draft-components 1.6.0 → 1.7.1

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 (174) hide show
  1. package/cjs/components/dialog/dialog.cjs +1 -1
  2. package/cjs/components/filtered-search/filter-item.cjs +23 -0
  3. package/cjs/components/filtered-search/filter-operator-select.cjs +17 -0
  4. package/cjs/components/filtered-search/filter-token.cjs +17 -0
  5. package/cjs/components/filtered-search/filter-value-list.cjs +20 -0
  6. package/cjs/components/filtered-search/filtered-search.cjs +202 -0
  7. package/cjs/components/filtered-search/icons.cjs +21 -0
  8. package/cjs/components/filtered-search/model/abstract-filter.cjs +6 -0
  9. package/cjs/components/filtered-search/model/string-filter.cjs +46 -0
  10. package/cjs/components/filtered-search/model/string-set-filter.cjs +44 -0
  11. package/cjs/components/filtered-search/string-filter-input.cjs +17 -0
  12. package/cjs/components/filtered-search/string-filter-item.cjs +68 -0
  13. package/cjs/components/filtered-search/string-set-filter-item.cjs +77 -0
  14. package/cjs/components/filtered-search/use-combobox-ids.cjs +17 -0
  15. package/cjs/components/filtered-search/use-translations.cjs +24 -0
  16. package/cjs/components/index.cjs +12 -0
  17. package/cjs/components/popover/popover.cjs +3 -4
  18. package/cjs/components/slide-over/slide-over-body.cjs +10 -0
  19. package/cjs/components/slide-over/slide-over-context.cjs +24 -0
  20. package/cjs/components/slide-over/slide-over-header.cjs +21 -0
  21. package/cjs/components/slide-over/slide-over.cjs +106 -0
  22. package/cjs/hooks/index.cjs +2 -2
  23. package/cjs/hooks/use-disable-body-scroll.cjs +3 -1
  24. package/cjs/hooks/use-esc-key-down.cjs +3 -1
  25. package/cjs/hooks/use-focus-trap.cjs +3 -1
  26. package/cjs/index.cjs +16 -2
  27. package/cjs/lib/helpers.cjs +5 -1
  28. package/cjs/lib/index.cjs +2 -0
  29. package/cjs/lib/keyboard-keys.cjs +1 -0
  30. package/cjs/lib/react-helpers.cjs +8 -0
  31. package/css/draft-components.css +345 -2
  32. package/css/draft-components.dark.css +65 -40
  33. package/esm/components/dialog/dialog.js +1 -1
  34. package/esm/components/filtered-search/filter-item.js +21 -0
  35. package/esm/components/filtered-search/filter-operator-select.js +15 -0
  36. package/esm/components/filtered-search/filter-token.js +15 -0
  37. package/esm/components/filtered-search/filter-value-list.js +18 -0
  38. package/esm/components/filtered-search/filtered-search.js +200 -0
  39. package/esm/components/filtered-search/icons.js +16 -0
  40. package/esm/components/filtered-search/model/abstract-filter.js +4 -0
  41. package/esm/components/filtered-search/model/string-filter.js +44 -0
  42. package/esm/components/filtered-search/model/string-set-filter.js +42 -0
  43. package/esm/components/filtered-search/string-filter-input.js +15 -0
  44. package/esm/components/filtered-search/string-filter-item.js +66 -0
  45. package/esm/components/filtered-search/string-set-filter-item.js +75 -0
  46. package/esm/components/filtered-search/use-combobox-ids.js +15 -0
  47. package/esm/components/filtered-search/use-translations.js +21 -0
  48. package/esm/components/index.js +6 -0
  49. package/esm/components/popover/popover.js +3 -4
  50. package/esm/components/slide-over/slide-over-body.js +8 -0
  51. package/esm/components/slide-over/slide-over-context.js +21 -0
  52. package/esm/components/slide-over/slide-over-header.js +19 -0
  53. package/esm/components/slide-over/slide-over.js +104 -0
  54. package/esm/hooks/index.js +1 -1
  55. package/esm/hooks/use-disable-body-scroll.js +3 -1
  56. package/esm/hooks/use-esc-key-down.js +3 -1
  57. package/esm/hooks/use-focus-trap.js +3 -1
  58. package/esm/index.js +9 -3
  59. package/esm/lib/helpers.js +5 -2
  60. package/esm/lib/index.js +2 -2
  61. package/esm/lib/keyboard-keys.js +1 -0
  62. package/esm/lib/react-helpers.js +8 -1
  63. package/package.json +30 -30
  64. package/types/components/alert/alert.d.ts +1 -1
  65. package/types/components/avatar/avatar.d.ts +1 -1
  66. package/types/components/avatar-group/avatar-group.d.ts +1 -1
  67. package/types/components/badge/badge.d.ts +1 -1
  68. package/types/components/breadcrumbs/breadcrumbs-context.d.ts +1 -1
  69. package/types/components/breadcrumbs/breadcrumbs-item.d.ts +1 -1
  70. package/types/components/breadcrumbs/breadcrumbs.d.ts +1 -1
  71. package/types/components/button/button.d.ts +1 -1
  72. package/types/components/button/icon-button.d.ts +2 -2
  73. package/types/components/button-group/button-group.d.ts +1 -1
  74. package/types/components/caption/caption.d.ts +1 -1
  75. package/types/components/caption/icons.d.ts +1 -1
  76. package/types/components/checkbox/checkbox.d.ts +1 -1
  77. package/types/components/color-picker/color-picker-button.d.ts +1 -1
  78. package/types/components/color-picker/color-picker.d.ts +1 -1
  79. package/types/components/date-picker/calendar-day.d.ts +1 -1
  80. package/types/components/date-picker/calendar-grid-head.d.ts +1 -1
  81. package/types/components/date-picker/calendar-grid.d.ts +1 -1
  82. package/types/components/date-picker/calendar.d.ts +3 -3
  83. package/types/components/date-picker/date-picker.d.ts +3 -3
  84. package/types/components/date-picker/date-range-picker.d.ts +4 -4
  85. package/types/components/date-picker/date-range.d.ts +1 -1
  86. package/types/components/date-picker/icons.d.ts +1 -1
  87. package/types/components/date-picker-popover/date-picker-popover.d.ts +3 -3
  88. package/types/components/date-range-picker-popover/date-range-picker-popover-footer.d.ts +1 -1
  89. package/types/components/date-range-picker-popover/date-range-picker-popover-presets.d.ts +1 -1
  90. package/types/components/date-range-picker-popover/date-range-picker-popover.d.ts +4 -4
  91. package/types/components/date-range-picker-popover/types.d.ts +1 -1
  92. package/types/components/dialog/dialog-body.d.ts +1 -1
  93. package/types/components/dialog/dialog-context.d.ts +1 -1
  94. package/types/components/dialog/dialog-footer.d.ts +1 -1
  95. package/types/components/dialog/dialog-header.d.ts +1 -1
  96. package/types/components/dialog/dialog.d.ts +1 -1
  97. package/types/components/dialog/x-mark-icon.d.ts +1 -1
  98. package/types/components/empty-state/empty-state.d.ts +1 -1
  99. package/types/components/filter-buttons/filter-button.d.ts +1 -1
  100. package/types/components/filter-buttons/filter-buttons.d.ts +1 -1
  101. package/types/components/filtered-search/filter-item.d.ts +10 -0
  102. package/types/components/filtered-search/filter-operator-select.d.ts +10 -0
  103. package/types/components/filtered-search/filter-token.d.ts +9 -0
  104. package/types/components/filtered-search/filter-value-list.d.ts +8 -0
  105. package/types/components/filtered-search/filtered-search.d.ts +15 -0
  106. package/types/components/filtered-search/icons.d.ts +5 -0
  107. package/types/components/filtered-search/index.d.ts +4 -0
  108. package/types/components/filtered-search/model/abstract-filter.d.ts +6 -0
  109. package/types/components/filtered-search/model/string-filter.d.ts +47 -0
  110. package/types/components/filtered-search/model/string-set-filter.d.ts +41 -0
  111. package/types/components/filtered-search/model/validation-result.d.ts +6 -0
  112. package/types/components/filtered-search/string-filter-input.d.ts +9 -0
  113. package/types/components/filtered-search/string-filter-item.d.ts +13 -0
  114. package/types/components/filtered-search/string-set-filter-item.d.ts +15 -0
  115. package/types/components/filtered-search/types.d.ts +4 -0
  116. package/types/components/filtered-search/use-combobox-ids.d.ts +5 -0
  117. package/types/components/filtered-search/use-translations.d.ts +13 -0
  118. package/types/components/form-field/form-field.d.ts +1 -1
  119. package/types/components/index.d.ts +2 -0
  120. package/types/components/label/label.d.ts +1 -1
  121. package/types/components/menu/menu-item.d.ts +1 -1
  122. package/types/components/menu/menu-separator.d.ts +1 -1
  123. package/types/components/menu/menu.d.ts +3 -3
  124. package/types/components/nav-list/nav-list-item.d.ts +1 -1
  125. package/types/components/nav-list/nav-list-title.d.ts +1 -1
  126. package/types/components/nav-list/nav-list.d.ts +1 -1
  127. package/types/components/password-input/icons.d.ts +1 -1
  128. package/types/components/password-input/password-input.d.ts +1 -1
  129. package/types/components/popover/popover.d.ts +3 -1
  130. package/types/components/portal/portal-context.d.ts +1 -1
  131. package/types/components/portal/portal.d.ts +1 -1
  132. package/types/components/positioner/calc-position.d.ts +1 -1
  133. package/types/components/positioner/positioner.d.ts +2 -2
  134. package/types/components/radio/radio.d.ts +1 -1
  135. package/types/components/segmented-control/segmented-control-button.d.ts +1 -1
  136. package/types/components/segmented-control/segmented-control.d.ts +1 -1
  137. package/types/components/select/select.d.ts +1 -1
  138. package/types/components/selection-control/selection-control.d.ts +1 -1
  139. package/types/components/slide-over/index.d.ts +4 -0
  140. package/types/components/slide-over/slide-over-body.d.ts +3 -0
  141. package/types/components/slide-over/slide-over-context.d.ts +14 -0
  142. package/types/components/slide-over/slide-over-header.d.ts +11 -0
  143. package/types/components/slide-over/slide-over.d.ts +15 -0
  144. package/types/components/slide-over/types.d.ts +1 -0
  145. package/types/components/slider/slider-tick-marks.d.ts +1 -1
  146. package/types/components/slider/slider.d.ts +2 -2
  147. package/types/components/spinner/spinner.d.ts +1 -1
  148. package/types/components/switch/switch.d.ts +1 -1
  149. package/types/components/table/table-body.d.ts +1 -1
  150. package/types/components/table/table-cell.d.ts +1 -1
  151. package/types/components/table/table-container.d.ts +1 -1
  152. package/types/components/table/table-head-cell.d.ts +1 -1
  153. package/types/components/table/table-head.d.ts +1 -1
  154. package/types/components/table/table-row.d.ts +1 -1
  155. package/types/components/table/table.d.ts +1 -1
  156. package/types/components/tabs/tab-list.d.ts +1 -1
  157. package/types/components/tabs/tab-panel.d.ts +2 -2
  158. package/types/components/tabs/tab.d.ts +1 -1
  159. package/types/components/tabs/tabs-context.d.ts +2 -2
  160. package/types/components/tabs/tabs.d.ts +2 -2
  161. package/types/components/tag/tag.d.ts +1 -1
  162. package/types/components/text-input/text-input.d.ts +1 -1
  163. package/types/components/textarea/textarea.d.ts +1 -1
  164. package/types/components/toast/toast-button.d.ts +1 -1
  165. package/types/components/toast/toast.d.ts +1 -1
  166. package/types/components/toaster/toaster.d.ts +1 -1
  167. package/types/components/tooltip/tooltip.d.ts +2 -2
  168. package/types/hooks/index.d.ts +1 -1
  169. package/types/hooks/use-disable-body-scroll.d.ts +1 -1
  170. package/types/hooks/use-esc-key-down.d.ts +1 -1
  171. package/types/hooks/use-focus-trap.d.ts +2 -2
  172. package/types/lib/helpers.d.ts +1 -0
  173. package/types/lib/keyboard-keys.d.ts +1 -0
  174. package/types/lib/react-helpers.d.ts +2 -1
