@vritti/quantum-ui 0.1.22 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button.d.ts +10 -3
- package/dist/Button.js +21 -36
- package/dist/Button.js.map +1 -1
- package/dist/Button2.js +42 -0
- package/dist/Button2.js.map +1 -0
- package/dist/Card.d.ts +8 -8
- package/dist/Card.js.map +1 -1
- package/dist/Checkbox.d.ts +5 -8
- package/dist/Checkbox.js +38 -278
- package/dist/Checkbox.js.map +1 -1
- package/dist/DatePicker.d.ts +68 -0
- package/dist/DatePicker.js +12038 -0
- package/dist/DatePicker.js.map +1 -0
- package/dist/Form.d.ts +70 -88
- package/dist/Form.js +34 -30
- package/dist/Form.js.map +1 -1
- package/dist/Label.js +40 -0
- package/dist/Label.js.map +1 -0
- package/dist/OTPField.js +2 -12
- package/dist/OTPField.js.map +1 -1
- package/dist/PasswordField.js.map +1 -1
- package/dist/PhoneField.js +6 -12
- package/dist/PhoneField.js.map +1 -1
- package/dist/Skeleton.d.ts +6 -0
- package/dist/Skeleton.js +9 -0
- package/dist/Skeleton.js.map +1 -0
- package/dist/Spinner.d.ts +14 -0
- package/dist/Spinner.js +31 -0
- package/dist/Spinner.js.map +1 -0
- package/dist/TextArea.js +4 -10
- package/dist/TextArea.js.map +1 -1
- package/dist/TextField.js.map +1 -1
- package/dist/ThemeToggle.js.map +1 -1
- package/dist/Typography.js.map +1 -1
- package/dist/assets/quantum-ui.css +66 -44
- package/dist/axios.d.ts +11 -6
- package/dist/axios.js +186 -147
- package/dist/axios.js.map +1 -1
- package/dist/components/Button.d.ts +7 -0
- package/dist/components/Button.js +2 -1
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Card.d.ts +7 -0
- package/dist/components/Checkbox.d.ts +7 -0
- package/dist/components/DatePicker.d.ts +9 -0
- package/dist/components/DatePicker.js +2 -0
- package/dist/components/DatePicker.js.map +1 -0
- package/dist/components/Form.d.ts +7 -0
- package/dist/components/Form.js +1 -1
- package/dist/components/OTPField.d.ts +7 -0
- package/dist/components/PasswordField.d.ts +7 -0
- package/dist/components/PhoneField.d.ts +7 -0
- package/dist/components/Progress.d.ts +7 -0
- package/dist/components/Progress.js +2 -5
- package/dist/components/Progress.js.map +1 -1
- package/dist/components/Skeleton.d.ts +9 -0
- package/dist/components/Skeleton.js +2 -0
- package/dist/components/Skeleton.js.map +1 -0
- package/dist/components/Spinner.d.ts +9 -0
- package/dist/components/Spinner.js +2 -0
- package/dist/components/Spinner.js.map +1 -0
- package/dist/components/TextArea.d.ts +7 -0
- package/dist/components/TextField.d.ts +7 -0
- package/dist/components/ThemeToggle.d.ts +7 -0
- package/dist/components/Typography.d.ts +7 -0
- package/dist/createLucideIcon.js.map +1 -1
- package/dist/field.js +26 -177
- package/dist/field.js.map +1 -1
- package/dist/index.d.ts +146 -142
- package/dist/index.js +10 -7
- package/dist/index.js.map +1 -1
- package/dist/index2.js +54 -116
- package/dist/index2.js.map +1 -1
- package/dist/index3.js +103 -1
- package/dist/index3.js.map +1 -1
- package/dist/index4.js +31 -55
- package/dist/index4.js.map +1 -1
- package/dist/index5.js +90 -3
- package/dist/index5.js.map +1 -1
- package/dist/index6.js +246 -0
- package/dist/index6.js.map +1 -0
- package/dist/shadcn/shadcnField.d.ts +7 -0
- package/dist/utils/axios.d.ts +21 -6
- package/dist/utils/axios.js +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +33 -17
- package/dist/AuthProvider.d.ts +0 -34
- package/dist/OnboardingProvider.js +0 -113
- package/dist/OnboardingProvider.js.map +0 -1
- package/dist/context/AuthProvider.d.ts +0 -2
- package/dist/context/AuthProvider.js +0 -2
- package/dist/context/AuthProvider.js.map +0 -1
package/dist/index2.js
CHANGED
|
@@ -1,126 +1,64 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
|
-
// packages/react/
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
// packages/react/context/src/create-context.tsx
|
|
5
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
6
|
+
let defaultContexts = [];
|
|
7
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
8
|
+
const BaseContext = React.createContext(defaultContext);
|
|
9
|
+
const index = defaultContexts.length;
|
|
10
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
11
|
+
const Provider = (props) => {
|
|
12
|
+
const { scope, children, ...context } = props;
|
|
13
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
14
|
+
const value = React.useMemo(() => context, Object.values(context));
|
|
15
|
+
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
16
|
+
};
|
|
17
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
18
|
+
function useContext2(consumerName, scope) {
|
|
19
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
20
|
+
const context = React.useContext(Context);
|
|
21
|
+
if (context) return context;
|
|
22
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
23
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
24
|
+
}
|
|
25
|
+
return [Provider, useContext2];
|
|
10
26
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let hasCleanup = false;
|
|
15
|
-
const cleanups = refs.map((ref) => {
|
|
16
|
-
const cleanup = setRef(ref, node);
|
|
17
|
-
if (!hasCleanup && typeof cleanup == "function") {
|
|
18
|
-
hasCleanup = true;
|
|
19
|
-
}
|
|
20
|
-
return cleanup;
|
|
27
|
+
const createScope = () => {
|
|
28
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
29
|
+
return React.createContext(defaultContext);
|
|
21
30
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
setRef(refs[i], null);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}
|
|
31
|
+
return function useScope(scope) {
|
|
32
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
33
|
+
return React.useMemo(
|
|
34
|
+
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
35
|
+
[scope, contexts]
|
|
36
|
+
);
|
|
37
|
+
};
|
|
34
38
|
};
|
|
39
|
+
createScope.scopeName = scopeName;
|
|
40
|
+
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
35
41
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return child;
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
|
59
|
-
}
|
|
60
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
61
|
-
});
|
|
62
|
-
Slot2.displayName = `${ownerName}.Slot`;
|
|
63
|
-
return Slot2;
|
|
64
|
-
}
|
|
65
|
-
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
66
|
-
// @__NO_SIDE_EFFECTS__
|
|
67
|
-
function createSlotClone(ownerName) {
|
|
68
|
-
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
69
|
-
const { children, ...slotProps } = props;
|
|
70
|
-
if (React.isValidElement(children)) {
|
|
71
|
-
const childrenRef = getElementRef(children);
|
|
72
|
-
const props2 = mergeProps(slotProps, children.props);
|
|
73
|
-
if (children.type !== React.Fragment) {
|
|
74
|
-
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
75
|
-
}
|
|
76
|
-
return React.cloneElement(children, props2);
|
|
77
|
-
}
|
|
78
|
-
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
79
|
-
});
|
|
80
|
-
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
81
|
-
return SlotClone;
|
|
82
|
-
}
|
|
83
|
-
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
84
|
-
function isSlottable(child) {
|
|
85
|
-
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
86
|
-
}
|
|
87
|
-
function mergeProps(slotProps, childProps) {
|
|
88
|
-
const overrideProps = { ...childProps };
|
|
89
|
-
for (const propName in childProps) {
|
|
90
|
-
const slotPropValue = slotProps[propName];
|
|
91
|
-
const childPropValue = childProps[propName];
|
|
92
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
93
|
-
if (isHandler) {
|
|
94
|
-
if (slotPropValue && childPropValue) {
|
|
95
|
-
overrideProps[propName] = (...args) => {
|
|
96
|
-
const result = childPropValue(...args);
|
|
97
|
-
slotPropValue(...args);
|
|
98
|
-
return result;
|
|
99
|
-
};
|
|
100
|
-
} else if (slotPropValue) {
|
|
101
|
-
overrideProps[propName] = slotPropValue;
|
|
102
|
-
}
|
|
103
|
-
} else if (propName === "style") {
|
|
104
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
105
|
-
} else if (propName === "className") {
|
|
106
|
-
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return { ...slotProps, ...overrideProps };
|
|
110
|
-
}
|
|
111
|
-
function getElementRef(element) {
|
|
112
|
-
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
113
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
114
|
-
if (mayWarn) {
|
|
115
|
-
return element.ref;
|
|
116
|
-
}
|
|
117
|
-
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
118
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
119
|
-
if (mayWarn) {
|
|
120
|
-
return element.props.ref;
|
|
121
|
-
}
|
|
122
|
-
return element.props.ref || element.ref;
|
|
42
|
+
function composeContextScopes(...scopes) {
|
|
43
|
+
const baseScope = scopes[0];
|
|
44
|
+
if (scopes.length === 1) return baseScope;
|
|
45
|
+
const createScope = () => {
|
|
46
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
47
|
+
useScope: createScope2(),
|
|
48
|
+
scopeName: createScope2.scopeName
|
|
49
|
+
}));
|
|
50
|
+
return function useComposedScopes(overrideScopes) {
|
|
51
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
52
|
+
const scopeProps = useScope(overrideScopes);
|
|
53
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
54
|
+
return { ...nextScopes2, ...currentScope };
|
|
55
|
+
}, {});
|
|
56
|
+
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
createScope.scopeName = baseScope.scopeName;
|
|
60
|
+
return createScope;
|
|
123
61
|
}
|
|
124
62
|
|
|
125
|
-
export {
|
|
63
|
+
export { createContextScope as c };
|
|
126
64
|
//# sourceMappingURL=index2.js.map
|
package/dist/index2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index2.js","sources":["../node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../node_modules/@radix-ui/react-slot/dist/index.mjs"],"sourcesContent":["// packages/react/compose-refs/src/compose-refs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\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"],"names":[],"mappings":";;;AAAA;AAEA,SAAS,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE;AAC5B,EAAE,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;AACjC,IAAI,OAAO,GAAG,CAAC,KAAK,CAAC;AACrB,EAAE,CAAC,MAAM,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,MAAM,EAAE;AAC7C,IAAI,GAAG,CAAC,OAAO,GAAG,KAAK;AACvB,EAAE;AACF;AACA,SAAS,WAAW,CAAC,GAAG,IAAI,EAAE;AAC9B,EAAE,OAAO,CAAC,IAAI,KAAK;AACnB,IAAI,IAAI,UAAU,GAAG,KAAK;AAC1B,IAAI,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;AACvC,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC;AACvC,MAAM,IAAI,CAAC,UAAU,IAAI,OAAO,OAAO,IAAI,UAAU,EAAE;AACvD,QAAQ,UAAU,GAAG,IAAI;AACzB,MAAM;AACN,MAAM,OAAO,OAAO;AACpB,IAAI,CAAC,CAAC;AACN,IAAI,IAAI,UAAU,EAAE;AACpB,MAAM,OAAO,MAAM;AACnB,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAClD,UAAU,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC;AACrC,UAAU,IAAI,OAAO,OAAO,IAAI,UAAU,EAAE;AAC5C,YAAY,OAAO,EAAE;AACrB,UAAU,CAAC,MAAM;AACjB,YAAY,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;AACjC,UAAU;AACV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AAE,GAAG,aAAa,EAAE,GAAG,cAAc,EAAE;AACvE,IAAI,CAAC,MAAM,IAAI,QAAQ,KAAK,WAAW,EAAE;AACzC,MAAM,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AACzF,IAAI;AACJ,EAAE;AACF,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,aAAa,EAAE;AAC3C;AACA,SAAS,aAAa,CAAC,OAAO,EAAE;AAChC,EAAE,IAAI,MAAM,GAAG,MAAM,CAAC,wBAAwB,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,GAAG;AACzE,EAAE,IAAI,OAAO,GAAG,MAAM,IAAI,gBAAgB,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,1]}
|
|
1
|
+
{"version":3,"file":"index2.js","sources":["../node_modules/.pnpm/@radix-ui+react-context@1.1.2_@types+react@19.1.6_react@19.1.1/node_modules/@radix-ui/react-context/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"],"names":[],"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,CAAC;AAC1D,IAAI,MAAM,QAAQ,GAAG,CAAC,KAAK,KAAK;AAChC,MAAM,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK;AACnD,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC,GAAG,KAAK,CAAC,IAAI,WAAW;AAChE,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACxE,MAAM,uBAAuB,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACvE,IAAI,CAAC;AACL,IAAI,QAAQ,CAAC,WAAW,GAAG,iBAAiB,GAAG,UAAU;AACzD,IAAI,SAAS,WAAW,CAAC,YAAY,EAAE,KAAK,EAAE;AAC9C,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC,GAAG,KAAK,CAA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AAC3C,EAAE,MAAM,WAAW,GAAG,MAAM;AAC5B,IAAI,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,YAAY,MAAM;AACrD,MAAM,QAAQ,EAAE,YAAY,EAAE;AAC9B,MAAM,SAAS,EAAE,YAAY,CAAC;AAC9B,KAAK,CAAC,CAAC;AACP,IAAI,OAAO,SAAS,iBAAiB,CAAC,cAAc,EAAE;AACtD,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK;AACrF,QAAQ,MAAM,UAAU,GAAG,QAAQ,CAAC,cAAc,CAAC;AACnD,QAAQ,MAAM,YAAY,GAAG,UAAU,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AAC9D,QAAQ,OAAO,EAAE,GAAG,WAAW,EAAE,GAAG,YAAY,EAAE;AAClD,MAAM,CAAC,EAAE,EAAE,CAAC;AACZ,MAAM,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;AACnG,IAAI,CAAC;AACL,EAAE,CAAC;AACH,EAAE,WAAW,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS;AAC7C,EAAE,OAAO,WAAW;AACpB;;;;","x_google_ignoreList":[0]}
|
package/dist/index3.js
CHANGED
|
@@ -1,5 +1,107 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { c as composeRefs } from './index4.js';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
4
|
import { a as clsx } from './utils.js';
|
|
2
5
|
|
|
6
|
+
// src/slot.tsx
|
|
7
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
8
|
+
var use = React[" use ".trim().toString()];
|
|
9
|
+
function isPromiseLike(value) {
|
|
10
|
+
return typeof value === "object" && value !== null && "then" in value;
|
|
11
|
+
}
|
|
12
|
+
function isLazyComponent(element) {
|
|
13
|
+
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
14
|
+
}
|
|
15
|
+
// @__NO_SIDE_EFFECTS__
|
|
16
|
+
function createSlot(ownerName) {
|
|
17
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
18
|
+
const Slot2 = React.forwardRef((props, forwardedRef) => {
|
|
19
|
+
let { children, ...slotProps } = props;
|
|
20
|
+
if (isLazyComponent(children) && typeof use === "function") {
|
|
21
|
+
children = use(children._payload);
|
|
22
|
+
}
|
|
23
|
+
const childrenArray = React.Children.toArray(children);
|
|
24
|
+
const slottable = childrenArray.find(isSlottable);
|
|
25
|
+
if (slottable) {
|
|
26
|
+
const newElement = slottable.props.children;
|
|
27
|
+
const newChildren = childrenArray.map((child) => {
|
|
28
|
+
if (child === slottable) {
|
|
29
|
+
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
|
30
|
+
return React.isValidElement(newElement) ? newElement.props.children : null;
|
|
31
|
+
} else {
|
|
32
|
+
return child;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
|
36
|
+
}
|
|
37
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
38
|
+
});
|
|
39
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
40
|
+
return Slot2;
|
|
41
|
+
}
|
|
42
|
+
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
43
|
+
// @__NO_SIDE_EFFECTS__
|
|
44
|
+
function createSlotClone(ownerName) {
|
|
45
|
+
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
46
|
+
let { children, ...slotProps } = props;
|
|
47
|
+
if (isLazyComponent(children) && typeof use === "function") {
|
|
48
|
+
children = use(children._payload);
|
|
49
|
+
}
|
|
50
|
+
if (React.isValidElement(children)) {
|
|
51
|
+
const childrenRef = getElementRef(children);
|
|
52
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
53
|
+
if (children.type !== React.Fragment) {
|
|
54
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
55
|
+
}
|
|
56
|
+
return React.cloneElement(children, props2);
|
|
57
|
+
}
|
|
58
|
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
59
|
+
});
|
|
60
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
61
|
+
return SlotClone;
|
|
62
|
+
}
|
|
63
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
64
|
+
function isSlottable(child) {
|
|
65
|
+
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
66
|
+
}
|
|
67
|
+
function mergeProps(slotProps, childProps) {
|
|
68
|
+
const overrideProps = { ...childProps };
|
|
69
|
+
for (const propName in childProps) {
|
|
70
|
+
const slotPropValue = slotProps[propName];
|
|
71
|
+
const childPropValue = childProps[propName];
|
|
72
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
73
|
+
if (isHandler) {
|
|
74
|
+
if (slotPropValue && childPropValue) {
|
|
75
|
+
overrideProps[propName] = (...args) => {
|
|
76
|
+
const result = childPropValue(...args);
|
|
77
|
+
slotPropValue(...args);
|
|
78
|
+
return result;
|
|
79
|
+
};
|
|
80
|
+
} else if (slotPropValue) {
|
|
81
|
+
overrideProps[propName] = slotPropValue;
|
|
82
|
+
}
|
|
83
|
+
} else if (propName === "style") {
|
|
84
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
85
|
+
} else if (propName === "className") {
|
|
86
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return { ...slotProps, ...overrideProps };
|
|
90
|
+
}
|
|
91
|
+
function getElementRef(element) {
|
|
92
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
93
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
94
|
+
if (mayWarn) {
|
|
95
|
+
return element.ref;
|
|
96
|
+
}
|
|
97
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
98
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
99
|
+
if (mayWarn) {
|
|
100
|
+
return element.props.ref;
|
|
101
|
+
}
|
|
102
|
+
return element.props.ref || element.ref;
|
|
103
|
+
}
|
|
104
|
+
|
|
3
105
|
const falsyToString = (value)=>typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
4
106
|
const cx = clsx;
|
|
5
107
|
const cva = (base, config)=>(props)=>{
|
|
@@ -41,5 +143,5 @@ const cva = (base, config)=>(props)=>{
|
|
|
41
143
|
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
42
144
|
};
|
|
43
145
|
|
|
44
|
-
export { cva as c };
|
|
146
|
+
export { Slot as S, createSlot as a, cva as c };
|
|
45
147
|
//# sourceMappingURL=index3.js.map
|
package/dist/index3.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index3.js","sources":["../node_modules/class-variance-authority/dist/index.mjs"],"sourcesContent":["/**\n * Copyright 2022 Joe Bell. All rights reserved.\n *\n * This file is licensed to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with the\n * License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */ import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\n"],"names":[],"mappings":";;AAeA,MAAM,aAAa,GAAG,CAAC,KAAK,GAAG,OAAO,KAAK,KAAK,SAAS,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,KAAK,KAAK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AAC,IAAI,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;AACrM,IAAI;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"index3.js","sources":["../node_modules/.pnpm/@radix-ui+react-slot@1.2.4_@types+react@19.1.6_react@19.1.1/node_modules/@radix-ui/react-slot/dist/index.mjs","../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/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 {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","/**\n * Copyright 2022 Joe Bell. All rights reserved.\n *\n * This file is licensed to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with the\n * License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */ import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\n"],"names":[],"mappings":";;;;;AAAA;AAIA,IAAI,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;AAC9C,IAAI,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC;AAC1C,SAAS,aAAa,CAAC,KAAK,EAAE;AAC9B,EAAE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,IAAI,KAAK;AACvE;AACA,SAAS,eAAe,CAAC,OAAO,EAAE;AAClC,EAAE,OAAO,OAAO,IAAI,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,UAAU,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,KAAK,eAAe,IAAI,UAAU,IAAI,OAAO,IAAI,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC;AACpL;AACA;AACA,SAAS,UAAU,CAAC,SAAS,EAAE;AAC/B,EAAE,MAAM,SAAS,mBAAmB,eAAe,CAAC,SAAS,CAAC;AAC9D,EAAE,MAAM,KAA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AAM,GAAG,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;AACrM,IAAI;;;;","x_google_ignoreList":[0,1]}
|
package/dist/index4.js
CHANGED
|
@@ -1,64 +1,40 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
|
3
2
|
|
|
4
|
-
// packages/react/
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
defaultContexts = [...defaultContexts, defaultContext];
|
|
11
|
-
const Provider = (props) => {
|
|
12
|
-
const { scope, children, ...context } = props;
|
|
13
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
14
|
-
const value = React.useMemo(() => context, Object.values(context));
|
|
15
|
-
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
16
|
-
};
|
|
17
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
18
|
-
function useContext2(consumerName, scope) {
|
|
19
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
20
|
-
const context = React.useContext(Context);
|
|
21
|
-
if (context) return context;
|
|
22
|
-
if (defaultContext !== void 0) return defaultContext;
|
|
23
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
24
|
-
}
|
|
25
|
-
return [Provider, useContext2];
|
|
3
|
+
// packages/react/compose-refs/src/compose-refs.tsx
|
|
4
|
+
function setRef(ref, value) {
|
|
5
|
+
if (typeof ref === "function") {
|
|
6
|
+
return ref(value);
|
|
7
|
+
} else if (ref !== null && ref !== void 0) {
|
|
8
|
+
ref.current = value;
|
|
26
9
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
10
|
+
}
|
|
11
|
+
function composeRefs(...refs) {
|
|
12
|
+
return (node) => {
|
|
13
|
+
let hasCleanup = false;
|
|
14
|
+
const cleanups = refs.map((ref) => {
|
|
15
|
+
const cleanup = setRef(ref, node);
|
|
16
|
+
if (!hasCleanup && typeof cleanup == "function") {
|
|
17
|
+
hasCleanup = true;
|
|
18
|
+
}
|
|
19
|
+
return cleanup;
|
|
30
20
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
21
|
+
if (hasCleanup) {
|
|
22
|
+
return () => {
|
|
23
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
24
|
+
const cleanup = cleanups[i];
|
|
25
|
+
if (typeof cleanup == "function") {
|
|
26
|
+
cleanup();
|
|
27
|
+
} else {
|
|
28
|
+
setRef(refs[i], null);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
38
33
|
};
|
|
39
|
-
createScope.scopeName = scopeName;
|
|
40
|
-
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
41
34
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
if (scopes.length === 1) return baseScope;
|
|
45
|
-
const createScope = () => {
|
|
46
|
-
const scopeHooks = scopes.map((createScope2) => ({
|
|
47
|
-
useScope: createScope2(),
|
|
48
|
-
scopeName: createScope2.scopeName
|
|
49
|
-
}));
|
|
50
|
-
return function useComposedScopes(overrideScopes) {
|
|
51
|
-
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
52
|
-
const scopeProps = useScope(overrideScopes);
|
|
53
|
-
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
54
|
-
return { ...nextScopes2, ...currentScope };
|
|
55
|
-
}, {});
|
|
56
|
-
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
createScope.scopeName = baseScope.scopeName;
|
|
60
|
-
return createScope;
|
|
35
|
+
function useComposedRefs(...refs) {
|
|
36
|
+
return React.useCallback(composeRefs(...refs), refs);
|
|
61
37
|
}
|
|
62
38
|
|
|
63
|
-
export {
|
|
39
|
+
export { composeRefs as c, useComposedRefs as u };
|
|
64
40
|
//# sourceMappingURL=index4.js.map
|
package/dist/index4.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index4.js","sources":["../node_modules/@radix-ui/react-
|
|
1
|
+
{"version":3,"file":"index4.js","sources":["../node_modules/.pnpm/@radix-ui+react-compose-refs@1.1.2_@types+react@19.1.6_react@19.1.1/node_modules/@radix-ui/react-compose-refs/dist/index.mjs"],"sourcesContent":["// packages/react/compose-refs/src/compose-refs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;AAAA;AAEA,SAAS,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE;AAC5B,EAAE,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE;AACjC,IAAI,OAAO,GAAG,CAAC,KAAK,CAAC;AACrB,EAAE,CAAC,MAAM,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,MAAM,EAAE;AAC7C,IAAI,GAAG,CAAC,OAAO,GAAG,KAAK;AACvB,EAAE;AACF;AACA,SAAS,WAAW,CAAC,GAAG,IAAI,EAAE;AAC9B,EAAE,OAAO,CAAC,IAAI,KAAK;AACnB,IAAI,IAAI,UAAU,GAAG,KAAK;AAC1B,IAAI,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK;AACvC,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC;AACvC,MAAM,IAAI,CAAC,UAAU,IAAI,OAAO,OAAO,IAAI,UAAU,EAAE;AACvD,QAAQ,UAAU,GAAG,IAAI;AACzB,MAAM;AACN,MAAM,OAAO,OAAO;AACpB,IAAI,CAAC,CAAC;AACN,IAAI,IAAI,UAAU,EAAE;AACpB,MAAM,OAAO,MAAM;AACnB,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAClD,UAAU,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC;AACrC,UAAU,IAAI,OAAO,OAAO,IAAI,UAAU,EAAE;AAC5C,YAAY,OAAO,EAAE;AACrB,UAAU,CAAC,MAAM;AACjB,YAAY,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC;AACjC,UAAU;AACV,QAAQ;AACR,MAAM,CAAC;AACP,IAAI;AACJ,EAAE,CAAC;AACH;AACA,SAAS,eAAe,CAAC,GAAG,IAAI,EAAE;AAClC,EAAE,OAAO,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC;AACtD;;;;","x_google_ignoreList":[0]}
|
package/dist/index5.js
CHANGED
|
@@ -1,8 +1,92 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import 'react-dom';
|
|
3
|
-
import { c as
|
|
2
|
+
import * as ReactDOM from 'react-dom';
|
|
3
|
+
import { c as composeRefs } from './index4.js';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
|
+
// src/slot.tsx
|
|
7
|
+
// @__NO_SIDE_EFFECTS__
|
|
8
|
+
function createSlot(ownerName) {
|
|
9
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
10
|
+
const Slot2 = React.forwardRef((props, forwardedRef) => {
|
|
11
|
+
const { children, ...slotProps } = props;
|
|
12
|
+
const childrenArray = React.Children.toArray(children);
|
|
13
|
+
const slottable = childrenArray.find(isSlottable);
|
|
14
|
+
if (slottable) {
|
|
15
|
+
const newElement = slottable.props.children;
|
|
16
|
+
const newChildren = childrenArray.map((child) => {
|
|
17
|
+
if (child === slottable) {
|
|
18
|
+
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
|
19
|
+
return React.isValidElement(newElement) ? newElement.props.children : null;
|
|
20
|
+
} else {
|
|
21
|
+
return child;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
|
25
|
+
}
|
|
26
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
27
|
+
});
|
|
28
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
29
|
+
return Slot2;
|
|
30
|
+
}
|
|
31
|
+
// @__NO_SIDE_EFFECTS__
|
|
32
|
+
function createSlotClone(ownerName) {
|
|
33
|
+
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
34
|
+
const { children, ...slotProps } = props;
|
|
35
|
+
if (React.isValidElement(children)) {
|
|
36
|
+
const childrenRef = getElementRef(children);
|
|
37
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
38
|
+
if (children.type !== React.Fragment) {
|
|
39
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
40
|
+
}
|
|
41
|
+
return React.cloneElement(children, props2);
|
|
42
|
+
}
|
|
43
|
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
44
|
+
});
|
|
45
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
46
|
+
return SlotClone;
|
|
47
|
+
}
|
|
48
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
49
|
+
function isSlottable(child) {
|
|
50
|
+
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
51
|
+
}
|
|
52
|
+
function mergeProps(slotProps, childProps) {
|
|
53
|
+
const overrideProps = { ...childProps };
|
|
54
|
+
for (const propName in childProps) {
|
|
55
|
+
const slotPropValue = slotProps[propName];
|
|
56
|
+
const childPropValue = childProps[propName];
|
|
57
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
58
|
+
if (isHandler) {
|
|
59
|
+
if (slotPropValue && childPropValue) {
|
|
60
|
+
overrideProps[propName] = (...args) => {
|
|
61
|
+
const result = childPropValue(...args);
|
|
62
|
+
slotPropValue(...args);
|
|
63
|
+
return result;
|
|
64
|
+
};
|
|
65
|
+
} else if (slotPropValue) {
|
|
66
|
+
overrideProps[propName] = slotPropValue;
|
|
67
|
+
}
|
|
68
|
+
} else if (propName === "style") {
|
|
69
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
70
|
+
} else if (propName === "className") {
|
|
71
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return { ...slotProps, ...overrideProps };
|
|
75
|
+
}
|
|
76
|
+
function getElementRef(element) {
|
|
77
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
78
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
79
|
+
if (mayWarn) {
|
|
80
|
+
return element.ref;
|
|
81
|
+
}
|
|
82
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
83
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
84
|
+
if (mayWarn) {
|
|
85
|
+
return element.props.ref;
|
|
86
|
+
}
|
|
87
|
+
return element.props.ref || element.ref;
|
|
88
|
+
}
|
|
89
|
+
|
|
6
90
|
// src/primitive.tsx
|
|
7
91
|
var NODES = [
|
|
8
92
|
"a",
|
|
@@ -36,6 +120,9 @@ var Primitive = NODES.reduce((primitive, node) => {
|
|
|
36
120
|
Node.displayName = `Primitive.${node}`;
|
|
37
121
|
return { ...primitive, [node]: Node };
|
|
38
122
|
}, {});
|
|
123
|
+
function dispatchDiscreteCustomEvent(target, event) {
|
|
124
|
+
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
125
|
+
}
|
|
39
126
|
|
|
40
|
-
export { Primitive as P };
|
|
127
|
+
export { Primitive as P, createSlot as c, dispatchDiscreteCustomEvent as d };
|
|
41
128
|
//# sourceMappingURL=index5.js.map
|