@eightshift/ui-components 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +27 -0
  2. package/dist/Checkbox-BLcVbhiO.js +178 -0
  3. package/dist/ColorSwatch-Cmlex_kT.js +66 -0
  4. package/dist/FieldError-wtMA4667.js +42 -0
  5. package/dist/FocusScope-1u9yyfIN.js +725 -0
  6. package/dist/Form-Cq3fu75_.js +5 -0
  7. package/dist/GridList-BZPXp3_O.js +1256 -0
  8. package/dist/Group-DyqpTRPe.js +49 -0
  9. package/dist/Input-jsbb4ugq.js +130 -0
  10. package/dist/Label-BPzS-sR7.js +17 -0
  11. package/dist/ListBox-w9gDaJkV.js +4423 -0
  12. package/dist/LiveAnnouncer-IsokfWQ5.js +73 -0
  13. package/dist/NumberFormatter-LzoKy975.js +160 -0
  14. package/dist/RSPContexts-CrNYmadY.js +14 -0
  15. package/dist/Select-49a62830.esm-C-RFtLiD.js +2541 -0
  16. package/dist/SelectionManager-mefd0ThJ.js +2155 -0
  17. package/dist/Separator-DHn0CwdK.js +325 -0
  18. package/dist/Slider-Pyh2V4bY.js +885 -0
  19. package/dist/Text-BM136LvS.js +17 -0
  20. package/dist/VisuallyHidden-BYRI1Lfo.js +51 -0
  21. package/dist/_commonjsHelpers-CUmg6egw.js +6 -0
  22. package/dist/ariaHideOutside-ByKBPHmX.js +113 -0
  23. package/dist/assets/style.css +1 -0
  24. package/dist/button-BkkdyHfJ.js +307 -0
  25. package/dist/components/animated-visibility/animated-visibility.js +7165 -0
  26. package/dist/components/base-control/base-control.js +97 -0
  27. package/dist/components/breakpoint-preview/breakpoint-preview.js +218 -0
  28. package/dist/components/button/button.js +10 -0
  29. package/dist/components/checkbox/checkbox.js +119 -0
  30. package/dist/components/color-pickers/color-picker.js +242 -0
  31. package/dist/components/color-pickers/color-swatch.js +62 -0
  32. package/dist/components/color-pickers/gradient-editor.js +516 -0
  33. package/dist/components/color-pickers/solid-color-picker.js +1633 -0
  34. package/dist/components/component-toggle/component-toggle.js +71 -0
  35. package/dist/components/container-panel/container-panel.js +39 -0
  36. package/dist/components/expandable/expandable.js +144 -0
  37. package/dist/components/input-field/input-field.js +224 -0
  38. package/dist/components/link-input/link-input.js +937 -0
  39. package/dist/components/list-box/list-box.js +152 -0
  40. package/dist/components/matrix-align/matrix-align.js +185 -0
  41. package/dist/components/menu/menu.js +1608 -0
  42. package/dist/components/notice/notice.js +119 -0
  43. package/dist/components/number-picker/number-picker.js +277 -0
  44. package/dist/components/popover/popover.js +9 -0
  45. package/dist/components/radio/radio.js +552 -0
  46. package/dist/components/repeater/repeater-item.js +127 -0
  47. package/dist/components/repeater/repeater.js +248 -0
  48. package/dist/components/responsive/responsive-legacy.js +326 -0
  49. package/dist/components/responsive/responsive.js +499 -0
  50. package/dist/components/responsive-preview/responsive-preview.js +119 -0
  51. package/dist/components/rich-label/rich-label.js +56 -0
  52. package/dist/components/select/async-multi-select.js +144 -0
  53. package/dist/components/select/async-single-select.js +126 -0
  54. package/dist/components/select/custom-select-default-components.js +38 -0
  55. package/dist/components/select/multi-select-components.js +8 -0
  56. package/dist/components/select/multi-select.js +134 -0
  57. package/dist/components/select/react-select-component-wrappers.js +90 -0
  58. package/dist/components/select/shared.js +45 -0
  59. package/dist/components/select/single-select.js +116 -0
  60. package/dist/components/select/styles.js +55 -0
  61. package/dist/components/slider/column-config-slider.js +225 -0
  62. package/dist/components/slider/slider.js +362 -0
  63. package/dist/components/slider/utils.js +45 -0
  64. package/dist/components/spacer/spacer.js +93 -0
  65. package/dist/components/tabs/tabs.js +626 -0
  66. package/dist/components/toggle/switch.js +140 -0
  67. package/dist/components/toggle/toggle.js +58 -0
  68. package/dist/components/toggle-button/toggle-button.js +206 -0
  69. package/dist/components/tooltip/tooltip.js +10 -0
  70. package/dist/context-jMy6xdVq.js +98 -0
  71. package/dist/default-i18n-BhE-OUmt.js +873 -0
  72. package/dist/filterDOMProps-DG2RfOUr.js +30 -0
  73. package/dist/focusSafely-C3K8zAKj.js +743 -0
  74. package/dist/hooks/use-cell-edit-mode.js +35 -0
  75. package/dist/icons/block-icon.js +42 -0
  76. package/dist/icons/generic-color-swatch.js +21 -0
  77. package/dist/icons/icons.js +3636 -0
  78. package/dist/index-Bfb9bWcb.js +28844 -0
  79. package/dist/index-a301f526.esm-Bioi4cGX.js +3576 -0
  80. package/dist/index.js +109 -0
  81. package/dist/intlStrings-CUhoK9EN.js +2484 -0
  82. package/dist/isScrollable-PcyglExV.js +10 -0
  83. package/dist/modifiers.esm-BuJQPI1X.js +31 -0
  84. package/dist/multi-select-components-CjVpCNko.js +3677 -0
  85. package/dist/number-rWqELA8W.js +39 -0
  86. package/dist/popover-Dx3vKXUX.js +1061 -0
  87. package/dist/react-select-async.esm-TFb_ZX6C.js +111 -0
  88. package/dist/react-select.esm-BjRWqf0E.js +15 -0
  89. package/dist/style.js +1 -0
  90. package/dist/textSelection-BosCCRVE.js +89 -0
  91. package/dist/tooltip-CkCndvTI.js +1094 -0
  92. package/dist/useButton-CuG5UzUw.js +74 -0
  93. package/dist/useEvent-DHv-yhOH.js +24 -0
  94. package/dist/useFocusRing-Cc-4eouh.js +41 -0
  95. package/dist/useFocusable-5q1Gek1J.js +81 -0
  96. package/dist/useFormReset-Buc9YJcv.js +23 -0
  97. package/dist/useFormValidationState-BAPPNXic.js +238 -0
  98. package/dist/useHasTabbableChild-D3uUNhJ0.js +37 -0
  99. package/dist/useLabel-CGlkoFG0.js +28 -0
  100. package/dist/useLabels-Dg62M_3P.js +25 -0
  101. package/dist/useListData-BelKu4kx.js +211 -0
  102. package/dist/useListState-Domq0blV.js +137 -0
  103. package/dist/useLocalizedStringFormatter-Prmz0h0A.js +130 -0
  104. package/dist/useNumberFieldState-BLU3uhSR.js +1253 -0
  105. package/dist/useNumberFormatter-BLc2xjZn.js +13 -0
  106. package/dist/usePress-BQgVor4T.js +698 -0
  107. package/dist/useToggle-C9ETOBaZ.js +58 -0
  108. package/dist/useToggleState-DJ_z5E2S.js +21 -0
  109. package/dist/utilities/classnames.js +16 -0
  110. package/dist/utilities/text-helpers.js +79 -0
  111. package/dist/utils-BsiH7-5Y.js +488 -0
  112. package/package.json +71 -0
