@craftzbay/ui 0.10.0 → 0.11.1

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 (187) hide show
  1. package/README.md +18 -12
  2. package/dist-lib/__tests__/helpers/color.d.ts +9 -0
  3. package/dist-lib/__tests__/helpers/theme.d.ts +18 -0
  4. package/dist-lib/components/ui/Accordion.js +18 -7
  5. package/dist-lib/components/ui/Accordion.js.map +1 -1
  6. package/dist-lib/components/ui/Alert.d.ts +16 -0
  7. package/dist-lib/components/ui/Alert.js +47 -34
  8. package/dist-lib/components/ui/Alert.js.map +1 -1
  9. package/dist-lib/components/ui/Avatar.d.ts +1 -1
  10. package/dist-lib/components/ui/Avatar.js +45 -47
  11. package/dist-lib/components/ui/Avatar.js.map +1 -1
  12. package/dist-lib/components/ui/Badge.d.ts +3 -1
  13. package/dist-lib/components/ui/Badge.js +24 -15
  14. package/dist-lib/components/ui/Badge.js.map +1 -1
  15. package/dist-lib/components/ui/Breadcrumbs.d.ts +2 -0
  16. package/dist-lib/components/ui/Breadcrumbs.js +46 -28
  17. package/dist-lib/components/ui/Breadcrumbs.js.map +1 -1
  18. package/dist-lib/components/ui/Button.d.ts +5 -3
  19. package/dist-lib/components/ui/Button.js +59 -45
  20. package/dist-lib/components/ui/Button.js.map +1 -1
  21. package/dist-lib/components/ui/Calendar.d.ts +1 -1
  22. package/dist-lib/components/ui/Calendar.js +87 -59
  23. package/dist-lib/components/ui/Calendar.js.map +1 -1
  24. package/dist-lib/components/ui/Card.d.ts +2 -0
  25. package/dist-lib/components/ui/Card.js +48 -67
  26. package/dist-lib/components/ui/Card.js.map +1 -1
  27. package/dist-lib/components/ui/Carousel.d.ts +6 -6
  28. package/dist-lib/components/ui/Carousel.js +133 -102
  29. package/dist-lib/components/ui/Carousel.js.map +1 -1
  30. package/dist-lib/components/ui/Chart.d.ts +49 -10
  31. package/dist-lib/components/ui/Chart.js +415 -181
  32. package/dist-lib/components/ui/Chart.js.map +1 -1
  33. package/dist-lib/components/ui/Checkbox.js +42 -28
  34. package/dist-lib/components/ui/Checkbox.js.map +1 -1
  35. package/dist-lib/components/ui/Combobox.d.ts +2 -0
  36. package/dist-lib/components/ui/Combobox.js +142 -111
  37. package/dist-lib/components/ui/Combobox.js.map +1 -1
  38. package/dist-lib/components/ui/CommandPalette.d.ts +6 -3
  39. package/dist-lib/components/ui/CommandPalette.js +92 -87
  40. package/dist-lib/components/ui/CommandPalette.js.map +1 -1
  41. package/dist-lib/components/ui/ContextMenu.d.ts +7 -2
  42. package/dist-lib/components/ui/ContextMenu.js +77 -62
  43. package/dist-lib/components/ui/ContextMenu.js.map +1 -1
  44. package/dist-lib/components/ui/DataGrid.d.ts +17 -4
  45. package/dist-lib/components/ui/DataGrid.js +65 -50
  46. package/dist-lib/components/ui/DataGrid.js.map +1 -1
  47. package/dist-lib/components/ui/DatePicker.js +118 -99
  48. package/dist-lib/components/ui/DatePicker.js.map +1 -1
  49. package/dist-lib/components/ui/DesignSystemProvider.d.ts +94 -40
  50. package/dist-lib/components/ui/DesignSystemProvider.js +111 -55
  51. package/dist-lib/components/ui/DesignSystemProvider.js.map +1 -1
  52. package/dist-lib/components/ui/Dialog.d.ts +18 -3
  53. package/dist-lib/components/ui/Dialog.js +105 -80
  54. package/dist-lib/components/ui/Dialog.js.map +1 -1
  55. package/dist-lib/components/ui/Drawer.d.ts +17 -2
  56. package/dist-lib/components/ui/Drawer.js +89 -55
  57. package/dist-lib/components/ui/Drawer.js.map +1 -1
  58. package/dist-lib/components/ui/DropdownMenu.js +14 -9
  59. package/dist-lib/components/ui/DropdownMenu.js.map +1 -1
  60. package/dist-lib/components/ui/EmptyState.d.ts +2 -0
  61. package/dist-lib/components/ui/EmptyState.js +30 -16
  62. package/dist-lib/components/ui/EmptyState.js.map +1 -1
  63. package/dist-lib/components/ui/ErrorState.d.ts +13 -2
  64. package/dist-lib/components/ui/ErrorState.js +44 -23
  65. package/dist-lib/components/ui/ErrorState.js.map +1 -1
  66. package/dist-lib/components/ui/FileUpload.js +59 -56
  67. package/dist-lib/components/ui/FileUpload.js.map +1 -1
  68. package/dist-lib/components/ui/Form.d.ts +15 -2
  69. package/dist-lib/components/ui/Form.js +97 -71
  70. package/dist-lib/components/ui/Form.js.map +1 -1
  71. package/dist-lib/components/ui/Icon.d.ts +1 -1
  72. package/dist-lib/components/ui/Icon.js +20 -14
  73. package/dist-lib/components/ui/Icon.js.map +1 -1
  74. package/dist-lib/components/ui/IconButton.d.ts +2 -2
  75. package/dist-lib/components/ui/IconButton.js +28 -20
  76. package/dist-lib/components/ui/IconButton.js.map +1 -1
  77. package/dist-lib/components/ui/Input.d.ts +3 -1
  78. package/dist-lib/components/ui/Input.js +102 -79
  79. package/dist-lib/components/ui/Input.js.map +1 -1
  80. package/dist-lib/components/ui/Kbd.js +1 -1
  81. package/dist-lib/components/ui/Kbd.js.map +1 -1
  82. package/dist-lib/components/ui/MultiSelect.js +121 -107
  83. package/dist-lib/components/ui/MultiSelect.js.map +1 -1
  84. package/dist-lib/components/ui/Pagination.js +67 -62
  85. package/dist-lib/components/ui/Pagination.js.map +1 -1
  86. package/dist-lib/components/ui/Popover.js +14 -14
  87. package/dist-lib/components/ui/Popover.js.map +1 -1
  88. package/dist-lib/components/ui/Progress.d.ts +3 -3
  89. package/dist-lib/components/ui/Progress.js +77 -72
  90. package/dist-lib/components/ui/Progress.js.map +1 -1
  91. package/dist-lib/components/ui/RadioGroup.d.ts +1 -1
  92. package/dist-lib/components/ui/RadioGroup.js +69 -52
  93. package/dist-lib/components/ui/RadioGroup.js.map +1 -1
  94. package/dist-lib/components/ui/RelativeTime.d.ts +19 -0
  95. package/dist-lib/components/ui/RelativeTime.js +31 -0
  96. package/dist-lib/components/ui/RelativeTime.js.map +1 -0
  97. package/dist-lib/components/ui/ScrollArea.d.ts +9 -1
  98. package/dist-lib/components/ui/ScrollArea.js +43 -27
  99. package/dist-lib/components/ui/ScrollArea.js.map +1 -1
  100. package/dist-lib/components/ui/Select.d.ts +6 -1
  101. package/dist-lib/components/ui/Select.js +79 -71
  102. package/dist-lib/components/ui/Select.js.map +1 -1
  103. package/dist-lib/components/ui/Separator.js +1 -1
  104. package/dist-lib/components/ui/Separator.js.map +1 -1
  105. package/dist-lib/components/ui/Sheet.d.ts +9 -0
  106. package/dist-lib/components/ui/Sheet.js +69 -46
  107. package/dist-lib/components/ui/Sheet.js.map +1 -1
  108. package/dist-lib/components/ui/Sidebar.d.ts +12 -9
  109. package/dist-lib/components/ui/Sidebar.js +152 -109
  110. package/dist-lib/components/ui/Sidebar.js.map +1 -1
  111. package/dist-lib/components/ui/Skeleton.d.ts +13 -2
  112. package/dist-lib/components/ui/Skeleton.js +15 -14
  113. package/dist-lib/components/ui/Skeleton.js.map +1 -1
  114. package/dist-lib/components/ui/Slider.js +41 -29
  115. package/dist-lib/components/ui/Slider.js.map +1 -1
  116. package/dist-lib/components/ui/Snackbar.js +23 -22
  117. package/dist-lib/components/ui/Snackbar.js.map +1 -1
  118. package/dist-lib/components/ui/Spinner.js +18 -6
  119. package/dist-lib/components/ui/Spinner.js.map +1 -1
  120. package/dist-lib/components/ui/Stepper.d.ts +6 -0
  121. package/dist-lib/components/ui/Stepper.js +71 -48
  122. package/dist-lib/components/ui/Stepper.js.map +1 -1
  123. package/dist-lib/components/ui/Switch.js +46 -43
  124. package/dist-lib/components/ui/Switch.js.map +1 -1
  125. package/dist-lib/components/ui/Table.d.ts +33 -5
  126. package/dist-lib/components/ui/Table.js +141 -119
  127. package/dist-lib/components/ui/Table.js.map +1 -1
  128. package/dist-lib/components/ui/Tabs.js +50 -48
  129. package/dist-lib/components/ui/Tabs.js.map +1 -1
  130. package/dist-lib/components/ui/TagInput.js +45 -45
  131. package/dist-lib/components/ui/TagInput.js.map +1 -1
  132. package/dist-lib/components/ui/Textarea.js +65 -54
  133. package/dist-lib/components/ui/Textarea.js.map +1 -1
  134. package/dist-lib/components/ui/Timeline.js +39 -35
  135. package/dist-lib/components/ui/Timeline.js.map +1 -1
  136. package/dist-lib/components/ui/Toast.js +44 -57
  137. package/dist-lib/components/ui/Toast.js.map +1 -1
  138. package/dist-lib/components/ui/Tooltip.d.ts +4 -1
  139. package/dist-lib/components/ui/Tooltip.js +24 -22
  140. package/dist-lib/components/ui/Tooltip.js.map +1 -1
  141. package/dist-lib/components/ui/TopNav.d.ts +7 -3
  142. package/dist-lib/components/ui/TopNav.js +39 -22
  143. package/dist-lib/components/ui/TopNav.js.map +1 -1
  144. package/dist-lib/components/ui/Tree.d.ts +15 -10
  145. package/dist-lib/components/ui/Tree.js +82 -79
  146. package/dist-lib/components/ui/Tree.js.map +1 -1
  147. package/dist-lib/hooks/use-debounce.d.ts +19 -0
  148. package/dist-lib/hooks/use-debounce.js +36 -0
  149. package/dist-lib/hooks/use-debounce.js.map +1 -0
  150. package/dist-lib/hooks/use-delayed-loading.d.ts +21 -0
  151. package/dist-lib/hooks/use-delayed-loading.js +20 -0
  152. package/dist-lib/hooks/use-delayed-loading.js.map +1 -0
  153. package/dist-lib/hooks/use-field-ids.d.ts +2 -1
  154. package/dist-lib/hooks/use-field-ids.js +9 -9
  155. package/dist-lib/hooks/use-field-ids.js.map +1 -1
  156. package/dist-lib/hooks/use-media-query.d.ts +3 -1
  157. package/dist-lib/hooks/use-media-query.js +16 -12
  158. package/dist-lib/hooks/use-media-query.js.map +1 -1
  159. package/dist-lib/hooks/use-modifier-key.d.ts +13 -0
  160. package/dist-lib/hooks/use-modifier-key.js +19 -0
  161. package/dist-lib/hooks/use-modifier-key.js.map +1 -0
  162. package/dist-lib/hooks/use-toast.d.ts +7 -2
  163. package/dist-lib/hooks/use-toast.js +61 -30
  164. package/dist-lib/hooks/use-toast.js.map +1 -1
  165. package/dist-lib/icons/index.d.ts +9 -0
  166. package/dist-lib/icons/index.js +148 -130
  167. package/dist-lib/icons/index.js.map +1 -1
  168. package/dist-lib/illustrations/index.d.ts +1 -0
  169. package/dist-lib/illustrations/index.js +15 -6
  170. package/dist-lib/illustrations/index.js.map +1 -1
  171. package/dist-lib/index.d.ts +6 -0
  172. package/dist-lib/index.js +280 -260
  173. package/dist-lib/index.js.map +1 -1
  174. package/dist-lib/lib/format.d.ts +65 -0
  175. package/dist-lib/lib/format.js +95 -0
  176. package/dist-lib/lib/format.js.map +1 -0
  177. package/dist-lib/lib/return-focus.d.ts +11 -0
  178. package/dist-lib/lib/return-focus.js +12 -0
  179. package/dist-lib/lib/return-focus.js.map +1 -0
  180. package/dist-lib/lib/strings.d.ts +62 -1
  181. package/dist-lib/lib/strings.js +75 -19
  182. package/dist-lib/lib/strings.js.map +1 -1
  183. package/dist-lib/lib/strings.mn.js +50 -5
  184. package/dist-lib/lib/strings.mn.js.map +1 -1
  185. package/dist-lib/styles.css +1 -1
  186. package/dist-lib/theme.css +141 -78
  187. package/package.json +11 -4
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ import { jsx as N } from "react/jsx-runtime";
3
+ import { forwardRef as h } from "react";
4
+ import { formatDate as v } 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, c = 60 * f, m = 24 * c, R = h(function({ date: n, now: o, absolute: d, className: g, ...p }, T) {
9
+ const t = M().relativeTime, s = n instanceof Date ? n : new Date(n), D = o === void 0 ? Date.now() : o instanceof Date ? o.getTime() : o, l = s.getTime() - D, e = Math.abs(l), r = l > 0, u = v(s, d);
10
+ let i;
11
+ return e < f ? i = t.justNow : e < c ? 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 / c)
15
+ }) : e < 30 * m ? i = a(r ? t.inDays : t.daysAgo, { n: Math.round(e / m) }) : i = u, /* @__PURE__ */ N(
16
+ "time",
17
+ {
18
+ ref: T,
19
+ dateTime: Number.isNaN(s.getTime()) ? void 0 : s.toISOString(),
20
+ title: u,
21
+ className: b("tabular", g),
22
+ ...p,
23
+ children: i
24
+ }
25
+ );
26
+ });
27
+ R.displayName = "RelativeTime";
28
+ export {
29
+ R as RelativeTime
30
+ };
31
+ //# sourceMappingURL=RelativeTime.js.map
@@ -0,0 +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 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,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,3 +1,4 @@
1
+ import { ComponentPropsWithoutRef } from 'react';
1
2
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
2
3
  /**
3
4
  * Custom scroll container with consistent styled scrollbars across OS / browsers.
@@ -9,5 +10,12 @@ import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
9
10
  * <div className="p-3">…long content…</div>
10
11
  * </ScrollArea>
11
12
  */
