Skip to content

Commit 3022c61

Browse files
committed
implement reset
1 parent 10d39cd commit 3022c61

1 file changed

Lines changed: 80 additions & 0 deletions

File tree

  • packages/clerk-js/src/ui/components/devPrompts/KeylessPrompt

packages/clerk-js/src/ui/components/devPrompts/KeylessPrompt/index.tsx

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,33 @@ const WIDTH_CLOSED = '15rem';
542542
const DURATION_OPEN = '220ms';
543543
const DURATION_CLOSE = '180ms';
544544
const EASE_BEZIER = 'cubic-bezier(0.2, 0, 0, 1)';
545+
const CSS_RESET = css`
546+
margin: 0;
547+
padding: 0;
548+
box-sizing: border-box;
549+
background: none;
550+
border: none;
551+
font-family:
552+
-apple-system,
553+
BlinkMacSystemFont,
554+
avenir next,
555+
avenir,
556+
segoe ui,
557+
helvetica neue,
558+
helvetica,
559+
Cantarell,
560+
Ubuntu,
561+
roboto,
562+
noto,
563+
arial,
564+
sans-serif;
565+
font-size: 1rem;
566+
font-weight: 400;
567+
line-height: 1.5;
568+
text-decoration: none;
569+
color: inherit;
570+
appearance: none;
571+
`;
545572

546573
const getDuration = (isOpen: boolean) => (isOpen ? DURATION_OPEN : DURATION_CLOSE);
547574

@@ -552,6 +579,7 @@ function Keyless() {
552579
<div
553580
data-expanded={isOpen}
554581
css={css`
582+
${CSS_RESET};
555583
position: fixed;
556584
bottom: 1.25rem;
557585
right: 1.25rem;
@@ -598,6 +626,7 @@ function Keyless() {
598626
aria-expanded={isOpen}
599627
onClick={() => setIsOpen(p => !p)}
600628
css={css`
629+
${CSS_RESET};
601630
display: flex;
602631
align-items: center;
603632
width: 100%;
@@ -606,6 +635,8 @@ function Keyless() {
606635
gap: 0.25rem;
607636
height: 2.5rem;
608637
outline: none;
638+
cursor: pointer;
639+
user-select: none;
609640
`}
610641
>
611642
<svg
@@ -635,6 +666,7 @@ function Keyless() {
635666
</svg>
636667
<span
637668
css={css`
669+
${CSS_RESET};
638670
font-size: 0.875rem;
639671
font-weight: 500;
640672
color: #d9d9d9;
@@ -670,19 +702,22 @@ function Keyless() {
670702
<div
671703
id={id}
672704
css={css`
705+
${CSS_RESET};
673706
display: grid;
674707
grid-template-rows: ${isOpen ? '1fr' : '0fr'};
675708
transition: grid-template-rows ${getDuration(isOpen)} ${EASE_BEZIER};
676709
`}
677710
>
678711
<div
679712
css={css`
713+
${CSS_RESET};
680714
min-height: 0;
681715
overflow: hidden;
682716
`}
683717
>
684718
<div
685719
css={css`
720+
${CSS_RESET};
686721
width: ${WIDTH_OPEN};
687722
padding-inline: 0.75rem;
688723
padding-block-end: 0.75rem;
@@ -692,6 +727,7 @@ function Keyless() {
692727
>
693728
<p
694729
css={css`
730+
${CSS_RESET};
695731
color: #b4b4b4;
696732
font-size: 0.8125rem;
697733
font-weight: 400;
@@ -702,12 +738,52 @@ function Keyless() {
702738
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dignissimos qui laboriosam sit fugiat, ipsam
703739
animi minima neque alias mollitia expedita.
704740
</p>
741+
<ul
742+
css={css`
743+
${CSS_RESET};
744+
margin-top: 0.5rem;
745+
padding-inline-start: 1rem;
746+
list-style: disc;
747+
`}
748+
>
749+
{['Add SSO connections (eg. GitHub)', 'Set up B2B authentication', 'Enable MFA'].map(item => (
750+
<li
751+
key={item}
752+
css={css`
753+
${CSS_RESET};
754+
color: #b4b4b4;
755+
font-size: 0.8125rem;
756+
font-weight: 400;
757+
line-height: 1rem;
758+
&:not(:first-child) {
759+
margin-top: 0.25rem;
760+
}
761+
`}
762+
>
763+
{item}
764+
</li>
765+
))}
766+
</ul>
767+
<p
768+
css={css`
769+
${CSS_RESET};
770+
margin-top: 0.5rem;
771+
color: #b4b4b4;
772+
font-size: 0.8125rem;
773+
font-weight: 400;
774+
line-height: 1rem;
775+
`}
776+
>
777+
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dignissimos qui laboriosam sit fugiat, ipsam
778+
animi minima neque alias mollitia expedita.
779+
</p>
705780

706781
<a
707782
href='https://clerk.com/dashboard'
708783
target='_blank'
709784
rel='noopener noreferrer'
710785
css={css`
786+
${CSS_RESET};
711787
margin: 0.75rem 0 0;
712788
box-sizing: border-box;
713789
display: flex;
@@ -733,6 +809,10 @@ function Keyless() {
733809
0px 1.5px 2px 0px rgba(0, 0, 0, 0.48),
734810
0px 0px 4px 0px rgba(243, 107, 22, 0) inset;
735811
outline: none;
812+
&:hover {
813+
background: #4b4b4b;
814+
transition: background-color 120ms ease-in-out;
815+
}
736816
&:focus-visible {
737817
outline: 2px solid #6c47ff;
738818
outline-offset: 2px;

0 commit comments

Comments
 (0)