@eightshift/ui-components 1.5.0 → 1.6.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.
- package/dist/{Dialog-DSquJZb-.js → Dialog-BdtBguys.js} +1 -1
- package/dist/Heading-DGnF6JDc.js +17 -0
- package/dist/List-Bx2anbX-.js +583 -0
- package/dist/{RSPContexts-DQtGvvpM.js → RSPContexts-2lR5GG9p.js} +2 -2
- package/dist/{Select-49a62830.esm-D8voKavK.js → Select-c7902d94.esm-DtzFQzf-.js} +6 -4
- package/dist/assets/style.css +1 -1
- package/dist/components/animated-visibility/animated-visibility.js +139 -118
- package/dist/components/checkbox/checkbox.js +1 -1
- package/dist/components/color-pickers/color-picker.js +18 -11
- package/dist/components/color-pickers/solid-color-picker.js +1 -1
- package/dist/components/component-toggle/component-toggle.js +44 -4
- package/dist/components/draggable/draggable-handle.js +45 -0
- package/dist/components/draggable/draggable.js +5138 -96
- package/dist/components/draggable-list/draggable-list-item.js +16 -25
- package/dist/components/draggable-list/draggable-list.js +54 -86
- package/dist/components/expandable/expandable.js +63 -40
- package/dist/components/index.js +6 -4
- package/dist/components/link-input/link-input.js +2 -2
- package/dist/components/menu/menu.js +2 -2
- package/dist/components/modal/modal.js +4 -15
- package/dist/components/options-panel/options-panel.js +55 -1
- package/dist/components/popover/popover.js +1 -1
- package/dist/components/repeater/repeater-item.js +76 -27
- package/dist/components/repeater/repeater.js +72 -5110
- package/dist/components/select/async-multi-select.js +1 -1
- package/dist/components/select/async-single-select.js +1 -1
- package/dist/components/select/multi-select.js +1 -1
- package/dist/components/select/single-select.js +1 -1
- package/dist/components/select/styles.js +1 -1
- package/dist/icons/jsx-svg.js +1 -1
- package/dist/index.js +6 -4
- package/dist/{react-jsx-parser.min-CAGfntg1.js → react-jsx-parser.min-sPC96O_U.js} +124 -85
- package/dist/{react-select-async.esm-DY-cP0QK.js → react-select-async.esm-CxA8wpeT.js} +1 -1
- package/dist/{react-select.esm-DNlXj0hV.js → react-select.esm-CeE7o5M9.js} +1 -1
- package/dist/{useMenuTrigger-BbwpSVmh.js → useMenuTrigger-CT2-BFLo.js} +1 -1
- package/package.json +14 -14
- package/dist/components/draggable/draggable-item.js +0 -66
- package/dist/swapy-qb4t7itb.js +0 -3059
|
@@ -6,8 +6,10 @@ import { Switch } from "../toggle/switch.js";
|
|
|
6
6
|
import { TriggeredPopover } from "../popover/popover.js";
|
|
7
7
|
import { ButtonGroup } from "../button/button.js";
|
|
8
8
|
import { ToggleButton } from "../toggle-button/toggle-button.js";
|
|
9
|
+
import { BaseControl } from "../base-control/base-control.js";
|
|
9
10
|
import { Spacer } from "../spacer/spacer.js";
|
|
10
11
|
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
12
|
+
import { AnimatedVisibility } from "../animated-visibility/animated-visibility.js";
|
|
11
13
|
/**
|
|
12
14
|
* A component that provides a nice way to toggle a component on and off, and display its content in an expandable panel.
|
|
13
15
|
*
|
|
@@ -19,8 +21,12 @@ import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
|
19
21
|
* @param {boolean} props.useComponent - Whether the component is used. If `false`, the content is hidden.
|
|
20
22
|
* @param {Function} props.onChange - Function to run when the toggle state changes.
|
|
21
23
|
* @param {boolean} [props.noUseToggle] - If `true`, the toggle is not displayed.
|
|
24
|
+
* @param {boolean} [props.noExpandButton] - If `true`, the expand button is not shown.
|
|
25
|
+
* @param {boolean} [props.noLabel] - If `true`, the label is not shown.
|
|
26
|
+
* @param {boolean} [props.noUseToggle] - If `true`, the toggle is not displayed.
|
|
22
27
|
* @param {boolean} [props.expandButtonDisabled] - If `true`, the expand button is disabled.
|
|
23
28
|
* @param {boolean} [props.controlOnly] - If `true`, only the control is displayed.
|
|
29
|
+
* @param {boolean} [props.hideUseToggleOnExpand] - If `true`, and the component is display in a variant where it can be expanded, the use toggle will hide when the component is expanded.
|
|
24
30
|
* @param {string} [props.contentClassName] - Classes to pass to the content container.
|
|
25
31
|
* @param {ComponentToggleDesign} [props.design='default'] - Design of the component.
|
|
26
32
|
* @param {boolean} [props.hidden] - If `true`, the component is not rendered.
|
|
@@ -48,9 +54,12 @@ const ComponentToggle = (props) => {
|
|
|
48
54
|
subtitle,
|
|
49
55
|
useComponent,
|
|
50
56
|
onChange,
|
|
57
|
+
noLabel,
|
|
51
58
|
noUseToggle,
|
|
52
|
-
|
|
59
|
+
noExpandButton,
|
|
53
60
|
controlOnly,
|
|
61
|
+
expandButtonDisabled,
|
|
62
|
+
hideUseToggleOnExpand,
|
|
54
63
|
contentClassName = "es-uic-space-y-2.5",
|
|
55
64
|
design = "default",
|
|
56
65
|
hidden
|
|
@@ -58,7 +67,7 @@ const ComponentToggle = (props) => {
|
|
|
58
67
|
if (hidden) {
|
|
59
68
|
return null;
|
|
60
69
|
}
|
|
61
|
-
if (controlOnly) {
|
|
70
|
+
if (controlOnly || noLabel && noUseToggle && noExpandButton) {
|
|
62
71
|
return children;
|
|
63
72
|
}
|
|
64
73
|
if (design.startsWith("compact")) {
|
|
@@ -70,7 +79,7 @@ const ComponentToggle = (props) => {
|
|
|
70
79
|
ToggleButton,
|
|
71
80
|
{
|
|
72
81
|
icon: hasIcon && (icon ?? icons.componentGeneric),
|
|
73
|
-
tooltip: hasIcon && label,
|
|
82
|
+
tooltip: hasIcon && !noLabel && label,
|
|
74
83
|
selected: useComponent,
|
|
75
84
|
onChange,
|
|
76
85
|
children: hasLabel && label
|
|
@@ -94,12 +103,43 @@ const ComponentToggle = (props) => {
|
|
|
94
103
|
)
|
|
95
104
|
] });
|
|
96
105
|
}
|
|
106
|
+
if (noExpandButton) {
|
|
107
|
+
return /* @__PURE__ */ jsxs(
|
|
108
|
+
BaseControl,
|
|
109
|
+
{
|
|
110
|
+
icon: icon ?? icons.componentGeneric,
|
|
111
|
+
label: !noLabel && label,
|
|
112
|
+
subtitle,
|
|
113
|
+
actions: !noUseToggle && /* @__PURE__ */ jsx(
|
|
114
|
+
Switch,
|
|
115
|
+
{
|
|
116
|
+
checked: useComponent,
|
|
117
|
+
onChange
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
disabled: !useComponent || expandButtonDisabled,
|
|
121
|
+
children: [
|
|
122
|
+
noUseToggle && children,
|
|
123
|
+
!noUseToggle && /* @__PURE__ */ jsx(
|
|
124
|
+
AnimatedVisibility,
|
|
125
|
+
{
|
|
126
|
+
visible: useComponent,
|
|
127
|
+
className: contentClassName,
|
|
128
|
+
noInitial: true,
|
|
129
|
+
children
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
);
|
|
135
|
+
}
|
|
97
136
|
return /* @__PURE__ */ jsx(
|
|
98
137
|
Expandable,
|
|
99
138
|
{
|
|
100
139
|
icon: icon ?? icons.componentGeneric,
|
|
101
|
-
label,
|
|
140
|
+
label: !noLabel && label,
|
|
102
141
|
subtitle,
|
|
142
|
+
keepActionsOnExpand: !hideUseToggleOnExpand,
|
|
103
143
|
actions: !noUseToggle && /* @__PURE__ */ jsx(
|
|
104
144
|
Switch,
|
|
105
145
|
{
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as clsx } from "../../lite-DVmmD_-j.js";
|
|
3
|
+
import "../../default-i18n-BqWys-1G.js";
|
|
4
|
+
import { DraggableContext } from "./draggable-context.js";
|
|
5
|
+
import { useContext } from "react";
|
|
6
|
+
import { icons } from "../../icons/icons.js";
|
|
7
|
+
import "../../react-jsx-parser.min-sPC96O_U.js";
|
|
8
|
+
/**
|
|
9
|
+
* A Draggable item handle.
|
|
10
|
+
*
|
|
11
|
+
* @component
|
|
12
|
+
* @param {Object} props - Component props.
|
|
13
|
+
* @param {string} [props.className] - Classes to pass to the handle.
|
|
14
|
+
*
|
|
15
|
+
* @returns {JSX.Element} The DraggableHandle component.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* <DraggableHandle />
|
|
19
|
+
*
|
|
20
|
+
* @preserve
|
|
21
|
+
*/
|
|
22
|
+
const DraggableHandle = (props) => {
|
|
23
|
+
const { className, children, ...rest } = props;
|
|
24
|
+
const { handleRef, status } = useContext(DraggableContext);
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
"div",
|
|
27
|
+
{
|
|
28
|
+
className: clsx(
|
|
29
|
+
"es-uic-flex es-uic-h-5 es-uic-w-4 es-uic-cursor-pointer es-uic-items-center es-uic-justify-center es-uic-rounded es-uic-border es-uic-border-gray-200 es-uic-bg-white es-uic-text-gray-400 es-uic-transition",
|
|
30
|
+
"[&>svg]:es-uic-size-4 [&>svg]:es-uic-shrink-0",
|
|
31
|
+
"active:es-uic-border-teal-500/30 active:es-uic-bg-teal-50 active:es-uic-text-teal-500",
|
|
32
|
+
"focus:es-uic-outline-none focus-visible:es-uic-border-teal-500 focus-visible:es-uic-outline-none focus-visible:es-uic-ring focus-visible:es-uic-ring-teal-500 focus-visible:es-uic-ring-opacity-50",
|
|
33
|
+
"hover:es-uic-text-teal-500",
|
|
34
|
+
status === "dragging" && "!es-uic-border-teal-600 !es-uic-bg-teal-500 !es-uic-text-white es-uic-shadow-sm es-uic-shadow-teal-500/30",
|
|
35
|
+
className
|
|
36
|
+
),
|
|
37
|
+
ref: handleRef,
|
|
38
|
+
...rest,
|
|
39
|
+
children: children ?? icons.reorderGrabberV
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
DraggableHandle
|
|
45
|
+
};
|