@uniformdev/design-system 19.117.1-alpha.2 → 19.117.2-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -22126,8 +22126,8 @@ var SearchAndFilterContainer = import_react138.css``;
22126
22126
  var SearchAndFilterControlsWrapper = import_react138.css`
22127
22127
  align-items: stretch;
22128
22128
  display: grid;
22129
- grid-template-columns: auto 1fr 1fr;
22130
- gap: var(--spacing-base);
22129
+ grid-template-columns: auto auto 1fr 0.5fr;
22130
+ gap: var(--spacing-sm);
22131
22131
  `;
22132
22132
  var SearchAndFilterOutterControlWrapper = import_react138.css`
22133
22133
  align-items: stretch;
@@ -22139,7 +22139,6 @@ var ConditionalFilterRow = import_react138.css`
22139
22139
  display: grid;
22140
22140
  grid-template-columns: 35px 1fr;
22141
22141
  gap: var(--spacing-sm);
22142
- padding: 0 var(--spacing-sm);
22143
22142
  margin-left: var(--spacing-base);
22144
22143
 
22145
22144
  ${cq("380px")} {
@@ -22166,7 +22165,7 @@ var ConditionalInputRow = import_react138.css`
22166
22165
  }
22167
22166
  ${cq("580px")} {
22168
22167
  display: grid;
22169
- grid-template-columns: repeat(4, minmax(160px, auto)) 32px;
22168
+ grid-template-columns: 200px 160px repeat(2, minmax(160px, 240px)) 32px;
22170
22169
  }
22171
22170
  `;
22172
22171
  var SearchInput = import_react138.css`
@@ -22186,36 +22185,48 @@ var FilterButton = import_react138.css`
22186
22185
  gap: var(--spacing-sm);
22187
22186
  padding: var(--spacing-sm) var(--spacing-base);
22188
22187
  transition: color var(--duration-fast) var(--timing-ease-out),
22189
- background-color var(--duration-fast) var(--timing-ease-out);
22188
+ background-color var(--duration-fast) var(--timing-ease-out),
22189
+ border-color var(--duration-fast) var(--timing-ease-out),
22190
+ box-shadow var(--duration-fast) var(--timing-ease-out);
22190
22191
 
22191
22192
  svg {
22192
22193
  color: var(--gray-300);
22193
22194
  transition: color var(--duration-fast) var(--timing-ease-out);
22194
22195
  }
22195
22196
 
22196
- &:focus,
22197
- &:hover {
22197
+ &:hover,
22198
+ :where([aria-expanded='true']) {
22198
22199
  outline: none;
22199
- background: var(--gray-300);
22200
+ background: var(--gray-200);
22201
+ border-color: var(--gray-300);
22200
22202
 
22201
22203
  svg {
22202
22204
  color: var(--typography-base);
22203
22205
  }
22204
22206
  }
22205
22207
 
22206
- :where([aria-expanded='true']) {
22207
- background: var(--purple-rain-100);
22208
+ &:disabled {
22209
+ opacity: var(--opacity-50);
22210
+ }
22211
+ `;
22212
+ var FilterButtonSelected = import_react138.css`
22213
+ background: var(--gray-100);
22214
+ border-color: var(--gray-300);
22208
22215
 
22209
- svg {
22210
- color: var(--typography-base);
22211
- }
22216
+ svg {
22217
+ color: var(--accent-dark);
22212
22218
  }
22213
22219
  `;
22214
22220
  var FilterButtonWithOptions = import_react138.css`
22215
- background: var(--purple-rain-100);
22216
- color: var(--typography-base);
22217
- svg {
22221
+ :where([aria-expanded='true']) {
22222
+ background: var(--purple-rain-100);
22223
+ border-color: var(--accent-light);
22218
22224
  color: var(--typography-base);
22225
+ box-shadow: var(--elevation-100);
22226
+
22227
+ svg {
22228
+ color: var(--accent-dark);
22229
+ }
22219
22230
  }
22220
22231
  `;
22221
22232
  var SearchIcon = import_react138.css`
@@ -22240,9 +22251,17 @@ var AddConditionalBtn = import_react138.css`
22240
22251
  &:focus {
22241
22252
  color: var(--primary-action-hover);
22242
22253
  }
22254
+
22255
+ &:disabled {
22256
+ color: var(--gray-400);
22257
+ }
22243
22258
  `;
22244
22259
  var Title = import_react138.css`
22245
22260
  color: var(--typography-light);
22261
+
22262
+ &:focus {
22263
+ outline: none;
22264
+ }
22246
22265
  `;
22247
22266
  var ResetConditionsBtn = import_react138.css`
22248
22267
  background: transparent;
@@ -22281,40 +22300,39 @@ var SearchAndFilterOptionsContainer = import_react138.css`
22281
22300
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-base);
22282
22301
  will-change: height;
22283
22302
  position: relative;
22284
- z-index: var(--z-50);
22303
+ z-index: 1;
22285
22304
  `;
22286
22305
  var SearchAndFilterOptionsInnerContainer = import_react138.css`
22287
22306
  display: flex;
22288
22307
  flex-direction: column;
22289
22308
  gap: var(--spacing-sm);
22290
- // TODO: this is nice for responsive but is causing issue with the dropdown
22291
- // ${scrollbarStyles}
22292
- // overflow-x: auto;
22293
- // overflow-y: visible;
22294
22309
  `;
22295
22310
  var SearchAndFilterButtonGroup = import_react138.css`
22296
22311
  margin-top: var(--spacing-base);
22297
22312
  `;
22298
- var SelectOpen = import_react138.css`
22299
- position: relative;
22300
- .input-combobox__menu {
22301
- background: red;
22302
- z-index: 99999 !important;
22303
- }
22304
- `;
22305
22313
 
22306
22314
  // src/components/SearchAndFilter/FilterButton.tsx
22307
22315
  var import_jsx_runtime117 = require("@emotion/react/jsx-runtime");
22308
- var FilterButton2 = ({ text = "Filters", filterCount, ...props }) => {
22316
+ var FilterButton2 = ({
22317
+ text = "Filters",
22318
+ icon = "filter-add",
22319
+ filterCount,
22320
+ hasSelectedValue,
22321
+ ...props
22322
+ }) => {
22309
22323
  return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
22310
22324
  "button",
22311
22325
  {
22312
22326
  type: "button",
22313
- css: [FilterButton, filterCount ? FilterButtonWithOptions : void 0],
22327
+ css: [
22328
+ FilterButton,
22329
+ hasSelectedValue ? FilterButtonSelected : void 0,
22330
+ filterCount ? [FilterButtonWithOptions, FilterButtonSelected] : void 0
22331
+ ],
22314
22332
  ...props,
22315
22333
  "data-testid": "filters-button",
22316
22334
  children: [
22317
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(Icon, { icon: "filter-add", iconColor: "currentColor", size: "1rem" }),
22335
+ /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(Icon, { icon, iconColor: "currentColor", size: "1rem" }),
22318
22336
  text,
22319
22337
  filterCount ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(Counter, { count: filterCount, bgColor: "var(--white)" }) : null
22320
22338
  ]
@@ -22335,7 +22353,7 @@ var SearchAndFilterContext = (0, import_react139.createContext)({
22335
22353
  searchTerm: "",
22336
22354
  setSearchTerm: () => {
22337
22355
  },
22338
- filterVisibility: false,
22356
+ filterVisibility: void 0,
22339
22357
  setFilterVisibility: () => {
22340
22358
  },
22341
22359
  filters: [],
@@ -22347,21 +22365,29 @@ var SearchAndFilterContext = (0, import_react139.createContext)({
22347
22365
  },
22348
22366
  handleDeleteFilter: () => {
22349
22367
  },
22368
+ setSortBy: () => {
22369
+ },
22370
+ sortByValue: "",
22350
22371
  filterOptions: [],
22372
+ sortOptions: [],
22351
22373
  validFilterQuery: [],
22352
22374
  totalResults: 0
22353
22375
  });
22354
22376
  var SearchAndFilterProvider = ({
22355
22377
  filters,
22356
22378
  filterOptions,
22379
+ sortOptions,
22380
+ defaultSortByValue,
22357
22381
  onSearchChange,
22358
22382
  onChange,
22383
+ onSortChange,
22359
22384
  totalResults,
22360
22385
  children
22361
22386
  }) => {
22362
22387
  const [searchTerm, setSearchTerm] = (0, import_react139.useState)("");
22363
22388
  const deferredSearchTerm = (0, import_react139.useDeferredValue)(searchTerm);
22364
- const [filterVisibility, setFilterVisibility] = (0, import_react139.useState)(false);
22389
+ const [filterVisibility, setFilterVisibility] = (0, import_react139.useState)(void 0);
22390
+ const [sortByValue, setSortByValue] = (0, import_react139.useState)(defaultSortByValue);
22365
22391
  const handleSearchTerm = (0, import_react139.useCallback)(
22366
22392
  (term) => {
22367
22393
  setSearchTerm(term);
@@ -22369,8 +22395,15 @@ var SearchAndFilterProvider = ({
22369
22395
  },
22370
22396
  [setSearchTerm, onSearchChange]
22371
22397
  );
22398
+ const handleOnSortChange = (0, import_react139.useCallback)(
22399
+ (sort) => {
22400
+ setSortByValue(sort);
22401
+ onSortChange(sort);
22402
+ },
22403
+ [onSortChange]
22404
+ );
22372
22405
  const handleToggleFilterVisibilty = (0, import_react139.useCallback)(
22373
- (visible) => setFilterVisibility(visible),
22406
+ (mode) => setFilterVisibility(mode),
22374
22407
  [setFilterVisibility]
22375
22408
  );
22376
22409
  const handleAddFilter = (0, import_react139.useCallback)(() => {
@@ -22396,7 +22429,7 @@ var SearchAndFilterProvider = ({
22396
22429
  if (filterVisibility) {
22397
22430
  const handleEscKeyFilterClose = (e) => {
22398
22431
  if (e.key === "Escape") {
22399
- setFilterVisibility(false);
22432
+ setFilterVisibility(void 0);
22400
22433
  }
22401
22434
  };
22402
22435
  document.addEventListener("keydown", (e) => handleEscKeyFilterClose(e));
@@ -22404,21 +22437,24 @@ var SearchAndFilterProvider = ({
22404
22437
  document.removeEventListener("keydown", (e) => handleEscKeyFilterClose(e));
22405
22438
  };
22406
22439
  }
22407
- }, [filterVisibility, setFilterVisibility]);
22440
+ }, [filterVisibility]);
22408
22441
  return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
22409
22442
  SearchAndFilterContext.Provider,
22410
22443
  {
22411
22444
  value: {
22412
22445
  searchTerm: deferredSearchTerm,
22413
22446
  setSearchTerm: (e) => handleSearchTerm(e),
22447
+ setSortBy: (e) => handleOnSortChange(e),
22448
+ sortByValue,
22414
22449
  filterVisibility,
22415
22450
  setFilterVisibility: (e) => handleToggleFilterVisibilty(e),
22416
22451
  filters,
22417
22452
  setFilters: (e) => onChange(e),
22418
- handleAddFilter: () => handleAddFilter(),
22419
- handleResetFilters: () => handleResetFilters(),
22420
- handleDeleteFilter: (index) => handleDeleteFilter(index),
22453
+ handleAddFilter,
22454
+ handleResetFilters,
22455
+ handleDeleteFilter,
22421
22456
  filterOptions,
22457
+ sortOptions,
22422
22458
  validFilterQuery,
22423
22459
  totalResults
22424
22460
  },
@@ -22433,8 +22469,10 @@ var useSearchAndFilter = () => {
22433
22469
 
22434
22470
  // src/components/SearchAndFilter/FilterControls.tsx
22435
22471
  var import_jsx_runtime119 = require("@emotion/react/jsx-runtime");
22436
- var FilterControls = ({ children }) => {
22437
- const { setFilterVisibility, filterVisibility, setSearchTerm, validFilterQuery, searchTerm } = useSearchAndFilter();
22472
+ var FilterControls = ({
22473
+ children
22474
+ }) => {
22475
+ const { setFilterVisibility, filterVisibility, setSearchTerm, validFilterQuery, searchTerm, sortByValue } = useSearchAndFilter();
22438
22476
  const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react140.useState)("");
22439
22477
  (0, import_react_use3.useDebounce)(
22440
22478
  () => {
@@ -22448,6 +22486,15 @@ var FilterControls = ({ children }) => {
22448
22486
  setLocaleSearchTerm("");
22449
22487
  }
22450
22488
  }, [searchTerm]);
22489
+ const handleFilterToggle = (mode) => {
22490
+ if (filterVisibility && ["sort", "filters"].includes(filterVisibility)) {
22491
+ return setFilterVisibility(void 0);
22492
+ }
22493
+ return setFilterVisibility(mode);
22494
+ };
22495
+ const sortByValues = sortByValue ? sortByValue == null ? void 0 : sortByValue.split("_") : "Sort";
22496
+ const sortByValueLabel = Array.isArray(sortByValues) ? sortByValue == null ? void 0 : sortByValue.split("_")[0] : "Sort";
22497
+ const sortByIcon = Array.isArray(sortByValues) ? sortByValues[1] === "ASC" ? "arrow-up" : "arrow-down" : "sort-az";
22451
22498
  return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_jsx_runtime119.Fragment, { children: [
22452
22499
  /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
22453
22500
  FilterButton2,
@@ -22455,9 +22502,23 @@ var FilterControls = ({ children }) => {
22455
22502
  "aria-controls": "search-and-filter-options",
22456
22503
  "aria-label": "filter options",
22457
22504
  "aria-haspopup": "true",
22458
- "aria-expanded": filterVisibility,
22505
+ "aria-expanded": filterVisibility === "filters",
22459
22506
  filterCount: validFilterQuery == null ? void 0 : validFilterQuery.length,
22460
- onClick: () => setFilterVisibility(!filterVisibility)
22507
+ onClick: () => handleFilterToggle("filters")
22508
+ }
22509
+ ),
22510
+ /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
22511
+ FilterButton2,
22512
+ {
22513
+ "aria-controls": "search-and-filter-sortBy",
22514
+ "aria-label": "sort by options",
22515
+ "aria-haspopup": "true",
22516
+ text: sortByValueLabel,
22517
+ icon: sortByIcon,
22518
+ "aria-expanded": filterVisibility === "sort",
22519
+ hasSelectedValue: sortByValue !== "",
22520
+ onClick: () => handleFilterToggle("sort"),
22521
+ "data-testid": "sort-by-dropdown"
22461
22522
  }
22462
22523
  ),
22463
22524
  /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
@@ -22476,7 +22537,7 @@ var FilterControls = ({ children }) => {
22476
22537
 
22477
22538
  // src/components/SearchAndFilter/FilterItem.tsx
22478
22539
  init_emotion_jsx_shim();
22479
- var import_react143 = require("react");
22540
+ var import_react144 = require("react");
22480
22541
 
22481
22542
  // src/components/SearchAndFilter/FilterEditor.tsx
22482
22543
  init_emotion_jsx_shim();
@@ -22605,6 +22666,7 @@ var FilterMultiChoiceEditor = ({
22605
22666
  InputComboBox,
22606
22667
  {
22607
22668
  ...props,
22669
+ placeholder: "Type to search...",
22608
22670
  options,
22609
22671
  isMulti: true,
22610
22672
  isClearable: true,
@@ -22626,6 +22688,7 @@ var FilterSingleChoiceEditor = ({
22626
22688
  return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
22627
22689
  InputComboBox,
22628
22690
  {
22691
+ placeholder: "Type to search...",
22629
22692
  options,
22630
22693
  isClearable: true,
22631
22694
  onChange: (e) => {
@@ -22876,6 +22939,7 @@ var ErrorContainer = ({ errorMessage }) => {
22876
22939
 
22877
22940
  // src/components/SearchAndFilter/FilterMenu.tsx
22878
22941
  init_emotion_jsx_shim();
22942
+ var import_react143 = __toESM(require("react"));
22879
22943
  var import_jsx_runtime122 = require("@emotion/react/jsx-runtime");
22880
22944
  var SearchAndFilterOptionsContainer2 = ({
22881
22945
  buttonRow,
@@ -22895,61 +22959,29 @@ var SearchAndFilterOptionsContainer2 = ({
22895
22959
  ) : null
22896
22960
  ] });
22897
22961
  };
22898
- var FilterMenu = ({
22899
- id,
22900
- addButtonText = "add condition",
22901
- isAddDisabled,
22902
- resetButtonText = "reset filters",
22903
- filterTitle = "Show records",
22904
- children
22905
- }) => {
22906
- const { filterVisibility, handleAddFilter, handleResetFilters, setFilterVisibility, validFilterQuery } = useSearchAndFilter();
22907
- return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(VerticalRhythm, { gap: "sm", "aria-haspopup": "true", id, children: filterVisibility ? /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
22908
- SearchAndFilterOptionsContainer2,
22909
- {
22910
- buttonRow: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
22911
- /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
22912
- "button",
22913
- {
22914
- type: "button",
22915
- css: AddConditionalBtn,
22916
- onClick: handleAddFilter,
22917
- disabled: isAddDisabled,
22918
- children: [
22919
- /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Icon, { icon: "math-plus", iconColor: "gray", size: "1rem" }),
22920
- addButtonText
22921
- ]
22922
- }
22923
- ),
22924
- (validFilterQuery == null ? void 0 : validFilterQuery.length) ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
22925
- "button",
22926
- {
22927
- type: "button",
22928
- css: ResetConditionsBtn,
22929
- onClick: () => {
22930
- handleResetFilters();
22931
- setFilterVisibility(false);
22932
- },
22933
- children: resetButtonText
22934
- }
22935
- ) : null
22936
- ] }),
22937
- children: [
22938
- /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { css: Title, children: filterTitle }),
22939
- /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
22940
- "button",
22941
- {
22942
- type: "button",
22943
- "aria-label": "close filters",
22944
- css: [CloseBtn],
22945
- onClick: () => setFilterVisibility(!filterVisibility),
22946
- children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Icon, { icon: "close", iconColor: "currentColor", size: "1.1rem" })
22947
- }
22948
- ),
22949
- children
22950
- ]
22962
+ var FilterMenu = ({ id, filterTitle = "Show records", menuControls, children }) => {
22963
+ const { filterVisibility, setFilterVisibility } = useSearchAndFilter();
22964
+ const innerMenuRef = import_react143.default.useRef(null);
22965
+ (0, import_react143.useEffect)(() => {
22966
+ var _a;
22967
+ if (filterVisibility) {
22968
+ (_a = innerMenuRef.current) == null ? void 0 : _a.focus();
22951
22969
  }
22952
- ) : null });
22970
+ }, [filterVisibility]);
22971
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(VerticalRhythm, { gap: "sm", "aria-haspopup": "true", id, children: filterVisibility ? /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(SearchAndFilterOptionsContainer2, { buttonRow: menuControls, children: [
22972
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }),
22973
+ /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
22974
+ "button",
22975
+ {
22976
+ type: "button",
22977
+ "aria-label": "close filters",
22978
+ css: [CloseBtn],
22979
+ onClick: () => setFilterVisibility(void 0),
22980
+ children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Icon, { icon: "close", iconColor: "currentColor", size: "1.1rem" })
22981
+ }
22982
+ ),
22983
+ children
22984
+ ] }) : null });
22953
22985
  };
22954
22986
 
22955
22987
  // src/components/SearchAndFilter/FilterItem.tsx
@@ -22969,7 +23001,7 @@ var FilterItem = ({
22969
23001
  const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
22970
23002
  const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
22971
23003
  const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
22972
- const { selectedFieldValue, selectedOperatorValue, selectedMetaValue } = (0, import_react143.useMemo)(() => {
23004
+ const { selectedFieldValue, selectedOperatorValue, selectedMetaValue } = (0, import_react144.useMemo)(() => {
22973
23005
  var _a2, _b2;
22974
23006
  const currentSelectedFilter = filterOptions.find((item) => {
22975
23007
  var _a3;
@@ -23045,8 +23077,19 @@ var FilterItem = ({
23045
23077
  ] })
23046
23078
  ] });
23047
23079
  };
23048
- var FilterItems = () => {
23049
- const { filterOptions, filters, setFilters } = useSearchAndFilter();
23080
+ var FilterItems = ({
23081
+ addButtonText = "add condition",
23082
+ resetButtonText = "reset filters"
23083
+ }) => {
23084
+ const {
23085
+ filterOptions,
23086
+ filters,
23087
+ setFilters,
23088
+ handleAddFilter,
23089
+ handleResetFilters,
23090
+ setFilterVisibility,
23091
+ validFilterQuery
23092
+ } = useSearchAndFilter();
23050
23093
  const handleUpdateFilter = (index, prop, value) => {
23051
23094
  const next = [...filters];
23052
23095
  next[index] = { ...next[index], [prop]: value };
@@ -23065,99 +23108,82 @@ var FilterItems = () => {
23065
23108
  }
23066
23109
  setFilters(next);
23067
23110
  };
23068
- return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(FilterMenu, { id: "search-and-filter-options", children: filters.map((item, i) => {
23069
- var _a, _b, _c, _d, _e, _f;
23070
- const availableTypeOptions = (_b = (_a = filterOptions.find((fo) => {
23071
- var _a2;
23072
- return (_a2 = fo.options) == null ? void 0 : _a2.find((op) => op.value === item.field);
23073
- })) == null ? void 0 : _a.options) != null ? _b : [];
23074
- const possibleValueOptions = (_d = (_c = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _c.valueOptions) != null ? _d : [];
23075
- const possibleOperators = (_f = (_e = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _e.operatorOptions) != null ? _f : [];
23076
- return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
23077
- FilterItem,
23078
- {
23079
- index: i,
23080
- paramOptions: filterOptions,
23081
- onParamChange: (e) => handleUpdateFilter(i, "field", e),
23082
- operatorOptions: possibleOperators,
23083
- onOperatorChange: (e) => handleUpdateFilter(i, "operator", e),
23084
- onValueChange: (e) => handleUpdateFilter(i, "value", e),
23085
- valueOptions: possibleValueOptions
23086
- },
23087
- i
23088
- );
23089
- }) });
23111
+ return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
23112
+ FilterMenu,
23113
+ {
23114
+ id: "search-and-filter-options",
23115
+ menuControls: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(import_jsx_runtime123.Fragment, { children: [
23116
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(
23117
+ "button",
23118
+ {
23119
+ type: "button",
23120
+ css: AddConditionalBtn,
23121
+ onClick: handleAddFilter,
23122
+ disabled: !validFilterQuery,
23123
+ children: [
23124
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Icon, { icon: "math-plus", iconColor: !validFilterQuery ? "currentColor" : "gray", size: "1rem" }),
23125
+ addButtonText
23126
+ ]
23127
+ }
23128
+ ),
23129
+ (validFilterQuery == null ? void 0 : validFilterQuery.length) ? /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
23130
+ "button",
23131
+ {
23132
+ type: "button",
23133
+ css: ResetConditionsBtn,
23134
+ onClick: () => {
23135
+ handleResetFilters();
23136
+ setFilterVisibility(void 0);
23137
+ },
23138
+ children: resetButtonText
23139
+ }
23140
+ ) : null
23141
+ ] }),
23142
+ children: filters.map((item, i) => {
23143
+ var _a, _b, _c, _d, _e, _f;
23144
+ const availableTypeOptions = (_b = (_a = filterOptions.find((fo) => {
23145
+ var _a2;
23146
+ return (_a2 = fo.options) == null ? void 0 : _a2.find((op) => op.value === item.field);
23147
+ })) == null ? void 0 : _a.options) != null ? _b : [];
23148
+ const possibleValueOptions = (_d = (_c = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _c.valueOptions) != null ? _d : [];
23149
+ const possibleOperators = (_f = (_e = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _e.operatorOptions) != null ? _f : [];
23150
+ return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
23151
+ FilterItem,
23152
+ {
23153
+ index: i,
23154
+ paramOptions: filterOptions,
23155
+ onParamChange: (e) => handleUpdateFilter(i, "field", e),
23156
+ operatorOptions: possibleOperators,
23157
+ onOperatorChange: (e) => handleUpdateFilter(i, "operator", e),
23158
+ onValueChange: (e) => handleUpdateFilter(i, "value", e),
23159
+ valueOptions: possibleValueOptions
23160
+ },
23161
+ i
23162
+ );
23163
+ })
23164
+ }
23165
+ );
23090
23166
  };
23091
23167
 
23092
23168
  // src/components/SearchAndFilter/SearchAndFilter.tsx
23093
23169
  init_emotion_jsx_shim();
23094
23170
 
23095
- // src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
23171
+ // src/components/SearchAndFilter/FilterModeView.tsx
23096
23172
  init_emotion_jsx_shim();
23097
- var import_jsx_runtime124 = require("@emotion/react/jsx-runtime");
23098
- var SearchAndFilterResultContainer = ({
23099
- clearButtonLabel = "clear"
23100
- }) => {
23101
- const { searchTerm, setSearchTerm, totalResults } = useSearchAndFilter();
23102
- return searchTerm ? /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(import_jsx_runtime124.Fragment, { children: [
23103
- /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(HorizontalRhythm, { children: [
23104
- /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("span", { children: [
23105
- totalResults,
23106
- " results for ",
23107
- /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("strong", { children: [
23108
- '"',
23109
- searchTerm,
23110
- '"'
23111
- ] })
23112
- ] }),
23113
- /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Button, { buttonType: "ghostDestructive", size: "zero", onClick: () => setSearchTerm(""), children: clearButtonLabel })
23114
- ] }),
23115
- totalResults === 0 ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Callout, { title: "No search results found", type: "note", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Button, { buttonType: "tertiaryOutline", size: "sm", onClick: () => setSearchTerm(""), children: "Clear search" }) }) : null
23116
- ] }) : null;
23117
- };
23118
23173
 
23119
- // src/components/SearchAndFilter/SearchAndFilter.tsx
23120
- var import_jsx_runtime125 = require("@emotion/react/jsx-runtime");
23121
- var SearchAndFilter = ({
23122
- filters,
23123
- filterOptions,
23124
- filterControls = /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(FilterControls, {}),
23125
- viewSwitchControls,
23126
- children = /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(FilterItems, {}),
23127
- onChange,
23128
- onSearchChange,
23129
- totalResults
23130
- }) => {
23131
- return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
23132
- SearchAndFilterProvider,
23133
- {
23134
- filters,
23135
- filterOptions,
23136
- onChange,
23137
- onSearchChange,
23138
- totalResults,
23139
- children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(VerticalRhythm, { css: SearchAndFilterContainer, "data-testid": "search-and-filter", children: [
23140
- /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { css: SearchAndFilterOutterControlWrapper, children: [
23141
- /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("div", { css: SearchAndFilterControlsWrapper, children: filterControls }),
23142
- viewSwitchControls
23143
- ] }),
23144
- children,
23145
- /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(SearchAndFilterResultContainer, {})
23146
- ] })
23147
- }
23148
- );
23149
- };
23174
+ // src/components/SearchAndFilter/SortItems.tsx
23175
+ init_emotion_jsx_shim();
23150
23176
 
23151
23177
  // src/components/SegmentedControl/SegmentedControl.tsx
23152
23178
  init_emotion_jsx_shim();
23153
- var import_react145 = require("@emotion/react");
23179
+ var import_react146 = require("@emotion/react");
23154
23180
  var import_CgCheck5 = require("@react-icons/all-files/cg/CgCheck");
23155
- var import_react146 = require("react");
23181
+ var import_react147 = require("react");
23156
23182
 
23157
23183
  // src/components/SegmentedControl/SegmentedControl.styles.ts
23158
23184
  init_emotion_jsx_shim();
23159
- var import_react144 = require("@emotion/react");
23160
- var segmentedControlStyles = import_react144.css`
23185
+ var import_react145 = require("@emotion/react");
23186
+ var segmentedControlStyles = import_react145.css`
23161
23187
  --segmented-control-rounded-value: var(--rounded-base);
23162
23188
  --segmented-control-border-width: 1px;
23163
23189
  --segmented-control-selected-color: var(--brand-secondary-3);
@@ -23176,14 +23202,14 @@ var segmentedControlStyles = import_react144.css`
23176
23202
  border-radius: calc(var(--segmented-control-rounded-value) + var(--segmented-control-border-width));
23177
23203
  font-size: var(--fs-xs);
23178
23204
  `;
23179
- var segmentedControlVerticalStyles = import_react144.css`
23205
+ var segmentedControlVerticalStyles = import_react145.css`
23180
23206
  flex-direction: column;
23181
23207
  --segmented-control-first-border-radius: var(--segmented-control-rounded-value)
23182
23208
  var(--segmented-control-rounded-value) 0 0;
23183
23209
  --segmented-control-last-border-radius: 0 0 var(--segmented-control-rounded-value)
23184
23210
  var(--segmented-control-rounded-value);
23185
23211
  `;
23186
- var segmentedControlItemStyles = import_react144.css`
23212
+ var segmentedControlItemStyles = import_react145.css`
23187
23213
  &:first-of-type label {
23188
23214
  border-radius: var(--segmented-control-first-border-radius);
23189
23215
  }
@@ -23191,10 +23217,10 @@ var segmentedControlItemStyles = import_react144.css`
23191
23217
  border-radius: var(--segmented-control-last-border-radius);
23192
23218
  }
23193
23219
  `;
23194
- var segmentedControlInputStyles = import_react144.css`
23220
+ var segmentedControlInputStyles = import_react145.css`
23195
23221
  ${accessibleHidden}
23196
23222
  `;
23197
- var segmentedControlLabelStyles = (checked, disabled2) => import_react144.css`
23223
+ var segmentedControlLabelStyles = (checked, disabled2) => import_react145.css`
23198
23224
  position: relative;
23199
23225
  display: flex;
23200
23226
  align-items: center;
@@ -23261,23 +23287,23 @@ var segmentedControlLabelStyles = (checked, disabled2) => import_react144.css`
23261
23287
  `}
23262
23288
  }
23263
23289
  `;
23264
- var segmentedControlLabelIconOnlyStyles = import_react144.css`
23290
+ var segmentedControlLabelIconOnlyStyles = import_react145.css`
23265
23291
  padding-inline: 0.5em;
23266
23292
  `;
23267
- var segmentedControlLabelCheckStyles = import_react144.css`
23293
+ var segmentedControlLabelCheckStyles = import_react145.css`
23268
23294
  opacity: 0.5;
23269
23295
  `;
23270
- var segmentedControlLabelContentStyles = import_react144.css`
23296
+ var segmentedControlLabelContentStyles = import_react145.css`
23271
23297
  display: flex;
23272
23298
  align-items: center;
23273
23299
  justify-content: center;
23274
23300
  gap: var(--spacing-sm);
23275
23301
  height: 100%;
23276
23302
  `;
23277
- var segmentedControlLabelTextStyles = import_react144.css``;
23303
+ var segmentedControlLabelTextStyles = import_react145.css``;
23278
23304
 
23279
23305
  // src/components/SegmentedControl/SegmentedControl.tsx
23280
- var import_jsx_runtime126 = require("@emotion/react/jsx-runtime");
23306
+ var import_jsx_runtime124 = require("@emotion/react/jsx-runtime");
23281
23307
  var SegmentedControl = ({
23282
23308
  name,
23283
23309
  options,
@@ -23289,7 +23315,7 @@ var SegmentedControl = ({
23289
23315
  size = "md",
23290
23316
  ...props
23291
23317
  }) => {
23292
- const onOptionChange = (0, import_react146.useCallback)(
23318
+ const onOptionChange = (0, import_react147.useCallback)(
23293
23319
  (event) => {
23294
23320
  if (event.target.checked) {
23295
23321
  onChange == null ? void 0 : onChange(options[parseInt(event.target.value)].value);
@@ -23297,18 +23323,18 @@ var SegmentedControl = ({
23297
23323
  },
23298
23324
  [options, onChange]
23299
23325
  );
23300
- const sizeStyles = (0, import_react146.useMemo)(() => {
23326
+ const sizeStyles = (0, import_react147.useMemo)(() => {
23301
23327
  const map = {
23302
- sm: (0, import_react145.css)({ height: "calc(24px - 2px)", fontSize: "var(--fs-xs)" }),
23303
- md: (0, import_react145.css)({ height: "calc(32px - 2px)", fontSize: "var(--fs-sm)" }),
23304
- lg: (0, import_react145.css)({ height: "calc(40px - 2px)", fontSize: "var(--fs-base)" })
23328
+ sm: (0, import_react146.css)({ height: "calc(24px - 2px)", fontSize: "var(--fs-xs)" }),
23329
+ md: (0, import_react146.css)({ height: "calc(32px - 2px)", fontSize: "var(--fs-sm)" }),
23330
+ lg: (0, import_react146.css)({ height: "calc(40px - 2px)", fontSize: "var(--fs-base)" })
23305
23331
  };
23306
23332
  return map[size];
23307
23333
  }, [size]);
23308
- const isIconOnly = (0, import_react146.useMemo)(() => {
23334
+ const isIconOnly = (0, import_react147.useMemo)(() => {
23309
23335
  return options.every((option) => option && option.icon && !option.label);
23310
23336
  }, [options]);
23311
- return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
23337
+ return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
23312
23338
  "div",
23313
23339
  {
23314
23340
  css: [segmentedControlStyles, orientation === "vertical" ? segmentedControlVerticalStyles : void 0],
@@ -23320,7 +23346,7 @@ var SegmentedControl = ({
23320
23346
  }
23321
23347
  const text = option.label ? option.label : option.icon ? null : String(option.value);
23322
23348
  const isDisabled = disabled2 || option.disabled;
23323
- return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Tooltip, { title: (_a = option.tooltip) != null ? _a : "", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { css: segmentedControlItemStyles, "data-testid": "container-segmented-control", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
23349
+ return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Tooltip, { title: (_a = option.tooltip) != null ? _a : "", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("div", { css: segmentedControlItemStyles, "data-testid": "container-segmented-control", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
23324
23350
  "label",
23325
23351
  {
23326
23352
  css: [
@@ -23329,7 +23355,7 @@ var SegmentedControl = ({
23329
23355
  isIconOnly ? segmentedControlLabelIconOnlyStyles : void 0
23330
23356
  ],
23331
23357
  children: [
23332
- /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
23358
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
23333
23359
  "input",
23334
23360
  {
23335
23361
  css: segmentedControlInputStyles,
@@ -23341,10 +23367,10 @@ var SegmentedControl = ({
23341
23367
  disabled: isDisabled
23342
23368
  }
23343
23369
  ),
23344
- option.value !== value || noCheckmark ? null : /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_CgCheck5.CgCheck, { css: segmentedControlLabelCheckStyles, "aria-label": "Selected", size: "1.5em" }),
23345
- /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("span", { css: segmentedControlLabelContentStyles, children: [
23346
- !option.icon ? null : /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(Icon, { icon: option.icon, size: "1.5em", iconColor: "currentColor" }),
23347
- !text ? null : /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { css: segmentedControlLabelTextStyles, children: text })
23370
+ option.value !== value || noCheckmark ? null : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_CgCheck5.CgCheck, { css: segmentedControlLabelCheckStyles, "aria-label": "Selected", size: "1.5em" }),
23371
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("span", { css: segmentedControlLabelContentStyles, children: [
23372
+ !option.icon ? null : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Icon, { icon: option.icon, size: "1.5em", iconColor: "currentColor" }),
23373
+ !text ? null : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { css: segmentedControlLabelTextStyles, children: text })
23348
23374
  ] })
23349
23375
  ]
23350
23376
  }
@@ -23354,23 +23380,136 @@ var SegmentedControl = ({
23354
23380
  );
23355
23381
  };
23356
23382
 
23383
+ // src/components/SearchAndFilter/SortItems.tsx
23384
+ var import_jsx_runtime125 = require("@emotion/react/jsx-runtime");
23385
+ var SortItems = () => {
23386
+ var _a, _b;
23387
+ const { sortOptions, setSortBy, sortByValue } = useSearchAndFilter();
23388
+ const values = sortByValue.split("_");
23389
+ const sortDirection = values.pop();
23390
+ const sortField = values.join("_");
23391
+ const currentSelectedOption = (_b = (_a = sortOptions.find((item) => {
23392
+ var _a2;
23393
+ return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
23394
+ })) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
23395
+ return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(FilterMenu, { id: "search-and-filter-options", filterTitle: "Sort by", children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("div", { css: ConditionalFilterRow, children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { css: ConditionalInputRow, children: [
23396
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
23397
+ InputComboBox,
23398
+ {
23399
+ options: sortOptions,
23400
+ onChange: (e) => {
23401
+ const fieldName = e == null ? void 0 : e.value;
23402
+ setSortBy(`${fieldName}_${sortDirection}`);
23403
+ },
23404
+ value: currentSelectedOption
23405
+ }
23406
+ ),
23407
+ /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
23408
+ SegmentedControl,
23409
+ {
23410
+ noCheckmark: true,
23411
+ name: "sortBy",
23412
+ options: [
23413
+ { label: "Ascending", value: `ASC` },
23414
+ { label: "Descending", value: `DESC` }
23415
+ ],
23416
+ onChange: (e) => setSortBy(`${sortField}_${e}`),
23417
+ value: sortDirection
23418
+ }
23419
+ )
23420
+ ] }) }) });
23421
+ };
23422
+
23423
+ // src/components/SearchAndFilter/FilterModeView.tsx
23424
+ var import_jsx_runtime126 = require("@emotion/react/jsx-runtime");
23425
+ var FilterModeView = () => {
23426
+ const { filterVisibility } = useSearchAndFilter();
23427
+ const modeView = {
23428
+ filters: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(FilterItems, {}),
23429
+ sort: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(SortItems, {})
23430
+ };
23431
+ return filterVisibility ? modeView[filterVisibility] : null;
23432
+ };
23433
+
23434
+ // src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
23435
+ init_emotion_jsx_shim();
23436
+ var import_jsx_runtime127 = require("@emotion/react/jsx-runtime");
23437
+ var SearchAndFilterResultContainer = ({
23438
+ clearButtonLabel = "clear"
23439
+ }) => {
23440
+ const { searchTerm, setSearchTerm, totalResults } = useSearchAndFilter();
23441
+ return searchTerm ? /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
23442
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(HorizontalRhythm, { children: [
23443
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("span", { children: [
23444
+ totalResults,
23445
+ " results for ",
23446
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("strong", { children: [
23447
+ '"',
23448
+ searchTerm,
23449
+ '"'
23450
+ ] })
23451
+ ] }),
23452
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Button, { buttonType: "ghostDestructive", size: "zero", onClick: () => setSearchTerm(""), children: clearButtonLabel })
23453
+ ] }),
23454
+ totalResults === 0 ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Callout, { title: "No search results found", type: "note", children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Button, { buttonType: "tertiaryOutline", size: "sm", onClick: () => setSearchTerm(""), children: "Clear search" }) }) : null
23455
+ ] }) : null;
23456
+ };
23457
+
23458
+ // src/components/SearchAndFilter/SearchAndFilter.tsx
23459
+ var import_jsx_runtime128 = require("@emotion/react/jsx-runtime");
23460
+ var SearchAndFilter = ({
23461
+ filters,
23462
+ filterOptions,
23463
+ sortOptions,
23464
+ defaultSortByValue,
23465
+ filterControls = /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(FilterControls, {}),
23466
+ viewSwitchControls,
23467
+ children = /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(FilterModeView, {}),
23468
+ onChange,
23469
+ onSearchChange,
23470
+ onSortChange,
23471
+ totalResults
23472
+ }) => {
23473
+ return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
23474
+ SearchAndFilterProvider,
23475
+ {
23476
+ filters,
23477
+ filterOptions,
23478
+ defaultSortByValue,
23479
+ sortOptions,
23480
+ onChange,
23481
+ onSearchChange,
23482
+ onSortChange,
23483
+ totalResults,
23484
+ children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(VerticalRhythm, { css: SearchAndFilterContainer, "data-testid": "search-and-filter", children: [
23485
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { css: SearchAndFilterOutterControlWrapper, children: [
23486
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { css: SearchAndFilterControlsWrapper, children: filterControls }),
23487
+ viewSwitchControls
23488
+ ] }),
23489
+ children,
23490
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(SearchAndFilterResultContainer, {})
23491
+ ] })
23492
+ }
23493
+ );
23494
+ };
23495
+
23357
23496
  // src/components/Skeleton/Skeleton.tsx
23358
23497
  init_emotion_jsx_shim();
23359
23498
 
23360
23499
  // src/components/Skeleton/Skeleton.styles.ts
23361
23500
  init_emotion_jsx_shim();
23362
- var import_react147 = require("@emotion/react");
23363
- var lightFadingOut = import_react147.keyframes`
23501
+ var import_react148 = require("@emotion/react");
23502
+ var lightFadingOut = import_react148.keyframes`
23364
23503
  from { opacity: 0.1; }
23365
23504
  to { opacity: 0.025; }
23366
23505
  `;
23367
- var skeletonStyles = import_react147.css`
23506
+ var skeletonStyles = import_react148.css`
23368
23507
  animation: ${lightFadingOut} 1s ease-out infinite alternate;
23369
23508
  background-color: var(--gray-900);
23370
23509
  `;
23371
23510
 
23372
23511
  // src/components/Skeleton/Skeleton.tsx
23373
- var import_jsx_runtime127 = require("@emotion/react/jsx-runtime");
23512
+ var import_jsx_runtime129 = require("@emotion/react/jsx-runtime");
23374
23513
  var Skeleton = ({
23375
23514
  width = "100%",
23376
23515
  height = "1.25rem",
@@ -23378,7 +23517,7 @@ var Skeleton = ({
23378
23517
  circle = false,
23379
23518
  children,
23380
23519
  ...otherProps
23381
- }) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
23520
+ }) => /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
23382
23521
  "div",
23383
23522
  {
23384
23523
  css: [
@@ -23399,12 +23538,12 @@ var Skeleton = ({
23399
23538
 
23400
23539
  // src/components/Switch/Switch.tsx
23401
23540
  init_emotion_jsx_shim();
23402
- var React25 = __toESM(require("react"));
23541
+ var React26 = __toESM(require("react"));
23403
23542
 
23404
23543
  // src/components/Switch/Switch.styles.ts
23405
23544
  init_emotion_jsx_shim();
23406
- var import_react148 = require("@emotion/react");
23407
- var SwitchInputContainer = import_react148.css`
23545
+ var import_react149 = require("@emotion/react");
23546
+ var SwitchInputContainer = import_react149.css`
23408
23547
  cursor: pointer;
23409
23548
  display: inline-block;
23410
23549
  position: relative;
@@ -23413,7 +23552,7 @@ var SwitchInputContainer = import_react148.css`
23413
23552
  vertical-align: middle;
23414
23553
  user-select: none;
23415
23554
  `;
23416
- var SwitchInput = import_react148.css`
23555
+ var SwitchInput = import_react149.css`
23417
23556
  appearance: none;
23418
23557
  border-radius: var(--rounded-full);
23419
23558
  background-color: var(--white);
@@ -23451,7 +23590,7 @@ var SwitchInput = import_react148.css`
23451
23590
  cursor: not-allowed;
23452
23591
  }
23453
23592
  `;
23454
- var SwitchInputDisabled = import_react148.css`
23593
+ var SwitchInputDisabled = import_react149.css`
23455
23594
  opacity: var(--opacity-50);
23456
23595
  cursor: not-allowed;
23457
23596
 
@@ -23459,7 +23598,7 @@ var SwitchInputDisabled = import_react148.css`
23459
23598
  cursor: not-allowed;
23460
23599
  }
23461
23600
  `;
23462
- var SwitchInputLabel = import_react148.css`
23601
+ var SwitchInputLabel = import_react149.css`
23463
23602
  align-items: center;
23464
23603
  color: var(--typography-base);
23465
23604
  display: inline-flex;
@@ -23480,26 +23619,26 @@ var SwitchInputLabel = import_react148.css`
23480
23619
  top: 0;
23481
23620
  }
