@yoopta/themes-shadcn 6.0.0-beta.14 → 6.0.0-beta.16
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/table/components/row-controls.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/accordion.js.map +0 -1
- package/dist/blockquote.js.map +0 -1
- package/dist/callout.js.map +0 -1
- package/dist/carousel.js.map +0 -1
- package/dist/chunks/Combination-2202c874.js +0 -1080
- package/dist/chunks/Combination-2202c874.js.map +0 -1
- package/dist/chunks/_tslib-514d60fe.js +0 -67
- package/dist/chunks/_tslib-514d60fe.js.map +0 -1
- package/dist/chunks/arrow-right-cc37c75c.js +0 -30
- package/dist/chunks/arrow-right-cc37c75c.js.map +0 -1
- package/dist/chunks/button-f9af7cb3.js +0 -76
- package/dist/chunks/button-f9af7cb3.js.map +0 -1
- package/dist/chunks/card-29720641.js +0 -38
- package/dist/chunks/card-29720641.js.map +0 -1
- package/dist/chunks/check-530fff0e.js +0 -14
- package/dist/chunks/check-530fff0e.js.map +0 -1
- package/dist/chunks/chevron-down-544d1acd.js +0 -16
- package/dist/chunks/chevron-down-544d1acd.js.map +0 -1
- package/dist/chunks/chevron-up-053cba03.js +0 -14
- package/dist/chunks/chevron-up-053cba03.js.map +0 -1
- package/dist/chunks/code-2ff9cc0c.js +0 -17
- package/dist/chunks/code-2ff9cc0c.js.map +0 -1
- package/dist/chunks/createLucideIcon-02eb7854.js +0 -95
- package/dist/chunks/createLucideIcon-02eb7854.js.map +0 -1
- package/dist/chunks/dropdown-menu-ac777fdc.js +0 -1165
- package/dist/chunks/dropdown-menu-ac777fdc.js.map +0 -1
- package/dist/chunks/external-link-43895ded.js +0 -18
- package/dist/chunks/external-link-43895ded.js.map +0 -1
- package/dist/chunks/file-text-99674d8d.js +0 -20
- package/dist/chunks/file-text-99674d8d.js.map +0 -1
- package/dist/chunks/hover-card-134f053d.js +0 -257
- package/dist/chunks/hover-card-134f053d.js.map +0 -1
- package/dist/chunks/index-056b596e.js +0 -16
- package/dist/chunks/index-056b596e.js.map +0 -1
- package/dist/chunks/index-35823769.js +0 -222
- package/dist/chunks/index-35823769.js.map +0 -1
- package/dist/chunks/index-41c4abc4.js +0 -3805
- package/dist/chunks/index-41c4abc4.js.map +0 -1
- package/dist/chunks/index-454935af.js +0 -71
- package/dist/chunks/index-454935af.js.map +0 -1
- package/dist/chunks/index-ae9b48d5.js +0 -12
- package/dist/chunks/index-ae9b48d5.js.map +0 -1
- package/dist/chunks/index-b8a83ba5.js +0 -335
- package/dist/chunks/index-b8a83ba5.js.map +0 -1
- package/dist/chunks/index-b8f2908d.js +0 -40
- package/dist/chunks/index-b8f2908d.js.map +0 -1
- package/dist/chunks/index-c655a86f.js +0 -7
- package/dist/chunks/index-c655a86f.js.map +0 -1
- package/dist/chunks/index-c90e54a4.js +0 -190
- package/dist/chunks/index-c90e54a4.js.map +0 -1
- package/dist/chunks/index-cf5f0d71.js +0 -2907
- package/dist/chunks/index-cf5f0d71.js.map +0 -1
- package/dist/chunks/index-d9171717.js +0 -13
- package/dist/chunks/index-d9171717.js.map +0 -1
- package/dist/chunks/index-dd0fd848.js +0 -70
- package/dist/chunks/index-dd0fd848.js.map +0 -1
- package/dist/chunks/input-5608c2c9.js +0 -13
- package/dist/chunks/input-5608c2c9.js.map +0 -1
- package/dist/chunks/label-c9152e49.js +0 -168
- package/dist/chunks/label-c9152e49.js.map +0 -1
- package/dist/chunks/language-select-bdc50f20.js +0 -44
- package/dist/chunks/language-select-bdc50f20.js.map +0 -1
- package/dist/chunks/play-1a34ad05.js +0 -16
- package/dist/chunks/play-1a34ad05.js.map +0 -1
- package/dist/chunks/plus-fcea2532.js +0 -17
- package/dist/chunks/plus-fcea2532.js.map +0 -1
- package/dist/chunks/popover-ef29b0ac.js +0 -300
- package/dist/chunks/popover-ef29b0ac.js.map +0 -1
- package/dist/chunks/scroll-area-17d8c584.js +0 -726
- package/dist/chunks/scroll-area-17d8c584.js.map +0 -1
- package/dist/chunks/select-98610101.js +0 -1213
- package/dist/chunks/select-98610101.js.map +0 -1
- package/dist/chunks/separator-9e6aa45b.js +0 -172
- package/dist/chunks/separator-9e6aa45b.js.map +0 -1
- package/dist/chunks/sparkles-8922a4af.js +0 -26
- package/dist/chunks/sparkles-8922a4af.js.map +0 -1
- package/dist/chunks/style-inject.es-746bb8ed.js +0 -29
- package/dist/chunks/style-inject.es-746bb8ed.js.map +0 -1
- package/dist/chunks/tabs-9cfbd3cc.js +0 -204
- package/dist/chunks/tabs-9cfbd3cc.js.map +0 -1
- package/dist/chunks/tooltip-f1e02ae0.js +0 -800
- package/dist/chunks/tooltip-f1e02ae0.js.map +0 -1
- package/dist/chunks/trash-2-be728dd2.js +0 -20
- package/dist/chunks/trash-2-be728dd2.js.map +0 -1
- package/dist/chunks/upload-0f56ec3e.js +0 -44
- package/dist/chunks/upload-0f56ec3e.js.map +0 -1
- package/dist/chunks/utils-131071a4.js +0 -2500
- package/dist/chunks/utils-131071a4.js.map +0 -1
- package/dist/chunks/x-2f6cf742.js +0 -17
- package/dist/chunks/x-2f6cf742.js.map +0 -1
- package/dist/code-group.js.map +0 -1
- package/dist/code.js.map +0 -1
- package/dist/divider.js.map +0 -1
- package/dist/embed.js.map +0 -1
- package/dist/file.js.map +0 -1
- package/dist/headings.js.map +0 -1
- package/dist/image.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/link.js.map +0 -1
- package/dist/lists.js.map +0 -1
- package/dist/mention.js.map +0 -1
- package/dist/paragraph.js.map +0 -1
- package/dist/steps.js.map +0 -1
- package/dist/table-of-contents.js.map +0 -1
- package/dist/table.js.map +0 -1
- package/dist/tabs.js.map +0 -1
- package/dist/video.js.map +0 -1
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { u as useLayoutEffect2 } from './index-b8a83ba5.js';
|
|
3
|
-
|
|
4
|
-
// src/use-controllable-state.tsx
|
|
5
|
-
var useInsertionEffect = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
6
|
-
function useControllableState({
|
|
7
|
-
prop,
|
|
8
|
-
defaultProp,
|
|
9
|
-
onChange = () => {
|
|
10
|
-
},
|
|
11
|
-
caller
|
|
12
|
-
}) {
|
|
13
|
-
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
14
|
-
defaultProp,
|
|
15
|
-
onChange
|
|
16
|
-
});
|
|
17
|
-
const isControlled = prop !== void 0;
|
|
18
|
-
const value = isControlled ? prop : uncontrolledProp;
|
|
19
|
-
{
|
|
20
|
-
const isControlledRef = React.useRef(prop !== void 0);
|
|
21
|
-
React.useEffect(() => {
|
|
22
|
-
const wasControlled = isControlledRef.current;
|
|
23
|
-
if (wasControlled !== isControlled) {
|
|
24
|
-
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
25
|
-
const to = isControlled ? "controlled" : "uncontrolled";
|
|
26
|
-
console.warn(
|
|
27
|
-
`${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.`
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
isControlledRef.current = isControlled;
|
|
31
|
-
}, [isControlled, caller]);
|
|
32
|
-
}
|
|
33
|
-
const setValue = React.useCallback(
|
|
34
|
-
(nextValue) => {
|
|
35
|
-
if (isControlled) {
|
|
36
|
-
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
37
|
-
if (value2 !== prop) {
|
|
38
|
-
onChangeRef.current?.(value2);
|
|
39
|
-
}
|
|
40
|
-
} else {
|
|
41
|
-
setUncontrolledProp(nextValue);
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
|
45
|
-
);
|
|
46
|
-
return [value, setValue];
|
|
47
|
-
}
|
|
48
|
-
function useUncontrolledState({
|
|
49
|
-
defaultProp,
|
|
50
|
-
onChange
|
|
51
|
-
}) {
|
|
52
|
-
const [value, setValue] = React.useState(defaultProp);
|
|
53
|
-
const prevValueRef = React.useRef(value);
|
|
54
|
-
const onChangeRef = React.useRef(onChange);
|
|
55
|
-
useInsertionEffect(() => {
|
|
56
|
-
onChangeRef.current = onChange;
|
|
57
|
-
}, [onChange]);
|
|
58
|
-
React.useEffect(() => {
|
|
59
|
-
if (prevValueRef.current !== value) {
|
|
60
|
-
onChangeRef.current?.(value);
|
|
61
|
-
prevValueRef.current = value;
|
|
62
|
-
}
|
|
63
|
-
}, [value, prevValueRef]);
|
|
64
|
-
return [value, setValue, onChangeRef];
|
|
65
|
-
}
|
|
66
|
-
function isFunction(value) {
|
|
67
|
-
return typeof value === "function";
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export { useControllableState as u };
|
|
71
|
-
//# sourceMappingURL=index-454935af.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-454935af.js","sources":["../../../../../node_modules/@radix-ui/react-use-controllable-state/src/use-controllable-state.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n// Prevent bundlers from trying to optimize the import\nconst useInsertionEffect: typeof useLayoutEffect =\n (React as any)[' useInsertionEffect '.trim().toString()] || useLayoutEffect;\n\ntype ChangeHandler<T> = (state: T) => void;\ntype SetStateFn<T> = React.Dispatch<React.SetStateAction<T>>;\n\ninterface UseControllableStateParams<T> {\n prop?: T | undefined;\n defaultProp: T;\n onChange?: ChangeHandler<T>;\n caller?: string;\n}\n\nexport function useControllableState<T>({\n prop,\n defaultProp,\n onChange = () => {},\n caller,\n}: UseControllableStateParams<T>): [T, SetStateFn<T>] {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange,\n });\n const isControlled = prop !== undefined;\n const value = isControlled ? prop : uncontrolledProp;\n\n // OK to disable conditionally calling hooks here because they will always run\n // consistently in the same environment. Bundlers should be able to remove the\n // code block entirely in production.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (process.env.NODE_ENV !== 'production') {\n const isControlledRef = React.useRef(prop !== undefined);\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 /* eslint-enable react-hooks/rules-of-hooks */\n\n const setValue = React.useCallback<SetStateFn<T>>(\n (nextValue) => {\n if (isControlled) {\n const value = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value !== prop) {\n onChangeRef.current?.(value);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n\n return [value, setValue];\n}\n\nfunction useUncontrolledState<T>({\n defaultProp,\n onChange,\n}: Omit<UseControllableStateParams<T>, 'prop'>): [\n Value: T,\n setValue: React.Dispatch<React.SetStateAction<T>>,\n OnChangeRef: React.RefObject<ChangeHandler<T> | undefined>,\n] {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n\n return [value, setValue, onChangeRef];\n}\n\nfunction isFunction(value: unknown): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n"],"names":["useLayoutEffect","value"],"mappings":";;;;AAIA,IAAM,qBACH,KAAc,CAAA,sBAAA,CAAuB,MAAO,CAAA,QAAA,EAAU,CAAK,IAAAA,gBAAA,CAAA;AAYvD,SAAS,oBAAwB,CAAA;AAAA,EACtC,IAAA;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irectionContext = React.createContext(void 0);
|
|
6
|
-
function useDirection(localDir) {
|
|
7
|
-
const globalDir = React.useContext(DirectionContext);
|
|
8
|
-
return localDir || globalDir || "ltr";
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export { useDirection as u };
|
|
12
|
-
//# sourceMappingURL=index-ae9b48d5.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-ae9b48d5.js","sources":["../../../../../node_modules/@radix-ui/react-direction/src/direction.tsx"],"sourcesContent":["import * as React from 'react';\n\ntype Direction = 'ltr' | 'rtl';\nconst DirectionContext = React.createContext<Direction | undefined>(undefined);\n\n/* -------------------------------------------------------------------------------------------------\n * Direction\n * -----------------------------------------------------------------------------------------------*/\n\ninterface DirectionProviderProps {\n children?: React.ReactNode;\n dir: Direction;\n}\nconst DirectionProvider: React.FC<DirectionProviderProps> = (props) => {\n const { dir, children } = props;\n return <DirectionContext.Provider value={dir}>{children}</DirectionContext.Provider>;\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction useDirection(localDir?: Direction) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || 'ltr';\n}\n\nconst Provider = DirectionProvider;\n\nexport {\n useDirection,\n //\n Provider,\n //\n DirectionProvider,\n};\n"],"names":[],"mappings":";;;;AAGA,IAAM,gBAAA,GAAyB,oBAAqC,KAAS,CAAA,CAAA,CAAA;AAiB7E,SAAS,aAAa,QAAsB,EAAA;AAC1C,EAAM,MAAA,SAAA,GAAkB,iBAAW,gBAAgB,CAAA,CAAA;AACnD,EAAA,OAAO,YAAY,SAAa,IAAA,KAAA,CAAA;AAClC;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,335 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import * as ReactDOM from 'react-dom';
|
|
4
|
-
import { c as composeRefs, u as useComposedRefs } from './index-b8f2908d.js';
|
|
5
|
-
|
|
6
|
-
// packages/react/context/src/create-context.tsx
|
|
7
|
-
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
8
|
-
let defaultContexts = [];
|
|
9
|
-
function createContext3(rootComponentName, defaultContext) {
|
|
10
|
-
const BaseContext = React.createContext(defaultContext);
|
|
11
|
-
const index = defaultContexts.length;
|
|
12
|
-
defaultContexts = [...defaultContexts, defaultContext];
|
|
13
|
-
const Provider = (props) => {
|
|
14
|
-
const { scope, children, ...context } = props;
|
|
15
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
16
|
-
const value = React.useMemo(() => context, Object.values(context));
|
|
17
|
-
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
18
|
-
};
|
|
19
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
20
|
-
function useContext2(consumerName, scope) {
|
|
21
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
22
|
-
const context = React.useContext(Context);
|
|
23
|
-
if (context) return context;
|
|
24
|
-
if (defaultContext !== void 0) return defaultContext;
|
|
25
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
26
|
-
}
|
|
27
|
-
return [Provider, useContext2];
|
|
28
|
-
}
|
|
29
|
-
const createScope = () => {
|
|
30
|
-
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
31
|
-
return React.createContext(defaultContext);
|
|
32
|
-
});
|
|
33
|
-
return function useScope(scope) {
|
|
34
|
-
const contexts = scope?.[scopeName] || scopeContexts;
|
|
35
|
-
return React.useMemo(
|
|
36
|
-
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
37
|
-
[scope, contexts]
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
createScope.scopeName = scopeName;
|
|
42
|
-
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
43
|
-
}
|
|
44
|
-
function composeContextScopes(...scopes) {
|
|
45
|
-
const baseScope = scopes[0];
|
|
46
|
-
if (scopes.length === 1) return baseScope;
|
|
47
|
-
const createScope = () => {
|
|
48
|
-
const scopeHooks = scopes.map((createScope2) => ({
|
|
49
|
-
useScope: createScope2(),
|
|
50
|
-
scopeName: createScope2.scopeName
|
|
51
|
-
}));
|
|
52
|
-
return function useComposedScopes(overrideScopes) {
|
|
53
|
-
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
54
|
-
const scopeProps = useScope(overrideScopes);
|
|
55
|
-
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
56
|
-
return { ...nextScopes2, ...currentScope };
|
|
57
|
-
}, {});
|
|
58
|
-
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
createScope.scopeName = baseScope.scopeName;
|
|
62
|
-
return createScope;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// src/slot.tsx
|
|
66
|
-
// @__NO_SIDE_EFFECTS__
|
|
67
|
-
function createSlot(ownerName) {
|
|
68
|
-
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
69
|
-
const Slot2 = React.forwardRef((props, forwardedRef) => {
|
|
70
|
-
const { children, ...slotProps } = props;
|
|
71
|
-
const childrenArray = React.Children.toArray(children);
|
|
72
|
-
const slottable = childrenArray.find(isSlottable);
|
|
73
|
-
if (slottable) {
|
|
74
|
-
const newElement = slottable.props.children;
|
|
75
|
-
const newChildren = childrenArray.map((child) => {
|
|
76
|
-
if (child === slottable) {
|
|
77
|
-
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
|
78
|
-
return React.isValidElement(newElement) ? newElement.props.children : null;
|
|
79
|
-
} else {
|
|
80
|
-
return child;
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
|
84
|
-
}
|
|
85
|
-
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
86
|
-
});
|
|
87
|
-
Slot2.displayName = `${ownerName}.Slot`;
|
|
88
|
-
return Slot2;
|
|
89
|
-
}
|
|
90
|
-
// @__NO_SIDE_EFFECTS__
|
|
91
|
-
function createSlotClone(ownerName) {
|
|
92
|
-
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
93
|
-
const { children, ...slotProps } = props;
|
|
94
|
-
if (React.isValidElement(children)) {
|
|
95
|
-
const childrenRef = getElementRef$1(children);
|
|
96
|
-
const props2 = mergeProps(slotProps, children.props);
|
|
97
|
-
if (children.type !== React.Fragment) {
|
|
98
|
-
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
99
|
-
}
|
|
100
|
-
return React.cloneElement(children, props2);
|
|
101
|
-
}
|
|
102
|
-
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
103
|
-
});
|
|
104
|
-
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
105
|
-
return SlotClone;
|
|
106
|
-
}
|
|
107
|
-
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
108
|
-
// @__NO_SIDE_EFFECTS__
|
|
109
|
-
function createSlottable(ownerName) {
|
|
110
|
-
const Slottable2 = ({ children }) => {
|
|
111
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
112
|
-
};
|
|
113
|
-
Slottable2.displayName = `${ownerName}.Slottable`;
|
|
114
|
-
Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
|
|
115
|
-
return Slottable2;
|
|
116
|
-
}
|
|
117
|
-
function isSlottable(child) {
|
|
118
|
-
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
119
|
-
}
|
|
120
|
-
function mergeProps(slotProps, childProps) {
|
|
121
|
-
const overrideProps = { ...childProps };
|
|
122
|
-
for (const propName in childProps) {
|
|
123
|
-
const slotPropValue = slotProps[propName];
|
|
124
|
-
const childPropValue = childProps[propName];
|
|
125
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
126
|
-
if (isHandler) {
|
|
127
|
-
if (slotPropValue && childPropValue) {
|
|
128
|
-
overrideProps[propName] = (...args) => {
|
|
129
|
-
const result = childPropValue(...args);
|
|
130
|
-
slotPropValue(...args);
|
|
131
|
-
return result;
|
|
132
|
-
};
|
|
133
|
-
} else if (slotPropValue) {
|
|
134
|
-
overrideProps[propName] = slotPropValue;
|
|
135
|
-
}
|
|
136
|
-
} else if (propName === "style") {
|
|
137
|
-
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
138
|
-
} else if (propName === "className") {
|
|
139
|
-
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return { ...slotProps, ...overrideProps };
|
|
143
|
-
}
|
|
144
|
-
function getElementRef$1(element) {
|
|
145
|
-
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
146
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
147
|
-
if (mayWarn) {
|
|
148
|
-
return element.ref;
|
|
149
|
-
}
|
|
150
|
-
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
151
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
152
|
-
if (mayWarn) {
|
|
153
|
-
return element.props.ref;
|
|
154
|
-
}
|
|
155
|
-
return element.props.ref || element.ref;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// src/primitive.tsx
|
|
159
|
-
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
160
|
-
return function handleEvent(event) {
|
|
161
|
-
originalEventHandler?.(event);
|
|
162
|
-
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
163
|
-
return ourEventHandler?.(event);
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// packages/react/use-layout-effect/src/use-layout-effect.tsx
|
|
169
|
-
var useLayoutEffect2 = globalThis?.document ? React.useLayoutEffect : () => {
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
// src/primitive.tsx
|
|
173
|
-
var NODES = [
|
|
174
|
-
"a",
|
|
175
|
-
"button",
|
|
176
|
-
"div",
|
|
177
|
-
"form",
|
|
178
|
-
"h2",
|
|
179
|
-
"h3",
|
|
180
|
-
"img",
|
|
181
|
-
"input",
|
|
182
|
-
"label",
|
|
183
|
-
"li",
|
|
184
|
-
"nav",
|
|
185
|
-
"ol",
|
|
186
|
-
"p",
|
|
187
|
-
"select",
|
|
188
|
-
"span",
|
|
189
|
-
"svg",
|
|
190
|
-
"ul"
|
|
191
|
-
];
|
|
192
|
-
var Primitive = NODES.reduce((primitive, node) => {
|
|
193
|
-
const Slot = createSlot(`Primitive.${node}`);
|
|
194
|
-
const Node = React.forwardRef((props, forwardedRef) => {
|
|
195
|
-
const { asChild, ...primitiveProps } = props;
|
|
196
|
-
const Comp = asChild ? Slot : node;
|
|
197
|
-
if (typeof window !== "undefined") {
|
|
198
|
-
window[Symbol.for("radix-ui")] = true;
|
|
199
|
-
}
|
|
200
|
-
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
201
|
-
});
|
|
202
|
-
Node.displayName = `Primitive.${node}`;
|
|
203
|
-
return { ...primitive, [node]: Node };
|
|
204
|
-
}, {});
|
|
205
|
-
function dispatchDiscreteCustomEvent(target, event) {
|
|
206
|
-
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
function useStateMachine(initialState, machine) {
|
|
210
|
-
return React.useReducer((state, event) => {
|
|
211
|
-
const nextState = machine[state][event];
|
|
212
|
-
return nextState ?? state;
|
|
213
|
-
}, initialState);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
// src/presence.tsx
|
|
217
|
-
var Presence = (props) => {
|
|
218
|
-
const { present, children } = props;
|
|
219
|
-
const presence = usePresence(present);
|
|
220
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React.Children.only(children);
|
|
221
|
-
const ref = useComposedRefs(presence.ref, getElementRef(child));
|
|
222
|
-
const forceMount = typeof children === "function";
|
|
223
|
-
return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;
|
|
224
|
-
};
|
|
225
|
-
Presence.displayName = "Presence";
|
|
226
|
-
function usePresence(present) {
|
|
227
|
-
const [node, setNode] = React.useState();
|
|
228
|
-
const stylesRef = React.useRef(null);
|
|
229
|
-
const prevPresentRef = React.useRef(present);
|
|
230
|
-
const prevAnimationNameRef = React.useRef("none");
|
|
231
|
-
const initialState = present ? "mounted" : "unmounted";
|
|
232
|
-
const [state, send] = useStateMachine(initialState, {
|
|
233
|
-
mounted: {
|
|
234
|
-
UNMOUNT: "unmounted",
|
|
235
|
-
ANIMATION_OUT: "unmountSuspended"
|
|
236
|
-
},
|
|
237
|
-
unmountSuspended: {
|
|
238
|
-
MOUNT: "mounted",
|
|
239
|
-
ANIMATION_END: "unmounted"
|
|
240
|
-
},
|
|
241
|
-
unmounted: {
|
|
242
|
-
MOUNT: "mounted"
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
React.useEffect(() => {
|
|
246
|
-
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
247
|
-
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
248
|
-
}, [state]);
|
|
249
|
-
useLayoutEffect2(() => {
|
|
250
|
-
const styles = stylesRef.current;
|
|
251
|
-
const wasPresent = prevPresentRef.current;
|
|
252
|
-
const hasPresentChanged = wasPresent !== present;
|
|
253
|
-
if (hasPresentChanged) {
|
|
254
|
-
const prevAnimationName = prevAnimationNameRef.current;
|
|
255
|
-
const currentAnimationName = getAnimationName(styles);
|
|
256
|
-
if (present) {
|
|
257
|
-
send("MOUNT");
|
|
258
|
-
} else if (currentAnimationName === "none" || styles?.display === "none") {
|
|
259
|
-
send("UNMOUNT");
|
|
260
|
-
} else {
|
|
261
|
-
const isAnimating = prevAnimationName !== currentAnimationName;
|
|
262
|
-
if (wasPresent && isAnimating) {
|
|
263
|
-
send("ANIMATION_OUT");
|
|
264
|
-
} else {
|
|
265
|
-
send("UNMOUNT");
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
prevPresentRef.current = present;
|
|
269
|
-
}
|
|
270
|
-
}, [present, send]);
|
|
271
|
-
useLayoutEffect2(() => {
|
|
272
|
-
if (node) {
|
|
273
|
-
let timeoutId;
|
|
274
|
-
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
275
|
-
const handleAnimationEnd = (event) => {
|
|
276
|
-
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
277
|
-
const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
|
|
278
|
-
if (event.target === node && isCurrentAnimation) {
|
|
279
|
-
send("ANIMATION_END");
|
|
280
|
-
if (!prevPresentRef.current) {
|
|
281
|
-
const currentFillMode = node.style.animationFillMode;
|
|
282
|
-
node.style.animationFillMode = "forwards";
|
|
283
|
-
timeoutId = ownerWindow.setTimeout(() => {
|
|
284
|
-
if (node.style.animationFillMode === "forwards") {
|
|
285
|
-
node.style.animationFillMode = currentFillMode;
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
const handleAnimationStart = (event) => {
|
|
292
|
-
if (event.target === node) {
|
|
293
|
-
prevAnimationNameRef.current = getAnimationName(stylesRef.current);
|
|
294
|
-
}
|
|
295
|
-
};
|
|
296
|
-
node.addEventListener("animationstart", handleAnimationStart);
|
|
297
|
-
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
298
|
-
node.addEventListener("animationend", handleAnimationEnd);
|
|
299
|
-
return () => {
|
|
300
|
-
ownerWindow.clearTimeout(timeoutId);
|
|
301
|
-
node.removeEventListener("animationstart", handleAnimationStart);
|
|
302
|
-
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
303
|
-
node.removeEventListener("animationend", handleAnimationEnd);
|
|
304
|
-
};
|
|
305
|
-
} else {
|
|
306
|
-
send("ANIMATION_END");
|
|
307
|
-
}
|
|
308
|
-
}, [node, send]);
|
|
309
|
-
return {
|
|
310
|
-
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
311
|
-
ref: React.useCallback((node2) => {
|
|
312
|
-
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
313
|
-
setNode(node2);
|
|
314
|
-
}, [])
|
|
315
|
-
};
|
|
316
|
-
}
|
|
317
|
-
function getAnimationName(styles) {
|
|
318
|
-
return styles?.animationName || "none";
|
|
319
|
-
}
|
|
320
|
-
function getElementRef(element) {
|
|
321
|
-
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
322
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
323
|
-
if (mayWarn) {
|
|
324
|
-
return element.ref;
|
|
325
|
-
}
|
|
326
|
-
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
327
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
328
|
-
if (mayWarn) {
|
|
329
|
-
return element.props.ref;
|
|
330
|
-
}
|
|
331
|
-
return element.props.ref || element.ref;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
export { Primitive as P, composeEventHandlers as a, Presence as b, createContextScope as c, dispatchDiscreteCustomEvent as d, createSlot as e, createSlottable as f, useLayoutEffect2 as u };
|
|
335
|
-
//# sourceMappingURL=index-b8a83ba5.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-b8a83ba5.js","sources":["../../../../../node_modules/@radix-ui/react-context/src/create-context.tsx","../../../../../node_modules/@radix-ui/react-slot/src/slot.tsx","../../../../../node_modules/@radix-ui/primitive/src/primitive.tsx","../../../../../node_modules/@radix-ui/react-use-layout-effect/src/use-layout-effect.tsx","../../../../../node_modules/@radix-ui/react-primitive/src/primitive.tsx","../../../../../node_modules/@radix-ui/react-presence/src/use-state-machine.tsx","../../../../../node_modules/@radix-ui/react-presence/src/presence.tsx"],"sourcesContent":["import * as React from 'react';\n\nfunction createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext?: ContextValueType\n) {\n const Context = React.createContext<ContextValueType | undefined>(defaultContext);\n\n const Provider: React.FC<ContextValueType & { children: React.ReactNode }> = (props) => {\n const { children, ...context } = props;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return <Context.Provider value={value}>{children}</Context.Provider>;\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * createContextScope\n * -----------------------------------------------------------------------------------------------*/\n\ntype Scope<C = any> = { [scopeName: string]: React.Context<C>[] } | undefined;\ntype ScopeHook = (scope: Scope) => { [__scopeProp: string]: Scope };\ninterface CreateScope {\n scopeName: string;\n (): ScopeHook;\n}\n\nfunction createContextScope(scopeName: string, createContextScopeDeps: CreateScope[] = []) {\n let defaultContexts: any[] = [];\n\n /* -----------------------------------------------------------------------------------------------\n * createContext\n * ---------------------------------------------------------------------------------------------*/\n\n function createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext?: ContextValueType\n ) {\n const BaseContext = React.createContext<ContextValueType | undefined>(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n\n const Provider: React.FC<\n ContextValueType & { scope: Scope<ContextValueType>; children: React.ReactNode }\n > = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return <Context.Provider value={value}>{children}</Context.Provider>;\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string, scope: Scope<ContextValueType | undefined>) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext] as const;\n }\n\n /* -----------------------------------------------------------------------------------------------\n * createScope\n * ---------------------------------------------------------------------------------------------*/\n\n const createScope: CreateScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope: Scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n\n createScope.scopeName = scopeName;\n return [createContext, composeContextScopes(createScope, ...createContextScopeDeps)] as const;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * composeContextScopes\n * -----------------------------------------------------------------------------------------------*/\n\nfunction composeContextScopes(...scopes: CreateScope[]) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n\n const createScope: CreateScope = () => {\n const scopeHooks = scopes.map((createScope) => ({\n useScope: createScope(),\n scopeName: createScope.scopeName,\n }));\n\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes, { useScope, scopeName }) => {\n // We are calling a hook inside a callback which React warns against to avoid inconsistent\n // renders, however, scoping doesn't have render side effects so we ignore the rule.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes, ...currentScope };\n }, {});\n\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nexport { createContext, createContextScope };\nexport type { CreateScope, Scope };\n","import * as React from 'react';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotProps extends React.HTMLAttributes<HTMLElement> {\n children?: React.ReactNode;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlot(ownerName: string) {\n const SlotClone = createSlotClone(ownerName);\n const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement)\n ? (newElement.props as { children: React.ReactNode }).children\n : null;\n } else {\n return child;\n }\n });\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {React.isValidElement(newElement)\n ? React.cloneElement(newElement, undefined, newChildren)\n : null}\n </SlotClone>\n );\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n );\n });\n\n Slot.displayName = `${ownerName}.Slot`;\n return Slot;\n}\n\nconst Slot = createSlot('Slot');\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ function createSlotClone(ownerName: string) {\n const SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props = mergeProps(slotProps, children.props as AnyProps);\n // do not pass ref to React.Fragment for React 19 compatibility\n if (children.type !== React.Fragment) {\n props.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props);\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nconst SLOTTABLE_IDENTIFIER = Symbol('radix.slottable');\n\ninterface SlottableProps {\n children: React.ReactNode;\n}\n\ninterface SlottableComponent extends React.FC<SlottableProps> {\n __radixId: symbol;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlottable(ownerName: string) {\n const Slottable: SlottableComponent = ({ children }) => {\n return <>{children}</>;\n };\n Slottable.displayName = `${ownerName}.Slottable`;\n Slottable.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable;\n}\n\nconst Slottable = createSlottable('Slottable');\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>;\n\nfunction isSlottable(\n child: React.ReactNode\n): child is React.ReactElement<SlottableProps, typeof Slottable> {\n return (\n React.isValidElement(child) &&\n typeof child.type === 'function' &&\n '__radixId' in child.type &&\n child.type.__radixId === SLOTTABLE_IDENTIFIER\n );\n}\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps) {\n // all child props should override\n const overrideProps = { ...childProps };\n\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args: unknown[]) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n }\n // but if it exists only on the slot, we use only this one\n else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n }\n // if it's `style`, we merge them\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\n return { ...slotProps, ...overrideProps };\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element.props as { ref?: React.Ref<unknown> }).ref;\n }\n\n // Not DEV\n return (element.props as { ref?: React.Ref<unknown> }).ref || (element as any).ref;\n}\n\nexport {\n Slot,\n Slottable,\n //\n Slot as Root,\n};\nexport type { SlotProps };\n","/* eslint-disable no-restricted-properties */\n\n/* eslint-disable no-restricted-globals */\nexport const canUseDOM = !!(\n typeof window !== 'undefined' &&\n window.document &&\n window.document.createElement\n);\n/* eslint-enable no-restricted-globals */\n\nexport function composeEventHandlers<E extends { defaultPrevented: boolean }>(\n originalEventHandler?: (event: E) => void,\n ourEventHandler?: (event: E) => void,\n { checkForDefaultPrevented = true } = {}\n) {\n return function handleEvent(event: E) {\n originalEventHandler?.(event);\n\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\n\nexport function getOwnerWindow(element: Node | null | undefined) {\n if (!canUseDOM) {\n throw new Error('Cannot access window outside of the DOM');\n }\n // eslint-disable-next-line no-restricted-globals\n return element?.ownerDocument?.defaultView ?? window;\n}\n\nexport function getOwnerDocument(element: Node | null | undefined) {\n if (!canUseDOM) {\n throw new Error('Cannot access document outside of the DOM');\n }\n // eslint-disable-next-line no-restricted-globals\n return element?.ownerDocument ?? document;\n}\n\n/**\n * Lifted from https://github.com/ariakit/ariakit/blob/main/packages/ariakit-core/src/utils/dom.ts#L37\n * MIT License, Copyright (c) AriaKit.\n */\nexport function getActiveElement(\n node: Node | null | undefined,\n activeDescendant = false\n): HTMLElement | null {\n const { activeElement } = getOwnerDocument(node);\n if (!activeElement?.nodeName) {\n // `activeElement` might be an empty object if we're interacting with elements\n // inside of an iframe.\n return null;\n }\n\n if (isFrame(activeElement) && activeElement.contentDocument) {\n return getActiveElement(activeElement.contentDocument.body, activeDescendant);\n }\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\n return activeElement as HTMLElement | null;\n}\n\nexport function isFrame(element: Element): element is HTMLIFrameElement {\n return element.tagName === 'IFRAME';\n}\n","import * as React from 'react';\n\n/**\n * On the server, React emits a warning when calling `useLayoutEffect`.\n * This is because neither `useLayoutEffect` nor `useEffect` run on the server.\n * We use this safe version which suppresses the warning by replacing it with a noop on the server.\n *\n * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nconst useLayoutEffect = globalThis?.document ? React.useLayoutEffect : () => {};\n\nexport { useLayoutEffect };\n","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { createSlot } from '@radix-ui/react-slot';\n\nconst 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] as const;\n\ntype Primitives = { [E in (typeof NODES)[number]]: PrimitiveForwardRefComponent<E> };\ntype PrimitivePropsWithRef<E extends React.ElementType> = React.ComponentPropsWithRef<E> & {\n asChild?: boolean;\n};\n\ninterface PrimitiveForwardRefComponent<E extends React.ElementType>\n extends React.ForwardRefExoticComponent<PrimitivePropsWithRef<E>> {}\n\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/\n\nconst Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props: PrimitivePropsWithRef<typeof node>, forwardedRef: any) => {\n const { asChild, ...primitiveProps } = props;\n const Comp: any = asChild ? Slot : node;\n\n if (typeof window !== 'undefined') {\n (window as any)[Symbol.for('radix-ui')] = true;\n }\n\n return <Comp {...primitiveProps} ref={forwardedRef} />;\n });\n\n Node.displayName = `Primitive.${node}`;\n\n return { ...primitive, [node]: Node };\n}, {} as Primitives);\n\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/\n\n/**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not necessary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click 👎\n * target.dispatchEvent(new Event(‘click’))\n *\n * dispatching a custom type within a non-discrete event 👎\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}\n *\n * dispatching a custom type within a `discrete` event 👍\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */\n\nfunction dispatchDiscreteCustomEvent<E extends CustomEvent>(target: E['target'], event: E) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nconst Root = Primitive;\n\nexport {\n Primitive,\n //\n Root,\n //\n dispatchDiscreteCustomEvent,\n};\nexport type { PrimitivePropsWithRef };\n","import * as React from 'react';\n\ntype Machine<S> = { [k: string]: { [k: string]: S } };\ntype MachineState<T> = keyof T;\ntype MachineEvent<T> = keyof UnionToIntersection<T[keyof T]>;\n\n// 🤯 https://fettblog.eu/typescript-union-to-intersection/\ntype UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any\n ? R\n : never;\n\nexport function useStateMachine<M>(\n initialState: MachineState<M>,\n machine: M & Machine<MachineState<M>>\n) {\n return React.useReducer((state: MachineState<M>, event: MachineEvent<M>): MachineState<M> => {\n const nextState = (machine[state] as any)[event];\n return nextState ?? state;\n }, initialState);\n}\n","import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useStateMachine } from './use-state-machine';\n\ninterface PresenceProps {\n children: React.ReactElement | ((props: { present: boolean }) => React.ReactElement);\n present: boolean;\n}\n\nconst Presence: React.FC<PresenceProps> = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n\n const child = (\n typeof children === 'function'\n ? children({ present: presence.isPresent })\n : React.Children.only(children)\n ) as React.ReactElement<{ ref?: React.Ref<HTMLElement> }>;\n\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === 'function';\n return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;\n};\n\nPresence.displayName = 'Presence';\n\n/* -------------------------------------------------------------------------------------------------\n * usePresence\n * -----------------------------------------------------------------------------------------------*/\n\nfunction usePresence(present: boolean) {\n const [node, setNode] = React.useState<HTMLElement>();\n const stylesRef = React.useRef<CSSStyleDeclaration | null>(null);\n const prevPresentRef = React.useRef(present);\n const prevAnimationNameRef = React.useRef<string>('none');\n const initialState = present ? 'mounted' : 'unmounted';\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: 'unmounted',\n ANIMATION_OUT: 'unmountSuspended',\n },\n unmountSuspended: {\n MOUNT: 'mounted',\n ANIMATION_END: 'unmounted',\n },\n unmounted: {\n MOUNT: 'mounted',\n },\n });\n\n React.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';\n }, [state]);\n\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n\n if (present) {\n send('MOUNT');\n } else if (currentAnimationName === 'none' || styles?.display === 'none') {\n // If there is no exit animation or the element is hidden, animations won't run\n // so we unmount instantly\n send('UNMOUNT');\n } else {\n /**\n * When `present` changes to `false`, we check changes to animation-name to\n * determine whether an animation has started. We chose this approach (reading\n * computed styles) because there is no `animationrun` event and `animationstart`\n * fires after `animation-delay` has expired which would be too late.\n */\n const isAnimating = prevAnimationName !== currentAnimationName;\n\n if (wasPresent && isAnimating) {\n send('ANIMATION_OUT');\n } else {\n send('UNMOUNT');\n }\n }\n\n prevPresentRef.current = present;\n }\n }, [present, send]);\n\n useLayoutEffect(() => {\n if (node) {\n let timeoutId: number;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n /**\n * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`\n * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we\n * make sure we only trigger ANIMATION_END for the currently active animation.\n */\n const handleAnimationEnd = (event: AnimationEvent) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n // The event.animationName is unescaped for CSS syntax,\n // so we need to escape it to compare with the animationName computed from the style.\n const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));\n if (event.target === node && isCurrentAnimation) {\n // With React 18 concurrency this update is applied a frame after the\n // animation ends, creating a flash of visible content. By setting the\n // animation fill mode to \"forwards\", we force the node to keep the\n // styles of the last keyframe, removing the flash.\n //\n // Previously we flushed the update via ReactDom.flushSync, but with\n // exit animations this resulted in the node being removed from the\n // DOM before the synthetic animationEnd event was dispatched, meaning\n // user-provided event handlers would not be called.\n // https://github.com/radix-ui/primitives/pull/1849\n send('ANIMATION_END');\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = 'forwards';\n // Reset the style after the node had time to unmount (for cases\n // where the component chooses not to unmount). Doing this any\n // sooner than `setTimeout` (e.g. with `requestAnimationFrame`)\n // still causes a flash.\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === 'forwards') {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event: AnimationEvent) => {\n if (event.target === node) {\n // if animation occurred, store its name as the previous animation.\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener('animationstart', handleAnimationStart);\n node.addEventListener('animationcancel', handleAnimationEnd);\n node.addEventListener('animationend', handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener('animationstart', handleAnimationStart);\n node.removeEventListener('animationcancel', handleAnimationEnd);\n node.removeEventListener('animationend', handleAnimationEnd);\n };\n } else {\n // Transition to the unmounted state if the node is removed prematurely.\n // We avoid doing so during cleanup as the node may change but still exist.\n send('ANIMATION_END');\n }\n }, [node, send]);\n\n return {\n isPresent: ['mounted', 'unmountSuspended'].includes(state),\n ref: React.useCallback((node: HTMLElement) => {\n stylesRef.current = node ? getComputedStyle(node) : null;\n setNode(node);\n }, []),\n };\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getAnimationName(styles: CSSStyleDeclaration | null) {\n return styles?.animationName || 'none';\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement<{ ref?: React.Ref<unknown> }>) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\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\n // Not DEV\n return element.props.ref || (element as any).ref;\n}\n\nconst Root = Presence;\n\nexport {\n Presence,\n //\n Root,\n};\nexport type { PresenceProps };\n"],"names":["createContext","useContext","createScope","nextScopes","Slot","getElementRef","props","Slottable","Fragment","useLayoutEffect","React2","node"],"mappings":";;;;;;AAwCA,SAAS,kBAAmB,CAAA,SAAA,EAAmB,sBAAwC,GAAA,EAAI,EAAA;AACzF,EAAA,IAAI,kBAAyB,EAAC,CAAA;AAM9B,EAASA,SAAAA,cAAAA,CACP,mBACA,cACA,EAAA;AACA,IAAM,MAAA,WAAA,GAAoB,oBAA4C,cAAc,CAAA,CAAA;AACpF,IAAA,MAAM,QAAQ,eAAgB,CAAA,MAAA,CAAA;AAC9B,IAAkB,eAAA,GAAA,CAAC,GAAG,eAAA,EAAiB,cAAc,CAAA,CAAA;AAErD,IAAM,MAAA,QAAA,GAEF,CAAC,KAAU,KAAA;AACb,MAAA,MAAM,EAAE,KAAA,EAAO,QAAU,EAAA,GAAG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,KAAM,CAAA,GAAA,CAAA;AAAA,GACvB;AAGA,EAAO,OAAA,OAAA,CAAQ,KAAM,CAAA,GAAA,IAAQ,OAAgB,CAAA,GAAA,CAAA;AAC/C;;;;","x_google_ignoreList":[0,1,2,3,4,5,6]}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
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;
|
|
9
|
-
}
|
|
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;
|
|
20
|
-
});
|
|
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
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
function useComposedRefs(...refs) {
|
|
36
|
-
return React.useCallback(composeRefs(...refs), refs);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export { composeRefs as c, useComposedRefs as u };
|
|
40
|
-
//# sourceMappingURL=index-b8f2908d.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-b8f2908d.js","sources":["../../../../../node_modules/@radix-ui/react-compose-refs/src/compose-refs.tsx"],"sourcesContent":["import * as React from 'react';\n\ntype PossibleRef<T> = React.Ref<T> | undefined;\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */\nfunction setRef<T>(ref: PossibleRef<T>, value: T) {\n if (typeof ref === 'function') {\n return ref(value);\n } else if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n}\n\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */\nfunction composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\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\n // React <19 will log an error to the console if a callback ref returns a\n // value. We don't use ref cleanups internally so this will only happen if a\n // user's ref callback returns a value, which we only expect if they are\n // using the cleanup functionality added in React 19.\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}\n\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */\nfunction useComposedRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return React.useCallback(composeRefs(...refs), refs);\n}\n\nexport { composeRefs, useComposedRefs };\n"],"names":[],"mappings":";;;AAQA,SAAS,MAAA,CAAU,KAAqB,KAAU,EAAA;AAChD,EAAI,IAAA,OAAO,QAAQ,UAAY,EAAA;AAC7B,IAAA,OAAO,IAAI,KAAK,CAAA,CAAA;AAAA,GACP,MAAA,IAAA,GAAA,KAAQ,IAAQ,IAAA,GAAA,KAAQ,KAAW,CAAA,EAAA;AAC5C,IAAA,GAAA,CAAI,OAAU,GAAA,KAAA,CAAA;AAAA,GAChB;AACF,CAAA;AAMA,SAAS,eAAkB,IAA8C,EAAA;AACvE,EAAA,OAAO,CAAC,IAAS,KAAA;AACf,IAAA,IAAI,UAAa,GAAA,KAAA,CAAA;AACjB,IAAA,MAAM,QAAW,GAAA,IAAA,CAAK,GAAI,CAAA,CAAC,GAAQ,KAAA;AACjC,MAAM,MAAA,OAAA,GAAU,MAAO,CAAA,GAAA,EAAK,IAAI,CAAA,CAAA;AAChC,MAAA,IAAI,CAAC,UAAA,IAAc,OAAO,OAAA,IAAW,UAAY,EAAA;AAC/C,QAAa,UAAA,GAAA,IAAA,CAAA;AAAA,OACf;AACA,MAAO,OAAA,OAAA,CAAA;AAAA,KACR,CAAA,CAAA;AAMD,IAAA,IAAI,UAAY,EAAA;AACd,MAAA,OAAO,MAAM;AACX,QAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,QAAA,CAAS,QAAQ,CAAK,EAAA,EAAA;AACxC,UAAM,MAAA,OAAA,GAAU,SAAS,CAAC,CAAA,CAAA;AAC1B,UAAI,IAAA,OAAO,WAAW,UAAY,EAAA;AAChC,YAAQ,OAAA,EAAA,CAAA;AAAA,WACH,MAAA;AACL,YAAO,MAAA,CAAA,IAAA,CAAK,CAAC,CAAA,EAAG,IAAI,CAAA,CAAA;AAAA,WACtB;AAAA,SACF;AAAA,OACF,CAAA;AAAA,KACF;AAAA,GACF,CAAA;AACF,CAAA;AAMA,SAAS,mBAAsB,IAA8C,EAAA;AAE3E,EAAA,OAAa,KAAY,CAAA,WAAA,CAAA,WAAA,CAAY,GAAG,IAAI,GAAG,IAAI,CAAA,CAAA;AACrD;;;;","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-c655a86f.js","sources":["../../../../../node_modules/@radix-ui/number/src/number.ts"],"sourcesContent":["function clamp(value: number, [min, max]: [number, number]): number {\n return Math.min(max, Math.max(min, value));\n}\n\nexport { clamp };\n"],"names":[],"mappings":";AAAA,SAAS,KAAM,CAAA,KAAA,EAAe,CAAC,GAAA,EAAK,GAAG,CAA6B,EAAA;AAClE,EAAA,OAAO,KAAK,GAAI,CAAA,GAAA,EAAK,KAAK,GAAI,CAAA,GAAA,EAAK,KAAK,CAAC,CAAA,CAAA;AAC3C;;;;","x_google_ignoreList":[0]}
|