@7onic-ui/react 0.3.8 → 0.3.10

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 (171) hide show
  1. package/README.md +2 -2
  2. package/dist/chart.js +1 -1
  3. package/dist/chart.js.map +1 -1
  4. package/dist/chart.mjs +4 -10
  5. package/dist/chart.mjs.map +1 -1
  6. package/dist/chunk-234NAXGV.mjs +252 -0
  7. package/dist/chunk-234NAXGV.mjs.map +1 -0
  8. package/dist/chunk-53MIUPSY.mjs +13 -0
  9. package/dist/chunk-53MIUPSY.mjs.map +1 -0
  10. package/dist/chunk-BN5BEA3V.mjs +195 -0
  11. package/dist/chunk-BN5BEA3V.mjs.map +1 -0
  12. package/dist/chunk-COW3B62M.mjs +214 -0
  13. package/dist/chunk-COW3B62M.mjs.map +1 -0
  14. package/dist/chunk-CTH6SN5Y.mjs +114 -0
  15. package/dist/chunk-CTH6SN5Y.mjs.map +1 -0
  16. package/dist/chunk-D3NTQNDW.mjs +440 -0
  17. package/dist/chunk-D3NTQNDW.mjs.map +1 -0
  18. package/dist/chunk-DDRYEJBJ.mjs +164 -0
  19. package/dist/chunk-DDRYEJBJ.mjs.map +1 -0
  20. package/dist/chunk-DJAEXCRU.mjs +190 -0
  21. package/dist/chunk-DJAEXCRU.mjs.map +1 -0
  22. package/dist/chunk-DRVHHEAY.mjs +145 -0
  23. package/dist/chunk-DRVHHEAY.mjs.map +1 -0
  24. package/dist/chunk-DTLNWOTR.mjs +482 -0
  25. package/dist/chunk-DTLNWOTR.mjs.map +1 -0
  26. package/dist/chunk-DYYQOHQR.mjs +214 -0
  27. package/dist/chunk-DYYQOHQR.mjs.map +1 -0
  28. package/dist/chunk-FHUAH6AJ.mjs +93 -0
  29. package/dist/chunk-FHUAH6AJ.mjs.map +1 -0
  30. package/dist/chunk-GD4YE5AE.mjs +209 -0
  31. package/dist/chunk-GD4YE5AE.mjs.map +1 -0
  32. package/dist/chunk-GRCJ35DX.mjs +144 -0
  33. package/dist/chunk-GRCJ35DX.mjs.map +1 -0
  34. package/dist/chunk-HHX4GABH.mjs +129 -0
  35. package/dist/chunk-HHX4GABH.mjs.map +1 -0
  36. package/dist/chunk-IPCIC2BI.mjs +148 -0
  37. package/dist/chunk-IPCIC2BI.mjs.map +1 -0
  38. package/dist/chunk-IY3R2VGB.mjs +272 -0
  39. package/dist/chunk-IY3R2VGB.mjs.map +1 -0
  40. package/dist/chunk-JCJEVXER.mjs +170 -0
  41. package/dist/chunk-JCJEVXER.mjs.map +1 -0
  42. package/dist/chunk-KBPYAMGS.mjs +157 -0
  43. package/dist/chunk-KBPYAMGS.mjs.map +1 -0
  44. package/dist/chunk-LJJ6K4IU.mjs +318 -0
  45. package/dist/chunk-LJJ6K4IU.mjs.map +1 -0
  46. package/dist/chunk-MRUVGHGP.mjs +375 -0
  47. package/dist/chunk-MRUVGHGP.mjs.map +1 -0
  48. package/dist/chunk-N4K2BDGM.mjs +153 -0
  49. package/dist/chunk-N4K2BDGM.mjs.map +1 -0
  50. package/dist/chunk-NWFMJWGX.mjs +165 -0
  51. package/dist/chunk-NWFMJWGX.mjs.map +1 -0
  52. package/dist/chunk-PTAPPOKU.mjs +117 -0
  53. package/dist/chunk-PTAPPOKU.mjs.map +1 -0
  54. package/dist/chunk-PVTBM7V7.mjs +316 -0
  55. package/dist/chunk-PVTBM7V7.mjs.map +1 -0
  56. package/dist/chunk-Q5WVLK2L.mjs +77 -0
  57. package/dist/chunk-Q5WVLK2L.mjs.map +1 -0
  58. package/dist/chunk-RKSB2N5L.mjs +206 -0
  59. package/dist/chunk-RKSB2N5L.mjs.map +1 -0
  60. package/dist/chunk-S4DGVKBK.mjs +151 -0
  61. package/dist/chunk-S4DGVKBK.mjs.map +1 -0
  62. package/dist/chunk-S4T4PU7F.mjs +114 -0
  63. package/dist/chunk-S4T4PU7F.mjs.map +1 -0
  64. package/dist/chunk-SZPZOGPC.mjs +394 -0
  65. package/dist/chunk-SZPZOGPC.mjs.map +1 -0
  66. package/dist/chunk-T546XBQG.mjs +443 -0
  67. package/dist/chunk-T546XBQG.mjs.map +1 -0
  68. package/dist/chunk-UWTT5AE6.mjs +145 -0
  69. package/dist/chunk-UWTT5AE6.mjs.map +1 -0
  70. package/dist/chunk-V5UFWYFI.mjs +255 -0
  71. package/dist/chunk-V5UFWYFI.mjs.map +1 -0
  72. package/dist/chunk-VUPGBB5X.mjs +150 -0
  73. package/dist/chunk-VUPGBB5X.mjs.map +1 -0
  74. package/dist/chunk-W6YNEU53.mjs +175 -0
  75. package/dist/chunk-W6YNEU53.mjs.map +1 -0
  76. package/dist/chunk-WWSN5YME.mjs +222 -0
  77. package/dist/chunk-WWSN5YME.mjs.map +1 -0
  78. package/dist/chunk-XK52LYR4.mjs +182 -0
  79. package/dist/chunk-XK52LYR4.mjs.map +1 -0
  80. package/dist/chunk-YIAH6KHV.mjs +164 -0
  81. package/dist/chunk-YIAH6KHV.mjs.map +1 -0
  82. package/dist/chunk-Z6JWWCNL.mjs +108 -0
  83. package/dist/chunk-Z6JWWCNL.mjs.map +1 -0
  84. package/dist/chunk-ZDRUTJ4T.mjs +119 -0
  85. package/dist/chunk-ZDRUTJ4T.mjs.map +1 -0
  86. package/dist/components/accordion.mjs +19 -0
  87. package/dist/components/accordion.mjs.map +1 -0
  88. package/dist/components/alert.mjs +15 -0
  89. package/dist/components/alert.mjs.map +1 -0
  90. package/dist/components/avatar.mjs +23 -0
  91. package/dist/components/avatar.mjs.map +1 -0
  92. package/dist/components/badge.mjs +11 -0
  93. package/dist/components/badge.mjs.map +1 -0
  94. package/dist/components/breadcrumb.mjs +23 -0
  95. package/dist/components/breadcrumb.mjs.map +1 -0
  96. package/dist/components/button-group.mjs +11 -0
  97. package/dist/components/button-group.mjs.map +1 -0
  98. package/dist/components/button.mjs +12 -0
  99. package/dist/components/button.mjs.map +1 -0
  100. package/dist/components/card.mjs +25 -0
  101. package/dist/components/card.mjs.map +1 -0
  102. package/dist/components/chat-input.mjs +15 -0
  103. package/dist/components/chat-input.mjs.map +1 -0
  104. package/dist/components/chat-message.mjs +17 -0
  105. package/dist/components/chat-message.mjs.map +1 -0
  106. package/dist/components/checkbox.mjs +12 -0
  107. package/dist/components/checkbox.mjs.map +1 -0
  108. package/dist/components/divider.mjs +11 -0
  109. package/dist/components/divider.mjs.map +1 -0
  110. package/dist/components/drawer.mjs +33 -0
  111. package/dist/components/drawer.mjs.map +1 -0
  112. package/dist/components/dropdown.mjs +35 -0
  113. package/dist/components/dropdown.mjs.map +1 -0
  114. package/dist/components/field.mjs +17 -0
  115. package/dist/components/field.mjs.map +1 -0
  116. package/dist/components/icon-button.mjs +12 -0
  117. package/dist/components/icon-button.mjs.map +1 -0
  118. package/dist/components/input.mjs +12 -0
  119. package/dist/components/input.mjs.map +1 -0
  120. package/dist/components/metric-card.mjs +23 -0
  121. package/dist/components/metric-card.mjs.map +1 -0
  122. package/dist/components/modal.mjs +57 -0
  123. package/dist/components/modal.mjs.map +1 -0
  124. package/dist/components/navigation-menu.mjs +27 -0
  125. package/dist/components/navigation-menu.mjs.map +1 -0
  126. package/dist/components/pagination.mjs +33 -0
  127. package/dist/components/pagination.mjs.map +1 -0
  128. package/dist/components/popover.mjs +23 -0
  129. package/dist/components/popover.mjs.map +1 -0
  130. package/dist/components/progress.mjs +11 -0
  131. package/dist/components/progress.mjs.map +1 -0
  132. package/dist/components/quick-reply.mjs +15 -0
  133. package/dist/components/quick-reply.mjs.map +1 -0
  134. package/dist/components/radio-group.mjs +16 -0
  135. package/dist/components/radio-group.mjs.map +1 -0
  136. package/dist/components/segmented.mjs +15 -0
  137. package/dist/components/segmented.mjs.map +1 -0
  138. package/dist/components/select.mjs +23 -0
  139. package/dist/components/select.mjs.map +1 -0
  140. package/dist/components/skeleton.mjs +11 -0
  141. package/dist/components/skeleton.mjs.map +1 -0
  142. package/dist/components/slider.mjs +11 -0
  143. package/dist/components/slider.mjs.map +1 -0
  144. package/dist/components/spinner.mjs +11 -0
  145. package/dist/components/spinner.mjs.map +1 -0
  146. package/dist/components/switch.mjs +12 -0
  147. package/dist/components/switch.mjs.map +1 -0
  148. package/dist/components/table.mjs +23 -0
  149. package/dist/components/table.mjs.map +1 -0
  150. package/dist/components/tabs.mjs +19 -0
  151. package/dist/components/tabs.mjs.map +1 -0
  152. package/dist/components/textarea.mjs +12 -0
  153. package/dist/components/textarea.mjs.map +1 -0
  154. package/dist/components/toast.mjs +13 -0
  155. package/dist/components/toast.mjs.map +1 -0
  156. package/dist/components/toggle-group.mjs +15 -0
  157. package/dist/components/toggle-group.mjs.map +1 -0
  158. package/dist/components/toggle.mjs +11 -0
  159. package/dist/components/toggle.mjs.map +1 -0
  160. package/dist/components/tooltip.mjs +21 -0
  161. package/dist/components/tooltip.mjs.map +1 -0
  162. package/dist/components/typing-indicator.mjs +11 -0
  163. package/dist/components/typing-indicator.mjs.map +1 -0
  164. package/dist/index.js +22 -7
  165. package/dist/index.js.map +1 -1
  166. package/dist/index.mjs +296 -7521
  167. package/dist/index.mjs.map +1 -1
  168. package/llms.txt +29 -25
  169. package/package.json +4 -3
  170. package/dist/chart.d.mts +0 -147
  171. package/dist/index.d.mts +0 -1535
