@uniformdev/design-system 19.79.1-alpha.13 → 19.79.1-alpha.18
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/LICENSE +1 -1
- package/dist/esm/index.js +1976 -308
- package/dist/index.d.mts +338 -6
- package/dist/index.d.ts +338 -6
- package/dist/index.js +1985 -282
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -1353,6 +1353,7 @@ __export(src_exports, {
|
|
|
1353
1353
|
Banner: () => Banner,
|
|
1354
1354
|
Button: () => Button,
|
|
1355
1355
|
ButtonWithMenu: () => ButtonWithMenu,
|
|
1356
|
+
CHECKBOX_OPERATORS: () => CHECKBOX_OPERATORS,
|
|
1356
1357
|
Calendar: () => Calendar,
|
|
1357
1358
|
Callout: () => Callout,
|
|
1358
1359
|
Caption: () => Caption,
|
|
@@ -1366,9 +1367,11 @@ __export(src_exports, {
|
|
|
1366
1367
|
Counter: () => Counter,
|
|
1367
1368
|
CreateTeamIntegrationTile: () => CreateTeamIntegrationTile,
|
|
1368
1369
|
CurrentDrawerContext: () => CurrentDrawerContext,
|
|
1370
|
+
DATE_OPERATORS: () => DATE_OPERATORS,
|
|
1369
1371
|
DashedBox: () => DashedBox,
|
|
1370
1372
|
DateTimePicker: () => DateTimePicker,
|
|
1371
1373
|
DateTimePickerVariant: () => DateTimePickerVariant,
|
|
1374
|
+
DebouncedInputKeywordSearch: () => DebouncedInputKeywordSearch,
|
|
1372
1375
|
DescriptionList: () => DescriptionList,
|
|
1373
1376
|
Details: () => Details,
|
|
1374
1377
|
DismissibleChipAction: () => DismissibleChipAction,
|
|
@@ -1379,6 +1382,11 @@ __export(src_exports, {
|
|
|
1379
1382
|
EditTeamIntegrationTile: () => EditTeamIntegrationTile,
|
|
1380
1383
|
ErrorMessage: () => ErrorMessage,
|
|
1381
1384
|
Fieldset: () => Fieldset,
|
|
1385
|
+
FilterButton: () => FilterButton2,
|
|
1386
|
+
FilterControls: () => FilterControls,
|
|
1387
|
+
FilterItem: () => FilterItem,
|
|
1388
|
+
FilterItems: () => FilterItems,
|
|
1389
|
+
FilterMenu: () => FilterMenu,
|
|
1382
1390
|
Heading: () => Heading,
|
|
1383
1391
|
HexModalBackground: () => HexModalBackground,
|
|
1384
1392
|
HorizontalRhythm: () => HorizontalRhythm,
|
|
@@ -1423,6 +1431,7 @@ __export(src_exports, {
|
|
|
1423
1431
|
MenuItemSeparator: () => MenuItemSeparator,
|
|
1424
1432
|
Modal: () => Modal,
|
|
1425
1433
|
MultilineChip: () => MultilineChip,
|
|
1434
|
+
NUMBER_OPERATORS: () => NUMBER_OPERATORS,
|
|
1426
1435
|
PageHeaderSection: () => PageHeaderSection,
|
|
1427
1436
|
Pagination: () => Pagination,
|
|
1428
1437
|
Paragraph: () => Paragraph,
|
|
@@ -1455,11 +1464,21 @@ __export(src_exports, {
|
|
|
1455
1464
|
ProgressBar: () => ProgressBar,
|
|
1456
1465
|
ProgressList: () => ProgressList,
|
|
1457
1466
|
ProgressListItem: () => ProgressListItem,
|
|
1467
|
+
RICHTEXT_OPERATORS: () => RICHTEXT_OPERATORS,
|
|
1458
1468
|
ResolveIcon: () => ResolveIcon,
|
|
1459
1469
|
RichTextToolbarIcon: () => RichTextToolbarIcon,
|
|
1470
|
+
SYSTEM_DATE_OPERATORS: () => SYSTEM_DATE_OPERATORS,
|
|
1471
|
+
SYSTEM_FIELD_OPERATORS: () => SYSTEM_FIELD_OPERATORS,
|
|
1460
1472
|
ScrollableList: () => ScrollableList,
|
|
1461
1473
|
ScrollableListInputItem: () => ScrollableListInputItem,
|
|
1462
1474
|
ScrollableListItem: () => ScrollableListItem,
|
|
1475
|
+
SearchAndFilter: () => SearchAndFilter,
|
|
1476
|
+
SearchAndFilterContext: () => SearchAndFilterContext,
|
|
1477
|
+
SearchAndFilterOptionsContainer: () => SearchAndFilterOptionsContainer2,
|
|
1478
|
+
SearchAndFilterProvider: () => SearchAndFilterProvider,
|
|
1479
|
+
SearchAndFilterResultContainer: () => SearchAndFilterResultContainer,
|
|
1480
|
+
SearchOnlyContext: () => SearchOnlyContext,
|
|
1481
|
+
SearchOnlyFilter: () => SearchOnlyFilter,
|
|
1463
1482
|
SegmentedControl: () => SegmentedControl,
|
|
1464
1483
|
ShortcutContext: () => ShortcutContext,
|
|
1465
1484
|
ShortcutRevealer: () => ShortcutRevealer,
|
|
@@ -1468,6 +1487,7 @@ __export(src_exports, {
|
|
|
1468
1487
|
SuccessMessage: () => SuccessMessage,
|
|
1469
1488
|
Switch: () => Switch,
|
|
1470
1489
|
TAKEOVER_STACK_ID: () => TAKEOVER_STACK_ID,
|
|
1490
|
+
TEXTBOX_OPERATORS: () => TEXTBOX_OPERATORS,
|
|
1471
1491
|
TabButton: () => TabButton,
|
|
1472
1492
|
TabButtonGroup: () => TabButtonGroup,
|
|
1473
1493
|
TabContent: () => TabContent,
|
|
@@ -1488,6 +1508,7 @@ __export(src_exports, {
|
|
|
1488
1508
|
ToastContainer: () => ToastContainer,
|
|
1489
1509
|
Tooltip: () => Tooltip,
|
|
1490
1510
|
TwoColumnLayout: () => TwoColumnLayout,
|
|
1511
|
+
USER_OPERATORS: () => USER_OPERATORS,
|
|
1491
1512
|
UniformBadge: () => UniformBadge,
|
|
1492
1513
|
UniformLogo: () => UniformLogo,
|
|
1493
1514
|
UniformLogoLarge: () => UniformLogoLarge,
|
|
@@ -1569,6 +1590,7 @@ __export(src_exports, {
|
|
|
1569
1590
|
useIconContext: () => useIconContext,
|
|
1570
1591
|
useOutsideClick: () => useOutsideClick,
|
|
1571
1592
|
useParameterShell: () => useParameterShell,
|
|
1593
|
+
useSearchAndFilter: () => useSearchAndFilter,
|
|
1572
1594
|
useShortcut: () => useShortcut,
|
|
1573
1595
|
warningIcon: () => warningIcon,
|
|
1574
1596
|
yesNoIcon: () => yesNoIcon
|
|
@@ -2226,7 +2248,7 @@ var input = (whiteSpaceWrap) => import_react4.css`
|
|
|
2226
2248
|
border-radius: var(--rounded-sm);
|
|
2227
2249
|
color: var(--gray-700);
|
|
2228
2250
|
padding: var(--input-padding);
|
|
2229
|
-
min-height:
|
|
2251
|
+
min-height: 50px;
|
|
2230
2252
|
width: 100%;
|
|
2231
2253
|
position: relative;
|
|
2232
2254
|
white-space: ${whiteSpaceWrap};
|
|
@@ -2291,6 +2313,15 @@ var input = (whiteSpaceWrap) => import_react4.css`
|
|
|
2291
2313
|
font-size: var(--fs-sm);
|
|
2292
2314
|
margin-right: var(--spacing-base);
|
|
2293
2315
|
}
|
|
2316
|
+
|
|
2317
|
+
&[aria-invalid='true'] {
|
|
2318
|
+
border-color: var(--action-destructive-default);
|
|
2319
|
+
box-shadow: var(--elevation-100);
|
|
2320
|
+
|
|
2321
|
+
&:hover {
|
|
2322
|
+
border-color: var(--action-destructive-hover);
|
|
2323
|
+
}
|
|
2324
|
+
}
|
|
2294
2325
|
`;
|
|
2295
2326
|
var inputError = import_react4.css`
|
|
2296
2327
|
border-color: var(--action-destructive-default);
|
|
@@ -2822,6 +2853,9 @@ var IconColorAction = import_react12.css`
|
|
|
2822
2853
|
var IconColorAccent = import_react12.css`
|
|
2823
2854
|
color: var(--accent-alt-dark);
|
|
2824
2855
|
`;
|
|
2856
|
+
var IconColorAccentDark = import_react12.css`
|
|
2857
|
+
color: var(--accent-dark);
|
|
2858
|
+
`;
|
|
2825
2859
|
var IconColorAccentLight = import_react12.css`
|
|
2826
2860
|
color: var(--accent-light);
|
|
2827
2861
|
`;
|
|
@@ -2866,6 +2900,7 @@ var IconInner = ({ icon, iconColor = "default", size = "1.5rem", ...otherProps }
|
|
|
2866
2900
|
red: IconColorRed,
|
|
2867
2901
|
accent: IconColorAccent,
|
|
2868
2902
|
currentColor: IconColorCurrent,
|
|
2903
|
+
"accent-dark": IconColorAccentDark,
|
|
2869
2904
|
"accent-light": IconColorAccentLight
|
|
2870
2905
|
};
|
|
2871
2906
|
if (isIconName && isLoading) {
|
|
@@ -3613,6 +3648,27 @@ var listViewLong = (0, import_all_files.GenIcon)({
|
|
|
3613
3648
|
}
|
|
3614
3649
|
]
|
|
3615
3650
|
});
|
|
3651
|
+
var filterAdd = (0, import_all_files.GenIcon)({
|
|
3652
|
+
tag: "svg",
|
|
3653
|
+
attr: {
|
|
3654
|
+
role: "img",
|
|
3655
|
+
viewBox: "0 0 16 16",
|
|
3656
|
+
fill: "none",
|
|
3657
|
+
strokeWidth: ""
|
|
3658
|
+
},
|
|
3659
|
+
child: [
|
|
3660
|
+
{
|
|
3661
|
+
tag: "path",
|
|
3662
|
+
attr: {
|
|
3663
|
+
stroke: "currentColor",
|
|
3664
|
+
d: "M8 13.3334L6 14V8.33335L3.01333 5.04802C2.7903 4.80264 2.6667 4.48295 2.66666 4.15135V2.66669H13.3333V4.11469C13.3333 4.46828 13.1927 4.80736 12.9427 5.05735L10 8.00002V10M10.6667 12.6667H14.6667M12.6667 10.6667V14.6667",
|
|
3665
|
+
strokeLinejoin: "round",
|
|
3666
|
+
strokeLinecap: "round"
|
|
3667
|
+
},
|
|
3668
|
+
child: []
|
|
3669
|
+
}
|
|
3670
|
+
]
|
|
3671
|
+
});
|
|
3616
3672
|
var customIcons = {
|
|
3617
3673
|
"rectangle-rounded": rectangleRoundedIcon,
|
|
3618
3674
|
card: cardIcon,
|
|
@@ -3639,7 +3695,8 @@ var customIcons = {
|
|
|
3639
3695
|
"diamond-fill": diamondFill,
|
|
3640
3696
|
"magic-wand": magicWand,
|
|
3641
3697
|
"list-view-short": listViewShort,
|
|
3642
|
-
"list-view-long": listViewLong
|
|
3698
|
+
"list-view-long": listViewLong,
|
|
3699
|
+
"filter-add": filterAdd
|
|
3643
3700
|
};
|
|
3644
3701
|
|
|
3645
3702
|
// src/components/AddListButton/AddListButton.styles.ts
|
|
@@ -4144,7 +4201,7 @@ var import_react22 = require("@emotion/react");
|
|
|
4144
4201
|
var PageHeaderSectionContainer = import_react22.css`
|
|
4145
4202
|
display: flex;
|
|
4146
4203
|
justify-content: space-between;
|
|
4147
|
-
margin-bottom: var(--spacing-
|
|
4204
|
+
margin-bottom: var(--spacing-sm);
|
|
4148
4205
|
flex-direction: column;
|
|
4149
4206
|
gap: var(--spacing-sm);
|
|
4150
4207
|
|
|
@@ -13846,6 +13903,7 @@ var import_react_aria_components = require("react-aria-components");
|
|
|
13846
13903
|
init_emotion_jsx_shim();
|
|
13847
13904
|
var import_react39 = require("@emotion/react");
|
|
13848
13905
|
var container = import_react39.css`
|
|
13906
|
+
--calendar-cell-size: 1.8rem;
|
|
13849
13907
|
width: fit-content;
|
|
13850
13908
|
max-width: 100%;
|
|
13851
13909
|
`;
|
|
@@ -13870,13 +13928,13 @@ var headerNavButton = import_react39.css`
|
|
|
13870
13928
|
}
|
|
13871
13929
|
`;
|
|
13872
13930
|
var cell = import_react39.css`
|
|
13873
|
-
width:
|
|
13874
|
-
line-height:
|
|
13931
|
+
width: var(--calendar-cell-size);
|
|
13932
|
+
line-height: var(--calendar-cell-size);
|
|
13875
13933
|
text-align: center;
|
|
13876
13934
|
border-radius: var(--rounded-sm);
|
|
13877
13935
|
cursor: default;
|
|
13878
13936
|
outline: none;
|
|
13879
|
-
margin: 1px;
|
|
13937
|
+
margin: 1px 0;
|
|
13880
13938
|
forced-color-adjust: none;
|
|
13881
13939
|
|
|
13882
13940
|
&:hover {
|
|
@@ -13902,6 +13960,12 @@ var cell = import_react39.css`
|
|
|
13902
13960
|
color: var(--white);
|
|
13903
13961
|
}
|
|
13904
13962
|
`;
|
|
13963
|
+
var cellIsOutsideRange = import_react39.css`
|
|
13964
|
+
color: var(--gray-400);
|
|
13965
|
+
`;
|
|
13966
|
+
var cellIsToday = import_react39.css`
|
|
13967
|
+
background: var(--gray-200);
|
|
13968
|
+
`;
|
|
13905
13969
|
var actions = import_react39.css`
|
|
13906
13970
|
display: flex;
|
|
13907
13971
|
justify-content: end;
|
|
@@ -13930,6 +13994,9 @@ var Calendar = ({
|
|
|
13930
13994
|
...props
|
|
13931
13995
|
}) => {
|
|
13932
13996
|
const [focusedValue, setFocusedValue] = (0, import_react40.useState)(void 0);
|
|
13997
|
+
const today_date = (0, import_date.today)(timeZone);
|
|
13998
|
+
const minDate = tryParseDate(minValue);
|
|
13999
|
+
const maxDate = tryParseDate(maxValue);
|
|
13933
14000
|
const handleChange = (0, import_react40.useCallback)(
|
|
13934
14001
|
(value2) => {
|
|
13935
14002
|
onChange == null ? void 0 : onChange(value2.toString());
|
|
@@ -13937,10 +14004,9 @@ var Calendar = ({
|
|
|
13937
14004
|
[onChange]
|
|
13938
14005
|
);
|
|
13939
14006
|
const gotoToday = (0, import_react40.useCallback)(() => {
|
|
13940
|
-
|
|
13941
|
-
|
|
13942
|
-
|
|
13943
|
-
}, [onChange, timeZone]);
|
|
14007
|
+
onChange == null ? void 0 : onChange(today_date.toString());
|
|
14008
|
+
setFocusedValue(today_date);
|
|
14009
|
+
}, [onChange, today_date]);
|
|
13944
14010
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { ...props, children: [
|
|
13945
14011
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
13946
14012
|
import_react_aria_components.Calendar,
|
|
@@ -13948,8 +14014,8 @@ var Calendar = ({
|
|
|
13948
14014
|
value: tryParseDate(value) || null,
|
|
13949
14015
|
focusedValue,
|
|
13950
14016
|
onFocusChange: setFocusedValue,
|
|
13951
|
-
minValue:
|
|
13952
|
-
maxValue:
|
|
14017
|
+
minValue: minDate,
|
|
14018
|
+
maxValue: maxDate,
|
|
13953
14019
|
onChange: handleChange,
|
|
13954
14020
|
css: container,
|
|
13955
14021
|
"aria-label": "Appointment date",
|
|
@@ -13976,7 +14042,18 @@ var Calendar = ({
|
|
|
13976
14042
|
}
|
|
13977
14043
|
)
|
|
13978
14044
|
] }),
|
|
13979
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_aria_components.CalendarGrid, { children: (date) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
14045
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_aria_components.CalendarGrid, { children: (date) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
14046
|
+
import_react_aria_components.CalendarCell,
|
|
14047
|
+
{
|
|
14048
|
+
css: [
|
|
14049
|
+
cell,
|
|
14050
|
+
minDate && date.compare(minDate) < 0 ? cellIsOutsideRange : null,
|
|
14051
|
+
maxDate && date.compare(maxDate) > 0 ? cellIsOutsideRange : null,
|
|
14052
|
+
(0, import_date.isToday)(date, timeZone) ? cellIsToday : null
|
|
14053
|
+
],
|
|
14054
|
+
date
|
|
14055
|
+
}
|
|
14056
|
+
) })
|
|
13980
14057
|
]
|
|
13981
14058
|
}
|
|
13982
14059
|
),
|
|
@@ -15499,6 +15576,13 @@ function InputComboBox(props) {
|
|
|
15499
15576
|
boxShadow: "none",
|
|
15500
15577
|
borderColor: "var(--accent-dark-hover)"
|
|
15501
15578
|
},
|
|
15579
|
+
'&:has([aria-readonly="true"])': {
|
|
15580
|
+
background: "var(--gray-100)",
|
|
15581
|
+
"&:hover": {
|
|
15582
|
+
borderColor: "var(--gray-300)"
|
|
15583
|
+
},
|
|
15584
|
+
...state.isFocused ? { borderColor: "var(--gray-300)" } : {}
|
|
15585
|
+
},
|
|
15502
15586
|
...(_b = (_a2 = props.styles) == null ? void 0 : _a2.control) == null ? void 0 : _b.call(_a2, base, state)
|
|
15503
15587
|
};
|
|
15504
15588
|
},
|
|
@@ -15712,6 +15796,8 @@ var InputInlineSelect = ({
|
|
|
15712
15796
|
init_emotion_jsx_shim();
|
|
15713
15797
|
var import_CgClose5 = require("@react-icons/all-files/cg/CgClose");
|
|
15714
15798
|
var import_CgSearch2 = require("@react-icons/all-files/cg/CgSearch");
|
|
15799
|
+
var React12 = __toESM(require("react"));
|
|
15800
|
+
var import_react_use2 = require("react-use");
|
|
15715
15801
|
var import_jsx_runtime53 = require("@emotion/react/jsx-runtime");
|
|
15716
15802
|
var InputKeywordSearch = ({
|
|
15717
15803
|
onSearchTextChanged,
|
|
@@ -15733,6 +15819,9 @@ var InputKeywordSearch = ({
|
|
|
15733
15819
|
e.preventDefault();
|
|
15734
15820
|
}
|
|
15735
15821
|
};
|
|
15822
|
+
const handleClear = () => {
|
|
15823
|
+
onClear ? onClear() : onSearchTextChanged("");
|
|
15824
|
+
};
|
|
15736
15825
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
15737
15826
|
Input,
|
|
15738
15827
|
{
|
|
@@ -15741,7 +15830,16 @@ var InputKeywordSearch = ({
|
|
|
15741
15830
|
placeholder,
|
|
15742
15831
|
showLabel: false,
|
|
15743
15832
|
value,
|
|
15744
|
-
icon: value ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
15833
|
+
icon: value ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
15834
|
+
"button",
|
|
15835
|
+
{
|
|
15836
|
+
css: inputSearchCloseBtn,
|
|
15837
|
+
onClick: handleClear,
|
|
15838
|
+
type: "button",
|
|
15839
|
+
"data-testid": "keyword-search-clear-button",
|
|
15840
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Icon, { icon: import_CgClose5.CgClose, iconColor: "red", size: "1rem" })
|
|
15841
|
+
}
|
|
15842
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Icon, { icon: import_CgSearch2.CgSearch, iconColor: "gray", size: "1rem" }),
|
|
15745
15843
|
onChange: handleSearchTextChanged,
|
|
15746
15844
|
onKeyPress: preventSubmitOnField,
|
|
15747
15845
|
disabled: disabled2,
|
|
@@ -15758,6 +15856,16 @@ var InputKeywordSearch = ({
|
|
|
15758
15856
|
}
|
|
15759
15857
|
);
|
|
15760
15858
|
};
|
|
15859
|
+
var DebouncedInputKeywordSearch = ({
|
|
15860
|
+
delay = 300,
|
|
15861
|
+
onSearchTextChanged,
|
|
15862
|
+
defaultValue,
|
|
15863
|
+
...props
|
|
15864
|
+
}) => {
|
|
15865
|
+
const [searchText, setSearchText] = React12.useState(defaultValue != null ? defaultValue : "");
|
|
15866
|
+
(0, import_react_use2.useDebounce)(() => onSearchTextChanged(searchText), delay, [searchText]);
|
|
15867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(InputKeywordSearch, { ...props, value: searchText, onSearchTextChanged: setSearchText });
|
|
15868
|
+
};
|
|
15761
15869
|
|
|
15762
15870
|
// src/components/Input/InputSelect.tsx
|
|
15763
15871
|
init_emotion_jsx_shim();
|
|
@@ -15828,7 +15936,7 @@ var InputSelect = (0, import_react63.forwardRef)(
|
|
|
15828
15936
|
// src/components/Input/InputTime.tsx
|
|
15829
15937
|
init_emotion_jsx_shim();
|
|
15830
15938
|
var import_date2 = require("@internationalized/date");
|
|
15831
|
-
var
|
|
15939
|
+
var React13 = __toESM(require("react"));
|
|
15832
15940
|
var import_react65 = require("react");
|
|
15833
15941
|
var import_react_aria_components2 = require("react-aria-components");
|
|
15834
15942
|
|
|
@@ -15888,7 +15996,7 @@ function tryParseTime(isoTime) {
|
|
|
15888
15996
|
return void 0;
|
|
15889
15997
|
}
|
|
15890
15998
|
}
|
|
15891
|
-
var InputTime =
|
|
15999
|
+
var InputTime = React13.forwardRef(
|
|
15892
16000
|
({
|
|
15893
16001
|
id,
|
|
15894
16002
|
label,
|
|
@@ -15970,9 +16078,9 @@ InputTime.displayName = "InputTime";
|
|
|
15970
16078
|
|
|
15971
16079
|
// src/components/Input/InputToggle.tsx
|
|
15972
16080
|
init_emotion_jsx_shim();
|
|
15973
|
-
var
|
|
16081
|
+
var React14 = __toESM(require("react"));
|
|
15974
16082
|
var import_jsx_runtime56 = require("@emotion/react/jsx-runtime");
|
|
15975
|
-
var InputToggle =
|
|
16083
|
+
var InputToggle = React14.forwardRef(
|
|
15976
16084
|
({
|
|
15977
16085
|
label,
|
|
15978
16086
|
type,
|
|
@@ -16148,7 +16256,7 @@ var popover = import_react69.css`
|
|
|
16148
16256
|
padding: var(--spacing-md);
|
|
16149
16257
|
max-width: none;
|
|
16150
16258
|
gap: var(--spacing-md);
|
|
16151
|
-
grid-template-columns:
|
|
16259
|
+
grid-template-columns: 0.8fr 1fr;
|
|
16152
16260
|
grid-template-rows: 1fr 1fr;
|
|
16153
16261
|
|
|
16154
16262
|
[data-variant='date'] & {
|
|
@@ -16204,7 +16312,7 @@ var import_date3 = require("@internationalized/date");
|
|
|
16204
16312
|
function getTimeZoneLabel(tz) {
|
|
16205
16313
|
var _a;
|
|
16206
16314
|
const offset = (_a = Intl.DateTimeFormat("en", { timeZoneName: "shortOffset", timeZone: tz }).formatToParts().find((p) => p.type === "timeZoneName")) == null ? void 0 : _a.value;
|
|
16207
|
-
return tz + (offset ? ` (${offset})` : "");
|
|
16315
|
+
return String(tz).replace(/_/g, " ") + (offset ? ` (${offset})` : "");
|
|
16208
16316
|
}
|
|
16209
16317
|
function tryParseAbsolute(isoDateTime, timeZone) {
|
|
16210
16318
|
try {
|
|
@@ -16240,7 +16348,8 @@ var DateTimePickerVariant = /* @__PURE__ */ ((DateTimePickerVariant2) => {
|
|
|
16240
16348
|
|
|
16241
16349
|
// src/components/DateTimePicker/DateTimePicker.tsx
|
|
16242
16350
|
var import_jsx_runtime61 = require("@emotion/react/jsx-runtime");
|
|
16243
|
-
var
|
|
16351
|
+
var timeZoneOptions = typeof Intl !== "undefined" && typeof Intl.supportedValuesOf === "function" ? Intl.supportedValuesOf("timeZone") : ["Etc/UTC"];
|
|
16352
|
+
var TIMEZONE_OPTIONS = timeZoneOptions.map((v) => ({
|
|
16244
16353
|
label: getTimeZoneLabel(v),
|
|
16245
16354
|
value: v
|
|
16246
16355
|
}));
|
|
@@ -16290,9 +16399,10 @@ var DateTimePicker = ({
|
|
|
16290
16399
|
return TIMEZONE_OPTIONS.find(({ value: value2 }) => value2 === timeZone);
|
|
16291
16400
|
});
|
|
16292
16401
|
(0, import_react70.useEffect)(() => {
|
|
16402
|
+
var _a;
|
|
16293
16403
|
if (popover2.visible) {
|
|
16294
16404
|
setDraftDate(tryToCalendarDate(parsedValue));
|
|
16295
|
-
setDraftTime(tryToTime(parsedValue));
|
|
16405
|
+
setDraftTime((_a = tryToTime(parsedValue)) != null ? _a : new import_date4.Time(0, 0));
|
|
16296
16406
|
}
|
|
16297
16407
|
}, [parsedValue, popover2.visible]);
|
|
16298
16408
|
const handleDateChange = (0, import_react70.useCallback)((isoDate) => {
|
|
@@ -16481,7 +16591,7 @@ var DescriptionListValueBoolean = ({ value }) => {
|
|
|
16481
16591
|
|
|
16482
16592
|
// src/components/Details/Details.tsx
|
|
16483
16593
|
init_emotion_jsx_shim();
|
|
16484
|
-
var
|
|
16594
|
+
var React16 = __toESM(require("react"));
|
|
16485
16595
|
|
|
16486
16596
|
// src/components/Details/Details.styles.ts
|
|
16487
16597
|
init_emotion_jsx_shim();
|
|
@@ -16541,9 +16651,9 @@ var Details = ({
|
|
|
16541
16651
|
onChange,
|
|
16542
16652
|
...props
|
|
16543
16653
|
}) => {
|
|
16544
|
-
const detailsRef =
|
|
16545
|
-
const [internalOpen, setInternalOpen] =
|
|
16546
|
-
const memoizedIsOpen =
|
|
16654
|
+
const detailsRef = React16.useRef(null);
|
|
16655
|
+
const [internalOpen, setInternalOpen] = React16.useState(isOpenByDefault);
|
|
16656
|
+
const memoizedIsOpen = React16.useMemo(() => {
|
|
16547
16657
|
return isOpen !== void 0 ? isOpen : internalOpen;
|
|
16548
16658
|
}, [internalOpen, isOpen]);
|
|
16549
16659
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
@@ -19282,6 +19392,16 @@ var toggleInput2 = import_react110.css`
|
|
|
19282
19392
|
color: var(--white);
|
|
19283
19393
|
}
|
|
19284
19394
|
|
|
19395
|
+
&:indeterminate,
|
|
19396
|
+
&:indeterminate:hover,
|
|
19397
|
+
&:indeterminate:focus {
|
|
19398
|
+
background: var(--accent-dark-active)
|
|
19399
|
+
url('data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIxNiIKICBoZWlnaHQ9IjE2IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKPgogIDxwYXRoCiAgICBkPSJNNCAxMkM0IDExLjQ0NzcgNC40NDc3MiAxMSA1IDExSDE5QzE5LjU1MjMgMTEgMjAgMTEuNDQ3NyAyMCAxMkMyMCAxMi41NTIzIDE5LjU1MjMgMTMgMTkgMTNINUM0LjQ0NzcyIDEzIDQgMTIuNTUyMyA0IDEyWiIKICAgIGZpbGw9IndoaXRlIgogIC8+Cjwvc3ZnPg==')
|
|
19400
|
+
no-repeat center center;
|
|
19401
|
+
border-color: var(--accent-dark-active);
|
|
19402
|
+
color: var(--white);
|
|
19403
|
+
}
|
|
19404
|
+
|
|
19285
19405
|
&:hover {
|
|
19286
19406
|
border-color: var(--accent-dark-hover);
|
|
19287
19407
|
}
|
|
@@ -21406,7 +21526,7 @@ var editorPlaceholder = import_react129.css`
|
|
|
21406
21526
|
left: calc(var(--spacing-sm) + 1px);
|
|
21407
21527
|
pointer-events: none;
|
|
21408
21528
|
position: absolute;
|
|
21409
|
-
top: var(--spacing-
|
|
21529
|
+
top: var(--spacing-sm);
|
|
21410
21530
|
user-select: none;
|
|
21411
21531
|
`;
|
|
21412
21532
|
var editorInput = import_react129.css`
|
|
@@ -21862,93 +21982,1562 @@ var ProgressListItem = ({
|
|
|
21862
21982
|
] });
|
|
21863
21983
|
};
|
|
21864
21984
|
|
|
21865
|
-
// src/components/
|
|
21985
|
+
// src/components/SearchAndFilter/constants.ts
|
|
21866
21986
|
init_emotion_jsx_shim();
|
|
21867
|
-
var
|
|
21868
|
-
|
|
21869
|
-
|
|
21987
|
+
var NUMBER_OPERATORS = [
|
|
21988
|
+
{
|
|
21989
|
+
label: "equals...",
|
|
21990
|
+
symbol: "=",
|
|
21991
|
+
value: "eq",
|
|
21992
|
+
editorType: "number"
|
|
21993
|
+
},
|
|
21994
|
+
{
|
|
21995
|
+
label: "does not equal...",
|
|
21996
|
+
symbol: "\u2260",
|
|
21997
|
+
value: "neq",
|
|
21998
|
+
editorType: "number"
|
|
21999
|
+
},
|
|
22000
|
+
{
|
|
22001
|
+
label: "greater than...",
|
|
22002
|
+
symbol: ">",
|
|
22003
|
+
value: "gt",
|
|
22004
|
+
editorType: "number"
|
|
22005
|
+
},
|
|
22006
|
+
{
|
|
22007
|
+
label: "greater than or equal to...",
|
|
22008
|
+
symbol: "\u2265",
|
|
22009
|
+
value: "gte",
|
|
22010
|
+
editorType: "number"
|
|
22011
|
+
},
|
|
22012
|
+
{
|
|
22013
|
+
label: "less than...",
|
|
22014
|
+
symbol: "<",
|
|
22015
|
+
value: "lt",
|
|
22016
|
+
editorType: "number"
|
|
22017
|
+
},
|
|
22018
|
+
{
|
|
22019
|
+
label: "less than or equal to...",
|
|
22020
|
+
symbol: "\u2264",
|
|
22021
|
+
value: "lte",
|
|
22022
|
+
editorType: "number"
|
|
22023
|
+
},
|
|
22024
|
+
{
|
|
22025
|
+
label: "is empty...",
|
|
22026
|
+
value: "ndef",
|
|
22027
|
+
editorType: "empty"
|
|
22028
|
+
},
|
|
22029
|
+
{
|
|
22030
|
+
label: "is between...",
|
|
22031
|
+
value: "between",
|
|
22032
|
+
editorType: "numberRange"
|
|
22033
|
+
},
|
|
22034
|
+
{
|
|
22035
|
+
label: "is not empty...",
|
|
22036
|
+
value: "def",
|
|
22037
|
+
editorType: "empty"
|
|
22038
|
+
}
|
|
22039
|
+
];
|
|
22040
|
+
var DATE_OPERATORS = [
|
|
22041
|
+
{
|
|
22042
|
+
label: "is...",
|
|
22043
|
+
value: "eq",
|
|
22044
|
+
editorType: "date"
|
|
22045
|
+
},
|
|
22046
|
+
{
|
|
22047
|
+
label: "is between...",
|
|
22048
|
+
value: "between",
|
|
22049
|
+
editorType: "dateRange"
|
|
22050
|
+
},
|
|
22051
|
+
{
|
|
22052
|
+
label: "is before...",
|
|
22053
|
+
value: "lt",
|
|
22054
|
+
editorType: "date"
|
|
22055
|
+
},
|
|
22056
|
+
{
|
|
22057
|
+
label: "is after...",
|
|
22058
|
+
value: "gt",
|
|
22059
|
+
editorType: "date"
|
|
22060
|
+
},
|
|
22061
|
+
{
|
|
22062
|
+
label: "is on or before...",
|
|
22063
|
+
value: "lte",
|
|
22064
|
+
editorType: "date"
|
|
22065
|
+
},
|
|
22066
|
+
{
|
|
22067
|
+
label: "is on or after...",
|
|
22068
|
+
value: "gte",
|
|
22069
|
+
editorType: "date"
|
|
22070
|
+
},
|
|
22071
|
+
{
|
|
22072
|
+
label: "is empty...",
|
|
22073
|
+
value: "ndef",
|
|
22074
|
+
editorType: "empty"
|
|
22075
|
+
},
|
|
22076
|
+
{
|
|
22077
|
+
label: "is not...",
|
|
22078
|
+
value: "neq",
|
|
22079
|
+
editorType: "date"
|
|
22080
|
+
},
|
|
22081
|
+
{
|
|
22082
|
+
label: "is not empty...",
|
|
22083
|
+
value: "def",
|
|
22084
|
+
editorType: "empty"
|
|
22085
|
+
}
|
|
22086
|
+
];
|
|
22087
|
+
var TEXTBOX_OPERATORS = [
|
|
22088
|
+
{
|
|
22089
|
+
label: "is...",
|
|
22090
|
+
value: "eq",
|
|
22091
|
+
editorType: "text"
|
|
22092
|
+
},
|
|
22093
|
+
{
|
|
22094
|
+
label: "is empty...",
|
|
22095
|
+
value: "ndef",
|
|
22096
|
+
editorType: "empty"
|
|
22097
|
+
},
|
|
22098
|
+
{
|
|
22099
|
+
label: "contains...",
|
|
22100
|
+
value: "match",
|
|
22101
|
+
editorType: "text"
|
|
22102
|
+
},
|
|
22103
|
+
{
|
|
22104
|
+
label: "is not...",
|
|
22105
|
+
value: "neq",
|
|
22106
|
+
editorType: "text"
|
|
22107
|
+
},
|
|
22108
|
+
{
|
|
22109
|
+
label: "is not empty...",
|
|
22110
|
+
value: "def",
|
|
22111
|
+
editorType: "empty"
|
|
22112
|
+
}
|
|
22113
|
+
];
|
|
22114
|
+
var USER_OPERATORS = [
|
|
22115
|
+
{
|
|
22116
|
+
label: "is...",
|
|
22117
|
+
value: "eq",
|
|
22118
|
+
editorType: "text"
|
|
22119
|
+
},
|
|
22120
|
+
{
|
|
22121
|
+
label: "contains...",
|
|
22122
|
+
value: "match",
|
|
22123
|
+
editorType: "text"
|
|
22124
|
+
},
|
|
22125
|
+
{
|
|
22126
|
+
label: "is not...",
|
|
22127
|
+
value: "neq",
|
|
22128
|
+
editorType: "text"
|
|
22129
|
+
}
|
|
22130
|
+
];
|
|
22131
|
+
var SYSTEM_DATE_OPERATORS = [
|
|
22132
|
+
{
|
|
22133
|
+
label: "is...",
|
|
22134
|
+
value: "eq",
|
|
22135
|
+
editorType: "date"
|
|
22136
|
+
},
|
|
22137
|
+
{
|
|
22138
|
+
label: "is between...",
|
|
22139
|
+
value: "between",
|
|
22140
|
+
editorType: "dateRange"
|
|
22141
|
+
},
|
|
22142
|
+
{
|
|
22143
|
+
label: "is before...",
|
|
22144
|
+
value: "lt",
|
|
22145
|
+
editorType: "date"
|
|
22146
|
+
},
|
|
22147
|
+
{
|
|
22148
|
+
label: "is after...",
|
|
22149
|
+
value: "gt",
|
|
22150
|
+
editorType: "date"
|
|
22151
|
+
},
|
|
22152
|
+
{
|
|
22153
|
+
label: "is on or before...",
|
|
22154
|
+
value: "lte",
|
|
22155
|
+
editorType: "date"
|
|
22156
|
+
},
|
|
22157
|
+
{
|
|
22158
|
+
label: "is on or after...",
|
|
22159
|
+
value: "gte",
|
|
22160
|
+
editorType: "date"
|
|
22161
|
+
},
|
|
22162
|
+
{
|
|
22163
|
+
label: "is not...",
|
|
22164
|
+
value: "neq",
|
|
22165
|
+
editorType: "date"
|
|
22166
|
+
}
|
|
22167
|
+
];
|
|
22168
|
+
var RICHTEXT_OPERATORS = [
|
|
22169
|
+
{
|
|
22170
|
+
label: "is empty...",
|
|
22171
|
+
value: "ndef",
|
|
22172
|
+
editorType: "empty"
|
|
22173
|
+
},
|
|
22174
|
+
{
|
|
22175
|
+
label: "contains...",
|
|
22176
|
+
value: "match",
|
|
22177
|
+
editorType: "text"
|
|
22178
|
+
},
|
|
22179
|
+
{
|
|
22180
|
+
label: "is not empty...",
|
|
22181
|
+
value: "def",
|
|
22182
|
+
editorType: "empty"
|
|
22183
|
+
}
|
|
22184
|
+
];
|
|
22185
|
+
var CHECKBOX_OPERATORS = [
|
|
22186
|
+
{
|
|
22187
|
+
label: "is checked...",
|
|
22188
|
+
value: "def",
|
|
22189
|
+
editorType: "empty"
|
|
22190
|
+
},
|
|
22191
|
+
{
|
|
22192
|
+
label: "is not checked...",
|
|
22193
|
+
value: "ndef",
|
|
22194
|
+
editorType: "empty"
|
|
22195
|
+
}
|
|
22196
|
+
];
|
|
22197
|
+
var SYSTEM_FIELD_OPERATORS = [
|
|
22198
|
+
{
|
|
22199
|
+
label: "is...",
|
|
22200
|
+
value: "eq",
|
|
22201
|
+
editorType: "singleChoice"
|
|
22202
|
+
},
|
|
22203
|
+
{
|
|
22204
|
+
label: "is any of...",
|
|
22205
|
+
value: "in",
|
|
22206
|
+
editorType: "multiChoice"
|
|
22207
|
+
},
|
|
22208
|
+
{
|
|
22209
|
+
label: "is not...",
|
|
22210
|
+
value: "neq",
|
|
22211
|
+
editorType: "singleChoice"
|
|
22212
|
+
},
|
|
22213
|
+
{
|
|
22214
|
+
label: "is none of...",
|
|
22215
|
+
value: "nin",
|
|
22216
|
+
editorType: "multiChoice"
|
|
22217
|
+
}
|
|
22218
|
+
];
|
|
21870
22219
|
|
|
21871
|
-
// src/components/
|
|
22220
|
+
// src/components/SearchAndFilter/FilterButton.tsx
|
|
22221
|
+
init_emotion_jsx_shim();
|
|
22222
|
+
|
|
22223
|
+
// src/components/SearchAndFilter/styles/SearchAndFilter.styles.ts
|
|
21872
22224
|
init_emotion_jsx_shim();
|
|
21873
22225
|
var import_react138 = require("@emotion/react");
|
|
21874
|
-
var
|
|
21875
|
-
|
|
21876
|
-
|
|
21877
|
-
|
|
21878
|
-
|
|
21879
|
-
|
|
21880
|
-
|
|
21881
|
-
|
|
22226
|
+
var SearchAndFilterContainer = import_react138.css``;
|
|
22227
|
+
var SearchAndFilterControlsWrapper = (gridColumns) => import_react138.css`
|
|
22228
|
+
align-items: stretch;
|
|
22229
|
+
display: grid;
|
|
22230
|
+
grid-template-columns: ${gridColumns};
|
|
22231
|
+
gap: var(--spacing-sm);
|
|
22232
|
+
`;
|
|
22233
|
+
var SearchAndFilterOutterControlWrapper = (gridColumns) => import_react138.css`
|
|
22234
|
+
align-items: stretch;
|
|
22235
|
+
display: grid;
|
|
22236
|
+
grid-template-columns: ${gridColumns};
|
|
22237
|
+
gap: var(--spacing-sm);
|
|
22238
|
+
`;
|
|
22239
|
+
var ConditionalFilterRow = import_react138.css`
|
|
22240
|
+
display: grid;
|
|
22241
|
+
grid-template-columns: 35px 1fr;
|
|
22242
|
+
gap: var(--spacing-sm);
|
|
22243
|
+
margin-left: var(--spacing-base);
|
|
21882
22244
|
|
|
21883
|
-
|
|
21884
|
-
|
|
21885
|
-
|
|
21886
|
-
|
|
21887
|
-
|
|
21888
|
-
|
|
21889
|
-
|
|
21890
|
-
|
|
21891
|
-
|
|
22245
|
+
${cq("380px")} {
|
|
22246
|
+
align-items: center;
|
|
22247
|
+
}
|
|
22248
|
+
|
|
22249
|
+
&:first-of-type {
|
|
22250
|
+
margin-left: 0;
|
|
22251
|
+
grid-template-columns: 50px 1fr;
|
|
22252
|
+
}
|
|
22253
|
+
|
|
22254
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
22255
|
+
animation: ${fadeInLtr} var(--duration-fast) var(--timing-ease-out);
|
|
22256
|
+
}
|
|
21892
22257
|
`;
|
|
21893
|
-
var
|
|
22258
|
+
var ConditionalInputRow = import_react138.css`
|
|
22259
|
+
display: flex;
|
|
22260
|
+
gap: var(--spacing-sm);
|
|
21894
22261
|
flex-direction: column;
|
|
21895
|
-
|
|
21896
|
-
|
|
21897
|
-
|
|
21898
|
-
|
|
21899
|
-
`;
|
|
21900
|
-
var segmentedControlItemStyles = import_react138.css`
|
|
21901
|
-
&:first-of-type label {
|
|
21902
|
-
border-radius: var(--segmented-control-first-border-radius);
|
|
22262
|
+
|
|
22263
|
+
${cq("380px")} {
|
|
22264
|
+
align-items: center;
|
|
22265
|
+
flex-direction: row;
|
|
21903
22266
|
}
|
|
21904
|
-
|
|
21905
|
-
|
|
22267
|
+
${cq("580px")} {
|
|
22268
|
+
display: grid;
|
|
22269
|
+
grid-template-columns: 200px 160px 1fr 32px;
|
|
21906
22270
|
}
|
|
21907
22271
|
`;
|
|
21908
|
-
var
|
|
21909
|
-
${
|
|
22272
|
+
var SearchInput = import_react138.css`
|
|
22273
|
+
${input("nowrap")}
|
|
22274
|
+
border-radius: var(--rounded-full);
|
|
22275
|
+
padding: var(--spacing-sm) var(--spacing-base);
|
|
22276
|
+
font-size: var(--fs-sm);
|
|
22277
|
+
padding-right: var(--spacing-2xl);
|
|
21910
22278
|
`;
|
|
21911
|
-
var
|
|
21912
|
-
position: relative;
|
|
21913
|
-
display: flex;
|
|
22279
|
+
var FilterButton = import_react138.css`
|
|
21914
22280
|
align-items: center;
|
|
21915
|
-
|
|
21916
|
-
|
|
21917
|
-
|
|
21918
|
-
|
|
21919
|
-
|
|
21920
|
-
|
|
21921
|
-
|
|
21922
|
-
|
|
21923
|
-
|
|
22281
|
+
background: var(--white);
|
|
22282
|
+
border: 1px solid var(--gray-300);
|
|
22283
|
+
border-radius: var(--rounded-full);
|
|
22284
|
+
color: var(--typography-base);
|
|
22285
|
+
display: flex;
|
|
22286
|
+
gap: var(--spacing-sm);
|
|
22287
|
+
padding: var(--spacing-sm) var(--spacing-base);
|
|
22288
|
+
transition: color var(--duration-fast) var(--timing-ease-out),
|
|
22289
|
+
background-color var(--duration-fast) var(--timing-ease-out),
|
|
22290
|
+
border-color var(--duration-fast) var(--timing-ease-out),
|
|
22291
|
+
box-shadow var(--duration-fast) var(--timing-ease-out);
|
|
21924
22292
|
|
|
21925
|
-
|
|
21926
|
-
|
|
21927
|
-
|
|
21928
|
-
box-shadow: 0 0.43em 1.7em 0 rgba(0, 0, 0, 0.15);
|
|
21929
|
-
color: white;
|
|
21930
|
-
-webkit-text-stroke-width: thin;
|
|
21931
|
-
z-index: 0;
|
|
22293
|
+
svg {
|
|
22294
|
+
color: var(--gray-300);
|
|
22295
|
+
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
21932
22296
|
}
|
|
21933
22297
|
|
|
21934
|
-
&:hover
|
|
21935
|
-
|
|
21936
|
-
|
|
22298
|
+
&:hover,
|
|
22299
|
+
:where([aria-expanded='true']) {
|
|
22300
|
+
outline: none;
|
|
22301
|
+
background: var(--gray-200);
|
|
22302
|
+
border-color: var(--gray-300);
|
|
21937
22303
|
|
|
21938
|
-
|
|
21939
|
-
|
|
21940
|
-
|
|
22304
|
+
svg {
|
|
22305
|
+
color: var(--typography-base);
|
|
22306
|
+
}
|
|
21941
22307
|
}
|
|
21942
22308
|
|
|
21943
|
-
&:
|
|
21944
|
-
|
|
21945
|
-
background-color: var(--gray-400);
|
|
22309
|
+
&:disabled {
|
|
22310
|
+
opacity: var(--opacity-50);
|
|
21946
22311
|
}
|
|
21947
|
-
|
|
21948
|
-
|
|
21949
|
-
|
|
21950
|
-
|
|
21951
|
-
|
|
22312
|
+
`;
|
|
22313
|
+
var FilterButtonText = import_react138.css`
|
|
22314
|
+
overflow: hidden;
|
|
22315
|
+
text-overflow: ellipsis;
|
|
22316
|
+
white-space: nowrap;
|
|
22317
|
+
max-width: 14ch;
|
|
22318
|
+
`;
|
|
22319
|
+
var FilterButtonSelected = import_react138.css`
|
|
22320
|
+
background: var(--gray-100);
|
|
22321
|
+
border-color: var(--gray-300);
|
|
22322
|
+
|
|
22323
|
+
svg {
|
|
22324
|
+
color: var(--accent-dark);
|
|
22325
|
+
}
|
|
22326
|
+
`;
|
|
22327
|
+
var FilterButtonWithOptions = import_react138.css`
|
|
22328
|
+
:where([aria-expanded='true']) {
|
|
22329
|
+
background: var(--purple-rain-100);
|
|
22330
|
+
border-color: var(--accent-light);
|
|
22331
|
+
color: var(--typography-base);
|
|
22332
|
+
box-shadow: var(--elevation-100);
|
|
22333
|
+
|
|
22334
|
+
svg {
|
|
22335
|
+
color: var(--accent-dark);
|
|
22336
|
+
}
|
|
22337
|
+
}
|
|
22338
|
+
`;
|
|
22339
|
+
var SearchIcon = import_react138.css`
|
|
22340
|
+
color: var(--icon-color);
|
|
22341
|
+
position: absolute;
|
|
22342
|
+
inset: 0 var(--spacing-base) 0 auto;
|
|
22343
|
+
margin: auto;
|
|
22344
|
+
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
22345
|
+
`;
|
|
22346
|
+
var AddConditionalBtn = import_react138.css`
|
|
22347
|
+
align-items: center;
|
|
22348
|
+
background: transparent;
|
|
22349
|
+
border: none;
|
|
22350
|
+
color: var(--primary-action-default);
|
|
22351
|
+
display: flex;
|
|
22352
|
+
gap: var(--spacing-sm);
|
|
22353
|
+
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
22354
|
+
padding: 0;
|
|
22355
|
+
|
|
22356
|
+
&:hover,
|
|
22357
|
+
&:focus {
|
|
22358
|
+
color: var(--primary-action-hover);
|
|
22359
|
+
}
|
|
22360
|
+
|
|
22361
|
+
&:disabled {
|
|
22362
|
+
color: var(--gray-400);
|
|
22363
|
+
}
|
|
22364
|
+
`;
|
|
22365
|
+
var Title = import_react138.css`
|
|
22366
|
+
color: var(--typography-light);
|
|
22367
|
+
|
|
22368
|
+
&:focus {
|
|
22369
|
+
outline: none;
|
|
22370
|
+
}
|
|
22371
|
+
`;
|
|
22372
|
+
var ResetConditionsBtn = import_react138.css`
|
|
22373
|
+
background: transparent;
|
|
22374
|
+
border: none;
|
|
22375
|
+
color: var(--action-destructive-default);
|
|
22376
|
+
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
22377
|
+
padding: 0;
|
|
22378
|
+
|
|
22379
|
+
&:hover,
|
|
22380
|
+
&:focus {
|
|
22381
|
+
color: var(--action-destructive-hover);
|
|
22382
|
+
}
|
|
22383
|
+
`;
|
|
22384
|
+
var IconBtn = import_react138.css`
|
|
22385
|
+
background: transparent;
|
|
22386
|
+
border: none;
|
|
22387
|
+
padding: var(--spacing-sm);
|
|
22388
|
+
`;
|
|
22389
|
+
var CloseBtn = import_react138.css`
|
|
22390
|
+
color: var(--gray-500);
|
|
22391
|
+
background: transparent;
|
|
22392
|
+
border: none;
|
|
22393
|
+
padding: 0;
|
|
22394
|
+
position: absolute;
|
|
22395
|
+
top: var(--spacing-base);
|
|
22396
|
+
right: var(--spacing-base);
|
|
22397
|
+
`;
|
|
22398
|
+
var SearchAndFilterOptionsContainer = import_react138.css`
|
|
22399
|
+
background: var(--gray-50);
|
|
22400
|
+
border: 1px solid var(--gray-300);
|
|
22401
|
+
border-radius: var(--rounded-base);
|
|
22402
|
+
container-type: inline-size;
|
|
22403
|
+
display: flex;
|
|
22404
|
+
flex-direction: column;
|
|
22405
|
+
gap: var(--spacing-sm);
|
|
22406
|
+
padding: var(--spacing-md) var(--spacing-md) var(--spacing-base);
|
|
22407
|
+
will-change: height;
|
|
22408
|
+
position: relative;
|
|
22409
|
+
z-index: 1;
|
|
22410
|
+
`;
|
|
22411
|
+
var SearchAndFilterOptionsInnerContainer = import_react138.css`
|
|
22412
|
+
display: flex;
|
|
22413
|
+
flex-direction: column;
|
|
22414
|
+
gap: var(--spacing-sm);
|
|
22415
|
+
`;
|
|
22416
|
+
var SearchAndFilterButtonGroup = import_react138.css`
|
|
22417
|
+
margin-top: var(--spacing-base);
|
|
22418
|
+
`;
|
|
22419
|
+
var SortFilterInputRow = import_react138.css`
|
|
22420
|
+
align-items: center;
|
|
22421
|
+
display: flex;
|
|
22422
|
+
gap: var(--spacing-sm);
|
|
22423
|
+
`;
|
|
22424
|
+
|
|
22425
|
+
// src/components/SearchAndFilter/FilterButton.tsx
|
|
22426
|
+
var import_jsx_runtime117 = require("@emotion/react/jsx-runtime");
|
|
22427
|
+
var FilterButton2 = ({
|
|
22428
|
+
text = "Filters",
|
|
22429
|
+
icon = "filter-add",
|
|
22430
|
+
filterCount,
|
|
22431
|
+
hasSelectedValue,
|
|
22432
|
+
...props
|
|
22433
|
+
}) => {
|
|
22434
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
|
|
22435
|
+
"button",
|
|
22436
|
+
{
|
|
22437
|
+
type: "button",
|
|
22438
|
+
css: [
|
|
22439
|
+
FilterButton,
|
|
22440
|
+
hasSelectedValue ? FilterButtonSelected : void 0,
|
|
22441
|
+
filterCount ? [FilterButtonWithOptions, FilterButtonSelected] : void 0
|
|
22442
|
+
],
|
|
22443
|
+
...props,
|
|
22444
|
+
"data-testid": "filters-button",
|
|
22445
|
+
children: [
|
|
22446
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(Icon, { icon, iconColor: "currentColor", size: "1rem" }),
|
|
22447
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)("span", { css: FilterButtonText, children: text }),
|
|
22448
|
+
filterCount ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(Counter, { count: filterCount, bgColor: "var(--white)" }) : null
|
|
22449
|
+
]
|
|
22450
|
+
}
|
|
22451
|
+
);
|
|
22452
|
+
};
|
|
22453
|
+
|
|
22454
|
+
// src/components/SearchAndFilter/FilterControls.tsx
|
|
22455
|
+
init_emotion_jsx_shim();
|
|
22456
|
+
var import_react140 = require("react");
|
|
22457
|
+
var import_react_use3 = require("react-use");
|
|
22458
|
+
|
|
22459
|
+
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
22460
|
+
init_emotion_jsx_shim();
|
|
22461
|
+
var import_react139 = require("react");
|
|
22462
|
+
var import_jsx_runtime118 = require("@emotion/react/jsx-runtime");
|
|
22463
|
+
var SearchAndFilterContext = (0, import_react139.createContext)({
|
|
22464
|
+
searchTerm: "",
|
|
22465
|
+
setSearchTerm: () => {
|
|
22466
|
+
},
|
|
22467
|
+
filterVisibility: void 0,
|
|
22468
|
+
setFilterVisibility: () => {
|
|
22469
|
+
},
|
|
22470
|
+
filters: [],
|
|
22471
|
+
setFilters: () => {
|
|
22472
|
+
},
|
|
22473
|
+
handleAddFilter: () => {
|
|
22474
|
+
},
|
|
22475
|
+
handleResetFilters: () => {
|
|
22476
|
+
},
|
|
22477
|
+
handleDeleteFilter: () => {
|
|
22478
|
+
},
|
|
22479
|
+
setSortBy: () => {
|
|
22480
|
+
},
|
|
22481
|
+
sortByValue: "",
|
|
22482
|
+
filterOptions: [],
|
|
22483
|
+
sortOptions: [],
|
|
22484
|
+
validFilterQuery: [],
|
|
22485
|
+
totalResults: 0
|
|
22486
|
+
});
|
|
22487
|
+
var SearchAndFilterProvider = ({
|
|
22488
|
+
filters,
|
|
22489
|
+
filterOptions,
|
|
22490
|
+
sortOptions,
|
|
22491
|
+
defaultSortByValue,
|
|
22492
|
+
filterMode: filterMode3 = void 0,
|
|
22493
|
+
onSearchChange,
|
|
22494
|
+
onChange,
|
|
22495
|
+
onSortChange,
|
|
22496
|
+
totalResults,
|
|
22497
|
+
children
|
|
22498
|
+
}) => {
|
|
22499
|
+
const [searchTerm, setSearchTerm] = (0, import_react139.useState)("");
|
|
22500
|
+
const deferredSearchTerm = (0, import_react139.useDeferredValue)(searchTerm);
|
|
22501
|
+
const [filterVisibility, setFilterVisibility] = (0, import_react139.useState)(filterMode3);
|
|
22502
|
+
const [sortByValue, setSortByValue] = (0, import_react139.useState)(defaultSortByValue);
|
|
22503
|
+
const handleSearchTerm = (0, import_react139.useCallback)(
|
|
22504
|
+
(term) => {
|
|
22505
|
+
setSearchTerm(term);
|
|
22506
|
+
onSearchChange == null ? void 0 : onSearchChange(term);
|
|
22507
|
+
},
|
|
22508
|
+
[setSearchTerm, onSearchChange]
|
|
22509
|
+
);
|
|
22510
|
+
const handleOnSortChange = (0, import_react139.useCallback)(
|
|
22511
|
+
(sort) => {
|
|
22512
|
+
setSortByValue(sort);
|
|
22513
|
+
onSortChange(sort);
|
|
22514
|
+
},
|
|
22515
|
+
[onSortChange]
|
|
22516
|
+
);
|
|
22517
|
+
const handleToggleFilterVisibilty = (0, import_react139.useCallback)(
|
|
22518
|
+
(mode) => setFilterVisibility(mode),
|
|
22519
|
+
[setFilterVisibility]
|
|
22520
|
+
);
|
|
22521
|
+
const handleAddFilter = (0, import_react139.useCallback)(() => {
|
|
22522
|
+
onChange([...filters, { field: "", operator: "", value: "" }]);
|
|
22523
|
+
}, [filters, onChange]);
|
|
22524
|
+
const handleResetFilters = (0, import_react139.useCallback)(() => {
|
|
22525
|
+
onChange([]);
|
|
22526
|
+
}, [onChange]);
|
|
22527
|
+
const handleDeleteFilter = (0, import_react139.useCallback)(
|
|
22528
|
+
(index) => {
|
|
22529
|
+
const remainingFilters = filters.filter((_, i) => i !== index);
|
|
22530
|
+
onChange(remainingFilters);
|
|
22531
|
+
},
|
|
22532
|
+
[filters, onChange]
|
|
22533
|
+
);
|
|
22534
|
+
const validFilterQuery = (0, import_react139.useMemo)(() => {
|
|
22535
|
+
const hasValidFilters = filters.every((f) => f.field && f.operator && f.value);
|
|
22536
|
+
if (hasValidFilters) {
|
|
22537
|
+
return filters;
|
|
22538
|
+
}
|
|
22539
|
+
}, [filters]);
|
|
22540
|
+
(0, import_react139.useEffect)(() => {
|
|
22541
|
+
if (filterVisibility) {
|
|
22542
|
+
const handleEscKeyFilterClose = (e) => {
|
|
22543
|
+
if (e.key === "Escape") {
|
|
22544
|
+
setFilterVisibility(void 0);
|
|
22545
|
+
}
|
|
22546
|
+
};
|
|
22547
|
+
document.addEventListener("keydown", (e) => handleEscKeyFilterClose(e));
|
|
22548
|
+
return () => {
|
|
22549
|
+
document.removeEventListener("keydown", (e) => handleEscKeyFilterClose(e));
|
|
22550
|
+
};
|
|
22551
|
+
}
|
|
22552
|
+
}, [filterVisibility]);
|
|
22553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
22554
|
+
SearchAndFilterContext.Provider,
|
|
22555
|
+
{
|
|
22556
|
+
value: {
|
|
22557
|
+
searchTerm: deferredSearchTerm,
|
|
22558
|
+
setSearchTerm: (e) => handleSearchTerm(e),
|
|
22559
|
+
setSortBy: (e) => handleOnSortChange(e),
|
|
22560
|
+
sortByValue,
|
|
22561
|
+
filterVisibility,
|
|
22562
|
+
setFilterVisibility: (e) => handleToggleFilterVisibilty(e),
|
|
22563
|
+
filters,
|
|
22564
|
+
setFilters: (e) => onChange(e),
|
|
22565
|
+
handleAddFilter,
|
|
22566
|
+
handleResetFilters,
|
|
22567
|
+
handleDeleteFilter,
|
|
22568
|
+
filterOptions,
|
|
22569
|
+
sortOptions,
|
|
22570
|
+
validFilterQuery,
|
|
22571
|
+
totalResults
|
|
22572
|
+
},
|
|
22573
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(VerticalRhythm, { children })
|
|
22574
|
+
}
|
|
22575
|
+
);
|
|
22576
|
+
};
|
|
22577
|
+
var useSearchAndFilter = () => {
|
|
22578
|
+
const value = (0, import_react139.useContext)(SearchAndFilterContext);
|
|
22579
|
+
return { ...value };
|
|
22580
|
+
};
|
|
22581
|
+
|
|
22582
|
+
// src/components/SearchAndFilter/FilterControls.tsx
|
|
22583
|
+
var import_jsx_runtime119 = require("@emotion/react/jsx-runtime");
|
|
22584
|
+
var FilterControls = ({
|
|
22585
|
+
children,
|
|
22586
|
+
defaultSortByValue,
|
|
22587
|
+
hideSearchInput
|
|
22588
|
+
}) => {
|
|
22589
|
+
var _a, _b, _c;
|
|
22590
|
+
const {
|
|
22591
|
+
setFilterVisibility,
|
|
22592
|
+
filterVisibility,
|
|
22593
|
+
setSearchTerm,
|
|
22594
|
+
validFilterQuery,
|
|
22595
|
+
searchTerm,
|
|
22596
|
+
sortByValue,
|
|
22597
|
+
filterOptions
|
|
22598
|
+
} = useSearchAndFilter();
|
|
22599
|
+
const [initialSortValue, setInitialSortValue] = (0, import_react140.useState)(sortByValue);
|
|
22600
|
+
const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react140.useState)("");
|
|
22601
|
+
const [userHasChangedSortByValue, setUserHasChangedSortByValue] = (0, import_react140.useState)(false);
|
|
22602
|
+
(0, import_react_use3.useDebounce)(
|
|
22603
|
+
() => {
|
|
22604
|
+
setSearchTerm(localeSearchTerm);
|
|
22605
|
+
},
|
|
22606
|
+
300,
|
|
22607
|
+
[localeSearchTerm, searchTerm]
|
|
22608
|
+
);
|
|
22609
|
+
(0, import_react140.useEffect)(() => {
|
|
22610
|
+
if (searchTerm === "") {
|
|
22611
|
+
setLocaleSearchTerm("");
|
|
22612
|
+
}
|
|
22613
|
+
}, [searchTerm]);
|
|
22614
|
+
const handleFilterToggle = (mode) => {
|
|
22615
|
+
if (filterVisibility === "filters" && mode === "filters" || filterVisibility === "sort" && mode === "sort") {
|
|
22616
|
+
return setFilterVisibility(void 0);
|
|
22617
|
+
}
|
|
22618
|
+
return setFilterVisibility(mode);
|
|
22619
|
+
};
|
|
22620
|
+
const sortValue = (sortByValue != null ? sortByValue : defaultSortByValue).split("_");
|
|
22621
|
+
const sortDirection = sortValue == null ? void 0 : sortValue.pop();
|
|
22622
|
+
const sortField = sortValue == null ? void 0 : sortValue.join("_");
|
|
22623
|
+
const sortOn = sortField.startsWith("fields.") ? "contentTypeFields" : "metadata";
|
|
22624
|
+
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;
|
|
22625
|
+
const sortByIcon = userHasChangedSortByValue ? sortDirection === "ASC" ? "arrow-up" : "arrow-down" : "sort-az";
|
|
22626
|
+
(0, import_react_use3.useEffectOnce)(() => {
|
|
22627
|
+
setInitialSortValue(sortByValue);
|
|
22628
|
+
});
|
|
22629
|
+
(0, import_react140.useEffect)(() => {
|
|
22630
|
+
if (initialSortValue !== sortByValue) {
|
|
22631
|
+
setUserHasChangedSortByValue(true);
|
|
22632
|
+
}
|
|
22633
|
+
}, [initialSortValue, sortByValue]);
|
|
22634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_jsx_runtime119.Fragment, { children: [
|
|
22635
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
22636
|
+
FilterButton2,
|
|
22637
|
+
{
|
|
22638
|
+
"aria-controls": "search-and-filter-options",
|
|
22639
|
+
"aria-label": "filter options",
|
|
22640
|
+
"aria-haspopup": "true",
|
|
22641
|
+
"aria-expanded": filterVisibility === "filters",
|
|
22642
|
+
filterCount: validFilterQuery == null ? void 0 : validFilterQuery.length,
|
|
22643
|
+
onClick: () => handleFilterToggle("filters")
|
|
22644
|
+
}
|
|
22645
|
+
),
|
|
22646
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
22647
|
+
FilterButton2,
|
|
22648
|
+
{
|
|
22649
|
+
"aria-controls": "search-and-filter-sortBy",
|
|
22650
|
+
"aria-label": "sort by options",
|
|
22651
|
+
"aria-haspopup": "true",
|
|
22652
|
+
text: !userHasChangedSortByValue ? "Sort" : sortByValueLabel,
|
|
22653
|
+
icon: sortByIcon,
|
|
22654
|
+
"aria-expanded": filterVisibility === "sort",
|
|
22655
|
+
hasSelectedValue: sortByValue !== "",
|
|
22656
|
+
onClick: () => handleFilterToggle("sort"),
|
|
22657
|
+
"data-testid": "sort-by-dropdown"
|
|
22658
|
+
}
|
|
22659
|
+
),
|
|
22660
|
+
hideSearchInput ? null : /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
22661
|
+
InputKeywordSearch,
|
|
22662
|
+
{
|
|
22663
|
+
placeholder: "Search...",
|
|
22664
|
+
onSearchTextChanged: (e) => setLocaleSearchTerm(e),
|
|
22665
|
+
value: localeSearchTerm,
|
|
22666
|
+
compact: true,
|
|
22667
|
+
rounded: true
|
|
22668
|
+
}
|
|
22669
|
+
),
|
|
22670
|
+
children
|
|
22671
|
+
] });
|
|
22672
|
+
};
|
|
22673
|
+
|
|
22674
|
+
// src/components/SearchAndFilter/FilterItem.tsx
|
|
22675
|
+
init_emotion_jsx_shim();
|
|
22676
|
+
var import_react144 = require("react");
|
|
22677
|
+
|
|
22678
|
+
// src/components/SearchAndFilter/FilterEditor.tsx
|
|
22679
|
+
init_emotion_jsx_shim();
|
|
22680
|
+
var import_react142 = require("react");
|
|
22681
|
+
var import_react_use4 = require("react-use");
|
|
22682
|
+
|
|
22683
|
+
// src/components/Validation/StatusBullet.tsx
|
|
22684
|
+
init_emotion_jsx_shim();
|
|
22685
|
+
|
|
22686
|
+
// src/components/Validation/StatusBullet.styles.ts
|
|
22687
|
+
init_emotion_jsx_shim();
|
|
22688
|
+
var import_react141 = require("@emotion/react");
|
|
22689
|
+
var StatusBulletContainer = import_react141.css`
|
|
22690
|
+
align-items: center;
|
|
22691
|
+
align-self: center;
|
|
22692
|
+
color: var(--gray-500);
|
|
22693
|
+
display: inline-flex;
|
|
22694
|
+
font-weight: var(--fw-regular);
|
|
22695
|
+
gap: var(--spacing-xs);
|
|
22696
|
+
line-height: 1;
|
|
22697
|
+
position: relative;
|
|
22698
|
+
text-transform: lowercase;
|
|
22699
|
+
|
|
22700
|
+
&:before {
|
|
22701
|
+
border-radius: var(--rounded-full);
|
|
22702
|
+
content: '';
|
|
22703
|
+
display: block;
|
|
22704
|
+
}
|
|
22705
|
+
`;
|
|
22706
|
+
var StatusBulletBase = import_react141.css`
|
|
22707
|
+
font-size: var(--fs-sm);
|
|
22708
|
+
&:before {
|
|
22709
|
+
width: var(--fs-xs);
|
|
22710
|
+
height: var(--fs-xs);
|
|
22711
|
+
}
|
|
22712
|
+
`;
|
|
22713
|
+
var StatusBulletSmall = import_react141.css`
|
|
22714
|
+
font-size: var(--fs-xs);
|
|
22715
|
+
&:before {
|
|
22716
|
+
width: var(--fs-xxs);
|
|
22717
|
+
height: var(--fs-xxs);
|
|
22718
|
+
}
|
|
22719
|
+
`;
|
|
22720
|
+
var StatusDraft = import_react141.css`
|
|
22721
|
+
&:before {
|
|
22722
|
+
background: var(--white);
|
|
22723
|
+
box-shadow: inset 0 0 0 0.125rem var(--primary-action-default);
|
|
22724
|
+
}
|
|
22725
|
+
`;
|
|
22726
|
+
var StatusModified = import_react141.css`
|
|
22727
|
+
&:before {
|
|
22728
|
+
background: linear-gradient(to right, var(--white) 50%, var(--primary-action-default) 50% 100%);
|
|
22729
|
+
box-shadow: inset 0 0 0 0.125rem var(--primary-action-default);
|
|
22730
|
+
}
|
|
22731
|
+
`;
|
|
22732
|
+
var StatusError = import_react141.css`
|
|
22733
|
+
color: var(--error);
|
|
22734
|
+
&:before {
|
|
22735
|
+
/* TODO: replace this with an svg icon */
|
|
22736
|
+
background: linear-gradient(
|
|
22737
|
+
133deg,
|
|
22738
|
+
var(--error) 41%,
|
|
22739
|
+
var(--white) 42%,
|
|
22740
|
+
var(--white) 58%,
|
|
22741
|
+
var(--error) 59%
|
|
22742
|
+
);
|
|
22743
|
+
}
|
|
22744
|
+
`;
|
|
22745
|
+
var StatusPublished = import_react141.css`
|
|
22746
|
+
&:before {
|
|
22747
|
+
background: var(--primary-action-default);
|
|
22748
|
+
}
|
|
22749
|
+
`;
|
|
22750
|
+
var StatusOrphan = import_react141.css`
|
|
22751
|
+
&:before {
|
|
22752
|
+
background: var(--brand-secondary-5);
|
|
22753
|
+
}
|
|
22754
|
+
`;
|
|
22755
|
+
var StatusUnknown = import_react141.css`
|
|
22756
|
+
&:before {
|
|
22757
|
+
background: var(--gray-800);
|
|
22758
|
+
}
|
|
22759
|
+
`;
|
|
22760
|
+
var StatusDeleted = import_react141.css`
|
|
22761
|
+
&:before {
|
|
22762
|
+
background: var(--error);
|
|
22763
|
+
}
|
|
22764
|
+
`;
|
|
22765
|
+
|
|
22766
|
+
// src/components/Validation/StatusBullet.tsx
|
|
22767
|
+
var import_jsx_runtime120 = require("@emotion/react/jsx-runtime");
|
|
22768
|
+
var StatusBullet = ({
|
|
22769
|
+
status,
|
|
22770
|
+
hideText = false,
|
|
22771
|
+
size = "base",
|
|
22772
|
+
message,
|
|
22773
|
+
...props
|
|
22774
|
+
}) => {
|
|
22775
|
+
const currentStateStyles = {
|
|
22776
|
+
Error: StatusError,
|
|
22777
|
+
Modified: StatusModified,
|
|
22778
|
+
Unsaved: StatusDraft,
|
|
22779
|
+
Orphan: StatusOrphan,
|
|
22780
|
+
Published: StatusPublished,
|
|
22781
|
+
Draft: StatusDraft,
|
|
22782
|
+
Previous: StatusDraft,
|
|
22783
|
+
Unknown: StatusUnknown,
|
|
22784
|
+
Deleted: StatusDeleted
|
|
22785
|
+
};
|
|
22786
|
+
const statusSize = size === "base" ? StatusBulletBase : StatusBulletSmall;
|
|
22787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
22788
|
+
"span",
|
|
22789
|
+
{
|
|
22790
|
+
role: "status",
|
|
22791
|
+
css: [StatusBulletContainer, currentStateStyles[status], statusSize],
|
|
22792
|
+
title: message != null ? message : status,
|
|
22793
|
+
...props,
|
|
22794
|
+
children: hideText ? null : message ? message : status
|
|
22795
|
+
}
|
|
22796
|
+
);
|
|
22797
|
+
};
|
|
22798
|
+
|
|
22799
|
+
// src/components/SearchAndFilter/FilterEditor.tsx
|
|
22800
|
+
var import_jsx_runtime121 = require("@emotion/react/jsx-runtime");
|
|
22801
|
+
var readOnlyAttributes = {
|
|
22802
|
+
isSearchable: false,
|
|
22803
|
+
menuIsOpen: false,
|
|
22804
|
+
isClearable: false
|
|
22805
|
+
};
|
|
22806
|
+
var FilterMultiChoiceEditor = ({
|
|
22807
|
+
value,
|
|
22808
|
+
options,
|
|
22809
|
+
isDisabled,
|
|
22810
|
+
readOnly,
|
|
22811
|
+
valueTestId,
|
|
22812
|
+
...props
|
|
22813
|
+
}) => {
|
|
22814
|
+
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
22815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
22816
|
+
InputComboBox,
|
|
22817
|
+
{
|
|
22818
|
+
...props,
|
|
22819
|
+
placeholder: "Type to search...",
|
|
22820
|
+
options,
|
|
22821
|
+
isMulti: true,
|
|
22822
|
+
isClearable: true,
|
|
22823
|
+
isDisabled,
|
|
22824
|
+
onChange: (e) => {
|
|
22825
|
+
var _a;
|
|
22826
|
+
return props.onChange((_a = e.map((item) => item.value)) != null ? _a : []);
|
|
22827
|
+
},
|
|
22828
|
+
value,
|
|
22829
|
+
"aria-readonly": readOnly,
|
|
22830
|
+
styles: {
|
|
22831
|
+
menu(base) {
|
|
22832
|
+
return {
|
|
22833
|
+
...base,
|
|
22834
|
+
minWidth: "max-content"
|
|
22835
|
+
};
|
|
22836
|
+
}
|
|
22837
|
+
},
|
|
22838
|
+
...readOnlyProps
|
|
22839
|
+
}
|
|
22840
|
+
) });
|
|
22841
|
+
};
|
|
22842
|
+
var FilterSingleChoiceEditor = ({
|
|
22843
|
+
options,
|
|
22844
|
+
value,
|
|
22845
|
+
isDisabled,
|
|
22846
|
+
readOnly,
|
|
22847
|
+
onChange,
|
|
22848
|
+
valueTestId
|
|
22849
|
+
}) => {
|
|
22850
|
+
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
22851
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
22852
|
+
InputComboBox,
|
|
22853
|
+
{
|
|
22854
|
+
placeholder: "Type to search...",
|
|
22855
|
+
options,
|
|
22856
|
+
isClearable: true,
|
|
22857
|
+
onChange: (e) => {
|
|
22858
|
+
var _a;
|
|
22859
|
+
return onChange((_a = e == null ? void 0 : e.value) != null ? _a : "");
|
|
22860
|
+
},
|
|
22861
|
+
isDisabled,
|
|
22862
|
+
value,
|
|
22863
|
+
"aria-readonly": readOnly,
|
|
22864
|
+
styles: {
|
|
22865
|
+
menu(base) {
|
|
22866
|
+
return {
|
|
22867
|
+
...base,
|
|
22868
|
+
minWidth: "max-content"
|
|
22869
|
+
};
|
|
22870
|
+
}
|
|
22871
|
+
},
|
|
22872
|
+
...readOnlyProps
|
|
22873
|
+
}
|
|
22874
|
+
) });
|
|
22875
|
+
};
|
|
22876
|
+
var CustomOptions = ({ label, value }) => {
|
|
22877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(StatusBullet, { status: label, message: value });
|
|
22878
|
+
};
|
|
22879
|
+
var StatusMultiEditor = ({
|
|
22880
|
+
options,
|
|
22881
|
+
value,
|
|
22882
|
+
isDisabled,
|
|
22883
|
+
readOnly,
|
|
22884
|
+
onChange,
|
|
22885
|
+
valueTestId
|
|
22886
|
+
}) => {
|
|
22887
|
+
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
22888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
22889
|
+
InputComboBox,
|
|
22890
|
+
{
|
|
22891
|
+
options,
|
|
22892
|
+
isMulti: true,
|
|
22893
|
+
onChange: (e) => {
|
|
22894
|
+
var _a;
|
|
22895
|
+
return onChange((_a = e.map((item) => item.value)) != null ? _a : []);
|
|
22896
|
+
},
|
|
22897
|
+
formatOptionLabel: CustomOptions,
|
|
22898
|
+
value,
|
|
22899
|
+
isDisabled,
|
|
22900
|
+
styles: {
|
|
22901
|
+
menu(base) {
|
|
22902
|
+
return {
|
|
22903
|
+
...base,
|
|
22904
|
+
minWidth: "max-content"
|
|
22905
|
+
};
|
|
22906
|
+
}
|
|
22907
|
+
},
|
|
22908
|
+
...readOnlyProps
|
|
22909
|
+
}
|
|
22910
|
+
) });
|
|
22911
|
+
};
|
|
22912
|
+
var StatusSingleEditor = ({
|
|
22913
|
+
options,
|
|
22914
|
+
value,
|
|
22915
|
+
isDisabled,
|
|
22916
|
+
readOnly,
|
|
22917
|
+
onChange,
|
|
22918
|
+
valueTestId
|
|
22919
|
+
}) => {
|
|
22920
|
+
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
22921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("div", { "data-testid": valueTestId, children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
22922
|
+
InputComboBox,
|
|
22923
|
+
{
|
|
22924
|
+
options,
|
|
22925
|
+
onChange: (e) => {
|
|
22926
|
+
var _a;
|
|
22927
|
+
return onChange((_a = e == null ? void 0 : e.value) != null ? _a : "");
|
|
22928
|
+
},
|
|
22929
|
+
formatOptionLabel: CustomOptions,
|
|
22930
|
+
value,
|
|
22931
|
+
isDisabled,
|
|
22932
|
+
styles: {
|
|
22933
|
+
menu(base) {
|
|
22934
|
+
return {
|
|
22935
|
+
...base,
|
|
22936
|
+
minWidth: "max-content"
|
|
22937
|
+
};
|
|
22938
|
+
}
|
|
22939
|
+
},
|
|
22940
|
+
...readOnlyProps
|
|
22941
|
+
}
|
|
22942
|
+
) });
|
|
22943
|
+
};
|
|
22944
|
+
var TextEditor = ({ onChange, ariaLabel, value, readOnly, valueTestId }) => {
|
|
22945
|
+
(0, import_react_use4.useDebounce)(() => onChange, 500, [value]);
|
|
22946
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
22947
|
+
Input,
|
|
22948
|
+
{
|
|
22949
|
+
showLabel: false,
|
|
22950
|
+
label: ariaLabel,
|
|
22951
|
+
onChange: (e) => onChange(e.currentTarget.value),
|
|
22952
|
+
placeholder: "Enter phrase to search\u2026",
|
|
22953
|
+
value,
|
|
22954
|
+
readOnly,
|
|
22955
|
+
"data-testid": valueTestId
|
|
22956
|
+
}
|
|
22957
|
+
);
|
|
22958
|
+
};
|
|
22959
|
+
var NumberRangeEditor = ({
|
|
22960
|
+
onChange,
|
|
22961
|
+
disabled: disabled2,
|
|
22962
|
+
ariaLabel,
|
|
22963
|
+
value,
|
|
22964
|
+
readOnly,
|
|
22965
|
+
valueTestId
|
|
22966
|
+
}) => {
|
|
22967
|
+
const [minValue, setMinValue] = (0, import_react142.useState)("");
|
|
22968
|
+
const [maxValue, setMaxValue] = (0, import_react142.useState)("");
|
|
22969
|
+
const [error, setError] = (0, import_react142.useState)("");
|
|
22970
|
+
(0, import_react142.useEffect)(() => {
|
|
22971
|
+
if (!maxValue && !minValue) {
|
|
22972
|
+
return;
|
|
22973
|
+
}
|
|
22974
|
+
const max = Number(maxValue);
|
|
22975
|
+
const min = Number(minValue);
|
|
22976
|
+
if (max < min || min > max) {
|
|
22977
|
+
setError("Please enter a valid numeric range");
|
|
22978
|
+
onChange([]);
|
|
22979
|
+
return;
|
|
22980
|
+
}
|
|
22981
|
+
if (maxValue && !minValue || minValue && !maxValue) {
|
|
22982
|
+
setError("Please enter both a low and high number");
|
|
22983
|
+
onChange([]);
|
|
22984
|
+
return;
|
|
22985
|
+
}
|
|
22986
|
+
setError("");
|
|
22987
|
+
onChange([minValue, maxValue]);
|
|
22988
|
+
}, [maxValue, minValue, setError]);
|
|
22989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(import_jsx_runtime121.Fragment, { children: [
|
|
22990
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
22991
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
22992
|
+
Input,
|
|
22993
|
+
{
|
|
22994
|
+
label: `${ariaLabel}-min`,
|
|
22995
|
+
type: "number",
|
|
22996
|
+
showLabel: false,
|
|
22997
|
+
min: 0,
|
|
22998
|
+
placeholder: "Low",
|
|
22999
|
+
onChange: (e) => setMinValue(e.currentTarget.value),
|
|
23000
|
+
"aria-invalid": !error ? false : true,
|
|
23001
|
+
disabled: disabled2,
|
|
23002
|
+
value: value ? value[0] : "",
|
|
23003
|
+
readOnly
|
|
23004
|
+
}
|
|
23005
|
+
),
|
|
23006
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
23007
|
+
Input,
|
|
23008
|
+
{
|
|
23009
|
+
type: "number",
|
|
23010
|
+
label: `${ariaLabel}-max`,
|
|
23011
|
+
showLabel: false,
|
|
23012
|
+
min: 0,
|
|
23013
|
+
placeholder: "High",
|
|
23014
|
+
onChange: (e) => setMaxValue(e.currentTarget.value),
|
|
23015
|
+
"aria-invalid": !error ? false : true,
|
|
23016
|
+
disabled: disabled2,
|
|
23017
|
+
value: value ? value[1] : "",
|
|
23018
|
+
readOnly
|
|
23019
|
+
}
|
|
23020
|
+
)
|
|
23021
|
+
] }),
|
|
23022
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(ErrorContainer, { errorMessage: error })
|
|
23023
|
+
] });
|
|
23024
|
+
};
|
|
23025
|
+
var NumberEditor = ({
|
|
23026
|
+
ariaLabel,
|
|
23027
|
+
onChange,
|
|
23028
|
+
disabled: disabled2,
|
|
23029
|
+
value,
|
|
23030
|
+
readOnly,
|
|
23031
|
+
valueTestId
|
|
23032
|
+
}) => {
|
|
23033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
23034
|
+
Input,
|
|
23035
|
+
{
|
|
23036
|
+
label: ariaLabel,
|
|
23037
|
+
type: "number",
|
|
23038
|
+
showLabel: false,
|
|
23039
|
+
min: 0,
|
|
23040
|
+
onChange: (e) => onChange(e.currentTarget.value),
|
|
23041
|
+
disabled: disabled2,
|
|
23042
|
+
value,
|
|
23043
|
+
readOnly,
|
|
23044
|
+
"data-testid": valueTestId
|
|
23045
|
+
}
|
|
23046
|
+
);
|
|
23047
|
+
};
|
|
23048
|
+
var DateEditor = ({
|
|
23049
|
+
onChange,
|
|
23050
|
+
ariaLabel,
|
|
23051
|
+
disabled: disabled2,
|
|
23052
|
+
value,
|
|
23053
|
+
readOnly,
|
|
23054
|
+
valueTestId
|
|
23055
|
+
}) => {
|
|
23056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
23057
|
+
Input,
|
|
23058
|
+
{
|
|
23059
|
+
type: "date",
|
|
23060
|
+
label: ariaLabel,
|
|
23061
|
+
showLabel: false,
|
|
23062
|
+
onChange: (e) => onChange(e.currentTarget.value),
|
|
23063
|
+
disabled: disabled2,
|
|
23064
|
+
value,
|
|
23065
|
+
readOnly,
|
|
23066
|
+
"data-testid": valueTestId
|
|
23067
|
+
}
|
|
23068
|
+
);
|
|
23069
|
+
};
|
|
23070
|
+
var DateRangeEditor = ({
|
|
23071
|
+
ariaLabel,
|
|
23072
|
+
onChange,
|
|
23073
|
+
disabled: disabled2,
|
|
23074
|
+
value,
|
|
23075
|
+
readOnly,
|
|
23076
|
+
valueTestId
|
|
23077
|
+
}) => {
|
|
23078
|
+
const [minDateValue, setMinDateValue] = (0, import_react142.useState)(value ? value[0] : "");
|
|
23079
|
+
const [maxDateValue, setMaxDateValue] = (0, import_react142.useState)(value ? value[1] : "");
|
|
23080
|
+
const [error, setError] = (0, import_react142.useState)("");
|
|
23081
|
+
(0, import_react142.useEffect)(() => {
|
|
23082
|
+
if (!minDateValue || !maxDateValue) {
|
|
23083
|
+
return;
|
|
23084
|
+
}
|
|
23085
|
+
const minDate = new Date(minDateValue);
|
|
23086
|
+
const maxDate = new Date(maxDateValue);
|
|
23087
|
+
if (maxDate < minDate) {
|
|
23088
|
+
setError("The max date cannot be lower than the min date");
|
|
23089
|
+
onChange([]);
|
|
23090
|
+
return;
|
|
23091
|
+
}
|
|
23092
|
+
if (maxDate && !minDate) {
|
|
23093
|
+
setError("Please enter both a low and high date");
|
|
23094
|
+
onChange([]);
|
|
23095
|
+
return;
|
|
23096
|
+
}
|
|
23097
|
+
const minDateString = minDate.toDateString();
|
|
23098
|
+
const maxDateString = maxDate.toDateString();
|
|
23099
|
+
if (minDateString === maxDateString || maxDateString === minDateString) {
|
|
23100
|
+
setError("The min and max date cannot be the same");
|
|
23101
|
+
onChange([]);
|
|
23102
|
+
return;
|
|
23103
|
+
}
|
|
23104
|
+
if (minDate > maxDate) {
|
|
23105
|
+
setError("The min date cannot be higher than the max date");
|
|
23106
|
+
onChange([]);
|
|
23107
|
+
return;
|
|
23108
|
+
}
|
|
23109
|
+
setError("");
|
|
23110
|
+
onChange([minDateValue, maxDateValue]);
|
|
23111
|
+
}, [minDateValue, maxDateValue, setError]);
|
|
23112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(import_jsx_runtime121.Fragment, { children: [
|
|
23113
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { css: twoColumnGrid, "data-testid": valueTestId, children: [
|
|
23114
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
23115
|
+
Input,
|
|
23116
|
+
{
|
|
23117
|
+
label: `${ariaLabel}-min-date`,
|
|
23118
|
+
type: "date",
|
|
23119
|
+
showLabel: false,
|
|
23120
|
+
value: minDateValue,
|
|
23121
|
+
onChange: (e) => setMinDateValue(e.currentTarget.value),
|
|
23122
|
+
"aria-invalid": !error ? false : true,
|
|
23123
|
+
disabled: disabled2,
|
|
23124
|
+
readOnly
|
|
23125
|
+
}
|
|
23126
|
+
),
|
|
23127
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
23128
|
+
Input,
|
|
23129
|
+
{
|
|
23130
|
+
label: `${ariaLabel}-max-date`,
|
|
23131
|
+
type: "date",
|
|
23132
|
+
showLabel: false,
|
|
23133
|
+
value: maxDateValue,
|
|
23134
|
+
onChange: (e) => setMaxDateValue(e.currentTarget.value),
|
|
23135
|
+
"aria-invalid": !error ? false : true,
|
|
23136
|
+
disabled: disabled2,
|
|
23137
|
+
readOnly
|
|
23138
|
+
}
|
|
23139
|
+
)
|
|
23140
|
+
] }),
|
|
23141
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(ErrorContainer, { errorMessage: error })
|
|
23142
|
+
] });
|
|
23143
|
+
};
|
|
23144
|
+
var FilterEditorRenderer = ({ editorType, ...props }) => {
|
|
23145
|
+
const Editor = filterMapper[editorType];
|
|
23146
|
+
if (!Editor) {
|
|
23147
|
+
return null;
|
|
23148
|
+
}
|
|
23149
|
+
if (editorType === "empty") {
|
|
23150
|
+
return null;
|
|
23151
|
+
}
|
|
23152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Editor, { ...props, disabled: props.isDisabled });
|
|
23153
|
+
};
|
|
23154
|
+
var filterMapper = {
|
|
23155
|
+
multiChoice: FilterMultiChoiceEditor,
|
|
23156
|
+
singleChoice: FilterSingleChoiceEditor,
|
|
23157
|
+
date: DateEditor,
|
|
23158
|
+
dateRange: DateRangeEditor,
|
|
23159
|
+
text: TextEditor,
|
|
23160
|
+
numberRange: NumberRangeEditor,
|
|
23161
|
+
number: NumberEditor,
|
|
23162
|
+
statusMultiChoice: StatusMultiEditor,
|
|
23163
|
+
statusSingleChoice: StatusSingleEditor,
|
|
23164
|
+
empty: null
|
|
23165
|
+
};
|
|
23166
|
+
var ErrorContainer = ({ errorMessage }) => {
|
|
23167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
23168
|
+
"div",
|
|
23169
|
+
{
|
|
23170
|
+
css: {
|
|
23171
|
+
gridColumn: "span 6",
|
|
23172
|
+
order: 6
|
|
23173
|
+
},
|
|
23174
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(FieldMessage, { errorMessage })
|
|
23175
|
+
}
|
|
23176
|
+
);
|
|
23177
|
+
};
|
|
23178
|
+
var twoColumnGrid = {
|
|
23179
|
+
display: "grid",
|
|
23180
|
+
gridTemplateColumns: "1fr 1fr",
|
|
23181
|
+
gap: "var(--spacing-sm);"
|
|
23182
|
+
};
|
|
23183
|
+
|
|
23184
|
+
// src/components/SearchAndFilter/FilterMenu.tsx
|
|
23185
|
+
init_emotion_jsx_shim();
|
|
23186
|
+
var import_react143 = __toESM(require("react"));
|
|
23187
|
+
var import_jsx_runtime122 = require("@emotion/react/jsx-runtime");
|
|
23188
|
+
var SearchAndFilterOptionsContainer2 = ({
|
|
23189
|
+
buttonRow,
|
|
23190
|
+
children
|
|
23191
|
+
}) => {
|
|
23192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { css: SearchAndFilterOptionsContainer, "data-testid": "search-and-filter-options", children: [
|
|
23193
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { css: SearchAndFilterOptionsInnerContainer, children }),
|
|
23194
|
+
buttonRow ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
23195
|
+
HorizontalRhythm,
|
|
23196
|
+
{
|
|
23197
|
+
css: SearchAndFilterButtonGroup,
|
|
23198
|
+
gap: "sm",
|
|
23199
|
+
align: "center",
|
|
23200
|
+
justify: "space-between",
|
|
23201
|
+
children: buttonRow
|
|
23202
|
+
}
|
|
23203
|
+
) : null
|
|
23204
|
+
] });
|
|
23205
|
+
};
|
|
23206
|
+
var FilterMenu = ({ id, filterTitle = "Show results", menuControls, children }) => {
|
|
23207
|
+
const { filterVisibility, setFilterVisibility } = useSearchAndFilter();
|
|
23208
|
+
const innerMenuRef = import_react143.default.useRef(null);
|
|
23209
|
+
(0, import_react143.useEffect)(() => {
|
|
23210
|
+
var _a;
|
|
23211
|
+
if (filterVisibility) {
|
|
23212
|
+
(_a = innerMenuRef.current) == null ? void 0 : _a.focus();
|
|
23213
|
+
}
|
|
23214
|
+
}, [filterVisibility]);
|
|
23215
|
+
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: [
|
|
23216
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }),
|
|
23217
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
23218
|
+
"button",
|
|
23219
|
+
{
|
|
23220
|
+
type: "button",
|
|
23221
|
+
"aria-label": "close filters",
|
|
23222
|
+
css: [CloseBtn],
|
|
23223
|
+
onClick: () => setFilterVisibility(void 0),
|
|
23224
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Icon, { icon: "close", iconColor: "currentColor", size: "1.1rem" })
|
|
23225
|
+
}
|
|
23226
|
+
),
|
|
23227
|
+
children
|
|
23228
|
+
] }) : null });
|
|
23229
|
+
};
|
|
23230
|
+
|
|
23231
|
+
// src/components/SearchAndFilter/FilterItem.tsx
|
|
23232
|
+
var import_jsx_runtime123 = require("@emotion/react/jsx-runtime");
|
|
23233
|
+
var FilterItem = ({
|
|
23234
|
+
index,
|
|
23235
|
+
paramOptions,
|
|
23236
|
+
operatorOptions,
|
|
23237
|
+
valueOptions,
|
|
23238
|
+
onParamChange,
|
|
23239
|
+
onOperatorChange,
|
|
23240
|
+
onValueChange
|
|
23241
|
+
}) => {
|
|
23242
|
+
var _a, _b;
|
|
23243
|
+
const { filters, handleDeleteFilter, filterOptions } = useSearchAndFilter();
|
|
23244
|
+
const label = filters[index].field !== "" ? filters[index].field : "unknown filter field";
|
|
23245
|
+
const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
|
|
23246
|
+
const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
|
|
23247
|
+
const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
|
|
23248
|
+
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly } = (0, import_react144.useMemo)(() => {
|
|
23249
|
+
var _a2;
|
|
23250
|
+
const currentSelectedFilter = filterOptions.find((item) => {
|
|
23251
|
+
var _a3;
|
|
23252
|
+
return (_a3 = item.options) == null ? void 0 : _a3.find((op) => op.value === filters[index].field);
|
|
23253
|
+
});
|
|
23254
|
+
const selectedFieldValue2 = (_a2 = currentSelectedFilter == null ? void 0 : currentSelectedFilter.options) == null ? void 0 : _a2.find((item) => {
|
|
23255
|
+
return filters[index].field === item.value;
|
|
23256
|
+
});
|
|
23257
|
+
const isCurrentFieldReadOnly = selectedFieldValue2 == null ? void 0 : selectedFieldValue2.readOnly;
|
|
23258
|
+
const selectedOperatorValue2 = operatorOptions == null ? void 0 : operatorOptions.find((item) => {
|
|
23259
|
+
return filters[index].operator === item.value;
|
|
23260
|
+
});
|
|
23261
|
+
const selectedMetaValue2 = valueOptions.filter((item) => {
|
|
23262
|
+
if (Array.isArray(filters[index].value) && item.value) {
|
|
23263
|
+
return filters[index].value.includes(item.value);
|
|
23264
|
+
}
|
|
23265
|
+
return filters[index].value === item.value;
|
|
23266
|
+
});
|
|
23267
|
+
return {
|
|
23268
|
+
selectedFieldValue: selectedFieldValue2,
|
|
23269
|
+
selectedOperatorValue: selectedOperatorValue2 != null ? selectedOperatorValue2 : void 0,
|
|
23270
|
+
selectedMetaValue: selectedMetaValue2.length > 0 ? selectedMetaValue2 : filters[index].value,
|
|
23271
|
+
readOnly: isCurrentFieldReadOnly
|
|
23272
|
+
};
|
|
23273
|
+
}, [filters, filterOptions, index, operatorOptions, valueOptions]);
|
|
23274
|
+
const readOnlyProps = readOnly ? {
|
|
23275
|
+
"aria-readonly": true,
|
|
23276
|
+
isSearchable: false,
|
|
23277
|
+
menuIsOpen: false,
|
|
23278
|
+
isClearable: false
|
|
23279
|
+
} : {};
|
|
23280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
|
|
23281
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { children: index === 0 ? "Where" : "and" }),
|
|
23282
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { css: ConditionalInputRow, children: [
|
|
23283
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
23284
|
+
InputComboBox,
|
|
23285
|
+
{
|
|
23286
|
+
"aria-label": label,
|
|
23287
|
+
options: paramOptions,
|
|
23288
|
+
onChange: (e) => {
|
|
23289
|
+
var _a2;
|
|
23290
|
+
onParamChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
|
|
23291
|
+
},
|
|
23292
|
+
isOptionDisabled: (option) => {
|
|
23293
|
+
var _a2;
|
|
23294
|
+
return (_a2 = option == null ? void 0 : option.disabled) != null ? _a2 : false;
|
|
23295
|
+
},
|
|
23296
|
+
styles: {
|
|
23297
|
+
menu(base) {
|
|
23298
|
+
return {
|
|
23299
|
+
...base,
|
|
23300
|
+
minWidth: "max-content"
|
|
23301
|
+
};
|
|
23302
|
+
}
|
|
23303
|
+
},
|
|
23304
|
+
value: selectedFieldValue,
|
|
23305
|
+
...readOnlyProps,
|
|
23306
|
+
id: "filter-field"
|
|
23307
|
+
}
|
|
23308
|
+
),
|
|
23309
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
23310
|
+
InputComboBox,
|
|
23311
|
+
{
|
|
23312
|
+
"aria-label": operatorLabel,
|
|
23313
|
+
options: operatorOptions,
|
|
23314
|
+
onChange: (e) => {
|
|
23315
|
+
var _a2;
|
|
23316
|
+
return onOperatorChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
|
|
23317
|
+
},
|
|
23318
|
+
isDisabled: !filters[index].field,
|
|
23319
|
+
value: selectedOperatorValue,
|
|
23320
|
+
styles: {
|
|
23321
|
+
menu(base) {
|
|
23322
|
+
return {
|
|
23323
|
+
...base,
|
|
23324
|
+
minWidth: "max-content"
|
|
23325
|
+
};
|
|
23326
|
+
}
|
|
23327
|
+
},
|
|
23328
|
+
...readOnlyProps,
|
|
23329
|
+
id: "filter-operator"
|
|
23330
|
+
}
|
|
23331
|
+
),
|
|
23332
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
23333
|
+
FilterEditorRenderer,
|
|
23334
|
+
{
|
|
23335
|
+
"aria-label": metaDataLabel,
|
|
23336
|
+
editorType: metaDataPossibleOptions,
|
|
23337
|
+
options: valueOptions,
|
|
23338
|
+
onChange: (e) => onValueChange(e != null ? e : ""),
|
|
23339
|
+
readOnly,
|
|
23340
|
+
isDisabled: !filters[index].operator,
|
|
23341
|
+
value: selectedMetaValue,
|
|
23342
|
+
valueTestId: "filter-value"
|
|
23343
|
+
}
|
|
23344
|
+
),
|
|
23345
|
+
readOnly ? null : /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
23346
|
+
"button",
|
|
23347
|
+
{
|
|
23348
|
+
type: "button",
|
|
23349
|
+
onClick: () => handleDeleteFilter(index),
|
|
23350
|
+
"aria-label": "delete filter",
|
|
23351
|
+
css: IconBtn,
|
|
23352
|
+
"data-testid": "delete-filter",
|
|
23353
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Icon, { icon: "trash", iconColor: "red", size: "1rem" })
|
|
23354
|
+
}
|
|
23355
|
+
)
|
|
23356
|
+
] })
|
|
23357
|
+
] });
|
|
23358
|
+
};
|
|
23359
|
+
var FilterItems = ({
|
|
23360
|
+
addButtonText = "add condition",
|
|
23361
|
+
resetButtonText = "reset filters"
|
|
23362
|
+
}) => {
|
|
23363
|
+
const { filterOptions, filters, setFilters, handleAddFilter, handleResetFilters, setFilterVisibility } = useSearchAndFilter();
|
|
23364
|
+
const handleUpdateFilter = (index, prop, value) => {
|
|
23365
|
+
var _a, _b, _c, _d, _e;
|
|
23366
|
+
const next = [...filters];
|
|
23367
|
+
next[index] = { ...next[index], [prop]: value };
|
|
23368
|
+
if (prop === "operator") {
|
|
23369
|
+
next[index].value = "";
|
|
23370
|
+
if (value === "def" || value === "true") {
|
|
23371
|
+
next[index].value = "true";
|
|
23372
|
+
}
|
|
23373
|
+
if (value === "ndef" || value === "false") {
|
|
23374
|
+
next[index].value = "false";
|
|
23375
|
+
}
|
|
23376
|
+
}
|
|
23377
|
+
if (prop === "field") {
|
|
23378
|
+
const firstOperatorInAvailableOperators = (_e = (_d = (_c = (_b = (_a = filterOptions.find((fo) => {
|
|
23379
|
+
var _a2;
|
|
23380
|
+
return (_a2 = fo.options) == null ? void 0 : _a2.find((op) => op.value === value);
|
|
23381
|
+
})) == 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";
|
|
23382
|
+
next[index].operator = firstOperatorInAvailableOperators;
|
|
23383
|
+
next[index].value = "";
|
|
23384
|
+
}
|
|
23385
|
+
setFilters(next);
|
|
23386
|
+
};
|
|
23387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
23388
|
+
FilterMenu,
|
|
23389
|
+
{
|
|
23390
|
+
id: "search-and-filter-options",
|
|
23391
|
+
menuControls: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(import_jsx_runtime123.Fragment, { children: [
|
|
23392
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(
|
|
23393
|
+
"button",
|
|
23394
|
+
{
|
|
23395
|
+
type: "button",
|
|
23396
|
+
css: AddConditionalBtn,
|
|
23397
|
+
onClick: handleAddFilter,
|
|
23398
|
+
"data-testid": "add-filter",
|
|
23399
|
+
children: [
|
|
23400
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Icon, { icon: "math-plus", iconColor: "currentColor", size: "1rem" }),
|
|
23401
|
+
addButtonText
|
|
23402
|
+
]
|
|
23403
|
+
}
|
|
23404
|
+
),
|
|
23405
|
+
(filters == null ? void 0 : filters.length) ? /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
23406
|
+
"button",
|
|
23407
|
+
{
|
|
23408
|
+
type: "button",
|
|
23409
|
+
css: ResetConditionsBtn,
|
|
23410
|
+
onClick: () => {
|
|
23411
|
+
handleResetFilters();
|
|
23412
|
+
setFilterVisibility(void 0);
|
|
23413
|
+
},
|
|
23414
|
+
"data-testid": "reset-filters",
|
|
23415
|
+
children: resetButtonText
|
|
23416
|
+
}
|
|
23417
|
+
) : null
|
|
23418
|
+
] }),
|
|
23419
|
+
children: filters.map((item, i) => {
|
|
23420
|
+
var _a, _b, _c, _d, _e, _f;
|
|
23421
|
+
const availableTypeOptions = (_b = (_a = filterOptions.find((fo) => {
|
|
23422
|
+
var _a2;
|
|
23423
|
+
return (_a2 = fo.options) == null ? void 0 : _a2.find((op) => op.value === item.field);
|
|
23424
|
+
})) == null ? void 0 : _a.options) != null ? _b : [];
|
|
23425
|
+
const possibleValueOptions = (_d = (_c = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _c.valueOptions) != null ? _d : [];
|
|
23426
|
+
const possibleOperators = (_f = (_e = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _e.operatorOptions) != null ? _f : [];
|
|
23427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
23428
|
+
FilterItem,
|
|
23429
|
+
{
|
|
23430
|
+
index: i,
|
|
23431
|
+
paramOptions: filterOptions,
|
|
23432
|
+
onParamChange: (e) => handleUpdateFilter(i, "field", e),
|
|
23433
|
+
operatorOptions: possibleOperators,
|
|
23434
|
+
onOperatorChange: (e) => handleUpdateFilter(i, "operator", e),
|
|
23435
|
+
onValueChange: (e) => handleUpdateFilter(i, "value", e),
|
|
23436
|
+
valueOptions: possibleValueOptions
|
|
23437
|
+
},
|
|
23438
|
+
i
|
|
23439
|
+
);
|
|
23440
|
+
})
|
|
23441
|
+
}
|
|
23442
|
+
);
|
|
23443
|
+
};
|
|
23444
|
+
|
|
23445
|
+
// src/components/SearchAndFilter/SearchAndFilter.tsx
|
|
23446
|
+
init_emotion_jsx_shim();
|
|
23447
|
+
|
|
23448
|
+
// src/components/SearchAndFilter/FilterModeView.tsx
|
|
23449
|
+
init_emotion_jsx_shim();
|
|
23450
|
+
|
|
23451
|
+
// src/components/SearchAndFilter/SortItems.tsx
|
|
23452
|
+
init_emotion_jsx_shim();
|
|
23453
|
+
|
|
23454
|
+
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
23455
|
+
init_emotion_jsx_shim();
|
|
23456
|
+
var import_react146 = require("@emotion/react");
|
|
23457
|
+
var import_CgCheck5 = require("@react-icons/all-files/cg/CgCheck");
|
|
23458
|
+
var import_react147 = require("react");
|
|
23459
|
+
|
|
23460
|
+
// src/components/SegmentedControl/SegmentedControl.styles.ts
|
|
23461
|
+
init_emotion_jsx_shim();
|
|
23462
|
+
var import_react145 = require("@emotion/react");
|
|
23463
|
+
var segmentedControlStyles = import_react145.css`
|
|
23464
|
+
--segmented-control-rounded-value: var(--rounded-base);
|
|
23465
|
+
--segmented-control-border-width: 1px;
|
|
23466
|
+
--segmented-control-selected-color: var(--brand-secondary-3);
|
|
23467
|
+
--segmented-control-first-border-radius: var(--segmented-control-rounded-value) 0 0
|
|
23468
|
+
var(--segmented-control-rounded-value);
|
|
23469
|
+
--segmented-control-last-border-radius: 0 var(--segmented-control-rounded-value)
|
|
23470
|
+
var(--segmented-control-rounded-value) 0;
|
|
23471
|
+
|
|
23472
|
+
position: relative;
|
|
23473
|
+
display: flex;
|
|
23474
|
+
justify-content: flex-start;
|
|
23475
|
+
width: fit-content;
|
|
23476
|
+
background-color: var(--gray-300);
|
|
23477
|
+
padding: var(--segmented-control-border-width);
|
|
23478
|
+
gap: var(--segmented-control-border-width);
|
|
23479
|
+
border-radius: calc(var(--segmented-control-rounded-value) + var(--segmented-control-border-width));
|
|
23480
|
+
font-size: var(--fs-xs);
|
|
23481
|
+
`;
|
|
23482
|
+
var segmentedControlVerticalStyles = import_react145.css`
|
|
23483
|
+
flex-direction: column;
|
|
23484
|
+
--segmented-control-first-border-radius: var(--segmented-control-rounded-value)
|
|
23485
|
+
var(--segmented-control-rounded-value) 0 0;
|
|
23486
|
+
--segmented-control-last-border-radius: 0 0 var(--segmented-control-rounded-value)
|
|
23487
|
+
var(--segmented-control-rounded-value);
|
|
23488
|
+
`;
|
|
23489
|
+
var segmentedControlItemStyles = import_react145.css`
|
|
23490
|
+
&:first-of-type label {
|
|
23491
|
+
border-radius: var(--segmented-control-first-border-radius);
|
|
23492
|
+
}
|
|
23493
|
+
&:last-of-type label {
|
|
23494
|
+
border-radius: var(--segmented-control-last-border-radius);
|
|
23495
|
+
}
|
|
23496
|
+
`;
|
|
23497
|
+
var segmentedControlInputStyles = import_react145.css`
|
|
23498
|
+
${accessibleHidden}
|
|
23499
|
+
`;
|
|
23500
|
+
var segmentedControlLabelStyles = (checked, disabled2) => import_react145.css`
|
|
23501
|
+
position: relative;
|
|
23502
|
+
display: flex;
|
|
23503
|
+
align-items: center;
|
|
23504
|
+
justify-content: center;
|
|
23505
|
+
height: 2rem;
|
|
23506
|
+
padding-inline: var(--spacing-base);
|
|
23507
|
+
background-color: white;
|
|
23508
|
+
transition-property: background-color, color, box-shadow;
|
|
23509
|
+
transition-duration: var(--duration-xfast);
|
|
23510
|
+
transition-timing-function: ease-in-out;
|
|
23511
|
+
z-index: 1;
|
|
23512
|
+
cursor: pointer;
|
|
23513
|
+
|
|
23514
|
+
&:has(:checked:not(:disabled)) {
|
|
23515
|
+
background-color: var(--segmented-control-selected-color);
|
|
23516
|
+
outline: var(--segmented-control-border-width) solid var(--segmented-control-selected-color);
|
|
23517
|
+
box-shadow: 0 0.43em 1.7em 0 rgba(0, 0, 0, 0.15);
|
|
23518
|
+
color: white;
|
|
23519
|
+
-webkit-text-stroke-width: thin;
|
|
23520
|
+
z-index: 0;
|
|
23521
|
+
}
|
|
23522
|
+
|
|
23523
|
+
&:hover:not(:has(:disabled, :checked)) {
|
|
23524
|
+
background-color: var(--gray-100);
|
|
23525
|
+
}
|
|
23526
|
+
|
|
23527
|
+
&:has(:disabled) {
|
|
23528
|
+
color: var(--gray-400);
|
|
23529
|
+
cursor: default;
|
|
23530
|
+
}
|
|
23531
|
+
|
|
23532
|
+
&:has(:checked:disabled) {
|
|
23533
|
+
color: var(--gray-50);
|
|
23534
|
+
background-color: var(--gray-400);
|
|
23535
|
+
}
|
|
23536
|
+
|
|
23537
|
+
// Firefox fallback using emotion variables
|
|
23538
|
+
// we can delete this whole block of code and variables in SegmentedControl.tsx
|
|
23539
|
+
// once Firefox supports :has selector
|
|
23540
|
+
@supports not selector(:has(*)) {
|
|
21952
23541
|
// equivalent to &:has(:checked:not(:disabled))
|
|
21953
23542
|
${checked && !disabled2 ? `
|
|
21954
23543
|
background-color: var(--segmented-control-selected-color);
|
|
@@ -21975,23 +23564,23 @@ var segmentedControlLabelStyles = (checked, disabled2) => import_react138.css`
|
|
|
21975
23564
|
`}
|
|
21976
23565
|
}
|
|
21977
23566
|
`;
|
|
21978
|
-
var segmentedControlLabelIconOnlyStyles =
|
|
23567
|
+
var segmentedControlLabelIconOnlyStyles = import_react145.css`
|
|
21979
23568
|
padding-inline: 0.5em;
|
|
21980
23569
|
`;
|
|
21981
|
-
var segmentedControlLabelCheckStyles =
|
|
23570
|
+
var segmentedControlLabelCheckStyles = import_react145.css`
|
|
21982
23571
|
opacity: 0.5;
|
|
21983
23572
|
`;
|
|
21984
|
-
var segmentedControlLabelContentStyles =
|
|
23573
|
+
var segmentedControlLabelContentStyles = import_react145.css`
|
|
21985
23574
|
display: flex;
|
|
21986
23575
|
align-items: center;
|
|
21987
23576
|
justify-content: center;
|
|
21988
23577
|
gap: var(--spacing-sm);
|
|
21989
23578
|
height: 100%;
|
|
21990
23579
|
`;
|
|
21991
|
-
var segmentedControlLabelTextStyles =
|
|
23580
|
+
var segmentedControlLabelTextStyles = import_react145.css``;
|
|
21992
23581
|
|
|
21993
23582
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
21994
|
-
var
|
|
23583
|
+
var import_jsx_runtime124 = require("@emotion/react/jsx-runtime");
|
|
21995
23584
|
var SegmentedControl = ({
|
|
21996
23585
|
name,
|
|
21997
23586
|
options,
|
|
@@ -22003,7 +23592,7 @@ var SegmentedControl = ({
|
|
|
22003
23592
|
size = "md",
|
|
22004
23593
|
...props
|
|
22005
23594
|
}) => {
|
|
22006
|
-
const onOptionChange = (0,
|
|
23595
|
+
const onOptionChange = (0, import_react147.useCallback)(
|
|
22007
23596
|
(event) => {
|
|
22008
23597
|
if (event.target.checked) {
|
|
22009
23598
|
onChange == null ? void 0 : onChange(options[parseInt(event.target.value)].value);
|
|
@@ -22011,18 +23600,18 @@ var SegmentedControl = ({
|
|
|
22011
23600
|
},
|
|
22012
23601
|
[options, onChange]
|
|
22013
23602
|
);
|
|
22014
|
-
const sizeStyles = (0,
|
|
23603
|
+
const sizeStyles = (0, import_react147.useMemo)(() => {
|
|
22015
23604
|
const map = {
|
|
22016
|
-
sm: (0,
|
|
22017
|
-
md: (0,
|
|
22018
|
-
lg: (0,
|
|
23605
|
+
sm: (0, import_react146.css)({ height: "calc(24px - 2px)", fontSize: "var(--fs-xs)" }),
|
|
23606
|
+
md: (0, import_react146.css)({ height: "calc(32px - 2px)", fontSize: "var(--fs-sm)" }),
|
|
23607
|
+
lg: (0, import_react146.css)({ height: "calc(40px - 2px)", fontSize: "var(--fs-base)" })
|
|
22019
23608
|
};
|
|
22020
23609
|
return map[size];
|
|
22021
23610
|
}, [size]);
|
|
22022
|
-
const isIconOnly = (0,
|
|
23611
|
+
const isIconOnly = (0, import_react147.useMemo)(() => {
|
|
22023
23612
|
return options.every((option) => option && option.icon && !option.label);
|
|
22024
23613
|
}, [options]);
|
|
22025
|
-
return /* @__PURE__ */ (0,
|
|
23614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
22026
23615
|
"div",
|
|
22027
23616
|
{
|
|
22028
23617
|
css: [segmentedControlStyles, orientation === "vertical" ? segmentedControlVerticalStyles : void 0],
|
|
@@ -22034,7 +23623,7 @@ var SegmentedControl = ({
|
|
|
22034
23623
|
}
|
|
22035
23624
|
const text = option.label ? option.label : option.icon ? null : String(option.value);
|
|
22036
23625
|
const isDisabled = disabled2 || option.disabled;
|
|
22037
|
-
return /* @__PURE__ */ (0,
|
|
23626
|
+
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)(
|
|
22038
23627
|
"label",
|
|
22039
23628
|
{
|
|
22040
23629
|
css: [
|
|
@@ -22043,7 +23632,7 @@ var SegmentedControl = ({
|
|
|
22043
23632
|
isIconOnly ? segmentedControlLabelIconOnlyStyles : void 0
|
|
22044
23633
|
],
|
|
22045
23634
|
children: [
|
|
22046
|
-
/* @__PURE__ */ (0,
|
|
23635
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
22047
23636
|
"input",
|
|
22048
23637
|
{
|
|
22049
23638
|
css: segmentedControlInputStyles,
|
|
@@ -22055,10 +23644,10 @@ var SegmentedControl = ({
|
|
|
22055
23644
|
disabled: isDisabled
|
|
22056
23645
|
}
|
|
22057
23646
|
),
|
|
22058
|
-
option.value !== value || noCheckmark ? null : /* @__PURE__ */ (0,
|
|
22059
|
-
/* @__PURE__ */ (0,
|
|
22060
|
-
!option.icon ? null : /* @__PURE__ */ (0,
|
|
22061
|
-
!text ? null : /* @__PURE__ */ (0,
|
|
23647
|
+
option.value !== value || noCheckmark ? null : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_CgCheck5.CgCheck, { css: segmentedControlLabelCheckStyles, "aria-label": "Selected", size: "1.5em" }),
|
|
23648
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsxs)("span", { css: segmentedControlLabelContentStyles, children: [
|
|
23649
|
+
!option.icon ? null : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(Icon, { icon: option.icon, size: "1.5em", iconColor: "currentColor" }),
|
|
23650
|
+
!text ? null : /* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { css: segmentedControlLabelTextStyles, children: text })
|
|
22062
23651
|
] })
|
|
22063
23652
|
]
|
|
22064
23653
|
}
|
|
@@ -22068,23 +23657,225 @@ var SegmentedControl = ({
|
|
|
22068
23657
|
);
|
|
22069
23658
|
};
|
|
22070
23659
|
|
|
23660
|
+
// src/components/SearchAndFilter/SortItems.tsx
|
|
23661
|
+
var import_jsx_runtime125 = require("@emotion/react/jsx-runtime");
|
|
23662
|
+
var SortItems = () => {
|
|
23663
|
+
var _a, _b;
|
|
23664
|
+
const { sortOptions, setSortBy, sortByValue } = useSearchAndFilter();
|
|
23665
|
+
const values = sortByValue.split("_");
|
|
23666
|
+
const sortDirection = values.pop();
|
|
23667
|
+
const sortField = values.join("_");
|
|
23668
|
+
const currentSelectedOption = (_b = (_a = sortOptions.find((item) => {
|
|
23669
|
+
var _a2;
|
|
23670
|
+
return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
|
|
23671
|
+
})) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
|
|
23672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(FilterMenu, { id: "search-and-filter-options", filterTitle: "Sort by", children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { css: SortFilterInputRow, children: [
|
|
23673
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
23674
|
+
InputComboBox,
|
|
23675
|
+
{
|
|
23676
|
+
options: sortOptions,
|
|
23677
|
+
onChange: (e) => {
|
|
23678
|
+
const fieldName = e == null ? void 0 : e.value;
|
|
23679
|
+
setSortBy(`${fieldName}_${sortDirection}`);
|
|
23680
|
+
},
|
|
23681
|
+
styles: {
|
|
23682
|
+
menu(base) {
|
|
23683
|
+
return {
|
|
23684
|
+
...base,
|
|
23685
|
+
minWidth: "max-content"
|
|
23686
|
+
};
|
|
23687
|
+
}
|
|
23688
|
+
},
|
|
23689
|
+
value: currentSelectedOption
|
|
23690
|
+
}
|
|
23691
|
+
),
|
|
23692
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
23693
|
+
SegmentedControl,
|
|
23694
|
+
{
|
|
23695
|
+
noCheckmark: true,
|
|
23696
|
+
name: "sortBy",
|
|
23697
|
+
options: [
|
|
23698
|
+
{ label: "Ascending", value: `ASC` },
|
|
23699
|
+
{ label: "Descending", value: `DESC` }
|
|
23700
|
+
],
|
|
23701
|
+
onChange: (e) => setSortBy(`${sortField}_${e}`),
|
|
23702
|
+
value: sortDirection
|
|
23703
|
+
}
|
|
23704
|
+
)
|
|
23705
|
+
] }) });
|
|
23706
|
+
};
|
|
23707
|
+
|
|
23708
|
+
// src/components/SearchAndFilter/FilterModeView.tsx
|
|
23709
|
+
var import_jsx_runtime126 = require("@emotion/react/jsx-runtime");
|
|
23710
|
+
var FilterModeView = () => {
|
|
23711
|
+
const { filterVisibility } = useSearchAndFilter();
|
|
23712
|
+
const modeView = {
|
|
23713
|
+
filters: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(FilterItems, {}),
|
|
23714
|
+
sort: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(SortItems, {})
|
|
23715
|
+
};
|
|
23716
|
+
return filterVisibility ? modeView[filterVisibility] : null;
|
|
23717
|
+
};
|
|
23718
|
+
|
|
23719
|
+
// src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
|
|
23720
|
+
init_emotion_jsx_shim();
|
|
23721
|
+
var import_jsx_runtime127 = require("@emotion/react/jsx-runtime");
|
|
23722
|
+
var SearchAndFilterResultContainer = ({
|
|
23723
|
+
buttonText,
|
|
23724
|
+
clearButtonLabel = "clear",
|
|
23725
|
+
calloutTitle: calloutTitle2,
|
|
23726
|
+
calloutText,
|
|
23727
|
+
onHandleClear
|
|
23728
|
+
}) => {
|
|
23729
|
+
const { searchTerm, setSearchTerm, totalResults, setFilters, filters } = useSearchAndFilter();
|
|
23730
|
+
const automateCalloutTitle = () => {
|
|
23731
|
+
if (searchTerm && !filters.length) {
|
|
23732
|
+
return "No search results found";
|
|
23733
|
+
}
|
|
23734
|
+
if (filters.length && !searchTerm) {
|
|
23735
|
+
return "No results match the selected filters";
|
|
23736
|
+
}
|
|
23737
|
+
return "No matching results found";
|
|
23738
|
+
};
|
|
23739
|
+
const handleResetFilters = () => {
|
|
23740
|
+
if (searchTerm && !filters.length) {
|
|
23741
|
+
setSearchTerm("");
|
|
23742
|
+
return;
|
|
23743
|
+
} else if (!searchTerm && filters.length) {
|
|
23744
|
+
setFilters([{ field: "", operator: "", value: "" }]);
|
|
23745
|
+
return;
|
|
23746
|
+
} else {
|
|
23747
|
+
setSearchTerm("");
|
|
23748
|
+
setFilters([{ field: "", operator: "", value: "" }]);
|
|
23749
|
+
return;
|
|
23750
|
+
}
|
|
23751
|
+
};
|
|
23752
|
+
if (totalResults && totalResults > 0) {
|
|
23753
|
+
return null;
|
|
23754
|
+
}
|
|
23755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
|
|
23756
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(HorizontalRhythm, { children: [
|
|
23757
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("span", { children: [
|
|
23758
|
+
totalResults,
|
|
23759
|
+
" results ",
|
|
23760
|
+
searchTerm ? `for "${searchTerm}"` : null
|
|
23761
|
+
] }),
|
|
23762
|
+
!searchTerm ? null : /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Button, { buttonType: "ghostDestructive", size: "zero", onClick: () => setSearchTerm(""), children: clearButtonLabel })
|
|
23763
|
+
] }),
|
|
23764
|
+
totalResults === 0 ? /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(Callout, { title: calloutTitle2 != null ? calloutTitle2 : automateCalloutTitle(), type: "note", children: [
|
|
23765
|
+
calloutText ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Paragraph, { children: calloutText }) : null,
|
|
23766
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)(Button, { buttonType: "tertiaryOutline", size: "xs", onClick: onHandleClear != null ? onHandleClear : handleResetFilters, children: buttonText != null ? buttonText : "Clear search" })
|
|
23767
|
+
] }) : null
|
|
23768
|
+
] });
|
|
23769
|
+
};
|
|
23770
|
+
|
|
23771
|
+
// src/components/SearchAndFilter/SearchAndFilter.tsx
|
|
23772
|
+
var import_jsx_runtime128 = require("@emotion/react/jsx-runtime");
|
|
23773
|
+
var SearchAndFilter = ({
|
|
23774
|
+
filters,
|
|
23775
|
+
filterOptions,
|
|
23776
|
+
filterMode: filterMode3,
|
|
23777
|
+
sortOptions,
|
|
23778
|
+
defaultSortByValue,
|
|
23779
|
+
filterControls,
|
|
23780
|
+
viewSwitchControls,
|
|
23781
|
+
resultsContainerView = /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(SearchAndFilterResultContainer, {}),
|
|
23782
|
+
children = /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(FilterModeView, {}),
|
|
23783
|
+
onChange,
|
|
23784
|
+
onSearchChange,
|
|
23785
|
+
onSortChange,
|
|
23786
|
+
totalResults
|
|
23787
|
+
}) => {
|
|
23788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
23789
|
+
SearchAndFilterProvider,
|
|
23790
|
+
{
|
|
23791
|
+
filters,
|
|
23792
|
+
filterOptions,
|
|
23793
|
+
filterMode: filterMode3,
|
|
23794
|
+
defaultSortByValue,
|
|
23795
|
+
sortOptions,
|
|
23796
|
+
onChange,
|
|
23797
|
+
onSearchChange,
|
|
23798
|
+
onSortChange,
|
|
23799
|
+
totalResults,
|
|
23800
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(VerticalRhythm, { css: SearchAndFilterContainer, "data-testid": "search-and-filter", children: [
|
|
23801
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsxs)("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
|
|
23802
|
+
/* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
|
|
23803
|
+
"div",
|
|
23804
|
+
{
|
|
23805
|
+
css: SearchAndFilterControlsWrapper(
|
|
23806
|
+
viewSwitchControls ? "auto auto 1fr 0.5fr" : "auto auto 1fr"
|
|
23807
|
+
),
|
|
23808
|
+
children: !filterControls ? /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(FilterControls, { hideSearchInput: !onSearchChange, defaultSortByValue }) : filterControls
|
|
23809
|
+
}
|
|
23810
|
+
),
|
|
23811
|
+
viewSwitchControls
|
|
23812
|
+
] }),
|
|
23813
|
+
children,
|
|
23814
|
+
resultsContainerView
|
|
23815
|
+
] })
|
|
23816
|
+
}
|
|
23817
|
+
);
|
|
23818
|
+
};
|
|
23819
|
+
|
|
23820
|
+
// src/components/SearchAndFilter/SearchOnlyFilter.tsx
|
|
23821
|
+
init_emotion_jsx_shim();
|
|
23822
|
+
var import_react148 = require("react");
|
|
23823
|
+
var import_react_use5 = require("react-use");
|
|
23824
|
+
var import_jsx_runtime129 = require("@emotion/react/jsx-runtime");
|
|
23825
|
+
var SearchOnlyContext = (0, import_react148.createContext)({
|
|
23826
|
+
searchTerm: "",
|
|
23827
|
+
setSearchTerm: () => {
|
|
23828
|
+
}
|
|
23829
|
+
});
|
|
23830
|
+
var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
23831
|
+
const { searchTerm, setSearchTerm } = useSearchAndFilter();
|
|
23832
|
+
const [localeSearchTerm, setLocaleSearchTerm] = (0, import_react148.useState)("");
|
|
23833
|
+
(0, import_react_use5.useDebounce)(
|
|
23834
|
+
() => {
|
|
23835
|
+
setSearchTerm(localeSearchTerm);
|
|
23836
|
+
onSearchChange == null ? void 0 : onSearchChange(localeSearchTerm);
|
|
23837
|
+
},
|
|
23838
|
+
300,
|
|
23839
|
+
[localeSearchTerm]
|
|
23840
|
+
);
|
|
23841
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
23842
|
+
SearchOnlyContext.Provider,
|
|
23843
|
+
{
|
|
23844
|
+
value: {
|
|
23845
|
+
searchTerm,
|
|
23846
|
+
setSearchTerm: setLocaleSearchTerm
|
|
23847
|
+
},
|
|
23848
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { css: { maxWidth: maxWidth != null ? maxWidth : "712px" }, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
|
|
23849
|
+
InputKeywordSearch,
|
|
23850
|
+
{
|
|
23851
|
+
placeholder: "Search...",
|
|
23852
|
+
onSearchTextChanged: (e) => setLocaleSearchTerm(e),
|
|
23853
|
+
value: localeSearchTerm,
|
|
23854
|
+
compact: true,
|
|
23855
|
+
rounded: true
|
|
23856
|
+
}
|
|
23857
|
+
) })
|
|
23858
|
+
}
|
|
23859
|
+
);
|
|
23860
|
+
};
|
|
23861
|
+
|
|
22071
23862
|
// src/components/Skeleton/Skeleton.tsx
|
|
22072
23863
|
init_emotion_jsx_shim();
|
|
22073
23864
|
|
|
22074
23865
|
// src/components/Skeleton/Skeleton.styles.ts
|
|
22075
23866
|
init_emotion_jsx_shim();
|
|
22076
|
-
var
|
|
22077
|
-
var lightFadingOut =
|
|
23867
|
+
var import_react149 = require("@emotion/react");
|
|
23868
|
+
var lightFadingOut = import_react149.keyframes`
|
|
22078
23869
|
from { opacity: 0.1; }
|
|
22079
23870
|
to { opacity: 0.025; }
|
|
22080
23871
|
`;
|
|
22081
|
-
var skeletonStyles =
|
|
23872
|
+
var skeletonStyles = import_react149.css`
|
|
22082
23873
|
animation: ${lightFadingOut} 1s ease-out infinite alternate;
|
|
22083
23874
|
background-color: var(--gray-900);
|
|
22084
23875
|
`;
|
|
22085
23876
|
|
|
22086
23877
|
// src/components/Skeleton/Skeleton.tsx
|
|
22087
|
-
var
|
|
23878
|
+
var import_jsx_runtime130 = require("@emotion/react/jsx-runtime");
|
|
22088
23879
|
var Skeleton = ({
|
|
22089
23880
|
width = "100%",
|
|
22090
23881
|
height = "1.25rem",
|
|
@@ -22092,7 +23883,7 @@ var Skeleton = ({
|
|
|
22092
23883
|
circle = false,
|
|
22093
23884
|
children,
|
|
22094
23885
|
...otherProps
|
|
22095
|
-
}) => /* @__PURE__ */ (0,
|
|
23886
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
22096
23887
|
"div",
|
|
22097
23888
|
{
|
|
22098
23889
|
css: [
|
|
@@ -22113,12 +23904,12 @@ var Skeleton = ({
|
|
|
22113
23904
|
|
|
22114
23905
|
// src/components/Switch/Switch.tsx
|
|
22115
23906
|
init_emotion_jsx_shim();
|
|
22116
|
-
var
|
|
23907
|
+
var React26 = __toESM(require("react"));
|
|
22117
23908
|
|
|
22118
23909
|
// src/components/Switch/Switch.styles.ts
|
|
22119
23910
|
init_emotion_jsx_shim();
|
|
22120
|
-
var
|
|
22121
|
-
var SwitchInputContainer =
|
|
23911
|
+
var import_react150 = require("@emotion/react");
|
|
23912
|
+
var SwitchInputContainer = import_react150.css`
|
|
22122
23913
|
cursor: pointer;
|
|
22123
23914
|
display: inline-block;
|
|
22124
23915
|
position: relative;
|
|
@@ -22127,7 +23918,7 @@ var SwitchInputContainer = import_react142.css`
|
|
|
22127
23918
|
vertical-align: middle;
|
|
22128
23919
|
user-select: none;
|
|
22129
23920
|
`;
|
|
22130
|
-
var SwitchInput =
|
|
23921
|
+
var SwitchInput = import_react150.css`
|
|
22131
23922
|
appearance: none;
|
|
22132
23923
|
border-radius: var(--rounded-full);
|
|
22133
23924
|
background-color: var(--white);
|
|
@@ -22165,7 +23956,7 @@ var SwitchInput = import_react142.css`
|
|
|
22165
23956
|
cursor: not-allowed;
|
|
22166
23957
|
}
|
|
22167
23958
|
`;
|
|
22168
|
-
var SwitchInputDisabled =
|
|
23959
|
+
var SwitchInputDisabled = import_react150.css`
|
|
22169
23960
|
opacity: var(--opacity-50);
|
|
22170
23961
|
cursor: not-allowed;
|
|
22171
23962
|
|
|
@@ -22173,7 +23964,7 @@ var SwitchInputDisabled = import_react142.css`
|
|
|
22173
23964
|
cursor: not-allowed;
|
|
22174
23965
|
}
|
|
22175
23966
|
`;
|
|
22176
|
-
var SwitchInputLabel =
|
|
23967
|
+
var SwitchInputLabel = import_react150.css`
|
|
22177
23968
|
align-items: center;
|
|
22178
23969
|
color: var(--typography-base);
|
|
22179
23970
|
display: inline-flex;
|
|
@@ -22194,26 +23985,26 @@ var SwitchInputLabel = import_react142.css`
|
|
|
22194
23985
|
top: 0;
|
|
22195
23986
|
}
|
|
22196
23987
|
`;
|
|
22197
|
-
var SwitchText =
|
|
23988
|
+
var SwitchText = import_react150.css`
|
|
22198
23989
|
color: var(--gray-500);
|
|
22199
23990
|
font-size: var(--fs-sm);
|
|
22200
23991
|
padding-inline: var(--spacing-2xl) 0;
|
|
22201
23992
|
`;
|
|
22202
23993
|
|
|
22203
23994
|
// src/components/Switch/Switch.tsx
|
|
22204
|
-
var
|
|
22205
|
-
var Switch =
|
|
23995
|
+
var import_jsx_runtime131 = require("@emotion/react/jsx-runtime");
|
|
23996
|
+
var Switch = React26.forwardRef(
|
|
22206
23997
|
({ label, infoText, toggleText, children, ...inputProps }, ref) => {
|
|
22207
23998
|
let additionalText = infoText;
|
|
22208
23999
|
if (infoText && toggleText) {
|
|
22209
24000
|
additionalText = inputProps.checked ? toggleText : infoText;
|
|
22210
24001
|
}
|
|
22211
|
-
return /* @__PURE__ */ (0,
|
|
22212
|
-
/* @__PURE__ */ (0,
|
|
22213
|
-
/* @__PURE__ */ (0,
|
|
22214
|
-
/* @__PURE__ */ (0,
|
|
24002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_jsx_runtime131.Fragment, { children: [
|
|
24003
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("label", { css: [SwitchInputContainer, inputProps.disabled ? SwitchInputDisabled : void 0], children: [
|
|
24004
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("input", { type: "checkbox", css: SwitchInput, ...inputProps, ref }),
|
|
24005
|
+
/* @__PURE__ */ (0, import_jsx_runtime131.jsx)("span", { css: SwitchInputLabel, children: label })
|
|
22215
24006
|
] }),
|
|
22216
|
-
additionalText ? /* @__PURE__ */ (0,
|
|
24007
|
+
additionalText ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("p", { css: SwitchText, children: additionalText }) : null,
|
|
22217
24008
|
children
|
|
22218
24009
|
] });
|
|
22219
24010
|
}
|
|
@@ -22221,12 +24012,12 @@ var Switch = React24.forwardRef(
|
|
|
22221
24012
|
|
|
22222
24013
|
// src/components/Table/Table.tsx
|
|
22223
24014
|
init_emotion_jsx_shim();
|
|
22224
|
-
var
|
|
24015
|
+
var React27 = __toESM(require("react"));
|
|
22225
24016
|
|
|
22226
24017
|
// src/components/Table/Table.styles.ts
|
|
22227
24018
|
init_emotion_jsx_shim();
|
|
22228
|
-
var
|
|
22229
|
-
var table = ({ cellPadding = "var(--spacing-base) var(--spacing-md)" }) =>
|
|
24019
|
+
var import_react151 = require("@emotion/react");
|
|
24020
|
+
var table = ({ cellPadding = "var(--spacing-base) var(--spacing-md)" }) => import_react151.css`
|
|
22230
24021
|
border-bottom: 1px solid var(--gray-400);
|
|
22231
24022
|
border-collapse: collapse;
|
|
22232
24023
|
min-width: 100%;
|
|
@@ -22237,67 +24028,67 @@ var table = ({ cellPadding = "var(--spacing-base) var(--spacing-md)" }) => impor
|
|
|
22237
24028
|
padding: ${cellPadding};
|
|
22238
24029
|
}
|
|
22239
24030
|
`;
|
|
22240
|
-
var tableHead =
|
|
24031
|
+
var tableHead = import_react151.css`
|
|
22241
24032
|
background: var(--gray-100);
|
|
22242
24033
|
color: var(--typography-base);
|
|
22243
24034
|
text-align: left;
|
|
22244
24035
|
`;
|
|
22245
|
-
var tableRow =
|
|
24036
|
+
var tableRow = import_react151.css`
|
|
22246
24037
|
border-bottom: 1px solid var(--gray-200);
|
|
22247
24038
|
`;
|
|
22248
|
-
var tableCellHead =
|
|
24039
|
+
var tableCellHead = import_react151.css`
|
|
22249
24040
|
font-size: var(--fs-sm);
|
|
22250
24041
|
text-transform: uppercase;
|
|
22251
24042
|
font-weight: var(--fw-bold);
|
|
22252
24043
|
`;
|
|
22253
24044
|
|
|
22254
24045
|
// src/components/Table/Table.tsx
|
|
22255
|
-
var
|
|
22256
|
-
var Table =
|
|
24046
|
+
var import_jsx_runtime132 = require("@emotion/react/jsx-runtime");
|
|
24047
|
+
var Table = React27.forwardRef(
|
|
22257
24048
|
({ children, cellPadding, ...otherProps }, ref) => {
|
|
22258
|
-
return /* @__PURE__ */ (0,
|
|
24049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("table", { ref, css: table({ cellPadding }), ...otherProps, children });
|
|
22259
24050
|
}
|
|
22260
24051
|
);
|
|
22261
|
-
var TableHead =
|
|
24052
|
+
var TableHead = React27.forwardRef(
|
|
22262
24053
|
({ children, ...otherProps }, ref) => {
|
|
22263
|
-
return /* @__PURE__ */ (0,
|
|
24054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("thead", { ref, css: tableHead, ...otherProps, children });
|
|
22264
24055
|
}
|
|
22265
24056
|
);
|
|
22266
|
-
var TableBody =
|
|
24057
|
+
var TableBody = React27.forwardRef(
|
|
22267
24058
|
({ children, ...otherProps }, ref) => {
|
|
22268
|
-
return /* @__PURE__ */ (0,
|
|
24059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("tbody", { ref, ...otherProps, children });
|
|
22269
24060
|
}
|
|
22270
24061
|
);
|
|
22271
|
-
var TableFoot =
|
|
24062
|
+
var TableFoot = React27.forwardRef(
|
|
22272
24063
|
({ children, ...otherProps }, ref) => {
|
|
22273
|
-
return /* @__PURE__ */ (0,
|
|
24064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("tfoot", { ref, ...otherProps, children });
|
|
22274
24065
|
}
|
|
22275
24066
|
);
|
|
22276
|
-
var TableRow =
|
|
24067
|
+
var TableRow = React27.forwardRef(
|
|
22277
24068
|
({ children, ...otherProps }, ref) => {
|
|
22278
|
-
return /* @__PURE__ */ (0,
|
|
24069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("tr", { ref, css: tableRow, ...otherProps, children });
|
|
22279
24070
|
}
|
|
22280
24071
|
);
|
|
22281
|
-
var TableCellHead =
|
|
24072
|
+
var TableCellHead = React27.forwardRef(
|
|
22282
24073
|
({ children, ...otherProps }, ref) => {
|
|
22283
|
-
return /* @__PURE__ */ (0,
|
|
24074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("th", { ref, css: tableCellHead, ...otherProps, children });
|
|
22284
24075
|
}
|
|
22285
24076
|
);
|
|
22286
|
-
var TableCellData =
|
|
24077
|
+
var TableCellData = React27.forwardRef(
|
|
22287
24078
|
({ children, ...otherProps }, ref) => {
|
|
22288
|
-
return /* @__PURE__ */ (0,
|
|
24079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("td", { ref, ...otherProps, children });
|
|
22289
24080
|
}
|
|
22290
24081
|
);
|
|
22291
24082
|
|
|
22292
24083
|
// src/components/Tabs/Tabs.tsx
|
|
22293
24084
|
init_emotion_jsx_shim();
|
|
22294
|
-
var
|
|
22295
|
-
var
|
|
24085
|
+
var import_react153 = require("@ariakit/react");
|
|
24086
|
+
var import_react154 = require("react");
|
|
22296
24087
|
|
|
22297
24088
|
// src/components/Tabs/Tabs.styles.ts
|
|
22298
24089
|
init_emotion_jsx_shim();
|
|
22299
|
-
var
|
|
22300
|
-
var tabButtonStyles =
|
|
24090
|
+
var import_react152 = require("@emotion/react");
|
|
24091
|
+
var tabButtonStyles = import_react152.css`
|
|
22301
24092
|
align-items: center;
|
|
22302
24093
|
border: 0;
|
|
22303
24094
|
height: 2.5rem;
|
|
@@ -22314,16 +24105,16 @@ var tabButtonStyles = import_react144.css`
|
|
|
22314
24105
|
box-shadow: inset 0 -2px 0 var(--brand-secondary-3);
|
|
22315
24106
|
}
|
|
22316
24107
|
`;
|
|
22317
|
-
var tabButtonGroupStyles =
|
|
24108
|
+
var tabButtonGroupStyles = import_react152.css`
|
|
22318
24109
|
display: flex;
|
|
22319
24110
|
gap: var(--spacing-base);
|
|
22320
24111
|
border-bottom: 1px solid var(--gray-300);
|
|
22321
24112
|
`;
|
|
22322
24113
|
|
|
22323
24114
|
// src/components/Tabs/Tabs.tsx
|
|
22324
|
-
var
|
|
24115
|
+
var import_jsx_runtime133 = require("@emotion/react/jsx-runtime");
|
|
22325
24116
|
var useCurrentTab = () => {
|
|
22326
|
-
const context = (0,
|
|
24117
|
+
const context = (0, import_react153.useTabStore)();
|
|
22327
24118
|
if (!context) {
|
|
22328
24119
|
throw new Error("This component can only be used inside <Tabs>");
|
|
22329
24120
|
}
|
|
@@ -22337,13 +24128,13 @@ var Tabs = ({
|
|
|
22337
24128
|
manual,
|
|
22338
24129
|
...props
|
|
22339
24130
|
}) => {
|
|
22340
|
-
const selected = (0,
|
|
24131
|
+
const selected = (0, import_react154.useMemo)(() => {
|
|
22341
24132
|
if (selectedId)
|
|
22342
24133
|
return selectedId;
|
|
22343
24134
|
return useHashForState && typeof window !== "undefined" && window.location.hash ? window.location.hash.substring(1) : void 0;
|
|
22344
24135
|
}, [selectedId, useHashForState]);
|
|
22345
|
-
const tab = (0,
|
|
22346
|
-
const onTabSelect = (0,
|
|
24136
|
+
const tab = (0, import_react153.useTabStore)({ ...props, selectOnMove: !manual, selectedId: selected });
|
|
24137
|
+
const onTabSelect = (0, import_react154.useCallback)(
|
|
22347
24138
|
(value) => {
|
|
22348
24139
|
const selectedValueWithoutNull = value != null ? value : void 0;
|
|
22349
24140
|
onSelectedIdChange == null ? void 0 : onSelectedIdChange(selectedValueWithoutNull);
|
|
@@ -22354,28 +24145,28 @@ var Tabs = ({
|
|
|
22354
24145
|
},
|
|
22355
24146
|
[onSelectedIdChange, useHashForState]
|
|
22356
24147
|
);
|
|
22357
|
-
(0,
|
|
24148
|
+
(0, import_react154.useEffect)(() => {
|
|
22358
24149
|
if (selected && selected !== tab.getState().activeId) {
|
|
22359
24150
|
tab.setSelectedId(selected);
|
|
22360
24151
|
}
|
|
22361
24152
|
}, [selected, tab]);
|
|
22362
|
-
return /* @__PURE__ */ (0,
|
|
24153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_react153.TabProvider, { store: tab, setSelectedId: onTabSelect, children });
|
|
22363
24154
|
};
|
|
22364
24155
|
var TabButtonGroup = ({ children, ...props }) => {
|
|
22365
|
-
return /* @__PURE__ */ (0,
|
|
24156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_react153.TabList, { ...props, css: tabButtonGroupStyles, children });
|
|
22366
24157
|
};
|
|
22367
24158
|
var TabButton = ({
|
|
22368
24159
|
children,
|
|
22369
24160
|
id,
|
|
22370
24161
|
...props
|
|
22371
24162
|
}) => {
|
|
22372
|
-
return /* @__PURE__ */ (0,
|
|
24163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_react153.Tab, { type: "button", id, ...props, css: tabButtonStyles, children });
|
|
22373
24164
|
};
|
|
22374
24165
|
var TabContent = ({
|
|
22375
24166
|
children,
|
|
22376
24167
|
...props
|
|
22377
24168
|
}) => {
|
|
22378
|
-
return /* @__PURE__ */ (0,
|
|
24169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_react153.TabPanel, { ...props, children });
|
|
22379
24170
|
};
|
|
22380
24171
|
|
|
22381
24172
|
// src/components/Toast/Toast.tsx
|
|
@@ -22384,8 +24175,8 @@ var import_react_toastify = require("react-toastify");
|
|
|
22384
24175
|
|
|
22385
24176
|
// src/components/Toast/Toast.styles.ts
|
|
22386
24177
|
init_emotion_jsx_shim();
|
|
22387
|
-
var
|
|
22388
|
-
var toastContainerStyles =
|
|
24178
|
+
var import_react155 = require("@emotion/react");
|
|
24179
|
+
var toastContainerStyles = import_react155.css`
|
|
22389
24180
|
${functionalColors}
|
|
22390
24181
|
|
|
22391
24182
|
--toastify-color-light: white;
|
|
@@ -22608,9 +24399,9 @@ var toastContainerStyles = import_react147.css`
|
|
|
22608
24399
|
`;
|
|
22609
24400
|
|
|
22610
24401
|
// src/components/Toast/Toast.tsx
|
|
22611
|
-
var
|
|
24402
|
+
var import_jsx_runtime134 = require("@emotion/react/jsx-runtime");
|
|
22612
24403
|
var ToastContainer = ({ limit = 4 }) => {
|
|
22613
|
-
return /* @__PURE__ */ (0,
|
|
24404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
22614
24405
|
import_react_toastify.ToastContainer,
|
|
22615
24406
|
{
|
|
22616
24407
|
css: toastContainerStyles,
|
|
@@ -22622,116 +24413,6 @@ var ToastContainer = ({ limit = 4 }) => {
|
|
|
22622
24413
|
}
|
|
22623
24414
|
);
|
|
22624
24415
|
};
|
|
22625
|
-
|
|
22626
|
-
// src/components/Validation/StatusBullet.tsx
|
|
22627
|
-
init_emotion_jsx_shim();
|
|
22628
|
-
|
|
22629
|
-
// src/components/Validation/StatusBullet.styles.ts
|
|
22630
|
-
init_emotion_jsx_shim();
|
|
22631
|
-
var import_react148 = require("@emotion/react");
|
|
22632
|
-
var StatusBulletContainer = import_react148.css`
|
|
22633
|
-
align-items: center;
|
|
22634
|
-
align-self: center;
|
|
22635
|
-
color: var(--gray-500);
|
|
22636
|
-
display: inline-flex;
|
|
22637
|
-
font-weight: var(--fw-regular);
|
|
22638
|
-
gap: var(--spacing-xs);
|
|
22639
|
-
line-height: 1;
|
|
22640
|
-
position: relative;
|
|
22641
|
-
text-transform: lowercase;
|
|
22642
|
-
|
|
22643
|
-
&:before {
|
|
22644
|
-
border-radius: var(--rounded-full);
|
|
22645
|
-
content: '';
|
|
22646
|
-
display: block;
|
|
22647
|
-
}
|
|
22648
|
-
`;
|
|
22649
|
-
var StatusBulletBase = import_react148.css`
|
|
22650
|
-
font-size: var(--fs-sm);
|
|
22651
|
-
&:before {
|
|
22652
|
-
width: var(--fs-xs);
|
|
22653
|
-
height: var(--fs-xs);
|
|
22654
|
-
}
|
|
22655
|
-
`;
|
|
22656
|
-
var StatusBulletSmall = import_react148.css`
|
|
22657
|
-
font-size: var(--fs-xs);
|
|
22658
|
-
&:before {
|
|
22659
|
-
width: var(--fs-xxs);
|
|
22660
|
-
height: var(--fs-xxs);
|
|
22661
|
-
}
|
|
22662
|
-
`;
|
|
22663
|
-
var StatusDraft = import_react148.css`
|
|
22664
|
-
&:before {
|
|
22665
|
-
background: var(--white);
|
|
22666
|
-
box-shadow: inset 0 0 0 0.125rem var(--primary-action-default);
|
|
22667
|
-
}
|
|
22668
|
-
`;
|
|
22669
|
-
var StatusModified = import_react148.css`
|
|
22670
|
-
&:before {
|
|
22671
|
-
background: linear-gradient(to right, var(--white) 50%, var(--primary-action-default) 50% 100%);
|
|
22672
|
-
box-shadow: inset 0 0 0 0.125rem var(--primary-action-default);
|
|
22673
|
-
}
|
|
22674
|
-
`;
|
|
22675
|
-
var StatusError = import_react148.css`
|
|
22676
|
-
color: var(--error);
|
|
22677
|
-
&:before {
|
|
22678
|
-
/* TODO: replace this with an svg icon */
|
|
22679
|
-
background: linear-gradient(
|
|
22680
|
-
133deg,
|
|
22681
|
-
var(--error) 41%,
|
|
22682
|
-
var(--white) 42%,
|
|
22683
|
-
var(--white) 58%,
|
|
22684
|
-
var(--error) 59%
|
|
22685
|
-
);
|
|
22686
|
-
}
|
|
22687
|
-
`;
|
|
22688
|
-
var StatusPublished = import_react148.css`
|
|
22689
|
-
&:before {
|
|
22690
|
-
background: var(--primary-action-default);
|
|
22691
|
-
}
|
|
22692
|
-
`;
|
|
22693
|
-
var StatusOrphan = import_react148.css`
|
|
22694
|
-
&:before {
|
|
22695
|
-
background: var(--brand-secondary-5);
|
|
22696
|
-
}
|
|
22697
|
-
`;
|
|
22698
|
-
var StatusUnknown = import_react148.css`
|
|
22699
|
-
&:before {
|
|
22700
|
-
background: var(--gray-800);
|
|
22701
|
-
}
|
|
22702
|
-
`;
|
|
22703
|
-
|
|
22704
|
-
// src/components/Validation/StatusBullet.tsx
|
|
22705
|
-
var import_jsx_runtime123 = require("@emotion/react/jsx-runtime");
|
|
22706
|
-
var StatusBullet = ({
|
|
22707
|
-
status,
|
|
22708
|
-
hideText = false,
|
|
22709
|
-
size = "base",
|
|
22710
|
-
message,
|
|
22711
|
-
...props
|
|
22712
|
-
}) => {
|
|
22713
|
-
const currentStateStyles = {
|
|
22714
|
-
Error: StatusError,
|
|
22715
|
-
Modified: StatusModified,
|
|
22716
|
-
Unsaved: StatusDraft,
|
|
22717
|
-
Orphan: StatusOrphan,
|
|
22718
|
-
Published: StatusPublished,
|
|
22719
|
-
Draft: StatusDraft,
|
|
22720
|
-
Previous: StatusDraft,
|
|
22721
|
-
Unknown: StatusUnknown
|
|
22722
|
-
};
|
|
22723
|
-
const statusSize = size === "base" ? StatusBulletBase : StatusBulletSmall;
|
|
22724
|
-
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
22725
|
-
"span",
|
|
22726
|
-
{
|
|
22727
|
-
role: "status",
|
|
22728
|
-
css: [StatusBulletContainer, currentStateStyles[status], statusSize],
|
|
22729
|
-
title: message != null ? message : status,
|
|
22730
|
-
...props,
|
|
22731
|
-
children: hideText ? null : message ? message : status
|
|
22732
|
-
}
|
|
22733
|
-
);
|
|
22734
|
-
};
|
|
22735
24416
|
// Annotate the CommonJS export names for ESM import in node:
|
|
22736
24417
|
0 && (module.exports = {
|
|
22737
24418
|
AddButton,
|
|
@@ -22743,6 +24424,7 @@ var StatusBullet = ({
|
|
|
22743
24424
|
Banner,
|
|
22744
24425
|
Button,
|
|
22745
24426
|
ButtonWithMenu,
|
|
24427
|
+
CHECKBOX_OPERATORS,
|
|
22746
24428
|
Calendar,
|
|
22747
24429
|
Callout,
|
|
22748
24430
|
Caption,
|
|
@@ -22756,9 +24438,11 @@ var StatusBullet = ({
|
|
|
22756
24438
|
Counter,
|
|
22757
24439
|
CreateTeamIntegrationTile,
|
|
22758
24440
|
CurrentDrawerContext,
|
|
24441
|
+
DATE_OPERATORS,
|
|
22759
24442
|
DashedBox,
|
|
22760
24443
|
DateTimePicker,
|
|
22761
24444
|
DateTimePickerVariant,
|
|
24445
|
+
DebouncedInputKeywordSearch,
|
|
22762
24446
|
DescriptionList,
|
|
22763
24447
|
Details,
|
|
22764
24448
|
DismissibleChipAction,
|
|
@@ -22769,6 +24453,11 @@ var StatusBullet = ({
|
|
|
22769
24453
|
EditTeamIntegrationTile,
|
|
22770
24454
|
ErrorMessage,
|
|
22771
24455
|
Fieldset,
|
|
24456
|
+
FilterButton,
|
|
24457
|
+
FilterControls,
|
|
24458
|
+
FilterItem,
|
|
24459
|
+
FilterItems,
|
|
24460
|
+
FilterMenu,
|
|
22772
24461
|
Heading,
|
|
22773
24462
|
HexModalBackground,
|
|
22774
24463
|
HorizontalRhythm,
|
|
@@ -22813,6 +24502,7 @@ var StatusBullet = ({
|
|
|
22813
24502
|
MenuItemSeparator,
|
|
22814
24503
|
Modal,
|
|
22815
24504
|
MultilineChip,
|
|
24505
|
+
NUMBER_OPERATORS,
|
|
22816
24506
|
PageHeaderSection,
|
|
22817
24507
|
Pagination,
|
|
22818
24508
|
Paragraph,
|
|
@@ -22845,11 +24535,21 @@ var StatusBullet = ({
|
|
|
22845
24535
|
ProgressBar,
|
|
22846
24536
|
ProgressList,
|
|
22847
24537
|
ProgressListItem,
|
|
24538
|
+
RICHTEXT_OPERATORS,
|
|
22848
24539
|
ResolveIcon,
|
|
22849
24540
|
RichTextToolbarIcon,
|
|
24541
|
+
SYSTEM_DATE_OPERATORS,
|
|
24542
|
+
SYSTEM_FIELD_OPERATORS,
|
|
22850
24543
|
ScrollableList,
|
|
22851
24544
|
ScrollableListInputItem,
|
|
22852
24545
|
ScrollableListItem,
|
|
24546
|
+
SearchAndFilter,
|
|
24547
|
+
SearchAndFilterContext,
|
|
24548
|
+
SearchAndFilterOptionsContainer,
|
|
24549
|
+
SearchAndFilterProvider,
|
|
24550
|
+
SearchAndFilterResultContainer,
|
|
24551
|
+
SearchOnlyContext,
|
|
24552
|
+
SearchOnlyFilter,
|
|
22853
24553
|
SegmentedControl,
|
|
22854
24554
|
ShortcutContext,
|
|
22855
24555
|
ShortcutRevealer,
|
|
@@ -22858,6 +24558,7 @@ var StatusBullet = ({
|
|
|
22858
24558
|
SuccessMessage,
|
|
22859
24559
|
Switch,
|
|
22860
24560
|
TAKEOVER_STACK_ID,
|
|
24561
|
+
TEXTBOX_OPERATORS,
|
|
22861
24562
|
TabButton,
|
|
22862
24563
|
TabButtonGroup,
|
|
22863
24564
|
TabContent,
|
|
@@ -22878,6 +24579,7 @@ var StatusBullet = ({
|
|
|
22878
24579
|
ToastContainer,
|
|
22879
24580
|
Tooltip,
|
|
22880
24581
|
TwoColumnLayout,
|
|
24582
|
+
USER_OPERATORS,
|
|
22881
24583
|
UniformBadge,
|
|
22882
24584
|
UniformLogo,
|
|
22883
24585
|
UniformLogoLarge,
|
|
@@ -22959,6 +24661,7 @@ var StatusBullet = ({
|
|
|
22959
24661
|
useIconContext,
|
|
22960
24662
|
useOutsideClick,
|
|
22961
24663
|
useParameterShell,
|
|
24664
|
+
useSearchAndFilter,
|
|
22962
24665
|
useShortcut,
|
|
22963
24666
|
warningIcon,
|
|
22964
24667
|
yesNoIcon
|