@obosbbl/grunnmuren-react 3.4.3 → 3.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__stories__/form-validation.stories.cjs +22 -23
- package/dist/__stories__/form-validation.stories.js +22 -23
- package/dist/__stories__/icons.stories.cjs +1 -1
- package/dist/__stories__/icons.stories.js +1 -1
- package/dist/__stories__/layout.stories.cjs +70 -37
- package/dist/__stories__/layout.stories.d.cts +2 -1
- package/dist/__stories__/layout.stories.d.ts +2 -1
- package/dist/__stories__/layout.stories.js +70 -38
- package/dist/__stories__/typography.stories.cjs +1 -1
- package/dist/__stories__/typography.stories.js +1 -1
- package/dist/index.d.mts +5 -3
- package/dist/index.mjs +124 -119
- package/package.json +10 -10
package/dist/index.mjs
CHANGED
|
@@ -95,7 +95,7 @@ const Footer = (props)=>/*#__PURE__*/ jsx("div", {
|
|
|
95
95
|
|
|
96
96
|
const disclosureButtonVariants = cva({
|
|
97
97
|
base: [
|
|
98
|
-
'inline-flex cursor-pointer items-center justify-between rounded-lg focus-visible:outline-current
|
|
98
|
+
'focus-visible:outline-focus inline-flex cursor-pointer items-center justify-between rounded-lg focus-visible:outline-current',
|
|
99
99
|
// Ensure a minimum click area of 44x44px, while making it look like it only has the size of the content
|
|
100
100
|
'p-2.5 focus-visible:outline-offset-[-0.625rem]',
|
|
101
101
|
'data-accordion:-m-2.5'
|
|
@@ -109,7 +109,7 @@ const disclosureButtonVariants = cva({
|
|
|
109
109
|
* When the button is without text, but with a single icon.
|
|
110
110
|
* @default false
|
|
111
111
|
*/ isIconOnly: {
|
|
112
|
-
true: '[&>svg]:
|
|
112
|
+
true: '[&>svg]:size-7',
|
|
113
113
|
false: 'gap-2.5'
|
|
114
114
|
}
|
|
115
115
|
},
|
|
@@ -270,7 +270,7 @@ function Accordion(props) {
|
|
|
270
270
|
child,
|
|
271
271
|
index < childCount - 1 && // Margin is added to enable support for containers with a background color
|
|
272
272
|
/*#__PURE__*/ jsx("hr", {
|
|
273
|
-
className: "
|
|
273
|
+
className: "border-gray-light mx-2",
|
|
274
274
|
"aria-hidden": true
|
|
275
275
|
})
|
|
276
276
|
]
|
|
@@ -300,7 +300,7 @@ function AccordionItem(props) {
|
|
|
300
300
|
level: 3,
|
|
301
301
|
_innerWrapper: (children)=>/*#__PURE__*/ jsx(DisclosureButton, {
|
|
302
302
|
// Use outline with offset as focus indicator, this does not cover the left sky border on the expanded content and works with or without a background color on the accordion container
|
|
303
|
-
className: "flex min-h-11 w-full gap-1.5 rounded-lg px-2 py-3.5 text-left
|
|
303
|
+
className: "focus-visible:outline-focus-inset! flex min-h-11 w-full gap-1.5 rounded-lg px-2 py-3.5 text-left",
|
|
304
304
|
type: "button",
|
|
305
305
|
withChevron: true,
|
|
306
306
|
id: buttonId,
|
|
@@ -394,21 +394,21 @@ const alertVariants = cva({
|
|
|
394
394
|
// Icon styles:
|
|
395
395
|
'[&:has([data-slot="heading"])>svg]:mt-0.5',
|
|
396
396
|
// Heading styles:
|
|
397
|
-
'**:data-[slot="heading"]:
|
|
397
|
+
'**:data-[slot="heading"]:text-base **:data-[slot="heading"]:leading-7 **:data-[slot="heading"]:font-medium',
|
|
398
398
|
// Content styles:
|
|
399
399
|
'**:data-[slot="content"]:text-sm **:data-[slot="content"]:leading-6 [&:has([data-slot="heading"])_[data-slot="content"]]:col-span-full',
|
|
400
400
|
// Footer styles:
|
|
401
|
-
'**:data-[slot="footer"]:col-span-full **:data-[slot="footer"]:
|
|
401
|
+
'**:data-[slot="footer"]:col-span-full **:data-[slot="footer"]:text-xs **:data-[slot="footer"]:leading-6 **:data-[slot="footer"]:font-light'
|
|
402
402
|
],
|
|
403
403
|
variants: {
|
|
404
404
|
/**
|
|
405
405
|
* The variant of the alert
|
|
406
406
|
* @default info
|
|
407
407
|
*/ variant: {
|
|
408
|
-
info: 'border-[#1A7FA7]
|
|
409
|
-
success: 'border-[#0F9B6E]
|
|
408
|
+
info: 'bg-sky-light border-[#1A7FA7]',
|
|
409
|
+
success: 'bg-mint-light border-[#0F9B6E]',
|
|
410
410
|
warning: 'border-[#C57C13] bg-[#FFF2DE]',
|
|
411
|
-
danger: 'border-[#C0385D]
|
|
411
|
+
danger: 'bg-red-light border-[#C0385D]'
|
|
412
412
|
}
|
|
413
413
|
},
|
|
414
414
|
defaultVariants: {
|
|
@@ -449,15 +449,15 @@ const Alertbox = ({ children, role, className, icon, variant = 'info', isDismiss
|
|
|
449
449
|
/*#__PURE__*/ jsx(Icon, {}),
|
|
450
450
|
firstChild,
|
|
451
451
|
isDismissable && /*#__PURE__*/ jsx("button", {
|
|
452
|
-
className: cx('-m-2 grid
|
|
452
|
+
className: cx('-m-2 grid size-11 place-items-center rounded-xl', 'focus-visible:outline-focus cursor-pointer focus-visible:-outline-offset-8'),
|
|
453
453
|
onClick: close,
|
|
454
454
|
"aria-label": translations$1.close[locale],
|
|
455
455
|
type: "button",
|
|
456
456
|
children: /*#__PURE__*/ jsx(Close, {})
|
|
457
457
|
}),
|
|
458
458
|
isExpandable && /*#__PURE__*/ jsxs("button", {
|
|
459
|
-
className: cx('
|
|
460
|
-
'outline-none after:absolute after:
|
|
459
|
+
className: cx('relative col-span-full row-start-2 -my-3 inline-flex max-w-fit cursor-pointer items-center gap-1 py-3 text-sm/6', // Focus styles:
|
|
460
|
+
'outline-none after:absolute after:inset-x-0 after:bottom-3 after:h-0', 'focus-visible:after:h-0.5 focus-visible:after:bg-black'),
|
|
461
461
|
onClick: ()=>setIsExpanded((prevState)=>!prevState),
|
|
462
462
|
"aria-expanded": isExpanded,
|
|
463
463
|
"aria-controls": id,
|
|
@@ -493,7 +493,7 @@ const Avatar = ({ src, alt = '', className, onError, loading = 'lazy', ...rest }
|
|
|
493
493
|
setHasError(true);
|
|
494
494
|
}
|
|
495
495
|
}) : /*#__PURE__*/ jsx("div", {
|
|
496
|
-
className: cx(className, baseClassName, '
|
|
496
|
+
className: cx(className, baseClassName, 'bg-gray-light text-gray-dark grid place-items-center'),
|
|
497
497
|
children: /*#__PURE__*/ jsx(User, {
|
|
498
498
|
className: "scale-[2.25]"
|
|
499
499
|
})
|
|
@@ -501,7 +501,7 @@ const Avatar = ({ src, alt = '', className, onError, loading = 'lazy', ...rest }
|
|
|
501
501
|
};
|
|
502
502
|
|
|
503
503
|
const formField = cx('group flex flex-col gap-2');
|
|
504
|
-
const formFieldError = cx('
|
|
504
|
+
const formFieldError = cx('bg-red-light text-red w-fit px-2 py-1 text-sm/6', 'group-data-[slot=file-upload]:rounded-lg');
|
|
505
505
|
const input = cva({
|
|
506
506
|
base: [
|
|
507
507
|
// All inputs should always have a white background (this also ensures that type="search" on Safri doesn't get a gray background)
|
|
@@ -510,7 +510,7 @@ const input = cva({
|
|
|
510
510
|
// Setting min-height to prevent the input from collapsing in Safari
|
|
511
511
|
// Combining these with a padding-y as base classes makes it easier to standardize the height (44px) of all inputs
|
|
512
512
|
'box-content min-h-6 py-2.5',
|
|
513
|
-
'rounded-md
|
|
513
|
+
'rounded-md text-base leading-6 font-normal placeholder-[#727070] ring-1 ring-black outline-hidden',
|
|
514
514
|
// invalid styles
|
|
515
515
|
'group-data-invalid:ring-focus group-data-invalid:ring-red',
|
|
516
516
|
// Fix invisible ring on safari: https://github.com/tailwindlabs/tailwindcss.com/issues/1135
|
|
@@ -519,12 +519,12 @@ const input = cva({
|
|
|
519
519
|
variants: {
|
|
520
520
|
// Focus rings. Can either be :focus or :focus-visible based on the needs of the particular component.
|
|
521
521
|
focusModifier: {
|
|
522
|
-
focus: 'focus:ring-focus group-data-invalid:focus:ring-
|
|
523
|
-
visible: 'data-focus-visible:ring-focus group-data-invalid:data-focus-visible:ring-
|
|
522
|
+
focus: 'focus:ring-focus group-data-invalid:focus:ring-red group-data-invalid:focus:ring-3',
|
|
523
|
+
visible: 'data-focus-visible:ring-focus group-data-invalid:data-focus-visible:ring-red group-data-invalid:data-focus-visible:ring-3'
|
|
524
524
|
},
|
|
525
525
|
isGrouped: {
|
|
526
526
|
false: 'px-3',
|
|
527
|
-
true: '
|
|
527
|
+
true: 'flex-1 ring-0!'
|
|
528
528
|
}
|
|
529
529
|
},
|
|
530
530
|
defaultVariants: {
|
|
@@ -533,11 +533,11 @@ const input = cva({
|
|
|
533
533
|
}
|
|
534
534
|
});
|
|
535
535
|
const inputGroup = cx([
|
|
536
|
-
'inline-flex items-center gap-3 overflow-hidden rounded-md bg-white px-3 text-base ring-1 ring-black
|
|
537
|
-
'group-data-invalid:ring-focus group-data-invalid:ring-red group-data-invalid:focus-within:ring-
|
|
536
|
+
'focus-within:ring-focus inline-flex items-center gap-3 overflow-hidden rounded-md bg-white px-3 text-base ring-1 ring-black',
|
|
537
|
+
'group-data-invalid:ring-focus group-data-invalid:ring-red group-data-invalid:focus-within:ring-red group-data-invalid:focus-within:ring-3'
|
|
538
538
|
]);
|
|
539
539
|
const dropdown = {
|
|
540
|
-
popover: cx('data-entering:fade-in data-exiting:fade-out min-w-(--trigger-width) overflow-y-auto rounded-md border border-black bg-white shadow-sm
|
|
540
|
+
popover: cx('data-entering:fade-in data-exiting:fade-out data-entering:animate-in data-exiting:animate-out min-w-(--trigger-width) overflow-y-auto rounded-md border border-black bg-white shadow-sm'),
|
|
541
541
|
// overflow-x-hidden is needed to prevent visible vertical scrollbars from overflowing the border radius of the popover
|
|
542
542
|
listbox: cx('max-h-100 overflow-x-hidden text-sm outline-hidden'),
|
|
543
543
|
chevronIcon: cx('text-base transition-transform duration-150 group-data-open:rotate-180 motion-reduce:transition-none')
|
|
@@ -550,7 +550,7 @@ const animateIconVariants = cva({
|
|
|
550
550
|
left: 'hover:*:[svg]:motion-safe:-translate-x-1',
|
|
551
551
|
down: 'hover:*:[svg]:motion-safe:translate-y-1',
|
|
552
552
|
up: 'hover:*:[svg]:motion-safe:-translate-y-1',
|
|
553
|
-
'up-right': 'hover:*:[svg]:motion-safe
|
|
553
|
+
'up-right': 'hover:*:[svg]:motion-safe:translate-x-0.5 hover:*:[svg]:motion-safe:-translate-y-0.5'
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
556
|
});
|
|
@@ -562,7 +562,7 @@ function Backlink(props) {
|
|
|
562
562
|
const { className, children, withUnderline, ref, ...restProps } = props;
|
|
563
563
|
const _className = cx(className, animateIconVariants({
|
|
564
564
|
animateIcon: 'left'
|
|
565
|
-
}), 'group flex max-w-fit cursor-pointer items-center gap-3 rounded-md p-2.5 font-normal no-underline
|
|
565
|
+
}), 'group focus-visible:outline-focus flex max-w-fit cursor-pointer items-center gap-3 rounded-md p-2.5 font-normal no-underline');
|
|
566
566
|
const content = /*#__PURE__*/ jsxs(Fragment, {
|
|
567
567
|
children: [
|
|
568
568
|
/*#__PURE__*/ jsx(ChevronLeft, {
|
|
@@ -570,7 +570,7 @@ function Backlink(props) {
|
|
|
570
570
|
}),
|
|
571
571
|
/*#__PURE__*/ jsx("span", {
|
|
572
572
|
children: /*#__PURE__*/ jsx("span", {
|
|
573
|
-
className: cx('border-
|
|
573
|
+
className: cx('border-y border-transparent transition-colors duration-300', withUnderline ? 'border-b-black' : 'group-hover:border-b-black'),
|
|
574
574
|
children: children
|
|
575
575
|
})
|
|
576
576
|
})
|
|
@@ -606,9 +606,9 @@ const badgeVariants = cva({
|
|
|
606
606
|
'green-dark': 'bg-green-dark text-white'
|
|
607
607
|
},
|
|
608
608
|
size: {
|
|
609
|
-
small: 'description px-2 py-0.5 [&_svg]:
|
|
610
|
-
medium: 'description px-2.5 py-1.5 [&_svg]:
|
|
611
|
-
large: 'paragraph px-3 py-2 [&_svg]:
|
|
609
|
+
small: 'description px-2 py-0.5 [&_svg]:size-4',
|
|
610
|
+
medium: 'description px-2.5 py-1.5 [&_svg]:size-4',
|
|
611
|
+
large: 'paragraph px-3 py-2 [&_svg]:size-5'
|
|
612
612
|
}
|
|
613
613
|
},
|
|
614
614
|
defaultVariants: {
|
|
@@ -630,7 +630,7 @@ function Badge(props) {
|
|
|
630
630
|
}
|
|
631
631
|
|
|
632
632
|
const linkVariants = compose(animateIconVariants, cva({
|
|
633
|
-
base: 'inline-flex cursor-pointer items-center gap-1 font-medium hover:no-underline focus-visible:outline-current
|
|
633
|
+
base: 'focus-visible:outline-focus-offset inline-flex cursor-pointer items-center gap-1 font-medium hover:no-underline focus-visible:outline-current data-disabled:cursor-default data-disabled:font-normal data-disabled:no-underline'
|
|
634
634
|
}));
|
|
635
635
|
const Link = ({ animateIcon, children, className, '~iconRight': iconRight, ...props })=>{
|
|
636
636
|
const locale = _useLocale();
|
|
@@ -662,7 +662,7 @@ function Breadcrumb(props) {
|
|
|
662
662
|
href ? /*#__PURE__*/ jsx(Link, {
|
|
663
663
|
href: href,
|
|
664
664
|
// use outline instead of ring-3 for focus marker that can be offset without creating a white background between the focus marker and the element content
|
|
665
|
-
className: "rounded-xs font-normal
|
|
665
|
+
className: "focus-visible:outline-focus rounded-xs font-normal group-last:no-underline hover:underline",
|
|
666
666
|
children: children
|
|
667
667
|
}) : children,
|
|
668
668
|
/*#__PURE__*/ jsx(ChevronRight, {
|
|
@@ -676,7 +676,7 @@ function Breadcrumbs(props) {
|
|
|
676
676
|
const { className, children, ...restProps } = props;
|
|
677
677
|
return /*#__PURE__*/ jsx(Breadcrumbs$1, {
|
|
678
678
|
...restProps,
|
|
679
|
-
className: cx(className, 'flex flex-wrap text-sm
|
|
679
|
+
className: cx(className, 'flex flex-wrap text-sm/6'),
|
|
680
680
|
children: children
|
|
681
681
|
});
|
|
682
682
|
}
|
|
@@ -685,7 +685,7 @@ function Breadcrumbs(props) {
|
|
|
685
685
|
* Figma: https://www.figma.com/file/9OvSg0ZXI5E1eQYi7AWiWn/Grunnmuren-2.0-%E2%94%82-Designsystem?node-id=30%3A2574&mode=dev
|
|
686
686
|
*/ const buttonVariants = compose(animateIconVariants, cva({
|
|
687
687
|
base: [
|
|
688
|
-
'inline-flex min-h-[44px] cursor-pointer items-center justify-center
|
|
688
|
+
'focus-visible:outline-focus-offset inline-flex min-h-[44px] cursor-pointer items-center justify-center rounded-lg font-medium whitespace-nowrap transition-colors duration-200'
|
|
689
689
|
],
|
|
690
690
|
variants: {
|
|
691
691
|
/**
|
|
@@ -709,7 +709,7 @@ function Breadcrumbs(props) {
|
|
|
709
709
|
* When the button is without text, but with a single icon.
|
|
710
710
|
* @default false
|
|
711
711
|
*/ isIconOnly: {
|
|
712
|
-
true: 'p-2 [&>svg]:
|
|
712
|
+
true: 'p-2 [&>svg]:size-7',
|
|
713
713
|
false: 'gap-2.5 px-4 py-2'
|
|
714
714
|
},
|
|
715
715
|
// Make the content of the button transparent to hide it's content, but keep the button width
|
|
@@ -723,48 +723,48 @@ function Breadcrumbs(props) {
|
|
|
723
723
|
color: 'blue',
|
|
724
724
|
variant: 'primary',
|
|
725
725
|
// Darken bg by 20% on hover. The color is manually crafted
|
|
726
|
-
className: 'bg-blue-dark
|
|
726
|
+
className: 'bg-blue-dark hover:bg-blue text-white active:bg-[#0536A0] active:text-white **:[[role="progressbar"]]:text-white'
|
|
727
727
|
},
|
|
728
728
|
{
|
|
729
729
|
color: 'blue',
|
|
730
730
|
variant: 'secondary',
|
|
731
|
-
className: 'text-blue-dark hover:
|
|
731
|
+
className: 'text-blue-dark hover:bg-blue hover:text-blue-dark **:[[role="progressbar"]]:text-blue-dark hover:border-transparent hover:text-white active:bg-[#0536A0] [&:hover_[role="progressbar"]]:text-white'
|
|
732
732
|
},
|
|
733
733
|
{
|
|
734
734
|
color: 'blue',
|
|
735
735
|
variant: 'tertiary',
|
|
736
|
-
className: '[
|
|
736
|
+
className: '**:[[role="progressbar"]]:text-black'
|
|
737
737
|
},
|
|
738
738
|
{
|
|
739
739
|
color: 'mint',
|
|
740
740
|
variant: 'primary',
|
|
741
741
|
// Darken bg by 20% on hover. The color is manually crafted
|
|
742
|
-
className: 'bg-mint text-black hover:bg-[#8dd4bd]
|
|
742
|
+
className: 'bg-mint active:[#9ddac6] text-black hover:bg-[#8dd4bd] **:[[role="progressbar"]]:text-black'
|
|
743
743
|
},
|
|
744
744
|
{
|
|
745
745
|
color: 'mint',
|
|
746
746
|
variant: 'secondary',
|
|
747
|
-
className: 'text-mint hover:bg-mint
|
|
747
|
+
className: 'text-mint hover:bg-mint **:[[role="progressbar"]]:text-mint hover:text-black [&:hover_[role="progressbar"]]:text-black'
|
|
748
748
|
},
|
|
749
749
|
{
|
|
750
750
|
color: 'mint',
|
|
751
751
|
variant: 'tertiary',
|
|
752
|
-
className: 'text-mint [
|
|
752
|
+
className: 'text-mint **:[[role="progressbar"]]:text-mint'
|
|
753
753
|
},
|
|
754
754
|
{
|
|
755
755
|
color: 'white',
|
|
756
756
|
variant: 'primary',
|
|
757
|
-
className: '
|
|
757
|
+
className: 'hover:bg-sky active:bg-sky-light bg-white text-black **:[[role="progressbar"]]:text-black'
|
|
758
758
|
},
|
|
759
759
|
{
|
|
760
760
|
color: 'white',
|
|
761
761
|
variant: 'secondary',
|
|
762
|
-
className: 'text-white hover:bg-white hover:text-black [&:hover_[role="progressbar"]]:text-black [
|
|
762
|
+
className: 'text-white hover:bg-white hover:text-black [&:hover_[role="progressbar"]]:text-black **:[[role="progressbar"]]:text-white'
|
|
763
763
|
},
|
|
764
764
|
{
|
|
765
765
|
color: 'white',
|
|
766
766
|
variant: 'tertiary',
|
|
767
|
-
className: 'text-white [
|
|
767
|
+
className: 'text-white **:[[role="progressbar"]]:text-white'
|
|
768
768
|
}
|
|
769
769
|
],
|
|
770
770
|
defaultVariants: {
|
|
@@ -845,7 +845,7 @@ const cardVariants = cva({
|
|
|
845
845
|
// **** Fail-safe for interactive elements ****
|
|
846
846
|
// Make interactive elements clickable by themselves, while the rest of the card is clickable as a whole
|
|
847
847
|
// The card is made clickable by a pseudo-element on the heading that covers the entire card
|
|
848
|
-
'[&:not(:has([data-slot="card-link"]_a))_a:not([data-slot="card-link"])]:relative
|
|
848
|
+
'[&_button]:relative [&_input]:relative [&:not(:has([data-slot="card-link"]_a))_a:not([data-slot="card-link"])]:relative',
|
|
849
849
|
// Our Button component has position: relative by default, so we need to override that if it is used in a CardLink (to make the entire card clickable)
|
|
850
850
|
'[&_[data-slot="card-link"]_a]:static',
|
|
851
851
|
// Place other interactive on top of the pseudo-element that makes the entire card clickable
|
|
@@ -876,7 +876,7 @@ const cardVariants = cva({
|
|
|
876
876
|
subtle: [
|
|
877
877
|
'border-transparent',
|
|
878
878
|
// **** Media styles ****
|
|
879
|
-
'
|
|
879
|
+
'**:data-[slot="media"]:rounded-2xl'
|
|
880
880
|
],
|
|
881
881
|
outlined: 'border border-black'
|
|
882
882
|
},
|
|
@@ -887,7 +887,7 @@ const cardVariants = cva({
|
|
|
887
887
|
vertical: [
|
|
888
888
|
'flex-col',
|
|
889
889
|
// **** Media ****
|
|
890
|
-
'
|
|
890
|
+
'**:data-[slot="media"]:rounded-t-2xl'
|
|
891
891
|
],
|
|
892
892
|
horizontal: [
|
|
893
893
|
// Use more gap for horizontal cards that have media
|
|
@@ -895,7 +895,7 @@ const cardVariants = cva({
|
|
|
895
895
|
'has-data-[slot=media]:layout-gap-x not-has-data-[slot=media]:gap-x-4',
|
|
896
896
|
// **** With Media ****
|
|
897
897
|
'[&:has(>[data-slot="media"]:last-child)]:flex-col-reverse',
|
|
898
|
-
'has-data-[slot=media]:@2xl
|
|
898
|
+
'has-data-[slot=media]:@2xl:flex-row!',
|
|
899
899
|
'*:data-[slot=media]:@2xl:h-fit',
|
|
900
900
|
'has-data-[slot=media]:*:@2xl:basis-1/2',
|
|
901
901
|
// Position media at the edges of the card
|
|
@@ -904,7 +904,7 @@ const cardVariants = cva({
|
|
|
904
904
|
'*:data-[slot=media]:last:@2xl:ml-0',
|
|
905
905
|
// Make sure the card link is clickable when the media is on the right side
|
|
906
906
|
// This is necessary because the media content is positioned after the card link in the DOM
|
|
907
|
-
'[&:has(>[data-slot="media"]:last-child)_[data-slot="card-link"]]:z-
|
|
907
|
+
'[&:has(>[data-slot="media"]:last-child)_[data-slot="card-link"]]:z-1',
|
|
908
908
|
// **** Without Media ****
|
|
909
909
|
'not-has-data-[slot=media]:@md:flex-row',
|
|
910
910
|
// Make the layout responsive: when the Content reaches a minimum width of 12rem, the layout switches to vertical. Also makes sure Content takes up the remaining space available.
|
|
@@ -925,7 +925,7 @@ const cardVariants = cva({
|
|
|
925
925
|
className: [
|
|
926
926
|
// **** Media ****
|
|
927
927
|
// Some rounded corners are removed when the card is outlined
|
|
928
|
-
'
|
|
928
|
+
'**:data-[slot="media"]:rounded-t-2xl',
|
|
929
929
|
'*:data-[slot=media]:first:@2xl:rounded-tr-none *:data-[slot=media]:first:@2xl:rounded-bl-2xl',
|
|
930
930
|
'*:data-[slot=media]:last:@2xl:rounded-tl-none *:data-[slot=media]:last:@2xl:rounded-br-2xl',
|
|
931
931
|
// **** Badge ****
|
|
@@ -990,8 +990,8 @@ const cardLinkVariants = cva({
|
|
|
990
990
|
// **** Clickarea ****
|
|
991
991
|
'cursor-pointer',
|
|
992
992
|
'after:absolute',
|
|
993
|
-
'after
|
|
994
|
-
'after:rounded-[calc(
|
|
993
|
+
'after:-inset-px',
|
|
994
|
+
'after:rounded-[calc(var(--radius-2xl)-theme(borderWidth.DEFAULT))]',
|
|
995
995
|
// **** Focus ****
|
|
996
996
|
'focus-visible:outline-none',
|
|
997
997
|
'data-focus-visible:after:outline-focus',
|
|
@@ -1005,8 +1005,8 @@ const cardLinkVariants = cva({
|
|
|
1005
1005
|
// **** Clickarea ****
|
|
1006
1006
|
'[&_a]:after:cursor-pointer',
|
|
1007
1007
|
'[&_a]:after:absolute',
|
|
1008
|
-
'[&_a]:after
|
|
1009
|
-
'[&_a]:after:rounded-[calc(
|
|
1008
|
+
'[&_a]:after:-inset-px',
|
|
1009
|
+
'[&_a]:after:rounded-[calc(var(--radius-2xl)-theme(borderWidth.DEFAULT))]',
|
|
1010
1010
|
// **** Focus ****
|
|
1011
1011
|
'[&_a[data-focus-visible]]:outline-none',
|
|
1012
1012
|
'[&_a[data-focus-visible]]:after:outline-focus',
|
|
@@ -1047,20 +1047,20 @@ const HeroContext = /*#__PURE__*/ createContext(null);
|
|
|
1047
1047
|
// Common variant for "standard" and "full-bleed" Hero variants
|
|
1048
1048
|
const oneColumnLayout = [
|
|
1049
1049
|
// Vertical spacing in the <Content>
|
|
1050
|
-
'lg:*:data-[slot=
|
|
1050
|
+
'lg:*:data-[slot=content]:gap-y-4',
|
|
1051
1051
|
// Main text content takes up 9 columns on medium screens and above
|
|
1052
|
-
'lg:*:data-[slot=
|
|
1052
|
+
'lg:*:data-[slot=content]:col-span-9',
|
|
1053
1053
|
// Make sure other elements than <Content> and <Media> (i.e CTA) does not span the full width on small screens
|
|
1054
|
-
'*:not-data-[slot=
|
|
1054
|
+
'*:not-data-[slot=content]:not-data-[slot=media]:w-fit',
|
|
1055
1055
|
// Other elements than <Content> and <Media> (e.g. CTA, SVG logo or Badge) take up 3 columns on medium screens and above, and are right aligned
|
|
1056
|
-
'lg:*:not-data-[slot=
|
|
1056
|
+
'lg:*:not-data-[slot=content]:not-data-[slot=media]:not-data-[slot=carousel]:col-span-3 lg:*:not-data-[slot=content]:not-data-[slot=media]:justify-self-end',
|
|
1057
1057
|
// <Media> and <Carousel> content takes up the full width on medium screens and above
|
|
1058
|
-
'lg:*:data-[slot=
|
|
1059
|
-
'lg:*:data-[slot=
|
|
1058
|
+
'lg:*:data-[slot=media]:col-span-full *:data-[slot=media]:*:w-full',
|
|
1059
|
+
'lg:*:data-[slot=carousel]:col-span-full',
|
|
1060
1060
|
// Aligns <Content> and any element beside it (e.g. <Media>, <Badge>, <CTA> etc.) to the bottom of the <Content> container
|
|
1061
1061
|
'lg:items-end'
|
|
1062
1062
|
];
|
|
1063
|
-
const nonFullBleedAspectRatiosForSmallScreens = '*:data-[slot=
|
|
1063
|
+
const nonFullBleedAspectRatiosForSmallScreens = '*:data-[slot=media]:not-has-data-[slot=video]:*:aspect-[1/1] sm:*:data-[slot=media]:not-has-data-[slot=video]:*:aspect-4/3 md:*:data-[slot=media]:not-has-data-[slot=video]:*:aspect-3/2';
|
|
1064
1064
|
const variants = cva({
|
|
1065
1065
|
base: [
|
|
1066
1066
|
'container px-0',
|
|
@@ -1068,14 +1068,14 @@ const variants = cva({
|
|
|
1068
1068
|
'grid lg:grid-cols-12 lg:gap-x-12 xl:gap-x-16',
|
|
1069
1069
|
'gap-y-10 lg:gap-y-12',
|
|
1070
1070
|
// Enable vertical gap within <Content>
|
|
1071
|
-
'*:data-[slot=
|
|
1071
|
+
'*:data-[slot=content]:grid',
|
|
1072
1072
|
// Vertical spacing in the <Content>
|
|
1073
|
-
'*:data-[slot=
|
|
1073
|
+
'*:data-[slot=content]:gap-y-3',
|
|
1074
1074
|
// Make sure <Media> content fills any available vertical and horizontal space
|
|
1075
|
-
'*:data-[slot=
|
|
1076
|
-
'*:data-[slot=
|
|
1075
|
+
'*:data-[slot=media]:*:object-cover',
|
|
1076
|
+
'*:data-[slot=carousel]:overflow-hidden *:data-[slot=carousel]:rounded-3xl',
|
|
1077
1077
|
// Make the carousel items full width, so we scroll one at a time
|
|
1078
|
-
'**:data-[slot=
|
|
1078
|
+
'**:data-[slot=carousel-item]:basis-full'
|
|
1079
1079
|
],
|
|
1080
1080
|
variants: {
|
|
1081
1081
|
/**
|
|
@@ -1085,36 +1085,36 @@ const variants = cva({
|
|
|
1085
1085
|
standard: [
|
|
1086
1086
|
oneColumnLayout,
|
|
1087
1087
|
nonFullBleedAspectRatiosForSmallScreens,
|
|
1088
|
-
'lg:*:data-[slot=
|
|
1088
|
+
'lg:*:data-[slot=media]:not-has-data-[slot=video]:*:aspect-2/1'
|
|
1089
1089
|
],
|
|
1090
1090
|
'full-bleed': [
|
|
1091
1091
|
oneColumnLayout,
|
|
1092
1092
|
// Position the media and carousel content to fill the entire viewport width
|
|
1093
|
-
'*:data-[slot=
|
|
1093
|
+
'*:data-[slot=media]:*:absolute *:data-[slot=media]:*:left-0',
|
|
1094
1094
|
// Special case for Carousel, where the Media is nested inside a CarouselItem
|
|
1095
|
-
'*:data-[slot=
|
|
1095
|
+
'*:data-[slot=carousel]:**:data-[slot=media]:w-full',
|
|
1096
1096
|
// Match the heights of the <Media> or <Carousel> wrapper for the Media content (e.g. image, VideoLoop, video etc.)
|
|
1097
1097
|
// This is necessary due to the absolute positioning of the media and carousel containers in this variant
|
|
1098
1098
|
// biome-ignore lint/nursery/useSortedClasses: biome is unable to sort the custom classes for 3xl and 4xl breakpoints
|
|
1099
|
-
'
|
|
1100
|
-
'**:data-[slot=
|
|
1099
|
+
'3xl:**:data-[slot=media]:h-192 4xl:**:data-[slot=media]:h-212 **:data-[slot=media]:h-80 sm:**:data-[slot=media]:h-100 md:**:data-[slot=media]:h-120 lg:**:data-[slot=media]:h-140 xl:**:data-[slot=media]:h-160 2xl:**:data-[slot=media]:h-168',
|
|
1100
|
+
'**:data-[slot=media]:*:h-[inherit]',
|
|
1101
1101
|
// biome-ignore lint/nursery/useSortedClasses: biome is unable to sort the custom classes for 3xl and 4xl breakpoints
|
|
1102
|
-
'
|
|
1103
|
-
'*:data-[slot=
|
|
1102
|
+
'3xl:*:data-[slot=carousel]:h-192 4xl:*:data-[slot=carousel]:h-212 *:data-[slot=carousel]:h-80 sm:*:data-[slot=carousel]:h-100 md:*:data-[slot=carousel]:h-120 lg:*:data-[slot=carousel]:h-140 xl:*:data-[slot=carousel]:h-160 2xl:*:data-[slot=carousel]:h-168',
|
|
1103
|
+
'*:data-[slot=carousel]:w-full!',
|
|
1104
1104
|
// Override aspect ratio of the media and carousel-item slots (since we can not use aspect for full-bleed layout)
|
|
1105
|
-
'**:data-[slot=
|
|
1105
|
+
'**:data-[slot=carousel-item]:data-[slot=media]:*:aspect-none',
|
|
1106
1106
|
// break out the carousel out of the container
|
|
1107
|
-
'**:data-[slot=
|
|
1107
|
+
'**:data-[slot=carousel-items-container]:absolute **:data-[slot=carousel-items-container]:inset-x-0 **:data-[slot=carousel-items-container]:h-[inherit]',
|
|
1108
1108
|
// Positions the carousel controls inside the carousel
|
|
1109
|
-
'
|
|
1109
|
+
'*:data-[slot=carousel]:flex *:data-[slot=carousel]:items-end *:data-[slot=carousel]:justify-end **:data-[slot=carousel-controls]:z-10 **:data-[slot=carousel-controls]:mb-4'
|
|
1110
1110
|
],
|
|
1111
1111
|
'two-column': [
|
|
1112
1112
|
'lg:items-center lg:*:col-span-6',
|
|
1113
1113
|
// Vertical spacing in the <Content>
|
|
1114
|
-
'lg:*:data-[slot=
|
|
1114
|
+
'lg:*:data-[slot=content]:gap-y-7',
|
|
1115
1115
|
nonFullBleedAspectRatiosForSmallScreens,
|
|
1116
1116
|
// Set media aspect ratio to 1:1 (square)
|
|
1117
|
-
'lg:*:data-[slot=
|
|
1117
|
+
'lg:*:data-[slot=media]:not-has-data-[slot=video]:*:aspect-square'
|
|
1118
1118
|
]
|
|
1119
1119
|
}
|
|
1120
1120
|
},
|
|
@@ -1125,8 +1125,8 @@ const variants = cva({
|
|
|
1125
1125
|
'two-column'
|
|
1126
1126
|
],
|
|
1127
1127
|
className: [
|
|
1128
|
-
'*:data-[slot=
|
|
1129
|
-
'
|
|
1128
|
+
'*:data-[slot=media]:*:rounded-3xl',
|
|
1129
|
+
'*:data-[slot=carousel]:relative **:data-[slot=carousel-container]:rounded-3xl **:data-[slot=carousel-controls]:absolute **:data-[slot=carousel-controls]:right-4 **:data-[slot=carousel-controls]:bottom-4'
|
|
1130
1130
|
]
|
|
1131
1131
|
}
|
|
1132
1132
|
],
|
|
@@ -1369,7 +1369,7 @@ const Carousel = ({ autoPlayDelay, align = 'center', children, initialIndex = 0,
|
|
|
1369
1369
|
} : {
|
|
1370
1370
|
variant: 'tertiary'
|
|
1371
1371
|
};
|
|
1372
|
-
return(//
|
|
1372
|
+
return(// oxlint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
1373
1373
|
/*#__PURE__*/ jsx("div", {
|
|
1374
1374
|
...rest,
|
|
1375
1375
|
"data-orientation": orientation,
|
|
@@ -1470,7 +1470,7 @@ const carouselButtonIconSlotVariants = cva({
|
|
|
1470
1470
|
{
|
|
1471
1471
|
slot: 'prev',
|
|
1472
1472
|
orientation: 'horizontal',
|
|
1473
|
-
className: 'group-hover:motion-safe:-translate-x-1
|
|
1473
|
+
className: 'rotate-180 group-hover:motion-safe:-translate-x-1'
|
|
1474
1474
|
},
|
|
1475
1475
|
// vertical controls
|
|
1476
1476
|
{
|
|
@@ -1481,7 +1481,7 @@ const carouselButtonIconSlotVariants = cva({
|
|
|
1481
1481
|
{
|
|
1482
1482
|
slot: 'prev',
|
|
1483
1483
|
orientation: 'vertical',
|
|
1484
|
-
className: 'group-hover:motion-safe:-translate-y-1
|
|
1484
|
+
className: '-rotate-90 group-hover:motion-safe:-translate-y-1'
|
|
1485
1485
|
}
|
|
1486
1486
|
]
|
|
1487
1487
|
});
|
|
@@ -1532,7 +1532,7 @@ function ErrorMessage(props) {
|
|
|
1532
1532
|
}
|
|
1533
1533
|
|
|
1534
1534
|
const defaultClasses$1 = cx([
|
|
1535
|
-
'group -mx-2.5
|
|
1535
|
+
'group relative left-0 -mx-2.5 inline-flex max-w-fit cursor-pointer items-start gap-4 p-2.5 leading-7'
|
|
1536
1536
|
]);
|
|
1537
1537
|
// Pulling this out into it's own component. Will probably export it in the future
|
|
1538
1538
|
// so it can be used in other views, outside of an input of type checkbox, like in table rows.
|
|
@@ -1544,7 +1544,7 @@ function CheckmarkBox() {
|
|
|
1544
1544
|
// For the ::before psuedo element the line height of the label is always 1em.
|
|
1545
1545
|
// When we know the height of the label we use the height of the radio to push it down to align with the label's first line
|
|
1546
1546
|
// TODO: 1.75 here is the unit less lineheight, altough we use 1.75rem as the line height, so there is a mismatch here. Revisit this when we've worked on typography in v2. Should this be a CSS custom property instead?
|
|
1547
|
-
'mt-[calc((
|
|
1547
|
+
'mt-[calc((1em*1.75-24px)/2)] h-[24px] w-[24px]',
|
|
1548
1548
|
// selected
|
|
1549
1549
|
'group-data-selected:group-not-data-hovered:group-not-data-invalid:border-blue group-data-selected:group-not-data-hovered:group-not-data-invalid:bg-blue',
|
|
1550
1550
|
'group-data-selected:group-not-data-hovered:group-data-invalid:border-red group-data-selected:group-not-data-hovered:group-data-invalid:bg-red',
|
|
@@ -1558,10 +1558,10 @@ function CheckmarkBox() {
|
|
|
1558
1558
|
'group-data-hovered:group-data-selected:group-not-data-invalid:bg-blue-dark',
|
|
1559
1559
|
// invalid - The border is 1 px thicker when invalid. We don't actually want to change the border width, as that causes the element's size to change
|
|
1560
1560
|
// so we use an inner shadow of 1 px instead to pad the actual border
|
|
1561
|
-
'group-data-invalid:border-red group-data-invalid:shadow-
|
|
1561
|
+
'group-data-invalid:border-red group-data-invalid:shadow-red group-data-invalid:shadow-[inset_0_0_0_1px]'
|
|
1562
1562
|
]),
|
|
1563
1563
|
children: /*#__PURE__*/ jsx(Check, {
|
|
1564
|
-
className: "
|
|
1564
|
+
className: "group-data-invalid:group-data-hovered:group-data-selected:text-red size-full opacity-0 group-data-selected:opacity-100"
|
|
1565
1565
|
})
|
|
1566
1566
|
});
|
|
1567
1567
|
}
|
|
@@ -1627,7 +1627,7 @@ function Description(props) {
|
|
|
1627
1627
|
function Label(props) {
|
|
1628
1628
|
const { children, className, ...restProps } = props;
|
|
1629
1629
|
return /*#__PURE__*/ jsx(Label$1, {
|
|
1630
|
-
className: cx(className, 'font-medium
|
|
1630
|
+
className: cx(className, 'leading-7 font-medium'),
|
|
1631
1631
|
...restProps,
|
|
1632
1632
|
children: children
|
|
1633
1633
|
});
|
|
@@ -1678,7 +1678,7 @@ const ListBoxItem = (props)=>{
|
|
|
1678
1678
|
}
|
|
1679
1679
|
return /*#__PURE__*/ jsx(ListBoxItem$1, {
|
|
1680
1680
|
...props,
|
|
1681
|
-
className: cx(props.className, 'flex cursor-pointer px-6 py-3 leading-6 outline-none
|
|
1681
|
+
className: cx(props.className, 'data-focused:bg-sky-lightest flex cursor-pointer px-6 py-3 leading-6 outline-none'),
|
|
1682
1682
|
textValue: textValue,
|
|
1683
1683
|
children: ({ isSelected })=>/*#__PURE__*/ jsxs(Fragment, {
|
|
1684
1684
|
children: [
|
|
@@ -1702,7 +1702,7 @@ const ListBoxItem = (props)=>{
|
|
|
1702
1702
|
* This component can be used to label grouped items in a `ListBoxSection` with a heading
|
|
1703
1703
|
*/ const ListBoxHeader = (props)=>/*#__PURE__*/ jsx(Header, {
|
|
1704
1704
|
...props,
|
|
1705
|
-
className: cx(props.className, 'mx-6 cursor-default py-2 font-medium
|
|
1705
|
+
className: cx(props.className, 'text-blue-dark mx-6 cursor-default py-2 leading-6 font-medium')
|
|
1706
1706
|
});
|
|
1707
1707
|
|
|
1708
1708
|
function Combobox(props) {
|
|
@@ -2047,7 +2047,7 @@ const FileUpload = ({ children, files: _files, onChange, validate, isInvalid: _i
|
|
|
2047
2047
|
className: "flex items-center gap-3",
|
|
2048
2048
|
children: [
|
|
2049
2049
|
/*#__PURE__*/ jsx("div", {
|
|
2050
|
-
className: "footnote
|
|
2050
|
+
className: "footnote border-gray-light bg-gray-lightest rounded-md border px-2.5 py-2",
|
|
2051
2051
|
children: getFileExtension(file)
|
|
2052
2052
|
}),
|
|
2053
2053
|
/*#__PURE__*/ jsxs("div", {
|
|
@@ -2068,8 +2068,8 @@ const FileUpload = ({ children, files: _files, onChange, validate, isInvalid: _i
|
|
|
2068
2068
|
/*#__PURE__*/ jsx("button", {
|
|
2069
2069
|
type: "button",
|
|
2070
2070
|
"aria-label": translations.remove[locale],
|
|
2071
|
-
className: cx('-m-2 grid
|
|
2072
|
-
'focus-visible
|
|
2071
|
+
className: cx('-m-2 grid size-11 shrink-0 cursor-pointer place-items-center rounded-xl', // Focus styles
|
|
2072
|
+
'focus-visible:outline-focus focus-visible:-outline-offset-8'),
|
|
2073
2073
|
onClick: ()=>{
|
|
2074
2074
|
// For controlled component
|
|
2075
2075
|
onChange?.((prevFiles)=>prevFiles.filter((_, index)=>index !== fileIndex));
|
|
@@ -2173,7 +2173,7 @@ const LinkListItem = ({ children, className, ...props })=>{
|
|
|
2173
2173
|
const iconRight = childProps['~iconRight'] || childProps.download ? /*#__PURE__*/ jsx(Download, {}) : childProps.rel?.includes('external') ? /*#__PURE__*/ jsx(LinkExternal, {}) : /*#__PURE__*/ jsx(ArrowRight, {});
|
|
2174
2174
|
return /*#__PURE__*/ jsx("li", {
|
|
2175
2175
|
...props,
|
|
2176
|
-
className: cx(className, 'after
|
|
2176
|
+
className: cx(className, 'after:bg-gray-light relative p-1.25 after:absolute after:inset-x-0 after:-top-px after:h-px after:w-full', '*:data-[slot=link]:paragraph', ...linkStyles),
|
|
2177
2177
|
"data-slot": "link-list-item",
|
|
2178
2178
|
children: /*#__PURE__*/ isValidElement(child) && /*#__PURE__*/ cloneElement(child, {
|
|
2179
2179
|
animateIcon,
|
|
@@ -2212,7 +2212,7 @@ const Modal = ({ isDismissable = true, isOpen, onOpenChange, defaultOpen, classN
|
|
|
2212
2212
|
isDismissable && /*#__PURE__*/ jsx(Button, {
|
|
2213
2213
|
slot: "close",
|
|
2214
2214
|
variant: "tertiary",
|
|
2215
|
-
className: "
|
|
2215
|
+
className: "data-focus-visible:outline-focus-inset px-2.5!",
|
|
2216
2216
|
"aria-label": translations$1.close[locale],
|
|
2217
2217
|
onPress: ()=>onOpenChange?.(false),
|
|
2218
2218
|
children: /*#__PURE__*/ jsx(Close, {})
|
|
@@ -2241,7 +2241,7 @@ const Modal = ({ isDismissable = true, isOpen, onOpenChange, defaultOpen, classN
|
|
|
2241
2241
|
const Dialog = ({ className, children, ...restProps })=>/*#__PURE__*/ jsx(Dialog$1, {
|
|
2242
2242
|
...restProps,
|
|
2243
2243
|
className: cx(className, 'relative grid gap-y-5 outline-none', // Footer
|
|
2244
|
-
'
|
|
2244
|
+
'**:data-[slot="footer"]:flex **:data-[slot="footer"]:gap-x-2'),
|
|
2245
2245
|
children: ({ close })=>/*#__PURE__*/ jsx(Provider, {
|
|
2246
2246
|
values: [
|
|
2247
2247
|
[
|
|
@@ -2330,23 +2330,23 @@ function NumberField(props) {
|
|
|
2330
2330
|
}
|
|
2331
2331
|
|
|
2332
2332
|
const defaultClasses = cx([
|
|
2333
|
-
'-ml-2.5
|
|
2333
|
+
'relative -ml-2.5 inline-flex max-w-fit cursor-pointer items-start gap-4 py-2.5 pl-2.5 leading-7',
|
|
2334
2334
|
// the radio button itself
|
|
2335
2335
|
'before:flex-none before:rounded-full before:border-2 before:border-black',
|
|
2336
2336
|
// to vertically align the radio we need to calculate the label's height, which is equal to it's font size multiplied by the line height.
|
|
2337
2337
|
// For the ::before psuedo element the line height of the label is always 1em.
|
|
2338
2338
|
// When we know the height of the label we use the height of the radio to push it down to align with the label's first line
|
|
2339
2339
|
// TODO: 1.75 here is the unit less lineheight, altough we use 1.75rem as the line height, so there is a mismatch here. Revisit this when we've worked on typography in v2. Should this be a CSS custom property instead?
|
|
2340
|
-
'before:mt-[calc((
|
|
2340
|
+
'before:mt-[calc((1em*1.75-24px)/2)] before:h-[24px] before:w-[24px]',
|
|
2341
2341
|
// selected
|
|
2342
|
-
'data-selected:before:
|
|
2342
|
+
'data-selected:before:bg-blue data-selected:before:border-black data-selected:before:shadow-[inset_0_0_0_4px_rgb(255,255,255)]',
|
|
2343
2343
|
// hover
|
|
2344
2344
|
'data-hovered:data-selected:before:border-blue-dark data-hovered:data-invalid:before:bg-red-light data-hovered:data-selected:before:bg-blue-dark data-hovered:before:border-blue data-hovered:before:bg-sky',
|
|
2345
2345
|
// focus
|
|
2346
2346
|
'data-focus-visible:before:ring-focus-offset',
|
|
2347
2347
|
// invalid - The border is 1 px thicker when invalid. We don't actually want to change the border width, as that causes the element's size to change
|
|
2348
2348
|
// so we use an inner outline to artifically pad the border
|
|
2349
|
-
'data-invalid:data-selected:before
|
|
2349
|
+
'data-invalid:data-selected:before:bg-red! data-invalid:before:border-red data-invalid:before:outline-red data-invalid:before:outline data-invalid:before:outline-[3px] data-invalid:before:outline-offset-[-3px] data-invalid:before:outline-solid'
|
|
2350
2350
|
]);
|
|
2351
2351
|
function Radio(props) {
|
|
2352
2352
|
const { children, className, description, ...restProps } = props;
|
|
@@ -2417,7 +2417,7 @@ function Select(props) {
|
|
|
2417
2417
|
ref: ref,
|
|
2418
2418
|
children: [
|
|
2419
2419
|
/*#__PURE__*/ jsx(SelectValue, {
|
|
2420
|
-
className: "flex-1 truncate text-left data-
|
|
2420
|
+
className: "flex-1 truncate text-left data-placeholder:text-[#727070]"
|
|
2421
2421
|
}),
|
|
2422
2422
|
/*#__PURE__*/ jsx(ChevronDown, {
|
|
2423
2423
|
className: dropdown.chevronIcon
|
|
@@ -2454,9 +2454,9 @@ const ProgressBar = ({ children, className, ...restProps })=>{
|
|
|
2454
2454
|
...restArgs
|
|
2455
2455
|
}) : children,
|
|
2456
2456
|
/*#__PURE__*/ jsx("div", {
|
|
2457
|
-
className: "
|
|
2457
|
+
className: "border-blue-dark bg-gray-light relative rounded border",
|
|
2458
2458
|
children: /*#__PURE__*/ jsx("div", {
|
|
2459
|
-
className: "h-1 rounded
|
|
2459
|
+
className: "bg-blue-dark h-1 rounded transition-all duration-300 ease-in-out",
|
|
2460
2460
|
style: {
|
|
2461
2461
|
width: `${percentage}%`
|
|
2462
2462
|
}
|
|
@@ -2469,14 +2469,13 @@ const ProgressBar = ({ children, className, ...restProps })=>{
|
|
|
2469
2469
|
|
|
2470
2470
|
function ScrollButton({ direction, onClick, isVisible, hasScrollingOccurred, className }) {
|
|
2471
2471
|
const Icon = direction === 'left' ? ChevronLeft : ChevronRight;
|
|
2472
|
-
return(//
|
|
2473
|
-
// biome-ignore lint/a11y/noStaticElementInteractions: This button is only for mouse interaction to help users scroll. Keyboard and screen reader users can navigate the content directly without needing these scroll helpers.
|
|
2472
|
+
return(// oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
2474
2473
|
/*#__PURE__*/ jsx("div", {
|
|
2475
2474
|
onClick: onClick,
|
|
2476
2475
|
className: cx(// Base scroll button styling
|
|
2477
2476
|
'flex cursor-pointer items-center justify-center', 'absolute top-0 size-11', 'group/scroll-button text-black', direction === 'left' ? 'bg-[linear-gradient(90deg,white,white_calc(100%-10px),transparent)]' : 'bg-[linear-gradient(90deg,transparent,white_calc(10px),white)]', // Animation
|
|
2478
2477
|
hasScrollingOccurred && 'duration-100 ease-in motion-safe:transition-transform', // Hide/show animation
|
|
2479
|
-
direction === 'left' ? !isVisible && '-translate-x-full
|
|
2478
|
+
direction === 'left' ? !isVisible && 'pointer-events-none -translate-x-full' : !isVisible && 'pointer-events-none translate-x-full', direction === 'left' ? '-left-3' : '-right-3', className),
|
|
2480
2479
|
children: /*#__PURE__*/ jsx(Icon, {
|
|
2481
2480
|
className: cx('motion-safe:transition-all', direction === 'left' ? 'group-hover/scroll-button:-translate-x-1' : 'group-hover/scroll-button:translate-x-1')
|
|
2482
2481
|
})
|
|
@@ -2507,11 +2506,14 @@ function ScrollButton({ direction, onClick, isVisible, hasScrollingOccurred, cla
|
|
|
2507
2506
|
}));
|
|
2508
2507
|
}, []);
|
|
2509
2508
|
const debouncedUpdateScrollState = useDebouncedCallback(updateScrollState, 100);
|
|
2510
|
-
//
|
|
2509
|
+
// The linter struggles here, so need to enable and disable to get it to pass...
|
|
2510
|
+
// useEffect with a usecallback.....
|
|
2511
|
+
// this feels wrong, but not touching this right now since we're just changing the lint setup
|
|
2512
|
+
/* oxlint-disable react-hooks/exhaustive-deps */ // Initial check and react to dependency changes
|
|
2511
2513
|
useEffect(updateScrollState, [
|
|
2512
2514
|
...scrollStateDeps
|
|
2513
2515
|
]);
|
|
2514
|
-
useEffect(()=>{
|
|
2516
|
+
/* oxlint-enable react-hooks/exhaustive-deps */ useEffect(()=>{
|
|
2515
2517
|
const container = scrollContainerRef.current;
|
|
2516
2518
|
if (!container) {
|
|
2517
2519
|
return;
|
|
@@ -2744,7 +2746,7 @@ const TableScrollContainerContext = /*#__PURE__*/ createContext({
|
|
|
2744
2746
|
*/ function TableHeader({ className, children, ...restProps }) {
|
|
2745
2747
|
return /*#__PURE__*/ jsx(TableHeader$1, {
|
|
2746
2748
|
...restProps,
|
|
2747
|
-
className: cx(className, 'border-
|
|
2749
|
+
className: cx(className, 'border-b border-black'),
|
|
2748
2750
|
children: children
|
|
2749
2751
|
});
|
|
2750
2752
|
}
|
|
@@ -2752,14 +2754,14 @@ function TableColumn(props) {
|
|
|
2752
2754
|
const { className, children, ...restProps } = props;
|
|
2753
2755
|
return /*#__PURE__*/ jsx(Column, {
|
|
2754
2756
|
...restProps,
|
|
2755
|
-
className: cx(className, 'px-4 py-3 text-left font-medium text-black
|
|
2757
|
+
className: cx(className, 'px-4 py-3 text-left text-sm font-medium text-black', 'data-focus-visible:outline-focus-inset', '[&_:not([data-slot="table-column-resizer"]):focus-visible]:outline-focus-offset', 'min-w-fit whitespace-nowrap', 'has-data-[slot=table-column-resizer]:*:data-[slot=content]:flex has-data-[slot=table-column-resizer]:*:data-[slot=content]:justify-between has-data-[slot=table-column-resizer]:*:data-[slot=content]:gap-2'),
|
|
2756
2758
|
"data-slot": "table-column",
|
|
2757
2759
|
children: children
|
|
2758
2760
|
});
|
|
2759
2761
|
}
|
|
2760
2762
|
const TableColumnResizer = ({ className, ...restProps })=>/*#__PURE__*/ jsx(ColumnResizer, {
|
|
2761
2763
|
...restProps,
|
|
2762
|
-
className: cx(className, '-my-3 -mr-4.5 size-11 flex-none', 'cursor-ew-resize', 'relative after:absolute after:
|
|
2764
|
+
className: cx(className, '-my-3 -mr-4.5 size-11 flex-none', 'cursor-ew-resize', 'relative after:absolute after:inset-y-2 after:right-5 after:w-px after:bg-black', 'data-focused:after:outline-focus-offset'),
|
|
2763
2765
|
"data-slot": "table-column-resizer"
|
|
2764
2766
|
});
|
|
2765
2767
|
/**
|
|
@@ -2785,7 +2787,7 @@ function TableCell(props) {
|
|
|
2785
2787
|
const { className, children, ...restProps } = props;
|
|
2786
2788
|
return /*#__PURE__*/ jsx(Cell, {
|
|
2787
2789
|
...restProps,
|
|
2788
|
-
className: cx(className, 'px-4 py-3 text-
|
|
2790
|
+
className: cx(className, 'px-4 py-3 text-sm/relaxed text-black', 'min-w-fit whitespace-nowrap', 'align-top', 'data-focus-visible:outline-focus-inset'),
|
|
2789
2791
|
"data-slot": "table-cell",
|
|
2790
2792
|
children: children
|
|
2791
2793
|
});
|
|
@@ -2908,7 +2910,7 @@ const tabsVariants = cva({
|
|
|
2908
2910
|
"data-scroll-animation": false,
|
|
2909
2911
|
className: cx(className, 'group/tablist', // Ensure the tab list is scrollable
|
|
2910
2912
|
'scrollbar-hidden overflow-x-auto', 'flex w-fit max-w-full', // Ensure tabs don't shrink and maintain min-width
|
|
2911
|
-
'
|
|
2913
|
+
'*:min-w-fit *:shrink-0', // Divider line
|
|
2912
2914
|
'border-gray-light', 'data-[orientation=horizontal]:border-b', 'data-[orientation=vertical]:border-r', // Selection highlight based on orientation
|
|
2913
2915
|
'data-[orientation=horizontal]:*:border-y-2', 'data-[orientation=horizontal]:*:data-selected:border-b-blue-dark', 'data-[orientation=vertical]:*:border-r-2', 'data-[orientation=vertical]:*:data-selected:border-r-blue-dark', // Flex direction based on orientation
|
|
2914
2916
|
'data-[orientation=vertical]:flex-col'),
|
|
@@ -2938,12 +2940,12 @@ const tabsVariants = cva({
|
|
|
2938
2940
|
const { className, children, ...restProps } = props;
|
|
2939
2941
|
return /*#__PURE__*/ jsx(Tab$1, {
|
|
2940
2942
|
...restProps,
|
|
2941
|
-
className: cx(className, 'data-focus-visible
|
|
2943
|
+
className: cx(className, 'data-focus-visible:outline-focus data-focus-visible:-outline-offset-10', 'description h-11 cursor-pointer border-transparent px-4 py-[0.71875rem] font-light', // Transition
|
|
2942
2944
|
'transition-colors duration-150 ease-out', // TODO: Should disabled tabs just be hidden?
|
|
2943
2945
|
'data-disabled:cursor-not-allowed data-disabled:opacity-50', // Selection
|
|
2944
|
-
'data-selected:
|
|
2946
|
+
'data-selected:text-blue-dark data-selected:font-medium', // Hover with layout shift prevention using pseudo-element
|
|
2945
2947
|
'after:invisible after:block after:h-0 after:overflow-hidden after:font-medium after:content-[attr(data-text)]', 'data-hovered:font-medium', // Pressed
|
|
2946
|
-
'data-pressed:
|
|
2948
|
+
'data-pressed:text-blue-dark data-pressed:font-medium'),
|
|
2947
2949
|
"data-text": typeof children === 'string' ? children : '',
|
|
2948
2950
|
children: children
|
|
2949
2951
|
});
|
|
@@ -2955,14 +2957,14 @@ const tabsVariants = cva({
|
|
|
2955
2957
|
return /*#__PURE__*/ jsx(TabPanel$1, {
|
|
2956
2958
|
...restProps,
|
|
2957
2959
|
shouldForceMount: true,
|
|
2958
|
-
className: cx(className, '
|
|
2960
|
+
className: cx(className, 'data-focus-visible:outline-focus-offset flex-1 data-inert:hidden'),
|
|
2959
2961
|
children: children
|
|
2960
2962
|
});
|
|
2961
2963
|
}
|
|
2962
2964
|
|
|
2963
2965
|
const tagVariants = cva({
|
|
2964
2966
|
base: [
|
|
2965
|
-
'relative flex cursor-pointer items-center gap-1 rounded-lg px-2 py-1 font-medium
|
|
2967
|
+
'relative flex cursor-pointer items-center gap-1 rounded-lg px-2 py-1 text-sm font-medium transition-colors duration-200',
|
|
2966
2968
|
// Resting
|
|
2967
2969
|
'border-2 border-black bg-white text-black',
|
|
2968
2970
|
//Focus
|
|
@@ -3021,7 +3023,7 @@ const tagVariants = cva({
|
|
|
3021
3023
|
children: [
|
|
3022
3024
|
children,
|
|
3023
3025
|
/*#__PURE__*/ jsx(Button$1, {
|
|
3024
|
-
className: "cursor-pointer outline-none after:absolute after:
|
|
3026
|
+
className: "cursor-pointer outline-none after:absolute after:inset-0",
|
|
3025
3027
|
slot: "remove",
|
|
3026
3028
|
children: /*#__PURE__*/ jsx(Close, {
|
|
3027
3029
|
className: "ml-1"
|
|
@@ -3151,12 +3153,13 @@ const VideoLoop = ({ src, format, alt, className })=>{
|
|
|
3151
3153
|
]);
|
|
3152
3154
|
return /*#__PURE__*/ jsxs("div", {
|
|
3153
3155
|
className: cx(className, 'relative', prefersReducedMotion === null && 'opacity-0'),
|
|
3156
|
+
"data-slot": "video-loop",
|
|
3154
3157
|
children: [
|
|
3155
3158
|
/*#__PURE__*/ jsx("video", {
|
|
3156
3159
|
"aria-hidden": true,
|
|
3157
3160
|
ref: videoRef,
|
|
3158
3161
|
// cursor-pointer is not working on the button below, so we add it here for the same effect
|
|
3159
|
-
className: "
|
|
3162
|
+
className: "size-full max-h-[inherit] cursor-pointer rounded-[inherit] object-cover",
|
|
3160
3163
|
playsInline: true,
|
|
3161
3164
|
loop: prefersReducedMotion === false,
|
|
3162
3165
|
autoPlay: prefersReducedMotion === false,
|
|
@@ -3169,6 +3172,7 @@ const VideoLoop = ({ src, format, alt, className })=>{
|
|
|
3169
3172
|
setIsPlaying(false);
|
|
3170
3173
|
}
|
|
3171
3174
|
},
|
|
3175
|
+
"data-slot": "video",
|
|
3172
3176
|
children: /*#__PURE__*/ jsx("source", {
|
|
3173
3177
|
src: src,
|
|
3174
3178
|
type: `video/${format}`
|
|
@@ -3176,10 +3180,11 @@ const VideoLoop = ({ src, format, alt, className })=>{
|
|
|
3176
3180
|
}),
|
|
3177
3181
|
prefersReducedMotion !== null && /*#__PURE__*/ jsx("button", {
|
|
3178
3182
|
"data-slot": "video-loop-button",
|
|
3183
|
+
// oxlint-disable-next-line jsx-a11y/no-aria-hidden-on-focusable
|
|
3179
3184
|
"aria-hidden": true,
|
|
3180
3185
|
type: "button",
|
|
3181
3186
|
onClick: ()=>setShouldPlay((prevState)=>!prevState),
|
|
3182
|
-
className: cx('absolute
|
|
3187
|
+
className: cx('absolute inset-0 m-auto grid place-items-center', 'focus-visible:outline-focus focus-visible:outline-focus-offset', 'rounded-[inherit]', // Setting the opacity to 0 before applying the transition below will ensure the button only fades in after the video has started playing
|
|
3183
3188
|
shouldPlay && 'opacity-0', isPlaying && [
|
|
3184
3189
|
'transition-opacity duration-200',
|
|
3185
3190
|
// Only show the pause button when the video is hovered or focused
|
|
@@ -3187,7 +3192,7 @@ const VideoLoop = ({ src, format, alt, className })=>{
|
|
|
3187
3192
|
'hover:opacity-100'
|
|
3188
3193
|
]),
|
|
3189
3194
|
children: /*#__PURE__*/ jsx("span", {
|
|
3190
|
-
className: "grid
|
|
3195
|
+
className: "grid size-12 place-items-center rounded-full bg-white outline-hidden",
|
|
3191
3196
|
children: isPlaying ? /*#__PURE__*/ jsx(PlayerPause, {}) : /*#__PURE__*/ jsx(PlayerPlay, {})
|
|
3192
3197
|
})
|
|
3193
3198
|
}),
|