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