@eightshift/ui-components 1.9.1 → 2.0.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 (122) hide show
  1. package/README.md +0 -7
  2. package/dist/{Button-BEIi9mB_.js → Button-OQ5EIPvt.js} +8 -8
  3. package/dist/{SelectionManager-DGbP8Ntl.js → Collection-CJM_asJz.js} +345 -197
  4. package/dist/{Color-CZxTZUqH.js → Color-B0HgM8f4.js} +1 -1
  5. package/dist/{ColorSwatch-Iijp9hzP.js → ColorSwatch-Dv3Wxdl_.js} +6 -7
  6. package/dist/{ComboBox-DVPU5XzU.js → ComboBox-BnlZjJ3T.js} +21 -22
  7. package/dist/{Dialog-17uxPRe5.js → Dialog-CIh-hX93.js} +77 -65
  8. package/dist/{FieldError-huHsqqMP.js → FieldError-D7A6s7O5.js} +2 -2
  9. package/dist/{FocusScope-7r2_SUa9.js → FocusScope-Cs5_OoeA.js} +6 -4
  10. package/dist/{Group-k_oyd3Te.js → Group-D6tr3U_n.js} +5 -6
  11. package/dist/{Heading-DRBzKYHb.js → Heading-DiYTXoIW.js} +3 -4
  12. package/dist/{Hidden-5cXbU70C.js → Hidden-DnOd_jPX.js} +2 -2
  13. package/dist/{Input-DCmTv_Qw.js → Input-Se0m3ubj.js} +13 -11
  14. package/dist/{Label-D8G0GMsc.js → Label-Ca9uelsn.js} +4 -5
  15. package/dist/{List-C7L49CxW.js → List-Br274SP1.js} +16 -8
  16. package/dist/{ListBox-BxZwDp9o.js → ListBox-D9dFEh5A.js} +36 -23
  17. package/dist/{OverlayArrow-Dca2JXYU.js → OverlayArrow-1jx-ZyCR.js} +75 -13
  18. package/dist/{Select-aab027f3.esm-OvJ8lZs8.js → Select-aab027f3.esm-HFNIFFya.js} +4 -4
  19. package/dist/{Separator-B_VdRHCf.js → Separator-BhZycTUp.js} +9 -7
  20. package/dist/{Slider-CgEZmlNY.js → Slider-BZNaJylD.js} +20 -24
  21. package/dist/{Text-Cld9rkzJ.js → Text-aOUPPvTO.js} +3 -4
  22. package/dist/{VisuallyHidden-D0lsNfi4.js → VisuallyHidden-ClTQo25k.js} +2 -2
  23. package/dist/assets/index.css +37 -0
  24. package/dist/assets/style-editor.css +5287 -0
  25. package/dist/assets/style.css +5293 -1
  26. package/dist/assets/wp-font-enhancements.css +8 -1
  27. package/dist/assets/wp-ui-enhancements.css +299 -1
  28. package/dist/components/animated-visibility/animated-visibility.js +17 -21
  29. package/dist/components/base-control/base-control.js +7 -7
  30. package/dist/components/breakpoint-preview/breakpoint-preview.js +50 -50
  31. package/dist/components/button/button.js +190 -86
  32. package/dist/components/checkbox/checkbox.js +44 -27
  33. package/dist/components/color-pickers/color-picker.js +13 -9
  34. package/dist/components/color-pickers/color-swatch.js +4 -4
  35. package/dist/components/color-pickers/gradient-editor.js +25 -24
  36. package/dist/components/color-pickers/solid-color-picker.js +197 -229
  37. package/dist/components/component-toggle/component-toggle.js +3 -3
  38. package/dist/components/container-panel/container-panel.js +17 -17
  39. package/dist/components/draggable/draggable-handle.js +6 -6
  40. package/dist/components/draggable/draggable.js +1414 -699
  41. package/dist/components/draggable-list/draggable-list-item.js +3 -3
  42. package/dist/components/draggable-list/draggable-list.js +12 -12
  43. package/dist/components/expandable/expandable.js +66 -78
  44. package/dist/components/index.js +2 -3
  45. package/dist/components/input-field/input-field.js +35 -22
  46. package/dist/components/layout/hstack.js +1 -1
  47. package/dist/components/layout/vstack.js +1 -1
  48. package/dist/components/link-input/link-input.js +69 -57
  49. package/dist/components/matrix-align/matrix-align.js +34 -86
  50. package/dist/components/menu/menu.js +22 -23
  51. package/dist/components/modal/modal.js +24 -25
  52. package/dist/components/notice/notice.js +32 -32
  53. package/dist/components/number-picker/number-picker.js +41 -40
  54. package/dist/components/option-select/option-select.js +9 -4
  55. package/dist/components/options-panel/options-panel.js +63 -28
  56. package/dist/components/placeholders/file-placeholder.js +6 -17
  57. package/dist/components/placeholders/image-placeholder.js +17 -17
  58. package/dist/components/placeholders/media-placeholder.js +12 -12
  59. package/dist/components/popover/popover.js +6 -5
  60. package/dist/components/radio/radio.js +60 -43
  61. package/dist/components/repeater/repeater-item.js +10 -10
  62. package/dist/components/repeater/repeater.js +8 -8
  63. package/dist/components/responsive/mini-responsive.js +41 -41
  64. package/dist/components/responsive/responsive-legacy.js +33 -33
  65. package/dist/components/responsive/responsive.js +48 -48
  66. package/dist/components/responsive-preview/responsive-preview.js +4 -4
  67. package/dist/components/rich-label/rich-label.js +13 -11
  68. package/dist/components/select/async-multi-select.js +3 -3
  69. package/dist/components/select/async-single-select.js +2 -2
  70. package/dist/components/select/custom-select-default-components.js +3 -3
  71. package/dist/components/select/multi-select-components.js +1 -1
  72. package/dist/components/select/multi-select.js +3 -3
  73. package/dist/components/select/react-select-component-wrappers.js +1 -1
  74. package/dist/components/select/single-select.js +2 -2
  75. package/dist/components/select/styles.js +21 -21
  76. package/dist/components/select/v2/async-select.js +37 -47
  77. package/dist/components/select/v2/shared.js +8 -8
  78. package/dist/components/select/v2/single-select.js +44 -48
  79. package/dist/components/slider/column-config-slider.js +25 -25
  80. package/dist/components/slider/slider.js +173 -182
  81. package/dist/components/spacer/spacer.js +21 -21
  82. package/dist/components/tabs/tabs.js +111 -63
  83. package/dist/components/toggle/switch.js +27 -21
  84. package/dist/components/toggle/toggle.js +1 -1
  85. package/dist/components/toggle-button/toggle-button.js +160 -83
  86. package/dist/components/tooltip/tooltip.js +25 -28
  87. package/dist/{context-DtrQ3I5U.js → context-CDOs-GuR.js} +1 -1
  88. package/dist/{focusSafely-ChK5oW-0.js → focusSafely-CiqTTjWy.js} +18 -17
  89. package/dist/icons/icons.js +52 -0
  90. package/dist/{index-641ee5b8.esm-DRaWil7u.js → index-641ee5b8.esm-DbdaYaxR.js} +45 -45
  91. package/dist/{index-D0mHceYg.js → index-BRp93Yfa.js} +24 -31
  92. package/dist/index-CcCn9HWX.js +44 -0
  93. package/dist/index.js +2 -3
  94. package/dist/{multi-select-components-2Ax71j9a.js → multi-select-components-CkF3LyTF.js} +4 -4
  95. package/dist/{react-select-async.esm-BZwl7Ddb.js → react-select-async.esm-DcVLw9X5.js} +3 -3
  96. package/dist/{react-select.esm-DI0eSkd8.js → react-select.esm-OZ0cmTjg.js} +3 -3
  97. package/dist/style-editor.js +1 -0
  98. package/dist/style.js +1 -1
  99. package/dist/{textSelection-CdZPiDxh.js → textSelection-BlTDSskG.js} +2 -2
  100. package/dist/{useButton-C5e_EJlC.js → useButton-CmLbE5vg.js} +3 -3
  101. package/dist/{useEvent-BW_vevRp.js → useEvent-cLDJlznQ.js} +1 -1
  102. package/dist/{useFocusRing-Dbj6MsFR.js → useFocusRing-CGp3guTX.js} +1 -1
  103. package/dist/{useFocusable-C2xrPFl6.js → useFocusable-087cO5Ct.js} +9 -6
  104. package/dist/{useFormReset-DDCE2RPv.js → useFormReset-NpLM2e3G.js} +1 -1
  105. package/dist/{useFormValidation-BxnASugK.js → useFormValidation-BWwmZQE2.js} +3 -3
  106. package/dist/{useLabel-C3sAYsiC.js → useLabel-C85N3Hzw.js} +2 -2
  107. package/dist/{useLabels-WnPbJUyQ.js → useLabels-C_2wWraB.js} +1 -1
  108. package/dist/{useListState-BmTFGt2_.js → useListState-Z7FB_NzO.js} +1 -1
  109. package/dist/{useLocalizedStringFormatter-BurzRhbk.js → useLocalizedStringFormatter-BQ4TF72x.js} +1 -1
  110. package/dist/{useNumberField-D_Azw6A1.js → useNumberField-Bm6_BVl9.js} +10 -10
  111. package/dist/{useNumberFormatter-B58dTQ-c.js → useNumberFormatter-DlUVKkO7.js} +1 -1
  112. package/dist/{usePress-DZ9pn6Jl.js → usePress-rg_OQIGW.js} +15 -14
  113. package/dist/{useSingleSelectListState-Dr843geC.js → useSingleSelectListState-Cu3xtEJS.js} +2 -2
  114. package/dist/{useToggle-Dq9VpeCd.js → useToggle-DzlgBLAJ.js} +4 -4
  115. package/dist/{useToggleState-DA_b3LG_.js → useToggleState-DhSBQxkp.js} +1 -1
  116. package/dist/{utils-BmaSD6gC.js → utils-39D0mStj.js} +41 -93
  117. package/package.json +40 -38
  118. package/dist/GeistMonoVF.woff2 +0 -0
  119. package/dist/GeistVF.woff2 +0 -0
  120. package/dist/assets/fonts.css +0 -1
  121. package/dist/components/list-box/list-box.js +0 -157
  122. package/dist/fonts.js +0 -1
