@decisiv/ui-components 2.0.1-alpha.8 → 2.0.1-alpha.82

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 (240) hide show
  1. package/lib/atoms/BaseButton/index.d.ts.map +1 -1
  2. package/lib/atoms/BaseButton/index.js +1 -1
  3. package/lib/atoms/BooleanInput/index.d.ts.map +1 -1
  4. package/lib/atoms/BooleanInput/index.js +19 -2
  5. package/lib/atoms/BooleanInput/index.test.js +17 -6
  6. package/lib/atoms/BooleanInput/types.d.ts +2 -0
  7. package/lib/atoms/BooleanInput/types.d.ts.map +1 -1
  8. package/lib/atoms/Calendar/hooks/useCalendar/index.d.ts.map +1 -1
  9. package/lib/atoms/Calendar/hooks/useCalendar/index.js +2 -1
  10. package/lib/atoms/Calendar/hooks/useCalendar/index.test.js +5 -6
  11. package/lib/atoms/Calendar/index.d.ts.map +1 -1
  12. package/lib/atoms/Calendar/index.js +8 -1
  13. package/lib/atoms/Calendar/index.test.js +70 -40
  14. package/lib/atoms/InputField/Containers.d.ts +10 -6
  15. package/lib/atoms/InputField/Containers.d.ts.map +1 -1
  16. package/lib/atoms/InputField/Containers.js +6 -6
  17. package/lib/atoms/InputField/InputLabel.d.ts +1 -0
  18. package/lib/atoms/InputField/InputLabel.d.ts.map +1 -1
  19. package/lib/atoms/InputField/InputLabel.js +2 -1
  20. package/lib/atoms/InputField/index.d.ts +4 -0
  21. package/lib/atoms/InputField/index.d.ts.map +1 -1
  22. package/lib/atoms/InputField/index.js +18 -7
  23. package/lib/atoms/InputField/index.test.js +91 -0
  24. package/lib/atoms/InputField/schema.d.ts.map +1 -1
  25. package/lib/atoms/InputField/schema.js +1 -0
  26. package/lib/atoms/OptionsList/Category.d.ts +1 -1
  27. package/lib/atoms/OptionsList/Category.d.ts.map +1 -1
  28. package/lib/atoms/OptionsList/Category.js +4 -2
  29. package/lib/atoms/OptionsList/Footer.d.ts +8 -0
  30. package/lib/atoms/OptionsList/Footer.d.ts.map +1 -0
  31. package/lib/atoms/OptionsList/Footer.js +72 -0
  32. package/lib/atoms/OptionsList/Option.d.ts.map +1 -1
  33. package/lib/atoms/OptionsList/Option.js +8 -5
  34. package/lib/atoms/OptionsList/index.d.ts.map +1 -1
  35. package/lib/atoms/OptionsList/index.js +43 -16
  36. package/lib/atoms/OptionsList/index.test.js +107 -11
  37. package/lib/atoms/OptionsList/schema.d.ts.map +1 -1
  38. package/lib/atoms/OptionsList/schema.js +4 -0
  39. package/lib/atoms/OptionsList/types.d.ts +14 -0
  40. package/lib/atoms/OptionsList/types.d.ts.map +1 -1
  41. package/lib/atoms/RequiredIcon.d.ts +9 -0
  42. package/lib/atoms/RequiredIcon.d.ts.map +1 -0
  43. package/lib/atoms/{InputField/RequiredIcon.js → RequiredIcon.js} +7 -3
  44. package/lib/components/Button/schema.d.ts +6 -1
  45. package/lib/components/Button/schema.d.ts.map +1 -1
  46. package/lib/components/Button/schema.js +9 -4
  47. package/lib/components/Checkbox/index.d.ts.map +1 -1
  48. package/lib/components/Checkbox/index.js +3 -1
  49. package/lib/components/Checkbox/schema.d.ts.map +1 -1
  50. package/lib/components/Checkbox/schema.js +2 -0
  51. package/lib/components/Combobox/Target.d.ts.map +1 -1
  52. package/lib/components/Combobox/Target.js +45 -14
  53. package/lib/components/Combobox/index.d.ts.map +1 -1
  54. package/lib/components/Combobox/index.js +182 -64
  55. package/lib/components/Combobox/index.test.js +358 -135
  56. package/lib/components/Combobox/schema.d.ts.map +1 -1
  57. package/lib/components/Combobox/schema.js +9 -2
  58. package/lib/components/Combobox/types.d.ts +12 -3
  59. package/lib/components/Combobox/types.d.ts.map +1 -1
  60. package/lib/components/DropdownList/index.d.ts +4 -0
  61. package/lib/components/DropdownList/index.d.ts.map +1 -1
  62. package/lib/components/DropdownList/index.js +76 -11
  63. package/lib/components/DropdownList/propTypes.d.ts +4 -0
  64. package/lib/components/DropdownList/propTypes.d.ts.map +1 -0
  65. package/lib/components/DropdownList/propTypes.js +42 -0
  66. package/lib/components/DropdownList/schema.d.ts.map +1 -1
  67. package/lib/components/DropdownList/schema.js +5 -0
  68. package/lib/components/DropdownList/types.d.ts +4 -1
  69. package/lib/components/DropdownList/types.d.ts.map +1 -1
  70. package/lib/components/Filter/IconWrapper/index.d.ts +197 -0
  71. package/lib/components/Filter/IconWrapper/index.d.ts.map +1 -0
  72. package/lib/components/Filter/IconWrapper/index.js +35 -0
  73. package/lib/components/Filter/SimplePrimary/index.d.ts +31 -0
  74. package/lib/components/Filter/SimplePrimary/index.d.ts.map +1 -0
  75. package/lib/components/Filter/SimplePrimary/index.js +58 -0
  76. package/lib/components/Filter/SimplePrimary/index.test.js +34 -0
  77. package/lib/components/Filter/StyledFilter.d.ts +4 -0
  78. package/lib/components/Filter/StyledFilter.d.ts.map +1 -0
  79. package/lib/components/Filter/StyledFilter.js +39 -0
  80. package/lib/components/Filter/StyledLabel/index.d.ts +8 -0
  81. package/lib/components/Filter/StyledLabel/index.d.ts.map +1 -0
  82. package/lib/components/Filter/StyledLabel/index.js +30 -0
  83. package/lib/components/Filter/index.d.ts +27 -0
  84. package/lib/components/Filter/index.d.ts.map +1 -0
  85. package/lib/components/Filter/index.js +95 -0
  86. package/lib/components/Filter/index.test.js +41 -0
  87. package/lib/components/Filter/kind.d.ts +6 -0
  88. package/lib/components/Filter/kind.d.ts.map +1 -0
  89. package/lib/components/Filter/kind.js +45 -0
  90. package/lib/components/Filter/schema.d.ts +9 -0
  91. package/lib/components/Filter/schema.d.ts.map +1 -0
  92. package/lib/components/Filter/schema.js +32 -0
  93. package/lib/components/Filter/types.d.ts +17 -0
  94. package/lib/components/Filter/types.d.ts.map +1 -0
  95. package/lib/components/Filter/types.js +1 -0
  96. package/lib/components/LeftNav/Item/ClickArea.d.ts.map +1 -1
  97. package/lib/components/LeftNav/Item/ClickArea.js +2 -2
  98. package/lib/components/LeftNav/Item/ItemWrapper.d.ts.map +1 -1
  99. package/lib/components/LeftNav/Item/ItemWrapper.js +3 -3
  100. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts +7 -0
  101. package/lib/components/LeftNav/Item/MenuItemWrapper.d.ts.map +1 -0
  102. package/lib/components/LeftNav/Item/MenuItemWrapper.js +20 -0
  103. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.d.ts.map +1 -1
  104. package/lib/components/LeftNav/Item/NavCollapsedXItem/index.js +7 -5
  105. package/lib/components/LeftNav/Item/NavExpandedItem/index.d.ts.map +1 -1
  106. package/lib/components/LeftNav/Item/NavExpandedItem/index.js +24 -13
  107. package/lib/components/LeftNav/Item/types.d.ts +1 -1
  108. package/lib/components/LeftNav/Item/types.d.ts.map +1 -1
  109. package/lib/components/LeftNav/index.test.js +13 -3
  110. package/lib/components/LeftNav/schema.d.ts.map +1 -1
  111. package/lib/components/LeftNav/schema.js +2 -0
  112. package/lib/components/LeftNav/types.d.ts +1 -0
  113. package/lib/components/LeftNav/types.d.ts.map +1 -1
  114. package/lib/components/Menu/index.d.ts.map +1 -1
  115. package/lib/components/Menu/index.js +3 -1
  116. package/lib/components/Menu/types.d.ts +2 -0
  117. package/lib/components/Menu/types.d.ts.map +1 -1
  118. package/lib/components/Modal/components.d.ts +2 -2
  119. package/lib/components/Modal/index.d.ts.map +1 -1
  120. package/lib/components/Modal/index.js +5 -5
  121. package/lib/components/Modal/index.test.js +32 -0
  122. package/lib/components/Modal/schema.d.ts.map +1 -1
  123. package/lib/components/Modal/schema.js +2 -2
  124. package/lib/components/Modal/types.d.ts +2 -2
  125. package/lib/components/Modal/types.d.ts.map +1 -1
  126. package/lib/components/Notifications/Notification/components.d.ts +3 -3
  127. package/lib/components/Notifications/Notification/components.d.ts.map +1 -1
  128. package/lib/components/Notifications/Notification/components.js +12 -6
  129. package/lib/components/Notifications/Notification/index.d.ts +3 -6
  130. package/lib/components/Notifications/Notification/index.d.ts.map +1 -1
  131. package/lib/components/Notifications/Notification/index.js +19 -12
  132. package/lib/components/Notifications/Notification/index.test.js +38 -19
  133. package/lib/components/Notifications/NotificationsPanel/index.d.ts +2 -1
  134. package/lib/components/Notifications/NotificationsPanel/index.d.ts.map +1 -1
  135. package/lib/components/Notifications/NotificationsPanel/index.js +44 -21
  136. package/lib/components/Notifications/NotificationsPanel/schema.js +1 -1
  137. package/lib/components/Notifications/Notifier.test.js +79 -10
  138. package/lib/components/Notifications/constants.d.ts +2 -0
  139. package/lib/components/Notifications/constants.d.ts.map +1 -0
  140. package/lib/components/Notifications/constants.js +16 -0
  141. package/lib/components/Notifications/schema.d.ts.map +1 -1
  142. package/lib/components/Notifications/schema.js +2 -1
  143. package/lib/components/Notifications/useNotifications.d.ts +1 -0
  144. package/lib/components/Notifications/useNotifications.d.ts.map +1 -1
  145. package/lib/components/Notifications/useNotifications.js +3 -3
  146. package/lib/components/Notifications/useNotifications.test.js +7 -4
  147. package/lib/components/Pagination/Pagination.d.ts +1 -1
  148. package/lib/components/Pagination/Pagination.d.ts.map +1 -1
  149. package/lib/components/Pagination/Pagination.js +1 -0
  150. package/lib/components/Pagination/Pagination.test.js +9 -0
  151. package/lib/components/Popover/utils.d.ts +1 -1
  152. package/lib/components/Select/Target.js +1 -1
  153. package/lib/components/Select/index.d.ts.map +1 -1
  154. package/lib/components/Select/index.js +20 -1
  155. package/lib/components/Select/index.test.js +31 -9
  156. package/lib/components/Select/schema.d.ts.map +1 -1
  157. package/lib/components/Select/schema.js +5 -0
  158. package/lib/components/Select/types.d.ts +2 -1
  159. package/lib/components/Select/types.d.ts.map +1 -1
  160. package/lib/components/SelectDate/Target.js +1 -1
  161. package/lib/components/SelectDate/index.test.js +71 -51
  162. package/lib/components/SelectDateRange/index.test.js +78 -58
  163. package/lib/components/SelectMenu/index.d.ts +5 -0
  164. package/lib/components/SelectMenu/index.d.ts.map +1 -1
  165. package/lib/components/SelectMenu/index.js +27 -3
  166. package/lib/components/SelectMenu/schema.d.ts.map +1 -1
  167. package/lib/components/SelectMenu/schema.js +4 -0
  168. package/lib/components/Table/Body.d.ts.map +1 -1
  169. package/lib/components/Table/Body.js +182 -38
  170. package/lib/components/Table/Container.d.ts.map +1 -1
  171. package/lib/components/Table/Container.js +2 -2
  172. package/lib/components/Table/DataRow.d.ts.map +1 -1
  173. package/lib/components/Table/DataRow.js +43 -16
  174. package/lib/components/Table/DraggableWrapper.d.ts +5 -0
  175. package/lib/components/Table/DraggableWrapper.d.ts.map +1 -0
  176. package/lib/components/Table/DraggableWrapper.js +38 -0
  177. package/lib/components/Table/Grip.d.ts +4 -0
  178. package/lib/components/Table/Grip.d.ts.map +1 -0
  179. package/lib/components/Table/Grip.js +30 -0
  180. package/lib/components/Table/Head.d.ts +1 -1
  181. package/lib/components/Table/Head.d.ts.map +1 -1
  182. package/lib/components/Table/Head.js +11 -5
  183. package/lib/components/Table/HeaderCell/index.d.ts.map +1 -1
  184. package/lib/components/Table/HeaderCell/index.js +22 -8
  185. package/lib/components/Table/HeaderCell/types.d.ts +6 -1
  186. package/lib/components/Table/HeaderCell/types.d.ts.map +1 -1
  187. package/lib/components/Table/Provider.d.ts +13 -4
  188. package/lib/components/Table/Provider.d.ts.map +1 -1
  189. package/lib/components/Table/Provider.js +45 -5
  190. package/lib/components/Table/index.d.ts.map +1 -1
  191. package/lib/components/Table/index.js +112 -18
  192. package/lib/components/Table/index.test.js +330 -84
  193. package/lib/components/Table/schema.columns.d.ts.map +1 -1
  194. package/lib/components/Table/schema.columns.js +6 -4
  195. package/lib/components/Table/schema.d.ts.map +1 -1
  196. package/lib/components/Table/schema.js +8 -6
  197. package/lib/components/Table/types.d.ts +34 -4
  198. package/lib/components/Table/types.d.ts.map +1 -1
  199. package/lib/components/Table/utils.d.ts +2 -8
  200. package/lib/components/Table/utils.d.ts.map +1 -1
  201. package/lib/components/Table/utils.js +21 -20
  202. package/lib/components/Tag/types.d.ts +1 -1
  203. package/lib/components/Tag/types.d.ts.map +1 -1
  204. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  205. package/lib/components/TextArea/TextArea.js +1 -1
  206. package/lib/components/TextArea/index.js +1 -0
  207. package/lib/components/TextArea/index.test.js +5 -0
  208. package/lib/components/TextField/Input.js +1 -1
  209. package/lib/components/TextField/index.test.js +5 -0
  210. package/lib/components/Toggle/index.d.ts.map +1 -1
  211. package/lib/components/Toggle/index.js +4 -0
  212. package/lib/components/Toggle/index.test.js +39 -10
  213. package/lib/components/TopNav/BrandInfo/index.d.ts +2 -1
  214. package/lib/components/TopNav/BrandInfo/index.d.ts.map +1 -1
  215. package/lib/components/TopNav/BrandInfo/index.js +9 -1
  216. package/lib/components/TopNav/BrandInfo/schema.d.ts.map +1 -1
  217. package/lib/components/TopNav/BrandInfo/schema.js +4 -1
  218. package/lib/components/TopNav/index.test.js +28 -0
  219. package/lib/components/index.d.ts +1 -0
  220. package/lib/components/index.d.ts.map +1 -1
  221. package/lib/components/index.js +9 -0
  222. package/lib/providers/ConfigProvider/index.d.ts.map +1 -1
  223. package/lib/providers/ConfigProvider/index.js +5 -1
  224. package/lib/providers/ConfigProvider/utils/context.d.ts +1 -1
  225. package/lib/providers/ConfigProvider/utils/context.d.ts.map +1 -1
  226. package/lib/providers/ConfigProvider/utils/normalizer.d.ts.map +1 -1
  227. package/lib/providers/ConfigProvider/utils/normalizer.js +1 -1
  228. package/lib/providers/ConfigProvider/utils/translations.d.ts +1 -1
  229. package/lib/providers/ConfigProvider/utils/translations.js +1 -1
  230. package/lib/providers/NotificationsProvider/index.d.ts +6 -5
  231. package/lib/providers/NotificationsProvider/index.d.ts.map +1 -1
  232. package/lib/providers/NotificationsProvider/index.js +47 -28
  233. package/lib/providers/NotificationsProvider/types.d.ts +4 -1
  234. package/lib/providers/NotificationsProvider/types.d.ts.map +1 -1
  235. package/lib/utils/joinClassnames.d.ts +3 -0
  236. package/lib/utils/joinClassnames.d.ts.map +1 -0
  237. package/lib/utils/joinClassnames.js +26 -0
  238. package/package.json +4 -2
  239. package/lib/atoms/InputField/RequiredIcon.d.ts +0 -4
  240. package/lib/atoms/InputField/RequiredIcon.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/schema.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,MAAM,KAAwC,CAAC;AAqErD,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/schema.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,MAAM,KAAwC,CAAC;AAuFrD,eAAe,MAAM,CAAC"}
