@luxfi/ui 8.2.7 → 8.2.8

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 (240) hide show
  1. package/dist/3d-model-viewer.cjs +25 -421
  2. package/dist/3d-model-viewer.js +20 -416
  3. package/dist/accordion.cjs +3 -10
  4. package/dist/accordion.js +2 -10
  5. package/dist/advanced-navigation-bar.cjs +5 -401
  6. package/dist/advanced-navigation-bar.js +5 -401
  7. package/dist/ai-agents.cjs +45 -890
  8. package/dist/ai-agents.js +8 -834
  9. package/dist/ai-assistant.cjs +13 -740
  10. package/dist/ai-assistant.js +10 -738
  11. package/dist/ai-chat.cjs +24 -770
  12. package/dist/ai-chat.js +18 -765
  13. package/dist/ai-code.cjs +67 -923
  14. package/dist/ai-code.js +49 -905
  15. package/dist/ai-playground.cjs +25 -801
  16. package/dist/ai-playground.js +18 -795
  17. package/dist/ai-tools.cjs +22 -767
  18. package/dist/ai-tools.js +15 -761
  19. package/dist/ai-vision.cjs +41 -993
  20. package/dist/ai-vision.js +30 -983
  21. package/dist/ai-voice-settings.cjs +35 -1006
  22. package/dist/ai-voice-settings.js +32 -1004
  23. package/dist/ai-voice.cjs +51 -1024
  24. package/dist/ai-voice.js +9 -963
  25. package/dist/alert.cjs +11 -129
  26. package/dist/alert.js +8 -127
  27. package/dist/announcement.cjs +6 -402
  28. package/dist/announcement.js +6 -402
  29. package/dist/app-switcher-navigation-bar.cjs +5 -401
  30. package/dist/app-switcher-navigation-bar.js +5 -401
  31. package/dist/apple-cards-carousel.cjs +84 -480
  32. package/dist/apple-cards-carousel.js +19 -415
  33. package/dist/auth.cjs +10 -387
  34. package/dist/auth.js +7 -385
  35. package/dist/avatar.cjs +2 -9
  36. package/dist/avatar.js +2 -10
  37. package/dist/badge.cjs +8 -228
  38. package/dist/badge.js +5 -210
  39. package/dist/button.cjs +14 -67
  40. package/dist/button.js +12 -65
  41. package/dist/chrome.cjs +29 -493
  42. package/dist/chrome.js +9 -474
  43. package/dist/code-block.cjs +16 -664
  44. package/dist/code-block.js +13 -662
  45. package/dist/code-compare.cjs +28 -1302
  46. package/dist/code-compare.js +18 -1293
  47. package/dist/code-diff.cjs +21 -669
  48. package/dist/code-diff.js +17 -666
  49. package/dist/code-editor.cjs +13 -409
  50. package/dist/code-editor.js +12 -408
  51. package/dist/code-explorer.cjs +14 -456
  52. package/dist/code-explorer.js +13 -456
  53. package/dist/code-preview.cjs +31 -983
  54. package/dist/code-preview.js +23 -976
  55. package/dist/code-snippet.cjs +19 -667
  56. package/dist/code-snippet.js +14 -663
  57. package/dist/code-terminal.cjs +24 -485
  58. package/dist/code-terminal.js +19 -481
  59. package/dist/collapsible.cjs +13 -347
  60. package/dist/collapsible.js +11 -330
  61. package/dist/color-picker.cjs +8 -450
  62. package/dist/color-picker.js +7 -450
  63. package/dist/combobox.cjs +6 -402
  64. package/dist/combobox.js +6 -402
  65. package/dist/communication-navigation-bar.cjs +7 -403
  66. package/dist/communication-navigation-bar.js +5 -401
  67. package/dist/dashboard-navigation-bar.cjs +6 -402
  68. package/dist/dashboard-navigation-bar.js +5 -401
  69. package/dist/dialog-stack.cjs +5 -401
  70. package/dist/dialog-stack.js +5 -401
  71. package/dist/dialog.cjs +13 -70
  72. package/dist/dialog.js +13 -70
  73. package/dist/drawer.cjs +23 -99
  74. package/dist/drawer.js +19 -96
  75. package/dist/e-commerce-navigation-bar.cjs +7 -403
  76. package/dist/e-commerce-navigation-bar.js +5 -401
  77. package/dist/editor.cjs +9 -405
  78. package/dist/editor.js +6 -402
  79. package/dist/iam.cjs +2 -123
  80. package/dist/iam.js +1 -122
  81. package/dist/icon-button.cjs +2 -56
  82. package/dist/icon-button.js +1 -55
  83. package/dist/identity.cjs +28 -242
  84. package/dist/identity.js +20 -235
  85. package/dist/image-crop.cjs +10 -406
  86. package/dist/image-crop.js +7 -403
  87. package/dist/image.cjs +14 -83
  88. package/dist/image.js +13 -67
  89. package/dist/index.cjs +1868 -38770
  90. package/dist/index.js +174 -38320
  91. package/dist/input-group.cjs +3 -10
  92. package/dist/input-group.js +2 -10
  93. package/dist/item.cjs +2 -27
  94. package/dist/item.js +1 -22
  95. package/dist/kanban.cjs +25 -751
  96. package/dist/kanban.js +15 -742
  97. package/dist/limelight-nav.cjs +10 -452
  98. package/dist/limelight-nav.js +9 -452
  99. package/dist/link.cjs +11 -80
  100. package/dist/link.js +6 -60
  101. package/dist/lux.config.cjs +14 -32
  102. package/dist/lux.config.js +3 -26
  103. package/dist/menu.cjs +5 -13
  104. package/dist/menu.js +1 -9
  105. package/dist/message-dock.cjs +5 -401
  106. package/dist/message-dock.js +5 -401
  107. package/dist/mini-calendar.cjs +7 -403
  108. package/dist/mini-calendar.js +6 -402
  109. package/dist/music-player.cjs +30 -528
  110. package/dist/music-player.js +22 -520
  111. package/dist/next.cjs +8 -89
  112. package/dist/next.js +3 -86
  113. package/dist/popover.cjs +17 -74
  114. package/dist/popover.js +16 -73
  115. package/dist/progress-circle.cjs +3 -10
  116. package/dist/progress-circle.js +2 -10
  117. package/dist/provider.cjs +7 -176
  118. package/dist/provider.js +4 -174
  119. package/dist/select.cjs +36 -89
  120. package/dist/select.js +35 -88
  121. package/dist/sidebar.cjs +22 -493
  122. package/dist/sidebar.js +17 -489
  123. package/dist/site/commerce/ui/context.cjs +9 -214
  124. package/dist/site/commerce/ui/context.js +6 -215
  125. package/dist/site/components/analytics.cjs +2 -42
  126. package/dist/site/components/analytics.js +1 -37
  127. package/dist/site/components/auth/callback.cjs +2 -8
  128. package/dist/site/components/auth/callback.js +1 -7
  129. package/dist/site/components/auth/login-panel.cjs +15 -74
  130. package/dist/site/components/auth/login-panel.js +12 -73
  131. package/dist/site/components/auth/login.cjs +2 -6
  132. package/dist/site/components/auth/login.js +1 -5
  133. package/dist/site/components/auth/widget.cjs +2 -6
  134. package/dist/site/components/auth/widget.js +1 -5
  135. package/dist/site/components/commerce/bag-button.cjs +2 -3
  136. package/dist/site/components/commerce/bag-button.js +2 -3
  137. package/dist/site/components/commerce/buy-button.cjs +2 -11
  138. package/dist/site/components/commerce/buy-button.js +1 -10
  139. package/dist/site/components/commerce/checkout-button.cjs +2 -3
  140. package/dist/site/components/commerce/checkout-button.js +2 -3
  141. package/dist/site/components/commerce/checkout-panel/desktop-cp.cjs +15 -173
  142. package/dist/site/components/commerce/checkout-panel/desktop-cp.js +14 -174
  143. package/dist/site/components/commerce/checkout-panel/index.cjs +9 -400
  144. package/dist/site/components/commerce/checkout-panel/index.js +10 -403
  145. package/dist/site/components/commerce/checkout-panel/mobile-cp.cjs +15 -236
  146. package/dist/site/components/commerce/checkout-panel/mobile-cp.js +13 -237
  147. package/dist/site/components/commerce/desktop-bag-popup.cjs +7 -8
  148. package/dist/site/components/commerce/desktop-bag-popup.js +3 -8
  149. package/dist/site/components/commerce/drawer/index.cjs +15 -289
  150. package/dist/site/components/commerce/drawer/index.js +10 -290
  151. package/dist/site/components/commerce/drawer/micro.cjs +8 -115
  152. package/dist/site/components/commerce/drawer/micro.js +4 -115
  153. package/dist/site/components/commerce/drawer/shell.cjs +2 -10
  154. package/dist/site/components/commerce/drawer/shell.js +2 -10
  155. package/dist/site/components/contact-dialog/index.cjs +6 -69
  156. package/dist/site/components/contact-dialog/index.js +7 -71
  157. package/dist/site/components/drawer-margin.cjs +2 -10
  158. package/dist/site/components/drawer-margin.js +2 -10
  159. package/dist/site/components/footer.cjs +11 -81
  160. package/dist/site/components/footer.js +8 -80
  161. package/dist/site/components/header/desktop.cjs +18 -374
  162. package/dist/site/components/header/desktop.js +12 -355
  163. package/dist/site/components/header/index.cjs +9 -674
  164. package/dist/site/components/header/index.js +8 -657
  165. package/dist/site/components/header/mobile-bag-drawer.cjs +6 -71
  166. package/dist/site/components/header/mobile-bag-drawer.js +5 -74
  167. package/dist/site/components/header/mobile-nav-menu-ai.cjs +25 -28
  168. package/dist/site/components/header/mobile-nav-menu-ai.js +24 -27
  169. package/dist/site/components/header/mobile-nav-menu-item.cjs +6 -60
  170. package/dist/site/components/header/mobile-nav-menu-item.js +6 -61
  171. package/dist/site/components/header/mobile-nav-menu.cjs +7 -110
  172. package/dist/site/components/header/mobile-nav-menu.js +7 -112
  173. package/dist/site/components/header/mobile.cjs +48 -330
  174. package/dist/site/components/header/mobile.js +42 -330
  175. package/dist/site/components/icons/index.cjs +34 -35
  176. package/dist/site/components/icons/index.js +5 -33
  177. package/dist/site/components/index.cjs +118 -1961
  178. package/dist/site/components/index.js +23 -1951
  179. package/dist/site/components/mini-chart/index.cjs +7 -90
  180. package/dist/site/components/mini-chart/index.js +1 -92
  181. package/dist/site/components/mini-chart/wrapper.cjs +7 -76
  182. package/dist/site/components/mini-chart/wrapper.js +4 -77
  183. package/dist/site/components/not-found/index.cjs +9 -819
  184. package/dist/site/components/not-found/index.js +8 -802
  185. package/dist/site/components/security/index.cjs +9 -819
  186. package/dist/site/components/security/index.js +8 -802
  187. package/dist/site/next/analytics/index.cjs +16 -49
  188. package/dist/site/next/analytics/index.js +3 -49
  189. package/dist/site/next/analytics/pixel-analytics.cjs +23 -8
  190. package/dist/site/next/analytics/pixel-analytics.js +4 -8
  191. package/dist/site/next/index.cjs +13 -140
  192. package/dist/site/next/index.js +2 -140
  193. package/dist/site/root-layout/index.cjs +12 -1435
  194. package/dist/site/root-layout/index.css +0 -133
  195. package/dist/site/root-layout/index.js +12 -1416
  196. package/dist/site/site-def/footer/community.cjs +11 -27
  197. package/dist/site/site-def/footer/community.js +2 -18
  198. package/dist/site/site-def/footer/index.cjs +38 -218
  199. package/dist/site/site-def/footer/index.js +14 -215
  200. package/dist/site/site-def/index.cjs +28 -620
  201. package/dist/site/site-def/index.js +3 -624
  202. package/dist/table.cjs +20 -338
  203. package/dist/table.js +19 -338
  204. package/dist/tabs.cjs +3 -10
  205. package/dist/tabs.js +1 -9
  206. package/dist/tag.cjs +9 -270
  207. package/dist/tag.js +6 -268
  208. package/dist/tags.cjs +6 -314
  209. package/dist/tags.js +5 -314
  210. package/dist/textarea.cjs +4 -50
  211. package/dist/textarea.js +3 -49
  212. package/dist/tooltip.cjs +15 -34
  213. package/dist/tooltip.js +13 -33
  214. package/dist/vite.cjs +3 -82
  215. package/dist/vite.js +1 -80
  216. package/package.json +1 -1
  217. package/dist/index.css +0 -132
  218. package/dist/site/components/auth/login-panel.css +0 -4
  219. package/dist/site/components/commerce/bag-button.css +0 -4
  220. package/dist/site/components/commerce/checkout-button.css +0 -4
  221. package/dist/site/components/commerce/checkout-panel/desktop-cp.css +0 -132
  222. package/dist/site/components/commerce/checkout-panel/index.css +0 -132
  223. package/dist/site/components/commerce/checkout-panel/mobile-cp.css +0 -132
  224. package/dist/site/components/commerce/desktop-bag-popup.css +0 -4
  225. package/dist/site/components/commerce/drawer/index.css +0 -132
  226. package/dist/site/components/commerce/drawer/micro.css +0 -4
  227. package/dist/site/components/header/desktop.css +0 -4
  228. package/dist/site/components/header/index.css +0 -132
  229. package/dist/site/components/header/mobile-bag-drawer.css +0 -4
  230. package/dist/site/components/header/mobile-nav-menu-ai.css +0 -132
  231. package/dist/site/components/header/mobile-nav-menu-item.css +0 -132
  232. package/dist/site/components/header/mobile-nav-menu.css +0 -132
  233. package/dist/site/components/header/mobile.css +0 -132
  234. package/dist/site/components/icons/index.css +0 -4
  235. package/dist/site/components/index.css +0 -132
  236. package/dist/site/components/not-found/index.css +0 -132
  237. package/dist/site/components/security/index.css +0 -132
  238. package/dist/site/site-def/footer/community.css +0 -4
  239. package/dist/site/site-def/footer/index.css +0 -4
  240. package/dist/site/site-def/index.css +0 -4
