@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/drawer.cjs
CHANGED
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var gui = require('@hanzo/gui');
|
|
5
|
-
var RadixDialog = require('@radix-ui/react-dialog');
|
|
6
5
|
var React3 = require('react');
|
|
7
|
-
var clsx = require('clsx');
|
|
8
|
-
var tailwindMerge = require('tailwind-merge');
|
|
9
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
10
7
|
|
|
11
8
|
function _interopNamespace(e) {
|
|
@@ -26,26 +23,9 @@ function _interopNamespace(e) {
|
|
|
26
23
|
return Object.freeze(n);
|
|
27
24
|
}
|
|
28
25
|
|
|
29
|
-
var RadixDialog__namespace = /*#__PURE__*/_interopNamespace(RadixDialog);
|
|
30
26
|
var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
|
|
31
27
|
|
|
32
28
|
// src/drawer.tsx
|
|
33
|
-
var NARROW_PX = 640;
|
|
34
|
-
function useBelow(px) {
|
|
35
|
-
const [below, setBelow] = React3__namespace.useState(false);
|
|
36
|
-
React3__namespace.useEffect(() => {
|
|
37
|
-
const mql = window.matchMedia(`(max-width: ${px - 1}px)`);
|
|
38
|
-
const apply = () => setBelow(mql.matches);
|
|
39
|
-
apply();
|
|
40
|
-
mql.addEventListener("change", apply);
|
|
41
|
-
return () => mql.removeEventListener("change", apply);
|
|
42
|
-
}, [px]);
|
|
43
|
-
return below;
|
|
44
|
-
}
|
|
45
|
-
var useIsNarrow = () => useBelow(NARROW_PX);
|
|
46
|
-
function cn(...inputs) {
|
|
47
|
-
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
48
|
-
}
|
|
49
29
|
var CLOSE_ICON_PATH = "M9.44 8.035a.791.791 0 0 0 1.12 0l3.802-3.803a.791.791 0 0 1 1.119 0l.287.287a.79.79 0 0 1 0 1.119L11.965 9.44a.79.79 0 0 0 0 1.118l3.803 3.803a.791.791 0 0 1 0 1.119l-.287.287a.791.791 0 0 1-1.119 0l-3.803-3.803a.79.79 0 0 0-1.118 0l-3.803 3.803a.79.79 0 0 1-1.119 0l-.287-.287a.791.791 0 0 1 0-1.119l3.803-3.803a.791.791 0 0 0 0-1.118L4.232 5.638a.791.791 0 0 1 0-1.119l.287-.287a.791.791 0 0 1 1.119 0L9.44 8.035Z";
|
|
50
30
|
var CloseButtonFrame = gui.styled(gui.View, {
|
|
51
31
|
name: "LuxCloseButton",
|
|
@@ -76,23 +56,19 @@ var CloseButtonFrame = gui.styled(gui.View, {
|
|
|
76
56
|
}
|
|
77
57
|
}
|
|
78
58
|
});
|
|
79
|
-
var CLOSE_BUTTON_CLASSES = [
|
|
80
|
-
"text-[var(--closeButton-fg,currentColor)]",
|
|
81
|
-
"hover:text-[var(--hover-color,currentColor)]",
|
|
82
|
-
"disabled:opacity-40"
|
|
83
|
-
].join(" ");
|
|
84
59
|
var CloseButton = React3__namespace.forwardRef(function CloseButton2(props, ref) {
|
|
85
60
|
const { variant: _variant, size: _size, className, children, ...rest } = props;
|
|
86
61
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
87
62
|
CloseButtonFrame,
|
|
88
63
|
{
|
|
89
64
|
ref,
|
|
90
|
-
className
|
|
65
|
+
className,
|
|
91
66
|
...rest,
|
|
92
67
|
children: children ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
93
68
|
"svg",
|
|
94
69
|
{
|
|
95
|
-
|
|
70
|
+
width: 20,
|
|
71
|
+
height: 20,
|
|
96
72
|
viewBox: "0 0 20 20",
|
|
97
73
|
fill: "none",
|
|
98
74
|
"aria-hidden": "true",
|
|
@@ -108,13 +84,35 @@ var CloseButton = React3__namespace.forwardRef(function CloseButton2(props, ref)
|
|
|
108
84
|
}
|
|
109
85
|
);
|
|
110
86
|
});
|
|
87
|
+
var ink = (children, Wrap = gui.Text, props = {}) => {
|
|
88
|
+
let hasText = false;
|
|
89
|
+
React3.Children.forEach(children, (child) => {
|
|
90
|
+
if (typeof child === "string" || typeof child === "number") hasText = true;
|
|
91
|
+
});
|
|
92
|
+
if (!hasText) return children;
|
|
93
|
+
return React3.Children.map(children, (child) => typeof child === "string" || typeof child === "number" ? React3.createElement(Wrap, props, child) : child);
|
|
94
|
+
};
|
|
95
|
+
var NARROW_PX = 640;
|
|
96
|
+
function useBelow(px) {
|
|
97
|
+
const [below, setBelow] = React3__namespace.useState(false);
|
|
98
|
+
React3__namespace.useEffect(() => {
|
|
99
|
+
const mql = window.matchMedia(`(max-width: ${px - 1}px)`);
|
|
100
|
+
const apply = () => setBelow(mql.matches);
|
|
101
|
+
apply();
|
|
102
|
+
mql.addEventListener("change", apply);
|
|
103
|
+
return () => mql.removeEventListener("change", apply);
|
|
104
|
+
}, [px]);
|
|
105
|
+
return below;
|
|
106
|
+
}
|
|
107
|
+
var useIsNarrow = () => useBelow(NARROW_PX);
|
|
111
108
|
var DrawerPlacementContext = React3__namespace.createContext("right");
|
|
112
109
|
var DrawerSizeContext = React3__namespace.createContext("md");
|
|
113
110
|
var DrawerStateContext = React3__namespace.createContext({
|
|
114
111
|
open: false,
|
|
115
112
|
setOpen: () => {
|
|
116
113
|
},
|
|
117
|
-
modal: true
|
|
114
|
+
modal: true,
|
|
115
|
+
narrow: false
|
|
118
116
|
});
|
|
119
117
|
var DrawerRoot = (props) => {
|
|
120
118
|
const {
|
|
@@ -129,60 +127,40 @@ var DrawerRoot = (props) => {
|
|
|
129
127
|
const [uncontrolled, setUncontrolled] = React3__namespace.useState(defaultOpen ?? false);
|
|
130
128
|
const isControlled = open !== void 0;
|
|
131
129
|
const isOpen = isControlled ? open : uncontrolled;
|
|
130
|
+
const narrow = useIsNarrow();
|
|
132
131
|
const setOpen = React3__namespace.useCallback((nextOpen) => {
|
|
133
132
|
if (!isControlled) setUncontrolled(nextOpen);
|
|
134
133
|
onOpenChange?.({ open: nextOpen });
|
|
135
134
|
}, [isControlled, onOpenChange]);
|
|
136
135
|
const state = React3__namespace.useMemo(
|
|
137
|
-
() => ({ open: isOpen, setOpen, modal }),
|
|
138
|
-
[isOpen, setOpen, modal]
|
|
136
|
+
() => ({ open: isOpen, setOpen, modal, narrow }),
|
|
137
|
+
[isOpen, setOpen, modal, narrow]
|
|
139
138
|
);
|
|
140
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DrawerPlacementContext.Provider, { value: placement, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerStateContext.Provider, { value: state, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
141
|
-
RadixDialog__namespace.Root,
|
|
142
|
-
{
|
|
143
|
-
open: isOpen,
|
|
144
|
-
onOpenChange: setOpen,
|
|
145
|
-
modal,
|
|
146
|
-
children
|
|
147
|
-
}
|
|
148
|
-
) }) }) });
|
|
139
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DrawerPlacementContext.Provider, { value: placement, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsxRuntime.jsx(DrawerStateContext.Provider, { value: state, children: narrow ? children : /* @__PURE__ */ jsxRuntime.jsx(gui.Dialog, { open: isOpen, onOpenChange: setOpen, modal, children }) }) }) });
|
|
149
140
|
};
|
|
150
|
-
var
|
|
151
|
-
right:
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
].join(" "),
|
|
156
|
-
left: [
|
|
157
|
-
"inset-y-0 left-0",
|
|
158
|
-
"data-[state=open]:animate-in data-[state=open]:slide-in-from-left",
|
|
159
|
-
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-left"
|
|
160
|
-
].join(" "),
|
|
161
|
-
top: [
|
|
162
|
-
"inset-x-0 top-0",
|
|
163
|
-
"data-[state=open]:animate-in data-[state=open]:slide-in-from-top",
|
|
164
|
-
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-top"
|
|
165
|
-
].join(" "),
|
|
166
|
-
bottom: [
|
|
167
|
-
"inset-x-0 bottom-0",
|
|
168
|
-
"data-[state=open]:animate-in data-[state=open]:slide-in-from-bottom",
|
|
169
|
-
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom"
|
|
170
|
-
].join(" ")
|
|
141
|
+
var ANCHOR = {
|
|
142
|
+
right: { top: 0, bottom: 0, right: 0, enterStyle: { x: 24, opacity: 0 }, exitStyle: { x: 24, opacity: 0 } },
|
|
143
|
+
left: { top: 0, bottom: 0, left: 0, enterStyle: { x: -24, opacity: 0 }, exitStyle: { x: -24, opacity: 0 } },
|
|
144
|
+
top: { left: 0, right: 0, top: 0, enterStyle: { y: -24, opacity: 0 }, exitStyle: { y: -24, opacity: 0 } },
|
|
145
|
+
bottom: { left: 0, right: 0, bottom: 0, enterStyle: { y: 24, opacity: 0 }, exitStyle: { y: 24, opacity: 0 } }
|
|
171
146
|
};
|
|
172
|
-
var
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
147
|
+
var ACROSS = {
|
|
148
|
+
xs: 240,
|
|
149
|
+
sm: 320,
|
|
150
|
+
md: 384,
|
|
151
|
+
lg: 480,
|
|
152
|
+
xl: 640,
|
|
153
|
+
full: "100%"
|
|
177
154
|
};
|
|
155
|
+
var extent = (placement, size) => placement === "left" || placement === "right" ? { width: ACROSS[size], maxWidth: "100%" } : { height: ACROSS[size], maxHeight: "100%" };
|
|
156
|
+
var SCRIM = "rgba(0,0,0,0.5)";
|
|
178
157
|
var DrawerContent = React3__namespace.forwardRef(
|
|
179
158
|
function DrawerContent2(props, ref) {
|
|
180
|
-
const { children, portalled = true, portalRef, offset: _offset, backdrop = true,
|
|
159
|
+
const { children, portalled = true, portalRef: _portalRef, offset: _offset, backdrop = true, ...rest } = props;
|
|
181
160
|
const placement = React3__namespace.useContext(DrawerPlacementContext);
|
|
182
161
|
const size = React3__namespace.useContext(DrawerSizeContext);
|
|
183
|
-
const { open, setOpen, modal } = React3__namespace.useContext(DrawerStateContext);
|
|
184
|
-
|
|
185
|
-
if (isNarrow) {
|
|
162
|
+
const { open, setOpen, modal, narrow } = React3__namespace.useContext(DrawerStateContext);
|
|
163
|
+
if (narrow) {
|
|
186
164
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
187
165
|
gui.Sheet,
|
|
188
166
|
{
|
|
@@ -200,7 +178,7 @@ var DrawerContent = React3__namespace.forwardRef(
|
|
|
200
178
|
transition: "lazy",
|
|
201
179
|
enterStyle: { opacity: 0 },
|
|
202
180
|
exitStyle: { opacity: 0 },
|
|
203
|
-
|
|
181
|
+
backgroundColor: SCRIM
|
|
204
182
|
}
|
|
205
183
|
),
|
|
206
184
|
/* @__PURE__ */ jsxRuntime.jsx(gui.Sheet.Handle, {}),
|
|
@@ -208,10 +186,11 @@ var DrawerContent = React3__namespace.forwardRef(
|
|
|
208
186
|
gui.Sheet.Frame,
|
|
209
187
|
{
|
|
210
188
|
unstyled: true,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
),
|
|
189
|
+
flexDirection: "column",
|
|
190
|
+
borderTopLeftRadius: 16,
|
|
191
|
+
borderTopRightRadius: 16,
|
|
192
|
+
backgroundColor: "var(--color-drawer-bg)",
|
|
193
|
+
shadowColor: "var(--shadow-drawer)",
|
|
215
194
|
...rest,
|
|
216
195
|
children
|
|
217
196
|
}
|
|
@@ -222,68 +201,62 @@ var DrawerContent = React3__namespace.forwardRef(
|
|
|
222
201
|
}
|
|
223
202
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
224
203
|
backdrop && /* @__PURE__ */ jsxRuntime.jsx(
|
|
225
|
-
|
|
204
|
+
gui.Dialog.Overlay,
|
|
226
205
|
{
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
206
|
+
position: "fixed",
|
|
207
|
+
top: 0,
|
|
208
|
+
right: 0,
|
|
209
|
+
bottom: 0,
|
|
210
|
+
left: 0,
|
|
211
|
+
zIndex: 50,
|
|
212
|
+
backgroundColor: SCRIM,
|
|
213
|
+
transition: "lazy",
|
|
214
|
+
enterStyle: { opacity: 0 },
|
|
215
|
+
exitStyle: { opacity: 0 }
|
|
216
|
+
},
|
|
217
|
+
"overlay"
|
|
233
218
|
),
|
|
234
219
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
235
|
-
|
|
220
|
+
gui.Dialog.Content,
|
|
236
221
|
{
|
|
237
222
|
ref,
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
223
|
+
unstyled: true,
|
|
224
|
+
position: "fixed",
|
|
225
|
+
zIndex: 50,
|
|
226
|
+
flexDirection: "column",
|
|
227
|
+
backgroundColor: "var(--color-drawer-bg)",
|
|
228
|
+
transition: "medium",
|
|
229
|
+
...ANCHOR[placement],
|
|
230
|
+
...extent(placement, size),
|
|
244
231
|
...rest,
|
|
245
232
|
children
|
|
246
|
-
}
|
|
233
|
+
},
|
|
234
|
+
"content"
|
|
247
235
|
)
|
|
248
236
|
] });
|
|
249
|
-
|
|
250
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Portal, { container: portalRef?.current ?? void 0, children: content });
|
|
251
|
-
}
|
|
252
|
-
return content;
|
|
237
|
+
return portalled ? /* @__PURE__ */ jsxRuntime.jsx(gui.Dialog.Portal, { children: content }) : content;
|
|
253
238
|
}
|
|
254
239
|
);
|
|
255
240
|
var DrawerCloseTrigger = React3__namespace.forwardRef(function DrawerCloseTrigger2(props, ref) {
|
|
256
|
-
return
|
|
257
|
-
CloseButton
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
...props
|
|
262
|
-
}
|
|
263
|
-
) });
|
|
241
|
+
return (
|
|
242
|
+
// Placement belongs to the surrounding box, not to the button: CloseButton
|
|
243
|
+
// is a fixed 20px control and has no opinion about where it sits.
|
|
244
|
+
/* @__PURE__ */ jsxRuntime.jsx(gui.View, { position: "absolute", top: 28, right: 20, zIndex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(gui.Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { ref, ...props }) }) })
|
|
245
|
+
);
|
|
264
246
|
});
|
|
265
|
-
var DrawerTrigger = (
|
|
266
|
-
const {
|
|
267
|
-
|
|
268
|
-
};
|
|
269
|
-
var DrawerHeader = React3__namespace.forwardRef(
|
|
270
|
-
function DrawerHeader2({ className, ...props }, ref) {
|
|
271
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex flex-col gap-1.5 p-6 pb-0", className), ...props });
|
|
247
|
+
var DrawerTrigger = ({ asChild = true, children, ...rest }) => {
|
|
248
|
+
const { setOpen, narrow } = React3__namespace.useContext(DrawerStateContext);
|
|
249
|
+
if (narrow) {
|
|
250
|
+
return React3__namespace.isValidElement(children) ? React3__namespace.cloneElement(children, { onClick: () => setOpen(true) }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
272
251
|
}
|
|
273
|
-
);
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
var
|
|
280
|
-
|
|
281
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex items-center justify-end gap-2 p-6 pt-0", className), ...props });
|
|
282
|
-
}
|
|
283
|
-
);
|
|
284
|
-
var DrawerTitle = RadixDialog__namespace.Title;
|
|
285
|
-
var DrawerDescription = RadixDialog__namespace.Description;
|
|
286
|
-
var DrawerActionTrigger = RadixDialog__namespace.Close;
|
|
252
|
+
return /* @__PURE__ */ jsxRuntime.jsx(gui.Dialog.Trigger, { asChild, ...rest, children });
|
|
253
|
+
};
|
|
254
|
+
var DrawerHeader = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { gap: 6, padding: 24, paddingBottom: 0, ...props, children: ink(children) });
|
|
255
|
+
var DrawerBody = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { flex: 1, overflow: "scroll", padding: 24, ...props, children: ink(children) });
|
|
256
|
+
var DrawerFooter = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { alignItems: "center", justifyContent: "flex-end", gap: 8, padding: 24, paddingTop: 0, ...props, children: ink(children) });
|
|
257
|
+
var DrawerTitle = gui.Dialog.Title;
|
|
258
|
+
var DrawerDescription = gui.Dialog.Description;
|
|
259
|
+
var DrawerActionTrigger = gui.Dialog.Close;
|
|
287
260
|
|
|
288
261
|
exports.DrawerActionTrigger = DrawerActionTrigger;
|
|
289
262
|
exports.DrawerBody = DrawerBody;
|
package/dist/drawer.d.cts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import * as _hanzogui_core from '@hanzogui/core';
|
|
2
|
+
import * as _hanzo_gui from '@hanzo/gui';
|
|
3
|
+
import { Dialog, YStack, XStack } from '@hanzo/gui';
|
|
4
|
+
import * as _hanzogui_web from '@hanzogui/web';
|
|
1
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
3
6
|
import * as React from 'react';
|
|
4
7
|
|
|
5
8
|
interface DrawerRootProps {
|
|
@@ -9,13 +12,15 @@ interface DrawerRootProps {
|
|
|
9
12
|
onOpenChange?: (details: {
|
|
10
13
|
open: boolean;
|
|
11
14
|
}) => void;
|
|
12
|
-
placement?:
|
|
15
|
+
placement?: Placement;
|
|
13
16
|
initialFocusEl?: (() => HTMLElement | null) | React.RefObject<HTMLElement>;
|
|
14
17
|
lazyMount?: boolean;
|
|
15
18
|
unmountOnExit?: boolean;
|
|
16
19
|
modal?: boolean;
|
|
17
|
-
size?:
|
|
20
|
+
size?: Size;
|
|
18
21
|
}
|
|
22
|
+
type Placement = 'left' | 'right' | 'top' | 'bottom';
|
|
23
|
+
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
19
24
|
declare const DrawerRoot: (props: DrawerRootProps) => react_jsx_runtime.JSX.Element;
|
|
20
25
|
interface DrawerContentProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
21
26
|
portalled?: boolean;
|
|
@@ -25,12 +30,40 @@ interface DrawerContentProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
|
25
30
|
}
|
|
26
31
|
declare const DrawerContent: React.ForwardRefExoticComponent<DrawerContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
32
|
declare const DrawerCloseTrigger: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
28
|
-
declare const DrawerTrigger: (
|
|
29
|
-
declare const DrawerHeader: React.
|
|
30
|
-
declare const DrawerBody: React.
|
|
31
|
-
declare const DrawerFooter: React.
|
|
32
|
-
declare const DrawerTitle:
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
declare const DrawerTrigger: ({ asChild, children, ...rest }: React.ComponentProps<typeof Dialog.Trigger>) => react_jsx_runtime.JSX.Element;
|
|
34
|
+
declare const DrawerHeader: ({ children, ...props }: React.ComponentProps<typeof YStack>) => react_jsx_runtime.JSX.Element;
|
|
35
|
+
declare const DrawerBody: ({ children, ...props }: React.ComponentProps<typeof YStack>) => react_jsx_runtime.JSX.Element;
|
|
36
|
+
declare const DrawerFooter: ({ children, ...props }: React.ComponentProps<typeof XStack>) => react_jsx_runtime.JSX.Element;
|
|
37
|
+
declare const DrawerTitle: _hanzogui_web.GuiComponent<Omit<_hanzogui_web.GetFinalProps<_hanzogui_web.TextNonStyleProps, _hanzogui_web.TextStylePropsBase, {
|
|
38
|
+
unstyled?: boolean | undefined;
|
|
39
|
+
size?: _hanzogui_web.FontSizeTokens | undefined;
|
|
40
|
+
}>, "scope"> & {
|
|
41
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
42
|
+
}, _hanzogui_web.GuiTextElement, _hanzogui_web.TextNonStyleProps & {
|
|
43
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
44
|
+
}, _hanzogui_web.TextStylePropsBase, {
|
|
45
|
+
unstyled?: boolean | undefined;
|
|
46
|
+
size?: _hanzogui_web.FontSizeTokens | undefined;
|
|
47
|
+
}, _hanzogui_web.StaticConfigPublic>;
|
|
48
|
+
declare const DrawerDescription: _hanzogui_web.GuiComponent<Omit<_hanzogui_web.GetFinalProps<_hanzogui_web.TextNonStyleProps, _hanzogui_web.TextStylePropsBase, {
|
|
49
|
+
unstyled?: boolean | undefined;
|
|
50
|
+
size?: _hanzogui_web.FontSizeTokens | undefined;
|
|
51
|
+
}>, "scope"> & {
|
|
52
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
53
|
+
}, _hanzogui_web.GuiTextElement, _hanzogui_web.TextNonStyleProps & {
|
|
54
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
55
|
+
}, _hanzogui_web.TextStylePropsBase, {
|
|
56
|
+
unstyled?: boolean | undefined;
|
|
57
|
+
size?: _hanzogui_web.FontSizeTokens | undefined;
|
|
58
|
+
}, _hanzogui_web.StaticConfigPublic>;
|
|
59
|
+
declare const DrawerActionTrigger: _hanzogui_web.GuiComponent<Omit<_hanzogui_web.GetFinalProps<_hanzogui_core.RNViewNonStyleProps, _hanzogui_web.StackStyleBase, {}>, "scope" | "displayWhenAdapted"> & {
|
|
60
|
+
displayWhenAdapted?: boolean;
|
|
61
|
+
} & {
|
|
62
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
63
|
+
}, _hanzogui_web.GuiElement, _hanzogui_core.RNViewNonStyleProps & {
|
|
64
|
+
displayWhenAdapted?: boolean;
|
|
65
|
+
} & {
|
|
66
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
67
|
+
}, _hanzogui_web.StackStyleBase, {}, _hanzogui_web.StaticConfigPublic>;
|
|
35
68
|
|
|
36
69
|
export { DrawerActionTrigger, DrawerBody, DrawerCloseTrigger, DrawerContent, type DrawerContentProps, DrawerDescription, DrawerFooter, DrawerHeader, DrawerRoot, type DrawerRootProps, DrawerTitle, DrawerTrigger };
|
package/dist/drawer.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import * as _hanzogui_core from '@hanzogui/core';
|
|
2
|
+
import * as _hanzo_gui from '@hanzo/gui';
|
|
3
|
+
import { Dialog, YStack, XStack } from '@hanzo/gui';
|
|
4
|
+
import * as _hanzogui_web from '@hanzogui/web';
|
|
1
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
3
6
|
import * as React from 'react';
|
|
4
7
|
|
|
5
8
|
interface DrawerRootProps {
|
|
@@ -9,13 +12,15 @@ interface DrawerRootProps {
|
|
|
9
12
|
onOpenChange?: (details: {
|
|
10
13
|
open: boolean;
|
|
11
14
|
}) => void;
|
|
12
|
-
placement?:
|
|
15
|
+
placement?: Placement;
|
|
13
16
|
initialFocusEl?: (() => HTMLElement | null) | React.RefObject<HTMLElement>;
|
|
14
17
|
lazyMount?: boolean;
|
|
15
18
|
unmountOnExit?: boolean;
|
|
16
19
|
modal?: boolean;
|
|
17
|
-
size?:
|
|
20
|
+
size?: Size;
|
|
18
21
|
}
|
|
22
|
+
type Placement = 'left' | 'right' | 'top' | 'bottom';
|
|
23
|
+
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
19
24
|
declare const DrawerRoot: (props: DrawerRootProps) => react_jsx_runtime.JSX.Element;
|
|
20
25
|
interface DrawerContentProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
21
26
|
portalled?: boolean;
|
|
@@ -25,12 +30,40 @@ interface DrawerContentProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
|
25
30
|
}
|
|
26
31
|
declare const DrawerContent: React.ForwardRefExoticComponent<DrawerContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
27
32
|
declare const DrawerCloseTrigger: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
28
|
-
declare const DrawerTrigger: (
|
|
29
|
-
declare const DrawerHeader: React.
|
|
30
|
-
declare const DrawerBody: React.
|
|
31
|
-
declare const DrawerFooter: React.
|
|
32
|
-
declare const DrawerTitle:
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
declare const DrawerTrigger: ({ asChild, children, ...rest }: React.ComponentProps<typeof Dialog.Trigger>) => react_jsx_runtime.JSX.Element;
|
|
34
|
+
declare const DrawerHeader: ({ children, ...props }: React.ComponentProps<typeof YStack>) => react_jsx_runtime.JSX.Element;
|
|
35
|
+
declare const DrawerBody: ({ children, ...props }: React.ComponentProps<typeof YStack>) => react_jsx_runtime.JSX.Element;
|
|
36
|
+
declare const DrawerFooter: ({ children, ...props }: React.ComponentProps<typeof XStack>) => react_jsx_runtime.JSX.Element;
|
|
37
|
+
declare const DrawerTitle: _hanzogui_web.GuiComponent<Omit<_hanzogui_web.GetFinalProps<_hanzogui_web.TextNonStyleProps, _hanzogui_web.TextStylePropsBase, {
|
|
38
|
+
unstyled?: boolean | undefined;
|
|
39
|
+
size?: _hanzogui_web.FontSizeTokens | undefined;
|
|
40
|
+
}>, "scope"> & {
|
|
41
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
42
|
+
}, _hanzogui_web.GuiTextElement, _hanzogui_web.TextNonStyleProps & {
|
|
43
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
44
|
+
}, _hanzogui_web.TextStylePropsBase, {
|
|
45
|
+
unstyled?: boolean | undefined;
|
|
46
|
+
size?: _hanzogui_web.FontSizeTokens | undefined;
|
|
47
|
+
}, _hanzogui_web.StaticConfigPublic>;
|
|
48
|
+
declare const DrawerDescription: _hanzogui_web.GuiComponent<Omit<_hanzogui_web.GetFinalProps<_hanzogui_web.TextNonStyleProps, _hanzogui_web.TextStylePropsBase, {
|
|
49
|
+
unstyled?: boolean | undefined;
|
|
50
|
+
size?: _hanzogui_web.FontSizeTokens | undefined;
|
|
51
|
+
}>, "scope"> & {
|
|
52
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
53
|
+
}, _hanzogui_web.GuiTextElement, _hanzogui_web.TextNonStyleProps & {
|
|
54
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
55
|
+
}, _hanzogui_web.TextStylePropsBase, {
|
|
56
|
+
unstyled?: boolean | undefined;
|
|
57
|
+
size?: _hanzogui_web.FontSizeTokens | undefined;
|
|
58
|
+
}, _hanzogui_web.StaticConfigPublic>;
|
|
59
|
+
declare const DrawerActionTrigger: _hanzogui_web.GuiComponent<Omit<_hanzogui_web.GetFinalProps<_hanzogui_core.RNViewNonStyleProps, _hanzogui_web.StackStyleBase, {}>, "scope" | "displayWhenAdapted"> & {
|
|
60
|
+
displayWhenAdapted?: boolean;
|
|
61
|
+
} & {
|
|
62
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
63
|
+
}, _hanzogui_web.GuiElement, _hanzogui_core.RNViewNonStyleProps & {
|
|
64
|
+
displayWhenAdapted?: boolean;
|
|
65
|
+
} & {
|
|
66
|
+
scope?: _hanzo_gui.DialogScopes;
|
|
67
|
+
}, _hanzogui_web.StackStyleBase, {}, _hanzogui_web.StaticConfigPublic>;
|
|
35
68
|
|
|
36
69
|
export { DrawerActionTrigger, DrawerBody, DrawerCloseTrigger, DrawerContent, type DrawerContentProps, DrawerDescription, DrawerFooter, DrawerHeader, DrawerRoot, type DrawerRootProps, DrawerTitle, DrawerTrigger };
|