@dmsi/wedgekit-react 0.0.26 → 0.0.27
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/{chunk-KDEPZ6I7.js → chunk-2S2Z3L56.js} +5 -1
- package/dist/{chunk-TU55CHXU.js → chunk-4JLU7TAC.js} +3 -1
- package/dist/{chunk-Z2LOGSGE.js → chunk-4N2PED4P.js} +15 -3
- package/dist/{chunk-U42SKNR6.js → chunk-57WRM337.js} +68 -30
- package/dist/{chunk-ZFGGZXB6.js → chunk-AY7ELVQY.js} +5 -2
- package/dist/{chunk-I2UVVKQI.js → chunk-CHTO7PW4.js} +3 -2
- package/dist/{chunk-WIDBAFBU.js → chunk-FWPJ73IK.js} +3 -1
- package/dist/{chunk-5TLFMKSR.js → chunk-INYI65WW.js} +15 -5
- package/dist/{chunk-TJ44JJCB.js → chunk-J6LETUNM.js} +5 -2
- package/dist/{chunk-T6HZARR7.js → chunk-MZJS2ZAU.js} +6 -3
- package/dist/{chunk-ZCBSLV7U.js → chunk-O4M2GISS.js} +5 -2
- package/dist/{chunk-OUTEIXV4.js → chunk-OUSNH76S.js} +11 -3
- package/dist/{chunk-YDREJNAS.js → chunk-PDDZ5PMY.js} +18 -4
- package/dist/{chunk-4RD5ZF2V.js → chunk-QBIEU25R.js} +10 -4
- package/dist/chunk-QUPHLL7D.js +61 -0
- package/dist/{chunk-OISE6NMA.js → chunk-QV2EFOYF.js} +17 -6
- package/dist/{chunk-YZQNTOIF.js → chunk-QZGUMB7T.js} +10 -5
- package/dist/{chunk-S7R37IUP.js → chunk-S5K22XTH.js} +5 -2
- package/dist/{chunk-GCPJH5R6.js → chunk-S5KPS4IQ.js} +22 -7
- package/dist/{chunk-VELXLFMJ.js → chunk-SAMX4YGM.js} +4 -1
- package/dist/{chunk-TWP6YSFO.js → chunk-SKHSGGO3.js} +14 -6
- package/dist/chunk-TVDFTRGL.js +57 -0
- package/dist/{chunk-N32PXOA5.js → chunk-UT7XCBZF.js} +9 -4
- package/dist/{chunk-L4UM372R.js → chunk-VC3R5EUH.js} +3 -0
- package/dist/{chunk-UIQ733QP.js → chunk-VG4EPHJA.js} +7 -3
- package/dist/components/Breadcrumbs.cjs +29 -9
- package/dist/components/Breadcrumbs.js +29 -9
- package/dist/components/Button.cjs +6 -3
- package/dist/components/Button.js +1 -1
- package/dist/components/CalendarRange.cjs +11 -3
- package/dist/components/CalendarRange.js +1 -1
- package/dist/components/Caption.cjs +53 -9
- package/dist/components/Caption.js +53 -9
- package/dist/components/Checkbox.cjs +15 -6
- package/dist/components/Checkbox.js +2 -2
- package/dist/components/ContentTab.cjs +20 -7
- package/dist/components/ContentTab.js +2 -2
- package/dist/components/ContentTabs.cjs +32 -18
- package/dist/components/ContentTabs.js +14 -13
- package/dist/components/DMSiLogo.cjs +22 -4
- package/dist/components/DMSiLogo.js +9 -5
- package/dist/components/DataGrid.cjs +374 -243
- package/dist/components/DataGrid.js +283 -226
- package/dist/components/DataGridCell.cjs +79 -21
- package/dist/components/DataGridCell.js +7 -7
- package/dist/components/DataTable.cjs +197 -139
- package/dist/components/DataTable.js +197 -139
- package/dist/components/DateInput.cjs +36 -10
- package/dist/components/DateInput.js +7 -3
- package/dist/components/DateRangeInput.cjs +36 -10
- package/dist/components/DateRangeInput.js +7 -3
- package/dist/components/DebugJson.cjs +21 -13
- package/dist/components/DebugJson.js +21 -13
- package/dist/components/Display.cjs +5 -2
- package/dist/components/Display.js +1 -1
- package/dist/components/EditingContext.cjs +4 -1
- package/dist/components/EditingContext.js +4 -1
- package/dist/components/FilterGroup.cjs +102 -32
- package/dist/components/FilterGroup.js +41 -17
- package/dist/components/FullViewportBox.cjs +10 -2
- package/dist/components/FullViewportBox.js +10 -2
- package/dist/components/Grid.cjs +3 -1
- package/dist/components/Grid.js +3 -1
- package/dist/components/Heading.cjs +5 -2
- package/dist/components/Heading.js +1 -1
- package/dist/components/HorizontalDivider.cjs +2 -2
- package/dist/components/HorizontalDivider.js +2 -2
- package/dist/components/Input.cjs +21 -7
- package/dist/components/Input.js +2 -2
- package/dist/components/InputGroup.cjs +13 -6
- package/dist/components/InputGroup.js +9 -5
- package/dist/components/Label.cjs +5 -2
- package/dist/components/Label.js +1 -1
- package/dist/components/List.cjs +3 -2
- package/dist/components/List.js +3 -2
- package/dist/components/LogoAgilityTopBar.cjs +22 -4
- package/dist/components/LogoAgilityTopBar.js +9 -5
- package/dist/components/LogoDMSiTopBar.cjs +22 -4
- package/dist/components/LogoDMSiTopBar.js +1 -1
- package/dist/components/LogoMillworkTopBar.cjs +22 -4
- package/dist/components/LogoMillworkTopBar.js +9 -5
- package/dist/components/MainBar.cjs +2 -0
- package/dist/components/MainBar.js +2 -0
- package/dist/components/Menu.cjs +3 -0
- package/dist/components/Menu.js +1 -1
- package/dist/components/MenuOption.cjs +28 -7
- package/dist/components/MenuOption.js +3 -3
- package/dist/components/MobileDataGrid.cjs +101 -46
- package/dist/components/MobileDataGrid.js +23 -11
- package/dist/components/Modal.cjs +96 -51
- package/dist/components/Modal.js +19 -7
- package/dist/components/ModalButtons.cjs +43 -26
- package/dist/components/ModalButtons.js +2 -2
- package/dist/components/ModalContent.cjs +3 -1
- package/dist/components/ModalContent.js +1 -1
- package/dist/components/ModalHeader.cjs +40 -25
- package/dist/components/ModalHeader.js +3 -3
- package/dist/components/ModalScrim.cjs +3 -1
- package/dist/components/ModalScrim.js +1 -1
- package/dist/components/NavigationTab.cjs +9 -3
- package/dist/components/NavigationTab.js +2 -2
- package/dist/components/NavigationTabs.cjs +15 -7
- package/dist/components/NavigationTabs.js +8 -6
- package/dist/components/NestedMenu.cjs +28 -7
- package/dist/components/NestedMenu.js +3 -3
- package/dist/components/Notification.cjs +84 -38
- package/dist/components/Notification.js +8 -4
- package/dist/components/OptionPill.cjs +24 -6
- package/dist/components/OptionPill.js +3 -3
- package/dist/components/Paragraph.cjs +7 -3
- package/dist/components/Paragraph.js +1 -1
- package/dist/components/Password.cjs +33 -11
- package/dist/components/Password.js +14 -6
- package/dist/components/ProjectBar.cjs +3 -1
- package/dist/components/ProjectBar.js +3 -1
- package/dist/components/Radio.cjs +13 -7
- package/dist/components/Radio.js +7 -5
- package/dist/components/Search.cjs +34 -12
- package/dist/components/Search.js +3 -3
- package/dist/components/Select.cjs +25 -7
- package/dist/components/Select.js +3 -3
- package/dist/components/SideMenu.cjs +6 -1
- package/dist/components/SideMenu.js +6 -1
- package/dist/components/SideMenuGroup.cjs +96 -49
- package/dist/components/SideMenuGroup.js +31 -19
- package/dist/components/SideMenuItem.cjs +99 -43
- package/dist/components/SideMenuItem.js +32 -12
- package/dist/components/Stack.cjs +91 -30
- package/dist/components/Stack.js +1 -1
- package/dist/components/StatusPill.cjs +13 -6
- package/dist/components/StatusPill.js +9 -5
- package/dist/components/Stepper.cjs +35 -17
- package/dist/components/Stepper.js +11 -10
- package/dist/components/Subheader.cjs +5 -2
- package/dist/components/Subheader.js +1 -1
- package/dist/components/Surface.cjs +5 -2
- package/dist/components/Surface.js +5 -2
- package/dist/components/Swatch.cjs +1544 -1308
- package/dist/components/Swatch.js +1469 -1275
- package/dist/components/Textarea.cjs +5 -2
- package/dist/components/Textarea.js +5 -2
- package/dist/components/Theme.cjs +3 -2
- package/dist/components/Theme.js +1 -1
- package/dist/components/Time.cjs +98 -40
- package/dist/components/Time.js +18 -6
- package/dist/components/Toast.cjs +38 -15
- package/dist/components/Toast.js +23 -10
- package/dist/components/Tooltip.cjs +5 -4
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/TopBar.cjs +16 -8
- package/dist/components/TopBar.js +12 -5
- package/package.json +1 -1
- package/src/components/Breadcrumbs.tsx +24 -15
- package/src/components/Button.tsx +7 -3
- package/src/components/CalendarRange.tsx +9 -0
- package/src/components/Caption.tsx +36 -6
- package/src/components/Checkbox.tsx +7 -2
- package/src/components/ContentTab.tsx +13 -3
- package/src/components/ContentTabs.tsx +11 -8
- package/src/components/DMSiLogo.tsx +2 -1
- package/src/components/DataGrid.tsx +85 -23
- package/src/components/DataGridCell.tsx +15 -2
- package/src/components/DataTable.tsx +64 -14
- package/src/components/DateInput.tsx +5 -1
- package/src/components/DateRangeInput.tsx +5 -1
- package/src/components/DebugJson.tsx +7 -3
- package/src/components/Display.tsx +3 -0
- package/src/components/EditingContext.tsx +8 -6
- package/src/components/FilterGroup.tsx +23 -3
- package/src/components/FullViewportBox.tsx +6 -1
- package/src/components/Grid.tsx +3 -0
- package/src/components/Heading.tsx +3 -0
- package/src/components/HorizontalDivider.tsx +4 -2
- package/src/components/Input.tsx +19 -10
- package/src/components/InputGroup.tsx +8 -4
- package/src/components/Label.tsx +3 -0
- package/src/components/Link.tsx +1 -0
- package/src/components/List.tsx +7 -1
- package/src/components/LogoAgilityTopBar.tsx +2 -1
- package/src/components/LogoDMSiTopBar.tsx +2 -1
- package/src/components/LogoMillworkTopBar.tsx +2 -1
- package/src/components/MainBar.tsx +3 -0
- package/src/components/Menu.tsx +3 -0
- package/src/components/MenuOption.tsx +72 -58
- package/src/components/MobileDataGrid.tsx +15 -4
- package/src/components/Modal.tsx +10 -1
- package/src/components/ModalButtons.tsx +12 -1
- package/src/components/ModalContent.tsx +3 -0
- package/src/components/ModalHeader.tsx +16 -6
- package/src/components/ModalScrim.tsx +3 -0
- package/src/components/NavigationTab.tsx +6 -3
- package/src/components/NavigationTabs.tsx +5 -2
- package/src/components/Notification.tsx +4 -0
- package/src/components/OptionPill.tsx +9 -1
- package/src/components/Paragraph.tsx +3 -0
- package/src/components/Password.tsx +9 -3
- package/src/components/ProjectBar.tsx +3 -0
- package/src/components/Radio.tsx +3 -2
- package/src/components/Search.tsx +56 -41
- package/src/components/Select.tsx +6 -1
- package/src/components/SideMenu.tsx +7 -1
- package/src/components/SideMenuGroup.tsx +13 -2
- package/src/components/SideMenuItem.tsx +15 -2
- package/src/components/Stack.tsx +8 -3
- package/src/components/StatusPill.tsx +4 -2
- package/src/components/Stepper.tsx +5 -5
- package/src/components/Subheader.tsx +3 -0
- package/src/components/Surface.tsx +3 -0
- package/src/components/Swatch.tsx +415 -140
- package/src/components/Textarea.tsx +6 -3
- package/src/components/Theme.tsx +3 -1
- package/src/components/Time.tsx +21 -5
- package/src/components/Toast.tsx +29 -14
- package/src/components/Tooltip.tsx +46 -32
- package/src/components/TopBar.tsx +7 -3
- package/dist/chunk-DBYSGYST.js +0 -47
- package/dist/chunk-UK3WG7HQ.js +0 -48
|
@@ -214,10 +214,12 @@ var textareaReadOnlyClass = (0, import_clsx2.default)(
|
|
|
214
214
|
);
|
|
215
215
|
var Textarea = (_a) => {
|
|
216
216
|
var _b = _a, {
|
|
217
|
+
id,
|
|
217
218
|
label,
|
|
218
219
|
error,
|
|
219
220
|
caption
|
|
220
221
|
} = _b, props = __objRest(_b, [
|
|
222
|
+
"id",
|
|
221
223
|
"label",
|
|
222
224
|
"error",
|
|
223
225
|
"caption"
|
|
@@ -228,6 +230,7 @@ var Textarea = (_a) => {
|
|
|
228
230
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
229
231
|
"label",
|
|
230
232
|
{
|
|
233
|
+
htmlFor: id,
|
|
231
234
|
className: (0, import_clsx2.default)(
|
|
232
235
|
"flex flex-col w-full",
|
|
233
236
|
"text-text-primary-normal has-disabled:text-text-primary-disabled",
|
|
@@ -250,7 +253,7 @@ var Textarea = (_a) => {
|
|
|
250
253
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
251
254
|
"textarea",
|
|
252
255
|
__spreadProps(__spreadValues(__spreadValues({}, props), attributes), {
|
|
253
|
-
id
|
|
256
|
+
id,
|
|
254
257
|
className: (0, import_clsx2.default)(
|
|
255
258
|
"disabled:text-text-primary-disabled",
|
|
256
259
|
typography.paragraph,
|
|
@@ -262,7 +265,7 @@ var Textarea = (_a) => {
|
|
|
262
265
|
)
|
|
263
266
|
})
|
|
264
267
|
),
|
|
265
|
-
caption
|
|
268
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { id: id ? `${id}-caption` : void 0, children: caption })
|
|
266
269
|
]
|
|
267
270
|
}
|
|
268
271
|
);
|
|
@@ -35,10 +35,12 @@ var textareaReadOnlyClass = clsx(
|
|
|
35
35
|
);
|
|
36
36
|
var Textarea = (_a) => {
|
|
37
37
|
var _b = _a, {
|
|
38
|
+
id,
|
|
38
39
|
label,
|
|
39
40
|
error,
|
|
40
41
|
caption
|
|
41
42
|
} = _b, props = __objRest(_b, [
|
|
43
|
+
"id",
|
|
42
44
|
"label",
|
|
43
45
|
"error",
|
|
44
46
|
"caption"
|
|
@@ -49,6 +51,7 @@ var Textarea = (_a) => {
|
|
|
49
51
|
return /* @__PURE__ */ jsxs(
|
|
50
52
|
"label",
|
|
51
53
|
{
|
|
54
|
+
htmlFor: id,
|
|
52
55
|
className: clsx(
|
|
53
56
|
"flex flex-col w-full",
|
|
54
57
|
"text-text-primary-normal has-disabled:text-text-primary-disabled",
|
|
@@ -71,7 +74,7 @@ var Textarea = (_a) => {
|
|
|
71
74
|
/* @__PURE__ */ jsx(
|
|
72
75
|
"textarea",
|
|
73
76
|
__spreadProps(__spreadValues(__spreadValues({}, props), attributes), {
|
|
74
|
-
id
|
|
77
|
+
id,
|
|
75
78
|
className: clsx(
|
|
76
79
|
"disabled:text-text-primary-disabled",
|
|
77
80
|
typography.paragraph,
|
|
@@ -83,7 +86,7 @@ var Textarea = (_a) => {
|
|
|
83
86
|
)
|
|
84
87
|
})
|
|
85
88
|
),
|
|
86
|
-
caption
|
|
89
|
+
caption && /* @__PURE__ */ jsx("div", { id: id ? `${id}-caption` : void 0, children: caption })
|
|
87
90
|
]
|
|
88
91
|
}
|
|
89
92
|
);
|
|
@@ -26,9 +26,10 @@ module.exports = __toCommonJS(Theme_exports);
|
|
|
26
26
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
27
27
|
function Theme({
|
|
28
28
|
theme,
|
|
29
|
-
children
|
|
29
|
+
children,
|
|
30
|
+
id
|
|
30
31
|
}) {
|
|
31
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "contents", "data-theme": theme, children });
|
|
32
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { id, className: "contents", "data-theme": theme, children });
|
|
32
33
|
}
|
|
33
34
|
// Annotate the CommonJS export names for ESM import in node:
|
|
34
35
|
0 && (module.exports = {
|
package/dist/components/Theme.js
CHANGED
package/dist/components/Time.cjs
CHANGED
|
@@ -203,18 +203,21 @@ var Label = (_a) => {
|
|
|
203
203
|
padded,
|
|
204
204
|
className,
|
|
205
205
|
color,
|
|
206
|
-
align
|
|
206
|
+
align,
|
|
207
|
+
id
|
|
207
208
|
} = _b, props = __objRest(_b, [
|
|
208
209
|
"as",
|
|
209
210
|
"padded",
|
|
210
211
|
"className",
|
|
211
212
|
"color",
|
|
212
|
-
"align"
|
|
213
|
+
"align",
|
|
214
|
+
"id"
|
|
213
215
|
]);
|
|
214
216
|
const Element = as;
|
|
215
217
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
216
218
|
Element,
|
|
217
219
|
__spreadProps(__spreadValues({
|
|
220
|
+
id,
|
|
218
221
|
className: (0, import_clsx2.default)(
|
|
219
222
|
typography.label,
|
|
220
223
|
align === "left" && "text-left",
|
|
@@ -301,6 +304,7 @@ function formatCurrencyDisplay(value) {
|
|
|
301
304
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
302
305
|
var InputBase = (_a) => {
|
|
303
306
|
var _b = _a, {
|
|
307
|
+
id,
|
|
304
308
|
before,
|
|
305
309
|
after,
|
|
306
310
|
type,
|
|
@@ -317,6 +321,7 @@ var InputBase = (_a) => {
|
|
|
317
321
|
wrapperClassName,
|
|
318
322
|
focus
|
|
319
323
|
} = _b, props = __objRest(_b, [
|
|
324
|
+
"id",
|
|
320
325
|
"before",
|
|
321
326
|
"after",
|
|
322
327
|
"type",
|
|
@@ -338,6 +343,7 @@ var InputBase = (_a) => {
|
|
|
338
343
|
"data-focus": focus || null
|
|
339
344
|
};
|
|
340
345
|
const inputRef = (0, import_react.useRef)(null);
|
|
346
|
+
const inputId = `${id}-input`;
|
|
341
347
|
(0, import_react.useEffect)(() => {
|
|
342
348
|
var _a2;
|
|
343
349
|
const input = inputRef.current;
|
|
@@ -378,6 +384,8 @@ var InputBase = (_a) => {
|
|
|
378
384
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
379
385
|
"label",
|
|
380
386
|
{
|
|
387
|
+
id,
|
|
388
|
+
htmlFor: inputId,
|
|
381
389
|
ref: inputContainerRef,
|
|
382
390
|
className: (0, import_clsx4.default)(
|
|
383
391
|
"w-full flex flex-col",
|
|
@@ -391,6 +399,7 @@ var InputBase = (_a) => {
|
|
|
391
399
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
392
400
|
Label,
|
|
393
401
|
{
|
|
402
|
+
id: id ? `${id}-label` : void 0,
|
|
394
403
|
className: (0, import_clsx4.default)(
|
|
395
404
|
props.disabled || props.readOnly ? "cursor-default" : "cursor-pointer"
|
|
396
405
|
),
|
|
@@ -427,7 +436,7 @@ var InputBase = (_a) => {
|
|
|
427
436
|
type,
|
|
428
437
|
required
|
|
429
438
|
}, props), attributes), {
|
|
430
|
-
id:
|
|
439
|
+
id: inputId,
|
|
431
440
|
className: (0, import_clsx4.default)(
|
|
432
441
|
"flex-1 outline-none w-full max-w-full min-h-6 min-w-0",
|
|
433
442
|
"[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
|
|
@@ -445,7 +454,7 @@ var InputBase = (_a) => {
|
|
|
445
454
|
]
|
|
446
455
|
}
|
|
447
456
|
),
|
|
448
|
-
caption
|
|
457
|
+
caption && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { id: id ? `${id}-caption` : void 0, children: caption })
|
|
449
458
|
]
|
|
450
459
|
}
|
|
451
460
|
);
|
|
@@ -459,7 +468,8 @@ var Input = (_a) => {
|
|
|
459
468
|
value: propValue,
|
|
460
469
|
onChange,
|
|
461
470
|
onBlur,
|
|
462
|
-
onClear
|
|
471
|
+
onClear,
|
|
472
|
+
id
|
|
463
473
|
} = _b, props = __objRest(_b, [
|
|
464
474
|
"variant",
|
|
465
475
|
"decimals",
|
|
@@ -468,7 +478,8 @@ var Input = (_a) => {
|
|
|
468
478
|
"value",
|
|
469
479
|
"onChange",
|
|
470
480
|
"onBlur",
|
|
471
|
-
"onClear"
|
|
481
|
+
"onClear",
|
|
482
|
+
"id"
|
|
472
483
|
]);
|
|
473
484
|
const [internalValue, setInternalValue] = (0, import_react.useState)("");
|
|
474
485
|
const [displayValue, setDisplayValue] = (0, import_react.useState)("");
|
|
@@ -494,7 +505,9 @@ var Input = (_a) => {
|
|
|
494
505
|
}, [propValue, decimals, variant]);
|
|
495
506
|
const getInputProps = () => {
|
|
496
507
|
var _a2;
|
|
497
|
-
const baseProps = __spreadProps(__spreadValues(__spreadValues({}, props),
|
|
508
|
+
const baseProps = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, props), {
|
|
509
|
+
id
|
|
510
|
+
}), getDecimalPlaceholder(decimals)), {
|
|
498
511
|
value: propValue
|
|
499
512
|
});
|
|
500
513
|
switch (variant) {
|
|
@@ -541,6 +554,7 @@ var Input = (_a) => {
|
|
|
541
554
|
return hasValue && !props.readOnly ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
542
555
|
Icon,
|
|
543
556
|
{
|
|
557
|
+
id: id ? `${id}-clear-button` : void 0,
|
|
544
558
|
name: "close",
|
|
545
559
|
onClick: handleSearchReset,
|
|
546
560
|
className: "cursor-pointer absolute right-2 bottom-2/4 translate-y-2/4"
|
|
@@ -713,38 +727,70 @@ var useFlexClassNames = ({ items, justify, grow }) => (0, import_clsx5.default)(
|
|
|
713
727
|
justify === "between" && "justify-between",
|
|
714
728
|
justify === "around" && "justify-around"
|
|
715
729
|
);
|
|
716
|
-
var Stack = ({
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
730
|
+
var Stack = (_a) => {
|
|
731
|
+
var _b = _a, {
|
|
732
|
+
children,
|
|
733
|
+
items,
|
|
734
|
+
justify,
|
|
735
|
+
grow,
|
|
736
|
+
padding,
|
|
737
|
+
paddingX,
|
|
738
|
+
horizontal,
|
|
739
|
+
horizontalMobile,
|
|
740
|
+
elevation = 0,
|
|
741
|
+
rounded,
|
|
742
|
+
centered,
|
|
743
|
+
width,
|
|
744
|
+
maxWidth,
|
|
745
|
+
minWidth,
|
|
746
|
+
height,
|
|
747
|
+
maxHeight,
|
|
748
|
+
borderColor,
|
|
749
|
+
backgroundColor,
|
|
750
|
+
sizing = "none",
|
|
751
|
+
overflowY = "inherit",
|
|
752
|
+
overflowX = "inherit",
|
|
753
|
+
flexShrink,
|
|
754
|
+
flexGrow,
|
|
755
|
+
position,
|
|
756
|
+
top,
|
|
757
|
+
left,
|
|
758
|
+
id
|
|
759
|
+
} = _b, props = __objRest(_b, [
|
|
760
|
+
"children",
|
|
761
|
+
"items",
|
|
762
|
+
"justify",
|
|
763
|
+
"grow",
|
|
764
|
+
"padding",
|
|
765
|
+
"paddingX",
|
|
766
|
+
"horizontal",
|
|
767
|
+
"horizontalMobile",
|
|
768
|
+
"elevation",
|
|
769
|
+
"rounded",
|
|
770
|
+
"centered",
|
|
771
|
+
"width",
|
|
772
|
+
"maxWidth",
|
|
773
|
+
"minWidth",
|
|
774
|
+
"height",
|
|
775
|
+
"maxHeight",
|
|
776
|
+
"borderColor",
|
|
777
|
+
"backgroundColor",
|
|
778
|
+
"sizing",
|
|
779
|
+
"overflowY",
|
|
780
|
+
"overflowX",
|
|
781
|
+
"flexShrink",
|
|
782
|
+
"flexGrow",
|
|
783
|
+
"position",
|
|
784
|
+
"top",
|
|
785
|
+
"left",
|
|
786
|
+
"id"
|
|
787
|
+
]);
|
|
744
788
|
const flexClassNames = useFlexClassNames({ items, justify, grow });
|
|
745
789
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
746
790
|
"div",
|
|
747
|
-
{
|
|
791
|
+
__spreadProps(__spreadValues({
|
|
792
|
+
id
|
|
793
|
+
}, props), {
|
|
748
794
|
style: {
|
|
749
795
|
height: height === "full" ? "100%" : height !== void 0 ? `${height}px` : void 0,
|
|
750
796
|
maxHeight: maxHeight !== void 0 ? `${maxHeight}px` : void 0,
|
|
@@ -792,7 +838,7 @@ var Stack = ({
|
|
|
792
838
|
rounded && "rounded"
|
|
793
839
|
),
|
|
794
840
|
children
|
|
795
|
-
}
|
|
841
|
+
})
|
|
796
842
|
);
|
|
797
843
|
};
|
|
798
844
|
|
|
@@ -800,7 +846,7 @@ var Stack = ({
|
|
|
800
846
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
801
847
|
var timePickerScrollableStyle = "overflow-auto max-h-full py-4 no-scrollbar";
|
|
802
848
|
var Time = (_a) => {
|
|
803
|
-
var _b = _a, { onChange, format = "12h" } = _b, props = __objRest(_b, ["onChange", "format"]);
|
|
849
|
+
var _b = _a, { onChange, format = "12h", id } = _b, props = __objRest(_b, ["onChange", "format", "id"]);
|
|
804
850
|
const [showTimePicker, setShowTimePicker] = (0, import_react2.useState)(false);
|
|
805
851
|
const [hasInteracted, setHasInteracted] = (0, import_react2.useState)(false);
|
|
806
852
|
const inputRef = (0, import_react2.useRef)(null);
|
|
@@ -996,12 +1042,19 @@ var Time = (_a) => {
|
|
|
996
1042
|
}
|
|
997
1043
|
}, 0);
|
|
998
1044
|
}
|
|
999
|
-
}, [
|
|
1045
|
+
}, [
|
|
1046
|
+
showTimePicker,
|
|
1047
|
+
is12HourFormat,
|
|
1048
|
+
selectedRefs.hour,
|
|
1049
|
+
selectedRefs.minute,
|
|
1050
|
+
selectedRefs.meridiem
|
|
1051
|
+
]);
|
|
1000
1052
|
const renderOptions = (items, type) => items.map((val) => {
|
|
1001
1053
|
const isSelected = type === "hour" && val === hour || type === "minute" && val === minute || type === "meridiem" && val === meridiem;
|
|
1002
1054
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1003
1055
|
TimeCell,
|
|
1004
1056
|
{
|
|
1057
|
+
id: id ? `${id}-${type}-${val}` : void 0,
|
|
1005
1058
|
selected: isSelected,
|
|
1006
1059
|
ref: isSelected ? (el) => {
|
|
1007
1060
|
selectedRefs[type].current = el;
|
|
@@ -1017,6 +1070,7 @@ var Time = (_a) => {
|
|
|
1017
1070
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1018
1071
|
InputBase,
|
|
1019
1072
|
__spreadProps(__spreadValues({}, props), {
|
|
1073
|
+
id,
|
|
1020
1074
|
ref: inputRef,
|
|
1021
1075
|
inputContainerRef,
|
|
1022
1076
|
value: inputValue,
|
|
@@ -1033,6 +1087,7 @@ var Time = (_a) => {
|
|
|
1033
1087
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1034
1088
|
Stack,
|
|
1035
1089
|
{
|
|
1090
|
+
id: id ? `${id}-timepicker` : void 0,
|
|
1036
1091
|
elevation: 4,
|
|
1037
1092
|
height: 240,
|
|
1038
1093
|
position: "absolute",
|
|
@@ -1049,7 +1104,7 @@ var Time = (_a) => {
|
|
|
1049
1104
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_clsx6.default)(timePickerScrollableStyle), children: renderOptions(
|
|
1050
1105
|
Array.from(
|
|
1051
1106
|
{ length: is12HourFormat ? 12 : 24 },
|
|
1052
|
-
(_, i) => (i + 1).toString().padStart(2, "0")
|
|
1107
|
+
(_, i) => (i + (is12HourFormat ? 1 : 0)).toString().padStart(2, "0")
|
|
1053
1108
|
),
|
|
1054
1109
|
"hour"
|
|
1055
1110
|
) }),
|
|
@@ -1070,6 +1125,7 @@ var Time = (_a) => {
|
|
|
1070
1125
|
};
|
|
1071
1126
|
function TimeCell(_a) {
|
|
1072
1127
|
var _b = _a, {
|
|
1128
|
+
id,
|
|
1073
1129
|
selected = false,
|
|
1074
1130
|
start = false,
|
|
1075
1131
|
intermediate = false,
|
|
@@ -1083,6 +1139,7 @@ function TimeCell(_a) {
|
|
|
1083
1139
|
className,
|
|
1084
1140
|
ref
|
|
1085
1141
|
} = _b, props = __objRest(_b, [
|
|
1142
|
+
"id",
|
|
1086
1143
|
"selected",
|
|
1087
1144
|
"start",
|
|
1088
1145
|
"intermediate",
|
|
@@ -1101,6 +1158,7 @@ function TimeCell(_a) {
|
|
|
1101
1158
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1102
1159
|
"button",
|
|
1103
1160
|
__spreadProps(__spreadValues({
|
|
1161
|
+
id,
|
|
1104
1162
|
onPointerOver: onHover,
|
|
1105
1163
|
onClick,
|
|
1106
1164
|
onKeyDown,
|
package/dist/components/Time.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Stack
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-57WRM337.js";
|
|
4
4
|
import {
|
|
5
5
|
findDocumentRoot
|
|
6
6
|
} from "../chunk-4T7F5BZZ.js";
|
|
7
7
|
import {
|
|
8
8
|
InputBase
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-QV2EFOYF.js";
|
|
10
|
+
import "../chunk-S5K22XTH.js";
|
|
11
11
|
import {
|
|
12
12
|
Icon
|
|
13
13
|
} from "../chunk-IGQVA7SC.js";
|
|
@@ -27,7 +27,7 @@ import clsx from "clsx";
|
|
|
27
27
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
28
28
|
var timePickerScrollableStyle = "overflow-auto max-h-full py-4 no-scrollbar";
|
|
29
29
|
var Time = (_a) => {
|
|
30
|
-
var _b = _a, { onChange, format = "12h" } = _b, props = __objRest(_b, ["onChange", "format"]);
|
|
30
|
+
var _b = _a, { onChange, format = "12h", id } = _b, props = __objRest(_b, ["onChange", "format", "id"]);
|
|
31
31
|
const [showTimePicker, setShowTimePicker] = useState(false);
|
|
32
32
|
const [hasInteracted, setHasInteracted] = useState(false);
|
|
33
33
|
const inputRef = useRef(null);
|
|
@@ -223,12 +223,19 @@ var Time = (_a) => {
|
|
|
223
223
|
}
|
|
224
224
|
}, 0);
|
|
225
225
|
}
|
|
226
|
-
}, [
|
|
226
|
+
}, [
|
|
227
|
+
showTimePicker,
|
|
228
|
+
is12HourFormat,
|
|
229
|
+
selectedRefs.hour,
|
|
230
|
+
selectedRefs.minute,
|
|
231
|
+
selectedRefs.meridiem
|
|
232
|
+
]);
|
|
227
233
|
const renderOptions = (items, type) => items.map((val) => {
|
|
228
234
|
const isSelected = type === "hour" && val === hour || type === "minute" && val === minute || type === "meridiem" && val === meridiem;
|
|
229
235
|
return /* @__PURE__ */ jsx(
|
|
230
236
|
TimeCell,
|
|
231
237
|
{
|
|
238
|
+
id: id ? `${id}-${type}-${val}` : void 0,
|
|
232
239
|
selected: isSelected,
|
|
233
240
|
ref: isSelected ? (el) => {
|
|
234
241
|
selectedRefs[type].current = el;
|
|
@@ -244,6 +251,7 @@ var Time = (_a) => {
|
|
|
244
251
|
/* @__PURE__ */ jsx(
|
|
245
252
|
InputBase,
|
|
246
253
|
__spreadProps(__spreadValues({}, props), {
|
|
254
|
+
id,
|
|
247
255
|
ref: inputRef,
|
|
248
256
|
inputContainerRef,
|
|
249
257
|
value: inputValue,
|
|
@@ -260,6 +268,7 @@ var Time = (_a) => {
|
|
|
260
268
|
/* @__PURE__ */ jsx(
|
|
261
269
|
Stack,
|
|
262
270
|
{
|
|
271
|
+
id: id ? `${id}-timepicker` : void 0,
|
|
263
272
|
elevation: 4,
|
|
264
273
|
height: 240,
|
|
265
274
|
position: "absolute",
|
|
@@ -276,7 +285,7 @@ var Time = (_a) => {
|
|
|
276
285
|
/* @__PURE__ */ jsx("div", { className: clsx(timePickerScrollableStyle), children: renderOptions(
|
|
277
286
|
Array.from(
|
|
278
287
|
{ length: is12HourFormat ? 12 : 24 },
|
|
279
|
-
(_, i) => (i + 1).toString().padStart(2, "0")
|
|
288
|
+
(_, i) => (i + (is12HourFormat ? 1 : 0)).toString().padStart(2, "0")
|
|
280
289
|
),
|
|
281
290
|
"hour"
|
|
282
291
|
) }),
|
|
@@ -297,6 +306,7 @@ var Time = (_a) => {
|
|
|
297
306
|
};
|
|
298
307
|
function TimeCell(_a) {
|
|
299
308
|
var _b = _a, {
|
|
309
|
+
id,
|
|
300
310
|
selected = false,
|
|
301
311
|
start = false,
|
|
302
312
|
intermediate = false,
|
|
@@ -310,6 +320,7 @@ function TimeCell(_a) {
|
|
|
310
320
|
className,
|
|
311
321
|
ref
|
|
312
322
|
} = _b, props = __objRest(_b, [
|
|
323
|
+
"id",
|
|
313
324
|
"selected",
|
|
314
325
|
"start",
|
|
315
326
|
"intermediate",
|
|
@@ -328,6 +339,7 @@ function TimeCell(_a) {
|
|
|
328
339
|
return /* @__PURE__ */ jsx(
|
|
329
340
|
"button",
|
|
330
341
|
__spreadProps(__spreadValues({
|
|
342
|
+
id,
|
|
331
343
|
onPointerOver: onHover,
|
|
332
344
|
onClick,
|
|
333
345
|
onKeyDown,
|
|
@@ -205,20 +205,23 @@ var Heading = (_a) => {
|
|
|
205
205
|
as,
|
|
206
206
|
color,
|
|
207
207
|
align,
|
|
208
|
-
variant = "heading1"
|
|
208
|
+
variant = "heading1",
|
|
209
|
+
id
|
|
209
210
|
} = _b, props = __objRest(_b, [
|
|
210
211
|
"className",
|
|
211
212
|
"children",
|
|
212
213
|
"as",
|
|
213
214
|
"color",
|
|
214
215
|
"align",
|
|
215
|
-
"variant"
|
|
216
|
+
"variant",
|
|
217
|
+
"id"
|
|
216
218
|
]);
|
|
217
219
|
const defaultElement = variant === "heading1" ? "h1" : variant === "heading2" ? "h2" : "h3";
|
|
218
220
|
const Element = as != null ? as : defaultElement;
|
|
219
221
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
220
222
|
Element,
|
|
221
223
|
__spreadProps(__spreadValues({
|
|
224
|
+
id,
|
|
222
225
|
className: (0, import_clsx2.default)(
|
|
223
226
|
typography[variant],
|
|
224
227
|
className,
|
|
@@ -254,7 +257,8 @@ var Paragraph = (_a) => {
|
|
|
254
257
|
tall,
|
|
255
258
|
addOverflow,
|
|
256
259
|
children,
|
|
257
|
-
as = "p"
|
|
260
|
+
as = "p",
|
|
261
|
+
id
|
|
258
262
|
} = _b, props = __objRest(_b, [
|
|
259
263
|
"className",
|
|
260
264
|
"color",
|
|
@@ -263,12 +267,15 @@ var Paragraph = (_a) => {
|
|
|
263
267
|
"tall",
|
|
264
268
|
"addOverflow",
|
|
265
269
|
"children",
|
|
266
|
-
"as"
|
|
270
|
+
"as",
|
|
271
|
+
"id"
|
|
267
272
|
]);
|
|
268
273
|
const Element = as;
|
|
269
274
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
270
275
|
Element,
|
|
271
|
-
__spreadProps(__spreadValues({
|
|
276
|
+
__spreadProps(__spreadValues({
|
|
277
|
+
id
|
|
278
|
+
}, props), {
|
|
272
279
|
className: (0, import_clsx3.default)(
|
|
273
280
|
typography.paragraph,
|
|
274
281
|
className,
|
|
@@ -336,7 +343,8 @@ var Button = (_a) => {
|
|
|
336
343
|
children,
|
|
337
344
|
iconOnly = false,
|
|
338
345
|
colorClassName,
|
|
339
|
-
href
|
|
346
|
+
href,
|
|
347
|
+
id
|
|
340
348
|
} = _b, props = __objRest(_b, [
|
|
341
349
|
"variant",
|
|
342
350
|
"as",
|
|
@@ -349,7 +357,8 @@ var Button = (_a) => {
|
|
|
349
357
|
"children",
|
|
350
358
|
"iconOnly",
|
|
351
359
|
"colorClassName",
|
|
352
|
-
"href"
|
|
360
|
+
"href",
|
|
361
|
+
"id"
|
|
353
362
|
]);
|
|
354
363
|
const primaryVariantStyles = variant === "primary" && (0, import_clsx5.default)(
|
|
355
364
|
(colorClassName == null ? void 0 : colorClassName.trim()) ? colorClassName : "text-text-on-action-primary-normal",
|
|
@@ -439,6 +448,7 @@ var Button = (_a) => {
|
|
|
439
448
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
440
449
|
Element,
|
|
441
450
|
__spreadProps(__spreadValues({
|
|
451
|
+
id,
|
|
442
452
|
type: Element === "button" ? "button" : void 0,
|
|
443
453
|
className: buttonClasses
|
|
444
454
|
}, props), {
|
|
@@ -446,7 +456,7 @@ var Button = (_a) => {
|
|
|
446
456
|
href,
|
|
447
457
|
children: [
|
|
448
458
|
leftIcon && leftIcon,
|
|
449
|
-
!iconOnly && children && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: labelClasses, children }),
|
|
459
|
+
!iconOnly && children && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { id: id ? `${id}-label` : void 0, className: labelClasses, children }),
|
|
450
460
|
rightIcon && rightIcon
|
|
451
461
|
]
|
|
452
462
|
})
|
|
@@ -522,6 +532,7 @@ function getToastRoot() {
|
|
|
522
532
|
}
|
|
523
533
|
var Toast = (_a) => {
|
|
524
534
|
var _b = _a, {
|
|
535
|
+
id,
|
|
525
536
|
variant = "success",
|
|
526
537
|
title,
|
|
527
538
|
message,
|
|
@@ -531,6 +542,7 @@ var Toast = (_a) => {
|
|
|
531
542
|
viewButtonLink,
|
|
532
543
|
showViewButton = false
|
|
533
544
|
} = _b, props = __objRest(_b, [
|
|
545
|
+
"id",
|
|
534
546
|
"variant",
|
|
535
547
|
"title",
|
|
536
548
|
"message",
|
|
@@ -548,9 +560,7 @@ var Toast = (_a) => {
|
|
|
548
560
|
(0, import_react.useEffect)(() => {
|
|
549
561
|
if (show && !showToast) {
|
|
550
562
|
if (toastElementRef.current) {
|
|
551
|
-
const animation = slideInFromBottomAnimation(
|
|
552
|
-
toastElementRef.current
|
|
553
|
-
);
|
|
563
|
+
const animation = slideInFromBottomAnimation(toastElementRef.current);
|
|
554
564
|
animationRef.current = animation;
|
|
555
565
|
animation.onfinish = () => {
|
|
556
566
|
onClose == null ? void 0 : onClose();
|
|
@@ -582,7 +592,10 @@ var Toast = (_a) => {
|
|
|
582
592
|
animationRef.current.addEventListener("finish", handleAnimationEnd);
|
|
583
593
|
return () => {
|
|
584
594
|
if (animationRef.current) {
|
|
585
|
-
animationRef.current.removeEventListener(
|
|
595
|
+
animationRef.current.removeEventListener(
|
|
596
|
+
"finish",
|
|
597
|
+
handleAnimationEnd
|
|
598
|
+
);
|
|
586
599
|
}
|
|
587
600
|
};
|
|
588
601
|
}
|
|
@@ -599,6 +612,7 @@ var Toast = (_a) => {
|
|
|
599
612
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
600
613
|
"div",
|
|
601
614
|
__spreadProps(__spreadValues({
|
|
615
|
+
id,
|
|
602
616
|
ref: toastElementRef,
|
|
603
617
|
onMouseEnter: handleMouseEnter,
|
|
604
618
|
onMouseLeave: handleMouseLeave,
|
|
@@ -614,10 +628,18 @@ var Toast = (_a) => {
|
|
|
614
628
|
iconElement,
|
|
615
629
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx6.default)("flex items-center", layoutGroupGap), children: [
|
|
616
630
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx6.default)("flex flex-col w-68", componentGap), children: [
|
|
617
|
-
title && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Heading3, { children: title }),
|
|
618
|
-
message && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Paragraph, { children: message })
|
|
631
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Heading3, { id: id ? `${id}-title` : void 0, children: title }),
|
|
632
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Paragraph, { id: id ? `${id}-message` : void 0, children: message })
|
|
619
633
|
] }),
|
|
620
|
-
showViewButton && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
634
|
+
showViewButton && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
635
|
+
Button,
|
|
636
|
+
{
|
|
637
|
+
id: id ? `${id}-view-button` : void 0,
|
|
638
|
+
variant: "tertiary",
|
|
639
|
+
href: viewButtonLink,
|
|
640
|
+
children: "View"
|
|
641
|
+
}
|
|
642
|
+
)
|
|
621
643
|
] })
|
|
622
644
|
]
|
|
623
645
|
})
|
|
@@ -637,6 +659,7 @@ function createToast(config) {
|
|
|
637
659
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
638
660
|
Toast,
|
|
639
661
|
{
|
|
662
|
+
id: config.id,
|
|
640
663
|
show: true,
|
|
641
664
|
onClose: handleClose,
|
|
642
665
|
variant: config.variant,
|