@abgov/react-components 6.10.0-next.1 → 6.11.0-dev.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.
Files changed (84) hide show
  1. package/experimental/badge/badge.d.ts +33 -0
  2. package/experimental/button/button.d.ts +43 -0
  3. package/experimental/calendar/calendar.d.ts +30 -0
  4. package/experimental/callout/callout.d.ts +33 -0
  5. package/experimental/checkbox/checkbox.d.ts +52 -0
  6. package/experimental/date-picker/date-picker.d.ts +43 -0
  7. package/experimental/drawer/drawer.d.ts +31 -0
  8. package/experimental/dropdown/dropdown-item.d.ts +26 -0
  9. package/experimental/dropdown/dropdown.d.ts +62 -0
  10. package/experimental/file-upload-card/file-upload-card.d.ts +32 -0
  11. package/experimental/file-upload-input/file-upload-input.d.ts +27 -0
  12. package/experimental/filter-chip/filter-chip.d.ts +31 -0
  13. package/experimental/footer/footer.d.ts +24 -0
  14. package/experimental/footer-meta-section/footer-meta-section.d.ts +18 -0
  15. package/experimental/footer-nav-section/footer-nav-section.d.ts +22 -0
  16. package/experimental/form-item/form-item.d.ts +46 -0
  17. package/experimental/index.d.ts +30 -2
  18. package/experimental/input/input.d.ts +124 -0
  19. package/experimental/link/link.d.ts +32 -0
  20. package/experimental/modal/modal.d.ts +44 -0
  21. package/experimental/notification/notification.d.ts +31 -0
  22. package/experimental/pagination/pagination.d.ts +29 -0
  23. package/experimental/radio-group/radio-group.d.ts +40 -0
  24. package/experimental/radio-group/radio.d.ts +42 -0
  25. package/experimental/side-menu/side-menu.d.ts +19 -0
  26. package/experimental/side-menu-group/side-menu-group.d.ts +24 -0
  27. package/experimental/side-menu-heading/side-menu-heading.d.ts +23 -0
  28. package/experimental/table/table-sort-header.d.ts +20 -0
  29. package/experimental/table/table.d.ts +30 -0
  30. package/experimental/tabs/tabs.d.ts +27 -0
  31. package/experimental/textarea/textarea.d.ts +53 -0
  32. package/experimental/work-side-menu-group/work-side-menu-group.d.ts +22 -0
  33. package/experimental.js +1160 -64
  34. package/experimental.js.map +1 -1
  35. package/experimental.mjs +1163 -68
  36. package/experimental.mjs.map +1 -1
  37. package/index.js +139 -1753
  38. package/index.js.map +1 -1
  39. package/index.mjs +68 -1683
  40. package/index.mjs.map +1 -1
  41. package/lib/badge/badge.d.ts +0 -16
  42. package/lib/button/button.d.ts +0 -22
  43. package/lib/calendar/calendar.d.ts +0 -16
  44. package/lib/callout/callout.d.ts +0 -16
  45. package/lib/checkbox/checkbox.d.ts +0 -25
  46. package/lib/date-picker/date-picker.d.ts +0 -21
  47. package/lib/drawer/drawer.d.ts +0 -15
  48. package/lib/dropdown/dropdown-item.d.ts +0 -15
  49. package/lib/dropdown/dropdown.d.ts +0 -29
  50. package/lib/file-upload-card/file-upload-card.d.ts +0 -17
  51. package/lib/file-upload-input/file-upload-input.d.ts +0 -15
  52. package/lib/filter-chip/filter-chip.d.ts +0 -15
  53. package/lib/footer/footer.d.ts +0 -12
  54. package/lib/footer-meta-section/footer-meta-section.d.ts +0 -10
  55. package/lib/footer-nav-section/footer-nav-section.d.ts +0 -12
  56. package/lib/form-item/form-item.d.ts +0 -19
  57. package/lib/input/input.d.ts +0 -38
  58. package/lib/link/link.d.ts +0 -15
  59. package/lib/modal/modal.d.ts +1 -23
  60. package/lib/notification/notification.d.ts +0 -14
  61. package/lib/pagination/pagination.d.ts +0 -15
  62. package/lib/radio-group/radio-group.d.ts +0 -19
  63. package/lib/radio-group/radio.d.ts +0 -20
  64. package/lib/side-menu/side-menu.d.ts +0 -10
  65. package/lib/side-menu-group/side-menu-group.d.ts +0 -12
  66. package/lib/side-menu-heading/side-menu-heading.d.ts +0 -11
  67. package/lib/tab/tab.d.ts +3 -1
  68. package/lib/table/table-sort-header.d.ts +0 -11
  69. package/lib/table/table.d.ts +0 -14
  70. package/lib/tabs/tabs.d.ts +0 -14
  71. package/lib/textarea/textarea.d.ts +0 -25
  72. package/package.json +1 -1
  73. package/parseISO-BHUUf1QW.mjs +1693 -0
  74. package/parseISO-BHUUf1QW.mjs.map +1 -0
  75. package/parseISO-Dj57mwuH.js +1692 -0
  76. package/parseISO-Dj57mwuH.js.map +1 -0
  77. package/experimental/form/form-summary.d.ts +0 -10
  78. package/experimental/form/form.d.ts +0 -23
  79. package/experimental/resizable-panel/ResizablePanel.d.ts +0 -7
  80. package/icon-B3p90m2x.js +0 -75
  81. package/icon-B3p90m2x.js.map +0 -1
  82. package/icon-CCNDGfBO.mjs +0 -76
  83. package/icon-CCNDGfBO.mjs.map +0 -1
  84. package/style.css +0 -49
