@eightshift/ui-components 8.1.0 → 8.3.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 (170) hide show
  1. package/dist/{Autocomplete-BUU44AuW.js → Autocomplete-Dqkum3dO.js} +29 -25
  2. package/dist/{Button-_E2Z5G2l.js → Button-DHgs_rCq.js} +15 -9
  3. package/dist/{Dialog-3XLIaepk.js → Dialog-CldDJ_4u.js} +390 -189
  4. package/dist/{Disclosure-Dh0z_DEQ.js → Disclosure-BHNgL5Is.js} +33 -29
  5. package/dist/{FocusScope-BKGWN6UK.js → FocusScope-CUuL5wjz.js} +13 -8
  6. package/dist/{Heading-BWTs9ckA.js → Heading-BQje2nS2.js} +1 -1
  7. package/dist/{I18nProvider-BskRMK8G.js → I18nProvider-R_4IDnf9.js} +1 -1
  8. package/dist/{Label-UpU4cKPh.js → Label-C4bJkVti.js} +1 -1
  9. package/dist/{ListBox-DepY-52g.js → ListBox-CZXso3mJ.js} +14 -38
  10. package/dist/{NumberFormatter-WKBRKiEA.js → NumberFormatter-Bwdv413k.js} +4 -2
  11. package/dist/{RadioGroup-Br9Mn9QJ.js → RadioGroup-BTByPMrl.js} +35 -35
  12. package/dist/{SearchField-q2Fj0L9K.js → SearchField-DkX1vqMN.js} +29 -26
  13. package/dist/{Slider-B8icnyOo.js → Slider-Dw-JjfLx.js} +55 -44
  14. package/dist/{Text-D4y19vs8.js → Text-CA2_mHEB.js} +4 -3
  15. package/dist/{VisuallyHidden-B_LZ_kn7.js → VisuallyHidden-ZZwHZDro.js} +2 -2
  16. package/dist/{animation-DpSgtWyu.js → animation-COc9P6ap.js} +2 -4
  17. package/dist/assets/{image-analysis-worker-BuHru-CI.js → image-analysis-worker-CBOB71mx.js} +1 -1
  18. package/dist/assets/style-admin.css +1 -1
  19. package/dist/assets/style-editor.css +1 -1
  20. package/dist/assets/style.css +1 -1
  21. package/dist/assets/wp-overrides/make-block-messages-nicer.css +1 -1
  22. package/dist/{build-module-DG6ZK7Ty.js → build-module-BISCoQjQ.js} +4 -4
  23. package/dist/{button-XSk_8UW7.js → button-ldR_tlvk.js} +64 -13
  24. package/dist/{checkbox-BYaS9tQ5.js → checkbox-DDyLJRY8.js} +8 -8
  25. package/dist/{color-swatch-6ZEIXej3.js → color-swatch-DmhdOhe4.js} +15 -16
  26. package/dist/components/animated-visibility/animated-visibility.js +5 -3
  27. package/dist/components/base-control/base-control.d.ts +1 -1
  28. package/dist/components/base-control/base-control.js +1 -1
  29. package/dist/components/base-control/container.d.ts +4 -30
  30. package/dist/components/base-control/container.js +5 -32
  31. package/dist/components/breakpoint-preview/breakpoint-preview.js +1 -1
  32. package/dist/components/button/button.d.ts +1 -1
  33. package/dist/components/button/button.js +1 -1
  34. package/dist/components/checkbox/checkbox.js +1 -1
  35. package/dist/components/color-pickers/color-picker.js +8 -8
  36. package/dist/components/color-pickers/color-swatch.js +1 -1
  37. package/dist/components/color-pickers/gradient-editor.js +1 -1
  38. package/dist/components/color-pickers/solid-color-picker.js +1 -1
  39. package/dist/components/component-toggle/component-toggle.d.ts +1 -1
  40. package/dist/components/component-toggle/component-toggle.js +4 -4
  41. package/dist/components/container-panel/container-panel.js +11 -11
  42. package/dist/components/contextual-help/contextual-help.js +3 -3
  43. package/dist/components/draggable/draggable.d.ts +3 -3
  44. package/dist/components/draggable/draggable.js +1 -1
  45. package/dist/components/draggable-list/draggable-list.d.ts +3 -3
  46. package/dist/components/draggable-list/draggable-list.js +9 -9
  47. package/dist/components/expandable/expandable.js +4 -4
  48. package/dist/components/index.d.ts +1 -0
  49. package/dist/components/index.js +18 -17
  50. package/dist/components/input-field/input-field.d.ts +1 -1
  51. package/dist/components/input-field/input-field.js +1 -1
  52. package/dist/components/item-collection/item-collection.d.ts +3 -28
  53. package/dist/components/item-collection/item-collection.js +7 -7
  54. package/dist/components/link-input/link-input.d.ts +0 -2
  55. package/dist/components/link-input/link-input.js +1 -1
  56. package/dist/components/matrix-align/matrix-align.js +5 -4
  57. package/dist/components/menu/menu.d.ts +8 -29
  58. package/dist/components/menu/menu.js +11 -8
  59. package/dist/components/modal/modal.js +1 -1
  60. package/dist/components/notice/notice.js +8 -8
  61. package/dist/components/number-picker/number-picker.d.ts +1 -1
  62. package/dist/components/number-picker/number-picker.js +1 -1
  63. package/dist/components/option-select/option-select.d.ts +1 -1
  64. package/dist/components/option-select/option-select.js +22 -16
  65. package/dist/components/options-panel/options-panel.js +4 -4
  66. package/dist/components/placeholders/file-picker-shell.js +4 -3
  67. package/dist/components/placeholders/file-placeholder.js +3 -2
  68. package/dist/components/popover/popover.js +5 -5
  69. package/dist/components/portal-provider/portal-provider.js +2 -1
  70. package/dist/components/prompt-popover/prompt-popover.d.ts +56 -0
  71. package/dist/components/prompt-popover/prompt-popover.js +81 -0
  72. package/dist/components/radio/radio.d.ts +2 -1
  73. package/dist/components/radio/radio.js +2 -2
  74. package/dist/components/repeater/repeater-context.d.ts +0 -1
  75. package/dist/components/repeater/repeater-item.js +2 -2
  76. package/dist/components/repeater/repeater.d.ts +5 -38
  77. package/dist/components/repeater/repeater.js +8 -11
  78. package/dist/components/responsive/mini-responsive.d.ts +0 -1
  79. package/dist/components/responsive/mini-responsive.js +31 -31
  80. package/dist/components/responsive/responsive-legacy.d.ts +0 -1
  81. package/dist/components/responsive/responsive-legacy.js +13 -11
  82. package/dist/components/responsive/responsive.d.ts +0 -1
  83. package/dist/components/responsive/responsive.js +29 -29
  84. package/dist/components/responsive-preview/responsive-preview.js +4 -4
  85. package/dist/components/rich-label/rich-label.d.ts +1 -1
  86. package/dist/components/rich-label/rich-label.js +2 -2
  87. package/dist/components/select/async-multi-select.d.ts +12 -13
  88. package/dist/components/select/async-multi-select.js +40 -21
  89. package/dist/components/select/async-select.d.ts +12 -13
  90. package/dist/components/select/async-select.js +39 -21
  91. package/dist/components/select/multi-select.d.ts +2 -8
  92. package/dist/components/select/multi-select.js +20 -20
  93. package/dist/components/select/shared.d.ts +7 -11
  94. package/dist/components/select/shared.js +2 -2
  95. package/dist/components/select/single-select.d.ts +2 -8
  96. package/dist/components/select/single-select.js +17 -17
  97. package/dist/components/select/styles.d.ts +2 -2
  98. package/dist/components/slider/column-config-slider.js +8 -6
  99. package/dist/components/slider/slider.js +16 -12
  100. package/dist/components/slider/utils.js +1 -1
  101. package/dist/components/smart-image/smart-image.d.ts +1 -2
  102. package/dist/components/smart-image/smart-image.js +53 -51
  103. package/dist/components/tabs/tabs.d.ts +16 -64
  104. package/dist/components/tabs/tabs.js +1 -1
  105. package/dist/components/toggle/switch.d.ts +1 -1
  106. package/dist/components/toggle/switch.js +1 -1
  107. package/dist/components/toggle/toggle.js +2 -2
  108. package/dist/components/toggle-button/toggle-button.d.ts +2 -2
  109. package/dist/components/toggle-button/toggle-button.js +1 -1
  110. package/dist/components/tooltip/tooltip.js +1 -1
  111. package/dist/{draggable-9MfdTVWP.js → draggable-oS68xcYX.js} +130 -125
  112. package/dist/{es-dash-DunirOmV.js → es-dash-DPtJSRjw.js} +23 -52
  113. package/dist/{gradient-editor-yqSw0uPA.js → gradient-editor-DP8ioFX1.js} +39 -30
  114. package/dist/icons/block-icon.js +1 -1
  115. package/dist/icons/icon.d.ts +3 -3
  116. package/dist/icons/icon.js +21 -9
  117. package/dist/icons/icons.d.ts +210 -1
  118. package/dist/icons/index.js +1 -1
  119. package/dist/icons/jsx-svg.d.ts +5 -4
  120. package/dist/icons/jsx-svg.js +1 -1
  121. package/dist/index.js +18 -17
  122. package/dist/{input-field-nN6BO0oz.js → input-field-C-XvZeCZ.js} +8 -8
  123. package/dist/{jsx-svg-BjGQUBLh.js → jsx-svg-DRwJdRpA.js} +171 -129
  124. package/dist/{keyboard-g5Amam-c.js → keyboard-Cdqi5ZQQ.js} +1 -1
  125. package/dist/{link-input-BhlPElU8.js → link-input-DdwuqoMg.js} +147 -89
  126. package/dist/{modal-B5axB0Fc.js → modal-DZco5MDu.js} +15 -14
  127. package/dist/{number-picker-nnOf0XnN.js → number-picker-XqKW0BNi.js} +9 -9
  128. package/dist/{react-y40Dt3ab.js → react-O71mlJXS.js} +250 -266
  129. package/dist/{shared-Ba_bt4s9.js → shared-YXMIX2ka.js} +60 -44
  130. package/dist/{solid-color-picker-CsosgTVa.js → solid-color-picker-D5LEdmDM.js} +78 -58
  131. package/dist/{switch-BJ4_OyUm.js → switch-Bo6nmed_.js} +8 -8
  132. package/dist/{tabs-wAe0AAyu.js → tabs-DE-qb7Kt.js} +35 -30
  133. package/dist/{text-helpers-2j9DuxP1.js → text-helpers-QrwKKaOh.js} +3 -2
  134. package/dist/{textSelection-B_Nv6Jz3.js → textSelection-C17LWYmO.js} +3 -3
  135. package/dist/{toggle-button-BLJdEp8V.js → toggle-button-Cb4yCEua.js} +39 -8
  136. package/dist/{tooltip-BW9nj5-V.js → tooltip-CT-vzIdz.js} +68 -62
  137. package/dist/{useAsyncList-B3-uyJgA.js → useAsyncList-CjKVLGN0.js} +8 -4
  138. package/dist/{useButton-CPMVLXoX.js → useButton-V65TBDGM.js} +3 -3
  139. package/dist/{useCollection-PzY6FI39.js → useCollection-DqUS7tjk.js} +281 -184
  140. package/dist/useEvent-C9zwSNzZ.js +18 -0
  141. package/dist/{useField-DrfR8j9h.js → useField-B_ibsWst.js} +2 -2
  142. package/dist/{useFilter-CiCjo6Na.js → useFilter-C75IzdIZ.js} +1 -1
  143. package/dist/{useFocusRing-CrYHpV7C.js → useFocusRing-JidySWlU.js} +1 -1
  144. package/dist/{useFormReset-U6c35PHq.js → useFormReset-Sp8-miDa.js} +1 -1
  145. package/dist/{useFormValidation-B2q2MGWN.js → useFormValidation-CpmQEh8J.js} +2 -2
  146. package/dist/{useHover-CNsbAR0V.js → useHover-CaY3sRjL.js} +250 -46
  147. package/dist/{useLabel-DuxAjaic.js → useLabel-gfFDE4bn.js} +2 -2
  148. package/dist/{useLabels-NUsp5IW3.js → useLabels-Dcg-cEyM.js} +1 -1
  149. package/dist/{useListState-FLxa7R_U.js → useListState-CzB3v6M9.js} +6 -11
  150. package/dist/{useLocalizedStringFormatter-Ccm8EL_u.js → useLocalizedStringFormatter-CTCqjYu4.js} +6 -1
  151. package/dist/{useNumberFieldState-DWvm7CXu.js → useNumberFieldState-DC3XY3DQ.js} +79 -62
  152. package/dist/{useNumberFormatter-B0_D7a_o.js → useNumberFormatter-DbAt_fC_.js} +2 -2
  153. package/dist/{useOverlayTriggerState-zZ7homyI.js → useOverlayTriggerState-BKmSTK_5.js} +16 -11
  154. package/dist/{usePress-DRoujMNm.js → usePress-CUCWcP-m.js} +50 -28
  155. package/dist/{useSlot-pRz-v9kC.js → useSlot-CnQHcvd4.js} +1 -1
  156. package/dist/{useTextField-e8jIFT3s.js → useTextField-C3QIkMON.js} +6 -6
  157. package/dist/{useToggle-CR_ZKvr_.js → useToggle-bbGRUbo4.js} +6 -6
  158. package/dist/{useToggleState-ButQxGrJ.js → useToggleState-D_rLMrVW.js} +1 -1
  159. package/dist/utilities/array-helpers.d.ts +2 -2
  160. package/dist/utilities/array-helpers.js +4 -3
  161. package/dist/utilities/debounce-throttle.d.ts +9 -2
  162. package/dist/utilities/es-dash.d.ts +11 -8
  163. package/dist/utilities/es-dash.js +1 -1
  164. package/dist/utilities/index.js +2 -2
  165. package/dist/utilities/text-helpers.js +1 -1
  166. package/dist/utilities/web-workers.d.ts +7 -7
  167. package/dist/utilities/web-workers.js +5 -5
  168. package/dist/{utils-Czi6q2Ub.js → utils-ClM91CuL.js} +30 -19
  169. package/package.json +23 -27
  170. package/dist/useEvent-CzuFZ2HT.js +0 -22
