@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-voice.cjs CHANGED
@@ -1,989 +1,16 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
- var React3 = require('react');
4
+ var react = require('react');
5
5
  var lucideReact = require('lucide-react');
6
6
  var ui = require('@hanzo/ui');
7
- var gui = require('@hanzo/gui');
7
+ var badge_js = require('./badge.js');
8
+ var button_js = require('./button.js');
9
+ var slider_js = require('./slider.js');
10
+ var switch_js = require('./switch.js');
11
+ var textarea_js = require('./textarea.js');
8
12
  var jsxRuntime = require('react/jsx-runtime');
9
- var usehooks = require('@uidotdev/usehooks');
10
13
 
11
- function _interopNamespace(e) {
12
- if (e && e.__esModule) return e;
13
- var n = Object.create(null);
14
- if (e) {
15
- Object.keys(e).forEach(function (k) {
16
- if (k !== 'default') {
17
- var d = Object.getOwnPropertyDescriptor(e, k);
18
- Object.defineProperty(n, k, d.get ? d : {
19
- enumerable: true,
20
- get: function () { return e[k]; }
21
- });
22
- }
23
- });
24
- }
25
- n.default = e;
26
- return Object.freeze(n);
27
- }
28
-
29
- var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
30
-
31
- var SKELETON_CLASSES = "lux-skeleton rounded-sm";
32
- var Skeleton = React3__namespace.forwardRef(
33
- function Skeleton2(props, ref) {
34
- const { loading = true, asChild, className, children, style, ...rest } = props;
35
- if (!loading) {
36
- if (asChild && React3__namespace.isValidElement(children)) return children;
37
- return /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { ref, className, style, ...rest, children });
38
- }
39
- return /* @__PURE__ */ jsxRuntime.jsx(
40
- "div",
41
- {
42
- ref,
43
- "data-loading": true,
44
- ...ui.sx(
45
- SKELETON_CLASSES,
46
- asChild || children ? "[&_*]:invisible" : "min-h-5",
47
- className
48
- ),
49
- style,
50
- ...rest,
51
- children
52
- }
53
- );
54
- }
55
- );
56
- React3__namespace.forwardRef(
57
- function SkeletonCircle2(props, ref) {
58
- const { size = 40, loading = true, className, ...rest } = props;
59
- const dimension = typeof size === "number" ? `${size}px` : size;
60
- return /* @__PURE__ */ jsxRuntime.jsx(
61
- Skeleton,
62
- {
63
- ref,
64
- loading,
65
- ...ui.sx("rounded-full shrink-0", className),
66
- style: { width: dimension, height: dimension, ...rest.style },
67
- ...rest
68
- }
69
- );
70
- }
71
- );
72
- React3__namespace.forwardRef(
73
- function SkeletonText2(props, ref) {
74
- const { noOfLines = 3, loading = true, className, ...rest } = props;
75
- return /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { ref, className: ui.cn("flex w-full flex-col gap-2", className), ...rest, children: Array.from({ length: noOfLines }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
76
- Skeleton,
77
- {
78
- loading,
79
- ...ui.sx(ui.cn("h-4", index === noOfLines - 1 && "max-w-[80%]"))
80
- },
81
- index
82
- )) });
83
- }
84
- );
85
- var ink = (children, Wrap = gui.Text, props = {}) => {
86
- let hasText = false;
87
- React3.Children.forEach(children, (child) => {
88
- if (typeof child === "string" || typeof child === "number") hasText = true;
89
- });
90
- if (!hasText) return children;
91
- return React3.Children.map(children, (child) => typeof child === "string" || typeof child === "number" ? React3.createElement(Wrap, props, child) : child);
92
- };
93
- var TOUCH_PX = 1024;
94
- function useBelow(px) {
95
- const [below, setBelow] = React3__namespace.useState(false);
96
- React3__namespace.useEffect(() => {
97
- const mql = window.matchMedia(`(max-width: ${px - 1}px)`);
98
- const apply = () => setBelow(mql.matches);
99
- apply();
100
- mql.addEventListener("change", apply);
101
- return () => mql.removeEventListener("change", apply);
102
- }, [px]);
103
- return below;
104
- }
105
- var useIsTouch = () => useBelow(TOUCH_PX);
106
- function mapPlacement(p) {
107
- if (!p) return void 0;
108
- return p;
109
- }
110
- var Tooltip = React3__namespace.forwardRef(
111
- function Tooltip2(props, ref) {
112
- const {
113
- showArrow: showArrowProp,
114
- onOpenChange,
115
- variant,
116
- selected,
117
- children,
118
- disabled,
119
- disableOnMobile,
120
- content,
121
- contentProps,
122
- defaultOpen = false,
123
- triggerProps,
124
- closeDelay = 100,
125
- openDelay = 100,
126
- interactive,
127
- positioning
128
- } = props;
129
- const [open, setOpen] = React3__namespace.useState(defaultOpen);
130
- const timeoutRef = React3__namespace.useRef(null);
131
- const isMobile = useIsTouch();
132
- const handleOpenChange = React3__namespace.useCallback((nextOpen) => {
133
- setOpen(nextOpen);
134
- onOpenChange?.({ open: nextOpen });
135
- }, [onOpenChange]);
136
- const handleOpenChangeManual = React3__namespace.useCallback((nextOpen) => {
137
- timeoutRef.current && window.clearTimeout(timeoutRef.current);
138
- timeoutRef.current = window.setTimeout(() => {
139
- setOpen(nextOpen);
140
- onOpenChange?.({ open: nextOpen });
141
- }, nextOpen ? openDelay : closeDelay);
142
- }, [closeDelay, openDelay, onOpenChange]);
143
- const handleClickAway = React3__namespace.useCallback(() => {
144
- if (open) handleOpenChangeManual(false);
145
- }, [open, handleOpenChangeManual]);
146
- const triggerRef = usehooks.useClickAway(handleClickAway);
147
- const handleTriggerClick = React3__namespace.useCallback(() => {
148
- handleOpenChangeManual(!open);
149
- }, [handleOpenChangeManual, open]);
150
- const handleContentClick = React3__namespace.useCallback((event) => {
151
- event.stopPropagation();
152
- if (interactive) {
153
- const closestLink = event.target?.closest("a");
154
- if (closestLink) {
155
- handleOpenChangeManual(false);
156
- }
157
- }
158
- }, [interactive, handleOpenChangeManual]);
159
- React3__namespace.useEffect(() => {
160
- return () => {
161
- if (timeoutRef.current) {
162
- clearTimeout(timeoutRef.current);
163
- }
164
- };
165
- }, []);
166
- if (disabled || disableOnMobile && isMobile) return children;
167
- const defaultShowArrow = variant === "popover" ? false : true;
168
- const showArrow = showArrowProp !== void 0 ? showArrowProp : defaultShowArrow;
169
- const isPopover = variant === "popover";
170
- const placement = mapPlacement(positioning?.placement) ?? "top";
171
- const offset = positioning?.offset?.mainAxis ?? 4;
172
- return /* @__PURE__ */ jsxRuntime.jsx(gui.TooltipGroup, { delay: openDelay, children: /* @__PURE__ */ jsxRuntime.jsxs(
173
- gui.Tooltip,
174
- {
175
- open,
176
- onOpenChange: handleOpenChange,
177
- delay: { open: openDelay, close: closeDelay },
178
- placement,
179
- offset,
180
- unstyled: true,
181
- children: [
182
- /* @__PURE__ */ jsxRuntime.jsx(
183
- gui.Tooltip.Trigger,
184
- {
185
- ref: triggerRef,
186
- asChild: true,
187
- ...isMobile ? { onClick: handleTriggerClick } : {},
188
- ...triggerProps,
189
- children
190
- }
191
- ),
192
- /* @__PURE__ */ jsxRuntime.jsxs(
193
- gui.Tooltip.Content,
194
- {
195
- ref,
196
- unstyled: true,
197
- zIndex: 9999,
198
- overflow: "hidden",
199
- borderRadius: 8,
200
- paddingHorizontal: 12,
201
- paddingVertical: 8,
202
- maxWidth: isPopover ? 384 : 320,
203
- backgroundColor: isPopover ? "var(--color-popover-bg)" : "var(--color-tooltip-bg)",
204
- transition: "quick",
205
- enterStyle: { opacity: 0, scale: 0.95 },
206
- exitStyle: { opacity: 0, scale: 0.95 },
207
- ...isPopover ? {
208
- borderWidth: 1,
209
- borderColor: "var(--color-border-divider)",
210
- shadowColor: "var(--shadow-popover)"
211
- } : {},
212
- onClick: interactive ? handleContentClick : void 0,
213
- ...selected ? { "data-selected": true } : {},
214
- ...contentProps,
215
- children: [
216
- showArrow && /* @__PURE__ */ jsxRuntime.jsx(
217
- gui.Tooltip.Arrow,
218
- {
219
- unstyled: true,
220
- backgroundColor: isPopover ? "var(--color-popover-bg)" : "var(--color-tooltip-bg)"
221
- }
222
- ),
223
- ink(content, void 0, {
224
- fontSize: 14,
225
- color: isPopover ? "var(--color-text-primary)" : "var(--color-tooltip-fg)"
226
- })
227
- ]
228
- }
229
- )
230
- ]
231
- }
232
- ) });
233
- }
234
- );
235
- function TruncatedTextTooltip({ label, children }) {
236
- return /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
237
- }
238
- var SIZE = {
239
- sm: { padding: 4, height: 18, minHeight: 18 },
240
- md: { paddingHorizontal: 4, paddingVertical: 2, minHeight: 24 },
241
- lg: { paddingHorizontal: 8, paddingVertical: 4, minHeight: 28 }
242
- };
243
- var SIZE_TEXT = {
244
- sm: { fontSize: 12, fontWeight: "500" },
245
- md: { fontSize: 14, fontWeight: "500" },
246
- lg: { fontSize: 14, fontWeight: "600" }
247
- };
248
- var COLOR_PALETTE = {
249
- gray: { bg: "var(--color-badge-gray-bg)", fg: "var(--color-badge-gray-fg)" },
250
- green: { bg: "var(--color-badge-green-bg)", fg: "var(--color-badge-green-fg)" },
251
- red: { bg: "var(--color-badge-red-bg)", fg: "var(--color-badge-red-fg)" },
252
- purple: { bg: "var(--color-badge-purple-bg)", fg: "var(--color-badge-purple-fg)" },
253
- orange: { bg: "var(--color-badge-orange-bg)", fg: "var(--color-badge-orange-fg)" },
254
- blue: { bg: "var(--color-badge-blue-bg)", fg: "var(--color-badge-blue-fg)" },
255
- yellow: { bg: "var(--color-badge-yellow-bg)", fg: "var(--color-badge-yellow-fg)" },
256
- teal: { bg: "var(--color-badge-teal-bg)", fg: "var(--color-badge-teal-fg)" },
257
- cyan: { bg: "var(--color-badge-cyan-bg)", fg: "var(--color-badge-cyan-fg)" },
258
- pink: { bg: "var(--color-badge-pink-bg)", fg: "var(--color-badge-pink-fg)" },
259
- purple_alt: { bg: "var(--color-badge-purple-alt-bg)", fg: "var(--color-badge-purple-alt-fg)" },
260
- blue_alt: { bg: "var(--color-badge-blue-alt-bg)", fg: "var(--color-badge-blue-alt-fg)" },
261
- bright_gray: { bg: "var(--color-badge-bright-gray-bg)", fg: "var(--color-badge-bright-gray-fg)" },
262
- bright_green: { bg: "var(--color-badge-bright-green-bg)", fg: "var(--color-badge-bright-green-fg)" },
263
- bright_red: { bg: "var(--color-badge-bright-red-bg)", fg: "var(--color-badge-bright-red-fg)" },
264
- bright_blue: { bg: "var(--color-badge-bright-blue-bg)", fg: "var(--color-badge-bright-blue-fg)" },
265
- bright_yellow: { bg: "var(--color-badge-bright-yellow-bg)", fg: "var(--color-badge-bright-yellow-fg)" },
266
- bright_teal: { bg: "var(--color-badge-bright-teal-bg)", fg: "var(--color-badge-bright-teal-fg)" },
267
- bright_cyan: { bg: "var(--color-badge-bright-cyan-bg)", fg: "var(--color-badge-bright-cyan-fg)" },
268
- bright_orange: { bg: "var(--color-badge-bright-orange-bg)", fg: "var(--color-badge-bright-orange-fg)" },
269
- bright_purple: { bg: "var(--color-badge-bright-purple-bg)", fg: "var(--color-badge-bright-purple-fg)" },
270
- bright_pink: { bg: "var(--color-badge-bright-pink-bg)", fg: "var(--color-badge-bright-pink-fg)" }
271
- };
272
- var TONE = {
273
- subtle: (p) => ({ backgroundColor: p.bg, color: p.fg, borderWidth: 0 }),
274
- solid: (p) => ({ backgroundColor: p.fg, color: p.bg, borderWidth: 0 }),
275
- outline: (p) => ({
276
- backgroundColor: "transparent",
277
- color: p.fg,
278
- borderWidth: 1,
279
- borderColor: p.fg
280
- })
281
- };
282
- var Badge = React3__namespace.default.forwardRef(
283
- function Badge2(props, ref) {
284
- const {
285
- loading,
286
- startElement,
287
- children,
288
- truncated = false,
289
- endElement,
290
- variant = "subtle",
291
- size = "md",
292
- colorPalette = "gray",
293
- className,
294
- style: badgeStyle,
295
- ...rest
296
- } = props;
297
- const palette = COLOR_PALETTE[colorPalette];
298
- const tone = TONE[variant](palette);
299
- const child = children ? (
300
- // `ellipsis` is gui Text's own built-in variant for single-line
301
- // truncation — it expands to the same overflow/text-overflow/
302
- // white-space/max-width rule Tailwind's `text-ellipsis` did, but
303
- // through the component's own variants (guaranteed to compile),
304
- // rather than naming each longhand as a separate style prop.
305
- /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { ellipsis: true, ...SIZE_TEXT[size], color: tone.color, children })
306
- ) : null;
307
- const childrenElement = truncated ? /* @__PURE__ */ jsxRuntime.jsx(TruncatedTextTooltip, { label: children, children: child }) : child;
308
- const badgeElement = /* @__PURE__ */ jsxRuntime.jsxs(
309
- gui.XStack,
310
- {
311
- ref,
312
- render: /* @__PURE__ */ jsxRuntime.jsx("span", {}),
313
- display: "inline-flex",
314
- alignItems: "center",
315
- alignSelf: "flex-start",
316
- borderRadius: 2,
317
- gap: 4,
318
- maxWidth: "100%",
319
- userSelect: "text",
320
- ...SIZE[size],
321
- ...tone,
322
- className,
323
- style: badgeStyle,
324
- ...rest,
325
- children: [
326
- startElement,
327
- childrenElement,
328
- endElement
329
- ]
330
- }
331
- );
332
- if (loading) {
333
- return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { loading, asChild: true, children: badgeElement });
334
- }
335
- return badgeElement;
336
- }
337
- );
338
- var SpinnerFrame = gui.styled(gui.View, {
339
- name: "ButtonSpinner",
340
- render: /* @__PURE__ */ jsxRuntime.jsx("span", {}),
341
- width: 16,
342
- height: 16,
343
- borderRadius: 1e3,
344
- borderWidth: 2,
345
- borderColor: "currentColor",
346
- borderBottomColor: "transparent",
347
- borderLeftColor: "transparent"
348
- });
349
- function Spinner({ className }) {
350
- return /* @__PURE__ */ jsxRuntime.jsx(
351
- SpinnerFrame,
352
- {
353
- role: "status",
354
- "aria-label": "Loading",
355
- className: [
356
- "animate-spin",
357
- className
358
- ].filter(Boolean).join(" ")
359
- }
360
- );
361
- }
362
- var ButtonFrame = gui.styled(gui.View, {
363
- name: "LuxButton",
364
- render: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button" }),
365
- role: "button",
366
- tabIndex: 0,
367
- cursor: "pointer",
368
- userSelect: "none",
369
- display: "inline-flex",
370
- alignItems: "center",
371
- justifyContent: "center",
372
- gap: 0,
373
- overflow: "hidden",
374
- borderRadius: 6,
375
- // Whitespace nowrap via className since hanzogui doesn't have a direct token
376
- // Transition via className
377
- variants: {
378
- size: {
379
- "2xs": { paddingHorizontal: 8, height: 20, minWidth: 20, fontSize: 12, borderRadius: 4, gap: 4 },
380
- xs: { paddingHorizontal: 8, height: 24, minWidth: 24, fontSize: 14, borderRadius: 4, gap: 4 },
381
- sm: { paddingHorizontal: 12, height: 32, minWidth: 32, fontSize: 14, borderRadius: 6, gap: 4 },
382
- md: { paddingHorizontal: 12, height: 40, minWidth: 40, fontSize: 16, borderRadius: 6, gap: 8 }
383
- },
384
- disabled: {
385
- true: {
386
- opacity: 0.2,
387
- cursor: "not-allowed",
388
- pointerEvents: "none"
389
- }
390
- }
391
- },
392
- defaultVariants: {
393
- size: "md"
394
- }
395
- });
396
- var VARIANT_CLASSES = {
397
- solid: [
398
- "bg-[var(--color-button-solid-bg)] text-[var(--color-button-solid-text)]",
399
- "hover:bg-[var(--color-hover)]",
400
- "data-[expanded]:bg-[var(--color-hover)]"
401
- ].join(" "),
402
- solid_danger: [
403
- "bg-[var(--color-button-danger-bg)] text-[var(--color-button-danger-fg)]",
404
- "hover:bg-[var(--color-button-danger-bg-hover)]",
405
- "data-[expanded]:bg-[var(--color-button-danger-bg-hover)]"
406
- ].join(" "),
407
- outline: [
408
- "border-2 border-solid bg-transparent",
409
- "text-[var(--color-button-outline-fg)] border-[var(--color-button-outline-fg)]",
410
- "hover:bg-transparent hover:text-[var(--color-hover)] hover:border-[var(--color-hover)]"
411
- ].join(" "),
412
- outline_danger: [
413
- "border-2 border-solid bg-transparent",
414
- "text-[var(--color-button-danger-bg)] border-[var(--color-button-danger-bg)]",
415
- "hover:bg-transparent hover:text-[var(--color-button-danger-bg-hover)] hover:border-[var(--color-button-danger-bg-hover)]"
416
- ].join(" "),
417
- dropdown: [
418
- "border-2 border-solid bg-transparent",
419
- "text-[var(--color-button-dropdown-fg)] border-[var(--color-button-dropdown-border)]",
420
- "hover:bg-transparent hover:text-[var(--color-hover)] hover:border-[var(--color-hover)]",
421
- "data-[expanded]:bg-transparent data-[expanded]:text-[var(--color-hover)] data-[expanded]:border-[var(--color-hover)]",
422
- "data-[selected]:bg-[var(--color-selected-control-bg)] data-[selected]:text-[var(--color-selected-control-text)] data-[selected]:border-transparent",
423
- "data-[selected]:hover:bg-[var(--color-selected-control-bg)]",
424
- "data-[selected]:hover:text-[var(--color-hover)] data-[selected]:hover:border-transparent",
425
- "data-[selected]:data-[expanded]:text-[var(--color-hover)]"
426
- ].join(" "),
427
- header: [
428
- "bg-transparent border-2 border-solid",
429
- "text-[var(--color-button-header-fg)] border-[var(--color-button-header-border)]",
430
- "hover:bg-transparent hover:text-[var(--color-hover)] hover:border-[var(--color-hover)]",
431
- "data-[selected]:bg-[var(--color-button-header-bg-selected)]",
432
- "data-[selected]:text-[var(--color-button-header-fg-selected)] data-[selected]:border-transparent data-[selected]:border-0",
433
- "data-[selected]:hover:bg-[var(--color-button-header-bg-selected)] data-[selected]:hover:text-[var(--color-hover)]",
434
- "data-[selected]:data-[expanded]:text-[var(--color-hover)]",
435
- "data-[selected]:data-[highlighted]:bg-[var(--color-button-header-bg-highlighted)]",
436
- "data-[selected]:data-[highlighted]:text-[var(--color-button-header-fg-highlighted)]",
437
- "data-[selected]:data-[highlighted]:border-transparent data-[selected]:data-[highlighted]:border-0",
438
- "data-[selected]:data-[highlighted]:hover:bg-[var(--color-button-header-bg-highlighted)]",
439
- "data-[selected]:data-[highlighted]:hover:text-[var(--color-hover)]",
440
- "data-[selected]:data-[highlighted]:data-[expanded]:text-[var(--color-hover)]"
441
- ].join(" "),
442
- hero: [
443
- "bg-[var(--color-button-hero-bg)] text-[var(--color-button-hero-fg)]",
444
- "hover:bg-[var(--color-button-hero-bg-hover)] hover:text-[var(--color-button-hero-fg-hover)]",
445
- "data-[selected]:bg-[var(--color-button-hero-bg-selected)] data-[selected]:text-[var(--color-button-hero-fg-selected)]",
446
- "data-[selected]:hover:bg-[var(--color-button-hero-bg-selected)] data-[selected]:hover:text-[var(--color-hover)]",
447
- "data-[selected]:data-[expanded]:text-[var(--color-hover)]"
448
- ].join(" "),
449
- segmented: [
450
- "bg-transparent border-2 border-solid rounded-none",
451
- "text-[var(--color-button-segmented-fg)] border-[var(--color-selected-control-bg)]",
452
- "hover:text-[var(--color-hover)]",
453
- "data-[selected]:bg-[var(--color-selected-control-bg)] data-[selected]:text-[var(--color-selected-control-text)]",
454
- "data-[selected]:hover:bg-[var(--color-selected-control-bg)] data-[selected]:hover:text-[var(--color-selected-control-text)]",
455
- "[&:not(:last-child)]:border-r-0 data-[selected]:[&:not(:last-child)]:border-r-2",
456
- "data-[selected]+*:border-l-0",
457
- "first:rounded-l-md last:rounded-r-md"
458
- ].join(" "),
459
- plain: "bg-transparent text-inherit border-none hover:bg-transparent",
460
- subtle: [
461
- "bg-[var(--color-button-subtle-bg)] text-[var(--color-button-subtle-fg)]",
462
- "hover:bg-[var(--color-button-subtle-bg)] hover:text-[var(--color-hover)]",
463
- "disabled:bg-[var(--color-button-subtle-bg)] disabled:text-[var(--color-button-subtle-fg)]"
464
- ].join(" "),
465
- link: [
466
- "bg-transparent text-[var(--color-link-primary)] border-none font-normal",
467
- "px-0 h-auto",
468
- "hover:bg-transparent hover:text-[var(--color-link-primary-hover)]",
469
- "disabled:text-[var(--color-text-secondary)]"
470
- ].join(" "),
471
- icon_secondary: [
472
- "bg-transparent text-[var(--color-icon-secondary)] border-none",
473
- "hover:text-[var(--color-hover)]",
474
- "data-[selected]:bg-[var(--color-selected-control-bg)] data-[selected]:text-[var(--color-selected-control-text)]",
475
- "data-[selected]:hover:bg-[var(--color-selected-control-bg)] data-[selected]:hover:text-[var(--color-hover)]",
476
- "data-[selected]:data-[expanded]:text-[var(--color-hover)]",
477
- "data-[expanded]:text-[var(--color-hover)]"
478
- ].join(" "),
479
- icon_background: [
480
- "bg-[var(--color-button-icon-background-bg)] text-[var(--color-icon-secondary)] border-none",
481
- "hover:text-[var(--color-hover)]",
482
- "data-[selected]:bg-[var(--color-selected-control-bg)] data-[selected]:text-[var(--color-selected-control-text)]",
483
- "data-[selected]:hover:bg-[var(--color-selected-control-bg)] data-[selected]:hover:text-[var(--color-hover)]",
484
- "data-[selected]:data-[expanded]:text-[var(--color-hover)]",
485
- "data-[expanded]:text-[var(--color-hover)]"
486
- ].join(" "),
487
- pagination: [
488
- "border-2 border-solid bg-transparent",
489
- "text-[var(--color-button-pagination-fg)] border-[var(--color-button-pagination-border)]",
490
- "hover:bg-transparent hover:text-[var(--color-hover)] hover:border-[var(--color-hover)]",
491
- "data-[selected]:bg-[var(--color-selected-control-bg)] data-[selected]:text-[var(--color-selected-control-text)] data-[selected]:border-transparent",
492
- "data-[selected]:hover:bg-[var(--color-selected-control-bg)]",
493
- "data-[selected]:hover:text-[var(--color-selected-control-text)] data-[selected]:hover:border-transparent"
494
- ].join(" ")
495
- };
496
- var BASE_CLASSES = "font-semibold whitespace-nowrap transition-colors duration-150";
497
- var SP = 4;
498
- function buildShimStyle(props) {
499
- const s = { ...props.style };
500
- if (props.mt !== void 0) s.marginTop = typeof props.mt === "number" ? `${props.mt * SP}px` : props.mt;
501
- if (props.ml !== void 0) s.marginLeft = typeof props.ml === "number" ? `${props.ml * SP}px` : props.ml;
502
- if (props.mr !== void 0) s.marginRight = typeof props.mr === "number" ? `${props.mr * SP}px` : props.mr;
503
- if (props.px !== void 0) {
504
- const v = typeof props.px === "number" ? `${props.px * SP}px` : props.px;
505
- s.paddingLeft = v;
506
- s.paddingRight = v;
507
- }
508
- if (props.py !== void 0) {
509
- const v = typeof props.py === "number" ? `${props.py * SP}px` : props.py;
510
- s.paddingTop = v;
511
- s.paddingBottom = v;
512
- }
513
- if (props.fontWeight !== void 0) s.fontWeight = props.fontWeight;
514
- if (props.gap !== void 0) s.gap = typeof props.gap === "number" ? `${props.gap * SP}px` : props.gap;
515
- if (props.flexShrink !== void 0) s.flexShrink = props.flexShrink;
516
- if (props.columnGap !== void 0) s.columnGap = typeof props.columnGap === "number" ? `${props.columnGap * SP}px` : props.columnGap;
517
- if (props.gridColumn !== void 0) s.gridColumn = typeof props.gridColumn === "number" ? String(props.gridColumn) : props.gridColumn;
518
- if (props.gridRow) s.gridRow = props.gridRow;
519
- if (props.justifySelf) s.justifySelf = props.justifySelf;
520
- if (props.alignSelf) s.alignSelf = props.alignSelf;
521
- if (props.h) s.height = props.h;
522
- if (props.w) s.width = props.w;
523
- if (props.display) s.display = props.display;
524
- if (props.borderBottomRightRadius !== void 0) s.borderBottomRightRadius = typeof props.borderBottomRightRadius === "number" ? `${props.borderBottomRightRadius}px` : props.borderBottomRightRadius;
525
- if (props.borderTopRightRadius !== void 0) s.borderTopRightRadius = typeof props.borderTopRightRadius === "number" ? `${props.borderTopRightRadius}px` : props.borderTopRightRadius;
526
- return Object.keys(s).length > 0 ? s : void 0;
527
- }
528
- var Button = React3__namespace.forwardRef(
529
- function Button2(props, ref) {
530
- const {
531
- className,
532
- variant = "solid",
533
- size = "md",
534
- asChild = false,
535
- loading = false,
536
- loadingText,
537
- loadingSkeleton = false,
538
- expanded,
539
- selected,
540
- highlighted,
541
- disabled,
542
- children,
543
- style: styleProp,
544
- // Strip Chakra style props
545
- mt,
546
- ml,
547
- mr,
548
- px,
549
- py,
550
- fontWeight,
551
- gap,
552
- flexShrink,
553
- columnGap,
554
- gridColumn,
555
- gridRow,
556
- justifySelf,
557
- alignSelf,
558
- textStyle: _textStyle,
559
- h,
560
- w,
561
- display,
562
- borderBottomRightRadius,
563
- borderTopRightRadius,
564
- ...rest
565
- } = props;
566
- const mergedStyle = buildShimStyle({
567
- style: styleProp,
568
- mt,
569
- ml,
570
- mr,
571
- px,
572
- py,
573
- fontWeight,
574
- gap,
575
- flexShrink,
576
- columnGap,
577
- gridColumn,
578
- gridRow,
579
- justifySelf,
580
- alignSelf,
581
- h,
582
- w,
583
- display,
584
- borderBottomRightRadius,
585
- borderTopRightRadius
586
- });
587
- const dataAttrs = {};
588
- if (expanded) dataAttrs["data-expanded"] = true;
589
- if (selected) dataAttrs["data-selected"] = true;
590
- if (highlighted) dataAttrs["data-highlighted"] = true;
591
- if (loadingSkeleton) dataAttrs["data-loading-skeleton"] = true;
592
- const isDisabled = !loadingSkeleton && (loading || disabled);
593
- const inner = loading ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
594
- /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}),
595
- loadingText != null && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { marginLeft: 8 }, children: loadingText })
596
- ] }) : children;
597
- const variantClass = VARIANT_CLASSES[variant] ?? VARIANT_CLASSES.solid;
598
- const combinedClassName = [BASE_CLASSES, variantClass, className].filter(Boolean).join(" ");
599
- const button = /* @__PURE__ */ jsxRuntime.jsx(
600
- ButtonFrame,
601
- {
602
- ref,
603
- size,
604
- disabled: isDisabled || void 0,
605
- asChild: asChild || void 0,
606
- className: combinedClassName,
607
- style: mergedStyle,
608
- ...dataAttrs,
609
- ...rest,
610
- children: inner
611
- }
612
- );
613
- if (loadingSkeleton) {
614
- return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { loading: loadingSkeleton, asChild: true, ref, children: button });
615
- }
616
- return button;
617
- }
618
- );
619
- React3__namespace.forwardRef(
620
- function ButtonGroup2(props, ref) {
621
- const { className, ...rest } = props;
622
- return /* @__PURE__ */ jsxRuntime.jsx(
623
- ui.Box,
624
- {
625
- ref,
626
- className: ["inline-flex", className].filter(Boolean).join(" "),
627
- role: "group",
628
- ...rest
629
- }
630
- );
631
- }
632
- );
633
- React3__namespace.forwardRef(
634
- function ButtonGroupRadio2(props, ref) {
635
- const {
636
- children,
637
- onChange,
638
- variant = "segmented",
639
- defaultValue,
640
- loading = false,
641
- equalWidth = false,
642
- className,
643
- ...rest
644
- } = props;
645
- const firstChildValue = React3__namespace.useMemo(() => {
646
- const firstChild = Array.isArray(children) ? children[0] : void 0;
647
- return typeof firstChild?.props.value === "string" ? firstChild.props.value : void 0;
648
- }, [children]);
649
- const [value, setValue] = React3__namespace.useState(defaultValue ?? firstChildValue);
650
- const handleItemClick = React3__namespace.useCallback((event) => {
651
- const v = event.currentTarget.value;
652
- setValue(v);
653
- onChange?.(v);
654
- }, [onChange]);
655
- const clonedChildren = React3__namespace.Children.map(children, (child) => {
656
- return React3__namespace.cloneElement(child, {
657
- onClick: handleItemClick,
658
- selected: value === child.props.value,
659
- variant
660
- });
661
- });
662
- const childrenLength = React3__namespace.Children.count(children);
663
- return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { loading, children: /* @__PURE__ */ jsxRuntime.jsx(
664
- ui.Box,
665
- {
666
- ref,
667
- className: [
668
- "inline-flex gap-0",
669
- equalWidth ? "grid" : "",
670
- className
671
- ].filter(Boolean).join(" "),
672
- style: equalWidth ? { gridTemplateColumns: `repeat(${childrenLength}, 1fr)` } : void 0,
673
- role: "group",
674
- ...rest,
675
- children: clonedChildren
676
- }
677
- ) });
678
- }
679
- );
680
- var MUTED = "var(--color-text-secondary)";
681
- var TRACK = "var(--color-border-divider)";
682
- var ACTIVE = "var(--color-link-primary)";
683
- var ACTIVE_HOVER = "var(--color-link-primary-hover)";
684
- var WHITE = "var(--color-white)";
685
- var Slider = React3__namespace.forwardRef(
686
- function Slider2(props, ref) {
687
- const {
688
- marks: marksProp,
689
- label,
690
- showValue,
691
- value,
692
- defaultValue,
693
- min = 0,
694
- max = 100,
695
- step,
696
- disabled,
697
- orientation = "horizontal",
698
- name,
699
- onValueChange,
700
- onValueCommit,
701
- className
702
- } = props;
703
- const resolvedValue = defaultValue ?? value;
704
- const marks = marksProp?.map((mark) => {
705
- if (typeof mark === "number") return { value: mark, label: void 0 };
706
- return mark;
707
- });
708
- const hasMarkLabel = Boolean(marks?.some((mark) => mark.label));
709
- const latest = React3__namespace.useRef(value ?? defaultValue ?? []);
710
- const handleValueChange = React3__namespace.useCallback((next) => {
711
- latest.current = next;
712
- onValueChange?.(next);
713
- }, [onValueChange]);
714
- const handleSlideEnd = React3__namespace.useCallback(() => {
715
- onValueCommit?.(latest.current);
716
- }, [onValueCommit]);
717
- return /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { className, gap: 4, children: [
718
- label && !showValue && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 14, fontWeight: "500", color: MUTED, children: label }),
719
- label && showValue && /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { alignItems: "center", justifyContent: "space-between", children: [
720
- /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 14, fontWeight: "500", color: MUTED, children: label }),
721
- /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: 14, color: MUTED, children: (value ?? defaultValue ?? [])?.join(", ") })
722
- ] }),
723
- /* @__PURE__ */ jsxRuntime.jsxs(
724
- gui.Slider,
725
- {
726
- ref,
727
- position: "relative",
728
- flexDirection: "row",
729
- width: "100%",
730
- userSelect: "none",
731
- alignItems: "center",
732
- marginBottom: hasMarkLabel ? 24 : 0,
733
- value,
734
- defaultValue,
735
- min,
736
- max,
737
- step,
738
- disabled,
739
- orientation,
740
- name,
741
- onValueChange: handleValueChange,
742
- onSlideEnd: handleSlideEnd,
743
- children: [
744
- /* @__PURE__ */ jsxRuntime.jsx(gui.Slider.Track, { unstyled: true, position: "relative", flexGrow: 1, height: 6, borderRadius: 9999, backgroundColor: TRACK, children: /* @__PURE__ */ jsxRuntime.jsx(gui.Slider.TrackActive, { unstyled: true, position: "absolute", height: "100%", borderRadius: 9999, backgroundColor: ACTIVE }) }),
745
- resolvedValue?.map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
746
- gui.Slider.Thumb,
747
- {
748
- index,
749
- unstyled: true,
750
- width: 20,
751
- height: 20,
752
- borderRadius: 9999,
753
- borderWidth: 2,
754
- borderColor: ACTIVE,
755
- backgroundColor: WHITE,
756
- boxShadow: "var(--shadow-sm)",
757
- transition: "quick",
758
- hoverStyle: { borderColor: ACTIVE_HOVER },
759
- focusStyle: { outlineWidth: 2, outlineStyle: "solid", outlineColor: ACTIVE, outlineOffset: 2 },
760
- disabledStyle: { pointerEvents: "none", opacity: 0.5 }
761
- },
762
- index
763
- ))
764
- ]
765
- }
766
- ),
767
- /* @__PURE__ */ jsxRuntime.jsx(SliderMarks, { marks, min, max })
768
- ] });
769
- }
770
- );
771
- function SliderMarks(props) {
772
- const { marks, min, max } = props;
773
- if (!marks?.length) return null;
774
- const range = max - min;
775
- return /* @__PURE__ */ jsxRuntime.jsx(gui.View, { position: "relative", width: "100%", height: 16, children: marks.map((mark, index) => {
776
- const percent = (mark.value - min) / range * 100;
777
- return /* @__PURE__ */ jsxRuntime.jsxs(gui.View, { position: "absolute", left: `${percent}%`, alignItems: "center", children: [
778
- /* @__PURE__ */ jsxRuntime.jsx(gui.View, { width: 2, height: 6, backgroundColor: TRACK }),
779
- mark.label != null && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { marginTop: 2, fontSize: 12, color: MUTED, children: mark.label })
780
- ] }, index);
781
- }) });
782
- }
783
- var NOOP = () => {
784
- };
785
- var SIZE2 = {
786
- sm: { width: 28, height: 16, thumb: 12, label: 12 },
787
- md: { width: 36, height: 20, thumb: 16, label: 14 },
788
- lg: { width: 44, height: 24, thumb: 20, label: 16 }
789
- };
790
- var TRACK_ON = "var(--color-text-primary)";
791
- var TRACK_OFF = "var(--color-switch-bg)";
792
- var OUTLINE = "var(--color-gray-500)";
793
- var WHITE2 = "var(--color-white)";
794
- var SwitchBase = React3__namespace.forwardRef(
795
- function Switch(props, ref) {
796
- const {
797
- inputProps,
798
- children,
799
- rootRef,
800
- labelProps,
801
- trackLabel,
802
- thumbLabel,
803
- checked: checkedProp,
804
- defaultChecked,
805
- onCheckedChange,
806
- onChange,
807
- disabled = false,
808
- size = "md",
809
- direction,
810
- ...rest
811
- } = props;
812
- const [internalChecked, setInternalChecked] = React3__namespace.useState(defaultChecked ?? false);
813
- const isControlled = checkedProp !== void 0;
814
- const checkedState = isControlled ? checkedProp : internalChecked;
815
- const handleCheckedChange = React3__namespace.useCallback(
816
- (nextChecked) => {
817
- if (!isControlled) {
818
- setInternalChecked(nextChecked);
819
- }
820
- onCheckedChange?.(nextChecked);
821
- },
822
- [isControlled, onCheckedChange]
823
- );
824
- const s = SIZE2[size];
825
- const isRtl = direction === "rtl";
826
- return /* @__PURE__ */ jsxRuntime.jsxs(
827
- gui.Label,
828
- {
829
- ref: rootRef,
830
- unstyled: true,
831
- flexDirection: isRtl ? "row-reverse" : "row",
832
- alignItems: "center",
833
- gap: 8,
834
- cursor: disabled ? "not-allowed" : "pointer",
835
- userSelect: "none",
836
- opacity: disabled ? 0.5 : 1,
837
- onChange,
838
- "data-disabled": disabled || void 0,
839
- ...rest,
840
- children: [
841
- /* @__PURE__ */ jsxRuntime.jsxs(
842
- gui.Switch,
843
- {
844
- unstyled: true,
845
- checked: checkedState,
846
- onCheckedChange: handleCheckedChange,
847
- disabled,
848
- position: "relative",
849
- flexShrink: 0,
850
- alignItems: "center",
851
- width: s.width,
852
- height: s.height,
853
- borderRadius: 9999,
854
- backgroundColor: checkedState ? TRACK_ON : TRACK_OFF,
855
- transition: "quick",
856
- focusStyle: { outlineWidth: 2, outlineStyle: "solid", outlineColor: OUTLINE, outlineOffset: 2 },
857
- children: [
858
- trackLabel && /* @__PURE__ */ jsxRuntime.jsx(
859
- gui.Text,
860
- {
861
- position: "absolute",
862
- width: "100%",
863
- textAlign: "center",
864
- fontSize: 8,
865
- fontWeight: "700",
866
- color: WHITE2,
867
- pointerEvents: "none",
868
- children: checkedState ? trackLabel.on : trackLabel.off
869
- }
870
- ),
871
- /* @__PURE__ */ jsxRuntime.jsx(
872
- gui.Switch.Thumb,
873
- {
874
- unstyled: true,
875
- "data-thumb": true,
876
- transition: "quicker",
877
- width: s.thumb,
878
- height: s.thumb,
879
- borderRadius: 9999,
880
- backgroundColor: WHITE2,
881
- boxShadow: "var(--shadow-sm)",
882
- children: thumbLabel && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { width: "100%", height: "100%", textAlign: "center", fontSize: 8, children: checkedState ? thumbLabel.on : thumbLabel.off })
883
- }
884
- )
885
- ]
886
- }
887
- ),
888
- /* @__PURE__ */ jsxRuntime.jsx(gui.VisuallyHidden, { children: /* @__PURE__ */ jsxRuntime.jsx(
889
- "input",
890
- {
891
- ref,
892
- type: "checkbox",
893
- checked: checkedState,
894
- disabled,
895
- tabIndex: -1,
896
- "aria-hidden": true,
897
- onChange: NOOP,
898
- ...inputProps
899
- }
900
- ) }),
901
- children != null && /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { ...labelProps, fontSize: s.label, children })
902
- ]
903
- }
904
- );
905
- }
906
- );
907
- var Switch2 = SwitchBase;
908
- var SIZE3 = {
909
- xs: { height: 24, paddingHorizontal: 8, fontSize: "$1", borderRadius: 4 },
910
- sm: { height: 32, paddingHorizontal: 12, fontSize: "$3", borderRadius: 6 },
911
- md: { height: 40, paddingHorizontal: 16, fontSize: "$5", borderRadius: 6 },
912
- lg: { height: 48, paddingHorizontal: 16, fontSize: "$6", borderRadius: 8 },
913
- "2xl": { height: 56, paddingHorizontal: 16, fontSize: "$7", borderRadius: 8 }
914
- };
915
- var VARIANT = {
916
- outline: { borderWidth: 1, borderStyle: "solid" },
917
- filled: { borderWidth: 0, backgroundColor: "var(--color-input-filled-bg)" },
918
- unstyled: { borderWidth: 0, backgroundColor: "transparent", padding: 0, height: "auto" }
919
- };
920
- var CONTROL = {
921
- width: "100%",
922
- outlineWidth: 0,
923
- backgroundColor: "var(--color-input-bg)",
924
- color: "var(--color-input-fg)",
925
- borderColor: "var(--color-input-border)",
926
- hoverStyle: { borderColor: "var(--color-input-border-hover)" },
927
- focusStyle: { borderColor: "var(--color-input-border-focus)" },
928
- disabledStyle: { opacity: 0.4, cursor: "not-allowed" }
929
- };
930
- var Input = React3__namespace.default.forwardRef(
931
- ({ size = "md", variant = "outline", className, onChange, onChangeText, ...rest }, ref) => {
932
- const handleChange = React3__namespace.default.useCallback(
933
- (event) => {
934
- onChange?.(event);
935
- onChangeText?.(event.target.value);
936
- },
937
- [onChange, onChangeText]
938
- );
939
- return /* @__PURE__ */ jsxRuntime.jsx(
940
- gui.Input,
941
- {
942
- ref,
943
- unstyled: true,
944
- className: className ? `lux-control ${className}` : "lux-control",
945
- ...CONTROL,
946
- ...SIZE3[size],
947
- ...VARIANT[variant],
948
- ...rest,
949
- onChange: handleChange
950
- }
951
- );
952
- }
953
- );
954
- Input.displayName = "Input";
955
- var SIZE4 = {
956
- xs: { paddingHorizontal: 8, paddingVertical: 4, fontSize: "$1", borderRadius: 4 },
957
- sm: { paddingHorizontal: 12, paddingVertical: 8, fontSize: "$3", borderRadius: 6 },
958
- md: { paddingHorizontal: 16, paddingVertical: 8, fontSize: "$5", borderRadius: 6 },
959
- lg: { paddingHorizontal: 16, paddingVertical: 12, fontSize: "$6", borderRadius: 8 },
960
- "2xl": { paddingHorizontal: 16, paddingVertical: 12, fontSize: "$7", borderRadius: 8 }
961
- };
962
- var Textarea = React3__namespace.default.forwardRef(
963
- ({ size = "md", variant = "outline", className, onChange, onChangeText, ...rest }, ref) => {
964
- const handleChange = React3__namespace.default.useCallback(
965
- (event) => {
966
- onChange?.(event);
967
- onChangeText?.(event.target.value);
968
- },
969
- [onChange, onChangeText]
970
- );
971
- return /* @__PURE__ */ jsxRuntime.jsx(
972
- gui.TextArea,
973
- {
974
- ref,
975
- unstyled: true,
976
- className: className ? `lux-control ${className}` : "lux-control",
977
- ...CONTROL,
978
- ...SIZE4[size],
979
- ...VARIANT[variant],
980
- ...rest,
981
- onChange: handleChange
982
- }
983
- );
984
- }
985
- );
986
- Textarea.displayName = "Textarea";
987
14
  var defaultVoices = [
988
15
  {
989
16
  id: "default-en-us",
@@ -1060,29 +87,29 @@ function AIVoice({
1060
87
  autoStart = false,
1061
88
  className
1062
89
  }) {
1063
- const [isListening, setIsListening] = React3.useState(false);
1064
- const [isSpeaking, setIsSpeaking] = React3.useState(false);
1065
- const [transcript, setTranscript] = React3.useState("");
1066
- const [finalTranscript, setFinalTranscript] = React3.useState("");
1067
- const [currentVolume, setCurrentVolume] = React3.useState(0);
1068
- const [isWakeWordActive, setIsWakeWordActive] = React3.useState(false);
1069
- const [selectedVoice, setSelectedVoice] = React3.useState(
90
+ const [isListening, setIsListening] = react.useState(false);
91
+ const [isSpeaking, setIsSpeaking] = react.useState(false);
92
+ const [transcript, setTranscript] = react.useState("");
93
+ const [finalTranscript, setFinalTranscript] = react.useState("");
94
+ const [currentVolume, setCurrentVolume] = react.useState(0);
95
+ const [isWakeWordActive, setIsWakeWordActive] = react.useState(false);
96
+ const [selectedVoice, setSelectedVoice] = react.useState(
1070
97
  voice || defaultVoices[0]
1071
98
  );
1072
- const [showSettings, setShowSettings] = React3.useState(false);
1073
- const [speechSpeed, setSpeechSpeed] = React3.useState(1);
1074
- const [speechPitch, setSpeechPitch] = React3.useState(1);
1075
- const [speechVolume, setSpeechVolume] = React3.useState(0.8);
1076
- const [error, setError] = React3.useState(null);
1077
- const [audioLevel, setAudioLevel] = React3.useState(0);
1078
- const recognitionRef = React3.useRef(null);
1079
- const synthRef = React3.useRef(null);
1080
- const audioContextRef = React3.useRef(null);
1081
- const analyserRef = React3.useRef(null);
1082
- const microphoneRef = React3.useRef(null);
1083
- const animationFrameRef = React3.useRef(null);
1084
- const canvasRef = React3.useRef(null);
1085
- React3.useEffect(() => {
99
+ const [showSettings, setShowSettings] = react.useState(false);
100
+ const [speechSpeed, setSpeechSpeed] = react.useState(1);
101
+ const [speechPitch, setSpeechPitch] = react.useState(1);
102
+ const [speechVolume, setSpeechVolume] = react.useState(0.8);
103
+ const [error, setError] = react.useState(null);
104
+ const [audioLevel, setAudioLevel] = react.useState(0);
105
+ const recognitionRef = react.useRef(null);
106
+ const synthRef = react.useRef(null);
107
+ const audioContextRef = react.useRef(null);
108
+ const analyserRef = react.useRef(null);
109
+ const microphoneRef = react.useRef(null);
110
+ const animationFrameRef = react.useRef(null);
111
+ const canvasRef = react.useRef(null);
112
+ react.useEffect(() => {
1086
113
  if (typeof window !== "undefined" && "webkitSpeechRecognition" in window) {
1087
114
  const SpeechRecognition = window.webkitSpeechRecognition || window.SpeechRecognition;
1088
115
  recognitionRef.current = new SpeechRecognition();
@@ -1133,12 +160,12 @@ function AIVoice({
1133
160
  }
1134
161
  };
1135
162
  }, [language, wakeWord, isWakeWordActive, onTranscript]);
1136
- React3.useEffect(() => {
163
+ react.useEffect(() => {
1137
164
  if (autoStart) {
1138
165
  startListening();
1139
166
  }
1140
167
  }, [autoStart]);
1141
- const initializeAudioContext = React3.useCallback(async () => {
168
+ const initializeAudioContext = react.useCallback(async () => {
1142
169
  try {
1143
170
  const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
1144
171
  audioContextRef.current = new (window.AudioContext || window.webkitAudioContext)();
@@ -1152,7 +179,7 @@ function AIVoice({
1152
179
  setError("Microphone access denied");
1153
180
  }
1154
181
  }, []);
1155
- const startAudioVisualization = React3.useCallback(() => {
182
+ const startAudioVisualization = react.useCallback(() => {
1156
183
  if (!analyserRef.current || !canvasRef.current) return;
1157
184
  const canvas = canvasRef.current;
1158
185
  const ctx = canvas.getContext("2d");
@@ -1180,7 +207,7 @@ function AIVoice({
1180
207
  };
1181
208
  draw();
1182
209
  }, []);
1183
- const startListening = React3.useCallback(async () => {
210
+ const startListening = react.useCallback(async () => {
1184
211
  if (!recognitionRef.current) {
1185
212
  setError("Speech recognition not supported");
1186
213
  return;
@@ -1194,7 +221,7 @@ function AIVoice({
1194
221
  setError("Failed to start listening");
1195
222
  }
1196
223
  }, [initializeAudioContext]);
1197
- const stopListening = React3.useCallback(() => {
224
+ const stopListening = react.useCallback(() => {
1198
225
  if (recognitionRef.current) {
1199
226
  recognitionRef.current.stop();
1200
227
  }
@@ -1203,7 +230,7 @@ function AIVoice({
1203
230
  cancelAnimationFrame(animationFrameRef.current);
1204
231
  }
1205
232
  }, []);
1206
- const speak = React3.useCallback(
233
+ const speak = react.useCallback(
1207
234
  (text) => {
1208
235
  if (!synthRef.current) return;
1209
236
  synthRef.current.cancel();
@@ -1222,13 +249,13 @@ function AIVoice({
1222
249
  },
1223
250
  [selectedVoice, speechSpeed, speechPitch, speechVolume]
1224
251
  );
1225
- const stopSpeaking = React3.useCallback(() => {
252
+ const stopSpeaking = react.useCallback(() => {
1226
253
  if (synthRef.current) {
1227
254
  synthRef.current.cancel();
1228
255
  setIsSpeaking(false);
1229
256
  }
1230
257
  }, []);
1231
- const checkForCommands = React3.useCallback(
258
+ const checkForCommands = react.useCallback(
1232
259
  (text) => {
1233
260
  const words = text.toLowerCase().trim();
1234
261
  for (const { pattern, command, extract } of commandPatterns) {
@@ -1247,7 +274,7 @@ function AIVoice({
1247
274
  },
1248
275
  [onCommand]
1249
276
  );
1250
- const handleWakeWordDetected = React3.useCallback(
277
+ const handleWakeWordDetected = react.useCallback(
1251
278
  (text) => {
1252
279
  speak("How can I help you?");
1253
280
  const afterWakeWord = text.split(wakeWord)[1]?.trim();
@@ -1257,11 +284,11 @@ function AIVoice({
1257
284
  },
1258
285
  [speak, wakeWord, checkForCommands]
1259
286
  );
1260
- const clearTranscript = React3.useCallback(() => {
287
+ const clearTranscript = react.useCallback(() => {
1261
288
  setTranscript("");
1262
289
  setFinalTranscript("");
1263
290
  }, []);
1264
- const handleKeyDown = React3.useCallback(
291
+ const handleKeyDown = react.useCallback(
1265
292
  (event) => {
1266
293
  switch (event.key) {
1267
294
  case " ":
@@ -1307,7 +334,7 @@ function AIVoice({
1307
334
  /* @__PURE__ */ jsxRuntime.jsx(ui.CardHeader, { ...ui.sx("pb-3"), children: /* @__PURE__ */ jsxRuntime.jsxs(ui.CardTitle, { ...ui.sx("flex items-center justify-between"), children: [
1308
335
  "AI Voice Interface",
1309
336
  /* @__PURE__ */ jsxRuntime.jsx(
1310
- Button,
337
+ button_js.Button,
1311
338
  {
1312
339
  variant: "outline",
1313
340
  size: "sm",
@@ -1331,7 +358,7 @@ function AIVoice({
1331
358
  ] }),
1332
359
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { className: "flex items-center justify-center gap-4", children: [
1333
360
  /* @__PURE__ */ jsxRuntime.jsxs(
1334
- Button,
361
+ button_js.Button,
1335
362
  {
1336
363
  variant: isListening ? "destructive" : "default",
1337
364
  size: "lg",
@@ -1350,7 +377,7 @@ function AIVoice({
1350
377
  }
1351
378
  ),
1352
379
  /* @__PURE__ */ jsxRuntime.jsxs(
1353
- Button,
380
+ button_js.Button,
1354
381
  {
1355
382
  variant: isSpeaking ? "destructive" : "outline",
1356
383
  size: "lg",
@@ -1362,7 +389,7 @@ function AIVoice({
1362
389
  ]
1363
390
  }
1364
391
  ),
1365
- /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "lg", onClick: clearTranscript, children: [
392
+ /* @__PURE__ */ jsxRuntime.jsxs(button_js.Button, { variant: "outline", size: "lg", onClick: clearTranscript, children: [
1366
393
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCcw, { style: ui.css("h-4 w-4") }),
1367
394
  /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { tag: "span", className: "ml-2", children: "Clear" })
1368
395
  ] })
@@ -1377,7 +404,7 @@ function AIVoice({
1377
404
  ] })
1378
405
  ] }),
1379
406
  /* @__PURE__ */ jsxRuntime.jsx(
1380
- Switch2,
407
+ switch_js.Switch,
1381
408
  {
1382
409
  checked: isWakeWordActive,
1383
410
  onCheckedChange: setIsWakeWordActive
@@ -1385,10 +412,10 @@ function AIVoice({
1385
412
  )
1386
413
  ] }),
1387
414
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { className: "flex items-center gap-2", children: [
1388
- isListening && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "solid", ...ui.sx("animate-pulse"), children: "Listening" }),
1389
- isSpeaking && /* @__PURE__ */ jsxRuntime.jsx(Badge, { colorPalette: "gray", ...ui.sx("animate-pulse"), children: "Speaking" }),
1390
- isWakeWordActive && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", children: "Wake Word Active" }),
1391
- audioLevel > 0.1 && /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "outline", children: [
415
+ isListening && /* @__PURE__ */ jsxRuntime.jsx(badge_js.Badge, { variant: "solid", ...ui.sx("animate-pulse"), children: "Listening" }),
416
+ isSpeaking && /* @__PURE__ */ jsxRuntime.jsx(badge_js.Badge, { colorPalette: "gray", ...ui.sx("animate-pulse"), children: "Speaking" }),
417
+ isWakeWordActive && /* @__PURE__ */ jsxRuntime.jsx(badge_js.Badge, { variant: "outline", children: "Wake Word Active" }),
418
+ audioLevel > 0.1 && /* @__PURE__ */ jsxRuntime.jsxs(badge_js.Badge, { variant: "outline", children: [
1392
419
  "Audio: ",
1393
420
  Math.round(audioLevel * 100),
1394
421
  "%"
@@ -1401,7 +428,7 @@ function AIVoice({
1401
428
  /* @__PURE__ */ jsxRuntime.jsx(ui.CardHeader, { ...ui.sx("pb-3"), children: /* @__PURE__ */ jsxRuntime.jsx(ui.CardTitle, { ...ui.sx("text-lg"), children: "Transcript" }) }),
1402
429
  /* @__PURE__ */ jsxRuntime.jsxs(ui.CardContent, { children: [
1403
430
  /* @__PURE__ */ jsxRuntime.jsx(
1404
- Textarea,
431
+ textarea_js.Textarea,
1405
432
  {
1406
433
  value: finalTranscript + (transcript ? ` ${transcript}` : ""),
1407
434
  onChange: (e) => setFinalTranscript(e.target.value),
@@ -1443,7 +470,7 @@ function AIVoice({
1443
470
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { className: "space-y-2", children: [
1444
471
  /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { tag: "label", className: "text-sm font-medium", children: "Speed" }),
1445
472
  /* @__PURE__ */ jsxRuntime.jsx(
1446
- Slider,
473
+ slider_js.Slider,
1447
474
  {
1448
475
  value: [speechSpeed],
1449
476
  onValueChange: ([value]) => setSpeechSpeed(value),
@@ -1461,7 +488,7 @@ function AIVoice({
1461
488
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { className: "space-y-2", children: [
1462
489
  /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { tag: "label", className: "text-sm font-medium", children: "Pitch" }),
1463
490
  /* @__PURE__ */ jsxRuntime.jsx(
1464
- Slider,
491
+ slider_js.Slider,
1465
492
  {
1466
493
  value: [speechPitch],
1467
494
  onValueChange: ([value]) => setSpeechPitch(value),
@@ -1479,7 +506,7 @@ function AIVoice({
1479
506
  /* @__PURE__ */ jsxRuntime.jsxs(ui.Box, { className: "space-y-2", children: [
1480
507
  /* @__PURE__ */ jsxRuntime.jsx(ui.Box, { tag: "label", className: "text-sm font-medium", children: "Volume" }),
1481
508
  /* @__PURE__ */ jsxRuntime.jsx(
1482
- Slider,
509
+ slider_js.Slider,
1483
510
  {
1484
511
  value: [speechVolume],
1485
512
  onValueChange: ([value]) => setSpeechVolume(value),