@@ -0,0 +1,104 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { useId, useRef, useCallback, useMemo, useEffect } from 'react';
3
+ import { SlideOverContextProvider } from './slide-over-context.js';
4
+ import { getRefElement, classNames } from '../../lib/react-helpers.js';
5
+ import { useDisableBodyScroll } from '../../hooks/use-disable-body-scroll.js';
6
+ import { useEscKeyDown } from '../../hooks/use-esc-key-down.js';
7
+ import { useFocusTrap } from '../../hooks/use-focus-trap.js';
8
+ import { Portal } from '../portal/portal.js';
9
+ import { SlideOverHeader } from './slide-over-header.js';
10
+ import { SlideOverBody } from './slide-over-body.js';
11
+
12
+ const panelSlideIn = [
13
+ { transform: 'translateX(100%)' },
14
+ { transform: 'translateX(0%)' },
15
+ ];
16
+ const backdropFade = [
17
+ { opacity: 0 },
18
+ { opacity: 1 },
19
+ ];
20
+ function SlideOver({ 'aria-labelledby': ariaLabelledby, 'aria-describedby': ariaDescribedby, animationDurationMs = 350, animationDisabled = false, className, children, onClose, ...props }) {
21
+ const id = useId();
22
+ const titleId = ariaLabelledby || `${id}dialogTitle`;
23
+ const descriptionId = ariaDescribedby || `${id}dialogDescription`;
24
+ const backdropRef = useRef(null);
25
+ const panelRef = useRef(null);
26
+ const isAnimationDisabled = useRef(animationDisabled);
27
+ const shouldPlayAnimations = useCallback(() => {
28
+ const mediaQueryList = window.matchMedia('(prefers-reduced-motion)');
29
+ return !isAnimationDisabled.current && !mediaQueryList.matches;
30
+ }, []);
31
+ const closePanel = useMemo(() => {
32
+ let isClosing = false;
33
+ return (source) => {
34
+ if (isClosing) {
35
+ return;
36
+ }
37
+ if (!shouldPlayAnimations()) {
38
+ onClose(source);
39
+ }
40
+ isClosing = true;
41
+ const backdrop = getRefElement(backdropRef);
42
+ const backdropAnimations = backdrop.getAnimations();
43
+ if (backdropAnimations.length === 0) {
44
+ backdropAnimations.push(backdrop.animate(backdropFade, {
45
+ direction: 'reverse',
46
+ fill: 'both',
47
+ easing: 'ease-in-out',
48
+ duration: animationDurationMs,
49
+ }));
50
+ }
51
+ else {
52
+ backdropAnimations.forEach((animation) => animation.reverse());
53
+ }
54
+ const panel = getRefElement(panelRef);
55
+ const panelAnimations = panel.getAnimations();
56
+ if (panelAnimations.length === 0) {
57
+ backdropAnimations.push(panel.animate(panelSlideIn, {
58
+ direction: 'reverse',
59
+ fill: 'both',
60
+ easing: 'ease-in-out',
61
+ duration: animationDurationMs,
62
+ }));
63
+ }
64
+ else {
65
+ panelAnimations.forEach((animation) => animation.reverse());
66
+ }
67
+ const animations = [...backdropAnimations, ...panelAnimations];
68
+ Promise.all(animations.map((animation) => animation.finished)).then(() => {
69
+ onClose(source);
70
+ isClosing = false;
71
+ });
72
+ };
73
+ }, [animationDurationMs, onClose, shouldPlayAnimations]);
74
+ useEffect(() => {
75
+ isAnimationDisabled.current = animationDisabled;
76
+ }, [animationDisabled]);
77
+ useEffect(() => {
78
+ if (shouldPlayAnimations()) {
79
+ const backdrop = getRefElement(backdropRef);
80
+ backdrop.animate(backdropFade, {
81
+ fill: 'both',
82
+ easing: 'ease-in-out',
83
+ duration: animationDurationMs,
84
+ });
85
+ const panel = getRefElement(panelRef);
86
+ panel.animate(panelSlideIn, {
87
+ fill: 'both',
88
+ easing: 'ease-in-out',
89
+ duration: animationDurationMs,
90
+ });
91
+ }
92
+ }, [shouldPlayAnimations, animationDurationMs]);
93
+ useEscKeyDown(() => closePanel('escape'));
94
+ useFocusTrap(panelRef);
95
+ useDisableBodyScroll();
96
+ const onClickBackdrop = () => {
97
+ closePanel('backdrop');
98
+ };
99
+ return (jsx(Portal, { children: jsxs("div", { className: "dc-slide-over", children: [jsx("div", { "data-testid": "slide-over-backdrop", className: "dc-slide-over__backdrop", ref: backdropRef, onClick: onClickBackdrop }), jsx("div", { ...props, className: classNames('dc-slide-over__panel', className), role: "dialog", ref: panelRef, "aria-modal": true, "aria-labelledby": titleId, "aria-describedby": descriptionId, children: jsx(SlideOverContextProvider, { titleId: titleId, descriptionId: descriptionId, closePanel: closePanel, children: children }) })] }) }));
100
+ }
101
+ SlideOver.Header = SlideOverHeader;
102
+ SlideOver.Body = SlideOverBody;
103
+
104
+ export { SlideOver };
@@ -1,4 +1,4 @@
1
- export { useMountTransition } from './use-mount-transition.js';
2
1
  export { useDisableBodyScroll } from './use-disable-body-scroll.js';
