@eightshift/ui-components 1.4.6 → 1.5.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 (95) hide show
  1. package/dist/{Button-uYE9D_E3.js → Button-CYX0D6At.js} +5 -5
  2. package/dist/{ColorSwatch-Bev-9Vbr.js → ColorSwatch-BNX2quma.js} +4 -4
  3. package/dist/{Dialog-CGE2ficT.js → Dialog-DSquJZb-.js} +110 -18
  4. package/dist/{FieldError-CBPJ4Xx8.js → FieldError-ClB3-XvF.js} +2 -2
  5. package/dist/{FocusScope-CVd6C65L.js → FocusScope-B5L3qI3N.js} +4 -4
  6. package/dist/{Group-WZgNv9RE.js → Group-ubPTwji_.js} +3 -3
  7. package/dist/{Hidden-YSmyVF_5.js → Hidden-CupIZhlF.js} +1 -1
  8. package/dist/{Input-CaS4qmLb.js → Input-BoNEjaXM.js} +8 -8
  9. package/dist/{Label-yZgqvhXc.js → Label-BqW0M3HN.js} +2 -2
  10. package/dist/{ListBox-MZyPpwvj.js → ListBox-civ86c_v.js} +13 -18
  11. package/dist/{Select-49a62830.esm-CqLHaIei.js → Select-49a62830.esm-D8voKavK.js} +1 -1
  12. package/dist/{SelectionManager-CvRaua4m.js → SelectionManager-Ctbzoj1E.js} +12 -21
  13. package/dist/{Separator-C7Few7L6.js → Separator-CDhAddZc.js} +3 -3
  14. package/dist/{Slider-D8a63VhT.js → Slider-Dkj8Slw3.js} +11 -11
  15. package/dist/{Text-D8qh3_U7.js → Text-CdwRBXol.js} +1 -1
  16. package/dist/{VisuallyHidden-DD480kAb.js → VisuallyHidden-DsMLX-RC.js} +2 -2
  17. package/dist/assets/style.css +1 -1
  18. package/dist/components/animated-visibility/animated-visibility.js +5794 -5751
  19. package/dist/components/base-control/base-control.js +1 -1
  20. package/dist/components/button/button.js +5 -5
  21. package/dist/components/checkbox/checkbox.js +7 -7
  22. package/dist/components/color-pickers/color-swatch.js +2 -2
  23. package/dist/components/color-pickers/gradient-editor.js +1 -1
  24. package/dist/components/color-pickers/solid-color-picker.js +18 -18
  25. package/dist/components/component-toggle/component-toggle.js +1 -0
  26. package/dist/components/draggable/draggable-context.js +5 -0
  27. package/dist/components/draggable/draggable-item.js +66 -0
  28. package/dist/components/draggable/draggable.js +159 -0
  29. package/dist/components/draggable-list/draggable-list-context.js +5 -0
  30. package/dist/components/draggable-list/draggable-list-item.js +51 -39
  31. package/dist/components/draggable-list/draggable-list.js +93 -3736
  32. package/dist/components/expandable/expandable.js +2 -2
  33. package/dist/components/index.js +10 -2
  34. package/dist/components/input-field/input-field.js +7 -7
  35. package/dist/components/item-collection/item-collection.js +54 -0
  36. package/dist/components/link-input/link-input.js +217 -31
  37. package/dist/components/list-box/list-box.js +1 -1
  38. package/dist/components/matrix-align/matrix-align.js +1 -1
  39. package/dist/components/menu/menu.js +14 -13
  40. package/dist/components/modal/modal.js +3 -4
  41. package/dist/components/number-picker/number-picker.js +10 -10
  42. package/dist/components/popover/popover.js +1 -1
  43. package/dist/components/radio/radio.js +13 -13
  44. package/dist/components/repeater/repeater.js +52 -48
  45. package/dist/components/responsive/responsive-legacy.js +1 -1
  46. package/dist/components/responsive/responsive.js +1 -1
  47. package/dist/components/select/async-multi-select.js +2 -2
  48. package/dist/components/select/async-single-select.js +2 -2
  49. package/dist/components/select/custom-select-default-components.js +1 -1
  50. package/dist/components/select/multi-select.js +2 -2
  51. package/dist/components/select/react-select-component-wrappers.js +1 -1
  52. package/dist/components/select/single-select.js +2 -2
  53. package/dist/components/slider/column-config-slider.js +2 -2
  54. package/dist/components/slider/slider.js +3 -3
  55. package/dist/components/tabs/tabs.js +46 -12
  56. package/dist/components/toggle/switch.js +7 -7
  57. package/dist/components/toggle/toggle.js +1 -1
  58. package/dist/components/toggle-button/toggle-button.js +6 -6
  59. package/dist/components/tooltip/tooltip.js +3 -3
  60. package/dist/{context-Bon2Gyx5.js → context-kCEA3M_y.js} +1 -1
  61. package/dist/{focusSafely-PMGZgZ9-.js → focusSafely-xMzk3syC.js} +1 -1
  62. package/dist/{index-a301f526.esm-B9tWL9yi.js → index-a301f526.esm-BMg114iK.js} +8 -3
  63. package/dist/index.js +10 -2
  64. package/dist/{intlStrings-KQxgp5tS.js → intlStrings-BxJIrC6b.js} +1 -1
  65. package/dist/{react-select-async.esm-8Rba_3KV.js → react-select-async.esm-DY-cP0QK.js} +2 -2
  66. package/dist/{react-select.esm-DkSeQzOP.js → react-select.esm-DNlXj0hV.js} +2 -2
  67. package/dist/swapy-qb4t7itb.js +3059 -0
  68. package/dist/{textSelection-DS7-670U.js → textSelection-D5Bit8i8.js} +1 -1
  69. package/dist/{tooltip-C9mg1CP5.js → tooltip-srrt1p-b.js} +9 -8
  70. package/dist/{useButton-BPY4yXUo.js → useButton-6H5k2W5N.js} +3 -3
  71. package/dist/{useEvent-DDLT851Z.js → useEvent-BY-3vfxa.js} +1 -1
  72. package/dist/{useFocusRing-DsxEaA2J.js → useFocusRing-rz8eyzby.js} +1 -1
  73. package/dist/{useFocusable-BFKHuYS9.js → useFocusable-Bu2Ovohk.js} +2 -2
  74. package/dist/{useFormReset-BCPbwfnH.js → useFormReset-fUHUaaR6.js} +1 -1
  75. package/dist/{useFormValidationState-DC5jbhBW.js → useFormValidationState-DAan_XbC.js} +2 -2
  76. package/dist/{useLabel-DuJhImKc.js → useLabel-Bk7iP__W.js} +2 -2
  77. package/dist/{useLabels-JaBafrnV.js → useLabels-DmsOywGg.js} +1 -1
  78. package/dist/{useListState-Csx05BmT.js → useListState-GXSJsAgz.js} +1 -1
  79. package/dist/{useLocalizedStringFormatter-CVIIVTgz.js → useLocalizedStringFormatter-m03yY3xi.js} +1 -1
  80. package/dist/{useMenuTrigger-CMgzyMKW.js → useMenuTrigger-BbwpSVmh.js} +4 -4
  81. package/dist/{useNumberFieldState-BVFqhboT.js → useNumberFieldState-CpmU88xz.js} +9 -9
  82. package/dist/{useNumberFormatter-BEeBSV-N.js → useNumberFormatter-B-20GQ2u.js} +1 -1
  83. package/dist/{usePress-CY8MpqYD.js → usePress-Cs8K7gKw.js} +4 -16
  84. package/dist/{useSingleSelectListState-CzZUgAt0.js → useSingleSelectListState-C1ddMCq3.js} +2 -2
  85. package/dist/{useToggle-CJp2Fh_L.js → useToggle-Cn2nQUNS.js} +4 -4
  86. package/dist/{useToggleState-B4--Ski0.js → useToggleState-Dj0JhD9W.js} +1 -1
  87. package/dist/utilities/index.js +2 -1
  88. package/dist/utilities/text-helpers.js +38 -0
  89. package/dist/{utils-B4IdLYb8.js → utils-Du2x3YVu.js} +4 -4
  90. package/package.json +19 -18
  91. package/dist/GridList-PBJsm70G.js +0 -1268
  92. package/dist/ariaHideOutside-BzxkODNq.js +0 -89
  93. package/dist/getScrollParent-B3XgpXBL.js +0 -10
  94. package/dist/useHasTabbableChild-Byd7ylXD.js +0 -37
  95. package/dist/useListData-B5Pk32vd.js +0 -200
