@povio/ui 3.3.0-rc.4 → 3.3.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/README.md +15 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +55 -206
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
- package/dist/components/buttons/shared/ButtonContent.js +22 -80
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +93 -227
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +84 -202
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +60 -132
- package/dist/components/inputs/DateTime/shared/Calendar.js +139 -339
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +114 -308
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +35 -150
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +95 -229
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +115 -296
- package/dist/components/inputs/DateTime/shared/DateField.js +135 -306
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +140 -338
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
- package/dist/components/inputs/File/FileUpload.js +1 -1
- package/dist/components/inputs/File/InputUpload.js +65 -261
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +48 -180
- package/dist/components/inputs/File/shared/FileUploadContentError.js +95 -265
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +99 -261
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +56 -234
- package/dist/components/inputs/File/shared/ProgressBar.js +15 -102
- package/dist/components/inputs/FormField/FormField.js +34 -47
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +75 -313
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +23 -83
- package/dist/components/inputs/Selection/Select/QuerySelect.js +30 -96
- package/dist/components/inputs/Selection/Select/Select.js +3 -3
- package/dist/components/inputs/Selection/shared/SelectInput.js +1 -0
- package/dist/components/inputs/Selection/shared/SelectListBox.js +51 -163
- package/dist/components/inputs/Selection/shared/useSelectItems.js +48 -108
- package/dist/components/inputs/Skeleton/InputFrame.js +177 -552
- package/dist/components/inputs/TextEditor/TextEditor.js +87 -389
- package/dist/components/inputs/shared/InputClear.js +24 -40
- package/dist/components/navigation/Accordion/Accordion.js +22 -69
- package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
- package/dist/components/navigation/Stepper/Stepper.js +22 -67
- package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +29 -110
- package/dist/components/shared/pagination/Pagination.js +22 -108
- package/dist/components/status/Alert/Alert.js +30 -97
- package/dist/components/table/InfiniteTable.js +16 -67
- package/dist/components/table/Table.d.ts +2 -8
- package/dist/components/table/Table.js +33 -55
- package/dist/components/text/Typography/Typography.js +8 -23
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/theme.context.js +45 -98
- package/dist/config/uiConfig.context.js +8 -39
- package/dist/config/uiOverrides.context.d.ts +0 -1
- package/dist/hooks/useDebounceCallback.js +17 -51
- package/dist/hooks/useFormAutosave.js +33 -120
- package/dist/hooks/useLongPressRepeat.js +20 -55
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -2
- package/package.json +2 -2
- package/dist/components/inputs/FormField/formField.cva.d.ts +0 -11
- package/dist/components/inputs/FormField/formField.cva.js +0 -16
- package/dist/components/table/TableColumnFilterInput.d.ts +0 -9
- package/dist/components/table/TableColumnFilterInput.js +0 -108
- package/dist/components/table/TableColumnFilterPlaceholder.d.ts +0 -5
- package/dist/components/table/TableColumnFilterPlaceholder.js +0 -41
- package/dist/components/table/TableColumnFilterRow.d.ts +0 -16
- package/dist/components/table/TableColumnFilterRow.js +0 -68
package/README.md
CHANGED
|
@@ -8,7 +8,21 @@ UI Components that match Povio's Atlas Design System.
|
|
|
8
8
|
|
|
9
9
|
## Versioning
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
`^2.1` still corresponds to Atlas 2.1. All versions after that currently target Atlas 2.2 and follow semantic versioning — breaking changes bump the major version.
|
|
12
|
+
|
|
13
|
+
## Publishing
|
|
14
|
+
|
|
15
|
+
### Stable release
|
|
16
|
+
|
|
17
|
+
Create a GitHub release with a tag matching `v*.*.*-ui`. This triggers the publish workflow and releases the package to NPM.
|
|
18
|
+
|
|
19
|
+
Example: `v1.2.3-ui`
|
|
20
|
+
|
|
21
|
+
### Release candidate
|
|
22
|
+
|
|
23
|
+
Create and push a git tag matching `v*.*.*-rc.*-ui` (do not use a GitHub release for this). This publishes the package to NPM under the `next` dist-tag.
|
|
24
|
+
|
|
25
|
+
Example: `v1.2.3-rc.1-ui`
|
|
12
26
|
|
|
13
27
|
## Requirements
|
|
14
28
|
|
|
@@ -5,16 +5,12 @@ import { MenuDesktop } from "../Menu/MenuDesktop.js";
|
|
|
5
5
|
import { Typography } from "../text/Typography/Typography.js";
|
|
6
6
|
import { Tooltip as Tooltip$1 } from "../overlays/Tooltip/Tooltip.js";
|
|
7
7
|
import { LinkContext } from "../../config/link.context.js";
|
|
8
|
-
import { c } from "react/compiler-runtime";
|
|
9
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
9
|
import { clsx } from "clsx";
|
|
11
10
|
import { useLayoutEffect, useRef, useState } from "react";
|
|
12
11
|
import { Breadcrumb, Breadcrumbs, Button, Link } from "react-aria-components";
|
|
13
12
|
//#region src/components/Breadcrumbs/Breadcrumbs.tsx
|
|
14
|
-
var Breadcrumbs$1 = (
|
|
15
|
-
const $ = c(58);
|
|
16
|
-
const { items, className, onAction, iconOnly: t1 } = t0;
|
|
17
|
-
const iconOnly = t1 === void 0 ? false : t1;
|
|
13
|
+
var Breadcrumbs$1 = ({ items, className, onAction, iconOnly: iconOnly_0 = false }) => {
|
|
18
14
|
const breadcrumbsCva = UIOverrides.useCva("breadcrumbs.cva", breadcrumbsDefinition);
|
|
19
15
|
const breadcrumbItem = UIOverrides.useCva("breadcrumbs.itemCva", breadcrumbItemDefinition);
|
|
20
16
|
const breadcrumbSegmentCva = UIOverrides.useCva("breadcrumbs.segmentCva", breadcrumbSegmentDefinition);
|
|
@@ -22,61 +18,45 @@ var Breadcrumbs$1 = (t0) => {
|
|
|
22
18
|
const breadcrumbIconCva = UIOverrides.useCva("breadcrumbs.iconCva", breadcrumbIconDefinition);
|
|
23
19
|
const containerRef = useRef(null);
|
|
24
20
|
const [isOverflowing, setIsOverflowing] = useState(items.length <= 2 ? false : null);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return () => resizeObserver.disconnect();
|
|
39
|
-
};
|
|
40
|
-
$[0] = items.length;
|
|
41
|
-
$[1] = t2;
|
|
42
|
-
} else t2 = $[1];
|
|
43
|
-
let t3;
|
|
44
|
-
if ($[2] !== items) {
|
|
45
|
-
t3 = [items];
|
|
46
|
-
$[2] = items;
|
|
47
|
-
$[3] = t3;
|
|
48
|
-
} else t3 = $[3];
|
|
49
|
-
useLayoutEffect(t2, t3);
|
|
21
|
+
useLayoutEffect(() => {
|
|
22
|
+
if (items.length <= 2) {
|
|
23
|
+
setIsOverflowing(false);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const container = containerRef.current;
|
|
27
|
+
if (!container) return;
|
|
28
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
29
|
+
setIsOverflowing(container.scrollWidth > container.clientWidth);
|
|
30
|
+
});
|
|
31
|
+
resizeObserver.observe(container);
|
|
32
|
+
return () => resizeObserver.disconnect();
|
|
33
|
+
}, [items]);
|
|
50
34
|
const isReady = isOverflowing !== null;
|
|
51
35
|
const hiddenItems = items.length > 2 ? items.slice(1, -1) : [];
|
|
52
36
|
const firstItem = items[0];
|
|
53
37
|
const lastItem = items[items.length - 1];
|
|
54
38
|
const LinkComponent = LinkContext.useLinkContext()?.LinkComponent ?? Link;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
className:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
})]
|
|
68
|
-
});
|
|
69
|
-
$[4] = LinkComponent;
|
|
70
|
-
$[5] = breadcrumbIconCva;
|
|
71
|
-
$[6] = breadcrumbItem;
|
|
72
|
-
$[7] = t4;
|
|
73
|
-
} else t4 = $[7];
|
|
74
|
-
const renderBreadcrumbLink = t4;
|
|
39
|
+
const renderBreadcrumbLink = (item, isCurrent, iconOnly) => /* @__PURE__ */ jsxs(LinkComponent, {
|
|
40
|
+
...item.link,
|
|
41
|
+
className: breadcrumbItem({ isCurrent }),
|
|
42
|
+
children: [item.icon && /* @__PURE__ */ jsx(item.icon, {
|
|
43
|
+
className: breadcrumbIconCva({}),
|
|
44
|
+
"aria-label": item.label
|
|
45
|
+
}), !iconOnly && /* @__PURE__ */ jsx(Typography, {
|
|
46
|
+
variant: "default",
|
|
47
|
+
size: "label-3",
|
|
48
|
+
children: item.label
|
|
49
|
+
})]
|
|
50
|
+
});
|
|
75
51
|
if (isOverflowing === true && items.length > 2) {
|
|
76
|
-
const menuItems = hiddenItems.map(
|
|
52
|
+
const menuItems = hiddenItems.map((item_0) => ({
|
|
53
|
+
id: item_0.id,
|
|
54
|
+
label: item_0.label,
|
|
55
|
+
link: item_0.link
|
|
56
|
+
}));
|
|
77
57
|
const renderEllipsis = () => /* @__PURE__ */ jsx(MenuDesktop, {
|
|
78
58
|
trigger: /* @__PURE__ */ jsx(Tooltip$1, {
|
|
79
|
-
text: hiddenItems.map(
|
|
59
|
+
text: hiddenItems.map((i) => i.label).join(", "),
|
|
80
60
|
children: /* @__PURE__ */ jsx(Button, {
|
|
81
61
|
"aria-label": "Show hidden breadcrumbs",
|
|
82
62
|
className: breadcrumbItem({
|
|
@@ -93,171 +73,40 @@ var Breadcrumbs$1 = (t0) => {
|
|
|
93
73
|
items: menuItems,
|
|
94
74
|
onAction: onAction ? (key) => onAction(key) : void 0
|
|
95
75
|
});
|
|
96
|
-
let t5;
|
|
97
|
-
if ($[8] !== breadcrumbsCva || $[9] !== className) {
|
|
98
|
-
t5 = clsx(breadcrumbsCva({}), className);
|
|
99
|
-
$[8] = breadcrumbsCva;
|
|
100
|
-
$[9] = className;
|
|
101
|
-
$[10] = t5;
|
|
102
|
-
} else t5 = $[10];
|
|
103
|
-
const t6 = firstItem.id;
|
|
104
|
-
let t7;
|
|
105
|
-
if ($[11] !== breadcrumbSegmentCva) {
|
|
106
|
-
t7 = breadcrumbSegmentCva({});
|
|
107
|
-
$[11] = breadcrumbSegmentCva;
|
|
108
|
-
$[12] = t7;
|
|
109
|
-
} else t7 = $[12];
|
|
110
|
-
let t8;
|
|
111
|
-
if ($[13] !== firstItem || $[14] !== iconOnly || $[15] !== renderBreadcrumbLink) {
|
|
112
|
-
t8 = renderBreadcrumbLink(firstItem, false, iconOnly);
|
|
113
|
-
$[13] = firstItem;
|
|
114
|
-
$[14] = iconOnly;
|
|
115
|
-
$[15] = renderBreadcrumbLink;
|
|
116
|
-
$[16] = t8;
|
|
117
|
-
} else t8 = $[16];
|
|
118
|
-
let t9;
|
|
119
|
-
if ($[17] !== breadcrumbChevronCva) {
|
|
120
|
-
t9 = breadcrumbChevronCva({});
|
|
121
|
-
$[17] = breadcrumbChevronCva;
|
|
122
|
-
$[18] = t9;
|
|
123
|
-
} else t9 = $[18];
|
|
124
|
-
let t10;
|
|
125
|
-
if ($[19] !== t9) {
|
|
126
|
-
t10 = /* @__PURE__ */ jsx(ChevronRightIcon, { className: t9 });
|
|
127
|
-
$[19] = t9;
|
|
128
|
-
$[20] = t10;
|
|
129
|
-
} else t10 = $[20];
|
|
130
|
-
let t11;
|
|
131
|
-
if ($[21] !== firstItem.id || $[22] !== t10 || $[23] !== t7 || $[24] !== t8) {
|
|
132
|
-
t11 = /* @__PURE__ */ jsxs(Breadcrumb, {
|
|
133
|
-
id: t6,
|
|
134
|
-
className: t7,
|
|
135
|
-
children: [t8, t10]
|
|
136
|
-
});
|
|
137
|
-
$[21] = firstItem.id;
|
|
138
|
-
$[22] = t10;
|
|
139
|
-
$[23] = t7;
|
|
140
|
-
$[24] = t8;
|
|
141
|
-
$[25] = t11;
|
|
142
|
-
} else t11 = $[25];
|
|
143
|
-
let t12;
|
|
144
|
-
if ($[26] !== breadcrumbSegmentCva) {
|
|
145
|
-
t12 = breadcrumbSegmentCva({});
|
|
146
|
-
$[26] = breadcrumbSegmentCva;
|
|
147
|
-
$[27] = t12;
|
|
148
|
-
} else t12 = $[27];
|
|
149
|
-
const t13 = renderEllipsis();
|
|
150
|
-
let t14;
|
|
151
|
-
if ($[28] !== breadcrumbChevronCva) {
|
|
152
|
-
t14 = breadcrumbChevronCva({});
|
|
153
|
-
$[28] = breadcrumbChevronCva;
|
|
154
|
-
$[29] = t14;
|
|
155
|
-
} else t14 = $[29];
|
|
156
|
-
let t15;
|
|
157
|
-
if ($[30] !== t14) {
|
|
158
|
-
t15 = /* @__PURE__ */ jsx(ChevronRightIcon, { className: t14 });
|
|
159
|
-
$[30] = t14;
|
|
160
|
-
$[31] = t15;
|
|
161
|
-
} else t15 = $[31];
|
|
162
|
-
const t16 = lastItem.id;
|
|
163
|
-
let t17;
|
|
164
|
-
if ($[32] !== breadcrumbSegmentCva) {
|
|
165
|
-
t17 = breadcrumbSegmentCva({});
|
|
166
|
-
$[32] = breadcrumbSegmentCva;
|
|
167
|
-
$[33] = t17;
|
|
168
|
-
} else t17 = $[33];
|
|
169
|
-
let t18;
|
|
170
|
-
if ($[34] !== lastItem || $[35] !== renderBreadcrumbLink) {
|
|
171
|
-
t18 = renderBreadcrumbLink(lastItem, true);
|
|
172
|
-
$[34] = lastItem;
|
|
173
|
-
$[35] = renderBreadcrumbLink;
|
|
174
|
-
$[36] = t18;
|
|
175
|
-
} else t18 = $[36];
|
|
176
|
-
let t19;
|
|
177
|
-
if ($[37] !== lastItem.id || $[38] !== t17 || $[39] !== t18) {
|
|
178
|
-
t19 = /* @__PURE__ */ jsx(Breadcrumb, {
|
|
179
|
-
id: t16,
|
|
180
|
-
className: t17,
|
|
181
|
-
children: t18
|
|
182
|
-
});
|
|
183
|
-
$[37] = lastItem.id;
|
|
184
|
-
$[38] = t17;
|
|
185
|
-
$[39] = t18;
|
|
186
|
-
$[40] = t19;
|
|
187
|
-
} else t19 = $[40];
|
|
188
76
|
return /* @__PURE__ */ jsxs(Breadcrumbs, {
|
|
189
77
|
onAction,
|
|
190
|
-
className:
|
|
78
|
+
className: clsx(breadcrumbsCva({}), className),
|
|
191
79
|
children: [
|
|
192
|
-
|
|
80
|
+
/* @__PURE__ */ jsxs(Breadcrumb, {
|
|
81
|
+
id: firstItem.id,
|
|
82
|
+
className: breadcrumbSegmentCva({}),
|
|
83
|
+
children: [renderBreadcrumbLink(firstItem, false, iconOnly_0), /* @__PURE__ */ jsx(ChevronRightIcon, { className: breadcrumbChevronCva({}) })]
|
|
84
|
+
}),
|
|
193
85
|
/* @__PURE__ */ jsxs(Breadcrumb, {
|
|
194
86
|
id: "ellipsis",
|
|
195
|
-
className:
|
|
196
|
-
children: [
|
|
87
|
+
className: breadcrumbSegmentCva({}),
|
|
88
|
+
children: [renderEllipsis(), /* @__PURE__ */ jsx(ChevronRightIcon, { className: breadcrumbChevronCva({}) })]
|
|
197
89
|
}),
|
|
198
|
-
|
|
90
|
+
/* @__PURE__ */ jsx(Breadcrumb, {
|
|
91
|
+
id: lastItem.id,
|
|
92
|
+
className: breadcrumbSegmentCva({}),
|
|
93
|
+
children: renderBreadcrumbLink(lastItem, true)
|
|
94
|
+
})
|
|
199
95
|
]
|
|
200
96
|
});
|
|
201
97
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
const t6 = isReady ? "visible" : "hidden";
|
|
210
|
-
let t7;
|
|
211
|
-
if ($[44] !== t6) {
|
|
212
|
-
t7 = { visibility: t6 };
|
|
213
|
-
$[44] = t6;
|
|
214
|
-
$[45] = t7;
|
|
215
|
-
} else t7 = $[45];
|
|
216
|
-
let t8;
|
|
217
|
-
if ($[46] !== breadcrumbChevronCva || $[47] !== breadcrumbSegmentCva || $[48] !== iconOnly || $[49] !== items[0] || $[50] !== renderBreadcrumbLink) {
|
|
218
|
-
t8 = (item_1) => /* @__PURE__ */ jsx(Breadcrumb, {
|
|
98
|
+
return /* @__PURE__ */ jsx(Breadcrumbs, {
|
|
99
|
+
ref: containerRef,
|
|
100
|
+
items,
|
|
101
|
+
onAction,
|
|
102
|
+
className: clsx(breadcrumbsCva({}), className),
|
|
103
|
+
style: { visibility: isReady ? "visible" : "hidden" },
|
|
104
|
+
children: (item_1) => /* @__PURE__ */ jsx(Breadcrumb, {
|
|
219
105
|
id: item_1.id,
|
|
220
106
|
className: breadcrumbSegmentCva({}),
|
|
221
|
-
children: (
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
$[46] = breadcrumbChevronCva;
|
|
227
|
-
$[47] = breadcrumbSegmentCva;
|
|
228
|
-
$[48] = iconOnly;
|
|
229
|
-
$[49] = items[0];
|
|
230
|
-
$[50] = renderBreadcrumbLink;
|
|
231
|
-
$[51] = t8;
|
|
232
|
-
} else t8 = $[51];
|
|
233
|
-
let t9;
|
|
234
|
-
if ($[52] !== items || $[53] !== onAction || $[54] !== t5 || $[55] !== t7 || $[56] !== t8) {
|
|
235
|
-
t9 = /* @__PURE__ */ jsx(Breadcrumbs, {
|
|
236
|
-
ref: containerRef,
|
|
237
|
-
items,
|
|
238
|
-
onAction,
|
|
239
|
-
className: t5,
|
|
240
|
-
style: t7,
|
|
241
|
-
children: t8
|
|
242
|
-
});
|
|
243
|
-
$[52] = items;
|
|
244
|
-
$[53] = onAction;
|
|
245
|
-
$[54] = t5;
|
|
246
|
-
$[55] = t7;
|
|
247
|
-
$[56] = t8;
|
|
248
|
-
$[57] = t9;
|
|
249
|
-
} else t9 = $[57];
|
|
250
|
-
return t9;
|
|
107
|
+
children: ({ isCurrent: isCurrent_0 }) => /* @__PURE__ */ jsxs(Fragment, { children: [renderBreadcrumbLink(item_1, isCurrent_0, iconOnly_0 && item_1 === items[0]), !isCurrent_0 && /* @__PURE__ */ jsx(ChevronRightIcon, { className: breadcrumbChevronCva({}) })] })
|
|
108
|
+
})
|
|
109
|
+
});
|
|
251
110
|
};
|
|
252
|
-
function _temp(item_0) {
|
|
253
|
-
return {
|
|
254
|
-
id: item_0.id,
|
|
255
|
-
label: item_0.label,
|
|
256
|
-
link: item_0.link
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
function _temp2(i) {
|
|
260
|
-
return i.label;
|
|
261
|
-
}
|
|
262
111
|
//#endregion
|
|
263
112
|
export { Breadcrumbs$1 as Breadcrumbs };
|
|
@@ -1,40 +1,15 @@
|
|
|
1
1
|
import { Button } from "../Button/Button.js";
|
|
2
|
-
import { c } from "react/compiler-runtime";
|
|
3
2
|
import { jsx } from "react/jsx-runtime";
|
|
4
3
|
//#region src/components/buttons/InlineIconButton/InlineIconButton.tsx
|
|
5
|
-
var InlineIconButton = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
$[2] = props;
|
|
15
|
-
$[3] = t1;
|
|
16
|
-
} else {
|
|
17
|
-
label = $[1];
|
|
18
|
-
props = $[2];
|
|
19
|
-
t1 = $[3];
|
|
20
|
-
}
|
|
21
|
-
const size = t1 === void 0 ? "none" : t1;
|
|
22
|
-
let t2;
|
|
23
|
-
if ($[4] !== label || $[5] !== props || $[6] !== size) {
|
|
24
|
-
t2 = /* @__PURE__ */ jsx(Button, {
|
|
25
|
-
...props,
|
|
26
|
-
iconOnly: true,
|
|
27
|
-
variant: "text",
|
|
28
|
-
size,
|
|
29
|
-
width: "hug",
|
|
30
|
-
children: label
|
|
31
|
-
});
|
|
32
|
-
$[4] = label;
|
|
33
|
-
$[5] = props;
|
|
34
|
-
$[6] = size;
|
|
35
|
-
$[7] = t2;
|
|
36
|
-
} else t2 = $[7];
|
|
37
|
-
return t2;
|
|
4
|
+
var InlineIconButton = ({ label, size = "none", ...props }) => {
|
|
5
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
6
|
+
...props,
|
|
7
|
+
iconOnly: true,
|
|
8
|
+
variant: "text",
|
|
9
|
+
size,
|
|
10
|
+
width: "hug",
|
|
11
|
+
children: label
|
|
12
|
+
});
|
|
38
13
|
};
|
|
39
14
|
//#endregion
|
|
40
15
|
export { InlineIconButton };
|
|
@@ -2,94 +2,36 @@ import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
|
2
2
|
import { typographyDefinition } from "../../text/Typography/typography.cva.js";
|
|
3
3
|
import { buttonContentLabel } from "./buttonContent.cva.js";
|
|
4
4
|
import { Loader } from "../../status/Loader/Loader.js";
|
|
5
|
-
import { c } from "react/compiler-runtime";
|
|
6
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
import { clsx } from "clsx";
|
|
8
7
|
import { isValidElement } from "react";
|
|
9
8
|
//#region src/components/buttons/shared/ButtonContent.tsx
|
|
10
|
-
var ButtonContent = (
|
|
11
|
-
const $ = c(21);
|
|
12
|
-
const { ref, content, isLoading, icon: Icon, iconClassName, hideText, iconPosition: t1, typography: typographyOverrides } = t0;
|
|
13
|
-
const iconPosition = t1 === void 0 ? "left" : t1;
|
|
9
|
+
var ButtonContent = ({ ref, content, isLoading, icon: Icon, iconClassName, hideText, iconPosition = "left", typography: typographyOverrides }) => {
|
|
14
10
|
const typographyCva = UIOverrides.useCva("typography.cva", typographyDefinition);
|
|
15
11
|
let iconOrLoader = null;
|
|
16
|
-
if (isLoading) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
$[3] = Icon;
|
|
35
|
-
$[4] = t2;
|
|
36
|
-
$[5] = t3;
|
|
37
|
-
} else t3 = $[5];
|
|
38
|
-
iconOrLoader = t3;
|
|
39
|
-
}
|
|
40
|
-
let t2;
|
|
41
|
-
let t3;
|
|
42
|
-
if ($[6] !== hideText || $[7] !== iconOrLoader || $[8] !== iconPosition || $[9] !== typographyCva || $[10] !== typographyOverrides) {
|
|
43
|
-
const resolvedTypography = {
|
|
44
|
-
size: "label-2",
|
|
45
|
-
variant: "prominent-1",
|
|
46
|
-
...typographyOverrides
|
|
47
|
-
};
|
|
48
|
-
t3 = iconOrLoader && iconPosition === "left" && iconOrLoader;
|
|
49
|
-
t2 = clsx(typographyCva({
|
|
50
|
-
...resolvedTypography,
|
|
51
|
-
sizeMobile: resolvedTypography.sizeMobile ?? resolvedTypography.size
|
|
52
|
-
}), buttonContentLabel({
|
|
53
|
-
iconPosition: iconOrLoader ? iconPosition : "none",
|
|
54
|
-
hideText: !!hideText
|
|
55
|
-
}));
|
|
56
|
-
$[6] = hideText;
|
|
57
|
-
$[7] = iconOrLoader;
|
|
58
|
-
$[8] = iconPosition;
|
|
59
|
-
$[9] = typographyCva;
|
|
60
|
-
$[10] = typographyOverrides;
|
|
61
|
-
$[11] = t2;
|
|
62
|
-
$[12] = t3;
|
|
63
|
-
} else {
|
|
64
|
-
t2 = $[11];
|
|
65
|
-
t3 = $[12];
|
|
66
|
-
}
|
|
67
|
-
let t4;
|
|
68
|
-
if ($[13] !== content || $[14] !== ref || $[15] !== t2) {
|
|
69
|
-
t4 = /* @__PURE__ */ jsx("span", {
|
|
70
|
-
className: t2,
|
|
12
|
+
if (isLoading) iconOrLoader = /* @__PURE__ */ jsx(Loader, { className: "shrink-0" });
|
|
13
|
+
else if (Icon) if (isValidElement(Icon)) iconOrLoader = Icon;
|
|
14
|
+
else iconOrLoader = /* @__PURE__ */ jsx(Icon, { className: clsx("shrink-0", iconClassName) });
|
|
15
|
+
const resolvedTypography = {
|
|
16
|
+
size: "label-2",
|
|
17
|
+
variant: "prominent-1",
|
|
18
|
+
...typographyOverrides
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21
|
+
iconOrLoader && iconPosition === "left" && iconOrLoader,
|
|
22
|
+
/* @__PURE__ */ jsx("span", {
|
|
23
|
+
className: clsx(typographyCva({
|
|
24
|
+
...resolvedTypography,
|
|
25
|
+
sizeMobile: resolvedTypography.sizeMobile ?? resolvedTypography.size
|
|
26
|
+
}), buttonContentLabel({
|
|
27
|
+
iconPosition: iconOrLoader ? iconPosition : "none",
|
|
28
|
+
hideText: !!hideText
|
|
29
|
+
})),
|
|
71
30
|
ref,
|
|
72
31
|
children: content
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
$[15] = t2;
|
|
77
|
-
$[16] = t4;
|
|
78
|
-
} else t4 = $[16];
|
|
79
|
-
const t5 = iconOrLoader && iconPosition === "right" && iconOrLoader;
|
|
80
|
-
let t6;
|
|
81
|
-
if ($[17] !== t3 || $[18] !== t4 || $[19] !== t5) {
|
|
82
|
-
t6 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
83
|
-
t3,
|
|
84
|
-
t4,
|
|
85
|
-
t5
|
|
86
|
-
] });
|
|
87
|
-
$[17] = t3;
|
|
88
|
-
$[18] = t4;
|
|
89
|
-
$[19] = t5;
|
|
90
|
-
$[20] = t6;
|
|
91
|
-
} else t6 = $[20];
|
|
92
|
-
return t6;
|
|
32
|
+
}),
|
|
33
|
+
iconOrLoader && iconPosition === "right" && iconOrLoader
|
|
34
|
+
] });
|
|
93
35
|
};
|
|
94
36
|
//#endregion
|
|
95
37
|
export { ButtonContent };
|
|
@@ -2,38 +2,24 @@ import { CheckboxCheckmarkIcon } from "../../../assets/icons/CheckboxCheckmark.j
|
|
|
2
2
|
import { CheckboxIndeterminateIcon } from "../../../assets/icons/CheckboxIndeterminate.js";
|
|
3
3
|
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
4
4
|
import { checkboxDefinition, checkboxIconDefinition } from "./checkbox.cva.js";
|
|
5
|
-
import { c } from "react/compiler-runtime";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
//#region src/components/inputs/Checkbox/CheckboxCheckmark.tsx
|
|
8
|
-
var CheckboxCheckmark = (
|
|
9
|
-
const $ = c(3);
|
|
10
|
-
const { variant, className, selectedIcon: t1, indeterminateIcon: t2, ...props } = t0;
|
|
11
|
-
const SelectedIcon = t1 === void 0 ? CheckboxCheckmarkIcon : t1;
|
|
12
|
-
const IndeterminateIcon = t2 === void 0 ? CheckboxIndeterminateIcon : t2;
|
|
7
|
+
var CheckboxCheckmark = ({ variant, className, selectedIcon: SelectedIcon = CheckboxCheckmarkIcon, indeterminateIcon: IndeterminateIcon = CheckboxIndeterminateIcon, ...props }) => {
|
|
13
8
|
const checkboxCva = UIOverrides.useCva("checkbox.cva", checkboxDefinition);
|
|
14
9
|
const checkboxIconCva = UIOverrides.useCva("checkbox.iconCva", checkboxIconDefinition);
|
|
15
|
-
const t3 = checkboxCva({
|
|
16
|
-
variant,
|
|
17
|
-
...props,
|
|
18
|
-
className
|
|
19
|
-
});
|
|
20
|
-
const t4 = checkboxIconCva({
|
|
21
|
-
...props,
|
|
22
|
-
iconVariant: "indeterminate"
|
|
23
|
-
});
|
|
24
|
-
let t5;
|
|
25
|
-
if ($[0] !== IndeterminateIcon || $[1] !== t4) {
|
|
26
|
-
t5 = /* @__PURE__ */ jsx(IndeterminateIcon, { className: t4 });
|
|
27
|
-
$[0] = IndeterminateIcon;
|
|
28
|
-
$[1] = t4;
|
|
29
|
-
$[2] = t5;
|
|
30
|
-
} else t5 = $[2];
|
|
31
10
|
return /* @__PURE__ */ jsxs("div", {
|
|
32
|
-
className:
|
|
11
|
+
className: checkboxCva({
|
|
12
|
+
variant,
|
|
13
|
+
...props,
|
|
14
|
+
className
|
|
15
|
+
}),
|
|
33
16
|
children: [/* @__PURE__ */ jsx(SelectedIcon, { className: checkboxIconCva({
|
|
34
17
|
...props,
|
|
35
18
|
iconVariant: "selected"
|
|
36
|
-
}) }),
|
|
19
|
+
}) }), /* @__PURE__ */ jsx(IndeterminateIcon, { className: checkboxIconCva({
|
|
20
|
+
...props,
|
|
21
|
+
iconVariant: "indeterminate"
|
|
22
|
+
}) })]
|
|
37
23
|
});
|
|
38
24
|
};
|
|
39
25
|
//#endregion
|