@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/tabs.js CHANGED
@@ -1,213 +1,126 @@
1
1
  "use client";
2
- import * as RadixTabs from '@radix-ui/react-tabs';
2
+ import { Tabs, useTabsContext, Text } from '@hanzo/gui';
3
3
  import * as React from 'react';
4
- import { clsx } from 'clsx';
5
- import { twMerge } from 'tailwind-merge';
4
+ import { Children, createElement } from 'react';
6
5
  import { jsx } from 'react/jsx-runtime';
7
6
 
8
7
  // src/tabs.tsx
9
- function cn(...inputs) {
10
- return twMerge(clsx(inputs));
11
- }
12
- var ROOT_SIZE_CLASSES = {
13
- sm: "[--tabs-height:2rem] [--tabs-content-padding:1.5rem]",
14
- md: "[--tabs-height:2.5rem] [--tabs-content-padding:1.5rem]",
15
- free: ""
8
+ var ink = (children, Wrap = Text, props = {}) => {
9
+ let hasText = false;
10
+ Children.forEach(children, (child) => {
11
+ if (typeof child === "string" || typeof child === "number") hasText = true;
12
+ });
13
+ if (!hasText) return children;
14
+ return Children.map(children, (child) => typeof child === "string" || typeof child === "number" ? createElement(Wrap, props, child) : child);
16
15
  };
17
- var TabsRoot = React.forwardRef(
18
- function TabsRoot2(props, ref) {
19
- const {
20
- variant = "solid",
21
- size = "md",
22
- fitted,
23
- lazyMount: _lazyMount,
24
- unmountOnExit: _unmountOnExit,
25
- onValueChange,
26
- className,
27
- ...rest
28
- } = props;
29
- const handleValueChange = React.useCallback(
30
- (value) => {
31
- if (!onValueChange) return;
32
- onValueChange({ value });
33
- },
34
- [onValueChange]
35
- );
36
- return /* @__PURE__ */ jsx(
37
- RadixTabs.Root,
38
- {
39
- ref,
40
- "data-variant": variant,
41
- "data-size": size,
42
- "data-fitted": fitted ? "" : void 0,
43
- className: cn(
44
- "relative",
45
- ROOT_SIZE_CLASSES[size],
46
- className
47
- ),
48
- onValueChange: onValueChange ? handleValueChange : void 0,
49
- ...rest
50
- }
51
- );
52
- }
53
- );
54
- var TabsList = React.forwardRef(
55
- function TabsList2(props, ref) {
56
- const {
57
- className,
58
- // Strip Chakra style props
59
- flexWrap: _flexWrap,
60
- alignItems: _alignItems,
61
- whiteSpace: _whiteSpace,
62
- bgColor: _bgColor,
63
- marginBottom: _marginBottom,
64
- mx: _mx,
65
- px: _px,
66
- w: _w,
67
- overflowX: _overflowX,
68
- overscrollBehaviorX: _overscrollBehaviorX,
69
- css: _css,
70
- position: _position,
71
- boxShadow: _boxShadow,
72
- top: _top,
73
- zIndex: _zIndex,
74
- style: styleProp,
75
- asChild,
76
- loop,
77
- ...rest
78
- } = props;
79
- return /* @__PURE__ */ jsx(
80
- RadixTabs.List,
81
- {
82
- ref,
83
- asChild,
84
- loop,
85
- className: cn(
86
- "inline-flex w-full relative isolate flex-row",
87
- "min-h-[var(--tabs-height,2.5rem)]",
88
- className
89
- ),
90
- style: styleProp,
91
- ...rest
92
- }
93
- );
94
- }
95
- );
96
- var TRIGGER_BASE = "outline-none min-w-[var(--tabs-height,2.5rem)] h-[var(--tabs-height,2.5rem)] flex items-center relative cursor-pointer gap-2 focus-visible:z-[1] focus-visible:outline-2 focus-visible:outline-offset-0 disabled:cursor-not-allowed disabled:opacity-50";
97
- var TRIGGER_SIZE_CLASSES = {
98
- sm: "py-1 px-3 text-sm",
99
- md: "py-2 px-4 text-base",
100
- free: ""
16
+ var Shape = React.createContext({
17
+ variant: "solid",
18
+ size: "md",
19
+ fitted: false
20
+ });
21
+ var SIZE = {
22
+ sm: { height: 32, minWidth: 32, paddingVertical: 4, paddingHorizontal: 12, fontSize: 14 },
23
+ md: { height: 40, minWidth: 40, paddingVertical: 8, paddingHorizontal: 16, fontSize: 16 },
24
+ free: {}
101
25
  };
102
- var TRIGGER_VARIANT_CLASSES = {
103
- solid: "font-semibold gap-1 rounded-md bg-transparent text-tabs-solid-fg data-[state=active]:bg-selected-control-bg data-[state=active]:text-selected-control-text data-[state=active]:hover:text-selected-control-text hover:text-hover",
104
- secondary: "font-medium bg-transparent text-tabs-secondary-fg border-2 border-solid border-tabs-secondary-border rounded-md data-[state=active]:bg-selected-control-bg data-[state=active]:text-selected-control-text data-[state=active]:border-transparent data-[state=active]:hover:border-transparent hover:text-hover hover:border-hover",
105
- segmented: "bg-transparent text-text-primary border-2 border-solid border-selected-control-bg hover:text-hover data-[state=active]:text-selected-control-text data-[state=active]:bg-selected-control-bg data-[state=active]:border-selected-control-bg data-[state=active]:hover:text-selected-control-text",
106
- unstyled: ""
26
+ var SELECTED_BG = "var(--color-selected-control-bg)";
27
+ var SELECTED_FG = "var(--color-selected-control-text)";
28
+ var VARIANT = {
29
+ solid: {
30
+ rest: {
31
+ fontWeight: "600",
32
+ borderRadius: 6,
33
+ color: "var(--color-tabs-solid-fg)",
34
+ hoverStyle: { color: "var(--color-hover)" }
35
+ },
36
+ active: { backgroundColor: SELECTED_BG, color: SELECTED_FG }
37
+ },
38
+ secondary: {
39
+ rest: {
40
+ fontWeight: "500",
41
+ borderRadius: 6,
42
+ borderWidth: 2,
43
+ borderColor: "var(--color-tabs-secondary-border)",
44
+ color: "var(--color-tabs-secondary-fg)",
45
+ hoverStyle: { color: "var(--color-hover)", borderColor: "var(--color-hover)" }
46
+ },
47
+ active: { backgroundColor: SELECTED_BG, color: SELECTED_FG, borderColor: "transparent" }
48
+ },
49
+ segmented: {
50
+ rest: {
51
+ borderWidth: 2,
52
+ borderColor: SELECTED_BG,
53
+ color: "var(--color-text-primary)",
54
+ hoverStyle: { color: "var(--color-hover)" }
55
+ },
56
+ active: { backgroundColor: SELECTED_BG, borderColor: SELECTED_BG, color: SELECTED_FG }
57
+ },
58
+ unstyled: { rest: {}, active: {} }
107
59
  };
108
- var TabsTrigger = React.forwardRef(
109
- function TabsTrigger2(props, ref) {
110
- const {
111
- className,
112
- // Strip Chakra style props
113
- scrollSnapAlign: _scrollSnapAlign,
114
- flexShrink: _flexShrink,
115
- bgColor: _bgColor,
116
- w: _w,
117
- py: _py,
118
- borderRadius: _borderRadius,
119
- fontWeight: _fontWeight,
120
- color: _color,
121
- _hover,
122
- position: _position,
123
- top: _top,
124
- left: _left,
125
- visibility: _visibility,
60
+ var LIST_HEIGHT = { sm: 32, md: 40, free: void 0 };
61
+ var TabsRoot = ({
62
+ variant = "solid",
63
+ size = "md",
64
+ fitted = false,
65
+ onValueChange,
66
+ ...rest
67
+ }) => {
68
+ const shape = React.useMemo(() => ({ variant, size, fitted }), [variant, size, fitted]);
69
+ return /* @__PURE__ */ jsx(Shape.Provider, { value: shape, children: /* @__PURE__ */ jsx(
70
+ Tabs,
71
+ {
72
+ unstyled: true,
73
+ position: "relative",
74
+ orientation: "horizontal",
75
+ onValueChange: onValueChange ? (value) => onValueChange({ value }) : void 0,
126
76
  ...rest
127
- } = props;
128
- const internalRef = React.useRef(null);
129
- const mergedRef = useMergedRef(ref, internalRef);
130
- const { variant, size, fitted } = useTabsContext(internalRef);
131
- return /* @__PURE__ */ jsx(
132
- RadixTabs.Trigger,
133
- {
134
- ref: mergedRef,
135
- className: cn(
136
- "group",
137
- TRIGGER_BASE,
138
- TRIGGER_SIZE_CLASSES[size],
139
- TRIGGER_VARIANT_CLASSES[variant],
140
- fitted && "flex-1 text-center justify-center",
141
- className
142
- ),
143
- ...rest
144
- }
145
- );
146
- }
147
- );
148
- var TabsContent = React.forwardRef(
149
- function TabsContent2(props, ref) {
150
- const { className, padding: _padding, ...rest } = props;
151
- return /* @__PURE__ */ jsx(
152
- RadixTabs.Content,
153
- {
154
- ref,
155
- className: cn(
156
- "w-full pt-[var(--tabs-content-padding,1.5rem)]",
157
- "focus-visible:outline-2 focus-visible:outline-offset-[-2px]",
158
- className
159
- ),
160
- ...rest
161
- }
162
- );
163
- }
164
- );
165
- var COUNTER_OVERLOAD = 50;
166
- var TabsCounter = ({ count }) => {
167
- if (count === void 0 || count === null) {
168
- return null;
169
- }
77
+ }
78
+ ) });
79
+ };
80
+ var TabsList = (props) => {
81
+ const { size } = React.useContext(Shape);
170
82
  return /* @__PURE__ */ jsx(
171
- "span",
83
+ Tabs.List,
172
84
  {
173
- className: cn(
174
- "group-hover:text-inherit",
175
- count > 0 ? "text-text-secondary" : "text-[rgba(16,17,18,0.24)] dark:text-[rgba(255,255,255,0.24)]"
176
- ),
177
- children: count > COUNTER_OVERLOAD ? `${COUNTER_OVERLOAD}+` : count
85
+ unstyled: true,
86
+ width: "100%",
87
+ position: "relative",
88
+ flexDirection: "row",
89
+ backgroundColor: "transparent",
90
+ minHeight: LIST_HEIGHT[size],
91
+ ...props
178
92
  }
179
93
  );
180
94
  };
181
- function useTabsContext(triggerRef) {
182
- const [ctx, setCtx] = React.useState({ variant: "solid", size: "md", fitted: false });
183
- React.useEffect(() => {
184
- const el = triggerRef.current;
185
- if (!el) return;
186
- const root = el.closest("[data-variant]");
187
- if (!root) return;
188
- setCtx({
189
- variant: root.getAttribute("data-variant") ?? "solid",
190
- size: root.getAttribute("data-size") ?? "md",
191
- fitted: root.hasAttribute("data-fitted")
192
- });
193
- }, [triggerRef]);
194
- return ctx;
195
- }
196
- function useMergedRef(...refs) {
197
- return React.useCallback(
198
- (instance) => {
199
- for (const ref of refs) {
200
- if (!ref) continue;
201
- if (typeof ref === "function") {
202
- ref(instance);
203
- } else {
204
- ref.current = instance;
205
- }
206
- }
207
- },
208
- // eslint-disable-next-line react-hooks/exhaustive-deps
209
- refs
95
+ var TabsTrigger = ({ children, ...props }) => {
96
+ const { variant, size, fitted } = React.useContext(Shape);
97
+ const { rest, active } = VARIANT[variant];
98
+ const selected = useTabsContext().value === props.value;
99
+ return /* @__PURE__ */ jsx(
100
+ Tabs.Tab,
101
+ {
102
+ unstyled: true,
103
+ flexDirection: "row",
104
+ alignItems: "center",
105
+ justifyContent: "center",
106
+ position: "relative",
107
+ cursor: "pointer",
108
+ gap: 8,
109
+ borderWidth: 0,
110
+ ...SIZE[size],
111
+ ...rest,
112
+ ...selected ? active : null,
113
+ ...fitted ? { flex: 1 } : null,
114
+ ...props,
115
+ children: ink(children, void 0, { fontSize: "inherit", color: "inherit", fontWeight: "inherit" })
116
+ }
210
117
  );
211
- }
118
+ };
119
+ var TabsContent = ({ children, ...props }) => /* @__PURE__ */ jsx(Tabs.Content, { unstyled: true, width: "100%", paddingTop: 24, backgroundColor: "transparent", ...props, children: ink(children) });
120
+ var COUNTER_OVERLOAD = 50;
121
+ var TabsCounter = ({ count }) => {
122
+ if (count === void 0 || count === null) return null;
123
+ return /* @__PURE__ */ jsx(Text, { color: count > 0 ? "var(--color-text-secondary)" : "var(--color-text-disabled)", children: count > COUNTER_OVERLOAD ? `${COUNTER_OVERLOAD}+` : count });
124
+ };
212
125
 
213
126
  export { TabsContent, TabsCounter, TabsList, TabsRoot, TabsTrigger };
package/dist/textarea.cjs CHANGED
@@ -3,8 +3,6 @@
3
3
 
4
4
  var gui = require('@hanzo/gui');
5
5
  var React = require('react');
6
- var clsx = require('clsx');
7
- var tailwindMerge = require('tailwind-merge');
8
6
  var jsxRuntime = require('react/jsx-runtime');
9
7
 
10
8
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -12,31 +10,59 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
12
10
  var React__default = /*#__PURE__*/_interopDefault(React);
13
11
 
14
12
  // src/textarea.tsx
15
- function cn(...inputs) {
16
- return tailwindMerge.twMerge(clsx.clsx(inputs));
17
- }
18
- var TEXTAREA_BASE = [
19
- "w-full appearance-none outline-none transition-colors resize-y",
20
- "bg-[var(--color-input-bg)] text-[var(--color-input-fg)] border-[var(--color-input-border)]",
21
- "placeholder:text-[var(--color-input-placeholder,theme(colors.gray.400))]",
22
- "hover:border-[var(--color-input-border-hover,theme(colors.gray.400))]",
23
- "focus:border-[var(--color-input-border-focus,theme(colors.blue.500))]",
24
- "focus:placeholder:text-[var(--color-input-placeholder-focus,theme(colors.gray.300))]",
25
- "disabled:opacity-40 disabled:cursor-not-allowed",
26
- "read-only:opacity-70",
27
- "data-[invalid]:border-[var(--color-input-border-invalid,theme(colors.red.500))]"
28
- ].join(" ");
29
- var TEXTAREA_SIZE_CLASSES = {
30
- xs: "px-2 py-1 text-xs rounded",
31
- sm: "px-3 py-2 text-sm rounded-md",
32
- md: "px-4 py-2 text-base rounded-md",
33
- lg: "px-4 py-3 text-lg rounded-lg",
34
- "2xl": "px-4 py-3 text-xl rounded-lg"
13
+ var SIZE = {
14
+ xs: { height: 24, paddingHorizontal: 8, fontSize: 12, borderRadius: 4 },
15
+ sm: { height: 32, paddingHorizontal: 12, fontSize: 14, borderRadius: 6 },
16
+ md: { height: 40, paddingHorizontal: 16, fontSize: 16, borderRadius: 6 },
17
+ lg: { height: 48, paddingHorizontal: 16, fontSize: 18, borderRadius: 8 },
18
+ "2xl": { height: 56, paddingHorizontal: 16, fontSize: 20, borderRadius: 8 }
35
19
  };
36
- var TEXTAREA_VARIANT_CLASSES = {
37
- outline: "border border-solid",
38
- filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
39
- unstyled: "border-0 bg-transparent p-0"
20
+ var VARIANT = {
21
+ outline: { borderWidth: 1, borderStyle: "solid" },
22
+ filled: { borderWidth: 0, backgroundColor: "var(--color-input-filled-bg)" },
23
+ unstyled: { borderWidth: 0, backgroundColor: "transparent", padding: 0, height: "auto" }
24
+ };
25
+ var CONTROL = {
26
+ width: "100%",
27
+ outlineWidth: 0,
28
+ backgroundColor: "var(--color-input-bg)",
29
+ color: "var(--color-input-fg)",
30
+ borderColor: "var(--color-input-border)",
31
+ hoverStyle: { borderColor: "var(--color-input-border-hover)" },
32
+ focusStyle: { borderColor: "var(--color-input-border-focus)" },
33
+ disabledStyle: { opacity: 0.4, cursor: "not-allowed" }
34
+ };
35
+ var Input = React__default.default.forwardRef(
36
+ ({ size = "md", variant = "outline", className, onChange, onChangeText, ...rest }, ref) => {
37
+ const handleChange = React__default.default.useCallback(
38
+ (event) => {
39
+ onChange?.(event);
40
+ onChangeText?.(event.target.value);
41
+ },
42
+ [onChange, onChangeText]
43
+ );
44
+ return /* @__PURE__ */ jsxRuntime.jsx(
45
+ gui.Input,
46
+ {
47
+ ref,
48
+ unstyled: true,
49
+ className: className ? `lux-control ${className}` : "lux-control",
50
+ ...CONTROL,
51
+ ...SIZE[size],
52
+ ...VARIANT[variant],
53
+ ...rest,
54
+ onChange: handleChange
55
+ }
56
+ );
57
+ }
58
+ );
59
+ Input.displayName = "Input";
60
+ var SIZE2 = {
61
+ xs: { paddingHorizontal: 8, paddingVertical: 4, fontSize: 12, borderRadius: 4 },
62
+ sm: { paddingHorizontal: 12, paddingVertical: 8, fontSize: 14, borderRadius: 6 },
63
+ md: { paddingHorizontal: 16, paddingVertical: 8, fontSize: 16, borderRadius: 6 },
64
+ lg: { paddingHorizontal: 16, paddingVertical: 12, fontSize: 18, borderRadius: 8 },
65
+ "2xl": { paddingHorizontal: 16, paddingVertical: 12, fontSize: 20, borderRadius: 8 }
40
66
  };
41
67
  var Textarea = React__default.default.forwardRef(
42
68
  ({ size = "md", variant = "outline", className, onChange, onChangeText, ...rest }, ref) => {
@@ -52,7 +78,10 @@ var Textarea = React__default.default.forwardRef(
52
78
  {
53
79
  ref,
54
80
  unstyled: true,
55
- className: cn(TEXTAREA_BASE, TEXTAREA_SIZE_CLASSES[size], TEXTAREA_VARIANT_CLASSES[variant], className),
81
+ className: className ? `lux-control ${className}` : "lux-control",
82
+ ...CONTROL,
83
+ ...SIZE2[size],
84
+ ...VARIANT[variant],
56
85
  ...rest,
57
86
  onChange: handleChange
58
87
  }
package/dist/textarea.js CHANGED
@@ -1,36 +1,62 @@
1
1
  "use client";
2
- import { TextArea } from '@hanzo/gui';
2
+ import { Input as Input$1, TextArea } from '@hanzo/gui';
3
3
  import React from 'react';
4
- import { clsx } from 'clsx';
5
- import { twMerge } from 'tailwind-merge';
6
4
  import { jsx } from 'react/jsx-runtime';
7
5
 
8
6
  // src/textarea.tsx
9
- function cn(...inputs) {
10
- return twMerge(clsx(inputs));
11
- }
12
- var TEXTAREA_BASE = [
13
- "w-full appearance-none outline-none transition-colors resize-y",
14
- "bg-[var(--color-input-bg)] text-[var(--color-input-fg)] border-[var(--color-input-border)]",
15
- "placeholder:text-[var(--color-input-placeholder,theme(colors.gray.400))]",
16
- "hover:border-[var(--color-input-border-hover,theme(colors.gray.400))]",
17
- "focus:border-[var(--color-input-border-focus,theme(colors.blue.500))]",
18
- "focus:placeholder:text-[var(--color-input-placeholder-focus,theme(colors.gray.300))]",
19
- "disabled:opacity-40 disabled:cursor-not-allowed",
20
- "read-only:opacity-70",
21
- "data-[invalid]:border-[var(--color-input-border-invalid,theme(colors.red.500))]"
22
- ].join(" ");
23
- var TEXTAREA_SIZE_CLASSES = {
24
- xs: "px-2 py-1 text-xs rounded",
25
- sm: "px-3 py-2 text-sm rounded-md",
26
- md: "px-4 py-2 text-base rounded-md",
27
- lg: "px-4 py-3 text-lg rounded-lg",
28
- "2xl": "px-4 py-3 text-xl rounded-lg"
7
+ var SIZE = {
8
+ xs: { height: 24, paddingHorizontal: 8, fontSize: 12, borderRadius: 4 },
9
+ sm: { height: 32, paddingHorizontal: 12, fontSize: 14, borderRadius: 6 },
10
+ md: { height: 40, paddingHorizontal: 16, fontSize: 16, borderRadius: 6 },
11
+ lg: { height: 48, paddingHorizontal: 16, fontSize: 18, borderRadius: 8 },
12
+ "2xl": { height: 56, paddingHorizontal: 16, fontSize: 20, borderRadius: 8 }
29
13
  };
30
- var TEXTAREA_VARIANT_CLASSES = {
31
- outline: "border border-solid",
32
- filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
33
- unstyled: "border-0 bg-transparent p-0"
14
+ var VARIANT = {
15
+ outline: { borderWidth: 1, borderStyle: "solid" },
16
+ filled: { borderWidth: 0, backgroundColor: "var(--color-input-filled-bg)" },
17
+ unstyled: { borderWidth: 0, backgroundColor: "transparent", padding: 0, height: "auto" }
18
+ };
19
+ var CONTROL = {
20
+ width: "100%",
21
+ outlineWidth: 0,
22
+ backgroundColor: "var(--color-input-bg)",
23
+ color: "var(--color-input-fg)",
24
+ borderColor: "var(--color-input-border)",
25
+ hoverStyle: { borderColor: "var(--color-input-border-hover)" },
26
+ focusStyle: { borderColor: "var(--color-input-border-focus)" },
27
+ disabledStyle: { opacity: 0.4, cursor: "not-allowed" }
28
+ };
29
+ var Input = React.forwardRef(
30
+ ({ size = "md", variant = "outline", className, onChange, onChangeText, ...rest }, ref) => {
31
+ const handleChange = React.useCallback(
32
+ (event) => {
33
+ onChange?.(event);
34
+ onChangeText?.(event.target.value);
35
+ },
36
+ [onChange, onChangeText]
37
+ );
38
+ return /* @__PURE__ */ jsx(
39
+ Input$1,
40
+ {
41
+ ref,
42
+ unstyled: true,
43
+ className: className ? `lux-control ${className}` : "lux-control",
44
+ ...CONTROL,
45
+ ...SIZE[size],
46
+ ...VARIANT[variant],
47
+ ...rest,
48
+ onChange: handleChange
49
+ }
50
+ );
51
+ }
52
+ );
53
+ Input.displayName = "Input";
54
+ var SIZE2 = {
55
+ xs: { paddingHorizontal: 8, paddingVertical: 4, fontSize: 12, borderRadius: 4 },
56
+ sm: { paddingHorizontal: 12, paddingVertical: 8, fontSize: 14, borderRadius: 6 },
57
+ md: { paddingHorizontal: 16, paddingVertical: 8, fontSize: 16, borderRadius: 6 },
58
+ lg: { paddingHorizontal: 16, paddingVertical: 12, fontSize: 18, borderRadius: 8 },
59
+ "2xl": { paddingHorizontal: 16, paddingVertical: 12, fontSize: 20, borderRadius: 8 }
34
60
  };
35
61
  var Textarea = React.forwardRef(
36
62
  ({ size = "md", variant = "outline", className, onChange, onChangeText, ...rest }, ref) => {
@@ -46,7 +72,10 @@ var Textarea = React.forwardRef(
46
72
  {
47
73
  ref,
48
74
  unstyled: true,
49
- className: cn(TEXTAREA_BASE, TEXTAREA_SIZE_CLASSES[size], TEXTAREA_VARIANT_CLASSES[variant], className),
75
+ className: className ? `lux-control ${className}` : "lux-control",
76
+ ...CONTROL,
77
+ ...SIZE2[size],
78
+ ...VARIANT[variant],
50
79
  ...rest,
51
80
  onChange: handleChange
52
81
  }