@@ -1,5 +1,5 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { $ as $514c0188e459b4c0$export$5f1af8db9871e1d6 } from "../../Text-D8qh3_U7.js";
2
+ import { $ as $514c0188e459b4c0$export$5f1af8db9871e1d6 } from "../../Text-CdwRBXol.js";
3
3
  import { c as clsx } from "../../lite-DVmmD_-j.js";
4
4
  import { RichLabel } from "../rich-label/rich-label.js";
5
5
  /**
@@ -1,12 +1,12 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { a as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-uYE9D_E3.js";
3
- import { g as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3, c as $3ef42575df84b30b$export$9d1611c77c2fe928, l as $df56164dff5785e2$export$4338b53315abf666 } from "../../utils-B4IdLYb8.js";
4
- import { b as $9bf71ea28793e738$export$c5251b9e124bf29 } from "../../FocusScope-CVd6C65L.js";
2
+ import { a as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-CYX0D6At.js";
3
+ import { j as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3, c as $3ef42575df84b30b$export$9d1611c77c2fe928, l as $df56164dff5785e2$export$4338b53315abf666 } from "../../utils-Du2x3YVu.js";
4
+ import { a as $9bf71ea28793e738$export$c5251b9e124bf29 } from "../../FocusScope-B5L3qI3N.js";
5
5
  import React__default, { useState, useRef, forwardRef, createContext } from "react";
6
- import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-Bon2Gyx5.js";
6
+ import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-kCEA3M_y.js";
7
7
  import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
8
8
  import { c as clsx } from "../../lite-DVmmD_-j.js";
9
- import { T as Tooltip } from "../../tooltip-C9mg1CP5.js";
9
+ import { T as Tooltip } from "../../tooltip-srrt1p-b.js";
10
10
  import { _ as __ } from "../../default-i18n-BqWys-1G.js";
11
11
  function $2680b1829e803644$export$fa142eb1681c520(props, ref) {
12
12
  const { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, orientation = "horizontal" } = props;
@@ -1,15 +1,15 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import { $ as $4e85f108e88277b8$export$b085522c77523c51 } from "../../RSPContexts-DQtGvvpM.js";
3
- import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, l as $df56164dff5785e2$export$4338b53315abf666, m as $5dc95899b306f630$export$c9058316764c140e, b as $64fa3d84918910a7$export$4d86445c2cf5e3, c as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "../../utils-B4IdLYb8.js";
3
+ import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, l as $df56164dff5785e2$export$4338b53315abf666, m as $5dc95899b306f630$export$c9058316764c140e, b as $64fa3d84918910a7$export$4d86445c2cf5e3, c as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "../../utils-Du2x3YVu.js";
4
4
  import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../Form-Cq3fu75_.js";
5
5
  import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
6
6
  import React__default, { useEffect, useRef, forwardRef, useContext, createContext } from "react";
7
- import { $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10, a as $e93e671b31057976$export$b8473d3665f3a75a, b as $e5be200c675c3b3a$export$dad6ae84456c676a, c as $e5be200c675c3b3a$export$a763b9476acd3eb } from "../../useFormValidationState-DC5jbhBW.js";
8
- import { $ as $d2c8e2b0480f3f34$export$cbe85ee05b554577 } from "../../useToggle-CJp2Fh_L.js";
9
- import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../../useToggleState-B4--Ski0.js";
10
- import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-DsxEaA2J.js";
11
- import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-PMGZgZ9-.js";
12
- import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "../../VisuallyHidden-DD480kAb.js";
7
+ import { $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10, a as $e93e671b31057976$export$b8473d3665f3a75a, b as $e5be200c675c3b3a$export$dad6ae84456c676a, c as $e5be200c675c3b3a$export$a763b9476acd3eb } from "../../useFormValidationState-DAan_XbC.js";
8
+ import { $ as $d2c8e2b0480f3f34$export$cbe85ee05b554577 } from "../../useToggle-Cn2nQUNS.js";
9
+ import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../../useToggleState-Dj0JhD9W.js";
10
+ import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-rz8eyzby.js";
11
+ import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-xMzk3syC.js";
12
+ import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "../../VisuallyHidden-DsMLX-RC.js";
13
13
  import { c as clsx } from "../../lite-DVmmD_-j.js";
14
14
  import { AnimatedVisibility } from "../animated-visibility/animated-visibility.js";
15
15
  import { icons } from "../../icons/icons.js";
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { $ as $251c695a52d94a8d$export$cae13e90592f246a } from "../../ColorSwatch-Bev-9Vbr.js";
3
- import { $ as $799cddbef784668f$export$6e865ea70d7724f } from "../../intlStrings-KQxgp5tS.js";
2
+ import { $ as $251c695a52d94a8d$export$cae13e90592f246a } from "../../ColorSwatch-BNX2quma.js";
3
+ import { $ as $799cddbef784668f$export$6e865ea70d7724f } from "../../intlStrings-BxJIrC6b.js";
4
4
  import { c as clsx } from "../../lite-DVmmD_-j.js";
5
5
  import { _ as __ } from "../../default-i18n-BqWys-1G.js";
6
6
  /**
@@ -6,7 +6,7 @@ import { icons } from "../../icons/icons.js";
6
6
  import { SolidColorPicker } from "./solid-color-picker.js";
7
7
  import { Slider } from "../slider/slider.js";
8
8
  import { NumberPicker } from "../number-picker/number-picker.js";
9
- import { $ as $251c695a52d94a8d$export$cae13e90592f246a } from "../../ColorSwatch-Bev-9Vbr.js";
9
+ import { $ as $251c695a52d94a8d$export$cae13e90592f246a } from "../../ColorSwatch-BNX2quma.js";
10
10
  import { Menu, MenuItem } from "../menu/menu.js";
11
11
  import { MatrixAlign } from "../matrix-align/matrix-align.js";
12
12
  import { Spacer } from "../spacer/spacer.js";
@@ -1,26 +1,26 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import React__default, { forwardRef, useContext, createContext, useMemo, useRef, useState, useCallback } from "react";
3
3
  import { b as $4e85f108e88277b8$export$ebe63fadcdce34ed, c as $4e85f108e88277b8$export$44644b8a16031b5b, d as $4e85f108e88277b8$export$717b2c0a523a0b53 } from "../../RSPContexts-DQtGvvpM.js";
4
- import { b as $64fa3d84918910a7$export$4d86445c2cf5e3, c as $3ef42575df84b30b$export$9d1611c77c2fe928, e as $bdb11010cef70236$export$f680877a34711e37, a as $64fa3d84918910a7$export$29f1550f4b0d4415, j as $64fa3d84918910a7$export$2881499e37b75b9a, h as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, i as $64fa3d84918910a7$export$ef03459518577ad4 } from "../../utils-B4IdLYb8.js";
4
+ import { b as $64fa3d84918910a7$export$4d86445c2cf5e3, c as $3ef42575df84b30b$export$9d1611c77c2fe928, e as $bdb11010cef70236$export$f680877a34711e37, a as $64fa3d84918910a7$export$29f1550f4b0d4415, i as $64fa3d84918910a7$export$2881499e37b75b9a, g as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, h as $64fa3d84918910a7$export$ef03459518577ad4 } from "../../utils-Du2x3YVu.js";
5
5
  import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
6
- import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-DsxEaA2J.js";
7
- import { $ as $6179b936705e76d3$export$ae780daf29e6d456, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715, m as $7215afc6de606d6b$export$de79e2c695e052f3, d as $9ab94262bd0047c7$export$420e68273165f4ec, c as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6, j as $c87311424ea30a05$export$fedb369cb70207f1, v as $c87311424ea30a05$export$a11b0059900ceec8 } from "../../focusSafely-PMGZgZ9-.js";
8
- import { $ as $799cddbef784668f$export$6e865ea70d7724f, b as $799cddbef784668f$export$4cde5df63f53f473, a as $3493a52097159720$exports } from "../../intlStrings-KQxgp5tS.js";
6
+ import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-rz8eyzby.js";
7
+ import { $ as $6179b936705e76d3$export$ae780daf29e6d456, e as $458b0a5536c1a7cf$export$40bfa8c7b0832715, m as $7215afc6de606d6b$export$de79e2c695e052f3, d as $9ab94262bd0047c7$export$420e68273165f4ec, c as $a1ea59d68270f0dd$export$f8168d8dd8fd66e6, j as $c87311424ea30a05$export$fedb369cb70207f1, v as $c87311424ea30a05$export$a11b0059900ceec8 } from "../../focusSafely-xMzk3syC.js";
8
+ import { $ as $799cddbef784668f$export$6e865ea70d7724f, b as $799cddbef784668f$export$4cde5df63f53f473, a as $3493a52097159720$exports } from "../../intlStrings-BxJIrC6b.js";
9
9
  import { a as $9446cca9a3875146$export$cb6e0bb50bc19463, $ as $9446cca9a3875146$export$7d15b64cf5a3a4c4 } from "../../number-CHmNj-oR.js";
10
- import { $ as $03deb23ff14920c4$export$4eaf04e54aa8eed6 } from "../../textSelection-DS7-670U.js";
11
- import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "../../useLabels-JaBafrnV.js";
12
- import { $ as $99facab73266f662$export$5add1d006293d136 } from "../../useFormReset-BCPbwfnH.js";
13
- import { a as $46d819fcbaf35654$export$8f71654801c2f7cd } from "../../useFocusable-BFKHuYS9.js";
14
- import { e as $28f99e3e86e6ec45$export$e5fda3247f5d67f9, f as $e8a7022cf87cba2a$export$36da96379f79f245, g as $bcca50147b47f54d$export$56b2c08e277f365, h as $47b897dc8cdb026b$export$8d15029008292ae, d as $6f909507e6374d18$export$1e7083018727fa60, i as $6f909507e6374d18$export$f1fce0420cc6d8ee, j as $6f909507e6374d18$export$6189c2744041d8f8, a as $6f909507e6374d18$export$105594979f116971 } from "../../Slider-D8a63VhT.js";
15
- import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-Bon2Gyx5.js";
16
- import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "../../useLocalizedStringFormatter-CVIIVTgz.js";
17
- import { a as $5c3e21d68f1c4674$export$a966af930f325cab } from "../../VisuallyHidden-DD480kAb.js";
18
- import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-CBPJ4Xx8.js";
19
- import { $ as $3985021b0ad6602f$export$37fb8590cf2c088c, a as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-CaS4qmLb.js";
20
- import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-yZgqvhXc.js";
21
- import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-D8qh3_U7.js";
22
- import { $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10, c as $e5be200c675c3b3a$export$a763b9476acd3eb } from "../../useFormValidationState-DC5jbhBW.js";
23
- import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, b as $d2e8511e6f209edf$export$e908e06f4b8e3402, c as $7d0a636d7a4dcefd$export$2123ff2b87c81ca, d as $d841c8010a73d545$export$4f384c9210e583c3, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberFieldState-BVFqhboT.js";
10
+ import { $ as $03deb23ff14920c4$export$4eaf04e54aa8eed6 } from "../../textSelection-D5Bit8i8.js";
11
+ import { $ as $313b98861ee5dd6c$export$d6875122194c7b44 } from "../../useLabels-DmsOywGg.js";
12
+ import { $ as $99facab73266f662$export$5add1d006293d136 } from "../../useFormReset-fUHUaaR6.js";
13
+ import { a as $46d819fcbaf35654$export$8f71654801c2f7cd } from "../../useFocusable-Bu2Ovohk.js";
14
+ import { e as $28f99e3e86e6ec45$export$e5fda3247f5d67f9, f as $e8a7022cf87cba2a$export$36da96379f79f245, g as $bcca50147b47f54d$export$56b2c08e277f365, h as $47b897dc8cdb026b$export$8d15029008292ae, d as $6f909507e6374d18$export$1e7083018727fa60, i as $6f909507e6374d18$export$f1fce0420cc6d8ee, j as $6f909507e6374d18$export$6189c2744041d8f8, a as $6f909507e6374d18$export$105594979f116971 } from "../../Slider-Dkj8Slw3.js";
15
+ import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-kCEA3M_y.js";
16
+ import { $ as $fca6afa0e843324b$export$f12b703ca79dfbb1 } from "../../useLocalizedStringFormatter-m03yY3xi.js";
17
+ import { a as $5c3e21d68f1c4674$export$a966af930f325cab } from "../../VisuallyHidden-DsMLX-RC.js";
18
+ import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-ClB3-XvF.js";
19
+ import { $ as $3985021b0ad6602f$export$37fb8590cf2c088c, a as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-BoNEjaXM.js";
20
+ import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-BqW0M3HN.js";
21
+ import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-CdwRBXol.js";
22
+ import { $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10, c as $e5be200c675c3b3a$export$a763b9476acd3eb } from "../../useFormValidationState-DAan_XbC.js";
23
+ import { $ as $de67e98908f0c6ee$export$7f629e9dc1ecf37c, b as $d2e8511e6f209edf$export$e908e06f4b8e3402, c as $7d0a636d7a4dcefd$export$2123ff2b87c81ca, d as $d841c8010a73d545$export$4f384c9210e583c3, a as $81397a9303501bda$export$23f548e970bdf099 } from "../../useNumberFieldState-CpmU88xz.js";
24
24
  import { c as clsx } from "../../lite-DVmmD_-j.js";
25
25
  import { BaseControl } from "../base-control/base-control.js";
26
26
  import { _ as __ } from "../../default-i18n-BqWys-1G.js";
@@ -108,6 +108,7 @@ const ComponentToggle = (props) => {
108
108
  }
109
109
  ),
110
110
  disabled: !useComponent || expandButtonDisabled,
111
+ noFocusHandling: true,
111
112
  children: !expandButtonDisabled && /* @__PURE__ */ jsx("div", { className: contentClassName, children })
