@jobber/components 8.22.0 → 8.23.0

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.
Files changed (72) hide show
  1. package/dist/CSPContext-cjs.js +69 -0
  2. package/dist/CSPContext-es.js +46 -0
  3. package/dist/Card/index.cjs +2 -0
  4. package/dist/Card/index.mjs +2 -0
  5. package/dist/ComboboxChipRemove-cjs.js +54 -211
  6. package/dist/ComboboxChipRemove-es.js +8 -164
  7. package/dist/DataDump/index.cjs +2 -0
  8. package/dist/DataDump/index.mjs +2 -0
  9. package/dist/Dialog/index.cjs +1 -0
  10. package/dist/Dialog/index.mjs +1 -0
  11. package/dist/DrawerDescription-cjs.js +2 -1
  12. package/dist/DrawerDescription-es.js +3 -2
  13. package/dist/DrawerTitle-es.js +1 -1
  14. package/dist/InputNumberExperimental-cjs.js +24 -23
  15. package/dist/InputNumberExperimental-es.js +3 -2
  16. package/dist/InternalBackdrop-es.js +3 -3
  17. package/dist/Menu/index.cjs +2 -0
  18. package/dist/Menu/index.mjs +2 -0
  19. package/dist/Menu-cjs.js +1 -1
  20. package/dist/Menu-es.js +1 -1
  21. package/dist/MenuSubmenuTrigger-cjs.js +5 -13
  22. package/dist/MenuSubmenuTrigger-es.js +8 -16
  23. package/dist/NumberFieldInput-cjs.js +9 -9
  24. package/dist/NumberFieldInput-es.js +3 -3
  25. package/dist/Page/index.cjs +2 -0
  26. package/dist/Page/index.mjs +2 -0
  27. package/dist/ScrollAreaViewport-cjs.js +5 -47
  28. package/dist/ScrollAreaViewport-es.js +5 -46
  29. package/dist/SelectGroupLabel-cjs.js +1924 -0
  30. package/dist/SelectGroupLabel-es.js +1888 -0
  31. package/dist/SelectPrimitive-cjs.js +112 -0
  32. package/dist/SelectPrimitive-es.js +110 -0
  33. package/dist/ToolbarRootContext-cjs.js +35 -0
  34. package/dist/ToolbarRootContext-es.js +14 -0
  35. package/dist/docs/SelectPrimitive/SelectPrimitive.md +326 -0
  36. package/dist/docs/index.md +1 -0
  37. package/dist/floating-ui.react-dom-cjs.js +1 -0
  38. package/dist/floating-ui.react-dom-es.js +2 -2
  39. package/dist/floating-ui.utils.dom-es.js +1 -1
  40. package/dist/index.cjs +2 -0
  41. package/dist/index.mjs +2 -0
  42. package/dist/primitives/BottomSheet/index.cjs +1 -0
  43. package/dist/primitives/BottomSheet/index.mjs +1 -0
  44. package/dist/primitives/ComboboxPrimitive/index.cjs +3 -1
  45. package/dist/primitives/ComboboxPrimitive/index.mjs +3 -1
  46. package/dist/primitives/InputNumberExperimental/index.cjs +2 -1
  47. package/dist/primitives/InputNumberExperimental/index.mjs +2 -1
  48. package/dist/primitives/SelectPrimitive/SelectPrimitive.d.ts +63 -0
  49. package/dist/primitives/SelectPrimitive/index.cjs +29 -0
  50. package/dist/primitives/SelectPrimitive/index.d.ts +2 -0
  51. package/dist/primitives/SelectPrimitive/index.mjs +23 -0
  52. package/dist/primitives/SelectPrimitive/types.d.ts +16 -0
  53. package/dist/primitives/index.cjs +8 -1
  54. package/dist/primitives/index.d.ts +1 -0
  55. package/dist/primitives/index.mjs +7 -1
  56. package/dist/primitives/mergeClassName.d.ts +12 -0
  57. package/dist/resolveAriaLabelledBy-cjs.js +195 -0
  58. package/dist/resolveAriaLabelledBy-es.js +162 -0
  59. package/dist/styles.css +325 -0
  60. package/dist/unstyledPrimitives/index.cjs +416 -24
  61. package/dist/unstyledPrimitives/index.d.ts +1 -0
  62. package/dist/unstyledPrimitives/index.mjs +417 -26
  63. package/dist/useButton-cjs.js +2 -0
  64. package/dist/useButton-es.js +3 -2
  65. package/dist/useCompositeListItem-es.js +3 -3
  66. package/dist/useLabel-cjs.js +3 -329
  67. package/dist/useLabel-es.js +4 -299
  68. package/dist/useLabelableId-cjs.js +332 -0
  69. package/dist/useLabelableId-es.js +300 -0
  70. package/dist/useRenderElement-cjs.js +3 -0
  71. package/dist/useRenderElement-es.js +4 -1
  72. package/package.json +2 -2