@@ -29,7 +29,9 @@ schema.propTypes = _objectSpread({}, (0, _omit.default)(_InputField.schema.makeP
29
29
  loading: _reactDesc.PropTypes.bool.description('Useful if variant="async". When true, a loading message will render in the dropdown instead of options.'),
30
30
  onChange: _reactDesc.PropTypes.func.description('This event handler is not called by Combobox. Prefer the more specific `onChangeInputValue` or `onChangeValue` props.').format('DO NOT USE'),
31
31
  onChangeInputValue: _reactDesc.PropTypes.func.description('An event handler called when the text value in the `<input>` is changed (including when it is cleared). IMPORTANT NOTE: This handler may be called with a change event, or with _NO_ arguments (indicates the input value was cleared). Your function must be able to handle both.'),
32
- onChangeValue: _reactDesc.PropTypes.func.description('An event handler called when a option in the dropdown is selected (with keyboard or click). Called with the `id` of the selected option.'),
32
+ onChangeValue: _reactDesc.PropTypes.func.description('An event handler called when a option in the dropdown is selected (with keyboard or click). Called with the `id` of the selected option (may be null under circumstances). Second argument is an object with key: value of `removed: boolean`.'),
33
+ onHide: _reactDesc.PropTypes.func.description('An event handler called when the options list is expanded. Called with no arguments.'),
34
+ onShow: _reactDesc.PropTypes.func.description('An event handler called when the options list is collapsed. Called with no arguments.'),
33
35
  options: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.shape({
34
36
  decoration: _reactDesc.PropTypes.shape({
35
37
  type: _reactDesc.PropTypes.oneOf(['Avatar', 'Badge'])
@@ -40,7 +42,12 @@ schema.propTypes = _objectSpread({}, (0, _omit.default)(_InputField.schema.makeP
40
42
  value: _reactDesc.PropTypes.string.description('The value for an option in the dropdown list.')
41
43
  })).description('The array of data for the options that will be rendered'),
42
44
  inputValue: _reactDesc.PropTypes.string.description('The text value for the input field. If provided, controlling the Combobox must be handled externally. Overrides `defaultInputValue`.'),
43
- value: _reactDesc.PropTypes.string.description('The ID of the option that is selected. If provided, controlling the Select must be handled externally. Overrides `defaultValue`.'),
45
+ value: _reactDesc.PropTypes.oneOfType([_reactDesc.PropTypes.string, _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.shape({
46
+ id: _reactDesc.PropTypes.string,
47
+ label: _reactDesc.PropTypes.string,
48
+ value: _reactDesc.PropTypes.string
49
+ }))]).description('The ID of the option that is selected. If provided, controlling the Select must be handled externally. Overrides `defaultValue`.'),
50
+ multiple: _reactDesc.PropTypes.bool.description('Used when multiple selections can be made in the Combobox').defaultValue(false),
44
51
  variant: _reactDesc.PropTypes.oneOf(['async', 'sync']).description('Enables different logic for rendering the dropdown list.').defaultValue('sync'),
45
52
  renderOptionLabel: _reactDesc.PropTypes.func.description('Function to customize render of option labels, called with the item value'),
46
53
  zIndex: _reactDesc.PropTypes.number.description('Sets the z-index style property of the options list')
@@ -1,23 +1,29 @@
1
1
  import { InputHTMLAttributes, Ref } from 'react';
2
2
  import { BaseInputFieldProps } from '../../atoms/InputField';
3
+ import { ActionHandler } from '../Tag/types';
3
4
  import { PopoverProps } from '../Popover/types';
4
5
  import { Items, DropdownListProps } from '../DropdownList';
5
6
  export declare type ComboboxInputRef = HTMLInputElement;
6
7
  declare type Variant = 'async' | 'sync';
7
- export interface ComboboxProps extends Omit<React.InputHTMLAttributes<ComboboxInputRef>, 'onChange'>, Omit<BaseInputFieldProps, 'children' | 'onChange' | 'value'>, Pick<DropdownListProps, 'renderOptionLabel'> {
8
+ interface TOnChangeMeta {
9
+ removed: boolean;
10
+ }
11
+ export interface ComboboxProps extends Omit<React.InputHTMLAttributes<ComboboxInputRef>, 'onChange' | 'value'>, Omit<BaseInputFieldProps, 'children' | 'onChange' | 'value'>, Pick<DropdownListProps, 'onShow' | 'onHide' | 'renderOptionLabel'> {
8
12
  clearButtonLabel?: string;
9
13
  defaultInputValue?: string;
10
14
  defaultValue?: string;
11
15
  inputValue?: string;
16
+ multiple?: boolean;
17
+ maxWidth?: string;
12
18
  loading?: boolean;
13
19
  onBlur?: React.FocusEventHandler;
14
20
  onChangeInputValue?: (event?: React.ChangeEvent) => void;
15
- onChangeValue?: (optionId?: string) => void;
21
+ onChangeValue?: (optionId: string | null, onChangeMeta: TOnChangeMeta) => void;
16
22
  onClick?: React.MouseEventHandler;
17
23
  onFocus?: React.FocusEventHandler;
18
24
  onKeyDown?: React.KeyboardEventHandler;
19
25
  options?: Items;
20
- value?: string;
26
+ value?: string | Items;
21
27
  variant?: Variant;
22
28
  zIndex?: PopoverProps['zIndex'];
23
29
  }
@@ -36,6 +42,9 @@ export interface TargetProps extends InputHTMLAttributes<HTMLInputElement> {
36
42
  hasClearButton?: boolean;
37
43
  inputFieldLabel: string;
38
44
  isPopoverVisible?: boolean;
45
+ multiple?: boolean;
46
+ selectedValues?: any[];
47
+ removeSelected: (id: string) => ActionHandler | undefined;
39
48
  onClear?: () => void;
40
49
  ref?: Ref<HTMLInputElement>;
41
50
  variant: Variant;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Combobox/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,oBAAY,gBAAgB,GAAG,gBAAgB,CAAC;AAEhD,aAAK,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEhC,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gB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BAAkB,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9D;AAED,MAAM,WAAW,WAAY,SAAQ,mBAAmB,CAAC,gBAAgB,CAAC;IACxE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC;IACvB,cAAc,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,aAAa,GAAG,SAAS,CAAC;IAC1D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,sBAAsB,EAAE,MAAM,IAAI,CAAC;CACpC"}
@@ -9,6 +9,10 @@ declare function DropdownList(props: Props): JSX.Element;
9
9
  declare namespace DropdownList {
10
10
  var displayName: string;
11
11
  var propTypes: any;
12
+ var defaultProps: {
13
+ actions: undefined;
14
+ defaultFooter: boolean;
15
+ };
12
16
  }
13
17
  export default DropdownList;
14
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DropdownList/index.tsx"],"names":[],"mappings":";AAeA,OAAO,EACL,QAAQ,IAAI,YAAY,EACxB,MAAM,IAAI,UAAU,EAErB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGlD,OAAO,EACL,YAAY,IAAI,oBAAoB,EACpC,gBAAgB,EAChB,MAAM,IAAI,kBAAkB,EAC5B,KAAK,IAAI,iBAAiB,GAC3B,CAAC;AAEF,oBAAY,KAAK,GAAG,gBAAgB,EAAE,CAAC;AACvC,oBAAY,QAAQ,GAAG,YAAY,CAAC;AACpC,oBAAY,MAAM,GAAG,UAAU,CAAC;AAEhC,iBAAS,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAkI/C;kBAlIQ,YAAY;;;;AAoJrB,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DropdownList/index.tsx"],"names":[],"mappings":";AAgBA,OAAO,EACL,QAAQ,IAAI,YAAY,EACxB,MAAM,IAAI,UAAU,EAErB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAIlD,OAAO,EACL,YAAY,IAAI,oBAAoB,EACpC,gBAAgB,EAChB,MAAM,IAAI,kBAAkB,EAC5B,KAAK,IAAI,iBAAiB,GAC3B,CAAC;AAEF,oBAAY,KAAK,GAAG,gBAAgB,EAAE,CAAC;AACvC,oBAAY,QAAQ,GAAG,YAAY,CAAC;AACpC,oBAAY,MAAM,GAAG,UAAU,CAAC;AAEhC,iBAAS,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA+L/C;kBA/LQ,YAAY;;;;;;;;AAuNrB,eAAe,YAAY,CAAC"}
@@ -29,10 +29,12 @@ var _react = _interopRequireWildcard(require("react"));
29
29
 
30
30
  var _composeReactRefs = _interopRequireDefault(require("@seznam/compose-react-refs"));
31
31
 
32
- var _canUseDOM = _interopRequireDefault(require("../../utils/canUseDOM"));
33
-
34
32
  var _Popover = _interopRequireDefault(require("../Popover"));
35
33
 
34
+ var _Grid = _interopRequireDefault(require("../Grid"));
35
+
36
+ var _propTypes2 = require("./propTypes");
37
+
36
38
  var _schema = _interopRequireDefault(require("./schema"));
37
39
 
38
40
  var _types = require("../../atoms/OptionsList/types");
@@ -41,6 +43,8 @@ var _OptionsList = _interopRequireWildcard(require("../../atoms/OptionsList"));
41
43
 
42
44
  var _types2 = _interopRequireWildcard(require("./types"));
43
45
 
46
+ var _canUseDOM = _interopRequireDefault(require("../../utils/canUseDOM"));
47
+
44
48
  var _focusWithoutScrolling = _interopRequireDefault(require("../../utils/focusWithoutScrolling"));
45
49
 
46
50
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
@@ -68,10 +72,12 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
68
72
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
69
73
 
70
74
  function DropdownList(props) {
71
- var borderRadius = props.borderRadius,
75
+ var actions = props.actions,
76
+ borderRadius = props.borderRadius,
72
77
  containerSelector = props.containerSelector,
73
78
  defaultSelectedIds = props.defaultSelectedIds,
74
79
  defaultVisible = props.defaultVisible,
80
+ defaultFooter = props.defaultFooter,
75
81
  _props$focusOnShowing = props.focusOnShowing,
76
82
  focusOnShowing = _props$focusOnShowing === void 0 ? true : _props$focusOnShowing,
77
83
  listRef = props.listRef,
@@ -89,7 +95,7 @@ function DropdownList(props) {
89
95
  maxHeight = props.maxHeight,
90
96
  maxWidth = props.maxWidth,
91
97
  minWidth = props.minWidth,
92
- rest = _objectWithoutProperties(props, ["borderRadius", "containerSelector", "defaultSelectedIds", "defaultVisible", "focusOnShowing", "listRef", "onChange", "onHide", "onShow", "placement", "selectedIds", "showArrow", "target", "visible", "zIndex", "PanelComponent", "maxHeight", "maxWidth", "minWidth"]); // Use a ref callback to get more control over re-rendering when a ref is stored.
98
+ rest = _objectWithoutProperties(props, ["actions", "borderRadius", "containerSelector", "defaultSelectedIds", "defaultVisible", "defaultFooter", "focusOnShowing", "listRef", "onChange", "onHide", "onShow", "placement", "selectedIds", "showArrow", "target", "visible", "zIndex", "PanelComponent", "maxHeight", "maxWidth", "minWidth"]); // Use a ref callback to get more control over re-rendering when a ref is stored.
93
99
  // Specifically, the scroll to selected item on first render of dropdown requires this.
94
100
 
95
101
 
@@ -104,8 +110,18 @@ function DropdownList(props) {
104
110
  _useState4 = _slicedToArray(_useState3, 2),
105
111
  showing = _useState4[0],
106
112
  setShowing = _useState4[1];
113
+
114
+ var _useState5 = (0, _react.useState)(selectedIdsProp),
115
+ _useState6 = _slicedToArray(_useState5, 2),
116
+ selected = _useState6[0],
117
+ setSelected = _useState6[1];
118
+
119
+ var _useState7 = (0, _react.useState)(selectedIdsProp),
120
+ _useState8 = _slicedToArray(_useState7, 2),
121
+ saved = _useState8[0],
122
+ setSaved = _useState8[1];
107
123
  /**
108
- * If the visible prop changes, it should always override any locally maintained current value.
124
+ * If the visible or selected prop changes, it should always override any locally maintained current value.
109
125
  * This allows the component to be controlled.
110
126
  */
111
127
 
@@ -114,16 +130,22 @@ function DropdownList(props) {
114
130
  if (typeof visible === 'boolean' && visible !== showing) {
115
131
  setShowing(visible);
116
132
  }
117
- }, [visible, showing]);
133
+
134
+ if (typeof selectedIdsProp !== 'undefined' && selectedIdsProp !== selected) {
135
+ setSelected(selectedIdsProp);
136
+ }
137
+ }, [visible, showing, selectedIdsProp, selected]);
118
138
  var handleOnHide = (0, _react.useCallback)(function (event) {
119
139
  setShowing(false);
140
+ setSelected([]);
120
141
  onHide && onHide(event);
121
142
  popRef && popRef.current && popRef.current.targetNode && popRef.current.targetNode.focus();
122
143
  }, [onHide]);
123
144
  var handleOnShow = (0, _react.useCallback)(function (event) {
145
+ setSelected(saved);
124
146
  setShowing(true);
125
147
  onShow && onShow(event);
126
- }, [onShow]);
148
+ }, [onShow, setSelected, saved]);
127
149
  (0, _react.useEffect)(function () {
128
150
  if (containerRef && focusOnShowing && showing) {
129
151
  (0, _focusWithoutScrolling.default)(containerRef);
@@ -136,13 +158,49 @@ function DropdownList(props) {
136
158
 
137
159
  var handleOnChange = (0, _react.useCallback)(function (selection) {
138
160
  onChange && onChange(Array.isArray(selection) ? selection : [selection]);
139
- }, [onChange]);
161
+ defaultFooter && setSelected(selection) && setSaved(selection);
162
+ }, [onChange, setSelected, setSaved, defaultFooter]);
163
+ var handleOnApply = (0, _react.useCallback)(function () {
164
+ setSaved(selected);
165
+ popRef && popRef.current && popRef.current.hide();
166
+ }, [setSaved, selected]);
167
+
168
+ var handleOnCancel = function handleOnCancel() {
169
+ popRef && popRef.current && popRef.current.hide();
170
+ };
171
+
172
+ var handleOnClear = function handleOnClear() {
173
+ setSaved([]);
174
+ setSelected([]);
175
+ };
176
+
140
177
  var onKeyDown = (0, _react.useCallback)(function (event) {
141
178
  if (event.key === 'Tab') {
142
179
  event.preventDefault();
143
180
  event.stopPropagation();
144
181
  }
145
182
  }, []);
183
+ var defaultActions = {
184
+ left: [{
185
+ id: '1',
186
+ text: 'apply',
187
+ onClick: handleOnApply
188
+ }, {
189
+ id: '2',
190
+ text: 'cancel',
191
+ kind: 'secondary',
192
+ onClick: handleOnCancel
193
+ }],
194
+ right: [{
195
+ id: '3',
196
+ text: 'clear',
197
+ variant: 'ghost',
198
+ kind: 'secondary',
199
+ intent: 'danger',
200
+ onClick: handleOnClear
201
+ }]
202
+ };
203
+ var footerActions = defaultFooter ? actions || defaultActions : actions;
146
204
  return _react.default.createElement(_Popover.default, {
147
205
  borderRadius: borderRadius,
148
206
  containerSelector: containerSelector,
@@ -160,20 +218,23 @@ function DropdownList(props) {
160
218
  maxHeight: maxHeight,
161
219
  maxWidth: maxWidth,
162
220
  minWidth: minWidth
163
- }, _react.default.createElement(PanelComponent, null)) : _react.default.createElement(_OptionsList.default, _extends({
221
+ }, _react.default.createElement(PanelComponent, null)) : _react.default.createElement(_Grid.default.Container, null, _react.default.createElement(_Grid.default.Row, null, _react.default.createElement(_OptionsList.default, _extends({
222
+ actions: footerActions,
164
223
  defaultSelected: defaultSelectedIds,
165
- selected: selectedIdsProp,
224
+ selected: selected,
166
225
  onChange: handleOnChange,
167
226
  ref: listRef ? (0, _composeReactRefs.default)(listRef, setContainerRefFunc) : setContainerRefFunc,
168
227
  onKeyDown: onKeyDown,
169
228
  maxHeight: maxHeight,
170
229
  maxWidth: maxWidth,
171
230
  minWidth: minWidth
172
- }, rest)));
231
+ }, rest)))));
173
232
  }
174
233
 
175
234
  DropdownList.displayName = 'DropdownList';
176
235
  DropdownList.propTypes = _objectSpread({}, _schema.default.propTypes, {
236
+ actions: _propTypes2.footerValidator,
237
+ defaultFooter: _propTypes2.footerValidator,
177
238
  target: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.element, _propTypes.default.shape({
178
239
  current: _propTypes.default.instanceOf(
179
240
  /* istanbul ignore next didn't test a non DOM env */
@@ -181,5 +242,9 @@ DropdownList.propTypes = _objectSpread({}, _schema.default.propTypes, {
181
242
  _canUseDOM.default ? Element : function Element() {})
182
243
  })]).isRequired
183
244
  });
245
+ DropdownList.defaultProps = {
246
+ actions: undefined,
247
+ defaultFooter: false
248
+ };
184
249
  var _default = DropdownList;
185
250
  exports.default = _default;
@@ -0,0 +1,4 @@
1
+ import DropdownListProps from './types';
2
+ declare function footerValidator(props: DropdownListProps, propName: 'defaultFooter' | 'actions', componentName: 'DropdownList'): Error | null;
3
+ export { footerValidator };
4
+ //# sourceMappingURL=propTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propTypes.d.ts","sourceRoot":"","sources":["../../../src/components/DropdownList/propTypes.ts"],"names":[],"mappings":"AAGA,OAAO,iBAAiB,MAAM,SAAS,CAAC;AAExC,iBAAS,eAAe,CACtB,KAAK,EAAE,iBAAiB,EACxB,QAAQ,EAAE,eAAe,GAAG,SAAS,EACrC,aAAa,EAAE,cAAc,GAC5B,KAAK,GAAG,IAAI,CAgDd;AAGD,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.footerValidator = footerValidator;
7
+
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+
10
+ var _Button = require("../Button");
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
+
16
+ function footerValidator(props, propName, componentName) {
17
+ var defaultFooter = props.defaultFooter,
18
+ actions = props.actions;
19
+
20
+ if (!!defaultFooter && !!actions) {
21
+ return new Error("Both `defaultFooter` and `actions` are supplied to `".concat(componentName, "`. `defaultFooter` will not be used"));
22
+ }
23
+
24
+ if (defaultFooter) {
25
+ _propTypes.default.checkPropTypes(_defineProperty({}, propName, _propTypes.default.bool), props, propName, componentName);
26
+ }
27
+
28
+ if (actions) {
29
+ _propTypes.default.checkPropTypes(_defineProperty({}, propName, _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.shape((0, _Button.makeButtonSchemaPropTypes)({
30
+ id: _propTypes.default.string.isRequired
31
+ }))), _propTypes.default.shape({
32
+ left: _propTypes.default.arrayOf(_propTypes.default.shape((0, _Button.makeButtonSchemaPropTypes)({
33
+ id: _propTypes.default.string.isRequired
34
+ }))),
35
+ right: _propTypes.default.arrayOf(_propTypes.default.shape((0, _Button.makeButtonSchemaPropTypes)({
36
+ id: _propTypes.default.string.isRequired
37
+ })))
38
+ })])), props, propName, componentName);
39
+ }
40
+
41
+ return null;
42
+ } // eslint-disable-next-line import/prefer-default-export
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/DropdownList/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAA4C,CAAC;AA8FzD,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/DropdownList/schema.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,KAA4C,CAAC;AA4GzD,eAAe,MAAM,CAAC"}
@@ -26,6 +26,7 @@ schema.propTypes = _objectSpread({}, (0, _omit.default)(_schema.default.makeProp
26
26
  containerSelector: _reactDesc.PropTypes.string.description('A CSS selector to the element where the popovers should be rendered in, or "parent" to render the popover in-place.').defaultValue('body'),
27
27
  defaultSelectedIds: _reactDesc.PropTypes.oneOfType([_reactDesc.PropTypes.string, _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.string)]).description('These IDs will appear as selected the first time the user opens the dropdown.'),
28
28
  defaultVisible: _reactDesc.PropTypes.bool.description('Controls if the dropdown list should be opened by default.'),
29
+ defaultFooter: _reactDesc.PropTypes.bool.description('Controls if the dropdown list uses the OptionsList footer with default actions').defaultValue('false'),
29
30
  items: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.shape({
30
31
  decoration: _reactDesc.PropTypes.shape({
31
32
  type: _reactDesc.PropTypes.oneOf(['Avatar', 'Badge'])
@@ -49,6 +50,10 @@ schema.propTypes = _objectSpread({}, (0, _omit.default)(_schema.default.makeProp
49
50
  placement: _reactDesc.PropTypes.string.description('The preferred side of the target the popover should attach to. See notes on Popover.').defaultValue('bottom-start'),
50
51
  visible: _reactDesc.PropTypes.bool.description('Used when component is controlled. Controls the display status of the dropdown.'),
51
52
  renderOptionLabel: _reactDesc.PropTypes.func.description('Function to customize render of option labels, called with the item value'),
53
+ actions: _reactDesc.PropTypes.oneOfType([_reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.object), _reactDesc.PropTypes.shape({
54
+ left: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.object),
55
+ right: _reactDesc.PropTypes.arrayOf(_reactDesc.PropTypes.object)
56
+ })]).description('A collection of objects, each containing a subset of props valid for a Button component. Check the notes on the OptionsList.'),
52
57
  zIndex: _reactDesc.PropTypes.number.description('Sets the z-index style property of the options list'),
53
58
  PanelComponent: _reactDesc.PropTypes.any.description('A React component that, if provided, is rendered in place of the items. Useful for loading/ no matches type messages and similar.')
54
59
  });
@@ -1,11 +1,12 @@
1
1
  import { Ref, ComponentType } from 'react';
2
2
  import { PopoverProps, Target as PopoverTarget } from '../Popover';
3
- import { OptionsListProps, ItemOption, Category } from '../../atoms/OptionsList/types';
3
+ import { FooterActions, OptionsListProps, ItemOption, Category } from '../../atoms/OptionsList/types';
4
4
  export declare type DropdownListItem = ItemOption | Category;
5
5
  export default interface Props extends Omit<OptionsListProps, 'defaultSelected' | 'items' | 'name' | 'onChange' | 'onKeyDown' | 'selected' | 'selectable' | 'tabIndex'> {
6
6
  containerSelector?: string;
7
7
  defaultSelectedIds?: string | string[];
8
8
  defaultVisible?: boolean;
9
+ defaultFooter?: boolean;
9
10
  focusOnShowing?: boolean;
10
11
  items: DropdownListItem[];
11
12
  listRef?: Ref<HTMLUListElement>;
@@ -15,8 +16,10 @@ export default interface Props extends Omit<OptionsListProps, 'defaultSelected'
15
16
  onShow?: (event?: Event) => void;
16
17
  placement?: PopoverProps['placement'];
17
18
  selectedIds?: string | string[];
19
+ showCheckbox?: boolean;
18
20
  showArrow?: boolean;
19
21
  target: PopoverTarget;
22
+ actions?: FooterActions;
20
23
  visible?: boolean;
21
24
  zIndex?: PopoverProps['zIndex'];
22
25
  PanelComponent?: ComponentType;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/DropdownList/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EACL,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACT,MAAM,+BAA+B,CAAC;AAEvC,oBAAY,gBAAgB,GAAG,UAAU,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// <reference types="react" />
2
+ import { FilterProps } from '../types';
3
+ declare const IconWrapper: import("styled-components").StyledComponent<"div", any, Partial<{
4
+ readonly alignContent?: string | import("../../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
5
+ readonly XS: "XS";
6
+ readonly SM: "SM";
7
+ readonly MD: "MD";
8
+ readonly LG: "LG";
9
+ readonly XL: "XL";
10
+ }> | undefined;
11
+ readonly alignItems?: string | import("../../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
12
+ readonly XS: "XS";
13
+ readonly SM: "SM";
14
+ readonly MD: "MD";
15
+ readonly LG: "LG";
16
+ readonly XL: "XL";
17
+ }> | undefined;
18
+ readonly alignSelf?: string | import("../../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
19
+ readonly XS: "XS";
20
+ readonly SM: "SM";
21
+ readonly MD: "MD";
22
+ readonly LG: "LG";
23
+ readonly XL: "XL";
24
+ }> | undefined;
25
+ readonly flex?: string | number | import("../../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("react").ReactText, {
26
+ readonly XS: "XS";
27
+ readonly SM: "SM";
28
+ readonly MD: "MD";
29
+ readonly LG: "LG";
30
+ readonly XL: "XL";
31
+ }> | undefined;
32
+ readonly flexBasis?: string | import("../../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
33
+ readonly XS: "XS";
34
+ readonly SM: "SM";
35
+ readonly MD: "MD";
36
+ readonly LG: "LG";
37
+ readonly XL: "XL";
38
+ }> | undefined;
39
+ readonly flexDirection?: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "row" | "column" | "column-reverse" | "row-reverse" | import("../../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("csstype").FlexDirectionProperty, {
40
+ readonly XS: "XS";
41
+ readonly SM: "SM";
42
+ readonly MD: "MD";
43
+ readonly LG: "LG";
44
+ readonly XL: "XL";
45
+ }> | undefined;
46
+ readonly flexGrow?: number | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | import("../../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("csstype").GlobalsNumber, {
47
+ readonly XS: "XS";
48
+ readonly SM: "SM";
49
+ readonly MD: "MD";
50
+ readonly LG: "LG";
51
+ readonly XL: "XL";
52
+ }> | undefined;
53
+ readonly flexShrink?: number | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | import("../../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("csstype").GlobalsNumber, {
54
+ readonly XS: "XS";
55
+ readonly SM: "SM";
56
+ readonly MD: "MD";
57
+ readonly LG: "LG";
58
+ readonly XL: "XL";
59
+ }> | undefined;
60
+ readonly flexWrap?: "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | "nowrap" | "wrap" | "wrap-reverse" | import("../../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("csstype").FlexWrapProperty, {
61
+ readonly XS: "XS";
62
+ readonly SM: "SM";
63
+ readonly MD: "MD";
64
+ readonly LG: "LG";
65
+ readonly XL: "XL";
66
+ }> | undefined;
67
+ readonly justifyContent?: string | import("../../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
68
+ readonly XS: "XS";
69
+ readonly SM: "SM";
70
+ readonly MD: "MD";
71
+ readonly LG: "LG";
72
+ readonly XL: "XL";
73
+ }> | undefined;
74
+ readonly justifyItems?: string | import("../../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
75
+ readonly XS: "XS";
76
+ readonly SM: "SM";
77
+ readonly MD: "MD";
78
+ readonly LG: "LG";
79
+ readonly XL: "XL";
80
+ }> | undefined;
81
+ readonly justifySelf?: string | import("../../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<string, {
82
+ readonly XS: "XS";
83
+ readonly SM: "SM";
84
+ readonly MD: "MD";
85
+ readonly LG: "LG";
86
+ readonly XL: "XL";
87
+ }> | undefined;
88
+ readonly order?: number | "-moz-initial" | "inherit" | "initial" | "revert" | "unset" | import("../../../utils/dynamicModifiers").DynamicResponsiveModifiersProp<import("csstype").GlobalsNumber, {
89
+ readonly XS: "XS";
90
+ readonly SM: "SM";
91
+ readonly MD: "MD";
92
+ readonly LG: "LG";
93
+ readonly XL: "XL";
94
+ }> | undefined;
95
+ readonly size?: "XS" | "SM" | "MD" | "LG" | "XL" | undefined;
96
+ }> & Partial<{
97
+ readonly margin: import("../../../utils/dynamicModifiers").DynamicModifiersProp<number, {
98
+ readonly XS: "XS";
99
+ readonly SM: "SM";
100
+ readonly MD: "MD";
101
+ readonly LG: "LG";
102
+ readonly XL: "XL";
103
+ }>;
104
+ readonly marginBottom: import("../../../utils/dynamicModifiers").DynamicModifiersProp<number, {
105
+ readonly XS: "XS";
106
+ readonly SM: "SM";
107
+ readonly MD: "MD";
108
+ readonly LG: "LG";
109
+ readonly XL: "XL";
110
+ }>;
111
+ readonly marginLeft: import("../../../utils/dynamicModifiers").DynamicModifiersProp<number, {
112
+ readonly XS: "XS";
113
+ readonly SM: "SM";
114
+ readonly MD: "MD";
115
+ readonly LG: "LG";
116
+ readonly XL: "XL";
117
+ }>;
118
+ readonly marginRight: import("../../../utils/dynamicModifiers").DynamicModifiersProp<number, {
119
+ readonly XS: "XS";
120
+ readonly SM: "SM";
121
+ readonly MD: "MD";
122
+ readonly LG: "LG";
123
+ readonly XL: "XL";
124
+ }>;
125
+ readonly marginTop: import("../../../utils/dynamicModifiers").DynamicModifiersProp<number, {
126
+ readonly XS: "XS";
127
+ readonly SM: "SM";
128
+ readonly MD: "MD";
129
+ readonly LG: "LG";
130
+ readonly XL: "XL";
131
+ }>;
132
+ readonly marginX: import("../../../utils/dynamicModifiers").DynamicModifiersProp<number, {
133
+ readonly XS: "XS";
134
+ readonly SM: "SM";
135
+ readonly MD: "MD";
136
+ readonly LG: "LG";
137
+ readonly XL: "XL";
138
+ }>;
139
+ readonly marginY: import("../../../utils/dynamicModifiers").DynamicModifiersProp<number, {
140
+ readonly XS: "XS";
141
+ readonly SM: "SM";
142
+ readonly MD: "MD";
143
+ readonly LG: "LG";
144
+ readonly XL: "XL";
145
+ }>;
146
+ readonly padding: import("../../../utils/dynamicModifiers").DynamicModifiersProp<number, {
147
+ readonly XS: "XS";
148
+ readonly SM: "SM";
149
+ readonly MD: "MD";
150
+ readonly LG: "LG";
151
+ readonly XL: "XL";
152
+ }>;
153
+ readonly paddingBottom: import("../../../utils/dynamicModifiers").DynamicModifiersProp<number, {
154
+ readonly XS: "XS";
155
+ readonly SM: "SM";
156
+ readonly MD: "MD";
157
+ readonly LG: "LG";
158
+ readonly XL: "XL";
159
+ }>;
160
+ readonly paddingLeft: import("../../../utils/dynamicModifiers").DynamicModifiersProp<number, {
161
+ readonly XS: "XS";
162
+ readonly SM: "SM";
163
+ readonly MD: "MD";
164
+ readonly LG: "LG";
165
+ readonly XL: "XL";
166
+ }>;
167
+ readonly paddingRight: import("../../../utils/dynamicModifiers").DynamicModifiersProp<number, {
168
+ readonly XS: "XS";
169
+ readonly SM: "SM";
170
+ readonly MD: "MD";
171
+ readonly LG: "LG";
172
+ readonly XL: "XL";
173
+ }>;
174
+ readonly paddingTop: import("../../../utils/dynamicModifiers").DynamicModifiersProp<number, {
175
+ readonly XS: "XS";
176
+ readonly SM: "SM";
177
+ readonly MD: "MD";
178
+ readonly LG: "LG";
179
+ readonly XL: "XL";
180
+ }>;
181
+ readonly paddingX: import("../../../utils/dynamicModifiers").DynamicModifiersProp<number, {
182
+ readonly XS: "XS";
183
+ readonly SM: "SM";
184
+ readonly MD: "MD";
185
+ readonly LG: "LG";
186
+ readonly XL: "XL";
187
+ }>;
188
+ readonly paddingY: import("../../../utils/dynamicModifiers").DynamicModifiersProp<number, {
189
+ readonly XS: "XS";
190
+ readonly SM: "SM";
191
+ readonly MD: "MD";
192
+ readonly LG: "LG";
193
+ readonly XL: "XL";
194
+ }>;
195
+ }> & Pick<FilterProps, "badgeColor">, never>;
196
+ export default IconWrapper;
197
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Filter/IconWrapper/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAgBvC,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4CAOhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
+
10
+ var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
11
+
12
+ var _spacing = _interopRequireDefault(require("@decisiv/design-tokens/lib/spacing"));
13
+
14
+ var _Flex = _interopRequireDefault(require("../../Flex"));
15
+
16
+ var _color = _interopRequireDefault(require("../../../modifiers/color"));
17
+
18
+ var _utils = require("../../../utils");
19
+
20
+ var _commonUIColors = require("../../../utils/commonUIColors");
21
+
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
+
24
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
25
+
26
+ var colorModifiers = (0, _utils.applyDynamicModifiers)('badgeColor', function (_ref) {
27
+ var badgeColor = _ref.badgeColor;
28
+ return (0, _styledComponents.css)(["", ";"], badgeColor && badgeColor in _commonUIColors.commonUIColors && (0, _color.default)(_commonUIColors.commonUIColors[badgeColor]));
29
+ });
30
+ var IconWrapper = (0, _styledComponents.default)(_Flex.default).withConfig({
31
+ displayName: "IconWrapper",
32
+ componentId: "sc-1e8ws53-0"
33
+ })(["width:", ";height:", ";padding:", ";border-radius:2px;", ";", ";"], (0, _rem.default)(_spacing.default.base * 2), (0, _rem.default)(_spacing.default.base * 2), (0, _rem.default)(_spacing.default.base * 0.4), (0, _color.default)(_commonUIColors.commonUIColors.information), colorModifiers);
34
+ var _default = IconWrapper;
35
+ exports.default = _default;