@vritti/quantum-ui 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/Alert.js +110 -0
- package/dist/Alert.js.map +1 -0
- package/dist/Avatar.js +219 -0
- package/dist/Avatar.js.map +1 -0
- package/dist/Badge.js +32 -0
- package/dist/Badge.js.map +1 -0
- package/dist/Button2.js +2 -2
- package/dist/Chart.js +19003 -0
- package/dist/Chart.js.map +1 -0
- package/dist/Checkbox.js +6 -26
- package/dist/Checkbox.js.map +1 -1
- package/dist/Combination.js +3856 -0
- package/dist/Combination.js.map +1 -0
- package/dist/DatePicker.js +15 -3886
- package/dist/DatePicker.js.map +1 -1
- package/dist/DropdownMenu.js +1522 -0
- package/dist/DropdownMenu.js.map +1 -0
- package/dist/Form.js +34 -23
- package/dist/Form.js.map +1 -1
- package/dist/Label.js +1 -1
- package/dist/OTPField.js +16 -5
- package/dist/OTPField.js.map +1 -1
- package/dist/PhoneField.js +14 -6
- package/dist/PhoneField.js.map +1 -1
- package/dist/Progress.js +116 -0
- package/dist/Progress.js.map +1 -0
- package/dist/SelectField.js +1351 -0
- package/dist/SelectField.js.map +1 -0
- package/dist/Separator.js +6 -0
- package/dist/Separator.js.map +1 -0
- package/dist/Sonner.js +3 -38
- package/dist/Sonner.js.map +1 -1
- package/dist/Spinner.js +1 -9
- package/dist/Spinner.js.map +1 -1
- package/dist/Switch.js +210 -0
- package/dist/Switch.js.map +1 -0
- package/dist/ThemeContext.js +57 -0
- package/dist/ThemeContext.js.map +1 -0
- package/dist/ThemeToggle.js +4 -15
- package/dist/ThemeToggle.js.map +1 -1
- package/dist/Toggle.js +69 -0
- package/dist/Toggle.js.map +1 -0
- package/dist/_commonjsHelpers.js +6 -0
- package/dist/_commonjsHelpers.js.map +1 -0
- package/dist/assets/quantum-ui.css +18 -0
- package/dist/axios.js.map +1 -1
- package/dist/check.js +15 -0
- package/dist/check.js.map +1 -0
- package/dist/chevron-down.js +15 -0
- package/dist/chevron-down.js.map +1 -0
- package/dist/chevron-right.js +15 -0
- package/dist/chevron-right.js.map +1 -0
- package/dist/components/Alert.js +2 -0
- package/dist/components/Alert.js.map +1 -0
- package/dist/components/Avatar.js +2 -0
- package/dist/components/Avatar.js.map +1 -0
- package/dist/components/Badge.js +2 -0
- package/dist/components/Badge.js.map +1 -0
- package/dist/components/Chart.js +2 -0
- package/dist/components/Chart.js.map +1 -0
- package/dist/components/DropdownMenu.js +2 -0
- package/dist/components/DropdownMenu.js.map +1 -0
- package/dist/components/Progress.js +1 -174
- package/dist/components/Progress.js.map +1 -1
- package/dist/components/SelectField.js +2 -0
- package/dist/components/SelectField.js.map +1 -0
- package/dist/components/Separator.js +2 -0
- package/dist/components/Separator.js.map +1 -0
- package/dist/components/Switch.js +2 -0
- package/dist/components/Switch.js.map +1 -0
- package/dist/components/Toggle.js +2 -0
- package/dist/components/Toggle.js.map +1 -0
- package/dist/context/index.js +2 -0
- package/dist/context/index.js.map +1 -0
- package/dist/field.js +2 -49
- package/dist/field.js.map +1 -1
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/index10.js +105 -0
- package/dist/index10.js.map +1 -0
- package/dist/index11.js +79 -0
- package/dist/index11.js.map +1 -0
- package/dist/index12.js +101 -0
- package/dist/index12.js.map +1 -0
- package/dist/index13.js +205 -0
- package/dist/index13.js.map +1 -0
- package/dist/index14.js +199 -0
- package/dist/index14.js.map +1 -0
- package/dist/index2.js +55 -130
- package/dist/index2.js.map +1 -1
- package/dist/index3.js +10 -42
- package/dist/index3.js.map +1 -1
- package/dist/index4.js +125 -35
- package/dist/index4.js.map +1 -1
- package/dist/index5.js +26 -414
- package/dist/index5.js.map +1 -1
- package/dist/index6.js +8 -0
- package/dist/index6.js.map +1 -0
- package/dist/index7.js +16 -0
- package/dist/index7.js.map +1 -0
- package/dist/index8.js +45 -0
- package/dist/index8.js.map +1 -0
- package/dist/index9.js +41 -0
- package/dist/index9.js.map +1 -0
- package/dist/lib/components/Alert/Alert.d.ts +10 -0
- package/dist/lib/components/Alert/Alert.d.ts.map +1 -0
- package/dist/lib/components/Alert/index.d.ts +2 -0
- package/dist/lib/components/Alert/index.d.ts.map +1 -0
- package/dist/lib/components/Avatar/Avatar.d.ts +8 -0
- package/dist/lib/components/Avatar/Avatar.d.ts.map +1 -0
- package/dist/lib/components/Avatar/index.d.ts +2 -0
- package/dist/lib/components/Avatar/index.d.ts.map +1 -0
- package/dist/lib/components/Badge/Badge.d.ts +5 -0
- package/dist/lib/components/Badge/Badge.d.ts.map +1 -0
- package/dist/lib/components/Badge/index.d.ts +3 -0
- package/dist/lib/components/Badge/index.d.ts.map +1 -0
- package/dist/lib/components/Button/index.d.ts +1 -1
- package/dist/lib/components/Button/index.d.ts.map +1 -1
- package/dist/lib/components/Chart/Chart.d.ts +13 -0
- package/dist/lib/components/Chart/Chart.d.ts.map +1 -0
- package/dist/lib/components/Chart/index.d.ts +3 -0
- package/dist/lib/components/Chart/index.d.ts.map +1 -0
- package/dist/lib/components/DropdownMenu/DropdownMenu.d.ts +28 -0
- package/dist/lib/components/DropdownMenu/DropdownMenu.d.ts.map +1 -0
- package/dist/lib/components/DropdownMenu/index.d.ts +3 -0
- package/dist/lib/components/DropdownMenu/index.d.ts.map +1 -0
- package/dist/lib/components/DropdownMenu/types.d.ts +72 -0
- package/dist/lib/components/DropdownMenu/types.d.ts.map +1 -0
- package/dist/lib/components/Form/Form.d.ts +1 -1
- package/dist/lib/components/Form/Form.d.ts.map +1 -1
- package/dist/lib/components/OTPField/OTPField.d.ts.map +1 -1
- package/dist/lib/components/PhoneField/PhoneField.d.ts.map +1 -1
- package/dist/lib/components/SelectField/SelectField.d.ts +24 -0
- package/dist/lib/components/SelectField/SelectField.d.ts.map +1 -0
- package/dist/lib/components/SelectField/index.d.ts +3 -0
- package/dist/lib/components/SelectField/index.d.ts.map +1 -0
- package/dist/lib/components/Separator/Separator.d.ts +3 -0
- package/dist/lib/components/Separator/Separator.d.ts.map +1 -0
- package/dist/lib/components/Separator/index.d.ts +2 -0
- package/dist/lib/components/Separator/index.d.ts.map +1 -0
- package/dist/lib/components/Switch/Switch.d.ts +9 -0
- package/dist/lib/components/Switch/Switch.d.ts.map +1 -0
- package/dist/lib/components/Switch/index.d.ts +3 -0
- package/dist/lib/components/Switch/index.d.ts.map +1 -0
- package/dist/lib/components/ThemeToggle/ThemeToggle.d.ts.map +1 -1
- package/dist/lib/components/Toggle/Toggle.d.ts +7 -0
- package/dist/lib/components/Toggle/Toggle.d.ts.map +1 -0
- package/dist/lib/components/Toggle/index.d.ts +2 -0
- package/dist/lib/components/Toggle/index.d.ts.map +1 -0
- package/dist/lib/components/index.d.ts +10 -0
- package/dist/lib/components/index.d.ts.map +1 -1
- package/dist/lib/context/ThemeContext.d.ts +18 -0
- package/dist/lib/context/ThemeContext.d.ts.map +1 -0
- package/dist/lib/context/index.d.ts +2 -0
- package/dist/lib/context/index.d.ts.map +1 -0
- package/dist/lib/hooks/index.d.ts +2 -0
- package/dist/lib/hooks/index.d.ts.map +1 -0
- package/dist/lib/hooks/useTheme.d.ts +8 -0
- package/dist/lib/hooks/useTheme.d.ts.map +1 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/theme/index.d.ts +13 -0
- package/dist/lib/theme/index.d.ts.map +1 -0
- package/dist/lib/utils/axios.d.ts +1 -0
- package/dist/lib/utils/axios.d.ts.map +1 -1
- package/dist/lib/utils/formHelpers.d.ts +7 -3
- package/dist/lib/utils/formHelpers.d.ts.map +1 -1
- package/dist/separator2.js +53 -0
- package/dist/separator2.js.map +1 -0
- package/dist/shadcn/index.d.ts +1 -1
- package/dist/shadcn/index.d.ts.map +1 -1
- package/dist/shadcn/shadcnAlert/alert.d.ts +11 -0
- package/dist/shadcn/shadcnAlert/alert.d.ts.map +1 -0
- package/dist/shadcn/shadcnAlert/index.d.ts +2 -0
- package/dist/shadcn/shadcnAlert/index.d.ts.map +1 -0
- package/dist/shadcn/shadcnAvatar/Avatar.d.ts +12 -0
- package/dist/shadcn/shadcnAvatar/Avatar.d.ts.map +1 -0
- package/dist/shadcn/shadcnAvatar/index.d.ts +2 -0
- package/dist/shadcn/shadcnAvatar/index.d.ts.map +1 -0
- package/dist/shadcn/shadcnBadge/Badge.d.ts +11 -0
- package/dist/shadcn/shadcnBadge/Badge.d.ts.map +1 -0
- package/dist/shadcn/shadcnBadge/index.d.ts +3 -0
- package/dist/shadcn/shadcnBadge/index.d.ts.map +1 -0
- package/dist/shadcn/shadcnButton/Button.d.ts +2 -2
- package/dist/shadcn/shadcnChart/Chart.d.ts +58 -0
- package/dist/shadcn/shadcnChart/Chart.d.ts.map +1 -0
- package/dist/shadcn/shadcnChart/index.d.ts +3 -0
- package/dist/shadcn/shadcnChart/index.d.ts.map +1 -0
- package/dist/shadcn/shadcnSpinner/Spinner.d.ts.map +1 -1
- package/dist/shadcn/shadcnSwitch/Switch.d.ts +7 -0
- package/dist/shadcn/shadcnSwitch/Switch.d.ts.map +1 -0
- package/dist/shadcn/shadcnSwitch/index.d.ts +2 -0
- package/dist/shadcn/shadcnSwitch/index.d.ts.map +1 -0
- package/dist/shadcn/shadcnToggle/Toggle.d.ts +10 -0
- package/dist/shadcn/shadcnToggle/Toggle.d.ts.map +1 -0
- package/dist/shadcn/shadcnToggle/index.d.ts +2 -0
- package/dist/shadcn/shadcnToggle/index.d.ts.map +1 -0
- package/dist/theme/index.js +11 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/triangle-alert.js +40 -0
- package/dist/triangle-alert.js.map +1 -0
- package/dist/useTheme.js +15 -0
- package/dist/useTheme.js.map +1 -0
- package/package.json +59 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index10.js","sources":["../node_modules/.pnpm/@radix-ui+react-slot@1.2.4_@types+react@19.2.9_react@19.2.3/node_modules/@radix-ui/react-slot/dist/index.mjs"],"sourcesContent":["// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\nvar REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\nvar use = React[\" use \".trim().toString()];\nfunction isPromiseLike(value) {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\nfunction isLazyComponent(element) {\n return element != null && typeof element === \"object\" && \"$$typeof\" in element && element.$$typeof === REACT_LAZY_TYPE && \"_payload\" in element && isPromiseLike(element._payload);\n}\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\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IAAI,MAAM,IAAI,MAAM,CAAC,cAAc;AAC7E,EAAE,IAAI,OAAO,EAAE;AACf,IAAI,OAAO,OAAO,CAAC,GAAG;AACtB,EAAE;AACF,EAAE,MAAM,GAAG,MAAM,CAAC,wBAAwB,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,GAAG;AAC/D,EAAE,OAAO,GAAG,MAAM,IAAI,gBAAgB,IAAI,MAAM,IAAI,MAAM,CAAC,cAAc;AACzE,EAAE,IAAI,OAAO,EAAE;AACf,IAAI,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG;AAC5B,EAAE;AACF,EAAE,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG;AACzC;;;;","x_google_ignoreList":[0]}
|
package/dist/index11.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { c as createContextScope } from './index12.js';
|
|
4
|
+
import { u as useComposedRefs } from './index5.js';
|
|
5
|
+
import { c as createSlot } from './index13.js';
|
|
6
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
|
+
|
|
8
|
+
function createCollection(name) {
|
|
9
|
+
const PROVIDER_NAME = name + "CollectionProvider";
|
|
10
|
+
const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);
|
|
11
|
+
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
|
12
|
+
PROVIDER_NAME,
|
|
13
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
14
|
+
);
|
|
15
|
+
const CollectionProvider = (props) => {
|
|
16
|
+
const { scope, children } = props;
|
|
17
|
+
const ref = React__default.useRef(null);
|
|
18
|
+
const itemMap = React__default.useRef(/* @__PURE__ */ new Map()).current;
|
|
19
|
+
return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
20
|
+
};
|
|
21
|
+
CollectionProvider.displayName = PROVIDER_NAME;
|
|
22
|
+
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
23
|
+
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
24
|
+
const CollectionSlot = React__default.forwardRef(
|
|
25
|
+
(props, forwardedRef) => {
|
|
26
|
+
const { scope, children } = props;
|
|
27
|
+
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
28
|
+
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
29
|
+
return /* @__PURE__ */ jsx(CollectionSlotImpl, { ref: composedRefs, children });
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
33
|
+
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
34
|
+
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
35
|
+
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
36
|
+
const CollectionItemSlot = React__default.forwardRef(
|
|
37
|
+
(props, forwardedRef) => {
|
|
38
|
+
const { scope, children, ...itemData } = props;
|
|
39
|
+
const ref = React__default.useRef(null);
|
|
40
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
41
|
+
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
42
|
+
React__default.useEffect(() => {
|
|
43
|
+
context.itemMap.set(ref, { ref, ...itemData });
|
|
44
|
+
return () => void context.itemMap.delete(ref);
|
|
45
|
+
});
|
|
46
|
+
return /* @__PURE__ */ jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
50
|
+
function useCollection(scope) {
|
|
51
|
+
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
52
|
+
const getItems = React__default.useCallback(() => {
|
|
53
|
+
const collectionNode = context.collectionRef.current;
|
|
54
|
+
if (!collectionNode) return [];
|
|
55
|
+
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
56
|
+
const items = Array.from(context.itemMap.values());
|
|
57
|
+
const orderedItems = items.sort(
|
|
58
|
+
(a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
|
|
59
|
+
);
|
|
60
|
+
return orderedItems;
|
|
61
|
+
}, [context.collectionRef, context.itemMap]);
|
|
62
|
+
return getItems;
|
|
63
|
+
}
|
|
64
|
+
return [
|
|
65
|
+
{ Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
|
|
66
|
+
useCollection,
|
|
67
|
+
createCollectionScope
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// packages/react/direction/src/direction.tsx
|
|
72
|
+
var DirectionContext = React.createContext(void 0);
|
|
73
|
+
function useDirection(localDir) {
|
|
74
|
+
const globalDir = React.useContext(DirectionContext);
|
|
75
|
+
return localDir || globalDir || "ltr";
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export { createCollection as c, useDirection as u };
|
|
79
|
+
//# sourceMappingURL=index11.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index11.js","sources":["../node_modules/.pnpm/@radix-ui+react-collection@1.1.7_@types+react-dom@19.2.3_@types+react@19.2.9__@types+re_ae03b05a8cab938032db1ba1dbeec717/node_modules/@radix-ui/react-collection/dist/index.mjs","../node_modules/.pnpm/@radix-ui+react-direction@1.1.1_@types+react@19.2.9_react@19.2.3/node_modules/@radix-ui/react-direction/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/collection-legacy.tsx\nimport React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createCollection(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }\n );\n const CollectionProvider = (props) => {\n const { scope, children } = props;\n const ref = React.useRef(null);\n const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;\n return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);\n const CollectionSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);\n const CollectionItemSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...itemData });\n return () => void context.itemMap.delete(ref);\n });\n return /* @__PURE__ */ jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useCollection(scope) {\n const context = useCollectionContext(name + \"CollectionConsumer\", scope);\n const getItems = React.useCallback(() => {\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort(\n (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)\n );\n return orderedItems;\n }, [context.collectionRef, context.itemMap]);\n return getItems;\n }\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n useCollection,\n createCollectionScope\n ];\n}\n\n// src/collection.tsx\nimport React2 from \"react\";\nimport { createContextScope as createContextScope2 } from \"@radix-ui/react-context\";\nimport { useComposedRefs as useComposedRefs2 } from \"@radix-ui/react-compose-refs\";\nimport { createSlot as createSlot2 } from \"@radix-ui/react-slot\";\n\n// src/ordered-dictionary.ts\nvar __instanciated = /* @__PURE__ */ new WeakMap();\nvar OrderedDict = class _OrderedDict extends Map {\n #keys;\n constructor(entries) {\n super(entries);\n this.#keys = [...super.keys()];\n __instanciated.set(this, true);\n }\n set(key, value) {\n if (__instanciated.get(this)) {\n if (this.has(key)) {\n this.#keys[this.#keys.indexOf(key)] = key;\n } else {\n this.#keys.push(key);\n }\n }\n super.set(key, value);\n return this;\n }\n insert(index, key, value) {\n const has = this.has(key);\n const length = this.#keys.length;\n const relativeIndex = toSafeInteger(index);\n let actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n const safeIndex = actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n if (safeIndex === this.size || has && safeIndex === this.size - 1 || safeIndex === -1) {\n this.set(key, value);\n return this;\n }\n const size = this.size + (has ? 0 : 1);\n if (relativeIndex < 0) {\n actualIndex++;\n }\n const keys = [...this.#keys];\n let nextValue;\n let shouldSkip = false;\n for (let i = actualIndex; i < size; i++) {\n if (actualIndex === i) {\n let nextKey = keys[i];\n if (keys[i] === key) {\n nextKey = keys[i + 1];\n }\n if (has) {\n this.delete(key);\n }\n nextValue = this.get(nextKey);\n this.set(key, value);\n } else {\n if (!shouldSkip && keys[i - 1] === key) {\n shouldSkip = true;\n }\n const currentKey = keys[shouldSkip ? i : i - 1];\n const currentValue = nextValue;\n nextValue = this.get(currentKey);\n this.delete(currentKey);\n this.set(currentKey, currentValue);\n }\n }\n return this;\n }\n with(index, key, value) {\n const copy = new _OrderedDict(this);\n copy.insert(index, key, value);\n return copy;\n }\n before(key) {\n const index = this.#keys.indexOf(key) - 1;\n if (index < 0) {\n return void 0;\n }\n return this.entryAt(index);\n }\n /**\n * Sets a new key-value pair at the position before the given key.\n */\n setBefore(key, newKey, value) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index, newKey, value);\n }\n after(key) {\n let index = this.#keys.indexOf(key);\n index = index === -1 || index === this.size - 1 ? -1 : index + 1;\n if (index === -1) {\n return void 0;\n }\n return this.entryAt(index);\n }\n /**\n * Sets a new key-value pair at the position after the given key.\n */\n setAfter(key, newKey, value) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index + 1, newKey, value);\n }\n first() {\n return this.entryAt(0);\n }\n last() {\n return this.entryAt(-1);\n }\n clear() {\n this.#keys = [];\n return super.clear();\n }\n delete(key) {\n const deleted = super.delete(key);\n if (deleted) {\n this.#keys.splice(this.#keys.indexOf(key), 1);\n }\n return deleted;\n }\n deleteAt(index) {\n const key = this.keyAt(index);\n if (key !== void 0) {\n return this.delete(key);\n }\n return false;\n }\n at(index) {\n const key = at(this.#keys, index);\n if (key !== void 0) {\n return this.get(key);\n }\n }\n entryAt(index) {\n const key = at(this.#keys, index);\n if (key !== void 0) {\n return [key, this.get(key)];\n }\n }\n indexOf(key) {\n return this.#keys.indexOf(key);\n }\n keyAt(index) {\n return at(this.#keys, index);\n }\n from(key, offset) {\n const index = this.indexOf(key);\n if (index === -1) {\n return void 0;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.at(dest);\n }\n keyFrom(key, offset) {\n const index = this.indexOf(key);\n if (index === -1) {\n return void 0;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.keyAt(dest);\n }\n find(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return entry;\n }\n index++;\n }\n return void 0;\n }\n findIndex(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return index;\n }\n index++;\n }\n return -1;\n }\n filter(predicate, thisArg) {\n const entries = [];\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n entries.push(entry);\n }\n index++;\n }\n return new _OrderedDict(entries);\n }\n map(callbackfn, thisArg) {\n const entries = [];\n let index = 0;\n for (const entry of this) {\n entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index, this])]);\n index++;\n }\n return new _OrderedDict(entries);\n }\n reduce(...args) {\n const [callbackfn, initialValue] = args;\n let index = 0;\n let accumulator = initialValue ?? this.at(0);\n for (const entry of this) {\n if (index === 0 && args.length === 1) {\n accumulator = entry;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n index++;\n }\n return accumulator;\n }\n reduceRight(...args) {\n const [callbackfn, initialValue] = args;\n let accumulator = initialValue ?? this.at(-1);\n for (let index = this.size - 1; index >= 0; index--) {\n const entry = this.at(index);\n if (index === this.size - 1 && args.length === 1) {\n accumulator = entry;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n }\n return accumulator;\n }\n toSorted(compareFn) {\n const entries = [...this.entries()].sort(compareFn);\n return new _OrderedDict(entries);\n }\n toReversed() {\n const reversed = new _OrderedDict();\n for (let index = this.size - 1; index >= 0; index--) {\n const key = this.keyAt(index);\n const element = this.get(key);\n reversed.set(key, element);\n }\n return reversed;\n }\n toSpliced(...args) {\n const entries = [...this.entries()];\n entries.splice(...args);\n return new _OrderedDict(entries);\n }\n slice(start, end) {\n const result = new _OrderedDict();\n let stop = this.size - 1;\n if (start === void 0) {\n return result;\n }\n if (start < 0) {\n start = start + this.size;\n }\n if (end !== void 0 && end > 0) {\n stop = end - 1;\n }\n for (let index = start; index <= stop; index++) {\n const key = this.keyAt(index);\n const element = this.get(key);\n result.set(key, element);\n }\n return result;\n }\n every(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (!Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return false;\n }\n index++;\n }\n return true;\n }\n some(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return true;\n }\n index++;\n }\n return false;\n }\n};\nfunction at(array, index) {\n if (\"at\" in Array.prototype) {\n return Array.prototype.at.call(array, index);\n }\n const actualIndex = toSafeIndex(array, index);\n return actualIndex === -1 ? void 0 : array[actualIndex];\n}\nfunction toSafeIndex(array, index) {\n const length = array.length;\n const relativeIndex = toSafeInteger(index);\n const actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n return actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n}\nfunction toSafeInteger(number) {\n return number !== number || number === 0 ? 0 : Math.trunc(number);\n}\n\n// src/collection.tsx\nimport { jsx as jsx2 } from \"react/jsx-runtime\";\nfunction createCollection2(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope2(PROVIDER_NAME);\n const [CollectionContextProvider, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n {\n collectionElement: null,\n collectionRef: { current: null },\n collectionRefObject: { current: null },\n itemMap: new OrderedDict(),\n setItemMap: () => void 0\n }\n );\n const CollectionProvider = ({ state, ...props }) => {\n return state ? /* @__PURE__ */ jsx2(CollectionProviderImpl, { ...props, state }) : /* @__PURE__ */ jsx2(CollectionInit, { ...props });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const CollectionInit = (props) => {\n const state = useInitCollection();\n return /* @__PURE__ */ jsx2(CollectionProviderImpl, { ...props, state });\n };\n CollectionInit.displayName = PROVIDER_NAME + \"Init\";\n const CollectionProviderImpl = (props) => {\n const { scope, children, state } = props;\n const ref = React2.useRef(null);\n const [collectionElement, setCollectionElement] = React2.useState(\n null\n );\n const composeRefs = useComposedRefs2(ref, setCollectionElement);\n const [itemMap, setItemMap] = state;\n React2.useEffect(() => {\n if (!collectionElement) return;\n const observer = getChildListObserver(() => {\n });\n observer.observe(collectionElement, {\n childList: true,\n subtree: true\n });\n return () => {\n observer.disconnect();\n };\n }, [collectionElement]);\n return /* @__PURE__ */ jsx2(\n CollectionContextProvider,\n {\n scope,\n itemMap,\n setItemMap,\n collectionRef: composeRefs,\n collectionRefObject: ref,\n collectionElement,\n children\n }\n );\n };\n CollectionProviderImpl.displayName = PROVIDER_NAME + \"Impl\";\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot2(COLLECTION_SLOT_NAME);\n const CollectionSlot = React2.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs2(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx2(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot2(ITEM_SLOT_NAME);\n const CollectionItemSlot = React2.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React2.useRef(null);\n const [element, setElement] = React2.useState(null);\n const composedRefs = useComposedRefs2(forwardedRef, ref, setElement);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n const { setItemMap } = context;\n const itemDataRef = React2.useRef(itemData);\n if (!shallowEqual(itemDataRef.current, itemData)) {\n itemDataRef.current = itemData;\n }\n const memoizedItemData = itemDataRef.current;\n React2.useEffect(() => {\n const itemData2 = memoizedItemData;\n setItemMap((map) => {\n if (!element) {\n return map;\n }\n if (!map.has(element)) {\n map.set(element, { ...itemData2, element });\n return map.toSorted(sortByDocumentPosition);\n }\n return map.set(element, { ...itemData2, element }).toSorted(sortByDocumentPosition);\n });\n return () => {\n setItemMap((map) => {\n if (!element || !map.has(element)) {\n return map;\n }\n map.delete(element);\n return new OrderedDict(map);\n });\n };\n }, [element, memoizedItemData, setItemMap]);\n return /* @__PURE__ */ jsx2(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useInitCollection() {\n return React2.useState(new OrderedDict());\n }\n function useCollection(scope) {\n const { itemMap } = useCollectionContext(name + \"CollectionConsumer\", scope);\n return itemMap;\n }\n const functions = {\n createCollectionScope,\n useCollection,\n useInitCollection\n };\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n functions\n ];\n}\nfunction shallowEqual(a, b) {\n if (a === b) return true;\n if (typeof a !== \"object\" || typeof b !== \"object\") return false;\n if (a == null || b == null) return false;\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n if (keysA.length !== keysB.length) return false;\n for (const key of keysA) {\n if (!Object.prototype.hasOwnProperty.call(b, key)) return false;\n if (a[key] !== b[key]) return false;\n }\n return true;\n}\nfunction isElementPreceding(a, b) {\n return !!(b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING);\n}\nfunction sortByDocumentPosition(a, b) {\n return !a[1].element || !b[1].element ? 0 : isElementPreceding(a[1].element, b[1].element) ? -1 : 1;\n}\nfunction getChildListObserver(callback) {\n const observer = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n if (mutation.type === \"childList\") {\n callback();\n return;\n }\n }\n });\n return observer;\n}\nexport {\n createCollection,\n createCollection2 as unstable_createCollection\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/direction/src/direction.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DirectionContext = React.createContext(void 0);\nvar DirectionProvider = (props) => {\n const { dir, children } = props;\n return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children });\n};\nfunction useDirection(localDir) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || \"ltr\";\n}\nvar Provider = DirectionProvider;\nexport {\n DirectionProvider,\n Provider,\n useDirection\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["React"],"mappings":";;;;;;;AAQA,SAAS,gBAAgB,CAAC,IAAI,EAAE;AAChC,EAAE,MAAM,aAAa,GAAG,IAAI,GAAG,oBAAoB;AACnD,EAAE,MAAM,CAAC,uBAAuB,EAAE,qBAAqB,CAAC,GAAG,kBAAkB,CAAC,aAAa,CAAC;AAC5F,EAAE,MAAM,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,GAAG,uBAAuB;AAChF,IAAI,aAAa;AACjB,IAAI,EAAE,aAAa,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,OAAO,kBAAkB,IAAI,GAAG,EAAE;AAC1E,GAAG;AACH,EAAE,MAAM,kBAAkB,GAAG,CAAC,KAAK,KAAK;AACxC,IAAI,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK;AACrC,IAAI,MAAM,GAAG,GAAGA,cAAK,CAAC,MAAM,CAAC,IAAI,CAAC;AAClC,IAAI,MAAM,OAAO,GAAGA,cAAK,CAAC,MAAM,iBAAiB,IAAI,GAAG,EAAE,CAAC,CAAC,OAAO;AACnE,IAAI,uBAAuB,GAAG,CAAC,sBAAsB,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;AACxG,EAAE,CAAC;AACH,EAAE,kBAAkB,CAAC,WAAW,GAAG,aAAa;AAChD,EAAE,MAAM,oBAAoB,GAAG,IAAI,GAAG,gBAAgB;AAC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kBAAkB,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,kBAAkB,EAAE;AACxF,IAAI,aAAa;AACjB,IAAI;AACJ,GAAG;AACH;;ACrEA;AAGA,IAAI,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC;AAKlD,SAAS,YAAY,CAAC,QAAQ,EAAE;AAChC,EAAE,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC;AACtD,EAAE,OAAO,QAAQ,IAAI,SAAS,IAAI,KAAK;AACvC;;;;","x_google_ignoreList":[0,1]}
|
package/dist/index12.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { u as useLayoutEffect2 } from './index6.js';
|
|
4
|
+
|
|
5
|
+
// packages/react/context/src/create-context.tsx
|
|
6
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
7
|
+
let defaultContexts = [];
|
|
8
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
9
|
+
const BaseContext = React.createContext(defaultContext);
|
|
10
|
+
const index = defaultContexts.length;
|
|
11
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
12
|
+
const Provider = (props) => {
|
|
13
|
+
const { scope, children, ...context } = props;
|
|
14
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
15
|
+
const value = React.useMemo(() => context, Object.values(context));
|
|
16
|
+
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
17
|
+
};
|
|
18
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
19
|
+
function useContext2(consumerName, scope) {
|
|
20
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
21
|
+
const context = React.useContext(Context);
|
|
22
|
+
if (context) return context;
|
|
23
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
24
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
25
|
+
}
|
|
26
|
+
return [Provider, useContext2];
|
|
27
|
+
}
|
|
28
|
+
const createScope = () => {
|
|
29
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
30
|
+
return React.createContext(defaultContext);
|
|
31
|
+
});
|
|
32
|
+
return function useScope(scope) {
|
|
33
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
34
|
+
return React.useMemo(
|
|
35
|
+
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
36
|
+
[scope, contexts]
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
createScope.scopeName = scopeName;
|
|
41
|
+
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
42
|
+
}
|
|
43
|
+
function composeContextScopes(...scopes) {
|
|
44
|
+
const baseScope = scopes[0];
|
|
45
|
+
if (scopes.length === 1) return baseScope;
|
|
46
|
+
const createScope = () => {
|
|
47
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
48
|
+
useScope: createScope2(),
|
|
49
|
+
scopeName: createScope2.scopeName
|
|
50
|
+
}));
|
|
51
|
+
return function useComposedScopes(overrideScopes) {
|
|
52
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
53
|
+
const scopeProps = useScope(overrideScopes);
|
|
54
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
55
|
+
return { ...nextScopes2, ...currentScope };
|
|
56
|
+
}, {});
|
|
57
|
+
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
createScope.scopeName = baseScope.scopeName;
|
|
61
|
+
return createScope;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// packages/react/use-size/src/use-size.tsx
|
|
65
|
+
function useSize(element) {
|
|
66
|
+
const [size, setSize] = React.useState(void 0);
|
|
67
|
+
useLayoutEffect2(() => {
|
|
68
|
+
if (element) {
|
|
69
|
+
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
70
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
71
|
+
if (!Array.isArray(entries)) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (!entries.length) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const entry = entries[0];
|
|
78
|
+
let width;
|
|
79
|
+
let height;
|
|
80
|
+
if ("borderBoxSize" in entry) {
|
|
81
|
+
const borderSizeEntry = entry["borderBoxSize"];
|
|
82
|
+
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
|
83
|
+
width = borderSize["inlineSize"];
|
|
84
|
+
height = borderSize["blockSize"];
|
|
85
|
+
} else {
|
|
86
|
+
width = element.offsetWidth;
|
|
87
|
+
height = element.offsetHeight;
|
|
88
|
+
}
|
|
89
|
+
setSize({ width, height });
|
|
90
|
+
});
|
|
91
|
+
resizeObserver.observe(element, { box: "border-box" });
|
|
92
|
+
return () => resizeObserver.unobserve(element);
|
|
93
|
+
} else {
|
|
94
|
+
setSize(void 0);
|
|
95
|
+
}
|
|
96
|
+
}, [element]);
|
|
97
|
+
return size;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export { createContextScope as c, useSize as u };
|
|
101
|
+
//# sourceMappingURL=index12.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index12.js","sources":["../node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.2.9_react@19.2.3/node_modules/@radix-ui/react-context/dist/index.mjs","../node_modules/.pnpm/@radix-ui+react-use-size@1.1.1_@types+react@19.2.9_react@19.2.3/node_modules/@radix-ui/react-use-size/dist/index.mjs"],"sourcesContent":["// packages/react/context/src/create-context.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createContext2(rootComponentName, defaultContext) {\n const Context = React.createContext(defaultContext);\n const Provider = (props) => {\n const { children, ...context } = props;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n}\nfunction createContextScope(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n function createContext3(rootComponentName, defaultContext) {\n const BaseContext = React.createContext(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n const Provider = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName, scope) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n }\n const createScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n createScope.scopeName = scopeName;\n return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];\n}\nfunction composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope = () => {\n const scopeHooks = scopes.map((createScope2) => ({\n useScope: createScope2(),\n scopeName: createScope2.scopeName\n }));\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes2, ...currentScope };\n }, {});\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\nexport {\n createContext2 as createContext,\n createContextScope\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/react/use-size/src/use-size.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nfunction useSize(element) {\n const [size, setSize] = React.useState(void 0);\n useLayoutEffect(() => {\n if (element) {\n setSize({ width: element.offsetWidth, height: element.offsetHeight });\n const resizeObserver = new ResizeObserver((entries) => {\n if (!Array.isArray(entries)) {\n return;\n }\n if (!entries.length) {\n return;\n }\n const entry = entries[0];\n let width;\n let height;\n if (\"borderBoxSize\" in entry) {\n const borderSizeEntry = entry[\"borderBoxSize\"];\n const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;\n width = borderSize[\"inlineSize\"];\n height = borderSize[\"blockSize\"];\n } else {\n width = element.offsetWidth;\n height = element.offsetHeight;\n }\n setSize({ width, height });\n });\n resizeObserver.observe(element, { box: \"border-box\" });\n return () => resizeObserver.unobserve(element);\n } else {\n setSize(void 0);\n }\n }, [element]);\n return size;\n}\nexport {\n useSize\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useLayoutEffect"],"mappings":";;;;AAAA;AAmBA,SAAS,kBAAkB,CAAC,SAAS,EAAE,sBAAsB,GAAG,EAAE,EAAE;AACpE,EAAE,IAAI,eAAe,GAAG,EAAE;AAC1B,EAAE,SAAS,cAAc,CAAC,iBAAiB,EAAE,cAAc,EAAE;AAC7D,IAAI,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC;AAC3D,IAAI,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM;AACxC,IAAI,eAAe,GAAG,CAAC,GAAG,eAAe,EAAE,cAAc,CAA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C;AAC1C,QAAQ,CAAC,MAAM;AACf,UAAU,KAAK,GAAG,OAAO,CAAC,WAAW;AACrC,UAAU,MAAM,GAAG,OAAO,CAAC,YAAY;AACvC,QAAQ;AACR,QAAQ,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAClC,MAAM,CAAC,CAAC;AACR,MAAM,cAAc,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC;AAC5D,MAAM,OAAO,MAAM,cAAc,CAAC,SAAS,CAAC,OAAO,CAAC;AACpD,IAAI,CAAC,MAAM;AACX,MAAM,OAAO,CAAC,MAAM,CAAC;AACrB,IAAI;AACJ,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;AACf,EAAE,OAAO,IAAI;AACb;;;;","x_google_ignoreList":[0,1]}
|
package/dist/index13.js
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { u as useLayoutEffect2 } from './index6.js';
|
|
3
|
+
import * as ReactDOM from 'react-dom';
|
|
4
|
+
import { c as composeRefs } from './index5.js';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
|
|
7
|
+
// src/primitive.tsx
|
|
8
|
+
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
9
|
+
return function handleEvent(event) {
|
|
10
|
+
originalEventHandler?.(event);
|
|
11
|
+
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
12
|
+
return ourEventHandler?.(event);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// src/use-controllable-state.tsx
|
|
18
|
+
var useInsertionEffect = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
19
|
+
function useControllableState({
|
|
20
|
+
prop,
|
|
21
|
+
defaultProp,
|
|
22
|
+
onChange = () => {
|
|
23
|
+
},
|
|
24
|
+
caller
|
|
25
|
+
}) {
|
|
26
|
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
27
|
+
defaultProp,
|
|
28
|
+
onChange
|
|
29
|
+
});
|
|
30
|
+
const isControlled = prop !== void 0;
|
|
31
|
+
const value = isControlled ? prop : uncontrolledProp;
|
|
32
|
+
{
|
|
33
|
+
const isControlledRef = React.useRef(prop !== void 0);
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
const wasControlled = isControlledRef.current;
|
|
36
|
+
if (wasControlled !== isControlled) {
|
|
37
|
+
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
38
|
+
const to = isControlled ? "controlled" : "uncontrolled";
|
|
39
|
+
console.warn(
|
|
40
|
+
`${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.`
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
isControlledRef.current = isControlled;
|
|
44
|
+
}, [isControlled, caller]);
|
|
45
|
+
}
|
|
46
|
+
const setValue = React.useCallback(
|
|
47
|
+
(nextValue) => {
|
|
48
|
+
if (isControlled) {
|
|
49
|
+
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
50
|
+
if (value2 !== prop) {
|
|
51
|
+
onChangeRef.current?.(value2);
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
setUncontrolledProp(nextValue);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
|
58
|
+
);
|
|
59
|
+
return [value, setValue];
|
|
60
|
+
}
|
|
61
|
+
function useUncontrolledState({
|
|
62
|
+
defaultProp,
|
|
63
|
+
onChange
|
|
64
|
+
}) {
|
|
65
|
+
const [value, setValue] = React.useState(defaultProp);
|
|
66
|
+
const prevValueRef = React.useRef(value);
|
|
67
|
+
const onChangeRef = React.useRef(onChange);
|
|
68
|
+
useInsertionEffect(() => {
|
|
69
|
+
onChangeRef.current = onChange;
|
|
70
|
+
}, [onChange]);
|
|
71
|
+
React.useEffect(() => {
|
|
72
|
+
if (prevValueRef.current !== value) {
|
|
73
|
+
onChangeRef.current?.(value);
|
|
74
|
+
prevValueRef.current = value;
|
|
75
|
+
}
|
|
76
|
+
}, [value, prevValueRef]);
|
|
77
|
+
return [value, setValue, onChangeRef];
|
|
78
|
+
}
|
|
79
|
+
function isFunction(value) {
|
|
80
|
+
return typeof value === "function";
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// src/slot.tsx
|
|
84
|
+
// @__NO_SIDE_EFFECTS__
|
|
85
|
+
function createSlot(ownerName) {
|
|
86
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
87
|
+
const Slot2 = React.forwardRef((props, forwardedRef) => {
|
|
88
|
+
const { children, ...slotProps } = props;
|
|
89
|
+
const childrenArray = React.Children.toArray(children);
|
|
90
|
+
const slottable = childrenArray.find(isSlottable);
|
|
91
|
+
if (slottable) {
|
|
92
|
+
const newElement = slottable.props.children;
|
|
93
|
+
const newChildren = childrenArray.map((child) => {
|
|
94
|
+
if (child === slottable) {
|
|
95
|
+
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
|
96
|
+
return React.isValidElement(newElement) ? newElement.props.children : null;
|
|
97
|
+
} else {
|
|
98
|
+
return child;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
|
102
|
+
}
|
|
103
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
104
|
+
});
|
|
105
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
106
|
+
return Slot2;
|
|
107
|
+
}
|
|
108
|
+
// @__NO_SIDE_EFFECTS__
|
|
109
|
+
function createSlotClone(ownerName) {
|
|
110
|
+
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
111
|
+
const { children, ...slotProps } = props;
|
|
112
|
+
if (React.isValidElement(children)) {
|
|
113
|
+
const childrenRef = getElementRef(children);
|
|
114
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
115
|
+
if (children.type !== React.Fragment) {
|
|
116
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
117
|
+
}
|
|
118
|
+
return React.cloneElement(children, props2);
|
|
119
|
+
}
|
|
120
|
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
121
|
+
});
|
|
122
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
123
|
+
return SlotClone;
|
|
124
|
+
}
|
|
125
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
126
|
+
function isSlottable(child) {
|
|
127
|
+
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
128
|
+
}
|
|
129
|
+
function mergeProps(slotProps, childProps) {
|
|
130
|
+
const overrideProps = { ...childProps };
|
|
131
|
+
for (const propName in childProps) {
|
|
132
|
+
const slotPropValue = slotProps[propName];
|
|
133
|
+
const childPropValue = childProps[propName];
|
|
134
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
135
|
+
if (isHandler) {
|
|
136
|
+
if (slotPropValue && childPropValue) {
|
|
137
|
+
overrideProps[propName] = (...args) => {
|
|
138
|
+
const result = childPropValue(...args);
|
|
139
|
+
slotPropValue(...args);
|
|
140
|
+
return result;
|
|
141
|
+
};
|
|
142
|
+
} else if (slotPropValue) {
|
|
143
|
+
overrideProps[propName] = slotPropValue;
|
|
144
|
+
}
|
|
145
|
+
} else if (propName === "style") {
|
|
146
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
147
|
+
} else if (propName === "className") {
|
|
148
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return { ...slotProps, ...overrideProps };
|
|
152
|
+
}
|
|
153
|
+
function getElementRef(element) {
|
|
154
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
155
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
156
|
+
if (mayWarn) {
|
|
157
|
+
return element.ref;
|
|
158
|
+
}
|
|
159
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
160
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
161
|
+
if (mayWarn) {
|
|
162
|
+
return element.props.ref;
|
|
163
|
+
}
|
|
164
|
+
return element.props.ref || element.ref;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// src/primitive.tsx
|
|
168
|
+
var NODES = [
|
|
169
|
+
"a",
|
|
170
|
+
"button",
|
|
171
|
+
"div",
|
|
172
|
+
"form",
|
|
173
|
+
"h2",
|
|
174
|
+
"h3",
|
|
175
|
+
"img",
|
|
176
|
+
"input",
|
|
177
|
+
"label",
|
|
178
|
+
"li",
|
|
179
|
+
"nav",
|
|
180
|
+
"ol",
|
|
181
|
+
"p",
|
|
182
|
+
"select",
|
|
183
|
+
"span",
|
|
184
|
+
"svg",
|
|
185
|
+
"ul"
|
|
186
|
+
];
|
|
187
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
|
188
|
+
const Slot = createSlot(`Primitive.${node}`);
|
|
189
|
+
const Node = React.forwardRef((props, forwardedRef) => {
|
|
190
|
+
const { asChild, ...primitiveProps } = props;
|
|
191
|
+
const Comp = asChild ? Slot : node;
|
|
192
|
+
if (typeof window !== "undefined") {
|
|
193
|
+
window[Symbol.for("radix-ui")] = true;
|
|
194
|
+
}
|
|
195
|
+
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
196
|
+
});
|
|
197
|
+
Node.displayName = `Primitive.${node}`;
|
|
198
|
+
return { ...primitive, [node]: Node };
|
|
199
|
+
}, {});
|
|
200
|
+
function dispatchDiscreteCustomEvent(target, event) {
|
|
201
|
+
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export { Primitive as P, composeEventHandlers as a, createSlot as c, dispatchDiscreteCustomEvent as d, useControllableState as u };
|
|
205
|
+
//# sourceMappingURL=index13.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index13.js","sources":["../node_modules/.pnpm/@radix-ui+primitive@1.1.3/node_modules/@radix-ui/primitive/dist/index.mjs","../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.2.9_react@19.2.3/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs","../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.2.9_react@19.2.3/node_modules/@radix-ui/react-slot/dist/index.mjs","../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.2.3_@types+react@19.2.9__@types+rea_57eb89d0235dc4221ced9969d75eafcb/node_modules/@radix-ui/react-primitive/dist/index.mjs"],"sourcesContent":["// src/primitive.tsx\nvar canUseDOM = !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\nfunction composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {\n return function handleEvent(event) {\n originalEventHandler?.(event);\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\nfunction getOwnerWindow(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access window outside of the DOM\");\n }\n return element?.ownerDocument?.defaultView ?? window;\n}\nfunction getOwnerDocument(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access document outside of the DOM\");\n }\n return element?.ownerDocument ?? document;\n}\nfunction getActiveElement(node, activeDescendant = false) {\n const { activeElement } = getOwnerDocument(node);\n if (!activeElement?.nodeName) {\n return null;\n }\n if (isFrame(activeElement) && activeElement.contentDocument) {\n return getActiveElement(activeElement.contentDocument.body, activeDescendant);\n }\n if (activeDescendant) {\n const id = activeElement.getAttribute(\"aria-activedescendant\");\n if (id) {\n const element = getOwnerDocument(activeElement).getElementById(id);\n if (element) {\n return element;\n }\n }\n }\n return activeElement;\n}\nfunction isFrame(element) {\n return element.tagName === \"IFRAME\";\n}\nexport {\n canUseDOM,\n composeEventHandlers,\n getActiveElement,\n getOwnerDocument,\n getOwnerWindow,\n isFrame\n};\n//# sourceMappingURL=index.mjs.map\n","// src/use-controllable-state.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nvar useInsertionEffect = React[\" useInsertionEffect \".trim().toString()] || useLayoutEffect;\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = () => {\n },\n caller\n}) {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange\n });\n const isControlled = prop !== void 0;\n const value = isControlled ? prop : uncontrolledProp;\n if (true) {\n const isControlledRef = React.useRef(prop !== void 0);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${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.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const setValue = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value2 !== prop) {\n onChangeRef.current?.(value2);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n return [value, setValue];\n}\nfunction useUncontrolledState({\n defaultProp,\n onChange\n}) {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n return [value, setValue, onChangeRef];\n}\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n\n// src/use-controllable-state-reducer.tsx\nimport * as React2 from \"react\";\nimport { useEffectEvent } from \"@radix-ui/react-use-effect-event\";\nvar SYNC_STATE = Symbol(\"RADIX:SYNC_STATE\");\nfunction useControllableStateReducer(reducer, userArgs, initialArg, init) {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== void 0;\n const onChange = useEffectEvent(onChangeProp);\n if (true) {\n const isControlledRef = React2.useRef(controlledState !== void 0);\n React2.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${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.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const args = [{ ...initialArg, state: defaultProp }];\n if (init) {\n args.push(init);\n }\n const [internalState, dispatch] = React2.useReducer(\n (state2, action) => {\n if (action.type === SYNC_STATE) {\n return { ...state2, state: action.state };\n }\n const next = reducer(state2, action);\n if (isControlled && !Object.is(next.state, state2.state)) {\n onChange(next.state);\n }\n return next;\n },\n ...args\n );\n const uncontrolledState = internalState.state;\n const prevValueRef = React2.useRef(uncontrolledState);\n React2.useEffect(() => {\n if (prevValueRef.current !== uncontrolledState) {\n prevValueRef.current = uncontrolledState;\n if (!isControlled) {\n onChange(uncontrolledState);\n }\n }\n }, [onChange, uncontrolledState, prevValueRef, isControlled]);\n const state = React2.useMemo(() => {\n const isControlled2 = controlledState !== void 0;\n if (isControlled2) {\n return { ...internalState, state: controlledState };\n }\n return internalState;\n }, [internalState, controlledState]);\n React2.useEffect(() => {\n if (isControlled && !Object.is(controlledState, internalState.state)) {\n dispatch({ type: SYNC_STATE, state: controlledState });\n }\n }, [controlledState, internalState.state, isControlled]);\n return [state, dispatch];\n}\nexport {\n useControllableState,\n useControllableStateReducer\n};\n//# sourceMappingURL=index.mjs.map\n","// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useLayoutEffect"],"mappings":";;;;;;AAAA;AAEA,SAAS,oBAAoB,CAAC,oBAAoB,EAAE,eAAe,EAAE,EAAE,wBAAwB,GAAG,IAAI,EAAE,GAAG,EAAE,EAAE;AAC/G,EAAE,OAAO,SAAS,WAAW,CAAC,KAAK,EAAE;AACrC,IAAI,oBAAoB,GAAG,KAAK,CAAC;AACjC,IAAI,IAAI,wBAAwB,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE;AACvE,MAAM,OAAO,eAAe,GAAG,KAAK,CAAC;AACrC,IAAI;AACJ,EAAE,CAAC;AACH;;ACTA;AAGA,IAAI,kBAAkB,GAAG,KAAK,CAAC,sBAAsB,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAIA,gBAAe;AAC3F,SAAS,oBAAoB,CAAC;AAC9B,EAAE,IAAI;AACN,EAAE,WAAW;AACb,EAA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