@usefui/components 1.5.3 → 1.6.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/CHANGELOG.md +6 -0
- package/dist/index.d.mts +237 -1
- package/dist/index.d.ts +237 -1
- package/dist/index.js +702 -231
- package/dist/index.mjs +668 -210
- package/package.json +12 -12
- package/src/__tests__/MessageBubble.test.tsx +179 -0
- package/src/__tests__/Shimmer.test.tsx +122 -0
- package/src/__tests__/Tree.test.tsx +275 -0
- package/src/accordion/hooks/index.tsx +3 -1
- package/src/badge/index.tsx +2 -3
- package/src/checkbox/hooks/index.tsx +5 -1
- package/src/collapsible/hooks/index.tsx +3 -1
- package/src/dialog/hooks/index.tsx +5 -1
- package/src/dropdown/hooks/index.tsx +3 -1
- package/src/dropdown/index.tsx +9 -9
- package/src/field/hooks/index.tsx +5 -1
- package/src/index.ts +6 -0
- package/src/message-bubble/MessageBubble.stories.tsx +91 -0
- package/src/message-bubble/hooks/index.tsx +41 -0
- package/src/message-bubble/index.tsx +153 -0
- package/src/message-bubble/styles/index.ts +61 -0
- package/src/otp-field/hooks/index.tsx +3 -1
- package/src/otp-field/index.tsx +5 -3
- package/src/sheet/hooks/index.tsx +5 -1
- package/src/shimmer/Shimmer.stories.tsx +95 -0
- package/src/shimmer/index.tsx +64 -0
- package/src/shimmer/styles/index.ts +33 -0
- package/src/switch/hooks/index.tsx +5 -1
- package/src/tabs/hooks/index.tsx +5 -1
- package/src/toolbar/hooks/index.tsx +5 -1
- package/src/tree/Tree.stories.tsx +139 -0
- package/src/tree/hooks/tree-node-provider.tsx +50 -0
- package/src/tree/hooks/tree-provider.tsx +75 -0
- package/src/tree/index.tsx +231 -0
- package/src/tree/styles/index.ts +23 -0
- package/tsconfig.build.json +20 -0
- package/tsconfig.json +1 -3
package/dist/index.mjs
CHANGED
|
@@ -889,7 +889,9 @@ var defaultComponentAPI2 = {
|
|
|
889
889
|
};
|
|
890
890
|
var CheckboxContext = createContext2(defaultComponentAPI2);
|
|
891
891
|
var useCheckbox = () => useContext2(CheckboxContext);
|
|
892
|
-
var CheckboxProvider = ({
|
|
892
|
+
var CheckboxProvider = ({
|
|
893
|
+
children
|
|
894
|
+
}) => {
|
|
893
895
|
const context = useCheckboxProvider();
|
|
894
896
|
return /* @__PURE__ */ React8.createElement(CheckboxContext.Provider, { value: context }, children);
|
|
895
897
|
};
|
|
@@ -1333,7 +1335,9 @@ var defaultComponentAPI4 = {
|
|
|
1333
1335
|
};
|
|
1334
1336
|
var DialogContext = createContext4(defaultComponentAPI4);
|
|
1335
1337
|
var useDialog = () => useContext4(DialogContext);
|
|
1336
|
-
var DialogProvider = ({
|
|
1338
|
+
var DialogProvider = ({
|
|
1339
|
+
children
|
|
1340
|
+
}) => {
|
|
1337
1341
|
const context = useDialogProvider();
|
|
1338
1342
|
return /* @__PURE__ */ React13.createElement(DialogContext.Provider, { value: context }, children);
|
|
1339
1343
|
};
|
|
@@ -1775,7 +1779,10 @@ var DropdownMenu = ({ children }) => {
|
|
|
1775
1779
|
const handleClickOutside = () => {
|
|
1776
1780
|
if (states.open && toggleOpen) toggleOpen();
|
|
1777
1781
|
};
|
|
1778
|
-
useClickOutside(
|
|
1782
|
+
useClickOutside(
|
|
1783
|
+
DropdownContentRef,
|
|
1784
|
+
handleClickOutside
|
|
1785
|
+
);
|
|
1779
1786
|
useDisabledScroll(Boolean(states.open));
|
|
1780
1787
|
return /* @__PURE__ */ React17.createElement(RootWrapper, { ref: DropdownContentRef }, children);
|
|
1781
1788
|
};
|
|
@@ -1951,7 +1958,9 @@ var defaultComponentAPI5 = {
|
|
|
1951
1958
|
};
|
|
1952
1959
|
var FieldContext = createContext5(defaultComponentAPI5);
|
|
1953
1960
|
var useField = () => useContext5(FieldContext);
|
|
1954
|
-
var FieldProvider = ({
|
|
1961
|
+
var FieldProvider = ({
|
|
1962
|
+
children
|
|
1963
|
+
}) => {
|
|
1955
1964
|
const context = useFieldProvider();
|
|
1956
1965
|
return /* @__PURE__ */ React18.createElement(FieldContext.Provider, { value: context }, children);
|
|
1957
1966
|
};
|
|
@@ -2244,23 +2253,175 @@ Field.Wrapper = FieldWrapper;
|
|
|
2244
2253
|
Field.Label = FieldLabel;
|
|
2245
2254
|
Field.Meta = FieldMeta;
|
|
2246
2255
|
|
|
2247
|
-
// src/
|
|
2256
|
+
// src/message-bubble/index.tsx
|
|
2248
2257
|
import React21 from "react";
|
|
2249
2258
|
|
|
2259
|
+
// src/message-bubble/hooks/index.tsx
|
|
2260
|
+
import React20, { useState as useState6, createContext as createContext6, useContext as useContext6 } from "react";
|
|
2261
|
+
var defaultComponentAPI6 = {
|
|
2262
|
+
id: "",
|
|
2263
|
+
states: {},
|
|
2264
|
+
methods: {}
|
|
2265
|
+
};
|
|
2266
|
+
var MessageBubbleContext = createContext6(defaultComponentAPI6);
|
|
2267
|
+
var useMessageBubble = () => useContext6(MessageBubbleContext);
|
|
2268
|
+
var MessageBubbleProvider = ({
|
|
2269
|
+
children
|
|
2270
|
+
}) => {
|
|
2271
|
+
const context = useMessageBubbleProvider();
|
|
2272
|
+
return /* @__PURE__ */ React20.createElement(MessageBubbleContext.Provider, { value: context }, children);
|
|
2273
|
+
};
|
|
2274
|
+
function useMessageBubbleProvider() {
|
|
2275
|
+
const [side, setSide] = useState6(null);
|
|
2276
|
+
const MessageBubbleId = React20.useId();
|
|
2277
|
+
return {
|
|
2278
|
+
id: MessageBubbleId,
|
|
2279
|
+
states: {
|
|
2280
|
+
side
|
|
2281
|
+
},
|
|
2282
|
+
methods: {
|
|
2283
|
+
applySide: (side2) => setSide(side2)
|
|
2284
|
+
}
|
|
2285
|
+
};
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2288
|
+
// src/message-bubble/styles/index.ts
|
|
2289
|
+
import styled11 from "styled-components";
|
|
2290
|
+
var MessageBubbleWrapper = styled11.div`
|
|
2291
|
+
display: flex;
|
|
2292
|
+
flex-direction: column;
|
|
2293
|
+
gap: var(--measurement-medium-10);
|
|
2294
|
+
|
|
2295
|
+
&[data-side="right"] {
|
|
2296
|
+
align-items: flex-end;
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
&[data-side="left"] {
|
|
2300
|
+
align-items: flex-start;
|
|
2301
|
+
}
|
|
2302
|
+
`;
|
|
2303
|
+
var MessageBubbleBadge = styled11(Badge)`
|
|
2304
|
+
position: relative;
|
|
2305
|
+
max-width: var(--measurement-large-90);
|
|
2306
|
+
width: 100%;
|
|
2307
|
+
justify-self: flex-end;
|
|
2308
|
+
padding: var(--measurement-medium-30) var(--measurement-medium-50) !important;
|
|
2309
|
+
border-radius: var(--measurement-medium-60) !important;
|
|
2310
|
+
|
|
2311
|
+
&[data-side="left"] {
|
|
2312
|
+
background-color: var(--contrast-color) !important;
|
|
2313
|
+
border-bottom-left-radius: 0 !important;
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
&[data-side="right"] {
|
|
2317
|
+
background-color: var(--font-color-alpha-10) !important;
|
|
2318
|
+
border-bottom-right-radius: 0 !important;
|
|
2319
|
+
}
|
|
2320
|
+
`;
|
|
2321
|
+
var MessageBubbleContentWrapper = styled11.div`
|
|
2322
|
+
line-height: 1.5;
|
|
2323
|
+
font-weight: 500;
|
|
2324
|
+
word-break: keep-all;
|
|
2325
|
+
width: 100%;
|
|
2326
|
+
|
|
2327
|
+
* {
|
|
2328
|
+
font-size: var(--fontsize-medium-10) !important;
|
|
2329
|
+
}
|
|
2330
|
+
`;
|
|
2331
|
+
var MessageBubbleMetaWrapper = styled11.div`
|
|
2332
|
+
display: flex;
|
|
2333
|
+
align-items: center;
|
|
2334
|
+
gap: var(--measurement-medium-10);
|
|
2335
|
+
width: 100%;
|
|
2336
|
+
|
|
2337
|
+
&[data-side="right"] {
|
|
2338
|
+
justify-content: flex-end;
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2341
|
+
&[data-side="left"] {
|
|
2342
|
+
justify-content: flex-start;
|
|
2343
|
+
}
|
|
2344
|
+
`;
|
|
2345
|
+
|
|
2346
|
+
// src/message-bubble/index.tsx
|
|
2347
|
+
var MessageBubbleRoot = ({ children }) => {
|
|
2348
|
+
return /* @__PURE__ */ React21.createElement(MessageBubbleProvider, null, children);
|
|
2349
|
+
};
|
|
2350
|
+
MessageBubbleRoot.displayName = "MessageBubble.Root";
|
|
2351
|
+
var MessageBubble = (props) => {
|
|
2352
|
+
const { side, raw, children, ...restProps } = props;
|
|
2353
|
+
const { methods } = useMessageBubble();
|
|
2354
|
+
React21.useEffect(() => {
|
|
2355
|
+
if (side && methods?.applySide) methods.applySide(side);
|
|
2356
|
+
}, [side]);
|
|
2357
|
+
return /* @__PURE__ */ React21.createElement(
|
|
2358
|
+
MessageBubbleWrapper,
|
|
2359
|
+
{
|
|
2360
|
+
"data-raw": Boolean(raw),
|
|
2361
|
+
"data-side": side,
|
|
2362
|
+
"aria-label": restProps["aria-label"] ?? `message-bubble-${side}`,
|
|
2363
|
+
...restProps
|
|
2364
|
+
},
|
|
2365
|
+
children
|
|
2366
|
+
);
|
|
2367
|
+
};
|
|
2368
|
+
MessageBubble.displayName = "MessageBubble";
|
|
2369
|
+
var MessageBubbleContent = (props) => {
|
|
2370
|
+
const { children, raw, ...restProps } = props;
|
|
2371
|
+
const { id, states } = useMessageBubble();
|
|
2372
|
+
return /* @__PURE__ */ React21.createElement(
|
|
2373
|
+
MessageBubbleBadge,
|
|
2374
|
+
{
|
|
2375
|
+
variant: "secondary",
|
|
2376
|
+
"data-raw": Boolean(raw),
|
|
2377
|
+
"data-side": states?.side,
|
|
2378
|
+
"aria-label": `message-bubble-content-${id}`,
|
|
2379
|
+
...restProps
|
|
2380
|
+
},
|
|
2381
|
+
/* @__PURE__ */ React21.createElement(MessageBubbleContentWrapper, null, children)
|
|
2382
|
+
);
|
|
2383
|
+
};
|
|
2384
|
+
MessageBubbleContent.displayName = "MessageBubble.Content";
|
|
2385
|
+
var MessageBubbleMeta = (props) => {
|
|
2386
|
+
const { createdAt, raw, ...restProps } = props;
|
|
2387
|
+
const { states } = useMessageBubble();
|
|
2388
|
+
const formattedDate = new Intl.DateTimeFormat("en-US", {
|
|
2389
|
+
dateStyle: "medium",
|
|
2390
|
+
timeStyle: "short"
|
|
2391
|
+
}).format(createdAt);
|
|
2392
|
+
return /* @__PURE__ */ React21.createElement(
|
|
2393
|
+
MessageBubbleMetaWrapper,
|
|
2394
|
+
{
|
|
2395
|
+
"data-raw": Boolean(raw),
|
|
2396
|
+
"data-side": states?.side,
|
|
2397
|
+
"aria-label": `message-bubble-meta-${states?.side}`,
|
|
2398
|
+
...restProps
|
|
2399
|
+
},
|
|
2400
|
+
formattedDate
|
|
2401
|
+
);
|
|
2402
|
+
};
|
|
2403
|
+
MessageBubbleMeta.displayName = "MessageBubble.Meta";
|
|
2404
|
+
MessageBubble.Root = MessageBubbleRoot;
|
|
2405
|
+
MessageBubble.Content = MessageBubbleContent;
|
|
2406
|
+
MessageBubble.Meta = MessageBubbleMeta;
|
|
2407
|
+
|
|
2408
|
+
// src/otp-field/index.tsx
|
|
2409
|
+
import React23 from "react";
|
|
2410
|
+
|
|
2250
2411
|
// src/otp-field/hooks/index.tsx
|
|
2251
|
-
import
|
|
2252
|
-
var OTPFieldContext =
|
|
2412
|
+
import React22 from "react";
|
|
2413
|
+
var OTPFieldContext = React22.createContext(
|
|
2253
2414
|
null
|
|
2254
2415
|
);
|
|
2255
2416
|
var useOTPField = () => {
|
|
2256
|
-
const context =
|
|
2417
|
+
const context = React22.useContext(OTPFieldContext);
|
|
2257
2418
|
if (!context) return null;
|
|
2258
2419
|
return context;
|
|
2259
2420
|
};
|
|
2260
2421
|
|
|
2261
2422
|
// src/otp-field/styles/index.ts
|
|
2262
|
-
import
|
|
2263
|
-
var OTPCell =
|
|
2423
|
+
import styled12 from "styled-components";
|
|
2424
|
+
var OTPCell = styled12.input`
|
|
2264
2425
|
width: var(--measurement-medium-90);
|
|
2265
2426
|
height: var(--measurement-medium-90);
|
|
2266
2427
|
border: var(--measurement-small-10) solid var(--font-color-alpha-10);
|
|
@@ -2295,11 +2456,11 @@ var OTPCell = styled11.input`
|
|
|
2295
2456
|
// src/otp-field/index.tsx
|
|
2296
2457
|
var OTPField = ({ children, length, onComplete }) => {
|
|
2297
2458
|
const defaultLength = length ?? 6;
|
|
2298
|
-
const inputRefs =
|
|
2299
|
-
const [otp, setOtp] =
|
|
2459
|
+
const inputRefs = React23.useRef([]);
|
|
2460
|
+
const [otp, setOtp] = React23.useState(
|
|
2300
2461
|
Array.from({ length: defaultLength }, () => "")
|
|
2301
2462
|
);
|
|
2302
|
-
const [activeIndex, setActiveIndex] =
|
|
2463
|
+
const [activeIndex, setActiveIndex] = React23.useState(0);
|
|
2303
2464
|
const handleChange = (index, value) => {
|
|
2304
2465
|
const newOtp = [...otp];
|
|
2305
2466
|
newOtp[index] = value.substring(value.length - 1);
|
|
@@ -2360,13 +2521,13 @@ var OTPField = ({ children, length, onComplete }) => {
|
|
|
2360
2521
|
);
|
|
2361
2522
|
return () => clearTimeout(timeout);
|
|
2362
2523
|
};
|
|
2363
|
-
|
|
2524
|
+
React23.useEffect(() => {
|
|
2364
2525
|
const otpString = otp.join("");
|
|
2365
2526
|
if (otpString.length === defaultLength && onComplete) {
|
|
2366
2527
|
onComplete(otpString);
|
|
2367
2528
|
}
|
|
2368
2529
|
}, [otp, defaultLength, onComplete]);
|
|
2369
|
-
const contextValue =
|
|
2530
|
+
const contextValue = React23.useMemo(() => {
|
|
2370
2531
|
return {
|
|
2371
2532
|
otp,
|
|
2372
2533
|
activeIndex,
|
|
@@ -2389,11 +2550,11 @@ var OTPField = ({ children, length, onComplete }) => {
|
|
|
2389
2550
|
handleClick,
|
|
2390
2551
|
handlePaste
|
|
2391
2552
|
]);
|
|
2392
|
-
return /* @__PURE__ */
|
|
2553
|
+
return /* @__PURE__ */ React23.createElement(OTPFieldContext.Provider, { value: contextValue }, children);
|
|
2393
2554
|
};
|
|
2394
2555
|
OTPField.displayName = "OTPField";
|
|
2395
|
-
var OTPFieldGroup =
|
|
2396
|
-
return /* @__PURE__ */
|
|
2556
|
+
var OTPFieldGroup = React23.forwardRef(({ ...props }, ref) => {
|
|
2557
|
+
return /* @__PURE__ */ React23.createElement("span", { ref, className: "flex g-medium-10 align-center", ...props });
|
|
2397
2558
|
});
|
|
2398
2559
|
OTPFieldGroup.displayName = "OTPField.Group";
|
|
2399
2560
|
var OTPFieldSlot = ({
|
|
@@ -2412,10 +2573,12 @@ var OTPFieldSlot = ({
|
|
|
2412
2573
|
handleClick,
|
|
2413
2574
|
handlePaste
|
|
2414
2575
|
} = context;
|
|
2415
|
-
return /* @__PURE__ */
|
|
2576
|
+
return /* @__PURE__ */ React23.createElement(
|
|
2416
2577
|
OTPCell,
|
|
2417
2578
|
{
|
|
2418
|
-
ref: (el) =>
|
|
2579
|
+
ref: (el) => {
|
|
2580
|
+
inputRefs.current[index] = el;
|
|
2581
|
+
},
|
|
2419
2582
|
type: "text",
|
|
2420
2583
|
"data-testid": "otp-field-slot",
|
|
2421
2584
|
"data-active": activeIndex === index,
|
|
@@ -2438,11 +2601,11 @@ OTPField.Group = OTPFieldGroup;
|
|
|
2438
2601
|
OTPField.Slot = OTPFieldSlot;
|
|
2439
2602
|
|
|
2440
2603
|
// src/overlay/index.tsx
|
|
2441
|
-
import
|
|
2604
|
+
import React24 from "react";
|
|
2442
2605
|
|
|
2443
2606
|
// src/overlay/styles/index.ts
|
|
2444
|
-
import
|
|
2445
|
-
var OverlayWrapper =
|
|
2607
|
+
import styled13 from "styled-components";
|
|
2608
|
+
var OverlayWrapper = styled13.div`
|
|
2446
2609
|
@keyframes animate-fade {
|
|
2447
2610
|
0% {
|
|
2448
2611
|
opacity: 0;
|
|
@@ -2470,15 +2633,15 @@ var OverlayWrapper = styled12.div`
|
|
|
2470
2633
|
// src/overlay/index.tsx
|
|
2471
2634
|
var Overlay = (props) => {
|
|
2472
2635
|
const { raw, visible, closeOnInteract, onClick, ...restProps } = props;
|
|
2473
|
-
const [mounted, setMounted] =
|
|
2636
|
+
const [mounted, setMounted] = React24.useState(Boolean(visible));
|
|
2474
2637
|
const handleClick = (event) => {
|
|
2475
2638
|
if (onClick) onClick(event);
|
|
2476
2639
|
if (closeOnInteract) setMounted(false);
|
|
2477
2640
|
};
|
|
2478
|
-
|
|
2641
|
+
React24.useEffect(() => {
|
|
2479
2642
|
if (visible !== mounted) setMounted(Boolean(visible));
|
|
2480
2643
|
}, [visible]);
|
|
2481
|
-
return /* @__PURE__ */
|
|
2644
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, mounted && /* @__PURE__ */ React24.createElement(
|
|
2482
2645
|
OverlayWrapper,
|
|
2483
2646
|
{
|
|
2484
2647
|
tabIndex: -1,
|
|
@@ -2492,13 +2655,13 @@ var Overlay = (props) => {
|
|
|
2492
2655
|
Overlay.displayName = "Overlay";
|
|
2493
2656
|
|
|
2494
2657
|
// src/page/index.tsx
|
|
2495
|
-
import
|
|
2658
|
+
import React25 from "react";
|
|
2496
2659
|
|
|
2497
2660
|
// src/page/styles/index.ts
|
|
2498
|
-
import
|
|
2661
|
+
import styled15 from "styled-components";
|
|
2499
2662
|
|
|
2500
2663
|
// src/scrollarea/styles/index.ts
|
|
2501
|
-
import
|
|
2664
|
+
import styled14, { css as css9 } from "styled-components";
|
|
2502
2665
|
var HiddenScrollbar = css9`
|
|
2503
2666
|
scrollbar-width: none;
|
|
2504
2667
|
|
|
@@ -2543,7 +2706,7 @@ var CustomScrollbar = css9`
|
|
|
2543
2706
|
scrollbar-width: thin;
|
|
2544
2707
|
scrollbar-color: ${({ $thumbColor, $trackColor }) => `${$thumbColor || "var(--font-color-alpha-10)"} ${$trackColor || "transparent"}`};
|
|
2545
2708
|
`;
|
|
2546
|
-
var ScrollAreaWrapper =
|
|
2709
|
+
var ScrollAreaWrapper = styled14.div`
|
|
2547
2710
|
overflow: scroll;
|
|
2548
2711
|
|
|
2549
2712
|
&[data-scrollbar="true"] {
|
|
@@ -2555,11 +2718,11 @@ var ScrollAreaWrapper = styled13.div`
|
|
|
2555
2718
|
`;
|
|
2556
2719
|
|
|
2557
2720
|
// src/page/styles/index.ts
|
|
2558
|
-
var PageRootWrapper =
|
|
2721
|
+
var PageRootWrapper = styled15.div`
|
|
2559
2722
|
height: 100dvh;
|
|
2560
2723
|
width: 100%;
|
|
2561
2724
|
`;
|
|
2562
|
-
var PageNavWrapper =
|
|
2725
|
+
var PageNavWrapper = styled15.nav`
|
|
2563
2726
|
background-color: var(--body-color);
|
|
2564
2727
|
border: var(--measurement-small-10) solid transparent;
|
|
2565
2728
|
border-bottom-color: var(--font-color-alpha-10);
|
|
@@ -2568,7 +2731,7 @@ var PageNavWrapper = styled14.nav`
|
|
|
2568
2731
|
max-height: var(--measurement-large-20);
|
|
2569
2732
|
padding: var(--measurement-medium-30);
|
|
2570
2733
|
`;
|
|
2571
|
-
var PageMenuWrapper =
|
|
2734
|
+
var PageMenuWrapper = styled15.menu`
|
|
2572
2735
|
background-color: var(--body-color);
|
|
2573
2736
|
border: var(--measurement-small-10) solid transparent;
|
|
2574
2737
|
border-bottom-color: var(--font-color-alpha-10);
|
|
@@ -2578,19 +2741,19 @@ var PageMenuWrapper = styled14.menu`
|
|
|
2578
2741
|
margin: 0;
|
|
2579
2742
|
padding: var(--measurement-medium-60) var(--measurement-medium-30);
|
|
2580
2743
|
`;
|
|
2581
|
-
var PagePanelWrapper =
|
|
2744
|
+
var PagePanelWrapper = styled15.aside`
|
|
2582
2745
|
position: absolute;
|
|
2583
2746
|
bottom: 0;
|
|
2584
2747
|
width: 100%;
|
|
2585
2748
|
overflow: scroll;
|
|
2586
2749
|
${HiddenScrollbar}
|
|
2587
2750
|
`;
|
|
2588
|
-
var PageSectionWrapper =
|
|
2751
|
+
var PageSectionWrapper = styled15.div`
|
|
2589
2752
|
background: var(--body-color);
|
|
2590
2753
|
width: 100%;
|
|
2591
2754
|
height: 100%;
|
|
2592
2755
|
`;
|
|
2593
|
-
var PageBodyWrapper =
|
|
2756
|
+
var PageBodyWrapper = styled15.div`
|
|
2594
2757
|
--menus-height: calc(
|
|
2595
2758
|
var(--measurement-large-30) *
|
|
2596
2759
|
${({ $menus }) => $menus ? Number($menus) : 0}
|
|
@@ -2615,12 +2778,12 @@ var PageBodyWrapper = styled14.div`
|
|
|
2615
2778
|
// src/page/index.tsx
|
|
2616
2779
|
var Page = (props) => {
|
|
2617
2780
|
const { children } = props;
|
|
2618
|
-
return /* @__PURE__ */
|
|
2781
|
+
return /* @__PURE__ */ React25.createElement(PageRootWrapper, { className: "flex", ...props }, children);
|
|
2619
2782
|
};
|
|
2620
2783
|
Page.displayName = "Page";
|
|
2621
2784
|
var PageNavigation = (props) => {
|
|
2622
2785
|
const { children } = props;
|
|
2623
|
-
return /* @__PURE__ */
|
|
2786
|
+
return /* @__PURE__ */ React25.createElement(PageNavWrapper, { ...props }, children);
|
|
2624
2787
|
};
|
|
2625
2788
|
PageNavigation.displayName = "Page.Navigation";
|
|
2626
2789
|
var PageTools = (props) => {
|
|
@@ -2642,7 +2805,7 @@ var PageTools = (props) => {
|
|
|
2642
2805
|
const handleClick = (event) => {
|
|
2643
2806
|
if (onClick) onClick(event);
|
|
2644
2807
|
};
|
|
2645
|
-
return /* @__PURE__ */
|
|
2808
|
+
return /* @__PURE__ */ React25.createElement(Toolbar.Root, null, /* @__PURE__ */ React25.createElement(
|
|
2646
2809
|
Toolbar,
|
|
2647
2810
|
{
|
|
2648
2811
|
raw,
|
|
@@ -2654,27 +2817,27 @@ var PageTools = (props) => {
|
|
|
2654
2817
|
defaultOpen,
|
|
2655
2818
|
...props
|
|
2656
2819
|
},
|
|
2657
|
-
/* @__PURE__ */
|
|
2658
|
-
!fixed && /* @__PURE__ */
|
|
2820
|
+
/* @__PURE__ */ React25.createElement(Toolbar.Section, { showoncollapse }, children),
|
|
2821
|
+
!fixed && /* @__PURE__ */ React25.createElement(
|
|
2659
2822
|
Toolbar.Trigger,
|
|
2660
2823
|
{
|
|
2661
2824
|
title: shortcut ? `${bindkey ?? "ctrl"} + ${hotkey}` : "toolbar-trigger",
|
|
2662
2825
|
onClick: handleClick,
|
|
2663
2826
|
...triggerProps
|
|
2664
2827
|
},
|
|
2665
|
-
trigger ?? /* @__PURE__ */
|
|
2828
|
+
trigger ?? /* @__PURE__ */ React25.createElement("span", null, "\u2194")
|
|
2666
2829
|
)
|
|
2667
2830
|
));
|
|
2668
2831
|
};
|
|
2669
2832
|
PageTools.displayName = "Page.Tools";
|
|
2670
2833
|
var PageContent = (props) => {
|
|
2671
2834
|
const { children } = props;
|
|
2672
|
-
return /* @__PURE__ */
|
|
2835
|
+
return /* @__PURE__ */ React25.createElement(ScrollArea, { as: PageSectionWrapper, ...props }, children);
|
|
2673
2836
|
};
|
|
2674
2837
|
PageContent.displayName = "Page.Content";
|
|
2675
2838
|
var PageWrapper = (props) => {
|
|
2676
2839
|
const { children } = props;
|
|
2677
|
-
return /* @__PURE__ */
|
|
2840
|
+
return /* @__PURE__ */ React25.createElement(PageBodyWrapper, { ...props }, children);
|
|
2678
2841
|
};
|
|
2679
2842
|
PageWrapper.displayName = "Page.Wrapper";
|
|
2680
2843
|
var PagePanel = (props) => {
|
|
@@ -2697,7 +2860,7 @@ var PagePanel = (props) => {
|
|
|
2697
2860
|
const handleClick = (event) => {
|
|
2698
2861
|
if (onClick) onClick(event);
|
|
2699
2862
|
};
|
|
2700
|
-
return /* @__PURE__ */
|
|
2863
|
+
return /* @__PURE__ */ React25.createElement(Toolbar.Root, null, /* @__PURE__ */ React25.createElement(
|
|
2701
2864
|
PagePanelWrapper,
|
|
2702
2865
|
{
|
|
2703
2866
|
as: Toolbar,
|
|
@@ -2711,22 +2874,22 @@ var PagePanel = (props) => {
|
|
|
2711
2874
|
defaultOpen,
|
|
2712
2875
|
"aria-label": props["aria-label"]
|
|
2713
2876
|
},
|
|
2714
|
-
!fixed && /* @__PURE__ */
|
|
2877
|
+
!fixed && /* @__PURE__ */ React25.createElement(
|
|
2715
2878
|
Toolbar.Trigger,
|
|
2716
2879
|
{
|
|
2717
2880
|
title: shortcut ? `${bindkey ?? "ctrl"} + ${hotkey}` : "toolbar-trigger",
|
|
2718
2881
|
onClick: handleClick,
|
|
2719
2882
|
...triggerProps
|
|
2720
2883
|
},
|
|
2721
|
-
trigger ?? /* @__PURE__ */
|
|
2884
|
+
trigger ?? /* @__PURE__ */ React25.createElement("span", { style: { transform: "rotate(90deg)" } }, "\u2194")
|
|
2722
2885
|
),
|
|
2723
|
-
/* @__PURE__ */
|
|
2886
|
+
/* @__PURE__ */ React25.createElement(Toolbar.Section, { showoncollapse }, children)
|
|
2724
2887
|
));
|
|
2725
2888
|
};
|
|
2726
2889
|
PagePanel.displayName = "Page.Panel";
|
|
2727
2890
|
var PageMenu = (props) => {
|
|
2728
2891
|
const { children } = props;
|
|
2729
|
-
return /* @__PURE__ */
|
|
2892
|
+
return /* @__PURE__ */ React25.createElement(PageMenuWrapper, { ...props }, children);
|
|
2730
2893
|
};
|
|
2731
2894
|
PageMenu.displayName = "Page.Menu";
|
|
2732
2895
|
Page.Navigation = PageNavigation;
|
|
@@ -2737,14 +2900,14 @@ Page.Panel = PagePanel;
|
|
|
2737
2900
|
Page.Menu = PageMenu;
|
|
2738
2901
|
|
|
2739
2902
|
// src/portal/index.tsx
|
|
2740
|
-
import
|
|
2903
|
+
import React26 from "react";
|
|
2741
2904
|
import { createPortal } from "react-dom";
|
|
2742
2905
|
var Portal = (props) => {
|
|
2743
2906
|
if (typeof document === "undefined") return null;
|
|
2744
2907
|
const { container, children } = props;
|
|
2745
|
-
const [hasMounted, setHasMounted] =
|
|
2746
|
-
const [portalRoot, setPortalRoot] =
|
|
2747
|
-
|
|
2908
|
+
const [hasMounted, setHasMounted] = React26.useState(false);
|
|
2909
|
+
const [portalRoot, setPortalRoot] = React26.useState(null);
|
|
2910
|
+
React26.useEffect(() => {
|
|
2748
2911
|
setHasMounted(true);
|
|
2749
2912
|
setPortalRoot(document.querySelector(`#${container}`));
|
|
2750
2913
|
}, [container]);
|
|
@@ -2754,18 +2917,18 @@ var Portal = (props) => {
|
|
|
2754
2917
|
Portal.displayName = "Portal";
|
|
2755
2918
|
|
|
2756
2919
|
// src/privacy-field/index.tsx
|
|
2757
|
-
import
|
|
2920
|
+
import React27 from "react";
|
|
2758
2921
|
|
|
2759
2922
|
// src/privacy-field/styles/index.ts
|
|
2760
|
-
import
|
|
2761
|
-
var Wrapper =
|
|
2923
|
+
import styled16 from "styled-components";
|
|
2924
|
+
var Wrapper = styled16(Field.Wrapper)`
|
|
2762
2925
|
position: relative;
|
|
2763
2926
|
|
|
2764
2927
|
input {
|
|
2765
2928
|
width: 100% !important;
|
|
2766
2929
|
}
|
|
2767
2930
|
`;
|
|
2768
|
-
var Trigger =
|
|
2931
|
+
var Trigger = styled16(Button)`
|
|
2769
2932
|
position: absolute !important;
|
|
2770
2933
|
right: var(--measurement-medium-50);
|
|
2771
2934
|
top: calc(var(--measurement-medium-50));
|
|
@@ -2778,30 +2941,30 @@ var PrivacyField = ({
|
|
|
2778
2941
|
passwordIcon,
|
|
2779
2942
|
...restProps
|
|
2780
2943
|
}) => {
|
|
2781
|
-
const [type, setType] =
|
|
2944
|
+
const [type, setType] = React27.useState(
|
|
2782
2945
|
defaultType ?? "password"
|
|
2783
2946
|
);
|
|
2784
|
-
const handleChangeType =
|
|
2947
|
+
const handleChangeType = React27.useCallback(() => {
|
|
2785
2948
|
if (type === "text") setType("password");
|
|
2786
2949
|
if (type === "password") setType("text");
|
|
2787
2950
|
}, [type, setType]);
|
|
2788
|
-
return /* @__PURE__ */
|
|
2951
|
+
return /* @__PURE__ */ React27.createElement(Wrapper, { className: "flex" }, /* @__PURE__ */ React27.createElement(Field, { autoComplete: "off", type, ...restProps }), /* @__PURE__ */ React27.createElement(Trigger, { variant: "ghost", sizing: "small", onClick: handleChangeType }, type === "text" && textIcon, type === "password" && passwordIcon));
|
|
2789
2952
|
};
|
|
2790
2953
|
PrivacyField.displayName = "PrivacyField";
|
|
2791
2954
|
|
|
2792
2955
|
// src/resizable/index.tsx
|
|
2793
|
-
import
|
|
2956
|
+
import React28 from "react";
|
|
2794
2957
|
|
|
2795
2958
|
// src/resizable/styles/index.ts
|
|
2796
|
-
import
|
|
2797
|
-
var SplitContainer =
|
|
2959
|
+
import styled17 from "styled-components";
|
|
2960
|
+
var SplitContainer = styled17.div`
|
|
2798
2961
|
position: relative;
|
|
2799
2962
|
`;
|
|
2800
|
-
var Panel =
|
|
2963
|
+
var Panel = styled17.div`
|
|
2801
2964
|
overflow: hidden;
|
|
2802
2965
|
width: ${(props) => props.width}%;
|
|
2803
2966
|
`;
|
|
2804
|
-
var Divider2 =
|
|
2967
|
+
var Divider2 = styled17.div`
|
|
2805
2968
|
width: var(--measurement-medium-10);
|
|
2806
2969
|
height: 100%;
|
|
2807
2970
|
top: 0;
|
|
@@ -2825,14 +2988,14 @@ var Divider2 = styled16.div`
|
|
|
2825
2988
|
height: ${(props) => props.$dragging ? "var(--measurement-large-10)" : "var(--measurement-medium-60)"};
|
|
2826
2989
|
}
|
|
2827
2990
|
`;
|
|
2828
|
-
var DragHandle =
|
|
2991
|
+
var DragHandle = styled17.div`
|
|
2829
2992
|
position: absolute;
|
|
2830
2993
|
top: 0;
|
|
2831
2994
|
bottom: 0;
|
|
2832
2995
|
left: calc(var(--measurement-medium-10) * -1);
|
|
2833
2996
|
right: calc(var(--measurement-medium-10) * -1);
|
|
2834
2997
|
`;
|
|
2835
|
-
var DragIndicator =
|
|
2998
|
+
var DragIndicator = styled17.div`
|
|
2836
2999
|
position: fixed;
|
|
2837
3000
|
width: var(--measurement-medium-10);
|
|
2838
3001
|
/* height: var(--measurement-medium-60); */
|
|
@@ -2842,7 +3005,7 @@ var DragIndicator = styled16.div`
|
|
|
2842
3005
|
opacity: 0;
|
|
2843
3006
|
transition: all 0.2s;
|
|
2844
3007
|
`;
|
|
2845
|
-
var DragOverlay =
|
|
3008
|
+
var DragOverlay = styled17.div`
|
|
2846
3009
|
position: fixed;
|
|
2847
3010
|
top: 0;
|
|
2848
3011
|
left: 0;
|
|
@@ -2858,12 +3021,12 @@ var Resizable = ({
|
|
|
2858
3021
|
left,
|
|
2859
3022
|
right
|
|
2860
3023
|
}) => {
|
|
2861
|
-
const containerRef =
|
|
2862
|
-
const [leftWidth, setLeftWidth] =
|
|
2863
|
-
const [isDragging, setIsDragging] =
|
|
2864
|
-
const handleMouseDown =
|
|
2865
|
-
const handleMouseUp =
|
|
2866
|
-
const handleMouseMove =
|
|
3024
|
+
const containerRef = React28.useRef(null);
|
|
3025
|
+
const [leftWidth, setLeftWidth] = React28.useState(defaultWidth ?? 50);
|
|
3026
|
+
const [isDragging, setIsDragging] = React28.useState(false);
|
|
3027
|
+
const handleMouseDown = React28.useCallback(() => setIsDragging(true), []);
|
|
3028
|
+
const handleMouseUp = React28.useCallback(() => setIsDragging(false), []);
|
|
3029
|
+
const handleMouseMove = React28.useCallback(
|
|
2867
3030
|
(e) => {
|
|
2868
3031
|
if (!isDragging || !containerRef.current) return;
|
|
2869
3032
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
@@ -2877,7 +3040,7 @@ var Resizable = ({
|
|
|
2877
3040
|
},
|
|
2878
3041
|
[isDragging]
|
|
2879
3042
|
);
|
|
2880
|
-
|
|
3043
|
+
React28.useEffect(() => {
|
|
2881
3044
|
if (isDragging) {
|
|
2882
3045
|
document.addEventListener("mousemove", handleMouseMove);
|
|
2883
3046
|
document.addEventListener("mouseup", handleMouseUp);
|
|
@@ -2896,45 +3059,47 @@ var Resizable = ({
|
|
|
2896
3059
|
document.body.style.userSelect = "";
|
|
2897
3060
|
};
|
|
2898
3061
|
}, [isDragging, handleMouseMove, handleMouseUp]);
|
|
2899
|
-
return /* @__PURE__ */
|
|
3062
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(SplitContainer, { ref: containerRef, className: "h-100 flex" }, /* @__PURE__ */ React28.createElement(Panel, { width: leftWidth }, left), /* @__PURE__ */ React28.createElement(
|
|
2900
3063
|
Divider2,
|
|
2901
3064
|
{
|
|
2902
3065
|
$dragging: isDragging,
|
|
2903
3066
|
onMouseDown: handleMouseDown,
|
|
2904
3067
|
onTouchStart: handleMouseDown
|
|
2905
3068
|
},
|
|
2906
|
-
/* @__PURE__ */
|
|
3069
|
+
/* @__PURE__ */ React28.createElement(
|
|
2907
3070
|
DragHandle,
|
|
2908
3071
|
{
|
|
2909
3072
|
className: "flex align-center justify-center",
|
|
2910
3073
|
id: "drag-handle"
|
|
2911
3074
|
},
|
|
2912
|
-
/* @__PURE__ */
|
|
3075
|
+
/* @__PURE__ */ React28.createElement(DragIndicator, { className: "drag-indicator-handle" })
|
|
2913
3076
|
)
|
|
2914
|
-
), /* @__PURE__ */
|
|
3077
|
+
), /* @__PURE__ */ React28.createElement(Panel, { width: 100 - leftWidth }, right)), isDragging && /* @__PURE__ */ React28.createElement(DragOverlay, null));
|
|
2915
3078
|
};
|
|
2916
3079
|
Resizable.displayName = "Resizable";
|
|
2917
3080
|
|
|
2918
3081
|
// src/sheet/index.tsx
|
|
2919
|
-
import
|
|
3082
|
+
import React30 from "react";
|
|
2920
3083
|
|
|
2921
3084
|
// src/sheet/hooks/index.tsx
|
|
2922
|
-
import
|
|
2923
|
-
var SheetContext =
|
|
3085
|
+
import React29 from "react";
|
|
3086
|
+
var SheetContext = React29.createContext({
|
|
2924
3087
|
id: {},
|
|
2925
3088
|
states: {},
|
|
2926
3089
|
methods: {}
|
|
2927
3090
|
});
|
|
2928
|
-
var useSheet = () =>
|
|
2929
|
-
var SheetProvider = ({
|
|
3091
|
+
var useSheet = () => React29.useContext(SheetContext);
|
|
3092
|
+
var SheetProvider = ({
|
|
3093
|
+
children
|
|
3094
|
+
}) => {
|
|
2930
3095
|
const context = useSheetProvider();
|
|
2931
|
-
return /* @__PURE__ */
|
|
3096
|
+
return /* @__PURE__ */ React29.createElement(SheetContext.Provider, { value: context }, children);
|
|
2932
3097
|
};
|
|
2933
3098
|
function useSheetProvider() {
|
|
2934
|
-
const containerId =
|
|
2935
|
-
const triggerId =
|
|
2936
|
-
const controlId =
|
|
2937
|
-
const [open, setOpen] =
|
|
3099
|
+
const containerId = React29.useId();
|
|
3100
|
+
const triggerId = React29.useId();
|
|
3101
|
+
const controlId = React29.useId();
|
|
3102
|
+
const [open, setOpen] = React29.useState(false);
|
|
2938
3103
|
return {
|
|
2939
3104
|
id: {
|
|
2940
3105
|
containerId,
|
|
@@ -2952,7 +3117,7 @@ function useSheetProvider() {
|
|
|
2952
3117
|
}
|
|
2953
3118
|
|
|
2954
3119
|
// src/sheet/styles/index.ts
|
|
2955
|
-
import
|
|
3120
|
+
import styled18, { css as css10 } from "styled-components";
|
|
2956
3121
|
var SheetStyles = css10`
|
|
2957
3122
|
all: unset;
|
|
2958
3123
|
position: fixed;
|
|
@@ -3012,7 +3177,7 @@ var SheetSideStyles = css10`
|
|
|
3012
3177
|
animation-name: slide-left;
|
|
3013
3178
|
}
|
|
3014
3179
|
`;
|
|
3015
|
-
var SheetWrapper =
|
|
3180
|
+
var SheetWrapper = styled18.dialog`
|
|
3016
3181
|
&[data-raw="false"] {
|
|
3017
3182
|
${SheetStyles}
|
|
3018
3183
|
${SheetSideStyles}
|
|
@@ -3022,7 +3187,7 @@ var SheetWrapper = styled17.dialog`
|
|
|
3022
3187
|
|
|
3023
3188
|
// src/sheet/index.tsx
|
|
3024
3189
|
var SheetRoot = ({ children }) => {
|
|
3025
|
-
return /* @__PURE__ */
|
|
3190
|
+
return /* @__PURE__ */ React30.createElement(SheetProvider, null, children);
|
|
3026
3191
|
};
|
|
3027
3192
|
SheetRoot.displayName = "Sheet.Root";
|
|
3028
3193
|
var Sheet = (props) => {
|
|
@@ -3043,16 +3208,16 @@ var Sheet = (props) => {
|
|
|
3043
3208
|
const { id, states, methods } = useSheet();
|
|
3044
3209
|
const { toggle } = methods;
|
|
3045
3210
|
const shortcutControls = useKeyPress(String(hotkey), true, bindkey);
|
|
3046
|
-
|
|
3211
|
+
React30.useEffect(() => {
|
|
3047
3212
|
if (open && toggle) return toggle();
|
|
3048
3213
|
}, [open]);
|
|
3049
|
-
|
|
3214
|
+
React30.useEffect(() => {
|
|
3050
3215
|
if (shortcut && shortcutControls && toggle) {
|
|
3051
3216
|
return toggle();
|
|
3052
3217
|
}
|
|
3053
3218
|
}, [shortcutControls]);
|
|
3054
3219
|
useDisabledScroll(lock && Boolean(states.open));
|
|
3055
|
-
return /* @__PURE__ */
|
|
3220
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, states.open && /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement(
|
|
3056
3221
|
SheetWrapper,
|
|
3057
3222
|
{
|
|
3058
3223
|
role: "dialog",
|
|
@@ -3069,7 +3234,7 @@ var Sheet = (props) => {
|
|
|
3069
3234
|
...restProps
|
|
3070
3235
|
},
|
|
3071
3236
|
children
|
|
3072
|
-
), overlay && /* @__PURE__ */
|
|
3237
|
+
), overlay && /* @__PURE__ */ React30.createElement(
|
|
3073
3238
|
Overlay,
|
|
3074
3239
|
{
|
|
3075
3240
|
onClick: () => toggle && toggle(!states.open),
|
|
@@ -3095,7 +3260,7 @@ var SheetTrigger = (props) => {
|
|
|
3095
3260
|
if (onClick) onClick(event);
|
|
3096
3261
|
if (toggle) toggle(!states.open);
|
|
3097
3262
|
};
|
|
3098
|
-
return /* @__PURE__ */
|
|
3263
|
+
return /* @__PURE__ */ React30.createElement(
|
|
3099
3264
|
Button,
|
|
3100
3265
|
{
|
|
3101
3266
|
id: id.triggerId,
|
|
@@ -3114,14 +3279,76 @@ SheetTrigger.displayName = "Sheet.Trigger";
|
|
|
3114
3279
|
Sheet.Root = SheetRoot;
|
|
3115
3280
|
Sheet.Trigger = SheetTrigger;
|
|
3116
3281
|
|
|
3282
|
+
// src/shimmer/index.tsx
|
|
3283
|
+
import React31 from "react";
|
|
3284
|
+
|
|
3285
|
+
// src/shimmer/styles/index.ts
|
|
3286
|
+
import styled19, { keyframes as keyframes2 } from "styled-components";
|
|
3287
|
+
var shimmer = keyframes2`
|
|
3288
|
+
0% {
|
|
3289
|
+
background-position: 200% center;
|
|
3290
|
+
}
|
|
3291
|
+
100% {
|
|
3292
|
+
background-position: -200% center;
|
|
3293
|
+
}
|
|
3294
|
+
`;
|
|
3295
|
+
var TextShimmerWrapper = styled19.span`
|
|
3296
|
+
background: linear-gradient(
|
|
3297
|
+
90deg,
|
|
3298
|
+
${({ "data-base-color": baseColor }) => baseColor} 0%,
|
|
3299
|
+
${({ "data-shimmer-color": shimmerColor }) => shimmerColor} 40%,
|
|
3300
|
+
${({ "data-base-color": baseColor }) => baseColor} 60%,
|
|
3301
|
+
${({ "data-base-color": baseColor }) => baseColor} 100%
|
|
3302
|
+
);
|
|
3303
|
+
background-size: ${({ "data-spread": spread }) => spread}% auto;
|
|
3304
|
+
background-clip: text;
|
|
3305
|
+
-webkit-background-clip: text;
|
|
3306
|
+
-webkit-text-fill-color: transparent;
|
|
3307
|
+
color: transparent;
|
|
3308
|
+
animation: ${shimmer} ${({ "data-duration": duration }) => duration}s linear
|
|
3309
|
+
infinite;
|
|
3310
|
+
display: inline-block;
|
|
3311
|
+
`;
|
|
3312
|
+
|
|
3313
|
+
// src/shimmer/index.tsx
|
|
3314
|
+
var DEFAULT_DURATION = 2;
|
|
3315
|
+
var DEFAULT_SPREAD = 200;
|
|
3316
|
+
var DEFAULT_SHIMMER_COLOR = "var(--font-color-alpha-60)";
|
|
3317
|
+
var DEFAULT_BASE_COLOR = "var(--font-color-alpha-30)";
|
|
3318
|
+
var Shimmer = (props) => {
|
|
3319
|
+
const {
|
|
3320
|
+
children,
|
|
3321
|
+
raw,
|
|
3322
|
+
duration = DEFAULT_DURATION,
|
|
3323
|
+
spread = DEFAULT_SPREAD,
|
|
3324
|
+
shimmerColor = DEFAULT_SHIMMER_COLOR,
|
|
3325
|
+
baseColor = DEFAULT_BASE_COLOR,
|
|
3326
|
+
...restProps
|
|
3327
|
+
} = props;
|
|
3328
|
+
return /* @__PURE__ */ React31.createElement(
|
|
3329
|
+
TextShimmerWrapper,
|
|
3330
|
+
{
|
|
3331
|
+
"data-raw": Boolean(raw),
|
|
3332
|
+
"data-duration": duration,
|
|
3333
|
+
"data-spread": spread,
|
|
3334
|
+
"data-shimmer-color": shimmerColor,
|
|
3335
|
+
"data-base-color": baseColor,
|
|
3336
|
+
"aria-label": restProps["aria-label"] ?? "shimmer-text",
|
|
3337
|
+
...restProps
|
|
3338
|
+
},
|
|
3339
|
+
children
|
|
3340
|
+
);
|
|
3341
|
+
};
|
|
3342
|
+
Shimmer.displayName = "Shimmer";
|
|
3343
|
+
|
|
3117
3344
|
// src/scrollarea/index.tsx
|
|
3118
|
-
import
|
|
3345
|
+
import React32 from "react";
|
|
3119
3346
|
var ScrollArea = ({
|
|
3120
3347
|
scrollbar = false,
|
|
3121
3348
|
children,
|
|
3122
3349
|
...restProps
|
|
3123
3350
|
}) => {
|
|
3124
|
-
return /* @__PURE__ */
|
|
3351
|
+
return /* @__PURE__ */ React32.createElement(
|
|
3125
3352
|
ScrollAreaWrapper,
|
|
3126
3353
|
{
|
|
3127
3354
|
"aria-hidden": "true",
|
|
@@ -3133,11 +3360,11 @@ var ScrollArea = ({
|
|
|
3133
3360
|
};
|
|
3134
3361
|
|
|
3135
3362
|
// src/spinner/index.tsx
|
|
3136
|
-
import
|
|
3363
|
+
import React33 from "react";
|
|
3137
3364
|
|
|
3138
3365
|
// src/spinner/styles/index.ts
|
|
3139
|
-
import
|
|
3140
|
-
var Rotate =
|
|
3366
|
+
import styled20, { css as css11, keyframes as keyframes3 } from "styled-components";
|
|
3367
|
+
var Rotate = keyframes3`
|
|
3141
3368
|
0% {
|
|
3142
3369
|
transform: rotate(0deg);
|
|
3143
3370
|
}
|
|
@@ -3159,7 +3386,7 @@ var FieldSizeStyles2 = css11`
|
|
|
3159
3386
|
height: var(--measurement-medium-60);
|
|
3160
3387
|
}
|
|
3161
3388
|
`;
|
|
3162
|
-
var RotatingSpinner =
|
|
3389
|
+
var RotatingSpinner = styled20.span`
|
|
3163
3390
|
padding: 0;
|
|
3164
3391
|
margin: 0;
|
|
3165
3392
|
|
|
@@ -3177,15 +3404,15 @@ var RotatingSpinner = styled18.span`
|
|
|
3177
3404
|
|
|
3178
3405
|
// src/spinner/index.tsx
|
|
3179
3406
|
var Spinner = (props) => {
|
|
3180
|
-
return /* @__PURE__ */
|
|
3407
|
+
return /* @__PURE__ */ React33.createElement(RotatingSpinner, { "data-size": props.sizing ?? "medium" });
|
|
3181
3408
|
};
|
|
3182
3409
|
|
|
3183
3410
|
// src/skeleton/index.tsx
|
|
3184
|
-
import
|
|
3411
|
+
import React34 from "react";
|
|
3185
3412
|
|
|
3186
3413
|
// src/skeleton/styles/index.ts
|
|
3187
|
-
import
|
|
3188
|
-
var SkeletonBlink =
|
|
3414
|
+
import styled21, { css as css12, keyframes as keyframes4 } from "styled-components";
|
|
3415
|
+
var SkeletonBlink = keyframes4`
|
|
3189
3416
|
0% {
|
|
3190
3417
|
opacity: 0.3;
|
|
3191
3418
|
}
|
|
@@ -3230,7 +3457,7 @@ var SkeletonShapeStyles = css12`
|
|
|
3230
3457
|
border-radius: var(--measurement-large-90);
|
|
3231
3458
|
}
|
|
3232
3459
|
`;
|
|
3233
|
-
var SkeletonLoader =
|
|
3460
|
+
var SkeletonLoader = styled21.span`
|
|
3234
3461
|
${SkeletonBaseStyles}
|
|
3235
3462
|
${SkeletonSizeStyles}
|
|
3236
3463
|
${SkeletonShapeStyles}
|
|
@@ -3243,7 +3470,7 @@ var Skeleton = (props) => {
|
|
|
3243
3470
|
shape = "smooth",
|
|
3244
3471
|
...restProps
|
|
3245
3472
|
} = props;
|
|
3246
|
-
return /* @__PURE__ */
|
|
3473
|
+
return /* @__PURE__ */ React34.createElement(
|
|
3247
3474
|
SkeletonLoader,
|
|
3248
3475
|
{
|
|
3249
3476
|
"data-size": sizing,
|
|
@@ -3256,24 +3483,26 @@ var Skeleton = (props) => {
|
|
|
3256
3483
|
Skeleton.displayName = "Skeleton";
|
|
3257
3484
|
|
|
3258
3485
|
// src/switch/index.tsx
|
|
3259
|
-
import
|
|
3486
|
+
import React36 from "react";
|
|
3260
3487
|
|
|
3261
3488
|
// src/switch/hooks/index.tsx
|
|
3262
|
-
import
|
|
3263
|
-
var
|
|
3489
|
+
import React35, { useState as useState7, createContext as createContext7, useContext as useContext7 } from "react";
|
|
3490
|
+
var defaultComponentAPI7 = {
|
|
3264
3491
|
id: "",
|
|
3265
3492
|
states: {},
|
|
3266
3493
|
methods: {}
|
|
3267
3494
|
};
|
|
3268
|
-
var SwitchContext =
|
|
3269
|
-
var useSwitch = () =>
|
|
3270
|
-
var SwitchProvider = ({
|
|
3495
|
+
var SwitchContext = createContext7(defaultComponentAPI7);
|
|
3496
|
+
var useSwitch = () => useContext7(SwitchContext);
|
|
3497
|
+
var SwitchProvider = ({
|
|
3498
|
+
children
|
|
3499
|
+
}) => {
|
|
3271
3500
|
const context = useSwitchProvider();
|
|
3272
|
-
return /* @__PURE__ */
|
|
3501
|
+
return /* @__PURE__ */ React35.createElement(SwitchContext.Provider, { value: context }, children);
|
|
3273
3502
|
};
|
|
3274
3503
|
function useSwitchProvider() {
|
|
3275
|
-
const [checked, setChecked] =
|
|
3276
|
-
const switchId =
|
|
3504
|
+
const [checked, setChecked] = useState7(false);
|
|
3505
|
+
const switchId = React35.useId();
|
|
3277
3506
|
return {
|
|
3278
3507
|
id: switchId,
|
|
3279
3508
|
states: {
|
|
@@ -3286,7 +3515,7 @@ function useSwitchProvider() {
|
|
|
3286
3515
|
}
|
|
3287
3516
|
|
|
3288
3517
|
// src/switch/styles/index.ts
|
|
3289
|
-
import
|
|
3518
|
+
import styled22, { css as css13 } from "styled-components";
|
|
3290
3519
|
var SwitchDefaultStyles = css13`
|
|
3291
3520
|
all: unset;
|
|
3292
3521
|
|
|
@@ -3381,14 +3610,14 @@ var SwitchSizeStyles = css13`
|
|
|
3381
3610
|
}
|
|
3382
3611
|
}
|
|
3383
3612
|
`;
|
|
3384
|
-
var TriggerWrapper =
|
|
3613
|
+
var TriggerWrapper = styled22.button`
|
|
3385
3614
|
&[data-raw="false"] {
|
|
3386
3615
|
${SwitchDefaultStyles}
|
|
3387
3616
|
${SwitchVariantsStyles}
|
|
3388
3617
|
${SwitchSizeStyles}
|
|
3389
3618
|
}
|
|
3390
3619
|
`;
|
|
3391
|
-
var Thumb =
|
|
3620
|
+
var Thumb = styled22.span`
|
|
3392
3621
|
&[data-raw="false"] {
|
|
3393
3622
|
all: unset;
|
|
3394
3623
|
display: block;
|
|
@@ -3422,10 +3651,10 @@ var Switch = (props) => {
|
|
|
3422
3651
|
if (onClick) onClick(event);
|
|
3423
3652
|
if (toggleSwitch) toggleSwitch();
|
|
3424
3653
|
};
|
|
3425
|
-
|
|
3654
|
+
React36.useEffect(() => {
|
|
3426
3655
|
if (defaultChecked && toggleSwitch) toggleSwitch();
|
|
3427
3656
|
}, [defaultChecked]);
|
|
3428
|
-
return /* @__PURE__ */
|
|
3657
|
+
return /* @__PURE__ */ React36.createElement(
|
|
3429
3658
|
TriggerWrapper,
|
|
3430
3659
|
{
|
|
3431
3660
|
type: "button",
|
|
@@ -3441,19 +3670,19 @@ var Switch = (props) => {
|
|
|
3441
3670
|
"data-raw": Boolean(raw),
|
|
3442
3671
|
...restProps
|
|
3443
3672
|
},
|
|
3444
|
-
/* @__PURE__ */
|
|
3673
|
+
/* @__PURE__ */ React36.createElement("title", null, "Switch"),
|
|
3445
3674
|
children
|
|
3446
3675
|
);
|
|
3447
3676
|
};
|
|
3448
3677
|
Switch.displayName = "Switch";
|
|
3449
3678
|
var SwitchRoot = ({ children }) => {
|
|
3450
|
-
return /* @__PURE__ */
|
|
3679
|
+
return /* @__PURE__ */ React36.createElement(SwitchProvider, null, children);
|
|
3451
3680
|
};
|
|
3452
3681
|
SwitchRoot.displayName = "Switch.Root";
|
|
3453
3682
|
var SwitchThumb = (props) => {
|
|
3454
3683
|
const { raw, sizing } = props;
|
|
3455
3684
|
const { id, states } = useSwitch();
|
|
3456
|
-
return /* @__PURE__ */
|
|
3685
|
+
return /* @__PURE__ */ React36.createElement(
|
|
3457
3686
|
Thumb,
|
|
3458
3687
|
{
|
|
3459
3688
|
role: "presentation",
|
|
@@ -3473,10 +3702,10 @@ Switch.Root = SwitchRoot;
|
|
|
3473
3702
|
Switch.Thumb = SwitchThumb;
|
|
3474
3703
|
|
|
3475
3704
|
// src/table/index.tsx
|
|
3476
|
-
import
|
|
3705
|
+
import React37 from "react";
|
|
3477
3706
|
|
|
3478
3707
|
// src/table/styles/index.ts
|
|
3479
|
-
import
|
|
3708
|
+
import styled23, { css as css14 } from "styled-components";
|
|
3480
3709
|
var CellStyles = css14`
|
|
3481
3710
|
box-sizing: border-box;
|
|
3482
3711
|
border: none;
|
|
@@ -3487,11 +3716,11 @@ var CellStyles = css14`
|
|
|
3487
3716
|
var(--fontsize-small-10) - ((var(--fontsize-small-10) * 1.066))
|
|
3488
3717
|
);
|
|
3489
3718
|
`;
|
|
3490
|
-
var TableLayer =
|
|
3719
|
+
var TableLayer = styled23.div`
|
|
3491
3720
|
border-radius: var(--measurement-medium-30);
|
|
3492
3721
|
border: var(--measurement-small-10) solid var(--font-color-alpha-10);
|
|
3493
3722
|
`;
|
|
3494
|
-
var TableWrapper =
|
|
3723
|
+
var TableWrapper = styled23.table`
|
|
3495
3724
|
border-collapse: collapse;
|
|
3496
3725
|
|
|
3497
3726
|
tbody {
|
|
@@ -3502,7 +3731,7 @@ var TableWrapper = styled21.table`
|
|
|
3502
3731
|
}
|
|
3503
3732
|
}
|
|
3504
3733
|
`;
|
|
3505
|
-
var RowWrapper =
|
|
3734
|
+
var RowWrapper = styled23.tr`
|
|
3506
3735
|
border-bottom: var(--measurement-small-10) solid var(--font-color-alpha-10);
|
|
3507
3736
|
|
|
3508
3737
|
transition: background-color linear 0.1s;
|
|
@@ -3511,7 +3740,7 @@ var RowWrapper = styled21.tr`
|
|
|
3511
3740
|
background-color: var(--font-color-alpha-10);
|
|
3512
3741
|
}
|
|
3513
3742
|
`;
|
|
3514
|
-
var HeadCellWrapper =
|
|
3743
|
+
var HeadCellWrapper = styled23.th`
|
|
3515
3744
|
font-size: var(--fontsize-medium-10);
|
|
3516
3745
|
${CellStyles}
|
|
3517
3746
|
|
|
@@ -3519,7 +3748,7 @@ var HeadCellWrapper = styled21.th`
|
|
|
3519
3748
|
color: var(--font-color-alpha-60);
|
|
3520
3749
|
}
|
|
3521
3750
|
`;
|
|
3522
|
-
var CellWrapper =
|
|
3751
|
+
var CellWrapper = styled23.td`
|
|
3523
3752
|
${CellStyles}
|
|
3524
3753
|
`;
|
|
3525
3754
|
|
|
@@ -3528,43 +3757,43 @@ var Table = ({
|
|
|
3528
3757
|
children,
|
|
3529
3758
|
...restProps
|
|
3530
3759
|
}) => {
|
|
3531
|
-
return /* @__PURE__ */
|
|
3760
|
+
return /* @__PURE__ */ React37.createElement(ScrollArea, { as: TableLayer, role: "presentation", tabIndex: -1 }, /* @__PURE__ */ React37.createElement(TableWrapper, { ...restProps, cellSpacing: "0", cellPadding: "0" }, children));
|
|
3532
3761
|
};
|
|
3533
3762
|
Table.displayName = "Table";
|
|
3534
3763
|
var TableHead = ({
|
|
3535
3764
|
children,
|
|
3536
3765
|
...restProps
|
|
3537
3766
|
}) => {
|
|
3538
|
-
return /* @__PURE__ */
|
|
3767
|
+
return /* @__PURE__ */ React37.createElement("thead", { ...restProps }, children);
|
|
3539
3768
|
};
|
|
3540
3769
|
TableHead.displayName = "Table.Head";
|
|
3541
3770
|
var TableBody = ({
|
|
3542
3771
|
children,
|
|
3543
3772
|
...restProps
|
|
3544
3773
|
}) => {
|
|
3545
|
-
return /* @__PURE__ */
|
|
3774
|
+
return /* @__PURE__ */ React37.createElement("tbody", { ...restProps }, children);
|
|
3546
3775
|
};
|
|
3547
3776
|
TableBody.displayName = "Table.Body";
|
|
3548
3777
|
var TableHeadCell = ({
|
|
3549
3778
|
children,
|
|
3550
3779
|
...restProps
|
|
3551
3780
|
}) => {
|
|
3552
|
-
return /* @__PURE__ */
|
|
3781
|
+
return /* @__PURE__ */ React37.createElement(HeadCellWrapper, { colSpan: 1, ...restProps }, /* @__PURE__ */ React37.createElement("div", { className: "flex align-center g-medium-30" }, children));
|
|
3553
3782
|
};
|
|
3554
3783
|
TableHeadCell.displayName = "Table.HeadCell";
|
|
3555
3784
|
var TableRow = ({ children, ...restProps }) => {
|
|
3556
|
-
return /* @__PURE__ */
|
|
3785
|
+
return /* @__PURE__ */ React37.createElement(RowWrapper, { className: "p-medium-30", ...restProps }, children);
|
|
3557
3786
|
};
|
|
3558
3787
|
TableRow.displayName = "Table.Row";
|
|
3559
3788
|
var TableCell = ({ children, ...restProps }) => {
|
|
3560
|
-
return /* @__PURE__ */
|
|
3789
|
+
return /* @__PURE__ */ React37.createElement(CellWrapper, { ...restProps }, /* @__PURE__ */ React37.createElement("div", { className: "flex align-center g-medium-30" }, children));
|
|
3561
3790
|
};
|
|
3562
3791
|
TableCell.displayName = "Table.Cell";
|
|
3563
3792
|
var TableFooter = ({
|
|
3564
3793
|
children,
|
|
3565
3794
|
...restProps
|
|
3566
3795
|
}) => {
|
|
3567
|
-
return /* @__PURE__ */
|
|
3796
|
+
return /* @__PURE__ */ React37.createElement("tfoot", { ...restProps }, children);
|
|
3568
3797
|
};
|
|
3569
3798
|
TableFooter.displayName = "Table.Footer";
|
|
3570
3799
|
Table.Head = TableHead;
|
|
@@ -3575,24 +3804,26 @@ Table.Cell = TableCell;
|
|
|
3575
3804
|
Table.Footer = TableFooter;
|
|
3576
3805
|
|
|
3577
3806
|
// src/tabs/index.tsx
|
|
3578
|
-
import
|
|
3807
|
+
import React39, { Children } from "react";
|
|
3579
3808
|
|
|
3580
3809
|
// src/tabs/hooks/index.tsx
|
|
3581
|
-
import
|
|
3582
|
-
var
|
|
3810
|
+
import React38, { createContext as createContext8, useContext as useContext8, useState as useState8 } from "react";
|
|
3811
|
+
var defaultComponentAPI8 = {
|
|
3583
3812
|
id: "",
|
|
3584
3813
|
states: {},
|
|
3585
3814
|
methods: {}
|
|
3586
3815
|
};
|
|
3587
|
-
var TabsContext =
|
|
3588
|
-
var useTabs = () =>
|
|
3589
|
-
var TabsProvider = ({
|
|
3816
|
+
var TabsContext = createContext8(defaultComponentAPI8);
|
|
3817
|
+
var useTabs = () => useContext8(TabsContext);
|
|
3818
|
+
var TabsProvider = ({
|
|
3819
|
+
children
|
|
3820
|
+
}) => {
|
|
3590
3821
|
const context = useTabsProvider();
|
|
3591
|
-
return /* @__PURE__ */
|
|
3822
|
+
return /* @__PURE__ */ React38.createElement(TabsContext.Provider, { value: context }, children);
|
|
3592
3823
|
};
|
|
3593
3824
|
function useTabsProvider() {
|
|
3594
|
-
const [value, setValue] =
|
|
3595
|
-
const tabsId =
|
|
3825
|
+
const [value, setValue] = useState8(null);
|
|
3826
|
+
const tabsId = React38.useId();
|
|
3596
3827
|
return {
|
|
3597
3828
|
id: tabsId,
|
|
3598
3829
|
states: {
|
|
@@ -3606,8 +3837,8 @@ function useTabsProvider() {
|
|
|
3606
3837
|
}
|
|
3607
3838
|
|
|
3608
3839
|
// src/tabs/styles/index.ts
|
|
3609
|
-
import
|
|
3610
|
-
var TabWrapper =
|
|
3840
|
+
import styled24 from "styled-components";
|
|
3841
|
+
var TabWrapper = styled24.div`
|
|
3611
3842
|
button {
|
|
3612
3843
|
&[aria-selected="true"] {
|
|
3613
3844
|
color: var(--font-color) !important;
|
|
@@ -3622,20 +3853,20 @@ var Tabs = (props) => {
|
|
|
3622
3853
|
const { applyValue } = methods;
|
|
3623
3854
|
const childArray = Children.toArray(children);
|
|
3624
3855
|
const firstChild = childArray[0];
|
|
3625
|
-
|
|
3626
|
-
if (
|
|
3856
|
+
React39.useEffect(() => {
|
|
3857
|
+
if (React39.isValidElement(firstChild)) {
|
|
3627
3858
|
if (childArray.length > 0 && applyValue)
|
|
3628
3859
|
applyValue(firstChild.props.value);
|
|
3629
3860
|
}
|
|
3630
3861
|
}, []);
|
|
3631
|
-
|
|
3862
|
+
React39.useEffect(() => {
|
|
3632
3863
|
if (defaultOpen && applyValue) applyValue(defaultOpen);
|
|
3633
3864
|
}, []);
|
|
3634
|
-
return /* @__PURE__ */
|
|
3865
|
+
return /* @__PURE__ */ React39.createElement(TabWrapper, { role: "tablist", ...restProps }, children);
|
|
3635
3866
|
};
|
|
3636
3867
|
Tabs.displayName = "Tabs";
|
|
3637
3868
|
var TabsRoot = ({ children }) => {
|
|
3638
|
-
return /* @__PURE__ */
|
|
3869
|
+
return /* @__PURE__ */ React39.createElement(TabsProvider, null, children);
|
|
3639
3870
|
};
|
|
3640
3871
|
TabsRoot.displayName = "Tabs.Root";
|
|
3641
3872
|
var TabsTrigger = (props) => {
|
|
@@ -3651,7 +3882,7 @@ var TabsTrigger = (props) => {
|
|
|
3651
3882
|
if (applyValue) applyValue(value);
|
|
3652
3883
|
if (onClick) onClick(event);
|
|
3653
3884
|
};
|
|
3654
|
-
return /* @__PURE__ */
|
|
3885
|
+
return /* @__PURE__ */ React39.createElement(
|
|
3655
3886
|
Button,
|
|
3656
3887
|
{
|
|
3657
3888
|
type: "button",
|
|
@@ -3679,7 +3910,7 @@ var TabsContent = (props) => {
|
|
|
3679
3910
|
trigger: getTabsId && getTabsId({ value, type: "trigger" }),
|
|
3680
3911
|
content: getTabsId && getTabsId({ value, type: "content" })
|
|
3681
3912
|
};
|
|
3682
|
-
return /* @__PURE__ */
|
|
3913
|
+
return /* @__PURE__ */ React39.createElement(
|
|
3683
3914
|
"div",
|
|
3684
3915
|
{
|
|
3685
3916
|
tabIndex: 0,
|
|
@@ -3700,10 +3931,10 @@ Tabs.Trigger = TabsTrigger;
|
|
|
3700
3931
|
Tabs.Content = TabsContent;
|
|
3701
3932
|
|
|
3702
3933
|
// src/text-area/index.tsx
|
|
3703
|
-
import
|
|
3934
|
+
import React40 from "react";
|
|
3704
3935
|
|
|
3705
3936
|
// src/text-area/styles/index.ts
|
|
3706
|
-
import
|
|
3937
|
+
import styled25, { css as css15 } from "styled-components";
|
|
3707
3938
|
var CustomScrollbar2 = css15`
|
|
3708
3939
|
height: ${({ $height }) => $height ?? "100%"};
|
|
3709
3940
|
width: ${({ $width }) => $width ?? "100%"};
|
|
@@ -3759,7 +3990,7 @@ var TextareaResizableStyles = css15`
|
|
|
3759
3990
|
resize: none;
|
|
3760
3991
|
}
|
|
3761
3992
|
`;
|
|
3762
|
-
var TextAreaContainer =
|
|
3993
|
+
var TextAreaContainer = styled25.textarea`
|
|
3763
3994
|
&[data-raw="false"] {
|
|
3764
3995
|
${FieldDefaultStyles}
|
|
3765
3996
|
${FieldShapeStyles}
|
|
@@ -3775,7 +4006,7 @@ var TextAreaContainer = styled23.textarea`
|
|
|
3775
4006
|
// src/text-area/index.tsx
|
|
3776
4007
|
var Textarea = (props) => {
|
|
3777
4008
|
const { raw, shape, sizing, variant, resizable, onChange } = props;
|
|
3778
|
-
const textareaRef =
|
|
4009
|
+
const textareaRef = React40.useRef(null);
|
|
3779
4010
|
const adjustHeight = () => {
|
|
3780
4011
|
const textarea = textareaRef.current;
|
|
3781
4012
|
if (textarea) {
|
|
@@ -3790,8 +4021,8 @@ var Textarea = (props) => {
|
|
|
3790
4021
|
adjustHeight();
|
|
3791
4022
|
onChange?.(e);
|
|
3792
4023
|
};
|
|
3793
|
-
|
|
3794
|
-
return /* @__PURE__ */
|
|
4024
|
+
React40.useEffect(() => adjustHeight(), [props.value]);
|
|
4025
|
+
return /* @__PURE__ */ React40.createElement(
|
|
3795
4026
|
TextAreaContainer,
|
|
3796
4027
|
{
|
|
3797
4028
|
ref: textareaRef,
|
|
@@ -3808,22 +4039,22 @@ var Textarea = (props) => {
|
|
|
3808
4039
|
Textarea.displayName = "Textarea";
|
|
3809
4040
|
|
|
3810
4041
|
// src/toggle/index.tsx
|
|
3811
|
-
import
|
|
4042
|
+
import React41 from "react";
|
|
3812
4043
|
var Toggle = (props) => {
|
|
3813
4044
|
const { defaultChecked, onClick, disabled, children, ...restProps } = props;
|
|
3814
|
-
const [checked, setChecked] =
|
|
4045
|
+
const [checked, setChecked] = React41.useState(
|
|
3815
4046
|
defaultChecked ?? false
|
|
3816
4047
|
);
|
|
3817
4048
|
const handleClick = (event) => {
|
|
3818
4049
|
if (onClick) onClick(event);
|
|
3819
4050
|
if (!disabled) setChecked((prevChecked) => !prevChecked);
|
|
3820
4051
|
};
|
|
3821
|
-
|
|
4052
|
+
React41.useEffect(() => {
|
|
3822
4053
|
if (defaultChecked !== void 0) {
|
|
3823
4054
|
setChecked(Boolean(defaultChecked));
|
|
3824
4055
|
}
|
|
3825
4056
|
}, [defaultChecked]);
|
|
3826
|
-
return /* @__PURE__ */
|
|
4057
|
+
return /* @__PURE__ */ React41.createElement(
|
|
3827
4058
|
Button,
|
|
3828
4059
|
{
|
|
3829
4060
|
role: "switch",
|
|
@@ -3841,24 +4072,26 @@ var Toggle = (props) => {
|
|
|
3841
4072
|
Toggle.displayName = "Toggle";
|
|
3842
4073
|
|
|
3843
4074
|
// src/toolbar/index.tsx
|
|
3844
|
-
import
|
|
4075
|
+
import React43 from "react";
|
|
3845
4076
|
|
|
3846
4077
|
// src/toolbar/hooks/index.tsx
|
|
3847
|
-
import
|
|
3848
|
-
var
|
|
4078
|
+
import React42, { useState as useState9, createContext as createContext9, useContext as useContext9 } from "react";
|
|
4079
|
+
var defaultComponentAPI9 = {
|
|
3849
4080
|
id: "",
|
|
3850
4081
|
states: {},
|
|
3851
4082
|
methods: {}
|
|
3852
4083
|
};
|
|
3853
|
-
var ToolbarContext =
|
|
3854
|
-
var useToolbar = () =>
|
|
3855
|
-
var ToolbarProvider = ({
|
|
4084
|
+
var ToolbarContext = createContext9(defaultComponentAPI9);
|
|
4085
|
+
var useToolbar = () => useContext9(ToolbarContext);
|
|
4086
|
+
var ToolbarProvider = ({
|
|
4087
|
+
children
|
|
4088
|
+
}) => {
|
|
3856
4089
|
const context = useToolbarProvider();
|
|
3857
|
-
return /* @__PURE__ */
|
|
4090
|
+
return /* @__PURE__ */ React42.createElement(ToolbarContext.Provider, { value: context }, children);
|
|
3858
4091
|
};
|
|
3859
4092
|
function useToolbarProvider() {
|
|
3860
|
-
const [expanded, setExpanded] =
|
|
3861
|
-
const toolbarId =
|
|
4093
|
+
const [expanded, setExpanded] = useState9(false);
|
|
4094
|
+
const toolbarId = React42.useId();
|
|
3862
4095
|
return {
|
|
3863
4096
|
id: toolbarId,
|
|
3864
4097
|
states: {
|
|
@@ -3871,7 +4104,7 @@ function useToolbarProvider() {
|
|
|
3871
4104
|
}
|
|
3872
4105
|
|
|
3873
4106
|
// src/toolbar/styles/index.ts
|
|
3874
|
-
import
|
|
4107
|
+
import styled26, { css as css16 } from "styled-components";
|
|
3875
4108
|
var ToolbarDefaultStyles = css16`
|
|
3876
4109
|
margin: 0;
|
|
3877
4110
|
display: grid;
|
|
@@ -3984,7 +4217,7 @@ var ToolbarSideStyles = css16`
|
|
|
3984
4217
|
}
|
|
3985
4218
|
}
|
|
3986
4219
|
`;
|
|
3987
|
-
var ToolbarWrapper =
|
|
4220
|
+
var ToolbarWrapper = styled26.menu`
|
|
3988
4221
|
&[data-raw="false"] {
|
|
3989
4222
|
${ToolbarDefaultStyles}
|
|
3990
4223
|
${ToolbarSizeStyles}
|
|
@@ -3992,7 +4225,7 @@ var ToolbarWrapper = styled24.menu`
|
|
|
3992
4225
|
${ToolbarSideStyles}
|
|
3993
4226
|
}
|
|
3994
4227
|
`;
|
|
3995
|
-
var ToolbarTriggerWrapper =
|
|
4228
|
+
var ToolbarTriggerWrapper = styled26.menu`
|
|
3996
4229
|
&[data-raw="false"] {
|
|
3997
4230
|
all: unset;
|
|
3998
4231
|
align-self: flex-end;
|
|
@@ -4017,13 +4250,13 @@ var Toolbar = (props) => {
|
|
|
4017
4250
|
const { toggleToolbar } = methods;
|
|
4018
4251
|
const shortcutControls = useKeyPress(String(hotkey), true, bindkey);
|
|
4019
4252
|
const orientation = side && ["left", "right"].includes(side) ? "vertical" : "horizontal";
|
|
4020
|
-
|
|
4253
|
+
React43.useEffect(() => {
|
|
4021
4254
|
if (defaultOpen && toggleToolbar) return toggleToolbar(true);
|
|
4022
4255
|
}, [defaultOpen]);
|
|
4023
|
-
|
|
4256
|
+
React43.useEffect(() => {
|
|
4024
4257
|
if (shortcut && shortcutControls && toggleToolbar) toggleToolbar();
|
|
4025
4258
|
}, [shortcutControls]);
|
|
4026
|
-
return /* @__PURE__ */
|
|
4259
|
+
return /* @__PURE__ */ React43.createElement(
|
|
4027
4260
|
ToolbarWrapper,
|
|
4028
4261
|
{
|
|
4029
4262
|
id,
|
|
@@ -4043,7 +4276,7 @@ var Toolbar = (props) => {
|
|
|
4043
4276
|
};
|
|
4044
4277
|
Toolbar.displayName = "Toolbar";
|
|
4045
4278
|
var ToolbarRoot = ({ children }) => {
|
|
4046
|
-
return /* @__PURE__ */
|
|
4279
|
+
return /* @__PURE__ */ React43.createElement(ToolbarProvider, null, children);
|
|
4047
4280
|
};
|
|
4048
4281
|
ToolbarRoot.displayName = "Toolbar.Root";
|
|
4049
4282
|
var ToolbarTrigger = (props) => {
|
|
@@ -4061,7 +4294,7 @@ var ToolbarTrigger = (props) => {
|
|
|
4061
4294
|
if (onClick) onClick(event);
|
|
4062
4295
|
if (toggleToolbar) toggleToolbar(!states.expanded);
|
|
4063
4296
|
};
|
|
4064
|
-
return /* @__PURE__ */
|
|
4297
|
+
return /* @__PURE__ */ React43.createElement(ToolbarTriggerWrapper, { "data-raw": Boolean(raw) }, /* @__PURE__ */ React43.createElement(
|
|
4065
4298
|
Button,
|
|
4066
4299
|
{
|
|
4067
4300
|
id: `${id}-trigger`,
|
|
@@ -4079,13 +4312,13 @@ var ToolbarSection = (props) => {
|
|
|
4079
4312
|
const { showoncollapse, children, ...restProps } = props;
|
|
4080
4313
|
const { states } = useToolbar();
|
|
4081
4314
|
const { expanded } = states;
|
|
4082
|
-
if (showoncollapse) return /* @__PURE__ */
|
|
4083
|
-
return /* @__PURE__ */
|
|
4315
|
+
if (showoncollapse) return /* @__PURE__ */ React43.createElement("section", { ...restProps }, children);
|
|
4316
|
+
return /* @__PURE__ */ React43.createElement("section", { ...restProps }, expanded && children);
|
|
4084
4317
|
};
|
|
4085
4318
|
ToolbarSection.displayName = "Toolbar.Section";
|
|
4086
4319
|
var ToolbarItem = (props) => {
|
|
4087
4320
|
const { showfirstchild, onClick, children, ...restProps } = props;
|
|
4088
|
-
const childArray =
|
|
4321
|
+
const childArray = React43.Children.toArray(children);
|
|
4089
4322
|
const { id, states, methods } = useToolbar();
|
|
4090
4323
|
const { expanded } = states;
|
|
4091
4324
|
const { toggleToolbar } = methods;
|
|
@@ -4094,7 +4327,7 @@ var ToolbarItem = (props) => {
|
|
|
4094
4327
|
if (onClick) onClick(event);
|
|
4095
4328
|
if (toggleToolbar && !expanded) toggleToolbar(true);
|
|
4096
4329
|
};
|
|
4097
|
-
return /* @__PURE__ */
|
|
4330
|
+
return /* @__PURE__ */ React43.createElement(
|
|
4098
4331
|
"div",
|
|
4099
4332
|
{
|
|
4100
4333
|
tabIndex: -1,
|
|
@@ -4115,11 +4348,11 @@ Toolbar.Item = ToolbarItem;
|
|
|
4115
4348
|
Toolbar.Section = ToolbarSection;
|
|
4116
4349
|
|
|
4117
4350
|
// src/tooltip/index.tsx
|
|
4118
|
-
import
|
|
4351
|
+
import React44 from "react";
|
|
4119
4352
|
|
|
4120
4353
|
// src/tooltip/styles/index.ts
|
|
4121
|
-
import
|
|
4122
|
-
var FadeIn2 =
|
|
4354
|
+
import styled27, { keyframes as keyframes5 } from "styled-components";
|
|
4355
|
+
var FadeIn2 = keyframes5`
|
|
4123
4356
|
0% {
|
|
4124
4357
|
opacity: 0;
|
|
4125
4358
|
}
|
|
@@ -4127,11 +4360,11 @@ var FadeIn2 = keyframes4`
|
|
|
4127
4360
|
opacity: 1;
|
|
4128
4361
|
}
|
|
4129
4362
|
`;
|
|
4130
|
-
var ContentBox =
|
|
4363
|
+
var ContentBox = styled27.div`
|
|
4131
4364
|
display: inline-block;
|
|
4132
4365
|
position: relative;
|
|
4133
4366
|
`;
|
|
4134
|
-
var ContentWrapper2 =
|
|
4367
|
+
var ContentWrapper2 = styled27.span`
|
|
4135
4368
|
&[data-raw="false"] {
|
|
4136
4369
|
width: fit-content;
|
|
4137
4370
|
max-width: var(--measurement-large-60);
|
|
@@ -4162,13 +4395,13 @@ var Tooltip = ({
|
|
|
4162
4395
|
children,
|
|
4163
4396
|
...restProps
|
|
4164
4397
|
}) => {
|
|
4165
|
-
const [visible, setVisible] =
|
|
4166
|
-
const [triggerProps, setTriggerProps] =
|
|
4167
|
-
const [contentProps, setContentProps] =
|
|
4168
|
-
const mounted =
|
|
4169
|
-
const containerRef =
|
|
4170
|
-
const contentRef =
|
|
4171
|
-
const timeoutRef =
|
|
4398
|
+
const [visible, setVisible] = React44.useState(false);
|
|
4399
|
+
const [triggerProps, setTriggerProps] = React44.useState(null);
|
|
4400
|
+
const [contentProps, setContentProps] = React44.useState(null);
|
|
4401
|
+
const mounted = React44.useRef(false);
|
|
4402
|
+
const containerRef = React44.useRef(null);
|
|
4403
|
+
const contentRef = React44.useRef(null);
|
|
4404
|
+
const timeoutRef = React44.useRef(null);
|
|
4172
4405
|
const contentRect = () => contentRef?.current?.getBoundingClientRect();
|
|
4173
4406
|
const bodyRect = () => {
|
|
4174
4407
|
if (typeof document !== "undefined") {
|
|
@@ -4192,14 +4425,14 @@ var Tooltip = ({
|
|
|
4192
4425
|
};
|
|
4193
4426
|
const hasEnoughHorizontalSpace = Number(dimensions.body_width) - Number(dimensions.content_left) > Number(dimensions.content_width) * 1.1;
|
|
4194
4427
|
const hasEnoughVerticalSpace = Number(dimensions.body_height) - Number(dimensions.content_bottom) > Number(dimensions.content_height) * 0.9;
|
|
4195
|
-
const showTooltip =
|
|
4428
|
+
const showTooltip = React44.useCallback(() => {
|
|
4196
4429
|
timeoutRef.current = setTimeout(() => setVisible(true), delay);
|
|
4197
4430
|
}, [delay]);
|
|
4198
|
-
const hideTooltip =
|
|
4431
|
+
const hideTooltip = React44.useCallback(() => {
|
|
4199
4432
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
4200
4433
|
setVisible(false);
|
|
4201
4434
|
}, []);
|
|
4202
|
-
const handleMouseEnter =
|
|
4435
|
+
const handleMouseEnter = React44.useCallback(() => {
|
|
4203
4436
|
const rect = containerRef.current?.getBoundingClientRect();
|
|
4204
4437
|
if (rect) {
|
|
4205
4438
|
setTriggerProps({
|
|
@@ -4213,11 +4446,11 @@ var Tooltip = ({
|
|
|
4213
4446
|
showTooltip();
|
|
4214
4447
|
}
|
|
4215
4448
|
}, [showTooltip]);
|
|
4216
|
-
const handleMouseLeave =
|
|
4449
|
+
const handleMouseLeave = React44.useCallback(
|
|
4217
4450
|
() => hideTooltip(),
|
|
4218
4451
|
[hideTooltip]
|
|
4219
4452
|
);
|
|
4220
|
-
|
|
4453
|
+
React44.useEffect(() => {
|
|
4221
4454
|
mounted.current = true;
|
|
4222
4455
|
setContentProps && setContentProps({
|
|
4223
4456
|
top: Number(contentRect()?.top),
|
|
@@ -4231,7 +4464,7 @@ var Tooltip = ({
|
|
|
4231
4464
|
mounted.current = false;
|
|
4232
4465
|
};
|
|
4233
4466
|
}, [visible]);
|
|
4234
|
-
return /* @__PURE__ */
|
|
4467
|
+
return /* @__PURE__ */ React44.createElement(
|
|
4235
4468
|
ContentBox,
|
|
4236
4469
|
{
|
|
4237
4470
|
ref: containerRef,
|
|
@@ -4241,7 +4474,7 @@ var Tooltip = ({
|
|
|
4241
4474
|
...restProps
|
|
4242
4475
|
},
|
|
4243
4476
|
children,
|
|
4244
|
-
visible && /* @__PURE__ */
|
|
4477
|
+
visible && /* @__PURE__ */ React44.createElement(
|
|
4245
4478
|
ContentWrapper2,
|
|
4246
4479
|
{
|
|
4247
4480
|
ref: contentRef,
|
|
@@ -4256,11 +4489,223 @@ var Tooltip = ({
|
|
|
4256
4489
|
"data-side": hasEnoughHorizontalSpace ? "left" /* Left */ : "right" /* Right */,
|
|
4257
4490
|
"data-align": hasEnoughHorizontalSpace ? "left" /* Left */ : "right" /* Right */
|
|
4258
4491
|
},
|
|
4259
|
-
/* @__PURE__ */
|
|
4492
|
+
/* @__PURE__ */ React44.createElement("div", null, content)
|
|
4260
4493
|
)
|
|
4261
4494
|
);
|
|
4262
4495
|
};
|
|
4263
4496
|
Tooltip.displayName = "Tooltip";
|
|
4497
|
+
|
|
4498
|
+
// src/tree/index.tsx
|
|
4499
|
+
import React47 from "react";
|
|
4500
|
+
|
|
4501
|
+
// src/tree/hooks/tree-provider.tsx
|
|
4502
|
+
import React45, { useState as useState10, createContext as createContext10, useContext as useContext10 } from "react";
|
|
4503
|
+
var defaultTreeAPI = {
|
|
4504
|
+
id: "",
|
|
4505
|
+
states: {},
|
|
4506
|
+
methods: {}
|
|
4507
|
+
};
|
|
4508
|
+
var TreeContext = createContext10(defaultTreeAPI);
|
|
4509
|
+
var useTree = () => useContext10(TreeContext);
|
|
4510
|
+
var TreeProvider = ({
|
|
4511
|
+
children,
|
|
4512
|
+
defaultExpandedIds = [],
|
|
4513
|
+
onSelectionChange
|
|
4514
|
+
}) => {
|
|
4515
|
+
const context = useTreeProviderContext({
|
|
4516
|
+
defaultExpandedIds,
|
|
4517
|
+
onSelectionChange
|
|
4518
|
+
});
|
|
4519
|
+
return /* @__PURE__ */ React45.createElement(TreeContext.Provider, { value: context }, children);
|
|
4520
|
+
};
|
|
4521
|
+
function useTreeProviderContext({
|
|
4522
|
+
defaultExpandedIds,
|
|
4523
|
+
onSelectionChange
|
|
4524
|
+
}) {
|
|
4525
|
+
const treeId = React45.useId();
|
|
4526
|
+
const [expandedIds, setExpandedIds] = useState10(
|
|
4527
|
+
() => new Set(defaultExpandedIds)
|
|
4528
|
+
);
|
|
4529
|
+
const [selectedIds, setSelectedIds] = useState10(() => /* @__PURE__ */ new Set());
|
|
4530
|
+
return {
|
|
4531
|
+
id: treeId,
|
|
4532
|
+
states: {
|
|
4533
|
+
expandedIds,
|
|
4534
|
+
selectedIds
|
|
4535
|
+
},
|
|
4536
|
+
methods: {
|
|
4537
|
+
isExpanded: (id) => expandedIds.has(id),
|
|
4538
|
+
isSelected: (id) => selectedIds.has(id),
|
|
4539
|
+
toggleExpanded: (id) => {
|
|
4540
|
+
setExpandedIds((prev) => {
|
|
4541
|
+
const next = new Set(prev);
|
|
4542
|
+
next.has(id) ? next.delete(id) : next.add(id);
|
|
4543
|
+
return next;
|
|
4544
|
+
});
|
|
4545
|
+
},
|
|
4546
|
+
toggleSelected: (id) => {
|
|
4547
|
+
setSelectedIds((prev) => {
|
|
4548
|
+
const next = new Set(prev);
|
|
4549
|
+
next.has(id) ? next.delete(id) : next.add(id);
|
|
4550
|
+
onSelectionChange?.(Array.from(next));
|
|
4551
|
+
return next;
|
|
4552
|
+
});
|
|
4553
|
+
},
|
|
4554
|
+
getTreeId: ({ nodeId, type }) => `${treeId}-${type}-${nodeId}`
|
|
4555
|
+
}
|
|
4556
|
+
};
|
|
4557
|
+
}
|
|
4558
|
+
|
|
4559
|
+
// src/tree/hooks/tree-node-provider.tsx
|
|
4560
|
+
import React46, { createContext as createContext11, useContext as useContext11 } from "react";
|
|
4561
|
+
var defaultTreeNodeAPI = {
|
|
4562
|
+
id: "",
|
|
4563
|
+
states: {},
|
|
4564
|
+
methods: {}
|
|
4565
|
+
};
|
|
4566
|
+
var TreeNodeContext = createContext11(defaultTreeNodeAPI);
|
|
4567
|
+
var useTreeNode = () => useContext11(TreeNodeContext);
|
|
4568
|
+
var TreeNodeProvider = ({
|
|
4569
|
+
children,
|
|
4570
|
+
nodeId,
|
|
4571
|
+
level,
|
|
4572
|
+
isLast
|
|
4573
|
+
}) => {
|
|
4574
|
+
const context = useTreeNodeProviderContext({ nodeId, level, isLast });
|
|
4575
|
+
return /* @__PURE__ */ React46.createElement(TreeNodeContext.Provider, { value: context }, children);
|
|
4576
|
+
};
|
|
4577
|
+
function useTreeNodeProviderContext({
|
|
4578
|
+
nodeId,
|
|
4579
|
+
level,
|
|
4580
|
+
isLast
|
|
4581
|
+
}) {
|
|
4582
|
+
return {
|
|
4583
|
+
id: nodeId,
|
|
4584
|
+
states: {
|
|
4585
|
+
nodeId,
|
|
4586
|
+
level,
|
|
4587
|
+
isLast
|
|
4588
|
+
},
|
|
4589
|
+
methods: {}
|
|
4590
|
+
};
|
|
4591
|
+
}
|
|
4592
|
+
|
|
4593
|
+
// src/tree/styles/index.ts
|
|
4594
|
+
import styled28 from "styled-components";
|
|
4595
|
+
var TreeView = styled28.ul`
|
|
4596
|
+
display: flex;
|
|
4597
|
+
flex-direction: column;
|
|
4598
|
+
list-style: none;
|
|
4599
|
+
margin: 0;
|
|
4600
|
+
padding: 0;
|
|
4601
|
+
`;
|
|
4602
|
+
var TreeItem = styled28.li`
|
|
4603
|
+
display: flex;
|
|
4604
|
+
flex-direction: column;
|
|
4605
|
+
list-style: none;
|
|
4606
|
+
`;
|
|
4607
|
+
var TreeNodeContent = styled28.ul`
|
|
4608
|
+
display: flex;
|
|
4609
|
+
flex-direction: column;
|
|
4610
|
+
list-style: none;
|
|
4611
|
+
margin: 0;
|
|
4612
|
+
padding: 0;
|
|
4613
|
+
`;
|
|
4614
|
+
|
|
4615
|
+
// src/tree/index.tsx
|
|
4616
|
+
var Tree = (props) => {
|
|
4617
|
+
const { children, ...restProps } = props;
|
|
4618
|
+
const { id } = useTree();
|
|
4619
|
+
return /* @__PURE__ */ React47.createElement(TreeView, { id, role: "tree", ...restProps }, children);
|
|
4620
|
+
};
|
|
4621
|
+
Tree.displayName = "Tree";
|
|
4622
|
+
var TreeRoot = ({
|
|
4623
|
+
children,
|
|
4624
|
+
defaultExpandedIds,
|
|
4625
|
+
onSelectionChange
|
|
4626
|
+
}) => {
|
|
4627
|
+
return /* @__PURE__ */ React47.createElement(
|
|
4628
|
+
TreeProvider,
|
|
4629
|
+
{
|
|
4630
|
+
defaultExpandedIds,
|
|
4631
|
+
onSelectionChange
|
|
4632
|
+
},
|
|
4633
|
+
children
|
|
4634
|
+
);
|
|
4635
|
+
};
|
|
4636
|
+
TreeRoot.displayName = "Tree.Root";
|
|
4637
|
+
var TreeNode = (props) => {
|
|
4638
|
+
const { nodeId, level = 0, isLast = false, children, ...restProps } = props;
|
|
4639
|
+
return /* @__PURE__ */ React47.createElement(TreeNodeProvider, { nodeId, level, isLast }, /* @__PURE__ */ React47.createElement(TreeItem, { role: "treeitem", "aria-level": level + 1, ...restProps }, children));
|
|
4640
|
+
};
|
|
4641
|
+
TreeNode.displayName = "Tree.Node";
|
|
4642
|
+
var TreeTrigger = (props) => {
|
|
4643
|
+
const { nodeId, disabled, onClick, children, ...restProps } = props;
|
|
4644
|
+
const { methods } = useTree();
|
|
4645
|
+
const { getTreeId, toggleExpanded, toggleSelected } = methods;
|
|
4646
|
+
const isExpanded = methods.isExpanded && methods.isExpanded(nodeId);
|
|
4647
|
+
const isSelected = methods.isSelected && methods.isSelected(nodeId);
|
|
4648
|
+
const IdHandler = {
|
|
4649
|
+
trigger: getTreeId && getTreeId({ nodeId, type: "trigger" }),
|
|
4650
|
+
content: getTreeId && getTreeId({ nodeId, type: "content" })
|
|
4651
|
+
};
|
|
4652
|
+
const { states: nodeStates } = useTreeNode();
|
|
4653
|
+
const level = nodeStates.level ?? 0;
|
|
4654
|
+
const handleClick = (event) => {
|
|
4655
|
+
if (!disabled) {
|
|
4656
|
+
onClick && onClick(event);
|
|
4657
|
+
toggleExpanded && toggleExpanded(nodeId);
|
|
4658
|
+
toggleSelected && toggleSelected(nodeId);
|
|
4659
|
+
}
|
|
4660
|
+
};
|
|
4661
|
+
return /* @__PURE__ */ React47.createElement(
|
|
4662
|
+
Button,
|
|
4663
|
+
{
|
|
4664
|
+
id: String(IdHandler.trigger),
|
|
4665
|
+
disabled: disabled ?? false,
|
|
4666
|
+
onClick: handleClick,
|
|
4667
|
+
"data-state": isExpanded ? "expanded" : "collapsed",
|
|
4668
|
+
"data-selected": isSelected || void 0,
|
|
4669
|
+
variant: props.variant ?? "ghost" /* Ghost */,
|
|
4670
|
+
style: { paddingLeft: `calc(${level} * 1rem + 0.5rem)` },
|
|
4671
|
+
rawicon: true,
|
|
4672
|
+
...restProps
|
|
4673
|
+
},
|
|
4674
|
+
children
|
|
4675
|
+
);
|
|
4676
|
+
};
|
|
4677
|
+
TreeTrigger.displayName = "Tree.Trigger";
|
|
4678
|
+
var TreeContent = (props) => {
|
|
4679
|
+
const { nodeId, defaultOpen = false, children, ...restProps } = props;
|
|
4680
|
+
const { methods } = useTree();
|
|
4681
|
+
const { getTreeId, toggleExpanded } = methods;
|
|
4682
|
+
const isExpanded = methods.isExpanded && methods.isExpanded(nodeId);
|
|
4683
|
+
const IdHandler = {
|
|
4684
|
+
trigger: getTreeId && getTreeId({ nodeId, type: "trigger" }),
|
|
4685
|
+
content: getTreeId && getTreeId({ nodeId, type: "content" })
|
|
4686
|
+
};
|
|
4687
|
+
React47.useEffect(() => {
|
|
4688
|
+
if (defaultOpen && !isExpanded && toggleExpanded) toggleExpanded(nodeId);
|
|
4689
|
+
}, []);
|
|
4690
|
+
if (isExpanded)
|
|
4691
|
+
return /* @__PURE__ */ React47.createElement(
|
|
4692
|
+
TreeNodeContent,
|
|
4693
|
+
{
|
|
4694
|
+
role: "group",
|
|
4695
|
+
id: String(IdHandler.content),
|
|
4696
|
+
"aria-labelledby": String(IdHandler.trigger),
|
|
4697
|
+
"data-nodeId": nodeId,
|
|
4698
|
+
...restProps
|
|
4699
|
+
},
|
|
4700
|
+
children
|
|
4701
|
+
);
|
|
4702
|
+
return /* @__PURE__ */ React47.createElement(React47.Fragment, null);
|
|
4703
|
+
};
|
|
4704
|
+
TreeContent.displayName = "Tree.Content";
|
|
4705
|
+
Tree.Root = TreeRoot;
|
|
4706
|
+
Tree.Node = TreeNode;
|
|
4707
|
+
Tree.Trigger = TreeTrigger;
|
|
4708
|
+
Tree.Content = TreeContent;
|
|
4264
4709
|
export {
|
|
4265
4710
|
Accordion,
|
|
4266
4711
|
AccordionContent,
|
|
@@ -4302,6 +4747,10 @@ export {
|
|
|
4302
4747
|
FieldMeta,
|
|
4303
4748
|
FieldRoot,
|
|
4304
4749
|
FieldWrapper,
|
|
4750
|
+
MessageBubble,
|
|
4751
|
+
MessageBubbleContent,
|
|
4752
|
+
MessageBubbleMeta,
|
|
4753
|
+
MessageBubbleRoot,
|
|
4305
4754
|
MetaVariantEnum,
|
|
4306
4755
|
OTPField,
|
|
4307
4756
|
OTPFieldSlot,
|
|
@@ -4320,6 +4769,7 @@ export {
|
|
|
4320
4769
|
Sheet,
|
|
4321
4770
|
SheetRoot,
|
|
4322
4771
|
SheetTrigger,
|
|
4772
|
+
Shimmer,
|
|
4323
4773
|
Skeleton,
|
|
4324
4774
|
Spinner,
|
|
4325
4775
|
Switch,
|
|
@@ -4344,14 +4794,22 @@ export {
|
|
|
4344
4794
|
ToolbarSection,
|
|
4345
4795
|
ToolbarTrigger,
|
|
4346
4796
|
Tooltip,
|
|
4797
|
+
Tree,
|
|
4798
|
+
TreeContent,
|
|
4799
|
+
TreeNode,
|
|
4800
|
+
TreeRoot,
|
|
4801
|
+
TreeTrigger,
|
|
4347
4802
|
useAccordion,
|
|
4348
4803
|
useCheckbox,
|
|
4349
4804
|
useCollapsible,
|
|
4350
4805
|
useDialog,
|
|
4351
4806
|
useDropdownMenu,
|
|
4352
4807
|
useField,
|
|
4808
|
+
useMessageBubble,
|
|
4353
4809
|
useSheet,
|
|
4354
4810
|
useSwitch,
|
|
4355
4811
|
useTabs,
|
|
4356
|
-
useToolbar
|
|
4812
|
+
useToolbar,
|
|
4813
|
+
useTree,
|
|
4814
|
+
useTreeNode
|
|
4357
4815
|
};
|