@luxfi/ui 7.4.10 → 7.4.12

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 (137) 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/alert.cjs +68 -46
  6. package/dist/alert.js +69 -46
  7. package/dist/avatar.cjs +49 -46
  8. package/dist/avatar.js +52 -48
  9. package/dist/badge.cjs +82 -49
  10. package/dist/badge.js +83 -50
  11. package/dist/checkbox.cjs +42 -75
  12. package/dist/checkbox.js +43 -76
  13. package/dist/chrome.cjs +196 -386
  14. package/dist/chrome.js +198 -386
  15. package/dist/close-button.cjs +3 -7
  16. package/dist/close-button.js +3 -7
  17. package/dist/collapsible.cjs +35 -26
  18. package/dist/collapsible.d.cts +2 -1
  19. package/dist/collapsible.d.ts +2 -1
  20. package/dist/collapsible.js +34 -24
  21. package/dist/dialog.cjs +3 -7
  22. package/dist/dialog.d.cts +1 -1
  23. package/dist/dialog.d.ts +1 -1
  24. package/dist/dialog.js +3 -7
  25. package/dist/drawer.cjs +95 -122
  26. package/dist/drawer.d.cts +43 -10
  27. package/dist/drawer.d.ts +43 -10
  28. package/dist/drawer.js +97 -122
  29. package/dist/empty-state.cjs +13 -13
  30. package/dist/empty-state.js +13 -13
  31. package/dist/expiration-selector.cjs +58 -63
  32. package/dist/expiration-selector.js +58 -63
  33. package/dist/field.cjs +60 -109
  34. package/dist/field.d.cts +0 -1
  35. package/dist/field.d.ts +0 -1
  36. package/dist/field.js +61 -109
  37. package/dist/greeks-display.cjs +48 -39
  38. package/dist/greeks-display.js +48 -39
  39. package/dist/heading.cjs +10 -17
  40. package/dist/heading.d.cts +0 -2
  41. package/dist/heading.d.ts +0 -2
  42. package/dist/heading.js +10 -17
  43. package/dist/icon-button.cjs +82 -82
  44. package/dist/icon-button.d.cts +16 -12
  45. package/dist/icon-button.d.ts +16 -12
  46. package/dist/icon-button.js +82 -82
  47. package/dist/index.cjs +1812 -2105
  48. package/dist/index.d.cts +1 -5
  49. package/dist/index.d.ts +1 -5
  50. package/dist/index.js +1814 -2100
  51. package/dist/input-group.cjs +11 -12
  52. package/dist/input-group.js +11 -12
  53. package/dist/input.cjs +27 -27
  54. package/dist/input.d.cts +21 -1
  55. package/dist/input.d.ts +21 -1
  56. package/dist/input.js +25 -28
  57. package/dist/menu.cjs +160 -271
  58. package/dist/menu.d.cts +41 -57
  59. package/dist/menu.d.ts +41 -57
  60. package/dist/menu.js +161 -251
  61. package/dist/option-chain.cjs +89 -67
  62. package/dist/option-chain.js +89 -67
  63. package/dist/option-position.cjs +88 -85
  64. package/dist/option-position.js +88 -85
  65. package/dist/pnl-diagram.cjs +20 -20
  66. package/dist/pnl-diagram.js +20 -20
  67. package/dist/popover.cjs +4 -8
  68. package/dist/popover.js +4 -8
  69. package/dist/progress.cjs +15 -22
  70. package/dist/progress.d.cts +6 -6
  71. package/dist/progress.d.ts +6 -6
  72. package/dist/progress.js +15 -22
  73. package/dist/radio.cjs +35 -67
  74. package/dist/radio.d.cts +18 -18
  75. package/dist/radio.d.ts +18 -18
  76. package/dist/radio.js +36 -68
  77. package/dist/select.cjs +40 -39
  78. package/dist/select.d.cts +35 -4
  79. package/dist/select.d.ts +35 -4
  80. package/dist/select.js +40 -38
  81. package/dist/separator.cjs +8 -33
  82. package/dist/separator.js +8 -33
  83. package/dist/slider.cjs +33 -49
  84. package/dist/slider.js +34 -50
  85. package/dist/switch.cjs +48 -55
  86. package/dist/switch.js +49 -56
  87. package/dist/tabs.cjs +108 -197
  88. package/dist/tabs.d.cts +16 -60
  89. package/dist/tabs.d.ts +16 -60
  90. package/dist/tabs.js +109 -196
  91. package/dist/tag.cjs +112 -69
  92. package/dist/tag.js +113 -69
  93. package/dist/textarea.cjs +56 -27
  94. package/dist/textarea.js +57 -28
  95. package/dist/toaster.cjs +97 -79
  96. package/dist/toaster.d.cts +7 -8
  97. package/dist/toaster.d.ts +7 -8
  98. package/dist/toaster.js +78 -80
  99. package/dist/tooltip.cjs +28 -17
  100. package/dist/tooltip.js +30 -18
  101. package/package.json +2 -16
  102. package/src/accordion.tsx +173 -227
  103. package/src/alert.tsx +78 -45
  104. package/src/avatar.tsx +54 -37
  105. package/src/badge.tsx +65 -44
  106. package/src/checkbox.tsx +70 -89
  107. package/src/close-button.tsx +3 -8
  108. package/src/collapsible.tsx +55 -52
  109. package/src/drawer.tsx +123 -115
  110. package/src/empty-state.tsx +21 -17
  111. package/src/expiration-selector.tsx +84 -66
  112. package/src/field.tsx +68 -124
  113. package/src/greeks-display.tsx +59 -51
  114. package/src/heading.tsx +22 -26
  115. package/src/icon-button.tsx +134 -141
  116. package/src/ink.tsx +37 -0
  117. package/src/input-group.tsx +59 -36
  118. package/src/input.tsx +41 -32
  119. package/src/menu.tsx +224 -397
  120. package/src/option-chain.tsx +154 -104
  121. package/src/option-position.tsx +136 -114
  122. package/src/pin-input.tsx +37 -29
  123. package/src/pnl-diagram.tsx +36 -28
  124. package/src/popover.tsx +1 -1
  125. package/src/progress.tsx +17 -21
  126. package/src/radio.tsx +56 -75
  127. package/src/select.tsx +80 -59
  128. package/src/separator.tsx +13 -34
  129. package/src/slider.tsx +43 -44
  130. package/src/strategy-builder.tsx +245 -156
  131. package/src/switch.tsx +63 -64
  132. package/src/tabs.tsx +166 -296
  133. package/src/tag.tsx +89 -51
  134. package/src/textarea.tsx +19 -29
  135. package/src/toaster.tsx +118 -86
  136. package/src/tooltip.tsx +21 -13
  137. package/tokens.css +79 -0