112
113
  }
113
114
  );
@@ -0,0 +1,5 @@
1
+ import { createContext } from "react";
2
+ const DraggableContext = createContext();
3
+ export {
4
+ DraggableContext
5
+ };
@@ -0,0 +1,66 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { c as clsx } from "../../lite-DVmmD_-j.js";
3
+ import "../../default-i18n-BqWys-1G.js";
4
+ import { DraggableContext } from "./draggable-context.js";
5
+ import { useContext } from "react";
6
+ import { icons } from "../../icons/icons.js";
7
+ import "../../react-jsx-parser.min-CAGfntg1.js";
8
+ /**
9
+ * A Draggable item.
10
+ *
11
+ * @component
12
+ * @param {Object} props - Component props.
13
+ * @param {string} [props.className] - Classes to pass to the container.
14
+ *
15
+ * @returns {JSX.Element} The DraggableList component.
16
+ *
17
+ * @see {@link DraggableList} for usage example.
18
+ *
19
+ * @preserve
20
+ */
21
+ const DraggableItem = (props) => {
22
+ const { children, className, ...rest } = props;
23
+ const { itemId } = useContext(DraggableContext);
24
+ return /* @__PURE__ */ jsx(
25
+ "div",
26
+ {
27
+ "data-swapy-item": itemId,
28
+ className,
29
+ ...rest,
30
+ children
31
+ }
32
+ );
33
+ };
34
+ /**
35
+ * A Draggable item handle.
36
+ *
37
+ * @component
38
+ * @param {Object} props - Component props.
39
+ * @param {string} [props.className] - Classes to pass to the handle.
40
+ *
41
+ * @returns {JSX.Element} The DraggableItemHandle component.
42
+ *
43
+ * @example
44
+ * <DraggableItemHandle />
45
+ *
46
+ * @preserve
47
+ */
48
+ const DraggableItemHandle = (props) => {
49
+ const { className, children, ...rest } = props;
50
+ return /* @__PURE__ */ jsx(
51
+ "div",
52
+ {
53
+ "data-swapy-handle": true,
54
+ className: clsx(
55
+ "es-uic-w-fit es-uic-cursor-pointer es-uic-rounded es-uic-border es-uic-border-gray-100 es-uic-bg-white es-uic-py-0.5 es-uic-text-gray-400 [&>svg]:es-uic-size-4",
56
+ className
57
+ ),
58
+ ...rest,
59
+ children: children ?? icons.reorderGrabberV
60
+ }
61
+ );
62
+ };
63
+ export {
64
+ DraggableItem,
65
+ DraggableItemHandle
66
+ };
@@ -0,0 +1,159 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useId, useMemo, useRef, useState, useEffect } from "react";
3
+ import "../../default-i18n-BqWys-1G.js";
4
+ import { j as je } from "../../swapy-qb4t7itb.js";
5
+ import { DraggableContext } from "./draggable-context.js";
6
+ import { c as clsx } from "../../lite-DVmmD_-j.js";
7
+ const fixIds = (items, itemIdBase) => {
8
+ return items.map((item, i) => ({
9
+ ...item,
10
+ id: (item == null ? void 0 : item.id) ?? `${itemIdBase}-${i}`
11
+ }));
12
+ };
13
+ /**
14
+ * A component that allows re-ordering items freely.
15
+ *
16
+ * @component
17
+ * @param {Object} props - Component props.
18
+ * @param {Object<string, any>[]} props.items - Data to display in the list.
19
+ * @param {Function} props.onChange - Function to run when the items change.
20
+ * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
21
+ * @param {boolean} [props.noReorder] - If `true`, item reordering is disabled.
22
+ * @param {string} [props.className] - Classes to pass to the component.
23
+ * @param {string} [props.slotClassName] - Classes to pass to the item container slot.
24
+ *
25
+ * @returns {JSX.Element} The Draggable component.
26
+ *
27
+ * @example
28
+ * <Draggable
29
+ * items={items}
30
+ * onChange={setItems}
31
+ * >
32
+ * {(item) => {
33
+ * const { title, updateData } = item;
34
+ *
35
+ * return (
36
+ * <DraggableItem
37
+ * label={title ?? 'New item'}
38
+ * icon={icons.myIcon}
39
+ * >
40
+ * <InputField
41
+ * label='Title'
42
+ * type='text'
43
+ * value={title}
44
+ * onChange={(value) => updateData({ title: value })}
45
+ * />
46
+ * </DraggableItem>
47
+ * );
48
+ * }}
49
+ * </Draggable>
50
+ *
51
+ * @preserve
52
+ */
53
+ const Draggable = (props) => {
54
+ const itemIdBase = useId("draggable-list-item-");
55
+ const {
56
+ children,
57
+ items: rawItems,
58
+ onChange,
59
+ noReorder,
60
+ className,
61
+ slotClassName,
62
+ hidden,
63
+ ...rest
64
+ } = props;
65
+ const items = useMemo(() => fixIds(rawItems, itemIdBase), [rawItems]);
66
+ const ref = useRef(null);
67
+ const swapyRef = useRef(null);
68
+ const [slotItemsMap, setSlotItemsMap] = useState([
69
+ ...items.map((item) => ({
70
+ slotId: item.id,
71
+ itemId: item.id
72
+ }))
73
+ ]);
74
+ const slottedItems = useMemo(
75
+ () => slotItemsMap.map(({ slotId, itemId }) => ({
76
+ slotId,
77
+ itemId,
78
+ item: items.find((item) => item.id === itemId)
79
+ })),
80
+ [items, slotItemsMap]
81
+ );
82
+ useEffect(() => {
83
+ var _a;
84
+ const newItems = items.filter((item) => !slotItemsMap.some((slotItem) => slotItem.itemId === item.id)).map((item) => ({
85
+ slotId: item.id,
86
+ itemId: item.id
87
+ }));
88
+ const withoutRemovedItems = slotItemsMap.filter((slotItem) => items.some((item) => item.id === slotItem.itemId) || !slotItem.itemId);
89
+ const updatedSlotItemsMap = [...withoutRemovedItems, ...newItems];
90
+ setSlotItemsMap(updatedSlotItemsMap);
91
+ (_a = swapyRef.current) == null ? void 0 : _a.setData({ array: updatedSlotItemsMap });
92
+ }, [items]);
93
+ useEffect(() => {
94
+ const container = ref == null ? void 0 : ref.current;
95
+ swapyRef.current = je(container, {
96
+ manualSwap: true
97
+ });
98
+ swapyRef.current.onSwap(({ data }) => {
99
+ var _a;
100
+ const tweakedItems = data.array.filter(({ itemId }) => itemId !== null).map(({ itemId }) => items.find((item) => (item == null ? void 0 : item.id) === itemId));
101
+ onChange(tweakedItems);
102
+ (_a = swapyRef.current) == null ? void 0 : _a.setData({ array: data.array });
103
+ setSlotItemsMap(data.array);
104
+ });
105
+ return () => {
106
+ var _a;
107
+ (_a = swapyRef.current) == null ? void 0 : _a.destroy();
108
+ };
109
+ }, []);
110
+ useEffect(() => {
111
+ var _a;
112
+ (_a = swapyRef == null ? void 0 : swapyRef.current) == null ? void 0 : _a.enable(!noReorder);
113
+ }, [noReorder]);
114
+ if (hidden) {
115
+ return null;
116
+ }
117
+ return /* @__PURE__ */ jsx(
118
+ "div",
119
+ {
120
+ className,
121
+ ref,
122
+ ...rest,
123
+ children: slottedItems.map(({ itemId, slotId, item }, index) => /* @__PURE__ */ jsx(
124
+ "div",
125
+ {
126
+ className: clsx(
127
+ "es-uic-transition-colors data-[swapy-highlighted]:es-uic-rounded-md data-[swapy-highlighted]:es-uic-outline-dashed data-[swapy-highlighted]:es-uic-outline-1 data-[swapy-highlighted]:es-uic-outline-teal-500/50",
128
+ slotClassName
129
+ ),
130
+ "data-swapy-slot": slotId,
131
+ children: item && /* @__PURE__ */ jsx(
132
+ DraggableContext.Provider,
133
+ {
134
+ value: { itemId },
135
+ children: children({
136
+ ...item,
137
+ updateData: (newValue) => {
138
+ onChange(items.map((i) => i.id === itemId ? { ...i, ...newValue } : i));
139
+ },
140
+ itemIndex: index,
141
+ deleteItem: () => {
142
+ onChange(items.filter((i) => i.id !== item.id));
143
+ if (item.onAfterItemRemove) {
144
+ onAfterItemRemove(item);
145
+ }
146
+ }
147
+ })
148
+ },
149
+ itemId
150
+ )
151
+ },
152
+ slotId
153
+ ))
154
+ }
155
+ );
156
+ };
157
+ export {
158
+ Draggable
159
+ };
@@ -0,0 +1,5 @@
1
+ import { createContext } from "react";
2
+ const DraggableListContext = createContext();
3
+ export {
4
+ DraggableListContext
5
+ };
@@ -1,10 +1,9 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { $ as $72e60046c03fbe42$export$e96fc9a8407faa6b } from "../../GridList-PBJsm70G.js";
3
- import { Button } from "../button/button.js";
4
- import { icons } from "../../icons/icons.js";
5
2
  import { c as clsx } from "../../lite-DVmmD_-j.js";
