@gerege-systems/ui 0.14.0 → 0.14.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 (77) 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/Breadcrumbs.js +6 -6
  6. package/dist-lib/components/ui/Breadcrumbs.js.map +1 -1
  7. package/dist-lib/components/ui/Button.js +9 -8
  8. package/dist-lib/components/ui/Button.js.map +1 -1
  9. package/dist-lib/components/ui/Calendar.js +3 -3
  10. package/dist-lib/components/ui/Calendar.js.map +1 -1
  11. package/dist-lib/components/ui/Card.js +7 -7
  12. package/dist-lib/components/ui/Card.js.map +1 -1
  13. package/dist-lib/components/ui/Carousel.js +1 -1
  14. package/dist-lib/components/ui/Carousel.js.map +1 -1
  15. package/dist-lib/components/ui/Chart.js +1 -1
  16. package/dist-lib/components/ui/Chart.js.map +1 -1
  17. package/dist-lib/components/ui/Checkbox.js +1 -1
  18. package/dist-lib/components/ui/Checkbox.js.map +1 -1
  19. package/dist-lib/components/ui/Combobox.js +12 -12
  20. package/dist-lib/components/ui/Combobox.js.map +1 -1
  21. package/dist-lib/components/ui/CommandPalette.js +8 -8
  22. package/dist-lib/components/ui/CommandPalette.js.map +1 -1
  23. package/dist-lib/components/ui/ContextMenu.js +1 -1
  24. package/dist-lib/components/ui/ContextMenu.js.map +1 -1
  25. package/dist-lib/components/ui/DatePicker.js +2 -2
  26. package/dist-lib/components/ui/DatePicker.js.map +1 -1
  27. package/dist-lib/components/ui/Dialog.js +1 -1
  28. package/dist-lib/components/ui/Dialog.js.map +1 -1
  29. package/dist-lib/components/ui/Drawer.js +18 -18
  30. package/dist-lib/components/ui/Drawer.js.map +1 -1
  31. package/dist-lib/components/ui/DropdownMenu.js +1 -1
  32. package/dist-lib/components/ui/DropdownMenu.js.map +1 -1
  33. package/dist-lib/components/ui/FileUpload.js +1 -1
  34. package/dist-lib/components/ui/FileUpload.js.map +1 -1
  35. package/dist-lib/components/ui/IconButton.js +7 -7
  36. package/dist-lib/components/ui/IconButton.js.map +1 -1
  37. package/dist-lib/components/ui/Input.js +7 -7
  38. package/dist-lib/components/ui/Input.js.map +1 -1
  39. package/dist-lib/components/ui/MultiSelect.js +24 -24
  40. package/dist-lib/components/ui/MultiSelect.js.map +1 -1
  41. package/dist-lib/components/ui/Pagination.js +21 -21
  42. package/dist-lib/components/ui/Pagination.js.map +1 -1
  43. package/dist-lib/components/ui/Popover.js +4 -4
  44. package/dist-lib/components/ui/Popover.js.map +1 -1
  45. package/dist-lib/components/ui/RadioGroup.js +9 -9
  46. package/dist-lib/components/ui/RadioGroup.js.map +1 -1
  47. package/dist-lib/components/ui/ScrollArea.js +11 -11
  48. package/dist-lib/components/ui/ScrollArea.js.map +1 -1
  49. package/dist-lib/components/ui/Select.js +29 -29
  50. package/dist-lib/components/ui/Select.js.map +1 -1
  51. package/dist-lib/components/ui/Sheet.js +1 -1
  52. package/dist-lib/components/ui/Sheet.js.map +1 -1
  53. package/dist-lib/components/ui/Sidebar.js +64 -60
  54. package/dist-lib/components/ui/Sidebar.js.map +1 -1
  55. package/dist-lib/components/ui/Slider.js +1 -1
  56. package/dist-lib/components/ui/Slider.js.map +1 -1
  57. package/dist-lib/components/ui/Snackbar.js +28 -19
  58. package/dist-lib/components/ui/Snackbar.js.map +1 -1
  59. package/dist-lib/components/ui/Switch.js +7 -7
  60. package/dist-lib/components/ui/Switch.js.map +1 -1
  61. package/dist-lib/components/ui/Table.js +6 -6
  62. package/dist-lib/components/ui/Table.js.map +1 -1
  63. package/dist-lib/components/ui/Tabs.js +6 -6
  64. package/dist-lib/components/ui/Tabs.js.map +1 -1
  65. package/dist-lib/components/ui/TagInput.js +3 -3
  66. package/dist-lib/components/ui/TagInput.js.map +1 -1
  67. package/dist-lib/components/ui/Textarea.js +1 -1
  68. package/dist-lib/components/ui/Textarea.js.map +1 -1
  69. package/dist-lib/components/ui/Toast.js +8 -8
  70. package/dist-lib/components/ui/Toast.js.map +1 -1
  71. package/dist-lib/components/ui/TopNav.js +9 -9
  72. package/dist-lib/components/ui/TopNav.js.map +1 -1
  73. package/dist-lib/components/ui/Tree.js +2 -2
  74. package/dist-lib/components/ui/Tree.js.map +1 -1
  75. package/dist-lib/styles.css +1 -1
  76. package/dist-lib/theme.css +42 -28
  77. package/package.json +1 -1
@@ -1,44 +1,44 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as x, Fragment as _ } from "react/jsx-runtime";
3
- import { forwardRef as j, useState as P, useContext as k, useId as G, createContext as T } from "react";
2
+ import { jsx as e, jsxs as h, Fragment as P } from "react/jsx-runtime";
3
+ import { forwardRef as j, useState as _, useContext as k, useId as T, createContext as G } from "react";
4
4
  import { Slot as R } from "@radix-ui/react-slot";
5
5
  import { ChevronsRight as D, ChevronsLeft as F, ChevronDown as L } from "../../icons/index.js";
6
6
  import { cn as u } from "../../lib/utils.js";
7
7
  import { useStrings as q } from "../../hooks/use-strings.js";
