@aivenio/aquarium 1.62.0 → 1.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_variables.scss +1 -1
- package/dist/src/molecules/Combobox/Combobox.d.ts +2 -1
- package/dist/src/molecules/Combobox/Combobox.js +6 -3
- package/dist/src/molecules/DataList/DataList.d.ts +29 -12
- package/dist/src/molecules/DataList/DataList.js +18 -15
- package/dist/src/molecules/DataList/DataListContext.d.ts +2 -2
- package/dist/src/molecules/DataList/DataListGroup.d.ts +8 -3
- package/dist/src/molecules/DataList/DataListGroup.js +35 -11
- package/dist/src/molecules/DataList/DataListToolbar.js +2 -4
- package/dist/src/molecules/DataList/utils.d.ts +2 -0
- package/dist/src/molecules/DataList/utils.js +3 -0
- package/dist/src/molecules/Dialog/Dialog.d.ts +4 -0
- package/dist/src/molecules/Dialog/Dialog.js +9 -4
- package/dist/system.cjs +147 -77
- package/dist/system.mjs +114 -44
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/system.cjs
CHANGED
@@ -9528,6 +9528,7 @@ var ComboboxBase = (_a) => {
|
|
9528
9528
|
createOption,
|
9529
9529
|
renderOption = (opt) => itemToString(opt),
|
9530
9530
|
isOptionDisabled = isOptionDisabledBuiltin,
|
9531
|
+
getOptionKey,
|
9531
9532
|
defaultValue,
|
9532
9533
|
value,
|
9533
9534
|
onChange,
|
@@ -9549,6 +9550,7 @@ var ComboboxBase = (_a) => {
|
|
9549
9550
|
"createOption",
|
9550
9551
|
"renderOption",
|
9551
9552
|
"isOptionDisabled",
|
9553
|
+
"getOptionKey",
|
9552
9554
|
"defaultValue",
|
9553
9555
|
"value",
|
9554
9556
|
"onChange",
|
@@ -9670,11 +9672,14 @@ var ComboboxBase = (_a) => {
|
|
9670
9672
|
style: { width: (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth }
|
9671
9673
|
}, /* @__PURE__ */ import_react56.default.createElement(Select.Menu, __spreadValues({
|
9672
9674
|
maxHeight
|
9673
|
-
}, menuProps), hasNoResults && /* @__PURE__ */ import_react56.default.createElement(Select.NoResults, null, emptyState), inputItems.map((item, index) =>
|
9674
|
-
|
9675
|
-
|
9676
|
-
|
9677
|
-
|
9675
|
+
}, menuProps), hasNoResults && /* @__PURE__ */ import_react56.default.createElement(Select.NoResults, null, emptyState), inputItems.map((item, index) => {
|
9676
|
+
var _a3;
|
9677
|
+
return /* @__PURE__ */ import_react56.default.createElement(Select.Item, __spreadValues({
|
9678
|
+
key: (_a3 = getOptionKey == null ? void 0 : getOptionKey(item)) != null ? _a3 : itemToString(item),
|
9679
|
+
selected: item === selectedItem,
|
9680
|
+
highlighted: index === highlightedIndex || item === selectedItem
|
9681
|
+
}, getItemProps({ item, index })), renderOption(item));
|
9682
|
+
}))));
|
9678
9683
|
};
|
9679
9684
|
var ComboboxBaseSkeleton = () => /* @__PURE__ */ import_react56.default.createElement(Skeleton, {
|
9680
9685
|
height: 38
|
@@ -9733,7 +9738,8 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ import_react
|
|
9733
9738
|
|
9734
9739
|
// src/molecules/DataList/DataList.tsx
|
9735
9740
|
var import_react79 = __toESM(require("react"));
|
9736
|
-
var
|
9741
|
+
var import_utils15 = require("@react-stately/utils");
|
9742
|
+
var import_castArray2 = __toESM(require("lodash/castArray"));
|
9737
9743
|
var import_compact = __toESM(require("lodash/compact"));
|
9738
9744
|
var import_groupBy2 = __toESM(require("lodash/groupBy"));
|
9739
9745
|
var import_isArray3 = __toESM(require("lodash/isArray"));
|
@@ -11413,9 +11419,17 @@ var useDataListContext = () => {
|
|
11413
11419
|
// src/molecules/DataList/DataListGroup.tsx
|
11414
11420
|
var import_react76 = __toESM(require("react"));
|
11415
11421
|
var import_isFunction2 = __toESM(require("lodash/isFunction"));
|
11422
|
+
|
11423
|
+
// src/molecules/DataList/utils.ts
|
11424
|
+
var flattenRows = (rows) => areRowsGrouped(rows) ? Object.values(rows).flatMap(flattenRows) : rows;
|
11425
|
+
|
11426
|
+
// src/molecules/DataList/DataListGroup.tsx
|
11416
11427
|
var GAP = 8;
|
11417
11428
|
var INDENTATION = 28;
|
11418
11429
|
var sortGroupKeys = (groupKeys) => [...groupKeys].sort((a) => a === "undefined" ? -1 : 1);
|
11430
|
+
var getDefaultRowCheckboxLabel = () => "Select row";
|
11431
|
+
var getDefaultGroupCheckboxLabel = (key) => `Select ${key}`;
|
11432
|
+
var renderDefaultGroupName = (key) => /* @__PURE__ */ import_react76.default.createElement(import_react76.default.Fragment, null, "Group: ", /* @__PURE__ */ import_react76.default.createElement("b", null, key));
|
11419
11433
|
var DataListGroup = (_a) => {
|
11420
11434
|
var _b = _a, {
|
11421
11435
|
groups,
|
@@ -11429,12 +11443,18 @@ var DataListGroup = (_a) => {
|
|
11429
11443
|
disabled,
|
11430
11444
|
expandedGroupIds,
|
11431
11445
|
getGroupRow,
|
11446
|
+
renderGroupName = renderDefaultGroupName,
|
11432
11447
|
menu,
|
11433
11448
|
menuAriaLabel,
|
11434
11449
|
onAction,
|
11435
11450
|
onGroupToggled,
|
11436
11451
|
onMenuOpenChange,
|
11437
|
-
rows
|
11452
|
+
rows,
|
11453
|
+
selectable,
|
11454
|
+
selectedRows,
|
11455
|
+
onSelectionChange,
|
11456
|
+
getRowCheckboxLabel = getDefaultRowCheckboxLabel,
|
11457
|
+
getGroupCheckboxLabel = getDefaultGroupCheckboxLabel
|
11438
11458
|
} = props;
|
11439
11459
|
const groupKeys = groups ? Object.keys(groups) : void 0;
|
11440
11460
|
const hasCustomRowForGroup = (0, import_isFunction2.default)(getGroupRow);
|
@@ -11442,12 +11462,16 @@ var DataListGroup = (_a) => {
|
|
11442
11462
|
return /* @__PURE__ */ import_react76.default.createElement(List, {
|
11443
11463
|
items: groups,
|
11444
11464
|
renderItem: (row, index) => {
|
11465
|
+
var _a2;
|
11466
|
+
const isChecked = (_a2 = selectedRows == null ? void 0 : selectedRows.includes(row.id)) != null ? _a2 : false;
|
11467
|
+
const isDisabled = disabled == null ? void 0 : disabled(row, index, rows);
|
11445
11468
|
return /* @__PURE__ */ import_react76.default.createElement(DataListRow, {
|
11446
11469
|
key: row.id,
|
11447
11470
|
columns,
|
11448
11471
|
row,
|
11449
11472
|
index,
|
11450
11473
|
rows,
|
11474
|
+
active: selectable && isChecked,
|
11451
11475
|
menu: /* @__PURE__ */ import_react76.default.createElement(DataListRowMenu, {
|
11452
11476
|
row,
|
11453
11477
|
index,
|
@@ -11457,11 +11481,22 @@ var DataListGroup = (_a) => {
|
|
11457
11481
|
menuAriaLabel
|
11458
11482
|
}),
|
11459
11483
|
disabled,
|
11484
|
+
additionalRowProps: () => selectable ? {
|
11485
|
+
"aria-selected": isChecked
|
11486
|
+
} : {},
|
11460
11487
|
additionalColumnProps: (_, columnIndex) => columnIndex === 0 ? {
|
11461
11488
|
style: {
|
11462
11489
|
paddingLeft: `${GAP + level * INDENTATION}px`
|
11463
11490
|
}
|
11464
|
-
} : {}
|
11491
|
+
} : {},
|
11492
|
+
renderFirstColumn: (row2, index2) => {
|
11493
|
+
return /* @__PURE__ */ import_react76.default.createElement(import_react76.default.Fragment, null, selectable && /* @__PURE__ */ import_react76.default.createElement(DataList.Cell, null, /* @__PURE__ */ import_react76.default.createElement(Checkbox, {
|
11494
|
+
"aria-label": getRowCheckboxLabel(row2, index2, isChecked, rows),
|
11495
|
+
onChange: onSelectionChange(row2.id),
|
11496
|
+
checked: isChecked,
|
11497
|
+
disabled: isDisabled
|
11498
|
+
})));
|
11499
|
+
}
|
11465
11500
|
});
|
11466
11501
|
}
|
11467
11502
|
});
|
@@ -11471,8 +11506,8 @@ var DataListGroup = (_a) => {
|
|
11471
11506
|
}
|
11472
11507
|
return /* @__PURE__ */ import_react76.default.createElement(List, {
|
11473
11508
|
items: sortGroupKeys(groupKeys),
|
11474
|
-
renderItem: (key) => {
|
11475
|
-
var _a2;
|
11509
|
+
renderItem: (key, index) => {
|
11510
|
+
var _a2, _b2;
|
11476
11511
|
const group = groups[key];
|
11477
11512
|
if (key === "undefined" || key === void 0) {
|
11478
11513
|
return /* @__PURE__ */ import_react76.default.createElement(DataListGroup, __spreadProps(__spreadValues({
|
@@ -11483,12 +11518,21 @@ var DataListGroup = (_a) => {
|
|
11483
11518
|
}));
|
11484
11519
|
}
|
11485
11520
|
const openPanelId = expandedGroupIds ? (_a2 = expandedGroupIds.find((id) => id === key)) != null ? _a2 : null : void 0;
|
11521
|
+
const nestedRowIds = flattenRows(group).map((row) => row.id);
|
11522
|
+
const nestedSelectedIds = (_b2 = selectedRows == null ? void 0 : selectedRows.filter((id) => nestedRowIds.includes(id))) != null ? _b2 : [];
|
11523
|
+
const allSelected = nestedRowIds.length === nestedSelectedIds.length;
|
11524
|
+
const isChecked = nestedSelectedIds.length > 0;
|
11486
11525
|
return /* @__PURE__ */ import_react76.default.createElement(Accordion, {
|
11487
11526
|
key,
|
11488
11527
|
openPanelId
|
11489
11528
|
}, hasCustomRowForGroup && /* @__PURE__ */ import_react76.default.createElement(DataList.Row, {
|
11490
|
-
active: !!openPanelId
|
11491
|
-
}, /* @__PURE__ */ import_react76.default.createElement(
|
11529
|
+
active: !!openPanelId || selectable && isChecked
|
11530
|
+
}, selectable && /* @__PURE__ */ import_react76.default.createElement(DataList.Cell, null, /* @__PURE__ */ import_react76.default.createElement(Checkbox, {
|
11531
|
+
"aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
|
11532
|
+
checked: isChecked,
|
11533
|
+
indeterminate: isChecked && !allSelected,
|
11534
|
+
onChange: onSelectionChange(nestedRowIds)
|
11535
|
+
})), /* @__PURE__ */ import_react76.default.createElement(List, {
|
11492
11536
|
items: columns,
|
11493
11537
|
renderItem: (column, idx) => /* @__PURE__ */ import_react76.default.createElement(DataList.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
11494
11538
|
className: tw("gap-3"),
|
@@ -11510,14 +11554,19 @@ var DataListGroup = (_a) => {
|
|
11510
11554
|
onMenuOpenChange,
|
11511
11555
|
menuAriaLabel
|
11512
11556
|
})), !hasCustomRowForGroup && /* @__PURE__ */ import_react76.default.createElement(DataList.Row, {
|
11513
|
-
active: !!openPanelId
|
11514
|
-
}, /* @__PURE__ */ import_react76.default.createElement(DataList.Cell, {
|
11557
|
+
active: !!openPanelId || selectable && isChecked
|
11558
|
+
}, selectable && /* @__PURE__ */ import_react76.default.createElement(DataList.Cell, null, /* @__PURE__ */ import_react76.default.createElement(Checkbox, {
|
11559
|
+
"aria-label": getGroupCheckboxLabel(key, group, index, isChecked, rows),
|
11560
|
+
checked: isChecked,
|
11561
|
+
indeterminate: isChecked && !allSelected,
|
11562
|
+
onChange: onSelectionChange(nestedRowIds)
|
11563
|
+
})), /* @__PURE__ */ import_react76.default.createElement(DataList.Cell, {
|
11515
11564
|
className: tw("gap-3"),
|
11516
|
-
style: { paddingLeft: `${GAP + level * INDENTATION}px`, gridColumn:
|
11565
|
+
style: { paddingLeft: `${GAP + level * INDENTATION}px`, gridColumn: `${selectable ? 2 : 1} / -1` }
|
11517
11566
|
}, /* @__PURE__ */ import_react76.default.createElement(Accordion.Toggle, {
|
11518
11567
|
panelId: key,
|
11519
11568
|
onChange: onGroupToggled
|
11520
|
-
}),
|
11569
|
+
}), renderGroupName(key, group))), /* @__PURE__ */ import_react76.default.createElement(DataList.Row, {
|
11521
11570
|
subgroup: true
|
11522
11571
|
}, /* @__PURE__ */ import_react76.default.createElement(Accordion.UnanimatedPanel, {
|
11523
11572
|
panelId: key
|
@@ -11570,11 +11619,11 @@ var DataListToolbar = ({
|
|
11570
11619
|
sticky = true
|
11571
11620
|
}) => {
|
11572
11621
|
var _a;
|
11573
|
-
const { selectedRows
|
11622
|
+
const { selectedRows } = useDataListContext();
|
11574
11623
|
const actions = (0, import_castArray.default)(_actions).filter(Boolean);
|
11575
11624
|
return /* @__PURE__ */ import_react78.default.createElement(DataList.Toolbar.Container, {
|
11576
11625
|
sticky
|
11577
|
-
}, /* @__PURE__ */ import_react78.default.createElement(DataList.Toolbar.Group, null, /* @__PURE__ */ import_react78.default.createElement(DataList.Toolbar.SelectionCount, null, (_a = selectedRows == null ? void 0 : selectedRows.length) != null ? _a : 0, "
|
11626
|
+
}, /* @__PURE__ */ import_react78.default.createElement(DataList.Toolbar.Group, null, /* @__PURE__ */ import_react78.default.createElement(DataList.Toolbar.SelectionCount, null, (_a = selectedRows == null ? void 0 : selectedRows.length) != null ? _a : 0, " selected")), actions.length > 0 && /* @__PURE__ */ import_react78.default.createElement(DataList.Toolbar.Group, null, /* @__PURE__ */ import_react78.default.createElement(DataList.Toolbar.Actions, null, actions.map(
|
11578
11627
|
(action) => renderAction({
|
11579
11628
|
kind: "ghost",
|
11580
11629
|
dense: true,
|
@@ -11591,7 +11640,6 @@ var DataListToolbar = ({
|
|
11591
11640
|
DataListToolbar.displayName = "DataList.Toolbar";
|
11592
11641
|
|
11593
11642
|
// src/molecules/DataList/DataList.tsx
|
11594
|
-
var getDefaultCheckboxLabel = () => "Select row";
|
11595
11643
|
var DataList2 = (_a) => {
|
11596
11644
|
var _b = _a, {
|
11597
11645
|
columns,
|
@@ -11608,12 +11656,14 @@ var DataList2 = (_a) => {
|
|
11608
11656
|
group,
|
11609
11657
|
disabled,
|
11610
11658
|
getGroupRow,
|
11659
|
+
renderGroupName,
|
11611
11660
|
onGroupToggled,
|
11612
11661
|
expandedGroupIds,
|
11613
11662
|
defaultSort,
|
11614
11663
|
onSortChanged,
|
11615
11664
|
selectable,
|
11616
|
-
|
11665
|
+
getRowCheckboxLabel = getDefaultRowCheckboxLabel,
|
11666
|
+
getGroupCheckboxLabel = getDefaultGroupCheckboxLabel,
|
11617
11667
|
selectedRows,
|
11618
11668
|
defaultSelectedRows,
|
11619
11669
|
onSelectionChange,
|
@@ -11633,19 +11683,21 @@ var DataList2 = (_a) => {
|
|
11633
11683
|
"group",
|
11634
11684
|
"disabled",
|
11635
11685
|
"getGroupRow",
|
11686
|
+
"renderGroupName",
|
11636
11687
|
"onGroupToggled",
|
11637
11688
|
"expandedGroupIds",
|
11638
11689
|
"defaultSort",
|
11639
11690
|
"onSortChanged",
|
11640
11691
|
"selectable",
|
11641
|
-
"
|
11692
|
+
"getRowCheckboxLabel",
|
11693
|
+
"getGroupCheckboxLabel",
|
11642
11694
|
"selectedRows",
|
11643
11695
|
"defaultSelectedRows",
|
11644
11696
|
"onSelectionChange",
|
11645
11697
|
"toolbar"
|
11646
11698
|
]);
|
11647
11699
|
var _a2, _b2;
|
11648
|
-
const [selected, setSelected] = (0,
|
11700
|
+
const [selected, setSelected] = (0, import_utils15.useControlledState)(
|
11649
11701
|
selectedRows,
|
11650
11702
|
defaultSelectedRows,
|
11651
11703
|
(value) => onSelectionChange == null ? void 0 : onSelectionChange(value != null ? value : [])
|
@@ -11677,20 +11729,22 @@ var DataList2 = (_a) => {
|
|
11677
11729
|
[]
|
11678
11730
|
);
|
11679
11731
|
const handleSelectionChange = (id) => (e) => {
|
11732
|
+
const ids = (0, import_castArray2.default)(id);
|
11680
11733
|
if (e.target.checked) {
|
11681
|
-
setSelected([...selected != null ? selected : [],
|
11734
|
+
setSelected([...selected != null ? selected : [], ...ids]);
|
11682
11735
|
} else {
|
11683
|
-
setSelected(selected == null ? void 0 : selected.filter((_id) => _id
|
11736
|
+
setSelected(selected == null ? void 0 : selected.filter((_id) => !ids.includes(_id)));
|
11684
11737
|
}
|
11685
11738
|
};
|
11739
|
+
const allRows = flattenRows(rows);
|
11686
11740
|
const totalSelected = (_b2 = selected == null ? void 0 : selected.length) != null ? _b2 : 0;
|
11687
11741
|
const allEnabledRowIds = (0, import_compact.default)(
|
11688
|
-
|
11742
|
+
allRows.map((row, index) => (disabled == null ? void 0 : disabled(row, index, sortedRows)) ? void 0 : row.id)
|
11689
11743
|
);
|
11690
11744
|
const allRowsSelected = totalSelected >= allEnabledRowIds.length;
|
11691
11745
|
return /* @__PURE__ */ import_react79.default.createElement(DataListContext.Provider, {
|
11692
11746
|
value: {
|
11693
|
-
rows: sortedRows,
|
11747
|
+
rows: (0, import_isArray3.default)(rows) ? sortedRows : rows,
|
11694
11748
|
selectedRows: selected
|
11695
11749
|
}
|
11696
11750
|
}, /* @__PURE__ */ import_react79.default.createElement(Template, {
|
@@ -11704,7 +11758,7 @@ var DataList2 = (_a) => {
|
|
11704
11758
|
sticky
|
11705
11759
|
}, /* @__PURE__ */ import_react79.default.createElement(Checkbox, {
|
11706
11760
|
"aria-label": "Select all rows",
|
11707
|
-
indeterminate: totalSelected > 0 && totalSelected <
|
11761
|
+
indeterminate: totalSelected > 0 && totalSelected < allRows.length,
|
11708
11762
|
checked: totalSelected > 0,
|
11709
11763
|
onChange: () => {
|
11710
11764
|
if (!allRowsSelected) {
|
@@ -11746,12 +11800,18 @@ var DataList2 = (_a) => {
|
|
11746
11800
|
columns,
|
11747
11801
|
disabled,
|
11748
11802
|
getGroupRow,
|
11803
|
+
renderGroupName,
|
11749
11804
|
expandedGroupIds,
|
11750
11805
|
menu,
|
11751
11806
|
menuAriaLabel,
|
11752
11807
|
onAction,
|
11753
11808
|
onGroupToggled,
|
11754
11809
|
onMenuOpenChange,
|
11810
|
+
selectable,
|
11811
|
+
selectedRows: selected,
|
11812
|
+
onSelectionChange: handleSelectionChange,
|
11813
|
+
getRowCheckboxLabel,
|
11814
|
+
getGroupCheckboxLabel,
|
11755
11815
|
rows,
|
11756
11816
|
groups,
|
11757
11817
|
level: 0
|
@@ -11759,13 +11819,17 @@ var DataList2 = (_a) => {
|
|
11759
11819
|
paginationContainer: PaginationFooter,
|
11760
11820
|
items: sortedRows,
|
11761
11821
|
renderItem: (row, index) => {
|
11822
|
+
var _a3;
|
11762
11823
|
const details = rowDetails == null ? void 0 : rowDetails(row, index, sortedRows);
|
11824
|
+
const isChecked = (_a3 = selected == null ? void 0 : selected.includes(row.id)) != null ? _a3 : false;
|
11825
|
+
const isDisabled = disabled == null ? void 0 : disabled(row, index, sortedRows);
|
11763
11826
|
const content = /* @__PURE__ */ import_react79.default.createElement(DataListRow, {
|
11764
11827
|
key: row.id,
|
11765
11828
|
columns,
|
11766
11829
|
row,
|
11767
11830
|
index,
|
11768
11831
|
rows: sortedRows,
|
11832
|
+
active: selectable && isChecked,
|
11769
11833
|
menu: /* @__PURE__ */ import_react79.default.createElement(DataListRowMenu, {
|
11770
11834
|
row,
|
11771
11835
|
index,
|
@@ -11776,17 +11840,14 @@ var DataList2 = (_a) => {
|
|
11776
11840
|
}),
|
11777
11841
|
disabled,
|
11778
11842
|
additionalRowProps: (row2) => {
|
11779
|
-
var
|
11843
|
+
var _a4;
|
11780
11844
|
return selectable ? {
|
11781
|
-
"aria-selected": (
|
11845
|
+
"aria-selected": (_a4 = selected == null ? void 0 : selected.includes(row2.id)) != null ? _a4 : false
|
11782
11846
|
} : {};
|
11783
11847
|
},
|
11784
11848
|
renderFirstColumn: (row2, index2) => {
|
11785
|
-
var _a3;
|
11786
|
-
const isChecked = (_a3 = selected == null ? void 0 : selected.includes(row2.id)) != null ? _a3 : false;
|
11787
|
-
const isDisabled = disabled == null ? void 0 : disabled(row2, index2, sortedRows);
|
11788
11849
|
return /* @__PURE__ */ import_react79.default.createElement(import_react79.default.Fragment, null, selectable && /* @__PURE__ */ import_react79.default.createElement(DataList.Cell, null, /* @__PURE__ */ import_react79.default.createElement(Checkbox, {
|
11789
|
-
"aria-label":
|
11850
|
+
"aria-label": getRowCheckboxLabel(row2, index2, isChecked, sortedRows),
|
11790
11851
|
onChange: handleSelectionChange(row2.id),
|
11791
11852
|
checked: isChecked,
|
11792
11853
|
disabled: isDisabled
|
@@ -12039,7 +12100,7 @@ DataTable.Skeleton = DataListSkeleton;
|
|
12039
12100
|
var import_react84 = __toESM(require("react"));
|
12040
12101
|
var import_dialog = require("@react-aria/dialog");
|
12041
12102
|
var import_overlays6 = require("@react-aria/overlays");
|
12042
|
-
var
|
12103
|
+
var import_utils19 = require("@react-aria/utils");
|
12043
12104
|
var import_overlays7 = require("@react-stately/overlays");
|
12044
12105
|
var import_omit8 = __toESM(require("lodash/omit"));
|
12045
12106
|
|
@@ -12188,8 +12249,13 @@ Modal.Actions = (_a) => {
|
|
12188
12249
|
// src/molecules/Dialog/Dialog.tsx
|
12189
12250
|
var Dialog = (props) => {
|
12190
12251
|
const ref = import_react84.default.useRef(null);
|
12191
|
-
const
|
12192
|
-
const
|
12252
|
+
const { open, onClose } = props;
|
12253
|
+
const state = (0, import_overlays7.useOverlayTriggerState)({ isOpen: open, onOpenChange: (isOpen) => !isOpen && (onClose == null ? void 0 : onClose()) });
|
12254
|
+
const { modalProps, underlayProps } = (0, import_overlays6.useModalOverlay)(
|
12255
|
+
{ isDismissable: false, isKeyboardDismissDisabled: false },
|
12256
|
+
state,
|
12257
|
+
ref
|
12258
|
+
);
|
12193
12259
|
if (!state.isOpen) {
|
12194
12260
|
return null;
|
12195
12261
|
}
|
@@ -12209,10 +12275,14 @@ var DialogWrapper = ({
|
|
12209
12275
|
secondaryAction
|
12210
12276
|
}) => {
|
12211
12277
|
const ref = import_react84.default.useRef(null);
|
12212
|
-
const labelledBy = (0,
|
12213
|
-
const describedBy = (0,
|
12278
|
+
const labelledBy = (0, import_utils19.useId)();
|
12279
|
+
const describedBy = (0, import_utils19.useId)();
|
12214
12280
|
const { dialogProps } = (0, import_dialog.useDialog)(
|
12215
|
-
{
|
12281
|
+
{
|
12282
|
+
"role": "alertdialog",
|
12283
|
+
"aria-labelledby": labelledBy,
|
12284
|
+
"aria-describedby": describedBy
|
12285
|
+
},
|
12216
12286
|
ref
|
12217
12287
|
);
|
12218
12288
|
return /* @__PURE__ */ import_react84.default.createElement("div", __spreadProps(__spreadValues({
|
@@ -12243,9 +12313,9 @@ var import_react86 = __toESM(require("react"));
|
|
12243
12313
|
var import_react_stately = require("react-stately");
|
12244
12314
|
var import_dialog2 = require("@react-aria/dialog");
|
12245
12315
|
var import_overlays8 = require("@react-aria/overlays");
|
12246
|
-
var
|
12316
|
+
var import_utils20 = require("@react-aria/utils");
|
12247
12317
|
var import_web4 = require("@react-spring/web");
|
12248
|
-
var
|
12318
|
+
var import_castArray3 = __toESM(require("lodash/castArray"));
|
12249
12319
|
var import_omit9 = __toESM(require("lodash/omit"));
|
12250
12320
|
|
12251
12321
|
// src/molecules/Tabs/Tabs.tsx
|
@@ -12632,8 +12702,8 @@ var DrawerWrapper = import_react86.default.forwardRef(
|
|
12632
12702
|
"menuAriaLabel"
|
12633
12703
|
]);
|
12634
12704
|
var _a2;
|
12635
|
-
const labelledBy = (0,
|
12636
|
-
const describedBy = (0,
|
12705
|
+
const labelledBy = (0, import_utils20.useId)();
|
12706
|
+
const describedBy = (0, import_utils20.useId)();
|
12637
12707
|
const { dialogProps } = (0, import_dialog2.useDialog)(
|
12638
12708
|
{ "role": "dialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
12639
12709
|
ref
|
@@ -12674,7 +12744,7 @@ var DrawerWrapper = import_react86.default.forwardRef(
|
|
12674
12744
|
}, /* @__PURE__ */ import_react86.default.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ import_react86.default.createElement(Button.Icon, {
|
12675
12745
|
"aria-label": (_a2 = menuAriaLabel != null ? menuAriaLabel : menuLabel) != null ? _a2 : "Context menu",
|
12676
12746
|
icon: import_more4.default
|
12677
|
-
})), menu)), secondaryActions && (0,
|
12747
|
+
})), menu)), secondaryActions && (0, import_castArray3.default)(secondaryActions).filter(Boolean).map((_b2) => {
|
12678
12748
|
var _c = _b2, { text } = _c, action = __objRest(_c, ["text"]);
|
12679
12749
|
return /* @__PURE__ */ import_react86.default.createElement(Button.Secondary, __spreadValues({
|
12680
12750
|
key: text
|
@@ -12697,7 +12767,7 @@ var import_react90 = __toESM(require("react"));
|
|
12697
12767
|
var import_react89 = __toESM(require("react"));
|
12698
12768
|
var import_interactions3 = require("@react-aria/interactions");
|
12699
12769
|
var import_overlays9 = require("@react-aria/overlays");
|
12700
|
-
var
|
12770
|
+
var import_utils22 = require("@react-aria/utils");
|
12701
12771
|
var import_overlays10 = require("@react-stately/overlays");
|
12702
12772
|
var import_classnames8 = __toESM(require("classnames"));
|
12703
12773
|
var import_omit10 = __toESM(require("lodash/omit"));
|
@@ -12804,7 +12874,7 @@ var PopoverTriggerWrapper = (_a) => {
|
|
12804
12874
|
const { pressProps } = (0, import_interactions3.usePress)(__spreadProps(__spreadValues({}, rest), { ref }));
|
12805
12875
|
return import_react89.default.cloneElement(trigger, __spreadProps(__spreadValues({
|
12806
12876
|
"ref": ref
|
12807
|
-
}, (0,
|
12877
|
+
}, (0, import_utils22.mergeProps)(pressProps, trigger.props)), {
|
12808
12878
|
"aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
|
12809
12879
|
}));
|
12810
12880
|
};
|
@@ -13195,9 +13265,9 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
13195
13265
|
var import_react99 = __toESM(require("react"));
|
13196
13266
|
var import_dialog4 = require("@react-aria/dialog");
|
13197
13267
|
var import_overlays11 = require("@react-aria/overlays");
|
13198
|
-
var
|
13268
|
+
var import_utils24 = require("@react-aria/utils");
|
13199
13269
|
var import_overlays12 = require("@react-stately/overlays");
|
13200
|
-
var
|
13270
|
+
var import_castArray4 = __toESM(require("lodash/castArray"));
|
13201
13271
|
var import_omit11 = __toESM(require("lodash/omit"));
|
13202
13272
|
var import_cross7 = __toESM(require_cross());
|
13203
13273
|
var Modal2 = (_a) => {
|
@@ -13226,8 +13296,8 @@ var Modal2 = (_a) => {
|
|
13226
13296
|
var ModalWrapper = import_react99.default.forwardRef(
|
13227
13297
|
(_a, ref) => {
|
13228
13298
|
var _b = _a, { title, subtitle, headerImage, primaryAction, secondaryActions, children, onClose } = _b, props = __objRest(_b, ["title", "subtitle", "headerImage", "primaryAction", "secondaryActions", "children", "onClose"]);
|
13229
|
-
const labelledBy = (0,
|
13230
|
-
const describedBy = (0,
|
13299
|
+
const labelledBy = (0, import_utils24.useId)();
|
13300
|
+
const describedBy = (0, import_utils24.useId)();
|
13231
13301
|
const { dialogProps } = (0, import_dialog4.useDialog)(
|
13232
13302
|
{ "role": "dialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
|
13233
13303
|
ref
|
@@ -13250,7 +13320,7 @@ var ModalWrapper = import_react99.default.forwardRef(
|
|
13250
13320
|
id: describedBy,
|
13251
13321
|
tabIndex: 0,
|
13252
13322
|
noFooter: !(secondaryActions || primaryAction)
|
13253
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ import_react99.default.createElement(Modal.Footer, null, /* @__PURE__ */ import_react99.default.createElement(Modal.Actions, null, secondaryActions && (0,
|
13323
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ import_react99.default.createElement(Modal.Footer, null, /* @__PURE__ */ import_react99.default.createElement(Modal.Actions, null, secondaryActions && (0, import_castArray4.default)(secondaryActions).filter(Boolean).map((_a2) => {
|
13254
13324
|
var _b2 = _a2, { text } = _b2, action = __objRest(_b2, ["text"]);
|
13255
13325
|
return /* @__PURE__ */ import_react99.default.createElement(Button.Secondary, __spreadValues({
|
13256
13326
|
key: text
|
@@ -13273,8 +13343,8 @@ var ModalTabs = createTabsComponent(
|
|
13273
13343
|
|
13274
13344
|
// src/molecules/MultiInput/MultiInput.tsx
|
13275
13345
|
var import_react101 = __toESM(require("react"));
|
13276
|
-
var
|
13277
|
-
var
|
13346
|
+
var import_utils26 = require("@react-aria/utils");
|
13347
|
+
var import_castArray5 = __toESM(require("lodash/castArray"));
|
13278
13348
|
var import_identity = __toESM(require("lodash/identity"));
|
13279
13349
|
var import_omit12 = __toESM(require("lodash/omit"));
|
13280
13350
|
|
@@ -13414,7 +13484,7 @@ var MultiInputBase = (_a) => {
|
|
13414
13484
|
inputRef.current.value = "";
|
13415
13485
|
}
|
13416
13486
|
if (value2) {
|
13417
|
-
const newItems = (0,
|
13487
|
+
const newItems = (0, import_castArray5.default)(value2).map(createItem).filter((item) => !items.includes(item));
|
13418
13488
|
if (newItems.length > 0 && items.length + newItems.length <= (maxLength != null ? maxLength : Number.MAX_SAFE_INTEGER)) {
|
13419
13489
|
const updated = (items != null ? items : []).concat(newItems);
|
13420
13490
|
setItems(updated);
|
@@ -13503,9 +13573,9 @@ var MultiInput = (props) => {
|
|
13503
13573
|
var _a2;
|
13504
13574
|
setValue((_a2 = props.value) != null ? _a2 : []);
|
13505
13575
|
}, [JSON.stringify(props.value)]);
|
13506
|
-
const defaultId = (0,
|
13576
|
+
const defaultId = (0, import_utils26.useId)();
|
13507
13577
|
const id = (_e = (_d = props.id) != null ? _d : props.name) != null ? _e : defaultId;
|
13508
|
-
const errorMessageId = (0,
|
13578
|
+
const errorMessageId = (0, import_utils26.useId)();
|
13509
13579
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13510
13580
|
const labelControlProps = getLabelControlProps(props);
|
13511
13581
|
const baseProps = (0, import_omit12.default)(props, Object.keys(labelControlProps));
|
@@ -13536,7 +13606,7 @@ MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
|
13536
13606
|
// src/molecules/MultiSelect/MultiSelect.tsx
|
13537
13607
|
var import_react102 = __toESM(require("react"));
|
13538
13608
|
var import_overlays13 = require("@react-aria/overlays");
|
13539
|
-
var
|
13609
|
+
var import_utils27 = require("@react-aria/utils");
|
13540
13610
|
var import_downshift3 = require("downshift");
|
13541
13611
|
var import_isArray4 = __toESM(require("lodash/isArray"));
|
13542
13612
|
var import_isEqual = __toESM(require("lodash/isEqual"));
|
@@ -13781,9 +13851,9 @@ var MultiSelect = (_a) => {
|
|
13781
13851
|
"emptyState"
|
13782
13852
|
]);
|
13783
13853
|
var _a2;
|
13784
|
-
const defaultId = (0,
|
13854
|
+
const defaultId = (0, import_utils27.useId)();
|
13785
13855
|
const id = (_a2 = props.id) != null ? _a2 : defaultId;
|
13786
|
-
const errorMessageId = (0,
|
13856
|
+
const errorMessageId = (0, import_utils27.useId)();
|
13787
13857
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13788
13858
|
const labelControlProps = getLabelControlProps(props);
|
13789
13859
|
const baseProps = (0, import_omit13.default)(props, Object.keys(labelControlProps));
|
@@ -13807,7 +13877,7 @@ MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
|
13807
13877
|
|
13808
13878
|
// src/molecules/NativeSelect/NativeSelect.tsx
|
13809
13879
|
var import_react103 = __toESM(require("react"));
|
13810
|
-
var
|
13880
|
+
var import_utils28 = require("@react-aria/utils");
|
13811
13881
|
var import_omit14 = __toESM(require("lodash/omit"));
|
13812
13882
|
var import_uniqueId = __toESM(require("lodash/uniqueId"));
|
13813
13883
|
var import_caretDown2 = __toESM(require_caretDown());
|
@@ -13869,9 +13939,9 @@ var NativeSelect = import_react103.default.forwardRef(
|
|
13869
13939
|
(_a, ref) => {
|
13870
13940
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
13871
13941
|
var _a2;
|
13872
|
-
const defaultId = (0,
|
13942
|
+
const defaultId = (0, import_utils28.useId)();
|
13873
13943
|
const id = (_a2 = props.id) != null ? _a2 : defaultId;
|
13874
|
-
const errorMessageId = (0,
|
13944
|
+
const errorMessageId = (0, import_utils28.useId)();
|
13875
13945
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
13876
13946
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
13877
13947
|
const baseProps = (0, import_omit14.default)(props, Object.keys(labelControlProps));
|
@@ -14013,7 +14083,7 @@ Navigation2.Section = Navigation.Section;
|
|
14013
14083
|
|
14014
14084
|
// src/molecules/PageHeader/PageHeader.tsx
|
14015
14085
|
var import_react107 = __toESM(require("react"));
|
14016
|
-
var
|
14086
|
+
var import_castArray6 = __toESM(require("lodash/castArray"));
|
14017
14087
|
|
14018
14088
|
// src/atoms/PageHeader/PageHeader.tsx
|
14019
14089
|
var import_react106 = __toESM(require("react"));
|
@@ -14107,7 +14177,7 @@ var CommonPageHeader = ({
|
|
14107
14177
|
}, /* @__PURE__ */ import_react107.default.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ import_react107.default.createElement(Button.Icon, {
|
14108
14178
|
"aria-label": menuAriaLabel,
|
14109
14179
|
icon: import_more5.default
|
14110
|
-
})), menu)), secondaryActions && (0,
|
14180
|
+
})), menu)), secondaryActions && (0, import_castArray6.default)(secondaryActions).filter(Boolean).map((secondaryAction2) => renderAction({ kind: "secondary", action: secondaryAction2 })), primaryAction && renderAction({ kind: "primary", action: primaryAction })));
|
14111
14181
|
};
|
14112
14182
|
var PageHeader2 = (props) => /* @__PURE__ */ import_react107.default.createElement(CommonPageHeader, __spreadValues({}, props));
|
14113
14183
|
PageHeader2.displayName = "PageHeader";
|
@@ -14326,7 +14396,7 @@ RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
|
|
14326
14396
|
|
14327
14397
|
// src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
|
14328
14398
|
var import_react113 = __toESM(require("react"));
|
14329
|
-
var
|
14399
|
+
var import_utils30 = require("@react-aria/utils");
|
14330
14400
|
var isRadioButton = (c) => {
|
14331
14401
|
return import_react113.default.isValidElement(c) && c.type === RadioButton2;
|
14332
14402
|
};
|
@@ -14352,7 +14422,7 @@ var RadioButtonGroup = (_a) => {
|
|
14352
14422
|
]);
|
14353
14423
|
var _a2;
|
14354
14424
|
const [value, setValue] = import_react113.default.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
14355
|
-
const errorMessageId = (0,
|
14425
|
+
const errorMessageId = (0, import_utils30.useId)();
|
14356
14426
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
14357
14427
|
const labelControlProps = getLabelControlProps(props);
|
14358
14428
|
if (_value !== void 0 && _value !== value) {
|
@@ -14407,9 +14477,9 @@ RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
|
|
14407
14477
|
|
14408
14478
|
// src/molecules/Section/Section.tsx
|
14409
14479
|
var import_react118 = __toESM(require("react"));
|
14410
|
-
var
|
14480
|
+
var import_utils31 = require("@react-aria/utils");
|
14411
14481
|
var import_web5 = require("@react-spring/web");
|
14412
|
-
var
|
14482
|
+
var import_castArray7 = __toESM(require("lodash/castArray"));
|
14413
14483
|
var import_isUndefined9 = __toESM(require("lodash/isUndefined"));
|
14414
14484
|
|
14415
14485
|
// src/molecules/Switch/Switch.tsx
|
@@ -14645,9 +14715,9 @@ var Section4 = (props) => {
|
|
14645
14715
|
},
|
14646
14716
|
immediate: !_collapsible
|
14647
14717
|
}), { transform, backgroundColor } = _f, spring = __objRest(_f, ["transform", "backgroundColor"]);
|
14648
|
-
const toggleId = (0,
|
14649
|
-
const regionId = (0,
|
14650
|
-
const titleId = (0,
|
14718
|
+
const toggleId = (0, import_utils31.useId)();
|
14719
|
+
const regionId = (0, import_utils31.useId)();
|
14720
|
+
const titleId = (0, import_utils31.useId)();
|
14651
14721
|
const hasTabs = isComponentType(children, Tabs);
|
14652
14722
|
return /* @__PURE__ */ import_react118.default.createElement(Section3, {
|
14653
14723
|
"aria-label": title,
|
@@ -14682,7 +14752,7 @@ var Section4 = (props) => {
|
|
14682
14752
|
}, /* @__PURE__ */ import_react118.default.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ import_react118.default.createElement(Button.Icon, {
|
14683
14753
|
"aria-label": menuAriaLabel,
|
14684
14754
|
icon: import_more6.default
|
14685
|
-
})), menu)), props.actions && (0,
|
14755
|
+
})), menu)), props.actions && (0, import_castArray7.default)(props.actions).filter(Boolean).map((action) => renderAction({ kind: "secondary", action })), props.switch && /* @__PURE__ */ import_react118.default.createElement(Switch2, __spreadValues({}, props.switch)), props.select && /* @__PURE__ */ import_react118.default.createElement(SelectBase, __spreadValues({
|
14686
14756
|
"aria-labelledby": titleId
|
14687
14757
|
}, props.select)))), !hasTabs && /* @__PURE__ */ import_react118.default.createElement(import_web5.animated.div, {
|
14688
14758
|
className: tw(`h-[1px]`),
|
@@ -14915,7 +14985,7 @@ Stepper2.Step = Step2;
|
|
14915
14985
|
|
14916
14986
|
// src/molecules/SwitchGroup/SwitchGroup.tsx
|
14917
14987
|
var import_react122 = __toESM(require("react"));
|
14918
|
-
var
|
14988
|
+
var import_utils34 = require("@react-aria/utils");
|
14919
14989
|
var SwitchGroup = (_a) => {
|
14920
14990
|
var _b = _a, {
|
14921
14991
|
value,
|
@@ -14937,7 +15007,7 @@ var SwitchGroup = (_a) => {
|
|
14937
15007
|
if (value !== void 0 && value !== selectedItems) {
|
14938
15008
|
setSelectedItems(value);
|
14939
15009
|
}
|
14940
|
-
const errorMessageId = (0,
|
15010
|
+
const errorMessageId = (0, import_utils34.useId)();
|
14941
15011
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
14942
15012
|
const labelControlProps = getLabelControlProps(props);
|
14943
15013
|
const handleChange = (e) => {
|
@@ -14981,7 +15051,7 @@ SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
|
|
14981
15051
|
|
14982
15052
|
// src/molecules/Textarea/Textarea.tsx
|
14983
15053
|
var import_react123 = __toESM(require("react"));
|
14984
|
-
var
|
15054
|
+
var import_utils36 = require("@react-aria/utils");
|
14985
15055
|
var import_omit16 = __toESM(require("lodash/omit"));
|
14986
15056
|
var import_toString2 = __toESM(require("lodash/toString"));
|
14987
15057
|
var TextareaBase = import_react123.default.forwardRef(
|
@@ -15001,9 +15071,9 @@ TextareaBase.Skeleton = () => /* @__PURE__ */ import_react123.default.createElem
|
|
15001
15071
|
var Textarea = import_react123.default.forwardRef((props, ref) => {
|
15002
15072
|
var _a, _b, _c;
|
15003
15073
|
const [value, setValue] = (0, import_react123.useState)((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
15004
|
-
const defaultId = (0,
|
15074
|
+
const defaultId = (0, import_utils36.useId)();
|
15005
15075
|
const id = (_c = props.id) != null ? _c : defaultId;
|
15006
|
-
const errorMessageId = (0,
|
15076
|
+
const errorMessageId = (0, import_utils36.useId)();
|
15007
15077
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
15008
15078
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
15009
15079
|
const baseProps = (0, import_omit16.default)(props, Object.keys(labelControlProps));
|