6
- import { _ as __ } from "../../default-i18n-BqWys-1G.js";
3
+ import "../../default-i18n-BqWys-1G.js";
7
4
  import { RichLabel } from "../rich-label/rich-label.js";
5
+ import { DraggableListContext } from "./draggable-list-context.js";
6
+ import { useContext } from "react";
8
7
  /**
9
8
  * A DraggableList item.
10
9
  *
@@ -15,7 +14,8 @@ import { RichLabel } from "../rich-label/rich-label.js";
15
14
  * @param {string} [props.subtitle] - Subtitle to display.
16
15
  * @param {JSX.Element|JSX.Element[]} [props.actions] - Actions to display to the right of the label.
17
16
  * @param {string} [props.textValue] - The text value of the item.
18
- * @param {string} [props.className] - Classes to pass to the item.
17
+ * @param {string} [props.className] - Classes to pass to the label.
18
+ * @param {string} [props.containerClassName] - Classes to pass to the item container.
19
19
  *
20
20
  * @returns {JSX.Element} The DraggableList component.
21
21
  *
@@ -24,51 +24,63 @@ import { RichLabel } from "../rich-label/rich-label.js";
24
24
  * @preserve
25
25
  */
26
26
  const DraggableListItem = (props) => {
27
- const { children, icon, label, subtitle, "aria-label": ariaLabel, className, textValue, ...rest } = props;
28
- let a11yLabel = textValue;
29
- if ((label == null ? void 0 : label.length) > 0) {
30
- a11yLabel = label;
31
- }
32
- if (a11yLabel === "" || !a11yLabel) {
33
- a11yLabel = __("New item", "eightshift-ui-components");
34
- }
27
+ const { children, icon, label, subtitle, className, containerClassName, ...rest } = props;
28
+ const { labelAsHandle } = useContext(DraggableListContext);
29
+ const labelElement = /* @__PURE__ */ jsx(
30
+ RichLabel,
31
+ {
32
+ hidden: !(icon || label || subtitle),
33
+ icon,
34
+ label,
35
+ subtitle,
36
+ className,
37
+ fullWidth: true
38
+ }
39
+ );
35
40
  return /* @__PURE__ */ jsxs(
36
- $72e60046c03fbe42$export$e96fc9a8407faa6b,
41
+ "div",
37
42
  {
38
- "aria-label": ariaLabel ?? a11yLabel,
39
- textValue: a11yLabel,
40
43
  className: clsx(
41
44
  "es-uic-flex es-uic-min-h-7 es-uic-items-center es-uic-gap-1 es-uic-rounded-lg es-uic-transition",
42
- "focus:es-uic-outline-none focus-visible:es-uic-ring focus-visible:es-uic-ring-teal-500 focus-visible:es-uic-ring-opacity-50"
45
+ "focus:es-uic-outline-none focus-visible:es-uic-ring focus-visible:es-uic-ring-teal-500 focus-visible:es-uic-ring-opacity-50",
46
+ containerClassName
43
47
  ),
44
48
  ...rest,
45
49
  children: [
46
- /* @__PURE__ */ jsx(
47
- RichLabel,
48
- {
49
- icon,
50
- label,
51
- subtitle,
52
- className,
53
- fullWidth: true
54
- }
55
- ),
56
- /* @__PURE__ */ jsx(
57
- Button,
58
- {
59
- size: "small",
60
- className: "es-uic-ml-auto es-uic-h-6 es-uic-w-4 es-uic-shrink-0 !es-uic-text-gray-500 es-uic-opacity-5 focus:!es-uic-opacity-100",
61
- slot: "drag",
62
- type: "ghost",
63
- icon: icons.reorderGrabberV,
64
- tooltip: __("Re-order", "eightshift-ui-components")
65
- }
66
- ),
50
+ labelAsHandle && /* @__PURE__ */ jsx("div", { "data-swapy-handle": true, children: labelElement }),
51
+ !labelAsHandle && labelElement,
67
52
  children
68
53
  ]
69
54
  }
70
55
  );
71
56
  };