@@ -162,4 +162,4 @@ function getFrameElement(win) {
162
162
  return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
163
163
  }
164
164
 
165
- export { isHTMLElement as a, isElement as b, isNode as c, isLastTraversableNode as d, getParentNode as e, getComputedStyle as f, getNodeName as g, getOverflowAncestors as h, isShadowRoot as i, isWebKit as j, getWindow as k, getFrameElement as l, getDocumentElement as m, isTopLayer as n, isOverflowElement as o, getNodeScroll as p, isTableElement as q, isContainingBlock as r, getContainingBlock as s };
165
+ export { isHTMLElement as a, isElement as b, isNode as c, isLastTraversableNode as d, getParentNode as e, getComputedStyle as f, getNodeName as g, getOverflowAncestors as h, isShadowRoot as i, isWebKit as j, getDocumentElement as k, isTopLayer as l, isOverflowElement as m, getNodeScroll as n, getWindow as o, isTableElement as p, isContainingBlock as q, getContainingBlock as r, getFrameElement as s };
package/dist/index.cjs CHANGED
@@ -175,6 +175,7 @@ require('./useRenderElement-cjs.js');
175
175
  require('./ScrollAreaViewport-cjs.js');
176
176
  require('./InternalBackdrop-cjs.js');
177
177
  require('./useButton-cjs.js');
178
+ require('./CSPContext-cjs.js');
178
179
  require('./clamp-cjs.js');
179
180
  require('./BottomSheet-cjs.js');
180
181
  require('./DrawerTitle-cjs.js');
@@ -188,6 +189,7 @@ require('./OverlaySeparator-cjs.js');
188
189
  require('./Separator-cjs.js');
189
190
  require('./MenuSubmenuTrigger-cjs.js');
190
191
  require('./useCompositeListItem-cjs.js');
192
+ require('./ToolbarRootContext-cjs.js');
191
193
  require('./AtlantisPortalContent-cjs.js');
192
194
  require('@jobber/formatters');
193
195
  require('react-dom/client');
package/dist/index.mjs CHANGED
@@ -173,6 +173,7 @@ import './useRenderElement-es.js';
173
173
  import './ScrollAreaViewport-es.js';
174
174
  import './InternalBackdrop-es.js';
175
175
  import './useButton-es.js';
176
+ import './CSPContext-es.js';
176
177
  import './clamp-es.js';
177
178
  import './BottomSheet-es.js';
178
179
  import './DrawerTitle-es.js';
@@ -186,6 +187,7 @@ import './OverlaySeparator-es.js';
186
187
  import './Separator-es.js';
187
188
  import './MenuSubmenuTrigger-es.js';
188
189
  import './useCompositeListItem-es.js';
190
+ import './ToolbarRootContext-es.js';
189
191
  import './AtlantisPortalContent-es.js';
190
192
  import '@jobber/formatters';
191
193
  import 'react-dom/client';
@@ -18,6 +18,7 @@ require('../../floating-ui.utils.dom-cjs.js');
18
18
  require('../../useButton-cjs.js');
