@overmap-ai/blocks 1.0.31-tailwind-components.21 → 1.0.31-tailwind-components.23
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/AlertDialog/typings.d.ts +2 -2
- package/dist/Avatar/Root.d.ts +2 -2
- package/dist/Avatar/context.d.ts +1 -1
- package/dist/Avatar/typings.d.ts +1 -1
- package/dist/Badge/Badge.d.ts +2 -2
- package/dist/Badge/typings.d.ts +1 -1
- package/dist/ButtonGroup/ButtonGroup.d.ts +2 -2
- package/dist/Buttons/Button.d.ts +2 -2
- package/dist/Buttons/IconButton.d.ts +2 -2
- package/dist/Card/Card.d.ts +2 -2
- package/dist/Card/typings.d.ts +1 -1
- package/dist/Checkbox/Root.d.ts +2 -2
- package/dist/Checkbox/typings.d.ts +1 -1
- package/dist/Dialog/Content.d.ts +2 -2
- package/dist/Dialog/Root.d.ts +1 -1
- package/dist/Dialog/context.d.ts +1 -1
- package/dist/Heading/Heading.d.ts +2 -2
- package/dist/Heading/constants.d.ts +1 -1
- package/dist/Heading/typings.d.ts +1 -1
- package/dist/HoverCard/Content.d.ts +2 -2
- package/dist/HoverCard/typings.d.ts +1 -1
- package/dist/Input/Root.d.ts +2 -2
- package/dist/Input/typings.d.ts +1 -1
- package/dist/Link/Link.d.ts +2 -2
- package/dist/Link/typings.d.ts +1 -1
- package/dist/Menu/ClickTrigger/ClickTrigger.d.ts +1 -1
- package/dist/Menu/Content/Content.d.ts +1 -1
- package/dist/Menu/Content/context.d.ts +2 -2
- package/dist/Menu/ContextTrigger/ContextTrigger.d.ts +1 -1
- package/dist/Menu/Group/Group.d.ts +1 -1
- package/dist/Menu/Input/Field.d.ts +1 -1
- package/dist/Menu/Input/Root.d.ts +1 -1
- package/dist/Menu/Input/Slot.d.ts +1 -1
- package/dist/Menu/Item/Item.d.ts +1 -1
- package/dist/Menu/MultiSelectGroup/MultiSelectGroup.d.ts +1 -1
- package/dist/Menu/PageContent/PageContent.d.ts +1 -1
- package/dist/Menu/PageTrigger/PageTrigger.d.ts +1 -1
- package/dist/Menu/Pages/Pages.d.ts +1 -1
- package/dist/Menu/SelectAll/SelectAllIndicator.d.ts +1 -1
- package/dist/Menu/SelectAll/SelectAllItem.d.ts +1 -1
- package/dist/Menu/SelectGroup/SelectGroup.d.ts +1 -1
- package/dist/Menu/SelectItem/SelectItem.d.ts +1 -1
- package/dist/Menu/Separator/Separator.d.ts +1 -1
- package/dist/Menu/Sub/Sub.d.ts +1 -1
- package/dist/Menu/Sub/context.d.ts +1 -1
- package/dist/Menu/SubContent/SubContent.d.ts +1 -1
- package/dist/Menu/SubTrigger/SubTrigger.d.ts +1 -1
- package/dist/Menu/VirtualTrigger/VirtualTrigger.d.ts +1 -1
- package/dist/Menu/root/Root.d.ts +1 -1
- package/dist/Menu/root/context.d.ts +1 -1
- package/dist/Popover/Content.d.ts +2 -2
- package/dist/Popover/typings.d.ts +1 -1
- package/dist/Provider/Provider.d.ts +1 -1
- package/dist/Provider/context.d.ts +1 -1
- package/dist/RadioGroup/Item.d.ts +1 -1
- package/dist/RadioGroup/Root.d.ts +2 -2
- package/dist/RadioGroup/context.d.ts +1 -1
- package/dist/RadioGroup/typings.d.ts +1 -1
- package/dist/SegmentedControl/Root.d.ts +2 -2
- package/dist/SegmentedControl/context.d.ts +1 -1
- package/dist/SegmentedControl/typings.d.ts +2 -2
- package/dist/Separator/Separator.d.ts +1 -1
- package/dist/Switch/Root.d.ts +2 -2
- package/dist/Switch/context.d.ts +1 -1
- package/dist/Switch/typings.d.ts +1 -1
- package/dist/Table/Root.d.ts +2 -2
- package/dist/Table/typings.d.ts +1 -1
- package/dist/Tabs/List.d.ts +2 -2
- package/dist/Tabs/context.d.ts +1 -1
- package/dist/Tabs/typings.d.ts +1 -1
- package/dist/Text/Text.d.ts +2 -2
- package/dist/Text/typings.d.ts +1 -1
- package/dist/TextArea/TextArea.d.ts +2 -2
- package/dist/TextArea/typings.d.ts +1 -1
- package/dist/Toast/Toast.d.ts +1 -1
- package/dist/Toast/ToastProvider.d.ts +1 -1
- package/dist/Toast/typings.d.ts +2 -2
- package/dist/ToggleButton/BaseToggleButton.d.ts +1 -1
- package/dist/ToggleButton/IconToggleButton.d.ts +1 -1
- package/dist/ToggleButton/ToggleButton.d.ts +1 -1
- package/dist/Tooltip/Content.d.ts +2 -2
- package/dist/Tooltip/typings.d.ts +1 -1
- package/dist/blocks.js +54 -405
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +54 -405
- package/dist/blocks.umd.cjs.map +1 -1
- package/package.json +2 -1
package/dist/blocks.js
CHANGED
|
@@ -24,6 +24,7 @@ import * as RadixRadioGroup from "@radix-ui/react-radio-group";
|
|
|
24
24
|
import * as Toggle from "@radix-ui/react-toggle";
|
|
25
25
|
import { Toggle as Toggle$1 } from "@radix-ui/react-toggle";
|
|
26
26
|
import { DismissableLayer } from "@radix-ui/react-dismissable-layer";
|
|
27
|
+
import * as RadixSwitch from "@radix-ui/react-switch";
|
|
27
28
|
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
28
29
|
import * as RadixToast from "@radix-ui/react-toast";
|
|
29
30
|
import { ToastProvider as ToastProvider$1, ToastViewport } from "@radix-ui/react-toast";
|
|
@@ -857,7 +858,7 @@ function useTextFilter(values, filterFunction) {
|
|
|
857
858
|
}, [filterFunction, filterValue, values]);
|
|
858
859
|
return [filteredOptions, filterValue, setFilterValue];
|
|
859
860
|
}
|
|
860
|
-
const useSize
|
|
861
|
+
const useSize = (target) => {
|
|
861
862
|
const [size2, setSize] = useState();
|
|
862
863
|
useLayoutEffect(() => {
|
|
863
864
|
var _a;
|
|
@@ -1328,7 +1329,7 @@ const Container = memo(
|
|
|
1328
1329
|
return !hideLayout && /* @__PURE__ */ jsx("div", { className: cx(className, "flex grow h-full"), ref, ...rest, children });
|
|
1329
1330
|
})
|
|
1330
1331
|
);
|
|
1331
|
-
const Root$
|
|
1332
|
+
const Root$1 = memo((props) => {
|
|
1332
1333
|
const { children, small = false, hideLayout = false } = props;
|
|
1333
1334
|
const [showLeftSlideOut, setShowLeftSlideOut] = useState(false);
|
|
1334
1335
|
const [showRightSlideOut, setShowRightSlideOut] = useState(false);
|
|
@@ -1345,9 +1346,9 @@ const Root$2 = memo((props) => {
|
|
|
1345
1346
|
);
|
|
1346
1347
|
return /* @__PURE__ */ jsx(LayoutContext.Provider, { value: contextValue, children });
|
|
1347
1348
|
});
|
|
1348
|
-
Root$
|
|
1349
|
+
Root$1.displayName = "Layout.Root";
|
|
1349
1350
|
function usePointerDownOutside(onPointerDownOutside, ownerElement = globalThis == null ? void 0 : globalThis.document.body) {
|
|
1350
|
-
const handlePointerDownOutside = useCallbackRef$
|
|
1351
|
+
const handlePointerDownOutside = useCallbackRef$1(onPointerDownOutside);
|
|
1351
1352
|
const isPointerInsideReactTreeRef = useRef(false);
|
|
1352
1353
|
const handleClickRef = useRef(() => {
|
|
1353
1354
|
});
|
|
@@ -1399,7 +1400,7 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
1399
1400
|
target.dispatchEvent(event);
|
|
1400
1401
|
}
|
|
1401
1402
|
}
|
|
1402
|
-
function useCallbackRef$
|
|
1403
|
+
function useCallbackRef$1(callback) {
|
|
1403
1404
|
const callbackRef = useRef(callback);
|
|
1404
1405
|
useEffect(() => {
|
|
1405
1406
|
callbackRef.current = callback;
|
|
@@ -1683,7 +1684,7 @@ const SlideOutTrigger = memo(
|
|
|
1683
1684
|
})
|
|
1684
1685
|
);
|
|
1685
1686
|
const Layout = {
|
|
1686
|
-
Root: Root$
|
|
1687
|
+
Root: Root$1,
|
|
1687
1688
|
Container,
|
|
1688
1689
|
SlideOutOverlay,
|
|
1689
1690
|
LeftSlideOut,
|
|
@@ -7857,7 +7858,7 @@ const RadioGroup = {
|
|
|
7857
7858
|
Item: RadioGroupItem,
|
|
7858
7859
|
Root: RadioGroupRoot
|
|
7859
7860
|
};
|
|
7860
|
-
function createContextScope
|
|
7861
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
7861
7862
|
let defaultContexts = [];
|
|
7862
7863
|
function createContext3(rootComponentName, defaultContext) {
|
|
7863
7864
|
const BaseContext = React.createContext(defaultContext);
|
|
@@ -7894,9 +7895,9 @@ function createContextScope$1(scopeName, createContextScopeDeps = []) {
|
|
|
7894
7895
|
};
|
|
7895
7896
|
};
|
|
7896
7897
|
createScope.scopeName = scopeName;
|
|
7897
|
-
return [createContext3, composeContextScopes
|
|
7898
|
+
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
7898
7899
|
}
|
|
7899
|
-
function composeContextScopes
|
|
7900
|
+
function composeContextScopes(...scopes) {
|
|
7900
7901
|
const baseScope = scopes[0];
|
|
7901
7902
|
if (scopes.length === 1) return baseScope;
|
|
7902
7903
|
const createScope = () => {
|
|
@@ -7916,7 +7917,7 @@ function composeContextScopes$1(...scopes) {
|
|
|
7916
7917
|
createScope.scopeName = baseScope.scopeName;
|
|
7917
7918
|
return createScope;
|
|
7918
7919
|
}
|
|
7919
|
-
var NODES
|
|
7920
|
+
var NODES = [
|
|
7920
7921
|
"a",
|
|
7921
7922
|
"button",
|
|
7922
7923
|
"div",
|
|
@@ -7934,7 +7935,7 @@ var NODES$1 = [
|
|
|
7934
7935
|
"svg",
|
|
7935
7936
|
"ul"
|
|
7936
7937
|
];
|
|
7937
|
-
var Primitive
|
|
7938
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
|
7938
7939
|
const Node2 = React.forwardRef((props, forwardedRef) => {
|
|
7939
7940
|
const { asChild, ...primitiveProps } = props;
|
|
7940
7941
|
const Comp = asChild ? Slot : node;
|
|
@@ -7946,7 +7947,7 @@ var Primitive$1 = NODES$1.reduce((primitive, node) => {
|
|
|
7946
7947
|
Node2.displayName = `Primitive.${node}`;
|
|
7947
7948
|
return { ...primitive, [node]: Node2 };
|
|
7948
7949
|
}, {});
|
|
7949
|
-
function composeEventHandlers
|
|
7950
|
+
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
7950
7951
|
return function handleEvent(event) {
|
|
7951
7952
|
originalEventHandler == null ? void 0 : originalEventHandler(event);
|
|
7952
7953
|
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
@@ -7954,18 +7955,18 @@ function composeEventHandlers$1(originalEventHandler, ourEventHandler, { checkFo
|
|
|
7954
7955
|
}
|
|
7955
7956
|
};
|
|
7956
7957
|
}
|
|
7957
|
-
function setRef
|
|
7958
|
+
function setRef(ref, value) {
|
|
7958
7959
|
if (typeof ref === "function") {
|
|
7959
7960
|
return ref(value);
|
|
7960
7961
|
} else if (ref !== null && ref !== void 0) {
|
|
7961
7962
|
ref.current = value;
|
|
7962
7963
|
}
|
|
7963
7964
|
}
|
|
7964
|
-
function composeRefs
|
|
7965
|
+
function composeRefs(...refs) {
|
|
7965
7966
|
return (node) => {
|
|
7966
7967
|
let hasCleanup = false;
|
|
7967
7968
|
const cleanups = refs.map((ref) => {
|
|
7968
|
-
const cleanup = setRef
|
|
7969
|
+
const cleanup = setRef(ref, node);
|
|
7969
7970
|
if (!hasCleanup && typeof cleanup == "function") {
|
|
7970
7971
|
hasCleanup = true;
|
|
7971
7972
|
}
|
|
@@ -7978,19 +7979,19 @@ function composeRefs$1(...refs) {
|
|
|
7978
7979
|
if (typeof cleanup == "function") {
|
|
7979
7980
|
cleanup();
|
|
7980
7981
|
} else {
|
|
7981
|
-
setRef
|
|
7982
|
+
setRef(refs[i], null);
|
|
7982
7983
|
}
|
|
7983
7984
|
}
|
|
7984
7985
|
};
|
|
7985
7986
|
}
|
|
7986
7987
|
};
|
|
7987
7988
|
}
|
|
7988
|
-
function useComposedRefs
|
|
7989
|
-
return React.useCallback(composeRefs
|
|
7989
|
+
function useComposedRefs(...refs) {
|
|
7990
|
+
return React.useCallback(composeRefs(...refs), refs);
|
|
7990
7991
|
}
|
|
7991
7992
|
function createCollection(name) {
|
|
7992
7993
|
const PROVIDER_NAME = name + "CollectionProvider";
|
|
7993
|
-
const [createCollectionContext, createCollectionScope2] = createContextScope
|
|
7994
|
+
const [createCollectionContext, createCollectionScope2] = createContextScope(PROVIDER_NAME);
|
|
7994
7995
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
|
7995
7996
|
PROVIDER_NAME,
|
|
7996
7997
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
@@ -8007,7 +8008,7 @@ function createCollection(name) {
|
|
|
8007
8008
|
(props, forwardedRef) => {
|
|
8008
8009
|
const { scope, children } = props;
|
|
8009
8010
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
8010
|
-
const composedRefs = useComposedRefs
|
|
8011
|
+
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
8011
8012
|
return /* @__PURE__ */ jsx(Slot, { ref: composedRefs, children });
|
|
8012
8013
|
}
|
|
8013
8014
|
);
|
|
@@ -8018,7 +8019,7 @@ function createCollection(name) {
|
|
|
8018
8019
|
(props, forwardedRef) => {
|
|
8019
8020
|
const { scope, children, ...itemData } = props;
|
|
8020
8021
|
const ref = React__default.useRef(null);
|
|
8021
|
-
const composedRefs = useComposedRefs
|
|
8022
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
8022
8023
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
8023
8024
|
React__default.useEffect(() => {
|
|
8024
8025
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
@@ -8048,18 +8049,18 @@ function createCollection(name) {
|
|
|
8048
8049
|
createCollectionScope2
|
|
8049
8050
|
];
|
|
8050
8051
|
}
|
|
8051
|
-
var useLayoutEffect2
|
|
8052
|
+
var useLayoutEffect2 = Boolean(globalThis == null ? void 0 : globalThis.document) ? React.useLayoutEffect : () => {
|
|
8052
8053
|
};
|
|
8053
8054
|
var useReactId = React["useId".toString()] || (() => void 0);
|
|
8054
8055
|
var count = 0;
|
|
8055
8056
|
function useId(deterministicId) {
|
|
8056
8057
|
const [id, setId] = React.useState(useReactId());
|
|
8057
|
-
useLayoutEffect2
|
|
8058
|
+
useLayoutEffect2(() => {
|
|
8058
8059
|
setId((reactId) => reactId ?? String(count++));
|
|
8059
8060
|
}, [deterministicId]);
|
|
8060
8061
|
return id ? `radix-${id}` : "";
|
|
8061
8062
|
}
|
|
8062
|
-
function useCallbackRef
|
|
8063
|
+
function useCallbackRef(callback) {
|
|
8063
8064
|
const callbackRef = React.useRef(callback);
|
|
8064
8065
|
React.useEffect(() => {
|
|
8065
8066
|
callbackRef.current = callback;
|
|
@@ -8069,16 +8070,16 @@ function useCallbackRef$1(callback) {
|
|
|
8069
8070
|
return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
|
|
8070
8071
|
}, []);
|
|
8071
8072
|
}
|
|
8072
|
-
function useControllableState
|
|
8073
|
+
function useControllableState({
|
|
8073
8074
|
prop,
|
|
8074
8075
|
defaultProp,
|
|
8075
8076
|
onChange = () => {
|
|
8076
8077
|
}
|
|
8077
8078
|
}) {
|
|
8078
|
-
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState
|
|
8079
|
+
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
|
|
8079
8080
|
const isControlled = prop !== void 0;
|
|
8080
8081
|
const value = isControlled ? prop : uncontrolledProp;
|
|
8081
|
-
const handleChange = useCallbackRef
|
|
8082
|
+
const handleChange = useCallbackRef(onChange);
|
|
8082
8083
|
const setValue = React.useCallback(
|
|
8083
8084
|
(nextValue) => {
|
|
8084
8085
|
if (isControlled) {
|
|
@@ -8093,14 +8094,14 @@ function useControllableState$1({
|
|
|
8093
8094
|
);
|
|
8094
8095
|
return [value, setValue];
|
|
8095
8096
|
}
|
|
8096
|
-
function useUncontrolledState
|
|
8097
|
+
function useUncontrolledState({
|
|
8097
8098
|
defaultProp,
|
|
8098
8099
|
onChange
|
|
8099
8100
|
}) {
|
|
8100
8101
|
const uncontrolledState = React.useState(defaultProp);
|
|
8101
8102
|
const [value] = uncontrolledState;
|
|
8102
8103
|
const prevValueRef = React.useRef(value);
|
|
8103
|
-
const handleChange = useCallbackRef
|
|
8104
|
+
const handleChange = useCallbackRef(onChange);
|
|
8104
8105
|
React.useEffect(() => {
|
|
8105
8106
|
if (prevValueRef.current !== value) {
|
|
8106
8107
|
handleChange(value);
|
|
@@ -8118,7 +8119,7 @@ var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
|
8118
8119
|
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
8119
8120
|
var GROUP_NAME = "RovingFocusGroup";
|
|
8120
8121
|
var [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);
|
|
8121
|
-
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope
|
|
8122
|
+
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
|
|
8122
8123
|
GROUP_NAME,
|
|
8123
8124
|
[createCollectionScope]
|
|
8124
8125
|
);
|
|
@@ -8143,15 +8144,15 @@ var RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
|
|
|
8143
8144
|
...groupProps
|
|
8144
8145
|
} = props;
|
|
8145
8146
|
const ref = React.useRef(null);
|
|
8146
|
-
const composedRefs = useComposedRefs
|
|
8147
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
8147
8148
|
const direction = useDirection(dir);
|
|
8148
|
-
const [currentTabStopId = null, setCurrentTabStopId] = useControllableState
|
|
8149
|
+
const [currentTabStopId = null, setCurrentTabStopId] = useControllableState({
|
|
8149
8150
|
prop: currentTabStopIdProp,
|
|
8150
8151
|
defaultProp: defaultCurrentTabStopId,
|
|
8151
8152
|
onChange: onCurrentTabStopIdChange
|
|
8152
8153
|
});
|
|
8153
8154
|
const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);
|
|
8154
|
-
const handleEntryFocus = useCallbackRef
|
|
8155
|
+
const handleEntryFocus = useCallbackRef(onEntryFocus);
|
|
8155
8156
|
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
8156
8157
|
const isClickFocusRef = React.useRef(false);
|
|
8157
8158
|
const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);
|
|
@@ -8184,17 +8185,17 @@ var RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
|
|
|
8184
8185
|
[]
|
|
8185
8186
|
),
|
|
8186
8187
|
children: /* @__PURE__ */ jsx(
|
|
8187
|
-
Primitive
|
|
8188
|
+
Primitive.div,
|
|
8188
8189
|
{
|
|
8189
8190
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
8190
8191
|
"data-orientation": orientation,
|
|
8191
8192
|
...groupProps,
|
|
8192
8193
|
ref: composedRefs,
|
|
8193
8194
|
style: { outline: "none", ...props.style },
|
|
8194
|
-
onMouseDown: composeEventHandlers
|
|
8195
|
+
onMouseDown: composeEventHandlers(props.onMouseDown, () => {
|
|
8195
8196
|
isClickFocusRef.current = true;
|
|
8196
8197
|
}),
|
|
8197
|
-
onFocus: composeEventHandlers
|
|
8198
|
+
onFocus: composeEventHandlers(props.onFocus, (event) => {
|
|
8198
8199
|
const isKeyboardFocus = !isClickFocusRef.current;
|
|
8199
8200
|
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
8200
8201
|
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
|
|
@@ -8212,7 +8213,7 @@ var RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {
|
|
|
8212
8213
|
}
|
|
8213
8214
|
isClickFocusRef.current = false;
|
|
8214
8215
|
}),
|
|
8215
|
-
onBlur: composeEventHandlers
|
|
8216
|
+
onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))
|
|
8216
8217
|
}
|
|
8217
8218
|
)
|
|
8218
8219
|
}
|
|
@@ -8248,18 +8249,18 @@ var RovingFocusGroupItem = React.forwardRef(
|
|
|
8248
8249
|
focusable,
|
|
8249
8250
|
active,
|
|
8250
8251
|
children: /* @__PURE__ */ jsx(
|
|
8251
|
-
Primitive
|
|
8252
|
+
Primitive.span,
|
|
8252
8253
|
{
|
|
8253
8254
|
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
8254
8255
|
"data-orientation": context.orientation,
|
|
8255
8256
|
...itemProps,
|
|
8256
8257
|
ref: forwardedRef,
|
|
8257
|
-
onMouseDown: composeEventHandlers
|
|
8258
|
+
onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
|
|
8258
8259
|
if (!focusable) event.preventDefault();
|
|
8259
8260
|
else context.onItemFocus(id);
|
|
8260
8261
|
}),
|
|
8261
|
-
onFocus: composeEventHandlers
|
|
8262
|
-
onKeyDown: composeEventHandlers
|
|
8262
|
+
onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),
|
|
8263
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
8263
8264
|
if (event.key === "Tab" && event.shiftKey) {
|
|
8264
8265
|
context.onItemShiftTab();
|
|
8265
8266
|
return;
|
|
@@ -8318,10 +8319,10 @@ function focusFirst(candidates, preventScroll = false) {
|
|
|
8318
8319
|
function wrapArray(array, startIndex) {
|
|
8319
8320
|
return array.map((_, index2) => array[(startIndex + index2) % array.length]);
|
|
8320
8321
|
}
|
|
8321
|
-
var
|
|
8322
|
+
var Root2 = RovingFocusGroup;
|
|
8322
8323
|
var Item = RovingFocusGroupItem;
|
|
8323
8324
|
var TOGGLE_GROUP_NAME = "ToggleGroup";
|
|
8324
|
-
var [createToggleGroupContext, createToggleGroupScope] = createContextScope
|
|
8325
|
+
var [createToggleGroupContext, createToggleGroupScope] = createContextScope(TOGGLE_GROUP_NAME, [
|
|
8325
8326
|
createRovingFocusGroupScope
|
|
8326
8327
|
]);
|
|
8327
8328
|
var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
|
@@ -8347,7 +8348,7 @@ var ToggleGroupImplSingle = React__default.forwardRef((props, forwardedRef) => {
|
|
|
8347
8348
|
},
|
|
8348
8349
|
...toggleGroupSingleProps
|
|
8349
8350
|
} = props;
|
|
8350
|
-
const [value, setValue] = useControllableState
|
|
8351
|
+
const [value, setValue] = useControllableState({
|
|
8351
8352
|
prop: valueProp,
|
|
8352
8353
|
defaultProp: defaultValue,
|
|
8353
8354
|
onChange: onValueChange
|
|
@@ -8372,7 +8373,7 @@ var ToggleGroupImplMultiple = React__default.forwardRef((props, forwardedRef) =>
|
|
|
8372
8373
|
},
|
|
8373
8374
|
...toggleGroupMultipleProps
|
|
8374
8375
|
} = props;
|
|
8375
|
-
const [value = [], setValue] = useControllableState
|
|
8376
|
+
const [value = [], setValue] = useControllableState({
|
|
8376
8377
|
prop: valueProp,
|
|
8377
8378
|
defaultProp: defaultValue,
|
|
8378
8379
|
onChange: onValueChange
|
|
@@ -8414,16 +8415,16 @@ var ToggleGroupImpl = React__default.forwardRef(
|
|
|
8414
8415
|
const direction = useDirection(dir);
|
|
8415
8416
|
const commonProps = { role: "group", dir: direction, ...toggleGroupProps };
|
|
8416
8417
|
return /* @__PURE__ */ jsx(ToggleGroupContext, { scope: __scopeToggleGroup, rovingFocus, disabled, children: rovingFocus ? /* @__PURE__ */ jsx(
|
|
8417
|
-
|
|
8418
|
+
Root2,
|
|
8418
8419
|
{
|
|
8419
8420
|
asChild: true,
|
|
8420
8421
|
...rovingFocusGroupScope,
|
|
8421
8422
|
orientation,
|
|
8422
8423
|
dir: direction,
|
|
8423
8424
|
loop,
|
|
8424
|
-
children: /* @__PURE__ */ jsx(Primitive
|
|
8425
|
+
children: /* @__PURE__ */ jsx(Primitive.div, { ...commonProps, ref: forwardedRef })
|
|
8425
8426
|
}
|
|
8426
|
-
) : /* @__PURE__ */ jsx(Primitive
|
|
8427
|
+
) : /* @__PURE__ */ jsx(Primitive.div, { ...commonProps, ref: forwardedRef }) });
|
|
8427
8428
|
}
|
|
8428
8429
|
);
|
|
8429
8430
|
var ITEM_NAME = "ToggleGroupItem";
|
|
@@ -8473,7 +8474,7 @@ var ToggleGroupItemImpl = React__default.forwardRef(
|
|
|
8473
8474
|
);
|
|
8474
8475
|
}
|
|
8475
8476
|
);
|
|
8476
|
-
var
|
|
8477
|
+
var Root22 = ToggleGroup;
|
|
8477
8478
|
var Item2 = ToggleGroupItem;
|
|
8478
8479
|
const segmentedControlRootCva = cva(["shrink-0", "transition-colors", "flex"], {
|
|
8479
8480
|
variants: {
|
|
@@ -8638,7 +8639,7 @@ const SegmentedControlRoot = forwardRef((props, ref) => {
|
|
|
8638
8639
|
...rest
|
|
8639
8640
|
} = props;
|
|
8640
8641
|
return /* @__PURE__ */ jsx(
|
|
8641
|
-
|
|
8642
|
+
Root22,
|
|
8642
8643
|
{
|
|
8643
8644
|
ref,
|
|
8644
8645
|
className: cx(
|
|
@@ -8880,358 +8881,6 @@ const Spinner = memo(() => {
|
|
|
8880
8881
|
return /* @__PURE__ */ jsx("div", { className: "size-5 rounded-full border border-2 border-(--base-a12) border-b-transparent animate-spin" });
|
|
8881
8882
|
});
|
|
8882
8883
|
Spinner.displayName = "Spinner";
|
|
8883
|
-
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
8884
|
-
return function handleEvent(event) {
|
|
8885
|
-
originalEventHandler == null ? void 0 : originalEventHandler(event);
|
|
8886
|
-
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
8887
|
-
return ourEventHandler == null ? void 0 : ourEventHandler(event);
|
|
8888
|
-
}
|
|
8889
|
-
};
|
|
8890
|
-
}
|
|
8891
|
-
function setRef(ref, value) {
|
|
8892
|
-
if (typeof ref === "function") {
|
|
8893
|
-
return ref(value);
|
|
8894
|
-
} else if (ref !== null && ref !== void 0) {
|
|
8895
|
-
ref.current = value;
|
|
8896
|
-
}
|
|
8897
|
-
}
|
|
8898
|
-
function composeRefs(...refs) {
|
|
8899
|
-
return (node) => {
|
|
8900
|
-
let hasCleanup = false;
|
|
8901
|
-
const cleanups = refs.map((ref) => {
|
|
8902
|
-
const cleanup = setRef(ref, node);
|
|
8903
|
-
if (!hasCleanup && typeof cleanup == "function") {
|
|
8904
|
-
hasCleanup = true;
|
|
8905
|
-
}
|
|
8906
|
-
return cleanup;
|
|
8907
|
-
});
|
|
8908
|
-
if (hasCleanup) {
|
|
8909
|
-
return () => {
|
|
8910
|
-
for (let i = 0; i < cleanups.length; i++) {
|
|
8911
|
-
const cleanup = cleanups[i];
|
|
8912
|
-
if (typeof cleanup == "function") {
|
|
8913
|
-
cleanup();
|
|
8914
|
-
} else {
|
|
8915
|
-
setRef(refs[i], null);
|
|
8916
|
-
}
|
|
8917
|
-
}
|
|
8918
|
-
};
|
|
8919
|
-
}
|
|
8920
|
-
};
|
|
8921
|
-
}
|
|
8922
|
-
function useComposedRefs(...refs) {
|
|
8923
|
-
return React.useCallback(composeRefs(...refs), refs);
|
|
8924
|
-
}
|
|
8925
|
-
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
8926
|
-
let defaultContexts = [];
|
|
8927
|
-
function createContext3(rootComponentName, defaultContext) {
|
|
8928
|
-
const BaseContext = React.createContext(defaultContext);
|
|
8929
|
-
const index2 = defaultContexts.length;
|
|
8930
|
-
defaultContexts = [...defaultContexts, defaultContext];
|
|
8931
|
-
const Provider2 = (props) => {
|
|
8932
|
-
var _a;
|
|
8933
|
-
const { scope, children, ...context } = props;
|
|
8934
|
-
const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index2]) || BaseContext;
|
|
8935
|
-
const value = React.useMemo(() => context, Object.values(context));
|
|
8936
|
-
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
8937
|
-
};
|
|
8938
|
-
Provider2.displayName = rootComponentName + "Provider";
|
|
8939
|
-
function useContext2(consumerName, scope) {
|
|
8940
|
-
var _a;
|
|
8941
|
-
const Context = ((_a = scope == null ? void 0 : scope[scopeName]) == null ? void 0 : _a[index2]) || BaseContext;
|
|
8942
|
-
const context = React.useContext(Context);
|
|
8943
|
-
if (context) return context;
|
|
8944
|
-
if (defaultContext !== void 0) return defaultContext;
|
|
8945
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
8946
|
-
}
|
|
8947
|
-
return [Provider2, useContext2];
|
|
8948
|
-
}
|
|
8949
|
-
const createScope = () => {
|
|
8950
|
-
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
8951
|
-
return React.createContext(defaultContext);
|
|
8952
|
-
});
|
|
8953
|
-
return function useScope(scope) {
|
|
8954
|
-
const contexts = (scope == null ? void 0 : scope[scopeName]) || scopeContexts;
|
|
8955
|
-
return React.useMemo(
|
|
8956
|
-
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
8957
|
-
[scope, contexts]
|
|
8958
|
-
);
|
|
8959
|
-
};
|
|
8960
|
-
};
|
|
8961
|
-
createScope.scopeName = scopeName;
|
|
8962
|
-
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
8963
|
-
}
|
|
8964
|
-
function composeContextScopes(...scopes) {
|
|
8965
|
-
const baseScope = scopes[0];
|
|
8966
|
-
if (scopes.length === 1) return baseScope;
|
|
8967
|
-
const createScope = () => {
|
|
8968
|
-
const scopeHooks = scopes.map((createScope2) => ({
|
|
8969
|
-
useScope: createScope2(),
|
|
8970
|
-
scopeName: createScope2.scopeName
|
|
8971
|
-
}));
|
|
8972
|
-
return function useComposedScopes(overrideScopes) {
|
|
8973
|
-
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
8974
|
-
const scopeProps = useScope(overrideScopes);
|
|
8975
|
-
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
8976
|
-
return { ...nextScopes2, ...currentScope };
|
|
8977
|
-
}, {});
|
|
8978
|
-
return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
8979
|
-
};
|
|
8980
|
-
};
|
|
8981
|
-
createScope.scopeName = baseScope.scopeName;
|
|
8982
|
-
return createScope;
|
|
8983
|
-
}
|
|
8984
|
-
function useCallbackRef(callback) {
|
|
8985
|
-
const callbackRef = React.useRef(callback);
|
|
8986
|
-
React.useEffect(() => {
|
|
8987
|
-
callbackRef.current = callback;
|
|
8988
|
-
});
|
|
8989
|
-
return React.useMemo(() => (...args) => {
|
|
8990
|
-
var _a;
|
|
8991
|
-
return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
|
|
8992
|
-
}, []);
|
|
8993
|
-
}
|
|
8994
|
-
function useControllableState({
|
|
8995
|
-
prop,
|
|
8996
|
-
defaultProp,
|
|
8997
|
-
onChange = () => {
|
|
8998
|
-
}
|
|
8999
|
-
}) {
|
|
9000
|
-
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
|
|
9001
|
-
const isControlled = prop !== void 0;
|
|
9002
|
-
const value = isControlled ? prop : uncontrolledProp;
|
|
9003
|
-
const handleChange = useCallbackRef(onChange);
|
|
9004
|
-
const setValue = React.useCallback(
|
|
9005
|
-
(nextValue) => {
|
|
9006
|
-
if (isControlled) {
|
|
9007
|
-
const setter = nextValue;
|
|
9008
|
-
const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
|
|
9009
|
-
if (value2 !== prop) handleChange(value2);
|
|
9010
|
-
} else {
|
|
9011
|
-
setUncontrolledProp(nextValue);
|
|
9012
|
-
}
|
|
9013
|
-
},
|
|
9014
|
-
[isControlled, prop, setUncontrolledProp, handleChange]
|
|
9015
|
-
);
|
|
9016
|
-
return [value, setValue];
|
|
9017
|
-
}
|
|
9018
|
-
function useUncontrolledState({
|
|
9019
|
-
defaultProp,
|
|
9020
|
-
onChange
|
|
9021
|
-
}) {
|
|
9022
|
-
const uncontrolledState = React.useState(defaultProp);
|
|
9023
|
-
const [value] = uncontrolledState;
|
|
9024
|
-
const prevValueRef = React.useRef(value);
|
|
9025
|
-
const handleChange = useCallbackRef(onChange);
|
|
9026
|
-
React.useEffect(() => {
|
|
9027
|
-
if (prevValueRef.current !== value) {
|
|
9028
|
-
handleChange(value);
|
|
9029
|
-
prevValueRef.current = value;
|
|
9030
|
-
}
|
|
9031
|
-
}, [value, prevValueRef, handleChange]);
|
|
9032
|
-
return uncontrolledState;
|
|
9033
|
-
}
|
|
9034
|
-
function usePrevious(value) {
|
|
9035
|
-
const ref = React.useRef({ value, previous: value });
|
|
9036
|
-
return React.useMemo(() => {
|
|
9037
|
-
if (ref.current.value !== value) {
|
|
9038
|
-
ref.current.previous = ref.current.value;
|
|
9039
|
-
ref.current.value = value;
|
|
9040
|
-
}
|
|
9041
|
-
return ref.current.previous;
|
|
9042
|
-
}, [value]);
|
|
9043
|
-
}
|
|
9044
|
-
var useLayoutEffect2 = Boolean(globalThis == null ? void 0 : globalThis.document) ? React.useLayoutEffect : () => {
|
|
9045
|
-
};
|
|
9046
|
-
function useSize(element) {
|
|
9047
|
-
const [size2, setSize] = React.useState(void 0);
|
|
9048
|
-
useLayoutEffect2(() => {
|
|
9049
|
-
if (element) {
|
|
9050
|
-
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
9051
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
9052
|
-
if (!Array.isArray(entries)) {
|
|
9053
|
-
return;
|
|
9054
|
-
}
|
|
9055
|
-
if (!entries.length) {
|
|
9056
|
-
return;
|
|
9057
|
-
}
|
|
9058
|
-
const entry = entries[0];
|
|
9059
|
-
let width;
|
|
9060
|
-
let height;
|
|
9061
|
-
if ("borderBoxSize" in entry) {
|
|
9062
|
-
const borderSizeEntry = entry["borderBoxSize"];
|
|
9063
|
-
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
|
9064
|
-
width = borderSize["inlineSize"];
|
|
9065
|
-
height = borderSize["blockSize"];
|
|
9066
|
-
} else {
|
|
9067
|
-
width = element.offsetWidth;
|
|
9068
|
-
height = element.offsetHeight;
|
|
9069
|
-
}
|
|
9070
|
-
setSize({ width, height });
|
|
9071
|
-
});
|
|
9072
|
-
resizeObserver.observe(element, { box: "border-box" });
|
|
9073
|
-
return () => resizeObserver.unobserve(element);
|
|
9074
|
-
} else {
|
|
9075
|
-
setSize(void 0);
|
|
9076
|
-
}
|
|
9077
|
-
}, [element]);
|
|
9078
|
-
return size2;
|
|
9079
|
-
}
|
|
9080
|
-
var NODES = [
|
|
9081
|
-
"a",
|
|
9082
|
-
"button",
|
|
9083
|
-
"div",
|
|
9084
|
-
"form",
|
|
9085
|
-
"h2",
|
|
9086
|
-
"h3",
|
|
9087
|
-
"img",
|
|
9088
|
-
"input",
|
|
9089
|
-
"label",
|
|
9090
|
-
"li",
|
|
9091
|
-
"nav",
|
|
9092
|
-
"ol",
|
|
9093
|
-
"p",
|
|
9094
|
-
"span",
|
|
9095
|
-
"svg",
|
|
9096
|
-
"ul"
|
|
9097
|
-
];
|
|
9098
|
-
var Primitive = NODES.reduce((primitive, node) => {
|
|
9099
|
-
const Node2 = React.forwardRef((props, forwardedRef) => {
|
|
9100
|
-
const { asChild, ...primitiveProps } = props;
|
|
9101
|
-
const Comp = asChild ? Slot : node;
|
|
9102
|
-
if (typeof window !== "undefined") {
|
|
9103
|
-
window[Symbol.for("radix-ui")] = true;
|
|
9104
|
-
}
|
|
9105
|
-
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
9106
|
-
});
|
|
9107
|
-
Node2.displayName = `Primitive.${node}`;
|
|
9108
|
-
return { ...primitive, [node]: Node2 };
|
|
9109
|
-
}, {});
|
|
9110
|
-
var SWITCH_NAME = "Switch";
|
|
9111
|
-
var [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME);
|
|
9112
|
-
var [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME);
|
|
9113
|
-
var Switch$1 = React.forwardRef(
|
|
9114
|
-
(props, forwardedRef) => {
|
|
9115
|
-
const {
|
|
9116
|
-
__scopeSwitch,
|
|
9117
|
-
name,
|
|
9118
|
-
checked: checkedProp,
|
|
9119
|
-
defaultChecked,
|
|
9120
|
-
required,
|
|
9121
|
-
disabled,
|
|
9122
|
-
value = "on",
|
|
9123
|
-
onCheckedChange,
|
|
9124
|
-
form,
|
|
9125
|
-
...switchProps
|
|
9126
|
-
} = props;
|
|
9127
|
-
const [button, setButton] = React.useState(null);
|
|
9128
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
|
|
9129
|
-
const hasConsumerStoppedPropagationRef = React.useRef(false);
|
|
9130
|
-
const isFormControl = button ? form || !!button.closest("form") : true;
|
|
9131
|
-
const [checked = false, setChecked] = useControllableState({
|
|
9132
|
-
prop: checkedProp,
|
|
9133
|
-
defaultProp: defaultChecked,
|
|
9134
|
-
onChange: onCheckedChange
|
|
9135
|
-
});
|
|
9136
|
-
return /* @__PURE__ */ jsxs(SwitchProvider, { scope: __scopeSwitch, checked, disabled, children: [
|
|
9137
|
-
/* @__PURE__ */ jsx(
|
|
9138
|
-
Primitive.button,
|
|
9139
|
-
{
|
|
9140
|
-
type: "button",
|
|
9141
|
-
role: "switch",
|
|
9142
|
-
"aria-checked": checked,
|
|
9143
|
-
"aria-required": required,
|
|
9144
|
-
"data-state": getState(checked),
|
|
9145
|
-
"data-disabled": disabled ? "" : void 0,
|
|
9146
|
-
disabled,
|
|
9147
|
-
value,
|
|
9148
|
-
...switchProps,
|
|
9149
|
-
ref: composedRefs,
|
|
9150
|
-
onClick: composeEventHandlers(props.onClick, (event) => {
|
|
9151
|
-
setChecked((prevChecked) => !prevChecked);
|
|
9152
|
-
if (isFormControl) {
|
|
9153
|
-
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
|
9154
|
-
if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
|
|
9155
|
-
}
|
|
9156
|
-
})
|
|
9157
|
-
}
|
|
9158
|
-
),
|
|
9159
|
-
isFormControl && /* @__PURE__ */ jsx(
|
|
9160
|
-
BubbleInput,
|
|
9161
|
-
{
|
|
9162
|
-
control: button,
|
|
9163
|
-
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
9164
|
-
name,
|
|
9165
|
-
value,
|
|
9166
|
-
checked,
|
|
9167
|
-
required,
|
|
9168
|
-
disabled,
|
|
9169
|
-
form,
|
|
9170
|
-
style: { transform: "translateX(-100%)" }
|
|
9171
|
-
}
|
|
9172
|
-
)
|
|
9173
|
-
] });
|
|
9174
|
-
}
|
|
9175
|
-
);
|
|
9176
|
-
Switch$1.displayName = SWITCH_NAME;
|
|
9177
|
-
var THUMB_NAME = "SwitchThumb";
|
|
9178
|
-
var SwitchThumb$1 = React.forwardRef(
|
|
9179
|
-
(props, forwardedRef) => {
|
|
9180
|
-
const { __scopeSwitch, ...thumbProps } = props;
|
|
9181
|
-
const context = useSwitchContext(THUMB_NAME, __scopeSwitch);
|
|
9182
|
-
return /* @__PURE__ */ jsx(
|
|
9183
|
-
Primitive.span,
|
|
9184
|
-
{
|
|
9185
|
-
"data-state": getState(context.checked),
|
|
9186
|
-
"data-disabled": context.disabled ? "" : void 0,
|
|
9187
|
-
...thumbProps,
|
|
9188
|
-
ref: forwardedRef
|
|
9189
|
-
}
|
|
9190
|
-
);
|
|
9191
|
-
}
|
|
9192
|
-
);
|
|
9193
|
-
SwitchThumb$1.displayName = THUMB_NAME;
|
|
9194
|
-
var BubbleInput = (props) => {
|
|
9195
|
-
const { control, checked, bubbles = true, ...inputProps } = props;
|
|
9196
|
-
const ref = React.useRef(null);
|
|
9197
|
-
const prevChecked = usePrevious(checked);
|
|
9198
|
-
const controlSize = useSize(control);
|
|
9199
|
-
React.useEffect(() => {
|
|
9200
|
-
const input = ref.current;
|
|
9201
|
-
const inputProto = window.HTMLInputElement.prototype;
|
|
9202
|
-
const descriptor = Object.getOwnPropertyDescriptor(inputProto, "checked");
|
|
9203
|
-
const setChecked = descriptor.set;
|
|
9204
|
-
if (prevChecked !== checked && setChecked) {
|
|
9205
|
-
const event = new Event("click", { bubbles });
|
|
9206
|
-
setChecked.call(input, checked);
|
|
9207
|
-
input.dispatchEvent(event);
|
|
9208
|
-
}
|
|
9209
|
-
}, [prevChecked, checked, bubbles]);
|
|
9210
|
-
return /* @__PURE__ */ jsx(
|
|
9211
|
-
"input",
|
|
9212
|
-
{
|
|
9213
|
-
type: "checkbox",
|
|
9214
|
-
"aria-hidden": true,
|
|
9215
|
-
defaultChecked: checked,
|
|
9216
|
-
...inputProps,
|
|
9217
|
-
tabIndex: -1,
|
|
9218
|
-
ref,
|
|
9219
|
-
style: {
|
|
9220
|
-
...props.style,
|
|
9221
|
-
...controlSize,
|
|
9222
|
-
position: "absolute",
|
|
9223
|
-
pointerEvents: "none",
|
|
9224
|
-
opacity: 0,
|
|
9225
|
-
margin: 0
|
|
9226
|
-
}
|
|
9227
|
-
}
|
|
9228
|
-
);
|
|
9229
|
-
};
|
|
9230
|
-
function getState(checked) {
|
|
9231
|
-
return checked ? "checked" : "unchecked";
|
|
9232
|
-
}
|
|
9233
|
-
var Root3 = Switch$1;
|
|
9234
|
-
var Thumb = SwitchThumb$1;
|
|
9235
8884
|
const SwitchContext = createContext({});
|
|
9236
8885
|
const switchRoot = cva(
|
|
9237
8886
|
[
|
|
@@ -9293,7 +8942,7 @@ const SwitchRoot = memo(
|
|
|
9293
8942
|
const providerContext = useProvider();
|
|
9294
8943
|
const { className, size: size2 = "md", children, accentColor = providerContext.accentColor, ...rest } = props;
|
|
9295
8944
|
return /* @__PURE__ */ jsx(
|
|
9296
|
-
|
|
8945
|
+
RadixSwitch.Root,
|
|
9297
8946
|
{
|
|
9298
8947
|
className: cx(className, switchRoot({ size: size2 })),
|
|
9299
8948
|
ref,
|
|
@@ -9308,7 +8957,7 @@ const SwitchThumb = memo(
|
|
|
9308
8957
|
forwardRef((props, ref) => {
|
|
9309
8958
|
const { className, ...rest } = props;
|
|
9310
8959
|
const { size: size2 } = useContext(SwitchContext);
|
|
9311
|
-
return /* @__PURE__ */ jsx(Thumb, { className: cx(className, switchThumb({ size: size2 })), ref, ...rest });
|
|
8960
|
+
return /* @__PURE__ */ jsx(RadixSwitch.Thumb, { className: cx(className, switchThumb({ size: size2 })), ref, ...rest });
|
|
9312
8961
|
})
|
|
9313
8962
|
);
|
|
9314
8963
|
const Switch = {
|
|
@@ -10129,7 +9778,7 @@ export {
|
|
|
10129
9778
|
usePagesContext,
|
|
10130
9779
|
useProvider,
|
|
10131
9780
|
useSelectedIndicatorContext,
|
|
10132
|
-
useSize
|
|
9781
|
+
useSize,
|
|
10133
9782
|
useStopEventPropagation,
|
|
10134
9783
|
useSubContext,
|
|
10135
9784
|
useTextFilter,
|