@uniformdev/design-system 19.119.0 → 19.121.1-alpha.3

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/esm/index.js CHANGED
@@ -639,7 +639,7 @@ var input = (whiteSpaceWrap) => css2`
639
639
  border-radius: var(--rounded-sm);
640
640
  color: var(--gray-700);
641
641
  padding: var(--input-padding);
642
- min-height: 46px;
642
+ min-height: 50px;
643
643
  width: 100%;
644
644
  position: relative;
645
645
  white-space: ${whiteSpaceWrap};
@@ -1232,6 +1232,9 @@ var IconColorAction = css8`
1232
1232
  var IconColorAccent = css8`
1233
1233
  color: var(--accent-alt-dark);
1234
1234
  `;
1235
+ var IconColorAccentDark = css8`
1236
+ color: var(--accent-dark);
1237
+ `;
1235
1238
  var IconColorAccentLight = css8`
1236
1239
  color: var(--accent-light);
1237
1240
  `;
@@ -1252,7 +1255,7 @@ function IconsProvider({ children }) {
1252
1255
  const [isLoading, setIsLoading] = useState2(true);
1253
1256
  const [iconsMap, setIconsMap] = useState2({});
1254
1257
  const initializeIconsMap = async () => {
1255
- const { importedIcons } = await import("./importedIcons-GRLD5JXK.js");
1258
+ const { importedIcons } = await import("./importedIcons-XEGXOSVC.js");
1256
1259
  setIconsMap({ ...importedIcons, ...customIcons });
1257
1260
  setIsLoading(false);
1258
1261
  };
@@ -1275,6 +1278,7 @@ var IconInner = ({ icon, iconColor = "default", size = "1.5rem", ...otherProps }
1275
1278
  red: IconColorRed,
1276
1279
  accent: IconColorAccent,
1277
1280
  currentColor: IconColorCurrent,
1281
+ "accent-dark": IconColorAccentDark,
1278
1282
  "accent-light": IconColorAccentLight
1279
1283
  };
1280
1284
  if (isIconName && isLoading) {
@@ -2553,7 +2557,7 @@ import { css as css15 } from "@emotion/react";
2553
2557
  var PageHeaderSectionContainer = css15`
2554
2558
  display: flex;
2555
2559
  justify-content: space-between;
2556
- margin-bottom: var(--spacing-lg);
2560
+ margin-bottom: var(--spacing-sm);
2557
2561
  flex-direction: column;
2558
2562
  gap: var(--spacing-sm);
2559
2563
 
@@ -12215,7 +12219,7 @@ var ButtonWithMenu = ({
12215
12219
  };
12216
12220
 
12217
12221
  // src/components/Calendar/Calendar.tsx
12218
- import { parseDate, today } from "@internationalized/date";
12222
+ import { isToday, parseDate, today } from "@internationalized/date";
12219
12223
  import { useCallback, useState as useState3 } from "react";
12220
12224
  import {
12221
12225
  Button as AriaButton,
@@ -12228,6 +12232,7 @@ import {
12228
12232
  // src/components/Calendar/Calendar.styles.ts
12229
12233
  import { css as css28 } from "@emotion/react";
12230
12234
  var container = css28`
12235
+ --calendar-cell-size: 1.8rem;
12231
12236
  width: fit-content;
12232
12237
  max-width: 100%;
12233
12238
  `;
@@ -12252,13 +12257,13 @@ var headerNavButton = css28`
12252
12257
  }
12253
12258
  `;
12254
12259
  var cell = css28`
12255
- width: 2rem;
12256
- line-height: 2rem;
12260
+ width: var(--calendar-cell-size);
12261
+ line-height: var(--calendar-cell-size);
12257
12262
  text-align: center;
12258
12263
  border-radius: var(--rounded-sm);
12259
12264
  cursor: default;
12260
12265
  outline: none;
12261
- margin: 1px;
12266
+ margin: 1px 0;
12262
12267
  forced-color-adjust: none;
12263
12268
 
12264
12269
  &:hover {
@@ -12284,6 +12289,12 @@ var cell = css28`
12284
12289
  color: var(--white);
12285
12290
  }
12286
12291
  `;
12292
+ var cellIsOutsideRange = css28`
12293
+ color: var(--gray-400);
12294
+ `;
12295
+ var cellIsToday = css28`
12296
+ background: var(--gray-200);
12297
+ `;
12287
12298
  var actions = css28`
12288
12299
  display: flex;
12289
12300
  justify-content: end;
@@ -12312,6 +12323,9 @@ var Calendar = ({
12312
12323
  ...props
12313
12324
  }) => {
12314
12325
  const [focusedValue, setFocusedValue] = useState3(void 0);
12326
+ const today_date = today(timeZone);
12327
+ const minDate = tryParseDate(minValue);
12328
+ const maxDate = tryParseDate(maxValue);
12315
12329
  const handleChange = useCallback(
12316
12330
  (value2) => {
12317
12331
  onChange == null ? void 0 : onChange(value2.toString());
@@ -12319,10 +12333,9 @@ var Calendar = ({
12319
12333
  [onChange]
12320
12334
  );
12321
12335
  const gotoToday = useCallback(() => {
12322
- const date = today(timeZone);
12323
- onChange == null ? void 0 : onChange(date.toString());
12324
- setFocusedValue(date);
12325
- }, [onChange, timeZone]);
12336
+ onChange == null ? void 0 : onChange(today_date.toString());
12337
+ setFocusedValue(today_date);
12338
+ }, [onChange, today_date]);
12326
12339
  return /* @__PURE__ */ jsxs18("div", { ...props, children: [
12327
12340
  /* @__PURE__ */ jsxs18(
12328
12341
  AriaCalendar,
@@ -12330,8 +12343,8 @@ var Calendar = ({
12330
12343
  value: tryParseDate(value) || null,
12331
12344
  focusedValue,
12332
12345
  onFocusChange: setFocusedValue,
12333
- minValue: tryParseDate(minValue),
12334
- maxValue: tryParseDate(maxValue),
12346
+ minValue: minDate,
12347
+ maxValue: maxDate,
12335
12348
  onChange: handleChange,
12336
12349
  css: container,
12337
12350
  "aria-label": "Appointment date",
@@ -12358,7 +12371,18 @@ var Calendar = ({
12358
12371
  }
12359
12372
  )
12360
12373
  ] }),
12361
- /* @__PURE__ */ jsx29(CalendarGrid, { children: (date) => /* @__PURE__ */ jsx29(CalendarCell, { css: cell, date }) })
12374
+ /* @__PURE__ */ jsx29(CalendarGrid, { children: (date) => /* @__PURE__ */ jsx29(
12375
+ CalendarCell,
12376
+ {
12377
+ css: [
12378
+ cell,
12379
+ minDate && date.compare(minDate) < 0 ? cellIsOutsideRange : null,
12380
+ maxDate && date.compare(maxDate) > 0 ? cellIsOutsideRange : null,
12381
+ isToday(date, timeZone) ? cellIsToday : null
12382
+ ],
12383
+ date
12384
+ }
12385
+ ) })
12362
12386
  ]
12363
12387
  }
12364
12388
  ),
@@ -13375,7 +13399,7 @@ var DashedBox = ({
13375
13399
  };
13376
13400
 
13377
13401
  // src/components/DateTimePicker/DateTimePicker.tsx
13378
- import { getLocalTimeZone as getLocalTimeZone2, parseDate as parseDate2, parseTime as parseTime2 } from "@internationalized/date";
13402
+ import { getLocalTimeZone as getLocalTimeZone2, parseDate as parseDate2, parseTime as parseTime2, Time as Time3 } from "@internationalized/date";
13379
13403
  import { createContext as createContext2, useCallback as useCallback3, useContext as useContext3, useEffect as useEffect4, useMemo, useState as useState6 } from "react";
13380
13404
  import { Popover as Popover2, PopoverDisclosure, usePopoverState } from "reakit/Popover";
13381
13405
 
@@ -13817,6 +13841,13 @@ function InputComboBox(props) {
13817
13841
  boxShadow: "none",
13818
13842
  borderColor: "var(--accent-dark-hover)"
13819
13843
  },
13844
+ '&:has([aria-readonly="true"])': {
13845
+ background: "var(--gray-100)",
13846
+ "&:hover": {
13847
+ borderColor: "var(--gray-300)"
13848
+ },
13849
+ ...state.isFocused ? { borderColor: "var(--gray-300)" } : {}
13850
+ },
13820
13851
  ...(_b = (_a2 = props.styles) == null ? void 0 : _a2.control) == null ? void 0 : _b.call(_a2, base, state)
13821
13852
  };
13822
13853
  },
@@ -14482,7 +14513,7 @@ var popover = css52`
14482
14513
  padding: var(--spacing-md);
14483
14514
  max-width: none;
14484
14515
  gap: var(--spacing-md);
14485
- grid-template-columns: 1fr 0.9fr;
14516
+ grid-template-columns: 0.8fr 1fr;
14486
14517
  grid-template-rows: 1fr 1fr;
14487
14518
 
14488
14519
  [data-variant='date'] & {
@@ -14544,7 +14575,7 @@ import {
14544
14575
  function getTimeZoneLabel(tz) {
14545
14576
  var _a;
14546
14577
  const offset = (_a = Intl.DateTimeFormat("en", { timeZoneName: "shortOffset", timeZone: tz }).formatToParts().find((p) => p.type === "timeZoneName")) == null ? void 0 : _a.value;
14547
- return tz + (offset ? ` (${offset})` : "");
14578
+ return String(tz).replace(/_/g, " ") + (offset ? ` (${offset})` : "");
14548
14579
  }
14549
14580
  function tryParseAbsolute(isoDateTime, timeZone) {
14550
14581
  try {
@@ -14579,7 +14610,8 @@ var DateTimePickerVariant = /* @__PURE__ */ ((DateTimePickerVariant2) => {
14579
14610
 
14580
14611
  // src/components/DateTimePicker/DateTimePicker.tsx
14581
14612
  import { jsx as jsx61, jsxs as jsxs38 } from "@emotion/react/jsx-runtime";
14582
- var TIMEZONE_OPTIONS = Intl.supportedValuesOf("timeZone").map((v) => ({
14613
+ var timeZoneOptions = typeof Intl !== "undefined" && typeof Intl.supportedValuesOf === "function" ? Intl.supportedValuesOf("timeZone") : ["Etc/UTC"];
14614
+ var TIMEZONE_OPTIONS = timeZoneOptions.map((v) => ({
14583
14615
  label: getTimeZoneLabel(v),
14584
14616
  value: v
14585
14617
  }));
@@ -14629,9 +14661,10 @@ var DateTimePicker = ({
14629
14661
  return TIMEZONE_OPTIONS.find(({ value: value2 }) => value2 === timeZone);
14630
14662
  });
14631
14663
  useEffect4(() => {
14664
+ var _a;
14632
14665
  if (popover2.visible) {
14633
14666
  setDraftDate(tryToCalendarDate(parsedValue));
14634
- setDraftTime(tryToTime(parsedValue));
14667
+ setDraftTime((_a = tryToTime(parsedValue)) != null ? _a : new Time3(0, 0));
14635
14668
  }
14636
14669
  }, [parsedValue, popover2.visible]);
14637
14670
  const handleDateChange = useCallback3((isoDate) => {
@@ -17529,6 +17562,16 @@ var toggleInput2 = css79`
17529
17562
  color: var(--white);
17530
17563
  }
17531
17564
 
17565
+ &:indeterminate,
17566
+ &:indeterminate:hover,
17567
+ &:indeterminate:focus {
17568
+ background: var(--accent-dark-active)
17569
+ url('data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIxNiIKICBoZWlnaHQ9IjE2IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKPgogIDxwYXRoCiAgICBkPSJNNCAxMkM0IDExLjQ0NzcgNC40NDc3MiAxMSA1IDExSDE5QzE5LjU1MjMgMTEgMjAgMTEuNDQ3NyAyMCAxMkMyMCAxMi41NTIzIDE5LjU1MjMgMTMgMTkgMTNINUM0LjQ0NzcyIDEzIDQgMTIuNTUyMyA0IDEyWiIKICAgIGZpbGw9IndoaXRlIgogIC8+Cjwvc3ZnPg==')
17570
+ no-repeat center center;
17571
+ border-color: var(--accent-dark-active);
17572
+ color: var(--white);
17573
+ }
17574
+
17532
17575
  &:hover {
17533
17576
  border-color: var(--accent-dark-hover);
17534
17577
  }
@@ -20240,6 +20283,60 @@ var TEXTBOX_OPERATORS = [
20240
20283
  editorType: "empty"
20241
20284
  }
20242
20285
  ];
20286
+ var USER_OPERATORS = [
20287
+ {
20288
+ label: "is...",
20289
+ value: "eq",
20290
+ editorType: "text"
20291
+ },
20292
+ {
20293
+ label: "contains...",
20294
+ value: "match",
20295
+ editorType: "text"
20296
+ },
20297
+ {
20298
+ label: "is not...",
20299
+ value: "neq",
20300
+ editorType: "text"
20301
+ }
20302
+ ];
20303
+ var SYSTEM_DATE_OPERATORS = [
20304
+ {
20305
+ label: "is...",
20306
+ value: "eq",
20307
+ editorType: "date"
20308
+ },
20309
+ {
20310
+ label: "is between...",
20311
+ value: "between",
20312
+ editorType: "dateRange"
20313
+ },
20314
+ {
20315
+ label: "is before...",
20316
+ value: "lt",
20317
+ editorType: "date"
20318
+ },
20319
+ {
20320
+ label: "is after...",
20321
+ value: "gt",
20322
+ editorType: "date"
20323
+ },
20324
+ {
20325
+ label: "is on or before...",
20326
+ value: "lte",
20327
+ editorType: "date"
20328
+ },
20329
+ {
20330
+ label: "is on or after...",
20331
+ value: "gte",
20332
+ editorType: "date"
20333
+ },
20334
+ {
20335
+ label: "is not...",
20336
+ value: "neq",
20337
+ editorType: "date"
20338
+ }
20339
+ ];
20243
20340
  var RICHTEXT_OPERATORS = [
20244
20341
  {
20245
20342
  label: "is empty...",
@@ -20295,16 +20392,16 @@ var SYSTEM_FIELD_OPERATORS = [
20295
20392
  // src/components/SearchAndFilter/styles/SearchAndFilter.styles.ts
20296
20393
  import { css as css92 } from "@emotion/react";
20297
20394
  var SearchAndFilterContainer = css92``;
20298
- var SearchAndFilterControlsWrapper = css92`
20395
+ var SearchAndFilterControlsWrapper = (gridColumns) => css92`
20299
20396
  align-items: stretch;
20300
20397
  display: grid;
20301
- grid-template-columns: auto auto 1fr 0.5fr;
20398
+ grid-template-columns: ${gridColumns};
20302
20399
  gap: var(--spacing-sm);
20303
20400
  `;
20304
- var SearchAndFilterOutterControlWrapper = css92`
20401
+ var SearchAndFilterOutterControlWrapper = (gridColumns) => css92`
20305
20402
  align-items: stretch;
20306
20403
  display: grid;
20307
- grid-template-columns: 1fr auto;
20404
+ grid-template-columns: ${gridColumns};
20308
20405
  gap: var(--spacing-sm);
20309
20406
  `;
20310
20407
  var ConditionalFilterRow = css92`
@@ -20337,7 +20434,7 @@ var ConditionalInputRow = css92`
20337
20434
  }
20338
20435
  ${cq("580px")} {
20339
20436
  display: grid;
20340
- grid-template-columns: 200px 160px repeat(2, minmax(160px, 240px)) 32px;
20437
+ grid-template-columns: 200px 160px 1fr 32px;
20341
20438
  }
20342
20439
  `;
20343
20440
  var SearchInput = css92`
@@ -20381,6 +20478,12 @@ var FilterButton = css92`
20381
20478
  opacity: var(--opacity-50);
20382
20479
  }
20383
20480
  `;
20481
+ var FilterButtonText = css92`
20482
+ overflow: hidden;
20483
+ text-overflow: ellipsis;
20484
+ white-space: nowrap;
20485
+ max-width: 14ch;
20486
+ `;
20384
20487
  var FilterButtonSelected = css92`
20385
20488
  background: var(--gray-100);
20386
20489
  border-color: var(--gray-300);
@@ -20417,7 +20520,6 @@ var AddConditionalBtn = css92`
20417
20520
  gap: var(--spacing-sm);
20418
20521
  transition: color var(--duration-fast) var(--timing-ease-out);
20419
20522
  padding: 0;
20420
- font-size: var(--fs-sm);
20421
20523
 
20422
20524
  &:hover,
20423
20525
  &:focus {
@@ -20482,6 +20584,11 @@ var SearchAndFilterOptionsInnerContainer = css92`
20482
20584
  var SearchAndFilterButtonGroup = css92`
20483
20585
  margin-top: var(--spacing-base);
20484
20586
  `;
20587
+ var SortFilterInputRow = css92`
20588
+ align-items: center;
20589
+ display: flex;
20590
+ gap: var(--spacing-sm);
20591
+ `;
20485
20592
 
20486
20593
  // src/components/SearchAndFilter/FilterButton.tsx
20487
20594
  import { jsx as jsx117, jsxs as jsxs79 } from "@emotion/react/jsx-runtime";
@@ -20505,7 +20612,7 @@ var FilterButton2 = ({
20505
20612
  "data-testid": "filters-button",
20506
20613
  children: [
20507
20614
  /* @__PURE__ */ jsx117(Icon, { icon, iconColor: "currentColor", size: "1rem" }),
20508
- text,
20615
+ /* @__PURE__ */ jsx117("span", { css: FilterButtonText, children: text }),
20509
20616
  filterCount ? /* @__PURE__ */ jsx117(Counter, { count: filterCount, bgColor: "var(--white)" }) : null
20510
20617
  ]
20511
20618
  }
@@ -20514,7 +20621,7 @@ var FilterButton2 = ({
20514
20621
 
20515
20622
  // src/components/SearchAndFilter/FilterControls.tsx
20516
20623
  import { useEffect as useEffect18, useState as useState17 } from "react";
20517
- import { useDebounce as useDebounce2 } from "react-use";
20624
+ import { useDebounce as useDebounce2, useEffectOnce } from "react-use";
20518
20625
 
20519
20626
  // src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
20520
20627
  import {
@@ -20556,6 +20663,7 @@ var SearchAndFilterProvider = ({
20556
20663
  filterOptions,
20557
20664
  sortOptions,
20558
20665
  defaultSortByValue,
20666
+ filterMode: filterMode3 = void 0,
20559
20667
  onSearchChange,
20560
20668
  onChange,
20561
20669
  onSortChange,
@@ -20564,12 +20672,12 @@ var SearchAndFilterProvider = ({
20564
20672
  }) => {
20565
20673
  const [searchTerm, setSearchTerm] = useState16("");
20566
20674
  const deferredSearchTerm = useDeferredValue2(searchTerm);
20567
- const [filterVisibility, setFilterVisibility] = useState16(void 0);
20675
+ const [filterVisibility, setFilterVisibility] = useState16(filterMode3);
20568
20676
  const [sortByValue, setSortByValue] = useState16(defaultSortByValue);
20569
20677
  const handleSearchTerm = useCallback10(
20570
20678
  (term) => {
20571
20679
  setSearchTerm(term);
20572
- onSearchChange(term);
20680
+ onSearchChange == null ? void 0 : onSearchChange(term);
20573
20681
  },
20574
20682
  [setSearchTerm, onSearchChange]
20575
20683
  );
@@ -20648,10 +20756,23 @@ var useSearchAndFilter = () => {
20648
20756
  // src/components/SearchAndFilter/FilterControls.tsx
20649
20757
  import { Fragment as Fragment19, jsx as jsx119, jsxs as jsxs80 } from "@emotion/react/jsx-runtime";
20650
20758
  var FilterControls = ({
20651
- children
20759
+ children,
20760
+ defaultSortByValue,
20761
+ hideSearchInput
20652
20762
  }) => {
20653
- const { setFilterVisibility, filterVisibility, setSearchTerm, validFilterQuery, searchTerm, sortByValue } = useSearchAndFilter();
20763
+ var _a, _b, _c;
20764
+ const {
20765
+ setFilterVisibility,
20766
+ filterVisibility,
20767
+ setSearchTerm,
20768
+ validFilterQuery,
20769
+ searchTerm,
20770
+ sortByValue,
20771
+ filterOptions
20772
+ } = useSearchAndFilter();
20773
+ const [initialSortValue, setInitialSortValue] = useState17(sortByValue);
20654
20774
  const [localeSearchTerm, setLocaleSearchTerm] = useState17("");
20775
+ const [userHasChangedSortByValue, setUserHasChangedSortByValue] = useState17(false);
20655
20776
  useDebounce2(
20656
20777
  () => {
20657
20778
  setSearchTerm(localeSearchTerm);
@@ -20665,14 +20786,25 @@ var FilterControls = ({
20665
20786
  }
20666
20787
  }, [searchTerm]);
20667
20788
  const handleFilterToggle = (mode) => {
20668
- if (filterVisibility && ["sort", "filters"].includes(filterVisibility)) {
20789
+ if (filterVisibility === "filters" && mode === "filters" || filterVisibility === "sort" && mode === "sort") {
20669
20790
  return setFilterVisibility(void 0);
20670
20791
  }
20671
20792
  return setFilterVisibility(mode);
20672
20793
  };
20673
- const sortByValues = sortByValue ? sortByValue == null ? void 0 : sortByValue.split("_") : "Sort";
20674
- const sortByValueLabel = Array.isArray(sortByValues) ? sortByValue == null ? void 0 : sortByValue.split("_")[0] : "Sort";
20675
- const sortByIcon = Array.isArray(sortByValues) ? sortByValues[1] === "ASC" ? "arrow-up" : "arrow-down" : "sort-az";
20794
+ const sortValue = (sortByValue != null ? sortByValue : defaultSortByValue).split("_");
20795
+ const sortDirection = sortValue == null ? void 0 : sortValue.pop();
20796
+ const sortField = sortValue == null ? void 0 : sortValue.join("_");
20797
+ const sortOn = sortField.startsWith("fields.") ? "contentTypeFields" : "metadata";
20798
+ const sortByValueLabel = (_c = (_b = (_a = filterOptions == null ? void 0 : filterOptions.find((op) => op.value === sortOn)) == null ? void 0 : _a.options) == null ? void 0 : _b.find((f) => f.value === sortField)) == null ? void 0 : _c.label;
20799
+ const sortByIcon = userHasChangedSortByValue ? sortDirection === "ASC" ? "arrow-up" : "arrow-down" : "sort-az";
20800
+ useEffectOnce(() => {
20801
+ setInitialSortValue(sortByValue);
20802
+ });
20803
+ useEffect18(() => {
20804
+ if (initialSortValue !== sortByValue) {
20805
+ setUserHasChangedSortByValue(true);
20806
+ }
20807
+ }, [initialSortValue, sortByValue]);
20676
20808
  return /* @__PURE__ */ jsxs80(Fragment19, { children: [
20677
20809
  /* @__PURE__ */ jsx119(
20678
20810
  FilterButton2,
@@ -20691,7 +20823,7 @@ var FilterControls = ({
20691
20823
  "aria-controls": "search-and-filter-sortBy",
20692
20824
  "aria-label": "sort by options",
20693
20825
  "aria-haspopup": "true",
20694
- text: sortByValueLabel,
20826
+ text: !userHasChangedSortByValue ? "Sort" : sortByValueLabel,
20695
20827
  icon: sortByIcon,
20696
20828
  "aria-expanded": filterVisibility === "sort",
20697
20829
  hasSelectedValue: sortByValue !== "",
@@ -20699,7 +20831,7 @@ var FilterControls = ({
20699
20831
  "data-testid": "sort-by-dropdown"
20700
20832
  }
20701
20833
  ),
20702
- /* @__PURE__ */ jsx119(
20834
+ hideSearchInput ? null : /* @__PURE__ */ jsx119(
20703
20835
  InputKeywordSearch,
20704
20836
  {
20705
20837
  placeholder: "Search...",
@@ -20793,6 +20925,11 @@ var StatusUnknown = css93`
20793
20925
  background: var(--gray-800);
20794
20926
  }
20795
20927
  `;
20928
+ var StatusDeleted = css93`
20929
+ &:before {
20930
+ background: var(--error);
20931
+ }
20932
+ `;
20796
20933
 
20797
20934
  // src/components/Validation/StatusBullet.tsx
20798
20935
  import { jsx as jsx120 } from "@emotion/react/jsx-runtime";
@@ -20811,7 +20948,8 @@ var StatusBullet = ({
20811
20948
  Published: StatusPublished,
20812
20949
  Draft: StatusDraft,
20813
20950
  Previous: StatusDraft,
20814
- Unknown: StatusUnknown
20951
+ Unknown: StatusUnknown,
20952
+ Deleted: StatusDeleted
20815
20953
  };
20816
20954
  const statusSize = size === "base" ? StatusBulletBase : StatusBulletSmall;
20817
20955
  return /* @__PURE__ */ jsx120(
@@ -20828,13 +20966,21 @@ var StatusBullet = ({
20828
20966
 
20829
20967
  // src/components/SearchAndFilter/FilterEditor.tsx
20830
20968
  import { Fragment as Fragment20, jsx as jsx121, jsxs as jsxs81 } from "@emotion/react/jsx-runtime";
20969
+ var readOnlyAttributes = {
20970
+ isSearchable: false,
20971
+ menuIsOpen: false,
20972
+ isClearable: false
20973
+ };
20831
20974
  var FilterMultiChoiceEditor = ({
20832
20975
  value,
20833
20976
  options,
20834
20977
  isDisabled,
20978
+ readOnly,
20979
+ valueTestId,
20835
20980
  ...props
20836
20981
  }) => {
20837
- return /* @__PURE__ */ jsx121(
20982
+ const readOnlyProps = readOnly ? readOnlyAttributes : {};
20983
+ return /* @__PURE__ */ jsx121("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx121(
20838
20984
  InputComboBox,
20839
20985
  {
20840
20986
  ...props,
@@ -20847,17 +20993,30 @@ var FilterMultiChoiceEditor = ({
20847
20993
  var _a;
20848
20994
  return props.onChange((_a = e.map((item) => item.value)) != null ? _a : []);
20849
20995
  },
20850
- value
20996
+ value,
20997
+ "aria-readonly": readOnly,
20998
+ styles: {
20999
+ menu(base) {
21000
+ return {
21001
+ ...base,
21002
+ minWidth: "max-content"
21003
+ };
21004
+ }
21005
+ },
21006
+ ...readOnlyProps
20851
21007
  }
20852
- );
21008
+ ) });
20853
21009
  };
20854
21010
  var FilterSingleChoiceEditor = ({
20855
21011
  options,
20856
21012
  value,
20857
21013
  isDisabled,
20858
- onChange
21014
+ readOnly,
21015
+ onChange,
21016
+ valueTestId
20859
21017
  }) => {
20860
- return /* @__PURE__ */ jsx121(
21018
+ const readOnlyProps = readOnly ? readOnlyAttributes : {};
21019
+ return /* @__PURE__ */ jsx121("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx121(
20861
21020
  InputComboBox,
20862
21021
  {
20863
21022
  placeholder: "Type to search...",
@@ -20868,9 +21027,19 @@ var FilterSingleChoiceEditor = ({
20868
21027
  return onChange((_a = e == null ? void 0 : e.value) != null ? _a : "");
20869
21028
  },
20870
21029
  isDisabled,
20871
- value
21030
+ value,
21031
+ "aria-readonly": readOnly,
21032
+ styles: {
21033
+ menu(base) {
21034
+ return {
21035
+ ...base,
21036
+ minWidth: "max-content"
21037
+ };
21038
+ }
21039
+ },
21040
+ ...readOnlyProps
20872
21041
  }
20873
- );
21042
+ ) });
20874
21043
  };
20875
21044
  var CustomOptions = ({ label, value }) => {
20876
21045
  return /* @__PURE__ */ jsx121(StatusBullet, { status: label, message: value });
@@ -20879,9 +21048,12 @@ var StatusMultiEditor = ({
20879
21048
  options,
20880
21049
  value,
20881
21050
  isDisabled,
20882
- onChange
21051
+ readOnly,
21052
+ onChange,
21053
+ valueTestId
20883
21054
  }) => {
20884
- return /* @__PURE__ */ jsx121(
21055
+ const readOnlyProps = readOnly ? readOnlyAttributes : {};
21056
+ return /* @__PURE__ */ jsx121("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx121(
20885
21057
  InputComboBox,
20886
21058
  {
20887
21059
  options,
@@ -20892,17 +21064,29 @@ var StatusMultiEditor = ({
20892
21064
  },
20893
21065
  formatOptionLabel: CustomOptions,
20894
21066
  value,
20895
- isDisabled
21067
+ isDisabled,
21068
+ styles: {
21069
+ menu(base) {
21070
+ return {
21071
+ ...base,
21072
+ minWidth: "max-content"
21073
+ };
21074
+ }
21075
+ },
21076
+ ...readOnlyProps
20896
21077
  }
20897
- );
21078
+ ) });
20898
21079
  };
20899
21080
  var StatusSingleEditor = ({
20900
21081
  options,
20901
21082
  value,
20902
21083
  isDisabled,
20903
- onChange
21084
+ readOnly,
21085
+ onChange,
21086
+ valueTestId
20904
21087
  }) => {
20905
- return /* @__PURE__ */ jsx121(
21088
+ const readOnlyProps = readOnly ? readOnlyAttributes : {};
21089
+ return /* @__PURE__ */ jsx121("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx121(
20906
21090
  InputComboBox,
20907
21091
  {
20908
21092
  options,
@@ -20912,11 +21096,20 @@ var StatusSingleEditor = ({
20912
21096
  },
20913
21097
  formatOptionLabel: CustomOptions,
20914
21098
  value,
20915
- isDisabled
21099
+ isDisabled,
21100
+ styles: {
21101
+ menu(base) {
21102
+ return {
21103
+ ...base,
21104
+ minWidth: "max-content"
21105
+ };
21106
+ }
21107
+ },
21108
+ ...readOnlyProps
20916
21109
  }
20917
- );
21110
+ ) });
20918
21111
  };
20919
- var TextEditor = ({ onChange, ariaLabel, value }) => {
21112
+ var TextEditor = ({ onChange, ariaLabel, value, readOnly, valueTestId }) => {
20920
21113
  useDebounce3(() => onChange, 500, [value]);
20921
21114
  return /* @__PURE__ */ jsx121(
20922
21115
  Input,
@@ -20925,11 +21118,20 @@ var TextEditor = ({ onChange, ariaLabel, value }) => {
20925
21118
  label: ariaLabel,
20926
21119
  onChange: (e) => onChange(e.currentTarget.value),
20927
21120
  placeholder: "Enter phrase to search\u2026",
20928
- value
21121
+ value,
21122
+ readOnly,
21123
+ "data-testid": valueTestId
20929
21124
  }
20930
21125
  );
20931
21126
  };
20932
- var NumberRangeEditor = ({ onChange, disabled: disabled2, ariaLabel, value }) => {
21127
+ var NumberRangeEditor = ({
21128
+ onChange,
21129
+ disabled: disabled2,
21130
+ ariaLabel,
21131
+ value,
21132
+ readOnly,
21133
+ valueTestId
21134
+ }) => {
20933
21135
  const [minValue, setMinValue] = useState18("");
20934
21136
  const [maxValue, setMaxValue] = useState18("");
20935
21137
  const [error, setError] = useState18("");
@@ -20953,38 +21155,49 @@ var NumberRangeEditor = ({ onChange, disabled: disabled2, ariaLabel, value }) =>
20953
21155
  onChange([minValue, maxValue]);
20954
21156
  }, [maxValue, minValue, setError]);
20955
21157
  return /* @__PURE__ */ jsxs81(Fragment20, { children: [
20956
- /* @__PURE__ */ jsx121(
20957
- Input,
20958
- {
20959
- label: `${ariaLabel}-min`,
20960
- type: "number",
20961
- showLabel: false,
20962
- min: 0,
20963
- placeholder: "Low",
20964
- onChange: (e) => setMinValue(e.currentTarget.value),
20965
- "aria-invalid": !error ? false : true,
20966
- disabled: disabled2,
20967
- value: value ? value[0] : ""
20968
- }
20969
- ),
20970
- /* @__PURE__ */ jsx121(
20971
- Input,
20972
- {
20973
- type: "number",
20974
- label: `${ariaLabel}-max`,
20975
- showLabel: false,
20976
- min: 0,
20977
- placeholder: "High",
20978
- onChange: (e) => setMaxValue(e.currentTarget.value),
20979
- "aria-invalid": !error ? false : true,
20980
- disabled: disabled2,
20981
- value: value ? value[1] : ""
20982
- }
20983
- ),
21158
+ /* @__PURE__ */ jsxs81("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
21159
+ /* @__PURE__ */ jsx121(
21160
+ Input,
21161
+ {
21162
+ label: `${ariaLabel}-min`,
21163
+ type: "number",
21164
+ showLabel: false,
21165
+ min: 0,
21166
+ placeholder: "Low",
21167
+ onChange: (e) => setMinValue(e.currentTarget.value),
21168
+ "aria-invalid": !error ? false : true,
21169
+ disabled: disabled2,
21170
+ value: value ? value[0] : "",
21171
+ readOnly
21172
+ }
21173
+ ),
21174
+ /* @__PURE__ */ jsx121(
21175
+ Input,
21176
+ {
21177
+ type: "number",
21178
+ label: `${ariaLabel}-max`,
21179
+ showLabel: false,
21180
+ min: 0,
21181
+ placeholder: "High",
21182
+ onChange: (e) => setMaxValue(e.currentTarget.value),
21183
+ "aria-invalid": !error ? false : true,
21184
+ disabled: disabled2,
21185
+ value: value ? value[1] : "",
21186
+ readOnly
21187
+ }
21188
+ )
21189
+ ] }),
20984
21190
  /* @__PURE__ */ jsx121(ErrorContainer, { errorMessage: error })
20985
21191
  ] });
20986
21192
  };
20987
- var NumberEditor = ({ ariaLabel, onChange, disabled: disabled2, value }) => {
21193
+ var NumberEditor = ({
21194
+ ariaLabel,
21195
+ onChange,
21196
+ disabled: disabled2,
21197
+ value,
21198
+ readOnly,
21199
+ valueTestId
21200
+ }) => {
20988
21201
  return /* @__PURE__ */ jsx121(
20989
21202
  Input,
20990
21203
  {
@@ -20994,11 +21207,20 @@ var NumberEditor = ({ ariaLabel, onChange, disabled: disabled2, value }) => {
20994
21207
  min: 0,
20995
21208
  onChange: (e) => onChange(e.currentTarget.value),
20996
21209
  disabled: disabled2,
20997
- value
21210
+ value,
21211
+ readOnly,
21212
+ "data-testid": valueTestId
20998
21213
  }
20999
21214
  );
21000
21215
  };
21001
- var DateEditor = ({ onChange, ariaLabel, disabled: disabled2, value }) => {
21216
+ var DateEditor = ({
21217
+ onChange,
21218
+ ariaLabel,
21219
+ disabled: disabled2,
21220
+ value,
21221
+ readOnly,
21222
+ valueTestId
21223
+ }) => {
21002
21224
  return /* @__PURE__ */ jsx121(
21003
21225
  Input,
21004
21226
  {
@@ -21007,11 +21229,20 @@ var DateEditor = ({ onChange, ariaLabel, disabled: disabled2, value }) => {
21007
21229
  showLabel: false,
21008
21230
  onChange: (e) => onChange(e.currentTarget.value),
21009
21231
  disabled: disabled2,
21010
- value
21232
+ value,
21233
+ readOnly,
21234
+ "data-testid": valueTestId
21011
21235
  }
21012
21236
  );
21013
21237
  };
21014
- var DateRangeEditor = ({ ariaLabel, onChange, disabled: disabled2, value }) => {
21238
+ var DateRangeEditor = ({
21239
+ ariaLabel,
21240
+ onChange,
21241
+ disabled: disabled2,
21242
+ value,
21243
+ readOnly,
21244
+ valueTestId
21245
+ }) => {
21015
21246
  const [minDateValue, setMinDateValue] = useState18(value ? value[0] : "");
21016
21247
  const [maxDateValue, setMaxDateValue] = useState18(value ? value[1] : "");
21017
21248
  const [error, setError] = useState18("");
@@ -21047,30 +21278,34 @@ var DateRangeEditor = ({ ariaLabel, onChange, disabled: disabled2, value }) => {
21047
21278
  onChange([minDateValue, maxDateValue]);
21048
21279
  }, [minDateValue, maxDateValue, setError]);
21049
21280
  return /* @__PURE__ */ jsxs81(Fragment20, { children: [
21050
- /* @__PURE__ */ jsx121(
21051
- Input,
21052
- {
21053
- label: `${ariaLabel}-min-date`,
21054
- type: "date",
21055
- showLabel: false,
21056
- value: minDateValue,
21057
- onChange: (e) => setMinDateValue(e.currentTarget.value),
21058
- "aria-invalid": !error ? false : true,
21059
- disabled: disabled2
21060
- }
21061
- ),
21062
- /* @__PURE__ */ jsx121(
21063
- Input,
21064
- {
21065
- label: `${ariaLabel}-max-date`,
21066
- type: "date",
21067
- showLabel: false,
21068
- value: maxDateValue,
21069
- onChange: (e) => setMaxDateValue(e.currentTarget.value),
21070
- "aria-invalid": !error ? false : true,
21071
- disabled: disabled2
21072
- }
21073
- ),
21281
+ /* @__PURE__ */ jsxs81("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
21282
+ /* @__PURE__ */ jsx121(
21283
+ Input,
21284
+ {
21285
+ label: `${ariaLabel}-min-date`,
21286
+ type: "date",
21287
+ showLabel: false,
21288
+ value: minDateValue,
21289
+ onChange: (e) => setMinDateValue(e.currentTarget.value),
21290
+ "aria-invalid": !error ? false : true,
21291
+ disabled: disabled2,
21292
+ readOnly
21293
+ }
21294
+ ),
21295
+ /* @__PURE__ */ jsx121(
21296
+ Input,
21297
+ {
21298
+ label: `${ariaLabel}-max-date`,
21299
+ type: "date",
21300
+ showLabel: false,
21301
+ value: maxDateValue,
21302
+ onChange: (e) => setMaxDateValue(e.currentTarget.value),
21303
+ "aria-invalid": !error ? false : true,
21304
+ disabled: disabled2,
21305
+ readOnly
21306
+ }
21307
+ )
21308
+ ] }),
21074
21309
  /* @__PURE__ */ jsx121(ErrorContainer, { errorMessage: error })
21075
21310
  ] });
21076
21311
  };
@@ -21108,6 +21343,11 @@ var ErrorContainer = ({ errorMessage }) => {
21108
21343
  }
21109
21344
  );
21110
21345
  };
21346
+ var twoColumnGrid = {
21347
+ display: "grid",
21348
+ gridTemplateColumns: "1fr 1fr",
21349
+ gap: "var(--spacing-sm);"
21350
+ };
21111
21351
 
21112
21352
  // src/components/SearchAndFilter/FilterMenu.tsx
21113
21353
  import React24, { useEffect as useEffect20 } from "react";
@@ -21130,7 +21370,7 @@ var SearchAndFilterOptionsContainer2 = ({
21130
21370
  ) : null
21131
21371
  ] });
21132
21372
  };
21133
- var FilterMenu = ({ id, filterTitle = "Show records", menuControls, children }) => {
21373
+ var FilterMenu = ({ id, filterTitle = "Show results", menuControls, children }) => {
21134
21374
  const { filterVisibility, setFilterVisibility } = useSearchAndFilter();
21135
21375
  const innerMenuRef = React24.useRef(null);
21136
21376
  useEffect20(() => {
@@ -21172,15 +21412,16 @@ var FilterItem = ({
21172
21412
  const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
21173
21413
  const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
21174
21414
  const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
21175
- const { selectedFieldValue, selectedOperatorValue, selectedMetaValue } = useMemo7(() => {
21176
- var _a2, _b2;
21415
+ const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly } = useMemo7(() => {
21416
+ var _a2;
21177
21417
  const currentSelectedFilter = filterOptions.find((item) => {
21178
21418
  var _a3;
21179
21419
  return (_a3 = item.options) == null ? void 0 : _a3.find((op) => op.value === filters[index].field);
21180
21420
  });
21181
- const selectedFieldValue2 = (_b2 = (_a2 = currentSelectedFilter == null ? void 0 : currentSelectedFilter.options) == null ? void 0 : _a2.find((item) => {
21421
+ const selectedFieldValue2 = (_a2 = currentSelectedFilter == null ? void 0 : currentSelectedFilter.options) == null ? void 0 : _a2.find((item) => {
21182
21422
  return filters[index].field === item.value;
21183
- })) != null ? _b2 : [];
21423
+ });
21424
+ const isCurrentFieldReadOnly = selectedFieldValue2 == null ? void 0 : selectedFieldValue2.readOnly;
21184
21425
  const selectedOperatorValue2 = operatorOptions == null ? void 0 : operatorOptions.find((item) => {
21185
21426
  return filters[index].operator === item.value;
21186
21427
  });
@@ -21193,11 +21434,18 @@ var FilterItem = ({
21193
21434
  return {
21194
21435
  selectedFieldValue: selectedFieldValue2,
21195
21436
  selectedOperatorValue: selectedOperatorValue2 != null ? selectedOperatorValue2 : void 0,
21196
- selectedMetaValue: selectedMetaValue2.length > 0 ? selectedMetaValue2 : filters[index].value
21437
+ selectedMetaValue: selectedMetaValue2.length > 0 ? selectedMetaValue2 : filters[index].value,
21438
+ readOnly: isCurrentFieldReadOnly
21197
21439
  };
21198
21440
  }, [filters, filterOptions, index, operatorOptions, valueOptions]);
21199
- return /* @__PURE__ */ jsxs83("div", { css: ConditionalFilterRow, children: [
21200
- /* @__PURE__ */ jsx123("span", { children: index === 0 ? "where" : "and" }),
21441
+ const readOnlyProps = readOnly ? {
21442
+ "aria-readonly": true,
21443
+ isSearchable: false,
21444
+ menuIsOpen: false,
21445
+ isClearable: false
21446
+ } : {};
21447
+ return /* @__PURE__ */ jsxs83("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
21448
+ /* @__PURE__ */ jsx123("span", { children: index === 0 ? "Where" : "and" }),
21201
21449
  /* @__PURE__ */ jsxs83("div", { css: ConditionalInputRow, children: [
21202
21450
  /* @__PURE__ */ jsx123(
21203
21451
  InputComboBox,
@@ -21208,7 +21456,21 @@ var FilterItem = ({
21208
21456
  var _a2;
21209
21457
  onParamChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
21210
21458
  },
21211
- value: selectedFieldValue
21459
+ isOptionDisabled: (option) => {
21460
+ var _a2;
21461
+ return (_a2 = option == null ? void 0 : option.disabled) != null ? _a2 : false;
21462
+ },
21463
+ styles: {
21464
+ menu(base) {
21465
+ return {
21466
+ ...base,
21467
+ minWidth: "max-content"
21468
+ };
21469
+ }
21470
+ },
21471
+ value: selectedFieldValue,
21472
+ ...readOnlyProps,
21473
+ id: "filter-field"
21212
21474
  }
21213
21475
  ),
21214
21476
  /* @__PURE__ */ jsx123(
@@ -21221,7 +21483,17 @@ var FilterItem = ({
21221
21483
  return onOperatorChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
21222
21484
  },
21223
21485
  isDisabled: !filters[index].field,
21224
- value: selectedOperatorValue
21486
+ value: selectedOperatorValue,
21487
+ styles: {
21488
+ menu(base) {
21489
+ return {
21490
+ ...base,
21491
+ minWidth: "max-content"
21492
+ };
21493
+ }
21494
+ },
21495
+ ...readOnlyProps,
21496
+ id: "filter-operator"
21225
21497
  }
21226
21498
  ),
21227
21499
  /* @__PURE__ */ jsx123(
@@ -21231,17 +21503,20 @@ var FilterItem = ({
21231
21503
  editorType: metaDataPossibleOptions,
21232
21504
  options: valueOptions,
21233
21505
  onChange: (e) => onValueChange(e != null ? e : ""),
21506
+ readOnly,
21234
21507
  isDisabled: !filters[index].operator,
21235
- value: selectedMetaValue
21508
+ value: selectedMetaValue,
21509
+ valueTestId: "filter-value"
21236
21510
  }
21237
21511
  ),
21238
- /* @__PURE__ */ jsx123(
21512
+ readOnly ? null : /* @__PURE__ */ jsx123(
21239
21513
  "button",
21240
21514
  {
21241
21515
  type: "button",
21242
21516
  onClick: () => handleDeleteFilter(index),
21243
21517
  "aria-label": "delete filter",
21244
21518
  css: IconBtn,
21519
+ "data-testid": "delete-filter",
21245
21520
  children: /* @__PURE__ */ jsx123(Icon, { icon: "trash", iconColor: "red", size: "1rem" })
21246
21521
  }
21247
21522
  )
@@ -21252,16 +21527,9 @@ var FilterItems = ({
21252
21527
  addButtonText = "add condition",
21253
21528
  resetButtonText = "reset filters"
21254
21529
  }) => {
21255
- const {
21256
- filterOptions,
21257
- filters,
21258
- setFilters,
21259
- handleAddFilter,
21260
- handleResetFilters,
21261
- setFilterVisibility,
21262
- validFilterQuery
21263
- } = useSearchAndFilter();
21530
+ const { filterOptions, filters, setFilters, handleAddFilter, handleResetFilters, setFilterVisibility } = useSearchAndFilter();
21264
21531
  const handleUpdateFilter = (index, prop, value) => {
21532
+ var _a, _b, _c, _d, _e;
21265
21533
  const next = [...filters];
21266
21534
  next[index] = { ...next[index], [prop]: value };
21267
21535
  if (prop === "operator") {
@@ -21274,7 +21542,11 @@ var FilterItems = ({
21274
21542
  }
21275
21543
  }
21276
21544
  if (prop === "field") {
21277
- next[index].operator = "";
21545
+ const firstOperatorInAvailableOperators = (_e = (_d = (_c = (_b = (_a = filterOptions.find((fo) => {
21546
+ var _a2;
21547
+ return (_a2 = fo.options) == null ? void 0 : _a2.find((op) => op.value === value);
21548
+ })) == null ? void 0 : _a.options) == null ? void 0 : _b.find((op) => op.value === next[index].field)) == null ? void 0 : _c.operatorOptions) == null ? void 0 : _d[0].value) != null ? _e : "eq";
21549
+ next[index].operator = firstOperatorInAvailableOperators;
21278
21550
  next[index].value = "";
21279
21551
  }
21280
21552
  setFilters(next);
@@ -21290,14 +21562,14 @@ var FilterItems = ({
21290
21562
  type: "button",
21291
21563
  css: AddConditionalBtn,
21292
21564
  onClick: handleAddFilter,
21293
- disabled: !validFilterQuery,
21565
+ "data-testid": "add-filter",
21294
21566
  children: [
21295
- /* @__PURE__ */ jsx123(Icon, { icon: "math-plus", iconColor: !validFilterQuery ? "currentColor" : "gray", size: "1rem" }),
21567
+ /* @__PURE__ */ jsx123(Icon, { icon: "math-plus", iconColor: "currentColor", size: "1rem" }),
21296
21568
  addButtonText
21297
21569
  ]
21298
21570
  }
21299
21571
  ),
21300
- (validFilterQuery == null ? void 0 : validFilterQuery.length) ? /* @__PURE__ */ jsx123(
21572
+ (filters == null ? void 0 : filters.length) ? /* @__PURE__ */ jsx123(
21301
21573
  "button",
21302
21574
  {
21303
21575
  type: "button",
@@ -21306,6 +21578,7 @@ var FilterItems = ({
21306
21578
  handleResetFilters();
21307
21579
  setFilterVisibility(void 0);
21308
21580
  },
21581
+ "data-testid": "reset-filters",
21309
21582
  children: resetButtonText
21310
21583
  }
21311
21584
  ) : null
@@ -21552,7 +21825,7 @@ var SortItems = () => {
21552
21825
  var _a2;
21553
21826
  return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
21554
21827
  })) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
21555
- return /* @__PURE__ */ jsx125(FilterMenu, { id: "search-and-filter-options", filterTitle: "Sort by", children: /* @__PURE__ */ jsx125("div", { css: ConditionalFilterRow, children: /* @__PURE__ */ jsxs85("div", { css: ConditionalInputRow, children: [
21828
+ return /* @__PURE__ */ jsx125(FilterMenu, { id: "search-and-filter-options", filterTitle: "Sort by", children: /* @__PURE__ */ jsxs85("div", { css: SortFilterInputRow, children: [
21556
21829
  /* @__PURE__ */ jsx125(
21557
21830
  InputComboBox,
21558
21831
  {
@@ -21561,6 +21834,14 @@ var SortItems = () => {
21561
21834
  const fieldName = e == null ? void 0 : e.value;
21562
21835
  setSortBy(`${fieldName}_${sortDirection}`);
21563
21836
  },
21837
+ styles: {
21838
+ menu(base) {
21839
+ return {
21840
+ ...base,
21841
+ minWidth: "max-content"
21842
+ };
21843
+ }
21844
+ },
21564
21845
  value: currentSelectedOption
21565
21846
  }
21566
21847
  ),
@@ -21577,7 +21858,7 @@ var SortItems = () => {
21577
21858
  value: sortDirection
21578
21859
  }
21579
21860
  )
21580
- ] }) }) });
21861
+ ] }) });
21581
21862
  };
21582
21863
 
21583
21864
  // src/components/SearchAndFilter/FilterModeView.tsx
@@ -21594,24 +21875,52 @@ var FilterModeView = () => {
21594
21875
  // src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
21595
21876
  import { Fragment as Fragment22, jsx as jsx127, jsxs as jsxs86 } from "@emotion/react/jsx-runtime";
21596
21877
  var SearchAndFilterResultContainer = ({
21597
- clearButtonLabel = "clear"
21878
+ buttonText,
21879
+ clearButtonLabel = "clear",
21880
+ calloutTitle: calloutTitle2,
21881
+ calloutText,
21882
+ onHandleClear
21598
21883
  }) => {
21599
- const { searchTerm, setSearchTerm, totalResults } = useSearchAndFilter();
21600
- return searchTerm ? /* @__PURE__ */ jsxs86(Fragment22, { children: [
21884
+ const { searchTerm, setSearchTerm, totalResults, setFilters, filters } = useSearchAndFilter();
21885
+ const automateCalloutTitle = () => {
21886
+ if (searchTerm && !filters.length) {
21887
+ return "No search results found";
21888
+ }
21889
+ if (filters.length && !searchTerm) {
21890
+ return "No results match the selected filters";
21891
+ }
21892
+ return "No matching results found";
21893
+ };
21894
+ const handleResetFilters = () => {
21895
+ if (searchTerm && !filters.length) {
21896
+ setSearchTerm("");
21897
+ return;
21898
+ } else if (!searchTerm && filters.length) {
21899
+ setFilters([{ field: "", operator: "", value: "" }]);
21900
+ return;
21901
+ } else {
21902
+ setSearchTerm("");
21903
+ setFilters([{ field: "", operator: "", value: "" }]);
21904
+ return;
21905
+ }
21906
+ };
21907
+ if (totalResults && totalResults > 0) {
21908
+ return null;
21909
+ }
21910
+ return /* @__PURE__ */ jsxs86(Fragment22, { children: [
21601
21911
  /* @__PURE__ */ jsxs86(HorizontalRhythm, { children: [
21602
21912
  /* @__PURE__ */ jsxs86("span", { children: [
21603
21913
  totalResults,
21604
- " results for ",
21605
- /* @__PURE__ */ jsxs86("strong", { children: [
21606
- '"',
21607
- searchTerm,
21608
- '"'
21609
- ] })
21914
+ " results ",
21915
+ searchTerm ? `for "${searchTerm}"` : null
21610
21916
  ] }),
21611
- /* @__PURE__ */ jsx127(Button, { buttonType: "ghostDestructive", size: "zero", onClick: () => setSearchTerm(""), children: clearButtonLabel })
21917
+ !searchTerm ? null : /* @__PURE__ */ jsx127(Button, { buttonType: "ghostDestructive", size: "zero", onClick: () => setSearchTerm(""), children: clearButtonLabel })
21612
21918
  ] }),
21613
- totalResults === 0 ? /* @__PURE__ */ jsx127(Callout, { title: "No search results found", type: "note", children: /* @__PURE__ */ jsx127(Button, { buttonType: "tertiaryOutline", size: "sm", onClick: () => setSearchTerm(""), children: "Clear search" }) }) : null
21614
- ] }) : null;
21919
+ totalResults === 0 ? /* @__PURE__ */ jsxs86(Callout, { title: calloutTitle2 != null ? calloutTitle2 : automateCalloutTitle(), type: "note", children: [
21920
+ calloutText ? /* @__PURE__ */ jsx127(Paragraph, { children: calloutText }) : null,
21921
+ /* @__PURE__ */ jsx127(Button, { buttonType: "tertiaryOutline", size: "xs", onClick: onHandleClear != null ? onHandleClear : handleResetFilters, children: buttonText != null ? buttonText : "Clear search" })
21922
+ ] }) : null
21923
+ ] });
21615
21924
  };
21616
21925
 
21617
21926
  // src/components/SearchAndFilter/SearchAndFilter.tsx
@@ -21619,10 +21928,12 @@ import { jsx as jsx128, jsxs as jsxs87 } from "@emotion/react/jsx-runtime";
21619
21928
  var SearchAndFilter = ({
21620
21929
  filters,
21621
21930
  filterOptions,
21931
+ filterMode: filterMode3,
21622
21932
  sortOptions,
21623
21933
  defaultSortByValue,
21624
- filterControls = /* @__PURE__ */ jsx128(FilterControls, {}),
21934
+ filterControls,
21625
21935
  viewSwitchControls,
21936
+ resultsContainerView = /* @__PURE__ */ jsx128(SearchAndFilterResultContainer, {}),
21626
21937
  children = /* @__PURE__ */ jsx128(FilterModeView, {}),
21627
21938
  onChange,
21628
21939
  onSearchChange,
@@ -21634,6 +21945,7 @@ var SearchAndFilter = ({
21634
21945
  {
21635
21946
  filters,
21636
21947
  filterOptions,
21948
+ filterMode: filterMode3,
21637
21949
  defaultSortByValue,
21638
21950
  sortOptions,
21639
21951
  onChange,
@@ -21641,17 +21953,66 @@ var SearchAndFilter = ({
21641
21953
  onSortChange,
21642
21954
  totalResults,
21643
21955
  children: /* @__PURE__ */ jsxs87(VerticalRhythm, { css: SearchAndFilterContainer, "data-testid": "search-and-filter", children: [
21644
- /* @__PURE__ */ jsxs87("div", { css: SearchAndFilterOutterControlWrapper, children: [
21645
- /* @__PURE__ */ jsx128("div", { css: SearchAndFilterControlsWrapper, children: filterControls }),
21956
+ /* @__PURE__ */ jsxs87("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
21957
+ /* @__PURE__ */ jsx128(
21958
+ "div",
21959
+ {
21960
+ css: SearchAndFilterControlsWrapper(
21961
+ viewSwitchControls ? "auto auto 1fr 0.5fr" : "auto auto 1fr"
21962
+ ),
21963
+ children: !filterControls ? /* @__PURE__ */ jsx128(FilterControls, { hideSearchInput: !onSearchChange, defaultSortByValue }) : filterControls
21964
+ }
21965
+ ),
21646
21966
  viewSwitchControls
21647
21967
  ] }),
21648
21968
  children,
21649
- /* @__PURE__ */ jsx128(SearchAndFilterResultContainer, {})
21969
+ resultsContainerView
21650
21970
  ] })
21651
21971
  }
21652
21972
  );
21653
21973
  };
21654
21974
 
21975
+ // src/components/SearchAndFilter/SearchOnlyFilter.tsx
21976
+ import { createContext as createContext7, useState as useState19 } from "react";
21977
+ import { useDebounce as useDebounce4 } from "react-use";
21978
+ import { jsx as jsx129 } from "@emotion/react/jsx-runtime";
21979
+ var SearchOnlyContext = createContext7({
21980
+ searchTerm: "",
21981
+ setSearchTerm: () => {
21982
+ }
21983
+ });
21984
+ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
21985
+ const { searchTerm, setSearchTerm } = useSearchAndFilter();
21986
+ const [localeSearchTerm, setLocaleSearchTerm] = useState19("");
21987
+ useDebounce4(
21988
+ () => {
21989
+ setSearchTerm(localeSearchTerm);
21990
+ onSearchChange == null ? void 0 : onSearchChange(localeSearchTerm);
21991
+ },
21992
+ 300,
21993
+ [localeSearchTerm]
21994
+ );
21995
+ return /* @__PURE__ */ jsx129(
21996
+ SearchOnlyContext.Provider,
21997
+ {
21998
+ value: {
21999
+ searchTerm,
22000
+ setSearchTerm: setLocaleSearchTerm
22001
+ },
22002
+ children: /* @__PURE__ */ jsx129("div", { css: { maxWidth: maxWidth != null ? maxWidth : "712px" }, children: /* @__PURE__ */ jsx129(
22003
+ InputKeywordSearch,
22004
+ {
22005
+ placeholder: "Search...",
22006
+ onSearchTextChanged: (e) => setLocaleSearchTerm(e),
22007
+ value: localeSearchTerm,
22008
+ compact: true,
22009
+ rounded: true
22010
+ }
22011
+ ) })
22012
+ }
22013
+ );
22014
+ };
22015
+
21655
22016
  // src/components/Skeleton/Skeleton.styles.ts
21656
22017
  import { css as css96, keyframes as keyframes5 } from "@emotion/react";
21657
22018
  var lightFadingOut = keyframes5`
@@ -21664,7 +22025,7 @@ var skeletonStyles = css96`
21664
22025
  `;
21665
22026
 
21666
22027
  // src/components/Skeleton/Skeleton.tsx
21667
- import { jsx as jsx129 } from "@emotion/react/jsx-runtime";
22028
+ import { jsx as jsx130 } from "@emotion/react/jsx-runtime";
21668
22029
  var Skeleton = ({
21669
22030
  width = "100%",
21670
22031
  height = "1.25rem",
@@ -21672,7 +22033,7 @@ var Skeleton = ({
21672
22033
  circle = false,
21673
22034
  children,
21674
22035
  ...otherProps
21675
- }) => /* @__PURE__ */ jsx129(
22036
+ }) => /* @__PURE__ */ jsx130(
21676
22037
  "div",
21677
22038
  {
21678
22039
  css: [
@@ -21779,7 +22140,7 @@ var SwitchText = css97`
21779
22140
  `;
21780
22141
 
21781
22142
  // src/components/Switch/Switch.tsx
21782
- import { Fragment as Fragment23, jsx as jsx130, jsxs as jsxs88 } from "@emotion/react/jsx-runtime";
22143
+ import { Fragment as Fragment23, jsx as jsx131, jsxs as jsxs88 } from "@emotion/react/jsx-runtime";
21783
22144
  var Switch = React26.forwardRef(
21784
22145
  ({ label, infoText, toggleText, children, ...inputProps }, ref) => {
21785
22146
  let additionalText = infoText;
@@ -21788,10 +22149,10 @@ var Switch = React26.forwardRef(
21788
22149
  }
21789
22150
  return /* @__PURE__ */ jsxs88(Fragment23, { children: [
21790
22151
  /* @__PURE__ */ jsxs88("label", { css: [SwitchInputContainer, inputProps.disabled ? SwitchInputDisabled : void 0], children: [
21791
- /* @__PURE__ */ jsx130("input", { type: "checkbox", css: SwitchInput, ...inputProps, ref }),
21792
- /* @__PURE__ */ jsx130("span", { css: SwitchInputLabel, children: label })
22152
+ /* @__PURE__ */ jsx131("input", { type: "checkbox", css: SwitchInput, ...inputProps, ref }),
22153
+ /* @__PURE__ */ jsx131("span", { css: SwitchInputLabel, children: label })
21793
22154
  ] }),
21794
- additionalText ? /* @__PURE__ */ jsx130("p", { css: SwitchText, children: additionalText }) : null,
22155
+ additionalText ? /* @__PURE__ */ jsx131("p", { css: SwitchText, children: additionalText }) : null,
21795
22156
  children
21796
22157
  ] });
21797
22158
  }
@@ -21828,40 +22189,40 @@ var tableCellHead = css98`
21828
22189
  `;
21829
22190
 
21830
22191
  // src/components/Table/Table.tsx
21831
- import { jsx as jsx131 } from "@emotion/react/jsx-runtime";
22192
+ import { jsx as jsx132 } from "@emotion/react/jsx-runtime";
21832
22193
  var Table = React27.forwardRef(
21833
22194
  ({ children, cellPadding, ...otherProps }, ref) => {
21834
- return /* @__PURE__ */ jsx131("table", { ref, css: table({ cellPadding }), ...otherProps, children });
22195
+ return /* @__PURE__ */ jsx132("table", { ref, css: table({ cellPadding }), ...otherProps, children });
21835
22196
  }
21836
22197
  );
21837
22198
  var TableHead = React27.forwardRef(
21838
22199
  ({ children, ...otherProps }, ref) => {
21839
- return /* @__PURE__ */ jsx131("thead", { ref, css: tableHead, ...otherProps, children });
22200
+ return /* @__PURE__ */ jsx132("thead", { ref, css: tableHead, ...otherProps, children });
21840
22201
  }
21841
22202
  );
21842
22203
  var TableBody = React27.forwardRef(
21843
22204
  ({ children, ...otherProps }, ref) => {
21844
- return /* @__PURE__ */ jsx131("tbody", { ref, ...otherProps, children });
22205
+ return /* @__PURE__ */ jsx132("tbody", { ref, ...otherProps, children });
21845
22206
  }
21846
22207
  );
21847
22208
  var TableFoot = React27.forwardRef(
21848
22209
  ({ children, ...otherProps }, ref) => {
21849
- return /* @__PURE__ */ jsx131("tfoot", { ref, ...otherProps, children });
22210
+ return /* @__PURE__ */ jsx132("tfoot", { ref, ...otherProps, children });
21850
22211
  }
21851
22212
  );
21852
22213
  var TableRow = React27.forwardRef(
21853
22214
  ({ children, ...otherProps }, ref) => {
21854
- return /* @__PURE__ */ jsx131("tr", { ref, css: tableRow, ...otherProps, children });
22215
+ return /* @__PURE__ */ jsx132("tr", { ref, css: tableRow, ...otherProps, children });
21855
22216
  }
21856
22217
  );
21857
22218
  var TableCellHead = React27.forwardRef(
21858
22219
  ({ children, ...otherProps }, ref) => {
21859
- return /* @__PURE__ */ jsx131("th", { ref, css: tableCellHead, ...otherProps, children });
22220
+ return /* @__PURE__ */ jsx132("th", { ref, css: tableCellHead, ...otherProps, children });
21860
22221
  }
21861
22222
  );
21862
22223
  var TableCellData = React27.forwardRef(
21863
22224
  ({ children, ...otherProps }, ref) => {
21864
- return /* @__PURE__ */ jsx131("td", { ref, ...otherProps, children });
22225
+ return /* @__PURE__ */ jsx132("td", { ref, ...otherProps, children });
21865
22226
  }
21866
22227
  );
21867
22228
 
@@ -21901,7 +22262,7 @@ var tabButtonGroupStyles = css99`
21901
22262
  `;
21902
22263
 
21903
22264
  // src/components/Tabs/Tabs.tsx
21904
- import { jsx as jsx132 } from "@emotion/react/jsx-runtime";
22265
+ import { jsx as jsx133 } from "@emotion/react/jsx-runtime";
21905
22266
  var useCurrentTab = () => {
21906
22267
  const context = useAriakitTabStore();
21907
22268
  if (!context) {
@@ -21939,23 +22300,23 @@ var Tabs = ({
21939
22300
  tab.setSelectedId(selected);
21940
22301
  }
21941
22302
  }, [selected, tab]);
21942
- return /* @__PURE__ */ jsx132(AriakitTabProvider, { store: tab, setSelectedId: onTabSelect, children });
22303
+ return /* @__PURE__ */ jsx133(AriakitTabProvider, { store: tab, setSelectedId: onTabSelect, children });
21943
22304
  };
21944
22305
  var TabButtonGroup = ({ children, ...props }) => {
21945
- return /* @__PURE__ */ jsx132(AriakitTabList, { ...props, css: tabButtonGroupStyles, children });
22306
+ return /* @__PURE__ */ jsx133(AriakitTabList, { ...props, css: tabButtonGroupStyles, children });
21946
22307
  };
21947
22308
  var TabButton = ({
21948
22309
  children,
21949
22310
  id,
21950
22311
  ...props
21951
22312
  }) => {
21952
- return /* @__PURE__ */ jsx132(AriakitTab, { type: "button", id, ...props, css: tabButtonStyles, children });
22313
+ return /* @__PURE__ */ jsx133(AriakitTab, { type: "button", id, ...props, css: tabButtonStyles, children });
21953
22314
  };
21954
22315
  var TabContent = ({
21955
22316
  children,
21956
22317
  ...props
21957
22318
  }) => {
21958
- return /* @__PURE__ */ jsx132(AriakitTabPanel, { ...props, children });
22319
+ return /* @__PURE__ */ jsx133(AriakitTabPanel, { ...props, children });
21959
22320
  };
21960
22321
 
21961
22322
  // src/components/Toast/Toast.tsx
@@ -22186,9 +22547,9 @@ var toastContainerStyles = css100`
22186
22547
  `;
22187
22548
 
22188
22549
  // src/components/Toast/Toast.tsx
22189
- import { jsx as jsx133 } from "@emotion/react/jsx-runtime";
22550
+ import { jsx as jsx134 } from "@emotion/react/jsx-runtime";
22190
22551
  var ToastContainer = ({ limit = 4 }) => {
22191
- return /* @__PURE__ */ jsx133(
22552
+ return /* @__PURE__ */ jsx134(
22192
22553
  ToastifyContainer,
22193
22554
  {
22194
22555
  css: toastContainerStyles,
@@ -22324,6 +22685,7 @@ export {
22324
22685
  RICHTEXT_OPERATORS,
22325
22686
  ResolveIcon,
22326
22687
  RichTextToolbarIcon,
22688
+ SYSTEM_DATE_OPERATORS,
22327
22689
  SYSTEM_FIELD_OPERATORS,
22328
22690
  ScrollableList,
22329
22691
  ScrollableListInputItem,
@@ -22333,6 +22695,8 @@ export {
22333
22695
  SearchAndFilterOptionsContainer2 as SearchAndFilterOptionsContainer,
22334
22696
  SearchAndFilterProvider,
22335
22697
  SearchAndFilterResultContainer,
22698
+ SearchOnlyContext,
22699
+ SearchOnlyFilter,
22336
22700
  SegmentedControl,
22337
22701
  ShortcutContext,
22338
22702
  ShortcutRevealer,
@@ -22362,6 +22726,7 @@ export {
22362
22726
  ToastContainer,
22363
22727
  Tooltip,
22364
22728
  TwoColumnLayout,
22729
+ USER_OPERATORS,
22365
22730
  UniformBadge,
22366
22731
  UniformLogo,
22367
22732
  UniformLogoLarge,