8
- import { Tooltip as A } from "./Tooltip.js";
9
- const y = T({ collapsed: !1 });
10
- function Y() {
8
+ import { TooltipProvider as A, Tooltip as B } from "./Tooltip.js";
9
+ const y = G({ collapsed: !1 });
10
+ function Z() {
11
11
  return k(y);
12
12
  }
13
- const B = j(function({
14
- defaultCollapsed: d = !1,
13
+ const E = j(function({
14
+ defaultCollapsed: c = !1,
15
15
  collapsed: a,
16
16
  onCollapsedChange: l,
17
17
  header: t,
18
- footer: s,
19
- className: v,
18
+ footer: i,
19
+ className: x,
20
20
  children: b,
21
- "aria-label": g,
22
- ...h
23
- }, i) {
24
- const o = q(), [c, n] = P(d), r = a ?? c, p = (f) => {
21
+ "aria-label": v,
22
+ ...g
23
+ }, s) {
24
+ const o = q(), [d, n] = _(c), r = a ?? d, p = (f) => {
25
25
  a === void 0 && n(f), l == null || l(f);
26
26
  };
27
- return /* @__PURE__ */ e(y.Provider, { value: { collapsed: r }, children: /* @__PURE__ */ x(
27
+ return /* @__PURE__ */ e(y.Provider, { value: { collapsed: r }, children: /* @__PURE__ */ h(
28
28
  "nav",
29
29
  {
30
30
  "data-slot": "sidebar",
31
- ref: i,
32
- "aria-label": g ?? o.sidebar.label,
31
+ ref: s,
32
+ "aria-label": v ?? o.sidebar.label,
33
33
  className: u(
34
34
  "border-border bg-background-subtle sticky top-0 hidden h-dvh shrink-0 flex-col gap-2 border-r md:flex",
35
35
  // Deliberate motion exception: the rail's own width transitions (layout).
36
36
  // Only the rail and the main column it flanks move; no content inside reflows.
37
37
  "transition-[width] duration-[var(--duration-base)] ease-[var(--ease-out)] motion-reduce:transition-none",
38
38
  r ? "w-14" : "w-60",
39
- v
39
+ x
40
40
  ),
41
- ...h,
41
+ ...g,
42
42
  children: [
43
43
  t && /* @__PURE__ */ e(
44
44
  "div",
@@ -51,8 +51,8 @@ const B = j(function({
51
51
  }
52
52
  ),
53
53
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto py-3", children: b }),
54
- s && /* @__PURE__ */ e("div", { className: "border-border border-t p-2", children: s }),
55
- /* @__PURE__ */ x(
54
+ i && /* @__PURE__ */ e("div", { className: "border-border border-t p-2", children: i }),
55
+ /* @__PURE__ */ h(
56
56
  "button",
57
57
  {
58
58
  type: "button",
@@ -61,7 +61,7 @@ const B = j(function({
61
61
  "aria-expanded": !r,
62
62
  className: u(
63
63
  "text-foreground-subtle mx-2 mb-2 flex h-8 items-center gap-2 rounded-md px-2",
64
- "hover:bg-background-muted hover:text-foreground outline-none",
64
+ "hover:bg-background-muted hover:text-foreground outline-hidden",
65
65
  "focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2",
66
66
  "transition-colors duration-[var(--duration-fast)]"
67
67
  ),
@@ -75,15 +75,15 @@ const B = j(function({
75
75
  }
76
76
  ) });
77
77
  });
78
- B.displayName = "Sidebar";
79
- function E({ label: m, className: d, children: a, ...l }) {
80
- const { collapsed: t } = k(y), s = G();
81
- return /* @__PURE__ */ x("div", { className: u("mb-3", d), ...l, children: [
78
+ E.displayName = "Sidebar";
79
+ function H({ label: m, className: c, children: a, ...l }) {
80
+ const { collapsed: t } = k(y), i = T();
81
+ return /* @__PURE__ */ h("div", { className: u("mb-3", c), ...l, children: [
82
82
  m && // Kept in the DOM (sr-only) while collapsed so the list stays labelled.
83
83
  /* @__PURE__ */ e(
84
84
  "div",
85
85
  {
86
- id: s,
86
+ id: i,
87
87
  className: u(
88
88
  "text-foreground-subtle px-4 pt-2 pb-1 text-xs font-medium",
89
89
  t && "sr-only"
@@ -91,27 +91,27 @@ function E({ label: m, className: d, children: a, ...l }) {
91
91
  children: m
92
92
  }
93
93
  ),
94
- /* @__PURE__ */ e("ul", { "aria-labelledby": m ? s : void 0, className: "flex flex-col gap-px", children: a })
94
+ /* @__PURE__ */ e("ul", { "aria-labelledby": m ? i : void 0, className: "flex flex-col gap-px", children: a })
95
95
  ] });
96
96
  }
97
- E.displayName = "SidebarSection";
98
- const H = j(
99
- function(d, a) {
100
- const { icon: l, active: t, trailing: s, sub: v, tooltip: b, asChild: g, className: h, children: i, ...o } = d, { collapsed: c } = k(y), n = u(
101
- "flex h-8 w-full items-center gap-2 rounded-md px-2 text-sm outline-none",
97
+ H.displayName = "SidebarSection";
98
+ const J = j(
99
+ function(c, a) {
100
+ const { icon: l, active: t, trailing: i, sub: x, tooltip: b, asChild: v, className: g, children: s, ...o } = c, { collapsed: d } = k(y), n = u(
101
+ "flex h-8 w-full items-center gap-2 rounded-md px-2 text-sm outline-hidden",
102
102
  "transition-colors duration-[var(--duration-fast)]",
103
103
  "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
104
104
  t ? "bg-background-muted text-foreground font-medium" : "text-foreground-muted hover:bg-background-muted hover:text-foreground",
105
- v && !c && "ml-6",
106
- c && "justify-center",
107
- h
108
- ), r = typeof i == "string" ? i : void 0, p = b ?? r, f = c && !!p, z = /* @__PURE__ */ x(_, { children: [
105
+ x && !d && "ml-6",
106
+ d && "justify-center",
107
+ g
108
+ ), r = typeof s == "string" ? s : void 0, p = b ?? r, f = d && !!p, z = /* @__PURE__ */ h(P, { children: [
109
109
  l && /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center [&_svg]:size-4", children: l }),
110
- c ? /* @__PURE__ */ e("span", { className: "sr-only", children: i }) : /* @__PURE__ */ e("span", { className: "flex-1 truncate text-left", title: r, children: i }),
111
- !c && s && /* @__PURE__ */ e("span", { className: "ml-auto", children: s })
110
+ d ? /* @__PURE__ */ e("span", { className: "sr-only", children: s }) : /* @__PURE__ */ e("span", { className: "flex-1 truncate text-left", title: r, children: s }),
111
+ !d && i && /* @__PURE__ */ e("span", { className: "ml-auto", children: i })
112
112
  ] });
113
113
  let N;
114
- if (g) {
114
+ if (v) {
115
115
  const { href: w, type: S, ...I } = o;
116
116
  N = /* @__PURE__ */ e(
117
117
  R,
@@ -120,7 +120,7 @@ const H = j(
120
120
  "aria-current": t ? "page" : void 0,
121
121
  className: n,
122
122
  ...I,
123
- children: i && typeof i == "object" && "props" in i ? i : null
123
+ children: s && typeof s == "object" && "props" in s ? s : null
124
124
  }
125
125
  );
126
126
  } else if (o.href !== void 0) {
@@ -154,26 +154,30 @@ const H = j(
154
154
  }
155
155
  );
156
156
  }
157
- return /* @__PURE__ */ e("li", { className: "px-2", children: f ? /* @__PURE__ */ e(A, { label: p, side: "right", children: N }) : N });
157
+ return /* @__PURE__ */ e("li", { className: "px-2", children: f ? (
158
+ // Own provider: a collapsed rail must not crash an app that never
159
+ // mounted <TooltipProvider>; an outer provider still wins for delays.
160
+ /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(B, { label: p, side: "right", children: N }) })
161
+ ) : N });
158
162
  }
159
163
  );
160
- H.displayName = "SidebarItem";
161
- const J = j(function({
162
- icon: d,
164
+ J.displayName = "SidebarItem";
165
+ const K = j(function({
166
+ icon: c,
163
167
  label: a,
164
168
  defaultOpen: l = !0,
165
169
  open: t,
166
- onOpenChange: s,
167
- className: v,
170
+ onOpenChange: i,
171
+ className: x,
168
172
  children: b,
169
- ...g
170
- }, h) {
171
- const { collapsed: i } = k(y), [o, c] = P(l), n = t ?? o, r = G(), p = () => {
173
+ ...v
174
+ }, g) {
175
+ const { collapsed: s } = k(y), [o, d] = _(l), n = t ?? o, r = T(), p = () => {
172
176
  const f = !n;
173
- t === void 0 && c(f), s == null || s(f);
177
+ t === void 0 && d(f), i == null || i(f);
174
178
  };
175
- return i ? /* @__PURE__ */ e(_, { children: b }) : /* @__PURE__ */ x("li", { ref: h, className: v, ...g, children: [
176
- /* @__PURE__ */ x(
179
+ return s ? /* @__PURE__ */ e(P, { children: b }) : /* @__PURE__ */ h("li", { ref: g, className: x, ...v, children: [
180
+ /* @__PURE__ */ h(
177
181
  "button",
178
182
  {
179
183
  type: "button",
@@ -181,13 +185,13 @@ const J = j(function({
181
185
  "aria-controls": n ? r : void 0,
182
186
  "aria-expanded": n,
183
187
  className: u(
184
- "text-foreground-muted mx-2 flex h-8 w-[calc(100%-1rem)] items-center gap-2 rounded-md px-2 text-sm outline-none",
188
+ "text-foreground-muted mx-2 flex h-8 w-[calc(100%-1rem)] items-center gap-2 rounded-md px-2 text-sm outline-hidden",
185
189
  "transition-colors duration-[var(--duration-fast)]",
186
190
  "hover:bg-background-muted hover:text-foreground",
187
191
  "focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2"
188
192
  ),
189
193
  children: [
190
- d && /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center [&_svg]:size-4", children: d }),
194
+ c && /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center [&_svg]:size-4", children: c }),
191
195
  /* @__PURE__ */ e("span", { className: "flex-1 text-left", children: a }),
192
196
  /* @__PURE__ */ e(
193
197
  L,
@@ -202,12 +206,12 @@ const J = j(function({
202
206
  n && /* @__PURE__ */ e("ul", { id: r, className: "flex flex-col gap-px", children: b })
203
207
  ] });
204
208
  });
205
- J.displayName = "SidebarGroup";
209
+ K.displayName = "SidebarGroup";
206
210
  export {
207
- B as Sidebar,
208
- J as SidebarGroup,
209
- H as SidebarItem,
210
- E as SidebarSection,
211
- Y as useSidebar
211
+ E as Sidebar,
212
+ K as SidebarGroup,
213
+ J as SidebarItem,
214
+ H as SidebarSection,
215
+ Z as useSidebar
212
216
  };
213
217
  //# sourceMappingURL=Sidebar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar.js","sources":["../../../src/components/ui/Sidebar.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n forwardRef,\n useContext,\n useId,\n useState,\n type AnchorHTMLAttributes,\n type ButtonHTMLAttributes,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { ChevronDown, ChevronsLeft, ChevronsRight } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\nimport { Tooltip } from './Tooltip';\n\ninterface SidebarContextValue {\n collapsed: boolean;\n}\nconst SidebarContext = createContext<SidebarContextValue>({ collapsed: false });\n\n/** Read the parent Sidebar's collapsed state. Useful for brand/footer slots\n * that need to swap between full and compact rendering. */\nexport function useSidebar(): SidebarContextValue {\n return useContext(SidebarContext);\n}\n\nexport interface SidebarProps extends HTMLAttributes<HTMLElement> {\n /** Default state on first mount. Use `defaultCollapsed` for uncontrolled. */\n defaultCollapsed?: boolean;\n /** Controlled collapsed state. */\n collapsed?: boolean;\n /** Called when the user toggles via the rail or keyboard. */\n onCollapsedChange?: (next: boolean) => void;\n /** Header slot pinned to the top (brand, workspace switcher, etc.). */\n header?: ReactNode;\n /** Footer slot pinned to the bottom (user card, version, etc.). */\n footer?: ReactNode;\n}\n\n/**\n * App-level navigation rail. Holds `SidebarSection` → `SidebarItem` lists,\n * and optionally a `footer`. Supports collapse to icon-only on desktop.\n * Below `md` the rail is hidden — pair it with a Sheet / Drawer for mobile.\n *\n * @example\n * <Sidebar footer={<UserCard />}>\n * <SidebarSection label=\"Workspace\">\n * <SidebarItem icon={<Home />} active>Home</SidebarItem>\n * <SidebarItem icon={<Folder />}>Projects</SidebarItem>\n * </SidebarSection>\n * <SidebarSection label=\"Account\">\n * <SidebarItem icon={<Settings />}>Settings</SidebarItem>\n * </SidebarSection>\n * </Sidebar>\n *\n * @do Use 1–3 sections. More than that signals the IA needs restructuring.\n * @dont Hide critical navigation under the collapsed state — keep icons\n * always visible with tooltips.\n */\nexport const Sidebar = forwardRef<HTMLElement, SidebarProps>(function Sidebar(\n {\n defaultCollapsed = false,\n collapsed: controlled,\n onCollapsedChange,\n header,\n footer,\n className,\n children,\n 'aria-label': ariaLabel,\n ...props\n },\n ref,\n) {\n const strings = useStrings();\n const [internal, setInternal] = useState(defaultCollapsed);\n const collapsed = controlled ?? internal;\n const setCollapsed = (next: boolean) => {\n if (controlled === undefined) setInternal(next);\n onCollapsedChange?.(next);\n };\n\n return (\n <SidebarContext.Provider value={{ collapsed }}>\n <nav\n data-slot=\"sidebar\"\n ref={ref}\n aria-label={ariaLabel ?? strings.sidebar.label}\n className={cn(\n 'border-border bg-background-subtle sticky top-0 hidden h-dvh shrink-0 flex-col gap-2 border-r md:flex',\n // Deliberate motion exception: the rail's own width transitions (layout).\n // Only the rail and the main column it flanks move; no content inside reflows.\n 'transition-[width] duration-[var(--duration-base)] ease-[var(--ease-out)] motion-reduce:transition-none',\n collapsed ? 'w-14' : 'w-60',\n className,\n )}\n {...props}\n >\n {header && (\n <div\n className={cn(\n 'border-border flex h-14 shrink-0 items-center overflow-hidden border-b',\n collapsed ? 'justify-center px-2' : 'px-3',\n )}\n >\n {header}\n </div>\n )}\n <div className=\"flex-1 overflow-y-auto py-3\">{children}</div>\n {footer && <div className=\"border-border border-t p-2\">{footer}</div>}\n <button\n type=\"button\"\n onClick={() => setCollapsed(!collapsed)}\n aria-label={collapsed ? strings.sidebar.expand : strings.sidebar.collapse}\n aria-expanded={!collapsed}\n className={cn(\n 'text-foreground-subtle mx-2 mb-2 flex h-8 items-center gap-2 rounded-md px-2',\n 'hover:bg-background-muted hover:text-foreground outline-none',\n 'focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2',\n 'transition-colors duration-[var(--duration-fast)]',\n )}\n >\n {collapsed ? (\n <ChevronsRight className=\"size-4\" aria-hidden />\n ) : (\n <ChevronsLeft className=\"size-4\" aria-hidden />\n )}\n {!collapsed && (\n <span className=\"text-xs font-medium\">{strings.sidebar.collapseShort}</span>\n )}\n </button>\n </nav>\n </SidebarContext.Provider>\n );\n});\nSidebar.displayName = 'Sidebar';\n\nexport interface SidebarSectionProps extends HTMLAttributes<HTMLDivElement> {\n /** Visible section header. Hidden when collapsed. */\n label?: ReactNode;\n}\n\nexport function SidebarSection({ label, className, children, ...props }: SidebarSectionProps) {\n const { collapsed } = useContext(SidebarContext);\n const labelId = useId();\n return (\n <div className={cn('mb-3', className)} {...props}>\n {label && (\n // Kept in the DOM (sr-only) while collapsed so the list stays labelled.\n <div\n id={labelId}\n className={cn(\n 'text-foreground-subtle px-4 pt-2 pb-1 text-xs font-medium',\n collapsed && 'sr-only',\n )}\n >\n {label}\n </div>\n )}\n <ul aria-labelledby={label ? labelId : undefined} className=\"flex flex-col gap-px\">\n {children}\n </ul>\n </div>\n );\n}\nSidebarSection.displayName = 'SidebarSection';\n\ninterface SidebarItemBaseProps {\n /** Lucide icon shown to the left. */\n icon?: ReactNode;\n /** Mark as the current page. */\n active?: boolean;\n /** Trailing badge / counter slot. */\n trailing?: ReactNode;\n /** Render a sub-item indented under a parent. */\n sub?: boolean;\n /**\n * Tooltip text shown while the sidebar is collapsed. Defaults to `children`\n * when that is a plain string.\n */\n tooltip?: ReactNode;\n /**\n * Render the child element (router `<Link>`) instead of `<a>`/`<button>`.\n * The child receives className, aria-current and the item content.\n */\n asChild?: boolean;\n}\n\ntype SidebarItemAnchorProps = SidebarItemBaseProps &\n AnchorHTMLAttributes<HTMLAnchorElement> & {\n /** Renders an `<a>`. Omit to render a `<button>`. */\n href: string;\n };\n\ntype SidebarItemButtonProps = SidebarItemBaseProps &\n ButtonHTMLAttributes<HTMLButtonElement> & {\n href?: undefined;\n };\n\n/** Discriminated on `href`: with it the item is an anchor, without it a button. */\nexport type SidebarItemProps = SidebarItemAnchorProps | SidebarItemButtonProps;\n\nexport const SidebarItem = forwardRef<HTMLElement, SidebarItemProps>(\n function SidebarItem(props, ref) {\n const { icon, active, trailing, sub, tooltip, asChild, className, children, ...rest } = props;\n const { collapsed } = useContext(SidebarContext);\n\n const classes = cn(\n 'flex h-8 w-full items-center gap-2 rounded-md px-2 text-sm outline-none',\n 'transition-colors duration-[var(--duration-fast)]',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n active\n ? 'bg-background-muted text-foreground font-medium'\n : 'text-foreground-muted hover:bg-background-muted hover:text-foreground',\n sub && !collapsed && 'ml-6',\n collapsed && 'justify-center',\n className,\n );\n\n const labelTitle = typeof children === 'string' ? children : undefined;\n const tip = tooltip ?? labelTitle;\n // Collapsed: keep an sr-only label so the control always has a name —\n // the Tooltip only wires aria-describedby while it is open.\n const showTooltip = collapsed && !!tip;\n\n const content = (\n <>\n {icon && <span className=\"flex shrink-0 items-center [&_svg]:size-4\">{icon}</span>}\n {collapsed ? (\n <span className=\"sr-only\">{children}</span>\n ) : (\n <span className=\"flex-1 truncate text-left\" title={labelTitle}>\n {children}\n </span>\n )}\n {!collapsed && trailing && <span className=\"ml-auto\">{trailing}</span>}\n </>\n );\n\n let element: ReactNode;\n if (asChild) {\n const { href: _href, type: _type, ...slotProps } = rest as Record<string, unknown>;\n element = (\n <Slot\n ref={ref}\n aria-current={active ? 'page' : undefined}\n className={classes}\n {...(slotProps as HTMLAttributes<HTMLElement>)}\n >\n {children && typeof children === 'object' && 'props' in (children as object)\n ? children\n : null}\n </Slot>\n );\n } else if (rest.href !== undefined) {\n const { href, ...anchorProps } = rest as Omit<\n SidebarItemAnchorProps,\n keyof SidebarItemBaseProps\n >;\n element = (\n <a\n ref={ref as Ref<HTMLAnchorElement>}\n href={href}\n aria-current={active ? 'page' : undefined}\n className={classes}\n {...anchorProps}\n >\n {content}\n </a>\n );\n } else {\n const {\n href: _href,\n type,\n ...buttonProps\n } = rest as Omit<SidebarItemButtonProps, keyof SidebarItemBaseProps>;\n element = (\n <button\n ref={ref as Ref<HTMLButtonElement>}\n type={type ?? 'button'}\n aria-current={active ? 'page' : undefined}\n className={classes}\n {...buttonProps}\n >\n {content}\n </button>\n );\n }\n\n return (\n <li className=\"px-2\">\n {showTooltip ? (\n <Tooltip label={tip} side=\"right\">\n {element}\n </Tooltip>\n ) : (\n element\n )}\n </li>\n );\n },\n);\nSidebarItem.displayName = 'SidebarItem';\n\n/** Lightweight collapsible sub-section inside the sidebar. */\nexport interface SidebarGroupProps extends Omit<HTMLAttributes<HTMLLIElement>, 'children'> {\n icon?: ReactNode;\n label: ReactNode;\n /** Initial open state (uncontrolled). */\n defaultOpen?: boolean;\n /** Controlled open state. */\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n children: ReactNode;\n}\n\nexport const SidebarGroup = forwardRef<HTMLLIElement, SidebarGroupProps>(function SidebarGroup(\n {\n icon,\n label,\n defaultOpen = true,\n open: controlled,\n onOpenChange,\n className,\n children,\n ...props\n },\n ref,\n) {\n const { collapsed } = useContext(SidebarContext);\n const [internal, setInternal] = useState(defaultOpen);\n const open = controlled ?? internal;\n const listId = useId();\n const toggle = () => {\n const next = !open;\n if (controlled === undefined) setInternal(next);\n onOpenChange?.(next);\n };\n if (collapsed) return <>{children}</>;\n return (\n <li ref={ref} className={className} {...props}>\n <button\n type=\"button\"\n onClick={toggle}\n aria-controls={open ? listId : undefined}\n aria-expanded={open}\n className={cn(\n 'text-foreground-muted mx-2 flex h-8 w-[calc(100%-1rem)] items-center gap-2 rounded-md px-2 text-sm outline-none',\n 'transition-colors duration-[var(--duration-fast)]',\n 'hover:bg-background-muted hover:text-foreground',\n 'focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2',\n )}\n >\n {icon && <span className=\"flex shrink-0 items-center [&_svg]:size-4\">{icon}</span>}\n <span className=\"flex-1 text-left\">{label}</span>\n <ChevronDown\n className={cn('size-3.5 transition-transform', open && 'rotate-180')}\n aria-hidden\n />\n </button>\n {open && (\n <ul id={listId} className=\"flex flex-col gap-px\">\n {children}\n </ul>\n )}\n </li>\n );\n});\nSidebarGroup.displayName = 'SidebarGroup';\n"],"names":["SidebarContext","createContext","useSidebar","useContext","Sidebar","forwardRef","defaultCollapsed","controlled","onCollapsedChange","header","footer","className","children","ariaLabel","props","ref","strings","useStrings","internal","setInternal","useState","collapsed","setCollapsed","next","jsxs","cn","jsx","ChevronsRight","ChevronsLeft","SidebarSection","label","labelId","useId","SidebarItem","icon","active","trailing","sub","tooltip","asChild","rest","classes","labelTitle","tip","showTooltip","content","Fragment","element","_href","_type","slotProps","Slot","href","anchorProps","type","buttonProps","Tooltip","SidebarGroup","defaultOpen","onOpenChange","open","listId","toggle","ChevronDown"],"mappings":";;;;;;;;AAuBA,MAAMA,IAAiBC,EAAmC,EAAE,WAAW,IAAO;AAIvE,SAASC,IAAkC;AAChD,SAAOC,EAAWH,CAAc;AAClC;AAmCO,MAAMI,IAAUC,EAAsC,SAC3D;AAAA,EACE,kBAAAC,IAAmB;AAAA,EACnB,WAAWC;AAAA,EACX,mBAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAcC;AAAA,EACd,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAUC,EAAA,GACV,CAACC,GAAUC,CAAW,IAAIC,EAASd,CAAgB,GACnDe,IAAYd,KAAcW,GAC1BI,IAAe,CAACC,MAAkB;AACtC,IAAIhB,MAAe,UAAWY,EAAY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G,iCAAiCmC,KAAQ,YAAY;AAAA,cACnE,eAAW;AAAA,YAAA;AAAA,UAAA;AAAA,QACb;AAAA,MAAA;AAAA,IAAA;AAAA,IAEDA,KACC,gBAAAlC,EAAC,MAAA,EAAG,IAAImC,GAAQ,WAAU,wBACvB,UAAAjD,EAAA,CACH;AAAA,EAAA,GAEJ;AAEJ,CAAC;AACD6C,EAAa,cAAc;"}
1
+ {"version":3,"file":"Sidebar.js","sources":["../../../src/components/ui/Sidebar.tsx"],"sourcesContent":["'use client';\n\nimport {\n createContext,\n forwardRef,\n useContext,\n useId,\n useState,\n type AnchorHTMLAttributes,\n type ButtonHTMLAttributes,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n} from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { ChevronDown, ChevronsLeft, ChevronsRight } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\nimport { Tooltip, TooltipProvider } from './Tooltip';\n\ninterface SidebarContextValue {\n collapsed: boolean;\n}\nconst SidebarContext = createContext<SidebarContextValue>({ collapsed: false });\n\n/** Read the parent Sidebar's collapsed state. Useful for brand/footer slots\n * that need to swap between full and compact rendering. */\nexport function useSidebar(): SidebarContextValue {\n return useContext(SidebarContext);\n}\n\nexport interface SidebarProps extends HTMLAttributes<HTMLElement> {\n /** Default state on first mount. Use `defaultCollapsed` for uncontrolled. */\n defaultCollapsed?: boolean;\n /** Controlled collapsed state. */\n collapsed?: boolean;\n /** Called when the user toggles via the rail or keyboard. */\n onCollapsedChange?: (next: boolean) => void;\n /** Header slot pinned to the top (brand, workspace switcher, etc.). */\n header?: ReactNode;\n /** Footer slot pinned to the bottom (user card, version, etc.). */\n footer?: ReactNode;\n}\n\n/**\n * App-level navigation rail. Holds `SidebarSection` → `SidebarItem` lists,\n * and optionally a `footer`. Supports collapse to icon-only on desktop.\n * Below `md` the rail is hidden — pair it with a Sheet / Drawer for mobile.\n *\n * @example\n * <Sidebar footer={<UserCard />}>\n * <SidebarSection label=\"Workspace\">\n * <SidebarItem icon={<Home />} active>Home</SidebarItem>\n * <SidebarItem icon={<Folder />}>Projects</SidebarItem>\n * </SidebarSection>\n * <SidebarSection label=\"Account\">\n * <SidebarItem icon={<Settings />}>Settings</SidebarItem>\n * </SidebarSection>\n * </Sidebar>\n *\n * @do Use 1–3 sections. More than that signals the IA needs restructuring.\n * @dont Hide critical navigation under the collapsed state — keep icons\n * always visible with tooltips.\n */\nexport const Sidebar = forwardRef<HTMLElement, SidebarProps>(function Sidebar(\n {\n defaultCollapsed = false,\n collapsed: controlled,\n onCollapsedChange,\n header,\n footer,\n className,\n children,\n 'aria-label': ariaLabel,\n ...props\n },\n ref,\n) {\n const strings = useStrings();\n const [internal, setInternal] = useState(defaultCollapsed);\n const collapsed = controlled ?? internal;\n const setCollapsed = (next: boolean) => {\n if (controlled === undefined) setInternal(next);\n onCollapsedChange?.(next);\n };\n\n return (\n <SidebarContext.Provider value={{ collapsed }}>\n <nav\n data-slot=\"sidebar\"\n ref={ref}\n aria-label={ariaLabel ?? strings.sidebar.label}\n className={cn(\n 'border-border bg-background-subtle sticky top-0 hidden h-dvh shrink-0 flex-col gap-2 border-r md:flex',\n // Deliberate motion exception: the rail's own width transitions (layout).\n // Only the rail and the main column it flanks move; no content inside reflows.\n 'transition-[width] duration-[var(--duration-base)] ease-[var(--ease-out)] motion-reduce:transition-none',\n collapsed ? 'w-14' : 'w-60',\n className,\n )}\n {...props}\n >\n {header && (\n <div\n className={cn(\n 'border-border flex h-14 shrink-0 items-center overflow-hidden border-b',\n collapsed ? 'justify-center px-2' : 'px-3',\n )}\n >\n {header}\n </div>\n )}\n <div className=\"flex-1 overflow-y-auto py-3\">{children}</div>\n {footer && <div className=\"border-border border-t p-2\">{footer}</div>}\n <button\n type=\"button\"\n onClick={() => setCollapsed(!collapsed)}\n aria-label={collapsed ? strings.sidebar.expand : strings.sidebar.collapse}\n aria-expanded={!collapsed}\n className={cn(\n 'text-foreground-subtle mx-2 mb-2 flex h-8 items-center gap-2 rounded-md px-2',\n 'hover:bg-background-muted hover:text-foreground outline-hidden',\n 'focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2',\n 'transition-colors duration-[var(--duration-fast)]',\n )}\n >\n {collapsed ? (\n <ChevronsRight className=\"size-4\" aria-hidden />\n ) : (\n <ChevronsLeft className=\"size-4\" aria-hidden />\n )}\n {!collapsed && (\n <span className=\"text-xs font-medium\">{strings.sidebar.collapseShort}</span>\n )}\n </button>\n </nav>\n </SidebarContext.Provider>\n );\n});\nSidebar.displayName = 'Sidebar';\n\nexport interface SidebarSectionProps extends HTMLAttributes<HTMLDivElement> {\n /** Visible section header. Hidden when collapsed. */\n label?: ReactNode;\n}\n\nexport function SidebarSection({ label, className, children, ...props }: SidebarSectionProps) {\n const { collapsed } = useContext(SidebarContext);\n const labelId = useId();\n return (\n <div className={cn('mb-3', className)} {...props}>\n {label && (\n // Kept in the DOM (sr-only) while collapsed so the list stays labelled.\n <div\n id={labelId}\n className={cn(\n 'text-foreground-subtle px-4 pt-2 pb-1 text-xs font-medium',\n collapsed && 'sr-only',\n )}\n >\n {label}\n </div>\n )}\n <ul aria-labelledby={label ? labelId : undefined} className=\"flex flex-col gap-px\">\n {children}\n </ul>\n </div>\n );\n}\nSidebarSection.displayName = 'SidebarSection';\n\ninterface SidebarItemBaseProps {\n /** Lucide icon shown to the left. */\n icon?: ReactNode;\n /** Mark as the current page. */\n active?: boolean;\n /** Trailing badge / counter slot. */\n trailing?: ReactNode;\n /** Render a sub-item indented under a parent. */\n sub?: boolean;\n /**\n * Tooltip text shown while the sidebar is collapsed. Defaults to `children`\n * when that is a plain string.\n */\n tooltip?: ReactNode;\n /**\n * Render the child element (router `<Link>`) instead of `<a>`/`<button>`.\n * The child receives className, aria-current and the item content.\n */\n asChild?: boolean;\n}\n\ntype SidebarItemAnchorProps = SidebarItemBaseProps &\n AnchorHTMLAttributes<HTMLAnchorElement> & {\n /** Renders an `<a>`. Omit to render a `<button>`. */\n href: string;\n };\n\ntype SidebarItemButtonProps = SidebarItemBaseProps &\n ButtonHTMLAttributes<HTMLButtonElement> & {\n href?: undefined;\n };\n\n/** Discriminated on `href`: with it the item is an anchor, without it a button. */\nexport type SidebarItemProps = SidebarItemAnchorProps | SidebarItemButtonProps;\n\nexport const SidebarItem = forwardRef<HTMLElement, SidebarItemProps>(\n function SidebarItem(props, ref) {\n const { icon, active, trailing, sub, tooltip, asChild, className, children, ...rest } = props;\n const { collapsed } = useContext(SidebarContext);\n\n const classes = cn(\n 'flex h-8 w-full items-center gap-2 rounded-md px-2 text-sm outline-hidden',\n 'transition-colors duration-[var(--duration-fast)]',\n 'focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n active\n ? 'bg-background-muted text-foreground font-medium'\n : 'text-foreground-muted hover:bg-background-muted hover:text-foreground',\n sub && !collapsed && 'ml-6',\n collapsed && 'justify-center',\n className,\n );\n\n const labelTitle = typeof children === 'string' ? children : undefined;\n const tip = tooltip ?? labelTitle;\n // Collapsed: keep an sr-only label so the control always has a name —\n // the Tooltip only wires aria-describedby while it is open.\n const showTooltip = collapsed && !!tip;\n\n const content = (\n <>\n {icon && <span className=\"flex shrink-0 items-center [&_svg]:size-4\">{icon}</span>}\n {collapsed ? (\n <span className=\"sr-only\">{children}</span>\n ) : (\n <span className=\"flex-1 truncate text-left\" title={labelTitle}>\n {children}\n </span>\n )}\n {!collapsed && trailing && <span className=\"ml-auto\">{trailing}</span>}\n </>\n );\n\n let element: ReactNode;\n if (asChild) {\n const { href: _href, type: _type, ...slotProps } = rest as Record<string, unknown>;\n element = (\n <Slot\n ref={ref}\n aria-current={active ? 'page' : undefined}\n className={classes}\n {...(slotProps as HTMLAttributes<HTMLElement>)}\n >\n {children && typeof children === 'object' && 'props' in (children as object)\n ? children\n : null}\n </Slot>\n );\n } else if (rest.href !== undefined) {\n const { href, ...anchorProps } = rest as Omit<\n SidebarItemAnchorProps,\n keyof SidebarItemBaseProps\n >;\n element = (\n <a\n ref={ref as Ref<HTMLAnchorElement>}\n href={href}\n aria-current={active ? 'page' : undefined}\n className={classes}\n {...anchorProps}\n >\n {content}\n </a>\n );\n } else {\n const {\n href: _href,\n type,\n ...buttonProps\n } = rest as Omit<SidebarItemButtonProps, keyof SidebarItemBaseProps>;\n element = (\n <button\n ref={ref as Ref<HTMLButtonElement>}\n type={type ?? 'button'}\n aria-current={active ? 'page' : undefined}\n className={classes}\n {...buttonProps}\n >\n {content}\n </button>\n );\n }\n\n return (\n <li className=\"px-2\">\n {showTooltip ? (\n // Own provider: a collapsed rail must not crash an app that never\n // mounted <TooltipProvider>; an outer provider still wins for delays.\n <TooltipProvider>\n <Tooltip label={tip} side=\"right\">\n {element}\n </Tooltip>\n </TooltipProvider>\n ) : (\n element\n )}\n </li>\n );\n },\n);\nSidebarItem.displayName = 'SidebarItem';\n\n/** Lightweight collapsible sub-section inside the sidebar. */\nexport interface SidebarGroupProps extends Omit<HTMLAttributes<HTMLLIElement>, 'children'> {\n icon?: ReactNode;\n label: ReactNode;\n /** Initial open state (uncontrolled). */\n defaultOpen?: boolean;\n /** Controlled open state. */\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n children: ReactNode;\n}\n\nexport const SidebarGroup = forwardRef<HTMLLIElement, SidebarGroupProps>(function SidebarGroup(\n {\n icon,\n label,\n defaultOpen = true,\n open: controlled,\n onOpenChange,\n className,\n children,\n ...props\n },\n ref,\n) {\n const { collapsed } = useContext(SidebarContext);\n const [internal, setInternal] = useState(defaultOpen);\n const open = controlled ?? internal;\n const listId = useId();\n const toggle = () => {\n const next = !open;\n if (controlled === undefined) setInternal(next);\n onOpenChange?.(next);\n };\n if (collapsed) return <>{children}</>;\n return (\n <li ref={ref} className={className} {...props}>\n <button\n type=\"button\"\n onClick={toggle}\n aria-controls={open ? listId : undefined}\n aria-expanded={open}\n className={cn(\n 'text-foreground-muted mx-2 flex h-8 w-[calc(100%-1rem)] items-center gap-2 rounded-md px-2 text-sm outline-hidden',\n 'transition-colors duration-[var(--duration-fast)]',\n 'hover:bg-background-muted hover:text-foreground',\n 'focus-visible:ring-ring focus-visible:ring-offset-background focus-visible:ring-2 focus-visible:ring-offset-2',\n )}\n >\n {icon && <span className=\"flex shrink-0 items-center [&_svg]:size-4\">{icon}</span>}\n <span className=\"flex-1 text-left\">{label}</span>\n <ChevronDown\n className={cn('size-3.5 transition-transform', open && 'rotate-180')}\n aria-hidden\n />\n </button>\n {open && (\n <ul id={listId} className=\"flex flex-col gap-px\">\n {children}\n </ul>\n )}\n </li>\n );\n});\nSidebarGroup.displayName = 'SidebarGroup';\n"],"names":["SidebarContext","createContext","useSidebar","useContext","Sidebar","forwardRef","defaultCollapsed","controlled","onCollapsedChange","header","footer","className","children","ariaLabel","props","ref","strings","useStrings","internal","setInternal","useState","collapsed","setCollapsed","next","jsxs","cn","jsx","ChevronsRight","ChevronsLeft","SidebarSection","label","labelId","useId","SidebarItem","icon","active","trailing","sub","tooltip","asChild","rest","classes","labelTitle","tip","showTooltip","content","Fragment","element","_href","_type","slotProps","Slot","href","anchorProps","type","buttonProps","TooltipProvider","Tooltip","SidebarGroup","defaultOpen","onOpenChange","open","listId","toggle","ChevronDown"],"mappings":";;;;;;;;AAuBA,MAAMA,IAAiBC,EAAmC,EAAE,WAAW,IAAO;AAIvE,SAASC,IAAkC;AAChD,SAAOC,EAAWH,CAAc;AAClC;AAmCO,MAAMI,IAAUC,EAAsC,SAC3D;AAAA,EACE,kBAAAC,IAAmB;AAAA,EACnB,WAAWC;AAAA,EACX,mBAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAcC;AAAA,EACd,GAAGC;AACL,GACAC,GACA;AACA,QAAMC,IAAUC,EAAA,GACV,CAACC,GAAUC,CAAW,IAAIC,EAASd,CAAgB,GACnDe,IAAYd,KAAcW,GAC1BI,IAAe,CAACC,MAAkB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AAU,oBAAoB,UAAAI,GAAM;AAAA,UAC1C,gBAAAJ;AAAA,YAACsC;AAAA,YAAA;AAAA,cACC,WAAWvC,EAAG,iCAAiCoC,KAAQ,YAAY;AAAA,cACnE,eAAW;AAAA,YAAA;AAAA,UAAA;AAAA,QACb;AAAA,MAAA;AAAA,IAAA;AAAA,IAEDA,KACC,gBAAAnC,EAAC,MAAA,EAAG,IAAIoC,GAAQ,WAAU,wBACvB,UAAAlD,EAAA,CACH;AAAA,EAAA,GAEJ;AAEJ,CAAC;AACD8C,EAAa,cAAc;"}
@@ -51,7 +51,7 @@ const z = k(
51
51
  "border-accent bg-card relative block size-4 rounded-full border-2 shadow-sm",
52
52
  // 44px touch target without growing the visible thumb.
53
53
  'before:absolute before:top-1/2 before:left-1/2 before:size-11 before:-translate-x-1/2 before:-translate-y-1/2 before:rounded-full before:content-[""]',
54
- "focus-visible:ring-ring focus-visible:ring-offset-background outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
54
+ "focus-visible:ring-ring focus-visible:ring-offset-background outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2",
55
55
  "transition-transform duration-[var(--duration-fast)] ease-[var(--ease-out)]",
56
56
  "hover:scale-110 data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
57
57
  ),
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.js","sources":["../../../src/components/ui/Slider.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n useId,\n useState,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type ReactNode,\n} from 'react';\nimport * as SliderPrimitive from '@radix-ui/react-slider';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\n\nexport interface SliderProps extends Omit<\n ComponentPropsWithoutRef<typeof SliderPrimitive.Root>,\n 'value' | 'defaultValue'\n> {\n /**\n * Controlled value. Pass `[n]` for a single-thumb slider, `[a, b]` for a range slider.\n */\n value?: number[];\n defaultValue?: number[];\n /** Inline label rendered above the slider. */\n label?: ReactNode;\n /** Show the numeric value next to the label. */\n showValue?: boolean;\n /** Format the displayed value (e.g. `(v) => \\`${v}%\\``). */\n formatValue?: (value: number) => string;\n}\n\n/**\n * Single- or range-thumb slider. Pass one item in `value` for a single\n * thumb, two for a range.\n *\n * @example Single value\n * <Slider label=\"Volume\" showValue defaultValue={[60]} max={100} step={1} />\n *\n * @example Price range\n * <Slider label=\"Price\"\n * defaultValue={[50, 250]}\n * min={0} max={500} step={10}\n * formatValue={(v) => \\`$\\${v}\\`}\n * showValue />\n *\n * @do Use `showValue` when the absolute number matters (price, volume, weight).\n * @dont Hide the value when users will need to reason about exact thresholds.\n */\nexport const Slider = forwardRef<ComponentRef<typeof SliderPrimitive.Root>, SliderProps>(\n function Slider(\n {\n className,\n label,\n showValue,\n formatValue = (v) => String(v),\n value,\n defaultValue,\n onValueChange,\n ...props\n },\n ref,\n ) {\n // Uncontrolled sliders track their own value so `showValue` stays live.\n const [internal, setInternal] = useState<number[]>(defaultValue ?? [0]);\n const isControlled = value !== undefined;\n const currentValue = isControlled ? value : internal;\n const isRange = currentValue.length > 1;\n const labelId = useId();\n const strings = useStrings();\n // Only a string label can double as aria-label; ReactNode labels are\n // referenced by id instead.\n const stringLabel = typeof label === 'string' ? label : undefined;\n const thumbLabel = (i: number) =>\n isRange\n ? i === 0\n ? strings.slider.minimum\n : strings.slider.maximum\n : (stringLabel ?? props['aria-label'] ?? strings.slider.value);\n\n return (\n <div className={cn('flex flex-col gap-2', className)}>\n {(label || showValue) && (\n <div className=\"flex items-center justify-between\">\n {label && (\n <span id={labelId} className=\"text-foreground text-sm font-medium\">\n {label}\n </span>\n )}\n {showValue && (\n <span className=\"tabular text-foreground-muted font-mono text-xs\">\n {isRange\n ? `${formatValue(currentValue[0])} – ${formatValue(currentValue[1])}`\n : formatValue(currentValue[0])}\n </span>\n )}\n </div>\n )}\n\n <SliderPrimitive.Root\n data-slot=\"slider\"\n ref={ref}\n value={value}\n defaultValue={defaultValue}\n onValueChange={(v) => {\n if (!isControlled) setInternal(v);\n onValueChange?.(v);\n }}\n className=\"relative flex w-full touch-none items-center py-3.5 select-none\"\n aria-labelledby={label && !stringLabel ? labelId : undefined}\n {...props}\n >\n <SliderPrimitive.Track\n data-slot=\"slider-track\"\n className=\"bg-background-muted relative h-1 w-full grow overflow-hidden rounded-full\"\n >\n <SliderPrimitive.Range className=\"bg-accent absolute h-full\" />\n </SliderPrimitive.Track>\n {currentValue.map((_, i) => (\n <SliderPrimitive.Thumb\n key={i}\n data-slot=\"slider-thumb\"\n className={cn(\n 'border-accent bg-card relative block size-4 rounded-full border-2 shadow-sm',\n // 44px touch target without growing the visible thumb.\n 'before:absolute before:top-1/2 before:left-1/2 before:size-11 before:-translate-x-1/2 before:-translate-y-1/2 before:rounded-full before:content-[\"\"]',\n 'focus-visible:ring-ring focus-visible:ring-offset-background outline-none focus-visible:ring-2 focus-visible:ring-offset-2',\n 'transition-transform duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'hover:scale-110 data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n )}\n aria-label={thumbLabel(i)}\n aria-labelledby={!isRange && label && !stringLabel ? labelId : undefined}\n />\n ))}\n </SliderPrimitive.Root>\n </div>\n );\n },\n);\n\nSlider.displayName = 'Slider';\n"],"names":["Slider","forwardRef","className","label","showValue","formatValue","v","value","defaultValue","onValueChange","props","ref","internal","setInternal","useState","isControlled","currentValue","isRange","labelId","useId","strings","useStrings","stringLabel","thumbLabel","i","cn","jsxs","SliderPrimitive","jsx","_"],"mappings":";;;;;;AAgDO,MAAMA,IAASC;AAAA,EACpB,SACE;AAAA,IACE,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC,IAAc,CAACC,MAAM,OAAOA,CAAC;AAAA,IAC7B,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,GACA;AAEA,UAAM,CAACC,GAAUC,CAAW,IAAIC,EAA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AA;AAAA,YAAA;AAAA,YAE9DX,EAAa,IAAI,CAACa,GAAGL,MACpB,gBAAAI;AAAA,cAACD,EAAgB;AAAA,cAAhB;AAAA,gBAEC,aAAU;AAAA,gBACV,WAAWF;AAAA,kBACT;AAAA;AAAA,kBAEA;AAAA,kBACA;AAAA,kBACA;AAAA,kBACA;AAAA,gBAAA;AAAA,gBAEF,cAAYF,EAAWC,CAAC;AAAA,gBACxB,mBAAiB,CAACP,KAAWd,KAAS,CAACmB,IAAcJ,IAAU;AAAA,cAAA;AAAA,cAX1DM;AAAA,YAAA,CAaR;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACH,GACF;AAAA,EAEJ;AACF;AAEAxB,EAAO,cAAc;"}
1
+ {"version":3,"file":"Slider.js","sources":["../../../src/components/ui/Slider.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n useId,\n useState,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type ReactNode,\n} from 'react';\nimport * as SliderPrimitive from '@radix-ui/react-slider';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\n\nexport interface SliderProps extends Omit<\n ComponentPropsWithoutRef<typeof SliderPrimitive.Root>,\n 'value' | 'defaultValue'\n> {\n /**\n * Controlled value. Pass `[n]` for a single-thumb slider, `[a, b]` for a range slider.\n */\n value?: number[];\n defaultValue?: number[];\n /** Inline label rendered above the slider. */\n label?: ReactNode;\n /** Show the numeric value next to the label. */\n showValue?: boolean;\n /** Format the displayed value (e.g. `(v) => \\`${v}%\\``). */\n formatValue?: (value: number) => string;\n}\n\n/**\n * Single- or range-thumb slider. Pass one item in `value` for a single\n * thumb, two for a range.\n *\n * @example Single value\n * <Slider label=\"Volume\" showValue defaultValue={[60]} max={100} step={1} />\n *\n * @example Price range\n * <Slider label=\"Price\"\n * defaultValue={[50, 250]}\n * min={0} max={500} step={10}\n * formatValue={(v) => \\`$\\${v}\\`}\n * showValue />\n *\n * @do Use `showValue` when the absolute number matters (price, volume, weight).\n * @dont Hide the value when users will need to reason about exact thresholds.\n */\nexport const Slider = forwardRef<ComponentRef<typeof SliderPrimitive.Root>, SliderProps>(\n function Slider(\n {\n className,\n label,\n showValue,\n formatValue = (v) => String(v),\n value,\n defaultValue,\n onValueChange,\n ...props\n },\n ref,\n ) {\n // Uncontrolled sliders track their own value so `showValue` stays live.\n const [internal, setInternal] = useState<number[]>(defaultValue ?? [0]);\n const isControlled = value !== undefined;\n const currentValue = isControlled ? value : internal;\n const isRange = currentValue.length > 1;\n const labelId = useId();\n const strings = useStrings();\n // Only a string label can double as aria-label; ReactNode labels are\n // referenced by id instead.\n const stringLabel = typeof label === 'string' ? label : undefined;\n const thumbLabel = (i: number) =>\n isRange\n ? i === 0\n ? strings.slider.minimum\n : strings.slider.maximum\n : (stringLabel ?? props['aria-label'] ?? strings.slider.value);\n\n return (\n <div className={cn('flex flex-col gap-2', className)}>\n {(label || showValue) && (\n <div className=\"flex items-center justify-between\">\n {label && (\n <span id={labelId} className=\"text-foreground text-sm font-medium\">\n {label}\n </span>\n )}\n {showValue && (\n <span className=\"tabular text-foreground-muted font-mono text-xs\">\n {isRange\n ? `${formatValue(currentValue[0])} – ${formatValue(currentValue[1])}`\n : formatValue(currentValue[0])}\n </span>\n )}\n </div>\n )}\n\n <SliderPrimitive.Root\n data-slot=\"slider\"\n ref={ref}\n value={value}\n defaultValue={defaultValue}\n onValueChange={(v) => {\n if (!isControlled) setInternal(v);\n onValueChange?.(v);\n }}\n className=\"relative flex w-full touch-none items-center py-3.5 select-none\"\n aria-labelledby={label && !stringLabel ? labelId : undefined}\n {...props}\n >\n <SliderPrimitive.Track\n data-slot=\"slider-track\"\n className=\"bg-background-muted relative h-1 w-full grow overflow-hidden rounded-full\"\n >\n <SliderPrimitive.Range className=\"bg-accent absolute h-full\" />\n </SliderPrimitive.Track>\n {currentValue.map((_, i) => (\n <SliderPrimitive.Thumb\n key={i}\n data-slot=\"slider-thumb\"\n className={cn(\n 'border-accent bg-card relative block size-4 rounded-full border-2 shadow-sm',\n // 44px touch target without growing the visible thumb.\n 'before:absolute before:top-1/2 before:left-1/2 before:size-11 before:-translate-x-1/2 before:-translate-y-1/2 before:rounded-full before:content-[\"\"]',\n 'focus-visible:ring-ring focus-visible:ring-offset-background outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2',\n 'transition-transform duration-[var(--duration-fast)] ease-[var(--ease-out)]',\n 'hover:scale-110 data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n )}\n aria-label={thumbLabel(i)}\n aria-labelledby={!isRange && label && !stringLabel ? labelId : undefined}\n />\n ))}\n </SliderPrimitive.Root>\n </div>\n );\n },\n);\n\nSlider.displayName = 'Slider';\n"],"names":["Slider","forwardRef","className","label","showValue","formatValue","v","value","defaultValue","onValueChange","props","ref","internal","setInternal","useState","isControlled","currentValue","isRange","labelId","useId","strings","useStrings","stringLabel","thumbLabel","i","cn","jsxs","SliderPrimitive","jsx","_"],"mappings":";;;;;;AAgDO,MAAMA,IAASC;AAAA,EACpB,SACE;AAAA,IACE,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,aAAAC,IAAc,CAACC,MAAM,OAAOA,CAAC;AAAA,IAC7B,OAAAC;AAAA,IACA,cAAAC;AAAA,IACA,eAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,GACA;AAEA,UAAM,CAACC,GAAUC,CAAW,IAAIC,EAAmBN,KAAgB,CAAC,CAAC,CAAC,GAChEO,IAAeR,MAAU,QACzBS,IAAeD,IAAeR,IAAQK,GACtCK,IAAUD,EAAa,SAAS,GAChCE,IAAUC,EAAA,GACVC,IAAUC,EAAA,GAGVC,IAAc,OAAOnB,KAAU,WAAWA,IAAQ,QAClDoB,IAAa,CAACC,MAClBP,IACIO,MAAM,IACJJ,EAAQ,OAAO,UACfA,EAAQ,OAAO,UAChBE,KAAeZ,EAAM,YAAY,KAAKU,EAAQ,OAAO;AAE5D,6BACG,OAAA,EAAI,WAAWK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AA,YAAA,CAaR;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IACH,GACF;AAAA,EAEJ;AACF;AAEAxB,EAAO,cAAc;"}
@@ -31,25 +31,34 @@ const w = N(
31
31
  danger: /* @__PURE__ */ e(g, { className: "text-danger-text mt-0.5 size-4 shrink-0", "aria-hidden": !0 })
32
32
  }, S = m(function({ className: o, variant: r = "default", title: t, action: d, onClose: a, icon: s, children: n, ...c }, l) {
33
33
  const u = v(), f = s === !1 ? null : s ?? z[r ?? "default"];
34
- return /* @__PURE__ */ i("div", { ref: l, role: "status", className: k(w({ variant: r }), o), ...c, children: [
35
- f,
36
- /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
37
- t && /* @__PURE__ */ e("p", { className: "font-medium", children: t }),
38
- n && /* @__PURE__ */ e("p", { className: "text-foreground-muted", children: n })
39
- ] }),
40
- d,
41
- a && /* @__PURE__ */ e(
42
- "button",
43
- {
44
- "data-slot": "snackbar",
45
- type: "button",
46
- onClick: a,
47
- "aria-label": u.snackbar.dismiss,
48
- className: "text-foreground-muted hover:bg-background-muted hover:text-foreground focus-visible:ring-ring focus-visible:ring-offset-card rounded p-1 outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
49
- children: /* @__PURE__ */ e(b, { className: "size-4", "aria-hidden": !0 })
50
- }
51
- )
52
- ] });
34
+ return /* @__PURE__ */ i(
35
+ "div",
36
+ {
37
+ "data-slot": "snackbar",
38
+ ref: l,
39
+ role: "status",
40
+ className: k(w({ variant: r }), o),
41
+ ...c,
42
+ children: [
43
+ f,
44
+ /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
45
+ t && /* @__PURE__ */ e("p", { className: "font-medium", children: t }),
46
+ n && /* @__PURE__ */ e("p", { className: "text-foreground-muted", children: n })
47
+ ] }),
48
+ d,
49
+ a && /* @__PURE__ */ e(
50
+ "button",
51
+ {
52
+ type: "button",
53
+ onClick: a,
54
+ "aria-label": u.snackbar.dismiss,
55
+ className: "text-foreground-muted hover:bg-background-muted hover:text-foreground focus-visible:ring-ring focus-visible:ring-offset-card rounded p-1 outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2",
56
+ children: /* @__PURE__ */ e(b, { className: "size-4", "aria-hidden": !0 })
57
+ }
58
+ )
59
+ ]
60
+ }
61
+ );
53
62
  });
54
63
  S.displayName = "Snackbar";
55
64
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Snackbar.js","sources":["../../../src/components/ui/Snackbar.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { CheckCircle2, Info, AlertTriangle, XCircle, X } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\nimport { cva, type VariantProps } from '@/lib/cva';\n\nconst snackbar = cva(\n [\n 'relative pointer-events-auto w-full max-w-md',\n 'flex items-start gap-3 rounded-md border bg-card p-3 shadow-md',\n 'text-sm text-foreground',\n ],\n {\n variants: {\n variant: {\n default: 'border-border',\n info: 'border-info-border-soft',\n success: 'border-success-border-soft',\n warning: 'border-warning-border-soft',\n danger: 'border-danger-border-soft',\n },\n },\n defaultVariants: { variant: 'default' },\n },\n);\n\nconst iconForVariant: Record<NonNullable<VariantProps<typeof snackbar>['variant']>, ReactNode> = {\n default: null,\n info: <Info className=\"text-info-text mt-0.5 size-4 shrink-0\" aria-hidden />,\n success: <CheckCircle2 className=\"text-success-text mt-0.5 size-4 shrink-0\" aria-hidden />,\n warning: <AlertTriangle className=\"text-warning-text mt-0.5 size-4 shrink-0\" aria-hidden />,\n danger: <XCircle className=\"text-danger-text mt-0.5 size-4 shrink-0\" aria-hidden />,\n};\n\nexport interface SnackbarProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>, VariantProps<typeof snackbar> {\n /** Headline. */\n title?: ReactNode;\n /** Action button rendered on the right. */\n action?: ReactNode;\n /** Show a close (×) button on the right. */\n onClose?: () => void;\n /** Override the variant's default icon. Pass `false` to hide. */\n icon?: ReactNode | false;\n}\n\n/**\n * Persistent inline notification. Unlike Toast, Snackbar does **not** auto-\n * dismiss. Pair with an `action` button or an `onClose` handler.\n */\nexport const Snackbar = forwardRef<HTMLDivElement, SnackbarProps>(function Snackbar(\n { className, variant = 'default', title, action, onClose, icon, children, ...props },\n ref,\n) {\n const strings = useStrings();\n const renderedIcon = icon === false ? null : (icon ?? iconForVariant[variant ?? 'default']);\n\n return (\n <div ref={ref} role=\"status\" className={cn(snackbar({ variant }), className)} {...props}>\n {renderedIcon}\n <div className=\"min-w-0 flex-1\">\n {title && <p className=\"font-medium\">{title}</p>}\n {children && <p className=\"text-foreground-muted\">{children}</p>}\n </div>\n {action}\n {onClose && (\n <button\n data-slot=\"snackbar\"\n type=\"button\"\n onClick={onClose}\n aria-label={strings.snackbar.dismiss}\n className=\"text-foreground-muted hover:bg-background-muted hover:text-foreground focus-visible:ring-ring focus-visible:ring-offset-card rounded p-1 outline-none focus-visible:ring-2 focus-visible:ring-offset-2\"\n >\n <X className=\"size-4\" aria-hidden />\n </button>\n )}\n </div>\n );\n});\nSnackbar.displayName = 'Snackbar';\n"],"names":["snackbar","cva","iconForVariant","jsx","Info","CheckCircle2","AlertTriangle","XCircle","Snackbar","forwardRef","className","variant","title","action","onClose","icon","children","props","ref","strings","useStrings","renderedIcon","jsxs","cn","X"],"mappings":";;;;;;;AAQA,MAAMA,IAAWC;AAAA,EACf;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,MAAM;AAAA,QACN,SAAS;AAAA,QACT,SAAS;AAAA,QACT,QAAQ;AAAA,MAAA;AAAA,IACV;AAAA,IAEF,iBAAiB,EAAE,SAAS,UAAA;AAAA,EAAU;AAE1C,GAEMC,IAA2F;AAAA,EAC/F,SAAS;AAAA,EACT,MAAM,gBAAAC,EAACC,GAAA,EAAK,WAAU,yCAAwC,eAAW,IAAC;AA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"],"sourcesContent":["'use client';\n\nimport { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\nimport { CheckCircle2, Info, AlertTriangle, XCircle, X } from '@/icons';\nimport { cn } from '@/lib/utils';\nimport { useStrings } from '@/hooks/use-strings';\nimport { cva, type VariantProps } from '@/lib/cva';\n\nconst snackbar = cva(\n [\n 'relative pointer-events-auto w-full max-w-md',\n 'flex items-start gap-3 rounded-md border bg-card p-3 shadow-md',\n 'text-sm text-foreground',\n ],\n {\n variants: {\n variant: {\n default: 'border-border',\n info: 'border-info-border-soft',\n success: 'border-success-border-soft',\n warning: 'border-warning-border-soft',\n danger: 'border-danger-border-soft',\n },\n },\n defaultVariants: { variant: 'default' },\n },\n);\n\nconst iconForVariant: Record<NonNullable<VariantProps<typeof snackbar>['variant']>, ReactNode> = {\n default: null,\n info: <Info className=\"text-info-text mt-0.5 size-4 shrink-0\" aria-hidden />,\n success: <CheckCircle2 className=\"text-success-text mt-0.5 size-4 shrink-0\" aria-hidden />,\n warning: <AlertTriangle className=\"text-warning-text mt-0.5 size-4 shrink-0\" aria-hidden />,\n danger: <XCircle className=\"text-danger-text mt-0.5 size-4 shrink-0\" aria-hidden />,\n};\n\nexport interface SnackbarProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>, VariantProps<typeof snackbar> {\n /** Headline. */\n title?: ReactNode;\n /** Action button rendered on the right. */\n action?: ReactNode;\n /** Show a close (×) button on the right. */\n onClose?: () => void;\n /** Override the variant's default icon. Pass `false` to hide. */\n icon?: ReactNode | false;\n}\n\n/**\n * Persistent inline notification. Unlike Toast, Snackbar does **not** auto-\n * dismiss. Pair with an `action` button or an `onClose` handler.\n */\nexport const Snackbar = forwardRef<HTMLDivElement, SnackbarProps>(function Snackbar(\n { className, variant = 'default', title, action, onClose, icon, children, ...props },\n ref,\n) {\n const strings = useStrings();\n const renderedIcon = icon === false ? null : (icon ?? iconForVariant[variant ?? 'default']);\n\n return (\n <div\n data-slot=\"snackbar\"\n ref={ref}\n role=\"status\"\n className={cn(snackbar({ variant }), className)}\n {...props}\n >\n {renderedIcon}\n <div className=\"min-w-0 flex-1\">\n {title && <p className=\"font-medium\">{title}</p>}\n {children && <p className=\"text-foreground-muted\">{children}</p>}\n </div>\n {action}\n {onClose && (\n <button\n type=\"button\"\n onClick={onClose}\n aria-label={strings.snackbar.dismiss}\n className=\"text-foreground-muted hover:bg-background-muted hover:text-foreground focus-visible:ring-ring focus-visible:ring-offset-card rounded p-1 outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2\"\n >\n <X className=\"size-4\" aria-hidden />\n </button>\n )}\n </div>\n );\n});\nSnackbar.displayName = 'Snackbar';\n"],"names":["snackbar","cva","iconForVariant","jsx","Info","CheckCircle2","AlertTriangle","XCircle","Snackbar","forwardRef","className","variant","title","action","onClose","icon","children","props","ref","strings","useStrings","renderedIcon","jsxs","cn","X"],"mappings":";;;;;;;AAQA,MAAMA,IAAWC;AAAA,EACf;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,MAAM;AAAA,QACN,SAAS;AAAA,QACT,SAAS;AAAA,QACT,QAAQ;AAAA,MAAA;AAAA,IACV;AAAA,IAEF,iBAAiB,EAAE,SAAS,UAAA;AAAA,EAAU;AAE1C,GAEMC,IAA2F;AAAA,EAC/F,SAAS;AAAA,EACT,MAAM,gBAAAC,EAACC,GAAA,EAAK,WAAU,yCAAwC,eAAW,IAAC;AAAA,EAC1E,SAAS,gBAAAD,EAACE,GAAA,EAAa,WAAU,4CAA2C,eAAW,IAAC;AAAA,EACxF,SAAS,gBAAAF,EAACG,GAAA,EAAc,WAAU,4CAA2C,eAAW,IAAC;AAAA,EACzF,QAAQ,gBAAAH,EAACI,GAAA,EAAQ,WAAU,2CAA0C,eAAW,GAAA,CAAC;AACnF,GAkBaC,IAAWC,EAA0C,SAChE,EAAE,WAAAC,GAAW,SAAAC,IAAU,WAAW,OAAAC,GAAO,QAAAC,GAAQ,SAAAC,GAAS,MAAAC,GAAM,UAAAC,GAAU,GAAGC,EAAA,GAC7EC,GACA;AACA,QAAMC,IAAUC,EAAA,GACVC,IAAeN,MAAS,KAAQ,OAAQA,KAAQb,EAAeS,KAAW,SAAS;AAEzF,SACE,gBAAAW;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,KAAAJ;AAAA,MACA,MAAK;AAAA,MACL,WAAWK,EAAGvB,EAAS,EAAE,SAAAW,EAAA,CAAS,GAAGD,CAAS;AAAA,MAC7C,GAAGO;AAAA,MAEH,UAAA;AAAA,QAAAI;AAAA,QACD,gBAAAC,EAAC,OAAA,EAAI,WAAU,kBACZ,UAAA;AAAA,UAAAV,KAAS,gBAAAT,EAAC,KAAA,EAAE,WAAU,eAAe,UAAAS,GAAM;AAAA,UAC3CI,KAAY,gBAAAb,EAAC,KAAA,EAAE,WAAU,yBAAyB,UAAAa,EAAA,CAAS;AAAA,QAAA,GAC9D;AAAA,QACCH;AAAA,QACAC,KACC,gBAAAX;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,SAASW;AAAA,YACT,cAAYK,EAAQ,SAAS;AAAA,YAC7B,WAAU;AAAA,YAEV,UAAA,gBAAAhB,EAACqB,GAAA,EAAE,WAAU,UAAS,eAAW,GAAA,CAAC;AAAA,UAAA;AAAA,QAAA;AAAA,MACpC;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;AACDhB,EAAS,cAAc;"}
@@ -12,7 +12,7 @@ const N = {
12
12
  }, I = k(
13
13
  function({
14
14
  className: b,
15
- label: a,
15
+ label: o,
16
16
  description: r,
17
17
  labelPosition: s = "after",
18
18
  size: i = "md",
@@ -22,18 +22,18 @@ const N = {
22
22
  "aria-describedby": h,
23
23
  ...v
24
24
  }, x) {
25
- const g = y(), o = m ?? g, c = r ? `${o}-desc` : void 0, w = [c, h].filter(Boolean).join(" ") || void 0, p = /* @__PURE__ */ e(
25
+ const g = y(), a = m ?? g, c = r ? `${a}-desc` : void 0, w = [c, h].filter(Boolean).join(" ") || void 0, p = /* @__PURE__ */ e(
26
26
  f.Root,
27
27
  {
28
28
  "data-slot": "switch",
29
29
  ref: x,
30
- id: o,
30
+ id: a,
31
31
  disabled: n,
32
32
  "aria-describedby": w,
33
33
  className: t(
34
34
  "peer relative inline-flex shrink-0 items-center rounded-full border-2 border-transparent",
35
35
  "transition-colors duration-[var(--duration-base)] ease-[var(--ease-out)]",
36
- "focus-visible:ring-ring focus-visible:ring-offset-background outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
36
+ "focus-visible:ring-ring focus-visible:ring-offset-background outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2",
37
37
  "disabled:cursor-not-allowed disabled:opacity-50",
38
38
  "data-[state=checked]:bg-accent data-[state=unchecked]:bg-switch-track-off",
39
39
  "aria-invalid:ring-danger aria-invalid:ring-2",
@@ -52,17 +52,17 @@ const N = {
52
52
  }
53
53
  )
54
54
  }
55
- ), d = a && /* @__PURE__ */ l("div", { className: "flex flex-col gap-0.5 select-none", children: [
55
+ ), d = o && /* @__PURE__ */ l("div", { className: "flex flex-col gap-0.5 select-none", children: [
56
56
  /* @__PURE__ */ e(
57
57
  "label",
58
58
  {
59
- htmlFor: o,
59
+ htmlFor: a,
60
60
  className: t(
61
61
  "text-foreground text-sm",
62
62
  n && "cursor-not-allowed opacity-50",
63
63
  u && "sr-only"
64
64
  ),
65
- children: a
65
+ children: o
66
66
  }
67
67
  ),
68
68
  r && /* @__PURE__ */ e("p", { id: c, className: "text-foreground-subtle text-xs", children: r })
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","sources":["../../../src/components/ui/Switch.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n useId,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type ReactNode,\n} from 'react';\nimport * as SwitchPrimitive from '@radix-ui/react-switch';\nimport { cn } from '@/lib/utils';\n\nexport interface SwitchProps extends Omit<\n ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>,\n 'asChild'\n> {\n /** Inline label rendered to the right. */\n label?: ReactNode;\n /** Secondary description rendered below the label. */\n description?: ReactNode;\n /** Position the label before the switch instead of after. */\n labelPosition?: 'before' | 'after';\n /** Visual size. */\n size?: 'sm' | 'md';\n /** Hide the label visually while keeping it accessible. */\n hideLabel?: boolean;\n}\n\n// Tracks are 28×16 (`sm`) / 36×20 (`md`) visually; the `before:` halo lifts\n// the hit area to ≥24px tall without changing the drawing (WCAG 2.5.8).\nconst trackSize = {\n sm: 'h-4 w-7 before:absolute before:-inset-x-1 before:-inset-y-1.5 before:content-[\"\"]',\n md: 'h-5 w-9 before:absolute before:-inset-x-1 before:-inset-y-1 before:content-[\"\"]',\n} as const;\nconst thumbSize = {\n sm: 'size-3 data-[state=checked]:translate-x-3',\n md: 'size-4 data-[state=checked]:translate-x-4',\n} as const;\n\n/**\n * Binary on/off toggle for instant-apply settings. Use Checkbox when the\n * choice is part of a form that needs explicit submission.\n *\n * @example Instant toggle\n * <Switch label=\"Email digest\" checked={on} onCheckedChange={setOn} />\n *\n * @example With description\n * <Switch label=\"Two-factor authentication\"\n * description=\"Required for admins on production accounts.\"\n * checked={tfa}\n * onCheckedChange={setTfa} />\n *\n * @do Use Switch when the change takes effect immediately. Pair with\n * a toast confirming the new state.\n * @dont Use Switch inside a form that requires submission — Checkbox\n * better matches that mental model.\n */\nexport const Switch = forwardRef<ComponentRef<typeof SwitchPrimitive.Root>, SwitchProps>(\n function Switch(\n {\n className,\n label,\n description,\n labelPosition = 'after',\n size = 'md',\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 const control = (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n ref={ref}\n id={fieldId}\n disabled={disabled}\n aria-describedby={describedBy}\n className={cn(\n 'peer relative inline-flex shrink-0 items-center rounded-full border-2 border-transparent',\n 'transition-colors duration-[var(--duration-base)] 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 'disabled:cursor-not-allowed disabled:opacity-50',\n 'data-[state=checked]:bg-accent data-[state=unchecked]:bg-switch-track-off',\n 'aria-invalid:ring-danger aria-invalid:ring-2',\n trackSize[size],\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n className={cn(\n 'bg-switch-thumb pointer-events-none block rounded-full shadow-sm',\n 'transition-transform duration-[var(--duration-base)] ease-[var(--ease-out)]',\n 'translate-x-0',\n thumbSize[size],\n )}\n />\n </SwitchPrimitive.Root>\n );\n\n const labelBlock = label && (\n <div className=\"flex flex-col gap-0.5 select-none\">\n <label\n htmlFor={fieldId}\n className={cn(\n 'text-foreground text-sm',\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\n return (\n <div className={cn('inline-flex items-center gap-2.5', className)}>\n {labelPosition === 'before' && labelBlock}\n {control}\n {labelPosition === 'after' && labelBlock}\n </div>\n );\n },\n);\n\nSwitch.displayName = 'Switch';\n"],"names":["trackSize","thumbSize","Switch","forwardRef","className","label","description","labelPosition","size","hideLabel","id","disabled","ariaDescribedby","props","ref","autoId","useId","fieldId","descId","describedBy","control","jsx","SwitchPrimitive","cn","labelBlock","jsxs"],"mappings":";;;;;AA8BA,MAAMA,IAAY;AAAA,EAChB,IAAI;AAAA,EACJ,IAAI;AACN,GACMC,IAAY;AAAA,EAChB,IAAI;AAAA,EACJ,IAAI;AACN,GAoBaC,IAASC;AAAA,EACpB,SACE;AAAA,IACE,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAA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,GAC7D,UAAA;AAAA,MAAAG,MAAkB,YAAYiB;AAAA,MAC9BJ;AAAA,MACAb,MAAkB,WAAWiB;AAAA,IAAA,GAChC;AAAA,EAEJ;AACF;AAEAtB,EAAO,cAAc;"}
1
+ {"version":3,"file":"Switch.js","sources":["../../../src/components/ui/Switch.tsx"],"sourcesContent":["'use client';\n\nimport {\n forwardRef,\n useId,\n type ComponentPropsWithoutRef,\n type ComponentRef,\n type ReactNode,\n} from 'react';\nimport * as SwitchPrimitive from '@radix-ui/react-switch';\nimport { cn } from '@/lib/utils';\n\nexport interface SwitchProps extends Omit<\n ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>,\n 'asChild'\n> {\n /** Inline label rendered to the right. */\n label?: ReactNode;\n /** Secondary description rendered below the label. */\n description?: ReactNode;\n /** Position the label before the switch instead of after. */\n labelPosition?: 'before' | 'after';\n /** Visual size. */\n size?: 'sm' | 'md';\n /** Hide the label visually while keeping it accessible. */\n hideLabel?: boolean;\n}\n\n// Tracks are 28×16 (`sm`) / 36×20 (`md`) visually; the `before:` halo lifts\n// the hit area to ≥24px tall without changing the drawing (WCAG 2.5.8).\nconst trackSize = {\n sm: 'h-4 w-7 before:absolute before:-inset-x-1 before:-inset-y-1.5 before:content-[\"\"]',\n md: 'h-5 w-9 before:absolute before:-inset-x-1 before:-inset-y-1 before:content-[\"\"]',\n} as const;\nconst thumbSize = {\n sm: 'size-3 data-[state=checked]:translate-x-3',\n md: 'size-4 data-[state=checked]:translate-x-4',\n} as const;\n\n/**\n * Binary on/off toggle for instant-apply settings. Use Checkbox when the\n * choice is part of a form that needs explicit submission.\n *\n * @example Instant toggle\n * <Switch label=\"Email digest\" checked={on} onCheckedChange={setOn} />\n *\n * @example With description\n * <Switch label=\"Two-factor authentication\"\n * description=\"Required for admins on production accounts.\"\n * checked={tfa}\n * onCheckedChange={setTfa} />\n *\n * @do Use Switch when the change takes effect immediately. Pair with\n * a toast confirming the new state.\n * @dont Use Switch inside a form that requires submission — Checkbox\n * better matches that mental model.\n */\nexport const Switch = forwardRef<ComponentRef<typeof SwitchPrimitive.Root>, SwitchProps>(\n function Switch(\n {\n className,\n label,\n description,\n labelPosition = 'after',\n size = 'md',\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 const control = (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n ref={ref}\n id={fieldId}\n disabled={disabled}\n aria-describedby={describedBy}\n className={cn(\n 'peer relative inline-flex shrink-0 items-center rounded-full border-2 border-transparent',\n 'transition-colors duration-[var(--duration-base)] 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 'disabled:cursor-not-allowed disabled:opacity-50',\n 'data-[state=checked]:bg-accent data-[state=unchecked]:bg-switch-track-off',\n 'aria-invalid:ring-danger aria-invalid:ring-2',\n trackSize[size],\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n className={cn(\n 'bg-switch-thumb pointer-events-none block rounded-full shadow-sm',\n 'transition-transform duration-[var(--duration-base)] ease-[var(--ease-out)]',\n 'translate-x-0',\n thumbSize[size],\n )}\n />\n </SwitchPrimitive.Root>\n );\n\n const labelBlock = label && (\n <div className=\"flex flex-col gap-0.5 select-none\">\n <label\n htmlFor={fieldId}\n className={cn(\n 'text-foreground text-sm',\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\n return (\n <div className={cn('inline-flex items-center gap-2.5', className)}>\n {labelPosition === 'before' && labelBlock}\n {control}\n {labelPosition === 'after' && labelBlock}\n </div>\n );\n },\n);\n\nSwitch.displayName = 'Switch';\n"],"names":["trackSize","thumbSize","Switch","forwardRef","className","label","description","labelPosition","size","hideLabel","id","disabled","ariaDescribedby","props","ref","autoId","useId","fieldId","descId","describedBy","control","jsx","SwitchPrimitive","cn","labelBlock","jsxs"],"mappings":";;;;;AA8BA,MAAMA,IAAY;AAAA,EAChB,IAAI;AAAA,EACJ,IAAI;AACN,GACMC,IAAY;AAAA,EAChB,IAAI;AAAA,EACJ,IAAI;AACN,GAoBaC,IAASC;AAAA,EACpB,SACE;AAAA,IACE,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,aAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,MAAAC,IAAO;AAAA,IACP,WAAAC;AAAA,IACA,IAAAC;AAAA,IACA,UAAAC;AAAA,IACA,oBAAoBC;AAAA,IACpB,GAAGC;AAAA,EAAA,GAELC,GACA;AACA,UAAMC,IAASC,EAAA,GACTC,IAAUP,KAAMK,GAChBG,IAASZ,IAAc,GAAGW,CAAO,UAAU,QAC3CE,IAAc,CAACD,GAAQN,CAAe,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,KAAK,QAErEQ,IACJ,gBAAAC;AAAA,MAACC,EAAgB;AAAA,MAAhB;AAAA,QACC,aAAU;AAAA,QACV,KAAAR;AAAA,QACA,IAAIG;AAAA,QACJ,UAAAN;AAAA,QACA,oBAAkBQ;AAAA,QAClB,WAAWI;AAAA,UACT;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACAvB,EAAUQ,CAAI;AAAA,QAAA;AAAA,QAEf,GAAGK;AAAA,QAEJ,UAAA,gBAAAQ;AAAA,UAACC,EAAgB;AAAA,UAAhB;AAAA,YACC,WAAWC;AAAA,cACT;AAAA,cACA;AAAA,cACA;AAAA,cACAtB,EAAUO,CAAI;AAAA,YAAA;AAAA,UAChB;AAAA,QAAA;AAAA,MACF;AAAA,IAAA,GAIEgB,IAAanB,KACjB,gBAAAoB,EAAC,OAAA,EAAI,WAAU,qCACb,UAAA;AAAA,MAAA,gBAAAJ;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAASJ;AAAA,UACT,WAAWM;AAAA,YACT;AAAA,YACAZ,KAAY;AAAA,YACZF,KAAa;AAAA,UAAA;AAAA,UAGd,UAAAJ;AAAA,QAAA;AAAA,MAAA;AAAA,MAEFC,KACC,gBAAAe,EAAC,KAAA,EAAE,IAAIH,GAAQ,WAAU,kCACtB,UAAAZ,EAAA,CACH;AAAA,IAAA,GAEJ;AAGF,6BACG,OAAA,EAAI,WAAWiB,EAAG,oCAAoCnB,CAAS,GAC7D,UAAA;AAAA,MAAAG,MAAkB,YAAYiB;AAAA,MAC9BJ;AAAA,MACAb,MAAkB,WAAWiB;AAAA,IAAA,GAChC;AAAA,EAEJ;AACF;AAEAtB,EAAO,cAAc;"}
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { jsx as o, jsxs as T } from "react/jsx-runtime";
3
3
  import { forwardRef as l } from "react";
4
- import { ArrowUp as v, ArrowDown as x, ArrowUpDown as N } from "../../icons/index.js";
4
+ import { ArrowUp as v, ArrowDown as x, ArrowUpDown as h } from "../../icons/index.js";
5
5
  import { cn as s } from "../../lib/utils.js";
6
- import { useStrings as h } from "../../hooks/use-strings.js";
6
+ import { useStrings as N } from "../../hooks/use-strings.js";
7
7
  const y = l(function({ className: t, containerClassName: e, maxHeight: a, scrollLabel: r, ...n }, d) {
8
- const u = h();
8
+ const u = N();
9
9
  return (
10
10
  // Whether the wrapper actually overflows is not knowable statically, so it
11
11
  // is always a tab stop (WCAG 2.1.1 / axe scrollable-region-focusable).
@@ -18,7 +18,7 @@ const y = l(function({ className: t, containerClassName: e, maxHeight: a, scroll
18
18
  tabIndex: 0,
19
19
  className: s(
20
20
  "relative isolate w-full overflow-auto",
21
- "focus-visible:ring-ring focus-visible:ring-offset-background outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
21
+ "focus-visible:ring-ring focus-visible:ring-offset-background outline-hidden focus-visible:ring-2 focus-visible:ring-offset-2",
22
22
  e
23
23
  ),
24
24
  style: a !== void 0 ? { maxHeight: a } : void 0,
@@ -148,7 +148,7 @@ const j = l(
148
148
  type: "button",
149
149
  onClick: p,
150
150
  className: s(
151
- "inline-flex h-10 w-full items-center gap-1.5 px-3 outline-none",
151
+ "inline-flex h-10 w-full items-center gap-1.5 px-3 outline-hidden",
152
152
  d === "right" && "flex-row-reverse",
153
153
  d === "center" && "justify-center",
154
154
  "transition-colors duration-[var(--duration-fast)]",
@@ -158,7 +158,7 @@ const j = l(
158
158
  ),
159
159
  children: [
160
160
  r,
161
- b === "asc" ? /* @__PURE__ */ o(v, { className: "size-3.5", "aria-hidden": !0 }) : b === "desc" ? /* @__PURE__ */ o(x, { className: "size-3.5", "aria-hidden": !0 }) : /* @__PURE__ */ o(N, { className: "size-3.5 opacity-40", "aria-hidden": !0 })
161
+ b === "asc" ? /* @__PURE__ */ o(v, { className: "size-3.5", "aria-hidden": !0 }) : b === "desc" ? /* @__PURE__ */ o(x, { className: "size-3.5", "aria-hidden": !0 }) : /* @__PURE__ */ o(h, { className: "size-3.5 opacity-40", "aria-hidden": !0 })
162
162
  ]
163
163
  }
164
164
  )