@marktiderman/genesis-ui 1.3.0 → 2.1.0
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/LICENSE +21 -0
- package/dist/AppShell-sQT0UbXg.d.ts +198 -0
- package/dist/{chunk-NJMO3VPA.js → chunk-22XB3Q6H.js} +8 -8
- package/dist/chunk-22XB3Q6H.js.map +1 -0
- package/dist/{chunk-2MXMWBDV.js → chunk-27ELYTGE.js} +6 -6
- package/dist/chunk-27ELYTGE.js.map +1 -0
- package/dist/chunk-46TZGMFW.js +159 -0
- package/dist/chunk-46TZGMFW.js.map +1 -0
- package/dist/chunk-4CQHPWJD.js +117 -0
- package/dist/chunk-4CQHPWJD.js.map +1 -0
- package/dist/{chunk-ZDAT5JDH.js → chunk-65SPT7EA.js} +24 -6
- package/dist/chunk-65SPT7EA.js.map +1 -0
- package/dist/chunk-6KHY647C.js +67 -0
- package/dist/chunk-6KHY647C.js.map +1 -0
- package/dist/chunk-6M4NHHKG.js +51 -0
- package/dist/chunk-6M4NHHKG.js.map +1 -0
- package/dist/chunk-6Q6CLLJ4.js +9 -0
- package/dist/chunk-6Q6CLLJ4.js.map +1 -0
- package/dist/{chunk-UGHQFQOE.js → chunk-6TVMQH6M.js} +28 -28
- package/dist/chunk-6TVMQH6M.js.map +1 -0
- package/dist/{chunk-6VVVGYKS.js → chunk-6XPMU65K.js} +5 -5
- package/dist/{chunk-6VVVGYKS.js.map → chunk-6XPMU65K.js.map} +1 -1
- package/dist/{chunk-YZEA5TGK.js → chunk-7XMZVISM.js} +16 -16
- package/dist/chunk-7XMZVISM.js.map +1 -0
- package/dist/chunk-A7AHVDG7.js +52 -0
- package/dist/chunk-A7AHVDG7.js.map +1 -0
- package/dist/chunk-AFZ76Q26.js +84 -0
- package/dist/chunk-AFZ76Q26.js.map +1 -0
- package/dist/{chunk-4V4H2ZM7.js → chunk-AL5TMEZQ.js} +31 -31
- package/dist/chunk-AL5TMEZQ.js.map +1 -0
- package/dist/{chunk-AUECDWP2.js → chunk-AOZGQM6W.js} +3 -3
- package/dist/chunk-AOZGQM6W.js.map +1 -0
- package/dist/chunk-ARJI2JUV.js +122 -0
- package/dist/chunk-ARJI2JUV.js.map +1 -0
- package/dist/chunk-AVFZ4P4B.js +25 -0
- package/dist/chunk-AVFZ4P4B.js.map +1 -0
- package/dist/chunk-B2GIBUQD.js +11 -0
- package/dist/chunk-B2GIBUQD.js.map +1 -0
- package/dist/{chunk-JXI2MYL3.js → chunk-C46ITXE4.js} +5 -5
- package/dist/chunk-C46ITXE4.js.map +1 -0
- package/dist/{chunk-A2OXCNNY.js → chunk-CNTWQSUT.js} +3 -3
- package/dist/{chunk-A2OXCNNY.js.map → chunk-CNTWQSUT.js.map} +1 -1
- package/dist/chunk-D2LIXA2Y.js +65 -0
- package/dist/chunk-D2LIXA2Y.js.map +1 -0
- package/dist/{chunk-T5VX5DYO.js → chunk-F47U5KNW.js} +5 -5
- package/dist/chunk-F47U5KNW.js.map +1 -0
- package/dist/chunk-FEJAZFP3.js +1100 -0
- package/dist/chunk-FEJAZFP3.js.map +1 -0
- package/dist/{chunk-2B3MFHBQ.js → chunk-FK42ZGGV.js} +21 -21
- package/dist/chunk-FK42ZGGV.js.map +1 -0
- package/dist/{chunk-XISSLIMH.js → chunk-FTTNGGLA.js} +2 -2
- package/dist/{chunk-XISSLIMH.js.map → chunk-FTTNGGLA.js.map} +1 -1
- package/dist/chunk-G5YKBPBF.js +74 -0
- package/dist/chunk-G5YKBPBF.js.map +1 -0
- package/dist/{chunk-QLCDAFS7.js → chunk-GDFNAHI4.js} +10 -6
- package/dist/chunk-GDFNAHI4.js.map +1 -0
- package/dist/{chunk-KB5T5LWM.js → chunk-IJCT5IJD.js} +3 -3
- package/dist/{chunk-KB5T5LWM.js.map → chunk-IJCT5IJD.js.map} +1 -1
- package/dist/{chunk-44TULYGG.js → chunk-J6FBA7PH.js} +3 -3
- package/dist/{chunk-44TULYGG.js.map → chunk-J6FBA7PH.js.map} +1 -1
- package/dist/chunk-JAMLFMDS.js +12 -0
- package/dist/chunk-JAMLFMDS.js.map +1 -0
- package/dist/{chunk-C6H7AMO4.js → chunk-LNFF2RBD.js} +9 -9
- package/dist/chunk-LNFF2RBD.js.map +1 -0
- package/dist/{chunk-QBZMY2AF.js → chunk-M62CHO3N.js} +18 -18
- package/dist/chunk-M62CHO3N.js.map +1 -0
- package/dist/{chunk-5Q4FABZQ.js → chunk-NUXW6NPP.js} +8 -8
- package/dist/chunk-NUXW6NPP.js.map +1 -0
- package/dist/{chunk-ZJFSZFPI.js → chunk-NWSCYLPT.js} +77 -18
- package/dist/chunk-NWSCYLPT.js.map +1 -0
- package/dist/{chunk-63FW5ZUA.js → chunk-P3ZL6FGR.js} +7 -7
- package/dist/chunk-P3ZL6FGR.js.map +1 -0
- package/dist/chunk-P64MFQXZ.js +191 -0
- package/dist/chunk-P64MFQXZ.js.map +1 -0
- package/dist/chunk-PLIYF6KI.js +52 -0
- package/dist/chunk-PLIYF6KI.js.map +1 -0
- package/dist/chunk-PSR47JRA.js +26 -0
- package/dist/chunk-PSR47JRA.js.map +1 -0
- package/dist/{chunk-SBJV3K4G.js → chunk-QJ6P2DW6.js} +28 -28
- package/dist/chunk-QJ6P2DW6.js.map +1 -0
- package/dist/{chunk-IP6TMT3D.js → chunk-R7QFP6EL.js} +3 -3
- package/dist/chunk-R7QFP6EL.js.map +1 -0
- package/dist/{chunk-WZWR2ELB.js → chunk-SEBU6JCK.js} +6 -6
- package/dist/chunk-SEBU6JCK.js.map +1 -0
- package/dist/{chunk-7OBL3H5P.js → chunk-SEFK4NZV.js} +3 -3
- package/dist/chunk-SEFK4NZV.js.map +1 -0
- package/dist/chunk-SRIT4NFQ.js +67 -0
- package/dist/chunk-SRIT4NFQ.js.map +1 -0
- package/dist/chunk-SY62XJFA.js +19 -0
- package/dist/chunk-SY62XJFA.js.map +1 -0
- package/dist/{chunk-SVXDWPLO.js → chunk-THD3YOOZ.js} +17 -17
- package/dist/chunk-THD3YOOZ.js.map +1 -0
- package/dist/chunk-VXFYETRK.js +58 -0
- package/dist/chunk-VXFYETRK.js.map +1 -0
- package/dist/chunk-XBX6QMR5.js +58 -0
- package/dist/chunk-XBX6QMR5.js.map +1 -0
- package/dist/{chunk-SCUT2ZCD.js → chunk-XCGZPFT7.js} +17 -17
- package/dist/chunk-XCGZPFT7.js.map +1 -0
- package/dist/chunk-XMK3T4TA.js +73 -0
- package/dist/chunk-XMK3T4TA.js.map +1 -0
- package/dist/chunk-YJ6MPS6U.js +226 -0
- package/dist/chunk-YJ6MPS6U.js.map +1 -0
- package/dist/chunk-YRYQXU3G.js +38 -0
- package/dist/chunk-YRYQXU3G.js.map +1 -0
- package/dist/{chunk-5J7BP5DI.js → chunk-YWFPMND7.js} +10 -10
- package/dist/chunk-YWFPMND7.js.map +1 -0
- package/dist/chunk-YYEGAFUE.js +94 -0
- package/dist/chunk-YYEGAFUE.js.map +1 -0
- package/dist/{chunk-TKA4LOMT.js → chunk-ZZ7H7VVX.js} +8 -8
- package/dist/chunk-ZZ7H7VVX.js.map +1 -0
- package/dist/components/data/index.d.ts +318 -228
- package/dist/components/data/index.js +591 -1394
- package/dist/components/data/index.js.map +1 -1
- package/dist/components/layout/dashboard-page.d.ts +4 -0
- package/dist/components/layout/dashboard-page.js +5 -0
- package/dist/components/layout/dashboard-page.js.map +1 -0
- package/dist/components/layout/detail-page.d.ts +91 -0
- package/dist/components/layout/detail-page.js +6 -0
- package/dist/components/layout/detail-page.js.map +1 -0
- package/dist/components/layout/form-page.d.ts +82 -0
- package/dist/components/layout/form-page.js +5 -0
- package/dist/components/layout/form-page.js.map +1 -0
- package/dist/components/layout/index.d.ts +14 -0
- package/dist/components/layout/index.js +21 -0
- package/dist/components/layout/index.js.map +1 -0
- package/dist/components/layout/settings-page.d.ts +114 -0
- package/dist/components/layout/settings-page.js +6 -0
- package/dist/components/layout/settings-page.js.map +1 -0
- package/dist/components/patterns/empty-state.d.ts +73 -0
- package/dist/components/{ui → patterns}/empty-state.js +2 -1
- package/dist/components/{ui → patterns}/form-field.d.ts +5 -6
- package/dist/components/{ui → patterns}/form-field.js +2 -2
- package/dist/components/patterns/index.d.ts +17 -0
- package/dist/components/patterns/index.js +18 -0
- package/dist/components/patterns/index.js.map +1 -0
- package/dist/components/patterns/page-loading.d.ts +25 -0
- package/dist/components/patterns/page-loading.js +5 -0
- package/dist/components/patterns/page-loading.js.map +1 -0
- package/dist/components/patterns/settings-row.d.ts +41 -0
- package/dist/components/patterns/settings-row.js +6 -0
- package/dist/components/patterns/settings-row.js.map +1 -0
- package/dist/components/patterns/status-badge.d.ts +37 -0
- package/dist/components/patterns/status-badge.js +4 -0
- package/dist/components/patterns/status-badge.js.map +1 -0
- package/dist/components/patterns/toggle-row.d.ts +35 -0
- package/dist/components/patterns/toggle-row.js +8 -0
- package/dist/components/patterns/toggle-row.js.map +1 -0
- package/dist/components/patterns/user-avatar.d.ts +34 -0
- package/dist/components/patterns/user-avatar.js +5 -0
- package/dist/components/patterns/user-avatar.js.map +1 -0
- package/dist/components/ui/accessible-icon.d.ts +47 -0
- package/dist/components/ui/accessible-icon.js +3 -0
- package/dist/components/ui/accessible-icon.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +5 -5
- package/dist/components/ui/accordion.js +1 -1
- package/dist/components/ui/alert-dialog.d.ts +12 -13
- package/dist/components/ui/alert-dialog.js +1 -1
- package/dist/components/ui/aspect-ratio.d.ts +2 -2
- package/dist/components/ui/aspect-ratio.js +1 -1
- package/dist/components/ui/avatar.d.ts +4 -4
- package/dist/components/ui/avatar.js +1 -1
- package/dist/components/ui/badge.d.ts +1 -2
- package/dist/components/ui/breadcrumb.d.ts +2 -3
- package/dist/components/ui/button-group.d.ts +1 -2
- package/dist/components/ui/button.d.ts +73 -8
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/calendar.d.ts +2 -3
- package/dist/components/ui/calendar.js +2 -2
- package/dist/components/ui/card.d.ts +6 -7
- package/dist/components/ui/carousel.d.ts +4 -4
- package/dist/components/ui/carousel.js +2 -2
- package/dist/components/ui/chart.d.ts +4 -5
- package/dist/components/ui/checkbox.d.ts +2 -2
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/collapsible.d.ts +4 -4
- package/dist/components/ui/collapsible.js +1 -1
- package/dist/components/ui/command-palette.d.ts +1 -2
- package/dist/components/ui/command-palette.js +3 -3
- package/dist/components/ui/command.d.ts +11 -12
- package/dist/components/ui/command.js +2 -2
- package/dist/components/ui/context-menu.d.ts +16 -17
- package/dist/components/ui/context-menu.js +1 -1
- package/dist/components/ui/date-picker.d.ts +2 -2
- package/dist/components/ui/date-picker.js +4 -4
- package/dist/components/ui/dialog.d.ts +11 -12
- package/dist/components/ui/dialog.js +1 -1
- package/dist/components/ui/drawer.d.ts +10 -11
- package/dist/components/ui/dropdown-menu.d.ts +16 -17
- package/dist/components/ui/dropdown-menu.js +1 -1
- package/dist/components/ui/hover-card.d.ts +4 -4
- package/dist/components/ui/hover-card.js +1 -1
- package/dist/components/ui/input-otp.d.ts +2 -2
- package/dist/components/ui/kbd.d.ts +1 -2
- package/dist/components/ui/label.d.ts +2 -2
- package/dist/components/ui/label.js +1 -1
- package/dist/components/ui/menubar.d.ts +17 -18
- package/dist/components/ui/menubar.js +1 -1
- package/dist/components/ui/navigation-menu.d.ts +9 -9
- package/dist/components/ui/navigation-menu.js +1 -1
- package/dist/components/ui/pagination.d.ts +5 -6
- package/dist/components/ui/pagination.js +2 -2
- package/dist/components/ui/password-toggle-field.d.ts +120 -0
- package/dist/components/ui/password-toggle-field.js +4 -0
- package/dist/components/ui/password-toggle-field.js.map +1 -0
- package/dist/components/ui/popover.d.ts +4 -4
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/progress.d.ts +1 -2
- package/dist/components/ui/radio-group.d.ts +3 -3
- package/dist/components/ui/radio-group.js +1 -1
- package/dist/components/ui/resizable.d.ts +3 -4
- package/dist/components/ui/scroll-area.d.ts +60 -3
- package/dist/components/ui/scroll-area.js +1 -1
- package/dist/components/ui/select.d.ts +9 -9
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/separator.d.ts +1 -2
- package/dist/components/ui/sheet.d.ts +13 -12
- package/dist/components/ui/sheet.js +1 -1
- package/dist/components/ui/skeleton.d.ts +1 -2
- package/dist/components/ui/slider.d.ts +2 -2
- package/dist/components/ui/slider.js +1 -1
- package/dist/components/ui/sonner.d.ts +1 -2
- package/dist/components/ui/spinner.d.ts +1 -2
- package/dist/components/ui/switch.d.ts +2 -2
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/tabs.d.ts +29 -14
- package/dist/components/ui/tabs.js +1 -1
- package/dist/components/ui/toggle-group.d.ts +3 -3
- package/dist/components/ui/toggle-group.js +2 -2
- package/dist/components/ui/toggle.d.ts +2 -2
- package/dist/components/ui/toggle.js +1 -1
- package/dist/components/ui/toolbar.d.ts +104 -0
- package/dist/components/ui/toolbar.js +6 -0
- package/dist/components/ui/toolbar.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +46 -5
- package/dist/components/ui/tooltip.js +1 -1
- package/dist/components/ui/typography.d.ts +9 -10
- package/dist/components/ui/visually-hidden.d.ts +48 -0
- package/dist/components/ui/visually-hidden.js +4 -0
- package/dist/components/ui/visually-hidden.js.map +1 -0
- package/dist/dashboard-page-C0TihRl5.d.ts +107 -0
- package/dist/hooks/index.d.ts +2 -3
- package/dist/hooks/index.js +6 -6
- package/dist/hooks/use-keyboard-navigation.d.ts +58 -2
- package/dist/hooks/use-keyboard-navigation.js +1 -1
- package/dist/hooks/use-resource-page.d.ts +2 -3
- package/dist/hooks/use-resource-page.js +2 -2
- package/dist/hooks/use-view-preference.d.ts +2 -2
- package/dist/hooks/use-view-preference.js +1 -1
- package/dist/index.d.ts +22 -25
- package/dist/index.js +54 -38
- package/dist/spacing-BS6qECD4.d.ts +191 -0
- package/dist/split-Dk9f4Mi0.d.ts +57 -0
- package/dist/{use-resource-page-BXBv_Xah.d.ts → use-resource-page-DTQS011Q.d.ts} +18 -6
- package/dist/view-settings-kHKCHMjj.d.ts +12 -0
- package/dist/{ViewToggle-DDe_Luj2.d.ts → view-toggle-CahQ87PW.d.ts} +2 -2
- package/package.json +80 -39
- package/dist/chunk-2B3MFHBQ.js.map +0 -1
- package/dist/chunk-2MXMWBDV.js.map +0 -1
- package/dist/chunk-4V4H2ZM7.js.map +0 -1
- package/dist/chunk-5J7BP5DI.js.map +0 -1
- package/dist/chunk-5Q4FABZQ.js.map +0 -1
- package/dist/chunk-63FW5ZUA.js.map +0 -1
- package/dist/chunk-7OBL3H5P.js.map +0 -1
- package/dist/chunk-AUECDWP2.js.map +0 -1
- package/dist/chunk-C6H7AMO4.js.map +0 -1
- package/dist/chunk-EI5EGKHL.js +0 -32
- package/dist/chunk-EI5EGKHL.js.map +0 -1
- package/dist/chunk-IP6TMT3D.js.map +0 -1
- package/dist/chunk-JJ4NOMMI.js +0 -73
- package/dist/chunk-JJ4NOMMI.js.map +0 -1
- package/dist/chunk-JXI2MYL3.js.map +0 -1
- package/dist/chunk-KBS4BHME.js +0 -11
- package/dist/chunk-KBS4BHME.js.map +0 -1
- package/dist/chunk-LRXDZBV2.js +0 -26
- package/dist/chunk-LRXDZBV2.js.map +0 -1
- package/dist/chunk-NJMO3VPA.js.map +0 -1
- package/dist/chunk-OCTV3S4I.js +0 -29
- package/dist/chunk-OCTV3S4I.js.map +0 -1
- package/dist/chunk-QBZMY2AF.js.map +0 -1
- package/dist/chunk-QLCDAFS7.js.map +0 -1
- package/dist/chunk-SBJV3K4G.js.map +0 -1
- package/dist/chunk-SCUT2ZCD.js.map +0 -1
- package/dist/chunk-SVXDWPLO.js.map +0 -1
- package/dist/chunk-T465NJRL.js +0 -134
- package/dist/chunk-T465NJRL.js.map +0 -1
- package/dist/chunk-T5VX5DYO.js.map +0 -1
- package/dist/chunk-TKA4LOMT.js.map +0 -1
- package/dist/chunk-UGHQFQOE.js.map +0 -1
- package/dist/chunk-WALXVR6V.js +0 -9
- package/dist/chunk-WALXVR6V.js.map +0 -1
- package/dist/chunk-WZWR2ELB.js.map +0 -1
- package/dist/chunk-YZEA5TGK.js.map +0 -1
- package/dist/chunk-ZDAT5JDH.js.map +0 -1
- package/dist/chunk-ZJFSZFPI.js.map +0 -1
- package/dist/components/ui/empty-state.d.ts +0 -22
- /package/dist/components/{ui → patterns}/empty-state.js.map +0 -0
- /package/dist/components/{ui → patterns}/form-field.js.map +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from './chunk-NZ5WBA4R.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { unstable_PasswordToggleField } from 'radix-ui';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
function PasswordToggleField({
|
|
8
|
+
className,
|
|
9
|
+
testID,
|
|
10
|
+
children,
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ jsx(unstable_PasswordToggleField.Root, { ...props, children: /* @__PURE__ */ jsx(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
"data-slot": "password-toggle-field",
|
|
17
|
+
"data-testid": testID,
|
|
18
|
+
className: cn("relative w-full", className),
|
|
19
|
+
children
|
|
20
|
+
}
|
|
21
|
+
) });
|
|
22
|
+
}
|
|
23
|
+
PasswordToggleField.displayName = "PasswordToggleField";
|
|
24
|
+
var PasswordToggleFieldInput = React.forwardRef(({ className, testID, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
25
|
+
unstable_PasswordToggleField.Input,
|
|
26
|
+
{
|
|
27
|
+
ref,
|
|
28
|
+
"data-slot": "input",
|
|
29
|
+
"data-testid": testID,
|
|
30
|
+
className: cn(
|
|
31
|
+
"flex h-10 w-full min-w-0 rounded-md border border-input bg-background py-2 pl-3 pr-10 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm aria-invalid:border-destructive aria-invalid:ring-destructive/20",
|
|
32
|
+
className
|
|
33
|
+
),
|
|
34
|
+
...props
|
|
35
|
+
}
|
|
36
|
+
));
|
|
37
|
+
PasswordToggleFieldInput.displayName = "PasswordToggleFieldInput";
|
|
38
|
+
var PasswordToggleFieldToggle = React.forwardRef(({ className, testID, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
39
|
+
unstable_PasswordToggleField.Toggle,
|
|
40
|
+
{
|
|
41
|
+
ref,
|
|
42
|
+
"data-testid": testID,
|
|
43
|
+
className: cn(
|
|
44
|
+
"absolute right-1 top-1/2 inline-flex size-8 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
45
|
+
className
|
|
46
|
+
),
|
|
47
|
+
...props
|
|
48
|
+
}
|
|
49
|
+
));
|
|
50
|
+
PasswordToggleFieldToggle.displayName = "PasswordToggleFieldToggle";
|
|
51
|
+
function PasswordToggleFieldSlot(props) {
|
|
52
|
+
return /* @__PURE__ */ jsx(unstable_PasswordToggleField.Slot, { ...props });
|
|
53
|
+
}
|
|
54
|
+
PasswordToggleFieldSlot.displayName = "PasswordToggleFieldSlot";
|
|
55
|
+
var PasswordToggleFieldIcon = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
56
|
+
unstable_PasswordToggleField.Icon,
|
|
57
|
+
{
|
|
58
|
+
ref,
|
|
59
|
+
className: cn("size-4 shrink-0", className),
|
|
60
|
+
...props
|
|
61
|
+
}
|
|
62
|
+
));
|
|
63
|
+
PasswordToggleFieldIcon.displayName = "PasswordToggleFieldIcon";
|
|
64
|
+
|
|
65
|
+
export { PasswordToggleField, PasswordToggleFieldIcon, PasswordToggleFieldInput, PasswordToggleFieldSlot, PasswordToggleFieldToggle };
|
|
66
|
+
//# sourceMappingURL=chunk-SRIT4NFQ.js.map
|
|
67
|
+
//# sourceMappingURL=chunk-SRIT4NFQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ui/password-toggle-field.tsx"],"names":["PasswordToggleFieldPrimitive"],"mappings":";;;;;AA6DO,SAAS,mBAAA,CAAoB;AAAA,EAClC,SAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA6B;AAC3B,EAAA,uBACE,GAAA,CAACA,4BAAA,CAA6B,IAAA,EAA7B,EAAmC,GAAG,KAAA,EACrC,QAAA,kBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,uBAAA;AAAA,MACV,aAAA,EAAa,MAAA;AAAA,MACb,SAAA,EAAW,EAAA,CAAG,iBAAA,EAAmB,SAAS,CAAA;AAAA,MAEzC;AAAA;AAAA,GACH,EACF,CAAA;AAEJ;AACA,mBAAA,CAAoB,WAAA,GAAc,qBAAA;AAoB3B,IAAM,wBAAA,GAAiC,iBAG5C,CAAC,EAAE,WAAW,MAAA,EAAQ,GAAG,KAAA,EAAM,EAAG,GAAA,qBAClC,GAAA;AAAA,EAACA,4BAAA,CAA6B,KAAA;AAAA,EAA7B;AAAA,IACC,GAAA;AAAA,IACA,WAAA,EAAU,OAAA;AAAA,IACV,aAAA,EAAa,MAAA;AAAA,IACb,SAAA,EAAW,EAAA;AAAA,MACT,0XAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,wBAAA,CAAyB,WAAA,GAAc,0BAAA;AAwBhC,IAAM,yBAAA,GAAkC,iBAG7C,CAAC,EAAE,WAAW,MAAA,EAAQ,GAAG,KAAA,EAAM,EAAG,GAAA,qBAClC,GAAA;AAAA,EAACA,4BAAA,CAA6B,MAAA;AAAA,EAA7B;AAAA,IACC,GAAA;AAAA,IACA,aAAA,EAAa,MAAA;AAAA,IACb,SAAA,EAAW,EAAA;AAAA,MACT,kaAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,yBAAA,CAA0B,WAAA,GAAc,2BAAA;AAgBjC,SAAS,wBAAwB,KAAA,EAAqC;AAC3E,EAAA,uBAAO,GAAA,CAACA,4BAAA,CAA6B,IAAA,EAA7B,EAAmC,GAAG,KAAA,EAAO,CAAA;AACvD;AACA,uBAAA,CAAwB,WAAA,GAAc,yBAAA;AAgB/B,IAAM,uBAAA,GAAgC,iBAG3C,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1B,GAAA;AAAA,EAACA,4BAAA,CAA6B,IAAA;AAAA,EAA7B;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,iBAAA,EAAmB,SAAS,CAAA;AAAA,IACzC,GAAG;AAAA;AACN,CACD;AACD,uBAAA,CAAwB,WAAA,GAAc,yBAAA","file":"chunk-SRIT4NFQ.js","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { unstable_PasswordToggleField as PasswordToggleFieldPrimitive } from \"radix-ui\";\n\nimport { cn } from \"../../utils\";\n\nexport interface PasswordToggleFieldProps\n extends React.ComponentPropsWithoutRef<\n typeof PasswordToggleFieldPrimitive.Root\n > {\n /** Class names for the field wrapper (the positioned box, see below). */\n className?: string;\n /** Stable test/automation selector for the wrapper (emitted as `data-testid`). */\n testID?: string;\n}\n\n/**\n * PasswordToggleField — a password input with a show/hide control that keeps\n * focus and caret position across the toggle.\n *\n * Composition:\n *\n * ```tsx\n * <PasswordToggleField>\n * <PasswordToggleFieldInput placeholder=\"Password\" />\n * <PasswordToggleFieldToggle>\n * <PasswordToggleFieldSlot visible={<EyeOff />} hidden={<Eye />} />\n * </PasswordToggleFieldToggle>\n * </PasswordToggleField>\n * ```\n *\n * Why Radix and not five lines of `useState` plus `type={shown ? \"text\" :\n * \"password\"}`: the naive version loses the caret on every toggle, leaves the\n * button unlabelled (or labelled with a state that never updates), and — the\n * part nobody writes — leaves the password visible in the DOM after the form is\n * submitted or reset. Radix resets visibility on both `submit` and `reset`,\n * restores `selectionStart`/`selectionEnd` after the type swap, and derives the\n * toggle's `aria-label` (\"Show password\" / \"Hide password\") from the current\n * state unless the caller supplies text or a label of their own.\n *\n * Radix's own root is a **context provider with no DOM node of its own**, so\n * this wrapper renders a `relative` box around the children. That box is\n * load-bearing, not decoration: `PasswordToggleFieldToggle` is positioned\n * `absolute`, and absolute positioning resolves against the nearest positioned\n * ancestor. Without a wrapper the toggle would escape the field and land\n * against whatever positioned ancestor the consumer's page happened to have —\n * or the initial containing block, i.e. the page corner. The composition\n * documented above would put the show/hide button nowhere near the input.\n *\n * ---\n *\n * **Stability.** Radix ships this primitive as `unstable_PasswordToggleField`\n * and documents its API as subject to change; the underlying\n * `@radix-ui/react-password-toggle-field` package is still on `0.1.x`. It is\n * exported here under its stable-looking name for ergonomics, but it is the one\n * component in this package whose props may change in a minor release. Pin the\n * package if that is unacceptable, or compose `Input` + `Button` yourself.\n *\n * @stability Experimental\n */\nexport function PasswordToggleField({\n className,\n testID,\n children,\n ...props\n}: PasswordToggleFieldProps) {\n return (\n <PasswordToggleFieldPrimitive.Root {...props}>\n <div\n data-slot=\"password-toggle-field\"\n data-testid={testID}\n className={cn(\"relative w-full\", className)}\n >\n {children}\n </div>\n </PasswordToggleFieldPrimitive.Root>\n );\n}\nPasswordToggleField.displayName = \"PasswordToggleField\";\n\nexport interface PasswordToggleFieldInputProps\n extends React.ComponentPropsWithoutRef<\n typeof PasswordToggleFieldPrimitive.Input\n > {\n /** Stable test/automation selector (emitted as `data-testid`). */\n testID?: string;\n}\n\n/**\n * PasswordToggleFieldInput — the field itself.\n *\n * Styling matches `Input`, with right padding reserved for the toggle so the\n * button never sits on top of the text. Radix owns `type`, which is why it is\n * absent from the props: it is derived from the field's visibility state and\n * a caller-supplied value would fight it.\n *\n * @stability Experimental\n */\nexport const PasswordToggleFieldInput = React.forwardRef<\n React.ComponentRef<typeof PasswordToggleFieldPrimitive.Input>,\n PasswordToggleFieldInputProps\n>(({ className, testID, ...props }, ref) => (\n <PasswordToggleFieldPrimitive.Input\n ref={ref}\n data-slot=\"input\"\n data-testid={testID}\n className={cn(\n \"flex h-10 w-full min-w-0 rounded-md border border-input bg-background py-2 pl-3 pr-10 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm aria-invalid:border-destructive aria-invalid:ring-destructive/20\",\n className\n )}\n {...props}\n />\n));\nPasswordToggleFieldInput.displayName = \"PasswordToggleFieldInput\";\n\nexport interface PasswordToggleFieldToggleProps\n extends React.ComponentPropsWithoutRef<\n typeof PasswordToggleFieldPrimitive.Toggle\n > {\n /** Stable test/automation selector (emitted as `data-testid`). */\n testID?: string;\n}\n\n/**\n * PasswordToggleFieldToggle — the show/hide button.\n *\n * Positioned `absolute` against the `relative` box that `PasswordToggleField`\n * renders — which is why that box exists; see the root's docs. Keep this\n * component inside a `PasswordToggleField`: positioning it against an\n * arbitrary ancestor is not a supported arrangement.\n *\n * Its accessible name comes from Radix (\"Show password\" / \"Hide password\",\n * following the current state) unless you provide inner text or an\n * `aria-label`.\n *\n * @stability Experimental\n */\nexport const PasswordToggleFieldToggle = React.forwardRef<\n React.ComponentRef<typeof PasswordToggleFieldPrimitive.Toggle>,\n PasswordToggleFieldToggleProps\n>(({ className, testID, ...props }, ref) => (\n <PasswordToggleFieldPrimitive.Toggle\n ref={ref}\n data-testid={testID}\n className={cn(\n \"absolute right-1 top-1/2 inline-flex size-8 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className\n )}\n {...props}\n />\n));\nPasswordToggleFieldToggle.displayName = \"PasswordToggleFieldToggle\";\n\nexport type PasswordToggleFieldSlotProps = React.ComponentPropsWithoutRef<\n typeof PasswordToggleFieldPrimitive.Slot\n>;\n\n/**\n * PasswordToggleFieldSlot — renders one of two nodes depending on visibility.\n *\n * Takes either the declarative pair (`visible` / `hidden`) or a `render`\n * callback receiving `{ visible }`. Unstyled by design: it is a switch, not a\n * box, and wrapping it in an element would break the toggle's `[&_svg]` icon\n * sizing.\n *\n * @stability Experimental\n */\nexport function PasswordToggleFieldSlot(props: PasswordToggleFieldSlotProps) {\n return <PasswordToggleFieldPrimitive.Slot {...props} />;\n}\nPasswordToggleFieldSlot.displayName = \"PasswordToggleFieldSlot\";\n\nexport interface PasswordToggleFieldIconProps\n extends React.ComponentPropsWithoutRef<\n typeof PasswordToggleFieldPrimitive.Icon\n > {}\n\n/**\n * PasswordToggleFieldIcon — the SVG-level variant of `PasswordToggleFieldSlot`.\n *\n * Swaps the icon's inner content while keeping ONE `<svg>` element mounted, so\n * a CSS transition on the glyph survives the toggle instead of being restarted\n * by a remount.\n *\n * @stability Experimental\n */\nexport const PasswordToggleFieldIcon = React.forwardRef<\n React.ComponentRef<typeof PasswordToggleFieldPrimitive.Icon>,\n PasswordToggleFieldIconProps\n>(({ className, ...props }, ref) => (\n <PasswordToggleFieldPrimitive.Icon\n ref={ref}\n className={cn(\"size-4 shrink-0\", className)}\n {...props}\n />\n));\nPasswordToggleFieldIcon.displayName = \"PasswordToggleFieldIcon\";\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { cn } from './chunk-NZ5WBA4R.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VisuallyHidden as VisuallyHidden$1 } from 'radix-ui';
|
|
4
|
+
import { jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var VisuallyHidden = React.forwardRef(({ className, testID, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7
|
+
VisuallyHidden$1.Root,
|
|
8
|
+
{
|
|
9
|
+
ref,
|
|
10
|
+
"data-testid": testID,
|
|
11
|
+
className: cn(className),
|
|
12
|
+
...props
|
|
13
|
+
}
|
|
14
|
+
));
|
|
15
|
+
VisuallyHidden.displayName = VisuallyHidden$1.Root.displayName;
|
|
16
|
+
|
|
17
|
+
export { VisuallyHidden };
|
|
18
|
+
//# sourceMappingURL=chunk-SY62XJFA.js.map
|
|
19
|
+
//# sourceMappingURL=chunk-SY62XJFA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ui/visually-hidden.tsx"],"names":["VisuallyHiddenPrimitive"],"mappings":";;;;;AAsDO,IAAM,cAAA,GAAuB,iBAGlC,CAAC,EAAE,WAAW,MAAA,EAAQ,GAAG,KAAA,EAAM,EAAG,GAAA,qBAClC,GAAA;AAAA,EAACA,gBAAA,CAAwB,IAAA;AAAA,EAAxB;AAAA,IACC,GAAA;AAAA,IACA,aAAA,EAAa,MAAA;AAAA,IACb,SAAA,EAAW,GAAG,SAAS,CAAA;AAAA,IACtB,GAAG;AAAA;AACN,CACD;AACD,cAAA,CAAe,WAAA,GAAcA,iBAAwB,IAAA,CAAK,WAAA","file":"chunk-SY62XJFA.js","sourcesContent":["// No \"use client\": this renders a span with inline styles and no hooks, and\n// neither `radix-ui` nor `@radix-ui/react-visually-hidden` carries the\n// directive itself. Leaving it off keeps the primitive importable from an RSC\n// server component — which matters, because the label an icon-only control\n// needs is very often rendered on the server.\nimport * as React from \"react\";\nimport { VisuallyHidden as VisuallyHiddenPrimitive } from \"radix-ui\";\n\nimport { cn } from \"../../utils\";\n\nexport interface VisuallyHiddenProps\n extends React.ComponentPropsWithoutRef<typeof VisuallyHiddenPrimitive.Root> {\n /** Stable test/automation selector (emitted as `data-testid`). */\n testID?: string;\n}\n\n/**\n * VisuallyHidden — content removed from the visual layout but kept in the\n * accessibility tree.\n *\n * This is the correct tool for the label an icon-only control needs, for the\n * `DialogTitle` a dialog must have even when the design shows none, and for\n * live-region status text. It is NOT `display: none` and it is NOT\n * `visibility: hidden` — both of those remove the node from the a11y tree too,\n * which is the exact opposite of the intent.\n *\n * Why Radix rather than Tailwind's `sr-only`: the two produce the same result,\n * but `sr-only` is a class a consumer's `@apply`, a purge misconfiguration, or\n * a competing utility can quietly defeat, and the failure is silent — the text\n * simply becomes visible, or the layout shifts, and nothing in a build catches\n * it. Radix applies the clip rectangle as inline styles on the element itself,\n * so there is no stylesheet for the consumer's build to lose.\n *\n * **That robustness cuts both ways, and it is the one thing to know before\n * reaching for this.** An inline style beats any ordinary class declaration, so\n * a `className` cannot override the clipping either — not accidentally, and\n * not on purpose. `className` is merged for non-visual concerns (a test hook, a\n * data attribute target); it is NOT a way to reveal the content.\n *\n * The escape hatch is the `style` prop, which Radix spreads *after* its own\n * (`{...VISUALLY_HIDDEN_STYLES, ...props.style}`) and which therefore wins.\n * Both behaviours are pinned in this component's tests, because the docs above\n * depend on them.\n *\n * **This is therefore the wrong primitive for a skip link.** A skip link is\n * hidden until focused, and \"until focused\" is state, not a class — a static\n * `style` prop cannot express it and `focus-within:` utilities cannot win\n * against the inline rule. Give a skip link its own element with real CSS, or\n * drive the `style` prop from `onFocus`/`onBlur`. Use `VisuallyHidden` for text\n * that stays hidden: control labels, dialog titles a design omits, live-region\n * status text.\n *\n * @stability Beta\n */\nexport const VisuallyHidden = React.forwardRef<\n React.ComponentRef<typeof VisuallyHiddenPrimitive.Root>,\n VisuallyHiddenProps\n>(({ className, testID, ...props }, ref) => (\n <VisuallyHiddenPrimitive.Root\n ref={ref}\n data-testid={testID}\n className={cn(className)}\n {...props}\n />\n));\nVisuallyHidden.displayName = VisuallyHiddenPrimitive.Root.displayName;\n"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from './chunk-NZ5WBA4R.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import
|
|
4
|
+
import { NavigationMenu as NavigationMenu$1 } from 'radix-ui';
|
|
5
5
|
import { ChevronDown } from 'lucide-react';
|
|
6
6
|
import { cva } from 'class-variance-authority';
|
|
7
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
var NavigationMenu = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
10
|
-
|
|
10
|
+
NavigationMenu$1.Root,
|
|
11
11
|
{
|
|
12
12
|
ref,
|
|
13
13
|
className: cn(
|
|
@@ -21,9 +21,9 @@ var NavigationMenu = React.forwardRef(({ className, children, ...props }, ref) =
|
|
|
21
21
|
]
|
|
22
22
|
}
|
|
23
23
|
));
|
|
24
|
-
NavigationMenu.displayName =
|
|
24
|
+
NavigationMenu.displayName = NavigationMenu$1.Root.displayName;
|
|
25
25
|
var NavigationMenuList = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
26
|
-
|
|
26
|
+
NavigationMenu$1.List,
|
|
27
27
|
{
|
|
28
28
|
ref,
|
|
29
29
|
className: cn(
|
|
@@ -33,13 +33,13 @@ var NavigationMenuList = React.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
33
33
|
...props
|
|
34
34
|
}
|
|
35
35
|
));
|
|
36
|
-
NavigationMenuList.displayName =
|
|
37
|
-
var NavigationMenuItem =
|
|
36
|
+
NavigationMenuList.displayName = NavigationMenu$1.List.displayName;
|
|
37
|
+
var NavigationMenuItem = NavigationMenu$1.Item;
|
|
38
38
|
var navigationMenuTriggerStyle = cva(
|
|
39
39
|
"group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"
|
|
40
40
|
);
|
|
41
41
|
var NavigationMenuTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
42
|
-
|
|
42
|
+
NavigationMenu$1.Trigger,
|
|
43
43
|
{
|
|
44
44
|
ref,
|
|
45
45
|
className: cn(navigationMenuTriggerStyle(), "group", className),
|
|
@@ -57,9 +57,9 @@ var NavigationMenuTrigger = React.forwardRef(({ className, children, ...props },
|
|
|
57
57
|
]
|
|
58
58
|
}
|
|
59
59
|
));
|
|
60
|
-
NavigationMenuTrigger.displayName =
|
|
60
|
+
NavigationMenuTrigger.displayName = NavigationMenu$1.Trigger.displayName;
|
|
61
61
|
var NavigationMenuContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
62
|
-
|
|
62
|
+
NavigationMenu$1.Content,
|
|
63
63
|
{
|
|
64
64
|
ref,
|
|
65
65
|
className: cn(
|
|
@@ -69,10 +69,10 @@ var NavigationMenuContent = React.forwardRef(({ className, ...props }, ref) => /
|
|
|
69
69
|
...props
|
|
70
70
|
}
|
|
71
71
|
));
|
|
72
|
-
NavigationMenuContent.displayName =
|
|
73
|
-
var NavigationMenuLink =
|
|
72
|
+
NavigationMenuContent.displayName = NavigationMenu$1.Content.displayName;
|
|
73
|
+
var NavigationMenuLink = NavigationMenu$1.Link;
|
|
74
74
|
var NavigationMenuViewport = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: cn("absolute left-0 top-full flex justify-center"), children: /* @__PURE__ */ jsx(
|
|
75
|
-
|
|
75
|
+
NavigationMenu$1.Viewport,
|
|
76
76
|
{
|
|
77
77
|
className: cn(
|
|
78
78
|
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
|
|
@@ -82,9 +82,9 @@ var NavigationMenuViewport = React.forwardRef(({ className, ...props }, ref) =>
|
|
|
82
82
|
...props
|
|
83
83
|
}
|
|
84
84
|
) }));
|
|
85
|
-
NavigationMenuViewport.displayName =
|
|
85
|
+
NavigationMenuViewport.displayName = NavigationMenu$1.Viewport.displayName;
|
|
86
86
|
var NavigationMenuIndicator = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
87
|
-
|
|
87
|
+
NavigationMenu$1.Indicator,
|
|
88
88
|
{
|
|
89
89
|
ref,
|
|
90
90
|
className: cn(
|
|
@@ -95,8 +95,8 @@ var NavigationMenuIndicator = React.forwardRef(({ className, ...props }, ref) =>
|
|
|
95
95
|
children: /* @__PURE__ */ jsx("div", { className: "relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" })
|
|
96
96
|
}
|
|
97
97
|
));
|
|
98
|
-
NavigationMenuIndicator.displayName =
|
|
98
|
+
NavigationMenuIndicator.displayName = NavigationMenu$1.Indicator.displayName;
|
|
99
99
|
|
|
100
100
|
export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, navigationMenuTriggerStyle };
|
|
101
|
-
//# sourceMappingURL=chunk-
|
|
102
|
-
//# sourceMappingURL=chunk-
|
|
101
|
+
//# sourceMappingURL=chunk-THD3YOOZ.js.map
|
|
102
|
+
//# sourceMappingURL=chunk-THD3YOOZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ui/navigation-menu.tsx"],"names":["NavigationMenuPrimitive"],"mappings":"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","file":"chunk-THD3YOOZ.js","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { NavigationMenu as NavigationMenuPrimitive } from \"radix-ui\";\nimport { ChevronDown } from \"lucide-react\";\nimport { cva } from \"class-variance-authority\";\n\nimport { cn } from \"../../utils\";\n\nconst NavigationMenu = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n className={cn(\n \"relative z-10 flex max-w-max flex-1 items-center justify-center\",\n className\n )}\n {...props}\n >\n {children}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive.Root>\n));\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;\n\nconst NavigationMenuList = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\n \"group flex flex-1 list-none items-center justify-center space-x-1\",\n className\n )}\n {...props}\n />\n));\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item;\n\nconst navigationMenuTriggerStyle = cva(\n \"group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50\"\n);\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(navigationMenuTriggerStyle(), \"group\", className)}\n {...props}\n >\n {children}{\" \"}\n <ChevronDown\n className=\"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n));\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;\n\nconst NavigationMenuContent = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto\",\n className\n )}\n {...props}\n />\n));\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link;\n\nconst NavigationMenuViewport = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>\n>(({ className, ...props }, ref) => (\n <div className={cn(\"absolute left-0 top-full flex justify-center\")}>\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className\n )}\n ref={ref}\n {...props}\n />\n </div>\n));\nNavigationMenuViewport.displayName =\n NavigationMenuPrimitive.Viewport.displayName;\n\nconst NavigationMenuIndicator = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,\n React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in\",\n className\n )}\n {...props}\n >\n <div className=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n));\nNavigationMenuIndicator.displayName =\n NavigationMenuPrimitive.Indicator.displayName;\n\nexport {\n navigationMenuTriggerStyle,\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport,\n};\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from './chunk-NZ5WBA4R.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Tabs as Tabs$1 } from 'radix-ui';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
var Tabs = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8
|
+
Tabs$1.Root,
|
|
9
|
+
{
|
|
10
|
+
ref,
|
|
11
|
+
className: cn("w-full", className),
|
|
12
|
+
...props
|
|
13
|
+
}
|
|
14
|
+
));
|
|
15
|
+
Tabs.displayName = Tabs$1.Root.displayName;
|
|
16
|
+
var TabsList = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
17
|
+
Tabs$1.List,
|
|
18
|
+
{
|
|
19
|
+
ref,
|
|
20
|
+
className: cn(
|
|
21
|
+
"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
|
|
22
|
+
className
|
|
23
|
+
),
|
|
24
|
+
...props
|
|
25
|
+
}
|
|
26
|
+
));
|
|
27
|
+
TabsList.displayName = Tabs$1.List.displayName;
|
|
28
|
+
var TabsTrigger = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
29
|
+
Tabs$1.Trigger,
|
|
30
|
+
{
|
|
31
|
+
ref,
|
|
32
|
+
className: cn(
|
|
33
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
|
|
34
|
+
// Same active styling as before, now keyed off the `data-state` Radix
|
|
35
|
+
// maintains rather than an `isActive` boolean read from local context.
|
|
36
|
+
"data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
|
|
37
|
+
className
|
|
38
|
+
),
|
|
39
|
+
...props
|
|
40
|
+
}
|
|
41
|
+
));
|
|
42
|
+
TabsTrigger.displayName = Tabs$1.Trigger.displayName;
|
|
43
|
+
var TabsContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
44
|
+
Tabs$1.Content,
|
|
45
|
+
{
|
|
46
|
+
ref,
|
|
47
|
+
className: cn(
|
|
48
|
+
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
49
|
+
className
|
|
50
|
+
),
|
|
51
|
+
...props
|
|
52
|
+
}
|
|
53
|
+
));
|
|
54
|
+
TabsContent.displayName = Tabs$1.Content.displayName;
|
|
55
|
+
|
|
56
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
57
|
+
//# sourceMappingURL=chunk-VXFYETRK.js.map
|
|
58
|
+
//# sourceMappingURL=chunk-VXFYETRK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ui/tabs.tsx"],"names":["TabsPrimitive"],"mappings":";;;;;AAkCA,IAAM,IAAA,GAAa,iBAGjB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1B,GAAA;AAAA,EAACA,MAAA,CAAc,IAAA;AAAA,EAAd;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,QAAA,EAAU,SAAS,CAAA;AAAA,IAChC,GAAG;AAAA;AACN,CACD;AACD,IAAA,CAAK,WAAA,GAAcA,OAAc,IAAA,CAAK,WAAA;AAEtC,IAAM,QAAA,GAAiB,iBAGrB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1B,GAAA;AAAA,EAACA,MAAA,CAAc,IAAA;AAAA,EAAd;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA;AAAA,MACT,4FAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,QAAA,CAAS,WAAA,GAAcA,OAAc,IAAA,CAAK,WAAA;AAE1C,IAAM,WAAA,GAAoB,iBAGxB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1B,GAAA;AAAA,EAACA,MAAA,CAAc,OAAA;AAAA,EAAd;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA;AAAA,MACT,iSAAA;AAAA;AAAA;AAAA,MAGA,qGAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,WAAA,CAAY,WAAA,GAAcA,OAAc,OAAA,CAAQ,WAAA;AAEhD,IAAM,WAAA,GAAoB,iBAGxB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1B,GAAA;AAAA,EAACA,MAAA,CAAc,OAAA;AAAA,EAAd;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA;AAAA,MACT,iIAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,WAAA,CAAY,WAAA,GAAcA,OAAc,OAAA,CAAQ,WAAA","file":"chunk-VXFYETRK.js","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Tabs as TabsPrimitive } from \"radix-ui\";\nimport { cn } from \"../../utils\";\n\ninterface TabsProps\n extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> {\n /**\n * Required here even though Radix's own `defaultValue` is optional — that is\n * the existing contract, and loosening it is a separate decision.\n */\n defaultValue: string;\n}\n\n/**\n * Tabs — a tablist and its panels.\n *\n * Backed by Radix `Tabs`. The hand-rolled version was a React context plus a\n * row of plain `<button>`s: it tracked the selected value correctly and\n * nothing else. Every keyboard and screen-reader affordance the WAI-ARIA tabs\n * pattern asks for was missing — `role=\"tablist\"`/`\"tab\"`/`\"tabpanel\"`, the\n * `aria-selected` state, the `aria-controls`/`aria-labelledby` link between a\n * tab and its panel, the roving `tabindex` that makes the whole tablist ONE\n * tab stop instead of N, and Arrow/Home/End navigation between tabs. Radix\n * supplies all of it, plus the selection state the old version already\n * handled.\n *\n * One behavioural note worth knowing: Radix selects on `mousedown` rather than\n * `click`. Pointer users see no difference, but a synthetic `fireEvent.click`\n * on a trigger no longer changes tabs.\n *\n * @stability Stable\n */\nconst Tabs = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Root>,\n TabsProps\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Root\n ref={ref}\n className={cn(\"w-full\", className)}\n {...props}\n />\n));\nTabs.displayName = TabsPrimitive.Root.displayName;\n\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n \"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground\",\n className\n )}\n {...props}\n />\n));\nTabsList.displayName = TabsPrimitive.List.displayName;\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n // Same active styling as before, now keyed off the `data-state` Radix\n // maintains rather than an `isActive` boolean read from local context.\n \"data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm\",\n className\n )}\n {...props}\n />\n));\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName;\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Content\n ref={ref}\n className={cn(\n \"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n className\n )}\n {...props}\n />\n));\nTabsContent.displayName = TabsPrimitive.Content.displayName;\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Avatar, AvatarImage, AvatarFallback } from './chunk-LNFF2RBD.js';
|
|
2
|
+
import { cn } from './chunk-NZ5WBA4R.js';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var userAvatarVariants = cva("shrink-0", {
|
|
7
|
+
variants: {
|
|
8
|
+
size: {
|
|
9
|
+
sm: "h-8 w-8 text-xs",
|
|
10
|
+
default: "h-10 w-10 text-sm",
|
|
11
|
+
lg: "h-12 w-12 text-base"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
defaultVariants: {
|
|
15
|
+
size: "default"
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var graphemeSegmenter;
|
|
19
|
+
function getGraphemeSegmenter() {
|
|
20
|
+
if (graphemeSegmenter === void 0) {
|
|
21
|
+
graphemeSegmenter = typeof Intl !== "undefined" && typeof Intl.Segmenter === "function" ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null;
|
|
22
|
+
}
|
|
23
|
+
return graphemeSegmenter;
|
|
24
|
+
}
|
|
25
|
+
function firstGrapheme(word) {
|
|
26
|
+
const segmenter = getGraphemeSegmenter();
|
|
27
|
+
if (segmenter) {
|
|
28
|
+
for (const { segment } of segmenter.segment(word)) return segment;
|
|
29
|
+
return "";
|
|
30
|
+
}
|
|
31
|
+
return Array.from(word)[0] ?? "";
|
|
32
|
+
}
|
|
33
|
+
function getInitials(name) {
|
|
34
|
+
const words = name.trim().split(/\s+/).filter(Boolean);
|
|
35
|
+
if (words.length === 0) return "?";
|
|
36
|
+
const first = firstGrapheme(words[0]);
|
|
37
|
+
const last = firstGrapheme(words[words.length - 1]);
|
|
38
|
+
return (words.length === 1 ? first : first + last).toUpperCase();
|
|
39
|
+
}
|
|
40
|
+
function UserAvatar({ name, src, size, className, testID }) {
|
|
41
|
+
return /* @__PURE__ */ jsxs(
|
|
42
|
+
Avatar,
|
|
43
|
+
{
|
|
44
|
+
role: "img",
|
|
45
|
+
"aria-label": name,
|
|
46
|
+
"data-testid": testID,
|
|
47
|
+
className: cn(userAvatarVariants({ size }), className),
|
|
48
|
+
children: [
|
|
49
|
+
src ? /* @__PURE__ */ jsx(AvatarImage, { src, alt: "" }) : null,
|
|
50
|
+
/* @__PURE__ */ jsx(AvatarFallback, { children: getInitials(name) })
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { UserAvatar, userAvatarVariants };
|
|
57
|
+
//# sourceMappingURL=chunk-XBX6QMR5.js.map
|
|
58
|
+
//# sourceMappingURL=chunk-XBX6QMR5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/patterns/user-avatar.tsx"],"names":[],"mappings":";;;;;AAKA,IAAM,kBAAA,GAAqB,IAAI,UAAA,EAAY;AAAA,EACzC,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,EAAA,EAAI,iBAAA;AAAA,MACJ,OAAA,EAAS,mBAAA;AAAA,MACT,EAAA,EAAI;AAAA;AACN,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,IAAA,EAAM;AAAA;AAEV,CAAC;AAID,IAAI,iBAAA;AAEJ,SAAS,oBAAA,GAA8C;AACrD,EAAA,IAAI,sBAAsB,MAAA,EAAW;AACnC,IAAA,iBAAA,GACE,OAAO,IAAA,KAAS,WAAA,IAAe,OAAO,KAAK,SAAA,KAAc,UAAA,GACrD,IAAI,IAAA,CAAK,UAAU,MAAA,EAAW,EAAE,WAAA,EAAa,UAAA,EAAY,CAAA,GACzD,IAAA;AAAA,EACR;AACA,EAAA,OAAO,iBAAA;AACT;AAWA,SAAS,cAAc,IAAA,EAAsB;AAC3C,EAAA,MAAM,YAAY,oBAAA,EAAqB;AACvC,EAAA,IAAI,SAAA,EAAW;AACb,IAAA,KAAA,MAAW,EAAE,OAAA,EAAQ,IAAK,UAAU,OAAA,CAAQ,IAAI,GAAG,OAAO,OAAA;AAC1D,IAAA,OAAO,EAAA;AAAA,EACT;AACA,EAAA,OAAO,KAAA,CAAM,IAAA,CAAK,IAAI,CAAA,CAAE,CAAC,CAAA,IAAK,EAAA;AAChC;AAGA,SAAS,YAAY,IAAA,EAAsB;AACzC,EAAA,MAAM,KAAA,GAAQ,KAAK,IAAA,EAAK,CAAE,MAAM,KAAK,CAAA,CAAE,OAAO,OAAO,CAAA;AACrD,EAAA,IAAI,KAAA,CAAM,MAAA,KAAW,CAAA,EAAG,OAAO,GAAA;AAC/B,EAAA,MAAM,KAAA,GAAQ,aAAA,CAAc,KAAA,CAAM,CAAC,CAAE,CAAA;AACrC,EAAA,MAAM,OAAO,aAAA,CAAc,KAAA,CAAM,KAAA,CAAM,MAAA,GAAS,CAAC,CAAE,CAAA;AACnD,EAAA,OAAA,CAAQ,MAAM,MAAA,KAAW,CAAA,GAAI,KAAA,GAAQ,KAAA,GAAQ,MAAM,WAAA,EAAY;AACjE;AA2BO,SAAS,WAAW,EAAE,IAAA,EAAM,KAAK,IAAA,EAAM,SAAA,EAAW,QAAO,EAAoB;AAClF,EAAA,uBACE,IAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,KAAA;AAAA,MACL,YAAA,EAAY,IAAA;AAAA,MACZ,aAAA,EAAa,MAAA;AAAA,MACb,WAAW,EAAA,CAAG,kBAAA,CAAmB,EAAE,IAAA,EAAM,GAAG,SAAS,CAAA;AAAA,MAOpD,QAAA,EAAA;AAAA,QAAA,GAAA,mBAAM,GAAA,CAAC,WAAA,EAAA,EAAY,GAAA,EAAU,GAAA,EAAI,IAAG,CAAA,GAAK,IAAA;AAAA,wBAC1C,GAAA,CAAC,cAAA,EAAA,EAAgB,QAAA,EAAA,WAAA,CAAY,IAAI,CAAA,EAAE;AAAA;AAAA;AAAA,GACrC;AAEJ","file":"chunk-XBX6QMR5.js","sourcesContent":["import * as React from \"react\";\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"../ui/avatar\";\nimport { cn } from \"../../utils\";\n\nconst userAvatarVariants = cva(\"shrink-0\", {\n variants: {\n size: {\n sm: \"h-8 w-8 text-xs\",\n default: \"h-10 w-10 text-sm\",\n lg: \"h-12 w-12 text-base\",\n },\n },\n defaultVariants: {\n size: \"default\",\n },\n});\n\n// Built lazily once — constructing a Segmenter per call is wasteful, and a\n// runtime either has Intl.Segmenter or never will.\nlet graphemeSegmenter: Intl.Segmenter | null | undefined;\n\nfunction getGraphemeSegmenter(): Intl.Segmenter | null {\n if (graphemeSegmenter === undefined) {\n graphemeSegmenter =\n typeof Intl !== \"undefined\" && typeof Intl.Segmenter === \"function\"\n ? new Intl.Segmenter(undefined, { granularity: \"grapheme\" })\n : null;\n }\n return graphemeSegmenter;\n}\n\n/**\n * First user-perceived character of `word`.\n *\n * `charAt(0)` / `[0]` index UTF-16 code units, so a name starting outside the\n * BMP (\"𐐀 Smith\", \"😊 Jones\") yields a lone surrogate that renders as a\n * replacement glyph. Grapheme segmentation additionally keeps combining marks\n * attached (\"é\" as e + U+0301); the `Array.from` fallback is code-point based,\n * which still fixes the surrogate case on runtimes without `Intl.Segmenter`.\n */\nfunction firstGrapheme(word: string): string {\n const segmenter = getGraphemeSegmenter();\n if (segmenter) {\n for (const { segment } of segmenter.segment(word)) return segment;\n return \"\";\n }\n return Array.from(word)[0] ?? \"\";\n}\n\n/** First + last initial from a display name (\"Ada Lovelace\" -> \"AL\", \"Cher\" -> \"C\"). */\nfunction getInitials(name: string): string {\n const words = name.trim().split(/\\s+/).filter(Boolean);\n if (words.length === 0) return \"?\";\n const first = firstGrapheme(words[0]!);\n const last = firstGrapheme(words[words.length - 1]!);\n return (words.length === 1 ? first : first + last).toUpperCase();\n}\n\nexport interface UserAvatarProps extends VariantProps<typeof userAvatarVariants> {\n /** Full display name. Source for the computed initials fallback and the accessible name. */\n name: string;\n /** Image URL. Omit — or let it fail to load — to show the initials fallback. */\n src?: string | null;\n className?: string;\n /** Stable test/automation selector (emitted as `data-testid`). */\n testID?: string;\n}\n\n/**\n * UserAvatar — canonical user-identity avatar. Shows the person's photo when\n * `src` is set and loads successfully; otherwise (including a failed image\n * load — Radix's Avatar swaps to the fallback automatically) it falls back\n * to initials computed from `name`. Wraps the lower-level\n * `Avatar`/`AvatarImage`/`AvatarFallback` primitives so call sites stop\n * hand-rolling initials logic per-usage.\n *\n * The root carries `role=\"img\"` + `aria-label={name}` so the person's full name\n * is the accessible name on BOTH paths — without it the fallback route renders\n * a bare `span`, a generic element whose author-supplied label AT may ignore,\n * announcing only the visible initials (\"AL\").\n *\n * @stability Beta\n */\nexport function UserAvatar({ name, src, size, className, testID }: UserAvatarProps) {\n return (\n <Avatar\n role=\"img\"\n aria-label={name}\n data-testid={testID}\n className={cn(userAvatarVariants({ size }), className)}\n >\n {/*\n alt=\"\" is deliberate: the root already exposes `name` as the accessible\n name, so labelling the nested <img> too would announce the person twice\n once the image loads.\n */}\n {src ? <AvatarImage src={src} alt=\"\" /> : null}\n <AvatarFallback>{getInitials(name)}</AvatarFallback>\n </Avatar>\n );\n}\n\nexport { userAvatarVariants };\n"]}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from './chunk-NZ5WBA4R.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import
|
|
4
|
+
import { Dialog } from 'radix-ui';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
6
6
|
import { X } from 'lucide-react';
|
|
7
7
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
|
-
var Sheet =
|
|
10
|
-
var SheetTrigger =
|
|
11
|
-
var SheetClose =
|
|
12
|
-
var SheetPortal =
|
|
9
|
+
var Sheet = Dialog.Root;
|
|
10
|
+
var SheetTrigger = Dialog.Trigger;
|
|
11
|
+
var SheetClose = Dialog.Close;
|
|
12
|
+
var SheetPortal = Dialog.Portal;
|
|
13
13
|
var SheetOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
14
|
-
|
|
14
|
+
Dialog.Overlay,
|
|
15
15
|
{
|
|
16
16
|
className: cn(
|
|
17
17
|
"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
@@ -21,7 +21,7 @@ var SheetOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
21
21
|
ref
|
|
22
22
|
}
|
|
23
23
|
));
|
|
24
|
-
SheetOverlay.displayName =
|
|
24
|
+
SheetOverlay.displayName = Dialog.Overlay.displayName;
|
|
25
25
|
var sheetVariants = cva(
|
|
26
26
|
"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
27
27
|
{
|
|
@@ -38,17 +38,17 @@ var sheetVariants = cva(
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
|
-
var SheetContent = React.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
41
|
+
var SheetContent = React.forwardRef(({ side = "right", className, children, showCloseButton = true, ...props }, ref) => /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
42
42
|
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
43
43
|
/* @__PURE__ */ jsxs(
|
|
44
|
-
|
|
44
|
+
Dialog.Content,
|
|
45
45
|
{
|
|
46
46
|
ref,
|
|
47
47
|
className: cn(sheetVariants({ side }), className),
|
|
48
48
|
...props,
|
|
49
49
|
children: [
|
|
50
50
|
children,
|
|
51
|
-
/* @__PURE__ */ jsxs(
|
|
51
|
+
showCloseButton && /* @__PURE__ */ jsxs(Dialog.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
|
|
52
52
|
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
53
53
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
54
54
|
] })
|
|
@@ -56,7 +56,7 @@ var SheetContent = React.forwardRef(({ side = "right", className, children, ...p
|
|
|
56
56
|
}
|
|
57
57
|
)
|
|
58
58
|
] }));
|
|
59
|
-
SheetContent.displayName =
|
|
59
|
+
SheetContent.displayName = Dialog.Content.displayName;
|
|
60
60
|
var SheetHeader = ({
|
|
61
61
|
className,
|
|
62
62
|
...props
|
|
@@ -86,24 +86,24 @@ var SheetFooter = ({
|
|
|
86
86
|
);
|
|
87
87
|
SheetFooter.displayName = "SheetFooter";
|
|
88
88
|
var SheetTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
89
|
-
|
|
89
|
+
Dialog.Title,
|
|
90
90
|
{
|
|
91
91
|
ref,
|
|
92
92
|
className: cn("text-lg font-semibold text-foreground", className),
|
|
93
93
|
...props
|
|
94
94
|
}
|
|
95
95
|
));
|
|
96
|
-
SheetTitle.displayName =
|
|
96
|
+
SheetTitle.displayName = Dialog.Title.displayName;
|
|
97
97
|
var SheetDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
98
|
-
|
|
98
|
+
Dialog.Description,
|
|
99
99
|
{
|
|
100
100
|
ref,
|
|
101
101
|
className: cn("text-sm text-muted-foreground", className),
|
|
102
102
|
...props
|
|
103
103
|
}
|
|
104
104
|
));
|
|
105
|
-
SheetDescription.displayName =
|
|
105
|
+
SheetDescription.displayName = Dialog.Description.displayName;
|
|
106
106
|
|
|
107
107
|
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger };
|
|
108
|
-
//# sourceMappingURL=chunk-
|
|
109
|
-
//# sourceMappingURL=chunk-
|
|
108
|
+
//# sourceMappingURL=chunk-XCGZPFT7.js.map
|
|
109
|
+
//# sourceMappingURL=chunk-XCGZPFT7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/ui/sheet.tsx"],"names":["SheetPrimitive"],"mappings":"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","file":"chunk-XCGZPFT7.js","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Dialog as SheetPrimitive } from \"radix-ui\";\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport { X } from \"lucide-react\";\nimport { cn } from \"../../utils\";\n\nconst Sheet = SheetPrimitive.Root;\nconst SheetTrigger = SheetPrimitive.Trigger;\nconst SheetClose = SheetPrimitive.Close;\nconst SheetPortal = SheetPrimitive.Portal;\n\nconst SheetOverlay = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n ref={ref}\n />\n));\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName;\n\nconst sheetVariants = cva(\n \"fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500\",\n {\n variants: {\n side: {\n top: \"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top\",\n bottom:\n \"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom\",\n left: \"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm\",\n right:\n \"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm\",\n },\n },\n defaultVariants: {\n side: \"right\",\n },\n }\n);\n\ninterface SheetContentProps\n extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,\n VariantProps<typeof sheetVariants> {\n /** Show the built-in top-right close affordance. Default true. Mirrors `DialogContent`'s `showCloseButton` — set false when a composing consumer (e.g. `DetailPanel`) renders its own close control. */\n showCloseButton?: boolean;\n}\n\nconst SheetContent = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Content>,\n SheetContentProps\n>(({ side = \"right\", className, children, showCloseButton = true, ...props }, ref) => (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content\n ref={ref}\n className={cn(sheetVariants({ side }), className)}\n {...props}\n >\n {children}\n {showCloseButton && (\n <SheetPrimitive.Close className=\"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary\">\n <X className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Content>\n </SheetPortal>\n));\nSheetContent.displayName = SheetPrimitive.Content.displayName;\n\nconst SheetHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col space-y-2 text-center sm:text-left\",\n className,\n )}\n {...props}\n />\n);\nSheetHeader.displayName = \"SheetHeader\";\n\nconst SheetFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className,\n )}\n {...props}\n />\n);\nSheetFooter.displayName = \"SheetFooter\";\n\nconst SheetTitle = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold text-foreground\", className)}\n {...props}\n />\n));\nSheetTitle.displayName = SheetPrimitive.Title.displayName;\n\nconst SheetDescription = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nSheetDescription.displayName = SheetPrimitive.Description.displayName;\n\nexport {\n Sheet,\n SheetPortal,\n SheetOverlay,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n};\n"]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { cn } from './chunk-NZ5WBA4R.js';
|
|
2
|
+
import { cva } from 'class-variance-authority';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var statusBadgeVariants = cva(
|
|
6
|
+
"inline-flex w-fit items-center whitespace-nowrap rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
7
|
+
{
|
|
8
|
+
variants: {
|
|
9
|
+
// AA-safe status text on the tinted chip, same technique as `Badge`'s
|
|
10
|
+
// success/warning/info variants (see badge.tsx): same-hue text on the
|
|
11
|
+
// raw tint fails WCAG AA, so text uses the semantic Tailwind ramp
|
|
12
|
+
// (same hues as the Genesis status tokens). All four hues clear 4.5:1
|
|
13
|
+
// at the 700(light)/300(dark) stops over the /15(light) and /20(dark)
|
|
14
|
+
// tints (emerald-700 4.76:1, blue-700 5.64:1, red-700 ~5.3:1);
|
|
15
|
+
// warning needs the 800/200 bump (amber-700 was 4.48:1 — under the
|
|
16
|
+
// 4.5:1 floor).
|
|
17
|
+
//
|
|
18
|
+
// NOTE on `destructive` vs `error`: the offTrack/blocked tint is
|
|
19
|
+
// `bg-destructive`, NOT `bg-error`, even though these two map to the
|
|
20
|
+
// `semantic.error` token upstream. The token layer names this
|
|
21
|
+
// semantic `error`; the CSS theme layer (apps' `@theme` blocks,
|
|
22
|
+
// design-system's generated genesis.css) names the very same color
|
|
23
|
+
// `destructive` and registers no `--color-error` at all — so
|
|
24
|
+
// `bg-error` would silently emit no utility and render an untinted
|
|
25
|
+
// chip. In light mode the two are literally the same value
|
|
26
|
+
// (`--destructive` = 0 84.2% 60.2% = #EF4444 = semantic.error.DEFAULT).
|
|
27
|
+
// Dark mode is the one asymmetry: the theme darkens `--destructive`
|
|
28
|
+
// (0 62.8% 30.6%) while keeping success/warning/info bright, so these
|
|
29
|
+
// two chips read as a more subdued tint there. Left as-is rather than
|
|
30
|
+
// hand-tuning a red-only opacity — that is a theme-layer
|
|
31
|
+
// characteristic, not this component's to paper over.
|
|
32
|
+
//
|
|
33
|
+
// TOKEN GAP — do NOT "fix" the text colours below to `text-*-foreground`
|
|
34
|
+
// (CMT-365-001 proposed exactly that). Those tokens pair with a SOLID
|
|
35
|
+
// fill: `--success-foreground` is `0 0% 100%` (pure white) and
|
|
36
|
+
// `--destructive-foreground` is `0 0% 98%`. These chips use a 15%/20%
|
|
37
|
+
// TINT, so white text on them measures roughly 1.2:1 — unreadable. That
|
|
38
|
+
// review was right about the defect and wrong about the remedy.
|
|
39
|
+
//
|
|
40
|
+
// The correct fix needs a token that does not exist yet: an "on-tint"
|
|
41
|
+
// foreground per status. The scales already carry the right value —
|
|
42
|
+
// `success.dark` is #065F46, which is what `emerald-700` approximates —
|
|
43
|
+
// but no `--color-success-dark` utility is emitted, so it cannot be
|
|
44
|
+
// referenced from here today. Adding one is a design-system API
|
|
45
|
+
// decision, so it is recorded rather than smuggled in.
|
|
46
|
+
//
|
|
47
|
+
// Until then this is a KNOWN brand-theming gap, stated plainly: a
|
|
48
|
+
// consumer brand that redefines `success` gets the new background and
|
|
49
|
+
// the old text colour.
|
|
50
|
+
status: {
|
|
51
|
+
onTrack: "border-transparent bg-success/15 text-emerald-700 dark:bg-success/20 dark:text-emerald-300",
|
|
52
|
+
done: "border-transparent bg-success/15 text-emerald-700 dark:bg-success/20 dark:text-emerald-300",
|
|
53
|
+
atRisk: "border-transparent bg-warning/15 text-amber-800 dark:bg-warning/20 dark:text-amber-200",
|
|
54
|
+
inProgress: "border-transparent bg-info/15 text-blue-700 dark:bg-info/20 dark:text-blue-300",
|
|
55
|
+
offTrack: "border-transparent bg-destructive/15 text-red-700 dark:bg-destructive/20 dark:text-red-300",
|
|
56
|
+
blocked: "border-transparent bg-destructive/15 text-red-700 dark:bg-destructive/20 dark:text-red-300"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
function StatusBadge({ className, status, ...props }) {
|
|
62
|
+
return /* @__PURE__ */ jsx(
|
|
63
|
+
"span",
|
|
64
|
+
{
|
|
65
|
+
className: cn(statusBadgeVariants({ status }), className),
|
|
66
|
+
...props
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export { StatusBadge, statusBadgeVariants };
|
|
72
|
+
//# sourceMappingURL=chunk-XMK3T4TA.js.map
|
|
73
|
+
//# sourceMappingURL=chunk-XMK3T4TA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/patterns/status-badge.tsx"],"names":[],"mappings":";;;;AAgBO,IAAM,mBAAA,GAAsB,GAAA;AAAA,EACjC,8LAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MA0CR,MAAA,EAAQ;AAAA,QACN,OAAA,EACE,4FAAA;AAAA,QACF,IAAA,EAAM,4FAAA;AAAA,QACN,MAAA,EACE,wFAAA;AAAA,QACF,UAAA,EACE,gFAAA;AAAA,QACF,QAAA,EACE,4FAAA;AAAA,QACF,OAAA,EACE;AAAA;AACJ;AACF;AAEJ;AAwBO,SAAS,YAAY,EAAE,SAAA,EAAW,MAAA,EAAQ,GAAG,OAAM,EAAqB;AAC7E,EAAA,uBACE,GAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,WAAW,EAAA,CAAG,mBAAA,CAAoB,EAAE,MAAA,EAAQ,GAAG,SAAS,CAAA;AAAA,MACvD,GAAG;AAAA;AAAA,GACN;AAEJ","file":"chunk-XMK3T4TA.js","sourcesContent":["import * as React from \"react\";\nimport { type VariantProps, cva } from \"class-variance-authority\";\nimport type { status } from \"@marktiderman/genesis-design-system/tokens\";\nimport { cn } from \"../../utils\";\n\n/**\n * The domain status vocabulary `StatusBadge` understands. A `Pick` (not a\n * hand-copied literal union) of `@marktiderman/genesis-design-system`'s\n * `status` tokens, so removing/renaming one of these keys upstream breaks\n * this file's typecheck instead of silently drifting.\n */\ntype StatusBadgeStatus = keyof Pick<\n typeof status,\n \"onTrack\" | \"atRisk\" | \"offTrack\" | \"done\" | \"blocked\" | \"inProgress\"\n>;\n\nexport const statusBadgeVariants = cva(\n \"inline-flex w-fit items-center whitespace-nowrap rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2\",\n {\n variants: {\n // AA-safe status text on the tinted chip, same technique as `Badge`'s\n // success/warning/info variants (see badge.tsx): same-hue text on the\n // raw tint fails WCAG AA, so text uses the semantic Tailwind ramp\n // (same hues as the Genesis status tokens). All four hues clear 4.5:1\n // at the 700(light)/300(dark) stops over the /15(light) and /20(dark)\n // tints (emerald-700 4.76:1, blue-700 5.64:1, red-700 ~5.3:1);\n // warning needs the 800/200 bump (amber-700 was 4.48:1 — under the\n // 4.5:1 floor).\n //\n // NOTE on `destructive` vs `error`: the offTrack/blocked tint is\n // `bg-destructive`, NOT `bg-error`, even though these two map to the\n // `semantic.error` token upstream. The token layer names this\n // semantic `error`; the CSS theme layer (apps' `@theme` blocks,\n // design-system's generated genesis.css) names the very same color\n // `destructive` and registers no `--color-error` at all — so\n // `bg-error` would silently emit no utility and render an untinted\n // chip. In light mode the two are literally the same value\n // (`--destructive` = 0 84.2% 60.2% = #EF4444 = semantic.error.DEFAULT).\n // Dark mode is the one asymmetry: the theme darkens `--destructive`\n // (0 62.8% 30.6%) while keeping success/warning/info bright, so these\n // two chips read as a more subdued tint there. Left as-is rather than\n // hand-tuning a red-only opacity — that is a theme-layer\n // characteristic, not this component's to paper over.\n //\n // TOKEN GAP — do NOT \"fix\" the text colours below to `text-*-foreground`\n // (CMT-365-001 proposed exactly that). Those tokens pair with a SOLID\n // fill: `--success-foreground` is `0 0% 100%` (pure white) and\n // `--destructive-foreground` is `0 0% 98%`. These chips use a 15%/20%\n // TINT, so white text on them measures roughly 1.2:1 — unreadable. That\n // review was right about the defect and wrong about the remedy.\n //\n // The correct fix needs a token that does not exist yet: an \"on-tint\"\n // foreground per status. The scales already carry the right value —\n // `success.dark` is #065F46, which is what `emerald-700` approximates —\n // but no `--color-success-dark` utility is emitted, so it cannot be\n // referenced from here today. Adding one is a design-system API\n // decision, so it is recorded rather than smuggled in.\n //\n // Until then this is a KNOWN brand-theming gap, stated plainly: a\n // consumer brand that redefines `success` gets the new background and\n // the old text colour.\n status: {\n onTrack:\n \"border-transparent bg-success/15 text-emerald-700 dark:bg-success/20 dark:text-emerald-300\",\n done: \"border-transparent bg-success/15 text-emerald-700 dark:bg-success/20 dark:text-emerald-300\",\n atRisk:\n \"border-transparent bg-warning/15 text-amber-800 dark:bg-warning/20 dark:text-amber-200\",\n inProgress:\n \"border-transparent bg-info/15 text-blue-700 dark:bg-info/20 dark:text-blue-300\",\n offTrack:\n \"border-transparent bg-destructive/15 text-red-700 dark:bg-destructive/20 dark:text-red-300\",\n blocked:\n \"border-transparent bg-destructive/15 text-red-700 dark:bg-destructive/20 dark:text-red-300\",\n } satisfies Record<StatusBadgeStatus, string>,\n },\n }\n);\n\nexport interface StatusBadgeProps\n extends Omit<React.HTMLAttributes<HTMLSpanElement>, \"color\"> {\n /** Which status to render. Drives the tint via `statusBadgeVariants`. */\n status: StatusBadgeStatus;\n}\n\n/**\n * Status-specific badge for progress/health states — the EOS/OKR-style\n * \"on track / at risk / off track\" goal vocabulary plus common\n * task-lifecycle states (\"done\", \"blocked\", \"in progress\").\n *\n * `Badge` answers \"what color is this badge\"; `StatusBadge` answers \"what\n * does this business status look like as a badge\" — it owns the\n * status → semantic-token mapping so consumers pass a status name instead\n * of hand-rolling their own `status-to-color` lookup (the pattern this\n * component exists to retire). Colors are token-driven — the same\n * `bg-success` / `bg-warning` / `bg-destructive` / `bg-info` semantic\n * Tailwind families `Badge` already uses, backed by\n * `@marktiderman/genesis-design-system`'s `status` tokens — no raw hex here.\n *\n * @stability Beta\n */\nexport function StatusBadge({ className, status, ...props }: StatusBadgeProps) {\n return (\n <span\n className={cn(statusBadgeVariants({ status }), className)}\n {...props}\n />\n );\n}\n\nexport type { StatusBadgeStatus };\n"]}
|