@eightshift/ui-components 5.0.0 → 5.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.
- package/dist/Button-wERNNG0T.js +185 -0
- package/dist/Collection-CKsHTyhc.js +2363 -0
- package/dist/Color-BhgbJF5x.js +2452 -0
- package/dist/ColorSwatch-Bcn6oRSg.js +64 -0
- package/dist/ComboBox-D1LPUwWP.js +1906 -0
- package/dist/Dialog-D190gMbE.js +2298 -0
- package/dist/FieldError-DeUh5Wkw.js +42 -0
- package/dist/FocusScope-C-plSxbS.js +831 -0
- package/dist/Form-Cq3fu75_.js +5 -0
- package/dist/Group-C5iZpSAM.js +48 -0
- package/dist/Heading-D-Pboe4p.js +16 -0
- package/dist/Hidden-rE6uR-lr.js +41 -0
- package/dist/Input--mF4XVE1.js +133 -0
- package/dist/Label-Fp6AwSRn.js +17 -0
- package/dist/List-CZMUbkFU.js +593 -0
- package/dist/ListBox-4oW9kh3R.js +582 -0
- package/dist/NumberFormatter-DA8u1Ot7.js +140 -0
- package/dist/OverlayArrow-BpB9uB_I.js +637 -0
- package/dist/RSPContexts-2lR5GG9p.js +14 -0
- package/dist/Select-aab027f3.esm-BKIJGje-.js +2469 -0
- package/dist/Separator-B88tj5YD.js +323 -0
- package/dist/Slider-CyJzC1bp.js +853 -0
- package/dist/Text-DRpwWot2.js +16 -0
- package/dist/VisuallyHidden-DsKYcRQ_.js +48 -0
- package/dist/_commonjsHelpers-CUmg6egw.js +6 -0
- package/dist/assets/index.css +57 -0
- package/dist/assets/style-admin.css +5864 -0
- package/dist/assets/style-editor.css +5864 -0
- package/dist/assets/style.css +5870 -0
- package/dist/assets/wp-font-enhancements.css +8 -0
- package/dist/assets/wp-ui-enhancements.css +377 -0
- package/dist/components/animated-visibility/animated-visibility.js +105 -0
- package/dist/components/base-control/base-control.js +86 -0
- package/dist/components/breakpoint-preview/breakpoint-preview.js +161 -0
- package/dist/components/button/button.js +387 -0
- package/dist/components/checkbox/checkbox.js +320 -0
- package/dist/components/color-pickers/color-picker.js +272 -0
- package/dist/components/color-pickers/color-swatch.js +59 -0
- package/dist/components/color-pickers/gradient-editor.js +534 -0
- package/dist/components/color-pickers/solid-color-picker.js +1567 -0
- package/dist/components/component-toggle/component-toggle.js +161 -0
- package/dist/components/container-panel/container-panel.js +131 -0
- package/dist/components/draggable/draggable-context.js +5 -0
- package/dist/components/draggable/draggable-handle.js +46 -0
- package/dist/components/draggable/draggable.js +6979 -0
- package/dist/components/draggable-list/draggable-list-context.js +5 -0
- package/dist/components/draggable-list/draggable-list-item.js +77 -0
- package/dist/components/draggable-list/draggable-list.js +151 -0
- package/dist/components/expandable/expandable.js +342 -0
- package/dist/components/index.js +137 -0
- package/dist/components/input-field/input-field.js +231 -0
- package/dist/components/item-collection/item-collection.js +59 -0
- package/dist/components/layout/hstack.js +30 -0
- package/dist/components/layout/vstack.js +30 -0
- package/dist/components/link-input/link-input.js +291 -0
- package/dist/components/matrix-align/matrix-align.js +134 -0
- package/dist/components/menu/menu.js +285 -0
- package/dist/components/modal/modal.js +305 -0
- package/dist/components/notice/notice.js +123 -0
- package/dist/components/number-picker/number-picker.js +292 -0
- package/dist/components/option-select/option-select.js +264 -0
- package/dist/components/options-panel/options-panel.js +158 -0
- package/dist/components/placeholders/file-placeholder.js +42 -0
- package/dist/components/placeholders/image-placeholder.js +88 -0
- package/dist/components/placeholders/media-placeholder.js +63 -0
- package/dist/components/popover/popover.js +207 -0
- package/dist/components/radio/radio.js +579 -0
- package/dist/components/repeater/repeater-context.js +5 -0
- package/dist/components/repeater/repeater-item.js +119 -0
- package/dist/components/repeater/repeater.js +280 -0
- package/dist/components/responsive/mini-responsive.js +498 -0
- package/dist/components/responsive/responsive-legacy.js +343 -0
- package/dist/components/responsive/responsive.js +583 -0
- package/dist/components/responsive-preview/responsive-preview.js +123 -0
- package/dist/components/rich-label/rich-label.js +66 -0
- package/dist/components/select/async-multi-select.js +157 -0
- package/dist/components/select/async-single-select.js +137 -0
- package/dist/components/select/custom-select-default-components.js +38 -0
- package/dist/components/select/multi-select-components.js +8 -0
- package/dist/components/select/multi-select.js +151 -0
- package/dist/components/select/react-select-component-wrappers.js +90 -0
- package/dist/components/select/shared.js +26 -0
- package/dist/components/select/single-select.js +131 -0
- package/dist/components/select/styles.js +49 -0
- package/dist/components/select/v2/async-select.js +297 -0
- package/dist/components/select/v2/shared.js +24 -0
- package/dist/components/select/v2/single-select.js +991 -0
- package/dist/components/slider/column-config-slider.js +210 -0
- package/dist/components/slider/slider.js +345 -0
- package/dist/components/slider/utils.js +94 -0
- package/dist/components/spacer/spacer.js +97 -0
- package/dist/components/tabs/tabs.js +704 -0
- package/dist/components/toggle/switch.js +156 -0
- package/dist/components/toggle/toggle.js +64 -0
- package/dist/components/toggle-button/toggle-button.js +343 -0
- package/dist/components/tooltip/tooltip.js +527 -0
- package/dist/context-BYWrbm1z.js +92 -0
- package/dist/default-i18n-CT_oS1Fy.js +922 -0
- package/dist/filterDOMProps-EDDcM64A.js +28 -0
- package/dist/icons/block-icon.js +42 -0
- package/dist/icons/generic-color-swatch.js +113 -0
- package/dist/icons/icons.js +30371 -0
- package/dist/icons/index.js +11 -0
- package/dist/icons/jsx-svg.js +50 -0
- package/dist/index-641ee5b8.esm-BPU8rMZr.js +3137 -0
- package/dist/index-CFozsmNS.js +28321 -0
- package/dist/index-wl5606BX.js +44 -0
- package/dist/index.js +139 -0
- package/dist/lite-DVmmD_-j.js +7 -0
- package/dist/modifiers.esm-BuJQPI1X.js +31 -0
- package/dist/multi-select-components-Sp-JEFEX.js +3744 -0
- package/dist/number-GajL10e1.js +36 -0
- package/dist/react-jsx-parser.min-DZCiis5V.js +11753 -0
- package/dist/react-select-async.esm-D937XTWW.js +107 -0
- package/dist/react-select.esm-Ciai3aKf.js +15 -0
- package/dist/style-admin.js +1 -0
- package/dist/style-editor.js +1 -0
- package/dist/style.js +1 -0
- package/dist/textSelection-CCcyjiRP.js +46 -0
- package/dist/useButton-BOHxkGQF.js +50 -0
- package/dist/useEvent-D5o_CqDH.js +23 -0
- package/dist/useFocusRing-nMG2uzxS.js +107 -0
- package/dist/useFormReset-DlmRL87g.js +22 -0
- package/dist/useFormValidation-D0_aaK-e.js +224 -0
- package/dist/useHover-VO5tcIli.js +890 -0
- package/dist/useLabel-BKH4fVA4.js +27 -0
- package/dist/useLabels-ntF3rFY0.js +23 -0
- package/dist/useListState-Cq2Nvr-v.js +161 -0
- package/dist/useLocalizedStringFormatter-CGzwx1a0.js +121 -0
- package/dist/useNumberField-C9dmERhP.js +1207 -0
- package/dist/useNumberFormatter-MrRLgvhj.js +13 -0
- package/dist/usePress-DjNo5790.js +677 -0
- package/dist/useSingleSelectListState--r3AAhRj.js +38 -0
- package/dist/useToggle-CQaXLe-O.js +59 -0
- package/dist/useToggleState-C3DLdez5.js +19 -0
- package/dist/utilities/array-helpers.js +56 -0
- package/dist/utilities/debounce-throttle.js +123 -0
- package/dist/utilities/es-dash.js +382 -0
- package/dist/utilities/index.js +27 -0
- package/dist/utilities/text-helpers.js +136 -0
- package/dist/utils-B94NDG0v.js +370 -0
- package/dist/wp/wp-font-enhancements.js +1 -0
- package/dist/wp/wp-ui-enhancements.js +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { c as clsx } from "./utils-B94NDG0v.js";
|
|
2
|
+
const falsyToString = (value) => typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
|
|
3
|
+
const cx = clsx;
|
|
4
|
+
const cva = (base, config) => (props) => {
|
|
5
|
+
var _config_compoundVariants;
|
|
6
|
+
if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
7
|
+
const { variants, defaultVariants } = config;
|
|
8
|
+
const getVariantClassNames = Object.keys(variants).map((variant) => {
|
|
9
|
+
const variantProp = props === null || props === void 0 ? void 0 : props[variant];
|
|
10
|
+
const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
|
|
11
|
+
if (variantProp === null) return null;
|
|
12
|
+
const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
|
|
13
|
+
return variants[variant][variantKey];
|
|
14
|
+
});
|
|
15
|
+
const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param) => {
|
|
16
|
+
let [key, value] = param;
|
|
17
|
+
if (value === void 0) {
|
|
18
|
+
return acc;
|
|
19
|
+
}
|
|
20
|
+
acc[key] = value;
|
|
21
|
+
return acc;
|
|
22
|
+
}, {});
|
|
23
|
+
const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param) => {
|
|
24
|
+
let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
|
|
25
|
+
return Object.entries(compoundVariantOptions).every((param2) => {
|
|
26
|
+
let [key, value] = param2;
|
|
27
|
+
return Array.isArray(value) ? value.includes({
|
|
28
|
+
...defaultVariants,
|
|
29
|
+
...propsWithoutUndefined
|
|
30
|
+
}[key]) : {
|
|
31
|
+
...defaultVariants,
|
|
32
|
+
...propsWithoutUndefined
|
|
33
|
+
}[key] === value;
|
|
34
|
+
}) ? [
|
|
35
|
+
...acc,
|
|
36
|
+
cvClass,
|
|
37
|
+
cvClassName
|
|
38
|
+
] : acc;
|
|
39
|
+
}, []);
|
|
40
|
+
return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
cva as c
|
|
44
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { AnimatedVisibility } from "./components/animated-visibility/animated-visibility.js";
|
|
2
|
+
import { BaseControl } from "./components/base-control/base-control.js";
|
|
3
|
+
import { BreakpointPreview } from "./components/breakpoint-preview/breakpoint-preview.js";
|
|
4
|
+
import { Button, ButtonGroup } from "./components/button/button.js";
|
|
5
|
+
import { Checkbox } from "./components/checkbox/checkbox.js";
|
|
6
|
+
import { ComponentToggle } from "./components/component-toggle/component-toggle.js";
|
|
7
|
+
import { ContainerPanel } from "./components/container-panel/container-panel.js";
|
|
8
|
+
import { ColorSwatch } from "./components/color-pickers/color-swatch.js";
|
|
9
|
+
import { ColorPicker } from "./components/color-pickers/color-picker.js";
|
|
10
|
+
import { ColumnConfigSlider, ColumnConfigSliderOutput } from "./components/slider/column-config-slider.js";
|
|
11
|
+
import { DraggableList } from "./components/draggable-list/draggable-list.js";
|
|
12
|
+
import { DraggableListItem, DraggableListItemHandle } from "./components/draggable-list/draggable-list-item.js";
|
|
13
|
+
import { DraggableContext } from "./components/draggable/draggable-context.js";
|
|
14
|
+
import { Draggable } from "./components/draggable/draggable.js";
|
|
15
|
+
import { DraggableHandle } from "./components/draggable/draggable-handle.js";
|
|
16
|
+
import { Expandable } from "./components/expandable/expandable.js";
|
|
17
|
+
import { FilePlaceholder } from "./components/placeholders/file-placeholder.js";
|
|
18
|
+
import { GradientEditor } from "./components/color-pickers/gradient-editor.js";
|
|
19
|
+
import { HStack } from "./components/layout/hstack.js";
|
|
20
|
+
import { RichLabel } from "./components/rich-label/rich-label.js";
|
|
21
|
+
import { InputField } from "./components/input-field/input-field.js";
|
|
22
|
+
import { ImagePlaceholder } from "./components/placeholders/image-placeholder.js";
|
|
23
|
+
import { ItemCollection } from "./components/item-collection/item-collection.js";
|
|
24
|
+
import { LinkInput } from "./components/link-input/link-input.js";
|
|
25
|
+
import { MatrixAlign } from "./components/matrix-align/matrix-align.js";
|
|
26
|
+
import { MediaPlaceholder } from "./components/placeholders/media-placeholder.js";
|
|
27
|
+
import { Menu, MenuItem, MenuSection, MenuSeparator, SubMenuItem } from "./components/menu/menu.js";
|
|
28
|
+
import { MiniResponsive } from "./components/responsive/mini-responsive.js";
|
|
29
|
+
import { Notice } from "./components/notice/notice.js";
|
|
30
|
+
import { NumberPicker } from "./components/number-picker/number-picker.js";
|
|
31
|
+
import { Popover, TriggeredPopover } from "./components/popover/popover.js";
|
|
32
|
+
import { RadioButton, RadioButtonGroup } from "./components/radio/radio.js";
|
|
33
|
+
import { Repeater } from "./components/repeater/repeater.js";
|
|
34
|
+
import { RepeaterItem } from "./components/repeater/repeater-item.js";
|
|
35
|
+
import { Responsive } from "./components/responsive/responsive.js";
|
|
36
|
+
import { ResponsiveLegacy } from "./components/responsive/responsive-legacy.js";
|
|
37
|
+
import { ResponsivePreview } from "./components/responsive-preview/responsive-preview.js";
|
|
38
|
+
import { AsyncMultiSelect } from "./components/select/async-multi-select.js";
|
|
39
|
+
import { AsyncSelect } from "./components/select/async-single-select.js";
|
|
40
|
+
import { __ExperimentalAsyncSelect } from "./components/select/v2/async-select.js";
|
|
41
|
+
import { __ExperimentalSelect } from "./components/select/v2/single-select.js";
|
|
42
|
+
import { Modal } from "./components/modal/modal.js";
|
|
43
|
+
import { MultiSelect } from "./components/select/multi-select.js";
|
|
44
|
+
import { RSClearIndicator, RSDropdownIndicator, RSMultiValue, RSMultiValueContainer, RSMultiValueLabel, RSMultiValueRemove, RSOption, RSSingleValue } from "./components/select/react-select-component-wrappers.js";
|
|
45
|
+
import { OptionSelect } from "./components/option-select/option-select.js";
|
|
46
|
+
import { OptionsPanel, OptionsPanelHeader, OptionsPanelIntro, OptionsPanelSection } from "./components/options-panel/options-panel.js";
|
|
47
|
+
import { Select } from "./components/select/single-select.js";
|
|
48
|
+
import { Slider } from "./components/slider/slider.js";
|
|
49
|
+
import { SolidColorPicker } from "./components/color-pickers/solid-color-picker.js";
|
|
50
|
+
import { Spacer } from "./components/spacer/spacer.js";
|
|
51
|
+
import { Tab, TabList, TabPanel, Tabs } from "./components/tabs/tabs.js";
|
|
52
|
+
import { Toggle } from "./components/toggle/toggle.js";
|
|
53
|
+
import { Switch } from "./components/toggle/switch.js";
|
|
54
|
+
import { ToggleButton } from "./components/toggle-button/toggle-button.js";
|
|
55
|
+
import { DecorativeTooltip, Tooltip } from "./components/tooltip/tooltip.js";
|
|
56
|
+
import { VStack } from "./components/layout/vstack.js";
|
|
57
|
+
import { getColumnConfigOutputText } from "./components/slider/utils.js";
|
|
58
|
+
export {
|
|
59
|
+
AnimatedVisibility,
|
|
60
|
+
AsyncMultiSelect,
|
|
61
|
+
AsyncSelect,
|
|
62
|
+
BaseControl,
|
|
63
|
+
BreakpointPreview,
|
|
64
|
+
Button,
|
|
65
|
+
ButtonGroup,
|
|
66
|
+
Checkbox,
|
|
67
|
+
ColorPicker,
|
|
68
|
+
ColorSwatch,
|
|
69
|
+
ColumnConfigSlider,
|
|
70
|
+
ColumnConfigSliderOutput,
|
|
71
|
+
ComponentToggle,
|
|
72
|
+
ContainerPanel,
|
|
73
|
+
DecorativeTooltip,
|
|
74
|
+
Draggable,
|
|
75
|
+
DraggableContext,
|
|
76
|
+
DraggableHandle,
|
|
77
|
+
DraggableList,
|
|
78
|
+
DraggableListItem,
|
|
79
|
+
DraggableListItemHandle,
|
|
80
|
+
Expandable,
|
|
81
|
+
FilePlaceholder,
|
|
82
|
+
GradientEditor,
|
|
83
|
+
HStack,
|
|
84
|
+
ImagePlaceholder,
|
|
85
|
+
InputField,
|
|
86
|
+
ItemCollection,
|
|
87
|
+
LinkInput,
|
|
88
|
+
MatrixAlign,
|
|
89
|
+
MediaPlaceholder,
|
|
90
|
+
Menu,
|
|
91
|
+
MenuItem,
|
|
92
|
+
MenuSection,
|
|
93
|
+
MenuSeparator,
|
|
94
|
+
MiniResponsive,
|
|
95
|
+
Modal,
|
|
96
|
+
MultiSelect,
|
|
97
|
+
Notice,
|
|
98
|
+
NumberPicker,
|
|
99
|
+
OptionSelect,
|
|
100
|
+
OptionsPanel,
|
|
101
|
+
OptionsPanelHeader,
|
|
102
|
+
OptionsPanelIntro,
|
|
103
|
+
OptionsPanelSection,
|
|
104
|
+
Popover,
|
|
105
|
+
RSClearIndicator,
|
|
106
|
+
RSDropdownIndicator,
|
|
107
|
+
RSMultiValue,
|
|
108
|
+
RSMultiValueContainer,
|
|
109
|
+
RSMultiValueLabel,
|
|
110
|
+
RSMultiValueRemove,
|
|
111
|
+
RSOption,
|
|
112
|
+
RSSingleValue,
|
|
113
|
+
RadioButton,
|
|
114
|
+
RadioButtonGroup,
|
|
115
|
+
Repeater,
|
|
116
|
+
RepeaterItem,
|
|
117
|
+
Responsive,
|
|
118
|
+
ResponsiveLegacy,
|
|
119
|
+
ResponsivePreview,
|
|
120
|
+
RichLabel,
|
|
121
|
+
Select,
|
|
122
|
+
Slider,
|
|
123
|
+
SolidColorPicker,
|
|
124
|
+
Spacer,
|
|
125
|
+
SubMenuItem,
|
|
126
|
+
Switch,
|
|
127
|
+
Tab,
|
|
128
|
+
TabList,
|
|
129
|
+
TabPanel,
|
|
130
|
+
Tabs,
|
|
131
|
+
Toggle,
|
|
132
|
+
ToggleButton,
|
|
133
|
+
Tooltip,
|
|
134
|
+
TriggeredPopover,
|
|
135
|
+
VStack,
|
|
136
|
+
__ExperimentalAsyncSelect,
|
|
137
|
+
__ExperimentalSelect,
|
|
138
|
+
getColumnConfigOutputText
|
|
139
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
function restrictToBoundingRect(transform, rect, boundingRect) {
|
|
3
|
+
const value = {
|
|
4
|
+
...transform
|
|
5
|
+
};
|
|
6
|
+
if (rect.top + transform.y <= boundingRect.top) {
|
|
7
|
+
value.y = boundingRect.top - rect.top;
|
|
8
|
+
} else if (rect.bottom + transform.y >= boundingRect.top + boundingRect.height) {
|
|
9
|
+
value.y = boundingRect.top + boundingRect.height - rect.bottom;
|
|
10
|
+
}
|
|
11
|
+
if (rect.left + transform.x <= boundingRect.left) {
|
|
12
|
+
value.x = boundingRect.left - rect.left;
|
|
13
|
+
} else if (rect.right + transform.x >= boundingRect.left + boundingRect.width) {
|
|
14
|
+
value.x = boundingRect.left + boundingRect.width - rect.right;
|
|
15
|
+
}
|
|
16
|
+
return value;
|
|
17
|
+
}
|
|
18
|
+
const restrictToParentElement = (_ref) => {
|
|
19
|
+
let {
|
|
20
|
+
containerNodeRect,
|
|
21
|
+
draggingNodeRect,
|
|
22
|
+
transform
|
|
23
|
+
} = _ref;
|
|
24
|
+
if (!draggingNodeRect || !containerNodeRect) {
|
|
25
|
+
return transform;
|
|
26
|
+
}
|
|
27
|
+
return restrictToBoundingRect(transform, draggingNodeRect, containerNodeRect);
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
restrictToParentElement as r
|
|
31
|
+
};
|