19
19
  require('react-dom');
20
20
  require('react/jsx-runtime');
21
+ require('../../CSPContext-cjs.js');
21
22
  require('../../clamp-cjs.js');
22
23
 
23
24
 
@@ -16,4 +16,5 @@ import '../../floating-ui.utils.dom-es.js';
16
16
  import '../../useButton-es.js';
17
17
  import 'react-dom';
18
18
  import 'react/jsx-runtime';
19
+ import '../../CSPContext-es.js';
19
20
  import '../../clamp-es.js';
@@ -15,12 +15,14 @@ require('../../ComboboxChipRemove-cjs.js');
15
15
  require('../../useButton-cjs.js');
16
16
  require('../../floating-ui.utils.dom-cjs.js');
17
17
  require('react-dom');
18
- require('../../useLabel-cjs.js');
18
+ require('../../useLabelableId-cjs.js');
19
19
  require('../../useCompositeListItem-cjs.js');
20
20
  require('../../InternalBackdrop-cjs.js');
21
21
  require('../../index.esm-cjs.js');
22
22
  require('react/jsx-runtime');
23
23
  require('../../floating-ui.react-dom-cjs.js');
24
+ require('../../resolveAriaLabelledBy-cjs.js');
25
+ require('../../useLabel-cjs.js');
24
26
  require('../../Separator-cjs.js');
25
27
 
26
28
 
@@ -13,10 +13,12 @@ import '../../ComboboxChipRemove-es.js';
13
13
  import '../../useButton-es.js';
14
14
  import '../../floating-ui.utils.dom-es.js';
15
15
  import 'react-dom';
16
- import '../../useLabel-es.js';
16
+ import '../../useLabelableId-es.js';
17
17
  import '../../useCompositeListItem-es.js';
18
18
  import '../../InternalBackdrop-es.js';
19
19
  import '../../index.esm-es.js';
20
20
  import 'react/jsx-runtime';
21
21
  import '../../floating-ui.react-dom-es.js';
22
+ import '../../resolveAriaLabelledBy-es.js';
23
+ import '../../useLabel-es.js';
22
24
  import '../../Separator-es.js';
@@ -14,10 +14,11 @@ require('../../useRenderElement-cjs.js');
14
14
  require('../../useButton-cjs.js');
15
15
  require('../../floating-ui.utils.dom-cjs.js');
16
16
  require('react-dom');
17
- require('../../useLabel-cjs.js');
17
+ require('../../useLabelableId-cjs.js');
18
18
  require('react/jsx-runtime');
19
19
  require('../../NumberFieldInput-cjs.js');
20
20
  require('../../clamp-cjs.js');
21
+ require('../../useLabel-cjs.js');
21
22
 
22
23
 
23
24
 
@@ -12,7 +12,8 @@ import '../../useRenderElement-es.js';
12
12
  import '../../useButton-es.js';
13
13
  import '../../floating-ui.utils.dom-es.js';
14
14
  import 'react-dom';
15
- import '../../useLabel-es.js';
15
+ import '../../useLabelableId-es.js';
16
16
  import 'react/jsx-runtime';
17
17
  import '../../NumberFieldInput-es.js';
18
18
  import '../../clamp-es.js';