12
- export declare const ScrollArea: import('react').ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
13
+ export interface ScrollAreaProps extends ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> {
14
+ /**
15
+ * Accessible name of the viewport (a focusable `group` so keyboard users
16
+ * can scroll it). Defaults to `strings.scrollArea.region`.
17
+ */
18
+ viewportLabel?: string;
19
+ }
20
+ export declare const ScrollArea: import('react').ForwardRefExoticComponent<ScrollAreaProps & import('react').RefAttributes<HTMLDivElement>>;
13
21
  export declare const ScrollBar: import('react').ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,44 +1,60 @@
1
1
  "use client";
2
2
  import { jsxs as d, jsx as l } from "react/jsx-runtime";
3
- import { forwardRef as c } from "react";
4
- import * as e from "@radix-ui/react-scroll-area";
3
+ import { forwardRef as s } from "react";
4
+ import * as o from "@radix-ui/react-scroll-area";
5
5
  import { cn as n } from "../../lib/utils.js";
6
- const f = c(function({ className: o, children: r, ...a }, t) {
7
- return /* @__PURE__ */ d(
8
- e.Root,
9
- {
10
- ref: t,
11
- className: n("relative overflow-hidden", o),
12
- ...a,
13
- children: [
14
- /* @__PURE__ */ l(e.Viewport, { className: "h-full w-full rounded-[inherit]", children: r }),
15
- /* @__PURE__ */ l(s, {}),
16
- /* @__PURE__ */ l(e.Corner, {})
17
- ]
18
- }
19
- );
20
- });
21
- f.displayName = "ScrollArea";
22
- const s = c(function({ className: o, orientation: r = "vertical", ...a }, t) {
6
+ import { useStrings as m } from "../../hooks/use-strings.js";
7
+ const p = s(
8
+ function({ className: e, children: r, viewportLabel: a, ...i }, f) {
9
+ const u = m();
10
+ return /* @__PURE__ */ d(
11
+ o.Root,
12
+ {
13
+ ref: f,
14
+ className: n("relative overflow-hidden", e),
15
+ ...i,
16
+ children: [
17
+ /* @__PURE__ */ l(
18
+ o.Viewport,
19
+ {
20
+ role: "group",
21
+ "aria-label": a ?? u.scrollArea.region,
22
+ tabIndex: 0,
23
+ className: n(
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"
26
+ ),
27
+ children: r
28
+ }
29
+ ),
30
+ /* @__PURE__ */ l(t, {}),
31
+ /* @__PURE__ */ l(o.Corner, {})
32
+ ]
33
+ }
34
+ );
35
+ }
36
+ );
37
+ p.displayName = "ScrollArea";
38
+ const t = s(function({ className: e, orientation: r = "vertical", ...a }, i) {
23
39
  return /* @__PURE__ */ l(
24
- e.ScrollAreaScrollbar,
40
+ o.ScrollAreaScrollbar,
25
41
  {
26
- ref: t,
42
+ ref: i,
27
43
  orientation: r,
28
44
  className: n(
29
- "flex touch-none select-none transition-colors duration-[var(--duration-fast)]",
45
+ "flex touch-none transition-colors duration-[var(--duration-fast)] select-none",
30
46
  r === "vertical" && "h-full w-2 border-l border-l-transparent p-px",
31
47
  r === "horizontal" && "h-2 flex-col border-t border-t-transparent p-px",
32
- o
48
+ e
33
49
  ),
34
50
  ...a,
35
- children: /* @__PURE__ */ l(e.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border-strong" })
51
+ children: /* @__PURE__ */ l(o.ScrollAreaThumb, { className: "bg-border-strong relative flex-1 rounded-full" })
36
52
  }
37
53
  );
38
54
  });
39
- s.displayName = "ScrollBar";
55
+ t.displayName = "ScrollBar";
40
56
  export {
41
- f as ScrollArea,
42
- s as ScrollBar
57
+ p as ScrollArea,
58
+ t as ScrollBar
43
59
  };
44
60
  //# sourceMappingURL=ScrollArea.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScrollArea.js","sources":["../../../src/components/ui/ScrollArea.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';\nimport { cn } from '@/lib/utils';\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 const ScrollArea = forwardRef<\n ElementRef<typeof ScrollAreaPrimitive.Root>,\n ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>\n>(function ScrollArea({ className, children, ...props }, ref) {\n return (\n <ScrollAreaPrimitive.Root\n ref={ref}\n className={cn('relative overflow-hidden', className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport className=\"h-full w-full rounded-[inherit]\">\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n );\n});\nScrollArea.displayName = 'ScrollArea';\n\nexport const ScrollBar = forwardRef<\n ElementRef<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 select-none transition-colors duration-[var(--duration-fast)]',\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=\"relative flex-1 rounded-full bg-border-strong\" />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n );\n});\nScrollBar.displayName = 'ScrollBar';\n"],"names":["ScrollArea","forwardRef","className","children","props","ref","jsxs","ScrollAreaPrimitive","cn","jsx","ScrollBar","orientation"],"mappings":";;;;;AAoBO,MAAMA,IAAaC,EAGxB,SAAoB,EAAE,WAAAC,GAAW,UAAAC,GAAU,GAAGC,EAAA,GAASC,GAAK;AAC5D,SACE,gBAAAC;AAAA,IAACC,EAAoB;AAAA,IAApB;AAAA,MACC,KAAAF;AAAA,MACA,WAAWG,EAAG,4BAA4BN,CAAS;AAAA,MAClD,GAAGE;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAK,EAACF,EAAoB,UAApB,EAA6B,WAAU,mCACrC,UAAAJ,GACH;AAAA,0BACCO,GAAA,EAAU;AAAA,QACX,gBAAAD,EAACF,EAAoB,QAApB,CAAA,CAA2B;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGlC,CAAC;AACDP,EAAW,cAAc;AAElB,MAAMU,IAAYT,EAGvB,SAAmB,EAAE,WAAAC,GAAW,aAAAS,IAAc,YAAY,GAAGP,EAAA,GAASC,GAAK;AAC3E,SACE,gBAAAI;AAAA,IAACF,EAAoB;AAAA,IAApB;AAAA,MACC,KAAAF;AAAA,MACA,aAAAM;AAAA,MACA,WAAWH;AAAA,QACT;AAAA,QACAG,MAAgB,cAAc;AAAA,QAC9BA,MAAgB,gBAAgB;AAAA,QAChCT;AAAA,MAAA;AAAA,MAED,GAAGE;AAAA,MAEJ,UAAA,gBAAAK,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 ElementRef } 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<ElementRef<typeof ScrollAreaPrimitive.Root>, ScrollAreaProps>(\n function ScrollArea({ className, children, viewportLabel, ...props }, ref) {\n const strings = useStrings();\n return (\n <ScrollAreaPrimitive.Root\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 },\n);\nScrollArea.displayName = 'ScrollArea';\n\nexport const ScrollBar = forwardRef<\n ElementRef<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;AAAA,EACxB,SAAoB,EAAE,WAAAC,GAAW,UAAAC,GAAU,eAAAC,GAAe,GAAGC,EAAA,GAASC,GAAK;AACzE,UAAMC,IAAUC,EAAA;AAChB,WACE,gBAAAC;AAAA,MAACC,EAAoB;AAAA,MAApB;AAAA,QACC,KAAAJ;AAAA,QACA,WAAWK,EAAG,4BAA4BT,CAAS;AAAA,QAClD,GAAGG;AAAA,QAEJ,UAAA;AAAA,UAAA,gBAAAO;AAAA,YAACF,EAAoB;AAAA,YAApB;AAAA,cACC,MAAK;AAAA,cACL,cAAYN,KAAiBG,EAAQ,WAAW;AAAA,cAChD,UAAU;AAAA,cACV,WAAWI;AAAA,gBACT;AAAA,gBACA;AAAA,cAAA;AAAA,cAGD,UAAAR;AAAA,YAAA;AAAA,UAAA;AAAA,4BAEFU,GAAA,EAAU;AAAA,UACX,gBAAAD,EAACF,EAAoB,QAApB,CAAA,CAA2B;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGlC;AACF;AACAV,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;"}
@@ -3,7 +3,12 @@ import * as SelectPrimitive from '@radix-ui/react-select';
3
3
  export declare const Select: import('react').FC<SelectPrimitive.SelectProps>;
4
4
  export declare const SelectValue: import('react').ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & import('react').RefAttributes<HTMLSpanElement>>;
5
5
  export interface SelectTriggerProps extends Omit<ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>, 'children'> {
6
- /** Placeholder shown when no value is selected. */
6
+ /**
7
+ * Placeholder shown when no value is selected. Also used as the trigger's
8
+ * accessible name when no `aria-label` / `aria-labelledby` / `id` (external
9
+ * `<Label htmlFor>`) is supplied — `role="combobox"` takes no name from
10
+ * its content.
11
+ */
7
12
  placeholder?: string;
8
13
  /** Trigger height — matches Input sizes. */
9
14
  size?: 'sm' | 'md' | 'lg';
@@ -1,53 +1,57 @@
1
1
  "use client";
2
2
  import { jsx as t, jsxs as d } from "react/jsx-runtime";
3
- import { forwardRef as n } from "react";
4
- import * as o from "@radix-ui/react-select";
5
- import { Check as h, ChevronDown as S, ChevronUp as b, ChevronsUpDown as x } from "../../icons/index.js";
3
+ import { forwardRef as l } from "react";
4
+ import * as a from "@radix-ui/react-select";
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
- const U = o.Root, j = o.Value, v = n(function({ className: r, placeholder: a, size: e = "md", tone: s = "default", ...i }, g) {
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) {
9
+ const b = y(), h = !!(n["aria-label"] || n["aria-labelledby"] || n.id);
8
10
  return /* @__PURE__ */ d(
9
- o.Trigger,
11
+ a.Trigger,
10
12
  {
11
13
  ref: g,
14
+ "aria-label": h ? void 0 : o ?? b.select.placeholder,
12
15
  className: c(
13
- "inline-flex w-full items-center justify-between gap-2 rounded-md border bg-card text-lg md:text-sm text-foreground",
16
+ "bg-card text-foreground inline-flex w-full items-center justify-between gap-2 rounded-md border text-lg md:text-sm",
17
+ "[&>span]:min-w-0 [&>span]:truncate",
14
18
  "transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]",
15
19
  "outline-none",
16
- "focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background",
17
- "disabled:opacity-50 disabled:cursor-not-allowed",
20
+ "focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2",
21
+ "disabled:cursor-not-allowed disabled:opacity-50",
18
22
  "data-[placeholder]:text-foreground-subtle",
19
23
  e === "sm" && "h-8 px-2.5",
20
24
  e === "md" && "h-9 px-3",
21
25
  e === "lg" && "h-10 px-3.5",
22
- s === "default" ? "border-border-input focus-visible:border-accent focus-visible:ring-ring" : "border-danger focus-visible:border-danger focus-visible:ring-danger",
26
+ i === "default" ? "border-border-input focus-visible:border-accent focus-visible:ring-ring" : "border-danger focus-visible:border-danger focus-visible:ring-danger",
23
27
  r
24
28
  ),
25
- ...i,
29
+ ...n,
26
30
  children: [
27
- /* @__PURE__ */ t(o.Value, { placeholder: a }),
28
- /* @__PURE__ */ t(o.Icon, { asChild: !0, children: /* @__PURE__ */ t(x, { className: "size-4 text-foreground-subtle shrink-0", "aria-hidden": !0 }) })
31
+ /* @__PURE__ */ t(a.Value, { placeholder: o }),
32
+ /* @__PURE__ */ t(a.Icon, { asChild: !0, children: /* @__PURE__ */ t(N, { className: "text-foreground-subtle size-4 shrink-0", "aria-hidden": !0 }) })
29
33
  ]
30
34
  }
31
35
  );
32
36
  });
33
- v.displayName = "SelectTrigger";
34
- const u = "flex h-6 cursor-default items-center justify-center text-foreground-subtle", m = n(function({ className: r, ...a }, e) {
35
- return /* @__PURE__ */ t(o.ScrollUpButton, { ref: e, className: c(u, r), ...a, children: /* @__PURE__ */ t(b, { className: "size-4", "aria-hidden": !0 }) });
37
+ w.displayName = "SelectTrigger";
38
+ const u = "flex h-6 cursor-default items-center justify-center text-foreground-subtle", m = l(function({ className: r, ...o }, e) {
39
+ return /* @__PURE__ */ t(a.ScrollUpButton, { ref: e, className: c(u, r), ...o, children: /* @__PURE__ */ t(v, { className: "size-4", "aria-hidden": !0 }) });
36
40
  });
37
41
  m.displayName = "SelectScrollUpButton";
38
- const p = n(function({ className: r, ...a }, e) {
39
- return /* @__PURE__ */ t(o.ScrollDownButton, { ref: e, className: c(u, r), ...a, children: /* @__PURE__ */ t(S, { className: "size-4", "aria-hidden": !0 }) });
42
+ const p = l(function({ className: r, ...o }, e) {
43
+ return /* @__PURE__ */ t(a.ScrollDownButton, { ref: e, className: c(u, r), ...o, children: /* @__PURE__ */ t(x, { className: "size-4", "aria-hidden": !0 }) });
40
44
  });
41
45
  p.displayName = "SelectScrollDownButton";
42
- const N = n(function({ className: r, children: a, position: e = "popper", ...s }, i) {
43
- return /* @__PURE__ */ t(o.Portal, { children: /* @__PURE__ */ d(
44
- o.Content,
46
+ const B = l(function({ className: r, children: o, position: e = "popper", ...i }, n) {
47
+ return /* @__PURE__ */ t(a.Portal, { children: /* @__PURE__ */ d(
48
+ a.Content,
45
49
  {
46
- ref: i,
50
+ ref: n,
47
51
  position: e,
48
52
  className: c(
49
- "z-[var(--z-popover)] min-w-[var(--radix-select-trigger-width)] max-h-96",
50
- "overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground",
53
+ "z-[var(--z-popover)] max-h-96 min-w-[var(--radix-select-trigger-width)]",
54
+ "border-border bg-popover text-popover-foreground overflow-hidden rounded-lg border",
51
55
  "shadow-md",
52
56
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
53
57
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
@@ -55,77 +59,81 @@ const N = n(function({ className: r, children: a, position: e = "popper", ...s }
55
59
  e === "popper" && "data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",
56
60
  r
57
61
  ),
58
- ...s,
62
+ ...i,
59
63
  children: [
60
64
  /* @__PURE__ */ t(m, {}),
61
- /* @__PURE__ */ t(o.Viewport, { className: "p-1", children: a }),
65
+ /* @__PURE__ */ t(a.Viewport, { className: "p-1", children: o }),
62
66
  /* @__PURE__ */ t(p, {})
63
67
  ]
64
68
  }
65
69
  ) });
66
70
  });
67
- N.displayName = "SelectContent";
68
- const f = n(function({ className: r, ...a }, e) {
71
+ B.displayName = "SelectContent";
72
+ const f = l(function({ className: r, ...o }, e) {
69
73
  return /* @__PURE__ */ t(
70
- o.Label,
74
+ a.Label,
71
75
  {
72
76
  ref: e,
73
- className: c("px-2 py-1.5 text-xs font-medium text-foreground-subtle", r),
74
- ...a
77
+ className: c("text-foreground-subtle px-2 py-1.5 text-xs font-medium", r),
78
+ ...o
75
79
  }
76
80
  );
77
81
  });
78
82
  f.displayName = "SelectLabel";
79
- const y = n(function({ className: r, children: a, leadingIcon: e, ...s }, i) {
80
- return /* @__PURE__ */ d(
81
- o.Item,
82
- {
83
- ref: i,
84
- className: c(
85
- "relative flex w-full cursor-default select-none items-center gap-2",
86
- "rounded-sm px-2 py-1.5 pr-8 text-sm text-foreground outline-none",
87
- "data-[highlighted]:bg-background-muted data-[highlighted]:text-foreground",
88
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
89
- r
90
- ),
91
- ...s,
92
- children: [
93
- e && /* @__PURE__ */ t("span", { className: "flex items-center text-foreground-subtle [&_svg]:size-4", children: e }),
94
- /* @__PURE__ */ t(o.ItemText, { children: a }),
95
- /* @__PURE__ */ t("span", { className: "absolute right-2 flex items-center justify-center", children: /* @__PURE__ */ t(o.ItemIndicator, { children: /* @__PURE__ */ t(h, { className: "size-4 text-accent", "aria-hidden": !0 }) }) })
96
- ]
97
- }
98
- );
99
- });
100
- y.displayName = "SelectItem";
101
- const w = n(function({ className: r, ...a }, e) {
83
+ const C = l(
84
+ function({ className: r, children: o, leadingIcon: e, ...i }, n) {
85
+ return /* @__PURE__ */ d(
86
+ a.Item,
87
+ {
88
+ ref: n,
89
+ className: c(
90
+ "relative flex w-full cursor-default items-center gap-2 select-none",
91
+ "text-foreground rounded-sm px-2 py-1.5 pr-8 text-sm outline-none",
92
+ "data-[highlighted]:bg-background-muted data-[highlighted]:text-foreground",
93
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
94
+ r
95
+ ),
96
+ ...i,
97
+ children: [
98
+ e && /* @__PURE__ */ t("span", { className: "text-foreground-subtle flex items-center [&_svg]:size-4", children: e }),
99
+ /* @__PURE__ */ t(a.ItemText, { children: o }),
100
+ /* @__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 }) }) })
101
+ ]
102
+ }
103
+ );
104
+ }
105
+ );
106
+ C.displayName = "SelectItem";
107
+ const z = l(function({ className: r, ...o }, e) {
102
108
  return /* @__PURE__ */ t(
103
- o.Separator,
109
+ a.Separator,
104
110
  {
105
111
  ref: e,
106
- className: c("-mx-1 my-1 h-px bg-border", r),
107
- ...a
112
+ className: c("bg-border -mx-1 my-1 h-px", r),
113
+ ...o
108
114
  }
109
115
  );
110
116
  });
111
- w.displayName = "SelectSeparator";
112
- const B = n(function({ label: r, children: a, ...e }, s) {
113
- return /* @__PURE__ */ d(o.Group, { ref: s, ...e, children: [
114
- r && /* @__PURE__ */ t(f, { children: r }),
115
- a
116
- ] });
117
- });
118
- B.displayName = "SelectGroup";
117
+ z.displayName = "SelectSeparator";
118
+ const I = l(
119
+ function({ label: r, children: o, ...e }, i) {
120
+ return /* @__PURE__ */ d(a.Group, { ref: i, ...e, children: [
121
+ r && /* @__PURE__ */ t(f, { children: r }),
122
+ o
123
+ ] });
124
+ }
125
+ );
126
+ I.displayName = "SelectGroup";
119
127
  export {
120
- U as Select,
121
- N as SelectContent,
122
- B as SelectGroup,
123
- y as SelectItem,
128
+ G as Select,
129
+ B as SelectContent,
130
+ I as SelectGroup,
131
+ C as SelectItem,
124
132
  f as SelectLabel,
125
133
  p as SelectScrollDownButton,
126
134
  m as SelectScrollUpButton,
127
- w as SelectSeparator,
128
- v as SelectTrigger,
129
- j as SelectValue
135
+ z as SelectSeparator,
136
+ w as SelectTrigger,
137
+ L as SelectValue
130
138
  };
131
139
  //# sourceMappingURL=Select.js.map
@@ -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 ElementRef,\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';\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\n extends Omit<ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>, 'children'> {\n /** Placeholder shown when no value is selected. */\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 ElementRef<typeof SelectPrimitive.Trigger>,\n SelectTriggerProps\n>(function SelectTrigger({ className, placeholder, size = 'md', tone = 'default', ...props }, ref) {\n return (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'inline-flex w-full items-center justify-between gap-2 rounded-md border bg-card text-lg md:text-sm text-foreground',\n 'transition-colors duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'outline-none',\n 'focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n 'disabled:opacity-50 disabled:cursor-not-allowed',\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=\"size-4 text-foreground-subtle shrink-0\" aria-hidden />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n});\nSelectTrigger.displayName = 'SelectTrigger';\n\nconst scrollBtn =\n 'flex h-6 cursor-default items-center justify-center text-foreground-subtle';\n\nexport const SelectScrollUpButton = forwardRef<\n ElementRef<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 ElementRef<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 ElementRef<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)] min-w-[var(--radix-select-trigger-width)] max-h-96',\n 'overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground',\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 ElementRef<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('px-2 py-1.5 text-xs font-medium text-foreground-subtle', className)}\n {...props}\n />\n );\n});\nSelectLabel.displayName = 'SelectLabel';\n\nexport interface SelectItemProps\n extends ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {\n /** Icon shown to the left of the label. */\n leadingIcon?: ReactNode;\n}\n\nexport const SelectItem = forwardRef<\n ElementRef<typeof SelectPrimitive.Item>,\n 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 select-none items-center gap-2',\n 'rounded-sm px-2 py-1.5 pr-8 text-sm text-foreground 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=\"flex items-center text-foreground-subtle [&_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=\"size-4 text-accent\" aria-hidden />\n </SelectPrimitive.ItemIndicator>\n </span>\n </SelectPrimitive.Item>\n );\n});\nSelectItem.displayName = 'SelectItem';\n\nexport const SelectSeparator = forwardRef<\n ElementRef<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('-mx-1 my-1 h-px bg-border', 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\n extends ComponentPropsWithoutRef<typeof SelectPrimitive.Group> {\n label?: ReactNode;\n}\nexport const SelectGroup = forwardRef<\n ElementRef<typeof SelectPrimitive.Group>,\n 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});\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","jsxs","cn","jsx","ChevronsUpDown","scrollBtn","SelectScrollUpButton","ChevronUp","SelectScrollDownButton","ChevronDown","SelectContent","children","position","SelectLabel","SelectItem","leadingIcon","Check","SelectSeparator","SelectGroup","label"],"mappings":";;;;;;AA6BO,MAAMA,IAASC,EAAgB,MACzBC,IAAcD,EAAgB,OAY9BE,IAAgBC,EAG3B,SAAuB,EAAE,WAAAC,GAAW,aAAAC,GAAa,MAAAC,IAAO,MAAM,MAAAC,IAAO,WAAW,GAAGC,EAAA,GAASC,GAAK;AACjG,SACE,gBAAAC;AAAA,IAACV,EAAgB;AAAA,IAAh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,EAAC,QAAA,EAAK,WAAU,qDACd,4BAACZ,EAAgB,eAAhB,EACC,UAAA,gBAAAY,EAACa,KAAM,WAAU,sBAAqB,eAAW,GAAA,CAAC,GACpD,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN,CAAC;AACDF,EAAW,cAAc;AAElB,MAAMG,IAAkBvB,EAG7B,SAAyB,EAAE,WAAAC,GAAW,GAAGI,EAAA,GAASC,GAAK;AACvD,SACE,gBAAAG;AAAA,IAACZ,EAAgB;AAAA,IAAhB;AAAA,MACC,KAAAS;AAAA,MACA,WAAWE,EAAG,6BAA6BP,CAAS;AAAA,MACnD,GAAGI;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDkB,EAAgB,cAAc;AAOvB,MAAMC,IAAcxB,EAGzB,SAAqB,EAAE,OAAAyB,GAAO,UAAAR,GAAU,GAAGZ,EAAA,GAASC,GAAK;AACzD,2BACGT,EAAgB,OAAhB,EAAsB,KAAAS,GAAW,GAAGD,GAClC,UAAA;AAAA,IAAAoB,KAAS,gBAAAhB,EAACU,KAAa,UAAAM,EAAA,CAAM;AAAA,IAC7BR;AAAA,EAAA,GACH;AAEJ,CAAC;AACDO,EAAY,cAAc;"}
1
+ {"version":3,"file":"Select.js","sources":["../../../src/components/ui/Select.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, type ComponentPropsWithoutRef, type ElementRef, type ReactNode } 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 ElementRef<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 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 ElementRef<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 ElementRef<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 ElementRef<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 ElementRef<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<ElementRef<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 ElementRef<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<ElementRef<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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  orientation: r,
12
12
  decorative: t,
13
13
  className: f(
14
- "shrink-0 bg-border",
14
+ "bg-border shrink-0",
15
15
  r === "horizontal" ? "h-px w-full" : "h-full w-px",
16
16
  o
17
17
  ),
@@ -1 +1 @@
1
- {"version":3,"file":"Separator.js","sources":["../../../src/components/ui/Separator.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n type ComponentPropsWithoutRef,\n type ElementRef,\n} from 'react';\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\nimport { cn } from '@/lib/utils';\n\n/**\n * Hairline divider. Decorative by default (no role announced). Pass\n * `decorative={false}` when the separator carries semantic meaning, e.g.\n * splitting two regions in a landmark.\n *\n * @example Section divider\n * <Separator className=\"my-6\" />\n *\n * @example Vertical inside a toolbar\n * <Separator orientation=\"vertical\" className=\"h-5 mx-2\" />\n */\nexport const Separator = forwardRef<\n ElementRef<typeof SeparatorPrimitive.Root>,\n ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(function Separator(\n { className, orientation = 'horizontal', decorative = true, ...props },\n ref,\n) {\n return (\n <SeparatorPrimitive.Root\n ref={ref}\n orientation={orientation}\n decorative={decorative}\n className={cn(\n 'shrink-0 bg-border',\n orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px',\n className,\n )}\n {...props}\n />\n );\n});\nSeparator.displayName = 'Separator';\n"],"names":["Separator","forwardRef","className","orientation","decorative","props","ref","jsx","SeparatorPrimitive","cn"],"mappings":";;;;;AAqBO,MAAMA,IAAYC,EAGvB,SACA,EAAE,WAAAC,GAAW,aAAAC,IAAc,cAAc,YAAAC,IAAa,IAAM,GAAGC,EAAA,GAC/DC,GACA;AACA,SACE,gBAAAC;AAAA,IAACC,EAAmB;AAAA,IAAnB;AAAA,MACC,KAAAF;AAAA,MACA,aAAAH;AAAA,MACA,YAAAC;AAAA,MACA,WAAWK;AAAA,QACT;AAAA,QACAN,MAAgB,eAAe,gBAAgB;AAAA,QAC/CD;AAAA,MAAA;AAAA,MAED,GAAGG;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDL,EAAU,cAAc;"}
1
+ {"version":3,"file":"Separator.js","sources":["../../../src/components/ui/Separator.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, type ComponentPropsWithoutRef, type ElementRef } from 'react';\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\nimport { cn } from '@/lib/utils';\n\n/**\n * Hairline divider. Decorative by default (no role announced). Pass\n * `decorative={false}` when the separator carries semantic meaning, e.g.\n * splitting two regions in a landmark.\n *\n * @example Section divider\n * <Separator className=\"my-6\" />\n *\n * @example Vertical inside a toolbar\n * <Separator orientation=\"vertical\" className=\"h-5 mx-2\" />\n */\nexport const Separator = forwardRef<\n ElementRef<typeof SeparatorPrimitive.Root>,\n ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(function Separator({ className, orientation = 'horizontal', decorative = true, ...props }, ref) {\n return (\n <SeparatorPrimitive.Root\n ref={ref}\n orientation={orientation}\n decorative={decorative}\n className={cn(\n 'bg-border shrink-0',\n orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px',\n className,\n )}\n {...props}\n />\n );\n});\nSeparator.displayName = 'Separator';\n"],"names":["Separator","forwardRef","className","orientation","decorative","props","ref","jsx","SeparatorPrimitive","cn"],"mappings":";;;;;AAiBO,MAAMA,IAAYC,EAGvB,SAAmB,EAAE,WAAAC,GAAW,aAAAC,IAAc,cAAc,YAAAC,IAAa,IAAM,GAAGC,EAAA,GAASC,GAAK;AAChG,SACE,gBAAAC;AAAA,IAACC,EAAmB;AAAA,IAAnB;AAAA,MACC,KAAAF;AAAA,MACA,aAAAH;AAAA,MACA,YAAAC;AAAA,MACA,WAAWK;AAAA,QACT;AAAA,QACAN,MAAgB,eAAe,gBAAgB;AAAA,QAC/CD;AAAA,MAAA;AAAA,MAED,GAAGG;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC;AACDL,EAAU,cAAc;"}
@@ -1,5 +1,6 @@
1
1
  import { ComponentPropsWithoutRef, HTMLAttributes } from 'react';
2
2
  import { VariantProps } from '../../lib/cva.js';
3
+ import { ReturnFocusRef } from '../../lib/return-focus.js';
3
4
  import * as DialogPrimitive from '@radix-ui/react-dialog';
4
5
  export declare const Sheet: import('react').FC<DialogPrimitive.DialogProps>;
5
6
  export declare const SheetTrigger: import('react').ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -10,6 +11,14 @@ declare const sheet: (props?: ({
10
11
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
11
12
  export interface SheetContentProps extends ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheet> {
12
13
  showClose?: boolean;
14
+ /**
15
+ * Element to focus when the overlay closes. Overrides Radix's default
16
+ * (the element focused when the content mounted), which is `<body>` for
17
+ * controlled overlays opened from a pointer click on a non-focusable /
18
+ * tooltip-wrapped trigger. A consumer `onCloseAutoFocus` runs first and
19
+ * wins if it calls `preventDefault()`.
20
+ */
21
+ returnFocusTo?: ReturnFocusRef;
13
22
  }
14
23
  export declare const SheetContent: import('react').ForwardRefExoticComponent<SheetContentProps & import('react').RefAttributes<HTMLDivElement>>;
15
24
  export declare function SheetHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;