@eightshift/ui-components 3.0.1 → 5.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 (144) hide show
  1. package/package.json +101 -101
  2. package/dist/Button-BPLceDeW.js +0 -185
  3. package/dist/Collection-CZxddMZS.js +0 -2332
  4. package/dist/Color-MV5kBVXr.js +0 -2452
  5. package/dist/ColorSwatch-BqQfVu4L.js +0 -64
  6. package/dist/ComboBox-_RfyhwZw.js +0 -1906
  7. package/dist/Dialog-8tYeQ9n4.js +0 -2300
  8. package/dist/FieldError-52GVSGgC.js +0 -42
  9. package/dist/FocusScope-Cri5BFRz.js +0 -831
  10. package/dist/Form-Cq3fu75_.js +0 -5
  11. package/dist/Group-_emcIVxI.js +0 -48
  12. package/dist/Heading-B2153VXe.js +0 -16
  13. package/dist/Hidden-rE6uR-lr.js +0 -41
  14. package/dist/Input-BxpFEIXV.js +0 -133
  15. package/dist/Label-icmbmNdI.js +0 -17
  16. package/dist/List-CZMUbkFU.js +0 -593
  17. package/dist/ListBox-Ca6hiCqz.js +0 -581
  18. package/dist/NumberFormatter-DA8u1Ot7.js +0 -140
  19. package/dist/OverlayArrow-CYXQSlEU.js +0 -629
  20. package/dist/RSPContexts-2lR5GG9p.js +0 -14
  21. package/dist/Select-aab027f3.esm-PDJCDE95.js +0 -2469
  22. package/dist/Separator-4IIDRlV_.js +0 -322
  23. package/dist/Slider-rz2XRMGm.js +0 -853
  24. package/dist/Text-DVSAPY-K.js +0 -16
  25. package/dist/VisuallyHidden-f9zX67a_.js +0 -48
  26. package/dist/_commonjsHelpers-CUmg6egw.js +0 -6
  27. package/dist/assets/index.css +0 -37
  28. package/dist/assets/style-admin.css +0 -5255
  29. package/dist/assets/style-editor.css +0 -5255
  30. package/dist/assets/style.css +0 -5261
  31. package/dist/assets/wp-font-enhancements.css +0 -8
  32. package/dist/assets/wp-ui-enhancements.css +0 -299
  33. package/dist/components/animated-visibility/animated-visibility.js +0 -105
  34. package/dist/components/base-control/base-control.js +0 -86
  35. package/dist/components/breakpoint-preview/breakpoint-preview.js +0 -161
  36. package/dist/components/button/button.js +0 -387
  37. package/dist/components/checkbox/checkbox.js +0 -320
  38. package/dist/components/color-pickers/color-picker.js +0 -272
  39. package/dist/components/color-pickers/color-swatch.js +0 -58
  40. package/dist/components/color-pickers/gradient-editor.js +0 -534
  41. package/dist/components/color-pickers/solid-color-picker.js +0 -1567
  42. package/dist/components/component-toggle/component-toggle.js +0 -158
  43. package/dist/components/container-panel/container-panel.js +0 -131
  44. package/dist/components/draggable/draggable-context.js +0 -5
  45. package/dist/components/draggable/draggable-handle.js +0 -46
  46. package/dist/components/draggable/draggable.js +0 -6207
  47. package/dist/components/draggable-list/draggable-list-context.js +0 -5
  48. package/dist/components/draggable-list/draggable-list-item.js +0 -77
  49. package/dist/components/draggable-list/draggable-list.js +0 -151
  50. package/dist/components/expandable/expandable.js +0 -342
  51. package/dist/components/index.js +0 -137
  52. package/dist/components/input-field/input-field.js +0 -231
  53. package/dist/components/item-collection/item-collection.js +0 -59
  54. package/dist/components/layout/hstack.js +0 -30
  55. package/dist/components/layout/vstack.js +0 -30
  56. package/dist/components/link-input/link-input.js +0 -293
  57. package/dist/components/matrix-align/matrix-align.js +0 -134
  58. package/dist/components/menu/menu.js +0 -285
  59. package/dist/components/modal/modal.js +0 -305
  60. package/dist/components/notice/notice.js +0 -123
  61. package/dist/components/number-picker/number-picker.js +0 -292
  62. package/dist/components/option-select/option-select.js +0 -264
  63. package/dist/components/options-panel/options-panel.js +0 -158
  64. package/dist/components/placeholders/file-placeholder.js +0 -42
  65. package/dist/components/placeholders/image-placeholder.js +0 -88
  66. package/dist/components/placeholders/media-placeholder.js +0 -63
  67. package/dist/components/popover/popover.js +0 -207
  68. package/dist/components/radio/radio.js +0 -579
  69. package/dist/components/repeater/repeater-context.js +0 -5
  70. package/dist/components/repeater/repeater-item.js +0 -119
  71. package/dist/components/repeater/repeater.js +0 -280
  72. package/dist/components/responsive/mini-responsive.js +0 -498
  73. package/dist/components/responsive/responsive-legacy.js +0 -343
  74. package/dist/components/responsive/responsive.js +0 -580
  75. package/dist/components/responsive-preview/responsive-preview.js +0 -123
  76. package/dist/components/rich-label/rich-label.js +0 -66
  77. package/dist/components/select/async-multi-select.js +0 -157
  78. package/dist/components/select/async-single-select.js +0 -137
  79. package/dist/components/select/custom-select-default-components.js +0 -38
  80. package/dist/components/select/multi-select-components.js +0 -8
  81. package/dist/components/select/multi-select.js +0 -151
  82. package/dist/components/select/react-select-component-wrappers.js +0 -90
  83. package/dist/components/select/shared.js +0 -26
  84. package/dist/components/select/single-select.js +0 -131
  85. package/dist/components/select/styles.js +0 -49
  86. package/dist/components/select/v2/async-select.js +0 -297
  87. package/dist/components/select/v2/shared.js +0 -24
  88. package/dist/components/select/v2/single-select.js +0 -990
  89. package/dist/components/slider/column-config-slider.js +0 -210
  90. package/dist/components/slider/slider.js +0 -343
  91. package/dist/components/slider/utils.js +0 -84
  92. package/dist/components/spacer/spacer.js +0 -97
  93. package/dist/components/tabs/tabs.js +0 -702
  94. package/dist/components/toggle/switch.js +0 -155
  95. package/dist/components/toggle/toggle.js +0 -64
  96. package/dist/components/toggle-button/toggle-button.js +0 -324
  97. package/dist/components/tooltip/tooltip.js +0 -525
  98. package/dist/context-D2KUdwNL.js +0 -92
  99. package/dist/default-i18n-CT_oS1Fy.js +0 -922
  100. package/dist/filterDOMProps-EDDcM64A.js +0 -28
  101. package/dist/icons/block-icon.js +0 -42
  102. package/dist/icons/generic-color-swatch.js +0 -113
  103. package/dist/icons/icons.js +0 -30371
  104. package/dist/icons/index.js +0 -11
  105. package/dist/icons/jsx-svg.js +0 -50
  106. package/dist/index-641ee5b8.esm-DIuJijyT.js +0 -3137
  107. package/dist/index-BKGQ6jGS.js +0 -44
  108. package/dist/index-CFozsmNS.js +0 -28321
  109. package/dist/index.js +0 -139
  110. package/dist/lite-DVmmD_-j.js +0 -7
  111. package/dist/modifiers.esm-BuJQPI1X.js +0 -31
  112. package/dist/multi-select-components-Sp-JEFEX.js +0 -3744
  113. package/dist/number-GajL10e1.js +0 -36
  114. package/dist/react-jsx-parser.min-DZCiis5V.js +0 -11753
  115. package/dist/react-select-async.esm-Bql4G5iV.js +0 -107
  116. package/dist/react-select.esm-B_TudhTU.js +0 -15
  117. package/dist/style-admin.js +0 -1
  118. package/dist/style-editor.js +0 -1
  119. package/dist/style.js +0 -1
  120. package/dist/textSelection-0UUS8Yfg.js +0 -46
  121. package/dist/useButton-Cg474OYB.js +0 -71
  122. package/dist/useEvent-B0b-6KBr.js +0 -23
  123. package/dist/useFocusRing-CV5l3lf6.js +0 -107
  124. package/dist/useFormReset-C5OggHsw.js +0 -22
  125. package/dist/useFormValidation-DhDNSjws.js +0 -224
  126. package/dist/useHover-DwDr6ozG.js +0 -900
  127. package/dist/useLabel-D7HkNEHT.js +0 -27
  128. package/dist/useLabels-D8cxd1Z8.js +0 -23
  129. package/dist/useListState-DVr6aYd_.js +0 -161
  130. package/dist/useLocalizedStringFormatter-CFP1YZWQ.js +0 -121
  131. package/dist/useNumberField-TwM0Z9D1.js +0 -1204
  132. package/dist/useNumberFormatter-321rAb4J.js +0 -13
  133. package/dist/usePress-Cucx-xSA.js +0 -664
  134. package/dist/useSingleSelectListState-CMGsRHHh.js +0 -38
  135. package/dist/useToggle-C0I3vs0g.js +0 -59
  136. package/dist/useToggleState-CmQX3SoX.js +0 -19
  137. package/dist/utilities/array-helpers.js +0 -56
  138. package/dist/utilities/debounce-throttle.js +0 -123
  139. package/dist/utilities/es-dash.js +0 -376
  140. package/dist/utilities/index.js +0 -27
  141. package/dist/utilities/text-helpers.js +0 -136
  142. package/dist/utils-DkCSC521.js +0 -370
  143. package/dist/wp/wp-font-enhancements.js +0 -1
  144. package/dist/wp/wp-ui-enhancements.js +0 -1