19
+ import '../../useLabel-es.js';
@@ -0,0 +1,63 @@
1
+ import React from "react";
2
+ import { Select } from "../../unstyledPrimitives";
3
+ import { OverlaySeparator } from "../OverlaySeparator";
4
+ declare function SelectPrimitiveTrigger({ className, children, ...props }: React.ComponentPropsWithoutRef<typeof Select.Trigger>): React.JSX.Element;
5
+ declare namespace SelectPrimitiveTrigger {
6
+ var displayName: string;
7
+ }
8
+ declare function SelectPrimitiveValue({ className, ...props }: React.ComponentPropsWithoutRef<typeof Select.Value>): React.JSX.Element;
9
+ declare namespace SelectPrimitiveValue {
10
+ var displayName: string;
11
+ }
12
+ declare function SelectPrimitivePositioner({ className, sideOffset, alignItemWithTrigger, ...props }: React.ComponentPropsWithoutRef<typeof Select.Positioner>): React.JSX.Element;
13
+ declare namespace SelectPrimitivePositioner {
14
+ var displayName: string;
15
+ }
16
+ declare function SelectPrimitivePopup({ className, ...props }: React.ComponentPropsWithoutRef<typeof Select.Popup>): React.JSX.Element;
17
+ declare namespace SelectPrimitivePopup {
18
+ var displayName: string;
19
+ }
20
+ declare function SelectPrimitiveList({ className, ...props }: React.ComponentPropsWithoutRef<typeof Select.List>): React.JSX.Element;
21
+ declare namespace SelectPrimitiveList {
22
+ var displayName: string;
23
+ }
24
+ declare function SelectPrimitiveItem({ className, ...props }: React.ComponentPropsWithoutRef<typeof Select.Item>): React.JSX.Element;
25
+ declare namespace SelectPrimitiveItem {
26
+ var displayName: string;
27
+ }
28
+ declare function SelectPrimitiveItemText({ className, ...props }: React.ComponentPropsWithoutRef<typeof Select.ItemText>): React.JSX.Element;
29
+ declare namespace SelectPrimitiveItemText {
30
+ var displayName: string;
31
+ }
32
+ declare function SelectPrimitiveItemIndicator({ className, children, ...props }: React.ComponentPropsWithoutRef<typeof Select.ItemIndicator>): React.JSX.Element;
33
+ declare namespace SelectPrimitiveItemIndicator {
34
+ var displayName: string;
35
+ }
36
+ declare function SelectPrimitiveGroup({ className, ...props }: React.ComponentPropsWithoutRef<typeof Select.Group>): React.JSX.Element;
37
+ declare namespace SelectPrimitiveGroup {
38
+ var displayName: string;
39
+ }
40
+ declare function SelectPrimitiveGroupLabel({ className, ...props }: React.ComponentPropsWithoutRef<typeof Select.GroupLabel>): React.JSX.Element;
41
+ declare namespace SelectPrimitiveGroupLabel {
42
+ var displayName: string;
43
+ }
44
+ declare function SelectPrimitiveSeparator({ className, ...props }: React.ComponentPropsWithoutRef<typeof OverlaySeparator>): React.JSX.Element;
45
+ declare namespace SelectPrimitiveSeparator {
46
+ var displayName: string;
47
+ }
48
+ export declare const SelectPrimitive: {
49
+ Root: typeof Select.Root;
50
+ Trigger: typeof SelectPrimitiveTrigger;
51
+ Value: typeof SelectPrimitiveValue;
52
+ Portal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SelectPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
53
+ Positioner: typeof SelectPrimitivePositioner;
54
+ Popup: typeof SelectPrimitivePopup;
55
+ List: typeof SelectPrimitiveList;
56
+ Item: typeof SelectPrimitiveItem;
57
+ ItemText: typeof SelectPrimitiveItemText;
58
+ ItemIndicator: typeof SelectPrimitiveItemIndicator;
59
+ Group: typeof SelectPrimitiveGroup;
60
+ GroupLabel: typeof SelectPrimitiveGroupLabel;
61
+ Separator: typeof SelectPrimitiveSeparator;
62
+ };
63
+ export {};
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var SelectPrimitive = require('../../SelectPrimitive-cjs.js');
4
+ require('../../tslib.es6-cjs.js');
5
+ require('react');
6
+ require('classnames');
7
+ require('../../Icon-cjs.js');
8
+ require('@jobber/design');
9
+ require('../../OverlaySeparator-cjs.js');
10
+ require('../../Separator-cjs.js');
11
+ require('../../useRenderElement-cjs.js');
12
+ require('../../SelectGroupLabel-cjs.js');
13
+ require('../../useButton-cjs.js');
14
+ require('../../floating-ui.utils.dom-cjs.js');
15
+ require('react-dom');
16
+ require('../../InternalBackdrop-cjs.js');
17
+ require('../../index.esm-cjs.js');
18
+ require('react/jsx-runtime');
19
+ require('../../useLabelableId-cjs.js');
20
+ require('../../resolveAriaLabelledBy-cjs.js');
21
+ require('../../useCompositeListItem-cjs.js');
22
+ require('../../floating-ui.react-dom-cjs.js');
23
+ require('../../CSPContext-cjs.js');
24
+ require('../../ToolbarRootContext-cjs.js');
25
+ require('../../clamp-cjs.js');
26
+
27
+
28
+
29
+ exports.SelectPrimitive = SelectPrimitive.SelectPrimitive;
@@ -0,0 +1,2 @@
1
+ export { SelectPrimitive } from "./SelectPrimitive";
2
+ export type { SelectPrimitiveRootProps, SelectPrimitiveTriggerProps, SelectPrimitiveValueProps, SelectPrimitivePortalProps, SelectPrimitivePositionerProps, SelectPrimitivePopupProps, SelectPrimitiveListProps, SelectPrimitiveItemProps, SelectPrimitiveItemTextProps, SelectPrimitiveItemIndicatorProps, SelectPrimitiveGroupProps, SelectPrimitiveGroupLabelProps, SelectPrimitiveSeparatorProps, } from "./types";
@@ -0,0 +1,23 @@
1
+ export { S as SelectPrimitive } from '../../SelectPrimitive-es.js';
2
+ import '../../tslib.es6-es.js';
3
+ import 'react';
4
+ import 'classnames';
5
+ import '../../Icon-es.js';
6
+ import '@jobber/design';
7
+ import '../../OverlaySeparator-es.js';
8
+ import '../../Separator-es.js';
9
+ import '../../useRenderElement-es.js';
10
+ import '../../SelectGroupLabel-es.js';
11
+ import '../../useButton-es.js';
12
+ import '../../floating-ui.utils.dom-es.js';
13
+ import 'react-dom';
14
+ import '../../InternalBackdrop-es.js';
15
+ import '../../index.esm-es.js';
16
+ import 'react/jsx-runtime';
17
+ import '../../useLabelableId-es.js';
18
+ import '../../resolveAriaLabelledBy-es.js';
19
+ import '../../useCompositeListItem-es.js';
20
+ import '../../floating-ui.react-dom-es.js';
21
+ import '../../CSPContext-es.js';
22
+ import '../../ToolbarRootContext-es.js';
23
+ import '../../clamp-es.js';
@@ -0,0 +1,16 @@
1
+ import type React from "react";
2
+ import type { Select } from "../../unstyledPrimitives";
3
+ import type { OverlaySeparator } from "../OverlaySeparator";
4
+ export type SelectPrimitiveRootProps = React.ComponentPropsWithoutRef<typeof Select.Root>;
5
+ export type SelectPrimitiveTriggerProps = React.ComponentPropsWithoutRef<typeof Select.Trigger>;
6
+ export type SelectPrimitiveValueProps = React.ComponentPropsWithoutRef<typeof Select.Value>;
7
+ export type SelectPrimitivePortalProps = React.ComponentPropsWithoutRef<typeof Select.Portal>;
8
+ export type SelectPrimitivePositionerProps = React.ComponentPropsWithoutRef<typeof Select.Positioner>;
9
+ export type SelectPrimitivePopupProps = React.ComponentPropsWithoutRef<typeof Select.Popup>;
10
+ export type SelectPrimitiveListProps = React.ComponentPropsWithoutRef<typeof Select.List>;
11
+ export type SelectPrimitiveItemProps = React.ComponentPropsWithoutRef<typeof Select.Item>;
12
+ export type SelectPrimitiveItemTextProps = React.ComponentPropsWithoutRef<typeof Select.ItemText>;
13
+ export type SelectPrimitiveItemIndicatorProps = React.ComponentPropsWithoutRef<typeof Select.ItemIndicator>;
14
+ export type SelectPrimitiveGroupProps = React.ComponentPropsWithoutRef<typeof Select.Group>;
15
+ export type SelectPrimitiveGroupLabelProps = React.ComponentPropsWithoutRef<typeof Select.GroupLabel>;
16
+ export type SelectPrimitiveSeparatorProps = React.ComponentPropsWithoutRef<typeof OverlaySeparator>;
@@ -5,6 +5,7 @@ var BottomSheet = require('../BottomSheet-cjs.js');
5
5
  var HelperText = require('../HelperText-cjs.js');
