@nexub/react 1.0.0 → 1.1.0
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/chunk-24CZFBTG.js +83 -0
- package/dist/chunk-2MKB5FQI.js +122 -0
- package/dist/chunk-2RLSIOGB.js +173 -0
- package/dist/chunk-2VDP2ML4.js +105 -0
- package/dist/chunk-3CSKW56L.js +44 -0
- package/dist/chunk-3U54QLYB.js +87 -0
- package/dist/chunk-46CFSBEO.js +48 -0
- package/dist/chunk-4BTP4464.js +92 -0
- package/dist/chunk-4NGB7XIM.js +88 -0
- package/dist/chunk-4OCXGNP3.js +85 -0
- package/dist/chunk-52KTX5A7.js +119 -0
- package/dist/chunk-6AZP6VBM.js +62 -0
- package/dist/chunk-6Y734SXN.js +51 -0
- package/dist/chunk-7B4FS7VQ.js +150 -0
- package/dist/chunk-7W2YDJ5W.js +128 -0
- package/dist/chunk-A7L75YXY.js +61 -0
- package/dist/chunk-ADO2DB6Q.js +1 -0
- package/dist/chunk-AHZQQ7OT.js +83 -0
- package/dist/chunk-AT6RPKU3.js +12 -0
- package/dist/chunk-BBVOB4EC.js +36 -0
- package/dist/chunk-BGY23Y5O.js +104 -0
- package/dist/chunk-BJKW3G2L.js +99 -0
- package/dist/chunk-BMVAZIAJ.js +187 -0
- package/dist/chunk-BTZW34TX.js +76 -0
- package/dist/chunk-BUBYXAJK.js +20 -0
- package/dist/chunk-BV3U3ATL.js +1 -0
- package/dist/chunk-BYCTJHXY.js +75 -0
- package/dist/chunk-BYF223HT.js +92 -0
- package/dist/chunk-CPV367VS.js +106 -0
- package/dist/chunk-CVBAWKNG.js +124 -0
- package/dist/chunk-CZUNTABW.js +25 -0
- package/dist/chunk-DAXDAFNG.js +92 -0
- package/dist/chunk-DD6XCW6R.js +53 -0
- package/dist/chunk-DEH2Z27F.js +50 -0
- package/dist/chunk-DOHXBNOP.js +119 -0
- package/dist/chunk-DR2Y3PIT.js +91 -0
- package/dist/chunk-ELC2NBGH.js +89 -0
- package/dist/chunk-EV43I5J6.js +1 -0
- package/dist/chunk-FS4XKWFA.js +308 -0
- package/dist/chunk-FUJOSPNQ.js +38 -0
- package/dist/chunk-GTQIA62H.js +60 -0
- package/dist/chunk-H4MXRAXP.js +37 -0
- package/dist/chunk-HW3I7I3R.js +29 -0
- package/dist/chunk-HY3JWSG4.js +1 -0
- package/dist/chunk-I5Z3A7N3.js +40 -0
- package/dist/chunk-IBCYG6HR.js +55 -0
- package/dist/chunk-IHW2L532.js +175 -0
- package/dist/chunk-IU76LV3W.js +101 -0
- package/dist/chunk-IZ6ZPEZ2.js +1 -0
- package/dist/chunk-JCUVWDUC.js +57 -0
- package/dist/chunk-JKTZMWWC.js +63 -0
- package/dist/chunk-JQDLCN5D.js +66 -0
- package/dist/chunk-K7CUCLLI.js +43 -0
- package/dist/chunk-KBB7M6WO.js +65 -0
- package/dist/chunk-KLTQJZOX.js +1 -0
- package/dist/chunk-KWWV3CM3.js +62 -0
- package/dist/chunk-KZW37FQZ.js +40 -0
- package/dist/chunk-L6GBZ2HB.js +145 -0
- package/dist/chunk-LAWZQ6R6.js +76 -0
- package/dist/chunk-LOP63AVE.js +49 -0
- package/dist/chunk-MY6XUJ5P.js +216 -0
- package/dist/chunk-N2GIMMTF.js +98 -0
- package/dist/chunk-NAIZ7R2L.js +59 -0
- package/dist/chunk-NHUQLIHL.js +9 -0
- package/dist/chunk-NZ7UK3G6.js +1 -0
- package/dist/chunk-OUBBOOZE.js +34 -0
- package/dist/chunk-OZPPL76D.js +82 -0
- package/dist/chunk-P6BZNFVU.js +38 -0
- package/dist/chunk-PANDAMD2.js +54 -0
- package/dist/chunk-PBLEGOLM.js +71 -0
- package/dist/chunk-PER3O4FD.js +33 -0
- package/dist/chunk-PICMOOAZ.js +1 -0
- package/dist/chunk-POBSY7EZ.js +155 -0
- package/dist/chunk-POFKKYHY.js +37 -0
- package/dist/chunk-QF7GUDOE.js +67 -0
- package/dist/chunk-QHJ43Q2T.js +70 -0
- package/dist/chunk-QURKXXNS.js +46 -0
- package/dist/chunk-ROZVVWPV.js +8 -0
- package/dist/chunk-S344IRK4.js +63 -0
- package/dist/chunk-SZKUSLHI.js +176 -0
- package/dist/chunk-T4IVMVMQ.js +32 -0
- package/dist/chunk-TCTFQYLH.js +115 -0
- package/dist/chunk-U3AEA4BZ.js +56 -0
- package/dist/chunk-U3EGB3JL.js +43 -0
- package/dist/chunk-UALYS4XI.js +67 -0
- package/dist/chunk-UTBUIBEP.js +153 -0
- package/dist/chunk-UWWL5FPC.js +80 -0
- package/dist/chunk-V3FZHIEB.js +52 -0
- package/dist/chunk-V6GZZFTV.js +106 -0
- package/dist/chunk-VPZCQFVY.js +33 -0
- package/dist/chunk-VT7RKY46.js +49 -0
- package/dist/chunk-W4IEXUD4.js +127 -0
- package/dist/chunk-WPPNDU2E.js +36 -0
- package/dist/chunk-XNDCVVNE.js +45 -0
- package/dist/chunk-Y45JAJKW.js +44 -0
- package/dist/chunk-YAGVMERC.js +81 -0
- package/dist/chunk-YGOR3KT7.js +46 -0
- package/dist/chunk-YJD66LTV.js +54 -0
- package/dist/chunk-YJU4ZRQZ.js +1 -0
- package/dist/chunk-YUFCNHZF.js +27 -0
- package/dist/chunk-YUNWZAAD.js +57 -0
- package/dist/chunk-ZFVBFCYV.js +84 -0
- package/dist/chunk-ZXLACKEB.js +8 -0
- package/dist/components/Accordion/index.js +8 -0
- package/dist/components/Alert/index.js +10 -0
- package/dist/components/AlertDialog/index.js +8 -0
- package/dist/components/AppShell/index.js +8 -0
- package/dist/components/AspectRatio/index.js +8 -0
- package/dist/components/Autocomplete/index.js +9 -0
- package/dist/components/Avatar/index.js +11 -0
- package/dist/components/AvatarGroup/index.js +11 -0
- package/dist/components/Badge/index.js +10 -0
- package/dist/components/Banner/index.js +10 -0
- package/dist/components/Box/index.js +8 -0
- package/dist/components/Breadcrumb/index.js +8 -0
- package/dist/components/Button/index.js +10 -0
- package/dist/components/ButtonGroup/index.js +8 -0
- package/dist/components/Callout/index.js +10 -0
- package/dist/components/Card/index.js +11 -0
- package/dist/components/CheckList/index.js +10 -0
- package/dist/components/Checkbox/index.js +8 -0
- package/dist/components/Chip/index.js +10 -0
- package/dist/components/Code/index.js +8 -0
- package/dist/components/Collapsible/index.js +8 -0
- package/dist/components/Combobox/index.js +9 -0
- package/dist/components/CommandPalette/index.js +8 -0
- package/dist/components/Container/index.js +10 -0
- package/dist/components/ContextMenu/index.js +8 -0
- package/dist/components/CountryBadge/index.js +9 -0
- package/dist/components/DataTable/index.js +8 -0
- package/dist/components/DatePicker/index.js +8 -0
- package/dist/components/DateRangePicker/index.js +8 -0
- package/dist/components/Dialog/index.js +9 -0
- package/dist/components/Drawer/index.js +11 -0
- package/dist/components/DropdownMenu/index.js +8 -0
- package/dist/components/EmptyState/index.js +8 -0
- package/dist/components/ErrorState/index.js +8 -0
- package/dist/components/EyebrowChip/index.js +8 -0
- package/dist/components/FileUpload/index.js +8 -0
- package/dist/components/FilterChip/index.js +8 -0
- package/dist/components/Flag/index.js +9 -0
- package/dist/components/Flex/index.js +8 -0
- package/dist/components/FormError/index.js +9 -0
- package/dist/components/FormField/index.js +11 -0
- package/dist/components/GradientDivider/index.js +8 -0
- package/dist/components/Grid/index.js +8 -0
- package/dist/components/Heading/index.js +10 -0
- package/dist/components/HelperText/index.js +9 -0
- package/dist/components/HoverCard/index.js +8 -0
- package/dist/components/IconButton/index.js +10 -0
- package/dist/components/Input/index.js +15 -0
- package/dist/components/Kbd/index.js +9 -0
- package/dist/components/KeyboardShortcut/index.js +9 -0
- package/dist/components/Label/index.js +11 -0
- package/dist/components/Link/index.js +10 -0
- package/dist/components/Logo/index.js +10 -0
- package/dist/components/Menubar/index.js +8 -0
- package/dist/components/Motion/index.js +13 -0
- package/dist/components/NavigationMenu/index.js +8 -0
- package/dist/components/NumberInput/index.js +9 -0
- package/dist/components/PageHeader/index.js +8 -0
- package/dist/components/Pagination/index.js +8 -0
- package/dist/components/PasswordInput/index.js +9 -0
- package/dist/components/Popover/index.js +9 -0
- package/dist/components/Progress/index.js +12 -0
- package/dist/components/RadioGroup/index.js +8 -0
- package/dist/components/Rating/index.js +11 -0
- package/dist/components/ScrollArea/index.js +8 -0
- package/dist/components/SearchInput/index.js +9 -0
- package/dist/components/Section/index.js +10 -0
- package/dist/components/SegmentedControl/index.js +8 -0
- package/dist/components/Select/index.js +8 -0
- package/dist/components/Separator/index.js +10 -0
- package/dist/components/Sidebar/index.js +8 -0
- package/dist/components/Skeleton/index.js +10 -0
- package/dist/components/Slider/index.js +8 -0
- package/dist/components/Spinner/index.js +10 -0
- package/dist/components/Stack/index.js +8 -0
- package/dist/components/StatusPill/index.js +10 -0
- package/dist/components/Switch/index.js +8 -0
- package/dist/components/Table/index.js +8 -0
- package/dist/components/Tabs/index.js +8 -0
- package/dist/components/Tag/index.js +10 -0
- package/dist/components/Text/index.js +10 -0
- package/dist/components/TextGradient/index.js +8 -0
- package/dist/components/Textarea/index.js +10 -0
- package/dist/components/ThemeProvider/index.js +10 -0
- package/dist/components/Toast/index.js +14 -0
- package/dist/components/Toggle/index.js +11 -0
- package/dist/components/ToggleGroup/index.js +9 -0
- package/dist/components/Toolbar/index.js +8 -0
- package/dist/components/Tooltip/index.js +16 -0
- package/dist/components/TopNav/index.js +9 -0
- package/dist/components/VisuallyHidden/index.js +7 -0
- package/dist/index.d.ts +28 -11
- package/dist/index.js +479 -5896
- package/package.json +12 -12
- package/dist/index.cjs +0 -6112
- package/dist/index.d.cts +0 -1245
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
// src/components/Motion/Fade.tsx
|
|
4
|
+
import * as React2 from "react";
|
|
5
|
+
|
|
6
|
+
// src/components/Motion/useMotion.ts
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
var DURATION_MS = {
|
|
9
|
+
instant: 0,
|
|
10
|
+
fast: 150,
|
|
11
|
+
normal: 200,
|
|
12
|
+
slow: 300,
|
|
13
|
+
slower: 500
|
|
14
|
+
};
|
|
15
|
+
var FALLBACK_MARGIN_MS = 50;
|
|
16
|
+
function useMotion({
|
|
17
|
+
visible,
|
|
18
|
+
duration = "normal",
|
|
19
|
+
easing = "out",
|
|
20
|
+
unmountOnExit = false
|
|
21
|
+
}) {
|
|
22
|
+
const [phase, setPhase] = React.useState(
|
|
23
|
+
visible ? "entered" : "exited"
|
|
24
|
+
);
|
|
25
|
+
const rafRef = React.useRef(null);
|
|
26
|
+
const isMounted = React.useRef(true);
|
|
27
|
+
React.useEffect(() => {
|
|
28
|
+
isMounted.current = true;
|
|
29
|
+
return () => {
|
|
30
|
+
isMounted.current = false;
|
|
31
|
+
if (rafRef.current !== null) cancelAnimationFrame(rafRef.current);
|
|
32
|
+
};
|
|
33
|
+
}, []);
|
|
34
|
+
const prevVisible = React.useRef(visible);
|
|
35
|
+
React.useEffect(() => {
|
|
36
|
+
if (prevVisible.current === visible) return;
|
|
37
|
+
prevVisible.current = visible;
|
|
38
|
+
if (visible) {
|
|
39
|
+
setPhase("entering");
|
|
40
|
+
rafRef.current = requestAnimationFrame(() => {
|
|
41
|
+
rafRef.current = requestAnimationFrame(() => {
|
|
42
|
+
if (isMounted.current) setPhase("entered");
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
} else {
|
|
46
|
+
setPhase("exiting");
|
|
47
|
+
}
|
|
48
|
+
}, [visible]);
|
|
49
|
+
React.useEffect(() => {
|
|
50
|
+
if (phase !== "exiting") return;
|
|
51
|
+
const t = setTimeout(() => setPhase("exited"), DURATION_MS[duration] + FALLBACK_MARGIN_MS);
|
|
52
|
+
return () => clearTimeout(t);
|
|
53
|
+
}, [phase, duration]);
|
|
54
|
+
const handleTransitionEnd = React.useCallback((e) => {
|
|
55
|
+
if (!isMounted.current) return;
|
|
56
|
+
if (e && e.target !== e.currentTarget) return;
|
|
57
|
+
setPhase((prev) => prev === "exiting" ? "exited" : prev);
|
|
58
|
+
}, []);
|
|
59
|
+
const mounted = unmountOnExit ? phase !== "exited" : true;
|
|
60
|
+
const transitionStyle = {
|
|
61
|
+
transitionDuration: `var(--duration-${duration})`,
|
|
62
|
+
transitionTimingFunction: `var(--ease-${easing})`,
|
|
63
|
+
transitionProperty: "opacity, transform"
|
|
64
|
+
};
|
|
65
|
+
return { phase, mounted, transitionStyle, handleTransitionEnd };
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// src/components/Motion/Fade.tsx
|
|
69
|
+
import { jsx } from "react/jsx-runtime";
|
|
70
|
+
var Fade = React2.forwardRef(function Fade2({
|
|
71
|
+
in: visible,
|
|
72
|
+
duration = "normal",
|
|
73
|
+
easing = "out",
|
|
74
|
+
unmountOnExit = false,
|
|
75
|
+
children,
|
|
76
|
+
style,
|
|
77
|
+
as: Tag = "div",
|
|
78
|
+
...rest
|
|
79
|
+
}, ref) {
|
|
80
|
+
const { phase, mounted, transitionStyle, handleTransitionEnd } = useMotion({
|
|
81
|
+
visible,
|
|
82
|
+
duration,
|
|
83
|
+
easing,
|
|
84
|
+
unmountOnExit
|
|
85
|
+
});
|
|
86
|
+
if (!mounted) return null;
|
|
87
|
+
const opacity = phase === "entered" ? 1 : 0;
|
|
88
|
+
return /* @__PURE__ */ jsx(
|
|
89
|
+
Tag,
|
|
90
|
+
{
|
|
91
|
+
ref,
|
|
92
|
+
onTransitionEnd: handleTransitionEnd,
|
|
93
|
+
style: {
|
|
94
|
+
opacity,
|
|
95
|
+
willChange: "opacity",
|
|
96
|
+
...transitionStyle,
|
|
97
|
+
...style
|
|
98
|
+
},
|
|
99
|
+
...rest,
|
|
100
|
+
children
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
});
|
|
104
|
+
Fade.displayName = "Fade";
|
|
105
|
+
|
|
106
|
+
// src/components/Motion/Slide.tsx
|
|
107
|
+
import * as React3 from "react";
|
|
108
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
109
|
+
var directionTransform = {
|
|
110
|
+
up: { from: "translateY(12px)", to: "translateY(0)" },
|
|
111
|
+
down: { from: "translateY(-12px)", to: "translateY(0)" },
|
|
112
|
+
left: { from: "translateX(12px)", to: "translateX(0)" },
|
|
113
|
+
right: { from: "translateX(-12px)", to: "translateX(0)" }
|
|
114
|
+
};
|
|
115
|
+
var Slide = React3.forwardRef(function Slide2({
|
|
116
|
+
in: visible,
|
|
117
|
+
duration = "normal",
|
|
118
|
+
easing = "out",
|
|
119
|
+
unmountOnExit = false,
|
|
120
|
+
direction = "up",
|
|
121
|
+
distance,
|
|
122
|
+
children,
|
|
123
|
+
style,
|
|
124
|
+
as: Tag = "div",
|
|
125
|
+
...rest
|
|
126
|
+
}, ref) {
|
|
127
|
+
const { phase, mounted, transitionStyle, handleTransitionEnd } = useMotion({
|
|
128
|
+
visible,
|
|
129
|
+
duration,
|
|
130
|
+
easing,
|
|
131
|
+
unmountOnExit
|
|
132
|
+
});
|
|
133
|
+
if (!mounted) return null;
|
|
134
|
+
const isEntered = phase === "entered";
|
|
135
|
+
const dt = directionTransform[direction];
|
|
136
|
+
let fromTransform = dt.from;
|
|
137
|
+
if (distance) {
|
|
138
|
+
if (direction === "up") fromTransform = `translateY(${distance})`;
|
|
139
|
+
if (direction === "down") fromTransform = `translateY(-${distance})`;
|
|
140
|
+
if (direction === "left") fromTransform = `translateX(${distance})`;
|
|
141
|
+
if (direction === "right") fromTransform = `translateX(-${distance})`;
|
|
142
|
+
}
|
|
143
|
+
return /* @__PURE__ */ jsx2(
|
|
144
|
+
Tag,
|
|
145
|
+
{
|
|
146
|
+
ref,
|
|
147
|
+
onTransitionEnd: handleTransitionEnd,
|
|
148
|
+
style: {
|
|
149
|
+
opacity: isEntered ? 1 : 0,
|
|
150
|
+
transform: isEntered ? dt.to : fromTransform,
|
|
151
|
+
willChange: "opacity, transform",
|
|
152
|
+
...transitionStyle,
|
|
153
|
+
...style
|
|
154
|
+
},
|
|
155
|
+
...rest,
|
|
156
|
+
children
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
});
|
|
160
|
+
Slide.displayName = "Slide";
|
|
161
|
+
|
|
162
|
+
// src/components/Motion/Scale.tsx
|
|
163
|
+
import * as React4 from "react";
|
|
164
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
165
|
+
var Scale = React4.forwardRef(function Scale2({
|
|
166
|
+
in: visible,
|
|
167
|
+
duration = "fast",
|
|
168
|
+
easing = "out-expo",
|
|
169
|
+
unmountOnExit = false,
|
|
170
|
+
initialScale = 0.95,
|
|
171
|
+
children,
|
|
172
|
+
style,
|
|
173
|
+
as: Tag = "div",
|
|
174
|
+
...rest
|
|
175
|
+
}, ref) {
|
|
176
|
+
const { phase, mounted, transitionStyle, handleTransitionEnd } = useMotion({
|
|
177
|
+
visible,
|
|
178
|
+
duration,
|
|
179
|
+
easing,
|
|
180
|
+
unmountOnExit
|
|
181
|
+
});
|
|
182
|
+
if (!mounted) return null;
|
|
183
|
+
const isEntered = phase === "entered";
|
|
184
|
+
return /* @__PURE__ */ jsx3(
|
|
185
|
+
Tag,
|
|
186
|
+
{
|
|
187
|
+
ref,
|
|
188
|
+
onTransitionEnd: handleTransitionEnd,
|
|
189
|
+
style: {
|
|
190
|
+
opacity: isEntered ? 1 : 0,
|
|
191
|
+
transform: isEntered ? "scale(1)" : `scale(${initialScale})`,
|
|
192
|
+
transformOrigin: "top center",
|
|
193
|
+
willChange: "opacity, transform",
|
|
194
|
+
...transitionStyle,
|
|
195
|
+
...style
|
|
196
|
+
},
|
|
197
|
+
...rest,
|
|
198
|
+
children
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
});
|
|
202
|
+
Scale.displayName = "Scale";
|
|
203
|
+
|
|
204
|
+
// src/components/Motion/Collapse.tsx
|
|
205
|
+
import * as React5 from "react";
|
|
206
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
207
|
+
var Collapse = React5.forwardRef(function Collapse2({
|
|
208
|
+
in: visible,
|
|
209
|
+
duration = "normal",
|
|
210
|
+
easing = "out",
|
|
211
|
+
unmountOnExit = false,
|
|
212
|
+
collapsedHeight = 0,
|
|
213
|
+
children,
|
|
214
|
+
style,
|
|
215
|
+
as: Tag = "div",
|
|
216
|
+
...rest
|
|
217
|
+
}, ref) {
|
|
218
|
+
const innerRef = React5.useRef(null);
|
|
219
|
+
const [height, setHeight] = React5.useState(visible ? "auto" : 0);
|
|
220
|
+
const [overflow, setOverflow] = React5.useState(
|
|
221
|
+
visible ? "visible" : "hidden"
|
|
222
|
+
);
|
|
223
|
+
const [mounted, setMounted] = React5.useState(unmountOnExit ? visible : true);
|
|
224
|
+
const prevVisible = React5.useRef(visible);
|
|
225
|
+
React5.useEffect(() => {
|
|
226
|
+
const changed = prevVisible.current !== visible;
|
|
227
|
+
prevVisible.current = visible;
|
|
228
|
+
if (!changed) return;
|
|
229
|
+
let raf1 = 0;
|
|
230
|
+
let raf2 = 0;
|
|
231
|
+
if (visible) {
|
|
232
|
+
setMounted(true);
|
|
233
|
+
raf1 = requestAnimationFrame(() => {
|
|
234
|
+
const el = innerRef.current;
|
|
235
|
+
if (el) {
|
|
236
|
+
setHeight(el.scrollHeight);
|
|
237
|
+
setOverflow("hidden");
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
} else {
|
|
241
|
+
const el = innerRef.current;
|
|
242
|
+
if (el) {
|
|
243
|
+
setHeight(el.scrollHeight);
|
|
244
|
+
setOverflow("hidden");
|
|
245
|
+
raf1 = requestAnimationFrame(() => {
|
|
246
|
+
raf2 = requestAnimationFrame(() => {
|
|
247
|
+
setHeight(typeof collapsedHeight === "number" ? collapsedHeight : 0);
|
|
248
|
+
});
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return () => {
|
|
253
|
+
cancelAnimationFrame(raf1);
|
|
254
|
+
cancelAnimationFrame(raf2);
|
|
255
|
+
};
|
|
256
|
+
}, [visible, collapsedHeight]);
|
|
257
|
+
const finish = React5.useCallback(() => {
|
|
258
|
+
if (visible) {
|
|
259
|
+
setHeight("auto");
|
|
260
|
+
setOverflow("visible");
|
|
261
|
+
} else if (unmountOnExit) {
|
|
262
|
+
setMounted(false);
|
|
263
|
+
}
|
|
264
|
+
}, [visible, unmountOnExit]);
|
|
265
|
+
const handleTransitionEnd = React5.useCallback(
|
|
266
|
+
(e) => {
|
|
267
|
+
if (e.target !== e.currentTarget || e.propertyName !== "max-height") return;
|
|
268
|
+
finish();
|
|
269
|
+
},
|
|
270
|
+
[finish]
|
|
271
|
+
);
|
|
272
|
+
const firstRender = React5.useRef(true);
|
|
273
|
+
React5.useEffect(() => {
|
|
274
|
+
if (firstRender.current) {
|
|
275
|
+
firstRender.current = false;
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
const t = setTimeout(finish, DURATION_MS[duration] + 100);
|
|
279
|
+
return () => clearTimeout(t);
|
|
280
|
+
}, [visible, duration, finish]);
|
|
281
|
+
if (!mounted) return null;
|
|
282
|
+
const maxHeight = height === "auto" ? "none" : `${height}px`;
|
|
283
|
+
return /* @__PURE__ */ jsx4(
|
|
284
|
+
Tag,
|
|
285
|
+
{
|
|
286
|
+
ref,
|
|
287
|
+
style: {
|
|
288
|
+
maxHeight,
|
|
289
|
+
overflow,
|
|
290
|
+
transitionProperty: "max-height",
|
|
291
|
+
transitionDuration: `var(--duration-${duration})`,
|
|
292
|
+
transitionTimingFunction: `var(--ease-${easing})`,
|
|
293
|
+
...style
|
|
294
|
+
},
|
|
295
|
+
onTransitionEnd: handleTransitionEnd,
|
|
296
|
+
...rest,
|
|
297
|
+
children: /* @__PURE__ */ jsx4("div", { ref: innerRef, children })
|
|
298
|
+
}
|
|
299
|
+
);
|
|
300
|
+
});
|
|
301
|
+
Collapse.displayName = "Collapse";
|
|
302
|
+
|
|
303
|
+
export {
|
|
304
|
+
Fade,
|
|
305
|
+
Slide,
|
|
306
|
+
Scale,
|
|
307
|
+
Collapse
|
|
308
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/GradientDivider/GradientDivider.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var BRAND_GRADIENT_H = "linear-gradient(90deg, #4099f1 0%, #1cce66 40%, #f59e0b 70%, #1b3b6f 100%)";
|
|
10
|
+
var BRAND_GRADIENT_V = "linear-gradient(180deg, #4099f1 0%, #1cce66 40%, #f59e0b 70%, #1b3b6f 100%)";
|
|
11
|
+
var GradientDivider = React.forwardRef(
|
|
12
|
+
({ className, height = 3, orientation = "horizontal", style, ...props }, ref) => {
|
|
13
|
+
const isHorizontal = orientation === "horizontal";
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
ref,
|
|
18
|
+
role: "separator",
|
|
19
|
+
"aria-orientation": orientation,
|
|
20
|
+
className: cn(
|
|
21
|
+
isHorizontal ? "w-full" : "h-full",
|
|
22
|
+
className
|
|
23
|
+
),
|
|
24
|
+
style: {
|
|
25
|
+
background: isHorizontal ? BRAND_GRADIENT_H : BRAND_GRADIENT_V,
|
|
26
|
+
...isHorizontal ? { height: `${height}px` } : { width: `${height}px` },
|
|
27
|
+
...style
|
|
28
|
+
},
|
|
29
|
+
...props
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
GradientDivider.displayName = "GradientDivider";
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
GradientDivider
|
|
38
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/IconButton/IconButton.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
9
|
+
import { cva } from "class-variance-authority";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
var iconButtonVariants = cva(
|
|
12
|
+
[
|
|
13
|
+
"inline-flex items-center justify-center rounded-md transition-colors flex-shrink-0",
|
|
14
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring-default)] focus-visible:ring-offset-2 ring-offset-[var(--color-ring-offset)]",
|
|
15
|
+
"disabled:opacity-50 disabled:pointer-events-none",
|
|
16
|
+
"select-none"
|
|
17
|
+
],
|
|
18
|
+
{
|
|
19
|
+
variants: {
|
|
20
|
+
variant: {
|
|
21
|
+
ghost: "bg-transparent text-[var(--color-text-primary)] hover:bg-[var(--color-bg-subtle)]",
|
|
22
|
+
solid: "bg-[var(--color-fill-primary)] text-white hover:bg-[var(--color-fill-primary-hover)]",
|
|
23
|
+
outline: "bg-transparent border border-[var(--color-border-default)] text-[var(--color-text-primary)] hover:bg-[var(--color-bg-subtle)]",
|
|
24
|
+
subtle: "bg-[var(--color-bg-subtle)] text-[var(--color-text-primary)] hover:bg-[var(--color-bg-muted)]"
|
|
25
|
+
},
|
|
26
|
+
size: {
|
|
27
|
+
xs: "h-7 w-7 text-xs",
|
|
28
|
+
sm: "h-8 w-8 text-sm",
|
|
29
|
+
md: "h-9 w-9 text-sm",
|
|
30
|
+
lg: "h-10 w-10 text-base",
|
|
31
|
+
xl: "h-12 w-12 text-base"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
variant: "ghost",
|
|
36
|
+
size: "md"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
var IconButton = React.forwardRef(
|
|
41
|
+
({ className, variant, size, label, asChild = false, children, ...props }, ref) => {
|
|
42
|
+
const Comp = asChild ? Slot : "button";
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
Comp,
|
|
45
|
+
{
|
|
46
|
+
ref,
|
|
47
|
+
"aria-label": label,
|
|
48
|
+
className: cn(iconButtonVariants({ variant, size }), className),
|
|
49
|
+
...props,
|
|
50
|
+
children
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
IconButton.displayName = "IconButton";
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
iconButtonVariants,
|
|
59
|
+
IconButton
|
|
60
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Collapsible/Collapsible.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import * as RadixCollapsible from "@radix-ui/react-collapsible";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var Root2 = React.forwardRef(
|
|
11
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(RadixCollapsible.Root, { ref, className: cn("", className), ...props })
|
|
12
|
+
);
|
|
13
|
+
Root2.displayName = "Collapsible.Root";
|
|
14
|
+
var Trigger2 = React.forwardRef(
|
|
15
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(RadixCollapsible.Trigger, { ref, className: cn("", className), ...props })
|
|
16
|
+
);
|
|
17
|
+
Trigger2.displayName = "Collapsible.Trigger";
|
|
18
|
+
var Content2 = React.forwardRef(
|
|
19
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
20
|
+
RadixCollapsible.Content,
|
|
21
|
+
{
|
|
22
|
+
ref,
|
|
23
|
+
className: cn(
|
|
24
|
+
"overflow-hidden",
|
|
25
|
+
"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
26
|
+
className
|
|
27
|
+
),
|
|
28
|
+
...props
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
);
|
|
32
|
+
Content2.displayName = "Collapsible.Content";
|
|
33
|
+
var Collapsible = { Root: Root2, Trigger: Trigger2, Content: Content2 };
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
Collapsible
|
|
37
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/TextGradient/TextGradient.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var TextGradient = React.forwardRef(
|
|
10
|
+
({ className, children, ...rest }, ref) => {
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
"span",
|
|
13
|
+
{
|
|
14
|
+
ref,
|
|
15
|
+
className: cn(
|
|
16
|
+
"bg-[var(--gradient-brand-horizontal)] bg-clip-text text-transparent",
|
|
17
|
+
className
|
|
18
|
+
),
|
|
19
|
+
...rest,
|
|
20
|
+
children
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
TextGradient.displayName = "TextGradient";
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
TextGradient
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
Kbd
|
|
4
|
+
} from "./chunk-PER3O4FD.js";
|
|
5
|
+
import {
|
|
6
|
+
cn
|
|
7
|
+
} from "./chunk-AT6RPKU3.js";
|
|
8
|
+
|
|
9
|
+
// src/components/KeyboardShortcut/KeyboardShortcut.tsx
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
var KeyboardShortcut = React.forwardRef(
|
|
13
|
+
({ keys, className, ...rest }, ref) => {
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
"span",
|
|
16
|
+
{
|
|
17
|
+
ref,
|
|
18
|
+
className: cn("inline-flex items-center gap-1", className),
|
|
19
|
+
"aria-label": keys.join("+"),
|
|
20
|
+
...rest,
|
|
21
|
+
children: keys.map((key, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
22
|
+
index > 0 && /* @__PURE__ */ jsx(
|
|
23
|
+
"span",
|
|
24
|
+
{
|
|
25
|
+
className: "text-[var(--color-text-muted)] text-xs select-none",
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
children: "+"
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ jsx(Kbd, { children: key })
|
|
31
|
+
] }, `${key}-${index}`))
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
KeyboardShortcut.displayName = "KeyboardShortcut";
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
KeyboardShortcut
|
|
40
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
cn
|
|
4
|
+
} from "./chunk-AT6RPKU3.js";
|
|
5
|
+
|
|
6
|
+
// src/components/Tag/Tag.tsx
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { cva } from "class-variance-authority";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var tagVariants = cva(
|
|
11
|
+
"inline-flex items-center rounded font-medium select-none whitespace-nowrap",
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
size: {
|
|
15
|
+
sm: "px-1.5 py-0.5 text-xs",
|
|
16
|
+
md: "px-2 py-0.5 text-xs",
|
|
17
|
+
lg: "px-2.5 py-1 text-sm"
|
|
18
|
+
},
|
|
19
|
+
tone: {
|
|
20
|
+
neutral: "bg-[var(--color-neutral-100)] text-[var(--color-neutral-700)]",
|
|
21
|
+
info: "bg-[var(--color-semantic-info-default)]/10 text-[var(--color-semantic-info-default)]",
|
|
22
|
+
success: "bg-[var(--color-semantic-success-default)]/10 text-[var(--color-semantic-success-default)]",
|
|
23
|
+
warning: "bg-[var(--color-semantic-warning-default)]/10 text-[var(--color-semantic-warning-default)]",
|
|
24
|
+
danger: "bg-[var(--color-semantic-error-default)]/10 text-[var(--color-semantic-error-default)]",
|
|
25
|
+
leap: "bg-[var(--color-leap-500)]/10 text-[var(--color-leap-700)]",
|
|
26
|
+
bookub: "bg-[var(--color-bookub-500)]/10 text-[var(--color-bookub-700)]",
|
|
27
|
+
payub: "bg-[var(--color-payub-500)]/10 text-[var(--color-payub-700)]",
|
|
28
|
+
founderub: "bg-[var(--color-founderub-500)]/10 text-[var(--color-founderub-700)]"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
size: "md",
|
|
33
|
+
tone: "neutral"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
var Tag = React.forwardRef(
|
|
38
|
+
({ className, size, tone = "neutral", children, ...props }, ref) => {
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
40
|
+
"span",
|
|
41
|
+
{
|
|
42
|
+
ref,
|
|
43
|
+
className: cn(tagVariants({ size, tone }), className),
|
|
44
|
+
...props,
|
|
45
|
+
children
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
Tag.displayName = "Tag";
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
tagVariants,
|
|
54
|
+
Tag
|
|
55
|
+
};
|