@@ -5,9 +5,10 @@ import type { PropsWithChildren } from 'react';
55import { useEffect , useMemo , useState } from 'react' ;
66import { createPortal } from 'react-dom' ;
77
8- import { Flex , Link } from '../../customizables' ;
9- import { Portal } from '../../elements/Portal' ;
10- import { InternalThemeProvider } from '../../styledSystem' ;
8+ import { Flex , Link } from '../../../customizables' ;
9+ import { Portal } from '../../../elements/Portal' ;
10+ import { InternalThemeProvider } from '../../../styledSystem' ;
11+ import { basePromptElementStyles , PromptContainer } from '../shared' ;
1112import { ClerkLogoIcon } from './ClerkLogoIcon' ;
1213import { KeySlashIcon } from './KeySlashIcon' ;
1314import { useRevalidateEnvironment } from './use-revalidate-environment' ;
@@ -22,30 +23,6 @@ const buttonIdentifierPrefix = `--clerk-keyless-prompt`;
2223const buttonIdentifier = `${ buttonIdentifierPrefix } -button` ;
2324const contentIdentifier = `${ buttonIdentifierPrefix } -content` ;
2425
25- const baseElementStyles = css `
26- box-sizing : border-box;
27- padding : 0 ;
28- margin : 0 ;
29- background : none;
30- border : none;
31- line-height : 1.5 ;
32- font-family :
33- -apple-system,
34- BlinkMacSystemFont,
35- avenir next,
36- avenir,
37- segoe ui,
38- helvetica neue,
39- helvetica,
40- Cantarell,
41- Ubuntu,
42- roboto,
43- noto,
44- arial,
45- sans-serif;
46- text-decoration : none;
47- ` ;
48-
4926/**
5027 * If we cannot reconstruct the url properly, then simply fallback to Clerk Dashboard
5128 */
@@ -122,7 +99,7 @@ const KeylessPromptInternal = (_props: KeylessPromptProps) => {
12299 } , [ _props . copyKeysUrl ] ) ;
123100
124101 const mainCTAStyles = css `
125- ${ baseElementStyles } ;
102+ ${ basePromptElementStyles } ;
126103 dis play: flex;
127104 align- items: center;
128105 justify- content: center;
@@ -150,22 +127,9 @@ const KeylessPromptInternal = (_props: KeylessPromptProps) => {
150127
151128 return (
152129 < Portal >
153- < Flex
130+ < PromptContainer
154131 data-expanded = { isForcedExpanded }
155- sx = { t => ( {
156- position : 'fixed' ,
157- bottom : '1.25rem' ,
158- right : '1.25rem' ,
159- height : `${ t . sizes . $10 } ` ,
160- minWidth : '13.4rem' ,
161- paddingLeft : `${ t . space . $3 } ` ,
162- borderRadius : '1.25rem' ,
163- fontFamily : t . fonts . $main ,
164- background : 'linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 100%), #1f1f1f' ,
165- boxShadow :
166- '0px 0px 0px 0.5px #2F3037 inset, 0px 1px 0px 0px rgba(255, 255, 255, 0.08) inset, 0px 0px 0.8px 0.8px rgba(255, 255, 255, 0.20) inset, 0px 0px 0px 0px rgba(255, 255, 255, 0.72), 0px 16px 36px -6px rgba(0, 0, 0, 0.36), 0px 6px 16px -2px rgba(0, 0, 0, 0.20);' ,
167- transition : 'all 195ms cubic-bezier(0.2, 0.61, 0.1, 1)' ,
168-
132+ containerSx = { t => ( {
169133 '&[data-expanded="false"]:hover' : {
170134 background : 'linear-gradient(180deg, rgba(255, 255, 255, 0.20) 0%, rgba(255, 255, 255, 0) 100%), #1f1f1f' ,
171135 } ,
@@ -192,7 +156,7 @@ const KeylessPromptInternal = (_props: KeylessPromptProps) => {
192156 id = { buttonIdentifier }
193157 onClick = { ( ) => ! claimed && setIsExpanded ( prev => ! prev ) }
194158 css = { css `
195- ${ baseElementStyles } ;
159+ ${ basePromptElementStyles } ;
196160 width: 100%;
197161 dis play: flex;
198162 justify- content: space- between;
@@ -315,7 +279,7 @@ const KeylessPromptInternal = (_props: KeylessPromptProps) => {
315279 success ? 'Claim completed' : claimed ? 'Missing environment keys' : 'Clerk is in keyless mode'
316280 }
317281 css = { css `
318- ${ baseElementStyles } ;
282+ ${ basePromptElementStyles } ;
319283 color : # d9d9d9 ;
320284 font- size: 0.875rem;
321285 font- weight: 500;
@@ -381,7 +345,7 @@ const KeylessPromptInternal = (_props: KeylessPromptProps) => {
381345 >
382346 < p
383347 css = { css `
384- ${ baseElementStyles } ;
348+ ${ basePromptElementStyles } ;
385349 color : # b4b4b4 ;
386350 font- size: 0.8125rem;
387351 font- weight: 400;
@@ -532,7 +496,7 @@ const KeylessPromptInternal = (_props: KeylessPromptProps) => {
532496 target = '_blank'
533497 rel = 'noopener noreferrer'
534498 css = { css `
535- ${ baseElementStyles } ;
499+ ${ basePromptElementStyles } ;
536500 color : # ffffff9e ;
537501 font- size: 0.75rem;
538502 transition: color 120ms ease- out;
@@ -565,7 +529,7 @@ const KeylessPromptInternal = (_props: KeylessPromptProps) => {
565529 </ Flex >
566530 ) ) }
567531 </ Flex >
568- </ Flex >
532+ </ PromptContainer >
569533 < BodyPortal >
570534 < a
571535 href = { `#${ buttonIdentifier } ` }
0 commit comments