@liner-fe/prism 2.1.52 → 2.1.53
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/lib/components/CheckBox/index.d.ts +1 -1
- package/lib/components/Label/index.d.ts +1 -1
- package/lib/components/Popover/index.d.ts +1 -1
- package/lib/components/Radio/index.d.ts +1 -1
- package/lib/components/Select/index.d.ts +1 -1
- package/lib/components/Slider/index.d.ts +1 -1
- package/lib/components/Tooltip/index.d.ts +2 -3
- package/lib/illust.js +10 -41
- package/lib/illust.js.map +4 -4
- package/lib/{index.mjs → index.js} +1778 -279
- package/lib/{index.mjs.map → index.js.map} +4 -4
- package/package.json +5 -15
- package/lib/index.cjs +0 -10242
- package/lib/index.cjs.map +0 -7
|
@@ -8352,8 +8352,1445 @@ var useToast = /* @__PURE__ */ __name(() => {
|
|
|
8352
8352
|
};
|
|
8353
8353
|
}, "useToast");
|
|
8354
8354
|
|
|
8355
|
-
//
|
|
8356
|
-
import
|
|
8355
|
+
// ../../node_modules/@radix-ui/react-toast/dist/index.mjs
|
|
8356
|
+
import * as React14 from "react";
|
|
8357
|
+
import * as ReactDOM3 from "react-dom";
|
|
8358
|
+
|
|
8359
|
+
// ../../node_modules/@radix-ui/primitive/dist/index.mjs
|
|
8360
|
+
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
8361
|
+
return /* @__PURE__ */ __name(function handleEvent(event) {
|
|
8362
|
+
originalEventHandler?.(event);
|
|
8363
|
+
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
8364
|
+
return ourEventHandler?.(event);
|
|
8365
|
+
}
|
|
8366
|
+
}, "handleEvent");
|
|
8367
|
+
}
|
|
8368
|
+
__name(composeEventHandlers, "composeEventHandlers");
|
|
8369
|
+
|
|
8370
|
+
// ../../node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
8371
|
+
import * as React from "react";
|
|
8372
|
+
function setRef(ref, value) {
|
|
8373
|
+
if (typeof ref === "function") {
|
|
8374
|
+
return ref(value);
|
|
8375
|
+
} else if (ref !== null && ref !== void 0) {
|
|
8376
|
+
ref.current = value;
|
|
8377
|
+
}
|
|
8378
|
+
}
|
|
8379
|
+
__name(setRef, "setRef");
|
|
8380
|
+
function composeRefs(...refs) {
|
|
8381
|
+
return (node) => {
|
|
8382
|
+
let hasCleanup = false;
|
|
8383
|
+
const cleanups = refs.map((ref) => {
|
|
8384
|
+
const cleanup = setRef(ref, node);
|
|
8385
|
+
if (!hasCleanup && typeof cleanup == "function") {
|
|
8386
|
+
hasCleanup = true;
|
|
8387
|
+
}
|
|
8388
|
+
return cleanup;
|
|
8389
|
+
});
|
|
8390
|
+
if (hasCleanup) {
|
|
8391
|
+
return () => {
|
|
8392
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
8393
|
+
const cleanup = cleanups[i];
|
|
8394
|
+
if (typeof cleanup == "function") {
|
|
8395
|
+
cleanup();
|
|
8396
|
+
} else {
|
|
8397
|
+
setRef(refs[i], null);
|
|
8398
|
+
}
|
|
8399
|
+
}
|
|
8400
|
+
};
|
|
8401
|
+
}
|
|
8402
|
+
};
|
|
8403
|
+
}
|
|
8404
|
+
__name(composeRefs, "composeRefs");
|
|
8405
|
+
function useComposedRefs(...refs) {
|
|
8406
|
+
return React.useCallback(composeRefs(...refs), refs);
|
|
8407
|
+
}
|
|
8408
|
+
__name(useComposedRefs, "useComposedRefs");
|
|
8409
|
+
|
|
8410
|
+
// ../../node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
8411
|
+
import React4 from "react";
|
|
8412
|
+
|
|
8413
|
+
// ../../node_modules/@radix-ui/react-context/dist/index.mjs
|
|
8414
|
+
import * as React2 from "react";
|
|
8415
|
+
import { jsx as jsx168 } from "react/jsx-runtime";
|
|
8416
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
8417
|
+
let defaultContexts = [];
|
|
8418
|
+
function createContext32(rootComponentName, defaultContext) {
|
|
8419
|
+
const BaseContext = React2.createContext(defaultContext);
|
|
8420
|
+
const index = defaultContexts.length;
|
|
8421
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
8422
|
+
const Provider2 = /* @__PURE__ */ __name((props) => {
|
|
8423
|
+
const { scope, children, ...context } = props;
|
|
8424
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
8425
|
+
const value = React2.useMemo(() => context, Object.values(context));
|
|
8426
|
+
return /* @__PURE__ */ jsx168(Context.Provider, { value, children });
|
|
8427
|
+
}, "Provider");
|
|
8428
|
+
Provider2.displayName = rootComponentName + "Provider";
|
|
8429
|
+
function useContext22(consumerName, scope) {
|
|
8430
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
8431
|
+
const context = React2.useContext(Context);
|
|
8432
|
+
if (context) return context;
|
|
8433
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
8434
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
8435
|
+
}
|
|
8436
|
+
__name(useContext22, "useContext2");
|
|
8437
|
+
return [Provider2, useContext22];
|
|
8438
|
+
}
|
|
8439
|
+
__name(createContext32, "createContext3");
|
|
8440
|
+
const createScope = /* @__PURE__ */ __name(() => {
|
|
8441
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
8442
|
+
return React2.createContext(defaultContext);
|
|
8443
|
+
});
|
|
8444
|
+
return /* @__PURE__ */ __name(function useScope(scope) {
|
|
8445
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
8446
|
+
return React2.useMemo(
|
|
8447
|
+
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
8448
|
+
[scope, contexts]
|
|
8449
|
+
);
|
|
8450
|
+
}, "useScope");
|
|
8451
|
+
}, "createScope");
|
|
8452
|
+
createScope.scopeName = scopeName;
|
|
8453
|
+
return [createContext32, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
8454
|
+
}
|
|
8455
|
+
__name(createContextScope, "createContextScope");
|
|
8456
|
+
function composeContextScopes(...scopes) {
|
|
8457
|
+
const baseScope = scopes[0];
|
|
8458
|
+
if (scopes.length === 1) return baseScope;
|
|
8459
|
+
const createScope = /* @__PURE__ */ __name(() => {
|
|
8460
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
8461
|
+
useScope: createScope2(),
|
|
8462
|
+
scopeName: createScope2.scopeName
|
|
8463
|
+
}));
|
|
8464
|
+
return /* @__PURE__ */ __name(function useComposedScopes(overrideScopes) {
|
|
8465
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
8466
|
+
const scopeProps = useScope(overrideScopes);
|
|
8467
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
8468
|
+
return { ...nextScopes2, ...currentScope };
|
|
8469
|
+
}, {});
|
|
8470
|
+
return React2.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
8471
|
+
}, "useComposedScopes");
|
|
8472
|
+
}, "createScope");
|
|
8473
|
+
createScope.scopeName = baseScope.scopeName;
|
|
8474
|
+
return createScope;
|
|
8475
|
+
}
|
|
8476
|
+
__name(composeContextScopes, "composeContextScopes");
|
|
8477
|
+
|
|
8478
|
+
// ../../node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
8479
|
+
import * as React3 from "react";
|
|
8480
|
+
import { Fragment as Fragment22, jsx as jsx169 } from "react/jsx-runtime";
|
|
8481
|
+
// @__NO_SIDE_EFFECTS__
|
|
8482
|
+
function createSlot(ownerName) {
|
|
8483
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
8484
|
+
const Slot2 = React3.forwardRef((props, forwardedRef) => {
|
|
8485
|
+
const { children, ...slotProps } = props;
|
|
8486
|
+
const childrenArray = React3.Children.toArray(children);
|
|
8487
|
+
const slottable = childrenArray.find(isSlottable);
|
|
8488
|
+
if (slottable) {
|
|
8489
|
+
const newElement = slottable.props.children;
|
|
8490
|
+
const newChildren = childrenArray.map((child) => {
|
|
8491
|
+
if (child === slottable) {
|
|
8492
|
+
if (React3.Children.count(newElement) > 1) return React3.Children.only(null);
|
|
8493
|
+
return React3.isValidElement(newElement) ? newElement.props.children : null;
|
|
8494
|
+
} else {
|
|
8495
|
+
return child;
|
|
8496
|
+
}
|
|
8497
|
+
});
|
|
8498
|
+
return /* @__PURE__ */ jsx169(SlotClone, { ...slotProps, ref: forwardedRef, children: React3.isValidElement(newElement) ? React3.cloneElement(newElement, void 0, newChildren) : null });
|
|
8499
|
+
}
|
|
8500
|
+
return /* @__PURE__ */ jsx169(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
8501
|
+
});
|
|
8502
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
8503
|
+
return Slot2;
|
|
8504
|
+
}
|
|
8505
|
+
__name(createSlot, "createSlot");
|
|
8506
|
+
// @__NO_SIDE_EFFECTS__
|
|
8507
|
+
function createSlotClone(ownerName) {
|
|
8508
|
+
const SlotClone = React3.forwardRef((props, forwardedRef) => {
|
|
8509
|
+
const { children, ...slotProps } = props;
|
|
8510
|
+
const childrenRef = React3.isValidElement(children) ? getElementRef(children) : void 0;
|
|
8511
|
+
const ref = useComposedRefs(childrenRef, forwardedRef);
|
|
8512
|
+
if (React3.isValidElement(children)) {
|
|
8513
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
8514
|
+
if (children.type !== React3.Fragment) {
|
|
8515
|
+
props2.ref = ref;
|
|
8516
|
+
}
|
|
8517
|
+
return React3.cloneElement(children, props2);
|
|
8518
|
+
}
|
|
8519
|
+
return React3.Children.count(children) > 1 ? React3.Children.only(null) : null;
|
|
8520
|
+
});
|
|
8521
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
8522
|
+
return SlotClone;
|
|
8523
|
+
}
|
|
8524
|
+
__name(createSlotClone, "createSlotClone");
|
|
8525
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
8526
|
+
function isSlottable(child) {
|
|
8527
|
+
return React3.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
8528
|
+
}
|
|
8529
|
+
__name(isSlottable, "isSlottable");
|
|
8530
|
+
function mergeProps(slotProps, childProps) {
|
|
8531
|
+
const overrideProps = { ...childProps };
|
|
8532
|
+
for (const propName in childProps) {
|
|
8533
|
+
const slotPropValue = slotProps[propName];
|
|
8534
|
+
const childPropValue = childProps[propName];
|
|
8535
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
8536
|
+
if (isHandler) {
|
|
8537
|
+
if (slotPropValue && childPropValue) {
|
|
8538
|
+
overrideProps[propName] = (...args) => {
|
|
8539
|
+
const result = childPropValue(...args);
|
|
8540
|
+
slotPropValue(...args);
|
|
8541
|
+
return result;
|
|
8542
|
+
};
|
|
8543
|
+
} else if (slotPropValue) {
|
|
8544
|
+
overrideProps[propName] = slotPropValue;
|
|
8545
|
+
}
|
|
8546
|
+
} else if (propName === "style") {
|
|
8547
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
8548
|
+
} else if (propName === "className") {
|
|
8549
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
8550
|
+
}
|
|
8551
|
+
}
|
|
8552
|
+
return { ...slotProps, ...overrideProps };
|
|
8553
|
+
}
|
|
8554
|
+
__name(mergeProps, "mergeProps");
|
|
8555
|
+
function getElementRef(element) {
|
|
8556
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
8557
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
8558
|
+
if (mayWarn) {
|
|
8559
|
+
return element.ref;
|
|
8560
|
+
}
|
|
8561
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
8562
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
8563
|
+
if (mayWarn) {
|
|
8564
|
+
return element.props.ref;
|
|
8565
|
+
}
|
|
8566
|
+
return element.props.ref || element.ref;
|
|
8567
|
+
}
|
|
8568
|
+
__name(getElementRef, "getElementRef");
|
|
8569
|
+
|
|
8570
|
+
// ../../node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
8571
|
+
import { jsx as jsx170 } from "react/jsx-runtime";
|
|
8572
|
+
import React22 from "react";
|
|
8573
|
+
import { jsx as jsx210 } from "react/jsx-runtime";
|
|
8574
|
+
function createCollection(name) {
|
|
8575
|
+
const PROVIDER_NAME2 = name + "CollectionProvider";
|
|
8576
|
+
const [createCollectionContext, createCollectionScope2] = createContextScope(PROVIDER_NAME2);
|
|
8577
|
+
const [CollectionProviderImpl, useCollectionContext2] = createCollectionContext(
|
|
8578
|
+
PROVIDER_NAME2,
|
|
8579
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
8580
|
+
);
|
|
8581
|
+
const CollectionProvider2 = /* @__PURE__ */ __name((props) => {
|
|
8582
|
+
const { scope, children } = props;
|
|
8583
|
+
const ref = React4.useRef(null);
|
|
8584
|
+
const itemMap = React4.useRef(/* @__PURE__ */ new Map()).current;
|
|
8585
|
+
return /* @__PURE__ */ jsx170(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
8586
|
+
}, "CollectionProvider");
|
|
8587
|
+
CollectionProvider2.displayName = PROVIDER_NAME2;
|
|
8588
|
+
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
8589
|
+
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
8590
|
+
const CollectionSlot = React4.forwardRef(
|
|
8591
|
+
(props, forwardedRef) => {
|
|
8592
|
+
const { scope, children } = props;
|
|
8593
|
+
const context = useCollectionContext2(COLLECTION_SLOT_NAME, scope);
|
|
8594
|
+
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
8595
|
+
return /* @__PURE__ */ jsx170(CollectionSlotImpl, { ref: composedRefs, children });
|
|
8596
|
+
}
|
|
8597
|
+
);
|
|
8598
|
+
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
8599
|
+
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
8600
|
+
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
8601
|
+
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
8602
|
+
const CollectionItemSlot = React4.forwardRef(
|
|
8603
|
+
(props, forwardedRef) => {
|
|
8604
|
+
const { scope, children, ...itemData } = props;
|
|
8605
|
+
const ref = React4.useRef(null);
|
|
8606
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
8607
|
+
const context = useCollectionContext2(ITEM_SLOT_NAME, scope);
|
|
8608
|
+
React4.useEffect(() => {
|
|
8609
|
+
context.itemMap.set(ref, { ref, ...itemData });
|
|
8610
|
+
return () => void context.itemMap.delete(ref);
|
|
8611
|
+
});
|
|
8612
|
+
return /* @__PURE__ */ jsx170(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
8613
|
+
}
|
|
8614
|
+
);
|
|
8615
|
+
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
8616
|
+
function useCollection2(scope) {
|
|
8617
|
+
const context = useCollectionContext2(name + "CollectionConsumer", scope);
|
|
8618
|
+
const getItems = React4.useCallback(() => {
|
|
8619
|
+
const collectionNode = context.collectionRef.current;
|
|
8620
|
+
if (!collectionNode) return [];
|
|
8621
|
+
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
8622
|
+
const items = Array.from(context.itemMap.values());
|
|
8623
|
+
const orderedItems = items.sort(
|
|
8624
|
+
(a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
|
|
8625
|
+
);
|
|
8626
|
+
return orderedItems;
|
|
8627
|
+
}, [context.collectionRef, context.itemMap]);
|
|
8628
|
+
return getItems;
|
|
8629
|
+
}
|
|
8630
|
+
__name(useCollection2, "useCollection");
|
|
8631
|
+
return [
|
|
8632
|
+
{ Provider: CollectionProvider2, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
|
|
8633
|
+
useCollection2,
|
|
8634
|
+
createCollectionScope2
|
|
8635
|
+
];
|
|
8636
|
+
}
|
|
8637
|
+
__name(createCollection, "createCollection");
|
|
8638
|
+
|
|
8639
|
+
// ../../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
8640
|
+
import * as React8 from "react";
|
|
8641
|
+
|
|
8642
|
+
// ../../node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
8643
|
+
import * as React5 from "react";
|
|
8644
|
+
import * as ReactDOM from "react-dom";
|
|
8645
|
+
import { jsx as jsx171 } from "react/jsx-runtime";
|
|
8646
|
+
var NODES = [
|
|
8647
|
+
"a",
|
|
8648
|
+
"button",
|
|
8649
|
+
"div",
|
|
8650
|
+
"form",
|
|
8651
|
+
"h2",
|
|
8652
|
+
"h3",
|
|
8653
|
+
"img",
|
|
8654
|
+
"input",
|
|
8655
|
+
"label",
|
|
8656
|
+
"li",
|
|
8657
|
+
"nav",
|
|
8658
|
+
"ol",
|
|
8659
|
+
"p",
|
|
8660
|
+
"select",
|
|
8661
|
+
"span",
|
|
8662
|
+
"svg",
|
|
8663
|
+
"ul"
|
|
8664
|
+
];
|
|
8665
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
|
8666
|
+
const Slot2 = createSlot(`Primitive.${node}`);
|
|
8667
|
+
const Node2 = React5.forwardRef((props, forwardedRef) => {
|
|
8668
|
+
const { asChild, ...primitiveProps } = props;
|
|
8669
|
+
const Comp = asChild ? Slot2 : node;
|
|
8670
|
+
if (typeof window !== "undefined") {
|
|
8671
|
+
window[Symbol.for("radix-ui")] = true;
|
|
8672
|
+
}
|
|
8673
|
+
return /* @__PURE__ */ jsx171(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
8674
|
+
});
|
|
8675
|
+
Node2.displayName = `Primitive.${node}`;
|
|
8676
|
+
return { ...primitive, [node]: Node2 };
|
|
8677
|
+
}, {});
|
|
8678
|
+
function dispatchDiscreteCustomEvent(target, event) {
|
|
8679
|
+
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
8680
|
+
}
|
|
8681
|
+
__name(dispatchDiscreteCustomEvent, "dispatchDiscreteCustomEvent");
|
|
8682
|
+
|
|
8683
|
+
// ../../node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
8684
|
+
import * as React6 from "react";
|
|
8685
|
+
function useCallbackRef(callback) {
|
|
8686
|
+
const callbackRef = React6.useRef(callback);
|
|
8687
|
+
React6.useEffect(() => {
|
|
8688
|
+
callbackRef.current = callback;
|
|
8689
|
+
});
|
|
8690
|
+
return React6.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
8691
|
+
}
|
|
8692
|
+
__name(useCallbackRef, "useCallbackRef");
|
|
8693
|
+
|
|
8694
|
+
// ../../node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
|
|
8695
|
+
import * as React7 from "react";
|
|
8696
|
+
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
8697
|
+
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
8698
|
+
React7.useEffect(() => {
|
|
8699
|
+
const handleKeyDown = /* @__PURE__ */ __name((event) => {
|
|
8700
|
+
if (event.key === "Escape") {
|
|
8701
|
+
onEscapeKeyDown(event);
|
|
8702
|
+
}
|
|
8703
|
+
}, "handleKeyDown");
|
|
8704
|
+
ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
|
|
8705
|
+
return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
|
|
8706
|
+
}, [onEscapeKeyDown, ownerDocument]);
|
|
8707
|
+
}
|
|
8708
|
+
__name(useEscapeKeydown, "useEscapeKeydown");
|
|
8709
|
+
|
|
8710
|
+
// ../../node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
8711
|
+
import { jsx as jsx172 } from "react/jsx-runtime";
|
|
8712
|
+
var DISMISSABLE_LAYER_NAME = "DismissableLayer";
|
|
8713
|
+
var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
8714
|
+
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
8715
|
+
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
8716
|
+
var originalBodyPointerEvents;
|
|
8717
|
+
var DismissableLayerContext = React8.createContext({
|
|
8718
|
+
layers: /* @__PURE__ */ new Set(),
|
|
8719
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
8720
|
+
branches: /* @__PURE__ */ new Set()
|
|
8721
|
+
});
|
|
8722
|
+
var DismissableLayer = React8.forwardRef(
|
|
8723
|
+
(props, forwardedRef) => {
|
|
8724
|
+
const {
|
|
8725
|
+
disableOutsidePointerEvents = false,
|
|
8726
|
+
onEscapeKeyDown,
|
|
8727
|
+
onPointerDownOutside,
|
|
8728
|
+
onFocusOutside,
|
|
8729
|
+
onInteractOutside,
|
|
8730
|
+
onDismiss,
|
|
8731
|
+
...layerProps
|
|
8732
|
+
} = props;
|
|
8733
|
+
const context = React8.useContext(DismissableLayerContext);
|
|
8734
|
+
const [node, setNode] = React8.useState(null);
|
|
8735
|
+
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
8736
|
+
const [, force] = React8.useState({});
|
|
8737
|
+
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
8738
|
+
const layers = Array.from(context.layers);
|
|
8739
|
+
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
8740
|
+
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
|
8741
|
+
const index = node ? layers.indexOf(node) : -1;
|
|
8742
|
+
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
8743
|
+
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
8744
|
+
const pointerDownOutside = usePointerDownOutside((event) => {
|
|
8745
|
+
const target = event.target;
|
|
8746
|
+
const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
|
|
8747
|
+
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
8748
|
+
onPointerDownOutside?.(event);
|
|
8749
|
+
onInteractOutside?.(event);
|
|
8750
|
+
if (!event.defaultPrevented) onDismiss?.();
|
|
8751
|
+
}, ownerDocument);
|
|
8752
|
+
const focusOutside = useFocusOutside((event) => {
|
|
8753
|
+
const target = event.target;
|
|
8754
|
+
const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));
|
|
8755
|
+
if (isFocusInBranch) return;
|
|
8756
|
+
onFocusOutside?.(event);
|
|
8757
|
+
onInteractOutside?.(event);
|
|
8758
|
+
if (!event.defaultPrevented) onDismiss?.();
|
|
8759
|
+
}, ownerDocument);
|
|
8760
|
+
useEscapeKeydown((event) => {
|
|
8761
|
+
const isHighestLayer = index === context.layers.size - 1;
|
|
8762
|
+
if (!isHighestLayer) return;
|
|
8763
|
+
onEscapeKeyDown?.(event);
|
|
8764
|
+
if (!event.defaultPrevented && onDismiss) {
|
|
8765
|
+
event.preventDefault();
|
|
8766
|
+
onDismiss();
|
|
8767
|
+
}
|
|
8768
|
+
}, ownerDocument);
|
|
8769
|
+
React8.useEffect(() => {
|
|
8770
|
+
if (!node) return;
|
|
8771
|
+
if (disableOutsidePointerEvents) {
|
|
8772
|
+
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
8773
|
+
originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
8774
|
+
ownerDocument.body.style.pointerEvents = "none";
|
|
8775
|
+
}
|
|
8776
|
+
context.layersWithOutsidePointerEventsDisabled.add(node);
|
|
8777
|
+
}
|
|
8778
|
+
context.layers.add(node);
|
|
8779
|
+
dispatchUpdate();
|
|
8780
|
+
return () => {
|
|
8781
|
+
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) {
|
|
8782
|
+
ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
|
|
8783
|
+
}
|
|
8784
|
+
};
|
|
8785
|
+
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
8786
|
+
React8.useEffect(() => {
|
|
8787
|
+
return () => {
|
|
8788
|
+
if (!node) return;
|
|
8789
|
+
context.layers.delete(node);
|
|
8790
|
+
context.layersWithOutsidePointerEventsDisabled.delete(node);
|
|
8791
|
+
dispatchUpdate();
|
|
8792
|
+
};
|
|
8793
|
+
}, [node, context]);
|
|
8794
|
+
React8.useEffect(() => {
|
|
8795
|
+
const handleUpdate = /* @__PURE__ */ __name(() => force({}), "handleUpdate");
|
|
8796
|
+
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
8797
|
+
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
8798
|
+
}, []);
|
|
8799
|
+
return /* @__PURE__ */ jsx172(
|
|
8800
|
+
Primitive.div,
|
|
8801
|
+
{
|
|
8802
|
+
...layerProps,
|
|
8803
|
+
ref: composedRefs,
|
|
8804
|
+
style: {
|
|
8805
|
+
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
|
|
8806
|
+
...props.style
|
|
8807
|
+
},
|
|
8808
|
+
onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
8809
|
+
onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
8810
|
+
onPointerDownCapture: composeEventHandlers(
|
|
8811
|
+
props.onPointerDownCapture,
|
|
8812
|
+
pointerDownOutside.onPointerDownCapture
|
|
8813
|
+
)
|
|
8814
|
+
}
|
|
8815
|
+
);
|
|
8816
|
+
}
|
|
8817
|
+
);
|
|
8818
|
+
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
8819
|
+
var BRANCH_NAME = "DismissableLayerBranch";
|
|
8820
|
+
var DismissableLayerBranch = React8.forwardRef((props, forwardedRef) => {
|
|
8821
|
+
const context = React8.useContext(DismissableLayerContext);
|
|
8822
|
+
const ref = React8.useRef(null);
|
|
8823
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
8824
|
+
React8.useEffect(() => {
|
|
8825
|
+
const node = ref.current;
|
|
8826
|
+
if (node) {
|
|
8827
|
+
context.branches.add(node);
|
|
8828
|
+
return () => {
|
|
8829
|
+
context.branches.delete(node);
|
|
8830
|
+
};
|
|
8831
|
+
}
|
|
8832
|
+
}, [context.branches]);
|
|
8833
|
+
return /* @__PURE__ */ jsx172(Primitive.div, { ...props, ref: composedRefs });
|
|
8834
|
+
});
|
|
8835
|
+
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
8836
|
+
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
8837
|
+
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
8838
|
+
const isPointerInsideReactTreeRef = React8.useRef(false);
|
|
8839
|
+
const handleClickRef = React8.useRef(() => {
|
|
8840
|
+
});
|
|
8841
|
+
React8.useEffect(() => {
|
|
8842
|
+
const handlePointerDown = /* @__PURE__ */ __name((event) => {
|
|
8843
|
+
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
8844
|
+
let handleAndDispatchPointerDownOutsideEvent2 = /* @__PURE__ */ __name(function() {
|
|
8845
|
+
handleAndDispatchCustomEvent(
|
|
8846
|
+
POINTER_DOWN_OUTSIDE,
|
|
8847
|
+
handlePointerDownOutside,
|
|
8848
|
+
eventDetail,
|
|
8849
|
+
{ discrete: true }
|
|
8850
|
+
);
|
|
8851
|
+
}, "handleAndDispatchPointerDownOutsideEvent2");
|
|
8852
|
+
var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;
|
|
8853
|
+
const eventDetail = { originalEvent: event };
|
|
8854
|
+
if (event.pointerType === "touch") {
|
|
8855
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
8856
|
+
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
|
|
8857
|
+
ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
|
|
8858
|
+
} else {
|
|
8859
|
+
handleAndDispatchPointerDownOutsideEvent2();
|
|
8860
|
+
}
|
|
8861
|
+
} else {
|
|
8862
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
8863
|
+
}
|
|
8864
|
+
isPointerInsideReactTreeRef.current = false;
|
|
8865
|
+
}, "handlePointerDown");
|
|
8866
|
+
const timerId = window.setTimeout(() => {
|
|
8867
|
+
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
|
8868
|
+
}, 0);
|
|
8869
|
+
return () => {
|
|
8870
|
+
window.clearTimeout(timerId);
|
|
8871
|
+
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
|
8872
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
8873
|
+
};
|
|
8874
|
+
}, [ownerDocument, handlePointerDownOutside]);
|
|
8875
|
+
return {
|
|
8876
|
+
// ensures we check React component tree (not just DOM tree)
|
|
8877
|
+
onPointerDownCapture: /* @__PURE__ */ __name(() => isPointerInsideReactTreeRef.current = true, "onPointerDownCapture")
|
|
8878
|
+
};
|
|
8879
|
+
}
|
|
8880
|
+
__name(usePointerDownOutside, "usePointerDownOutside");
|
|
8881
|
+
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
8882
|
+
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
8883
|
+
const isFocusInsideReactTreeRef = React8.useRef(false);
|
|
8884
|
+
React8.useEffect(() => {
|
|
8885
|
+
const handleFocus = /* @__PURE__ */ __name((event) => {
|
|
8886
|
+
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
8887
|
+
const eventDetail = { originalEvent: event };
|
|
8888
|
+
handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
8889
|
+
discrete: false
|
|
8890
|
+
});
|
|
8891
|
+
}
|
|
8892
|
+
}, "handleFocus");
|
|
8893
|
+
ownerDocument.addEventListener("focusin", handleFocus);
|
|
8894
|
+
return () => ownerDocument.removeEventListener("focusin", handleFocus);
|
|
8895
|
+
}, [ownerDocument, handleFocusOutside]);
|
|
8896
|
+
return {
|
|
8897
|
+
onFocusCapture: /* @__PURE__ */ __name(() => isFocusInsideReactTreeRef.current = true, "onFocusCapture"),
|
|
8898
|
+
onBlurCapture: /* @__PURE__ */ __name(() => isFocusInsideReactTreeRef.current = false, "onBlurCapture")
|
|
8899
|
+
};
|
|
8900
|
+
}
|
|
8901
|
+
__name(useFocusOutside, "useFocusOutside");
|
|
8902
|
+
function dispatchUpdate() {
|
|
8903
|
+
const event = new CustomEvent(CONTEXT_UPDATE);
|
|
8904
|
+
document.dispatchEvent(event);
|
|
8905
|
+
}
|
|
8906
|
+
__name(dispatchUpdate, "dispatchUpdate");
|
|
8907
|
+
function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
8908
|
+
const target = detail.originalEvent.target;
|
|
8909
|
+
const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
|
|
8910
|
+
if (handler) target.addEventListener(name, handler, { once: true });
|
|
8911
|
+
if (discrete) {
|
|
8912
|
+
dispatchDiscreteCustomEvent(target, event);
|
|
8913
|
+
} else {
|
|
8914
|
+
target.dispatchEvent(event);
|
|
8915
|
+
}
|
|
8916
|
+
}
|
|
8917
|
+
__name(handleAndDispatchCustomEvent, "handleAndDispatchCustomEvent");
|
|
8918
|
+
var Root = DismissableLayer;
|
|
8919
|
+
var Branch = DismissableLayerBranch;
|
|
8920
|
+
|
|
8921
|
+
// ../../node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
8922
|
+
import * as React10 from "react";
|
|
8923
|
+
import ReactDOM2 from "react-dom";
|
|
8924
|
+
|
|
8925
|
+
// ../../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
8926
|
+
import * as React9 from "react";
|
|
8927
|
+
var useLayoutEffect2 = globalThis?.document ? React9.useLayoutEffect : () => {
|
|
8928
|
+
};
|
|
8929
|
+
|
|
8930
|
+
// ../../node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
8931
|
+
import { jsx as jsx173 } from "react/jsx-runtime";
|
|
8932
|
+
var PORTAL_NAME = "Portal";
|
|
8933
|
+
var Portal = React10.forwardRef((props, forwardedRef) => {
|
|
8934
|
+
const { container: containerProp, ...portalProps } = props;
|
|
8935
|
+
const [mounted, setMounted] = React10.useState(false);
|
|
8936
|
+
useLayoutEffect2(() => setMounted(true), []);
|
|
8937
|
+
const container = containerProp || mounted && globalThis?.document?.body;
|
|
8938
|
+
return container ? ReactDOM2.createPortal(/* @__PURE__ */ jsx173(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
8939
|
+
});
|
|
8940
|
+
Portal.displayName = PORTAL_NAME;
|
|
8941
|
+
|
|
8942
|
+
// ../../node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
8943
|
+
import * as React23 from "react";
|
|
8944
|
+
import * as React11 from "react";
|
|
8945
|
+
function useStateMachine(initialState, machine) {
|
|
8946
|
+
return React11.useReducer((state, event) => {
|
|
8947
|
+
const nextState = machine[state][event];
|
|
8948
|
+
return nextState ?? state;
|
|
8949
|
+
}, initialState);
|
|
8950
|
+
}
|
|
8951
|
+
__name(useStateMachine, "useStateMachine");
|
|
8952
|
+
var Presence = /* @__PURE__ */ __name((props) => {
|
|
8953
|
+
const { present, children } = props;
|
|
8954
|
+
const presence = usePresence(present);
|
|
8955
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React23.Children.only(children);
|
|
8956
|
+
const ref = useComposedRefs(presence.ref, getElementRef2(child));
|
|
8957
|
+
const forceMount = typeof children === "function";
|
|
8958
|
+
return forceMount || presence.isPresent ? React23.cloneElement(child, { ref }) : null;
|
|
8959
|
+
}, "Presence");
|
|
8960
|
+
Presence.displayName = "Presence";
|
|
8961
|
+
function usePresence(present) {
|
|
8962
|
+
const [node, setNode] = React23.useState();
|
|
8963
|
+
const stylesRef = React23.useRef(null);
|
|
8964
|
+
const prevPresentRef = React23.useRef(present);
|
|
8965
|
+
const prevAnimationNameRef = React23.useRef("none");
|
|
8966
|
+
const initialState = present ? "mounted" : "unmounted";
|
|
8967
|
+
const [state, send] = useStateMachine(initialState, {
|
|
8968
|
+
mounted: {
|
|
8969
|
+
UNMOUNT: "unmounted",
|
|
8970
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
8971
|
+
},
|
|
8972
|
+
unmountSuspended: {
|
|
8973
|
+
MOUNT: "mounted",
|
|
8974
|
+
ANIMATION_END: "unmounted"
|
|
8975
|
+
},
|
|
8976
|
+
unmounted: {
|
|
8977
|
+
MOUNT: "mounted"
|
|
8978
|
+
}
|
|
8979
|
+
});
|
|
8980
|
+
React23.useEffect(() => {
|
|
8981
|
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
8982
|
+
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
8983
|
+
}, [state]);
|
|
8984
|
+
useLayoutEffect2(() => {
|
|
8985
|
+
const styles = stylesRef.current;
|
|
8986
|
+
const wasPresent = prevPresentRef.current;
|
|
8987
|
+
const hasPresentChanged = wasPresent !== present;
|
|
8988
|
+
if (hasPresentChanged) {
|
|
8989
|
+
const prevAnimationName = prevAnimationNameRef.current;
|
|
8990
|
+
const currentAnimationName = getAnimationName(styles);
|
|
8991
|
+
if (present) {
|
|
8992
|
+
send("MOUNT");
|
|
8993
|
+
} else if (currentAnimationName === "none" || styles?.display === "none") {
|
|
8994
|
+
send("UNMOUNT");
|
|
8995
|
+
} else {
|
|
8996
|
+
const isAnimating = prevAnimationName !== currentAnimationName;
|
|
8997
|
+
if (wasPresent && isAnimating) {
|
|
8998
|
+
send("ANIMATION_OUT");
|
|
8999
|
+
} else {
|
|
9000
|
+
send("UNMOUNT");
|
|
9001
|
+
}
|
|
9002
|
+
}
|
|
9003
|
+
prevPresentRef.current = present;
|
|
9004
|
+
}
|
|
9005
|
+
}, [present, send]);
|
|
9006
|
+
useLayoutEffect2(() => {
|
|
9007
|
+
if (node) {
|
|
9008
|
+
let timeoutId;
|
|
9009
|
+
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
9010
|
+
const handleAnimationEnd = /* @__PURE__ */ __name((event) => {
|
|
9011
|
+
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
9012
|
+
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
9013
|
+
if (event.target === node && isCurrentAnimation) {
|
|
9014
|
+
send("ANIMATION_END");
|
|
9015
|
+
if (!prevPresentRef.current) {
|
|
9016
|
+
const currentFillMode = node.style.animationFillMode;
|
|
9017
|
+
node.style.animationFillMode = "forwards";
|
|
9018
|
+
timeoutId = ownerWindow.setTimeout(() => {
|
|
9019
|
+
if (node.style.animationFillMode === "forwards") {
|
|
9020
|
+
node.style.animationFillMode = currentFillMode;
|
|
9021
|
+
}
|
|
9022
|
+
});
|
|
9023
|
+
}
|
|
9024
|
+
}
|
|
9025
|
+
}, "handleAnimationEnd");
|
|
9026
|
+
const handleAnimationStart = /* @__PURE__ */ __name((event) => {
|
|
9027
|
+
if (event.target === node) {
|
|
9028
|
+
prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
9029
|
+
}
|
|
9030
|
+
}, "handleAnimationStart");
|
|
9031
|
+
node.addEventListener("animationstart", handleAnimationStart);
|
|
9032
|
+
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
9033
|
+
node.addEventListener("animationend", handleAnimationEnd);
|
|
9034
|
+
return () => {
|
|
9035
|
+
ownerWindow.clearTimeout(timeoutId);
|
|
9036
|
+
node.removeEventListener("animationstart", handleAnimationStart);
|
|
9037
|
+
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
9038
|
+
node.removeEventListener("animationend", handleAnimationEnd);
|
|
9039
|
+
};
|
|
9040
|
+
} else {
|
|
9041
|
+
send("ANIMATION_END");
|
|
9042
|
+
}
|
|
9043
|
+
}, [node, send]);
|
|
9044
|
+
return {
|
|
9045
|
+
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
9046
|
+
ref: React23.useCallback((node2) => {
|
|
9047
|
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
9048
|
+
setNode(node2);
|
|
9049
|
+
}, [])
|
|
9050
|
+
};
|
|
9051
|
+
}
|
|
9052
|
+
__name(usePresence, "usePresence");
|
|
9053
|
+
function getAnimationName(styles) {
|
|
9054
|
+
return styles?.animationName || "none";
|
|
9055
|
+
}
|
|
9056
|
+
__name(getAnimationName, "getAnimationName");
|
|
9057
|
+
function getElementRef2(element) {
|
|
9058
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
9059
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
9060
|
+
if (mayWarn) {
|
|
9061
|
+
return element.ref;
|
|
9062
|
+
}
|
|
9063
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
9064
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
9065
|
+
if (mayWarn) {
|
|
9066
|
+
return element.props.ref;
|
|
9067
|
+
}
|
|
9068
|
+
return element.props.ref || element.ref;
|
|
9069
|
+
}
|
|
9070
|
+
__name(getElementRef2, "getElementRef");
|
|
9071
|
+
|
|
9072
|
+
// ../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
9073
|
+
import * as React12 from "react";
|
|
9074
|
+
import * as React24 from "react";
|
|
9075
|
+
var useInsertionEffect = React12[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
9076
|
+
function useControllableState({
|
|
9077
|
+
prop,
|
|
9078
|
+
defaultProp,
|
|
9079
|
+
onChange = /* @__PURE__ */ __name(() => {
|
|
9080
|
+
}, "onChange"),
|
|
9081
|
+
caller
|
|
9082
|
+
}) {
|
|
9083
|
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
9084
|
+
defaultProp,
|
|
9085
|
+
onChange
|
|
9086
|
+
});
|
|
9087
|
+
const isControlled = prop !== void 0;
|
|
9088
|
+
const value = isControlled ? prop : uncontrolledProp;
|
|
9089
|
+
if (true) {
|
|
9090
|
+
const isControlledRef = React12.useRef(prop !== void 0);
|
|
9091
|
+
React12.useEffect(() => {
|
|
9092
|
+
const wasControlled = isControlledRef.current;
|
|
9093
|
+
if (wasControlled !== isControlled) {
|
|
9094
|
+
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
9095
|
+
const to = isControlled ? "controlled" : "uncontrolled";
|
|
9096
|
+
console.warn(
|
|
9097
|
+
`${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
9098
|
+
);
|
|
9099
|
+
}
|
|
9100
|
+
isControlledRef.current = isControlled;
|
|
9101
|
+
}, [isControlled, caller]);
|
|
9102
|
+
}
|
|
9103
|
+
const setValue = React12.useCallback(
|
|
9104
|
+
(nextValue) => {
|
|
9105
|
+
if (isControlled) {
|
|
9106
|
+
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
9107
|
+
if (value2 !== prop) {
|
|
9108
|
+
onChangeRef.current?.(value2);
|
|
9109
|
+
}
|
|
9110
|
+
} else {
|
|
9111
|
+
setUncontrolledProp(nextValue);
|
|
9112
|
+
}
|
|
9113
|
+
},
|
|
9114
|
+
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
|
9115
|
+
);
|
|
9116
|
+
return [value, setValue];
|
|
9117
|
+
}
|
|
9118
|
+
__name(useControllableState, "useControllableState");
|
|
9119
|
+
function useUncontrolledState({
|
|
9120
|
+
defaultProp,
|
|
9121
|
+
onChange
|
|
9122
|
+
}) {
|
|
9123
|
+
const [value, setValue] = React12.useState(defaultProp);
|
|
9124
|
+
const prevValueRef = React12.useRef(value);
|
|
9125
|
+
const onChangeRef = React12.useRef(onChange);
|
|
9126
|
+
useInsertionEffect(() => {
|
|
9127
|
+
onChangeRef.current = onChange;
|
|
9128
|
+
}, [onChange]);
|
|
9129
|
+
React12.useEffect(() => {
|
|
9130
|
+
if (prevValueRef.current !== value) {
|
|
9131
|
+
onChangeRef.current?.(value);
|
|
9132
|
+
prevValueRef.current = value;
|
|
9133
|
+
}
|
|
9134
|
+
}, [value, prevValueRef]);
|
|
9135
|
+
return [value, setValue, onChangeRef];
|
|
9136
|
+
}
|
|
9137
|
+
__name(useUncontrolledState, "useUncontrolledState");
|
|
9138
|
+
function isFunction(value) {
|
|
9139
|
+
return typeof value === "function";
|
|
9140
|
+
}
|
|
9141
|
+
__name(isFunction, "isFunction");
|
|
9142
|
+
var SYNC_STATE = Symbol("RADIX:SYNC_STATE");
|
|
9143
|
+
|
|
9144
|
+
// ../../node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
|
|
9145
|
+
import * as React13 from "react";
|
|
9146
|
+
import { jsx as jsx174 } from "react/jsx-runtime";
|
|
9147
|
+
var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
9148
|
+
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
9149
|
+
position: "absolute",
|
|
9150
|
+
border: 0,
|
|
9151
|
+
width: 1,
|
|
9152
|
+
height: 1,
|
|
9153
|
+
padding: 0,
|
|
9154
|
+
margin: -1,
|
|
9155
|
+
overflow: "hidden",
|
|
9156
|
+
clip: "rect(0, 0, 0, 0)",
|
|
9157
|
+
whiteSpace: "nowrap",
|
|
9158
|
+
wordWrap: "normal"
|
|
9159
|
+
});
|
|
9160
|
+
var NAME = "VisuallyHidden";
|
|
9161
|
+
var VisuallyHidden = React13.forwardRef(
|
|
9162
|
+
(props, forwardedRef) => {
|
|
9163
|
+
return /* @__PURE__ */ jsx174(
|
|
9164
|
+
Primitive.span,
|
|
9165
|
+
{
|
|
9166
|
+
...props,
|
|
9167
|
+
ref: forwardedRef,
|
|
9168
|
+
style: { ...VISUALLY_HIDDEN_STYLES, ...props.style }
|
|
9169
|
+
}
|
|
9170
|
+
);
|
|
9171
|
+
}
|
|
9172
|
+
);
|
|
9173
|
+
VisuallyHidden.displayName = NAME;
|
|
9174
|
+
|
|
9175
|
+
// ../../node_modules/@radix-ui/react-toast/dist/index.mjs
|
|
9176
|
+
import { Fragment as Fragment6, jsx as jsx175, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
9177
|
+
var PROVIDER_NAME = "ToastProvider";
|
|
9178
|
+
var [Collection, useCollection, createCollectionScope] = createCollection("Toast");
|
|
9179
|
+
var [createToastContext, createToastScope] = createContextScope("Toast", [createCollectionScope]);
|
|
9180
|
+
var [ToastProviderProvider, useToastProviderContext] = createToastContext(PROVIDER_NAME);
|
|
9181
|
+
var ToastProvider = /* @__PURE__ */ __name((props) => {
|
|
9182
|
+
const {
|
|
9183
|
+
__scopeToast,
|
|
9184
|
+
label = "Notification",
|
|
9185
|
+
duration = 5e3,
|
|
9186
|
+
swipeDirection = "right",
|
|
9187
|
+
swipeThreshold = 50,
|
|
9188
|
+
children
|
|
9189
|
+
} = props;
|
|
9190
|
+
const [viewport, setViewport] = React14.useState(null);
|
|
9191
|
+
const [toastCount, setToastCount] = React14.useState(0);
|
|
9192
|
+
const isFocusedToastEscapeKeyDownRef = React14.useRef(false);
|
|
9193
|
+
const isClosePausedRef = React14.useRef(false);
|
|
9194
|
+
if (!label.trim()) {
|
|
9195
|
+
console.error(
|
|
9196
|
+
`Invalid prop \`label\` supplied to \`${PROVIDER_NAME}\`. Expected non-empty \`string\`.`
|
|
9197
|
+
);
|
|
9198
|
+
}
|
|
9199
|
+
return /* @__PURE__ */ jsx175(Collection.Provider, { scope: __scopeToast, children: /* @__PURE__ */ jsx175(
|
|
9200
|
+
ToastProviderProvider,
|
|
9201
|
+
{
|
|
9202
|
+
scope: __scopeToast,
|
|
9203
|
+
label,
|
|
9204
|
+
duration,
|
|
9205
|
+
swipeDirection,
|
|
9206
|
+
swipeThreshold,
|
|
9207
|
+
toastCount,
|
|
9208
|
+
viewport,
|
|
9209
|
+
onViewportChange: setViewport,
|
|
9210
|
+
onToastAdd: React14.useCallback(() => setToastCount((prevCount) => prevCount + 1), []),
|
|
9211
|
+
onToastRemove: React14.useCallback(() => setToastCount((prevCount) => prevCount - 1), []),
|
|
9212
|
+
isFocusedToastEscapeKeyDownRef,
|
|
9213
|
+
isClosePausedRef,
|
|
9214
|
+
children
|
|
9215
|
+
}
|
|
9216
|
+
) });
|
|
9217
|
+
}, "ToastProvider");
|
|
9218
|
+
ToastProvider.displayName = PROVIDER_NAME;
|
|
9219
|
+
var VIEWPORT_NAME = "ToastViewport";
|
|
9220
|
+
var VIEWPORT_DEFAULT_HOTKEY = ["F8"];
|
|
9221
|
+
var VIEWPORT_PAUSE = "toast.viewportPause";
|
|
9222
|
+
var VIEWPORT_RESUME = "toast.viewportResume";
|
|
9223
|
+
var ToastViewport = React14.forwardRef(
|
|
9224
|
+
(props, forwardedRef) => {
|
|
9225
|
+
const {
|
|
9226
|
+
__scopeToast,
|
|
9227
|
+
hotkey = VIEWPORT_DEFAULT_HOTKEY,
|
|
9228
|
+
label = "Notifications ({hotkey})",
|
|
9229
|
+
...viewportProps
|
|
9230
|
+
} = props;
|
|
9231
|
+
const context = useToastProviderContext(VIEWPORT_NAME, __scopeToast);
|
|
9232
|
+
const getItems = useCollection(__scopeToast);
|
|
9233
|
+
const wrapperRef = React14.useRef(null);
|
|
9234
|
+
const headFocusProxyRef = React14.useRef(null);
|
|
9235
|
+
const tailFocusProxyRef = React14.useRef(null);
|
|
9236
|
+
const ref = React14.useRef(null);
|
|
9237
|
+
const composedRefs = useComposedRefs(forwardedRef, ref, context.onViewportChange);
|
|
9238
|
+
const hotkeyLabel = hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
|
|
9239
|
+
const hasToasts = context.toastCount > 0;
|
|
9240
|
+
React14.useEffect(() => {
|
|
9241
|
+
const handleKeyDown = /* @__PURE__ */ __name((event) => {
|
|
9242
|
+
const isHotkeyPressed = hotkey.length !== 0 && hotkey.every((key) => event[key] || event.code === key);
|
|
9243
|
+
if (isHotkeyPressed) ref.current?.focus();
|
|
9244
|
+
}, "handleKeyDown");
|
|
9245
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
9246
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
9247
|
+
}, [hotkey]);
|
|
9248
|
+
React14.useEffect(() => {
|
|
9249
|
+
const wrapper = wrapperRef.current;
|
|
9250
|
+
const viewport = ref.current;
|
|
9251
|
+
if (hasToasts && wrapper && viewport) {
|
|
9252
|
+
const handlePause = /* @__PURE__ */ __name(() => {
|
|
9253
|
+
if (!context.isClosePausedRef.current) {
|
|
9254
|
+
const pauseEvent = new CustomEvent(VIEWPORT_PAUSE);
|
|
9255
|
+
viewport.dispatchEvent(pauseEvent);
|
|
9256
|
+
context.isClosePausedRef.current = true;
|
|
9257
|
+
}
|
|
9258
|
+
}, "handlePause");
|
|
9259
|
+
const handleResume = /* @__PURE__ */ __name(() => {
|
|
9260
|
+
if (context.isClosePausedRef.current) {
|
|
9261
|
+
const resumeEvent = new CustomEvent(VIEWPORT_RESUME);
|
|
9262
|
+
viewport.dispatchEvent(resumeEvent);
|
|
9263
|
+
context.isClosePausedRef.current = false;
|
|
9264
|
+
}
|
|
9265
|
+
}, "handleResume");
|
|
9266
|
+
const handleFocusOutResume = /* @__PURE__ */ __name((event) => {
|
|
9267
|
+
const isFocusMovingOutside = !wrapper.contains(event.relatedTarget);
|
|
9268
|
+
if (isFocusMovingOutside) handleResume();
|
|
9269
|
+
}, "handleFocusOutResume");
|
|
9270
|
+
const handlePointerLeaveResume = /* @__PURE__ */ __name(() => {
|
|
9271
|
+
const isFocusInside = wrapper.contains(document.activeElement);
|
|
9272
|
+
if (!isFocusInside) handleResume();
|
|
9273
|
+
}, "handlePointerLeaveResume");
|
|
9274
|
+
wrapper.addEventListener("focusin", handlePause);
|
|
9275
|
+
wrapper.addEventListener("focusout", handleFocusOutResume);
|
|
9276
|
+
wrapper.addEventListener("pointermove", handlePause);
|
|
9277
|
+
wrapper.addEventListener("pointerleave", handlePointerLeaveResume);
|
|
9278
|
+
window.addEventListener("blur", handlePause);
|
|
9279
|
+
window.addEventListener("focus", handleResume);
|
|
9280
|
+
return () => {
|
|
9281
|
+
wrapper.removeEventListener("focusin", handlePause);
|
|
9282
|
+
wrapper.removeEventListener("focusout", handleFocusOutResume);
|
|
9283
|
+
wrapper.removeEventListener("pointermove", handlePause);
|
|
9284
|
+
wrapper.removeEventListener("pointerleave", handlePointerLeaveResume);
|
|
9285
|
+
window.removeEventListener("blur", handlePause);
|
|
9286
|
+
window.removeEventListener("focus", handleResume);
|
|
9287
|
+
};
|
|
9288
|
+
}
|
|
9289
|
+
}, [hasToasts, context.isClosePausedRef]);
|
|
9290
|
+
const getSortedTabbableCandidates = React14.useCallback(
|
|
9291
|
+
({ tabbingDirection }) => {
|
|
9292
|
+
const toastItems = getItems();
|
|
9293
|
+
const tabbableCandidates = toastItems.map((toastItem) => {
|
|
9294
|
+
const toastNode = toastItem.ref.current;
|
|
9295
|
+
const toastTabbableCandidates = [toastNode, ...getTabbableCandidates(toastNode)];
|
|
9296
|
+
return tabbingDirection === "forwards" ? toastTabbableCandidates : toastTabbableCandidates.reverse();
|
|
9297
|
+
});
|
|
9298
|
+
return (tabbingDirection === "forwards" ? tabbableCandidates.reverse() : tabbableCandidates).flat();
|
|
9299
|
+
},
|
|
9300
|
+
[getItems]
|
|
9301
|
+
);
|
|
9302
|
+
React14.useEffect(() => {
|
|
9303
|
+
const viewport = ref.current;
|
|
9304
|
+
if (viewport) {
|
|
9305
|
+
const handleKeyDown = /* @__PURE__ */ __name((event) => {
|
|
9306
|
+
const isMetaKey = event.altKey || event.ctrlKey || event.metaKey;
|
|
9307
|
+
const isTabKey = event.key === "Tab" && !isMetaKey;
|
|
9308
|
+
if (isTabKey) {
|
|
9309
|
+
const focusedElement = document.activeElement;
|
|
9310
|
+
const isTabbingBackwards = event.shiftKey;
|
|
9311
|
+
const targetIsViewport = event.target === viewport;
|
|
9312
|
+
if (targetIsViewport && isTabbingBackwards) {
|
|
9313
|
+
headFocusProxyRef.current?.focus();
|
|
9314
|
+
return;
|
|
9315
|
+
}
|
|
9316
|
+
const tabbingDirection = isTabbingBackwards ? "backwards" : "forwards";
|
|
9317
|
+
const sortedCandidates = getSortedTabbableCandidates({ tabbingDirection });
|
|
9318
|
+
const index = sortedCandidates.findIndex((candidate) => candidate === focusedElement);
|
|
9319
|
+
if (focusFirst(sortedCandidates.slice(index + 1))) {
|
|
9320
|
+
event.preventDefault();
|
|
9321
|
+
} else {
|
|
9322
|
+
isTabbingBackwards ? headFocusProxyRef.current?.focus() : tailFocusProxyRef.current?.focus();
|
|
9323
|
+
}
|
|
9324
|
+
}
|
|
9325
|
+
}, "handleKeyDown");
|
|
9326
|
+
viewport.addEventListener("keydown", handleKeyDown);
|
|
9327
|
+
return () => viewport.removeEventListener("keydown", handleKeyDown);
|
|
9328
|
+
}
|
|
9329
|
+
}, [getItems, getSortedTabbableCandidates]);
|
|
9330
|
+
return /* @__PURE__ */ jsxs117(
|
|
9331
|
+
Branch,
|
|
9332
|
+
{
|
|
9333
|
+
ref: wrapperRef,
|
|
9334
|
+
role: "region",
|
|
9335
|
+
"aria-label": label.replace("{hotkey}", hotkeyLabel),
|
|
9336
|
+
tabIndex: -1,
|
|
9337
|
+
style: { pointerEvents: hasToasts ? void 0 : "none" },
|
|
9338
|
+
children: [
|
|
9339
|
+
hasToasts && /* @__PURE__ */ jsx175(
|
|
9340
|
+
FocusProxy,
|
|
9341
|
+
{
|
|
9342
|
+
ref: headFocusProxyRef,
|
|
9343
|
+
onFocusFromOutsideViewport: /* @__PURE__ */ __name(() => {
|
|
9344
|
+
const tabbableCandidates = getSortedTabbableCandidates({
|
|
9345
|
+
tabbingDirection: "forwards"
|
|
9346
|
+
});
|
|
9347
|
+
focusFirst(tabbableCandidates);
|
|
9348
|
+
}, "onFocusFromOutsideViewport")
|
|
9349
|
+
}
|
|
9350
|
+
),
|
|
9351
|
+
/* @__PURE__ */ jsx175(Collection.Slot, { scope: __scopeToast, children: /* @__PURE__ */ jsx175(Primitive.ol, { tabIndex: -1, ...viewportProps, ref: composedRefs }) }),
|
|
9352
|
+
hasToasts && /* @__PURE__ */ jsx175(
|
|
9353
|
+
FocusProxy,
|
|
9354
|
+
{
|
|
9355
|
+
ref: tailFocusProxyRef,
|
|
9356
|
+
onFocusFromOutsideViewport: /* @__PURE__ */ __name(() => {
|
|
9357
|
+
const tabbableCandidates = getSortedTabbableCandidates({
|
|
9358
|
+
tabbingDirection: "backwards"
|
|
9359
|
+
});
|
|
9360
|
+
focusFirst(tabbableCandidates);
|
|
9361
|
+
}, "onFocusFromOutsideViewport")
|
|
9362
|
+
}
|
|
9363
|
+
)
|
|
9364
|
+
]
|
|
9365
|
+
}
|
|
9366
|
+
);
|
|
9367
|
+
}
|
|
9368
|
+
);
|
|
9369
|
+
ToastViewport.displayName = VIEWPORT_NAME;
|
|
9370
|
+
var FOCUS_PROXY_NAME = "ToastFocusProxy";
|
|
9371
|
+
var FocusProxy = React14.forwardRef(
|
|
9372
|
+
(props, forwardedRef) => {
|
|
9373
|
+
const { __scopeToast, onFocusFromOutsideViewport, ...proxyProps } = props;
|
|
9374
|
+
const context = useToastProviderContext(FOCUS_PROXY_NAME, __scopeToast);
|
|
9375
|
+
return /* @__PURE__ */ jsx175(
|
|
9376
|
+
VisuallyHidden,
|
|
9377
|
+
{
|
|
9378
|
+
"aria-hidden": true,
|
|
9379
|
+
tabIndex: 0,
|
|
9380
|
+
...proxyProps,
|
|
9381
|
+
ref: forwardedRef,
|
|
9382
|
+
style: { position: "fixed" },
|
|
9383
|
+
onFocus: /* @__PURE__ */ __name((event) => {
|
|
9384
|
+
const prevFocusedElement = event.relatedTarget;
|
|
9385
|
+
const isFocusFromOutsideViewport = !context.viewport?.contains(prevFocusedElement);
|
|
9386
|
+
if (isFocusFromOutsideViewport) onFocusFromOutsideViewport();
|
|
9387
|
+
}, "onFocus")
|
|
9388
|
+
}
|
|
9389
|
+
);
|
|
9390
|
+
}
|
|
9391
|
+
);
|
|
9392
|
+
FocusProxy.displayName = FOCUS_PROXY_NAME;
|
|
9393
|
+
var TOAST_NAME = "Toast";
|
|
9394
|
+
var TOAST_SWIPE_START = "toast.swipeStart";
|
|
9395
|
+
var TOAST_SWIPE_MOVE = "toast.swipeMove";
|
|
9396
|
+
var TOAST_SWIPE_CANCEL = "toast.swipeCancel";
|
|
9397
|
+
var TOAST_SWIPE_END = "toast.swipeEnd";
|
|
9398
|
+
var Toast = React14.forwardRef(
|
|
9399
|
+
(props, forwardedRef) => {
|
|
9400
|
+
const { forceMount, open: openProp, defaultOpen, onOpenChange, ...toastProps } = props;
|
|
9401
|
+
const [open, setOpen] = useControllableState({
|
|
9402
|
+
prop: openProp,
|
|
9403
|
+
defaultProp: defaultOpen ?? true,
|
|
9404
|
+
onChange: onOpenChange,
|
|
9405
|
+
caller: TOAST_NAME
|
|
9406
|
+
});
|
|
9407
|
+
return /* @__PURE__ */ jsx175(Presence, { present: forceMount || open, children: /* @__PURE__ */ jsx175(
|
|
9408
|
+
ToastImpl,
|
|
9409
|
+
{
|
|
9410
|
+
open,
|
|
9411
|
+
...toastProps,
|
|
9412
|
+
ref: forwardedRef,
|
|
9413
|
+
onClose: /* @__PURE__ */ __name(() => setOpen(false), "onClose"),
|
|
9414
|
+
onPause: useCallbackRef(props.onPause),
|
|
9415
|
+
onResume: useCallbackRef(props.onResume),
|
|
9416
|
+
onSwipeStart: composeEventHandlers(props.onSwipeStart, (event) => {
|
|
9417
|
+
event.currentTarget.setAttribute("data-swipe", "start");
|
|
9418
|
+
}),
|
|
9419
|
+
onSwipeMove: composeEventHandlers(props.onSwipeMove, (event) => {
|
|
9420
|
+
const { x, y } = event.detail.delta;
|
|
9421
|
+
event.currentTarget.setAttribute("data-swipe", "move");
|
|
9422
|
+
event.currentTarget.style.setProperty("--radix-toast-swipe-move-x", `${x}px`);
|
|
9423
|
+
event.currentTarget.style.setProperty("--radix-toast-swipe-move-y", `${y}px`);
|
|
9424
|
+
}),
|
|
9425
|
+
onSwipeCancel: composeEventHandlers(props.onSwipeCancel, (event) => {
|
|
9426
|
+
event.currentTarget.setAttribute("data-swipe", "cancel");
|
|
9427
|
+
event.currentTarget.style.removeProperty("--radix-toast-swipe-move-x");
|
|
9428
|
+
event.currentTarget.style.removeProperty("--radix-toast-swipe-move-y");
|
|
9429
|
+
event.currentTarget.style.removeProperty("--radix-toast-swipe-end-x");
|
|
9430
|
+
event.currentTarget.style.removeProperty("--radix-toast-swipe-end-y");
|
|
9431
|
+
}),
|
|
9432
|
+
onSwipeEnd: composeEventHandlers(props.onSwipeEnd, (event) => {
|
|
9433
|
+
const { x, y } = event.detail.delta;
|
|
9434
|
+
event.currentTarget.setAttribute("data-swipe", "end");
|
|
9435
|
+
event.currentTarget.style.removeProperty("--radix-toast-swipe-move-x");
|
|
9436
|
+
event.currentTarget.style.removeProperty("--radix-toast-swipe-move-y");
|
|
9437
|
+
event.currentTarget.style.setProperty("--radix-toast-swipe-end-x", `${x}px`);
|
|
9438
|
+
event.currentTarget.style.setProperty("--radix-toast-swipe-end-y", `${y}px`);
|
|
9439
|
+
setOpen(false);
|
|
9440
|
+
})
|
|
9441
|
+
}
|
|
9442
|
+
) });
|
|
9443
|
+
}
|
|
9444
|
+
);
|
|
9445
|
+
Toast.displayName = TOAST_NAME;
|
|
9446
|
+
var [ToastInteractiveProvider, useToastInteractiveContext] = createToastContext(TOAST_NAME, {
|
|
9447
|
+
onClose() {
|
|
9448
|
+
}
|
|
9449
|
+
});
|
|
9450
|
+
var ToastImpl = React14.forwardRef(
|
|
9451
|
+
(props, forwardedRef) => {
|
|
9452
|
+
const {
|
|
9453
|
+
__scopeToast,
|
|
9454
|
+
type = "foreground",
|
|
9455
|
+
duration: durationProp,
|
|
9456
|
+
open,
|
|
9457
|
+
onClose,
|
|
9458
|
+
onEscapeKeyDown,
|
|
9459
|
+
onPause,
|
|
9460
|
+
onResume,
|
|
9461
|
+
onSwipeStart,
|
|
9462
|
+
onSwipeMove,
|
|
9463
|
+
onSwipeCancel,
|
|
9464
|
+
onSwipeEnd,
|
|
9465
|
+
...toastProps
|
|
9466
|
+
} = props;
|
|
9467
|
+
const context = useToastProviderContext(TOAST_NAME, __scopeToast);
|
|
9468
|
+
const [node, setNode] = React14.useState(null);
|
|
9469
|
+
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
9470
|
+
const pointerStartRef = React14.useRef(null);
|
|
9471
|
+
const swipeDeltaRef = React14.useRef(null);
|
|
9472
|
+
const duration = durationProp || context.duration;
|
|
9473
|
+
const closeTimerStartTimeRef = React14.useRef(0);
|
|
9474
|
+
const closeTimerRemainingTimeRef = React14.useRef(duration);
|
|
9475
|
+
const closeTimerRef = React14.useRef(0);
|
|
9476
|
+
const { onToastAdd, onToastRemove } = context;
|
|
9477
|
+
const handleClose = useCallbackRef(() => {
|
|
9478
|
+
const isFocusInToast = node?.contains(document.activeElement);
|
|
9479
|
+
if (isFocusInToast) context.viewport?.focus();
|
|
9480
|
+
onClose();
|
|
9481
|
+
});
|
|
9482
|
+
const startTimer = React14.useCallback(
|
|
9483
|
+
(duration2) => {
|
|
9484
|
+
if (!duration2 || duration2 === Infinity) return;
|
|
9485
|
+
window.clearTimeout(closeTimerRef.current);
|
|
9486
|
+
closeTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
|
|
9487
|
+
closeTimerRef.current = window.setTimeout(handleClose, duration2);
|
|
9488
|
+
},
|
|
9489
|
+
[handleClose]
|
|
9490
|
+
);
|
|
9491
|
+
React14.useEffect(() => {
|
|
9492
|
+
const viewport = context.viewport;
|
|
9493
|
+
if (viewport) {
|
|
9494
|
+
const handleResume = /* @__PURE__ */ __name(() => {
|
|
9495
|
+
startTimer(closeTimerRemainingTimeRef.current);
|
|
9496
|
+
onResume?.();
|
|
9497
|
+
}, "handleResume");
|
|
9498
|
+
const handlePause = /* @__PURE__ */ __name(() => {
|
|
9499
|
+
const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;
|
|
9500
|
+
closeTimerRemainingTimeRef.current = closeTimerRemainingTimeRef.current - elapsedTime;
|
|
9501
|
+
window.clearTimeout(closeTimerRef.current);
|
|
9502
|
+
onPause?.();
|
|
9503
|
+
}, "handlePause");
|
|
9504
|
+
viewport.addEventListener(VIEWPORT_PAUSE, handlePause);
|
|
9505
|
+
viewport.addEventListener(VIEWPORT_RESUME, handleResume);
|
|
9506
|
+
return () => {
|
|
9507
|
+
viewport.removeEventListener(VIEWPORT_PAUSE, handlePause);
|
|
9508
|
+
viewport.removeEventListener(VIEWPORT_RESUME, handleResume);
|
|
9509
|
+
};
|
|
9510
|
+
}
|
|
9511
|
+
}, [context.viewport, duration, onPause, onResume, startTimer]);
|
|
9512
|
+
React14.useEffect(() => {
|
|
9513
|
+
if (open && !context.isClosePausedRef.current) startTimer(duration);
|
|
9514
|
+
}, [open, duration, context.isClosePausedRef, startTimer]);
|
|
9515
|
+
React14.useEffect(() => {
|
|
9516
|
+
onToastAdd();
|
|
9517
|
+
return () => onToastRemove();
|
|
9518
|
+
}, [onToastAdd, onToastRemove]);
|
|
9519
|
+
const announceTextContent = React14.useMemo(() => {
|
|
9520
|
+
return node ? getAnnounceTextContent(node) : null;
|
|
9521
|
+
}, [node]);
|
|
9522
|
+
if (!context.viewport) return null;
|
|
9523
|
+
return /* @__PURE__ */ jsxs117(Fragment6, { children: [
|
|
9524
|
+
announceTextContent && /* @__PURE__ */ jsx175(
|
|
9525
|
+
ToastAnnounce,
|
|
9526
|
+
{
|
|
9527
|
+
__scopeToast,
|
|
9528
|
+
role: "status",
|
|
9529
|
+
"aria-live": type === "foreground" ? "assertive" : "polite",
|
|
9530
|
+
"aria-atomic": true,
|
|
9531
|
+
children: announceTextContent
|
|
9532
|
+
}
|
|
9533
|
+
),
|
|
9534
|
+
/* @__PURE__ */ jsx175(ToastInteractiveProvider, { scope: __scopeToast, onClose: handleClose, children: ReactDOM3.createPortal(
|
|
9535
|
+
/* @__PURE__ */ jsx175(Collection.ItemSlot, { scope: __scopeToast, children: /* @__PURE__ */ jsx175(
|
|
9536
|
+
Root,
|
|
9537
|
+
{
|
|
9538
|
+
asChild: true,
|
|
9539
|
+
onEscapeKeyDown: composeEventHandlers(onEscapeKeyDown, () => {
|
|
9540
|
+
if (!context.isFocusedToastEscapeKeyDownRef.current) handleClose();
|
|
9541
|
+
context.isFocusedToastEscapeKeyDownRef.current = false;
|
|
9542
|
+
}),
|
|
9543
|
+
children: /* @__PURE__ */ jsx175(
|
|
9544
|
+
Primitive.li,
|
|
9545
|
+
{
|
|
9546
|
+
role: "status",
|
|
9547
|
+
"aria-live": "off",
|
|
9548
|
+
"aria-atomic": true,
|
|
9549
|
+
tabIndex: 0,
|
|
9550
|
+
"data-state": open ? "open" : "closed",
|
|
9551
|
+
"data-swipe-direction": context.swipeDirection,
|
|
9552
|
+
...toastProps,
|
|
9553
|
+
ref: composedRefs,
|
|
9554
|
+
style: { userSelect: "none", touchAction: "none", ...props.style },
|
|
9555
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
9556
|
+
if (event.key !== "Escape") return;
|
|
9557
|
+
onEscapeKeyDown?.(event.nativeEvent);
|
|
9558
|
+
if (!event.nativeEvent.defaultPrevented) {
|
|
9559
|
+
context.isFocusedToastEscapeKeyDownRef.current = true;
|
|
9560
|
+
handleClose();
|
|
9561
|
+
}
|
|
9562
|
+
}),
|
|
9563
|
+
onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
|
|
9564
|
+
if (event.button !== 0) return;
|
|
9565
|
+
pointerStartRef.current = { x: event.clientX, y: event.clientY };
|
|
9566
|
+
}),
|
|
9567
|
+
onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {
|
|
9568
|
+
if (!pointerStartRef.current) return;
|
|
9569
|
+
const x = event.clientX - pointerStartRef.current.x;
|
|
9570
|
+
const y = event.clientY - pointerStartRef.current.y;
|
|
9571
|
+
const hasSwipeMoveStarted = Boolean(swipeDeltaRef.current);
|
|
9572
|
+
const isHorizontalSwipe = ["left", "right"].includes(context.swipeDirection);
|
|
9573
|
+
const clamp = ["left", "up"].includes(context.swipeDirection) ? Math.min : Math.max;
|
|
9574
|
+
const clampedX = isHorizontalSwipe ? clamp(0, x) : 0;
|
|
9575
|
+
const clampedY = !isHorizontalSwipe ? clamp(0, y) : 0;
|
|
9576
|
+
const moveStartBuffer = event.pointerType === "touch" ? 10 : 2;
|
|
9577
|
+
const delta = { x: clampedX, y: clampedY };
|
|
9578
|
+
const eventDetail = { originalEvent: event, delta };
|
|
9579
|
+
if (hasSwipeMoveStarted) {
|
|
9580
|
+
swipeDeltaRef.current = delta;
|
|
9581
|
+
handleAndDispatchCustomEvent2(TOAST_SWIPE_MOVE, onSwipeMove, eventDetail, {
|
|
9582
|
+
discrete: false
|
|
9583
|
+
});
|
|
9584
|
+
} else if (isDeltaInDirection(delta, context.swipeDirection, moveStartBuffer)) {
|
|
9585
|
+
swipeDeltaRef.current = delta;
|
|
9586
|
+
handleAndDispatchCustomEvent2(TOAST_SWIPE_START, onSwipeStart, eventDetail, {
|
|
9587
|
+
discrete: false
|
|
9588
|
+
});
|
|
9589
|
+
event.target.setPointerCapture(event.pointerId);
|
|
9590
|
+
} else if (Math.abs(x) > moveStartBuffer || Math.abs(y) > moveStartBuffer) {
|
|
9591
|
+
pointerStartRef.current = null;
|
|
9592
|
+
}
|
|
9593
|
+
}),
|
|
9594
|
+
onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {
|
|
9595
|
+
const delta = swipeDeltaRef.current;
|
|
9596
|
+
const target = event.target;
|
|
9597
|
+
if (target.hasPointerCapture(event.pointerId)) {
|
|
9598
|
+
target.releasePointerCapture(event.pointerId);
|
|
9599
|
+
}
|
|
9600
|
+
swipeDeltaRef.current = null;
|
|
9601
|
+
pointerStartRef.current = null;
|
|
9602
|
+
if (delta) {
|
|
9603
|
+
const toast = event.currentTarget;
|
|
9604
|
+
const eventDetail = { originalEvent: event, delta };
|
|
9605
|
+
if (isDeltaInDirection(delta, context.swipeDirection, context.swipeThreshold)) {
|
|
9606
|
+
handleAndDispatchCustomEvent2(TOAST_SWIPE_END, onSwipeEnd, eventDetail, {
|
|
9607
|
+
discrete: true
|
|
9608
|
+
});
|
|
9609
|
+
} else {
|
|
9610
|
+
handleAndDispatchCustomEvent2(
|
|
9611
|
+
TOAST_SWIPE_CANCEL,
|
|
9612
|
+
onSwipeCancel,
|
|
9613
|
+
eventDetail,
|
|
9614
|
+
{
|
|
9615
|
+
discrete: true
|
|
9616
|
+
}
|
|
9617
|
+
);
|
|
9618
|
+
}
|
|
9619
|
+
toast.addEventListener("click", (event2) => event2.preventDefault(), {
|
|
9620
|
+
once: true
|
|
9621
|
+
});
|
|
9622
|
+
}
|
|
9623
|
+
})
|
|
9624
|
+
}
|
|
9625
|
+
)
|
|
9626
|
+
}
|
|
9627
|
+
) }),
|
|
9628
|
+
context.viewport
|
|
9629
|
+
) })
|
|
9630
|
+
] });
|
|
9631
|
+
}
|
|
9632
|
+
);
|
|
9633
|
+
var ToastAnnounce = /* @__PURE__ */ __name((props) => {
|
|
9634
|
+
const { __scopeToast, children, ...announceProps } = props;
|
|
9635
|
+
const context = useToastProviderContext(TOAST_NAME, __scopeToast);
|
|
9636
|
+
const [renderAnnounceText, setRenderAnnounceText] = React14.useState(false);
|
|
9637
|
+
const [isAnnounced, setIsAnnounced] = React14.useState(false);
|
|
9638
|
+
useNextFrame(() => setRenderAnnounceText(true));
|
|
9639
|
+
React14.useEffect(() => {
|
|
9640
|
+
const timer = window.setTimeout(() => setIsAnnounced(true), 1e3);
|
|
9641
|
+
return () => window.clearTimeout(timer);
|
|
9642
|
+
}, []);
|
|
9643
|
+
return isAnnounced ? null : /* @__PURE__ */ jsx175(Portal, { asChild: true, children: /* @__PURE__ */ jsx175(VisuallyHidden, { ...announceProps, children: renderAnnounceText && /* @__PURE__ */ jsxs117(Fragment6, { children: [
|
|
9644
|
+
context.label,
|
|
9645
|
+
" ",
|
|
9646
|
+
children
|
|
9647
|
+
] }) }) });
|
|
9648
|
+
}, "ToastAnnounce");
|
|
9649
|
+
var TITLE_NAME = "ToastTitle";
|
|
9650
|
+
var ToastTitle = React14.forwardRef(
|
|
9651
|
+
(props, forwardedRef) => {
|
|
9652
|
+
const { __scopeToast, ...titleProps } = props;
|
|
9653
|
+
return /* @__PURE__ */ jsx175(Primitive.div, { ...titleProps, ref: forwardedRef });
|
|
9654
|
+
}
|
|
9655
|
+
);
|
|
9656
|
+
ToastTitle.displayName = TITLE_NAME;
|
|
9657
|
+
var DESCRIPTION_NAME = "ToastDescription";
|
|
9658
|
+
var ToastDescription = React14.forwardRef(
|
|
9659
|
+
(props, forwardedRef) => {
|
|
9660
|
+
const { __scopeToast, ...descriptionProps } = props;
|
|
9661
|
+
return /* @__PURE__ */ jsx175(Primitive.div, { ...descriptionProps, ref: forwardedRef });
|
|
9662
|
+
}
|
|
9663
|
+
);
|
|
9664
|
+
ToastDescription.displayName = DESCRIPTION_NAME;
|
|
9665
|
+
var ACTION_NAME = "ToastAction";
|
|
9666
|
+
var ToastAction = React14.forwardRef(
|
|
9667
|
+
(props, forwardedRef) => {
|
|
9668
|
+
const { altText, ...actionProps } = props;
|
|
9669
|
+
if (!altText.trim()) {
|
|
9670
|
+
console.error(
|
|
9671
|
+
`Invalid prop \`altText\` supplied to \`${ACTION_NAME}\`. Expected non-empty \`string\`.`
|
|
9672
|
+
);
|
|
9673
|
+
return null;
|
|
9674
|
+
}
|
|
9675
|
+
return /* @__PURE__ */ jsx175(ToastAnnounceExclude, { altText, asChild: true, children: /* @__PURE__ */ jsx175(ToastClose, { ...actionProps, ref: forwardedRef }) });
|
|
9676
|
+
}
|
|
9677
|
+
);
|
|
9678
|
+
ToastAction.displayName = ACTION_NAME;
|
|
9679
|
+
var CLOSE_NAME = "ToastClose";
|
|
9680
|
+
var ToastClose = React14.forwardRef(
|
|
9681
|
+
(props, forwardedRef) => {
|
|
9682
|
+
const { __scopeToast, ...closeProps } = props;
|
|
9683
|
+
const interactiveContext = useToastInteractiveContext(CLOSE_NAME, __scopeToast);
|
|
9684
|
+
return /* @__PURE__ */ jsx175(ToastAnnounceExclude, { asChild: true, children: /* @__PURE__ */ jsx175(
|
|
9685
|
+
Primitive.button,
|
|
9686
|
+
{
|
|
9687
|
+
type: "button",
|
|
9688
|
+
...closeProps,
|
|
9689
|
+
ref: forwardedRef,
|
|
9690
|
+
onClick: composeEventHandlers(props.onClick, interactiveContext.onClose)
|
|
9691
|
+
}
|
|
9692
|
+
) });
|
|
9693
|
+
}
|
|
9694
|
+
);
|
|
9695
|
+
ToastClose.displayName = CLOSE_NAME;
|
|
9696
|
+
var ToastAnnounceExclude = React14.forwardRef((props, forwardedRef) => {
|
|
9697
|
+
const { __scopeToast, altText, ...announceExcludeProps } = props;
|
|
9698
|
+
return /* @__PURE__ */ jsx175(
|
|
9699
|
+
Primitive.div,
|
|
9700
|
+
{
|
|
9701
|
+
"data-radix-toast-announce-exclude": "",
|
|
9702
|
+
"data-radix-toast-announce-alt": altText || void 0,
|
|
9703
|
+
...announceExcludeProps,
|
|
9704
|
+
ref: forwardedRef
|
|
9705
|
+
}
|
|
9706
|
+
);
|
|
9707
|
+
});
|
|
9708
|
+
function getAnnounceTextContent(container) {
|
|
9709
|
+
const textContent = [];
|
|
9710
|
+
const childNodes = Array.from(container.childNodes);
|
|
9711
|
+
childNodes.forEach((node) => {
|
|
9712
|
+
if (node.nodeType === node.TEXT_NODE && node.textContent) textContent.push(node.textContent);
|
|
9713
|
+
if (isHTMLElement(node)) {
|
|
9714
|
+
const isHidden = node.ariaHidden || node.hidden || node.style.display === "none";
|
|
9715
|
+
const isExcluded = node.dataset.radixToastAnnounceExclude === "";
|
|
9716
|
+
if (!isHidden) {
|
|
9717
|
+
if (isExcluded) {
|
|
9718
|
+
const altText = node.dataset.radixToastAnnounceAlt;
|
|
9719
|
+
if (altText) textContent.push(altText);
|
|
9720
|
+
} else {
|
|
9721
|
+
textContent.push(...getAnnounceTextContent(node));
|
|
9722
|
+
}
|
|
9723
|
+
}
|
|
9724
|
+
}
|
|
9725
|
+
});
|
|
9726
|
+
return textContent;
|
|
9727
|
+
}
|
|
9728
|
+
__name(getAnnounceTextContent, "getAnnounceTextContent");
|
|
9729
|
+
function handleAndDispatchCustomEvent2(name, handler, detail, { discrete }) {
|
|
9730
|
+
const currentTarget = detail.originalEvent.currentTarget;
|
|
9731
|
+
const event = new CustomEvent(name, { bubbles: true, cancelable: true, detail });
|
|
9732
|
+
if (handler) currentTarget.addEventListener(name, handler, { once: true });
|
|
9733
|
+
if (discrete) {
|
|
9734
|
+
dispatchDiscreteCustomEvent(currentTarget, event);
|
|
9735
|
+
} else {
|
|
9736
|
+
currentTarget.dispatchEvent(event);
|
|
9737
|
+
}
|
|
9738
|
+
}
|
|
9739
|
+
__name(handleAndDispatchCustomEvent2, "handleAndDispatchCustomEvent");
|
|
9740
|
+
var isDeltaInDirection = /* @__PURE__ */ __name((delta, direction, threshold = 0) => {
|
|
9741
|
+
const deltaX = Math.abs(delta.x);
|
|
9742
|
+
const deltaY = Math.abs(delta.y);
|
|
9743
|
+
const isDeltaX = deltaX > deltaY;
|
|
9744
|
+
if (direction === "left" || direction === "right") {
|
|
9745
|
+
return isDeltaX && deltaX > threshold;
|
|
9746
|
+
} else {
|
|
9747
|
+
return !isDeltaX && deltaY > threshold;
|
|
9748
|
+
}
|
|
9749
|
+
}, "isDeltaInDirection");
|
|
9750
|
+
function useNextFrame(callback = () => {
|
|
9751
|
+
}) {
|
|
9752
|
+
const fn = useCallbackRef(callback);
|
|
9753
|
+
useLayoutEffect2(() => {
|
|
9754
|
+
let raf1 = 0;
|
|
9755
|
+
let raf2 = 0;
|
|
9756
|
+
raf1 = window.requestAnimationFrame(() => raf2 = window.requestAnimationFrame(fn));
|
|
9757
|
+
return () => {
|
|
9758
|
+
window.cancelAnimationFrame(raf1);
|
|
9759
|
+
window.cancelAnimationFrame(raf2);
|
|
9760
|
+
};
|
|
9761
|
+
}, [fn]);
|
|
9762
|
+
}
|
|
9763
|
+
__name(useNextFrame, "useNextFrame");
|
|
9764
|
+
function isHTMLElement(node) {
|
|
9765
|
+
return node.nodeType === node.ELEMENT_NODE;
|
|
9766
|
+
}
|
|
9767
|
+
__name(isHTMLElement, "isHTMLElement");
|
|
9768
|
+
function getTabbableCandidates(container) {
|
|
9769
|
+
const nodes = [];
|
|
9770
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
9771
|
+
acceptNode: /* @__PURE__ */ __name((node) => {
|
|
9772
|
+
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
9773
|
+
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
|
|
9774
|
+
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
9775
|
+
}, "acceptNode")
|
|
9776
|
+
});
|
|
9777
|
+
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
9778
|
+
return nodes;
|
|
9779
|
+
}
|
|
9780
|
+
__name(getTabbableCandidates, "getTabbableCandidates");
|
|
9781
|
+
function focusFirst(candidates) {
|
|
9782
|
+
const previouslyFocusedElement = document.activeElement;
|
|
9783
|
+
return candidates.some((candidate) => {
|
|
9784
|
+
if (candidate === previouslyFocusedElement) return true;
|
|
9785
|
+
candidate.focus();
|
|
9786
|
+
return document.activeElement !== previouslyFocusedElement;
|
|
9787
|
+
});
|
|
9788
|
+
}
|
|
9789
|
+
__name(focusFirst, "focusFirst");
|
|
9790
|
+
var Provider = ToastProvider;
|
|
9791
|
+
var Viewport = ToastViewport;
|
|
9792
|
+
var Root2 = Toast;
|
|
9793
|
+
var Title = ToastTitle;
|
|
8357
9794
|
|
|
8358
9795
|
// src/components/Toast/style.module.scss
|
|
8359
9796
|
var style_module_default4 = {
|
|
@@ -8368,11 +9805,11 @@ var style_module_default4 = {
|
|
|
8368
9805
|
};
|
|
8369
9806
|
|
|
8370
9807
|
// src/components/Toast/index.tsx
|
|
8371
|
-
import { useEffect, useRef, useState } from "react";
|
|
9808
|
+
import { useEffect as useEffect8, useRef as useRef7, useState as useState6 } from "react";
|
|
8372
9809
|
|
|
8373
9810
|
// src/components/Typography/Set/Paragraph.tsx
|
|
8374
9811
|
import clsx3 from "clsx";
|
|
8375
|
-
import { forwardRef as
|
|
9812
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
8376
9813
|
|
|
8377
9814
|
// src/components/Typography/utils.ts
|
|
8378
9815
|
import { cva as cva4 } from "cva";
|
|
@@ -8414,10 +9851,10 @@ var colorVariants = cva4({
|
|
|
8414
9851
|
});
|
|
8415
9852
|
|
|
8416
9853
|
// src/components/Typography/Set/Paragraph.tsx
|
|
8417
|
-
import { jsx as
|
|
8418
|
-
var Paragraph =
|
|
9854
|
+
import { jsx as jsx176 } from "react/jsx-runtime";
|
|
9855
|
+
var Paragraph = forwardRef8(
|
|
8419
9856
|
({ size, type, weight, className, children, color = "neutral-label-primary", as: Element = "p", ...rest }, ref) => {
|
|
8420
|
-
return /* @__PURE__ */
|
|
9857
|
+
return /* @__PURE__ */ jsx176(
|
|
8421
9858
|
Element,
|
|
8422
9859
|
{
|
|
8423
9860
|
...rest,
|
|
@@ -8908,27 +10345,27 @@ var loading_default = {
|
|
|
8908
10345
|
|
|
8909
10346
|
// src/components/Toast/index.tsx
|
|
8910
10347
|
import { millisecondsInSecond as millisecondsInSecond2 } from "date-fns/constants";
|
|
8911
|
-
import { jsx as
|
|
10348
|
+
import { jsx as jsx177, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
8912
10349
|
import { createElement } from "react";
|
|
8913
10350
|
var Toaster = /* @__PURE__ */ __name(() => {
|
|
8914
10351
|
const list = useRecoilValue(toastAtom);
|
|
8915
|
-
return /* @__PURE__ */
|
|
10352
|
+
return /* @__PURE__ */ jsxs118(Provider, { children: [
|
|
8916
10353
|
list.map((props) => /* @__PURE__ */ createElement(SingleToast, { ...props, key: props.toastId })),
|
|
8917
|
-
/* @__PURE__ */
|
|
10354
|
+
/* @__PURE__ */ jsx177(Viewport, { className: style_module_default4.ToastViewport })
|
|
8918
10355
|
] });
|
|
8919
10356
|
}, "Toaster");
|
|
8920
10357
|
var SingleToast = /* @__PURE__ */ __name((props) => {
|
|
8921
10358
|
const setToast = useSetRecoilState2(toastAtom);
|
|
8922
|
-
const timerRef =
|
|
10359
|
+
const timerRef = useRef7();
|
|
8923
10360
|
const { message, icon, button, timer, toastId, isLoading } = props;
|
|
8924
|
-
const [isOpen, setIsOpen] =
|
|
8925
|
-
const lottieRef =
|
|
8926
|
-
const toastSuccess =
|
|
10361
|
+
const [isOpen, setIsOpen] = useState6(true);
|
|
10362
|
+
const lottieRef = useRef7(null);
|
|
10363
|
+
const toastSuccess = useRef7(false);
|
|
8927
10364
|
const removeToast = /* @__PURE__ */ __name(() => {
|
|
8928
10365
|
setToast((prev) => prev.filter((toast) => toast.toastId !== toastId));
|
|
8929
10366
|
timerRef.current && clearTimeout(timerRef.current);
|
|
8930
10367
|
}, "removeToast");
|
|
8931
|
-
|
|
10368
|
+
useEffect8(() => {
|
|
8932
10369
|
if (isLoading && !toastSuccess.current) {
|
|
8933
10370
|
if (lottieRef.current) {
|
|
8934
10371
|
Lottie.loadAnimation({
|
|
@@ -8956,12 +10393,12 @@ var SingleToast = /* @__PURE__ */ __name((props) => {
|
|
|
8956
10393
|
}, [isLoading]);
|
|
8957
10394
|
const renderIcon = /* @__PURE__ */ __name(() => {
|
|
8958
10395
|
if (!icon) return null;
|
|
8959
|
-
return /* @__PURE__ */
|
|
10396
|
+
return /* @__PURE__ */ jsx177("i", { className: style_module_default4.Icon, children: /* @__PURE__ */ jsx177(Icon, { ...icon, size: "m" }) });
|
|
8960
10397
|
}, "renderIcon");
|
|
8961
|
-
return /* @__PURE__ */
|
|
8962
|
-
isLoading && !toastSuccess.current ? /* @__PURE__ */
|
|
8963
|
-
/* @__PURE__ */
|
|
8964
|
-
/* @__PURE__ */
|
|
10398
|
+
return /* @__PURE__ */ jsxs118(Root2, { className: style_module_default4.ToastRoot, open: isOpen, ...props, children: [
|
|
10399
|
+
isLoading && !toastSuccess.current ? /* @__PURE__ */ jsx177("div", { ref: lottieRef, style: { width: "24px", height: "24px" } }) : renderIcon(),
|
|
10400
|
+
/* @__PURE__ */ jsxs118(Title, { className: style_module_default4.ToastTitle, children: [
|
|
10401
|
+
/* @__PURE__ */ jsx177(
|
|
8965
10402
|
Paragraph,
|
|
8966
10403
|
{
|
|
8967
10404
|
className: style_module_default4.TitleText,
|
|
@@ -8972,7 +10409,7 @@ var SingleToast = /* @__PURE__ */ __name((props) => {
|
|
|
8972
10409
|
children: message
|
|
8973
10410
|
}
|
|
8974
10411
|
),
|
|
8975
|
-
button && /* @__PURE__ */
|
|
10412
|
+
button && /* @__PURE__ */ jsx177(
|
|
8976
10413
|
Button,
|
|
8977
10414
|
{
|
|
8978
10415
|
onClick: () => {
|
|
@@ -8994,13 +10431,13 @@ var SingleToast = /* @__PURE__ */ __name((props) => {
|
|
|
8994
10431
|
}, "SingleToast");
|
|
8995
10432
|
|
|
8996
10433
|
// src/components/Typography/Set/Heading.tsx
|
|
8997
|
-
import { forwardRef as
|
|
10434
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
8998
10435
|
import clsx4 from "clsx";
|
|
8999
|
-
import { jsx as
|
|
9000
|
-
var Heading =
|
|
10436
|
+
import { jsx as jsx178 } from "react/jsx-runtime";
|
|
10437
|
+
var Heading = forwardRef9(
|
|
9001
10438
|
({ size, children, type, className, color = "neutral-label-primary", as, ...rest }, ref) => {
|
|
9002
10439
|
const Element = as || `h${size}`;
|
|
9003
|
-
return /* @__PURE__ */
|
|
10440
|
+
return /* @__PURE__ */ jsx178(
|
|
9004
10441
|
Element,
|
|
9005
10442
|
{
|
|
9006
10443
|
...rest,
|
|
@@ -9014,11 +10451,11 @@ var Heading = forwardRef3(
|
|
|
9014
10451
|
|
|
9015
10452
|
// src/components/Typography/Set/Caption.tsx
|
|
9016
10453
|
import clsx5 from "clsx";
|
|
9017
|
-
import { forwardRef as
|
|
9018
|
-
import { jsx as
|
|
9019
|
-
var Caption =
|
|
10454
|
+
import { forwardRef as forwardRef10 } from "react";
|
|
10455
|
+
import { jsx as jsx179 } from "react/jsx-runtime";
|
|
10456
|
+
var Caption = forwardRef10(
|
|
9020
10457
|
({ children, size, weight, type, className, color = "neutral-label-primary", as: Element = "p", ...rest }, ref) => {
|
|
9021
|
-
return /* @__PURE__ */
|
|
10458
|
+
return /* @__PURE__ */ jsx179(
|
|
9022
10459
|
Element,
|
|
9023
10460
|
{
|
|
9024
10461
|
...rest,
|
|
@@ -9036,12 +10473,12 @@ var Caption = forwardRef4(
|
|
|
9036
10473
|
);
|
|
9037
10474
|
|
|
9038
10475
|
// src/components/Typography/Set/Title.tsx
|
|
9039
|
-
import { forwardRef as
|
|
10476
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
9040
10477
|
import clsx6 from "clsx";
|
|
9041
|
-
import { jsx as
|
|
9042
|
-
var Title2 =
|
|
10478
|
+
import { jsx as jsx180 } from "react/jsx-runtime";
|
|
10479
|
+
var Title2 = forwardRef11(
|
|
9043
10480
|
({ weight, size, type, className, children, color = "neutral-label-primary", as: Element = "p", ...rest }, ref) => {
|
|
9044
|
-
return /* @__PURE__ */
|
|
10481
|
+
return /* @__PURE__ */ jsx180(
|
|
9045
10482
|
Element,
|
|
9046
10483
|
{
|
|
9047
10484
|
...rest,
|
|
@@ -9055,11 +10492,11 @@ var Title2 = forwardRef5(
|
|
|
9055
10492
|
|
|
9056
10493
|
// src/components/Typography/Set/Display.tsx
|
|
9057
10494
|
import clsx7 from "clsx";
|
|
9058
|
-
import { forwardRef as
|
|
9059
|
-
import { jsx as
|
|
9060
|
-
var Display =
|
|
10495
|
+
import { forwardRef as forwardRef12 } from "react";
|
|
10496
|
+
import { jsx as jsx181 } from "react/jsx-runtime";
|
|
10497
|
+
var Display = forwardRef12(
|
|
9061
10498
|
({ size, type, weight, className, children, color = "neutral-label-primary", as: Element = "p", ...rest }, ref) => {
|
|
9062
|
-
return /* @__PURE__ */
|
|
10499
|
+
return /* @__PURE__ */ jsx181(
|
|
9063
10500
|
Element,
|
|
9064
10501
|
{
|
|
9065
10502
|
...rest,
|
|
@@ -9092,7 +10529,7 @@ var rootMediaStyle = AppMedia.createMediaStyle();
|
|
|
9092
10529
|
var { MediaContextProvider, Media } = AppMedia;
|
|
9093
10530
|
|
|
9094
10531
|
// src/components/Typography/Responsive/index.tsx
|
|
9095
|
-
import { Fragment as
|
|
10532
|
+
import { Fragment as Fragment7, jsx as jsx182 } from "react/jsx-runtime";
|
|
9096
10533
|
import { createElement as createElement2 } from "react";
|
|
9097
10534
|
var TypographyImpl = /* @__PURE__ */ __name(({ level, text, ...rest }) => {
|
|
9098
10535
|
const commonProps = {
|
|
@@ -9101,15 +10538,15 @@ var TypographyImpl = /* @__PURE__ */ __name(({ level, text, ...rest }) => {
|
|
|
9101
10538
|
};
|
|
9102
10539
|
switch (level) {
|
|
9103
10540
|
case "caption":
|
|
9104
|
-
return /* @__PURE__ */
|
|
10541
|
+
return /* @__PURE__ */ jsx182(Caption, { ...commonProps });
|
|
9105
10542
|
case "display":
|
|
9106
|
-
return /* @__PURE__ */
|
|
10543
|
+
return /* @__PURE__ */ jsx182(Display, { ...commonProps });
|
|
9107
10544
|
case "heading":
|
|
9108
|
-
return /* @__PURE__ */
|
|
10545
|
+
return /* @__PURE__ */ jsx182(Heading, { ...commonProps });
|
|
9109
10546
|
case "paragraph":
|
|
9110
|
-
return /* @__PURE__ */
|
|
10547
|
+
return /* @__PURE__ */ jsx182(Paragraph, { ...commonProps });
|
|
9111
10548
|
case "title":
|
|
9112
|
-
return /* @__PURE__ */
|
|
10549
|
+
return /* @__PURE__ */ jsx182(Title2, { ...commonProps });
|
|
9113
10550
|
default:
|
|
9114
10551
|
return null;
|
|
9115
10552
|
}
|
|
@@ -9150,11 +10587,11 @@ var Typography = /* @__PURE__ */ __name((props) => {
|
|
|
9150
10587
|
}, "createMediaProps");
|
|
9151
10588
|
return (
|
|
9152
10589
|
// Fragment없이도 원래 동작해야하는데 liner-web에서 JSX.Element가 배열로 오면 에러 띄워서 임시로 Fragment로 래핑합니다.
|
|
9153
|
-
/* @__PURE__ */
|
|
10590
|
+
/* @__PURE__ */ jsx182(Fragment7, { children: breakPointKeyArray.map((breakPointKey) => {
|
|
9154
10591
|
const variable = props[breakPointKey];
|
|
9155
10592
|
const isExistVariable = !!variable;
|
|
9156
10593
|
if (isExistVariable) {
|
|
9157
|
-
return /* @__PURE__ */ createElement2(Media, { ...createMediaProps(breakPointKey), key: breakPointKey }, /* @__PURE__ */
|
|
10594
|
+
return /* @__PURE__ */ createElement2(Media, { ...createMediaProps(breakPointKey), key: breakPointKey }, /* @__PURE__ */ jsx182(TypographyImpl, { ...variable, text: variable.text || children }));
|
|
9158
10595
|
}
|
|
9159
10596
|
return null;
|
|
9160
10597
|
}) })
|
|
@@ -9162,8 +10599,8 @@ var Typography = /* @__PURE__ */ __name((props) => {
|
|
|
9162
10599
|
}, "Typography");
|
|
9163
10600
|
|
|
9164
10601
|
// src/components/Popover/index.tsx
|
|
9165
|
-
import * as
|
|
9166
|
-
import
|
|
10602
|
+
import * as React17 from "react";
|
|
10603
|
+
import { Popover as PopoverPrimitive } from "radix-ui";
|
|
9167
10604
|
|
|
9168
10605
|
// src/components/Popover/style.module.scss
|
|
9169
10606
|
var style_module_default6 = {
|
|
@@ -9206,9 +10643,9 @@ var style_module_default7 = {
|
|
|
9206
10643
|
};
|
|
9207
10644
|
|
|
9208
10645
|
// src/components/TextButton/index.tsx
|
|
9209
|
-
import { Children as
|
|
10646
|
+
import { Children as Children4, cloneElement as cloneElement4, forwardRef as forwardRef13 } from "react";
|
|
9210
10647
|
import clsx8 from "clsx";
|
|
9211
|
-
import { jsx as
|
|
10648
|
+
import { jsx as jsx183, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
9212
10649
|
var textButtonLevelIconTypeMap = {
|
|
9213
10650
|
primary: "brand-label-primary",
|
|
9214
10651
|
secondary: "neutral-label-primary",
|
|
@@ -9245,7 +10682,7 @@ var textButtonVariants = cva5({
|
|
|
9245
10682
|
}
|
|
9246
10683
|
}
|
|
9247
10684
|
});
|
|
9248
|
-
var TextButton =
|
|
10685
|
+
var TextButton = forwardRef13(
|
|
9249
10686
|
({
|
|
9250
10687
|
level = "primary",
|
|
9251
10688
|
thick = false,
|
|
@@ -9265,14 +10702,14 @@ var TextButton = forwardRef7(
|
|
|
9265
10702
|
fillType: textButtonLevelIconFillTypeMap[level],
|
|
9266
10703
|
...icon
|
|
9267
10704
|
}), "getIconProps");
|
|
9268
|
-
const renderContent = /* @__PURE__ */ __name((children2) => /* @__PURE__ */
|
|
9269
|
-
leftIcon && /* @__PURE__ */
|
|
9270
|
-
/* @__PURE__ */
|
|
9271
|
-
rightIcon && /* @__PURE__ */
|
|
10705
|
+
const renderContent = /* @__PURE__ */ __name((children2) => /* @__PURE__ */ jsxs119("span", { className: style_module_default7["text-children"], children: [
|
|
10706
|
+
leftIcon && /* @__PURE__ */ jsx183(Icon, { ...getIconProps(leftIcon) }),
|
|
10707
|
+
/* @__PURE__ */ jsx183("p", { children: children2 }),
|
|
10708
|
+
rightIcon && /* @__PURE__ */ jsx183(Icon, { ...getIconProps(rightIcon) })
|
|
9272
10709
|
] }), "renderContent");
|
|
9273
10710
|
if (asChild) {
|
|
9274
|
-
const parent =
|
|
9275
|
-
return
|
|
10711
|
+
const parent = Children4.only(children);
|
|
10712
|
+
return cloneElement4(
|
|
9276
10713
|
parent,
|
|
9277
10714
|
{
|
|
9278
10715
|
...rest,
|
|
@@ -9282,7 +10719,7 @@ var TextButton = forwardRef7(
|
|
|
9282
10719
|
renderContent(parent.props.children)
|
|
9283
10720
|
);
|
|
9284
10721
|
}
|
|
9285
|
-
return /* @__PURE__ */
|
|
10722
|
+
return /* @__PURE__ */ jsx183(
|
|
9286
10723
|
"button",
|
|
9287
10724
|
{
|
|
9288
10725
|
className: clsx8(textButtonVariants({ level, thick, underline, size }), className),
|
|
@@ -9296,7 +10733,7 @@ var TextButton = forwardRef7(
|
|
|
9296
10733
|
TextButton.displayName = "TextButton";
|
|
9297
10734
|
|
|
9298
10735
|
// src/components/Popover/index.tsx
|
|
9299
|
-
import { Fragment as
|
|
10736
|
+
import { Fragment as Fragment8, jsx as jsx184, jsxs as jsxs120 } from "react/jsx-runtime";
|
|
9300
10737
|
var DEFAULT_OFFSET = -6;
|
|
9301
10738
|
var popoverVariants = cva6({
|
|
9302
10739
|
base: style_module_default6.content,
|
|
@@ -9318,20 +10755,33 @@ var popoverAnchorVariants = cva6({
|
|
|
9318
10755
|
});
|
|
9319
10756
|
var popoverTagVariants = cva6({ base: [style_module_default6.tag, "lp-sys-typo-caption3-normal-bold"] });
|
|
9320
10757
|
var popoverTitleVariants = cva6({ base: [style_module_default6.title, "lp-sys-typo-paragraph3-normal-bold"] });
|
|
9321
|
-
var popoverDescriptionVariants = cva6({
|
|
10758
|
+
var popoverDescriptionVariants = cva6({
|
|
10759
|
+
base: [style_module_default6.description, "lp-sys-typo-caption1-normal-regular"]
|
|
10760
|
+
});
|
|
9322
10761
|
var popoverFooterVariants = cva6({ base: [style_module_default6.footer, "lp-sys-typo-caption1-normal-medium"] });
|
|
9323
|
-
var PopoverRoot = /* @__PURE__ */ __name(({ isOpen, children, onChange }) => /* @__PURE__ */
|
|
9324
|
-
var PopoverTrigger = /* @__PURE__ */ __name(({ by }) => /* @__PURE__ */
|
|
9325
|
-
var PopoverAnchor = /* @__PURE__ */ __name(({ className }) => /* @__PURE__ */
|
|
9326
|
-
"
|
|
10762
|
+
var PopoverRoot = /* @__PURE__ */ __name(({ isOpen, children, onChange }) => /* @__PURE__ */ jsx184(PopoverPrimitive.Root, { open: isOpen, onOpenChange: onChange, children }), "PopoverRoot");
|
|
10763
|
+
var PopoverTrigger = /* @__PURE__ */ __name(({ by }) => /* @__PURE__ */ jsx184(PopoverPrimitive.Trigger, { asChild: true, children: by }), "PopoverTrigger");
|
|
10764
|
+
var PopoverAnchor = /* @__PURE__ */ __name(({ className }) => /* @__PURE__ */ jsx184(
|
|
10765
|
+
"svg",
|
|
9327
10766
|
{
|
|
9328
|
-
|
|
9329
|
-
|
|
9330
|
-
|
|
9331
|
-
|
|
10767
|
+
className,
|
|
10768
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10769
|
+
width: "30",
|
|
10770
|
+
height: "10",
|
|
10771
|
+
viewBox: "0 0 30 10",
|
|
10772
|
+
fill: "none",
|
|
10773
|
+
children: /* @__PURE__ */ jsx184(
|
|
10774
|
+
"path",
|
|
10775
|
+
{
|
|
10776
|
+
fillRule: "evenodd",
|
|
10777
|
+
clipRule: "evenodd",
|
|
10778
|
+
d: "M0 9.9985C1.09308 9.9985 2.18584 10.005 3.27892 9.99081C4.32509 9.97696 5.49602 9.95734 6.51412 9.49459C7.6139 8.99453 8.34198 8.1202 9.07453 7.09123C9.60193 6.35114 10.6379 4.77211 11.1423 4.00971C11.5552 3.38463 12.3633 2.1491 12.8046 1.55134C13.3601 0.799326 14.0467 0 15.0003 0C15.954 0 16.6403 0.799326 17.1954 1.55057C17.6367 2.14795 18.4448 3.38425 18.858 4.00894C19.3618 4.77134 20.3978 6.35037 20.9255 7.09046C21.6593 8.11943 22.3861 8.99377 23.4856 9.49382C24.504 9.95542 25.6752 9.97619 26.7208 9.99004C27.8142 10.0043 28.9069 9.99773 30 9.99773",
|
|
10779
|
+
fill: "none"
|
|
10780
|
+
}
|
|
10781
|
+
)
|
|
9332
10782
|
}
|
|
9333
|
-
)
|
|
9334
|
-
var PopoverContent =
|
|
10783
|
+
), "PopoverAnchor");
|
|
10784
|
+
var PopoverContent = React17.forwardRef(
|
|
9335
10785
|
({
|
|
9336
10786
|
level = "primary",
|
|
9337
10787
|
position = "top",
|
|
@@ -9349,8 +10799,8 @@ var PopoverContent = React3.forwardRef(
|
|
|
9349
10799
|
children,
|
|
9350
10800
|
container,
|
|
9351
10801
|
...props
|
|
9352
|
-
}, ref) => /* @__PURE__ */
|
|
9353
|
-
/* @__PURE__ */
|
|
10802
|
+
}, ref) => /* @__PURE__ */ jsx184(PopoverPrimitive.Portal, { container, children: /* @__PURE__ */ jsxs120(Fragment8, { children: [
|
|
10803
|
+
/* @__PURE__ */ jsxs120(
|
|
9354
10804
|
PopoverPrimitive.Content,
|
|
9355
10805
|
{
|
|
9356
10806
|
ref,
|
|
@@ -9361,24 +10811,33 @@ var PopoverContent = React3.forwardRef(
|
|
|
9361
10811
|
className: clsx9(popoverVariants({ level }), className),
|
|
9362
10812
|
...props,
|
|
9363
10813
|
children: [
|
|
9364
|
-
/* @__PURE__ */
|
|
9365
|
-
(tag || icon || onClose) && /* @__PURE__ */
|
|
9366
|
-
tag && /* @__PURE__ */
|
|
9367
|
-
icon && /* @__PURE__ */
|
|
9368
|
-
/* @__PURE__ */
|
|
9369
|
-
onClose && /* @__PURE__ */
|
|
10814
|
+
/* @__PURE__ */ jsxs120("div", { className: style_module_default6.contentContainer, children: [
|
|
10815
|
+
(tag || icon || onClose) && /* @__PURE__ */ jsxs120("div", { className: style_module_default6.heading, children: [
|
|
10816
|
+
tag && /* @__PURE__ */ jsx184("span", { className: popoverTagVariants(), children: tag }),
|
|
10817
|
+
icon && /* @__PURE__ */ jsx184(Icon, { name: icon.name, size: "xs", thick: icon.thick, fill: icon.fill }),
|
|
10818
|
+
/* @__PURE__ */ jsx184("p", { className: popoverTitleVariants(), children: title }),
|
|
10819
|
+
onClose && /* @__PURE__ */ jsx184(
|
|
9370
10820
|
PopoverPrimitive.PopoverClose,
|
|
9371
10821
|
{
|
|
9372
10822
|
className: style_module_default6.closeButton,
|
|
9373
10823
|
onClick: () => {
|
|
9374
10824
|
onClose();
|
|
9375
10825
|
},
|
|
9376
|
-
children: /* @__PURE__ */
|
|
10826
|
+
children: /* @__PURE__ */ jsx184(
|
|
10827
|
+
Icon,
|
|
10828
|
+
{
|
|
10829
|
+
name: "close-fill",
|
|
10830
|
+
size: "s",
|
|
10831
|
+
fill: true,
|
|
10832
|
+
thick: true,
|
|
10833
|
+
type: "neutral-label-static-primary"
|
|
10834
|
+
}
|
|
10835
|
+
)
|
|
9377
10836
|
}
|
|
9378
10837
|
)
|
|
9379
10838
|
] }),
|
|
9380
|
-
description && /* @__PURE__ */
|
|
9381
|
-
onConfirm && /* @__PURE__ */
|
|
10839
|
+
description && /* @__PURE__ */ jsx184("p", { className: popoverDescriptionVariants(), children: description }),
|
|
10840
|
+
onConfirm && /* @__PURE__ */ jsx184("div", { className: popoverFooterVariants(), children: /* @__PURE__ */ jsx184(
|
|
9382
10841
|
TextButton,
|
|
9383
10842
|
{
|
|
9384
10843
|
level: "inverse-static",
|
|
@@ -9390,11 +10849,11 @@ var PopoverContent = React3.forwardRef(
|
|
|
9390
10849
|
) }),
|
|
9391
10850
|
children
|
|
9392
10851
|
] }),
|
|
9393
|
-
/* @__PURE__ */
|
|
10852
|
+
/* @__PURE__ */ jsx184(PopoverPrimitive.Arrow, { asChild: true, children: /* @__PURE__ */ jsx184(PopoverAnchor, { className: clsx9(popoverAnchorVariants({ level })) }) })
|
|
9394
10853
|
]
|
|
9395
10854
|
}
|
|
9396
10855
|
),
|
|
9397
|
-
isOverlay && /* @__PURE__ */
|
|
10856
|
+
isOverlay && /* @__PURE__ */ jsx184("div", { "data-radix-popper-overlay": true, className: style_module_default6.overlay })
|
|
9398
10857
|
] }) })
|
|
9399
10858
|
);
|
|
9400
10859
|
var Popover = Object.assign(PopoverRoot, {
|
|
@@ -9405,8 +10864,8 @@ var Popover = Object.assign(PopoverRoot, {
|
|
|
9405
10864
|
});
|
|
9406
10865
|
|
|
9407
10866
|
// src/components/Tooltip/index.tsx
|
|
9408
|
-
import
|
|
9409
|
-
import { forwardRef as
|
|
10867
|
+
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
10868
|
+
import { forwardRef as forwardRef15 } from "react";
|
|
9410
10869
|
|
|
9411
10870
|
// src/components/Tooltip/style.module.scss
|
|
9412
10871
|
var style_module_default8 = {
|
|
@@ -9417,14 +10876,21 @@ var style_module_default8 = {
|
|
|
9417
10876
|
// src/components/Tooltip/index.tsx
|
|
9418
10877
|
import { cva as cva7 } from "cva";
|
|
9419
10878
|
import clsx10 from "clsx";
|
|
9420
|
-
import { jsx as
|
|
10879
|
+
import { jsx as jsx185 } from "react/jsx-runtime";
|
|
9421
10880
|
var DEFAULT_OFFSET2 = "medium";
|
|
9422
10881
|
var tooltipVariants = cva7({ base: [style_module_default8.tooltip, "lp-sys-typo-caption1-normal-medium"] });
|
|
9423
10882
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
9424
|
-
var TooltipRoot = /* @__PURE__ */ __name(({ children, ...props }) => /* @__PURE__ */
|
|
9425
|
-
var TooltipTrigger = /* @__PURE__ */ __name(({ by }) => /* @__PURE__ */
|
|
9426
|
-
var TooltipContent =
|
|
9427
|
-
({
|
|
10883
|
+
var TooltipRoot = /* @__PURE__ */ __name(({ children, ...props }) => /* @__PURE__ */ jsx185(TooltipPrimitive.Root, { delayDuration: 0, ...props, children }), "TooltipRoot");
|
|
10884
|
+
var TooltipTrigger = /* @__PURE__ */ __name(({ by }) => /* @__PURE__ */ jsx185(TooltipPrimitive.Trigger, { asChild: true, children: by }), "TooltipTrigger");
|
|
10885
|
+
var TooltipContent = forwardRef15(
|
|
10886
|
+
({
|
|
10887
|
+
description,
|
|
10888
|
+
position = "top",
|
|
10889
|
+
className,
|
|
10890
|
+
offset = DEFAULT_OFFSET2,
|
|
10891
|
+
collisionPadding,
|
|
10892
|
+
...props
|
|
10893
|
+
}, ref) => /* @__PURE__ */ jsx185(
|
|
9428
10894
|
TooltipPrimitive.Content,
|
|
9429
10895
|
{
|
|
9430
10896
|
ref,
|
|
@@ -9433,7 +10899,7 @@ var TooltipContent = forwardRef9(
|
|
|
9433
10899
|
collisionPadding,
|
|
9434
10900
|
className: clsx10(tooltipVariants(), className),
|
|
9435
10901
|
...props,
|
|
9436
|
-
children: /* @__PURE__ */
|
|
10902
|
+
children: /* @__PURE__ */ jsx185("p", { className: style_module_default8.tooltipContent, children: description })
|
|
9437
10903
|
}
|
|
9438
10904
|
)
|
|
9439
10905
|
);
|
|
@@ -9445,7 +10911,7 @@ var Tooltip = Object.assign(TooltipRoot, {
|
|
|
9445
10911
|
|
|
9446
10912
|
// src/components/IconButton/index.tsx
|
|
9447
10913
|
import { cva as cva8 } from "cva";
|
|
9448
|
-
import { forwardRef as
|
|
10914
|
+
import { forwardRef as forwardRef16 } from "react";
|
|
9449
10915
|
import clsx11 from "clsx";
|
|
9450
10916
|
|
|
9451
10917
|
// src/components/IconButton/style.module.scss
|
|
@@ -9467,8 +10933,9 @@ var style_module_default9 = {
|
|
|
9467
10933
|
};
|
|
9468
10934
|
|
|
9469
10935
|
// src/components/IconButton/index.tsx
|
|
9470
|
-
import { Slot } from "
|
|
9471
|
-
import { jsx as
|
|
10936
|
+
import { Slot as SlotPrimitive } from "radix-ui";
|
|
10937
|
+
import { jsx as jsx186 } from "react/jsx-runtime";
|
|
10938
|
+
var { Slot } = SlotPrimitive;
|
|
9472
10939
|
var iconButtonSizeIconSizeMap = {
|
|
9473
10940
|
l: "m",
|
|
9474
10941
|
m: "s",
|
|
@@ -9539,7 +11006,7 @@ var iconButtonVariants = cva8({
|
|
|
9539
11006
|
}
|
|
9540
11007
|
}
|
|
9541
11008
|
});
|
|
9542
|
-
var IconButton =
|
|
11009
|
+
var IconButton = forwardRef16(
|
|
9543
11010
|
({
|
|
9544
11011
|
asChild,
|
|
9545
11012
|
level = "primary",
|
|
@@ -9552,7 +11019,7 @@ var IconButton = forwardRef10(
|
|
|
9552
11019
|
...rest
|
|
9553
11020
|
}, ref) => {
|
|
9554
11021
|
const Comp = asChild ? Slot : "button";
|
|
9555
|
-
return /* @__PURE__ */
|
|
11022
|
+
return /* @__PURE__ */ jsx186(
|
|
9556
11023
|
Comp,
|
|
9557
11024
|
{
|
|
9558
11025
|
...rest,
|
|
@@ -9561,7 +11028,7 @@ var IconButton = forwardRef10(
|
|
|
9561
11028
|
disabled: disabled && !isLoading,
|
|
9562
11029
|
"aria-label": icon.name,
|
|
9563
11030
|
role: "button",
|
|
9564
|
-
children: isLoading ? /* @__PURE__ */
|
|
11031
|
+
children: isLoading ? /* @__PURE__ */ jsx186(Loading, { size: iconButtonLoadingSizeMap[size], level: iconButtonLoadingLevelMap[level] }) : /* @__PURE__ */ jsx186(
|
|
9565
11032
|
Icon,
|
|
9566
11033
|
{
|
|
9567
11034
|
size: iconButtonSizeIconSizeMap[size],
|
|
@@ -9576,7 +11043,7 @@ var IconButton = forwardRef10(
|
|
|
9576
11043
|
IconButton.displayName = "IconButton";
|
|
9577
11044
|
|
|
9578
11045
|
// src/components/CheckBox/index.tsx
|
|
9579
|
-
import
|
|
11046
|
+
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
9580
11047
|
|
|
9581
11048
|
// src/components/CheckBox/style.module.scss
|
|
9582
11049
|
var style_module_default10 = {
|
|
@@ -9587,12 +11054,12 @@ var style_module_default10 = {
|
|
|
9587
11054
|
};
|
|
9588
11055
|
|
|
9589
11056
|
// src/components/CheckBox/index.tsx
|
|
9590
|
-
import { forwardRef as
|
|
11057
|
+
import { forwardRef as forwardRef18 } from "react";
|
|
9591
11058
|
import clsx13 from "clsx";
|
|
9592
11059
|
|
|
9593
11060
|
// src/components/Label/index.tsx
|
|
9594
|
-
import { forwardRef as
|
|
9595
|
-
import
|
|
11061
|
+
import { forwardRef as forwardRef17 } from "react";
|
|
11062
|
+
import { Label as LabelPrimitive } from "radix-ui";
|
|
9596
11063
|
import clsx12 from "clsx";
|
|
9597
11064
|
|
|
9598
11065
|
// src/components/Label/style.module.scss
|
|
@@ -9614,7 +11081,7 @@ var style_module_default11 = {
|
|
|
9614
11081
|
|
|
9615
11082
|
// src/components/Label/index.tsx
|
|
9616
11083
|
import { cva as cva9 } from "cva";
|
|
9617
|
-
import { jsx as
|
|
11084
|
+
import { jsx as jsx187 } from "react/jsx-runtime";
|
|
9618
11085
|
var defaultLabelVariants = cva9({
|
|
9619
11086
|
base: ["lp-sys-typo-paragraph2-normal-medium", style_module_default11.label],
|
|
9620
11087
|
variants: {
|
|
@@ -9644,7 +11111,7 @@ var defaultLabelVariants = cva9({
|
|
|
9644
11111
|
}
|
|
9645
11112
|
}
|
|
9646
11113
|
});
|
|
9647
|
-
var Label =
|
|
11114
|
+
var Label = forwardRef17(
|
|
9648
11115
|
({
|
|
9649
11116
|
className,
|
|
9650
11117
|
level = "primary",
|
|
@@ -9655,7 +11122,7 @@ var Label = forwardRef11(
|
|
|
9655
11122
|
error = false,
|
|
9656
11123
|
...props
|
|
9657
11124
|
}, ref) => {
|
|
9658
|
-
return /* @__PURE__ */
|
|
11125
|
+
return /* @__PURE__ */ jsx187(
|
|
9659
11126
|
LabelPrimitive.Root,
|
|
9660
11127
|
{
|
|
9661
11128
|
ref,
|
|
@@ -9671,24 +11138,24 @@ var Label = forwardRef11(
|
|
|
9671
11138
|
Label.displayName = "Label";
|
|
9672
11139
|
|
|
9673
11140
|
// src/components/CheckBox/index.tsx
|
|
9674
|
-
import { Fragment as
|
|
9675
|
-
var Checkbox =
|
|
11141
|
+
import { Fragment as Fragment9, jsx as jsx188, jsxs as jsxs121 } from "react/jsx-runtime";
|
|
11142
|
+
var Checkbox = forwardRef18(
|
|
9676
11143
|
({ className, label, description, ...props }, ref) => {
|
|
9677
|
-
const CheckboxWrapper = /* @__PURE__ */ __name(({ children }) => label ? /* @__PURE__ */
|
|
9678
|
-
/* @__PURE__ */
|
|
11144
|
+
const CheckboxWrapper = /* @__PURE__ */ __name(({ children }) => label ? /* @__PURE__ */ jsxs121(Label, { position: "right", htmlFor: props.id, children: [
|
|
11145
|
+
/* @__PURE__ */ jsxs121("div", { className: style_module_default10["label-wrapper"], children: [
|
|
9679
11146
|
label,
|
|
9680
|
-
/* @__PURE__ */
|
|
11147
|
+
/* @__PURE__ */ jsx188(Paragraph, { className: style_module_default10.description, size: 3, type: "normal", weight: "regular", children: description })
|
|
9681
11148
|
] }),
|
|
9682
11149
|
children
|
|
9683
|
-
] }) : /* @__PURE__ */
|
|
9684
|
-
return /* @__PURE__ */
|
|
11150
|
+
] }) : /* @__PURE__ */ jsx188(Fragment9, { children }), "CheckboxWrapper");
|
|
11151
|
+
return /* @__PURE__ */ jsx188(CheckboxWrapper, { children: /* @__PURE__ */ jsx188(CheckboxPrimitive.Root, { className: clsx13(style_module_default10.checkbox, className), ref, ...props, children: /* @__PURE__ */ jsx188(CheckboxPrimitive.Indicator, { className: style_module_default10["checkbox-indicator"], children: /* @__PURE__ */ jsx188(Icon, { name: "check-mark", thick: true, size: "xs", type: "inverse-label-primary" }) }) }) });
|
|
9685
11152
|
}
|
|
9686
11153
|
);
|
|
9687
11154
|
|
|
9688
11155
|
// src/components/Radio/index.tsx
|
|
9689
|
-
import
|
|
11156
|
+
import { RadioGroup as RadioGroupPrimitive } from "radix-ui";
|
|
9690
11157
|
import clsx14 from "clsx";
|
|
9691
|
-
import { forwardRef as
|
|
11158
|
+
import { forwardRef as forwardRef19 } from "react";
|
|
9692
11159
|
|
|
9693
11160
|
// src/components/Radio/style.module.scss
|
|
9694
11161
|
var style_module_default12 = {
|
|
@@ -9699,27 +11166,27 @@ var style_module_default12 = {
|
|
|
9699
11166
|
};
|
|
9700
11167
|
|
|
9701
11168
|
// src/components/Radio/index.tsx
|
|
9702
|
-
import { Fragment as
|
|
9703
|
-
var RadioIndicator = /* @__PURE__ */ __name(() => /* @__PURE__ */
|
|
9704
|
-
var RadioRoot =
|
|
11169
|
+
import { Fragment as Fragment10, jsx as jsx189, jsxs as jsxs122 } from "react/jsx-runtime";
|
|
11170
|
+
var RadioIndicator = /* @__PURE__ */ __name(() => /* @__PURE__ */ jsx189("svg", { xmlns: "http://www.w3.org/2000/svg", width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", children: /* @__PURE__ */ jsx189("circle", { cx: "5", cy: "5", r: "5", fill: "#313133" }) }), "RadioIndicator");
|
|
11171
|
+
var RadioRoot = forwardRef19(({ className, ...props }, ref) => /* @__PURE__ */ jsx189(RadioGroupPrimitive.Root, { ref, className, ...props }));
|
|
9705
11172
|
RadioRoot.displayName = "RadioRoot";
|
|
9706
|
-
var RadioItem =
|
|
11173
|
+
var RadioItem = forwardRef19(
|
|
9707
11174
|
({ className, label, description, ...props }, ref) => {
|
|
9708
|
-
const RadioItemWrapper = /* @__PURE__ */ __name(({ children }) => label ? /* @__PURE__ */
|
|
9709
|
-
/* @__PURE__ */
|
|
11175
|
+
const RadioItemWrapper = /* @__PURE__ */ __name(({ children }) => label ? /* @__PURE__ */ jsxs122(Label, { position: "right", children: [
|
|
11176
|
+
/* @__PURE__ */ jsxs122("div", { className: style_module_default12["label-wrapper"], children: [
|
|
9710
11177
|
label,
|
|
9711
|
-
description && /* @__PURE__ */
|
|
11178
|
+
description && /* @__PURE__ */ jsx189(Paragraph, { className: style_module_default12.description, size: 3, type: "normal", weight: "regular", children: description })
|
|
9712
11179
|
] }),
|
|
9713
11180
|
children
|
|
9714
|
-
] }) : /* @__PURE__ */
|
|
9715
|
-
return /* @__PURE__ */
|
|
11181
|
+
] }) : /* @__PURE__ */ jsx189(Fragment10, { children }), "RadioItemWrapper");
|
|
11182
|
+
return /* @__PURE__ */ jsx189(RadioItemWrapper, { children: /* @__PURE__ */ jsx189(
|
|
9716
11183
|
RadioGroupPrimitive.Item,
|
|
9717
11184
|
{
|
|
9718
11185
|
ref,
|
|
9719
11186
|
className: clsx14(style_module_default12["radio-item"], className),
|
|
9720
11187
|
...props,
|
|
9721
11188
|
"aria-label": label,
|
|
9722
|
-
children: /* @__PURE__ */
|
|
11189
|
+
children: /* @__PURE__ */ jsx189(RadioGroupPrimitive.Indicator, { className: style_module_default12.indicator, children: /* @__PURE__ */ jsx189(RadioIndicator, {}) })
|
|
9723
11190
|
}
|
|
9724
11191
|
) });
|
|
9725
11192
|
}
|
|
@@ -9731,11 +11198,11 @@ var Radio = Object.assign(RadioRoot, {
|
|
|
9731
11198
|
|
|
9732
11199
|
// src/components/Textfield/index.tsx
|
|
9733
11200
|
import {
|
|
9734
|
-
forwardRef as
|
|
11201
|
+
forwardRef as forwardRef20,
|
|
9735
11202
|
useId,
|
|
9736
11203
|
useImperativeHandle,
|
|
9737
|
-
useRef as
|
|
9738
|
-
useState as
|
|
11204
|
+
useRef as useRef8,
|
|
11205
|
+
useState as useState7
|
|
9739
11206
|
} from "react";
|
|
9740
11207
|
|
|
9741
11208
|
// src/components/Textfield/style.module.scss
|
|
@@ -9763,8 +11230,8 @@ var style_module_default13 = {
|
|
|
9763
11230
|
// src/components/Textfield/index.tsx
|
|
9764
11231
|
import { cva as cva10 } from "cva";
|
|
9765
11232
|
import clsx15 from "clsx";
|
|
9766
|
-
import { flushSync } from "react-dom";
|
|
9767
|
-
import { Fragment as
|
|
11233
|
+
import { flushSync as flushSync2 } from "react-dom";
|
|
11234
|
+
import { Fragment as Fragment11, jsx as jsx190, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
9768
11235
|
var defaultTextfieldVariants = cva10({
|
|
9769
11236
|
base: style_module_default13.textfield,
|
|
9770
11237
|
variants: {
|
|
@@ -9774,7 +11241,7 @@ var defaultTextfieldVariants = cva10({
|
|
|
9774
11241
|
}
|
|
9775
11242
|
}
|
|
9776
11243
|
});
|
|
9777
|
-
var Textfield =
|
|
11244
|
+
var Textfield = forwardRef20((props, ref) => {
|
|
9778
11245
|
const {
|
|
9779
11246
|
id = useId(),
|
|
9780
11247
|
type,
|
|
@@ -9790,9 +11257,9 @@ var Textfield = forwardRef14((props, ref) => {
|
|
|
9790
11257
|
onClear,
|
|
9791
11258
|
...rest
|
|
9792
11259
|
} = props;
|
|
9793
|
-
const inputRef =
|
|
9794
|
-
const [value, setValue] =
|
|
9795
|
-
const [deidentifiy, setDeidentifiy] =
|
|
11260
|
+
const inputRef = useRef8(null);
|
|
11261
|
+
const [value, setValue] = useState7("");
|
|
11262
|
+
const [deidentifiy, setDeidentifiy] = useState7(true);
|
|
9796
11263
|
const isControlled = controlledValue !== void 0;
|
|
9797
11264
|
const isPassword = type === "password";
|
|
9798
11265
|
const isDeidentified = isPassword && deidentifiy;
|
|
@@ -9822,7 +11289,7 @@ var Textfield = forwardRef14((props, ref) => {
|
|
|
9822
11289
|
const handleDeidentify = /* @__PURE__ */ __name((e) => {
|
|
9823
11290
|
e.stopPropagation();
|
|
9824
11291
|
if (!disabled) {
|
|
9825
|
-
|
|
11292
|
+
flushSync2(() => {
|
|
9826
11293
|
setDeidentifiy((prev) => !prev);
|
|
9827
11294
|
});
|
|
9828
11295
|
}
|
|
@@ -9833,8 +11300,8 @@ var Textfield = forwardRef14((props, ref) => {
|
|
|
9833
11300
|
}
|
|
9834
11301
|
}, "handleDeidentify");
|
|
9835
11302
|
useImperativeHandle(ref, () => inputRef.current);
|
|
9836
|
-
return /* @__PURE__ */
|
|
9837
|
-
/* @__PURE__ */
|
|
11303
|
+
return /* @__PURE__ */ jsxs123("div", { className: style_module_default13["textfield-container"], children: [
|
|
11304
|
+
/* @__PURE__ */ jsx190(
|
|
9838
11305
|
"div",
|
|
9839
11306
|
{
|
|
9840
11307
|
className: clsx15(defaultTextfieldVariants({ color }), {
|
|
@@ -9842,8 +11309,8 @@ var Textfield = forwardRef14((props, ref) => {
|
|
|
9842
11309
|
[style_module_default13["label-out-textfield"]]: !label || labelType === "out"
|
|
9843
11310
|
}),
|
|
9844
11311
|
onClick: handleTextfieldClick,
|
|
9845
|
-
children: /* @__PURE__ */
|
|
9846
|
-
/* @__PURE__ */
|
|
11312
|
+
children: /* @__PURE__ */ jsxs123("div", { className: style_module_default13["input-wrapper"], children: [
|
|
11313
|
+
/* @__PURE__ */ jsx190(
|
|
9847
11314
|
"input",
|
|
9848
11315
|
{
|
|
9849
11316
|
className: clsx15(style_module_default13.input, {
|
|
@@ -9858,7 +11325,7 @@ var Textfield = forwardRef14((props, ref) => {
|
|
|
9858
11325
|
...rest
|
|
9859
11326
|
}
|
|
9860
11327
|
),
|
|
9861
|
-
/* @__PURE__ */
|
|
11328
|
+
/* @__PURE__ */ jsx190(
|
|
9862
11329
|
Label,
|
|
9863
11330
|
{
|
|
9864
11331
|
className: clsx15(style_module_default13.label, {
|
|
@@ -9870,8 +11337,8 @@ var Textfield = forwardRef14((props, ref) => {
|
|
|
9870
11337
|
children: labelText
|
|
9871
11338
|
}
|
|
9872
11339
|
),
|
|
9873
|
-
/* @__PURE__ */
|
|
9874
|
-
textfieldValue && !disabled && /* @__PURE__ */
|
|
11340
|
+
/* @__PURE__ */ jsxs123("div", { className: style_module_default13["input-action-buttons"], children: [
|
|
11341
|
+
textfieldValue && !disabled && /* @__PURE__ */ jsx190(
|
|
9875
11342
|
IconButton,
|
|
9876
11343
|
{
|
|
9877
11344
|
tabIndex: -1,
|
|
@@ -9889,7 +11356,7 @@ var Textfield = forwardRef14((props, ref) => {
|
|
|
9889
11356
|
}
|
|
9890
11357
|
}
|
|
9891
11358
|
),
|
|
9892
|
-
isPassword && !disabled && /* @__PURE__ */
|
|
11359
|
+
isPassword && !disabled && /* @__PURE__ */ jsx190(
|
|
9893
11360
|
IconButton,
|
|
9894
11361
|
{
|
|
9895
11362
|
tabIndex: -1,
|
|
@@ -9907,14 +11374,14 @@ var Textfield = forwardRef14((props, ref) => {
|
|
|
9907
11374
|
}
|
|
9908
11375
|
}
|
|
9909
11376
|
),
|
|
9910
|
-
buttonProps && /* @__PURE__ */
|
|
11377
|
+
buttonProps && /* @__PURE__ */ jsx190(Button, { ...buttonProps, size: "m", type: "button" })
|
|
9911
11378
|
] })
|
|
9912
11379
|
] })
|
|
9913
11380
|
}
|
|
9914
11381
|
),
|
|
9915
|
-
displayFooter && /* @__PURE__ */
|
|
9916
|
-
/* @__PURE__ */
|
|
9917
|
-
/* @__PURE__ */
|
|
11382
|
+
displayFooter && /* @__PURE__ */ jsxs123("div", { className: style_module_default13.footer, children: [
|
|
11383
|
+
/* @__PURE__ */ jsx190("div", { className: style_module_default13["error-wrapper"], children: error && /* @__PURE__ */ jsxs123(Fragment11, { children: [
|
|
11384
|
+
/* @__PURE__ */ jsx190(
|
|
9918
11385
|
Icon,
|
|
9919
11386
|
{
|
|
9920
11387
|
name: "exclamationmark-fill",
|
|
@@ -9924,9 +11391,9 @@ var Textfield = forwardRef14((props, ref) => {
|
|
|
9924
11391
|
type: "function-label-negative"
|
|
9925
11392
|
}
|
|
9926
11393
|
),
|
|
9927
|
-
/* @__PURE__ */
|
|
11394
|
+
/* @__PURE__ */ jsx190(Caption, { size: 3, type: "normal", weight: "regular", className: style_module_default13["error-message"], children: error })
|
|
9928
11395
|
] }) }),
|
|
9929
|
-
maxCharacter && /* @__PURE__ */
|
|
11396
|
+
maxCharacter && /* @__PURE__ */ jsxs123(Caption, { className: style_module_default13.character, size: 3, type: "normal", weight: "regular", children: [
|
|
9930
11397
|
isControlled ? controlledValue.length : value.length,
|
|
9931
11398
|
"/",
|
|
9932
11399
|
maxCharacter
|
|
@@ -9937,7 +11404,7 @@ var Textfield = forwardRef14((props, ref) => {
|
|
|
9937
11404
|
Textfield.displayName = "Textfield";
|
|
9938
11405
|
|
|
9939
11406
|
// src/components/Slider/index.tsx
|
|
9940
|
-
import { forwardRef as
|
|
11407
|
+
import { forwardRef as forwardRef21 } from "react";
|
|
9941
11408
|
|
|
9942
11409
|
// src/components/Slider/style.module.scss
|
|
9943
11410
|
var style_module_default14 = {
|
|
@@ -9953,39 +11420,41 @@ var style_module_default14 = {
|
|
|
9953
11420
|
};
|
|
9954
11421
|
|
|
9955
11422
|
// src/components/Slider/index.tsx
|
|
9956
|
-
import
|
|
9957
|
-
import { Fragment as
|
|
9958
|
-
var SliderRoot =
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
/* @__PURE__ */
|
|
9962
|
-
|
|
9963
|
-
/* @__PURE__ */
|
|
9964
|
-
/* @__PURE__ */
|
|
9965
|
-
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
/* @__PURE__ */
|
|
9969
|
-
|
|
9970
|
-
|
|
11423
|
+
import { Slider as SliderPrimitive } from "radix-ui";
|
|
11424
|
+
import { Fragment as Fragment12, jsx as jsx191, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
11425
|
+
var SliderRoot = forwardRef21(
|
|
11426
|
+
(props, ref) => {
|
|
11427
|
+
const { label, tooltip, rangeLeft, rangeRight, min, max, step = 50, ...rest } = props;
|
|
11428
|
+
return /* @__PURE__ */ jsx191(Fragment12, { children: /* @__PURE__ */ jsxs124(Tooltip.Provider, { children: [
|
|
11429
|
+
/* @__PURE__ */ jsx191(Label, { level: "secondary", size: "m", offset: "high", className: style_module_default14.label, children: label }),
|
|
11430
|
+
/* @__PURE__ */ jsxs124("div", { className: style_module_default14["slider-wrapper"], children: [
|
|
11431
|
+
/* @__PURE__ */ jsxs124("div", { className: style_module_default14["slider-option-wrapper"], children: [
|
|
11432
|
+
/* @__PURE__ */ jsx191(Icon, { name: rangeLeft.icon, size: "xs" }),
|
|
11433
|
+
/* @__PURE__ */ jsx191(Caption, { size: 1, type: "normal", weight: "medium", className: style_module_default14.optionText, children: rangeLeft.text })
|
|
11434
|
+
] }),
|
|
11435
|
+
/* @__PURE__ */ jsxs124(SliderPrimitive.Root, { ...rest, step, className: style_module_default14["slider-root"], ref, children: [
|
|
11436
|
+
/* @__PURE__ */ jsxs124(SliderPrimitive.Track, { className: style_module_default14["slider-track"], children: [
|
|
11437
|
+
Array.from({ length: 100 / step + 1 }).map((_, index) => /* @__PURE__ */ jsx191("span", { className: style_module_default14["slider-step"] }, index)),
|
|
11438
|
+
/* @__PURE__ */ jsx191(SliderPrimitive.Range, { className: style_module_default14["slider-range"] })
|
|
11439
|
+
] }),
|
|
11440
|
+
/* @__PURE__ */ jsxs124(Tooltip, { children: [
|
|
11441
|
+
/* @__PURE__ */ jsx191(Tooltip.Trigger, { by: /* @__PURE__ */ jsx191(SliderPrimitive.Thumb, { className: style_module_default14["slider-thumb"] }) }),
|
|
11442
|
+
/* @__PURE__ */ jsx191(Tooltip.Content, { description: tooltip })
|
|
11443
|
+
] })
|
|
9971
11444
|
] }),
|
|
9972
|
-
/* @__PURE__ */
|
|
9973
|
-
/* @__PURE__ */
|
|
9974
|
-
/* @__PURE__ */
|
|
11445
|
+
/* @__PURE__ */ jsxs124("div", { className: style_module_default14["slider-option-wrapper"], children: [
|
|
11446
|
+
/* @__PURE__ */ jsx191(Icon, { name: rangeRight.icon, size: "xs" }),
|
|
11447
|
+
/* @__PURE__ */ jsx191(Caption, { size: 1, type: "normal", weight: "medium", className: style_module_default14.optionText, children: rangeRight.text })
|
|
9975
11448
|
] })
|
|
9976
|
-
] }),
|
|
9977
|
-
/* @__PURE__ */ jsxs123("div", { className: style_module_default14["slider-option-wrapper"], children: [
|
|
9978
|
-
/* @__PURE__ */ jsx183(Icon, { name: rangeRight.icon, size: "xs" }),
|
|
9979
|
-
/* @__PURE__ */ jsx183(Caption, { size: 1, type: "normal", weight: "medium", className: style_module_default14.optionText, children: rangeRight.text })
|
|
9980
11449
|
] })
|
|
9981
|
-
] })
|
|
9982
|
-
|
|
9983
|
-
|
|
11450
|
+
] }) });
|
|
11451
|
+
}
|
|
11452
|
+
);
|
|
9984
11453
|
var Slider = Object.assign(SliderRoot, {});
|
|
9985
11454
|
|
|
9986
11455
|
// src/components/Select/index.tsx
|
|
9987
|
-
import
|
|
9988
|
-
import
|
|
11456
|
+
import { Select as SelectPrimitive } from "radix-ui";
|
|
11457
|
+
import { ScrollArea } from "radix-ui";
|
|
9989
11458
|
|
|
9990
11459
|
// src/components/Select/style.module.scss
|
|
9991
11460
|
var style_module_default15 = {
|
|
@@ -10015,96 +11484,126 @@ var style_module_default15 = {
|
|
|
10015
11484
|
|
|
10016
11485
|
// src/components/Select/index.tsx
|
|
10017
11486
|
import {
|
|
10018
|
-
forwardRef as
|
|
10019
|
-
useEffect as
|
|
10020
|
-
useState as
|
|
11487
|
+
forwardRef as forwardRef22,
|
|
11488
|
+
useEffect as useEffect9,
|
|
11489
|
+
useState as useState8
|
|
10021
11490
|
} from "react";
|
|
10022
11491
|
import clsx16 from "clsx";
|
|
10023
|
-
import { jsx as
|
|
10024
|
-
var Badge = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */
|
|
10025
|
-
var SelectContent =
|
|
10026
|
-
|
|
10027
|
-
|
|
10028
|
-
SelectPrimitive.
|
|
10029
|
-
|
|
10030
|
-
|
|
10031
|
-
|
|
10032
|
-
|
|
10033
|
-
ref
|
|
10034
|
-
|
|
10035
|
-
ref
|
|
10036
|
-
|
|
10037
|
-
|
|
10038
|
-
|
|
10039
|
-
|
|
10040
|
-
|
|
10041
|
-
|
|
10042
|
-
className: clsx16(style_module_default15["desktop-content"], {
|
|
10043
|
-
[style_module_default15["responsive"]]: isResponsive
|
|
10044
|
-
}),
|
|
10045
|
-
position: "popper",
|
|
10046
|
-
side: popSide,
|
|
10047
|
-
sideOffset,
|
|
10048
|
-
avoidCollisions: false,
|
|
10049
|
-
children: /* @__PURE__ */ jsxs124(ScrollArea.Root, { className: style_module_default15.scrollAreaRoot, type: "always", children: [
|
|
10050
|
-
/* @__PURE__ */ jsx184(SelectPrimitive.Viewport, { asChild: true, children: /* @__PURE__ */ jsx184(ScrollArea.Viewport, { className: style_module_default15.scrollAreaViewport, style: { maxHeight: "268px", overflowY: "auto" }, children: /* @__PURE__ */ jsxs124(SelectPrimitive.Group, { children: [
|
|
10051
|
-
listLabel && /* @__PURE__ */ jsx184(SelectPrimitive.Label, { asChild: true, children: /* @__PURE__ */ jsx184(Label, { className: style_module_default15["desktop-label"], level: "secondary", size: "m", offset: "low", children: listLabel }) }),
|
|
10052
|
-
children
|
|
10053
|
-
] }) }) }),
|
|
10054
|
-
/* @__PURE__ */ jsx184(ScrollArea.Scrollbar, { className: style_module_default15.scrollAreaScrollbar, orientation: "vertical", children: /* @__PURE__ */ jsx184(ScrollArea.Thumb, { className: style_module_default15.scrollAreaThumb }) })
|
|
10055
|
-
] })
|
|
10056
|
-
}
|
|
10057
|
-
) });
|
|
10058
|
-
});
|
|
10059
|
-
var SelectRoot = forwardRef16((props, ref) => {
|
|
10060
|
-
const {
|
|
10061
|
-
id,
|
|
10062
|
-
placeholder,
|
|
10063
|
-
label,
|
|
10064
|
-
chip,
|
|
10065
|
-
listLabel,
|
|
10066
|
-
popSide = "top",
|
|
10067
|
-
sideOffset = 6,
|
|
10068
|
-
children,
|
|
10069
|
-
open = false,
|
|
10070
|
-
onOpenChange,
|
|
10071
|
-
isResponsive = false,
|
|
10072
|
-
openDirection = "slide-right",
|
|
10073
|
-
badge,
|
|
10074
|
-
container,
|
|
10075
|
-
...rest
|
|
10076
|
-
} = props;
|
|
10077
|
-
const contentProps = { id, isResponsive, popSide, sideOffset, listLabel, children, container };
|
|
10078
|
-
const [isOpen, setIsOpen] = useState4(false);
|
|
10079
|
-
useEffect2(() => {
|
|
10080
|
-
setIsOpen(open);
|
|
10081
|
-
}, [open]);
|
|
10082
|
-
return /* @__PURE__ */ jsxs124("div", { children: [
|
|
10083
|
-
/* @__PURE__ */ jsxs124("div", { className: style_module_default15["label-container"], children: [
|
|
10084
|
-
/* @__PURE__ */ jsx184(Label, { className: style_module_default15["select-label"], level: "secondary", size: "m", offset: "low", htmlFor: id, children: label }),
|
|
10085
|
-
badge && /* @__PURE__ */ jsx184(Badge, { children: badge })
|
|
10086
|
-
] }),
|
|
10087
|
-
/* @__PURE__ */ jsxs124(
|
|
10088
|
-
SelectPrimitive.Root,
|
|
10089
|
-
{
|
|
10090
|
-
...rest,
|
|
10091
|
-
open: isOpen,
|
|
10092
|
-
onOpenChange: (open2) => {
|
|
10093
|
-
onOpenChange?.(open2);
|
|
10094
|
-
setIsOpen(open2);
|
|
11492
|
+
import { jsx as jsx192, jsxs as jsxs125 } from "react/jsx-runtime";
|
|
11493
|
+
var Badge = /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ jsx192("div", { className: style_module_default15.badgeContainer, children: /* @__PURE__ */ jsx192(Caption, { className: style_module_default15.badge, size: 2, type: "normal", weight: "medium", children }) }), "Badge");
|
|
11494
|
+
var SelectContent = forwardRef22(
|
|
11495
|
+
(props, ref) => {
|
|
11496
|
+
const { id, isResponsive, popSide, sideOffset, listLabel, children, container } = props;
|
|
11497
|
+
return /* @__PURE__ */ jsx192(SelectPrimitive.Portal, { container, children: /* @__PURE__ */ jsx192(
|
|
11498
|
+
SelectPrimitive.Content,
|
|
11499
|
+
{
|
|
11500
|
+
id: `select-content-${id}`,
|
|
11501
|
+
ref: (instance) => {
|
|
11502
|
+
if (typeof ref === "function") {
|
|
11503
|
+
ref(instance);
|
|
11504
|
+
} else if (ref) {
|
|
11505
|
+
ref.current = instance;
|
|
11506
|
+
}
|
|
11507
|
+
if (!instance) return;
|
|
11508
|
+
instance.ontouchstart = (e) => {
|
|
11509
|
+
e.stopPropagation();
|
|
11510
|
+
};
|
|
10095
11511
|
},
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
11512
|
+
className: clsx16(style_module_default15["desktop-content"], {
|
|
11513
|
+
[style_module_default15["responsive"]]: isResponsive
|
|
11514
|
+
}),
|
|
11515
|
+
position: "popper",
|
|
11516
|
+
side: popSide,
|
|
11517
|
+
sideOffset,
|
|
11518
|
+
avoidCollisions: false,
|
|
11519
|
+
children: /* @__PURE__ */ jsxs125(ScrollArea.Root, { className: style_module_default15.scrollAreaRoot, type: "always", children: [
|
|
11520
|
+
/* @__PURE__ */ jsx192(SelectPrimitive.Viewport, { asChild: true, children: /* @__PURE__ */ jsx192(
|
|
11521
|
+
ScrollArea.Viewport,
|
|
11522
|
+
{
|
|
11523
|
+
className: style_module_default15.scrollAreaViewport,
|
|
11524
|
+
style: { maxHeight: "268px", overflowY: "auto" },
|
|
11525
|
+
children: /* @__PURE__ */ jsxs125(SelectPrimitive.Group, { children: [
|
|
11526
|
+
listLabel && /* @__PURE__ */ jsx192(SelectPrimitive.Label, { asChild: true, children: /* @__PURE__ */ jsx192(
|
|
11527
|
+
Label,
|
|
11528
|
+
{
|
|
11529
|
+
className: style_module_default15["desktop-label"],
|
|
11530
|
+
level: "secondary",
|
|
11531
|
+
size: "m",
|
|
11532
|
+
offset: "low",
|
|
11533
|
+
children: listLabel
|
|
11534
|
+
}
|
|
11535
|
+
) }),
|
|
11536
|
+
children
|
|
11537
|
+
] })
|
|
11538
|
+
}
|
|
11539
|
+
) }),
|
|
11540
|
+
/* @__PURE__ */ jsx192(ScrollArea.Scrollbar, { className: style_module_default15.scrollAreaScrollbar, orientation: "vertical", children: /* @__PURE__ */ jsx192(ScrollArea.Thumb, { className: style_module_default15.scrollAreaThumb }) })
|
|
11541
|
+
] })
|
|
10103
11542
|
}
|
|
10104
|
-
)
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
var
|
|
11543
|
+
) });
|
|
11544
|
+
}
|
|
11545
|
+
);
|
|
11546
|
+
var SelectRoot = forwardRef22(
|
|
11547
|
+
(props, ref) => {
|
|
11548
|
+
const {
|
|
11549
|
+
id,
|
|
11550
|
+
placeholder,
|
|
11551
|
+
label,
|
|
11552
|
+
chip,
|
|
11553
|
+
listLabel,
|
|
11554
|
+
popSide = "top",
|
|
11555
|
+
sideOffset = 6,
|
|
11556
|
+
children,
|
|
11557
|
+
open = false,
|
|
11558
|
+
onOpenChange,
|
|
11559
|
+
isResponsive = false,
|
|
11560
|
+
openDirection = "slide-right",
|
|
11561
|
+
badge,
|
|
11562
|
+
container,
|
|
11563
|
+
...rest
|
|
11564
|
+
} = props;
|
|
11565
|
+
const contentProps = { id, isResponsive, popSide, sideOffset, listLabel, children, container };
|
|
11566
|
+
const [isOpen, setIsOpen] = useState8(false);
|
|
11567
|
+
useEffect9(() => {
|
|
11568
|
+
setIsOpen(open);
|
|
11569
|
+
}, [open]);
|
|
11570
|
+
return /* @__PURE__ */ jsxs125("div", { children: [
|
|
11571
|
+
/* @__PURE__ */ jsxs125("div", { className: style_module_default15["label-container"], children: [
|
|
11572
|
+
/* @__PURE__ */ jsx192(
|
|
11573
|
+
Label,
|
|
11574
|
+
{
|
|
11575
|
+
className: style_module_default15["select-label"],
|
|
11576
|
+
level: "secondary",
|
|
11577
|
+
size: "m",
|
|
11578
|
+
offset: "low",
|
|
11579
|
+
htmlFor: id,
|
|
11580
|
+
children: label
|
|
11581
|
+
}
|
|
11582
|
+
),
|
|
11583
|
+
badge && /* @__PURE__ */ jsx192(Badge, { children: badge })
|
|
11584
|
+
] }),
|
|
11585
|
+
/* @__PURE__ */ jsxs125(
|
|
11586
|
+
SelectPrimitive.Root,
|
|
11587
|
+
{
|
|
11588
|
+
...rest,
|
|
11589
|
+
open: isOpen,
|
|
11590
|
+
onOpenChange: (open2) => {
|
|
11591
|
+
onOpenChange?.(open2);
|
|
11592
|
+
setIsOpen(open2);
|
|
11593
|
+
},
|
|
11594
|
+
children: [
|
|
11595
|
+
/* @__PURE__ */ jsxs125(SelectPrimitive.Trigger, { className: style_module_default15.trigger, ref, id, children: [
|
|
11596
|
+
/* @__PURE__ */ jsx192(SelectPrimitive.Value, { className: style_module_default15.placeholder, placeholder }),
|
|
11597
|
+
/* @__PURE__ */ jsx192(SelectPrimitive.Icon, { className: style_module_default15.openIcon, children: /* @__PURE__ */ jsx192(Icon, { name: "arrow-drop-down", fill: true, thick: true, size: "xs" }) })
|
|
11598
|
+
] }),
|
|
11599
|
+
/* @__PURE__ */ jsx192(SelectContent, { ...contentProps })
|
|
11600
|
+
]
|
|
11601
|
+
}
|
|
11602
|
+
)
|
|
11603
|
+
] });
|
|
11604
|
+
}
|
|
11605
|
+
);
|
|
11606
|
+
var SelectItem = /* @__PURE__ */ __name(({ value, text, disabled, icon, onClick }) => /* @__PURE__ */ jsxs125(
|
|
10108
11607
|
SelectPrimitive.Item,
|
|
10109
11608
|
{
|
|
10110
11609
|
className: style_module_default15.item,
|
|
@@ -10115,9 +11614,9 @@ var SelectItem = /* @__PURE__ */ __name(({ value, text, disabled, icon, onClick
|
|
|
10115
11614
|
onClick?.();
|
|
10116
11615
|
},
|
|
10117
11616
|
children: [
|
|
10118
|
-
/* @__PURE__ */
|
|
10119
|
-
icon && /* @__PURE__ */
|
|
10120
|
-
/* @__PURE__ */
|
|
11617
|
+
/* @__PURE__ */ jsx192(SelectPrimitive.ItemText, { children: /* @__PURE__ */ jsx192(Paragraph, { size: 3, type: "normal", weight: "medium", children: text ?? value }) }),
|
|
11618
|
+
icon && /* @__PURE__ */ jsx192(SelectPrimitive.Icon, { className: style_module_default15.icon, children: /* @__PURE__ */ jsx192(Icon, { size: "xs", ...icon }) }),
|
|
11619
|
+
/* @__PURE__ */ jsx192(SelectPrimitive.ItemIndicator, { className: style_module_default15.itemIndicator, children: /* @__PURE__ */ jsx192(Icon, { fill: false, thick: true, size: "xs", name: "check-mark", type: "brand-label-primary" }) })
|
|
10121
11620
|
]
|
|
10122
11621
|
}
|
|
10123
11622
|
), "SelectItem");
|
|
@@ -10133,18 +11632,18 @@ var style_module_default16 = {
|
|
|
10133
11632
|
};
|
|
10134
11633
|
|
|
10135
11634
|
// src/components/List/index.tsx
|
|
10136
|
-
import { useState as
|
|
11635
|
+
import { useState as useState9 } from "react";
|
|
10137
11636
|
|
|
10138
11637
|
// src/hooks/collection.tsx
|
|
10139
|
-
import { createContext, useContext, useMemo } from "react";
|
|
10140
|
-
import { jsx as
|
|
10141
|
-
var CollectionContext =
|
|
11638
|
+
import { createContext as createContext3, useContext as useContext3, useMemo as useMemo5 } from "react";
|
|
11639
|
+
import { jsx as jsx193 } from "react/jsx-runtime";
|
|
11640
|
+
var CollectionContext = createContext3(void 0);
|
|
10142
11641
|
var CollectionProvider = /* @__PURE__ */ __name(({ value, onChangeValue, children }) => {
|
|
10143
|
-
const contextValue =
|
|
10144
|
-
return /* @__PURE__ */
|
|
11642
|
+
const contextValue = useMemo5(() => ({ value, onChangeValue }), [value, onChangeValue]);
|
|
11643
|
+
return /* @__PURE__ */ jsx193(CollectionContext.Provider, { value: contextValue, children });
|
|
10145
11644
|
}, "CollectionProvider");
|
|
10146
11645
|
var useCollectionContext = /* @__PURE__ */ __name(() => {
|
|
10147
|
-
const context =
|
|
11646
|
+
const context = useContext3(CollectionContext);
|
|
10148
11647
|
if (!context) {
|
|
10149
11648
|
throw new Error("useCollectionContext must be used within a CollectionProvider");
|
|
10150
11649
|
}
|
|
@@ -10153,16 +11652,16 @@ var useCollectionContext = /* @__PURE__ */ __name(() => {
|
|
|
10153
11652
|
|
|
10154
11653
|
// src/components/List/index.tsx
|
|
10155
11654
|
import clsx17 from "clsx";
|
|
10156
|
-
import { jsx as
|
|
11655
|
+
import { jsx as jsx194, jsxs as jsxs126 } from "react/jsx-runtime";
|
|
10157
11656
|
var ListRoot = /* @__PURE__ */ __name(({ children, className, ...props }) => {
|
|
10158
|
-
return /* @__PURE__ */
|
|
11657
|
+
return /* @__PURE__ */ jsx194(CollectionProvider, { ...props, children: /* @__PURE__ */ jsx194("ul", { className: clsx17(style_module_default16.list, className), children }) });
|
|
10159
11658
|
}, "ListRoot");
|
|
10160
|
-
var
|
|
10161
|
-
const [isFocused, setIsFocused] =
|
|
11659
|
+
var Item = /* @__PURE__ */ __name(({ value, text, disabled, icon, onClick }) => {
|
|
11660
|
+
const [isFocused, setIsFocused] = useState9(false);
|
|
10162
11661
|
const { value: contextValue, onChangeValue } = useCollectionContext();
|
|
10163
11662
|
const isSelected = contextValue === value;
|
|
10164
11663
|
const iconProps = isSelected ? { name: "check-mark", type: "brand-label-primary", thick: true } : icon ? icon : {};
|
|
10165
|
-
return /* @__PURE__ */
|
|
11664
|
+
return /* @__PURE__ */ jsxs126(
|
|
10166
11665
|
"li",
|
|
10167
11666
|
{
|
|
10168
11667
|
className: style_module_default16.item,
|
|
@@ -10180,13 +11679,13 @@ var Item3 = /* @__PURE__ */ __name(({ value, text, disabled, icon, onClick }) =>
|
|
|
10180
11679
|
onChangeValue?.(value);
|
|
10181
11680
|
},
|
|
10182
11681
|
children: [
|
|
10183
|
-
/* @__PURE__ */
|
|
10184
|
-
(icon || isSelected) && /* @__PURE__ */
|
|
11682
|
+
/* @__PURE__ */ jsx194(Paragraph, { size: 3, type: "normal", weight: "medium", children: text }),
|
|
11683
|
+
(icon || isSelected) && /* @__PURE__ */ jsx194(Icon, { className: style_module_default16.icon, size: "xs", ...iconProps })
|
|
10185
11684
|
]
|
|
10186
11685
|
}
|
|
10187
11686
|
);
|
|
10188
11687
|
}, "Item");
|
|
10189
|
-
var List = Object.assign(ListRoot, { Item
|
|
11688
|
+
var List = Object.assign(ListRoot, { Item });
|
|
10190
11689
|
export {
|
|
10191
11690
|
Button,
|
|
10192
11691
|
Caption,
|
|
@@ -10222,4 +11721,4 @@ export {
|
|
|
10222
11721
|
rootMediaStyle,
|
|
10223
11722
|
useToast
|
|
10224
11723
|
};
|
|
10225
|
-
//# sourceMappingURL=index.
|
|
11724
|
+
//# sourceMappingURL=index.js.map
|