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,299 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { composeEventHandlers } from '../../primitive/dist/index.js';
|
|
3
|
-
import { useComposedRefs } from '../../react-compose-refs/dist/index.js';
|
|
4
|
-
import { createContextScope } from '../../react-context/dist/index.js';
|
|
5
|
-
import { DismissableLayer } from '../../react-dismissable-layer/dist/index.js';
|
|
6
|
-
import { useFocusGuards } from '../../react-focus-guards/dist/index.js';
|
|
7
|
-
import { FocusScope } from '../../react-focus-scope/dist/index.js';
|
|
8
|
-
import { useId } from '../../react-id/dist/index.js';
|
|
9
|
-
import { createPopperScope, Content, Root as Root2$1, Anchor, Arrow } from '../../react-popper/dist/index.js';
|
|
10
|
-
import { Portal as Portal$1 } from '../../react-portal/dist/index.js';
|
|
11
|
-
import { Presence } from '../../react-presence/dist/index.js';
|
|
12
|
-
import { Primitive } from '../../react-primitive/dist/index.js';
|
|
13
|
-
import { createSlot } from '../../react-slot/dist/index.js';
|
|
14
|
-
import { useControllableState } from '../../react-use-controllable-state/dist/index.js';
|
|
15
|
-
import { hideOthers } from '../../../aria-hidden/dist/es2015/index.js';
|
|
16
|
-
import ReactRemoveScroll from '../../../react-remove-scroll/dist/es2015/Combination.js';
|
|
17
|
-
import { j as jsxRuntimeExports } from '../../../../_virtual/jsx-runtime.js';
|
|
18
|
-
|
|
19
|
-
var POPOVER_NAME = "Popover";
|
|
20
|
-
var [createPopoverContext] = createContextScope(POPOVER_NAME, [
|
|
21
|
-
createPopperScope
|
|
22
|
-
]);
|
|
23
|
-
var usePopperScope = createPopperScope();
|
|
24
|
-
var [PopoverProvider, usePopoverContext] = createPopoverContext(POPOVER_NAME);
|
|
25
|
-
var Popover = (props) => {
|
|
26
|
-
const {
|
|
27
|
-
__scopePopover,
|
|
28
|
-
children,
|
|
29
|
-
open: openProp,
|
|
30
|
-
defaultOpen,
|
|
31
|
-
onOpenChange,
|
|
32
|
-
modal = false
|
|
33
|
-
} = props;
|
|
34
|
-
const popperScope = usePopperScope(__scopePopover);
|
|
35
|
-
const triggerRef = React.useRef(null);
|
|
36
|
-
const [hasCustomAnchor, setHasCustomAnchor] = React.useState(false);
|
|
37
|
-
const [open, setOpen] = useControllableState({
|
|
38
|
-
prop: openProp,
|
|
39
|
-
defaultProp: defaultOpen ?? false,
|
|
40
|
-
onChange: onOpenChange,
|
|
41
|
-
caller: POPOVER_NAME
|
|
42
|
-
});
|
|
43
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Root2$1, { ...popperScope, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
44
|
-
PopoverProvider,
|
|
45
|
-
{
|
|
46
|
-
scope: __scopePopover,
|
|
47
|
-
contentId: useId(),
|
|
48
|
-
triggerRef,
|
|
49
|
-
open,
|
|
50
|
-
onOpenChange: setOpen,
|
|
51
|
-
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
52
|
-
hasCustomAnchor,
|
|
53
|
-
onCustomAnchorAdd: React.useCallback(() => setHasCustomAnchor(true), []),
|
|
54
|
-
onCustomAnchorRemove: React.useCallback(() => setHasCustomAnchor(false), []),
|
|
55
|
-
modal,
|
|
56
|
-
children
|
|
57
|
-
}
|
|
58
|
-
) });
|
|
59
|
-
};
|
|
60
|
-
Popover.displayName = POPOVER_NAME;
|
|
61
|
-
var ANCHOR_NAME = "PopoverAnchor";
|
|
62
|
-
var PopoverAnchor = React.forwardRef(
|
|
63
|
-
(props, forwardedRef) => {
|
|
64
|
-
const { __scopePopover, ...anchorProps } = props;
|
|
65
|
-
const context = usePopoverContext(ANCHOR_NAME, __scopePopover);
|
|
66
|
-
const popperScope = usePopperScope(__scopePopover);
|
|
67
|
-
const { onCustomAnchorAdd, onCustomAnchorRemove } = context;
|
|
68
|
-
React.useEffect(() => {
|
|
69
|
-
onCustomAnchorAdd();
|
|
70
|
-
return () => onCustomAnchorRemove();
|
|
71
|
-
}, [onCustomAnchorAdd, onCustomAnchorRemove]);
|
|
72
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
PopoverAnchor.displayName = ANCHOR_NAME;
|
|
76
|
-
var TRIGGER_NAME = "PopoverTrigger";
|
|
77
|
-
var PopoverTrigger = React.forwardRef(
|
|
78
|
-
(props, forwardedRef) => {
|
|
79
|
-
const { __scopePopover, ...triggerProps } = props;
|
|
80
|
-
const context = usePopoverContext(TRIGGER_NAME, __scopePopover);
|
|
81
|
-
const popperScope = usePopperScope(__scopePopover);
|
|
82
|
-
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
83
|
-
const trigger = /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
84
|
-
Primitive.button,
|
|
85
|
-
{
|
|
86
|
-
type: "button",
|
|
87
|
-
"aria-haspopup": "dialog",
|
|
88
|
-
"aria-expanded": context.open,
|
|
89
|
-
"aria-controls": context.contentId,
|
|
90
|
-
"data-state": getState(context.open),
|
|
91
|
-
...triggerProps,
|
|
92
|
-
ref: composedTriggerRef,
|
|
93
|
-
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
94
|
-
}
|
|
95
|
-
);
|
|
96
|
-
return context.hasCustomAnchor ? trigger : /* @__PURE__ */ jsxRuntimeExports.jsx(Anchor, { asChild: true, ...popperScope, children: trigger });
|
|
97
|
-
}
|
|
98
|
-
);
|
|
99
|
-
PopoverTrigger.displayName = TRIGGER_NAME;
|
|
100
|
-
var PORTAL_NAME = "PopoverPortal";
|
|
101
|
-
var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {
|
|
102
|
-
forceMount: void 0
|
|
103
|
-
});
|
|
104
|
-
var PopoverPortal = (props) => {
|
|
105
|
-
const { __scopePopover, forceMount, children, container } = props;
|
|
106
|
-
const context = usePopoverContext(PORTAL_NAME, __scopePopover);
|
|
107
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Portal$1, { asChild: true, container, children }) }) });
|
|
108
|
-
};
|
|
109
|
-
PopoverPortal.displayName = PORTAL_NAME;
|
|
110
|
-
var CONTENT_NAME = "PopoverContent";
|
|
111
|
-
var PopoverContent = React.forwardRef(
|
|
112
|
-
(props, forwardedRef) => {
|
|
113
|
-
const portalContext = usePortalContext(CONTENT_NAME, props.__scopePopover);
|
|
114
|
-
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
115
|
-
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
116
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsxRuntimeExports.jsx(PopoverContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsxRuntimeExports.jsx(PopoverContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
|
117
|
-
}
|
|
118
|
-
);
|
|
119
|
-
PopoverContent.displayName = CONTENT_NAME;
|
|
120
|
-
var Slot = createSlot("PopoverContent.RemoveScroll");
|
|
121
|
-
var PopoverContentModal = React.forwardRef(
|
|
122
|
-
(props, forwardedRef) => {
|
|
123
|
-
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
124
|
-
const contentRef = React.useRef(null);
|
|
125
|
-
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
126
|
-
const isRightClickOutsideRef = React.useRef(false);
|
|
127
|
-
React.useEffect(() => {
|
|
128
|
-
const content = contentRef.current;
|
|
129
|
-
if (content) return hideOthers(content);
|
|
130
|
-
}, []);
|
|
131
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
132
|
-
PopoverContentImpl,
|
|
133
|
-
{
|
|
134
|
-
...props,
|
|
135
|
-
ref: composedRefs,
|
|
136
|
-
trapFocus: context.open,
|
|
137
|
-
disableOutsidePointerEvents: true,
|
|
138
|
-
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
139
|
-
event.preventDefault();
|
|
140
|
-
if (!isRightClickOutsideRef.current) context.triggerRef.current?.focus();
|
|
141
|
-
}),
|
|
142
|
-
onPointerDownOutside: composeEventHandlers(
|
|
143
|
-
props.onPointerDownOutside,
|
|
144
|
-
(event) => {
|
|
145
|
-
const originalEvent = event.detail.originalEvent;
|
|
146
|
-
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
147
|
-
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
148
|
-
isRightClickOutsideRef.current = isRightClick;
|
|
149
|
-
},
|
|
150
|
-
{ checkForDefaultPrevented: false }
|
|
151
|
-
),
|
|
152
|
-
onFocusOutside: composeEventHandlers(
|
|
153
|
-
props.onFocusOutside,
|
|
154
|
-
(event) => event.preventDefault(),
|
|
155
|
-
{ checkForDefaultPrevented: false }
|
|
156
|
-
)
|
|
157
|
-
}
|
|
158
|
-
) });
|
|
159
|
-
}
|
|
160
|
-
);
|
|
161
|
-
var PopoverContentNonModal = React.forwardRef(
|
|
162
|
-
(props, forwardedRef) => {
|
|
163
|
-
const context = usePopoverContext(CONTENT_NAME, props.__scopePopover);
|
|
164
|
-
const hasInteractedOutsideRef = React.useRef(false);
|
|
165
|
-
const hasPointerDownOutsideRef = React.useRef(false);
|
|
166
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
167
|
-
PopoverContentImpl,
|
|
168
|
-
{
|
|
169
|
-
...props,
|
|
170
|
-
ref: forwardedRef,
|
|
171
|
-
trapFocus: false,
|
|
172
|
-
disableOutsidePointerEvents: false,
|
|
173
|
-
onCloseAutoFocus: (event) => {
|
|
174
|
-
props.onCloseAutoFocus?.(event);
|
|
175
|
-
if (!event.defaultPrevented) {
|
|
176
|
-
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
177
|
-
event.preventDefault();
|
|
178
|
-
}
|
|
179
|
-
hasInteractedOutsideRef.current = false;
|
|
180
|
-
hasPointerDownOutsideRef.current = false;
|
|
181
|
-
},
|
|
182
|
-
onInteractOutside: (event) => {
|
|
183
|
-
props.onInteractOutside?.(event);
|
|
184
|
-
if (!event.defaultPrevented) {
|
|
185
|
-
hasInteractedOutsideRef.current = true;
|
|
186
|
-
if (event.detail.originalEvent.type === "pointerdown") {
|
|
187
|
-
hasPointerDownOutsideRef.current = true;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
const target = event.target;
|
|
191
|
-
const targetIsTrigger = context.triggerRef.current?.contains(target);
|
|
192
|
-
if (targetIsTrigger) event.preventDefault();
|
|
193
|
-
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
|
194
|
-
event.preventDefault();
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
);
|
|
199
|
-
}
|
|
200
|
-
);
|
|
201
|
-
var PopoverContentImpl = React.forwardRef(
|
|
202
|
-
(props, forwardedRef) => {
|
|
203
|
-
const {
|
|
204
|
-
__scopePopover,
|
|
205
|
-
trapFocus,
|
|
206
|
-
onOpenAutoFocus,
|
|
207
|
-
onCloseAutoFocus,
|
|
208
|
-
disableOutsidePointerEvents,
|
|
209
|
-
onEscapeKeyDown,
|
|
210
|
-
onPointerDownOutside,
|
|
211
|
-
onFocusOutside,
|
|
212
|
-
onInteractOutside,
|
|
213
|
-
...contentProps
|
|
214
|
-
} = props;
|
|
215
|
-
const context = usePopoverContext(CONTENT_NAME, __scopePopover);
|
|
216
|
-
const popperScope = usePopperScope(__scopePopover);
|
|
217
|
-
useFocusGuards();
|
|
218
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
219
|
-
FocusScope,
|
|
220
|
-
{
|
|
221
|
-
asChild: true,
|
|
222
|
-
loop: true,
|
|
223
|
-
trapped: trapFocus,
|
|
224
|
-
onMountAutoFocus: onOpenAutoFocus,
|
|
225
|
-
onUnmountAutoFocus: onCloseAutoFocus,
|
|
226
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
227
|
-
DismissableLayer,
|
|
228
|
-
{
|
|
229
|
-
asChild: true,
|
|
230
|
-
disableOutsidePointerEvents,
|
|
231
|
-
onInteractOutside,
|
|
232
|
-
onEscapeKeyDown,
|
|
233
|
-
onPointerDownOutside,
|
|
234
|
-
onFocusOutside,
|
|
235
|
-
onDismiss: () => context.onOpenChange(false),
|
|
236
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
237
|
-
Content,
|
|
238
|
-
{
|
|
239
|
-
"data-state": getState(context.open),
|
|
240
|
-
role: "dialog",
|
|
241
|
-
id: context.contentId,
|
|
242
|
-
...popperScope,
|
|
243
|
-
...contentProps,
|
|
244
|
-
ref: forwardedRef,
|
|
245
|
-
style: {
|
|
246
|
-
...contentProps.style,
|
|
247
|
-
// re-namespace exposed content custom properties
|
|
248
|
-
...{
|
|
249
|
-
"--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
250
|
-
"--radix-popover-content-available-width": "var(--radix-popper-available-width)",
|
|
251
|
-
"--radix-popover-content-available-height": "var(--radix-popper-available-height)",
|
|
252
|
-
"--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
|
|
253
|
-
"--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
)
|
|
258
|
-
}
|
|
259
|
-
)
|
|
260
|
-
}
|
|
261
|
-
);
|
|
262
|
-
}
|
|
263
|
-
);
|
|
264
|
-
var CLOSE_NAME = "PopoverClose";
|
|
265
|
-
var PopoverClose = React.forwardRef(
|
|
266
|
-
(props, forwardedRef) => {
|
|
267
|
-
const { __scopePopover, ...closeProps } = props;
|
|
268
|
-
const context = usePopoverContext(CLOSE_NAME, __scopePopover);
|
|
269
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
270
|
-
Primitive.button,
|
|
271
|
-
{
|
|
272
|
-
type: "button",
|
|
273
|
-
...closeProps,
|
|
274
|
-
ref: forwardedRef,
|
|
275
|
-
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
|
276
|
-
}
|
|
277
|
-
);
|
|
278
|
-
}
|
|
279
|
-
);
|
|
280
|
-
PopoverClose.displayName = CLOSE_NAME;
|
|
281
|
-
var ARROW_NAME = "PopoverArrow";
|
|
282
|
-
var PopoverArrow = React.forwardRef(
|
|
283
|
-
(props, forwardedRef) => {
|
|
284
|
-
const { __scopePopover, ...arrowProps } = props;
|
|
285
|
-
const popperScope = usePopperScope(__scopePopover);
|
|
286
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });
|
|
287
|
-
}
|
|
288
|
-
);
|
|
289
|
-
PopoverArrow.displayName = ARROW_NAME;
|
|
290
|
-
function getState(open) {
|
|
291
|
-
return open ? "open" : "closed";
|
|
292
|
-
}
|
|
293
|
-
var Root2 = Popover;
|
|
294
|
-
var Anchor2 = PopoverAnchor;
|
|
295
|
-
var Trigger = PopoverTrigger;
|
|
296
|
-
var Portal = PopoverPortal;
|
|
297
|
-
var Content2 = PopoverContent;
|
|
298
|
-
|
|
299
|
-
export { Anchor2 as Anchor, Content2 as Content, Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverPortal, PopoverTrigger, Portal, Root2 as Root, Trigger };
|
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { useFloating, offset, shift, flip, size, arrow, hide, limitShift } from '../../../@floating-ui/react-dom/dist/floating-ui.react-dom.js';
|
|
3
|
-
import { Root } from '../../react-arrow/dist/index.js';
|
|
4
|
-
import { useComposedRefs } from '../../react-compose-refs/dist/index.js';
|
|
5
|
-
import { createContextScope } from '../../react-context/dist/index.js';
|
|
6
|
-
import { Primitive } from '../../react-primitive/dist/index.js';
|
|
7
|
-
import { useCallbackRef } from '../../react-use-callback-ref/dist/index.js';
|
|
8
|
-
import { useLayoutEffect as useLayoutEffect2 } from '../../react-use-layout-effect/dist/index.js';
|
|
9
|
-
import { useSize } from '../../react-use-size/dist/index.js';
|
|
10
|
-
import { j as jsxRuntimeExports } from '../../../../_virtual/jsx-runtime.js';
|
|
11
|
-
import { autoUpdate } from '../../../@floating-ui/dom/dist/floating-ui.dom.js';
|
|
12
|
-
|
|
13
|
-
var POPPER_NAME = "Popper";
|
|
14
|
-
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
15
|
-
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
16
|
-
var Popper = (props) => {
|
|
17
|
-
const { __scopePopper, children } = props;
|
|
18
|
-
const [anchor, setAnchor] = React.useState(null);
|
|
19
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
20
|
-
};
|
|
21
|
-
Popper.displayName = POPPER_NAME;
|
|
22
|
-
var ANCHOR_NAME = "PopperAnchor";
|
|
23
|
-
var PopperAnchor = React.forwardRef(
|
|
24
|
-
(props, forwardedRef) => {
|
|
25
|
-
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
26
|
-
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
27
|
-
const ref = React.useRef(null);
|
|
28
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
29
|
-
const anchorRef = React.useRef(null);
|
|
30
|
-
React.useEffect(() => {
|
|
31
|
-
const previousAnchor = anchorRef.current;
|
|
32
|
-
anchorRef.current = virtualRef?.current || ref.current;
|
|
33
|
-
if (previousAnchor !== anchorRef.current) {
|
|
34
|
-
context.onAnchorChange(anchorRef.current);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
return virtualRef ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
38
|
-
}
|
|
39
|
-
);
|
|
40
|
-
PopperAnchor.displayName = ANCHOR_NAME;
|
|
41
|
-
var CONTENT_NAME = "PopperContent";
|
|
42
|
-
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
|
|
43
|
-
var PopperContent = React.forwardRef(
|
|
44
|
-
(props, forwardedRef) => {
|
|
45
|
-
const {
|
|
46
|
-
__scopePopper,
|
|
47
|
-
side = "bottom",
|
|
48
|
-
sideOffset = 0,
|
|
49
|
-
align = "center",
|
|
50
|
-
alignOffset = 0,
|
|
51
|
-
arrowPadding = 0,
|
|
52
|
-
avoidCollisions = true,
|
|
53
|
-
collisionBoundary = [],
|
|
54
|
-
collisionPadding: collisionPaddingProp = 0,
|
|
55
|
-
sticky = "partial",
|
|
56
|
-
hideWhenDetached = false,
|
|
57
|
-
updatePositionStrategy = "optimized",
|
|
58
|
-
onPlaced,
|
|
59
|
-
...contentProps
|
|
60
|
-
} = props;
|
|
61
|
-
const context = usePopperContext(CONTENT_NAME, __scopePopper);
|
|
62
|
-
const [content, setContent] = React.useState(null);
|
|
63
|
-
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
64
|
-
const [arrow$1, setArrow] = React.useState(null);
|
|
65
|
-
const arrowSize = useSize(arrow$1);
|
|
66
|
-
const arrowWidth = arrowSize?.width ?? 0;
|
|
67
|
-
const arrowHeight = arrowSize?.height ?? 0;
|
|
68
|
-
const desiredPlacement = side + (align !== "center" ? "-" + align : "");
|
|
69
|
-
const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
|
|
70
|
-
const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
|
|
71
|
-
const hasExplicitBoundaries = boundary.length > 0;
|
|
72
|
-
const detectOverflowOptions = {
|
|
73
|
-
padding: collisionPadding,
|
|
74
|
-
boundary: boundary.filter(isNotNull),
|
|
75
|
-
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
76
|
-
altBoundary: hasExplicitBoundaries
|
|
77
|
-
};
|
|
78
|
-
const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
|
|
79
|
-
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
80
|
-
strategy: "fixed",
|
|
81
|
-
placement: desiredPlacement,
|
|
82
|
-
whileElementsMounted: (...args) => {
|
|
83
|
-
const cleanup = autoUpdate(...args, {
|
|
84
|
-
animationFrame: updatePositionStrategy === "always"
|
|
85
|
-
});
|
|
86
|
-
return cleanup;
|
|
87
|
-
},
|
|
88
|
-
elements: {
|
|
89
|
-
reference: context.anchor
|
|
90
|
-
},
|
|
91
|
-
middleware: [
|
|
92
|
-
offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),
|
|
93
|
-
avoidCollisions && shift({
|
|
94
|
-
mainAxis: true,
|
|
95
|
-
crossAxis: false,
|
|
96
|
-
limiter: sticky === "partial" ? limitShift() : void 0,
|
|
97
|
-
...detectOverflowOptions
|
|
98
|
-
}),
|
|
99
|
-
avoidCollisions && flip({ ...detectOverflowOptions }),
|
|
100
|
-
size({
|
|
101
|
-
...detectOverflowOptions,
|
|
102
|
-
apply: ({ elements, rects, availableWidth, availableHeight }) => {
|
|
103
|
-
const { width: anchorWidth, height: anchorHeight } = rects.reference;
|
|
104
|
-
const contentStyle = elements.floating.style;
|
|
105
|
-
contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
|
|
106
|
-
contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
|
|
107
|
-
contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
|
|
108
|
-
contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
|
|
109
|
-
}
|
|
110
|
-
}),
|
|
111
|
-
arrow$1 && arrow({ element: arrow$1, padding: arrowPadding }),
|
|
112
|
-
transformOrigin({ arrowWidth, arrowHeight }),
|
|
113
|
-
hideWhenDetached && hide({ strategy: "referenceHidden", ...detectOverflowOptions })
|
|
114
|
-
]
|
|
115
|
-
});
|
|
116
|
-
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
117
|
-
const handlePlaced = useCallbackRef(onPlaced);
|
|
118
|
-
useLayoutEffect2(() => {
|
|
119
|
-
if (isPositioned) {
|
|
120
|
-
handlePlaced?.();
|
|
121
|
-
}
|
|
122
|
-
}, [isPositioned, handlePlaced]);
|
|
123
|
-
const arrowX = middlewareData.arrow?.x;
|
|
124
|
-
const arrowY = middlewareData.arrow?.y;
|
|
125
|
-
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
126
|
-
const [contentZIndex, setContentZIndex] = React.useState();
|
|
127
|
-
useLayoutEffect2(() => {
|
|
128
|
-
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
129
|
-
}, [content]);
|
|
130
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
131
|
-
"div",
|
|
132
|
-
{
|
|
133
|
-
ref: refs.setFloating,
|
|
134
|
-
"data-radix-popper-content-wrapper": "",
|
|
135
|
-
style: {
|
|
136
|
-
...floatingStyles,
|
|
137
|
-
transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
|
|
138
|
-
// keep off the page when measuring
|
|
139
|
-
minWidth: "max-content",
|
|
140
|
-
zIndex: contentZIndex,
|
|
141
|
-
["--radix-popper-transform-origin"]: [
|
|
142
|
-
middlewareData.transformOrigin?.x,
|
|
143
|
-
middlewareData.transformOrigin?.y
|
|
144
|
-
].join(" "),
|
|
145
|
-
// hide the content if using the hide middleware and should be hidden
|
|
146
|
-
// set visibility to hidden and disable pointer events so the UI behaves
|
|
147
|
-
// as if the PopperContent isn't there at all
|
|
148
|
-
...middlewareData.hide?.referenceHidden && {
|
|
149
|
-
visibility: "hidden",
|
|
150
|
-
pointerEvents: "none"
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
dir: props.dir,
|
|
154
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
155
|
-
PopperContentProvider,
|
|
156
|
-
{
|
|
157
|
-
scope: __scopePopper,
|
|
158
|
-
placedSide,
|
|
159
|
-
onArrowChange: setArrow,
|
|
160
|
-
arrowX,
|
|
161
|
-
arrowY,
|
|
162
|
-
shouldHideArrow: cannotCenterArrow,
|
|
163
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
164
|
-
Primitive.div,
|
|
165
|
-
{
|
|
166
|
-
"data-side": placedSide,
|
|
167
|
-
"data-align": placedAlign,
|
|
168
|
-
...contentProps,
|
|
169
|
-
ref: composedRefs,
|
|
170
|
-
style: {
|
|
171
|
-
...contentProps.style,
|
|
172
|
-
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
173
|
-
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
174
|
-
animation: !isPositioned ? "none" : void 0
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
)
|
|
178
|
-
}
|
|
179
|
-
)
|
|
180
|
-
}
|
|
181
|
-
);
|
|
182
|
-
}
|
|
183
|
-
);
|
|
184
|
-
PopperContent.displayName = CONTENT_NAME;
|
|
185
|
-
var ARROW_NAME = "PopperArrow";
|
|
186
|
-
var OPPOSITE_SIDE = {
|
|
187
|
-
top: "bottom",
|
|
188
|
-
right: "left",
|
|
189
|
-
bottom: "top",
|
|
190
|
-
left: "right"
|
|
191
|
-
};
|
|
192
|
-
var PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
193
|
-
const { __scopePopper, ...arrowProps } = props;
|
|
194
|
-
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
195
|
-
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
196
|
-
return (
|
|
197
|
-
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
198
|
-
// doesn't report size as we'd expect on SVG elements.
|
|
199
|
-
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
200
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
201
|
-
"span",
|
|
202
|
-
{
|
|
203
|
-
ref: contentContext.onArrowChange,
|
|
204
|
-
style: {
|
|
205
|
-
position: "absolute",
|
|
206
|
-
left: contentContext.arrowX,
|
|
207
|
-
top: contentContext.arrowY,
|
|
208
|
-
[baseSide]: 0,
|
|
209
|
-
transformOrigin: {
|
|
210
|
-
top: "",
|
|
211
|
-
right: "0 0",
|
|
212
|
-
bottom: "center 0",
|
|
213
|
-
left: "100% 0"
|
|
214
|
-
}[contentContext.placedSide],
|
|
215
|
-
transform: {
|
|
216
|
-
top: "translateY(100%)",
|
|
217
|
-
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
218
|
-
bottom: `rotate(180deg)`,
|
|
219
|
-
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
220
|
-
}[contentContext.placedSide],
|
|
221
|
-
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
222
|
-
},
|
|
223
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
224
|
-
Root,
|
|
225
|
-
{
|
|
226
|
-
...arrowProps,
|
|
227
|
-
ref: forwardedRef,
|
|
228
|
-
style: {
|
|
229
|
-
...arrowProps.style,
|
|
230
|
-
// ensures the element can be measured correctly (mostly for if SVG)
|
|
231
|
-
display: "block"
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
)
|
|
235
|
-
}
|
|
236
|
-
)
|
|
237
|
-
);
|
|
238
|
-
});
|
|
239
|
-
PopperArrow.displayName = ARROW_NAME;
|
|
240
|
-
function isNotNull(value) {
|
|
241
|
-
return value !== null;
|
|
242
|
-
}
|
|
243
|
-
var transformOrigin = (options) => ({
|
|
244
|
-
name: "transformOrigin",
|
|
245
|
-
options,
|
|
246
|
-
fn(data) {
|
|
247
|
-
const { placement, rects, middlewareData } = data;
|
|
248
|
-
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
249
|
-
const isArrowHidden = cannotCenterArrow;
|
|
250
|
-
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
|
251
|
-
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
|
252
|
-
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
253
|
-
const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
|
|
254
|
-
const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
|
|
255
|
-
const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
|
|
256
|
-
let x = "";
|
|
257
|
-
let y = "";
|
|
258
|
-
if (placedSide === "bottom") {
|
|
259
|
-
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
260
|
-
y = `${-arrowHeight}px`;
|
|
261
|
-
} else if (placedSide === "top") {
|
|
262
|
-
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
263
|
-
y = `${rects.floating.height + arrowHeight}px`;
|
|
264
|
-
} else if (placedSide === "right") {
|
|
265
|
-
x = `${-arrowHeight}px`;
|
|
266
|
-
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
267
|
-
} else if (placedSide === "left") {
|
|
268
|
-
x = `${rects.floating.width + arrowHeight}px`;
|
|
269
|
-
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
270
|
-
}
|
|
271
|
-
return { data: { x, y } };
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
function getSideAndAlignFromPlacement(placement) {
|
|
275
|
-
const [side, align = "center"] = placement.split("-");
|
|
276
|
-
return [side, align];
|
|
277
|
-
}
|
|
278
|
-
var Root2 = Popper;
|
|
279
|
-
var Anchor = PopperAnchor;
|
|
280
|
-
var Content = PopperContent;
|
|
281
|
-
var Arrow = PopperArrow;
|
|
282
|
-
|
|
283
|
-
export { Anchor, Arrow, Content, Popper, PopperAnchor, PopperArrow, PopperContent, Root2 as Root, createPopperScope };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import ReactDOM__default from 'react-dom';
|
|
3
|
-
import { Primitive } from '../../react-primitive/dist/index.js';
|
|
4
|
-
import { useLayoutEffect as useLayoutEffect2 } from '../../react-use-layout-effect/dist/index.js';
|
|
5
|
-
import { j as jsxRuntimeExports } from '../../../../_virtual/jsx-runtime.js';
|
|
6
|
-
|
|
7
|
-
var PORTAL_NAME = "Portal";
|
|
8
|
-
var Portal = React.forwardRef((props, forwardedRef) => {
|
|
9
|
-
const { container: containerProp, ...portalProps } = props;
|
|
10
|
-
const [mounted, setMounted] = React.useState(false);
|
|
11
|
-
useLayoutEffect2(() => setMounted(true), []);
|
|
12
|
-
const container = containerProp || mounted && globalThis?.document?.body;
|
|
13
|
-
return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsxRuntimeExports.jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
14
|
-
});
|
|
15
|
-
Portal.displayName = PORTAL_NAME;
|
|
16
|
-
|
|
17
|
-
export { Portal };
|