package/experimental.mjs CHANGED
@@ -1,88 +1,1129 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useRef, useState, useEffect } from "react";
3
- import { a as GoabIcon } from "./icon-CCNDGfBO.mjs";
4
- import { G } from "./icon-CCNDGfBO.mjs";
5
- const panel = "_panel_m3z4m_1";
6
- const panelBackground = "_panelBackground_m3z4m_8";
7
- const children = "_children_m3z4m_12";
8
- const handle = "_handle_m3z4m_17";
9
- const width = "_width_m3z4m_42";
10
- const Css = {
11
- panel,
12
- panelBackground,
13
- children,
14
- handle,
15
- width
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { t as transformProps, l as lowercase, f as format, p as parseISO, i as isValid } from "./parseISO-BHUUf1QW.mjs";
3
+ import { useRef, useEffect } from "react";
4
+ function getIconValue(icon, iconType) {
5
+ if (icon !== void 0) {
6
+ return icon ? "true" : "false";
7
+ }
8
+ return iconType ? "true" : "false";
9
+ }
10
+ function GoabxBadge({
11
+ icon,
12
+ iconType,
13
+ size = "medium",
14
+ emphasis = "strong",
15
+ version = "2",
16
+ ...rest
17
+ }) {
18
+ const _props = transformProps({ size, emphasis, ...rest }, lowercase);
19
+ return /* @__PURE__ */ jsx(
20
+ "goa-badge",
21
+ {
22
+ icon: getIconValue(icon, iconType),
23
+ icontype: iconType,
24
+ ..._props,
25
+ version,
26
+ size,
27
+ emphasis
28
+ }
29
+ );
30
+ }
31
+ function GoabxButton({
32
+ disabled,
33
+ onClick,
34
+ actionArgs,
35
+ actionArg,
36
+ children,
37
+ version = "2",
38
+ ...rest
39
+ }) {
40
+ const el = useRef(null);
41
+ const _props = transformProps(rest, lowercase);
42
+ useEffect(() => {
43
+ if (!el.current) {
44
+ return;
45
+ }
46
+ if (!onClick) {
47
+ return;
48
+ }
49
+ const current = el.current;
50
+ const listener = () => {
51
+ onClick == null ? void 0 : onClick();
52
+ };
53
+ current.addEventListener("_click", listener);
54
+ return () => {
55
+ current.removeEventListener("_click", listener);
56
+ };
57
+ }, [el, onClick]);
58
+ return /* @__PURE__ */ jsx(
59
+ "goa-button",
60
+ {
61
+ ref: el,
62
+ disabled: disabled ? "true" : void 0,
63
+ "action-arg": actionArg,
64
+ "action-args": JSON.stringify(actionArgs),
65
+ ..._props,
66
+ version,
67
+ children
68
+ }
69
+ );
70
+ }
71
+ function GoabxCalendar({
72
+ min,
73
+ max,
74
+ onChange,
75
+ name,
76
+ version = "2",
77
+ ...rest
78
+ }) {
79
+ const ref = useRef(null);
80
+ const _props = transformProps(rest, lowercase);
81
+ useEffect(() => {
82
+ if (!ref.current) {
83
+ return;
84
+ }
85
+ const current = ref.current;
86
+ const listener = (e) => {
87
+ onChange({
88
+ name: name || "",
89
+ value: e.detail.value
90
+ });
91
+ };
92
+ current.addEventListener("_change", listener);
93
+ return () => {
94
+ current.removeEventListener("_change", listener);
95
+ };
96
+ }, []);
97
+ return /* @__PURE__ */ jsx(
98
+ "goa-calendar",
99
+ {
100
+ ref,
101
+ name,
102
+ min: min || void 0,
103
+ max: max || void 0,
104
+ version,
105
+ ..._props
106
+ }
107
+ );
108
+ }
109
+ const GoabxCallout = ({
110
+ type = "information",
111
+ iconTheme = "outline",
112
+ size = "large",
113
+ ariaLive = "off",
114
+ emphasis = "medium",
115
+ children,
116
+ version = "2",
117
+ ...rest
118
+ }) => {
119
+ const _props = transformProps(
120
+ { type, icontheme: iconTheme, size, arialive: ariaLive, emphasis, ...rest },
121
+ lowercase
122
+ );
123
+ return /* @__PURE__ */ jsx("goa-callout", { ..._props, version, children });
16
124
  };
17
- function ResizablePanel(props) {
18
- const bgRef = useRef(null);
19
- const sectionRef = useRef(null);
20
- const widthRef = useRef(null);
21
- const handleRef = useRef(null);
22
- const maxWidth = useRef(0);
23
- const resizeBarState = useRef("static");
24
- const [width2, setWidth] = useState();
125
+ function GoabxCheckbox({
126
+ error,
127
+ checked,
128
+ indeterminate,
129
+ disabled,
130
+ value,
131
+ description,
132
+ reveal,
133
+ onChange,
134
+ name,
135
+ children,
136
+ size = "default",
137
+ version = "2",
138
+ ...rest
139
+ }) {
140
+ const el = useRef(null);
141
+ const _props = transformProps({ size, ...rest }, lowercase);
142
+ useEffect(() => {
143
+ if (!el.current) {
144
+ return;
145
+ }
146
+ const current = el.current;
147
+ const listener = (e) => {
148
+ const detail = e.detail;
149
+ onChange == null ? void 0 : onChange({ ...detail, event: e });
150
+ };
151
+ current.addEventListener("_change", listener);
152
+ return () => {
153
+ current.removeEventListener("_change", listener);
154
+ };
155
+ }, [name, onChange]);
156
+ return /* @__PURE__ */ jsxs(
157
+ "goa-checkbox",
158
+ {
159
+ ref: el,
160
+ ..._props,
161
+ name,
162
+ error: error ? "true" : void 0,
163
+ checked: checked ? "true" : void 0,
164
+ indeterminate: indeterminate ? "true" : void 0,
165
+ disabled: disabled ? "true" : void 0,
166
+ value: typeof value === "boolean" ? value ? "true" : void 0 : value,
167
+ description: typeof description === "string" ? description : void 0,
168
+ version,
169
+ children: [
170
+ children,
171
+ typeof description !== "string" && description && /* @__PURE__ */ jsx("div", { slot: "description", children: description }),
172
+ reveal && /* @__PURE__ */ jsx("div", { slot: "reveal", children: reveal })
173
+ ]
174
+ }
175
+ );
176
+ }
177
+ function GoabxDatePicker({
178
+ value,
179
+ error,
180
+ min,
181
+ max,
182
+ disabled,
183
+ relative,
184
+ version = "2",
185
+ onChange,
186
+ ...rest
187
+ }) {
188
+ const ref = useRef(null);
189
+ const _props = transformProps(rest, lowercase);
190
+ useEffect(() => {
191
+ if (value && typeof value !== "string") {
192
+ console.warn(
193
+ "Using a `Date` type for value is deprecated. Instead use a string of the format `yyyy-mm-dd`"
194
+ );
195
+ }
196
+ }, []);
197
+ useEffect(() => {
198
+ if (!ref.current) {
199
+ return;
200
+ }
201
+ const current = ref.current;
202
+ const handleChange = (e) => {
203
+ const detail = e.detail;
204
+ onChange == null ? void 0 : onChange({ ...detail, event: e });
205
+ };
206
+ if (onChange) {
207
+ current.addEventListener("_change", handleChange);
208
+ }
209
+ return () => {
210
+ if (onChange) {
211
+ current.removeEventListener("_change", handleChange);
212
+ }
213
+ };
214
+ }, [onChange]);
215
+ const formatValue = (val) => {
216
+ if (!val) return "";
217
+ if (val instanceof Date) {
218
+ return val.toISOString();
219
+ }
220
+ return val;
221
+ };
222
+ return /* @__PURE__ */ jsx(
223
+ "goa-date-picker",
224
+ {
225
+ ref,
226
+ value: formatValue(value) || void 0,
227
+ error: error ? "true" : void 0,
228
+ disabled: disabled ? "true" : void 0,
229
+ min: formatValue(min) || void 0,
230
+ max: formatValue(max) || void 0,
231
+ relative: relative ? "true" : void 0,
232
+ version,
233
+ ..._props
234
+ }
235
+ );
236
+ }
237
+ function GoabxDrawer({
238
+ position,
239
+ open,
240
+ heading,
241
+ maxSize,
242
+ testId,
243
+ actions,
244
+ children,
245
+ onClose,
246
+ version = "2"
247
+ }) {
248
+ const el = useRef(null);
25
249
  useEffect(() => {
26
250
  var _a;
27
- maxWidth.current = ((_a = bgRef.current) == null ? void 0 : _a.getBoundingClientRect().width) ?? 0;
251
+ if (!(el == null ? void 0 : el.current) || !onClose) {
252
+ return;
253
+ }
254
+ (_a = el.current) == null ? void 0 : _a.addEventListener("_close", onClose);
255
+ return () => {
256
+ var _a2;
257
+ (_a2 = el.current) == null ? void 0 : _a2.removeEventListener("_close", onClose);
258
+ };
259
+ }, [el, onClose]);
260
+ return /* @__PURE__ */ jsxs(
261
+ "goa-drawer",
262
+ {
263
+ ref: el,
264
+ position,
265
+ open: open ? true : void 0,
266
+ heading: typeof heading === "string" ? heading : void 0,
267
+ maxsize: maxSize,
268
+ testid: testId,
269
+ version,
270
+ children: [
271
+ heading && typeof heading !== "string" && /* @__PURE__ */ jsx("div", { slot: "heading", children: heading }),
272
+ actions && /* @__PURE__ */ jsx("div", { slot: "actions", children: actions }),
273
+ children
274
+ ]
275
+ }
276
+ );
277
+ }
278
+ function stringify(value) {
279
+ if (typeof value === "undefined") {
280
+ return "";
281
+ }
282
+ if (typeof value === "string") {
283
+ return value;
284
+ }
285
+ return JSON.stringify(value);
286
+ }
287
+ function GoabxDropdown({
288
+ value,
289
+ onChange,
290
+ disabled,
291
+ error,
292
+ filterable,
293
+ multiselect,
294
+ native,
295
+ relative,
296
+ children,
297
+ size = "default",
298
+ version = "2",
299
+ ...rest
300
+ }) {
301
+ const el = useRef(null);
302
+ const _props = transformProps({ size, ...rest }, lowercase);
303
+ useEffect(() => {
304
+ if (!el.current) {
305
+ return;
306
+ }
307
+ const current = el.current;
308
+ const handler = (e) => {
309
+ const detail = e.detail;
310
+ onChange == null ? void 0 : onChange({ ...detail, event: e });
311
+ };
312
+ if (onChange) {
313
+ current.addEventListener("_change", handler);
314
+ }
315
+ return () => {
316
+ if (onChange) {
317
+ current.removeEventListener("_change", handler);
318
+ }
319
+ };
320
+ }, [el, onChange]);
321
+ return /* @__PURE__ */ jsx(
322
+ "goa-dropdown",
323
+ {
324
+ ref: el,
325
+ value: stringify(value),
326
+ disabled: disabled ? "true" : void 0,
327
+ error: error ? "true" : void 0,
328
+ filterable: filterable ? "true" : void 0,
329
+ multiselect: multiselect ? "true" : void 0,
330
+ native: native ? "true" : void 0,
331
+ relative: relative ? "true" : void 0,
332
+ ..._props,
333
+ version,
334
+ children
335
+ }
336
+ );
337
+ }
338
+ function GoabxDropdownOption(props) {
339
+ useEffect(() => {
340
+ console.warn("GoabxDropdownOption is deprecated. Please use GoabxDropdownItem");
28
341
  }, []);
29
- function resetMouseState() {
30
- resizeBarState.current = "static";
342
+ return /* @__PURE__ */ jsx(GoabxDropdownItem, { ...props });
343
+ }
344
+ function GoabxDropdownItem({
345
+ value,
346
+ label,
347
+ filter,
348
+ name,
349
+ mountType = "append"
350
+ }) {
351
+ return /* @__PURE__ */ jsx(
352
+ "goa-dropdown-item",
353
+ {
354
+ value,
355
+ label,
356
+ filter,
357
+ name,
358
+ mount: mountType
359
+ }
360
+ );
361
+ }
362
+ function GoabxFileUploadCard({
363
+ onDelete,
364
+ onCancel,
365
+ filename,
366
+ version = "2",
367
+ ...rest
368
+ }) {
369
+ const el = useRef(null);
370
+ const _props = transformProps({ filename, ...rest }, lowercase);
371
+ useEffect(() => {
372
+ if (!el.current) return;
373
+ const current = el.current;
374
+ const deleteHandler = (event) => onDelete == null ? void 0 : onDelete({ filename, event });
375
+ const cancelHandler = (event) => onCancel == null ? void 0 : onCancel({ filename, event });
376
+ current.addEventListener("_delete", deleteHandler);
377
+ current.addEventListener("_cancel", cancelHandler);
378
+ return () => {
379
+ current.removeEventListener("_delete", deleteHandler);
380
+ current.removeEventListener("_cancel", cancelHandler);
381
+ };
382
+ }, [el, onDelete, onCancel, filename]);
383
+ return /* @__PURE__ */ jsx("goa-file-upload-card", { ref: el, ..._props, version });
384
+ }
385
+ function GoabxFileUploadInput({
386
+ onSelectFile,
387
+ version = "2",
388
+ ...rest
389
+ }) {
390
+ const el = useRef(null);
391
+ const _props = transformProps(rest, lowercase);
392
+ useEffect(() => {
393
+ if (!el.current) return;
394
+ const current = el.current;
395
+ const handler = (e) => {
396
+ const detail = e.detail;
397
+ onSelectFile({ ...detail, event: e });
398
+ };
399
+ current.addEventListener("_selectFile", handler);
400
+ return () => {
401
+ current.removeEventListener("_selectFile", handler);
402
+ };
403
+ }, [el, onSelectFile]);
404
+ return /* @__PURE__ */ jsx("goa-file-upload-input", { ref: el, ..._props, version });
405
+ }
406
+ const GoabxFilterChip = ({
407
+ iconTheme = "outline",
408
+ error,
409
+ onClick,
410
+ version = "2",
411
+ ...rest
412
+ }) => {
413
+ const el = useRef(null);
414
+ const _props = transformProps(
415
+ { icontheme: iconTheme, ...rest },
416
+ lowercase
417
+ );
418
+ useEffect(() => {
419
+ if (!el.current) return;
420
+ if (!onClick) return;
421
+ const current = el.current;
422
+ current.addEventListener("_click", onClick);
423
+ return () => {
424
+ current.removeEventListener("_click", onClick);
425
+ };
426
+ }, [el, onClick]);
427
+ return /* @__PURE__ */ jsx(
428
+ "goa-filter-chip",
429
+ {
430
+ ref: el,
431
+ error: error ? "true" : void 0,
432
+ version,
433
+ ..._props
434
+ }
435
+ );
436
+ };
437
+ function GoabxFormItem({
438
+ error,
439
+ helpText,
440
+ publicFormSummaryOrder,
441
+ children,
442
+ type = "",
443
+ version = "2",
444
+ ...rest
445
+ }) {
446
+ const _props = transformProps({ type, ...rest }, lowercase);
447
+ return /* @__PURE__ */ jsxs(
448
+ "goa-form-item",
449
+ {
450
+ error: typeof error === "string" ? error : void 0,
451
+ helptext: typeof helpText === "string" ? helpText : void 0,
452
+ "public-form-summary-order": publicFormSummaryOrder,
453
+ ..._props,
454
+ version,
455
+ children: [
456
+ error && typeof error !== "string" && /* @__PURE__ */ jsx("div", { slot: "error", children: error }),
457
+ helpText && typeof helpText !== "string" && /* @__PURE__ */ jsx("div", { slot: "helptext", children: helpText }),
458
+ children
459
+ ]
460
+ }
461
+ );
462
+ }
463
+ function GoabxAppFooter({ children, ...rest }) {
464
+ const _props = transformProps(rest, lowercase);
465
+ return /* @__PURE__ */ jsx("goa-app-footer", { ..._props, version: "2", children });
466
+ }
467
+ function GoabxAppFooterMetaSection({
468
+ children,
469
+ ...rest
470
+ }) {
471
+ const _props = transformProps(rest, lowercase);
472
+ return /* @__PURE__ */ jsx("goa-app-footer-meta-section", { slot: "meta", ..._props, children });
473
+ }
474
+ function GoabxAppFooterNavSection({
475
+ children,
476
+ ...rest
477
+ }) {
478
+ const _props = transformProps(rest, lowercase);
479
+ return /* @__PURE__ */ jsx("goa-app-footer-nav-section", { slot: "nav", ..._props, children });
480
+ }
481
+ function GoabxInput({
482
+ variant = "goa",
483
+ textAlign = "left",
484
+ size = "default",
485
+ focused,
486
+ disabled,
487
+ readonly,
488
+ error,
489
+ leadingContent,
490
+ trailingContent,
491
+ onTrailingIconClick,
492
+ onChange,
493
+ onFocus,
494
+ onBlur,
495
+ onKeyPress,
496
+ version = "2",
497
+ ...rest
498
+ }) {
499
+ const ref = useRef(null);
500
+ const _props = transformProps(
501
+ { variant, textalign: textAlign, size, ...rest },
502
+ lowercase
503
+ );
504
+ useEffect(() => {
505
+ if (!ref.current) {
506
+ return;
507
+ }
508
+ const current = ref.current;
509
+ const changeListener = (e) => {
510
+ const detail = e.detail;
511
+ onChange == null ? void 0 : onChange({ ...detail, event: e });
512
+ };
513
+ const clickListener = () => {
514
+ onTrailingIconClick == null ? void 0 : onTrailingIconClick();
515
+ };
516
+ const focusListener = (e) => {
517
+ const detail = e.detail;
518
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
519
+ };
520
+ const blurListener = (e) => {
521
+ const detail = e.detail;
522
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
523
+ };
524
+ const keypressListener = (e) => {
525
+ const detail = e.detail;
526
+ onKeyPress == null ? void 0 : onKeyPress({ ...detail, event: e });
527
+ };
528
+ current.addEventListener("_change", changeListener);
529
+ current.addEventListener("_trailingIconClick", clickListener);
530
+ current.addEventListener("_focus", focusListener);
531
+ current.addEventListener("_blur", blurListener);
532
+ current.addEventListener("_keyPress", keypressListener);
533
+ return () => {
534
+ current.removeEventListener("_change", changeListener);
535
+ current.removeEventListener("_trailingIconClick", clickListener);
536
+ current.removeEventListener("_focus", focusListener);
537
+ current.removeEventListener("_blur", blurListener);
538
+ current.removeEventListener("_keyPress", keypressListener);
539
+ };
540
+ }, [ref, onChange, onTrailingIconClick, onFocus, onBlur, onKeyPress]);
541
+ return /* @__PURE__ */ jsxs(
542
+ "goa-input",
543
+ {
544
+ ref,
545
+ ..._props,
546
+ focused: focused ? "true" : void 0,
547
+ disabled: disabled ? "true" : void 0,
548
+ readonly: readonly ? "true" : void 0,
549
+ error: error ? "true" : void 0,
550
+ handletrailingiconclick: onTrailingIconClick ? "true" : "false",
551
+ version,
552
+ children: [
553
+ leadingContent && /* @__PURE__ */ jsx("div", { slot: "leadingContent", children: leadingContent }),
554
+ trailingContent && /* @__PURE__ */ jsx("div", { slot: "trailingContent", children: trailingContent })
555
+ ]
556
+ }
557
+ );
558
+ }
559
+ const onDateChangeHandler = (onChange) => {
560
+ return ({ name, value, event }) => {
561
+ if (!value) {
562
+ onChange == null ? void 0 : onChange({ name, value: "", event });
563
+ return;
564
+ }
565
+ if (typeof value === "string" && isValid(new Date(value))) {
566
+ onChange == null ? void 0 : onChange({ name, value: parseISO(value), event });
567
+ return;
568
+ }
569
+ if (isValid(value)) {
570
+ onChange == null ? void 0 : onChange({ name, value, event });
571
+ return;
572
+ }
573
+ };
574
+ };
575
+ const onTimeChangeHandler = (onChange) => {
576
+ return ({ name, value, event }) => {
577
+ if (!value) {
578
+ onChange == null ? void 0 : onChange({ name, value: "", event });
579
+ return;
580
+ }
581
+ onChange == null ? void 0 : onChange({ name, value, event });
582
+ };
583
+ };
584
+ function toString(value, tmpl = "yyyy-MM-dd") {
585
+ if (!value) {
586
+ return "";
31
587
  }
32
- function onMouseDown(_) {
33
- resizeBarState.current = "active";
34
- window.addEventListener("mouseup", resetMouseState);
588
+ if (typeof value === "string") {
589
+ return format(parseISO(value), tmpl);
35
590
  }
36
- function onMouseUp(_) {
37
- resizeBarState.current = "static";
38
- window.removeEventListener("mouseup", resetMouseState);
591
+ if (value.toISOString() === (/* @__PURE__ */ new Date(0)).toISOString()) {
592
+ return "";
39
593
  }
40
- function onMouseMove(e) {
41
- var _a, _b;
42
- if (resizeBarState.current === "static") {
594
+ return format(value, tmpl);
595
+ }
596
+ function GoabxInputText(props) {
597
+ return /* @__PURE__ */ jsx(GoabxInput, { ...props, type: "text" });
598
+ }
599
+ function GoabxInputPassword(props) {
600
+ return /* @__PURE__ */ jsx(GoabxInput, { ...props, type: "password" });
601
+ }
602
+ function GoabxInputDate({
603
+ value,
604
+ min = "",
605
+ max = "",
606
+ ...props
607
+ }) {
608
+ return /* @__PURE__ */ jsx(
609
+ GoabxInput,
610
+ {
611
+ ...props,
612
+ type: "date",
613
+ onChange: onDateChangeHandler(props.onChange),
614
+ min: toString(min),
615
+ max: toString(max),
616
+ value: toString(value)
617
+ }
618
+ );
619
+ }
620
+ function GoabxInputTime({
621
+ value,
622
+ min = "",
623
+ max = "",
624
+ ...props
625
+ }) {
626
+ return /* @__PURE__ */ jsx(
627
+ GoabxInput,
628
+ {
629
+ ...props,
630
+ onChange: onTimeChangeHandler(props.onChange),
631
+ value,
632
+ type: "time"
633
+ }
634
+ );
635
+ }
636
+ function GoabxInputDateTime({
637
+ value,
638
+ min = "",
639
+ max = "",
640
+ ...props
641
+ }) {
642
+ return /* @__PURE__ */ jsx(
643
+ GoabxInput,
644
+ {
645
+ ...props,
646
+ onChange: onDateChangeHandler(props.onChange),
647
+ value: toString(value, "yyyy-MM-dd'T'HH:mm"),
648
+ type: "datetime-local"
649
+ }
650
+ );
651
+ }
652
+ function GoabxInputEmail(props) {
653
+ return /* @__PURE__ */ jsx(GoabxInput, { ...props, type: "email" });
654
+ }
655
+ function GoabxInputSearch(props) {
656
+ return /* @__PURE__ */ jsx(GoabxInput, { ...props, type: "search", trailingIcon: "search" });
657
+ }
658
+ function GoabxInputUrl(props) {
659
+ return /* @__PURE__ */ jsx(GoabxInput, { ...props, type: "url" });
660
+ }
661
+ function GoabxInputTel(props) {
662
+ return /* @__PURE__ */ jsx(GoabxInput, { ...props, type: "tel" });
663
+ }
664
+ function GoabxInputFile(props) {
665
+ return /* @__PURE__ */ jsx(
666
+ "input",
667
+ {
668
+ id: props.id,
669
+ name: props.name,
670
+ type: "file",
671
+ onChange: (e) => {
672
+ var _a;
673
+ return (_a = props.onChange) == null ? void 0 : _a.call(props, {
674
+ name: e.target.name,
675
+ value: e.target.value,
676
+ event: e.nativeEvent
677
+ });
678
+ },
679
+ style: { backgroundColor: "revert" }
680
+ }
681
+ );
682
+ }
683
+ function GoabxInputMonth(props) {
684
+ return /* @__PURE__ */ jsx(GoabxInput, { ...props, type: "month" });
685
+ }
686
+ function GoabxInputNumber({
687
+ min = Number.MIN_VALUE,
688
+ max = Number.MAX_VALUE,
689
+ value,
690
+ textAlign = "right",
691
+ ...props
692
+ }) {
693
+ const onNumberChange = ({ name, value: value2, event }) => {
694
+ var _a;
695
+ (_a = props.onChange) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), event });
696
+ };
697
+ const onFocus = ({ name, value: value2, event }) => {
698
+ var _a;
699
+ (_a = props.onFocus) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), event });
700
+ };
701
+ const onBlur = ({ name, value: value2, event }) => {
702
+ var _a;
703
+ (_a = props.onBlur) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), event });
704
+ };
705
+ const onKeyPress = ({ name, value: value2, key, event }) => {
706
+ var _a;
707
+ (_a = props.onKeyPress) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), key: parseInt(key), event });
708
+ };
709
+ return /* @__PURE__ */ jsx(
710
+ GoabxInput,
711
+ {
712
+ ...props,
713
+ onChange: onNumberChange,
714
+ min: min == null ? void 0 : min.toString(),
715
+ max: max == null ? void 0 : max.toString(),
716
+ value: value == null ? void 0 : value.toString(),
717
+ onFocus,
718
+ onBlur,
719
+ type: "number",
720
+ onKeyPress,
721
+ textAlign
722
+ }
723
+ );
724
+ }
725
+ function GoabxInputRange(props) {
726
+ return /* @__PURE__ */ jsx(GoabxInput, { ...props, type: "range" });
727
+ }
728
+ function GoabxLink({
729
+ actionArgs,
730
+ actionArg,
731
+ color = "interactive",
732
+ size = "medium",
733
+ children,
734
+ ...rest
735
+ }) {
736
+ const _props = transformProps({ color, size, ...rest }, lowercase);
737
+ return /* @__PURE__ */ jsx(
738
+ "goa-link",
739
+ {
740
+ "action-arg": actionArg,
741
+ "action-args": JSON.stringify(actionArgs),
742
+ ..._props,
743
+ children
744
+ }
745
+ );
746
+ }
747
+ function GoabxModal({
748
+ heading,
749
+ children,
750
+ maxWidth,
751
+ open,
752
+ actions,
753
+ transition,
754
+ calloutVariant,
755
+ onClose,
756
+ testId,
757
+ version = "2"
758
+ }) {
759
+ const el = useRef(null);
760
+ useEffect(() => {
761
+ if (!el.current) {
43
762
  return;
44
763
  }
45
- const sectionEl = sectionRef.current;
46
- const xOffset = (sectionEl == null ? void 0 : sectionEl.getBoundingClientRect().x) || 0;
47
- const mouseX = e.clientX;
48
- const minWidth = props.minWidth || 0;
49
- if (mouseX <= 0) {
764
+ const current = el.current;
765
+ const listener = () => {
766
+ onClose == null ? void 0 : onClose();
767
+ };
768
+ current.addEventListener("_close", listener);
769
+ return () => {
770
+ current.removeEventListener("_close", listener);
771
+ };
772
+ }, [el, onClose]);
773
+ return /* @__PURE__ */ jsxs(
774
+ "goa-modal",
775
+ {
776
+ ref: el,
777
+ open: open ? "true" : void 0,
778
+ closable: onClose ? "true" : "false",
779
+ heading: typeof heading === "string" ? heading : void 0,
780
+ maxwidth: maxWidth,
781
+ transition,
782
+ calloutvariant: calloutVariant,
783
+ testid: testId,
784
+ version,
785
+ children: [
786
+ heading && typeof heading !== "string" && /* @__PURE__ */ jsx("div", { slot: "heading", children: heading }),
787
+ actions && /* @__PURE__ */ jsx("div", { slot: "actions", children: actions }),
788
+ children
789
+ ]
790
+ }
791
+ );
792
+ }
793
+ const GoabxNotification = ({
794
+ type = "information",
795
+ emphasis = "high",
796
+ compact,
797
+ ariaLive,
798
+ maxContentWidth,
799
+ children,
800
+ testId,
801
+ onDismiss,
802
+ version = "2"
803
+ }) => {
804
+ const el = useRef(null);
805
+ useEffect(() => {
806
+ if (!el.current) {
50
807
  return;
51
808
  }
52
- const newXPos = ((_a = handleRef.current) == null ? void 0 : _a.getBoundingClientRect().x) ?? 0;
53
- const calcWidth = Math.max(
54
- newXPos - xOffset,
55
- Math.min(mouseX - xOffset, maxWidth.current)
56
- );
57
- const elementWidth = Math.max(minWidth, calcWidth - 64);
58
- if (elementWidth <= minWidth) {
809
+ const current = el.current;
810
+ const listener = () => {
811
+ onDismiss == null ? void 0 : onDismiss();
812
+ };
813
+ current.addEventListener("_dismiss", listener);
814
+ return () => {
815
+ current.removeEventListener("_dismiss", listener);
816
+ };
817
+ }, [el, onDismiss]);
818
+ return /* @__PURE__ */ jsx(
819
+ "goa-notification",
820
+ {
821
+ ref: el,
822
+ type,
823
+ testid: testId,
824
+ maxcontentwidth: maxContentWidth,
825
+ arialive: ariaLive,
826
+ emphasis,
827
+ compact: compact ? "true" : void 0,
828
+ version,
829
+ children
830
+ }
831
+ );
832
+ };
833
+ function GoabxPagination({
834
+ onChange,
835
+ version = "2",
836
+ ...props
837
+ }) {
838
+ const ref = useRef(null);
839
+ useEffect(() => {
840
+ if (!ref.current) {
59
841
  return;
60
842
  }
61
- sectionEl == null ? void 0 : sectionEl.setAttribute("style", `width: ${calcWidth}px;`);
62
- (_b = widthRef.current) == null ? void 0 : _b.setAttribute(
63
- "style",
64
- `right: ${maxWidth.current - calcWidth + 32}px`
65
- );
66
- setWidth(`${Math.round(elementWidth)}px`);
67
- }
843
+ const current = ref.current;
844
+ const changeListener = (e) => {
845
+ const detail = e.detail;
846
+ onChange(detail);
847
+ };
848
+ current.addEventListener("_change", changeListener);
849
+ return () => {
850
+ current.removeEventListener("_change", changeListener);
851
+ };
852
+ }, [ref, onChange]);
853
+ return /* @__PURE__ */ jsx(
854
+ "goa-pagination",
855
+ {
856
+ ref,
857
+ itemcount: props.itemCount,
858
+ perpagecount: props.perPageCount,
859
+ pagenumber: props.pageNumber,
860
+ variant: props.variant,
861
+ mt: props.mt,
862
+ mb: props.mb,
863
+ ml: props.ml,
864
+ mr: props.mr,
865
+ testid: props.testId,
866
+ version
867
+ }
868
+ );
869
+ }
870
+ function GoabxRadioItem({
871
+ name,
872
+ label,
873
+ value,
874
+ description,
875
+ reveal,
876
+ revealAriaLabel,
877
+ maxWidth,
878
+ disabled,
879
+ checked,
880
+ error,
881
+ compact,
882
+ ariaLabel,
883
+ children,
884
+ version = "2",
885
+ mt,
886
+ mr,
887
+ mb,
888
+ ml
889
+ }) {
68
890
  return /* @__PURE__ */ jsxs(
69
- "div",
891
+ "goa-radio-item",
70
892
  {
71
- ref: bgRef,
72
- className: Css.panelBackground,
73
- onMouseDown,
74
- onMouseMove,
75
- onMouseUp,
893
+ name,
894
+ label,
895
+ value,
896
+ description: typeof description === "string" ? description : void 0,
897
+ maxwidth: maxWidth,
898
+ error: error ? "true" : void 0,
899
+ disabled: disabled ? "true" : void 0,
900
+ checked: checked ? "true" : void 0,
901
+ compact: compact ? "true" : void 0,
902
+ arialabel: ariaLabel,
903
+ revealarialabel: revealAriaLabel,
904
+ mt,
905
+ mr,
906
+ mb,
907
+ ml,
908
+ version,
76
909
  children: [
77
- /* @__PURE__ */ jsxs("section", { ref: sectionRef, className: Css.panel, children: [
78
- /* @__PURE__ */ jsx("div", { className: Css.children, children: props.children }),
79
- /* @__PURE__ */ jsx("div", { ref: handleRef, className: Css.handle, children: /* @__PURE__ */ jsx(GoabIcon, { type: "reorder-two" }) })
80
- ] }),
81
- /* @__PURE__ */ jsx("div", { ref: widthRef, className: Css.width, children: width2 })
910
+ description && typeof description !== "string" && /* @__PURE__ */ jsx("div", { slot: "description", children: description }),
911
+ reveal && /* @__PURE__ */ jsx("div", { slot: "reveal", children: reveal }),
912
+ children
82
913
  ]
83
914
  }
84
915
  );
85
916
  }
917
+ function GoabxRadioGroup({
918
+ disabled,
919
+ error,
920
+ onChange,
921
+ name,
922
+ children,
923
+ size = "default",
924
+ version = "2",
925
+ ...rest
926
+ }) {
927
+ const el = useRef(null);
928
+ const _props = transformProps({ size, ...rest }, lowercase);
929
+ useEffect(() => {
930
+ if (!el.current) return;
931
+ const listener = (e) => {
932
+ const detail = e.detail;
933
+ onChange == null ? void 0 : onChange({ ...detail, event: e });
934
+ };
935
+ const currentEl = el.current;
936
+ if (onChange) {
937
+ currentEl.addEventListener("_change", listener);
938
+ }
939
+ return () => {
940
+ if (onChange) {
941
+ currentEl.removeEventListener("_change", listener);
942
+ }
943
+ };
944
+ }, [name, onChange]);
945
+ return /* @__PURE__ */ jsx(
946
+ "goa-radio-group",
947
+ {
948
+ ref: el,
949
+ ..._props,
950
+ name,
951
+ disabled: disabled ? "true" : void 0,
952
+ error: error ? "true" : void 0,
953
+ version,
954
+ children
955
+ }
956
+ );
957
+ }
958
+ function GoabxSideMenu({
959
+ testId,
960
+ children,
961
+ version = "2"
962
+ }) {
963
+ return /* @__PURE__ */ jsx("goa-side-menu", { testid: testId, version, children });
964
+ }
965
+ function GoabxSideMenuGroup({
966
+ heading,
967
+ icon,
968
+ testId,
969
+ children,
970
+ mt,
971
+ mr,
972
+ mb,
973
+ ml,
974
+ version = "2"
975
+ }) {
976
+ return /* @__PURE__ */ jsx(
977
+ "goa-side-menu-group",
978
+ {
979
+ heading,
980
+ icon,
981
+ testid: testId,
982
+ mt,
983
+ mr,
984
+ mb,
985
+ ml,
986
+ version,
987
+ children
988
+ }
989
+ );
990
+ }
991
+ function GoabxSideMenuHeading({
992
+ meta,
993
+ testId,
994
+ icon,
995
+ children,
996
+ version = "2"
997
+ }) {
998
+ return /* @__PURE__ */ jsxs("goa-side-menu-heading", { icon, testid: testId, version, children: [
999
+ children,
1000
+ meta && /* @__PURE__ */ jsx("span", { slot: "meta", children: meta })
1001
+ ] });
1002
+ }
1003
+ function GoabxTable({ onSort, version = "2", ...props }) {
1004
+ const ref = useRef(null);
1005
+ useEffect(() => {
1006
+ if (!ref.current) {
1007
+ return;
1008
+ }
1009
+ const current = ref.current;
1010
+ const sortListener = (e) => {
1011
+ const detail = e.detail;
1012
+ onSort == null ? void 0 : onSort(detail);
1013
+ };
1014
+ current.addEventListener("_sort", sortListener);
1015
+ return () => {
1016
+ current.removeEventListener("_sort", sortListener);
1017
+ };
1018
+ }, [ref, onSort]);
1019
+ return /* @__PURE__ */ jsx(
1020
+ "goa-table",
1021
+ {
1022
+ ref,
1023
+ width: props.width,
1024
+ variant: props.variant,
1025
+ striped: props.striped ? "true" : void 0,
1026
+ testid: props.testId,
1027
+ mt: props.mt,
1028
+ mb: props.mb,
1029
+ ml: props.ml,
1030
+ mr: props.mr,
1031
+ version,
1032
+ children: /* @__PURE__ */ jsx("table", { style: { width: "100%" }, children: props.children })
1033
+ }
1034
+ );
1035
+ }
1036
+ function GoabxTableSortHeader({
1037
+ children,
1038
+ ...rest
1039
+ }) {
1040
+ const _props = transformProps(rest, lowercase);
1041
+ return /* @__PURE__ */ jsx("goa-table-sort-header", { ..._props, children });
1042
+ }
1043
+ function GoabxTabs({
1044
+ initialTab,
1045
+ children,
1046
+ testId,
1047
+ onChange,
1048
+ variant,
1049
+ version = "2"
1050
+ }) {
1051
+ const ref = useRef(null);
1052
+ useEffect(() => {
1053
+ const element = ref.current;
1054
+ if (element && onChange) {
1055
+ const handler = (event) => {
1056
+ const detail = event.detail;
1057
+ onChange(detail);
1058
+ };
1059
+ element.addEventListener("_change", handler);
1060
+ return () => {
1061
+ element.removeEventListener("_change", handler);
1062
+ };
1063
+ }
1064
+ }, [onChange]);
1065
+ return /* @__PURE__ */ jsx(
1066
+ "goa-tabs",
1067
+ {
1068
+ ref,
1069
+ initialtab: initialTab,
1070
+ testid: testId,
1071
+ variant,
1072
+ version,
1073
+ children
1074
+ }
1075
+ );
1076
+ }
1077
+ function GoabxTextArea({
1078
+ readOnly,
1079
+ disabled,
1080
+ error,
1081
+ onChange,
1082
+ onKeyPress,
1083
+ onBlur,
1084
+ version = "2",
1085
+ ...rest
1086
+ }) {
1087
+ const el = useRef(null);
1088
+ const _props = transformProps(rest, lowercase);
1089
+ useEffect(() => {
1090
+ if (!el.current) {
1091
+ return;
1092
+ }
1093
+ const current = el.current;
1094
+ const changeListener = (e) => {
1095
+ const detail = e.detail;
1096
+ onChange == null ? void 0 : onChange({ ...detail, event: e });
1097
+ };
1098
+ const keypressListener = (e) => {
1099
+ const detail = e.detail;
1100
+ onKeyPress == null ? void 0 : onKeyPress({ ...detail, event: e });
1101
+ };
1102
+ const blurListener = (e) => {
1103
+ const detail = e.detail;
1104
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
1105
+ };
1106
+ current.addEventListener("_change", changeListener);
1107
+ current.addEventListener("_keyPress", keypressListener);
1108
+ current.addEventListener("_blur", blurListener);
1109
+ return () => {
1110
+ current.removeEventListener("_change", changeListener);
1111
+ current.removeEventListener("_keyPress", keypressListener);
1112
+ current.removeEventListener("_blur", blurListener);
1113
+ };
1114
+ }, [el, onChange, onKeyPress, onBlur]);
1115
+ return /* @__PURE__ */ jsx(
1116
+ "goa-textarea",
1117
+ {
1118
+ ref: el,
1119
+ readOnly: readOnly ? "true" : void 0,
1120
+ disabled: disabled ? "true" : void 0,
1121
+ error: error ? "true" : void 0,
1122
+ version,
1123
+ ..._props
1124
+ }
1125
+ );
1126
+ }
86
1127
  function GoabxWorkSideMenu({
87
1128
  heading,
88
1129
  url,
@@ -141,10 +1182,64 @@ function GoabxWorkSideMenuItem(props) {
141
1182
  }
142
1183
  );
143
1184
  }
1185
+ function GoabxWorkSideMenuGroup(props) {
1186
+ return /* @__PURE__ */ jsx(
1187
+ "goa-work-side-menu-group",
1188
+ {
1189
+ heading: props.heading,
1190
+ icon: props.icon,
1191
+ testid: props.testId,
1192
+ children: props.children
1193
+ }
1194
+ );
1195
+ }
144
1196
  export {
145
- G as GoabDrawer,
1197
+ GoabxAppFooter,
1198
+ GoabxAppFooterMetaSection,
1199
+ GoabxAppFooterNavSection,
1200
+ GoabxBadge,
1201
+ GoabxButton,
1202
+ GoabxCalendar,
1203
+ GoabxCallout,
1204
+ GoabxCheckbox,
1205
+ GoabxDatePicker,
1206
+ GoabxDrawer,
1207
+ GoabxDropdown,
1208
+ GoabxDropdownItem,
1209
+ GoabxDropdownOption,
1210
+ GoabxFileUploadCard,
1211
+ GoabxFileUploadInput,
1212
+ GoabxFilterChip,
1213
+ GoabxFormItem,
1214
+ GoabxInput,
1215
+ GoabxInputDate,
1216
+ GoabxInputDateTime,
1217
+ GoabxInputEmail,
1218
+ GoabxInputFile,
1219
+ GoabxInputMonth,
1220
+ GoabxInputNumber,
1221
+ GoabxInputPassword,
1222
+ GoabxInputRange,
1223
+ GoabxInputSearch,
1224
+ GoabxInputTel,
1225
+ GoabxInputText,
1226
+ GoabxInputTime,
1227
+ GoabxInputUrl,
1228
+ GoabxLink,
1229
+ GoabxModal,
1230
+ GoabxNotification,
1231
+ GoabxPagination,
1232
+ GoabxRadioGroup,
1233
+ GoabxRadioItem,
1234
+ GoabxSideMenu,
1235
+ GoabxSideMenuGroup,
1236
+ GoabxSideMenuHeading,
1237
+ GoabxTable,
1238
+ GoabxTableSortHeader,
1239
+ GoabxTabs,
1240
+ GoabxTextArea,
146
1241
  GoabxWorkSideMenu,
147
- GoabxWorkSideMenuItem,
148
- ResizablePanel
1242
+ GoabxWorkSideMenuGroup,
1243
+ GoabxWorkSideMenuItem
149
1244
  };
150
1245
  //# sourceMappingURL=experimental.mjs.map