@@ -0,0 +1,255 @@
1
+ "use client";
2
+ import {
3
+ cn
4
+ } from "./chunk-53MIUPSY.mjs";
5
+
6
+ // src/components/ui/dropdown.tsx
7
+ import * as React from "react";
8
+ import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
9
+ var contentRadiusMap = {
10
+ md: "rounded-md",
11
+ // 6px
12
+ lg: "rounded-lg",
13
+ // 8px
14
+ xl: "rounded-xl"
15
+ // 12px (default)
16
+ };
17
+ var itemRadiusMap = {
18
+ md: "rounded",
19
+ // 4px — perceptual balance (67%)
20
+ lg: "rounded-md",
21
+ // 6px — perceptual balance (75%)
22
+ xl: "rounded-lg"
23
+ // 8px — perceptual balance (67%)
24
+ };
25
+ var itemSizeMap = {
26
+ sm: "px-2 py-1.5 text-xs",
27
+ md: "px-2 py-1.5 text-sm",
28
+ lg: "px-3 py-2.5 text-md"
29
+ };
30
+ var indicatorItemSizeMap = {
31
+ sm: "py-1.5 pl-6 pr-2 text-xs",
32
+ md: "py-1.5 pl-8 pr-2 text-sm",
33
+ lg: "py-2.5 pl-10 pr-3 text-md"
34
+ };
35
+ var indicatorSizeMap = {
36
+ sm: "left-2 h-3 w-3",
37
+ md: "left-2 h-3.5 w-3.5",
38
+ lg: "left-3 h-4 w-4"
39
+ };
40
+ var labelSizeMap = {
41
+ sm: "px-2 py-1.5 text-xs",
42
+ md: "px-2 py-1.5 text-xs",
43
+ lg: "px-3 py-2.5 text-xs"
44
+ };
45
+ var flushItemPaddingMap = {
46
+ sm: "px-3",
47
+ md: "px-3",
48
+ lg: "px-4"
49
+ };
50
+ var flushIndicatorItemPaddingMap = {
51
+ sm: "pl-7 pr-3",
52
+ md: "pl-9 pr-3",
53
+ lg: "pl-11 pr-4"
54
+ };
55
+ var insetSizeMap = {
56
+ sm: "pl-6",
57
+ md: "pl-8",
58
+ lg: "pl-10"
59
+ };
60
+ var DropdownMenuStyleContext = React.createContext({ radius: "lg", flush: false, size: "md" });
61
+ var DropdownMenu = DropdownMenuPrimitive.Root;
62
+ var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
63
+ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
64
+ var DropdownMenuSub = DropdownMenuPrimitive.Sub;
65
+ var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
66
+ var DropdownMenuContent = React.forwardRef(({ className, sideOffset = 4, radius = "md", flush = false, size = "md", onCloseAutoFocus, ...props }, ref) => /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.Portal, null, /* @__PURE__ */ React.createElement(DropdownMenuStyleContext.Provider, { value: { radius, flush, size } }, /* @__PURE__ */ React.createElement(
67
+ DropdownMenuPrimitive.Content,
68
+ {
69
+ ref,
70
+ sideOffset,
71
+ onCloseAutoFocus: (e) => {
72
+ e.preventDefault();
73
+ onCloseAutoFocus?.(e);
74
+ },
75
+ className: cn(
76
+ "z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg",
77
+ flush ? "py-1" : "p-1",
78
+ contentRadiusMap[radius],
79
+ className
80
+ ),
81
+ ...props
82
+ }
83
+ ))));
84
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
85
+ var DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref) => {
86
+ const { radius, flush, size } = React.useContext(DropdownMenuStyleContext);
87
+ return /* @__PURE__ */ React.createElement(
88
+ DropdownMenuPrimitive.Item,
89
+ {
90
+ ref,
91
+ className: cn(
92
+ "relative flex cursor-default select-none items-center outline-none",
93
+ itemSizeMap[size],
94
+ !flush && itemRadiusMap[radius],
95
+ flush && flushItemPaddingMap[size],
96
+ "transition-colors duration-fast",
97
+ "focus:bg-background-muted",
98
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
99
+ inset && insetSizeMap[size],
100
+ className
101
+ ),
102
+ ...props
103
+ }
104
+ );
105
+ });
106
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
107
+ var DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checked, ...props }, ref) => {
108
+ const { radius, flush, size } = React.useContext(DropdownMenuStyleContext);
109
+ return /* @__PURE__ */ React.createElement(
110
+ DropdownMenuPrimitive.CheckboxItem,
111
+ {
112
+ ref,
113
+ className: cn(
114
+ "relative flex cursor-default select-none items-center outline-none",
115
+ indicatorItemSizeMap[size],
116
+ !flush && itemRadiusMap[radius],
117
+ flush && flushIndicatorItemPaddingMap[size],
118
+ "transition-colors duration-fast",
119
+ "focus:bg-background-muted",
120
+ "data-[state=checked]:text-foreground data-[state=checked]:font-semibold",
121
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
122
+ className
123
+ ),
124
+ checked,
125
+ ...props
126
+ },
127
+ /* @__PURE__ */ React.createElement("span", { className: cn("absolute flex items-center justify-center", indicatorSizeMap[size]) }, /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React.createElement("svg", { className: "icon-xs", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3, "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })))),
128
+ children
129
+ );
130
+ });
131
+ DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
132
+ var DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props }, ref) => {
133
+ const { radius, flush, size } = React.useContext(DropdownMenuStyleContext);
134
+ return /* @__PURE__ */ React.createElement(
135
+ DropdownMenuPrimitive.RadioItem,
136
+ {
137
+ ref,
138
+ className: cn(
139
+ "relative flex cursor-default select-none items-center outline-none",
140
+ indicatorItemSizeMap[size],
141
+ !flush && itemRadiusMap[radius],
142
+ flush && flushIndicatorItemPaddingMap[size],
143
+ "transition-colors duration-fast",
144
+ "focus:bg-background-muted",
145
+ "data-[state=checked]:text-foreground data-[state=checked]:font-semibold",
146
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
147
+ className
148
+ ),
149
+ ...props
150
+ },
151
+ /* @__PURE__ */ React.createElement("span", { className: cn("absolute flex items-center justify-center", indicatorSizeMap[size]) }, /* @__PURE__ */ React.createElement(DropdownMenuPrimitive.ItemIndicator, null, /* @__PURE__ */ React.createElement("svg", { className: "icon-xs", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "12", r: "6" })))),
152
+ children
153
+ );
154
+ });
155
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
156
+ var DropdownMenuLabel = React.forwardRef(({ className, inset, ...props }, ref) => {
157
+ const { flush, size } = React.useContext(DropdownMenuStyleContext);
158
+ return /* @__PURE__ */ React.createElement(
159
+ DropdownMenuPrimitive.Label,
160
+ {
161
+ ref,
162
+ className: cn(
163
+ "font-semibold text-text-muted",
164
+ labelSizeMap[size],
165
+ flush && flushItemPaddingMap[size],
166
+ inset && insetSizeMap[size],
167
+ className
168
+ ),
169
+ ...props
170
+ }
171
+ );
172
+ });
173
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
174
+ var DropdownMenuSeparator = React.forwardRef(({ className, ...props }, ref) => {
175
+ const { flush } = React.useContext(DropdownMenuStyleContext);
176
+ return /* @__PURE__ */ React.createElement(
177
+ DropdownMenuPrimitive.Separator,
178
+ {
179
+ ref,
180
+ className: cn("h-px bg-border my-1", !flush && "-mx-1", className),
181
+ ...props
182
+ }
183
+ );
184
+ });
185
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
186
+ var DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, ...props }, ref) => {
187
+ const { radius, flush, size } = React.useContext(DropdownMenuStyleContext);
188
+ return /* @__PURE__ */ React.createElement(
189
+ DropdownMenuPrimitive.SubTrigger,
190
+ {
191
+ ref,
192
+ className: cn(
193
+ "flex cursor-default select-none items-center outline-none",
194
+ itemSizeMap[size],
195
+ !flush && itemRadiusMap[radius],
196
+ flush && flushItemPaddingMap[size],
197
+ "focus:bg-background-muted data-[state=open]:bg-background-muted",
198
+ inset && insetSizeMap[size],
199
+ className
200
+ ),
201
+ ...props
202
+ },
203
+ children,
204
+ /* @__PURE__ */ React.createElement("svg", { className: "ml-auto icon-xs", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, "aria-hidden": "true" }, /* @__PURE__ */ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }))
205
+ );
206
+ });
207
+ DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
208
+ var DropdownMenuSubContent = React.forwardRef(({ className, ...props }, ref) => {
209
+ const { radius, flush } = React.useContext(DropdownMenuStyleContext);
210
+ return /* @__PURE__ */ React.createElement(
211
+ DropdownMenuPrimitive.SubContent,
212
+ {
213
+ ref,
214
+ className: cn(
215
+ "z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg",
216
+ flush ? "py-1" : "p-1",
217
+ contentRadiusMap[radius],
218
+ className
219
+ ),
220
+ ...props
221
+ }
222
+ );
223
+ });
224
+ DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
225
+ function DropdownMenuShortcut({
226
+ className,
227
+ ...props
228
+ }) {
229
+ return /* @__PURE__ */ React.createElement(
230
+ "span",
231
+ {
232
+ className: cn("ml-auto pl-4 text-xs text-text-subtle tracking-widest", className),
233
+ ...props
234
+ }
235
+ );
236
+ }
237
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
238
+
239
+ export {
240
+ DropdownMenu,
241
+ DropdownMenuTrigger,
242
+ DropdownMenuGroup,
243
+ DropdownMenuSub,
244
+ DropdownMenuRadioGroup,
245
+ DropdownMenuContent,
246
+ DropdownMenuItem,
247
+ DropdownMenuCheckboxItem,
248
+ DropdownMenuRadioItem,
249
+ DropdownMenuLabel,
250
+ DropdownMenuSeparator,
251
+ DropdownMenuSubTrigger,
252
+ DropdownMenuSubContent,
253
+ DropdownMenuShortcut
254
+ };
255
+ //# sourceMappingURL=chunk-V5UFWYFI.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/dropdown.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'\nimport { cn } from '@/lib/utils'\n\n// Radius variants for Content and Item (concentric rounded rectangles)\ntype DropdownMenuRadius = 'md' | 'lg' | 'xl'\n\nconst contentRadiusMap: Record<DropdownMenuRadius, string> = {\n md: 'rounded-md', // 6px\n lg: 'rounded-lg', // 8px\n xl: 'rounded-xl', // 12px (default)\n}\n\nconst itemRadiusMap: Record<DropdownMenuRadius, string> = {\n md: 'rounded', // 4px — perceptual balance (67%)\n lg: 'rounded-md', // 6px — perceptual balance (75%)\n xl: 'rounded-lg', // 8px — perceptual balance (67%)\n}\n\n// Size variants\ntype DropdownMenuSize = 'sm' | 'md' | 'lg'\n\nconst itemSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'px-2 py-1.5 text-xs',\n md: 'px-2 py-1.5 text-sm',\n lg: 'px-3 py-2.5 text-md',\n}\n\nconst indicatorItemSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'py-1.5 pl-6 pr-2 text-xs',\n md: 'py-1.5 pl-8 pr-2 text-sm',\n lg: 'py-2.5 pl-10 pr-3 text-md',\n}\n\nconst indicatorSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'left-2 h-3 w-3',\n md: 'left-2 h-3.5 w-3.5',\n lg: 'left-3 h-4 w-4',\n}\n\nconst labelSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'px-2 py-1.5 text-xs',\n md: 'px-2 py-1.5 text-xs',\n lg: 'px-3 py-2.5 text-xs',\n}\n\nconst flushItemPaddingMap: Record<DropdownMenuSize, string> = {\n sm: 'px-3',\n md: 'px-3',\n lg: 'px-4',\n}\n\nconst flushIndicatorItemPaddingMap: Record<DropdownMenuSize, string> = {\n sm: 'pl-7 pr-3',\n md: 'pl-9 pr-3',\n lg: 'pl-11 pr-4',\n}\n\nconst insetSizeMap: Record<DropdownMenuSize, string> = {\n sm: 'pl-6',\n md: 'pl-8',\n lg: 'pl-10',\n}\n\n// Style context — propagates radius, flush, size from Content to children\nconst DropdownMenuStyleContext = React.createContext<{\n radius: DropdownMenuRadius\n flush: boolean\n size: DropdownMenuSize\n}>({ radius: 'lg', flush: false, size: 'md' })\n\n// Root — state management (controlled / uncontrolled)\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\n// Trigger — the element that toggles the menu\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\n// Group — groups related items\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\n\n// Sub — submenu root\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\n\n// RadioGroup — radio selection group\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\n// Content — the floating panel (rendered in a Portal)\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> & {\n radius?: DropdownMenuRadius\n flush?: boolean\n size?: DropdownMenuSize\n }\n>(({ className, sideOffset = 4, radius = 'md', flush = false, size = 'md', onCloseAutoFocus, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuStyleContext.Provider value={{ radius, flush, size }}>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n onCloseAutoFocus={(e) => {\n e.preventDefault()\n onCloseAutoFocus?.(e)\n }}\n className={cn(\n 'z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg',\n flush ? 'py-1' : 'p-1',\n contentRadiusMap[radius],\n className\n )}\n {...props}\n />\n </DropdownMenuStyleContext.Provider>\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\n// Item — a single menu item\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center outline-none',\n itemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushItemPaddingMap[size],\n 'transition-colors duration-fast',\n 'focus:bg-background-muted',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n inset && insetSizeMap[size],\n className\n )}\n {...props}\n />\n )\n})\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\n// CheckboxItem — item with a checkbox indicator\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center outline-none',\n indicatorItemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushIndicatorItemPaddingMap[size],\n 'transition-colors duration-fast',\n 'focus:bg-background-muted',\n 'data-[state=checked]:text-foreground data-[state=checked]:font-semibold',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n checked={checked}\n {...props}\n >\n <span className={cn('absolute flex items-center justify-center', indicatorSizeMap[size])}>\n <DropdownMenuPrimitive.ItemIndicator>\n <svg className=\"icon-xs\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={3} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M5 13l4 4L19 7\" />\n </svg>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n )\n})\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName\n\n// RadioItem — item within a RadioGroup\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center outline-none',\n indicatorItemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushIndicatorItemPaddingMap[size],\n 'transition-colors duration-fast',\n 'focus:bg-background-muted',\n 'data-[state=checked]:text-foreground data-[state=checked]:font-semibold',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n {...props}\n >\n <span className={cn('absolute flex items-center justify-center', indicatorSizeMap[size])}>\n <DropdownMenuPrimitive.ItemIndicator>\n <svg className=\"icon-xs\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"6\" />\n </svg>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n )\n})\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\n// Label — non-interactive group heading\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => {\n const { flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn(\n 'font-semibold text-text-muted',\n labelSizeMap[size],\n flush && flushItemPaddingMap[size],\n inset && insetSizeMap[size],\n className\n )}\n {...props}\n />\n )\n})\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\n// Separator — visual divider between groups\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => {\n const { flush } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n className={cn('h-px bg-border my-1', !flush && '-mx-1', className)}\n {...props}\n />\n )\n})\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\n// SubTrigger — item that opens a submenu\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => {\n const { radius, flush, size } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center outline-none',\n itemSizeMap[size],\n !flush && itemRadiusMap[radius],\n flush && flushItemPaddingMap[size],\n 'focus:bg-background-muted data-[state=open]:bg-background-muted',\n inset && insetSizeMap[size],\n className\n )}\n {...props}\n >\n {children}\n <svg className=\"ml-auto icon-xs\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2} aria-hidden=\"true\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M9 5l7 7-7 7\" />\n </svg>\n </DropdownMenuPrimitive.SubTrigger>\n )\n})\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\n// SubContent — the floating panel for a submenu\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => {\n const { radius, flush } = React.useContext(DropdownMenuStyleContext)\n return (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-popover min-w-[8rem] overflow-hidden border border-border bg-background text-foreground shadow-lg',\n flush ? 'py-1' : 'p-1',\n contentRadiusMap[radius],\n className\n )}\n {...props}\n />\n )\n})\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\n// Shortcut — keyboard shortcut hint text\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n className={cn('ml-auto pl-4 text-xs text-text-subtle tracking-widest', className)}\n {...props}\n />\n )\n}\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut'\n\nexport type { DropdownMenuRadius, DropdownMenuSize }\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuGroup,\n DropdownMenuSub,\n DropdownMenuSubTrigger,\n DropdownMenuSubContent,\n DropdownMenuShortcut,\n}\n"],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,2BAA2B;AAMvC,IAAM,mBAAuD;AAAA,EAC3D,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AACN;AAEA,IAAM,gBAAoD;AAAA,EACxD,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AAAA,EACJ,IAAI;AAAA;AACN;AAKA,IAAM,cAAgD;AAAA,EACpD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,IAAM,uBAAyD;AAAA,EAC7D,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,IAAM,mBAAqD;AAAA,EACzD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,IAAM,eAAiD;AAAA,EACrD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,IAAM,sBAAwD;AAAA,EAC5D,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,IAAM,+BAAiE;AAAA,EACrE,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAEA,IAAM,eAAiD;AAAA,EACrD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAGA,IAAM,2BAAiC,oBAIpC,EAAE,QAAQ,MAAM,OAAO,OAAO,MAAM,KAAK,CAAC;AAG7C,IAAM,eAAqC;AAG3C,IAAM,sBAA4C;AAGlD,IAAM,oBAA0C;AAGhD,IAAM,kBAAwC;AAG9C,IAAM,yBAA+C;AAGrD,IAAM,sBAA4B,iBAOhC,CAA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GtE,IAAM,yBAA+B,iBAGnC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClC,QAAM,EAAE,QAAQ,MAAM,IAAU,iBAAW,wBAAwB;AACnE,SACE;AAAA,IAAuB;AAAA,IAAtB;AAAA,MACC;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA,QAAQ,SAAS;AAAA,QACjB,iBAAiB,MAAM;AAAA,QACvB;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AACD,uBAAuB,cAAoC,iCAAW;AAGtE,SAAS,qBAAqB;AAAA,EAC5B;AAAA,EACA,GAAG;AACL,GAA0C;AACxC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,yDAAyD,SAAS;AAAA,MAC/E,GAAG;AAAA;AAAA,EACN;AAEJ;AACA,qBAAqB,cAAc;","names":[]}
@@ -0,0 +1,150 @@
1
+ "use client";
2
+ import {
3
+ cn
4
+ } from "./chunk-53MIUPSY.mjs";
5
+
6
+ // src/components/ui/slider.tsx
7
+ import * as React from "react";
8
+ import * as SliderPrimitive from "@radix-ui/react-slider";
9
+ import { cva } from "class-variance-authority";
10
+ var sliderVariants = cva(
11
+ "relative flex touch-none select-none",
12
+ {
13
+ variants: {
14
+ size: {
15
+ sm: "",
16
+ default: "",
17
+ lg: ""
18
+ }
19
+ },
20
+ defaultVariants: {
21
+ size: "default"
22
+ }
23
+ }
24
+ );
25
+ var trackSizes = {
26
+ sm: "h-1 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-1",
27
+ default: "h-1.5 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-1.5",
28
+ lg: "h-2 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-2"
29
+ };
30
+ var thumbSizes = {
31
+ sm: "w-[var(--component-slider-thumb-sm)] h-[var(--component-slider-thumb-sm)]",
32
+ default: "w-[var(--component-slider-thumb-default)] h-[var(--component-slider-thumb-default)]",
33
+ lg: "w-[var(--component-slider-thumb-lg)] h-[var(--component-slider-thumb-lg)]"
34
+ };
35
+ var contentSizes = {
36
+ sm: "text-xs",
37
+ default: "text-sm",
38
+ lg: "text-base"
39
+ };
40
+ var sliderColorMap = {
41
+ default: {
42
+ range: "bg-foreground",
43
+ thumb: "bg-background border-foreground",
44
+ thumbHover: "hover:shadow-[0_0_0_4px_color-mix(in_srgb,var(--color-text)_16%,transparent)] hover:border-foreground",
45
+ thumbActive: "active:shadow-[0_0_0_6px_color-mix(in_srgb,var(--color-text)_16%,transparent)]"
46
+ },
47
+ primary: {
48
+ range: "bg-primary",
49
+ thumb: "bg-primary-foreground border-primary",
50
+ thumbHover: "hover:shadow-primary-glow hover:border-primary-hover",
51
+ thumbActive: "active:shadow-[0_0_0_6px_color-mix(in_srgb,var(--color-primary)_16%,transparent)]"
52
+ }
53
+ };
54
+ var Slider = React.forwardRef(({ className, size, color = "default", value, defaultValue, onValueChange, showTooltip = "never", formatLabel, startContent, endContent, orientation, ...props }, ref) => {
55
+ const resolvedSize = size || "default";
56
+ const thumbCount = value?.length ?? defaultValue?.length ?? 1;
57
+ const hasTooltip = showTooltip !== "never";
58
+ const hasWrapper = !!(startContent || endContent);
59
+ const isVertical = orientation === "vertical";
60
+ const [internalValue, setInternalValue] = React.useState(
61
+ () => value ?? defaultValue ?? Array(thumbCount).fill(props.min ?? 0)
62
+ );
63
+ const displayValues = value ?? internalValue;
64
+ const handleValueChange = React.useCallback((newValue) => {
65
+ setInternalValue(newValue);
66
+ onValueChange?.(newValue);
67
+ }, [onValueChange]);
68
+ const sliderRoot = /* @__PURE__ */ React.createElement(
69
+ SliderPrimitive.Root,
70
+ {
71
+ ref,
72
+ className: cn(
73
+ sliderVariants({ size }),
74
+ isVertical ? "h-full w-auto flex-col items-center" : "w-full items-center",
75
+ hasWrapper && (isVertical ? "flex-1 min-h-0" : "flex-1 min-w-0"),
76
+ !hasWrapper && className
77
+ ),
78
+ value,
79
+ defaultValue,
80
+ onValueChange: hasTooltip ? handleValueChange : onValueChange,
81
+ orientation,
82
+ ...props
83
+ },
84
+ /* @__PURE__ */ React.createElement(
85
+ SliderPrimitive.Track,
86
+ {
87
+ className: cn(
88
+ "relative grow overflow-hidden rounded-full bg-border",
89
+ isVertical ? "h-full" : "w-full",
90
+ trackSizes[resolvedSize]
91
+ )
92
+ },
93
+ /* @__PURE__ */ React.createElement(
94
+ SliderPrimitive.Range,
95
+ {
96
+ className: cn(
97
+ "absolute rounded-full",
98
+ sliderColorMap[color].range,
99
+ isVertical ? "w-full transition-[top,bottom] duration-fast ease-out" : "h-full transition-[left,right] duration-fast ease-out"
100
+ )
101
+ }
102
+ )
103
+ ),
104
+ Array.from({ length: thumbCount }).map((_, i) => /* @__PURE__ */ React.createElement(
105
+ SliderPrimitive.Thumb,
106
+ {
107
+ key: i,
108
+ className: cn(
109
+ "group/thumb block rounded-full border-2 shadow-sm",
110
+ sliderColorMap[color].thumb,
111
+ isVertical ? "transition-[top,box-shadow,border-color] duration-fast ease-out" : "transition-[left,box-shadow,border-color] duration-fast ease-out",
112
+ sliderColorMap[color].thumbHover,
113
+ sliderColorMap[color].thumbActive,
114
+ "focus-visible:focus-ring",
115
+ "disabled:pointer-events-none disabled:opacity-50",
116
+ thumbSizes[resolvedSize]
117
+ )
118
+ },
119
+ hasTooltip && /* @__PURE__ */ React.createElement(
120
+ "div",
121
+ {
122
+ className: cn(
123
+ "absolute pointer-events-none",
124
+ "transition-all duration-fast ease-out",
125
+ isVertical ? "right-full top-1/2 -translate-y-1/2 mr-2 origin-right" : "bottom-full left-1/2 -translate-x-1/2 mb-2 origin-bottom",
126
+ showTooltip === "always" ? "opacity-100 scale-100" : [
127
+ "opacity-0 scale-95",
128
+ "group-hover/thumb:opacity-100 group-hover/thumb:scale-100",
129
+ "group-active/thumb:opacity-100 group-active/thumb:scale-100",
130
+ "group-focus-visible/thumb:opacity-100 group-focus-visible/thumb:scale-100"
131
+ ]
132
+ )
133
+ },
134
+ /* @__PURE__ */ React.createElement("div", { className: "relative bg-foreground text-background text-xs font-semibold font-mono tabular-nums px-2.5 py-1 rounded-md shadow-lg whitespace-nowrap" }, formatLabel ? formatLabel(displayValues[i]) : displayValues[i], isVertical ? /* @__PURE__ */ React.createElement("div", { className: "absolute left-full top-1/2 -translate-y-1/2 border-4 border-transparent border-l-foreground" }) : /* @__PURE__ */ React.createElement("div", { className: "absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-foreground" }))
135
+ )
136
+ ))
137
+ );
138
+ if (!hasWrapper) return sliderRoot;
139
+ return /* @__PURE__ */ React.createElement("div", { className: cn(
140
+ isVertical ? "inline-flex flex-col items-center gap-2 h-full" : "flex items-center gap-3",
141
+ className
142
+ ) }, startContent && /* @__PURE__ */ React.createElement("span", { className: cn("shrink-0 text-text-muted select-none", contentSizes[resolvedSize], props.disabled && "opacity-50") }, startContent), sliderRoot, endContent && /* @__PURE__ */ React.createElement("span", { className: cn("shrink-0 text-text-muted select-none", contentSizes[resolvedSize], props.disabled && "opacity-50") }, endContent));
143
+ });
144
+ Slider.displayName = "Slider";
145
+
146
+ export {
147
+ sliderVariants,
148
+ Slider
149
+ };
150
+ //# sourceMappingURL=chunk-VUPGBB5X.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/slider.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as SliderPrimitive from '@radix-ui/react-slider'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '@/lib/utils'\n\n// Slider root variants\nconst sliderVariants = cva(\n 'relative flex touch-none select-none',\n {\n variants: {\n size: {\n sm: '',\n default: '',\n lg: '',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n }\n)\n\n// Track sizes per orientation\nconst trackSizes = {\n sm: 'h-1 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-1',\n default: 'h-1.5 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-1.5',\n lg: 'h-2 data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-2',\n}\n\n// Thumb sizes\nconst thumbSizes = {\n sm: 'w-[var(--component-slider-thumb-sm)] h-[var(--component-slider-thumb-sm)]',\n default: 'w-[var(--component-slider-thumb-default)] h-[var(--component-slider-thumb-default)]',\n lg: 'w-[var(--component-slider-thumb-lg)] h-[var(--component-slider-thumb-lg)]',\n}\n\n// Content font sizes (for startContent / endContent)\nconst contentSizes = {\n sm: 'text-xs',\n default: 'text-sm',\n lg: 'text-base',\n}\n\n// Color maps for range and thumb\nconst sliderColorMap = {\n default: {\n range: 'bg-foreground',\n thumb: 'bg-background border-foreground',\n thumbHover: 'hover:shadow-[0_0_0_4px_color-mix(in_srgb,var(--color-text)_16%,transparent)] hover:border-foreground',\n thumbActive: 'active:shadow-[0_0_0_6px_color-mix(in_srgb,var(--color-text)_16%,transparent)]',\n },\n primary: {\n range: 'bg-primary',\n thumb: 'bg-primary-foreground border-primary',\n thumbHover: 'hover:shadow-primary-glow hover:border-primary-hover',\n thumbActive: 'active:shadow-[0_0_0_6px_color-mix(in_srgb,var(--color-primary)_16%,transparent)]',\n },\n} as const\n\nexport type SliderColor = keyof typeof sliderColorMap\n\nexport interface SliderProps\n extends React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>,\n VariantProps<typeof sliderVariants> {\n /** Track and thumb color */\n color?: SliderColor\n /** Tooltip display mode: auto (hover/drag), always, never */\n showTooltip?: 'auto' | 'always' | 'never'\n /** Custom formatter for tooltip value */\n formatLabel?: (value: number) => string\n /** Content to display before the slider (icon, label, etc.) */\n startContent?: React.ReactNode\n /** Content to display after the slider */\n endContent?: React.ReactNode\n}\n\nconst Slider = React.forwardRef<\n React.ElementRef<typeof SliderPrimitive.Root>,\n SliderProps\n>(({ className, size, color = 'default', value, defaultValue, onValueChange, showTooltip = 'never', formatLabel, startContent, endContent, orientation, ...props }, ref) => {\n const resolvedSize = size || 'default'\n const thumbCount = value?.length ?? defaultValue?.length ?? 1\n const hasTooltip = showTooltip !== 'never'\n const hasWrapper = !!(startContent || endContent)\n const isVertical = orientation === 'vertical'\n\n // Track value internally for tooltip display\n const [internalValue, setInternalValue] = React.useState(\n () => value ?? defaultValue ?? Array(thumbCount).fill(props.min ?? 0)\n )\n const displayValues = value ?? internalValue\n\n const handleValueChange = React.useCallback((newValue: number[]) => {\n setInternalValue(newValue)\n onValueChange?.(newValue)\n }, [onValueChange])\n\n const sliderRoot = (\n <SliderPrimitive.Root\n ref={ref}\n className={cn(\n sliderVariants({ size }),\n isVertical\n ? 'h-full w-auto flex-col items-center'\n : 'w-full items-center',\n hasWrapper && (isVertical ? 'flex-1 min-h-0' : 'flex-1 min-w-0'),\n !hasWrapper && className\n )}\n value={value}\n defaultValue={defaultValue}\n onValueChange={hasTooltip ? handleValueChange : onValueChange}\n orientation={orientation}\n {...props}\n >\n <SliderPrimitive.Track\n className={cn(\n 'relative grow overflow-hidden rounded-full bg-border',\n isVertical ? 'h-full' : 'w-full',\n trackSizes[resolvedSize]\n )}\n >\n <SliderPrimitive.Range\n className={cn(\n 'absolute rounded-full', sliderColorMap[color].range,\n isVertical\n ? 'w-full transition-[top,bottom] duration-fast ease-out'\n : 'h-full transition-[left,right] duration-fast ease-out'\n )}\n />\n </SliderPrimitive.Track>\n {Array.from({ length: thumbCount }).map((_, i) => (\n <SliderPrimitive.Thumb\n key={i}\n className={cn(\n 'group/thumb block rounded-full border-2 shadow-sm', sliderColorMap[color].thumb,\n isVertical\n ? 'transition-[top,box-shadow,border-color] duration-fast ease-out'\n : 'transition-[left,box-shadow,border-color] duration-fast ease-out',\n sliderColorMap[color].thumbHover,\n sliderColorMap[color].thumbActive,\n 'focus-visible:focus-ring',\n 'disabled:pointer-events-none disabled:opacity-50',\n thumbSizes[resolvedSize]\n )}\n >\n {hasTooltip && (\n <div\n className={cn(\n 'absolute pointer-events-none',\n 'transition-all duration-fast ease-out',\n isVertical\n ? 'right-full top-1/2 -translate-y-1/2 mr-2 origin-right'\n : 'bottom-full left-1/2 -translate-x-1/2 mb-2 origin-bottom',\n showTooltip === 'always'\n ? 'opacity-100 scale-100'\n : [\n 'opacity-0 scale-95',\n 'group-hover/thumb:opacity-100 group-hover/thumb:scale-100',\n 'group-active/thumb:opacity-100 group-active/thumb:scale-100',\n 'group-focus-visible/thumb:opacity-100 group-focus-visible/thumb:scale-100',\n ]\n )}\n >\n <div className=\"relative bg-foreground text-background text-xs font-semibold font-mono tabular-nums px-2.5 py-1 rounded-md shadow-lg whitespace-nowrap\">\n {formatLabel ? formatLabel(displayValues[i]) : displayValues[i]}\n {/* Arrow */}\n {isVertical ? (\n <div className=\"absolute left-full top-1/2 -translate-y-1/2 border-4 border-transparent border-l-foreground\" />\n ) : (\n <div className=\"absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-foreground\" />\n )}\n </div>\n </div>\n )}\n </SliderPrimitive.Thumb>\n ))}\n </SliderPrimitive.Root>\n )\n\n if (!hasWrapper) return sliderRoot\n\n return (\n <div className={cn(\n isVertical ? 'inline-flex flex-col items-center gap-2 h-full' : 'flex items-center gap-3',\n className\n )}>\n {startContent && (\n <span className={cn('shrink-0 text-text-muted select-none', contentSizes[resolvedSize], props.disabled && 'opacity-50')}>\n {startContent}\n </span>\n )}\n {sliderRoot}\n {endContent && (\n <span className={cn('shrink-0 text-text-muted select-none', contentSizes[resolvedSize], props.disabled && 'opacity-50')}>\n {endContent}\n </span>\n )}\n </div>\n )\n})\nSlider.displayName = 'Slider'\n\nexport { Slider, sliderVariants }\n"],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,YAAY,qBAAqB;AACjC,SAAS,WAA8B;AAIvC,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,MACN;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAGA,IAAM,aAAa;AAAA,EACjB,IAAI;AAAA,EAC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,GAAG,MAAM,YAAY,YAAY,KACnH,YACH,GAED,YACA,cACC,oCAAC,UAAK,WAAW,GAAG,wCAAwC,aAAa,YAAY,GAAG,MAAM,YAAY,YAAY,KACnH,UACH,CAEJ;AAEJ,CAAC;AACD,OAAO,cAAc;","names":[]}
@@ -0,0 +1,175 @@
1
+ "use client";
2
+ import {
3
+ cn
4
+ } from "./chunk-53MIUPSY.mjs";
5
+
6
+ // src/components/ui/badge.tsx
7
+ import * as React from "react";
8
+ import { Slot } from "@radix-ui/react-slot";
9
+ import { cva } from "class-variance-authority";
10
+ var colorMap = {
11
+ default: {
12
+ solid: "bg-foreground text-background",
13
+ subtle: "bg-background-muted text-foreground",
14
+ outline: "border-border text-foreground"
15
+ },
16
+ primary: {
17
+ solid: "bg-primary text-primary-foreground",
18
+ subtle: "bg-primary-tint text-text-primary",
19
+ outline: "border-primary text-text-primary"
20
+ },
21
+ success: {
22
+ solid: "bg-success text-success-foreground",
23
+ subtle: "bg-success-tint text-text-success",
24
+ outline: "border-success text-text-success"
25
+ },
26
+ warning: {
27
+ solid: "bg-warning text-warning-foreground",
28
+ subtle: "bg-warning-tint text-text-warning",
29
+ outline: "border-warning text-text-warning"
30
+ },
31
+ error: {
32
+ solid: "bg-error text-error-foreground",
33
+ subtle: "bg-error-tint text-text-error",
34
+ outline: "border-error text-text-error"
35
+ },
36
+ info: {
37
+ solid: "bg-info text-info-foreground",
38
+ subtle: "bg-info-tint text-text-info",
39
+ outline: "border-info text-text-info"
40
+ }
41
+ };
42
+ var badgeVariants = cva(
43
+ "inline-flex items-center justify-center whitespace-nowrap font-semibold transition-colors select-none",
44
+ {
45
+ variants: {
46
+ size: {
47
+ sm: "h-5 min-w-5 px-1.5 text-2xs gap-1",
48
+ // 20px height, 6px paddingX, 11px font
49
+ default: "h-6 min-w-6 px-2 text-xs gap-1",
50
+ // 24px height, 8px paddingX, 12px font
51
+ lg: "h-7 min-w-7 px-2.5 text-sm gap-1.5"
52
+ // 28px height, 10px paddingX, 13px font
53
+ },
54
+ radius: {
55
+ sm: "rounded-sm",
56
+ // 2px
57
+ base: "rounded",
58
+ // 4px
59
+ md: "rounded-md",
60
+ // 6px
61
+ lg: "rounded-lg",
62
+ // 8px
63
+ full: "rounded-full"
64
+ // 9999px
65
+ }
66
+ },
67
+ defaultVariants: {
68
+ size: "default",
69
+ radius: "full"
70
+ }
71
+ }
72
+ );
73
+ var badgeIconSizes = {
74
+ sm: "icon-2xs",
75
+ // 12px
76
+ default: "icon-2xs",
77
+ // 12px
78
+ lg: "icon-xs"
79
+ // 14px
80
+ };
81
+ var badgeDotSizes = {
82
+ sm: "w-1 h-1",
83
+ default: "w-1.5 h-1.5",
84
+ lg: "w-1.5 h-1.5"
85
+ };
86
+ var dotColorMap = {
87
+ default: "bg-foreground",
88
+ primary: "bg-primary",
89
+ success: "bg-success",
90
+ warning: "bg-warning",
91
+ error: "bg-error",
92
+ info: "bg-info"
93
+ };
94
+ var Badge = React.forwardRef(
95
+ ({
96
+ className,
97
+ variant = "subtle",
98
+ color = "default",
99
+ size,
100
+ radius,
101
+ icon,
102
+ dot = false,
103
+ removable = false,
104
+ onRemove,
105
+ asChild = false,
106
+ children,
107
+ ...props
108
+ }, ref) => {
109
+ const Comp = asChild ? Slot : "span";
110
+ const resolvedSize = size || "default";
111
+ const colorClasses = colorMap[color][variant];
112
+ const outlineClasses = variant === "outline" ? "border bg-transparent" : "";
113
+ const dotColor = variant === "solid" ? "bg-current" : dotColorMap[color];
114
+ return /* @__PURE__ */ React.createElement(
115
+ Comp,
116
+ {
117
+ ref,
118
+ className: cn(
119
+ badgeVariants({ size, radius }),
120
+ colorClasses,
121
+ outlineClasses,
122
+ className
123
+ ),
124
+ ...props
125
+ },
126
+ dot && /* @__PURE__ */ React.createElement(
127
+ "span",
128
+ {
129
+ className: cn("shrink-0 rounded-full", badgeDotSizes[resolvedSize], dotColor),
130
+ "aria-hidden": "true"
131
+ }
132
+ ),
133
+ icon && /* @__PURE__ */ React.createElement(
134
+ "span",
135
+ {
136
+ className: cn("shrink-0 [&>svg]:w-full [&>svg]:h-full", badgeIconSizes[resolvedSize]),
137
+ "aria-hidden": "true"
138
+ },
139
+ icon
140
+ ),
141
+ children,
142
+ removable && /* @__PURE__ */ React.createElement(
143
+ "button",
144
+ {
145
+ type: "button",
146
+ className: "shrink-0 -mr-0.5 ml-0.5 rounded-full p-0.5 opacity-70 hover:opacity-100 transition-opacity focus-visible:focus-ring",
147
+ onClick: (e) => {
148
+ e.stopPropagation();
149
+ onRemove?.();
150
+ },
151
+ "aria-label": "Remove"
152
+ },
153
+ /* @__PURE__ */ React.createElement(
154
+ "svg",
155
+ {
156
+ className: "w-3 h-3",
157
+ fill: "none",
158
+ viewBox: "0 0 24 24",
159
+ stroke: "currentColor",
160
+ strokeWidth: 2,
161
+ "aria-hidden": "true"
162
+ },
163
+ /* @__PURE__ */ React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" })
164
+ )
165
+ )
166
+ );
167
+ }
168
+ );
169
+ Badge.displayName = "Badge";
170
+
171
+ export {
172
+ badgeVariants,
173
+ Badge
174
+ };
175
+ //# sourceMappingURL=chunk-W6YNEU53.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ui/badge.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '@/lib/utils'\n\n// Badge color maps for variant × color combinations\n// Uses semantic tokens (*.tint, text-text-*) for v4 dark mode compatibility\nconst colorMap = {\n default: {\n solid: 'bg-foreground text-background',\n subtle: 'bg-background-muted text-foreground',\n outline: 'border-border text-foreground',\n },\n primary: {\n solid: 'bg-primary text-primary-foreground',\n subtle: 'bg-primary-tint text-text-primary',\n outline: 'border-primary text-text-primary',\n },\n success: {\n solid: 'bg-success text-success-foreground',\n subtle: 'bg-success-tint text-text-success',\n outline: 'border-success text-text-success',\n },\n warning: {\n solid: 'bg-warning text-warning-foreground',\n subtle: 'bg-warning-tint text-text-warning',\n outline: 'border-warning text-text-warning',\n },\n error: {\n solid: 'bg-error text-error-foreground',\n subtle: 'bg-error-tint text-text-error',\n outline: 'border-error text-text-error',\n },\n info: {\n solid: 'bg-info text-info-foreground',\n subtle: 'bg-info-tint text-text-info',\n outline: 'border-info text-text-info',\n },\n} as const\n\nconst badgeVariants = cva(\n 'inline-flex items-center justify-center whitespace-nowrap font-semibold transition-colors select-none',\n {\n variants: {\n size: {\n sm: 'h-5 min-w-5 px-1.5 text-2xs gap-1', // 20px height, 6px paddingX, 11px font\n default: 'h-6 min-w-6 px-2 text-xs gap-1', // 24px height, 8px paddingX, 12px font\n lg: 'h-7 min-w-7 px-2.5 text-sm gap-1.5', // 28px height, 10px paddingX, 13px font\n },\n radius: {\n sm: 'rounded-sm', // 2px\n base: 'rounded', // 4px\n md: 'rounded-md', // 6px\n lg: 'rounded-lg', // 8px\n full: 'rounded-full', // 9999px\n },\n },\n defaultVariants: {\n size: 'default',\n radius: 'full',\n },\n }\n)\n\n// Icon sizes per badge size\nconst badgeIconSizes = {\n sm: 'icon-2xs', // 12px\n default: 'icon-2xs', // 12px\n lg: 'icon-xs', // 14px\n} as const\n\n// Dot sizes per badge size\nconst badgeDotSizes = {\n sm: 'w-1 h-1',\n default: 'w-1.5 h-1.5',\n lg: 'w-1.5 h-1.5',\n} as const\n\n// Dot colors per color (matches the solid background)\nconst dotColorMap = {\n default: 'bg-foreground',\n primary: 'bg-primary',\n success: 'bg-success',\n warning: 'bg-warning',\n error: 'bg-error',\n info: 'bg-info',\n} as const\n\nexport type BadgeVariant = 'solid' | 'subtle' | 'outline'\nexport type BadgeColor = 'default' | 'primary' | 'success' | 'warning' | 'error' | 'info'\nexport type BadgeSize = 'sm' | 'default' | 'lg'\nexport type BadgeRadius = 'sm' | 'base' | 'md' | 'lg' | 'full'\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLSpanElement>,\n VariantProps<typeof badgeVariants> {\n /** Visual style */\n variant?: BadgeVariant\n /** Semantic color */\n color?: BadgeColor\n /** Leading icon slot */\n icon?: React.ReactNode\n /** Show a status dot before text */\n dot?: boolean\n /** Show a remove button */\n removable?: boolean\n /** Callback when remove button is clicked */\n onRemove?: () => void\n /** Render as child element (Slot pattern) */\n asChild?: boolean\n}\n\nconst Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(\n ({\n className,\n variant = 'subtle',\n color = 'default',\n size,\n radius,\n icon,\n dot = false,\n removable = false,\n onRemove,\n asChild = false,\n children,\n ...props\n }, ref) => {\n const Comp = asChild ? Slot : 'span'\n const resolvedSize = size || 'default'\n\n // Color classes from variant × color map\n const colorClasses = colorMap[color][variant]\n // Outline variant needs border\n const outlineClasses = variant === 'outline' ? 'border bg-transparent' : ''\n\n // Dot color: in solid variant use currentColor (white/foreground), otherwise use semantic color\n const dotColor = variant === 'solid' ? 'bg-current' : dotColorMap[color]\n\n return (\n <Comp\n ref={ref}\n className={cn(\n badgeVariants({ size, radius }),\n colorClasses,\n outlineClasses,\n className\n )}\n {...props}\n >\n {dot && (\n <span\n className={cn('shrink-0 rounded-full', badgeDotSizes[resolvedSize], dotColor)}\n aria-hidden=\"true\"\n />\n )}\n {icon && (\n <span\n className={cn('shrink-0 [&>svg]:w-full [&>svg]:h-full', badgeIconSizes[resolvedSize])}\n aria-hidden=\"true\"\n >\n {icon}\n </span>\n )}\n {children}\n {removable && (\n <button\n type=\"button\"\n className=\"shrink-0 -mr-0.5 ml-0.5 rounded-full p-0.5 opacity-70 hover:opacity-100 transition-opacity focus-visible:focus-ring\"\n onClick={(e) => {\n e.stopPropagation()\n onRemove?.()\n }}\n aria-label=\"Remove\"\n >\n <svg\n className=\"w-3 h-3\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n strokeWidth={2}\n aria-hidden=\"true\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18L18 6M6 6l12 12\"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