@luxfi/ui 8.2.7 → 8.2.9
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/3d-model-viewer.cjs +25 -421
- package/dist/3d-model-viewer.js +20 -416
- package/dist/accordion.cjs +3 -10
- package/dist/accordion.js +2 -10
- package/dist/advanced-navigation-bar.cjs +5 -401
- package/dist/advanced-navigation-bar.js +5 -401
- package/dist/ai-agents.cjs +45 -890
- package/dist/ai-agents.js +8 -834
- package/dist/ai-assistant.cjs +13 -740
- package/dist/ai-assistant.js +10 -738
- package/dist/ai-chat.cjs +24 -770
- package/dist/ai-chat.js +18 -765
- package/dist/ai-code.cjs +67 -923
- package/dist/ai-code.js +49 -905
- package/dist/ai-playground.cjs +25 -801
- package/dist/ai-playground.js +18 -795
- package/dist/ai-tools.cjs +22 -767
- package/dist/ai-tools.js +15 -761
- package/dist/ai-vision.cjs +41 -993
- package/dist/ai-vision.js +30 -983
- package/dist/ai-voice-settings.cjs +35 -1006
- package/dist/ai-voice-settings.js +32 -1004
- package/dist/ai-voice.cjs +51 -1024
- package/dist/ai-voice.js +9 -963
- package/dist/alert.cjs +11 -129
- package/dist/alert.js +8 -127
- package/dist/announcement.cjs +6 -402
- package/dist/announcement.js +6 -402
- package/dist/app-switcher-navigation-bar.cjs +5 -401
- package/dist/app-switcher-navigation-bar.js +5 -401
- package/dist/apple-cards-carousel.cjs +84 -480
- package/dist/apple-cards-carousel.js +19 -415
- package/dist/auth.cjs +10 -387
- package/dist/auth.js +7 -385
- package/dist/avatar.cjs +2 -9
- package/dist/avatar.js +2 -10
- package/dist/badge.cjs +8 -228
- package/dist/badge.js +5 -210
- package/dist/button.cjs +14 -67
- package/dist/button.js +12 -65
- package/dist/chrome.cjs +29 -493
- package/dist/chrome.js +9 -474
- package/dist/code-block.cjs +16 -664
- package/dist/code-block.js +13 -662
- package/dist/code-compare.cjs +28 -1302
- package/dist/code-compare.js +18 -1293
- package/dist/code-diff.cjs +21 -669
- package/dist/code-diff.js +17 -666
- package/dist/code-editor.cjs +13 -409
- package/dist/code-editor.js +12 -408
- package/dist/code-explorer.cjs +14 -456
- package/dist/code-explorer.js +13 -456
- package/dist/code-preview.cjs +31 -983
- package/dist/code-preview.js +23 -976
- package/dist/code-snippet.cjs +19 -667
- package/dist/code-snippet.js +14 -663
- package/dist/code-terminal.cjs +24 -485
- package/dist/code-terminal.js +19 -481
- package/dist/collapsible.cjs +13 -347
- package/dist/collapsible.js +11 -330
- package/dist/color-picker.cjs +8 -450
- package/dist/color-picker.js +7 -450
- package/dist/combobox.cjs +6 -402
- package/dist/combobox.js +6 -402
- package/dist/communication-navigation-bar.cjs +7 -403
- package/dist/communication-navigation-bar.js +5 -401
- package/dist/dashboard-navigation-bar.cjs +6 -402
- package/dist/dashboard-navigation-bar.js +5 -401
- package/dist/dialog-stack.cjs +5 -401
- package/dist/dialog-stack.js +5 -401
- package/dist/dialog.cjs +13 -70
- package/dist/dialog.js +13 -70
- package/dist/drawer.cjs +23 -99
- package/dist/drawer.js +19 -96
- package/dist/e-commerce-navigation-bar.cjs +7 -403
- package/dist/e-commerce-navigation-bar.js +5 -401
- package/dist/editor.cjs +9 -405
- package/dist/editor.js +6 -402
- package/dist/iam.cjs +2 -123
- package/dist/iam.js +1 -122
- package/dist/icon-button.cjs +2 -56
- package/dist/icon-button.js +1 -55
- package/dist/identity.cjs +28 -242
- package/dist/identity.js +20 -235
- package/dist/image-crop.cjs +10 -406
- package/dist/image-crop.js +7 -403
- package/dist/image.cjs +14 -83
- package/dist/image.js +13 -67
- package/dist/index.cjs +1868 -38770
- package/dist/index.js +174 -38320
- package/dist/input-group.cjs +3 -10
- package/dist/input-group.js +2 -10
- package/dist/item.cjs +2 -27
- package/dist/item.js +1 -22
- package/dist/kanban.cjs +25 -751
- package/dist/kanban.js +15 -742
- package/dist/limelight-nav.cjs +10 -452
- package/dist/limelight-nav.js +9 -452
- package/dist/link.cjs +11 -80
- package/dist/link.js +6 -60
- package/dist/lux.config.cjs +14 -32
- package/dist/lux.config.js +3 -26
- package/dist/menu.cjs +5 -13
- package/dist/menu.js +1 -9
- package/dist/message-dock.cjs +5 -401
- package/dist/message-dock.js +5 -401
- package/dist/mini-calendar.cjs +7 -403
- package/dist/mini-calendar.js +6 -402
- package/dist/music-player.cjs +30 -528
- package/dist/music-player.js +22 -520
- package/dist/next.cjs +8 -89
- package/dist/next.js +3 -86
- package/dist/popover.cjs +17 -74
- package/dist/popover.js +16 -73
- package/dist/progress-circle.cjs +3 -10
- package/dist/progress-circle.js +2 -10
- package/dist/provider.cjs +7 -176
- package/dist/provider.js +4 -174
- package/dist/select.cjs +36 -89
- package/dist/select.js +35 -88
- package/dist/sidebar.cjs +22 -493
- package/dist/sidebar.js +17 -489
- package/dist/site/commerce/ui/context.cjs +9 -214
- package/dist/site/commerce/ui/context.js +6 -215
- package/dist/site/components/analytics.cjs +2 -42
- package/dist/site/components/analytics.js +1 -37
- package/dist/site/components/auth/callback.cjs +2 -8
- package/dist/site/components/auth/callback.js +1 -7
- package/dist/site/components/auth/login-panel.cjs +15 -74
- package/dist/site/components/auth/login-panel.js +12 -73
- package/dist/site/components/auth/login.cjs +2 -6
- package/dist/site/components/auth/login.js +1 -5
- package/dist/site/components/auth/widget.cjs +2 -6
- package/dist/site/components/auth/widget.js +1 -5
- package/dist/site/components/commerce/bag-button.cjs +2 -3
- package/dist/site/components/commerce/bag-button.js +2 -3
- package/dist/site/components/commerce/buy-button.cjs +2 -11
- package/dist/site/components/commerce/buy-button.js +1 -10
- package/dist/site/components/commerce/checkout-button.cjs +2 -3
- package/dist/site/components/commerce/checkout-button.js +2 -3
- package/dist/site/components/commerce/checkout-panel/desktop-cp.cjs +15 -173
- package/dist/site/components/commerce/checkout-panel/desktop-cp.js +14 -174
- package/dist/site/components/commerce/checkout-panel/index.cjs +9 -400
- package/dist/site/components/commerce/checkout-panel/index.js +10 -403
- package/dist/site/components/commerce/checkout-panel/mobile-cp.cjs +15 -236
- package/dist/site/components/commerce/checkout-panel/mobile-cp.js +13 -237
- package/dist/site/components/commerce/desktop-bag-popup.cjs +7 -8
- package/dist/site/components/commerce/desktop-bag-popup.js +3 -8
- package/dist/site/components/commerce/drawer/index.cjs +15 -289
- package/dist/site/components/commerce/drawer/index.js +10 -290
- package/dist/site/components/commerce/drawer/micro.cjs +8 -115
- package/dist/site/components/commerce/drawer/micro.js +4 -115
- package/dist/site/components/commerce/drawer/shell.cjs +2 -10
- package/dist/site/components/commerce/drawer/shell.js +2 -10
- package/dist/site/components/contact-dialog/index.cjs +6 -69
- package/dist/site/components/contact-dialog/index.js +7 -71
- package/dist/site/components/drawer-margin.cjs +2 -10
- package/dist/site/components/drawer-margin.js +2 -10
- package/dist/site/components/footer.cjs +11 -81
- package/dist/site/components/footer.js +8 -80
- package/dist/site/components/header/desktop.cjs +18 -374
- package/dist/site/components/header/desktop.js +12 -355
- package/dist/site/components/header/index.cjs +9 -674
- package/dist/site/components/header/index.js +8 -657
- package/dist/site/components/header/mobile-bag-drawer.cjs +6 -71
- package/dist/site/components/header/mobile-bag-drawer.js +5 -74
- package/dist/site/components/header/mobile-nav-menu-ai.cjs +2 -31
- package/dist/site/components/header/mobile-nav-menu-ai.js +1 -26
- package/dist/site/components/header/mobile-nav-menu-item.cjs +6 -60
- package/dist/site/components/header/mobile-nav-menu-item.js +6 -61
- package/dist/site/components/header/mobile-nav-menu.cjs +7 -110
- package/dist/site/components/header/mobile-nav-menu.js +7 -112
- package/dist/site/components/header/mobile.cjs +25 -330
- package/dist/site/components/header/mobile.js +20 -330
- package/dist/site/components/icons/index.cjs +34 -35
- package/dist/site/components/icons/index.js +5 -33
- package/dist/site/components/index.cjs +118 -1961
- package/dist/site/components/index.js +23 -1951
- package/dist/site/components/mini-chart/index.cjs +7 -90
- package/dist/site/components/mini-chart/index.js +1 -92
- package/dist/site/components/mini-chart/wrapper.cjs +7 -76
- package/dist/site/components/mini-chart/wrapper.js +4 -77
- package/dist/site/components/not-found/index.cjs +9 -819
- package/dist/site/components/not-found/index.js +8 -802
- package/dist/site/components/security/index.cjs +9 -819
- package/dist/site/components/security/index.js +8 -802
- package/dist/site/next/analytics/index.cjs +16 -49
- package/dist/site/next/analytics/index.js +3 -49
- package/dist/site/next/analytics/pixel-analytics.cjs +23 -8
- package/dist/site/next/analytics/pixel-analytics.js +4 -8
- package/dist/site/next/index.cjs +13 -140
- package/dist/site/next/index.js +2 -140
- package/dist/site/root-layout/index.cjs +12 -1435
- package/dist/site/root-layout/index.css +0 -133
- package/dist/site/root-layout/index.js +12 -1416
- package/dist/site/site-def/footer/community.cjs +11 -27
- package/dist/site/site-def/footer/community.js +2 -18
- package/dist/site/site-def/footer/company.d.ts +3 -3
- package/dist/site/site-def/footer/index.cjs +38 -218
- package/dist/site/site-def/footer/index.js +14 -215
- package/dist/site/site-def/index.cjs +28 -620
- package/dist/site/site-def/index.js +3 -624
- package/dist/table.cjs +20 -338
- package/dist/table.js +19 -338
- package/dist/tabs.cjs +3 -10
- package/dist/tabs.js +1 -9
- package/dist/tag.cjs +9 -270
- package/dist/tag.js +6 -268
- package/dist/tags.cjs +6 -314
- package/dist/tags.js +5 -314
- package/dist/textarea.cjs +4 -50
- package/dist/textarea.js +3 -49
- package/dist/tooltip.cjs +15 -34
- package/dist/tooltip.js +13 -33
- package/dist/vite.cjs +3 -82
- package/dist/vite.js +1 -80
- package/package.json +1 -1
- package/dist/index.css +0 -132
- package/dist/site/components/auth/login-panel.css +0 -4
- package/dist/site/components/commerce/bag-button.css +0 -4
- package/dist/site/components/commerce/checkout-button.css +0 -4
- package/dist/site/components/commerce/checkout-panel/desktop-cp.css +0 -132
- package/dist/site/components/commerce/checkout-panel/index.css +0 -132
- package/dist/site/components/commerce/checkout-panel/mobile-cp.css +0 -132
- package/dist/site/components/commerce/desktop-bag-popup.css +0 -4
- package/dist/site/components/commerce/drawer/index.css +0 -132
- package/dist/site/components/commerce/drawer/micro.css +0 -4
- package/dist/site/components/header/desktop.css +0 -4
- package/dist/site/components/header/index.css +0 -132
- package/dist/site/components/header/mobile-bag-drawer.css +0 -4
- package/dist/site/components/header/mobile-nav-menu-ai.css +0 -132
- package/dist/site/components/header/mobile-nav-menu-item.css +0 -132
- package/dist/site/components/header/mobile-nav-menu.css +0 -132
- package/dist/site/components/header/mobile.css +0 -132
- package/dist/site/components/icons/index.css +0 -4
- package/dist/site/components/index.css +0 -132
- package/dist/site/components/not-found/index.css +0 -132
- package/dist/site/components/security/index.css +0 -132
- package/dist/site/site-def/footer/community.css +0 -4
- package/dist/site/site-def/footer/index.css +0 -4
- package/dist/site/site-def/index.css +0 -4
package/dist/table.js
CHANGED
|
@@ -1,330 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { throttle } from 'es-toolkit';
|
|
3
|
-
import { Box,
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
3
|
+
import { Box, cn, css, sx } from '@hanzo/ui';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { Link } from './link.js';
|
|
6
6
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
var Skeleton = React3.forwardRef(
|
|
10
|
-
function Skeleton2(props, ref) {
|
|
11
|
-
const { loading = true, asChild, className, children, style, ...rest } = props;
|
|
12
|
-
if (!loading) {
|
|
13
|
-
if (asChild && React3.isValidElement(children)) return children;
|
|
14
|
-
return /* @__PURE__ */ jsx(Box, { ref, className, style, ...rest, children });
|
|
15
|
-
}
|
|
16
|
-
return /* @__PURE__ */ jsx(
|
|
17
|
-
"div",
|
|
18
|
-
{
|
|
19
|
-
ref,
|
|
20
|
-
"data-loading": true,
|
|
21
|
-
...sx(
|
|
22
|
-
SKELETON_CLASSES,
|
|
23
|
-
asChild || children ? "[&_*]:invisible" : "min-h-5",
|
|
24
|
-
className
|
|
25
|
-
),
|
|
26
|
-
style,
|
|
27
|
-
...rest,
|
|
28
|
-
children
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
React3.forwardRef(
|
|
34
|
-
function SkeletonCircle2(props, ref) {
|
|
35
|
-
const { size = 40, loading = true, className, ...rest } = props;
|
|
36
|
-
const dimension = typeof size === "number" ? `${size}px` : size;
|
|
37
|
-
return /* @__PURE__ */ jsx(
|
|
38
|
-
Skeleton,
|
|
39
|
-
{
|
|
40
|
-
ref,
|
|
41
|
-
loading,
|
|
42
|
-
...sx("rounded-full shrink-0", className),
|
|
43
|
-
style: { width: dimension, height: dimension, ...rest.style },
|
|
44
|
-
...rest
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
React3.forwardRef(
|
|
50
|
-
function SkeletonText2(props, ref) {
|
|
51
|
-
const { noOfLines = 3, loading = true, className, ...rest } = props;
|
|
52
|
-
return /* @__PURE__ */ jsx(Box, { ref, className: cn("flex w-full flex-col gap-2", className), ...rest, children: Array.from({ length: noOfLines }).map((_, index) => /* @__PURE__ */ jsx(
|
|
53
|
-
Skeleton,
|
|
54
|
-
{
|
|
55
|
-
loading,
|
|
56
|
-
...sx(cn("h-4", index === noOfLines - 1 && "max-w-[80%]"))
|
|
57
|
-
},
|
|
58
|
-
index
|
|
59
|
-
)) });
|
|
60
|
-
}
|
|
61
|
-
);
|
|
62
|
-
var ArrowIcon = ({ className, style }) => /* @__PURE__ */ jsx("svg", { className, style, viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M11 3h6v6M17 3L7 13M14 11v6H3V6h6", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
63
|
-
function stripUtmParams(url) {
|
|
64
|
-
try {
|
|
65
|
-
const urlObj = new URL(url);
|
|
66
|
-
for (const param of ["utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"]) {
|
|
67
|
-
urlObj.searchParams.delete(param);
|
|
68
|
-
}
|
|
69
|
-
return urlObj.toString();
|
|
70
|
-
} catch {
|
|
71
|
-
return url;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
var VARIANT_CLASSES = {
|
|
75
|
-
primary: cn(
|
|
76
|
-
"text-[var(--color-link-primary)]",
|
|
77
|
-
"hover:no-underline hover:text-[var(--color-link-primary-hover)]",
|
|
78
|
-
"data-[hover]:no-underline data-[hover]:text-[var(--color-link-primary-hover)]"
|
|
79
|
-
),
|
|
80
|
-
secondary: cn(
|
|
81
|
-
"text-[var(--color-link-secondary)]",
|
|
82
|
-
"hover:no-underline hover:text-[var(--color-hover)]",
|
|
83
|
-
"data-[hover]:no-underline data-[hover]:text-[var(--color-hover)]"
|
|
84
|
-
),
|
|
85
|
-
subtle: cn(
|
|
86
|
-
"text-[var(--color-link-subtle)]",
|
|
87
|
-
"hover:text-[var(--color-link-subtle-hover)] hover:underline hover:decoration-[var(--color-link-subtle-hover)]",
|
|
88
|
-
"data-[hover]:text-[var(--color-link-subtle-hover)] data-[hover]:underline data-[hover]:decoration-[var(--color-link-subtle-hover)]"
|
|
89
|
-
),
|
|
90
|
-
underlaid: cn(
|
|
91
|
-
"text-[var(--color-link-primary)] bg-[var(--color-link-underlaid-bg)]",
|
|
92
|
-
"px-2 py-1.5 rounded-md text-sm",
|
|
93
|
-
"hover:text-[var(--color-link-primary-hover)] hover:no-underline",
|
|
94
|
-
"data-[hover]:text-[var(--color-link-primary-hover)] data-[hover]:no-underline"
|
|
95
|
-
),
|
|
96
|
-
menu: cn(
|
|
97
|
-
"text-[var(--color-link-menu)]",
|
|
98
|
-
"hover:text-[var(--color-hover)] hover:no-underline",
|
|
99
|
-
"data-[hover]:text-[var(--color-hover)] data-[hover]:no-underline"
|
|
100
|
-
),
|
|
101
|
-
navigation: cn(
|
|
102
|
-
"text-[var(--color-link-nav-fg)] bg-transparent",
|
|
103
|
-
"hover:text-[var(--color-link-nav-fg-hover)] hover:no-underline",
|
|
104
|
-
"data-[hover]:text-[var(--color-link-nav-fg-hover)] data-[hover]:no-underline",
|
|
105
|
-
"data-[selected]:text-[var(--color-link-nav-fg-selected)] data-[selected]:bg-[var(--color-link-nav-bg-selected)]",
|
|
106
|
-
"data-[active]:text-[var(--color-link-nav-fg-active)]"
|
|
107
|
-
),
|
|
108
|
-
plain: cn(
|
|
109
|
-
"text-inherit",
|
|
110
|
-
"hover:no-underline",
|
|
111
|
-
"data-[hover]:no-underline"
|
|
112
|
-
)
|
|
113
|
-
};
|
|
114
|
-
var BASE_CLASSES = "inline-flex items-center gap-0 cursor-pointer data-[disabled]:cursor-not-allowed";
|
|
115
|
-
var LinkExternalIcon = ({ color }) => /* @__PURE__ */ jsx(
|
|
116
|
-
ArrowIcon,
|
|
117
|
-
{
|
|
118
|
-
...sx(
|
|
119
|
-
"size-3 align-middle shrink-0",
|
|
120
|
-
"group-hover:text-inherit"
|
|
121
|
-
),
|
|
122
|
-
style: color ? { color } : { color: "var(--color-icon-secondary)" },
|
|
123
|
-
"aria-hidden": "true"
|
|
124
|
-
}
|
|
125
|
-
);
|
|
126
|
-
var SPACING = 4;
|
|
127
|
-
function resolveSpacing(v) {
|
|
128
|
-
if (v === void 0) return void 0;
|
|
129
|
-
if (typeof v === "number") return `${v * SPACING}px`;
|
|
130
|
-
if (typeof v === "string") return v;
|
|
131
|
-
if (typeof v === "object" && v !== null) {
|
|
132
|
-
const base = v.base;
|
|
133
|
-
if (base !== void 0) return typeof base === "number" ? `${base * SPACING}px` : base;
|
|
134
|
-
const lg = v.lg;
|
|
135
|
-
if (lg !== void 0) return typeof lg === "number" ? `${lg * SPACING}px` : lg;
|
|
136
|
-
}
|
|
137
|
-
return void 0;
|
|
138
|
-
}
|
|
139
|
-
var Link = React3__default.forwardRef(
|
|
140
|
-
function Link2(props, ref) {
|
|
141
|
-
const {
|
|
142
|
-
external,
|
|
143
|
-
loading,
|
|
144
|
-
href,
|
|
145
|
-
children,
|
|
146
|
-
disabled,
|
|
147
|
-
noIcon,
|
|
148
|
-
iconColor,
|
|
149
|
-
variant = "primary",
|
|
150
|
-
className,
|
|
151
|
-
asChild: _asChild,
|
|
152
|
-
// Strip Next.js-specific props (accepted for compat, not used)
|
|
153
|
-
shallow: _shallow,
|
|
154
|
-
prefetch: _prefetch,
|
|
155
|
-
scroll: _scroll,
|
|
156
|
-
// Strip Chakra style props
|
|
157
|
-
fontWeight: _fontWeight,
|
|
158
|
-
whiteSpace: _whiteSpace,
|
|
159
|
-
wordBreak: _wordBreak,
|
|
160
|
-
textStyle: _textStyle,
|
|
161
|
-
ml: _ml,
|
|
162
|
-
mr: _mr,
|
|
163
|
-
display: _display,
|
|
164
|
-
alignItems: _alignItems,
|
|
165
|
-
flexShrink: _flexShrink,
|
|
166
|
-
minW: _minW,
|
|
167
|
-
justifyContent: _justifyContent,
|
|
168
|
-
position: _position,
|
|
169
|
-
...rest
|
|
170
|
-
} = props;
|
|
171
|
-
const shimStyle = {};
|
|
172
|
-
if (_fontWeight !== void 0) shimStyle.fontWeight = _fontWeight;
|
|
173
|
-
if (_whiteSpace) shimStyle.whiteSpace = _whiteSpace;
|
|
174
|
-
if (_wordBreak) shimStyle.wordBreak = _wordBreak;
|
|
175
|
-
if (_ml !== void 0) shimStyle.marginLeft = resolveSpacing(_ml);
|
|
176
|
-
if (_mr !== void 0) shimStyle.marginRight = resolveSpacing(_mr);
|
|
177
|
-
if (_display) shimStyle.display = _display;
|
|
178
|
-
if (_alignItems) shimStyle.alignItems = _alignItems;
|
|
179
|
-
if (_flexShrink !== void 0) shimStyle.flexShrink = _flexShrink;
|
|
180
|
-
if (_minW !== void 0) shimStyle.minWidth = typeof _minW === "number" ? `${_minW * SPACING}px` : _minW;
|
|
181
|
-
if (_justifyContent) shimStyle.justifyContent = _justifyContent;
|
|
182
|
-
if (_position) shimStyle.position = _position;
|
|
183
|
-
const linkClasses = cn(BASE_CLASSES, VARIANT_CLASSES[variant], className);
|
|
184
|
-
const linkStyle = Object.keys(shimStyle).length > 0 ? shimStyle : void 0;
|
|
185
|
-
if (external) {
|
|
186
|
-
const processedHref = typeof href === "string" ? stripUtmParams(href) : href;
|
|
187
|
-
return /* @__PURE__ */ jsx(Skeleton, { loading, ref, asChild: true, children: /* @__PURE__ */ jsxs(
|
|
188
|
-
Box,
|
|
189
|
-
{
|
|
190
|
-
tag: "a",
|
|
191
|
-
href: processedHref,
|
|
192
|
-
className: cn("group", linkClasses),
|
|
193
|
-
style: linkStyle,
|
|
194
|
-
target: "_blank",
|
|
195
|
-
rel: "noopener noreferrer",
|
|
196
|
-
...disabled ? { "data-disabled": true } : {},
|
|
197
|
-
...rest,
|
|
198
|
-
children: [
|
|
199
|
-
children,
|
|
200
|
-
!noIcon && /* @__PURE__ */ jsx(LinkExternalIcon, { color: iconColor })
|
|
201
|
-
]
|
|
202
|
-
}
|
|
203
|
-
) });
|
|
204
|
-
}
|
|
205
|
-
if (href) {
|
|
206
|
-
return /* @__PURE__ */ jsx(Skeleton, { loading, ref, asChild: true, children: /* @__PURE__ */ jsx(
|
|
207
|
-
Box,
|
|
208
|
-
{
|
|
209
|
-
tag: "a",
|
|
210
|
-
href,
|
|
211
|
-
className: linkClasses,
|
|
212
|
-
style: linkStyle,
|
|
213
|
-
...disabled ? { "data-disabled": true } : {},
|
|
214
|
-
...rest,
|
|
215
|
-
children
|
|
216
|
-
}
|
|
217
|
-
) });
|
|
218
|
-
}
|
|
219
|
-
return /* @__PURE__ */ jsx(Skeleton, { loading, ref, asChild: true, children: /* @__PURE__ */ jsx(
|
|
220
|
-
Box,
|
|
221
|
-
{
|
|
222
|
-
tag: "span",
|
|
223
|
-
className: linkClasses,
|
|
224
|
-
...disabled ? { "data-disabled": true } : {},
|
|
225
|
-
...rest,
|
|
226
|
-
children
|
|
227
|
-
}
|
|
228
|
-
) });
|
|
229
|
-
}
|
|
230
|
-
);
|
|
231
|
-
React3__default.forwardRef(
|
|
232
|
-
function LinkBox2(props, ref) {
|
|
233
|
-
const { className, ...rest } = props;
|
|
234
|
-
return /* @__PURE__ */ jsx(
|
|
235
|
-
Box,
|
|
236
|
-
{
|
|
237
|
-
ref,
|
|
238
|
-
className: cn("relative", className),
|
|
239
|
-
...rest
|
|
240
|
-
}
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
);
|
|
244
|
-
React3__default.forwardRef(
|
|
245
|
-
function LinkOverlay2(props, ref) {
|
|
246
|
-
const {
|
|
247
|
-
children,
|
|
248
|
-
external,
|
|
249
|
-
loading,
|
|
250
|
-
href,
|
|
251
|
-
noIcon,
|
|
252
|
-
iconColor,
|
|
253
|
-
variant = "primary",
|
|
254
|
-
className,
|
|
255
|
-
disabled,
|
|
256
|
-
asChild: _asChild2,
|
|
257
|
-
shallow: _shallow2,
|
|
258
|
-
prefetch: _prefetch2,
|
|
259
|
-
scroll: _scroll2,
|
|
260
|
-
fontWeight: _fw2,
|
|
261
|
-
whiteSpace: _ws2,
|
|
262
|
-
wordBreak: _wb2,
|
|
263
|
-
textStyle: _ts2,
|
|
264
|
-
ml: _ml2,
|
|
265
|
-
mr: _mr2,
|
|
266
|
-
display: _d2,
|
|
267
|
-
alignItems: _ai2,
|
|
268
|
-
flexShrink: _fs2,
|
|
269
|
-
minW: _mw2,
|
|
270
|
-
justifyContent: _jc2,
|
|
271
|
-
position: _p2,
|
|
272
|
-
...rest
|
|
273
|
-
} = props;
|
|
274
|
-
const overlayClasses = cn(
|
|
275
|
-
BASE_CLASSES,
|
|
276
|
-
VARIANT_CLASSES[variant],
|
|
277
|
-
// Static positioning with a ::before pseudo-element that covers the LinkBox
|
|
278
|
-
"static",
|
|
279
|
-
'before:absolute before:inset-0 before:z-0 before:content-[""]',
|
|
280
|
-
className
|
|
281
|
-
);
|
|
282
|
-
if (external) {
|
|
283
|
-
const processedHref = typeof href === "string" ? stripUtmParams(href) : href;
|
|
284
|
-
return /* @__PURE__ */ jsx(
|
|
285
|
-
Box,
|
|
286
|
-
{
|
|
287
|
-
tag: "a",
|
|
288
|
-
ref,
|
|
289
|
-
href: loading ? void 0 : processedHref,
|
|
290
|
-
className: overlayClasses,
|
|
291
|
-
target: "_blank",
|
|
292
|
-
rel: "noopener noreferrer",
|
|
293
|
-
...rest,
|
|
294
|
-
children: (children || !noIcon && href) && /* @__PURE__ */ jsxs(Skeleton, { ...sx("inline-flex items-center max-w-full h-full"), loading, children: [
|
|
295
|
-
children,
|
|
296
|
-
!noIcon && href && /* @__PURE__ */ jsx(LinkExternalIcon, { color: iconColor })
|
|
297
|
-
] })
|
|
298
|
-
}
|
|
299
|
-
);
|
|
300
|
-
}
|
|
301
|
-
const content = children ? /* @__PURE__ */ jsx(Skeleton, { ...sx("inline-flex items-center max-w-full h-full"), loading, children }) : null;
|
|
302
|
-
if (href) {
|
|
303
|
-
return /* @__PURE__ */ jsx(
|
|
304
|
-
Box,
|
|
305
|
-
{
|
|
306
|
-
tag: "a",
|
|
307
|
-
ref,
|
|
308
|
-
href,
|
|
309
|
-
className: overlayClasses,
|
|
310
|
-
...rest,
|
|
311
|
-
children: content
|
|
312
|
-
}
|
|
313
|
-
);
|
|
314
|
-
}
|
|
315
|
-
return /* @__PURE__ */ jsx(
|
|
316
|
-
Box,
|
|
317
|
-
{
|
|
318
|
-
tag: "span",
|
|
319
|
-
ref,
|
|
320
|
-
className: overlayClasses,
|
|
321
|
-
...rest,
|
|
322
|
-
children: content
|
|
323
|
-
}
|
|
324
|
-
);
|
|
325
|
-
}
|
|
326
|
-
);
|
|
327
|
-
var ArrowIcon2 = (props) => /* @__PURE__ */ jsx("svg", { ...props, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M5 12h14M12 5l7 7-7 7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
8
|
+
var ArrowIcon = (props) => /* @__PURE__ */ jsx("svg", { ...props, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { d: "M5 12h14M12 5l7 7-7 7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
328
9
|
var SPACING_SCALE = 4;
|
|
329
10
|
function toPixels(value) {
|
|
330
11
|
if (value === void 0) return void 0;
|
|
@@ -503,7 +184,7 @@ function resolveResponsive(value) {
|
|
|
503
184
|
}
|
|
504
185
|
return void 0;
|
|
505
186
|
}
|
|
506
|
-
var TableRoot =
|
|
187
|
+
var TableRoot = React.forwardRef(
|
|
507
188
|
function TableRoot2(props, ref) {
|
|
508
189
|
const { className, style: styleProp, children, ...other } = props;
|
|
509
190
|
const rawMinW = other.minWidth ?? other.minW;
|
|
@@ -527,7 +208,7 @@ var TableRoot = React3.forwardRef(
|
|
|
527
208
|
);
|
|
528
209
|
}
|
|
529
210
|
);
|
|
530
|
-
var TableHeader =
|
|
211
|
+
var TableHeader = React.forwardRef(
|
|
531
212
|
function TableHeader2(props, ref) {
|
|
532
213
|
const { className, style: styleProp, children, ...other } = props;
|
|
533
214
|
const { style: extracted, rest } = extractStyles(other);
|
|
@@ -545,7 +226,7 @@ var TableHeader = React3.forwardRef(
|
|
|
545
226
|
);
|
|
546
227
|
}
|
|
547
228
|
);
|
|
548
|
-
var TableBody =
|
|
229
|
+
var TableBody = React.forwardRef(
|
|
549
230
|
function TableBody2(props, ref) {
|
|
550
231
|
const { className, style: styleProp, children, ...other } = props;
|
|
551
232
|
const { style: extracted, rest } = extractStyles(other);
|
|
@@ -563,7 +244,7 @@ var TableBody = React3.forwardRef(
|
|
|
563
244
|
);
|
|
564
245
|
}
|
|
565
246
|
);
|
|
566
|
-
var TableRow =
|
|
247
|
+
var TableRow = React.forwardRef(
|
|
567
248
|
function TableRow2(props, ref) {
|
|
568
249
|
const { className, style: styleProp, children, ...other } = props;
|
|
569
250
|
const { style: extracted, rest } = extractStyles(other);
|
|
@@ -581,7 +262,7 @@ var TableRow = React3.forwardRef(
|
|
|
581
262
|
);
|
|
582
263
|
}
|
|
583
264
|
);
|
|
584
|
-
var TableCell =
|
|
265
|
+
var TableCell = React.forwardRef(
|
|
585
266
|
function TableCell2(props, ref) {
|
|
586
267
|
const { isNumeric, className, style: styleProp, children, ...other } = props;
|
|
587
268
|
const { style: extracted, rest } = extractStyles(other);
|
|
@@ -603,7 +284,7 @@ var TableCell = React3.forwardRef(
|
|
|
603
284
|
);
|
|
604
285
|
}
|
|
605
286
|
);
|
|
606
|
-
var TableColumnHeader =
|
|
287
|
+
var TableColumnHeader = React.forwardRef(
|
|
607
288
|
function TableColumnHeader2(props, ref) {
|
|
608
289
|
const { isNumeric, className, style: styleProp, children, ...other } = props;
|
|
609
290
|
const { style: extracted, rest } = extractStyles(other);
|
|
@@ -631,7 +312,7 @@ var TableColumnHeader = React3.forwardRef(
|
|
|
631
312
|
);
|
|
632
313
|
var TableColumnHeaderSortable = (props) => {
|
|
633
314
|
const { sortField, sortValue, onSortToggle, children, disabled, indicatorPosition = "left", contentAfter, ...rest } = props;
|
|
634
|
-
const handleSortToggle =
|
|
315
|
+
const handleSortToggle = React.useCallback(() => {
|
|
635
316
|
onSortToggle(sortField);
|
|
636
317
|
}, [onSortToggle, sortField]);
|
|
637
318
|
const isActive = sortValue.includes(sortField);
|
|
@@ -647,7 +328,7 @@ var TableColumnHeaderSortable = (props) => {
|
|
|
647
328
|
indicatorPosition === "left" ? "-left-5" : "-right-5",
|
|
648
329
|
isAsc ? "-rotate-90" : "rotate-90"
|
|
649
330
|
),
|
|
650
|
-
children: /* @__PURE__ */ jsx(
|
|
331
|
+
children: /* @__PURE__ */ jsx(ArrowIcon, { style: css("h-4 w-4") })
|
|
651
332
|
}
|
|
652
333
|
),
|
|
653
334
|
children
|
|
@@ -658,16 +339,16 @@ var TableColumnHeaderSortable = (props) => {
|
|
|
658
339
|
var ACTION_BAR_SHADOW = "0 4px 4px -4px rgb(0 0 0 / 10%), 0 2px 4px -4px rgb(0 0 0 / 6%)";
|
|
659
340
|
var TableHeaderSticky = (props) => {
|
|
660
341
|
const { top, children, className, style: styleProp, ...rest } = props;
|
|
661
|
-
const ref =
|
|
662
|
-
const [isStuck, setIsStuck] =
|
|
663
|
-
const handleScroll =
|
|
342
|
+
const ref = React.useRef(null);
|
|
343
|
+
const [isStuck, setIsStuck] = React.useState(false);
|
|
344
|
+
const handleScroll = React.useCallback(() => {
|
|
664
345
|
if (Number(ref.current?.getBoundingClientRect().y) <= (Number(top) || 0)) {
|
|
665
346
|
setIsStuck(true);
|
|
666
347
|
} else {
|
|
667
348
|
setIsStuck(false);
|
|
668
349
|
}
|
|
669
350
|
}, [top]);
|
|
670
|
-
|
|
351
|
+
React.useEffect(() => {
|
|
671
352
|
const throttledHandleScroll = throttle(handleScroll, 300);
|
|
672
353
|
window.addEventListener("scroll", throttledHandleScroll);
|
|
673
354
|
return () => {
|
|
@@ -689,7 +370,7 @@ var TableHeaderSticky = (props) => {
|
|
|
689
370
|
}
|
|
690
371
|
);
|
|
691
372
|
};
|
|
692
|
-
var TableCaption =
|
|
373
|
+
var TableCaption = React.forwardRef(
|
|
693
374
|
function TableCaption2(props, ref) {
|
|
694
375
|
const { className, style: styleProp, children, ...other } = props;
|
|
695
376
|
const { style: extracted, rest } = extractStyles(other);
|
|
@@ -707,7 +388,7 @@ var TableCaption = React3.forwardRef(
|
|
|
707
388
|
);
|
|
708
389
|
}
|
|
709
390
|
);
|
|
710
|
-
var TableFooter =
|
|
391
|
+
var TableFooter = React.forwardRef(
|
|
711
392
|
function TableFooter2(props, ref) {
|
|
712
393
|
const { className, style: styleProp, children, ...other } = props;
|
|
713
394
|
const { style: extracted, rest } = extractStyles(other);
|
|
@@ -725,7 +406,7 @@ var TableFooter = React3.forwardRef(
|
|
|
725
406
|
);
|
|
726
407
|
}
|
|
727
408
|
);
|
|
728
|
-
var TableScrollWrapper =
|
|
409
|
+
var TableScrollWrapper = React.forwardRef(
|
|
729
410
|
function TableScrollWrapper2(props, ref) {
|
|
730
411
|
const { className, children, ...rest } = props;
|
|
731
412
|
return /* @__PURE__ */ jsx(
|
package/dist/tabs.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
var gui = require('@hanzo/gui');
|
|
5
5
|
var React = require('react');
|
|
6
|
+
var ink_cjs = require('./ink.cjs');
|
|
6
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
8
|
|
|
8
9
|
function _interopNamespace(e) {
|
|
@@ -25,14 +26,6 @@ function _interopNamespace(e) {
|
|
|
25
26
|
|
|
26
27
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
28
|
|
|
28
|
-
var ink = (children, Wrap = gui.Text, props = {}) => {
|
|
29
|
-
let hasText = false;
|
|
30
|
-
React.Children.forEach(children, (child) => {
|
|
31
|
-
if (typeof child === "string" || typeof child === "number") hasText = true;
|
|
32
|
-
});
|
|
33
|
-
if (!hasText) return children;
|
|
34
|
-
return React.Children.map(children, (child) => typeof child === "string" || typeof child === "number" ? React.createElement(Wrap, props, child) : child);
|
|
35
|
-
};
|
|
36
29
|
var Shape = React__namespace.createContext({
|
|
37
30
|
variant: "solid",
|
|
38
31
|
size: "md",
|
|
@@ -132,11 +125,11 @@ var TabsTrigger = ({ children, ...props }) => {
|
|
|
132
125
|
...selected ? active : null,
|
|
133
126
|
...fitted ? { flex: 1 } : null,
|
|
134
127
|
...props,
|
|
135
|
-
children: ink(children, void 0, { fontSize: "inherit", color: "inherit", fontWeight: "inherit" })
|
|
128
|
+
children: ink_cjs.ink(children, void 0, { fontSize: "inherit", color: "inherit", fontWeight: "inherit" })
|
|
136
129
|
}
|
|
137
130
|
);
|
|
138
131
|
};
|
|
139
|
-
var TabsContent = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(gui.Tabs.Content, { unstyled: true, width: "100%", paddingTop: 24, backgroundColor: "transparent", ...props, children: ink(children) });
|
|
132
|
+
var TabsContent = ({ children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(gui.Tabs.Content, { unstyled: true, width: "100%", paddingTop: 24, backgroundColor: "transparent", ...props, children: ink_cjs.ink(children) });
|
|
140
133
|
var COUNTER_OVERLOAD = 50;
|
|
141
134
|
var TabsCounter = ({ count }) => {
|
|
142
135
|
if (count === void 0 || count === null) return null;
|
package/dist/tabs.js
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { Tabs, useTabsContext, Text } from '@hanzo/gui';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { ink } from './ink.js';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
|
-
var ink = (children, Wrap = Text, props = {}) => {
|
|
8
|
-
let hasText = false;
|
|
9
|
-
Children.forEach(children, (child) => {
|
|
10
|
-
if (typeof child === "string" || typeof child === "number") hasText = true;
|
|
11
|
-
});
|
|
12
|
-
if (!hasText) return children;
|
|
13
|
-
return Children.map(children, (child) => typeof child === "string" || typeof child === "number" ? createElement(Wrap, props, child) : child);
|
|
14
|
-
};
|
|
15
7
|
var Shape = React.createContext({
|
|
16
8
|
variant: "solid",
|
|
17
9
|
size: "md",
|