ingeniuscliq-core 0.4.25 → 0.4.26
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/components/common/carousel/CustomCarousel.js +26 -0
- package/dist/components/common/carousel/CustomCarouselSection.js +41 -0
- package/dist/components/common/form/CustomFormField.js +29 -0
- package/dist/components/common/form/{FormCheckbox.tsx → FormCheckbox.js} +7 -7
- package/dist/components/common/form/{FormInput.tsx → FormInput.js} +5 -5
- package/dist/components/common/form/{FormSelect.tsx → FormSelect.js} +7 -7
- package/dist/components/common/form/{FormTextArea.tsx → FormTextArea.js} +5 -5
- package/dist/components/common/form/{FormWrapper.tsx → FormWrapper.js} +2 -2
- package/dist/components/common/logo/{Logo.tsx → Logo.js} +3 -3
- package/dist/components/common/pagination/{CustomPagination.tsx → CustomPagination.js} +6 -6
- package/dist/components/common/select/CustomSelect.js +27 -0
- package/dist/components/common/spinner/Spinner.js +32 -0
- package/dist/components/common/stepper/{Stepper.tsx → Stepper.js} +9 -9
- package/dist/components/layouts/CoreBaseLayout.js +19 -0
- package/dist/components/templates/CoreHomeLayout.js +8 -0
- package/dist/components/templates/{CorePreviewLayout.tsx → CorePreviewLayout.js} +3 -3
- package/dist/components/ui/accordion.js +44 -0
- package/dist/components/ui/{alert-dialog.tsx → alert-dialog.js} +28 -28
- package/dist/components/ui/{alert.tsx → alert.js} +5 -5
- package/dist/components/ui/{avatar.tsx → avatar.js} +11 -11
- package/dist/components/ui/{badge.tsx → badge.js} +3 -3
- package/dist/components/ui/{breadcrumb.tsx → breadcrumb.js} +13 -14
- package/dist/components/ui/{button.tsx → button.js} +4 -4
- package/dist/components/ui/{card.tsx → card.js} +8 -8
- package/dist/components/ui/{carousel.tsx → carousel.js} +14 -15
- package/dist/components/ui/{checkbox.tsx → checkbox.js} +9 -9
- package/dist/components/ui/{dialog.tsx → dialog.js} +26 -26
- package/dist/components/ui/{dropdown-menu.tsx → dropdown-menu.js} +37 -39
- package/dist/components/ui/{form.tsx → form.js} +10 -10
- package/dist/components/ui/{input.tsx → input.js} +2 -2
- package/dist/components/ui/{label.tsx → label.js} +6 -6
- package/dist/components/ui/{pagination.tsx → pagination.js} +16 -18
- package/dist/components/ui/{popover.tsx → popover.js} +8 -8
- package/dist/components/ui/radio-group.js +34 -0
- package/dist/components/ui/{select.tsx → select.js} +38 -40
- package/dist/components/ui/{separator.tsx → separator.js} +5 -5
- package/dist/components/ui/{sheet.tsx → sheet.js} +27 -27
- package/dist/components/ui/{skeleton.tsx → skeleton.js} +2 -2
- package/dist/components/ui/{slider.tsx → slider.js} +9 -9
- package/dist/components/ui/{stepper.tsx → stepper.js} +35 -35
- package/dist/components/ui/{switch.tsx → switch.js} +7 -7
- package/dist/components/ui/{table.tsx → table.js} +9 -9
- package/dist/components/ui/{tabs.tsx → tabs.js} +13 -13
- package/dist/components/ui/{textarea.tsx → textarea.js} +2 -2
- package/dist/components/ui/{tooltip.tsx → tooltip.js} +8 -8
- package/dist/helpers/axiosGlobal.js +1 -2
- package/dist/hooks/useNotification.js +1 -1
- package/dist/index.js +45 -45
- package/dist/lib/utils.js +2 -2
- package/dist/modules/CoreAuth/classes/CoreAuthBuilder.js +1 -1
- package/dist/modules/CoreAuth/context/{AuthContext.tsx → AuthContext.js} +1 -1
- package/dist/modules/CoreAuth/index.js +2 -1
- package/dist/modules/CoreCustomization/classes/CoreCustomizationBuilder.js +1 -1
- package/dist/modules/CoreCustomization/index.js +1 -0
- package/dist/modules/CoreOrder/classes/CoreOrderBuilder.js +1 -1
- package/dist/modules/CoreOrder/index.js +1 -0
- package/dist/modules/CorePayForm/classes/CorePayFormBuilder.js +1 -1
- package/dist/modules/CorePayForm/index.js +1 -0
- package/dist/modules/CoreProduct/classes/CoreProductBuilder.js +1 -1
- package/dist/modules/CoreProduct/index.js +1 -0
- package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.js +1 -1
- package/dist/modules/CoreShipment/index.js +1 -0
- package/dist/modules/CoreShopCart/classes/CoreShopCartBuilder.js +1 -1
- package/package.json +3 -7
- package/dist/_virtual/index.js +0 -5
- package/dist/_virtual/index2.js +0 -3
- package/dist/_virtual/jsx-runtime.js +0 -5
- package/dist/_virtual/jsx-runtime2.js +0 -3
- package/dist/_virtual/react-jsx-runtime.development.js +0 -3
- package/dist/_virtual/react-jsx-runtime.production.js +0 -3
- package/dist/_virtual/use-sync-external-store-shim.development.js +0 -3
- package/dist/_virtual/use-sync-external-store-shim.production.js +0 -3
- package/dist/components/common/carousel/CustomCarousel.tsx +0 -26
- package/dist/components/common/carousel/CustomCarouselSection.tsx +0 -41
- package/dist/components/common/form/CustomFormField.tsx +0 -29
- package/dist/components/common/select/CustomSelect.tsx +0 -27
- package/dist/components/common/spinner/Spinner.tsx +0 -32
- package/dist/components/layouts/CoreBaseLayout.tsx +0 -19
- package/dist/components/templates/CoreHomeLayout.tsx +0 -8
- package/dist/components/ui/accordion.tsx +0 -44
- package/dist/components/ui/radio-group.tsx +0 -34
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +0 -814
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +0 -751
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +0 -350
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +0 -161
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +0 -137
- package/dist/node_modules/@radix-ui/number/dist/index.js +0 -6
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +0 -11
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +0 -305
- package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +0 -147
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +0 -25
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +0 -118
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +0 -270
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +0 -145
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +0 -70
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -39
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +0 -79
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +0 -321
- package/dist/node_modules/@radix-ui/react-direction/dist/index.js +0 -11
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -211
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +0 -267
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +0 -29
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -207
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +0 -15
- package/dist/node_modules/@radix-ui/react-label/dist/index.js +0 -24
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +0 -834
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +0 -299
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +0 -283
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +0 -17
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +0 -130
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +0 -43
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +0 -282
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.js +0 -223
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +0 -1156
- package/dist/node_modules/@radix-ui/react-separator/dist/index.js +0 -30
- package/dist/node_modules/@radix-ui/react-slider/dist/index.js +0 -554
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +0 -99
- package/dist/node_modules/@radix-ui/react-switch/dist/index.js +0 -152
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +0 -187
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +0 -482
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +0 -12
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +0 -70
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +0 -18
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +0 -16
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +0 -7
- package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +0 -15
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +0 -40
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +0 -35
- package/dist/node_modules/@stepperize/core/dist/index.js +0 -3
- package/dist/node_modules/@stepperize/react/dist/index.js +0 -6
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -137
- package/dist/node_modules/axios/index.js +0 -25
- package/dist/node_modules/axios/lib/adapters/adapters.js +0 -81
- package/dist/node_modules/axios/lib/adapters/fetch.js +0 -229
- package/dist/node_modules/axios/lib/adapters/xhr.js +0 -199
- package/dist/node_modules/axios/lib/axios.js +0 -86
- package/dist/node_modules/axios/lib/cancel/CancelToken.js +0 -133
- package/dist/node_modules/axios/lib/cancel/CanceledError.js +0 -23
- package/dist/node_modules/axios/lib/cancel/isCancel.js +0 -5
- package/dist/node_modules/axios/lib/core/Axios.js +0 -238
- package/dist/node_modules/axios/lib/core/AxiosError.js +0 -101
- package/dist/node_modules/axios/lib/core/AxiosHeaders.js +0 -312
- package/dist/node_modules/axios/lib/core/InterceptorManager.js +0 -69
- package/dist/node_modules/axios/lib/core/buildFullPath.js +0 -22
- package/dist/node_modules/axios/lib/core/dispatchRequest.js +0 -81
- package/dist/node_modules/axios/lib/core/mergeConfig.js +0 -106
- package/dist/node_modules/axios/lib/core/settle.js +0 -27
- package/dist/node_modules/axios/lib/core/transformData.js +0 -28
- package/dist/node_modules/axios/lib/defaults/index.js +0 -159
- package/dist/node_modules/axios/lib/defaults/transitional.js +0 -7
- package/dist/node_modules/axios/lib/env/data.js +0 -3
- package/dist/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -56
- package/dist/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -71
- package/dist/node_modules/axios/lib/helpers/bind.js +0 -7
- package/dist/node_modules/axios/lib/helpers/buildURL.js +0 -69
- package/dist/node_modules/axios/lib/helpers/combineURLs.js +0 -15
- package/dist/node_modules/axios/lib/helpers/composeSignals.js +0 -48
- package/dist/node_modules/axios/lib/helpers/cookies.js +0 -43
- package/dist/node_modules/axios/lib/helpers/formDataToJSON.js +0 -93
- package/dist/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -15
- package/dist/node_modules/axios/lib/helpers/isAxiosError.js +0 -14
- package/dist/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -16
- package/dist/node_modules/axios/lib/helpers/null.js +0 -4
- package/dist/node_modules/axios/lib/helpers/parseHeaders.js +0 -55
- package/dist/node_modules/axios/lib/helpers/parseProtocol.js +0 -6
- package/dist/node_modules/axios/lib/helpers/progressEventReducer.js +0 -46
- package/dist/node_modules/axios/lib/helpers/resolveConfig.js +0 -58
- package/dist/node_modules/axios/lib/helpers/speedometer.js +0 -53
- package/dist/node_modules/axios/lib/helpers/spread.js +0 -28
- package/dist/node_modules/axios/lib/helpers/throttle.js +0 -44
- package/dist/node_modules/axios/lib/helpers/toFormData.js +0 -219
- package/dist/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -19
- package/dist/node_modules/axios/lib/helpers/trackStream.js +0 -88
- package/dist/node_modules/axios/lib/helpers/validator.js +0 -99
- package/dist/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -3
- package/dist/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -3
- package/dist/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -5
- package/dist/node_modules/axios/lib/platform/browser/index.js +0 -15
- package/dist/node_modules/axios/lib/platform/common/utils.js +0 -45
- package/dist/node_modules/axios/lib/platform/index.js +0 -9
- package/dist/node_modules/axios/lib/utils.js +0 -780
- package/dist/node_modules/class-variance-authority/dist/index.js +0 -44
- package/dist/node_modules/clsx/dist/clsx.js +0 -3
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +0 -1669
- package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +0 -37
- package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +0 -38
- package/dist/node_modules/get-nonce/dist/es2015/index.js +0 -8
- package/dist/node_modules/lucide-react/dist/esm/Icon.js +0 -43
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.js +0 -30
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.js +0 -20
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left.js +0 -17
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-right.js +0 -17
- package/dist/node_modules/lucide-react/dist/esm/icons/check.js +0 -14
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +0 -14
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.js +0 -14
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-right.js +0 -14
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +0 -14
- package/dist/node_modules/lucide-react/dist/esm/icons/circle.js +0 -14
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis.js +0 -18
- package/dist/node_modules/lucide-react/dist/esm/icons/x.js +0 -17
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.js +0 -28
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -363
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.js +0 -44
- package/dist/node_modules/react/jsx-runtime.js +0 -19
- package/dist/node_modules/react-hook-form/dist/index.esm.js +0 -560
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +0 -9
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +0 -167
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +0 -38
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -21
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +0 -110
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +0 -5
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +0 -7
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +0 -56
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +0 -10
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +0 -31
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +0 -19
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +0 -25
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +0 -51
- package/dist/node_modules/sonner/dist/index.js +0 -299
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +0 -3035
- package/dist/node_modules/tslib/tslib.es6.js +0 -56
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +0 -24
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +0 -48
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +0 -42
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +0 -21
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +0 -77
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +0 -106
- package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +0 -77
- package/dist/node_modules/use-sync-external-store/shim/index.js +0 -19
- package/dist/node_modules/zustand/esm/react.js +0 -22
- package/dist/node_modules/zustand/esm/vanilla.js +0 -24
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { composeEventHandlers } from '../../primitive/dist/index.js';
|
|
3
|
-
import { composeRefs } from '../../react-compose-refs/dist/index.js';
|
|
4
|
-
import { createContextScope } from '../../react-context/dist/index.js';
|
|
5
|
-
import { useControllableState } from '../../react-use-controllable-state/dist/index.js';
|
|
6
|
-
import { Primitive } from '../../react-primitive/dist/index.js';
|
|
7
|
-
import { createMenuScope, SubTrigger, SubContent, Portal, Content as Content2$1, Item as Item2$1, CheckboxItem, ItemIndicator, RadioItem, Label, Separator, Root as Root3, Anchor as Anchor2, Group, Sub, RadioGroup, Arrow as Arrow2 } from '../../react-menu/dist/index.js';
|
|
8
|
-
import { useId } from '../../react-id/dist/index.js';
|
|
9
|
-
import { j as jsxRuntimeExports } from '../../../../_virtual/jsx-runtime.js';
|
|
10
|
-
|
|
11
|
-
var DROPDOWN_MENU_NAME = "DropdownMenu";
|
|
12
|
-
var [createDropdownMenuContext] = createContextScope(
|
|
13
|
-
DROPDOWN_MENU_NAME,
|
|
14
|
-
[createMenuScope]
|
|
15
|
-
);
|
|
16
|
-
var useMenuScope = createMenuScope();
|
|
17
|
-
var [DropdownMenuProvider, useDropdownMenuContext] = createDropdownMenuContext(DROPDOWN_MENU_NAME);
|
|
18
|
-
var DropdownMenu = (props) => {
|
|
19
|
-
const {
|
|
20
|
-
__scopeDropdownMenu,
|
|
21
|
-
children,
|
|
22
|
-
dir,
|
|
23
|
-
open: openProp,
|
|
24
|
-
defaultOpen,
|
|
25
|
-
onOpenChange,
|
|
26
|
-
modal = true
|
|
27
|
-
} = props;
|
|
28
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
29
|
-
const triggerRef = React.useRef(null);
|
|
30
|
-
const [open, setOpen] = useControllableState({
|
|
31
|
-
prop: openProp,
|
|
32
|
-
defaultProp: defaultOpen ?? false,
|
|
33
|
-
onChange: onOpenChange,
|
|
34
|
-
caller: DROPDOWN_MENU_NAME
|
|
35
|
-
});
|
|
36
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
37
|
-
DropdownMenuProvider,
|
|
38
|
-
{
|
|
39
|
-
scope: __scopeDropdownMenu,
|
|
40
|
-
triggerId: useId(),
|
|
41
|
-
triggerRef,
|
|
42
|
-
contentId: useId(),
|
|
43
|
-
open,
|
|
44
|
-
onOpenChange: setOpen,
|
|
45
|
-
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
46
|
-
modal,
|
|
47
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Root3, { ...menuScope, open, onOpenChange: setOpen, dir, modal, children })
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
};
|
|
51
|
-
DropdownMenu.displayName = DROPDOWN_MENU_NAME;
|
|
52
|
-
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
53
|
-
var DropdownMenuTrigger = React.forwardRef(
|
|
54
|
-
(props, forwardedRef) => {
|
|
55
|
-
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
56
|
-
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
57
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
58
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Anchor2, { asChild: true, ...menuScope, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
59
|
-
Primitive.button,
|
|
60
|
-
{
|
|
61
|
-
type: "button",
|
|
62
|
-
id: context.triggerId,
|
|
63
|
-
"aria-haspopup": "menu",
|
|
64
|
-
"aria-expanded": context.open,
|
|
65
|
-
"aria-controls": context.open ? context.contentId : void 0,
|
|
66
|
-
"data-state": context.open ? "open" : "closed",
|
|
67
|
-
"data-disabled": disabled ? "" : void 0,
|
|
68
|
-
disabled,
|
|
69
|
-
...triggerProps,
|
|
70
|
-
ref: composeRefs(forwardedRef, context.triggerRef),
|
|
71
|
-
onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
|
|
72
|
-
if (!disabled && event.button === 0 && event.ctrlKey === false) {
|
|
73
|
-
context.onOpenToggle();
|
|
74
|
-
if (!context.open) event.preventDefault();
|
|
75
|
-
}
|
|
76
|
-
}),
|
|
77
|
-
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
78
|
-
if (disabled) return;
|
|
79
|
-
if (["Enter", " "].includes(event.key)) context.onOpenToggle();
|
|
80
|
-
if (event.key === "ArrowDown") context.onOpenChange(true);
|
|
81
|
-
if (["Enter", " ", "ArrowDown"].includes(event.key)) event.preventDefault();
|
|
82
|
-
})
|
|
83
|
-
}
|
|
84
|
-
) });
|
|
85
|
-
}
|
|
86
|
-
);
|
|
87
|
-
DropdownMenuTrigger.displayName = TRIGGER_NAME;
|
|
88
|
-
var PORTAL_NAME = "DropdownMenuPortal";
|
|
89
|
-
var DropdownMenuPortal = (props) => {
|
|
90
|
-
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
91
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
92
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Portal, { ...menuScope, ...portalProps });
|
|
93
|
-
};
|
|
94
|
-
DropdownMenuPortal.displayName = PORTAL_NAME;
|
|
95
|
-
var CONTENT_NAME = "DropdownMenuContent";
|
|
96
|
-
var DropdownMenuContent = React.forwardRef(
|
|
97
|
-
(props, forwardedRef) => {
|
|
98
|
-
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
99
|
-
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
100
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
101
|
-
const hasInteractedOutsideRef = React.useRef(false);
|
|
102
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
103
|
-
Content2$1,
|
|
104
|
-
{
|
|
105
|
-
id: context.contentId,
|
|
106
|
-
"aria-labelledby": context.triggerId,
|
|
107
|
-
...menuScope,
|
|
108
|
-
...contentProps,
|
|
109
|
-
ref: forwardedRef,
|
|
110
|
-
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
111
|
-
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
112
|
-
hasInteractedOutsideRef.current = false;
|
|
113
|
-
event.preventDefault();
|
|
114
|
-
}),
|
|
115
|
-
onInteractOutside: composeEventHandlers(props.onInteractOutside, (event) => {
|
|
116
|
-
const originalEvent = event.detail.originalEvent;
|
|
117
|
-
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
118
|
-
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
119
|
-
if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true;
|
|
120
|
-
}),
|
|
121
|
-
style: {
|
|
122
|
-
...props.style,
|
|
123
|
-
// re-namespace exposed content custom properties
|
|
124
|
-
...{
|
|
125
|
-
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
126
|
-
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
127
|
-
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
128
|
-
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
129
|
-
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
);
|
|
136
|
-
DropdownMenuContent.displayName = CONTENT_NAME;
|
|
137
|
-
var GROUP_NAME = "DropdownMenuGroup";
|
|
138
|
-
var DropdownMenuGroup = React.forwardRef(
|
|
139
|
-
(props, forwardedRef) => {
|
|
140
|
-
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
141
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
142
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Group, { ...menuScope, ...groupProps, ref: forwardedRef });
|
|
143
|
-
}
|
|
144
|
-
);
|
|
145
|
-
DropdownMenuGroup.displayName = GROUP_NAME;
|
|
146
|
-
var LABEL_NAME = "DropdownMenuLabel";
|
|
147
|
-
var DropdownMenuLabel = React.forwardRef(
|
|
148
|
-
(props, forwardedRef) => {
|
|
149
|
-
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
150
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
151
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Label, { ...menuScope, ...labelProps, ref: forwardedRef });
|
|
152
|
-
}
|
|
153
|
-
);
|
|
154
|
-
DropdownMenuLabel.displayName = LABEL_NAME;
|
|
155
|
-
var ITEM_NAME = "DropdownMenuItem";
|
|
156
|
-
var DropdownMenuItem = React.forwardRef(
|
|
157
|
-
(props, forwardedRef) => {
|
|
158
|
-
const { __scopeDropdownMenu, ...itemProps } = props;
|
|
159
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
160
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Item2$1, { ...menuScope, ...itemProps, ref: forwardedRef });
|
|
161
|
-
}
|
|
162
|
-
);
|
|
163
|
-
DropdownMenuItem.displayName = ITEM_NAME;
|
|
164
|
-
var CHECKBOX_ITEM_NAME = "DropdownMenuCheckboxItem";
|
|
165
|
-
var DropdownMenuCheckboxItem = React.forwardRef((props, forwardedRef) => {
|
|
166
|
-
const { __scopeDropdownMenu, ...checkboxItemProps } = props;
|
|
167
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
168
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(CheckboxItem, { ...menuScope, ...checkboxItemProps, ref: forwardedRef });
|
|
169
|
-
});
|
|
170
|
-
DropdownMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;
|
|
171
|
-
var RADIO_GROUP_NAME = "DropdownMenuRadioGroup";
|
|
172
|
-
var DropdownMenuRadioGroup = React.forwardRef((props, forwardedRef) => {
|
|
173
|
-
const { __scopeDropdownMenu, ...radioGroupProps } = props;
|
|
174
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
175
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(RadioGroup, { ...menuScope, ...radioGroupProps, ref: forwardedRef });
|
|
176
|
-
});
|
|
177
|
-
DropdownMenuRadioGroup.displayName = RADIO_GROUP_NAME;
|
|
178
|
-
var RADIO_ITEM_NAME = "DropdownMenuRadioItem";
|
|
179
|
-
var DropdownMenuRadioItem = React.forwardRef((props, forwardedRef) => {
|
|
180
|
-
const { __scopeDropdownMenu, ...radioItemProps } = props;
|
|
181
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
182
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(RadioItem, { ...menuScope, ...radioItemProps, ref: forwardedRef });
|
|
183
|
-
});
|
|
184
|
-
DropdownMenuRadioItem.displayName = RADIO_ITEM_NAME;
|
|
185
|
-
var INDICATOR_NAME = "DropdownMenuItemIndicator";
|
|
186
|
-
var DropdownMenuItemIndicator = React.forwardRef((props, forwardedRef) => {
|
|
187
|
-
const { __scopeDropdownMenu, ...itemIndicatorProps } = props;
|
|
188
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
189
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(ItemIndicator, { ...menuScope, ...itemIndicatorProps, ref: forwardedRef });
|
|
190
|
-
});
|
|
191
|
-
DropdownMenuItemIndicator.displayName = INDICATOR_NAME;
|
|
192
|
-
var SEPARATOR_NAME = "DropdownMenuSeparator";
|
|
193
|
-
var DropdownMenuSeparator = React.forwardRef((props, forwardedRef) => {
|
|
194
|
-
const { __scopeDropdownMenu, ...separatorProps } = props;
|
|
195
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
196
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Separator, { ...menuScope, ...separatorProps, ref: forwardedRef });
|
|
197
|
-
});
|
|
198
|
-
DropdownMenuSeparator.displayName = SEPARATOR_NAME;
|
|
199
|
-
var ARROW_NAME = "DropdownMenuArrow";
|
|
200
|
-
var DropdownMenuArrow = React.forwardRef(
|
|
201
|
-
(props, forwardedRef) => {
|
|
202
|
-
const { __scopeDropdownMenu, ...arrowProps } = props;
|
|
203
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
204
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Arrow2, { ...menuScope, ...arrowProps, ref: forwardedRef });
|
|
205
|
-
}
|
|
206
|
-
);
|
|
207
|
-
DropdownMenuArrow.displayName = ARROW_NAME;
|
|
208
|
-
var DropdownMenuSub = (props) => {
|
|
209
|
-
const { __scopeDropdownMenu, children, open: openProp, onOpenChange, defaultOpen } = props;
|
|
210
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
211
|
-
const [open, setOpen] = useControllableState({
|
|
212
|
-
prop: openProp,
|
|
213
|
-
defaultProp: defaultOpen ?? false,
|
|
214
|
-
onChange: onOpenChange,
|
|
215
|
-
caller: "DropdownMenuSub"
|
|
216
|
-
});
|
|
217
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Sub, { ...menuScope, open, onOpenChange: setOpen, children });
|
|
218
|
-
};
|
|
219
|
-
var SUB_TRIGGER_NAME = "DropdownMenuSubTrigger";
|
|
220
|
-
var DropdownMenuSubTrigger = React.forwardRef((props, forwardedRef) => {
|
|
221
|
-
const { __scopeDropdownMenu, ...subTriggerProps } = props;
|
|
222
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
223
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(SubTrigger, { ...menuScope, ...subTriggerProps, ref: forwardedRef });
|
|
224
|
-
});
|
|
225
|
-
DropdownMenuSubTrigger.displayName = SUB_TRIGGER_NAME;
|
|
226
|
-
var SUB_CONTENT_NAME = "DropdownMenuSubContent";
|
|
227
|
-
var DropdownMenuSubContent = React.forwardRef((props, forwardedRef) => {
|
|
228
|
-
const { __scopeDropdownMenu, ...subContentProps } = props;
|
|
229
|
-
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
230
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
231
|
-
SubContent,
|
|
232
|
-
{
|
|
233
|
-
...menuScope,
|
|
234
|
-
...subContentProps,
|
|
235
|
-
ref: forwardedRef,
|
|
236
|
-
style: {
|
|
237
|
-
...props.style,
|
|
238
|
-
// re-namespace exposed content custom properties
|
|
239
|
-
...{
|
|
240
|
-
"--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
241
|
-
"--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
|
|
242
|
-
"--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
|
|
243
|
-
"--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
|
|
244
|
-
"--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
);
|
|
249
|
-
});
|
|
250
|
-
DropdownMenuSubContent.displayName = SUB_CONTENT_NAME;
|
|
251
|
-
var Root2 = DropdownMenu;
|
|
252
|
-
var Trigger = DropdownMenuTrigger;
|
|
253
|
-
var Portal2 = DropdownMenuPortal;
|
|
254
|
-
var Content2 = DropdownMenuContent;
|
|
255
|
-
var Group2 = DropdownMenuGroup;
|
|
256
|
-
var Label2 = DropdownMenuLabel;
|
|
257
|
-
var Item2 = DropdownMenuItem;
|
|
258
|
-
var CheckboxItem2 = DropdownMenuCheckboxItem;
|
|
259
|
-
var RadioGroup2 = DropdownMenuRadioGroup;
|
|
260
|
-
var RadioItem2 = DropdownMenuRadioItem;
|
|
261
|
-
var ItemIndicator2 = DropdownMenuItemIndicator;
|
|
262
|
-
var Separator2 = DropdownMenuSeparator;
|
|
263
|
-
var Sub2 = DropdownMenuSub;
|
|
264
|
-
var SubTrigger2 = DropdownMenuSubTrigger;
|
|
265
|
-
var SubContent2 = DropdownMenuSubContent;
|
|
266
|
-
|
|
267
|
-
export { CheckboxItem2 as CheckboxItem, Content2 as Content, DropdownMenu, DropdownMenuArrow, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuItemIndicator, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Group2 as Group, Item2 as Item, ItemIndicator2 as ItemIndicator, Label2 as Label, Portal2 as Portal, RadioGroup2 as RadioGroup, RadioItem2 as RadioItem, Root2 as Root, Separator2 as Separator, Sub2 as Sub, SubContent2 as SubContent, SubTrigger2 as SubTrigger, Trigger };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
var count = 0;
|
|
4
|
-
function useFocusGuards() {
|
|
5
|
-
React.useEffect(() => {
|
|
6
|
-
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
7
|
-
document.body.insertAdjacentElement("afterbegin", edgeGuards[0] ?? createFocusGuard());
|
|
8
|
-
document.body.insertAdjacentElement("beforeend", edgeGuards[1] ?? createFocusGuard());
|
|
9
|
-
count++;
|
|
10
|
-
return () => {
|
|
11
|
-
if (count === 1) {
|
|
12
|
-
document.querySelectorAll("[data-radix-focus-guard]").forEach((node) => node.remove());
|
|
13
|
-
}
|
|
14
|
-
count--;
|
|
15
|
-
};
|
|
16
|
-
}, []);
|
|
17
|
-
}
|
|
18
|
-
function createFocusGuard() {
|
|
19
|
-
const element = document.createElement("span");
|
|
20
|
-
element.setAttribute("data-radix-focus-guard", "");
|
|
21
|
-
element.tabIndex = 0;
|
|
22
|
-
element.style.outline = "none";
|
|
23
|
-
element.style.opacity = "0";
|
|
24
|
-
element.style.position = "fixed";
|
|
25
|
-
element.style.pointerEvents = "none";
|
|
26
|
-
return element;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { useFocusGuards };
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { useComposedRefs } from '../../react-compose-refs/dist/index.js';
|
|
3
|
-
import { Primitive } from '../../react-primitive/dist/index.js';
|
|
4
|
-
import { useCallbackRef } from '../../react-use-callback-ref/dist/index.js';
|
|
5
|
-
import { j as jsxRuntimeExports } from '../../../../_virtual/jsx-runtime.js';
|
|
6
|
-
|
|
7
|
-
var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
8
|
-
var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
9
|
-
var EVENT_OPTIONS = { bubbles: false, cancelable: true };
|
|
10
|
-
var FOCUS_SCOPE_NAME = "FocusScope";
|
|
11
|
-
var FocusScope = React.forwardRef((props, forwardedRef) => {
|
|
12
|
-
const {
|
|
13
|
-
loop = false,
|
|
14
|
-
trapped = false,
|
|
15
|
-
onMountAutoFocus: onMountAutoFocusProp,
|
|
16
|
-
onUnmountAutoFocus: onUnmountAutoFocusProp,
|
|
17
|
-
...scopeProps
|
|
18
|
-
} = props;
|
|
19
|
-
const [container, setContainer] = React.useState(null);
|
|
20
|
-
const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
|
|
21
|
-
const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
|
|
22
|
-
const lastFocusedElementRef = React.useRef(null);
|
|
23
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
|
|
24
|
-
const focusScope = React.useRef({
|
|
25
|
-
paused: false,
|
|
26
|
-
pause() {
|
|
27
|
-
this.paused = true;
|
|
28
|
-
},
|
|
29
|
-
resume() {
|
|
30
|
-
this.paused = false;
|
|
31
|
-
}
|
|
32
|
-
}).current;
|
|
33
|
-
React.useEffect(() => {
|
|
34
|
-
if (trapped) {
|
|
35
|
-
let handleFocusIn2 = function(event) {
|
|
36
|
-
if (focusScope.paused || !container) return;
|
|
37
|
-
const target = event.target;
|
|
38
|
-
if (container.contains(target)) {
|
|
39
|
-
lastFocusedElementRef.current = target;
|
|
40
|
-
} else {
|
|
41
|
-
focus(lastFocusedElementRef.current, { select: true });
|
|
42
|
-
}
|
|
43
|
-
}, handleFocusOut2 = function(event) {
|
|
44
|
-
if (focusScope.paused || !container) return;
|
|
45
|
-
const relatedTarget = event.relatedTarget;
|
|
46
|
-
if (relatedTarget === null) return;
|
|
47
|
-
if (!container.contains(relatedTarget)) {
|
|
48
|
-
focus(lastFocusedElementRef.current, { select: true });
|
|
49
|
-
}
|
|
50
|
-
}, handleMutations2 = function(mutations) {
|
|
51
|
-
const focusedElement = document.activeElement;
|
|
52
|
-
if (focusedElement !== document.body) return;
|
|
53
|
-
for (const mutation of mutations) {
|
|
54
|
-
if (mutation.removedNodes.length > 0) focus(container);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
document.addEventListener("focusin", handleFocusIn2);
|
|
58
|
-
document.addEventListener("focusout", handleFocusOut2);
|
|
59
|
-
const mutationObserver = new MutationObserver(handleMutations2);
|
|
60
|
-
if (container) mutationObserver.observe(container, { childList: true, subtree: true });
|
|
61
|
-
return () => {
|
|
62
|
-
document.removeEventListener("focusin", handleFocusIn2);
|
|
63
|
-
document.removeEventListener("focusout", handleFocusOut2);
|
|
64
|
-
mutationObserver.disconnect();
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
}, [trapped, container, focusScope.paused]);
|
|
68
|
-
React.useEffect(() => {
|
|
69
|
-
if (container) {
|
|
70
|
-
focusScopesStack.add(focusScope);
|
|
71
|
-
const previouslyFocusedElement = document.activeElement;
|
|
72
|
-
const hasFocusedCandidate = container.contains(previouslyFocusedElement);
|
|
73
|
-
if (!hasFocusedCandidate) {
|
|
74
|
-
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
75
|
-
container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
76
|
-
container.dispatchEvent(mountEvent);
|
|
77
|
-
if (!mountEvent.defaultPrevented) {
|
|
78
|
-
focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
|
|
79
|
-
if (document.activeElement === previouslyFocusedElement) {
|
|
80
|
-
focus(container);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return () => {
|
|
85
|
-
container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
86
|
-
setTimeout(() => {
|
|
87
|
-
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
|
|
88
|
-
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
89
|
-
container.dispatchEvent(unmountEvent);
|
|
90
|
-
if (!unmountEvent.defaultPrevented) {
|
|
91
|
-
focus(previouslyFocusedElement ?? document.body, { select: true });
|
|
92
|
-
}
|
|
93
|
-
container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
94
|
-
focusScopesStack.remove(focusScope);
|
|
95
|
-
}, 0);
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
}, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
|
|
99
|
-
const handleKeyDown = React.useCallback(
|
|
100
|
-
(event) => {
|
|
101
|
-
if (!loop && !trapped) return;
|
|
102
|
-
if (focusScope.paused) return;
|
|
103
|
-
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
104
|
-
const focusedElement = document.activeElement;
|
|
105
|
-
if (isTabKey && focusedElement) {
|
|
106
|
-
const container2 = event.currentTarget;
|
|
107
|
-
const [first, last] = getTabbableEdges(container2);
|
|
108
|
-
const hasTabbableElementsInside = first && last;
|
|
109
|
-
if (!hasTabbableElementsInside) {
|
|
110
|
-
if (focusedElement === container2) event.preventDefault();
|
|
111
|
-
} else {
|
|
112
|
-
if (!event.shiftKey && focusedElement === last) {
|
|
113
|
-
event.preventDefault();
|
|
114
|
-
if (loop) focus(first, { select: true });
|
|
115
|
-
} else if (event.shiftKey && focusedElement === first) {
|
|
116
|
-
event.preventDefault();
|
|
117
|
-
if (loop) focus(last, { select: true });
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
[loop, trapped, focusScope.paused]
|
|
123
|
-
);
|
|
124
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
|
|
125
|
-
});
|
|
126
|
-
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
127
|
-
function focusFirst(candidates, { select = false } = {}) {
|
|
128
|
-
const previouslyFocusedElement = document.activeElement;
|
|
129
|
-
for (const candidate of candidates) {
|
|
130
|
-
focus(candidate, { select });
|
|
131
|
-
if (document.activeElement !== previouslyFocusedElement) return;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
function getTabbableEdges(container) {
|
|
135
|
-
const candidates = getTabbableCandidates(container);
|
|
136
|
-
const first = findVisible(candidates, container);
|
|
137
|
-
const last = findVisible(candidates.reverse(), container);
|
|
138
|
-
return [first, last];
|
|
139
|
-
}
|
|
140
|
-
function getTabbableCandidates(container) {
|
|
141
|
-
const nodes = [];
|
|
142
|
-
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
143
|
-
acceptNode: (node) => {
|
|
144
|
-
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
145
|
-
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
|
|
146
|
-
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
150
|
-
return nodes;
|
|
151
|
-
}
|
|
152
|
-
function findVisible(elements, container) {
|
|
153
|
-
for (const element of elements) {
|
|
154
|
-
if (!isHidden(element, { upTo: container })) return element;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
function isHidden(node, { upTo }) {
|
|
158
|
-
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
159
|
-
while (node) {
|
|
160
|
-
if (upTo !== void 0 && node === upTo) return false;
|
|
161
|
-
if (getComputedStyle(node).display === "none") return true;
|
|
162
|
-
node = node.parentElement;
|
|
163
|
-
}
|
|
164
|
-
return false;
|
|
165
|
-
}
|
|
166
|
-
function isSelectableInput(element) {
|
|
167
|
-
return element instanceof HTMLInputElement && "select" in element;
|
|
168
|
-
}
|
|
169
|
-
function focus(element, { select = false } = {}) {
|
|
170
|
-
if (element && element.focus) {
|
|
171
|
-
const previouslyFocusedElement = document.activeElement;
|
|
172
|
-
element.focus({ preventScroll: true });
|
|
173
|
-
if (element !== previouslyFocusedElement && isSelectableInput(element) && select)
|
|
174
|
-
element.select();
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
var focusScopesStack = createFocusScopesStack();
|
|
178
|
-
function createFocusScopesStack() {
|
|
179
|
-
let stack = [];
|
|
180
|
-
return {
|
|
181
|
-
add(focusScope) {
|
|
182
|
-
const activeFocusScope = stack[0];
|
|
183
|
-
if (focusScope !== activeFocusScope) {
|
|
184
|
-
activeFocusScope?.pause();
|
|
185
|
-
}
|
|
186
|
-
stack = arrayRemove(stack, focusScope);
|
|
187
|
-
stack.unshift(focusScope);
|
|
188
|
-
},
|
|
189
|
-
remove(focusScope) {
|
|
190
|
-
stack = arrayRemove(stack, focusScope);
|
|
191
|
-
stack[0]?.resume();
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
function arrayRemove(array, item) {
|
|
196
|
-
const updatedArray = [...array];
|
|
197
|
-
const index = updatedArray.indexOf(item);
|
|
198
|
-
if (index !== -1) {
|
|
199
|
-
updatedArray.splice(index, 1);
|
|
200
|
-
}
|
|
201
|
-
return updatedArray;
|
|
202
|
-
}
|
|
203
|
-
function removeLinks(items) {
|
|
204
|
-
return items.filter((item) => item.tagName !== "A");
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
export { FocusScope };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { useLayoutEffect as useLayoutEffect2 } from '../../react-use-layout-effect/dist/index.js';
|
|
3
|
-
|
|
4
|
-
// packages/react/id/src/id.tsx
|
|
5
|
-
var useReactId = React[" useId ".trim().toString()] || (() => void 0);
|
|
6
|
-
var count = 0;
|
|
7
|
-
function useId(deterministicId) {
|
|
8
|
-
const [id, setId] = React.useState(useReactId());
|
|
9
|
-
useLayoutEffect2(() => {
|
|
10
|
-
setId((reactId) => reactId ?? String(count++));
|
|
11
|
-
}, [deterministicId]);
|
|
12
|
-
return (id ? `radix-${id}` : "");
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { useId };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Primitive } from '../../react-primitive/dist/index.js';
|
|
3
|
-
import { j as jsxRuntimeExports } from '../../../../_virtual/jsx-runtime.js';
|
|
4
|
-
|
|
5
|
-
var NAME = "Label";
|
|
6
|
-
var Label = React.forwardRef((props, forwardedRef) => {
|
|
7
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
8
|
-
Primitive.label,
|
|
9
|
-
{
|
|
10
|
-
...props,
|
|
11
|
-
ref: forwardedRef,
|
|
12
|
-
onMouseDown: (event) => {
|
|
13
|
-
const target = event.target;
|
|
14
|
-
if (target.closest("button, input, select, textarea")) return;
|
|
15
|
-
props.onMouseDown?.(event);
|
|
16
|
-
if (!event.defaultPrevented && event.detail > 1) event.preventDefault();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
);
|
|
20
|
-
});
|
|
21
|
-
Label.displayName = NAME;
|
|
22
|
-
var Root = Label;
|
|
23
|
-
|
|
24
|
-
export { Label, Root };
|