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