@databricks/design-system 1.9.1 → 1.9.3

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