@homebound/beam 2.409.0 → 2.410.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/index.cjs +247 -244
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +176 -173
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -13706,7 +13706,7 @@ var variantStyles2 = {
|
|
|
13706
13706
|
};
|
|
13707
13707
|
|
|
13708
13708
|
// src/components/BeamContext.tsx
|
|
13709
|
-
import { createContext as createContext6, useContext as useContext15, useMemo as useMemo37, useReducer, useRef as
|
|
13709
|
+
import { createContext as createContext6, useContext as useContext15, useMemo as useMemo37, useReducer, useRef as useRef45 } from "react";
|
|
13710
13710
|
import { OverlayProvider } from "react-aria";
|
|
13711
13711
|
|
|
13712
13712
|
// src/components/Modal/Modal.tsx
|
|
@@ -15621,17 +15621,66 @@ function FullBleed({ children, omitPadding = false }) {
|
|
|
15621
15621
|
// src/components/Layout/GridTableLayout/GridTableLayout.tsx
|
|
15622
15622
|
import React15, { useEffect as useEffect25, useMemo as useMemo35, useState as useState37 } from "react";
|
|
15623
15623
|
|
|
15624
|
+
// src/components/ButtonMenu.tsx
|
|
15625
|
+
import { useRef as useRef43 } from "react";
|
|
15626
|
+
import { useMenuTrigger as useMenuTrigger3 } from "react-aria";
|
|
15627
|
+
import { useMenuTriggerState as useMenuTriggerState3 } from "react-stately";
|
|
15628
|
+
import { jsx as jsx125 } from "@emotion/react/jsx-runtime";
|
|
15629
|
+
function ButtonMenu(props) {
|
|
15630
|
+
const { defaultOpen, disabled, items, persistentItems, trigger, searchable, contrast = false } = props;
|
|
15631
|
+
let selectedItem, onChange;
|
|
15632
|
+
if (isSelectionButtonMenuProps(props)) {
|
|
15633
|
+
selectedItem = props.selectedItem;
|
|
15634
|
+
onChange = props.onChange;
|
|
15635
|
+
}
|
|
15636
|
+
const state = useMenuTriggerState3({ isOpen: defaultOpen });
|
|
15637
|
+
const buttonRef = useRef43(null);
|
|
15638
|
+
const { menuTriggerProps, menuProps } = useMenuTrigger3({ isDisabled: !!disabled }, state, buttonRef);
|
|
15639
|
+
const tid = useTestIds(
|
|
15640
|
+
props,
|
|
15641
|
+
isTextButton(trigger) ? labelOr(trigger, "buttonMenu") : isNavLinkButton(trigger) ? defaultTestId(trigger.navLabel) : isIconButton(trigger) ? trigger.icon : trigger.name
|
|
15642
|
+
);
|
|
15643
|
+
return /* @__PURE__ */ jsx125(
|
|
15644
|
+
OverlayTrigger,
|
|
15645
|
+
{
|
|
15646
|
+
...props,
|
|
15647
|
+
menuTriggerProps,
|
|
15648
|
+
state,
|
|
15649
|
+
buttonRef,
|
|
15650
|
+
...tid,
|
|
15651
|
+
contrast,
|
|
15652
|
+
children: /* @__PURE__ */ jsx125(
|
|
15653
|
+
Menu,
|
|
15654
|
+
{
|
|
15655
|
+
ariaMenuProps: menuProps,
|
|
15656
|
+
onClose: () => state.close(),
|
|
15657
|
+
items,
|
|
15658
|
+
persistentItems,
|
|
15659
|
+
searchable,
|
|
15660
|
+
contrast,
|
|
15661
|
+
selectedItem,
|
|
15662
|
+
onChange,
|
|
15663
|
+
...tid
|
|
15664
|
+
}
|
|
15665
|
+
)
|
|
15666
|
+
}
|
|
15667
|
+
);
|
|
15668
|
+
}
|
|
15669
|
+
function isSelectionButtonMenuProps(props) {
|
|
15670
|
+
return typeof props === "object" && "selectedItem" in props && "onChange" in props;
|
|
15671
|
+
}
|
|
15672
|
+
|
|
15624
15673
|
// src/components/Filters/FilterDropdownMenu.tsx
|
|
15625
|
-
import { memo as memo2, useMemo as useMemo33, useRef as
|
|
15674
|
+
import { memo as memo2, useMemo as useMemo33, useRef as useRef44, useState as useState36 } from "react";
|
|
15626
15675
|
import { useOverlay as useOverlay3 } from "react-aria";
|
|
15627
15676
|
|
|
15628
15677
|
// src/components/CountBadge.tsx
|
|
15629
|
-
import { jsx as
|
|
15678
|
+
import { jsx as jsx126 } from "@emotion/react/jsx-runtime";
|
|
15630
15679
|
function CountBadge(props) {
|
|
15631
15680
|
const { count, bgColor = "rgba(29, 78, 216, 1)" /* Blue700 */, color = "rgba(255,255,255,1)" /* White */, hideIfZero = false, ...otherProps } = props;
|
|
15632
15681
|
const tid = useTestIds(otherProps, "countBadge");
|
|
15633
15682
|
if (hideIfZero && count === 0) return null;
|
|
15634
|
-
return /* @__PURE__ */
|
|
15683
|
+
return /* @__PURE__ */ jsx126(
|
|
15635
15684
|
"span",
|
|
15636
15685
|
{
|
|
15637
15686
|
...tid,
|
|
@@ -15664,7 +15713,7 @@ var BaseFilter = class {
|
|
|
15664
15713
|
};
|
|
15665
15714
|
|
|
15666
15715
|
// src/components/Filters/DateFilter.tsx
|
|
15667
|
-
import { Fragment as Fragment25, jsx as
|
|
15716
|
+
import { Fragment as Fragment25, jsx as jsx127, jsxs as jsxs61 } from "@emotion/react/jsx-runtime";
|
|
15668
15717
|
function dateFilter(props) {
|
|
15669
15718
|
return (key) => new DateFilter(key, props);
|
|
15670
15719
|
}
|
|
@@ -15673,9 +15722,9 @@ var DateFilter = class extends BaseFilter {
|
|
|
15673
15722
|
render(value, setValue, tid, inModal, vertical) {
|
|
15674
15723
|
const { label, operations, getOperationValue, getOperationLabel } = this.props;
|
|
15675
15724
|
return /* @__PURE__ */ jsxs61(Fragment25, { children: [
|
|
15676
|
-
vertical && /* @__PURE__ */
|
|
15725
|
+
vertical && /* @__PURE__ */ jsx127(Label, { label }),
|
|
15677
15726
|
/* @__PURE__ */ jsxs61(CompoundField, { children: [
|
|
15678
|
-
/* @__PURE__ */
|
|
15727
|
+
/* @__PURE__ */ jsx127(
|
|
15679
15728
|
SelectField,
|
|
15680
15729
|
{
|
|
15681
15730
|
compact: true,
|
|
@@ -15698,7 +15747,7 @@ var DateFilter = class extends BaseFilter {
|
|
|
15698
15747
|
...tid[`${defaultTestId(this.label)}_dateOperation`]
|
|
15699
15748
|
}
|
|
15700
15749
|
),
|
|
15701
|
-
/* @__PURE__ */
|
|
15750
|
+
/* @__PURE__ */ jsx127(
|
|
15702
15751
|
DateField,
|
|
15703
15752
|
{
|
|
15704
15753
|
compact: true,
|
|
@@ -15716,7 +15765,7 @@ var DateFilter = class extends BaseFilter {
|
|
|
15716
15765
|
};
|
|
15717
15766
|
|
|
15718
15767
|
// src/components/Filters/DateRangeFilter.tsx
|
|
15719
|
-
import { Fragment as Fragment26, jsx as
|
|
15768
|
+
import { Fragment as Fragment26, jsx as jsx128, jsxs as jsxs62 } from "@emotion/react/jsx-runtime";
|
|
15720
15769
|
function dateRangeFilter(props) {
|
|
15721
15770
|
return (key) => new DateRangeFilter(key, props);
|
|
15722
15771
|
}
|
|
@@ -15724,8 +15773,8 @@ var DateRangeFilter = class extends BaseFilter {
|
|
|
15724
15773
|
render(value, setValue, tid, inModal, vertical) {
|
|
15725
15774
|
const { label, placeholderText, disabledDays, testFieldLabel, defaultValue } = this.props;
|
|
15726
15775
|
return /* @__PURE__ */ jsxs62(Fragment26, { children: [
|
|
15727
|
-
vertical && /* @__PURE__ */
|
|
15728
|
-
/* @__PURE__ */
|
|
15776
|
+
vertical && /* @__PURE__ */ jsx128(Label, { label }),
|
|
15777
|
+
/* @__PURE__ */ jsx128(
|
|
15729
15778
|
DateRangeField,
|
|
15730
15779
|
{
|
|
15731
15780
|
compact: true,
|
|
@@ -15744,7 +15793,7 @@ var DateRangeFilter = class extends BaseFilter {
|
|
|
15744
15793
|
};
|
|
15745
15794
|
|
|
15746
15795
|
// src/components/Filters/MultiFilter.tsx
|
|
15747
|
-
import { jsx as
|
|
15796
|
+
import { jsx as jsx129 } from "@emotion/react/jsx-runtime";
|
|
15748
15797
|
function multiFilter(props) {
|
|
15749
15798
|
return (key) => new MultiFilter(key, props);
|
|
15750
15799
|
}
|
|
@@ -15754,7 +15803,7 @@ var MultiFilter = class extends BaseFilter {
|
|
|
15754
15803
|
const { disabledOptions } = this.props;
|
|
15755
15804
|
const disabledOptionsWithReasons = Object.fromEntries(disabledOptions?.map(disabledOptionToKeyedTuple) ?? []);
|
|
15756
15805
|
const disabledKeys = Object.keys(disabledOptionsWithReasons);
|
|
15757
|
-
return /* @__PURE__ */
|
|
15806
|
+
return /* @__PURE__ */ jsx129(
|
|
15758
15807
|
ToggleChipGroup,
|
|
15759
15808
|
{
|
|
15760
15809
|
label: this.label,
|
|
@@ -15778,7 +15827,7 @@ var MultiFilter = class extends BaseFilter {
|
|
|
15778
15827
|
);
|
|
15779
15828
|
}
|
|
15780
15829
|
const { defaultValue, nothingSelectedText, ...props } = this.props;
|
|
15781
|
-
return /* @__PURE__ */
|
|
15830
|
+
return /* @__PURE__ */ jsx129(
|
|
15782
15831
|
MultiSelectField,
|
|
15783
15832
|
{
|
|
15784
15833
|
...props,
|
|
@@ -15798,7 +15847,7 @@ var MultiFilter = class extends BaseFilter {
|
|
|
15798
15847
|
};
|
|
15799
15848
|
|
|
15800
15849
|
// src/components/Filters/NumberRangeFilter.tsx
|
|
15801
|
-
import { Fragment as Fragment27, jsx as
|
|
15850
|
+
import { Fragment as Fragment27, jsx as jsx130, jsxs as jsxs63 } from "@emotion/react/jsx-runtime";
|
|
15802
15851
|
function numberRangeFilter(props) {
|
|
15803
15852
|
return (key) => new NumberRangeFilter(key, props);
|
|
15804
15853
|
}
|
|
@@ -15809,8 +15858,8 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
15809
15858
|
const max = value?.max ?? void 0;
|
|
15810
15859
|
return /* @__PURE__ */ jsxs63(Fragment27, { children: [
|
|
15811
15860
|
vertical && /* @__PURE__ */ jsxs63("div", { ...tid, children: [
|
|
15812
|
-
/* @__PURE__ */
|
|
15813
|
-
/* @__PURE__ */
|
|
15861
|
+
/* @__PURE__ */ jsx130(Label, { label }),
|
|
15862
|
+
/* @__PURE__ */ jsx130("div", { css: Css.pb1.$, children: /* @__PURE__ */ jsx130(
|
|
15814
15863
|
NumberField,
|
|
15815
15864
|
{
|
|
15816
15865
|
labelStyle: "inline",
|
|
@@ -15826,7 +15875,7 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
15826
15875
|
...tid[`${defaultTestId(label)}_min_vertical`]
|
|
15827
15876
|
}
|
|
15828
15877
|
) }),
|
|
15829
|
-
/* @__PURE__ */
|
|
15878
|
+
/* @__PURE__ */ jsx130(
|
|
15830
15879
|
NumberField,
|
|
15831
15880
|
{
|
|
15832
15881
|
labelStyle: "inline",
|
|
@@ -15844,7 +15893,7 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
15844
15893
|
)
|
|
15845
15894
|
] }),
|
|
15846
15895
|
!vertical && /* @__PURE__ */ jsxs63(CompoundField, { ...tid, children: [
|
|
15847
|
-
/* @__PURE__ */
|
|
15896
|
+
/* @__PURE__ */ jsx130(
|
|
15848
15897
|
NumberField,
|
|
15849
15898
|
{
|
|
15850
15899
|
compact: true,
|
|
@@ -15862,7 +15911,7 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
15862
15911
|
...tid[`${defaultTestId(label)}_min`]
|
|
15863
15912
|
}
|
|
15864
15913
|
),
|
|
15865
|
-
/* @__PURE__ */
|
|
15914
|
+
/* @__PURE__ */ jsx130(
|
|
15866
15915
|
NumberField,
|
|
15867
15916
|
{
|
|
15868
15917
|
compact: true,
|
|
@@ -15886,7 +15935,7 @@ var NumberRangeFilter = class extends BaseFilter {
|
|
|
15886
15935
|
};
|
|
15887
15936
|
|
|
15888
15937
|
// src/components/Filters/SingleFilter.tsx
|
|
15889
|
-
import { jsx as
|
|
15938
|
+
import { jsx as jsx131 } from "@emotion/react/jsx-runtime";
|
|
15890
15939
|
function singleFilter(props) {
|
|
15891
15940
|
return (key) => new SingleFilter(key, props);
|
|
15892
15941
|
}
|
|
@@ -15903,7 +15952,7 @@ var SingleFilter = class extends BaseFilter {
|
|
|
15903
15952
|
...props
|
|
15904
15953
|
} = this.props;
|
|
15905
15954
|
const options = Array.isArray(maybeOptions) ? [allOption, ...maybeOptions] : { ...maybeOptions, current: maybeOptions.current };
|
|
15906
|
-
return /* @__PURE__ */
|
|
15955
|
+
return /* @__PURE__ */ jsx131(
|
|
15907
15956
|
SelectField,
|
|
15908
15957
|
{
|
|
15909
15958
|
...props,
|
|
@@ -15924,14 +15973,14 @@ var SingleFilter = class extends BaseFilter {
|
|
|
15924
15973
|
};
|
|
15925
15974
|
|
|
15926
15975
|
// src/components/Filters/TreeFilter.tsx
|
|
15927
|
-
import { jsx as
|
|
15976
|
+
import { jsx as jsx132 } from "@emotion/react/jsx-runtime";
|
|
15928
15977
|
function treeFilter(props) {
|
|
15929
15978
|
return (key) => new TreeFilter(key, props);
|
|
15930
15979
|
}
|
|
15931
15980
|
var TreeFilter = class extends BaseFilter {
|
|
15932
15981
|
render(value, setValue, tid, inModal, vertical) {
|
|
15933
15982
|
const { defaultValue, nothingSelectedText, filterBy = "root", ...props } = this.props;
|
|
15934
|
-
return /* @__PURE__ */
|
|
15983
|
+
return /* @__PURE__ */ jsx132(
|
|
15935
15984
|
TreeSelectField,
|
|
15936
15985
|
{
|
|
15937
15986
|
...props,
|
|
@@ -15952,14 +16001,14 @@ var TreeFilter = class extends BaseFilter {
|
|
|
15952
16001
|
};
|
|
15953
16002
|
|
|
15954
16003
|
// src/components/Filters/BooleanFilter.tsx
|
|
15955
|
-
import { jsx as
|
|
16004
|
+
import { jsx as jsx133 } from "@emotion/react/jsx-runtime";
|
|
15956
16005
|
function booleanFilter(props) {
|
|
15957
16006
|
return (key) => new BooleanFilter(key, props);
|
|
15958
16007
|
}
|
|
15959
16008
|
var BooleanFilter = class extends BaseFilter {
|
|
15960
16009
|
render(value, setValue, tid, inModal, vertical) {
|
|
15961
16010
|
const { options = defaultBooleanOptions, label, defaultValue, ...props } = this.props;
|
|
15962
|
-
return /* @__PURE__ */
|
|
16011
|
+
return /* @__PURE__ */ jsx133(
|
|
15963
16012
|
SelectField,
|
|
15964
16013
|
{
|
|
15965
16014
|
...props,
|
|
@@ -15987,7 +16036,7 @@ var defaultBooleanOptions = [
|
|
|
15987
16036
|
];
|
|
15988
16037
|
|
|
15989
16038
|
// src/components/Filters/CheckboxFilter.tsx
|
|
15990
|
-
import { jsx as
|
|
16039
|
+
import { jsx as jsx134 } from "@emotion/react/jsx-runtime";
|
|
15991
16040
|
function checkboxFilter(props) {
|
|
15992
16041
|
return (key) => new CheckboxFilter(key, {
|
|
15993
16042
|
// If the user has set the offValue, that should be the default b/c we're only a two-state
|
|
@@ -15998,7 +16047,7 @@ function checkboxFilter(props) {
|
|
|
15998
16047
|
var CheckboxFilter = class extends BaseFilter {
|
|
15999
16048
|
render(value, setValue, tid, inModal, vertical) {
|
|
16000
16049
|
const { defaultValue, onValue = true, offValue = void 0, ...props } = this.props;
|
|
16001
|
-
return /* @__PURE__ */
|
|
16050
|
+
return /* @__PURE__ */ jsx134(
|
|
16002
16051
|
Checkbox,
|
|
16003
16052
|
{
|
|
16004
16053
|
...props,
|
|
@@ -16021,7 +16070,7 @@ import { useState as useState35 } from "react";
|
|
|
16021
16070
|
|
|
16022
16071
|
// src/components/Modal/OpenModal.tsx
|
|
16023
16072
|
import { useEffect as useEffect23 } from "react";
|
|
16024
|
-
import { jsx as
|
|
16073
|
+
import { jsx as jsx135 } from "@emotion/react/jsx-runtime";
|
|
16025
16074
|
function OpenModal(props) {
|
|
16026
16075
|
const { openModal } = useModal();
|
|
16027
16076
|
const { size, children, keepOpen } = props;
|
|
@@ -16031,22 +16080,22 @@ function OpenModal(props) {
|
|
|
16031
16080
|
}
|
|
16032
16081
|
}, [keepOpen, openModal, size, children]);
|
|
16033
16082
|
if (keepOpen) {
|
|
16034
|
-
return /* @__PURE__ */
|
|
16083
|
+
return /* @__PURE__ */ jsx135(Modal, { size, content: children });
|
|
16035
16084
|
} else {
|
|
16036
|
-
return /* @__PURE__ */
|
|
16085
|
+
return /* @__PURE__ */ jsx135("div", { children: "dummy content" });
|
|
16037
16086
|
}
|
|
16038
16087
|
}
|
|
16039
16088
|
|
|
16040
16089
|
// src/components/Filters/FilterModal.tsx
|
|
16041
|
-
import { Fragment as Fragment28, jsx as
|
|
16090
|
+
import { Fragment as Fragment28, jsx as jsx136, jsxs as jsxs64 } from "@emotion/react/jsx-runtime";
|
|
16042
16091
|
function FilterModal(props) {
|
|
16043
16092
|
const { filter, filters, onApply } = props;
|
|
16044
16093
|
const testId = useTestIds(props, filterTestIdPrefix);
|
|
16045
16094
|
const { closeModal } = useModal();
|
|
16046
16095
|
const [modalFilter, setModalFilter] = useState35(filter);
|
|
16047
16096
|
return /* @__PURE__ */ jsxs64(Fragment28, { children: [
|
|
16048
|
-
/* @__PURE__ */
|
|
16049
|
-
/* @__PURE__ */
|
|
16097
|
+
/* @__PURE__ */ jsx136(ModalHeader, { children: "More Filters" }),
|
|
16098
|
+
/* @__PURE__ */ jsx136(ModalBody, { children: /* @__PURE__ */ jsx136("div", { css: Css.df.fdc.$, children: safeEntries(filters).map(([key, f]) => /* @__PURE__ */ jsx136(ModalFilterItem, { label: f.hideLabelInModal ? void 0 : f.label, children: f.render(
|
|
16050
16099
|
modalFilter[key],
|
|
16051
16100
|
(value) => setModalFilter(updateFilter(modalFilter, key, value)),
|
|
16052
16101
|
testId,
|
|
@@ -16054,7 +16103,7 @@ function FilterModal(props) {
|
|
|
16054
16103
|
false
|
|
16055
16104
|
) }, key)) }) }),
|
|
16056
16105
|
/* @__PURE__ */ jsxs64(ModalFooter, { xss: Css.jcsb.$, children: [
|
|
16057
|
-
/* @__PURE__ */
|
|
16106
|
+
/* @__PURE__ */ jsx136(
|
|
16058
16107
|
Button,
|
|
16059
16108
|
{
|
|
16060
16109
|
label: "Clear",
|
|
@@ -16068,8 +16117,8 @@ function FilterModal(props) {
|
|
|
16068
16117
|
}
|
|
16069
16118
|
),
|
|
16070
16119
|
/* @__PURE__ */ jsxs64("div", { css: Css.df.gap1.$, children: [
|
|
16071
|
-
/* @__PURE__ */
|
|
16072
|
-
/* @__PURE__ */
|
|
16120
|
+
/* @__PURE__ */ jsx136(Button, { label: "Cancel", variant: "quaternary", onClick: closeModal, ...testId.modalClose }),
|
|
16121
|
+
/* @__PURE__ */ jsx136(
|
|
16073
16122
|
Button,
|
|
16074
16123
|
{
|
|
16075
16124
|
label: "Apply",
|
|
@@ -16086,14 +16135,14 @@ function FilterModal(props) {
|
|
|
16086
16135
|
}
|
|
16087
16136
|
function ModalFilterItem({ label, children }) {
|
|
16088
16137
|
return /* @__PURE__ */ jsxs64("div", { css: Css.mb4.if(!label).bt.bcGray200.$, children: [
|
|
16089
|
-
label && /* @__PURE__ */
|
|
16090
|
-
/* @__PURE__ */
|
|
16138
|
+
label && /* @__PURE__ */ jsx136("h2", { css: Css.md.mb2.$, children: label }),
|
|
16139
|
+
/* @__PURE__ */ jsx136("div", { css: Css.if(!label).pt3.$, children })
|
|
16091
16140
|
] });
|
|
16092
16141
|
}
|
|
16093
16142
|
|
|
16094
16143
|
// src/components/Filters/Filters.tsx
|
|
16095
16144
|
import { memo, useMemo as useMemo32 } from "react";
|
|
16096
|
-
import { jsx as
|
|
16145
|
+
import { jsx as jsx137, jsxs as jsxs65 } from "@emotion/react/jsx-runtime";
|
|
16097
16146
|
function Filters(props) {
|
|
16098
16147
|
const { filter, onChange, filterDefs, groupBy, vertical = false, numberOfInlineFilters = groupBy ? 3 : 4 } = props;
|
|
16099
16148
|
const testId = useTestIds(props, filterTestIdPrefix);
|
|
@@ -16109,7 +16158,7 @@ function Filters(props) {
|
|
|
16109
16158
|
return [Object.fromEntries(impls), {}];
|
|
16110
16159
|
}, [numberOfInlineFilters, vertical, filterDefs]);
|
|
16111
16160
|
const numModalFilters = safeKeys(modalFilters).filter((fk) => filter[fk] !== void 0).length;
|
|
16112
|
-
const maybeGroupByField = groupBy ? /* @__PURE__ */
|
|
16161
|
+
const maybeGroupByField = groupBy ? /* @__PURE__ */ jsx137("div", { children: /* @__PURE__ */ jsx137(
|
|
16113
16162
|
SelectField,
|
|
16114
16163
|
{
|
|
16115
16164
|
label: "Group by",
|
|
@@ -16132,21 +16181,21 @@ function Filters(props) {
|
|
|
16132
16181
|
...testId,
|
|
16133
16182
|
children: [
|
|
16134
16183
|
maybeGroupByField,
|
|
16135
|
-
safeEntries(pageFilters).map(([key, f]) => /* @__PURE__ */
|
|
16136
|
-
Object.keys(modalFilters).length > 0 && /* @__PURE__ */
|
|
16184
|
+
safeEntries(pageFilters).map(([key, f]) => /* @__PURE__ */ jsx137("div", { children: f.render(filter[key], (value) => onChange(updateFilter(filter, key, value)), testId, false, vertical) }, key)),
|
|
16185
|
+
Object.keys(modalFilters).length > 0 && /* @__PURE__ */ jsx137(
|
|
16137
16186
|
Button,
|
|
16138
16187
|
{
|
|
16139
16188
|
label: "More Filters",
|
|
16140
|
-
endAdornment: /* @__PURE__ */
|
|
16189
|
+
endAdornment: /* @__PURE__ */ jsx137(CountBadge, { count: numModalFilters, hideIfZero: true }),
|
|
16141
16190
|
variant: "secondary",
|
|
16142
16191
|
onClick: () => openModal({
|
|
16143
16192
|
// Spreading `props` to pass along `data-testid`
|
|
16144
|
-
content: /* @__PURE__ */
|
|
16193
|
+
content: /* @__PURE__ */ jsx137(FilterModal, { ...props, filter, onApply: onChange, filters: modalFilters })
|
|
16145
16194
|
}),
|
|
16146
16195
|
...testId.moreFiltersBtn
|
|
16147
16196
|
}
|
|
16148
16197
|
),
|
|
16149
|
-
Object.keys(filter).length > 0 && /* @__PURE__ */
|
|
16198
|
+
Object.keys(filter).length > 0 && /* @__PURE__ */ jsx137("div", { children: /* @__PURE__ */ jsx137(Button, { label: "Clear", variant: "tertiary", onClick: () => onChange({}), ...testId.clearBtn }) })
|
|
16150
16199
|
]
|
|
16151
16200
|
}
|
|
16152
16201
|
);
|
|
@@ -16154,7 +16203,7 @@ function Filters(props) {
|
|
|
16154
16203
|
var _Filters = memo(Filters);
|
|
16155
16204
|
|
|
16156
16205
|
// src/components/Filters/ToggleFilter.tsx
|
|
16157
|
-
import { jsx as
|
|
16206
|
+
import { jsx as jsx138 } from "@emotion/react/jsx-runtime";
|
|
16158
16207
|
function toggleFilter(props) {
|
|
16159
16208
|
return (key) => new ToggleFilter(key, {
|
|
16160
16209
|
// If the user has set the offValue, that should be the default b/c we're only a two-state
|
|
@@ -16165,7 +16214,7 @@ function toggleFilter(props) {
|
|
|
16165
16214
|
var ToggleFilter = class extends BaseFilter {
|
|
16166
16215
|
render(value, setValue, tid, inModal, vertical) {
|
|
16167
16216
|
const { defaultValue, onValue = true, offValue = void 0, ...props } = this.props;
|
|
16168
|
-
return /* @__PURE__ */
|
|
16217
|
+
return /* @__PURE__ */ jsx138(
|
|
16169
16218
|
Switch,
|
|
16170
16219
|
{
|
|
16171
16220
|
...props,
|
|
@@ -16195,13 +16244,13 @@ function updateFilter(currentFilter, key, value) {
|
|
|
16195
16244
|
var filterTestIdPrefix = "filter";
|
|
16196
16245
|
|
|
16197
16246
|
// src/components/Filters/FilterDropdownMenu.tsx
|
|
16198
|
-
import { Fragment as Fragment29, jsx as
|
|
16247
|
+
import { Fragment as Fragment29, jsx as jsx139, jsxs as jsxs66 } from "@emotion/react/jsx-runtime";
|
|
16199
16248
|
function FilterDropdownMenu(props) {
|
|
16200
16249
|
const { filter, onChange, filterDefs, groupBy } = props;
|
|
16201
16250
|
const testId = useTestIds(props, filterTestIdPrefix);
|
|
16202
16251
|
const [isOpen, setIsOpen] = useState36(false);
|
|
16203
|
-
const buttonRef =
|
|
16204
|
-
const filterContentRef =
|
|
16252
|
+
const buttonRef = useRef44(null);
|
|
16253
|
+
const filterContentRef = useRef44(null);
|
|
16205
16254
|
const { overlayProps } = useOverlay3(
|
|
16206
16255
|
{
|
|
16207
16256
|
isOpen,
|
|
@@ -16220,18 +16269,18 @@ function FilterDropdownMenu(props) {
|
|
|
16220
16269
|
const entries = safeEntries(filterImpls);
|
|
16221
16270
|
const nonCheckbox = entries.filter(([_, f]) => !f.hideLabelInModal);
|
|
16222
16271
|
const checkbox = entries.filter(([_, f]) => f.hideLabelInModal);
|
|
16223
|
-
return [...nonCheckbox, ...checkbox].map(([key, f]) => /* @__PURE__ */
|
|
16272
|
+
return [...nonCheckbox, ...checkbox].map(([key, f]) => /* @__PURE__ */ jsx139("div", { children: f.render(filter[key], (value) => onChange(updateFilter(filter, key, value)), testId, false, false) }, key));
|
|
16224
16273
|
};
|
|
16225
16274
|
return /* @__PURE__ */ jsxs66(Fragment29, { children: [
|
|
16226
|
-
/* @__PURE__ */
|
|
16275
|
+
/* @__PURE__ */ jsx139("div", { ref: buttonRef, children: /* @__PURE__ */ jsx139(
|
|
16227
16276
|
Button,
|
|
16228
16277
|
{
|
|
16229
16278
|
label: "Filter",
|
|
16230
16279
|
icon: "filter",
|
|
16231
16280
|
size: "md",
|
|
16232
16281
|
endAdornment: /* @__PURE__ */ jsxs66("div", { css: Css.df.aic.gap1.$, children: [
|
|
16233
|
-
activeFilterCount > 0 && /* @__PURE__ */
|
|
16234
|
-
/* @__PURE__ */
|
|
16282
|
+
activeFilterCount > 0 && /* @__PURE__ */ jsx139(CountBadge, { count: activeFilterCount }),
|
|
16283
|
+
/* @__PURE__ */ jsx139(Icon, { icon: isOpen ? "chevronUp" : "chevronDown" })
|
|
16235
16284
|
] }),
|
|
16236
16285
|
variant: "secondaryBlack",
|
|
16237
16286
|
onClick: () => setIsOpen(!isOpen),
|
|
@@ -16239,7 +16288,7 @@ function FilterDropdownMenu(props) {
|
|
|
16239
16288
|
}
|
|
16240
16289
|
) }),
|
|
16241
16290
|
isOpen && /* @__PURE__ */ jsxs66("div", { ref: filterContentRef, ...overlayProps, css: Css.df.aic.fww.gap1.order(1).$, children: [
|
|
16242
|
-
groupBy && /* @__PURE__ */
|
|
16291
|
+
groupBy && /* @__PURE__ */ jsx139(
|
|
16243
16292
|
SelectField,
|
|
16244
16293
|
{
|
|
16245
16294
|
label: "Group by",
|
|
@@ -16254,9 +16303,9 @@ function FilterDropdownMenu(props) {
|
|
|
16254
16303
|
}
|
|
16255
16304
|
),
|
|
16256
16305
|
renderFilters(),
|
|
16257
|
-
activeFilterCount > 0 && /* @__PURE__ */
|
|
16306
|
+
activeFilterCount > 0 && /* @__PURE__ */ jsx139(Button, { label: "Clear", variant: "tertiary", onClick: () => onChange({}), ...testId.clearBtn })
|
|
16258
16307
|
] }),
|
|
16259
|
-
!isOpen && /* @__PURE__ */
|
|
16308
|
+
!isOpen && /* @__PURE__ */ jsx139(
|
|
16260
16309
|
FilterChips,
|
|
16261
16310
|
{
|
|
16262
16311
|
filter,
|
|
@@ -16282,7 +16331,7 @@ function FilterChips({
|
|
|
16282
16331
|
return value.map((item) => {
|
|
16283
16332
|
const chipKey = `${String(key)}_${item}`;
|
|
16284
16333
|
const newArray = value.filter((v) => v !== item);
|
|
16285
|
-
return /* @__PURE__ */
|
|
16334
|
+
return /* @__PURE__ */ jsx139(
|
|
16286
16335
|
ToggleChip,
|
|
16287
16336
|
{
|
|
16288
16337
|
text: titleCase(String(item)),
|
|
@@ -16293,7 +16342,7 @@ function FilterChips({
|
|
|
16293
16342
|
);
|
|
16294
16343
|
});
|
|
16295
16344
|
}
|
|
16296
|
-
return /* @__PURE__ */
|
|
16345
|
+
return /* @__PURE__ */ jsx139(
|
|
16297
16346
|
ToggleChip,
|
|
16298
16347
|
{
|
|
16299
16348
|
text: titleCase(String(value)),
|
|
@@ -16306,7 +16355,7 @@ function FilterChips({
|
|
|
16306
16355
|
if (chips.length === 0) return null;
|
|
16307
16356
|
return /* @__PURE__ */ jsxs66("div", { css: Css.df.gap1.fww.aic.order(1).$, children: [
|
|
16308
16357
|
chips,
|
|
16309
|
-
/* @__PURE__ */
|
|
16358
|
+
/* @__PURE__ */ jsx139(Button, { label: "Clear", variant: "tertiary", onClick: onClear, ...testId.clearBtn })
|
|
16310
16359
|
] });
|
|
16311
16360
|
}
|
|
16312
16361
|
function buildFilterImpls(filterDefs) {
|
|
@@ -16321,11 +16370,11 @@ function getActiveFilterCount(filter) {
|
|
|
16321
16370
|
var _FilterDropdownMenu = memo2(FilterDropdownMenu);
|
|
16322
16371
|
|
|
16323
16372
|
// src/components/Table/TableActions.tsx
|
|
16324
|
-
import { jsx as
|
|
16373
|
+
import { jsx as jsx140, jsxs as jsxs67 } from "@emotion/react/jsx-runtime";
|
|
16325
16374
|
function TableActions(props) {
|
|
16326
16375
|
const { xss, children, right } = props;
|
|
16327
16376
|
return /* @__PURE__ */ jsxs67("div", { css: { ...Css.df.gap1.aic.jcsb.aifs.pb2.$, ...xss }, children: [
|
|
16328
|
-
/* @__PURE__ */
|
|
16377
|
+
/* @__PURE__ */ jsx140("div", { css: Css.df.gap1.aic.fww.$, children }),
|
|
16329
16378
|
right
|
|
16330
16379
|
] });
|
|
16331
16380
|
}
|
|
@@ -16337,7 +16386,7 @@ import { StringParam as StringParam2, useQueryParams as useQueryParams3 } from "
|
|
|
16337
16386
|
// src/components/Layout/ScrollableContent.tsx
|
|
16338
16387
|
import { useEffect as useEffect24 } from "react";
|
|
16339
16388
|
import { createPortal as createPortal4 } from "react-dom";
|
|
16340
|
-
import { Fragment as Fragment30, jsx as
|
|
16389
|
+
import { Fragment as Fragment30, jsx as jsx141 } from "@emotion/react/jsx-runtime";
|
|
16341
16390
|
function ScrollableContent(props) {
|
|
16342
16391
|
const { children, virtualized = false, omitBottomPadding, bgColor } = props;
|
|
16343
16392
|
const { scrollableEl, setPortalTick, pl, pr } = useScrollableParent();
|
|
@@ -16346,10 +16395,10 @@ function ScrollableContent(props) {
|
|
|
16346
16395
|
return () => setPortalTick((prev) => prev + 1);
|
|
16347
16396
|
}, [setPortalTick]);
|
|
16348
16397
|
if (!scrollableEl) {
|
|
16349
|
-
return /* @__PURE__ */
|
|
16398
|
+
return /* @__PURE__ */ jsx141(Fragment30, { children });
|
|
16350
16399
|
}
|
|
16351
16400
|
return createPortal4(
|
|
16352
|
-
/* @__PURE__ */
|
|
16401
|
+
/* @__PURE__ */ jsx141(
|
|
16353
16402
|
"div",
|
|
16354
16403
|
{
|
|
16355
16404
|
css: {
|
|
@@ -16368,7 +16417,7 @@ function ScrollableContent(props) {
|
|
|
16368
16417
|
import { useMemo as useMemo34 } from "react";
|
|
16369
16418
|
|
|
16370
16419
|
// src/components/LoadingSkeleton.tsx
|
|
16371
|
-
import { jsx as
|
|
16420
|
+
import { jsx as jsx142 } from "@emotion/react/jsx-runtime";
|
|
16372
16421
|
function LoadingSkeleton({
|
|
16373
16422
|
rows = 1,
|
|
16374
16423
|
columns = 1,
|
|
@@ -16381,7 +16430,7 @@ function LoadingSkeleton({
|
|
|
16381
16430
|
const rowHeight = sizeToPixels2[size];
|
|
16382
16431
|
const rowCells = (rowNumber) => {
|
|
16383
16432
|
const flexGrowForCell = randomizeWidths ? getRandomizedFlexBasisByRowIndex(rowNumber) : 1;
|
|
16384
|
-
return cellArray.map((_, i) => /* @__PURE__ */
|
|
16433
|
+
return cellArray.map((_, i) => /* @__PURE__ */ jsx142(
|
|
16385
16434
|
"div",
|
|
16386
16435
|
{
|
|
16387
16436
|
css: Css.br4.add("animation", "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite").add("flexGrow", flexGrowForCell).bgGray300.if(contrast).bgGray700.$
|
|
@@ -16389,7 +16438,7 @@ function LoadingSkeleton({
|
|
|
16389
16438
|
`row-${rowNumber}-cell-${i}`
|
|
16390
16439
|
));
|
|
16391
16440
|
};
|
|
16392
|
-
return /* @__PURE__ */
|
|
16441
|
+
return /* @__PURE__ */ jsx142("div", { "aria-label": "Loading", children: rowArray.map((_, i) => /* @__PURE__ */ jsx142("div", { css: Css.df.gap1.mb1.hPx(rowHeight).$, children: rowCells(i) }, `row-${i}`)) });
|
|
16393
16442
|
}
|
|
16394
16443
|
function getRandomizedFlexBasisByRowIndex(rowIndex) {
|
|
16395
16444
|
const randomizedFlexBasisValues = [0.65, 0.8, 0.75, 0.9, 0.8, 0.85, 0.8, 0.95];
|
|
@@ -16403,7 +16452,7 @@ var sizeToPixels2 = {
|
|
|
16403
16452
|
};
|
|
16404
16453
|
|
|
16405
16454
|
// src/components/Layout/GridTableLayout/QueryTable.tsx
|
|
16406
|
-
import { Fragment as Fragment31, jsx as
|
|
16455
|
+
import { Fragment as Fragment31, jsx as jsx143, jsxs as jsxs68 } from "@emotion/react/jsx-runtime";
|
|
16407
16456
|
function QueryTable(props) {
|
|
16408
16457
|
const { emptyFallback, query, createRows, getPageInfo, columns, keepHeaderWhenLoading, ...others } = props;
|
|
16409
16458
|
const data = query.loading || query.error ? void 0 : query.data;
|
|
@@ -16412,18 +16461,18 @@ function QueryTable(props) {
|
|
|
16412
16461
|
const infoMessage = hasNextPage ? "Too many rows" : void 0;
|
|
16413
16462
|
const fallbackMessage = query.loading ? "Loading\u2026" : query.error ? `Error: ${query.error.message}` : emptyFallback;
|
|
16414
16463
|
const headers = rows.filter((row) => row.kind === "header");
|
|
16415
|
-
return query.loading ? /* @__PURE__ */
|
|
16464
|
+
return query.loading ? /* @__PURE__ */ jsx143("div", { children: keepHeaderWhenLoading ? /* @__PURE__ */ jsx143(GridTable, { ...{ columns, ...others }, rows: headers, fallbackMessage }) : /* @__PURE__ */ jsx143(LoadingTable, { columns: columns.length }) }) : /* @__PURE__ */ jsx143(GridTable, { ...{ rows, columns, fallbackMessage, infoMessage, ...others } });
|
|
16416
16465
|
}
|
|
16417
16466
|
function LoadingTable(props) {
|
|
16418
16467
|
const { columns } = props;
|
|
16419
16468
|
return /* @__PURE__ */ jsxs68(Fragment31, { children: [
|
|
16420
|
-
/* @__PURE__ */
|
|
16421
|
-
/* @__PURE__ */
|
|
16469
|
+
/* @__PURE__ */ jsx143(LoadingSkeleton, { rows: 1, columns: 1 }),
|
|
16470
|
+
/* @__PURE__ */ jsx143(LoadingSkeleton, { rows: 5, columns: columns ?? 5 })
|
|
16422
16471
|
] });
|
|
16423
16472
|
}
|
|
16424
16473
|
|
|
16425
16474
|
// src/components/Layout/GridTableLayout/GridTableLayout.tsx
|
|
16426
|
-
import { Fragment as Fragment32, jsx as
|
|
16475
|
+
import { Fragment as Fragment32, jsx as jsx144, jsxs as jsxs69 } from "@emotion/react/jsx-runtime";
|
|
16427
16476
|
function isGridTableProps(props) {
|
|
16428
16477
|
return "rows" in props;
|
|
16429
16478
|
}
|
|
@@ -16436,6 +16485,7 @@ function GridTableLayoutComponent(props) {
|
|
|
16436
16485
|
primaryAction,
|
|
16437
16486
|
secondaryAction,
|
|
16438
16487
|
tertiaryAction,
|
|
16488
|
+
actionMenu,
|
|
16439
16489
|
hideEditColumns = false
|
|
16440
16490
|
} = props;
|
|
16441
16491
|
const tid = useTestIds(props);
|
|
@@ -16460,20 +16510,21 @@ function GridTableLayoutComponent(props) {
|
|
|
16460
16510
|
}, [visibleColumnIds, layoutState]);
|
|
16461
16511
|
const visibleColumnsStorageKey = layoutState?.persistedColumnsStorageKey;
|
|
16462
16512
|
return /* @__PURE__ */ jsxs69(Fragment32, { children: [
|
|
16463
|
-
/* @__PURE__ */
|
|
16513
|
+
/* @__PURE__ */ jsx144(
|
|
16464
16514
|
Header2,
|
|
16465
16515
|
{
|
|
16466
16516
|
pageTitle,
|
|
16467
16517
|
breadcrumb,
|
|
16468
16518
|
primaryAction,
|
|
16469
16519
|
secondaryAction,
|
|
16470
|
-
tertiaryAction
|
|
16520
|
+
tertiaryAction,
|
|
16521
|
+
actionMenu
|
|
16471
16522
|
}
|
|
16472
16523
|
),
|
|
16473
16524
|
showTableActions && /* @__PURE__ */ jsxs69(
|
|
16474
16525
|
TableActions,
|
|
16475
16526
|
{
|
|
16476
|
-
right: hasHideableColumns && /* @__PURE__ */
|
|
16527
|
+
right: hasHideableColumns && /* @__PURE__ */ jsx144(
|
|
16477
16528
|
EditColumnsButton,
|
|
16478
16529
|
{
|
|
16479
16530
|
columns,
|
|
@@ -16484,8 +16535,8 @@ function GridTableLayoutComponent(props) {
|
|
|
16484
16535
|
}
|
|
16485
16536
|
),
|
|
16486
16537
|
children: [
|
|
16487
|
-
layoutState?.search && /* @__PURE__ */
|
|
16488
|
-
layoutState?.filterDefs && /* @__PURE__ */
|
|
16538
|
+
layoutState?.search && /* @__PURE__ */ jsx144(SearchBox, { onSearch: layoutState.setSearchString }),
|
|
16539
|
+
layoutState?.filterDefs && /* @__PURE__ */ jsx144(
|
|
16489
16540
|
_FilterDropdownMenu,
|
|
16490
16541
|
{
|
|
16491
16542
|
filterDefs: layoutState.filterDefs,
|
|
@@ -16497,7 +16548,7 @@ function GridTableLayoutComponent(props) {
|
|
|
16497
16548
|
]
|
|
16498
16549
|
}
|
|
16499
16550
|
),
|
|
16500
|
-
/* @__PURE__ */
|
|
16551
|
+
/* @__PURE__ */ jsx144(ScrollableContent, { virtualized: isVirtualized, children: isGridTableProps(tableProps) ? /* @__PURE__ */ jsx144(
|
|
16501
16552
|
GridTable,
|
|
16502
16553
|
{
|
|
16503
16554
|
...tableProps,
|
|
@@ -16507,7 +16558,7 @@ function GridTableLayoutComponent(props) {
|
|
|
16507
16558
|
stickyHeader: true,
|
|
16508
16559
|
visibleColumnsStorageKey
|
|
16509
16560
|
}
|
|
16510
|
-
) : /* @__PURE__ */
|
|
16561
|
+
) : /* @__PURE__ */ jsx144(
|
|
16511
16562
|
QueryTable,
|
|
16512
16563
|
{
|
|
16513
16564
|
...tableProps,
|
|
@@ -16557,17 +16608,18 @@ function useGridTableLayoutState({
|
|
|
16557
16608
|
};
|
|
16558
16609
|
}
|
|
16559
16610
|
function Header2(props) {
|
|
16560
|
-
const { pageTitle, breadcrumb, primaryAction, secondaryAction, tertiaryAction } = props;
|
|
16611
|
+
const { pageTitle, breadcrumb, primaryAction, secondaryAction, tertiaryAction, actionMenu } = props;
|
|
16561
16612
|
const tids = useTestIds(props);
|
|
16562
|
-
return /* @__PURE__ */
|
|
16613
|
+
return /* @__PURE__ */ jsx144(FullBleed, { children: /* @__PURE__ */ jsxs69("header", { css: { ...Css.p3.mb3.mhPx(50).bgWhite.df.jcsb.aic.$ }, ...tids.header, children: [
|
|
16563
16614
|
/* @__PURE__ */ jsxs69("div", { children: [
|
|
16564
|
-
breadcrumb && /* @__PURE__ */
|
|
16565
|
-
/* @__PURE__ */
|
|
16615
|
+
breadcrumb && /* @__PURE__ */ jsx144(PageHeaderBreadcrumbs, { breadcrumb }),
|
|
16616
|
+
/* @__PURE__ */ jsx144("h1", { css: Css.xl2.mt1.$, ...tids.pageTitle, children: pageTitle })
|
|
16566
16617
|
] }),
|
|
16567
|
-
/* @__PURE__ */ jsxs69("div", { css: Css.df.fwr.jcfe.gap1.$, children: [
|
|
16568
|
-
tertiaryAction && /* @__PURE__ */
|
|
16569
|
-
secondaryAction && /* @__PURE__ */
|
|
16570
|
-
primaryAction && /* @__PURE__ */
|
|
16618
|
+
/* @__PURE__ */ jsxs69("div", { css: Css.df.fwr.jcfe.gap1.aic.$, children: [
|
|
16619
|
+
tertiaryAction && /* @__PURE__ */ jsx144(Button, { ...tertiaryAction, variant: "tertiary" }),
|
|
16620
|
+
secondaryAction && /* @__PURE__ */ jsx144(Button, { ...secondaryAction, variant: "secondary" }),
|
|
16621
|
+
primaryAction && /* @__PURE__ */ jsx144(Button, { ...primaryAction }),
|
|
16622
|
+
actionMenu && /* @__PURE__ */ jsx144(ButtonMenu, { ...actionMenu, trigger: { icon: "verticalDots" } })
|
|
16571
16623
|
] })
|
|
16572
16624
|
] }) });
|
|
16573
16625
|
}
|
|
@@ -16579,7 +16631,7 @@ function SearchBox({ onSearch }) {
|
|
|
16579
16631
|
onSearch(debouncedSearch);
|
|
16580
16632
|
setQueryParams({ search: debouncedSearch || void 0 }, "replaceIn");
|
|
16581
16633
|
}, [debouncedSearch, onSearch, setQueryParams]);
|
|
16582
|
-
return /* @__PURE__ */
|
|
16634
|
+
return /* @__PURE__ */ jsx144("div", { css: Css.wPx(244).$, children: /* @__PURE__ */ jsx144(
|
|
16583
16635
|
TextField,
|
|
16584
16636
|
{
|
|
16585
16637
|
label: "Search",
|
|
@@ -16588,25 +16640,25 @@ function SearchBox({ onSearch }) {
|
|
|
16588
16640
|
onChange: (v) => setValue(v ?? ""),
|
|
16589
16641
|
placeholder: "Search",
|
|
16590
16642
|
clearable: true,
|
|
16591
|
-
startAdornment: /* @__PURE__ */
|
|
16643
|
+
startAdornment: /* @__PURE__ */ jsx144(Icon, { icon: "search", color: "rgba(100, 100, 100, 1)" /* Gray700 */ })
|
|
16592
16644
|
}
|
|
16593
16645
|
) });
|
|
16594
16646
|
}
|
|
16595
16647
|
|
|
16596
16648
|
// src/components/Layout/PreventBrowserScroll.tsx
|
|
16597
|
-
import { jsx as
|
|
16649
|
+
import { jsx as jsx145 } from "@emotion/react/jsx-runtime";
|
|
16598
16650
|
function PreventBrowserScroll({ children }) {
|
|
16599
16651
|
return (
|
|
16600
16652
|
// Take over the full viewport and hide any overflown content.
|
|
16601
16653
|
// Using `-webkit-fill-available`, otherwise `height: 100vh` includes the app bars in mobile Safari. See https://allthingssmitty.com/2020/05/11/css-fix-for-100vh-in-mobile-webkit/
|
|
16602
16654
|
// Setting the multiple "(min|max-)height" properties is necessary, as Truss will turn this into an object and there can only be one `height` property.
|
|
16603
|
-
/* @__PURE__ */
|
|
16655
|
+
/* @__PURE__ */ jsx145("div", { css: Css.oh.vh100.mh("-webkit-fill-available").maxh("-webkit-fill-available").$, children: /* @__PURE__ */ jsx145("div", { css: Css.h100.df.fdc.mh0.oa.$, children }) })
|
|
16604
16656
|
);
|
|
16605
16657
|
}
|
|
16606
16658
|
|
|
16607
16659
|
// src/components/Layout/RightPaneLayout/RightPaneContext.tsx
|
|
16608
16660
|
import React16, { useCallback as useCallback19, useContext as useContext14, useMemo as useMemo36, useState as useState38 } from "react";
|
|
16609
|
-
import { jsx as
|
|
16661
|
+
import { jsx as jsx146 } from "@emotion/react/jsx-runtime";
|
|
16610
16662
|
var RightPaneContext = React16.createContext({
|
|
16611
16663
|
openInPane: () => {
|
|
16612
16664
|
},
|
|
@@ -16633,7 +16685,7 @@ function RightPaneProvider({ children }) {
|
|
|
16633
16685
|
() => ({ openInPane, closePane, clearPane, rightPaneContent, isRightPaneOpen }),
|
|
16634
16686
|
[openInPane, closePane, rightPaneContent, clearPane, isRightPaneOpen]
|
|
16635
16687
|
);
|
|
16636
|
-
return /* @__PURE__ */
|
|
16688
|
+
return /* @__PURE__ */ jsx146(RightPaneContext.Provider, { value: context, children });
|
|
16637
16689
|
}
|
|
16638
16690
|
function useRightPaneContext() {
|
|
16639
16691
|
return useContext14(RightPaneContext);
|
|
@@ -16642,13 +16694,13 @@ function useRightPaneContext() {
|
|
|
16642
16694
|
// src/components/Layout/RightPaneLayout/RightPaneLayout.tsx
|
|
16643
16695
|
import { AnimatePresence as AnimatePresence3, motion as motion3 } from "framer-motion";
|
|
16644
16696
|
import { useEffect as useEffect26 } from "react";
|
|
16645
|
-
import { Fragment as Fragment33, jsx as
|
|
16697
|
+
import { Fragment as Fragment33, jsx as jsx147, jsxs as jsxs70 } from "@emotion/react/jsx-runtime";
|
|
16646
16698
|
function RightPaneLayout(props) {
|
|
16647
16699
|
const { children, paneBgColor = "rgba(255,255,255,1)" /* White */, paneWidth = 450, defaultPaneContent } = props;
|
|
16648
16700
|
const { isRightPaneOpen, rightPaneContent, clearPane, closePane } = useRightPaneContext();
|
|
16649
16701
|
useEffect26(() => closePane, [closePane]);
|
|
16650
|
-
return /* @__PURE__ */
|
|
16651
|
-
/* @__PURE__ */
|
|
16702
|
+
return /* @__PURE__ */ jsx147("div", { css: Css.h100.df.oxh.$, children: /* @__PURE__ */ jsxs70(Fragment33, { children: [
|
|
16703
|
+
/* @__PURE__ */ jsx147(
|
|
16652
16704
|
"div",
|
|
16653
16705
|
{
|
|
16654
16706
|
css: {
|
|
@@ -16660,14 +16712,14 @@ function RightPaneLayout(props) {
|
|
|
16660
16712
|
}
|
|
16661
16713
|
),
|
|
16662
16714
|
/* @__PURE__ */ jsxs70("div", { css: Css.relative.if(!!defaultPaneContent).wPx(paneWidth).$, children: [
|
|
16663
|
-
defaultPaneContent && /* @__PURE__ */
|
|
16715
|
+
defaultPaneContent && /* @__PURE__ */ jsx147(
|
|
16664
16716
|
"div",
|
|
16665
16717
|
{
|
|
16666
16718
|
css: Css.h100.wPx(paneWidth).left(0).absolute.add("transition", "all .3s ease-in-out").if(isRightPaneOpen).add("opacity", 0).left(100).$,
|
|
16667
16719
|
children: defaultPaneContent
|
|
16668
16720
|
}
|
|
16669
16721
|
),
|
|
16670
|
-
/* @__PURE__ */
|
|
16722
|
+
/* @__PURE__ */ jsx147(AnimatePresence3, { children: isRightPaneOpen && /* @__PURE__ */ jsx147(
|
|
16671
16723
|
motion3.div,
|
|
16672
16724
|
{
|
|
16673
16725
|
layout: "position",
|
|
@@ -16696,7 +16748,7 @@ function useRightPane() {
|
|
|
16696
16748
|
}
|
|
16697
16749
|
|
|
16698
16750
|
// src/components/BeamContext.tsx
|
|
16699
|
-
import { jsx as
|
|
16751
|
+
import { jsx as jsx148, jsxs as jsxs71 } from "@emotion/react/jsx-runtime";
|
|
16700
16752
|
var BeamContext = createContext6({
|
|
16701
16753
|
modalState: new EmptyRef(),
|
|
16702
16754
|
modalCanCloseChecks: new EmptyRef(),
|
|
@@ -16710,18 +16762,18 @@ var BeamContext = createContext6({
|
|
|
16710
16762
|
});
|
|
16711
16763
|
function BeamProvider({ children, ...presentationProps }) {
|
|
16712
16764
|
const [, tick] = useReducer((prev) => prev + 1, 0);
|
|
16713
|
-
const modalRef =
|
|
16765
|
+
const modalRef = useRef45();
|
|
16714
16766
|
const modalHeaderDiv = useMemo37(() => document.createElement("div"), []);
|
|
16715
16767
|
const modalBodyDiv = useMemo37(() => {
|
|
16716
16768
|
const el = document.createElement("div");
|
|
16717
16769
|
el.style.height = "100%";
|
|
16718
16770
|
return el;
|
|
16719
16771
|
}, []);
|
|
16720
|
-
const modalCanCloseChecksRef =
|
|
16772
|
+
const modalCanCloseChecksRef = useRef45([]);
|
|
16721
16773
|
const modalFooterDiv = useMemo37(() => document.createElement("div"), []);
|
|
16722
|
-
const drawerContentStackRef =
|
|
16723
|
-
const drawerCanCloseChecks =
|
|
16724
|
-
const drawerCanCloseDetailsChecks =
|
|
16774
|
+
const drawerContentStackRef = useRef45([]);
|
|
16775
|
+
const drawerCanCloseChecks = useRef45([]);
|
|
16776
|
+
const drawerCanCloseDetailsChecks = useRef45([]);
|
|
16725
16777
|
const sdHeaderDiv = useMemo37(() => document.createElement("div"), []);
|
|
16726
16778
|
const context = useMemo37(() => {
|
|
16727
16779
|
return {
|
|
@@ -16738,12 +16790,12 @@ function BeamProvider({ children, ...presentationProps }) {
|
|
|
16738
16790
|
sdHeaderDiv
|
|
16739
16791
|
};
|
|
16740
16792
|
}, [modalBodyDiv, modalFooterDiv, modalHeaderDiv, sdHeaderDiv]);
|
|
16741
|
-
return /* @__PURE__ */
|
|
16793
|
+
return /* @__PURE__ */ jsx148(BeamContext.Provider, { value: { ...context }, children: /* @__PURE__ */ jsx148(PresentationProvider, { ...presentationProps, children: /* @__PURE__ */ jsx148(RightPaneProvider, { children: /* @__PURE__ */ jsx148(AutoSaveStatusProvider, { children: /* @__PURE__ */ jsx148(SnackbarProvider, { children: /* @__PURE__ */ jsxs71(ToastProvider, { children: [
|
|
16742
16794
|
/* @__PURE__ */ jsxs71(OverlayProvider, { children: [
|
|
16743
16795
|
children,
|
|
16744
|
-
modalRef.current && /* @__PURE__ */
|
|
16796
|
+
modalRef.current && /* @__PURE__ */ jsx148(Modal, { ...modalRef.current })
|
|
16745
16797
|
] }),
|
|
16746
|
-
/* @__PURE__ */
|
|
16798
|
+
/* @__PURE__ */ jsx148(SuperDrawer, {})
|
|
16747
16799
|
] }) }) }) }) }) });
|
|
16748
16800
|
}
|
|
16749
16801
|
var PretendRefThatTicks = class {
|
|
@@ -16764,20 +16816,20 @@ function useBeamContext() {
|
|
|
16764
16816
|
}
|
|
16765
16817
|
|
|
16766
16818
|
// src/components/ButtonDatePicker.tsx
|
|
16767
|
-
import { useRef as
|
|
16768
|
-
import { useMenuTrigger as
|
|
16769
|
-
import { useMenuTriggerState as
|
|
16770
|
-
import { jsx as
|
|
16819
|
+
import { useRef as useRef46 } from "react";
|
|
16820
|
+
import { useMenuTrigger as useMenuTrigger4 } from "react-aria";
|
|
16821
|
+
import { useMenuTriggerState as useMenuTriggerState4 } from "react-stately";
|
|
16822
|
+
import { jsx as jsx149 } from "@emotion/react/jsx-runtime";
|
|
16771
16823
|
function ButtonDatePicker(props) {
|
|
16772
16824
|
const { defaultOpen, disabled, trigger, onSelect, ...datePickerProps } = props;
|
|
16773
|
-
const state =
|
|
16774
|
-
const buttonRef =
|
|
16775
|
-
const { menuTriggerProps, menuProps } =
|
|
16825
|
+
const state = useMenuTriggerState4({ isOpen: defaultOpen });
|
|
16826
|
+
const buttonRef = useRef46(null);
|
|
16827
|
+
const { menuTriggerProps, menuProps } = useMenuTrigger4({ isDisabled: !!disabled }, state, buttonRef);
|
|
16776
16828
|
const tid = useTestIds(
|
|
16777
16829
|
props,
|
|
16778
16830
|
isTextButton(trigger) ? defaultTestId(labelOr(trigger, "buttonDatePicker")) : isNavLinkButton(trigger) ? defaultTestId(trigger.navLabel) : isIconButton(trigger) ? trigger.icon : trigger.name
|
|
16779
16831
|
);
|
|
16780
|
-
return /* @__PURE__ */
|
|
16832
|
+
return /* @__PURE__ */ jsx149(OverlayTrigger, { ...props, menuTriggerProps, state, buttonRef, ...tid, children: /* @__PURE__ */ jsx149(DatePickerOverlay, { overlayProps: menuProps, children: /* @__PURE__ */ jsx149(
|
|
16781
16833
|
DatePicker,
|
|
16782
16834
|
{
|
|
16783
16835
|
...datePickerProps,
|
|
@@ -16791,29 +16843,29 @@ function ButtonDatePicker(props) {
|
|
|
16791
16843
|
}
|
|
16792
16844
|
|
|
16793
16845
|
// src/components/ButtonGroup.tsx
|
|
16794
|
-
import { useRef as
|
|
16846
|
+
import { useRef as useRef47 } from "react";
|
|
16795
16847
|
import { useButton as useButton10, useFocusRing as useFocusRing12, useHover as useHover15 } from "react-aria";
|
|
16796
|
-
import { jsx as
|
|
16848
|
+
import { jsx as jsx150, jsxs as jsxs72 } from "@emotion/react/jsx-runtime";
|
|
16797
16849
|
function ButtonGroup(props) {
|
|
16798
16850
|
const { buttons, disabled = false, size = "sm" } = props;
|
|
16799
16851
|
const tid = useTestIds(props, "buttonGroup");
|
|
16800
16852
|
return (
|
|
16801
16853
|
// Adding `line-height: 0` prevent inheriting line-heights that might throw off sizing within the button group.
|
|
16802
|
-
/* @__PURE__ */
|
|
16854
|
+
/* @__PURE__ */ jsx150("div", { ...tid, css: Css.df.lh(0).add({ ...sizeStyles2[size] }).$, children: buttons.map(({ disabled: buttonDisabled, ...buttonProps }, i) => (
|
|
16803
16855
|
// Disable the button if the ButtonGroup is disabled or if the current button is disabled.
|
|
16804
|
-
/* @__PURE__ */
|
|
16856
|
+
/* @__PURE__ */ jsx150(GroupButton, { ...buttonProps, disabled: disabled || buttonDisabled, size, ...tid }, i)
|
|
16805
16857
|
)) })
|
|
16806
16858
|
);
|
|
16807
16859
|
}
|
|
16808
16860
|
function GroupButton(props) {
|
|
16809
16861
|
const { icon, iconInc, iconColor, text, active, onClick: onPress, disabled, size, tooltip, ...otherProps } = props;
|
|
16810
16862
|
const ariaProps = { onPress, isDisabled: !!disabled, ...otherProps };
|
|
16811
|
-
const ref =
|
|
16863
|
+
const ref = useRef47(null);
|
|
16812
16864
|
const { buttonProps, isPressed } = useButton10(ariaProps, ref);
|
|
16813
16865
|
const { isFocusVisible, focusProps } = useFocusRing12();
|
|
16814
16866
|
const { hoverProps, isHovered } = useHover15(ariaProps);
|
|
16815
16867
|
const tid = useTestIds(props);
|
|
16816
|
-
return /* @__PURE__ */
|
|
16868
|
+
return /* @__PURE__ */ jsx150("span", { css: getButtonStyles2(), children: maybeTooltip({
|
|
16817
16869
|
title: resolveTooltip(disabled, tooltip),
|
|
16818
16870
|
placement: "top",
|
|
16819
16871
|
children: /* @__PURE__ */ jsxs72(
|
|
@@ -16833,7 +16885,7 @@ function GroupButton(props) {
|
|
|
16833
16885
|
},
|
|
16834
16886
|
...tid[defaultTestId(typeof text === "string" && text || icon || "button")],
|
|
16835
16887
|
children: [
|
|
16836
|
-
icon && /* @__PURE__ */
|
|
16888
|
+
icon && /* @__PURE__ */ jsx150(Icon, { xss: Css.if(!!text).mrPx(4).$, icon, color: disabled ? void 0 : iconColor, inc: iconInc }),
|
|
16837
16889
|
text
|
|
16838
16890
|
]
|
|
16839
16891
|
}
|
|
@@ -16866,55 +16918,6 @@ var iconStyles2 = {
|
|
|
16866
16918
|
md: Css.px1.$
|
|
16867
16919
|
};
|
|
16868
16920
|
|
|
16869
|
-
// src/components/ButtonMenu.tsx
|
|
16870
|
-
import { useRef as useRef47 } from "react";
|
|
16871
|
-
import { useMenuTrigger as useMenuTrigger4 } from "react-aria";
|
|
16872
|
-
import { useMenuTriggerState as useMenuTriggerState4 } from "react-stately";
|
|
16873
|
-
import { jsx as jsx150 } from "@emotion/react/jsx-runtime";
|
|
16874
|
-
function ButtonMenu(props) {
|
|
16875
|
-
const { defaultOpen, disabled, items, persistentItems, trigger, searchable, contrast = false } = props;
|
|
16876
|
-
let selectedItem, onChange;
|
|
16877
|
-
if (isSelectionButtonMenuProps(props)) {
|
|
16878
|
-
selectedItem = props.selectedItem;
|
|
16879
|
-
onChange = props.onChange;
|
|
16880
|
-
}
|
|
16881
|
-
const state = useMenuTriggerState4({ isOpen: defaultOpen });
|
|
16882
|
-
const buttonRef = useRef47(null);
|
|
16883
|
-
const { menuTriggerProps, menuProps } = useMenuTrigger4({ isDisabled: !!disabled }, state, buttonRef);
|
|
16884
|
-
const tid = useTestIds(
|
|
16885
|
-
props,
|
|
16886
|
-
isTextButton(trigger) ? labelOr(trigger, "buttonMenu") : isNavLinkButton(trigger) ? defaultTestId(trigger.navLabel) : isIconButton(trigger) ? trigger.icon : trigger.name
|
|
16887
|
-
);
|
|
16888
|
-
return /* @__PURE__ */ jsx150(
|
|
16889
|
-
OverlayTrigger,
|
|
16890
|
-
{
|
|
16891
|
-
...props,
|
|
16892
|
-
menuTriggerProps,
|
|
16893
|
-
state,
|
|
16894
|
-
buttonRef,
|
|
16895
|
-
...tid,
|
|
16896
|
-
contrast,
|
|
16897
|
-
children: /* @__PURE__ */ jsx150(
|
|
16898
|
-
Menu,
|
|
16899
|
-
{
|
|
16900
|
-
ariaMenuProps: menuProps,
|
|
16901
|
-
onClose: () => state.close(),
|
|
16902
|
-
items,
|
|
16903
|
-
persistentItems,
|
|
16904
|
-
searchable,
|
|
16905
|
-
contrast,
|
|
16906
|
-
selectedItem,
|
|
16907
|
-
onChange,
|
|
16908
|
-
...tid
|
|
16909
|
-
}
|
|
16910
|
-
)
|
|
16911
|
-
}
|
|
16912
|
-
);
|
|
16913
|
-
}
|
|
16914
|
-
function isSelectionButtonMenuProps(props) {
|
|
16915
|
-
return typeof props === "object" && "selectedItem" in props && "onChange" in props;
|
|
16916
|
-
}
|
|
16917
|
-
|
|
16918
16921
|
// src/components/Card.tsx
|
|
16919
16922
|
import { useMemo as useMemo38 } from "react";
|
|
16920
16923
|
import { useHover as useHover16 } from "react-aria";
|