@@ -1,137 +0,0 @@
1
- import { AnimatedVisibility } from "./animated-visibility/animated-visibility.js";
2
- import { BaseControl } from "./base-control/base-control.js";
3
- import { BreakpointPreview } from "./breakpoint-preview/breakpoint-preview.js";
4
- import { Button, ButtonGroup } from "./button/button.js";
5
- import { Checkbox } from "./checkbox/checkbox.js";
6
- import { ComponentToggle } from "./component-toggle/component-toggle.js";
7
- import { ContainerPanel } from "./container-panel/container-panel.js";
8
- import { ColorSwatch } from "./color-pickers/color-swatch.js";
9
- import { ColorPicker } from "./color-pickers/color-picker.js";
10
- import { ColumnConfigSlider, ColumnConfigSliderOutput } from "./slider/column-config-slider.js";
11
- import { DraggableList } from "./draggable-list/draggable-list.js";
12
- import { DraggableListItem, DraggableListItemHandle } from "./draggable-list/draggable-list-item.js";
13
- import { DraggableContext } from "./draggable/draggable-context.js";
14
- import { Draggable } from "./draggable/draggable.js";
15
- import { DraggableHandle } from "./draggable/draggable-handle.js";
16
- import { Expandable } from "./expandable/expandable.js";
17
- import { FilePlaceholder } from "./placeholders/file-placeholder.js";
18
- import { GradientEditor } from "./color-pickers/gradient-editor.js";
19
- import { HStack } from "./layout/hstack.js";
20
- import { RichLabel } from "./rich-label/rich-label.js";
21
- import { InputField } from "./input-field/input-field.js";
22
- import { ImagePlaceholder } from "./placeholders/image-placeholder.js";
23
- import { ItemCollection } from "./item-collection/item-collection.js";
24
- import { LinkInput } from "./link-input/link-input.js";
25
- import { MatrixAlign } from "./matrix-align/matrix-align.js";
26
- import { MediaPlaceholder } from "./placeholders/media-placeholder.js";
27
- import { Menu, MenuItem, MenuSection, MenuSeparator, SubMenuItem } from "./menu/menu.js";
28
- import { MiniResponsive } from "./responsive/mini-responsive.js";
29
- import { Notice } from "./notice/notice.js";
30
- import { NumberPicker } from "./number-picker/number-picker.js";
31
- import { Popover, TriggeredPopover } from "./popover/popover.js";
32
- import { RadioButton, RadioButtonGroup } from "./radio/radio.js";
33
- import { Repeater } from "./repeater/repeater.js";
34
- import { RepeaterItem } from "./repeater/repeater-item.js";
35
- import { Responsive } from "./responsive/responsive.js";
36
- import { ResponsiveLegacy } from "./responsive/responsive-legacy.js";
37
- import { ResponsivePreview } from "./responsive-preview/responsive-preview.js";
38
- import { AsyncMultiSelect } from "./select/async-multi-select.js";
39
- import { AsyncSelect } from "./select/async-single-select.js";
40
- import { __ExperimentalAsyncSelect } from "./select/v2/async-select.js";
41
- import { __ExperimentalSelect } from "./select/v2/single-select.js";
42
- import { Modal } from "./modal/modal.js";
43
- import { MultiSelect } from "./select/multi-select.js";
44
- import { RSClearIndicator, RSDropdownIndicator, RSMultiValue, RSMultiValueContainer, RSMultiValueLabel, RSMultiValueRemove, RSOption, RSSingleValue } from "./select/react-select-component-wrappers.js";
45
- import { OptionSelect } from "./option-select/option-select.js";
46
- import { OptionsPanel, OptionsPanelHeader, OptionsPanelIntro, OptionsPanelSection } from "./options-panel/options-panel.js";
47
- import { Select } from "./select/single-select.js";
48
- import { Slider } from "./slider/slider.js";
49
- import { SolidColorPicker } from "./color-pickers/solid-color-picker.js";
50
- import { Spacer } from "./spacer/spacer.js";
51
- import { Tab, TabList, TabPanel, Tabs } from "./tabs/tabs.js";
52
- import { Toggle } from "./toggle/toggle.js";
53
- import { Switch } from "./toggle/switch.js";
54
- import { ToggleButton } from "./toggle-button/toggle-button.js";
55
- import { DecorativeTooltip, Tooltip } from "./tooltip/tooltip.js";
56
- import { VStack } from "./layout/vstack.js";
57
- export {
58
- AnimatedVisibility,
59
- AsyncMultiSelect,
60
- AsyncSelect,
61
- BaseControl,
62
- BreakpointPreview,
63
- Button,
64
- ButtonGroup,
65
- Checkbox,
66
- ColorPicker,
67
- ColorSwatch,
68
- ColumnConfigSlider,
69
- ColumnConfigSliderOutput,
70
- ComponentToggle,
71
- ContainerPanel,
72
- DecorativeTooltip,
73
- Draggable,
74
- DraggableContext,
75
- DraggableHandle,
76
- DraggableList,
77
- DraggableListItem,
78
- DraggableListItemHandle,
79
- Expandable,
80
- FilePlaceholder,
81
- GradientEditor,
82
- HStack,
83
- ImagePlaceholder,
84
- InputField,
85
- ItemCollection,
86
- LinkInput,
87
- MatrixAlign,
88
- MediaPlaceholder,
89
- Menu,
90
- MenuItem,
91
- MenuSection,
92
- MenuSeparator,
93
- MiniResponsive,
94
- Modal,
95
- MultiSelect,
96
- Notice,
97
- NumberPicker,
98
- OptionSelect,
99
- OptionsPanel,
100
- OptionsPanelHeader,
101
- OptionsPanelIntro,
102
- OptionsPanelSection,
103
- Popover,
104
- RSClearIndicator,
105
- RSDropdownIndicator,
106
- RSMultiValue,
107
- RSMultiValueContainer,
108
- RSMultiValueLabel,
109
- RSMultiValueRemove,
110
- RSOption,
111
- RSSingleValue,
112
- RadioButton,
113
- RadioButtonGroup,
114
- Repeater,
115
- RepeaterItem,
116
- Responsive,
117
- ResponsiveLegacy,
118
- ResponsivePreview,
119
- RichLabel,
120
- Select,
121
- Slider,
122
- SolidColorPicker,
123
- Spacer,
124
- SubMenuItem,
125
- Switch,
126
- Tab,
127
- TabList,
128
- TabPanel,
129
- Tabs,
130
- Toggle,
131
- ToggleButton,
132
- Tooltip,
133
- TriggeredPopover,
134
- VStack,
135
- __ExperimentalAsyncSelect,
136
- __ExperimentalSelect
137
- };
@@ -1,231 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { a as $3985021b0ad6602f$export$37fb8590cf2c088c, b as $2d73ec29415bd339$export$712718f7aec83d5, $ as $3985021b0ad6602f$export$f5b8910cec6cf069 } from "../../Input-BxpFEIXV.js";
3
- import { a as $01b77f81d0f07f68$export$75b6ee27786ba447, $ as $01b77f81d0f07f68$export$b04be29aa201d4f5 } from "../../Label-icmbmNdI.js";
4
- import { a as $64fa3d84918910a7$export$29f1550f4b0d4415, b as $64fa3d84918910a7$export$4d86445c2cf5e3, d as $3ef42575df84b30b$export$9d1611c77c2fe928, $ as $64fa3d84918910a7$export$fabf2dc03a41866e, g as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, h as $64fa3d84918910a7$export$ef03459518577ad4, i as $64fa3d84918910a7$export$2881499e37b75b9a } from "../../utils-DkCSC521.js";
5
- import React__default, { forwardRef, createContext, useRef, useState, useCallback } from "react";
6
- import { $ as $6179b936705e76d3$export$ae780daf29e6d456 } from "../../useHover-DwDr6ozG.js";
7
- import { $ as $f7dceffc5ad7768b$export$4e328f61c538687f } from "../../useFocusRing-CV5l3lf6.js";
8
- import { $ as $ee014567cb39d3f0$export$ff05c3ac10437e03 } from "../../FieldError-52GVSGgC.js";
9
- import { $ as $d3e0e05bdfcf66bd$export$c24727297075ec6a } from "../../Form-Cq3fu75_.js";
10
- import { a as $514c0188e459b4c0$export$9afb8bc826b033ea } from "../../Text-DVSAPY-K.js";
11
- import { $ as $f39a9eba43920ace$export$86427a43e3e48ebb } from "../../Hidden-rE6uR-lr.js";
12
- import { $ as $65484d02dcb7eb3e$export$457c3d6518dd4c6f } from "../../filterDOMProps-EDDcM64A.js";
13
- import { BaseControl } from "../base-control/base-control.js";
14
- import { c as clsx } from "../../lite-DVmmD_-j.js";
15
- const $216918bed6669f72$export$2dc6166a7e65358c = /* @__PURE__ */ createContext({});
16
- let $216918bed6669f72$var$filterHoverProps = (props) => {
17
- let { onHoverStart, onHoverChange, onHoverEnd, ...otherProps } = props;
18
- return otherProps;
19
- };
20
- const $216918bed6669f72$export$f5c9f3c2c4054eec = /* @__PURE__ */ forwardRef(function TextArea(props, ref) {
21
- [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $216918bed6669f72$export$2dc6166a7e65358c);
22
- let { hoverProps, isHovered } = $6179b936705e76d3$export$ae780daf29e6d456(props);
23
- let { isFocused, isFocusVisible, focusProps } = $f7dceffc5ad7768b$export$4e328f61c538687f({
24
- isTextInput: true,
25
- autoFocus: props.autoFocus
26
- });
27
- let isInvalid = !!props["aria-invalid"] && props["aria-invalid"] !== "false";
28
- let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
29
- ...props,
30
- values: {
31
- isHovered,
32
- isFocused,
33
- isFocusVisible,
34
- isDisabled: props.disabled || false,
35
- isInvalid
36
- },
37
- defaultClassName: "react-aria-TextArea"
38
- });
39
- return /* @__PURE__ */ React__default.createElement("textarea", {
40
- ...$3ef42575df84b30b$export$9d1611c77c2fe928($216918bed6669f72$var$filterHoverProps(props), focusProps, hoverProps),
41
- ...renderProps,
42
- ref,
43
- "data-focused": isFocused || void 0,
44
- "data-disabled": props.disabled || void 0,
45
- "data-hovered": isHovered || void 0,
46
- "data-focus-visible": isFocusVisible || void 0,
47
- "data-invalid": isInvalid || void 0
48
- });
49
- });
50
- const $bcdf0525bf22703d$export$2129e27b3ef0d483 = /* @__PURE__ */ createContext(null);
51
- const $bcdf0525bf22703d$export$2c73285ae9390cec = /* @__PURE__ */ $f39a9eba43920ace$export$86427a43e3e48ebb(function TextField(props, ref) {
52
- [props, ref] = $64fa3d84918910a7$export$29f1550f4b0d4415(props, ref, $bcdf0525bf22703d$export$2129e27b3ef0d483);
53
- let { validationBehavior: formValidationBehavior } = $64fa3d84918910a7$export$fabf2dc03a41866e($d3e0e05bdfcf66bd$export$c24727297075ec6a) || {};
54
- var _props_validationBehavior, _ref;
55
- let validationBehavior = (_ref = (_props_validationBehavior = props.validationBehavior) !== null && _props_validationBehavior !== void 0 ? _props_validationBehavior : formValidationBehavior) !== null && _ref !== void 0 ? _ref : "native";
56
- let inputRef = useRef(null);
57
- let [inputContextProps, mergedInputRef] = $64fa3d84918910a7$export$29f1550f4b0d4415({}, inputRef, $3985021b0ad6602f$export$37fb8590cf2c088c);
58
- let [labelRef, label] = $64fa3d84918910a7$export$9d4c57ee4c6ffdd8(!props["aria-label"] && !props["aria-labelledby"]);
59
- let [inputElementType, setInputElementType] = useState("input");
60
- let { labelProps, inputProps, descriptionProps, errorMessageProps, ...validation } = $2d73ec29415bd339$export$712718f7aec83d5({
61
- ...$64fa3d84918910a7$export$ef03459518577ad4(props),
62
- inputElementType,
63
- label,
64
- validationBehavior
65
- }, mergedInputRef);
66
- let inputOrTextAreaRef = useCallback((el) => {
67
- mergedInputRef.current = el;
68
- if (el) setInputElementType(el instanceof HTMLTextAreaElement ? "textarea" : "input");
69
- }, [
70
- mergedInputRef
71
- ]);
72
- let renderProps = $64fa3d84918910a7$export$4d86445c2cf5e3({
73
- ...props,
74
- values: {
75
- isDisabled: props.isDisabled || false,
76
- isInvalid: validation.isInvalid,
77
- isReadOnly: props.isReadOnly || false,
78
- isRequired: props.isRequired || false
79
- },
80
- defaultClassName: "react-aria-TextField"
81
- });
82
- let DOMProps = $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props);
83
- delete DOMProps.id;
84
- return /* @__PURE__ */ React__default.createElement("div", {
85
- ...DOMProps,
86
- ...renderProps,
87
- ref,
88
- slot: props.slot || void 0,
89
- "data-disabled": props.isDisabled || void 0,
90
- "data-invalid": validation.isInvalid || void 0,
91
- "data-readonly": props.isReadOnly || void 0,
92
- "data-required": props.isRequired || void 0
93
- }, /* @__PURE__ */ React__default.createElement($64fa3d84918910a7$export$2881499e37b75b9a, {
94
- values: [
95
- [
96
- $01b77f81d0f07f68$export$75b6ee27786ba447,
97
- {
98
- ...labelProps,
99
- ref: labelRef
100
- }
101
- ],
102
- [
103
- $3985021b0ad6602f$export$37fb8590cf2c088c,
104
- {
105
- ...$3ef42575df84b30b$export$9d1611c77c2fe928(inputProps, inputContextProps),
106
- ref: inputOrTextAreaRef
107
- }
108
- ],
109
- [
110
- $216918bed6669f72$export$2dc6166a7e65358c,
111
- {
112
- ...inputProps,
113
- ref: inputOrTextAreaRef
114
- }
115
- ],
116
- [
117
- $514c0188e459b4c0$export$9afb8bc826b033ea,
118
- {
119
- slots: {
120
- description: descriptionProps,
121
- errorMessage: errorMessageProps
122
- }
123
- }
124
- ],
125
- [
126
- $ee014567cb39d3f0$export$ff05c3ac10437e03,
127
- validation
128
- ]
129
- ]
130
- }, renderProps.children));
131
- });
132
- /**
133
- * An input field.
134
- *
135
- * @component
136
- * @param {Object} props - Component props.
137
- * @param {JSX.Element} [props.icon] - Icon to display in the label.
138
- * @param {string} [props.label] - Label to display.
139
- * @param {string} [props.subtitle] - Subtitle to display.
140
- * @param {string} [props.help] - Help text to display below the input.
141
- * @param {JSX.Element|JSX.Element[]} [props.actions] - Actions to display to the right of the label.
142
- * @param {boolean} [props.inline] - Whether the element menu is displayed inline with the label, to the right of it.
143
- * @param {string} [props.value] - The current value of the input.
144
- * @param {Function} [props.onChange] - Function to run when the input value changes.
145
- * @param {InputType} [props.type='text'] - The input type. Renders a `<textarea>` instead of `<input>` if set to 'multiline'.
146
- * @param {boolean} [props.disabled] - If `true`, the input is disabled.
147
- * @param {boolean} [props.readOnly] - If `true`, the input is read-only.
148
- * @param {string} [props.className] - Classes to pass to the input field.
149
- * @param {string} [props.wrapperClassName] - Classes to pass to the input field wrapping element.
150
- * @param {boolean} [props.monospaceFont] - If `true`, the input uses a monospace font. Useful for things like IDs to make them easier to read.
151
- * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
152
- *
153
- * @returns {JSX.Element} The InputField component.
154
- *
155
- * @typedef {'text' | 'search' | 'url' | 'tel' | 'email' | 'password' | 'multiline'} InputType
156
- *
157
- * @example
158
- * <InputField
159
- * label='My input'
160
- * value={inputValue}
161
- * onChange={setInputValue}
162
- * />
163
- *
164
- * @preserve
165
- */
166
- const InputField = (props) => {
167
- const { icon, label, subtitle, help, actions, inline, value, onChange, type = "text", disabled, readOnly, className, wrapperClassName, hidden, monospaceFont, ...other } = props;
168
- if (hidden) {
169
- return null;
170
- }
171
- return /* @__PURE__ */ jsx(
172
- $bcdf0525bf22703d$export$2c73285ae9390cec,
173
- {
174
- value: value ?? "",
175
- onChange,
176
- isDisabled: disabled,
177
- isReadOnly: readOnly,
178
- className: wrapperClassName,
179
- ...other,
180
- children: /* @__PURE__ */ jsxs(
181
- BaseControl,
182
- {
183
- icon,
184
- label,
185
- subtitle,
186
- actions,
187
- inline,
188
- labelAs: $01b77f81d0f07f68$export$b04be29aa201d4f5,
189
- help,
190
- children: [
191
- type !== "multiline" && /* @__PURE__ */ jsx(
192
- $3985021b0ad6602f$export$f5b8910cec6cf069,
193
- {
194
- ...other,
195
- type,
196
- className: clsx(
197
- "es:min-h-10 es:w-full es:rounded-lg es:border es:border-secondary-300 es:p-2 es:text-sm es:shadow-xs es:transition es:selection:bg-accent-500/20 es:selection:text-accent-950",
198
- "es:any-focus:outline-hidden",
199
- "es:focus-visible:ring-2 es:focus-visible:ring-accent-500/50",
200
- "es:focus-visible:border-accent-500",
201
- "es:inset-ring es:inset-ring-secondary-100",
202
- "es:disabled:shadow-none! es:disabled:border-secondary-200 es:disabled:bg-secondary-50 es:disabled:text-secondary-500 es:disabled:cursor-default es:readonly:bg-secondary-50",
203
- (monospaceFont || type === "password") && "es:font-mono",
204
- className
205
- )
206
- }
207
- ),
208
- type === "multiline" && /* @__PURE__ */ jsx(
209
- $216918bed6669f72$export$f5c9f3c2c4054eec,
210
- {
211
- ...other,
212
- className: clsx(
213
- "es:min-h-10 es:w-full es:rounded-lg es:border es:border-secondary-300 es:p-2 es:text-sm es:shadow-xs es:transition es:selection:bg-accent-500/20 es:selection:text-accent-950",
214
- "es:any-focus:outline-hidden",
215
- "es:focus-visible:ring-2 es:focus-visible:ring-accent-500/50",
216
- "es:focus-visible:border-accent-500",
217
- "es:inset-ring es:inset-ring-secondary-100",
218
- "es:disabled:shadow-none! es:disabled:border-secondary-200 es:disabled:bg-secondary-50 es:disabled:text-secondary-500 es:disabled:cursor-default es:readonly:bg-secondary-50",
219
- className
220
- )
221
- }
222
- )
223
- ]
224
- }
225
- )
226
- }
227
- );
228
- };
229
- export {
230
- InputField
231
- };
@@ -1,59 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { Fragment } from "react";
3
- import { _ as __ } from "../../default-i18n-CT_oS1Fy.js";
4
- /**
5
- * A simple component to manage a collection of items.
6
- *
7
- * @component
8
- * @param {Object} props - Component props.
9
- * @param {Object<string, any>[]} props.items - Items to show.
10
- * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
11
- *
12
- * @returns {JSX.Element} The ItemCollection component.
13
- *
14
- * @example
15
- * <ItemCollection
16
- * items={items}
17
- * onChange={setItems}
18
- * >
19
- * {({ title, updateData, deleteItem }) => (
20
- * <div>
21
- * <InputField
22
- * label={__('Title', 'demo')}
23
- * value={title}
24
- * onChange={(title) => updateData({ title })}
25
- * />
26
- * </div>
27
- * )}
28
- * </ItemCollection>
29
- *
30
- * @preserve
31
- */
32
- const ItemCollection = (props) => {
33
- const { children, items: rawItems, onChange, hidden } = props;
34
- if (hidden) {
35
- return null;
36
- }
37
- if (typeof rawItems === "undefined" || rawItems === null || !Array.isArray(rawItems)) {
38
- console.warn(__("ItemCollection: 'items' are not an array or are undefined!", "eightshift-ui-components"));
39
- }
40
- const items = rawItems ?? [];
41
- return items.map((item, index) => /* @__PURE__ */ jsx(Fragment, { children: children({
42
- ...item,
43
- updateData: (newValue) => {
44
- const updated = [...items];
45
- updated[index] = {
46
- ...updated[index],
47
- ...newValue
48
- };
49
- onChange(updated);
50
- },
51
- itemIndex: index,
52
- deleteItem: () => {
53
- onChange([...items].filter((_, i) => i !== index));
54
- }
55
- }) }, index));
56
- };
57
- export {
58
- ItemCollection
59
- };
@@ -1,30 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { c as clsx } from "../../lite-DVmmD_-j.js";
3
- /**
4
- * Allows for stacking elements horizontally, with a gap between them.
5
- *
6
- * @component
7
- * @param {Object} props - Component props.
8
- * @param {boolean} [props.noWrap] - If `true`, the children will not wrap if their size exceeds the container size.
9
- * @param {string} [props.className] - Classes to pass to the component.
10
- * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
11
- *
12
- * @returns {JSX.Element} The HStack component.
13
- *
14
- * @example
15
- * <HStack>
16
- * ...
17
- * </HStack>
18
- *
19
- * @preserve
20
- */
21
- const HStack = (props) => {
22
- const { children, noWrap, className, hidden } = props;
23
- if (hidden) {
24
- return null;
25
- }
26
- return /* @__PURE__ */ jsx("div", { className: clsx("es:flex es:items-center es:gap-x-1.5 es:gap-y-2", !noWrap && "es:flex-wrap", className), children });
27
- };
28
- export {
29
- HStack
30
- };
@@ -1,30 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { c as clsx } from "../../lite-DVmmD_-j.js";
3
- /**
4
- * Allows for stacking elements vertically, with a gap between them.
5
- *
6
- * @component
7
- * @param {Object} props - Component props.
8
- * @param {boolean} [props.noWrap] - If `true`, the children will not wrap if their size exceeds the container size.
9
- * @param {string} [props.className] - Classes to pass to the component.
10
- * @param {boolean} [props.hidden] - If `true`, the component is not rendered.
11
- *
12
- * @returns {JSX.Element} The VStack component.
13
- *
14
- * @example
15
- * <VStack>
16
- * ...
17
- * </VStack>
18
- *
19
- * @preserve
20
- */
21
- const VStack = (props) => {
22
- const { children, noWrap, className, hidden } = props;
23
- if (hidden) {
24
- return null;
25
- }
26
- return /* @__PURE__ */ jsx("div", { className: clsx("es:flex es:flex-col es:gap-x-1.5 es:gap-y-1.5", !noWrap && "es:flex-wrap", className), children });
27
- };
28
- export {
29
- VStack
30
- };