@uniformdev/design-system 19.114.0 → 19.115.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +1286 -276
- package/dist/index.d.mts +146 -1
- package/dist/index.d.ts +146 -1
- package/dist/index.js +1316 -283
- 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,6 +1367,7 @@ __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,
|
|
@@ -1379,6 +1381,11 @@ __export(src_exports, {
|
|
|
1379
1381
|
EditTeamIntegrationTile: () => EditTeamIntegrationTile,
|
|
1380
1382
|
ErrorMessage: () => ErrorMessage,
|
|
1381
1383
|
Fieldset: () => Fieldset,
|
|
1384
|
+
FilterButton: () => FilterButton2,
|
|
1385
|
+
FilterControls: () => FilterControls,
|
|
1386
|
+
FilterItem: () => FilterItem,
|
|
1387
|
+
FilterItems: () => FilterItems,
|
|
1388
|
+
FilterMenu: () => FilterMenu,
|
|
1382
1389
|
Heading: () => Heading,
|
|
1383
1390
|
HexModalBackground: () => HexModalBackground,
|
|
1384
1391
|
HorizontalRhythm: () => HorizontalRhythm,
|
|
@@ -1423,6 +1430,7 @@ __export(src_exports, {
|
|
|
1423
1430
|
MenuItemSeparator: () => MenuItemSeparator,
|
|
1424
1431
|
Modal: () => Modal,
|
|
1425
1432
|
MultilineChip: () => MultilineChip,
|
|
1433
|
+
NUMBER_OPERATORS: () => NUMBER_OPERATORS,
|
|
1426
1434
|
PageHeaderSection: () => PageHeaderSection,
|
|
1427
1435
|
Pagination: () => Pagination,
|
|
1428
1436
|
Paragraph: () => Paragraph,
|
|
@@ -1455,11 +1463,17 @@ __export(src_exports, {
|
|
|
1455
1463
|
ProgressBar: () => ProgressBar,
|
|
1456
1464
|
ProgressList: () => ProgressList,
|
|
1457
1465
|
ProgressListItem: () => ProgressListItem,
|
|
1466
|
+
RICHTEXT_OPERATORS: () => RICHTEXT_OPERATORS,
|
|
1458
1467
|
ResolveIcon: () => ResolveIcon,
|
|
1459
1468
|
RichTextToolbarIcon: () => RichTextToolbarIcon,
|
|
1469
|
+
SYSTEM_FIELD_OPERATORS: () => SYSTEM_FIELD_OPERATORS,
|
|
1460
1470
|
ScrollableList: () => ScrollableList,
|
|
1461
1471
|
ScrollableListInputItem: () => ScrollableListInputItem,
|
|
1462
1472
|
ScrollableListItem: () => ScrollableListItem,
|
|
1473
|
+
SearchAndFilter: () => SearchAndFilter,
|
|
1474
|
+
SearchAndFilterContext: () => SearchAndFilterContext,
|
|
1475
|
+
SearchAndFilterOptionsContainer: () => SearchAndFilterOptionsContainer2,
|
|
1476
|
+
SearchAndFilterProvider: () => SearchAndFilterProvider,
|
|
1463
1477
|
SegmentedControl: () => SegmentedControl,
|
|
1464
1478
|
ShortcutContext: () => ShortcutContext,
|
|
1465
1479
|
ShortcutRevealer: () => ShortcutRevealer,
|
|
@@ -1468,6 +1482,7 @@ __export(src_exports, {
|
|
|
1468
1482
|
SuccessMessage: () => SuccessMessage,
|
|
1469
1483
|
Switch: () => Switch,
|
|
1470
1484
|
TAKEOVER_STACK_ID: () => TAKEOVER_STACK_ID,
|
|
1485
|
+
TEXTBOX_OPERATORS: () => TEXTBOX_OPERATORS,
|
|
1471
1486
|
TabButton: () => TabButton,
|
|
1472
1487
|
TabButtonGroup: () => TabButtonGroup,
|
|
1473
1488
|
TabContent: () => TabContent,
|
|
@@ -1569,6 +1584,7 @@ __export(src_exports, {
|
|
|
1569
1584
|
useIconContext: () => useIconContext,
|
|
1570
1585
|
useOutsideClick: () => useOutsideClick,
|
|
1571
1586
|
useParameterShell: () => useParameterShell,
|
|
1587
|
+
useSearchAndFilter: () => useSearchAndFilter,
|
|
1572
1588
|
useShortcut: () => useShortcut,
|
|
1573
1589
|
warningIcon: () => warningIcon,
|
|
1574
1590
|
yesNoIcon: () => yesNoIcon
|
|
@@ -2291,6 +2307,15 @@ var input = (whiteSpaceWrap) => import_react4.css`
|
|
|
2291
2307
|
font-size: var(--fs-sm);
|
|
2292
2308
|
margin-right: var(--spacing-base);
|
|
2293
2309
|
}
|
|
2310
|
+
|
|
2311
|
+
&[aria-invalid='true'] {
|
|
2312
|
+
border-color: var(--action-destructive-default);
|
|
2313
|
+
box-shadow: var(--elevation-100);
|
|
2314
|
+
|
|
2315
|
+
&:hover {
|
|
2316
|
+
border-color: var(--action-destructive-hover);
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2294
2319
|
`;
|
|
2295
2320
|
var inputError = import_react4.css`
|
|
2296
2321
|
border-color: var(--action-destructive-default);
|
|
@@ -3613,6 +3638,27 @@ var listViewLong = (0, import_all_files.GenIcon)({
|
|
|
3613
3638
|
}
|
|
3614
3639
|
]
|
|
3615
3640
|
});
|
|
3641
|
+
var filterAdd = (0, import_all_files.GenIcon)({
|
|
3642
|
+
tag: "svg",
|
|
3643
|
+
attr: {
|
|
3644
|
+
role: "img",
|
|
3645
|
+
viewBox: "0 0 16 16",
|
|
3646
|
+
fill: "none",
|
|
3647
|
+
strokeWidth: ""
|
|
3648
|
+
},
|
|
3649
|
+
child: [
|
|
3650
|
+
{
|
|
3651
|
+
tag: "path",
|
|
3652
|
+
attr: {
|
|
3653
|
+
stroke: "currentColor",
|
|
3654
|
+
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",
|
|
3655
|
+
strokeLinejoin: "round",
|
|
3656
|
+
strokeLinecap: "round"
|
|
3657
|
+
},
|
|
3658
|
+
child: []
|
|
3659
|
+
}
|
|
3660
|
+
]
|
|
3661
|
+
});
|
|
3616
3662
|
var customIcons = {
|
|
3617
3663
|
"rectangle-rounded": rectangleRoundedIcon,
|
|
3618
3664
|
card: cardIcon,
|
|
@@ -3639,7 +3685,8 @@ var customIcons = {
|
|
|
3639
3685
|
"diamond-fill": diamondFill,
|
|
3640
3686
|
"magic-wand": magicWand,
|
|
3641
3687
|
"list-view-short": listViewShort,
|
|
3642
|
-
"list-view-long": listViewLong
|
|
3688
|
+
"list-view-long": listViewLong,
|
|
3689
|
+
"filter-add": filterAdd
|
|
3643
3690
|
};
|
|
3644
3691
|
|
|
3645
3692
|
// src/components/AddListButton/AddListButton.styles.ts
|
|
@@ -21862,148 +21909,1228 @@ var ProgressListItem = ({
|
|
|
21862
21909
|
] });
|
|
21863
21910
|
};
|
|
21864
21911
|
|
|
21865
|
-
// src/components/
|
|
21912
|
+
// src/components/SearchAndFilter/constants.ts
|
|
21866
21913
|
init_emotion_jsx_shim();
|
|
21867
|
-
var
|
|
21868
|
-
|
|
21869
|
-
|
|
21914
|
+
var NUMBER_OPERATORS = [
|
|
21915
|
+
{
|
|
21916
|
+
label: "equals...",
|
|
21917
|
+
symbol: "=",
|
|
21918
|
+
value: "eq",
|
|
21919
|
+
editorType: "number"
|
|
21920
|
+
},
|
|
21921
|
+
{
|
|
21922
|
+
label: "does not equal...",
|
|
21923
|
+
symbol: "\u2260",
|
|
21924
|
+
value: "neq",
|
|
21925
|
+
editorType: "number"
|
|
21926
|
+
},
|
|
21927
|
+
{
|
|
21928
|
+
label: "greater than...",
|
|
21929
|
+
symbol: ">",
|
|
21930
|
+
value: "gt",
|
|
21931
|
+
editorType: "number"
|
|
21932
|
+
},
|
|
21933
|
+
{
|
|
21934
|
+
label: "greater than or equal to...",
|
|
21935
|
+
symbol: "\u2265",
|
|
21936
|
+
value: "gte",
|
|
21937
|
+
editorType: "number"
|
|
21938
|
+
},
|
|
21939
|
+
{
|
|
21940
|
+
label: "less than...",
|
|
21941
|
+
symbol: "<",
|
|
21942
|
+
value: "lt",
|
|
21943
|
+
editorType: "number"
|
|
21944
|
+
},
|
|
21945
|
+
{
|
|
21946
|
+
label: "less than or equal to...",
|
|
21947
|
+
symbol: "\u2264",
|
|
21948
|
+
value: "lte",
|
|
21949
|
+
editorType: "number"
|
|
21950
|
+
},
|
|
21951
|
+
{
|
|
21952
|
+
label: "is empty...",
|
|
21953
|
+
value: "ndef",
|
|
21954
|
+
editorType: "empty"
|
|
21955
|
+
},
|
|
21956
|
+
{
|
|
21957
|
+
label: "is between...",
|
|
21958
|
+
value: "between",
|
|
21959
|
+
editorType: "numberRange"
|
|
21960
|
+
},
|
|
21961
|
+
{
|
|
21962
|
+
label: "is not empty...",
|
|
21963
|
+
value: "def",
|
|
21964
|
+
editorType: "empty"
|
|
21965
|
+
}
|
|
21966
|
+
];
|
|
21967
|
+
var DATE_OPERATORS = [
|
|
21968
|
+
{
|
|
21969
|
+
label: "is...",
|
|
21970
|
+
value: "eq",
|
|
21971
|
+
editorType: "date"
|
|
21972
|
+
},
|
|
21973
|
+
{
|
|
21974
|
+
label: "is between...",
|
|
21975
|
+
value: "between",
|
|
21976
|
+
editorType: "dateRange"
|
|
21977
|
+
},
|
|
21978
|
+
{
|
|
21979
|
+
label: "is before...",
|
|
21980
|
+
value: "lt",
|
|
21981
|
+
editorType: "date"
|
|
21982
|
+
},
|
|
21983
|
+
{
|
|
21984
|
+
label: "is after...",
|
|
21985
|
+
value: "gt",
|
|
21986
|
+
editorType: "date"
|
|
21987
|
+
},
|
|
21988
|
+
{
|
|
21989
|
+
label: "is on or before...",
|
|
21990
|
+
value: "lte",
|
|
21991
|
+
editorType: "date"
|
|
21992
|
+
},
|
|
21993
|
+
{
|
|
21994
|
+
label: "is on or after...",
|
|
21995
|
+
value: "gte",
|
|
21996
|
+
editorType: "date"
|
|
21997
|
+
},
|
|
21998
|
+
{
|
|
21999
|
+
label: "is empty...",
|
|
22000
|
+
value: "ndef",
|
|
22001
|
+
editorType: "empty"
|
|
22002
|
+
},
|
|
22003
|
+
{
|
|
22004
|
+
label: "is not...",
|
|
22005
|
+
value: "neq",
|
|
22006
|
+
editorType: "date"
|
|
22007
|
+
},
|
|
22008
|
+
{
|
|
22009
|
+
label: "is not empty...",
|
|
22010
|
+
value: "def",
|
|
22011
|
+
editorType: "empty"
|
|
22012
|
+
}
|
|
22013
|
+
];
|
|
22014
|
+
var TEXTBOX_OPERATORS = [
|
|
22015
|
+
{
|
|
22016
|
+
label: "is...",
|
|
22017
|
+
value: "eq",
|
|
22018
|
+
editorType: "text"
|
|
22019
|
+
},
|
|
22020
|
+
{
|
|
22021
|
+
label: "is empty...",
|
|
22022
|
+
value: "ndef",
|
|
22023
|
+
editorType: "empty"
|
|
22024
|
+
},
|
|
22025
|
+
{
|
|
22026
|
+
label: "contains...",
|
|
22027
|
+
value: "match",
|
|
22028
|
+
editorType: "text"
|
|
22029
|
+
},
|
|
22030
|
+
{
|
|
22031
|
+
label: "is not...",
|
|
22032
|
+
value: "neq",
|
|
22033
|
+
editorType: "text"
|
|
22034
|
+
},
|
|
22035
|
+
{
|
|
22036
|
+
label: "is not empty...",
|
|
22037
|
+
value: "def",
|
|
22038
|
+
editorType: "empty"
|
|
22039
|
+
}
|
|
22040
|
+
];
|
|
22041
|
+
var RICHTEXT_OPERATORS = [
|
|
22042
|
+
{
|
|
22043
|
+
label: "is empty...",
|
|
22044
|
+
value: "ndef",
|
|
22045
|
+
editorType: "empty"
|
|
22046
|
+
},
|
|
22047
|
+
{
|
|
22048
|
+
label: "contains...",
|
|
22049
|
+
value: "match",
|
|
22050
|
+
editorType: "text"
|
|
22051
|
+
},
|
|
22052
|
+
{
|
|
22053
|
+
label: "is not empty...",
|
|
22054
|
+
value: "def",
|
|
22055
|
+
editorType: "empty"
|
|
22056
|
+
}
|
|
22057
|
+
];
|
|
22058
|
+
var CHECKBOX_OPERATORS = [
|
|
22059
|
+
{
|
|
22060
|
+
label: "is checked...",
|
|
22061
|
+
value: "def",
|
|
22062
|
+
editorType: "empty"
|
|
22063
|
+
},
|
|
22064
|
+
{
|
|
22065
|
+
label: "is not checked...",
|
|
22066
|
+
value: "ndef",
|
|
22067
|
+
editorType: "empty"
|
|
22068
|
+
}
|
|
22069
|
+
];
|
|
22070
|
+
var SYSTEM_FIELD_OPERATORS = [
|
|
22071
|
+
{
|
|
22072
|
+
label: "is...",
|
|
22073
|
+
value: "eq",
|
|
22074
|
+
editorType: "singleChoice"
|
|
22075
|
+
},
|
|
22076
|
+
{
|
|
22077
|
+
label: "is any of...",
|
|
22078
|
+
value: "in",
|
|
22079
|
+
editorType: "multiChoice"
|
|
22080
|
+
},
|
|
22081
|
+
{
|
|
22082
|
+
label: "is not...",
|
|
22083
|
+
value: "neq",
|
|
22084
|
+
editorType: "singleChoice"
|
|
22085
|
+
},
|
|
22086
|
+
{
|
|
22087
|
+
label: "is none of...",
|
|
22088
|
+
value: "nin",
|
|
22089
|
+
editorType: "multiChoice"
|
|
22090
|
+
}
|
|
22091
|
+
];
|
|
21870
22092
|
|
|
21871
|
-
// src/components/
|
|
22093
|
+
// src/components/SearchAndFilter/FilterButton.tsx
|
|
22094
|
+
init_emotion_jsx_shim();
|
|
22095
|
+
|
|
22096
|
+
// src/components/SearchAndFilter/styles/SearchAndFilter.styles.ts
|
|
21872
22097
|
init_emotion_jsx_shim();
|
|
21873
22098
|
var import_react138 = require("@emotion/react");
|
|
21874
|
-
var
|
|
21875
|
-
|
|
21876
|
-
|
|
21877
|
-
|
|
21878
|
-
|
|
21879
|
-
|
|
21880
|
-
|
|
21881
|
-
|
|
22099
|
+
var SearchAndFilterContainer = import_react138.css``;
|
|
22100
|
+
var SearchAndFilterControlsWrapper = import_react138.css`
|
|
22101
|
+
align-items: stretch;
|
|
22102
|
+
display: grid;
|
|
22103
|
+
grid-template-columns: auto 1fr 1fr;
|
|
22104
|
+
gap: var(--spacing-base);
|
|
22105
|
+
`;
|
|
22106
|
+
var ConditionalFilterRow = import_react138.css`
|
|
22107
|
+
display: grid;
|
|
22108
|
+
grid-template-columns: 35px 1fr;
|
|
22109
|
+
gap: var(--spacing-sm);
|
|
22110
|
+
padding: 0 var(--spacing-sm);
|
|
22111
|
+
margin-left: var(--spacing-base);
|
|
21882
22112
|
|
|
21883
|
-
|
|
21884
|
-
|
|
21885
|
-
|
|
21886
|
-
|
|
21887
|
-
|
|
21888
|
-
|
|
21889
|
-
|
|
21890
|
-
|
|
21891
|
-
|
|
22113
|
+
${cq("380px")} {
|
|
22114
|
+
align-items: center;
|
|
22115
|
+
}
|
|
22116
|
+
|
|
22117
|
+
&:first-of-type {
|
|
22118
|
+
margin-left: 0;
|
|
22119
|
+
grid-template-columns: 50px 1fr;
|
|
22120
|
+
}
|
|
22121
|
+
|
|
22122
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
22123
|
+
animation: ${fadeInLtr} var(--duration-fast) var(--timing-ease-out);
|
|
22124
|
+
}
|
|
21892
22125
|
`;
|
|
21893
|
-
var
|
|
22126
|
+
var ConditionalInputRow = import_react138.css`
|
|
22127
|
+
display: flex;
|
|
22128
|
+
gap: var(--spacing-sm);
|
|
21894
22129
|
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);
|
|
22130
|
+
|
|
22131
|
+
${cq("380px")} {
|
|
22132
|
+
align-items: center;
|
|
22133
|
+
flex-direction: row;
|
|
21903
22134
|
}
|
|
21904
|
-
|
|
21905
|
-
|
|
22135
|
+
${cq("580px")} {
|
|
22136
|
+
display: grid;
|
|
22137
|
+
grid-template-columns: repeat(4, minmax(160px, auto)) 32px;
|
|
21906
22138
|
}
|
|
21907
22139
|
`;
|
|
21908
|
-
var
|
|
21909
|
-
${
|
|
22140
|
+
var SearchInput = import_react138.css`
|
|
22141
|
+
${input("nowrap")}
|
|
22142
|
+
border-radius: var(--rounded-full);
|
|
22143
|
+
padding: var(--spacing-sm) var(--spacing-base);
|
|
22144
|
+
font-size: var(--fs-sm);
|
|
22145
|
+
padding-right: var(--spacing-2xl);
|
|
21910
22146
|
`;
|
|
21911
|
-
var
|
|
21912
|
-
position: relative;
|
|
21913
|
-
display: flex;
|
|
22147
|
+
var FilterButton = import_react138.css`
|
|
21914
22148
|
align-items: center;
|
|
21915
|
-
|
|
21916
|
-
|
|
21917
|
-
|
|
21918
|
-
|
|
21919
|
-
|
|
21920
|
-
|
|
21921
|
-
|
|
21922
|
-
|
|
21923
|
-
|
|
21924
|
-
|
|
21925
|
-
&:has(:checked:not(:disabled)) {
|
|
21926
|
-
background-color: var(--segmented-control-selected-color);
|
|
21927
|
-
outline: var(--segmented-control-border-width) solid var(--segmented-control-selected-color);
|
|
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;
|
|
21932
|
-
}
|
|
22149
|
+
background: var(--white);
|
|
22150
|
+
border: 1px solid var(--gray-300);
|
|
22151
|
+
border-radius: var(--rounded-full);
|
|
22152
|
+
color: var(--typography-base);
|
|
22153
|
+
display: flex;
|
|
22154
|
+
gap: var(--spacing-sm);
|
|
22155
|
+
padding: var(--spacing-sm) var(--spacing-base);
|
|
22156
|
+
transition: color var(--duration-fast) var(--timing-ease-out),
|
|
22157
|
+
background-color var(--duration-fast) var(--timing-ease-out);
|
|
21933
22158
|
|
|
21934
|
-
|
|
21935
|
-
|
|
22159
|
+
svg {
|
|
22160
|
+
color: var(--gray-300);
|
|
22161
|
+
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
21936
22162
|
}
|
|
21937
22163
|
|
|
21938
|
-
&:
|
|
21939
|
-
|
|
21940
|
-
|
|
21941
|
-
|
|
22164
|
+
&:focus,
|
|
22165
|
+
&:hover {
|
|
22166
|
+
outline: none;
|
|
22167
|
+
background: var(--gray-300);
|
|
21942
22168
|
|
|
21943
|
-
|
|
21944
|
-
|
|
21945
|
-
|
|
22169
|
+
svg {
|
|
22170
|
+
color: var(--typography-base);
|
|
22171
|
+
}
|
|
21946
22172
|
}
|
|
21947
22173
|
|
|
21948
|
-
|
|
21949
|
-
|
|
21950
|
-
// once Firefox supports :has selector
|
|
21951
|
-
@supports not selector(:has(*)) {
|
|
21952
|
-
// equivalent to &:has(:checked:not(:disabled))
|
|
21953
|
-
${checked && !disabled2 ? `
|
|
21954
|
-
background-color: var(--segmented-control-selected-color);
|
|
21955
|
-
outline: var(--segmented-control-border-width) solid var(--segmented-control-selected-color);
|
|
21956
|
-
box-shadow: 0 0.43em 1.7em 0 rgba(0, 0, 0, 0.15);
|
|
21957
|
-
color: white;
|
|
21958
|
-
-webkit-text-stroke-width: thin;
|
|
21959
|
-
z-index: 0;` : void 0}
|
|
22174
|
+
:where([aria-expanded='true']) {
|
|
22175
|
+
background: var(--purple-rain-100);
|
|
21960
22176
|
|
|
21961
|
-
|
|
21962
|
-
|
|
21963
|
-
${!checked && !disabled2 ? `background-color: var(--gray-100);` : void 0}
|
|
22177
|
+
svg {
|
|
22178
|
+
color: var(--typography-base);
|
|
21964
22179
|
}
|
|
21965
|
-
|
|
21966
|
-
// equivalent to &:has(:disabled)
|
|
21967
|
-
${disabled2 ? `
|
|
21968
|
-
color: var(--gray-400);
|
|
21969
|
-
cursor: default;` : void 0}
|
|
21970
|
-
|
|
21971
|
-
// equivalent to &:has(:checked:disabled)
|
|
21972
|
-
${checked && disabled2 && `
|
|
21973
|
-
color: var(--gray-50);
|
|
21974
|
-
background-color: var(--gray-400);
|
|
21975
|
-
`}
|
|
21976
22180
|
}
|
|
21977
22181
|
`;
|
|
21978
|
-
var
|
|
21979
|
-
|
|
22182
|
+
var FilterButtonWithOptions = import_react138.css`
|
|
22183
|
+
background: var(--purple-rain-100);
|
|
22184
|
+
color: var(--typography-base);
|
|
22185
|
+
svg {
|
|
22186
|
+
color: var(--typography-base);
|
|
22187
|
+
}
|
|
21980
22188
|
`;
|
|
21981
|
-
var
|
|
21982
|
-
|
|
22189
|
+
var SearchIcon = import_react138.css`
|
|
22190
|
+
color: var(--icon-color);
|
|
22191
|
+
position: absolute;
|
|
22192
|
+
inset: 0 var(--spacing-base) 0 auto;
|
|
22193
|
+
margin: auto;
|
|
22194
|
+
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
21983
22195
|
`;
|
|
21984
|
-
var
|
|
21985
|
-
display: flex;
|
|
22196
|
+
var AddConditionalBtn = import_react138.css`
|
|
21986
22197
|
align-items: center;
|
|
21987
|
-
|
|
22198
|
+
background: transparent;
|
|
22199
|
+
border: none;
|
|
22200
|
+
color: var(--primary-action-default);
|
|
22201
|
+
display: flex;
|
|
21988
22202
|
gap: var(--spacing-sm);
|
|
21989
|
-
|
|
22203
|
+
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
22204
|
+
padding: 0;
|
|
22205
|
+
font-size: var(--fs-sm);
|
|
22206
|
+
|
|
22207
|
+
&:hover,
|
|
22208
|
+
&:focus {
|
|
22209
|
+
color: var(--primary-action-hover);
|
|
22210
|
+
}
|
|
22211
|
+
`;
|
|
22212
|
+
var Title = import_react138.css`
|
|
22213
|
+
color: var(--typography-light);
|
|
21990
22214
|
`;
|
|
21991
|
-
var
|
|
22215
|
+
var ResetConditionsBtn = import_react138.css`
|
|
22216
|
+
background: transparent;
|
|
22217
|
+
border: none;
|
|
22218
|
+
color: var(--action-destructive-default);
|
|
22219
|
+
transition: color var(--duration-fast) var(--timing-ease-out);
|
|
22220
|
+
padding: 0;
|
|
21992
22221
|
|
|
21993
|
-
|
|
21994
|
-
|
|
21995
|
-
var
|
|
21996
|
-
|
|
21997
|
-
|
|
21998
|
-
|
|
21999
|
-
|
|
22000
|
-
|
|
22001
|
-
|
|
22002
|
-
|
|
22222
|
+
&:hover,
|
|
22223
|
+
&:focus {
|
|
22224
|
+
color: var(--action-destructive-hover);
|
|
22225
|
+
}
|
|
22226
|
+
`;
|
|
22227
|
+
var IconBtn = import_react138.css`
|
|
22228
|
+
background: transparent;
|
|
22229
|
+
border: none;
|
|
22230
|
+
padding: var(--spacing-sm);
|
|
22231
|
+
`;
|
|
22232
|
+
var CloseBtn = import_react138.css`
|
|
22233
|
+
color: var(--gray-500);
|
|
22234
|
+
background: transparent;
|
|
22235
|
+
border: none;
|
|
22236
|
+
padding: 0;
|
|
22237
|
+
position: absolute;
|
|
22238
|
+
top: var(--spacing-base);
|
|
22239
|
+
right: var(--spacing-base);
|
|
22240
|
+
`;
|
|
22241
|
+
var SearchAndFilterOptionsContainer = import_react138.css`
|
|
22242
|
+
background: var(--gray-50);
|
|
22243
|
+
border: 1px solid var(--gray-300);
|
|
22244
|
+
border-radius: var(--rounded-base);
|
|
22245
|
+
container-type: inline-size;
|
|
22246
|
+
display: flex;
|
|
22247
|
+
flex-direction: column;
|
|
22248
|
+
gap: var(--spacing-sm);
|
|
22249
|
+
padding: var(--spacing-md) var(--spacing-md) var(--spacing-base);
|
|
22250
|
+
will-change: height;
|
|
22251
|
+
position: relative;
|
|
22252
|
+
z-index: var(--z-50);
|
|
22253
|
+
`;
|
|
22254
|
+
var SearchAndFilterOptionsInnerContainer = import_react138.css`
|
|
22255
|
+
display: flex;
|
|
22256
|
+
flex-direction: column;
|
|
22257
|
+
gap: var(--spacing-sm);
|
|
22258
|
+
// TODO: this is nice for responsive but is causing issue with the dropdown
|
|
22259
|
+
// ${scrollbarStyles}
|
|
22260
|
+
// overflow-x: auto;
|
|
22261
|
+
// overflow-y: visible;
|
|
22262
|
+
`;
|
|
22263
|
+
var SearchAndFilterButtonGroup = import_react138.css`
|
|
22264
|
+
margin-top: var(--spacing-base);
|
|
22265
|
+
`;
|
|
22266
|
+
var SelectOpen = import_react138.css`
|
|
22267
|
+
position: relative;
|
|
22268
|
+
.input-combobox__menu {
|
|
22269
|
+
background: red;
|
|
22270
|
+
z-index: 99999 !important;
|
|
22271
|
+
}
|
|
22272
|
+
`;
|
|
22273
|
+
|
|
22274
|
+
// src/components/SearchAndFilter/FilterButton.tsx
|
|
22275
|
+
var import_jsx_runtime117 = require("@emotion/react/jsx-runtime");
|
|
22276
|
+
var FilterButton2 = ({ text = "Filters", filterCount, ...props }) => {
|
|
22277
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
|
|
22278
|
+
"button",
|
|
22279
|
+
{
|
|
22280
|
+
type: "button",
|
|
22281
|
+
css: [FilterButton, filterCount ? FilterButtonWithOptions : void 0],
|
|
22282
|
+
...props,
|
|
22283
|
+
children: [
|
|
22284
|
+
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(Icon, { icon: "filter-add", iconColor: "currentColor", size: "1rem" }),
|
|
22285
|
+
text,
|
|
22286
|
+
filterCount ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(Counter, { count: filterCount, bgColor: "var(--white)" }) : null
|
|
22287
|
+
]
|
|
22288
|
+
}
|
|
22289
|
+
);
|
|
22290
|
+
};
|
|
22291
|
+
|
|
22292
|
+
// src/components/SearchAndFilter/FilterControls.tsx
|
|
22293
|
+
init_emotion_jsx_shim();
|
|
22294
|
+
|
|
22295
|
+
// src/components/SearchAndFilter/hooks/useSearchAndFilter.tsx
|
|
22296
|
+
init_emotion_jsx_shim();
|
|
22297
|
+
var import_react139 = require("react");
|
|
22298
|
+
var import_jsx_runtime118 = require("@emotion/react/jsx-runtime");
|
|
22299
|
+
var SearchAndFilterContext = (0, import_react139.createContext)({
|
|
22300
|
+
searchTerm: "",
|
|
22301
|
+
setSearchTerm: () => {
|
|
22302
|
+
},
|
|
22303
|
+
filterVisibility: false,
|
|
22304
|
+
setFilterVisibility: () => {
|
|
22305
|
+
},
|
|
22306
|
+
filters: [],
|
|
22307
|
+
setFilters: () => {
|
|
22308
|
+
},
|
|
22309
|
+
handleAddFilter: () => {
|
|
22310
|
+
},
|
|
22311
|
+
handleResetFilters: () => {
|
|
22312
|
+
},
|
|
22313
|
+
handleDeleteFilter: () => {
|
|
22314
|
+
},
|
|
22315
|
+
filterOptions: [],
|
|
22316
|
+
validFilterQuery: []
|
|
22317
|
+
});
|
|
22318
|
+
var SearchAndFilterProvider = ({
|
|
22319
|
+
filters,
|
|
22320
|
+
filterOptions,
|
|
22321
|
+
onChange,
|
|
22322
|
+
children
|
|
22323
|
+
}) => {
|
|
22324
|
+
const [searchTerm, setSearchTerm] = (0, import_react139.useState)("");
|
|
22325
|
+
const deferredSearchTerm = (0, import_react139.useDeferredValue)(searchTerm);
|
|
22326
|
+
const [filterVisibility, setFilterVisibility] = (0, import_react139.useState)(false);
|
|
22327
|
+
const handleSearchTerm = (0, import_react139.useCallback)((term) => setSearchTerm(term), [setSearchTerm]);
|
|
22328
|
+
const handleToggleFilterVisibilty = (0, import_react139.useCallback)(
|
|
22329
|
+
(visible) => setFilterVisibility(visible),
|
|
22330
|
+
[setFilterVisibility]
|
|
22331
|
+
);
|
|
22332
|
+
const handleAddFilter = (0, import_react139.useCallback)(() => {
|
|
22333
|
+
onChange([...filters, { field: "", operator: "", value: "" }]);
|
|
22334
|
+
}, [filters, onChange]);
|
|
22335
|
+
const handleResetFilters = (0, import_react139.useCallback)(() => {
|
|
22336
|
+
onChange([]);
|
|
22337
|
+
}, [onChange]);
|
|
22338
|
+
const handleDeleteFilter = (0, import_react139.useCallback)(
|
|
22339
|
+
(index) => {
|
|
22340
|
+
const remainingFilters = filters.filter((_, i) => i !== index);
|
|
22341
|
+
onChange(remainingFilters);
|
|
22342
|
+
},
|
|
22343
|
+
[filters, onChange]
|
|
22344
|
+
);
|
|
22345
|
+
const validFilterQuery = (0, import_react139.useMemo)(() => {
|
|
22346
|
+
const hasValidFilters = filters.every((f) => f.field && f.operator && f.value);
|
|
22347
|
+
if (hasValidFilters) {
|
|
22348
|
+
return filters;
|
|
22349
|
+
}
|
|
22350
|
+
}, [filters]);
|
|
22351
|
+
(0, import_react139.useEffect)(() => {
|
|
22352
|
+
if (filterVisibility) {
|
|
22353
|
+
const handleEscKeyFilterClose = (e) => {
|
|
22354
|
+
if (e.key === "Escape") {
|
|
22355
|
+
setFilterVisibility(false);
|
|
22356
|
+
}
|
|
22357
|
+
};
|
|
22358
|
+
document.addEventListener("keydown", (e) => handleEscKeyFilterClose(e));
|
|
22359
|
+
return () => {
|
|
22360
|
+
document.removeEventListener("keydown", (e) => handleEscKeyFilterClose(e));
|
|
22361
|
+
};
|
|
22362
|
+
}
|
|
22363
|
+
}, [filterVisibility, setFilterVisibility]);
|
|
22364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
22365
|
+
SearchAndFilterContext.Provider,
|
|
22366
|
+
{
|
|
22367
|
+
value: {
|
|
22368
|
+
searchTerm: deferredSearchTerm,
|
|
22369
|
+
setSearchTerm: (e) => handleSearchTerm(e),
|
|
22370
|
+
filterVisibility,
|
|
22371
|
+
setFilterVisibility: (e) => handleToggleFilterVisibilty(e),
|
|
22372
|
+
filters,
|
|
22373
|
+
setFilters: (e) => onChange(e),
|
|
22374
|
+
handleAddFilter: () => handleAddFilter(),
|
|
22375
|
+
handleResetFilters: () => handleResetFilters(),
|
|
22376
|
+
handleDeleteFilter: (index) => handleDeleteFilter(index),
|
|
22377
|
+
filterOptions,
|
|
22378
|
+
validFilterQuery
|
|
22379
|
+
},
|
|
22380
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(VerticalRhythm, { children })
|
|
22381
|
+
}
|
|
22382
|
+
);
|
|
22383
|
+
};
|
|
22384
|
+
var useSearchAndFilter = () => {
|
|
22385
|
+
const value = (0, import_react139.useContext)(SearchAndFilterContext);
|
|
22386
|
+
return { ...value };
|
|
22387
|
+
};
|
|
22388
|
+
|
|
22389
|
+
// src/components/SearchAndFilter/FilterControls.tsx
|
|
22390
|
+
var import_jsx_runtime119 = require("@emotion/react/jsx-runtime");
|
|
22391
|
+
var FilterControls = ({ children }) => {
|
|
22392
|
+
const { setFilterVisibility, filterVisibility, setSearchTerm, validFilterQuery } = useSearchAndFilter();
|
|
22393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_jsx_runtime119.Fragment, { children: [
|
|
22394
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
22395
|
+
FilterButton2,
|
|
22396
|
+
{
|
|
22397
|
+
"aria-controls": "search-and-filter-options",
|
|
22398
|
+
"aria-label": "filter options",
|
|
22399
|
+
"aria-haspopup": "true",
|
|
22400
|
+
"aria-expanded": filterVisibility,
|
|
22401
|
+
filterCount: validFilterQuery == null ? void 0 : validFilterQuery.length,
|
|
22402
|
+
onClick: () => setFilterVisibility(!filterVisibility)
|
|
22403
|
+
}
|
|
22404
|
+
),
|
|
22405
|
+
/* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
22406
|
+
InputKeywordSearch,
|
|
22407
|
+
{
|
|
22408
|
+
type: "search",
|
|
22409
|
+
placeholder: "Search...",
|
|
22410
|
+
onSearchTextChanged: (e) => setSearchTerm(e),
|
|
22411
|
+
compact: true,
|
|
22412
|
+
rounded: true
|
|
22413
|
+
}
|
|
22414
|
+
),
|
|
22415
|
+
children
|
|
22416
|
+
] });
|
|
22417
|
+
};
|
|
22418
|
+
|
|
22419
|
+
// src/components/SearchAndFilter/FilterItem.tsx
|
|
22420
|
+
init_emotion_jsx_shim();
|
|
22421
|
+
|
|
22422
|
+
// src/components/SearchAndFilter/FilterEditor.tsx
|
|
22423
|
+
init_emotion_jsx_shim();
|
|
22424
|
+
var import_react141 = require("@emotion/react");
|
|
22425
|
+
var import_react142 = require("react");
|
|
22426
|
+
|
|
22427
|
+
// src/components/Validation/StatusBullet.tsx
|
|
22428
|
+
init_emotion_jsx_shim();
|
|
22429
|
+
|
|
22430
|
+
// src/components/Validation/StatusBullet.styles.ts
|
|
22431
|
+
init_emotion_jsx_shim();
|
|
22432
|
+
var import_react140 = require("@emotion/react");
|
|
22433
|
+
var StatusBulletContainer = import_react140.css`
|
|
22434
|
+
align-items: center;
|
|
22435
|
+
align-self: center;
|
|
22436
|
+
color: var(--gray-500);
|
|
22437
|
+
display: inline-flex;
|
|
22438
|
+
font-weight: var(--fw-regular);
|
|
22439
|
+
gap: var(--spacing-xs);
|
|
22440
|
+
line-height: 1;
|
|
22441
|
+
position: relative;
|
|
22442
|
+
text-transform: lowercase;
|
|
22443
|
+
|
|
22444
|
+
&:before {
|
|
22445
|
+
border-radius: var(--rounded-full);
|
|
22446
|
+
content: '';
|
|
22447
|
+
display: block;
|
|
22448
|
+
}
|
|
22449
|
+
`;
|
|
22450
|
+
var StatusBulletBase = import_react140.css`
|
|
22451
|
+
font-size: var(--fs-sm);
|
|
22452
|
+
&:before {
|
|
22453
|
+
width: var(--fs-xs);
|
|
22454
|
+
height: var(--fs-xs);
|
|
22455
|
+
}
|
|
22456
|
+
`;
|
|
22457
|
+
var StatusBulletSmall = import_react140.css`
|
|
22458
|
+
font-size: var(--fs-xs);
|
|
22459
|
+
&:before {
|
|
22460
|
+
width: var(--fs-xxs);
|
|
22461
|
+
height: var(--fs-xxs);
|
|
22462
|
+
}
|
|
22463
|
+
`;
|
|
22464
|
+
var StatusDraft = import_react140.css`
|
|
22465
|
+
&:before {
|
|
22466
|
+
background: var(--white);
|
|
22467
|
+
box-shadow: inset 0 0 0 0.125rem var(--primary-action-default);
|
|
22468
|
+
}
|
|
22469
|
+
`;
|
|
22470
|
+
var StatusModified = import_react140.css`
|
|
22471
|
+
&:before {
|
|
22472
|
+
background: linear-gradient(to right, var(--white) 50%, var(--primary-action-default) 50% 100%);
|
|
22473
|
+
box-shadow: inset 0 0 0 0.125rem var(--primary-action-default);
|
|
22474
|
+
}
|
|
22475
|
+
`;
|
|
22476
|
+
var StatusError = import_react140.css`
|
|
22477
|
+
color: var(--error);
|
|
22478
|
+
&:before {
|
|
22479
|
+
/* TODO: replace this with an svg icon */
|
|
22480
|
+
background: linear-gradient(
|
|
22481
|
+
133deg,
|
|
22482
|
+
var(--error) 41%,
|
|
22483
|
+
var(--white) 42%,
|
|
22484
|
+
var(--white) 58%,
|
|
22485
|
+
var(--error) 59%
|
|
22486
|
+
);
|
|
22487
|
+
}
|
|
22488
|
+
`;
|
|
22489
|
+
var StatusPublished = import_react140.css`
|
|
22490
|
+
&:before {
|
|
22491
|
+
background: var(--primary-action-default);
|
|
22492
|
+
}
|
|
22493
|
+
`;
|
|
22494
|
+
var StatusOrphan = import_react140.css`
|
|
22495
|
+
&:before {
|
|
22496
|
+
background: var(--brand-secondary-5);
|
|
22497
|
+
}
|
|
22498
|
+
`;
|
|
22499
|
+
var StatusUnknown = import_react140.css`
|
|
22500
|
+
&:before {
|
|
22501
|
+
background: var(--gray-800);
|
|
22502
|
+
}
|
|
22503
|
+
`;
|
|
22504
|
+
|
|
22505
|
+
// src/components/Validation/StatusBullet.tsx
|
|
22506
|
+
var import_jsx_runtime120 = require("@emotion/react/jsx-runtime");
|
|
22507
|
+
var StatusBullet = ({
|
|
22508
|
+
status,
|
|
22509
|
+
hideText = false,
|
|
22510
|
+
size = "base",
|
|
22511
|
+
message,
|
|
22512
|
+
...props
|
|
22513
|
+
}) => {
|
|
22514
|
+
const currentStateStyles = {
|
|
22515
|
+
Error: StatusError,
|
|
22516
|
+
Modified: StatusModified,
|
|
22517
|
+
Unsaved: StatusDraft,
|
|
22518
|
+
Orphan: StatusOrphan,
|
|
22519
|
+
Published: StatusPublished,
|
|
22520
|
+
Draft: StatusDraft,
|
|
22521
|
+
Previous: StatusDraft,
|
|
22522
|
+
Unknown: StatusUnknown
|
|
22523
|
+
};
|
|
22524
|
+
const statusSize = size === "base" ? StatusBulletBase : StatusBulletSmall;
|
|
22525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
22526
|
+
"span",
|
|
22527
|
+
{
|
|
22528
|
+
role: "status",
|
|
22529
|
+
css: [StatusBulletContainer, currentStateStyles[status], statusSize],
|
|
22530
|
+
title: message != null ? message : status,
|
|
22531
|
+
...props,
|
|
22532
|
+
children: hideText ? null : message ? message : status
|
|
22533
|
+
}
|
|
22534
|
+
);
|
|
22535
|
+
};
|
|
22536
|
+
|
|
22537
|
+
// src/components/SearchAndFilter/FilterEditor.tsx
|
|
22538
|
+
var import_jsx_runtime121 = require("@emotion/react/jsx-runtime");
|
|
22539
|
+
var FilterMultiChoiceEditor = ({
|
|
22540
|
+
value,
|
|
22541
|
+
options,
|
|
22542
|
+
...props
|
|
22543
|
+
}) => {
|
|
22544
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
22545
|
+
InputComboBox,
|
|
22546
|
+
{
|
|
22547
|
+
...props,
|
|
22548
|
+
options,
|
|
22549
|
+
isMulti: true,
|
|
22550
|
+
isClearable: true,
|
|
22551
|
+
onChange: (e) => {
|
|
22552
|
+
var _a;
|
|
22553
|
+
return props.onChange((_a = e.map((item) => item.value)) != null ? _a : []);
|
|
22554
|
+
}
|
|
22555
|
+
}
|
|
22556
|
+
);
|
|
22557
|
+
};
|
|
22558
|
+
var FilterSingleChoiceEditor = ({
|
|
22559
|
+
options,
|
|
22560
|
+
value,
|
|
22561
|
+
...props
|
|
22562
|
+
}) => {
|
|
22563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
22564
|
+
InputComboBox,
|
|
22565
|
+
{
|
|
22566
|
+
options,
|
|
22567
|
+
isClearable: true,
|
|
22568
|
+
...props,
|
|
22569
|
+
onChange: (e) => {
|
|
22570
|
+
var _a;
|
|
22571
|
+
return props.onChange((_a = e == null ? void 0 : e.value) != null ? _a : "");
|
|
22572
|
+
}
|
|
22573
|
+
}
|
|
22574
|
+
);
|
|
22575
|
+
};
|
|
22576
|
+
var CustomOptions = ({ label, value }) => {
|
|
22577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(StatusBullet, { status: label, message: value });
|
|
22578
|
+
};
|
|
22579
|
+
var StatusMultiEditor = ({
|
|
22580
|
+
options,
|
|
22581
|
+
value,
|
|
22582
|
+
...props
|
|
22583
|
+
}) => {
|
|
22584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
22585
|
+
InputComboBox,
|
|
22586
|
+
{
|
|
22587
|
+
options,
|
|
22588
|
+
isMulti: true,
|
|
22589
|
+
...props,
|
|
22590
|
+
onChange: (e) => {
|
|
22591
|
+
var _a;
|
|
22592
|
+
return props.onChange((_a = e.map((item) => item.value)) != null ? _a : []);
|
|
22593
|
+
},
|
|
22594
|
+
formatOptionLabel: CustomOptions
|
|
22595
|
+
}
|
|
22596
|
+
);
|
|
22597
|
+
};
|
|
22598
|
+
var StatusSingleEditor = ({
|
|
22599
|
+
options,
|
|
22600
|
+
value,
|
|
22601
|
+
...props
|
|
22602
|
+
}) => {
|
|
22603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
22604
|
+
InputComboBox,
|
|
22605
|
+
{
|
|
22606
|
+
options,
|
|
22607
|
+
...props,
|
|
22608
|
+
onChange: (e) => {
|
|
22609
|
+
var _a;
|
|
22610
|
+
return props.onChange((_a = e == null ? void 0 : e.value) != null ? _a : "");
|
|
22611
|
+
},
|
|
22612
|
+
formatOptionLabel: CustomOptions
|
|
22613
|
+
}
|
|
22614
|
+
);
|
|
22615
|
+
};
|
|
22616
|
+
var TextEditor = ({ onChange, ariaLabel }) => {
|
|
22617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
22618
|
+
Input,
|
|
22619
|
+
{
|
|
22620
|
+
showLabel: false,
|
|
22621
|
+
"aria-label": ariaLabel,
|
|
22622
|
+
onChange: (e) => onChange(e.currentTarget.value),
|
|
22623
|
+
placeholder: "Enter phrase to search\u2026"
|
|
22624
|
+
}
|
|
22625
|
+
);
|
|
22626
|
+
};
|
|
22627
|
+
var NumberRangeEditor = ({ onChange, ...props }) => {
|
|
22628
|
+
const [minValue, setMinValue] = (0, import_react142.useState)("");
|
|
22629
|
+
const [maxValue, setMaxValue] = (0, import_react142.useState)("");
|
|
22630
|
+
const [error, setError] = (0, import_react142.useState)("");
|
|
22631
|
+
(0, import_react142.useEffect)(() => {
|
|
22632
|
+
if (!maxValue && !minValue) {
|
|
22633
|
+
return;
|
|
22634
|
+
}
|
|
22635
|
+
const max = Number(maxValue);
|
|
22636
|
+
const min = Number(minValue);
|
|
22637
|
+
if (max < min || min > max) {
|
|
22638
|
+
setError("Please enter a valid numeric range");
|
|
22639
|
+
onChange([]);
|
|
22640
|
+
return;
|
|
22641
|
+
}
|
|
22642
|
+
if (maxValue && !minValue || minValue && !maxValue) {
|
|
22643
|
+
setError("Please enter both a low and high number");
|
|
22644
|
+
onChange([]);
|
|
22645
|
+
return;
|
|
22646
|
+
}
|
|
22647
|
+
setError("");
|
|
22648
|
+
onChange([minValue, maxValue]);
|
|
22649
|
+
}, [maxValue, minValue, setError]);
|
|
22650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(import_jsx_runtime121.Fragment, { children: [
|
|
22651
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
22652
|
+
Input,
|
|
22653
|
+
{
|
|
22654
|
+
...props,
|
|
22655
|
+
type: "number",
|
|
22656
|
+
showLabel: false,
|
|
22657
|
+
min: 0,
|
|
22658
|
+
placeholder: "Low",
|
|
22659
|
+
onChange: (e) => setMinValue(e.currentTarget.value),
|
|
22660
|
+
"aria-invalid": !error ? false : true
|
|
22661
|
+
}
|
|
22662
|
+
),
|
|
22663
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
22664
|
+
Input,
|
|
22665
|
+
{
|
|
22666
|
+
...props,
|
|
22667
|
+
type: "number",
|
|
22668
|
+
showLabel: false,
|
|
22669
|
+
min: 0,
|
|
22670
|
+
placeholder: "High",
|
|
22671
|
+
onChange: (e) => setMaxValue(e.currentTarget.value),
|
|
22672
|
+
"aria-invalid": !error ? false : true
|
|
22673
|
+
}
|
|
22674
|
+
),
|
|
22675
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(ErrorContainer, { errorMessage: error })
|
|
22676
|
+
] });
|
|
22677
|
+
};
|
|
22678
|
+
var NumberEditor = ({ ariaLabel, onChange }) => {
|
|
22679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
22680
|
+
Input,
|
|
22681
|
+
{
|
|
22682
|
+
"aria-label": ariaLabel,
|
|
22683
|
+
type: "number",
|
|
22684
|
+
showLabel: false,
|
|
22685
|
+
min: 0,
|
|
22686
|
+
onChange: (e) => onChange(e.currentTarget.value)
|
|
22687
|
+
}
|
|
22688
|
+
);
|
|
22689
|
+
};
|
|
22690
|
+
var DateEditor = ({ onChange, ...props }) => {
|
|
22691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Input, { type: "date", ...props, showLabel: false, onChange: (e) => onChange(e.currentTarget.value) });
|
|
22692
|
+
};
|
|
22693
|
+
var DateRangeEditor = ({ ariaLabel, onChange }) => {
|
|
22694
|
+
const [minDateValue, setMinDateValue] = (0, import_react142.useState)("");
|
|
22695
|
+
const [maxDateValue, setMaxDateValue] = (0, import_react142.useState)("");
|
|
22696
|
+
const [error, setError] = (0, import_react142.useState)("");
|
|
22697
|
+
(0, import_react142.useEffect)(() => {
|
|
22698
|
+
if (!minDateValue || !maxDateValue) {
|
|
22699
|
+
return;
|
|
22700
|
+
}
|
|
22701
|
+
const minDate = new Date(minDateValue);
|
|
22702
|
+
const maxDate = new Date(maxDateValue);
|
|
22703
|
+
if (maxDate < minDate) {
|
|
22704
|
+
setError("The max date cannot be lower than the min date");
|
|
22705
|
+
onChange([]);
|
|
22706
|
+
return;
|
|
22707
|
+
}
|
|
22708
|
+
if (maxDate && !minDate) {
|
|
22709
|
+
setError("Please enter both a low and high date");
|
|
22710
|
+
onChange([]);
|
|
22711
|
+
return;
|
|
22712
|
+
}
|
|
22713
|
+
const minDateString = minDate.toDateString();
|
|
22714
|
+
const maxDateString = maxDate.toDateString();
|
|
22715
|
+
if (minDateString === maxDateString || maxDateString === minDateString) {
|
|
22716
|
+
setError("The min and max date cannot be the same");
|
|
22717
|
+
onChange([]);
|
|
22718
|
+
return;
|
|
22719
|
+
}
|
|
22720
|
+
if (minDate > maxDate) {
|
|
22721
|
+
setError("The min date cannot be higher than the max date");
|
|
22722
|
+
onChange([]);
|
|
22723
|
+
return;
|
|
22724
|
+
}
|
|
22725
|
+
setError("");
|
|
22726
|
+
onChange([minDateValue, maxDateValue]);
|
|
22727
|
+
}, [minDateValue, maxDateValue, setError]);
|
|
22728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(import_jsx_runtime121.Fragment, { children: [
|
|
22729
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
22730
|
+
Input,
|
|
22731
|
+
{
|
|
22732
|
+
"aria-label": `${ariaLabel}-min-date`,
|
|
22733
|
+
type: "date",
|
|
22734
|
+
showLabel: false,
|
|
22735
|
+
value: minDateValue,
|
|
22736
|
+
onChange: (e) => setMinDateValue(e.currentTarget.value),
|
|
22737
|
+
"aria-invalid": !error ? false : true
|
|
22738
|
+
}
|
|
22739
|
+
),
|
|
22740
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
22741
|
+
Input,
|
|
22742
|
+
{
|
|
22743
|
+
"aria-label": `${ariaLabel}-max-date`,
|
|
22744
|
+
type: "date",
|
|
22745
|
+
showLabel: false,
|
|
22746
|
+
value: maxDateValue,
|
|
22747
|
+
onChange: (e) => setMaxDateValue(e.currentTarget.value),
|
|
22748
|
+
"aria-invalid": !error ? false : true
|
|
22749
|
+
}
|
|
22750
|
+
),
|
|
22751
|
+
/* @__PURE__ */ (0, import_jsx_runtime121.jsx)(ErrorContainer, { errorMessage: error })
|
|
22752
|
+
] });
|
|
22753
|
+
};
|
|
22754
|
+
var FilterEditorRenderer = ({ editorType, ...props }) => {
|
|
22755
|
+
const Editor = filterMapper[editorType];
|
|
22756
|
+
if (!Editor) {
|
|
22757
|
+
return null;
|
|
22758
|
+
}
|
|
22759
|
+
if (editorType === "empty") {
|
|
22760
|
+
return null;
|
|
22761
|
+
}
|
|
22762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(Editor, { ...props });
|
|
22763
|
+
};
|
|
22764
|
+
var filterMapper = {
|
|
22765
|
+
multiChoice: FilterMultiChoiceEditor,
|
|
22766
|
+
singleChoice: FilterSingleChoiceEditor,
|
|
22767
|
+
date: DateEditor,
|
|
22768
|
+
dateRange: DateRangeEditor,
|
|
22769
|
+
text: TextEditor,
|
|
22770
|
+
numberRange: NumberRangeEditor,
|
|
22771
|
+
number: NumberEditor,
|
|
22772
|
+
statusMultiChoice: StatusMultiEditor,
|
|
22773
|
+
statusSingleChoice: StatusSingleEditor,
|
|
22774
|
+
empty: null
|
|
22775
|
+
};
|
|
22776
|
+
var ErrorContainer = ({ errorMessage }) => {
|
|
22777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
22778
|
+
"div",
|
|
22779
|
+
{
|
|
22780
|
+
css: import_react141.css`
|
|
22781
|
+
grid-column: span 6;
|
|
22782
|
+
order: 6;
|
|
22783
|
+
`,
|
|
22784
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(FieldMessage, { errorMessage })
|
|
22785
|
+
}
|
|
22786
|
+
);
|
|
22787
|
+
};
|
|
22788
|
+
|
|
22789
|
+
// src/components/SearchAndFilter/FilterMenu.tsx
|
|
22790
|
+
init_emotion_jsx_shim();
|
|
22791
|
+
var import_jsx_runtime122 = require("@emotion/react/jsx-runtime");
|
|
22792
|
+
var SearchAndFilterOptionsContainer2 = ({
|
|
22793
|
+
buttonRow,
|
|
22794
|
+
children
|
|
22795
|
+
}) => {
|
|
22796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { css: SearchAndFilterOptionsContainer, children: [
|
|
22797
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { css: SearchAndFilterOptionsInnerContainer, children }),
|
|
22798
|
+
buttonRow ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
22799
|
+
HorizontalRhythm,
|
|
22800
|
+
{
|
|
22801
|
+
css: SearchAndFilterButtonGroup,
|
|
22802
|
+
gap: "sm",
|
|
22803
|
+
align: "center",
|
|
22804
|
+
justify: "space-between",
|
|
22805
|
+
children: buttonRow
|
|
22806
|
+
}
|
|
22807
|
+
) : null
|
|
22808
|
+
] });
|
|
22809
|
+
};
|
|
22810
|
+
var FilterMenu = ({
|
|
22811
|
+
id,
|
|
22812
|
+
addButtonText = "add condition",
|
|
22813
|
+
isAddDisabled,
|
|
22814
|
+
resetButtonText = "reset filters",
|
|
22815
|
+
filterTitle = "Show records",
|
|
22816
|
+
children
|
|
22817
|
+
}) => {
|
|
22818
|
+
const { filterVisibility, handleAddFilter, handleResetFilters, setFilterVisibility, validFilterQuery } = useSearchAndFilter();
|
|
22819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(VerticalRhythm, { gap: "sm", "aria-haspopup": "true", id, children: filterVisibility ? /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
22820
|
+
SearchAndFilterOptionsContainer2,
|
|
22821
|
+
{
|
|
22822
|
+
buttonRow: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
|
|
22823
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
|
|
22824
|
+
"button",
|
|
22825
|
+
{
|
|
22826
|
+
type: "button",
|
|
22827
|
+
css: AddConditionalBtn,
|
|
22828
|
+
onClick: handleAddFilter,
|
|
22829
|
+
disabled: isAddDisabled,
|
|
22830
|
+
children: [
|
|
22831
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Icon, { icon: "math-plus", iconColor: "gray", size: "1rem" }),
|
|
22832
|
+
addButtonText
|
|
22833
|
+
]
|
|
22834
|
+
}
|
|
22835
|
+
),
|
|
22836
|
+
(validFilterQuery == null ? void 0 : validFilterQuery.length) ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
22837
|
+
"button",
|
|
22838
|
+
{
|
|
22839
|
+
type: "button",
|
|
22840
|
+
css: ResetConditionsBtn,
|
|
22841
|
+
onClick: () => {
|
|
22842
|
+
handleResetFilters();
|
|
22843
|
+
setFilterVisibility(false);
|
|
22844
|
+
},
|
|
22845
|
+
children: resetButtonText
|
|
22846
|
+
}
|
|
22847
|
+
) : null
|
|
22848
|
+
] }),
|
|
22849
|
+
children: [
|
|
22850
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { css: Title, children: filterTitle }),
|
|
22851
|
+
/* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
22852
|
+
"button",
|
|
22853
|
+
{
|
|
22854
|
+
type: "button",
|
|
22855
|
+
"aria-label": "close filters",
|
|
22856
|
+
css: [CloseBtn],
|
|
22857
|
+
onClick: () => setFilterVisibility(!filterVisibility),
|
|
22858
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(Icon, { icon: "close", iconColor: "currentColor", size: "1.1rem" })
|
|
22859
|
+
}
|
|
22860
|
+
),
|
|
22861
|
+
children
|
|
22862
|
+
]
|
|
22863
|
+
}
|
|
22864
|
+
) : null });
|
|
22865
|
+
};
|
|
22866
|
+
|
|
22867
|
+
// src/components/SearchAndFilter/FilterItem.tsx
|
|
22868
|
+
var import_jsx_runtime123 = require("@emotion/react/jsx-runtime");
|
|
22869
|
+
var FilterItem = ({
|
|
22870
|
+
index,
|
|
22871
|
+
paramOptions,
|
|
22872
|
+
operatorOptions,
|
|
22873
|
+
valueOptions,
|
|
22874
|
+
onParamChange,
|
|
22875
|
+
onOperatorChange,
|
|
22876
|
+
onValueChange
|
|
22877
|
+
}) => {
|
|
22878
|
+
var _a, _b;
|
|
22879
|
+
const { filters, handleDeleteFilter } = useSearchAndFilter();
|
|
22880
|
+
const label = filters[index].field !== "" ? filters[index].field : "unknown filter field";
|
|
22881
|
+
const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
|
|
22882
|
+
const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
|
|
22883
|
+
const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
|
|
22884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { css: ConditionalFilterRow, children: [
|
|
22885
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { children: index === 0 ? "where" : "and" }),
|
|
22886
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsxs)("div", { css: ConditionalInputRow, children: [
|
|
22887
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
22888
|
+
InputComboBox,
|
|
22889
|
+
{
|
|
22890
|
+
"aria-label": label,
|
|
22891
|
+
options: paramOptions,
|
|
22892
|
+
onChange: (e) => {
|
|
22893
|
+
var _a2;
|
|
22894
|
+
onParamChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
|
|
22895
|
+
}
|
|
22896
|
+
}
|
|
22897
|
+
),
|
|
22898
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
22899
|
+
InputComboBox,
|
|
22900
|
+
{
|
|
22901
|
+
"aria-label": operatorLabel,
|
|
22902
|
+
options: operatorOptions,
|
|
22903
|
+
onChange: (e) => {
|
|
22904
|
+
var _a2;
|
|
22905
|
+
return onOperatorChange((_a2 = e == null ? void 0 : e.value) != null ? _a2 : "");
|
|
22906
|
+
},
|
|
22907
|
+
isDisabled: !filters[index].field
|
|
22908
|
+
}
|
|
22909
|
+
),
|
|
22910
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
22911
|
+
FilterEditorRenderer,
|
|
22912
|
+
{
|
|
22913
|
+
"aria-label": metaDataLabel,
|
|
22914
|
+
editorType: metaDataPossibleOptions,
|
|
22915
|
+
options: valueOptions,
|
|
22916
|
+
onChange: (e) => onValueChange(e != null ? e : "")
|
|
22917
|
+
}
|
|
22918
|
+
),
|
|
22919
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
22920
|
+
"button",
|
|
22921
|
+
{
|
|
22922
|
+
type: "button",
|
|
22923
|
+
onClick: () => handleDeleteFilter(index),
|
|
22924
|
+
"aria-label": "delete filter",
|
|
22925
|
+
css: IconBtn,
|
|
22926
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(Icon, { icon: "trash", iconColor: "red", size: "1rem" })
|
|
22927
|
+
}
|
|
22928
|
+
)
|
|
22929
|
+
] })
|
|
22930
|
+
] });
|
|
22931
|
+
};
|
|
22932
|
+
var FilterItems = () => {
|
|
22933
|
+
const { filterOptions, filters, setFilters } = useSearchAndFilter();
|
|
22934
|
+
const handleUpdateFilter = (index, prop, value) => {
|
|
22935
|
+
const next = [...filters];
|
|
22936
|
+
next[index] = { ...next[index], [prop]: value };
|
|
22937
|
+
if (prop === "operator") {
|
|
22938
|
+
next[index].value = "";
|
|
22939
|
+
if (value === "def" || value === "true") {
|
|
22940
|
+
next[index].value = "true";
|
|
22941
|
+
}
|
|
22942
|
+
if (value === "ndef" || value === "false") {
|
|
22943
|
+
next[index].value = "false";
|
|
22944
|
+
}
|
|
22945
|
+
}
|
|
22946
|
+
if (prop === "field") {
|
|
22947
|
+
next[index].operator = "";
|
|
22948
|
+
next[index].value = "";
|
|
22949
|
+
}
|
|
22950
|
+
setFilters(next);
|
|
22951
|
+
};
|
|
22952
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(FilterMenu, { id: "search-and-filter-options", children: filters.map((item, i) => {
|
|
22953
|
+
var _a, _b, _c, _d, _e, _f;
|
|
22954
|
+
const availableTypeOptions = (_b = (_a = filterOptions.find((fo) => {
|
|
22955
|
+
var _a2;
|
|
22956
|
+
return (_a2 = fo.options) == null ? void 0 : _a2.find((op) => op.value === item.field);
|
|
22957
|
+
})) == null ? void 0 : _a.options) != null ? _b : [];
|
|
22958
|
+
const possibleValueOptions = (_d = (_c = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _c.valueOptions) != null ? _d : [];
|
|
22959
|
+
const possibleOperators = (_f = (_e = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _e.operatorOptions) != null ? _f : [];
|
|
22960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
22961
|
+
FilterItem,
|
|
22962
|
+
{
|
|
22963
|
+
index: i,
|
|
22964
|
+
paramOptions: filterOptions,
|
|
22965
|
+
onParamChange: (e) => handleUpdateFilter(i, "field", e),
|
|
22966
|
+
operatorOptions: possibleOperators,
|
|
22967
|
+
onOperatorChange: (e) => handleUpdateFilter(i, "operator", e),
|
|
22968
|
+
onValueChange: (e) => handleUpdateFilter(i, "value", e),
|
|
22969
|
+
valueOptions: possibleValueOptions
|
|
22970
|
+
},
|
|
22971
|
+
i
|
|
22972
|
+
);
|
|
22973
|
+
}) });
|
|
22974
|
+
};
|
|
22975
|
+
|
|
22976
|
+
// src/components/SearchAndFilter/SearchAndFilter.tsx
|
|
22977
|
+
init_emotion_jsx_shim();
|
|
22978
|
+
var import_jsx_runtime124 = require("@emotion/react/jsx-runtime");
|
|
22979
|
+
var SearchAndFilter = ({
|
|
22980
|
+
filters,
|
|
22981
|
+
filterOptions,
|
|
22982
|
+
filterControls = /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(FilterControls, {}),
|
|
22983
|
+
children = /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(FilterItems, {}),
|
|
22984
|
+
onChange
|
|
22985
|
+
}) => {
|
|
22986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(SearchAndFilterProvider, { filters, filterOptions, onChange, children: /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(VerticalRhythm, { css: SearchAndFilterContainer, "data-testid": "search-and-filter", children: [
|
|
22987
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("div", { css: SearchAndFilterControlsWrapper, children: filterControls }),
|
|
22988
|
+
children
|
|
22989
|
+
] }) });
|
|
22990
|
+
};
|
|
22991
|
+
|
|
22992
|
+
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
22993
|
+
init_emotion_jsx_shim();
|
|
22994
|
+
var import_react144 = require("@emotion/react");
|
|
22995
|
+
var import_CgCheck5 = require("@react-icons/all-files/cg/CgCheck");
|
|
22996
|
+
var import_react145 = require("react");
|
|
22997
|
+
|
|
22998
|
+
// src/components/SegmentedControl/SegmentedControl.styles.ts
|
|
22999
|
+
init_emotion_jsx_shim();
|
|
23000
|
+
var import_react143 = require("@emotion/react");
|
|
23001
|
+
var segmentedControlStyles = import_react143.css`
|
|
23002
|
+
--segmented-control-rounded-value: var(--rounded-base);
|
|
23003
|
+
--segmented-control-border-width: 1px;
|
|
23004
|
+
--segmented-control-selected-color: var(--brand-secondary-3);
|
|
23005
|
+
--segmented-control-first-border-radius: var(--segmented-control-rounded-value) 0 0
|
|
23006
|
+
var(--segmented-control-rounded-value);
|
|
23007
|
+
--segmented-control-last-border-radius: 0 var(--segmented-control-rounded-value)
|
|
23008
|
+
var(--segmented-control-rounded-value) 0;
|
|
23009
|
+
|
|
23010
|
+
position: relative;
|
|
23011
|
+
display: flex;
|
|
23012
|
+
justify-content: flex-start;
|
|
23013
|
+
width: fit-content;
|
|
23014
|
+
background-color: var(--gray-300);
|
|
23015
|
+
padding: var(--segmented-control-border-width);
|
|
23016
|
+
gap: var(--segmented-control-border-width);
|
|
23017
|
+
border-radius: calc(var(--segmented-control-rounded-value) + var(--segmented-control-border-width));
|
|
23018
|
+
font-size: var(--fs-xs);
|
|
23019
|
+
`;
|
|
23020
|
+
var segmentedControlVerticalStyles = import_react143.css`
|
|
23021
|
+
flex-direction: column;
|
|
23022
|
+
--segmented-control-first-border-radius: var(--segmented-control-rounded-value)
|
|
23023
|
+
var(--segmented-control-rounded-value) 0 0;
|
|
23024
|
+
--segmented-control-last-border-radius: 0 0 var(--segmented-control-rounded-value)
|
|
23025
|
+
var(--segmented-control-rounded-value);
|
|
23026
|
+
`;
|
|
23027
|
+
var segmentedControlItemStyles = import_react143.css`
|
|
23028
|
+
&:first-of-type label {
|
|
23029
|
+
border-radius: var(--segmented-control-first-border-radius);
|
|
23030
|
+
}
|
|
23031
|
+
&:last-of-type label {
|
|
23032
|
+
border-radius: var(--segmented-control-last-border-radius);
|
|
23033
|
+
}
|
|
23034
|
+
`;
|
|
23035
|
+
var segmentedControlInputStyles = import_react143.css`
|
|
23036
|
+
${accessibleHidden}
|
|
23037
|
+
`;
|
|
23038
|
+
var segmentedControlLabelStyles = (checked, disabled2) => import_react143.css`
|
|
23039
|
+
position: relative;
|
|
23040
|
+
display: flex;
|
|
23041
|
+
align-items: center;
|
|
23042
|
+
justify-content: center;
|
|
23043
|
+
height: 2rem;
|
|
23044
|
+
padding-inline: var(--spacing-base);
|
|
23045
|
+
background-color: white;
|
|
23046
|
+
transition-property: background-color, color, box-shadow;
|
|
23047
|
+
transition-duration: var(--duration-xfast);
|
|
23048
|
+
transition-timing-function: ease-in-out;
|
|
23049
|
+
z-index: 1;
|
|
23050
|
+
cursor: pointer;
|
|
23051
|
+
|
|
23052
|
+
&:has(:checked:not(:disabled)) {
|
|
23053
|
+
background-color: var(--segmented-control-selected-color);
|
|
23054
|
+
outline: var(--segmented-control-border-width) solid var(--segmented-control-selected-color);
|
|
23055
|
+
box-shadow: 0 0.43em 1.7em 0 rgba(0, 0, 0, 0.15);
|
|
23056
|
+
color: white;
|
|
23057
|
+
-webkit-text-stroke-width: thin;
|
|
23058
|
+
z-index: 0;
|
|
23059
|
+
}
|
|
23060
|
+
|
|
23061
|
+
&:hover:not(:has(:disabled, :checked)) {
|
|
23062
|
+
background-color: var(--gray-100);
|
|
23063
|
+
}
|
|
23064
|
+
|
|
23065
|
+
&:has(:disabled) {
|
|
23066
|
+
color: var(--gray-400);
|
|
23067
|
+
cursor: default;
|
|
23068
|
+
}
|
|
23069
|
+
|
|
23070
|
+
&:has(:checked:disabled) {
|
|
23071
|
+
color: var(--gray-50);
|
|
23072
|
+
background-color: var(--gray-400);
|
|
23073
|
+
}
|
|
23074
|
+
|
|
23075
|
+
// Firefox fallback using emotion variables
|
|
23076
|
+
// we can delete this whole block of code and variables in SegmentedControl.tsx
|
|
23077
|
+
// once Firefox supports :has selector
|
|
23078
|
+
@supports not selector(:has(*)) {
|
|
23079
|
+
// equivalent to &:has(:checked:not(:disabled))
|
|
23080
|
+
${checked && !disabled2 ? `
|
|
23081
|
+
background-color: var(--segmented-control-selected-color);
|
|
23082
|
+
outline: var(--segmented-control-border-width) solid var(--segmented-control-selected-color);
|
|
23083
|
+
box-shadow: 0 0.43em 1.7em 0 rgba(0, 0, 0, 0.15);
|
|
23084
|
+
color: white;
|
|
23085
|
+
-webkit-text-stroke-width: thin;
|
|
23086
|
+
z-index: 0;` : void 0}
|
|
23087
|
+
|
|
23088
|
+
// equivalent to &:hover:not(:has(:disabled, :checked))
|
|
23089
|
+
&:hover {
|
|
23090
|
+
${!checked && !disabled2 ? `background-color: var(--gray-100);` : void 0}
|
|
23091
|
+
}
|
|
23092
|
+
|
|
23093
|
+
// equivalent to &:has(:disabled)
|
|
23094
|
+
${disabled2 ? `
|
|
23095
|
+
color: var(--gray-400);
|
|
23096
|
+
cursor: default;` : void 0}
|
|
23097
|
+
|
|
23098
|
+
// equivalent to &:has(:checked:disabled)
|
|
23099
|
+
${checked && disabled2 && `
|
|
23100
|
+
color: var(--gray-50);
|
|
23101
|
+
background-color: var(--gray-400);
|
|
23102
|
+
`}
|
|
23103
|
+
}
|
|
23104
|
+
`;
|
|
23105
|
+
var segmentedControlLabelIconOnlyStyles = import_react143.css`
|
|
23106
|
+
padding-inline: 0.5em;
|
|
23107
|
+
`;
|
|
23108
|
+
var segmentedControlLabelCheckStyles = import_react143.css`
|
|
23109
|
+
opacity: 0.5;
|
|
23110
|
+
`;
|
|
23111
|
+
var segmentedControlLabelContentStyles = import_react143.css`
|
|
23112
|
+
display: flex;
|
|
23113
|
+
align-items: center;
|
|
23114
|
+
justify-content: center;
|
|
23115
|
+
gap: var(--spacing-sm);
|
|
23116
|
+
height: 100%;
|
|
23117
|
+
`;
|
|
23118
|
+
var segmentedControlLabelTextStyles = import_react143.css``;
|
|
23119
|
+
|
|
23120
|
+
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
23121
|
+
var import_jsx_runtime125 = require("@emotion/react/jsx-runtime");
|
|
23122
|
+
var SegmentedControl = ({
|
|
23123
|
+
name,
|
|
23124
|
+
options,
|
|
23125
|
+
value,
|
|
23126
|
+
onChange,
|
|
23127
|
+
noCheckmark = false,
|
|
23128
|
+
disabled: disabled2 = false,
|
|
23129
|
+
orientation = "horizontal",
|
|
22003
23130
|
size = "md",
|
|
22004
23131
|
...props
|
|
22005
23132
|
}) => {
|
|
22006
|
-
const onOptionChange = (0,
|
|
23133
|
+
const onOptionChange = (0, import_react145.useCallback)(
|
|
22007
23134
|
(event) => {
|
|
22008
23135
|
if (event.target.checked) {
|
|
22009
23136
|
onChange == null ? void 0 : onChange(options[parseInt(event.target.value)].value);
|
|
@@ -22011,18 +23138,18 @@ var SegmentedControl = ({
|
|
|
22011
23138
|
},
|
|
22012
23139
|
[options, onChange]
|
|
22013
23140
|
);
|
|
22014
|
-
const sizeStyles = (0,
|
|
23141
|
+
const sizeStyles = (0, import_react145.useMemo)(() => {
|
|
22015
23142
|
const map = {
|
|
22016
|
-
sm: (0,
|
|
22017
|
-
md: (0,
|
|
22018
|
-
lg: (0,
|
|
23143
|
+
sm: (0, import_react144.css)({ height: "calc(24px - 2px)", fontSize: "var(--fs-xs)" }),
|
|
23144
|
+
md: (0, import_react144.css)({ height: "calc(32px - 2px)", fontSize: "var(--fs-sm)" }),
|
|
23145
|
+
lg: (0, import_react144.css)({ height: "calc(40px - 2px)", fontSize: "var(--fs-base)" })
|
|
22019
23146
|
};
|
|
22020
23147
|
return map[size];
|
|
22021
23148
|
}, [size]);
|
|
22022
|
-
const isIconOnly = (0,
|
|
23149
|
+
const isIconOnly = (0, import_react145.useMemo)(() => {
|
|
22023
23150
|
return options.every((option) => option && option.icon && !option.label);
|
|
22024
23151
|
}, [options]);
|
|
22025
|
-
return /* @__PURE__ */ (0,
|
|
23152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
22026
23153
|
"div",
|
|
22027
23154
|
{
|
|
22028
23155
|
css: [segmentedControlStyles, orientation === "vertical" ? segmentedControlVerticalStyles : void 0],
|
|
@@ -22034,7 +23161,7 @@ var SegmentedControl = ({
|
|
|
22034
23161
|
}
|
|
22035
23162
|
const text = option.label ? option.label : option.icon ? null : String(option.value);
|
|
22036
23163
|
const isDisabled = disabled2 || option.disabled;
|
|
22037
|
-
return /* @__PURE__ */ (0,
|
|
23164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Tooltip, { title: (_a = option.tooltip) != null ? _a : "", children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("div", { css: segmentedControlItemStyles, "data-testid": "container-segmented-control", children: /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)(
|
|
22038
23165
|
"label",
|
|
22039
23166
|
{
|
|
22040
23167
|
css: [
|
|
@@ -22043,7 +23170,7 @@ var SegmentedControl = ({
|
|
|
22043
23170
|
isIconOnly ? segmentedControlLabelIconOnlyStyles : void 0
|
|
22044
23171
|
],
|
|
22045
23172
|
children: [
|
|
22046
|
-
/* @__PURE__ */ (0,
|
|
23173
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
|
|
22047
23174
|
"input",
|
|
22048
23175
|
{
|
|
22049
23176
|
css: segmentedControlInputStyles,
|
|
@@ -22055,10 +23182,10 @@ var SegmentedControl = ({
|
|
|
22055
23182
|
disabled: isDisabled
|
|
22056
23183
|
}
|
|
22057
23184
|
),
|
|
22058
|
-
option.value !== value || noCheckmark ? null : /* @__PURE__ */ (0,
|
|
22059
|
-
/* @__PURE__ */ (0,
|
|
22060
|
-
!option.icon ? null : /* @__PURE__ */ (0,
|
|
22061
|
-
!text ? null : /* @__PURE__ */ (0,
|
|
23185
|
+
option.value !== value || noCheckmark ? null : /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_CgCheck5.CgCheck, { css: segmentedControlLabelCheckStyles, "aria-label": "Selected", size: "1.5em" }),
|
|
23186
|
+
/* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("span", { css: segmentedControlLabelContentStyles, children: [
|
|
23187
|
+
!option.icon ? null : /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(Icon, { icon: option.icon, size: "1.5em", iconColor: "currentColor" }),
|
|
23188
|
+
!text ? null : /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("span", { css: segmentedControlLabelTextStyles, children: text })
|
|
22062
23189
|
] })
|
|
22063
23190
|
]
|
|
22064
23191
|
}
|
|
@@ -22073,18 +23200,18 @@ init_emotion_jsx_shim();
|
|
|
22073
23200
|
|
|
22074
23201
|
// src/components/Skeleton/Skeleton.styles.ts
|
|
22075
23202
|
init_emotion_jsx_shim();
|
|
22076
|
-
var
|
|
22077
|
-
var lightFadingOut =
|
|
23203
|
+
var import_react146 = require("@emotion/react");
|
|
23204
|
+
var lightFadingOut = import_react146.keyframes`
|
|
22078
23205
|
from { opacity: 0.1; }
|
|
22079
23206
|
to { opacity: 0.025; }
|
|
22080
23207
|
`;
|
|
22081
|
-
var skeletonStyles =
|
|
23208
|
+
var skeletonStyles = import_react146.css`
|
|
22082
23209
|
animation: ${lightFadingOut} 1s ease-out infinite alternate;
|
|
22083
23210
|
background-color: var(--gray-900);
|
|
22084
23211
|
`;
|
|
22085
23212
|
|
|
22086
23213
|
// src/components/Skeleton/Skeleton.tsx
|
|
22087
|
-
var
|
|
23214
|
+
var import_jsx_runtime126 = require("@emotion/react/jsx-runtime");
|
|
22088
23215
|
var Skeleton = ({
|
|
22089
23216
|
width = "100%",
|
|
22090
23217
|
height = "1.25rem",
|
|
@@ -22092,7 +23219,7 @@ var Skeleton = ({
|
|
|
22092
23219
|
circle = false,
|
|
22093
23220
|
children,
|
|
22094
23221
|
...otherProps
|
|
22095
|
-
}) => /* @__PURE__ */ (0,
|
|
23222
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
22096
23223
|
"div",
|
|
22097
23224
|
{
|
|
22098
23225
|
css: [
|
|
@@ -22117,8 +23244,8 @@ var React24 = __toESM(require("react"));
|
|
|
22117
23244
|
|
|
22118
23245
|
// src/components/Switch/Switch.styles.ts
|
|
22119
23246
|
init_emotion_jsx_shim();
|
|
22120
|
-
var
|
|
22121
|
-
var SwitchInputContainer =
|
|
23247
|
+
var import_react147 = require("@emotion/react");
|
|
23248
|
+
var SwitchInputContainer = import_react147.css`
|
|
22122
23249
|
cursor: pointer;
|
|
22123
23250
|
display: inline-block;
|
|
22124
23251
|
position: relative;
|
|
@@ -22127,7 +23254,7 @@ var SwitchInputContainer = import_react142.css`
|
|
|
22127
23254
|
vertical-align: middle;
|
|
22128
23255
|
user-select: none;
|
|
22129
23256
|
`;
|
|
22130
|
-
var SwitchInput =
|
|
23257
|
+
var SwitchInput = import_react147.css`
|
|
22131
23258
|
appearance: none;
|
|
22132
23259
|
border-radius: var(--rounded-full);
|
|
22133
23260
|
background-color: var(--white);
|
|
@@ -22165,7 +23292,7 @@ var SwitchInput = import_react142.css`
|
|
|
22165
23292
|
cursor: not-allowed;
|
|
22166
23293
|
}
|
|
22167
23294
|
`;
|
|
22168
|
-
var SwitchInputDisabled =
|
|
23295
|
+
var SwitchInputDisabled = import_react147.css`
|
|
22169
23296
|
opacity: var(--opacity-50);
|
|
22170
23297
|
cursor: not-allowed;
|
|
22171
23298
|
|
|
@@ -22173,7 +23300,7 @@ var SwitchInputDisabled = import_react142.css`
|
|
|
22173
23300
|
cursor: not-allowed;
|
|
22174
23301
|
}
|
|
22175
23302
|
`;
|
|
22176
|
-
var SwitchInputLabel =
|
|
23303
|
+
var SwitchInputLabel = import_react147.css`
|
|
22177
23304
|
align-items: center;
|
|
22178
23305
|
color: var(--typography-base);
|
|
22179
23306
|
display: inline-flex;
|
|
@@ -22194,26 +23321,26 @@ var SwitchInputLabel = import_react142.css`
|
|
|
22194
23321
|
top: 0;
|
|
22195
23322
|
}
|
|
22196
23323
|
`;
|
|
22197
|
-
var SwitchText =
|
|
23324
|
+
var SwitchText = import_react147.css`
|
|
22198
23325
|
color: var(--gray-500);
|
|
22199
23326
|
font-size: var(--fs-sm);
|
|
22200
23327
|
padding-inline: var(--spacing-2xl) 0;
|
|
22201
23328
|
`;
|
|
22202
23329
|
|
|
22203
23330
|
// src/components/Switch/Switch.tsx
|
|
22204
|
-
var
|
|
23331
|
+
var import_jsx_runtime127 = require("@emotion/react/jsx-runtime");
|
|
22205
23332
|
var Switch = React24.forwardRef(
|
|
22206
23333
|
({ label, infoText, toggleText, children, ...inputProps }, ref) => {
|
|
22207
23334
|
let additionalText = infoText;
|
|
22208
23335
|
if (infoText && toggleText) {
|
|
22209
23336
|
additionalText = inputProps.checked ? toggleText : infoText;
|
|
22210
23337
|
}
|
|
22211
|
-
return /* @__PURE__ */ (0,
|
|
22212
|
-
/* @__PURE__ */ (0,
|
|
22213
|
-
/* @__PURE__ */ (0,
|
|
22214
|
-
/* @__PURE__ */ (0,
|
|
23338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
|
|
23339
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("label", { css: [SwitchInputContainer, inputProps.disabled ? SwitchInputDisabled : void 0], children: [
|
|
23340
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("input", { type: "checkbox", css: SwitchInput, ...inputProps, ref }),
|
|
23341
|
+
/* @__PURE__ */ (0, import_jsx_runtime127.jsx)("span", { css: SwitchInputLabel, children: label })
|
|
22215
23342
|
] }),
|
|
22216
|
-
additionalText ? /* @__PURE__ */ (0,
|
|
23343
|
+
additionalText ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("p", { css: SwitchText, children: additionalText }) : null,
|
|
22217
23344
|
children
|
|
22218
23345
|
] });
|
|
22219
23346
|
}
|
|
@@ -22225,8 +23352,8 @@ var React25 = __toESM(require("react"));
|
|
|
22225
23352
|
|
|
22226
23353
|
// src/components/Table/Table.styles.ts
|
|
22227
23354
|
init_emotion_jsx_shim();
|
|
22228
|
-
var
|
|
22229
|
-
var table = ({ cellPadding = "var(--spacing-base) var(--spacing-md)" }) =>
|
|
23355
|
+
var import_react148 = require("@emotion/react");
|
|
23356
|
+
var table = ({ cellPadding = "var(--spacing-base) var(--spacing-md)" }) => import_react148.css`
|
|
22230
23357
|
border-bottom: 1px solid var(--gray-400);
|
|
22231
23358
|
border-collapse: collapse;
|
|
22232
23359
|
min-width: 100%;
|
|
@@ -22237,67 +23364,67 @@ var table = ({ cellPadding = "var(--spacing-base) var(--spacing-md)" }) => impor
|
|
|
22237
23364
|
padding: ${cellPadding};
|
|
22238
23365
|
}
|
|
22239
23366
|
`;
|
|
22240
|
-
var tableHead =
|
|
23367
|
+
var tableHead = import_react148.css`
|
|
22241
23368
|
background: var(--gray-100);
|
|
22242
23369
|
color: var(--typography-base);
|
|
22243
23370
|
text-align: left;
|
|
22244
23371
|
`;
|
|
22245
|
-
var tableRow =
|
|
23372
|
+
var tableRow = import_react148.css`
|
|
22246
23373
|
border-bottom: 1px solid var(--gray-200);
|
|
22247
23374
|
`;
|
|
22248
|
-
var tableCellHead =
|
|
23375
|
+
var tableCellHead = import_react148.css`
|
|
22249
23376
|
font-size: var(--fs-sm);
|
|
22250
23377
|
text-transform: uppercase;
|
|
22251
23378
|
font-weight: var(--fw-bold);
|
|
22252
23379
|
`;
|
|
22253
23380
|
|
|
22254
23381
|
// src/components/Table/Table.tsx
|
|
22255
|
-
var
|
|
23382
|
+
var import_jsx_runtime128 = require("@emotion/react/jsx-runtime");
|
|
22256
23383
|
var Table = React25.forwardRef(
|
|
22257
23384
|
({ children, cellPadding, ...otherProps }, ref) => {
|
|
22258
|
-
return /* @__PURE__ */ (0,
|
|
23385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("table", { ref, css: table({ cellPadding }), ...otherProps, children });
|
|
22259
23386
|
}
|
|
22260
23387
|
);
|
|
22261
23388
|
var TableHead = React25.forwardRef(
|
|
22262
23389
|
({ children, ...otherProps }, ref) => {
|
|
22263
|
-
return /* @__PURE__ */ (0,
|
|
23390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("thead", { ref, css: tableHead, ...otherProps, children });
|
|
22264
23391
|
}
|
|
22265
23392
|
);
|
|
22266
23393
|
var TableBody = React25.forwardRef(
|
|
22267
23394
|
({ children, ...otherProps }, ref) => {
|
|
22268
|
-
return /* @__PURE__ */ (0,
|
|
23395
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("tbody", { ref, ...otherProps, children });
|
|
22269
23396
|
}
|
|
22270
23397
|
);
|
|
22271
23398
|
var TableFoot = React25.forwardRef(
|
|
22272
23399
|
({ children, ...otherProps }, ref) => {
|
|
22273
|
-
return /* @__PURE__ */ (0,
|
|
23400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("tfoot", { ref, ...otherProps, children });
|
|
22274
23401
|
}
|
|
22275
23402
|
);
|
|
22276
23403
|
var TableRow = React25.forwardRef(
|
|
22277
23404
|
({ children, ...otherProps }, ref) => {
|
|
22278
|
-
return /* @__PURE__ */ (0,
|
|
23405
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("tr", { ref, css: tableRow, ...otherProps, children });
|
|
22279
23406
|
}
|
|
22280
23407
|
);
|
|
22281
23408
|
var TableCellHead = React25.forwardRef(
|
|
22282
23409
|
({ children, ...otherProps }, ref) => {
|
|
22283
|
-
return /* @__PURE__ */ (0,
|
|
23410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("th", { ref, css: tableCellHead, ...otherProps, children });
|
|
22284
23411
|
}
|
|
22285
23412
|
);
|
|
22286
23413
|
var TableCellData = React25.forwardRef(
|
|
22287
23414
|
({ children, ...otherProps }, ref) => {
|
|
22288
|
-
return /* @__PURE__ */ (0,
|
|
23415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("td", { ref, ...otherProps, children });
|
|
22289
23416
|
}
|
|
22290
23417
|
);
|
|
22291
23418
|
|
|
22292
23419
|
// src/components/Tabs/Tabs.tsx
|
|
22293
23420
|
init_emotion_jsx_shim();
|
|
22294
|
-
var
|
|
22295
|
-
var
|
|
23421
|
+
var import_react150 = require("@ariakit/react");
|
|
23422
|
+
var import_react151 = require("react");
|
|
22296
23423
|
|
|
22297
23424
|
// src/components/Tabs/Tabs.styles.ts
|
|
22298
23425
|
init_emotion_jsx_shim();
|
|
22299
|
-
var
|
|
22300
|
-
var tabButtonStyles =
|
|
23426
|
+
var import_react149 = require("@emotion/react");
|
|
23427
|
+
var tabButtonStyles = import_react149.css`
|
|
22301
23428
|
align-items: center;
|
|
22302
23429
|
border: 0;
|
|
22303
23430
|
height: 2.5rem;
|
|
@@ -22314,16 +23441,16 @@ var tabButtonStyles = import_react144.css`
|
|
|
22314
23441
|
box-shadow: inset 0 -2px 0 var(--brand-secondary-3);
|
|
22315
23442
|
}
|
|
22316
23443
|
`;
|
|
22317
|
-
var tabButtonGroupStyles =
|
|
23444
|
+
var tabButtonGroupStyles = import_react149.css`
|
|
22318
23445
|
display: flex;
|
|
22319
23446
|
gap: var(--spacing-base);
|
|
22320
23447
|
border-bottom: 1px solid var(--gray-300);
|
|
22321
23448
|
`;
|
|
22322
23449
|
|
|
22323
23450
|
// src/components/Tabs/Tabs.tsx
|
|
22324
|
-
var
|
|
23451
|
+
var import_jsx_runtime129 = require("@emotion/react/jsx-runtime");
|
|
22325
23452
|
var useCurrentTab = () => {
|
|
22326
|
-
const context = (0,
|
|
23453
|
+
const context = (0, import_react150.useTabStore)();
|
|
22327
23454
|
if (!context) {
|
|
22328
23455
|
throw new Error("This component can only be used inside <Tabs>");
|
|
22329
23456
|
}
|
|
@@ -22337,13 +23464,13 @@ var Tabs = ({
|
|
|
22337
23464
|
manual,
|
|
22338
23465
|
...props
|
|
22339
23466
|
}) => {
|
|
22340
|
-
const selected = (0,
|
|
23467
|
+
const selected = (0, import_react151.useMemo)(() => {
|
|
22341
23468
|
if (selectedId)
|
|
22342
23469
|
return selectedId;
|
|
22343
23470
|
return useHashForState && typeof window !== "undefined" && window.location.hash ? window.location.hash.substring(1) : void 0;
|
|
22344
23471
|
}, [selectedId, useHashForState]);
|
|
22345
|
-
const tab = (0,
|
|
22346
|
-
const onTabSelect = (0,
|
|
23472
|
+
const tab = (0, import_react150.useTabStore)({ ...props, selectOnMove: !manual, selectedId: selected });
|
|
23473
|
+
const onTabSelect = (0, import_react151.useCallback)(
|
|
22347
23474
|
(value) => {
|
|
22348
23475
|
const selectedValueWithoutNull = value != null ? value : void 0;
|
|
22349
23476
|
onSelectedIdChange == null ? void 0 : onSelectedIdChange(selectedValueWithoutNull);
|
|
@@ -22354,28 +23481,28 @@ var Tabs = ({
|
|
|
22354
23481
|
},
|
|
22355
23482
|
[onSelectedIdChange, useHashForState]
|
|
22356
23483
|
);
|
|
22357
|
-
(0,
|
|
23484
|
+
(0, import_react151.useEffect)(() => {
|
|
22358
23485
|
if (selected && selected !== tab.getState().activeId) {
|
|
22359
23486
|
tab.setSelectedId(selected);
|
|
22360
23487
|
}
|
|
22361
23488
|
}, [selected, tab]);
|
|
22362
|
-
return /* @__PURE__ */ (0,
|
|
23489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_react150.TabProvider, { store: tab, setSelectedId: onTabSelect, children });
|
|
22363
23490
|
};
|
|
22364
23491
|
var TabButtonGroup = ({ children, ...props }) => {
|
|
22365
|
-
return /* @__PURE__ */ (0,
|
|
23492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_react150.TabList, { ...props, css: tabButtonGroupStyles, children });
|
|
22366
23493
|
};
|
|
22367
23494
|
var TabButton = ({
|
|
22368
23495
|
children,
|
|
22369
23496
|
id,
|
|
22370
23497
|
...props
|
|
22371
23498
|
}) => {
|
|
22372
|
-
return /* @__PURE__ */ (0,
|
|
23499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_react150.Tab, { type: "button", id, ...props, css: tabButtonStyles, children });
|
|
22373
23500
|
};
|
|
22374
23501
|
var TabContent = ({
|
|
22375
23502
|
children,
|
|
22376
23503
|
...props
|
|
22377
23504
|
}) => {
|
|
22378
|
-
return /* @__PURE__ */ (0,
|
|
23505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_react150.TabPanel, { ...props, children });
|
|
22379
23506
|
};
|
|
22380
23507
|
|
|
22381
23508
|
// src/components/Toast/Toast.tsx
|
|
@@ -22384,8 +23511,8 @@ var import_react_toastify = require("react-toastify");
|
|
|
22384
23511
|
|
|
22385
23512
|
// src/components/Toast/Toast.styles.ts
|
|
22386
23513
|
init_emotion_jsx_shim();
|
|
22387
|
-
var
|
|
22388
|
-
var toastContainerStyles =
|
|
23514
|
+
var import_react152 = require("@emotion/react");
|
|
23515
|
+
var toastContainerStyles = import_react152.css`
|
|
22389
23516
|
${functionalColors}
|
|
22390
23517
|
|
|
22391
23518
|
--toastify-color-light: white;
|
|
@@ -22608,9 +23735,9 @@ var toastContainerStyles = import_react147.css`
|
|
|
22608
23735
|
`;
|
|
22609
23736
|
|
|
22610
23737
|
// src/components/Toast/Toast.tsx
|
|
22611
|
-
var
|
|
23738
|
+
var import_jsx_runtime130 = require("@emotion/react/jsx-runtime");
|
|
22612
23739
|
var ToastContainer = ({ limit = 4 }) => {
|
|
22613
|
-
return /* @__PURE__ */ (0,
|
|
23740
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
|
|
22614
23741
|
import_react_toastify.ToastContainer,
|
|
22615
23742
|
{
|
|
22616
23743
|
css: toastContainerStyles,
|
|
@@ -22622,116 +23749,6 @@ var ToastContainer = ({ limit = 4 }) => {
|
|
|
22622
23749
|
}
|
|
22623
23750
|
);
|
|
22624
23751
|
};
|
|
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
23752
|
// Annotate the CommonJS export names for ESM import in node:
|
|
22736
23753
|
0 && (module.exports = {
|
|
22737
23754
|
AddButton,
|
|
@@ -22743,6 +23760,7 @@ var StatusBullet = ({
|
|
|
22743
23760
|
Banner,
|
|
22744
23761
|
Button,
|
|
22745
23762
|
ButtonWithMenu,
|
|
23763
|
+
CHECKBOX_OPERATORS,
|
|
22746
23764
|
Calendar,
|
|
22747
23765
|
Callout,
|
|
22748
23766
|
Caption,
|
|
@@ -22756,6 +23774,7 @@ var StatusBullet = ({
|
|
|
22756
23774
|
Counter,
|
|
22757
23775
|
CreateTeamIntegrationTile,
|
|
22758
23776
|
CurrentDrawerContext,
|
|
23777
|
+
DATE_OPERATORS,
|
|
22759
23778
|
DashedBox,
|
|
22760
23779
|
DateTimePicker,
|
|
22761
23780
|
DateTimePickerVariant,
|
|
@@ -22769,6 +23788,11 @@ var StatusBullet = ({
|
|
|
22769
23788
|
EditTeamIntegrationTile,
|
|
22770
23789
|
ErrorMessage,
|
|
22771
23790
|
Fieldset,
|
|
23791
|
+
FilterButton,
|
|
23792
|
+
FilterControls,
|
|
23793
|
+
FilterItem,
|
|
23794
|
+
FilterItems,
|
|
23795
|
+
FilterMenu,
|
|
22772
23796
|
Heading,
|
|
22773
23797
|
HexModalBackground,
|
|
22774
23798
|
HorizontalRhythm,
|
|
@@ -22813,6 +23837,7 @@ var StatusBullet = ({
|
|
|
22813
23837
|
MenuItemSeparator,
|
|
22814
23838
|
Modal,
|
|
22815
23839
|
MultilineChip,
|
|
23840
|
+
NUMBER_OPERATORS,
|
|
22816
23841
|
PageHeaderSection,
|
|
22817
23842
|
Pagination,
|
|
22818
23843
|
Paragraph,
|
|
@@ -22845,11 +23870,17 @@ var StatusBullet = ({
|
|
|
22845
23870
|
ProgressBar,
|
|
22846
23871
|
ProgressList,
|
|
22847
23872
|
ProgressListItem,
|
|
23873
|
+
RICHTEXT_OPERATORS,
|
|
22848
23874
|
ResolveIcon,
|
|
22849
23875
|
RichTextToolbarIcon,
|
|
23876
|
+
SYSTEM_FIELD_OPERATORS,
|
|
22850
23877
|
ScrollableList,
|
|
22851
23878
|
ScrollableListInputItem,
|
|
22852
23879
|
ScrollableListItem,
|
|
23880
|
+
SearchAndFilter,
|
|
23881
|
+
SearchAndFilterContext,
|
|
23882
|
+
SearchAndFilterOptionsContainer,
|
|
23883
|
+
SearchAndFilterProvider,
|
|
22853
23884
|
SegmentedControl,
|
|
22854
23885
|
ShortcutContext,
|
|
22855
23886
|
ShortcutRevealer,
|
|
@@ -22858,6 +23889,7 @@ var StatusBullet = ({
|
|
|
22858
23889
|
SuccessMessage,
|
|
22859
23890
|
Switch,
|
|
22860
23891
|
TAKEOVER_STACK_ID,
|
|
23892
|
+
TEXTBOX_OPERATORS,
|
|
22861
23893
|
TabButton,
|
|
22862
23894
|
TabButtonGroup,
|
|
22863
23895
|
TabContent,
|
|
@@ -22959,6 +23991,7 @@ var StatusBullet = ({
|
|
|
22959
23991
|
useIconContext,
|
|
22960
23992
|
useOutsideClick,
|
|
22961
23993
|
useParameterShell,
|
|
23994
|
+
useSearchAndFilter,
|
|
22962
23995
|
useShortcut,
|
|
22963
23996
|
warningIcon,
|
|
22964
23997
|
yesNoIcon
|