@aivenio/aquarium 1.14.0 → 1.15.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.
Files changed (34) hide show
  1. package/dist/_variables.scss +1 -1
  2. package/dist/_variables_timescale.scss +1 -1
  3. package/dist/atoms.cjs +162 -94
  4. package/dist/atoms.mjs +161 -94
  5. package/dist/src/atoms/Navigation/Navigation.d.ts +20 -0
  6. package/dist/src/atoms/Navigation/Navigation.js +49 -0
  7. package/dist/src/atoms/PageHeader/PageHeader.d.ts +13 -0
  8. package/dist/src/atoms/PageHeader/PageHeader.js +43 -0
  9. package/dist/src/atoms/index.d.ts +1 -0
  10. package/dist/src/atoms/index.js +2 -1
  11. package/dist/src/molecules/Button/Button.d.ts +1 -1
  12. package/dist/src/molecules/Button/Button.js +4 -4
  13. package/dist/src/molecules/DataList/DataList.d.ts +3 -3
  14. package/dist/src/molecules/DataList/DataList.js +19 -6
  15. package/dist/src/molecules/DataTable/DataTable.d.ts +3 -3
  16. package/dist/src/molecules/DataTable/DataTable.js +18 -6
  17. package/dist/src/molecules/DropdownMenu/DropdownMenu.d.ts +11 -5
  18. package/dist/src/molecules/DropdownMenu/DropdownMenu.js +2 -1
  19. package/dist/src/molecules/Navigation/Navigation.d.ts +19 -0
  20. package/dist/src/molecules/Navigation/Navigation.js +27 -0
  21. package/dist/src/molecules/PageHeader/PageHeader.d.ts +2 -0
  22. package/dist/src/molecules/PageHeader/PageHeader.js +10 -9
  23. package/dist/src/molecules/Stepper/Stepper.js +2 -1
  24. package/dist/src/molecules/index.d.ts +1 -0
  25. package/dist/src/molecules/index.js +2 -1
  26. package/dist/src/utils/table/types.d.ts +16 -1
  27. package/dist/src/utils/table/types.js +1 -1
  28. package/dist/styles.css +24 -11
  29. package/dist/styles_timescaledb.css +24 -11
  30. package/dist/system.cjs +1570 -1395
  31. package/dist/system.mjs +1571 -1397
  32. package/dist/tsconfig.module.tsbuildinfo +1 -1
  33. package/dist/types/tailwindGenerated.d.ts +1 -1
  34. package/package.json +2 -2
package/dist/system.mjs CHANGED
@@ -1456,6 +1456,22 @@ var require_questionMark = __commonJS({
1456
1456
  }
1457
1457
  });
1458
1458
 
1459
+ // src/icons/more.js
1460
+ var require_more = __commonJS({
1461
+ "src/icons/more.js"(exports) {
1462
+ "use strict";
1463
+ var data = {
1464
+ "body": '<path fill="currentColor" d="M3.5 13a2.5 2.5 0 100-5 2.5 2.5 0 000 5Zm14 0a2.5 2.5 0 100-5 2.5 2.5 0 000 5Zm-7 0a2.5 2.5 0 100-5 2.5 2.5 0 000 5Z"/>',
1465
+ "left": 0,
1466
+ "top": 0,
1467
+ "width": 20,
1468
+ "height": 20
1469
+ };
1470
+ exports.__esModule = true;
1471
+ exports.default = data;
1472
+ }
1473
+ });
1474
+
1459
1475
  // src/icons/smallCross.js
