@uniformdev/design-system 19.138.0 → 19.139.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 +338 -457
- package/dist/index.d.mts +72 -112
- package/dist/index.d.ts +72 -112
- package/dist/index.js +343 -465
- package/package.json +4 -4
package/dist/esm/index.js
CHANGED
|
@@ -13856,6 +13856,10 @@ function InputComboBox(props) {
|
|
|
13856
13856
|
},
|
|
13857
13857
|
'&:has([aria-readonly="true"])': {
|
|
13858
13858
|
background: "var(--gray-100)",
|
|
13859
|
+
'div[class^="input-combobox__multi-value__remove"]': {
|
|
13860
|
+
borderRight: "none",
|
|
13861
|
+
display: "none"
|
|
13862
|
+
},
|
|
13859
13863
|
"&:hover": {
|
|
13860
13864
|
borderColor: "var(--gray-300)"
|
|
13861
13865
|
},
|
|
@@ -13911,7 +13915,7 @@ function InputComboBox(props) {
|
|
|
13911
13915
|
color: "var(--typography-base)"
|
|
13912
13916
|
};
|
|
13913
13917
|
},
|
|
13914
|
-
multiValueRemove: (styles) => {
|
|
13918
|
+
multiValueRemove: (styles, state) => {
|
|
13915
13919
|
return {
|
|
13916
13920
|
...styles,
|
|
13917
13921
|
background: "var(--gray-100)",
|
|
@@ -13919,7 +13923,8 @@ function InputComboBox(props) {
|
|
|
13919
13923
|
color: "var(--white)",
|
|
13920
13924
|
background: "var(--action-destructive-default)",
|
|
13921
13925
|
transition: "color var(--duration-fast) var(--timing-ease-out), background-color var(--duration-fast) var(--timing-ease-out)"
|
|
13922
|
-
}
|
|
13926
|
+
},
|
|
13927
|
+
...state.isDisabled && { display: "none" }
|
|
13923
13928
|
};
|
|
13924
13929
|
}
|
|
13925
13930
|
}
|
|
@@ -20339,6 +20344,11 @@ var TEXTBOX_OPERATORS = [
|
|
|
20339
20344
|
value: "match",
|
|
20340
20345
|
editorType: "text"
|
|
20341
20346
|
},
|
|
20347
|
+
{
|
|
20348
|
+
label: "starts with...",
|
|
20349
|
+
value: "starts",
|
|
20350
|
+
editorType: "text"
|
|
20351
|
+
},
|
|
20342
20352
|
{
|
|
20343
20353
|
label: "is not...",
|
|
20344
20354
|
value: "neq",
|
|
@@ -20361,6 +20371,11 @@ var USER_OPERATORS = [
|
|
|
20361
20371
|
value: "match",
|
|
20362
20372
|
editorType: "text"
|
|
20363
20373
|
},
|
|
20374
|
+
{
|
|
20375
|
+
label: "starts with...",
|
|
20376
|
+
value: "starts",
|
|
20377
|
+
editorType: "text"
|
|
20378
|
+
},
|
|
20364
20379
|
{
|
|
20365
20380
|
label: "is not...",
|
|
20366
20381
|
value: "neq",
|
|
@@ -20415,6 +20430,11 @@ var RICHTEXT_OPERATORS = [
|
|
|
20415
20430
|
value: "match",
|
|
20416
20431
|
editorType: "text"
|
|
20417
20432
|
},
|
|
20433
|
+
{
|
|
20434
|
+
label: "starts with...",
|
|
20435
|
+
value: "starts",
|
|
20436
|
+
editorType: "text"
|
|
20437
|
+
},
|
|
20418
20438
|
{
|
|
20419
20439
|
label: "is not empty",
|
|
20420
20440
|
value: "def",
|
|
@@ -20692,22 +20712,6 @@ var SearchAndFilterButtonGroup = css92`
|
|
|
20692
20712
|
margin-top: var(--spacing-xs);
|
|
20693
20713
|
margin-left: calc(56px + var(--spacing-md));
|
|
20694
20714
|
`;
|
|
20695
|
-
var SortFilterWrapper = (hiddenLocaleInput) => css92`
|
|
20696
|
-
border-top: 1px solid var(--gray-300);
|
|
20697
|
-
align-items: center;
|
|
20698
|
-
display: grid;
|
|
20699
|
-
grid-template-columns: ${hiddenLocaleInput ? "1fr" : "1fr 200px"};
|
|
20700
|
-
gap: var(--spacing-xl);
|
|
20701
|
-
padding: var(--spacing-base) var(--spacing-md) 0;
|
|
20702
|
-
position: relative;
|
|
20703
|
-
z-index: 0;
|
|
20704
|
-
`;
|
|
20705
|
-
var SortFilterInputRow = css92`
|
|
20706
|
-
align-items: center;
|
|
20707
|
-
display: grid;
|
|
20708
|
-
grid-template-columns: 1fr auto;
|
|
20709
|
-
gap: var(--spacing-base);
|
|
20710
|
-
`;
|
|
20711
20715
|
|
|
20712
20716
|
// src/components/SearchAndFilter/FilterButton.tsx
|
|
20713
20717
|
import { jsx as jsx118, jsxs as jsxs80 } from "@emotion/react/jsx-runtime";
|
|
@@ -20886,6 +20890,7 @@ var FilterMultiChoiceEditor = ({
|
|
|
20886
20890
|
...props
|
|
20887
20891
|
}) => {
|
|
20888
20892
|
const readOnlyProps = readOnly ? readOnlyAttributes : {};
|
|
20893
|
+
const isClearable = !readOnly || !disabled2;
|
|
20889
20894
|
return /* @__PURE__ */ jsx120("div", { "data-testid": valueTestId, children: /* @__PURE__ */ jsx120(
|
|
20890
20895
|
InputComboBox,
|
|
20891
20896
|
{
|
|
@@ -20893,7 +20898,7 @@ var FilterMultiChoiceEditor = ({
|
|
|
20893
20898
|
placeholder: "Type to search...",
|
|
20894
20899
|
options,
|
|
20895
20900
|
isMulti: true,
|
|
20896
|
-
isClearable
|
|
20901
|
+
isClearable,
|
|
20897
20902
|
isDisabled: disabled2,
|
|
20898
20903
|
onChange: (e) => {
|
|
20899
20904
|
var _a;
|
|
@@ -21282,31 +21287,17 @@ var SearchAndFilterContext = createContext6({
|
|
|
21282
21287
|
},
|
|
21283
21288
|
handleDeleteFilter: () => {
|
|
21284
21289
|
},
|
|
21285
|
-
handleLocaleChange: () => {
|
|
21286
|
-
},
|
|
21287
|
-
setSortBy: () => {
|
|
21288
|
-
},
|
|
21289
|
-
sortByValue: "",
|
|
21290
21290
|
filterOptions: [],
|
|
21291
|
-
sortOptions: [],
|
|
21292
21291
|
validFilterQuery: [],
|
|
21293
21292
|
filterMapper: {},
|
|
21294
|
-
totalResults: 0
|
|
21295
|
-
localeOptions: [],
|
|
21296
|
-
localeValue: ""
|
|
21293
|
+
totalResults: 0
|
|
21297
21294
|
});
|
|
21298
21295
|
var SearchAndFilterProvider = ({
|
|
21299
21296
|
filters,
|
|
21300
21297
|
filterOptions,
|
|
21301
|
-
sortOptions,
|
|
21302
|
-
defaultSortByValue,
|
|
21303
|
-
defaultLocale = "",
|
|
21304
|
-
localeOptions,
|
|
21305
|
-
onLocaleChange,
|
|
21306
21298
|
filterVisible = false,
|
|
21307
21299
|
onSearchChange,
|
|
21308
21300
|
onChange,
|
|
21309
|
-
onSortChange,
|
|
21310
21301
|
resetFilterValues = [{ field: "", operator: "", value: "" }],
|
|
21311
21302
|
totalResults,
|
|
21312
21303
|
filterMapper: filterMapper2 = filterMapper,
|
|
@@ -21315,8 +21306,6 @@ var SearchAndFilterProvider = ({
|
|
|
21315
21306
|
const [searchTerm, setSearchTerm] = useState17("");
|
|
21316
21307
|
const deferredSearchTerm = useDeferredValue2(searchTerm);
|
|
21317
21308
|
const [filterVisibility, setFilterVisibility] = useState17(filterVisible);
|
|
21318
|
-
const [sortByValue, setSortByValue] = useState17(defaultSortByValue);
|
|
21319
|
-
const [localeValue, setLocale] = useState17(defaultLocale);
|
|
21320
21309
|
const handleSearchTerm = useCallback10(
|
|
21321
21310
|
(term) => {
|
|
21322
21311
|
setSearchTerm(term);
|
|
@@ -21324,21 +21313,7 @@ var SearchAndFilterProvider = ({
|
|
|
21324
21313
|
},
|
|
21325
21314
|
[setSearchTerm, onSearchChange]
|
|
21326
21315
|
);
|
|
21327
|
-
const
|
|
21328
|
-
(locale) => {
|
|
21329
|
-
setLocale(locale);
|
|
21330
|
-
onLocaleChange == null ? void 0 : onLocaleChange(locale);
|
|
21331
|
-
},
|
|
21332
|
-
[onLocaleChange]
|
|
21333
|
-
);
|
|
21334
|
-
const handleOnSortChange = useCallback10(
|
|
21335
|
-
(sort) => {
|
|
21336
|
-
setSortByValue(sort);
|
|
21337
|
-
onSortChange(sort);
|
|
21338
|
-
},
|
|
21339
|
-
[onSortChange]
|
|
21340
|
-
);
|
|
21341
|
-
const handleToggleFilterVisibilty = useCallback10(
|
|
21316
|
+
const handleToggleFilterVisibility = useCallback10(
|
|
21342
21317
|
(visible) => setFilterVisibility(visible),
|
|
21343
21318
|
[setFilterVisibility]
|
|
21344
21319
|
);
|
|
@@ -21380,22 +21355,16 @@ var SearchAndFilterProvider = ({
|
|
|
21380
21355
|
value: {
|
|
21381
21356
|
searchTerm: deferredSearchTerm,
|
|
21382
21357
|
setSearchTerm: (e) => handleSearchTerm(e),
|
|
21383
|
-
setSortBy: (e) => handleOnSortChange(e),
|
|
21384
|
-
sortByValue,
|
|
21385
21358
|
filterVisibility,
|
|
21386
|
-
setFilterVisibility: (e) =>
|
|
21359
|
+
setFilterVisibility: (e) => handleToggleFilterVisibility(e),
|
|
21387
21360
|
filters,
|
|
21388
21361
|
setFilters: (e) => onChange(e),
|
|
21389
21362
|
handleAddFilter,
|
|
21390
21363
|
handleResetFilters,
|
|
21391
21364
|
handleDeleteFilter,
|
|
21392
21365
|
filterOptions,
|
|
21393
|
-
sortOptions,
|
|
21394
21366
|
validFilterQuery,
|
|
21395
21367
|
totalResults,
|
|
21396
|
-
localeOptions,
|
|
21397
|
-
localeValue,
|
|
21398
|
-
handleLocaleChange,
|
|
21399
21368
|
filterMapper: filterMapper2
|
|
21400
21369
|
},
|
|
21401
21370
|
children: /* @__PURE__ */ jsx121(VerticalRhythm, { children })
|
|
@@ -21457,14 +21426,14 @@ var FilterControls = ({
|
|
|
21457
21426
|
};
|
|
21458
21427
|
|
|
21459
21428
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
21460
|
-
import { useMemo as
|
|
21429
|
+
import { useMemo as useMemo7 } from "react";
|
|
21461
21430
|
|
|
21462
21431
|
// src/components/SearchAndFilter/FilterMenu.tsx
|
|
21463
21432
|
import React24, { useEffect as useEffect20 } from "react";
|
|
21464
21433
|
import { jsx as jsx123, jsxs as jsxs83 } from "@emotion/react/jsx-runtime";
|
|
21465
21434
|
var SearchAndFilterOptionsContainer2 = ({
|
|
21466
21435
|
buttonRow,
|
|
21467
|
-
|
|
21436
|
+
additionalFiltersContainer,
|
|
21468
21437
|
children
|
|
21469
21438
|
}) => {
|
|
21470
21439
|
return /* @__PURE__ */ jsxs83("div", { css: SearchAndFilterOptionsContainer, children: [
|
|
@@ -21479,14 +21448,14 @@ var SearchAndFilterOptionsContainer2 = ({
|
|
|
21479
21448
|
children: buttonRow
|
|
21480
21449
|
}
|
|
21481
21450
|
) : null,
|
|
21482
|
-
|
|
21451
|
+
additionalFiltersContainer ? /* @__PURE__ */ jsx123("div", { children: additionalFiltersContainer }) : null
|
|
21483
21452
|
] });
|
|
21484
21453
|
};
|
|
21485
21454
|
var FilterMenu = ({
|
|
21486
21455
|
id,
|
|
21487
21456
|
filterTitle = "Show results",
|
|
21488
21457
|
menuControls,
|
|
21489
|
-
|
|
21458
|
+
additionalFiltersContainer,
|
|
21490
21459
|
children,
|
|
21491
21460
|
dataTestId,
|
|
21492
21461
|
resetButtonText = "reset"
|
|
@@ -21499,334 +21468,36 @@ var FilterMenu = ({
|
|
|
21499
21468
|
(_a = innerMenuRef.current) == null ? void 0 : _a.focus();
|
|
21500
21469
|
}
|
|
21501
21470
|
}, [filterVisibility]);
|
|
21502
|
-
return /* @__PURE__ */ jsx123(VerticalRhythm, { gap: "sm", "aria-haspopup": "true", id, "data-testid": dataTestId, children: filterVisibility ? /* @__PURE__ */ jsxs83(
|
|
21503
|
-
|
|
21504
|
-
/* @__PURE__ */ jsx123("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }),
|
|
21505
|
-
(filters == null ? void 0 : filters.length) ? /* @__PURE__ */ jsx123(
|
|
21506
|
-
"button",
|
|
21507
|
-
{
|
|
21508
|
-
type: "button",
|
|
21509
|
-
css: ResetConditionsBtn,
|
|
21510
|
-
onClick: () => {
|
|
21511
|
-
handleResetFilters();
|
|
21512
|
-
setFilterVisibility(false);
|
|
21513
|
-
},
|
|
21514
|
-
"data-testid": "reset-filters",
|
|
21515
|
-
children: resetButtonText
|
|
21516
|
-
}
|
|
21517
|
-
) : null
|
|
21518
|
-
] }),
|
|
21519
|
-
children
|
|
21520
|
-
] }) : null });
|
|
21521
|
-
};
|
|
21522
|
-
|
|
21523
|
-
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
21524
|
-
import { css as css95 } from "@emotion/react";
|
|
21525
|
-
import { CgCheck as CgCheck4 } from "@react-icons/all-files/cg/CgCheck";
|
|
21526
|
-
import { useCallback as useCallback11, useMemo as useMemo7 } from "react";
|
|
21527
|
-
|
|
21528
|
-
// src/components/SegmentedControl/SegmentedControl.styles.ts
|
|
21529
|
-
import { css as css94 } from "@emotion/react";
|
|
21530
|
-
var segmentedControlStyles = css94`
|
|
21531
|
-
--segmented-control-rounded-value: var(--rounded-base);
|
|
21532
|
-
--segmented-control-border-width: 1px;
|
|
21533
|
-
--segmented-control-selected-color: var(--brand-secondary-3);
|
|
21534
|
-
--segmented-control-first-border-radius: var(--segmented-control-rounded-value) 0 0
|
|
21535
|
-
var(--segmented-control-rounded-value);
|
|
21536
|
-
--segmented-control-last-border-radius: 0 var(--segmented-control-rounded-value)
|
|
21537
|
-
var(--segmented-control-rounded-value) 0;
|
|
21538
|
-
|
|
21539
|
-
position: relative;
|
|
21540
|
-
display: flex;
|
|
21541
|
-
justify-content: flex-start;
|
|
21542
|
-
width: fit-content;
|
|
21543
|
-
background-color: var(--gray-300);
|
|
21544
|
-
padding: var(--segmented-control-border-width);
|
|
21545
|
-
gap: var(--segmented-control-border-width);
|
|
21546
|
-
border-radius: calc(var(--segmented-control-rounded-value) + var(--segmented-control-border-width));
|
|
21547
|
-
font-size: var(--fs-xs);
|
|
21548
|
-
`;
|
|
21549
|
-
var segmentedControlVerticalStyles = css94`
|
|
21550
|
-
flex-direction: column;
|
|
21551
|
-
--segmented-control-first-border-radius: var(--segmented-control-rounded-value)
|
|
21552
|
-
var(--segmented-control-rounded-value) 0 0;
|
|
21553
|
-
--segmented-control-last-border-radius: 0 0 var(--segmented-control-rounded-value)
|
|
21554
|
-
var(--segmented-control-rounded-value);
|
|
21555
|
-
`;
|
|
21556
|
-
var segmentedControlItemStyles = css94`
|
|
21557
|
-
&:first-of-type label {
|
|
21558
|
-
border-radius: var(--segmented-control-first-border-radius);
|
|
21559
|
-
}
|
|
21560
|
-
&:last-of-type label {
|
|
21561
|
-
border-radius: var(--segmented-control-last-border-radius);
|
|
21562
|
-
}
|
|
21563
|
-
`;
|
|
21564
|
-
var segmentedControlInputStyles = css94`
|
|
21565
|
-
${accessibleHidden}
|
|
21566
|
-
`;
|
|
21567
|
-
var segmentedControlLabelStyles = (checked, disabled2) => css94`
|
|
21568
|
-
position: relative;
|
|
21569
|
-
display: flex;
|
|
21570
|
-
align-items: center;
|
|
21571
|
-
justify-content: center;
|
|
21572
|
-
height: 2rem;
|
|
21573
|
-
padding-inline: var(--spacing-base);
|
|
21574
|
-
background-color: white;
|
|
21575
|
-
transition-property: background-color, color, box-shadow;
|
|
21576
|
-
transition-duration: var(--duration-xfast);
|
|
21577
|
-
transition-timing-function: ease-in-out;
|
|
21578
|
-
z-index: 1;
|
|
21579
|
-
cursor: pointer;
|
|
21580
|
-
|
|
21581
|
-
&:has(:checked:not(:disabled)) {
|
|
21582
|
-
background-color: var(--segmented-control-selected-color);
|
|
21583
|
-
outline: var(--segmented-control-border-width) solid var(--segmented-control-selected-color);
|
|
21584
|
-
box-shadow: 0 0.43em 1.7em 0 rgba(0, 0, 0, 0.15);
|
|
21585
|
-
color: white;
|
|
21586
|
-
-webkit-text-stroke-width: thin;
|
|
21587
|
-
z-index: 0;
|
|
21588
|
-
}
|
|
21589
|
-
|
|
21590
|
-
&:hover:not(:has(:disabled, :checked)) {
|
|
21591
|
-
background-color: var(--gray-100);
|
|
21592
|
-
}
|
|
21593
|
-
|
|
21594
|
-
&:has(:disabled) {
|
|
21595
|
-
color: var(--gray-400);
|
|
21596
|
-
cursor: default;
|
|
21597
|
-
}
|
|
21598
|
-
|
|
21599
|
-
&:has(:checked:disabled) {
|
|
21600
|
-
color: var(--gray-50);
|
|
21601
|
-
background-color: var(--gray-400);
|
|
21602
|
-
}
|
|
21603
|
-
|
|
21604
|
-
// Firefox fallback using emotion variables
|
|
21605
|
-
// we can delete this whole block of code and variables in SegmentedControl.tsx
|
|
21606
|
-
// once Firefox supports :has selector
|
|
21607
|
-
@supports not selector(:has(*)) {
|
|
21608
|
-
// equivalent to &:has(:checked:not(:disabled))
|
|
21609
|
-
${checked && !disabled2 ? `
|
|
21610
|
-
background-color: var(--segmented-control-selected-color);
|
|
21611
|
-
outline: var(--segmented-control-border-width) solid var(--segmented-control-selected-color);
|
|
21612
|
-
box-shadow: 0 0.43em 1.7em 0 rgba(0, 0, 0, 0.15);
|
|
21613
|
-
color: white;
|
|
21614
|
-
-webkit-text-stroke-width: thin;
|
|
21615
|
-
z-index: 0;` : void 0}
|
|
21616
|
-
|
|
21617
|
-
// equivalent to &:hover:not(:has(:disabled, :checked))
|
|
21618
|
-
&:hover {
|
|
21619
|
-
${!checked && !disabled2 ? `background-color: var(--gray-100);` : void 0}
|
|
21620
|
-
}
|
|
21621
|
-
|
|
21622
|
-
// equivalent to &:has(:disabled)
|
|
21623
|
-
${disabled2 ? `
|
|
21624
|
-
color: var(--gray-400);
|
|
21625
|
-
cursor: default;` : void 0}
|
|
21626
|
-
|
|
21627
|
-
// equivalent to &:has(:checked:disabled)
|
|
21628
|
-
${checked && disabled2 && `
|
|
21629
|
-
color: var(--gray-50);
|
|
21630
|
-
background-color: var(--gray-400);
|
|
21631
|
-
`}
|
|
21632
|
-
}
|
|
21633
|
-
`;
|
|
21634
|
-
var segmentedControlLabelIconOnlyStyles = css94`
|
|
21635
|
-
padding-inline: 0.5em;
|
|
21636
|
-
`;
|
|
21637
|
-
var segmentedControlLabelCheckStyles = css94`
|
|
21638
|
-
opacity: 0.5;
|
|
21639
|
-
`;
|
|
21640
|
-
var segmentedControlLabelContentStyles = css94`
|
|
21641
|
-
display: flex;
|
|
21642
|
-
align-items: center;
|
|
21643
|
-
justify-content: center;
|
|
21644
|
-
gap: var(--spacing-sm);
|
|
21645
|
-
height: 100%;
|
|
21646
|
-
`;
|
|
21647
|
-
var segmentedControlLabelTextStyles = css94``;
|
|
21648
|
-
|
|
21649
|
-
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
21650
|
-
import { jsx as jsx124, jsxs as jsxs84 } from "@emotion/react/jsx-runtime";
|
|
21651
|
-
var SegmentedControl = ({
|
|
21652
|
-
name,
|
|
21653
|
-
options,
|
|
21654
|
-
value,
|
|
21655
|
-
onChange,
|
|
21656
|
-
noCheckmark = false,
|
|
21657
|
-
disabled: disabled2 = false,
|
|
21658
|
-
orientation = "horizontal",
|
|
21659
|
-
size = "md",
|
|
21660
|
-
hideOptionText = false,
|
|
21661
|
-
iconSize = "1.5em",
|
|
21662
|
-
...props
|
|
21663
|
-
}) => {
|
|
21664
|
-
const onOptionChange = useCallback11(
|
|
21665
|
-
(event) => {
|
|
21666
|
-
if (event.target.checked) {
|
|
21667
|
-
onChange == null ? void 0 : onChange(options[parseInt(event.target.value)].value);
|
|
21668
|
-
}
|
|
21669
|
-
},
|
|
21670
|
-
[options, onChange]
|
|
21671
|
-
);
|
|
21672
|
-
const sizeStyles = useMemo7(() => {
|
|
21673
|
-
const map = {
|
|
21674
|
-
sm: css95({ height: "calc(24px - 2px)", fontSize: "var(--fs-xs)" }),
|
|
21675
|
-
md: css95({ height: "calc(32px - 2px)", fontSize: "var(--fs-sm)" }),
|
|
21676
|
-
lg: css95({ height: "calc(40px - 2px)", fontSize: "var(--fs-base)" }),
|
|
21677
|
-
xl: css95({ height: "calc(48px - 2px)", fontSize: "var(--fs-base)" })
|
|
21678
|
-
};
|
|
21679
|
-
return map[size];
|
|
21680
|
-
}, [size]);
|
|
21681
|
-
const isIconOnly = useMemo7(() => {
|
|
21682
|
-
return options.every((option) => option && option.icon && !option.label);
|
|
21683
|
-
}, [options]);
|
|
21684
|
-
return /* @__PURE__ */ jsx124(
|
|
21685
|
-
"div",
|
|
21471
|
+
return /* @__PURE__ */ jsx123(VerticalRhythm, { gap: "sm", "aria-haspopup": "true", id, "data-testid": dataTestId, children: filterVisibility ? /* @__PURE__ */ jsxs83(
|
|
21472
|
+
SearchAndFilterOptionsContainer2,
|
|
21686
21473
|
{
|
|
21687
|
-
|
|
21688
|
-
|
|
21689
|
-
|
|
21690
|
-
|
|
21691
|
-
|
|
21692
|
-
|
|
21693
|
-
|
|
21694
|
-
|
|
21695
|
-
|
|
21696
|
-
|
|
21697
|
-
|
|
21698
|
-
|
|
21699
|
-
|
|
21700
|
-
css: segmentedControlItemStyles,
|
|
21701
|
-
"data-testid": option["data-testid"] ? option["data-testid"] : "container-segmented-control",
|
|
21702
|
-
children: /* @__PURE__ */ jsxs84(
|
|
21703
|
-
"label",
|
|
21704
|
-
{
|
|
21705
|
-
css: [
|
|
21706
|
-
segmentedControlLabelStyles(option.value === value, isDisabled),
|
|
21707
|
-
sizeStyles,
|
|
21708
|
-
isIconOnly ? segmentedControlLabelIconOnlyStyles : void 0
|
|
21709
|
-
],
|
|
21710
|
-
children: [
|
|
21711
|
-
/* @__PURE__ */ jsx124(
|
|
21712
|
-
"input",
|
|
21713
|
-
{
|
|
21714
|
-
css: segmentedControlInputStyles,
|
|
21715
|
-
type: "radio",
|
|
21716
|
-
name,
|
|
21717
|
-
value: index,
|
|
21718
|
-
checked: option.value === value,
|
|
21719
|
-
onChange: onOptionChange,
|
|
21720
|
-
disabled: isDisabled
|
|
21721
|
-
}
|
|
21722
|
-
),
|
|
21723
|
-
option.value !== value || noCheckmark ? null : /* @__PURE__ */ jsx124(CgCheck4, { css: segmentedControlLabelCheckStyles, "aria-label": "Selected", size: "1.5em" }),
|
|
21724
|
-
/* @__PURE__ */ jsxs84("span", { css: segmentedControlLabelContentStyles, children: [
|
|
21725
|
-
!option.icon ? null : /* @__PURE__ */ jsx124(Icon, { icon: option.icon, size: iconSize, iconColor: "currentColor" }),
|
|
21726
|
-
!text || hideOptionText ? null : /* @__PURE__ */ jsx124("span", { css: segmentedControlLabelTextStyles, children: text })
|
|
21727
|
-
] })
|
|
21728
|
-
]
|
|
21729
|
-
}
|
|
21730
|
-
)
|
|
21731
|
-
}
|
|
21732
|
-
) }, JSON.stringify(option.value));
|
|
21733
|
-
})
|
|
21734
|
-
}
|
|
21735
|
-
);
|
|
21736
|
-
};
|
|
21737
|
-
|
|
21738
|
-
// src/components/SearchAndFilter/SortItems.tsx
|
|
21739
|
-
import { jsx as jsx125, jsxs as jsxs85 } from "@emotion/react/jsx-runtime";
|
|
21740
|
-
var SortItems = ({ sortByLabel = "Sort by", localeLabel = "Locale returned" }) => {
|
|
21741
|
-
var _a, _b;
|
|
21742
|
-
const { sortOptions, setSortBy, sortByValue, localeValue, localeOptions, handleLocaleChange } = useSearchAndFilter();
|
|
21743
|
-
const hideLocaleOptions = !localeOptions;
|
|
21744
|
-
const values = sortByValue.split("_");
|
|
21745
|
-
const sortDirection = values.pop();
|
|
21746
|
-
const sortField = values.join("_");
|
|
21747
|
-
const currentSelectedOption = (_b = (_a = sortOptions.find((item) => {
|
|
21748
|
-
var _a2;
|
|
21749
|
-
return (_a2 = item.options) == null ? void 0 : _a2.find((option) => option.value === sortField);
|
|
21750
|
-
})) == null ? void 0 : _a.options) == null ? void 0 : _b.find((nestedOption) => nestedOption.value === sortField);
|
|
21751
|
-
return /* @__PURE__ */ jsxs85("div", { css: [SortFilterWrapper(hideLocaleOptions)], "data-testid": "sorting-options", children: [
|
|
21752
|
-
/* @__PURE__ */ jsxs85(VerticalRhythm, { gap: "xs", children: [
|
|
21753
|
-
/* @__PURE__ */ jsx125("span", { css: Title, children: sortByLabel }),
|
|
21754
|
-
/* @__PURE__ */ jsxs85("div", { css: SortFilterInputRow, children: [
|
|
21755
|
-
/* @__PURE__ */ jsx125(
|
|
21756
|
-
InputComboBox,
|
|
21757
|
-
{
|
|
21758
|
-
id: "sort-by-field",
|
|
21759
|
-
"aria-label": "Sort by",
|
|
21760
|
-
options: sortOptions,
|
|
21761
|
-
onChange: (e) => {
|
|
21762
|
-
const fieldName = e == null ? void 0 : e.value;
|
|
21763
|
-
setSortBy(`${fieldName}_${sortDirection}`);
|
|
21764
|
-
},
|
|
21765
|
-
styles: {
|
|
21766
|
-
menu(base) {
|
|
21767
|
-
return {
|
|
21768
|
-
...base,
|
|
21769
|
-
minWidth: "max-content"
|
|
21770
|
-
};
|
|
21771
|
-
}
|
|
21772
|
-
},
|
|
21773
|
-
value: currentSelectedOption
|
|
21774
|
-
}
|
|
21775
|
-
),
|
|
21776
|
-
/* @__PURE__ */ jsx125(
|
|
21777
|
-
SegmentedControl,
|
|
21778
|
-
{
|
|
21779
|
-
noCheckmark: true,
|
|
21780
|
-
name: "sortBy",
|
|
21781
|
-
hideOptionText: true,
|
|
21782
|
-
iconSize: "1rem",
|
|
21783
|
-
size: "xl",
|
|
21784
|
-
options: [
|
|
21785
|
-
{
|
|
21786
|
-
label: "Ascending",
|
|
21787
|
-
icon: "arrow-up",
|
|
21788
|
-
value: `ASC`,
|
|
21789
|
-
tooltip: "Ascending (e.g. A-Z, newest to oldest)",
|
|
21790
|
-
"data-testid": "sort-ascending"
|
|
21474
|
+
buttonRow: menuControls,
|
|
21475
|
+
additionalFiltersContainer,
|
|
21476
|
+
children: [
|
|
21477
|
+
/* @__PURE__ */ jsxs83(HorizontalRhythm, { gap: "sm", align: "center", justify: "space-between", children: [
|
|
21478
|
+
/* @__PURE__ */ jsx123("span", { css: Title, ref: innerMenuRef, tabIndex: 0, children: filterTitle }),
|
|
21479
|
+
(filters == null ? void 0 : filters.length) ? /* @__PURE__ */ jsx123(
|
|
21480
|
+
"button",
|
|
21481
|
+
{
|
|
21482
|
+
type: "button",
|
|
21483
|
+
css: ResetConditionsBtn,
|
|
21484
|
+
onClick: () => {
|
|
21485
|
+
handleResetFilters();
|
|
21486
|
+
setFilterVisibility(false);
|
|
21791
21487
|
},
|
|
21792
|
-
|
|
21793
|
-
|
|
21794
|
-
|
|
21795
|
-
|
|
21796
|
-
|
|
21797
|
-
|
|
21798
|
-
|
|
21799
|
-
|
|
21800
|
-
|
|
21801
|
-
value: sortDirection
|
|
21802
|
-
}
|
|
21803
|
-
)
|
|
21804
|
-
] })
|
|
21805
|
-
] }),
|
|
21806
|
-
hideLocaleOptions ? null : /* @__PURE__ */ jsxs85(VerticalRhythm, { gap: "xs", children: [
|
|
21807
|
-
/* @__PURE__ */ jsx125("span", { css: Title, children: localeLabel }),
|
|
21808
|
-
/* @__PURE__ */ jsx125(
|
|
21809
|
-
InputSelect,
|
|
21810
|
-
{
|
|
21811
|
-
name: "localeReturned",
|
|
21812
|
-
"aria-label": "Locale returned",
|
|
21813
|
-
label: "Locale returned",
|
|
21814
|
-
showLabel: false,
|
|
21815
|
-
"data-testid": "context-locale",
|
|
21816
|
-
onChange: (e) => {
|
|
21817
|
-
var _a2;
|
|
21818
|
-
return handleLocaleChange((_a2 = e.currentTarget.value) != null ? _a2 : "");
|
|
21819
|
-
},
|
|
21820
|
-
options: localeOptions,
|
|
21821
|
-
value: localeValue
|
|
21822
|
-
}
|
|
21823
|
-
)
|
|
21824
|
-
] })
|
|
21825
|
-
] });
|
|
21488
|
+
"data-testid": "reset-filters",
|
|
21489
|
+
children: resetButtonText
|
|
21490
|
+
}
|
|
21491
|
+
) : null
|
|
21492
|
+
] }),
|
|
21493
|
+
children
|
|
21494
|
+
]
|
|
21495
|
+
}
|
|
21496
|
+
) : null });
|
|
21826
21497
|
};
|
|
21827
21498
|
|
|
21828
21499
|
// src/components/SearchAndFilter/FilterItem.tsx
|
|
21829
|
-
import { jsx as
|
|
21500
|
+
import { jsx as jsx124, jsxs as jsxs84 } from "@emotion/react/jsx-runtime";
|
|
21830
21501
|
var FilterItem = ({
|
|
21831
21502
|
index,
|
|
21832
21503
|
paramOptions,
|
|
@@ -21842,7 +21513,7 @@ var FilterItem = ({
|
|
|
21842
21513
|
const operatorLabel = filters[index].operator !== "" ? `operator ${filters[index].operator}` : "unknown operator";
|
|
21843
21514
|
const metaDataLabel = filters[index].value !== "" ? `value ${filters[index].value}` : "unknown value";
|
|
21844
21515
|
const metaDataPossibleOptions = (_b = (_a = operatorOptions.find((op) => filters[index].operator === op.value)) == null ? void 0 : _a.editorType) != null ? _b : "singleChoice";
|
|
21845
|
-
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } =
|
|
21516
|
+
const { selectedFieldValue, selectedOperatorValue, selectedMetaValue, readOnly, bindable } = useMemo7(() => {
|
|
21846
21517
|
var _a2;
|
|
21847
21518
|
const currentSelectedFilter = filterOptions.find((item) => {
|
|
21848
21519
|
var _a3;
|
|
@@ -21869,10 +21540,10 @@ var FilterItem = ({
|
|
|
21869
21540
|
menuIsOpen: false,
|
|
21870
21541
|
isClearable: false
|
|
21871
21542
|
} : {};
|
|
21872
|
-
return /* @__PURE__ */
|
|
21873
|
-
/* @__PURE__ */
|
|
21874
|
-
/* @__PURE__ */
|
|
21875
|
-
/* @__PURE__ */
|
|
21543
|
+
return /* @__PURE__ */ jsxs84("div", { css: ConditionalFilterRow, "data-testid": "filter-item", children: [
|
|
21544
|
+
/* @__PURE__ */ jsx124("span", { children: index === 0 ? "Where" : "and" }),
|
|
21545
|
+
/* @__PURE__ */ jsxs84("div", { css: ConditionalInputRow, children: [
|
|
21546
|
+
/* @__PURE__ */ jsx124(
|
|
21876
21547
|
InputComboBox,
|
|
21877
21548
|
{
|
|
21878
21549
|
"aria-label": label,
|
|
@@ -21899,7 +21570,7 @@ var FilterItem = ({
|
|
|
21899
21570
|
name: `filter-field-${index}`
|
|
21900
21571
|
}
|
|
21901
21572
|
),
|
|
21902
|
-
/* @__PURE__ */
|
|
21573
|
+
/* @__PURE__ */ jsx124(
|
|
21903
21574
|
InputComboBox,
|
|
21904
21575
|
{
|
|
21905
21576
|
"aria-label": operatorLabel,
|
|
@@ -21923,7 +21594,7 @@ var FilterItem = ({
|
|
|
21923
21594
|
name: `filter-operator-${index}`
|
|
21924
21595
|
}
|
|
21925
21596
|
),
|
|
21926
|
-
/* @__PURE__ */
|
|
21597
|
+
/* @__PURE__ */ jsx124(
|
|
21927
21598
|
FilterEditorRenderer,
|
|
21928
21599
|
{
|
|
21929
21600
|
"aria-label": metaDataLabel,
|
|
@@ -21937,7 +21608,7 @@ var FilterItem = ({
|
|
|
21937
21608
|
valueTestId: "filter-value"
|
|
21938
21609
|
}
|
|
21939
21610
|
),
|
|
21940
|
-
readOnly || index === 0 ? null : /* @__PURE__ */
|
|
21611
|
+
readOnly || index === 0 ? null : /* @__PURE__ */ jsx124(
|
|
21941
21612
|
"button",
|
|
21942
21613
|
{
|
|
21943
21614
|
type: "button",
|
|
@@ -21945,13 +21616,16 @@ var FilterItem = ({
|
|
|
21945
21616
|
"aria-label": "delete filter",
|
|
21946
21617
|
css: IconBtn,
|
|
21947
21618
|
"data-testid": "delete-filter",
|
|
21948
|
-
children: /* @__PURE__ */
|
|
21619
|
+
children: /* @__PURE__ */ jsx124(Icon, { icon: "trash", iconColor: "red", size: "1rem" })
|
|
21949
21620
|
}
|
|
21950
21621
|
)
|
|
21951
21622
|
] })
|
|
21952
21623
|
] });
|
|
21953
21624
|
};
|
|
21954
|
-
var FilterItems = ({
|
|
21625
|
+
var FilterItems = ({
|
|
21626
|
+
addButtonText = "add condition",
|
|
21627
|
+
additionalFiltersContainer
|
|
21628
|
+
}) => {
|
|
21955
21629
|
const { filterOptions, filters, setFilters, handleAddFilter } = useSearchAndFilter();
|
|
21956
21630
|
const handleUpdateFilter = (index, prop, value) => {
|
|
21957
21631
|
var _a, _b, _c, _d, _e;
|
|
@@ -21961,6 +21635,9 @@ var FilterItems = ({ addButtonText = "add condition" }) => {
|
|
|
21961
21635
|
if (["eq", "neq", "lt", "gt"].includes(value) && Array.isArray(next[index].value)) {
|
|
21962
21636
|
next[index].value = next[index].value[0];
|
|
21963
21637
|
}
|
|
21638
|
+
if (filters[index].operator === "ndef" || filters[index].operator === "def") {
|
|
21639
|
+
next[index].value = "";
|
|
21640
|
+
}
|
|
21964
21641
|
if (["between"].includes(value) && Array.isArray(next[index].value) === false) {
|
|
21965
21642
|
next[index].value = [next[index].value, ""];
|
|
21966
21643
|
}
|
|
@@ -21981,12 +21658,12 @@ var FilterItems = ({ addButtonText = "add condition" }) => {
|
|
|
21981
21658
|
}
|
|
21982
21659
|
setFilters(next);
|
|
21983
21660
|
};
|
|
21984
|
-
return /* @__PURE__ */
|
|
21661
|
+
return /* @__PURE__ */ jsx124(
|
|
21985
21662
|
FilterMenu,
|
|
21986
21663
|
{
|
|
21987
21664
|
id: "search-and-filter-options",
|
|
21988
21665
|
dataTestId: "search-and-filter-options",
|
|
21989
|
-
menuControls: /* @__PURE__ */
|
|
21666
|
+
menuControls: /* @__PURE__ */ jsxs84(
|
|
21990
21667
|
"button",
|
|
21991
21668
|
{
|
|
21992
21669
|
type: "button",
|
|
@@ -21994,12 +21671,12 @@ var FilterItems = ({ addButtonText = "add condition" }) => {
|
|
|
21994
21671
|
onClick: handleAddFilter,
|
|
21995
21672
|
"data-testid": "add-filter",
|
|
21996
21673
|
children: [
|
|
21997
|
-
/* @__PURE__ */
|
|
21674
|
+
/* @__PURE__ */ jsx124(Icon, { icon: "math-plus", iconColor: "currentColor", size: "1rem" }),
|
|
21998
21675
|
addButtonText
|
|
21999
21676
|
]
|
|
22000
21677
|
}
|
|
22001
21678
|
),
|
|
22002
|
-
|
|
21679
|
+
additionalFiltersContainer,
|
|
22003
21680
|
children: filters.map((item, i) => {
|
|
22004
21681
|
var _a, _b, _c, _d, _e, _f;
|
|
22005
21682
|
const availableTypeOptions = (_b = (_a = filterOptions.find((fo) => {
|
|
@@ -22008,7 +21685,7 @@ var FilterItems = ({ addButtonText = "add condition" }) => {
|
|
|
22008
21685
|
})) == null ? void 0 : _a.options) != null ? _b : [];
|
|
22009
21686
|
const possibleValueOptions = (_d = (_c = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _c.valueOptions) != null ? _d : [];
|
|
22010
21687
|
const possibleOperators = (_f = (_e = availableTypeOptions == null ? void 0 : availableTypeOptions.find((op) => op.value === item.field)) == null ? void 0 : _e.operatorOptions) != null ? _f : [];
|
|
22011
|
-
return /* @__PURE__ */
|
|
21688
|
+
return /* @__PURE__ */ jsx124(
|
|
22012
21689
|
FilterItem,
|
|
22013
21690
|
{
|
|
22014
21691
|
index: i,
|
|
@@ -22027,13 +21704,14 @@ var FilterItems = ({ addButtonText = "add condition" }) => {
|
|
|
22027
21704
|
};
|
|
22028
21705
|
|
|
22029
21706
|
// src/components/SearchAndFilter/SearchAndFilterResultContainer.tsx
|
|
22030
|
-
import { Fragment as Fragment21, jsx as
|
|
21707
|
+
import { Fragment as Fragment21, jsx as jsx125, jsxs as jsxs85 } from "@emotion/react/jsx-runtime";
|
|
22031
21708
|
var SearchAndFilterResultContainer = ({
|
|
22032
21709
|
buttonText,
|
|
22033
21710
|
clearButtonLabel = "clear",
|
|
22034
21711
|
calloutTitle: calloutTitle2,
|
|
22035
21712
|
calloutText,
|
|
22036
|
-
onHandleClear
|
|
21713
|
+
onHandleClear,
|
|
21714
|
+
hideClearButton
|
|
22037
21715
|
}) => {
|
|
22038
21716
|
const { searchTerm, setSearchTerm, totalResults, setFilters, filters } = useSearchAndFilter();
|
|
22039
21717
|
const automateCalloutTitle = () => {
|
|
@@ -22061,75 +21739,63 @@ var SearchAndFilterResultContainer = ({
|
|
|
22061
21739
|
if (totalResults && totalResults > 0) {
|
|
22062
21740
|
return null;
|
|
22063
21741
|
}
|
|
22064
|
-
return /* @__PURE__ */
|
|
22065
|
-
/* @__PURE__ */
|
|
22066
|
-
/* @__PURE__ */
|
|
21742
|
+
return /* @__PURE__ */ jsxs85(Fragment21, { children: [
|
|
21743
|
+
/* @__PURE__ */ jsxs85(HorizontalRhythm, { children: [
|
|
21744
|
+
/* @__PURE__ */ jsxs85("span", { children: [
|
|
22067
21745
|
totalResults,
|
|
22068
21746
|
" results ",
|
|
22069
21747
|
searchTerm ? `for "${searchTerm}"` : null
|
|
22070
21748
|
] }),
|
|
22071
|
-
!searchTerm ? null : /* @__PURE__ */
|
|
21749
|
+
!searchTerm || hideClearButton ? null : /* @__PURE__ */ jsx125(Button, { buttonType: "ghostDestructive", size: "zero", onClick: () => setSearchTerm(""), children: clearButtonLabel })
|
|
22072
21750
|
] }),
|
|
22073
|
-
totalResults === 0 ? /* @__PURE__ */
|
|
22074
|
-
calloutText ? /* @__PURE__ */
|
|
22075
|
-
/* @__PURE__ */
|
|
21751
|
+
totalResults === 0 ? /* @__PURE__ */ jsxs85(Callout, { title: calloutTitle2 != null ? calloutTitle2 : automateCalloutTitle(), type: "note", children: [
|
|
21752
|
+
calloutText ? /* @__PURE__ */ jsx125(Paragraph, { children: calloutText }) : null,
|
|
21753
|
+
hideClearButton ? null : /* @__PURE__ */ jsx125(Button, { buttonType: "tertiaryOutline", size: "xs", onClick: onHandleClear != null ? onHandleClear : handleResetFilters, children: buttonText != null ? buttonText : "Clear search" })
|
|
22076
21754
|
] }) : null
|
|
22077
21755
|
] });
|
|
22078
21756
|
};
|
|
22079
21757
|
|
|
22080
21758
|
// src/components/SearchAndFilter/SearchAndFilter.tsx
|
|
22081
|
-
import { jsx as
|
|
21759
|
+
import { jsx as jsx126, jsxs as jsxs86 } from "@emotion/react/jsx-runtime";
|
|
22082
21760
|
var SearchAndFilter = ({
|
|
22083
21761
|
filters,
|
|
22084
21762
|
filterOptions,
|
|
22085
21763
|
filterVisible,
|
|
22086
|
-
sortOptions,
|
|
22087
|
-
defaultSortByValue,
|
|
22088
21764
|
filterControls,
|
|
22089
21765
|
viewSwitchControls,
|
|
22090
|
-
resultsContainerView = /* @__PURE__ */
|
|
22091
|
-
children = /* @__PURE__ */ jsx128(FilterItems, {}),
|
|
21766
|
+
resultsContainerView = /* @__PURE__ */ jsx126(SearchAndFilterResultContainer, {}),
|
|
22092
21767
|
filterMapper: filterMapper2 = filterMapper,
|
|
21768
|
+
additionalFiltersContainer,
|
|
22093
21769
|
onChange,
|
|
22094
21770
|
onSearchChange,
|
|
22095
|
-
onSortChange,
|
|
22096
|
-
onLocaleChange,
|
|
22097
21771
|
totalResults,
|
|
22098
|
-
resetFilterValues = []
|
|
22099
|
-
defaultLocale,
|
|
22100
|
-
localeOptions
|
|
21772
|
+
resetFilterValues = []
|
|
22101
21773
|
}) => {
|
|
22102
|
-
return /* @__PURE__ */
|
|
21774
|
+
return /* @__PURE__ */ jsx126(
|
|
22103
21775
|
SearchAndFilterProvider,
|
|
22104
21776
|
{
|
|
22105
21777
|
filters,
|
|
22106
21778
|
filterOptions,
|
|
22107
21779
|
filterVisible,
|
|
22108
|
-
defaultSortByValue,
|
|
22109
|
-
sortOptions,
|
|
22110
21780
|
onChange,
|
|
22111
21781
|
onSearchChange,
|
|
22112
|
-
onSortChange,
|
|
22113
21782
|
totalResults,
|
|
22114
21783
|
resetFilterValues,
|
|
22115
|
-
defaultLocale,
|
|
22116
|
-
localeOptions,
|
|
22117
|
-
onLocaleChange,
|
|
22118
21784
|
filterMapper: filterMapper2,
|
|
22119
|
-
children: /* @__PURE__ */
|
|
22120
|
-
/* @__PURE__ */
|
|
22121
|
-
/* @__PURE__ */
|
|
21785
|
+
children: /* @__PURE__ */ jsxs86(VerticalRhythm, { css: SearchAndFilterContainer, "data-testid": "search-and-filter", children: [
|
|
21786
|
+
/* @__PURE__ */ jsxs86("div", { css: SearchAndFilterOutterControlWrapper(viewSwitchControls ? "1fr auto" : "1fr"), children: [
|
|
21787
|
+
/* @__PURE__ */ jsx126(
|
|
22122
21788
|
"div",
|
|
22123
21789
|
{
|
|
22124
21790
|
css: SearchAndFilterControlsWrapper(
|
|
22125
21791
|
viewSwitchControls ? "auto 1fr 0.05fr" : "auto auto 1fr"
|
|
22126
21792
|
),
|
|
22127
|
-
children: !filterControls ? /* @__PURE__ */
|
|
21793
|
+
children: !filterControls ? /* @__PURE__ */ jsx126(FilterControls, { hideSearchInput: !onSearchChange }) : filterControls
|
|
22128
21794
|
}
|
|
22129
21795
|
),
|
|
22130
21796
|
viewSwitchControls
|
|
22131
21797
|
] }),
|
|
22132
|
-
|
|
21798
|
+
/* @__PURE__ */ jsx126(FilterItems, { additionalFiltersContainer }),
|
|
22133
21799
|
resultsContainerView
|
|
22134
21800
|
] })
|
|
22135
21801
|
}
|
|
@@ -22139,7 +21805,7 @@ var SearchAndFilter = ({
|
|
|
22139
21805
|
// src/components/SearchAndFilter/SearchOnlyFilter.tsx
|
|
22140
21806
|
import { createContext as createContext7, useState as useState19 } from "react";
|
|
22141
21807
|
import { useDebounce as useDebounce4 } from "react-use";
|
|
22142
|
-
import { jsx as
|
|
21808
|
+
import { jsx as jsx127 } from "@emotion/react/jsx-runtime";
|
|
22143
21809
|
var SearchOnlyContext = createContext7({
|
|
22144
21810
|
searchTerm: "",
|
|
22145
21811
|
setSearchTerm: () => {
|
|
@@ -22156,14 +21822,14 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
|
22156
21822
|
300,
|
|
22157
21823
|
[localeSearchTerm]
|
|
22158
21824
|
);
|
|
22159
|
-
return /* @__PURE__ */
|
|
21825
|
+
return /* @__PURE__ */ jsx127(
|
|
22160
21826
|
SearchOnlyContext.Provider,
|
|
22161
21827
|
{
|
|
22162
21828
|
value: {
|
|
22163
21829
|
searchTerm,
|
|
22164
21830
|
setSearchTerm: setLocaleSearchTerm
|
|
22165
21831
|
},
|
|
22166
|
-
children: /* @__PURE__ */
|
|
21832
|
+
children: /* @__PURE__ */ jsx127("div", { css: { maxWidth: maxWidth != null ? maxWidth : "712px" }, children: /* @__PURE__ */ jsx127(
|
|
22167
21833
|
InputKeywordSearch,
|
|
22168
21834
|
{
|
|
22169
21835
|
placeholder: "Search...",
|
|
@@ -22177,6 +21843,221 @@ var SearchOnlyFilter = ({ onSearchChange, maxWidth }) => {
|
|
|
22177
21843
|
);
|
|
22178
21844
|
};
|
|
22179
21845
|
|
|
21846
|
+
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
21847
|
+
import { css as css95 } from "@emotion/react";
|
|
21848
|
+
import { CgCheck as CgCheck4 } from "@react-icons/all-files/cg/CgCheck";
|
|
21849
|
+
import { useCallback as useCallback11, useMemo as useMemo8 } from "react";
|
|
21850
|
+
|
|
21851
|
+
// src/components/SegmentedControl/SegmentedControl.styles.ts
|
|
21852
|
+
import { css as css94 } from "@emotion/react";
|
|
21853
|
+
var segmentedControlStyles = css94`
|
|
21854
|
+
--segmented-control-rounded-value: var(--rounded-base);
|
|
21855
|
+
--segmented-control-border-width: 1px;
|
|
21856
|
+
--segmented-control-selected-color: var(--brand-secondary-3);
|
|
21857
|
+
--segmented-control-first-border-radius: var(--segmented-control-rounded-value) 0 0
|
|
21858
|
+
var(--segmented-control-rounded-value);
|
|
21859
|
+
--segmented-control-last-border-radius: 0 var(--segmented-control-rounded-value)
|
|
21860
|
+
var(--segmented-control-rounded-value) 0;
|
|
21861
|
+
|
|
21862
|
+
position: relative;
|
|
21863
|
+
display: flex;
|
|
21864
|
+
justify-content: flex-start;
|
|
21865
|
+
width: fit-content;
|
|
21866
|
+
background-color: var(--gray-300);
|
|
21867
|
+
padding: var(--segmented-control-border-width);
|
|
21868
|
+
gap: var(--segmented-control-border-width);
|
|
21869
|
+
border-radius: calc(var(--segmented-control-rounded-value) + var(--segmented-control-border-width));
|
|
21870
|
+
font-size: var(--fs-xs);
|
|
21871
|
+
`;
|
|
21872
|
+
var segmentedControlVerticalStyles = css94`
|
|
21873
|
+
flex-direction: column;
|
|
21874
|
+
--segmented-control-first-border-radius: var(--segmented-control-rounded-value)
|
|
21875
|
+
var(--segmented-control-rounded-value) 0 0;
|
|
21876
|
+
--segmented-control-last-border-radius: 0 0 var(--segmented-control-rounded-value)
|
|
21877
|
+
var(--segmented-control-rounded-value);
|
|
21878
|
+
`;
|
|
21879
|
+
var segmentedControlItemStyles = css94`
|
|
21880
|
+
&:first-of-type label {
|
|
21881
|
+
border-radius: var(--segmented-control-first-border-radius);
|
|
21882
|
+
}
|
|
21883
|
+
&:last-of-type label {
|
|
21884
|
+
border-radius: var(--segmented-control-last-border-radius);
|
|
21885
|
+
}
|
|
21886
|
+
`;
|
|
21887
|
+
var segmentedControlInputStyles = css94`
|
|
21888
|
+
${accessibleHidden}
|
|
21889
|
+
`;
|
|
21890
|
+
var segmentedControlLabelStyles = (checked, disabled2) => css94`
|
|
21891
|
+
position: relative;
|
|
21892
|
+
display: flex;
|
|
21893
|
+
align-items: center;
|
|
21894
|
+
justify-content: center;
|
|
21895
|
+
height: 2rem;
|
|
21896
|
+
padding-inline: var(--spacing-base);
|
|
21897
|
+
background-color: white;
|
|
21898
|
+
transition-property: background-color, color, box-shadow;
|
|
21899
|
+
transition-duration: var(--duration-xfast);
|
|
21900
|
+
transition-timing-function: ease-in-out;
|
|
21901
|
+
z-index: 1;
|
|
21902
|
+
cursor: pointer;
|
|
21903
|
+
|
|
21904
|
+
&:has(:checked:not(:disabled)) {
|
|
21905
|
+
background-color: var(--segmented-control-selected-color);
|
|
21906
|
+
outline: var(--segmented-control-border-width) solid var(--segmented-control-selected-color);
|
|
21907
|
+
box-shadow: 0 0.43em 1.7em 0 rgba(0, 0, 0, 0.15);
|
|
21908
|
+
color: white;
|
|
21909
|
+
-webkit-text-stroke-width: thin;
|
|
21910
|
+
z-index: 0;
|
|
21911
|
+
}
|
|
21912
|
+
|
|
21913
|
+
&:hover:not(:has(:disabled, :checked)) {
|
|
21914
|
+
background-color: var(--gray-100);
|
|
21915
|
+
}
|
|
21916
|
+
|
|
21917
|
+
&:has(:disabled) {
|
|
21918
|
+
color: var(--gray-400);
|
|
21919
|
+
cursor: default;
|
|
21920
|
+
}
|
|
21921
|
+
|
|
21922
|
+
&:has(:checked:disabled) {
|
|
21923
|
+
color: var(--gray-50);
|
|
21924
|
+
background-color: var(--gray-400);
|
|
21925
|
+
}
|
|
21926
|
+
|
|
21927
|
+
// Firefox fallback using emotion variables
|
|
21928
|
+
// we can delete this whole block of code and variables in SegmentedControl.tsx
|
|
21929
|
+
// once Firefox supports :has selector
|
|
21930
|
+
@supports not selector(:has(*)) {
|
|
21931
|
+
// equivalent to &:has(:checked:not(:disabled))
|
|
21932
|
+
${checked && !disabled2 ? `
|
|
21933
|
+
background-color: var(--segmented-control-selected-color);
|
|
21934
|
+
outline: var(--segmented-control-border-width) solid var(--segmented-control-selected-color);
|
|
21935
|
+
box-shadow: 0 0.43em 1.7em 0 rgba(0, 0, 0, 0.15);
|
|
21936
|
+
color: white;
|
|
21937
|
+
-webkit-text-stroke-width: thin;
|
|
21938
|
+
z-index: 0;` : void 0}
|
|
21939
|
+
|
|
21940
|
+
// equivalent to &:hover:not(:has(:disabled, :checked))
|
|
21941
|
+
&:hover {
|
|
21942
|
+
${!checked && !disabled2 ? `background-color: var(--gray-100);` : void 0}
|
|
21943
|
+
}
|
|
21944
|
+
|
|
21945
|
+
// equivalent to &:has(:disabled)
|
|
21946
|
+
${disabled2 ? `
|
|
21947
|
+
color: var(--gray-400);
|
|
21948
|
+
cursor: default;` : void 0}
|
|
21949
|
+
|
|
21950
|
+
// equivalent to &:has(:checked:disabled)
|
|
21951
|
+
${checked && disabled2 && `
|
|
21952
|
+
color: var(--gray-50);
|
|
21953
|
+
background-color: var(--gray-400);
|
|
21954
|
+
`}
|
|
21955
|
+
}
|
|
21956
|
+
`;
|
|
21957
|
+
var segmentedControlLabelIconOnlyStyles = css94`
|
|
21958
|
+
padding-inline: 0.5em;
|
|
21959
|
+
`;
|
|
21960
|
+
var segmentedControlLabelCheckStyles = css94`
|
|
21961
|
+
opacity: 0.5;
|
|
21962
|
+
`;
|
|
21963
|
+
var segmentedControlLabelContentStyles = css94`
|
|
21964
|
+
display: flex;
|
|
21965
|
+
align-items: center;
|
|
21966
|
+
justify-content: center;
|
|
21967
|
+
gap: var(--spacing-sm);
|
|
21968
|
+
height: 100%;
|
|
21969
|
+
`;
|
|
21970
|
+
var segmentedControlLabelTextStyles = css94``;
|
|
21971
|
+
|
|
21972
|
+
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
21973
|
+
import { jsx as jsx128, jsxs as jsxs87 } from "@emotion/react/jsx-runtime";
|
|
21974
|
+
var SegmentedControl = ({
|
|
21975
|
+
name,
|
|
21976
|
+
options,
|
|
21977
|
+
value,
|
|
21978
|
+
onChange,
|
|
21979
|
+
noCheckmark = false,
|
|
21980
|
+
disabled: disabled2 = false,
|
|
21981
|
+
orientation = "horizontal",
|
|
21982
|
+
size = "md",
|
|
21983
|
+
hideOptionText = false,
|
|
21984
|
+
iconSize = "1.5em",
|
|
21985
|
+
...props
|
|
21986
|
+
}) => {
|
|
21987
|
+
const onOptionChange = useCallback11(
|
|
21988
|
+
(event) => {
|
|
21989
|
+
if (event.target.checked) {
|
|
21990
|
+
onChange == null ? void 0 : onChange(options[parseInt(event.target.value)].value);
|
|
21991
|
+
}
|
|
21992
|
+
},
|
|
21993
|
+
[options, onChange]
|
|
21994
|
+
);
|
|
21995
|
+
const sizeStyles = useMemo8(() => {
|
|
21996
|
+
const map = {
|
|
21997
|
+
sm: css95({ height: "calc(24px - 2px)", fontSize: "var(--fs-xs)" }),
|
|
21998
|
+
md: css95({ height: "calc(32px - 2px)", fontSize: "var(--fs-sm)" }),
|
|
21999
|
+
lg: css95({ height: "calc(40px - 2px)", fontSize: "var(--fs-base)" }),
|
|
22000
|
+
xl: css95({ height: "calc(48px - 2px)", fontSize: "var(--fs-base)" })
|
|
22001
|
+
};
|
|
22002
|
+
return map[size];
|
|
22003
|
+
}, [size]);
|
|
22004
|
+
const isIconOnly = useMemo8(() => {
|
|
22005
|
+
return options.every((option) => option && option.icon && !option.label);
|
|
22006
|
+
}, [options]);
|
|
22007
|
+
return /* @__PURE__ */ jsx128(
|
|
22008
|
+
"div",
|
|
22009
|
+
{
|
|
22010
|
+
css: [segmentedControlStyles, orientation === "vertical" ? segmentedControlVerticalStyles : void 0],
|
|
22011
|
+
...props,
|
|
22012
|
+
"data-testid": "segmented-control",
|
|
22013
|
+
children: options.map((option, index) => {
|
|
22014
|
+
var _a;
|
|
22015
|
+
if (!option) {
|
|
22016
|
+
return null;
|
|
22017
|
+
}
|
|
22018
|
+
const text = option.label ? option.label : option.icon ? null : String(option.value);
|
|
22019
|
+
const isDisabled = disabled2 || option.disabled;
|
|
22020
|
+
return /* @__PURE__ */ jsx128(Tooltip, { title: (_a = option.tooltip) != null ? _a : "", children: /* @__PURE__ */ jsx128(
|
|
22021
|
+
"div",
|
|
22022
|
+
{
|
|
22023
|
+
css: segmentedControlItemStyles,
|
|
22024
|
+
"data-testid": option["data-testid"] ? option["data-testid"] : "container-segmented-control",
|
|
22025
|
+
children: /* @__PURE__ */ jsxs87(
|
|
22026
|
+
"label",
|
|
22027
|
+
{
|
|
22028
|
+
css: [
|
|
22029
|
+
segmentedControlLabelStyles(option.value === value, isDisabled),
|
|
22030
|
+
sizeStyles,
|
|
22031
|
+
isIconOnly ? segmentedControlLabelIconOnlyStyles : void 0
|
|
22032
|
+
],
|
|
22033
|
+
children: [
|
|
22034
|
+
/* @__PURE__ */ jsx128(
|
|
22035
|
+
"input",
|
|
22036
|
+
{
|
|
22037
|
+
css: segmentedControlInputStyles,
|
|
22038
|
+
type: "radio",
|
|
22039
|
+
name,
|
|
22040
|
+
value: index,
|
|
22041
|
+
checked: option.value === value,
|
|
22042
|
+
onChange: onOptionChange,
|
|
22043
|
+
disabled: isDisabled
|
|
22044
|
+
}
|
|
22045
|
+
),
|
|
22046
|
+
option.value !== value || noCheckmark ? null : /* @__PURE__ */ jsx128(CgCheck4, { css: segmentedControlLabelCheckStyles, "aria-label": "Selected", size: "1.5em" }),
|
|
22047
|
+
/* @__PURE__ */ jsxs87("span", { css: segmentedControlLabelContentStyles, children: [
|
|
22048
|
+
!option.icon ? null : /* @__PURE__ */ jsx128(Icon, { icon: option.icon, size: iconSize, iconColor: "currentColor" }),
|
|
22049
|
+
!text || hideOptionText ? null : /* @__PURE__ */ jsx128("span", { css: segmentedControlLabelTextStyles, children: text })
|
|
22050
|
+
] })
|
|
22051
|
+
]
|
|
22052
|
+
}
|
|
22053
|
+
)
|
|
22054
|
+
}
|
|
22055
|
+
) }, JSON.stringify(option.value));
|
|
22056
|
+
})
|
|
22057
|
+
}
|
|
22058
|
+
);
|
|
22059
|
+
};
|
|
22060
|
+
|
|
22180
22061
|
// src/components/Skeleton/Skeleton.styles.ts
|
|
22181
22062
|
import { css as css96, keyframes as keyframes5 } from "@emotion/react";
|
|
22182
22063
|
var lightFadingOut = keyframes5`
|
|
@@ -22189,7 +22070,7 @@ var skeletonStyles = css96`
|
|
|
22189
22070
|
`;
|
|
22190
22071
|
|
|
22191
22072
|
// src/components/Skeleton/Skeleton.tsx
|
|
22192
|
-
import { jsx as
|
|
22073
|
+
import { jsx as jsx129 } from "@emotion/react/jsx-runtime";
|
|
22193
22074
|
var Skeleton = ({
|
|
22194
22075
|
width = "100%",
|
|
22195
22076
|
height = "1.25rem",
|
|
@@ -22197,7 +22078,7 @@ var Skeleton = ({
|
|
|
22197
22078
|
circle = false,
|
|
22198
22079
|
children,
|
|
22199
22080
|
...otherProps
|
|
22200
|
-
}) => /* @__PURE__ */
|
|
22081
|
+
}) => /* @__PURE__ */ jsx129(
|
|
22201
22082
|
"div",
|
|
22202
22083
|
{
|
|
22203
22084
|
css: [
|
|
@@ -22304,19 +22185,19 @@ var SwitchText = css97`
|
|
|
22304
22185
|
`;
|
|
22305
22186
|
|
|
22306
22187
|
// src/components/Switch/Switch.tsx
|
|
22307
|
-
import { Fragment as Fragment22, jsx as
|
|
22188
|
+
import { Fragment as Fragment22, jsx as jsx130, jsxs as jsxs88 } from "@emotion/react/jsx-runtime";
|
|
22308
22189
|
var Switch = React26.forwardRef(
|
|
22309
22190
|
({ label, infoText, toggleText, children, ...inputProps }, ref) => {
|
|
22310
22191
|
let additionalText = infoText;
|
|
22311
22192
|
if (infoText && toggleText) {
|
|
22312
22193
|
additionalText = inputProps.checked ? toggleText : infoText;
|
|
22313
22194
|
}
|
|
22314
|
-
return /* @__PURE__ */
|
|
22315
|
-
/* @__PURE__ */
|
|
22316
|
-
/* @__PURE__ */
|
|
22317
|
-
/* @__PURE__ */
|
|
22195
|
+
return /* @__PURE__ */ jsxs88(Fragment22, { children: [
|
|
22196
|
+
/* @__PURE__ */ jsxs88("label", { css: [SwitchInputContainer, inputProps.disabled ? SwitchInputDisabled : void 0], children: [
|
|
22197
|
+
/* @__PURE__ */ jsx130("input", { type: "checkbox", css: SwitchInput, ...inputProps, ref }),
|
|
22198
|
+
/* @__PURE__ */ jsx130("span", { css: SwitchInputLabel, children: label })
|
|
22318
22199
|
] }),
|
|
22319
|
-
additionalText ? /* @__PURE__ */
|
|
22200
|
+
additionalText ? /* @__PURE__ */ jsx130("p", { css: SwitchText, children: additionalText }) : null,
|
|
22320
22201
|
children
|
|
22321
22202
|
] });
|
|
22322
22203
|
}
|
|
@@ -22353,40 +22234,40 @@ var tableCellHead = css98`
|
|
|
22353
22234
|
`;
|
|
22354
22235
|
|
|
22355
22236
|
// src/components/Table/Table.tsx
|
|
22356
|
-
import { jsx as
|
|
22237
|
+
import { jsx as jsx131 } from "@emotion/react/jsx-runtime";
|
|
22357
22238
|
var Table = React27.forwardRef(
|
|
22358
22239
|
({ children, cellPadding, ...otherProps }, ref) => {
|
|
22359
|
-
return /* @__PURE__ */
|
|
22240
|
+
return /* @__PURE__ */ jsx131("table", { ref, css: table({ cellPadding }), ...otherProps, children });
|
|
22360
22241
|
}
|
|
22361
22242
|
);
|
|
22362
22243
|
var TableHead = React27.forwardRef(
|
|
22363
22244
|
({ children, ...otherProps }, ref) => {
|
|
22364
|
-
return /* @__PURE__ */
|
|
22245
|
+
return /* @__PURE__ */ jsx131("thead", { ref, css: tableHead, ...otherProps, children });
|
|
22365
22246
|
}
|
|
22366
22247
|
);
|
|
22367
22248
|
var TableBody = React27.forwardRef(
|
|
22368
22249
|
({ children, ...otherProps }, ref) => {
|
|
22369
|
-
return /* @__PURE__ */
|
|
22250
|
+
return /* @__PURE__ */ jsx131("tbody", { ref, ...otherProps, children });
|
|
22370
22251
|
}
|
|
22371
22252
|
);
|
|
22372
22253
|
var TableFoot = React27.forwardRef(
|
|
22373
22254
|
({ children, ...otherProps }, ref) => {
|
|
22374
|
-
return /* @__PURE__ */
|
|
22255
|
+
return /* @__PURE__ */ jsx131("tfoot", { ref, ...otherProps, children });
|
|
22375
22256
|
}
|
|
22376
22257
|
);
|
|
22377
22258
|
var TableRow = React27.forwardRef(
|
|
22378
22259
|
({ children, ...otherProps }, ref) => {
|
|
22379
|
-
return /* @__PURE__ */
|
|
22260
|
+
return /* @__PURE__ */ jsx131("tr", { ref, css: tableRow, ...otherProps, children });
|
|
22380
22261
|
}
|
|
22381
22262
|
);
|
|
22382
22263
|
var TableCellHead = React27.forwardRef(
|
|
22383
22264
|
({ children, ...otherProps }, ref) => {
|
|
22384
|
-
return /* @__PURE__ */
|
|
22265
|
+
return /* @__PURE__ */ jsx131("th", { ref, css: tableCellHead, ...otherProps, children });
|
|
22385
22266
|
}
|
|
22386
22267
|
);
|
|
22387
22268
|
var TableCellData = React27.forwardRef(
|
|
22388
22269
|
({ children, ...otherProps }, ref) => {
|
|
22389
|
-
return /* @__PURE__ */
|
|
22270
|
+
return /* @__PURE__ */ jsx131("td", { ref, ...otherProps, children });
|
|
22390
22271
|
}
|
|
22391
22272
|
);
|
|
22392
22273
|
|
|
@@ -22426,7 +22307,7 @@ var tabButtonGroupStyles = css99`
|
|
|
22426
22307
|
`;
|
|
22427
22308
|
|
|
22428
22309
|
// src/components/Tabs/Tabs.tsx
|
|
22429
|
-
import { jsx as
|
|
22310
|
+
import { jsx as jsx132 } from "@emotion/react/jsx-runtime";
|
|
22430
22311
|
var useCurrentTab = () => {
|
|
22431
22312
|
const context = useAriakitTabStore();
|
|
22432
22313
|
if (!context) {
|
|
@@ -22464,23 +22345,23 @@ var Tabs = ({
|
|
|
22464
22345
|
tab.setSelectedId(selected);
|
|
22465
22346
|
}
|
|
22466
22347
|
}, [selected, tab]);
|
|
22467
|
-
return /* @__PURE__ */
|
|
22348
|
+
return /* @__PURE__ */ jsx132(AriakitTabProvider, { store: tab, setSelectedId: onTabSelect, children });
|
|
22468
22349
|
};
|
|
22469
22350
|
var TabButtonGroup = ({ children, ...props }) => {
|
|
22470
|
-
return /* @__PURE__ */
|
|
22351
|
+
return /* @__PURE__ */ jsx132(AriakitTabList, { ...props, css: tabButtonGroupStyles, children });
|
|
22471
22352
|
};
|
|
22472
22353
|
var TabButton = ({
|
|
22473
22354
|
children,
|
|
22474
22355
|
id,
|
|
22475
22356
|
...props
|
|
22476
22357
|
}) => {
|
|
22477
|
-
return /* @__PURE__ */
|
|
22358
|
+
return /* @__PURE__ */ jsx132(AriakitTab, { type: "button", id, ...props, css: tabButtonStyles, children });
|
|
22478
22359
|
};
|
|
22479
22360
|
var TabContent = ({
|
|
22480
22361
|
children,
|
|
22481
22362
|
...props
|
|
22482
22363
|
}) => {
|
|
22483
|
-
return /* @__PURE__ */
|
|
22364
|
+
return /* @__PURE__ */ jsx132(AriakitTabPanel, { ...props, children });
|
|
22484
22365
|
};
|
|
22485
22366
|
|
|
22486
22367
|
// src/components/Toast/Toast.tsx
|
|
@@ -22711,9 +22592,9 @@ var toastContainerStyles = css100`
|
|
|
22711
22592
|
`;
|
|
22712
22593
|
|
|
22713
22594
|
// src/components/Toast/Toast.tsx
|
|
22714
|
-
import { jsx as
|
|
22595
|
+
import { jsx as jsx133 } from "@emotion/react/jsx-runtime";
|
|
22715
22596
|
var ToastContainer = ({ limit = 4 }) => {
|
|
22716
|
-
return /* @__PURE__ */
|
|
22597
|
+
return /* @__PURE__ */ jsx133(
|
|
22717
22598
|
ToastifyContainer,
|
|
22718
22599
|
{
|
|
22719
22600
|
css: toastContainerStyles,
|