@@ -1,11 +1,12 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-BEIi9mB_.js";
3
- import { l as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3, d as $3ef42575df84b30b$export$9d1611c77c2fe928, m as $df56164dff5785e2$export$4338b53315abf666 } from "../../utils-BmaSD6gC.js";
4
- import { $ as $9bf71ea28793e738$export$c5251b9e124bf29 } from "../../FocusScope-7r2_SUa9.js";
2
+ import { $ as $d2b4bc8c273e7be6$export$353f5b6fc5456de1 } from "../../Button-OQ5EIPvt.js";
3
+ import { l as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3, d as $3ef42575df84b30b$export$9d1611c77c2fe928, m as $df56164dff5785e2$export$4338b53315abf666 } from "../../utils-39D0mStj.js";
4
+ import { $ as $9bf71ea28793e738$export$c5251b9e124bf29 } from "../../FocusScope-Cs5_OoeA.js";
5
5
  import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
6
6
  import React__default, { useState, useRef, forwardRef, createContext } from "react";
7
- import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-DtrQ3I5U.js";
7
+ import { $ as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "../../context-CDOs-GuR.js";
8
8
  import { c as clsx } from "../../lite-DVmmD_-j.js";
9
+ import { c as cva } from "../../index-CcCn9HWX.js";
9
10
  import { Tooltip } from "../tooltip/tooltip.js";
10
11
  import { _ as __ } from "../../default-i18n-CM1-Xvzf.js";
11
12
  function $2680b1829e803644$export$fa142eb1681c520(props, ref) {
@@ -65,7 +66,7 @@ function $2680b1829e803644$export$fa142eb1681c520(props, ref) {
65
66
  };
66
67
  }
67
68
  const $13c3c67164f4d5be$export$6311e7ab80ef752f = /* @__PURE__ */ createContext({});
68
- function $13c3c67164f4d5be$var$Toolbar(props, ref) {
69
+ const $13c3c67164f4d5be$export$4c260019440d418f = /* @__PURE__ */ forwardRef(function Toolbar(props, ref) {
69
70
  [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $13c3c67164f4d5be$export$6311e7ab80ef752f);
70
71
  let { toolbarProps } = $2680b1829e803644$export$fa142eb1681c520(props, ref);
71
72
  let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
@@ -84,8 +85,7 @@ function $13c3c67164f4d5be$var$Toolbar(props, ref) {
84
85
  slot: props.slot || void 0,
85
86
  "data-orientation": props.orientation || "horizontal"
86
87
  }, renderProps.children);
87
- }
88
- const $13c3c67164f4d5be$export$4c260019440d418f = /* @__PURE__ */ forwardRef($13c3c67164f4d5be$var$Toolbar);
88
+ });
89
89
  /**
90
90
  * A simple button component.
91
91
  *
@@ -106,7 +106,7 @@ const $13c3c67164f4d5be$export$4c260019440d418f = /* @__PURE__ */ forwardRef($13
106
106
  * @returns {JSX.Element} The Button component.
107
107
  *
108
108
  * @typedef {'small' | 'default' | 'large'} ButtonSize
109
- * @typedef {'default' | 'selected' | 'ghost' | 'danger'} ButtonType
109
+ * @typedef {'default' | 'selected' | 'ghost' | 'danger' | 'dangerGhost'} ButtonType
110
110
  *
111
111
  * @example
112
112
  * <Button onPress={() => console.log('Hi!')} icon={icons.myIcon} />
@@ -116,7 +116,6 @@ const $13c3c67164f4d5be$export$4c260019440d418f = /* @__PURE__ */ forwardRef($13
116
116
  * @preserve
117
117
  */
118
118
  const Button = (props) => {
119
- var _a, _b, _c, _d;
120
119
  const {
121
120
  children,
122
121
  icon,
@@ -141,84 +140,178 @@ const Button = (props) => {
141
140
  if (hidden) {
142
141
  return null;
143
142
  }
144
- const sizes = {
145
- small: {
146
- iconButton: "es-uic-size-7",
147
- button: "es-uic-h-7 es-uic-min-w-7",
148
- iconButtonPadding: "es-uic-px-1",
149
- buttonPadding: "es-uic-px-2",
150
- iconSize: "[&>svg]:es-uic-size-4.5"
151
- },
152
- default: {
153
- iconButton: "es-uic-size-9",
154
- button: "es-uic-h-9 es-uic-min-w-9",
155
- iconButtonPadding: "es-uic-px-1.5",
156
- buttonPadding: "es-uic-px-2",
157
- iconSize: "[&>svg]:es-uic-size-5.5"
158
- },
159
- large: {
160
- iconButton: "es-uic-size-10",
161
- button: "es-uic-h-10 es-uic-min-w-10",
162
- iconButtonPadding: "es-uic-px-2",
163
- buttonPadding: "es-uic-px-4",
164
- iconSize: "[&>svg]:es-uic-size-6"
165
- }
166
- };
167
- const themes = {
168
- default: {
169
- regular: "es-uic-text-gray-700 es-uic-shadow-sm es-uic-border es-uic-border-gray-300 es-uic-bg-white",
170
- hover: "hover:es-uic-border-gray-300 hover:es-uic-bg-gray-100",
171
- disabled: "disabled:es-uic-border-gray-300 disabled:es-uic-bg-gray-50/50 disabled:es-uic-text-gray-300 es-uic-border",
172
- focus: "focus-visible:es-uic-ring-teal-500 focus-visible:es-uic-ring-opacity-50"
173
- },
174
- selected: {
175
- regular: "es-uic-bg-teal-600 es-uic-text-white es-uic-border-teal-600 after:es-uic-opacity-45 es-uic-border es-uic-shadow-md es-uic-shadow-teal-500/25",
176
- hover: "hover:es-uic-shadow-teal-600/50 hover:after:es-uic-opacity-60"
177
- },
178
- ghost: {
179
- regular: "es-uic-border-transparent es-uic-text-gray-700",
180
- hover: "hover:es-uic-bg-gray-100",
181
- disabled: "disabled:es-uic-text-gray-300 disabled:es-uic-border-transparent"
182
- },
183
- danger: {
184
- regular: "es-uic-border-red-300 es-uic-text-gray-700 es-uic-text-gray-900 es-uic-shadow-red-300/30 [&>svg]:es-uic-text-red-500 es-uic-shadow-sm es-uic-border",
185
- hover: "hover:es-uic-border-red-400 hover:es-uic-bg-red-50 hover:es-uic-text-red-500 hover:es-uic-shadow-red-300/75",
186
- focus: "focus-visible:es-uic-ring-red-500 focus-visible:es-uic-ring-opacity-50"
143
+ const componentClasses = cva(
144
+ [
145
+ "es:flex es:items-center es:gap-1",
146
+ "es:transition es:duration-300 es:border es:text-sm",
147
+ "es:any-focus:outline-hidden es:focus-visible:z-10",
148
+ "es:focus-visible:ring-2 es:focus-visible:ring-accent-500/50",
149
+ "es:focus-visible:border-accent-500",
150
+ "es:btn-group-mid:rounded-none",
151
+ "es:btn-group-h-start:rounded-r-none es:btn-group-v-start:rounded-b-none",
152
+ "es:btn-group-h-end:rounded-l-none es:btn-group-v-end:rounded-t-none",
153
+ "es:cursor-pointer",
154
+ "es:shrink-0",
155
+ icon && children ? "es:justify-start" : "es:justify-center",
156
+ className
157
+ ],
158
+ {
159
+ variants: {
160
+ size: {
161
+ small: "es:icon:size-4.5 es:rounded-md",
162
+ default: "es:icon:size-5.5 es:rounded-lg",
163
+ large: "es:icon:size-6 es:rounded-lg"
164
+ },
165
+ type: {
166
+ default: ["es:bg-radial-[at_50%_125%]", "es:inset-ring es:inset-shadow-xs"],
167
+ selected: ["es:bg-radial-[at_50%_125%]", "es:inset-ring es:inset-shadow-xs"],
168
+ danger: ["es:bg-radial-[at_50%_125%]", "es:inset-ring es:inset-shadow-xs"],
169
+ ghost: ["es:border-transparent es:text-secondary-700", "es:hover:bg-secondary-100", "es:disabled:border-transparent!"],
170
+ dangerGhost: [
171
+ "es:border-transparent es:text-red-600",
172
+ "es:hover:bg-red-500/5",
173
+ "es:focus-visible:text-red-700",
174
+ "es:focus-visible:ring-red-500/30 es:focus-visible:border-red-600 es:focus-visible:inset-ring-red-100",
175
+ "es:disabled:border-transparent!"
176
+ ]
177
+ }
178
+ },
179
+ compoundVariants: [
180
+ // Styles.
181
+ {
182
+ type: "default",
183
+ disabled: false,
184
+ class: [
185
+ "es:text-black",
186
+ "es:from-secondary-50 es:to-white",
187
+ "es:border-secondary-300",
188
+ "es:inset-ring-secondary-100",
189
+ "es:inset-shadow-secondary-100/50",
190
+ "es:shadow-xs",
191
+ "es:hover:inset-shadow-secondary-100 es:hover:to-secondary-100 es:hover:inset-ring-secondary-100",
192
+ "es:hover:text-accent-950",
193
+ "es:focus-visible:text-accent-950"
194
+ ]
195
+ },
196
+ {
197
+ type: "selected",
198
+ disabled: false,
199
+ class: [
200
+ "es:text-white",
201
+ "es:from-accent-500 es:to-accent-600",
202
+ "es:border-accent-700",
203
+ "es:inset-ring es:inset-ring-accent-600",
204
+ "es:inset-shadow-xs es:inset-shadow-accent-400/75",
205
+ "es:focus-visible:border-accent-700",
206
+ "es:focus-visible:inset-ring es:focus-visible:inset-ring-accent-600",
207
+ "es:focus-visible:inset-shadow-xs es:focus-visible:inset-shadow-accent-400",
208
+ "es:shadow es:shadow-accent-600/30"
209
+ ]
210
+ },
211
+ {
212
+ type: "danger",
213
+ disabled: false,
214
+ class: [
215
+ "es:text-red-800",
216
+ "es:from-red-50/75 es:to-white",
217
+ "es:border-red-600/50",
218
+ "es:inset-ring-red-100",
219
+ "es:inset-shadow-red-50",
220
+ "es:hover:inset-shadow-red-100 es:hover:inset-ring-red-100 es:hover:text-red-800 es:hover:border-red-600",
221
+ "es:focus-visible:text-red-900",
222
+ "es:focus-visible:ring-red-500/30 es:focus-visible:border-red-600 es:focus-visible:inset-ring-red-100",
223
+ "es:shadow"
224
+ ]
225
+ },
226
+ {
227
+ disabled: true,
228
+ class: "es:disabled:border-zinc-300 es:disabled:text-zinc-400 es:border es:shadow-none es:disabled:inset-shadow-transparent es:disabled:inset-ring-0"
229
+ },
230
+ // Sizes.
231
+ {
232
+ size: "small",
233
+ iconOnly: false,
234
+ class: "es:h-7 es:min-w-7"
235
+ },
236
+ {
237
+ size: "small",
238
+ iconOnly: true,
239
+ class: "es:size-7"
240
+ },
241
+ {
242
+ size: "small",
243
+ hasIcon: false,
244
+ iconOnly: false,
245
+ class: "es:px-2"
246
+ },
247
+ {
248
+ size: "small",
249
+ hasIcon: true,
250
+ iconOnly: false,
251
+ class: "es:px-1"
252
+ },
253
+ {
254
+ size: "default",
255
+ iconOnly: false,
256
+ class: "es:h-9 es:min-w-9"
257
+ },
258
+ {
259
+ size: "default",
260
+ iconOnly: true,
261
+ class: "es:size-9"
262
+ },
263
+ {
264
+ size: "default",
265
+ hasIcon: false,
266
+ iconOnly: false,
267
+ class: "es:px-2"
268
+ },
269
+ {
270
+ size: "default",
271
+ hasIcon: true,
272
+ iconOnly: false,
273
+ class: "es:px-1.5"
274
+ },
275
+ {
276
+ size: "large",
277
+ iconOnly: false,
278
+ class: "es:h-10 es:min-w-10"
279
+ },
280
+ {
281
+ size: "large",
282
+ iconOnly: true,
283
+ class: "es:size-10"
284
+ },
285
+ {
286
+ size: "large",
287
+ hasIcon: false,
288
+ iconOnly: false,
289
+ class: "es:px-4"
290
+ },
291
+ {
292
+ size: "large",
293
+ hasIcon: true,
294
+ iconOnly: false,
295
+ class: "es:px-2"
296
+ }
297
+ ],
298
+ defaultVariants: {
299
+ disabled: false
300
+ }
187
301
  }
188
- };
302
+ );
189
303
  const component = /* @__PURE__ */ jsxs(
190
304
  $d2b4bc8c273e7be6$export$353f5b6fc5456de1,
191
305
  {
192
306
  onPress,
193
307
  isDisabled: disabled,
194
- className: clsx(
195
- "es-uic-flex es-uic-items-center es-uic-gap-1 es-uic-rounded-md es-uic-transition es-uic-duration-300",
196
- icon && children && "es-uic-justify-start",
197
- icon && !children && "es-uic-justify-center",
198
- !icon && children && "es-uic-justify-center",
199
- !disabled && (((_a = themes[type]) == null ? void 0 : _a.regular) ?? themes.default.regular),
200
- !disabled && (((_b = themes[type]) == null ? void 0 : _b.hover) ?? themes.default.hover),
201
- "disabled:es-uic-shadow-none",
202
- disabled && (((_c = themes[type]) == null ? void 0 : _c.disabled) ?? themes.default.disabled),
203
- "focus:es-uic-outline-none focus-visible:es-uic-outline-none focus-visible:es-uic-ring",
204
- ((_d = themes[type]) == null ? void 0 : _d.focus) ?? themes.default.focus,
205
- icon && !children && sizes[size].iconButton,
206
- children && "es-uic-text-sm",
207
- children && sizes[size].button,
208
- children && icon && sizes[size].iconButtonPadding,
209
- children && !icon && sizes[size].buttonPadding,
210
- "[.es-uic-button-group-h_&:not(:first-child)]:es-uic-rounded-l-none [.es-uic-button-group-h_&:not(:last-child)]:-es-uic-mr-px [.es-uic-button-group-h_&:not(:last-child)]:es-uic-rounded-r-none",
211
- "[.es-uic-button-group-h_div:not(:first-child)_>_&]:es-uic-rounded-l-none [.es-uic-button-group-h_div:not(:last-child)_>_&]:-es-uic-mr-px [.es-uic-button-group-h_div:not(:last-child)_>_&]:es-uic-rounded-r-none",
212
- sizes[size].iconSize,
213
- type === "selected" && 'es-uic-relative es-uic-isolate after:es-uic-absolute after:es-uic-inset-0 after:-es-uic-z-10 after:es-uic-rounded-[0.3125rem] after:es-uic-bg-gradient-to-br after:es-uic-from-teal-100/40 after:es-uic-via-transparent after:es-uic-to-teal-200/50 after:es-uic-opacity-0 after:es-uic-transition-opacity after:es-uic-content-[""]',
214
- type === "selected" && "[.es-uic-button-group-h_&:not(:first-child)]:after:es-uic-rounded-l-none [.es-uic-button-group-h_&:not(:last-child)]:after:es-uic-rounded-r-none",
215
- type === "selected" && "[.es-uic-button-group-h_div:not(:first-child)_>_&]:after:es-uic-rounded-l-none [.es-uic-button-group-h_div:not(:last-child)_>_&]:after:es-uic-rounded-r-none",
216
- "[.es-uic-button-group-v_&:not(:first-child)]:es-uic-rounded-t-none [.es-uic-button-group-v_&:not(:last-child)]:-es-uic-mb-px [.es-uic-button-group-v_&:not(:last-child)]:es-uic-rounded-b-none",
217
- "[.es-uic-button-group-v_div:not(:first-child)_>_&]:es-uic-rounded-t-none [.es-uic-button-group-v_div:not(:last-child)_>_&]:-es-uic-mb-px [.es-uic-button-group-v_div:not(:last-child)_>_&]:es-uic-rounded-b-none",
218
- type === "selected" && "[.es-uic-button-group-v_&:not(:first-child)]:after:es-uic-rounded-t-none [.es-uic-button-group-v_&:not(:last-child)]:after:es-uic-rounded-b-none",
219
- type === "selected" && "[.es-uic-button-group-v_div:not(:first-child)_>_&]:after:es-uic-rounded-t-none [.es-uic-button-group-v_div:not(:last-child)_>_&]:after:es-uic-rounded-b-none",
220
- className
221
- ),
308
+ className: componentClasses({
309
+ disabled,
310
+ hasIcon: Boolean(icon),
311
+ iconOnly: Boolean(icon && !children),
312
+ size,
313
+ type
314
+ }),
222
315
  ref: objRef,
223
316
  "aria-label": ariaLabel,
224
317
  ...other,
@@ -250,27 +343,38 @@ const Button = (props) => {
250
343
  * @param {Object} props - Component props.
251
344
  * @param {string} [props.className] - Classes to pass to the button group container.
252
345
  * @param {boolean} [props.vertical] - If `true`, the buttons are displayed vertically.
346
+ * @param {ButtonGroupType} [props.type='segmented'] - The way the button group is laid out.
253
347
  * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
254
348
  *
255
349
  * @returns {JSX.Element} The ButtonGroup component.
256
350
  *
351
+ * @typedef {'segmented' | 'split'} ButtonGroupType
352
+ *
257
353
  * @example
258
354
  * <ButtonGroup>
259
- * <Button ... />
260
- * <Button ... />
261
- * <Button ... />
355
+ * <Button />
356
+ * <Button />
357
+ * <Button />
262
358
  * </ButtonGroup>
263
359
  *
264
360
  * @preserve
265
361
  */
266
- const ButtonGroup = ({ children, className, vertical, hidden, ...rest }) => {
362
+ const ButtonGroup = ({ children, className, vertical, hidden, type = "segmented", ...rest }) => {
267
363
  if (hidden) {
268
364
  return null;
269
365
  }
270
366
  return /* @__PURE__ */ jsx(
271
367
  $13c3c67164f4d5be$export$4c260019440d418f,
272
368
  {
273
- className: clsx("es-uic-flex", vertical ? "es-uic-button-group-v es-uic-flex-col" : "es-uic-button-group-h", className),
369
+ className: clsx(
370
+ "es:flex",
371
+ vertical && "es:flex-col",
372
+ type === "segmented" && vertical && "es-button-group-v es:-space-y-px!",
373
+ type === "segmented" && !vertical && "es-button-group-h es:-space-x-px!",
374
+ type === "split" && vertical && "es:space-y-1",
375
+ type === "split" && !vertical && "es:space-x-1.5",
376
+ className
377
+ ),
274
378
  orientation: vertical ? "vertical" : "horizontal",
275
379
  ...rest,
276
380
  children
@@ -1,16 +1,16 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { a as $4e85f108e88277b8$export$b085522c77523c51 } from "../../RSPContexts-2lR5GG9p.js";
3
- import { d as $3ef42575df84b30b$export$9d1611c77c2fe928, a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, m as $df56164dff5785e2$export$4338b53315abf666, n as $5dc95899b306f630$export$c9058316764c140e, i as $64fa3d84918910a7$export$ef03459518577ad4, b as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "../../utils-BmaSD6gC.js";
3
+ import { d as $3ef42575df84b30b$export$9d1611c77c2fe928, a as $64fa3d84918910a7$export$29f1550f4b0d4415, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, m as $df56164dff5785e2$export$4338b53315abf666, n as $5dc95899b306f630$export$c9058316764c140e, i as $64fa3d84918910a7$export$ef03459518577ad4, b as $64fa3d84918910a7$export$4d86445c2cf5e3 } from "../../utils-39D0mStj.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$a763b9476acd3eb, c as $e5be200c675c3b3a$export$dad6ae84456c676a } from "../../useFormValidation-BxnASugK.js";
8
- import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "../../usePress-DZ9pn6Jl.js";
9
- import { $ as $d2c8e2b0480f3f34$export$cbe85ee05b554577 } from "../../useToggle-Dq9VpeCd.js";
10
- import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../../useToggleState-DA_b3LG_.js";
11
- import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-Dbj6MsFR.js";
12
- import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-ChK5oW-0.js";
13
- import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "../../VisuallyHidden-D0lsNfi4.js";
7
+ import { $ as $e5be200c675c3b3a$export$fc1a364ae1f3ff10, a as $e93e671b31057976$export$b8473d3665f3a75a, b as $e5be200c675c3b3a$export$a763b9476acd3eb, c as $e5be200c675c3b3a$export$dad6ae84456c676a } from "../../useFormValidation-BWwmZQE2.js";
8
+ import { $ as $f6c31cce2adf654f$export$45712eceda6fad21 } from "../../usePress-rg_OQIGW.js";
9
+ import { $ as $d2c8e2b0480f3f34$export$cbe85ee05b554577 } from "../../useToggle-DzlgBLAJ.js";
10
+ import { $ as $3017fa7ffdddec74$export$8042c6c013fd5226 } from "../../useToggleState-DhSBQxkp.js";
11
+ import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-CGp3guTX.js";
12
+ import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../focusSafely-CiqTTjWy.js";
13
+ import { $ as $5c3e21d68f1c4674$export$439d29a4e110a164 } from "../../VisuallyHidden-ClTQo25k.js";
14
14
  import { c as clsx } from "../../lite-DVmmD_-j.js";
15
15
  import { AnimatedVisibility } from "../animated-visibility/animated-visibility.js";
16
16
  import { icons } from "../../icons/icons.js";
@@ -115,7 +115,7 @@ function $fba3e38d5ca8983f$export$353b32fc6898d37d(props, state, inputRef) {
115
115
  };
116
116
  }
117
117
  const $bc237834342dbd75$export$139c5b8563afc1fc = /* @__PURE__ */ createContext(null);
118
- function $bc237834342dbd75$var$Checkbox(props, ref) {
118
+ const $bc237834342dbd75$export$48513f6b9f8ce62d = /* @__PURE__ */ forwardRef(function Checkbox(props, ref) {
119
119
  let { inputRef: userProvidedInputRef = null, ...otherProps } = props;
120
120
  [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(otherProps, ref, $4e85f108e88277b8$export$b085522c77523c51);
121
121
  let { validationBehavior: formValidationBehavior } = $64fa3d84918910a7$export$fabf2dc03a41866e($d3e0e05bdfcf66bd$export$c24727297075ec6a) || {};
@@ -180,8 +180,7 @@ function $bc237834342dbd75$var$Checkbox(props, ref) {
180
180
  ...$3ef42575df84b30b$export$9d1611c77c2fe928(inputProps, focusProps),
181
181
  ref: inputRef
182
182
  })), renderProps.children);
183
- }
184
- const $bc237834342dbd75$export$48513f6b9f8ce62d = /* @__PURE__ */ forwardRef($bc237834342dbd75$var$Checkbox);
183
+ });
185
184
  /**
186
185
  * A simple checkbox.
187
186
  *
@@ -198,6 +197,7 @@ const $bc237834342dbd75$export$48513f6b9f8ce62d = /* @__PURE__ */ forwardRef($bc
198
197
  * @param {string} [props.className] - Additional classes to add to the checkbox container.
199
198
  * @param {string} [props.labelClassName] - Additional classes to add to the label container.
200
199
  * @param {boolean} [props.alignEnd] - Whether the label should be aligned to the end.
200
+ * @param {boolean} [props.inlineSubtitle] - If `true`, the subtitle is shown after the label instead of below it.
201
201
  * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
202
202
  *
203
203
  * @returns {JSX.Element} The Checkbox component.
@@ -211,7 +211,7 @@ const $bc237834342dbd75$export$48513f6b9f8ce62d = /* @__PURE__ */ forwardRef($bc
211
211
  *
212
212
  * @preserve
213
213
  */
214
- const Checkbox = (props) => {
214
+ const Checkbox2 = (props) => {
215
215
  const {
216
216
  icon,
217
217
  label,
@@ -223,6 +223,7 @@ const Checkbox = (props) => {
223
223
  onChange,
224
224
  className,
225
225
  labelClassName,
226
+ inlineSubtitle,
226
227
  alignEnd,
227
228
  children,
228
229
  hidden,
@@ -231,7 +232,8 @@ const Checkbox = (props) => {
231
232
  if (hidden) {
232
233
  return null;
233
234
  }
234
- return /* @__PURE__ */ jsx(
235
+ const selectedOrIntermediate = checked || indeterminate;
236
+ return /* @__PURE__ */ jsxs(
235
237
  $bc237834342dbd75$export$48513f6b9f8ce62d,
236
238
  {
237
239
  isDisabled: disabled,
@@ -239,16 +241,18 @@ const Checkbox = (props) => {
239
241
  isReadOnly: readOnly,
240
242
  isSelected: checked ?? false,
241
243
  onChange,
242
- className: clsx("es-uic-flex es-uic-w-full es-uic-items-center es-uic-gap-1.5 es-uic-text-sm", className),
244
+ className: clsx("es:group es:flex es:w-full es:items-center es:gap-1.5 es:text-sm", className),
243
245
  ...other,
244
- children: ({ isIndeterminate, isSelected }) => /* @__PURE__ */ jsxs(Fragment, { children: [
246
+ children: [
245
247
  (icon || alignEnd) && (label || subtitle) && /* @__PURE__ */ jsx(
246
248
  RichLabel,
247
249
  {
248
250
  icon,
249
251
  label,
250
252
  subtitle,
251
- className: labelClassName,
253
+ className: clsx("es:ml-1", labelClassName),
254
+ inlineSubtitle,
255
+ fullSizeSubtitle: true,
252
256
  fullWidth: true
253
257
  }
254
258
  ),
@@ -256,25 +260,36 @@ const Checkbox = (props) => {
256
260
  "div",
257
261
  {
258
262
  className: clsx(
259
- "es-uic-flex es-uic-size-5 es-uic-items-center es-uic-justify-center es-uic-rounded-md es-uic-border es-uic-text-gray-600 es-uic-shadow-sm es-uic-transition",
260
- isSelected || indeterminate ? "es-uic-border-teal-600 es-uic-bg-teal-600 es-uic-text-white" : "es-uic-border-gray-300"
263
+ "es:size-5 es:flex es:items-center es:justify-center",
264
+ "es:transition es:cursor-pointer",
265
+ "es:bg-radial es:border es:rounded-md",
266
+ "es:shadow-xs es:inset-ring es:inset-shadow-xs",
267
+ "es:any-focus:outline-hidden es:group-focus-visible:ring-2 es:group-focus-visible:ring-accent-500/50",
268
+ !selectedOrIntermediate && "es:group-focus-visible:border-accent-500",
269
+ !selectedOrIntermediate && "es:border-secondary-300 es:inset-ring-secondary-100 es:inset-shadow-secondary-100/50",
270
+ !selectedOrIntermediate && "es:from-secondary-50 es:to-white es:text-secondary-600 es:hover:text-accent-950",
271
+ !selectedOrIntermediate && "es:hover:inset-shadow-secondary-100 es:hover:to-secondary-100 es:hover:inset-ring-secondary-100",
272
+ selectedOrIntermediate && "es:text-white es:from-accent-500 es:to-accent-600",
273
+ selectedOrIntermediate && "es:shadow-accent-600/30 es:border-accent-700 es:inset-ring es:inset-ring-accent-600 es:inset-shadow-accent-400/75",
274
+ selectedOrIntermediate && "es:group-focus-visible:inset-ring-accent-600 es:group-focus-visible:inset-shadow-xs es:group-focus-visible:inset-shadow-accent-400",
275
+ !alignEnd && subtitle && "es:mb-auto"
261
276
  ),
262
277
  children: [
263
278
  /* @__PURE__ */ jsx(
264
279
  AnimatedVisibility,
265
280
  {
266
281
  transition: "scaleFade",
267
- visible: isIndeterminate,
268
- className: "es-uic-transition-none",
269
- children: /* @__PURE__ */ jsx("div", { className: "es-uic-h-0.5 es-uic-w-3 es-uic-rounded es-uic-bg-white" })
282
+ visible: indeterminate,
283
+ className: "es:transition-none",
284
+ children: /* @__PURE__ */ jsx("div", { className: "es:h-0.5 es:w-3 es:rounded es:bg-white" })
270
285
  }
271
286
  ),
272
287
  /* @__PURE__ */ jsx(
273
288
  AnimatedVisibility,
274
289
  {
275
290
  transition: "scaleRotateFade",
276
- visible: !isIndeterminate && isSelected,
277
- className: "es-uic-transition-none [&>svg]:es-uic-size-3 [&>svg]:es-uic-stroke-[3]",
291
+ visible: !indeterminate && checked,
292
+ className: "es:transition-none es:icon:size-3 es:icon:stroke-3",
278
293
  noInitial: true,
279
294
  children: icons.check
280
295
  }
@@ -287,14 +302,16 @@ const Checkbox = (props) => {
287
302
  {
288
303
  label,
289
304
  subtitle,
290
- className: labelClassName
305
+ className: clsx(subtitle && "es:mt-0.5", "es:ml-0.5 es:*:space-y-0.5", labelClassName),
306
+ inlineSubtitle,
307
+ fullSizeSubtitle: true
291
308
  }
292
309
  ),
293
310
  !(icon || label || subtitle) && children
294
- ] })
311
+ ]
295
312
  }
296
313
  );
297
314
  };
298
315
  export {
299
- Checkbox
316
+ Checkbox2 as Checkbox
300
317
  };
@@ -29,6 +29,7 @@ import { icons } from "../../icons/icons.js";
29
29
  * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
30
30
  * @param {string} [props.tooltip] - If provided, overrides the default tooltip text. If there is no label, the value will still be shown within the tooltip.
31
31
  * @param {string} [props.clearItemLabel] - Label for the "None" item, if `clearable` is enabled.
32
+ * @param {JSX.Element|JSX.Element[]} [props.extraOptions] - If `type` is `menu`, allows passing additional menu items, which will be displayed below the options.
32
33
  *
33
34
  * @returns {JSX.Element} The ColorPicker component.
34
35
  *
@@ -68,6 +69,7 @@ const ColorPicker = (props) => {
68
69
  clearItemLabel = __("None", "eightshift-ui-components"),
69
70
  hidden,
70
71
  tooltip,
72
+ extraOptions,
71
73
  ...rest
72
74
  } = props;
73
75
  if (hidden) {
@@ -115,18 +117,18 @@ const ColorPicker = (props) => {
115
117
  endIcon: /* @__PURE__ */ jsx(
116
118
  ColorSwatch,
117
119
  {
118
- className: "!es-uic-size-5.5",
120
+ className: "es:size-5.5!",
119
121
  color
120
122
  }
121
123
  ),
122
124
  onClick: () => onChange(slug),
123
125
  selected: value === slug,
124
126
  children: [
125
- !showColorCode && name,
127
+ !showColorCode && name.replaceAll("-", " "),
126
128
  showColorCode && /* @__PURE__ */ jsx(
127
129
  RichLabel,
128
130
  {
129
- label: name,
131
+ label: name.replaceAll("-", " "),
130
132
  subtitle: color.toUpperCase()
131
133
  }
132
134
  )
@@ -178,7 +180,7 @@ const ColorPicker = (props) => {
178
180
  icon,
179
181
  label,
180
182
  subtitle,
181
- className: clsx("es-uic-w-full", labelClassName),
183
+ className: clsx("es:w-full", labelClassName),
182
184
  inline: !stacked,
183
185
  children: /* @__PURE__ */ jsxs(
184
186
  Menu,
@@ -188,16 +190,16 @@ const ColorPicker = (props) => {
188
190
  ColorSwatch,
189
191
  {
190
192
  color: currentColor,
191
- className: "!es-uic-size-6 !es-uic-shadow-none"
193
+ className: "es:size-6! es:shadow-none!"
192
194
  }
193
195
  ),
194
- !icon && type !== "default" && /* @__PURE__ */ jsxs("div", { className: "es-uic-relative es-uic-size-6 [&>svg]:es-uic-absolute [&>svg]:es-uic-inset-0 [&>svg]:es-uic-size-full", children: [
196
+ !icon && type !== "default" && /* @__PURE__ */ jsxs("div", { className: "es:relative es:size-6 es:icon:absolute es:icon:inset-0 es:icon:size-full", children: [
195
197
  menuTriggerIcon,
196
198
  /* @__PURE__ */ jsx(
197
199
  ColorSwatch,
198
200
  {
199
201
  color: currentColor,
200
- className: "es-uic-absolute -es-uic-bottom-0.5 es-uic-left-0 !es-uic-h-2 !es-uic-shadow-none"
202
+ className: "es:absolute es:-bottom-0.5 es:left-0 es:h-2! es:shadow-none!"
201
203
  }
202
204
  )
203
205
  ] })
@@ -216,7 +218,7 @@ const ColorPicker = (props) => {
216
218
  {
217
219
  onClick: () => onChange(void 0),
218
220
  selected: typeof value === "undefined",
219
- endIcon: /* @__PURE__ */ jsx(ColorSwatch, { className: "!es-uic-size-5.5" }),
221
+ endIcon: /* @__PURE__ */ jsx(ColorSwatch, { className: "es:size-5.5!" }),
220
222
  children: clearItemLabel
221
223
  }
222
224
  ),
@@ -256,7 +258,9 @@ const ColorPicker = (props) => {
256
258
  },
257
259
  color.slug
258
260
  )) })
259
- ] })
261
+ ] }),
262
+ extraOptions && /* @__PURE__ */ jsx(MenuSeparator, {}),
263
+ extraOptions
260
264
  ]
261
265
  }
262
266
  )
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { $ as $251c695a52d94a8d$export$cae13e90592f246a } from "../../ColorSwatch-Iijp9hzP.js";
3
- import { $ as $799cddbef784668f$export$6e865ea70d7724f } from "../../Color-CZxTZUqH.js";
2
+ import { $ as $251c695a52d94a8d$export$cae13e90592f246a } from "../../ColorSwatch-Dv3Wxdl_.js";
3
+ import { $ as $799cddbef784668f$export$6e865ea70d7724f } from "../../Color-B0HgM8f4.js";
4
4
  import { c as clsx } from "../../lite-DVmmD_-j.js";
5
5
  import { _ as __ } from "../../default-i18n-CM1-Xvzf.js";
6
6
  /**
@@ -46,10 +46,10 @@ const ColorSwatch = (props) => {
46
46
  style: {
47
47
  background: (color || gradient) && backgroundGradient
48
48
  },
49
- className: () => clsx("es-uic-size-6 es-uic-rounded es-uic-border es-uic-border-gray-300 es-uic-shadow-sm", !color && !gradient && "es-uic-bg-white", className),
49
+ className: () => clsx("es:size-6 es:rounded es:border es:border-secondary-300 es:shadow-xs", !color && !gradient && "es:bg-white", className),
50
50
  colorName: !color && !gradient ? __("No color", "eightshift-ui-components") : colorName,
51
51
  color,
52
- children: !color && !gradient && /* @__PURE__ */ jsx("div", { className: "es-uic-m-auto es-uic-h-full es-uic-w-px es-uic-rotate-45 es-uic-rounded es-uic-bg-red-500" })
52
+ children: !color && !gradient && /* @__PURE__ */ jsx("div", { className: "es:m-auto es:h-full es:w-px es:rotate-45 es:rounded es:bg-red-500" })
53
53
  }
54
54
  );
55
55
  };