1460
1476
  var require_smallCross = __commonJS({
1461
1477
  "src/icons/smallCross.js"(exports) {
@@ -1570,7 +1586,7 @@ __export(molecules_exports, {
1570
1586
  Divider: () => Divider2,
1571
1587
  Dropdown: () => Dropdown,
1572
1588
  DropdownButton: () => DropdownButton,
1573
- DropdownMenu: () => DropdownMenu3,
1589
+ DropdownMenu: () => DropdownMenu2,
1574
1590
  Element: () => Element,
1575
1591
  EmptyState: () => EmptyState,
1576
1592
  EmptyStateLayout: () => EmptyStateLayout,
@@ -1588,7 +1604,7 @@ __export(molecules_exports, {
1588
1604
  InputBase: () => InputBase,
1589
1605
  LineClamp: () => LineClamp2,
1590
1606
  Link: () => Link2,
1591
- List: () => List,
1607
+ List: () => List2,
1592
1608
  ListItem: () => ListItem,
1593
1609
  Modal: () => Modal2,
1594
1610
  ModalTab: () => ModalTab,
@@ -1600,9 +1616,10 @@ __export(molecules_exports, {
1600
1616
  MultiSelectBase: () => MultiSelectBase,
1601
1617
  NativeSelect: () => NativeSelect,
1602
1618
  NativeSelectBase: () => NativeSelectBase,
1619
+ Navigation: () => Navigation2,
1603
1620
  OneLineBanner: () => OneLineBanner,
1604
1621
  Option: () => Option,
1605
- PageHeader: () => PageHeader,
1622
+ PageHeader: () => PageHeader2,
1606
1623
  Pagination: () => Pagination,
1607
1624
  Popover: () => Popover2,
1608
1625
  PopoverDialog: () => PopoverDialog2,
@@ -1616,7 +1633,7 @@ __export(molecules_exports, {
1616
1633
  SecondaryButton: () => SecondaryButton,
1617
1634
  SecondaryDropdownButton: () => SecondaryDropdownButton,
1618
1635
  SecondaryGhostButton: () => SecondaryGhostButton,
1619
- Section: () => Section3,
1636
+ Section: () => Section4,
1620
1637
  SegmentedControl: () => SegmentedControl,
1621
1638
  SegmentedControlGroup: () => SegmentedControlGroup,
1622
1639
  Select: () => Select2,
@@ -3076,17 +3093,20 @@ var asButton = (Component, isDropdownButton) => {
3076
3093
  className: classNames(
3077
3094
  UNSAFE_className,
3078
3095
  !isIconOnlyButton && COLOR_CLASSNAMES[kind],
3079
- tw("inline-block border-0 rounded-sm transition whitespace-nowrap focus:outline-none relative", {
3080
- "text-grey-70 p-2 active:text-grey-70 active:bg-transparent hover:text-grey-90 hover:bg-grey-0 focus-visible:text-grey-90 focus-visible:bg-grey-0 disabled:text-grey-20 disabled:bg-transparent": isIconOnlyButton,
3081
- "typography-default-strong": !dense && !isIconOnlyButton && kind !== "text",
3082
- "typography-small-strong": dense && !isIconOnlyButton,
3083
- "py-3 px-4": !dense && isButton,
3084
- "py-2 px-3": dense && isButton,
3085
- "py-3": !dense && isGhost,
3086
- "py-2": dense && isGhost,
3087
- "block w-full": fullWidth && !isIconOnlyButton,
3088
- "cursor-not-allowed": !!disabled || !!loading2
3089
- })
3096
+ tw(
3097
+ "inline-block border-0 rounded-sm transition whitespace-nowrap focus:outline-none relative text-center",
3098
+ {
3099
+ "text-grey-70 p-2 active:text-grey-70 active:bg-transparent hover:text-grey-90 hover:bg-grey-0 focus-visible:text-grey-90 focus-visible:bg-grey-0 disabled:text-grey-20 disabled:bg-transparent": isIconOnlyButton,
3100
+ "typography-default-strong": !dense && !isIconOnlyButton && kind !== "text",
3101
+ "typography-small-strong": dense && !isIconOnlyButton && kind !== "text",
3102
+ "py-3 px-4": !dense && isButton,
3103
+ "py-2 px-3": dense && isButton,
3104
+ "py-3": !dense && isGhost,
3105
+ "py-2": dense && isGhost,
3106
+ "block w-full": fullWidth && !isIconOnlyButton,
3107
+ "cursor-not-allowed": !!disabled || !!loading2
3108
+ }
3109
+ )
3090
3110
  ),
3091
3111
  "aria-label": isIconOnlyButton ? ariaLabel != null ? ariaLabel : tooltip : ariaLabel,
3092
3112
  disabled: disabled || loading2
@@ -5212,100 +5232,549 @@ var Container2 = ({ maxWidth = "xl", children }) => /* @__PURE__ */ React42.crea
5212
5232
  }, children);
5213
5233
 
5214
5234
  // src/molecules/DataList/DataList.tsx
5215
- import React48 from "react";
5235
+ import React52 from "react";
5236
+ import compact from "lodash/compact";
5237
+ import isFunction from "lodash/isFunction";
5216
5238
 
5217
- // src/molecules/Template/Template.tsx
5239
+ // src/molecules/DropdownMenu/DropdownMenu.tsx
5240
+ import React46 from "react";
5241
+ import { useFilter } from "@react-aria/i18n";
5242
+ import { PressResponder, usePress } from "@react-aria/interactions";
5243
+ import { useMenu, useMenuItem, useMenuSection, useMenuTrigger } from "@react-aria/menu";
5244
+ import { useSeparator } from "@react-aria/separator";
5245
+ import { mergeProps as mergeProps2 } from "@react-aria/utils";
5246
+ import { Item as Item3, Section } from "@react-stately/collections";
5247
+ import { useMenuTriggerState } from "@react-stately/menu";
5248
+ import { useTreeState } from "@react-stately/tree";
5249
+
5250
+ // src/molecules/Input/Input.tsx
5251
+ import React44, { forwardRef, useImperativeHandle, useRef as useRef6, useState as useState6 } from "react";
5252
+ import omit7 from "lodash/omit";
5253
+ import toString from "lodash/toString";
5254
+ import uniqueId3 from "lodash/uniqueId";
5255
+
5256
+ // src/utils/form/InputAdornment/InputAdornment.tsx
5218
5257
  import React43 from "react";
5219
- var Template = ({
5220
- children,
5221
- columns,
5222
- alignSelf,
5223
- alignContent,
5224
- alignItems,
5225
- justifySelf,
5226
- gap,
5227
- columnGap,
5228
- rowGap,
5229
- fullHeight
5230
- }) => {
5231
- const gridTemplateColumns = typeof columns === "number" ? "1fr ".repeat(columns) : columns.map((column) => typeof column === "number" ? `${column}px` : column === "auto" ? column : `${column}fr`).join(" ");
5232
- const styles = useStyle({
5233
- height: fullHeight ? "100%" : void 0,
5234
- display: "grid",
5235
- gridTemplateColumns,
5236
- alignSelf,
5237
- alignContent,
5238
- alignItems,
5239
- justifySelf,
5240
- gap,
5241
- rowGap,
5242
- columnGap
5243
- });
5244
- return /* @__PURE__ */ React43.createElement("div", {
5245
- style: __spreadValues({}, styles)
5246
- }, children);
5258
+ var import_cross4 = __toESM(require_cross());
5259
+ var import_error2 = __toESM(require_error());
5260
+ var import_search2 = __toESM(require_search());
5261
+ var import_tick3 = __toESM(require_tick());
5262
+ var InputAdornment = ({ placement = "right", className, dense, children }) => {
5263
+ return /* @__PURE__ */ React43.createElement("span", {
5264
+ className: classNames(className, "absolute inset-y-0 grow-0 text-grey-40 flex items-center mx-3", {
5265
+ "right-0": placement === "right",
5266
+ "left-0": placement === "left",
5267
+ "typography-small": dense,
5268
+ "typography-default-strong": !dense
5269
+ })
5270
+ }, /* @__PURE__ */ React43.createElement(Flexbox, {
5271
+ gap: "3",
5272
+ wrap: "wrap"
5273
+ }, children));
5247
5274
  };
5275
+ var SearchIcon = ({ onClick }) => /* @__PURE__ */ React43.createElement(Icon, {
5276
+ icon: import_search2.default,
5277
+ color: "grey-30",
5278
+ "data-testid": "icon-search",
5279
+ onClick
5280
+ });
5281
+ var ResetIcon = ({ onClick }) => /* @__PURE__ */ React43.createElement(Icon, {
5282
+ className: "hover:cursor-pointer",
5283
+ icon: import_cross4.default,
5284
+ color: "grey-30",
5285
+ "data-testid": "icon-reset",
5286
+ onClick
5287
+ });
5248
5288
 
5249
- // src/atoms/DataList/DataList.tsx
5250
- import React46 from "react";
5289
+ // src/molecules/Input/Input.tsx
5290
+ var createInput = (displayName, opts = {}) => {
5291
+ const InputComponent = forwardRef(
5292
+ (_a, ref) => {
5293
+ var _b = _a, {
5294
+ type = "text",
5295
+ maxLength,
5296
+ valid = true,
5297
+ required = false,
5298
+ endAdornment,
5299
+ disabled = false,
5300
+ readOnly = false
5301
+ } = _b, props = __objRest(_b, [
5302
+ "type",
5303
+ "maxLength",
5304
+ "valid",
5305
+ "required",
5306
+ "endAdornment",
5307
+ "disabled",
5308
+ "readOnly"
5309
+ ]);
5310
+ var _a2;
5311
+ const inputRef = React44.useRef(null);
5312
+ useImperativeHandle(ref, () => inputRef.current);
5313
+ const handleReset = () => {
5314
+ var _a3;
5315
+ const el = inputRef.current;
5316
+ if (el) {
5317
+ const lastValue = el.value;
5318
+ el.value = "";
5319
+ (_a3 = el._valueTracker) == null ? void 0 : _a3.setValue(lastValue);
5320
+ el.dispatchEvent(new Event("change", { bubbles: true }));
5321
+ el.focus();
5322
+ }
5323
+ };
5324
+ return /* @__PURE__ */ React44.createElement("span", {
5325
+ className: tw("relative block")
5326
+ }, opts.adornment && /* @__PURE__ */ React44.createElement(InputAdornment, {
5327
+ placement: "left"
5328
+ }, opts.adornment), /* @__PURE__ */ React44.createElement("input", __spreadProps(__spreadValues({
5329
+ ref: inputRef,
5330
+ type
5331
+ }, props), {
5332
+ disabled,
5333
+ maxLength,
5334
+ required,
5335
+ readOnly,
5336
+ className: classNames(
5337
+ {
5338
+ "pl-7": opts.adornment
5339
+ },
5340
+ getCommonInputStyles({ readOnly, valid }),
5341
+ props.className
5342
+ )
5343
+ })), opts.canReset && (props.value || ((_a2 = inputRef.current) == null ? void 0 : _a2.value)) && /* @__PURE__ */ React44.createElement(InputAdornment, null, /* @__PURE__ */ React44.createElement(ResetIcon, {
5344
+ onClick: handleReset
5345
+ })), !opts.canReset && endAdornment && /* @__PURE__ */ React44.createElement(InputAdornment, null, endAdornment));
5346
+ }
5347
+ );
5348
+ InputComponent.displayName = displayName;
5349
+ InputComponent.Skeleton = () => /* @__PURE__ */ React44.createElement(Skeleton, {
5350
+ height: 38
5351
+ });
5352
+ return InputComponent;
5353
+ };
5354
+ var InputBase = createInput("InputBase");
5355
+ var SearchInput = createInput("SearchInput", { adornment: /* @__PURE__ */ React44.createElement(SearchIcon, null), canReset: true });
5356
+ var Input2 = React44.forwardRef((_a, ref) => {
5357
+ var _b = _a, { readOnly = false } = _b, props = __objRest(_b, ["readOnly"]);
5358
+ var _a2, _b2, _c;
5359
+ const [value, setValue] = useState6((_b2 = (_a2 = props.value) != null ? _a2 : props.defaultValue) != null ? _b2 : "");
5360
+ const id = useRef6((_c = props.id) != null ? _c : `input-${uniqueId3()}`);
5361
+ const errorMessageId = uniqueId3();
5362
+ const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
5363
+ const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
5364
+ const baseProps = omit7(props, Object.keys(labelControlProps));
5365
+ return /* @__PURE__ */ React44.createElement(LabelControl, __spreadValues({
5366
+ id: `${id.current}-label`,
5367
+ htmlFor: id.current,
5368
+ messageId: errorMessageId,
5369
+ length: value !== void 0 ? toString(value).length : void 0
5370
+ }, labelControlProps), /* @__PURE__ */ React44.createElement(InputBase, __spreadProps(__spreadValues(__spreadValues({
5371
+ ref
5372
+ }, baseProps), errorProps), {
5373
+ id: id.current,
5374
+ "data-testid": dataTestId,
5375
+ onChange: (e) => {
5376
+ var _a3;
5377
+ setValue(e.currentTarget.value);
5378
+ (_a3 = props.onChange) == null ? void 0 : _a3.call(props, e);
5379
+ },
5380
+ disabled: props.disabled,
5381
+ maxLength: props.maxLength,
5382
+ required: props.required,
5383
+ valid: props.valid,
5384
+ readOnly
5385
+ })));
5386
+ });
5387
+ Input2.displayName = "Input";
5388
+ Input2.Skeleton = () => /* @__PURE__ */ React44.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React44.createElement(InputBase.Skeleton, null));
5389
+ Input2.Skeleton.displayName = "Input.Skeleton";
5251
5390
 
5252
- // src/atoms/Table/Table.tsx
5391
+ // src/atoms/DropdownMenu/DropdownMenu.tsx
5253
5392
  import React45 from "react";
5254
-
5255
- // src/atoms/RadioButton/RadioButton.tsx
5256
- import React44 from "react";
5257
- var RadioButton = React44.forwardRef(
5393
+ var import_tick4 = __toESM(require_tick());
5394
+ var DropdownMenu = React45.forwardRef(
5258
5395
  (_a, ref) => {
5259
- var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
5260
- return /* @__PURE__ */ React44.createElement("input", __spreadProps(__spreadValues({
5261
- id,
5396
+ var _b = _a, { maxHeight = "450px", minWidth = "125px", maxWidth, className, children } = _b, props = __objRest(_b, ["maxHeight", "minWidth", "maxWidth", "className", "children"]);
5397
+ return /* @__PURE__ */ React45.createElement("div", __spreadValues({
5262
5398
  ref,
5263
- type: "radio",
5264
- name
5265
- }, props), {
5266
- className: classNames(
5267
- tw(
5268
- "inline-flex justify-center items-center self-center appearance-none",
5269
- "w-5 h-5 p-[3px] rounded-full cursor-pointer border border-grey-20",
5270
- "outline-none focus:border-info-70 checked:bg-navyBlue-100 checked:shadow-whiteInset",
5271
- {
5272
- "hover:border-grey-50 checked:border-navyBlue-100": !disabled,
5273
- "cursor-not-allowed border-grey-5 bg-grey-0 checked:bg-opacity-40": disabled
5274
- }
5275
- )
5276
- ),
5277
- readOnly,
5278
- disabled
5399
+ style: { maxHeight, minWidth, maxWidth },
5400
+ className: classNames(className, "bg-white w-full flex flex-col overflow-x-hidden typography-small text-grey-70")
5401
+ }, props), children);
5402
+ }
5403
+ );
5404
+ var ContentContainer = ({ children }) => /* @__PURE__ */ React45.createElement("div", {
5405
+ className: tw("p-3 overflow-y-auto overflow-x-hidden")
5406
+ }, children);
5407
+ DropdownMenu.ContentContainer = ContentContainer;
5408
+ var List = React45.forwardRef(
5409
+ (_a, ref) => {
5410
+ var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
5411
+ return /* @__PURE__ */ React45.createElement("ul", __spreadValues({
5412
+ ref,
5413
+ className: classNames(className, "outline-none ring-0")
5414
+ }, props), children);
5415
+ }
5416
+ );
5417
+ DropdownMenu.List = List;
5418
+ var Group2 = React45.forwardRef(
5419
+ (_a, ref) => {
5420
+ var _b = _a, { className, title, titleProps, children } = _b, props = __objRest(_b, ["className", "title", "titleProps", "children"]);
5421
+ return /* @__PURE__ */ React45.createElement("li", __spreadValues({
5422
+ ref
5423
+ }, props), title && /* @__PURE__ */ React45.createElement("div", __spreadValues({
5424
+ className: classNames(className, "p-3 text-grey-40 uppercase cursor-default typography-caption", {
5425
+ "text-grey-20": props.disabled
5426
+ })
5427
+ }, titleProps), title), children);
5428
+ }
5429
+ );
5430
+ DropdownMenu.Group = Group2;
5431
+ var Item2 = React45.forwardRef(
5432
+ (_a, ref) => {
5433
+ var _b = _a, { kind, highlighted, selected, className, icon, children } = _b, props = __objRest(_b, ["kind", "highlighted", "selected", "className", "icon", "children"]);
5434
+ return /* @__PURE__ */ React45.createElement("li", __spreadValues({
5435
+ ref,
5436
+ className: classNames(className, "flex items-center gap-x-3 p-3 outline-none", {
5437
+ "cursor-pointer hover:bg-grey-0": !props.disabled,
5438
+ "bg-grey-0": highlighted,
5439
+ "text-primary-80": kind === "action",
5440
+ "text-grey-20 cursor-not-allowed": props.disabled
5441
+ })
5442
+ }, props), icon && /* @__PURE__ */ React45.createElement(InlineIcon, {
5443
+ icon
5444
+ }), /* @__PURE__ */ React45.createElement("span", {
5445
+ className: tw("grow")
5446
+ }, children), selected && /* @__PURE__ */ React45.createElement(InlineIcon, {
5447
+ icon: import_tick4.default
5279
5448
  }));
5280
5449
  }
5281
5450
  );
5282
-
5283
- // src/atoms/Table/Table.tsx
5284
- var import_chevronDown3 = __toESM(require_chevronDown());
5285
- var import_chevronUp2 = __toESM(require_chevronUp());
5286
- var HeadContext = React45.createContext(null);
5287
- var tableClassNames = tw("w-full relative typography-default border-spacing-0");
5288
- var Table = (_a) => {
5289
- var _b = _a, { children, ariaLabel, className } = _b, rest = __objRest(_b, ["children", "ariaLabel", "className"]);
5290
- return /* @__PURE__ */ React45.createElement("table", __spreadProps(__spreadValues({}, rest), {
5291
- className: classNames(tableClassNames, className),
5292
- "aria-label": ariaLabel
5293
- }), children);
5294
- };
5295
- var TableHead = (_a) => {
5296
- var _b = _a, { children, sticky } = _b, rest = __objRest(_b, ["children", "sticky"]);
5297
- return /* @__PURE__ */ React45.createElement("thead", __spreadValues({}, rest), /* @__PURE__ */ React45.createElement("tr", null, /* @__PURE__ */ React45.createElement(HeadContext.Provider, {
5298
- value: { children, sticky }
5299
- }, children)));
5451
+ DropdownMenu.Item = Item2;
5452
+ var Description = ({ disabled, children }) => /* @__PURE__ */ React45.createElement(Typography2.Caption, {
5453
+ color: disabled ? "grey-20" : "grey-40"
5454
+ }, children);
5455
+ DropdownMenu.Description = Description;
5456
+ var Separator = (_a) => {
5457
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
5458
+ return /* @__PURE__ */ React45.createElement("li", __spreadProps(__spreadValues({}, props), {
5459
+ className: classNames(className, tw("m-3 block bg-grey-5 h-[1px]"))
5460
+ }));
5300
5461
  };
5301
- var TableBody = (_a) => {
5302
- var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
5303
- return /* @__PURE__ */ React45.createElement("tbody", __spreadValues({}, rest), children);
5462
+ DropdownMenu.Separator = Separator;
5463
+ var EmptyStateContainer2 = (_a) => {
5464
+ var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
5465
+ return /* @__PURE__ */ React45.createElement("div", __spreadValues({
5466
+ className: classNames(tw("border border-dashed border-grey-10 p-3"), className)
5467
+ }, props), children);
5468
+ };
5469
+ DropdownMenu.EmptyStateContainer = EmptyStateContainer2;
5470
+
5471
+ // src/molecules/DropdownMenu/utils.ts
5472
+ import { ListCollection } from "@react-stately/list";
5473
+ var filterCollection = (collection, inputValue, filter) => {
5474
+ return new ListCollection(filterNodes(collection, inputValue, filter));
5475
+ };
5476
+ var filterNodes = (nodes, inputValue, filter) => {
5477
+ const filteredNode = [];
5478
+ for (const node of nodes) {
5479
+ if (node.type === "section" && node.hasChildNodes) {
5480
+ const filtered = filterNodes(node.childNodes, inputValue, filter);
5481
+ if ([...filtered].length > 0) {
5482
+ filteredNode.push(__spreadProps(__spreadValues({}, node), { childNodes: filtered }));
5483
+ }
5484
+ } else if (node.type !== "section" && filter(node.textValue, inputValue)) {
5485
+ filteredNode.push(__spreadValues({}, node));
5486
+ }
5487
+ }
5488
+ return filteredNode;
5489
+ };
5490
+
5491
+ // src/molecules/DropdownMenu/DropdownMenu.tsx
5492
+ var DropdownMenu2 = (_a) => {
5493
+ var _b = _a, {
5494
+ onAction,
5495
+ selectionMode,
5496
+ selection,
5497
+ onSelectionChange,
5498
+ placement = "bottom-left",
5499
+ minWidth,
5500
+ maxWidth,
5501
+ searchable = false,
5502
+ emptyState,
5503
+ header,
5504
+ footer,
5505
+ children
5506
+ } = _b, props = __objRest(_b, [
5507
+ "onAction",
5508
+ "selectionMode",
5509
+ "selection",
5510
+ "onSelectionChange",
5511
+ "placement",
5512
+ "minWidth",
5513
+ "maxWidth",
5514
+ "searchable",
5515
+ "emptyState",
5516
+ "header",
5517
+ "footer",
5518
+ "children"
5519
+ ]);
5520
+ const triggerRef = React46.useRef(null);
5521
+ const [trigger, items] = extractTriggerAndItems(children);
5522
+ const state = useMenuTriggerState(props);
5523
+ const { menuTriggerProps, menuProps } = useMenuTrigger({}, state, triggerRef);
5524
+ return /* @__PURE__ */ React46.createElement("div", null, /* @__PURE__ */ React46.createElement(PressResponder, __spreadValues({
5525
+ ref: triggerRef,
5526
+ onPress: () => state.toggle()
5527
+ }, menuTriggerProps), /* @__PURE__ */ React46.createElement(TriggerWrapper, null, trigger.props.children)), state.isOpen && /* @__PURE__ */ React46.createElement(PopoverOverlay, {
5528
+ triggerRef,
5529
+ state,
5530
+ placement,
5531
+ focusable: false
5532
+ }, /* @__PURE__ */ React46.createElement(MenuWrapper, __spreadValues({
5533
+ onAction,
5534
+ selectionMode,
5535
+ selection,
5536
+ onSelectionChange,
5537
+ searchable,
5538
+ emptyState,
5539
+ minWidth,
5540
+ maxWidth,
5541
+ header,
5542
+ footer
5543
+ }, menuProps), items.props.children)));
5544
+ };
5545
+ DropdownMenu2.displayName = "DropdownMenu";
5546
+ var MenuTrigger = () => null;
5547
+ var MenuItems = () => null;
5548
+ DropdownMenu2.Trigger = MenuTrigger;
5549
+ DropdownMenu2.Trigger.displayName = "DropdownMenu.Trigger";
5550
+ DropdownMenu2.Items = MenuItems;
5551
+ DropdownMenu2.Items.displayName = "DropdownMenu.Items";
5552
+ DropdownMenu2.Item = Item3;
5553
+ DropdownMenu2.Item.displayName = "DropdownMenu.Item";
5554
+ DropdownMenu2.Section = Section;
5555
+ DropdownMenu2.Section.displayName = "DropdownMenu.Section";
5556
+ var TriggerWrapper = (_a) => {
5557
+ var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
5558
+ const ref = React46.useRef(null);
5559
+ const { pressProps } = usePress(__spreadProps(__spreadValues({}, props), { ref }));
5560
+ const trigger = React46.Children.only(children);
5561
+ if (!trigger || !React46.isValidElement(trigger)) {
5562
+ throw new Error("<DropdownMenu.Trigger> must have valid child");
5563
+ }
5564
+ return React46.cloneElement(trigger, __spreadValues({ ref }, mergeProps2(pressProps, props)));
5565
+ };
5566
+ var isSectionNode = (item) => item.type === "section";
5567
+ var isItemNode = (item) => item.type === "item";
5568
+ var MenuWrapper = (_a) => {
5569
+ var _b = _a, {
5570
+ selection: selectedKeys,
5571
+ minWidth,
5572
+ maxWidth,
5573
+ searchable,
5574
+ emptyState,
5575
+ header,
5576
+ footer
5577
+ } = _b, props = __objRest(_b, [
5578
+ "selection",
5579
+ "minWidth",
5580
+ "maxWidth",
5581
+ "searchable",
5582
+ "emptyState",
5583
+ "header",
5584
+ "footer"
5585
+ ]);
5586
+ const ref = React46.useRef(null);
5587
+ const disabledKeys = getDisabledItemKeys(props.children);
5588
+ const state = useTreeState(__spreadValues({
5589
+ disabledKeys,
5590
+ selectedKeys
5591
+ }, props));
5592
+ const { menuProps } = useMenu(props, state, ref);
5593
+ const { contains } = useFilter({ sensitivity: "base" });
5594
+ const [search, setSearch] = React46.useState("");
5595
+ const filteredCollection = React46.useMemo(
5596
+ () => searchable ? filterCollection(state.collection, search, contains) : state.collection,
5597
+ [state.collection, search, contains]
5598
+ );
5599
+ return /* @__PURE__ */ React46.createElement(DropdownMenu, {
5600
+ minWidth: minWidth !== void 0 ? `${minWidth}px` : void 0,
5601
+ maxWidth: maxWidth !== void 0 ? `${maxWidth}px` : void 0
5602
+ }, header, /* @__PURE__ */ React46.createElement(DropdownMenu.ContentContainer, null, searchable && /* @__PURE__ */ React46.createElement(SearchInput, {
5603
+ "aria-label": "search",
5604
+ value: search,
5605
+ onChange: (e) => setSearch(e.target.value),
5606
+ className: tw("mb-5")
5607
+ }), filteredCollection.size === 0 && emptyState && /* @__PURE__ */ React46.createElement(DropdownMenu.EmptyStateContainer, null, emptyState), /* @__PURE__ */ React46.createElement(DropdownMenu.List, __spreadValues({
5608
+ ref
5609
+ }, menuProps), Array.from(filteredCollection).map((item) => {
5610
+ if (isSectionNode(item)) {
5611
+ return /* @__PURE__ */ React46.createElement(SectionWrapper, {
5612
+ key: item.key,
5613
+ section: item,
5614
+ state
5615
+ });
5616
+ } else if (isItemNode(item)) {
5617
+ return /* @__PURE__ */ React46.createElement(ItemWrapper, {
5618
+ key: item.key,
5619
+ item,
5620
+ state
5621
+ });
5622
+ }
5623
+ }))), footer);
5624
+ };
5625
+ var ItemWrapper = ({ item, state }) => {
5626
+ const ref = React46.useRef(null);
5627
+ const { menuItemProps, descriptionProps, isSelected, isFocused, isDisabled } = useMenuItem(
5628
+ { key: item.key, closeOnSelect: item.props.closeOnSelect },
5629
+ state,
5630
+ ref
5631
+ );
5632
+ const { icon, description, kind = "default" } = item.props;
5633
+ return /* @__PURE__ */ React46.createElement(DropdownMenu.Item, __spreadProps(__spreadValues({
5634
+ ref
5635
+ }, menuItemProps), {
5636
+ kind,
5637
+ selected: isSelected,
5638
+ highlighted: isFocused,
5639
+ disabled: isDisabled,
5640
+ icon
5641
+ }), item.rendered, description && /* @__PURE__ */ React46.createElement(DropdownMenu.Description, __spreadValues({
5642
+ disabled: isDisabled
5643
+ }, descriptionProps), description));
5644
+ };
5645
+ var SectionWrapper = ({ section, state }) => {
5646
+ const { itemProps, headingProps, groupProps } = useMenuSection({
5647
+ "heading": section.rendered,
5648
+ "aria-label": section["aria-label"]
5649
+ });
5650
+ const { separatorProps } = useSeparator({
5651
+ elementType: "li"
5652
+ });
5653
+ return /* @__PURE__ */ React46.createElement(React46.Fragment, null, section.key !== state.collection.getFirstKey() && /* @__PURE__ */ React46.createElement(DropdownMenu.Separator, __spreadValues({}, separatorProps)), /* @__PURE__ */ React46.createElement(DropdownMenu.Group, __spreadValues({
5654
+ title: section.rendered,
5655
+ titleProps: headingProps
5656
+ }, itemProps), /* @__PURE__ */ React46.createElement("ul", __spreadValues({}, groupProps), Array.from(section.childNodes).map((node) => /* @__PURE__ */ React46.createElement(ItemWrapper, {
5657
+ key: node.key,
5658
+ item: node,
5659
+ state
5660
+ })))));
5661
+ };
5662
+ var extractTriggerAndItems = (children) => {
5663
+ const [trigger, items] = React46.Children.toArray(children);
5664
+ if (!isComponentType(trigger, MenuTrigger) || !isComponentType(items, MenuItems)) {
5665
+ throw new Error("<DropdownMenu> must have <DropdownMenu.Trigger> and <DropdownMenu.Items> defined");
5666
+ }
5667
+ return [trigger, items];
5668
+ };
5669
+ var getDisabledItemKeys = (children) => {
5670
+ const keys = React46.Children.map(children, (child) => {
5671
+ var _a, _b;
5672
+ if (!child || typeof child === "function") {
5673
+ return null;
5674
+ }
5675
+ if (isComponentType(child, Item3) && child.props.disabled) {
5676
+ return (_b = (_a = child.key) == null ? void 0 : _a.toString()) != null ? _b : null;
5677
+ }
5678
+ if (isComponentType(child, Section)) {
5679
+ return getDisabledItemKeys(child.props.children);
5680
+ }
5681
+ return null;
5682
+ });
5683
+ return keys.flat().filter((key) => key !== null);
5684
+ };
5685
+
5686
+ // src/molecules/Template/Template.tsx
5687
+ import React47 from "react";
5688
+ var Template = ({
5689
+ children,
5690
+ columns,
5691
+ alignSelf,
5692
+ alignContent,
5693
+ alignItems,
5694
+ justifySelf,
5695
+ gap,
5696
+ columnGap,
5697
+ rowGap,
5698
+ fullHeight
5699
+ }) => {
5700
+ const gridTemplateColumns = typeof columns === "number" ? "1fr ".repeat(columns) : columns.map((column) => typeof column === "number" ? `${column}px` : column === "auto" ? column : `${column}fr`).join(" ");
5701
+ const styles = useStyle({
5702
+ height: fullHeight ? "100%" : void 0,
5703
+ display: "grid",
5704
+ gridTemplateColumns,
5705
+ alignSelf,
5706
+ alignContent,
5707
+ alignItems,
5708
+ justifySelf,
5709
+ gap,
5710
+ rowGap,
5711
+ columnGap
5712
+ });
5713
+ return /* @__PURE__ */ React47.createElement("div", {
5714
+ style: __spreadValues({}, styles)
5715
+ }, children);
5716
+ };
5717
+
5718
+ // src/atoms/DataList/DataList.tsx
5719
+ import React50 from "react";
5720
+
5721
+ // src/atoms/Table/Table.tsx
5722
+ import React49 from "react";
5723
+
5724
+ // src/atoms/RadioButton/RadioButton.tsx
5725
+ import React48 from "react";
5726
+ var RadioButton = React48.forwardRef(
5727
+ (_a, ref) => {
5728
+ var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
5729
+ return /* @__PURE__ */ React48.createElement("input", __spreadProps(__spreadValues({
5730
+ id,
5731
+ ref,
5732
+ type: "radio",
5733
+ name
5734
+ }, props), {
5735
+ className: classNames(
5736
+ tw(
5737
+ "inline-flex justify-center items-center self-center appearance-none",
5738
+ "w-5 h-5 p-[3px] rounded-full cursor-pointer border border-grey-20",
5739
+ "outline-none focus:border-info-70 checked:bg-navyBlue-100 checked:shadow-whiteInset",
5740
+ {
5741
+ "hover:border-grey-50 checked:border-navyBlue-100": !disabled,
5742
+ "cursor-not-allowed border-grey-5 bg-grey-0 checked:bg-opacity-40": disabled
5743
+ }
5744
+ )
5745
+ ),
5746
+ readOnly,
5747
+ disabled
5748
+ }));
5749
+ }
5750
+ );
5751
+
5752
+ // src/atoms/Table/Table.tsx
5753
+ var import_chevronDown3 = __toESM(require_chevronDown());
5754
+ var import_chevronUp2 = __toESM(require_chevronUp());
5755
+ var HeadContext = React49.createContext(null);
5756
+ var tableClassNames = tw("w-full relative typography-default border-spacing-0");
5757
+ var Table = (_a) => {
5758
+ var _b = _a, { children, ariaLabel, className } = _b, rest = __objRest(_b, ["children", "ariaLabel", "className"]);
5759
+ return /* @__PURE__ */ React49.createElement("table", __spreadProps(__spreadValues({}, rest), {
5760
+ className: classNames(tableClassNames, className),
5761
+ "aria-label": ariaLabel
5762
+ }), children);
5763
+ };
5764
+ var TableHead = (_a) => {
5765
+ var _b = _a, { children, sticky } = _b, rest = __objRest(_b, ["children", "sticky"]);
5766
+ return /* @__PURE__ */ React49.createElement("thead", __spreadValues({}, rest), /* @__PURE__ */ React49.createElement("tr", null, /* @__PURE__ */ React49.createElement(HeadContext.Provider, {
5767
+ value: { children, sticky }
5768
+ }, children)));
5769
+ };
5770
+ var TableBody = (_a) => {
5771
+ var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
5772
+ return /* @__PURE__ */ React49.createElement("tbody", __spreadValues({}, rest), children);
5304
5773
  };
5305
5774
  var rowClassNames = tw("children:border-grey-10 group children:last:border-b-0 hover:bg-grey-0");
5306
5775
  var TableRow = (_a) => {
5307
5776
  var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
5308
- return /* @__PURE__ */ React45.createElement("tr", __spreadProps(__spreadValues({}, rest), {
5777
+ return /* @__PURE__ */ React49.createElement("tr", __spreadProps(__spreadValues({}, rest), {
5309
5778
  className: classNames(rowClassNames, className)
5310
5779
  }), children);
5311
5780
  };
@@ -5332,15 +5801,15 @@ var getHeadCellClassNames = (sticky = true, stickyColumn) => {
5332
5801
  };
5333
5802
  var TableCell = (_a) => {
5334
5803
  var _b = _a, { children, className, stickyColumn, align = "left" } = _b, rest = __objRest(_b, ["children", "className", "stickyColumn", "align"]);
5335
- const headContext = React45.useContext(HeadContext);
5336
- return headContext ? /* @__PURE__ */ React45.createElement("th", __spreadProps(__spreadValues({}, rest), {
5804
+ const headContext = React49.useContext(HeadContext);
5805
+ return headContext ? /* @__PURE__ */ React49.createElement("th", __spreadProps(__spreadValues({}, rest), {
5337
5806
  className: classNames(
5338
5807
  cellClassNames,
5339
5808
  getHeadCellClassNames(headContext.sticky, stickyColumn),
5340
5809
  getAlignClassNames(align),
5341
5810
  className
5342
5811
  )
5343
- }), children) : /* @__PURE__ */ React45.createElement("td", __spreadProps(__spreadValues({}, rest), {
5812
+ }), children) : /* @__PURE__ */ React49.createElement("td", __spreadProps(__spreadValues({}, rest), {
5344
5813
  className: classNames(
5345
5814
  cellClassNames,
5346
5815
  getBodyCellClassNames(true, stickyColumn),
@@ -5351,11 +5820,11 @@ var TableCell = (_a) => {
5351
5820
  };
5352
5821
  var TableSelectCell = (_a) => {
5353
5822
  var _b = _a, { ariaLabel } = _b, props = __objRest(_b, ["ariaLabel"]);
5354
- return /* @__PURE__ */ React45.createElement(Table.Cell, {
5823
+ return /* @__PURE__ */ React49.createElement(Table.Cell, {
5355
5824
  className: tw("leading-[0px]")
5356
- }, props.type === "radio" ? /* @__PURE__ */ React45.createElement(RadioButton, __spreadValues({
5825
+ }, props.type === "radio" ? /* @__PURE__ */ React49.createElement(RadioButton, __spreadValues({
5357
5826
  "aria-label": ariaLabel
5358
- }, props)) : /* @__PURE__ */ React45.createElement(Checkbox, __spreadValues({
5827
+ }, props)) : /* @__PURE__ */ React49.createElement(Checkbox, __spreadValues({
5359
5828
  "aria-label": ariaLabel
5360
5829
  }, props)));
5361
5830
  };
@@ -5365,39 +5834,39 @@ var getSortCellIconClassNames = (active) => {
5365
5834
  };
5366
5835
  var TableSortCell = (_a) => {
5367
5836
  var _b = _a, { children, direction = "none", onClick } = _b, rest = __objRest(_b, ["children", "direction", "onClick"]);
5368
- return /* @__PURE__ */ React45.createElement(Table.Cell, __spreadProps(__spreadValues({}, rest), {
5837
+ return /* @__PURE__ */ React49.createElement(Table.Cell, __spreadProps(__spreadValues({}, rest), {
5369
5838
  "aria-sort": direction
5370
- }), /* @__PURE__ */ React45.createElement("span", {
5839
+ }), /* @__PURE__ */ React49.createElement("span", {
5371
5840
  className: getSortCellButtonClassNames(rest.align),
5372
5841
  role: "button",
5373
5842
  tabIndex: -1,
5374
5843
  onClick
5375
- }, children, /* @__PURE__ */ React45.createElement("div", {
5844
+ }, children, /* @__PURE__ */ React49.createElement("div", {
5376
5845
  "data-sort-icons": true,
5377
5846
  className: tw("flex flex-col", {
5378
5847
  "invisible group-hover:visible": direction === "none"
5379
5848
  })
5380
- }, /* @__PURE__ */ React45.createElement(InlineIcon, {
5849
+ }, /* @__PURE__ */ React49.createElement(InlineIcon, {
5381
5850
  icon: import_chevronUp2.default,
5382
5851
  className: getSortCellIconClassNames(direction === "descending")
5383
- }), /* @__PURE__ */ React45.createElement(InlineIcon, {
5852
+ }), /* @__PURE__ */ React49.createElement(InlineIcon, {
5384
5853
  icon: import_chevronDown3.default,
5385
5854
  className: getSortCellIconClassNames(direction === "ascending")
5386
5855
  }))));
5387
5856
  };
5388
- var Item2 = ({ image, imageAlt, imageSize = 35, title, caption }) => /* @__PURE__ */ React45.createElement("div", {
5857
+ var Item4 = ({ image, imageAlt, imageSize = 35, title, caption }) => /* @__PURE__ */ React49.createElement("div", {
5389
5858
  className: tw("flex gap-4 items-center")
5390
- }, image && /* @__PURE__ */ React45.createElement("img", {
5859
+ }, image && /* @__PURE__ */ React49.createElement("img", {
5391
5860
  src: image,
5392
5861
  alt: imageAlt,
5393
5862
  style: { width: imageSize, height: imageSize }
5394
- }), /* @__PURE__ */ React45.createElement("div", null, title, caption && /* @__PURE__ */ React45.createElement(Typography2.Caption, null, caption)));
5395
- Table.Head = React45.memo(TableHead);
5396
- Table.Body = React45.memo(TableBody);
5397
- Table.Row = React45.memo(TableRow);
5398
- Table.Cell = React45.memo(TableCell);
5399
- Table.SortCell = React45.memo(TableSortCell);
5400
- Table.SelectCell = React45.memo(TableSelectCell);
5863
+ }), /* @__PURE__ */ React49.createElement("div", null, title, caption && /* @__PURE__ */ React49.createElement(Typography2.Caption, null, caption)));
5864
+ Table.Head = React49.memo(TableHead);
5865
+ Table.Body = React49.memo(TableBody);
5866
+ Table.Row = React49.memo(TableRow);
5867
+ Table.Cell = React49.memo(TableCell);
5868
+ Table.SortCell = React49.memo(TableSortCell);
5869
+ Table.SelectCell = React49.memo(TableSelectCell);
5401
5870
 
5402
5871
  // src/atoms/DataList/DataList.tsx
5403
5872
  var import_chevronDown4 = __toESM(require_chevronDown());
@@ -5409,7 +5878,7 @@ var getAlignClassNames2 = (align) => tw("flex items-center", {
5409
5878
  });
5410
5879
  var DataList = (_a) => {
5411
5880
  var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
5412
- return /* @__PURE__ */ React46.createElement("div", __spreadValues({}, rest));
5881
+ return /* @__PURE__ */ React50.createElement("div", __spreadValues({}, rest));
5413
5882
  };
5414
5883
  var HeadCell = (_a) => {
5415
5884
  var _b = _a, {
@@ -5422,1141 +5891,732 @@ var HeadCell = (_a) => {
5422
5891
  "sticky",
5423
5892
  "align",
5424
5893
  "stickyColumn"
5425
- ]);
5426
- return /* @__PURE__ */ React46.createElement("div", __spreadProps(__spreadValues({}, rest), {
5427
- role: "cell",
5428
- className: classNames(
5429
- cellClassNames,
5430
- getHeadCellClassNames(sticky, stickyColumn),
5431
- getAlignClassNames2(align),
5432
- className
5433
- )
5434
- }));
5435
- };
5436
- var Cell = (_a) => {
5437
- var _b = _a, {
5438
- className,
5439
- align,
5440
- stickyColumn
5441
- } = _b, rest = __objRest(_b, [
5442
- "className",
5443
- "align",
5444
- "stickyColumn"
5445
- ]);
5446
- return /* @__PURE__ */ React46.createElement("div", __spreadProps(__spreadValues({}, rest), {
5447
- role: "cell",
5448
- className: classNames(
5449
- cellClassNames,
5450
- getBodyCellClassNames(false, stickyColumn),
5451
- getAlignClassNames2(align),
5452
- tw("border-grey-10 group-hover:bg-grey-0 group-last:border-b-0"),
5453
- className
5454
- )
5455
- }));
5456
- };
5457
- var Row = (_a) => {
5458
- var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
5459
- return /* @__PURE__ */ React46.createElement("div", __spreadProps(__spreadValues({}, rest), {
5460
- className: classNames(tw("contents group"), className),
5461
- role: "row"
5462
- }));
5463
- };
5464
- var SortCell = (_a) => {
5465
- var _b = _a, { children, direction = "none", onClick, sticky } = _b, rest = __objRest(_b, ["children", "direction", "onClick", "sticky"]);
5466
- return /* @__PURE__ */ React46.createElement(HeadCell, __spreadProps(__spreadValues({}, rest), {
5467
- "aria-sort": direction,
5468
- role: "cell",
5469
- sticky
5470
- }), /* @__PURE__ */ React46.createElement("span", {
5471
- className: getSortCellButtonClassNames(rest.align),
5472
- role: "button",
5473
- tabIndex: -1,
5474
- onClick
5475
- }, children, /* @__PURE__ */ React46.createElement("div", {
5476
- "data-sort-icons": true,
5477
- className: tw("flex flex-col", {
5478
- "invisible group-hover:visible": direction === "none"
5479
- })
5480
- }, /* @__PURE__ */ React46.createElement(InlineIcon, {
5481
- icon: import_chevronUp3.default,
5482
- className: getSortCellIconClassNames(direction === "descending")
5483
- }), /* @__PURE__ */ React46.createElement(InlineIcon, {
5484
- icon: import_chevronDown4.default,
5485
- className: getSortCellIconClassNames(direction === "ascending")
5486
- }))));
5487
- };
5488
- DataList.HeadCell = HeadCell;
5489
- DataList.SortCell = SortCell;
5490
- DataList.Cell = Cell;
5491
- DataList.Row = Row;
5492
-
5493
- // src/utils/object.ts
5494
- var renameProperty = (oldProp, newProp, _a) => {
5495
- var _b = _a, { [oldProp]: oldValue } = _b, rest = __objRest(_b, [__restKey(oldProp)]);
5496
- return __spreadValues({
5497
- [newProp]: oldValue
5498
- }, rest);
5499
- };
5500
-
5501
- // src/utils/table/types.ts
5502
- var toSortDirection = (direction) => direction === "ascending" ? "asc" : direction === "descending" ? "desc" : false;
5503
- var cellProps = (column) => ({
5504
- key: column.key || column.headerName,
5505
- align: column.type === "number" || column.type === "action" ? "right" : "left",
5506
- stickyColumn: column.sticky
5507
- });
5508
- var columnIsFieldColumn = (column) => Boolean(column && column.field);
5509
-
5510
- // src/utils/table/useTableSort.tsx
5511
- import React47 from "react";
5512
- var useTableSort = () => {
5513
- const [sort, setSort] = React47.useState();
5514
- const handleSortClick = (column) => {
5515
- if (sort && sort.column.headerName === column.headerName) {
5516
- if (sort.direction === "ascending") {
5517
- setSort({ column, direction: "descending" });
5518
- } else {
5519
- setSort(void 0);
5520
- }
5521
- } else {
5522
- setSort({ column, direction: "ascending" });
5523
- }
5524
- };
5525
- return [sort, handleSortClick];
5526
- };
5527
-
5528
- // src/utils/table/utils.ts
5529
- import orderBy2 from "lodash/orderBy";
5530
- var sortRowsBy = (rows, sort) => {
5531
- if (!sort) {
5532
- return rows;
5533
- }
5534
- const sortFunction = sort.column.sort;
5535
- if (sortFunction) {
5536
- return [...rows].sort((a, b) => sortFunction(a, b, sort.direction));
5537
- } else if (columnIsFieldColumn(sort.column)) {
5538
- return orderBy2(rows, [sort.column.field], [toSortDirection(sort.direction)]);
5539
- }
5540
- return rows;
5541
- };
5542
-
5543
- // src/molecules/DataList/DataList.tsx
5544
- var DataList2 = ({
5545
- columns,
5546
- rows,
5547
- sticky
5548
- }) => {
5549
- const [sort, updateSort] = useTableSort();
5550
- const sortedRows = sortRowsBy(rows, sort);
5551
- const templateColumns = columns.map((column) => {
5552
- var _a;
5553
- return (_a = column.width) != null ? _a : "auto";
5554
- });
5555
- return /* @__PURE__ */ React48.createElement(Template, {
5556
- columns: templateColumns
5557
- }, columns.map(
5558
- (column) => columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ React48.createElement(DataList.SortCell, __spreadValues({
5559
- direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
5560
- onClick: () => updateSort(column),
5561
- sticky
5562
- }, cellProps(column)), column.headerName) : /* @__PURE__ */ React48.createElement(DataList.HeadCell, __spreadProps(__spreadValues({}, cellProps(column)), {
5563
- sticky
5564
- }), column.headerName)
5565
- ), /* @__PURE__ */ React48.createElement(List, {
5566
- items: sortedRows,
5567
- renderItem: (row, index) => /* @__PURE__ */ React48.createElement(DataList.Row, {
5568
- key: row.id
5569
- }, /* @__PURE__ */ React48.createElement(List, {
5570
- items: columns,
5571
- renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React48.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React48.createElement(StatusChip, __spreadValues({
5572
- dense: true
5573
- }, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React48.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React48.createElement(SecondaryButton, __spreadValues({
5574
- dense: true
5575
- }, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React48.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React48.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React48.createElement(Item2, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React48.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
5576
- }))
5577
- }));
5578
- };
5579
-
5580
- // src/molecules/DataTable/DataTable.tsx
5581
- import React51 from "react";
5582
-
5583
- // src/molecules/Table/Table.tsx
5584
- import React50 from "react";
5585
-
5586
- // src/utils/table/useScrollTarget.ts
5587
- import React49 from "react";
5588
- var useScrollTarget = (callback) => {
5589
- const targetRef = React49.useRef(null);
5590
- React49.useLayoutEffect(() => {
5591
- const observer = new IntersectionObserver((entries) => entries[0].isIntersecting && callback && callback(), {
5592
- root: null,
5593
- rootMargin: `0px 0px 200px 0px`
5594
- });
5595
- if (targetRef.current) {
5596
- observer.observe(targetRef.current);
5597
- }
5598
- return () => observer.disconnect();
5599
- }, []);
5600
- return targetRef;
5601
- };
5602
-
5603
- // src/molecules/Table/Table.tsx
5604
- var Table2 = (_a) => {
5605
- var _b = _a, { children, onPrev, onNext } = _b, rest = __objRest(_b, ["children", "onPrev", "onNext"]);
5606
- const bottomRef = useScrollTarget(onNext);
5607
- const topRef = useScrollTarget(onPrev);
5608
- return /* @__PURE__ */ React50.createElement("div", {
5609
- className: "relative w-full"
5610
- }, /* @__PURE__ */ React50.createElement("div", {
5611
- ref: topRef,
5612
- className: tw("absolute top-0 h-1 w-full left-0 bg-transparent")
5613
- }), /* @__PURE__ */ React50.createElement(Table, __spreadValues({}, rest), children), /* @__PURE__ */ React50.createElement("div", {
5614
- ref: bottomRef,
5615
- className: tw("absolute bottom-0 h-1 w-full left-0 bg-transparent")
5616
- }));
5617
- };
5618
- Table2.Head = Table.Head;
5619
- Table2.Body = Table.Body;
5620
- Table2.Row = Table.Row;
5621
- Table2.Cell = Table.Cell;
5622
- Table2.SortCell = Table.SortCell;
5623
- Table2.SelectCell = Table.SelectCell;
5624
-
5625
- // src/molecules/DataTable/DataTable.tsx
5626
- var DataTable = (_a) => {
5627
- var _b = _a, {
5628
- columns,
5629
- rows,
5630
- noWrap = false,
5631
- layout = "auto",
5632
- sticky
5633
- } = _b, rest = __objRest(_b, [
5634
- "columns",
5635
- "rows",
5636
- "noWrap",
5637
- "layout",
5638
- "sticky"
5639
- ]);
5640
- const [sort, updateSort] = useTableSort();
5641
- const sortedRows = sortRowsBy(rows, sort);
5642
- return /* @__PURE__ */ React51.createElement(Table2, __spreadProps(__spreadValues({}, rest), {
5643
- className: tw({
5644
- "whitespace-nowrap": noWrap,
5645
- "table-auto": layout === "auto",
5646
- "table-fixed": layout === "fixed"
5647
- })
5648
- }), /* @__PURE__ */ React51.createElement(Table2.Head, {
5649
- sticky
5650
- }, columns.map(
5651
- (column) => columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ React51.createElement(Table2.SortCell, __spreadValues({
5652
- direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
5653
- onClick: () => updateSort(column),
5654
- style: { width: column.width },
5655
- "aria-label": column.headerInvisible ? column.headerName : void 0
5656
- }, cellProps(column)), !column.headerInvisible && column.headerName) : /* @__PURE__ */ React51.createElement(Table2.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
5657
- style: { width: column.width },
5658
- "aria-label": column.headerInvisible ? column.headerName : void 0
5659
- }), !column.headerInvisible && column.headerName)
5660
- )), /* @__PURE__ */ React51.createElement(Table2.Body, null, /* @__PURE__ */ React51.createElement(List, {
5661
- items: sortedRows,
5662
- renderItem: (row, index) => /* @__PURE__ */ React51.createElement(Table2.Row, {
5663
- key: row.id
5664
- }, /* @__PURE__ */ React51.createElement(List, {
5665
- items: columns,
5666
- renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React51.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React51.createElement(StatusChip, __spreadValues({
5667
- dense: true
5668
- }, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React51.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React51.createElement(SecondaryButton, __spreadValues({
5669
- dense: true
5670
- }, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React51.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React51.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React51.createElement(Item2, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React51.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
5671
- }))
5672
- })));
5673
- };
5674
-
5675
- // src/molecules/Dialog/Dialog.tsx
5676
- import React53 from "react";
5677
- import { useDialog } from "@react-aria/dialog";
5678
- import { Overlay as Overlay2, useModalOverlay } from "@react-aria/overlays";
5679
- import { useId } from "@react-aria/utils";
5680
- import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
5681
- import omit7 from "lodash/omit";
5682
-
5683
- // src/atoms/Dialog/Dialog.tsx
5684
- var import_confirm2 = __toESM(require_confirm());
5685
- var import_error2 = __toESM(require_error());
5686
- var import_warningSign2 = __toESM(require_warningSign());
5687
- var DIALOG_ICONS_AND_COLORS = {
5688
- confirmation: {
5689
- icon: import_confirm2.default,
5690
- color: "info-70"
5691
- },
5692
- warning: {
5693
- icon: import_warningSign2.default,
5694
- color: "secondary-70"
5695
- },
5696
- danger: {
5697
- icon: import_error2.default,
5698
- color: "error-70"
5699
- }
5700
- };
5701
-
5702
- // src/atoms/Modal/Modal.tsx
5703
- import React52 from "react";
5704
- var Modal = (_a) => {
5705
- var _b = _a, { children, className, open } = _b, rest = __objRest(_b, ["children", "className", "open"]);
5706
- return open ? /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({}, rest), {
5894
+ ]);
5895
+ return /* @__PURE__ */ React50.createElement("div", __spreadProps(__spreadValues({}, rest), {
5896
+ role: "cell",
5707
5897
  className: classNames(
5708
- tw("inset-0 overflow-y-auto z-modal flex justify-center items-center fixed py-7"),
5898
+ cellClassNames,
5899
+ getHeadCellClassNames(sticky, stickyColumn),
5900
+ getAlignClassNames2(align),
5709
5901
  className
5710
5902
  )
5711
- }), children) : null;
5712
- };
5713
- Modal.BackDrop = (_a) => {
5714
- var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
5715
- return /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({}, rest), {
5716
- className: classNames(tw("-z-10 fixed min-w-full min-h-full bg-navyBlue-100 opacity-70"), className)
5717
5903
  }));
5718
5904
  };
5719
- Modal.Dialog = React52.forwardRef(
5720
- (_a, ref) => {
5721
- var _b = _a, { children, className, size = "sm" } = _b, rest = __objRest(_b, ["children", "className", "size"]);
5722
- return /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({
5723
- ref,
5724
- "aria-modal": "true"
5725
- }, rest), {
5726
- className: classNames(
5727
- tw("relative bg-white rounded mx-7 w-full max-h-full flex flex-col"),
5728
- {
5729
- "max-w-[600px]": size === "sm",
5730
- "max-w-[940px]": size === "md",
5731
- "min-h-full": size === "full"
5732
- },
5733
- className
5734
- )
5735
- }), children);
5736
- }
5737
- );
5738
- Modal.Header = (_a) => {
5739
- var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
5740
- return /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({}, rest), {
5741
- className: classNames(tw("px-7 py-6 gap-3 flex items-center"), className)
5742
- }), children);
5743
- };
5744
- Modal.HeaderImage = (_a) => {
5745
- var _b = _a, { backgroundImage, className } = _b, rest = __objRest(_b, ["backgroundImage", "className"]);
5746
- const common = tw("h-[120px] min-h-[120px] w-full ");
5747
- return backgroundImage ? /* @__PURE__ */ React52.createElement("img", __spreadProps(__spreadValues({
5748
- "aria-hidden": true,
5749
- src: backgroundImage != null ? backgroundImage : void 0
5750
- }, rest), {
5751
- className: classNames(common, tw("object-cover"), className)
5752
- })) : /* @__PURE__ */ React52.createElement("div", {
5753
- className: classNames(common, tw("bg-grey-5"), className)
5754
- });
5905
+ var Cell = (_a) => {
5906
+ var _b = _a, {
5907
+ className,
5908
+ align,
5909
+ stickyColumn
5910
+ } = _b, rest = __objRest(_b, [
5911
+ "className",
5912
+ "align",
5913
+ "stickyColumn"
5914
+ ]);
5915
+ return /* @__PURE__ */ React50.createElement("div", __spreadProps(__spreadValues({}, rest), {
5916
+ role: "cell",
5917
+ className: classNames(
5918
+ cellClassNames,
5919
+ getBodyCellClassNames(false, stickyColumn),
5920
+ getAlignClassNames2(align),
5921
+ tw("border-grey-10 group-hover:bg-grey-0 group-last:border-b-0"),
5922
+ className
5923
+ )
5924
+ }));
5755
5925
  };
5756
- Modal.CloseButtonContainer = (_a) => {
5926
+ var Row = (_a) => {
5757
5927
  var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
5758
- return /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({}, rest), {
5759
- className: classNames(tw("absolute top-[20px] right-[28px]"), className)
5928
+ return /* @__PURE__ */ React50.createElement("div", __spreadProps(__spreadValues({}, rest), {
5929
+ className: classNames(tw("contents group"), className),
5930
+ role: "row"
5760
5931
  }));
5761
5932
  };
5762
- Modal.Title = (_a) => {
5763
- var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
5764
- return /* @__PURE__ */ React52.createElement(Typography, __spreadValues({
5765
- htmlTag: "h2",
5766
- variant: "subheading",
5767
- color: "grey-90",
5768
- className: classNames(tw("leading-none"), className)
5769
- }, rest), children);
5770
- };
5771
- Modal.Subtitle = (_a) => {
5772
- var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
5773
- return /* @__PURE__ */ React52.createElement(Typography, __spreadValues({
5774
- variant: "small",
5775
- color: "grey-60"
5776
- }, rest), children);
5777
- };
5778
- Modal.TitleContainer = (_a) => {
5779
- var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
5780
- return /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({}, rest), {
5781
- className: classNames(tw("flex flex-col grow gap-2"), className)
5782
- }), children);
5783
- };
5784
- Modal.Body = (_a) => {
5785
- var _b = _a, { children, className, noFooter = false, maxHeight, style } = _b, rest = __objRest(_b, ["children", "className", "noFooter", "maxHeight", "style"]);
5786
- return /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({}, rest), {
5787
- className: classNames(tw("px-7 grow overflow-y-auto", { "pb-6": noFooter }), className),
5788
- style: __spreadValues({ maxHeight }, style)
5789
- }), children);
5790
- };
5791
- Modal.Footer = (_a) => {
5792
- var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
5793
- return /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({}, rest), {
5794
- className: classNames(tw("px-7 py-6"), className)
5795
- }), children);
5796
- };
5797
- Modal.Actions = (_a) => {
5798
- var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
5799
- return /* @__PURE__ */ React52.createElement("div", __spreadProps(__spreadValues({}, rest), {
5800
- className: classNames(tw("flex gap-4 justify-end"), className)
5801
- }), children);
5933
+ var SortCell = (_a) => {
5934
+ var _b = _a, { children, direction = "none", onClick, sticky } = _b, rest = __objRest(_b, ["children", "direction", "onClick", "sticky"]);
5935
+ return /* @__PURE__ */ React50.createElement(HeadCell, __spreadProps(__spreadValues({}, rest), {
5936
+ "aria-sort": direction,
5937
+ role: "cell",
5938
+ sticky
5939
+ }), /* @__PURE__ */ React50.createElement("span", {
5940
+ className: getSortCellButtonClassNames(rest.align),
5941
+ role: "button",
5942
+ tabIndex: -1,
5943
+ onClick
5944
+ }, children, /* @__PURE__ */ React50.createElement("div", {
5945
+ "data-sort-icons": true,
5946
+ className: tw("flex flex-col", {
5947
+ "invisible group-hover:visible": direction === "none"
5948
+ })
5949
+ }, /* @__PURE__ */ React50.createElement(InlineIcon, {
5950
+ icon: import_chevronUp3.default,
5951
+ className: getSortCellIconClassNames(direction === "descending")
5952
+ }), /* @__PURE__ */ React50.createElement(InlineIcon, {
5953
+ icon: import_chevronDown4.default,
5954
+ className: getSortCellIconClassNames(direction === "ascending")
5955
+ }))));
5802
5956
  };
5957
+ DataList.HeadCell = HeadCell;
5958
+ DataList.SortCell = SortCell;
5959
+ DataList.Cell = Cell;
5960
+ DataList.Row = Row;
5803
5961
 
5804
- // src/molecules/Dialog/Dialog.tsx
5805
- var Dialog = (props) => {
5806
- const ref = React53.useRef(null);
5807
- const state = useOverlayTriggerState2({ isOpen: props.open });
5808
- const { modalProps, underlayProps } = useModalOverlay({}, state, ref);
5809
- if (!state.isOpen) {
5810
- return null;
5811
- }
5812
- return /* @__PURE__ */ React53.createElement(Overlay2, null, /* @__PURE__ */ React53.createElement(Modal, {
5813
- open: true
5814
- }, /* @__PURE__ */ React53.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React53.createElement(Modal.Dialog, __spreadValues({
5815
- ref,
5816
- size: "sm"
5817
- }, modalProps), /* @__PURE__ */ React53.createElement(DialogWrapper, __spreadValues({}, props)))));
5962
+ // src/utils/object.ts
5963
+ var renameProperty = (oldProp, newProp, _a) => {
5964
+ var _b = _a, { [oldProp]: oldValue } = _b, rest = __objRest(_b, [__restKey(oldProp)]);
5965
+ return __spreadValues({
5966
+ [newProp]: oldValue
5967
+ }, rest);
5818
5968
  };
5819
- var DialogWrapper = ({
5820
- title,
5821
- type = "confirmation",
5822
- children,
5823
- primaryAction,
5824
- secondaryAction
5825
- }) => {
5826
- const ref = React53.useRef(null);
5827
- const labelledBy = useId();
5828
- const describedBy = useId();
5829
- const { dialogProps } = useDialog(
5830
- { "role": "alertdialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
5831
- ref
5832
- );
5833
- return /* @__PURE__ */ React53.createElement("div", __spreadProps(__spreadValues({
5834
- ref
5835
- }, dialogProps), {
5836
- className: tw("outline-none")
5837
- }), /* @__PURE__ */ React53.createElement(Modal.Header, null, /* @__PURE__ */ React53.createElement(Icon, {
5838
- icon: DIALOG_ICONS_AND_COLORS[type].icon,
5839
- color: DIALOG_ICONS_AND_COLORS[type].color,
5840
- fontSize: 20
5841
- }), /* @__PURE__ */ React53.createElement(Modal.Title, {
5842
- id: labelledBy,
5843
- variant: "large-strong",
5844
- color: DIALOG_ICONS_AND_COLORS[type].color
5845
- }, title)), /* @__PURE__ */ React53.createElement(Modal.Body, {
5846
- id: describedBy
5847
- }, children), /* @__PURE__ */ React53.createElement(Modal.Footer, null, /* @__PURE__ */ React53.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ React53.createElement(GhostButton, __spreadValues({
5848
- key: secondaryAction.text
5849
- }, omit7(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React53.createElement(SecondaryButton, __spreadValues({
5850
- key: primaryAction.text
5851
- }, omit7(primaryAction, "text")), primaryAction.text))));
5969
+
5970
+ // src/utils/table/types.ts
5971
+ var toSortDirection = (direction) => direction === "ascending" ? "asc" : direction === "descending" ? "desc" : false;
5972
+ var cellProps = (column) => ({
5973
+ key: column.key || column.headerName,
5974
+ align: column.type === "number" || column.type === "action" ? "right" : "left",
5975
+ stickyColumn: column.sticky
5976
+ });
5977
+ var columnIsFieldColumn = (column) => Boolean(column && column.field);
5978
+
5979
+ // src/utils/table/useTableSort.tsx
5980
+ import React51 from "react";
5981
+ var useTableSort = () => {
5982
+ const [sort, setSort] = React51.useState();
5983
+ const handleSortClick = (column) => {
5984
+ if (sort && sort.column.headerName === column.headerName) {
5985
+ if (sort.direction === "ascending") {
5986
+ setSort({ column, direction: "descending" });
5987
+ } else {
5988
+ setSort(void 0);
5989
+ }
5990
+ } else {
5991
+ setSort({ column, direction: "ascending" });
5992
+ }
5993
+ };
5994
+ return [sort, handleSortClick];
5852
5995
  };
5853
5996
 
5854
- // src/molecules/Divider/Divider.tsx
5855
- import React54 from "react";
5856
- var sizeClasses = {
5857
- horizontal: {
5858
- 1: "h-1px",
5859
- 2: "h-1",
5860
- 4: "h-2",
5861
- 8: "h-3",
5862
- 16: "h-5",
5863
- 24: "h-6"
5864
- },
5865
- vertical: {
5866
- 1: "w-1px",
5867
- 2: "w-1",
5868
- 4: "w-2",
5869
- 8: "w-3",
5870
- 16: "w-5",
5871
- 24: "w-6"
5997
+ // src/utils/table/utils.ts
5998
+ import orderBy2 from "lodash/orderBy";
5999
+ var sortRowsBy = (rows, sort) => {
6000
+ if (!sort) {
6001
+ return rows;
5872
6002
  }
6003
+ const sortFunction = sort.column.sort;
6004
+ if (sortFunction) {
6005
+ return [...rows].sort((a, b) => sortFunction(a, b, sort.direction));
6006
+ } else if (columnIsFieldColumn(sort.column)) {
6007
+ return orderBy2(rows, [sort.column.field], [toSortDirection(sort.direction)]);
6008
+ }
6009
+ return rows;
5873
6010
  };
5874
- var Divider2 = (_a) => {
5875
- var _b = _a, { direction = "horizontal", size = 1 } = _b, props = __objRest(_b, ["direction", "size"]);
5876
- const sizeClass = sizeClasses[direction][size];
5877
- return /* @__PURE__ */ React54.createElement("div", __spreadProps(__spreadValues({}, props), {
5878
- className: tw(`bg-grey-5 ${sizeClass}`, {
5879
- "block w-full": direction === "horizontal",
5880
- "inline-block h-full": direction === "vertical"
5881
- })
5882
- }));
5883
- };
5884
-
5885
- // src/molecules/Dropdown/Dropdown.tsx
5886
- import React57 from "react";
5887
6011
 
5888
- // src/molecules/Popover/Popover.tsx
5889
- import React56, { useRef as useRef6 } from "react";
5890
- import { PressResponder, usePress } from "@react-aria/interactions";
5891
- import { useOverlayTrigger } from "@react-aria/overlays";
5892
- import { mergeProps as mergeProps2 } from "@react-aria/utils";
5893
- import { useOverlayTriggerState as useOverlayTriggerState3 } from "@react-stately/overlays";
6012
+ // src/molecules/DataList/DataList.tsx
6013
+ var import_more = __toESM(require_more());
6014
+ var DataList2 = ({
6015
+ columns,
6016
+ rows,
6017
+ sticky,
6018
+ menu,
6019
+ onAction
6020
+ }) => {
6021
+ const [sort, updateSort] = useTableSort();
6022
+ const sortedRows = sortRowsBy(rows, sort);
6023
+ const templateColumns = compact([
6024
+ ...columns.map((column) => {
6025
+ var _a;
6026
+ return (_a = column.width) != null ? _a : "auto";
6027
+ }),
6028
+ menu ? "auto" : void 0
6029
+ ]);
6030
+ return /* @__PURE__ */ React52.createElement(Template, {
6031
+ columns: templateColumns
6032
+ }, columns.map(
6033
+ (column) => columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ React52.createElement(DataList.SortCell, __spreadValues({
6034
+ direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
6035
+ onClick: () => updateSort(column),
6036
+ sticky
6037
+ }, cellProps(column)), column.headerName) : /* @__PURE__ */ React52.createElement(DataList.HeadCell, __spreadProps(__spreadValues({}, cellProps(column)), {
6038
+ sticky
6039
+ }), column.headerName)
6040
+ ), menu && /* @__PURE__ */ React52.createElement(DataList.HeadCell, {
6041
+ align: "right",
6042
+ "aria-label": "Context menu"
6043
+ }), /* @__PURE__ */ React52.createElement(List2, {
6044
+ items: sortedRows,
6045
+ renderItem: (row, index) => /* @__PURE__ */ React52.createElement(DataList.Row, {
6046
+ key: row.id
6047
+ }, /* @__PURE__ */ React52.createElement(List2, {
6048
+ items: columns,
6049
+ renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React52.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React52.createElement(StatusChip, __spreadValues({
6050
+ dense: true
6051
+ }, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React52.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React52.createElement(SecondaryButton, __spreadValues({
6052
+ dense: true
6053
+ }, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React52.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React52.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React52.createElement(Item4, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React52.createElement(DataList.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
6054
+ }), menu && /* @__PURE__ */ React52.createElement(DataList.Cell, {
6055
+ align: "right"
6056
+ }, /* @__PURE__ */ React52.createElement(DropdownMenu2, {
6057
+ onAction: (action) => onAction == null ? void 0 : onAction(action, row, index)
6058
+ }, /* @__PURE__ */ React52.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React52.createElement(IconButton, {
6059
+ "aria-label": "menu",
6060
+ icon: import_more.default
6061
+ })), isFunction(menu) ? menu(row, index) : menu)))
6062
+ }));
6063
+ };
5894
6064
 
5895
- // src/molecules/Popover/Dialog.tsx
6065
+ // src/molecules/DataTable/DataTable.tsx
5896
6066
  import React55 from "react";
5897
- import { useDialog as useDialog2 } from "@react-aria/dialog";
5898
- var Dialog2 = ({ children }) => {
5899
- const ref = React55.useRef(null);
5900
- const { dialogProps } = useDialog2({}, ref);
5901
- return /* @__PURE__ */ React55.createElement("div", __spreadProps(__spreadValues({
5902
- ref
5903
- }, dialogProps), {
5904
- className: tw("outline-none")
5905
- }), children);
5906
- };
6067
+ import compact2 from "lodash/compact";
6068
+ import isFunction2 from "lodash/isFunction";
5907
6069
 
5908
- // src/molecules/Popover/PopoverContext.tsx
5909
- import { createContext, useContext as useContext2 } from "react";
5910
- var PopoverContext = createContext(null);
5911
- var usePopoverContext = () => {
5912
- const ctx = useContext2(PopoverContext);
5913
- if (ctx === null) {
5914
- throw new Error("PopoverContext was used outside of provider.");
5915
- }
5916
- return ctx;
5917
- };
6070
+ // src/molecules/Table/Table.tsx
6071
+ import React54 from "react";
5918
6072
 
5919
- // src/molecules/Popover/Popover.tsx
5920
- var Popover2 = (props) => {
5921
- const {
5922
- id,
5923
- type,
5924
- placement = "bottom-left",
5925
- containFocus = true,
5926
- isKeyboardDismissDisabled = false,
5927
- targetRef,
5928
- offset,
5929
- crossOffset,
5930
- shouldFlip
5931
- } = props;
5932
- const triggerRef = useRef6(null);
5933
- const state = useOverlayTriggerState3(props);
5934
- const { triggerProps, overlayProps } = useOverlayTrigger({ type: type != null ? type : "dialog" }, state, triggerRef);
5935
- return /* @__PURE__ */ React56.createElement(PopoverContext.Provider, {
5936
- value: {
5937
- state
5938
- }
5939
- }, React56.Children.map(props.children, (child) => {
5940
- if (isComponentType(child, Popover2.Trigger)) {
5941
- return /* @__PURE__ */ React56.createElement(PressResponder, __spreadValues({
5942
- ref: triggerRef
5943
- }, triggerProps), /* @__PURE__ */ React56.createElement(PopoverTriggerWrapper, {
5944
- "data-testid": props["data-testid"],
5945
- "aria-controls": id
5946
- }, child.props.children));
5947
- }
5948
- if (isComponentType(child, Popover2.Panel)) {
5949
- return state.isOpen && /* @__PURE__ */ React56.createElement(PopoverOverlay, __spreadValues({
5950
- triggerRef: targetRef != null ? targetRef : triggerRef,
5951
- state,
5952
- placement,
5953
- isNonModal: !containFocus,
5954
- autoFocus: !containFocus,
5955
- isKeyboardDismissDisabled,
5956
- className: child.props.className,
5957
- offset,
5958
- crossOffset,
5959
- shouldFlip
5960
- }, overlayProps), containFocus ? /* @__PURE__ */ React56.createElement(Dialog2, null, child.props.children) : child.props.children);
6073
+ // src/utils/table/useScrollTarget.ts
6074
+ import React53 from "react";
6075
+ var useScrollTarget = (callback) => {
6076
+ const targetRef = React53.useRef(null);
6077
+ React53.useLayoutEffect(() => {
6078
+ const observer = new IntersectionObserver((entries) => entries[0].isIntersecting && callback && callback(), {
6079
+ root: null,
6080
+ rootMargin: `0px 0px 200px 0px`
6081
+ });
6082
+ if (targetRef.current) {
6083
+ observer.observe(targetRef.current);
5961
6084
  }
5962
- throw new Error("Invalid children element type");
5963
- }));
5964
- };
5965
- var Trigger = () => null;
5966
- Trigger.displayName = "Popover.Trigger";
5967
- Popover2.Trigger = Trigger;
5968
- var Panel = () => null;
5969
- Panel.displayName = "Popover.Panel";
5970
- Popover2.Panel = Panel;
5971
- var asPopoverButton = (Component, displayName) => {
5972
- const PopoverButton2 = (props) => {
5973
- const { onClick } = props;
5974
- const { state } = usePopoverContext();
5975
- const handleClick = (e) => {
5976
- state.close();
5977
- onClick == null ? void 0 : onClick(e);
5978
- };
5979
- return /* @__PURE__ */ React56.createElement(Component, __spreadProps(__spreadValues({}, props), {
5980
- onClick: handleClick
5981
- }));
5982
- };
5983
- PopoverButton2.displayName = displayName;
5984
- return PopoverButton2;
6085
+ return () => observer.disconnect();
6086
+ }, []);
6087
+ return targetRef;
5985
6088
  };
5986
- var PopoverButton = asPopoverButton(Button, "PopoverButton");
5987
- Popover2.Button = PopoverButton;
5988
- var PopoverTriggerWrapper = (_a) => {
5989
- var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
5990
- var _a2;
5991
- const ref = useRef6(null);
5992
- const trigger = React56.Children.only(children);
5993
- const { pressProps } = usePress(__spreadProps(__spreadValues({}, rest), { ref }));
5994
- return React56.cloneElement(trigger, __spreadProps(__spreadValues({
5995
- "ref": ref
5996
- }, mergeProps2(pressProps, trigger.props)), {
5997
- "aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
6089
+
6090
+ // src/molecules/Table/Table.tsx
6091
+ var Table2 = (_a) => {
6092
+ var _b = _a, { children, onPrev, onNext } = _b, rest = __objRest(_b, ["children", "onPrev", "onNext"]);
6093
+ const bottomRef = useScrollTarget(onNext);
6094
+ const topRef = useScrollTarget(onPrev);
6095
+ return /* @__PURE__ */ React54.createElement("div", {
6096
+ className: "relative w-full"
6097
+ }, /* @__PURE__ */ React54.createElement("div", {
6098
+ ref: topRef,
6099
+ className: tw("absolute top-0 h-1 w-full left-0 bg-transparent")
6100
+ }), /* @__PURE__ */ React54.createElement(Table, __spreadValues({}, rest), children), /* @__PURE__ */ React54.createElement("div", {
6101
+ ref: bottomRef,
6102
+ className: tw("absolute bottom-0 h-1 w-full left-0 bg-transparent")
5998
6103
  }));
5999
6104
  };
6105
+ Table2.Head = Table.Head;
6106
+ Table2.Body = Table.Body;
6107
+ Table2.Row = Table.Row;
6108
+ Table2.Cell = Table.Cell;
6109
+ Table2.SortCell = Table.SortCell;
6110
+ Table2.SelectCell = Table.SelectCell;
6000
6111
 
6001
- // src/molecules/Dropdown/Dropdown.tsx
6002
- var Dropdown = ({ children, content, placement = "bottom-left" }) => {
6003
- return /* @__PURE__ */ React57.createElement(Popover2, {
6004
- type: "menu",
6005
- placement
6006
- }, /* @__PURE__ */ React57.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ React57.createElement(Popover2.Panel, null, content));
6007
- };
6008
- var DropdownMenu = ({
6009
- title,
6010
- children,
6011
- contentId,
6012
- triggerId,
6013
- setClose = () => void 0
6014
- }) => {
6015
- const menuRef = React57.useRef(null);
6016
- React57.useEffect(() => {
6017
- const id = setTimeout(() => {
6018
- var _a, _b, _c;
6019
- return (_c = (_b = (_a = menuRef.current) == null ? void 0 : _a.children) == null ? void 0 : _b[0]) == null ? void 0 : _c.focus();
6020
- });
6021
- return () => clearTimeout(id);
6022
- }, [menuRef.current]);
6023
- return /* @__PURE__ */ React57.createElement("div", {
6024
- style: { minWidth: "250px" },
6025
- className: tw("py-3 bg-white")
6026
- }, !!title && /* @__PURE__ */ React57.createElement("div", {
6027
- className: tw("px-4 py-4 text-left text-grey-100 typography-default-strong")
6028
- }, title), /* @__PURE__ */ React57.createElement("ol", {
6029
- role: "menu",
6030
- ref: menuRef,
6031
- id: contentId,
6032
- "aria-labelledby": triggerId
6033
- }, React57.Children.map(children, (child) => {
6034
- return React57.cloneElement(child, { setClose });
6035
- })));
6036
- };
6037
- var DropdownItem = (_a) => {
6112
+ // src/molecules/DataTable/DataTable.tsx
6113
+ var import_more2 = __toESM(require_more());
6114
+ var DataTable = (_a) => {
6038
6115
  var _b = _a, {
6039
- children,
6040
- disabled = false,
6041
- tooltip,
6042
- tooltipPlacement,
6043
- color = "default",
6044
- onSelect,
6045
- setClose = () => void 0
6046
- } = _b, props = __objRest(_b, [
6047
- "children",
6048
- "disabled",
6049
- "tooltip",
6050
- "tooltipPlacement",
6051
- "color",
6052
- "onSelect",
6053
- "setClose"
6116
+ columns,
6117
+ rows,
6118
+ noWrap = false,
6119
+ layout = "auto",
6120
+ sticky,
6121
+ menu,
6122
+ onAction
6123
+ } = _b, rest = __objRest(_b, [
6124
+ "columns",
6125
+ "rows",
6126
+ "noWrap",
6127
+ "layout",
6128
+ "sticky",
6129
+ "menu",
6130
+ "onAction"
6054
6131
  ]);
6055
- const { state } = usePopoverContext();
6056
- const handleSelect = () => {
6057
- onSelect == null ? void 0 : onSelect();
6058
- state.close();
6059
- setClose();
6060
- };
6061
- const handleKeyDown = (event) => {
6062
- const target = event.target;
6063
- const parent = target.parentElement;
6064
- const first = parent.firstChild;
6065
- const last = parent.lastChild;
6066
- const next = target.nextElementSibling;
6067
- const prev = target.previousElementSibling;
6068
- if (event.key === "ArrowUp") {
6069
- prev ? prev.focus() : last.focus();
6070
- } else if (event.key === "ArrowDown") {
6071
- next ? next.focus() : first.focus();
6072
- } else if (event.key === "Tab") {
6073
- event.preventDefault();
6074
- event.stopPropagation();
6075
- } else if (event.key === "Home" || event.key === "PageUp") {
6076
- first.focus();
6077
- } else if (event.key === "End" || event.key === "PageDown") {
6078
- last.focus();
6079
- } else if (event.key === "Enter") {
6080
- !disabled && handleSelect();
6081
- }
6082
- };
6083
- const handleClick = (e) => {
6084
- e.stopPropagation();
6085
- if (!disabled) {
6086
- handleSelect();
6087
- }
6088
- };
6089
- const itemContent = /* @__PURE__ */ React57.createElement("div", {
6090
- className: tw("py-3 px-4")
6091
- }, children);
6092
- return /* @__PURE__ */ React57.createElement("li", __spreadProps(__spreadValues({
6093
- role: "menuitem",
6094
- tabIndex: -1,
6095
- onClick: handleClick,
6096
- onKeyDown: handleKeyDown
6097
- }, props), {
6098
- className: tw("typography-small flex items-center focus:ring-0", {
6099
- "text-grey-70 cursor-pointer hover:bg-grey-0": !disabled,
6100
- "text-grey-10 cursor-not-allowed": disabled,
6101
- "text-primary-70 hover:text-primary-80": color === "danger" && !disabled
6132
+ const [sort, updateSort] = useTableSort();
6133
+ const sortedRows = sortRowsBy(rows, sort);
6134
+ return /* @__PURE__ */ React55.createElement(Table2, __spreadProps(__spreadValues({}, rest), {
6135
+ className: tw({
6136
+ "whitespace-nowrap": noWrap,
6137
+ "table-auto": layout === "auto",
6138
+ "table-fixed": layout === "fixed"
6102
6139
  })
6103
- }), tooltip ? /* @__PURE__ */ React57.createElement(Tooltip, {
6104
- content: tooltip,
6105
- placement: tooltipPlacement,
6106
- inline: false
6107
- }, /* @__PURE__ */ React57.createElement("div", {
6108
- tabIndex: 0,
6109
- className: tw("grow")
6110
- }, itemContent)) : itemContent);
6140
+ }), /* @__PURE__ */ React55.createElement(Table2.Head, {
6141
+ sticky
6142
+ }, compact2([
6143
+ ...columns.map(
6144
+ (column) => columnIsFieldColumn(column) && column.sortable || column.sort ? /* @__PURE__ */ React55.createElement(Table2.SortCell, __spreadValues({
6145
+ direction: sort && sort.column.headerName === column.headerName ? sort.direction : "none",
6146
+ onClick: () => updateSort(column),
6147
+ style: { width: column.width },
6148
+ "aria-label": column.headerInvisible ? column.headerName : void 0
6149
+ }, cellProps(column)), !column.headerInvisible && column.headerName) : /* @__PURE__ */ React55.createElement(Table2.Cell, __spreadProps(__spreadValues({}, cellProps(column)), {
6150
+ style: { width: column.width },
6151
+ "aria-label": column.headerInvisible ? column.headerName : void 0
6152
+ }), !column.headerInvisible && column.headerName)
6153
+ ),
6154
+ menu ? /* @__PURE__ */ React55.createElement(Table2.Cell, {
6155
+ key: "__contextMenu",
6156
+ align: "right",
6157
+ "aria-label": "Context menu"
6158
+ }) : null
6159
+ ])), /* @__PURE__ */ React55.createElement(Table2.Body, null, /* @__PURE__ */ React55.createElement(List2, {
6160
+ items: sortedRows,
6161
+ renderItem: (row, index) => /* @__PURE__ */ React55.createElement(Table2.Row, {
6162
+ key: row.id
6163
+ }, /* @__PURE__ */ React55.createElement(List2, {
6164
+ items: columns,
6165
+ renderItem: (column) => column.type === "status" ? /* @__PURE__ */ React55.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React55.createElement(StatusChip, __spreadValues({
6166
+ dense: true
6167
+ }, column.status(row, index, sortedRows)))) : column.type === "action" ? /* @__PURE__ */ React55.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React55.createElement(SecondaryButton, __spreadValues({
6168
+ dense: true
6169
+ }, renameProperty("text", "children", column.action(row, index, sortedRows))))) : column.type === "custom" ? /* @__PURE__ */ React55.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.UNSAFE_render(row, index, sortedRows)) : column.type === "item" ? /* @__PURE__ */ React55.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), /* @__PURE__ */ React55.createElement(Item4, __spreadValues({}, column.item(row, index, sortedRows)))) : /* @__PURE__ */ React55.createElement(Table2.Cell, __spreadValues({}, cellProps(column)), column.formatter ? column.formatter(row[column.field], row, index, sortedRows) : row[column.field])
6170
+ }), menu && /* @__PURE__ */ React55.createElement(Table2.Cell, {
6171
+ align: "right"
6172
+ }, /* @__PURE__ */ React55.createElement(DropdownMenu2, {
6173
+ onAction: (action) => onAction == null ? void 0 : onAction(action, row, index)
6174
+ }, /* @__PURE__ */ React55.createElement(DropdownMenu2.Trigger, null, /* @__PURE__ */ React55.createElement(IconButton, {
6175
+ "aria-label": "menu",
6176
+ icon: import_more2.default
6177
+ })), isFunction2(menu) ? menu(row, index) : menu)))
6178
+ })));
6111
6179
  };
6112
- Dropdown.Menu = DropdownMenu;
6113
- Dropdown.Item = DropdownItem;
6114
-
6115
- // src/molecules/DropdownMenu/DropdownMenu.tsx
6116
- import React61 from "react";
6117
- import { useFilter } from "@react-aria/i18n";
6118
- import { PressResponder as PressResponder2, usePress as usePress2 } from "@react-aria/interactions";
6119
- import { useMenu, useMenuItem, useMenuSection, useMenuTrigger } from "@react-aria/menu";
6120
- import { useSeparator } from "@react-aria/separator";
6121
- import { mergeProps as mergeProps3 } from "@react-aria/utils";
6122
- import { Item as Item4, Section } from "@react-stately/collections";
6123
- import { useMenuTriggerState } from "@react-stately/menu";
6124
- import { useTreeState } from "@react-stately/tree";
6125
6180
 
6126
- // src/molecules/Input/Input.tsx
6127
- import React59, { forwardRef, useImperativeHandle, useRef as useRef7, useState as useState6 } from "react";
6181
+ // src/molecules/Dialog/Dialog.tsx
6182
+ import React57 from "react";
6183
+ import { useDialog } from "@react-aria/dialog";
6184
+ import { Overlay as Overlay2, useModalOverlay } from "@react-aria/overlays";
6185
+ import { useId } from "@react-aria/utils";
6186
+ import { useOverlayTriggerState as useOverlayTriggerState2 } from "@react-stately/overlays";
6128
6187
  import omit8 from "lodash/omit";
6129
- import toString from "lodash/toString";
6130
- import uniqueId3 from "lodash/uniqueId";
6131
6188
 
6132
- // src/utils/form/InputAdornment/InputAdornment.tsx
6133
- import React58 from "react";
6134
- var import_cross4 = __toESM(require_cross());
6189
+ // src/atoms/Dialog/Dialog.tsx
6190
+ var import_confirm2 = __toESM(require_confirm());
6135
6191
  var import_error3 = __toESM(require_error());
6136
- var import_search2 = __toESM(require_search());
6137
- var import_tick3 = __toESM(require_tick());
6138
- var InputAdornment = ({ placement = "right", className, dense, children }) => {
6139
- return /* @__PURE__ */ React58.createElement("span", {
6140
- className: classNames(className, "absolute inset-y-0 grow-0 text-grey-40 flex items-center mx-3", {
6141
- "right-0": placement === "right",
6142
- "left-0": placement === "left",
6143
- "typography-small": dense,
6144
- "typography-default-strong": !dense
6145
- })
6146
- }, /* @__PURE__ */ React58.createElement(Flexbox, {
6147
- gap: "3",
6148
- wrap: "wrap"
6149
- }, children));
6192
+ var import_warningSign2 = __toESM(require_warningSign());
6193
+ var DIALOG_ICONS_AND_COLORS = {
6194
+ confirmation: {
6195
+ icon: import_confirm2.default,
6196
+ color: "info-70"
6197
+ },
6198
+ warning: {
6199
+ icon: import_warningSign2.default,
6200
+ color: "secondary-70"
6201
+ },
6202
+ danger: {
6203
+ icon: import_error3.default,
6204
+ color: "error-70"
6205
+ }
6150
6206
  };
6151
- var SearchIcon = ({ onClick }) => /* @__PURE__ */ React58.createElement(Icon, {
6152
- icon: import_search2.default,
6153
- color: "grey-30",
6154
- "data-testid": "icon-search",
6155
- onClick
6156
- });
6157
- var ResetIcon = ({ onClick }) => /* @__PURE__ */ React58.createElement(Icon, {
6158
- className: "hover:cursor-pointer",
6159
- icon: import_cross4.default,
6160
- color: "grey-30",
6161
- "data-testid": "icon-reset",
6162
- onClick
6163
- });
6164
6207
 
6165
- // src/molecules/Input/Input.tsx
6166
- var createInput = (displayName, opts = {}) => {
6167
- const InputComponent = forwardRef(
6168
- (_a, ref) => {
6169
- var _b = _a, {
6170
- type = "text",
6171
- maxLength,
6172
- valid = true,
6173
- required = false,
6174
- endAdornment,
6175
- disabled = false,
6176
- readOnly = false
6177
- } = _b, props = __objRest(_b, [
6178
- "type",
6179
- "maxLength",
6180
- "valid",
6181
- "required",
6182
- "endAdornment",
6183
- "disabled",
6184
- "readOnly"
6185
- ]);
6186
- var _a2;
6187
- const inputRef = React59.useRef(null);
6188
- useImperativeHandle(ref, () => inputRef.current);
6189
- const handleReset = () => {
6190
- var _a3;
6191
- const el = inputRef.current;
6192
- if (el) {
6193
- const lastValue = el.value;
6194
- el.value = "";
6195
- (_a3 = el._valueTracker) == null ? void 0 : _a3.setValue(lastValue);
6196
- el.dispatchEvent(new Event("change", { bubbles: true }));
6197
- el.focus();
6198
- }
6199
- };
6200
- return /* @__PURE__ */ React59.createElement("span", {
6201
- className: tw("relative block")
6202
- }, opts.adornment && /* @__PURE__ */ React59.createElement(InputAdornment, {
6203
- placement: "left"
6204
- }, opts.adornment), /* @__PURE__ */ React59.createElement("input", __spreadProps(__spreadValues({
6205
- ref: inputRef,
6206
- type
6207
- }, props), {
6208
- disabled,
6209
- maxLength,
6210
- required,
6211
- readOnly,
6212
- className: classNames(
6213
- {
6214
- "pl-7": opts.adornment
6215
- },
6216
- getCommonInputStyles({ readOnly, valid }),
6217
- props.className
6218
- )
6219
- })), opts.canReset && (props.value || ((_a2 = inputRef.current) == null ? void 0 : _a2.value)) && /* @__PURE__ */ React59.createElement(InputAdornment, null, /* @__PURE__ */ React59.createElement(ResetIcon, {
6220
- onClick: handleReset
6221
- })), !opts.canReset && endAdornment && /* @__PURE__ */ React59.createElement(InputAdornment, null, endAdornment));
6222
- }
6223
- );
6224
- InputComponent.displayName = displayName;
6225
- InputComponent.Skeleton = () => /* @__PURE__ */ React59.createElement(Skeleton, {
6226
- height: 38
6227
- });
6228
- return InputComponent;
6208
+ // src/atoms/Modal/Modal.tsx
6209
+ import React56 from "react";
6210
+ var Modal = (_a) => {
6211
+ var _b = _a, { children, className, open } = _b, rest = __objRest(_b, ["children", "className", "open"]);
6212
+ return open ? /* @__PURE__ */ React56.createElement("div", __spreadProps(__spreadValues({}, rest), {
6213
+ className: classNames(
6214
+ tw("inset-0 overflow-y-auto z-modal flex justify-center items-center fixed py-7"),
6215
+ className
6216
+ )
6217
+ }), children) : null;
6229
6218
  };
6230
- var InputBase = createInput("InputBase");
6231
- var SearchInput = createInput("SearchInput", { adornment: /* @__PURE__ */ React59.createElement(SearchIcon, null), canReset: true });
6232
- var Input2 = React59.forwardRef((_a, ref) => {
6233
- var _b = _a, { readOnly = false } = _b, props = __objRest(_b, ["readOnly"]);
6234
- var _a2, _b2, _c;
6235
- const [value, setValue] = useState6((_b2 = (_a2 = props.value) != null ? _a2 : props.defaultValue) != null ? _b2 : "");
6236
- const id = useRef7((_c = props.id) != null ? _c : `input-${uniqueId3()}`);
6237
- const errorMessageId = uniqueId3();
6238
- const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
6239
- const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
6240
- const baseProps = omit8(props, Object.keys(labelControlProps));
6241
- return /* @__PURE__ */ React59.createElement(LabelControl, __spreadValues({
6242
- id: `${id.current}-label`,
6243
- htmlFor: id.current,
6244
- messageId: errorMessageId,
6245
- length: value !== void 0 ? toString(value).length : void 0
6246
- }, labelControlProps), /* @__PURE__ */ React59.createElement(InputBase, __spreadProps(__spreadValues(__spreadValues({
6247
- ref
6248
- }, baseProps), errorProps), {
6249
- id: id.current,
6250
- "data-testid": dataTestId,
6251
- onChange: (e) => {
6252
- var _a3;
6253
- setValue(e.currentTarget.value);
6254
- (_a3 = props.onChange) == null ? void 0 : _a3.call(props, e);
6255
- },
6256
- disabled: props.disabled,
6257
- maxLength: props.maxLength,
6258
- required: props.required,
6259
- valid: props.valid,
6260
- readOnly
6261
- })));
6262
- });
6263
- Input2.displayName = "Input";
6264
- Input2.Skeleton = () => /* @__PURE__ */ React59.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React59.createElement(InputBase.Skeleton, null));
6265
- Input2.Skeleton.displayName = "Input.Skeleton";
6266
-
6267
- // src/atoms/DropdownMenu/DropdownMenu.tsx
6268
- import React60 from "react";
6269
- var import_tick4 = __toESM(require_tick());
6270
- var DropdownMenu2 = React60.forwardRef(
6271
- (_a, ref) => {
6272
- var _b = _a, { maxHeight = "450px", minWidth = "125px", maxWidth, className, children } = _b, props = __objRest(_b, ["maxHeight", "minWidth", "maxWidth", "className", "children"]);
6273
- return /* @__PURE__ */ React60.createElement("div", __spreadValues({
6274
- ref,
6275
- style: { maxHeight, minWidth, maxWidth },
6276
- className: classNames(className, "bg-white w-full flex flex-col overflow-x-hidden typography-small text-grey-70")
6277
- }, props), children);
6278
- }
6279
- );
6280
- var ContentContainer = ({ children }) => /* @__PURE__ */ React60.createElement("div", {
6281
- className: tw("p-3 overflow-y-auto overflow-x-hidden")
6282
- }, children);
6283
- DropdownMenu2.ContentContainer = ContentContainer;
6284
- var List2 = React60.forwardRef(
6285
- (_a, ref) => {
6286
- var _b = _a, { children, className } = _b, props = __objRest(_b, ["children", "className"]);
6287
- return /* @__PURE__ */ React60.createElement("ul", __spreadValues({
6288
- ref,
6289
- className: classNames(className, "outline-none ring-0")
6290
- }, props), children);
6291
- }
6292
- );
6293
- DropdownMenu2.List = List2;
6294
- var Group2 = React60.forwardRef(
6295
- (_a, ref) => {
6296
- var _b = _a, { className, title, titleProps, children } = _b, props = __objRest(_b, ["className", "title", "titleProps", "children"]);
6297
- return /* @__PURE__ */ React60.createElement("li", __spreadValues({
6298
- ref
6299
- }, props), title && /* @__PURE__ */ React60.createElement("div", __spreadValues({
6300
- className: classNames(className, "p-3 text-grey-40 uppercase cursor-default typography-caption", {
6301
- "text-grey-20": props.disabled
6302
- })
6303
- }, titleProps), title), children);
6304
- }
6305
- );
6306
- DropdownMenu2.Group = Group2;
6307
- var Item3 = React60.forwardRef(
6219
+ Modal.BackDrop = (_a) => {
6220
+ var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
6221
+ return /* @__PURE__ */ React56.createElement("div", __spreadProps(__spreadValues({}, rest), {
6222
+ className: classNames(tw("-z-10 fixed min-w-full min-h-full bg-navyBlue-100 opacity-70"), className)
6223
+ }));
6224
+ };
6225
+ Modal.Dialog = React56.forwardRef(
6308
6226
  (_a, ref) => {
6309
- var _b = _a, { kind, highlighted, selected, className, icon, children } = _b, props = __objRest(_b, ["kind", "highlighted", "selected", "className", "icon", "children"]);
6310
- return /* @__PURE__ */ React60.createElement("li", __spreadValues({
6227
+ var _b = _a, { children, className, size = "sm" } = _b, rest = __objRest(_b, ["children", "className", "size"]);
6228
+ return /* @__PURE__ */ React56.createElement("div", __spreadProps(__spreadValues({
6311
6229
  ref,
6312
- className: classNames(className, "flex items-center gap-x-3 p-3 outline-none", {
6313
- "cursor-pointer hover:bg-grey-0": !props.disabled,
6314
- "bg-grey-0": highlighted,
6315
- "text-primary-80": kind === "action",
6316
- "text-grey-20 cursor-not-allowed": props.disabled
6317
- })
6318
- }, props), icon && /* @__PURE__ */ React60.createElement(InlineIcon, {
6319
- icon
6320
- }), /* @__PURE__ */ React60.createElement("span", {
6321
- className: tw("grow")
6322
- }, children), selected && /* @__PURE__ */ React60.createElement(InlineIcon, {
6323
- icon: import_tick4.default
6324
- }));
6230
+ "aria-modal": "true"
6231
+ }, rest), {
6232
+ className: classNames(
6233
+ tw("relative bg-white rounded mx-7 w-full max-h-full flex flex-col"),
6234
+ {
6235
+ "max-w-[600px]": size === "sm",
6236
+ "max-w-[940px]": size === "md",
6237
+ "min-h-full": size === "full"
6238
+ },
6239
+ className
6240
+ )
6241
+ }), children);
6325
6242
  }
6326
6243
  );
6327
- DropdownMenu2.Item = Item3;
6328
- var Description = ({ disabled, children }) => /* @__PURE__ */ React60.createElement(Typography2.Caption, {
6329
- color: disabled ? "grey-20" : "grey-40"
6330
- }, children);
6331
- DropdownMenu2.Description = Description;
6332
- var Separator = (_a) => {
6333
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
6334
- return /* @__PURE__ */ React60.createElement("li", __spreadProps(__spreadValues({}, props), {
6335
- className: classNames(className, tw("m-3 block bg-grey-5 h-[1px]"))
6244
+ Modal.Header = (_a) => {
6245
+ var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
6246
+ return /* @__PURE__ */ React56.createElement("div", __spreadProps(__spreadValues({}, rest), {
6247
+ className: classNames(tw("px-7 py-6 gap-3 flex items-center"), className)
6248
+ }), children);
6249
+ };
6250
+ Modal.HeaderImage = (_a) => {
6251
+ var _b = _a, { backgroundImage, className } = _b, rest = __objRest(_b, ["backgroundImage", "className"]);
6252
+ const common = tw("h-[120px] min-h-[120px] w-full ");
6253
+ return backgroundImage ? /* @__PURE__ */ React56.createElement("img", __spreadProps(__spreadValues({
6254
+ "aria-hidden": true,
6255
+ src: backgroundImage != null ? backgroundImage : void 0
6256
+ }, rest), {
6257
+ className: classNames(common, tw("object-cover"), className)
6258
+ })) : /* @__PURE__ */ React56.createElement("div", {
6259
+ className: classNames(common, tw("bg-grey-5"), className)
6260
+ });
6261
+ };
6262
+ Modal.CloseButtonContainer = (_a) => {
6263
+ var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
6264
+ return /* @__PURE__ */ React56.createElement("div", __spreadProps(__spreadValues({}, rest), {
6265
+ className: classNames(tw("absolute top-[20px] right-[28px]"), className)
6336
6266
  }));
6337
6267
  };
6338
- DropdownMenu2.Separator = Separator;
6339
- var EmptyStateContainer2 = (_a) => {
6340
- var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
6341
- return /* @__PURE__ */ React60.createElement("div", __spreadValues({
6342
- className: classNames(tw("border border-dashed border-grey-10 p-3"), className)
6343
- }, props), children);
6268
+ Modal.Title = (_a) => {
6269
+ var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
6270
+ return /* @__PURE__ */ React56.createElement(Typography, __spreadValues({
6271
+ htmlTag: "h2",
6272
+ variant: "subheading",
6273
+ color: "grey-90",
6274
+ className: classNames(tw("leading-none"), className)
6275
+ }, rest), children);
6276
+ };
6277
+ Modal.Subtitle = (_a) => {
6278
+ var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
6279
+ return /* @__PURE__ */ React56.createElement(Typography, __spreadValues({
6280
+ variant: "small",
6281
+ color: "grey-60"
6282
+ }, rest), children);
6283
+ };
6284
+ Modal.TitleContainer = (_a) => {
6285
+ var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
6286
+ return /* @__PURE__ */ React56.createElement("div", __spreadProps(__spreadValues({}, rest), {
6287
+ className: classNames(tw("flex flex-col grow gap-2"), className)
6288
+ }), children);
6289
+ };
6290
+ Modal.Body = (_a) => {
6291
+ var _b = _a, { children, className, noFooter = false, maxHeight, style } = _b, rest = __objRest(_b, ["children", "className", "noFooter", "maxHeight", "style"]);
6292
+ return /* @__PURE__ */ React56.createElement("div", __spreadProps(__spreadValues({}, rest), {
6293
+ className: classNames(tw("px-7 grow overflow-y-auto", { "pb-6": noFooter }), className),
6294
+ style: __spreadValues({ maxHeight }, style)
6295
+ }), children);
6296
+ };
6297
+ Modal.Footer = (_a) => {
6298
+ var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
6299
+ return /* @__PURE__ */ React56.createElement("div", __spreadProps(__spreadValues({}, rest), {
6300
+ className: classNames(tw("px-7 py-6"), className)
6301
+ }), children);
6302
+ };
6303
+ Modal.Actions = (_a) => {
6304
+ var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
6305
+ return /* @__PURE__ */ React56.createElement("div", __spreadProps(__spreadValues({}, rest), {
6306
+ className: classNames(tw("flex gap-4 justify-end"), className)
6307
+ }), children);
6344
6308
  };
6345
- DropdownMenu2.EmptyStateContainer = EmptyStateContainer2;
6346
6309
 
6347
- // src/molecules/DropdownMenu/utils.ts
6348
- import { ListCollection } from "@react-stately/list";
6349
- var filterCollection = (collection, inputValue, filter) => {
6350
- return new ListCollection(filterNodes(collection, inputValue, filter));
6310
+ // src/molecules/Dialog/Dialog.tsx
6311
+ var Dialog = (props) => {
6312
+ const ref = React57.useRef(null);
6313
+ const state = useOverlayTriggerState2({ isOpen: props.open });
6314
+ const { modalProps, underlayProps } = useModalOverlay({}, state, ref);
6315
+ if (!state.isOpen) {
6316
+ return null;
6317
+ }
6318
+ return /* @__PURE__ */ React57.createElement(Overlay2, null, /* @__PURE__ */ React57.createElement(Modal, {
6319
+ open: true
6320
+ }, /* @__PURE__ */ React57.createElement(Modal.BackDrop, __spreadValues({}, underlayProps)), /* @__PURE__ */ React57.createElement(Modal.Dialog, __spreadValues({
6321
+ ref,
6322
+ size: "sm"
6323
+ }, modalProps), /* @__PURE__ */ React57.createElement(DialogWrapper, __spreadValues({}, props)))));
6351
6324
  };
6352
- var filterNodes = (nodes, inputValue, filter) => {
6353
- const filteredNode = [];
6354
- for (const node of nodes) {
6355
- if (node.type === "section" && node.hasChildNodes) {
6356
- const filtered = filterNodes(node.childNodes, inputValue, filter);
6357
- if ([...filtered].length > 0) {
6358
- filteredNode.push(__spreadProps(__spreadValues({}, node), { childNodes: filtered }));
6359
- }
6360
- } else if (node.type !== "section" && filter(node.textValue, inputValue)) {
6361
- filteredNode.push(__spreadValues({}, node));
6362
- }
6325
+ var DialogWrapper = ({
6326
+ title,
6327
+ type = "confirmation",
6328
+ children,
6329
+ primaryAction,
6330
+ secondaryAction
6331
+ }) => {
6332
+ const ref = React57.useRef(null);
6333
+ const labelledBy = useId();
6334
+ const describedBy = useId();
6335
+ const { dialogProps } = useDialog(
6336
+ { "role": "alertdialog", "aria-labelledby": labelledBy, "aria-describedby": describedBy },
6337
+ ref
6338
+ );
6339
+ return /* @__PURE__ */ React57.createElement("div", __spreadProps(__spreadValues({
6340
+ ref
6341
+ }, dialogProps), {
6342
+ className: tw("outline-none")
6343
+ }), /* @__PURE__ */ React57.createElement(Modal.Header, null, /* @__PURE__ */ React57.createElement(Icon, {
6344
+ icon: DIALOG_ICONS_AND_COLORS[type].icon,
6345
+ color: DIALOG_ICONS_AND_COLORS[type].color,
6346
+ fontSize: 20
6347
+ }), /* @__PURE__ */ React57.createElement(Modal.Title, {
6348
+ id: labelledBy,
6349
+ variant: "large-strong",
6350
+ color: DIALOG_ICONS_AND_COLORS[type].color
6351
+ }, title)), /* @__PURE__ */ React57.createElement(Modal.Body, {
6352
+ id: describedBy
6353
+ }, children), /* @__PURE__ */ React57.createElement(Modal.Footer, null, /* @__PURE__ */ React57.createElement(Modal.Actions, null, secondaryAction && /* @__PURE__ */ React57.createElement(GhostButton, __spreadValues({
6354
+ key: secondaryAction.text
6355
+ }, omit8(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React57.createElement(SecondaryButton, __spreadValues({
6356
+ key: primaryAction.text
6357
+ }, omit8(primaryAction, "text")), primaryAction.text))));
6358
+ };
6359
+
6360
+ // src/molecules/Divider/Divider.tsx
6361
+ import React58 from "react";
6362
+ var sizeClasses = {
6363
+ horizontal: {
6364
+ 1: "h-1px",
6365
+ 2: "h-1",
6366
+ 4: "h-2",
6367
+ 8: "h-3",
6368
+ 16: "h-5",
6369
+ 24: "h-6"
6370
+ },
6371
+ vertical: {
6372
+ 1: "w-1px",
6373
+ 2: "w-1",
6374
+ 4: "w-2",
6375
+ 8: "w-3",
6376
+ 16: "w-5",
6377
+ 24: "w-6"
6363
6378
  }
6364
- return filteredNode;
6379
+ };
6380
+ var Divider2 = (_a) => {
6381
+ var _b = _a, { direction = "horizontal", size = 1 } = _b, props = __objRest(_b, ["direction", "size"]);
6382
+ const sizeClass = sizeClasses[direction][size];
6383
+ return /* @__PURE__ */ React58.createElement("div", __spreadProps(__spreadValues({}, props), {
6384
+ className: tw(`bg-grey-5 ${sizeClass}`, {
6385
+ "block w-full": direction === "horizontal",
6386
+ "inline-block h-full": direction === "vertical"
6387
+ })
6388
+ }));
6365
6389
  };
6366
6390
 
6367
- // src/molecules/DropdownMenu/DropdownMenu.tsx
6368
- var DropdownMenu3 = (_a) => {
6369
- var _b = _a, {
6370
- onAction,
6371
- selectionMode,
6372
- selection,
6373
- onSelectionChange,
6374
- placement = "bottom-left",
6375
- minWidth,
6376
- maxWidth,
6377
- searchable = false,
6378
- emptyState,
6379
- header,
6380
- footer,
6381
- children
6382
- } = _b, props = __objRest(_b, [
6383
- "onAction",
6384
- "selectionMode",
6385
- "selection",
6386
- "onSelectionChange",
6387
- "placement",
6388
- "minWidth",
6389
- "maxWidth",
6390
- "searchable",
6391
- "emptyState",
6392
- "header",
6393
- "footer",
6394
- "children"
6395
- ]);
6396
- const triggerRef = React61.useRef(null);
6397
- const [trigger, items] = extractTriggerAndItems(children);
6398
- const state = useMenuTriggerState(props);
6399
- const { menuTriggerProps, menuProps } = useMenuTrigger({}, state, triggerRef);
6400
- return /* @__PURE__ */ React61.createElement("div", null, /* @__PURE__ */ React61.createElement(PressResponder2, __spreadValues({
6401
- ref: triggerRef,
6402
- onPress: () => state.toggle()
6403
- }, menuTriggerProps), /* @__PURE__ */ React61.createElement(TriggerWrapper, null, trigger.props.children)), state.isOpen && /* @__PURE__ */ React61.createElement(PopoverOverlay, {
6404
- triggerRef,
6405
- state,
6406
- placement,
6407
- focusable: false
6408
- }, /* @__PURE__ */ React61.createElement(MenuWrapper, __spreadValues({
6409
- onAction,
6410
- selectionMode,
6411
- selection,
6412
- onSelectionChange,
6413
- searchable,
6414
- emptyState,
6415
- minWidth,
6416
- maxWidth,
6417
- header,
6418
- footer
6419
- }, menuProps), items.props.children)));
6391
+ // src/molecules/Dropdown/Dropdown.tsx
6392
+ import React61 from "react";
6393
+
6394
+ // src/molecules/Popover/Popover.tsx
6395
+ import React60, { useRef as useRef7 } from "react";
6396
+ import { PressResponder as PressResponder2, usePress as usePress2 } from "@react-aria/interactions";
6397
+ import { useOverlayTrigger } from "@react-aria/overlays";
6398
+ import { mergeProps as mergeProps3 } from "@react-aria/utils";
6399
+ import { useOverlayTriggerState as useOverlayTriggerState3 } from "@react-stately/overlays";
6400
+
6401
+ // src/molecules/Popover/Dialog.tsx
6402
+ import React59 from "react";
6403
+ import { useDialog as useDialog2 } from "@react-aria/dialog";
6404
+ var Dialog2 = ({ children }) => {
6405
+ const ref = React59.useRef(null);
6406
+ const { dialogProps } = useDialog2({}, ref);
6407
+ return /* @__PURE__ */ React59.createElement("div", __spreadProps(__spreadValues({
6408
+ ref
6409
+ }, dialogProps), {
6410
+ className: tw("outline-none")
6411
+ }), children);
6420
6412
  };
6421
- var MenuTrigger = () => null;
6422
- var MenuItems = () => null;
6423
- DropdownMenu3.Trigger = MenuTrigger;
6424
- DropdownMenu3.Trigger.displayName = "DropdownMenu.Trigger";
6425
- DropdownMenu3.Items = MenuItems;
6426
- DropdownMenu3.Items.displayName = "DropdownMenu.Items";
6427
- DropdownMenu3.Item = Item4;
6428
- DropdownMenu3.Item.displayName = "DropdownMenu.Item";
6429
- DropdownMenu3.Section = Section;
6430
- DropdownMenu3.Section.displayName = "DropdownMenu.Section";
6431
- var TriggerWrapper = (_a) => {
6432
- var _b = _a, { children } = _b, props = __objRest(_b, ["children"]);
6433
- const ref = React61.useRef(null);
6434
- const { pressProps } = usePress2(__spreadProps(__spreadValues({}, props), { ref }));
6435
- const trigger = React61.Children.only(children);
6436
- if (!trigger || !React61.isValidElement(trigger)) {
6437
- throw new Error("<DropdownMenu.Trigger> must have valid child");
6413
+
6414
+ // src/molecules/Popover/PopoverContext.tsx
6415
+ import { createContext, useContext as useContext2 } from "react";
6416
+ var PopoverContext = createContext(null);
6417
+ var usePopoverContext = () => {
6418
+ const ctx = useContext2(PopoverContext);
6419
+ if (ctx === null) {
6420
+ throw new Error("PopoverContext was used outside of provider.");
6438
6421
  }
6439
- return React61.cloneElement(trigger, __spreadValues({ ref }, mergeProps3(pressProps, props)));
6422
+ return ctx;
6440
6423
  };
6441
- var isSectionNode = (item) => item.type === "section";
6442
- var isItemNode = (item) => item.type === "item";
6443
- var MenuWrapper = (_a) => {
6444
- var _b = _a, {
6445
- selection: selectedKeys,
6446
- minWidth,
6447
- maxWidth,
6448
- searchable,
6449
- emptyState,
6450
- header,
6451
- footer
6452
- } = _b, props = __objRest(_b, [
6453
- "selection",
6454
- "minWidth",
6455
- "maxWidth",
6456
- "searchable",
6457
- "emptyState",
6458
- "header",
6459
- "footer"
6460
- ]);
6461
- const ref = React61.useRef(null);
6462
- const disabledKeys = getDisabledItemKeys(props.children);
6463
- const state = useTreeState(__spreadValues({
6464
- disabledKeys,
6465
- selectedKeys
6466
- }, props));
6467
- const { menuProps } = useMenu(props, state, ref);
6468
- const { contains } = useFilter({ sensitivity: "base" });
6469
- const [search, setSearch] = React61.useState("");
6470
- const filteredCollection = React61.useMemo(
6471
- () => searchable ? filterCollection(state.collection, search, contains) : state.collection,
6472
- [state.collection, search, contains]
6473
- );
6474
- return /* @__PURE__ */ React61.createElement(DropdownMenu2, {
6475
- minWidth: minWidth !== void 0 ? `${minWidth}px` : void 0,
6476
- maxWidth: maxWidth !== void 0 ? `${maxWidth}px` : void 0
6477
- }, header, /* @__PURE__ */ React61.createElement(DropdownMenu2.ContentContainer, null, searchable && /* @__PURE__ */ React61.createElement(SearchInput, {
6478
- "aria-label": "search",
6479
- value: search,
6480
- onChange: (e) => setSearch(e.target.value),
6481
- className: tw("mb-5")
6482
- }), filteredCollection.size === 0 && emptyState && /* @__PURE__ */ React61.createElement(DropdownMenu2.EmptyStateContainer, null, emptyState), /* @__PURE__ */ React61.createElement(DropdownMenu2.List, __spreadValues({
6483
- ref
6484
- }, menuProps), Array.from(filteredCollection).map((item) => {
6485
- if (isSectionNode(item)) {
6486
- return /* @__PURE__ */ React61.createElement(SectionWrapper, {
6487
- key: item.key,
6488
- section: item,
6489
- state
6490
- });
6491
- } else if (isItemNode(item)) {
6492
- return /* @__PURE__ */ React61.createElement(ItemWrapper, {
6493
- key: item.key,
6494
- item,
6495
- state
6496
- });
6424
+
6425
+ // src/molecules/Popover/Popover.tsx
6426
+ var Popover2 = (props) => {
6427
+ const {
6428
+ id,
6429
+ type,
6430
+ placement = "bottom-left",
6431
+ containFocus = true,
6432
+ isKeyboardDismissDisabled = false,
6433
+ targetRef,
6434
+ offset,
6435
+ crossOffset,
6436
+ shouldFlip
6437
+ } = props;
6438
+ const triggerRef = useRef7(null);
6439
+ const state = useOverlayTriggerState3(props);
6440
+ const { triggerProps, overlayProps } = useOverlayTrigger({ type: type != null ? type : "dialog" }, state, triggerRef);
6441
+ return /* @__PURE__ */ React60.createElement(PopoverContext.Provider, {
6442
+ value: {
6443
+ state
6497
6444
  }
6498
- }))), footer);
6445
+ }, React60.Children.map(props.children, (child) => {
6446
+ if (isComponentType(child, Popover2.Trigger)) {
6447
+ return /* @__PURE__ */ React60.createElement(PressResponder2, __spreadValues({
6448
+ ref: triggerRef
6449
+ }, triggerProps), /* @__PURE__ */ React60.createElement(PopoverTriggerWrapper, {
6450
+ "data-testid": props["data-testid"],
6451
+ "aria-controls": id
6452
+ }, child.props.children));
6453
+ }
6454
+ if (isComponentType(child, Popover2.Panel)) {
6455
+ return state.isOpen && /* @__PURE__ */ React60.createElement(PopoverOverlay, __spreadValues({
6456
+ triggerRef: targetRef != null ? targetRef : triggerRef,
6457
+ state,
6458
+ placement,
6459
+ isNonModal: !containFocus,
6460
+ autoFocus: !containFocus,
6461
+ isKeyboardDismissDisabled,
6462
+ className: child.props.className,
6463
+ offset,
6464
+ crossOffset,
6465
+ shouldFlip
6466
+ }, overlayProps), containFocus ? /* @__PURE__ */ React60.createElement(Dialog2, null, child.props.children) : child.props.children);
6467
+ }
6468
+ throw new Error("Invalid children element type");
6469
+ }));
6470
+ };
6471
+ var Trigger = () => null;
6472
+ Trigger.displayName = "Popover.Trigger";
6473
+ Popover2.Trigger = Trigger;
6474
+ var Panel = () => null;
6475
+ Panel.displayName = "Popover.Panel";
6476
+ Popover2.Panel = Panel;
6477
+ var asPopoverButton = (Component, displayName) => {
6478
+ const PopoverButton2 = (props) => {
6479
+ const { onClick } = props;
6480
+ const { state } = usePopoverContext();
6481
+ const handleClick = (e) => {
6482
+ state.close();
6483
+ onClick == null ? void 0 : onClick(e);
6484
+ };
6485
+ return /* @__PURE__ */ React60.createElement(Component, __spreadProps(__spreadValues({}, props), {
6486
+ onClick: handleClick
6487
+ }));
6488
+ };
6489
+ PopoverButton2.displayName = displayName;
6490
+ return PopoverButton2;
6499
6491
  };
6500
- var ItemWrapper = ({ item, state }) => {
6501
- const ref = React61.useRef(null);
6502
- const { menuItemProps, descriptionProps, isSelected, isFocused, isDisabled } = useMenuItem(
6503
- { key: item.key, closeOnSelect: item.props.closeOnSelect },
6504
- state,
6505
- ref
6506
- );
6507
- const { icon, description, kind = "default" } = item.props;
6508
- return /* @__PURE__ */ React61.createElement(DropdownMenu2.Item, __spreadProps(__spreadValues({
6509
- ref
6510
- }, menuItemProps), {
6511
- kind,
6512
- selected: isSelected,
6513
- highlighted: isFocused,
6514
- disabled: isDisabled,
6515
- icon
6516
- }), item.rendered, description && /* @__PURE__ */ React61.createElement(DropdownMenu2.Description, __spreadValues({
6517
- disabled: isDisabled
6518
- }, descriptionProps), description));
6492
+ var PopoverButton = asPopoverButton(Button, "PopoverButton");
6493
+ Popover2.Button = PopoverButton;
6494
+ var PopoverTriggerWrapper = (_a) => {
6495
+ var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
6496
+ var _a2;
6497
+ const ref = useRef7(null);
6498
+ const trigger = React60.Children.only(children);
6499
+ const { pressProps } = usePress2(__spreadProps(__spreadValues({}, rest), { ref }));
6500
+ return React60.cloneElement(trigger, __spreadProps(__spreadValues({
6501
+ "ref": ref
6502
+ }, mergeProps3(pressProps, trigger.props)), {
6503
+ "aria-controls": (_a2 = rest["aria-controls"]) != null ? _a2 : pressProps["aria-controls"]
6504
+ }));
6519
6505
  };
6520
- var SectionWrapper = ({ section, state }) => {
6521
- const { itemProps, headingProps, groupProps } = useMenuSection({
6522
- "heading": section.rendered,
6523
- "aria-label": section["aria-label"]
6524
- });
6525
- const { separatorProps } = useSeparator({
6526
- elementType: "li"
6527
- });
6528
- return /* @__PURE__ */ React61.createElement(React61.Fragment, null, section.key !== state.collection.getFirstKey() && /* @__PURE__ */ React61.createElement(DropdownMenu2.Separator, __spreadValues({}, separatorProps)), /* @__PURE__ */ React61.createElement(DropdownMenu2.Group, __spreadValues({
6529
- title: section.rendered,
6530
- titleProps: headingProps
6531
- }, itemProps), /* @__PURE__ */ React61.createElement("ul", __spreadValues({}, groupProps), Array.from(section.childNodes).map((node) => /* @__PURE__ */ React61.createElement(ItemWrapper, {
6532
- key: node.key,
6533
- item: node,
6534
- state
6535
- })))));
6506
+
6507
+ // src/molecules/Dropdown/Dropdown.tsx
6508
+ var Dropdown = ({ children, content, placement = "bottom-left" }) => {
6509
+ return /* @__PURE__ */ React61.createElement(Popover2, {
6510
+ type: "menu",
6511
+ placement
6512
+ }, /* @__PURE__ */ React61.createElement(Popover2.Trigger, null, children), /* @__PURE__ */ React61.createElement(Popover2.Panel, null, content));
6536
6513
  };
6537
- var extractTriggerAndItems = (children) => {
6538
- const [trigger, items] = React61.Children.toArray(children);
6539
- if (!isComponentType(trigger, MenuTrigger) || !isComponentType(items, MenuItems)) {
6540
- throw new Error("<DropdownMenu> must have <DropdownMenu.Trigger> and <DropdownMenu.Items> defined");
6541
- }
6542
- return [trigger, items];
6514
+ var DropdownMenu3 = ({
6515
+ title,
6516
+ children,
6517
+ contentId,
6518
+ triggerId,
6519
+ setClose = () => void 0
6520
+ }) => {
6521
+ const menuRef = React61.useRef(null);
6522
+ React61.useEffect(() => {
6523
+ const id = setTimeout(() => {
6524
+ var _a, _b, _c;
6525
+ return (_c = (_b = (_a = menuRef.current) == null ? void 0 : _a.children) == null ? void 0 : _b[0]) == null ? void 0 : _c.focus();
6526
+ });
6527
+ return () => clearTimeout(id);
6528
+ }, [menuRef.current]);
6529
+ return /* @__PURE__ */ React61.createElement("div", {
6530
+ style: { minWidth: "250px" },
6531
+ className: tw("py-3 bg-white")
6532
+ }, !!title && /* @__PURE__ */ React61.createElement("div", {
6533
+ className: tw("px-4 py-4 text-left text-grey-100 typography-default-strong")
6534
+ }, title), /* @__PURE__ */ React61.createElement("ol", {
6535
+ role: "menu",
6536
+ ref: menuRef,
6537
+ id: contentId,
6538
+ "aria-labelledby": triggerId
6539
+ }, React61.Children.map(children, (child) => {
6540
+ return React61.cloneElement(child, { setClose });
6541
+ })));
6543
6542
  };
6544
- var getDisabledItemKeys = (children) => {
6545
- const keys = React61.Children.map(children, (child) => {
6546
- var _a, _b;
6547
- if (!child || typeof child === "function") {
6548
- return null;
6549
- }
6550
- if (isComponentType(child, Item4) && child.props.disabled) {
6551
- return (_b = (_a = child.key) == null ? void 0 : _a.toString()) != null ? _b : null;
6543
+ var DropdownItem = (_a) => {
6544
+ var _b = _a, {
6545
+ children,
6546
+ disabled = false,
6547
+ tooltip,
6548
+ tooltipPlacement,
6549
+ color = "default",
6550
+ onSelect,
6551
+ setClose = () => void 0
6552
+ } = _b, props = __objRest(_b, [
6553
+ "children",
6554
+ "disabled",
6555
+ "tooltip",
6556
+ "tooltipPlacement",
6557
+ "color",
6558
+ "onSelect",
6559
+ "setClose"
6560
+ ]);
6561
+ const { state } = usePopoverContext();
6562
+ const handleSelect = () => {
6563
+ onSelect == null ? void 0 : onSelect();
6564
+ state.close();
6565
+ setClose();
6566
+ };
6567
+ const handleKeyDown = (event) => {
6568
+ const target = event.target;
6569
+ const parent = target.parentElement;
6570
+ const first = parent.firstChild;
6571
+ const last = parent.lastChild;
6572
+ const next = target.nextElementSibling;
6573
+ const prev = target.previousElementSibling;
6574
+ if (event.key === "ArrowUp") {
6575
+ prev ? prev.focus() : last.focus();
6576
+ } else if (event.key === "ArrowDown") {
6577
+ next ? next.focus() : first.focus();
6578
+ } else if (event.key === "Tab") {
6579
+ event.preventDefault();
6580
+ event.stopPropagation();
6581
+ } else if (event.key === "Home" || event.key === "PageUp") {
6582
+ first.focus();
6583
+ } else if (event.key === "End" || event.key === "PageDown") {
6584
+ last.focus();
6585
+ } else if (event.key === "Enter") {
6586
+ !disabled && handleSelect();
6552
6587
  }
6553
- if (isComponentType(child, Section)) {
6554
- return getDisabledItemKeys(child.props.children);
6588
+ };
6589
+ const handleClick = (e) => {
6590
+ e.stopPropagation();
6591
+ if (!disabled) {
6592
+ handleSelect();
6555
6593
  }
6556
- return null;
6557
- });
6558
- return keys.flat().filter((key) => key !== null);
6594
+ };
6595
+ const itemContent = /* @__PURE__ */ React61.createElement("div", {
6596
+ className: tw("py-3 px-4")
6597
+ }, children);
6598
+ return /* @__PURE__ */ React61.createElement("li", __spreadProps(__spreadValues({
6599
+ role: "menuitem",
6600
+ tabIndex: -1,
6601
+ onClick: handleClick,
6602
+ onKeyDown: handleKeyDown
6603
+ }, props), {
6604
+ className: tw("typography-small flex items-center focus:ring-0", {
6605
+ "text-grey-70 cursor-pointer hover:bg-grey-0": !disabled,
6606
+ "text-grey-10 cursor-not-allowed": disabled,
6607
+ "text-primary-70 hover:text-primary-80": color === "danger" && !disabled
6608
+ })
6609
+ }), tooltip ? /* @__PURE__ */ React61.createElement(Tooltip, {
6610
+ content: tooltip,
6611
+ placement: tooltipPlacement,
6612
+ inline: false
6613
+ }, /* @__PURE__ */ React61.createElement("div", {
6614
+ tabIndex: 0,
6615
+ className: tw("grow")
6616
+ }, itemContent)) : itemContent);
6559
6617
  };
6618
+ Dropdown.Menu = DropdownMenu3;
6619
+ Dropdown.Item = DropdownItem;
6560
6620
 
6561
6621
  // src/molecules/EmptyState/EmptyState.tsx
6562
6622
  import React63 from "react";
@@ -6772,7 +6832,7 @@ var Link2 = (props) => /* @__PURE__ */ React67.createElement(Link, __spreadValue
6772
6832
 
6773
6833
  // src/molecules/List/List.tsx
6774
6834
  import React68 from "react";
6775
- var List = ({ items, renderItem, container = React68.Fragment }) => {
6835
+ var List2 = ({ items, renderItem, container = React68.Fragment }) => {
6776
6836
  const Component = container;
6777
6837
  return /* @__PURE__ */ React68.createElement(Component, null, items.map(renderItem));
6778
6838
  };
@@ -7762,12 +7822,140 @@ var NativeSelectSkeleton = () => /* @__PURE__ */ React75.createElement(LabelCont
7762
7822
  NativeSelect.Skeleton = NativeSelectSkeleton;
7763
7823
  NativeSelect.Skeleton.displayName = "NativeSelect.Skeleton";
7764
7824
 
7765
- // src/molecules/PageHeader/PageHeader.tsx
7825
+ // src/molecules/Navigation/Navigation.tsx
7826
+ import React77 from "react";
7827
+
7828
+ // src/atoms/Navigation/Navigation.tsx
7766
7829
  import React76 from "react";
7830
+ var Navigation = (_a) => {
7831
+ var _b = _a, { className, children } = _b, rest = __objRest(_b, ["className", "children"]);
7832
+ return /* @__PURE__ */ React76.createElement("nav", {
7833
+ className: classNames(tw("bg-grey-0 h-full"))
7834
+ }, /* @__PURE__ */ React76.createElement("ul", __spreadProps(__spreadValues({}, rest), {
7835
+ className: classNames(tw("flex flex-col h-full"), className),
7836
+ role: "menu"
7837
+ }), children));
7838
+ };
7839
+ var Header = (_a) => {
7840
+ var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
7841
+ return /* @__PURE__ */ React76.createElement("li", __spreadProps(__spreadValues({}, rest), {
7842
+ role: "presentation",
7843
+ className: classNames(tw("px-6 py-5"), className)
7844
+ }));
7845
+ };
7846
+ var Footer = (_a) => {
7847
+ var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
7848
+ return /* @__PURE__ */ React76.createElement("li", __spreadProps(__spreadValues({}, rest), {
7849
+ role: "presentation",
7850
+ className: classNames(tw("px-6 py-5 mt-auto"), className)
7851
+ }));
7852
+ };
7853
+ var Section2 = (_a) => {
7854
+ var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
7855
+ return /* @__PURE__ */ React76.createElement("li", {
7856
+ role: "presentation"
7857
+ }, /* @__PURE__ */ React76.createElement("ul", __spreadProps(__spreadValues({}, rest), {
7858
+ role: "group",
7859
+ className: classNames(tw(" py-5 flex flex-col"), className)
7860
+ })));
7861
+ };
7862
+ var Divider3 = (_a) => {
7863
+ var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
7864
+ return /* @__PURE__ */ React76.createElement("li", __spreadProps(__spreadValues({
7865
+ role: "separator"
7866
+ }, rest), {
7867
+ className: classNames(tw("border-t-2 border-grey-5"), className)
7868
+ }));
7869
+ };
7870
+ var Item5 = (_a) => {
7871
+ var _b = _a, { className, active } = _b, rest = __objRest(_b, ["className", "active"]);
7872
+ return /* @__PURE__ */ React76.createElement("li", {
7873
+ role: "presentation"
7874
+ }, /* @__PURE__ */ React76.createElement("a", __spreadProps(__spreadValues({}, rest), {
7875
+ role: "menuitem",
7876
+ className: classNames(
7877
+ tw("py-3 px-6 hover:bg-grey-5 cursor-pointer flex gap-4 items-center typography-small focusable", {
7878
+ "text-grey-60": !active,
7879
+ "text-primary-80": !!active
7880
+ }),
7881
+ className
7882
+ )
7883
+ })));
7884
+ };
7885
+ Navigation.Header = Header;
7886
+ Navigation.Footer = Footer;
7887
+ Navigation.Section = Section2;
7888
+ Navigation.Item = Item5;
7889
+ Navigation.Divider = Divider3;
7890
+
7891
+ // src/molecules/Navigation/Navigation.tsx
7892
+ var Navigation2 = (props) => /* @__PURE__ */ React77.createElement(Navigation, __spreadValues({}, props));
7893
+ var Item6 = (_a) => {
7894
+ var _b = _a, { children, icon } = _b, rest = __objRest(_b, ["children", "icon"]);
7895
+ return /* @__PURE__ */ React77.createElement(Navigation.Item, __spreadValues({}, rest), icon && /* @__PURE__ */ React77.createElement(InlineIcon, {
7896
+ icon
7897
+ }), children);
7898
+ };
7899
+ Navigation2.Item = Item6;
7900
+ Navigation2.Divider = Navigation.Divider;
7901
+ Navigation2.Footer = Navigation.Footer;
7902
+ Navigation2.Header = Navigation.Header;
7903
+ Navigation2.Section = Navigation.Section;
7904
+
7905
+ // src/molecules/PageHeader/PageHeader.tsx
7906
+ import React79 from "react";
7767
7907
  import castArray3 from "lodash/castArray";
7768
7908
  import omit14 from "lodash/omit";
7769
- var PageHeader = ({
7909
+
7910
+ // src/atoms/PageHeader/PageHeader.tsx
7911
+ import React78 from "react";
7912
+ var PageHeader = (_a) => {
7913
+ var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
7914
+ return /* @__PURE__ */ React78.createElement("div", __spreadValues({
7915
+ className: classNames(tw("flex flex-row gap-4 pb-6"), className)
7916
+ }, rest), children);
7917
+ };
7918
+ PageHeader.Container = (_a) => {
7919
+ var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
7920
+ return /* @__PURE__ */ React78.createElement("div", __spreadValues({
7921
+ className: classNames(tw("flex flex-col grow gap-0"), className)
7922
+ }, rest), children);
7923
+ };
7924
+ PageHeader.TitleContainer = (_a) => {
7925
+ var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
7926
+ return /* @__PURE__ */ React78.createElement("div", __spreadValues({
7927
+ className: classNames(tw("flex flex-col justify-center gap-2"), className)
7928
+ }, rest), children);
7929
+ };
7930
+ PageHeader.Title = (_a) => {
7931
+ var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
7932
+ return /* @__PURE__ */ React78.createElement(Typography2.Heading, __spreadProps(__spreadValues({}, rest), {
7933
+ color: "grey-100"
7934
+ }), children);
7935
+ };
7936
+ PageHeader.Subtitle = (_a) => {
7937
+ var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
7938
+ return /* @__PURE__ */ React78.createElement(Typography2.Small, __spreadProps(__spreadValues({}, rest), {
7939
+ color: "grey-70"
7940
+ }), children);
7941
+ };
7942
+ PageHeader.Chips = (_a) => {
7943
+ var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
7944
+ return /* @__PURE__ */ React78.createElement("div", __spreadValues({
7945
+ className: classNames(tw("flex gap-3"), className)
7946
+ }, rest), children);
7947
+ };
7948
+ PageHeader.Actions = (_a) => {
7949
+ var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
7950
+ return /* @__PURE__ */ React78.createElement("div", __spreadValues({
7951
+ className: classNames(tw("flex flex-row gap-4 self-start"), className)
7952
+ }, rest), children);
7953
+ };
7954
+
7955
+ // src/molecules/PageHeader/PageHeader.tsx
7956
+ var PageHeader2 = ({
7770
7957
  title,
7958
+ subtitle,
7771
7959
  image,
7772
7960
  imageAlt,
7773
7961
  primaryAction,
@@ -7775,48 +7963,32 @@ var PageHeader = ({
7775
7963
  chips = [],
7776
7964
  breadcrumbs
7777
7965
  }) => {
7778
- return /* @__PURE__ */ React76.createElement(Flexbox, {
7779
- direction: "row",
7780
- gap: "4",
7781
- paddingBottom: "6"
7782
- }, /* @__PURE__ */ React76.createElement(Flexbox, {
7783
- className: tw("grow"),
7784
- direction: "column",
7785
- gap: "0"
7786
- }, breadcrumbs && /* @__PURE__ */ React76.createElement(Breadcrumbs, null, breadcrumbs), /* @__PURE__ */ React76.createElement(Flexbox, {
7966
+ return /* @__PURE__ */ React79.createElement(PageHeader, null, /* @__PURE__ */ React79.createElement(PageHeader.Container, null, breadcrumbs && /* @__PURE__ */ React79.createElement(Breadcrumbs, null, breadcrumbs), /* @__PURE__ */ React79.createElement(Flexbox, {
7787
7967
  gap: "5"
7788
- }, image && /* @__PURE__ */ React76.createElement("img", {
7968
+ }, image && /* @__PURE__ */ React79.createElement("img", {
7789
7969
  src: image,
7790
7970
  alt: imageAlt,
7791
7971
  className: tw("w-[56px] h-[56px]")
7792
- }), /* @__PURE__ */ React76.createElement(Flexbox, {
7793
- direction: "column",
7794
- justifyContent: "center"
7795
- }, /* @__PURE__ */ React76.createElement(Typography2.Heading, null, title), chips.length > 0 && /* @__PURE__ */ React76.createElement(Flexbox, {
7796
- gap: "3"
7797
- }, chips.map((chip) => /* @__PURE__ */ React76.createElement(Chip2, {
7972
+ }), /* @__PURE__ */ React79.createElement(PageHeader.TitleContainer, null, /* @__PURE__ */ React79.createElement(PageHeader.Title, null, title), chips.length > 0 && /* @__PURE__ */ React79.createElement(PageHeader.Chips, null, chips.map((chip) => /* @__PURE__ */ React79.createElement(Chip2, {
7798
7973
  key: chip,
7799
7974
  dense: true,
7800
7975
  text: chip
7801
- })))))), (secondaryActions || primaryAction) && /* @__PURE__ */ React76.createElement(Flexbox, {
7802
- gap: "4",
7803
- className: tw("self-start")
7804
- }, secondaryActions && castArray3(secondaryActions).filter(Boolean).map((_a) => {
7976
+ }))), subtitle && /* @__PURE__ */ React79.createElement(PageHeader.Subtitle, null, subtitle)))), (secondaryActions || primaryAction) && /* @__PURE__ */ React79.createElement(PageHeader.Actions, null, secondaryActions && castArray3(secondaryActions).filter(Boolean).map((_a) => {
7805
7977
  var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
7806
- return /* @__PURE__ */ React76.createElement(SecondaryButton, __spreadValues({
7978
+ return /* @__PURE__ */ React79.createElement(SecondaryButton, __spreadValues({
7807
7979
  key: text
7808
7980
  }, action), text);
7809
- }), primaryAction && /* @__PURE__ */ React76.createElement(PrimaryButton, __spreadValues({
7981
+ }), primaryAction && /* @__PURE__ */ React79.createElement(PrimaryButton, __spreadValues({
7810
7982
  key: primaryAction.text
7811
7983
  }, omit14(primaryAction, "text")), primaryAction.text)));
7812
7984
  };
7813
7985
 
7814
7986
  // src/molecules/Pagination/Pagination.tsx
7815
- import React78 from "react";
7987
+ import React81 from "react";
7816
7988
  import clamp from "lodash/clamp";
7817
7989
 
7818
7990
  // src/molecules/Select/Select.tsx
7819
- import React77, { useRef as useRef12, useState as useState10 } from "react";
7991
+ import React80, { useRef as useRef12, useState as useState10 } from "react";
7820
7992
  import { useSelect } from "downshift";
7821
7993
  import defaults from "lodash/defaults";
7822
7994
  import isArray from "lodash/isArray";
@@ -7832,10 +8004,10 @@ var hasOptionGroups = (val) => {
7832
8004
  };
7833
8005
  var defaultRenderOption = (item, props, { selectedItem }, { getOptionKey, getValue, optionToString = getOptionLabelBuiltin }) => {
7834
8006
  var _a, _b;
7835
- return /* @__PURE__ */ React77.createElement(Select.Item, __spreadValues({
8007
+ return /* @__PURE__ */ React80.createElement(Select.Item, __spreadValues({
7836
8008
  key: (_b = (_a = getOptionKey == null ? void 0 : getOptionKey(item)) != null ? _a : getValue == null ? void 0 : getValue(item)) != null ? _b : optionToString(item),
7837
8009
  selected: item === selectedItem
7838
- }, props), hasIconProperty(item) && /* @__PURE__ */ React77.createElement(InlineIcon, {
8010
+ }, props), hasIconProperty(item) && /* @__PURE__ */ React80.createElement(InlineIcon, {
7839
8011
  icon: item.icon
7840
8012
  }), optionToString(item));
7841
8013
  };
@@ -7954,13 +8126,13 @@ var _SelectBase = (props) => {
7954
8126
  },
7955
8127
  withDefaults
7956
8128
  );
7957
- const renderGroup = (group) => /* @__PURE__ */ React77.createElement(React77.Fragment, {
8129
+ const renderGroup = (group) => /* @__PURE__ */ React80.createElement(React80.Fragment, {
7958
8130
  key: group.label
7959
- }, /* @__PURE__ */ React77.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, items.indexOf(opt))));
7960
- const input = /* @__PURE__ */ React77.createElement(Select.InputContainer, __spreadProps(__spreadValues({}, getToggleButtonProps({ disabled: disabled || readOnly, ref: targetRef })), {
8131
+ }, /* @__PURE__ */ React80.createElement(Select.Group, null, group.label), group.options.map((opt) => renderItem(opt, items.indexOf(opt))));
8132
+ const input = /* @__PURE__ */ React80.createElement(Select.InputContainer, __spreadProps(__spreadValues({}, getToggleButtonProps({ disabled: disabled || readOnly, ref: targetRef })), {
7961
8133
  variant: disabled ? "disabled" : !valid ? "error" : readOnly ? "readOnly" : hasFocus ? "focused" : "default",
7962
8134
  tabIndex: 0
7963
- }), /* @__PURE__ */ React77.createElement(Select.Input, __spreadProps(__spreadValues({
8135
+ }), /* @__PURE__ */ React80.createElement(Select.Input, __spreadProps(__spreadValues({
7964
8136
  id,
7965
8137
  name
7966
8138
  }, rest), {
@@ -7972,26 +8144,26 @@ var _SelectBase = (props) => {
7972
8144
  tabIndex: -1,
7973
8145
  onFocus: () => setFocus(true),
7974
8146
  onBlur: () => setFocus(false)
7975
- })), !readOnly && /* @__PURE__ */ React77.createElement(Select.Toggle, {
8147
+ })), !readOnly && /* @__PURE__ */ React80.createElement(Select.Toggle, {
7976
8148
  disabled,
7977
8149
  isOpen,
7978
8150
  tabIndex: -1
7979
8151
  }));
7980
8152
  const menuProps = getMenuProps({ ref: menuRef }, { suppressRefError: !isOpen });
7981
- return /* @__PURE__ */ React77.createElement("div", {
8153
+ return /* @__PURE__ */ React80.createElement("div", {
7982
8154
  className: tw("relative")
7983
- }, labelWrapper ? React77.cloneElement(labelWrapper, { children: input }) : input, isOpen && /* @__PURE__ */ React77.createElement(PopoverOverlay, {
8155
+ }, labelWrapper ? React80.cloneElement(labelWrapper, { children: input }) : input, isOpen && /* @__PURE__ */ React80.createElement(PopoverOverlay, {
7984
8156
  state,
7985
8157
  triggerRef: targetRef,
7986
8158
  placement: "bottom-left",
7987
8159
  shouldFlip: true,
7988
8160
  style: { width: (_b = targetRef.current) == null ? void 0 : _b.offsetWidth }
7989
- }, /* @__PURE__ */ React77.createElement(Select.Menu, __spreadValues({
8161
+ }, /* @__PURE__ */ React80.createElement(Select.Menu, __spreadValues({
7990
8162
  ref: menuRef,
7991
8163
  maxHeight
7992
- }, menuProps), options.length === 0 && /* @__PURE__ */ React77.createElement(Select.EmptyStateContainer, null, emptyState), options.length > 0 && !hasOptionGroups(options) && options.map(renderItem), options.length > 0 && hasOptionGroups(options) && options.map(renderGroup), actions.length > 0 && /* @__PURE__ */ React77.createElement(React77.Fragment, null, /* @__PURE__ */ React77.createElement(Select.Divider, {
8164
+ }, menuProps), options.length === 0 && /* @__PURE__ */ React80.createElement(Select.EmptyStateContainer, null, emptyState), options.length > 0 && !hasOptionGroups(options) && options.map(renderItem), options.length > 0 && hasOptionGroups(options) && options.map(renderGroup), actions.length > 0 && /* @__PURE__ */ React80.createElement(React80.Fragment, null, /* @__PURE__ */ React80.createElement(Select.Divider, {
7993
8165
  onMouseOver: () => setHighlightedIndex(-1)
7994
- }), actions.map((act, index) => /* @__PURE__ */ React77.createElement(Select.ActionItem, __spreadProps(__spreadValues({
8166
+ }), actions.map((act, index) => /* @__PURE__ */ React80.createElement(Select.ActionItem, __spreadProps(__spreadValues({
7995
8167
  key: `${index}`
7996
8168
  }, act), {
7997
8169
  onMouseOver: () => setHighlightedIndex(-1),
@@ -8001,10 +8173,10 @@ var _SelectBase = (props) => {
8001
8173
  }
8002
8174
  }), act.label))))));
8003
8175
  };
8004
- var SelectBase = (props) => /* @__PURE__ */ React77.createElement(_SelectBase, __spreadProps(__spreadValues({}, props), {
8176
+ var SelectBase = (props) => /* @__PURE__ */ React80.createElement(_SelectBase, __spreadProps(__spreadValues({}, props), {
8005
8177
  labelWrapper: void 0
8006
8178
  }));
8007
- var SelectBaseSkeleton = () => /* @__PURE__ */ React77.createElement(Skeleton, {
8179
+ var SelectBaseSkeleton = () => /* @__PURE__ */ React80.createElement(Skeleton, {
8008
8180
  height: 38
8009
8181
  });
8010
8182
  SelectBase.Skeleton = SelectBaseSkeleton;
@@ -8022,19 +8194,19 @@ var Select2 = (_a) => {
8022
8194
  const baseProps = omit15(props, Object.keys(labelProps));
8023
8195
  const legacyError = labelProps.error !== void 0 && labelProps.valid === false;
8024
8196
  const variant = !labelProps.valid || legacyError ? "error" : labelProps.disabled ? "disabled" : "default";
8025
- const label = /* @__PURE__ */ React77.createElement(Label, __spreadValues({
8197
+ const label = /* @__PURE__ */ React80.createElement(Label, __spreadValues({
8026
8198
  id: `${id.current}-label`,
8027
8199
  htmlFor: `${id.current}-input`,
8028
8200
  variant,
8029
8201
  messageId: errorMessageId
8030
8202
  }, labelProps));
8031
- return /* @__PURE__ */ React77.createElement(FormControl, null, /* @__PURE__ */ React77.createElement(_SelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
8203
+ return /* @__PURE__ */ React80.createElement(FormControl, null, /* @__PURE__ */ React80.createElement(_SelectBase, __spreadProps(__spreadValues(__spreadValues({}, baseProps), errorProps), {
8032
8204
  id: `${id.current}-input`,
8033
8205
  options,
8034
8206
  disabled: props.disabled,
8035
8207
  valid: props.valid,
8036
8208
  labelWrapper: label
8037
- })), /* @__PURE__ */ React77.createElement(HelperText, {
8209
+ })), /* @__PURE__ */ React80.createElement(HelperText, {
8038
8210
  messageId: errorMessageId,
8039
8211
  error: !labelProps.valid,
8040
8212
  helperText: labelProps.helperText,
@@ -8043,7 +8215,7 @@ var Select2 = (_a) => {
8043
8215
  reserveSpaceForError: labelProps.reserveSpaceForError
8044
8216
  }));
8045
8217
  };
8046
- var SelectSkeleton = () => /* @__PURE__ */ React77.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React77.createElement(SelectBase.Skeleton, null));
8218
+ var SelectSkeleton = () => /* @__PURE__ */ React80.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React80.createElement(SelectBase.Skeleton, null));
8047
8219
  Select2.Skeleton = SelectSkeleton;
8048
8220
  Select2.Skeleton.displayName = "Select.Skeleton";
8049
8221
 
@@ -8062,23 +8234,23 @@ var Pagination = ({
8062
8234
  pageSizes,
8063
8235
  onPageSizeChange
8064
8236
  }) => {
8065
- const [value, setValue] = React78.useState(currentPage);
8066
- React78.useEffect(() => {
8237
+ const [value, setValue] = React81.useState(currentPage);
8238
+ React81.useEffect(() => {
8067
8239
  setValue(currentPage);
8068
8240
  }, [currentPage]);
8069
- return /* @__PURE__ */ React78.createElement(Box, {
8241
+ return /* @__PURE__ */ React81.createElement(Box, {
8070
8242
  className: tw("grid grid-cols-[200px_1fr_200px]"),
8071
8243
  backgroundColor: "grey-0",
8072
8244
  padding: "4"
8073
- }, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */ React78.createElement(Box, {
8245
+ }, pageSizes && onPageSizeChange && typeof pageSize === "number" ? /* @__PURE__ */ React81.createElement(Box, {
8074
8246
  display: "flex",
8075
8247
  alignItems: "center",
8076
8248
  gap: "4"
8077
- }, /* @__PURE__ */ React78.createElement(Typography2.Small, {
8249
+ }, /* @__PURE__ */ React81.createElement(Typography2.Small, {
8078
8250
  color: "grey-50"
8079
- }, "Items per page "), /* @__PURE__ */ React78.createElement("div", {
8251
+ }, "Items per page "), /* @__PURE__ */ React81.createElement("div", {
8080
8252
  className: tw("max-w-[70px]")
8081
- }, /* @__PURE__ */ React78.createElement(SelectBase, {
8253
+ }, /* @__PURE__ */ React81.createElement(SelectBase, {
8082
8254
  options: pageSizes.map((size) => size.toString()),
8083
8255
  value: pageSize.toString(),
8084
8256
  onChange: (size) => {
@@ -8089,26 +8261,26 @@ var Pagination = ({
8089
8261
  }
8090
8262
  }
8091
8263
  }
8092
- }))) : /* @__PURE__ */ React78.createElement("div", null), /* @__PURE__ */ React78.createElement(Box, {
8264
+ }))) : /* @__PURE__ */ React81.createElement("div", null), /* @__PURE__ */ React81.createElement(Box, {
8093
8265
  display: "flex",
8094
8266
  justifyContent: "center",
8095
8267
  alignItems: "center",
8096
8268
  className: tw("grow")
8097
- }, /* @__PURE__ */ React78.createElement(IconButton, {
8269
+ }, /* @__PURE__ */ React81.createElement(IconButton, {
8098
8270
  "aria-label": "First",
8099
8271
  onClick: () => onPageChange(1),
8100
8272
  icon: import_chevronBackward.default,
8101
8273
  disabled: !hasPreviousPage
8102
- }), /* @__PURE__ */ React78.createElement(IconButton, {
8274
+ }), /* @__PURE__ */ React81.createElement(IconButton, {
8103
8275
  "aria-label": "Previous",
8104
8276
  onClick: () => onPageChange(currentPage - 1),
8105
8277
  icon: import_chevronLeft3.default,
8106
8278
  disabled: !hasPreviousPage
8107
- }), /* @__PURE__ */ React78.createElement(Box, {
8279
+ }), /* @__PURE__ */ React81.createElement(Box, {
8108
8280
  paddingX: "4"
8109
- }, /* @__PURE__ */ React78.createElement(Typography2.Small, {
8281
+ }, /* @__PURE__ */ React81.createElement(Typography2.Small, {
8110
8282
  color: "grey-60"
8111
- }, "Page")), /* @__PURE__ */ React78.createElement(InputBase, {
8283
+ }, "Page")), /* @__PURE__ */ React81.createElement(InputBase, {
8112
8284
  className: classNames(tw("text-center max-w-[40px]"), "no-arrows"),
8113
8285
  type: "number",
8114
8286
  min: 1,
@@ -8125,67 +8297,67 @@ var Pagination = ({
8125
8297
  const newPage = !isNaN(numberValue) ? clamp(numberValue, 1, totalPages) : 1;
8126
8298
  onPageChange(newPage);
8127
8299
  }
8128
- }), /* @__PURE__ */ React78.createElement(Box, {
8300
+ }), /* @__PURE__ */ React81.createElement(Box, {
8129
8301
  paddingX: "4"
8130
- }, /* @__PURE__ */ React78.createElement(Typography2.Small, {
8302
+ }, /* @__PURE__ */ React81.createElement(Typography2.Small, {
8131
8303
  color: "grey-60"
8132
- }, "of ", totalPages)), /* @__PURE__ */ React78.createElement(IconButton, {
8304
+ }, "of ", totalPages)), /* @__PURE__ */ React81.createElement(IconButton, {
8133
8305
  "aria-label": "Next",
8134
8306
  onClick: () => onPageChange(currentPage + 1),
8135
8307
  icon: import_chevronRight3.default,
8136
8308
  disabled: !hasNextPage
8137
- }), /* @__PURE__ */ React78.createElement(IconButton, {
8309
+ }), /* @__PURE__ */ React81.createElement(IconButton, {
8138
8310
  "aria-label": "Last",
8139
8311
  onClick: () => onPageChange(totalPages),
8140
8312
  icon: import_chevronForward.default,
8141
8313
  disabled: !hasNextPage
8142
- })), /* @__PURE__ */ React78.createElement("div", null));
8314
+ })), /* @__PURE__ */ React81.createElement("div", null));
8143
8315
  };
8144
8316
 
8145
8317
  // src/molecules/PopoverDialog/PopoverDialog.tsx
8146
- import React80 from "react";
8318
+ import React83 from "react";
8147
8319
  import omit16 from "lodash/omit";
8148
8320
 
8149
8321
  // src/atoms/PopoverDialog/PopoverDialog.tsx
8150
- import React79 from "react";
8151
- var Header = (_a) => {
8322
+ import React82 from "react";
8323
+ var Header2 = (_a) => {
8152
8324
  var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
8153
- return /* @__PURE__ */ React79.createElement("div", __spreadProps(__spreadValues({}, rest), {
8325
+ return /* @__PURE__ */ React82.createElement("div", __spreadProps(__spreadValues({}, rest), {
8154
8326
  className: classNames(tw("p-5 gap-3 flex items-center"), className)
8155
8327
  }), children);
8156
8328
  };
8157
8329
  var Title = (_a) => {
8158
8330
  var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
8159
- return /* @__PURE__ */ React79.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
8331
+ return /* @__PURE__ */ React82.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
8160
8332
  htmlTag: "h1",
8161
8333
  variant: "small-strong"
8162
8334
  }), children);
8163
8335
  };
8164
8336
  var Body = (_a) => {
8165
8337
  var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
8166
- return /* @__PURE__ */ React79.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
8338
+ return /* @__PURE__ */ React82.createElement(Typography, __spreadProps(__spreadValues({}, rest), {
8167
8339
  htmlTag: "div",
8168
8340
  variant: "caption",
8169
8341
  className: classNames(tw("px-5 overflow-y-auto"), className)
8170
8342
  }), children);
8171
8343
  };
8172
- var Footer = (_a) => {
8344
+ var Footer2 = (_a) => {
8173
8345
  var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
8174
- return /* @__PURE__ */ React79.createElement("div", __spreadProps(__spreadValues({}, rest), {
8346
+ return /* @__PURE__ */ React82.createElement("div", __spreadProps(__spreadValues({}, rest), {
8175
8347
  className: classNames(tw("p-5"), className)
8176
8348
  }), children);
8177
8349
  };
8178
8350
  var Actions2 = (_a) => {
8179
8351
  var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
8180
- return /* @__PURE__ */ React79.createElement("div", __spreadProps(__spreadValues({}, rest), {
8352
+ return /* @__PURE__ */ React82.createElement("div", __spreadProps(__spreadValues({}, rest), {
8181
8353
  className: classNames(tw("flex gap-4"), className)
8182
8354
  }), children);
8183
8355
  };
8184
8356
  var PopoverDialog = {
8185
- Header,
8357
+ Header: Header2,
8186
8358
  Title,
8187
8359
  Body,
8188
- Footer,
8360
+ Footer: Footer2,
8189
8361
  Actions: Actions2
8190
8362
  };
8191
8363
 
@@ -8193,13 +8365,13 @@ var PopoverDialog = {
8193
8365
  var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction, children }) => {
8194
8366
  const wrapPromptWithBody = (child) => {
8195
8367
  if (isComponentType(child, PopoverDialog2.Prompt)) {
8196
- return /* @__PURE__ */ React80.createElement(Popover2.Panel, {
8368
+ return /* @__PURE__ */ React83.createElement(Popover2.Panel, {
8197
8369
  className: tw("max-w-[300px]")
8198
- }, /* @__PURE__ */ React80.createElement(PopoverDialog.Header, null, /* @__PURE__ */ React80.createElement(PopoverDialog.Title, null, title)), child, /* @__PURE__ */ React80.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ React80.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ React80.createElement(Popover2.Button, __spreadValues({
8370
+ }, /* @__PURE__ */ React83.createElement(PopoverDialog.Header, null, /* @__PURE__ */ React83.createElement(PopoverDialog.Title, null, title)), child, /* @__PURE__ */ React83.createElement(PopoverDialog.Footer, null, /* @__PURE__ */ React83.createElement(PopoverDialog.Actions, null, secondaryAction && /* @__PURE__ */ React83.createElement(Popover2.Button, __spreadValues({
8199
8371
  kind: "secondary-ghost",
8200
8372
  key: secondaryAction.text,
8201
8373
  dense: true
8202
- }, omit16(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React80.createElement(Popover2.Button, __spreadValues({
8374
+ }, omit16(secondaryAction, "text")), secondaryAction.text), /* @__PURE__ */ React83.createElement(Popover2.Button, __spreadValues({
8203
8375
  kind: "ghost",
8204
8376
  key: primaryAction.text,
8205
8377
  dense: true
@@ -8207,15 +8379,15 @@ var PopoverDialog2 = ({ placement, open, title, secondaryAction, primaryAction,
8207
8379
  }
8208
8380
  return child;
8209
8381
  };
8210
- return /* @__PURE__ */ React80.createElement(Popover2, {
8382
+ return /* @__PURE__ */ React83.createElement(Popover2, {
8211
8383
  type: "dialog",
8212
8384
  isOpen: open,
8213
8385
  placement,
8214
8386
  containFocus: true
8215
- }, React80.Children.map(children, wrapPromptWithBody));
8387
+ }, React83.Children.map(children, wrapPromptWithBody));
8216
8388
  };
8217
8389
  PopoverDialog2.Trigger = Popover2.Trigger;
8218
- var Prompt = ({ children }) => /* @__PURE__ */ React80.createElement(PopoverDialog.Body, null, children);
8390
+ var Prompt = ({ children }) => /* @__PURE__ */ React83.createElement(PopoverDialog.Body, null, children);
8219
8391
  Prompt.displayName = "PopoverDialog.Prompt";
8220
8392
  PopoverDialog2.Prompt = Prompt;
8221
8393
 
@@ -8224,14 +8396,14 @@ import { createPortal } from "react-dom";
8224
8396
  var Portal = ({ children, to }) => createPortal(children, to);
8225
8397
 
8226
8398
  // src/molecules/ProgressBar/ProgressBar.tsx
8227
- import React82 from "react";
8399
+ import React85 from "react";
8228
8400
 
8229
8401
  // src/atoms/ProgressBar/ProgressBar.tsx
8230
- import React81 from "react";
8402
+ import React84 from "react";
8231
8403
  import clamp2 from "lodash/clamp";
8232
8404
  var ProgressBar = (_a) => {
8233
8405
  var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
8234
- return /* @__PURE__ */ React81.createElement("div", __spreadProps(__spreadValues({}, rest), {
8406
+ return /* @__PURE__ */ React84.createElement("div", __spreadProps(__spreadValues({}, rest), {
8235
8407
  className: classNames(
8236
8408
  tw("relative flex items-center w-full bg-grey-0 h-2 rounded-full overflow-hidden"),
8237
8409
  className
@@ -8247,7 +8419,7 @@ var STATUS_COLORS = {
8247
8419
  ProgressBar.Indicator = (_a) => {
8248
8420
  var _b = _a, { min, max, value, "aria-label": ariaLabel, status, className } = _b, rest = __objRest(_b, ["min", "max", "value", "aria-label", "status", "className"]);
8249
8421
  const completedPercentage = clamp2((value - min) / (max - min) * 100, 0, 100);
8250
- return /* @__PURE__ */ React81.createElement("div", __spreadProps(__spreadValues({}, rest), {
8422
+ return /* @__PURE__ */ React84.createElement("div", __spreadProps(__spreadValues({}, rest), {
8251
8423
  className: classNames(
8252
8424
  tw("h-2 rounded-full transition-all ease-in-out delay-150"),
8253
8425
  STATUS_COLORS[status],
@@ -8263,11 +8435,11 @@ ProgressBar.Indicator = (_a) => {
8263
8435
  };
8264
8436
  ProgressBar.Labels = (_a) => {
8265
8437
  var _b = _a, { children, startLabel, endLabel, className } = _b, rest = __objRest(_b, ["children", "startLabel", "endLabel", "className"]);
8266
- return /* @__PURE__ */ React81.createElement("div", {
8438
+ return /* @__PURE__ */ React84.createElement("div", {
8267
8439
  className: classNames(tw("flex flex-row"), className)
8268
- }, /* @__PURE__ */ React81.createElement("span", __spreadProps(__spreadValues({}, rest), {
8440
+ }, /* @__PURE__ */ React84.createElement("span", __spreadProps(__spreadValues({}, rest), {
8269
8441
  className: tw("grow text-grey-70 typography-caption")
8270
- }), startLabel), /* @__PURE__ */ React81.createElement("span", __spreadProps(__spreadValues({}, rest), {
8442
+ }), startLabel), /* @__PURE__ */ React84.createElement("span", __spreadProps(__spreadValues({}, rest), {
8271
8443
  className: tw("grow text-grey-70 typography-caption text-right")
8272
8444
  }), endLabel));
8273
8445
  };
@@ -8285,7 +8457,7 @@ var ProgressBar2 = (props) => {
8285
8457
  if (min > max) {
8286
8458
  throw new Error("`min` value provided to `ProgressBar` is greater than `max` value.");
8287
8459
  }
8288
- const progress = /* @__PURE__ */ React82.createElement(ProgressBar, null, /* @__PURE__ */ React82.createElement(ProgressBar.Indicator, {
8460
+ const progress = /* @__PURE__ */ React85.createElement(ProgressBar, null, /* @__PURE__ */ React85.createElement(ProgressBar.Indicator, {
8289
8461
  status: value === max ? completedStatus : progresStatus,
8290
8462
  min,
8291
8463
  max,
@@ -8295,13 +8467,13 @@ var ProgressBar2 = (props) => {
8295
8467
  if (props.dense) {
8296
8468
  return progress;
8297
8469
  }
8298
- return /* @__PURE__ */ React82.createElement("div", null, progress, /* @__PURE__ */ React82.createElement(ProgressBar.Labels, {
8470
+ return /* @__PURE__ */ React85.createElement("div", null, progress, /* @__PURE__ */ React85.createElement(ProgressBar.Labels, {
8299
8471
  className: tw("py-2"),
8300
8472
  startLabel: props.startLabel,
8301
8473
  endLabel: props.endLabel
8302
8474
  }));
8303
8475
  };
8304
- var ProgressBarSkeleton = () => /* @__PURE__ */ React82.createElement(Skeleton, {
8476
+ var ProgressBarSkeleton = () => /* @__PURE__ */ React85.createElement(Skeleton, {
8305
8477
  height: 4,
8306
8478
  display: "block"
8307
8479
  });
@@ -8309,13 +8481,13 @@ ProgressBar2.Skeleton = ProgressBarSkeleton;
8309
8481
  ProgressBar2.Skeleton.displayName = "ProgressBar.Skeleton";
8310
8482
 
8311
8483
  // src/molecules/RadioButton/RadioButton.tsx
8312
- import React83 from "react";
8313
- var RadioButton2 = React83.forwardRef(
8484
+ import React86 from "react";
8485
+ var RadioButton2 = React86.forwardRef(
8314
8486
  (_a, ref) => {
8315
8487
  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"]);
8316
8488
  var _a2;
8317
8489
  const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
8318
- return !readOnly || isChecked ? /* @__PURE__ */ React83.createElement(ControlLabel, {
8490
+ return !readOnly || isChecked ? /* @__PURE__ */ React86.createElement(ControlLabel, {
8319
8491
  htmlFor: id,
8320
8492
  label: children,
8321
8493
  "aria-label": ariaLabel,
@@ -8323,7 +8495,7 @@ var RadioButton2 = React83.forwardRef(
8323
8495
  readOnly,
8324
8496
  disabled,
8325
8497
  style: { gap: "0 8px" }
8326
- }, !readOnly && /* @__PURE__ */ React83.createElement(RadioButton, __spreadProps(__spreadValues({
8498
+ }, !readOnly && /* @__PURE__ */ React86.createElement(RadioButton, __spreadProps(__spreadValues({
8327
8499
  id,
8328
8500
  ref,
8329
8501
  name
@@ -8334,12 +8506,12 @@ var RadioButton2 = React83.forwardRef(
8334
8506
  }
8335
8507
  );
8336
8508
  RadioButton2.displayName = "RadioButton";
8337
- var RadioButtonSkeleton = () => /* @__PURE__ */ React83.createElement("div", {
8509
+ var RadioButtonSkeleton = () => /* @__PURE__ */ React86.createElement("div", {
8338
8510
  className: tw("flex gap-3")
8339
- }, /* @__PURE__ */ React83.createElement(Skeleton, {
8511
+ }, /* @__PURE__ */ React86.createElement(Skeleton, {
8340
8512
  height: 20,
8341
8513
  width: 20
8342
- }), /* @__PURE__ */ React83.createElement(Skeleton, {
8514
+ }), /* @__PURE__ */ React86.createElement(Skeleton, {
8343
8515
  height: 20,
8344
8516
  width: 150
8345
8517
  }));
@@ -8347,10 +8519,10 @@ RadioButton2.Skeleton = RadioButtonSkeleton;
8347
8519
  RadioButton2.Skeleton.displayName = "RadioButton.Skeleton";
8348
8520
 
8349
8521
  // src/molecules/RadioButtonGroup/RadioButtonGroup.tsx
8350
- import React84 from "react";
8522
+ import React87 from "react";
8351
8523
  import uniqueId8 from "lodash/uniqueId";
8352
8524
  var isRadioButton = (c) => {
8353
- return React84.isValidElement(c) && c.type === RadioButton2;
8525
+ return React87.isValidElement(c) && c.type === RadioButton2;
8354
8526
  };
8355
8527
  var RadioButtonGroup = (_a) => {
8356
8528
  var _b = _a, {
@@ -8373,7 +8545,7 @@ var RadioButtonGroup = (_a) => {
8373
8545
  "children"
8374
8546
  ]);
8375
8547
  var _a2;
8376
- const [value, setValue] = React84.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
8548
+ const [value, setValue] = React87.useState((_a2 = _value != null ? _value : defaultValue) != null ? _a2 : "");
8377
8549
  const errorMessageId = uniqueId8();
8378
8550
  const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
8379
8551
  const labelControlProps = getLabelControlProps(props);
@@ -8384,14 +8556,14 @@ var RadioButtonGroup = (_a) => {
8384
8556
  setValue(e.target.value);
8385
8557
  onChange == null ? void 0 : onChange(e.target.value);
8386
8558
  };
8387
- const content = React84.Children.map(children, (c) => {
8559
+ const content = React87.Children.map(children, (c) => {
8388
8560
  var _a3, _b2, _c;
8389
8561
  if (!isRadioButton(c)) {
8390
8562
  return null;
8391
8563
  }
8392
8564
  const defaultChecked = defaultValue === void 0 ? void 0 : c.props.value === defaultValue;
8393
8565
  const checked = value === void 0 ? void 0 : c.props.value === value;
8394
- return React84.cloneElement(c, {
8566
+ return React87.cloneElement(c, {
8395
8567
  name,
8396
8568
  defaultChecked: (_a3 = c.props.defaultChecked) != null ? _a3 : defaultChecked,
8397
8569
  checked: (_b2 = c.props.checked) != null ? _b2 : checked,
@@ -8400,11 +8572,11 @@ var RadioButtonGroup = (_a) => {
8400
8572
  readOnly
8401
8573
  });
8402
8574
  });
8403
- return /* @__PURE__ */ React84.createElement(LabelControl, __spreadValues(__spreadValues({
8575
+ return /* @__PURE__ */ React87.createElement(LabelControl, __spreadValues(__spreadValues({
8404
8576
  fieldset: true
8405
- }, labelControlProps), errorProps), cols && /* @__PURE__ */ React84.createElement(InputGroup, {
8577
+ }, labelControlProps), errorProps), cols && /* @__PURE__ */ React87.createElement(InputGroup, {
8406
8578
  cols
8407
- }, content), !cols && /* @__PURE__ */ React84.createElement(Flexbox, {
8579
+ }, content), !cols && /* @__PURE__ */ React87.createElement(Flexbox, {
8408
8580
  direction,
8409
8581
  alignItems: "flex-start",
8410
8582
  colGap: "8",
@@ -8413,12 +8585,12 @@ var RadioButtonGroup = (_a) => {
8413
8585
  }, content));
8414
8586
  };
8415
8587
  var RadioButtonGroupSkeleton = ({ direction = "row", options = 2 }) => {
8416
- return /* @__PURE__ */ React84.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React84.createElement("div", {
8588
+ return /* @__PURE__ */ React87.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React87.createElement("div", {
8417
8589
  className: tw("flex flex-wrap", {
8418
8590
  "flex-row gap-8": direction === "row",
8419
8591
  "flex-col gap-2": direction === "column"
8420
8592
  })
8421
- }, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React84.createElement(RadioButton2.Skeleton, {
8593
+ }, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React87.createElement(RadioButton2.Skeleton, {
8422
8594
  key
8423
8595
  }))));
8424
8596
  };
@@ -8426,68 +8598,68 @@ RadioButtonGroup.Skeleton = RadioButtonGroupSkeleton;
8426
8598
  RadioButtonGroup.Skeleton.displayName = "RadioButtonGroup.Skeleton";
8427
8599
 
8428
8600
  // src/molecules/Section/Section.tsx
8429
- import React86 from "react";
8601
+ import React89 from "react";
8430
8602
  import castArray4 from "lodash/castArray";
8431
8603
 
8432
8604
  // src/atoms/Section/Section.tsx
8433
- import React85 from "react";
8434
- var Section2 = (_a) => {
8605
+ import React88 from "react";
8606
+ var Section3 = (_a) => {
8435
8607
  var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
8436
- return /* @__PURE__ */ React85.createElement(Box, __spreadValues({
8608
+ return /* @__PURE__ */ React88.createElement(Box, __spreadValues({
8437
8609
  borderColor: "grey-5",
8438
8610
  borderWidth: "1px"
8439
8611
  }, rest), children);
8440
8612
  };
8441
- Section2.Header = (_a) => {
8613
+ Section3.Header = (_a) => {
8442
8614
  var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
8443
- return /* @__PURE__ */ React85.createElement("div", __spreadProps(__spreadValues({}, rest), {
8615
+ return /* @__PURE__ */ React88.createElement("div", __spreadProps(__spreadValues({}, rest), {
8444
8616
  className: classNames(tw("px-6 py-5 flex gap-5 justify-between items-center"), className)
8445
8617
  }), children);
8446
8618
  };
8447
- Section2.TitleContainer = (_a) => {
8619
+ Section3.TitleContainer = (_a) => {
8448
8620
  var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
8449
- return /* @__PURE__ */ React85.createElement("div", __spreadProps(__spreadValues({}, rest), {
8621
+ return /* @__PURE__ */ React88.createElement("div", __spreadProps(__spreadValues({}, rest), {
8450
8622
  className: classNames(tw("flex flex-col grow gap-2"), className)
8451
8623
  }), children);
8452
8624
  };
8453
- Section2.Title = (_a) => {
8625
+ Section3.Title = (_a) => {
8454
8626
  var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
8455
- return /* @__PURE__ */ React85.createElement(Typography2.Subheading, __spreadProps(__spreadValues({}, rest), {
8627
+ return /* @__PURE__ */ React88.createElement(Typography2.Subheading, __spreadProps(__spreadValues({}, rest), {
8456
8628
  color: "black"
8457
8629
  }), children);
8458
8630
  };
8459
- Section2.Subtitle = (_a) => {
8631
+ Section3.Subtitle = (_a) => {
8460
8632
  var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
8461
- return /* @__PURE__ */ React85.createElement(Typography2.SmallText, __spreadProps(__spreadValues({}, rest), {
8633
+ return /* @__PURE__ */ React88.createElement(Typography2.SmallText, __spreadProps(__spreadValues({}, rest), {
8462
8634
  color: "grey-70"
8463
8635
  }), children);
8464
8636
  };
8465
- Section2.Actions = (_a) => {
8637
+ Section3.Actions = (_a) => {
8466
8638
  var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
8467
- return /* @__PURE__ */ React85.createElement("div", __spreadProps(__spreadValues({}, rest), {
8639
+ return /* @__PURE__ */ React88.createElement("div", __spreadProps(__spreadValues({}, rest), {
8468
8640
  className: classNames(tw("flex gap-4 justify-end"), className)
8469
8641
  }), children);
8470
8642
  };
8471
- Section2.Body = (_a) => {
8643
+ Section3.Body = (_a) => {
8472
8644
  var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
8473
- return /* @__PURE__ */ React85.createElement("div", __spreadProps(__spreadValues({}, rest), {
8645
+ return /* @__PURE__ */ React88.createElement("div", __spreadProps(__spreadValues({}, rest), {
8474
8646
  className: classNames(tw("p-6"), className)
8475
- }), /* @__PURE__ */ React85.createElement(Typography, {
8647
+ }), /* @__PURE__ */ React88.createElement(Typography, {
8476
8648
  htmlTag: "div",
8477
8649
  color: "grey-70"
8478
8650
  }, children));
8479
8651
  };
8480
8652
 
8481
8653
  // src/molecules/Section/Section.tsx
8482
- var Section3 = ({ title, subtitle, actions, children }) => /* @__PURE__ */ React86.createElement(Section2, null, title && /* @__PURE__ */ React86.createElement(React86.Fragment, null, /* @__PURE__ */ React86.createElement(Section2.Header, null, /* @__PURE__ */ React86.createElement(Section2.TitleContainer, null, /* @__PURE__ */ React86.createElement(Section2.Title, null, title), subtitle && /* @__PURE__ */ React86.createElement(Section2.Subtitle, null, subtitle)), /* @__PURE__ */ React86.createElement(Section2.Actions, null, actions && castArray4(actions).filter(Boolean).map((_a) => {
8654
+ var Section4 = ({ title, subtitle, actions, children }) => /* @__PURE__ */ React89.createElement(Section3, null, title && /* @__PURE__ */ React89.createElement(React89.Fragment, null, /* @__PURE__ */ React89.createElement(Section3.Header, null, /* @__PURE__ */ React89.createElement(Section3.TitleContainer, null, /* @__PURE__ */ React89.createElement(Section3.Title, null, title), subtitle && /* @__PURE__ */ React89.createElement(Section3.Subtitle, null, subtitle)), /* @__PURE__ */ React89.createElement(Section3.Actions, null, actions && castArray4(actions).filter(Boolean).map((_a) => {
8483
8655
  var _b = _a, { text } = _b, action = __objRest(_b, ["text"]);
8484
- return /* @__PURE__ */ React86.createElement(SecondaryButton, __spreadValues({
8656
+ return /* @__PURE__ */ React89.createElement(SecondaryButton, __spreadValues({
8485
8657
  key: text
8486
8658
  }, action), text);
8487
- }))), /* @__PURE__ */ React86.createElement(Divider2, null)), /* @__PURE__ */ React86.createElement(Section2.Body, null, children));
8659
+ }))), /* @__PURE__ */ React89.createElement(Divider2, null)), /* @__PURE__ */ React89.createElement(Section3.Body, null, children));
8488
8660
 
8489
8661
  // src/molecules/SegmentedControl/SegmentedControl.tsx
8490
- import React87 from "react";
8662
+ import React90 from "react";
8491
8663
  var SegmentedControl = (_a) => {
8492
8664
  var _b = _a, {
8493
8665
  children,
@@ -8504,7 +8676,7 @@ var SegmentedControl = (_a) => {
8504
8676
  "selected",
8505
8677
  "className"
8506
8678
  ]);
8507
- return /* @__PURE__ */ React87.createElement("button", __spreadProps(__spreadValues({
8679
+ return /* @__PURE__ */ React90.createElement("button", __spreadProps(__spreadValues({
8508
8680
  type: "button"
8509
8681
  }, rest), {
8510
8682
  className: classNames(
@@ -8535,11 +8707,11 @@ var SegmentedControlGroup = (_a) => {
8535
8707
  "border border-grey-20 text-grey-50": variant === "outlined",
8536
8708
  "bg-grey-0": variant === "raised"
8537
8709
  });
8538
- return /* @__PURE__ */ React87.createElement("div", __spreadProps(__spreadValues({}, rest), {
8710
+ return /* @__PURE__ */ React90.createElement("div", __spreadProps(__spreadValues({}, rest), {
8539
8711
  className: classNames(classes2, className)
8540
- }), React87.Children.map(
8712
+ }), React90.Children.map(
8541
8713
  children,
8542
- (child) => React87.cloneElement(child, {
8714
+ (child) => React90.cloneElement(child, {
8543
8715
  dense,
8544
8716
  variant,
8545
8717
  onClick: () => onChange(child.props.value),
@@ -8577,10 +8749,10 @@ var getCommonClassNames = (dense, selected) => tw(
8577
8749
  );
8578
8750
 
8579
8751
  // src/molecules/Spacing/Spacing.tsx
8580
- import React88 from "react";
8752
+ import React91 from "react";
8581
8753
  var Spacing = (_a) => {
8582
8754
  var _b = _a, { gap, row } = _b, rest = __objRest(_b, ["gap", "row"]);
8583
- return /* @__PURE__ */ React88.createElement(Box, __spreadProps(__spreadValues({}, rest), {
8755
+ return /* @__PURE__ */ React91.createElement(Box, __spreadProps(__spreadValues({}, rest), {
8584
8756
  display: "flex",
8585
8757
  flexDirection: row ? "row" : "column",
8586
8758
  gap
@@ -8588,14 +8760,14 @@ var Spacing = (_a) => {
8588
8760
  };
8589
8761
 
8590
8762
  // src/molecules/Stepper/Stepper.tsx
8591
- import React90 from "react";
8763
+ import React93 from "react";
8592
8764
 
8593
8765
  // src/atoms/Stepper/Stepper.tsx
8594
- import React89 from "react";
8766
+ import React92 from "react";
8595
8767
  var import_tick5 = __toESM(require_tick());
8596
8768
  var Stepper = (_a) => {
8597
8769
  var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
8598
- return /* @__PURE__ */ React89.createElement("div", __spreadProps(__spreadValues({}, rest), {
8770
+ return /* @__PURE__ */ React92.createElement("div", __spreadProps(__spreadValues({}, rest), {
8599
8771
  className: classNames(className)
8600
8772
  }));
8601
8773
  };
@@ -8609,7 +8781,7 @@ var ConnectorContainer = (_a) => {
8609
8781
  "completed",
8610
8782
  "dense"
8611
8783
  ]);
8612
- return /* @__PURE__ */ React89.createElement("div", __spreadProps(__spreadValues({}, rest), {
8784
+ return /* @__PURE__ */ React92.createElement("div", __spreadProps(__spreadValues({}, rest), {
8613
8785
  className: classNames(
8614
8786
  tw("absolute w-full -left-1/2", {
8615
8787
  "top-[3px] px-[14px]": Boolean(dense),
@@ -8621,7 +8793,7 @@ var ConnectorContainer = (_a) => {
8621
8793
  };
8622
8794
  var Connector = (_a) => {
8623
8795
  var _b = _a, { children, className, completed, dense } = _b, rest = __objRest(_b, ["children", "className", "completed", "dense"]);
8624
- return /* @__PURE__ */ React89.createElement("div", __spreadProps(__spreadValues({}, rest), {
8796
+ return /* @__PURE__ */ React92.createElement("div", __spreadProps(__spreadValues({}, rest), {
8625
8797
  className: classNames(
8626
8798
  tw("w-full", {
8627
8799
  "bg-grey-20": !completed,
@@ -8635,7 +8807,7 @@ var Connector = (_a) => {
8635
8807
  };
8636
8808
  var Step = (_a) => {
8637
8809
  var _b = _a, { className, state } = _b, rest = __objRest(_b, ["className", "state"]);
8638
- return /* @__PURE__ */ React89.createElement("div", __spreadProps(__spreadValues({}, rest), {
8810
+ return /* @__PURE__ */ React92.createElement("div", __spreadProps(__spreadValues({}, rest), {
8639
8811
  className: classNames(
8640
8812
  tw("flex flex-col items-center text-grey-90 relative text-center", {
8641
8813
  "text-grey-20": state === "inactive"
@@ -8656,13 +8828,13 @@ var getDenseClassNames = (state) => tw("h-[8px] w-[8px]", {
8656
8828
  });
8657
8829
  var Indicator = (_a) => {
8658
8830
  var _b = _a, { children, className, state, dense } = _b, rest = __objRest(_b, ["children", "className", "state", "dense"]);
8659
- return /* @__PURE__ */ React89.createElement("div", __spreadProps(__spreadValues({}, rest), {
8831
+ return /* @__PURE__ */ React92.createElement("div", __spreadProps(__spreadValues({}, rest), {
8660
8832
  className: classNames(
8661
8833
  tw("rounded-full flex justify-center items-center mx-2 mb-3"),
8662
8834
  dense ? getDenseClassNames(state) : getClassNames(state),
8663
8835
  className
8664
8836
  )
8665
- }), state === "completed" ? /* @__PURE__ */ React89.createElement(InlineIcon, {
8837
+ }), state === "completed" ? /* @__PURE__ */ React92.createElement(InlineIcon, {
8666
8838
  icon: import_tick5.default
8667
8839
  }) : dense ? null : children);
8668
8840
  };
@@ -8673,46 +8845,47 @@ Stepper.ConnectorContainer = ConnectorContainer;
8673
8845
 
8674
8846
  // src/molecules/Stepper/Stepper.tsx
8675
8847
  var Stepper2 = ({ children, activeIndex, dense }) => {
8676
- const steps = React90.Children.count(children);
8677
- return /* @__PURE__ */ React90.createElement(Stepper, {
8848
+ const steps = React93.Children.count(children);
8849
+ return /* @__PURE__ */ React93.createElement(Stepper, {
8678
8850
  role: "list"
8679
- }, /* @__PURE__ */ React90.createElement(Template, {
8851
+ }, /* @__PURE__ */ React93.createElement(Template, {
8680
8852
  columns: steps
8681
- }, React90.Children.map(children, (child, index) => {
8853
+ }, React93.Children.map(children, (child, index) => {
8682
8854
  if (!isComponentType(child, Step2)) {
8683
8855
  return new Error("<Stepper> can only have <Stepper.Step> components as children");
8684
8856
  } else {
8685
8857
  const state = index > activeIndex ? "inactive" : index === activeIndex ? "active" : "completed";
8686
- return /* @__PURE__ */ React90.createElement(Stepper.Step, {
8858
+ return /* @__PURE__ */ React93.createElement(Stepper.Step, {
8687
8859
  state,
8688
8860
  "aria-current": state === "active" ? "step" : false,
8689
8861
  role: "listitem"
8690
- }, index > 0 && index <= steps && /* @__PURE__ */ React90.createElement(Stepper.ConnectorContainer, {
8862
+ }, index > 0 && index <= steps && /* @__PURE__ */ React93.createElement(Stepper.ConnectorContainer, {
8691
8863
  dense
8692
- }, /* @__PURE__ */ React90.createElement(Stepper.ConnectorContainer.Connector, {
8864
+ }, /* @__PURE__ */ React93.createElement(Stepper.ConnectorContainer.Connector, {
8693
8865
  completed: state === "completed" || state === "active"
8694
- })), /* @__PURE__ */ React90.createElement(Stepper.Step.Indicator, {
8866
+ })), /* @__PURE__ */ React93.createElement(Stepper.Step.Indicator, {
8695
8867
  state,
8696
8868
  dense
8697
8869
  }, index + 1), child.props.children);
8698
8870
  }
8699
8871
  })));
8700
8872
  };
8873
+ Stepper2.displayName = "Stepper";
8701
8874
  var Step2 = () => null;
8702
8875
  Step2.displayName = "Stepper.Step";
8703
8876
  Stepper2.Step = Step2;
8704
8877
 
8705
8878
  // src/molecules/Switch/Switch.tsx
8706
- import React92 from "react";
8879
+ import React95 from "react";
8707
8880
 
8708
8881
  // src/atoms/Switch/Switch.tsx
8709
- import React91 from "react";
8710
- var Switch = React91.forwardRef(
8882
+ import React94 from "react";
8883
+ var Switch = React94.forwardRef(
8711
8884
  (_a, ref) => {
8712
8885
  var _b = _a, { id, children, name, disabled = false, readOnly = false } = _b, props = __objRest(_b, ["id", "children", "name", "disabled", "readOnly"]);
8713
- return /* @__PURE__ */ React91.createElement("span", {
8886
+ return /* @__PURE__ */ React94.createElement("span", {
8714
8887
  className: tw("relative inline-flex justify-center items-center self-center group")
8715
- }, /* @__PURE__ */ React91.createElement("input", __spreadProps(__spreadValues({
8888
+ }, /* @__PURE__ */ React94.createElement("input", __spreadProps(__spreadValues({
8716
8889
  id,
8717
8890
  ref,
8718
8891
  type: "checkbox",
@@ -8731,7 +8904,7 @@ var Switch = React91.forwardRef(
8731
8904
  ),
8732
8905
  readOnly,
8733
8906
  disabled
8734
- })), /* @__PURE__ */ React91.createElement("span", {
8907
+ })), /* @__PURE__ */ React94.createElement("span", {
8735
8908
  className: tw(
8736
8909
  "pointer-events-none rounded-full absolute inline-block transition duration-300 h-4 w-4 transform peer-checked/switch:translate-x-5",
8737
8910
  "bg-white peer-disabled/switch:bg-grey-0 left-2 peer-checked/switch:left-1",
@@ -8744,12 +8917,12 @@ var Switch = React91.forwardRef(
8744
8917
  );
8745
8918
 
8746
8919
  // src/molecules/Switch/Switch.tsx
8747
- var Switch2 = React92.forwardRef(
8920
+ var Switch2 = React95.forwardRef(
8748
8921
  (_a, ref) => {
8749
8922
  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"]);
8750
8923
  var _a2;
8751
8924
  const isChecked = (_a2 = props.checked) != null ? _a2 : props.defaultChecked;
8752
- return !readOnly || isChecked ? /* @__PURE__ */ React92.createElement(ControlLabel, {
8925
+ return !readOnly || isChecked ? /* @__PURE__ */ React95.createElement(ControlLabel, {
8753
8926
  htmlFor: id,
8754
8927
  label: children,
8755
8928
  "aria-label": ariaLabel,
@@ -8757,7 +8930,7 @@ var Switch2 = React92.forwardRef(
8757
8930
  readOnly,
8758
8931
  disabled,
8759
8932
  style: { gap: "0 8px" }
8760
- }, !readOnly && /* @__PURE__ */ React92.createElement(Switch, __spreadProps(__spreadValues({
8933
+ }, !readOnly && /* @__PURE__ */ React95.createElement(Switch, __spreadProps(__spreadValues({
8761
8934
  id,
8762
8935
  ref,
8763
8936
  name
@@ -8768,12 +8941,12 @@ var Switch2 = React92.forwardRef(
8768
8941
  }
8769
8942
  );
8770
8943
  Switch2.displayName = "Switch";
8771
- var SwitchSkeleton = () => /* @__PURE__ */ React92.createElement("div", {
8944
+ var SwitchSkeleton = () => /* @__PURE__ */ React95.createElement("div", {
8772
8945
  className: tw("flex gap-3")
8773
- }, /* @__PURE__ */ React92.createElement(Skeleton, {
8946
+ }, /* @__PURE__ */ React95.createElement(Skeleton, {
8774
8947
  height: 20,
8775
8948
  width: 35
8776
- }), /* @__PURE__ */ React92.createElement(Skeleton, {
8949
+ }), /* @__PURE__ */ React95.createElement(Skeleton, {
8777
8950
  height: 20,
8778
8951
  width: 150
8779
8952
  }));
@@ -8781,7 +8954,7 @@ Switch2.Skeleton = SwitchSkeleton;
8781
8954
  Switch2.Skeleton.displayName = "Switch.Skeleton ";
8782
8955
 
8783
8956
  // src/molecules/SwitchGroup/SwitchGroup.tsx
8784
- import React93, { useState as useState11 } from "react";
8957
+ import React96, { useState as useState11 } from "react";
8785
8958
  import uniqueId9 from "lodash/uniqueId";
8786
8959
  var SwitchGroup = (_a) => {
8787
8960
  var _b = _a, {
@@ -8813,11 +8986,11 @@ var SwitchGroup = (_a) => {
8813
8986
  setSelectedItems(updated);
8814
8987
  onChange == null ? void 0 : onChange(updated);
8815
8988
  };
8816
- return /* @__PURE__ */ React93.createElement(LabelControl, __spreadValues(__spreadValues({
8989
+ return /* @__PURE__ */ React96.createElement(LabelControl, __spreadValues(__spreadValues({
8817
8990
  fieldset: true
8818
- }, labelControlProps), errorProps), /* @__PURE__ */ React93.createElement(InputGroup, {
8991
+ }, labelControlProps), errorProps), /* @__PURE__ */ React96.createElement(InputGroup, {
8819
8992
  cols
8820
- }, React93.Children.map(children, (c) => {
8993
+ }, React96.Children.map(children, (c) => {
8821
8994
  var _a3, _b2, _c, _d;
8822
8995
  if (!isComponentType(c, Switch2)) {
8823
8996
  return null;
@@ -8825,7 +8998,7 @@ var SwitchGroup = (_a) => {
8825
8998
  const str = (_a3 = c.props.value) == null ? void 0 : _a3.toString();
8826
8999
  const defaultChecked = defaultValue === void 0 ? void 0 : str !== void 0 && defaultValue.includes(str);
8827
9000
  const checked = value === void 0 ? void 0 : str !== void 0 && value.includes(str);
8828
- return React93.cloneElement(c, {
9001
+ return React96.cloneElement(c, {
8829
9002
  defaultChecked: (_b2 = c.props.defaultChecked) != null ? _b2 : defaultChecked,
8830
9003
  checked: (_c = c.props.checked) != null ? _c : checked,
8831
9004
  onChange: (_d = c.props.onChange) != null ? _d : handleChange,
@@ -8835,9 +9008,9 @@ var SwitchGroup = (_a) => {
8835
9008
  })));
8836
9009
  };
8837
9010
  var SwitchGroupSkeleton = ({ options = 2 }) => {
8838
- return /* @__PURE__ */ React93.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React93.createElement("div", {
9011
+ return /* @__PURE__ */ React96.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React96.createElement("div", {
8839
9012
  className: tw("flex flex-wrap flex-col gap-2")
8840
- }, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React93.createElement(Switch2.Skeleton, {
9013
+ }, Array.from({ length: options }).map((_, key) => /* @__PURE__ */ React96.createElement(Switch2.Skeleton, {
8841
9014
  key
8842
9015
  }))));
8843
9016
  };
@@ -8845,10 +9018,10 @@ SwitchGroup.Skeleton = SwitchGroupSkeleton;
8845
9018
  SwitchGroup.Skeleton.displayName = "SwitchGroup.Skeleton";
8846
9019
 
8847
9020
  // src/molecules/TagLabel/TagLabel.tsx
8848
- import React94 from "react";
9021
+ import React97 from "react";
8849
9022
  var TagLabel = (_a) => {
8850
9023
  var _b = _a, { title, dense = false } = _b, rest = __objRest(_b, ["title", "dense"]);
8851
- return /* @__PURE__ */ React94.createElement("span", __spreadProps(__spreadValues({}, rest), {
9024
+ return /* @__PURE__ */ React97.createElement("span", __spreadProps(__spreadValues({}, rest), {
8852
9025
  className: tw("rounded-full text-white bg-primary-70", {
8853
9026
  "py-2 px-4 typography-caption": !dense,
8854
9027
  "py-2 px-3 typography-caption-small": dense
@@ -8857,14 +9030,14 @@ var TagLabel = (_a) => {
8857
9030
  };
8858
9031
 
8859
9032
  // src/molecules/Textarea/Textarea.tsx
8860
- import React95, { useRef as useRef13, useState as useState12 } from "react";
9033
+ import React98, { useRef as useRef13, useState as useState12 } from "react";
8861
9034
  import omit17 from "lodash/omit";
8862
9035
  import toString2 from "lodash/toString";
8863
9036
  import uniqueId10 from "lodash/uniqueId";
8864
- var TextareaBase = React95.forwardRef(
9037
+ var TextareaBase = React98.forwardRef(
8865
9038
  (_a, ref) => {
8866
9039
  var _b = _a, { readOnly = false, valid = true } = _b, props = __objRest(_b, ["readOnly", "valid"]);
8867
- return /* @__PURE__ */ React95.createElement("textarea", __spreadProps(__spreadValues({
9040
+ return /* @__PURE__ */ React98.createElement("textarea", __spreadProps(__spreadValues({
8868
9041
  ref
8869
9042
  }, props), {
8870
9043
  readOnly,
@@ -8872,10 +9045,10 @@ var TextareaBase = React95.forwardRef(
8872
9045
  }));
8873
9046
  }
8874
9047
  );
8875
- TextareaBase.Skeleton = () => /* @__PURE__ */ React95.createElement(Skeleton, {
9048
+ TextareaBase.Skeleton = () => /* @__PURE__ */ React98.createElement(Skeleton, {
8876
9049
  height: 58
8877
9050
  });
8878
- var Textarea = React95.forwardRef((props, ref) => {
9051
+ var Textarea = React98.forwardRef((props, ref) => {
8879
9052
  var _a, _b, _c;
8880
9053
  const [value, setValue] = useState12((_b = (_a = props.value) != null ? _a : props.defaultValue) != null ? _b : "");
8881
9054
  const id = useRef13((_c = props.id) != null ? _c : `textarea-${uniqueId10()}`);
@@ -8883,12 +9056,12 @@ var Textarea = React95.forwardRef((props, ref) => {
8883
9056
  const errorProps = props.valid === false ? { "aria-invalid": true, "aria-describedby": errorMessageId } : {};
8884
9057
  const _d = getLabelControlProps(props), { "data-testid": dataTestId } = _d, labelControlProps = __objRest(_d, ["data-testid"]);
8885
9058
  const baseProps = omit17(props, Object.keys(labelControlProps));
8886
- return /* @__PURE__ */ React95.createElement(LabelControl, __spreadValues({
9059
+ return /* @__PURE__ */ React98.createElement(LabelControl, __spreadValues({
8887
9060
  id: `${id.current}-label`,
8888
9061
  htmlFor: id.current,
8889
9062
  messageId: errorMessageId,
8890
9063
  length: value !== void 0 ? toString2(value).length : void 0
8891
- }, labelControlProps), /* @__PURE__ */ React95.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
9064
+ }, labelControlProps), /* @__PURE__ */ React98.createElement(TextareaBase, __spreadProps(__spreadValues(__spreadValues({
8892
9065
  ref
8893
9066
  }, baseProps), errorProps), {
8894
9067
  id: id.current,
@@ -8905,48 +9078,48 @@ var Textarea = React95.forwardRef((props, ref) => {
8905
9078
  })));
8906
9079
  });
8907
9080
  Textarea.displayName = "Textarea";
8908
- var TextAreaSkeleton = () => /* @__PURE__ */ React95.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React95.createElement(TextareaBase.Skeleton, null));
9081
+ var TextAreaSkeleton = () => /* @__PURE__ */ React98.createElement(LabelControl.Skeleton, null, /* @__PURE__ */ React98.createElement(TextareaBase.Skeleton, null));
8909
9082
  Textarea.Skeleton = TextAreaSkeleton;
8910
9083
  Textarea.Skeleton.displayName = "Textarea.Skeleton";
8911
9084
 
8912
9085
  // src/molecules/Timeline/Timeline.tsx
8913
- import React97 from "react";
9086
+ import React100 from "react";
8914
9087
 
8915
9088
  // src/atoms/Timeline/Timeline.tsx
8916
- import React96 from "react";
9089
+ import React99 from "react";
8917
9090
  var Timeline = (_a) => {
8918
9091
  var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
8919
- return /* @__PURE__ */ React96.createElement("div", __spreadProps(__spreadValues({}, rest), {
9092
+ return /* @__PURE__ */ React99.createElement("div", __spreadProps(__spreadValues({}, rest), {
8920
9093
  className: classNames(tw("grid grid-cols-[16px_1fr] gap-x-4"), className)
8921
9094
  }));
8922
9095
  };
8923
9096
  var Content2 = (_a) => {
8924
9097
  var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
8925
- return /* @__PURE__ */ React96.createElement("div", __spreadProps(__spreadValues({}, rest), {
9098
+ return /* @__PURE__ */ React99.createElement("div", __spreadProps(__spreadValues({}, rest), {
8926
9099
  className: classNames(tw("pb-6"), className)
8927
9100
  }));
8928
9101
  };
8929
9102
  var Separator2 = (_a) => {
8930
9103
  var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
8931
- return /* @__PURE__ */ React96.createElement("div", __spreadProps(__spreadValues({}, rest), {
9104
+ return /* @__PURE__ */ React99.createElement("div", __spreadProps(__spreadValues({}, rest), {
8932
9105
  className: classNames(tw("flex items-center justify-center h-5 w-5"), className)
8933
9106
  }));
8934
9107
  };
8935
9108
  var LineContainer = (_a) => {
8936
9109
  var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
8937
- return /* @__PURE__ */ React96.createElement("div", __spreadProps(__spreadValues({}, rest), {
9110
+ return /* @__PURE__ */ React99.createElement("div", __spreadProps(__spreadValues({}, rest), {
8938
9111
  className: classNames(tw("flex justify-center py-1"), className)
8939
9112
  }));
8940
9113
  };
8941
9114
  var Line = (_a) => {
8942
9115
  var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
8943
- return /* @__PURE__ */ React96.createElement("div", __spreadProps(__spreadValues({}, rest), {
9116
+ return /* @__PURE__ */ React99.createElement("div", __spreadProps(__spreadValues({}, rest), {
8944
9117
  className: classNames(tw("w-1 bg-grey-5 h-full justify-self-center"), className)
8945
9118
  }));
8946
9119
  };
8947
9120
  var Dot = (_a) => {
8948
9121
  var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
8949
- return /* @__PURE__ */ React96.createElement("div", __spreadProps(__spreadValues({}, rest), {
9122
+ return /* @__PURE__ */ React99.createElement("div", __spreadProps(__spreadValues({}, rest), {
8950
9123
  className: classNames(tw("bg-grey-30 h-[6px] w-[6px] rounded"), className)
8951
9124
  }));
8952
9125
  };
@@ -8961,52 +9134,52 @@ var import_error4 = __toESM(require_error());
8961
9134
  var import_time = __toESM(require_time());
8962
9135
  var import_warningSign4 = __toESM(require_warningSign());
8963
9136
  var TimelineItem = () => null;
8964
- var Timeline2 = ({ children }) => /* @__PURE__ */ React97.createElement("div", null, React97.Children.map(children, (item) => {
9137
+ var Timeline2 = ({ children }) => /* @__PURE__ */ React100.createElement("div", null, React100.Children.map(children, (item) => {
8965
9138
  if (!isComponentType(item, TimelineItem)) {
8966
9139
  throw new Error("<Timeline> can only have <Timeline.Item> components as children");
8967
9140
  } else {
8968
9141
  const { props, key } = item;
8969
- return /* @__PURE__ */ React97.createElement(Timeline, {
9142
+ return /* @__PURE__ */ React100.createElement(Timeline, {
8970
9143
  key: key != null ? key : props.title
8971
- }, /* @__PURE__ */ React97.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React97.createElement(Icon, {
9144
+ }, /* @__PURE__ */ React100.createElement(Timeline.Separator, null, props.variant === "error" ? /* @__PURE__ */ React100.createElement(Icon, {
8972
9145
  icon: import_error4.default,
8973
9146
  color: "error-30"
8974
- }) : props.variant === "warning" ? /* @__PURE__ */ React97.createElement(Icon, {
9147
+ }) : props.variant === "warning" ? /* @__PURE__ */ React100.createElement(Icon, {
8975
9148
  icon: import_warningSign4.default,
8976
9149
  color: "warning-30"
8977
- }) : props.variant === "info" ? /* @__PURE__ */ React97.createElement(Icon, {
9150
+ }) : props.variant === "info" ? /* @__PURE__ */ React100.createElement(Icon, {
8978
9151
  icon: import_time.default,
8979
9152
  color: "info-30"
8980
- }) : /* @__PURE__ */ React97.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React97.createElement(Typography2.Caption, {
9153
+ }) : /* @__PURE__ */ React100.createElement(Timeline.Separator.Dot, null)), /* @__PURE__ */ React100.createElement(Typography2.Caption, {
8981
9154
  color: "grey-50"
8982
- }, props.title), /* @__PURE__ */ React97.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React97.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React97.createElement(Timeline.Content, null, /* @__PURE__ */ React97.createElement(Typography2.Small, null, props.children)));
9155
+ }, props.title), /* @__PURE__ */ React100.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React100.createElement(Timeline.LineContainer.Line, null)), /* @__PURE__ */ React100.createElement(Timeline.Content, null, /* @__PURE__ */ React100.createElement(Typography2.Small, null, props.children)));
8983
9156
  }
8984
9157
  }));
8985
- var TimelineItemSkeleton = () => /* @__PURE__ */ React97.createElement(Timeline, null, /* @__PURE__ */ React97.createElement(Timeline.Separator, null, /* @__PURE__ */ React97.createElement(Skeleton, {
9158
+ var TimelineItemSkeleton = () => /* @__PURE__ */ React100.createElement(Timeline, null, /* @__PURE__ */ React100.createElement(Timeline.Separator, null, /* @__PURE__ */ React100.createElement(Skeleton, {
8986
9159
  width: 6,
8987
9160
  height: 6,
8988
9161
  rounded: true
8989
- })), /* @__PURE__ */ React97.createElement(Skeleton, {
9162
+ })), /* @__PURE__ */ React100.createElement(Skeleton, {
8990
9163
  height: 12,
8991
9164
  width: 120
8992
- }), /* @__PURE__ */ React97.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React97.createElement(Skeleton, {
9165
+ }), /* @__PURE__ */ React100.createElement(Timeline.LineContainer, null, /* @__PURE__ */ React100.createElement(Skeleton, {
8993
9166
  width: 2,
8994
9167
  height: "100%"
8995
- })), /* @__PURE__ */ React97.createElement(Timeline.Content, null, /* @__PURE__ */ React97.createElement(Box, {
9168
+ })), /* @__PURE__ */ React100.createElement(Timeline.Content, null, /* @__PURE__ */ React100.createElement(Box, {
8996
9169
  display: "flex",
8997
9170
  flexDirection: "column",
8998
9171
  gap: "3"
8999
- }, /* @__PURE__ */ React97.createElement(Skeleton, {
9172
+ }, /* @__PURE__ */ React100.createElement(Skeleton, {
9000
9173
  height: 32,
9001
9174
  width: "100%"
9002
- }), /* @__PURE__ */ React97.createElement(Skeleton, {
9175
+ }), /* @__PURE__ */ React100.createElement(Skeleton, {
9003
9176
  height: 32,
9004
9177
  width: "73%"
9005
- }), /* @__PURE__ */ React97.createElement(Skeleton, {
9178
+ }), /* @__PURE__ */ React100.createElement(Skeleton, {
9006
9179
  height: 32,
9007
9180
  width: "80%"
9008
9181
  }))));
9009
- var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React97.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React97.createElement(TimelineItemSkeleton, {
9182
+ var TimelineSkeleton = ({ items = 3 }) => /* @__PURE__ */ React100.createElement("div", null, Array.from({ length: items }).map((_, key) => /* @__PURE__ */ React100.createElement(TimelineItemSkeleton, {
9010
9183
  key
9011
9184
  })));
9012
9185
  Timeline2.Item = TimelineItem;
@@ -9014,9 +9187,9 @@ Timeline2.Skeleton = TimelineSkeleton;
9014
9187
  Timeline2.Skeleton.displayName = "Timeline.Skeleton";
9015
9188
 
9016
9189
  // src/utils/table/useTableSelect.ts
9017
- import React98 from "react";
9190
+ import React101 from "react";
9018
9191
  var useTableSelect = (data, { key }) => {
9019
- const [selected, setSelected] = React98.useState([]);
9192
+ const [selected, setSelected] = React101.useState([]);
9020
9193
  const allSelected = selected.length === data.length;
9021
9194
  const isSelected = (dot) => selected.includes(dot[key]);
9022
9195
  const selectAll = () => setSelected(data.map((dot) => dot[key]));
@@ -9226,7 +9399,7 @@ export {
9226
9399
  Divider2 as Divider,
9227
9400
  Dropdown,
9228
9401
  DropdownButton,
9229
- DropdownMenu3 as DropdownMenu,
9402
+ DropdownMenu2 as DropdownMenu,
9230
9403
  Element,
9231
9404
  EmptyState,
9232
9405
  EmptyStateLayout,
@@ -9248,7 +9421,7 @@ export {
9248
9421
  LabelControl,
9249
9422
  LineClamp2 as LineClamp,
9250
9423
  Link2 as Link,
9251
- List,
9424
+ List2 as List,
9252
9425
  ListItem,
9253
9426
  Modal2 as Modal,
9254
9427
  ModalTab,
@@ -9260,9 +9433,10 @@ export {
9260
9433
  MultiSelectBase,
9261
9434
  NativeSelect,
9262
9435
  NativeSelectBase,
9436
+ Navigation2 as Navigation,
9263
9437
  OneLineBanner,
9264
9438
  Option,
9265
- PageHeader,
9439
+ PageHeader2 as PageHeader,
9266
9440
  Pagination,
9267
9441
  Popover2 as Popover,
9268
9442
  PopoverDialog2 as PopoverDialog,
@@ -9277,7 +9451,7 @@ export {
9277
9451
  SecondaryButton,
9278
9452
  SecondaryDropdownButton,
9279
9453
  SecondaryGhostButton,
9280
- Section3 as Section,
9454
+ Section4 as Section,
9281
9455
  SegmentedControl,
9282
9456
  SegmentedControlGroup,
9283
9457
  Select2 as Select,