6
6
  var ComboboxPrimitive = require('../ComboboxPrimitive-cjs.js');
7
7
  var InputNumberExperimental = require('../InputNumberExperimental-cjs.js');
8
+ var SelectPrimitive = require('../SelectPrimitive-cjs.js');
8
9
  require('../tslib.es6-cjs.js');
9
10
  require('react');
10
11
  require('classnames');
@@ -23,14 +24,19 @@ require('../floating-ui.utils.dom-cjs.js');
23
24
  require('../useButton-cjs.js');
24
25
  require('react-dom');
25
26
  require('react/jsx-runtime');
27
+ require('../CSPContext-cjs.js');
26
28
  require('../clamp-cjs.js');
27
29
  require('../Text-cjs.js');
28
30
  require('../ComboboxChipRemove-cjs.js');
29
- require('../useLabel-cjs.js');
31
+ require('../useLabelableId-cjs.js');
30
32
  require('../useCompositeListItem-cjs.js');
31
33
  require('../floating-ui.react-dom-cjs.js');
34
+ require('../resolveAriaLabelledBy-cjs.js');
35
+ require('../useLabel-cjs.js');
32
36
  require('../ActivityIndicator-cjs.js');
33
37
  require('../NumberFieldInput-cjs.js');
38
+ require('../SelectGroupLabel-cjs.js');
39
+ require('../ToolbarRootContext-cjs.js');
34
40
 