package/dist/tabs.cjs CHANGED
@@ -1,10 +1,8 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var RadixTabs = require('@radix-ui/react-tabs');
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 _interopNamespace(e) {
@@ -25,213 +23,126 @@ function _interopNamespace(e) {
25
23
  return Object.freeze(n);
26
24
  }
27
25
 
28
- var RadixTabs__namespace = /*#__PURE__*/_interopNamespace(RadixTabs);
29
26
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
30
27
 
31
28
  // src/tabs.tsx
32
- function cn(...inputs) {
33
- return tailwindMerge.twMerge(clsx.clsx(inputs));
34
- }
35
- var ROOT_SIZE_CLASSES = {
36
- sm: "[--tabs-height:2rem] [--tabs-content-padding:1.5rem]",
37
- md: "[--tabs-height:2.5rem] [--tabs-content-padding:1.5rem]",
38
- free: ""
29
+ var ink = (children, Wrap = gui.Text, props = {}) => {
30
+ let hasText = false;
31
+ React.Children.forEach(children, (child) => {
32
+ if (typeof child === "string" || typeof child === "number") hasText = true;
33
+ });
34
+ if (!hasText) return children;
35
+ return React.Children.map(children, (child) => typeof child === "string" || typeof child === "number" ? React.createElement(Wrap, props, child) : child);
39
36
  };
40
- var TabsRoot = React__namespace.forwardRef(
41
- function TabsRoot2(props, ref) {
42
- const {
43
- variant = "solid",
44
- size = "md",
45
- fitted,
46
- lazyMount: _lazyMount,
47
- unmountOnExit: _unmountOnExit,
48
- onValueChange,
49
- className,
50
- ...rest
51
- } = props;
52
- const handleValueChange = React__namespace.useCallback(
53
- (value) => {
54
- if (!onValueChange) return;
55
- onValueChange({ value });
56
- },
57
- [onValueChange]
58
- );
59
- return /* @__PURE__ */ jsxRuntime.jsx(
60
- RadixTabs__namespace.Root,
61
- {
62
- ref,
63
- "data-variant": variant,
64
- "data-size": size,
65
- "data-fitted": fitted ? "" : void 0,
66
- className: cn(
67
- "relative",
68
- ROOT_SIZE_CLASSES[size],
69
- className
70
- ),
71
- onValueChange: onValueChange ? handleValueChange : void 0,
72
- ...rest
73
- }
74
- );
75
- }
76
- );
77
- var TabsList = React__namespace.forwardRef(
78
- function TabsList2(props, ref) {
79
- const {
80
- className,
81
- // Strip Chakra style props
82
- flexWrap: _flexWrap,
83
- alignItems: _alignItems,
84
- whiteSpace: _whiteSpace,
85
- bgColor: _bgColor,
86
- marginBottom: _marginBottom,
87
- mx: _mx,
88
- px: _px,
89
- w: _w,
90
- overflowX: _overflowX,
91
- overscrollBehaviorX: _overscrollBehaviorX,
92
- css: _css,
93
- position: _position,
94
- boxShadow: _boxShadow,
95
- top: _top,
96
- zIndex: _zIndex,
97
- style: styleProp,
98
- asChild,
99
- loop,
100
- ...rest
101
- } = props;
102
- return /* @__PURE__ */ jsxRuntime.jsx(
103
- RadixTabs__namespace.List,
104
- {
105
- ref,
106
- asChild,
107
- loop,
108
- className: cn(
109
- "inline-flex w-full relative isolate flex-row",
110
- "min-h-[var(--tabs-height,2.5rem)]",
111
- className
112
- ),
113
- style: styleProp,
114
- ...rest
115
- }
116
- );
117
- }
118
- );
119
- 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";
120
- var TRIGGER_SIZE_CLASSES = {
121
- sm: "py-1 px-3 text-sm",
122
- md: "py-2 px-4 text-base",
123
- free: ""
37
+ var Shape = React__namespace.createContext({
38
+ variant: "solid",
39
+ size: "md",
40
+ fitted: false
41
+ });
42
+ var SIZE = {
43
+ sm: { height: 32, minWidth: 32, paddingVertical: 4, paddingHorizontal: 12, fontSize: 14 },
44
+ md: { height: 40, minWidth: 40, paddingVertical: 8, paddingHorizontal: 16, fontSize: 16 },
45
+ free: {}
124
46
  };
125
- var TRIGGER_VARIANT_CLASSES = {
126
- 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",
127
- 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",
128
- 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",
129
- unstyled: ""
47
+ var SELECTED_BG = "var(--color-selected-control-bg)";
48
+ var SELECTED_FG = "var(--color-selected-control-text)";
49
+ var VARIANT = {
50
+ solid: {
51
+ rest: {
52
+ fontWeight: "600",
53
+ borderRadius: 6,
54
+ color: "var(--color-tabs-solid-fg)",
55
+ hoverStyle: { color: "var(--color-hover)" }
56
+ },
57
+ active: { backgroundColor: SELECTED_BG, color: SELECTED_FG }
58
+ },
59
+ secondary: {
60
+ rest: {
61
+ fontWeight: "500",
62
+ borderRadius: 6,
63
+ borderWidth: 2,
64
+ borderColor: "var(--color-tabs-secondary-border)",
65
+ color: "var(--color-tabs-secondary-fg)",
66
+ hoverStyle: { color: "var(--color-hover)", borderColor: "var(--color-hover)" }
67
+ },
68
+ active: { backgroundColor: SELECTED_BG, color: SELECTED_FG, borderColor: "transparent" }
69
+ },
70
+ segmented: {
71
+ rest: {
72
+ borderWidth: 2,
73
+ borderColor: SELECTED_BG,
74
+ color: "var(--color-text-primary)",
75
+ hoverStyle: { color: "var(--color-hover)" }
76
+ },
77
+ active: { backgroundColor: SELECTED_BG, borderColor: SELECTED_BG, color: SELECTED_FG }
78
+ },
79
+ unstyled: { rest: {}, active: {} }
130
80
  };
131
- var TabsTrigger = React__namespace.forwardRef(
132
- function TabsTrigger2(props, ref) {
133
- const {
134
- className,
135
- // Strip Chakra style props
136
- scrollSnapAlign: _scrollSnapAlign,
137
- flexShrink: _flexShrink,
138
- bgColor: _bgColor,
139
- w: _w,
140
- py: _py,
141
- borderRadius: _borderRadius,
142
- fontWeight: _fontWeight,
143
- color: _color,
144
- _hover,
145
- position: _position,
146
- top: _top,
147
- left: _left,
148
- visibility: _visibility,
81
+ var LIST_HEIGHT = { sm: 32, md: 40, free: void 0 };
82
+ var TabsRoot = ({
83
+ variant = "solid",
84
+ size = "md",
85
+ fitted = false,
86
+ onValueChange,
87
+ ...rest
88
+ }) => {
89
+ const shape = React__namespace.useMemo(() => ({ variant, size, fitted }), [variant, size, fitted]);
90
+ return /* @__PURE__ */ jsxRuntime.jsx(Shape.Provider, { value: shape, children: /* @__PURE__ */ jsxRuntime.jsx(
91
+ gui.Tabs,
92
+ {
93
+ unstyled: true,
94
+ position: "relative",
95
+ orientation: "horizontal",
96
+ onValueChange: onValueChange ? (value) => onValueChange({ value }) : void 0,
149
97
  ...rest
150
- } = props;
151
- const internalRef = React__namespace.useRef(null);
152
- const mergedRef = useMergedRef(ref, internalRef);
153
- const { variant, size, fitted } = useTabsContext(internalRef);
154
- return /* @__PURE__ */ jsxRuntime.jsx(
155
- RadixTabs__namespace.Trigger,
156
- {
157
- ref: mergedRef,
158
- className: cn(
159
- "group",
160
- TRIGGER_BASE,
161
- TRIGGER_SIZE_CLASSES[size],
162
- TRIGGER_VARIANT_CLASSES[variant],
163
- fitted && "flex-1 text-center justify-center",
164
- className
165
- ),
166
- ...rest
167
- }
168
- );
169
- }
170
- );
171
- var TabsContent = React__namespace.forwardRef(
172
- function TabsContent2(props, ref) {
173
- const { className, padding: _padding, ...rest } = props;
174
- return /* @__PURE__ */ jsxRuntime.jsx(
175
- RadixTabs__namespace.Content,
176
- {
177
- ref,
178
- className: cn(
179
- "w-full pt-[var(--tabs-content-padding,1.5rem)]",
180
- "focus-visible:outline-2 focus-visible:outline-offset-[-2px]",
181
- className
182
- ),
183
- ...rest
184
- }
185
- );
186
- }
187
- );
188
- var COUNTER_OVERLOAD = 50;
189
- var TabsCounter = ({ count }) => {
190
- if (count === void 0 || count === null) {
191
- return null;
192
- }
98
+ }
99
+ ) });
100
+ };
101
+ var TabsList = (props) => {
102
+ const { size } = React__namespace.useContext(Shape);
193
103
  return /* @__PURE__ */ jsxRuntime.jsx(
194
- "span",
104
+ gui.Tabs.List,
195
105
  {
196
- className: cn(
197
- "group-hover:text-inherit",
198
- count > 0 ? "text-text-secondary" : "text-[rgba(16,17,18,0.24)] dark:text-[rgba(255,255,255,0.24)]"
199
- ),
200
- children: count > COUNTER_OVERLOAD ? `${COUNTER_OVERLOAD}+` : count
106
+ unstyled: true,
107
+ width: "100%",
108
+ position: "relative",
109
+ flexDirection: "row",
110
+ backgroundColor: "transparent",
111
+ minHeight: LIST_HEIGHT[size],
112
+ ...props
201
113
  }
202
114
  );
203
115
  };
204
- function useTabsContext(triggerRef) {
205
- const [ctx, setCtx] = React__namespace.useState({ variant: "solid", size: "md", fitted: false });
206
- React__namespace.useEffect(() => {
207
- const el = triggerRef.current;
208
- if (!el) return;
209
- const root = el.closest("[data-variant]");
210
- if (!root) return;
211
- setCtx({
212
- variant: root.getAttribute("data-variant") ?? "solid",
213
- size: root.getAttribute("data-size") ?? "md",
214
- fitted: root.hasAttribute("data-fitted")
215
- });
216
- }, [triggerRef]);
217
- return ctx;
218
- }
219
- function useMergedRef(...refs) {
220
- return React__namespace.useCallback(
221
- (instance) => {
222
- for (const ref of refs) {
223
- if (!ref) continue;
224
- if (typeof ref === "function") {
225
- ref(instance);
226
- } else {
227
- ref.current = instance;
228
- }
229
- }
230
- },
231
- // eslint-disable-next-line react-hooks/exhaustive-deps
232
- refs
116
+ var TabsTrigger = ({ children, ...props }) => {
117
+ const { variant, size, fitted } = React__namespace.useContext(Shape);
118
+ const { rest, active } = VARIANT[variant];
119
+ const selected = gui.useTabsContext().value === props.value;
120
+ return /* @__PURE__ */ jsxRuntime.jsx(
121
+ gui.Tabs.Tab,
122
+ {
123
+ unstyled: true,
124
+ flexDirection: "row",
125
+ alignItems: "center",
126
+ justifyContent: "center",
127
+ position: "relative",
128
+ cursor: "pointer",
129
+ gap: 8,
130
+ borderWidth: 0,
131
+ ...SIZE[size],
132
+ ...rest,
133
+ ...selected ? active : null,
134
+ ...fitted ? { flex: 1 } : null,
135
+ ...props,
136
+ children: ink(children, void 0, { fontSize: "inherit", color: "inherit", fontWeight: "inherit" })
137
+ }
233
138
  );
234
- }
139
+ };
140
+ var TabsContent = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(gui.Tabs.Content, { unstyled: true, width: "100%", paddingTop: 24, backgroundColor: "transparent", ...props, children: ink(children) });
141
+ var COUNTER_OVERLOAD = 50;
142
+ var TabsCounter = ({ count }) => {
143
+ if (count === void 0 || count === null) return null;
144
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { color: count > 0 ? "var(--color-text-secondary)" : "var(--color-text-disabled)", children: count > COUNTER_OVERLOAD ? `${COUNTER_OVERLOAD}+` : count });
145
+ };
235
146
 
236
147
  exports.TabsContent = TabsContent;
237
148
  exports.TabsCounter = TabsCounter;
package/dist/tabs.d.cts CHANGED
@@ -1,78 +1,34 @@
1
- import * as RadixTabs from '@radix-ui/react-tabs';
1
+ import { Tabs } from '@hanzo/gui';
2
2
  import * as React from 'react';
3
3
 
4
4
  type TabsVariant = 'solid' | 'secondary' | 'segmented' | 'unstyled';
5
5
  type TabsSize = 'sm' | 'md' | 'free';
6
- interface TabsProps extends Omit<React.ComponentPropsWithoutRef<typeof RadixTabs.Root>, 'onValueChange'> {
6
+ interface TabsProps extends Omit<React.ComponentProps<typeof Tabs>, 'onValueChange' | 'size'> {
7
7
  /** Visual variant. Default: "solid". */
8
8
  variant?: TabsVariant;
9
9
  /** Size preset. Default: "md". */
10
10
  size?: TabsSize;
11
11
  /** Stretch triggers to fill the list width. */
12
12
  fitted?: boolean;
13
- /**
14
- * @deprecated Chakra-compat. Radix mounts lazily by default (content only
15
- * renders when active). Kept so call-sites don't break at compile time.
16
- */
17
- lazyMount?: boolean;
18
- /**
19
- * @deprecated Chakra-compat. Radix unmounts inactive content by default.
20
- * Kept so call-sites don't break at compile time.
21
- */
22
- unmountOnExit?: boolean;
23
- /**
24
- * Chakra-compatible value-change handler.
25
- * Accepts both `(details: { value: string }) => void` (Chakra convention)
26
- * and `(value: string) => void` (Radix convention).
27
- */
28
- onValueChange?: ((details: {
13
+ /** Fires with the newly selected value. */
14
+ onValueChange?: (details: {
29
15
  value: string;
30
- }) => void) | ((value: string) => void);
16
+ }) => void;
31
17
  }
32
- declare const TabsRoot: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
33
- interface TabsListProps extends React.HTMLAttributes<HTMLDivElement> {
34
- asChild?: boolean;
35
- loop?: boolean;
36
- flexWrap?: string;
37
- alignItems?: string;
38
- whiteSpace?: string;
39
- bgColor?: string;
40
- marginBottom?: number | string;
41
- mx?: string | Record<string, string>;
42
- px?: string | Record<string, string>;
43
- w?: string | Record<string, string>;
44
- overflowX?: string | Record<string, string>;
45
- overscrollBehaviorX?: string;
46
- css?: Record<string, unknown>;
47
- position?: string;
48
- boxShadow?: string | Record<string, string>;
49
- top?: number | string;
50
- zIndex?: string | Record<string, string>;
51
- }
52
- declare const TabsList: React.ForwardRefExoticComponent<TabsListProps & React.RefAttributes<HTMLDivElement>>;
53
- interface TabsTriggerProps extends Omit<React.ComponentPropsWithoutRef<typeof RadixTabs.Trigger>, 'dir'> {
54
- scrollSnapAlign?: string;
55
- flexShrink?: number;
56
- bgColor?: string | Record<string, string>;
57
- w?: string;
58
- py?: string;
59
- borderRadius?: string;
60
- fontWeight?: string;
61
- color?: string;
62
- _hover?: Record<string, string>;
63
- position?: string;
64
- top?: string;
65
- left?: string;
66
- visibility?: string;
67
- }
68
- declare const TabsTrigger: React.ForwardRefExoticComponent<TabsTriggerProps & React.RefAttributes<HTMLButtonElement>>;
69
- interface TabsContentProps extends React.ComponentPropsWithoutRef<typeof RadixTabs.Content> {
70
- padding?: number | string;
71
- }
72
- declare const TabsContent: React.ForwardRefExoticComponent<TabsContentProps & React.RefAttributes<HTMLDivElement>>;
18
+ declare const TabsRoot: ({ variant, size, fitted, onValueChange, ...rest }: TabsProps) => React.ReactElement;
19
+ type TabsListProps = React.ComponentProps<typeof Tabs.List>;
20
+ declare const TabsList: (props: TabsListProps) => React.ReactElement;
21
+ type TabsTriggerProps = React.ComponentProps<typeof Tabs.Tab>;
22
+ declare const TabsTrigger: ({ children, ...props }: TabsTriggerProps) => React.ReactElement;
23
+ type TabsContentProps = React.ComponentProps<typeof Tabs.Content>;
24
+ declare const TabsContent: ({ children, ...props }: TabsContentProps) => React.ReactElement;
73
25
  interface TabsCounterProps {
74
26
  count?: number | null;
75
27
  }
28
+ /**
29
+ * The count beside a tab label. Zero is deliberately dimmer than a real count —
30
+ * "nothing here" should read quieter than "three things here".
31
+ */
76
32
  declare const TabsCounter: ({ count }: TabsCounterProps) => React.ReactElement | null;
77
33
 
78
34
  export { TabsContent, type TabsContentProps, TabsCounter, type TabsCounterProps, TabsList, type TabsListProps, type TabsProps, TabsRoot, TabsTrigger, type TabsTriggerProps };
package/dist/tabs.d.ts CHANGED
@@ -1,78 +1,34 @@
1
- import * as RadixTabs from '@radix-ui/react-tabs';
1
+ import { Tabs } from '@hanzo/gui';
2
2
  import * as React from 'react';
3
3
 
4
4
  type TabsVariant = 'solid' | 'secondary' | 'segmented' | 'unstyled';
5
5
  type TabsSize = 'sm' | 'md' | 'free';
6
- interface TabsProps extends Omit<React.ComponentPropsWithoutRef<typeof RadixTabs.Root>, 'onValueChange'> {
6
+ interface TabsProps extends Omit<React.ComponentProps<typeof Tabs>, 'onValueChange' | 'size'> {
7
7
  /** Visual variant. Default: "solid". */
8
8
  variant?: TabsVariant;
9
9
  /** Size preset. Default: "md". */
10
10
  size?: TabsSize;
11
11
  /** Stretch triggers to fill the list width. */
12
12
  fitted?: boolean;
13
- /**
14
- * @deprecated Chakra-compat. Radix mounts lazily by default (content only
15
- * renders when active). Kept so call-sites don't break at compile time.
16
- */
17
- lazyMount?: boolean;
18
- /**
19
- * @deprecated Chakra-compat. Radix unmounts inactive content by default.
20
- * Kept so call-sites don't break at compile time.
21
- */
22
- unmountOnExit?: boolean;
23
- /**
24
- * Chakra-compatible value-change handler.
25
- * Accepts both `(details: { value: string }) => void` (Chakra convention)
26
- * and `(value: string) => void` (Radix convention).
27
- */
28
- onValueChange?: ((details: {
13
+ /** Fires with the newly selected value. */
14
+ onValueChange?: (details: {
29
15
  value: string;
30
- }) => void) | ((value: string) => void);
16
+ }) => void;
31
17
  }
32
- declare const TabsRoot: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
33
- interface TabsListProps extends React.HTMLAttributes<HTMLDivElement> {
34
- asChild?: boolean;
35
- loop?: boolean;
36
- flexWrap?: string;
37
- alignItems?: string;
38
- whiteSpace?: string;
39
- bgColor?: string;
40
- marginBottom?: number | string;
41
- mx?: string | Record<string, string>;
42
- px?: string | Record<string, string>;
43
- w?: string | Record<string, string>;
44
- overflowX?: string | Record<string, string>;
45
- overscrollBehaviorX?: string;
46
- css?: Record<string, unknown>;
47
- position?: string;
48
- boxShadow?: string | Record<string, string>;
49
- top?: number | string;
50
- zIndex?: string | Record<string, string>;
51
- }
52
- declare const TabsList: React.ForwardRefExoticComponent<TabsListProps & React.RefAttributes<HTMLDivElement>>;
53
- interface TabsTriggerProps extends Omit<React.ComponentPropsWithoutRef<typeof RadixTabs.Trigger>, 'dir'> {
54
- scrollSnapAlign?: string;
55
- flexShrink?: number;
56
- bgColor?: string | Record<string, string>;
57
- w?: string;
58
- py?: string;
59
- borderRadius?: string;
60
- fontWeight?: string;
61
- color?: string;
62
- _hover?: Record<string, string>;
63
- position?: string;
64
- top?: string;
65
- left?: string;
66
- visibility?: string;
67
- }
68
- declare const TabsTrigger: React.ForwardRefExoticComponent<TabsTriggerProps & React.RefAttributes<HTMLButtonElement>>;
69
- interface TabsContentProps extends React.ComponentPropsWithoutRef<typeof RadixTabs.Content> {
70
- padding?: number | string;
71
- }
72
- declare const TabsContent: React.ForwardRefExoticComponent<TabsContentProps & React.RefAttributes<HTMLDivElement>>;
18
+ declare const TabsRoot: ({ variant, size, fitted, onValueChange, ...rest }: TabsProps) => React.ReactElement;
19
+ type TabsListProps = React.ComponentProps<typeof Tabs.List>;
20
+ declare const TabsList: (props: TabsListProps) => React.ReactElement;
21
+ type TabsTriggerProps = React.ComponentProps<typeof Tabs.Tab>;
22
+ declare const TabsTrigger: ({ children, ...props }: TabsTriggerProps) => React.ReactElement;
23
+ type TabsContentProps = React.ComponentProps<typeof Tabs.Content>;
24
+ declare const TabsContent: ({ children, ...props }: TabsContentProps) => React.ReactElement;
73
25
  interface TabsCounterProps {
74
26
  count?: number | null;
75
27
  }
28
+ /**
29
+ * The count beside a tab label. Zero is deliberately dimmer than a real count —
30
+ * "nothing here" should read quieter than "three things here".
31
+ */
76
32
  declare const TabsCounter: ({ count }: TabsCounterProps) => React.ReactElement | null;
77
33
 
78
34
  export { TabsContent, type TabsContentProps, TabsCounter, type TabsCounterProps, TabsList, type TabsListProps, type TabsProps, TabsRoot, TabsTrigger, type TabsTriggerProps };