@@ -0,0 +1,116 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { S as StateManagedSelect$1 } from "../../react-select.esm-BjRWqf0E.js";
3
+ import { CustomSelectDefaultDropdownIndicator, CustomSelectDefaultClearIndicator } from "./custom-select-default-components.js";
4
+ import { getValue, customOnChange } from "./shared.js";
5
+ import { BaseControl } from "../base-control/base-control.js";
6
+ import { eightshiftSelectClasses } from "./styles.js";
7
+ import { c as components } from "../../index-a301f526.esm-Bioi4cGX.js";
8
+ /**
9
+ * Select menu.
10
+ *
11
+ * @component
12
+ * @param {Object} props - Component props.
13
+ * @param {string} [props.icon] - Icon of the component.
14
+ * @param {string} [props.help] - Help text of the component.
15
+ * @param {string} [props.label] - Label of the component.
16
+ * @param {boolean} [props.inline] - Whether the Select menu is displayed inline with the label, to the right.
17
+ * @param {JSX.Element|JSX.Element[]} [props.actions] - Actions to show to the right of the label.
18
+ * @param {string} [props.subtitle] - Subtitle of the component.
19
+ * @param {{label: string, value: string, metadata: Object<string, any>?}[]} props.options - Options to display in the select. `[{ label: string, value: string }]`.
20
+ * @param {string|{label: string, value: string, metadata: Object<string, any>?}} props.value - Current value of the select.
21
+ * @param {Function} props.onChange - Function to call when the value changes.
22
+ * @param {boolean} [props.simpleValue=false] - If `true`, instead of using a `{label: '', value: ''}` value type, a string is used (just the value).
23
+ * @param {boolean} [props.clearable] - Whether the select is clearable.
24
+ * @param {boolean} [props.noSearch] - Whether the search is disabled.
25
+ * @param {boolean} [props.disabled] - Whether the select is disabled.
26
+ * @param {boolean} [props.keepMenuOpenAfterSelect] - Whether the menu stays open after an select.
27
+ * @param {string} [props.placeholder] - Placeholder text to show when no value is selected.
28
+ * @param {JSX.Element} [props.customMenuOption] - If provided, replaces the default item in the dropdown menu (react-select's `components.Option`).
29
+ * @param {JSX.Element} [props.customValueDisplay] - If provided, replaces the default current value display of each selected item (react-select's `components.MultiValue`).
30
+ * @param {JSX.Element} [props.customDropdownArrow] - If provided, replaces the default dropdown arrow indicator.
31
+ * @param {JSX.Element} [props.customClearIndicator] - If provided, replaces the default 'Clear all' button.
32
+ * @param {string} [props.className] - Classes to pass to the select menu.
33
+ *
34
+ * @returns {JSX.Element} The Select component.
35
+ *
36
+ * @example
37
+ * const [value, setValue] = useState(null);
38
+ *
39
+ * const options = [
40
+ * { label: 'Option 1', value: 'option-1' },
41
+ * { label: 'Option 2', value: 'option-2' },
42
+ * { label: 'Option 3', value: 'option-3' },
43
+ * ];
44
+ *
45
+ * <MultiSelect
46
+ * label='Select items'
47
+ * options={loadOptions}
48
+ * value={value}
49
+ * onChange={setValue}
50
+ * />
51
+ *
52
+ * @preserve
53
+ */
54
+ const Select = (props) => {
55
+ const {
56
+ icon,
57
+ help,
58
+ label,
59
+ inline,
60
+ actions,
61
+ subtitle,
62
+ value,
63
+ onChange,
64
+ options,
65
+ simpleValue = false,
66
+ disabled = false,
67
+ noSearch = false,
68
+ clearable = false,
69
+ keepMenuOpenAfterSelect = false,
70
+ placeholder,
71
+ customMenuOption,
72
+ customValueDisplay,
73
+ customDropdownArrow,
74
+ customClearIndicator,
75
+ className,
76
+ ...additionalProps
77
+ } = props;
78
+ return /* @__PURE__ */ jsx(
79
+ BaseControl,
80
+ {
81
+ label,
82
+ icon,
83
+ subtitle,
84
+ actions,
85
+ help,
86
+ inline,
87
+ children: /* @__PURE__ */ jsx(
88
+ StateManagedSelect$1,
89
+ {
90
+ unstyled: true,
91
+ options,
92
+ value: getValue(simpleValue, value, options),
93
+ onChange: (v) => customOnChange(simpleValue, v, onChange),
94
+ closeMenuOnSelect: !keepMenuOpenAfterSelect,
95
+ isClearable: clearable,
96
+ isSearchable: !noSearch,
97
+ isDisabled: disabled,
98
+ className,
99
+ placeholder,
100
+ classNames: eightshiftSelectClasses,
101
+ components: {
102
+ Option: customMenuOption ?? components.Option,
103
+ SingleValue: customValueDisplay ?? components.SingleValue,
104
+ IndicatorSeparator: null,
105
+ DropdownIndicator: customDropdownArrow ?? CustomSelectDefaultDropdownIndicator,
106
+ ClearIndicator: customClearIndicator ?? CustomSelectDefaultClearIndicator
107
+ },
108
+ ...additionalProps
109
+ }
110
+ )
111
+ }
112
+ );
113
+ };
114
+ export {
115
+ Select
116
+ };
@@ -0,0 +1,55 @@
1
+ import { classnames } from "../../utilities/classnames.js";
2
+ const controlStyles = {
3
+ base: "es-uic-border es-uic-rounded-md es-uic-bg-white es-uic-text-sm es-uic-transition es-uic-group es-uic-shadow-sm !es-uic-min-h-10",
4
+ focus: "es-uic-ring es-uic-ring-teal-500 es-uic-ring-opacity-50",
5
+ nonFocus: "es-uic-border-gray-300"
6
+ };
7
+ const placeholderStyles = "es-uic-text-gray-400 es-uic-ml-0.5";
8
+ const selectInputStyles = "focus:es-uic-outline-none [&_input]:!es-uic-shadow-none [&_input:focus]:!es-uic-shadow-none";
9
+ const valueContainerStyles = "es-uic-gap-1 es-uic-ml-1 !es-uic-overflow-visible";
10
+ const singleValueStyles = "es-uic-ml-0.5";
11
+ const multiValueStyles = classnames(
12
+ "es-uic-bg-gray-100 es-uic-rounded es-uic-p-1 es-uic-border es-uic-border-gray-100 es-uic-hover:border-gray-300 es-uic-items-center es-uic-gap-1.5 es-uic-transition es-uic-overflow-visible",
13
+ "[:focus-visible_&]:es-uic-outline-none [:focus-visible_&]:es-uic-ring",
14
+ "[:focus-visible_&]:es-uic-ring-teal-500 [:focus-visible_&]:es-uic-ring-opacity-50"
15
+ );
16
+ const multiValueLabelStyles = "es-uic-select-none";
17
+ const multiValueRemoveStyles = "hover:es-uic-bg-red-500/15 hover:es-uic-text-red-900 es-uic-text-gray-500 es-uic-rounded es-uic-p-0.5 [&>svg]:es-uic-size-3.5 [&>svg]:es-uic-stroke-[1.5] es-uic-transition";
18
+ const clearIndicatorStyles = "es-uic-text-gray-500 es-uic-p-1 es-uic-rounded-md es-uic-hover:bg-red-50 es-uic-hover:text-red-800 es-uic-transition";
19
+ const dropdownIndicatorStyles = "es-uic-text-gray-500 es-uic-px-1 group-hover:es-uic-text-black [&>svg]:es-uic-transition-transform [&>svg]:es-uic-duration-500 [&>svg]:es-uic-size-5.5";
20
+ const menuStyles = "es-uic-rounded-md es-uic-border es-uic-border-gray-200 es-uic-bg-white es-uic-shadow-lg es-uic-mt-1 es-uic-text-sm es-uic-overflow-x-hidden";
21
+ const optionStyles = {
22
+ base: "es-uic-p-2 !es-uic-flex es-uic-items-center es-uic-gap-1.5 es-uic-text-gray-800 es-uic-rounded [&>svg]:es-uic-size-5 [&>svg]:es-uic-text-gray-500 es-uic-transition es-uic-mx-1 first:es-uic-mt-1 last:es-uic-mb-1 !es-uic-w-auto es-uic-min-h-9",
23
+ focus: "es-uic-bg-gray-100 active:es-uic-bg-teal-700/15",
24
+ selected: "es-uic-bg-teal-600/15 es-uic-text-teal-950"
25
+ };
26
+ const noOptionsMessageStyles = "es-uic-text-gray-400 es-uic-p-4";
27
+ const groupHeadingStyles = "es-uic-ml-3 es-uic-mt-2 es-uic-text-gray-500 es-uic-empty:hidden";
28
+ const groupStyles = "es-uic-border-b last:es-uic-border-b-0";
29
+ const eightshiftSelectClasses = {
30
+ clearIndicator: () => clearIndicatorStyles,
31
+ control: ({ isFocused }) => classnames(
32
+ isFocused ? controlStyles.focus : controlStyles.nonFocus,
33
+ controlStyles.base
34
+ ),
35
+ dropdownIndicator: () => dropdownIndicatorStyles,
36
+ group: () => groupStyles,
37
+ groupHeading: () => groupHeadingStyles,
38
+ input: () => selectInputStyles,
39
+ menu: () => menuStyles,
40
+ multiValue: () => multiValueStyles,
41
+ multiValueLabel: () => multiValueLabelStyles,
42
+ multiValueRemove: () => multiValueRemoveStyles,
43
+ noOptionsMessage: () => noOptionsMessageStyles,
44
+ option: ({ isFocused, isSelected }) => classnames(
45
+ isFocused && optionStyles.focus,
46
+ isSelected && optionStyles.selected,
47
+ optionStyles.base
48
+ ),
49
+ placeholder: () => placeholderStyles,
50
+ singleValue: () => singleValueStyles,
51
+ valueContainer: () => valueContainerStyles
52
+ };
53
+ export {
54
+ eightshiftSelectClasses
55
+ };
@@ -0,0 +1,225 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-BPzS-sR7.js";
3
+ import { $ as $6f909507e6374d18$export$472062a354075cee, a as $6f909507e6374d18$export$105594979f116971, b as $6f909507e6374d18$export$2c1b491743890dec, c as $6f909507e6374d18$export$a590f758a961cb5b } from "../../Slider-Pyh2V4bY.js";
4
+ import { BaseControl } from "../base-control/base-control.js";
5
+ import { classnames } from "../../utilities/classnames.js";
6
+ import { _ as __, s as sprintf, a as _n } from "../../default-i18n-BhE-OUmt.js";
7
+ import { icons } from "../../icons/icons.js";
8
+ /**
9
+ * A two-thumb slider for selecting a range of columns.
10
+ *
11
+ * @component
12
+ * @param {Object} props - Component props.
13
+ * @param {JSX.Element} [props.icon] - Icon to display within the slider.
14
+ * @param {string} [props.help] - The help text shown below the slider.
15
+ * @param {string} [props.label] - The label of the slider.
16
+ * @param {JSX.Element|JSX.Element[]} [props.actions] - Actions to display next to the label.
17
+ * @param {string} [props.subtitle] - The subtitle of the slider.
18
+ * @param {Number} [props.columns=12] - Number of columns.
19
+ * @param {boolean} [props.disableWidth] - If `true`, the width thumb is disabled.
20
+ * @param {boolean} [props.disableOffset] - If `true`, the offset thumb is disabled.
21
+ * @param {boolean} [props.showOuterAsGutter] - If `true`, the outer columns are displayed with a special icons instead of the column numbers. Other numbers are offset by 1.
22
+ * @param {Number | Number[]} props.value - The current value of the slider.
23
+ * @param {Function} props.onChange - Function to run when the value changes.
24
+ * @param {Function} props.onChangeEnd - Function to run when the value change ends.
25
+ * @param {boolean} [props.disabled] - If `true`, the slider is disabled.
26
+ * @param {string} [props.labelClassName] - Additional classes to pass to the label.
27
+ *
28
+ * @returns {JSX.Element} The ColumnConfigSlider component.
29
+ *
30
+ * @example
31
+ * <ColumnConfigSlider
32
+ * label='My slider'
33
+ * value={sliderValue}
34
+ * onChange={setSliderValue}
35
+ * />
36
+ *
37
+ * @preserve
38
+ */
39
+ const ColumnConfigSlider = (props) => {
40
+ const {
41
+ icon,
42
+ help,
43
+ label,
44
+ actions,
45
+ subtitle,
46
+ columns = 12,
47
+ disableWidth,
48
+ disableOffset,
49
+ showOuterAsGutter,
50
+ value,
51
+ onChange,
52
+ onChangeEnd,
53
+ disabled,
54
+ labelClassName,
55
+ ...other
56
+ } = props;
57
+ const markerData = [...Array(columns).keys()];
58
+ const thumbLabels = [__("Offset", "eightshift-ui-components"), __("Width", "eightshift-ui-components")];
59
+ return /* @__PURE__ */ jsx(
60
+ $6f909507e6374d18$export$472062a354075cee,
61
+ {
62
+ value,
63
+ onChange,
64
+ minValue: 1,
65
+ maxValue: columns,
66
+ step: 1,
67
+ isDisabled: disabled,
68
+ orientation: "horizontal",
69
+ className: "es-uic-w-full es-uic-pb-3.5",
70
+ onChangeEnd,
71
+ ...other,
72
+ children: /* @__PURE__ */ jsx(
73
+ BaseControl,
74
+ {
75
+ icon,
76
+ label,
77
+ subtitle,
78
+ help,
79
+ actions: /* @__PURE__ */ jsxs(Fragment, { children: [
80
+ actions,
81
+ /* @__PURE__ */ jsx(ColumnConfigSliderOutput, { showOuterAsGutter })
82
+ ] }),
83
+ labelAs: $01b77f81d0f07f68$export$b04be29aa201d4f5,
84
+ className: labelClassName,
85
+ controlContainerClassName: "es-uic-flex es-uic-items-center es-uic-gap-2.5 !es-uic-space-y-0",
86
+ children: /* @__PURE__ */ jsx(
87
+ $6f909507e6374d18$export$105594979f116971,
88
+ {
89
+ className: "es-uic-isolate es-uic-grid es-uic-h-10 es-uic-w-full es-uic-grid-rows-1",
90
+ style: { gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` },
91
+ children: ({ state }) => {
92
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
93
+ /* @__PURE__ */ jsx(
94
+ "div",
95
+ {
96
+ className: classnames(
97
+ "es-uic-col-span-full es-uic-row-span-1 es-uic-row-start-1 es-uic-h-full es-uic-w-full es-uic-grow es-uic-rounded-md es-uic-border",
98
+ disabled ? "es-uic-border-gray-200 es-uic-bg-white" : "es-uic-border-gray-300 es-uic-bg-gray-50 es-uic-shadow-sm"
99
+ )
100
+ }
101
+ ),
102
+ markerData.slice(0, -1).map((marker) => /* @__PURE__ */ jsx(
103
+ "div",
104
+ {
105
+ className: classnames(
106
+ "es-uic-row-span-1 es-uic-row-start-1 es-uic-h-full es-uic-w-px es-uic-justify-self-center",
107
+ marker >= value[0] - 1 && marker < value[1] ? "es-uic-bg-teal-700/25" : "es-uic-bg-gray-300",
108
+ (marker === value[0] - 2 || marker === value[1] - 1) && "es-uic-hidden"
109
+ ),
110
+ style: { gridColumn: `${marker + 1} / span 2` }
111
+ },
112
+ marker
113
+ )),
114
+ /* @__PURE__ */ jsx(
115
+ "div",
116
+ {
117
+ className: classnames(
118
+ "es-uic-pointer-events-none es-uic-col-start-1 es-uic-row-start-1 es-uic-border",
119
+ "es-uic-h-full es-uic-w-full es-uic-self-center es-uic-rounded-md",
120
+ disabled ? "es-uic-border-gray-200 es-uic-bg-gray-50" : "es-uic-border-teal-500 es-uic-bg-teal-500/30"
121
+ ),
122
+ style: {
123
+ gridColumn: `${value[0]} / span ${value[1] - value[0] + 1}`
124
+ }
125
+ }
126
+ ),
127
+ markerData.map((marker, index) => {
128
+ return /* @__PURE__ */ jsxs(
129
+ "span",
130
+ {
131
+ className: classnames(
132
+ "es-uic-row-span-1 es-uic-row-start-1 es-uic-select-none es-uic-place-self-center es-uic-text-xs es-uic-transition-colors",
133
+ "es-uic-inset-y-0 es-uic-my-auto es-uic-h-fit es-uic-pl-px es-uic-text-center",
134
+ "[&>svg]:es-uic-size-3 [&>svg]:es-uic-stroke-[1.5]",
135
+ marker >= value[0] - 1 && marker < value[1] ? "es-uic-text-teal-700" : "es-uic-text-gray-400"
136
+ ),
137
+ style: { gridColumn: `${index + 1} / span 1` },
138
+ children: [
139
+ showOuterAsGutter && marker === 0 && icons.chevronLeft,
140
+ showOuterAsGutter && marker === columns - 1 && icons.chevronRight,
141
+ showOuterAsGutter && marker > 0 && marker < columns - 1 && marker,
142
+ !showOuterAsGutter && marker + 1
143
+ ]
144
+ },
145
+ marker
146
+ );
147
+ }),
148
+ state.values.map((_, i) => /* @__PURE__ */ jsx(
149
+ $6f909507e6374d18$export$2c1b491743890dec,
150
+ {
151
+ index: i,
152
+ "aria-label": thumbLabels == null ? void 0 : thumbLabels[i],
153
+ isDisabled: i === 0 && disableOffset || i === 1 && disableWidth,
154
+ className: classnames(
155
+ "!es-uic-static es-uic-row-span-1 es-uic-row-start-1 es-uic-h-6 es-uic-w-1.5 es-uic-rounded-full es-uic-border es-uic-transition es-uic-duration-300",
156
+ i === 0 && "!-es-uic-translate-x-1/2 !es-uic-translate-y-0 es-uic-self-center es-uic-justify-self-start",
157
+ i === 1 && "!es-uic-translate-x-1/2 !es-uic-translate-y-0 es-uic-self-center es-uic-justify-self-end",
158
+ "es-uic-shadow dragging:es-uic-bg-teal-600 disabled:es-uic-opacity-0",
159
+ "focus-visible:es-uic-ring focus-visible:es-uic-ring-teal-500 focus-visible:es-uic-ring-opacity-50",
160
+ "es-uic-border-teal-600 es-uic-bg-teal-500 es-uic-shadow-teal-600/50"
161
+ ),
162
+ style: {
163
+ gridColumn: `${state.values[i]} / span 1`
164
+ }
165
+ },
166
+ i
167
+ ))
168
+ ] });
169
+ }
170
+ }
171
+ )
172
+ }
173
+ )
174
+ }
175
+ );
176
+ };
177
+ /**
178
+ * The output for the ColumnConfigSlider component.
179
+ *
180
+ * Meant to be used within the ColumnConfigSlider component, e.g in help or actions.
181
+ *
182
+ * @component
183
+ * @param {Object} props - Component props.
184
+ * @param {boolean} [props.showOuterAsGutter] - If `true`, the outer columns are displayed with a special icons instead of the column numbers. Other numbers are offset by 1.
185
+ *
186
+ * @returns {JSX.Element} The ColumnConfigSliderOutput component.
187
+ *
188
+ * @example
189
+ * <ColumnConfigSliderOutput />
190
+ *
191
+ * @preserve
192
+ */
193
+ const ColumnConfigSliderOutput = ({ showOuterAsGutter }) => /* @__PURE__ */ jsx($6f909507e6374d18$export$a590f758a961cb5b, { className: classnames("es-uic-text-xs es-uic-tabular-nums es-uic-text-gray-600"), children: ({ state }) => {
194
+ const columns = state.getThumbMaxValue(1);
195
+ const offset = parseInt(state.getThumbValueLabel(0));
196
+ const endOffset = parseInt(state.getThumbValueLabel(1));
197
+ const width = endOffset - offset + 1;
198
+ if (offset === 1 && endOffset === columns) {
199
+ return __("Full-width", "eightshift-ui-components");
200
+ }
201
+ if (offset === 1 && endOffset < columns) {
202
+ return sprintf(__("To col %d", "eightshift-ui-components"), showOuterAsGutter ? endOffset - 1 : endOffset);
203
+ }
204
+ if (offset > 1 && endOffset === columns) {
205
+ return sprintf(__("From col %d", "eightshift-ui-components"), showOuterAsGutter ? offset - 1 : offset);
206
+ }
207
+ if (showOuterAsGutter && width === 1 && offset === 1) {
208
+ return __("Start gutter", "eightshift-ui-components");
209
+ }
210
+ if (showOuterAsGutter && endOffset === columns) {
211
+ return __("Start gutter", "eightshift-ui-components");
212
+ }
213
+ if (width === 1) {
214
+ return sprintf(__("Col %d", "eightshift-ui-components"), offset);
215
+ }
216
+ return sprintf(
217
+ _n("%s col from %s", "%s cols from %s", width, "eightshift-ui-components"),
218
+ width,
219
+ showOuterAsGutter ? offset - 1 : offset
220
+ );
221
+ } });
222
+ export {
223
+ ColumnConfigSlider,
224
+ ColumnConfigSliderOutput
225
+ };