35
41
 
36
42
 
@@ -40,3 +46,4 @@ exports.BottomSheetScrollAreaContext = BottomSheet.BottomSheetScrollAreaContext;
40
46
  exports.HelperText = HelperText.HelperText;
41
47
  exports.ComboboxPrimitive = ComboboxPrimitive.ComboboxPrimitive;
42
48
  exports.InputNumberExperimental = InputNumberExperimental.InputNumberExperimental;
49
+ exports.SelectPrimitive = SelectPrimitive.SelectPrimitive;
@@ -11,3 +11,4 @@ export * from "./HelperText/index";
11
11
  export * from "./ComboboxPrimitive/index";
12
12
  export { InputNumberExperimental } from "./InputNumberExperimental";
13
13
  export type { InputNumberExperimentalAffix, InputNumberExperimentalProps, InputNumberExperimentalRef, } from "./InputNumberExperimental";
14
+ export * from "./SelectPrimitive";
@@ -3,6 +3,7 @@ export { a as BottomSheet, B as BottomSheetScrollAreaContext } from '../BottomSh
3
3
  export { H as HelperText } from '../HelperText-es.js';
4
4
  export { C as ComboboxPrimitive } from '../ComboboxPrimitive-es.js';
5
5
  export { I as InputNumberExperimental } from '../InputNumberExperimental-es.js';
6
+ export { S as SelectPrimitive } from '../SelectPrimitive-es.js';
6
7
  import '../tslib.es6-es.js';
7
8
  import 'react';
8
9
  import 'classnames';
@@ -21,11 +22,16 @@ import '../floating-ui.utils.dom-es.js';
21
22
  import '../useButton-es.js';
22
23
  import 'react-dom';
23
24
  import 'react/jsx-runtime';
25
+ import '../CSPContext-es.js';
24
26
  import '../clamp-es.js';
25
27
  import '../Text-es.js';
26
28
  import '../ComboboxChipRemove-es.js';
