@luxfi/ui 7.4.10 → 7.4.11

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 (78) hide show
  1. package/dist/accordion.cjs +107 -166
  2. package/dist/accordion.d.cts +18 -51
  3. package/dist/accordion.d.ts +18 -51
  4. package/dist/accordion.js +109 -166
  5. package/dist/chrome.cjs +193 -379
  6. package/dist/chrome.js +195 -379
  7. package/dist/collapsible.cjs +35 -26
  8. package/dist/collapsible.d.cts +2 -1
  9. package/dist/collapsible.d.ts +2 -1
  10. package/dist/collapsible.js +34 -24
  11. package/dist/dialog.d.cts +1 -1
  12. package/dist/dialog.d.ts +1 -1
  13. package/dist/drawer.cjs +92 -115
  14. package/dist/drawer.d.cts +43 -10
  15. package/dist/drawer.d.ts +43 -10
  16. package/dist/drawer.js +94 -115
  17. package/dist/field.cjs +60 -109
  18. package/dist/field.d.cts +0 -1
  19. package/dist/field.d.ts +0 -1
  20. package/dist/field.js +61 -109
  21. package/dist/heading.cjs +10 -17
  22. package/dist/heading.d.cts +0 -2
  23. package/dist/heading.d.ts +0 -2
  24. package/dist/heading.js +10 -17
  25. package/dist/icon-button.cjs +82 -82
  26. package/dist/icon-button.d.cts +16 -12
  27. package/dist/icon-button.d.ts +16 -12
  28. package/dist/icon-button.js +82 -82
  29. package/dist/index.cjs +1073 -1419
  30. package/dist/index.d.cts +1 -5
  31. package/dist/index.d.ts +1 -5
  32. package/dist/index.js +1075 -1414
  33. package/dist/input-group.cjs +11 -12
  34. package/dist/input-group.js +11 -12
  35. package/dist/input.cjs +27 -27
  36. package/dist/input.d.cts +21 -1
  37. package/dist/input.d.ts +21 -1
  38. package/dist/input.js +25 -28
  39. package/dist/menu.cjs +160 -271
  40. package/dist/menu.d.cts +41 -57
  41. package/dist/menu.d.ts +41 -57
  42. package/dist/menu.js +161 -251
  43. package/dist/popover.cjs +1 -1
  44. package/dist/popover.js +1 -1
  45. package/dist/select.cjs +40 -39
  46. package/dist/select.d.cts +35 -4
  47. package/dist/select.d.ts +35 -4
  48. package/dist/select.js +40 -38
  49. package/dist/separator.cjs +8 -33
  50. package/dist/separator.js +8 -33
  51. package/dist/tabs.cjs +108 -197
  52. package/dist/tabs.d.cts +16 -60
  53. package/dist/tabs.d.ts +16 -60
  54. package/dist/tabs.js +109 -196
  55. package/dist/textarea.cjs +56 -27
  56. package/dist/textarea.js +57 -28
  57. package/dist/toaster.cjs +97 -79
  58. package/dist/toaster.d.cts +7 -8
  59. package/dist/toaster.d.ts +7 -8
  60. package/dist/toaster.js +78 -80
  61. package/package.json +2 -16
  62. package/src/accordion.tsx +173 -227
  63. package/src/collapsible.tsx +55 -52
  64. package/src/drawer.tsx +123 -115
  65. package/src/field.tsx +68 -124
  66. package/src/heading.tsx +22 -26
  67. package/src/icon-button.tsx +134 -141
  68. package/src/ink.tsx +37 -0
  69. package/src/input-group.tsx +21 -12
  70. package/src/input.tsx +41 -32
  71. package/src/menu.tsx +224 -397
  72. package/src/popover.tsx +1 -1
  73. package/src/select.tsx +80 -59
  74. package/src/separator.tsx +13 -34
  75. package/src/tabs.tsx +166 -296
  76. package/src/textarea.tsx +19 -29
  77. package/src/toaster.tsx +118 -86
  78. package/tokens.css +61 -0