23482
23621
  `;
23483
- var SwitchText = import_react148.css`
23622
+ var SwitchText = import_react149.css`
23484
23623
  color: var(--gray-500);
23485
23624
  font-size: var(--fs-sm);
23486
23625
  padding-inline: var(--spacing-2xl) 0;
23487
23626
  `;
23488
23627
 
23489
23628
  // src/components/Switch/Switch.tsx
23490
- var import_jsx_runtime128 = require("@emotion/react/jsx-runtime");
23491
- var Switch = React25.forwardRef(
23629
+ var import_jsx_runtime130 = require("@emotion/react/jsx-runtime");
23630
+ var Switch = React26.forwardRef(
23492
23631
  ({ label, infoText, toggleText, children, ...inputProps }, ref) => {
23493
23632
  let additionalText = infoText;
23494
23633
  if (infoText && toggleText) {
23495
23634
  additionalText = inputProps.checked ? toggleText : infoText;
23496
23635
  }
23497
- return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
23498
- /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("label", { css: [SwitchInputContainer, inputProps.disabled ? SwitchInputDisabled : void 0], children: [
23499
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("input", { type: "checkbox", css: SwitchInput, ...inputProps, ref }),
23500
- /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("span", { css: SwitchInputLabel, children: label })
23636
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
23637
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("label", { css: [SwitchInputContainer, inputProps.disabled ? SwitchInputDisabled : void 0], children: [
23638
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("input", { type: "checkbox", css: SwitchInput, ...inputProps, ref }),
23639
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { css: SwitchInputLabel, children: label })
23501
23640
  ] }),
23502
- additionalText ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("p", { css: SwitchText, children: additionalText }) : null,
23641
+ additionalText ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("p", { css: SwitchText, children: additionalText }) : null,
23503
23642
  children
23504
23643
  ] });
23505
23644
  }
@@ -23507,12 +23646,12 @@ var Switch = React25.forwardRef(
23507
23646
 
23508
23647
  // src/components/Table/Table.tsx
23509
23648
  init_emotion_jsx_shim();
23510
- var React26 = __toESM(require("react"));
23649
+ var React27 = __toESM(require("react"));
23511
23650
 
23512
23651
  // src/components/Table/Table.styles.ts
23513
23652
  init_emotion_jsx_shim();
23514
- var import_react149 = require("@emotion/react");
23515
- var table = ({ cellPadding = "var(--spacing-base) var(--spacing-md)" }) => import_react149.css`
23653
+ var import_react150 = require("@emotion/react");
23654
+ var table = ({ cellPadding = "var(--spacing-base) var(--spacing-md)" }) => import_react150.css`
23516
23655
  border-bottom: 1px solid var(--gray-400);
23517
23656
  border-collapse: collapse;
23518
23657
  min-width: 100%;
@@ -23523,67 +23662,67 @@ var table = ({ cellPadding = "var(--spacing-base) var(--spacing-md)" }) => impor
23523
23662
  padding: ${cellPadding};
23524
23663
  }
23525
23664
  `;
23526
- var tableHead = import_react149.css`
23665
+ var tableHead = import_react150.css`
23527
23666
  background: var(--gray-100);
23528
23667
  color: var(--typography-base);
23529
23668
  text-align: left;
23530
23669
  `;
23531
- var tableRow = import_react149.css`
23670
+ var tableRow = import_react150.css`
23532
23671
  border-bottom: 1px solid var(--gray-200);
23533
23672
  `;
23534
- var tableCellHead = import_react149.css`
23673
+ var tableCellHead = import_react150.css`
23535
23674
  font-size: var(--fs-sm);
23536
23675
  text-transform: uppercase;
23537
23676
  font-weight: var(--fw-bold);
23538
23677
  `;
23539
23678
 
23540
23679
  // src/components/Table/Table.tsx
23541
- var import_jsx_runtime129 = require("@emotion/react/jsx-runtime");
23542
- var Table = React26.forwardRef(
23680
+ var import_jsx_runtime131 = require("@emotion/react/jsx-runtime");
23681
+ var Table = React27.forwardRef(
23543
23682
  ({ children, cellPadding, ...otherProps }, ref) => {
23544
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("table", { ref, css: table({ cellPadding }), ...otherProps, children });
23683
+ return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("table", { ref, css: table({ cellPadding }), ...otherProps, children });
23545
23684
  }
23546
23685
  );
23547
- var TableHead = React26.forwardRef(
23686
+ var TableHead = React27.forwardRef(
23548
23687
  ({ children, ...otherProps }, ref) => {
23549
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("thead", { ref, css: tableHead, ...otherProps, children });
23688
+ return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("thead", { ref, css: tableHead, ...otherProps, children });
23550
23689
  }
23551
23690
  );
23552
- var TableBody = React26.forwardRef(
23691
+ var TableBody = React27.forwardRef(
23553
23692
  ({ children, ...otherProps }, ref) => {
23554
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("tbody", { ref, ...otherProps, children });
23693
+ return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("tbody", { ref, ...otherProps, children });
23555
23694
  }
23556
23695
  );
23557
- var TableFoot = React26.forwardRef(
23696
+ var TableFoot = React27.forwardRef(
23558
23697
  ({ children, ...otherProps }, ref) => {
23559
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("tfoot", { ref, ...otherProps, children });
23698
+ return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("tfoot", { ref, ...otherProps, children });
23560
23699
  }
23561
23700
  );
23562
- var TableRow = React26.forwardRef(
23701
+ var TableRow = React27.forwardRef(
23563
23702
  ({ children, ...otherProps }, ref) => {
23564
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("tr", { ref, css: tableRow, ...otherProps, children });
23703
+ return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("tr", { ref, css: tableRow, ...otherProps, children });
23565
23704
  }
23566
23705
  );
23567
- var TableCellHead = React26.forwardRef(
23706
+ var TableCellHead = React27.forwardRef(
23568
23707
  ({ children, ...otherProps }, ref) => {
23569
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("th", { ref, css: tableCellHead, ...otherProps, children });
23708
+ return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("th", { ref, css: tableCellHead, ...otherProps, children });
23570
23709
  }
23571
23710
  );
23572
- var TableCellData = React26.forwardRef(
23711
+ var TableCellData = React27.forwardRef(
23573
23712
  ({ children, ...otherProps }, ref) => {
23574
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("td", { ref, ...otherProps, children });
23713
+ return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("td", { ref, ...otherProps, children });
23575
23714
  }
23576
23715
  );
23577
23716
 
23578
23717
  // src/components/Tabs/Tabs.tsx
23579
23718
  init_emotion_jsx_shim();
23580
- var import_react151 = require("@ariakit/react");
23581
- var import_react152 = require("react");
23719
+ var import_react152 = require("@ariakit/react");
23720
+ var import_react153 = require("react");
23582
23721
 
23583
23722
  // src/components/Tabs/Tabs.styles.ts
23584
23723
  init_emotion_jsx_shim();
23585
- var import_react150 = require("@emotion/react");
23586
- var tabButtonStyles = import_react150.css`
23724
+ var import_react151 = require("@emotion/react");
23725
+ var tabButtonStyles = import_react151.css`
23587
23726
  align-items: center;
23588
23727
  border: 0;
23589
23728
  height: 2.5rem;
@@ -23600,16 +23739,16 @@ var tabButtonStyles = import_react150.css`
23600
23739
  box-shadow: inset 0 -2px 0 var(--brand-secondary-3);
23601
23740
  }
23602
23741
  `;
23603
- var tabButtonGroupStyles = import_react150.css`
23742
+ var tabButtonGroupStyles = import_react151.css`
23604
23743
  display: flex;
23605
23744
  gap: var(--spacing-base);
23606
23745
  border-bottom: 1px solid var(--gray-300);
23607
23746
  `;
23608
23747
 
23609
23748
  // src/components/Tabs/Tabs.tsx
23610
- var import_jsx_runtime130 = require("@emotion/react/jsx-runtime");
23749
+ var import_jsx_runtime132 = require("@emotion/react/jsx-runtime");
23611
23750
  var useCurrentTab = () => {
23612
- const context = (0, import_react151.useTabStore)();
23751
+ const context = (0, import_react152.useTabStore)();
23613
23752
  if (!context) {
23614
23753
  throw new Error("This component can only be used inside <Tabs>");
23615
23754
  }
@@ -23623,13 +23762,13 @@ var Tabs = ({
23623
23762
  manual,
23624
23763
  ...props
23625
23764
  }) => {
23626
- const selected = (0, import_react152.useMemo)(() => {
23765
+ const selected = (0, import_react153.useMemo)(() => {
23627
23766
  if (selectedId)
23628
23767
  return selectedId;
23629
23768
  return useHashForState && typeof window !== "undefined" && window.location.hash ? window.location.hash.substring(1) : void 0;
23630
23769
  }, [selectedId, useHashForState]);
23631
- const tab = (0, import_react151.useTabStore)({ ...props, selectOnMove: !manual, selectedId: selected });
23632
- const onTabSelect = (0, import_react152.useCallback)(
23770
+ const tab = (0, import_react152.useTabStore)({ ...props, selectOnMove: !manual, selectedId: selected });
23771
+ const onTabSelect = (0, import_react153.useCallback)(
23633
23772
  (value) => {
23634
23773
  const selectedValueWithoutNull = value != null ? value : void 0;
23635
23774
  onSelectedIdChange == null ? void 0 : onSelectedIdChange(selectedValueWithoutNull);
@@ -23640,28 +23779,28 @@ var Tabs = ({
23640
23779
  },
23641
23780
  [onSelectedIdChange, useHashForState]
23642
23781
  );
23643
- (0, import_react152.useEffect)(() => {
23782
+ (0, import_react153.useEffect)(() => {
23644
23783
  if (selected && selected !== tab.getState().activeId) {
23645
23784
  tab.setSelectedId(selected);
23646
23785
  }
23647
23786
  }, [selected, tab]);
23648
- return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_react151.TabProvider, { store: tab, setSelectedId: onTabSelect, children });
23787
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_react152.TabProvider, { store: tab, setSelectedId: onTabSelect, children });
23649
23788
  };
23650
23789
  var TabButtonGroup = ({ children, ...props }) => {
23651
- return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_react151.TabList, { ...props, css: tabButtonGroupStyles, children });
23790
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_react152.TabList, { ...props, css: tabButtonGroupStyles, children });
23652
23791
  };
23653
23792
  var TabButton = ({
23654
23793
  children,
23655
23794
  id,
23656
23795
  ...props
23657
23796
  }) => {
23658
- return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_react151.Tab, { type: "button", id, ...props, css: tabButtonStyles, children });
23797
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_react152.Tab, { type: "button", id, ...props, css: tabButtonStyles, children });
23659
23798
  };
23660
23799
  var TabContent = ({
23661
23800
  children,
23662
23801
  ...props
23663
23802
  }) => {
23664
- return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_react151.TabPanel, { ...props, children });
23803
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_react152.TabPanel, { ...props, children });
23665
23804
  };
23666
23805
 
23667
23806
  // src/components/Toast/Toast.tsx
@@ -23670,8 +23809,8 @@ var import_react_toastify = require("react-toastify");
23670
23809
 
23671
23810
  // src/components/Toast/Toast.styles.ts
23672
23811
  init_emotion_jsx_shim();
23673
- var import_react153 = require("@emotion/react");
23674
- var toastContainerStyles = import_react153.css`
23812
+ var import_react154 = require("@emotion/react");
23813
+ var toastContainerStyles = import_react154.css`
23675
23814
  ${functionalColors}
23676
23815
 
23677
23816
  --toastify-color-light: white;
@@ -23894,9 +24033,9 @@ var toastContainerStyles = import_react153.css`
23894
24033
  `;
23895
24034
 
23896
24035
  // src/components/Toast/Toast.tsx
23897
- var import_jsx_runtime131 = require("@emotion/react/jsx-runtime");
24036
+ var import_jsx_runtime133 = require("@emotion/react/jsx-runtime");
23898
24037
  var ToastContainer = ({ limit = 4 }) => {
23899
- return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
24038
+ return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
23900
24039
  import_react_toastify.ToastContainer,
23901
24040
  {
23902
24041
  css: toastContainerStyles,