@redis-ui/components 47.3.2 → 47.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AppSelectionMenu/components/Compose/Compose.cjs +1 -1
- package/dist/AppSelectionMenu/components/Compose/Compose.js +1 -1
- package/dist/Banner/components/BannerSemanticComponents/SemanticCloseButton/SemanticCloseButton.style.cjs +1 -1
- package/dist/Banner/components/BannerSemanticComponents/SemanticCloseButton/SemanticCloseButton.style.js +1 -1
- package/dist/BoxSelectionGroup/hooks/useBoxSelectionGroup.cjs +1 -1
- package/dist/BoxSelectionGroup/hooks/useBoxSelectionGroup.js +1 -1
- package/dist/Checkbox/components/Compose/Compose.cjs +1 -1
- package/dist/Checkbox/components/Compose/Compose.js +1 -1
- package/dist/Checkbox/components/Indicator/Indicator.style.cjs +2 -2
- package/dist/Checkbox/components/Indicator/Indicator.style.js +3 -3
- package/dist/Drawer/components/Description/Description.cjs +1 -1
- package/dist/Drawer/components/Description/Description.js +1 -1
- package/dist/Drawer/components/Header/components/Title/Title.cjs +1 -1
- package/dist/Drawer/components/Header/components/Title/Title.js +1 -1
- package/dist/Inputs/PasswordInput/components/PasswordInput.context.cjs +1 -1
- package/dist/Inputs/PasswordInput/components/PasswordInput.context.js +1 -1
- package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.cjs +1 -1
- package/dist/Inputs/TextArea/components/TextAreaTag/TextAreaTag.js +1 -1
- package/dist/Inputs/components/Context/InputValue.context.d.ts +1 -1
- package/dist/Inputs/components/Context/InputValueProvider.cjs +1 -1
- package/dist/Inputs/components/Context/InputValueProvider.js +1 -1
- package/dist/Inputs/components/Context/NumericInputValueProvider.cjs +1 -1
- package/dist/Inputs/components/Context/NumericInputValueProvider.js +1 -1
- package/dist/Inputs/components/InputTag/InputTag.cjs +1 -1
- package/dist/Inputs/components/InputTag/InputTag.js +1 -1
- package/dist/Loader/Loader.cjs +1 -1
- package/dist/Loader/Loader.js +1 -1
- package/dist/Modal/components/Content/components/Description/Description.cjs +1 -1
- package/dist/Modal/components/Content/components/Description/Description.js +1 -1
- package/dist/Modal/components/Content/components/Header/components/Title/Title.cjs +1 -1
- package/dist/Modal/components/Content/components/Header/components/Title/Title.js +1 -1
- package/dist/MultiSelect/components/Compose/hooks/useMultiSelectContextApi.cjs +1 -1
- package/dist/MultiSelect/components/Compose/hooks/useMultiSelectContextApi.d.ts +1 -1
- package/dist/MultiSelect/components/Compose/hooks/useMultiSelectContextApi.js +1 -1
- package/dist/RadioGroup/components/Compose/Compose.cjs +2 -2
- package/dist/RadioGroup/components/Compose/Compose.js +2 -2
- package/dist/ScreenReaderAnnounce/ScreenReaderAnnounce.cjs +1 -1
- package/dist/ScreenReaderAnnounce/ScreenReaderAnnounce.js +1 -1
- package/dist/Section/components/Compose/Compose.cjs +1 -1
- package/dist/Section/components/Compose/Compose.js +1 -1
- package/dist/Section/components/Header/components/CollapseButton/CollapseButton.cjs +1 -1
- package/dist/Section/components/Header/components/CollapseButton/CollapseButton.js +1 -1
- package/dist/Select/components/Context/hooks/useSelectContextApi.d.ts +1 -1
- package/dist/Select/components/Trigger/components/Compose/Compose.cjs +1 -1
- package/dist/Select/components/Trigger/components/Compose/Compose.js +1 -1
- package/dist/Slider/components/Compose/Compose.cjs +1 -1
- package/dist/Slider/components/Compose/Compose.js +1 -1
- package/dist/Switch/components/Compose/Compose.cjs +1 -1
- package/dist/Switch/components/Compose/Compose.js +1 -1
- package/dist/Toast/Toaster.style.cjs +2 -2
- package/dist/Toast/Toaster.style.js +2 -2
- package/dist/Toast/core/mapping.helpers.cjs +1 -1
- package/dist/Toast/core/mapping.helpers.js +1 -1
- package/dist/Typography/hooks/useEllipsisTooltip.d.ts +1 -1
- package/dist/node_modules/@radix-ui/primitive/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.cjs +108 -62
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +108 -62
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.cjs +5 -4
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +5 -4
- package/dist/node_modules/@radix-ui/react-collection/dist/index.cjs +4 -2
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +5 -3
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +16 -2
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +16 -2
- package/dist/node_modules/@radix-ui/react-context/dist/index.cjs +8 -8
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +8 -8
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.cjs +6 -4
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +6 -4
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.cjs +4 -3
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +4 -3
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.cjs +4 -1
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +4 -1
- package/dist/node_modules/@radix-ui/react-id/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-menu/dist/index.cjs +8 -5
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +8 -5
- package/dist/node_modules/@radix-ui/react-popover/dist/index.cjs +6 -4
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +6 -4
- package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs +4 -1
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +4 -1
- package/dist/node_modules/@radix-ui/react-presence/dist/index.cjs +16 -6
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +16 -5
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.cjs +3 -1
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +3 -1
- package/dist/node_modules/@radix-ui/react-progress/dist/index.cjs +2 -2
- package/dist/node_modules/@radix-ui/react-progress/dist/index.js +2 -2
- package/dist/node_modules/@radix-ui/{react-slider → react-progress}/node_modules/@radix-ui/react-context/dist/index.cjs +2 -1
- package/dist/node_modules/@radix-ui/{react-switch → react-progress}/node_modules/@radix-ui/react-context/dist/index.js +2 -1
- package/dist/node_modules/@radix-ui/{react-slider → react-progress}/node_modules/@radix-ui/react-primitive/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/{react-switch → react-progress}/node_modules/@radix-ui/react-primitive/dist/index.js +4 -2
- package/dist/node_modules/@radix-ui/{react-slider → react-progress}/node_modules/@radix-ui/react-slot/dist/index.cjs +14 -4
- package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-slot/dist/index.js +97 -0
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.cjs +16 -11
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +16 -11
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.cjs +11 -6
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +11 -6
- package/dist/node_modules/@radix-ui/react-select/dist/index.cjs +56 -35
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +57 -36
- package/dist/node_modules/@radix-ui/react-slider/dist/index.cjs +35 -35
- package/dist/node_modules/@radix-ui/react-slider/dist/index.js +10 -10
- package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs +55 -39
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +54 -38
- package/dist/node_modules/@radix-ui/react-switch/dist/index.cjs +27 -23
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js +17 -13
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.cjs +2 -1
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +2 -1
- package/dist/node_modules/@radix-ui/react-toggle/dist/index.cjs +4 -3
- package/dist/node_modules/@radix-ui/react-toggle/dist/index.js +4 -3
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.cjs +33 -17
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +33 -17
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +29 -16
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +29 -16
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +14 -11
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +14 -11
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs +8 -2
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +8 -2
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.cjs +3 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +3 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs +4 -2
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +4 -2
- package/dist/{node_modules/@radix-ui/react-switch → packages/components}/node_modules/@radix-ui/react-primitive/dist/index.cjs +5 -3
- package/dist/{node_modules/@radix-ui/react-slider → packages/components}/node_modules/@radix-ui/react-primitive/dist/index.js +1 -1
- package/dist/packages/components/node_modules/@radix-ui/react-slot/dist/index.cjs +99 -0
- package/dist/{node_modules/@radix-ui/react-slider → packages/components}/node_modules/@radix-ui/react-slot/dist/index.js +14 -4
- package/dist/packages/components/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +32 -0
- package/dist/packages/components/node_modules/@radix-ui/react-visually-hidden/dist/index.js +30 -0
- package/dist/{node_modules → packages/components/node_modules}/react-toastify/dist/react-toastify.esm.cjs +3 -3
- package/dist/{node_modules → packages/components/node_modules}/react-toastify/dist/react-toastify.esm.js +2 -2
- package/package.json +18 -14
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/number/dist/index.cjs +0 -6
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/number/dist/index.js +0 -6
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/primitive/dist/index.cjs +0 -9
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/primitive/dist/index.js +0 -9
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-collection/dist/index.cjs +0 -81
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-collection/dist/index.js +0 -79
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +0 -31
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -28
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-context/dist/index.js +0 -67
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-direction/dist/index.cjs +0 -12
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-direction/dist/index.js +0 -10
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +0 -57
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +0 -7
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -5
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-previous/dist/index.cjs +0 -19
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-previous/dist/index.js +0 -17
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-size/dist/index.cjs +0 -41
- package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-use-size/dist/index.js +0 -39
- package/dist/node_modules/@radix-ui/react-switch/node_modules/@radix-ui/primitive/dist/index.cjs +0 -9
- package/dist/node_modules/@radix-ui/react-switch/node_modules/@radix-ui/primitive/dist/index.js +0 -9
- package/dist/node_modules/@radix-ui/react-switch/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +0 -31
- package/dist/node_modules/@radix-ui/react-switch/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -28
- package/dist/node_modules/@radix-ui/react-switch/node_modules/@radix-ui/react-context/dist/index.cjs +0 -69
- package/dist/node_modules/@radix-ui/react-switch/node_modules/@radix-ui/react-slot/dist/index.cjs +0 -82
- package/dist/node_modules/@radix-ui/react-switch/node_modules/@radix-ui/react-slot/dist/index.js +0 -80
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
const require_runtime = require("../../../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_index = require("../../../../../../node_modules/@radix-ui/react-compose-refs/dist/index.cjs");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_runtime.__toESM(react, 1);
|
|
6
|
+
//#region node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
7
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
8
|
+
var use = react[" use ".trim().toString()];
|
|
9
|
+
function isPromiseLike(value) {
|
|
10
|
+
return typeof value === "object" && value !== null && "then" in value;
|
|
11
|
+
}
|
|
12
|
+
function isLazyComponent(element) {
|
|
13
|
+
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
14
|
+
}
|
|
15
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
16
|
+
function createSlot(ownerName) {
|
|
17
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
18
|
+
const Slot2 = react.forwardRef((props, forwardedRef) => {
|
|
19
|
+
let { children, ...slotProps } = props;
|
|
20
|
+
if (isLazyComponent(children) && typeof use === "function") children = use(children._payload);
|
|
21
|
+
const childrenArray = react.Children.toArray(children);
|
|
22
|
+
const slottable = childrenArray.find(isSlottable);
|
|
23
|
+
if (slottable) {
|
|
24
|
+
const newElement = slottable.props.children;
|
|
25
|
+
const newChildren = childrenArray.map((child) => {
|
|
26
|
+
if (child === slottable) {
|
|
27
|
+
if (react.Children.count(newElement) > 1) return react.Children.only(null);
|
|
28
|
+
return react.isValidElement(newElement) ? newElement.props.children : null;
|
|
29
|
+
} else return child;
|
|
30
|
+
});
|
|
31
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SlotClone, {
|
|
32
|
+
...slotProps,
|
|
33
|
+
ref: forwardedRef,
|
|
34
|
+
children: react.isValidElement(newElement) ? react.cloneElement(newElement, void 0, newChildren) : null
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SlotClone, {
|
|
38
|
+
...slotProps,
|
|
39
|
+
ref: forwardedRef,
|
|
40
|
+
children
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
44
|
+
return Slot2;
|
|
45
|
+
}
|
|
46
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
47
|
+
function createSlotClone(ownerName) {
|
|
48
|
+
const SlotClone = react.forwardRef((props, forwardedRef) => {
|
|
49
|
+
let { children, ...slotProps } = props;
|
|
50
|
+
if (isLazyComponent(children) && typeof use === "function") children = use(children._payload);
|
|
51
|
+
if (react.isValidElement(children)) {
|
|
52
|
+
const childrenRef = getElementRef(children);
|
|
53
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
54
|
+
if (children.type !== react.Fragment) props2.ref = forwardedRef ? require_index.composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
55
|
+
return react.cloneElement(children, props2);
|
|
56
|
+
}
|
|
57
|
+
return react.Children.count(children) > 1 ? react.Children.only(null) : null;
|
|
58
|
+
});
|
|
59
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
60
|
+
return SlotClone;
|
|
61
|
+
}
|
|
62
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
63
|
+
function isSlottable(child) {
|
|
64
|
+
return react.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
65
|
+
}
|
|
66
|
+
function mergeProps(slotProps, childProps) {
|
|
67
|
+
const overrideProps = { ...childProps };
|
|
68
|
+
for (const propName in childProps) {
|
|
69
|
+
const slotPropValue = slotProps[propName];
|
|
70
|
+
const childPropValue = childProps[propName];
|
|
71
|
+
if (/^on[A-Z]/.test(propName)) {
|
|
72
|
+
if (slotPropValue && childPropValue) overrideProps[propName] = (...args) => {
|
|
73
|
+
const result = childPropValue(...args);
|
|
74
|
+
slotPropValue(...args);
|
|
75
|
+
return result;
|
|
76
|
+
};
|
|
77
|
+
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
78
|
+
} else if (propName === "style") overrideProps[propName] = {
|
|
79
|
+
...slotPropValue,
|
|
80
|
+
...childPropValue
|
|
81
|
+
};
|
|
82
|
+
else if (propName === "className") overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
...slotProps,
|
|
86
|
+
...overrideProps
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function getElementRef(element) {
|
|
90
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
91
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
92
|
+
if (mayWarn) return element.ref;
|
|
93
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
94
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
95
|
+
if (mayWarn) return element.props.ref;
|
|
96
|
+
return element.props.ref || element.ref;
|
|
97
|
+
}
|
|
98
|
+
//#endregion
|
|
99
|
+
exports.createSlot = createSlot;
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import { composeRefs } from "
|
|
1
|
+
import { composeRefs } from "../../../../../../node_modules/@radix-ui/react-compose-refs/dist/index.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import * as React$1 from "react";
|
|
4
|
-
//#region
|
|
4
|
+
//#region node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
5
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
6
|
+
var use = React$1[" use ".trim().toString()];
|
|
7
|
+
function isPromiseLike(value) {
|
|
8
|
+
return typeof value === "object" && value !== null && "then" in value;
|
|
9
|
+
}
|
|
10
|
+
function isLazyComponent(element) {
|
|
11
|
+
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
12
|
+
}
|
|
5
13
|
/* @__NO_SIDE_EFFECTS__ */
|
|
6
14
|
function createSlot(ownerName) {
|
|
7
15
|
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
8
16
|
const Slot2 = React$1.forwardRef((props, forwardedRef) => {
|
|
9
|
-
|
|
17
|
+
let { children, ...slotProps } = props;
|
|
18
|
+
if (isLazyComponent(children) && typeof use === "function") children = use(children._payload);
|
|
10
19
|
const childrenArray = React$1.Children.toArray(children);
|
|
11
20
|
const slottable = childrenArray.find(isSlottable);
|
|
12
21
|
if (slottable) {
|
|
@@ -35,7 +44,8 @@ function createSlot(ownerName) {
|
|
|
35
44
|
/* @__NO_SIDE_EFFECTS__ */
|
|
36
45
|
function createSlotClone(ownerName) {
|
|
37
46
|
const SlotClone = React$1.forwardRef((props, forwardedRef) => {
|
|
38
|
-
|
|
47
|
+
let { children, ...slotProps } = props;
|
|
48
|
+
if (isLazyComponent(children) && typeof use === "function") children = use(children._payload);
|
|
39
49
|
if (React$1.isValidElement(children)) {
|
|
40
50
|
const childrenRef = getElementRef(children);
|
|
41
51
|
const props2 = mergeProps(slotProps, children.props);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const require_runtime = require("../../../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_index = require("../../react-primitive/dist/index.cjs");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_runtime.__toESM(react, 1);
|
|
6
|
+
//#region node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
|
|
7
|
+
var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
8
|
+
position: "absolute",
|
|
9
|
+
border: 0,
|
|
10
|
+
width: 1,
|
|
11
|
+
height: 1,
|
|
12
|
+
padding: 0,
|
|
13
|
+
margin: -1,
|
|
14
|
+
overflow: "hidden",
|
|
15
|
+
clip: "rect(0, 0, 0, 0)",
|
|
16
|
+
whiteSpace: "nowrap",
|
|
17
|
+
wordWrap: "normal"
|
|
18
|
+
});
|
|
19
|
+
var NAME = "VisuallyHidden";
|
|
20
|
+
var VisuallyHidden = react.forwardRef((props, forwardedRef) => {
|
|
21
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_index.Primitive.span, {
|
|
22
|
+
...props,
|
|
23
|
+
ref: forwardedRef,
|
|
24
|
+
style: {
|
|
25
|
+
...VISUALLY_HIDDEN_STYLES,
|
|
26
|
+
...props.style
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
VisuallyHidden.displayName = NAME;
|
|
31
|
+
//#endregion
|
|
32
|
+
exports.VisuallyHidden = VisuallyHidden;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Primitive } from "../../react-primitive/dist/index.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
//#region node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
|
|
5
|
+
var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
6
|
+
position: "absolute",
|
|
7
|
+
border: 0,
|
|
8
|
+
width: 1,
|
|
9
|
+
height: 1,
|
|
10
|
+
padding: 0,
|
|
11
|
+
margin: -1,
|
|
12
|
+
overflow: "hidden",
|
|
13
|
+
clip: "rect(0, 0, 0, 0)",
|
|
14
|
+
whiteSpace: "nowrap",
|
|
15
|
+
wordWrap: "normal"
|
|
16
|
+
});
|
|
17
|
+
var NAME = "VisuallyHidden";
|
|
18
|
+
var VisuallyHidden = React$1.forwardRef((props, forwardedRef) => {
|
|
19
|
+
return /* @__PURE__ */ jsx(Primitive.span, {
|
|
20
|
+
...props,
|
|
21
|
+
ref: forwardedRef,
|
|
22
|
+
style: {
|
|
23
|
+
...VISUALLY_HIDDEN_STYLES,
|
|
24
|
+
...props.style
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
VisuallyHidden.displayName = NAME;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { VisuallyHidden };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
const require_runtime = require("
|
|
3
|
-
const require_clsx = require("
|
|
2
|
+
const require_runtime = require("../../../../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_clsx = require("../../../../../node_modules/clsx/dist/clsx.cjs");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
react = require_runtime.__toESM(react, 1);
|
|
6
|
-
//#region
|
|
6
|
+
//#region node_modules/react-toastify/dist/react-toastify.esm.mjs
|
|
7
7
|
var c = (e) => "number" == typeof e && !isNaN(e), d = (e) => "string" == typeof e, u = (e) => "function" == typeof e, p = (e) => d(e) || u(e) ? e : null, m = (e) => (0, react.isValidElement)(e) || d(e) || u(e) || c(e);
|
|
8
8
|
function f(e, t, n) {
|
|
9
9
|
void 0 === n && (n = 300);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import clsx from "
|
|
2
|
+
import clsx from "../../../../../node_modules/clsx/dist/clsx.js";
|
|
3
3
|
import React, { cloneElement, isValidElement, useEffect, useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
4
|
-
//#region
|
|
4
|
+
//#region node_modules/react-toastify/dist/react-toastify.esm.mjs
|
|
5
5
|
var c = (e) => "number" == typeof e && !isNaN(e), d = (e) => "string" == typeof e, u = (e) => "function" == typeof e, p = (e) => d(e) || u(e) ? e : null, m = (e) => isValidElement(e) || d(e) || u(e) || c(e);
|
|
6
6
|
function f(e, t, n) {
|
|
7
7
|
void 0 === n && (n = 300);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redis-ui/components",
|
|
3
3
|
"license": "UNLICENSED",
|
|
4
|
-
"version": "47.
|
|
4
|
+
"version": "47.4.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"repository": "git@github.com:redislabsdev/redis-ui.git",
|
|
@@ -36,20 +36,24 @@
|
|
|
36
36
|
"styled-components": "^5.0.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@radix-ui/react-checkbox": "^1.
|
|
40
|
-
"@radix-ui/react-collapsible": "^1.
|
|
41
|
-
"@radix-ui/react-
|
|
42
|
-
"@radix-ui/react-
|
|
43
|
-
"@radix-ui/react-
|
|
44
|
-
"@radix-ui/react-
|
|
45
|
-
"@radix-ui/react-
|
|
46
|
-
"@radix-ui/react-
|
|
47
|
-
"@radix-ui/react-
|
|
39
|
+
"@radix-ui/react-checkbox": "^1.3.3",
|
|
40
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
41
|
+
"@radix-ui/react-compose-refs": "^1.1.2",
|
|
42
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
43
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
44
|
+
"@radix-ui/react-id": "^1.1.1",
|
|
45
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
46
|
+
"@radix-ui/react-popper": "^1.2.8",
|
|
47
|
+
"@radix-ui/react-progress": "^1.1.8",
|
|
48
|
+
"@radix-ui/react-radio-group": "^1.3.8",
|
|
49
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
48
50
|
"@radix-ui/react-slider": "^1.3.6",
|
|
49
|
-
"@radix-ui/react-switch": "^1.
|
|
50
|
-
"@radix-ui/react-tabs": "^1.
|
|
51
|
-
"@radix-ui/react-toggle": "^1.
|
|
52
|
-
"@radix-ui/react-tooltip": "^1.
|
|
51
|
+
"@radix-ui/react-switch": "^1.2.6",
|
|
52
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
53
|
+
"@radix-ui/react-toggle": "^1.1.10",
|
|
54
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
55
|
+
"@radix-ui/react-use-controllable-state": "^1.2.2",
|
|
56
|
+
"@radix-ui/react-visually-hidden": "^1.2.4",
|
|
53
57
|
"@react-hook/resize-observer": "^2.0.2",
|
|
54
58
|
"react-children-utilities": "2.9.0",
|
|
55
59
|
"react-hotkeys-hook": "^4.6.1",
|
package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/primitive/dist/index.cjs
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
typeof window !== "undefined" && window.document && window.document.createElement;
|
|
2
|
-
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
3
|
-
return function handleEvent(event) {
|
|
4
|
-
originalEventHandler?.(event);
|
|
5
|
-
if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler?.(event);
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
exports.composeEventHandlers = composeEventHandlers;
|
package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/primitive/dist/index.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
typeof window !== "undefined" && window.document && window.document.createElement;
|
|
2
|
-
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
3
|
-
return function handleEvent(event) {
|
|
4
|
-
originalEventHandler?.(event);
|
|
5
|
-
if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler?.(event);
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
export { composeEventHandlers };
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
const require_runtime = require("../../../../../../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
-
const require_index = require("../../react-compose-refs/dist/index.cjs");
|
|
4
|
-
const require_index$1 = require("../../react-context/dist/index.cjs");
|
|
5
|
-
const require_index$2 = require("../../react-slot/dist/index.cjs");
|
|
6
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
-
let react = require("react");
|
|
8
|
-
react = require_runtime.__toESM(react, 1);
|
|
9
|
-
//#region ../../node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
10
|
-
function createCollection(name) {
|
|
11
|
-
const PROVIDER_NAME = name + "CollectionProvider";
|
|
12
|
-
const [createCollectionContext, createCollectionScope] = require_index$1.createContextScope(PROVIDER_NAME);
|
|
13
|
-
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
14
|
-
collectionRef: { current: null },
|
|
15
|
-
itemMap: /* @__PURE__ */ new Map()
|
|
16
|
-
});
|
|
17
|
-
const CollectionProvider = (props) => {
|
|
18
|
-
const { scope, children } = props;
|
|
19
|
-
const ref = react.default.useRef(null);
|
|
20
|
-
const itemMap = react.default.useRef(/* @__PURE__ */ new Map()).current;
|
|
21
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CollectionProviderImpl, {
|
|
22
|
-
scope,
|
|
23
|
-
itemMap,
|
|
24
|
-
collectionRef: ref,
|
|
25
|
-
children
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
CollectionProvider.displayName = PROVIDER_NAME;
|
|
29
|
-
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
30
|
-
const CollectionSlotImpl = require_index$2.createSlot(COLLECTION_SLOT_NAME);
|
|
31
|
-
const CollectionSlot = react.default.forwardRef((props, forwardedRef) => {
|
|
32
|
-
const { scope, children } = props;
|
|
33
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CollectionSlotImpl, {
|
|
34
|
-
ref: require_index.useComposedRefs(forwardedRef, useCollectionContext(COLLECTION_SLOT_NAME, scope).collectionRef),
|
|
35
|
-
children
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
39
|
-
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
40
|
-
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
41
|
-
const CollectionItemSlotImpl = require_index$2.createSlot(ITEM_SLOT_NAME);
|
|
42
|
-
const CollectionItemSlot = react.default.forwardRef((props, forwardedRef) => {
|
|
43
|
-
const { scope, children, ...itemData } = props;
|
|
44
|
-
const ref = react.default.useRef(null);
|
|
45
|
-
const composedRefs = require_index.useComposedRefs(forwardedRef, ref);
|
|
46
|
-
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
47
|
-
react.default.useEffect(() => {
|
|
48
|
-
context.itemMap.set(ref, {
|
|
49
|
-
ref,
|
|
50
|
-
...itemData
|
|
51
|
-
});
|
|
52
|
-
return () => void context.itemMap.delete(ref);
|
|
53
|
-
});
|
|
54
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CollectionItemSlotImpl, {
|
|
55
|
-
[ITEM_DATA_ATTR]: "",
|
|
56
|
-
ref: composedRefs,
|
|
57
|
-
children
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
61
|
-
function useCollection(scope) {
|
|
62
|
-
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
63
|
-
return react.default.useCallback(() => {
|
|
64
|
-
const collectionNode = context.collectionRef.current;
|
|
65
|
-
if (!collectionNode) return [];
|
|
66
|
-
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
67
|
-
return Array.from(context.itemMap.values()).sort((a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current));
|
|
68
|
-
}, [context.collectionRef, context.itemMap]);
|
|
69
|
-
}
|
|
70
|
-
return [
|
|
71
|
-
{
|
|
72
|
-
Provider: CollectionProvider,
|
|
73
|
-
Slot: CollectionSlot,
|
|
74
|
-
ItemSlot: CollectionItemSlot
|
|
75
|
-
},
|
|
76
|
-
useCollection,
|
|
77
|
-
createCollectionScope
|
|
78
|
-
];
|
|
79
|
-
}
|
|
80
|
-
//#endregion
|
|
81
|
-
exports.createCollection = createCollection;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useComposedRefs } from "../../react-compose-refs/dist/index.js";
|
|
3
|
-
import { createContextScope } from "../../react-context/dist/index.js";
|
|
4
|
-
import { createSlot } from "../../react-slot/dist/index.js";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import React from "react";
|
|
7
|
-
//#region ../../node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
8
|
-
function createCollection(name) {
|
|
9
|
-
const PROVIDER_NAME = name + "CollectionProvider";
|
|
10
|
-
const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);
|
|
11
|
-
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
12
|
-
collectionRef: { current: null },
|
|
13
|
-
itemMap: /* @__PURE__ */ new Map()
|
|
14
|
-
});
|
|
15
|
-
const CollectionProvider = (props) => {
|
|
16
|
-
const { scope, children } = props;
|
|
17
|
-
const ref = React.useRef(null);
|
|
18
|
-
const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;
|
|
19
|
-
return /* @__PURE__ */ jsx(CollectionProviderImpl, {
|
|
20
|
-
scope,
|
|
21
|
-
itemMap,
|
|
22
|
-
collectionRef: ref,
|
|
23
|
-
children
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
CollectionProvider.displayName = PROVIDER_NAME;
|
|
27
|
-
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
28
|
-
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
29
|
-
const CollectionSlot = React.forwardRef((props, forwardedRef) => {
|
|
30
|
-
const { scope, children } = props;
|
|
31
|
-
return /* @__PURE__ */ jsx(CollectionSlotImpl, {
|
|
32
|
-
ref: useComposedRefs(forwardedRef, useCollectionContext(COLLECTION_SLOT_NAME, scope).collectionRef),
|
|
33
|
-
children
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
37
|
-
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
38
|
-
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
39
|
-
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
40
|
-
const CollectionItemSlot = React.forwardRef((props, forwardedRef) => {
|
|
41
|
-
const { scope, children, ...itemData } = props;
|
|
42
|
-
const ref = React.useRef(null);
|
|
43
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
44
|
-
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
45
|
-
React.useEffect(() => {
|
|
46
|
-
context.itemMap.set(ref, {
|
|
47
|
-
ref,
|
|
48
|
-
...itemData
|
|
49
|
-
});
|
|
50
|
-
return () => void context.itemMap.delete(ref);
|
|
51
|
-
});
|
|
52
|
-
return /* @__PURE__ */ jsx(CollectionItemSlotImpl, {
|
|
53
|
-
[ITEM_DATA_ATTR]: "",
|
|
54
|
-
ref: composedRefs,
|
|
55
|
-
children
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
59
|
-
function useCollection(scope) {
|
|
60
|
-
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
61
|
-
return React.useCallback(() => {
|
|
62
|
-
const collectionNode = context.collectionRef.current;
|
|
63
|
-
if (!collectionNode) return [];
|
|
64
|
-
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
65
|
-
return Array.from(context.itemMap.values()).sort((a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current));
|
|
66
|
-
}, [context.collectionRef, context.itemMap]);
|
|
67
|
-
}
|
|
68
|
-
return [
|
|
69
|
-
{
|
|
70
|
-
Provider: CollectionProvider,
|
|
71
|
-
Slot: CollectionSlot,
|
|
72
|
-
ItemSlot: CollectionItemSlot
|
|
73
|
-
},
|
|
74
|
-
useCollection,
|
|
75
|
-
createCollectionScope
|
|
76
|
-
];
|
|
77
|
-
}
|
|
78
|
-
//#endregion
|
|
79
|
-
export { createCollection };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const require_runtime = require("../../../../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
let react = require("react");
|
|
3
|
-
react = require_runtime.__toESM(react, 1);
|
|
4
|
-
//#region ../../node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
5
|
-
function setRef(ref, value) {
|
|
6
|
-
if (typeof ref === "function") return ref(value);
|
|
7
|
-
else if (ref !== null && ref !== void 0) ref.current = value;
|
|
8
|
-
}
|
|
9
|
-
function composeRefs(...refs) {
|
|
10
|
-
return (node) => {
|
|
11
|
-
let hasCleanup = false;
|
|
12
|
-
const cleanups = refs.map((ref) => {
|
|
13
|
-
const cleanup = setRef(ref, node);
|
|
14
|
-
if (!hasCleanup && typeof cleanup == "function") hasCleanup = true;
|
|
15
|
-
return cleanup;
|
|
16
|
-
});
|
|
17
|
-
if (hasCleanup) return () => {
|
|
18
|
-
for (let i = 0; i < cleanups.length; i++) {
|
|
19
|
-
const cleanup = cleanups[i];
|
|
20
|
-
if (typeof cleanup == "function") cleanup();
|
|
21
|
-
else setRef(refs[i], null);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
function useComposedRefs(...refs) {
|
|
27
|
-
return react.useCallback(composeRefs(...refs), refs);
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
|
-
exports.composeRefs = composeRefs;
|
|
31
|
-
exports.useComposedRefs = useComposedRefs;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as React$1 from "react";
|
|
2
|
-
//#region ../../node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
3
|
-
function setRef(ref, value) {
|
|
4
|
-
if (typeof ref === "function") return ref(value);
|
|
5
|
-
else if (ref !== null && ref !== void 0) ref.current = value;
|
|
6
|
-
}
|
|
7
|
-
function composeRefs(...refs) {
|
|
8
|
-
return (node) => {
|
|
9
|
-
let hasCleanup = false;
|
|
10
|
-
const cleanups = refs.map((ref) => {
|
|
11
|
-
const cleanup = setRef(ref, node);
|
|
12
|
-
if (!hasCleanup && typeof cleanup == "function") hasCleanup = true;
|
|
13
|
-
return cleanup;
|
|
14
|
-
});
|
|
15
|
-
if (hasCleanup) return () => {
|
|
16
|
-
for (let i = 0; i < cleanups.length; i++) {
|
|
17
|
-
const cleanup = cleanups[i];
|
|
18
|
-
if (typeof cleanup == "function") cleanup();
|
|
19
|
-
else setRef(refs[i], null);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
function useComposedRefs(...refs) {
|
|
25
|
-
return React$1.useCallback(composeRefs(...refs), refs);
|
|
26
|
-
}
|
|
27
|
-
//#endregion
|
|
28
|
-
export { composeRefs, useComposedRefs };
|
package/dist/node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-context/dist/index.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import * as React$1 from "react";
|
|
3
|
-
//#region ../../node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-context/dist/index.mjs
|
|
4
|
-
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
5
|
-
let defaultContexts = [];
|
|
6
|
-
function createContext3(rootComponentName, defaultContext) {
|
|
7
|
-
const BaseContext = React$1.createContext(defaultContext);
|
|
8
|
-
const index = defaultContexts.length;
|
|
9
|
-
defaultContexts = [...defaultContexts, defaultContext];
|
|
10
|
-
const Provider = (props) => {
|
|
11
|
-
const { scope, children, ...context } = props;
|
|
12
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
13
|
-
const value = React$1.useMemo(() => context, Object.values(context));
|
|
14
|
-
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
15
|
-
value,
|
|
16
|
-
children
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
20
|
-
function useContext2(consumerName, scope) {
|
|
21
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
22
|
-
const context = React$1.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$1.createContext(defaultContext);
|
|
32
|
-
});
|
|
33
|
-
return function useScope(scope) {
|
|
34
|
-
const contexts = scope?.[scopeName] || scopeContexts;
|
|
35
|
-
return React$1.useMemo(() => ({ [`__scope${scopeName}`]: {
|
|
36
|
-
...scope,
|
|
37
|
-
[scopeName]: contexts
|
|
38
|
-
} }), [scope, contexts]);
|
|
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 currentScope = useScope(overrideScopes)[`__scope${scopeName}`];
|
|
55
|
-
return {
|
|
56
|
-
...nextScopes2,
|
|
57
|
-
...currentScope
|
|
58
|
-
};
|
|
59
|
-
}, {});
|
|
60
|
-
return React$1.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
createScope.scopeName = baseScope.scopeName;
|
|
64
|
-
return createScope;
|
|
65
|
-
}
|
|
66
|
-
//#endregion
|
|
67
|
-
export { createContextScope };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const require_runtime = require("../../../../../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
-
require("react/jsx-runtime");
|
|
3
|
-
let react = require("react");
|
|
4
|
-
react = require_runtime.__toESM(react, 1);
|
|
5
|
-
//#region ../../node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
6
|
-
var DirectionContext = react.createContext(void 0);
|
|
7
|
-
function useDirection(localDir) {
|
|
8
|
-
const globalDir = react.useContext(DirectionContext);
|
|
9
|
-
return localDir || globalDir || "ltr";
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
12
|
-
exports.useDirection = useDirection;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import * as React$1 from "react";
|
|
3
|
-
//#region ../../node_modules/@radix-ui/react-slider/node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
4
|
-
var DirectionContext = React$1.createContext(void 0);
|
|
5
|
-
function useDirection(localDir) {
|
|
6
|
-
const globalDir = React$1.useContext(DirectionContext);
|
|
7
|
-
return localDir || globalDir || "ltr";
|
|
8
|
-
}
|
|
9
|
-
//#endregion
|
|
10
|
-
export { useDirection };
|