@vritti/quantum-ui 0.2.8 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/Alert.js +115 -0
- package/dist/Alert.js.map +1 -0
- package/dist/Avatar.js +6 -6
- package/dist/Badge.js +2 -28
- package/dist/Badge.js.map +1 -1
- package/dist/Badge2.js +30 -0
- package/dist/Badge2.js.map +1 -0
- package/dist/Button.js +1 -1
- package/dist/Button2.js +35 -16
- package/dist/Button2.js.map +1 -1
- package/dist/Card.js +1 -1
- package/dist/Chart.js +2 -2
- package/dist/Checkbox.js +2 -289
- package/dist/Checkbox.js.map +1 -1
- package/dist/Checkbox2.js +292 -0
- package/dist/Checkbox2.js.map +1 -0
- package/dist/Combination.js +6 -18
- package/dist/Combination.js.map +1 -1
- package/dist/DatePicker.js +4 -335
- package/dist/DatePicker.js.map +1 -1
- package/dist/DropdownMenu.js +8 -7
- package/dist/DropdownMenu.js.map +1 -1
- package/dist/Form.js +52 -27
- package/dist/Form.js.map +1 -1
- package/dist/Label.js +2 -2
- package/dist/OTPField.js +1 -1
- package/dist/PasswordField.js +1 -1
- package/dist/PhoneField.js +6 -6
- package/dist/PhoneField.js.map +1 -1
- package/dist/Progress.js +3 -3
- package/dist/Skeleton.js +1 -1
- package/dist/Sonner.js +7 -39
- package/dist/Sonner.js.map +1 -1
- package/dist/Spinner.js +1 -1
- package/dist/Switch.js +5 -5
- package/dist/TextArea.js +1 -1
- package/dist/TextField.js +4 -3
- package/dist/TextField.js.map +1 -1
- package/dist/ThemeContext.js +2 -8
- package/dist/ThemeContext.js.map +1 -1
- package/dist/Toggle.js +3 -3
- package/dist/Typography.js +1 -1
- package/dist/assets/quantum-ui.css +31 -31
- package/dist/chevron-left.js +15 -0
- package/dist/chevron-left.js.map +1 -0
- package/dist/chevron-right.js +15 -0
- package/dist/chevron-right.js.map +1 -0
- package/dist/components/Alert.js +2 -0
- package/dist/components/Alert.js.map +1 -0
- package/dist/components/Badge.js +2 -1
- package/dist/components/Badge.js.map +1 -1
- package/dist/components/DataTable.js +2 -0
- package/dist/components/DataTable.js.map +1 -0
- package/dist/components/Select.js +1379 -0
- package/dist/components/Select.js.map +1 -0
- package/dist/field.js +2 -2
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/index10.js +10 -99
- package/dist/index10.js.map +1 -1
- package/dist/index11.js +35 -95
- package/dist/index11.js.map +1 -1
- package/dist/index12.js +86 -190
- package/dist/index12.js.map +1 -1
- package/dist/index13.js +196 -190
- package/dist/index13.js.map +1 -1
- package/dist/index14.js +199 -0
- package/dist/index14.js.map +1 -0
- package/dist/index2.js +65 -58
- package/dist/index2.js.map +1 -1
- package/dist/index3.js +60 -8
- package/dist/index3.js.map +1 -1
- package/dist/index4.js +80 -106
- package/dist/index4.js.map +1 -1
- package/dist/index5.js +42 -37
- package/dist/index5.js.map +1 -1
- package/dist/index6.js +9 -4
- package/dist/index6.js.map +1 -1
- package/dist/index7.js +125 -10
- package/dist/index7.js.map +1 -1
- package/dist/index8.js +37 -42
- package/dist/index8.js.map +1 -1
- package/dist/index9.js +4 -37
- package/dist/index9.js.map +1 -1
- package/dist/lib/components/Alert/Alert.d.ts +11 -0
- package/dist/lib/components/Alert/Alert.d.ts.map +1 -0
- package/dist/lib/components/Alert/index.d.ts +2 -0
- package/dist/lib/components/Alert/index.d.ts.map +1 -0
- package/dist/lib/components/DataTable/DataTable.d.ts +15 -0
- package/dist/lib/components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTableColumnHeader.d.ts +12 -0
- package/dist/lib/components/DataTable/components/DataTableColumnHeader.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTableEmpty.d.ts +13 -0
- package/dist/lib/components/DataTable/components/DataTableEmpty.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTablePagination.d.ts +13 -0
- package/dist/lib/components/DataTable/components/DataTablePagination.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTableToolbar.d.ts +15 -0
- package/dist/lib/components/DataTable/components/DataTableToolbar.d.ts.map +1 -0
- package/dist/lib/components/DataTable/components/DataTableViewOptions.d.ts +11 -0
- package/dist/lib/components/DataTable/components/DataTableViewOptions.d.ts.map +1 -0
- package/dist/lib/components/DataTable/hooks/useDataTable.d.ts +3 -0
- package/dist/lib/components/DataTable/hooks/useDataTable.d.ts.map +1 -0
- package/dist/lib/components/DataTable/index.d.ts +10 -0
- package/dist/lib/components/DataTable/index.d.ts.map +1 -0
- package/dist/lib/components/DataTable/types.d.ts +67 -0
- package/dist/lib/components/DataTable/types.d.ts.map +1 -0
- package/dist/lib/components/DataTable/utils.d.ts +3 -0
- package/dist/lib/components/DataTable/utils.d.ts.map +1 -0
- package/dist/lib/components/Form/Form.d.ts +3 -2
- package/dist/lib/components/Form/Form.d.ts.map +1 -1
- package/dist/lib/components/PhoneField/PhoneField.d.ts +1 -0
- package/dist/lib/components/PhoneField/PhoneField.d.ts.map +1 -1
- package/dist/lib/components/Select/Select.d.ts +23 -0
- package/dist/lib/components/Select/Select.d.ts.map +1 -0
- package/dist/lib/components/Select/components/MultiSelect/MultiSelect.d.ts +25 -0
- package/dist/lib/components/Select/components/MultiSelect/MultiSelect.d.ts.map +1 -0
- package/dist/lib/components/Select/components/MultiSelect/MultiSelectFilter.d.ts +21 -0
- package/dist/lib/components/Select/components/MultiSelect/MultiSelectFilter.d.ts.map +1 -0
- package/dist/lib/components/Select/components/SingleSelect/SingleSelect.d.ts +25 -0
- package/dist/lib/components/Select/components/SingleSelect/SingleSelect.d.ts.map +1 -0
- package/dist/lib/components/Select/components/SingleSelect/SingleSelectFilter.d.ts +21 -0
- package/dist/lib/components/Select/components/SingleSelect/SingleSelectFilter.d.ts.map +1 -0
- package/dist/lib/components/Select/hooks/useMultiSelect.d.ts +32 -0
- package/dist/lib/components/Select/hooks/useMultiSelect.d.ts.map +1 -0
- package/dist/lib/components/Select/hooks/useSelect.d.ts +23 -0
- package/dist/lib/components/Select/hooks/useSelect.d.ts.map +1 -0
- package/dist/lib/components/Select/hooks/useSingleSelect.d.ts +30 -0
- package/dist/lib/components/Select/hooks/useSingleSelect.d.ts.map +1 -0
- package/dist/lib/components/Select/index.d.ts +38 -0
- package/dist/lib/components/Select/index.d.ts.map +1 -0
- package/dist/lib/components/Select/types.d.ts +31 -0
- package/dist/lib/components/Select/types.d.ts.map +1 -0
- package/dist/lib/components/TextField/TextField.d.ts.map +1 -1
- package/dist/lib/components/index.d.ts +3 -0
- package/dist/lib/components/index.d.ts.map +1 -1
- package/dist/lib/context/ThemeContext.d.ts +1 -1
- package/dist/lib/context/ThemeContext.d.ts.map +1 -1
- package/dist/lib/context/index.d.ts +1 -1
- package/dist/lib/context/index.d.ts.map +1 -1
- package/dist/lib/hooks/index.d.ts +2 -1
- package/dist/lib/hooks/index.d.ts.map +1 -1
- package/dist/lib/hooks/useSSE.d.ts +21 -0
- package/dist/lib/hooks/useSSE.d.ts.map +1 -0
- package/dist/lib/index.d.ts +2 -2
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/utils/axios.d.ts.map +1 -1
- package/dist/lib/utils/formHelpers.d.ts +7 -3
- package/dist/lib/utils/formHelpers.d.ts.map +1 -1
- package/dist/popover.js +329 -0
- package/dist/popover.js.map +1 -0
- package/dist/separator2.js +2 -2
- package/dist/shadcn/shadcnAlert/alert.d.ts +11 -0
- package/dist/shadcn/shadcnAlert/alert.d.ts.map +1 -0
- package/dist/shadcn/shadcnAlert/index.d.ts +2 -0
- package/dist/shadcn/shadcnAlert/index.d.ts.map +1 -0
- package/dist/shadcn/shadcnBadge/Badge.d.ts +1 -1
- package/dist/shadcn/shadcnButton/Button.d.ts +2 -2
- package/dist/shadcn/shadcnButton/Button.d.ts.map +1 -1
- package/dist/shadcn/shadcnInputOTP/InputOTP.d.ts +2 -2
- package/dist/shadcn/shadcnMultiSelect/index.d.ts +3 -0
- package/dist/shadcn/shadcnMultiSelect/index.d.ts.map +1 -0
- package/dist/shadcn/shadcnMultiSelect/multi-select.d.ts +61 -0
- package/dist/shadcn/shadcnMultiSelect/multi-select.d.ts.map +1 -0
- package/dist/shadcn/shadcnSingleSelect/index.d.ts +3 -0
- package/dist/shadcn/shadcnSingleSelect/index.d.ts.map +1 -0
- package/dist/shadcn/shadcnSingleSelect/single-select.d.ts +60 -0
- package/dist/shadcn/shadcnSingleSelect/single-select.d.ts.map +1 -0
- package/dist/shadcn/shadcnSonner/sonner.d.ts +1 -1
- package/dist/shadcn/shadcnSonner/sonner.d.ts.map +1 -1
- package/dist/triangle-alert.js +40 -0
- package/dist/triangle-alert.js.map +1 -0
- package/dist/useSSE.js +82 -0
- package/dist/useSSE.js.map +1 -0
- package/dist/useTheme.js.map +1 -1
- package/dist/utils/axios.js +4167 -2
- package/dist/utils/axios.js.map +1 -1
- package/dist/utils.js +3748 -2970
- package/dist/utils.js.map +1 -1
- package/dist/utils2.js +3042 -0
- package/dist/utils2.js.map +1 -0
- package/dist/x.js +18 -0
- package/dist/x.js.map +1 -0
- package/package.json +22 -7
- package/dist/axios.js +0 -4228
- package/dist/axios.js.map +0 -1
package/dist/index13.js
CHANGED
|
@@ -1,199 +1,205 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { u as useLayoutEffect2 } from './index9.js';
|
|
3
|
+
import * as ReactDOM from 'react-dom';
|
|
4
|
+
import { c as composeRefs } from './index8.js';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
6
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
12
|
-
*
|
|
13
|
-
* This source code is licensed under the MIT license found in the
|
|
14
|
-
* LICENSE file in the root directory of this source tree.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
var hasRequiredUseSyncExternalStoreShim_production;
|
|
18
|
-
|
|
19
|
-
function requireUseSyncExternalStoreShim_production () {
|
|
20
|
-
if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
|
|
21
|
-
hasRequiredUseSyncExternalStoreShim_production = 1;
|
|
22
|
-
var React = React__default;
|
|
23
|
-
function is(x, y) {
|
|
24
|
-
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
25
|
-
}
|
|
26
|
-
var objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
27
|
-
useState = React.useState,
|
|
28
|
-
useEffect = React.useEffect,
|
|
29
|
-
useLayoutEffect = React.useLayoutEffect,
|
|
30
|
-
useDebugValue = React.useDebugValue;
|
|
31
|
-
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
32
|
-
var value = getSnapshot(),
|
|
33
|
-
_useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),
|
|
34
|
-
inst = _useState[0].inst,
|
|
35
|
-
forceUpdate = _useState[1];
|
|
36
|
-
useLayoutEffect(
|
|
37
|
-
function () {
|
|
38
|
-
inst.value = value;
|
|
39
|
-
inst.getSnapshot = getSnapshot;
|
|
40
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
41
|
-
},
|
|
42
|
-
[subscribe, value, getSnapshot]
|
|
43
|
-
);
|
|
44
|
-
useEffect(
|
|
45
|
-
function () {
|
|
46
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
47
|
-
return subscribe(function () {
|
|
48
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
49
|
-
});
|
|
50
|
-
},
|
|
51
|
-
[subscribe]
|
|
52
|
-
);
|
|
53
|
-
useDebugValue(value);
|
|
54
|
-
return value;
|
|
55
|
-
}
|
|
56
|
-
function checkIfSnapshotChanged(inst) {
|
|
57
|
-
var latestGetSnapshot = inst.getSnapshot;
|
|
58
|
-
inst = inst.value;
|
|
59
|
-
try {
|
|
60
|
-
var nextValue = latestGetSnapshot();
|
|
61
|
-
return !objectIs(inst, nextValue);
|
|
62
|
-
} catch (error) {
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
67
|
-
return getSnapshot();
|
|
68
|
-
}
|
|
69
|
-
var shim =
|
|
70
|
-
"undefined" === typeof window ||
|
|
71
|
-
"undefined" === typeof window.document ||
|
|
72
|
-
"undefined" === typeof window.document.createElement
|
|
73
|
-
? useSyncExternalStore$1
|
|
74
|
-
: useSyncExternalStore$2;
|
|
75
|
-
useSyncExternalStoreShim_production.useSyncExternalStore =
|
|
76
|
-
void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
|
|
77
|
-
return useSyncExternalStoreShim_production;
|
|
7
|
+
// src/primitive.tsx
|
|
8
|
+
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
9
|
+
return function handleEvent(event) {
|
|
10
|
+
originalEventHandler?.(event);
|
|
11
|
+
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
12
|
+
return ourEventHandler?.(event);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
78
15
|
}
|
|
79
16
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
var latestGetSnapshot = inst.getSnapshot;
|
|
145
|
-
inst = inst.value;
|
|
146
|
-
try {
|
|
147
|
-
var nextValue = latestGetSnapshot();
|
|
148
|
-
return !objectIs(inst, nextValue);
|
|
149
|
-
} catch (error) {
|
|
150
|
-
return true;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
154
|
-
return getSnapshot();
|
|
155
|
-
}
|
|
156
|
-
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
157
|
-
"function" ===
|
|
158
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
|
|
159
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
160
|
-
var React = React__default,
|
|
161
|
-
objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
162
|
-
useState = React.useState,
|
|
163
|
-
useEffect = React.useEffect,
|
|
164
|
-
useLayoutEffect = React.useLayoutEffect,
|
|
165
|
-
useDebugValue = React.useDebugValue,
|
|
166
|
-
didWarnOld18Alpha = false,
|
|
167
|
-
didWarnUncachedGetSnapshot = false,
|
|
168
|
-
shim =
|
|
169
|
-
"undefined" === typeof window ||
|
|
170
|
-
"undefined" === typeof window.document ||
|
|
171
|
-
"undefined" === typeof window.document.createElement
|
|
172
|
-
? useSyncExternalStore$1
|
|
173
|
-
: useSyncExternalStore$2;
|
|
174
|
-
useSyncExternalStoreShim_development.useSyncExternalStore =
|
|
175
|
-
void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
|
|
176
|
-
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
177
|
-
"function" ===
|
|
178
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
|
179
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
180
|
-
})();
|
|
181
|
-
return useSyncExternalStoreShim_development;
|
|
17
|
+
// src/use-controllable-state.tsx
|
|
18
|
+
var useInsertionEffect = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
19
|
+
function useControllableState({
|
|
20
|
+
prop,
|
|
21
|
+
defaultProp,
|
|
22
|
+
onChange = () => {
|
|
23
|
+
},
|
|
24
|
+
caller
|
|
25
|
+
}) {
|
|
26
|
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
27
|
+
defaultProp,
|
|
28
|
+
onChange
|
|
29
|
+
});
|
|
30
|
+
const isControlled = prop !== void 0;
|
|
31
|
+
const value = isControlled ? prop : uncontrolledProp;
|
|
32
|
+
{
|
|
33
|
+
const isControlledRef = React.useRef(prop !== void 0);
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
const wasControlled = isControlledRef.current;
|
|
36
|
+
if (wasControlled !== isControlled) {
|
|
37
|
+
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
38
|
+
const to = isControlled ? "controlled" : "uncontrolled";
|
|
39
|
+
console.warn(
|
|
40
|
+
`${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
isControlledRef.current = isControlled;
|
|
44
|
+
}, [isControlled, caller]);
|
|
45
|
+
}
|
|
46
|
+
const setValue = React.useCallback(
|
|
47
|
+
(nextValue) => {
|
|
48
|
+
if (isControlled) {
|
|
49
|
+
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
50
|
+
if (value2 !== prop) {
|
|
51
|
+
onChangeRef.current?.(value2);
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
setUncontrolledProp(nextValue);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
|
58
|
+
);
|
|
59
|
+
return [value, setValue];
|
|
60
|
+
}
|
|
61
|
+
function useUncontrolledState({
|
|
62
|
+
defaultProp,
|
|
63
|
+
onChange
|
|
64
|
+
}) {
|
|
65
|
+
const [value, setValue] = React.useState(defaultProp);
|
|
66
|
+
const prevValueRef = React.useRef(value);
|
|
67
|
+
const onChangeRef = React.useRef(onChange);
|
|
68
|
+
useInsertionEffect(() => {
|
|
69
|
+
onChangeRef.current = onChange;
|
|
70
|
+
}, [onChange]);
|
|
71
|
+
React.useEffect(() => {
|
|
72
|
+
if (prevValueRef.current !== value) {
|
|
73
|
+
onChangeRef.current?.(value);
|
|
74
|
+
prevValueRef.current = value;
|
|
75
|
+
}
|
|
76
|
+
}, [value, prevValueRef]);
|
|
77
|
+
return [value, setValue, onChangeRef];
|
|
78
|
+
}
|
|
79
|
+
function isFunction(value) {
|
|
80
|
+
return typeof value === "function";
|
|
182
81
|
}
|
|
183
82
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
function
|
|
187
|
-
|
|
188
|
-
|
|
83
|
+
// src/slot.tsx
|
|
84
|
+
// @__NO_SIDE_EFFECTS__
|
|
85
|
+
function createSlot(ownerName) {
|
|
86
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
87
|
+
const Slot2 = React.forwardRef((props, forwardedRef) => {
|
|
88
|
+
const { children, ...slotProps } = props;
|
|
89
|
+
const childrenArray = React.Children.toArray(children);
|
|
90
|
+
const slottable = childrenArray.find(isSlottable);
|
|
91
|
+
if (slottable) {
|
|
92
|
+
const newElement = slottable.props.children;
|
|
93
|
+
const newChildren = childrenArray.map((child) => {
|
|
94
|
+
if (child === slottable) {
|
|
95
|
+
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
|
96
|
+
return React.isValidElement(newElement) ? newElement.props.children : null;
|
|
97
|
+
} else {
|
|
98
|
+
return child;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
|
102
|
+
}
|
|
103
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
104
|
+
});
|
|
105
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
106
|
+
return Slot2;
|
|
107
|
+
}
|
|
108
|
+
// @__NO_SIDE_EFFECTS__
|
|
109
|
+
function createSlotClone(ownerName) {
|
|
110
|
+
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
111
|
+
const { children, ...slotProps } = props;
|
|
112
|
+
if (React.isValidElement(children)) {
|
|
113
|
+
const childrenRef = getElementRef(children);
|
|
114
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
115
|
+
if (children.type !== React.Fragment) {
|
|
116
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
117
|
+
}
|
|
118
|
+
return React.cloneElement(children, props2);
|
|
119
|
+
}
|
|
120
|
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
121
|
+
});
|
|
122
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
123
|
+
return SlotClone;
|
|
124
|
+
}
|
|
125
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
126
|
+
function isSlottable(child) {
|
|
127
|
+
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
128
|
+
}
|
|
129
|
+
function mergeProps(slotProps, childProps) {
|
|
130
|
+
const overrideProps = { ...childProps };
|
|
131
|
+
for (const propName in childProps) {
|
|
132
|
+
const slotPropValue = slotProps[propName];
|
|
133
|
+
const childPropValue = childProps[propName];
|
|
134
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
135
|
+
if (isHandler) {
|
|
136
|
+
if (slotPropValue && childPropValue) {
|
|
137
|
+
overrideProps[propName] = (...args) => {
|
|
138
|
+
const result = childPropValue(...args);
|
|
139
|
+
slotPropValue(...args);
|
|
140
|
+
return result;
|
|
141
|
+
};
|
|
142
|
+
} else if (slotPropValue) {
|
|
143
|
+
overrideProps[propName] = slotPropValue;
|
|
144
|
+
}
|
|
145
|
+
} else if (propName === "style") {
|
|
146
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
147
|
+
} else if (propName === "className") {
|
|
148
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return { ...slotProps, ...overrideProps };
|
|
152
|
+
}
|
|
153
|
+
function getElementRef(element) {
|
|
154
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
155
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
156
|
+
if (mayWarn) {
|
|
157
|
+
return element.ref;
|
|
158
|
+
}
|
|
159
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
160
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
161
|
+
if (mayWarn) {
|
|
162
|
+
return element.props.ref;
|
|
163
|
+
}
|
|
164
|
+
return element.props.ref || element.ref;
|
|
165
|
+
}
|
|
189
166
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
167
|
+
// src/primitive.tsx
|
|
168
|
+
var NODES = [
|
|
169
|
+
"a",
|
|
170
|
+
"button",
|
|
171
|
+
"div",
|
|
172
|
+
"form",
|
|
173
|
+
"h2",
|
|
174
|
+
"h3",
|
|
175
|
+
"img",
|
|
176
|
+
"input",
|
|
177
|
+
"label",
|
|
178
|
+
"li",
|
|
179
|
+
"nav",
|
|
180
|
+
"ol",
|
|
181
|
+
"p",
|
|
182
|
+
"select",
|
|
183
|
+
"span",
|
|
184
|
+
"svg",
|
|
185
|
+
"ul"
|
|
186
|
+
];
|
|
187
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
|
188
|
+
const Slot = createSlot(`Primitive.${node}`);
|
|
189
|
+
const Node = React.forwardRef((props, forwardedRef) => {
|
|
190
|
+
const { asChild, ...primitiveProps } = props;
|
|
191
|
+
const Comp = asChild ? Slot : node;
|
|
192
|
+
if (typeof window !== "undefined") {
|
|
193
|
+
window[Symbol.for("radix-ui")] = true;
|
|
194
|
+
}
|
|
195
|
+
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
196
|
+
});
|
|
197
|
+
Node.displayName = `Primitive.${node}`;
|
|
198
|
+
return { ...primitive, [node]: Node };
|
|
199
|
+
}, {});
|
|
200
|
+
function dispatchDiscreteCustomEvent(target, event) {
|
|
201
|
+
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
196
202
|
}
|
|
197
203
|
|
|
198
|
-
export {
|
|
204
|
+
export { Primitive as P, createSlot as a, composeEventHandlers as c, dispatchDiscreteCustomEvent as d, useControllableState as u };
|
|
199
205
|
//# sourceMappingURL=index13.js.map
|
package/dist/index13.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index13.js","sources":["../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js","../node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.3/node_modules/use-sync-external-store/shim/index.js"],"sourcesContent":["/**\n * @license React\n * use-sync-external-store-shim.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nfunction useSyncExternalStore$2(subscribe, getSnapshot) {\n var value = getSnapshot(),\n _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n}\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n}\nfunction useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n}\nvar shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\nexports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n","/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n function useSyncExternalStore$2(subscribe, getSnapshot) {\n didWarnOld18Alpha ||\n void 0 === React.startTransition ||\n ((didWarnOld18Alpha = !0),\n console.error(\n \"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.\"\n ));\n var value = getSnapshot();\n if (!didWarnUncachedGetSnapshot) {\n var cachedValue = getSnapshot();\n objectIs(value, cachedValue) ||\n (console.error(\n \"The result of getSnapshot should be cached to avoid an infinite loop\"\n ),\n (didWarnUncachedGetSnapshot = !0));\n }\n cachedValue = useState({\n inst: { value: value, getSnapshot: getSnapshot }\n });\n var inst = cachedValue[0].inst,\n forceUpdate = cachedValue[1];\n useLayoutEffect(\n function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot;\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n },\n [subscribe, value, getSnapshot]\n );\n useEffect(\n function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n return subscribe(function () {\n checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });\n });\n },\n [subscribe]\n );\n useDebugValue(value);\n return value;\n }\n function checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n inst = inst.value;\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(inst, nextValue);\n } catch (error) {\n return !0;\n }\n }\n function useSyncExternalStore$1(subscribe, getSnapshot) {\n return getSnapshot();\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue,\n didWarnOld18Alpha = !1,\n didWarnUncachedGetSnapshot = !1,\n shim =\n \"undefined\" === typeof window ||\n \"undefined\" === typeof window.document ||\n \"undefined\" === typeof window.document.createElement\n ? useSyncExternalStore$1\n : useSyncExternalStore$2;\n exports.useSyncExternalStore =\n void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n"],"names":["require$$0","shimModule","require$$1"],"mappings":";;;;;;;;;;;;;;;;;;;;;CAWA,IAAI,KAAK,GAAGA,cAAgB;AAC5B,CAAA,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;GAChB,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1E,CAAA;AACA,CAAA,IAAI,QAAQ,GAAG,UAAU,KAAK,OAAO,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,GAAG,EAAE;AAC/D,GAAE,QAAQ,GAAG,KAAK,CAAC,QAAQ;AAC3B,GAAE,SAAS,GAAG,KAAK,CAAC,SAAS;AAC7B,GAAE,eAAe,GAAG,KAAK,CAAC,eAAe;AACzC,GAAE,aAAa,GAAG,KAAK,CAA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C/E,CAAA,CAAC,MAAM;GACLC,IAAA,CAAA,OAAc,GAAGC,2CAAA,EAA6D;AAChF,CAAA;;;;;;","x_google_ignoreList":[0,1,2]}
|
|
1
|
+
{"version":3,"file":"index13.js","sources":["../node_modules/.pnpm/@radix-ui+primitive@1.1.3/node_modules/@radix-ui/primitive/dist/index.mjs","../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.2.2_@types+react@19.2.9_react@19.2.3/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs","../node_modules/.pnpm/@radix-ui+react-slot@1.2.3_@types+react@19.2.9_react@19.2.3/node_modules/@radix-ui/react-slot/dist/index.mjs","../node_modules/.pnpm/@radix-ui+react-primitive@2.1.3_@types+react-dom@19.2.3_@types+react@19.2.9__@types+rea_57eb89d0235dc4221ced9969d75eafcb/node_modules/@radix-ui/react-primitive/dist/index.mjs"],"sourcesContent":["// src/primitive.tsx\nvar canUseDOM = !!(typeof window !== \"undefined\" && window.document && window.document.createElement);\nfunction composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {\n return function handleEvent(event) {\n originalEventHandler?.(event);\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\nfunction getOwnerWindow(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access window outside of the DOM\");\n }\n return element?.ownerDocument?.defaultView ?? window;\n}\nfunction getOwnerDocument(element) {\n if (!canUseDOM) {\n throw new Error(\"Cannot access document outside of the DOM\");\n }\n return element?.ownerDocument ?? document;\n}\nfunction getActiveElement(node, activeDescendant = false) {\n const { activeElement } = getOwnerDocument(node);\n if (!activeElement?.nodeName) {\n return null;\n }\n if (isFrame(activeElement) && activeElement.contentDocument) {\n return getActiveElement(activeElement.contentDocument.body, activeDescendant);\n }\n if (activeDescendant) {\n const id = activeElement.getAttribute(\"aria-activedescendant\");\n if (id) {\n const element = getOwnerDocument(activeElement).getElementById(id);\n if (element) {\n return element;\n }\n }\n }\n return activeElement;\n}\nfunction isFrame(element) {\n return element.tagName === \"IFRAME\";\n}\nexport {\n canUseDOM,\n composeEventHandlers,\n getActiveElement,\n getOwnerDocument,\n getOwnerWindow,\n isFrame\n};\n//# sourceMappingURL=index.mjs.map\n","// src/use-controllable-state.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nvar useInsertionEffect = React[\" useInsertionEffect \".trim().toString()] || useLayoutEffect;\nfunction useControllableState({\n prop,\n defaultProp,\n onChange = () => {\n },\n caller\n}) {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange\n });\n const isControlled = prop !== void 0;\n const value = isControlled ? prop : uncontrolledProp;\n if (true) {\n const isControlledRef = React.useRef(prop !== void 0);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const setValue = React.useCallback(\n (nextValue) => {\n if (isControlled) {\n const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value2 !== prop) {\n onChangeRef.current?.(value2);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n return [value, setValue];\n}\nfunction useUncontrolledState({\n defaultProp,\n onChange\n}) {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n return [value, setValue, onChangeRef];\n}\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\n\n// src/use-controllable-state-reducer.tsx\nimport * as React2 from \"react\";\nimport { useEffectEvent } from \"@radix-ui/react-use-effect-event\";\nvar SYNC_STATE = Symbol(\"RADIX:SYNC_STATE\");\nfunction useControllableStateReducer(reducer, userArgs, initialArg, init) {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== void 0;\n const onChange = useEffectEvent(onChangeProp);\n if (true) {\n const isControlledRef = React2.useRef(controlledState !== void 0);\n React2.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? \"controlled\" : \"uncontrolled\";\n const to = isControlled ? \"controlled\" : \"uncontrolled\";\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n const args = [{ ...initialArg, state: defaultProp }];\n if (init) {\n args.push(init);\n }\n const [internalState, dispatch] = React2.useReducer(\n (state2, action) => {\n if (action.type === SYNC_STATE) {\n return { ...state2, state: action.state };\n }\n const next = reducer(state2, action);\n if (isControlled && !Object.is(next.state, state2.state)) {\n onChange(next.state);\n }\n return next;\n },\n ...args\n );\n const uncontrolledState = internalState.state;\n const prevValueRef = React2.useRef(uncontrolledState);\n React2.useEffect(() => {\n if (prevValueRef.current !== uncontrolledState) {\n prevValueRef.current = uncontrolledState;\n if (!isControlled) {\n onChange(uncontrolledState);\n }\n }\n }, [onChange, uncontrolledState, prevValueRef, isControlled]);\n const state = React2.useMemo(() => {\n const isControlled2 = controlledState !== void 0;\n if (isControlled2) {\n return { ...internalState, state: controlledState };\n }\n return internalState;\n }, [internalState, controlledState]);\n React2.useEffect(() => {\n if (isControlled && !Object.is(controlledState, internalState.state)) {\n dispatch({ type: SYNC_STATE, state: controlledState });\n }\n }, [controlledState, internalState.state, isControlled]);\n return [state, dispatch];\n}\nexport {\n useControllableState,\n useControllableStateReducer\n};\n//# sourceMappingURL=index.mjs.map\n","// src/slot.tsx\nimport * as React from \"react\";\nimport { composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n","// src/primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"select\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Slot = createSlot(`Primitive.${node}`);\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useLayoutEffect"],"mappings":";;;;;;AAAA;AAEA,SAAS,oBAAoB,CAAC,oBAAoB,EAAE,eAAe,EAAE,EAAE,wBAAwB,GAAG,IAAI,EAAE,GAAG,EAAE,EAAE;AAC/G,EAAE,OAAO,SAAS,WAAW,CAAC,KAAK,EAAE;AACrC,IAAI,oBAAoB,GAAG,KAAK,CAAC;AACjC,IAAI,IAAI,wBAAwB,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE;AACvE,MAAM,OAAO,eAAe,GAAG,KAAK,CAAC;AACrC,IAAI;AACJ,EAAE,CAAC;AACH;;ACTA;AAGA,IAAI,kBAAkB,GAAG,KAAK,CAAC,sBAAsB,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAIA,gBAAe;AAC3F,SAAS,oBAAoB,CAAC;AAC9B,EAAE,IAAI;AACN,EAAE,WAAW;AACb,EAAE,QAAQ,GAAG,MAAM;AACnB,EAAE,CAAC;AACH,EAAE;AACF,CAAC,EAAE;AACH,EAAE,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,EAAE,WAAW,CAAC,GAAG,oBAAoB,CA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AI;AACJ,IAAI,uBAAuB,GAAG,CAAC,IAAI,EAAE,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE,YAAY,EAAE,CAAC;AAC9E,EAAE,CAAC,CAAC;AACJ,EAAE,IAAI,CAAC,WAAW,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AACxC,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,CAAC,IAAI,GAAG,IAAI,EAAE;AACvC,CAAC,EAAE,EAAE;AACL,SAAS,2BAA2B,CAAC,MAAM,EAAE,KAAK,EAAE;AACpD,EAAE,IAAI,MAAM,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AACnE;;;;","x_google_ignoreList":[0,1,2,3]}
|
package/dist/index14.js
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
var shim = {exports: {}};
|
|
4
|
+
|
|
5
|
+
var useSyncExternalStoreShim_production = {};
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @license React
|
|
9
|
+
* use-sync-external-store-shim.production.js
|
|
10
|
+
*
|
|
11
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the MIT license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
var hasRequiredUseSyncExternalStoreShim_production;
|
|
18
|
+
|
|
19
|
+
function requireUseSyncExternalStoreShim_production () {
|
|
20
|
+
if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
|
|
21
|
+
hasRequiredUseSyncExternalStoreShim_production = 1;
|
|
22
|
+
var React = React__default;
|
|
23
|
+
function is(x, y) {
|
|
24
|
+
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
25
|
+
}
|
|
26
|
+
var objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
27
|
+
useState = React.useState,
|
|
28
|
+
useEffect = React.useEffect,
|
|
29
|
+
useLayoutEffect = React.useLayoutEffect,
|
|
30
|
+
useDebugValue = React.useDebugValue;
|
|
31
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
32
|
+
var value = getSnapshot(),
|
|
33
|
+
_useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),
|
|
34
|
+
inst = _useState[0].inst,
|
|
35
|
+
forceUpdate = _useState[1];
|
|
36
|
+
useLayoutEffect(
|
|
37
|
+
function () {
|
|
38
|
+
inst.value = value;
|
|
39
|
+
inst.getSnapshot = getSnapshot;
|
|
40
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
41
|
+
},
|
|
42
|
+
[subscribe, value, getSnapshot]
|
|
43
|
+
);
|
|
44
|
+
useEffect(
|
|
45
|
+
function () {
|
|
46
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
47
|
+
return subscribe(function () {
|
|
48
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
[subscribe]
|
|
52
|
+
);
|
|
53
|
+
useDebugValue(value);
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
function checkIfSnapshotChanged(inst) {
|
|
57
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
58
|
+
inst = inst.value;
|
|
59
|
+
try {
|
|
60
|
+
var nextValue = latestGetSnapshot();
|
|
61
|
+
return !objectIs(inst, nextValue);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
67
|
+
return getSnapshot();
|
|
68
|
+
}
|
|
69
|
+
var shim =
|
|
70
|
+
"undefined" === typeof window ||
|
|
71
|
+
"undefined" === typeof window.document ||
|
|
72
|
+
"undefined" === typeof window.document.createElement
|
|
73
|
+
? useSyncExternalStore$1
|
|
74
|
+
: useSyncExternalStore$2;
|
|
75
|
+
useSyncExternalStoreShim_production.useSyncExternalStore =
|
|
76
|
+
void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
|
|
77
|
+
return useSyncExternalStoreShim_production;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
var useSyncExternalStoreShim_development = {};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @license React
|
|
84
|
+
* use-sync-external-store-shim.development.js
|
|
85
|
+
*
|
|
86
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the MIT license found in the
|
|
89
|
+
* LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
var hasRequiredUseSyncExternalStoreShim_development;
|
|
93
|
+
|
|
94
|
+
function requireUseSyncExternalStoreShim_development () {
|
|
95
|
+
if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
|
|
96
|
+
hasRequiredUseSyncExternalStoreShim_development = 1;
|
|
97
|
+
"production" !== process.env.NODE_ENV &&
|
|
98
|
+
(function () {
|
|
99
|
+
function is(x, y) {
|
|
100
|
+
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
101
|
+
}
|
|
102
|
+
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
103
|
+
didWarnOld18Alpha ||
|
|
104
|
+
void 0 === React.startTransition ||
|
|
105
|
+
((didWarnOld18Alpha = true),
|
|
106
|
+
console.error(
|
|
107
|
+
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
108
|
+
));
|
|
109
|
+
var value = getSnapshot();
|
|
110
|
+
if (!didWarnUncachedGetSnapshot) {
|
|
111
|
+
var cachedValue = getSnapshot();
|
|
112
|
+
objectIs(value, cachedValue) ||
|
|
113
|
+
(console.error(
|
|
114
|
+
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
115
|
+
),
|
|
116
|
+
(didWarnUncachedGetSnapshot = true));
|
|
117
|
+
}
|
|
118
|
+
cachedValue = useState({
|
|
119
|
+
inst: { value: value, getSnapshot: getSnapshot }
|
|
120
|
+
});
|
|
121
|
+
var inst = cachedValue[0].inst,
|
|
122
|
+
forceUpdate = cachedValue[1];
|
|
123
|
+
useLayoutEffect(
|
|
124
|
+
function () {
|
|
125
|
+
inst.value = value;
|
|
126
|
+
inst.getSnapshot = getSnapshot;
|
|
127
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
128
|
+
},
|
|
129
|
+
[subscribe, value, getSnapshot]
|
|
130
|
+
);
|
|
131
|
+
useEffect(
|
|
132
|
+
function () {
|
|
133
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
134
|
+
return subscribe(function () {
|
|
135
|
+
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
[subscribe]
|
|
139
|
+
);
|
|
140
|
+
useDebugValue(value);
|
|
141
|
+
return value;
|
|
142
|
+
}
|
|
143
|
+
function checkIfSnapshotChanged(inst) {
|
|
144
|
+
var latestGetSnapshot = inst.getSnapshot;
|
|
145
|
+
inst = inst.value;
|
|
146
|
+
try {
|
|
147
|
+
var nextValue = latestGetSnapshot();
|
|
148
|
+
return !objectIs(inst, nextValue);
|
|
149
|
+
} catch (error) {
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
154
|
+
return getSnapshot();
|
|
155
|
+
}
|
|
156
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
157
|
+
"function" ===
|
|
158
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
|
|
159
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
160
|
+
var React = React__default,
|
|
161
|
+
objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
162
|
+
useState = React.useState,
|
|
163
|
+
useEffect = React.useEffect,
|
|
164
|
+
useLayoutEffect = React.useLayoutEffect,
|
|
165
|
+
useDebugValue = React.useDebugValue,
|
|
166
|
+
didWarnOld18Alpha = false,
|
|
167
|
+
didWarnUncachedGetSnapshot = false,
|
|
168
|
+
shim =
|
|
169
|
+
"undefined" === typeof window ||
|
|
170
|
+
"undefined" === typeof window.document ||
|
|
171
|
+
"undefined" === typeof window.document.createElement
|
|
172
|
+
? useSyncExternalStore$1
|
|
173
|
+
: useSyncExternalStore$2;
|
|
174
|
+
useSyncExternalStoreShim_development.useSyncExternalStore =
|
|
175
|
+
void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
|
|
176
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
177
|
+
"function" ===
|
|
178
|
+
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
|
179
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
180
|
+
})();
|
|
181
|
+
return useSyncExternalStoreShim_development;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
var hasRequiredShim;
|
|
185
|
+
|
|
186
|
+
function requireShim () {
|
|
187
|
+
if (hasRequiredShim) return shim.exports;
|
|
188
|
+
hasRequiredShim = 1;
|
|
189
|
+
|
|
190
|
+
if (process.env.NODE_ENV === 'production') {
|
|
191
|
+
shim.exports = requireUseSyncExternalStoreShim_production();
|
|
192
|
+
} else {
|
|
193
|
+
shim.exports = requireUseSyncExternalStoreShim_development();
|
|
194
|
+
}
|
|
195
|
+
return shim.exports;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export { requireShim as r };
|
|
199
|
+
//# sourceMappingURL=index14.js.map
|