@luxfi/ui 7.4.0 → 7.4.2
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/avatar.cjs +7 -6
- package/dist/avatar.js +7 -5
- package/dist/badge.cjs +30 -32
- package/dist/badge.js +30 -32
- package/dist/bank.d.cts +3 -3
- package/dist/bank.d.ts +3 -3
- package/dist/checkbox.cjs +4 -4
- package/dist/checkbox.d.cts +3 -2
- package/dist/checkbox.d.ts +3 -2
- package/dist/checkbox.js +5 -4
- package/dist/chrome.cjs +950 -0
- package/dist/chrome.d.cts +93 -0
- package/dist/chrome.d.ts +93 -0
- package/dist/chrome.js +921 -0
- package/dist/drawer.cjs +86 -20
- package/dist/drawer.js +85 -19
- package/dist/expiration-selector.cjs +3 -2
- package/dist/expiration-selector.js +3 -2
- package/dist/greeks-display.cjs +6 -6
- package/dist/greeks-display.js +6 -6
- package/dist/gui.cjs +13 -0
- package/dist/gui.d.cts +2 -0
- package/dist/gui.d.ts +2 -0
- package/dist/gui.js +2 -0
- package/dist/heading.cjs +4 -2
- package/dist/heading.js +4 -2
- package/dist/iam.cjs +206 -0
- package/dist/iam.d.cts +65 -0
- package/dist/iam.d.ts +65 -0
- package/dist/iam.js +201 -0
- package/dist/icons.cjs +13 -0
- package/dist/icons.d.cts +1 -0
- package/dist/icons.d.ts +1 -0
- package/dist/icons.js +2 -0
- package/dist/identity.cjs +420 -0
- package/dist/identity.d.cts +64 -0
- package/dist/identity.d.ts +64 -0
- package/dist/identity.js +398 -0
- package/dist/index.cjs +1597 -833
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +1574 -828
- package/dist/input.cjs +3 -1
- package/dist/input.d.cts +3 -5
- package/dist/input.d.ts +3 -5
- package/dist/input.js +3 -1
- package/dist/lux.config.cjs +23 -2
- package/dist/lux.config.d.cts +28 -10
- package/dist/lux.config.d.ts +28 -10
- package/dist/lux.config.js +23 -2
- package/dist/menu.cjs +4 -4
- package/dist/menu.js +4 -4
- package/dist/next.cjs +99 -0
- package/dist/next.d.cts +29 -0
- package/dist/next.d.ts +29 -0
- package/dist/next.js +96 -0
- package/dist/option-chain.cjs +1 -1
- package/dist/option-chain.js +1 -1
- package/dist/option-position.cjs +2 -1
- package/dist/option-position.js +2 -1
- package/dist/pnl-diagram.cjs +8 -6
- package/dist/pnl-diagram.js +8 -6
- package/dist/progress.cjs +7 -6
- package/dist/progress.js +7 -5
- package/dist/provider.cjs +136 -4
- package/dist/provider.d.cts +15 -3
- package/dist/provider.d.ts +15 -3
- package/dist/provider.js +136 -5
- package/dist/radio.cjs +9 -7
- package/dist/radio.js +10 -7
- package/dist/separator.cjs +3 -1
- package/dist/separator.js +3 -1
- package/dist/slider.cjs +28 -16
- package/dist/slider.js +28 -15
- package/dist/strategy-builder.cjs +2 -1
- package/dist/strategy-builder.js +2 -1
- package/dist/switch.cjs +11 -12
- package/dist/switch.js +12 -12
- package/dist/tag.cjs +31 -33
- package/dist/tag.js +30 -32
- package/dist/textarea.cjs +3 -1
- package/dist/textarea.js +3 -1
- package/dist/tooltip.cjs +25 -27
- package/dist/tooltip.js +24 -26
- package/dist/use-narrow.cjs +46 -0
- package/dist/use-narrow.d.cts +12 -0
- package/dist/use-narrow.d.ts +12 -0
- package/dist/use-narrow.js +20 -0
- package/dist/vite.cjs +40 -0
- package/dist/vite.d.cts +29 -0
- package/dist/vite.d.ts +29 -0
- package/dist/vite.js +38 -0
- package/dist/white-label.cjs +132 -0
- package/dist/white-label.d.cts +59 -0
- package/dist/white-label.d.ts +59 -0
- package/dist/white-label.js +124 -0
- package/package.json +85 -19
- package/src/avatar.tsx +22 -16
- package/src/checkbox.tsx +15 -10
- package/src/chrome.tsx +459 -0
- package/src/drawer.tsx +83 -10
- package/src/expiration-selector.tsx +3 -2
- package/src/greeks-display.tsx +9 -6
- package/src/gui.ts +17 -0
- package/src/heading.tsx +12 -8
- package/src/iam.ts +170 -0
- package/src/icons.ts +18 -0
- package/src/identity.tsx +318 -0
- package/src/index.ts +44 -1
- package/src/input.tsx +13 -9
- package/src/lux.config.ts +16 -15
- package/src/menu.tsx +4 -4
- package/src/next.ts +142 -0
- package/src/option-chain.tsx +1 -1
- package/src/option-position.tsx +2 -1
- package/src/pnl-diagram.tsx +11 -6
- package/src/progress.tsx +15 -8
- package/src/provider.tsx +48 -7
- package/src/radio.tsx +15 -11
- package/src/separator.tsx +8 -3
- package/src/slider.tsx +35 -19
- package/src/strategy-builder.tsx +3 -2
- package/src/switch.tsx +17 -16
- package/src/textarea.tsx +8 -4
- package/src/tooltip.tsx +2 -21
- package/src/use-narrow.ts +40 -0
- package/src/vite.ts +78 -0
- package/src/white-label.ts +240 -0
- package/tokens.css +544 -319
- package/src/tokens.css +0 -438
package/dist/avatar.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
6
|
var clsx = require('clsx');
|
|
7
7
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -25,7 +25,6 @@ function _interopNamespace(e) {
|
|
|
25
25
|
return Object.freeze(n);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
var RadixAvatar__namespace = /*#__PURE__*/_interopNamespace(RadixAvatar);
|
|
29
28
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
30
29
|
|
|
31
30
|
function cn(...inputs) {
|
|
@@ -71,9 +70,10 @@ var Avatar = React__namespace.forwardRef(
|
|
|
71
70
|
const variant = variantProp ?? group.variant ?? DEFAULT_VARIANT;
|
|
72
71
|
const isBorderless = borderless ?? group.borderless ?? false;
|
|
73
72
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
74
|
-
|
|
73
|
+
gui.Avatar,
|
|
75
74
|
{
|
|
76
75
|
ref,
|
|
76
|
+
unstyled: true,
|
|
77
77
|
className: cn(
|
|
78
78
|
"relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full align-middle",
|
|
79
79
|
SIZE_CLASSES[size],
|
|
@@ -84,8 +84,8 @@ var Avatar = React__namespace.forwardRef(
|
|
|
84
84
|
...rest,
|
|
85
85
|
children: [
|
|
86
86
|
/* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { name, icon, children: fallback }),
|
|
87
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
88
|
-
|
|
87
|
+
src != null && /* @__PURE__ */ jsxRuntime.jsx(
|
|
88
|
+
gui.Avatar.Image,
|
|
89
89
|
{
|
|
90
90
|
className: "h-full w-full rounded-[inherit] object-cover",
|
|
91
91
|
src,
|
|
@@ -104,9 +104,10 @@ var AvatarFallback = React__namespace.forwardRef(
|
|
|
104
104
|
function AvatarFallback2(props, ref) {
|
|
105
105
|
const { name, icon, children, className, ...rest } = props;
|
|
106
106
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
107
|
-
|
|
107
|
+
gui.Avatar.Fallback,
|
|
108
108
|
{
|
|
109
109
|
ref,
|
|
110
|
+
unstyled: true,
|
|
110
111
|
className: cn(
|
|
111
112
|
"flex h-full w-full items-center justify-center font-medium",
|
|
112
113
|
className
|
package/dist/avatar.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import { Avatar as Avatar$1 } from '@hanzo/gui';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -48,9 +48,10 @@ var Avatar = React.forwardRef(
|
|
|
48
48
|
const variant = variantProp ?? group.variant ?? DEFAULT_VARIANT;
|
|
49
49
|
const isBorderless = borderless ?? group.borderless ?? false;
|
|
50
50
|
return /* @__PURE__ */ jsxs(
|
|
51
|
-
|
|
51
|
+
Avatar$1,
|
|
52
52
|
{
|
|
53
53
|
ref,
|
|
54
|
+
unstyled: true,
|
|
54
55
|
className: cn(
|
|
55
56
|
"relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full align-middle",
|
|
56
57
|
SIZE_CLASSES[size],
|
|
@@ -61,8 +62,8 @@ var Avatar = React.forwardRef(
|
|
|
61
62
|
...rest,
|
|
62
63
|
children: [
|
|
63
64
|
/* @__PURE__ */ jsx(AvatarFallback, { name, icon, children: fallback }),
|
|
64
|
-
/* @__PURE__ */ jsx(
|
|
65
|
-
|
|
65
|
+
src != null && /* @__PURE__ */ jsx(
|
|
66
|
+
Avatar$1.Image,
|
|
66
67
|
{
|
|
67
68
|
className: "h-full w-full rounded-[inherit] object-cover",
|
|
68
69
|
src,
|
|
@@ -81,9 +82,10 @@ var AvatarFallback = React.forwardRef(
|
|
|
81
82
|
function AvatarFallback2(props, ref) {
|
|
82
83
|
const { name, icon, children, className, ...rest } = props;
|
|
83
84
|
return /* @__PURE__ */ jsxs(
|
|
84
|
-
|
|
85
|
+
Avatar$1.Fallback,
|
|
85
86
|
{
|
|
86
87
|
ref,
|
|
88
|
+
unstyled: true,
|
|
87
89
|
className: cn(
|
|
88
90
|
"flex h-full w-full items-center justify-center font-medium",
|
|
89
91
|
className
|
package/dist/badge.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var React3 = require('react');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var tailwindMerge = require('tailwind-merge');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -26,7 +26,7 @@ function _interopNamespace(e) {
|
|
|
26
26
|
return Object.freeze(n);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var React3__namespace = /*#__PURE__*/_interopNamespace(React3);
|
|
30
30
|
|
|
31
31
|
// src/badge.tsx
|
|
32
32
|
function cn(...inputs) {
|
|
@@ -152,7 +152,7 @@ var SKELETON_CLASSES = [
|
|
|
152
152
|
"bg-[length:200%_100%]"
|
|
153
153
|
].join(" ");
|
|
154
154
|
var HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
|
|
155
|
-
var Skeleton =
|
|
155
|
+
var Skeleton = React3__namespace.forwardRef(
|
|
156
156
|
function Skeleton2(props, ref) {
|
|
157
157
|
const { loading = false, asChild, className, children, style: styleProp, as: Component = "div", ...allRest } = props;
|
|
158
158
|
const shimStyle = shimToStyle(props);
|
|
@@ -161,10 +161,10 @@ var Skeleton = React2__namespace.forwardRef(
|
|
|
161
161
|
const cls = hideBelowClass ? cn(className, hideBelowClass) : className;
|
|
162
162
|
const htmlRest = stripShims(allRest);
|
|
163
163
|
if (!loading) {
|
|
164
|
-
if (asChild &&
|
|
164
|
+
if (asChild && React3__namespace.isValidElement(children)) return children;
|
|
165
165
|
return /* @__PURE__ */ jsxRuntime.jsx(Component, { ref, className: cls, style: mergedStyle, ...htmlRest, children });
|
|
166
166
|
}
|
|
167
|
-
if (asChild &&
|
|
167
|
+
if (asChild && React3__namespace.isValidElement(children)) {
|
|
168
168
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
169
169
|
Component,
|
|
170
170
|
{
|
|
@@ -190,7 +190,7 @@ var Skeleton = React2__namespace.forwardRef(
|
|
|
190
190
|
);
|
|
191
191
|
}
|
|
192
192
|
);
|
|
193
|
-
|
|
193
|
+
React3__namespace.forwardRef(
|
|
194
194
|
function SkeletonCircle2(props, ref) {
|
|
195
195
|
const { size = 40, loading = true, className, ...rest } = props;
|
|
196
196
|
const dimension = typeof size === "number" ? `${size}px` : size;
|
|
@@ -206,7 +206,7 @@ React2__namespace.forwardRef(
|
|
|
206
206
|
);
|
|
207
207
|
}
|
|
208
208
|
);
|
|
209
|
-
|
|
209
|
+
React3__namespace.forwardRef(
|
|
210
210
|
function SkeletonText2(props, ref) {
|
|
211
211
|
const { noOfLines = 3, loading = true, className, ...rest } = props;
|
|
212
212
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...rest, children: Array.from({ length: noOfLines }).map((_, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -219,26 +219,24 @@ React2__namespace.forwardRef(
|
|
|
219
219
|
)) });
|
|
220
220
|
}
|
|
221
221
|
);
|
|
222
|
-
var
|
|
223
|
-
function
|
|
224
|
-
const [
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
return () => mql.removeEventListener("change", handler);
|
|
234
|
-
}, []);
|
|
235
|
-
return isMobile;
|
|
222
|
+
var TOUCH_PX = 1024;
|
|
223
|
+
function useBelow(px) {
|
|
224
|
+
const [below, setBelow] = React3__namespace.useState(false);
|
|
225
|
+
React3__namespace.useEffect(() => {
|
|
226
|
+
const mql = window.matchMedia(`(max-width: ${px - 1}px)`);
|
|
227
|
+
const apply = () => setBelow(mql.matches);
|
|
228
|
+
apply();
|
|
229
|
+
mql.addEventListener("change", apply);
|
|
230
|
+
return () => mql.removeEventListener("change", apply);
|
|
231
|
+
}, [px]);
|
|
232
|
+
return below;
|
|
236
233
|
}
|
|
234
|
+
var useIsTouch = () => useBelow(TOUCH_PX);
|
|
237
235
|
function mapPlacement(p) {
|
|
238
236
|
if (!p) return void 0;
|
|
239
237
|
return p;
|
|
240
238
|
}
|
|
241
|
-
var Tooltip =
|
|
239
|
+
var Tooltip = React3__namespace.forwardRef(
|
|
242
240
|
function Tooltip2(props, ref) {
|
|
243
241
|
const {
|
|
244
242
|
showArrow: showArrowProp,
|
|
@@ -257,28 +255,28 @@ var Tooltip = React2__namespace.forwardRef(
|
|
|
257
255
|
interactive,
|
|
258
256
|
positioning
|
|
259
257
|
} = props;
|
|
260
|
-
const [open, setOpen] =
|
|
261
|
-
const timeoutRef =
|
|
262
|
-
const isMobile =
|
|
263
|
-
const handleOpenChange =
|
|
258
|
+
const [open, setOpen] = React3__namespace.useState(defaultOpen);
|
|
259
|
+
const timeoutRef = React3__namespace.useRef(null);
|
|
260
|
+
const isMobile = useIsTouch();
|
|
261
|
+
const handleOpenChange = React3__namespace.useCallback((nextOpen) => {
|
|
264
262
|
setOpen(nextOpen);
|
|
265
263
|
onOpenChange?.({ open: nextOpen });
|
|
266
264
|
}, [onOpenChange]);
|
|
267
|
-
const handleOpenChangeManual =
|
|
265
|
+
const handleOpenChangeManual = React3__namespace.useCallback((nextOpen) => {
|
|
268
266
|
timeoutRef.current && window.clearTimeout(timeoutRef.current);
|
|
269
267
|
timeoutRef.current = window.setTimeout(() => {
|
|
270
268
|
setOpen(nextOpen);
|
|
271
269
|
onOpenChange?.({ open: nextOpen });
|
|
272
270
|
}, nextOpen ? openDelay : closeDelay);
|
|
273
271
|
}, [closeDelay, openDelay, onOpenChange]);
|
|
274
|
-
const handleClickAway =
|
|
272
|
+
const handleClickAway = React3__namespace.useCallback(() => {
|
|
275
273
|
handleOpenChangeManual(false);
|
|
276
274
|
}, [handleOpenChangeManual]);
|
|
277
275
|
const triggerRef = usehooks.useClickAway(handleClickAway);
|
|
278
|
-
const handleTriggerClick =
|
|
276
|
+
const handleTriggerClick = React3__namespace.useCallback(() => {
|
|
279
277
|
handleOpenChangeManual(!open);
|
|
280
278
|
}, [handleOpenChangeManual, open]);
|
|
281
|
-
const handleContentClick =
|
|
279
|
+
const handleContentClick = React3__namespace.useCallback((event) => {
|
|
282
280
|
event.stopPropagation();
|
|
283
281
|
if (interactive) {
|
|
284
282
|
const closestLink = event.target?.closest("a");
|
|
@@ -287,7 +285,7 @@ var Tooltip = React2__namespace.forwardRef(
|
|
|
287
285
|
}
|
|
288
286
|
}
|
|
289
287
|
}, [interactive, handleOpenChangeManual]);
|
|
290
|
-
|
|
288
|
+
React3__namespace.useEffect(() => {
|
|
291
289
|
return () => {
|
|
292
290
|
if (timeoutRef.current) {
|
|
293
291
|
clearTimeout(timeoutRef.current);
|
|
@@ -389,7 +387,7 @@ var COLOR_PALETTE_CLASSES = {
|
|
|
389
387
|
bright_pink: "bg-badge-bright-pink-bg text-badge-bright-pink-fg"
|
|
390
388
|
};
|
|
391
389
|
var S2 = 4;
|
|
392
|
-
var Badge =
|
|
390
|
+
var Badge = React3__namespace.default.forwardRef(
|
|
393
391
|
function Badge2(props, ref) {
|
|
394
392
|
const {
|
|
395
393
|
loading,
|
package/dist/badge.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
2
|
+
import * as React3 from 'react';
|
|
3
|
+
import React3__default from 'react';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
6
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -131,7 +131,7 @@ var SKELETON_CLASSES = [
|
|
|
131
131
|
"bg-[length:200%_100%]"
|
|
132
132
|
].join(" ");
|
|
133
133
|
var HIDE_BELOW_MAP = { lg: "lg:hidden", md: "md:hidden", sm: "sm:hidden" };
|
|
134
|
-
var Skeleton =
|
|
134
|
+
var Skeleton = React3.forwardRef(
|
|
135
135
|
function Skeleton2(props, ref) {
|
|
136
136
|
const { loading = false, asChild, className, children, style: styleProp, as: Component = "div", ...allRest } = props;
|
|
137
137
|
const shimStyle = shimToStyle(props);
|
|
@@ -140,10 +140,10 @@ var Skeleton = React2.forwardRef(
|
|
|
140
140
|
const cls = hideBelowClass ? cn(className, hideBelowClass) : className;
|
|
141
141
|
const htmlRest = stripShims(allRest);
|
|
142
142
|
if (!loading) {
|
|
143
|
-
if (asChild &&
|
|
143
|
+
if (asChild && React3.isValidElement(children)) return children;
|
|
144
144
|
return /* @__PURE__ */ jsx(Component, { ref, className: cls, style: mergedStyle, ...htmlRest, children });
|
|
145
145
|
}
|
|
146
|
-
if (asChild &&
|
|
146
|
+
if (asChild && React3.isValidElement(children)) {
|
|
147
147
|
return /* @__PURE__ */ jsx(
|
|
148
148
|
Component,
|
|
149
149
|
{
|
|
@@ -169,7 +169,7 @@ var Skeleton = React2.forwardRef(
|
|
|
169
169
|
);
|
|
170
170
|
}
|
|
171
171
|
);
|
|
172
|
-
|
|
172
|
+
React3.forwardRef(
|
|
173
173
|
function SkeletonCircle2(props, ref) {
|
|
174
174
|
const { size = 40, loading = true, className, ...rest } = props;
|
|
175
175
|
const dimension = typeof size === "number" ? `${size}px` : size;
|
|
@@ -185,7 +185,7 @@ React2.forwardRef(
|
|
|
185
185
|
);
|
|
186
186
|
}
|
|
187
187
|
);
|
|
188
|
-
|
|
188
|
+
React3.forwardRef(
|
|
189
189
|
function SkeletonText2(props, ref) {
|
|
190
190
|
const { noOfLines = 3, loading = true, className, ...rest } = props;
|
|
191
191
|
return /* @__PURE__ */ jsx("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...rest, children: Array.from({ length: noOfLines }).map((_, index) => /* @__PURE__ */ jsx(
|
|
@@ -198,26 +198,24 @@ React2.forwardRef(
|
|
|
198
198
|
)) });
|
|
199
199
|
}
|
|
200
200
|
);
|
|
201
|
-
var
|
|
202
|
-
function
|
|
203
|
-
const [
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
return () => mql.removeEventListener("change", handler);
|
|
213
|
-
}, []);
|
|
214
|
-
return isMobile;
|
|
201
|
+
var TOUCH_PX = 1024;
|
|
202
|
+
function useBelow(px) {
|
|
203
|
+
const [below, setBelow] = React3.useState(false);
|
|
204
|
+
React3.useEffect(() => {
|
|
205
|
+
const mql = window.matchMedia(`(max-width: ${px - 1}px)`);
|
|
206
|
+
const apply = () => setBelow(mql.matches);
|
|
207
|
+
apply();
|
|
208
|
+
mql.addEventListener("change", apply);
|
|
209
|
+
return () => mql.removeEventListener("change", apply);
|
|
210
|
+
}, [px]);
|
|
211
|
+
return below;
|
|
215
212
|
}
|
|
213
|
+
var useIsTouch = () => useBelow(TOUCH_PX);
|
|
216
214
|
function mapPlacement(p) {
|
|
217
215
|
if (!p) return void 0;
|
|
218
216
|
return p;
|
|
219
217
|
}
|
|
220
|
-
var Tooltip =
|
|
218
|
+
var Tooltip = React3.forwardRef(
|
|
221
219
|
function Tooltip2(props, ref) {
|
|
222
220
|
const {
|
|
223
221
|
showArrow: showArrowProp,
|
|
@@ -236,28 +234,28 @@ var Tooltip = React2.forwardRef(
|
|
|
236
234
|
interactive,
|
|
237
235
|
positioning
|
|
238
236
|
} = props;
|
|
239
|
-
const [open, setOpen] =
|
|
240
|
-
const timeoutRef =
|
|
241
|
-
const isMobile =
|
|
242
|
-
const handleOpenChange =
|
|
237
|
+
const [open, setOpen] = React3.useState(defaultOpen);
|
|
238
|
+
const timeoutRef = React3.useRef(null);
|
|
239
|
+
const isMobile = useIsTouch();
|
|
240
|
+
const handleOpenChange = React3.useCallback((nextOpen) => {
|
|
243
241
|
setOpen(nextOpen);
|
|
244
242
|
onOpenChange?.({ open: nextOpen });
|
|
245
243
|
}, [onOpenChange]);
|
|
246
|
-
const handleOpenChangeManual =
|
|
244
|
+
const handleOpenChangeManual = React3.useCallback((nextOpen) => {
|
|
247
245
|
timeoutRef.current && window.clearTimeout(timeoutRef.current);
|
|
248
246
|
timeoutRef.current = window.setTimeout(() => {
|
|
249
247
|
setOpen(nextOpen);
|
|
250
248
|
onOpenChange?.({ open: nextOpen });
|
|
251
249
|
}, nextOpen ? openDelay : closeDelay);
|
|
252
250
|
}, [closeDelay, openDelay, onOpenChange]);
|
|
253
|
-
const handleClickAway =
|
|
251
|
+
const handleClickAway = React3.useCallback(() => {
|
|
254
252
|
handleOpenChangeManual(false);
|
|
255
253
|
}, [handleOpenChangeManual]);
|
|
256
254
|
const triggerRef = useClickAway(handleClickAway);
|
|
257
|
-
const handleTriggerClick =
|
|
255
|
+
const handleTriggerClick = React3.useCallback(() => {
|
|
258
256
|
handleOpenChangeManual(!open);
|
|
259
257
|
}, [handleOpenChangeManual, open]);
|
|
260
|
-
const handleContentClick =
|
|
258
|
+
const handleContentClick = React3.useCallback((event) => {
|
|
261
259
|
event.stopPropagation();
|
|
262
260
|
if (interactive) {
|
|
263
261
|
const closestLink = event.target?.closest("a");
|
|
@@ -266,7 +264,7 @@ var Tooltip = React2.forwardRef(
|
|
|
266
264
|
}
|
|
267
265
|
}
|
|
268
266
|
}, [interactive, handleOpenChangeManual]);
|
|
269
|
-
|
|
267
|
+
React3.useEffect(() => {
|
|
270
268
|
return () => {
|
|
271
269
|
if (timeoutRef.current) {
|
|
272
270
|
clearTimeout(timeoutRef.current);
|
|
@@ -368,7 +366,7 @@ var COLOR_PALETTE_CLASSES = {
|
|
|
368
366
|
bright_pink: "bg-badge-bright-pink-bg text-badge-bright-pink-fg"
|
|
369
367
|
};
|
|
370
368
|
var S2 = 4;
|
|
371
|
-
var Badge =
|
|
369
|
+
var Badge = React3__default.forwardRef(
|
|
372
370
|
function Badge2(props, ref) {
|
|
373
371
|
const {
|
|
374
372
|
loading,
|
package/dist/bank.d.cts
CHANGED
|
@@ -40,12 +40,12 @@ type BankInputProps = GetProps<typeof BankInput> & {
|
|
|
40
40
|
placeholderTextColor?: string;
|
|
41
41
|
};
|
|
42
42
|
declare const BankButton: _hanzogui_web.GuiComponent<_hanzogui_web.TamaDefer, _hanzogui_web.GuiElement, _hanzogui_core.RNViewNonStyleProps, _hanzogui_web.StackStyleBase, {
|
|
43
|
-
variant?: "primary" | "secondary" | "ghost" | undefined;
|
|
44
43
|
disabled?: boolean | undefined;
|
|
44
|
+
variant?: "primary" | "secondary" | "ghost" | undefined;
|
|
45
45
|
}, _hanzogui_web.StaticConfigPublic>;
|
|
46
46
|
declare const BankButtonText: _hanzogui_web.GuiComponent<_hanzogui_web.TamaDefer, _hanzogui_web.GuiTextElement, _hanzogui_core.RNTextNonStyleProps, _hanzogui_web.TextStylePropsBase, {
|
|
47
|
-
variant?: "primary" | "secondary" | "ghost" | undefined;
|
|
48
47
|
unstyled?: boolean | undefined;
|
|
48
|
+
variant?: "primary" | "secondary" | "ghost" | undefined;
|
|
49
49
|
}, _hanzogui_web.StaticConfigPublic>;
|
|
50
50
|
type BankButtonProps = GetProps<typeof BankButton>;
|
|
51
51
|
declare const BankHeading: _hanzogui_web.GuiComponent<_hanzogui_web.TamaDefer, _hanzogui_web.GuiTextElement, _hanzogui_core.RNTextNonStyleProps, _hanzogui_web.TextStylePropsBase, {
|
|
@@ -54,8 +54,8 @@ declare const BankHeading: _hanzogui_web.GuiComponent<_hanzogui_web.TamaDefer, _
|
|
|
54
54
|
}, _hanzogui_web.StaticConfigPublic>;
|
|
55
55
|
type BankHeadingProps = GetProps<typeof BankHeading>;
|
|
56
56
|
declare const BankText: _hanzogui_web.GuiComponent<_hanzogui_web.TamaDefer, _hanzogui_web.GuiTextElement, _hanzogui_core.RNTextNonStyleProps, _hanzogui_web.TextStylePropsBase, {
|
|
57
|
-
variant?: "default" | "label" | "link" | "error" | "success" | "muted" | undefined;
|
|
58
57
|
unstyled?: boolean | undefined;
|
|
58
|
+
variant?: "default" | "label" | "link" | "error" | "success" | "muted" | undefined;
|
|
59
59
|
}, _hanzogui_web.StaticConfigPublic>;
|
|
60
60
|
type BankTextProps = GetProps<typeof BankText>;
|
|
61
61
|
declare function BankField({ label, error, children, }: {
|
package/dist/bank.d.ts
CHANGED
|
@@ -40,12 +40,12 @@ type BankInputProps = GetProps<typeof BankInput> & {
|
|
|
40
40
|
placeholderTextColor?: string;
|
|
41
41
|
};
|
|
42
42
|
declare const BankButton: _hanzogui_web.GuiComponent<_hanzogui_web.TamaDefer, _hanzogui_web.GuiElement, _hanzogui_core.RNViewNonStyleProps, _hanzogui_web.StackStyleBase, {
|
|
43
|
-
variant?: "primary" | "secondary" | "ghost" | undefined;
|
|
44
43
|
disabled?: boolean | undefined;
|
|
44
|
+
variant?: "primary" | "secondary" | "ghost" | undefined;
|
|
45
45
|
}, _hanzogui_web.StaticConfigPublic>;
|
|
46
46
|
declare const BankButtonText: _hanzogui_web.GuiComponent<_hanzogui_web.TamaDefer, _hanzogui_web.GuiTextElement, _hanzogui_core.RNTextNonStyleProps, _hanzogui_web.TextStylePropsBase, {
|
|
47
|
-
variant?: "primary" | "secondary" | "ghost" | undefined;
|
|
48
47
|
unstyled?: boolean | undefined;
|
|
48
|
+
variant?: "primary" | "secondary" | "ghost" | undefined;
|
|
49
49
|
}, _hanzogui_web.StaticConfigPublic>;
|
|
50
50
|
type BankButtonProps = GetProps<typeof BankButton>;
|
|
51
51
|
declare const BankHeading: _hanzogui_web.GuiComponent<_hanzogui_web.TamaDefer, _hanzogui_web.GuiTextElement, _hanzogui_core.RNTextNonStyleProps, _hanzogui_web.TextStylePropsBase, {
|
|
@@ -54,8 +54,8 @@ declare const BankHeading: _hanzogui_web.GuiComponent<_hanzogui_web.TamaDefer, _
|
|
|
54
54
|
}, _hanzogui_web.StaticConfigPublic>;
|
|
55
55
|
type BankHeadingProps = GetProps<typeof BankHeading>;
|
|
56
56
|
declare const BankText: _hanzogui_web.GuiComponent<_hanzogui_web.TamaDefer, _hanzogui_web.GuiTextElement, _hanzogui_core.RNTextNonStyleProps, _hanzogui_web.TextStylePropsBase, {
|
|
57
|
-
variant?: "default" | "label" | "link" | "error" | "success" | "muted" | undefined;
|
|
58
57
|
unstyled?: boolean | undefined;
|
|
58
|
+
variant?: "default" | "label" | "link" | "error" | "success" | "muted" | undefined;
|
|
59
59
|
}, _hanzogui_web.StaticConfigPublic>;
|
|
60
60
|
type BankTextProps = GetProps<typeof BankText>;
|
|
61
61
|
declare function BankField({ label, error, children, }: {
|
package/dist/checkbox.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
6
|
var clsx = require('clsx');
|
|
7
7
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -25,7 +25,6 @@ function _interopNamespace(e) {
|
|
|
25
25
|
return Object.freeze(n);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
var RadixCheckbox__namespace = /*#__PURE__*/_interopNamespace(RadixCheckbox);
|
|
29
28
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
30
29
|
|
|
31
30
|
// src/checkbox.tsx
|
|
@@ -214,8 +213,9 @@ var CheckboxBase = React__namespace.forwardRef(
|
|
|
214
213
|
...rest,
|
|
215
214
|
children: [
|
|
216
215
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
217
|
-
|
|
216
|
+
gui.Checkbox,
|
|
218
217
|
{
|
|
218
|
+
unstyled: true,
|
|
219
219
|
checked: checkedState,
|
|
220
220
|
onCheckedChange: handleCheckedChange,
|
|
221
221
|
disabled: disabled || readOnly,
|
|
@@ -233,7 +233,7 @@ var CheckboxBase = React__namespace.forwardRef(
|
|
|
233
233
|
"transition-colors duration-150",
|
|
234
234
|
sizeClasses.control
|
|
235
235
|
),
|
|
236
|
-
children: icon ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
236
|
+
children: icon ?? /* @__PURE__ */ jsxRuntime.jsx(gui.Checkbox.Indicator, { className: cn("flex items-center justify-center", sizeClasses.icon), children: checkedState === "indeterminate" ? /* @__PURE__ */ jsxRuntime.jsx(IndeterminateIcon, { className: sizeClasses.icon }) : /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { className: sizeClasses.icon }) })
|
|
237
237
|
}
|
|
238
238
|
),
|
|
239
239
|
/* @__PURE__ */ jsxRuntime.jsx(
|
package/dist/checkbox.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as RadixCheckbox from '@radix-ui/react-checkbox';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
|
|
3
|
+
/** Tri-state, as the Chakra/Radix contract consumers already code against. */
|
|
4
|
+
type CheckedState = boolean | 'indeterminate';
|
|
4
5
|
interface CheckboxGroupProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
5
6
|
value?: Array<string>;
|
|
6
7
|
defaultValue?: Array<string>;
|
|
@@ -17,7 +18,7 @@ interface CheckboxProps extends Omit<React.ComponentPropsWithoutRef<'label'>, 'o
|
|
|
17
18
|
rootRef?: React.Ref<HTMLLabelElement>;
|
|
18
19
|
checked?: boolean | 'indeterminate';
|
|
19
20
|
defaultChecked?: boolean;
|
|
20
|
-
onCheckedChange?: (checked:
|
|
21
|
+
onCheckedChange?: (checked: CheckedState) => void;
|
|
21
22
|
onChange?: React.FormEventHandler<HTMLLabelElement>;
|
|
22
23
|
disabled?: boolean;
|
|
23
24
|
readOnly?: boolean;
|
package/dist/checkbox.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as RadixCheckbox from '@radix-ui/react-checkbox';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
|
|
3
|
+
/** Tri-state, as the Chakra/Radix contract consumers already code against. */
|
|
4
|
+
type CheckedState = boolean | 'indeterminate';
|
|
4
5
|
interface CheckboxGroupProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
5
6
|
value?: Array<string>;
|
|
6
7
|
defaultValue?: Array<string>;
|
|
@@ -17,7 +18,7 @@ interface CheckboxProps extends Omit<React.ComponentPropsWithoutRef<'label'>, 'o
|
|
|
17
18
|
rootRef?: React.Ref<HTMLLabelElement>;
|
|
18
19
|
checked?: boolean | 'indeterminate';
|
|
19
20
|
defaultChecked?: boolean;
|
|
20
|
-
onCheckedChange?: (checked:
|
|
21
|
+
onCheckedChange?: (checked: CheckedState) => void;
|
|
21
22
|
onChange?: React.FormEventHandler<HTMLLabelElement>;
|
|
22
23
|
disabled?: boolean;
|
|
23
24
|
readOnly?: boolean;
|
package/dist/checkbox.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import { Checkbox } from '@hanzo/gui';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { clsx } from 'clsx';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -104,7 +104,7 @@ var IndeterminateIcon = ({ className }) => /* @__PURE__ */ jsx(
|
|
|
104
104
|
}
|
|
105
105
|
);
|
|
106
106
|
var CheckboxBase = React.forwardRef(
|
|
107
|
-
function Checkbox(props, ref) {
|
|
107
|
+
function Checkbox$1(props, ref) {
|
|
108
108
|
const {
|
|
109
109
|
icon,
|
|
110
110
|
children,
|
|
@@ -191,8 +191,9 @@ var CheckboxBase = React.forwardRef(
|
|
|
191
191
|
...rest,
|
|
192
192
|
children: [
|
|
193
193
|
/* @__PURE__ */ jsx(
|
|
194
|
-
|
|
194
|
+
Checkbox,
|
|
195
195
|
{
|
|
196
|
+
unstyled: true,
|
|
196
197
|
checked: checkedState,
|
|
197
198
|
onCheckedChange: handleCheckedChange,
|
|
198
199
|
disabled: disabled || readOnly,
|
|
@@ -210,7 +211,7 @@ var CheckboxBase = React.forwardRef(
|
|
|
210
211
|
"transition-colors duration-150",
|
|
211
212
|
sizeClasses.control
|
|
212
213
|
),
|
|
213
|
-
children: icon ?? /* @__PURE__ */ jsx(
|
|
214
|
+
children: icon ?? /* @__PURE__ */ jsx(Checkbox.Indicator, { className: cn("flex items-center justify-center", sizeClasses.icon), children: checkedState === "indeterminate" ? /* @__PURE__ */ jsx(IndeterminateIcon, { className: sizeClasses.icon }) : /* @__PURE__ */ jsx(CheckIcon, { className: sizeClasses.icon }) })
|
|
214
215
|
}
|
|
215
216
|
),
|
|
216
217
|
/* @__PURE__ */ jsx(
|