@@ -1,12 +1,12 @@
1
1
  import { type ComponentProps, type ReactNode } from 'react';
2
2
  import { BaseControl } from '../base-control/base-control';
3
3
  import type { Prettify } from '../../utilities/types';
4
- type DraggableListRenderContext<TItem extends Record<string, unknown>> = TItem & {
4
+ type DraggableListRenderContext<TItem extends object> = TItem & {
5
5
  updateData: (newValue: Partial<TItem>) => void;
6
6
  itemIndex: number;
7
7
  deleteItem: () => void;
8
8
  };
9
- type DraggableListProps<TItem extends Record<string, unknown>> = ComponentProps<typeof BaseControl> & {
9
+ type DraggableListProps<TItem extends object> = ComponentProps<typeof BaseControl> & {
10
10
  children: (item: DraggableListRenderContext<TItem>) => ReactNode;
11
11
  /** Data to display in the list. */
12
12
  items?: TItem[] | null;
@@ -52,5 +52,5 @@ type DraggableListProps<TItem extends Record<string, unknown>> = ComponentProps<
52
52
  * }}
53
53
  * </DraggableList>
54
54
  */
55
- export declare const DraggableList: <TItem extends Record<string, unknown>>(props: Prettify<DraggableListProps<TItem>>) => import("react").JSX.Element | null;
55
+ export declare const DraggableList: <TItem extends object>(props: Prettify<DraggableListProps<TItem>>) => import("react").JSX.Element | null;
56
56
  export {};
@@ -1,13 +1,17 @@
1
1
  import { t as clsx } from "../../clsx-DQoRUQAf.js";
2
2
  import { BaseControl } from "../base-control/base-control.js";
3
- import { t as __ } from "../../build-module-DG6ZK7Ty.js";
4
- import { Container } from "../base-control/container.js";
3
+ import { t as __ } from "../../build-module-BISCoQjQ.js";
4
+ import { Container as TypedContainer$1 } from "../base-control/container.js";
5
5
  import { n as arrayMove, r as arrayRemove, t as List } from "../../List-BKcyZ8tT.js";
6
6
  import { useCallback, useMemo } from "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  //#region lib/components/draggable-list/draggable-list.tsx
9
9
  var TypedBaseControl = BaseControl;
10
- var TypedContainer = Container;
10
+ var TypedContainer = TypedContainer$1;
11
+ var mergeItem = (item, newValue) => ({
12
+ ...item,
13
+ ...newValue
14
+ });
11
15
  /**
12
16
  * A component that allows re-ordering a list of items.
13
17
  *
@@ -44,7 +48,7 @@ var TypedContainer = Container;
44
48
  var DraggableList = (props) => {
45
49
  const { children, items, onChange, icon, label, subtitle, help, actions, className, itemClassName, itemContainerClassName, onAfterItemRemove, hidden, ...rest } = props;
46
50
  const normalizedItems = useMemo(() => Array.isArray(items) ? items : [], [items]);
47
- if (typeof items === "undefined" || items === null || !Array.isArray(items)) console.warn(__("DraggableList: 'items' are not an array or are undefined!", "eightshift-ui-components"));
51
+ if (items === void 0 || items === null || !Array.isArray(items)) console.warn(__("DraggableList: 'items' are not an array or are undefined!", "eightshift-ui-components"));
48
52
  const handleListChange = useCallback(({ oldIndex, newIndex }) => onChange(newIndex === -1 ? arrayRemove(normalizedItems, oldIndex) : arrayMove(normalizedItems, oldIndex, newIndex)), [normalizedItems, onChange]);
49
53
  const renderList = useCallback(({ children: listChildren, props: listProps }) => {
50
54
  return jsx("ul", {
@@ -66,11 +70,7 @@ var DraggableList = (props) => {
66
70
  children: children({
67
71
  ...value,
68
72
  updateData: (newValue) => {
69
- const updated = [...normalizedItems];
70
- updated[index] = {
71
- ...updated[index],
72
- ...newValue
73
- };
73
+ const updated = normalizedItems.map((currentItem, itemIndex) => itemIndex === index ? mergeItem(currentItem, newValue) : currentItem);
74
74
  onChange(updated);
75
75
  },
76
76
  itemIndex: index,
@@ -1,10 +1,10 @@
1
1
  import { t as clsx } from "../../clsx-DQoRUQAf.js";
2
2
  import { AnimatedVisibility } from "../animated-visibility/animated-visibility.js";
3
- import { n as $43a3b93638fe5db9$export$b04be29aa201d4f5 } from "../../Label-UpU4cKPh.js";
4
- import { n as $a3e16eab0ea4036c$export$feabaa331e1d464c, t as $a3e16eab0ea4036c$export$74a362b31437ec83 } from "../../Disclosure-Dh0z_DEQ.js";
5
- import { t as Button } from "../../button-XSk_8UW7.js";
3
+ import { n as $43a3b93638fe5db9$export$b04be29aa201d4f5 } from "../../Label-C4bJkVti.js";
4
+ import { n as $a3e16eab0ea4036c$export$feabaa331e1d464c, t as $a3e16eab0ea4036c$export$74a362b31437ec83 } from "../../Disclosure-BHNgL5Is.js";
5
+ import { t as Button } from "../../button-ldR_tlvk.js";
6
6
  import { RichLabel } from "../rich-label/rich-label.js";
7
- import { t as __ } from "../../build-module-DG6ZK7Ty.js";
7
+ import { t as __ } from "../../build-module-BISCoQjQ.js";
8
8
  import { dropdownCaretAlt } from "../../icons/ui-icons/dropdown-caret-alt.js";
9
9
  import { useState } from "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -32,6 +32,7 @@ export { MiniResponsive } from './responsive/mini-responsive';
32
32
  export { Notice } from './notice/notice';
33
33
  export { NumberPicker } from './number-picker/number-picker';
34
34
  export { Popover, TriggeredPopover } from './popover/popover';
35
+ export { PromptPopover } from './prompt-popover/prompt-popover';
35
36
  export { PortalProvider } from './portal-provider/portal-provider';
36
37
  export { RadioButton, RadioButtonGroup } from './radio/radio';
37
38
  export { Repeater } from './repeater/repeater';
@@ -1,16 +1,16 @@
1
1
  import { AnimatedVisibility } from "./animated-visibility/animated-visibility.js";
2
- import { t as LinkInput } from "../link-input-BhlPElU8.js";
3
- import { t as Checkbox } from "../checkbox-BYaS9tQ5.js";
4
- import { t as SolidColorPicker } from "../solid-color-picker-CsosgTVa.js";
5
- import { t as ColorSwatch } from "../color-swatch-6ZEIXej3.js";
6
- import { i as Tabs, n as TabList, r as TabPanel, t as Tab } from "../tabs-wAe0AAyu.js";
7
- import { t as Modal } from "../modal-B5axB0Fc.js";
8
- import { t as NumberPicker } from "../number-picker-nnOf0XnN.js";
9
- import { t as Switch } from "../switch-BJ4_OyUm.js";
10
- import { t as InputField } from "../input-field-nN6BO0oz.js";
11
- import { t as ToggleButton } from "../toggle-button-BLJdEp8V.js";
12
- import { n as ButtonGroup, t as Button } from "../button-XSk_8UW7.js";
13
- import { n as Tooltip, t as DecorativeTooltip } from "../tooltip-BW9nj5-V.js";
2
+ import { t as LinkInput } from "../link-input-DdwuqoMg.js";
3
+ import { t as Checkbox } from "../checkbox-DDyLJRY8.js";
4
+ import { t as SolidColorPicker } from "../solid-color-picker-D5LEdmDM.js";
5
+ import { t as ColorSwatch } from "../color-swatch-DmhdOhe4.js";
6
+ import { i as Tabs, n as TabList, r as TabPanel, t as Tab } from "../tabs-DE-qb7Kt.js";
7
+ import { n as Tooltip, t as DecorativeTooltip } from "../tooltip-CT-vzIdz.js";
8
+ import { t as Modal } from "../modal-DZco5MDu.js";
9
+ import { t as NumberPicker } from "../number-picker-XqKW0BNi.js";
10
+ import { t as Switch } from "../switch-Bo6nmed_.js";
11
+ import { t as InputField } from "../input-field-C-XvZeCZ.js";
12
+ import { t as ToggleButton } from "../toggle-button-Cb4yCEua.js";
13
+ import { n as ButtonGroup, t as Button } from "../button-ldR_tlvk.js";
14
14
  import { RichLabel } from "./rich-label/rich-label.js";
15
15
  import { BaseControl } from "./base-control/base-control.js";
16
16
  import { BreakpointPreview } from "./breakpoint-preview/breakpoint-preview.js";
@@ -23,17 +23,17 @@ import { ContainerPanel } from "./container-panel/container-panel.js";
23
23
  import { Menu, MenuItem, MenuSection, MenuSectionHeader, MenuSeparator, SubMenuItem } from "./menu/menu.js";
24
24
  import { ColorPicker } from "./color-pickers/color-picker.js";
25
25
  import { ColumnConfigSlider, ColumnConfigSliderOutput } from "./slider/column-config-slider.js";
26
- import { Container, ContainerGroup } from "./base-control/container.js";
26
+ import { Container as TypedContainer, ContainerGroup as TypedContainerGroup } from "./base-control/container.js";
27
27
  import { ContextualHelp } from "./contextual-help/contextual-help.js";
28
28
  import { DraggableList } from "./draggable-list/draggable-list.js";
29
29
  import { DraggableListItem, DraggableListItemHandle } from "./draggable-list/draggable-list-item.js";
30
30
  import { DraggableContext } from "./draggable/draggable-context.js";
31
- import { t as Draggable } from "../draggable-9MfdTVWP.js";
31
+ import { t as Draggable } from "../draggable-oS68xcYX.js";
32
32
  import { DraggableHandle } from "./draggable/draggable-handle.js";
33
33
  import { SmartImage } from "./smart-image/smart-image.js";
34
34
  import { FilePickerShell } from "./placeholders/file-picker-shell.js";
35
35
  import { FilePlaceholder } from "./placeholders/file-placeholder.js";
36
- import { t as GradientEditor } from "../gradient-editor-yqSw0uPA.js";
36
+ import { t as GradientEditor } from "../gradient-editor-DP8ioFX1.js";
37
37
  import { MatrixAlign } from "./matrix-align/matrix-align.js";
38
38
  import { RadioButton, RadioButtonGroup } from "./radio/radio.js";
39
39
  import { OptionSelect } from "./option-select/option-select.js";
@@ -45,6 +45,8 @@ import { MediaPlaceholder } from "./placeholders/media-placeholder.js";
45
45
  import { ResponsivePreview } from "./responsive-preview/responsive-preview.js";
46
46
  import { MiniResponsive } from "./responsive/mini-responsive.js";
47
47
  import { Notice } from "./notice/notice.js";
48
+ import { VStack } from "./layout/vstack.js";
49
+ import { PromptPopover } from "./prompt-popover/prompt-popover.js";
48
50
  import { PortalProvider } from "./portal-provider/portal-provider.js";
49
51
  import { Repeater } from "./repeater/repeater.js";
50
52
  import { RepeaterItem } from "./repeater/repeater-item.js";
@@ -55,5 +57,4 @@ import { AsyncSelect } from "./select/async-select.js";
55
57
  import { MultiSelect } from "./select/multi-select.js";
56
58
  import { OptionsPanel, OptionsPanelHeader, OptionsPanelIntro, OptionsPanelSection } from "./options-panel/options-panel.js";
57
59
  import { Select } from "./select/single-select.js";
58
- import { VStack } from "./layout/vstack.js";
59
- export { AnimatedVisibility, AsyncMultiSelect, AsyncSelect, BaseControl, BreakpointPreview, Button, ButtonGroup, Checkbox, ColorPicker, ColorSwatch, ColumnConfigSlider, ColumnConfigSliderOutput, ComponentToggle, Container, ContainerGroup, ContainerPanel, ContextualHelp, DecorativeTooltip, Draggable, DraggableContext, DraggableHandle, DraggableList, DraggableListItem, DraggableListItemHandle, Expandable, FilePickerShell, FilePlaceholder, GradientEditor, HStack, ImagePlaceholder, InputField, ItemCollection, LinkInput, MatrixAlign, MediaPlaceholder, Menu, MenuItem, MenuSection, MenuSectionHeader, MenuSeparator, MiniResponsive, Modal, MultiSelect, Notice, NumberPicker, OptionSelect, OptionsPanel, OptionsPanelHeader, OptionsPanelIntro, OptionsPanelSection, Popover, PortalProvider, RadioButton, RadioButtonGroup, Repeater, RepeaterItem, Responsive, ResponsiveLegacy, ResponsivePreview, RichLabel, Select, Slider, SmartImage, SolidColorPicker, Spacer, SubMenuItem, Switch, Tab, TabList, TabPanel, Tabs, Toggle, ToggleButton, Tooltip, TriggeredPopover, VStack };
60
+ export { AnimatedVisibility, AsyncMultiSelect, AsyncSelect, BaseControl, BreakpointPreview, Button, ButtonGroup, Checkbox, ColorPicker, ColorSwatch, ColumnConfigSlider, ColumnConfigSliderOutput, ComponentToggle, TypedContainer as Container, TypedContainerGroup as ContainerGroup, ContainerPanel, ContextualHelp, DecorativeTooltip, Draggable, DraggableContext, DraggableHandle, DraggableList, DraggableListItem, DraggableListItemHandle, Expandable, FilePickerShell, FilePlaceholder, GradientEditor, HStack, ImagePlaceholder, InputField, ItemCollection, LinkInput, MatrixAlign, MediaPlaceholder, Menu, MenuItem, MenuSection, MenuSectionHeader, MenuSeparator, MiniResponsive, Modal, MultiSelect, Notice, NumberPicker, OptionSelect, OptionsPanel, OptionsPanelHeader, OptionsPanelIntro, OptionsPanelSection, Popover, PortalProvider, PromptPopover, RadioButton, RadioButtonGroup, Repeater, RepeaterItem, Responsive, ResponsiveLegacy, ResponsivePreview, RichLabel, Select, Slider, SmartImage, SolidColorPicker, Spacer, SubMenuItem, Switch, Tab, TabList, TabPanel, Tabs, Toggle, ToggleButton, Tooltip, TriggeredPopover, VStack };
@@ -4,7 +4,7 @@ import { Input as ReactAriaInput, TextArea, TextField } from 'react-aria-compone
4
4
  import { type BaseControlProps } from '../base-control/base-control';
5
5
  import type { Prettify } from '../../utilities/types';
6
6
  declare const inputClass: (props?: ({
7
- size?: "small" | "default" | "large" | "medium" | null | undefined;
7
+ size?: "default" | "large" | "medium" | "small" | null | undefined;
8
8
  mono?: boolean | null | undefined;
9
9
  multiline?: boolean | null | undefined;
10
10
  disabled?: boolean | null | undefined;
@@ -1,2 +1,2 @@
1
- import { t as InputField } from "../../input-field-nN6BO0oz.js";
1
+ import { t as InputField } from "../../input-field-C-XvZeCZ.js";
2
2
  export { InputField };
@@ -1,11 +1,11 @@
1
1
  import { type ReactNode } from 'react';
2
2
  import type { Prettify } from '../../utilities/types';
3
- type ItemCollectionRenderContext<TItem extends Record<string, unknown>> = TItem & {
3
+ type ItemCollectionRenderContext<TItem extends object> = TItem & {
4
4
  updateData: (newValue: Partial<TItem>) => void;
5
5
  itemIndex: number;
6
6
  deleteItem: () => void;
7
7
  };
8
- type ItemCollectionProps<TItem extends Record<string, unknown>> = {
8
+ type ItemCollectionProps<TItem extends object> = {
9
9
  children: (item: ItemCollectionRenderContext<TItem>) => ReactNode;
10
10
  /** Items to show. */
11
11
  items?: TItem[] | null;
@@ -13,30 +13,5 @@ type ItemCollectionProps<TItem extends Record<string, unknown>> = {
13
13
  /** If `true`, the component is not rendered. */
14
14
  hidden?: boolean;
15
15
  };
16
- /**
17
- * A simple component to manage a collection of items.
18
- *
19
- * @component
20
- * @param {ItemCollectionProps} props - Component props.
21
- *
22
- * @returns {JSX.Element} The ItemCollection component.
23
- *
24
- * @example
25
- * <ItemCollection
26
- * items={items}
27
- * onChange={setItems}
28
- * >
29
- * {({ title, updateData, deleteItem }) => (
30
- * <div>
31
- * <InputField
32
- * label={__('Title', 'demo')}
33
- * value={title}
34
- * onChange={(nextTitle) => updateData({ title: nextTitle })}
35
- * />
36
- * <Button onPress={deleteItem}>Remove</Button>
37
- * </div>
38
- * )}
39
- * </ItemCollection>
40
- */
41
- export declare const ItemCollection: <TItem extends Record<string, unknown>>(props: Prettify<ItemCollectionProps<TItem>>) => import("react").JSX.Element[] | null;
16
+ export declare const ItemCollection: <TItem extends object>(props: Prettify<ItemCollectionProps<TItem>>) => import("react").JSX.Element[] | null;
42
17
  export {};
@@ -1,4 +1,4 @@
1
- import { t as __ } from "../../build-module-DG6ZK7Ty.js";
1
+ import { t as __ } from "../../build-module-BISCoQjQ.js";
2
2
  import { Fragment } from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  //#region lib/components/item-collection/item-collection.tsx
@@ -27,19 +27,19 @@ import { jsx } from "react/jsx-runtime";
27
27
  * )}