package/dist/ai-vision.js CHANGED
@@ -1,969 +1,16 @@
1
1
  'use client';
2
- import * as React10 from 'react';
3
- import React10__default, { Children, createElement } from 'react';
2
+ import * as React from 'react';
4
3
  import { Upload, Link, Camera, Loader2, Eye, Target, Type, Smile, Download, FileText, Copy, Tag, Palette, BarChart3 } from 'lucide-react';
5
4
  import { toast } from 'sonner';
6
- import { Box, sx, cn, Label as Label$1, Tabs, TabsList, TabsTrigger, TabsContent, css, ScrollArea, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, Card, CardHeader, CardTitle, CardContent } from '@hanzo/ui';
7
- import { TooltipGroup, Tooltip as Tooltip$1, Text, XStack, styled, View, Input as Input$1, YStack, Slider as Slider$1, Label, Switch, VisuallyHidden, TextArea } from '@hanzo/gui';
8
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
- import { useClickAway } from '@uidotdev/usehooks';
5
+ import { Box, cn, Label, sx, Tabs, TabsList, TabsTrigger, TabsContent, css, ScrollArea, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, Card, CardHeader, CardTitle, CardContent } from '@hanzo/ui';
6
+ import { Badge } from './badge.js';
7
+ import { Button } from './button.js';
8
+ import { Input } from './input.js';
9
+ import { Slider } from './slider.js';
10
+ import { Switch } from './switch.js';
11
+ import { Textarea } from './textarea.js';
12
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
10
13
 