package/dist/menu.cjs CHANGED
@@ -1,293 +1,182 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var DropdownMenu = require('@radix-ui/react-dropdown-menu');
5
- var React = require('react');
4
+ var gui = require('@hanzo/gui');
6
5
  var lucideReact = require('lucide-react');
7
- var clsx = require('clsx');
8
- var tailwindMerge = require('tailwind-merge');
6
+ var react = require('react');
9
7
  var jsxRuntime = require('react/jsx-runtime');
10
8
 
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 DropdownMenu__namespace = /*#__PURE__*/_interopNamespace(DropdownMenu);
30
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
31
-
32
- function cn(...inputs) {
33
- return tailwindMerge.twMerge(clsx.clsx(inputs));
34
- }
35
- function parsePlacement(placement) {
36
- if (!placement) {
37
- return { side: "bottom", align: "start" };
38
- }
39
- const parts = placement.split("-");
40
- const side = parts[0] ?? "bottom";
41
- const alignPart = parts[1];
42
- let align = "center";
43
- if (alignPart === "start") {
44
- align = "start";
45
- } else if (alignPart === "end") {
46
- align = "end";
47
- }
48
- return { side, align };
49
- }
50
- var PositioningContext = React__namespace.createContext({
51
- side: "bottom",
52
- align: "start",
53
- sideOffset: 4,
54
- alignOffset: 0
55
- });
56
- var MenuRoot = (props) => {
57
- const {
58
- children,
9
+ var ink = (children, Wrap = gui.Text, props = {}) => {
10
+ let hasText = false;
11
+ react.Children.forEach(children, (child) => {
12
+ if (typeof child === "string" || typeof child === "number") hasText = true;
13
+ });
14
+ if (!hasText) return children;
15
+ return react.Children.map(children, (child) => typeof child === "string" || typeof child === "number" ? react.createElement(Wrap, props, child) : child);
16
+ };
17
+ var ITEM_HOVER = "var(--color-popover-item-hover)";
18
+ var TEXT = "var(--color-text-primary)";
19
+ var ROW = {
20
+ position: "relative",
21
+ flexDirection: "row",
22
+ alignItems: "center",
23
+ cursor: "pointer",
24
+ userSelect: "none",
25
+ borderRadius: 6,
26
+ fontSize: 14,
27
+ backgroundColor: "transparent",
28
+ hoverStyle: { backgroundColor: ITEM_HOVER },
29
+ focusStyle: { backgroundColor: ITEM_HOVER }
30
+ };
31
+ var MenuRoot = ({
32
+ children,
33
+ open,
34
+ defaultOpen,
35
+ onOpenChange,
36
+ positioning,
37
+ modal = true
38
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
39
+ gui.Menu,
40
+ {
59
41
  open,
60
42
  defaultOpen,
61
- onOpenChange,
62
- positioning,
63
- modal = true,
64
- // lazyMount / unmountOnExit have no direct Radix equivalent; Radix handles
65
- // mount/unmount automatically.
66
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
67
- lazyMount: _lazyMount,
68
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
69
- unmountOnExit: _unmountOnExit
70
- } = props;
71
- const mergedPositioning = {
72
- placement: "bottom-start",
73
- ...positioning,
74
- offset: {
75
- mainAxis: 4,
76
- ...positioning?.offset
77
- }
78
- };
79
- const { side, align } = parsePlacement(mergedPositioning.placement);
80
- const positioningValue = React__namespace.useMemo(() => ({
81
- side,
82
- align,
83
- sideOffset: mergedPositioning.offset?.mainAxis ?? 4,
84
- alignOffset: mergedPositioning.offset?.crossAxis ?? 0
85
- }), [side, align, mergedPositioning.offset?.mainAxis, mergedPositioning.offset?.crossAxis]);
86
- const handleOpenChange = React__namespace.useCallback((isOpen) => {
87
- onOpenChange?.({ open: isOpen });
88
- }, [onOpenChange]);
89
- return /* @__PURE__ */ jsxRuntime.jsx(PositioningContext.Provider, { value: positioningValue, children: /* @__PURE__ */ jsxRuntime.jsx(
90
- DropdownMenu__namespace.Root,
91
- {
92
- open,
93
- defaultOpen,
94
- onOpenChange: handleOpenChange,
95
- modal,
96
- children
97
- }
98
- ) });
99
- };
100
- var MenuTrigger = React__namespace.forwardRef(function MenuTrigger2(props, ref) {
101
- const { asChild = false, ...rest } = props;
102
- return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Trigger, { asChild, ref, ...rest });
103
- });
104
- var MenuContent = React__namespace.forwardRef(function MenuContent2(props, ref) {
105
- const { portalled = true, portalRef, className, zIndex, minW, style, ...rest } = props;
106
- const positioning = React__namespace.useContext(PositioningContext);
107
- const mergedStyle = {
108
- ...style,
109
- ...zIndex !== void 0 ? { zIndex: typeof zIndex === "string" ? `var(--z-index-${zIndex}, ${zIndex})` : zIndex } : {},
110
- ...minW !== void 0 ? { minWidth: minW } : {}
111
- };
112
- const content = /* @__PURE__ */ jsxRuntime.jsx(
113
- DropdownMenu__namespace.Content,
114
- {
115
- ref,
116
- side: positioning.side,
117
- align: positioning.align,
118
- sideOffset: positioning.sideOffset,
119
- alignOffset: positioning.alignOffset,
120
- className: cn(
121
- "z-50 min-w-[8rem] overflow-hidden rounded-lg p-1",
122
- "border border-[var(--color-popover-border,var(--color-border-divider))]",
123
- "bg-[var(--color-popover-bg,var(--color-dialog-bg))]",
124
- "shadow-[0_4px_12px_var(--color-popover-shadow)]",
125
- "outline-none",
126
- "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
127
- "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
128
- "data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2",
129
- "data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
130
- className
131
- ),
132
- style: Object.keys(mergedStyle).length > 0 ? mergedStyle : void 0,
133
- ...rest
134
- }
135
- );
136
- if (!portalled) {
137
- return content;
43
+ onOpenChange: onOpenChange ? (isOpen) => onOpenChange({ open: isOpen }) : void 0,
44
+ modal,
45
+ placement: positioning?.placement ?? "bottom-start",
46
+ offset: positioning?.offset?.mainAxis ?? 4,
47
+ children
138
48
  }
139
- return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Portal, { container: portalRef?.current ?? void 0, children: content });
140
- });
141
- var MenuItem = React__namespace.forwardRef(function MenuItem2(props, ref) {
142
- const { className, value: _value, asChild, closeOnSelect: _closeOnSelect, disabled, children, onClick, ...rest } = props;
143
- return /* @__PURE__ */ jsxRuntime.jsx(
144
- DropdownMenu__namespace.Item,
49
+ );
50
+ var MenuTrigger = ({ asChild = false, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(gui.Menu.Trigger, { asChild, ...rest });
51
+ var MenuContent = ({
52
+ portalled = true,
53
+ minW,
54
+ children,
55
+ ...rest
56
+ }) => {
57
+ const content = /* @__PURE__ */ jsxRuntime.jsx(
58
+ gui.Menu.Content,
145
59
  {
146
- ref,
147
- asChild,
148
- disabled,
149
- onClick,
150
- className: cn(
151
- "relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm",
152
- "outline-none transition-colors",
153
- "text-[var(--color-text-primary,inherit)]",
154
- "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
155
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
156
- className
157
- ),
60
+ unstyled: true,
61
+ zIndex: 50,
62
+ minWidth: minW ?? 128,
63
+ overflow: "hidden",
64
+ borderRadius: 8,
65
+ padding: 4,
66
+ borderWidth: 1,
67
+ borderColor: "var(--color-popover-border)",
68
+ backgroundColor: "var(--color-popover-bg)",
69
+ transition: "quick",
70
+ enterStyle: { opacity: 0, scale: 0.95 },
71
+ exitStyle: { opacity: 0, scale: 0.95 },
158
72
  ...rest,
159
73
  children
160
74
  }
161
75
  );
162
- });
163
- var MenuItemText = React__namespace.forwardRef(function MenuItemText2(props, ref) {
164
- const { className, ...rest } = props;
165
- return /* @__PURE__ */ jsxRuntime.jsx("span", { ref, className: cn("flex-1", className), ...rest });
166
- });
167
- var MenuItemCommand = React__namespace.forwardRef(function MenuItemCommand2(props, ref) {
168
- const { className, ...rest } = props;
169
- return /* @__PURE__ */ jsxRuntime.jsx(
170
- "span",
171
- {
172
- ref,
173
- className: cn("ml-auto text-xs tracking-widest opacity-60", className),
174
- ...rest
175
- }
176
- );
177
- });
178
- var MenuSeparator = React__namespace.forwardRef(function MenuSeparator2(props, ref) {
179
- const { className, ...rest } = props;
180
- return /* @__PURE__ */ jsxRuntime.jsx(
181
- DropdownMenu__namespace.Separator,
182
- {
183
- ref,
184
- className: cn("-mx-1 my-1 h-px bg-[var(--color-border-divider)]", className),
185
- ...rest
186
- }
187
- );
188
- });
189
- var MenuItemGroup = React__namespace.forwardRef(function MenuItemGroup2(props, ref) {
190
- const { title, children, className, ...rest } = props;
191
- return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu__namespace.Group, { ref, className, ...rest, children: [
192
- title && /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Label, { className: "px-2 py-1.5 text-xs font-semibold select-none opacity-60", children: title }),
193
- children
194
- ] });
195
- });
196
- var MenuArrow = React__namespace.forwardRef(function MenuArrow2(props, ref) {
197
- const { className, ...rest } = props;
198
- return /* @__PURE__ */ jsxRuntime.jsx(
199
- DropdownMenu__namespace.Arrow,
200
- {
201
- ref,
202
- className: cn("fill-[var(--color-popover-bg,var(--color-dialog-bg))]", className),
203
- ...rest
204
- }
205
- );
206
- });
207
- var MenuCheckboxItem = React__namespace.forwardRef(function MenuCheckboxItem2(props, ref) {
208
- const { className, children, checked, onCheckedChange, onClick, ...rest } = props;
209
- return /* @__PURE__ */ jsxRuntime.jsxs(
210
- DropdownMenu__namespace.CheckboxItem,
76
+ return portalled ? /* @__PURE__ */ jsxRuntime.jsx(gui.Menu.Portal, { children: content }) : content;
77
+ };
78
+ var MenuItem = ({ children, value: _value, asChild, ...rest }) => (
79
+ // `asChild` means the caller brought its own element and owns the look. Its
80
+ // props are then forwarded to that element verbatim, so the skin must NOT be
81
+ // applied: `unstyled` and friends are not DOM attributes and React rejects
82
+ // them out loud ("Received `true` for a non-boolean attribute `unstyled`").
83
+ // Two shapes, said once, rather than one shape that is wrong in one of them.
84
+ asChild ? /* @__PURE__ */ jsxRuntime.jsx(gui.Menu.Item, { asChild: true, ...rest, children }) : /* @__PURE__ */ jsxRuntime.jsx(
85
+ gui.Menu.Item,
211
86
  {
212
- ref,
213
- checked,
214
- onCheckedChange,
215
- onClick,
216
- className: cn(
217
- "relative flex cursor-pointer select-none items-center rounded-md py-1.5 pr-2 pl-8 text-sm",
218
- "outline-none transition-colors",
219
- "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
220
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
221
- className
222
- ),
87
+ unstyled: true,
88
+ ...ROW,
89
+ gap: 8,
90
+ paddingHorizontal: 8,
91
+ paddingVertical: 6,
92
+ disabledStyle: { opacity: 0.5, pointerEvents: "none" },
223
93
  ...rest,
224
- children: [
225
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
226
- children
227
- ]
228
- }
229
- );
230
- });
231
- var MenuRadioItemGroup = React__namespace.forwardRef(function MenuRadioItemGroup2(props, ref) {
232
- const { value, onValueChange, ...rest } = props;
233
- return /* @__PURE__ */ jsxRuntime.jsx(
234
- DropdownMenu__namespace.RadioGroup,
235
- {
236
- ref,
237
- value,
238
- onValueChange,
239
- ...rest
94
+ children: ink(children, void 0, { fontSize: 14, color: TEXT })
240
95
  }
241
- );
242
- });
243
- var MenuRadioItem = React__namespace.forwardRef(function MenuRadioItem2(props, ref) {
244
- const { className, children, value, onClick, ...rest } = props;
245
- const { value: _v, ...radixRest } = rest;
246
- return /* @__PURE__ */ jsxRuntime.jsxs(
247
- DropdownMenu__namespace.RadioItem,
248
- {
249
- ref,
250
- value,
251
- onClick,
252
- className: cn(
253
- "relative flex cursor-pointer select-none items-center rounded-md py-1.5 pr-2 pl-8 text-sm",
254
- "outline-none transition-colors",
255
- "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
256
- "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
257
- className
258
- ),
259
- children: [
260
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "h-4 w-4" }) }) }),
261
- /* @__PURE__ */ jsxRuntime.jsx("span", { children })
262
- ]
263
- }
264
- );
265
- });
266
- var MenuContextTrigger = React__namespace.forwardRef(function MenuContextTrigger2(props, ref) {
267
- const { asChild: _asChild, ...rest } = props;
268
- return /* @__PURE__ */ jsxRuntime.jsx("span", { ref, ...rest });
269
- });
270
- var MenuTriggerItem = React__namespace.forwardRef(function MenuTriggerItem2(props, ref) {
271
- const { startIcon, children, className, ...rest } = props;
272
- return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu__namespace.Sub, { children: /* @__PURE__ */ jsxRuntime.jsxs(
273
- DropdownMenu__namespace.SubTrigger,
96
+ )
97
+ );
98
+ var MenuItemText = (props) => /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { flex: 1, fontSize: 14, color: TEXT, ...props });
99
+ var MenuItemCommand = (props) => /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { marginLeft: "auto", fontSize: 12, letterSpacing: 1, opacity: 0.6, color: TEXT, ...props });
100
+ var MenuSeparator = (props) => /* @__PURE__ */ jsxRuntime.jsx(
101
+ gui.Menu.Separator,
102
+ {
103
+ unstyled: true,
104
+ height: 1,
105
+ marginVertical: 4,
106
+ marginHorizontal: -4,
107
+ backgroundColor: "var(--color-border-divider)",
108
+ ...props
109
+ }
110
+ );
111
+ var MenuItemGroup = ({ title, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsxs(gui.Menu.Group, { unstyled: true, ...rest, children: [
112
+ title && /* @__PURE__ */ jsxRuntime.jsx(
113
+ gui.Menu.Label,
274
114
  {
275
- ref,
276
- className: cn(
277
- "relative flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm",
278
- "outline-none transition-colors",
279
- "data-[highlighted]:bg-[var(--color-popover-item-hover,rgba(0,0,0,0.04))]",
280
- className
281
- ),
282
- ...rest,
283
- children: [
284
- startIcon,
285
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1", children }),
286
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
287
- ]
115
+ unstyled: true,
116
+ paddingHorizontal: 8,
117
+ paddingVertical: 6,
118
+ fontSize: 12,
119
+ fontWeight: "600",
120
+ userSelect: "none",
121
+ opacity: 0.6,
122
+ color: TEXT,
123
+ children: title
288
124
  }
289
- ) });
290
- });
125
+ ),
126
+ children
127
+ ] });
128
+ var MenuArrow = (props) => /* @__PURE__ */ jsxRuntime.jsx(gui.Menu.Arrow, { backgroundColor: "var(--color-popover-bg)", ...props });
129
+ var Indicator = () => /* @__PURE__ */ jsxRuntime.jsx(gui.View, { position: "absolute", left: 8, width: 14, height: 14, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(gui.Menu.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { size: 16 }) }) });
130
+ var MenuCheckboxItem = ({ children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsxs(
131
+ gui.Menu.CheckboxItem,
132
+ {
133
+ unstyled: true,
134
+ ...ROW,
135
+ paddingLeft: 32,
136
+ paddingRight: 8,
137
+ paddingVertical: 6,
138
+ disabledStyle: { opacity: 0.5, pointerEvents: "none" },
139
+ ...rest,
140
+ children: [
141
+ /* @__PURE__ */ jsxRuntime.jsx(Indicator, {}),
142
+ ink(children, void 0, { fontSize: 14, color: TEXT })
143
+ ]
144
+ }
145
+ );
146
+ var MenuRadioItemGroup = (props) => /* @__PURE__ */ jsxRuntime.jsx(gui.Menu.RadioGroup, { ...props });
147
+ var MenuRadioItem = ({ children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsxs(
148
+ gui.Menu.RadioItem,
149
+ {
150
+ unstyled: true,
151
+ ...ROW,
152
+ paddingLeft: 32,
153
+ paddingRight: 8,
154
+ paddingVertical: 6,
155
+ disabledStyle: { opacity: 0.5, pointerEvents: "none" },
156
+ ...rest,
157
+ children: [
158
+ /* @__PURE__ */ jsxRuntime.jsx(Indicator, {}),
159
+ ink(children, void 0, { fontSize: 14, color: TEXT })
160
+ ]
161
+ }
162
+ );
163
+ var MenuContextTrigger = ({ asChild: _asChild, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(gui.View, { ...rest });
164
+ var MenuTriggerItem = ({ startIcon, children, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(gui.Menu.Sub, { children: /* @__PURE__ */ jsxRuntime.jsxs(
165
+ gui.Menu.SubTrigger,
166
+ {
167
+ unstyled: true,
168
+ ...ROW,
169
+ gap: 8,
170
+ paddingHorizontal: 8,
171
+ paddingVertical: 6,
172
+ ...rest,
173
+ children: [
174
+ startIcon,
175
+ /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { flex: 1, children: ink(children, void 0, { fontSize: 14, color: TEXT }) }),
176
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { size: 16 })
177
+ ]
178
+ }
179
+ ) });
291
180
 
292
181
  exports.MenuArrow = MenuArrow;
293
182
  exports.MenuCheckboxItem = MenuCheckboxItem;
package/dist/menu.d.cts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Menu, Text, View } from '@hanzo/gui';
1
2
  import * as React from 'react';
2
3
 
3
4
  interface Positioning {
@@ -15,70 +16,53 @@ interface MenuRootProps {
15
16
  open: boolean;
16
17
  }) => void;
17
18
  readonly positioning?: Positioning;
18
- readonly lazyMount?: boolean;
19
- readonly unmountOnExit?: boolean;
20
19
  readonly modal?: boolean;
21
20
  }
22
- declare const MenuRoot: (props: MenuRootProps) => React.ReactElement;
23
- interface MenuTriggerProps extends React.ComponentPropsWithoutRef<'button'> {
24
- readonly asChild?: boolean;
25
- }
26
- declare const MenuTrigger: React.ForwardRefExoticComponent<MenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
27
- interface MenuContentProps extends React.ComponentPropsWithoutRef<'div'> {
21
+ declare const MenuRoot: ({ children, open, defaultOpen, onOpenChange, positioning, modal, }: MenuRootProps) => React.ReactElement;
22
+ type MenuTriggerProps = React.ComponentProps<typeof Menu.Trigger>;
23
+ declare const MenuTrigger: ({ asChild, ...rest }: MenuTriggerProps) => React.ReactElement;
24
+ type MenuContentProps = React.ComponentProps<typeof Menu.Content> & {
28
25
  readonly portalled?: boolean;
29
- readonly portalRef?: React.RefObject<HTMLElement>;
30
- /** Legacy Chakra zIndex prop - mapped to inline style */
31
- readonly zIndex?: string | number;
32
- /** Legacy Chakra minW prop - mapped to inline style */
33
26
  readonly minW?: string | number;
34
- }
35
- declare const MenuContent: React.ForwardRefExoticComponent<MenuContentProps & React.RefAttributes<HTMLDivElement>>;
36
- interface MenuItemProps extends React.ComponentPropsWithoutRef<'div'> {
37
- /** Informational value identifier (not used by Radix but kept for API compat) */
27
+ };
28
+ declare const MenuContent: ({ portalled, minW, children, ...rest }: MenuContentProps) => React.ReactElement;
29
+ type MenuItemProps = React.ComponentProps<typeof Menu.Item> & {
30
+ /** Informational identifier the row's own name, not read by the engine. */
38
31
  readonly value?: string;
39
- readonly disabled?: boolean;
40
- readonly asChild?: boolean;
41
- /** Chakra compat - accepted but not used by Radix */
42
- readonly closeOnSelect?: boolean;
43
- }
44
- declare const MenuItem: React.ForwardRefExoticComponent<MenuItemProps & React.RefAttributes<HTMLDivElement>>;
45
- interface MenuItemTextProps extends React.ComponentPropsWithoutRef<'span'> {
46
- }
47
- declare const MenuItemText: React.ForwardRefExoticComponent<MenuItemTextProps & React.RefAttributes<HTMLSpanElement>>;
48
- interface MenuItemCommandProps extends React.ComponentPropsWithoutRef<'span'> {
49
- }
50
- declare const MenuItemCommand: React.ForwardRefExoticComponent<MenuItemCommandProps & React.RefAttributes<HTMLSpanElement>>;
51
- interface MenuSeparatorProps extends React.ComponentPropsWithoutRef<'div'> {
52
- }
53
- declare const MenuSeparator: React.ForwardRefExoticComponent<MenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
54
- interface MenuItemGroupProps extends React.ComponentPropsWithoutRef<'div'> {
32
+ };
33
+ declare const MenuItem: ({ children, value: _value, asChild, ...rest }: MenuItemProps) => React.ReactElement;
34
+ type MenuItemTextProps = React.ComponentProps<typeof Text>;
35
+ declare const MenuItemText: (props: MenuItemTextProps) => React.ReactElement;
36
+ type MenuItemCommandProps = React.ComponentProps<typeof Text>;
37
+ /** The keyboard shortcut on the trailing edge of a row. */
38
+ declare const MenuItemCommand: (props: MenuItemCommandProps) => React.ReactElement;
39
+ type MenuSeparatorProps = React.ComponentProps<typeof Menu.Separator>;
40
+ declare const MenuSeparator: (props: MenuSeparatorProps) => React.ReactElement;
41
+ type MenuItemGroupProps = React.ComponentProps<typeof Menu.Group> & {
55
42
  readonly title?: string;
56
- }
57
- declare const MenuItemGroup: React.ForwardRefExoticComponent<MenuItemGroupProps & React.RefAttributes<HTMLDivElement>>;
58
- interface MenuArrowProps extends React.ComponentPropsWithoutRef<'svg'> {
59
- }
60
- declare const MenuArrow: React.ForwardRefExoticComponent<MenuArrowProps & React.RefAttributes<SVGSVGElement>>;
61
- interface MenuCheckboxItemProps extends React.ComponentPropsWithoutRef<'div'> {
62
- readonly checked?: boolean;
63
- readonly onCheckedChange?: (checked: boolean) => void;
64
- }
65
- declare const MenuCheckboxItem: React.ForwardRefExoticComponent<MenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>>;
66
- interface MenuRadioItemGroupProps extends React.ComponentPropsWithoutRef<'div'> {
67
- readonly value?: string;
68
- readonly onValueChange?: (value: string) => void;
69
- }
70
- declare const MenuRadioItemGroup: React.ForwardRefExoticComponent<MenuRadioItemGroupProps & React.RefAttributes<HTMLDivElement>>;
71
- interface MenuRadioItemProps extends React.ComponentPropsWithoutRef<'div'> {
72
- readonly value: string;
73
- }
74
- declare const MenuRadioItem: React.ForwardRefExoticComponent<MenuRadioItemProps & React.RefAttributes<HTMLDivElement>>;
75
- interface MenuContextTriggerProps extends React.ComponentPropsWithoutRef<'span'> {
43
+ };
44
+ declare const MenuItemGroup: ({ title, children, ...rest }: MenuItemGroupProps) => React.ReactElement;
45
+ type MenuArrowProps = React.ComponentProps<typeof Menu.Arrow>;
46
+ declare const MenuArrow: (props: MenuArrowProps) => React.ReactElement;
47
+ type MenuCheckboxItemProps = React.ComponentProps<typeof Menu.CheckboxItem>;
48
+ declare const MenuCheckboxItem: ({ children, ...rest }: MenuCheckboxItemProps) => React.ReactElement;
49
+ type MenuRadioItemGroupProps = React.ComponentProps<typeof Menu.RadioGroup>;
50
+ declare const MenuRadioItemGroup: (props: MenuRadioItemGroupProps) => React.ReactElement;
51
+ type MenuRadioItemProps = React.ComponentProps<typeof Menu.RadioItem>;
52
+ declare const MenuRadioItem: ({ children, ...rest }: MenuRadioItemProps) => React.ReactElement;
53
+ type MenuContextTriggerProps = React.ComponentProps<typeof View> & {
76
54
  readonly asChild?: boolean;
77
- }
78
- declare const MenuContextTrigger: React.ForwardRefExoticComponent<MenuContextTriggerProps & React.RefAttributes<HTMLSpanElement>>;
79
- interface MenuTriggerItemProps extends React.ComponentPropsWithoutRef<'div'> {
55
+ };
56
+ /**
57
+ * A right-click target. This menu is a DROPDOWN — it opens from its trigger, not
58
+ * from a pointer position — so the wrapper passes its children through. gui does
59
+ * ship a real `ContextMenu`; a surface that wants one should reach for that
60
+ * rather than have this quietly behave like it.
61
+ */
62
+ declare const MenuContextTrigger: ({ asChild: _asChild, ...rest }: MenuContextTriggerProps) => React.ReactElement;
63
+ type MenuTriggerItemProps = React.ComponentProps<typeof Menu.SubTrigger> & {
80
64
  readonly startIcon?: React.ReactNode;
81
- }
82
- declare const MenuTriggerItem: React.ForwardRefExoticComponent<MenuTriggerItemProps & React.RefAttributes<HTMLDivElement>>;
65
+ };
66
+ declare const MenuTriggerItem: ({ startIcon, children, ...rest }: MenuTriggerItemProps) => React.ReactElement;
83
67
 
84
68
  export { MenuArrow, type MenuArrowProps, MenuCheckboxItem, type MenuCheckboxItemProps, MenuContent, type MenuContentProps, MenuContextTrigger, type MenuContextTriggerProps, MenuItem, MenuItemCommand, type MenuItemCommandProps, MenuItemGroup, type MenuItemGroupProps, type MenuItemProps, MenuItemText, type MenuItemTextProps, MenuRadioItem, MenuRadioItemGroup, type MenuRadioItemGroupProps, type MenuRadioItemProps, MenuRoot, type MenuRootProps, MenuSeparator, type MenuSeparatorProps, MenuTrigger, MenuTriggerItem, type MenuTriggerItemProps, type MenuTriggerProps };