@dust-tt/sparkle 0.2.266-rc-2 → 0.2.267-rc-1
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/cjs/index.js +1431 -902
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/Checkbox.d.ts +9 -20
- package/dist/esm/components/Checkbox.d.ts.map +1 -1
- package/dist/esm/components/Checkbox.js +56 -43
- package/dist/esm/components/Checkbox.js.map +1 -1
- package/dist/esm/components/RadioGroup.d.ts +12 -0
- package/dist/esm/components/RadioGroup.d.ts.map +1 -0
- package/dist/esm/components/RadioGroup.js +31 -0
- package/dist/esm/components/RadioGroup.js.map +1 -0
- package/dist/esm/components/index.d.ts +2 -3
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +2 -2
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/stories/Checkbox.stories.d.ts +10 -4
- package/dist/esm/stories/Checkbox.stories.d.ts.map +1 -1
- package/dist/esm/stories/Checkbox.stories.js +51 -20
- package/dist/esm/stories/Checkbox.stories.js.map +1 -1
- package/dist/esm/stories/RadioGroup.stories.d.ts +7 -0
- package/dist/esm/stories/RadioGroup.stories.d.ts.map +1 -0
- package/dist/esm/stories/RadioGroup.stories.js +30 -0
- package/dist/esm/stories/RadioGroup.stories.js.map +1 -0
- package/dist/esm/stories/Tree.stories.d.ts.map +1 -1
- package/dist/esm/stories/Tree.stories.js +76 -37
- package/dist/esm/stories/Tree.stories.js.map +1 -1
- package/dist/sparkle.css +84 -111
- package/package.json +2 -2
- package/src/components/Checkbox.tsx +103 -87
- package/src/components/RadioGroup.tsx +69 -0
- package/src/components/index.ts +2 -7
- package/src/stories/Checkbox.stories.tsx +92 -38
- package/src/stories/RadioGroup.stories.tsx +44 -0
- package/src/stories/Tree.stories.tsx +76 -37
- package/dist/esm/components/RadioButton.d.ts +0 -15
- package/dist/esm/components/RadioButton.d.ts.map +0 -1
- package/dist/esm/components/RadioButton.js +0 -26
- package/dist/esm/components/RadioButton.js.map +0 -1
- package/dist/esm/stories/RadioButton.stories.d.ts +0 -9
- package/dist/esm/stories/RadioButton.stories.d.ts.map +0 -1
- package/dist/esm/stories/RadioButton.stories.js +0 -57
- package/dist/esm/stories/RadioButton.stories.js.map +0 -1
- package/src/components/RadioButton.tsx +0 -83
- package/src/stories/RadioButton.stories.tsx +0 -81
package/dist/cjs/index.js
CHANGED
|
@@ -43055,7 +43055,7 @@ function useComposedRefs$4(...refs) {
|
|
|
43055
43055
|
}
|
|
43056
43056
|
|
|
43057
43057
|
// packages/react/context/src/createContext.tsx
|
|
43058
|
-
function createContextScope$
|
|
43058
|
+
function createContextScope$b(scopeName, createContextScopeDeps = []) {
|
|
43059
43059
|
let defaultContexts = [];
|
|
43060
43060
|
function createContext3(rootComponentName, defaultContext) {
|
|
43061
43061
|
const BaseContext = React__namespace.createContext(defaultContext);
|
|
@@ -43090,9 +43090,9 @@ function createContextScope$9(scopeName, createContextScopeDeps = []) {
|
|
|
43090
43090
|
};
|
|
43091
43091
|
};
|
|
43092
43092
|
createScope.scopeName = scopeName;
|
|
43093
|
-
return [createContext3, composeContextScopes$
|
|
43093
|
+
return [createContext3, composeContextScopes$b(createScope, ...createContextScopeDeps)];
|
|
43094
43094
|
}
|
|
43095
|
-
function composeContextScopes$
|
|
43095
|
+
function composeContextScopes$b(...scopes) {
|
|
43096
43096
|
const baseScope = scopes[0];
|
|
43097
43097
|
if (scopes.length === 1) return baseScope;
|
|
43098
43098
|
const createScope = () => {
|
|
@@ -74374,12 +74374,12 @@ var useLayoutEffect2$5 = Boolean(globalThis?.document) ? React__namespace.useLay
|
|
|
74374
74374
|
};
|
|
74375
74375
|
|
|
74376
74376
|
// packages/react/id/src/id.tsx
|
|
74377
|
-
var useReactId$
|
|
74378
|
-
var count$
|
|
74379
|
-
function useId$
|
|
74380
|
-
const [id, setId] = React__namespace.useState(useReactId$
|
|
74377
|
+
var useReactId$4 = React__namespace["useId".toString()] || (() => void 0);
|
|
74378
|
+
var count$7 = 0;
|
|
74379
|
+
function useId$4(deterministicId) {
|
|
74380
|
+
const [id, setId] = React__namespace.useState(useReactId$4());
|
|
74381
74381
|
useLayoutEffect2$5(() => {
|
|
74382
|
-
if (!deterministicId) setId((reactId) => reactId ?? String(count$
|
|
74382
|
+
if (!deterministicId) setId((reactId) => reactId ?? String(count$7++));
|
|
74383
74383
|
}, [deterministicId]);
|
|
74384
74384
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
74385
74385
|
}
|
|
@@ -76354,7 +76354,7 @@ Arrow$5.displayName = NAME$5;
|
|
|
76354
76354
|
var Root$7 = Arrow$5;
|
|
76355
76355
|
|
|
76356
76356
|
// packages/react/context/src/createContext.tsx
|
|
76357
|
-
function createContextScope$
|
|
76357
|
+
function createContextScope$a(scopeName, createContextScopeDeps = []) {
|
|
76358
76358
|
let defaultContexts = [];
|
|
76359
76359
|
function createContext3(rootComponentName, defaultContext) {
|
|
76360
76360
|
const BaseContext = React__namespace.createContext(defaultContext);
|
|
@@ -76389,9 +76389,9 @@ function createContextScope$8(scopeName, createContextScopeDeps = []) {
|
|
|
76389
76389
|
};
|
|
76390
76390
|
};
|
|
76391
76391
|
createScope.scopeName = scopeName;
|
|
76392
|
-
return [createContext3, composeContextScopes$
|
|
76392
|
+
return [createContext3, composeContextScopes$a(createScope, ...createContextScopeDeps)];
|
|
76393
76393
|
}
|
|
76394
|
-
function composeContextScopes$
|
|
76394
|
+
function composeContextScopes$a(...scopes) {
|
|
76395
76395
|
const baseScope = scopes[0];
|
|
76396
76396
|
if (scopes.length === 1) return baseScope;
|
|
76397
76397
|
const createScope = () => {
|
|
@@ -76449,7 +76449,7 @@ function useSize$3(element) {
|
|
|
76449
76449
|
}
|
|
76450
76450
|
|
|
76451
76451
|
var POPPER_NAME$2 = "Popper";
|
|
76452
|
-
var [createPopperContext$2, createPopperScope$2] = createContextScope$
|
|
76452
|
+
var [createPopperContext$2, createPopperScope$2] = createContextScope$a(POPPER_NAME$2);
|
|
76453
76453
|
var [PopperProvider$2, usePopperContext$2] = createPopperContext$2(POPPER_NAME$2);
|
|
76454
76454
|
var Popper$2 = (props) => {
|
|
76455
76455
|
const { __scopePopper, children } = props;
|
|
@@ -76708,7 +76708,7 @@ function getSideAndAlignFromPlacement$2(placement) {
|
|
|
76708
76708
|
const [side, align = "center"] = placement.split("-");
|
|
76709
76709
|
return [side, align];
|
|
76710
76710
|
}
|
|
76711
|
-
var Root2$
|
|
76711
|
+
var Root2$5 = Popper$2;
|
|
76712
76712
|
var Anchor$2 = PopperAnchor$2;
|
|
76713
76713
|
var Content$2 = PopperContent$2;
|
|
76714
76714
|
var Arrow$4 = PopperArrow$2;
|
|
@@ -76929,7 +76929,7 @@ var VisuallyHidden = React__namespace.forwardRef(
|
|
|
76929
76929
|
VisuallyHidden.displayName = NAME$4;
|
|
76930
76930
|
var Root$6 = VisuallyHidden;
|
|
76931
76931
|
|
|
76932
|
-
var [createTooltipContext, createTooltipScope] = createContextScope$
|
|
76932
|
+
var [createTooltipContext, createTooltipScope] = createContextScope$b("Tooltip", [
|
|
76933
76933
|
createPopperScope$2
|
|
76934
76934
|
]);
|
|
76935
76935
|
var usePopperScope$2 = createPopperScope$2();
|
|
@@ -76994,7 +76994,7 @@ var Tooltip$1 = (props) => {
|
|
|
76994
76994
|
const providerContext = useTooltipProviderContext(TOOLTIP_NAME, props.__scopeTooltip);
|
|
76995
76995
|
const popperScope = usePopperScope$2(__scopeTooltip);
|
|
76996
76996
|
const [trigger, setTrigger] = React__namespace.useState(null);
|
|
76997
|
-
const contentId = useId$
|
|
76997
|
+
const contentId = useId$4();
|
|
76998
76998
|
const openTimerRef = React__namespace.useRef(0);
|
|
76999
76999
|
const disableHoverableContent = disableHoverableContentProp ?? providerContext.disableHoverableContent;
|
|
77000
77000
|
const delayDuration = delayDurationProp ?? providerContext.delayDuration;
|
|
@@ -77034,7 +77034,7 @@ var Tooltip$1 = (props) => {
|
|
|
77034
77034
|
React__namespace.useEffect(() => {
|
|
77035
77035
|
return () => window.clearTimeout(openTimerRef.current);
|
|
77036
77036
|
}, []);
|
|
77037
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Root2$
|
|
77037
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Root2$5, { ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
77038
77038
|
TooltipContextProvider,
|
|
77039
77039
|
{
|
|
77040
77040
|
scope: __scopeTooltip,
|
|
@@ -77931,7 +77931,7 @@ var iconClasses$4 = {
|
|
|
77931
77931
|
link: "s-text-brand group-hover/item:s-text-action-400 group-active/item:s-text-action-700 dark:group-hover/item:s-text-action-600-dark dark:group-active/item:s-text-action-400-dark",
|
|
77932
77932
|
warning: "s-text-warning-400 group-hover/item:s-text-warning-300 group-active/item:s-text-warning-700 dark:group-hover/item:s-text-warning-600-dark dark:group-active/item:s-text-warning-400-dark",
|
|
77933
77933
|
};
|
|
77934
|
-
function Item$
|
|
77934
|
+
function Item$2(_a) {
|
|
77935
77935
|
var label = _a.label, description = _a.description, visual = _a.visual, icon = _a.icon, _b = _a.style, style = _b === void 0 ? "action" : _b, _c = _a.spacing, spacing = _c === void 0 ? "sm" : _c, _d = _a.action, action = _d === void 0 ? ChevronRightIcon : _d, _e = _a.hasAction, hasAction = _e === void 0 ? true : _e, onClick = _a.onClick, _f = _a.selected, selected = _f === void 0 ? false : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.className, className = _h === void 0 ? "" : _h, link = _a.link;
|
|
77936
77936
|
var components = React.useContext(SparkleContext).components;
|
|
77937
77937
|
var _j = link || {}, href = _j.href, target = _j.target;
|
|
@@ -77969,42 +77969,42 @@ function Item$1(_a) {
|
|
|
77969
77969
|
: classNames("s-text-element-600 group-hover/item:s-text-action-400 group-active/item:s-text-action-700 dark:group-hover/item:s-text-action-600-dark dark:group-active/item:s-text-action-400-dark", hasAction ? "group-hover/item:s-opacity-100" : ""))
|
|
77970
77970
|
: "s-hidden", size: "sm" })));
|
|
77971
77971
|
}
|
|
77972
|
-
Item$
|
|
77973
|
-
return React.createElement(Item$
|
|
77972
|
+
Item$2.Entry = function (props) {
|
|
77973
|
+
return React.createElement(Item$2, __assign({}, props, { spacing: "sm", style: "item", hasAction: "hover" }));
|
|
77974
77974
|
};
|
|
77975
|
-
Item$
|
|
77975
|
+
Item$2.Avatar = function (_a) {
|
|
77976
77976
|
var description = _a.description, _b = _a.hasAction, hasAction = _b === void 0 ? false : _b, otherProps = __rest(_a, ["description", "hasAction"]);
|
|
77977
|
-
return (React.createElement(Item$
|
|
77977
|
+
return (React.createElement(Item$2, __assign({}, otherProps, { style: "action", spacing: description ? "md" : "sm", description: description, hasAction: hasAction })));
|
|
77978
77978
|
};
|
|
77979
|
-
Item$
|
|
77980
|
-
return React.createElement(Item$
|
|
77979
|
+
Item$2.Navigation = function (props) {
|
|
77980
|
+
return React.createElement(Item$2, __assign({}, props, { style: "action", spacing: "md" }));
|
|
77981
77981
|
};
|
|
77982
|
-
Item$
|
|
77982
|
+
Item$2.Link = function (_a) {
|
|
77983
77983
|
var props = __rest(_a, []);
|
|
77984
|
-
return (React.createElement(Item$
|
|
77984
|
+
return (React.createElement(Item$2, __assign({}, props, {
|
|
77985
77985
|
// Pass down additional props as needed
|
|
77986
77986
|
style: "link", hasAction: false, spacing: "lg" })));
|
|
77987
77987
|
};
|
|
77988
|
-
Item$
|
|
77988
|
+
Item$2.Dropdown = function (_a) {
|
|
77989
77989
|
var style = _a.style, props = __rest(_a, ["style"]);
|
|
77990
|
-
return (React.createElement(Item$
|
|
77990
|
+
return (React.createElement(Item$2, __assign({}, props, {
|
|
77991
77991
|
// Pass down additional props as needed
|
|
77992
77992
|
style: style === "default" ? "action" : "warning", hasAction: false })));
|
|
77993
77993
|
};
|
|
77994
|
-
Item$
|
|
77994
|
+
Item$2.SectionHeader = function (_a) {
|
|
77995
77995
|
var label = _a.label, _b = _a.variant, variant = _b === void 0 ? "primary" : _b, _c = _a.className, className = _c === void 0 ? "" : _c;
|
|
77996
77996
|
return (React.createElement("div", { className: classNames(className, variant === "primary"
|
|
77997
77997
|
? "s-text-element-800 dark:s-text-element-800-dark"
|
|
77998
77998
|
: "s-text-element-600 dark:s-text-element-600-dark", "s-pb-2 s-pt-6 s-text-xs s-font-medium s-uppercase") }, label));
|
|
77999
77999
|
};
|
|
78000
|
-
Item$
|
|
78000
|
+
Item$2.List = function (_a) {
|
|
78001
78001
|
var children = _a.children, className = _a.className;
|
|
78002
78002
|
return (React.createElement("div", { className: classNames(className ? className : "", "s-flex") },
|
|
78003
78003
|
React.createElement("div", { className: "s-flex s-w-full s-flex-col" }, children)));
|
|
78004
78004
|
};
|
|
78005
78005
|
|
|
78006
78006
|
var ButtonRefContext = React.createContext(null);
|
|
78007
|
-
var labelClasses
|
|
78007
|
+
var labelClasses = {
|
|
78008
78008
|
base: "s-text-element-900 s-inline-flex s-transition-colors s-ease-out s-duration-400 s-box-border s-gap-x-2 s-select-none",
|
|
78009
78009
|
hover: "group-hover/dm:s-text-action-500",
|
|
78010
78010
|
active: "active:s-text-action-700",
|
|
@@ -78050,7 +78050,7 @@ function DropdownMenu$1(_a) {
|
|
|
78050
78050
|
DropdownMenu$1.Button = React.forwardRef(function DropdownMenuButton(_a, forwardedRef) {
|
|
78051
78051
|
var label = _a.label, _b = _a.type, type = _b === void 0 ? "menu" : _b, _c = _a.size, size = _c === void 0 ? "sm" : _c, tooltip = _a.tooltip, icon = _a.icon, children = _a.children, _d = _a.tooltipPosition, tooltipPosition = _d === void 0 ? "top" : _d, _e = _a.className, className = _e === void 0 ? "" : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, onClick = _a.onClick;
|
|
78052
78052
|
var contextRef = React.useContext(ButtonRefContext);
|
|
78053
|
-
var finalLabelClasses = classNames(labelClasses
|
|
78053
|
+
var finalLabelClasses = classNames(labelClasses.base, labelSizeClasses[size], labelClasses.dark.base, !disabled ? labelClasses.active : "", !disabled ? labelClasses.dark.active : "", !disabled ? labelClasses.hover : "", !disabled ? labelClasses.dark.hover : "", disabled ? labelClasses.disabled : "");
|
|
78054
78054
|
var finalIconClasses = classNames(iconClasses$3.base, iconClasses$3.dark.base, !disabled ? iconClasses$3.hover : "", !disabled ? iconClasses$3.dark.hover : "", disabled ? iconClasses$3.disabled : "");
|
|
78055
78055
|
var finalChevronClasses = classNames(chevronClasses.base, !disabled ? chevronClasses.hover : "", chevronClasses.dark.base, !disabled ? chevronClasses.dark.hover : "", disabled ? chevronClasses.disabled : "");
|
|
78056
78056
|
var aggregatedRef = function (value) {
|
|
@@ -78099,7 +78099,7 @@ DropdownMenu$1.Item = function (_a) {
|
|
|
78099
78099
|
// need to use as="div" -- otherwise we get a "forwardRef" error in the console
|
|
78100
78100
|
React.createElement(qe$1.Item, { disabled: disabled, as: "div" }, hasChildren ? (React.createElement(DropdownMenu$1, { className: "s-w-full s-gap-x-2 s-py-2" },
|
|
78101
78101
|
React.createElement(DropdownMenu$1.Button, { className: "s-w-full", disabled: disabled, label: label, type: "submenu" }),
|
|
78102
|
-
children)) : (React.createElement(Item$
|
|
78102
|
+
children)) : (React.createElement(Item$2.Dropdown, { className: "s-w-full", description: description, disabled: disabled, link: link, icon: icon, label: label, onClick: onClick, selected: selected, style: variant, visual: visual }))));
|
|
78103
78103
|
};
|
|
78104
78104
|
DropdownMenu$1.SectionHeader = function (_a) {
|
|
78105
78105
|
var label = _a.label;
|
|
@@ -78188,7 +78188,7 @@ DropdownMenu$1.Items = function (_a) {
|
|
|
78188
78188
|
React.createElement(qe$1.Items, { onKeyDown: onKeyDown, className: classNames("s-absolute s-z-10", getOriginClass(origin), "s-rounded-xl s-border s-border-structure-100 s-bg-structure-0 s-shadow-lg focus:s-outline-none dark:s-border-structure-100-dark dark:s-bg-structure-0-dark"), onClick: function (e) { return e.stopPropagation(); }, style: styleInsert(origin, marginLeft) },
|
|
78189
78189
|
topBar,
|
|
78190
78190
|
React.createElement("div", { className: classNames(classNamesForVariant(variant, hasDropdownItem), getOverflowClass(overflow)) },
|
|
78191
|
-
React.createElement(Item$
|
|
78191
|
+
React.createElement(Item$2.List, null, children)),
|
|
78192
78192
|
bottomBar)));
|
|
78193
78193
|
};
|
|
78194
78194
|
function findOriginFromButton(buttonRef) {
|
|
@@ -78814,511 +78814,62 @@ function truncateWithTooltip(text, length) {
|
|
|
78814
78814
|
return text.length > length ? (React.createElement(Tooltip, { trigger: "".concat(text.substring(0, length - 1)).concat(ELLIPSIS_STRING), label: text })) : (text);
|
|
78815
78815
|
}
|
|
78816
78816
|
|
|
78817
|
-
|
|
78818
|
-
|
|
78819
|
-
|
|
78820
|
-
|
|
78821
|
-
|
|
78822
|
-
|
|
78823
|
-
|
|
78824
|
-
|
|
78825
|
-
|
|
78826
|
-
|
|
78827
|
-
|
|
78828
|
-
|
|
78829
|
-
|
|
78830
|
-
|
|
78831
|
-
|
|
78832
|
-
|
|
78833
|
-
|
|
78834
|
-
|
|
78835
|
-
|
|
78836
|
-
const BaseContext = React__namespace.createContext(defaultContext);
|
|
78837
|
-
const index = defaultContexts.length;
|
|
78838
|
-
defaultContexts = [...defaultContexts, defaultContext];
|
|
78839
|
-
const Provider = (props) => {
|
|
78840
|
-
const { scope, children, ...context } = props;
|
|
78841
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
78842
|
-
const value = React__namespace.useMemo(() => context, Object.values(context));
|
|
78843
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
|
|
78844
|
-
};
|
|
78845
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
78846
|
-
function useContext2(consumerName, scope) {
|
|
78847
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
78848
|
-
const context = React__namespace.useContext(Context);
|
|
78849
|
-
if (context) return context;
|
|
78850
|
-
if (defaultContext !== void 0) return defaultContext;
|
|
78851
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
78817
|
+
function Checkbox(_a) {
|
|
78818
|
+
var _b = _a.variant, variant = _b === void 0 ? "selectable" : _b, _c = _a.checked, checked = _c === void 0 ? "unchecked" : _c, _d = _a.size, size = _d === void 0 ? "sm" : _d, onChange = _a.onChange, _e = _a.className, className = _e === void 0 ? "" : _e, disabled = _a.disabled;
|
|
78819
|
+
var isChecked;
|
|
78820
|
+
var isPartialChecked;
|
|
78821
|
+
switch (checked) {
|
|
78822
|
+
case "checked":
|
|
78823
|
+
isChecked = true;
|
|
78824
|
+
isPartialChecked = false;
|
|
78825
|
+
break;
|
|
78826
|
+
case "unchecked":
|
|
78827
|
+
isChecked = false;
|
|
78828
|
+
isPartialChecked = false;
|
|
78829
|
+
break;
|
|
78830
|
+
case "partial":
|
|
78831
|
+
isChecked = true;
|
|
78832
|
+
isPartialChecked = true;
|
|
78833
|
+
break;
|
|
78834
|
+
default:
|
|
78835
|
+
throw new Error("Invalid checked prop");
|
|
78852
78836
|
}
|
|
78853
|
-
|
|
78854
|
-
|
|
78855
|
-
|
|
78856
|
-
|
|
78857
|
-
|
|
78858
|
-
|
|
78859
|
-
|
|
78860
|
-
|
|
78861
|
-
|
|
78862
|
-
|
|
78863
|
-
[scope, contexts]
|
|
78864
|
-
);
|
|
78837
|
+
var baseStyleClasses = {
|
|
78838
|
+
base: "s-border s-justify-center s-flex s-items-center s-transition-colors s-duration-300 s-ease-out",
|
|
78839
|
+
idle: "s-bg-structure-50 s-border-element-600 s-cursor-pointer",
|
|
78840
|
+
hover: "hover:s-border-action-500 hover:s-bg-action-200 hover:s-text-white/100",
|
|
78841
|
+
disabled: "s-bg-structure-0 s-border-structure-300 s-cursor-default",
|
|
78842
|
+
dark: {
|
|
78843
|
+
base: "dark:s-bg-structure-50-dark dark:s-border-element-500-dark",
|
|
78844
|
+
hover: "dark:hover:s-border-action-500-dark dark:hover:s-bg-action-200-dark",
|
|
78845
|
+
disabled: "dark:s-bg-structure-0-dark dark:s-border-structure-300-dark s-cursor-default",
|
|
78846
|
+
},
|
|
78865
78847
|
};
|
|
78866
|
-
|
|
78867
|
-
|
|
78868
|
-
|
|
78869
|
-
}
|
|
78870
|
-
function composeContextScopes$7(...scopes) {
|
|
78871
|
-
const baseScope = scopes[0];
|
|
78872
|
-
if (scopes.length === 1) return baseScope;
|
|
78873
|
-
const createScope = () => {
|
|
78874
|
-
const scopeHooks = scopes.map((createScope2) => ({
|
|
78875
|
-
useScope: createScope2(),
|
|
78876
|
-
scopeName: createScope2.scopeName
|
|
78877
|
-
}));
|
|
78878
|
-
return function useComposedScopes(overrideScopes) {
|
|
78879
|
-
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
78880
|
-
const scopeProps = useScope(overrideScopes);
|
|
78881
|
-
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
78882
|
-
return { ...nextScopes2, ...currentScope };
|
|
78883
|
-
}, {});
|
|
78884
|
-
return React__namespace.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
78848
|
+
var baseSizeClasses = {
|
|
78849
|
+
xs: "s-w-4 s-h-4 s-rounded",
|
|
78850
|
+
sm: "s-w-5 s-h-5 s-rounded-md",
|
|
78885
78851
|
};
|
|
78886
|
-
|
|
78887
|
-
|
|
78888
|
-
|
|
78889
|
-
|
|
78890
|
-
|
|
78891
|
-
|
|
78892
|
-
function composeEventHandlers$3(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
78893
|
-
return function handleEvent(event) {
|
|
78894
|
-
originalEventHandler?.(event);
|
|
78895
|
-
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
78896
|
-
return ourEventHandler?.(event);
|
|
78897
|
-
}
|
|
78898
|
-
};
|
|
78899
|
-
}
|
|
78900
|
-
|
|
78901
|
-
// packages/react/use-callback-ref/src/useCallbackRef.tsx
|
|
78902
|
-
function useCallbackRef$4(callback) {
|
|
78903
|
-
const callbackRef = React__namespace.useRef(callback);
|
|
78904
|
-
React__namespace.useEffect(() => {
|
|
78905
|
-
callbackRef.current = callback;
|
|
78906
|
-
});
|
|
78907
|
-
return React__namespace.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
78908
|
-
}
|
|
78909
|
-
|
|
78910
|
-
// packages/react/use-controllable-state/src/useControllableState.tsx
|
|
78911
|
-
function useControllableState$3({
|
|
78912
|
-
prop,
|
|
78913
|
-
defaultProp,
|
|
78914
|
-
onChange = () => {
|
|
78915
|
-
}
|
|
78916
|
-
}) {
|
|
78917
|
-
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState$3({ defaultProp, onChange });
|
|
78918
|
-
const isControlled = prop !== void 0;
|
|
78919
|
-
const value = isControlled ? prop : uncontrolledProp;
|
|
78920
|
-
const handleChange = useCallbackRef$4(onChange);
|
|
78921
|
-
const setValue = React__namespace.useCallback(
|
|
78922
|
-
(nextValue) => {
|
|
78923
|
-
if (isControlled) {
|
|
78924
|
-
const setter = nextValue;
|
|
78925
|
-
const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
|
|
78926
|
-
if (value2 !== prop) handleChange(value2);
|
|
78927
|
-
} else {
|
|
78928
|
-
setUncontrolledProp(nextValue);
|
|
78929
|
-
}
|
|
78930
|
-
},
|
|
78931
|
-
[isControlled, prop, setUncontrolledProp, handleChange]
|
|
78932
|
-
);
|
|
78933
|
-
return [value, setValue];
|
|
78934
|
-
}
|
|
78935
|
-
function useUncontrolledState$3({
|
|
78936
|
-
defaultProp,
|
|
78937
|
-
onChange
|
|
78938
|
-
}) {
|
|
78939
|
-
const uncontrolledState = React__namespace.useState(defaultProp);
|
|
78940
|
-
const [value] = uncontrolledState;
|
|
78941
|
-
const prevValueRef = React__namespace.useRef(value);
|
|
78942
|
-
const handleChange = useCallbackRef$4(onChange);
|
|
78943
|
-
React__namespace.useEffect(() => {
|
|
78944
|
-
if (prevValueRef.current !== value) {
|
|
78945
|
-
handleChange(value);
|
|
78946
|
-
prevValueRef.current = value;
|
|
78947
|
-
}
|
|
78948
|
-
}, [value, prevValueRef, handleChange]);
|
|
78949
|
-
return uncontrolledState;
|
|
78950
|
-
}
|
|
78951
|
-
|
|
78952
|
-
// packages/react/use-previous/src/usePrevious.tsx
|
|
78953
|
-
function usePrevious(value) {
|
|
78954
|
-
const ref = React__namespace.useRef({ value, previous: value });
|
|
78955
|
-
return React__namespace.useMemo(() => {
|
|
78956
|
-
if (ref.current.value !== value) {
|
|
78957
|
-
ref.current.previous = ref.current.value;
|
|
78958
|
-
ref.current.value = value;
|
|
78959
|
-
}
|
|
78960
|
-
return ref.current.previous;
|
|
78961
|
-
}, [value]);
|
|
78962
|
-
}
|
|
78963
|
-
|
|
78964
|
-
// packages/react/use-layout-effect/src/useLayoutEffect.tsx
|
|
78965
|
-
var useLayoutEffect2$3 = Boolean(globalThis?.document) ? React__namespace.useLayoutEffect : () => {
|
|
78966
|
-
};
|
|
78967
|
-
|
|
78968
|
-
// packages/react/use-size/src/useSize.tsx
|
|
78969
|
-
function useSize$2(element) {
|
|
78970
|
-
const [size, setSize] = React__namespace.useState(void 0);
|
|
78971
|
-
useLayoutEffect2$3(() => {
|
|
78972
|
-
if (element) {
|
|
78973
|
-
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
78974
|
-
const resizeObserver = new ResizeObserver((entries) => {
|
|
78975
|
-
if (!Array.isArray(entries)) {
|
|
78976
|
-
return;
|
|
78977
|
-
}
|
|
78978
|
-
if (!entries.length) {
|
|
78979
|
-
return;
|
|
78980
|
-
}
|
|
78981
|
-
const entry = entries[0];
|
|
78982
|
-
let width;
|
|
78983
|
-
let height;
|
|
78984
|
-
if ("borderBoxSize" in entry) {
|
|
78985
|
-
const borderSizeEntry = entry["borderBoxSize"];
|
|
78986
|
-
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
|
78987
|
-
width = borderSize["inlineSize"];
|
|
78988
|
-
height = borderSize["blockSize"];
|
|
78989
|
-
} else {
|
|
78990
|
-
width = element.offsetWidth;
|
|
78991
|
-
height = element.offsetHeight;
|
|
78992
|
-
}
|
|
78993
|
-
setSize({ width, height });
|
|
78994
|
-
});
|
|
78995
|
-
resizeObserver.observe(element, { box: "border-box" });
|
|
78996
|
-
return () => resizeObserver.unobserve(element);
|
|
78997
|
-
} else {
|
|
78998
|
-
setSize(void 0);
|
|
78999
|
-
}
|
|
79000
|
-
}, [element]);
|
|
79001
|
-
return size;
|
|
79002
|
-
}
|
|
79003
|
-
|
|
79004
|
-
// packages/react/primitive/src/Primitive.tsx
|
|
79005
|
-
var NODES$5 = [
|
|
79006
|
-
"a",
|
|
79007
|
-
"button",
|
|
79008
|
-
"div",
|
|
79009
|
-
"form",
|
|
79010
|
-
"h2",
|
|
79011
|
-
"h3",
|
|
79012
|
-
"img",
|
|
79013
|
-
"input",
|
|
79014
|
-
"label",
|
|
79015
|
-
"li",
|
|
79016
|
-
"nav",
|
|
79017
|
-
"ol",
|
|
79018
|
-
"p",
|
|
79019
|
-
"span",
|
|
79020
|
-
"svg",
|
|
79021
|
-
"ul"
|
|
79022
|
-
];
|
|
79023
|
-
var Primitive$5 = NODES$5.reduce((primitive, node) => {
|
|
79024
|
-
const Node = React__namespace.forwardRef((props, forwardedRef) => {
|
|
79025
|
-
const { asChild, ...primitiveProps } = props;
|
|
79026
|
-
const Comp = asChild ? Slot : node;
|
|
79027
|
-
if (typeof window !== "undefined") {
|
|
79028
|
-
window[Symbol.for("radix-ui")] = true;
|
|
79029
|
-
}
|
|
79030
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
79031
|
-
});
|
|
79032
|
-
Node.displayName = `Primitive.${node}`;
|
|
79033
|
-
return { ...primitive, [node]: Node };
|
|
79034
|
-
}, {});
|
|
79035
|
-
|
|
79036
|
-
var CHECKBOX_NAME = "Checkbox";
|
|
79037
|
-
var [createCheckboxContext, createCheckboxScope] = createContextScope$7(CHECKBOX_NAME);
|
|
79038
|
-
var [CheckboxProvider, useCheckboxContext] = createCheckboxContext(CHECKBOX_NAME);
|
|
79039
|
-
var Checkbox$1 = React__namespace.forwardRef(
|
|
79040
|
-
(props, forwardedRef) => {
|
|
79041
|
-
const {
|
|
79042
|
-
__scopeCheckbox,
|
|
79043
|
-
name,
|
|
79044
|
-
checked: checkedProp,
|
|
79045
|
-
defaultChecked,
|
|
79046
|
-
required,
|
|
79047
|
-
disabled,
|
|
79048
|
-
value = "on",
|
|
79049
|
-
onCheckedChange,
|
|
79050
|
-
form,
|
|
79051
|
-
...checkboxProps
|
|
79052
|
-
} = props;
|
|
79053
|
-
const [button, setButton] = React__namespace.useState(null);
|
|
79054
|
-
const composedRefs = useComposedRefs$2(forwardedRef, (node) => setButton(node));
|
|
79055
|
-
const hasConsumerStoppedPropagationRef = React__namespace.useRef(false);
|
|
79056
|
-
const isFormControl = button ? form || !!button.closest("form") : true;
|
|
79057
|
-
const [checked = false, setChecked] = useControllableState$3({
|
|
79058
|
-
prop: checkedProp,
|
|
79059
|
-
defaultProp: defaultChecked,
|
|
79060
|
-
onChange: onCheckedChange
|
|
79061
|
-
});
|
|
79062
|
-
const initialCheckedStateRef = React__namespace.useRef(checked);
|
|
79063
|
-
React__namespace.useEffect(() => {
|
|
79064
|
-
const form2 = button?.form;
|
|
79065
|
-
if (form2) {
|
|
79066
|
-
const reset = () => setChecked(initialCheckedStateRef.current);
|
|
79067
|
-
form2.addEventListener("reset", reset);
|
|
79068
|
-
return () => form2.removeEventListener("reset", reset);
|
|
79069
|
-
}
|
|
79070
|
-
}, [button, setChecked]);
|
|
79071
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(CheckboxProvider, { scope: __scopeCheckbox, state: checked, disabled, children: [
|
|
79072
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
79073
|
-
Primitive$5.button,
|
|
79074
|
-
{
|
|
79075
|
-
type: "button",
|
|
79076
|
-
role: "checkbox",
|
|
79077
|
-
"aria-checked": isIndeterminate$1(checked) ? "mixed" : checked,
|
|
79078
|
-
"aria-required": required,
|
|
79079
|
-
"data-state": getState$1(checked),
|
|
79080
|
-
"data-disabled": disabled ? "" : void 0,
|
|
79081
|
-
disabled,
|
|
79082
|
-
value,
|
|
79083
|
-
...checkboxProps,
|
|
79084
|
-
ref: composedRefs,
|
|
79085
|
-
onKeyDown: composeEventHandlers$3(props.onKeyDown, (event) => {
|
|
79086
|
-
if (event.key === "Enter") event.preventDefault();
|
|
79087
|
-
}),
|
|
79088
|
-
onClick: composeEventHandlers$3(props.onClick, (event) => {
|
|
79089
|
-
setChecked((prevChecked) => isIndeterminate$1(prevChecked) ? true : !prevChecked);
|
|
79090
|
-
if (isFormControl) {
|
|
79091
|
-
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
|
79092
|
-
if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
|
|
79093
|
-
}
|
|
79094
|
-
})
|
|
79095
|
-
}
|
|
79096
|
-
),
|
|
79097
|
-
isFormControl && /* @__PURE__ */ jsxRuntime.jsx(
|
|
79098
|
-
BubbleInput,
|
|
79099
|
-
{
|
|
79100
|
-
control: button,
|
|
79101
|
-
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
79102
|
-
name,
|
|
79103
|
-
value,
|
|
79104
|
-
checked,
|
|
79105
|
-
required,
|
|
79106
|
-
disabled,
|
|
79107
|
-
form,
|
|
79108
|
-
style: { transform: "translateX(-100%)" },
|
|
79109
|
-
defaultChecked: isIndeterminate$1(defaultChecked) ? false : defaultChecked
|
|
79110
|
-
}
|
|
79111
|
-
)
|
|
79112
|
-
] });
|
|
79113
|
-
}
|
|
79114
|
-
);
|
|
79115
|
-
Checkbox$1.displayName = CHECKBOX_NAME;
|
|
79116
|
-
var INDICATOR_NAME$1 = "CheckboxIndicator";
|
|
79117
|
-
var CheckboxIndicator = React__namespace.forwardRef(
|
|
79118
|
-
(props, forwardedRef) => {
|
|
79119
|
-
const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
|
|
79120
|
-
const context = useCheckboxContext(INDICATOR_NAME$1, __scopeCheckbox);
|
|
79121
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || isIndeterminate$1(context.state) || context.state === true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
79122
|
-
Primitive$5.span,
|
|
79123
|
-
{
|
|
79124
|
-
"data-state": getState$1(context.state),
|
|
79125
|
-
"data-disabled": context.disabled ? "" : void 0,
|
|
79126
|
-
...indicatorProps,
|
|
79127
|
-
ref: forwardedRef,
|
|
79128
|
-
style: { pointerEvents: "none", ...props.style }
|
|
79129
|
-
}
|
|
79130
|
-
) });
|
|
79131
|
-
}
|
|
79132
|
-
);
|
|
79133
|
-
CheckboxIndicator.displayName = INDICATOR_NAME$1;
|
|
79134
|
-
var BubbleInput = (props) => {
|
|
79135
|
-
const { control, checked, bubbles = true, defaultChecked, ...inputProps } = props;
|
|
79136
|
-
const ref = React__namespace.useRef(null);
|
|
79137
|
-
const prevChecked = usePrevious(checked);
|
|
79138
|
-
const controlSize = useSize$2(control);
|
|
79139
|
-
React__namespace.useEffect(() => {
|
|
79140
|
-
const input = ref.current;
|
|
79141
|
-
const inputProto = window.HTMLInputElement.prototype;
|
|
79142
|
-
const descriptor = Object.getOwnPropertyDescriptor(inputProto, "checked");
|
|
79143
|
-
const setChecked = descriptor.set;
|
|
79144
|
-
if (prevChecked !== checked && setChecked) {
|
|
79145
|
-
const event = new Event("click", { bubbles });
|
|
79146
|
-
input.indeterminate = isIndeterminate$1(checked);
|
|
79147
|
-
setChecked.call(input, isIndeterminate$1(checked) ? false : checked);
|
|
79148
|
-
input.dispatchEvent(event);
|
|
79149
|
-
}
|
|
79150
|
-
}, [prevChecked, checked, bubbles]);
|
|
79151
|
-
const defaultCheckedRef = React__namespace.useRef(isIndeterminate$1(checked) ? false : checked);
|
|
79152
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
79153
|
-
"input",
|
|
79154
|
-
{
|
|
79155
|
-
type: "checkbox",
|
|
79156
|
-
"aria-hidden": true,
|
|
79157
|
-
defaultChecked: defaultChecked ?? defaultCheckedRef.current,
|
|
79158
|
-
...inputProps,
|
|
79159
|
-
tabIndex: -1,
|
|
79160
|
-
ref,
|
|
79161
|
-
style: {
|
|
79162
|
-
...props.style,
|
|
79163
|
-
...controlSize,
|
|
79164
|
-
position: "absolute",
|
|
79165
|
-
pointerEvents: "none",
|
|
79166
|
-
opacity: 0,
|
|
79167
|
-
margin: 0
|
|
79168
|
-
}
|
|
79169
|
-
}
|
|
79170
|
-
);
|
|
79171
|
-
};
|
|
79172
|
-
function isIndeterminate$1(checked) {
|
|
79173
|
-
return checked === "indeterminate";
|
|
79174
|
-
}
|
|
79175
|
-
function getState$1(checked) {
|
|
79176
|
-
return isIndeterminate$1(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
79177
|
-
}
|
|
79178
|
-
var Root$5 = Checkbox$1;
|
|
79179
|
-
var Indicator = CheckboxIndicator;
|
|
79180
|
-
|
|
79181
|
-
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
79182
|
-
|
|
79183
|
-
const falsyToString = (value)=>typeof value === "boolean" ? "".concat(value) : value === 0 ? "0" : value;
|
|
79184
|
-
const cx = clsx;
|
|
79185
|
-
const cva = (base, config)=>{
|
|
79186
|
-
return (props)=>{
|
|
79187
|
-
var ref;
|
|
79188
|
-
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
79189
|
-
const { variants , defaultVariants } = config;
|
|
79190
|
-
const getVariantClassNames = Object.keys(variants).map((variant)=>{
|
|
79191
|
-
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
79192
|
-
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
79193
|
-
if (variantProp === null) return null;
|
|
79194
|
-
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
79195
|
-
return variants[variant][variantKey];
|
|
79196
|
-
});
|
|
79197
|
-
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{
|
|
79198
|
-
let [key, value] = param;
|
|
79199
|
-
if (value === undefined) {
|
|
79200
|
-
return acc;
|
|
79201
|
-
}
|
|
79202
|
-
acc[key] = value;
|
|
79203
|
-
return acc;
|
|
79204
|
-
}, {});
|
|
79205
|
-
const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (ref = config.compoundVariants) === null || ref === void 0 ? void 0 : ref.reduce((acc, param1)=>{
|
|
79206
|
-
let { class: cvClass , className: cvClassName , ...compoundVariantOptions } = param1;
|
|
79207
|
-
return Object.entries(compoundVariantOptions).every((param)=>{
|
|
79208
|
-
let [key, value] = param;
|
|
79209
|
-
return Array.isArray(value) ? value.includes({
|
|
79210
|
-
...defaultVariants,
|
|
79211
|
-
...propsWithoutUndefined
|
|
79212
|
-
}[key]) : ({
|
|
79213
|
-
...defaultVariants,
|
|
79214
|
-
...propsWithoutUndefined
|
|
79215
|
-
})[key] === value;
|
|
79216
|
-
}) ? [
|
|
79217
|
-
...acc,
|
|
79218
|
-
cvClass,
|
|
79219
|
-
cvClassName
|
|
79220
|
-
] : acc;
|
|
79221
|
-
}, []);
|
|
79222
|
-
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
78852
|
+
var checkedIndicatorClasses = {
|
|
78853
|
+
base: "s-transition s-duration-300 s-ease-in-out",
|
|
78854
|
+
selected: "s-opacity-100 s-bg-action-500 dark:s-bg-action-500-dark",
|
|
78855
|
+
unselected: "s-opacity-0",
|
|
78856
|
+
partialChecked: "s-opacity-100 s-bg-element-700 dark:s-bg-element-700-dark",
|
|
78857
|
+
disabled: "s-opacity-100 s-bg-element-500 dark:s-bg-element-500-dark",
|
|
79223
78858
|
};
|
|
79224
|
-
|
|
79225
|
-
|
|
79226
|
-
|
|
79227
|
-
|
|
79228
|
-
|
|
79229
|
-
|
|
79230
|
-
|
|
79231
|
-
|
|
79232
|
-
|
|
79233
|
-
|
|
79234
|
-
|
|
79235
|
-
|
|
79236
|
-
|
|
79237
|
-
|
|
79238
|
-
"nav",
|
|
79239
|
-
"ol",
|
|
79240
|
-
"p",
|
|
79241
|
-
"span",
|
|
79242
|
-
"svg",
|
|
79243
|
-
"ul"
|
|
79244
|
-
];
|
|
79245
|
-
var Primitive$4 = NODES$4.reduce((primitive, node) => {
|
|
79246
|
-
const Node = React__namespace.forwardRef((props, forwardedRef) => {
|
|
79247
|
-
const { asChild, ...primitiveProps } = props;
|
|
79248
|
-
const Comp = asChild ? Slot : node;
|
|
79249
|
-
if (typeof window !== "undefined") {
|
|
79250
|
-
window[Symbol.for("radix-ui")] = true;
|
|
79251
|
-
}
|
|
79252
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
79253
|
-
});
|
|
79254
|
-
Node.displayName = `Primitive.${node}`;
|
|
79255
|
-
return { ...primitive, [node]: Node };
|
|
79256
|
-
}, {});
|
|
79257
|
-
|
|
79258
|
-
var NAME$3 = "Label";
|
|
79259
|
-
var Label$2 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
79260
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
79261
|
-
Primitive$4.label,
|
|
79262
|
-
{
|
|
79263
|
-
...props,
|
|
79264
|
-
ref: forwardedRef,
|
|
79265
|
-
onMouseDown: (event) => {
|
|
79266
|
-
const target = event.target;
|
|
79267
|
-
if (target.closest("button, input, select, textarea")) return;
|
|
79268
|
-
props.onMouseDown?.(event);
|
|
79269
|
-
if (!event.defaultPrevented && event.detail > 1) event.preventDefault();
|
|
79270
|
-
}
|
|
79271
|
-
}
|
|
79272
|
-
);
|
|
79273
|
-
});
|
|
79274
|
-
Label$2.displayName = NAME$3;
|
|
79275
|
-
var Root$4 = Label$2;
|
|
79276
|
-
|
|
79277
|
-
var labelVariants = cn("s-text-sm s-text-foreground s-leading-none", "peer-disabled:s-cursor-not-allowed peer-disabled:s-opacity-70");
|
|
79278
|
-
var Label$1 = React__namespace.forwardRef(function (_a, ref) {
|
|
79279
|
-
var className = _a.className, props = __rest(_a, ["className"]);
|
|
79280
|
-
return (React__namespace.createElement(Root$4, __assign({ ref: ref, className: cn(labelVariants, className) }, props)));
|
|
79281
|
-
});
|
|
79282
|
-
Label$1.displayName = Root$4.displayName;
|
|
79283
|
-
|
|
79284
|
-
var checkboxStyles = cva(cn("s-shrink-0 s-peer s-border s-border-primary-500 s-text-foreground", "data-[state=checked]:s-text-white data-[state=checked]:s-text-foreground", "focus-visible:s-ring-ring s-ring-offset-background focus-visible:s-outline-none focus-visible:s-ring-2 focus-visible:s-ring-offset-2", "disabled:s-cursor-not-allowed disabled:s-opacity-50"), {
|
|
79285
|
-
variants: {
|
|
79286
|
-
checked: {
|
|
79287
|
-
true: "data-[state=checked]:s-bg-action-500",
|
|
79288
|
-
partial: "data-[state=checked]:s-bg-element-700",
|
|
79289
|
-
false: "",
|
|
79290
|
-
},
|
|
79291
|
-
size: {
|
|
79292
|
-
xs: "s-h-4 s-w-4 s-rounded",
|
|
79293
|
-
sm: "s-h-5 s-w-5 s-rounded-md",
|
|
79294
|
-
},
|
|
79295
|
-
},
|
|
79296
|
-
defaultVariants: {
|
|
79297
|
-
size: "sm",
|
|
79298
|
-
checked: false,
|
|
79299
|
-
},
|
|
79300
|
-
});
|
|
79301
|
-
var Checkbox = React.forwardRef(function (_a, ref) {
|
|
79302
|
-
var className = _a.className, size = _a.size, checked = _a.checked, props = __rest(_a, ["className", "size", "checked"]);
|
|
79303
|
-
return (React.createElement(Root$5, __assign({ ref: ref, className: cn(checkboxStyles({ checked: checked, size: size }), className), checked: !!checked }, props),
|
|
79304
|
-
React.createElement(Indicator, { className: "s-flex s-items-center s-justify-center s-text-current" },
|
|
79305
|
-
React.createElement("span", { className: cn(size === "xs" ? "-s-mt-px" : "") },
|
|
79306
|
-
React.createElement(Icon, { size: "xs", visual: checked === "partial" ? DashIcon : CheckIcon })))));
|
|
79307
|
-
});
|
|
79308
|
-
Checkbox.displayName = Root$5.displayName;
|
|
79309
|
-
function CheckboxWithText(_a) {
|
|
79310
|
-
var text = _a.text, props = __rest(_a, ["text"]);
|
|
79311
|
-
return (React.createElement("div", { className: "s-items-top s-flex s-items-center s-space-x-2" },
|
|
79312
|
-
React.createElement(Checkbox, __assign({}, props)),
|
|
79313
|
-
React.createElement(Label$1, { className: "s-text-sm s-leading-none peer-disabled:s-cursor-not-allowed peer-disabled:s-opacity-70" }, text)));
|
|
79314
|
-
}
|
|
79315
|
-
function CheckBoxWithTextAndDescription(_a) {
|
|
79316
|
-
var text = _a.text, description = _a.description, props = __rest(_a, ["text", "description"]);
|
|
79317
|
-
return (React.createElement("div", { className: "s-items-top s-flex s-space-x-2" },
|
|
79318
|
-
React.createElement(Checkbox, __assign({}, props)),
|
|
79319
|
-
React.createElement("div", { className: "s-grid s-gap-1.5 s-leading-none" },
|
|
79320
|
-
React.createElement(Label$1, { className: "s-text-sm s-leading-none peer-disabled:s-cursor-not-allowed peer-disabled:s-opacity-70" }, text),
|
|
79321
|
-
React.createElement("p", { className: "s-text-xs s-text-muted-foreground" }, description))));
|
|
78859
|
+
var sizeStyles = {
|
|
78860
|
+
xs: { width: "12px", height: "12px", borderRadius: "2px" },
|
|
78861
|
+
sm: { width: "14px", height: "14px", borderRadius: "3px" },
|
|
78862
|
+
};
|
|
78863
|
+
var combinedBaseClasses = classNames(baseStyleClasses.base, baseSizeClasses[size], isChecked || isPartialChecked ? "s-text-white" : "s-text-white/0", disabled ? baseStyleClasses.disabled : baseStyleClasses.idle, !disabled ? baseStyleClasses.hover : "", disabled ? baseStyleClasses.dark.disabled : baseStyleClasses.dark.base, !disabled ? baseStyleClasses.dark.hover : "", className);
|
|
78864
|
+
var combinedCheckedIndicatorClasses = classNames(checkedIndicatorClasses.base, disabled ? checkedIndicatorClasses.disabled : "", isChecked && !isPartialChecked && !disabled
|
|
78865
|
+
? checkedIndicatorClasses.selected
|
|
78866
|
+
: "", isPartialChecked && !disabled ? checkedIndicatorClasses.partialChecked : "", !isChecked && !disabled ? checkedIndicatorClasses.unselected : "");
|
|
78867
|
+
return (React.createElement("label", null,
|
|
78868
|
+
React.createElement("input", { type: "checkbox", checked: isChecked, onChange: function (e) { return onChange && onChange(e.target.checked); }, className: "s-hidden", disabled: disabled }),
|
|
78869
|
+
React.createElement("div", { className: classNames(combinedBaseClasses, "s-relative") },
|
|
78870
|
+
React.createElement("div", { className: combinedCheckedIndicatorClasses, style: sizeStyles[size] }),
|
|
78871
|
+
variant === "checkable" && (React.createElement("div", { className: "s-absolute" },
|
|
78872
|
+
React.createElement(Icon, { visual: isPartialChecked ? DashIcon : CheckIcon, size: "xs" }))))));
|
|
79322
78873
|
}
|
|
79323
78874
|
|
|
79324
78875
|
var sizeClasses$2 = {
|
|
@@ -107518,7 +107069,7 @@ const unique = (columnId, leafRows) => {
|
|
|
107518
107069
|
const uniqueCount = (columnId, leafRows) => {
|
|
107519
107070
|
return new Set(leafRows.map(d => d.getValue(columnId))).size;
|
|
107520
107071
|
};
|
|
107521
|
-
const count$
|
|
107072
|
+
const count$6 = (_columnId, leafRows) => {
|
|
107522
107073
|
return leafRows.length;
|
|
107523
107074
|
};
|
|
107524
107075
|
const aggregationFns = {
|
|
@@ -107530,7 +107081,7 @@ const aggregationFns = {
|
|
|
107530
107081
|
median,
|
|
107531
107082
|
unique,
|
|
107532
107083
|
uniqueCount,
|
|
107533
|
-
count: count$
|
|
107084
|
+
count: count$6
|
|
107534
107085
|
};
|
|
107535
107086
|
|
|
107536
107087
|
//
|
|
@@ -113890,6 +113441,64 @@ function IconToggleButton(_a) {
|
|
|
113890
113441
|
return tooltip ? (React.createElement(Tooltip, { trigger: IconButtonToggleContent, label: tooltip, side: tooltipPosition })) : (IconButtonToggleContent);
|
|
113891
113442
|
}
|
|
113892
113443
|
|
|
113444
|
+
// packages/react/primitive/src/Primitive.tsx
|
|
113445
|
+
var NODES$5 = [
|
|
113446
|
+
"a",
|
|
113447
|
+
"button",
|
|
113448
|
+
"div",
|
|
113449
|
+
"form",
|
|
113450
|
+
"h2",
|
|
113451
|
+
"h3",
|
|
113452
|
+
"img",
|
|
113453
|
+
"input",
|
|
113454
|
+
"label",
|
|
113455
|
+
"li",
|
|
113456
|
+
"nav",
|
|
113457
|
+
"ol",
|
|
113458
|
+
"p",
|
|
113459
|
+
"span",
|
|
113460
|
+
"svg",
|
|
113461
|
+
"ul"
|
|
113462
|
+
];
|
|
113463
|
+
var Primitive$5 = NODES$5.reduce((primitive, node) => {
|
|
113464
|
+
const Node = React__namespace.forwardRef((props, forwardedRef) => {
|
|
113465
|
+
const { asChild, ...primitiveProps } = props;
|
|
113466
|
+
const Comp = asChild ? Slot : node;
|
|
113467
|
+
if (typeof window !== "undefined") {
|
|
113468
|
+
window[Symbol.for("radix-ui")] = true;
|
|
113469
|
+
}
|
|
113470
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
113471
|
+
});
|
|
113472
|
+
Node.displayName = `Primitive.${node}`;
|
|
113473
|
+
return { ...primitive, [node]: Node };
|
|
113474
|
+
}, {});
|
|
113475
|
+
|
|
113476
|
+
var NAME$3 = "Label";
|
|
113477
|
+
var Label$2 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
113478
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
113479
|
+
Primitive$5.label,
|
|
113480
|
+
{
|
|
113481
|
+
...props,
|
|
113482
|
+
ref: forwardedRef,
|
|
113483
|
+
onMouseDown: (event) => {
|
|
113484
|
+
const target = event.target;
|
|
113485
|
+
if (target.closest("button, input, select, textarea")) return;
|
|
113486
|
+
props.onMouseDown?.(event);
|
|
113487
|
+
if (!event.defaultPrevented && event.detail > 1) event.preventDefault();
|
|
113488
|
+
}
|
|
113489
|
+
}
|
|
113490
|
+
);
|
|
113491
|
+
});
|
|
113492
|
+
Label$2.displayName = NAME$3;
|
|
113493
|
+
var Root$5 = Label$2;
|
|
113494
|
+
|
|
113495
|
+
var labelVariants = cn("s-text-sm s-text-foreground s-leading-none", "peer-disabled:s-cursor-not-allowed peer-disabled:s-opacity-70");
|
|
113496
|
+
var Label$1 = React__namespace.forwardRef(function (_a, ref) {
|
|
113497
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
113498
|
+
return (React__namespace.createElement(Root$5, __assign({ ref: ref, className: cn(labelVariants, className) }, props)));
|
|
113499
|
+
});
|
|
113500
|
+
Label$1.displayName = Root$5.displayName;
|
|
113501
|
+
|
|
113893
113502
|
var inputStyleClasses = cn("s-text-sm s-bg-background s-rounded-xl s-border s-border-border-dark s-flex s-h-9 s-w-full s-px-3 s-py-1.5 ", "file:s-border-0 file:s-bg-transparent file:s-text-sm file:s-font-medium file:s-text-foreground", "placeholder:s-text-muted-foreground", "focus-visible:s-outline-none focus-visible:s-ring-2 focus-visible:s-ring-offset-2 focus-visible:s-ring-ring focus-visible:s-border-primary-400", "disabled:s-cursor-not-allowed disabled:s-opacity-50 disabled:s-text-muted-foreground");
|
|
113894
113503
|
var Input = React.forwardRef(function (_a, ref) {
|
|
113895
113504
|
var className = _a.className, error = _a.error, value = _a.value, label = _a.label, _b = _a.showErrorLabel, showErrorLabel = _b === void 0 ? false : _b, props = __rest(_a, ["className", "error", "value", "label", "showErrorLabel"]);
|
|
@@ -135442,7 +135051,7 @@ function Markdown(_a) {
|
|
|
135442
135051
|
}
|
|
135443
135052
|
|
|
135444
135053
|
// packages/core/primitive/src/primitive.tsx
|
|
135445
|
-
function composeEventHandlers$
|
|
135054
|
+
function composeEventHandlers$3(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
135446
135055
|
return function handleEvent(event) {
|
|
135447
135056
|
originalEventHandler?.(event);
|
|
135448
135057
|
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
@@ -135452,19 +135061,19 @@ function composeEventHandlers$2(originalEventHandler, ourEventHandler, { checkFo
|
|
|
135452
135061
|
}
|
|
135453
135062
|
|
|
135454
135063
|
// packages/react/compose-refs/src/composeRefs.tsx
|
|
135455
|
-
function setRef$
|
|
135064
|
+
function setRef$3(ref, value) {
|
|
135456
135065
|
if (typeof ref === "function") {
|
|
135457
135066
|
ref(value);
|
|
135458
135067
|
} else if (ref !== null && ref !== void 0) {
|
|
135459
135068
|
ref.current = value;
|
|
135460
135069
|
}
|
|
135461
135070
|
}
|
|
135462
|
-
function composeRefs$
|
|
135463
|
-
return (node) => refs.forEach((ref) => setRef$
|
|
135071
|
+
function composeRefs$3(...refs) {
|
|
135072
|
+
return (node) => refs.forEach((ref) => setRef$3(ref, node));
|
|
135464
135073
|
}
|
|
135465
135074
|
|
|
135466
135075
|
// packages/react/context/src/createContext.tsx
|
|
135467
|
-
function createContextScope$
|
|
135076
|
+
function createContextScope$9(scopeName, createContextScopeDeps = []) {
|
|
135468
135077
|
let defaultContexts = [];
|
|
135469
135078
|
function createContext3(rootComponentName, defaultContext) {
|
|
135470
135079
|
const BaseContext = React__namespace.createContext(defaultContext);
|
|
@@ -135499,9 +135108,9 @@ function createContextScope$6(scopeName, createContextScopeDeps = []) {
|
|
|
135499
135108
|
};
|
|
135500
135109
|
};
|
|
135501
135110
|
createScope.scopeName = scopeName;
|
|
135502
|
-
return [createContext3, composeContextScopes$
|
|
135111
|
+
return [createContext3, composeContextScopes$9(createScope, ...createContextScopeDeps)];
|
|
135503
135112
|
}
|
|
135504
|
-
function composeContextScopes$
|
|
135113
|
+
function composeContextScopes$9(...scopes) {
|
|
135505
135114
|
const baseScope = scopes[0];
|
|
135506
135115
|
if (scopes.length === 1) return baseScope;
|
|
135507
135116
|
const createScope = () => {
|
|
@@ -135523,7 +135132,7 @@ function composeContextScopes$6(...scopes) {
|
|
|
135523
135132
|
}
|
|
135524
135133
|
|
|
135525
135134
|
// packages/react/use-callback-ref/src/useCallbackRef.tsx
|
|
135526
|
-
function useCallbackRef$
|
|
135135
|
+
function useCallbackRef$4(callback) {
|
|
135527
135136
|
const callbackRef = React__namespace.useRef(callback);
|
|
135528
135137
|
React__namespace.useEffect(() => {
|
|
135529
135138
|
callbackRef.current = callback;
|
|
@@ -135532,16 +135141,16 @@ function useCallbackRef$3(callback) {
|
|
|
135532
135141
|
}
|
|
135533
135142
|
|
|
135534
135143
|
// packages/react/use-controllable-state/src/useControllableState.tsx
|
|
135535
|
-
function useControllableState$
|
|
135144
|
+
function useControllableState$3({
|
|
135536
135145
|
prop,
|
|
135537
135146
|
defaultProp,
|
|
135538
135147
|
onChange = () => {
|
|
135539
135148
|
}
|
|
135540
135149
|
}) {
|
|
135541
|
-
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState$
|
|
135150
|
+
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState$3({ defaultProp, onChange });
|
|
135542
135151
|
const isControlled = prop !== void 0;
|
|
135543
135152
|
const value = isControlled ? prop : uncontrolledProp;
|
|
135544
|
-
const handleChange = useCallbackRef$
|
|
135153
|
+
const handleChange = useCallbackRef$4(onChange);
|
|
135545
135154
|
const setValue = React__namespace.useCallback(
|
|
135546
135155
|
(nextValue) => {
|
|
135547
135156
|
if (isControlled) {
|
|
@@ -135556,14 +135165,14 @@ function useControllableState$2({
|
|
|
135556
135165
|
);
|
|
135557
135166
|
return [value, setValue];
|
|
135558
135167
|
}
|
|
135559
|
-
function useUncontrolledState$
|
|
135168
|
+
function useUncontrolledState$3({
|
|
135560
135169
|
defaultProp,
|
|
135561
135170
|
onChange
|
|
135562
135171
|
}) {
|
|
135563
135172
|
const uncontrolledState = React__namespace.useState(defaultProp);
|
|
135564
135173
|
const [value] = uncontrolledState;
|
|
135565
135174
|
const prevValueRef = React__namespace.useRef(value);
|
|
135566
|
-
const handleChange = useCallbackRef$
|
|
135175
|
+
const handleChange = useCallbackRef$4(onChange);
|
|
135567
135176
|
React__namespace.useEffect(() => {
|
|
135568
135177
|
if (prevValueRef.current !== value) {
|
|
135569
135178
|
handleChange(value);
|
|
@@ -135574,7 +135183,7 @@ function useUncontrolledState$2({
|
|
|
135574
135183
|
}
|
|
135575
135184
|
|
|
135576
135185
|
// packages/react/primitive/src/Primitive.tsx
|
|
135577
|
-
var NODES$
|
|
135186
|
+
var NODES$4 = [
|
|
135578
135187
|
"a",
|
|
135579
135188
|
"button",
|
|
135580
135189
|
"div",
|
|
@@ -135592,7 +135201,7 @@ var NODES$3 = [
|
|
|
135592
135201
|
"svg",
|
|
135593
135202
|
"ul"
|
|
135594
135203
|
];
|
|
135595
|
-
var Primitive$
|
|
135204
|
+
var Primitive$4 = NODES$4.reduce((primitive, node) => {
|
|
135596
135205
|
const Node = React__namespace.forwardRef((props, forwardedRef) => {
|
|
135597
135206
|
const { asChild, ...primitiveProps } = props;
|
|
135598
135207
|
const Comp = asChild ? Slot : node;
|
|
@@ -135606,7 +135215,7 @@ var Primitive$3 = NODES$3.reduce((primitive, node) => {
|
|
|
135606
135215
|
}, {});
|
|
135607
135216
|
|
|
135608
135217
|
// packages/core/primitive/src/primitive.tsx
|
|
135609
|
-
function composeEventHandlers$
|
|
135218
|
+
function composeEventHandlers$2(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
135610
135219
|
return function handleEvent(event) {
|
|
135611
135220
|
originalEventHandler?.(event);
|
|
135612
135221
|
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
@@ -135616,7 +135225,7 @@ function composeEventHandlers$1(originalEventHandler, ourEventHandler, { checkFo
|
|
|
135616
135225
|
}
|
|
135617
135226
|
|
|
135618
135227
|
// packages/react/context/src/createContext.tsx
|
|
135619
|
-
function createContextScope$
|
|
135228
|
+
function createContextScope$8(scopeName, createContextScopeDeps = []) {
|
|
135620
135229
|
let defaultContexts = [];
|
|
135621
135230
|
function createContext3(rootComponentName, defaultContext) {
|
|
135622
135231
|
const BaseContext = React__namespace.createContext(defaultContext);
|
|
@@ -135651,9 +135260,9 @@ function createContextScope$5(scopeName, createContextScopeDeps = []) {
|
|
|
135651
135260
|
};
|
|
135652
135261
|
};
|
|
135653
135262
|
createScope.scopeName = scopeName;
|
|
135654
|
-
return [createContext3, composeContextScopes$
|
|
135263
|
+
return [createContext3, composeContextScopes$8(createScope, ...createContextScopeDeps)];
|
|
135655
135264
|
}
|
|
135656
|
-
function composeContextScopes$
|
|
135265
|
+
function composeContextScopes$8(...scopes) {
|
|
135657
135266
|
const baseScope = scopes[0];
|
|
135658
135267
|
if (scopes.length === 1) return baseScope;
|
|
135659
135268
|
const createScope = () => {
|
|
@@ -135675,23 +135284,23 @@ function composeContextScopes$5(...scopes) {
|
|
|
135675
135284
|
}
|
|
135676
135285
|
|
|
135677
135286
|
// packages/react/compose-refs/src/composeRefs.tsx
|
|
135678
|
-
function setRef$
|
|
135287
|
+
function setRef$2(ref, value) {
|
|
135679
135288
|
if (typeof ref === "function") {
|
|
135680
135289
|
ref(value);
|
|
135681
135290
|
} else if (ref !== null && ref !== void 0) {
|
|
135682
135291
|
ref.current = value;
|
|
135683
135292
|
}
|
|
135684
135293
|
}
|
|
135685
|
-
function composeRefs$
|
|
135686
|
-
return (node) => refs.forEach((ref) => setRef$
|
|
135294
|
+
function composeRefs$2(...refs) {
|
|
135295
|
+
return (node) => refs.forEach((ref) => setRef$2(ref, node));
|
|
135687
135296
|
}
|
|
135688
|
-
function useComposedRefs$
|
|
135689
|
-
return React__namespace.useCallback(composeRefs$
|
|
135297
|
+
function useComposedRefs$2(...refs) {
|
|
135298
|
+
return React__namespace.useCallback(composeRefs$2(...refs), refs);
|
|
135690
135299
|
}
|
|
135691
135300
|
|
|
135692
|
-
function createCollection(name) {
|
|
135301
|
+
function createCollection$1(name) {
|
|
135693
135302
|
const PROVIDER_NAME = name + "CollectionProvider";
|
|
135694
|
-
const [createCollectionContext, createCollectionScope] = createContextScope$
|
|
135303
|
+
const [createCollectionContext, createCollectionScope] = createContextScope$8(PROVIDER_NAME);
|
|
135695
135304
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
|
135696
135305
|
PROVIDER_NAME,
|
|
135697
135306
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
@@ -135708,7 +135317,7 @@ function createCollection(name) {
|
|
|
135708
135317
|
(props, forwardedRef) => {
|
|
135709
135318
|
const { scope, children } = props;
|
|
135710
135319
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
135711
|
-
const composedRefs = useComposedRefs$
|
|
135320
|
+
const composedRefs = useComposedRefs$2(forwardedRef, context.collectionRef);
|
|
135712
135321
|
return /* @__PURE__ */ jsxRuntime.jsx(Slot, { ref: composedRefs, children });
|
|
135713
135322
|
}
|
|
135714
135323
|
);
|
|
@@ -135719,7 +135328,7 @@ function createCollection(name) {
|
|
|
135719
135328
|
(props, forwardedRef) => {
|
|
135720
135329
|
const { scope, children, ...itemData } = props;
|
|
135721
135330
|
const ref = React.useRef(null);
|
|
135722
|
-
const composedRefs = useComposedRefs$
|
|
135331
|
+
const composedRefs = useComposedRefs$2(forwardedRef, ref);
|
|
135723
135332
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
135724
135333
|
React.useEffect(() => {
|
|
135725
135334
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
@@ -135751,7 +135360,7 @@ function createCollection(name) {
|
|
|
135751
135360
|
}
|
|
135752
135361
|
|
|
135753
135362
|
// packages/react/context/src/createContext.tsx
|
|
135754
|
-
function createContextScope$
|
|
135363
|
+
function createContextScope$7(scopeName, createContextScopeDeps = []) {
|
|
135755
135364
|
let defaultContexts = [];
|
|
135756
135365
|
function createContext3(rootComponentName, defaultContext) {
|
|
135757
135366
|
const BaseContext = React__namespace.createContext(defaultContext);
|
|
@@ -135786,9 +135395,9 @@ function createContextScope$4(scopeName, createContextScopeDeps = []) {
|
|
|
135786
135395
|
};
|
|
135787
135396
|
};
|
|
135788
135397
|
createScope.scopeName = scopeName;
|
|
135789
|
-
return [createContext3, composeContextScopes$
|
|
135398
|
+
return [createContext3, composeContextScopes$7(createScope, ...createContextScopeDeps)];
|
|
135790
135399
|
}
|
|
135791
|
-
function composeContextScopes$
|
|
135400
|
+
function composeContextScopes$7(...scopes) {
|
|
135792
135401
|
const baseScope = scopes[0];
|
|
135793
135402
|
if (scopes.length === 1) return baseScope;
|
|
135794
135403
|
const createScope = () => {
|
|
@@ -135810,14 +135419,14 @@ function composeContextScopes$4(...scopes) {
|
|
|
135810
135419
|
}
|
|
135811
135420
|
|
|
135812
135421
|
// packages/react/direction/src/Direction.tsx
|
|
135813
|
-
var DirectionContext = React__namespace.createContext(void 0);
|
|
135814
|
-
function useDirection(localDir) {
|
|
135815
|
-
const globalDir = React__namespace.useContext(DirectionContext);
|
|
135422
|
+
var DirectionContext$1 = React__namespace.createContext(void 0);
|
|
135423
|
+
function useDirection$1(localDir) {
|
|
135424
|
+
const globalDir = React__namespace.useContext(DirectionContext$1);
|
|
135816
135425
|
return localDir || globalDir || "ltr";
|
|
135817
135426
|
}
|
|
135818
135427
|
|
|
135819
135428
|
// packages/react/primitive/src/Primitive.tsx
|
|
135820
|
-
var NODES$
|
|
135429
|
+
var NODES$3 = [
|
|
135821
135430
|
"a",
|
|
135822
135431
|
"button",
|
|
135823
135432
|
"div",
|
|
@@ -135835,7 +135444,7 @@ var NODES$2 = [
|
|
|
135835
135444
|
"svg",
|
|
135836
135445
|
"ul"
|
|
135837
135446
|
];
|
|
135838
|
-
var Primitive$
|
|
135447
|
+
var Primitive$3 = NODES$3.reduce((primitive, node) => {
|
|
135839
135448
|
const Node = React__namespace.forwardRef((props, forwardedRef) => {
|
|
135840
135449
|
const { asChild, ...primitiveProps } = props;
|
|
135841
135450
|
const Comp = asChild ? Slot : node;
|
|
@@ -135852,7 +135461,7 @@ function dispatchDiscreteCustomEvent$1(target, event) {
|
|
|
135852
135461
|
}
|
|
135853
135462
|
|
|
135854
135463
|
// packages/react/use-callback-ref/src/useCallbackRef.tsx
|
|
135855
|
-
function useCallbackRef$
|
|
135464
|
+
function useCallbackRef$3(callback) {
|
|
135856
135465
|
const callbackRef = React__namespace.useRef(callback);
|
|
135857
135466
|
React__namespace.useEffect(() => {
|
|
135858
135467
|
callbackRef.current = callback;
|
|
@@ -135862,7 +135471,7 @@ function useCallbackRef$2(callback) {
|
|
|
135862
135471
|
|
|
135863
135472
|
// packages/react/use-escape-keydown/src/useEscapeKeydown.tsx
|
|
135864
135473
|
function useEscapeKeydown$1(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
135865
|
-
const onEscapeKeyDown = useCallbackRef$
|
|
135474
|
+
const onEscapeKeyDown = useCallbackRef$3(onEscapeKeyDownProp);
|
|
135866
135475
|
React__namespace.useEffect(() => {
|
|
135867
135476
|
const handleKeyDown = (event) => {
|
|
135868
135477
|
if (event.key === "Escape") {
|
|
@@ -135899,7 +135508,7 @@ var DismissableLayer$1 = React__namespace.forwardRef(
|
|
|
135899
135508
|
const [node, setNode] = React__namespace.useState(null);
|
|
135900
135509
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
135901
135510
|
const [, force] = React__namespace.useState({});
|
|
135902
|
-
const composedRefs = useComposedRefs$
|
|
135511
|
+
const composedRefs = useComposedRefs$2(forwardedRef, (node2) => setNode(node2));
|
|
135903
135512
|
const layers = Array.from(context.layers);
|
|
135904
135513
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
135905
135514
|
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
|
@@ -135962,7 +135571,7 @@ var DismissableLayer$1 = React__namespace.forwardRef(
|
|
|
135962
135571
|
return () => document.removeEventListener(CONTEXT_UPDATE$1, handleUpdate);
|
|
135963
135572
|
}, []);
|
|
135964
135573
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
135965
|
-
Primitive$
|
|
135574
|
+
Primitive$3.div,
|
|
135966
135575
|
{
|
|
135967
135576
|
...layerProps,
|
|
135968
135577
|
ref: composedRefs,
|
|
@@ -135970,9 +135579,9 @@ var DismissableLayer$1 = React__namespace.forwardRef(
|
|
|
135970
135579
|
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
|
|
135971
135580
|
...props.style
|
|
135972
135581
|
},
|
|
135973
|
-
onFocusCapture: composeEventHandlers$
|
|
135974
|
-
onBlurCapture: composeEventHandlers$
|
|
135975
|
-
onPointerDownCapture: composeEventHandlers$
|
|
135582
|
+
onFocusCapture: composeEventHandlers$2(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
135583
|
+
onBlurCapture: composeEventHandlers$2(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
135584
|
+
onPointerDownCapture: composeEventHandlers$2(
|
|
135976
135585
|
props.onPointerDownCapture,
|
|
135977
135586
|
pointerDownOutside.onPointerDownCapture
|
|
135978
135587
|
)
|
|
@@ -135985,7 +135594,7 @@ var BRANCH_NAME$1 = "DismissableLayerBranch";
|
|
|
135985
135594
|
var DismissableLayerBranch$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
135986
135595
|
const context = React__namespace.useContext(DismissableLayerContext$1);
|
|
135987
135596
|
const ref = React__namespace.useRef(null);
|
|
135988
|
-
const composedRefs = useComposedRefs$
|
|
135597
|
+
const composedRefs = useComposedRefs$2(forwardedRef, ref);
|
|
135989
135598
|
React__namespace.useEffect(() => {
|
|
135990
135599
|
const node = ref.current;
|
|
135991
135600
|
if (node) {
|
|
@@ -135995,11 +135604,11 @@ var DismissableLayerBranch$1 = React__namespace.forwardRef((props, forwardedRef)
|
|
|
135995
135604
|
};
|
|
135996
135605
|
}
|
|
135997
135606
|
}, [context.branches]);
|
|
135998
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Primitive$
|
|
135607
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive$3.div, { ...props, ref: composedRefs });
|
|
135999
135608
|
});
|
|
136000
135609
|
DismissableLayerBranch$1.displayName = BRANCH_NAME$1;
|
|
136001
135610
|
function usePointerDownOutside$1(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
136002
|
-
const handlePointerDownOutside = useCallbackRef$
|
|
135611
|
+
const handlePointerDownOutside = useCallbackRef$3(onPointerDownOutside);
|
|
136003
135612
|
const isPointerInsideReactTreeRef = React__namespace.useRef(false);
|
|
136004
135613
|
const handleClickRef = React__namespace.useRef(() => {
|
|
136005
135614
|
});
|
|
@@ -136042,7 +135651,7 @@ function usePointerDownOutside$1(onPointerDownOutside, ownerDocument = globalThi
|
|
|
136042
135651
|
};
|
|
136043
135652
|
}
|
|
136044
135653
|
function useFocusOutside$1(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
136045
|
-
const handleFocusOutside = useCallbackRef$
|
|
135654
|
+
const handleFocusOutside = useCallbackRef$3(onFocusOutside);
|
|
136046
135655
|
const isFocusInsideReactTreeRef = React__namespace.useRef(false);
|
|
136047
135656
|
React__namespace.useEffect(() => {
|
|
136048
135657
|
const handleFocus = (event) => {
|
|
@@ -136076,18 +135685,18 @@ function handleAndDispatchCustomEvent$1(name, handler, detail, { discrete }) {
|
|
|
136076
135685
|
}
|
|
136077
135686
|
}
|
|
136078
135687
|
|
|
136079
|
-
var count$
|
|
135688
|
+
var count$5 = 0;
|
|
136080
135689
|
function useFocusGuards$1() {
|
|
136081
135690
|
React__namespace.useEffect(() => {
|
|
136082
135691
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
136083
135692
|
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard$1());
|
|
136084
135693
|
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard$1());
|
|
136085
|
-
count$
|
|
135694
|
+
count$5++;
|
|
136086
135695
|
return () => {
|
|
136087
|
-
if (count$
|
|
135696
|
+
if (count$5 === 1) {
|
|
136088
135697
|
document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
|
|
136089
135698
|
}
|
|
136090
|
-
count$
|
|
135699
|
+
count$5--;
|
|
136091
135700
|
};
|
|
136092
135701
|
}, []);
|
|
136093
135702
|
}
|
|
@@ -136104,7 +135713,7 @@ function createFocusGuard$1() {
|
|
|
136104
135713
|
|
|
136105
135714
|
var AUTOFOCUS_ON_MOUNT$1 = "focusScope.autoFocusOnMount";
|
|
136106
135715
|
var AUTOFOCUS_ON_UNMOUNT$1 = "focusScope.autoFocusOnUnmount";
|
|
136107
|
-
var EVENT_OPTIONS$
|
|
135716
|
+
var EVENT_OPTIONS$3 = { bubbles: false, cancelable: true };
|
|
136108
135717
|
var FOCUS_SCOPE_NAME$1 = "FocusScope";
|
|
136109
135718
|
var FocusScope$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
136110
135719
|
const {
|
|
@@ -136115,10 +135724,10 @@ var FocusScope$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
136115
135724
|
...scopeProps
|
|
136116
135725
|
} = props;
|
|
136117
135726
|
const [container, setContainer] = React__namespace.useState(null);
|
|
136118
|
-
const onMountAutoFocus = useCallbackRef$
|
|
136119
|
-
const onUnmountAutoFocus = useCallbackRef$
|
|
135727
|
+
const onMountAutoFocus = useCallbackRef$3(onMountAutoFocusProp);
|
|
135728
|
+
const onUnmountAutoFocus = useCallbackRef$3(onUnmountAutoFocusProp);
|
|
136120
135729
|
const lastFocusedElementRef = React__namespace.useRef(null);
|
|
136121
|
-
const composedRefs = useComposedRefs$
|
|
135730
|
+
const composedRefs = useComposedRefs$2(forwardedRef, (node) => setContainer(node));
|
|
136122
135731
|
const focusScope = React__namespace.useRef({
|
|
136123
135732
|
paused: false,
|
|
136124
135733
|
pause() {
|
|
@@ -136169,11 +135778,11 @@ var FocusScope$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
136169
135778
|
const previouslyFocusedElement = document.activeElement;
|
|
136170
135779
|
const hasFocusedCandidate = container.contains(previouslyFocusedElement);
|
|
136171
135780
|
if (!hasFocusedCandidate) {
|
|
136172
|
-
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT$1, EVENT_OPTIONS$
|
|
135781
|
+
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT$1, EVENT_OPTIONS$3);
|
|
136173
135782
|
container.addEventListener(AUTOFOCUS_ON_MOUNT$1, onMountAutoFocus);
|
|
136174
135783
|
container.dispatchEvent(mountEvent);
|
|
136175
135784
|
if (!mountEvent.defaultPrevented) {
|
|
136176
|
-
focusFirst$
|
|
135785
|
+
focusFirst$4(removeLinks$1(getTabbableCandidates$1(container)), { select: true });
|
|
136177
135786
|
if (document.activeElement === previouslyFocusedElement) {
|
|
136178
135787
|
focus$1(container);
|
|
136179
135788
|
}
|
|
@@ -136182,7 +135791,7 @@ var FocusScope$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
136182
135791
|
return () => {
|
|
136183
135792
|
container.removeEventListener(AUTOFOCUS_ON_MOUNT$1, onMountAutoFocus);
|
|
136184
135793
|
setTimeout(() => {
|
|
136185
|
-
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT$1, EVENT_OPTIONS$
|
|
135794
|
+
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT$1, EVENT_OPTIONS$3);
|
|
136186
135795
|
container.addEventListener(AUTOFOCUS_ON_UNMOUNT$1, onUnmountAutoFocus);
|
|
136187
135796
|
container.dispatchEvent(unmountEvent);
|
|
136188
135797
|
if (!unmountEvent.defaultPrevented) {
|
|
@@ -136219,10 +135828,10 @@ var FocusScope$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
136219
135828
|
},
|
|
136220
135829
|
[loop, trapped, focusScope.paused]
|
|
136221
135830
|
);
|
|
136222
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Primitive$
|
|
135831
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive$3.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
136223
135832
|
});
|
|
136224
135833
|
FocusScope$1.displayName = FOCUS_SCOPE_NAME$1;
|
|
136225
|
-
function focusFirst$
|
|
135834
|
+
function focusFirst$4(candidates, { select = false } = {}) {
|
|
136226
135835
|
const previouslyFocusedElement = document.activeElement;
|
|
136227
135836
|
for (const candidate of candidates) {
|
|
136228
135837
|
focus$1(candidate, { select });
|
|
@@ -136303,16 +135912,16 @@ function removeLinks$1(items) {
|
|
|
136303
135912
|
}
|
|
136304
135913
|
|
|
136305
135914
|
// packages/react/use-layout-effect/src/useLayoutEffect.tsx
|
|
136306
|
-
var useLayoutEffect2$
|
|
135915
|
+
var useLayoutEffect2$3 = Boolean(globalThis?.document) ? React__namespace.useLayoutEffect : () => {
|
|
136307
135916
|
};
|
|
136308
135917
|
|
|
136309
135918
|
// packages/react/id/src/id.tsx
|
|
136310
|
-
var useReactId$
|
|
136311
|
-
var count$
|
|
136312
|
-
function useId$
|
|
136313
|
-
const [id, setId] = React__namespace.useState(useReactId$
|
|
136314
|
-
useLayoutEffect2$
|
|
136315
|
-
if (!deterministicId) setId((reactId) => reactId ?? String(count$
|
|
135919
|
+
var useReactId$3 = React__namespace["useId".toString()] || (() => void 0);
|
|
135920
|
+
var count$4 = 0;
|
|
135921
|
+
function useId$3(deterministicId) {
|
|
135922
|
+
const [id, setId] = React__namespace.useState(useReactId$3());
|
|
135923
|
+
useLayoutEffect2$3(() => {
|
|
135924
|
+
if (!deterministicId) setId((reactId) => reactId ?? String(count$4++));
|
|
136316
135925
|
}, [deterministicId]);
|
|
136317
135926
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
136318
135927
|
}
|
|
@@ -136322,7 +135931,7 @@ var NAME$2 = "Arrow";
|
|
|
136322
135931
|
var Arrow$3 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
136323
135932
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
136324
135933
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
136325
|
-
Primitive$
|
|
135934
|
+
Primitive$3.svg,
|
|
136326
135935
|
{
|
|
136327
135936
|
...arrowProps,
|
|
136328
135937
|
ref: forwardedRef,
|
|
@@ -136335,10 +135944,10 @@ var Arrow$3 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
136335
135944
|
);
|
|
136336
135945
|
});
|
|
136337
135946
|
Arrow$3.displayName = NAME$2;
|
|
136338
|
-
var Root$
|
|
135947
|
+
var Root$4 = Arrow$3;
|
|
136339
135948
|
|
|
136340
135949
|
// packages/react/context/src/createContext.tsx
|
|
136341
|
-
function createContextScope$
|
|
135950
|
+
function createContextScope$6(scopeName, createContextScopeDeps = []) {
|
|
136342
135951
|
let defaultContexts = [];
|
|
136343
135952
|
function createContext3(rootComponentName, defaultContext) {
|
|
136344
135953
|
const BaseContext = React__namespace.createContext(defaultContext);
|
|
@@ -136373,9 +135982,9 @@ function createContextScope$3(scopeName, createContextScopeDeps = []) {
|
|
|
136373
135982
|
};
|
|
136374
135983
|
};
|
|
136375
135984
|
createScope.scopeName = scopeName;
|
|
136376
|
-
return [createContext3, composeContextScopes$
|
|
135985
|
+
return [createContext3, composeContextScopes$6(createScope, ...createContextScopeDeps)];
|
|
136377
135986
|
}
|
|
136378
|
-
function composeContextScopes$
|
|
135987
|
+
function composeContextScopes$6(...scopes) {
|
|
136379
135988
|
const baseScope = scopes[0];
|
|
136380
135989
|
if (scopes.length === 1) return baseScope;
|
|
136381
135990
|
const createScope = () => {
|
|
@@ -136397,9 +136006,9 @@ function composeContextScopes$3(...scopes) {
|
|
|
136397
136006
|
}
|
|
136398
136007
|
|
|
136399
136008
|
// packages/react/use-size/src/useSize.tsx
|
|
136400
|
-
function useSize$
|
|
136009
|
+
function useSize$2(element) {
|
|
136401
136010
|
const [size, setSize] = React__namespace.useState(void 0);
|
|
136402
|
-
useLayoutEffect2$
|
|
136011
|
+
useLayoutEffect2$3(() => {
|
|
136403
136012
|
if (element) {
|
|
136404
136013
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
136405
136014
|
const resizeObserver = new ResizeObserver((entries) => {
|
|
@@ -136433,7 +136042,7 @@ function useSize$1(element) {
|
|
|
136433
136042
|
}
|
|
136434
136043
|
|
|
136435
136044
|
var POPPER_NAME$1 = "Popper";
|
|
136436
|
-
var [createPopperContext$1, createPopperScope$1] = createContextScope$
|
|
136045
|
+
var [createPopperContext$1, createPopperScope$1] = createContextScope$6(POPPER_NAME$1);
|
|
136437
136046
|
var [PopperProvider$1, usePopperContext$1] = createPopperContext$1(POPPER_NAME$1);
|
|
136438
136047
|
var Popper$1 = (props) => {
|
|
136439
136048
|
const { __scopePopper, children } = props;
|
|
@@ -136447,11 +136056,11 @@ var PopperAnchor$1 = React__namespace.forwardRef(
|
|
|
136447
136056
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
136448
136057
|
const context = usePopperContext$1(ANCHOR_NAME$3, __scopePopper);
|
|
136449
136058
|
const ref = React__namespace.useRef(null);
|
|
136450
|
-
const composedRefs = useComposedRefs$
|
|
136059
|
+
const composedRefs = useComposedRefs$2(forwardedRef, ref);
|
|
136451
136060
|
React__namespace.useEffect(() => {
|
|
136452
136061
|
context.onAnchorChange(virtualRef?.current || ref.current);
|
|
136453
136062
|
});
|
|
136454
|
-
return virtualRef ? null : /* @__PURE__ */ jsxRuntime.jsx(Primitive$
|
|
136063
|
+
return virtualRef ? null : /* @__PURE__ */ jsxRuntime.jsx(Primitive$3.div, { ...anchorProps, ref: composedRefs });
|
|
136455
136064
|
}
|
|
136456
136065
|
);
|
|
136457
136066
|
PopperAnchor$1.displayName = ANCHOR_NAME$3;
|
|
@@ -136477,9 +136086,9 @@ var PopperContent$1 = React__namespace.forwardRef(
|
|
|
136477
136086
|
} = props;
|
|
136478
136087
|
const context = usePopperContext$1(CONTENT_NAME$4, __scopePopper);
|
|
136479
136088
|
const [content, setContent] = React__namespace.useState(null);
|
|
136480
|
-
const composedRefs = useComposedRefs$
|
|
136089
|
+
const composedRefs = useComposedRefs$2(forwardedRef, (node) => setContent(node));
|
|
136481
136090
|
const [arrow$1, setArrow] = React__namespace.useState(null);
|
|
136482
|
-
const arrowSize = useSize$
|
|
136091
|
+
const arrowSize = useSize$2(arrow$1);
|
|
136483
136092
|
const arrowWidth = arrowSize?.width ?? 0;
|
|
136484
136093
|
const arrowHeight = arrowSize?.height ?? 0;
|
|
136485
136094
|
const desiredPlacement = side + (align !== "center" ? "-" + align : "");
|
|
@@ -136531,8 +136140,8 @@ var PopperContent$1 = React__namespace.forwardRef(
|
|
|
136531
136140
|
]
|
|
136532
136141
|
});
|
|
136533
136142
|
const [placedSide, placedAlign] = getSideAndAlignFromPlacement$1(placement);
|
|
136534
|
-
const handlePlaced = useCallbackRef$
|
|
136535
|
-
useLayoutEffect2$
|
|
136143
|
+
const handlePlaced = useCallbackRef$3(onPlaced);
|
|
136144
|
+
useLayoutEffect2$3(() => {
|
|
136536
136145
|
if (isPositioned) {
|
|
136537
136146
|
handlePlaced?.();
|
|
136538
136147
|
}
|
|
@@ -136541,7 +136150,7 @@ var PopperContent$1 = React__namespace.forwardRef(
|
|
|
136541
136150
|
const arrowY = middlewareData.arrow?.y;
|
|
136542
136151
|
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
136543
136152
|
const [contentZIndex, setContentZIndex] = React__namespace.useState();
|
|
136544
|
-
useLayoutEffect2$
|
|
136153
|
+
useLayoutEffect2$3(() => {
|
|
136545
136154
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
136546
136155
|
}, [content]);
|
|
136547
136156
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -136578,7 +136187,7 @@ var PopperContent$1 = React__namespace.forwardRef(
|
|
|
136578
136187
|
arrowY,
|
|
136579
136188
|
shouldHideArrow: cannotCenterArrow,
|
|
136580
136189
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
136581
|
-
Primitive$
|
|
136190
|
+
Primitive$3.div,
|
|
136582
136191
|
{
|
|
136583
136192
|
"data-side": placedSide,
|
|
136584
136193
|
"data-align": placedAlign,
|
|
@@ -136638,7 +136247,7 @@ var PopperArrow$1 = React__namespace.forwardRef(function PopperArrow2(props, for
|
|
|
136638
136247
|
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
136639
136248
|
},
|
|
136640
136249
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
136641
|
-
Root$
|
|
136250
|
+
Root$4,
|
|
136642
136251
|
{
|
|
136643
136252
|
...arrowProps,
|
|
136644
136253
|
ref: forwardedRef,
|
|
@@ -136692,7 +136301,7 @@ function getSideAndAlignFromPlacement$1(placement) {
|
|
|
136692
136301
|
const [side, align = "center"] = placement.split("-");
|
|
136693
136302
|
return [side, align];
|
|
136694
136303
|
}
|
|
136695
|
-
var Root2$
|
|
136304
|
+
var Root2$4 = Popper$1;
|
|
136696
136305
|
var Anchor$1 = PopperAnchor$1;
|
|
136697
136306
|
var Content$1 = PopperContent$1;
|
|
136698
136307
|
var Arrow$2 = PopperArrow$1;
|
|
@@ -136701,14 +136310,14 @@ var PORTAL_NAME$4 = "Portal";
|
|
|
136701
136310
|
var Portal$3 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
136702
136311
|
const { container: containerProp, ...portalProps } = props;
|
|
136703
136312
|
const [mounted, setMounted] = React__namespace.useState(false);
|
|
136704
|
-
useLayoutEffect2$
|
|
136313
|
+
useLayoutEffect2$3(() => setMounted(true), []);
|
|
136705
136314
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
136706
|
-
return container ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntime.jsx(Primitive$
|
|
136315
|
+
return container ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntime.jsx(Primitive$3.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
136707
136316
|
});
|
|
136708
136317
|
Portal$3.displayName = PORTAL_NAME$4;
|
|
136709
136318
|
|
|
136710
136319
|
// packages/react/context/src/createContext.tsx
|
|
136711
|
-
function createContextScope$
|
|
136320
|
+
function createContextScope$5(scopeName, createContextScopeDeps = []) {
|
|
136712
136321
|
let defaultContexts = [];
|
|
136713
136322
|
function createContext3(rootComponentName, defaultContext) {
|
|
136714
136323
|
const BaseContext = React__namespace.createContext(defaultContext);
|
|
@@ -136743,9 +136352,9 @@ function createContextScope$2(scopeName, createContextScopeDeps = []) {
|
|
|
136743
136352
|
};
|
|
136744
136353
|
};
|
|
136745
136354
|
createScope.scopeName = scopeName;
|
|
136746
|
-
return [createContext3, composeContextScopes$
|
|
136355
|
+
return [createContext3, composeContextScopes$5(createScope, ...createContextScopeDeps)];
|
|
136747
136356
|
}
|
|
136748
|
-
function composeContextScopes$
|
|
136357
|
+
function composeContextScopes$5(...scopes) {
|
|
136749
136358
|
const baseScope = scopes[0];
|
|
136750
136359
|
if (scopes.length === 1) return baseScope;
|
|
136751
136360
|
const createScope = () => {
|
|
@@ -136767,16 +136376,16 @@ function composeContextScopes$2(...scopes) {
|
|
|
136767
136376
|
}
|
|
136768
136377
|
|
|
136769
136378
|
// packages/react/use-controllable-state/src/useControllableState.tsx
|
|
136770
|
-
function useControllableState$
|
|
136379
|
+
function useControllableState$2({
|
|
136771
136380
|
prop,
|
|
136772
136381
|
defaultProp,
|
|
136773
136382
|
onChange = () => {
|
|
136774
136383
|
}
|
|
136775
136384
|
}) {
|
|
136776
|
-
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState$
|
|
136385
|
+
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState$2({ defaultProp, onChange });
|
|
136777
136386
|
const isControlled = prop !== void 0;
|
|
136778
136387
|
const value = isControlled ? prop : uncontrolledProp;
|
|
136779
|
-
const handleChange = useCallbackRef$
|
|
136388
|
+
const handleChange = useCallbackRef$3(onChange);
|
|
136780
136389
|
const setValue = React__namespace.useCallback(
|
|
136781
136390
|
(nextValue) => {
|
|
136782
136391
|
if (isControlled) {
|
|
@@ -136791,14 +136400,14 @@ function useControllableState$1({
|
|
|
136791
136400
|
);
|
|
136792
136401
|
return [value, setValue];
|
|
136793
136402
|
}
|
|
136794
|
-
function useUncontrolledState$
|
|
136403
|
+
function useUncontrolledState$2({
|
|
136795
136404
|
defaultProp,
|
|
136796
136405
|
onChange
|
|
136797
136406
|
}) {
|
|
136798
136407
|
const uncontrolledState = React__namespace.useState(defaultProp);
|
|
136799
136408
|
const [value] = uncontrolledState;
|
|
136800
136409
|
const prevValueRef = React__namespace.useRef(value);
|
|
136801
|
-
const handleChange = useCallbackRef$
|
|
136410
|
+
const handleChange = useCallbackRef$3(onChange);
|
|
136802
136411
|
React__namespace.useEffect(() => {
|
|
136803
136412
|
if (prevValueRef.current !== value) {
|
|
136804
136413
|
handleChange(value);
|
|
@@ -136808,22 +136417,22 @@ function useUncontrolledState$1({
|
|
|
136808
136417
|
return uncontrolledState;
|
|
136809
136418
|
}
|
|
136810
136419
|
|
|
136811
|
-
var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
136812
|
-
var EVENT_OPTIONS$
|
|
136813
|
-
var GROUP_NAME$
|
|
136814
|
-
var [Collection$
|
|
136815
|
-
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope$
|
|
136816
|
-
GROUP_NAME$
|
|
136817
|
-
[createCollectionScope$
|
|
136420
|
+
var ENTRY_FOCUS$1 = "rovingFocusGroup.onEntryFocus";
|
|
136421
|
+
var EVENT_OPTIONS$2 = { bubbles: false, cancelable: true };
|
|
136422
|
+
var GROUP_NAME$3 = "RovingFocusGroup";
|
|
136423
|
+
var [Collection$2, useCollection$2, createCollectionScope$2] = createCollection$1(GROUP_NAME$3);
|
|
136424
|
+
var [createRovingFocusGroupContext$1, createRovingFocusGroupScope$1] = createContextScope$5(
|
|
136425
|
+
GROUP_NAME$3,
|
|
136426
|
+
[createCollectionScope$2]
|
|
136818
136427
|
);
|
|
136819
|
-
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME$
|
|
136820
|
-
var RovingFocusGroup = React__namespace.forwardRef(
|
|
136428
|
+
var [RovingFocusProvider$1, useRovingFocusContext$1] = createRovingFocusGroupContext$1(GROUP_NAME$3);
|
|
136429
|
+
var RovingFocusGroup$1 = React__namespace.forwardRef(
|
|
136821
136430
|
(props, forwardedRef) => {
|
|
136822
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Collection$
|
|
136431
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Collection$2.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntime.jsx(Collection$2.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntime.jsx(RovingFocusGroupImpl$1, { ...props, ref: forwardedRef }) }) });
|
|
136823
136432
|
}
|
|
136824
136433
|
);
|
|
136825
|
-
RovingFocusGroup.displayName = GROUP_NAME$
|
|
136826
|
-
var RovingFocusGroupImpl = React__namespace.forwardRef((props, forwardedRef) => {
|
|
136434
|
+
RovingFocusGroup$1.displayName = GROUP_NAME$3;
|
|
136435
|
+
var RovingFocusGroupImpl$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
136827
136436
|
const {
|
|
136828
136437
|
__scopeRovingFocusGroup,
|
|
136829
136438
|
orientation,
|
|
@@ -136837,27 +136446,27 @@ var RovingFocusGroupImpl = React__namespace.forwardRef((props, forwardedRef) =>
|
|
|
136837
136446
|
...groupProps
|
|
136838
136447
|
} = props;
|
|
136839
136448
|
const ref = React__namespace.useRef(null);
|
|
136840
|
-
const composedRefs = useComposedRefs$
|
|
136841
|
-
const direction = useDirection(dir);
|
|
136842
|
-
const [currentTabStopId = null, setCurrentTabStopId] = useControllableState$
|
|
136449
|
+
const composedRefs = useComposedRefs$2(forwardedRef, ref);
|
|
136450
|
+
const direction = useDirection$1(dir);
|
|
136451
|
+
const [currentTabStopId = null, setCurrentTabStopId] = useControllableState$2({
|
|
136843
136452
|
prop: currentTabStopIdProp,
|
|
136844
136453
|
defaultProp: defaultCurrentTabStopId,
|
|
136845
136454
|
onChange: onCurrentTabStopIdChange
|
|
136846
136455
|
});
|
|
136847
136456
|
const [isTabbingBackOut, setIsTabbingBackOut] = React__namespace.useState(false);
|
|
136848
|
-
const handleEntryFocus = useCallbackRef$
|
|
136849
|
-
const getItems = useCollection$
|
|
136457
|
+
const handleEntryFocus = useCallbackRef$3(onEntryFocus);
|
|
136458
|
+
const getItems = useCollection$2(__scopeRovingFocusGroup);
|
|
136850
136459
|
const isClickFocusRef = React__namespace.useRef(false);
|
|
136851
136460
|
const [focusableItemsCount, setFocusableItemsCount] = React__namespace.useState(0);
|
|
136852
136461
|
React__namespace.useEffect(() => {
|
|
136853
136462
|
const node = ref.current;
|
|
136854
136463
|
if (node) {
|
|
136855
|
-
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
136856
|
-
return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
136464
|
+
node.addEventListener(ENTRY_FOCUS$1, handleEntryFocus);
|
|
136465
|
+
return () => node.removeEventListener(ENTRY_FOCUS$1, handleEntryFocus);
|
|
136857
136466
|
}
|
|
136858
136467
|
}, [handleEntryFocus]);
|
|
136859
136468
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
136860
|
-
RovingFocusProvider,
|
|
136469
|
+
RovingFocusProvider$1,
|
|
136861
136470
|
{
|
|
136862
136471
|
scope: __scopeRovingFocusGroup,
|
|
136863
136472
|
orientation,
|
|
@@ -136878,20 +136487,20 @@ var RovingFocusGroupImpl = React__namespace.forwardRef((props, forwardedRef) =>
|
|
|
136878
136487
|
[]
|
|
136879
136488
|
),
|
|
136880
136489
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
136881
|
-
Primitive$
|
|
136490
|
+
Primitive$3.div,
|
|
136882
136491
|
{
|
|
136883
136492
|
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
136884
136493
|
"data-orientation": orientation,
|
|
136885
136494
|
...groupProps,
|
|
136886
136495
|
ref: composedRefs,
|
|
136887
136496
|
style: { outline: "none", ...props.style },
|
|
136888
|
-
onMouseDown: composeEventHandlers$
|
|
136497
|
+
onMouseDown: composeEventHandlers$2(props.onMouseDown, () => {
|
|
136889
136498
|
isClickFocusRef.current = true;
|
|
136890
136499
|
}),
|
|
136891
|
-
onFocus: composeEventHandlers$
|
|
136500
|
+
onFocus: composeEventHandlers$2(props.onFocus, (event) => {
|
|
136892
136501
|
const isKeyboardFocus = !isClickFocusRef.current;
|
|
136893
136502
|
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
136894
|
-
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS$
|
|
136503
|
+
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS$1, EVENT_OPTIONS$2);
|
|
136895
136504
|
event.currentTarget.dispatchEvent(entryFocusEvent);
|
|
136896
136505
|
if (!entryFocusEvent.defaultPrevented) {
|
|
136897
136506
|
const items = getItems().filter((item) => item.focusable);
|
|
@@ -136901,19 +136510,19 @@ var RovingFocusGroupImpl = React__namespace.forwardRef((props, forwardedRef) =>
|
|
|
136901
136510
|
Boolean
|
|
136902
136511
|
);
|
|
136903
136512
|
const candidateNodes = candidateItems.map((item) => item.ref.current);
|
|
136904
|
-
focusFirst$
|
|
136513
|
+
focusFirst$3(candidateNodes, preventScrollOnEntryFocus);
|
|
136905
136514
|
}
|
|
136906
136515
|
}
|
|
136907
136516
|
isClickFocusRef.current = false;
|
|
136908
136517
|
}),
|
|
136909
|
-
onBlur: composeEventHandlers$
|
|
136518
|
+
onBlur: composeEventHandlers$2(props.onBlur, () => setIsTabbingBackOut(false))
|
|
136910
136519
|
}
|
|
136911
136520
|
)
|
|
136912
136521
|
}
|
|
136913
136522
|
);
|
|
136914
136523
|
});
|
|
136915
|
-
var ITEM_NAME$
|
|
136916
|
-
var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
136524
|
+
var ITEM_NAME$4 = "RovingFocusGroupItem";
|
|
136525
|
+
var RovingFocusGroupItem$1 = React__namespace.forwardRef(
|
|
136917
136526
|
(props, forwardedRef) => {
|
|
136918
136527
|
const {
|
|
136919
136528
|
__scopeRovingFocusGroup,
|
|
@@ -136922,11 +136531,11 @@ var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
|
136922
136531
|
tabStopId,
|
|
136923
136532
|
...itemProps
|
|
136924
136533
|
} = props;
|
|
136925
|
-
const autoId = useId$
|
|
136534
|
+
const autoId = useId$3();
|
|
136926
136535
|
const id = tabStopId || autoId;
|
|
136927
|
-
const context = useRovingFocusContext(ITEM_NAME$
|
|
136536
|
+
const context = useRovingFocusContext$1(ITEM_NAME$4, __scopeRovingFocusGroup);
|
|
136928
136537
|
const isCurrentTabStop = context.currentTabStopId === id;
|
|
136929
|
-
const getItems = useCollection$
|
|
136538
|
+
const getItems = useCollection$2(__scopeRovingFocusGroup);
|
|
136930
136539
|
const { onFocusableItemAdd, onFocusableItemRemove } = context;
|
|
136931
136540
|
React__namespace.useEffect(() => {
|
|
136932
136541
|
if (focusable) {
|
|
@@ -136935,31 +136544,31 @@ var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
|
136935
136544
|
}
|
|
136936
136545
|
}, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
|
|
136937
136546
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
136938
|
-
Collection$
|
|
136547
|
+
Collection$2.ItemSlot,
|
|
136939
136548
|
{
|
|
136940
136549
|
scope: __scopeRovingFocusGroup,
|
|
136941
136550
|
id,
|
|
136942
136551
|
focusable,
|
|
136943
136552
|
active,
|
|
136944
136553
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
136945
|
-
Primitive$
|
|
136554
|
+
Primitive$3.span,
|
|
136946
136555
|
{
|
|
136947
136556
|
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
136948
136557
|
"data-orientation": context.orientation,
|
|
136949
136558
|
...itemProps,
|
|
136950
136559
|
ref: forwardedRef,
|
|
136951
|
-
onMouseDown: composeEventHandlers$
|
|
136560
|
+
onMouseDown: composeEventHandlers$2(props.onMouseDown, (event) => {
|
|
136952
136561
|
if (!focusable) event.preventDefault();
|
|
136953
136562
|
else context.onItemFocus(id);
|
|
136954
136563
|
}),
|
|
136955
|
-
onFocus: composeEventHandlers$
|
|
136956
|
-
onKeyDown: composeEventHandlers$
|
|
136564
|
+
onFocus: composeEventHandlers$2(props.onFocus, () => context.onItemFocus(id)),
|
|
136565
|
+
onKeyDown: composeEventHandlers$2(props.onKeyDown, (event) => {
|
|
136957
136566
|
if (event.key === "Tab" && event.shiftKey) {
|
|
136958
136567
|
context.onItemShiftTab();
|
|
136959
136568
|
return;
|
|
136960
136569
|
}
|
|
136961
136570
|
if (event.target !== event.currentTarget) return;
|
|
136962
|
-
const focusIntent = getFocusIntent(event, context.orientation, context.dir);
|
|
136571
|
+
const focusIntent = getFocusIntent$1(event, context.orientation, context.dir);
|
|
136963
136572
|
if (focusIntent !== void 0) {
|
|
136964
136573
|
if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
|
|
136965
136574
|
event.preventDefault();
|
|
@@ -136969,9 +136578,9 @@ var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
|
136969
136578
|
else if (focusIntent === "prev" || focusIntent === "next") {
|
|
136970
136579
|
if (focusIntent === "prev") candidateNodes.reverse();
|
|
136971
136580
|
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
136972
|
-
candidateNodes = context.loop ? wrapArray$
|
|
136581
|
+
candidateNodes = context.loop ? wrapArray$2(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
136973
136582
|
}
|
|
136974
|
-
setTimeout(() => focusFirst$
|
|
136583
|
+
setTimeout(() => focusFirst$3(candidateNodes));
|
|
136975
136584
|
}
|
|
136976
136585
|
})
|
|
136977
136586
|
}
|
|
@@ -136980,8 +136589,8 @@ var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
|
136980
136589
|
);
|
|
136981
136590
|
}
|
|
136982
136591
|
);
|
|
136983
|
-
RovingFocusGroupItem.displayName = ITEM_NAME$
|
|
136984
|
-
var MAP_KEY_TO_FOCUS_INTENT = {
|
|
136592
|
+
RovingFocusGroupItem$1.displayName = ITEM_NAME$4;
|
|
136593
|
+
var MAP_KEY_TO_FOCUS_INTENT$1 = {
|
|
136985
136594
|
ArrowLeft: "prev",
|
|
136986
136595
|
ArrowUp: "prev",
|
|
136987
136596
|
ArrowRight: "next",
|
|
@@ -136991,17 +136600,17 @@ var MAP_KEY_TO_FOCUS_INTENT = {
|
|
|
136991
136600
|
PageDown: "last",
|
|
136992
136601
|
End: "last"
|
|
136993
136602
|
};
|
|
136994
|
-
function getDirectionAwareKey(key, dir) {
|
|
136603
|
+
function getDirectionAwareKey$1(key, dir) {
|
|
136995
136604
|
if (dir !== "rtl") return key;
|
|
136996
136605
|
return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
136997
136606
|
}
|
|
136998
|
-
function getFocusIntent(event, orientation, dir) {
|
|
136999
|
-
const key = getDirectionAwareKey(event.key, dir);
|
|
136607
|
+
function getFocusIntent$1(event, orientation, dir) {
|
|
136608
|
+
const key = getDirectionAwareKey$1(event.key, dir);
|
|
137000
136609
|
if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
|
|
137001
136610
|
if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
|
|
137002
|
-
return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
136611
|
+
return MAP_KEY_TO_FOCUS_INTENT$1[key];
|
|
137003
136612
|
}
|
|
137004
|
-
function focusFirst$
|
|
136613
|
+
function focusFirst$3(candidates, preventScroll = false) {
|
|
137005
136614
|
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
137006
136615
|
for (const candidate of candidates) {
|
|
137007
136616
|
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
@@ -137009,11 +136618,11 @@ function focusFirst$2(candidates, preventScroll = false) {
|
|
|
137009
136618
|
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
137010
136619
|
}
|
|
137011
136620
|
}
|
|
137012
|
-
function wrapArray$
|
|
136621
|
+
function wrapArray$2(array, startIndex) {
|
|
137013
136622
|
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
137014
136623
|
}
|
|
137015
|
-
var Root$
|
|
137016
|
-
var Item = RovingFocusGroupItem;
|
|
136624
|
+
var Root$3 = RovingFocusGroup$1;
|
|
136625
|
+
var Item$1 = RovingFocusGroupItem$1;
|
|
137017
136626
|
|
|
137018
136627
|
var getDefaultParent = function (originalTarget) {
|
|
137019
136628
|
if (typeof document === 'undefined') {
|
|
@@ -137191,7 +136800,7 @@ function assignRef(ref, value) {
|
|
|
137191
136800
|
* @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref
|
|
137192
136801
|
* @returns {MutableRefObject}
|
|
137193
136802
|
*/
|
|
137194
|
-
function useCallbackRef$
|
|
136803
|
+
function useCallbackRef$2(initialValue, callback) {
|
|
137195
136804
|
var ref = React.useState(function () { return ({
|
|
137196
136805
|
// value
|
|
137197
136806
|
value: initialValue,
|
|
@@ -137231,7 +136840,7 @@ function useCallbackRef$1(initialValue, callback) {
|
|
|
137231
136840
|
* }
|
|
137232
136841
|
*/
|
|
137233
136842
|
function useMergeRefs(refs, defaultValue) {
|
|
137234
|
-
return useCallbackRef$
|
|
136843
|
+
return useCallbackRef$2(defaultValue || null, function (newValue) { return refs.forEach(function (ref) { return assignRef(ref, newValue); }); });
|
|
137235
136844
|
}
|
|
137236
136845
|
|
|
137237
136846
|
function ItoI(a) {
|
|
@@ -137833,14 +137442,14 @@ var SUB_CLOSE_KEYS = {
|
|
|
137833
137442
|
rtl: ["ArrowRight"]
|
|
137834
137443
|
};
|
|
137835
137444
|
var MENU_NAME = "Menu";
|
|
137836
|
-
var [Collection, useCollection, createCollectionScope] = createCollection(MENU_NAME);
|
|
137837
|
-
var [createMenuContext, createMenuScope] = createContextScope$
|
|
137838
|
-
createCollectionScope,
|
|
137445
|
+
var [Collection$1, useCollection$1, createCollectionScope$1] = createCollection$1(MENU_NAME);
|
|
137446
|
+
var [createMenuContext, createMenuScope] = createContextScope$7(MENU_NAME, [
|
|
137447
|
+
createCollectionScope$1,
|
|
137839
137448
|
createPopperScope$1,
|
|
137840
|
-
createRovingFocusGroupScope
|
|
137449
|
+
createRovingFocusGroupScope$1
|
|
137841
137450
|
]);
|
|
137842
137451
|
var usePopperScope$1 = createPopperScope$1();
|
|
137843
|
-
var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
|
137452
|
+
var useRovingFocusGroupScope$1 = createRovingFocusGroupScope$1();
|
|
137844
137453
|
var [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);
|
|
137845
137454
|
var [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);
|
|
137846
137455
|
var Menu = (props) => {
|
|
@@ -137848,8 +137457,8 @@ var Menu = (props) => {
|
|
|
137848
137457
|
const popperScope = usePopperScope$1(__scopeMenu);
|
|
137849
137458
|
const [content, setContent] = React__namespace.useState(null);
|
|
137850
137459
|
const isUsingKeyboardRef = React__namespace.useRef(false);
|
|
137851
|
-
const handleOpenChange = useCallbackRef$
|
|
137852
|
-
const direction = useDirection(dir);
|
|
137460
|
+
const handleOpenChange = useCallbackRef$3(onOpenChange);
|
|
137461
|
+
const direction = useDirection$1(dir);
|
|
137853
137462
|
React__namespace.useEffect(() => {
|
|
137854
137463
|
const handleKeyDown = () => {
|
|
137855
137464
|
isUsingKeyboardRef.current = true;
|
|
@@ -137864,7 +137473,7 @@ var Menu = (props) => {
|
|
|
137864
137473
|
document.removeEventListener("pointermove", handlePointer, { capture: true });
|
|
137865
137474
|
};
|
|
137866
137475
|
}, []);
|
|
137867
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Root2$
|
|
137476
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Root2$4, { ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
137868
137477
|
MenuProvider,
|
|
137869
137478
|
{
|
|
137870
137479
|
scope: __scopeMenu,
|
|
@@ -137914,14 +137523,14 @@ var MenuContent = React__namespace.forwardRef(
|
|
|
137914
137523
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
137915
137524
|
const context = useMenuContext(CONTENT_NAME$3, props.__scopeMenu);
|
|
137916
137525
|
const rootContext = useMenuRootContext(CONTENT_NAME$3, props.__scopeMenu);
|
|
137917
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Collection.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsxRuntime.jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntime.jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
|
|
137526
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Collection$1.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Collection$1.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsxRuntime.jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntime.jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });
|
|
137918
137527
|
}
|
|
137919
137528
|
);
|
|
137920
137529
|
var MenuRootContentModal = React__namespace.forwardRef(
|
|
137921
137530
|
(props, forwardedRef) => {
|
|
137922
137531
|
const context = useMenuContext(CONTENT_NAME$3, props.__scopeMenu);
|
|
137923
137532
|
const ref = React__namespace.useRef(null);
|
|
137924
|
-
const composedRefs = useComposedRefs$
|
|
137533
|
+
const composedRefs = useComposedRefs$2(forwardedRef, ref);
|
|
137925
137534
|
React__namespace.useEffect(() => {
|
|
137926
137535
|
const content = ref.current;
|
|
137927
137536
|
if (content) return hideOthers(content);
|
|
@@ -137934,7 +137543,7 @@ var MenuRootContentModal = React__namespace.forwardRef(
|
|
|
137934
137543
|
trapFocus: context.open,
|
|
137935
137544
|
disableOutsidePointerEvents: context.open,
|
|
137936
137545
|
disableOutsideScroll: true,
|
|
137937
|
-
onFocusOutside: composeEventHandlers$
|
|
137546
|
+
onFocusOutside: composeEventHandlers$2(
|
|
137938
137547
|
props.onFocusOutside,
|
|
137939
137548
|
(event) => event.preventDefault(),
|
|
137940
137549
|
{ checkForDefaultPrevented: false }
|
|
@@ -137979,11 +137588,11 @@ var MenuContentImpl = React__namespace.forwardRef(
|
|
|
137979
137588
|
const context = useMenuContext(CONTENT_NAME$3, __scopeMenu);
|
|
137980
137589
|
const rootContext = useMenuRootContext(CONTENT_NAME$3, __scopeMenu);
|
|
137981
137590
|
const popperScope = usePopperScope$1(__scopeMenu);
|
|
137982
|
-
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
137983
|
-
const getItems = useCollection(__scopeMenu);
|
|
137591
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope$1(__scopeMenu);
|
|
137592
|
+
const getItems = useCollection$1(__scopeMenu);
|
|
137984
137593
|
const [currentItemId, setCurrentItemId] = React__namespace.useState(null);
|
|
137985
137594
|
const contentRef = React__namespace.useRef(null);
|
|
137986
|
-
const composedRefs = useComposedRefs$
|
|
137595
|
+
const composedRefs = useComposedRefs$2(forwardedRef, contentRef, context.onContentChange);
|
|
137987
137596
|
const timerRef = React__namespace.useRef(0);
|
|
137988
137597
|
const searchRef = React__namespace.useRef("");
|
|
137989
137598
|
const pointerGraceTimerRef = React__namespace.useRef(0);
|
|
@@ -138051,7 +137660,7 @@ var MenuContentImpl = React__namespace.forwardRef(
|
|
|
138051
137660
|
{
|
|
138052
137661
|
asChild: true,
|
|
138053
137662
|
trapped: trapFocus,
|
|
138054
|
-
onMountAutoFocus: composeEventHandlers$
|
|
137663
|
+
onMountAutoFocus: composeEventHandlers$2(onOpenAutoFocus, (event) => {
|
|
138055
137664
|
event.preventDefault();
|
|
138056
137665
|
contentRef.current?.focus({ preventScroll: true });
|
|
138057
137666
|
}),
|
|
@@ -138067,7 +137676,7 @@ var MenuContentImpl = React__namespace.forwardRef(
|
|
|
138067
137676
|
onInteractOutside,
|
|
138068
137677
|
onDismiss,
|
|
138069
137678
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
138070
|
-
Root$
|
|
137679
|
+
Root$3,
|
|
138071
137680
|
{
|
|
138072
137681
|
asChild: true,
|
|
138073
137682
|
...rovingFocusGroupScope,
|
|
@@ -138076,7 +137685,7 @@ var MenuContentImpl = React__namespace.forwardRef(
|
|
|
138076
137685
|
loop,
|
|
138077
137686
|
currentTabStopId: currentItemId,
|
|
138078
137687
|
onCurrentTabStopIdChange: setCurrentItemId,
|
|
138079
|
-
onEntryFocus: composeEventHandlers$
|
|
137688
|
+
onEntryFocus: composeEventHandlers$2(onEntryFocus, (event) => {
|
|
138080
137689
|
if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
|
|
138081
137690
|
}),
|
|
138082
137691
|
preventScrollOnEntryFocus: true,
|
|
@@ -138092,7 +137701,7 @@ var MenuContentImpl = React__namespace.forwardRef(
|
|
|
138092
137701
|
...contentProps,
|
|
138093
137702
|
ref: composedRefs,
|
|
138094
137703
|
style: { outline: "none", ...contentProps.style },
|
|
138095
|
-
onKeyDown: composeEventHandlers$
|
|
137704
|
+
onKeyDown: composeEventHandlers$2(contentProps.onKeyDown, (event) => {
|
|
138096
137705
|
const target = event.target;
|
|
138097
137706
|
const isKeyDownInside = target.closest("[data-radix-menu-content]") === event.currentTarget;
|
|
138098
137707
|
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
|
|
@@ -138108,15 +137717,15 @@ var MenuContentImpl = React__namespace.forwardRef(
|
|
|
138108
137717
|
const items = getItems().filter((item) => !item.disabled);
|
|
138109
137718
|
const candidateNodes = items.map((item) => item.ref.current);
|
|
138110
137719
|
if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();
|
|
138111
|
-
focusFirst$
|
|
137720
|
+
focusFirst$2(candidateNodes);
|
|
138112
137721
|
}),
|
|
138113
|
-
onBlur: composeEventHandlers$
|
|
137722
|
+
onBlur: composeEventHandlers$2(props.onBlur, (event) => {
|
|
138114
137723
|
if (!event.currentTarget.contains(event.target)) {
|
|
138115
137724
|
window.clearTimeout(timerRef.current);
|
|
138116
137725
|
searchRef.current = "";
|
|
138117
137726
|
}
|
|
138118
137727
|
}),
|
|
138119
|
-
onPointerMove: composeEventHandlers$
|
|
137728
|
+
onPointerMove: composeEventHandlers$2(
|
|
138120
137729
|
props.onPointerMove,
|
|
138121
137730
|
whenMouse((event) => {
|
|
138122
137731
|
const target = event.target;
|
|
@@ -138141,31 +137750,31 @@ var MenuContentImpl = React__namespace.forwardRef(
|
|
|
138141
137750
|
}
|
|
138142
137751
|
);
|
|
138143
137752
|
MenuContent.displayName = CONTENT_NAME$3;
|
|
138144
|
-
var GROUP_NAME$
|
|
137753
|
+
var GROUP_NAME$2 = "MenuGroup";
|
|
138145
137754
|
var MenuGroup = React__namespace.forwardRef(
|
|
138146
137755
|
(props, forwardedRef) => {
|
|
138147
137756
|
const { __scopeMenu, ...groupProps } = props;
|
|
138148
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Primitive$
|
|
137757
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive$3.div, { role: "group", ...groupProps, ref: forwardedRef });
|
|
138149
137758
|
}
|
|
138150
137759
|
);
|
|
138151
|
-
MenuGroup.displayName = GROUP_NAME$
|
|
137760
|
+
MenuGroup.displayName = GROUP_NAME$2;
|
|
138152
137761
|
var LABEL_NAME$1 = "MenuLabel";
|
|
138153
137762
|
var MenuLabel = React__namespace.forwardRef(
|
|
138154
137763
|
(props, forwardedRef) => {
|
|
138155
137764
|
const { __scopeMenu, ...labelProps } = props;
|
|
138156
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Primitive$
|
|
137765
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive$3.div, { ...labelProps, ref: forwardedRef });
|
|
138157
137766
|
}
|
|
138158
137767
|
);
|
|
138159
137768
|
MenuLabel.displayName = LABEL_NAME$1;
|
|
138160
|
-
var ITEM_NAME$
|
|
137769
|
+
var ITEM_NAME$3 = "MenuItem";
|
|
138161
137770
|
var ITEM_SELECT = "menu.itemSelect";
|
|
138162
137771
|
var MenuItem = React__namespace.forwardRef(
|
|
138163
137772
|
(props, forwardedRef) => {
|
|
138164
137773
|
const { disabled = false, onSelect, ...itemProps } = props;
|
|
138165
137774
|
const ref = React__namespace.useRef(null);
|
|
138166
|
-
const rootContext = useMenuRootContext(ITEM_NAME$
|
|
138167
|
-
const contentContext = useMenuContentContext(ITEM_NAME$
|
|
138168
|
-
const composedRefs = useComposedRefs$
|
|
137775
|
+
const rootContext = useMenuRootContext(ITEM_NAME$3, props.__scopeMenu);
|
|
137776
|
+
const contentContext = useMenuContentContext(ITEM_NAME$3, props.__scopeMenu);
|
|
137777
|
+
const composedRefs = useComposedRefs$2(forwardedRef, ref);
|
|
138169
137778
|
const isPointerDownRef = React__namespace.useRef(false);
|
|
138170
137779
|
const handleSelect = () => {
|
|
138171
137780
|
const menuItem = ref.current;
|
|
@@ -138186,15 +137795,15 @@ var MenuItem = React__namespace.forwardRef(
|
|
|
138186
137795
|
...itemProps,
|
|
138187
137796
|
ref: composedRefs,
|
|
138188
137797
|
disabled,
|
|
138189
|
-
onClick: composeEventHandlers$
|
|
137798
|
+
onClick: composeEventHandlers$2(props.onClick, handleSelect),
|
|
138190
137799
|
onPointerDown: (event) => {
|
|
138191
137800
|
props.onPointerDown?.(event);
|
|
138192
137801
|
isPointerDownRef.current = true;
|
|
138193
137802
|
},
|
|
138194
|
-
onPointerUp: composeEventHandlers$
|
|
137803
|
+
onPointerUp: composeEventHandlers$2(props.onPointerUp, (event) => {
|
|
138195
137804
|
if (!isPointerDownRef.current) event.currentTarget?.click();
|
|
138196
137805
|
}),
|
|
138197
|
-
onKeyDown: composeEventHandlers$
|
|
137806
|
+
onKeyDown: composeEventHandlers$2(props.onKeyDown, (event) => {
|
|
138198
137807
|
const isTypingAhead = contentContext.searchRef.current !== "";
|
|
138199
137808
|
if (disabled || isTypingAhead && event.key === " ") return;
|
|
138200
137809
|
if (SELECTION_KEYS.includes(event.key)) {
|
|
@@ -138206,14 +137815,14 @@ var MenuItem = React__namespace.forwardRef(
|
|
|
138206
137815
|
);
|
|
138207
137816
|
}
|
|
138208
137817
|
);
|
|
138209
|
-
MenuItem.displayName = ITEM_NAME$
|
|
137818
|
+
MenuItem.displayName = ITEM_NAME$3;
|
|
138210
137819
|
var MenuItemImpl = React__namespace.forwardRef(
|
|
138211
137820
|
(props, forwardedRef) => {
|
|
138212
137821
|
const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;
|
|
138213
|
-
const contentContext = useMenuContentContext(ITEM_NAME$
|
|
138214
|
-
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
137822
|
+
const contentContext = useMenuContentContext(ITEM_NAME$3, __scopeMenu);
|
|
137823
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope$1(__scopeMenu);
|
|
138215
137824
|
const ref = React__namespace.useRef(null);
|
|
138216
|
-
const composedRefs = useComposedRefs$
|
|
137825
|
+
const composedRefs = useComposedRefs$2(forwardedRef, ref);
|
|
138217
137826
|
const [isFocused, setIsFocused] = React__namespace.useState(false);
|
|
138218
137827
|
const [textContent, setTextContent] = React__namespace.useState("");
|
|
138219
137828
|
React__namespace.useEffect(() => {
|
|
@@ -138223,13 +137832,13 @@ var MenuItemImpl = React__namespace.forwardRef(
|
|
|
138223
137832
|
}
|
|
138224
137833
|
}, [itemProps.children]);
|
|
138225
137834
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
138226
|
-
Collection.ItemSlot,
|
|
137835
|
+
Collection$1.ItemSlot,
|
|
138227
137836
|
{
|
|
138228
137837
|
scope: __scopeMenu,
|
|
138229
137838
|
disabled,
|
|
138230
137839
|
textValue: textValue ?? textContent,
|
|
138231
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
138232
|
-
Primitive$
|
|
137840
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Item$1, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
137841
|
+
Primitive$3.div,
|
|
138233
137842
|
{
|
|
138234
137843
|
role: "menuitem",
|
|
138235
137844
|
"data-highlighted": isFocused ? "" : void 0,
|
|
@@ -138237,7 +137846,7 @@ var MenuItemImpl = React__namespace.forwardRef(
|
|
|
138237
137846
|
"data-disabled": disabled ? "" : void 0,
|
|
138238
137847
|
...itemProps,
|
|
138239
137848
|
ref: composedRefs,
|
|
138240
|
-
onPointerMove: composeEventHandlers$
|
|
137849
|
+
onPointerMove: composeEventHandlers$2(
|
|
138241
137850
|
props.onPointerMove,
|
|
138242
137851
|
whenMouse((event) => {
|
|
138243
137852
|
if (disabled) {
|
|
@@ -138251,12 +137860,12 @@ var MenuItemImpl = React__namespace.forwardRef(
|
|
|
138251
137860
|
}
|
|
138252
137861
|
})
|
|
138253
137862
|
),
|
|
138254
|
-
onPointerLeave: composeEventHandlers$
|
|
137863
|
+
onPointerLeave: composeEventHandlers$2(
|
|
138255
137864
|
props.onPointerLeave,
|
|
138256
137865
|
whenMouse((event) => contentContext.onItemLeave(event))
|
|
138257
137866
|
),
|
|
138258
|
-
onFocus: composeEventHandlers$
|
|
138259
|
-
onBlur: composeEventHandlers$
|
|
137867
|
+
onFocus: composeEventHandlers$2(props.onFocus, () => setIsFocused(true)),
|
|
137868
|
+
onBlur: composeEventHandlers$2(props.onBlur, () => setIsFocused(false))
|
|
138260
137869
|
}
|
|
138261
137870
|
) })
|
|
138262
137871
|
}
|
|
@@ -138275,7 +137884,7 @@ var MenuCheckboxItem = React__namespace.forwardRef(
|
|
|
138275
137884
|
...checkboxItemProps,
|
|
138276
137885
|
ref: forwardedRef,
|
|
138277
137886
|
"data-state": getCheckedState(checked),
|
|
138278
|
-
onSelect: composeEventHandlers$
|
|
137887
|
+
onSelect: composeEventHandlers$2(
|
|
138279
137888
|
checkboxItemProps.onSelect,
|
|
138280
137889
|
() => onCheckedChange?.(isIndeterminate(checked) ? true : !checked),
|
|
138281
137890
|
{ checkForDefaultPrevented: false }
|
|
@@ -138285,25 +137894,25 @@ var MenuCheckboxItem = React__namespace.forwardRef(
|
|
|
138285
137894
|
}
|
|
138286
137895
|
);
|
|
138287
137896
|
MenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME$1;
|
|
138288
|
-
var RADIO_GROUP_NAME$
|
|
138289
|
-
var [RadioGroupProvider, useRadioGroupContext] = createMenuContext(
|
|
138290
|
-
RADIO_GROUP_NAME$
|
|
137897
|
+
var RADIO_GROUP_NAME$2 = "MenuRadioGroup";
|
|
137898
|
+
var [RadioGroupProvider$1, useRadioGroupContext$1] = createMenuContext(
|
|
137899
|
+
RADIO_GROUP_NAME$2,
|
|
138291
137900
|
{ value: void 0, onValueChange: () => {
|
|
138292
137901
|
} }
|
|
138293
137902
|
);
|
|
138294
137903
|
var MenuRadioGroup = React__namespace.forwardRef(
|
|
138295
137904
|
(props, forwardedRef) => {
|
|
138296
137905
|
const { value, onValueChange, ...groupProps } = props;
|
|
138297
|
-
const handleValueChange = useCallbackRef$
|
|
138298
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsxRuntime.jsx(MenuGroup, { ...groupProps, ref: forwardedRef }) });
|
|
137906
|
+
const handleValueChange = useCallbackRef$3(onValueChange);
|
|
137907
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadioGroupProvider$1, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsxRuntime.jsx(MenuGroup, { ...groupProps, ref: forwardedRef }) });
|
|
138299
137908
|
}
|
|
138300
137909
|
);
|
|
138301
|
-
MenuRadioGroup.displayName = RADIO_GROUP_NAME$
|
|
137910
|
+
MenuRadioGroup.displayName = RADIO_GROUP_NAME$2;
|
|
138302
137911
|
var RADIO_ITEM_NAME$1 = "MenuRadioItem";
|
|
138303
137912
|
var MenuRadioItem = React__namespace.forwardRef(
|
|
138304
137913
|
(props, forwardedRef) => {
|
|
138305
137914
|
const { value, ...radioItemProps } = props;
|
|
138306
|
-
const context = useRadioGroupContext(RADIO_ITEM_NAME$1, props.__scopeMenu);
|
|
137915
|
+
const context = useRadioGroupContext$1(RADIO_ITEM_NAME$1, props.__scopeMenu);
|
|
138307
137916
|
const checked = value === context.value;
|
|
138308
137917
|
return /* @__PURE__ */ jsxRuntime.jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
138309
137918
|
MenuItem,
|
|
@@ -138313,7 +137922,7 @@ var MenuRadioItem = React__namespace.forwardRef(
|
|
|
138313
137922
|
...radioItemProps,
|
|
138314
137923
|
ref: forwardedRef,
|
|
138315
137924
|
"data-state": getCheckedState(checked),
|
|
138316
|
-
onSelect: composeEventHandlers$
|
|
137925
|
+
onSelect: composeEventHandlers$2(
|
|
138317
137926
|
radioItemProps.onSelect,
|
|
138318
137927
|
() => context.onValueChange?.(value),
|
|
138319
137928
|
{ checkForDefaultPrevented: false }
|
|
@@ -138337,7 +137946,7 @@ var MenuItemIndicator = React__namespace.forwardRef(
|
|
|
138337
137946
|
{
|
|
138338
137947
|
present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
|
|
138339
137948
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
138340
|
-
Primitive$
|
|
137949
|
+
Primitive$3.span,
|
|
138341
137950
|
{
|
|
138342
137951
|
...itemIndicatorProps,
|
|
138343
137952
|
ref: forwardedRef,
|
|
@@ -138354,7 +137963,7 @@ var MenuSeparator = React__namespace.forwardRef(
|
|
|
138354
137963
|
(props, forwardedRef) => {
|
|
138355
137964
|
const { __scopeMenu, ...separatorProps } = props;
|
|
138356
137965
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
138357
|
-
Primitive$
|
|
137966
|
+
Primitive$3.div,
|
|
138358
137967
|
{
|
|
138359
137968
|
role: "separator",
|
|
138360
137969
|
"aria-orientation": "horizontal",
|
|
@@ -138382,12 +137991,12 @@ var MenuSub = (props) => {
|
|
|
138382
137991
|
const popperScope = usePopperScope$1(__scopeMenu);
|
|
138383
137992
|
const [trigger, setTrigger] = React__namespace.useState(null);
|
|
138384
137993
|
const [content, setContent] = React__namespace.useState(null);
|
|
138385
|
-
const handleOpenChange = useCallbackRef$
|
|
137994
|
+
const handleOpenChange = useCallbackRef$3(onOpenChange);
|
|
138386
137995
|
React__namespace.useEffect(() => {
|
|
138387
137996
|
if (parentMenuContext.open === false) handleOpenChange(false);
|
|
138388
137997
|
return () => handleOpenChange(false);
|
|
138389
137998
|
}, [parentMenuContext.open, handleOpenChange]);
|
|
138390
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Root2$
|
|
137999
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Root2$4, { ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
138391
138000
|
MenuProvider,
|
|
138392
138001
|
{
|
|
138393
138002
|
scope: __scopeMenu,
|
|
@@ -138399,8 +138008,8 @@ var MenuSub = (props) => {
|
|
|
138399
138008
|
MenuSubProvider,
|
|
138400
138009
|
{
|
|
138401
138010
|
scope: __scopeMenu,
|
|
138402
|
-
contentId: useId$
|
|
138403
|
-
triggerId: useId$
|
|
138011
|
+
contentId: useId$3(),
|
|
138012
|
+
triggerId: useId$3(),
|
|
138404
138013
|
trigger,
|
|
138405
138014
|
onTriggerChange: setTrigger,
|
|
138406
138015
|
children
|
|
@@ -138441,14 +138050,14 @@ var MenuSubTrigger = React__namespace.forwardRef(
|
|
|
138441
138050
|
"aria-controls": subContext.contentId,
|
|
138442
138051
|
"data-state": getOpenState(context.open),
|
|
138443
138052
|
...props,
|
|
138444
|
-
ref: composeRefs$
|
|
138053
|
+
ref: composeRefs$2(forwardedRef, subContext.onTriggerChange),
|
|
138445
138054
|
onClick: (event) => {
|
|
138446
138055
|
props.onClick?.(event);
|
|
138447
138056
|
if (props.disabled || event.defaultPrevented) return;
|
|
138448
138057
|
event.currentTarget.focus();
|
|
138449
138058
|
if (!context.open) context.onOpenChange(true);
|
|
138450
138059
|
},
|
|
138451
|
-
onPointerMove: composeEventHandlers$
|
|
138060
|
+
onPointerMove: composeEventHandlers$2(
|
|
138452
138061
|
props.onPointerMove,
|
|
138453
138062
|
whenMouse((event) => {
|
|
138454
138063
|
contentContext.onItemEnter(event);
|
|
@@ -138462,7 +138071,7 @@ var MenuSubTrigger = React__namespace.forwardRef(
|
|
|
138462
138071
|
}
|
|
138463
138072
|
})
|
|
138464
138073
|
),
|
|
138465
|
-
onPointerLeave: composeEventHandlers$
|
|
138074
|
+
onPointerLeave: composeEventHandlers$2(
|
|
138466
138075
|
props.onPointerLeave,
|
|
138467
138076
|
whenMouse((event) => {
|
|
138468
138077
|
clearOpenTimer();
|
|
@@ -138497,7 +138106,7 @@ var MenuSubTrigger = React__namespace.forwardRef(
|
|
|
138497
138106
|
}
|
|
138498
138107
|
})
|
|
138499
138108
|
),
|
|
138500
|
-
onKeyDown: composeEventHandlers$
|
|
138109
|
+
onKeyDown: composeEventHandlers$2(props.onKeyDown, (event) => {
|
|
138501
138110
|
const isTypingAhead = contentContext.searchRef.current !== "";
|
|
138502
138111
|
if (props.disabled || isTypingAhead && event.key === " ") return;
|
|
138503
138112
|
if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {
|
|
@@ -138520,8 +138129,8 @@ var MenuSubContent = React__namespace.forwardRef(
|
|
|
138520
138129
|
const rootContext = useMenuRootContext(CONTENT_NAME$3, props.__scopeMenu);
|
|
138521
138130
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME$1, props.__scopeMenu);
|
|
138522
138131
|
const ref = React__namespace.useRef(null);
|
|
138523
|
-
const composedRefs = useComposedRefs$
|
|
138524
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Collection.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
138132
|
+
const composedRefs = useComposedRefs$2(forwardedRef, ref);
|
|
138133
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Collection$1.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntime.jsx(Collection$1.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
138525
138134
|
MenuContentImpl,
|
|
138526
138135
|
{
|
|
138527
138136
|
id: subContext.contentId,
|
|
@@ -138538,14 +138147,14 @@ var MenuSubContent = React__namespace.forwardRef(
|
|
|
138538
138147
|
event.preventDefault();
|
|
138539
138148
|
},
|
|
138540
138149
|
onCloseAutoFocus: (event) => event.preventDefault(),
|
|
138541
|
-
onFocusOutside: composeEventHandlers$
|
|
138150
|
+
onFocusOutside: composeEventHandlers$2(props.onFocusOutside, (event) => {
|
|
138542
138151
|
if (event.target !== subContext.trigger) context.onOpenChange(false);
|
|
138543
138152
|
}),
|
|
138544
|
-
onEscapeKeyDown: composeEventHandlers$
|
|
138153
|
+
onEscapeKeyDown: composeEventHandlers$2(props.onEscapeKeyDown, (event) => {
|
|
138545
138154
|
rootContext.onClose();
|
|
138546
138155
|
event.preventDefault();
|
|
138547
138156
|
}),
|
|
138548
|
-
onKeyDown: composeEventHandlers$
|
|
138157
|
+
onKeyDown: composeEventHandlers$2(props.onKeyDown, (event) => {
|
|
138549
138158
|
const isKeyDownInside = event.currentTarget.contains(event.target);
|
|
138550
138159
|
const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);
|
|
138551
138160
|
if (isKeyDownInside && isCloseKey) {
|
|
@@ -138568,7 +138177,7 @@ function isIndeterminate(checked) {
|
|
|
138568
138177
|
function getCheckedState(checked) {
|
|
138569
138178
|
return isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
138570
138179
|
}
|
|
138571
|
-
function focusFirst$
|
|
138180
|
+
function focusFirst$2(candidates) {
|
|
138572
138181
|
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
138573
138182
|
for (const candidate of candidates) {
|
|
138574
138183
|
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
@@ -138576,14 +138185,14 @@ function focusFirst$1(candidates) {
|
|
|
138576
138185
|
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
138577
138186
|
}
|
|
138578
138187
|
}
|
|
138579
|
-
function wrapArray(array, startIndex) {
|
|
138188
|
+
function wrapArray$1(array, startIndex) {
|
|
138580
138189
|
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
138581
138190
|
}
|
|
138582
138191
|
function getNextMatch(values, search, currentMatch) {
|
|
138583
138192
|
const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);
|
|
138584
138193
|
const normalizedSearch = isRepeated ? search[0] : search;
|
|
138585
138194
|
const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;
|
|
138586
|
-
let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));
|
|
138195
|
+
let wrappedValues = wrapArray$1(values, Math.max(currentMatchIndex, 0));
|
|
138587
138196
|
const excludeCurrentMatch = normalizedSearch.length === 1;
|
|
138588
138197
|
if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);
|
|
138589
138198
|
const nextMatch = wrappedValues.find(
|
|
@@ -138618,9 +138227,9 @@ var Portal$2 = MenuPortal;
|
|
|
138618
138227
|
var Content2$2 = MenuContent;
|
|
138619
138228
|
var Group = MenuGroup;
|
|
138620
138229
|
var Label = MenuLabel;
|
|
138621
|
-
var Item2$
|
|
138230
|
+
var Item2$2 = MenuItem;
|
|
138622
138231
|
var CheckboxItem = MenuCheckboxItem;
|
|
138623
|
-
var RadioGroup = MenuRadioGroup;
|
|
138232
|
+
var RadioGroup$2 = MenuRadioGroup;
|
|
138624
138233
|
var RadioItem = MenuRadioItem;
|
|
138625
138234
|
var ItemIndicator = MenuItemIndicator;
|
|
138626
138235
|
var Separator$2 = MenuSeparator;
|
|
@@ -138630,22 +138239,22 @@ var SubTrigger = MenuSubTrigger;
|
|
|
138630
138239
|
var SubContent = MenuSubContent;
|
|
138631
138240
|
|
|
138632
138241
|
// packages/react/use-layout-effect/src/useLayoutEffect.tsx
|
|
138633
|
-
var useLayoutEffect2$
|
|
138242
|
+
var useLayoutEffect2$2 = Boolean(globalThis?.document) ? React__namespace.useLayoutEffect : () => {
|
|
138634
138243
|
};
|
|
138635
138244
|
|
|
138636
138245
|
// packages/react/id/src/id.tsx
|
|
138637
|
-
var useReactId$
|
|
138638
|
-
var count$
|
|
138639
|
-
function useId$
|
|
138640
|
-
const [id, setId] = React__namespace.useState(useReactId$
|
|
138641
|
-
useLayoutEffect2$
|
|
138642
|
-
if (!deterministicId) setId((reactId) => reactId ?? String(count$
|
|
138246
|
+
var useReactId$2 = React__namespace["useId".toString()] || (() => void 0);
|
|
138247
|
+
var count$3 = 0;
|
|
138248
|
+
function useId$2(deterministicId) {
|
|
138249
|
+
const [id, setId] = React__namespace.useState(useReactId$2());
|
|
138250
|
+
useLayoutEffect2$2(() => {
|
|
138251
|
+
if (!deterministicId) setId((reactId) => reactId ?? String(count$3++));
|
|
138643
138252
|
}, [deterministicId]);
|
|
138644
138253
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
138645
138254
|
}
|
|
138646
138255
|
|
|
138647
138256
|
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
138648
|
-
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope$
|
|
138257
|
+
var [createDropdownMenuContext, createDropdownMenuScope] = createContextScope$9(
|
|
138649
138258
|
DROPDOWN_MENU_NAME,
|
|
138650
138259
|
[createMenuScope]
|
|
138651
138260
|
);
|
|
@@ -138663,7 +138272,7 @@ var DropdownMenu = (props) => {
|
|
|
138663
138272
|
} = props;
|
|
138664
138273
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
138665
138274
|
const triggerRef = React__namespace.useRef(null);
|
|
138666
|
-
const [open = false, setOpen] = useControllableState$
|
|
138275
|
+
const [open = false, setOpen] = useControllableState$3({
|
|
138667
138276
|
prop: openProp,
|
|
138668
138277
|
defaultProp: defaultOpen,
|
|
138669
138278
|
onChange: onOpenChange
|
|
@@ -138672,9 +138281,9 @@ var DropdownMenu = (props) => {
|
|
|
138672
138281
|
DropdownMenuProvider,
|
|
138673
138282
|
{
|
|
138674
138283
|
scope: __scopeDropdownMenu,
|
|
138675
|
-
triggerId: useId$
|
|
138284
|
+
triggerId: useId$2(),
|
|
138676
138285
|
triggerRef,
|
|
138677
|
-
contentId: useId$
|
|
138286
|
+
contentId: useId$2(),
|
|
138678
138287
|
open,
|
|
138679
138288
|
onOpenChange: setOpen,
|
|
138680
138289
|
onOpenToggle: React__namespace.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
@@ -138691,7 +138300,7 @@ var DropdownMenuTrigger = React__namespace.forwardRef(
|
|
|
138691
138300
|
const context = useDropdownMenuContext(TRIGGER_NAME$1, __scopeDropdownMenu);
|
|
138692
138301
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
138693
138302
|
return /* @__PURE__ */ jsxRuntime.jsx(Anchor2, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
138694
|
-
Primitive$
|
|
138303
|
+
Primitive$4.button,
|
|
138695
138304
|
{
|
|
138696
138305
|
type: "button",
|
|
138697
138306
|
id: context.triggerId,
|
|
@@ -138702,14 +138311,14 @@ var DropdownMenuTrigger = React__namespace.forwardRef(
|
|
|
138702
138311
|
"data-disabled": disabled ? "" : void 0,
|
|
138703
138312
|
disabled,
|
|
138704
138313
|
...triggerProps,
|
|
138705
|
-
ref: composeRefs$
|
|
138706
|
-
onPointerDown: composeEventHandlers$
|
|
138314
|
+
ref: composeRefs$3(forwardedRef, context.triggerRef),
|
|
138315
|
+
onPointerDown: composeEventHandlers$3(props.onPointerDown, (event) => {
|
|
138707
138316
|
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
138708
138317
|
context.onOpenToggle();
|
|
138709
138318
|
if (!context.open) event.preventDefault();
|
|
138710
138319
|
}
|
|
138711
138320
|
}),
|
|
138712
|
-
onKeyDown: composeEventHandlers$
|
|
138321
|
+
onKeyDown: composeEventHandlers$3(props.onKeyDown, (event) => {
|
|
138713
138322
|
if (disabled) return;
|
|
138714
138323
|
if (["Enter", " "].includes(event.key)) context.onOpenToggle();
|
|
138715
138324
|
if (event.key === "ArrowDown") context.onOpenChange(true);
|
|
@@ -138742,12 +138351,12 @@ var DropdownMenuContent = React__namespace.forwardRef(
|
|
|
138742
138351
|
...menuScope,
|
|
138743
138352
|
...contentProps,
|
|
138744
138353
|
ref: forwardedRef,
|
|
138745
|
-
onCloseAutoFocus: composeEventHandlers$
|
|
138354
|
+
onCloseAutoFocus: composeEventHandlers$3(props.onCloseAutoFocus, (event) => {
|
|
138746
138355
|
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
138747
138356
|
hasInteractedOutsideRef.current = false;
|
|
138748
138357
|
event.preventDefault();
|
|
138749
138358
|
}),
|
|
138750
|
-
onInteractOutside: composeEventHandlers$
|
|
138359
|
+
onInteractOutside: composeEventHandlers$3(props.onInteractOutside, (event) => {
|
|
138751
138360
|
const originalEvent = event.detail.originalEvent;
|
|
138752
138361
|
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
138753
138362
|
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
@@ -138769,7 +138378,7 @@ var DropdownMenuContent = React__namespace.forwardRef(
|
|
|
138769
138378
|
}
|
|
138770
138379
|
);
|
|
138771
138380
|
DropdownMenuContent.displayName = CONTENT_NAME$2;
|
|
138772
|
-
var GROUP_NAME = "DropdownMenuGroup";
|
|
138381
|
+
var GROUP_NAME$1 = "DropdownMenuGroup";
|
|
138773
138382
|
var DropdownMenuGroup = React__namespace.forwardRef(
|
|
138774
138383
|
(props, forwardedRef) => {
|
|
138775
138384
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
@@ -138777,7 +138386,7 @@ var DropdownMenuGroup = React__namespace.forwardRef(
|
|
|
138777
138386
|
return /* @__PURE__ */ jsxRuntime.jsx(Group, { ...menuScope, ...groupProps, ref: forwardedRef });
|
|
138778
138387
|
}
|
|
138779
138388
|
);
|
|
138780
|
-
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
138389
|
+
DropdownMenuGroup.displayName = GROUP_NAME$1;
|
|
138781
138390
|
var LABEL_NAME = "DropdownMenuLabel";
|
|
138782
138391
|
var DropdownMenuLabel = React__namespace.forwardRef(
|
|
138783
138392
|
(props, forwardedRef) => {
|
|
@@ -138787,15 +138396,15 @@ var DropdownMenuLabel = React__namespace.forwardRef(
|
|
|
138787
138396
|
}
|
|
138788
138397
|
);
|
|
138789
138398
|
DropdownMenuLabel.displayName = LABEL_NAME;
|
|
138790
|
-
var ITEM_NAME = "DropdownMenuItem";
|
|
138399
|
+
var ITEM_NAME$2 = "DropdownMenuItem";
|
|
138791
138400
|
var DropdownMenuItem = React__namespace.forwardRef(
|
|
138792
138401
|
(props, forwardedRef) => {
|
|
138793
138402
|
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
138794
138403
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
138795
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Item2$
|
|
138404
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Item2$2, { ...menuScope, ...itemProps, ref: forwardedRef });
|
|
138796
138405
|
}
|
|
138797
138406
|
);
|
|
138798
|
-
DropdownMenuItem.displayName = ITEM_NAME;
|
|
138407
|
+
DropdownMenuItem.displayName = ITEM_NAME$2;
|
|
138799
138408
|
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
138800
138409
|
var DropdownMenuCheckboxItem = React__namespace.forwardRef((props, forwardedRef) => {
|
|
138801
138410
|
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
@@ -138803,13 +138412,13 @@ var DropdownMenuCheckboxItem = React__namespace.forwardRef((props, forwardedRef)
|
|
|
138803
138412
|
return /* @__PURE__ */ jsxRuntime.jsx(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
138804
138413
|
});
|
|
138805
138414
|
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
138806
|
-
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
138415
|
+
var RADIO_GROUP_NAME$1 = "DropdownMenuRadioGroup";
|
|
138807
138416
|
var DropdownMenuRadioGroup = React__namespace.forwardRef((props, forwardedRef) => {
|
|
138808
138417
|
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
138809
138418
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
138810
|
-
return /* @__PURE__ */ jsxRuntime.jsx(RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
138419
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadioGroup$2, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
138811
138420
|
});
|
|
138812
|
-
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
138421
|
+
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME$1;
|
|
138813
138422
|
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
138814
138423
|
var DropdownMenuRadioItem = React__namespace.forwardRef((props, forwardedRef) => {
|
|
138815
138424
|
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
@@ -138817,13 +138426,13 @@ var DropdownMenuRadioItem = React__namespace.forwardRef((props, forwardedRef) =>
|
|
|
138817
138426
|
return /* @__PURE__ */ jsxRuntime.jsx(RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
138818
138427
|
});
|
|
138819
138428
|
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
138820
|
-
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
138429
|
+
var INDICATOR_NAME$1 = "DropdownMenuItemIndicator";
|
|
138821
138430
|
var DropdownMenuItemIndicator = React__namespace.forwardRef((props, forwardedRef) => {
|
|
138822
138431
|
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
138823
138432
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
138824
138433
|
return /* @__PURE__ */ jsxRuntime.jsx(ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
138825
138434
|
});
|
|
138826
|
-
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
138435
|
+
DropdownMenuItemIndicator.displayName = INDICATOR_NAME$1;
|
|
138827
138436
|
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
138828
138437
|
var DropdownMenuSeparator = React__namespace.forwardRef((props, forwardedRef) => {
|
|
138829
138438
|
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
@@ -138843,7 +138452,7 @@ DropdownMenuArrow.displayName = ARROW_NAME$2;
|
|
|
138843
138452
|
var DropdownMenuSub = (props) => {
|
|
138844
138453
|
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
138845
138454
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
138846
|
-
const [open = false, setOpen] = useControllableState$
|
|
138455
|
+
const [open = false, setOpen] = useControllableState$3({
|
|
138847
138456
|
prop: openProp,
|
|
138848
138457
|
defaultProp: defaultOpen,
|
|
138849
138458
|
onChange: onOpenChange
|
|
@@ -138882,13 +138491,13 @@ var DropdownMenuSubContent = React__namespace.forwardRef((props, forwardedRef) =
|
|
|
138882
138491
|
);
|
|
138883
138492
|
});
|
|
138884
138493
|
DropdownMenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
138885
|
-
var Root2$
|
|
138494
|
+
var Root2$3 = DropdownMenu;
|
|
138886
138495
|
var Trigger$1 = DropdownMenuTrigger;
|
|
138887
138496
|
var Portal2 = DropdownMenuPortal;
|
|
138888
138497
|
var Content2$1 = DropdownMenuContent;
|
|
138889
138498
|
var Group2 = DropdownMenuGroup;
|
|
138890
138499
|
var Label2 = DropdownMenuLabel;
|
|
138891
|
-
var Item2 = DropdownMenuItem;
|
|
138500
|
+
var Item2$1 = DropdownMenuItem;
|
|
138892
138501
|
var CheckboxItem2 = DropdownMenuCheckboxItem;
|
|
138893
138502
|
var RadioGroup2 = DropdownMenuRadioGroup;
|
|
138894
138503
|
var RadioItem2 = DropdownMenuRadioItem;
|
|
@@ -138911,7 +138520,7 @@ var menuStyleClasses = {
|
|
|
138911
138520
|
separator: "-s-mx-1 s-my-1 s-h-px s-bg-separator",
|
|
138912
138521
|
shortcut: "s-ml-auto s-text-xs s-tracking-widest s-text-primary-400",
|
|
138913
138522
|
};
|
|
138914
|
-
var NewDropdownMenu = Root2$
|
|
138523
|
+
var NewDropdownMenu = Root2$3;
|
|
138915
138524
|
var NewDropdownMenuGroup = Group2;
|
|
138916
138525
|
var NewDropdownMenuPortal = Portal2;
|
|
138917
138526
|
var NewDropdownMenuSub = Sub2;
|
|
@@ -138954,10 +138563,10 @@ var NewDropdownMenuContent = React__namespace.forwardRef(function (_a, ref) {
|
|
|
138954
138563
|
NewDropdownMenuContent.displayName = Content2$1.displayName;
|
|
138955
138564
|
var NewDropdownMenuItem = React__namespace.forwardRef(function (_a, ref) {
|
|
138956
138565
|
var children = _a.children, description = _a.description, className = _a.className, inset = _a.inset, icon = _a.icon, label = _a.label, props = __rest(_a, ["children", "description", "className", "inset", "icon", "label"]);
|
|
138957
|
-
return (React__namespace.createElement(Item2, __assign({ ref: ref, className: cn(menuStyleClasses.item, inset ? menuStyleClasses.inset : "", className || "") }, props),
|
|
138566
|
+
return (React__namespace.createElement(Item2$1, __assign({ ref: ref, className: cn(menuStyleClasses.item, inset ? menuStyleClasses.inset : "", className || "") }, props),
|
|
138958
138567
|
React__namespace.createElement(ItemWithLabelIconAndDescription, { label: label, icon: icon, description: description }, children)));
|
|
138959
138568
|
});
|
|
138960
|
-
NewDropdownMenuItem.displayName = Item2.displayName;
|
|
138569
|
+
NewDropdownMenuItem.displayName = Item2$1.displayName;
|
|
138961
138570
|
var NewDropdownMenuCheckboxItem = React__namespace.forwardRef(function (_a, ref) {
|
|
138962
138571
|
var className = _a.className, children = _a.children, checked = _a.checked, props = __rest(_a, ["className", "children", "checked"]);
|
|
138963
138572
|
return (React__namespace.createElement(CheckboxItem2, __assign({ ref: ref, className: cn(menuStyleClasses.item, menuStyleClasses.inset, className || ""), checked: checked }, props),
|
|
@@ -139011,7 +138620,7 @@ function Notification(_a) {
|
|
|
139011
138620
|
}
|
|
139012
138621
|
|
|
139013
138622
|
// packages/react/primitive/src/Primitive.tsx
|
|
139014
|
-
var NODES$
|
|
138623
|
+
var NODES$2 = [
|
|
139015
138624
|
"a",
|
|
139016
138625
|
"button",
|
|
139017
138626
|
"div",
|
|
@@ -139029,7 +138638,7 @@ var NODES$1 = [
|
|
|
139029
138638
|
"svg",
|
|
139030
138639
|
"ul"
|
|
139031
138640
|
];
|
|
139032
|
-
var Primitive$
|
|
138641
|
+
var Primitive$2 = NODES$2.reduce((primitive, node) => {
|
|
139033
138642
|
const Node = React__namespace.forwardRef((props, forwardedRef) => {
|
|
139034
138643
|
const { asChild, ...primitiveProps } = props;
|
|
139035
138644
|
const Comp = asChild ? Slot : node;
|
|
@@ -139052,7 +138661,7 @@ var Separator$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
139052
138661
|
const ariaOrientation = orientation === "vertical" ? orientation : void 0;
|
|
139053
138662
|
const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
|
|
139054
138663
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
139055
|
-
Primitive$
|
|
138664
|
+
Primitive$2.div,
|
|
139056
138665
|
{
|
|
139057
138666
|
"data-orientation": orientation,
|
|
139058
138667
|
...semanticProps,
|
|
@@ -139065,13 +138674,13 @@ Separator$1.displayName = NAME$1;
|
|
|
139065
138674
|
function isValidOrientation(orientation) {
|
|
139066
138675
|
return ORIENTATIONS.includes(orientation);
|
|
139067
138676
|
}
|
|
139068
|
-
var Root$
|
|
138677
|
+
var Root$2 = Separator$1;
|
|
139069
138678
|
|
|
139070
138679
|
var Separator = React__namespace.forwardRef(function (_a, ref) {
|
|
139071
138680
|
var className = _a.className, _b = _a.orientation, orientation = _b === void 0 ? "horizontal" : _b, _c = _a.decorative, decorative = _c === void 0 ? true : _c, props = __rest(_a, ["className", "orientation", "decorative"]);
|
|
139072
|
-
return (React__namespace.createElement(Root$
|
|
138681
|
+
return (React__namespace.createElement(Root$2, __assign({ ref: ref, decorative: decorative, orientation: orientation, className: classNames("s-bg-separator s-shrink-0", orientation === "horizontal" ? "s-h-[1px] s-w-full" : "s-h-full s-w-[1px]", className !== null && className !== void 0 ? className : "") }, props)));
|
|
139073
138682
|
});
|
|
139074
|
-
Separator.displayName = Root$
|
|
138683
|
+
Separator.displayName = Root$2.displayName;
|
|
139075
138684
|
|
|
139076
138685
|
function Page(_a) {
|
|
139077
138686
|
var children = _a.children, _b = _a.variant, variant = _b === void 0 ? "normal" : _b;
|
|
@@ -139184,7 +138793,7 @@ function PaginatedCitationsGrid(_a) {
|
|
|
139184
138793
|
}
|
|
139185
138794
|
|
|
139186
138795
|
// packages/core/primitive/src/primitive.tsx
|
|
139187
|
-
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
138796
|
+
function composeEventHandlers$1(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
139188
138797
|
return function handleEvent(event) {
|
|
139189
138798
|
originalEventHandler?.(event);
|
|
139190
138799
|
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
@@ -139194,22 +138803,22 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
139194
138803
|
}
|
|
139195
138804
|
|
|
139196
138805
|
// packages/react/compose-refs/src/composeRefs.tsx
|
|
139197
|
-
function setRef(ref, value) {
|
|
138806
|
+
function setRef$1(ref, value) {
|
|
139198
138807
|
if (typeof ref === "function") {
|
|
139199
138808
|
ref(value);
|
|
139200
138809
|
} else if (ref !== null && ref !== void 0) {
|
|
139201
138810
|
ref.current = value;
|
|
139202
138811
|
}
|
|
139203
138812
|
}
|
|
139204
|
-
function composeRefs(...refs) {
|
|
139205
|
-
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
138813
|
+
function composeRefs$1(...refs) {
|
|
138814
|
+
return (node) => refs.forEach((ref) => setRef$1(ref, node));
|
|
139206
138815
|
}
|
|
139207
|
-
function useComposedRefs(...refs) {
|
|
139208
|
-
return React__namespace.useCallback(composeRefs(...refs), refs);
|
|
138816
|
+
function useComposedRefs$1(...refs) {
|
|
138817
|
+
return React__namespace.useCallback(composeRefs$1(...refs), refs);
|
|
139209
138818
|
}
|
|
139210
138819
|
|
|
139211
138820
|
// packages/react/context/src/createContext.tsx
|
|
139212
|
-
function createContextScope$
|
|
138821
|
+
function createContextScope$4(scopeName, createContextScopeDeps = []) {
|
|
139213
138822
|
let defaultContexts = [];
|
|
139214
138823
|
function createContext3(rootComponentName, defaultContext) {
|
|
139215
138824
|
const BaseContext = React__namespace.createContext(defaultContext);
|
|
@@ -139244,9 +138853,9 @@ function createContextScope$1(scopeName, createContextScopeDeps = []) {
|
|
|
139244
138853
|
};
|
|
139245
138854
|
};
|
|
139246
138855
|
createScope.scopeName = scopeName;
|
|
139247
|
-
return [createContext3, composeContextScopes$
|
|
138856
|
+
return [createContext3, composeContextScopes$4(createScope, ...createContextScopeDeps)];
|
|
139248
138857
|
}
|
|
139249
|
-
function composeContextScopes$
|
|
138858
|
+
function composeContextScopes$4(...scopes) {
|
|
139250
138859
|
const baseScope = scopes[0];
|
|
139251
138860
|
if (scopes.length === 1) return baseScope;
|
|
139252
138861
|
const createScope = () => {
|
|
@@ -139268,7 +138877,7 @@ function composeContextScopes$1(...scopes) {
|
|
|
139268
138877
|
}
|
|
139269
138878
|
|
|
139270
138879
|
// packages/react/primitive/src/Primitive.tsx
|
|
139271
|
-
var NODES = [
|
|
138880
|
+
var NODES$1 = [
|
|
139272
138881
|
"a",
|
|
139273
138882
|
"button",
|
|
139274
138883
|
"div",
|
|
@@ -139286,7 +138895,7 @@ var NODES = [
|
|
|
139286
138895
|
"svg",
|
|
139287
138896
|
"ul"
|
|
139288
138897
|
];
|
|
139289
|
-
var Primitive = NODES.reduce((primitive, node) => {
|
|
138898
|
+
var Primitive$1 = NODES$1.reduce((primitive, node) => {
|
|
139290
138899
|
const Node = React__namespace.forwardRef((props, forwardedRef) => {
|
|
139291
138900
|
const { asChild, ...primitiveProps } = props;
|
|
139292
138901
|
const Comp = asChild ? Slot : node;
|
|
@@ -139303,7 +138912,7 @@ function dispatchDiscreteCustomEvent(target, event) {
|
|
|
139303
138912
|
}
|
|
139304
138913
|
|
|
139305
138914
|
// packages/react/use-callback-ref/src/useCallbackRef.tsx
|
|
139306
|
-
function useCallbackRef(callback) {
|
|
138915
|
+
function useCallbackRef$1(callback) {
|
|
139307
138916
|
const callbackRef = React__namespace.useRef(callback);
|
|
139308
138917
|
React__namespace.useEffect(() => {
|
|
139309
138918
|
callbackRef.current = callback;
|
|
@@ -139313,7 +138922,7 @@ function useCallbackRef(callback) {
|
|
|
139313
138922
|
|
|
139314
138923
|
// packages/react/use-escape-keydown/src/useEscapeKeydown.tsx
|
|
139315
138924
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
139316
|
-
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
138925
|
+
const onEscapeKeyDown = useCallbackRef$1(onEscapeKeyDownProp);
|
|
139317
138926
|
React__namespace.useEffect(() => {
|
|
139318
138927
|
const handleKeyDown = (event) => {
|
|
139319
138928
|
if (event.key === "Escape") {
|
|
@@ -139350,7 +138959,7 @@ var DismissableLayer = React__namespace.forwardRef(
|
|
|
139350
138959
|
const [node, setNode] = React__namespace.useState(null);
|
|
139351
138960
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
139352
138961
|
const [, force] = React__namespace.useState({});
|
|
139353
|
-
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
138962
|
+
const composedRefs = useComposedRefs$1(forwardedRef, (node2) => setNode(node2));
|
|
139354
138963
|
const layers = Array.from(context.layers);
|
|
139355
138964
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
139356
138965
|
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
|
@@ -139413,7 +139022,7 @@ var DismissableLayer = React__namespace.forwardRef(
|
|
|
139413
139022
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
139414
139023
|
}, []);
|
|
139415
139024
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
139416
|
-
Primitive.div,
|
|
139025
|
+
Primitive$1.div,
|
|
139417
139026
|
{
|
|
139418
139027
|
...layerProps,
|
|
139419
139028
|
ref: composedRefs,
|
|
@@ -139421,9 +139030,9 @@ var DismissableLayer = React__namespace.forwardRef(
|
|
|
139421
139030
|
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
|
|
139422
139031
|
...props.style
|
|
139423
139032
|
},
|
|
139424
|
-
onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
139425
|
-
onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
139426
|
-
onPointerDownCapture: composeEventHandlers(
|
|
139033
|
+
onFocusCapture: composeEventHandlers$1(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
139034
|
+
onBlurCapture: composeEventHandlers$1(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
139035
|
+
onPointerDownCapture: composeEventHandlers$1(
|
|
139427
139036
|
props.onPointerDownCapture,
|
|
139428
139037
|
pointerDownOutside.onPointerDownCapture
|
|
139429
139038
|
)
|
|
@@ -139436,7 +139045,7 @@ var BRANCH_NAME = "DismissableLayerBranch";
|
|
|
139436
139045
|
var DismissableLayerBranch = React__namespace.forwardRef((props, forwardedRef) => {
|
|
139437
139046
|
const context = React__namespace.useContext(DismissableLayerContext);
|
|
139438
139047
|
const ref = React__namespace.useRef(null);
|
|
139439
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
139048
|
+
const composedRefs = useComposedRefs$1(forwardedRef, ref);
|
|
139440
139049
|
React__namespace.useEffect(() => {
|
|
139441
139050
|
const node = ref.current;
|
|
139442
139051
|
if (node) {
|
|
@@ -139446,11 +139055,11 @@ var DismissableLayerBranch = React__namespace.forwardRef((props, forwardedRef) =
|
|
|
139446
139055
|
};
|
|
139447
139056
|
}
|
|
139448
139057
|
}, [context.branches]);
|
|
139449
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { ...props, ref: composedRefs });
|
|
139058
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive$1.div, { ...props, ref: composedRefs });
|
|
139450
139059
|
});
|
|
139451
139060
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
139452
139061
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
139453
|
-
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
139062
|
+
const handlePointerDownOutside = useCallbackRef$1(onPointerDownOutside);
|
|
139454
139063
|
const isPointerInsideReactTreeRef = React__namespace.useRef(false);
|
|
139455
139064
|
const handleClickRef = React__namespace.useRef(() => {
|
|
139456
139065
|
});
|
|
@@ -139493,7 +139102,7 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?
|
|
|
139493
139102
|
};
|
|
139494
139103
|
}
|
|
139495
139104
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
139496
|
-
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
139105
|
+
const handleFocusOutside = useCallbackRef$1(onFocusOutside);
|
|
139497
139106
|
const isFocusInsideReactTreeRef = React__namespace.useRef(false);
|
|
139498
139107
|
React__namespace.useEffect(() => {
|
|
139499
139108
|
const handleFocus = (event) => {
|
|
@@ -139527,18 +139136,18 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
139527
139136
|
}
|
|
139528
139137
|
}
|
|
139529
139138
|
|
|
139530
|
-
var count$
|
|
139139
|
+
var count$2 = 0;
|
|
139531
139140
|
function useFocusGuards() {
|
|
139532
139141
|
React__namespace.useEffect(() => {
|
|
139533
139142
|
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
139534
139143
|
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
139535
139144
|
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
139536
|
-
count$
|
|
139145
|
+
count$2++;
|
|
139537
139146
|
return () => {
|
|
139538
|
-
if (count$
|
|
139147
|
+
if (count$2 === 1) {
|
|
139539
139148
|
document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
|
|
139540
139149
|
}
|
|
139541
|
-
count$
|
|
139150
|
+
count$2--;
|
|
139542
139151
|
};
|
|
139543
139152
|
}, []);
|
|
139544
139153
|
}
|
|
@@ -139555,7 +139164,7 @@ function createFocusGuard() {
|
|
|
139555
139164
|
|
|
139556
139165
|
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
139557
139166
|
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
139558
|
-
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
139167
|
+
var EVENT_OPTIONS$1 = { bubbles: false, cancelable: true };
|
|
139559
139168
|
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
139560
139169
|
var FocusScope = React__namespace.forwardRef((props, forwardedRef) => {
|
|
139561
139170
|
const {
|
|
@@ -139566,10 +139175,10 @@ var FocusScope = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
139566
139175
|
...scopeProps
|
|
139567
139176
|
} = props;
|
|
139568
139177
|
const [container, setContainer] = React__namespace.useState(null);
|
|
139569
|
-
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
139570
|
-
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
139178
|
+
const onMountAutoFocus = useCallbackRef$1(onMountAutoFocusProp);
|
|
139179
|
+
const onUnmountAutoFocus = useCallbackRef$1(onUnmountAutoFocusProp);
|
|
139571
139180
|
const lastFocusedElementRef = React__namespace.useRef(null);
|
|
139572
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
139181
|
+
const composedRefs = useComposedRefs$1(forwardedRef, (node) => setContainer(node));
|
|
139573
139182
|
const focusScope = React__namespace.useRef({
|
|
139574
139183
|
paused: false,
|
|
139575
139184
|
pause() {
|
|
@@ -139620,11 +139229,11 @@ var FocusScope = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
139620
139229
|
const previouslyFocusedElement = document.activeElement;
|
|
139621
139230
|
const hasFocusedCandidate = container.contains(previouslyFocusedElement);
|
|
139622
139231
|
if (!hasFocusedCandidate) {
|
|
139623
|
-
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
139232
|
+
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS$1);
|
|
139624
139233
|
container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
139625
139234
|
container.dispatchEvent(mountEvent);
|
|
139626
139235
|
if (!mountEvent.defaultPrevented) {
|
|
139627
|
-
focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
|
|
139236
|
+
focusFirst$1(removeLinks(getTabbableCandidates(container)), { select: true });
|
|
139628
139237
|
if (document.activeElement === previouslyFocusedElement) {
|
|
139629
139238
|
focus(container);
|
|
139630
139239
|
}
|
|
@@ -139633,7 +139242,7 @@ var FocusScope = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
139633
139242
|
return () => {
|
|
139634
139243
|
container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
139635
139244
|
setTimeout(() => {
|
|
139636
|
-
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
|
|
139245
|
+
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS$1);
|
|
139637
139246
|
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
139638
139247
|
container.dispatchEvent(unmountEvent);
|
|
139639
139248
|
if (!unmountEvent.defaultPrevented) {
|
|
@@ -139670,10 +139279,10 @@ var FocusScope = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
139670
139279
|
},
|
|
139671
139280
|
[loop, trapped, focusScope.paused]
|
|
139672
139281
|
);
|
|
139673
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
139282
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Primitive$1.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
139674
139283
|
});
|
|
139675
139284
|
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
139676
|
-
function focusFirst(candidates, { select = false } = {}) {
|
|
139285
|
+
function focusFirst$1(candidates, { select = false } = {}) {
|
|
139677
139286
|
const previouslyFocusedElement = document.activeElement;
|
|
139678
139287
|
for (const candidate of candidates) {
|
|
139679
139288
|
focus(candidate, { select });
|
|
@@ -139754,16 +139363,16 @@ function removeLinks(items) {
|
|
|
139754
139363
|
}
|
|
139755
139364
|
|
|
139756
139365
|
// packages/react/use-layout-effect/src/useLayoutEffect.tsx
|
|
139757
|
-
var useLayoutEffect2 = Boolean(globalThis?.document) ? React__namespace.useLayoutEffect : () => {
|
|
139366
|
+
var useLayoutEffect2$1 = Boolean(globalThis?.document) ? React__namespace.useLayoutEffect : () => {
|
|
139758
139367
|
};
|
|
139759
139368
|
|
|
139760
139369
|
// packages/react/id/src/id.tsx
|
|
139761
|
-
var useReactId = React__namespace["useId".toString()] || (() => void 0);
|
|
139762
|
-
var count = 0;
|
|
139763
|
-
function useId(deterministicId) {
|
|
139764
|
-
const [id, setId] = React__namespace.useState(useReactId());
|
|
139765
|
-
useLayoutEffect2(() => {
|
|
139766
|
-
if (!deterministicId) setId((reactId) => reactId ?? String(count++));
|
|
139370
|
+
var useReactId$1 = React__namespace["useId".toString()] || (() => void 0);
|
|
139371
|
+
var count$1 = 0;
|
|
139372
|
+
function useId$1(deterministicId) {
|
|
139373
|
+
const [id, setId] = React__namespace.useState(useReactId$1());
|
|
139374
|
+
useLayoutEffect2$1(() => {
|
|
139375
|
+
if (!deterministicId) setId((reactId) => reactId ?? String(count$1++));
|
|
139767
139376
|
}, [deterministicId]);
|
|
139768
139377
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
139769
139378
|
}
|
|
@@ -139773,7 +139382,7 @@ var NAME = "Arrow";
|
|
|
139773
139382
|
var Arrow$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
139774
139383
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
139775
139384
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
139776
|
-
Primitive.svg,
|
|
139385
|
+
Primitive$1.svg,
|
|
139777
139386
|
{
|
|
139778
139387
|
...arrowProps,
|
|
139779
139388
|
ref: forwardedRef,
|
|
@@ -139786,10 +139395,10 @@ var Arrow$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
|
139786
139395
|
);
|
|
139787
139396
|
});
|
|
139788
139397
|
Arrow$1.displayName = NAME;
|
|
139789
|
-
var Root = Arrow$1;
|
|
139398
|
+
var Root$1 = Arrow$1;
|
|
139790
139399
|
|
|
139791
139400
|
// packages/react/context/src/createContext.tsx
|
|
139792
|
-
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
139401
|
+
function createContextScope$3(scopeName, createContextScopeDeps = []) {
|
|
139793
139402
|
let defaultContexts = [];
|
|
139794
139403
|
function createContext3(rootComponentName, defaultContext) {
|
|
139795
139404
|
const BaseContext = React__namespace.createContext(defaultContext);
|
|
@@ -139824,9 +139433,9 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
139824
139433
|
};
|
|
139825
139434
|
};
|
|
139826
139435
|
createScope.scopeName = scopeName;
|
|
139827
|
-
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
139436
|
+
return [createContext3, composeContextScopes$3(createScope, ...createContextScopeDeps)];
|
|
139828
139437
|
}
|
|
139829
|
-
function composeContextScopes(...scopes) {
|
|
139438
|
+
function composeContextScopes$3(...scopes) {
|
|
139830
139439
|
const baseScope = scopes[0];
|
|
139831
139440
|
if (scopes.length === 1) return baseScope;
|
|
139832
139441
|
const createScope = () => {
|
|
@@ -139848,9 +139457,9 @@ function composeContextScopes(...scopes) {
|
|
|
139848
139457
|
}
|
|
139849
139458
|
|
|
139850
139459
|
// packages/react/use-size/src/useSize.tsx
|
|
139851
|
-
function useSize(element) {
|
|
139460
|
+
function useSize$1(element) {
|
|
139852
139461
|
const [size, setSize] = React__namespace.useState(void 0);
|
|
139853
|
-
useLayoutEffect2(() => {
|
|
139462
|
+
useLayoutEffect2$1(() => {
|
|
139854
139463
|
if (element) {
|
|
139855
139464
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
139856
139465
|
const resizeObserver = new ResizeObserver((entries) => {
|
|
@@ -139884,7 +139493,7 @@ function useSize(element) {
|
|
|
139884
139493
|
}
|
|
139885
139494
|
|
|
139886
139495
|
var POPPER_NAME = "Popper";
|
|
139887
|
-
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
139496
|
+
var [createPopperContext, createPopperScope] = createContextScope$3(POPPER_NAME);
|
|
139888
139497
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
139889
139498
|
var Popper = (props) => {
|
|
139890
139499
|
const { __scopePopper, children } = props;
|
|
@@ -139898,11 +139507,11 @@ var PopperAnchor = React__namespace.forwardRef(
|
|
|
139898
139507
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
139899
139508
|
const context = usePopperContext(ANCHOR_NAME$1, __scopePopper);
|
|
139900
139509
|
const ref = React__namespace.useRef(null);
|
|
139901
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
139510
|
+
const composedRefs = useComposedRefs$1(forwardedRef, ref);
|
|
139902
139511
|
React__namespace.useEffect(() => {
|
|
139903
139512
|
context.onAnchorChange(virtualRef?.current || ref.current);
|
|
139904
139513
|
});
|
|
139905
|
-
return virtualRef ? null : /* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
139514
|
+
return virtualRef ? null : /* @__PURE__ */ jsxRuntime.jsx(Primitive$1.div, { ...anchorProps, ref: composedRefs });
|
|
139906
139515
|
}
|
|
139907
139516
|
);
|
|
139908
139517
|
PopperAnchor.displayName = ANCHOR_NAME$1;
|
|
@@ -139928,9 +139537,9 @@ var PopperContent = React__namespace.forwardRef(
|
|
|
139928
139537
|
} = props;
|
|
139929
139538
|
const context = usePopperContext(CONTENT_NAME$1, __scopePopper);
|
|
139930
139539
|
const [content, setContent] = React__namespace.useState(null);
|
|
139931
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
139540
|
+
const composedRefs = useComposedRefs$1(forwardedRef, (node) => setContent(node));
|
|
139932
139541
|
const [arrow$1, setArrow] = React__namespace.useState(null);
|
|
139933
|
-
const arrowSize = useSize(arrow$1);
|
|
139542
|
+
const arrowSize = useSize$1(arrow$1);
|
|
139934
139543
|
const arrowWidth = arrowSize?.width ?? 0;
|
|
139935
139544
|
const arrowHeight = arrowSize?.height ?? 0;
|
|
139936
139545
|
const desiredPlacement = side + (align !== "center" ? "-" + align : "");
|
|
@@ -139982,8 +139591,8 @@ var PopperContent = React__namespace.forwardRef(
|
|
|
139982
139591
|
]
|
|
139983
139592
|
});
|
|
139984
139593
|
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
139985
|
-
const handlePlaced = useCallbackRef(onPlaced);
|
|
139986
|
-
useLayoutEffect2(() => {
|
|
139594
|
+
const handlePlaced = useCallbackRef$1(onPlaced);
|
|
139595
|
+
useLayoutEffect2$1(() => {
|
|
139987
139596
|
if (isPositioned) {
|
|
139988
139597
|
handlePlaced?.();
|
|
139989
139598
|
}
|
|
@@ -139992,7 +139601,7 @@ var PopperContent = React__namespace.forwardRef(
|
|
|
139992
139601
|
const arrowY = middlewareData.arrow?.y;
|
|
139993
139602
|
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
139994
139603
|
const [contentZIndex, setContentZIndex] = React__namespace.useState();
|
|
139995
|
-
useLayoutEffect2(() => {
|
|
139604
|
+
useLayoutEffect2$1(() => {
|
|
139996
139605
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
139997
139606
|
}, [content]);
|
|
139998
139607
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -140029,7 +139638,7 @@ var PopperContent = React__namespace.forwardRef(
|
|
|
140029
139638
|
arrowY,
|
|
140030
139639
|
shouldHideArrow: cannotCenterArrow,
|
|
140031
139640
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
140032
|
-
Primitive.div,
|
|
139641
|
+
Primitive$1.div,
|
|
140033
139642
|
{
|
|
140034
139643
|
"data-side": placedSide,
|
|
140035
139644
|
"data-align": placedAlign,
|
|
@@ -140089,7 +139698,7 @@ var PopperArrow = React__namespace.forwardRef(function PopperArrow2(props, forwa
|
|
|
140089
139698
|
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
140090
139699
|
},
|
|
140091
139700
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
140092
|
-
Root,
|
|
139701
|
+
Root$1,
|
|
140093
139702
|
{
|
|
140094
139703
|
...arrowProps,
|
|
140095
139704
|
ref: forwardedRef,
|
|
@@ -140143,7 +139752,7 @@ function getSideAndAlignFromPlacement(placement) {
|
|
|
140143
139752
|
const [side, align = "center"] = placement.split("-");
|
|
140144
139753
|
return [side, align];
|
|
140145
139754
|
}
|
|
140146
|
-
var Root2$
|
|
139755
|
+
var Root2$2 = Popper;
|
|
140147
139756
|
var Anchor = PopperAnchor;
|
|
140148
139757
|
var Content = PopperContent;
|
|
140149
139758
|
var Arrow = PopperArrow;
|
|
@@ -140152,23 +139761,23 @@ var PORTAL_NAME$1 = "Portal";
|
|
|
140152
139761
|
var Portal$1 = React__namespace.forwardRef((props, forwardedRef) => {
|
|
140153
139762
|
const { container: containerProp, ...portalProps } = props;
|
|
140154
139763
|
const [mounted, setMounted] = React__namespace.useState(false);
|
|
140155
|
-
useLayoutEffect2(() => setMounted(true), []);
|
|
139764
|
+
useLayoutEffect2$1(() => setMounted(true), []);
|
|
140156
139765
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
140157
|
-
return container ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntime.jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
139766
|
+
return container ? ReactDOM.createPortal(/* @__PURE__ */ jsxRuntime.jsx(Primitive$1.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
140158
139767
|
});
|
|
140159
139768
|
Portal$1.displayName = PORTAL_NAME$1;
|
|
140160
139769
|
|
|
140161
139770
|
// packages/react/use-controllable-state/src/useControllableState.tsx
|
|
140162
|
-
function useControllableState({
|
|
139771
|
+
function useControllableState$1({
|
|
140163
139772
|
prop,
|
|
140164
139773
|
defaultProp,
|
|
140165
139774
|
onChange = () => {
|
|
140166
139775
|
}
|
|
140167
139776
|
}) {
|
|
140168
|
-
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
|
|
139777
|
+
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState$1({ defaultProp, onChange });
|
|
140169
139778
|
const isControlled = prop !== void 0;
|
|
140170
139779
|
const value = isControlled ? prop : uncontrolledProp;
|
|
140171
|
-
const handleChange = useCallbackRef(onChange);
|
|
139780
|
+
const handleChange = useCallbackRef$1(onChange);
|
|
140172
139781
|
const setValue = React__namespace.useCallback(
|
|
140173
139782
|
(nextValue) => {
|
|
140174
139783
|
if (isControlled) {
|
|
@@ -140183,14 +139792,14 @@ function useControllableState({
|
|
|
140183
139792
|
);
|
|
140184
139793
|
return [value, setValue];
|
|
140185
139794
|
}
|
|
140186
|
-
function useUncontrolledState({
|
|
139795
|
+
function useUncontrolledState$1({
|
|
140187
139796
|
defaultProp,
|
|
140188
139797
|
onChange
|
|
140189
139798
|
}) {
|
|
140190
139799
|
const uncontrolledState = React__namespace.useState(defaultProp);
|
|
140191
139800
|
const [value] = uncontrolledState;
|
|
140192
139801
|
const prevValueRef = React__namespace.useRef(value);
|
|
140193
|
-
const handleChange = useCallbackRef(onChange);
|
|
139802
|
+
const handleChange = useCallbackRef$1(onChange);
|
|
140194
139803
|
React__namespace.useEffect(() => {
|
|
140195
139804
|
if (prevValueRef.current !== value) {
|
|
140196
139805
|
handleChange(value);
|
|
@@ -140520,7 +140129,7 @@ ReactRemoveScroll.classNames = RemoveScroll$1.classNames;
|
|
|
140520
140129
|
var RemoveScroll = ReactRemoveScroll;
|
|
140521
140130
|
|
|
140522
140131
|
var POPOVER_NAME = "Popover";
|
|
140523
|
-
var [createPopoverContext, createPopoverScope] = createContextScope$
|
|
140132
|
+
var [createPopoverContext, createPopoverScope] = createContextScope$4(POPOVER_NAME, [
|
|
140524
140133
|
createPopperScope
|
|
140525
140134
|
]);
|
|
140526
140135
|
var usePopperScope = createPopperScope();
|
|
@@ -140537,16 +140146,16 @@ var Popover$1 = (props) => {
|
|
|
140537
140146
|
const popperScope = usePopperScope(__scopePopover);
|
|
140538
140147
|
const triggerRef = React__namespace.useRef(null);
|
|
140539
140148
|
const [hasCustomAnchor, setHasCustomAnchor] = React__namespace.useState(false);
|
|
140540
|
-
const [open = false, setOpen] = useControllableState({
|
|
140149
|
+
const [open = false, setOpen] = useControllableState$1({
|
|
140541
140150
|
prop: openProp,
|
|
140542
140151
|
defaultProp: defaultOpen,
|
|
140543
140152
|
onChange: onOpenChange
|
|
140544
140153
|
});
|
|
140545
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Root2$
|
|
140154
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Root2$2, { ...popperScope, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
140546
140155
|
PopoverProvider,
|
|
140547
140156
|
{
|
|
140548
140157
|
scope: __scopePopover,
|
|
140549
|
-
contentId: useId(),
|
|
140158
|
+
contentId: useId$1(),
|
|
140550
140159
|
triggerRef,
|
|
140551
140160
|
open,
|
|
140552
140161
|
onOpenChange: setOpen,
|
|
@@ -140581,18 +140190,18 @@ var PopoverTrigger$1 = React__namespace.forwardRef(
|
|
|
140581
140190
|
const { __scopePopover, ...triggerProps } = props;
|
|
140582
140191
|
const context = usePopoverContext(TRIGGER_NAME, __scopePopover);
|
|
140583
140192
|
const popperScope = usePopperScope(__scopePopover);
|
|
140584
|
-
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
140193
|
+
const composedTriggerRef = useComposedRefs$1(forwardedRef, context.triggerRef);
|
|
140585
140194
|
const trigger = /* @__PURE__ */ jsxRuntime.jsx(
|
|
140586
|
-
Primitive.button,
|
|
140195
|
+
Primitive$1.button,
|
|
140587
140196
|
{
|
|
140588
140197
|
type: "button",
|
|
140589
140198
|
"aria-haspopup": "dialog",
|
|
140590
140199
|
"aria-expanded": context.open,
|
|
140591
140200
|
"aria-controls": context.contentId,
|
|
140592
|
-
"data-state": getState(context.open),
|
|
140201
|
+
"data-state": getState$1(context.open),
|
|
140593
140202
|
...triggerProps,
|
|
140594
140203
|
ref: composedTriggerRef,
|
|
140595
|
-
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
140204
|
+
onClick: composeEventHandlers$1(props.onClick, context.onOpenToggle)
|
|
140596
140205
|
}
|
|
140597
140206
|
);
|
|
140598
140207
|
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsxRuntime.jsx(Anchor, { asChild: true, ...popperScope, children: trigger });
|
|
@@ -140623,7 +140232,7 @@ var PopoverContentModal = React__namespace.forwardRef(
|
|
|
140623
140232
|
(props, forwardedRef) => {
|
|
140624
140233
|
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
140625
140234
|
const contentRef = React__namespace.useRef(null);
|
|
140626
|
-
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
140235
|
+
const composedRefs = useComposedRefs$1(forwardedRef, contentRef);
|
|
140627
140236
|
const isRightClickOutsideRef = React__namespace.useRef(false);
|
|
140628
140237
|
React__namespace.useEffect(() => {
|
|
140629
140238
|
const content = contentRef.current;
|
|
@@ -140636,11 +140245,11 @@ var PopoverContentModal = React__namespace.forwardRef(
|
|
|
140636
140245
|
ref: composedRefs,
|
|
140637
140246
|
trapFocus: context.open,
|
|
140638
140247
|
disableOutsidePointerEvents: true,
|
|
140639
|
-
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
140248
|
+
onCloseAutoFocus: composeEventHandlers$1(props.onCloseAutoFocus, (event) => {
|
|
140640
140249
|
event.preventDefault();
|
|
140641
140250
|
if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();
|
|
140642
140251
|
}),
|
|
140643
|
-
onPointerDownOutside: composeEventHandlers(
|
|
140252
|
+
onPointerDownOutside: composeEventHandlers$1(
|
|
140644
140253
|
props.onPointerDownOutside,
|
|
140645
140254
|
(event) => {
|
|
140646
140255
|
const originalEvent = event.detail.originalEvent;
|
|
@@ -140650,7 +140259,7 @@ var PopoverContentModal = React__namespace.forwardRef(
|
|
|
140650
140259
|
},
|
|
140651
140260
|
{ checkForDefaultPrevented: false }
|
|
140652
140261
|
),
|
|
140653
|
-
onFocusOutside: composeEventHandlers(
|
|
140262
|
+
onFocusOutside: composeEventHandlers$1(
|
|
140654
140263
|
props.onFocusOutside,
|
|
140655
140264
|
(event) => event.preventDefault(),
|
|
140656
140265
|
{ checkForDefaultPrevented: false }
|
|
@@ -140737,7 +140346,7 @@ var PopoverContentImpl = React__namespace.forwardRef(
|
|
|
140737
140346
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
140738
140347
|
Content,
|
|
140739
140348
|
{
|
|
140740
|
-
"data-state": getState(context.open),
|
|
140349
|
+
"data-state": getState$1(context.open),
|
|
140741
140350
|
role: "dialog",
|
|
140742
140351
|
id: context.contentId,
|
|
140743
140352
|
...popperScope,
|
|
@@ -140768,12 +140377,12 @@ var PopoverClose = React__namespace.forwardRef(
|
|
|
140768
140377
|
const { __scopePopover, ...closeProps } = props;
|
|
140769
140378
|
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
140770
140379
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
140771
|
-
Primitive.button,
|
|
140380
|
+
Primitive$1.button,
|
|
140772
140381
|
{
|
|
140773
140382
|
type: "button",
|
|
140774
140383
|
...closeProps,
|
|
140775
140384
|
ref: forwardedRef,
|
|
140776
|
-
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
|
140385
|
+
onClick: composeEventHandlers$1(props.onClick, () => context.onOpenChange(false))
|
|
140777
140386
|
}
|
|
140778
140387
|
);
|
|
140779
140388
|
}
|
|
@@ -140788,15 +140397,15 @@ var PopoverArrow = React__namespace.forwardRef(
|
|
|
140788
140397
|
}
|
|
140789
140398
|
);
|
|
140790
140399
|
PopoverArrow.displayName = ARROW_NAME;
|
|
140791
|
-
function getState(open) {
|
|
140400
|
+
function getState$1(open) {
|
|
140792
140401
|
return open ? "open" : "closed";
|
|
140793
140402
|
}
|
|
140794
|
-
var Root2 = Popover$1;
|
|
140403
|
+
var Root2$1 = Popover$1;
|
|
140795
140404
|
var Trigger = PopoverTrigger$1;
|
|
140796
140405
|
var Portal = PopoverPortal;
|
|
140797
140406
|
var Content2 = PopoverContent$1;
|
|
140798
140407
|
|
|
140799
|
-
var PopoverRoot = Root2;
|
|
140408
|
+
var PopoverRoot = Root2$1;
|
|
140800
140409
|
var PopoverTrigger = Trigger;
|
|
140801
140410
|
var PopoverContent = React__namespace.forwardRef(function (_a, ref) {
|
|
140802
140411
|
var className = _a.className, _b = _a.align, align = _b === void 0 ? "center" : _b, _c = _a.sideOffset, sideOffset = _c === void 0 ? 4 : _c, _d = _a.fullWidth, fullWidth = _d === void 0 ? false : _d, props = __rest(_a, ["className", "align", "sideOffset", "fullWidth"]);
|
|
@@ -140905,30 +140514,951 @@ PriceTable.Container = function (_a) {
|
|
|
140905
140514
|
return (React.createElement("div", { className: "s-flex s-w-full s-items-stretch s-gap-3" }, children));
|
|
140906
140515
|
};
|
|
140907
140516
|
|
|
140908
|
-
|
|
140909
|
-
|
|
140910
|
-
|
|
140517
|
+
// packages/core/primitive/src/primitive.tsx
|
|
140518
|
+
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
140519
|
+
return function handleEvent(event) {
|
|
140520
|
+
originalEventHandler?.(event);
|
|
140521
|
+
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
140522
|
+
return ourEventHandler?.(event);
|
|
140523
|
+
}
|
|
140524
|
+
};
|
|
140525
|
+
}
|
|
140526
|
+
|
|
140527
|
+
// packages/react/compose-refs/src/composeRefs.tsx
|
|
140528
|
+
function setRef(ref, value) {
|
|
140529
|
+
if (typeof ref === "function") {
|
|
140530
|
+
ref(value);
|
|
140531
|
+
} else if (ref !== null && ref !== void 0) {
|
|
140532
|
+
ref.current = value;
|
|
140533
|
+
}
|
|
140534
|
+
}
|
|
140535
|
+
function composeRefs(...refs) {
|
|
140536
|
+
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
140537
|
+
}
|
|
140538
|
+
function useComposedRefs(...refs) {
|
|
140539
|
+
return React__namespace.useCallback(composeRefs(...refs), refs);
|
|
140540
|
+
}
|
|
140541
|
+
|
|
140542
|
+
// packages/react/context/src/createContext.tsx
|
|
140543
|
+
function createContextScope$2(scopeName, createContextScopeDeps = []) {
|
|
140544
|
+
let defaultContexts = [];
|
|
140545
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
140546
|
+
const BaseContext = React__namespace.createContext(defaultContext);
|
|
140547
|
+
const index = defaultContexts.length;
|
|
140548
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
140549
|
+
const Provider = (props) => {
|
|
140550
|
+
const { scope, children, ...context } = props;
|
|
140551
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
140552
|
+
const value = React__namespace.useMemo(() => context, Object.values(context));
|
|
140553
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
|
|
140554
|
+
};
|
|
140555
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
140556
|
+
function useContext2(consumerName, scope) {
|
|
140557
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
140558
|
+
const context = React__namespace.useContext(Context);
|
|
140559
|
+
if (context) return context;
|
|
140560
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
140561
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
140562
|
+
}
|
|
140563
|
+
return [Provider, useContext2];
|
|
140564
|
+
}
|
|
140565
|
+
const createScope = () => {
|
|
140566
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
140567
|
+
return React__namespace.createContext(defaultContext);
|
|
140568
|
+
});
|
|
140569
|
+
return function useScope(scope) {
|
|
140570
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
140571
|
+
return React__namespace.useMemo(
|
|
140572
|
+
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
140573
|
+
[scope, contexts]
|
|
140574
|
+
);
|
|
140575
|
+
};
|
|
140576
|
+
};
|
|
140577
|
+
createScope.scopeName = scopeName;
|
|
140578
|
+
return [createContext3, composeContextScopes$2(createScope, ...createContextScopeDeps)];
|
|
140579
|
+
}
|
|
140580
|
+
function composeContextScopes$2(...scopes) {
|
|
140581
|
+
const baseScope = scopes[0];
|
|
140582
|
+
if (scopes.length === 1) return baseScope;
|
|
140583
|
+
const createScope = () => {
|
|
140584
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
140585
|
+
useScope: createScope2(),
|
|
140586
|
+
scopeName: createScope2.scopeName
|
|
140587
|
+
}));
|
|
140588
|
+
return function useComposedScopes(overrideScopes) {
|
|
140589
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
140590
|
+
const scopeProps = useScope(overrideScopes);
|
|
140591
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
140592
|
+
return { ...nextScopes2, ...currentScope };
|
|
140593
|
+
}, {});
|
|
140594
|
+
return React__namespace.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
140595
|
+
};
|
|
140596
|
+
};
|
|
140597
|
+
createScope.scopeName = baseScope.scopeName;
|
|
140598
|
+
return createScope;
|
|
140599
|
+
}
|
|
140600
|
+
|
|
140601
|
+
// packages/react/primitive/src/Primitive.tsx
|
|
140602
|
+
var NODES = [
|
|
140603
|
+
"a",
|
|
140604
|
+
"button",
|
|
140605
|
+
"div",
|
|
140606
|
+
"form",
|
|
140607
|
+
"h2",
|
|
140608
|
+
"h3",
|
|
140609
|
+
"img",
|
|
140610
|
+
"input",
|
|
140611
|
+
"label",
|
|
140612
|
+
"li",
|
|
140613
|
+
"nav",
|
|
140614
|
+
"ol",
|
|
140615
|
+
"p",
|
|
140616
|
+
"span",
|
|
140617
|
+
"svg",
|
|
140618
|
+
"ul"
|
|
140619
|
+
];
|
|
140620
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
|
140621
|
+
const Node = React__namespace.forwardRef((props, forwardedRef) => {
|
|
140622
|
+
const { asChild, ...primitiveProps } = props;
|
|
140623
|
+
const Comp = asChild ? Slot : node;
|
|
140624
|
+
if (typeof window !== "undefined") {
|
|
140625
|
+
window[Symbol.for("radix-ui")] = true;
|
|
140626
|
+
}
|
|
140627
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
140628
|
+
});
|
|
140629
|
+
Node.displayName = `Primitive.${node}`;
|
|
140630
|
+
return { ...primitive, [node]: Node };
|
|
140631
|
+
}, {});
|
|
140632
|
+
|
|
140633
|
+
// packages/react/context/src/createContext.tsx
|
|
140634
|
+
function createContextScope$1(scopeName, createContextScopeDeps = []) {
|
|
140635
|
+
let defaultContexts = [];
|
|
140636
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
140637
|
+
const BaseContext = React__namespace.createContext(defaultContext);
|
|
140638
|
+
const index = defaultContexts.length;
|
|
140639
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
140640
|
+
function Provider(props) {
|
|
140641
|
+
const { scope, children, ...context } = props;
|
|
140642
|
+
const Context = scope?.[scopeName][index] || BaseContext;
|
|
140643
|
+
const value = React__namespace.useMemo(() => context, Object.values(context));
|
|
140644
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
|
|
140645
|
+
}
|
|
140646
|
+
function useContext2(consumerName, scope) {
|
|
140647
|
+
const Context = scope?.[scopeName][index] || BaseContext;
|
|
140648
|
+
const context = React__namespace.useContext(Context);
|
|
140649
|
+
if (context) return context;
|
|
140650
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
140651
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
140652
|
+
}
|
|
140653
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
140654
|
+
return [Provider, useContext2];
|
|
140655
|
+
}
|
|
140656
|
+
const createScope = () => {
|
|
140657
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
140658
|
+
return React__namespace.createContext(defaultContext);
|
|
140659
|
+
});
|
|
140660
|
+
return function useScope(scope) {
|
|
140661
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
140662
|
+
return React__namespace.useMemo(
|
|
140663
|
+
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
140664
|
+
[scope, contexts]
|
|
140665
|
+
);
|
|
140666
|
+
};
|
|
140667
|
+
};
|
|
140668
|
+
createScope.scopeName = scopeName;
|
|
140669
|
+
return [createContext3, composeContextScopes$1(createScope, ...createContextScopeDeps)];
|
|
140670
|
+
}
|
|
140671
|
+
function composeContextScopes$1(...scopes) {
|
|
140672
|
+
const baseScope = scopes[0];
|
|
140673
|
+
if (scopes.length === 1) return baseScope;
|
|
140674
|
+
const createScope = () => {
|
|
140675
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
140676
|
+
useScope: createScope2(),
|
|
140677
|
+
scopeName: createScope2.scopeName
|
|
140678
|
+
}));
|
|
140679
|
+
return function useComposedScopes(overrideScopes) {
|
|
140680
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
140681
|
+
const scopeProps = useScope(overrideScopes);
|
|
140682
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
140683
|
+
return { ...nextScopes2, ...currentScope };
|
|
140684
|
+
}, {});
|
|
140685
|
+
return React__namespace.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
140686
|
+
};
|
|
140687
|
+
};
|
|
140688
|
+
createScope.scopeName = baseScope.scopeName;
|
|
140689
|
+
return createScope;
|
|
140690
|
+
}
|
|
140691
|
+
|
|
140692
|
+
function createCollection(name) {
|
|
140693
|
+
const PROVIDER_NAME = name + "CollectionProvider";
|
|
140694
|
+
const [createCollectionContext, createCollectionScope] = createContextScope$1(PROVIDER_NAME);
|
|
140695
|
+
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
|
140696
|
+
PROVIDER_NAME,
|
|
140697
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
140698
|
+
);
|
|
140699
|
+
const CollectionProvider = (props) => {
|
|
140700
|
+
const { scope, children } = props;
|
|
140701
|
+
const ref = React.useRef(null);
|
|
140702
|
+
const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;
|
|
140703
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
140704
|
+
};
|
|
140705
|
+
CollectionProvider.displayName = PROVIDER_NAME;
|
|
140706
|
+
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
140707
|
+
const CollectionSlot = React.forwardRef(
|
|
140708
|
+
(props, forwardedRef) => {
|
|
140709
|
+
const { scope, children } = props;
|
|
140710
|
+
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
140711
|
+
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
140712
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Slot, { ref: composedRefs, children });
|
|
140713
|
+
}
|
|
140714
|
+
);
|
|
140715
|
+
CollectionSlot.displayName = COLLECTION_SLOT_NAME;
|
|
140716
|
+
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
140717
|
+
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
140718
|
+
const CollectionItemSlot = React.forwardRef(
|
|
140719
|
+
(props, forwardedRef) => {
|
|
140720
|
+
const { scope, children, ...itemData } = props;
|
|
140721
|
+
const ref = React.useRef(null);
|
|
140722
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
140723
|
+
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
140724
|
+
React.useEffect(() => {
|
|
140725
|
+
context.itemMap.set(ref, { ref, ...itemData });
|
|
140726
|
+
return () => void context.itemMap.delete(ref);
|
|
140727
|
+
});
|
|
140728
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Slot, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
|
|
140729
|
+
}
|
|
140730
|
+
);
|
|
140731
|
+
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
140732
|
+
function useCollection(scope) {
|
|
140733
|
+
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
140734
|
+
const getItems = React.useCallback(() => {
|
|
140735
|
+
const collectionNode = context.collectionRef.current;
|
|
140736
|
+
if (!collectionNode) return [];
|
|
140737
|
+
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
140738
|
+
const items = Array.from(context.itemMap.values());
|
|
140739
|
+
const orderedItems = items.sort(
|
|
140740
|
+
(a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
|
|
140741
|
+
);
|
|
140742
|
+
return orderedItems;
|
|
140743
|
+
}, [context.collectionRef, context.itemMap]);
|
|
140744
|
+
return getItems;
|
|
140745
|
+
}
|
|
140746
|
+
return [
|
|
140747
|
+
{ Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
|
|
140748
|
+
useCollection,
|
|
140749
|
+
createCollectionScope
|
|
140750
|
+
];
|
|
140751
|
+
}
|
|
140752
|
+
|
|
140753
|
+
// packages/react/context/src/createContext.tsx
|
|
140754
|
+
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
140755
|
+
let defaultContexts = [];
|
|
140756
|
+
function createContext3(rootComponentName, defaultContext) {
|
|
140757
|
+
const BaseContext = React__namespace.createContext(defaultContext);
|
|
140758
|
+
const index = defaultContexts.length;
|
|
140759
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
140760
|
+
function Provider(props) {
|
|
140761
|
+
const { scope, children, ...context } = props;
|
|
140762
|
+
const Context = scope?.[scopeName][index] || BaseContext;
|
|
140763
|
+
const value = React__namespace.useMemo(() => context, Object.values(context));
|
|
140764
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
|
|
140765
|
+
}
|
|
140766
|
+
function useContext2(consumerName, scope) {
|
|
140767
|
+
const Context = scope?.[scopeName][index] || BaseContext;
|
|
140768
|
+
const context = React__namespace.useContext(Context);
|
|
140769
|
+
if (context) return context;
|
|
140770
|
+
if (defaultContext !== void 0) return defaultContext;
|
|
140771
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
140772
|
+
}
|
|
140773
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
140774
|
+
return [Provider, useContext2];
|
|
140775
|
+
}
|
|
140776
|
+
const createScope = () => {
|
|
140777
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
140778
|
+
return React__namespace.createContext(defaultContext);
|
|
140779
|
+
});
|
|
140780
|
+
return function useScope(scope) {
|
|
140781
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
140782
|
+
return React__namespace.useMemo(
|
|
140783
|
+
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
140784
|
+
[scope, contexts]
|
|
140785
|
+
);
|
|
140786
|
+
};
|
|
140787
|
+
};
|
|
140788
|
+
createScope.scopeName = scopeName;
|
|
140789
|
+
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
140790
|
+
}
|
|
140791
|
+
function composeContextScopes(...scopes) {
|
|
140792
|
+
const baseScope = scopes[0];
|
|
140793
|
+
if (scopes.length === 1) return baseScope;
|
|
140794
|
+
const createScope = () => {
|
|
140795
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
140796
|
+
useScope: createScope2(),
|
|
140797
|
+
scopeName: createScope2.scopeName
|
|
140798
|
+
}));
|
|
140799
|
+
return function useComposedScopes(overrideScopes) {
|
|
140800
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
140801
|
+
const scopeProps = useScope(overrideScopes);
|
|
140802
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
140803
|
+
return { ...nextScopes2, ...currentScope };
|
|
140804
|
+
}, {});
|
|
140805
|
+
return React__namespace.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
140806
|
+
};
|
|
140807
|
+
};
|
|
140808
|
+
createScope.scopeName = baseScope.scopeName;
|
|
140809
|
+
return createScope;
|
|
140810
|
+
}
|
|
140811
|
+
|
|
140812
|
+
// packages/react/use-layout-effect/src/useLayoutEffect.tsx
|
|
140813
|
+
var useLayoutEffect2 = Boolean(globalThis?.document) ? React__namespace.useLayoutEffect : () => {
|
|
140911
140814
|
};
|
|
140912
|
-
|
|
140913
|
-
|
|
140914
|
-
|
|
140915
|
-
|
|
140916
|
-
|
|
140815
|
+
|
|
140816
|
+
// packages/react/id/src/id.tsx
|
|
140817
|
+
var useReactId = React__namespace["useId".toString()] || (() => void 0);
|
|
140818
|
+
var count = 0;
|
|
140819
|
+
function useId(deterministicId) {
|
|
140820
|
+
const [id, setId] = React__namespace.useState(useReactId());
|
|
140821
|
+
useLayoutEffect2(() => {
|
|
140822
|
+
if (!deterministicId) setId((reactId) => reactId ?? String(count++));
|
|
140823
|
+
}, [deterministicId]);
|
|
140824
|
+
return deterministicId || (id ? `radix-${id}` : "");
|
|
140825
|
+
}
|
|
140826
|
+
|
|
140827
|
+
// packages/react/use-callback-ref/src/useCallbackRef.tsx
|
|
140828
|
+
function useCallbackRef(callback) {
|
|
140829
|
+
const callbackRef = React__namespace.useRef(callback);
|
|
140830
|
+
React__namespace.useEffect(() => {
|
|
140831
|
+
callbackRef.current = callback;
|
|
140832
|
+
});
|
|
140833
|
+
return React__namespace.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
140834
|
+
}
|
|
140835
|
+
|
|
140836
|
+
// packages/react/use-controllable-state/src/useControllableState.tsx
|
|
140837
|
+
function useControllableState({
|
|
140838
|
+
prop,
|
|
140839
|
+
defaultProp,
|
|
140840
|
+
onChange = () => {
|
|
140841
|
+
}
|
|
140842
|
+
}) {
|
|
140843
|
+
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
|
|
140844
|
+
const isControlled = prop !== void 0;
|
|
140845
|
+
const value = isControlled ? prop : uncontrolledProp;
|
|
140846
|
+
const handleChange = useCallbackRef(onChange);
|
|
140847
|
+
const setValue = React__namespace.useCallback(
|
|
140848
|
+
(nextValue) => {
|
|
140849
|
+
if (isControlled) {
|
|
140850
|
+
const setter = nextValue;
|
|
140851
|
+
const value2 = typeof nextValue === "function" ? setter(prop) : nextValue;
|
|
140852
|
+
if (value2 !== prop) handleChange(value2);
|
|
140853
|
+
} else {
|
|
140854
|
+
setUncontrolledProp(nextValue);
|
|
140855
|
+
}
|
|
140856
|
+
},
|
|
140857
|
+
[isControlled, prop, setUncontrolledProp, handleChange]
|
|
140858
|
+
);
|
|
140859
|
+
return [value, setValue];
|
|
140860
|
+
}
|
|
140861
|
+
function useUncontrolledState({
|
|
140862
|
+
defaultProp,
|
|
140863
|
+
onChange
|
|
140864
|
+
}) {
|
|
140865
|
+
const uncontrolledState = React__namespace.useState(defaultProp);
|
|
140866
|
+
const [value] = uncontrolledState;
|
|
140867
|
+
const prevValueRef = React__namespace.useRef(value);
|
|
140868
|
+
const handleChange = useCallbackRef(onChange);
|
|
140869
|
+
React__namespace.useEffect(() => {
|
|
140870
|
+
if (prevValueRef.current !== value) {
|
|
140871
|
+
handleChange(value);
|
|
140872
|
+
prevValueRef.current = value;
|
|
140873
|
+
}
|
|
140874
|
+
}, [value, prevValueRef, handleChange]);
|
|
140875
|
+
return uncontrolledState;
|
|
140876
|
+
}
|
|
140877
|
+
|
|
140878
|
+
// packages/react/direction/src/Direction.tsx
|
|
140879
|
+
var DirectionContext = React__namespace.createContext(void 0);
|
|
140880
|
+
function useDirection(localDir) {
|
|
140881
|
+
const globalDir = React__namespace.useContext(DirectionContext);
|
|
140882
|
+
return localDir || globalDir || "ltr";
|
|
140883
|
+
}
|
|
140884
|
+
|
|
140885
|
+
var ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
|
|
140886
|
+
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
140887
|
+
var GROUP_NAME = "RovingFocusGroup";
|
|
140888
|
+
var [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);
|
|
140889
|
+
var [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(
|
|
140890
|
+
GROUP_NAME,
|
|
140891
|
+
[createCollectionScope]
|
|
140892
|
+
);
|
|
140893
|
+
var [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);
|
|
140894
|
+
var RovingFocusGroup = React__namespace.forwardRef(
|
|
140895
|
+
(props, forwardedRef) => {
|
|
140896
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntime.jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsxRuntime.jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });
|
|
140897
|
+
}
|
|
140898
|
+
);
|
|
140899
|
+
RovingFocusGroup.displayName = GROUP_NAME;
|
|
140900
|
+
var RovingFocusGroupImpl = React__namespace.forwardRef((props, forwardedRef) => {
|
|
140901
|
+
const {
|
|
140902
|
+
__scopeRovingFocusGroup,
|
|
140903
|
+
orientation,
|
|
140904
|
+
loop = false,
|
|
140905
|
+
dir,
|
|
140906
|
+
currentTabStopId: currentTabStopIdProp,
|
|
140907
|
+
defaultCurrentTabStopId,
|
|
140908
|
+
onCurrentTabStopIdChange,
|
|
140909
|
+
onEntryFocus,
|
|
140910
|
+
preventScrollOnEntryFocus = false,
|
|
140911
|
+
...groupProps
|
|
140912
|
+
} = props;
|
|
140913
|
+
const ref = React__namespace.useRef(null);
|
|
140914
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
140915
|
+
const direction = useDirection(dir);
|
|
140916
|
+
const [currentTabStopId = null, setCurrentTabStopId] = useControllableState({
|
|
140917
|
+
prop: currentTabStopIdProp,
|
|
140918
|
+
defaultProp: defaultCurrentTabStopId,
|
|
140919
|
+
onChange: onCurrentTabStopIdChange
|
|
140920
|
+
});
|
|
140921
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = React__namespace.useState(false);
|
|
140922
|
+
const handleEntryFocus = useCallbackRef(onEntryFocus);
|
|
140923
|
+
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
140924
|
+
const isClickFocusRef = React__namespace.useRef(false);
|
|
140925
|
+
const [focusableItemsCount, setFocusableItemsCount] = React__namespace.useState(0);
|
|
140926
|
+
React__namespace.useEffect(() => {
|
|
140927
|
+
const node = ref.current;
|
|
140928
|
+
if (node) {
|
|
140929
|
+
node.addEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
140930
|
+
return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);
|
|
140931
|
+
}
|
|
140932
|
+
}, [handleEntryFocus]);
|
|
140933
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
140934
|
+
RovingFocusProvider,
|
|
140935
|
+
{
|
|
140936
|
+
scope: __scopeRovingFocusGroup,
|
|
140937
|
+
orientation,
|
|
140938
|
+
dir: direction,
|
|
140939
|
+
loop,
|
|
140940
|
+
currentTabStopId,
|
|
140941
|
+
onItemFocus: React__namespace.useCallback(
|
|
140942
|
+
(tabStopId) => setCurrentTabStopId(tabStopId),
|
|
140943
|
+
[setCurrentTabStopId]
|
|
140944
|
+
),
|
|
140945
|
+
onItemShiftTab: React__namespace.useCallback(() => setIsTabbingBackOut(true), []),
|
|
140946
|
+
onFocusableItemAdd: React__namespace.useCallback(
|
|
140947
|
+
() => setFocusableItemsCount((prevCount) => prevCount + 1),
|
|
140948
|
+
[]
|
|
140949
|
+
),
|
|
140950
|
+
onFocusableItemRemove: React__namespace.useCallback(
|
|
140951
|
+
() => setFocusableItemsCount((prevCount) => prevCount - 1),
|
|
140952
|
+
[]
|
|
140953
|
+
),
|
|
140954
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
140955
|
+
Primitive.div,
|
|
140956
|
+
{
|
|
140957
|
+
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
140958
|
+
"data-orientation": orientation,
|
|
140959
|
+
...groupProps,
|
|
140960
|
+
ref: composedRefs,
|
|
140961
|
+
style: { outline: "none", ...props.style },
|
|
140962
|
+
onMouseDown: composeEventHandlers(props.onMouseDown, () => {
|
|
140963
|
+
isClickFocusRef.current = true;
|
|
140964
|
+
}),
|
|
140965
|
+
onFocus: composeEventHandlers(props.onFocus, (event) => {
|
|
140966
|
+
const isKeyboardFocus = !isClickFocusRef.current;
|
|
140967
|
+
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
140968
|
+
const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
|
|
140969
|
+
event.currentTarget.dispatchEvent(entryFocusEvent);
|
|
140970
|
+
if (!entryFocusEvent.defaultPrevented) {
|
|
140971
|
+
const items = getItems().filter((item) => item.focusable);
|
|
140972
|
+
const activeItem = items.find((item) => item.active);
|
|
140973
|
+
const currentItem = items.find((item) => item.id === currentTabStopId);
|
|
140974
|
+
const candidateItems = [activeItem, currentItem, ...items].filter(
|
|
140975
|
+
Boolean
|
|
140976
|
+
);
|
|
140977
|
+
const candidateNodes = candidateItems.map((item) => item.ref.current);
|
|
140978
|
+
focusFirst(candidateNodes, preventScrollOnEntryFocus);
|
|
140979
|
+
}
|
|
140980
|
+
}
|
|
140981
|
+
isClickFocusRef.current = false;
|
|
140982
|
+
}),
|
|
140983
|
+
onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))
|
|
140984
|
+
}
|
|
140985
|
+
)
|
|
140986
|
+
}
|
|
140987
|
+
);
|
|
140988
|
+
});
|
|
140989
|
+
var ITEM_NAME$1 = "RovingFocusGroupItem";
|
|
140990
|
+
var RovingFocusGroupItem = React__namespace.forwardRef(
|
|
140991
|
+
(props, forwardedRef) => {
|
|
140992
|
+
const {
|
|
140993
|
+
__scopeRovingFocusGroup,
|
|
140994
|
+
focusable = true,
|
|
140995
|
+
active = false,
|
|
140996
|
+
tabStopId,
|
|
140997
|
+
...itemProps
|
|
140998
|
+
} = props;
|
|
140999
|
+
const autoId = useId();
|
|
141000
|
+
const id = tabStopId || autoId;
|
|
141001
|
+
const context = useRovingFocusContext(ITEM_NAME$1, __scopeRovingFocusGroup);
|
|
141002
|
+
const isCurrentTabStop = context.currentTabStopId === id;
|
|
141003
|
+
const getItems = useCollection(__scopeRovingFocusGroup);
|
|
141004
|
+
const { onFocusableItemAdd, onFocusableItemRemove } = context;
|
|
141005
|
+
React__namespace.useEffect(() => {
|
|
141006
|
+
if (focusable) {
|
|
141007
|
+
onFocusableItemAdd();
|
|
141008
|
+
return () => onFocusableItemRemove();
|
|
141009
|
+
}
|
|
141010
|
+
}, [focusable, onFocusableItemAdd, onFocusableItemRemove]);
|
|
141011
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
141012
|
+
Collection.ItemSlot,
|
|
141013
|
+
{
|
|
141014
|
+
scope: __scopeRovingFocusGroup,
|
|
141015
|
+
id,
|
|
141016
|
+
focusable,
|
|
141017
|
+
active,
|
|
141018
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
141019
|
+
Primitive.span,
|
|
141020
|
+
{
|
|
141021
|
+
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
141022
|
+
"data-orientation": context.orientation,
|
|
141023
|
+
...itemProps,
|
|
141024
|
+
ref: forwardedRef,
|
|
141025
|
+
onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {
|
|
141026
|
+
if (!focusable) event.preventDefault();
|
|
141027
|
+
else context.onItemFocus(id);
|
|
141028
|
+
}),
|
|
141029
|
+
onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),
|
|
141030
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
141031
|
+
if (event.key === "Tab" && event.shiftKey) {
|
|
141032
|
+
context.onItemShiftTab();
|
|
141033
|
+
return;
|
|
141034
|
+
}
|
|
141035
|
+
if (event.target !== event.currentTarget) return;
|
|
141036
|
+
const focusIntent = getFocusIntent(event, context.orientation, context.dir);
|
|
141037
|
+
if (focusIntent !== void 0) {
|
|
141038
|
+
if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;
|
|
141039
|
+
event.preventDefault();
|
|
141040
|
+
const items = getItems().filter((item) => item.focusable);
|
|
141041
|
+
let candidateNodes = items.map((item) => item.ref.current);
|
|
141042
|
+
if (focusIntent === "last") candidateNodes.reverse();
|
|
141043
|
+
else if (focusIntent === "prev" || focusIntent === "next") {
|
|
141044
|
+
if (focusIntent === "prev") candidateNodes.reverse();
|
|
141045
|
+
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
141046
|
+
candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
141047
|
+
}
|
|
141048
|
+
setTimeout(() => focusFirst(candidateNodes));
|
|
141049
|
+
}
|
|
141050
|
+
})
|
|
141051
|
+
}
|
|
141052
|
+
)
|
|
141053
|
+
}
|
|
141054
|
+
);
|
|
141055
|
+
}
|
|
141056
|
+
);
|
|
141057
|
+
RovingFocusGroupItem.displayName = ITEM_NAME$1;
|
|
141058
|
+
var MAP_KEY_TO_FOCUS_INTENT = {
|
|
141059
|
+
ArrowLeft: "prev",
|
|
141060
|
+
ArrowUp: "prev",
|
|
141061
|
+
ArrowRight: "next",
|
|
141062
|
+
ArrowDown: "next",
|
|
141063
|
+
PageUp: "first",
|
|
141064
|
+
Home: "first",
|
|
141065
|
+
PageDown: "last",
|
|
141066
|
+
End: "last"
|
|
140917
141067
|
};
|
|
140918
|
-
function
|
|
140919
|
-
|
|
140920
|
-
|
|
140921
|
-
|
|
140922
|
-
|
|
140923
|
-
|
|
140924
|
-
|
|
140925
|
-
|
|
140926
|
-
|
|
140927
|
-
|
|
140928
|
-
|
|
140929
|
-
|
|
141068
|
+
function getDirectionAwareKey(key, dir) {
|
|
141069
|
+
if (dir !== "rtl") return key;
|
|
141070
|
+
return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
141071
|
+
}
|
|
141072
|
+
function getFocusIntent(event, orientation, dir) {
|
|
141073
|
+
const key = getDirectionAwareKey(event.key, dir);
|
|
141074
|
+
if (orientation === "vertical" && ["ArrowLeft", "ArrowRight"].includes(key)) return void 0;
|
|
141075
|
+
if (orientation === "horizontal" && ["ArrowUp", "ArrowDown"].includes(key)) return void 0;
|
|
141076
|
+
return MAP_KEY_TO_FOCUS_INTENT[key];
|
|
141077
|
+
}
|
|
141078
|
+
function focusFirst(candidates, preventScroll = false) {
|
|
141079
|
+
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
141080
|
+
for (const candidate of candidates) {
|
|
141081
|
+
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
141082
|
+
candidate.focus({ preventScroll });
|
|
141083
|
+
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
141084
|
+
}
|
|
141085
|
+
}
|
|
141086
|
+
function wrapArray(array, startIndex) {
|
|
141087
|
+
return array.map((_, index) => array[(startIndex + index) % array.length]);
|
|
141088
|
+
}
|
|
141089
|
+
var Root = RovingFocusGroup;
|
|
141090
|
+
var Item = RovingFocusGroupItem;
|
|
141091
|
+
|
|
141092
|
+
// packages/react/use-size/src/useSize.tsx
|
|
141093
|
+
function useSize(element) {
|
|
141094
|
+
const [size, setSize] = React__namespace.useState(void 0);
|
|
141095
|
+
useLayoutEffect2(() => {
|
|
141096
|
+
if (element) {
|
|
141097
|
+
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
141098
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
141099
|
+
if (!Array.isArray(entries)) {
|
|
141100
|
+
return;
|
|
141101
|
+
}
|
|
141102
|
+
if (!entries.length) {
|
|
141103
|
+
return;
|
|
141104
|
+
}
|
|
141105
|
+
const entry = entries[0];
|
|
141106
|
+
let width;
|
|
141107
|
+
let height;
|
|
141108
|
+
if ("borderBoxSize" in entry) {
|
|
141109
|
+
const borderSizeEntry = entry["borderBoxSize"];
|
|
141110
|
+
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
|
141111
|
+
width = borderSize["inlineSize"];
|
|
141112
|
+
height = borderSize["blockSize"];
|
|
141113
|
+
} else {
|
|
141114
|
+
width = element.offsetWidth;
|
|
141115
|
+
height = element.offsetHeight;
|
|
141116
|
+
}
|
|
141117
|
+
setSize({ width, height });
|
|
141118
|
+
});
|
|
141119
|
+
resizeObserver.observe(element, { box: "border-box" });
|
|
141120
|
+
return () => resizeObserver.unobserve(element);
|
|
141121
|
+
} else {
|
|
141122
|
+
setSize(void 0);
|
|
141123
|
+
}
|
|
141124
|
+
}, [element]);
|
|
141125
|
+
return size;
|
|
141126
|
+
}
|
|
141127
|
+
|
|
141128
|
+
// packages/react/use-previous/src/usePrevious.tsx
|
|
141129
|
+
function usePrevious(value) {
|
|
141130
|
+
const ref = React__namespace.useRef({ value, previous: value });
|
|
141131
|
+
return React__namespace.useMemo(() => {
|
|
141132
|
+
if (ref.current.value !== value) {
|
|
141133
|
+
ref.current.previous = ref.current.value;
|
|
141134
|
+
ref.current.value = value;
|
|
141135
|
+
}
|
|
141136
|
+
return ref.current.previous;
|
|
141137
|
+
}, [value]);
|
|
140930
141138
|
}
|
|
140931
141139
|
|
|
141140
|
+
var RADIO_NAME = "Radio";
|
|
141141
|
+
var [createRadioContext, createRadioScope] = createContextScope$2(RADIO_NAME);
|
|
141142
|
+
var [RadioProvider, useRadioContext] = createRadioContext(RADIO_NAME);
|
|
141143
|
+
var Radio = React__namespace.forwardRef(
|
|
141144
|
+
(props, forwardedRef) => {
|
|
141145
|
+
const {
|
|
141146
|
+
__scopeRadio,
|
|
141147
|
+
name,
|
|
141148
|
+
checked = false,
|
|
141149
|
+
required,
|
|
141150
|
+
disabled,
|
|
141151
|
+
value = "on",
|
|
141152
|
+
onCheck,
|
|
141153
|
+
form,
|
|
141154
|
+
...radioProps
|
|
141155
|
+
} = props;
|
|
141156
|
+
const [button, setButton] = React__namespace.useState(null);
|
|
141157
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setButton(node));
|
|
141158
|
+
const hasConsumerStoppedPropagationRef = React__namespace.useRef(false);
|
|
141159
|
+
const isFormControl = button ? form || !!button.closest("form") : true;
|
|
141160
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(RadioProvider, { scope: __scopeRadio, checked, disabled, children: [
|
|
141161
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
141162
|
+
Primitive.button,
|
|
141163
|
+
{
|
|
141164
|
+
type: "button",
|
|
141165
|
+
role: "radio",
|
|
141166
|
+
"aria-checked": checked,
|
|
141167
|
+
"data-state": getState(checked),
|
|
141168
|
+
"data-disabled": disabled ? "" : void 0,
|
|
141169
|
+
disabled,
|
|
141170
|
+
value,
|
|
141171
|
+
...radioProps,
|
|
141172
|
+
ref: composedRefs,
|
|
141173
|
+
onClick: composeEventHandlers(props.onClick, (event) => {
|
|
141174
|
+
if (!checked) onCheck?.();
|
|
141175
|
+
if (isFormControl) {
|
|
141176
|
+
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
|
141177
|
+
if (!hasConsumerStoppedPropagationRef.current) event.stopPropagation();
|
|
141178
|
+
}
|
|
141179
|
+
})
|
|
141180
|
+
}
|
|
141181
|
+
),
|
|
141182
|
+
isFormControl && /* @__PURE__ */ jsxRuntime.jsx(
|
|
141183
|
+
BubbleInput,
|
|
141184
|
+
{
|
|
141185
|
+
control: button,
|
|
141186
|
+
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
141187
|
+
name,
|
|
141188
|
+
value,
|
|
141189
|
+
checked,
|
|
141190
|
+
required,
|
|
141191
|
+
disabled,
|
|
141192
|
+
form,
|
|
141193
|
+
style: { transform: "translateX(-100%)" }
|
|
141194
|
+
}
|
|
141195
|
+
)
|
|
141196
|
+
] });
|
|
141197
|
+
}
|
|
141198
|
+
);
|
|
141199
|
+
Radio.displayName = RADIO_NAME;
|
|
141200
|
+
var INDICATOR_NAME = "RadioIndicator";
|
|
141201
|
+
var RadioIndicator = React__namespace.forwardRef(
|
|
141202
|
+
(props, forwardedRef) => {
|
|
141203
|
+
const { __scopeRadio, forceMount, ...indicatorProps } = props;
|
|
141204
|
+
const context = useRadioContext(INDICATOR_NAME, __scopeRadio);
|
|
141205
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || context.checked, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
141206
|
+
Primitive.span,
|
|
141207
|
+
{
|
|
141208
|
+
"data-state": getState(context.checked),
|
|
141209
|
+
"data-disabled": context.disabled ? "" : void 0,
|
|
141210
|
+
...indicatorProps,
|
|
141211
|
+
ref: forwardedRef
|
|
141212
|
+
}
|
|
141213
|
+
) });
|
|
141214
|
+
}
|
|
141215
|
+
);
|
|
141216
|
+
RadioIndicator.displayName = INDICATOR_NAME;
|
|
141217
|
+
var BubbleInput = (props) => {
|
|
141218
|
+
const { control, checked, bubbles = true, ...inputProps } = props;
|
|
141219
|
+
const ref = React__namespace.useRef(null);
|
|
141220
|
+
const prevChecked = usePrevious(checked);
|
|
141221
|
+
const controlSize = useSize(control);
|
|
141222
|
+
React__namespace.useEffect(() => {
|
|
141223
|
+
const input = ref.current;
|
|
141224
|
+
const inputProto = window.HTMLInputElement.prototype;
|
|
141225
|
+
const descriptor = Object.getOwnPropertyDescriptor(inputProto, "checked");
|
|
141226
|
+
const setChecked = descriptor.set;
|
|
141227
|
+
if (prevChecked !== checked && setChecked) {
|
|
141228
|
+
const event = new Event("click", { bubbles });
|
|
141229
|
+
setChecked.call(input, checked);
|
|
141230
|
+
input.dispatchEvent(event);
|
|
141231
|
+
}
|
|
141232
|
+
}, [prevChecked, checked, bubbles]);
|
|
141233
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
141234
|
+
"input",
|
|
141235
|
+
{
|
|
141236
|
+
type: "radio",
|
|
141237
|
+
"aria-hidden": true,
|
|
141238
|
+
defaultChecked: checked,
|
|
141239
|
+
...inputProps,
|
|
141240
|
+
tabIndex: -1,
|
|
141241
|
+
ref,
|
|
141242
|
+
style: {
|
|
141243
|
+
...props.style,
|
|
141244
|
+
...controlSize,
|
|
141245
|
+
position: "absolute",
|
|
141246
|
+
pointerEvents: "none",
|
|
141247
|
+
opacity: 0,
|
|
141248
|
+
margin: 0
|
|
141249
|
+
}
|
|
141250
|
+
}
|
|
141251
|
+
);
|
|
141252
|
+
};
|
|
141253
|
+
function getState(checked) {
|
|
141254
|
+
return checked ? "checked" : "unchecked";
|
|
141255
|
+
}
|
|
141256
|
+
var ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
|
|
141257
|
+
var RADIO_GROUP_NAME = "RadioGroup";
|
|
141258
|
+
var [createRadioGroupContext, createRadioGroupScope] = createContextScope$2(RADIO_GROUP_NAME, [
|
|
141259
|
+
createRovingFocusGroupScope,
|
|
141260
|
+
createRadioScope
|
|
141261
|
+
]);
|
|
141262
|
+
var useRovingFocusGroupScope = createRovingFocusGroupScope();
|
|
141263
|
+
var useRadioScope = createRadioScope();
|
|
141264
|
+
var [RadioGroupProvider, useRadioGroupContext] = createRadioGroupContext(RADIO_GROUP_NAME);
|
|
141265
|
+
var RadioGroup$1 = React__namespace.forwardRef(
|
|
141266
|
+
(props, forwardedRef) => {
|
|
141267
|
+
const {
|
|
141268
|
+
__scopeRadioGroup,
|
|
141269
|
+
name,
|
|
141270
|
+
defaultValue,
|
|
141271
|
+
value: valueProp,
|
|
141272
|
+
required = false,
|
|
141273
|
+
disabled = false,
|
|
141274
|
+
orientation,
|
|
141275
|
+
dir,
|
|
141276
|
+
loop = true,
|
|
141277
|
+
onValueChange,
|
|
141278
|
+
...groupProps
|
|
141279
|
+
} = props;
|
|
141280
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
|
|
141281
|
+
const direction = useDirection(dir);
|
|
141282
|
+
const [value, setValue] = useControllableState({
|
|
141283
|
+
prop: valueProp,
|
|
141284
|
+
defaultProp: defaultValue,
|
|
141285
|
+
onChange: onValueChange
|
|
141286
|
+
});
|
|
141287
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
141288
|
+
RadioGroupProvider,
|
|
141289
|
+
{
|
|
141290
|
+
scope: __scopeRadioGroup,
|
|
141291
|
+
name,
|
|
141292
|
+
required,
|
|
141293
|
+
disabled,
|
|
141294
|
+
value,
|
|
141295
|
+
onValueChange: setValue,
|
|
141296
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
141297
|
+
Root,
|
|
141298
|
+
{
|
|
141299
|
+
asChild: true,
|
|
141300
|
+
...rovingFocusGroupScope,
|
|
141301
|
+
orientation,
|
|
141302
|
+
dir: direction,
|
|
141303
|
+
loop,
|
|
141304
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
141305
|
+
Primitive.div,
|
|
141306
|
+
{
|
|
141307
|
+
role: "radiogroup",
|
|
141308
|
+
"aria-required": required,
|
|
141309
|
+
"aria-orientation": orientation,
|
|
141310
|
+
"data-disabled": disabled ? "" : void 0,
|
|
141311
|
+
dir: direction,
|
|
141312
|
+
...groupProps,
|
|
141313
|
+
ref: forwardedRef
|
|
141314
|
+
}
|
|
141315
|
+
)
|
|
141316
|
+
}
|
|
141317
|
+
)
|
|
141318
|
+
}
|
|
141319
|
+
);
|
|
141320
|
+
}
|
|
141321
|
+
);
|
|
141322
|
+
RadioGroup$1.displayName = RADIO_GROUP_NAME;
|
|
141323
|
+
var ITEM_NAME = "RadioGroupItem";
|
|
141324
|
+
var RadioGroupItem$1 = React__namespace.forwardRef(
|
|
141325
|
+
(props, forwardedRef) => {
|
|
141326
|
+
const { __scopeRadioGroup, disabled, ...itemProps } = props;
|
|
141327
|
+
const context = useRadioGroupContext(ITEM_NAME, __scopeRadioGroup);
|
|
141328
|
+
const isDisabled = context.disabled || disabled;
|
|
141329
|
+
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeRadioGroup);
|
|
141330
|
+
const radioScope = useRadioScope(__scopeRadioGroup);
|
|
141331
|
+
const ref = React__namespace.useRef(null);
|
|
141332
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
141333
|
+
const checked = context.value === itemProps.value;
|
|
141334
|
+
const isArrowKeyPressedRef = React__namespace.useRef(false);
|
|
141335
|
+
React__namespace.useEffect(() => {
|
|
141336
|
+
const handleKeyDown = (event) => {
|
|
141337
|
+
if (ARROW_KEYS.includes(event.key)) {
|
|
141338
|
+
isArrowKeyPressedRef.current = true;
|
|
141339
|
+
}
|
|
141340
|
+
};
|
|
141341
|
+
const handleKeyUp = () => isArrowKeyPressedRef.current = false;
|
|
141342
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
141343
|
+
document.addEventListener("keyup", handleKeyUp);
|
|
141344
|
+
return () => {
|
|
141345
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
141346
|
+
document.removeEventListener("keyup", handleKeyUp);
|
|
141347
|
+
};
|
|
141348
|
+
}, []);
|
|
141349
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
141350
|
+
Item,
|
|
141351
|
+
{
|
|
141352
|
+
asChild: true,
|
|
141353
|
+
...rovingFocusGroupScope,
|
|
141354
|
+
focusable: !isDisabled,
|
|
141355
|
+
active: checked,
|
|
141356
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
141357
|
+
Radio,
|
|
141358
|
+
{
|
|
141359
|
+
disabled: isDisabled,
|
|
141360
|
+
required: context.required,
|
|
141361
|
+
checked,
|
|
141362
|
+
...radioScope,
|
|
141363
|
+
...itemProps,
|
|
141364
|
+
name: context.name,
|
|
141365
|
+
ref: composedRefs,
|
|
141366
|
+
onCheck: () => context.onValueChange(itemProps.value),
|
|
141367
|
+
onKeyDown: composeEventHandlers((event) => {
|
|
141368
|
+
if (event.key === "Enter") event.preventDefault();
|
|
141369
|
+
}),
|
|
141370
|
+
onFocus: composeEventHandlers(itemProps.onFocus, () => {
|
|
141371
|
+
if (isArrowKeyPressedRef.current) ref.current?.click();
|
|
141372
|
+
})
|
|
141373
|
+
}
|
|
141374
|
+
)
|
|
141375
|
+
}
|
|
141376
|
+
);
|
|
141377
|
+
}
|
|
141378
|
+
);
|
|
141379
|
+
RadioGroupItem$1.displayName = ITEM_NAME;
|
|
141380
|
+
var INDICATOR_NAME2 = "RadioGroupIndicator";
|
|
141381
|
+
var RadioGroupIndicator = React__namespace.forwardRef(
|
|
141382
|
+
(props, forwardedRef) => {
|
|
141383
|
+
const { __scopeRadioGroup, ...indicatorProps } = props;
|
|
141384
|
+
const radioScope = useRadioScope(__scopeRadioGroup);
|
|
141385
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadioIndicator, { ...radioScope, ...indicatorProps, ref: forwardedRef });
|
|
141386
|
+
}
|
|
141387
|
+
);
|
|
141388
|
+
RadioGroupIndicator.displayName = INDICATOR_NAME2;
|
|
141389
|
+
var Root2 = RadioGroup$1;
|
|
141390
|
+
var Item2 = RadioGroupItem$1;
|
|
141391
|
+
var Indicator = RadioGroupIndicator;
|
|
141392
|
+
|
|
141393
|
+
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
141394
|
+
|
|
141395
|
+
const falsyToString = (value)=>typeof value === "boolean" ? "".concat(value) : value === 0 ? "0" : value;
|
|
141396
|
+
const cx = clsx;
|
|
141397
|
+
const cva = (base, config)=>{
|
|
141398
|
+
return (props)=>{
|
|
141399
|
+
var ref;
|
|
141400
|
+
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
141401
|
+
const { variants , defaultVariants } = config;
|
|
141402
|
+
const getVariantClassNames = Object.keys(variants).map((variant)=>{
|
|
141403
|
+
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
141404
|
+
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
141405
|
+
if (variantProp === null) return null;
|
|
141406
|
+
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
141407
|
+
return variants[variant][variantKey];
|
|
141408
|
+
});
|
|
141409
|
+
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{
|
|
141410
|
+
let [key, value] = param;
|
|
141411
|
+
if (value === undefined) {
|
|
141412
|
+
return acc;
|
|
141413
|
+
}
|
|
141414
|
+
acc[key] = value;
|
|
141415
|
+
return acc;
|
|
141416
|
+
}, {});
|
|
141417
|
+
const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (ref = config.compoundVariants) === null || ref === void 0 ? void 0 : ref.reduce((acc, param1)=>{
|
|
141418
|
+
let { class: cvClass , className: cvClassName , ...compoundVariantOptions } = param1;
|
|
141419
|
+
return Object.entries(compoundVariantOptions).every((param)=>{
|
|
141420
|
+
let [key, value] = param;
|
|
141421
|
+
return Array.isArray(value) ? value.includes({
|
|
141422
|
+
...defaultVariants,
|
|
141423
|
+
...propsWithoutUndefined
|
|
141424
|
+
}[key]) : ({
|
|
141425
|
+
...defaultVariants,
|
|
141426
|
+
...propsWithoutUndefined
|
|
141427
|
+
})[key] === value;
|
|
141428
|
+
}) ? [
|
|
141429
|
+
...acc,
|
|
141430
|
+
cvClass,
|
|
141431
|
+
cvClassName
|
|
141432
|
+
] : acc;
|
|
141433
|
+
}, []);
|
|
141434
|
+
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
141435
|
+
};
|
|
141436
|
+
};
|
|
141437
|
+
|
|
141438
|
+
var radioStyles = cva(cn("s-aspect-square s-h-4 s-w-4 s-rounded-full s-border s-border-primary-500 s-text-foreground s-ring-offset-background", "focus-visible:s-outline-none focus-visible:s-ring-2 focus-visible:s-ring-offset-2 focus-visible:s-ring-ring", "disabled:s-cursor-not-allowed disabled:s-opacity-50", "checked:s-ring-0 checked:s-bg-action-500"), {
|
|
141439
|
+
variants: {
|
|
141440
|
+
size: {
|
|
141441
|
+
xs: "s-h-4 s-w-4",
|
|
141442
|
+
sm: "s-h-5 s-w-5",
|
|
141443
|
+
},
|
|
141444
|
+
},
|
|
141445
|
+
defaultVariants: {
|
|
141446
|
+
size: "xs",
|
|
141447
|
+
},
|
|
141448
|
+
});
|
|
141449
|
+
var RadioGroup = React__namespace.forwardRef(function (_a, ref) {
|
|
141450
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
141451
|
+
return (React__namespace.createElement(Root2, __assign({ className: cn("s-grid s-gap-2", className) }, props, { ref: ref })));
|
|
141452
|
+
});
|
|
141453
|
+
RadioGroup.displayName = Root2.displayName;
|
|
141454
|
+
var RadioGroupItem = React__namespace.forwardRef(function (_a, ref) {
|
|
141455
|
+
var className = _a.className, _b = _a.size, size = _b === void 0 ? "xs" : _b, props = __rest(_a, ["className", "size"]);
|
|
141456
|
+
return (React__namespace.createElement(Item2, __assign({ ref: ref, className: cn(radioStyles({ size: size }), className) }, props),
|
|
141457
|
+
React__namespace.createElement(Indicator, { className: "s-flex s-items-center s-justify-center" },
|
|
141458
|
+
React__namespace.createElement(CircleIcon, { className: cn(size === "xs" ? "s-h-2.5 s-w-2.5" : "s-h-3 s-w-3", "s-fill-current s-text-current focus:s-bg-action-50-dark") }))));
|
|
141459
|
+
});
|
|
141460
|
+
RadioGroupItem.displayName = Item2.displayName;
|
|
141461
|
+
|
|
140932
141462
|
var sizeClasses$1 = {
|
|
140933
141463
|
xs: "s-text-xs s-h-[26px] s-pl-3 s-pr-6 s-pt-1.5 s-rounded-lg",
|
|
140934
141464
|
sm: "s-text-sm s-h-[34px] s-pl-4 s-pr-8 s-pt-1.5 s-rounded-xl",
|
|
@@ -141476,13 +142006,11 @@ exports.ChatBubbleLeftRightIcon = SvgChatBubbleLeftRight$3;
|
|
|
141476
142006
|
exports.ChatBubbleLeftRightStrokeIcon = SvgChatBubbleLeftRight$1;
|
|
141477
142007
|
exports.ChatBubbleThoughtIcon = SvgChatBubbleThought$3;
|
|
141478
142008
|
exports.ChatBubbleThoughtStrokeIcon = SvgChatBubbleThought$1;
|
|
141479
|
-
exports.CheckBoxWithTextAndDescription = CheckBoxWithTextAndDescription;
|
|
141480
142009
|
exports.CheckCircleIcon = CheckCircleIcon;
|
|
141481
142010
|
exports.CheckCircleStrokeIcon = SvgCheckCircle$1;
|
|
141482
142011
|
exports.CheckIcon = CheckIcon;
|
|
141483
142012
|
exports.CheckStrokeIcon = SvgCheck$1;
|
|
141484
142013
|
exports.Checkbox = Checkbox;
|
|
141485
|
-
exports.CheckboxWithText = CheckboxWithText;
|
|
141486
142014
|
exports.ChevronDoubleLeftIcon = SvgChevronDoubleLeft$3;
|
|
141487
142015
|
exports.ChevronDoubleLeftStrokeIcon = SvgChevronDoubleLeft$1;
|
|
141488
142016
|
exports.ChevronDoubleRightIcon = SvgChevronDoubleRight$3;
|
|
@@ -141628,7 +142156,7 @@ exports.InformationCircleIcon = InformationCircleIcon;
|
|
|
141628
142156
|
exports.InformationCircleStrokeIcon = SvgInformationCircle$1;
|
|
141629
142157
|
exports.Input = Input;
|
|
141630
142158
|
exports.IntercomLogo = IntercomLogo;
|
|
141631
|
-
exports.Item = Item$
|
|
142159
|
+
exports.Item = Item$2;
|
|
141632
142160
|
exports.KeyIcon = SvgKey$3;
|
|
141633
142161
|
exports.KeyStrokeIcon = SvgKey$1;
|
|
141634
142162
|
exports.Label = Label$1;
|
|
@@ -141732,7 +142260,8 @@ exports.PuzzleIcon = SvgPuzzle$3;
|
|
|
141732
142260
|
exports.PuzzleStrokeIcon = SvgPuzzle$1;
|
|
141733
142261
|
exports.QuestionMarkCircleIcon = SvgQuestionMarkCircle$3;
|
|
141734
142262
|
exports.QuestionMarkCircleStrokeIcon = SvgQuestionMarkCircle$1;
|
|
141735
|
-
exports.
|
|
142263
|
+
exports.RadioGroup = RadioGroup;
|
|
142264
|
+
exports.RadioGroupItem = RadioGroupItem;
|
|
141736
142265
|
exports.ReactionIcon = SvgReaction$3;
|
|
141737
142266
|
exports.ReactionStrokeIcon = SvgReaction$1;
|
|
141738
142267
|
exports.RectangleIcon = SvgRectangle$3;
|