11
- var SKELETON_CLASSES = "lux-skeleton rounded-sm";
12
- var Skeleton = React10.forwardRef(
13
- function Skeleton2(props, ref) {
14
- const { loading = true, asChild, className, children, style, ...rest } = props;
15
- if (!loading) {
16
- if (asChild && React10.isValidElement(children)) return children;
17
- return /* @__PURE__ */ jsx(Box, { ref, className, style, ...rest, children });
18
- }
19
- return /* @__PURE__ */ jsx(
20
- "div",
21
- {
22
- ref,
23
- "data-loading": true,
24
- ...sx(
25
- SKELETON_CLASSES,
26
- asChild || children ? "[&_*]:invisible" : "min-h-5",
27
- className
28
- ),
29
- style,
30
- ...rest,
31
- children
32
- }
33
- );
34
- }
35
- );
36
- React10.forwardRef(
37
- function SkeletonCircle2(props, ref) {
38
- const { size = 40, loading = true, className, ...rest } = props;
39
- const dimension = typeof size === "number" ? `${size}px` : size;
40
- return /* @__PURE__ */ jsx(
41
- Skeleton,
42
- {
43
- ref,
44
- loading,
45
- ...sx("rounded-full shrink-0", className),
46
- style: { width: dimension, height: dimension, ...rest.style },
47
- ...rest
48
- }
49
- );
50
- }
51
- );
52
- React10.forwardRef(
53
- function SkeletonText2(props, ref) {
54
- const { noOfLines = 3, loading = true, className, ...rest } = props;
55
- return /* @__PURE__ */ jsx(Box, { ref, className: cn("flex w-full flex-col gap-2", className), ...rest, children: Array.from({ length: noOfLines }).map((_, index) => /* @__PURE__ */ jsx(
56
- Skeleton,
57
- {
58
- loading,
59
- ...sx(cn("h-4", index === noOfLines - 1 && "max-w-[80%]"))
60
- },
61
- index
62
- )) });
63
- }
64
- );
65
- var ink = (children, Wrap = Text, props = {}) => {
66
- let hasText = false;
67
- Children.forEach(children, (child) => {
68
- if (typeof child === "string" || typeof child === "number") hasText = true;
69
- });
70
- if (!hasText) return children;
71
- return Children.map(children, (child) => typeof child === "string" || typeof child === "number" ? createElement(Wrap, props, child) : child);
72
- };
73
- var TOUCH_PX = 1024;
74
- function useBelow(px) {
75
- const [below, setBelow] = React10.useState(false);
76
- React10.useEffect(() => {
77
- const mql = window.matchMedia(`(max-width: ${px - 1}px)`);
78
- const apply = () => setBelow(mql.matches);
79
- apply();
80
- mql.addEventListener("change", apply);
81
- return () => mql.removeEventListener("change", apply);
82
- }, [px]);
83
- return below;
84
- }
85
- var useIsTouch = () => useBelow(TOUCH_PX);
86
- function mapPlacement(p) {
87
- if (!p) return void 0;
88
- return p;
89
- }
90
- var Tooltip = React10.forwardRef(
91
- function Tooltip2(props, ref) {
92
- const {
93
- showArrow: showArrowProp,
94
- onOpenChange,
95
- variant,
96
- selected,
97
- children,
98
- disabled,
99
- disableOnMobile,
100
- content,
101
- contentProps,
102
- defaultOpen = false,
103
- triggerProps,
104
- closeDelay = 100,
105
- openDelay = 100,
106
- interactive,
107
- positioning
108
- } = props;
109
- const [open, setOpen] = React10.useState(defaultOpen);
110
- const timeoutRef = React10.useRef(null);
111
- const isMobile = useIsTouch();
112
- const handleOpenChange = React10.useCallback((nextOpen) => {
113
- setOpen(nextOpen);
114
- onOpenChange?.({ open: nextOpen });
115
- }, [onOpenChange]);
116
- const handleOpenChangeManual = React10.useCallback((nextOpen) => {
117
- timeoutRef.current && window.clearTimeout(timeoutRef.current);
118
- timeoutRef.current = window.setTimeout(() => {
119
- setOpen(nextOpen);
120
- onOpenChange?.({ open: nextOpen });
121
- }, nextOpen ? openDelay : closeDelay);
122
- }, [closeDelay, openDelay, onOpenChange]);
123
- const handleClickAway = React10.useCallback(() => {
124
- if (open) handleOpenChangeManual(false);
125
- }, [open, handleOpenChangeManual]);
126
- const triggerRef = useClickAway(handleClickAway);
127
- const handleTriggerClick = React10.useCallback(() => {
128
- handleOpenChangeManual(!open);
129
- }, [handleOpenChangeManual, open]);
130
- const handleContentClick = React10.useCallback((event) => {
131
- event.stopPropagation();
132
- if (interactive) {
133
- const closestLink = event.target?.closest("a");
134
- if (closestLink) {
135
- handleOpenChangeManual(false);
136
- }
137
- }
138
- }, [interactive, handleOpenChangeManual]);
139
- React10.useEffect(() => {
140
- return () => {
141
- if (timeoutRef.current) {
142
- clearTimeout(timeoutRef.current);
143
- }
144
- };
145
- }, []);
146
- if (disabled || disableOnMobile && isMobile) return children;
147
- const defaultShowArrow = variant === "popover" ? false : true;
148
- const showArrow = showArrowProp !== void 0 ? showArrowProp : defaultShowArrow;
149
- const isPopover = variant === "popover";
150
- const placement = mapPlacement(positioning?.placement) ?? "top";
151
- const offset = positioning?.offset?.mainAxis ?? 4;
152
- return /* @__PURE__ */ jsx(TooltipGroup, { delay: openDelay, children: /* @__PURE__ */ jsxs(
153
- Tooltip$1,
154
- {
155
- open,
156
- onOpenChange: handleOpenChange,
157
- delay: { open: openDelay, close: closeDelay },
158
- placement,
159
- offset,
160
- unstyled: true,
161
- children: [
162
- /* @__PURE__ */ jsx(
163
- Tooltip$1.Trigger,
164
- {
165
- ref: triggerRef,
166
- asChild: true,
167
- ...isMobile ? { onClick: handleTriggerClick } : {},
168
- ...triggerProps,
169
- children
170
- }
171
- ),
172
- /* @__PURE__ */ jsxs(
173
- Tooltip$1.Content,
174
- {
175
- ref,
176
- unstyled: true,
177
- zIndex: 9999,
178
- overflow: "hidden",
179
- borderRadius: 8,
180
- paddingHorizontal: 12,
181
- paddingVertical: 8,
182
- maxWidth: isPopover ? 384 : 320,
183
- backgroundColor: isPopover ? "var(--color-popover-bg)" : "var(--color-tooltip-bg)",
184
- transition: "quick",
185
- enterStyle: { opacity: 0, scale: 0.95 },
186
- exitStyle: { opacity: 0, scale: 0.95 },
187
- ...isPopover ? {
188
- borderWidth: 1,
189
- borderColor: "var(--color-border-divider)",
190
- shadowColor: "var(--shadow-popover)"
191
- } : {},
192
- onClick: interactive ? handleContentClick : void 0,
193
- ...selected ? { "data-selected": true } : {},
194
- ...contentProps,
195
- children: [
196
- showArrow && /* @__PURE__ */ jsx(
197
- Tooltip$1.Arrow,
198
- {
199
- unstyled: true,
200
- backgroundColor: isPopover ? "var(--color-popover-bg)" : "var(--color-tooltip-bg)"
201
- }
202
- ),
203
- ink(content, void 0, {
204
- fontSize: 14,
205
- color: isPopover ? "var(--color-text-primary)" : "var(--color-tooltip-fg)"
206
- })
207
- ]
208
- }
209
- )
210
- ]
211
- }
212
- ) });
213
- }
214
- );
215
- function TruncatedTextTooltip({ label, children }) {
216
- return /* @__PURE__ */ jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
217
- }
218
- var SIZE = {
219
- sm: { padding: 4, height: 18, minHeight: 18 },
220
- md: { paddingHorizontal: 4, paddingVertical: 2, minHeight: 24 },
221
- lg: { paddingHorizontal: 8, paddingVertical: 4, minHeight: 28 }
222
- };
223
- var SIZE_TEXT = {
224
- sm: { fontSize: 12, fontWeight: "500" },
225
- md: { fontSize: 14, fontWeight: "500" },
226
- lg: { fontSize: 14, fontWeight: "600" }
227
- };
228
- var COLOR_PALETTE = {
229
- gray: { bg: "var(--color-badge-gray-bg)", fg: "var(--color-badge-gray-fg)" },
230
- green: { bg: "var(--color-badge-green-bg)", fg: "var(--color-badge-green-fg)" },
231
- red: { bg: "var(--color-badge-red-bg)", fg: "var(--color-badge-red-fg)" },
232
- purple: { bg: "var(--color-badge-purple-bg)", fg: "var(--color-badge-purple-fg)" },
233
- orange: { bg: "var(--color-badge-orange-bg)", fg: "var(--color-badge-orange-fg)" },
234
- blue: { bg: "var(--color-badge-blue-bg)", fg: "var(--color-badge-blue-fg)" },
235
- yellow: { bg: "var(--color-badge-yellow-bg)", fg: "var(--color-badge-yellow-fg)" },
236
- teal: { bg: "var(--color-badge-teal-bg)", fg: "var(--color-badge-teal-fg)" },
237
- cyan: { bg: "var(--color-badge-cyan-bg)", fg: "var(--color-badge-cyan-fg)" },
238
- pink: { bg: "var(--color-badge-pink-bg)", fg: "var(--color-badge-pink-fg)" },
239
- purple_alt: { bg: "var(--color-badge-purple-alt-bg)", fg: "var(--color-badge-purple-alt-fg)" },
240
- blue_alt: { bg: "var(--color-badge-blue-alt-bg)", fg: "var(--color-badge-blue-alt-fg)" },
241
- bright_gray: { bg: "var(--color-badge-bright-gray-bg)", fg: "var(--color-badge-bright-gray-fg)" },
242
- bright_green: { bg: "var(--color-badge-bright-green-bg)", fg: "var(--color-badge-bright-green-fg)" },
243
- bright_red: { bg: "var(--color-badge-bright-red-bg)", fg: "var(--color-badge-bright-red-fg)" },
244
- bright_blue: { bg: "var(--color-badge-bright-blue-bg)", fg: "var(--color-badge-bright-blue-fg)" },
245
- bright_yellow: { bg: "var(--color-badge-bright-yellow-bg)", fg: "var(--color-badge-bright-yellow-fg)" },
246
- bright_teal: { bg: "var(--color-badge-bright-teal-bg)", fg: "var(--color-badge-bright-teal-fg)" },
247
- bright_cyan: { bg: "var(--color-badge-bright-cyan-bg)", fg: "var(--color-badge-bright-cyan-fg)" },
248
- bright_orange: { bg: "var(--color-badge-bright-orange-bg)", fg: "var(--color-badge-bright-orange-fg)" },
249
- bright_purple: { bg: "var(--color-badge-bright-purple-bg)", fg: "var(--color-badge-bright-purple-fg)" },
250
- bright_pink: { bg: "var(--color-badge-bright-pink-bg)", fg: "var(--color-badge-bright-pink-fg)" }
251
- };
252
- var TONE = {
253
- subtle: (p) => ({ backgroundColor: p.bg, color: p.fg, borderWidth: 0 }),
254
- solid: (p) => ({ backgroundColor: p.fg, color: p.bg, borderWidth: 0 }),
255
- outline: (p) => ({
256
- backgroundColor: "transparent",
257
- color: p.fg,
258
- borderWidth: 1,
259
- borderColor: p.fg
260
- })
261
- };
262
- var Badge = React10__default.forwardRef(
263
- function Badge2(props, ref) {
264
- const {
265
- loading,
266
- startElement,
267
- children,
268
- truncated = false,
269
- endElement,
270
- variant = "subtle",
271
- size = "md",
272
- colorPalette = "gray",
273
- className,
274
- style: badgeStyle,
275
- ...rest
276
- } = props;
277
- const palette = COLOR_PALETTE[colorPalette];
278
- const tone = TONE[variant](palette);
279
- const child = children ? (
280
- // `ellipsis` is gui Text's own built-in variant for single-line
281
- // truncation — it expands to the same overflow/text-overflow/
282
- // white-space/max-width rule Tailwind's `text-ellipsis` did, but
283
- // through the component's own variants (guaranteed to compile),
284
- // rather than naming each longhand as a separate style prop.
285
- /* @__PURE__ */ jsx(Text, { ellipsis: true, ...SIZE_TEXT[size], color: tone.color, children })
286
- ) : null;
287
- const childrenElement = truncated ? /* @__PURE__ */ jsx(TruncatedTextTooltip, { label: children, children: child }) : child;
288
- const badgeElement = /* @__PURE__ */ jsxs(
289
- XStack,
290
- {
291
- ref,
292
- render: /* @__PURE__ */ jsx("span", {}),
293
- display: "inline-flex",
294
- alignItems: "center",
295
- alignSelf: "flex-start",
296
- borderRadius: 2,
297
- gap: 4,
298
- maxWidth: "100%",
299
- userSelect: "text",
300
- ...SIZE[size],
301
- ...tone,
302
- className,
303
- style: badgeStyle,
304
- ...rest,
305
- children: [
306
- startElement,
307
- childrenElement,
308
- endElement
309
- ]
310
- }
311
- );
312
- if (loading) {
313
- return /* @__PURE__ */ jsx(Skeleton, { loading, asChild: true, children: badgeElement });
314
- }
315
- return badgeElement;
316
- }
317
- );
318
- var SpinnerFrame = styled(View, {
319
- name: "ButtonSpinner",
320
- render: /* @__PURE__ */ jsx("span", {}),
321
- width: 16,
322
- height: 16,
323
- borderRadius: 1e3,
324
- borderWidth: 2,
325
- borderColor: "currentColor",
326
- borderBottomColor: "transparent",
327
- borderLeftColor: "transparent"
328
- });
329
- function Spinner({ className }) {
330
- return /* @__PURE__ */ jsx(
331
- SpinnerFrame,
332
- {
333
- role: "status",
334
- "aria-label": "Loading",
335
- className: [
336
- "animate-spin",
337
- className
338
- ].filter(Boolean).join(" ")
339
- }
340
- );
341
- }
342
- var ButtonFrame = styled(View, {
343
- name: "LuxButton",
344
- render: /* @__PURE__ */ jsx("button", { type: "button" }),
345
- role: "button",
346
- tabIndex: 0,
347
- cursor: "pointer",
348
- userSelect: "none",
349
- display: "inline-flex",
350
- alignItems: "center",
351
- justifyContent: "center",
352
- gap: 0,
353
- overflow: "hidden",
354
- borderRadius: 6,
355
- // Whitespace nowrap via className since hanzogui doesn't have a direct token
356
- // Transition via className
357
- variants: {
358
- size: {
359
- "2xs": { paddingHorizontal: 8, height: 20, minWidth: 20, fontSize: 12, borderRadius: 4, gap: 4 },
360
- xs: { paddingHorizontal: 8, height: 24, minWidth: 24, fontSize: 14, borderRadius: 4, gap: 4 },
361
- sm: { paddingHorizontal: 12, height: 32, minWidth: 32, fontSize: 14, borderRadius: 6, gap: 4 },
362
- md: { paddingHorizontal: 12, height: 40, minWidth: 40, fontSize: 16, borderRadius: 6, gap: 8 }
363
- },
364
- disabled: {
365
- true: {
366
- opacity: 0.2,
367
- cursor: "not-allowed",
368
- pointerEvents: "none"
369
- }
370
- }
371
- },
372
- defaultVariants: {
373
- size: "md"
374
- }
375
- });
376
- var VARIANT_CLASSES = {
377
- solid: [
378
- "bg-[var(--color-button-solid-bg)] text-[var(--color-button-solid-text)]",
379
- "hover:bg-[var(--color-hover)]",
380
- "data-[expanded]:bg-[var(--color-hover)]"
381
- ].join(" "),
382
- solid_danger: [
383
- "bg-[var(--color-button-danger-bg)] text-[var(--color-button-danger-fg)]",
384
- "hover:bg-[var(--color-button-danger-bg-hover)]",
385
- "data-[expanded]:bg-[var(--color-button-danger-bg-hover)]"
386
- ].join(" "),
387
- outline: [
388
- "border-2 border-solid bg-transparent",
389
- "text-[var(--color-button-outline-fg)] border-[var(--color-button-outline-fg)]",
390
- "hover:bg-transparent hover:text-[var(--color-hover)] hover:border-[var(--color-hover)]"
391
- ].join(" "),
392
- outline_danger: [
393
- "border-2 border-solid bg-transparent",
394
- "text-[var(--color-button-danger-bg)] border-[var(--color-button-danger-bg)]",
395
- "hover:bg-transparent hover:text-[var(--color-button-danger-bg-hover)] hover:border-[var(--color-button-danger-bg-hover)]"
396
- ].join(" "),
397
- dropdown: [
398
- "border-2 border-solid bg-transparent",
399
- "text-[var(--color-button-dropdown-fg)] border-[var(--color-button-dropdown-border)]",
400
- "hover:bg-transparent hover:text-[var(--color-hover)] hover:border-[var(--color-hover)]",
401
- "data-[expanded]:bg-transparent data-[expanded]:text-[var(--color-hover)] data-[expanded]:border-[var(--color-hover)]",
402
- "data-[selected]:bg-[var(--color-selected-control-bg)] data-[selected]:text-[var(--color-selected-control-text)] data-[selected]:border-transparent",
403
- "data-[selected]:hover:bg-[var(--color-selected-control-bg)]",
404
- "data-[selected]:hover:text-[var(--color-hover)] data-[selected]:hover:border-transparent",
405
- "data-[selected]:data-[expanded]:text-[var(--color-hover)]"
406
- ].join(" "),
407
- header: [
408
- "bg-transparent border-2 border-solid",
409
- "text-[var(--color-button-header-fg)] border-[var(--color-button-header-border)]",
410
- "hover:bg-transparent hover:text-[var(--color-hover)] hover:border-[var(--color-hover)]",
411
- "data-[selected]:bg-[var(--color-button-header-bg-selected)]",
412
- "data-[selected]:text-[var(--color-button-header-fg-selected)] data-[selected]:border-transparent data-[selected]:border-0",
413
- "data-[selected]:hover:bg-[var(--color-button-header-bg-selected)] data-[selected]:hover:text-[var(--color-hover)]",
414
- "data-[selected]:data-[expanded]:text-[var(--color-hover)]",
415
- "data-[selected]:data-[highlighted]:bg-[var(--color-button-header-bg-highlighted)]",
416
- "data-[selected]:data-[highlighted]:text-[var(--color-button-header-fg-highlighted)]",
417
- "data-[selected]:data-[highlighted]:border-transparent data-[selected]:data-[highlighted]:border-0",
418
- "data-[selected]:data-[highlighted]:hover:bg-[var(--color-button-header-bg-highlighted)]",
419
- "data-[selected]:data-[highlighted]:hover:text-[var(--color-hover)]",
420
- "data-[selected]:data-[highlighted]:data-[expanded]:text-[var(--color-hover)]"
421
- ].join(" "),
422
- hero: [
423
- "bg-[var(--color-button-hero-bg)] text-[var(--color-button-hero-fg)]",
424
- "hover:bg-[var(--color-button-hero-bg-hover)] hover:text-[var(--color-button-hero-fg-hover)]",
425
- "data-[selected]:bg-[var(--color-button-hero-bg-selected)] data-[selected]:text-[var(--color-button-hero-fg-selected)]",
426
- "data-[selected]:hover:bg-[var(--color-button-hero-bg-selected)] data-[selected]:hover:text-[var(--color-hover)]",
427
- "data-[selected]:data-[expanded]:text-[var(--color-hover)]"
428
- ].join(" "),
429
- segmented: [
430
- "bg-transparent border-2 border-solid rounded-none",
431
- "text-[var(--color-button-segmented-fg)] border-[var(--color-selected-control-bg)]",
432
- "hover:text-[var(--color-hover)]",
433
- "data-[selected]:bg-[var(--color-selected-control-bg)] data-[selected]:text-[var(--color-selected-control-text)]",
434
- "data-[selected]:hover:bg-[var(--color-selected-control-bg)] data-[selected]:hover:text-[var(--color-selected-control-text)]",
435
- "[&:not(:last-child)]:border-r-0 data-[selected]:[&:not(:last-child)]:border-r-2",
436
- "data-[selected]+*:border-l-0",
437
- "first:rounded-l-md last:rounded-r-md"
438
- ].join(" "),
439
- plain: "bg-transparent text-inherit border-none hover:bg-transparent",
440
- subtle: [
441
- "bg-[var(--color-button-subtle-bg)] text-[var(--color-button-subtle-fg)]",
442
- "hover:bg-[var(--color-button-subtle-bg)] hover:text-[var(--color-hover)]",
443
- "disabled:bg-[var(--color-button-subtle-bg)] disabled:text-[var(--color-button-subtle-fg)]"
444
- ].join(" "),
445
- link: [
446
- "bg-transparent text-[var(--color-link-primary)] border-none font-normal",
447
- "px-0 h-auto",
448
- "hover:bg-transparent hover:text-[var(--color-link-primary-hover)]",
449
- "disabled:text-[var(--color-text-secondary)]"
450
- ].join(" "),
451
- icon_secondary: [
452
- "bg-transparent text-[var(--color-icon-secondary)] border-none",
453
- "hover:text-[var(--color-hover)]",
454
- "data-[selected]:bg-[var(--color-selected-control-bg)] data-[selected]:text-[var(--color-selected-control-text)]",
455
- "data-[selected]:hover:bg-[var(--color-selected-control-bg)] data-[selected]:hover:text-[var(--color-hover)]",
456
- "data-[selected]:data-[expanded]:text-[var(--color-hover)]",
457
- "data-[expanded]:text-[var(--color-hover)]"
458
- ].join(" "),
459
- icon_background: [
460
- "bg-[var(--color-button-icon-background-bg)] text-[var(--color-icon-secondary)] border-none",
461
- "hover:text-[var(--color-hover)]",
462
- "data-[selected]:bg-[var(--color-selected-control-bg)] data-[selected]:text-[var(--color-selected-control-text)]",
463
- "data-[selected]:hover:bg-[var(--color-selected-control-bg)] data-[selected]:hover:text-[var(--color-hover)]",
464
- "data-[selected]:data-[expanded]:text-[var(--color-hover)]",
465
- "data-[expanded]:text-[var(--color-hover)]"
466
- ].join(" "),
467
- pagination: [
468
- "border-2 border-solid bg-transparent",
469
- "text-[var(--color-button-pagination-fg)] border-[var(--color-button-pagination-border)]",
470
- "hover:bg-transparent hover:text-[var(--color-hover)] hover:border-[var(--color-hover)]",
471
- "data-[selected]:bg-[var(--color-selected-control-bg)] data-[selected]:text-[var(--color-selected-control-text)] data-[selected]:border-transparent",
472
- "data-[selected]:hover:bg-[var(--color-selected-control-bg)]",
473
- "data-[selected]:hover:text-[var(--color-selected-control-text)] data-[selected]:hover:border-transparent"
474
- ].join(" ")
475
- };
476
- var BASE_CLASSES = "font-semibold whitespace-nowrap transition-colors duration-150";
477
- var SP = 4;
478
- function buildShimStyle(props) {
479
- const s = { ...props.style };
480
- if (props.mt !== void 0) s.marginTop = typeof props.mt === "number" ? `${props.mt * SP}px` : props.mt;
481
- if (props.ml !== void 0) s.marginLeft = typeof props.ml === "number" ? `${props.ml * SP}px` : props.ml;
482
- if (props.mr !== void 0) s.marginRight = typeof props.mr === "number" ? `${props.mr * SP}px` : props.mr;
483
- if (props.px !== void 0) {
484
- const v = typeof props.px === "number" ? `${props.px * SP}px` : props.px;
485
- s.paddingLeft = v;
486
- s.paddingRight = v;
487
- }
488
- if (props.py !== void 0) {
489
- const v = typeof props.py === "number" ? `${props.py * SP}px` : props.py;
490
- s.paddingTop = v;
491
- s.paddingBottom = v;
492
- }
493
- if (props.fontWeight !== void 0) s.fontWeight = props.fontWeight;
494
- if (props.gap !== void 0) s.gap = typeof props.gap === "number" ? `${props.gap * SP}px` : props.gap;
495
- if (props.flexShrink !== void 0) s.flexShrink = props.flexShrink;
496
- if (props.columnGap !== void 0) s.columnGap = typeof props.columnGap === "number" ? `${props.columnGap * SP}px` : props.columnGap;
497
- if (props.gridColumn !== void 0) s.gridColumn = typeof props.gridColumn === "number" ? String(props.gridColumn) : props.gridColumn;
498
- if (props.gridRow) s.gridRow = props.gridRow;
499
- if (props.justifySelf) s.justifySelf = props.justifySelf;
500
- if (props.alignSelf) s.alignSelf = props.alignSelf;
501
- if (props.h) s.height = props.h;
502
- if (props.w) s.width = props.w;
503
- if (props.display) s.display = props.display;
504
- if (props.borderBottomRightRadius !== void 0) s.borderBottomRightRadius = typeof props.borderBottomRightRadius === "number" ? `${props.borderBottomRightRadius}px` : props.borderBottomRightRadius;
505
- if (props.borderTopRightRadius !== void 0) s.borderTopRightRadius = typeof props.borderTopRightRadius === "number" ? `${props.borderTopRightRadius}px` : props.borderTopRightRadius;
506
- return Object.keys(s).length > 0 ? s : void 0;
507
- }
508
- var Button = React10.forwardRef(
509
- function Button2(props, ref) {
510
- const {
511
- className,
512
- variant = "solid",
513
- size = "md",
514
- asChild = false,
515
- loading = false,
516
- loadingText,
517
- loadingSkeleton = false,
518
- expanded,
519
- selected,
520
- highlighted,
521
- disabled,
522
- children,
523
- style: styleProp,
524
- // Strip Chakra style props
525
- mt,
526
- ml,
527
- mr,
528
- px,
529
- py,
530
- fontWeight,
531
- gap,
532
- flexShrink,
533
- columnGap,
534
- gridColumn,
535
- gridRow,
536
- justifySelf,
537
- alignSelf,
538
- textStyle: _textStyle,
539
- h,
540
- w,
541
- display,
542
- borderBottomRightRadius,
543
- borderTopRightRadius,
544
- ...rest
545
- } = props;
546
- const mergedStyle = buildShimStyle({
547
- style: styleProp,
548
- mt,
549
- ml,
550
- mr,
551
- px,
552
- py,
553
- fontWeight,
554
- gap,
555
- flexShrink,
556
- columnGap,
557
- gridColumn,
558
- gridRow,
559
- justifySelf,
560
- alignSelf,
561
- h,
562
- w,
563
- display,
564
- borderBottomRightRadius,
565
- borderTopRightRadius
566
- });
567
- const dataAttrs = {};
568
- if (expanded) dataAttrs["data-expanded"] = true;
569
- if (selected) dataAttrs["data-selected"] = true;
570
- if (highlighted) dataAttrs["data-highlighted"] = true;
571
- if (loadingSkeleton) dataAttrs["data-loading-skeleton"] = true;
572
- const isDisabled = !loadingSkeleton && (loading || disabled);
573
- const inner = loading ? /* @__PURE__ */ jsxs(Fragment, { children: [
574
- /* @__PURE__ */ jsx(Spinner, {}),
575
- loadingText != null && /* @__PURE__ */ jsx("span", { style: { marginLeft: 8 }, children: loadingText })
576
- ] }) : children;
577
- const variantClass = VARIANT_CLASSES[variant] ?? VARIANT_CLASSES.solid;
578
- const combinedClassName = [BASE_CLASSES, variantClass, className].filter(Boolean).join(" ");
579
- const button = /* @__PURE__ */ jsx(
580
- ButtonFrame,
581
- {
582
- ref,
583
- size,
584
- disabled: isDisabled || void 0,
585
- asChild: asChild || void 0,
586
- className: combinedClassName,
587
- style: mergedStyle,
588
- ...dataAttrs,
589
- ...rest,
590
- children: inner
591
- }
592
- );
593
- if (loadingSkeleton) {
594
- return /* @__PURE__ */ jsx(Skeleton, { loading: loadingSkeleton, asChild: true, ref, children: button });
595
- }
596
- return button;
597
- }
598
- );
599
- React10.forwardRef(
600
- function ButtonGroup2(props, ref) {
601
- const { className, ...rest } = props;
602
- return /* @__PURE__ */ jsx(
603
- Box,
604
- {
605
- ref,
606
- className: ["inline-flex", className].filter(Boolean).join(" "),
607
- role: "group",
608
- ...rest
609
- }
610
- );
611
- }
612
- );
613
- React10.forwardRef(
614
- function ButtonGroupRadio2(props, ref) {
615
- const {
616
- children,
617
- onChange,
618
- variant = "segmented",
619
- defaultValue,
620
- loading = false,
621
- equalWidth = false,
622
- className,
623
- ...rest
624
- } = props;
625
- const firstChildValue = React10.useMemo(() => {
626
- const firstChild = Array.isArray(children) ? children[0] : void 0;
627
- return typeof firstChild?.props.value === "string" ? firstChild.props.value : void 0;
628
- }, [children]);
629
- const [value, setValue] = React10.useState(defaultValue ?? firstChildValue);
630
- const handleItemClick = React10.useCallback((event) => {
631
- const v = event.currentTarget.value;
632
- setValue(v);
633
- onChange?.(v);
634
- }, [onChange]);
635
- const clonedChildren = React10.Children.map(children, (child) => {
636
- return React10.cloneElement(child, {
637
- onClick: handleItemClick,
638
- selected: value === child.props.value,
639
- variant
640
- });
641
- });
642
- const childrenLength = React10.Children.count(children);
643
- return /* @__PURE__ */ jsx(Skeleton, { loading, children: /* @__PURE__ */ jsx(
644
- Box,
645
- {
646
- ref,
647
- className: [
648
- "inline-flex gap-0",
649
- equalWidth ? "grid" : "",
650
- className
651
- ].filter(Boolean).join(" "),
652
- style: equalWidth ? { gridTemplateColumns: `repeat(${childrenLength}, 1fr)` } : void 0,
653
- role: "group",
654
- ...rest,
655
- children: clonedChildren
656
- }
657
- ) });
658
- }
659
- );
660
- var SIZE2 = {
661
- xs: { height: 24, paddingHorizontal: 8, fontSize: "$1", borderRadius: 4 },
662
- sm: { height: 32, paddingHorizontal: 12, fontSize: "$3", borderRadius: 6 },
663
- md: { height: 40, paddingHorizontal: 16, fontSize: "$5", borderRadius: 6 },
664
- lg: { height: 48, paddingHorizontal: 16, fontSize: "$6", borderRadius: 8 },
665
- "2xl": { height: 56, paddingHorizontal: 16, fontSize: "$7", borderRadius: 8 }
666
- };
667
- var VARIANT = {
668
- outline: { borderWidth: 1, borderStyle: "solid" },
669
- filled: { borderWidth: 0, backgroundColor: "var(--color-input-filled-bg)" },
670
- unstyled: { borderWidth: 0, backgroundColor: "transparent", padding: 0, height: "auto" }
671
- };
672
- var CONTROL = {
673
- width: "100%",
674
- outlineWidth: 0,
675
- backgroundColor: "var(--color-input-bg)",
676
- color: "var(--color-input-fg)",
677
- borderColor: "var(--color-input-border)",
678
- hoverStyle: { borderColor: "var(--color-input-border-hover)" },
679
- focusStyle: { borderColor: "var(--color-input-border-focus)" },
680
- disabledStyle: { opacity: 0.4, cursor: "not-allowed" }
681
- };
682
- var Input = React10__default.forwardRef(
683
- ({ size = "md", variant = "outline", className, onChange, onChangeText, ...rest }, ref) => {
684
- const handleChange = React10__default.useCallback(
685
- (event) => {
686
- onChange?.(event);
687
- onChangeText?.(event.target.value);
688
- },
689
- [onChange, onChangeText]
690
- );
691
- return /* @__PURE__ */ jsx(
692
- Input$1,
693
- {
694
- ref,
695
- unstyled: true,
696
- className: className ? `lux-control ${className}` : "lux-control",
697
- ...CONTROL,
698
- ...SIZE2[size],
699
- ...VARIANT[variant],
700
- ...rest,
701
- onChange: handleChange
702
- }
703
- );
704
- }
705
- );
706
- Input.displayName = "Input";
707
- var MUTED = "var(--color-text-secondary)";
708
- var TRACK = "var(--color-border-divider)";
709
- var ACTIVE = "var(--color-link-primary)";
710
- var ACTIVE_HOVER = "var(--color-link-primary-hover)";
711
- var WHITE = "var(--color-white)";
712
- var Slider = React10.forwardRef(
713
- function Slider2(props, ref) {
714
- const {
715
- marks: marksProp,
716
- label,
717
- showValue,
718
- value,
719
- defaultValue,
720
- min = 0,
721
- max = 100,
722
- step,
723
- disabled,
724
- orientation = "horizontal",
725
- name,
726
- onValueChange,
727
- onValueCommit,
728
- className
729
- } = props;
730
- const resolvedValue = defaultValue ?? value;
731
- const marks = marksProp?.map((mark) => {
732
- if (typeof mark === "number") return { value: mark, label: void 0 };
733
- return mark;
734
- });
735
- const hasMarkLabel = Boolean(marks?.some((mark) => mark.label));
736
- const latest = React10.useRef(value ?? defaultValue ?? []);
737
- const handleValueChange = React10.useCallback((next) => {
738
- latest.current = next;
739
- onValueChange?.(next);
740
- }, [onValueChange]);
741
- const handleSlideEnd = React10.useCallback(() => {
742
- onValueCommit?.(latest.current);
743
- }, [onValueCommit]);
744
- return /* @__PURE__ */ jsxs(YStack, { className, gap: 4, children: [
745
- label && !showValue && /* @__PURE__ */ jsx(Text, { fontSize: 14, fontWeight: "500", color: MUTED, children: label }),
746
- label && showValue && /* @__PURE__ */ jsxs(XStack, { alignItems: "center", justifyContent: "space-between", children: [
747
- /* @__PURE__ */ jsx(Text, { fontSize: 14, fontWeight: "500", color: MUTED, children: label }),
748
- /* @__PURE__ */ jsx(Text, { fontSize: 14, color: MUTED, children: (value ?? defaultValue ?? [])?.join(", ") })
749
- ] }),
750
- /* @__PURE__ */ jsxs(
751
- Slider$1,
752
- {
753
- ref,
754
- position: "relative",
755
- flexDirection: "row",
756
- width: "100%",
757
- userSelect: "none",
758
- alignItems: "center",
759
- marginBottom: hasMarkLabel ? 24 : 0,
760
- value,
761
- defaultValue,
762
- min,
763
- max,
764
- step,
765
- disabled,
766
- orientation,
767
- name,
768
- onValueChange: handleValueChange,
769
- onSlideEnd: handleSlideEnd,
770
- children: [
771
- /* @__PURE__ */ jsx(Slider$1.Track, { unstyled: true, position: "relative", flexGrow: 1, height: 6, borderRadius: 9999, backgroundColor: TRACK, children: /* @__PURE__ */ jsx(Slider$1.TrackActive, { unstyled: true, position: "absolute", height: "100%", borderRadius: 9999, backgroundColor: ACTIVE }) }),
772
- resolvedValue?.map((_, index) => /* @__PURE__ */ jsx(
773
- Slider$1.Thumb,
774
- {
775
- index,
776
- unstyled: true,
777
- width: 20,
778
- height: 20,
779
- borderRadius: 9999,
780
- borderWidth: 2,
781
- borderColor: ACTIVE,
782
- backgroundColor: WHITE,
783
- boxShadow: "var(--shadow-sm)",
784
- transition: "quick",
785
- hoverStyle: { borderColor: ACTIVE_HOVER },
786
- focusStyle: { outlineWidth: 2, outlineStyle: "solid", outlineColor: ACTIVE, outlineOffset: 2 },
787
- disabledStyle: { pointerEvents: "none", opacity: 0.5 }
788
- },
789
- index
790
- ))
791
- ]
792
- }
793
- ),
794
- /* @__PURE__ */ jsx(SliderMarks, { marks, min, max })
795
- ] });
796
- }
797
- );
798
- function SliderMarks(props) {
799
- const { marks, min, max } = props;
800
- if (!marks?.length) return null;
801
- const range = max - min;
802
- return /* @__PURE__ */ jsx(View, { position: "relative", width: "100%", height: 16, children: marks.map((mark, index) => {
803
- const percent = (mark.value - min) / range * 100;
804
- return /* @__PURE__ */ jsxs(View, { position: "absolute", left: `${percent}%`, alignItems: "center", children: [
805
- /* @__PURE__ */ jsx(View, { width: 2, height: 6, backgroundColor: TRACK }),
806
- mark.label != null && /* @__PURE__ */ jsx(Text, { marginTop: 2, fontSize: 12, color: MUTED, children: mark.label })
807
- ] }, index);
808
- }) });
809
- }
810
- var NOOP = () => {
811
- };
812
- var SIZE3 = {
813
- sm: { width: 28, height: 16, thumb: 12, label: 12 },
814
- md: { width: 36, height: 20, thumb: 16, label: 14 },
815
- lg: { width: 44, height: 24, thumb: 20, label: 16 }
816
- };
817
- var TRACK_ON = "var(--color-text-primary)";
818
- var TRACK_OFF = "var(--color-switch-bg)";
819
- var OUTLINE = "var(--color-gray-500)";
820
- var WHITE2 = "var(--color-white)";
821
- var SwitchBase = React10.forwardRef(
822
- function Switch$1(props, ref) {
823
- const {
824
- inputProps,
825
- children,
826
- rootRef,
827
- labelProps,
828
- trackLabel,
829
- thumbLabel,
830
- checked: checkedProp,
831
- defaultChecked,
832
- onCheckedChange,
833
- onChange,
834
- disabled = false,
835
- size = "md",
836
- direction,
837
- ...rest
838
- } = props;
839
- const [internalChecked, setInternalChecked] = React10.useState(defaultChecked ?? false);
840
- const isControlled = checkedProp !== void 0;
841
- const checkedState = isControlled ? checkedProp : internalChecked;
842
- const handleCheckedChange = React10.useCallback(
843
- (nextChecked) => {
844
- if (!isControlled) {
845
- setInternalChecked(nextChecked);
846
- }
847
- onCheckedChange?.(nextChecked);
848
- },
849
- [isControlled, onCheckedChange]
850
- );
851
- const s = SIZE3[size];
852
- const isRtl = direction === "rtl";
853
- return /* @__PURE__ */ jsxs(
854
- Label,
855
- {
856
- ref: rootRef,
857
- unstyled: true,
858
- flexDirection: isRtl ? "row-reverse" : "row",
859
- alignItems: "center",
860
- gap: 8,
861
- cursor: disabled ? "not-allowed" : "pointer",
862
- userSelect: "none",
863
- opacity: disabled ? 0.5 : 1,
864
- onChange,
865
- "data-disabled": disabled || void 0,
866
- ...rest,
867
- children: [
868
- /* @__PURE__ */ jsxs(
869
- Switch,
870
- {
871
- unstyled: true,
872
- checked: checkedState,
873
- onCheckedChange: handleCheckedChange,
874
- disabled,
875
- position: "relative",
876
- flexShrink: 0,
877
- alignItems: "center",
878
- width: s.width,
879
- height: s.height,
880
- borderRadius: 9999,
881
- backgroundColor: checkedState ? TRACK_ON : TRACK_OFF,
882
- transition: "quick",
883
- focusStyle: { outlineWidth: 2, outlineStyle: "solid", outlineColor: OUTLINE, outlineOffset: 2 },
884
- children: [
885
- trackLabel && /* @__PURE__ */ jsx(
886
- Text,
887
- {
888
- position: "absolute",
889
- width: "100%",
890
- textAlign: "center",
891
- fontSize: 8,
892
- fontWeight: "700",
893
- color: WHITE2,
894
- pointerEvents: "none",
895
- children: checkedState ? trackLabel.on : trackLabel.off
896
- }
897
- ),
898
- /* @__PURE__ */ jsx(
899
- Switch.Thumb,
900
- {
901
- unstyled: true,
902
- "data-thumb": true,
903
- transition: "quicker",
904
- width: s.thumb,
905
- height: s.thumb,
906
- borderRadius: 9999,
907
- backgroundColor: WHITE2,
908
- boxShadow: "var(--shadow-sm)",
909
- children: thumbLabel && /* @__PURE__ */ jsx(Text, { width: "100%", height: "100%", textAlign: "center", fontSize: 8, children: checkedState ? thumbLabel.on : thumbLabel.off })
910
- }
911
- )
912
- ]
913
- }
914
- ),
915
- /* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx(
916
- "input",
917
- {
918
- ref,
919
- type: "checkbox",
920
- checked: checkedState,
921
- disabled,
922
- tabIndex: -1,
923
- "aria-hidden": true,
924
- onChange: NOOP,
925
- ...inputProps
926
- }
927
- ) }),
928
- children != null && /* @__PURE__ */ jsx(Text, { ...labelProps, fontSize: s.label, children })
929
- ]
930
- }
931
- );
932
- }
933
- );
934
- var Switch2 = SwitchBase;
935
- var SIZE4 = {
936
- xs: { paddingHorizontal: 8, paddingVertical: 4, fontSize: "$1", borderRadius: 4 },
937
- sm: { paddingHorizontal: 12, paddingVertical: 8, fontSize: "$3", borderRadius: 6 },
938
- md: { paddingHorizontal: 16, paddingVertical: 8, fontSize: "$5", borderRadius: 6 },
939
- lg: { paddingHorizontal: 16, paddingVertical: 12, fontSize: "$6", borderRadius: 8 },
940
- "2xl": { paddingHorizontal: 16, paddingVertical: 12, fontSize: "$7", borderRadius: 8 }
941
- };
942
- var Textarea = React10__default.forwardRef(
943
- ({ size = "md", variant = "outline", className, onChange, onChangeText, ...rest }, ref) => {
944
- const handleChange = React10__default.useCallback(
945
- (event) => {
946
- onChange?.(event);
947
- onChangeText?.(event.target.value);
948
- },
949
- [onChange, onChangeText]
950
- );
951
- return /* @__PURE__ */ jsx(
952
- TextArea,
953
- {
954
- ref,
955
- unstyled: true,
956
- className: className ? `lux-control ${className}` : "lux-control",
957
- ...CONTROL,
958
- ...SIZE4[size],
959
- ...VARIANT[variant],
960
- ...rest,
961
- onChange: handleChange
962
- }
963
- );
964
- }
965
- );
966
- Textarea.displayName = "Textarea";
967
14
  var CanvasOverlay = ({
968
15
  imageRef,
969
16
  results,
@@ -972,8 +19,8 @@ var CanvasOverlay = ({
972
19
  minConfidence,
973
20
  selectedTypes
974
21
  }) => {
975
- const canvasRef = React10.useRef(null);
976
- React10.useEffect(() => {
22
+ const canvasRef = React.useRef(null);
23
+ React.useEffect(() => {
977
24
  if (!canvasRef.current || !imageRef.current || !results) return;
978
25
  const canvas = canvasRef.current;
979
26
  const ctx = canvas.getContext("2d");
@@ -1326,7 +373,7 @@ var ResultsPanel = ({
1326
373
  ] })
1327
374
  ] });
1328
375
  };
1329
- var AIVision = React10.forwardRef(
376
+ var AIVision = React.forwardRef(
1330
377
  ({
1331
378
  className,
1332
379
  onAnalysis,
@@ -1351,26 +398,26 @@ var AIVision = React10.forwardRef(
1351
398
  minConfidence = 0.5,
1352
399
  ...props
1353
400
  }, ref) => {
1354
- const [currentImage, setCurrentImage] = React10.useState(
401
+ const [currentImage, setCurrentImage] = React.useState(
1355
402
  defaultImage || null
1356
403
  );
1357
- const [isAnalyzing, setIsAnalyzing] = React10.useState(false);
1358
- const [results, setResults] = React10.useState(null);
1359
- const [isDragging, setIsDragging] = React10.useState(false);
1360
- const [urlInput, setUrlInput] = React10.useState("");
1361
- const [showBoundingBoxes, setShowBoundingBoxes] = React10.useState(true);
1362
- const [confidenceThreshold, setConfidenceThreshold] = React10.useState(minConfidence);
1363
- const [selectedTypes, setSelectedTypes] = React10.useState([
404
+ const [isAnalyzing, setIsAnalyzing] = React.useState(false);
405
+ const [results, setResults] = React.useState(null);
406
+ const [isDragging, setIsDragging] = React.useState(false);
407
+ const [urlInput, setUrlInput] = React.useState("");
408
+ const [showBoundingBoxes, setShowBoundingBoxes] = React.useState(true);
409
+ const [confidenceThreshold, setConfidenceThreshold] = React.useState(minConfidence);
410
+ const [selectedTypes, setSelectedTypes] = React.useState([
1364
411
  "objects",
1365
412
  "text",
1366
413
  "faces"
1367
414
  ]);
1368
- const [generationPrompt, setGenerationPrompt] = React10.useState("");
1369
- const [isGenerating, setIsGenerating] = React10.useState(false);
1370
- const fileInputRef = React10.useRef(null);
1371
- const imageRef = React10.useRef(null);
1372
- const videoRef = React10.useRef(null);
1373
- const [isCameraActive, setIsCameraActive] = React10.useState(false);
415
+ const [generationPrompt, setGenerationPrompt] = React.useState("");
416
+ const [isGenerating, setIsGenerating] = React.useState(false);
417
+ const fileInputRef = React.useRef(null);
418
+ const imageRef = React.useRef(null);
419
+ const videoRef = React.useRef(null);
420
+ const [isCameraActive, setIsCameraActive] = React.useState(false);
1374
421
  const analyzeImage = async (imageData) => {
1375
422
  setIsAnalyzing(true);
1376
423
  await new Promise((resolve) => setTimeout(resolve, 2e3));
@@ -1595,9 +642,9 @@ var AIVision = React10.forwardRef(
1595
642
  /* @__PURE__ */ jsx(Box, { tag: "p", className: "text-sm text-muted-foreground", children: "Analyze images with AI-powered computer vision" })
1596
643
  ] }),
1597
644
  /* @__PURE__ */ jsxs(Box, { className: "flex items-center space-x-2", children: [
1598
- /* @__PURE__ */ jsx(Label$1, { htmlFor: "bounding-boxes", ...sx("text-sm"), children: "Show Overlays" }),
645
+ /* @__PURE__ */ jsx(Label, { htmlFor: "bounding-boxes", ...sx("text-sm"), children: "Show Overlays" }),
1599
646
  /* @__PURE__ */ jsx(
1600
- Switch2,
647
+ Switch,
1601
648
  {
1602
649
  id: "bounding-boxes",
1603
650
  checked: showBoundingBoxes,
@@ -1747,7 +794,7 @@ var AIVision = React10.forwardRef(
1747
794
  /* @__PURE__ */ jsxs(Box, { className: "w-96 border-l flex flex-col", children: [
1748
795
  /* @__PURE__ */ jsx(Box, { className: "p-4 border-b", children: /* @__PURE__ */ jsxs(Box, { className: "space-y-4", children: [
1749
796
  /* @__PURE__ */ jsxs(Box, { className: "space-y-2", children: [
1750
- /* @__PURE__ */ jsxs(Label$1, { ...sx("text-sm"), children: [
797
+ /* @__PURE__ */ jsxs(Label, { ...sx("text-sm"), children: [
1751
798
  "Confidence Threshold:",
1752
799
  " ",
1753
800
  Math.round(confidenceThreshold * 100),
@@ -1766,7 +813,7 @@ var AIVision = React10.forwardRef(
1766
813
  )
1767
814
  ] }),
1768
815
  /* @__PURE__ */ jsxs(Box, { className: "space-y-2", children: [
1769
- /* @__PURE__ */ jsx(Label$1, { ...sx("text-sm"), children: "Show Detection Types" }),
816
+ /* @__PURE__ */ jsx(Label, { ...sx("text-sm"), children: "Show Detection Types" }),
1770
817
  /* @__PURE__ */ jsx(Box, { className: "flex flex-wrap gap-2", children: [
1771
818
  { key: "objects", label: "Objects", icon: Target },
1772
819
  { key: "text", label: "Text", icon: Type },