28
28
  * </ItemCollection>
29
29
  */
30
+ var mergeItem = (item, newValue) => ({
31
+ ...item,
32
+ ...newValue
33
+ });
30
34
  var ItemCollection = (props) => {
31
35
  const { children, items: rawItems, onChange, hidden } = props;
32
36
  if (hidden) return null;
33
- if (typeof rawItems === "undefined" || rawItems === null || !Array.isArray(rawItems)) console.warn(__("ItemCollection: 'items' are not an array or are undefined!", "eightshift-ui-components"));
37
+ if (rawItems === void 0 || rawItems === null || !Array.isArray(rawItems)) console.warn(__("ItemCollection: 'items' are not an array or are undefined!", "eightshift-ui-components"));
34
38
  const items = rawItems ?? [];
35
39
  return items.map((item, index) => jsx(Fragment, { children: children({
36
40
  ...item,
37
41
  updateData: (newValue) => {
38
- const updated = [...items];
39
- updated[index] = {
40
- ...updated[index],
41
- ...newValue
42
- };
42
+ const updated = items.map((currentItem, itemIndex) => itemIndex === index ? mergeItem(currentItem, newValue) : currentItem);
43
43
  onChange(updated);
44
44
  },
45
45
  itemIndex: index,
@@ -10,9 +10,7 @@ type LinkSuggestionItem = {
10
10
  value: string;
11
11
  metadata?: {
12
12
  subtype?: string | null;
13
- [key: string]: unknown;
14
13
  };
15
- [key: string]: unknown;
16
14
  };
17
15
  type LinkInputProps = {
18
16
  /** The current URL. Defaults to `''`. */
@@ -1,2 +1,2 @@
1
- import { t as LinkInput } from "../../link-input-BhlPElU8.js";
1
+ import { t as LinkInput } from "../../link-input-DdwuqoMg.js";
2
2
  export { LinkInput };
@@ -1,14 +1,15 @@
1
1
  import { t as clsx } from "../../clsx-DQoRUQAf.js";
2
- import { n as $fe21c36db05242bb$export$d7b12c4107be0d61, t as $fe21c36db05242bb$export$a98f0dcb43a68a25 } from "../../RadioGroup-Br9Mn9QJ.js";
2
+ import { n as $fe21c36db05242bb$export$d7b12c4107be0d61, t as $fe21c36db05242bb$export$a98f0dcb43a68a25 } from "../../RadioGroup-BTByPMrl.js";
3
3
  import { RichLabel } from "../rich-label/rich-label.js";
4
4
  import { BaseControl } from "../base-control/base-control.js";
5
- import { f as upperFirst, t as camelCase } from "../../es-dash-DunirOmV.js";
6
- import { t as __ } from "../../build-module-DG6ZK7Ty.js";
5
+ import { f as upperFirst, t as camelCase } from "../../es-dash-DPtJSRjw.js";
6
+ import { t as __ } from "../../build-module-BISCoQjQ.js";
7
7
  import { Icon } from "../../icons/icon.js";
8
8
  import { TriggeredPopover } from "../popover/popover.js";
9
9
  import "react";
10
10
  import { jsx, jsxs } from "react/jsx-runtime";
11
11
  //#region lib/components/matrix-align/matrix-align.tsx
12
+ var isStringValue = (value) => Object.prototype.toString.call(value) === "[object String]";
12
13
  var allSizeOptions = [
13
14
  {
14
15
  value: "top left",
@@ -99,7 +100,7 @@ var MatrixAlign = (props) => {
99
100
  children: [jsx("div", {
100
101
  className: "es:bg-accent-50/60 es:inset-ring es:inset-ring-accent-800/3 es:rounded-t-xl es:rounded-b-md",
101
102
  children: jsx($fe21c36db05242bb$export$a98f0dcb43a68a25, {
102
- "aria-label": typeof tooltip === "string" ? tooltip : __("Position", "eightshift-ui-components"),
103
+ "aria-label": isStringValue(tooltip) ? tooltip : __("Position", "eightshift-ui-components"),
103
104
  value,
104
105
  onChange,
105
106
  orientation: "horizontal",
@@ -159,33 +159,12 @@ export declare const MenuSeparator: ({ className }: Prettify<MenuSeparatorProps>
159
159
  * @see {@link Menu} for usage example.
160
160
  */
161
161
  export declare const MenuItem: (props: Prettify<MenuItemProps>) => import("react").JSX.Element | null;
162
- /**
163
- * A supplementary menu item that triggers a submenu.
164
- *
165
- * @component
166
- * @param {SubMenuItemProps} props - Component props.
167
- *
168
- * @returns {JSX.Element} The SubMenuItem component.
169
- *
170
- * @see {@link Menu} for usage example.
171
- */
172
- export declare const SubMenuItem: {
173
- (props: Prettify<SubMenuItemProps>): import("react").JSX.Element;
174
- displayName: string;
175
- };
176
- /**
177
- * A decorative menu section header, used to label groups of menu items.
178
- *
179
- * @component
180
- * @param {MenuSectionHeaderProps} props - Component props.
181
- *
182
- * @returns {JSX.Element} The MenuSectionHeader component.
183
- *
184
- * @example
185
- * <MenuSectionHeader>Section</MenuSectionHeader>
186
- */
187
- export declare const MenuSectionHeader: {
188
- (props: Prettify<MenuSectionHeaderProps>): import("react").JSX.Element | null;
189
- displayName: string;
190
- };
162
+ export declare function SubMenuItem(props: Prettify<SubMenuItemProps>): import("react").JSX.Element;
163
+ export declare namespace SubMenuItem {
164
+ var displayName: string;
165
+ }
166
+ export declare function MenuSectionHeader(props: Prettify<MenuSectionHeaderProps>): import("react").JSX.Element | null;
167
+ export declare namespace MenuSectionHeader {
168
+ var displayName: string;
169
+ }
191
170
  export {};
@@ -1,8 +1,8 @@
1
1
  import { t as clsx } from "../../clsx-DQoRUQAf.js";
2
- import { S as $e28ab3efe3e87743$export$1ff3c3f08ae963c0, a as $49319ee1285aa241$export$2ce376c2cc3355c8, c as $49319ee1285aa241$export$ecabc99eeffab7ca, i as $49319ee1285aa241$export$27d2ad3c5815583e, o as $49319ee1285aa241$export$4b1545b4f2016d26, s as $49319ee1285aa241$export$d9b273488cd8ce6f } from "../../Dialog-3XLIaepk.js";
3
- import { t as Button } from "../../button-XSk_8UW7.js";
2
+ import { C as $e28ab3efe3e87743$export$1ff3c3f08ae963c0, a as $49319ee1285aa241$export$2ce376c2cc3355c8, c as $49319ee1285aa241$export$ecabc99eeffab7ca, i as $49319ee1285aa241$export$27d2ad3c5815583e, o as $49319ee1285aa241$export$4b1545b4f2016d26, s as $49319ee1285aa241$export$d9b273488cd8ce6f } from "../../Dialog-CldDJ_4u.js";
3
+ import { t as Button } from "../../button-ldR_tlvk.js";
4
4
  import { RichLabel } from "../rich-label/rich-label.js";
5
- import { t as __ } from "../../build-module-DG6ZK7Ty.js";
5
+ import { t as __ } from "../../build-module-BISCoQjQ.js";
6
6
  import { dummySpacer } from "../../icons/ui-icons/dummy-spacer.js";
7
7
  import { chevronRight } from "../../icons/ui-icons/chevron-right.js";
8
8
  import { hamburgerMenu } from "../../icons/ui-icons/hamburger-menu.js";
@@ -12,10 +12,13 @@ import { Popover } from "../popover/popover.js";
12
12
  import { Children, Fragment, cloneElement, isValidElement } from "react";
13
13
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
14
14
  //#region lib/components/menu/menu.tsx
15
+ var isStringValue = (value) => Object.prototype.toString.call(value) === "[object String]";
16
+ var isSymbolValue = (value) => Object.prototype.toString.call(value) === "[object Symbol]";
17
+ var emptyMenuItems = [];
15
18
  var isSubMenuItem = (child) => {
16
19
  if (!isValidElement(child)) return false;
17
20
  if (child.type === Fragment) return Children.toArray(child.props.children).some(isSubMenuItem);
18
- if (typeof child.type === "string" || typeof child.type === "symbol") return false;
21
+ if (isStringValue(child.type) || isSymbolValue(child.type)) return false;
19
22
  return child.type === SubMenuItem || "displayName" in child.type && child.type.displayName === "SubMenuItem";
20
23
  };
21
24
  /**
@@ -58,14 +61,14 @@ var isSubMenuItem = (child) => {
58
61
  * </Menu>
59
62
  */
60
63
  var Menu = (props) => {
61
- const { children, triggerLabel, triggerIcon = !triggerLabel ? hamburgerMenu : void 0, triggerProps, popoverProps, tooltip, keepOpen = false, "aria-label": ariaLabel = typeof triggerLabel === "string" ? triggerLabel : __("Menu", "eightshift-ui-components"), openOnLongPress = false, disabled, manualWidth, hidden, ...other } = props;
64
+ const { children, triggerLabel, triggerIcon = !triggerLabel ? hamburgerMenu : void 0, triggerProps, popoverProps, tooltip, keepOpen = false, "aria-label": ariaLabel = isStringValue(triggerLabel) ? triggerLabel : __("Menu", "eightshift-ui-components"), openOnLongPress = false, disabled, manualWidth, hidden, ...other } = props;
62
65
  if (hidden) return null;
63
66
  const triggerBehavior = openOnLongPress ? { trigger: "longPress" } : void 0;
64
67
  const keepOpenProps = keepOpen ? {
65
68
  selectionMode: "multiple",
66
69
  selectedKeys: new Set(),
67
70
  onSelectionChange: () => {},
68
- items: []
71
+ items: emptyMenuItems
69
72
  } : void 0;
70
73
  const hasSubmenuItems = Children.toArray(children).some(isSubMenuItem);
71
74
  const { className: popoverClassName, wrapperClassName: popoverWrapperClassName, popoverProps: nestedPopoverProps, ...otherPopoverProps } = popoverProps ?? {};
@@ -143,7 +146,7 @@ var MenuSeparator = ({ className }) => {
143
146
  * @see {@link Menu} for usage example.
144
147
  */
145
148
  var MenuItem = (props) => {
146
- const { icon, children, subtitle, checked, selected, disabled, endIcon, onClick, onClickNative = (event) => event.stopPropagation(), shortcut, danger, primary, className, "aria-label": ariaLabel = typeof children === "string" ? children : __("Menu item", "eightshift-ui-components"), hidden, ...other } = props;
149
+ const { icon, children, subtitle, checked, selected, disabled, endIcon, onClick, onClickNative = (event) => event.stopPropagation(), shortcut, danger, primary, className, "aria-label": ariaLabel = isStringValue(children) ? children : __("Menu item", "eightshift-ui-components"), hidden, ...other } = props;
147
150
  if (hidden) return null;
148
151
  let itemIcon = icon;
149
152
  if (checked === true) itemIcon = menuItemCheck;
@@ -191,7 +194,7 @@ var SubMenuItem = (props) => {
191
194
  selectionMode: "multiple",
192
195
  selectedKeys: new Set(),
193
196
  onSelectionChange: () => {},
194
- items: []
197
+ items: emptyMenuItems
195
198
  } : void 0;
196
199
  return jsxs($49319ee1285aa241$export$ecabc99eeffab7ca, { children: [cloneElement(trigger, { endIcon: jsx("span", {
197
200
  className: "es:text-surface-500 es:contrast-more:text-current es:icon:size-3! es:icon:stroke-2!",
@@ -1,2 +1,2 @@
1
- import { t as Modal } from "../../modal-B5axB0Fc.js";
1
+ import { t as Modal } from "../../modal-DZco5MDu.js";
2
2
  export { Modal };
@@ -21,7 +21,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
21
21
  var Notice = (props) => {
22
22
  const { icon, label, subtitle, className, type = "default", alignIconToTitle = false, flat, hidden } = props;
23
23
  if (hidden) return null;
24
- const styles = {
24
+ const currentStyle = {
25
25
  info: {
26
26
  icon: info,
27
27
  className: "es:inset-ring-blue-600/15 es:shadow-blue-800/5 es:from-blue-400/2 es:to-blue-600/5 es:inset-shadow-blue-500/10",
@@ -69,20 +69,20 @@ var Notice = (props) => {
69
69
  subtitleColorClassName: "es:text-surface-800/50",
70
70
  selectionClassName: "es:selection:bg-accent-100 es:selection:text-accent-700"
71
71
  }
72
- };
72
+ }[type];
73
73
  return jsxs("div", {
74
- className: clsx("es:grid es:grid-cols-[auto_1fr] es:grid-rows-[auto_auto]", "es:rounded-xl", "es:bg-white", "es:inset-ring", "es:bg-linear-to-b es:from-35%", "es:inset-shadow-sm", flat ? "es:shadow-2xs" : "es:shadow-sm", styles[type].className, "es:icon:shrink-0", "es:selection:p-2", styles[type].selectionClassName, icon || styles[type].icon ? "es:gap-x-2 es:py-3 es:pl-2.5 es:pr-3" : "es:py-3 es:px-3.5", className),
74
+ className: clsx("es:grid es:grid-cols-[auto_1fr] es:grid-rows-[auto_auto]", "es:rounded-xl", "es:bg-white", "es:inset-ring", "es:bg-linear-to-b es:from-35%", "es:inset-shadow-sm", flat ? "es:shadow-2xs" : "es:shadow-sm", currentStyle.className, "es:icon:shrink-0", "es:selection:p-2", currentStyle.selectionClassName, icon || currentStyle.icon ? "es:gap-x-2 es:py-3 es:pl-2.5 es:pr-3" : "es:py-3 es:px-3.5", className),
75
75
  children: [
76
- (icon || styles[type].icon) && jsx("div", {
77
- className: clsx("es:col-span-1 es:col-start-1 es:row-span-2 es:row-start-1 es:shrink-0 es:icon:size-6", alignIconToTitle ? "es:self-baseline" : "es:self-center-safe", styles[type].iconColorClassName),
78
- children: icon ?? styles[type].icon
76
+ (icon || currentStyle.icon) && jsx("div", {
77
+ className: clsx("es:col-span-1 es:col-start-1 es:row-span-2 es:row-start-1 es:shrink-0 es:icon:size-6", alignIconToTitle ? "es:self-baseline" : "es:self-center-safe", currentStyle.iconColorClassName),
78
+ children: icon ?? currentStyle.icon
79
79
  }),
80
80
  label && jsx("span", {
81
- className: clsx("es:col-span-2 es:col-start-2 es:text-balance es:text-14", subtitle ? "es:self-end" : "es:row-span-2 es:self-center-safe", "es:font-variation-[\"wdth\"_78,\"wght\"_325,\"ROND\"_100]", styles[type].textColorClassName),
81
+ className: clsx("es:col-span-2 es:col-start-2 es:text-balance es:text-14", subtitle ? "es:self-end" : "es:row-span-2 es:self-center-safe", "es:font-variation-[\"wdth\"_78,\"wght\"_325,\"ROND\"_100]", currentStyle.textColorClassName),
82
82
  children: label
83
83
  }),
84
84
  subtitle && jsx("span", {
85
- className: clsx("es:col-span-2 es:col-start-2 es:text-balance es:text-xs es:leading-tighter es:pt-0.75", "es:font-variation-[\"wdth\"_90,\"wght\"_350,\"slnt\"_-1]", styles[type].subtitleColorClassName, label ? "es:self-start" : "es:row-span-2 es:self-center-safe"),
85
+ className: clsx("es:col-span-2 es:col-start-2 es:text-balance es:text-xs es:leading-tighter es:pt-0.75", "es:font-variation-[\"wdth\"_90,\"wght\"_350,\"slnt\"_-1]", currentStyle.subtitleColorClassName, label ? "es:self-start" : "es:row-span-2 es:self-center-safe"),
86
86
  children: subtitle
87
87
  })
88
88
  ]
@@ -4,7 +4,7 @@ import { NumberField } from 'react-aria-components';
4
4
  import { type BaseControlProps } from '../base-control/base-control';
5
5
  import type { Prettify } from '../../utilities/types';
6
6
  declare const inputClass: (props?: ({
7
- size?: "small" | "default" | "large" | "medium" | null | undefined;
7
+ size?: "default" | "large" | "medium" | "small" | null | undefined;
8
8
  disabled?: boolean | null | undefined;
9
9
  flat?: boolean | null | undefined;
10
10
  readOnly?: boolean | null | undefined;
@@ -1,2 +1,2 @@
1
- import { t as NumberPicker } from "../../number-picker-nnOf0XnN.js";
1
+ import { t as NumberPicker } from "../../number-picker-XqKW0BNi.js";
2
2
  export { NumberPicker };
@@ -6,7 +6,7 @@ import { RadioButton, RadioButtonGroup } from '../radio/radio';
6
6
  import { ToggleButton } from '../toggle-button/toggle-button';
7
7
  import type { Prettify } from '../../utilities/types';
8
8
  type OptionSelectType = 'toggleButtons' | 'toggleButtonsSplit' | 'radios' | 'radiosSegmented' | 'menu' | 'submenu' | 'standaloneMenuItems';
9
- type OptionValue = string | number | boolean;
9
+ type OptionValue = string | number | boolean | null | undefined;
10
10
  type IconValue = string | JSX.Element | null;
11
11
  type OptionSeparator = boolean | 'above' | 'below';
12
12
  type OptionItem = {
@@ -1,15 +1,21 @@
1
- import { t as ToggleButton } from "../../toggle-button-BLJdEp8V.js";
2
- import { n as ButtonGroup } from "../../button-XSk_8UW7.js";
1
+ import { t as ToggleButton } from "../../toggle-button-Cb4yCEua.js";
2
+ import { n as ButtonGroup } from "../../button-ldR_tlvk.js";
3
3
  import { RichLabel } from "../rich-label/rich-label.js";
4
4
  import { BaseControl } from "../base-control/base-control.js";
5
- import { t as __ } from "../../build-module-DG6ZK7Ty.js";
5
+ import { t as __ } from "../../build-module-BISCoQjQ.js";
6
6
  import { Icon } from "../../icons/icon.js";
7
7
  import { Menu, MenuItem, MenuSeparator, SubMenuItem } from "../menu/menu.js";
8
8
  import { RadioButton, RadioButtonGroup } from "../radio/radio.js";
9
9
  import { Fragment } from "react";
10
10
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
11
  //#region lib/components/option-select/option-select.tsx
12
- var getOptionKey = (value) => `${typeof value}:${String(value)}`;
12
+ var isStringValue = (value) => Object.prototype.toString.call(value) === "[object String]";
13
+ var isBooleanValue = (value) => Object.prototype.toString.call(value) === "[object Boolean]";
14
+ var getOptionKey = (value) => {
15
+ if (value === null) return "null";
16
+ if (value === void 0) return "undefined";
17
+ return JSON.stringify([value]);
18
+ };
13
19
  var renderOptionIcon = (icon) => icon ? jsx(Icon, { icon }) : null;
14
20
  /**
15
21
  * A component that allows the user to select an option from a list of options.
@@ -60,9 +66,9 @@ var OptionSelect = (props) => {
60
66
  });
61
67
  };
62
68
  const getToggleTooltip = (optionTooltip, optionAriaLabel, optionLabel) => {
63
- if (typeof optionTooltip === "string" || typeof optionTooltip === "boolean") return optionTooltip;
69
+ if (isStringValue(optionTooltip) || isBooleanValue(optionTooltip)) return optionTooltip;
64
70
  if (optionAriaLabel) return optionAriaLabel;
65
- if (noItemLabel && typeof optionLabel === "string") return optionLabel;
71
+ if (noItemLabel && isStringValue(optionLabel)) return optionLabel;
66
72
  };
67
73
  const renderMenuOptions = () => options.map(({ label: optionLabel, value: optionValue, icon: optionIcon, endIcon: optionEndIcon, ariaLabel: optionAriaLabel, subtitle: optionSubtitle, separator: optionHasSeparator, sectionTitle: optionSectionTitle, sectionIcon: optionSectionIcon, sectionSubtitle: optionSectionSubtitle, sectionEndIcon: optionSectionEndIcon, shortcut: optionShortcut, disabled: optionDisabled }) => jsxs(Fragment, { children: [
68
74
  optionHasSeparator === true || optionHasSeparator === "above" ? jsx(MenuSeparator, {}) : null,
@@ -79,7 +85,7 @@ var OptionSelect = (props) => {
79
85
  className: itemClassName,
80
86
  icon: !noItemIcon ? renderOptionIcon(optionIcon) : null,
81
87
  endIcon: !noItemIcon ? renderOptionIcon(optionEndIcon) : null,
82
- "aria-label": optionAriaLabel ?? (typeof optionLabel === "string" ? optionLabel : void 0),
88
+ "aria-label": optionAriaLabel ?? (isStringValue(optionLabel) ? optionLabel : void 0),
83
89
  onClick: () => onChange(optionValue),
84
90
  shortcut: optionShortcut,
85
91
  ...itemProps,
@@ -112,7 +118,7 @@ var OptionSelect = (props) => {
112
118
  children: [
113
119
  ["toggleButtons", "toggleButtonsSplit"].includes(type) ? jsx(ButtonGroup, {
114
120
  vertical,
115
- "aria-label": typeof label !== "undefined" ? void 0 : ariaLabel,
121
+ "aria-label": label !== void 0 ? void 0 : ariaLabel,
116
122
  type: type === "toggleButtonsSplit" ? "split" : "segmented",
117
123
  ...wrapperProps,
118
124
  children: options.map(({ label: optionLabel, value: optionValue, icon: optionIcon, tooltip: optionTooltip, ariaLabel: optionAriaLabel, subtitle: optionSubtitle, disabled: optionDisabled }) => jsx(ToggleButton, {
@@ -122,7 +128,7 @@ var OptionSelect = (props) => {
122
128
  className: itemClassName,
123
129
  icon: !noItemIcon ? renderOptionIcon(optionIcon) : null,
124
130
  tooltip: getToggleTooltip(optionTooltip, optionAriaLabel, optionLabel),
125
- "aria-label": optionAriaLabel ?? (typeof optionLabel === "string" ? optionLabel : void 0),
131
+ "aria-label": optionAriaLabel ?? (isStringValue(optionLabel) ? optionLabel : void 0),
126
132
  ...itemProps,
127
133
  children: renderOptionContent(optionLabel, optionSubtitle)
128
134
  }, getOptionKey(optionValue)))
@@ -134,8 +140,8 @@ var OptionSelect = (props) => {
134
140
  if (nextItem) onChange(nextItem.value);
135
141
  },
136
142
  design: radioDesign,
137
- "aria-label": typeof label !== "undefined" ? void 0 : ariaLabel,
138
- value: value === void 0 ? void 0 : getOptionKey(value),
143
+ "aria-label": label !== void 0 ? void 0 : ariaLabel,
144
+ value: currentItem ? getOptionKey(currentItem.value) : void 0,
139
145
  ...wrapperProps,
140
146
  children: options.map(({ label: optionLabel, value: optionValue, icon: optionIcon, ariaLabel: optionAriaLabel, subtitle: optionSubtitle, disabled: optionDisabled }) => jsx(RadioButton, {
141
147
  value: getOptionKey(optionValue),
@@ -143,14 +149,14 @@ var OptionSelect = (props) => {
143
149
  className: itemClassName,
144
150
  subtitle: !noItemLabel ? optionSubtitle : void 0,
145
151
  icon: !noItemIcon ? renderOptionIcon(optionIcon) : null,
146
- "aria-label": optionAriaLabel ?? (typeof optionLabel === "string" ? optionLabel : void 0),
152
+ "aria-label": optionAriaLabel ?? (isStringValue(optionLabel) ? optionLabel : void 0),
147
153
  label: !noItemLabel ? optionLabel : void 0,
148
154
  ...itemProps
149
155
  }, getOptionKey(optionValue)))
150
156
  }) : null,
151
157
  type === "menu" ? jsxs(Menu, {
152
- triggerLabel: value ? resolvedMenuTriggerLabel : notSetLabel,
153
- triggerIcon: value && resolvedTriggerIcon,
158
+ triggerLabel: currentItem ? resolvedMenuTriggerLabel : notSetLabel,
159
+ triggerIcon: currentItem ? resolvedTriggerIcon : void 0,
154
160
  tooltip: noTriggerLabel ? jsx(RichLabel, {
155
161
  label: tooltip || currentItem?.tooltip || currentItem?.label,
156
162
  subtitle: tooltip ? currentItem?.tooltip || currentItem?.label : void 0,
@@ -158,10 +164,10 @@ var OptionSelect = (props) => {
158
164
  }) : tooltip,
159
165
  triggerProps: {
160
166
  ...wrapperProps?.triggerProps,
161
- "aria-label": typeof label !== "undefined" ? void 0 : ariaLabel ?? (typeof label === "string" ? label : void 0) ?? (typeof tooltip === "string" ? tooltip : void 0)
167
+ "aria-label": label !== void 0 ? void 0 : ariaLabel ?? (isStringValue(label) ? label : void 0) ?? (isStringValue(tooltip) ? tooltip : void 0)
162
168
  },
163
169
  keepOpen: true,
164
- "aria-label": ariaLabel ?? (typeof label === "string" ? label : void 0) ?? (typeof tooltip === "string" ? tooltip : void 0) ?? __("Menu", "eightshift-ui-components"),
170
+ "aria-label": ariaLabel ?? (isStringValue(label) ? label : void 0) ?? (isStringValue(tooltip) ? tooltip : void 0) ?? __("Menu", "eightshift-ui-components"),
165
171
  ...wrapperProps,
166
172
  children: [renderMenuOptions(), children]
167
173
  }) : null
@@ -1,6 +1,6 @@
1
1
  import { t as clsx } from "../../clsx-DQoRUQAf.js";
2
- import { t as $2ec61d1d4f780267$export$a8a3e93435678ff9 } from "../../Heading-BWTs9ckA.js";
3
- import { Container, ContainerGroup } from "../base-control/container.js";
2
+ import { t as $2ec61d1d4f780267$export$a8a3e93435678ff9 } from "../../Heading-BQje2nS2.js";
3
+ import { Container as TypedContainer, ContainerGroup as TypedContainerGroup } from "../base-control/container.js";
4
4
  import { cloneElement } from "react";
5
5
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region lib/components/options-panel/options-panel.tsx
@@ -22,7 +22,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
22
22
  var OptionsPanel = (props) => {
23
23
  const { children, className, title, help, hidden } = props;
24
24
  if (hidden) return null;
25
- return jsxs(Fragment$1, { children: [jsx(ContainerGroup, {
25
+ return jsxs(Fragment$1, { children: [jsx(TypedContainerGroup, {
26
26
  title,
27
27
  className,
28
28
  children
@@ -46,7 +46,7 @@ var OptionsPanel = (props) => {
46
46
  */
47
47
  var OptionsPanelSection = ({ children, className, hidden }) => {
48
48
  if (hidden) return null;
49
- return jsx(Container, {
49
+ return jsx(TypedContainer, {
50
50
  className: clsx("es:max-w-lg", className),
51
51
  children
52
52
  });