@databricks/design-system 1.9.1 → 1.10.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/{Typography-84a00e02.js → Spinner-140f57ac.js} +1135 -75
- package/dist/Spinner-140f57ac.js.map +1 -0
- package/dist/common-3ab0e300.js +15 -0
- package/dist/common-3ab0e300.js.map +1 -0
- package/dist/design-system/AutoComplete/AutoComplete.d.ts.map +1 -1
- package/dist/design-system/Button/Button.d.ts +5 -1
- package/dist/design-system/Button/Button.d.ts.map +1 -1
- package/dist/design-system/Button/styles.d.ts.map +1 -1
- package/dist/design-system/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/design-system/DatePicker/DatePicker.d.ts +18 -14
- package/dist/design-system/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/design-system/DesignSystemProvider/DesignSystemProvider.d.ts +3 -1
- package/dist/design-system/DesignSystemProvider/DesignSystemProvider.d.ts.map +1 -1
- package/dist/design-system/Drawer/Drawer.d.ts +12 -1
- package/dist/design-system/Drawer/Drawer.d.ts.map +1 -1
- package/dist/design-system/FormMessage/FormMessage.d.ts.map +1 -1
- package/dist/design-system/FormV2/RHFAdapters.d.ts +7 -7
- package/dist/design-system/FormV2/RHFAdapters.d.ts.map +1 -1
- package/dist/design-system/Hooks/useDesignSystemTheme.d.ts.map +1 -1
- package/dist/design-system/Icon/__generated/icons/BracketsXIcon.v2.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/BracketsXIcon.v2.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/CloudModelIcon.v2.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/CloudModelIcon.v2.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/CursorIcon.v2.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/CursorIcon.v2.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/DagIcon.v2.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/DagIcon.v2.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/DecimalIcon.v2.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/DecimalIcon.v2.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/DotsCircleIcon.v2.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/DotsCircleIcon.v2.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/LettersIcon.v2.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/LettersIcon.v2.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/NumbersIcon.v2.d.ts +4 -0
- package/dist/design-system/Icon/__generated/icons/NumbersIcon.v2.d.ts.map +1 -0
- package/dist/design-system/Icon/__generated/icons/index.d.ts +8 -1
- package/dist/design-system/Icon/__generated/icons/index.d.ts.map +1 -1
- package/dist/design-system/LegacyTable/LegacyTable.d.ts +100 -0
- package/dist/design-system/LegacyTable/LegacyTable.d.ts.map +1 -0
- package/dist/design-system/LegacyTable/index.d.ts +2 -0
- package/dist/design-system/LegacyTable/index.d.ts.map +1 -0
- package/dist/design-system/Modal/Modal.d.ts +3 -1
- package/dist/design-system/Modal/Modal.d.ts.map +1 -1
- package/dist/design-system/Notification/Notification.d.ts.map +1 -1
- package/dist/design-system/PageWrapper/PageWrapper.d.ts.map +1 -1
- package/dist/design-system/Popover/Popover.d.ts +2 -1
- package/dist/design-system/Popover/Popover.d.ts.map +1 -1
- package/dist/design-system/PopoverV2/PopoverV2.d.ts +1 -0
- package/dist/design-system/PopoverV2/PopoverV2.d.ts.map +1 -1
- package/dist/design-system/Radio/Radio.d.ts.map +1 -1
- package/dist/design-system/SegmentedControl/SegmentedControl.d.ts +0 -2
- package/dist/design-system/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/design-system/Select/Select.d.ts.map +1 -1
- package/dist/design-system/Sidebar/Sidebar.d.ts +1 -1
- package/dist/design-system/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/design-system/SplitButton/Dropdown/DropdownButton.d.ts.map +1 -1
- package/dist/design-system/Table/index.d.ts +1 -1
- package/dist/design-system/ToggleButton/ToggleButton.d.ts.map +1 -1
- package/dist/design-system/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/design-system/index.d.ts +1 -1
- package/dist/design-system/index.d.ts.map +1 -1
- package/dist/development/Filter/Filter.d.ts +10 -0
- package/dist/development/Filter/Filter.d.ts.map +1 -0
- package/dist/development/Filter/Filter.test.d.ts +2 -0
- package/dist/development/Filter/Filter.test.d.ts.map +1 -0
- package/dist/development/Filter/FilterButtonContainer.d.ts +2 -0
- package/dist/development/Filter/FilterButtonContainer.d.ts.map +1 -0
- package/dist/development/Filter/FilterContent.d.ts +14 -0
- package/dist/development/Filter/FilterContent.d.ts.map +1 -0
- package/dist/development/Filter/FilterCountBadge.d.ts +2 -0
- package/dist/development/Filter/FilterCountBadge.d.ts.map +1 -0
- package/dist/development/Filter/FilterLoadingSpinner.d.ts +2 -0
- package/dist/development/Filter/FilterLoadingSpinner.d.ts.map +1 -0
- package/dist/development/Filter/FilterOptionControlledList.d.ts +9 -0
- package/dist/development/Filter/FilterOptionControlledList.d.ts.map +1 -0
- package/dist/development/Filter/FilterOptionList.d.ts +10 -0
- package/dist/development/Filter/FilterOptionList.d.ts.map +1 -0
- package/dist/development/Filter/FilterOptionListCheckboxItem.d.ts +11 -0
- package/dist/development/Filter/FilterOptionListCheckboxItem.d.ts.map +1 -0
- package/dist/development/Filter/FilterOptionListSearch.d.ts +7 -0
- package/dist/development/Filter/FilterOptionListSearch.d.ts.map +1 -0
- package/dist/development/Filter/FilterOptionListSelectItem.d.ts +10 -0
- package/dist/development/Filter/FilterOptionListSelectItem.d.ts.map +1 -0
- package/dist/development/Filter/FilterSectionHeader.d.ts +2 -0
- package/dist/development/Filter/FilterSectionHeader.d.ts.map +1 -0
- package/dist/development/Filter/FilterSeparator.d.ts +2 -0
- package/dist/development/Filter/FilterSeparator.d.ts.map +1 -0
- package/dist/development/Filter/FilterTrigger.d.ts +15 -0
- package/dist/development/Filter/FilterTrigger.d.ts.map +1 -0
- package/dist/development/Filter/hooks/useFilterContext.d.ts +2 -0
- package/dist/development/Filter/hooks/useFilterContext.d.ts.map +1 -0
- package/dist/development/Filter/hooks/useFilterOptionListContext.d.ts +2 -0
- package/dist/development/Filter/hooks/useFilterOptionListContext.d.ts.map +1 -0
- package/dist/development/Filter/index.d.ts +14 -0
- package/dist/development/Filter/index.d.ts.map +1 -0
- package/dist/development/Filter/providers/FilterContext.d.ts +15 -0
- package/dist/development/Filter/providers/FilterContext.d.ts.map +1 -0
- package/dist/development/Filter/providers/FilterOptionListContext.d.ts +10 -0
- package/dist/development/Filter/providers/FilterOptionListContext.d.ts.map +1 -0
- package/dist/development/Filter/shared.d.ts +3 -0
- package/dist/development/Filter/shared.d.ts.map +1 -0
- package/dist/development/Slider/Slider.d.ts.map +1 -1
- package/dist/development/TableUI/index.d.ts +33 -0
- package/dist/development/TableUI/index.d.ts.map +1 -1
- package/dist/development/index.d.ts +1 -0
- package/dist/development/index.d.ts.map +1 -1
- package/dist/development.js +1097 -472
- package/dist/development.js.map +1 -1
- package/dist/index-dark.css +1 -0
- package/dist/index-mfe-dark.css +1 -0
- package/dist/index-mfe.css +1 -0
- package/dist/index.css +1 -0
- package/dist/index.js +836 -1558
- package/dist/index.js.map +1 -1
- package/dist/test-utils/common.d.ts +11 -0
- package/dist/test-utils/common.d.ts.map +1 -0
- package/dist/test-utils/enzyme/index.d.ts +1 -0
- package/dist/test-utils/enzyme/index.d.ts.map +1 -1
- package/dist/test-utils/enzyme/selectEvent.d.ts +42 -0
- package/dist/test-utils/enzyme/selectEvent.d.ts.map +1 -0
- package/dist/test-utils/enzyme/selectEvent.test.d.ts +2 -0
- package/dist/test-utils/enzyme/selectEvent.test.d.ts.map +1 -0
- package/dist/test-utils/enzyme/utils.d.ts +33 -0
- package/dist/test-utils/enzyme/utils.d.ts.map +1 -0
- package/dist/test-utils/enzyme.js +258 -1
- package/dist/test-utils/enzyme.js.map +1 -1
- package/dist/test-utils/rtl/index.d.ts +1 -0
- package/dist/test-utils/rtl/index.d.ts.map +1 -1
- package/dist/test-utils/rtl/selectEvent.d.ts +41 -0
- package/dist/test-utils/rtl/selectEvent.d.ts.map +1 -0
- package/dist/test-utils/rtl/selectEvent.test.d.ts +2 -0
- package/dist/test-utils/rtl/selectEvent.test.d.ts.map +1 -0
- package/dist/test-utils/rtl.js +135 -1
- package/dist/test-utils/rtl.js.map +1 -1
- package/dist/test-utils/types.d.ts +1 -14
- package/dist/test-utils/types.d.ts.map +1 -1
- package/dist/theme/colorList.d.ts +7 -8
- package/dist/theme/colorList.d.ts.map +1 -1
- package/dist/theme/colors.d.ts +9 -11
- package/dist/theme/colors.d.ts.map +1 -1
- package/dist/theme/convertToLessVars.d.ts +3 -4
- package/dist/theme/convertToLessVars.d.ts.map +1 -1
- package/dist/theme/generalVariables.d.ts +4 -0
- package/dist/theme/generalVariables.d.ts.map +1 -1
- package/dist/theme/index.d.ts +7 -3
- package/dist/theme/index.d.ts.map +1 -1
- package/package.json +7 -6
- package/dist/Typography-52abe0b7.js +0 -1142
- package/dist/Typography-52abe0b7.js.map +0 -1
- package/dist/Typography-84a00e02.js.map +0 -1
- package/dist/design-system/Icon/__generated/icons/ArrayIcon.v2.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/ArrayIcon.v2.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/BookmarkBorderIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/BookmarkBorderIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/BracketsIcon.v2.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/BracketsIcon.v2.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/CheckCircleBorderIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/CheckCircleBorderIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/ClusterIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/ClusterIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/ClustersIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/ClustersIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/DataMarketplace.v2.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/DataMarketplace.v2.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/ErrorBorderIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/ErrorBorderIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/ErrorFillIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/ErrorFillIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/ExperimentIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/ExperimentIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/Folder1Icon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/Folder1Icon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/Gear1Icon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/Gear1Icon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/InfoBorderIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/InfoBorderIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/LifesaverIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/LifesaverIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/LinkRemoveIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/LinkRemoveIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/LockBorderIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/LockBorderIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/MinusCircleBorderIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/MinusCircleBorderIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/NotificationsOffIcon.v2.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/NotificationsOffIcon.v2.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/PinBorderIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/PinBorderIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/PlayCircleBorderIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/PlayCircleBorderIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/PlusCircleBorderIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/PlusCircleBorderIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/QueryListViewIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/QueryListViewIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/QueryNavIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/QueryNavIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/QuestionMarkBorderIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/QuestionMarkBorderIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/Redo.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/Redo.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/RedoIcon.v2.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/RedoIcon.v2.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/Refresh.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/Refresh.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/Refresh.v2.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/Refresh.v2.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/RefreshIcon.v2.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/RefreshIcon.v2.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/Search1Icon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/Search1Icon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/StarBorderIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/StarBorderIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/StopCircleBorderIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/StopCircleBorderIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/StopCricleFillIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/StopCricleFillIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/Undo.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/Undo.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/Visible.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/Visible.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/VisibleOff.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/VisibleOff.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/WarningBorderIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/WarningBorderIcon.d.ts.map +0 -1
- package/dist/design-system/Icon/__generated/icons/XCircleBorderIcon.d.ts +0 -4
- package/dist/design-system/Icon/__generated/icons/XCircleBorderIcon.d.ts.map +0 -1
- package/dist/test-utils/enzyme.d.ts +0 -8
- package/dist/test-utils/enzyme.d.ts.map +0 -1
- package/dist/test-utils/rtl.d.ts +0 -7
- package/dist/test-utils/rtl.d.ts.map +0 -1
package/dist/development.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useContext,
|
|
3
|
-
import { jsx,
|
|
4
|
-
import { u as useDesignSystemTheme
|
|
1
|
+
import { css } from '@emotion/react';
|
|
2
|
+
import React__default, { createContext, useContext, useState, useEffect, forwardRef } from 'react';
|
|
3
|
+
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
4
|
+
import { u as useDesignSystemTheme, S as Spinner, c as useDesignSystemContext, i as importantify, j as Checkbox, h as Input, x as SearchIcon, d as CheckIcon, X as XCircleFillIcon, C as ChevronDownIcon, e as Tooltip, B as Button, b as CloseIcon, T as Typography, y as SortAscendingIcon, z as SortDescendingIcon, E as SortUnsortedIcon } from './Spinner-140f57ac.js';
|
|
5
|
+
import * as Popover from '@radix-ui/react-popover';
|
|
5
6
|
import * as RadixSlider from '@radix-ui/react-slider';
|
|
6
7
|
import 'antd';
|
|
7
8
|
import 'classnames';
|
|
8
|
-
import chroma from 'chroma-js';
|
|
9
|
-
import '@ant-design/icons';
|
|
10
9
|
import 'lodash/isNil';
|
|
11
10
|
import 'lodash/endsWith';
|
|
12
11
|
import 'lodash/isBoolean';
|
|
@@ -14,57 +13,964 @@ import 'lodash/isNumber';
|
|
|
14
13
|
import 'lodash/isString';
|
|
15
14
|
import 'lodash/mapValues';
|
|
16
15
|
import '@emotion/unitless';
|
|
16
|
+
import 'chroma-js';
|
|
17
|
+
import '@ant-design/icons';
|
|
18
|
+
|
|
19
|
+
const filterContextDefaults = {
|
|
20
|
+
label: '',
|
|
21
|
+
value: [],
|
|
22
|
+
isInsideFilter: false,
|
|
23
|
+
multiSelect: false,
|
|
24
|
+
setValue: () => {},
|
|
25
|
+
setIsControlled: () => {}
|
|
26
|
+
};
|
|
27
|
+
const FilterContext = /*#__PURE__*/createContext(filterContextDefaults);
|
|
28
|
+
const FilterContextProvider = _ref => {
|
|
29
|
+
let {
|
|
30
|
+
children,
|
|
31
|
+
value
|
|
32
|
+
} = _ref;
|
|
33
|
+
return jsx(FilterContext.Provider, {
|
|
34
|
+
value: value,
|
|
35
|
+
children: children
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const useFilterContext = () => {
|
|
40
|
+
return useContext(FilterContext);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const Filter = _ref => {
|
|
44
|
+
let {
|
|
45
|
+
children,
|
|
46
|
+
label,
|
|
47
|
+
value = [],
|
|
48
|
+
...props
|
|
49
|
+
} = _ref;
|
|
50
|
+
// Used to avoid infinite loop when value is controlled from within the component (FilterOptionControlledList)
|
|
51
|
+
// We can't remove setValue altogether because uncontrolled component users need to be able to set the value from root for trigger to update
|
|
52
|
+
const [isControlled, setIsControlled] = useState(false);
|
|
53
|
+
const [selectedValue, setSelectedValue] = useState(value);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (!isControlled) {
|
|
56
|
+
setSelectedValue(value);
|
|
57
|
+
}
|
|
58
|
+
}, [value, isControlled]);
|
|
59
|
+
return jsx(FilterContextProvider, {
|
|
60
|
+
value: {
|
|
61
|
+
label,
|
|
62
|
+
value: selectedValue,
|
|
63
|
+
setValue: setSelectedValue,
|
|
64
|
+
setIsControlled,
|
|
65
|
+
isInsideFilter: true,
|
|
66
|
+
multiSelect: props.multiSelect
|
|
67
|
+
},
|
|
68
|
+
children: jsx(Root$1, {
|
|
69
|
+
...props,
|
|
70
|
+
children: children
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
const Root$1 = props => {
|
|
75
|
+
const {
|
|
76
|
+
children,
|
|
77
|
+
stayOpenOnSelection,
|
|
78
|
+
open,
|
|
79
|
+
multiSelect,
|
|
80
|
+
...restProps
|
|
81
|
+
} = props;
|
|
82
|
+
const {
|
|
83
|
+
value
|
|
84
|
+
} = useFilterContext();
|
|
85
|
+
const [isOpen, setIsOpen] = useState(!!open);
|
|
86
|
+
const handleOpenChange = open => {
|
|
87
|
+
setIsOpen(open);
|
|
88
|
+
};
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
if (!stayOpenOnSelection && (typeof stayOpenOnSelection === 'boolean' || !multiSelect)) {
|
|
91
|
+
setIsOpen(false);
|
|
92
|
+
}
|
|
93
|
+
}, [value, stayOpenOnSelection, multiSelect]);
|
|
94
|
+
return jsx(Popover.Root, {
|
|
95
|
+
open: open !== undefined ? open : isOpen,
|
|
96
|
+
onOpenChange: handleOpenChange,
|
|
97
|
+
...restProps,
|
|
98
|
+
children: children
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const getFilterButtonContainerStyles = theme => {
|
|
103
|
+
return /*#__PURE__*/css({
|
|
104
|
+
display: 'flex',
|
|
105
|
+
flexDirection: 'row',
|
|
106
|
+
justifyContent: 'flex-end',
|
|
107
|
+
alignItems: 'flex-end',
|
|
108
|
+
padding: "".concat(theme.spacing.sm, "px ").concat(theme.spacing.lg / 2, "px ").concat(theme.spacing.sm, "px ").concat(theme.spacing.lg / 2, "px"),
|
|
109
|
+
gap: theme.spacing.sm,
|
|
110
|
+
alignSelf: 'stretch'
|
|
111
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:getFilterButtonContainerStyles;");
|
|
112
|
+
};
|
|
113
|
+
const FilterButtonContainer = _ref => {
|
|
114
|
+
let {
|
|
115
|
+
children,
|
|
116
|
+
...restProps
|
|
117
|
+
} = _ref;
|
|
118
|
+
const {
|
|
119
|
+
theme
|
|
120
|
+
} = useDesignSystemTheme();
|
|
121
|
+
const {
|
|
122
|
+
isInsideFilter
|
|
123
|
+
} = useFilterContext();
|
|
124
|
+
if (!isInsideFilter) {
|
|
125
|
+
throw new Error('`FilterButtonContainer` must be used within `Filter`');
|
|
126
|
+
}
|
|
127
|
+
return jsx("div", {
|
|
128
|
+
...restProps,
|
|
129
|
+
css: getFilterButtonContainerStyles(theme),
|
|
130
|
+
children: children
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const FilterLoadingSpinner = props => {
|
|
135
|
+
const {
|
|
136
|
+
theme
|
|
137
|
+
} = useDesignSystemTheme();
|
|
138
|
+
return jsx(Spinner, {
|
|
139
|
+
css: /*#__PURE__*/css({
|
|
140
|
+
display: 'flex',
|
|
141
|
+
alignSelf: 'center',
|
|
142
|
+
justifyContent: 'center',
|
|
143
|
+
alignItems: 'center',
|
|
144
|
+
height: theme.general.heightSm,
|
|
145
|
+
width: theme.general.heightSm,
|
|
146
|
+
'> span': {
|
|
147
|
+
fontSize: 20
|
|
148
|
+
}
|
|
149
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:FilterLoadingSpinner;"),
|
|
150
|
+
...props
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__$6() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
155
|
+
const getContentWrapperStyles = (theme, _ref) => {
|
|
156
|
+
let {
|
|
157
|
+
maxHeight = '100vh',
|
|
158
|
+
maxWidth = '100vw',
|
|
159
|
+
minHeight = 0,
|
|
160
|
+
minWidth = 0
|
|
161
|
+
} = _ref;
|
|
162
|
+
return /*#__PURE__*/css({
|
|
163
|
+
maxHeight,
|
|
164
|
+
maxWidth,
|
|
165
|
+
minHeight,
|
|
166
|
+
minWidth,
|
|
167
|
+
background: theme.colors.backgroundPrimary,
|
|
168
|
+
color: theme.colors.textPrimary,
|
|
169
|
+
overflow: 'auto',
|
|
170
|
+
// Making sure the content popover overlaps the remove button when opens to the right
|
|
171
|
+
zIndex: theme.options.zIndexBase + 10,
|
|
172
|
+
boxSizing: 'border-box',
|
|
173
|
+
padding: "".concat(theme.spacing.xs, "px 0"),
|
|
174
|
+
border: "1px solid ".concat(theme.colors.border),
|
|
175
|
+
boxShadow: theme.general.shadowLow,
|
|
176
|
+
borderRadius: 4,
|
|
177
|
+
colorScheme: theme.isDarkMode ? 'dark' : 'light'
|
|
178
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:getContentWrapperStyles;");
|
|
179
|
+
};
|
|
180
|
+
var _ref3 = process.env.NODE_ENV === "production" ? {
|
|
181
|
+
name: "1ij1o5n",
|
|
182
|
+
styles: "display:flex;flex-direction:column;align-items:flex-start;justify-content:center"
|
|
183
|
+
} : {
|
|
184
|
+
name: "qbojwf-FilterContent",
|
|
185
|
+
styles: "display:flex;flex-direction:column;align-items:flex-start;justify-content:center;label:FilterContent;",
|
|
186
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$6
|
|
187
|
+
};
|
|
188
|
+
const FilterContent = /*#__PURE__*/forwardRef((_ref2, forwardedRef) => {
|
|
189
|
+
let {
|
|
190
|
+
children,
|
|
191
|
+
loading,
|
|
192
|
+
maxHeight,
|
|
193
|
+
maxWidth,
|
|
194
|
+
minHeight,
|
|
195
|
+
minWidth = 240,
|
|
196
|
+
align = 'start',
|
|
197
|
+
side = 'bottom',
|
|
198
|
+
sideOffset = 4,
|
|
199
|
+
...restProps
|
|
200
|
+
} = _ref2;
|
|
201
|
+
const {
|
|
202
|
+
theme
|
|
203
|
+
} = useDesignSystemTheme();
|
|
204
|
+
const {
|
|
205
|
+
label,
|
|
206
|
+
isInsideFilter
|
|
207
|
+
} = useFilterContext();
|
|
208
|
+
const {
|
|
209
|
+
getPopupContainer
|
|
210
|
+
} = useDesignSystemContext();
|
|
211
|
+
if (!isInsideFilter) {
|
|
212
|
+
throw new Error('`FilterContent` must be used within `Filter`');
|
|
213
|
+
}
|
|
214
|
+
return jsx(Popover.Portal, {
|
|
215
|
+
container: getPopupContainer && getPopupContainer(),
|
|
216
|
+
children: jsx(Popover.Content, {
|
|
217
|
+
"aria-label": "".concat(label, " filter options"),
|
|
218
|
+
"aria-busy": loading,
|
|
219
|
+
css: getContentWrapperStyles(theme, {
|
|
220
|
+
maxHeight,
|
|
221
|
+
maxWidth,
|
|
222
|
+
minHeight,
|
|
223
|
+
minWidth
|
|
224
|
+
}),
|
|
225
|
+
align: align,
|
|
226
|
+
side: side,
|
|
227
|
+
sideOffset: sideOffset,
|
|
228
|
+
...restProps,
|
|
229
|
+
ref: forwardedRef,
|
|
230
|
+
children: jsx("div", {
|
|
231
|
+
css: _ref3,
|
|
232
|
+
children: loading ? jsx(FilterLoadingSpinner, {
|
|
233
|
+
"aria-label": "Loading",
|
|
234
|
+
alt: "Loading spinner"
|
|
235
|
+
}) : children
|
|
236
|
+
})
|
|
237
|
+
})
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
const getCountBadgeStyles = theme => /*#__PURE__*/css(importantify({
|
|
242
|
+
display: 'inline-flex',
|
|
243
|
+
alignItems: 'center',
|
|
244
|
+
justifyContent: 'center',
|
|
245
|
+
boxSizing: 'border-box',
|
|
246
|
+
padding: "".concat(theme.spacing.xs / 2, "px ").concat(theme.spacing.xs, "px"),
|
|
247
|
+
background: theme.colors.tagDefault,
|
|
248
|
+
borderRadius: theme.general.borderRadiusBase,
|
|
249
|
+
fontWeight: theme.typography.typographyBoldFontWeight,
|
|
250
|
+
fontSize: theme.typography.fontSizeSm,
|
|
251
|
+
height: 20
|
|
252
|
+
}), process.env.NODE_ENV === "production" ? "" : ";label:getCountBadgeStyles;");
|
|
253
|
+
const FilterCountBadge = props => {
|
|
254
|
+
const {
|
|
255
|
+
theme
|
|
256
|
+
} = useDesignSystemTheme();
|
|
257
|
+
const {
|
|
258
|
+
value
|
|
259
|
+
} = useFilterContext();
|
|
260
|
+
return jsx("div", {
|
|
261
|
+
...props,
|
|
262
|
+
css: getCountBadgeStyles(theme),
|
|
263
|
+
children: Array.isArray(value) ? value.length : value ? 1 : 0
|
|
264
|
+
});
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
const FilterOptionListContext = /*#__PURE__*/createContext({});
|
|
268
|
+
const FilterOptionListContextProvider = _ref => {
|
|
269
|
+
let {
|
|
270
|
+
children,
|
|
271
|
+
value
|
|
272
|
+
} = _ref;
|
|
273
|
+
return jsx(FilterOptionListContext.Provider, {
|
|
274
|
+
value: value,
|
|
275
|
+
children: children
|
|
276
|
+
});
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
const useFilterOptionListContext = () => {
|
|
280
|
+
return useContext(FilterOptionListContext);
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
const getFilterOptionItemWrapperStyles = theme => {
|
|
284
|
+
return /*#__PURE__*/css(importantify({
|
|
285
|
+
display: 'flex',
|
|
286
|
+
flexDirection: 'row',
|
|
287
|
+
alignItems: 'center',
|
|
288
|
+
justifyContent: 'flex-start',
|
|
289
|
+
alignSelf: 'stretch',
|
|
290
|
+
padding: '6px 32px 6px 12px',
|
|
291
|
+
lineHeight: theme.typography.lineHeightBase,
|
|
292
|
+
height: theme.typography.lineHeightBase,
|
|
293
|
+
cursor: 'pointer',
|
|
294
|
+
userSelect: 'none',
|
|
295
|
+
'&:hover': {
|
|
296
|
+
background: theme.colors.actionTertiaryBackgroundHover
|
|
297
|
+
}
|
|
298
|
+
}), process.env.NODE_ENV === "production" ? "" : ";label:getFilterOptionItemWrapperStyles;");
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__$5() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
302
|
+
var _ref2$3 = process.env.NODE_ENV === "production" ? {
|
|
303
|
+
name: "je8g23",
|
|
304
|
+
styles: "pointer-events:none"
|
|
305
|
+
} : {
|
|
306
|
+
name: "1v7dgvu-FilterOptionListCheckboxItem",
|
|
307
|
+
styles: "pointer-events:none;label:FilterOptionListCheckboxItem;",
|
|
308
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$5
|
|
309
|
+
};
|
|
310
|
+
const FilterOptionListCheckboxItem = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
311
|
+
let {
|
|
312
|
+
value,
|
|
313
|
+
checked,
|
|
314
|
+
indeterminate,
|
|
315
|
+
onChange,
|
|
316
|
+
children,
|
|
317
|
+
...props
|
|
318
|
+
} = _ref;
|
|
319
|
+
const {
|
|
320
|
+
theme
|
|
321
|
+
} = useDesignSystemTheme();
|
|
322
|
+
const {
|
|
323
|
+
isInsideFilterOptionList
|
|
324
|
+
} = useFilterOptionListContext();
|
|
325
|
+
if (!isInsideFilterOptionList) {
|
|
326
|
+
throw new Error('`FilterOptionListCheckboxItem` must be used within `FilterOptionList`');
|
|
327
|
+
}
|
|
328
|
+
const handleSelect = () => {
|
|
329
|
+
if (onChange) {
|
|
330
|
+
onChange(value);
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
return jsx("div", {
|
|
334
|
+
ref: ref,
|
|
335
|
+
role: "option"
|
|
336
|
+
// Using aria-selected instead of aria-checked because the parent listbox
|
|
337
|
+
,
|
|
338
|
+
"aria-selected": indeterminate ? false : checked,
|
|
339
|
+
css: [getFilterOptionItemWrapperStyles(theme), process.env.NODE_ENV === "production" ? "" : ";label:FilterOptionListCheckboxItem;"],
|
|
340
|
+
onClick: handleSelect,
|
|
341
|
+
...props,
|
|
342
|
+
children: jsx(Checkbox, {
|
|
343
|
+
isChecked: indeterminate ? null : checked,
|
|
344
|
+
css: _ref2$3
|
|
345
|
+
// Needed because Antd handles keyboard inputs as clicks
|
|
346
|
+
,
|
|
347
|
+
onClick: e => {
|
|
348
|
+
e.stopPropagation();
|
|
349
|
+
handleSelect();
|
|
350
|
+
},
|
|
351
|
+
children: children !== null && children !== void 0 ? children : value
|
|
352
|
+
})
|
|
353
|
+
});
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
const filterChildren = (children, searchValue) => {
|
|
357
|
+
var _React$Children$map;
|
|
358
|
+
return (_React$Children$map = React__default.Children.map(children, child => {
|
|
359
|
+
if (child !== null && child !== void 0 && child.props.value.toLowerCase().includes(searchValue)) {
|
|
360
|
+
return child;
|
|
361
|
+
}
|
|
362
|
+
return null;
|
|
363
|
+
})) === null || _React$Children$map === void 0 ? void 0 : _React$Children$map.filter(child => child);
|
|
364
|
+
};
|
|
365
|
+
const FilterOptionListSearch = /*#__PURE__*/forwardRef((_ref, forwardedRef) => {
|
|
366
|
+
var _filteredChildren, _filteredChildren$pro, _filteredChildren2;
|
|
367
|
+
let {
|
|
368
|
+
onChange,
|
|
369
|
+
children,
|
|
370
|
+
hasWrapper,
|
|
371
|
+
...restProps
|
|
372
|
+
} = _ref;
|
|
373
|
+
const {
|
|
374
|
+
theme
|
|
375
|
+
} = useDesignSystemTheme();
|
|
376
|
+
const {
|
|
377
|
+
isInsideFilterOptionList
|
|
378
|
+
} = useFilterOptionListContext();
|
|
379
|
+
const [searchValue, setSearchValue] = React__default.useState();
|
|
380
|
+
if (!isInsideFilterOptionList) {
|
|
381
|
+
throw new Error('`FilterOptionListSearch` must be used within `FilterOptionList`');
|
|
382
|
+
}
|
|
383
|
+
const handleOnChange = event => {
|
|
384
|
+
setSearchValue(event.target.value.toLowerCase());
|
|
385
|
+
};
|
|
386
|
+
let filteredChildren = children;
|
|
387
|
+
if (searchValue) {
|
|
388
|
+
filteredChildren = filterChildren(hasWrapper ? children.props.children : children, searchValue);
|
|
389
|
+
if (hasWrapper) {
|
|
390
|
+
filteredChildren = /*#__PURE__*/React__default.cloneElement(children, {}, filteredChildren);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
return jsxs(Fragment, {
|
|
394
|
+
children: [jsx("div", {
|
|
395
|
+
css: /*#__PURE__*/css({
|
|
396
|
+
padding: "".concat(theme.spacing.sm, "px ").concat(theme.spacing.lg / 2, "px ").concat(theme.spacing.sm, "px"),
|
|
397
|
+
width: '100%',
|
|
398
|
+
boxSizing: 'border-box'
|
|
399
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:FilterOptionListSearch;"),
|
|
400
|
+
children: jsx(Input, {
|
|
401
|
+
ref: forwardedRef,
|
|
402
|
+
prefix: jsx(SearchIcon, {}),
|
|
403
|
+
placeholder: "Search",
|
|
404
|
+
onChange: handleOnChange,
|
|
405
|
+
value: searchValue,
|
|
406
|
+
...restProps
|
|
407
|
+
})
|
|
408
|
+
}), hasWrapper && (_filteredChildren = filteredChildren) !== null && _filteredChildren !== void 0 && (_filteredChildren$pro = _filteredChildren.props.children) !== null && _filteredChildren$pro !== void 0 && _filteredChildren$pro.length || !hasWrapper && (_filteredChildren2 = filteredChildren) !== null && _filteredChildren2 !== void 0 && _filteredChildren2.length ? filteredChildren : jsx("div", {
|
|
409
|
+
css: /*#__PURE__*/css({
|
|
410
|
+
color: theme.colors.textSecondary,
|
|
411
|
+
textAlign: 'center',
|
|
412
|
+
padding: '6px 32px 6px 12px',
|
|
413
|
+
width: '100%',
|
|
414
|
+
boxSizing: 'border-box'
|
|
415
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:FilterOptionListSearch;"),
|
|
416
|
+
children: "No results found"
|
|
417
|
+
})]
|
|
418
|
+
});
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__$4() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
422
|
+
var _ref2$2 = process.env.NODE_ENV === "production" ? {
|
|
423
|
+
name: "1cjitc6",
|
|
424
|
+
styles: "width:16px"
|
|
425
|
+
} : {
|
|
426
|
+
name: "1lwu3su-FilterOptionListSelectItem",
|
|
427
|
+
styles: "width:16px;label:FilterOptionListSelectItem;",
|
|
428
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$4
|
|
429
|
+
};
|
|
430
|
+
const FilterOptionListSelectItem = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
431
|
+
let {
|
|
432
|
+
value,
|
|
433
|
+
checked,
|
|
434
|
+
onChange,
|
|
435
|
+
children,
|
|
436
|
+
...props
|
|
437
|
+
} = _ref;
|
|
438
|
+
const {
|
|
439
|
+
theme
|
|
440
|
+
} = useDesignSystemTheme();
|
|
441
|
+
const {
|
|
442
|
+
isInsideFilterOptionList
|
|
443
|
+
} = useFilterOptionListContext();
|
|
444
|
+
if (!isInsideFilterOptionList) {
|
|
445
|
+
throw new Error('`FilterOptionListSelectItem` must be used within `FilterOptionList`');
|
|
446
|
+
}
|
|
447
|
+
const handleSelect = () => {
|
|
448
|
+
if (onChange) {
|
|
449
|
+
onChange(value);
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
return jsxs("div", {
|
|
453
|
+
ref: ref,
|
|
454
|
+
css: [getFilterOptionItemWrapperStyles(theme), {
|
|
455
|
+
'&:focus': {
|
|
456
|
+
background: theme.colors.actionTertiaryBackgroundHover,
|
|
457
|
+
outline: 'none'
|
|
458
|
+
}
|
|
459
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:FilterOptionListSelectItem;"],
|
|
460
|
+
...props,
|
|
461
|
+
onClick: handleSelect,
|
|
462
|
+
tabIndex: 0,
|
|
463
|
+
onKeyDown: e => {
|
|
464
|
+
switch (e.key) {
|
|
465
|
+
case 'ArrowDown':
|
|
466
|
+
e.preventDefault();
|
|
467
|
+
const nextSibling = e.currentTarget.nextElementSibling;
|
|
468
|
+
nextSibling === null || nextSibling === void 0 ? void 0 : nextSibling.focus();
|
|
469
|
+
break;
|
|
470
|
+
case 'ArrowUp':
|
|
471
|
+
e.preventDefault();
|
|
472
|
+
const previousSibling = e.currentTarget.previousElementSibling;
|
|
473
|
+
previousSibling === null || previousSibling === void 0 ? void 0 : previousSibling.focus();
|
|
474
|
+
break;
|
|
475
|
+
case ' ':
|
|
476
|
+
case 'Enter':
|
|
477
|
+
e.preventDefault();
|
|
478
|
+
handleSelect();
|
|
479
|
+
break;
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
role: "option",
|
|
483
|
+
"aria-selected": checked,
|
|
484
|
+
children: [checked ? jsx(CheckIcon, {}) : jsx("div", {
|
|
485
|
+
css: _ref2$2
|
|
486
|
+
}), jsx("label", {
|
|
487
|
+
style: {
|
|
488
|
+
marginLeft: theme.spacing.sm,
|
|
489
|
+
cursor: 'pointer'
|
|
490
|
+
},
|
|
491
|
+
children: children !== null && children !== void 0 ? children : value
|
|
492
|
+
})]
|
|
493
|
+
});
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__$3() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
497
|
+
var _ref2$1 = process.env.NODE_ENV === "production" ? {
|
|
498
|
+
name: "6kz1wu",
|
|
499
|
+
styles: "display:flex;flex-direction:column;align-items:flex-start"
|
|
500
|
+
} : {
|
|
501
|
+
name: "160mr8t-FilterOptionControlledList",
|
|
502
|
+
styles: "display:flex;flex-direction:column;align-items:flex-start;label:FilterOptionControlledList;",
|
|
503
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$3
|
|
504
|
+
};
|
|
505
|
+
const FilterOptionControlledList = /*#__PURE__*/forwardRef((_ref, forwardedRef) => {
|
|
506
|
+
let {
|
|
507
|
+
options,
|
|
508
|
+
onChange,
|
|
509
|
+
loading,
|
|
510
|
+
withProgressiveLoading,
|
|
511
|
+
withSearch,
|
|
512
|
+
showSelectAndClearAll,
|
|
513
|
+
...restProps
|
|
514
|
+
} = _ref;
|
|
515
|
+
const {
|
|
516
|
+
isInsideFilter,
|
|
517
|
+
multiSelect,
|
|
518
|
+
value,
|
|
519
|
+
setValue,
|
|
520
|
+
setIsControlled
|
|
521
|
+
} = useFilterContext();
|
|
522
|
+
if (!isInsideFilter) {
|
|
523
|
+
throw new Error('`FilterOptionControlledList` must be used within `Filter`');
|
|
524
|
+
}
|
|
525
|
+
const isOptionChecked = options.reduce((acc, option) => {
|
|
526
|
+
acc[option] = value === null || value === void 0 ? void 0 : value.includes(option);
|
|
527
|
+
return acc;
|
|
528
|
+
}, {});
|
|
529
|
+
const handleUpdate = updatedValue => {
|
|
530
|
+
setIsControlled(true);
|
|
531
|
+
let newValue = [];
|
|
532
|
+
if (multiSelect) {
|
|
533
|
+
if (value.find(item => item === updatedValue)) {
|
|
534
|
+
newValue = value.filter(item => item !== updatedValue);
|
|
535
|
+
} else {
|
|
536
|
+
newValue = [...value, updatedValue];
|
|
537
|
+
}
|
|
538
|
+
} else {
|
|
539
|
+
newValue = [updatedValue];
|
|
540
|
+
}
|
|
541
|
+
setValue(newValue);
|
|
542
|
+
isOptionChecked[updatedValue] = !isOptionChecked[updatedValue];
|
|
543
|
+
if (onChange) {
|
|
544
|
+
onChange(newValue);
|
|
545
|
+
}
|
|
546
|
+
};
|
|
547
|
+
const handleSelectAll = () => {
|
|
548
|
+
setIsControlled(true);
|
|
549
|
+
if (value.length === options.length) {
|
|
550
|
+
setValue([]);
|
|
551
|
+
options.forEach(option => {
|
|
552
|
+
isOptionChecked[option] = false;
|
|
553
|
+
});
|
|
554
|
+
if (onChange) {
|
|
555
|
+
onChange([]);
|
|
556
|
+
}
|
|
557
|
+
} else {
|
|
558
|
+
setValue(options);
|
|
559
|
+
options.forEach(option => {
|
|
560
|
+
isOptionChecked[option] = true;
|
|
561
|
+
});
|
|
562
|
+
if (onChange) {
|
|
563
|
+
onChange(options);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
const renderedOptions = jsxs(Fragment, {
|
|
568
|
+
children: [showSelectAndClearAll && multiSelect && jsx(FilterOptionListCheckboxItem, {
|
|
569
|
+
value: "all",
|
|
570
|
+
onChange: handleSelectAll,
|
|
571
|
+
checked: value.length === options.length,
|
|
572
|
+
indeterminate: !!value.length && value.length !== options.length,
|
|
573
|
+
children: value.length === options.length ? 'Clear all' : 'Select all'
|
|
574
|
+
}), options === null || options === void 0 ? void 0 : options.map((option, key) => multiSelect ? jsx(FilterOptionListCheckboxItem, {
|
|
575
|
+
value: option,
|
|
576
|
+
checked: isOptionChecked[option],
|
|
577
|
+
onChange: handleUpdate,
|
|
578
|
+
children: option
|
|
579
|
+
}, key) : jsx(FilterOptionListSelectItem, {
|
|
580
|
+
value: option,
|
|
581
|
+
checked: isOptionChecked[option],
|
|
582
|
+
onChange: handleUpdate,
|
|
583
|
+
children: option
|
|
584
|
+
}, key))]
|
|
585
|
+
});
|
|
586
|
+
return jsx("div", {
|
|
587
|
+
ref: forwardedRef,
|
|
588
|
+
"aria-busy": loading,
|
|
589
|
+
css: _ref2$1,
|
|
590
|
+
...restProps,
|
|
591
|
+
children: jsx(FilterOptionListContextProvider, {
|
|
592
|
+
value: {
|
|
593
|
+
isInsideFilterOptionList: true
|
|
594
|
+
},
|
|
595
|
+
children: jsx(Fragment, {
|
|
596
|
+
children: loading ? withProgressiveLoading ? jsxs(Fragment, {
|
|
597
|
+
children: [withSearch ? jsx(FilterOptionListSearch, {
|
|
598
|
+
hasWrapper: true,
|
|
599
|
+
children: renderedOptions
|
|
600
|
+
}) : renderedOptions, jsx(FilterLoadingSpinner, {
|
|
601
|
+
"aria-label": "Loading",
|
|
602
|
+
alt: "Loading spinner"
|
|
603
|
+
})]
|
|
604
|
+
}) : jsx(FilterLoadingSpinner, {
|
|
605
|
+
"aria-label": "Loading",
|
|
606
|
+
alt: "Loading spinner"
|
|
607
|
+
}) : withSearch ? jsx(FilterOptionListSearch, {
|
|
608
|
+
hasWrapper: true,
|
|
609
|
+
children: renderedOptions
|
|
610
|
+
}) : renderedOptions
|
|
611
|
+
})
|
|
612
|
+
})
|
|
613
|
+
});
|
|
614
|
+
});
|
|
615
|
+
|
|
616
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__$2() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
617
|
+
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
618
|
+
name: "1pgv7dg",
|
|
619
|
+
styles: "display:flex;flex-direction:column;align-items:flex-start;width:100%"
|
|
620
|
+
} : {
|
|
621
|
+
name: "s7a3b7-FilterOptionList",
|
|
622
|
+
styles: "display:flex;flex-direction:column;align-items:flex-start;width:100%;label:FilterOptionList;",
|
|
623
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$2
|
|
624
|
+
};
|
|
625
|
+
const FilterOptionList = /*#__PURE__*/forwardRef((_ref, forwardedRef) => {
|
|
626
|
+
let {
|
|
627
|
+
children,
|
|
628
|
+
onChange,
|
|
629
|
+
loading,
|
|
630
|
+
withProgressiveLoading,
|
|
631
|
+
...restProps
|
|
632
|
+
} = _ref;
|
|
633
|
+
const {
|
|
634
|
+
isInsideFilter,
|
|
635
|
+
value
|
|
636
|
+
} = useFilterContext();
|
|
637
|
+
if (!isInsideFilter) {
|
|
638
|
+
throw new Error('`FilterOptionList` must be used within `Filter`');
|
|
639
|
+
}
|
|
640
|
+
useEffect(() => {
|
|
641
|
+
if (onChange) {
|
|
642
|
+
onChange(value);
|
|
643
|
+
}
|
|
644
|
+
}, [value, onChange]);
|
|
645
|
+
return jsx("div", {
|
|
646
|
+
ref: forwardedRef,
|
|
647
|
+
"aria-busy": loading,
|
|
648
|
+
role: "list",
|
|
649
|
+
css: _ref2,
|
|
650
|
+
...restProps,
|
|
651
|
+
children: jsx(FilterOptionListContextProvider, {
|
|
652
|
+
value: {
|
|
653
|
+
isInsideFilterOptionList: true
|
|
654
|
+
},
|
|
655
|
+
children: loading ? withProgressiveLoading ? jsxs(Fragment, {
|
|
656
|
+
children: [children, jsx(FilterLoadingSpinner, {
|
|
657
|
+
"aria-label": "Loading",
|
|
658
|
+
alt: "Loading spinner"
|
|
659
|
+
})]
|
|
660
|
+
}) : jsx(FilterLoadingSpinner, {
|
|
661
|
+
"aria-label": "Loading",
|
|
662
|
+
alt: "Loading spinner"
|
|
663
|
+
}) : children
|
|
664
|
+
})
|
|
665
|
+
});
|
|
666
|
+
});
|
|
667
|
+
|
|
668
|
+
const FilterSectionHeader = _ref => {
|
|
669
|
+
let {
|
|
670
|
+
children,
|
|
671
|
+
...props
|
|
672
|
+
} = _ref;
|
|
673
|
+
const {
|
|
674
|
+
theme
|
|
675
|
+
} = useDesignSystemTheme();
|
|
676
|
+
const {
|
|
677
|
+
isInsideFilter
|
|
678
|
+
} = useFilterContext();
|
|
679
|
+
if (!isInsideFilter) {
|
|
680
|
+
throw new Error('`FilterSectionHeader` must be used within `Filter`');
|
|
681
|
+
}
|
|
682
|
+
return jsx("div", {
|
|
683
|
+
...props,
|
|
684
|
+
css: /*#__PURE__*/css({
|
|
685
|
+
display: 'flex',
|
|
686
|
+
flexDirection: 'row',
|
|
687
|
+
alignItems: 'flex-start',
|
|
688
|
+
padding: "".concat(theme.spacing.xs, "px ").concat(theme.spacing.lg / 2, "px"),
|
|
689
|
+
alignSelf: 'stretch',
|
|
690
|
+
fontWeight: 400,
|
|
691
|
+
color: theme.colors.textSecondary
|
|
692
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:FilterSectionHeader;"),
|
|
693
|
+
children: children
|
|
694
|
+
});
|
|
695
|
+
};
|
|
696
|
+
|
|
697
|
+
const FilterSeparator = props => {
|
|
698
|
+
const {
|
|
699
|
+
theme
|
|
700
|
+
} = useDesignSystemTheme();
|
|
701
|
+
const {
|
|
702
|
+
isInsideFilter
|
|
703
|
+
} = useFilterContext();
|
|
704
|
+
if (!isInsideFilter) {
|
|
705
|
+
throw new Error('`FilterSeparator` must be used within `Filter`');
|
|
706
|
+
}
|
|
707
|
+
return jsx("div", {
|
|
708
|
+
...props,
|
|
709
|
+
css: /*#__PURE__*/css({
|
|
710
|
+
display: 'flex',
|
|
711
|
+
flexDirection: 'row',
|
|
712
|
+
alignItems: 'center',
|
|
713
|
+
margin: "".concat(theme.spacing.xs, "px ").concat(theme.spacing.lg / 2, "px"),
|
|
714
|
+
border: "1px solid ".concat(theme.colors.borderDecorative),
|
|
715
|
+
borderBottom: 0,
|
|
716
|
+
alignSelf: 'stretch'
|
|
717
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:FilterSeparator;")
|
|
718
|
+
});
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
const getTriggerWrapperStyles = removable => /*#__PURE__*/css(importantify({
|
|
722
|
+
display: 'inline-flex',
|
|
723
|
+
alignItems: 'center',
|
|
724
|
+
...(removable && {
|
|
725
|
+
'& > button:last-of-type': importantify({
|
|
726
|
+
borderBottomLeftRadius: 0,
|
|
727
|
+
borderTopLeftRadius: 0,
|
|
728
|
+
marginLeft: -1
|
|
729
|
+
})
|
|
730
|
+
})
|
|
731
|
+
}), process.env.NODE_ENV === "production" ? "" : ";label:getTriggerWrapperStyles;");
|
|
732
|
+
const getTriggerStyles = (theme, maxWidth, removable) => {
|
|
733
|
+
const removeButtonInteractionStyles = {
|
|
734
|
+
...(removable && {
|
|
735
|
+
zIndex: theme.options.zIndexBase + 2,
|
|
736
|
+
'&& + button': {
|
|
737
|
+
marginLeft: -1,
|
|
738
|
+
zIndex: theme.options.zIndexBase + 1
|
|
739
|
+
}
|
|
740
|
+
})
|
|
741
|
+
};
|
|
742
|
+
return /*#__PURE__*/css(importantify({
|
|
743
|
+
position: 'relative',
|
|
744
|
+
display: 'inline-flex',
|
|
745
|
+
alignItems: 'center',
|
|
746
|
+
maxWidth: maxWidth,
|
|
747
|
+
justifyContent: 'center',
|
|
748
|
+
background: 'transparent',
|
|
749
|
+
padding: '6px 8px 6px 12px',
|
|
750
|
+
boxSizing: 'border-box',
|
|
751
|
+
height: theme.general.heightSm,
|
|
752
|
+
border: "1px solid ".concat(theme.colors.actionDefaultBorderDefault),
|
|
753
|
+
borderRadius: 4,
|
|
754
|
+
color: theme.colors.textPrimary,
|
|
755
|
+
lineHeight: theme.typography.lineHeightBase,
|
|
756
|
+
cursor: 'pointer',
|
|
757
|
+
...(removable && {
|
|
758
|
+
borderBottomRightRadius: 0,
|
|
759
|
+
borderTopRightRadius: 0,
|
|
760
|
+
borderRightColor: 'transparent'
|
|
761
|
+
}),
|
|
762
|
+
'&:hover': {
|
|
763
|
+
background: theme.colors.actionDefaultBackgroundHover,
|
|
764
|
+
borderColor: theme.colors.actionDefaultBorderHover,
|
|
765
|
+
...removeButtonInteractionStyles
|
|
766
|
+
},
|
|
767
|
+
'&:focus': {
|
|
768
|
+
borderColor: theme.colors.actionDefaultBorderFocus,
|
|
769
|
+
...removeButtonInteractionStyles
|
|
770
|
+
}
|
|
771
|
+
}), process.env.NODE_ENV === "production" ? "" : ";label:getTriggerStyles;");
|
|
772
|
+
};
|
|
773
|
+
const FilterTrigger = /*#__PURE__*/forwardRef((_ref, forwardedRef) => {
|
|
774
|
+
let {
|
|
775
|
+
removable = false,
|
|
776
|
+
onRemove,
|
|
777
|
+
children,
|
|
778
|
+
maxWidth = 9999,
|
|
779
|
+
withCountBadge,
|
|
780
|
+
showBadgeAfterValueCount = 3,
|
|
781
|
+
allowClear = true,
|
|
782
|
+
controlled,
|
|
783
|
+
onClear,
|
|
784
|
+
...restProps
|
|
785
|
+
} = _ref;
|
|
786
|
+
const {
|
|
787
|
+
theme
|
|
788
|
+
} = useDesignSystemTheme();
|
|
789
|
+
const {
|
|
790
|
+
label,
|
|
791
|
+
value,
|
|
792
|
+
isInsideFilter,
|
|
793
|
+
multiSelect,
|
|
794
|
+
setValue
|
|
795
|
+
} = useFilterContext();
|
|
796
|
+
if (!isInsideFilter) {
|
|
797
|
+
throw new Error('`FilterTrigger` must be used within `Filter`');
|
|
798
|
+
}
|
|
799
|
+
const handleRemove = () => {
|
|
800
|
+
if (!onRemove) {
|
|
801
|
+
console.warn('Filter.Trigger: Attempted remove without providing onRemove handler');
|
|
802
|
+
} else {
|
|
803
|
+
onRemove();
|
|
804
|
+
}
|
|
805
|
+
};
|
|
806
|
+
const handleClear = e => {
|
|
807
|
+
e.stopPropagation();
|
|
808
|
+
if (controlled) {
|
|
809
|
+
setValue([]);
|
|
810
|
+
} else if (!onClear) {
|
|
811
|
+
console.warn('Filter.Trigger: Attempted clear without providing onClear handler');
|
|
812
|
+
} else {
|
|
813
|
+
onClear();
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
const [showTooltip, setShowTooltip] = React__default.useState();
|
|
817
|
+
const triggerContentRef = React__default.useRef(null);
|
|
818
|
+
useEffect(() => {
|
|
819
|
+
if ((value === null || value === void 0 ? void 0 : value.length) > showBadgeAfterValueCount) {
|
|
820
|
+
setShowTooltip(true);
|
|
821
|
+
} else if (triggerContentRef.current) {
|
|
822
|
+
const {
|
|
823
|
+
clientWidth,
|
|
824
|
+
scrollWidth
|
|
825
|
+
} = triggerContentRef.current;
|
|
826
|
+
setShowTooltip(clientWidth < scrollWidth);
|
|
827
|
+
}
|
|
828
|
+
}, [showBadgeAfterValueCount, value]);
|
|
829
|
+
const concatenatedValues = Array.isArray(value) ? value.join(', ') : value;
|
|
830
|
+
const displayedValues = jsx("span", {
|
|
831
|
+
children: concatenatedValues
|
|
832
|
+
});
|
|
833
|
+
let ariaLabel = "".concat(label, " filter");
|
|
834
|
+
if (value !== null && value !== void 0 && value.length) {
|
|
835
|
+
ariaLabel += multiSelect ? ", multiselectable, ".concat(value.length, " options selected: ").concat(concatenatedValues) : ", selected option: ".concat(concatenatedValues);
|
|
836
|
+
} else {
|
|
837
|
+
ariaLabel += multiSelect ? ', multiselectable, 0 options selected' : ', no option selected';
|
|
838
|
+
}
|
|
839
|
+
const triggerContent = children !== null && children !== void 0 ? children : jsxs(Popover.Trigger, {
|
|
840
|
+
"aria-label": ariaLabel,
|
|
841
|
+
ref: forwardedRef,
|
|
842
|
+
...restProps,
|
|
843
|
+
css: getTriggerStyles(theme, maxWidth, removable),
|
|
844
|
+
role: "listbox",
|
|
845
|
+
"aria-multiselectable": multiSelect,
|
|
846
|
+
children: [jsxs("span", {
|
|
847
|
+
css: /*#__PURE__*/css({
|
|
848
|
+
whiteSpace: 'nowrap',
|
|
849
|
+
overflow: 'hidden',
|
|
850
|
+
textOverflow: 'ellipsis',
|
|
851
|
+
height: theme.typography.lineHeightBase
|
|
852
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:triggerContent;"),
|
|
853
|
+
ref: triggerContentRef,
|
|
854
|
+
children: [jsx("span", {
|
|
855
|
+
css: /*#__PURE__*/css({
|
|
856
|
+
marginRight: theme.spacing.xs,
|
|
857
|
+
fontWeight: theme.typography.typographyBoldFontWeight
|
|
858
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:triggerContent;"),
|
|
859
|
+
children: label
|
|
860
|
+
}), withCountBadge || (value === null || value === void 0 ? void 0 : value.length) > showBadgeAfterValueCount ? jsx(FilterCountBadge, {
|
|
861
|
+
role: "status",
|
|
862
|
+
"aria-label": "Filter options selected count"
|
|
863
|
+
}) : displayedValues]
|
|
864
|
+
}), allowClear && value !== null && value !== void 0 && value.length ? jsx(XCircleFillIcon, {
|
|
865
|
+
onClick: handleClear,
|
|
866
|
+
css: /*#__PURE__*/css({
|
|
867
|
+
color: theme.colors.textPlaceholder,
|
|
868
|
+
fontSize: theme.typography.fontSizeSm,
|
|
869
|
+
marginLeft: theme.spacing.xs,
|
|
870
|
+
':hover': {
|
|
871
|
+
color: theme.colors.actionTertiaryTextHover
|
|
872
|
+
}
|
|
873
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:triggerContent;")
|
|
874
|
+
}) : null, jsx(ChevronDownIcon, {
|
|
875
|
+
css: /*#__PURE__*/css({
|
|
876
|
+
color: theme.colors.textSecondary,
|
|
877
|
+
marginLeft: 4
|
|
878
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:triggerContent;")
|
|
879
|
+
})]
|
|
880
|
+
});
|
|
881
|
+
return jsxs("div", {
|
|
882
|
+
css: getTriggerWrapperStyles(removable),
|
|
883
|
+
children: [showTooltip && value !== null && value !== void 0 && value.length ? jsx(Tooltip, {
|
|
884
|
+
title: displayedValues,
|
|
885
|
+
children: triggerContent
|
|
886
|
+
}) : triggerContent, removable && jsx(Button, {
|
|
887
|
+
"aria-label": "Remove ".concat(label, " filters"),
|
|
888
|
+
onClick: handleRemove,
|
|
889
|
+
dangerouslySetForceIconStyles: true,
|
|
890
|
+
children: jsx(CloseIcon, {})
|
|
891
|
+
})]
|
|
892
|
+
});
|
|
893
|
+
});
|
|
17
894
|
|
|
18
895
|
function _EMOTION_STRINGIFIED_CSS_ERROR__$1() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
19
896
|
// For performance, these styles are defined outside of the component so they are not redefined on every render.
|
|
20
897
|
// We're also using CSS Variables rather than any dynamic styles so that the style object remains static.
|
|
21
898
|
const tableStyles = {
|
|
22
899
|
row: process.env.NODE_ENV === "production" ? {
|
|
23
|
-
name: "
|
|
24
|
-
styles: "display:flex;border-bottom:1px solid;border-color:var(--table-
|
|
900
|
+
name: "v9xe5f",
|
|
901
|
+
styles: "display:flex;border-bottom:1px solid;border-color:var(--table-separator-color);.table-row-select-cell input[type=\"checkbox\"] ~ *{opacity:var(--row-checkbox-opacity, 0);}&:hover{> *{background-color:var(--table-row-hover);}.table-row-select-cell input[type=\"checkbox\"] ~ *{opacity:1;}}.table-row-select-cell input[type=\"checkbox\"]:focus ~ *{opacity:1;}> *{padding-top:var(--table-row-vertical-padding);padding-bottom:var(--table-row-vertical-padding);}"
|
|
25
902
|
} : {
|
|
26
|
-
name: "
|
|
27
|
-
styles: "display:flex;border-bottom:1px solid;border-color:var(--table-
|
|
903
|
+
name: "19eijcc-row",
|
|
904
|
+
styles: "display:flex;border-bottom:1px solid;border-color:var(--table-separator-color);.table-row-select-cell input[type=\"checkbox\"] ~ *{opacity:var(--row-checkbox-opacity, 0);}&:hover{> *{background-color:var(--table-row-hover);}.table-row-select-cell input[type=\"checkbox\"] ~ *{opacity:1;}}.table-row-select-cell input[type=\"checkbox\"]:focus ~ *{opacity:1;}> *{padding-top:var(--table-row-vertical-padding);padding-bottom:var(--table-row-vertical-padding);};label:row;",
|
|
28
905
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
|
|
29
906
|
},
|
|
30
907
|
cell: process.env.NODE_ENV === "production" ? {
|
|
31
|
-
name: "
|
|
32
|
-
styles: "display:inline-grid;align-items:var(--table-row-vertical-alignment, flex-start);flex:1;line-height:initial;padding:
|
|
908
|
+
name: "11nbh8q",
|
|
909
|
+
styles: "display:inline-grid;position:relative;align-items:var(--table-row-vertical-alignment, flex-start);flex:1;line-height:initial;box-sizing:border-box;padding-left:var(--table-spacing-sm);padding-right:var(--table-spacing-sm);word-break:break-word;overflow:hidden"
|
|
33
910
|
} : {
|
|
34
|
-
name: "
|
|
35
|
-
styles: "display:inline-grid;align-items:var(--table-row-vertical-alignment, flex-start);flex:1;line-height:initial;padding:
|
|
911
|
+
name: "pezdmp-cell",
|
|
912
|
+
styles: "display:inline-grid;position:relative;align-items:var(--table-row-vertical-alignment, flex-start);flex:1;line-height:initial;box-sizing:border-box;padding-left:var(--table-spacing-sm);padding-right:var(--table-spacing-sm);word-break:break-word;overflow:hidden;label:cell;",
|
|
36
913
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
|
|
37
914
|
},
|
|
38
|
-
|
|
39
|
-
name: "
|
|
40
|
-
styles: "padding:
|
|
915
|
+
rowMenuContainer: process.env.NODE_ENV === "production" ? {
|
|
916
|
+
name: "1o9y8zx",
|
|
917
|
+
styles: "padding-left:var(--table-spacing-xs);padding-right:var(--table-spacing-xs)"
|
|
41
918
|
} : {
|
|
42
|
-
name: "
|
|
43
|
-
styles: "padding:
|
|
919
|
+
name: "1gopnk4-rowMenuContainer",
|
|
920
|
+
styles: "padding-left:var(--table-spacing-xs);padding-right:var(--table-spacing-xs);label:rowMenuContainer;",
|
|
44
921
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
|
|
45
922
|
},
|
|
46
923
|
header: process.env.NODE_ENV === "production" ? {
|
|
47
|
-
name: "
|
|
48
|
-
styles: "font-weight:bold;align-items:flex-end;display:flex;overflow:hidden;&[aria-sort]{cursor:pointer;user-select:none;}[
|
|
924
|
+
name: "753xvu",
|
|
925
|
+
styles: "font-weight:bold;align-items:flex-end;display:flex;overflow:hidden;&[aria-sort]{cursor:pointer;user-select:none;}.table-header-text{color:var(--table-header-text-color);}.table-header-icon-container{color:var(--table-header-sort-icon-color);display:none;}&:hover{.table-header-icon-container, .table-header-text{color:var(--table-header-focus-color);}}&:active{.table-header-icon-container, .table-header-text{color:var(--table-header-active-color);}}&:hover, &[aria-sort=\"ascending\"], &[aria-sort=\"descending\"]{.table-header-icon-container{display:inline;}}"
|
|
49
926
|
} : {
|
|
50
|
-
name: "
|
|
51
|
-
styles: "font-weight:bold;align-items:flex-end;display:flex;overflow:hidden;&[aria-sort]{cursor:pointer;user-select:none;}[
|
|
927
|
+
name: "1shmncy-header",
|
|
928
|
+
styles: "font-weight:bold;align-items:flex-end;display:flex;overflow:hidden;&[aria-sort]{cursor:pointer;user-select:none;}.table-header-text{color:var(--table-header-text-color);}.table-header-icon-container{color:var(--table-header-sort-icon-color);display:none;}&:hover{.table-header-icon-container, .table-header-text{color:var(--table-header-focus-color);}}&:active{.table-header-icon-container, .table-header-text{color:var(--table-header-active-color);}}&:hover, &[aria-sort=\"ascending\"], &[aria-sort=\"descending\"]{.table-header-icon-container{display:inline;}};label:header;",
|
|
52
929
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
|
|
53
930
|
},
|
|
54
931
|
headerButtonTarget: process.env.NODE_ENV === "production" ? {
|
|
55
|
-
name: "
|
|
56
|
-
styles: "align-items:flex-end;display:flex;overflow:hidden;width:100
|
|
932
|
+
name: "dpqgee",
|
|
933
|
+
styles: "align-items:flex-end;display:flex;overflow:hidden;width:100%;&:focus{.table-header-text{color:var(--table-header-focus-color);}.table-header-icon-container{color:var(--table-header-focus-color);display:inline;}}&:active{.table-header-icon-container, .table-header-text{color:var(--table-header-active-color);}}"
|
|
57
934
|
} : {
|
|
58
|
-
name: "
|
|
59
|
-
styles: "align-items:flex-end;display:flex;overflow:hidden;width:100
|
|
935
|
+
name: "s60l4r-headerButtonTarget",
|
|
936
|
+
styles: "align-items:flex-end;display:flex;overflow:hidden;width:100%;&:focus{.table-header-text{color:var(--table-header-focus-color);}.table-header-icon-container{color:var(--table-header-focus-color);display:inline;}}&:active{.table-header-icon-container, .table-header-text{color:var(--table-header-active-color);}};label:headerButtonTarget;",
|
|
60
937
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
|
|
61
938
|
},
|
|
62
939
|
checkboxCell: process.env.NODE_ENV === "production" ? {
|
|
63
|
-
name: "
|
|
64
|
-
styles: "
|
|
940
|
+
name: "mozdib",
|
|
941
|
+
styles: "display:flex;align-items:center;flex:0;padding-left:var(--table-spacing-sm);padding-top:0;padding-bottom:0;min-width:var(--table-spacing-md);max-width:var(--table-spacing-md)"
|
|
942
|
+
} : {
|
|
943
|
+
name: "101mdic-checkboxCell",
|
|
944
|
+
styles: "display:flex;align-items:center;flex:0;padding-left:var(--table-spacing-sm);padding-top:0;padding-bottom:0;min-width:var(--table-spacing-md);max-width:var(--table-spacing-md);label:checkboxCell;",
|
|
945
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
|
|
946
|
+
},
|
|
947
|
+
resizeHandleContainer: /*#__PURE__*/css({
|
|
948
|
+
position: 'absolute',
|
|
949
|
+
right: -3,
|
|
950
|
+
top: 'var(--table-spacing-sm)',
|
|
951
|
+
bottom: 'var(--table-spacing-sm)',
|
|
952
|
+
width: 'var(--table-spacing-sm)',
|
|
953
|
+
display: 'flex',
|
|
954
|
+
justifyContent: 'center',
|
|
955
|
+
cursor: 'col-resize',
|
|
956
|
+
userSelect: 'none',
|
|
957
|
+
touchAction: 'none',
|
|
958
|
+
zIndex: 1
|
|
959
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:resizeHandleContainer;"),
|
|
960
|
+
resizeHandle: process.env.NODE_ENV === "production" ? {
|
|
961
|
+
name: "gpjshw",
|
|
962
|
+
styles: "width:1px;background:var(--table-separator-color)"
|
|
65
963
|
} : {
|
|
66
|
-
name: "
|
|
67
|
-
styles: "
|
|
964
|
+
name: "1n6mwr7-resizeHandle",
|
|
965
|
+
styles: "width:1px;background:var(--table-separator-color);label:resizeHandle;",
|
|
966
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
|
|
967
|
+
},
|
|
968
|
+
paginationContainer: process.env.NODE_ENV === "production" ? {
|
|
969
|
+
name: "eb4gqw",
|
|
970
|
+
styles: "display:flex;justify-content:flex-end;margin-top:var(--table-spacing-sm)"
|
|
971
|
+
} : {
|
|
972
|
+
name: "e4q60i-paginationContainer",
|
|
973
|
+
styles: "display:flex;justify-content:flex-end;margin-top:var(--table-spacing-sm);label:paginationContainer;",
|
|
68
974
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
|
|
69
975
|
}
|
|
70
976
|
};
|
|
@@ -75,26 +981,43 @@ const Table = _ref => {
|
|
|
75
981
|
let {
|
|
76
982
|
children,
|
|
77
983
|
size = 'default',
|
|
78
|
-
someRowsSelected
|
|
984
|
+
someRowsSelected,
|
|
985
|
+
style,
|
|
986
|
+
pagination,
|
|
987
|
+
empty
|
|
79
988
|
} = _ref;
|
|
80
989
|
const {
|
|
81
990
|
theme
|
|
82
|
-
} = useDesignSystemTheme
|
|
991
|
+
} = useDesignSystemTheme();
|
|
83
992
|
return jsx(TableContext.Provider, {
|
|
84
993
|
value: {
|
|
85
994
|
size,
|
|
86
995
|
someRowsSelected
|
|
87
996
|
},
|
|
88
|
-
children:
|
|
89
|
-
|
|
997
|
+
children: jsxs("div", {
|
|
998
|
+
// This is a performance optimization; we want to statically create the styles for the table,
|
|
90
999
|
// but for the dynamic theme values, we need to use CSS variables.
|
|
91
1000
|
// See: https://emotion.sh/docs/best-practices#advanced-css-variables-with-style
|
|
92
|
-
,
|
|
93
1001
|
style: {
|
|
94
|
-
|
|
95
|
-
['--table-
|
|
1002
|
+
...style,
|
|
1003
|
+
['--table-separator-color']: theme.colors.tableSeparatorColor,
|
|
1004
|
+
['--table-row-hover']: theme.colors.tableRowHover,
|
|
1005
|
+
['--table-spacing-xs']: "".concat(theme.spacing.xs, "px"),
|
|
1006
|
+
['--table-spacing-sm']: "".concat(theme.spacing.sm, "px"),
|
|
1007
|
+
['--table-spacing-md']: "".concat(theme.spacing.md, "px")
|
|
96
1008
|
},
|
|
97
|
-
children:
|
|
1009
|
+
children: [jsxs("div", {
|
|
1010
|
+
role: "table",
|
|
1011
|
+
children: [children, empty && jsx("div", {
|
|
1012
|
+
css: /*#__PURE__*/css({
|
|
1013
|
+
padding: theme.spacing.lg
|
|
1014
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:Table;"),
|
|
1015
|
+
children: empty
|
|
1016
|
+
})]
|
|
1017
|
+
}), !empty && pagination && jsx("div", {
|
|
1018
|
+
css: tableStyles.paginationContainer,
|
|
1019
|
+
children: pagination
|
|
1020
|
+
})]
|
|
98
1021
|
})
|
|
99
1022
|
});
|
|
100
1023
|
};
|
|
@@ -107,14 +1030,32 @@ const TableRow = _ref2 => {
|
|
|
107
1030
|
isHeader = false,
|
|
108
1031
|
verticalAlignment = 'top'
|
|
109
1032
|
} = _ref2;
|
|
1033
|
+
const {
|
|
1034
|
+
size
|
|
1035
|
+
} = useContext(TableContext);
|
|
1036
|
+
const {
|
|
1037
|
+
theme
|
|
1038
|
+
} = useDesignSystemTheme();
|
|
1039
|
+
|
|
1040
|
+
// Vertical only be larger if the row is a header AND size is large.
|
|
1041
|
+
const shouldUseLargeVerticalPadding = isHeader && size === 'default';
|
|
1042
|
+
let rowPadding;
|
|
1043
|
+
if (shouldUseLargeVerticalPadding) {
|
|
1044
|
+
rowPadding = theme.spacing.sm;
|
|
1045
|
+
} else if (size === 'default') {
|
|
1046
|
+
rowPadding = 6;
|
|
1047
|
+
} else {
|
|
1048
|
+
rowPadding = theme.spacing.xs;
|
|
1049
|
+
}
|
|
110
1050
|
return jsx(TableRowContext.Provider, {
|
|
111
1051
|
value: {
|
|
112
1052
|
isHeader
|
|
113
1053
|
},
|
|
114
1054
|
children: jsx("div", {
|
|
115
|
-
css: tableStyles.row,
|
|
1055
|
+
css: [tableStyles.row, process.env.NODE_ENV === "production" ? "" : ";label:TableRow;"],
|
|
116
1056
|
role: "row",
|
|
117
1057
|
style: {
|
|
1058
|
+
['--table-row-vertical-padding']: "".concat(rowPadding, "px"),
|
|
118
1059
|
['--table-row-vertical-alignment']: verticalAlignment === 'top' ? 'flex-start' : 'center'
|
|
119
1060
|
},
|
|
120
1061
|
children: children
|
|
@@ -124,7 +1065,8 @@ const TableRow = _ref2 => {
|
|
|
124
1065
|
const TableCell = _ref3 => {
|
|
125
1066
|
let {
|
|
126
1067
|
children,
|
|
127
|
-
ellipsis = false
|
|
1068
|
+
ellipsis = false,
|
|
1069
|
+
style
|
|
128
1070
|
} = _ref3;
|
|
129
1071
|
const {
|
|
130
1072
|
size
|
|
@@ -134,8 +1076,9 @@ const TableCell = _ref3 => {
|
|
|
134
1076
|
typographySize = 'sm';
|
|
135
1077
|
}
|
|
136
1078
|
return jsx("div", {
|
|
137
|
-
css: [tableStyles.cell,
|
|
1079
|
+
css: [tableStyles.cell, process.env.NODE_ENV === "production" ? "" : ";label:TableCell;"],
|
|
138
1080
|
role: "cell",
|
|
1081
|
+
style: style,
|
|
139
1082
|
children: jsx(Typography.Text, {
|
|
140
1083
|
ellipsis: ellipsis,
|
|
141
1084
|
size: typographySize,
|
|
@@ -150,11 +1093,12 @@ const TableHeader = _ref4 => {
|
|
|
150
1093
|
ellipsis = false,
|
|
151
1094
|
sortable,
|
|
152
1095
|
sortDirection,
|
|
153
|
-
onToggleSort
|
|
1096
|
+
onToggleSort,
|
|
1097
|
+
style
|
|
154
1098
|
} = _ref4;
|
|
155
1099
|
const {
|
|
156
1100
|
theme
|
|
157
|
-
} = useDesignSystemTheme
|
|
1101
|
+
} = useDesignSystemTheme();
|
|
158
1102
|
const {
|
|
159
1103
|
size
|
|
160
1104
|
} = useContext(TableContext);
|
|
@@ -185,21 +1129,30 @@ const TableHeader = _ref4 => {
|
|
|
185
1129
|
typographySize = 'sm';
|
|
186
1130
|
}
|
|
187
1131
|
const textContents = jsx(Typography.Text, {
|
|
1132
|
+
className: "table-header-text"
|
|
188
1133
|
// If sortable, we must use ellipsis to prevent wrapping and misalignment.
|
|
1134
|
+
,
|
|
189
1135
|
ellipsis: ellipsis || sortable,
|
|
190
1136
|
size: typographySize,
|
|
191
1137
|
title: ellipsis && typeof children === 'string' && children || undefined,
|
|
192
1138
|
children: children
|
|
193
1139
|
});
|
|
194
1140
|
return jsx("div", {
|
|
195
|
-
css: [tableStyles.cell, tableStyles.header,
|
|
1141
|
+
css: [tableStyles.cell, tableStyles.header, process.env.NODE_ENV === "production" ? "" : ";label:TableHeader;"],
|
|
196
1142
|
role: "columnheader",
|
|
197
1143
|
"aria-sort": sortable && ariaSort || undefined,
|
|
1144
|
+
onClick: onToggleSort,
|
|
1145
|
+
style: {
|
|
1146
|
+
...style,
|
|
1147
|
+
['--table-header-text-color']: theme.colors.actionDefaultTextDefault,
|
|
1148
|
+
['--table-header-focus-color']: theme.colors.actionDefaultTextHover,
|
|
1149
|
+
['--table-header-active-color']: theme.colors.actionDefaultTextPress,
|
|
1150
|
+
['--table-header-sort-icon-color']: theme.colors.textSecondary
|
|
1151
|
+
},
|
|
198
1152
|
children: sortable ? jsxs("div", {
|
|
199
1153
|
css: [tableStyles.headerButtonTarget, process.env.NODE_ENV === "production" ? "" : ";label:TableHeader;"],
|
|
200
1154
|
role: "button",
|
|
201
1155
|
tabIndex: 0,
|
|
202
|
-
onClick: onToggleSort,
|
|
203
1156
|
onKeyDown: event => {
|
|
204
1157
|
if (sortable && (event.key === 'Enter' || event.key === ' ')) {
|
|
205
1158
|
event.preventDefault();
|
|
@@ -207,21 +1160,43 @@ const TableHeader = _ref4 => {
|
|
|
207
1160
|
}
|
|
208
1161
|
},
|
|
209
1162
|
children: [textContents, jsx("span", {
|
|
1163
|
+
className: "table-header-icon-container",
|
|
210
1164
|
style: {
|
|
211
|
-
|
|
1165
|
+
marginLeft: 4
|
|
212
1166
|
},
|
|
213
1167
|
children: sortIcon
|
|
214
1168
|
})]
|
|
215
1169
|
}) : textContents
|
|
216
1170
|
});
|
|
217
1171
|
};
|
|
218
|
-
const
|
|
1172
|
+
const TableHeaderResizeHandle = _ref5 => {
|
|
1173
|
+
let {
|
|
1174
|
+
style,
|
|
1175
|
+
resizeHandler
|
|
1176
|
+
} = _ref5;
|
|
1177
|
+
const {
|
|
1178
|
+
isHeader
|
|
1179
|
+
} = useContext(TableRowContext);
|
|
1180
|
+
if (!isHeader) {
|
|
1181
|
+
throw new Error('`TableHeaderResizeHandle` must be used within a `TableRow` with `isHeader` set to true.');
|
|
1182
|
+
}
|
|
1183
|
+
return jsx("div", {
|
|
1184
|
+
onMouseDown: resizeHandler,
|
|
1185
|
+
onTouchStart: resizeHandler,
|
|
1186
|
+
css: tableStyles.resizeHandleContainer,
|
|
1187
|
+
style: style,
|
|
1188
|
+
children: jsx("div", {
|
|
1189
|
+
css: tableStyles.resizeHandle
|
|
1190
|
+
})
|
|
1191
|
+
});
|
|
1192
|
+
};
|
|
1193
|
+
const TableRowSelectCell = _ref6 => {
|
|
219
1194
|
let {
|
|
220
1195
|
onChange,
|
|
221
1196
|
checked,
|
|
222
1197
|
indeterminate,
|
|
223
1198
|
noCheckbox
|
|
224
|
-
} =
|
|
1199
|
+
} = _ref6;
|
|
225
1200
|
const {
|
|
226
1201
|
isHeader
|
|
227
1202
|
} = useContext(TableRowContext);
|
|
@@ -237,12 +1212,6 @@ const TableRowSelectCell = _ref5 => {
|
|
|
237
1212
|
return jsx("div", {
|
|
238
1213
|
css: tableStyles.checkboxCell,
|
|
239
1214
|
style: {
|
|
240
|
-
paddingLeft: 8,
|
|
241
|
-
paddingTop: 0,
|
|
242
|
-
paddingBottom: 0,
|
|
243
|
-
flex: 0,
|
|
244
|
-
minWidth: 16,
|
|
245
|
-
maxWidth: 16,
|
|
246
1215
|
['--row-checkbox-opacity']: someRowsSelected ? 1 : 0
|
|
247
1216
|
},
|
|
248
1217
|
role: isHeader ? 'columnheader' : 'cell'
|
|
@@ -256,431 +1225,87 @@ const TableRowSelectCell = _ref5 => {
|
|
|
256
1225
|
})
|
|
257
1226
|
});
|
|
258
1227
|
};
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
// Exported from go/designsystem/colorsheet
|
|
271
|
-
const colorPalettePrimary = {
|
|
272
|
-
primary: '#2272B4',
|
|
273
|
-
blue100: '#F0F8FF',
|
|
274
|
-
blue200: '#D7EDFE',
|
|
275
|
-
blue300: '#BAE1FC',
|
|
276
|
-
blue400: '#8ACAFF',
|
|
277
|
-
blue500: '#4299E0',
|
|
278
|
-
blue600: '#2272B4',
|
|
279
|
-
blue700: '#0E538B',
|
|
280
|
-
blue800: '#04355D',
|
|
281
|
-
green100: '#F3FCF6',
|
|
282
|
-
green200: '#D4F7DF',
|
|
283
|
-
green300: '#B1ECC5',
|
|
284
|
-
green400: '#8DDDA8',
|
|
285
|
-
green500: '#3CAA60',
|
|
286
|
-
green600: '#277C43',
|
|
287
|
-
green700: '#115026',
|
|
288
|
-
green800: '#093919',
|
|
289
|
-
white: '#FFFFFF',
|
|
290
|
-
grey100: '#F2F5F7',
|
|
291
|
-
grey200: '#E4ECF1',
|
|
292
|
-
grey300: '#CDDAE5',
|
|
293
|
-
grey400: '#BDCDDB',
|
|
294
|
-
grey500: '#8196A7',
|
|
295
|
-
grey600: '#5D7283',
|
|
296
|
-
grey700: '#44535F',
|
|
297
|
-
grey800: '#1F272D',
|
|
298
|
-
red100: '#FFF5F7',
|
|
299
|
-
red200: '#FDE2E8',
|
|
300
|
-
red300: '#FBD0D8',
|
|
301
|
-
red400: '#F792A6',
|
|
302
|
-
red500: '#E65B77',
|
|
303
|
-
red600: '#C82D4C',
|
|
304
|
-
red700: '#9E102C',
|
|
305
|
-
red800: '#630316',
|
|
306
|
-
yellow100: '#FFF9EB',
|
|
307
|
-
yellow200: '#FCEACA',
|
|
308
|
-
yellow300: '#F8D4A5',
|
|
309
|
-
yellow400: '#F2BE88',
|
|
310
|
-
yellow500: '#DE7921',
|
|
311
|
-
yellow600: '#BE501E',
|
|
312
|
-
yellow700: '#93320B',
|
|
313
|
-
yellow800: '#5F1B02'
|
|
314
|
-
};
|
|
315
|
-
const colorPaletteSecondary = {
|
|
316
|
-
brown: '#A6630C',
|
|
317
|
-
coral: '#C83243',
|
|
318
|
-
charcoal: '#5D7283',
|
|
319
|
-
indigo: '#434A93',
|
|
320
|
-
lemon: '#FACB66',
|
|
321
|
-
lime: '#308613',
|
|
322
|
-
pink: '#B45091',
|
|
323
|
-
purple: '#8A63BF',
|
|
324
|
-
teal: '#04867D',
|
|
325
|
-
turquoise: '#157CBC'
|
|
1228
|
+
const TableRowMenuContainer = _ref7 => {
|
|
1229
|
+
let {
|
|
1230
|
+
children,
|
|
1231
|
+
style
|
|
1232
|
+
} = _ref7;
|
|
1233
|
+
return jsx("div", {
|
|
1234
|
+
css: tableStyles.rowMenuContainer,
|
|
1235
|
+
style: style,
|
|
1236
|
+
children: children
|
|
1237
|
+
});
|
|
326
1238
|
};
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
actionDangerDefaultBackgroundDefault: chroma(colorPalettePrimary.red600).alpha(0).hex(),
|
|
344
|
-
actionDangerDefaultBackgroundHover: chroma(colorPalettePrimary.red600).alpha(0.08).hex(),
|
|
345
|
-
actionDangerDefaultBackgroundPress: chroma(colorPalettePrimary.red600).alpha(0.16).hex(),
|
|
346
|
-
actionDangerDefaultBorderDefault: colorPalettePrimary.red600,
|
|
347
|
-
actionDangerDefaultBorderHover: colorPalettePrimary.red700,
|
|
348
|
-
actionDangerDefaultBorderPress: colorPalettePrimary.red800,
|
|
349
|
-
actionDangerDefaultTextDefault: colorPalettePrimary.red600,
|
|
350
|
-
actionDangerDefaultTextHover: colorPalettePrimary.red700,
|
|
351
|
-
actionDangerDefaultTextPress: colorPalettePrimary.red800,
|
|
352
|
-
actionDefaultBackgroundDefault: chroma(colorPalettePrimary.blue800).alpha(0).hex(),
|
|
353
|
-
actionDefaultBackgroundHover: chroma(colorPalettePrimary.blue600).alpha(0.08).hex(),
|
|
354
|
-
actionDefaultBackgroundPress: chroma(colorPalettePrimary.blue600).alpha(0.16).hex(),
|
|
355
|
-
actionDefaultBorderDefault: colorPalettePrimary.grey300,
|
|
356
|
-
actionDefaultBorderFocus: colorPalettePrimary.blue600,
|
|
357
|
-
actionDefaultBorderHover: colorPalettePrimary.blue700,
|
|
358
|
-
actionDefaultBorderPress: colorPalettePrimary.blue800,
|
|
359
|
-
actionDefaultTextDefault: colorPalettePrimary.grey800,
|
|
360
|
-
actionDefaultTextHover: colorPalettePrimary.blue700,
|
|
361
|
-
actionDefaultTextPress: colorPalettePrimary.blue800,
|
|
362
|
-
actionDisabledBackground: colorPalettePrimary.grey200,
|
|
363
|
-
actionDisabledText: colorPalettePrimary.grey400,
|
|
364
|
-
actionPrimaryBackgroundDefault: colorPalettePrimary.blue600,
|
|
365
|
-
actionPrimaryBackgroundHover: colorPalettePrimary.blue700,
|
|
366
|
-
actionPrimaryBackgroundPress: colorPalettePrimary.blue800,
|
|
367
|
-
actionPrimaryTextDefault: colorPalettePrimary.white,
|
|
368
|
-
actionPrimaryTextHover: colorPalettePrimary.white,
|
|
369
|
-
actionPrimaryTextPress: colorPalettePrimary.white,
|
|
370
|
-
actionTertiaryBackgroundDefault: chroma(colorPalettePrimary.blue600).alpha(0).hex(),
|
|
371
|
-
actionTertiaryBackgroundHover: chroma(colorPalettePrimary.blue600).alpha(0.08).hex(),
|
|
372
|
-
actionTertiaryBackgroundPress: chroma(colorPalettePrimary.blue600).alpha(0.16).hex(),
|
|
373
|
-
actionTertiaryTextDefault: colorPalettePrimary.blue600,
|
|
374
|
-
actionTertiaryTextHover: colorPalettePrimary.blue700,
|
|
375
|
-
actionTertiaryTextPress: colorPalettePrimary.blue800,
|
|
376
|
-
backgroundDanger: chroma(colorPalettePrimary.red100).alpha(0.08).hex(),
|
|
377
|
-
backgroundSecondary: colorPalettePrimary.grey100,
|
|
378
|
-
backgroundWarning: chroma(colorPalettePrimary.yellow100).alpha(0.08).hex(),
|
|
379
|
-
border: colorPalettePrimary.grey300,
|
|
380
|
-
borderDecorative: colorPalettePrimary.grey300,
|
|
381
|
-
textPrimary: colorPalettePrimary.grey800,
|
|
382
|
-
textSecondary: colorPalettePrimary.grey600,
|
|
383
|
-
textPlaceholder: colorPalettePrimary.grey400,
|
|
384
|
-
textValidationDanger: colorPalettePrimary.red600,
|
|
385
|
-
textValidationSuccess: colorPalettePrimary.green600,
|
|
386
|
-
textValidationWarning: colorPalettePrimary.yellow600,
|
|
387
|
-
overlayOverlay: chroma(colorPalettePrimary.grey100).alpha(0.72).hex(),
|
|
388
|
-
// Tags
|
|
389
|
-
tagDefault: chroma(colorPalettePrimary.grey600).alpha(0.08).hex(),
|
|
390
|
-
tagBrown: colorPaletteSecondary.brown,
|
|
391
|
-
tagCoral: colorPaletteSecondary.coral,
|
|
392
|
-
tagCharcoal: colorPalettePrimary.grey600,
|
|
393
|
-
tagIndigo: colorPaletteSecondary.indigo,
|
|
394
|
-
tagLemon: colorPaletteSecondary.lemon,
|
|
395
|
-
tagLime: colorPaletteSecondary.lime,
|
|
396
|
-
tagPink: colorPaletteSecondary.pink,
|
|
397
|
-
tagPurple: colorPaletteSecondary.purple,
|
|
398
|
-
tagTeal: colorPaletteSecondary.teal,
|
|
399
|
-
tagTurquoise: colorPaletteSecondary.turquoise,
|
|
400
|
-
tagText: colorPalettePrimary.white,
|
|
401
|
-
tagHover: chroma(colorPalettePrimary.blue400).alpha(0.08).hex(),
|
|
402
|
-
tagPress: chroma(colorPalettePrimary.blue400).alpha(0.16).hex(),
|
|
403
|
-
tagIconHover: chroma(colorPalettePrimary.white).alpha(0.8).hex(),
|
|
404
|
-
tagIconPress: chroma(colorPalettePrimary.white).alpha(0.76).hex(),
|
|
405
|
-
// Typography
|
|
406
|
-
typographyCodeBg: chroma(colorPalettePrimary.grey600).alpha(0.08).hex(),
|
|
407
|
-
// Table
|
|
408
|
-
tableBorder: colorPalettePrimary.grey200,
|
|
409
|
-
tableRowHover: chroma(colorPalettePrimary.grey600).alpha(0.04).hex(),
|
|
410
|
-
tooltipBackgroundTooltip: colorPalettePrimary.grey800,
|
|
411
|
-
...unstableColors
|
|
412
|
-
};
|
|
413
|
-
const darkColorList = {
|
|
414
|
-
actionDangerPrimaryBackgroundDefault: chroma(colorPalettePrimary.red400).alpha(0.84).hex(),
|
|
415
|
-
actionDangerPrimaryBackgroundHover: chroma(colorPalettePrimary.red400).alpha(0.72).hex(),
|
|
416
|
-
actionDangerPrimaryBackgroundPress: chroma(colorPalettePrimary.red400).alpha(0.6).hex(),
|
|
417
|
-
actionDangerDefaultBackgroundDefault: chroma(colorPalettePrimary.red400).alpha(0).hex(),
|
|
418
|
-
actionDangerDefaultBackgroundHover: chroma(colorPalettePrimary.red400).alpha(0.08).hex(),
|
|
419
|
-
actionDangerDefaultBackgroundPress: chroma(colorPalettePrimary.red400).alpha(0.16).hex(),
|
|
420
|
-
actionDangerDefaultBorderDefault: colorPalettePrimary.red400,
|
|
421
|
-
actionDangerDefaultBorderHover: chroma(colorPalettePrimary.red400).alpha(0.72).hex(),
|
|
422
|
-
actionDangerDefaultBorderPress: chroma(colorPalettePrimary.red400).alpha(0.6).hex(),
|
|
423
|
-
actionDangerDefaultTextDefault: colorPalettePrimary.red400,
|
|
424
|
-
actionDangerDefaultTextHover: chroma(colorPalettePrimary.red400).alpha(0.72).hex(),
|
|
425
|
-
actionDangerDefaultTextPress: chroma(colorPalettePrimary.red400).alpha(0.6).hex(),
|
|
426
|
-
actionDefaultBackgroundDefault: chroma(colorPalettePrimary.blue400).alpha(0).hex(),
|
|
427
|
-
actionDefaultBackgroundHover: chroma(colorPalettePrimary.blue400).alpha(0.08).hex(),
|
|
428
|
-
actionDefaultBackgroundPress: chroma(colorPalettePrimary.blue400).alpha(0.16).hex(),
|
|
429
|
-
actionDefaultBorderDefault: chroma(colorPalettePrimary.white).alpha(0.6).hex(),
|
|
430
|
-
actionDefaultBorderFocus: chroma(colorPalettePrimary.blue400).alpha(0.84).hex(),
|
|
431
|
-
actionDefaultBorderHover: chroma(colorPalettePrimary.blue400).alpha(0.8).hex(),
|
|
432
|
-
actionDefaultBorderPress: chroma(colorPalettePrimary.blue400).alpha(0.76).hex(),
|
|
433
|
-
actionDefaultTextDefault: chroma(colorPalettePrimary.white).alpha(0.84).hex(),
|
|
434
|
-
actionDefaultTextHover: chroma(colorPalettePrimary.blue400).alpha(0.8).hex(),
|
|
435
|
-
actionDefaultTextPress: chroma(colorPalettePrimary.blue400).alpha(0.76).hex(),
|
|
436
|
-
actionDisabledBackground: chroma(colorPalettePrimary.white).alpha(0.24).hex(),
|
|
437
|
-
actionDisabledText: chroma(colorPalettePrimary.white).alpha(0.4).hex(),
|
|
438
|
-
actionPrimaryBackgroundDefault: chroma(colorPalettePrimary.blue400).alpha(0.84).hex(),
|
|
439
|
-
actionPrimaryBackgroundHover: chroma(colorPalettePrimary.blue400).alpha(0.8).hex(),
|
|
440
|
-
actionPrimaryBackgroundPress: chroma(colorPalettePrimary.blue400).alpha(0.76).hex(),
|
|
441
|
-
actionPrimaryTextDefault: colorPalettePrimary.grey800,
|
|
442
|
-
actionPrimaryTextHover: colorPalettePrimary.grey800,
|
|
443
|
-
actionPrimaryTextPress: colorPalettePrimary.grey800,
|
|
444
|
-
actionTertiaryBackgroundDefault: chroma(colorPalettePrimary.blue400).alpha(0).hex(),
|
|
445
|
-
actionTertiaryBackgroundHover: chroma(colorPalettePrimary.blue400).alpha(0.08).hex(),
|
|
446
|
-
actionTertiaryBackgroundPress: chroma(colorPalettePrimary.blue400).alpha(0.16).hex(),
|
|
447
|
-
actionTertiaryTextDefault: chroma(colorPalettePrimary.blue400).alpha(0.84).hex(),
|
|
448
|
-
actionTertiaryTextHover: chroma(colorPalettePrimary.blue400).alpha(0.8).hex(),
|
|
449
|
-
actionTertiaryTextPress: chroma(colorPalettePrimary.blue400).alpha(0.76).hex(),
|
|
450
|
-
backgroundPrimary: colorPalettePrimary.grey800,
|
|
451
|
-
backgroundSecondary: chroma(colorPalettePrimary.white).alpha(0.04).hex(),
|
|
452
|
-
border: chroma(colorPalettePrimary.white).alpha(0.48).hex(),
|
|
453
|
-
borderDecorative: chroma(colorPalettePrimary.white).alpha(0.24).hex(),
|
|
454
|
-
textPrimary: chroma(colorPalettePrimary.white).alpha(0.84).hex(),
|
|
455
|
-
textSecondary: chroma(colorPalettePrimary.white).alpha(0.6).hex(),
|
|
456
|
-
textPlaceholder: chroma(colorPalettePrimary.grey400).alpha(0.84).hex(),
|
|
457
|
-
textValidationDanger: chroma(colorPalettePrimary.red400).alpha(0.84).hex(),
|
|
458
|
-
textValidationSuccess: chroma(colorPalettePrimary.green400).alpha(0.84).hex(),
|
|
459
|
-
textValidationWarning: chroma(colorPalettePrimary.yellow400).alpha(0.84).hex(),
|
|
460
|
-
overlayOverlay: chroma(colorPalettePrimary.grey800).alpha(0.72).hex(),
|
|
461
|
-
// Tags
|
|
462
|
-
tagDefault: chroma(colorPalettePrimary.white).alpha(0.16).hex(),
|
|
463
|
-
tagBrown: chroma(colorPaletteSecondary.brown).alpha(0.84).hex(),
|
|
464
|
-
tagCoral: chroma(colorPaletteSecondary.coral).alpha(0.84).hex(),
|
|
465
|
-
tagCharcoal: chroma(colorPalettePrimary.grey600).alpha(0.84).hex(),
|
|
466
|
-
tagIndigo: chroma(colorPaletteSecondary.indigo).alpha(0.84).hex(),
|
|
467
|
-
tagLemon: chroma(colorPaletteSecondary.lemon).alpha(0.84).hex(),
|
|
468
|
-
tagLime: chroma(colorPaletteSecondary.lime).alpha(0.84).hex(),
|
|
469
|
-
tagPink: chroma(colorPaletteSecondary.pink).alpha(0.84).hex(),
|
|
470
|
-
tagPurple: chroma(colorPaletteSecondary.purple).alpha(0.84).hex(),
|
|
471
|
-
tagTeal: chroma(colorPaletteSecondary.teal).alpha(0.84).hex(),
|
|
472
|
-
tagTurquoise: chroma(colorPaletteSecondary.turquoise).alpha(0.84).hex(),
|
|
473
|
-
tagText: chroma(colorPalettePrimary.white).alpha(0.84).hex(),
|
|
474
|
-
tagHover: chroma(colorPalettePrimary.blue400).alpha(0.08).hex(),
|
|
475
|
-
tagPress: chroma(colorPalettePrimary.blue400).alpha(0.16).hex(),
|
|
476
|
-
tagIconHover: chroma(colorPalettePrimary.white).alpha(0.8).hex(),
|
|
477
|
-
tagIconPress: chroma(colorPalettePrimary.white).alpha(0.76).hex(),
|
|
478
|
-
// Typography
|
|
479
|
-
typographyCodeBg: chroma(colorPalettePrimary.white).alpha(0.16).hex(),
|
|
480
|
-
// Table
|
|
481
|
-
tableBorder: chroma(colorPalettePrimary.white).alpha(0.24).hex(),
|
|
482
|
-
tableRowHover: chroma(colorPalettePrimary.white).alpha(0.16).hex(),
|
|
483
|
-
tooltipBackgroundTooltip: chroma(colorPalettePrimary.white).alpha(0.6).hex(),
|
|
484
|
-
// Missing in list
|
|
485
|
-
backgroundDanger: 'rgba(200,45,76,0.08)',
|
|
486
|
-
backgroundWarning: 'rgba(222,121,33,0.08)',
|
|
487
|
-
// Missing in light list
|
|
488
|
-
// "background-validation-danger": "rgba(229,110,134,0)",
|
|
489
|
-
// "background-validation-warning": "rgba(252,234,202,0)",
|
|
490
|
-
...unstableColors
|
|
491
|
-
};
|
|
492
|
-
const darkColors = {
|
|
493
|
-
...darkColorList,
|
|
494
|
-
...colorPalettePrimary,
|
|
495
|
-
...colorPaletteSecondary
|
|
496
|
-
};
|
|
497
|
-
const lightColors = {
|
|
498
|
-
...lightColorList,
|
|
499
|
-
...colorPalettePrimary,
|
|
500
|
-
...colorPaletteSecondary
|
|
501
|
-
};
|
|
502
|
-
function getSemanticColors(theme) {
|
|
503
|
-
switch (theme) {
|
|
504
|
-
case 'dark':
|
|
505
|
-
return {
|
|
506
|
-
...darkColors
|
|
507
|
-
};
|
|
508
|
-
default:
|
|
509
|
-
return {
|
|
510
|
-
...lightColors
|
|
511
|
-
};
|
|
1239
|
+
const TableSkeletonStyles = {
|
|
1240
|
+
container: process.env.NODE_ENV === "production" ? {
|
|
1241
|
+
name: "uxqssl",
|
|
1242
|
+
styles: "display:flex;flex-direction:column;align-items:flex-start;margin:6px 0;gap:12px"
|
|
1243
|
+
} : {
|
|
1244
|
+
name: "1zl9za-container",
|
|
1245
|
+
styles: "display:flex;flex-direction:column;align-items:flex-start;margin:6px 0;gap:12px;label:container;",
|
|
1246
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
|
|
1247
|
+
},
|
|
1248
|
+
cell: process.env.NODE_ENV === "production" ? {
|
|
1249
|
+
name: "18wj7jq",
|
|
1250
|
+
styles: "width:100%;height:8px;border-radius:4px;background:var(--table-skeleton-color)"
|
|
1251
|
+
} : {
|
|
1252
|
+
name: "2md9en-cell",
|
|
1253
|
+
styles: "width:100%;height:8px;border-radius:4px;background:var(--table-skeleton-color);label:cell;",
|
|
1254
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
|
|
512
1255
|
}
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
// TODO (FEINF-1674): Remove when removing USE_NEW_RADIO_STYLES
|
|
516
|
-
/*
|
|
517
|
-
Colors that need to be replaced by semantic colors.
|
|
518
|
-
*/
|
|
519
|
-
const deprecatedColors = {
|
|
520
|
-
// Radio Colors
|
|
521
|
-
radioInteractiveAvailable: colorPalettePrimary.primary,
|
|
522
|
-
radioInteractiveHover: '#186099',
|
|
523
|
-
radioInteractivePress: '#0D4F85',
|
|
524
|
-
radioDisabled: '#A2AEB8',
|
|
525
|
-
radioDefaultBorder: '#64727D',
|
|
526
|
-
radioDefaultBackground: '#FFFFFF',
|
|
527
|
-
radioInteractiveHoverSecondary: 'rgba(34, 115, 181, 0.08)',
|
|
528
|
-
// Fade of Interactive Available
|
|
529
|
-
radioInteractivePressSecondary: 'rgba(34, 115, 181, 0.16)' // Fade of Interactive Available
|
|
530
|
-
};
|
|
531
|
-
|
|
532
|
-
function getColors(theme) {
|
|
533
|
-
return {
|
|
534
|
-
...deprecatedColors,
|
|
535
|
-
...getSemanticColors(theme)
|
|
536
|
-
};
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
// eslint-disable-next-line import/no-anonymous-default-export
|
|
540
|
-
var antdVars = {
|
|
541
|
-
// IMPORTANT: Do not read this directly from components. Use `React.useContext`.
|
|
542
|
-
'ant-prefix': 'du-bois'
|
|
543
|
-
};
|
|
544
|
-
const DEFAULT_SPACING_UNIT = 8;
|
|
545
|
-
const MODAL_PADDING = 40;
|
|
546
|
-
const spacing = {
|
|
547
|
-
xs: DEFAULT_SPACING_UNIT / 2,
|
|
548
|
-
sm: DEFAULT_SPACING_UNIT,
|
|
549
|
-
md: DEFAULT_SPACING_UNIT * 2,
|
|
550
|
-
lg: DEFAULT_SPACING_UNIT * 3
|
|
551
1256
|
};
|
|
1257
|
+
const TableSkeleton = _ref8 => {
|
|
1258
|
+
let {
|
|
1259
|
+
lines = 1,
|
|
1260
|
+
seed = '',
|
|
1261
|
+
style
|
|
1262
|
+
} = _ref8;
|
|
1263
|
+
const {
|
|
1264
|
+
theme
|
|
1265
|
+
} = useDesignSystemTheme();
|
|
552
1266
|
|
|
553
|
-
//
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
defaultPaddingXss: spacing.xs,
|
|
560
|
-
paddingLg: spacing.md,
|
|
561
|
-
// TODO: Check if there is a better alternative with team
|
|
562
|
-
paddingMd: spacing.sm,
|
|
563
|
-
paddingSm: spacing.sm,
|
|
564
|
-
paddingXs: spacing.xs,
|
|
565
|
-
paddingXss: 0,
|
|
566
|
-
marginSm: 12,
|
|
567
|
-
marginLg: spacing.lg,
|
|
568
|
-
// Button
|
|
569
|
-
btnPaddingHorizontalBase: DEFAULT_SPACING_UNIT * 2,
|
|
570
|
-
btnPaddingHorizontalLg: DEFAULT_SPACING_UNIT * 2,
|
|
571
|
-
btnPaddingHorizontalSm: DEFAULT_SPACING_UNIT * 2,
|
|
572
|
-
// Input
|
|
573
|
-
inputPaddingHorizontal: DEFAULT_SPACING_UNIT * 1.5,
|
|
574
|
-
inputPaddingHorizontalBase: DEFAULT_SPACING_UNIT * 1.5,
|
|
575
|
-
inputPaddingHorizontalSm: DEFAULT_SPACING_UNIT * 1.5,
|
|
576
|
-
inputPaddingHorizontalLg: DEFAULT_SPACING_UNIT * 1.5,
|
|
577
|
-
inputPaddingVertical: spacing.xs + 1,
|
|
578
|
-
inputPaddingVerticalBase: spacing.xs + 1,
|
|
579
|
-
inputPaddingVerticalSm: spacing.xs + 1,
|
|
580
|
-
inputPaddingVerticalLg: spacing.xs + 1,
|
|
581
|
-
// Modal
|
|
582
|
-
modalPadding: MODAL_PADDING,
|
|
583
|
-
modalLessPadding: MODAL_PADDING - 20,
|
|
584
|
-
modalHeaderPadding: "".concat(MODAL_PADDING, "px ").concat(MODAL_PADDING, "px ").concat(MODAL_PADDING - 20, "px"),
|
|
585
|
-
modalHeaderCloseSize: MODAL_PADDING * 2 + 22,
|
|
586
|
-
modalHeaderBorderWidth: 0,
|
|
587
|
-
modalBodyPadding: "0 ".concat(MODAL_PADDING, "px"),
|
|
588
|
-
modalFooterPaddingVertical: 0,
|
|
589
|
-
modalFooterPaddingHorizontal: 0,
|
|
590
|
-
modalFooterBorderWidth: 0,
|
|
591
|
-
// Switch
|
|
592
|
-
switchPadding: 0,
|
|
593
|
-
switchHeight: 16,
|
|
594
|
-
switchMinWidth: 28,
|
|
595
|
-
switchPinSize: 14
|
|
596
|
-
});
|
|
597
|
-
var spacing$1 = spacing;
|
|
598
|
-
const heightBase = 40;
|
|
599
|
-
const borderWidth = 1;
|
|
600
|
-
const antdGeneralVariables = {
|
|
601
|
-
classnamePrefix: antdVars['ant-prefix'],
|
|
602
|
-
iconfontCssPrefix: 'anticon',
|
|
603
|
-
borderRadiusBase: 4,
|
|
604
|
-
borderWidth: borderWidth,
|
|
605
|
-
heightSm: 32,
|
|
606
|
-
heightBase: heightBase,
|
|
607
|
-
iconSize: 24,
|
|
608
|
-
// TODO (FEINF-1545): Update with icon overhaul to 16px
|
|
609
|
-
iconFontSize: 13,
|
|
610
|
-
iconFontSizeNew: 16,
|
|
611
|
-
buttonHeight: heightBase,
|
|
612
|
-
// Height available within button (for label and icon). Same for middle and small buttons.
|
|
613
|
-
buttonInnerHeight: heightBase - spacing$1.sm * 2 - borderWidth * 2
|
|
614
|
-
};
|
|
615
|
-
var generalVariables = antdGeneralVariables;
|
|
616
|
-
const FONT_SIZE_BASE = 13;
|
|
617
|
-
|
|
618
|
-
// Less variables that are used by AntD
|
|
619
|
-
const antdTypography = {
|
|
620
|
-
fontSizeSm: 12,
|
|
621
|
-
fontSizeBase: FONT_SIZE_BASE,
|
|
622
|
-
fontSizeMd: FONT_SIZE_BASE,
|
|
623
|
-
fontSizeLg: 18,
|
|
624
|
-
fontSizeXl: 22,
|
|
625
|
-
fontSizeXxl: 32,
|
|
626
|
-
lineHeightSm: '16px',
|
|
627
|
-
lineHeightBase: '20px',
|
|
628
|
-
lineHeightMd: '20px',
|
|
629
|
-
lineHeightLg: '24px',
|
|
630
|
-
lineHeightXl: '28px',
|
|
631
|
-
lineHeightXxl: '40px',
|
|
632
|
-
typographyBoldFontWeight: 600
|
|
633
|
-
};
|
|
1267
|
+
// This is a very simple PRNG that is seeded (so that the output is deterministic).
|
|
1268
|
+
// We need this in order to produce a random ragged edge for the table skeleton.
|
|
1269
|
+
function pseudoRandomNumberGeneratorFromSeed(seed) {
|
|
1270
|
+
// This is a simple way to get a consistent number from a string;
|
|
1271
|
+
// `charCodeAt` returns a number between 0 and 65535, and we then just add them all up.
|
|
1272
|
+
const seedValue = seed.split('').map(char => char.charCodeAt(0)).reduce((prev, curr) => prev + curr, 0);
|
|
634
1273
|
|
|
635
|
-
//
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
1274
|
+
// This is a simple sine wave function that will always return a number between 0 and 1.
|
|
1275
|
+
// This produces a value akin to `Math.random()`, but has deterministic output.
|
|
1276
|
+
// Of course, sine curves are not a perfectly random distribution between 0 and 1, but
|
|
1277
|
+
// it's close enough for our purposes.
|
|
1278
|
+
return Math.sin(seedValue) / 2 + 0.5;
|
|
1279
|
+
}
|
|
639
1280
|
|
|
640
|
-
//
|
|
641
|
-
|
|
1281
|
+
// This is a simple Fisher-Yates shuffler using the above PRNG.
|
|
1282
|
+
function shuffleArray(arr, seed) {
|
|
1283
|
+
for (let i = arr.length - 1; i > 0; i--) {
|
|
1284
|
+
const j = Math.floor(pseudoRandomNumberGeneratorFromSeed(seed + String(i)) * (i + 1));
|
|
1285
|
+
[arr[i], arr[j]] = [arr[j], arr[i]];
|
|
1286
|
+
}
|
|
1287
|
+
return arr;
|
|
1288
|
+
}
|
|
642
1289
|
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
1290
|
+
// Finally, we shuffle a list off offsets to apply to the widths of the cells.
|
|
1291
|
+
// This ensures that the cells are not all the same width, but that they are
|
|
1292
|
+
// random to produce a more realistic looking skeleton.
|
|
1293
|
+
const widths = shuffleArray([48, 24, 0], seed);
|
|
1294
|
+
return jsx("div", {
|
|
1295
|
+
css: TableSkeletonStyles.container,
|
|
1296
|
+
style: {
|
|
1297
|
+
...style,
|
|
1298
|
+
// TODO: Pull this from the themes; it's not currently available.
|
|
1299
|
+
['--table-skeleton-color']: theme.isDarkMode ? 'rgba(255, 255, 255, 0.1)' : 'rgba(31, 38, 45, 0.1)'
|
|
1300
|
+
},
|
|
1301
|
+
children: [...Array(lines)].map((_, idx) => jsx("div", {
|
|
1302
|
+
css: [TableSkeletonStyles.cell, {
|
|
1303
|
+
width: "calc(100% - ".concat(widths[idx % widths.length], "px)")
|
|
1304
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:TableSkeleton;"]
|
|
1305
|
+
}, idx))
|
|
1306
|
+
});
|
|
646
1307
|
};
|
|
647
1308
|
|
|
648
|
-
// Function to get variables for a certain theme.
|
|
649
|
-
// End users should use useDesignSystemTheme instead.
|
|
650
|
-
function getTheme(themeName) {
|
|
651
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultOptions;
|
|
652
|
-
return {
|
|
653
|
-
colors: getColors(themeName),
|
|
654
|
-
spacing: spacing$1,
|
|
655
|
-
general: generalVariables,
|
|
656
|
-
typography,
|
|
657
|
-
borders: borders$1,
|
|
658
|
-
themeName,
|
|
659
|
-
options
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
const themeNameToAntdName = {
|
|
663
|
-
dark: 'dark',
|
|
664
|
-
default: 'light'
|
|
665
|
-
};
|
|
666
|
-
function getClassNamePrefix(theme) {
|
|
667
|
-
const antdThemeName = themeNameToAntdName[theme.themeName];
|
|
668
|
-
return "".concat(theme.general.classnamePrefix, "-").concat(antdThemeName);
|
|
669
|
-
}
|
|
670
|
-
function getPrefixedClassNameFromTheme(theme, className) {
|
|
671
|
-
return [getClassNamePrefix(theme), className].filter(Boolean).join('-');
|
|
672
|
-
}
|
|
673
|
-
function useDesignSystemTheme() {
|
|
674
|
-
const emotionTheme = useTheme();
|
|
675
|
-
// Graceful fallback to default theme in case a test or developer forgot context.
|
|
676
|
-
const theme = emotionTheme && emotionTheme.general ? emotionTheme : getTheme('default');
|
|
677
|
-
return {
|
|
678
|
-
theme: theme,
|
|
679
|
-
classNamePrefix: getClassNamePrefix(theme),
|
|
680
|
-
getPrefixedClassName: className => getPrefixedClassNameFromTheme(theme, className)
|
|
681
|
-
};
|
|
682
|
-
}
|
|
683
|
-
|
|
684
1309
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
685
1310
|
var _ref = process.env.NODE_ENV === "production" ? {
|
|
686
1311
|
name: "1tciq3q",
|
|
@@ -785,5 +1410,5 @@ var Slider = /*#__PURE__*/Object.freeze({
|
|
|
785
1410
|
Thumb: Thumb
|
|
786
1411
|
});
|
|
787
1412
|
|
|
788
|
-
export { Slider, Table, TableCell, TableHeader, TableRow, TableRowSelectCell };
|
|
1413
|
+
export { Filter, FilterButtonContainer, FilterContent, FilterCountBadge, FilterLoadingSpinner, FilterOptionControlledList, FilterOptionList, FilterOptionListCheckboxItem, FilterOptionListSearch, FilterOptionListSelectItem, FilterSectionHeader, FilterSeparator, FilterTrigger, Slider, Table, TableCell, TableHeader, TableHeaderResizeHandle, TableRow, TableRowMenuContainer, TableRowSelectCell, TableSkeleton };
|
|
789
1414
|
//# sourceMappingURL=development.js.map
|