27
- import '../useLabel-es.js';
29
+ import '../useLabelableId-es.js';
28
30
  import '../useCompositeListItem-es.js';
29
31
  import '../floating-ui.react-dom-es.js';
32
+ import '../resolveAriaLabelledBy-es.js';
33
+ import '../useLabel-es.js';
30
34
  import '../ActivityIndicator-es.js';
31
35
  import '../NumberFieldInput-es.js';
36
+ import '../SelectGroupLabel-es.js';
37
+ import '../ToolbarRootContext-es.js';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Shared utility for styled BaseUI primitive wrappers.
3
+ *
4
+ * Merges an Atlantis base class with a consumer-supplied className that may be
5
+ * either a plain string or a BaseUI state-based function
6
+ * (e.g. `className={(state) => state.open ? "open" : ""}`).
7
+ *
8
+ * All styled primitives should import from here rather than defining their own
9
+ * copy, so the type is consistent across the package.
10
+ */
11
+ export type PrimitiveClassName<State = void> = string | ((state: State) => string | undefined) | undefined;
12
+ export declare function mergeClassName<State>(baseClassName: string, className: PrimitiveClassName<State>): PrimitiveClassName<State>;
@@ -0,0 +1,195 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+
6
+ function _interopNamespaceDefault(e) {
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
24
+
25
+ const defaultItemEquality = (itemValue, selectedValue) => Object.is(itemValue, selectedValue);
26
+ function compareItemEquality(itemValue, selectedValue, comparer) {
27
+ if (itemValue == null || selectedValue == null) {
28
+ return Object.is(itemValue, selectedValue);
29
+ }
30
+ return comparer(itemValue, selectedValue);
31
+ }
32
+ function selectedValueIncludes(selectedValues, itemValue, comparer) {
33
+ if (!selectedValues || selectedValues.length === 0) {
34
+ return false;
35
+ }
36
+ return selectedValues.some(selectedValue => {
37
+ if (selectedValue === undefined) {
38
+ return false;
39
+ }
40
+ return compareItemEquality(itemValue, selectedValue, comparer);
41
+ });
42
+ }
43
+ function findItemIndex(itemValues, selectedValue, comparer) {
44
+ if (!itemValues || itemValues.length === 0) {
45
+ return -1;
46
+ }
47
+ return itemValues.findIndex(itemValue => {
48
+ if (itemValue === undefined) {
49
+ return false;
50
+ }
51
+ return compareItemEquality(itemValue, selectedValue, comparer);
52
+ });
53
+ }
54
+ function removeItem(selectedValues, itemValue, comparer) {
55
+ return selectedValues.filter(selectedValue => !compareItemEquality(itemValue, selectedValue, comparer));
56
+ }
57
+
58
+ function serializeValue(value) {
59
+ if (value == null) {
60
+ return '';
61
+ }
62
+ if (typeof value === 'string') {
63
+ return value;
64
+ }
65
+ try {
66
+ return JSON.stringify(value);
67
+ } catch {
68
+ return String(value);
69
+ }
70
+ }
71
+
72
+ function isGroupedItems(items) {
73
+ return items != null && items.length > 0 && typeof items[0] === 'object' && items[0] != null && 'items' in items[0];
74
+ }
75
+
76
+ /**
77
+ * Checks if the items array contains an item with a null value that has a non-null label.
78
+ */
79
+ function hasNullItemLabel(items) {
80
+ if (!Array.isArray(items)) {
81
+ return items != null && 'null' in items;
82
+ }
83
+ const arrayItems = items;
84
+ if (isGroupedItems(arrayItems)) {
85
+ for (const group of arrayItems) {
86
+ for (const item of group.items) {
87
+ if (item && item.value == null && item.label != null) {
88
+ return true;
89
+ }
90
+ }
91
+ }
92
+ return false;
93
+ }
94
+ for (const item of arrayItems) {
95
+ if (item && item.value == null && item.label != null) {
96
+ return true;
97
+ }
98
+ }
99
+ return false;
100
+ }
101
+ function stringifyAsLabel(item, itemToStringLabel) {
102
+ if (itemToStringLabel && item != null) {
103
+ return itemToStringLabel(item) ?? '';
104
+ }
105
+ if (item && typeof item === 'object') {
106
+ if ('label' in item && item.label != null) {
107
+ return String(item.label);
108
+ }
109
+ if ('value' in item) {
110
+ return String(item.value);
111
+ }
112
+ }
113
+ return serializeValue(item);
114
+ }
115
+ function stringifyAsValue(item, itemToStringValue) {
116
+ if (itemToStringValue && item != null) {
117
+ return itemToStringValue(item) ?? '';
118
+ }
119
+ if (item && typeof item === 'object' && 'value' in item && 'label' in item) {
120
+ return serializeValue(item.value);
121
+ }
122
+ return serializeValue(item);
123
+ }
124
+ function resolveSelectedLabel(value, items, itemToStringLabel) {
125
+ function fallback() {
126
+ return stringifyAsLabel(value, itemToStringLabel);
127
+ }
128
+ if (itemToStringLabel && value != null) {
129
+ return itemToStringLabel(value);
130
+ }
131
+
132
+ // Custom object with explicit label takes precedence
133
+ if (value && typeof value === 'object' && 'label' in value && value.label != null) {
134
+ return value.label;
135
+ }
136
+
137
+ // Items provided as plain record map
138
+ if (items && !Array.isArray(items)) {
139
+ return items[value] ?? fallback();
140
+ }
141
+
142
+ // Items provided as array (flat or grouped)
143
+ if (Array.isArray(items)) {
144
+ const arrayItems = items;
145
+ const flatItems = isGroupedItems(arrayItems) ? arrayItems.flatMap(group => group.items) : arrayItems;
146
+ if (value == null || typeof value !== 'object') {
147
+ const match = flatItems.find(item => item.value === value);
148
+ if (match && match.label != null) {
149
+ return match.label;
150
+ }
151
+ return fallback();
152
+ }
153
+
154
+ // Object without explicit label: try matching by its `value` property
155
+ if ('value' in value) {
156
+ const match = flatItems.find(item => item && item.value === value.value);
157
+ if (match && match.label != null) {
158
+ return match.label;
159
+ }
160
+ }
161
+ }
162
+ return fallback();
163
+ }
164
+ function resolveMultipleLabels(values, items, itemToStringLabel) {
165
+ return values.reduce((acc, value, index) => {
166
+ if (index > 0) {
167
+ acc.push(', ');
168
+ }
169
+ acc.push(/*#__PURE__*/jsxRuntime.jsx(React__namespace.Fragment, {
170
+ children: resolveSelectedLabel(value, items, itemToStringLabel)
171
+ }, index));
172
+ return acc;
173
+ }, []);
174
+ }
175
+
176
+ function getDefaultLabelId(id) {
177
+ return id == null ? undefined : `${id}-label`;
178
+ }
179
+ function resolveAriaLabelledBy(fieldLabelId, localLabelId) {
180
+ return fieldLabelId ?? localLabelId;
181
+ }
182
+
183
+ exports.compareItemEquality = compareItemEquality;
184
+ exports.defaultItemEquality = defaultItemEquality;
185
+ exports.findItemIndex = findItemIndex;
186
+ exports.getDefaultLabelId = getDefaultLabelId;
187
+ exports.hasNullItemLabel = hasNullItemLabel;
188
+ exports.isGroupedItems = isGroupedItems;
189
+ exports.removeItem = removeItem;
190
+ exports.resolveAriaLabelledBy = resolveAriaLabelledBy;
191
+ exports.resolveMultipleLabels = resolveMultipleLabels;
192
+ exports.resolveSelectedLabel = resolveSelectedLabel;
193
+ exports.selectedValueIncludes = selectedValueIncludes;
194
+ exports.stringifyAsLabel = stringifyAsLabel;
195
+ exports.stringifyAsValue = stringifyAsValue;