@aivenio/aquarium 1.3.0 → 1.4.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 +2 -1
- package/dist/_variables_timescale.scss +2 -1
- package/dist/atoms.cjs +129 -53
- package/dist/atoms.mjs +128 -53
- package/dist/src/common/RadioButton/RadioButton.js +5 -12
- package/dist/src/common/Stepper/Stepper.d.ts +33 -0
- package/dist/src/common/Stepper/Stepper.js +60 -0
- package/dist/src/common/Table/Table.js +2 -2
- package/dist/src/common/index.d.ts +1 -0
- package/dist/src/common/index.js +2 -1
- package/dist/src/components/Container/Container.d.ts +16 -0
- package/dist/src/components/Container/Container.js +18 -0
- package/dist/src/components/Stepper/Stepper.d.ts +24 -0
- package/dist/src/components/Stepper/Stepper.js +24 -0
- package/dist/src/components/index.d.ts +2 -0
- package/dist/src/components/index.js +3 -1
- package/dist/styles.css +93 -38
- package/dist/styles_timescaledb.css +93 -38
- package/dist/system.cjs +640 -512
- package/dist/system.mjs +596 -470
- package/dist/tailwind.config.js +4 -1
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/types/tailwindGenerated.d.ts +1 -1
- package/package.json +1 -1
package/dist/system.mjs
CHANGED
@@ -1560,6 +1560,7 @@ __export(components_exports, {
|
|
1560
1560
|
ChoiceChip: () => ChoiceChip,
|
1561
1561
|
Combobox: () => Combobox,
|
1562
1562
|
ComboboxBase: () => ComboboxBase,
|
1563
|
+
Container: () => Container2,
|
1563
1564
|
Context: () => Context,
|
1564
1565
|
ControlLabel: () => ControlLabel,
|
1565
1566
|
DataList: () => DataList2,
|
@@ -1621,6 +1622,7 @@ __export(components_exports, {
|
|
1621
1622
|
SelectItem: () => SelectItem,
|
1622
1623
|
Skeleton: () => Skeleton,
|
1623
1624
|
StatusChip: () => StatusChip,
|
1625
|
+
Stepper: () => Stepper2,
|
1624
1626
|
Switch: () => Switch2,
|
1625
1627
|
SwitchGroup: () => SwitchGroup,
|
1626
1628
|
TabContainer: () => TabContainer,
|
@@ -4944,12 +4946,27 @@ var Combobox = (_a) => {
|
|
4944
4946
|
};
|
4945
4947
|
Combobox.Skeleton = () => /* @__PURE__ */ React38.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React38.createElement(ComboboxBase.Skeleton, null));
|
4946
4948
|
|
4949
|
+
// src/components/Container/Container.tsx
|
4950
|
+
import React39 from "react";
|
4951
|
+
var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React39.createElement(Box, {
|
4952
|
+
marginLeft: "auto",
|
4953
|
+
marginRight: "auto",
|
4954
|
+
width: "full",
|
4955
|
+
className: tw({
|
4956
|
+
"max-w-screen-xl": maxWidth === "xl",
|
4957
|
+
"max-w-screen-lg": maxWidth === "lg",
|
4958
|
+
"max-w-screen-md": maxWidth === "md",
|
4959
|
+
"max-w-screen-sm": maxWidth === "sm",
|
4960
|
+
"max-w-screen-xs": maxWidth === "xs"
|
4961
|
+
})
|
4962
|
+
}, children);
|
4963
|
+
|
4947
4964
|
// src/components/DataList/DataList.tsx
|
4948
|
-
import
|
4965
|
+
import React45 from "react";
|
4949
4966
|
import orderBy2 from "lodash/orderBy";
|
4950
4967
|
|
4951
4968
|
// src/components/Template/Template.tsx
|
4952
|
-
import
|
4969
|
+
import React40 from "react";
|
4953
4970
|
var Template = ({
|
4954
4971
|
children,
|
4955
4972
|
columns,
|
@@ -4975,78 +4992,71 @@ var Template = ({
|
|
4975
4992
|
rowGap,
|
4976
4993
|
columnGap
|
4977
4994
|
});
|
4978
|
-
return /* @__PURE__ */
|
4995
|
+
return /* @__PURE__ */ React40.createElement("div", {
|
4979
4996
|
style: __spreadValues({}, styles)
|
4980
4997
|
}, children);
|
4981
4998
|
};
|
4982
4999
|
|
4983
5000
|
// src/common/DataList/DataList.tsx
|
4984
|
-
import
|
5001
|
+
import React43 from "react";
|
4985
5002
|
|
4986
5003
|
// src/common/Table/Table.tsx
|
4987
|
-
import
|
5004
|
+
import React42 from "react";
|
4988
5005
|
|
4989
5006
|
// src/common/RadioButton/RadioButton.tsx
|
4990
|
-
import
|
4991
|
-
var RadioButton =
|
5007
|
+
import React41 from "react";
|
5008
|
+
var RadioButton = React41.forwardRef(
|
4992
5009
|
(_a, ref) => {
|
4993
5010
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
4994
|
-
return /* @__PURE__ */
|
4995
|
-
className: classNames(tw("inline-flex justify-center items-center relative self-center"))
|
4996
|
-
}, /* @__PURE__ */ React40.createElement("input", __spreadProps(__spreadValues({
|
5011
|
+
return /* @__PURE__ */ React41.createElement("input", __spreadProps(__spreadValues({
|
4997
5012
|
id,
|
4998
5013
|
ref,
|
4999
5014
|
type: "radio",
|
5000
5015
|
name
|
5001
5016
|
}, props), {
|
5002
|
-
className:
|
5017
|
+
className: classNames(
|
5018
|
+
tw(
|
5019
|
+
"inline-flex justify-center items-center self-center appearance-none ",
|
5020
|
+
"w-5 h-5 p-[3px] rounded-full cursor-pointer border border-grey-20",
|
5021
|
+
"focus:border-info-70 checked:bg-navyBlue-100 checked:shadow-whiteInset",
|
5022
|
+
{
|
5023
|
+
"hover:border-grey-50 checked:border-navyBlue-100": !disabled,
|
5024
|
+
"cursor-not-allowed border-grey-5 bg-grey-0 checked:bg-opacity-40": disabled
|
5025
|
+
}
|
5026
|
+
)
|
5027
|
+
),
|
5003
5028
|
readOnly,
|
5004
5029
|
disabled
|
5005
|
-
}))
|
5006
|
-
className: tw(
|
5007
|
-
"rounded-full w-5 h-5 p-[3px] border cursor-pointer",
|
5008
|
-
"border-grey-20 peer-focus/radio:border-info-70",
|
5009
|
-
"peer-checked/radio:[&>*]:block",
|
5010
|
-
{
|
5011
|
-
"peer-checked/radio:border-navyBlue-100 peer-hover/radio:border-grey-50": !disabled,
|
5012
|
-
"border-grey-5 peer-checked/radio:[&>*]:opacity-40": disabled
|
5013
|
-
}
|
5014
|
-
)
|
5015
|
-
}, /* @__PURE__ */ React40.createElement("span", {
|
5016
|
-
style: { backgroundColor: "currentcolor" },
|
5017
|
-
className: tw("w-3 h-3 rounded-full hidden bg-navyBlue-100 pointer-events-none", {
|
5018
|
-
"peer-checked/radio:opacity-40": disabled
|
5019
|
-
})
|
5020
|
-
})));
|
5030
|
+
}));
|
5021
5031
|
}
|
5022
5032
|
);
|
5023
5033
|
|
5024
5034
|
// src/common/Table/Table.tsx
|
5025
5035
|
var import_chevronDown3 = __toESM(require_chevronDown());
|
5026
5036
|
var import_chevronUp2 = __toESM(require_chevronUp());
|
5027
|
-
var HeadContext =
|
5037
|
+
var HeadContext = React42.createContext(null);
|
5028
5038
|
var tableClassNames = tw("w-full relative typography-default border-spacing-0");
|
5029
5039
|
var Table = (_a) => {
|
5030
5040
|
var _b = _a, { children, ariaLabel, className } = _b, rest = __objRest(_b, ["children", "ariaLabel", "className"]);
|
5031
|
-
return /* @__PURE__ */
|
5041
|
+
return /* @__PURE__ */ React42.createElement("table", __spreadProps(__spreadValues({}, rest), {
|
5032
5042
|
className: classNames(tableClassNames, className),
|
5033
5043
|
"aria-label": ariaLabel
|
5034
5044
|
}), children);
|
5035
5045
|
};
|
5036
5046
|
var TableHead = (_a) => {
|
5037
5047
|
var _b = _a, { children, sticky } = _b, rest = __objRest(_b, ["children", "sticky"]);
|
5038
|
-
return /* @__PURE__ */
|
5048
|
+
return /* @__PURE__ */ React42.createElement("thead", __spreadValues({}, rest), /* @__PURE__ */ React42.createElement("tr", null, /* @__PURE__ */ React42.createElement(HeadContext.Provider, {
|
5039
5049
|
value: { children, sticky }
|
5040
5050
|
}, children)));
|
5041
5051
|
};
|
5042
5052
|
var TableBody = (_a) => {
|
5043
5053
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
5044
|
-
return /* @__PURE__ */
|
5054
|
+
return /* @__PURE__ */ React42.createElement("tbody", __spreadValues({}, rest), children);
|
5045
5055
|
};
|
5046
5056
|
var rowClassNames = tw("children:border-grey-10 children:last:border-b-0 hover:bg-grey-0");
|
5047
5057
|
var TableRow = (_a) => {
|
5048
5058
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5049
|
-
return /* @__PURE__ */
|
5059
|
+
return /* @__PURE__ */ React42.createElement("tr", __spreadProps(__spreadValues({}, rest), {
|
5050
5060
|
className: classNames(rowClassNames, className)
|
5051
5061
|
}), children);
|
5052
5062
|
};
|
@@ -5058,29 +5068,29 @@ var getBodyCellClassNames = (table = true) => tw("text-grey-70 py-3", {
|
|
5058
5068
|
var getAlignClassNames = (align) => tw({ "text-right": align === "right", "text-center": align === "center" });
|
5059
5069
|
var getHeadCellClassNames = (sticky = true) => {
|
5060
5070
|
const common = tw("py-[14px] text-left bg-white border-grey-40 text-grey-50 font-normal");
|
5061
|
-
return sticky ? classNames(common, tw("sticky top-0")) : common;
|
5071
|
+
return sticky ? classNames(common, tw("sticky top-0 z-10")) : common;
|
5062
5072
|
};
|
5063
5073
|
var TableCell = (_a) => {
|
5064
5074
|
var _b = _a, { children, className, align = "left" } = _b, rest = __objRest(_b, ["children", "className", "align"]);
|
5065
|
-
const headContext =
|
5066
|
-
return headContext ? /* @__PURE__ */
|
5075
|
+
const headContext = React42.useContext(HeadContext);
|
5076
|
+
return headContext ? /* @__PURE__ */ React42.createElement("th", __spreadProps(__spreadValues({}, rest), {
|
5067
5077
|
className: classNames(
|
5068
5078
|
cellClassNames,
|
5069
5079
|
getHeadCellClassNames(headContext.sticky),
|
5070
5080
|
getAlignClassNames(align),
|
5071
5081
|
className
|
5072
5082
|
)
|
5073
|
-
}), children) : /* @__PURE__ */
|
5083
|
+
}), children) : /* @__PURE__ */ React42.createElement("td", __spreadProps(__spreadValues({}, rest), {
|
5074
5084
|
className: classNames(cellClassNames, getBodyCellClassNames(), getAlignClassNames(align), className)
|
5075
5085
|
}), children);
|
5076
5086
|
};
|
5077
5087
|
var TableSelectCell = (_a) => {
|
5078
5088
|
var _b = _a, { ariaLabel } = _b, props = __objRest(_b, ["ariaLabel"]);
|
5079
|
-
return /* @__PURE__ */
|
5089
|
+
return /* @__PURE__ */ React42.createElement(Table.Cell, {
|
5080
5090
|
className: tw("leading-[0px]")
|
5081
|
-
}, props.type === "radio" ? /* @__PURE__ */
|
5091
|
+
}, props.type === "radio" ? /* @__PURE__ */ React42.createElement(RadioButton, __spreadValues({
|
5082
5092
|
"aria-label": ariaLabel
|
5083
|
-
}, props)) : /* @__PURE__ */
|
5093
|
+
}, props)) : /* @__PURE__ */ React42.createElement(Checkbox, __spreadValues({
|
5084
5094
|
"aria-label": ariaLabel
|
5085
5095
|
}, props)));
|
5086
5096
|
};
|
@@ -5090,39 +5100,39 @@ var getSortCellIconClassNames = (active) => {
|
|
5090
5100
|
};
|
5091
5101
|
var TableSortCell = (_a) => {
|
5092
5102
|
var _b = _a, { children, direction = "none", onClick } = _b, rest = __objRest(_b, ["children", "direction", "onClick"]);
|
5093
|
-
return /* @__PURE__ */
|
5103
|
+
return /* @__PURE__ */ React42.createElement(Table.Cell, __spreadProps(__spreadValues({}, rest), {
|
5094
5104
|
"aria-sort": direction
|
5095
|
-
}), /* @__PURE__ */
|
5105
|
+
}), /* @__PURE__ */ React42.createElement("span", {
|
5096
5106
|
className: getSortCellButtonClassNames(rest.align),
|
5097
5107
|
role: "button",
|
5098
5108
|
tabIndex: -1,
|
5099
5109
|
onClick
|
5100
|
-
}, children, /* @__PURE__ */
|
5110
|
+
}, children, /* @__PURE__ */ React42.createElement("div", {
|
5101
5111
|
"data-sort-icons": true,
|
5102
5112
|
className: tw("flex flex-col", {
|
5103
5113
|
"invisible group-hover:visible": direction === "none"
|
5104
5114
|
})
|
5105
|
-
}, /* @__PURE__ */
|
5115
|
+
}, /* @__PURE__ */ React42.createElement(InlineIcon, {
|
5106
5116
|
icon: import_chevronUp2.default,
|
5107
5117
|
className: getSortCellIconClassNames(direction === "descending")
|
5108
|
-
}), /* @__PURE__ */
|
5118
|
+
}), /* @__PURE__ */ React42.createElement(InlineIcon, {
|
5109
5119
|
icon: import_chevronDown3.default,
|
5110
5120
|
className: getSortCellIconClassNames(direction === "ascending")
|
5111
5121
|
}))));
|
5112
5122
|
};
|
5113
|
-
var Item2 = ({ image, imageAlt, imageSize = 35, title, caption }) => /* @__PURE__ */
|
5123
|
+
var Item2 = ({ image, imageAlt, imageSize = 35, title, caption }) => /* @__PURE__ */ React42.createElement("div", {
|
5114
5124
|
className: tw("flex gap-4 items-center")
|
5115
|
-
}, image && /* @__PURE__ */
|
5125
|
+
}, image && /* @__PURE__ */ React42.createElement("img", {
|
5116
5126
|
src: image,
|
5117
5127
|
alt: imageAlt,
|
5118
5128
|
style: { width: imageSize, height: imageSize }
|
5119
|
-
}), /* @__PURE__ */
|
5120
|
-
Table.Head =
|
5121
|
-
Table.Body =
|
5122
|
-
Table.Row =
|
5123
|
-
Table.Cell =
|
5124
|
-
Table.SortCell =
|
5125
|
-
Table.SelectCell =
|
5129
|
+
}), /* @__PURE__ */ React42.createElement("div", null, title, caption && /* @__PURE__ */ React42.createElement(Typography2.Caption, null, caption)));
|
5130
|
+
Table.Head = React42.memo(TableHead);
|
5131
|
+
Table.Body = React42.memo(TableBody);
|
5132
|
+
Table.Row = React42.memo(TableRow);
|
5133
|
+
Table.Cell = React42.memo(TableCell);
|
5134
|
+
Table.SortCell = React42.memo(TableSortCell);
|
5135
|
+
Table.SelectCell = React42.memo(TableSelectCell);
|
5126
5136
|
|
5127
5137
|
// src/common/DataList/DataList.tsx
|
5128
5138
|
var import_chevronDown4 = __toESM(require_chevronDown());
|
@@ -5134,7 +5144,7 @@ var getAlignClassNames2 = (align) => tw("flex items-center", {
|
|
5134
5144
|
});
|
5135
5145
|
var DataList = (_a) => {
|
5136
5146
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5137
|
-
return /* @__PURE__ */
|
5147
|
+
return /* @__PURE__ */ React43.createElement("div", __spreadValues({}, rest));
|
5138
5148
|
};
|
5139
5149
|
var HeadCell = (_a) => {
|
5140
5150
|
var _b = _a, {
|
@@ -5146,14 +5156,14 @@ var HeadCell = (_a) => {
|
|
5146
5156
|
"sticky",
|
5147
5157
|
"align"
|
5148
5158
|
]);
|
5149
|
-
return /* @__PURE__ */
|
5159
|
+
return /* @__PURE__ */ React43.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5150
5160
|
role: "cell",
|
5151
5161
|
className: classNames(cellClassNames, getHeadCellClassNames(sticky), getAlignClassNames2(align), className)
|
5152
5162
|
}));
|
5153
5163
|
};
|
5154
5164
|
var Cell = (_a) => {
|
5155
5165
|
var _b = _a, { className, align } = _b, rest = __objRest(_b, ["className", "align"]);
|
5156
|
-
return /* @__PURE__ */
|
5166
|
+
return /* @__PURE__ */ React43.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5157
5167
|
role: "cell",
|
5158
5168
|
className: classNames(
|
5159
5169
|
cellClassNames,
|
@@ -5166,30 +5176,30 @@ var Cell = (_a) => {
|
|
5166
5176
|
};
|
5167
5177
|
var Row = (_a) => {
|
5168
5178
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5169
|
-
return /* @__PURE__ */
|
5179
|
+
return /* @__PURE__ */ React43.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5170
5180
|
className: classNames(tw("contents group"), className),
|
5171
5181
|
role: "row"
|
5172
5182
|
}));
|
5173
5183
|
};
|
5174
5184
|
var SortCell = (_a) => {
|
5175
5185
|
var _b = _a, { children, direction = "none", onClick } = _b, rest = __objRest(_b, ["children", "direction", "onClick"]);
|
5176
|
-
return /* @__PURE__ */
|
5186
|
+
return /* @__PURE__ */ React43.createElement(HeadCell, __spreadProps(__spreadValues({}, rest), {
|
5177
5187
|
"aria-sort": direction,
|
5178
5188
|
role: "cell"
|
5179
|
-
}), /* @__PURE__ */
|
5189
|
+
}), /* @__PURE__ */ React43.createElement("span", {
|
5180
5190
|
className: getSortCellButtonClassNames(rest.align),
|
5181
5191
|
role: "button",
|
5182
5192
|
tabIndex: -1,
|
5183
5193
|
onClick
|
5184
|
-
}, children, /* @__PURE__ */
|
5194
|
+
}, children, /* @__PURE__ */ React43.createElement("div", {
|
5185
5195
|
"data-sort-icons": true,
|
5186
5196
|
className: tw("flex flex-col", {
|
5187
5197
|
"invisible group-hover:visible": direction === "none"
|
5188
5198
|
})
|
5189
|
-
}, /* @__PURE__ */
|
5199
|
+
}, /* @__PURE__ */ React43.createElement(InlineIcon, {
|
5190
5200
|
icon: import_chevronUp3.default,
|
5191
5201
|
className: getSortCellIconClassNames(direction === "descending")
|
5192
|
-
}), /* @__PURE__ */
|
5202
|
+
}), /* @__PURE__ */ React43.createElement(InlineIcon, {
|
5193
5203
|
icon: import_chevronDown4.default,
|
5194
5204
|
className: getSortCellIconClassNames(direction === "ascending")
|
5195
5205
|
}))));
|
@@ -5215,9 +5225,9 @@ var cellProps = (column) => ({
|
|
5215
5225
|
});
|
5216
5226
|
|
5217
5227
|
// src/utils/table/useTableSort.tsx
|
5218
|
-
import
|
5228
|
+
import React44 from "react";
|
5219
5229
|
var useTableSort = () => {
|
5220
|
-
const [sort, setSort] =
|
5230
|
+
const [sort, setSort] = React44.useState();
|
5221
5231
|
const handleSortClick = (field) => {
|
5222
5232
|
if ((sort == null ? void 0 : sort.key) === field) {
|
5223
5233
|
if (sort.direction === "ascending") {
|
@@ -5240,40 +5250,40 @@ var DataList2 = ({ columns, rows }) => {
|
|
5240
5250
|
var _a;
|
5241
5251
|
return (_a = column.width) != null ? _a : "auto";
|
5242
5252
|
});
|
5243
|
-
return /* @__PURE__ */
|
5253
|
+
return /* @__PURE__ */ React45.createElement(Template, {
|
5244
5254
|
columns: templateColumns
|
5245
5255
|
}, columns.map(
|
5246
|
-
(column) => (column.type === "text" || column.type === "number") && column.sortable ? /* @__PURE__ */
|
5256
|
+
(column) => (column.type === "text" || column.type === "number") && column.sortable ? /* @__PURE__ */ React45.createElement(DataList.SortCell, __spreadValues({
|
5247
5257
|
direction: sort && sort.key === column.field ? sort.direction : "none",
|
5248
5258
|
onClick: () => updateSort(column.field)
|
5249
|
-
}, cellProps(column)), column.headerName) : /* @__PURE__ */
|
5250
|
-
), /* @__PURE__ */
|
5259
|
+
}, cellProps(column)), column.headerName) : /* @__PURE__ */ React45.createElement(DataList.HeadCell, __spreadValues({}, cellProps(column)), column.headerName)
|
5260
|
+
), /* @__PURE__ */ React45.createElement(List, {
|
5251
5261
|
items: sortedRows,
|
5252
|
-
renderItem: (row, index) => /* @__PURE__ */
|
5262
|
+
renderItem: (row, index) => /* @__PURE__ */ React45.createElement(DataList.Row, {
|
5253
5263
|
key: row.id
|
5254
|
-
}, /* @__PURE__ */
|
5264
|
+
}, /* @__PURE__ */ React45.createElement(List, {
|
5255
5265
|
items: columns,
|
5256
|
-
renderItem: (column) => column.type === "status" ? /* @__PURE__ */
|
5266
|
+
renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React45.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React45.createElement(StatusChip, __spreadValues({
|
5257
5267
|
dense: true
|
5258
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */
|
5268
|
+
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React45.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React45.createElement(SecondaryButton, __spreadValues({
|
5259
5269
|
dense: true
|
5260
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */
|
5270
|
+
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React45.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React45.createElement(DataList.Cell, null, /* @__PURE__ */ React45.createElement(Item2, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React45.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
|
5261
5271
|
}))
|
5262
5272
|
}));
|
5263
5273
|
};
|
5264
5274
|
|
5265
5275
|
// src/components/DataTable/DataTable.tsx
|
5266
|
-
import
|
5276
|
+
import React48 from "react";
|
5267
5277
|
import orderBy3 from "lodash/orderBy";
|
5268
5278
|
|
5269
5279
|
// src/components/Table/Table.tsx
|
5270
|
-
import
|
5280
|
+
import React47 from "react";
|
5271
5281
|
|
5272
5282
|
// src/utils/table/useScrollTarget.ts
|
5273
|
-
import
|
5283
|
+
import React46 from "react";
|
5274
5284
|
var useScrollTarget = (callback) => {
|
5275
|
-
const targetRef =
|
5276
|
-
|
5285
|
+
const targetRef = React46.useRef(null);
|
5286
|
+
React46.useLayoutEffect(() => {
|
5277
5287
|
const observer = new IntersectionObserver((entries) => entries[0].isIntersecting && callback && callback(), {
|
5278
5288
|
root: null,
|
5279
5289
|
rootMargin: `0px 0px 200px 0px`
|
@@ -5291,12 +5301,12 @@ var Table2 = (_a) => {
|
|
5291
5301
|
var _b = _a, { children, onPrev, onNext } = _b, rest = __objRest(_b, ["children", "onPrev", "onNext"]);
|
5292
5302
|
const bottomRef = useScrollTarget(onNext);
|
5293
5303
|
const topRef = useScrollTarget(onPrev);
|
5294
|
-
return /* @__PURE__ */
|
5304
|
+
return /* @__PURE__ */ React47.createElement("div", {
|
5295
5305
|
className: "relative w-full"
|
5296
|
-
}, /* @__PURE__ */
|
5306
|
+
}, /* @__PURE__ */ React47.createElement("div", {
|
5297
5307
|
ref: topRef,
|
5298
5308
|
className: tw("absolute top-0 h-1 w-full left-0 bg-transparent")
|
5299
|
-
}), /* @__PURE__ */
|
5309
|
+
}), /* @__PURE__ */ React47.createElement(Table, __spreadValues({}, rest), children), /* @__PURE__ */ React47.createElement("div", {
|
5300
5310
|
ref: bottomRef,
|
5301
5311
|
className: tw("absolute bottom-0 h-1 w-full left-0 bg-transparent")
|
5302
5312
|
}));
|
@@ -5323,37 +5333,37 @@ var DataTable = (_a) => {
|
|
5323
5333
|
]);
|
5324
5334
|
const [sort, updateSort] = useTableSort();
|
5325
5335
|
const sortedRows = orderBy3(rows, [sort == null ? void 0 : sort.key], [toSortDirection(sort == null ? void 0 : sort.direction)]);
|
5326
|
-
return /* @__PURE__ */
|
5336
|
+
return /* @__PURE__ */ React48.createElement(Table2, __spreadProps(__spreadValues({}, rest), {
|
5327
5337
|
className: tw({
|
5328
5338
|
"whitespace-nowrap": noWrap,
|
5329
5339
|
"table-auto": layout === "auto",
|
5330
5340
|
"table-fixed": layout === "fixed"
|
5331
5341
|
})
|
5332
|
-
}), /* @__PURE__ */
|
5333
|
-
(column) => (column.type === "text" || column.type === "number") && column.sortable ? /* @__PURE__ */
|
5342
|
+
}), /* @__PURE__ */ React48.createElement(Table2.Head, null, columns.map(
|
5343
|
+
(column) => (column.type === "text" || column.type === "number") && column.sortable ? /* @__PURE__ */ React48.createElement(Table2.SortCell, __spreadValues({
|
5334
5344
|
direction: sort && sort.key === column.field ? sort.direction : "none",
|
5335
5345
|
onClick: () => updateSort(column.field),
|
5336
5346
|
style: { width: column.width }
|
5337
|
-
}, cellProps(column)), column.headerName) : /* @__PURE__ */
|
5347
|
+
}, cellProps(column)), column.headerName) : /* @__PURE__ */ React48.createElement(Table2.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
|
5338
5348
|
style: { width: column.width }
|
5339
5349
|
}), column.headerName)
|
5340
|
-
)), /* @__PURE__ */
|
5350
|
+
)), /* @__PURE__ */ React48.createElement(Table2.Body, null, /* @__PURE__ */ React48.createElement(List, {
|
5341
5351
|
items: sortedRows,
|
5342
|
-
renderItem: (row, index) => /* @__PURE__ */
|
5352
|
+
renderItem: (row, index) => /* @__PURE__ */ React48.createElement(Table2.Row, {
|
5343
5353
|
key: row.id
|
5344
|
-
}, /* @__PURE__ */
|
5354
|
+
}, /* @__PURE__ */ React48.createElement(List, {
|
5345
5355
|
items: columns,
|
5346
|
-
renderItem: (column) => column.type === "status" ? /* @__PURE__ */
|
5356
|
+
renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React48.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React48.createElement(StatusChip, __spreadValues({
|
5347
5357
|
dense: true
|
5348
|
-
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */
|
5358
|
+
}, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React48.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React48.createElement(SecondaryButton, __spreadValues({
|
5349
5359
|
dense: true
|
5350
|
-
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */
|
5360
|
+
}, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React48.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React48.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React48.createElement(Item2, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React48.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
|
5351
5361
|
}))
|
5352
5362
|
})));
|
5353
5363
|
};
|
5354
5364
|
|
5355
5365
|
// src/components/Dialog/Dialog.tsx
|
5356
|
-
import
|
5366
|
+
import React50 from "react";
|
5357
5367
|
import { useDialog } from "@react-aria/dialog";
|
5358
5368
|
import { FocusScope as FocusScope2 } from "@react-aria/focus";
|
5359
5369
|
import { Overlay, useModalOverlay } from "@react-aria/overlays";
|
@@ -5381,10 +5391,10 @@ var DIALOG_ICONS_AND_COLORS = {
|
|
5381
5391
|
};
|
5382
5392
|
|
5383
5393
|
// src/common/Modal/Modal.tsx
|
5384
|
-
import
|
5394
|
+
import React49 from "react";
|
5385
5395
|
var Modal = (_a) => {
|
5386
5396
|
var _b = _a, { children, className, open } = _b, rest = __objRest(_b, ["children", "className", "open"]);
|
5387
|
-
return open ? /* @__PURE__ */
|
5397
|
+
return open ? /* @__PURE__ */ React49.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5388
5398
|
className: classNames(
|
5389
5399
|
tw("inset-0 overflow-y-auto z-modal flex justify-center items-center fixed py-7"),
|
5390
5400
|
className
|
@@ -5393,14 +5403,14 @@ var Modal = (_a) => {
|
|
5393
5403
|
};
|
5394
5404
|
Modal.BackDrop = (_a) => {
|
5395
5405
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5396
|
-
return /* @__PURE__ */
|
5406
|
+
return /* @__PURE__ */ React49.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5397
5407
|
className: classNames(tw("-z-10 fixed min-w-full min-h-full bg-navyBlue-100 opacity-70"), className)
|
5398
5408
|
}));
|
5399
5409
|
};
|
5400
|
-
Modal.Dialog =
|
5410
|
+
Modal.Dialog = React49.forwardRef(
|
5401
5411
|
(_a, ref) => {
|
5402
5412
|
var _b = _a, { children, className, size = "sm" } = _b, rest = __objRest(_b, ["children", "className", "size"]);
|
5403
|
-
return /* @__PURE__ */
|
5413
|
+
return /* @__PURE__ */ React49.createElement("div", __spreadProps(__spreadValues({
|
5404
5414
|
ref,
|
5405
5415
|
"aria-modal": "true"
|
5406
5416
|
}, rest), {
|
@@ -5418,31 +5428,31 @@ Modal.Dialog = React48.forwardRef(
|
|
5418
5428
|
);
|
5419
5429
|
Modal.Header = (_a) => {
|
5420
5430
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5421
|
-
return /* @__PURE__ */
|
5431
|
+
return /* @__PURE__ */ React49.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5422
5432
|
className: classNames(tw("px-7 py-6 gap-3 flex items-center"), className)
|
5423
5433
|
}), children);
|
5424
5434
|
};
|
5425
5435
|
Modal.HeaderImage = (_a) => {
|
5426
5436
|
var _b = _a, { backgroundImage, className } = _b, rest = __objRest(_b, ["backgroundImage", "className"]);
|
5427
5437
|
const common = tw("h-[120px] min-h-[120px] w-full ");
|
5428
|
-
return backgroundImage ? /* @__PURE__ */
|
5438
|
+
return backgroundImage ? /* @__PURE__ */ React49.createElement("img", __spreadProps(__spreadValues({
|
5429
5439
|
"aria-hidden": true,
|
5430
5440
|
src: backgroundImage != null ? backgroundImage : void 0
|
5431
5441
|
}, rest), {
|
5432
5442
|
className: classNames(common, tw("object-cover"), className)
|
5433
|
-
})) : /* @__PURE__ */
|
5443
|
+
})) : /* @__PURE__ */ React49.createElement("div", {
|
5434
5444
|
className: classNames(common, tw("bg-grey-5"), className)
|
5435
5445
|
});
|
5436
5446
|
};
|
5437
5447
|
Modal.CloseButtonContainer = (_a) => {
|
5438
5448
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
5439
|
-
return /* @__PURE__ */
|
5449
|
+
return /* @__PURE__ */ React49.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5440
5450
|
className: classNames(tw("absolute top-[20px] right-[28px]"), className)
|
5441
5451
|
}));
|
5442
5452
|
};
|
5443
5453
|
Modal.Title = (_a) => {
|
5444
5454
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5445
|
-
return /* @__PURE__ */
|
5455
|
+
return /* @__PURE__ */ React49.createElement(Typography, __spreadValues({
|
5446
5456
|
htmlTag: "h2",
|
5447
5457
|
variant: "subheading",
|
5448
5458
|
color: "grey-90",
|
@@ -5451,33 +5461,33 @@ Modal.Title = (_a) => {
|
|
5451
5461
|
};
|
5452
5462
|
Modal.Subtitle = (_a) => {
|
5453
5463
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
5454
|
-
return /* @__PURE__ */
|
5464
|
+
return /* @__PURE__ */ React49.createElement(Typography, __spreadValues({
|
5455
5465
|
variant: "small",
|
5456
5466
|
color: "grey-60"
|
5457
5467
|
}, rest), children);
|
5458
5468
|
};
|
5459
5469
|
Modal.TitleContainer = (_a) => {
|
5460
5470
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5461
|
-
return /* @__PURE__ */
|
5471
|
+
return /* @__PURE__ */ React49.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5462
5472
|
className: classNames(tw("flex flex-col grow gap-2"), className)
|
5463
5473
|
}), children);
|
5464
5474
|
};
|
5465
5475
|
Modal.Body = (_a) => {
|
5466
5476
|
var _b = _a, { children, className, noFooter = false, maxHeight, style } = _b, rest = __objRest(_b, ["children", "className", "noFooter", "maxHeight", "style"]);
|
5467
|
-
return /* @__PURE__ */
|
5477
|
+
return /* @__PURE__ */ React49.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5468
5478
|
className: classNames(tw("px-7 grow overflow-y-auto", { "pb-6": noFooter }), className),
|
5469
5479
|
style: __spreadValues({ maxHeight }, style)
|
5470
5480
|
}), children);
|
5471
5481
|
};
|
5472
5482
|
Modal.Footer = (_a) => {
|
5473
5483
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5474
|
-
return /* @__PURE__ */
|
5484
|
+
return /* @__PURE__ */ React49.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5475
5485
|
className: classNames(tw("px-7 py-6"), className)
|
5476
5486
|
}), children);
|
5477
5487
|
};
|
5478
5488
|
Modal.Actions = (_a) => {
|
5479
5489
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
5480
|
-
return /* @__PURE__ */
|
5490
|
+
return /* @__PURE__ */ React49.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
5481
5491
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
5482
5492
|
}), children);
|
5483
5493
|
};
|
@@ -5491,7 +5501,7 @@ var Dialog = ({
|
|
5491
5501
|
primaryAction,
|
5492
5502
|
secondaryAction
|
5493
5503
|
}) => {
|
5494
|
-
const ref =
|
5504
|
+
const ref = React50.useRef(null);
|
5495
5505
|
const state = useOverlayTriggerState2({ isOpen: open });
|
5496
5506
|
const { modalProps, underlayProps } = useModalOverlay({ isDismissable: false }, state, ref);
|
5497
5507
|
const labelledBy = useId();
|
@@ -5503,34 +5513,34 @@ var Dialog = ({
|
|
5503
5513
|
if (!open) {
|
5504
5514
|
return null;
|
5505
5515
|
}
|
5506
|
-
return /* @__PURE__ */
|
5516
|
+
return /* @__PURE__ */ React50.createElement(Overlay, null, /* @__PURE__ */ React50.createElement(Modal, {
|
5507
5517
|
open
|
5508
|
-
}, /* @__PURE__ */
|
5518
|
+
}, /* @__PURE__ */ React50.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React50.createElement(FocusScope2, {
|
5509
5519
|
contain: true,
|
5510
5520
|
restoreFocus: true,
|
5511
5521
|
autoFocus: true
|
5512
|
-
}, /* @__PURE__ */
|
5522
|
+
}, /* @__PURE__ */ React50.createElement(Modal.Dialog, __spreadValues(__spreadValues({
|
5513
5523
|
ref,
|
5514
5524
|
size: "sm"
|
5515
|
-
}, modalProps), dialogProps), /* @__PURE__ */
|
5525
|
+
}, modalProps), dialogProps), /* @__PURE__ */ React50.createElement(Modal.Header, null, /* @__PURE__ */ React50.createElement(Icon, {
|
5516
5526
|
icon: DIALOG_ICONS_AND_COLORS[type].icon,
|
5517
5527
|
color: DIALOG_ICONS_AND_COLORS[type].color,
|
5518
5528
|
fontSize: 20
|
5519
|
-
}), /* @__PURE__ */
|
5529
|
+
}), /* @__PURE__ */ React50.createElement(Modal.Title, {
|
5520
5530
|
id: labelledBy,
|
5521
5531
|
variant: "large-strong",
|
5522
5532
|
color: DIALOG_ICONS_AND_COLORS[type].color
|
5523
|
-
}, title)), /* @__PURE__ */
|
5533
|
+
}, title)), /* @__PURE__ */ React50.createElement(Modal.Body, {
|
5524
5534
|
id: describedBy
|
5525
|
-
}, children), /* @__PURE__ */
|
5535
|
+
}, children), /* @__PURE__ */ React50.createElement(Modal.Footer, null, /* @__PURE__ */ React50.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ React50.createElement(GhostButton, __spreadValues({
|
5526
5536
|
key: secondaryAction.text
|
5527
|
-
}, omit6(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
5537
|
+
}, omit6(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React50.createElement(SecondaryButton, __spreadValues({
|
5528
5538
|
key: primaryAction.text
|
5529
5539
|
}, omit6(primaryAction, "text")), primaryAction.text)))))));
|
5530
5540
|
};
|
5531
5541
|
|
5532
5542
|
// src/components/Divider/Divider.tsx
|
5533
|
-
import
|
5543
|
+
import React51 from "react";
|
5534
5544
|
var sizeClasses = {
|
5535
5545
|
horizontal: {
|
5536
5546
|
1: "h-1px",
|
@@ -5552,7 +5562,7 @@ var sizeClasses = {
|
|
5552
5562
|
var Divider2 = (_a) => {
|
5553
5563
|
var _b = _a, { direction = "horizontal", size = 1 } = _b, props = __objRest(_b, ["direction", "size"]);
|
5554
5564
|
const sizeClass = sizeClasses[direction][size];
|
5555
|
-
return /* @__PURE__ */
|
5565
|
+
return /* @__PURE__ */ React51.createElement("div", __spreadProps(__spreadValues({}, props), {
|
5556
5566
|
className: tw(`bg-grey-5 ${sizeClass}`, {
|
5557
5567
|
"block w-full": direction === "horizontal",
|
5558
5568
|
"inline-block h-full": direction === "vertical"
|
@@ -5561,10 +5571,10 @@ var Divider2 = (_a) => {
|
|
5561
5571
|
};
|
5562
5572
|
|
5563
5573
|
// src/components/Dropdown/Dropdown.tsx
|
5564
|
-
import
|
5574
|
+
import React53 from "react";
|
5565
5575
|
|
5566
5576
|
// src/components/Popover/Popover.tsx
|
5567
|
-
import
|
5577
|
+
import React52, { useRef as useRef4 } from "react";
|
5568
5578
|
import { PressResponder, usePress } from "@react-aria/interactions";
|
5569
5579
|
import { useOverlayPosition as useOverlayPosition3, useOverlayTrigger } from "@react-aria/overlays";
|
5570
5580
|
import { mergeProps as mergeProps3 } from "@react-aria/utils";
|
@@ -5613,22 +5623,22 @@ var Popover2 = (props) => {
|
|
5613
5623
|
state,
|
5614
5624
|
triggerRef
|
5615
5625
|
);
|
5616
|
-
return /* @__PURE__ */
|
5626
|
+
return /* @__PURE__ */ React52.createElement(PopoverContext.Provider, {
|
5617
5627
|
value: {
|
5618
5628
|
state
|
5619
5629
|
}
|
5620
|
-
},
|
5630
|
+
}, React52.Children.map(props.children, (child) => {
|
5621
5631
|
if (isComponentType(child, Popover2.Trigger)) {
|
5622
|
-
return /* @__PURE__ */
|
5632
|
+
return /* @__PURE__ */ React52.createElement(PressResponder, __spreadValues({
|
5623
5633
|
ref: triggerRef,
|
5624
5634
|
onPress: state.toggle
|
5625
|
-
}, triggerProps), /* @__PURE__ */
|
5635
|
+
}, triggerProps), /* @__PURE__ */ React52.createElement(PopoverTriggerWrapper, {
|
5626
5636
|
"data-testid": props["data-testid"],
|
5627
5637
|
"aria-controls": id
|
5628
5638
|
}, child.props.children));
|
5629
5639
|
}
|
5630
5640
|
if (isComponentType(child, Popover2.Panel)) {
|
5631
|
-
return /* @__PURE__ */
|
5641
|
+
return /* @__PURE__ */ React52.createElement(PopoverWrapper, __spreadProps(__spreadValues(__spreadValues({
|
5632
5642
|
ref: overlayRef,
|
5633
5643
|
isOpen: state.isOpen,
|
5634
5644
|
onClose: state.close,
|
@@ -5659,7 +5669,7 @@ var asPopoverButton = (Component, displayName) => {
|
|
5659
5669
|
state.close();
|
5660
5670
|
onClick == null ? void 0 : onClick(e);
|
5661
5671
|
};
|
5662
|
-
return /* @__PURE__ */
|
5672
|
+
return /* @__PURE__ */ React52.createElement(Component, __spreadProps(__spreadValues({}, props), {
|
5663
5673
|
onClick: handleClick
|
5664
5674
|
}));
|
5665
5675
|
};
|
@@ -5672,9 +5682,9 @@ var PopoverTriggerWrapper = (_a) => {
|
|
5672
5682
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
5673
5683
|
var _a2;
|
5674
5684
|
const ref = useRef4(null);
|
5675
|
-
const trigger =
|
5685
|
+
const trigger = React52.Children.only(children);
|
5676
5686
|
const { pressProps } = usePress(__spreadProps(__spreadValues({}, rest), { ref }));
|
5677
|
-
return
|
5687
|
+
return React52.cloneElement(trigger, __spreadProps(__spreadValues({
|
5678
5688
|
"ref": ref
|
5679
5689
|
}, mergeProps3(pressProps, trigger.props)), {
|
5680
5690
|
"aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
|
@@ -5683,11 +5693,11 @@ var PopoverTriggerWrapper = (_a) => {
|
|
5683
5693
|
|
5684
5694
|
// src/components/Dropdown/Dropdown.tsx
|
5685
5695
|
var Dropdown = ({ children, content, placement = "bottom-left" }) => {
|
5686
|
-
return /* @__PURE__ */
|
5696
|
+
return /* @__PURE__ */ React53.createElement(Popover2, {
|
5687
5697
|
type: "menu",
|
5688
5698
|
placement,
|
5689
5699
|
autoFocus: true
|
5690
|
-
}, /* @__PURE__ */
|
5700
|
+
}, /* @__PURE__ */ React53.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ React53.createElement(Popover2.Panel, null, content));
|
5691
5701
|
};
|
5692
5702
|
var DropdownMenu = ({
|
5693
5703
|
title,
|
@@ -5696,26 +5706,26 @@ var DropdownMenu = ({
|
|
5696
5706
|
triggerId,
|
5697
5707
|
setClose = () => void 0
|
5698
5708
|
}) => {
|
5699
|
-
const menuRef =
|
5700
|
-
|
5709
|
+
const menuRef = React53.useRef(null);
|
5710
|
+
React53.useEffect(() => {
|
5701
5711
|
const id = setTimeout(() => {
|
5702
5712
|
var _a, _b, _c;
|
5703
5713
|
return (_c = (_b = (_a = menuRef.current) == null ? void 0 : _a.children) == null ? void 0 : _b[0]) == null ? void 0 : _c.focus();
|
5704
5714
|
});
|
5705
5715
|
return () => clearTimeout(id);
|
5706
5716
|
}, [menuRef.current]);
|
5707
|
-
return /* @__PURE__ */
|
5717
|
+
return /* @__PURE__ */ React53.createElement("div", {
|
5708
5718
|
style: { minWidth: "250px" },
|
5709
5719
|
className: tw("py-3 bg-white")
|
5710
|
-
}, !!title && /* @__PURE__ */
|
5720
|
+
}, !!title && /* @__PURE__ */ React53.createElement("div", {
|
5711
5721
|
className: tw("px-4 py-4 text-left text-grey-100 typography-default-strong")
|
5712
|
-
}, title), /* @__PURE__ */
|
5722
|
+
}, title), /* @__PURE__ */ React53.createElement("ol", {
|
5713
5723
|
role: "menu",
|
5714
5724
|
ref: menuRef,
|
5715
5725
|
id: contentId,
|
5716
5726
|
"aria-labelledby": triggerId
|
5717
|
-
},
|
5718
|
-
return
|
5727
|
+
}, React53.Children.map(children, (child) => {
|
5728
|
+
return React53.cloneElement(child, { setClose });
|
5719
5729
|
})));
|
5720
5730
|
};
|
5721
5731
|
var DropdownItem = (_a) => {
|
@@ -5770,10 +5780,10 @@ var DropdownItem = (_a) => {
|
|
5770
5780
|
handleSelect();
|
5771
5781
|
}
|
5772
5782
|
};
|
5773
|
-
const itemContent = /* @__PURE__ */
|
5783
|
+
const itemContent = /* @__PURE__ */ React53.createElement("div", {
|
5774
5784
|
className: tw("py-3 px-4")
|
5775
5785
|
}, children);
|
5776
|
-
return /* @__PURE__ */
|
5786
|
+
return /* @__PURE__ */ React53.createElement("li", __spreadProps(__spreadValues({
|
5777
5787
|
role: "menuitem",
|
5778
5788
|
tabIndex: -1,
|
5779
5789
|
onClick: handleClick,
|
@@ -5784,7 +5794,7 @@ var DropdownItem = (_a) => {
|
|
5784
5794
|
"text-grey-10 cursor-not-allowed": disabled,
|
5785
5795
|
"text-primary-70 hover:text-primary-80": color === "danger" && !disabled
|
5786
5796
|
})
|
5787
|
-
}), tooltip ? /* @__PURE__ */
|
5797
|
+
}), tooltip ? /* @__PURE__ */ React53.createElement(Tooltip, {
|
5788
5798
|
content: tooltip,
|
5789
5799
|
placement: tooltipPlacement,
|
5790
5800
|
inline: false
|
@@ -5794,7 +5804,7 @@ Dropdown.Menu = DropdownMenu;
|
|
5794
5804
|
Dropdown.Item = DropdownItem;
|
5795
5805
|
|
5796
5806
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
5797
|
-
import
|
5807
|
+
import React57 from "react";
|
5798
5808
|
import { useFilter } from "@react-aria/i18n";
|
5799
5809
|
import { PressResponder as PressResponder2, usePress as usePress2 } from "@react-aria/interactions";
|
5800
5810
|
import { useMenu, useMenuItem, useMenuSection, useMenuTrigger } from "@react-aria/menu";
|
@@ -5806,7 +5816,7 @@ import { useMenuTriggerState } from "@react-stately/menu";
|
|
5806
5816
|
import { useTreeState } from "@react-stately/tree";
|
5807
5817
|
|
5808
5818
|
// src/components/Input/Input.tsx
|
5809
|
-
import
|
5819
|
+
import React55, { forwardRef, useImperativeHandle, useRef as useRef5, useState as useState6 } from "react";
|
5810
5820
|
import omit7 from "lodash/omit";
|
5811
5821
|
import toString from "lodash/toString";
|
5812
5822
|
import uniqueId3 from "lodash/uniqueId";
|
@@ -5823,31 +5833,31 @@ var getCommonInputStyles = ({ readOnly, valid }) => tw(
|
|
5823
5833
|
);
|
5824
5834
|
|
5825
5835
|
// src/utils/form/InputAdornment/InputAdornment.tsx
|
5826
|
-
import
|
5836
|
+
import React54 from "react";
|
5827
5837
|
var import_cross4 = __toESM(require_cross());
|
5828
5838
|
var import_error3 = __toESM(require_error());
|
5829
5839
|
var import_search2 = __toESM(require_search());
|
5830
5840
|
var import_tick3 = __toESM(require_tick());
|
5831
5841
|
var InputAdornment = ({ placement = "right", className, dense, children }) => {
|
5832
|
-
return /* @__PURE__ */
|
5842
|
+
return /* @__PURE__ */ React54.createElement("span", {
|
5833
5843
|
className: classNames(className, "absolute inset-y-0 grow-0 text-grey-40 flex items-center mx-3", {
|
5834
5844
|
"right-0": placement === "right",
|
5835
5845
|
"left-0": placement === "left",
|
5836
5846
|
"typography-small": dense,
|
5837
5847
|
"typography-default-strong": !dense
|
5838
5848
|
})
|
5839
|
-
}, /* @__PURE__ */
|
5849
|
+
}, /* @__PURE__ */ React54.createElement(Flexbox, {
|
5840
5850
|
gap: "3",
|
5841
5851
|
wrap: "wrap"
|
5842
5852
|
}, children));
|
5843
5853
|
};
|
5844
|
-
var SearchIcon = ({ onClick }) => /* @__PURE__ */
|
5854
|
+
var SearchIcon = ({ onClick }) => /* @__PURE__ */ React54.createElement(Icon, {
|
5845
5855
|
icon: import_search2.default,
|
5846
5856
|
color: "grey-30",
|
5847
5857
|
"data-testid": "icon-search",
|
5848
5858
|
onClick
|
5849
5859
|
});
|
5850
|
-
var ResetIcon = ({ onClick }) => /* @__PURE__ */
|
5860
|
+
var ResetIcon = ({ onClick }) => /* @__PURE__ */ React54.createElement(Icon, {
|
5851
5861
|
className: "hover:cursor-pointer",
|
5852
5862
|
icon: import_cross4.default,
|
5853
5863
|
color: "grey-30",
|
@@ -5877,7 +5887,7 @@ var createInput = (displayName, opts = {}) => {
|
|
5877
5887
|
"readOnly"
|
5878
5888
|
]);
|
5879
5889
|
var _a2;
|
5880
|
-
const inputRef =
|
5890
|
+
const inputRef = React55.useRef(null);
|
5881
5891
|
useImperativeHandle(ref, () => inputRef.current);
|
5882
5892
|
const handleReset = () => {
|
5883
5893
|
var _a3;
|
@@ -5890,11 +5900,11 @@ var createInput = (displayName, opts = {}) => {
|
|
5890
5900
|
el.focus();
|
5891
5901
|
}
|
5892
5902
|
};
|
5893
|
-
return /* @__PURE__ */
|
5903
|
+
return /* @__PURE__ */ React55.createElement("span", {
|
5894
5904
|
className: tw("relative block")
|
5895
|
-
}, opts.adornment && /* @__PURE__ */
|
5905
|
+
}, opts.adornment && /* @__PURE__ */ React55.createElement(InputAdornment, {
|
5896
5906
|
placement: "left"
|
5897
|
-
}, opts.adornment), /* @__PURE__ */
|
5907
|
+
}, opts.adornment), /* @__PURE__ */ React55.createElement("input", __spreadProps(__spreadValues({
|
5898
5908
|
ref: inputRef,
|
5899
5909
|
type
|
5900
5910
|
}, props), {
|
@@ -5909,20 +5919,20 @@ var createInput = (displayName, opts = {}) => {
|
|
5909
5919
|
getCommonInputStyles({ readOnly, valid }),
|
5910
5920
|
props.className
|
5911
5921
|
)
|
5912
|
-
})), opts.canReset && (props.value || ((_a2 = inputRef.current) == null ? void 0 : _a2.value)) && /* @__PURE__ */
|
5922
|
+
})), opts.canReset && (props.value || ((_a2 = inputRef.current) == null ? void 0 : _a2.value)) && /* @__PURE__ */ React55.createElement(InputAdornment, null, /* @__PURE__ */ React55.createElement(ResetIcon, {
|
5913
5923
|
onClick: handleReset
|
5914
|
-
})), !opts.canReset && endAdornment && /* @__PURE__ */
|
5924
|
+
})), !opts.canReset && endAdornment && /* @__PURE__ */ React55.createElement(InputAdornment, null, endAdornment));
|
5915
5925
|
}
|
5916
5926
|
);
|
5917
5927
|
InputComponent.displayName = displayName;
|
5918
|
-
InputComponent.Skeleton = () => /* @__PURE__ */
|
5928
|
+
InputComponent.Skeleton = () => /* @__PURE__ */ React55.createElement(Skeleton, {
|
5919
5929
|
height: 38
|
5920
5930
|
});
|
5921
5931
|
return InputComponent;
|
5922
5932
|
};
|
5923
5933
|
var InputBase = createInput("InputBase");
|
5924
|
-
var SearchInput = createInput("SearchInput", { adornment: /* @__PURE__ */
|
5925
|
-
var Input2 =
|
5934
|
+
var SearchInput = createInput("SearchInput", { adornment: /* @__PURE__ */ React55.createElement(SearchIcon, null), canReset: true });
|
5935
|
+
var Input2 = React55.forwardRef((_a, ref) => {
|
5926
5936
|
var _b = _a, { readOnly = false } = _b, props = __objRest(_b, ["readOnly"]);
|
5927
5937
|
var _a2, _b2, _c;
|
5928
5938
|
const [value, setValue] = useState6((_b2 = (_a2 = props.value) != null ? _a2 : props.defaultValue) != null ? _b2 : "");
|
@@ -5931,12 +5941,12 @@ var Input2 = React54.forwardRef((_a, ref) => {
|
|
5931
5941
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
5932
5942
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
5933
5943
|
const baseProps = omit7(props, Object.keys(labelControlProps));
|
5934
|
-
return /* @__PURE__ */
|
5944
|
+
return /* @__PURE__ */ React55.createElement(LabelControl, __spreadValues({
|
5935
5945
|
id: `${id.current}-label`,
|
5936
5946
|
htmlFor: id.current,
|
5937
5947
|
messageId: errorMessageId,
|
5938
5948
|
length: value !== void 0 ? toString(value).length : void 0
|
5939
|
-
}, labelControlProps), /* @__PURE__ */
|
5949
|
+
}, labelControlProps), /* @__PURE__ */ React55.createElement(InputBase, __spreadProps(__spreadValues(__spreadValues({
|
5940
5950
|
ref
|
5941
5951
|
}, baseProps), errorProps), {
|
5942
5952
|
id: id.current,
|
@@ -5954,16 +5964,16 @@ var Input2 = React54.forwardRef((_a, ref) => {
|
|
5954
5964
|
})));
|
5955
5965
|
});
|
5956
5966
|
Input2.displayName = "Input";
|
5957
|
-
Input2.Skeleton = () => /* @__PURE__ */
|
5967
|
+
Input2.Skeleton = () => /* @__PURE__ */ React55.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React55.createElement(InputBase.Skeleton, null));
|
5958
5968
|
Input2.Skeleton.displayName = "Input.Skeleton";
|
5959
5969
|
|
5960
5970
|
// src/common/DropdownMenu/DropdownMenu.tsx
|
5961
|
-
import
|
5971
|
+
import React56 from "react";
|
5962
5972
|
var import_tick4 = __toESM(require_tick());
|
5963
|
-
var DropdownMenu2 =
|
5973
|
+
var DropdownMenu2 = React56.forwardRef(
|
5964
5974
|
(_a, ref) => {
|
5965
5975
|
var _b = _a, { maxHeight = "450px", minWidth = "125px", maxWidth, className, children } = _b, props = __objRest(_b, ["maxHeight", "minWidth", "maxWidth", "className", "children"]);
|
5966
|
-
return /* @__PURE__ */
|
5976
|
+
return /* @__PURE__ */ React56.createElement("div", __spreadValues({
|
5967
5977
|
ref,
|
5968
5978
|
style: { maxHeight, minWidth, maxWidth },
|
5969
5979
|
className: classNames(
|
@@ -5973,25 +5983,25 @@ var DropdownMenu2 = React55.forwardRef(
|
|
5973
5983
|
}, props), children);
|
5974
5984
|
}
|
5975
5985
|
);
|
5976
|
-
var ContentContainer = ({ children }) => /* @__PURE__ */
|
5986
|
+
var ContentContainer = ({ children }) => /* @__PURE__ */ React56.createElement("div", {
|
5977
5987
|
className: tw("p-3")
|
5978
5988
|
}, children);
|
5979
5989
|
DropdownMenu2.ContentContainer = ContentContainer;
|
5980
|
-
var List2 =
|
5990
|
+
var List2 = React56.forwardRef(
|
5981
5991
|
(_a, ref) => {
|
5982
5992
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
5983
|
-
return /* @__PURE__ */
|
5993
|
+
return /* @__PURE__ */ React56.createElement("ul", __spreadValues({
|
5984
5994
|
ref
|
5985
5995
|
}, props), children);
|
5986
5996
|
}
|
5987
5997
|
);
|
5988
5998
|
DropdownMenu2.List = List2;
|
5989
|
-
var Group2 =
|
5999
|
+
var Group2 = React56.forwardRef(
|
5990
6000
|
(_a, ref) => {
|
5991
6001
|
var _b = _a, { className, title, titleProps, children } = _b, props = __objRest(_b, ["className", "title", "titleProps", "children"]);
|
5992
|
-
return /* @__PURE__ */
|
6002
|
+
return /* @__PURE__ */ React56.createElement("li", __spreadValues({
|
5993
6003
|
ref
|
5994
|
-
}, props), title && /* @__PURE__ */
|
6004
|
+
}, props), title && /* @__PURE__ */ React56.createElement("div", __spreadValues({
|
5995
6005
|
className: classNames(className, "p-3 text-grey-40 uppercase cursor-default typography-caption", {
|
5996
6006
|
"text-grey-20": props.disabled
|
5997
6007
|
})
|
@@ -5999,10 +6009,10 @@ var Group2 = React55.forwardRef(
|
|
5999
6009
|
}
|
6000
6010
|
);
|
6001
6011
|
DropdownMenu2.Group = Group2;
|
6002
|
-
var Item3 =
|
6012
|
+
var Item3 = React56.forwardRef(
|
6003
6013
|
(_a, ref) => {
|
6004
6014
|
var _b = _a, { kind, highlighted, selected, className, icon, children } = _b, props = __objRest(_b, ["kind", "highlighted", "selected", "className", "icon", "children"]);
|
6005
|
-
return /* @__PURE__ */
|
6015
|
+
return /* @__PURE__ */ React56.createElement("li", __spreadValues({
|
6006
6016
|
ref,
|
6007
6017
|
className: classNames(className, "flex items-center gap-x-3 p-3 outline-none", {
|
6008
6018
|
"cursor-pointer hover:bg-grey-0": !props.disabled,
|
@@ -6010,30 +6020,30 @@ var Item3 = React55.forwardRef(
|
|
6010
6020
|
"text-primary-80": kind === "action",
|
6011
6021
|
"text-grey-20 cursor-not-allowed": props.disabled
|
6012
6022
|
})
|
6013
|
-
}, props), icon && /* @__PURE__ */
|
6023
|
+
}, props), icon && /* @__PURE__ */ React56.createElement(InlineIcon, {
|
6014
6024
|
icon
|
6015
|
-
}), /* @__PURE__ */
|
6025
|
+
}), /* @__PURE__ */ React56.createElement("span", {
|
6016
6026
|
className: tw("grow")
|
6017
|
-
}, children), selected && /* @__PURE__ */
|
6027
|
+
}, children), selected && /* @__PURE__ */ React56.createElement(InlineIcon, {
|
6018
6028
|
icon: import_tick4.default
|
6019
6029
|
}));
|
6020
6030
|
}
|
6021
6031
|
);
|
6022
6032
|
DropdownMenu2.Item = Item3;
|
6023
|
-
var Description = ({ disabled, children }) => /* @__PURE__ */
|
6033
|
+
var Description = ({ disabled, children }) => /* @__PURE__ */ React56.createElement(Typography2.Caption, {
|
6024
6034
|
color: disabled ? "grey-20" : "grey-40"
|
6025
6035
|
}, children);
|
6026
6036
|
DropdownMenu2.Description = Description;
|
6027
6037
|
var Separator = (_a) => {
|
6028
6038
|
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
6029
|
-
return /* @__PURE__ */
|
6039
|
+
return /* @__PURE__ */ React56.createElement("li", __spreadProps(__spreadValues({}, props), {
|
6030
6040
|
className: classNames(className, tw("m-3 block bg-grey-5 h-[1px]"))
|
6031
6041
|
}));
|
6032
6042
|
};
|
6033
6043
|
DropdownMenu2.Separator = Separator;
|
6034
6044
|
var EmptyStateContainer2 = (_a) => {
|
6035
6045
|
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
6036
|
-
return /* @__PURE__ */
|
6046
|
+
return /* @__PURE__ */ React56.createElement("div", __spreadValues({
|
6037
6047
|
className: classNames(tw("border border-dashed border-grey-10 p-3"), className)
|
6038
6048
|
}, props), children);
|
6039
6049
|
};
|
@@ -6088,8 +6098,8 @@ var DropdownMenu3 = (_a) => {
|
|
6088
6098
|
"footer",
|
6089
6099
|
"children"
|
6090
6100
|
]);
|
6091
|
-
const triggerRef =
|
6092
|
-
const overlayRef =
|
6101
|
+
const triggerRef = React57.useRef(null);
|
6102
|
+
const overlayRef = React57.useRef(null);
|
6093
6103
|
const [trigger, items] = extractTriggerAndItems(children);
|
6094
6104
|
const state = useMenuTriggerState(props);
|
6095
6105
|
const { menuTriggerProps, menuProps } = useMenuTrigger({}, state, triggerRef);
|
@@ -6100,17 +6110,17 @@ var DropdownMenu3 = (_a) => {
|
|
6100
6110
|
shouldFlip: true,
|
6101
6111
|
isOpen: state.isOpen
|
6102
6112
|
});
|
6103
|
-
return /* @__PURE__ */
|
6113
|
+
return /* @__PURE__ */ React57.createElement("div", null, /* @__PURE__ */ React57.createElement(PressResponder2, __spreadValues({
|
6104
6114
|
ref: triggerRef,
|
6105
6115
|
onPress: () => state.toggle()
|
6106
|
-
}, menuTriggerProps), /* @__PURE__ */
|
6116
|
+
}, menuTriggerProps), /* @__PURE__ */ React57.createElement(TriggerWrapper, null, trigger.props.children)), /* @__PURE__ */ React57.createElement(PopoverWrapper, __spreadValues({
|
6107
6117
|
ref: overlayRef,
|
6108
6118
|
isDismissable: true,
|
6109
6119
|
autoFocus: true,
|
6110
6120
|
containFocus: true,
|
6111
6121
|
isOpen: state.isOpen,
|
6112
6122
|
onClose: state.close
|
6113
|
-
}, overlayProps), /* @__PURE__ */
|
6123
|
+
}, overlayProps), /* @__PURE__ */ React57.createElement(MenuWrapper, __spreadValues({
|
6114
6124
|
onAction,
|
6115
6125
|
selectionMode,
|
6116
6126
|
selection,
|
@@ -6131,13 +6141,13 @@ DropdownMenu3.Item = Item4;
|
|
6131
6141
|
DropdownMenu3.Section = Section;
|
6132
6142
|
var TriggerWrapper = (_a) => {
|
6133
6143
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
6134
|
-
const ref =
|
6144
|
+
const ref = React57.useRef(null);
|
6135
6145
|
const { pressProps } = usePress2(__spreadProps(__spreadValues({}, props), { ref }));
|
6136
|
-
const trigger =
|
6137
|
-
if (!trigger || !
|
6146
|
+
const trigger = React57.Children.only(children);
|
6147
|
+
if (!trigger || !React57.isValidElement(trigger)) {
|
6138
6148
|
throw new Error("<DropdownMenu.Trigger> must have valid child");
|
6139
6149
|
}
|
6140
|
-
return
|
6150
|
+
return React57.cloneElement(trigger, __spreadValues({ ref }, mergeProps4(pressProps, props)));
|
6141
6151
|
};
|
6142
6152
|
var isSectionNode = (item) => item.type === "section";
|
6143
6153
|
var isItemNode = (item) => item.type === "item";
|
@@ -6159,7 +6169,7 @@ var MenuWrapper = (_a) => {
|
|
6159
6169
|
"header",
|
6160
6170
|
"footer"
|
6161
6171
|
]);
|
6162
|
-
const ref =
|
6172
|
+
const ref = React57.useRef(null);
|
6163
6173
|
const disabledKeys = getDisabledItemKeys(props.children);
|
6164
6174
|
const state = useTreeState(__spreadValues({
|
6165
6175
|
disabledKeys,
|
@@ -6167,30 +6177,30 @@ var MenuWrapper = (_a) => {
|
|
6167
6177
|
}, props));
|
6168
6178
|
const { menuProps } = useMenu(props, state, ref);
|
6169
6179
|
const { contains } = useFilter({ sensitivity: "base" });
|
6170
|
-
const [search, setSearch] =
|
6171
|
-
const filteredCollection =
|
6180
|
+
const [search, setSearch] = React57.useState("");
|
6181
|
+
const filteredCollection = React57.useMemo(
|
6172
6182
|
() => searchable ? filterCollection(state.collection, search, contains) : state.collection,
|
6173
6183
|
[state.collection, search, contains]
|
6174
6184
|
);
|
6175
|
-
return /* @__PURE__ */
|
6185
|
+
return /* @__PURE__ */ React57.createElement(DropdownMenu2, {
|
6176
6186
|
minWidth: minWidth !== void 0 ? `${minWidth}px` : void 0,
|
6177
6187
|
maxWidth: maxWidth !== void 0 ? `${maxWidth}px` : void 0
|
6178
|
-
}, header, /* @__PURE__ */
|
6188
|
+
}, header, /* @__PURE__ */ React57.createElement(DropdownMenu2.ContentContainer, null, searchable && /* @__PURE__ */ React57.createElement(SearchInput, {
|
6179
6189
|
"aria-label": "search",
|
6180
6190
|
value: search,
|
6181
6191
|
onChange: (e) => setSearch(e.target.value),
|
6182
6192
|
className: tw("mb-5")
|
6183
|
-
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */
|
6193
|
+
}), filteredCollection.size === 0 && emptyState && /* @__PURE__ */ React57.createElement(DropdownMenu2.EmptyStateContainer, null, emptyState), /* @__PURE__ */ React57.createElement(DropdownMenu2.List, __spreadValues({
|
6184
6194
|
ref
|
6185
6195
|
}, menuProps), Array.from(filteredCollection).map((item) => {
|
6186
6196
|
if (isSectionNode(item)) {
|
6187
|
-
return /* @__PURE__ */
|
6197
|
+
return /* @__PURE__ */ React57.createElement(SectionWrapper, {
|
6188
6198
|
key: item.key,
|
6189
6199
|
section: item,
|
6190
6200
|
state
|
6191
6201
|
});
|
6192
6202
|
} else if (isItemNode(item)) {
|
6193
|
-
return /* @__PURE__ */
|
6203
|
+
return /* @__PURE__ */ React57.createElement(ItemWrapper, {
|
6194
6204
|
key: item.key,
|
6195
6205
|
item,
|
6196
6206
|
state
|
@@ -6199,14 +6209,14 @@ var MenuWrapper = (_a) => {
|
|
6199
6209
|
}))), footer);
|
6200
6210
|
};
|
6201
6211
|
var ItemWrapper = ({ item, state }) => {
|
6202
|
-
const ref =
|
6212
|
+
const ref = React57.useRef(null);
|
6203
6213
|
const { menuItemProps, descriptionProps, isSelected, isFocused, isDisabled } = useMenuItem(
|
6204
6214
|
{ key: item.key },
|
6205
6215
|
state,
|
6206
6216
|
ref
|
6207
6217
|
);
|
6208
6218
|
const { icon, description, kind = "default" } = item.props;
|
6209
|
-
return /* @__PURE__ */
|
6219
|
+
return /* @__PURE__ */ React57.createElement(DropdownMenu2.Item, __spreadProps(__spreadValues({
|
6210
6220
|
ref
|
6211
6221
|
}, menuItemProps), {
|
6212
6222
|
kind,
|
@@ -6214,7 +6224,7 @@ var ItemWrapper = ({ item, state }) => {
|
|
6214
6224
|
highlighted: isFocused,
|
6215
6225
|
disabled: isDisabled,
|
6216
6226
|
icon
|
6217
|
-
}), item.rendered, description && /* @__PURE__ */
|
6227
|
+
}), item.rendered, description && /* @__PURE__ */ React57.createElement(DropdownMenu2.Description, __spreadValues({
|
6218
6228
|
disabled: isDisabled
|
6219
6229
|
}, descriptionProps), description));
|
6220
6230
|
};
|
@@ -6226,24 +6236,24 @@ var SectionWrapper = ({ section, state }) => {
|
|
6226
6236
|
const { separatorProps } = useSeparator({
|
6227
6237
|
elementType: "li"
|
6228
6238
|
});
|
6229
|
-
return /* @__PURE__ */
|
6239
|
+
return /* @__PURE__ */ React57.createElement(React57.Fragment, null, section.key !== state.collection.getFirstKey() && /* @__PURE__ */ React57.createElement(DropdownMenu2.Separator, __spreadValues({}, separatorProps)), /* @__PURE__ */ React57.createElement(DropdownMenu2.Group, __spreadValues({
|
6230
6240
|
title: section.rendered,
|
6231
6241
|
titleProps: headingProps
|
6232
|
-
}, itemProps), /* @__PURE__ */
|
6242
|
+
}, itemProps), /* @__PURE__ */ React57.createElement("ul", __spreadValues({}, groupProps), Array.from(section.childNodes).map((node) => /* @__PURE__ */ React57.createElement(ItemWrapper, {
|
6233
6243
|
key: node.key,
|
6234
6244
|
item: node,
|
6235
6245
|
state
|
6236
6246
|
})))));
|
6237
6247
|
};
|
6238
6248
|
var extractTriggerAndItems = (children) => {
|
6239
|
-
const [trigger, items] =
|
6249
|
+
const [trigger, items] = React57.Children.toArray(children);
|
6240
6250
|
if (!isComponentType(trigger, MenuTrigger) || !isComponentType(items, MenuItems)) {
|
6241
6251
|
throw new Error("<DropdownMenu> must have <DropdownMenu.Trigger> and <DropdownMenu.Items> defined");
|
6242
6252
|
}
|
6243
6253
|
return [trigger, items];
|
6244
6254
|
};
|
6245
6255
|
var getDisabledItemKeys = (children) => {
|
6246
|
-
const keys =
|
6256
|
+
const keys = React57.Children.map(children, (child) => {
|
6247
6257
|
var _a, _b;
|
6248
6258
|
if (!child || typeof child === "function") {
|
6249
6259
|
return null;
|
@@ -6260,11 +6270,11 @@ var getDisabledItemKeys = (children) => {
|
|
6260
6270
|
};
|
6261
6271
|
|
6262
6272
|
// src/components/EmptyState/EmptyState.tsx
|
6263
|
-
import
|
6273
|
+
import React59 from "react";
|
6264
6274
|
import omit8 from "lodash/omit";
|
6265
6275
|
|
6266
6276
|
// src/components/Flexbox/FlexboxItem.tsx
|
6267
|
-
import
|
6277
|
+
import React58 from "react";
|
6268
6278
|
var FlexboxItem = Tailwindify(
|
6269
6279
|
({ htmlTag = "div", className, style, children, display, flex, grow, shrink, order, alignSelf }) => {
|
6270
6280
|
const hookStyle = useStyle({
|
@@ -6276,7 +6286,7 @@ var FlexboxItem = Tailwindify(
|
|
6276
6286
|
alignSelf
|
6277
6287
|
});
|
6278
6288
|
const HtmlElement = htmlTag;
|
6279
|
-
return /* @__PURE__ */
|
6289
|
+
return /* @__PURE__ */ React58.createElement(HtmlElement, {
|
6280
6290
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
6281
6291
|
className
|
6282
6292
|
}, children);
|
@@ -6333,7 +6343,7 @@ var EmptyState = ({
|
|
6333
6343
|
borderStyle = "dashed"
|
6334
6344
|
}) => {
|
6335
6345
|
const template = layoutStyle(layout);
|
6336
|
-
return /* @__PURE__ */
|
6346
|
+
return /* @__PURE__ */ React59.createElement(Box, {
|
6337
6347
|
className: classNames(
|
6338
6348
|
tw("rounded", {
|
6339
6349
|
"border border-dashed": borderStyle === "dashed",
|
@@ -6345,38 +6355,38 @@ var EmptyState = ({
|
|
6345
6355
|
backgroundColor: "transparent",
|
6346
6356
|
borderColor: "grey-10",
|
6347
6357
|
padding: "9"
|
6348
|
-
}, /* @__PURE__ */
|
6358
|
+
}, /* @__PURE__ */ React59.createElement(Flexbox, {
|
6349
6359
|
direction: template.layout,
|
6350
6360
|
justifyContent: template.justifyContent,
|
6351
6361
|
alignItems: template.layout === "row" ? "center" : template.alignItems,
|
6352
6362
|
colGap: "l5",
|
6353
6363
|
rowGap: "8"
|
6354
|
-
}, image && /* @__PURE__ */
|
6364
|
+
}, image && /* @__PURE__ */ React59.createElement(FlexboxItem, null, /* @__PURE__ */ React59.createElement("img", {
|
6355
6365
|
src: image,
|
6356
6366
|
alt: imageAlt,
|
6357
6367
|
style: { width: imageWidth ? `${imageWidth}px` : void 0, height: "auto" }
|
6358
|
-
})), /* @__PURE__ */
|
6368
|
+
})), /* @__PURE__ */ React59.createElement(Flexbox, {
|
6359
6369
|
style: { maxWidth: "610px" },
|
6360
6370
|
direction: "column",
|
6361
6371
|
justifyContent: template.justifyContent,
|
6362
6372
|
alignItems: template.alignItems
|
6363
|
-
}, /* @__PURE__ */
|
6373
|
+
}, /* @__PURE__ */ React59.createElement(Typography2, {
|
6364
6374
|
variant: "heading",
|
6365
6375
|
htmlTag: "h2"
|
6366
|
-
}, title), description && /* @__PURE__ */
|
6376
|
+
}, title), description && /* @__PURE__ */ React59.createElement(Box, {
|
6367
6377
|
marginTop: "5"
|
6368
|
-
}, /* @__PURE__ */
|
6378
|
+
}, /* @__PURE__ */ React59.createElement(Typography2, {
|
6369
6379
|
variant: "default",
|
6370
6380
|
color: "grey-60"
|
6371
|
-
}, description)), (secondaryAction || primaryAction) && /* @__PURE__ */
|
6381
|
+
}, description)), (secondaryAction || primaryAction) && /* @__PURE__ */ React59.createElement(Flexbox, {
|
6372
6382
|
marginTop: "7",
|
6373
6383
|
gap: "4",
|
6374
6384
|
justifyContent: "center",
|
6375
6385
|
alignItems: "center",
|
6376
6386
|
wrap: "wrap"
|
6377
|
-
}, primaryAction && /* @__PURE__ */
|
6387
|
+
}, primaryAction && /* @__PURE__ */ React59.createElement(PrimaryButton, __spreadValues({}, omit8(primaryAction, "text")), primaryAction.text), secondaryAction && /* @__PURE__ */ React59.createElement(SecondaryButton, __spreadValues({}, omit8(secondaryAction, "text")), secondaryAction.text)), footer && /* @__PURE__ */ React59.createElement(Box, {
|
6378
6388
|
marginTop: "7"
|
6379
|
-
}, /* @__PURE__ */
|
6389
|
+
}, /* @__PURE__ */ React59.createElement(Typography2, {
|
6380
6390
|
htmlTag: "div",
|
6381
6391
|
variant: "small",
|
6382
6392
|
color: "grey-60"
|
@@ -6384,7 +6394,7 @@ var EmptyState = ({
|
|
6384
6394
|
};
|
6385
6395
|
|
6386
6396
|
// src/components/Grid/GridItem.tsx
|
6387
|
-
import
|
6397
|
+
import React60 from "react";
|
6388
6398
|
var GridItem = Tailwindify(
|
6389
6399
|
({
|
6390
6400
|
htmlTag = "div",
|
@@ -6415,7 +6425,7 @@ var GridItem = Tailwindify(
|
|
6415
6425
|
gridRowEnd: rowEnd
|
6416
6426
|
});
|
6417
6427
|
const HtmlElement = htmlTag;
|
6418
|
-
return /* @__PURE__ */
|
6428
|
+
return /* @__PURE__ */ React60.createElement(HtmlElement, {
|
6419
6429
|
style: __spreadValues(__spreadValues({}, hookStyle), style),
|
6420
6430
|
className
|
6421
6431
|
}, children);
|
@@ -6423,23 +6433,23 @@ var GridItem = Tailwindify(
|
|
6423
6433
|
);
|
6424
6434
|
|
6425
6435
|
// src/components/List/List.tsx
|
6426
|
-
import
|
6427
|
-
var List = ({ items, renderItem, container =
|
6436
|
+
import React61 from "react";
|
6437
|
+
var List = ({ items, renderItem, container = React61.Fragment }) => {
|
6428
6438
|
const Component = container;
|
6429
|
-
return /* @__PURE__ */
|
6439
|
+
return /* @__PURE__ */ React61.createElement(Component, null, items.map(renderItem));
|
6430
6440
|
};
|
6431
6441
|
|
6432
6442
|
// src/components/ListItem/ListItem.tsx
|
6433
|
-
import
|
6443
|
+
import React62 from "react";
|
6434
6444
|
var ListItem = ({ name, icon, active = false }) => {
|
6435
|
-
return /* @__PURE__ */
|
6445
|
+
return /* @__PURE__ */ React62.createElement(Flexbox, {
|
6436
6446
|
alignItems: "center"
|
6437
|
-
}, /* @__PURE__ */
|
6447
|
+
}, /* @__PURE__ */ React62.createElement(Typography2, {
|
6438
6448
|
variant: active ? "small-strong" : "small",
|
6439
6449
|
color: "grey-70",
|
6440
6450
|
htmlTag: "span",
|
6441
6451
|
className: `px-4 py-2 rounded-full ${active ? "bg-grey-5" : "hover:bg-grey-0"}`
|
6442
|
-
}, /* @__PURE__ */
|
6452
|
+
}, /* @__PURE__ */ React62.createElement("img", {
|
6443
6453
|
src: icon,
|
6444
6454
|
alt: name,
|
6445
6455
|
className: "inline mr-4",
|
@@ -6449,7 +6459,7 @@ var ListItem = ({ name, icon, active = false }) => {
|
|
6449
6459
|
};
|
6450
6460
|
|
6451
6461
|
// src/components/Modal/Modal.tsx
|
6452
|
-
import
|
6462
|
+
import React64 from "react";
|
6453
6463
|
import { useDialog as useDialog2 } from "@react-aria/dialog";
|
6454
6464
|
import { FocusScope as FocusScope3 } from "@react-aria/focus";
|
6455
6465
|
import { Overlay as Overlay2, useModalOverlay as useModalOverlay2 } from "@react-aria/overlays";
|
@@ -6459,18 +6469,18 @@ import castArray from "lodash/castArray";
|
|
6459
6469
|
import omit9 from "lodash/omit";
|
6460
6470
|
|
6461
6471
|
// src/components/Tabs/Tabs.tsx
|
6462
|
-
import
|
6472
|
+
import React63, { useEffect as useEffect5, useLayoutEffect as useLayoutEffect2, useRef as useRef6, useState as useState7 } from "react";
|
6463
6473
|
import isNumber4 from "lodash/isNumber";
|
6464
6474
|
import kebabCase from "lodash/kebabCase";
|
6465
6475
|
var import_chevronLeft2 = __toESM(require_chevronLeft());
|
6466
6476
|
var import_chevronRight2 = __toESM(require_chevronRight());
|
6467
6477
|
var import_warningSign3 = __toESM(require_warningSign());
|
6468
6478
|
var isTabComponent = (c) => {
|
6469
|
-
return
|
6479
|
+
return React63.isValidElement(c) && (c.type === Tab || c.type === ModalTab);
|
6470
6480
|
};
|
6471
|
-
var Tab =
|
6481
|
+
var Tab = React63.forwardRef(
|
6472
6482
|
({ className, id, title, children }, ref) => {
|
6473
|
-
return /* @__PURE__ */
|
6483
|
+
return /* @__PURE__ */ React63.createElement("div", {
|
6474
6484
|
ref,
|
6475
6485
|
id: `${id != null ? id : kebabCase(title)}-panel`,
|
6476
6486
|
className,
|
@@ -6482,14 +6492,14 @@ var Tab = React62.forwardRef(
|
|
6482
6492
|
);
|
6483
6493
|
var TabContainer = (_a) => {
|
6484
6494
|
var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
|
6485
|
-
return /* @__PURE__ */
|
6495
|
+
return /* @__PURE__ */ React63.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
6486
6496
|
className: classNames("py-6 z-0", className)
|
6487
6497
|
}), children);
|
6488
6498
|
};
|
6489
6499
|
var ModalTab = Tab;
|
6490
6500
|
var ModalTabContainer = TabContainer;
|
6491
6501
|
var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
6492
|
-
const Tab2 =
|
6502
|
+
const Tab2 = React63.forwardRef(
|
6493
6503
|
(_a, ref) => {
|
6494
6504
|
var _b = _a, {
|
6495
6505
|
id,
|
@@ -6519,17 +6529,17 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
6519
6529
|
const _id = id != null ? id : kebabCase(title);
|
6520
6530
|
let statusIcon = void 0;
|
6521
6531
|
if (status === "warning") {
|
6522
|
-
statusIcon = /* @__PURE__ */
|
6532
|
+
statusIcon = /* @__PURE__ */ React63.createElement(InlineIcon, {
|
6523
6533
|
icon: import_warningSign3.default,
|
6524
6534
|
color: "warning-80"
|
6525
6535
|
});
|
6526
6536
|
} else if (status === "error") {
|
6527
|
-
statusIcon = /* @__PURE__ */
|
6537
|
+
statusIcon = /* @__PURE__ */ React63.createElement(InlineIcon, {
|
6528
6538
|
icon: import_warningSign3.default,
|
6529
6539
|
color: "error-50"
|
6530
6540
|
});
|
6531
6541
|
}
|
6532
|
-
const tab = /* @__PURE__ */
|
6542
|
+
const tab = /* @__PURE__ */ React63.createElement(Component, __spreadValues({
|
6533
6543
|
ref,
|
6534
6544
|
id: `${_id}-tab`,
|
6535
6545
|
onClick: () => !disabled && onSelected(value != null ? value : index),
|
@@ -6546,24 +6556,24 @@ var asTabItem = (Component, displayName, { defaultUnderlineHidden } = {}) => {
|
|
6546
6556
|
"aria-selected": selected,
|
6547
6557
|
"aria-controls": `${_id}-panel`,
|
6548
6558
|
tabIndex: disabled ? void 0 : 0
|
6549
|
-
}, rest), /* @__PURE__ */
|
6559
|
+
}, rest), /* @__PURE__ */ React63.createElement(Typography2, {
|
6550
6560
|
htmlTag: "div",
|
6551
6561
|
variant: "small",
|
6552
6562
|
color: selected ? "primary-80" : disabled ? "grey-20" : "current",
|
6553
6563
|
className: tw("inline-flex items-center gap-3")
|
6554
|
-
}, /* @__PURE__ */
|
6564
|
+
}, /* @__PURE__ */ React63.createElement("span", {
|
6555
6565
|
className: tw("whitespace-nowrap")
|
6556
|
-
}, title), isNumber4(badge) && /* @__PURE__ */
|
6566
|
+
}, title), isNumber4(badge) && /* @__PURE__ */ React63.createElement(Typography2, {
|
6557
6567
|
htmlTag: "span",
|
6558
6568
|
variant: "small",
|
6559
6569
|
color: selected ? "primary-80" : "grey-5",
|
6560
6570
|
className: "leading-none"
|
6561
|
-
}, /* @__PURE__ */
|
6571
|
+
}, /* @__PURE__ */ React63.createElement(TabBadge, {
|
6562
6572
|
kind: "filled",
|
6563
6573
|
value: badge,
|
6564
6574
|
textClassname: classNames({ "text-white": selected, "text-grey-50": !selected })
|
6565
6575
|
})), statusIcon));
|
6566
|
-
return tooltip ? /* @__PURE__ */
|
6576
|
+
return tooltip ? /* @__PURE__ */ React63.createElement(Tooltip, {
|
6567
6577
|
content: tooltip
|
6568
6578
|
}, tab) : tab;
|
6569
6579
|
}
|
@@ -6576,7 +6586,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6576
6586
|
const Tabs2 = (props) => {
|
6577
6587
|
var _a, _b;
|
6578
6588
|
const { className, value, defaultValue, onChange, children } = props;
|
6579
|
-
const childArr =
|
6589
|
+
const childArr = React63.Children.toArray(children);
|
6580
6590
|
const firstTab = childArr[0];
|
6581
6591
|
const firstTabValue = isTabComponent(firstTab) ? firstTab.props.value : -1;
|
6582
6592
|
const [selected, setSelected] = useState7((_b = (_a = value != null ? value : defaultValue) != null ? _a : firstTabValue) != null ? _b : 0);
|
@@ -6662,27 +6672,27 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6662
6672
|
const handleSelected = (key) => {
|
6663
6673
|
(onChange != null ? onChange : setSelected)(key);
|
6664
6674
|
};
|
6665
|
-
|
6675
|
+
React63.Children.forEach(children, (c) => {
|
6666
6676
|
if (c && !isTabComponent(c)) {
|
6667
6677
|
throw new Error("<Tabs> can only have <Tabs.Tab> components as children");
|
6668
6678
|
}
|
6669
6679
|
});
|
6670
|
-
return /* @__PURE__ */
|
6680
|
+
return /* @__PURE__ */ React63.createElement("div", {
|
6671
6681
|
ref: parentRef,
|
6672
6682
|
className: classNames(tw("h-full"), className)
|
6673
|
-
}, /* @__PURE__ */
|
6683
|
+
}, /* @__PURE__ */ React63.createElement("div", {
|
6674
6684
|
className: tw("relative flex items-center h-full border-b-2 border-grey-10")
|
6675
|
-
}, /* @__PURE__ */
|
6685
|
+
}, /* @__PURE__ */ React63.createElement("div", {
|
6676
6686
|
ref: containerRef,
|
6677
6687
|
className: tw("overflow-y-auto scrollbar-hide h-full mb-[-2px]")
|
6678
|
-
}, /* @__PURE__ */
|
6688
|
+
}, /* @__PURE__ */ React63.createElement("div", {
|
6679
6689
|
ref: tabsRef,
|
6680
6690
|
role: "tablist",
|
6681
6691
|
"aria-label": "tabs",
|
6682
6692
|
className: tw("inline-flex items-center cursor-pointer font-normal h-full")
|
6683
|
-
},
|
6693
|
+
}, React63.Children.map(
|
6684
6694
|
children,
|
6685
|
-
(tab, index) => tab ? /* @__PURE__ */
|
6695
|
+
(tab, index) => tab ? /* @__PURE__ */ React63.createElement(TabItemComponent, __spreadProps(__spreadValues({
|
6686
6696
|
key: tab.props.value
|
6687
6697
|
}, tab.props), {
|
6688
6698
|
index,
|
@@ -6690,20 +6700,20 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6690
6700
|
onKeyDown: handleKeyDown,
|
6691
6701
|
onSelected: handleSelected
|
6692
6702
|
})) : void 0
|
6693
|
-
))), leftCaret && /* @__PURE__ */
|
6703
|
+
))), leftCaret && /* @__PURE__ */ React63.createElement("div", {
|
6694
6704
|
className: tw("absolute left-0 bg-gradient-to-r from-white via-white z-20 py-3 pr-4")
|
6695
|
-
}, /* @__PURE__ */
|
6705
|
+
}, /* @__PURE__ */ React63.createElement("div", {
|
6696
6706
|
onClick: () => handleScrollToNext("left"),
|
6697
6707
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
6698
|
-
}, /* @__PURE__ */
|
6708
|
+
}, /* @__PURE__ */ React63.createElement(InlineIcon, {
|
6699
6709
|
icon: import_chevronLeft2.default
|
6700
|
-
}))), rightCaret && /* @__PURE__ */
|
6710
|
+
}))), rightCaret && /* @__PURE__ */ React63.createElement("div", {
|
6701
6711
|
onClick: () => handleScrollToNext("right"),
|
6702
6712
|
className: tw("absolute right-0 bg-gradient-to-l from-white via-white z-20 py-3 pl-4")
|
6703
|
-
}, /* @__PURE__ */
|
6713
|
+
}, /* @__PURE__ */ React63.createElement("div", {
|
6704
6714
|
onClick: () => handleScrollToNext("right"),
|
6705
6715
|
className: tw("hover:bg-grey-0 p-2 leading-none cursor-pointer")
|
6706
|
-
}, /* @__PURE__ */
|
6716
|
+
}, /* @__PURE__ */ React63.createElement(InlineIcon, {
|
6707
6717
|
icon: import_chevronRight2.default
|
6708
6718
|
})))), renderChildren(children, selected, props));
|
6709
6719
|
};
|
@@ -6711,7 +6721,7 @@ var createTabsComponent = (TabComponent, TabItemComponent, displayName, renderCh
|
|
6711
6721
|
Tabs2.Tab = TabComponent;
|
6712
6722
|
return Tabs2;
|
6713
6723
|
};
|
6714
|
-
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */
|
6724
|
+
var Tabs = createTabsComponent(Tab, TabItem, "Tabs", (children, selected) => /* @__PURE__ */ React63.createElement(TabContainer, null, children.find(
|
6715
6725
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
6716
6726
|
)));
|
6717
6727
|
|
@@ -6728,7 +6738,7 @@ var Modal2 = ({
|
|
6728
6738
|
secondaryActions,
|
6729
6739
|
size
|
6730
6740
|
}) => {
|
6731
|
-
const ref =
|
6741
|
+
const ref = React64.useRef(null);
|
6732
6742
|
const state = useOverlayTriggerState4({ isOpen: open });
|
6733
6743
|
const { modalProps, underlayProps } = useModalOverlay2({ isDismissable: false }, state, ref);
|
6734
6744
|
const labelledBy = useId2();
|
@@ -6740,35 +6750,35 @@ var Modal2 = ({
|
|
6740
6750
|
if (!open) {
|
6741
6751
|
return null;
|
6742
6752
|
}
|
6743
|
-
return /* @__PURE__ */
|
6753
|
+
return /* @__PURE__ */ React64.createElement(Overlay2, null, /* @__PURE__ */ React64.createElement(Modal, {
|
6744
6754
|
open: state.isOpen
|
6745
|
-
}, /* @__PURE__ */
|
6755
|
+
}, /* @__PURE__ */ React64.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React64.createElement(FocusScope3, {
|
6746
6756
|
contain: true,
|
6747
6757
|
restoreFocus: true,
|
6748
6758
|
autoFocus: true
|
6749
|
-
}, /* @__PURE__ */
|
6759
|
+
}, /* @__PURE__ */ React64.createElement(Modal.Dialog, __spreadValues(__spreadValues({
|
6750
6760
|
ref,
|
6751
6761
|
size
|
6752
|
-
}, modalProps), dialogProps), /* @__PURE__ */
|
6762
|
+
}, modalProps), dialogProps), /* @__PURE__ */ React64.createElement(Modal.CloseButtonContainer, null, /* @__PURE__ */ React64.createElement(IconButton, {
|
6753
6763
|
"aria-label": "Close",
|
6754
6764
|
icon: import_cross5.default,
|
6755
6765
|
onClick: onClose
|
6756
|
-
})), headerImage !== void 0 && /* @__PURE__ */
|
6766
|
+
})), headerImage !== void 0 && /* @__PURE__ */ React64.createElement(Modal.HeaderImage, {
|
6757
6767
|
backgroundImage: headerImage
|
6758
|
-
}), /* @__PURE__ */
|
6768
|
+
}), /* @__PURE__ */ React64.createElement(Modal.Header, {
|
6759
6769
|
className: tw({ "pb-3": isComponentType(children, ModalTabs) })
|
6760
|
-
}, /* @__PURE__ */
|
6770
|
+
}, /* @__PURE__ */ React64.createElement(Modal.TitleContainer, null, /* @__PURE__ */ React64.createElement(Modal.Title, {
|
6761
6771
|
id: labelledBy
|
6762
|
-
}, title), subtitle && /* @__PURE__ */
|
6772
|
+
}, title), subtitle && /* @__PURE__ */ React64.createElement(Modal.Subtitle, null, subtitle))), isComponentType(children, ModalTabs) ? React64.cloneElement(children, { className: tw("[&>div:first-child]:px-5 grow") }) : /* @__PURE__ */ React64.createElement(Modal.Body, {
|
6763
6773
|
id: describedBy,
|
6764
6774
|
tabIndex: 0,
|
6765
6775
|
noFooter: !(secondaryActions || primaryAction)
|
6766
|
-
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */
|
6776
|
+
}, children), (secondaryActions || primaryAction) && /* @__PURE__ */ React64.createElement(Modal.Footer, null, /* @__PURE__ */ React64.createElement(Modal.Actions, null, secondaryActions && castArray(secondaryActions).filter(Boolean).map((_a) => {
|
6767
6777
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
6768
|
-
return /* @__PURE__ */
|
6778
|
+
return /* @__PURE__ */ React64.createElement(SecondaryButton, __spreadValues({
|
6769
6779
|
key: text
|
6770
6780
|
}, action), text);
|
6771
|
-
}), primaryAction && /* @__PURE__ */
|
6781
|
+
}), primaryAction && /* @__PURE__ */ React64.createElement(PrimaryButton, __spreadValues({
|
6772
6782
|
key: primaryAction.text
|
6773
6783
|
}, omit9(primaryAction, "text")), primaryAction.text)))))));
|
6774
6784
|
};
|
@@ -6776,24 +6786,24 @@ var ModalTabs = createTabsComponent(
|
|
6776
6786
|
ModalTab,
|
6777
6787
|
TabItem,
|
6778
6788
|
"ModalTabs",
|
6779
|
-
(children, selected, props) => /* @__PURE__ */
|
6789
|
+
(children, selected, props) => /* @__PURE__ */ React64.createElement(Modal.Body, {
|
6780
6790
|
maxHeight: props.maxHeight
|
6781
|
-
}, /* @__PURE__ */
|
6791
|
+
}, /* @__PURE__ */ React64.createElement(ModalTabContainer, null, children.find(
|
6782
6792
|
(node, index) => (node == null ? void 0 : node.props.value) === selected || index === selected
|
6783
6793
|
)))
|
6784
6794
|
);
|
6785
6795
|
|
6786
6796
|
// src/components/MultiInput/MultiInput.tsx
|
6787
|
-
import
|
6797
|
+
import React66, { useEffect as useEffect6, useRef as useRef7, useState as useState8 } from "react";
|
6788
6798
|
import castArray2 from "lodash/castArray";
|
6789
6799
|
import identity from "lodash/identity";
|
6790
6800
|
import omit10 from "lodash/omit";
|
6791
6801
|
import uniqueId4 from "lodash/uniqueId";
|
6792
6802
|
|
6793
6803
|
// src/components/MultiInput/InputChip.tsx
|
6794
|
-
import
|
6804
|
+
import React65 from "react";
|
6795
6805
|
var import_smallCross = __toESM(require_smallCross());
|
6796
|
-
var InputChip =
|
6806
|
+
var InputChip = React65.forwardRef(
|
6797
6807
|
(_a, ref) => {
|
6798
6808
|
var _b = _a, { invalid = false, disabled, readOnly, className, onClick: _onClick, children } = _b, props = __objRest(_b, ["invalid", "disabled", "readOnly", "className", "onClick", "children"]);
|
6799
6809
|
const onClick = (e) => {
|
@@ -6801,7 +6811,7 @@ var InputChip = React64.forwardRef(
|
|
6801
6811
|
_onClick == null ? void 0 : _onClick(e);
|
6802
6812
|
}
|
6803
6813
|
};
|
6804
|
-
return /* @__PURE__ */
|
6814
|
+
return /* @__PURE__ */ React65.createElement("div", __spreadValues({
|
6805
6815
|
ref,
|
6806
6816
|
role: "button",
|
6807
6817
|
className: classNames(className, "inline-flex align-middle mx-1 px-2 py-1 items-center rounded-sm break-all", {
|
@@ -6811,10 +6821,10 @@ var InputChip = React64.forwardRef(
|
|
6811
6821
|
"bg-grey-5 pointer-events-none": disabled
|
6812
6822
|
}),
|
6813
6823
|
onClick
|
6814
|
-
}, props), /* @__PURE__ */
|
6824
|
+
}, props), /* @__PURE__ */ React65.createElement(Typography2, {
|
6815
6825
|
variant: "small",
|
6816
6826
|
color: invalid ? "error-80" : disabled ? "grey-40" : "grey-70"
|
6817
|
-
}, children), !readOnly && /* @__PURE__ */
|
6827
|
+
}, children), !readOnly && /* @__PURE__ */ React65.createElement("div", null, /* @__PURE__ */ React65.createElement(Icon, {
|
6818
6828
|
icon: import_smallCross.default,
|
6819
6829
|
className: tw("ml-2", {
|
6820
6830
|
"text-error-70": invalid,
|
@@ -6952,7 +6962,7 @@ var MultiInputBase = (_a) => {
|
|
6952
6962
|
};
|
6953
6963
|
const renderChips = () => items == null ? void 0 : items.map((item, index) => {
|
6954
6964
|
var _a3;
|
6955
|
-
return /* @__PURE__ */
|
6965
|
+
return /* @__PURE__ */ React66.createElement(InputChip, {
|
6956
6966
|
key: `${itemToString(item)}.${index}`,
|
6957
6967
|
invalid: !((_a3 = isItemValid == null ? void 0 : isItemValid(item, index)) != null ? _a3 : true),
|
6958
6968
|
readOnly,
|
@@ -6963,11 +6973,11 @@ var MultiInputBase = (_a) => {
|
|
6963
6973
|
}
|
6964
6974
|
}, itemToString(item));
|
6965
6975
|
});
|
6966
|
-
return /* @__PURE__ */
|
6976
|
+
return /* @__PURE__ */ React66.createElement("div", null, /* @__PURE__ */ React66.createElement(Select.InputContainer, {
|
6967
6977
|
variant: disabled ? "disabled" : valid === false ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
6968
|
-
}, /* @__PURE__ */
|
6978
|
+
}, /* @__PURE__ */ React66.createElement("div", {
|
6969
6979
|
className: "grow inline-flex flex-row flex-wrap gap-y-2"
|
6970
|
-
}, inline && renderChips(), /* @__PURE__ */
|
6980
|
+
}, inline && renderChips(), /* @__PURE__ */ React66.createElement(Select.Input, __spreadProps(__spreadValues({
|
6971
6981
|
ref: inputRef,
|
6972
6982
|
id: id != null ? id : name,
|
6973
6983
|
name,
|
@@ -6985,11 +6995,11 @@ var MultiInputBase = (_a) => {
|
|
6985
6995
|
onFocus: handleFocus,
|
6986
6996
|
onBlur: handleBlur,
|
6987
6997
|
autoComplete: "off"
|
6988
|
-
}))), endAdornment && /* @__PURE__ */
|
6998
|
+
}))), endAdornment && /* @__PURE__ */ React66.createElement(InputAdornment, null, endAdornment)), !inline && /* @__PURE__ */ React66.createElement("div", {
|
6989
6999
|
className: tw("flex flex-row flex-wrap gap-y-2 mt-2")
|
6990
7000
|
}, renderChips()));
|
6991
7001
|
};
|
6992
|
-
var BaseMultiInputSkeleton = () => /* @__PURE__ */
|
7002
|
+
var BaseMultiInputSkeleton = () => /* @__PURE__ */ React66.createElement(Skeleton, {
|
6993
7003
|
height: 38
|
6994
7004
|
});
|
6995
7005
|
MultiInputBase.Skeleton = BaseMultiInputSkeleton;
|
@@ -7006,14 +7016,14 @@ var MultiInput = (props) => {
|
|
7006
7016
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7007
7017
|
const labelControlProps = getLabelControlProps(props);
|
7008
7018
|
const baseProps = omit10(props, Object.keys(labelControlProps));
|
7009
|
-
return /* @__PURE__ */
|
7019
|
+
return /* @__PURE__ */ React66.createElement(LabelControl, __spreadProps(__spreadValues({
|
7010
7020
|
id: `${id.current}-label`,
|
7011
7021
|
htmlFor: `${id.current}-input`,
|
7012
7022
|
messageId: errorMessageId
|
7013
7023
|
}, labelControlProps), {
|
7014
7024
|
length: value.length,
|
7015
7025
|
maxLength
|
7016
|
-
}), /* @__PURE__ */
|
7026
|
+
}), /* @__PURE__ */ React66.createElement(MultiInputBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7017
7027
|
id: `${id.current}-input`,
|
7018
7028
|
onChange: (value2) => {
|
7019
7029
|
var _a2;
|
@@ -7025,12 +7035,12 @@ var MultiInput = (props) => {
|
|
7025
7035
|
valid: props.valid
|
7026
7036
|
})));
|
7027
7037
|
};
|
7028
|
-
var MultiInputSkeleton = () => /* @__PURE__ */
|
7038
|
+
var MultiInputSkeleton = () => /* @__PURE__ */ React66.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React66.createElement(MultiInputBase.Skeleton, null));
|
7029
7039
|
MultiInput.Skeleton = MultiInputSkeleton;
|
7030
7040
|
MultiInput.Skeleton.displayName = "MultiInput.Skeleton";
|
7031
7041
|
|
7032
7042
|
// src/components/MultiSelect/MultiSelect.tsx
|
7033
|
-
import
|
7043
|
+
import React67, { useRef as useRef8, useState as useState9 } from "react";
|
7034
7044
|
import { useOverlayPosition as useOverlayPosition5 } from "@react-aria/overlays";
|
7035
7045
|
import { useCombobox as useCombobox2, useMultipleSelection } from "downshift";
|
7036
7046
|
import isNil from "lodash/isNil";
|
@@ -7149,7 +7159,7 @@ var MultiSelectBase = (_a) => {
|
|
7149
7159
|
});
|
7150
7160
|
const inputProps = getInputProps(getDropdownProps({ preventKeyAction: isOpen, disabled: disabled || readOnly }));
|
7151
7161
|
const renderChips = () => {
|
7152
|
-
return selectedItems.map((selectedItem, index) => /* @__PURE__ */
|
7162
|
+
return selectedItems.map((selectedItem, index) => /* @__PURE__ */ React67.createElement(InputChip, __spreadProps(__spreadValues({
|
7153
7163
|
key: `${itemToString(selectedItem)}.chip`,
|
7154
7164
|
className: tw("mx-0"),
|
7155
7165
|
disabled,
|
@@ -7164,14 +7174,14 @@ var MultiSelectBase = (_a) => {
|
|
7164
7174
|
const hasNoResults = options.length === 0 || filteredOptions.length === 0;
|
7165
7175
|
const width = (_a2 = targetRef.current) == null ? void 0 : _a2.offsetWidth;
|
7166
7176
|
const style = isOpen ? __spreadProps(__spreadValues({}, overlayProps.style), { width }) : { display: "none" };
|
7167
|
-
return /* @__PURE__ */
|
7177
|
+
return /* @__PURE__ */ React67.createElement("div", {
|
7168
7178
|
className: tw("relative")
|
7169
|
-
}, /* @__PURE__ */
|
7179
|
+
}, /* @__PURE__ */ React67.createElement(Select.InputContainer, {
|
7170
7180
|
ref: targetRef,
|
7171
7181
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default"
|
7172
|
-
}, /* @__PURE__ */
|
7182
|
+
}, /* @__PURE__ */ React67.createElement("div", {
|
7173
7183
|
className: "grow inline-flex flex-row flex-wrap gap-2"
|
7174
|
-
}, !hideChips && inline && renderChips(), /* @__PURE__ */
|
7184
|
+
}, !hideChips && inline && renderChips(), /* @__PURE__ */ React67.createElement(Select.Input, __spreadProps(__spreadValues(__spreadValues({
|
7175
7185
|
id,
|
7176
7186
|
name,
|
7177
7187
|
placeholder: selectedItems.length === 0 && !readOnly ? placeholder : "",
|
@@ -7187,27 +7197,27 @@ var MultiSelectBase = (_a) => {
|
|
7187
7197
|
onKeyUp: (e) => e.stopPropagation(),
|
7188
7198
|
onFocus: () => setFocus(true),
|
7189
7199
|
onBlur: () => setFocus(false)
|
7190
|
-
}))), !readOnly && /* @__PURE__ */
|
7200
|
+
}))), !readOnly && /* @__PURE__ */ React67.createElement(Select.Toggle, __spreadValues({
|
7191
7201
|
hasFocus,
|
7192
7202
|
isOpen
|
7193
|
-
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */
|
7203
|
+
}, getToggleButtonProps({ disabled })))), !hideChips && !inline && /* @__PURE__ */ React67.createElement("div", {
|
7194
7204
|
className: tw("flex flex-row flex-wrap gap-2 mt-2")
|
7195
|
-
}, renderChips()), /* @__PURE__ */
|
7205
|
+
}, renderChips()), /* @__PURE__ */ React67.createElement(PopoverWrapper, __spreadProps(__spreadValues({
|
7196
7206
|
isOpen: true,
|
7197
7207
|
isDismissable: true,
|
7198
7208
|
autoFocus: true
|
7199
7209
|
}, getMenuProps({ ref: overlayRef })), {
|
7200
7210
|
style,
|
7201
7211
|
onClose: closeMenu
|
7202
|
-
}), /* @__PURE__ */
|
7212
|
+
}), /* @__PURE__ */ React67.createElement(Select.Menu, {
|
7203
7213
|
maxHeight
|
7204
|
-
}, isOpen && hasNoResults && /* @__PURE__ */
|
7214
|
+
}, isOpen && hasNoResults && /* @__PURE__ */ React67.createElement(Select.NoResults, null, noResults), isOpen && filteredOptions.map((item, index) => /* @__PURE__ */ React67.createElement(Select.Item, __spreadValues({
|
7205
7215
|
key: itemToString(item),
|
7206
7216
|
highlighted: index === highlightedIndex,
|
7207
7217
|
selected: selectedItems.includes(item)
|
7208
7218
|
}, getItemProps({ item, index, disabled: isOptionDisabled(item, index) })), renderOption(item))))));
|
7209
7219
|
};
|
7210
|
-
var MultiSelectBaseSkeleton = () => /* @__PURE__ */
|
7220
|
+
var MultiSelectBaseSkeleton = () => /* @__PURE__ */ React67.createElement(Skeleton, {
|
7211
7221
|
height: 38
|
7212
7222
|
});
|
7213
7223
|
MultiSelectBase.Skeleton = MultiSelectBaseSkeleton;
|
@@ -7225,11 +7235,11 @@ var MultiSelect = (_a) => {
|
|
7225
7235
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7226
7236
|
const labelControlProps = getLabelControlProps(props);
|
7227
7237
|
const baseProps = omit11(props, Object.keys(labelControlProps));
|
7228
|
-
return /* @__PURE__ */
|
7238
|
+
return /* @__PURE__ */ React67.createElement(LabelControl, __spreadValues({
|
7229
7239
|
id: `${id.current}-label`,
|
7230
7240
|
htmlFor: `${id.current}-input`,
|
7231
7241
|
messageId: errorMessageId
|
7232
|
-
}, labelControlProps), /* @__PURE__ */
|
7242
|
+
}, labelControlProps), /* @__PURE__ */ React67.createElement(MultiSelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7233
7243
|
id: id.current,
|
7234
7244
|
options,
|
7235
7245
|
noResults,
|
@@ -7237,16 +7247,16 @@ var MultiSelect = (_a) => {
|
|
7237
7247
|
valid: props.valid
|
7238
7248
|
})));
|
7239
7249
|
};
|
7240
|
-
var MultiSelectSkeleton = () => /* @__PURE__ */
|
7250
|
+
var MultiSelectSkeleton = () => /* @__PURE__ */ React67.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React67.createElement(MultiSelectBase.Skeleton, null));
|
7241
7251
|
MultiSelect.Skeleton = MultiSelectSkeleton;
|
7242
7252
|
MultiSelect.Skeleton.displayName = "MultiSelect.Skeleton";
|
7243
7253
|
|
7244
7254
|
// src/components/NativeSelect/NativeSelect.tsx
|
7245
|
-
import
|
7255
|
+
import React68, { useRef as useRef9 } from "react";
|
7246
7256
|
import omit12 from "lodash/omit";
|
7247
7257
|
import uniqueId6 from "lodash/uniqueId";
|
7248
7258
|
var import_caretDown = __toESM(require_caretDown());
|
7249
|
-
var NativeSelectBase =
|
7259
|
+
var NativeSelectBase = React68.forwardRef(
|
7250
7260
|
(_a, ref) => {
|
7251
7261
|
var _b = _a, { children, disabled = false, required = false, valid = true, readOnly = false } = _b, props = __objRest(_b, ["children", "disabled", "required", "valid", "readOnly"]);
|
7252
7262
|
const placeholderValue = uniqueId6("default_value_for_placeholder");
|
@@ -7263,16 +7273,16 @@ var NativeSelectBase = React67.forwardRef(
|
|
7263
7273
|
(_b2 = props.onBlur) == null ? void 0 : _b2.call(props, event);
|
7264
7274
|
}
|
7265
7275
|
};
|
7266
|
-
return /* @__PURE__ */
|
7276
|
+
return /* @__PURE__ */ React68.createElement("span", {
|
7267
7277
|
className: tw("relative block")
|
7268
|
-
}, !readOnly && /* @__PURE__ */
|
7278
|
+
}, !readOnly && /* @__PURE__ */ React68.createElement("span", {
|
7269
7279
|
className: tw(
|
7270
7280
|
"absolute right-0 inset-y-0 mr-4 text-grey-40 flex ml-3 pointer-events-none typography-default-strong mt-4"
|
7271
7281
|
)
|
7272
|
-
}, /* @__PURE__ */
|
7282
|
+
}, /* @__PURE__ */ React68.createElement(Icon, {
|
7273
7283
|
icon: import_caretDown.default,
|
7274
7284
|
"data-testid": "icon-dropdown"
|
7275
|
-
})), /* @__PURE__ */
|
7285
|
+
})), /* @__PURE__ */ React68.createElement("select", __spreadProps(__spreadValues({
|
7276
7286
|
ref,
|
7277
7287
|
disabled: disabled || readOnly,
|
7278
7288
|
required
|
@@ -7291,16 +7301,16 @@ var NativeSelectBase = React67.forwardRef(
|
|
7291
7301
|
),
|
7292
7302
|
props.className
|
7293
7303
|
)
|
7294
|
-
}), props.placeholder && /* @__PURE__ */
|
7304
|
+
}), props.placeholder && /* @__PURE__ */ React68.createElement("option", {
|
7295
7305
|
value: placeholderValue,
|
7296
7306
|
disabled: true
|
7297
7307
|
}, props.placeholder), children));
|
7298
7308
|
}
|
7299
7309
|
);
|
7300
|
-
NativeSelectBase.Skeleton = () => /* @__PURE__ */
|
7310
|
+
NativeSelectBase.Skeleton = () => /* @__PURE__ */ React68.createElement(Skeleton, {
|
7301
7311
|
height: 38
|
7302
7312
|
});
|
7303
|
-
var NativeSelect =
|
7313
|
+
var NativeSelect = React68.forwardRef(
|
7304
7314
|
(_a, ref) => {
|
7305
7315
|
var _b = _a, { readOnly } = _b, props = __objRest(_b, ["readOnly"]);
|
7306
7316
|
var _a2;
|
@@ -7309,11 +7319,11 @@ var NativeSelect = React67.forwardRef(
|
|
7309
7319
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7310
7320
|
const _b2 = getLabelControlProps(props), { "data-testid": dataTestId } = _b2, labelControlProps = __objRest(_b2, ["data-testid"]);
|
7311
7321
|
const baseProps = omit12(props, Object.keys(labelControlProps));
|
7312
|
-
return /* @__PURE__ */
|
7322
|
+
return /* @__PURE__ */ React68.createElement(LabelControl, __spreadValues({
|
7313
7323
|
id: `${id.current}-label`,
|
7314
7324
|
htmlFor: id.current,
|
7315
7325
|
messageId: errorMessageId
|
7316
|
-
}, labelControlProps), /* @__PURE__ */
|
7326
|
+
}, labelControlProps), /* @__PURE__ */ React68.createElement(NativeSelectBase, __spreadProps(__spreadValues(__spreadValues({
|
7317
7327
|
ref
|
7318
7328
|
}, baseProps), errorProps), {
|
7319
7329
|
id: id.current,
|
@@ -7326,20 +7336,20 @@ var NativeSelect = React67.forwardRef(
|
|
7326
7336
|
})));
|
7327
7337
|
}
|
7328
7338
|
);
|
7329
|
-
var Option =
|
7339
|
+
var Option = React68.forwardRef((_a, ref) => {
|
7330
7340
|
var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
|
7331
|
-
return /* @__PURE__ */
|
7341
|
+
return /* @__PURE__ */ React68.createElement("option", __spreadValues({
|
7332
7342
|
ref
|
7333
7343
|
}, props), children);
|
7334
7344
|
});
|
7335
|
-
var NativeSelectSkeleton = () => /* @__PURE__ */
|
7345
|
+
var NativeSelectSkeleton = () => /* @__PURE__ */ React68.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React68.createElement(NativeSelectBase.Skeleton, null), /* @__PURE__ */ React68.createElement("div", {
|
7336
7346
|
style: { height: "1px" }
|
7337
7347
|
}));
|
7338
7348
|
NativeSelect.Skeleton = NativeSelectSkeleton;
|
7339
7349
|
NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
|
7340
7350
|
|
7341
7351
|
// src/components/PageHeader/PageHeader.tsx
|
7342
|
-
import
|
7352
|
+
import React69 from "react";
|
7343
7353
|
import castArray3 from "lodash/castArray";
|
7344
7354
|
import omit13 from "lodash/omit";
|
7345
7355
|
var PageHeader = ({
|
@@ -7351,48 +7361,48 @@ var PageHeader = ({
|
|
7351
7361
|
chips = [],
|
7352
7362
|
breadcrumbs
|
7353
7363
|
}) => {
|
7354
|
-
return /* @__PURE__ */
|
7364
|
+
return /* @__PURE__ */ React69.createElement(Flexbox, {
|
7355
7365
|
direction: "row",
|
7356
7366
|
gap: "4",
|
7357
7367
|
paddingBottom: "6"
|
7358
|
-
}, /* @__PURE__ */
|
7368
|
+
}, /* @__PURE__ */ React69.createElement(Flexbox, {
|
7359
7369
|
className: tw("grow"),
|
7360
7370
|
direction: "column",
|
7361
7371
|
gap: "0"
|
7362
|
-
}, breadcrumbs && /* @__PURE__ */
|
7372
|
+
}, breadcrumbs && /* @__PURE__ */ React69.createElement(Breadcrumbs, null, breadcrumbs), /* @__PURE__ */ React69.createElement(Flexbox, {
|
7363
7373
|
gap: "5"
|
7364
|
-
}, image && /* @__PURE__ */
|
7374
|
+
}, image && /* @__PURE__ */ React69.createElement("img", {
|
7365
7375
|
src: image,
|
7366
7376
|
alt: imageAlt,
|
7367
7377
|
className: tw("w-[56px] h-[56px]")
|
7368
|
-
}), /* @__PURE__ */
|
7378
|
+
}), /* @__PURE__ */ React69.createElement(Flexbox, {
|
7369
7379
|
direction: "column",
|
7370
7380
|
justifyContent: "center"
|
7371
|
-
}, /* @__PURE__ */
|
7381
|
+
}, /* @__PURE__ */ React69.createElement(Typography2.Heading, null, title), chips.length > 0 && /* @__PURE__ */ React69.createElement(Flexbox, {
|
7372
7382
|
gap: "3"
|
7373
|
-
}, chips.map((chip) => /* @__PURE__ */
|
7383
|
+
}, chips.map((chip) => /* @__PURE__ */ React69.createElement(Chip2, {
|
7374
7384
|
key: chip,
|
7375
7385
|
dense: true,
|
7376
7386
|
text: chip
|
7377
|
-
})))))), (secondaryActions || primaryAction) && /* @__PURE__ */
|
7387
|
+
})))))), (secondaryActions || primaryAction) && /* @__PURE__ */ React69.createElement(Flexbox, {
|
7378
7388
|
gap: "4",
|
7379
7389
|
className: tw("self-start")
|
7380
7390
|
}, secondaryActions && castArray3(secondaryActions).filter(Boolean).map((_a) => {
|
7381
7391
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
7382
|
-
return /* @__PURE__ */
|
7392
|
+
return /* @__PURE__ */ React69.createElement(SecondaryButton, __spreadValues({
|
7383
7393
|
key: text
|
7384
7394
|
}, action), text);
|
7385
|
-
}), primaryAction && /* @__PURE__ */
|
7395
|
+
}), primaryAction && /* @__PURE__ */ React69.createElement(PrimaryButton, __spreadValues({
|
7386
7396
|
key: primaryAction.text
|
7387
7397
|
}, omit13(primaryAction, "text")), primaryAction.text)));
|
7388
7398
|
};
|
7389
7399
|
|
7390
7400
|
// src/components/Pagination/Pagination.tsx
|
7391
|
-
import
|
7401
|
+
import React71 from "react";
|
7392
7402
|
import clamp from "lodash/clamp";
|
7393
7403
|
|
7394
7404
|
// src/components/Select/Select.tsx
|
7395
|
-
import
|
7405
|
+
import React70, { useRef as useRef10, useState as useState10 } from "react";
|
7396
7406
|
import { useOverlayPosition as useOverlayPosition6 } from "@react-aria/overlays";
|
7397
7407
|
import { useSelect } from "downshift";
|
7398
7408
|
import defaults from "lodash/defaults";
|
@@ -7409,10 +7419,10 @@ var hasOptionGroups = (val) => {
|
|
7409
7419
|
};
|
7410
7420
|
var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getValue, optionToString = getOptionLabelBuiltin }) => {
|
7411
7421
|
var _a, _b;
|
7412
|
-
return /* @__PURE__ */
|
7422
|
+
return /* @__PURE__ */ React70.createElement(Select.Item, __spreadValues({
|
7413
7423
|
key: (_b = (_a = getOptionKey == null ? void 0 : getOptionKey(item)) != null ? _a : getValue == null ? void 0 : getValue(item)) != null ? _b : optionToString(item),
|
7414
7424
|
selected: item === selectedItem
|
7415
|
-
}, props), hasIconProperty(item) && /* @__PURE__ */
|
7425
|
+
}, props), hasIconProperty(item) && /* @__PURE__ */ React70.createElement(InlineIcon, {
|
7416
7426
|
icon: item.icon
|
7417
7427
|
}), optionToString(item));
|
7418
7428
|
};
|
@@ -7529,13 +7539,13 @@ var _SelectBase = (props) => {
|
|
7529
7539
|
},
|
7530
7540
|
withDefaults
|
7531
7541
|
);
|
7532
|
-
const renderGroup = (group) => /* @__PURE__ */
|
7542
|
+
const renderGroup = (group) => /* @__PURE__ */ React70.createElement(React70.Fragment, {
|
7533
7543
|
key: group.label
|
7534
|
-
}, /* @__PURE__ */
|
7535
|
-
const input = /* @__PURE__ */
|
7544
|
+
}, /* @__PURE__ */ React70.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, items.indexOf(opt))));
|
7545
|
+
const input = /* @__PURE__ */ React70.createElement(Select.InputContainer, __spreadProps(__spreadValues({}, getToggleButtonProps({ disabled: disabled || readOnly, ref: targetRef })), {
|
7536
7546
|
variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default",
|
7537
7547
|
tabIndex: 0
|
7538
|
-
}), /* @__PURE__ */
|
7548
|
+
}), /* @__PURE__ */ React70.createElement(Select.Input, __spreadProps(__spreadValues({
|
7539
7549
|
id,
|
7540
7550
|
name
|
7541
7551
|
}, rest), {
|
@@ -7547,27 +7557,27 @@ var _SelectBase = (props) => {
|
|
7547
7557
|
tabIndex: -1,
|
7548
7558
|
onFocus: () => setFocus(true),
|
7549
7559
|
onBlur: () => setFocus(false)
|
7550
|
-
})), !readOnly && /* @__PURE__ */
|
7560
|
+
})), !readOnly && /* @__PURE__ */ React70.createElement(Select.Toggle, {
|
7551
7561
|
disabled,
|
7552
7562
|
isOpen,
|
7553
7563
|
tabIndex: -1
|
7554
7564
|
}));
|
7555
7565
|
const width = (_b = targetRef.current) == null ? void 0 : _b.offsetWidth;
|
7556
7566
|
const style = isOpen ? __spreadProps(__spreadValues({}, overlayProps.style), { width }) : { display: "none" };
|
7557
|
-
return /* @__PURE__ */
|
7567
|
+
return /* @__PURE__ */ React70.createElement("div", {
|
7558
7568
|
className: tw("relative")
|
7559
|
-
}, labelWrapper ?
|
7569
|
+
}, labelWrapper ? React70.cloneElement(labelWrapper, { children: input }) : input, /* @__PURE__ */ React70.createElement(PopoverWrapper, __spreadProps(__spreadValues({
|
7560
7570
|
isOpen: true,
|
7561
7571
|
isDismissable: true,
|
7562
7572
|
autoFocus: true
|
7563
7573
|
}, getMenuProps({ ref: overlayRef })), {
|
7564
7574
|
style,
|
7565
7575
|
onClose: closeMenu
|
7566
|
-
}), /* @__PURE__ */
|
7576
|
+
}), /* @__PURE__ */ React70.createElement(Select.Menu, {
|
7567
7577
|
maxHeight
|
7568
|
-
}, isOpen && options.length === 0 && /* @__PURE__ */
|
7578
|
+
}, isOpen && options.length === 0 && /* @__PURE__ */ React70.createElement(Select.EmptyStateContainer, null, emptyState), isOpen && options.length > 0 && !hasOptionGroups(options) && options.map(renderItem), isOpen && options.length > 0 && hasOptionGroups(options) && options.map(renderGroup), isOpen && actions.length > 0 && /* @__PURE__ */ React70.createElement(React70.Fragment, null, /* @__PURE__ */ React70.createElement(Select.Divider, {
|
7569
7579
|
onMouseOver: () => setHighlightedIndex(-1)
|
7570
|
-
}), actions.map((act, index) => /* @__PURE__ */
|
7580
|
+
}), actions.map((act, index) => /* @__PURE__ */ React70.createElement(Select.ActionItem, __spreadProps(__spreadValues({
|
7571
7581
|
key: `${index}`
|
7572
7582
|
}, act), {
|
7573
7583
|
onMouseOver: () => setHighlightedIndex(-1),
|
@@ -7577,10 +7587,10 @@ var _SelectBase = (props) => {
|
|
7577
7587
|
}
|
7578
7588
|
}), act.label))))));
|
7579
7589
|
};
|
7580
|
-
var SelectBase = (props) => /* @__PURE__ */
|
7590
|
+
var SelectBase = (props) => /* @__PURE__ */ React70.createElement(_SelectBase, __spreadProps(__spreadValues({}, props), {
|
7581
7591
|
labelWrapper: void 0
|
7582
7592
|
}));
|
7583
|
-
var SelectBaseSkeleton = () => /* @__PURE__ */
|
7593
|
+
var SelectBaseSkeleton = () => /* @__PURE__ */ React70.createElement(Skeleton, {
|
7584
7594
|
height: 38
|
7585
7595
|
});
|
7586
7596
|
SelectBase.Skeleton = SelectBaseSkeleton;
|
@@ -7598,19 +7608,19 @@ var Select2 = (_a) => {
|
|
7598
7608
|
const baseProps = omit14(props, Object.keys(labelProps));
|
7599
7609
|
const legacyError = labelProps.error !== void 0 && labelProps.valid === false;
|
7600
7610
|
const variant = !labelProps.valid || legacyError ? "error" : labelProps.disabled ? "disabled" : "default";
|
7601
|
-
const label = /* @__PURE__ */
|
7611
|
+
const label = /* @__PURE__ */ React70.createElement(Label, __spreadValues({
|
7602
7612
|
id: `${id.current}-label`,
|
7603
7613
|
htmlFor: `${id.current}-input`,
|
7604
7614
|
variant,
|
7605
7615
|
messageId: errorMessageId
|
7606
7616
|
}, labelProps));
|
7607
|
-
return /* @__PURE__ */
|
7617
|
+
return /* @__PURE__ */ React70.createElement(FormControl, null, /* @__PURE__ */ React70.createElement(_SelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
|
7608
7618
|
id: `${id.current}-input`,
|
7609
7619
|
options,
|
7610
7620
|
disabled: props.disabled,
|
7611
7621
|
valid: props.valid,
|
7612
7622
|
labelWrapper: label
|
7613
|
-
})), /* @__PURE__ */
|
7623
|
+
})), /* @__PURE__ */ React70.createElement(HelperText, {
|
7614
7624
|
messageId: errorMessageId,
|
7615
7625
|
error: !labelProps.valid,
|
7616
7626
|
helperText: labelProps.helperText,
|
@@ -7619,7 +7629,7 @@ var Select2 = (_a) => {
|
|
7619
7629
|
reserveSpaceForError: labelProps.reserveSpaceForError
|
7620
7630
|
}));
|
7621
7631
|
};
|
7622
|
-
var SelectSkeleton = () => /* @__PURE__ */
|
7632
|
+
var SelectSkeleton = () => /* @__PURE__ */ React70.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React70.createElement(SelectBase.Skeleton, null));
|
7623
7633
|
Select2.Skeleton = SelectSkeleton;
|
7624
7634
|
|
7625
7635
|
// src/components/Pagination/Pagination.tsx
|
@@ -7637,25 +7647,25 @@ var Pagination = ({
|
|
7637
7647
|
pageSizes,
|
7638
7648
|
onPageSizeChange
|
7639
7649
|
}) => {
|
7640
|
-
const [value, setValue] =
|
7641
|
-
|
7650
|
+
const [value, setValue] = React71.useState(currentPage);
|
7651
|
+
React71.useEffect(() => {
|
7642
7652
|
setValue(currentPage);
|
7643
7653
|
}, [currentPage]);
|
7644
|
-
|
7654
|
+
React71.useEffect(() => {
|
7645
7655
|
onPageChange(1);
|
7646
7656
|
setValue(1);
|
7647
7657
|
}, [pageSize]);
|
7648
|
-
return /* @__PURE__ */
|
7658
|
+
return /* @__PURE__ */ React71.createElement(Box, {
|
7649
7659
|
className: tw("grid grid-cols-[200px_1fr_200px]"),
|
7650
7660
|
backgroundColor: "grey-0",
|
7651
7661
|
padding: "4"
|
7652
|
-
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */
|
7662
|
+
}, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */ React71.createElement(Box, {
|
7653
7663
|
display: "flex",
|
7654
7664
|
alignItems: "center",
|
7655
7665
|
gap: "4"
|
7656
|
-
}, /* @__PURE__ */
|
7666
|
+
}, /* @__PURE__ */ React71.createElement(Typography2.SmallText, null, "Items per page "), /* @__PURE__ */ React71.createElement("div", {
|
7657
7667
|
className: tw("max-w-[70px]")
|
7658
|
-
}, /* @__PURE__ */
|
7668
|
+
}, /* @__PURE__ */ React71.createElement(SelectBase, {
|
7659
7669
|
options: pageSizes.map((size) => size.toString()),
|
7660
7670
|
value: pageSize.toString(),
|
7661
7671
|
onChange: (size) => {
|
@@ -7666,24 +7676,24 @@ var Pagination = ({
|
|
7666
7676
|
}
|
7667
7677
|
}
|
7668
7678
|
}
|
7669
|
-
}))) : /* @__PURE__ */
|
7679
|
+
}))) : /* @__PURE__ */ React71.createElement("div", null), /* @__PURE__ */ React71.createElement(Box, {
|
7670
7680
|
display: "flex",
|
7671
7681
|
justifyContent: "center",
|
7672
7682
|
alignItems: "center",
|
7673
7683
|
className: tw("grow")
|
7674
|
-
}, /* @__PURE__ */
|
7684
|
+
}, /* @__PURE__ */ React71.createElement(IconButton, {
|
7675
7685
|
"aria-label": "First",
|
7676
7686
|
onClick: () => onPageChange(1),
|
7677
7687
|
icon: import_chevronBackward.default,
|
7678
7688
|
disabled: !hasPreviousPage
|
7679
|
-
}), /* @__PURE__ */
|
7689
|
+
}), /* @__PURE__ */ React71.createElement(IconButton, {
|
7680
7690
|
"aria-label": "Previous",
|
7681
7691
|
onClick: () => onPageChange(currentPage - 1),
|
7682
7692
|
icon: import_chevronLeft3.default,
|
7683
7693
|
disabled: !hasPreviousPage
|
7684
|
-
}), /* @__PURE__ */
|
7694
|
+
}), /* @__PURE__ */ React71.createElement(Box, {
|
7685
7695
|
paddingX: "4"
|
7686
|
-
}, /* @__PURE__ */
|
7696
|
+
}, /* @__PURE__ */ React71.createElement(Typography2.SmallText, null, "Page")), /* @__PURE__ */ React71.createElement(InputBase, {
|
7687
7697
|
className: classNames(tw("text-center max-w-[40px]"), "no-arrows"),
|
7688
7698
|
type: "number",
|
7689
7699
|
min: 1,
|
@@ -7706,43 +7716,43 @@ var Pagination = ({
|
|
7706
7716
|
setValue(1);
|
7707
7717
|
}
|
7708
7718
|
}
|
7709
|
-
}), /* @__PURE__ */
|
7719
|
+
}), /* @__PURE__ */ React71.createElement(Box, {
|
7710
7720
|
paddingX: "4"
|
7711
|
-
}, /* @__PURE__ */
|
7721
|
+
}, /* @__PURE__ */ React71.createElement(Typography2.SmallText, null, "of ", totalPages)), /* @__PURE__ */ React71.createElement(IconButton, {
|
7712
7722
|
"aria-label": "Next",
|
7713
7723
|
onClick: () => onPageChange(currentPage + 1),
|
7714
7724
|
icon: import_chevronRight3.default,
|
7715
7725
|
disabled: !hasNextPage
|
7716
|
-
}), /* @__PURE__ */
|
7726
|
+
}), /* @__PURE__ */ React71.createElement(IconButton, {
|
7717
7727
|
"aria-label": "Last",
|
7718
7728
|
onClick: () => onPageChange(totalPages),
|
7719
7729
|
icon: import_chevronForward.default,
|
7720
7730
|
disabled: !hasNextPage
|
7721
|
-
})), /* @__PURE__ */
|
7731
|
+
})), /* @__PURE__ */ React71.createElement("div", null));
|
7722
7732
|
};
|
7723
7733
|
|
7724
7734
|
// src/components/PopoverDialog/PopoverDialog.tsx
|
7725
|
-
import
|
7735
|
+
import React73 from "react";
|
7726
7736
|
import omit15 from "lodash/omit";
|
7727
7737
|
|
7728
7738
|
// src/common/PopoverDialog/PopoverDialog.tsx
|
7729
|
-
import
|
7739
|
+
import React72 from "react";
|
7730
7740
|
var Header = (_a) => {
|
7731
7741
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7732
|
-
return /* @__PURE__ */
|
7742
|
+
return /* @__PURE__ */ React72.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7733
7743
|
className: classNames(tw("p-5 gap-3 flex items-center"), className)
|
7734
7744
|
}), children);
|
7735
7745
|
};
|
7736
7746
|
var Title = (_a) => {
|
7737
7747
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7738
|
-
return /* @__PURE__ */
|
7748
|
+
return /* @__PURE__ */ React72.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
7739
7749
|
htmlTag: "h1",
|
7740
7750
|
variant: "small-strong"
|
7741
7751
|
}), children);
|
7742
7752
|
};
|
7743
7753
|
var Body = (_a) => {
|
7744
7754
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7745
|
-
return /* @__PURE__ */
|
7755
|
+
return /* @__PURE__ */ React72.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
|
7746
7756
|
htmlTag: "div",
|
7747
7757
|
variant: "caption",
|
7748
7758
|
className: classNames(tw("px-5 overflow-y-auto"), className)
|
@@ -7750,13 +7760,13 @@ var Body = (_a) => {
|
|
7750
7760
|
};
|
7751
7761
|
var Footer = (_a) => {
|
7752
7762
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7753
|
-
return /* @__PURE__ */
|
7763
|
+
return /* @__PURE__ */ React72.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7754
7764
|
className: classNames(tw("p-5"), className)
|
7755
7765
|
}), children);
|
7756
7766
|
};
|
7757
7767
|
var Actions = (_a) => {
|
7758
7768
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7759
|
-
return /* @__PURE__ */
|
7769
|
+
return /* @__PURE__ */ React72.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7760
7770
|
className: classNames(tw("flex gap-4"), className)
|
7761
7771
|
}), children);
|
7762
7772
|
};
|
@@ -7772,13 +7782,13 @@ var PopoverDialog = {
|
|
7772
7782
|
var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
|
7773
7783
|
const wrapPromptWithBody = (child) => {
|
7774
7784
|
if (isComponentType(child, PopoverDialog2.Prompt)) {
|
7775
|
-
return /* @__PURE__ */
|
7785
|
+
return /* @__PURE__ */ React73.createElement(Popover2.Panel, {
|
7776
7786
|
className: tw("max-w-[300px]")
|
7777
|
-
}, /* @__PURE__ */
|
7787
|
+
}, /* @__PURE__ */ React73.createElement(PopoverDialog.Header, null, /* @__PURE__ */ React73.createElement(PopoverDialog.Title, null, title)), child, /* @__PURE__ */ React73.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ React73.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ React73.createElement(Popover2.Button, __spreadValues({
|
7778
7788
|
kind: "secondary-ghost",
|
7779
7789
|
key: secondaryAction.text,
|
7780
7790
|
dense: true
|
7781
|
-
}, omit15(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */
|
7791
|
+
}, omit15(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React73.createElement(Popover2.Button, __spreadValues({
|
7782
7792
|
kind: "ghost",
|
7783
7793
|
key: primaryAction.text,
|
7784
7794
|
dense: true
|
@@ -7786,7 +7796,7 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
|
|
7786
7796
|
}
|
7787
7797
|
return child;
|
7788
7798
|
};
|
7789
|
-
return /* @__PURE__ */
|
7799
|
+
return /* @__PURE__ */ React73.createElement(Popover2, {
|
7790
7800
|
type: "dialog",
|
7791
7801
|
isOpen: open,
|
7792
7802
|
placement,
|
@@ -7794,10 +7804,10 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
|
|
7794
7804
|
isKeyboardDismissDisabled: false,
|
7795
7805
|
autoFocus: true,
|
7796
7806
|
containFocus: true
|
7797
|
-
},
|
7807
|
+
}, React73.Children.map(children, wrapPromptWithBody));
|
7798
7808
|
};
|
7799
7809
|
PopoverDialog2.Trigger = Popover2.Trigger;
|
7800
|
-
var Prompt = ({ children }) => /* @__PURE__ */
|
7810
|
+
var Prompt = ({ children }) => /* @__PURE__ */ React73.createElement(PopoverDialog.Body, null, children);
|
7801
7811
|
Prompt.displayName = "PopoverDialog.Prompt";
|
7802
7812
|
PopoverDialog2.Prompt = Prompt;
|
7803
7813
|
|
@@ -7806,14 +7816,14 @@ import { createPortal } from "react-dom";
|
|
7806
7816
|
var Portal = ({ children, to }) => createPortal(children, to);
|
7807
7817
|
|
7808
7818
|
// src/components/ProgressBar/ProgressBar.tsx
|
7809
|
-
import
|
7819
|
+
import React75 from "react";
|
7810
7820
|
|
7811
7821
|
// src/common/ProgressBar/ProgressBar.tsx
|
7812
|
-
import
|
7822
|
+
import React74 from "react";
|
7813
7823
|
import clamp2 from "lodash/clamp";
|
7814
7824
|
var ProgressBar = (_a) => {
|
7815
7825
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
7816
|
-
return /* @__PURE__ */
|
7826
|
+
return /* @__PURE__ */ React74.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7817
7827
|
className: classNames(
|
7818
7828
|
tw("relative flex items-center w-full bg-grey-0 h-2 rounded-full overflow-hidden"),
|
7819
7829
|
className
|
@@ -7829,7 +7839,7 @@ var STATUS_COLORS = {
|
|
7829
7839
|
ProgressBar.Indicator = (_a) => {
|
7830
7840
|
var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
|
7831
7841
|
const completedPercentage = clamp2((value - min) / (max - min) * 100, 0, 100);
|
7832
|
-
return /* @__PURE__ */
|
7842
|
+
return /* @__PURE__ */ React74.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
7833
7843
|
className: classNames(
|
7834
7844
|
tw("h-2 rounded-full transition-all ease-in-out delay-150"),
|
7835
7845
|
STATUS_COLORS[status],
|
@@ -7845,11 +7855,11 @@ ProgressBar.Indicator = (_a) => {
|
|
7845
7855
|
};
|
7846
7856
|
ProgressBar.Labels = (_a) => {
|
7847
7857
|
var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
|
7848
|
-
return /* @__PURE__ */
|
7858
|
+
return /* @__PURE__ */ React74.createElement("div", {
|
7849
7859
|
className: classNames(tw("flex flex-row"), className)
|
7850
|
-
}, /* @__PURE__ */
|
7860
|
+
}, /* @__PURE__ */ React74.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
7851
7861
|
className: tw("grow text-grey-70 typography-caption")
|
7852
|
-
}), startLabel), /* @__PURE__ */
|
7862
|
+
}), startLabel), /* @__PURE__ */ React74.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
7853
7863
|
className: tw("grow text-grey-70 typography-caption text-right")
|
7854
7864
|
}), endLabel));
|
7855
7865
|
};
|
@@ -7867,7 +7877,7 @@ var ProgressBar2 = (props) => {
|
|
7867
7877
|
if (min > max) {
|
7868
7878
|
throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
|
7869
7879
|
}
|
7870
|
-
const progress = /* @__PURE__ */
|
7880
|
+
const progress = /* @__PURE__ */ React75.createElement(ProgressBar, null, /* @__PURE__ */ React75.createElement(ProgressBar.Indicator, {
|
7871
7881
|
status: value === max ? completedStatus : progresStatus,
|
7872
7882
|
min,
|
7873
7883
|
max,
|
@@ -7877,25 +7887,25 @@ var ProgressBar2 = (props) => {
|
|
7877
7887
|
if (props.dense) {
|
7878
7888
|
return progress;
|
7879
7889
|
}
|
7880
|
-
return /* @__PURE__ */
|
7890
|
+
return /* @__PURE__ */ React75.createElement("div", null, progress, /* @__PURE__ */ React75.createElement(ProgressBar.Labels, {
|
7881
7891
|
className: tw("py-2"),
|
7882
7892
|
startLabel: props.startLabel,
|
7883
7893
|
endLabel: props.endLabel
|
7884
7894
|
}));
|
7885
7895
|
};
|
7886
|
-
ProgressBar2.Skeleton = () => /* @__PURE__ */
|
7896
|
+
ProgressBar2.Skeleton = () => /* @__PURE__ */ React75.createElement(Skeleton, {
|
7887
7897
|
height: 4,
|
7888
7898
|
display: "block"
|
7889
7899
|
});
|
7890
7900
|
|
7891
7901
|
// src/components/RadioButton/RadioButton.tsx
|
7892
|
-
import
|
7893
|
-
var RadioButton2 =
|
7902
|
+
import React76 from "react";
|
7903
|
+
var RadioButton2 = React76.forwardRef(
|
7894
7904
|
(_a, ref) => {
|
7895
7905
|
var _b = _a, { name, id, readOnly = false, disabled = false, caption, children, "aria-label": ariaLabel } = _b, props = __objRest(_b, ["name", "id", "readOnly", "disabled", "caption", "children", "aria-label"]);
|
7896
7906
|
var _a2;
|
7897
7907
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
7898
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
7908
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React76.createElement(ControlLabel, {
|
7899
7909
|
htmlFor: id,
|
7900
7910
|
label: children,
|
7901
7911
|
"aria-label": ariaLabel,
|
@@ -7903,7 +7913,7 @@ var RadioButton2 = React75.forwardRef(
|
|
7903
7913
|
readOnly,
|
7904
7914
|
disabled,
|
7905
7915
|
style: { gap: "0 8px" }
|
7906
|
-
}, !readOnly && /* @__PURE__ */
|
7916
|
+
}, !readOnly && /* @__PURE__ */ React76.createElement(RadioButton, __spreadProps(__spreadValues({
|
7907
7917
|
id,
|
7908
7918
|
ref,
|
7909
7919
|
name
|
@@ -7913,22 +7923,22 @@ var RadioButton2 = React75.forwardRef(
|
|
7913
7923
|
}))) : null;
|
7914
7924
|
}
|
7915
7925
|
);
|
7916
|
-
var RadioButtonSkeleton = () => /* @__PURE__ */
|
7926
|
+
var RadioButtonSkeleton = () => /* @__PURE__ */ React76.createElement("div", {
|
7917
7927
|
className: tw("flex gap-3")
|
7918
|
-
}, /* @__PURE__ */
|
7928
|
+
}, /* @__PURE__ */ React76.createElement(Skeleton, {
|
7919
7929
|
height: 20,
|
7920
7930
|
width: 20
|
7921
|
-
}), /* @__PURE__ */
|
7931
|
+
}), /* @__PURE__ */ React76.createElement(Skeleton, {
|
7922
7932
|
height: 20,
|
7923
7933
|
width: 150
|
7924
7934
|
}));
|
7925
7935
|
RadioButton2.Skeleton = RadioButtonSkeleton;
|
7926
7936
|
|
7927
7937
|
// src/components/RadioButtonGroup/RadioButtonGroup.tsx
|
7928
|
-
import
|
7938
|
+
import React77 from "react";
|
7929
7939
|
import uniqueId8 from "lodash/uniqueId";
|
7930
7940
|
var isRadioButton = (c) => {
|
7931
|
-
return
|
7941
|
+
return React77.isValidElement(c) && c.type === RadioButton2;
|
7932
7942
|
};
|
7933
7943
|
var RadioButtonGroup = (_a) => {
|
7934
7944
|
var _b = _a, {
|
@@ -7951,7 +7961,7 @@ var RadioButtonGroup = (_a) => {
|
|
7951
7961
|
"children"
|
7952
7962
|
]);
|
7953
7963
|
var _a2;
|
7954
|
-
const [value, setValue] =
|
7964
|
+
const [value, setValue] = React77.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
|
7955
7965
|
const errorMessageId = uniqueId8();
|
7956
7966
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
7957
7967
|
const labelControlProps = getLabelControlProps(props);
|
@@ -7962,14 +7972,14 @@ var RadioButtonGroup = (_a) => {
|
|
7962
7972
|
setValue(e.target.value);
|
7963
7973
|
onChange == null ? void 0 : onChange(e.target.value);
|
7964
7974
|
};
|
7965
|
-
const content =
|
7975
|
+
const content = React77.Children.map(children, (c) => {
|
7966
7976
|
var _a3, _b2, _c;
|
7967
7977
|
if (!isRadioButton(c)) {
|
7968
7978
|
return null;
|
7969
7979
|
}
|
7970
7980
|
const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
|
7971
7981
|
const checked = value === void 0 ? void 0 : c.props.value === value;
|
7972
|
-
return
|
7982
|
+
return React77.cloneElement(c, {
|
7973
7983
|
name,
|
7974
7984
|
defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
|
7975
7985
|
checked: (_b2 = c.props.checked) != null ? _b2 : checked,
|
@@ -7978,11 +7988,11 @@ var RadioButtonGroup = (_a) => {
|
|
7978
7988
|
readOnly
|
7979
7989
|
});
|
7980
7990
|
});
|
7981
|
-
return /* @__PURE__ */
|
7991
|
+
return /* @__PURE__ */ React77.createElement(LabelControl, __spreadValues(__spreadValues({
|
7982
7992
|
fieldset: true
|
7983
|
-
}, labelControlProps), errorProps), cols && /* @__PURE__ */
|
7993
|
+
}, labelControlProps), errorProps), cols && /* @__PURE__ */ React77.createElement(InputGroup, {
|
7984
7994
|
cols
|
7985
|
-
}, content), !cols && /* @__PURE__ */
|
7995
|
+
}, content), !cols && /* @__PURE__ */ React77.createElement(Flexbox, {
|
7986
7996
|
direction,
|
7987
7997
|
alignItems: "flex-start",
|
7988
7998
|
colGap: "8",
|
@@ -7991,80 +8001,80 @@ var RadioButtonGroup = (_a) => {
|
|
7991
8001
|
}, content));
|
7992
8002
|
};
|
7993
8003
|
var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
|
7994
|
-
return /* @__PURE__ */
|
8004
|
+
return /* @__PURE__ */ React77.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React77.createElement("div", {
|
7995
8005
|
className: tw("flex flex-wrap", {
|
7996
8006
|
"flex-row gap-8": direction === "row",
|
7997
8007
|
"flex-col gap-2": direction === "column"
|
7998
8008
|
})
|
7999
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
8009
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React77.createElement(RadioButton2.Skeleton, {
|
8000
8010
|
key
|
8001
8011
|
}))));
|
8002
8012
|
};
|
8003
8013
|
RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
|
8004
8014
|
|
8005
8015
|
// src/components/Section/Section.tsx
|
8006
|
-
import
|
8016
|
+
import React79 from "react";
|
8007
8017
|
import castArray4 from "lodash/castArray";
|
8008
8018
|
|
8009
8019
|
// src/common/Section/Section.tsx
|
8010
|
-
import
|
8020
|
+
import React78 from "react";
|
8011
8021
|
var Section2 = (_a) => {
|
8012
8022
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8013
|
-
return /* @__PURE__ */
|
8023
|
+
return /* @__PURE__ */ React78.createElement(Box, __spreadValues({
|
8014
8024
|
borderColor: "grey-5",
|
8015
8025
|
borderWidth: "1px"
|
8016
8026
|
}, rest), children);
|
8017
8027
|
};
|
8018
8028
|
Section2.Header = (_a) => {
|
8019
8029
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8020
|
-
return /* @__PURE__ */
|
8030
|
+
return /* @__PURE__ */ React78.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8021
8031
|
className: classNames(tw("px-6 py-5 flex gap-5 justify-between items-center"), className)
|
8022
8032
|
}), children);
|
8023
8033
|
};
|
8024
8034
|
Section2.TitleContainer = (_a) => {
|
8025
8035
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8026
|
-
return /* @__PURE__ */
|
8036
|
+
return /* @__PURE__ */ React78.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8027
8037
|
className: classNames(tw("flex flex-col grow gap-2"), className)
|
8028
8038
|
}), children);
|
8029
8039
|
};
|
8030
8040
|
Section2.Title = (_a) => {
|
8031
8041
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8032
|
-
return /* @__PURE__ */
|
8042
|
+
return /* @__PURE__ */ React78.createElement(Typography2.Subheading, __spreadProps(__spreadValues({}, rest), {
|
8033
8043
|
color: "black"
|
8034
8044
|
}), children);
|
8035
8045
|
};
|
8036
8046
|
Section2.Subtitle = (_a) => {
|
8037
8047
|
var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
|
8038
|
-
return /* @__PURE__ */
|
8048
|
+
return /* @__PURE__ */ React78.createElement(Typography2.SmallText, __spreadProps(__spreadValues({}, rest), {
|
8039
8049
|
color: "grey-70"
|
8040
8050
|
}), children);
|
8041
8051
|
};
|
8042
8052
|
Section2.Actions = (_a) => {
|
8043
8053
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8044
|
-
return /* @__PURE__ */
|
8054
|
+
return /* @__PURE__ */ React78.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8045
8055
|
className: classNames(tw("flex gap-4 justify-end"), className)
|
8046
8056
|
}), children);
|
8047
8057
|
};
|
8048
8058
|
Section2.Body = (_a) => {
|
8049
8059
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
8050
|
-
return /* @__PURE__ */
|
8060
|
+
return /* @__PURE__ */ React78.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8051
8061
|
className: classNames(tw("p-6"), className)
|
8052
|
-
}), /* @__PURE__ */
|
8062
|
+
}), /* @__PURE__ */ React78.createElement(Typography, {
|
8053
8063
|
htmlTag: "div",
|
8054
8064
|
color: "grey-70"
|
8055
8065
|
}, children));
|
8056
8066
|
};
|
8057
8067
|
|
8058
8068
|
// src/components/Section/Section.tsx
|
8059
|
-
var Section3 = ({ title, subtitle, actions, children }) => /* @__PURE__ */
|
8069
|
+
var Section3 = ({ title, subtitle, actions, children }) => /* @__PURE__ */ React79.createElement(Section2, null, title && /* @__PURE__ */ React79.createElement(React79.Fragment, null, /* @__PURE__ */ React79.createElement(Section2.Header, null, /* @__PURE__ */ React79.createElement(Section2.TitleContainer, null, /* @__PURE__ */ React79.createElement(Section2.Title, null, title), subtitle && /* @__PURE__ */ React79.createElement(Section2.Subtitle, null, subtitle)), /* @__PURE__ */ React79.createElement(Section2.Actions, null, actions && castArray4(actions).filter(Boolean).map((_a) => {
|
8060
8070
|
var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
|
8061
|
-
return /* @__PURE__ */
|
8071
|
+
return /* @__PURE__ */ React79.createElement(SecondaryButton, __spreadValues({
|
8062
8072
|
key: text
|
8063
8073
|
}, action), text);
|
8064
|
-
}))), /* @__PURE__ */
|
8074
|
+
}))), /* @__PURE__ */ React79.createElement(Divider2, null)), /* @__PURE__ */ React79.createElement(Section2.Body, null, children));
|
8065
8075
|
|
8066
8076
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
8067
|
-
import
|
8077
|
+
import React80 from "react";
|
8068
8078
|
var SegmentedControl = (_a) => {
|
8069
8079
|
var _b = _a, {
|
8070
8080
|
children,
|
@@ -8081,7 +8091,7 @@ var SegmentedControl = (_a) => {
|
|
8081
8091
|
"selected",
|
8082
8092
|
"className"
|
8083
8093
|
]);
|
8084
|
-
return /* @__PURE__ */
|
8094
|
+
return /* @__PURE__ */ React80.createElement("button", __spreadProps(__spreadValues({
|
8085
8095
|
type: "button"
|
8086
8096
|
}, rest), {
|
8087
8097
|
className: classNames(
|
@@ -8112,11 +8122,11 @@ var SegmentedControlGroup = (_a) => {
|
|
8112
8122
|
"border border-grey-20 text-grey-50": variant === "outlined",
|
8113
8123
|
"bg-grey-0": variant === "raised"
|
8114
8124
|
});
|
8115
|
-
return /* @__PURE__ */
|
8125
|
+
return /* @__PURE__ */ React80.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8116
8126
|
className: classNames(classes, className)
|
8117
|
-
}),
|
8127
|
+
}), React80.Children.map(
|
8118
8128
|
children,
|
8119
|
-
(child) =>
|
8129
|
+
(child) => React80.cloneElement(child, {
|
8120
8130
|
dense,
|
8121
8131
|
variant,
|
8122
8132
|
onClick: () => onChange(child.props.value),
|
@@ -8153,17 +8163,131 @@ var getCommonClassNames = (dense, selected) => tw(
|
|
8153
8163
|
}
|
8154
8164
|
);
|
8155
8165
|
|
8156
|
-
// src/components/
|
8166
|
+
// src/components/Stepper/Stepper.tsx
|
8167
|
+
import React82 from "react";
|
8168
|
+
|
8169
|
+
// src/common/Stepper/Stepper.tsx
|
8157
8170
|
import React81 from "react";
|
8171
|
+
var import_tick5 = __toESM(require_tick());
|
8172
|
+
var Stepper = (_a) => {
|
8173
|
+
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8174
|
+
return /* @__PURE__ */ React81.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8175
|
+
className: classNames(className)
|
8176
|
+
}));
|
8177
|
+
};
|
8178
|
+
var ConnectorContainer = (_a) => {
|
8179
|
+
var _b = _a, {
|
8180
|
+
className,
|
8181
|
+
completed,
|
8182
|
+
dense
|
8183
|
+
} = _b, rest = __objRest(_b, [
|
8184
|
+
"className",
|
8185
|
+
"completed",
|
8186
|
+
"dense"
|
8187
|
+
]);
|
8188
|
+
return /* @__PURE__ */ React81.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8189
|
+
className: classNames(
|
8190
|
+
tw("absolute w-full -left-1/2", {
|
8191
|
+
"top-[3px] px-[14px]": Boolean(dense),
|
8192
|
+
"top-[14px] px-[20px]": !dense
|
8193
|
+
}),
|
8194
|
+
className
|
8195
|
+
)
|
8196
|
+
}));
|
8197
|
+
};
|
8198
|
+
var Connector = (_a) => {
|
8199
|
+
var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
|
8200
|
+
return /* @__PURE__ */ React81.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8201
|
+
className: classNames(
|
8202
|
+
tw("w-full", {
|
8203
|
+
"bg-grey-20": !completed,
|
8204
|
+
"bg-success-70": Boolean(completed),
|
8205
|
+
"h-[2px]": !dense,
|
8206
|
+
"h-[3px]": Boolean(dense)
|
8207
|
+
}),
|
8208
|
+
className
|
8209
|
+
)
|
8210
|
+
}));
|
8211
|
+
};
|
8212
|
+
var Step = (_a) => {
|
8213
|
+
var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
|
8214
|
+
return /* @__PURE__ */ React81.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8215
|
+
className: classNames(
|
8216
|
+
tw("flex flex-col items-center text-grey-90 relative text-center", {
|
8217
|
+
"text-grey-20": state === "inactive"
|
8218
|
+
}),
|
8219
|
+
className
|
8220
|
+
)
|
8221
|
+
}));
|
8222
|
+
};
|
8223
|
+
var getClassNames = (state) => tw("h-[32px] w-[32px] border-2", {
|
8224
|
+
"border-grey-90 bg-white": state === "active",
|
8225
|
+
"border-grey-20 bg-white": state === "inactive",
|
8226
|
+
"text-white bg-success-70 border-success-70": state === "completed"
|
8227
|
+
});
|
8228
|
+
var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
|
8229
|
+
"bg-grey-90": state === "active",
|
8230
|
+
"bg-grey-20": state === "inactive",
|
8231
|
+
"text-success-70": state === "completed"
|
8232
|
+
});
|
8233
|
+
var Indicator = (_a) => {
|
8234
|
+
var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
|
8235
|
+
return /* @__PURE__ */ React81.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8236
|
+
className: classNames(
|
8237
|
+
tw("rounded-full flex justify-center items-center mx-2 mb-3"),
|
8238
|
+
dense ? getDenseClassNames(state) : getClassNames(state),
|
8239
|
+
className
|
8240
|
+
)
|
8241
|
+
}), state === "completed" ? /* @__PURE__ */ React81.createElement(InlineIcon, {
|
8242
|
+
icon: import_tick5.default
|
8243
|
+
}) : dense ? null : children);
|
8244
|
+
};
|
8245
|
+
Step.Indicator = Indicator;
|
8246
|
+
Stepper.Step = Step;
|
8247
|
+
ConnectorContainer.Connector = Connector;
|
8248
|
+
Stepper.ConnectorContainer = ConnectorContainer;
|
8249
|
+
|
8250
|
+
// src/components/Stepper/Stepper.tsx
|
8251
|
+
var Stepper2 = ({ children, activeIndex, dense }) => {
|
8252
|
+
const steps = React82.Children.count(children);
|
8253
|
+
return /* @__PURE__ */ React82.createElement(Stepper, {
|
8254
|
+
role: "list"
|
8255
|
+
}, /* @__PURE__ */ React82.createElement(Template, {
|
8256
|
+
columns: steps
|
8257
|
+
}, React82.Children.map(children, (child, index) => {
|
8258
|
+
if (!isComponentType(child, Step2)) {
|
8259
|
+
return new Error("<Stepper> can only have <Stepper.Step> components as children");
|
8260
|
+
} else {
|
8261
|
+
const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
|
8262
|
+
return /* @__PURE__ */ React82.createElement(Stepper.Step, {
|
8263
|
+
state,
|
8264
|
+
"aria-current": state === "active" ? "step" : false,
|
8265
|
+
role: "listitem"
|
8266
|
+
}, index > 0 && index <= steps && /* @__PURE__ */ React82.createElement(Stepper.ConnectorContainer, {
|
8267
|
+
dense
|
8268
|
+
}, /* @__PURE__ */ React82.createElement(Stepper.ConnectorContainer.Connector, {
|
8269
|
+
completed: state === "completed" || state === "active"
|
8270
|
+
})), /* @__PURE__ */ React82.createElement(Stepper.Step.Indicator, {
|
8271
|
+
state,
|
8272
|
+
dense
|
8273
|
+
}, index + 1), child.props.children);
|
8274
|
+
}
|
8275
|
+
})));
|
8276
|
+
};
|
8277
|
+
var Step2 = () => null;
|
8278
|
+
Stepper2.Step = Step2;
|
8279
|
+
|
8280
|
+
// src/components/Switch/Switch.tsx
|
8281
|
+
import React84 from "react";
|
8158
8282
|
|
8159
8283
|
// src/common/Switch/Switch.tsx
|
8160
|
-
import
|
8161
|
-
var Switch =
|
8284
|
+
import React83 from "react";
|
8285
|
+
var Switch = React83.forwardRef(
|
8162
8286
|
(_a, ref) => {
|
8163
8287
|
var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
|
8164
|
-
return /* @__PURE__ */
|
8288
|
+
return /* @__PURE__ */ React83.createElement("span", {
|
8165
8289
|
className: tw("relative inline-flex justify-center items-center self-center group")
|
8166
|
-
}, /* @__PURE__ */
|
8290
|
+
}, /* @__PURE__ */ React83.createElement("input", __spreadProps(__spreadValues({
|
8167
8291
|
id,
|
8168
8292
|
ref,
|
8169
8293
|
type: "checkbox",
|
@@ -8172,7 +8296,7 @@ var Switch = React80.forwardRef(
|
|
8172
8296
|
className: tw("opacity-0 peer/switch w-0 h-0"),
|
8173
8297
|
readOnly,
|
8174
8298
|
disabled
|
8175
|
-
})), /* @__PURE__ */
|
8299
|
+
})), /* @__PURE__ */ React83.createElement("span", {
|
8176
8300
|
className: tw(
|
8177
8301
|
"rounded-full inline-block w-[34px] h-[20px] transition duration-300",
|
8178
8302
|
"peer-focus/switch:border border-info-70 bg-grey-20",
|
@@ -8181,7 +8305,7 @@ var Switch = React80.forwardRef(
|
|
8181
8305
|
"bg-grey-5 peer-checked/switch:opacity-40": disabled
|
8182
8306
|
}
|
8183
8307
|
)
|
8184
|
-
}), /* @__PURE__ */
|
8308
|
+
}), /* @__PURE__ */ React83.createElement("span", {
|
8185
8309
|
className: tw(
|
8186
8310
|
"rounded-full absolute inline-block transition duration-300 h-4 w-4 transform peer-checked/switch:translate-x-5",
|
8187
8311
|
"bg-white peer-disabled/switch:bg-grey-0 left-2 peer-checked/switch:left-1",
|
@@ -8194,12 +8318,12 @@ var Switch = React80.forwardRef(
|
|
8194
8318
|
);
|
8195
8319
|
|
8196
8320
|
// src/components/Switch/Switch.tsx
|
8197
|
-
var Switch2 =
|
8321
|
+
var Switch2 = React84.forwardRef(
|
8198
8322
|
(_a, ref) => {
|
8199
8323
|
var _b = _a, { id, name, caption, readOnly = false, disabled = false, children, "aria-label": ariaLabel } = _b, props = __objRest(_b, ["id", "name", "caption", "readOnly", "disabled", "children", "aria-label"]);
|
8200
8324
|
var _a2;
|
8201
8325
|
const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
|
8202
|
-
return !readOnly || isChecked ? /* @__PURE__ */
|
8326
|
+
return !readOnly || isChecked ? /* @__PURE__ */ React84.createElement(ControlLabel, {
|
8203
8327
|
htmlFor: id,
|
8204
8328
|
label: children,
|
8205
8329
|
"aria-label": ariaLabel,
|
@@ -8207,7 +8331,7 @@ var Switch2 = React81.forwardRef(
|
|
8207
8331
|
readOnly,
|
8208
8332
|
disabled,
|
8209
8333
|
style: { gap: "0 8px" }
|
8210
|
-
}, !readOnly && /* @__PURE__ */
|
8334
|
+
}, !readOnly && /* @__PURE__ */ React84.createElement(Switch, __spreadProps(__spreadValues({
|
8211
8335
|
id,
|
8212
8336
|
ref,
|
8213
8337
|
name
|
@@ -8217,19 +8341,19 @@ var Switch2 = React81.forwardRef(
|
|
8217
8341
|
}))) : null;
|
8218
8342
|
}
|
8219
8343
|
);
|
8220
|
-
var SwitchSkeleton = () => /* @__PURE__ */
|
8344
|
+
var SwitchSkeleton = () => /* @__PURE__ */ React84.createElement("div", {
|
8221
8345
|
className: tw("flex gap-3")
|
8222
|
-
}, /* @__PURE__ */
|
8346
|
+
}, /* @__PURE__ */ React84.createElement(Skeleton, {
|
8223
8347
|
height: 20,
|
8224
8348
|
width: 35
|
8225
|
-
}), /* @__PURE__ */
|
8349
|
+
}), /* @__PURE__ */ React84.createElement(Skeleton, {
|
8226
8350
|
height: 20,
|
8227
8351
|
width: 150
|
8228
8352
|
}));
|
8229
8353
|
Switch2.Skeleton = SwitchSkeleton;
|
8230
8354
|
|
8231
8355
|
// src/components/SwitchGroup/SwitchGroup.tsx
|
8232
|
-
import
|
8356
|
+
import React85, { useState as useState11 } from "react";
|
8233
8357
|
import uniqueId9 from "lodash/uniqueId";
|
8234
8358
|
var SwitchGroup = (_a) => {
|
8235
8359
|
var _b = _a, {
|
@@ -8261,11 +8385,11 @@ var SwitchGroup = (_a) => {
|
|
8261
8385
|
setSelectedItems(updated);
|
8262
8386
|
onChange == null ? void 0 : onChange(updated);
|
8263
8387
|
};
|
8264
|
-
return /* @__PURE__ */
|
8388
|
+
return /* @__PURE__ */ React85.createElement(LabelControl, __spreadValues(__spreadValues({
|
8265
8389
|
fieldset: true
|
8266
|
-
}, labelControlProps), errorProps), /* @__PURE__ */
|
8390
|
+
}, labelControlProps), errorProps), /* @__PURE__ */ React85.createElement(InputGroup, {
|
8267
8391
|
cols
|
8268
|
-
},
|
8392
|
+
}, React85.Children.map(children, (c) => {
|
8269
8393
|
var _a3, _b2, _c, _d;
|
8270
8394
|
if (!isComponentType(c, Switch2)) {
|
8271
8395
|
return null;
|
@@ -8273,7 +8397,7 @@ var SwitchGroup = (_a) => {
|
|
8273
8397
|
const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
|
8274
8398
|
const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
|
8275
8399
|
const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
|
8276
|
-
return
|
8400
|
+
return React85.cloneElement(c, {
|
8277
8401
|
defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
|
8278
8402
|
checked: (_c = c.props.checked) != null ? _c : checked,
|
8279
8403
|
onChange: (_d = c.props.onChange) != null ? _d : handleChange,
|
@@ -8283,19 +8407,19 @@ var SwitchGroup = (_a) => {
|
|
8283
8407
|
})));
|
8284
8408
|
};
|
8285
8409
|
var SwitchGroupSkeleton = ({ options = 2 }) => {
|
8286
|
-
return /* @__PURE__ */
|
8410
|
+
return /* @__PURE__ */ React85.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React85.createElement("div", {
|
8287
8411
|
className: tw("flex flex-wrap flex-col gap-2")
|
8288
|
-
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */
|
8412
|
+
}, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React85.createElement(Switch2.Skeleton, {
|
8289
8413
|
key
|
8290
8414
|
}))));
|
8291
8415
|
};
|
8292
8416
|
SwitchGroup.Skeleton = SwitchGroupSkeleton;
|
8293
8417
|
|
8294
8418
|
// src/components/TagLabel/TagLabel.tsx
|
8295
|
-
import
|
8419
|
+
import React86 from "react";
|
8296
8420
|
var TagLabel = (_a) => {
|
8297
8421
|
var _b = _a, { title, dense = false } = _b, rest = __objRest(_b, ["title", "dense"]);
|
8298
|
-
return /* @__PURE__ */
|
8422
|
+
return /* @__PURE__ */ React86.createElement("span", __spreadProps(__spreadValues({}, rest), {
|
8299
8423
|
className: tw("rounded-full text-white bg-primary-70", {
|
8300
8424
|
"py-2 px-4 typography-caption": !dense,
|
8301
8425
|
"py-2 px-3 typography-caption-small": dense
|
@@ -8304,14 +8428,14 @@ var TagLabel = (_a) => {
|
|
8304
8428
|
};
|
8305
8429
|
|
8306
8430
|
// src/components/Textarea/Textarea.tsx
|
8307
|
-
import
|
8431
|
+
import React87, { useRef as useRef11, useState as useState12 } from "react";
|
8308
8432
|
import omit16 from "lodash/omit";
|
8309
8433
|
import toString2 from "lodash/toString";
|
8310
8434
|
import uniqueId10 from "lodash/uniqueId";
|
8311
|
-
var TextareaBase =
|
8435
|
+
var TextareaBase = React87.forwardRef(
|
8312
8436
|
(_a, ref) => {
|
8313
8437
|
var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
|
8314
|
-
return /* @__PURE__ */
|
8438
|
+
return /* @__PURE__ */ React87.createElement("textarea", __spreadProps(__spreadValues({
|
8315
8439
|
ref
|
8316
8440
|
}, props), {
|
8317
8441
|
readOnly,
|
@@ -8319,10 +8443,10 @@ var TextareaBase = React84.forwardRef(
|
|
8319
8443
|
}));
|
8320
8444
|
}
|
8321
8445
|
);
|
8322
|
-
TextareaBase.Skeleton = () => /* @__PURE__ */
|
8446
|
+
TextareaBase.Skeleton = () => /* @__PURE__ */ React87.createElement(Skeleton, {
|
8323
8447
|
height: 58
|
8324
8448
|
});
|
8325
|
-
var Textarea =
|
8449
|
+
var Textarea = React87.forwardRef((props, ref) => {
|
8326
8450
|
var _a, _b, _c;
|
8327
8451
|
const [value, setValue] = useState12((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
|
8328
8452
|
const id = useRef11((_c = props.id) != null ? _c : `textarea-${uniqueId10()}`);
|
@@ -8330,12 +8454,12 @@ var Textarea = React84.forwardRef((props, ref) => {
|
|
8330
8454
|
const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
|
8331
8455
|
const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
|
8332
8456
|
const baseProps = omit16(props, Object.keys(labelControlProps));
|
8333
|
-
return /* @__PURE__ */
|
8457
|
+
return /* @__PURE__ */ React87.createElement(LabelControl, __spreadValues({
|
8334
8458
|
id: `${id.current}-label`,
|
8335
8459
|
htmlFor: id.current,
|
8336
8460
|
messageId: errorMessageId,
|
8337
8461
|
length: value !== void 0 ? toString2(value).length : void 0
|
8338
|
-
}, labelControlProps), /* @__PURE__ */
|
8462
|
+
}, labelControlProps), /* @__PURE__ */ React87.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
|
8339
8463
|
ref
|
8340
8464
|
}, baseProps), errorProps), {
|
8341
8465
|
id: id.current,
|
@@ -8351,47 +8475,47 @@ var Textarea = React84.forwardRef((props, ref) => {
|
|
8351
8475
|
valid: props.valid
|
8352
8476
|
})));
|
8353
8477
|
});
|
8354
|
-
var TextAreaSkeleton = () => /* @__PURE__ */
|
8478
|
+
var TextAreaSkeleton = () => /* @__PURE__ */ React87.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React87.createElement(TextareaBase.Skeleton, null));
|
8355
8479
|
Textarea.Skeleton = TextAreaSkeleton;
|
8356
8480
|
|
8357
8481
|
// src/components/Timeline/Timeline.tsx
|
8358
|
-
import
|
8482
|
+
import React89 from "react";
|
8359
8483
|
|
8360
8484
|
// src/common/Timeline/Timeline.tsx
|
8361
|
-
import
|
8485
|
+
import React88 from "react";
|
8362
8486
|
var Timeline = (_a) => {
|
8363
8487
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8364
|
-
return /* @__PURE__ */
|
8488
|
+
return /* @__PURE__ */ React88.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8365
8489
|
className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
|
8366
8490
|
}));
|
8367
8491
|
};
|
8368
8492
|
var Content = (_a) => {
|
8369
8493
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8370
|
-
return /* @__PURE__ */
|
8494
|
+
return /* @__PURE__ */ React88.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8371
8495
|
className: classNames(tw("pb-6"), className)
|
8372
8496
|
}));
|
8373
8497
|
};
|
8374
8498
|
var Separator2 = (_a) => {
|
8375
8499
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8376
|
-
return /* @__PURE__ */
|
8500
|
+
return /* @__PURE__ */ React88.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8377
8501
|
className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
|
8378
8502
|
}));
|
8379
8503
|
};
|
8380
8504
|
var LineContainer = (_a) => {
|
8381
8505
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8382
|
-
return /* @__PURE__ */
|
8506
|
+
return /* @__PURE__ */ React88.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8383
8507
|
className: classNames(tw("flex justify-center py-1"), className)
|
8384
8508
|
}));
|
8385
8509
|
};
|
8386
8510
|
var Line = (_a) => {
|
8387
8511
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8388
|
-
return /* @__PURE__ */
|
8512
|
+
return /* @__PURE__ */ React88.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8389
8513
|
className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
|
8390
8514
|
}));
|
8391
8515
|
};
|
8392
8516
|
var Dot = (_a) => {
|
8393
8517
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
8394
|
-
return /* @__PURE__ */
|
8518
|
+
return /* @__PURE__ */ React88.createElement("div", __spreadProps(__spreadValues({}, rest), {
|
8395
8519
|
className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
|
8396
8520
|
}));
|
8397
8521
|
};
|
@@ -8406,60 +8530,60 @@ var import_error4 = __toESM(require_error());
|
|
8406
8530
|
var import_time = __toESM(require_time());
|
8407
8531
|
var import_warningSign4 = __toESM(require_warningSign());
|
8408
8532
|
var TimelineItem = () => null;
|
8409
|
-
var Timeline2 = ({ children }) => /* @__PURE__ */
|
8533
|
+
var Timeline2 = ({ children }) => /* @__PURE__ */ React89.createElement("div", null, React89.Children.map(children, (item) => {
|
8410
8534
|
if (!isComponentType(item, TimelineItem)) {
|
8411
8535
|
throw new Error("<Timeline> can only have <Timeline.Item> components as children");
|
8412
8536
|
} else {
|
8413
8537
|
const { props, key } = item;
|
8414
|
-
return /* @__PURE__ */
|
8538
|
+
return /* @__PURE__ */ React89.createElement(Timeline, {
|
8415
8539
|
key: key != null ? key : props.title
|
8416
|
-
}, /* @__PURE__ */
|
8540
|
+
}, /* @__PURE__ */ React89.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React89.createElement(Icon, {
|
8417
8541
|
icon: import_error4.default,
|
8418
8542
|
color: "error-30"
|
8419
|
-
}) : props.variant === "warning" ? /* @__PURE__ */
|
8543
|
+
}) : props.variant === "warning" ? /* @__PURE__ */ React89.createElement(Icon, {
|
8420
8544
|
icon: import_warningSign4.default,
|
8421
8545
|
color: "warning-30"
|
8422
|
-
}) : props.variant === "info" ? /* @__PURE__ */
|
8546
|
+
}) : props.variant === "info" ? /* @__PURE__ */ React89.createElement(Icon, {
|
8423
8547
|
icon: import_time.default,
|
8424
8548
|
color: "info-30"
|
8425
|
-
}) : /* @__PURE__ */
|
8549
|
+
}) : /* @__PURE__ */ React89.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React89.createElement(Typography2.Caption, {
|
8426
8550
|
color: "grey-50"
|
8427
|
-
}, props.title), /* @__PURE__ */
|
8551
|
+
}, props.title), /* @__PURE__ */ React89.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React89.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React89.createElement(Timeline.Content, null, /* @__PURE__ */ React89.createElement(Typography2, null, props.children)));
|
8428
8552
|
}
|
8429
8553
|
}));
|
8430
|
-
var TimelineItemSkeleton = () => /* @__PURE__ */
|
8554
|
+
var TimelineItemSkeleton = () => /* @__PURE__ */ React89.createElement(Timeline, null, /* @__PURE__ */ React89.createElement(Timeline.Separator, null, /* @__PURE__ */ React89.createElement(Skeleton, {
|
8431
8555
|
width: 6,
|
8432
8556
|
height: 6,
|
8433
8557
|
rounded: true
|
8434
|
-
})), /* @__PURE__ */
|
8558
|
+
})), /* @__PURE__ */ React89.createElement(Skeleton, {
|
8435
8559
|
height: 12,
|
8436
8560
|
width: 120
|
8437
|
-
}), /* @__PURE__ */
|
8561
|
+
}), /* @__PURE__ */ React89.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React89.createElement(Skeleton, {
|
8438
8562
|
width: 2
|
8439
|
-
})), /* @__PURE__ */
|
8563
|
+
})), /* @__PURE__ */ React89.createElement(Timeline.Content, null, /* @__PURE__ */ React89.createElement(Box, {
|
8440
8564
|
display: "flex",
|
8441
8565
|
flexDirection: "column",
|
8442
8566
|
gap: "3"
|
8443
|
-
}, /* @__PURE__ */
|
8567
|
+
}, /* @__PURE__ */ React89.createElement(Skeleton, {
|
8444
8568
|
height: 32,
|
8445
8569
|
width: "100%"
|
8446
|
-
}), /* @__PURE__ */
|
8570
|
+
}), /* @__PURE__ */ React89.createElement(Skeleton, {
|
8447
8571
|
height: 32,
|
8448
8572
|
width: "73%"
|
8449
|
-
}), /* @__PURE__ */
|
8573
|
+
}), /* @__PURE__ */ React89.createElement(Skeleton, {
|
8450
8574
|
height: 32,
|
8451
8575
|
width: "80%"
|
8452
8576
|
}))));
|
8453
|
-
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */
|
8577
|
+
var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React89.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React89.createElement(TimelineItemSkeleton, {
|
8454
8578
|
key
|
8455
8579
|
})));
|
8456
8580
|
Timeline2.Item = TimelineItem;
|
8457
8581
|
Timeline2.Skeleton = TimelineSkeleton;
|
8458
8582
|
|
8459
8583
|
// src/utils/table/useTableSelect.ts
|
8460
|
-
import
|
8584
|
+
import React90 from "react";
|
8461
8585
|
var useTableSelect = (data, { key }) => {
|
8462
|
-
const [selected, setSelected] =
|
8586
|
+
const [selected, setSelected] = React90.useState([]);
|
8463
8587
|
const allSelected = selected.length === data.length;
|
8464
8588
|
const isSelected = (dot) => selected.includes(dot[key]);
|
8465
8589
|
const selectAll = () => setSelected(data.map((dot) => dot[key]));
|
@@ -8657,6 +8781,7 @@ export {
|
|
8657
8781
|
ChoiceChip,
|
8658
8782
|
Combobox,
|
8659
8783
|
ComboboxBase,
|
8784
|
+
Container2 as Container,
|
8660
8785
|
Context,
|
8661
8786
|
ControlLabel,
|
8662
8787
|
DataList2 as DataList,
|
@@ -8723,6 +8848,7 @@ export {
|
|
8723
8848
|
SelectItem,
|
8724
8849
|
Skeleton,
|
8725
8850
|
StatusChip,
|
8851
|
+
Stepper2 as Stepper,
|
8726
8852
|
Switch2 as Switch,
|
8727
8853
|
SwitchGroup,
|
8728
8854
|
TabContainer,
|