@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.
- package/dist/accordion.cjs +107 -166
- package/dist/accordion.d.cts +18 -51
- package/dist/accordion.d.ts +18 -51
- package/dist/accordion.js +109 -166
- package/dist/alert.cjs +68 -46
- package/dist/alert.js +69 -46
- package/dist/avatar.cjs +49 -46
- package/dist/avatar.js +52 -48
- package/dist/badge.cjs +82 -49
- package/dist/badge.js +83 -50
- package/dist/checkbox.cjs +42 -75
- package/dist/checkbox.js +43 -76
- package/dist/chrome.cjs +196 -386
- package/dist/chrome.js +198 -386
- package/dist/close-button.cjs +3 -7
- package/dist/close-button.js +3 -7
- package/dist/collapsible.cjs +35 -26
- package/dist/collapsible.d.cts +2 -1
- package/dist/collapsible.d.ts +2 -1
- package/dist/collapsible.js +34 -24
- package/dist/dialog.cjs +3 -7
- package/dist/dialog.d.cts +1 -1
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.js +3 -7
- package/dist/drawer.cjs +95 -122
- package/dist/drawer.d.cts +43 -10
- package/dist/drawer.d.ts +43 -10
- package/dist/drawer.js +97 -122
- package/dist/empty-state.cjs +13 -13
- package/dist/empty-state.js +13 -13
- package/dist/expiration-selector.cjs +58 -63
- package/dist/expiration-selector.js +58 -63
- package/dist/field.cjs +60 -109
- package/dist/field.d.cts +0 -1
- package/dist/field.d.ts +0 -1
- package/dist/field.js +61 -109
- package/dist/greeks-display.cjs +48 -39
- package/dist/greeks-display.js +48 -39
- package/dist/heading.cjs +10 -17
- package/dist/heading.d.cts +0 -2
- package/dist/heading.d.ts +0 -2
- package/dist/heading.js +10 -17
- package/dist/icon-button.cjs +82 -82
- package/dist/icon-button.d.cts +16 -12
- package/dist/icon-button.d.ts +16 -12
- package/dist/icon-button.js +82 -82
- package/dist/index.cjs +1812 -2105
- package/dist/index.d.cts +1 -5
- package/dist/index.d.ts +1 -5
- package/dist/index.js +1814 -2100
- package/dist/input-group.cjs +11 -12
- package/dist/input-group.js +11 -12
- package/dist/input.cjs +27 -27
- package/dist/input.d.cts +21 -1
- package/dist/input.d.ts +21 -1
- package/dist/input.js +25 -28
- package/dist/menu.cjs +160 -271
- package/dist/menu.d.cts +41 -57
- package/dist/menu.d.ts +41 -57
- package/dist/menu.js +161 -251
- package/dist/option-chain.cjs +89 -67
- package/dist/option-chain.js +89 -67
- package/dist/option-position.cjs +88 -85
- package/dist/option-position.js +88 -85
- package/dist/pnl-diagram.cjs +20 -20
- package/dist/pnl-diagram.js +20 -20
- package/dist/popover.cjs +4 -8
- package/dist/popover.js +4 -8
- package/dist/progress.cjs +15 -22
- package/dist/progress.d.cts +6 -6
- package/dist/progress.d.ts +6 -6
- package/dist/progress.js +15 -22
- package/dist/radio.cjs +35 -67
- package/dist/radio.d.cts +18 -18
- package/dist/radio.d.ts +18 -18
- package/dist/radio.js +36 -68
- package/dist/select.cjs +40 -39
- package/dist/select.d.cts +35 -4
- package/dist/select.d.ts +35 -4
- package/dist/select.js +40 -38
- package/dist/separator.cjs +8 -33
- package/dist/separator.js +8 -33
- package/dist/slider.cjs +33 -49
- package/dist/slider.js +34 -50
- package/dist/switch.cjs +48 -55
- package/dist/switch.js +49 -56
- package/dist/tabs.cjs +108 -197
- package/dist/tabs.d.cts +16 -60
- package/dist/tabs.d.ts +16 -60
- package/dist/tabs.js +109 -196
- package/dist/tag.cjs +112 -69
- package/dist/tag.js +113 -69
- package/dist/textarea.cjs +56 -27
- package/dist/textarea.js +57 -28
- package/dist/toaster.cjs +97 -79
- package/dist/toaster.d.cts +7 -8
- package/dist/toaster.d.ts +7 -8
- package/dist/toaster.js +78 -80
- package/dist/tooltip.cjs +28 -17
- package/dist/tooltip.js +30 -18
- package/package.json +2 -16
- package/src/accordion.tsx +173 -227
- package/src/alert.tsx +78 -45
- package/src/avatar.tsx +54 -37
- package/src/badge.tsx +65 -44
- package/src/checkbox.tsx +70 -89
- package/src/close-button.tsx +3 -8
- package/src/collapsible.tsx +55 -52
- package/src/drawer.tsx +123 -115
- package/src/empty-state.tsx +21 -17
- package/src/expiration-selector.tsx +84 -66
- package/src/field.tsx +68 -124
- package/src/greeks-display.tsx +59 -51
- package/src/heading.tsx +22 -26
- package/src/icon-button.tsx +134 -141
- package/src/ink.tsx +37 -0
- package/src/input-group.tsx +59 -36
- package/src/input.tsx +41 -32
- package/src/menu.tsx +224 -397
- package/src/option-chain.tsx +154 -104
- package/src/option-position.tsx +136 -114
- package/src/pin-input.tsx +37 -29
- package/src/pnl-diagram.tsx +36 -28
- package/src/popover.tsx +1 -1
- package/src/progress.tsx +17 -21
- package/src/radio.tsx +56 -75
- package/src/select.tsx +80 -59
- package/src/separator.tsx +13 -34
- package/src/slider.tsx +43 -44
- package/src/strategy-builder.tsx +245 -156
- package/src/switch.tsx +63 -64
- package/src/tabs.tsx +166 -296
- package/src/tag.tsx +89 -51
- package/src/textarea.tsx +19 -29
- package/src/toaster.tsx +118 -86
- package/src/tooltip.tsx +21 -13
- 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
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
-
|
|
104
|
+
gui.Tabs.List,
|
|
195
105
|
{
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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
|
-
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
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
|
|
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.
|
|
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
|
-
|
|
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
|
|
16
|
+
}) => void;
|
|
31
17
|
}
|
|
32
|
-
declare const TabsRoot:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
|
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.
|
|
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
|
-
|
|
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
|
|
16
|
+
}) => void;
|
|
31
17
|
}
|
|
32
|
-
declare const TabsRoot:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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 };
|