@cerberus-design/react 0.25.1-rc.1 → 0.25.2-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/components/accordion/primitives.cjs +2 -2
- package/dist/components/accordion/primitives.js +2 -2
- package/dist/components/admonition/primitives.js +1 -1
- package/dist/components/button/button.js +1 -1
- package/dist/components/button/primitives.js +1 -1
- package/dist/components/carousel/parts.js +1 -1
- package/dist/components/carousel/primitives.cjs +3 -3
- package/dist/components/carousel/primitives.js +3 -3
- package/dist/components/circular-progress/primitives.cjs +4 -4
- package/dist/components/circular-progress/primitives.js +5 -5
- package/dist/components/clipboard/primitives.cjs +4 -4
- package/dist/components/clipboard/primitives.js +4 -4
- package/dist/components/collapsible/index.cjs +1 -0
- package/dist/components/collapsible/index.js +1 -1
- package/dist/components/collapsible/parts.cjs +1 -0
- package/dist/components/collapsible/parts.d.cts +4 -0
- package/dist/components/collapsible/parts.d.ts +4 -0
- package/dist/components/collapsible/parts.js +2 -1
- package/dist/components/collapsible/primitives.cjs +3 -0
- package/dist/components/collapsible/primitives.d.cts +6 -1
- package/dist/components/collapsible/primitives.d.ts +6 -1
- package/dist/components/collapsible/primitives.js +3 -1
- package/dist/components/combobox/combobox.cjs +1 -2
- package/dist/components/combobox/combobox.d.cts +0 -5
- package/dist/components/combobox/combobox.d.ts +0 -5
- package/dist/components/combobox/combobox.js +1 -2
- package/dist/components/combobox/primitives.cjs +7 -7
- package/dist/components/combobox/primitives.js +7 -7
- package/dist/components/date-picker/calendar.cjs +1 -1
- package/dist/components/date-picker/calendar.d.cts +0 -5
- package/dist/components/date-picker/calendar.d.ts +0 -5
- package/dist/components/date-picker/calendar.js +1 -1
- package/dist/components/date-picker/index.cjs +4 -4
- package/dist/components/date-picker/index.js +2 -2
- package/dist/components/date-picker/primitives.cjs +7 -7
- package/dist/components/date-picker/primitives.js +7 -7
- package/dist/components/deprecated/Legend.js +1 -1
- package/dist/components/deprecated/NavMenuLink.js +1 -1
- package/dist/components/dialog/primitives.cjs +2 -2
- package/dist/components/dialog/primitives.js +2 -2
- package/dist/components/field/primitives.cjs +2 -2
- package/dist/components/field/primitives.js +2 -2
- package/dist/components/file-upload/file-status.js +1 -1
- package/dist/components/file-upload/file-uploader.cjs +1 -1
- package/dist/components/file-upload/file-uploader.js +1 -1
- package/dist/components/file-upload/index.cjs +1 -0
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/file-upload/parts.cjs +1 -0
- package/dist/components/file-upload/parts.d.cts +4 -0
- package/dist/components/file-upload/parts.d.ts +4 -0
- package/dist/components/file-upload/parts.js +2 -1
- package/dist/components/file-upload/primitives.cjs +11 -9
- package/dist/components/file-upload/primitives.d.cts +2 -0
- package/dist/components/file-upload/primitives.d.ts +2 -0
- package/dist/components/file-upload/primitives.js +11 -10
- package/dist/components/file-upload/utils.cjs +1 -1
- package/dist/components/file-upload/utils.js +1 -1
- package/dist/components/menu/menu.js +1 -1
- package/dist/components/notifications/index.cjs +4 -4
- package/dist/components/notifications/index.js +1 -1
- package/dist/components/number-input/primitives.cjs +3 -3
- package/dist/components/number-input/primitives.js +3 -3
- package/dist/components/pin-input/primitives.cjs +1 -1
- package/dist/components/pin-input/primitives.js +1 -1
- package/dist/components/progress/primitives.js +1 -1
- package/dist/components/radio/primitives.cjs +3 -3
- package/dist/components/radio/primitives.js +3 -3
- package/dist/components/rating/primitives.cjs +2 -2
- package/dist/components/rating/primitives.js +2 -2
- package/dist/components/select/primitives.cjs +8 -8
- package/dist/components/select/primitives.js +8 -8
- package/dist/components/select/select.d.cts +0 -5
- package/dist/components/select/select.d.ts +0 -5
- package/dist/components/switch/primitives.cjs +2 -2
- package/dist/components/switch/primitives.js +2 -2
- package/dist/components/table/primitives.js +1 -1
- package/dist/components/tabs/parts.js +1 -1
- package/dist/components/tabs/primitives.cjs +2 -2
- package/dist/components/tabs/primitives.js +2 -2
- package/dist/components/tooltip/primitives.cjs +4 -4
- package/dist/components/tooltip/primitives.js +4 -4
- package/dist/context/cerberus.js +1 -1
- package/dist/context/confirm-modal.js +1 -1
- package/dist/context/feature-flags.js +1 -1
- package/dist/context/navMenu.js +1 -1
- package/dist/context/prompt-modal.js +1 -1
- package/dist/context/theme.js +1 -1
- package/dist/index.cjs +266 -256
- package/dist/index.client.d.cts +1 -1
- package/dist/index.client.d.ts +1 -1
- package/dist/index.js +9 -9
- package/dist/node_modules/.pnpm/@ark-ui_react@5.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-root-provider.cjs +21 -0
- package/dist/node_modules/.pnpm/@ark-ui_react@5.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-root-provider.js +17 -0
- package/dist/node_modules/.pnpm/{@floating-ui_core@1.7.3 → @floating-ui_core@1.7.4}/node_modules/@floating-ui/core/dist/floating-ui.core.cjs +79 -73
- package/dist/node_modules/.pnpm/{@floating-ui_core@1.7.3 → @floating-ui_core@1.7.4}/node_modules/@floating-ui/core/dist/floating-ui.core.js +80 -74
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs +1 -1
- package/dist/node_modules/.pnpm/@floating-ui_dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +2 -2
- package/dist/node_modules/.pnpm/@internationalized_date@3.10.0/node_modules/@internationalized/date/src/queries.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_accordion@1.31.1/node_modules/@zag-js/accordion/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@zag-js_avatar@1.31.1/node_modules/@zag-js/avatar/dist/index.cjs +5 -5
- package/dist/node_modules/.pnpm/@zag-js_carousel@1.31.1/node_modules/@zag-js/carousel/dist/index.cjs +16 -16
- package/dist/node_modules/.pnpm/@zag-js_carousel@1.31.1/node_modules/@zag-js/carousel/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@zag-js_clipboard@1.31.1/node_modules/@zag-js/clipboard/dist/index.cjs +4 -4
- package/dist/node_modules/.pnpm/@zag-js_clipboard@1.31.1/node_modules/@zag-js/clipboard/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_collapsible@1.31.1/node_modules/@zag-js/collapsible/dist/index.cjs +11 -11
- package/dist/node_modules/.pnpm/@zag-js_collapsible@1.31.1/node_modules/@zag-js/collapsible/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_combobox@1.31.1/node_modules/@zag-js/combobox/dist/index.cjs +84 -84
- package/dist/node_modules/.pnpm/@zag-js_combobox@1.31.1/node_modules/@zag-js/combobox/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_date-picker@1.31.1_@internationalized_date@3.10.0/node_modules/@zag-js/date-picker/dist/index.cjs +154 -154
- package/dist/node_modules/.pnpm/@zag-js_date-picker@1.31.1_@internationalized_date@3.10.0/node_modules/@zag-js/date-picker/dist/index.js +4 -4
- package/dist/node_modules/.pnpm/@zag-js_date-utils@1.31.1_@internationalized_date@3.10.0/node_modules/@zag-js/date-utils/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/@zag-js_date-utils@1.31.1_@internationalized_date@3.10.0/node_modules/@zag-js/date-utils/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@zag-js_dialog@1.31.1/node_modules/@zag-js/dialog/dist/index.cjs +14 -14
- package/dist/node_modules/.pnpm/@zag-js_file-upload@1.31.1/node_modules/@zag-js/file-upload/dist/index.cjs +47 -47
- package/dist/node_modules/.pnpm/@zag-js_file-upload@1.31.1/node_modules/@zag-js/file-upload/dist/index.js +3 -3
- package/dist/node_modules/.pnpm/@zag-js_number-input@1.31.1/node_modules/@zag-js/number-input/dist/index.cjs +53 -53
- package/dist/node_modules/.pnpm/@zag-js_number-input@1.31.1/node_modules/@zag-js/number-input/dist/index.js +3 -3
- package/dist/node_modules/.pnpm/@zag-js_pin-input@1.31.1/node_modules/@zag-js/pin-input/dist/index.cjs +44 -44
- package/dist/node_modules/.pnpm/@zag-js_pin-input@1.31.1/node_modules/@zag-js/pin-input/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_progress@1.31.1/node_modules/@zag-js/progress/dist/index.cjs +6 -6
- package/dist/node_modules/.pnpm/@zag-js_rating-group@1.31.1/node_modules/@zag-js/rating-group/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_react@1.31.1_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@zag-js/react/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_remove-scroll@1.31.1/node_modules/@zag-js/remove-scroll/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_select@1.31.1/node_modules/@zag-js/select/dist/index.cjs +5 -5
- package/dist/node_modules/.pnpm/@zag-js_tabs@1.31.1/node_modules/@zag-js/tabs/dist/index.cjs +37 -37
- package/dist/node_modules/.pnpm/@zag-js_tabs@1.31.1/node_modules/@zag-js/tabs/dist/index.js +2 -2
- package/dist/node_modules/.pnpm/@zag-js_toast@1.31.1/node_modules/@zag-js/toast/dist/index.cjs +33 -33
- package/dist/node_modules/.pnpm/@zag-js_toast@1.31.1/node_modules/@zag-js/toast/dist/index.js +1 -1
- package/dist/node_modules/.pnpm/@zag-js_tooltip@1.31.1/node_modules/@zag-js/tooltip/dist/index.cjs +9 -9
- package/dist/node_modules/.pnpm/@zag-js_tooltip@1.31.1/node_modules/@zag-js/tooltip/dist/index.js +1 -1
- package/package.json +3 -3
- package/src/components/collapsible/parts.ts +6 -0
- package/src/components/collapsible/primitives.tsx +6 -0
- package/src/components/combobox/combobox.tsx +0 -6
- package/src/components/date-picker/calendar.tsx +1 -6
- package/src/components/file-upload/file-uploader.tsx +2 -2
- package/src/components/file-upload/parts.tsx +6 -0
- package/src/components/file-upload/primitives.ts +5 -0
- package/src/components/file-upload/utils.ts +1 -1
- package/src/components/select/select.tsx +0 -5
- package/src/index.client.ts +2 -0
package/dist/index.client.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AccordionRootProvider, useAccordion, DialogRootProvider, useDialog, FileUploadRootProvider, useFileUpload, ClientOnly, DownloadTrigger, FocusTrap, Format, Frame, Highlight, JsonTreeView, useJsonTreeView, Presence, EnvironmentProvider, useEnvironmentContext, LocaleProvider, useLocaleContext, } from '@ark-ui/react';
|
|
1
|
+
export { AccordionRootProvider, useAccordion, useCollapsible, useCollapsibleContext, DialogRootProvider, useDialog, FileUploadRootProvider, useFileUpload, ClientOnly, DownloadTrigger, FocusTrap, Format, Frame, Highlight, JsonTreeView, useJsonTreeView, Presence, EnvironmentProvider, useEnvironmentContext, LocaleProvider, useLocaleContext, } from '@ark-ui/react';
|
|
2
2
|
export * from '@dnd-kit/core';
|
package/dist/index.client.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { AccordionRootProvider, useAccordion, DialogRootProvider, useDialog, FileUploadRootProvider, useFileUpload, ClientOnly, DownloadTrigger, FocusTrap, Format, Frame, Highlight, JsonTreeView, useJsonTreeView, Presence, EnvironmentProvider, useEnvironmentContext, LocaleProvider, useLocaleContext, } from '@ark-ui/react';
|
|
1
|
+
export { AccordionRootProvider, useAccordion, useCollapsible, useCollapsibleContext, DialogRootProvider, useDialog, FileUploadRootProvider, useFileUpload, ClientOnly, DownloadTrigger, FocusTrap, Format, Frame, Highlight, JsonTreeView, useJsonTreeView, Presence, EnvironmentProvider, useEnvironmentContext, LocaleProvider, useLocaleContext, } from '@ark-ui/react';
|
|
2
2
|
export * from '@dnd-kit/core';
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,7 @@ export { CircularProgress } from './components/circular-progress/circular-progre
|
|
|
31
31
|
export { ClipboardContext, ClipboardControl, ClipboardIndicator, ClipboardInput, ClipboardLabel, ClipboardRoot, ClipboardTrigger } from './components/clipboard/primitives.js';
|
|
32
32
|
export { Clipboard } from './components/clipboard/parts.js';
|
|
33
33
|
export { Collapsible } from './components/collapsible/parts.js';
|
|
34
|
-
export { CollapsibleContent, CollapsibleIndicator, CollapsibleRoot, CollapsibleTrigger } from './components/collapsible/primitives.js';
|
|
34
|
+
export { CollapsibleContent, CollapsibleIndicator, CollapsibleRoot, CollapsibleRootProvider, CollapsibleTrigger } from './components/collapsible/primitives.js';
|
|
35
35
|
export { ComboboxParts } from './components/combobox/parts.js';
|
|
36
36
|
export { ComboItemText, ComboboxClearTrigger, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxItemGroup, ComboboxItemGroupLabel, ComboboxItemIndicator, ComboboxItemText, ComboboxLabel, ComboboxPositioner, ComboboxRoot, ComboboxStartIcon, ComboboxTrigger } from './components/combobox/primitives.js';
|
|
37
37
|
export { Combobox } from './components/combobox/combobox.js';
|
|
@@ -59,7 +59,7 @@ export { FieldStatusIndicator } from './components/field/status-indicator.js';
|
|
|
59
59
|
export { Fieldset } from './components/fieldset/fieldset.js';
|
|
60
60
|
export { FieldsetParts } from './components/fieldset/parts.js';
|
|
61
61
|
export { FieldsetErrorText, FieldsetHelperText, FieldsetLegend, FieldsetRoot } from './components/fieldset/primitives.js';
|
|
62
|
-
export { FileUploadClearTrigger, FileUploadContext, FileUploadDescription, FileUploadDropzone, FileUploadHeading, FileUploadHiddenInput, FileUploadIcon, FileUploadItem, FileUploadItemDeleteTrigger, FileUploadItemGroup, FileUploadItemName, FileUploadItemPreview, FileUploadItemPreviewImage, FileUploadItemSizeText, FileUploadLabel, FileUploadRoot, FileUploadTrigger } from './components/file-upload/primitives.js';
|
|
62
|
+
export { FileUploadClearTrigger, FileUploadContent, FileUploadContext, FileUploadDescription, FileUploadDropzone, FileUploadHeading, FileUploadHiddenInput, FileUploadIcon, FileUploadItem, FileUploadItemDeleteTrigger, FileUploadItemGroup, FileUploadItemName, FileUploadItemPreview, FileUploadItemPreviewImage, FileUploadItemSizeText, FileUploadLabel, FileUploadRoot, FileUploadTrigger } from './components/file-upload/primitives.js';
|
|
63
63
|
export { FileUploadParts } from './components/file-upload/parts.js';
|
|
64
64
|
export { FileStatus, processStatus } from './components/file-upload/file-status.js';
|
|
65
65
|
export { FileUploader } from './components/file-upload/file-uploader.js';
|
|
@@ -123,17 +123,17 @@ export { useRootColors } from './hooks/useRootColors.js';
|
|
|
123
123
|
export { makeSystemConfig } from './config/index.js';
|
|
124
124
|
export { formatNotifyCount, splitProps } from './utils/index.js';
|
|
125
125
|
export { cerberus, createCerberusPrimitive } from './system/index.js';
|
|
126
|
-
export
|
|
127
|
-
export {
|
|
126
|
+
export * from '@dnd-kit/core';
|
|
127
|
+
export { AccordionRootProvider, ClientOnly, DialogRootProvider, DownloadTrigger, EnvironmentProvider, FileUploadRootProvider, FocusTrap, Format, Frame, Highlight, JsonTreeView, LocaleProvider, Presence, useAccordion, useCollapsible, useCollapsibleContext, useDialog, useEnvironmentContext, useFileUpload, useJsonTreeView, useLocaleContext } from '@ark-ui/react';
|
|
128
128
|
export { CalendarDate } from './node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/src/CalendarDate.js';
|
|
129
|
-
export { getLocalTimeZone, today } from './node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/src/queries.js';
|
|
130
129
|
export { DateFormatter } from './node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/src/DateFormatter.js';
|
|
131
130
|
export { IconButton } from './components/icon-button/button.js';
|
|
132
131
|
export { IconButtonRoot } from './components/icon-button/primitives.js';
|
|
133
|
-
export { createToaster } from './node_modules/.pnpm/@ark-ui_react@5.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@ark-ui/react/dist/components/toast/create-toaster.js';
|
|
134
|
-
export { Toaster } from './node_modules/.pnpm/@ark-ui_react@5.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@ark-ui/react/dist/components/toast/toaster.js';
|
|
135
132
|
export { SplitButton } from './components/split-button/button.js';
|
|
133
|
+
export { Toaster } from './node_modules/.pnpm/@ark-ui_react@5.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@ark-ui/react/dist/components/toast/toaster.js';
|
|
134
|
+
export { createToaster } from './node_modules/.pnpm/@ark-ui_react@5.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@ark-ui/react/dist/components/toast/create-toaster.js';
|
|
136
135
|
export { defineIcons } from './config/defineIcons.js';
|
|
137
136
|
export { getLocalStorage, setLocalStorage } from './utils/localStorage.js';
|
|
138
|
-
export {
|
|
139
|
-
export
|
|
137
|
+
export { getLocalTimeZone, today } from './node_modules/.pnpm/@internationalized_date@3.10.1/node_modules/@internationalized/date/src/queries.js';
|
|
138
|
+
export { parse as parseDate } from './node_modules/.pnpm/@zag-js_date-picker@1.31.1_@internationalized_date@3.10.0/node_modules/@zag-js/date-picker/dist/index.js';
|
|
139
|
+
export { useAvatarContext } from './node_modules/.pnpm/@ark-ui_react@5.30.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@ark-ui/react/dist/components/avatar/use-avatar-context.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
const React = require('react');
|
|
8
|
+
const createSplitProps = require('../../utils/create-split-props.cjs');
|
|
9
|
+
const factory = require('../factory.cjs');
|
|
10
|
+
const useCollapsibleContext = require('./use-collapsible-context.cjs');
|
|
11
|
+
const index = require('../../../../../../../@zag-js_core@1.31.1/node_modules/@zag-js/core/dist/index.cjs');
|
|
12
|
+
|
|
13
|
+
const splitRootProviderProps = createSplitProps.createSplitProps();
|
|
14
|
+
const CollapsibleRootProvider = React.forwardRef((props, ref) => {
|
|
15
|
+
const [{ value: collapsible }, localProps] = splitRootProviderProps(props, ["value"]);
|
|
16
|
+
const mergedProps = index.mergeProps(collapsible.getRootProps(), localProps);
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsx(useCollapsibleContext.CollapsibleProvider, { value: collapsible, children: /* @__PURE__ */ jsxRuntime.jsx(factory.ark.div, { ...mergedProps, ref }) });
|
|
18
|
+
});
|
|
19
|
+
CollapsibleRootProvider.displayName = "CollapsibleRootProvider";
|
|
20
|
+
|
|
21
|
+
exports.CollapsibleRootProvider = CollapsibleRootProvider;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { createSplitProps } from '../../utils/create-split-props.js';
|
|
5
|
+
import { ark } from '../factory.js';
|
|
6
|
+
import { CollapsibleProvider } from './use-collapsible-context.js';
|
|
7
|
+
import { mergeProps } from '../../../../../../../@zag-js_core@1.31.1/node_modules/@zag-js/core/dist/index.js';
|
|
8
|
+
|
|
9
|
+
const splitRootProviderProps = createSplitProps();
|
|
10
|
+
const CollapsibleRootProvider = forwardRef((props, ref) => {
|
|
11
|
+
const [{ value: collapsible }, localProps] = splitRootProviderProps(props, ["value"]);
|
|
12
|
+
const mergedProps = mergeProps(collapsible.getRootProps(), localProps);
|
|
13
|
+
return /* @__PURE__ */ jsx(CollapsibleProvider, { value: collapsible, children: /* @__PURE__ */ jsx(ark.div, { ...mergedProps, ref }) });
|
|
14
|
+
});
|
|
15
|
+
CollapsibleRootProvider.displayName = "CollapsibleRootProvider";
|
|
16
|
+
|
|
17
|
+
export { CollapsibleRootProvider };
|
|
@@ -61,6 +61,71 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
61
61
|
return coords;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
66
|
+
* element is overflowing a given clipping boundary on each side.
|
|
67
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
68
|
+
* - negative = how many pixels left before it will overflow
|
|
69
|
+
* - 0 = lies flush with the boundary
|
|
70
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
71
|
+
*/
|
|
72
|
+
async function detectOverflow(state, options) {
|
|
73
|
+
var _await$platform$isEle;
|
|
74
|
+
if (options === void 0) {
|
|
75
|
+
options = {};
|
|
76
|
+
}
|
|
77
|
+
const {
|
|
78
|
+
x,
|
|
79
|
+
y,
|
|
80
|
+
platform,
|
|
81
|
+
rects,
|
|
82
|
+
elements,
|
|
83
|
+
strategy
|
|
84
|
+
} = state;
|
|
85
|
+
const {
|
|
86
|
+
boundary = 'clippingAncestors',
|
|
87
|
+
rootBoundary = 'viewport',
|
|
88
|
+
elementContext = 'floating',
|
|
89
|
+
altBoundary = false,
|
|
90
|
+
padding = 0
|
|
91
|
+
} = floatingUi_utils.evaluate(options, state);
|
|
92
|
+
const paddingObject = floatingUi_utils.getPaddingObject(padding);
|
|
93
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
94
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
95
|
+
const clippingClientRect = floatingUi_utils.rectToClientRect(await platform.getClippingRect({
|
|
96
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
97
|
+
boundary,
|
|
98
|
+
rootBoundary,
|
|
99
|
+
strategy
|
|
100
|
+
}));
|
|
101
|
+
const rect = elementContext === 'floating' ? {
|
|
102
|
+
x,
|
|
103
|
+
y,
|
|
104
|
+
width: rects.floating.width,
|
|
105
|
+
height: rects.floating.height
|
|
106
|
+
} : rects.reference;
|
|
107
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
108
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
109
|
+
x: 1,
|
|
110
|
+
y: 1
|
|
111
|
+
} : {
|
|
112
|
+
x: 1,
|
|
113
|
+
y: 1
|
|
114
|
+
};
|
|
115
|
+
const elementClientRect = floatingUi_utils.rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
116
|
+
elements,
|
|
117
|
+
rect,
|
|
118
|
+
offsetParent,
|
|
119
|
+
strategy
|
|
120
|
+
}) : rect);
|
|
121
|
+
return {
|
|
122
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
123
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
124
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
125
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
64
129
|
/**
|
|
65
130
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
66
131
|
* next to a given reference element.
|
|
@@ -90,6 +155,7 @@ const computePosition = async (reference, floating, config) => {
|
|
|
90
155
|
let middlewareData = {};
|
|
91
156
|
let resetCount = 0;
|
|
92
157
|
for (let i = 0; i < validMiddleware.length; i++) {
|
|
158
|
+
var _platform$detectOverf;
|
|
93
159
|
const {
|
|
94
160
|
name,
|
|
95
161
|
fn
|
|
@@ -107,7 +173,10 @@ const computePosition = async (reference, floating, config) => {
|
|
|
107
173
|
strategy,
|
|
108
174
|
middlewareData,
|
|
109
175
|
rects,
|
|
110
|
-
platform
|
|
176
|
+
platform: {
|
|
177
|
+
...platform,
|
|
178
|
+
detectOverflow: (_platform$detectOverf = platform.detectOverflow) != null ? _platform$detectOverf : detectOverflow
|
|
179
|
+
},
|
|
111
180
|
elements: {
|
|
112
181
|
reference,
|
|
113
182
|
floating
|
|
@@ -152,71 +221,6 @@ const computePosition = async (reference, floating, config) => {
|
|
|
152
221
|
};
|
|
153
222
|
};
|
|
154
223
|
|
|
155
|
-
/**
|
|
156
|
-
* Resolves with an object of overflow side offsets that determine how much the
|
|
157
|
-
* element is overflowing a given clipping boundary on each side.
|
|
158
|
-
* - positive = overflowing the boundary by that number of pixels
|
|
159
|
-
* - negative = how many pixels left before it will overflow
|
|
160
|
-
* - 0 = lies flush with the boundary
|
|
161
|
-
* @see https://floating-ui.com/docs/detectOverflow
|
|
162
|
-
*/
|
|
163
|
-
async function detectOverflow(state, options) {
|
|
164
|
-
var _await$platform$isEle;
|
|
165
|
-
if (options === void 0) {
|
|
166
|
-
options = {};
|
|
167
|
-
}
|
|
168
|
-
const {
|
|
169
|
-
x,
|
|
170
|
-
y,
|
|
171
|
-
platform,
|
|
172
|
-
rects,
|
|
173
|
-
elements,
|
|
174
|
-
strategy
|
|
175
|
-
} = state;
|
|
176
|
-
const {
|
|
177
|
-
boundary = 'clippingAncestors',
|
|
178
|
-
rootBoundary = 'viewport',
|
|
179
|
-
elementContext = 'floating',
|
|
180
|
-
altBoundary = false,
|
|
181
|
-
padding = 0
|
|
182
|
-
} = floatingUi_utils.evaluate(options, state);
|
|
183
|
-
const paddingObject = floatingUi_utils.getPaddingObject(padding);
|
|
184
|
-
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
185
|
-
const element = elements[altBoundary ? altContext : elementContext];
|
|
186
|
-
const clippingClientRect = floatingUi_utils.rectToClientRect(await platform.getClippingRect({
|
|
187
|
-
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
188
|
-
boundary,
|
|
189
|
-
rootBoundary,
|
|
190
|
-
strategy
|
|
191
|
-
}));
|
|
192
|
-
const rect = elementContext === 'floating' ? {
|
|
193
|
-
x,
|
|
194
|
-
y,
|
|
195
|
-
width: rects.floating.width,
|
|
196
|
-
height: rects.floating.height
|
|
197
|
-
} : rects.reference;
|
|
198
|
-
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
199
|
-
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
200
|
-
x: 1,
|
|
201
|
-
y: 1
|
|
202
|
-
} : {
|
|
203
|
-
x: 1,
|
|
204
|
-
y: 1
|
|
205
|
-
};
|
|
206
|
-
const elementClientRect = floatingUi_utils.rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
207
|
-
elements,
|
|
208
|
-
rect,
|
|
209
|
-
offsetParent,
|
|
210
|
-
strategy
|
|
211
|
-
}) : rect);
|
|
212
|
-
return {
|
|
213
|
-
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
214
|
-
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
215
|
-
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
216
|
-
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
|
|
220
224
|
/**
|
|
221
225
|
* Provides data to position an inner element of the floating element so that it
|
|
222
226
|
* appears centered to the reference element.
|
|
@@ -349,7 +353,7 @@ const flip = function (options) {
|
|
|
349
353
|
fallbackPlacements.push(...floatingUi_utils.getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
350
354
|
}
|
|
351
355
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
352
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
356
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
353
357
|
const overflows = [];
|
|
354
358
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
355
359
|
if (checkMainAxis) {
|
|
@@ -456,7 +460,8 @@ const hide = function (options) {
|
|
|
456
460
|
options,
|
|
457
461
|
async fn(state) {
|
|
458
462
|
const {
|
|
459
|
-
rects
|
|
463
|
+
rects,
|
|
464
|
+
platform
|
|
460
465
|
} = state;
|
|
461
466
|
const {
|
|
462
467
|
strategy = 'referenceHidden',
|
|
@@ -465,7 +470,7 @@ const hide = function (options) {
|
|
|
465
470
|
switch (strategy) {
|
|
466
471
|
case 'referenceHidden':
|
|
467
472
|
{
|
|
468
|
-
const overflow = await detectOverflow(state, {
|
|
473
|
+
const overflow = await platform.detectOverflow(state, {
|
|
469
474
|
...detectOverflowOptions,
|
|
470
475
|
elementContext: 'reference'
|
|
471
476
|
});
|
|
@@ -479,7 +484,7 @@ const hide = function (options) {
|
|
|
479
484
|
}
|
|
480
485
|
case 'escaped':
|
|
481
486
|
{
|
|
482
|
-
const overflow = await detectOverflow(state, {
|
|
487
|
+
const overflow = await platform.detectOverflow(state, {
|
|
483
488
|
...detectOverflowOptions,
|
|
484
489
|
altBoundary: true
|
|
485
490
|
});
|
|
@@ -602,7 +607,8 @@ const shift = function (options) {
|
|
|
602
607
|
const {
|
|
603
608
|
x,
|
|
604
609
|
y,
|
|
605
|
-
placement
|
|
610
|
+
placement,
|
|
611
|
+
platform
|
|
606
612
|
} = state;
|
|
607
613
|
const {
|
|
608
614
|
mainAxis: checkMainAxis = true,
|
|
@@ -625,7 +631,7 @@ const shift = function (options) {
|
|
|
625
631
|
x,
|
|
626
632
|
y
|
|
627
633
|
};
|
|
628
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
634
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
629
635
|
const crossAxis = floatingUi_utils.getSideAxis(floatingUi_utils.getSide(placement));
|
|
630
636
|
const mainAxis = floatingUi_utils.getOppositeAxis(crossAxis);
|
|
631
637
|
let mainAxisCoord = coords[mainAxis];
|
|
@@ -757,7 +763,7 @@ const size = function (options) {
|
|
|
757
763
|
apply = () => {},
|
|
758
764
|
...detectOverflowOptions
|
|
759
765
|
} = floatingUi_utils.evaluate(options, state);
|
|
760
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
766
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
761
767
|
const side = floatingUi_utils.getSide(placement);
|
|
762
768
|
const alignment = floatingUi_utils.getAlignment(placement);
|
|
763
769
|
const isYAxis = floatingUi_utils.getSideAxis(placement) === 'y';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { evaluate, getSide, getSideAxis, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, getAlignmentSides, clamp, getPaddingObject, getAlignmentAxis, getAlignment, min, max,
|
|
2
|
+
import { evaluate, getSide, getSideAxis, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, getAlignmentSides, clamp, getPaddingObject, getAlignmentAxis, getAlignment, min, max, getOppositeAxis, getAxisLength, sides, rectToClientRect } from '../../../../../@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js';
|
|
3
3
|
|
|
4
4
|
function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
5
5
|
let {
|
|
@@ -57,6 +57,71 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
57
57
|
return coords;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Resolves with an object of overflow side offsets that determine how much the
|
|
62
|
+
* element is overflowing a given clipping boundary on each side.
|
|
63
|
+
* - positive = overflowing the boundary by that number of pixels
|
|
64
|
+
* - negative = how many pixels left before it will overflow
|
|
65
|
+
* - 0 = lies flush with the boundary
|
|
66
|
+
* @see https://floating-ui.com/docs/detectOverflow
|
|
67
|
+
*/
|
|
68
|
+
async function detectOverflow(state, options) {
|
|
69
|
+
var _await$platform$isEle;
|
|
70
|
+
if (options === void 0) {
|
|
71
|
+
options = {};
|
|
72
|
+
}
|
|
73
|
+
const {
|
|
74
|
+
x,
|
|
75
|
+
y,
|
|
76
|
+
platform,
|
|
77
|
+
rects,
|
|
78
|
+
elements,
|
|
79
|
+
strategy
|
|
80
|
+
} = state;
|
|
81
|
+
const {
|
|
82
|
+
boundary = 'clippingAncestors',
|
|
83
|
+
rootBoundary = 'viewport',
|
|
84
|
+
elementContext = 'floating',
|
|
85
|
+
altBoundary = false,
|
|
86
|
+
padding = 0
|
|
87
|
+
} = evaluate(options, state);
|
|
88
|
+
const paddingObject = getPaddingObject(padding);
|
|
89
|
+
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
90
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
91
|
+
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
92
|
+
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
93
|
+
boundary,
|
|
94
|
+
rootBoundary,
|
|
95
|
+
strategy
|
|
96
|
+
}));
|
|
97
|
+
const rect = elementContext === 'floating' ? {
|
|
98
|
+
x,
|
|
99
|
+
y,
|
|
100
|
+
width: rects.floating.width,
|
|
101
|
+
height: rects.floating.height
|
|
102
|
+
} : rects.reference;
|
|
103
|
+
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
104
|
+
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
105
|
+
x: 1,
|
|
106
|
+
y: 1
|
|
107
|
+
} : {
|
|
108
|
+
x: 1,
|
|
109
|
+
y: 1
|
|
110
|
+
};
|
|
111
|
+
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
112
|
+
elements,
|
|
113
|
+
rect,
|
|
114
|
+
offsetParent,
|
|
115
|
+
strategy
|
|
116
|
+
}) : rect);
|
|
117
|
+
return {
|
|
118
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
119
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
120
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
121
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
60
125
|
/**
|
|
61
126
|
* Computes the `x` and `y` coordinates that will place the floating element
|
|
62
127
|
* next to a given reference element.
|
|
@@ -86,6 +151,7 @@ const computePosition = async (reference, floating, config) => {
|
|
|
86
151
|
let middlewareData = {};
|
|
87
152
|
let resetCount = 0;
|
|
88
153
|
for (let i = 0; i < validMiddleware.length; i++) {
|
|
154
|
+
var _platform$detectOverf;
|
|
89
155
|
const {
|
|
90
156
|
name,
|
|
91
157
|
fn
|
|
@@ -103,7 +169,10 @@ const computePosition = async (reference, floating, config) => {
|
|
|
103
169
|
strategy,
|
|
104
170
|
middlewareData,
|
|
105
171
|
rects,
|
|
106
|
-
platform
|
|
172
|
+
platform: {
|
|
173
|
+
...platform,
|
|
174
|
+
detectOverflow: (_platform$detectOverf = platform.detectOverflow) != null ? _platform$detectOverf : detectOverflow
|
|
175
|
+
},
|
|
107
176
|
elements: {
|
|
108
177
|
reference,
|
|
109
178
|
floating
|
|
@@ -148,71 +217,6 @@ const computePosition = async (reference, floating, config) => {
|
|
|
148
217
|
};
|
|
149
218
|
};
|
|
150
219
|
|
|
151
|
-
/**
|
|
152
|
-
* Resolves with an object of overflow side offsets that determine how much the
|
|
153
|
-
* element is overflowing a given clipping boundary on each side.
|
|
154
|
-
* - positive = overflowing the boundary by that number of pixels
|
|
155
|
-
* - negative = how many pixels left before it will overflow
|
|
156
|
-
* - 0 = lies flush with the boundary
|
|
157
|
-
* @see https://floating-ui.com/docs/detectOverflow
|
|
158
|
-
*/
|
|
159
|
-
async function detectOverflow(state, options) {
|
|
160
|
-
var _await$platform$isEle;
|
|
161
|
-
if (options === void 0) {
|
|
162
|
-
options = {};
|
|
163
|
-
}
|
|
164
|
-
const {
|
|
165
|
-
x,
|
|
166
|
-
y,
|
|
167
|
-
platform,
|
|
168
|
-
rects,
|
|
169
|
-
elements,
|
|
170
|
-
strategy
|
|
171
|
-
} = state;
|
|
172
|
-
const {
|
|
173
|
-
boundary = 'clippingAncestors',
|
|
174
|
-
rootBoundary = 'viewport',
|
|
175
|
-
elementContext = 'floating',
|
|
176
|
-
altBoundary = false,
|
|
177
|
-
padding = 0
|
|
178
|
-
} = evaluate(options, state);
|
|
179
|
-
const paddingObject = getPaddingObject(padding);
|
|
180
|
-
const altContext = elementContext === 'floating' ? 'reference' : 'floating';
|
|
181
|
-
const element = elements[altBoundary ? altContext : elementContext];
|
|
182
|
-
const clippingClientRect = rectToClientRect(await platform.getClippingRect({
|
|
183
|
-
element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
|
|
184
|
-
boundary,
|
|
185
|
-
rootBoundary,
|
|
186
|
-
strategy
|
|
187
|
-
}));
|
|
188
|
-
const rect = elementContext === 'floating' ? {
|
|
189
|
-
x,
|
|
190
|
-
y,
|
|
191
|
-
width: rects.floating.width,
|
|
192
|
-
height: rects.floating.height
|
|
193
|
-
} : rects.reference;
|
|
194
|
-
const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
|
|
195
|
-
const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
|
|
196
|
-
x: 1,
|
|
197
|
-
y: 1
|
|
198
|
-
} : {
|
|
199
|
-
x: 1,
|
|
200
|
-
y: 1
|
|
201
|
-
};
|
|
202
|
-
const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
203
|
-
elements,
|
|
204
|
-
rect,
|
|
205
|
-
offsetParent,
|
|
206
|
-
strategy
|
|
207
|
-
}) : rect);
|
|
208
|
-
return {
|
|
209
|
-
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
210
|
-
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
211
|
-
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
212
|
-
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
|
|
216
220
|
/**
|
|
217
221
|
* Provides data to position an inner element of the floating element so that it
|
|
218
222
|
* appears centered to the reference element.
|
|
@@ -345,7 +349,7 @@ const flip = function (options) {
|
|
|
345
349
|
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
346
350
|
}
|
|
347
351
|
const placements = [initialPlacement, ...fallbackPlacements];
|
|
348
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
352
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
349
353
|
const overflows = [];
|
|
350
354
|
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
351
355
|
if (checkMainAxis) {
|
|
@@ -452,7 +456,8 @@ const hide = function (options) {
|
|
|
452
456
|
options,
|
|
453
457
|
async fn(state) {
|
|
454
458
|
const {
|
|
455
|
-
rects
|
|
459
|
+
rects,
|
|
460
|
+
platform
|
|
456
461
|
} = state;
|
|
457
462
|
const {
|
|
458
463
|
strategy = 'referenceHidden',
|
|
@@ -461,7 +466,7 @@ const hide = function (options) {
|
|
|
461
466
|
switch (strategy) {
|
|
462
467
|
case 'referenceHidden':
|
|
463
468
|
{
|
|
464
|
-
const overflow = await detectOverflow(state, {
|
|
469
|
+
const overflow = await platform.detectOverflow(state, {
|
|
465
470
|
...detectOverflowOptions,
|
|
466
471
|
elementContext: 'reference'
|
|
467
472
|
});
|
|
@@ -475,7 +480,7 @@ const hide = function (options) {
|
|
|
475
480
|
}
|
|
476
481
|
case 'escaped':
|
|
477
482
|
{
|
|
478
|
-
const overflow = await detectOverflow(state, {
|
|
483
|
+
const overflow = await platform.detectOverflow(state, {
|
|
479
484
|
...detectOverflowOptions,
|
|
480
485
|
altBoundary: true
|
|
481
486
|
});
|
|
@@ -598,7 +603,8 @@ const shift = function (options) {
|
|
|
598
603
|
const {
|
|
599
604
|
x,
|
|
600
605
|
y,
|
|
601
|
-
placement
|
|
606
|
+
placement,
|
|
607
|
+
platform
|
|
602
608
|
} = state;
|
|
603
609
|
const {
|
|
604
610
|
mainAxis: checkMainAxis = true,
|
|
@@ -621,7 +627,7 @@ const shift = function (options) {
|
|
|
621
627
|
x,
|
|
622
628
|
y
|
|
623
629
|
};
|
|
624
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
630
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
625
631
|
const crossAxis = getSideAxis(getSide(placement));
|
|
626
632
|
const mainAxis = getOppositeAxis(crossAxis);
|
|
627
633
|
let mainAxisCoord = coords[mainAxis];
|
|
@@ -753,7 +759,7 @@ const size = function (options) {
|
|
|
753
759
|
apply = () => {},
|
|
754
760
|
...detectOverflowOptions
|
|
755
761
|
} = evaluate(options, state);
|
|
756
|
-
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
762
|
+
const overflow = await platform.detectOverflow(state, detectOverflowOptions);
|
|
757
763
|
const side = getSide(placement);
|
|
758
764
|
const alignment = getAlignment(placement);
|
|
759
765
|
const isYAxis = getSideAxis(placement) === 'y';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
5
|
|
|
6
|
-
const floatingUi_core = require('../../../../../@floating-ui_core@1.7.
|
|
6
|
+
const floatingUi_core = require('../../../../../@floating-ui_core@1.7.4/node_modules/@floating-ui/core/dist/floating-ui.core.cjs');
|
|
7
7
|
const floatingUi_utils = require('../../../../../@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.cjs');
|
|
8
8
|
const floatingUi_utils_dom = require('../../../../../@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.cjs');
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { offset as offset$1, flip as flip$1, shift as shift$1, arrow as arrow$1, size as size$1, hide as hide$1, computePosition as computePosition$1, limitShift as limitShift$1 } from '../../../../../@floating-ui_core@1.7.
|
|
3
|
-
import { createCoords, rectToClientRect, floor,
|
|
2
|
+
import { offset as offset$1, flip as flip$1, shift as shift$1, arrow as arrow$1, size as size$1, hide as hide$1, computePosition as computePosition$1, limitShift as limitShift$1 } from '../../../../../@floating-ui_core@1.7.4/node_modules/@floating-ui/core/dist/floating-ui.core.js';
|
|
3
|
+
import { createCoords, rectToClientRect, floor, round, max, min } from '../../../../../@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.js';
|
|
4
4
|
import { getOverflowAncestors, isElement, getDocumentElement, getWindow, getFrameElement, getComputedStyle as getComputedStyle$1, isHTMLElement, isWebKit, isTopLayer, getParentNode, isLastTraversableNode, isTableElement, isContainingBlock, getContainingBlock, getNodeName, isOverflowElement, getNodeScroll } from '../../../../../@floating-ui_utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js';
|
|
5
5
|
|
|
6
6
|
function getCssDimensions(element) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAnatomy } from '../../../../../@zag-js_anatomy@1.31.1/node_modules/@zag-js/anatomy/dist/index.js';
|
|
2
|
-
import {
|
|
3
|
-
import { warn,
|
|
2
|
+
import { getEventKey, isSafari, dataAttr, prevById, nextById, queryAll } from '../../../../../@zag-js_dom-query@1.31.1/node_modules/@zag-js/dom-query/dist/index.js';
|
|
3
|
+
import { warn, add, remove, last, first } from '../../../../../@zag-js_utils@1.31.1/node_modules/@zag-js/utils/dist/index.js';
|
|
4
4
|
import { createMachine, createGuards } from '../../../../../@zag-js_core@1.31.1/node_modules/@zag-js/core/dist/index.js';
|
|
5
5
|
import { createProps } from '../../../../../@zag-js_types@1.31.1/node_modules/@zag-js/types/dist/index.js';
|
|
6
6
|
|
package/dist/node_modules/.pnpm/@zag-js_avatar@1.31.1/node_modules/@zag-js/avatar/dist/index.cjs
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const index$
|
|
6
|
-
const index$
|
|
5
|
+
const index$1 = require('../../../../../@zag-js_anatomy@1.31.1/node_modules/@zag-js/anatomy/dist/index.cjs');
|
|
6
|
+
const index$2 = require('../../../../../@zag-js_dom-query@1.31.1/node_modules/@zag-js/dom-query/dist/index.cjs');
|
|
7
7
|
const index = require('../../../../../@zag-js_core@1.31.1/node_modules/@zag-js/core/dist/index.cjs');
|
|
8
8
|
const index$3 = require('../../../../../@zag-js_types@1.31.1/node_modules/@zag-js/types/dist/index.cjs');
|
|
9
9
|
|
|
10
10
|
// src/avatar.anatomy.ts
|
|
11
|
-
var anatomy = index$
|
|
11
|
+
var anatomy = index$1.createAnatomy("avatar").parts("root", "image", "fallback");
|
|
12
12
|
var parts = anatomy.build();
|
|
13
13
|
|
|
14
14
|
// src/avatar.dom.ts
|
|
@@ -129,7 +129,7 @@ var machine = index.createMachine({
|
|
|
129
129
|
effects: {
|
|
130
130
|
trackImageRemoval({ send, scope }) {
|
|
131
131
|
const rootEl = getRootEl(scope);
|
|
132
|
-
return index$
|
|
132
|
+
return index$2.observeChildren(rootEl, {
|
|
133
133
|
callback(records) {
|
|
134
134
|
const removedNodes = Array.from(records[0].removedNodes);
|
|
135
135
|
const removed = removedNodes.find(
|
|
@@ -143,7 +143,7 @@ var machine = index.createMachine({
|
|
|
143
143
|
},
|
|
144
144
|
trackSrcChange({ send, scope }) {
|
|
145
145
|
const imageEl = getImageEl(scope);
|
|
146
|
-
return index$
|
|
146
|
+
return index$2.observeAttributes(imageEl, {
|
|
147
147
|
attributes: ["src", "srcset"],
|
|
148
148
|
callback() {
|
|
149
149
|
send({ type: "src.change" });
|