@gerege-systems/ui 0.14.0 → 0.15.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.
Files changed (98) hide show
  1. package/dist-lib/components/ui/Accordion.js +1 -1
  2. package/dist-lib/components/ui/Accordion.js.map +1 -1
  3. package/dist-lib/components/ui/Alert.js +1 -1
  4. package/dist-lib/components/ui/Alert.js.map +1 -1
  5. package/dist-lib/components/ui/Avatar.js +1 -0
  6. package/dist-lib/components/ui/Avatar.js.map +1 -1
  7. package/dist-lib/components/ui/Breadcrumbs.js +6 -6
  8. package/dist-lib/components/ui/Breadcrumbs.js.map +1 -1
  9. package/dist-lib/components/ui/Button.js +9 -8
  10. package/dist-lib/components/ui/Button.js.map +1 -1
  11. package/dist-lib/components/ui/Calendar.js +3 -3
  12. package/dist-lib/components/ui/Calendar.js.map +1 -1
  13. package/dist-lib/components/ui/Card.js +7 -7
  14. package/dist-lib/components/ui/Card.js.map +1 -1
  15. package/dist-lib/components/ui/Carousel.js +1 -1
  16. package/dist-lib/components/ui/Carousel.js.map +1 -1
  17. package/dist-lib/components/ui/Chart.js +1 -1
  18. package/dist-lib/components/ui/Chart.js.map +1 -1
  19. package/dist-lib/components/ui/Checkbox.js +1 -1
  20. package/dist-lib/components/ui/Checkbox.js.map +1 -1
  21. package/dist-lib/components/ui/Combobox.js +12 -12
  22. package/dist-lib/components/ui/Combobox.js.map +1 -1
  23. package/dist-lib/components/ui/CommandPalette.js +8 -8
  24. package/dist-lib/components/ui/CommandPalette.js.map +1 -1
  25. package/dist-lib/components/ui/ContextMenu.js +1 -1
  26. package/dist-lib/components/ui/ContextMenu.js.map +1 -1
  27. package/dist-lib/components/ui/DataGrid.d.ts +7 -2
  28. package/dist-lib/components/ui/DataGrid.js +66 -54
  29. package/dist-lib/components/ui/DataGrid.js.map +1 -1
  30. package/dist-lib/components/ui/DatePicker.js +2 -2
  31. package/dist-lib/components/ui/DatePicker.js.map +1 -1
  32. package/dist-lib/components/ui/DesignSystemProvider.js +25 -25
  33. package/dist-lib/components/ui/DesignSystemProvider.js.map +1 -1
  34. package/dist-lib/components/ui/Dialog.d.ts +5 -1
  35. package/dist-lib/components/ui/Dialog.js +55 -58
  36. package/dist-lib/components/ui/Dialog.js.map +1 -1
  37. package/dist-lib/components/ui/Drawer.js +18 -18
  38. package/dist-lib/components/ui/Drawer.js.map +1 -1
  39. package/dist-lib/components/ui/DropdownMenu.js +1 -1
  40. package/dist-lib/components/ui/DropdownMenu.js.map +1 -1
  41. package/dist-lib/components/ui/ErrorState.d.ts +5 -3
  42. package/dist-lib/components/ui/ErrorState.js +1 -1
  43. package/dist-lib/components/ui/ErrorState.js.map +1 -1
  44. package/dist-lib/components/ui/FileUpload.d.ts +6 -0
  45. package/dist-lib/components/ui/FileUpload.js +61 -56
  46. package/dist-lib/components/ui/FileUpload.js.map +1 -1
  47. package/dist-lib/components/ui/IconButton.js +7 -7
  48. package/dist-lib/components/ui/IconButton.js.map +1 -1
  49. package/dist-lib/components/ui/Input.js +7 -7
  50. package/dist-lib/components/ui/Input.js.map +1 -1
  51. package/dist-lib/components/ui/MultiSelect.js +61 -60
  52. package/dist-lib/components/ui/MultiSelect.js.map +1 -1
  53. package/dist-lib/components/ui/Pagination.js +21 -21
  54. package/dist-lib/components/ui/Pagination.js.map +1 -1
  55. package/dist-lib/components/ui/Popover.js +4 -4
  56. package/dist-lib/components/ui/Popover.js.map +1 -1
  57. package/dist-lib/components/ui/RadioGroup.js +9 -9
  58. package/dist-lib/components/ui/RadioGroup.js.map +1 -1
  59. package/dist-lib/components/ui/RelativeTime.d.ts +5 -1
  60. package/dist-lib/components/ui/RelativeTime.js +23 -19
  61. package/dist-lib/components/ui/RelativeTime.js.map +1 -1
  62. package/dist-lib/components/ui/ScrollArea.js +11 -11
  63. package/dist-lib/components/ui/ScrollArea.js.map +1 -1
  64. package/dist-lib/components/ui/Select.js +29 -29
  65. package/dist-lib/components/ui/Select.js.map +1 -1
  66. package/dist-lib/components/ui/Sheet.js +1 -1
  67. package/dist-lib/components/ui/Sheet.js.map +1 -1
  68. package/dist-lib/components/ui/Sidebar.d.ts +3 -1
  69. package/dist-lib/components/ui/Sidebar.js +111 -107
  70. package/dist-lib/components/ui/Sidebar.js.map +1 -1
  71. package/dist-lib/components/ui/Slider.js +29 -29
  72. package/dist-lib/components/ui/Slider.js.map +1 -1
  73. package/dist-lib/components/ui/Snackbar.js +28 -19
  74. package/dist-lib/components/ui/Snackbar.js.map +1 -1
  75. package/dist-lib/components/ui/Switch.js +7 -7
  76. package/dist-lib/components/ui/Switch.js.map +1 -1
  77. package/dist-lib/components/ui/Table.js +6 -6
  78. package/dist-lib/components/ui/Table.js.map +1 -1
  79. package/dist-lib/components/ui/Tabs.js +6 -6
  80. package/dist-lib/components/ui/Tabs.js.map +1 -1
  81. package/dist-lib/components/ui/TagInput.js +3 -3
  82. package/dist-lib/components/ui/TagInput.js.map +1 -1
  83. package/dist-lib/components/ui/Textarea.js +1 -1
  84. package/dist-lib/components/ui/Textarea.js.map +1 -1
  85. package/dist-lib/components/ui/Toast.js +8 -8
  86. package/dist-lib/components/ui/Toast.js.map +1 -1
  87. package/dist-lib/components/ui/TopNav.js +9 -9
  88. package/dist-lib/components/ui/TopNav.js.map +1 -1
  89. package/dist-lib/components/ui/Tree.js +2 -2
  90. package/dist-lib/components/ui/Tree.js.map +1 -1
  91. package/dist-lib/lib/strings.d.ts +4 -0
  92. package/dist-lib/lib/strings.js +3 -1
  93. package/dist-lib/lib/strings.js.map +1 -1
  94. package/dist-lib/lib/strings.mn.js +3 -1
  95. package/dist-lib/lib/strings.mn.js.map +1 -1
  96. package/dist-lib/styles.css +1 -1
  97. package/dist-lib/theme.css +67 -49
  98. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Popover.js","sources":["../../../src/components/ui/Popover.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, type ComponentPropsWithoutRef, type ComponentRef } from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { cn } from '@/lib/utils';\n\nexport const Popover = PopoverPrimitive.Root;\nexport const PopoverTrigger = PopoverPrimitive.Trigger;\nexport const PopoverAnchor = PopoverPrimitive.Anchor;\nexport const PopoverClose = PopoverPrimitive.Close;\n\nexport const PopoverContent = forwardRef<\n ComponentRef<typeof PopoverPrimitive.Content>,\n ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(function PopoverContent({ className, align = 'center', sideOffset = 4, ...props }, ref) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'border-border bg-popover text-popover-foreground z-[var(--z-popover)] max-w-sm min-w-72 rounded-lg border p-4 shadow-md',\n 'focus-visible:ring-ring focus-visible:ring-offset-background outline-none focus-visible:ring-2 focus-visible:ring-offset-2',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n 'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-1 data-[side=top]:slide-in-from-bottom-1',\n 'data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n});\nPopoverContent.displayName = 'PopoverContent';\n\n/**\n * @example\n * <Popover>\n * <PopoverTrigger asChild><Button variant=\"outline\">Options</Button></PopoverTrigger>\n * <PopoverContent>…</PopoverContent>\n * </Popover>\n *\n * @do Reserve Popover for low-stakes, transient UI — pickers, mini-forms.\n * @dont Use Popover for navigation menus — that's DropdownMenu.\n */\n"],"names":["Popover","PopoverPrimitive","PopoverTrigger","PopoverAnchor","PopoverClose","PopoverContent","forwardRef","className","align","sideOffset","props","ref","jsx","cn"],"mappings":";;;;;AAMO,MAAMA,IAAUC,EAAiB,MAC3BC,IAAiBD,EAAiB,SAClCE,IAAgBF,EAAiB,QACjCG,IAAeH,EAAiB,OAEhCI,IAAiBC,EAG5B,SAAwB,EAAE,WAAAC,GAAW,OAAAC,IAAQ,UAAU,YAAAC,IAAa,GAAG,GAAGC,EAAA,GAASC,GAAK;AACxF,SACE,gBAAAC,EAACX,EAAiB,QAAjB,EACC,UAAA,gBAAAW;AAAA,IAACX,EAAiB;AAAA,IAAjB;AAAA,MACC,aAAU;AAAA,MACV,KAAAU;AAAA,MACA,OAAAH;AAAA,MACA,YAAAC;AAAA,MACA,WAAWI;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACAN;AAAA,MAAA;AAAA,MAED,GAAGG;AAAA,IAAA;AAAA,EAAA,GAER;AAEJ,CAAC;AACDL,EAAe,cAAc;"}
1
+ {"version":3,"file":"Popover.js","sources":["../../../src/components/ui/Popover.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, type ComponentPropsWithoutRef, type ComponentRef } from 'react';\nimport * as PopoverPrimitive from '@radix-ui/react-popover';\nimport { cn } from '@/lib/utils';\n\nexport const Popover = PopoverPrimitive.Root;\nexport const PopoverTrigger = PopoverPrimitive.Trigger;\nexport const PopoverAnchor = PopoverPrimitive.Anchor;\nexport const PopoverClose = PopoverPrimitive.Close;\n\nexport const PopoverContent = forwardRef<\n ComponentRef<typeof PopoverPrimitive.Content>,\n ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(function PopoverContent({ className, align = 'center', sideOffset = 4, ...props }, ref) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'border-border bg-popover text-popover-foreground z-[var(--z-popover)] max-w-sm min-w-72 rounded-lg border p-4 shadow-md',\n 'focus-visible:ring-ring focus-visible:ring-offset-background outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n 'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-1 data-[side=top]:slide-in-from-bottom-1',\n 'data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n});\nPopoverContent.displayName = 'PopoverContent';\n\n/**\n * @example\n * <Popover>\n * <PopoverTrigger asChild><Button variant=\"outline\">Options</Button></PopoverTrigger>\n * <PopoverContent>…</PopoverContent>\n * </Popover>\n *\n * @do Reserve Popover for low-stakes, transient UI — pickers, mini-forms.\n * @dont Use Popover for navigation menus — that's DropdownMenu.\n */\n"],"names":["Popover","PopoverPrimitive","PopoverTrigger","PopoverAnchor","PopoverClose","PopoverContent","forwardRef","className","align","sideOffset","props","ref","jsx","cn"],"mappings":";;;;;AAMO,MAAMA,IAAUC,EAAiB,MAC3BC,IAAiBD,EAAiB,SAClCE,IAAgBF,EAAiB,QACjCG,IAAeH,EAAiB,OAEhCI,IAAiBC,EAG5B,SAAwB,EAAE,WAAAC,GAAW,OAAAC,IAAQ,UAAU,YAAAC,IAAa,GAAG,GAAGC,EAAA,GAASC,GAAK;AACxF,SACE,gBAAAC,EAACX,EAAiB,QAAjB,EACC,UAAA,gBAAAW;AAAA,IAACX,EAAiB;AAAA,IAAjB;AAAA,MACC,aAAU;AAAA,MACV,KAAAU;AAAA,MACA,OAAAH;AAAA,MACA,YAAAC;AAAA,MACA,WAAWI;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACAN;AAAA,MAAA;AAAA,MAED,GAAGG;AAAA,IAAA;AAAA,EAAA,GAER;AAEJ,CAAC;AACDL,EAAe,cAAc;"}
@@ -2,18 +2,18 @@
2
2
  import { jsx as e, jsxs as c } from "react/jsx-runtime";
3
3
  import { forwardRef as f, useId as h } from "react";
4
4
  import * as d from "@radix-ui/react-radio-group";
5
- import { cn as a } from "../../lib/utils.js";
6
- const y = f(function({ className: i, orientation: r = "vertical", ...o }, t) {
5
+ import { cn as i } from "../../lib/utils.js";
6
+ const y = f(function({ className: a, orientation: r = "vertical", ...o }, t) {
7
7
  return /* @__PURE__ */ e(
8
8
  d.Root,
9
9
  {
10
10
  "data-slot": "radio-group",
11
11
  ref: t,
12
12
  orientation: r,
13
- className: a(
13
+ className: i(
14
14
  "flex gap-3",
15
15
  r === "vertical" ? "flex-col" : "flex-row flex-wrap",
16
- i
16
+ a
17
17
  ),
18
18
  ...o
19
19
  }
@@ -22,7 +22,7 @@ const y = f(function({ className: i, orientation: r = "vertical", ...o }, t) {
22
22
  y.displayName = "RadioGroup";
23
23
  const N = f(
24
24
  function({
25
- className: i,
25
+ className: a,
26
26
  label: r,
27
27
  description: o,
28
28
  hideLabel: t,
@@ -32,7 +32,7 @@ const N = f(
32
32
  ...p
33
33
  }, x) {
34
34
  const g = h(), s = m ?? g, n = o ? `${s}-desc` : void 0, v = [n, b].filter(Boolean).join(" ") || void 0;
35
- return /* @__PURE__ */ c("div", { className: a("flex items-start gap-2.5", i), children: [
35
+ return /* @__PURE__ */ c("div", { className: i("flex items-start gap-2.5", a), children: [
36
36
  /* @__PURE__ */ e(
37
37
  d.Item,
38
38
  {
@@ -40,12 +40,12 @@ const N = f(
40
40
  id: s,
41
41
  disabled: l,
42
42
  "aria-describedby": v,
43
- className: a(
43
+ className: i(
44
44
  "bg-card relative mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border",
45
45
  // WCAG 2.5.8: 16px visual box, ≥24px hit area via an invisible inset halo.
46
46
  'before:absolute before:-inset-1.5 before:rounded-full before:content-[""]',
47
47
  "transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]",
48
- "focus-visible:ring-ring focus-visible:ring-offset-background outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
48
+ "focus-visible:ring-ring focus-visible:ring-offset-background outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2",
49
49
  "data-[state=checked]:border-accent",
50
50
  "disabled:cursor-not-allowed disabled:opacity-50",
51
51
  "border-border-input aria-invalid:border-danger"
@@ -59,7 +59,7 @@ const N = f(
59
59
  "label",
60
60
  {
61
61
  htmlFor: s,
62
- className: a(
62
+ className: i(
63
63
  "text-foreground text-sm select-none",
64
64
  l && "cursor-not-allowed opacity-50",
65
65
  t && "sr-only"
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.js","sources":["../../../src/components/ui/RadioGroup.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n useId,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type ReactNode,\n} from 'react';\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport { cn } from '@/lib/utils';\n\nexport interface RadioGroupProps extends ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> {\n /** Lay out the radios vertically (default) or horizontally. Also drives arrow-key navigation. */\n orientation?: 'horizontal' | 'vertical';\n}\n\nexport const RadioGroup = forwardRef<\n ComponentRef<typeof RadioGroupPrimitive.Root>,\n RadioGroupProps\n>(function RadioGroup({ className, orientation = 'vertical', ...props }, ref) {\n return (\n <RadioGroupPrimitive.Root\n data-slot=\"radio-group\"\n ref={ref}\n orientation={orientation}\n className={cn(\n 'flex gap-3',\n orientation === 'vertical' ? 'flex-col' : 'flex-row flex-wrap',\n className,\n )}\n {...props}\n />\n );\n});\nRadioGroup.displayName = 'RadioGroup';\n\nexport interface RadioItemProps extends Omit<\n ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>,\n 'asChild'\n> {\n label?: ReactNode;\n description?: ReactNode;\n hideLabel?: boolean;\n}\n\n/**\n * One radio option with inline label + description.\n *\n * @example\n * <RadioGroup defaultValue=\"weekly\">\n * <RadioItem value=\"daily\" label=\"Daily\" description=\"Every morning at 9am\" />\n * <RadioItem value=\"weekly\" label=\"Weekly\" description=\"Monday mornings\" />\n * <RadioItem value=\"never\" label=\"Never\" />\n * </RadioGroup>\n *\n * @do Pair every RadioItem with a label — naked radios are unreachable for\n * screen reader users.\n * @dont Use RadioGroup for binary choices — use Switch.\n */\nexport const RadioItem = forwardRef<ComponentRef<typeof RadioGroupPrimitive.Item>, RadioItemProps>(\n function RadioItem(\n {\n className,\n label,\n description,\n hideLabel,\n id,\n disabled,\n 'aria-describedby': ariaDescribedby,\n ...props\n },\n ref,\n ) {\n const autoId = useId();\n const fieldId = id ?? autoId;\n const descId = description ? `${fieldId}-desc` : undefined;\n const describedBy = [descId, ariaDescribedby].filter(Boolean).join(' ') || undefined;\n\n return (\n <div className={cn('flex items-start gap-2.5', className)}>\n <RadioGroupPrimitive.Item\n ref={ref}\n id={fieldId}\n disabled={disabled}\n aria-describedby={describedBy}\n className={cn(\n 'bg-card relative mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border',\n // WCAG 2.5.8: 16px visual box, ≥24px hit area via an invisible inset halo.\n 'before:absolute before:-inset-1.5 before:rounded-full before:content-[\"\"]',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'focus-visible:ring-ring focus-visible:ring-offset-background outline-none focus-visible:ring-2 focus-visible:ring-offset-2',\n 'data-[state=checked]:border-accent',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'border-border-input aria-invalid:border-danger',\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n <span className=\"bg-accent size-2 rounded-full\" aria-hidden />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n\n {label && (\n <div className=\"flex flex-col gap-0.5\">\n <label\n htmlFor={fieldId}\n className={cn(\n 'text-foreground text-sm select-none',\n disabled && 'cursor-not-allowed opacity-50',\n hideLabel && 'sr-only',\n )}\n >\n {label}\n </label>\n {description && (\n <p id={descId} className=\"text-foreground-subtle text-xs\">\n {description}\n </p>\n )}\n </div>\n )}\n </div>\n );\n },\n);\nRadioItem.displayName = 'RadioItem';\n"],"names":["RadioGroup","forwardRef","className","orientation","props","ref","jsx","RadioGroupPrimitive","cn","RadioItem","label","description","hideLabel","id","disabled","ariaDescribedby","autoId","useId","fieldId","descId","describedBy","jsxs"],"mappings":";;;;;AAiBO,MAAMA,IAAaC,EAGxB,SAAoB,EAAE,WAAAC,GAAW,aAAAC,IAAc,YAAY,GAAGC,EAAA,GAASC,GAAK;AAC5E,SACE,gBAAAC;AAAA,IAACC,EAAoB;AAAA,IAApB;AAAA,MACC,aAAU;AAAA,MACV,KAAAF;AAAA,MACA,aAAAF;AAAA,MACA,WAAWK;AAAA,QACT;AAAA,QACAL,MAAgB,aAAa,aAAa;AAAA,QAC1CD;AAAA,MAAA;AAAA,MAED,GAAGE;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDJ,EAAW,cAAc;AAyBlB,MAAMS,IAAYR;AAAA,EACvB,SACE;AAAA,IACE,WAAAC;AAAA,IACA,OAAAQ;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,IAAAC;AAAA,IACA,UAAAC;AAAA,IACA,oBAAoBC;AAAA,IACpB,GAAGX;AAAA,EAAA,GAELC,GACA;AACA,UAAMW,IAASC,EAAA,GACTC,IAAUL,KAAMG,GAChBG,IAASR,IAAc,GAAGO,CAAO,UAAU,QAC3CE,IAAc,CAACD,GAAQJ,CAAe,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,KAAK;AAE3E,6BACG,OAAA,EAAI,WAAWP,EAAG,4BAA4BN,CAAS,GACtD,UAAA;AAAA,MAAA,gBAAAI;AAAA,QAACC,EAAoB;AAAA,QAApB;AAAA,UACC,KAAAF;AAAA,UACA,IAAIa;AAAA,UACJ,UAAAJ;AAAA,UACA,oBAAkBM;AAAA,UAClB,WAAWZ;AAAA,YACT;AAAA;AAAA,YAEA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,UAED,GAAGJ;AAAA,UAEJ,UAAA,gBAAAE,EAACC,EAAoB,WAApB,EAA8B,WAAU,oCACvC,UAAA,gBAAAD,EAAC,QAAA,EAAK,WAAU,iCAAgC,eAAW,GAAA,CAAC,EAAA,CAC9D;AAAA,QAAA;AAAA,MAAA;AAAA,MAGDI,KACC,gBAAAW,EAAC,OAAA,EAAI,WAAU,yBACb,UAAA;AAAA,QAAA,gBAAAf;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,SAASY;AAAA,YACT,WAAWV;AAAA,cACT;AAAA,cACAM,KAAY;AAAA,cACZF,KAAa;AAAA,YAAA;AAAA,YAGd,UAAAF;AAAA,UAAA;AAAA,QAAA;AAAA,QAEFC,KACC,gBAAAL,EAAC,KAAA,EAAE,IAAIa,GAAQ,WAAU,kCACtB,UAAAR,EAAA,CACH;AAAA,MAAA,EAAA,CAEJ;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AACAF,EAAU,cAAc;"}
1
+ {"version":3,"file":"RadioGroup.js","sources":["../../../src/components/ui/RadioGroup.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n useId,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type ReactNode,\n} from 'react';\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group';\nimport { cn } from '@/lib/utils';\n\nexport interface RadioGroupProps extends ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> {\n /** Lay out the radios vertically (default) or horizontally. Also drives arrow-key navigation. */\n orientation?: 'horizontal' | 'vertical';\n}\n\nexport const RadioGroup = forwardRef<\n ComponentRef<typeof RadioGroupPrimitive.Root>,\n RadioGroupProps\n>(function RadioGroup({ className, orientation = 'vertical', ...props }, ref) {\n return (\n <RadioGroupPrimitive.Root\n data-slot=\"radio-group\"\n ref={ref}\n orientation={orientation}\n className={cn(\n 'flex gap-3',\n orientation === 'vertical' ? 'flex-col' : 'flex-row flex-wrap',\n className,\n )}\n {...props}\n />\n );\n});\nRadioGroup.displayName = 'RadioGroup';\n\nexport interface RadioItemProps extends Omit<\n ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>,\n 'asChild'\n> {\n label?: ReactNode;\n description?: ReactNode;\n hideLabel?: boolean;\n}\n\n/**\n * One radio option with inline label + description.\n *\n * @example\n * <RadioGroup defaultValue=\"weekly\">\n * <RadioItem value=\"daily\" label=\"Daily\" description=\"Every morning at 9am\" />\n * <RadioItem value=\"weekly\" label=\"Weekly\" description=\"Monday mornings\" />\n * <RadioItem value=\"never\" label=\"Never\" />\n * </RadioGroup>\n *\n * @do Pair every RadioItem with a label — naked radios are unreachable for\n * screen reader users.\n * @dont Use RadioGroup for binary choices — use Switch.\n */\nexport const RadioItem = forwardRef<ComponentRef<typeof RadioGroupPrimitive.Item>, RadioItemProps>(\n function RadioItem(\n {\n className,\n label,\n description,\n hideLabel,\n id,\n disabled,\n 'aria-describedby': ariaDescribedby,\n ...props\n },\n ref,\n ) {\n const autoId = useId();\n const fieldId = id ?? autoId;\n const descId = description ? `${fieldId}-desc` : undefined;\n const describedBy = [descId, ariaDescribedby].filter(Boolean).join(' ') || undefined;\n\n return (\n <div className={cn('flex items-start gap-2.5', className)}>\n <RadioGroupPrimitive.Item\n ref={ref}\n id={fieldId}\n disabled={disabled}\n aria-describedby={describedBy}\n className={cn(\n 'bg-card relative mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border',\n // WCAG 2.5.8: 16px visual box, ≥24px hit area via an invisible inset halo.\n 'before:absolute before:-inset-1.5 before:rounded-full before:content-[\"\"]',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'focus-visible:ring-ring focus-visible:ring-offset-background outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2',\n 'data-[state=checked]:border-accent',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'border-border-input aria-invalid:border-danger',\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n <span className=\"bg-accent size-2 rounded-full\" aria-hidden />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n\n {label && (\n <div className=\"flex flex-col gap-0.5\">\n <label\n htmlFor={fieldId}\n className={cn(\n 'text-foreground text-sm select-none',\n disabled && 'cursor-not-allowed opacity-50',\n hideLabel && 'sr-only',\n )}\n >\n {label}\n </label>\n {description && (\n <p id={descId} className=\"text-foreground-subtle text-xs\">\n {description}\n </p>\n )}\n </div>\n )}\n </div>\n );\n },\n);\nRadioItem.displayName = 'RadioItem';\n"],"names":["RadioGroup","forwardRef","className","orientation","props","ref","jsx","RadioGroupPrimitive","cn","RadioItem","label","description","hideLabel","id","disabled","ariaDescribedby","autoId","useId","fieldId","descId","describedBy","jsxs"],"mappings":";;;;;AAiBO,MAAMA,IAAaC,EAGxB,SAAoB,EAAE,WAAAC,GAAW,aAAAC,IAAc,YAAY,GAAGC,EAAA,GAASC,GAAK;AAC5E,SACE,gBAAAC;AAAA,IAACC,EAAoB;AAAA,IAApB;AAAA,MACC,aAAU;AAAA,MACV,KAAAF;AAAA,MACA,aAAAF;AAAA,MACA,WAAWK;AAAA,QACT;AAAA,QACAL,MAAgB,aAAa,aAAa;AAAA,QAC1CD;AAAA,MAAA;AAAA,MAED,GAAGE;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDJ,EAAW,cAAc;AAyBlB,MAAMS,IAAYR;AAAA,EACvB,SACE;AAAA,IACE,WAAAC;AAAA,IACA,OAAAQ;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,IAAAC;AAAA,IACA,UAAAC;AAAA,IACA,oBAAoBC;AAAA,IACpB,GAAGX;AAAA,EAAA,GAELC,GACA;AACA,UAAMW,IAASC,EAAA,GACTC,IAAUL,KAAMG,GAChBG,IAASR,IAAc,GAAGO,CAAO,UAAU,QAC3CE,IAAc,CAACD,GAAQJ,CAAe,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,KAAK;AAE3E,6BACG,OAAA,EAAI,WAAWP,EAAG,4BAA4BN,CAAS,GACtD,UAAA;AAAA,MAAA,gBAAAI;AAAA,QAACC,EAAoB;AAAA,QAApB;AAAA,UACC,KAAAF;AAAA,UACA,IAAIa;AAAA,UACJ,UAAAJ;AAAA,UACA,oBAAkBM;AAAA,UAClB,WAAWZ;AAAA,YACT;AAAA;AAAA,YAEA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UAAA;AAAA,UAED,GAAGJ;AAAA,UAEJ,UAAA,gBAAAE,EAACC,EAAoB,WAApB,EAA8B,WAAU,oCACvC,UAAA,gBAAAD,EAAC,QAAA,EAAK,WAAU,iCAAgC,eAAW,GAAA,CAAC,EAAA,CAC9D;AAAA,QAAA;AAAA,MAAA;AAAA,MAGDI,KACC,gBAAAW,EAAC,OAAA,EAAI,WAAU,yBACb,UAAA;AAAA,QAAA,gBAAAf;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,SAASY;AAAA,YACT,WAAWV;AAAA,cACT;AAAA,cACAM,KAAY;AAAA,cACZF,KAAa;AAAA,YAAA;AAAA,YAGd,UAAAF;AAAA,UAAA;AAAA,QAAA;AAAA,QAEFC,KACC,gBAAAL,EAAC,KAAA,EAAE,IAAIa,GAAQ,WAAU,kCACtB,UAAAR,EAAA,CACH;AAAA,MAAA,EAAA,CAEJ;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AACAF,EAAU,cAAc;"}
@@ -3,7 +3,11 @@ import { FormatDateOptions } from '../../lib/format.js';
3
3
  export interface RelativeTimeProps extends Omit<TimeHTMLAttributes<HTMLTimeElement>, 'dateTime'> {
4
4
  /** The instant to describe. */
5
5
  date: Date | number | string;
6
- /** Reference "now". Default `Date.now()` at render — pass one for stable SSR/tests. */
6
+ /**
7
+ * Reference "now". Omitted: the current minute, re-read every minute so the
8
+ * label does not go stale ("1 min ago" stays true). Pass a fixed value for
9
+ * deterministic SSR and tests.
10
+ */
7
11
  now?: Date | number;
8
12
  /** Options for the absolute `title` (tooltip). */
9
13
  absolute?: FormatDateOptions;
@@ -1,32 +1,36 @@
1
1
  "use client";
2
- import { jsx as D } from "react/jsx-runtime";
3
- import { forwardRef as N } from "react";
4
- import { formatDate as h } from "../../lib/format.js";
5
- import { formatString as a } from "../../lib/strings.js";
6
- import { useStrings as M } from "../../hooks/use-strings.js";
7
- import { cn as b } from "../../lib/utils.js";
8
- const f = 6e4, l = 60 * f, m = 24 * l, R = N(function({ date: n, now: o, absolute: d, className: g, ...p }, T) {
9
- const t = M().relativeTime, s = n instanceof Date ? n : new Date(n), v = o === void 0 ? Date.now() : o instanceof Date ? o.getTime() : o, c = s.getTime() - v, e = Math.abs(c), r = c > 0, u = h(s, d);
2
+ import { jsx as b } from "react/jsx-runtime";
3
+ import { forwardRef as R, useSyncExternalStore as y } from "react";
4
+ import { formatDate as A } from "../../lib/format.js";
5
+ import { formatString as f } from "../../lib/strings.js";
6
+ import { useStrings as I } from "../../hooks/use-strings.js";
7
+ import { cn as x } from "../../lib/utils.js";
8
+ const r = 6e4, d = 60 * r, u = 24 * d, a = /* @__PURE__ */ new Set();
9
+ let m;
10
+ const j = (c) => (a.add(c), m ?? (m = setInterval(() => a.forEach((o) => o()), 3e4)), () => {
11
+ a.delete(c), a.size === 0 && m !== void 0 && (clearInterval(m), m = void 0);
12
+ }), h = () => Math.floor(Date.now() / r) * r, w = R(function({ date: o, now: n, absolute: p, className: M, ...T }, D) {
13
+ const e = I().relativeTime, s = o instanceof Date ? o : new Date(o), N = y(j, h, h), S = n === void 0 ? N : n instanceof Date ? n.getTime() : n, v = s.getTime() - S, t = Math.abs(v), l = v > 0, g = A(s, p);
10
14
  let i;
11
- return e < f ? i = t.justNow : e < l ? i = a(r ? t.inMinutes : t.minutesAgo, {
12
- n: Math.round(e / f)
13
- }) : e < m ? i = a(r ? t.inHours : t.hoursAgo, {
14
- n: Math.round(e / l)
15
- }) : e < 30 * m ? i = a(r ? t.inDays : t.daysAgo, { n: Math.round(e / m) }) : i = u, /* @__PURE__ */ D(
15
+ return t < r ? i = e.justNow : t < d ? i = f(l ? e.inMinutes : e.minutesAgo, {
16
+ n: Math.round(t / r)
17
+ }) : t < u ? i = f(l ? e.inHours : e.hoursAgo, {
18
+ n: Math.round(t / d)
19
+ }) : t < 30 * u ? i = f(l ? e.inDays : e.daysAgo, { n: Math.round(t / u) }) : i = g, /* @__PURE__ */ b(
16
20
  "time",
17
21
  {
18
22
  "data-slot": "relative-time",
19
- ref: T,
23
+ ref: D,
20
24
  dateTime: Number.isNaN(s.getTime()) ? void 0 : s.toISOString(),
21
- title: u,
22
- className: b("tabular", g),
23
- ...p,
25
+ title: g,
26
+ className: x("tabular", M),
27
+ ...T,
24
28
  children: i
25
29
  }
26
30
  );
27
31
  });
28
- R.displayName = "RelativeTime";
32
+ w.displayName = "RelativeTime";
29
33
  export {
30
- R as RelativeTime
34
+ w as RelativeTime
31
35
  };
32
36
  //# sourceMappingURL=RelativeTime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RelativeTime.js","sources":["../../../src/components/ui/RelativeTime.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, type TimeHTMLAttributes } from 'react';\nimport { formatDate, type FormatDateOptions } from '@/lib/format';\nimport { formatString } from '@/lib/strings';\nimport { useStrings } from '@/hooks/use-strings';\nimport { cn } from '@/lib/utils';\n\nexport interface RelativeTimeProps extends Omit<TimeHTMLAttributes<HTMLTimeElement>, 'dateTime'> {\n /** The instant to describe. */\n date: Date | number | string;\n /** Reference \"now\". Default `Date.now()` at render — pass one for stable SSR/tests. */\n now?: Date | number;\n /** Options for the absolute `title` (tooltip). */\n absolute?: FormatDateOptions;\n}\n\nconst MIN = 60_000;\nconst HOUR = 60 * MIN;\nconst DAY = 24 * HOUR;\n\n/**\n * `<time>` showing \"5 min ago\" with the absolute timestamp as `title` and a\n * machine-readable `dateTime`. Strings come from `UiStrings.relativeTime`.\n * Beyond 30 days it falls back to the absolute date so text never goes stale.\n *\n * @example\n * <RelativeTime date={post.createdAt} />\n */\nexport const RelativeTime = forwardRef<HTMLTimeElement, RelativeTimeProps>(function RelativeTime(\n { date, now, absolute, className, ...props },\n ref,\n) {\n const strings = useStrings().relativeTime;\n const d = date instanceof Date ? date : new Date(date);\n const ref_ = now === undefined ? Date.now() : now instanceof Date ? now.getTime() : now;\n const diff = d.getTime() - ref_;\n const abs = Math.abs(diff);\n const future = diff > 0;\n const title = formatDate(d, absolute);\n\n let label: string;\n if (abs < MIN) label = strings.justNow;\n else if (abs < HOUR)\n label = formatString(future ? strings.inMinutes : strings.minutesAgo, {\n n: Math.round(abs / MIN),\n });\n else if (abs < DAY)\n label = formatString(future ? strings.inHours : strings.hoursAgo, {\n n: Math.round(abs / HOUR),\n });\n else if (abs < 30 * DAY)\n label = formatString(future ? strings.inDays : strings.daysAgo, { n: Math.round(abs / DAY) });\n else label = title;\n\n return (\n <time\n data-slot=\"relative-time\"\n ref={ref}\n dateTime={Number.isNaN(d.getTime()) ? undefined : d.toISOString()}\n title={title}\n className={cn('tabular', className)}\n {...props}\n >\n {label}\n </time>\n );\n});\nRelativeTime.displayName = 'RelativeTime';\n"],"names":["MIN","HOUR","DAY","RelativeTime","forwardRef","date","now","absolute","className","props","ref","strings","useStrings","d","ref_","diff","abs","future","title","formatDate","label","formatString","jsx","cn"],"mappings":";;;;;;;AAiBA,MAAMA,IAAM,KACNC,IAAO,KAAKD,GACZE,IAAM,KAAKD,GAUJE,IAAeC,EAA+C,SACzE,EAAE,MAAAC,GAAM,KAAAC,GAAK,UAAAC,GAAU,WAAAC,GAAW,GAAGC,EAAA,GACrCC,GACA;AACA,QAAMC,IAAUC,IAAa,cACvBC,IAAIR,aAAgB,OAAOA,IAAO,IAAI,KAAKA,CAAI,GAC/CS,IAAOR,MAAQ,SAAY,KAAK,QAAQA,aAAe,OAAOA,EAAI,QAAA,IAAYA,GAC9ES,IAAOF,EAAE,QAAA,IAAYC,GACrBE,IAAM,KAAK,IAAID,CAAI,GACnBE,IAASF,IAAO,GAChBG,IAAQC,EAAWN,GAAGN,CAAQ;AAEpC,MAAIa;AACJ,SAAIJ,IAAMhB,IAAKoB,IAAQT,EAAQ,UACtBK,IAAMf,IACbmB,IAAQC,EAAaJ,IAASN,EAAQ,YAAYA,EAAQ,YAAY;AAAA,IACpE,GAAG,KAAK,MAAMK,IAAMhB,CAAG;AAAA,EAAA,CACxB,IACMgB,IAAMd,IACbkB,IAAQC,EAAaJ,IAASN,EAAQ,UAAUA,EAAQ,UAAU;AAAA,IAChE,GAAG,KAAK,MAAMK,IAAMf,CAAI;AAAA,EAAA,CACzB,IACMe,IAAM,KAAKd,IAClBkB,IAAQC,EAAaJ,IAASN,EAAQ,SAASA,EAAQ,SAAS,EAAE,GAAG,KAAK,MAAMK,IAAMd,CAAG,GAAG,IACzFkB,IAAQF,GAGX,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,KAAAZ;AAAA,MACA,UAAU,OAAO,MAAMG,EAAE,SAAS,IAAI,SAAYA,EAAE,YAAA;AAAA,MACpD,OAAAK;AAAA,MACA,WAAWK,EAAG,WAAWf,CAAS;AAAA,MACjC,GAAGC;AAAA,MAEH,UAAAW;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;AACDjB,EAAa,cAAc;"}
1
+ {"version":3,"file":"RelativeTime.js","sources":["../../../src/components/ui/RelativeTime.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, useSyncExternalStore, type TimeHTMLAttributes } from 'react';\nimport { formatDate, type FormatDateOptions } from '@/lib/format';\nimport { formatString } from '@/lib/strings';\nimport { useStrings } from '@/hooks/use-strings';\nimport { cn } from '@/lib/utils';\n\nexport interface RelativeTimeProps extends Omit<TimeHTMLAttributes<HTMLTimeElement>, 'dateTime'> {\n /** The instant to describe. */\n date: Date | number | string;\n /**\n * Reference \"now\". Omitted: the current minute, re-read every minute so the\n * label does not go stale (\"1 min ago\" stays true). Pass a fixed value for\n * deterministic SSR and tests.\n */\n now?: Date | number;\n /** Options for the absolute `title` (tooltip). */\n absolute?: FormatDateOptions;\n}\n\nconst MIN = 60_000;\nconst HOUR = 60 * MIN;\nconst DAY = 24 * HOUR;\n\n/**\n * One shared minute ticker for every mounted RelativeTime. The snapshot is the\n * current minute (not the millisecond) so it is referentially stable between\n * renders, and so server and client agree unless a minute boundary falls\n * between the two — the same granularity the label itself has.\n */\nconst listeners = new Set<() => void>();\nlet timer: ReturnType<typeof setInterval> | undefined;\nconst subscribe = (cb: () => void) => {\n listeners.add(cb);\n timer ??= setInterval(() => listeners.forEach((l) => l()), 30_000);\n return () => {\n listeners.delete(cb);\n if (listeners.size === 0 && timer !== undefined) {\n clearInterval(timer);\n timer = undefined;\n }\n };\n};\nconst currentMinute = () => Math.floor(Date.now() / MIN) * MIN;\n\n/**\n * `<time>` showing \"5 min ago\" with the absolute timestamp as `title` and a\n * machine-readable `dateTime`. Strings come from `UiStrings.relativeTime`.\n * Beyond 30 days it falls back to the absolute date so text never goes stale.\n *\n * @example\n * <RelativeTime date={post.createdAt} />\n */\nexport const RelativeTime = forwardRef<HTMLTimeElement, RelativeTimeProps>(function RelativeTime(\n { date, now, absolute, className, ...props },\n ref,\n) {\n const strings = useStrings().relativeTime;\n const d = date instanceof Date ? date : new Date(date);\n const tick = useSyncExternalStore(subscribe, currentMinute, currentMinute);\n const ref_ = now === undefined ? tick : now instanceof Date ? now.getTime() : now;\n const diff = d.getTime() - ref_;\n const abs = Math.abs(diff);\n const future = diff > 0;\n const title = formatDate(d, absolute);\n\n let label: string;\n if (abs < MIN) label = strings.justNow;\n else if (abs < HOUR)\n label = formatString(future ? strings.inMinutes : strings.minutesAgo, {\n n: Math.round(abs / MIN),\n });\n else if (abs < DAY)\n label = formatString(future ? strings.inHours : strings.hoursAgo, {\n n: Math.round(abs / HOUR),\n });\n else if (abs < 30 * DAY)\n label = formatString(future ? strings.inDays : strings.daysAgo, { n: Math.round(abs / DAY) });\n else label = title;\n\n return (\n <time\n data-slot=\"relative-time\"\n ref={ref}\n dateTime={Number.isNaN(d.getTime()) ? undefined : d.toISOString()}\n title={title}\n className={cn('tabular', className)}\n {...props}\n >\n {label}\n </time>\n );\n});\nRelativeTime.displayName = 'RelativeTime';\n"],"names":["MIN","HOUR","DAY","listeners","timer","subscribe","cb","l","currentMinute","RelativeTime","forwardRef","date","now","absolute","className","props","ref","strings","useStrings","d","tick","useSyncExternalStore","ref_","diff","abs","future","title","formatDate","label","formatString","jsx","cn"],"mappings":";;;;;;;AAqBA,MAAMA,IAAM,KACNC,IAAO,KAAKD,GACZE,IAAM,KAAKD,GAQXE,wBAAgB,IAAA;AACtB,IAAIC;AACJ,MAAMC,IAAY,CAACC,OACjBH,EAAU,IAAIG,CAAE,GAChBF,UAAU,YAAY,MAAMD,EAAU,QAAQ,CAACI,MAAMA,GAAG,GAAG,GAAM,IAC1D,MAAM;AACX,EAAAJ,EAAU,OAAOG,CAAE,GACfH,EAAU,SAAS,KAAKC,MAAU,WACpC,cAAcA,CAAK,GACnBA,IAAQ;AAEZ,IAEII,IAAgB,MAAM,KAAK,MAAM,KAAK,IAAA,IAAQR,CAAG,IAAIA,GAU9CS,IAAeC,EAA+C,SACzE,EAAE,MAAAC,GAAM,KAAAC,GAAK,UAAAC,GAAU,WAAAC,GAAW,GAAGC,EAAA,GACrCC,GACA;AACA,QAAMC,IAAUC,IAAa,cACvBC,IAAIR,aAAgB,OAAOA,IAAO,IAAI,KAAKA,CAAI,GAC/CS,IAAOC,EAAqBhB,GAAWG,GAAeA,CAAa,GACnEc,IAAOV,MAAQ,SAAYQ,IAAOR,aAAe,OAAOA,EAAI,YAAYA,GACxEW,IAAOJ,EAAE,QAAA,IAAYG,GACrBE,IAAM,KAAK,IAAID,CAAI,GACnBE,IAASF,IAAO,GAChBG,IAAQC,EAAWR,GAAGN,CAAQ;AAEpC,MAAIe;AACJ,SAAIJ,IAAMxB,IAAK4B,IAAQX,EAAQ,UACtBO,IAAMvB,IACb2B,IAAQC,EAAaJ,IAASR,EAAQ,YAAYA,EAAQ,YAAY;AAAA,IACpE,GAAG,KAAK,MAAMO,IAAMxB,CAAG;AAAA,EAAA,CACxB,IACMwB,IAAMtB,IACb0B,IAAQC,EAAaJ,IAASR,EAAQ,UAAUA,EAAQ,UAAU;AAAA,IAChE,GAAG,KAAK,MAAMO,IAAMvB,CAAI;AAAA,EAAA,CACzB,IACMuB,IAAM,KAAKtB,IAClB0B,IAAQC,EAAaJ,IAASR,EAAQ,SAASA,EAAQ,SAAS,EAAE,GAAG,KAAK,MAAMO,IAAMtB,CAAG,GAAG,IACzF0B,IAAQF,GAGX,gBAAAI;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,KAAAd;AAAA,MACA,UAAU,OAAO,MAAMG,EAAE,SAAS,IAAI,SAAYA,EAAE,YAAA;AAAA,MACpD,OAAAO;AAAA,MACA,WAAWK,EAAG,WAAWjB,CAAS;AAAA,MACjC,GAAGC;AAAA,MAEH,UAAAa;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;AACDnB,EAAa,cAAc;"}
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- import { jsxs as d, jsx as l } from "react/jsx-runtime";
3
- import { forwardRef as n } from "react";
2
+ import { jsxs as u, jsx as l } from "react/jsx-runtime";
3
+ import { forwardRef as t } from "react";
4
4
  import * as o from "@radix-ui/react-scroll-area";
5
5
  import { cn as s } from "../../lib/utils.js";
6
6
  import { useStrings as m } from "../../hooks/use-strings.js";
7
- const p = n(function({ className: e, children: r, viewportLabel: a, ...i }, f) {
8
- const u = m();
9
- return /* @__PURE__ */ d(
7
+ const p = t(function({ className: e, children: r, viewportLabel: a, ...i }, f) {
8
+ const d = m();
9
+ return /* @__PURE__ */ u(
10
10
  o.Root,
11
11
  {
12
12
  "data-slot": "scroll-area",
@@ -18,23 +18,23 @@ const p = n(function({ className: e, children: r, viewportLabel: a, ...i }, f) {
18
18
  o.Viewport,
19
19
  {
20
20
  role: "group",
21
- "aria-label": a ?? u.scrollArea.region,
21
+ "aria-label": a ?? d.scrollArea.region,
22
22
  tabIndex: 0,
23
23
  className: s(
24
24
  "h-full w-full rounded-[inherit]",
25
- "focus-visible:ring-ring focus-visible:ring-offset-background outline-none focus-visible:ring-2 focus-visible:ring-offset-2"
25
+ "focus-visible:ring-ring focus-visible:ring-offset-background outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2"
26
26
  ),
27
27
  children: r
28
28
  }
29
29
  ),
30
- /* @__PURE__ */ l(t, {}),
30
+ /* @__PURE__ */ l(n, {}),
31
31
  /* @__PURE__ */ l(o.Corner, {})
32
32
  ]
33
33
  }
34
34
  );
35
35
  });
36
36
  p.displayName = "ScrollArea";
37
- const t = n(function({ className: e, orientation: r = "vertical", ...a }, i) {
37
+ const n = t(function({ className: e, orientation: r = "vertical", ...a }, i) {
38
38
  return /* @__PURE__ */ l(
39
39
  o.ScrollAreaScrollbar,
40
40
  {
@@ -51,9 +51,9 @@ const t = n(function({ className: e, orientation: r = "vertical", ...a }, i) {
51
51
  }
52
52
  );
53
53
  });
54
- t.displayName = "ScrollBar";
54
+ n.displayName = "ScrollBar";
55
55
  export {
56
56
  p as ScrollArea,
57
- t as ScrollBar
57
+ n as ScrollBar
58
58
  };
59
59
  //# sourceMappingURL=ScrollArea.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollArea.js","sources":["../../../src/components/ui/ScrollArea.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, type ComponentPropsWithoutRef, type ComponentRef } from 'react';\nimport * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\n\n/**\n * Custom scroll container with consistent styled scrollbars across OS / browsers.\n * Use when the default OS scrollbar would visually clash (sidebars, command\n * palettes, code panes). Falls back to native scroll inside the viewport.\n *\n * @example\n * <ScrollArea className=\"h-64 rounded-md border border-border\">\n * <div className=\"p-3\">…long content…</div>\n * </ScrollArea>\n */\nexport interface ScrollAreaProps extends ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> {\n /**\n * Accessible name of the viewport (a focusable `group` so keyboard users\n * can scroll it). Defaults to `strings.scrollArea.region`.\n */\n viewportLabel?: string;\n}\n\nexport const ScrollArea = forwardRef<\n ComponentRef<typeof ScrollAreaPrimitive.Root>,\n ScrollAreaProps\n>(function ScrollArea({ className, children, viewportLabel, ...props }, ref) {\n const strings = useStrings();\n return (\n <ScrollAreaPrimitive.Root\n data-slot=\"scroll-area\"\n ref={ref}\n className={cn('relative overflow-hidden', className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport\n role=\"group\"\n aria-label={viewportLabel ?? strings.scrollArea.region}\n tabIndex={0}\n className={cn(\n 'h-full w-full rounded-[inherit]',\n 'focus-visible:ring-ring focus-visible:ring-offset-background outline-none focus-visible:ring-2 focus-visible:ring-offset-2',\n )}\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n );\n});\nScrollArea.displayName = 'ScrollArea';\n\nexport const ScrollBar = forwardRef<\n ComponentRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(function ScrollBar({ className, orientation = 'vertical', ...props }, ref) {\n return (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n 'flex touch-none transition-colors duration-[var(--duration-fast)] select-none',\n orientation === 'vertical' && 'h-full w-2 border-l border-l-transparent p-px',\n orientation === 'horizontal' && 'h-2 flex-col border-t border-t-transparent p-px',\n className,\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"bg-border-strong relative flex-1 rounded-full\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n );\n});\nScrollBar.displayName = 'ScrollBar';\n"],"names":["ScrollArea","forwardRef","className","children","viewportLabel","props","ref","strings","useStrings","jsxs","ScrollAreaPrimitive","cn","jsx","ScrollBar","orientation"],"mappings":";;;;;;AAyBO,MAAMA,IAAaC,EAGxB,SAAoB,EAAE,WAAAC,GAAW,UAAAC,GAAU,eAAAC,GAAe,GAAGC,EAAA,GAASC,GAAK;AAC3E,QAAMC,IAAUC,EAAA;AAChB,SACE,gBAAAC;AAAA,IAACC,EAAoB;AAAA,IAApB;AAAA,MACC,aAAU;AAAA,MACV,KAAAJ;AAAA,MACA,WAAWK,EAAG,4BAA4BT,CAAS;AAAA,MAClD,GAAGG;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAO;AAAA,UAACF,EAAoB;AAAA,UAApB;AAAA,YACC,MAAK;AAAA,YACL,cAAYN,KAAiBG,EAAQ,WAAW;AAAA,YAChD,UAAU;AAAA,YACV,WAAWI;AAAA,cACT;AAAA,cACA;AAAA,YAAA;AAAA,YAGD,UAAAR;AAAA,UAAA;AAAA,QAAA;AAAA,0BAEFU,GAAA,EAAU;AAAA,QACX,gBAAAD,EAACF,EAAoB,QAApB,CAAA,CAA2B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGlC,CAAC;AACDV,EAAW,cAAc;AAElB,MAAMa,IAAYZ,EAGvB,SAAmB,EAAE,WAAAC,GAAW,aAAAY,IAAc,YAAY,GAAGT,EAAA,GAASC,GAAK;AAC3E,SACE,gBAAAM;AAAA,IAACF,EAAoB;AAAA,IAApB;AAAA,MACC,KAAAJ;AAAA,MACA,aAAAQ;AAAA,MACA,WAAWH;AAAA,QACT;AAAA,QACAG,MAAgB,cAAc;AAAA,QAC9BA,MAAgB,gBAAgB;AAAA,QAChCZ;AAAA,MAAA;AAAA,MAED,GAAGG;AAAA,MAEJ,UAAA,gBAAAO,EAACF,EAAoB,iBAApB,EAAoC,WAAU,gDAAA,CAAgD;AAAA,IAAA;AAAA,EAAA;AAGrG,CAAC;AACDG,EAAU,cAAc;"}
1
+ {"version":3,"file":"ScrollArea.js","sources":["../../../src/components/ui/ScrollArea.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, type ComponentPropsWithoutRef, type ComponentRef } from 'react';\nimport * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\n\n/**\n * Custom scroll container with consistent styled scrollbars across OS / browsers.\n * Use when the default OS scrollbar would visually clash (sidebars, command\n * palettes, code panes). Falls back to native scroll inside the viewport.\n *\n * @example\n * <ScrollArea className=\"h-64 rounded-md border border-border\">\n * <div className=\"p-3\">…long content…</div>\n * </ScrollArea>\n */\nexport interface ScrollAreaProps extends ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> {\n /**\n * Accessible name of the viewport (a focusable `group` so keyboard users\n * can scroll it). Defaults to `strings.scrollArea.region`.\n */\n viewportLabel?: string;\n}\n\nexport const ScrollArea = forwardRef<\n ComponentRef<typeof ScrollAreaPrimitive.Root>,\n ScrollAreaProps\n>(function ScrollArea({ className, children, viewportLabel, ...props }, ref) {\n const strings = useStrings();\n return (\n <ScrollAreaPrimitive.Root\n data-slot=\"scroll-area\"\n ref={ref}\n className={cn('relative overflow-hidden', className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport\n role=\"group\"\n aria-label={viewportLabel ?? strings.scrollArea.region}\n tabIndex={0}\n className={cn(\n 'h-full w-full rounded-[inherit]',\n 'focus-visible:ring-ring focus-visible:ring-offset-background outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2',\n )}\n >\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n );\n});\nScrollArea.displayName = 'ScrollArea';\n\nexport const ScrollBar = forwardRef<\n ComponentRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,\n ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>\n>(function ScrollBar({ className, orientation = 'vertical', ...props }, ref) {\n return (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n 'flex touch-none transition-colors duration-[var(--duration-fast)] select-none',\n orientation === 'vertical' && 'h-full w-2 border-l border-l-transparent p-px',\n orientation === 'horizontal' && 'h-2 flex-col border-t border-t-transparent p-px',\n className,\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb className=\"bg-border-strong relative flex-1 rounded-full\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n );\n});\nScrollBar.displayName = 'ScrollBar';\n"],"names":["ScrollArea","forwardRef","className","children","viewportLabel","props","ref","strings","useStrings","jsxs","ScrollAreaPrimitive","cn","jsx","ScrollBar","orientation"],"mappings":";;;;;;AAyBO,MAAMA,IAAaC,EAGxB,SAAoB,EAAE,WAAAC,GAAW,UAAAC,GAAU,eAAAC,GAAe,GAAGC,EAAA,GAASC,GAAK;AAC3E,QAAMC,IAAUC,EAAA;AAChB,SACE,gBAAAC;AAAA,IAACC,EAAoB;AAAA,IAApB;AAAA,MACC,aAAU;AAAA,MACV,KAAAJ;AAAA,MACA,WAAWK,EAAG,4BAA4BT,CAAS;AAAA,MAClD,GAAGG;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAO;AAAA,UAACF,EAAoB;AAAA,UAApB;AAAA,YACC,MAAK;AAAA,YACL,cAAYN,KAAiBG,EAAQ,WAAW;AAAA,YAChD,UAAU;AAAA,YACV,WAAWI;AAAA,cACT;AAAA,cACA;AAAA,YAAA;AAAA,YAGD,UAAAR;AAAA,UAAA;AAAA,QAAA;AAAA,0BAEFU,GAAA,EAAU;AAAA,QACX,gBAAAD,EAACF,EAAoB,QAApB,CAAA,CAA2B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGlC,CAAC;AACDV,EAAW,cAAc;AAElB,MAAMa,IAAYZ,EAGvB,SAAmB,EAAE,WAAAC,GAAW,aAAAY,IAAc,YAAY,GAAGT,EAAA,GAASC,GAAK;AAC3E,SACE,gBAAAM;AAAA,IAACF,EAAoB;AAAA,IAApB;AAAA,MACC,KAAAJ;AAAA,MACA,aAAAQ;AAAA,MACA,WAAWH;AAAA,QACT;AAAA,QACAG,MAAgB,cAAc;AAAA,QAC9BA,MAAgB,gBAAgB;AAAA,QAChCZ;AAAA,MAAA;AAAA,MAED,GAAGG;AAAA,MAEJ,UAAA,gBAAAO,EAACF,EAAoB,iBAApB,EAAoC,WAAU,gDAAA,CAAgD;AAAA,IAAA;AAAA,EAAA;AAGrG,CAAC;AACDG,EAAU,cAAc;"}
@@ -1,23 +1,23 @@
1
1
  "use client";
2
2
  import { jsx as t, jsxs as d } from "react/jsx-runtime";
3
3
  import { forwardRef as l } from "react";
4
- import * as a from "@radix-ui/react-select";
4
+ import * as o from "@radix-ui/react-select";
5
5
  import { Check as S, ChevronDown as x, ChevronUp as v, ChevronsUpDown as N } from "../../icons/index.js";
6
6
  import { cn as c } from "../../lib/utils.js";
7
7
  import { useStrings as y } from "../../hooks/use-strings.js";
8
- const G = a.Root, L = a.Value, w = l(function({ className: r, placeholder: o, size: e = "md", tone: i = "default", ...n }, g) {
8
+ const G = o.Root, L = o.Value, w = l(function({ className: r, placeholder: a, size: e = "md", tone: i = "default", ...n }, g) {
9
9
  const b = y(), h = !!(n["aria-label"] || n["aria-labelledby"] || n.id);
10
10
  return /* @__PURE__ */ d(
11
- a.Trigger,
11
+ o.Trigger,
12
12
  {
13
13
  "data-slot": "select-trigger",
14
14
  ref: g,
15
- "aria-label": h ? void 0 : o ?? b.select.placeholder,
15
+ "aria-label": h ? void 0 : a ?? b.select.placeholder,
16
16
  className: c(
17
17
  "bg-card text-foreground inline-flex w-full items-center justify-between gap-2 rounded-md border text-lg md:text-sm",
18
18
  "[&>span]:min-w-0 [&>span]:truncate",
19
19
  "transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]",
20
- "outline-none",
20
+ "outline-hidden",
21
21
  "focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2",
22
22
  "disabled:cursor-not-allowed disabled:opacity-50",
23
23
  "data-[placeholder]:text-foreground-subtle",
@@ -29,24 +29,24 @@ const G = a.Root, L = a.Value, w = l(function({ className: r, placeholder: o, si
29
29
  ),
30
30
  ...n,
31
31
  children: [
32
- /* @__PURE__ */ t(a.Value, { placeholder: o }),
33
- /* @__PURE__ */ t(a.Icon, { asChild: !0, children: /* @__PURE__ */ t(N, { className: "text-foreground-subtle size-4 shrink-0", "aria-hidden": !0 }) })
32
+ /* @__PURE__ */ t(o.Value, { placeholder: a }),
33
+ /* @__PURE__ */ t(o.Icon, { asChild: !0, children: /* @__PURE__ */ t(N, { className: "text-foreground-subtle size-4 shrink-0", "aria-hidden": !0 }) })
34
34
  ]
35
35
  }
36
36
  );
37
37
  });
38
38
  w.displayName = "SelectTrigger";
39
- const u = "flex h-6 cursor-default items-center justify-center text-foreground-subtle", m = l(function({ className: r, ...o }, e) {
40
- return /* @__PURE__ */ t(a.ScrollUpButton, { ref: e, className: c(u, r), ...o, children: /* @__PURE__ */ t(v, { className: "size-4", "aria-hidden": !0 }) });
39
+ const u = "flex h-6 cursor-default items-center justify-center text-foreground-subtle", m = l(function({ className: r, ...a }, e) {
40
+ return /* @__PURE__ */ t(o.ScrollUpButton, { ref: e, className: c(u, r), ...a, children: /* @__PURE__ */ t(v, { className: "size-4", "aria-hidden": !0 }) });
41
41
  });
42
42
  m.displayName = "SelectScrollUpButton";
43
- const p = l(function({ className: r, ...o }, e) {
44
- return /* @__PURE__ */ t(a.ScrollDownButton, { ref: e, className: c(u, r), ...o, children: /* @__PURE__ */ t(x, { className: "size-4", "aria-hidden": !0 }) });
43
+ const p = l(function({ className: r, ...a }, e) {
44
+ return /* @__PURE__ */ t(o.ScrollDownButton, { ref: e, className: c(u, r), ...a, children: /* @__PURE__ */ t(x, { className: "size-4", "aria-hidden": !0 }) });
45
45
  });
46
46
  p.displayName = "SelectScrollDownButton";
47
- const B = l(function({ className: r, children: o, position: e = "popper", ...i }, n) {
48
- return /* @__PURE__ */ t(a.Portal, { children: /* @__PURE__ */ d(
49
- a.Content,
47
+ const B = l(function({ className: r, children: a, position: e = "popper", ...i }, n) {
48
+ return /* @__PURE__ */ t(o.Portal, { children: /* @__PURE__ */ d(
49
+ o.Content,
50
50
  {
51
51
  ref: n,
52
52
  position: e,
@@ -63,33 +63,33 @@ const B = l(function({ className: r, children: o, position: e = "popper", ...i }
63
63
  ...i,
64
64
  children: [
65
65
  /* @__PURE__ */ t(m, {}),
66
- /* @__PURE__ */ t(a.Viewport, { className: "p-1", children: o }),
66
+ /* @__PURE__ */ t(o.Viewport, { className: "p-1", children: a }),
67
67
  /* @__PURE__ */ t(p, {})
68
68
  ]
69
69
  }
70
70
  ) });
71
71
  });
72
72
  B.displayName = "SelectContent";
73
- const f = l(function({ className: r, ...o }, e) {
73
+ const f = l(function({ className: r, ...a }, e) {
74
74
  return /* @__PURE__ */ t(
75
- a.Label,
75
+ o.Label,
76
76
  {
77
77
  ref: e,
78
78
  className: c("text-foreground-subtle px-2 py-1.5 text-xs font-medium", r),
79
- ...o
79
+ ...a
80
80
  }
81
81
  );
82
82
  });
83
83
  f.displayName = "SelectLabel";
84
84
  const C = l(
85
- function({ className: r, children: o, leadingIcon: e, ...i }, n) {
85
+ function({ className: r, children: a, leadingIcon: e, ...i }, n) {
86
86
  return /* @__PURE__ */ d(
87
- a.Item,
87
+ o.Item,
88
88
  {
89
89
  ref: n,
90
90
  className: c(
91
91
  "relative flex w-full cursor-default items-center gap-2 select-none",
92
- "text-foreground rounded-sm px-2 py-1.5 pr-8 text-sm outline-none",
92
+ "text-foreground rounded-sm px-2 py-1.5 pr-8 text-sm outline-hidden",
93
93
  "data-[highlighted]:bg-background-muted data-[highlighted]:text-foreground",
94
94
  "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
95
95
  r
@@ -97,30 +97,30 @@ const C = l(
97
97
  ...i,
98
98
  children: [
99
99
  e && /* @__PURE__ */ t("span", { className: "text-foreground-subtle flex items-center [&_svg]:size-4", children: e }),
100
- /* @__PURE__ */ t(a.ItemText, { children: o }),
101
- /* @__PURE__ */ t("span", { className: "absolute right-2 flex items-center justify-center", children: /* @__PURE__ */ t(a.ItemIndicator, { children: /* @__PURE__ */ t(S, { className: "text-accent size-4", "aria-hidden": !0 }) }) })
100
+ /* @__PURE__ */ t(o.ItemText, { children: a }),
101
+ /* @__PURE__ */ t("span", { className: "absolute right-2 flex items-center justify-center", children: /* @__PURE__ */ t(o.ItemIndicator, { children: /* @__PURE__ */ t(S, { className: "text-accent size-4", "aria-hidden": !0 }) }) })
102
102
  ]
103
103
  }
104
104
  );
105
105
  }
106
106
  );
107
107
  C.displayName = "SelectItem";
108
- const z = l(function({ className: r, ...o }, e) {
108
+ const z = l(function({ className: r, ...a }, e) {
109
109
  return /* @__PURE__ */ t(
110
- a.Separator,
110
+ o.Separator,
111
111
  {
112
112
  ref: e,
113
113
  className: c("bg-border -mx-1 my-1 h-px", r),
114
- ...o
114
+ ...a
115
115
  }
116
116
  );
117
117
  });
118
118
  z.displayName = "SelectSeparator";
119
119
  const I = l(
120
- function({ label: r, children: o, ...e }, i) {
121
- return /* @__PURE__ */ d(a.Group, { ref: i, ...e, children: [
120
+ function({ label: r, children: a, ...e }, i) {
121
+ return /* @__PURE__ */ d(o.Group, { ref: i, ...e, children: [
122
122
  r && /* @__PURE__ */ t(f, { children: r }),
123
- o
123
+ a
124
124
  ] });
125
125
  }
126
126
  );
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sources":["../../../src/components/ui/Select.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type ReactNode,\n} from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { Check, ChevronDown, ChevronUp, ChevronsUpDown } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\n\n/* -----------------------------------------------------------------------------\n * Compound API:\n *\n * <Select value={…} onValueChange={…}>\n * <SelectTrigger placeholder=\"Pick one\" />\n * <SelectContent>\n * <SelectGroup label=\"Active\">\n * <SelectItem value=\"a\">Apple</SelectItem>\n * <SelectItem value=\"b\">Banana</SelectItem>\n * </SelectGroup>\n * </SelectContent>\n * </Select>\n *\n * All accessibility is handled by Radix: keyboard navigation, type-ahead,\n * focus trap, ARIA roles. We only style.\n * --------------------------------------------------------------------------- */\n\nexport const Select = SelectPrimitive.Root;\nexport const SelectValue = SelectPrimitive.Value;\n\nexport interface SelectTriggerProps extends Omit<\n ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>,\n 'children'\n> {\n /**\n * Placeholder shown when no value is selected. Also used as the trigger's\n * accessible name when no `aria-label` / `aria-labelledby` / `id` (external\n * `<Label htmlFor>`) is supplied — `role=\"combobox\"` takes no name from\n * its content.\n */\n placeholder?: string;\n /** Trigger height — matches Input sizes. */\n size?: 'sm' | 'md' | 'lg';\n /** Visual tone — `error` swaps the border + ring to danger. */\n tone?: 'default' | 'error';\n}\n\nexport const SelectTrigger = forwardRef<\n ComponentRef<typeof SelectPrimitive.Trigger>,\n SelectTriggerProps\n>(function SelectTrigger({ className, placeholder, size = 'md', tone = 'default', ...props }, ref) {\n const strings = useStrings();\n const hasName = Boolean(props['aria-label'] || props['aria-labelledby'] || props.id);\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n ref={ref}\n aria-label={hasName ? undefined : (placeholder ?? strings.select.placeholder)}\n className={cn(\n 'bg-card text-foreground inline-flex w-full items-center justify-between gap-2 rounded-md border text-lg md:text-sm',\n '[&>span]:min-w-0 [&>span]:truncate',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none',\n 'focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'data-[placeholder]:text-foreground-subtle',\n size === 'sm' && 'h-8 px-2.5',\n size === 'md' && 'h-9 px-3',\n size === 'lg' && 'h-10 px-3.5',\n tone === 'default'\n ? 'border-border-input focus-visible:border-accent focus-visible:ring-ring'\n : 'border-danger focus-visible:border-danger focus-visible:ring-danger',\n className,\n )}\n {...props}\n >\n <SelectPrimitive.Value placeholder={placeholder} />\n <SelectPrimitive.Icon asChild>\n <ChevronsUpDown className=\"text-foreground-subtle size-4 shrink-0\" aria-hidden />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n});\nSelectTrigger.displayName = 'SelectTrigger';\n\nconst scrollBtn = 'flex h-6 cursor-default items-center justify-center text-foreground-subtle';\n\nexport const SelectScrollUpButton = forwardRef<\n ComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(function SelectScrollUpButton({ className, ...props }, ref) {\n return (\n <SelectPrimitive.ScrollUpButton ref={ref} className={cn(scrollBtn, className)} {...props}>\n <ChevronUp className=\"size-4\" aria-hidden />\n </SelectPrimitive.ScrollUpButton>\n );\n});\nSelectScrollUpButton.displayName = 'SelectScrollUpButton';\n\nexport const SelectScrollDownButton = forwardRef<\n ComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(function SelectScrollDownButton({ className, ...props }, ref) {\n return (\n <SelectPrimitive.ScrollDownButton ref={ref} className={cn(scrollBtn, className)} {...props}>\n <ChevronDown className=\"size-4\" aria-hidden />\n </SelectPrimitive.ScrollDownButton>\n );\n});\nSelectScrollDownButton.displayName = 'SelectScrollDownButton';\n\nexport const SelectContent = forwardRef<\n ComponentRef<typeof SelectPrimitive.Content>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(function SelectContent({ className, children, position = 'popper', ...props }, ref) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n position={position}\n className={cn(\n 'z-[var(--z-popover)] max-h-96 min-w-[var(--radix-select-trigger-width)]',\n 'border-border bg-popover text-popover-foreground overflow-hidden rounded-lg border',\n 'shadow-md',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n 'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1',\n className,\n )}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport className=\"p-1\">{children}</SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n});\nSelectContent.displayName = 'SelectContent';\n\nexport const SelectLabel = forwardRef<\n ComponentRef<typeof SelectPrimitive.Label>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(function SelectLabel({ className, ...props }, ref) {\n return (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('text-foreground-subtle px-2 py-1.5 text-xs font-medium', className)}\n {...props}\n />\n );\n});\nSelectLabel.displayName = 'SelectLabel';\n\nexport interface SelectItemProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {\n /** Icon shown to the left of the label. */\n leadingIcon?: ReactNode;\n}\n\nexport const SelectItem = forwardRef<ComponentRef<typeof SelectPrimitive.Item>, SelectItemProps>(\n function SelectItem({ className, children, leadingIcon, ...props }, ref) {\n return (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex w-full cursor-default items-center gap-2 select-none',\n 'text-foreground rounded-sm px-2 py-1.5 pr-8 text-sm outline-none',\n 'data-[highlighted]:bg-background-muted data-[highlighted]:text-foreground',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n {leadingIcon && (\n <span className=\"text-foreground-subtle flex items-center [&_svg]:size-4\">\n {leadingIcon}\n </span>\n )}\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n <span className=\"absolute right-2 flex items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"text-accent size-4\" aria-hidden />\n </SelectPrimitive.ItemIndicator>\n </span>\n </SelectPrimitive.Item>\n );\n },\n);\nSelectItem.displayName = 'SelectItem';\n\nexport const SelectSeparator = forwardRef<\n ComponentRef<typeof SelectPrimitive.Separator>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(function SelectSeparator({ className, ...props }, ref) {\n return (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('bg-border -mx-1 my-1 h-px', className)}\n {...props}\n />\n );\n});\nSelectSeparator.displayName = 'SelectSeparator';\n\n/** Optional grouping with a label header. Pure composition over Radix Group + Label. */\nexport interface SelectGroupProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Group> {\n label?: ReactNode;\n}\nexport const SelectGroup = forwardRef<ComponentRef<typeof SelectPrimitive.Group>, SelectGroupProps>(\n function SelectGroup({ label, children, ...props }, ref) {\n return (\n <SelectPrimitive.Group ref={ref} {...props}>\n {label && <SelectLabel>{label}</SelectLabel>}\n {children}\n </SelectPrimitive.Group>\n );\n },\n);\nSelectGroup.displayName = 'SelectGroup';\n\n/**\n * Compose `Select` + `SelectTrigger` + `SelectContent` + `SelectItem` for a\n * single-choice picker. Keyboard, type-ahead, and ARIA come from Radix.\n *\n * @example Basic\n * <Select onValueChange={setStatus}>\n * <SelectTrigger placeholder=\"Status\" />\n * <SelectContent>\n * <SelectItem value=\"open\">Open</SelectItem>\n * <SelectItem value=\"closed\">Closed</SelectItem>\n * </SelectContent>\n * </Select>\n *\n * @example Grouped\n * <SelectContent>\n * <SelectGroup label=\"People\">\n * <SelectItem value=\"anu\">Anu</SelectItem>\n * <SelectItem value=\"bat\">Bat</SelectItem>\n * </SelectGroup>\n * <SelectSeparator />\n * <SelectGroup label=\"Bots\">\n * <SelectItem value=\"robo\">Robo</SelectItem>\n * </SelectGroup>\n * </SelectContent>\n *\n * @do Use `placeholder` on the trigger when there is no default value.\n * @dont Use Select for more than ~12 options — switch to `Combobox`.\n */\n"],"names":["Select","SelectPrimitive","SelectValue","SelectTrigger","forwardRef","className","placeholder","size","tone","props","ref","strings","useStrings","hasName","jsxs","cn","jsx","ChevronsUpDown","scrollBtn","SelectScrollUpButton","ChevronUp","SelectScrollDownButton","ChevronDown","SelectContent","children","position","SelectLabel","SelectItem","leadingIcon","Check","SelectSeparator","SelectGroup","label"],"mappings":";;;;;;;AA8BO,MAAMA,IAASC,EAAgB,MACzBC,IAAcD,EAAgB,OAmB9BE,IAAgBC,EAG3B,SAAuB,EAAE,WAAAC,GAAW,aAAAC,GAAa,MAAAC,IAAO,MAAM,MAAAC,IAAO,WAAW,GAAGC,EAAA,GAASC,GAAK;AACjG,QAAMC,IAAUC,EAAA,GACVC,IAAU,GAAQJ,EAAM,YAAY,KAAKA,EAAM,iBAAiB,KAAKA,EAAM;AACjF,SACE,gBAAAK;AAAA,IAACb,EAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,KAAAS;AAAA,MACA,cAAYG,IAAU,SAAaP,KAAeK,EAAQ,OAAO;AAAA,MACjE,WAAWI;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACAR,MAAS,QAAQ;AAAA,QACjBA,MAAS,QAAQ;AAAA,QACjBA,MAAS,QAAQ;AAAA,QACjBC,MAAS,YACL,4EACA;AAAA,QACJH;AAAA,MAAA;AAAA,MAED,GAAGI;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAO,EAACf,EAAgB,OAAhB,EAAsB,aAAAK,EAAA,CAA0B;AAAA,QACjD,gBAAAU,EAACf,EAAgB,MAAhB,EAAqB,SAAO,IAC3B,UAAA,gBAAAe,EAACC,GAAA,EAAe,WAAU,0CAAyC,eAAW,GAAA,CAAC,EAAA,CACjF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;AACDd,EAAc,cAAc;AAE5B,MAAMe,IAAY,8EAELC,IAAuBf,EAGlC,SAA8B,EAAE,WAAAC,GAAW,GAAGI,EAAA,GAASC,GAAK;AAC5D,2BACGT,EAAgB,gBAAhB,EAA+B,KAAAS,GAAU,WAAWK,EAAGG,GAAWb,CAAS,GAAI,GAA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H;AAAA,EAEJ;AACF;AACAO,EAAY,cAAc;"}
1
+ {"version":3,"file":"Select.js","sources":["../../../src/components/ui/Select.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type ReactNode,\n} from 'react';\nimport * as SelectPrimitive from '@radix-ui/react-select';\nimport { Check, ChevronDown, ChevronUp, ChevronsUpDown } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\n\n/* -----------------------------------------------------------------------------\n * Compound API:\n *\n * <Select value={…} onValueChange={…}>\n * <SelectTrigger placeholder=\"Pick one\" />\n * <SelectContent>\n * <SelectGroup label=\"Active\">\n * <SelectItem value=\"a\">Apple</SelectItem>\n * <SelectItem value=\"b\">Banana</SelectItem>\n * </SelectGroup>\n * </SelectContent>\n * </Select>\n *\n * All accessibility is handled by Radix: keyboard navigation, type-ahead,\n * focus trap, ARIA roles. We only style.\n * --------------------------------------------------------------------------- */\n\nexport const Select = SelectPrimitive.Root;\nexport const SelectValue = SelectPrimitive.Value;\n\nexport interface SelectTriggerProps extends Omit<\n ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>,\n 'children'\n> {\n /**\n * Placeholder shown when no value is selected. Also used as the trigger's\n * accessible name when no `aria-label` / `aria-labelledby` / `id` (external\n * `<Label htmlFor>`) is supplied — `role=\"combobox\"` takes no name from\n * its content.\n */\n placeholder?: string;\n /** Trigger height — matches Input sizes. */\n size?: 'sm' | 'md' | 'lg';\n /** Visual tone — `error` swaps the border + ring to danger. */\n tone?: 'default' | 'error';\n}\n\nexport const SelectTrigger = forwardRef<\n ComponentRef<typeof SelectPrimitive.Trigger>,\n SelectTriggerProps\n>(function SelectTrigger({ className, placeholder, size = 'md', tone = 'default', ...props }, ref) {\n const strings = useStrings();\n const hasName = Boolean(props['aria-label'] || props['aria-labelledby'] || props.id);\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n ref={ref}\n aria-label={hasName ? undefined : (placeholder ?? strings.select.placeholder)}\n className={cn(\n 'bg-card text-foreground inline-flex w-full items-center justify-between gap-2 rounded-md border text-lg md:text-sm',\n '[&>span]:min-w-0 [&>span]:truncate',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-hidden',\n 'focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n 'data-[placeholder]:text-foreground-subtle',\n size === 'sm' && 'h-8 px-2.5',\n size === 'md' && 'h-9 px-3',\n size === 'lg' && 'h-10 px-3.5',\n tone === 'default'\n ? 'border-border-input focus-visible:border-accent focus-visible:ring-ring'\n : 'border-danger focus-visible:border-danger focus-visible:ring-danger',\n className,\n )}\n {...props}\n >\n <SelectPrimitive.Value placeholder={placeholder} />\n <SelectPrimitive.Icon asChild>\n <ChevronsUpDown className=\"text-foreground-subtle size-4 shrink-0\" aria-hidden />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n});\nSelectTrigger.displayName = 'SelectTrigger';\n\nconst scrollBtn = 'flex h-6 cursor-default items-center justify-center text-foreground-subtle';\n\nexport const SelectScrollUpButton = forwardRef<\n ComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(function SelectScrollUpButton({ className, ...props }, ref) {\n return (\n <SelectPrimitive.ScrollUpButton ref={ref} className={cn(scrollBtn, className)} {...props}>\n <ChevronUp className=\"size-4\" aria-hidden />\n </SelectPrimitive.ScrollUpButton>\n );\n});\nSelectScrollUpButton.displayName = 'SelectScrollUpButton';\n\nexport const SelectScrollDownButton = forwardRef<\n ComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(function SelectScrollDownButton({ className, ...props }, ref) {\n return (\n <SelectPrimitive.ScrollDownButton ref={ref} className={cn(scrollBtn, className)} {...props}>\n <ChevronDown className=\"size-4\" aria-hidden />\n </SelectPrimitive.ScrollDownButton>\n );\n});\nSelectScrollDownButton.displayName = 'SelectScrollDownButton';\n\nexport const SelectContent = forwardRef<\n ComponentRef<typeof SelectPrimitive.Content>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Content>\n>(function SelectContent({ className, children, position = 'popper', ...props }, ref) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n position={position}\n className={cn(\n 'z-[var(--z-popover)] max-h-96 min-w-[var(--radix-select-trigger-width)]',\n 'border-border bg-popover text-popover-foreground overflow-hidden rounded-lg border',\n 'shadow-md',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',\n 'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',\n position === 'popper' &&\n 'data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1',\n className,\n )}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport className=\"p-1\">{children}</SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n});\nSelectContent.displayName = 'SelectContent';\n\nexport const SelectLabel = forwardRef<\n ComponentRef<typeof SelectPrimitive.Label>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(function SelectLabel({ className, ...props }, ref) {\n return (\n <SelectPrimitive.Label\n ref={ref}\n className={cn('text-foreground-subtle px-2 py-1.5 text-xs font-medium', className)}\n {...props}\n />\n );\n});\nSelectLabel.displayName = 'SelectLabel';\n\nexport interface SelectItemProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {\n /** Icon shown to the left of the label. */\n leadingIcon?: ReactNode;\n}\n\nexport const SelectItem = forwardRef<ComponentRef<typeof SelectPrimitive.Item>, SelectItemProps>(\n function SelectItem({ className, children, leadingIcon, ...props }, ref) {\n return (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex w-full cursor-default items-center gap-2 select-none',\n 'text-foreground rounded-sm px-2 py-1.5 pr-8 text-sm outline-hidden',\n 'data-[highlighted]:bg-background-muted data-[highlighted]:text-foreground',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className,\n )}\n {...props}\n >\n {leadingIcon && (\n <span className=\"text-foreground-subtle flex items-center [&_svg]:size-4\">\n {leadingIcon}\n </span>\n )}\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n <span className=\"absolute right-2 flex items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"text-accent size-4\" aria-hidden />\n </SelectPrimitive.ItemIndicator>\n </span>\n </SelectPrimitive.Item>\n );\n },\n);\nSelectItem.displayName = 'SelectItem';\n\nexport const SelectSeparator = forwardRef<\n ComponentRef<typeof SelectPrimitive.Separator>,\n ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(function SelectSeparator({ className, ...props }, ref) {\n return (\n <SelectPrimitive.Separator\n ref={ref}\n className={cn('bg-border -mx-1 my-1 h-px', className)}\n {...props}\n />\n );\n});\nSelectSeparator.displayName = 'SelectSeparator';\n\n/** Optional grouping with a label header. Pure composition over Radix Group + Label. */\nexport interface SelectGroupProps extends ComponentPropsWithoutRef<typeof SelectPrimitive.Group> {\n label?: ReactNode;\n}\nexport const SelectGroup = forwardRef<ComponentRef<typeof SelectPrimitive.Group>, SelectGroupProps>(\n function SelectGroup({ label, children, ...props }, ref) {\n return (\n <SelectPrimitive.Group ref={ref} {...props}>\n {label && <SelectLabel>{label}</SelectLabel>}\n {children}\n </SelectPrimitive.Group>\n );\n },\n);\nSelectGroup.displayName = 'SelectGroup';\n\n/**\n * Compose `Select` + `SelectTrigger` + `SelectContent` + `SelectItem` for a\n * single-choice picker. Keyboard, type-ahead, and ARIA come from Radix.\n *\n * @example Basic\n * <Select onValueChange={setStatus}>\n * <SelectTrigger placeholder=\"Status\" />\n * <SelectContent>\n * <SelectItem value=\"open\">Open</SelectItem>\n * <SelectItem value=\"closed\">Closed</SelectItem>\n * </SelectContent>\n * </Select>\n *\n * @example Grouped\n * <SelectContent>\n * <SelectGroup label=\"People\">\n * <SelectItem value=\"anu\">Anu</SelectItem>\n * <SelectItem value=\"bat\">Bat</SelectItem>\n * </SelectGroup>\n * <SelectSeparator />\n * <SelectGroup label=\"Bots\">\n * <SelectItem value=\"robo\">Robo</SelectItem>\n * </SelectGroup>\n * </SelectContent>\n *\n * @do Use `placeholder` on the trigger when there is no default value.\n * @dont Use Select for more than ~12 options — switch to `Combobox`.\n */\n"],"names":["Select","SelectPrimitive","SelectValue","SelectTrigger","forwardRef","className","placeholder","size","tone","props","ref","strings","useStrings","hasName","jsxs","cn","jsx","ChevronsUpDown","scrollBtn","SelectScrollUpButton","ChevronUp","SelectScrollDownButton","ChevronDown","SelectContent","children","position","SelectLabel","SelectItem","leadingIcon","Check","SelectSeparator","SelectGroup","label"],"mappings":";;;;;;;AA8BO,MAAMA,IAASC,EAAgB,MACzBC,IAAcD,EAAgB,OAmB9BE,IAAgBC,EAG3B,SAAuB,EAAE,WAAAC,GAAW,aAAAC,GAAa,MAAAC,IAAO,MAAM,MAAAC,IAAO,WAAW,GAAGC,EAAA,GAASC,GAAK;AACjG,QAAMC,IAAUC,EAAA,GACVC,IAAU,GAAQJ,EAAM,YAAY,KAAKA,EAAM,iBAAiB,KAAKA,EAAM;AACjF,SACE,gBAAAK;AAAA,IAACb,EAAgB;AAAA,IAAhB;AAAA,MACC,aAAU;AAAA,MACV,KAAAS;AAAA,MACA,cAAYG,IAAU,SAAaP,KAAeK,EAAQ,OAAO;AAAA,MACjE,WAAWI;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACAR,MAAS,QAAQ;AAAA,QACjBA,MAAS,QAAQ;AAAA,QACjBA,MAAS,QAAQ;AAAA,QACjBC,MAAS,YACL,4EACA;AAAA,QACJH;AAAA,MAAA;AAAA,MAED,GAAGI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,GAAW,GAAGI,EAAA,GAASC,GAAK;AACvD,SACE,gBAAAM;AAAA,IAACf,EAAgB;AAAA,IAAhB;AAAA,MACC,KAAAS;AAAA,MACA,WAAWK,EAAG,6BAA6BV,CAAS;AAAA,MACnD,GAAGI;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDqB,EAAgB,cAAc;AAMvB,MAAMC,IAAc3B;AAAA,EACzB,SAAqB,EAAE,OAAA4B,GAAO,UAAAR,GAAU,GAAGf,EAAA,GAASC,GAAK;AACvD,6BACGT,EAAgB,OAAhB,EAAsB,KAAAS,GAAW,GAAGD,GAClC,UAAA;AAAA,MAAAuB,KAAS,gBAAAhB,EAACU,KAAa,UAAAM,EAAA,CAAM;AAAA,MAC7BR;AAAA,IAAA,GACH;AAAA,EAEJ;AACF;AACAO,EAAY,cAAc;"}
@@ -72,7 +72,7 @@ const y = v(
72
72
  className: i(
73
73
  "text-foreground-subtle absolute top-4 right-4 inline-flex size-8 items-center justify-center rounded-md",
74
74
  "hover:bg-background-muted hover:text-foreground",
75
- "focus-visible:ring-ring focus-visible:ring-offset-card outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
75
+ "focus-visible:ring-ring focus-visible:ring-offset-card outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2",
76
76
  "transition-colors duration-[var(--duration-fast)]"
77
77
  ),
78
78
  children: /* @__PURE__ */ o(g, { className: "size-4", "aria-hidden": !0 })
@@ -1 +1 @@
1
- {"version":3,"file":"Sheet.js","sources":["../../../src/components/ui/Sheet.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type HTMLAttributes,\n} from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { X } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\nimport { cva, type VariantProps } from '@/lib/cva';\nimport { withReturnFocus, type ReturnFocusRef } from '@/lib/return-focus';\n\n/* -----------------------------------------------------------------------------\n * Sheet — drawer-style overlay. Built on Radix Dialog (focus trap, escape,\n * click-outside come from there). Slides in from one of four sides.\n * --------------------------------------------------------------------------- */\n\nexport const Sheet = DialogPrimitive.Root;\nexport const SheetTrigger = DialogPrimitive.Trigger;\nexport const SheetClose = DialogPrimitive.Close;\nexport const SheetPortal = DialogPrimitive.Portal;\n\nconst SheetOverlay = forwardRef<\n ComponentRef<typeof DialogPrimitive.Overlay>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(function SheetOverlay({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'bg-overlay fixed inset-0 z-[var(--z-overlay)]',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0',\n className,\n )}\n {...props}\n />\n );\n});\nSheetOverlay.displayName = 'SheetOverlay';\n\nconst sheet = cva(\n [\n 'fixed z-[var(--z-modal)] bg-card text-card-foreground shadow-lg',\n 'flex flex-col gap-4 p-6',\n // Safe-area insets for notched devices (consumers set viewport-fit=cover).\n 'pb-[max(1.5rem,env(safe-area-inset-bottom))] pl-[max(1.5rem,env(safe-area-inset-left))] pr-[max(1.5rem,env(safe-area-inset-right))]',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:duration-[var(--duration-base)] data-[state=open]:duration-[var(--duration-slow)]',\n ],\n {\n variants: {\n side: {\n top: 'inset-x-0 top-0 border-b border-border data-[state=open]:slide-in-from-top data-[state=closed]:slide-out-to-top',\n bottom:\n 'inset-x-0 bottom-0 border-t border-border data-[state=open]:slide-in-from-bottom data-[state=closed]:slide-out-to-bottom',\n left: 'inset-y-0 left-0 h-full w-3/4 max-w-md border-r border-border data-[state=open]:slide-in-from-left data-[state=closed]:slide-out-to-left',\n right:\n 'inset-y-0 right-0 h-full w-3/4 max-w-md border-l border-border data-[state=open]:slide-in-from-right data-[state=closed]:slide-out-to-right',\n },\n },\n defaultVariants: { side: 'right' },\n },\n);\n\nexport interface SheetContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheet> {\n showClose?: boolean;\n /**\n * Element to focus when the overlay closes. Overrides Radix's default\n * (the element focused when the content mounted), which is `<body>` for\n * controlled overlays opened from a pointer click on a non-focusable /\n * tooltip-wrapped trigger. A consumer `onCloseAutoFocus` runs first and\n * wins if it calls `preventDefault()`.\n */\n returnFocusTo?: ReturnFocusRef;\n}\n\nexport const SheetContent = forwardRef<\n ComponentRef<typeof DialogPrimitive.Content>,\n SheetContentProps\n>(function SheetContent(\n {\n className,\n children,\n side = 'right',\n showClose = true,\n returnFocusTo,\n onCloseAutoFocus,\n ...props\n },\n ref,\n) {\n const strings = useStrings();\n return (\n <SheetPortal>\n <SheetOverlay />\n <DialogPrimitive.Content\n data-slot=\"sheet-content\"\n ref={ref}\n className={cn(sheet({ side }), className)}\n onCloseAutoFocus={withReturnFocus(returnFocusTo, onCloseAutoFocus)}\n {...props}\n >\n {children}\n {showClose && (\n <DialogPrimitive.Close\n aria-label={strings.sheet.close}\n className={cn(\n 'text-foreground-subtle absolute top-4 right-4 inline-flex size-8 items-center justify-center rounded-md',\n 'hover:bg-background-muted hover:text-foreground',\n 'focus-visible:ring-ring focus-visible:ring-offset-card outline-none focus-visible:ring-2 focus-visible:ring-offset-2',\n 'transition-colors duration-[var(--duration-fast)]',\n )}\n >\n <X className=\"size-4\" aria-hidden />\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </SheetPortal>\n );\n});\nSheetContent.displayName = 'SheetContent';\n\nexport function SheetHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn('flex flex-col gap-1', className)} {...props} />;\n}\nSheetHeader.displayName = 'SheetHeader';\n\nexport function SheetFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn(\n 'mt-auto flex flex-col-reverse gap-2 pt-4 sm:flex-row sm:justify-end',\n className,\n )}\n {...props}\n />\n );\n}\nSheetFooter.displayName = 'SheetFooter';\n\nexport const SheetTitle = forwardRef<\n ComponentRef<typeof DialogPrimitive.Title>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(function SheetTitle({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-foreground text-lg leading-tight font-semibold', className)}\n {...props}\n />\n );\n});\nSheetTitle.displayName = 'SheetTitle';\n\nexport const SheetDescription = forwardRef<\n ComponentRef<typeof DialogPrimitive.Description>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(function SheetDescription({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-foreground-muted text-sm', className)}\n {...props}\n />\n );\n});\nSheetDescription.displayName = 'SheetDescription';\n\n/**\n * @example Right-side filter drawer\n * <Sheet>\n * <SheetTrigger asChild><Button variant=\"outline\">Filters</Button></SheetTrigger>\n * <SheetContent side=\"right\">\n * <SheetHeader>\n * <SheetTitle>Filters</SheetTitle>\n * <SheetDescription>Refine the result set.</SheetDescription>\n * </SheetHeader>\n * …\n * <SheetFooter>\n * <SheetClose asChild><Button variant=\"outline\">Cancel</Button></SheetClose>\n * <Button>Apply</Button>\n * </SheetFooter>\n * </SheetContent>\n * </Sheet>\n *\n * @do Use right side for filters/inspectors, left for navigation, bottom for\n * mobile sheets.\n * @dont Use a full-screen sheet on desktop — prefer Dialog or a dedicated page.\n */\n"],"names":["Sheet","DialogPrimitive","SheetTrigger","SheetClose","SheetPortal","SheetOverlay","forwardRef","className","props","ref","jsx","cn","sheet","cva","SheetContent","children","side","showClose","returnFocusTo","onCloseAutoFocus","strings","useStrings","jsxs","withReturnFocus","X","SheetHeader","SheetFooter","SheetTitle","SheetDescription"],"mappings":";;;;;;;;;AAoBO,MAAMA,IAAQC,EAAgB,MACxBC,IAAeD,EAAgB,SAC/BE,IAAaF,EAAgB,OAC7BG,IAAcH,EAAgB,QAErCI,IAAeC,EA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import {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type HTMLAttributes,\n} from 'react';\nimport * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { X } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\nimport { cva, type VariantProps } from '@/lib/cva';\nimport { withReturnFocus, type ReturnFocusRef } from '@/lib/return-focus';\n\n/* -----------------------------------------------------------------------------\n * Sheet — drawer-style overlay. Built on Radix Dialog (focus trap, escape,\n * click-outside come from there). Slides in from one of four sides.\n * --------------------------------------------------------------------------- */\n\nexport const Sheet = DialogPrimitive.Root;\nexport const SheetTrigger = DialogPrimitive.Trigger;\nexport const SheetClose = DialogPrimitive.Close;\nexport const SheetPortal = DialogPrimitive.Portal;\n\nconst SheetOverlay = forwardRef<\n ComponentRef<typeof DialogPrimitive.Overlay>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(function SheetOverlay({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'bg-overlay fixed inset-0 z-[var(--z-overlay)]',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0',\n className,\n )}\n {...props}\n />\n );\n});\nSheetOverlay.displayName = 'SheetOverlay';\n\nconst sheet = cva(\n [\n 'fixed z-[var(--z-modal)] bg-card text-card-foreground shadow-lg',\n 'flex flex-col gap-4 p-6',\n // Safe-area insets for notched devices (consumers set viewport-fit=cover).\n 'pb-[max(1.5rem,env(safe-area-inset-bottom))] pl-[max(1.5rem,env(safe-area-inset-left))] pr-[max(1.5rem,env(safe-area-inset-right))]',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out',\n 'data-[state=closed]:duration-[var(--duration-base)] data-[state=open]:duration-[var(--duration-slow)]',\n ],\n {\n variants: {\n side: {\n top: 'inset-x-0 top-0 border-b border-border data-[state=open]:slide-in-from-top data-[state=closed]:slide-out-to-top',\n bottom:\n 'inset-x-0 bottom-0 border-t border-border data-[state=open]:slide-in-from-bottom data-[state=closed]:slide-out-to-bottom',\n left: 'inset-y-0 left-0 h-full w-3/4 max-w-md border-r border-border data-[state=open]:slide-in-from-left data-[state=closed]:slide-out-to-left',\n right:\n 'inset-y-0 right-0 h-full w-3/4 max-w-md border-l border-border data-[state=open]:slide-in-from-right data-[state=closed]:slide-out-to-right',\n },\n },\n defaultVariants: { side: 'right' },\n },\n);\n\nexport interface SheetContentProps\n extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheet> {\n showClose?: boolean;\n /**\n * Element to focus when the overlay closes. Overrides Radix's default\n * (the element focused when the content mounted), which is `<body>` for\n * controlled overlays opened from a pointer click on a non-focusable /\n * tooltip-wrapped trigger. A consumer `onCloseAutoFocus` runs first and\n * wins if it calls `preventDefault()`.\n */\n returnFocusTo?: ReturnFocusRef;\n}\n\nexport const SheetContent = forwardRef<\n ComponentRef<typeof DialogPrimitive.Content>,\n SheetContentProps\n>(function SheetContent(\n {\n className,\n children,\n side = 'right',\n showClose = true,\n returnFocusTo,\n onCloseAutoFocus,\n ...props\n },\n ref,\n) {\n const strings = useStrings();\n return (\n <SheetPortal>\n <SheetOverlay />\n <DialogPrimitive.Content\n data-slot=\"sheet-content\"\n ref={ref}\n className={cn(sheet({ side }), className)}\n onCloseAutoFocus={withReturnFocus(returnFocusTo, onCloseAutoFocus)}\n {...props}\n >\n {children}\n {showClose && (\n <DialogPrimitive.Close\n aria-label={strings.sheet.close}\n className={cn(\n 'text-foreground-subtle absolute top-4 right-4 inline-flex size-8 items-center justify-center rounded-md',\n 'hover:bg-background-muted hover:text-foreground',\n 'focus-visible:ring-ring focus-visible:ring-offset-card outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2',\n 'transition-colors duration-[var(--duration-fast)]',\n )}\n >\n <X className=\"size-4\" aria-hidden />\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </SheetPortal>\n );\n});\nSheetContent.displayName = 'SheetContent';\n\nexport function SheetHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return <div className={cn('flex flex-col gap-1', className)} {...props} />;\n}\nSheetHeader.displayName = 'SheetHeader';\n\nexport function SheetFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn(\n 'mt-auto flex flex-col-reverse gap-2 pt-4 sm:flex-row sm:justify-end',\n className,\n )}\n {...props}\n />\n );\n}\nSheetFooter.displayName = 'SheetFooter';\n\nexport const SheetTitle = forwardRef<\n ComponentRef<typeof DialogPrimitive.Title>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(function SheetTitle({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-foreground text-lg leading-tight font-semibold', className)}\n {...props}\n />\n );\n});\nSheetTitle.displayName = 'SheetTitle';\n\nexport const SheetDescription = forwardRef<\n ComponentRef<typeof DialogPrimitive.Description>,\n ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(function SheetDescription({ className, ...props }, ref) {\n return (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-foreground-muted text-sm', className)}\n {...props}\n />\n );\n});\nSheetDescription.displayName = 'SheetDescription';\n\n/**\n * @example Right-side filter drawer\n * <Sheet>\n * <SheetTrigger asChild><Button variant=\"outline\">Filters</Button></SheetTrigger>\n * <SheetContent side=\"right\">\n * <SheetHeader>\n * <SheetTitle>Filters</SheetTitle>\n * <SheetDescription>Refine the result set.</SheetDescription>\n * </SheetHeader>\n * …\n * <SheetFooter>\n * <SheetClose asChild><Button variant=\"outline\">Cancel</Button></SheetClose>\n * <Button>Apply</Button>\n * </SheetFooter>\n * </SheetContent>\n * </Sheet>\n *\n * @do Use right side for filters/inspectors, left for navigation, bottom for\n * mobile sheets.\n * @dont Use a full-screen sheet on desktop — prefer Dialog or a dedicated page.\n */\n"],"names":["Sheet","DialogPrimitive","SheetTrigger","SheetClose","SheetPortal","SheetOverlay","forwardRef","className","props","ref","jsx","cn","sheet","cva","SheetContent","children","side","showClose","returnFocusTo","onCloseAutoFocus","strings","useStrings","jsxs","withReturnFocus","X","SheetHeader","SheetFooter","SheetTitle","SheetDescription"],"mappings":";;;;;;;;;AAoBO,MAAMA,IAAQC,EAAgB,MACxBC,IAAeD,EAAgB,SAC/BE,IAAaF,EAAgB,OAC7BG,IAAcH,EAAgB,QAErCI,IAAeC,EAGnB,SAAsB,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,GAAK;AACpD,SACE,gBAAAC;AAAA,IAACT,EAAgB;AAAA,IAAhB;AAAA,MACC,KAAAQ;AAAA,MACA,WAAWE;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACAJ;AAAA,MAAA;AAAA,MAED,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDH,EAAa,cAAc;AAE3B,MAAMO,IAAQC;AAAA,EACZ;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,KAAK;AAAA,QACL,QACE;AAAA,QACF,MAAM;AAAA,QACN,OACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB,EAAE,MAAM,QAAA;AAAA,EAAQ;AAErC,GAeaC,IAAeR,EAG1B,SACA;AAAA,EACE,WAAAC;AAAA,EACA,UAAAQ;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,WAAAC,IAAY;AAAA,EACZ,eAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,GAAGX;AACL,GACAC,GACA;AACA,QAAMW,IAAUC,EAAA;AAChB,2BACGjB,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAM,EAACL,GAAA,EAAa;AAAA,IACd,gBAAAiB;AAAA,MAACrB,EAAgB;AAAA,MAAhB;AAAA,QACC,aAAU;AAAA,QACV,KAAAQ;AAAA,QACA,WAAWE,EAAGC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D,SACE,gBAAAC;AAAA,IAACT,EAAgB;AAAA,IAAhB;AAAA,MACC,KAAAQ;AAAA,MACA,WAAWE,EAAG,iCAAiCJ,CAAS;AAAA,MACvD,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDoB,EAAiB,cAAc;"}
@@ -62,7 +62,9 @@ interface SidebarItemBaseProps {
62
62
  tooltip?: ReactNode;
63
63
  /**
64
64
  * Render the child element (router `<Link>`) instead of `<a>`/`<button>`.
65
- * The child receives className, aria-current and the item content.
65
+ * The child receives className, aria-current and the item content — its own
66
+ * children become the label, wrapped with `icon`, `trailing` and the
67
+ * collapsed sr-only text exactly like a plain item.
66
68
  */
67
69
  asChild?: boolean;
68
70
  }