3
2
  export { useEscKeyDown } from './use-esc-key-down.js';
4
3
  export { useFocusTrap } from './use-focus-trap.js';
4
+ export { useMountTransition } from './use-mount-transition.js';
@@ -1,7 +1,9 @@
1
1
  import { useEffect } from 'react';
2
2
  import { once } from '../lib/helpers.js';
3
3
 
4
- function useDisableBodyScroll(options) {
4
+ function useDisableBodyScroll(options = {
5
+ isEnabled: true,
6
+ }) {
5
7
  useEffect(() => {
6
8
  if (options.isEnabled) {
7
9
  return disableBodyScroll();
@@ -13,7 +13,9 @@ const handlers = [];
13
13
  * @param options.isEnabled A flag that determines whether to run
14
14
  * the passed handler or not.
15
15
  */
16
- function useEscKeyDown(handler, options) {
16
+ function useEscKeyDown(handler, options = {
17
+ isEnabled: true,
18
+ }) {
17
19
  const handlerRef = useRef(handler);
18
20
  const isEnabled = options.isEnabled;
19
21
  useEffect(() => {
@@ -24,7 +24,9 @@ const focusableElementsSelector = [
24
24
  * @param {boolean} options.isEnabled - A flag that determines whether
25
25
  * to trap focus or not.
26
26
  */
27
- function useFocusTrap(modalRef, options) {
27
+ function useFocusTrap(modalRef, options = {
28
+ isEnabled: true,
29
+ }) {
28
30
  const isEnabled = options.isEnabled;
29
31
  useEffect(() => {
30
32
  if (!isEnabled) {
package/esm/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  export { KeyboardKeys } from './lib/keyboard-keys.js';
2
- export { assertIfNullable, once } from './lib/helpers.js';
3
- export { classNames, focusElement, isReactElementWithRef, mergeRefs } from './lib/react-helpers.js';
4
- export { useMountTransition } from './hooks/use-mount-transition.js';
2
+ export { assertIfNullable, exhaustiveCheck, once } from './lib/helpers.js';
3
+ export { classNames, focusElement, getRefElement, isReactElementWithRef, mergeRefs } from './lib/react-helpers.js';
5
4
  export { useDisableBodyScroll } from './hooks/use-disable-body-scroll.js';
6
5
  export { useEscKeyDown } from './hooks/use-esc-key-down.js';
7
6
  export { useFocusTrap } from './hooks/use-focus-trap.js';
7
+ export { useMountTransition } from './hooks/use-mount-transition.js';
8
8
  export { Alert } from './components/alert/alert.js';
9
9
  export { Avatar } from './components/avatar/avatar.js';
10
10
  export { AvatarGroup } from './components/avatar-group/avatar-group.js';
@@ -29,6 +29,9 @@ export { EmptyState } from './components/empty-state/empty-state.js';
29
29
  export { FilePicker } from './components/file-picker/file-picker.js';
30
30
  export { FilterButtons } from './components/filter-buttons/filter-buttons.js';
31
31
  export { FilterButton } from './components/filter-buttons/filter-button.js';
32
+ export { StringFilter } from './components/filtered-search/model/string-filter.js';
33
+ export { StringSetFilter } from './components/filtered-search/model/string-set-filter.js';
34
+ export { FilteredSearch } from './components/filtered-search/filtered-search.js';
32
35
  export { FormField } from './components/form-field/form-field.js';
33
36
  export { Label } from './components/label/label.js';
34
37
  export { Menu } from './components/menu/menu.js';
@@ -45,6 +48,9 @@ export { Radio } from './components/radio/radio.js';
45
48
  export { SegmentedControl } from './components/segmented-control/segmented-control.js';
46
49
  export { Select } from './components/select/select.js';
47
50
  export { SelectionControl } from './components/selection-control/selection-control.js';
51
+ export { SlideOver } from './components/slide-over/slide-over.js';
52
+ export { SlideOverHeader } from './components/slide-over/slide-over-header.js';
53
+ export { SlideOverBody } from './components/slide-over/slide-over-body.js';
48
54
  export { Slider } from './components/slider/slider.js';
49
55
  export { SliderTickMarks } from './components/slider/slider-tick-marks.js';
50
56
  export { Spinner } from './components/spinner/spinner.js';
@@ -9,10 +9,13 @@ function once(fn) {
9
9
  return result;
10
10
  };
11
11
  }
12
- function assertIfNullable(value, message = 'value is null or undefined') {
12
+ function exhaustiveCheck(value, message) {
13
+ throw new Error(message);
14
+ }
15
+ function assertIfNullable(value, message = 'assertIfNullable: value is null or undefined.') {
13
16
  if (value == null) {
14
17
  throw Error(message);
15
18
  }
16
19
  }
17
20
 
18
- export { assertIfNullable, once };
21
+ export { assertIfNullable, exhaustiveCheck, once };
package/esm/lib/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export { KeyboardKeys } from './keyboard-keys.js';
2
- export { assertIfNullable, once } from './helpers.js';
3
- export { classNames, focusElement, isReactElementWithRef, mergeRefs } from './react-helpers.js';
2
+ export { assertIfNullable, exhaustiveCheck, once } from './helpers.js';
3
+ export { classNames, focusElement, getRefElement, isReactElementWithRef, mergeRefs } from './react-helpers.js';
@@ -10,6 +10,7 @@ const KeyboardKeys = {
10
10
  PageDown: 'PageDown',
11
11
  Enter: 'Enter',
12
12
  Escape: 'Escape',
13
+ Backspace: 'Backspace',
13
14
  Space: ' ',
14
15
  };
15
16
 
@@ -41,5 +41,12 @@ function focusElement(element) {
41
41
  element.focus();
42
42
  }
43
43
  }
44
+ function getRefElement(ref, message = 'getElementFromRef: ref value is null.') {
45
+ const value = ref.current;
46
+ if (value == null) {
47
+ throw new Error(message);
48
+ }
49
+ return value;
50
+ }
44
51
 
45
- export { classNames, focusElement, isReactElementWithRef, mergeRefs };
52
+ export { classNames, focusElement, getRefElement, isReactElementWithRef, mergeRefs };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "draft-components",
3
- "version": "1.6.0",
3
+ "version": "1.7.1",
4
4
  "description": "The React based UI components library.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -56,50 +56,50 @@
56
56
  "react-dom": ">= 18"
57
57
  },
58
58
  "devDependencies": {
59
- "@alexzimakov/eslint-config": "1.5.0",
60
- "@babel/core": "7.22.5",
61
- "@babel/preset-env": "7.22.5",
59
+ "@alexzimakov/eslint-config": "1.6.0",
60
+ "@babel/core": "7.22.9",
61
+ "@babel/preset-env": "7.22.9",
62
62
  "@babel/preset-react": "7.22.5",
63
63
  "@babel/preset-typescript": "7.22.5",
64
64
  "@heroicons/react": "2.0.18",
65
- "@rollup/plugin-typescript": "11.1.1",
66
- "@storybook/addon-actions": "7.0.23",
67
- "@storybook/addon-essentials": "7.0.23",
68
- "@storybook/addon-links": "7.0.23",
69
- "@storybook/react": "7.0.23",
70
- "@storybook/react-vite": "7.0.23",
65
+ "@rollup/plugin-typescript": "11.1.2",
66
+ "@storybook/addon-actions": "7.1.1",
67
+ "@storybook/addon-essentials": "7.1.1",
68
+ "@storybook/addon-links": "7.1.1",
69
+ "@storybook/react": "7.1.1",
70
+ "@storybook/react-vite": "7.1.1",
71
71
  "@testing-library/dom": "9.3.1",
72
- "@testing-library/jest-dom": "5.16.5",
72
+ "@testing-library/jest-dom": "5.17.0",
73
73
  "@testing-library/react": "14.0.0",
74
74
  "@testing-library/user-event": "14.4.3",
75
- "@types/jest": "29.5.2",
76
- "@types/node": "18.16.18",
77
- "@types/react": "18.2.13",
78
- "@types/react-dom": "18.2.6",
79
- "@typescript-eslint/eslint-plugin": "5.60.0",
80
- "@typescript-eslint/parser": "5.60.0",
75
+ "@types/jest": "29.5.3",
76
+ "@types/node": "18.17.0",
77
+ "@types/react": "18.2.16",
78
+ "@types/react-dom": "18.2.7",
79
+ "@typescript-eslint/eslint-plugin": "6.2.0",
80
+ "@typescript-eslint/parser": "6.2.0",
81
81
  "autoprefixer": "10.4.14",
82
- "eslint": "8.43.0",
82
+ "eslint": "8.45.0",
83
83
  "eslint-plugin-jsx-a11y": "6.7.1",
84
- "eslint-plugin-react": "7.32.2",
84
+ "eslint-plugin-react": "7.33.0",
85
85
  "eslint-plugin-react-hooks": "4.6.0",
86
- "eslint-plugin-storybook": "0.6.12",
86
+ "eslint-plugin-storybook": "0.6.13",
87
87
  "eslint-plugin-testing-library": "5.11.0",
88
88
  "husky": "8.0.3",
89
- "jest": "29.5.0",
90
- "jest-environment-jsdom": "29.5.0",
91
- "lint-staged": "13.2.2",
92
- "postcss": "8.4.24",
89
+ "jest": "29.6.1",
90
+ "jest-environment-jsdom": "29.6.1",
91
+ "lint-staged": "13.2.3",
92
+ "postcss": "8.4.27",
93
93
  "postcss-import": "15.1.0",
94
94
  "react": "18.2.0",
95
95
  "react-dom": "18.2.0",
96
- "rollup": "3.25.1",
97
- "storybook": "7.0.23",
98
- "stylelint": "15.8.0",
99
- "stylelint-config-standard": "33.0.0",
96
+ "rollup": "3.26.3",
97
+ "storybook": "7.1.1",
98
+ "stylelint": "15.10.2",
99
+ "stylelint-config-standard": "34.0.0",
100
100
  "stylelint-order": "6.0.3",
101
- "typescript": "5.1.3",
102
- "vite": "4.3.9"
101
+ "typescript": "5.1.6",
102
+ "vite": "4.4.7"
103
103
  },
104
104
  "lint-staged": {
105
105
  "*.ts?(x)": "npm run lint",
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithRef, type JSX, type ReactNode } from 'react';
1
+ import { ComponentPropsWithRef, JSX, ReactNode } from 'react';
2
2
  type AlertHTMLProps = ComponentPropsWithRef<'div'>;
3
3
  export type AlertAppearance = 'default' | 'info' | 'success' | 'warning' | 'error';
4
4
  export type AlertVariant = 'default' | 'full-width' | 'accent-border';
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithRef, type ReactNode } from 'react';
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
2
  export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
3
3
  export type AvatarFill = 'gray' | 'pink' | 'red' | 'orange' | 'yellow' | 'green' | 'blue' | 'violet';
4
4
  export type AvatarProps = ComponentPropsWithRef<'div'> & {
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithoutRef, type JSX } from 'react';
1
+ import { ComponentPropsWithoutRef, JSX } from 'react';
2
2
  type AvatarGroupBaseProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'>;
3
3
  export type AvatarGroupProps = AvatarGroupBaseProps & {
4
4
  children: JSX.Element | JSX.Element[];
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithoutRef } from 'react';
2
2
  type BadgeHTMLProps = ComponentPropsWithoutRef<'span'>;
3
3
  type BadgeBaseProps = Omit<BadgeHTMLProps, 'children'>;
4
4
  export type BadgeProps = {
@@ -1,4 +1,4 @@
1
- import { type ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  export type BreadcrumbsContextValue = {
3
3
  separator: ReactNode;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithoutRef, type JSX, type ReactNode } from 'react';
1
+ import { ComponentPropsWithoutRef, JSX, ReactNode } from 'react';
2
2
  type BreadcrumbsItemHTMLProps = ComponentPropsWithoutRef<'a'>;
3
3
  export type BreadcrumbsItemRenderFn = (props: {
4
4
  className: string;
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
  type BreadcrumbsHTMLProps = ComponentPropsWithoutRef<'nav'>;
3
3
  export type BreadcrumbsProps = {
4
4
  separator?: ReactNode;
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithRef, type JSX, type ReactNode } from 'react';
1
+ import { ComponentPropsWithRef, JSX, ReactNode } from 'react';
2
2
  export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
3
3
  export type ButtonAppearance = 'default' | 'primary' | 'danger' | 'success';
4
4
  export type ButtonVariant = 'filled' | 'tinted' | 'plain';
@@ -1,5 +1,5 @@
1
- import { type ReactNode } from 'react';
2
- import { type ButtonProps } from './button';
1
+ import { ReactNode } from 'react';
2
+ import { ButtonProps } from './button';
3
3
  export type IconButtonBaseProps = Omit<ButtonProps, 'children' | 'caption' | 'leftIcon' | 'rightIcon'>;
4
4
  export type IconButtonProps = {
5
5
  icon: ReactNode;
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithoutRef, type JSX } from 'react';
1
+ import { ComponentPropsWithoutRef, JSX } from 'react';
2
2
  type ButtonGroupBaseProps = Omit<ComponentPropsWithoutRef<'div'>, 'children'>;
3
3
  export type ButtonGroupProps = ButtonGroupBaseProps & {
4
4
  children: JSX.Element | JSX.Element[];
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithRef } from 'react';
1
+ import { ComponentPropsWithRef } from 'react';
2
2
  export type CaptionAppearance = 'default' | 'info' | 'success' | 'error' | 'warning';
3
3
  export type CaptionProps = ComponentPropsWithRef<'div'> & {
4
4
  showIcon?: boolean;
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithoutRef } from 'react';
2
2
  export declare function InfoIcon(props: ComponentPropsWithoutRef<'svg'>): import("react/jsx-runtime").JSX.Element;
3
3
  export declare function SuccessIcon(props: ComponentPropsWithoutRef<'svg'>): import("react/jsx-runtime").JSX.Element;
4
4
  export declare function ErrorIcon(props: ComponentPropsWithoutRef<'svg'>): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithRef } from 'react';
1
+ import { ComponentPropsWithRef } from 'react';
2
2
  type CheckboxHTMLProps = ComponentPropsWithRef<'input'>;
3
3
  type CheckboxBaseProps = Omit<CheckboxHTMLProps, 'type'>;
4
4
  export type CheckboxToggleHandler = (checked: boolean) => void;
@@ -1,4 +1,4 @@
1
- import { type CSSProperties, type ChangeEventHandler, type ReactNode } from 'react';
1
+ import { CSSProperties, ChangeEventHandler, ReactNode } from 'react';
2
2
  export type ColorPickerButtonProps<T extends string | number> = {
3
3
  style?: CSSProperties;
4
4
  className?: string;
@@ -1,4 +1,4 @@
1
- import { type ChangeEventHandler, type ComponentPropsWithoutRef, type ReactNode } from 'react';
1
+ import { ChangeEventHandler, ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
  export type ColorPickerOption<T extends string | number> = {
3
3
  value: T;
4
4
  color: string;
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithoutRef } from 'react';
2
2
  type CalendarDayHTMLProps = ComponentPropsWithoutRef<'button'>;
3
3
  export type CalendarDayProps = {
4
4
  date: Date;
@@ -1,4 +1,4 @@
1
- import { type Weekday } from './date-helpers';
1
+ import { Weekday } from './date-helpers';
2
2
  export type CalendarGridHeadProps = {
3
3
  locale?: string;
4
4
  weekStartsOn?: Weekday;
@@ -1,5 +1,5 @@
1
1
  import { type Weekday } from './date-helpers';
2
- import { type CalendarDayProps } from './calendar-day';
2
+ import { CalendarDayProps } from './calendar-day';
3
3
  export type GetCalendarDayProps = (date: Date) => Pick<CalendarDayProps, 'isSelected' | 'inRange' | 'isRangeStart' | 'isRangeEnd'>;
4
4
  export type CalendarGridProps = {
5
5
  focusDay: Date;
@@ -1,6 +1,6 @@
1
- import { type Weekday } from './date-helpers';
2
- import { type CalendarHeaderProps } from './calendar-header';
3
- import { type CalendarGridProps } from './calendar-grid';
1
+ import { Weekday } from './date-helpers';
2
+ import { CalendarHeaderProps } from './calendar-header';
3
+ import { CalendarGridProps } from './calendar-grid';
4
4
  export type CalendarProps = {
5
5
  className?: string;
6
6
  defaultFocusDay?: Date | null;
@@ -1,6 +1,6 @@
1
- import { type DateISO, type Weekday } from './date-helpers';
2
- import { type ComponentPropsWithoutRef } from 'react';
3
- import { type CalendarProps } from './calendar';
1
+ import { DateISO, Weekday } from './date-helpers';
2
+ import { ComponentPropsWithoutRef } from 'react';
3
+ import { CalendarProps } from './calendar';
4
4
  type DatePickerHTMLProps = ComponentPropsWithoutRef<'div'>;
5
5
  export type DatePickerProps = {
6
6
  value: DateISO | null;
@@ -1,7 +1,7 @@
1
- import { type DateISORange } from './date-range';
2
- import { type DateISO, type Weekday } from './date-helpers';
3
- import { type ComponentPropsWithoutRef } from 'react';
4
- import { type CalendarProps } from './calendar';
1
+ import { DateISORange } from './date-range';
2
+ import { DateISO, Weekday } from './date-helpers';
3
+ import { ComponentPropsWithoutRef } from 'react';
4
+ import { CalendarProps } from './calendar';
5
5
  type DateRangePickerHTMLProps = ComponentPropsWithoutRef<'div'>;
6
6
  export type DateRangePickerProps = {
7
7
  value: DateISORange | null;
@@ -1,4 +1,4 @@
1
- import { type DateISO } from './date-helpers';
1
+ import { DateISO } from './date-helpers';
2
2
  export type DateISORange = {
3
3
  start: DateISO;
4
4
  end: DateISO;
@@ -1,3 +1,3 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithoutRef } from 'react';
2
2
  export declare function ChevronLeftIcon(props: ComponentPropsWithoutRef<'svg'>): import("react/jsx-runtime").JSX.Element;
3
3
  export declare function ChevronRightIcon(props: ComponentPropsWithoutRef<'svg'>): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
- import { type DateISO } from '../date-picker/date-helpers';
2
- import { type JSX, type ReactNode } from 'react';
3
- import { type DatePickerProps } from '../date-picker';
1
+ import { DateISO } from '../date-picker/date-helpers';
2
+ import { JSX, ReactNode } from 'react';
3
+ import { DatePickerProps } from '../date-picker';
4
4
  export type DatePickerChangeValueFn = (value: DateISO) => void;
5
5
  export type DatePickerPopoverProps = {
6
6
  className?: string;
@@ -1,4 +1,4 @@
1
- import { type MouseEventHandler, type ReactNode } from 'react';
1
+ import { MouseEventHandler, ReactNode } from 'react';
2
2
  export type DateRangePickerPopoverFooterProps = {
3
3
  children?: ReactNode;
4
4
  cancelButtonLabel: ReactNode;
@@ -1,4 +1,4 @@
1
- import { type DateRangePickerPopoverOption, type DateRangePickerPopoverSelection } from './types';
1
+ import { DateRangePickerPopoverOption, DateRangePickerPopoverSelection } from './types';
2
2
  export type DateRangePickerPopoverPresetsProps = {
3
3
  isCompactView: boolean;
4
4
  customPresetLabel: string;
@@ -1,7 +1,7 @@
1
- import { type DateRangePickerPopoverOption, type DateRangePickerPopoverSelection } from './types';
2
- import { type JSX, type ReactNode } from 'react';
3
- import { type PopoverAlignment, type PopoverPlacement } from '../popover';
4
- import { type DateRangePickerProps } from '../date-picker';
1
+ import { DateRangePickerPopoverOption, DateRangePickerPopoverSelection } from './types';
2
+ import { JSX, ReactNode } from 'react';
3
+ import { PopoverAlignment, PopoverPlacement } from '../popover';
4
+ import { DateRangePickerProps } from '../date-picker';
5
5
  export type DateRangePickerPopoverPlacement = PopoverPlacement;
6
6
  export type DateRangePickerPopoverAlignment = PopoverAlignment;
7
7
  export type DateRangePickerPopoverRenderFooter = (context: {
@@ -1,4 +1,4 @@
1
- import { type DateISORange } from '../date-picker/date-range';
1
+ import { DateISORange } from '../date-picker/date-range';
2
2
  export type DateRangePickerPopoverSelection = {
3
3
  preset: string;
4
4
  range: DateISORange;
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithoutRef } from 'react';
2
2
  type DialogBodyHTMLProps = ComponentPropsWithoutRef<'div'>;
3
3
  export type DialogBodyProps = DialogBodyHTMLProps;
4
4
  export declare function DialogBody({ className, children, }: DialogBodyProps): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { type ReactNode } from 'react';
1
+ import { ReactNode } from 'react';
2
2
  export type DialogContextValue = {
3
3
  titleId: string;
4
4
  descriptionId: string;
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithoutRef } from 'react';
2
2
  type DialogFooterHTMLProps = ComponentPropsWithoutRef<'div'>;
3
3
  export type DialogFooterProps = {
4
4
  hasBorder?: boolean;
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
  type DialogHeaderHTMLProps = ComponentPropsWithoutRef<'div'>;
3
3
  export type DialogHeaderProps = {
4
4
  hasBorder?: boolean;
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithoutRef, type RefObject } from 'react';
1
+ import { ComponentPropsWithoutRef, RefObject } from 'react';
2
2
  type DialogHTMLProps = ComponentPropsWithoutRef<'section'>;
3
3
  export type DialogWidth = 'sm' | 'md' | 'lg';
4
4
  export type DialogProps = {
@@ -1,2 +1,2 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithoutRef } from 'react';
2
2
  export declare function XMarkIcon(props: ComponentPropsWithoutRef<'svg'>): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
2
  type EmptyStateHTMLProps = ComponentPropsWithoutRef<'div'>;
3
3
  export type EmptyStateProps = {
4
4
  image?: ReactNode;
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithRef } from 'react';
1
+ import { ComponentPropsWithRef } from 'react';
2
2
  type FilterButtonHTMLProps = ComponentPropsWithRef<'button'>;
3
3
  export type FilterButtonProps = {
4
4
  isActive?: boolean;
@@ -1,4 +1,4 @@
1
- import { type ComponentPropsWithoutRef } from 'react';
1
+ import { ComponentPropsWithoutRef } from 'react';
2
2
  type FilterButtonsHTMLProps = ComponentPropsWithoutRef<'div'>;
3
3
  export type FilterButtonsProps = FilterButtonsHTMLProps;
4
4
  export declare function FilterButtons({ className, children, ...props }: FilterButtonsProps): import("react/jsx-runtime").JSX.Element;