57
+ /**
58
+ * A Draggable item handle.
59
+ *
60
+ * @component
61
+ * @param {Object} props - Component props.
62
+ * @param {string} [props.className] - Classes to pass to the handle.
63
+ *
64
+ * @returns {JSX.Element} The DraggableListItemHandle component.
65
+ *
66
+ * @example
67
+ * <DraggableListItemHandle />
68
+ *
69
+ * @preserve
70
+ */
71
+ const DraggableListItemHandle = (props) => {
72
+ const { className, children, ...rest } = props;
73
+ return /* @__PURE__ */ jsx(
74
+ "div",
75
+ {
76
+ "data-swapy-handle": true,
77
+ className: className ?? 'es-uic-relative es-uic-h-6 es-uic-w-2 es-uic-cursor-pointer es-uic-items-center es-uic-justify-center es-uic-self-center es-uic-rounded es-uic-border es-uic-border-gray-300 es-uic-bg-gray-50 es-uic-transition after:es-uic-absolute after:es-uic-inset-0 after:es-uic-m-auto after:es-uic-h-4 after:es-uic-w-px after:es-uic-bg-gray-200 after:es-uic-transition after:es-uic-content-[""] hover:es-uic-border-teal-500 hover:es-uic-bg-teal-400 hover:after:es-uic-bg-teal-500',
78
+ ...rest,
79
+ children
80
+ }
81
+ );
82
+ };
72
83
  export {
73
- DraggableListItem
84
+ DraggableListItem,
85
+ DraggableListItemHandle
74
86
  };