@vkzstudio/muza-ui 1.0.11 → 1.0.13

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 (242) hide show
  1. package/dist/components/Accordion/Accordion.d.ts +57 -4
  2. package/dist/components/Accordion/Accordion.d.ts.map +1 -1
  3. package/dist/components/Accordion/Accordion.js +1 -4
  4. package/dist/components/Accordion/Accordion.stories.d.ts.map +1 -1
  5. package/dist/components/Alert/Alert.d.ts +13 -2
  6. package/dist/components/Alert/Alert.d.ts.map +1 -1
  7. package/dist/components/Alert/Alert.js +4 -4
  8. package/dist/components/Alert/Alert.stories.d.ts.map +1 -1
  9. package/dist/components/Avatar/Avatar.d.ts +12 -1
  10. package/dist/components/Avatar/Avatar.d.ts.map +1 -1
  11. package/dist/components/Avatar/Avatar.stories.d.ts.map +1 -1
  12. package/dist/components/Breadcrumb/Breadcrumb.d.ts +23 -8
  13. package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
  14. package/dist/components/Breadcrumb/Breadcrumb.js +3 -12
  15. package/dist/components/Button/Button.d.ts +30 -0
  16. package/dist/components/Button/Button.d.ts.map +1 -1
  17. package/dist/components/Button/Button.js +1 -1
  18. package/dist/components/Button/Button.stories.d.ts.map +1 -1
  19. package/dist/components/Calendar/Calendar.d.ts +39 -3
  20. package/dist/components/Calendar/Calendar.d.ts.map +1 -1
  21. package/dist/components/Calendar/Calendar.js +1 -1
  22. package/dist/components/Calendar/utils/formatDate.d.ts +4 -0
  23. package/dist/components/Calendar/utils/formatDate.d.ts.map +1 -1
  24. package/dist/components/Calendar/utils/formatDateRange.d.ts +5 -0
  25. package/dist/components/Calendar/utils/formatDateRange.d.ts.map +1 -1
  26. package/dist/components/Checkbox/Checkbox.d.ts +25 -3
  27. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  28. package/dist/components/Checkbox/Checkbox.js +1 -1
  29. package/dist/components/Checkbox/Checkbox.stories.d.ts.map +1 -1
  30. package/dist/components/Chip/Chip.d.ts +3 -6
  31. package/dist/components/Chip/Chip.d.ts.map +1 -1
  32. package/dist/components/Chip/Chip.js +6 -6
  33. package/dist/components/Chip/Chip.stories.d.ts.map +1 -1
  34. package/dist/components/DataTable/DataTable.d.ts +40 -1
  35. package/dist/components/DataTable/DataTable.d.ts.map +1 -1
  36. package/dist/components/DataTable/DataTable.js +1 -1
  37. package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -1
  38. package/dist/components/DataTable/index.d.ts +1 -1
  39. package/dist/components/DataTable/index.d.ts.map +1 -1
  40. package/dist/components/DatePicker/DatePicker.d.ts +59 -4
  41. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  42. package/dist/components/DatePicker/DatePicker.js +7 -7
  43. package/dist/components/DatePicker/DatePicker.stories.d.ts.map +1 -1
  44. package/dist/components/DatePicker/index.d.ts +1 -0
  45. package/dist/components/DatePicker/index.d.ts.map +1 -1
  46. package/dist/components/DatePicker/utils/getDateRange.d.ts +9 -0
  47. package/dist/components/DatePicker/utils/getDateRange.d.ts.map +1 -1
  48. package/dist/components/DatePicker/utils/getDateRange.js +28 -15
  49. package/dist/components/Dialog/Dialog.d.ts +39 -2
  50. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  51. package/dist/components/Dialog/Dialog.js +176 -60
  52. package/dist/components/Dialog/Dialog.stories.d.ts +2 -0
  53. package/dist/components/Dialog/Dialog.stories.d.ts.map +1 -1
  54. package/dist/components/DropdownMenu/DropdownMenu.d.ts +73 -11
  55. package/dist/components/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  56. package/dist/components/DropdownMenu/DropdownMenu.js +2 -8
  57. package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +10 -26
  58. package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts.map +1 -1
  59. package/dist/components/EdgeButton/EdgeButton.d.ts +18 -0
  60. package/dist/components/EdgeButton/EdgeButton.d.ts.map +1 -1
  61. package/dist/components/EdgeButton/EdgeButton.js +4 -4
  62. package/dist/components/EdgeButton/EdgeButton.stories.d.ts.map +1 -1
  63. package/dist/components/EdgeButton/index.d.ts +1 -1
  64. package/dist/components/EdgeButton/index.d.ts.map +1 -1
  65. package/dist/components/EmptyState/EmptyState.d.ts +10 -0
  66. package/dist/components/EmptyState/EmptyState.d.ts.map +1 -1
  67. package/dist/components/EmptyState/EmptyState.js +6 -6
  68. package/dist/components/EmptyState/EmptyState.stories.d.ts.map +1 -1
  69. package/dist/components/ExpandableTable/ExpandableTable.d.ts +54 -0
  70. package/dist/components/ExpandableTable/ExpandableTable.d.ts.map +1 -1
  71. package/dist/components/ExpandableTable/ExpandableTable.js +2 -2
  72. package/dist/components/ExpandableTable/ExpandableTable.stories.d.ts +0 -3
  73. package/dist/components/ExpandableTable/ExpandableTable.stories.d.ts.map +1 -1
  74. package/dist/components/ExpandableTable/Table.js +1 -1
  75. package/dist/components/ExpandableTable/index.d.ts +1 -1
  76. package/dist/components/ExpandableTable/index.d.ts.map +1 -1
  77. package/dist/components/FileUpload/FileItem.js +1 -1
  78. package/dist/components/FileUpload/FileUpload.d.ts +51 -0
  79. package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
  80. package/dist/components/FileUpload/FileUpload.stories.d.ts.map +1 -1
  81. package/dist/components/FileUpload/index.d.ts +1 -1
  82. package/dist/components/FileUpload/index.d.ts.map +1 -1
  83. package/dist/components/Flex/Flex.d.ts +49 -1
  84. package/dist/components/Flex/Flex.d.ts.map +1 -1
  85. package/dist/components/Flex/Flex.stories.d.ts.map +1 -1
  86. package/dist/components/Flex/index.d.ts +1 -1
  87. package/dist/components/Flex/index.d.ts.map +1 -1
  88. package/dist/components/Icons/CustomIcons.d.ts +166 -1
  89. package/dist/components/Icons/CustomIcons.d.ts.map +1 -1
  90. package/dist/components/Icons/CustomIcons.js +110 -97
  91. package/dist/components/InfoCard/InfoCard.d.ts +17 -0
  92. package/dist/components/InfoCard/InfoCard.d.ts.map +1 -0
  93. package/dist/components/InfoCard/index.d.ts +2 -0
  94. package/dist/components/InfoCard/index.d.ts.map +1 -0
  95. package/dist/components/Input/Input.d.ts +26 -0
  96. package/dist/components/Input/Input.d.ts.map +1 -1
  97. package/dist/components/Input/Input.stories.d.ts.map +1 -1
  98. package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts +16 -0
  99. package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts.map +1 -1
  100. package/dist/components/LanguageSwitcher/LanguageSwitcher.stories.d.ts.map +1 -1
  101. package/dist/components/Lightbox/Lightbox.d.ts +15 -2
  102. package/dist/components/Lightbox/Lightbox.d.ts.map +1 -1
  103. package/dist/components/Lightbox/Lightbox.js +22 -20
  104. package/dist/components/Loader/Loader.d.ts +3 -0
  105. package/dist/components/Loader/Loader.d.ts.map +1 -1
  106. package/dist/components/Loader/Loader.stories.d.ts.map +1 -1
  107. package/dist/components/LoginScreen/LoginScreen.d.ts +18 -0
  108. package/dist/components/LoginScreen/LoginScreen.d.ts.map +1 -1
  109. package/dist/components/LoginScreen/LoginScreen.stories.d.ts.map +1 -1
  110. package/dist/components/LoginScreen/LoginScreenItem.d.ts +5 -0
  111. package/dist/components/LoginScreen/LoginScreenItem.d.ts.map +1 -1
  112. package/dist/components/LoginScreen/index.d.ts +2 -2
  113. package/dist/components/LoginScreen/index.d.ts.map +1 -1
  114. package/dist/components/MultiSelect/MultiSelect.d.ts +25 -0
  115. package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
  116. package/dist/components/MultiSelect/MultiSelect.js +8 -8
  117. package/dist/components/MultiSelect/MultiSelect.stories.d.ts.map +1 -1
  118. package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts +26 -1
  119. package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts.map +1 -1
  120. package/dist/components/PasswordInput/PasswordInput.d.ts +5 -0
  121. package/dist/components/PasswordInput/PasswordInput.d.ts.map +1 -1
  122. package/dist/components/PasswordInput/PasswordInput.stories.d.ts.map +1 -1
  123. package/dist/components/PinIndicator/PinIndicator.d.ts +15 -0
  124. package/dist/components/PinIndicator/PinIndicator.d.ts.map +1 -1
  125. package/dist/components/PinIndicator/PinIndicator.stories.d.ts.map +1 -1
  126. package/dist/components/Popover/Popover.d.ts +36 -1
  127. package/dist/components/Popover/Popover.d.ts.map +1 -1
  128. package/dist/components/Popover/Popover.stories.d.ts.map +1 -1
  129. package/dist/components/Radio/Radio.d.ts +28 -3
  130. package/dist/components/Radio/Radio.d.ts.map +1 -1
  131. package/dist/components/Radio/Radio.js +2 -5
  132. package/dist/components/Radio/Radio.stories.d.ts.map +1 -1
  133. package/dist/components/Reorderable/Reorderable.d.ts +79 -30
  134. package/dist/components/Reorderable/Reorderable.d.ts.map +1 -1
  135. package/dist/components/Reorderable/Reorderable.js +162 -143
  136. package/dist/components/Reorderable/Reorderable.stories.d.ts +1 -0
  137. package/dist/components/Reorderable/Reorderable.stories.d.ts.map +1 -1
  138. package/dist/components/Reorderable/index.d.ts +1 -1
  139. package/dist/components/Reorderable/index.d.ts.map +1 -1
  140. package/dist/components/ReorderableTable/ReorderableTable.d.ts +47 -13
  141. package/dist/components/ReorderableTable/ReorderableTable.d.ts.map +1 -1
  142. package/dist/components/ReorderableTable/ReorderableTable.js +44 -43
  143. package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts +1 -0
  144. package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts.map +1 -1
  145. package/dist/components/ReorderableTable/index.d.ts +1 -1
  146. package/dist/components/ReorderableTable/index.d.ts.map +1 -1
  147. package/dist/components/Searchbar/Searchbar.d.ts +11 -0
  148. package/dist/components/Searchbar/Searchbar.d.ts.map +1 -1
  149. package/dist/components/Searchbar/Searchbar.stories.d.ts.map +1 -1
  150. package/dist/components/SegmentedControl/SegmentedControl.d.ts +35 -1
  151. package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
  152. package/dist/components/SegmentedControl/SegmentedControl.js +1 -1
  153. package/dist/components/SegmentedControl/SegmentedControl.stories.d.ts.map +1 -1
  154. package/dist/components/SegmentedControl/index.d.ts +1 -1
  155. package/dist/components/SegmentedControl/index.d.ts.map +1 -1
  156. package/dist/components/SegmentedIconControl/SegmentedIconControl.d.ts +38 -1
  157. package/dist/components/SegmentedIconControl/SegmentedIconControl.d.ts.map +1 -1
  158. package/dist/components/SegmentedIconControl/SegmentedIconControl.stories.d.ts.map +1 -1
  159. package/dist/components/SegmentedIconControl/index.d.ts +1 -1
  160. package/dist/components/SegmentedIconControl/index.d.ts.map +1 -1
  161. package/dist/components/Select/Select.d.ts +25 -0
  162. package/dist/components/Select/Select.d.ts.map +1 -1
  163. package/dist/components/Select/Select.stories.d.ts.map +1 -1
  164. package/dist/components/Select/index.d.ts +1 -1
  165. package/dist/components/Select/index.d.ts.map +1 -1
  166. package/dist/components/Skeleton/Skeleton.d.ts +9 -6
  167. package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
  168. package/dist/components/Skeleton/Skeleton.stories.d.ts.map +1 -1
  169. package/dist/components/SliderIndicators/SliderIndicators.d.ts +9 -0
  170. package/dist/components/SliderIndicators/SliderIndicators.d.ts.map +1 -1
  171. package/dist/components/SliderIndicators/SliderIndicators.stories.d.ts.map +1 -1
  172. package/dist/components/Stepper/Stepper.d.ts +38 -0
  173. package/dist/components/Stepper/Stepper.d.ts.map +1 -1
  174. package/dist/components/Stepper/Stepper.js +5 -5
  175. package/dist/components/Stepper/Stepper.stories.d.ts.map +1 -1
  176. package/dist/components/Stepper/index.d.ts +1 -1
  177. package/dist/components/Stepper/index.d.ts.map +1 -1
  178. package/dist/components/SwipeButton/SwipeButton.d.ts +39 -0
  179. package/dist/components/SwipeButton/SwipeButton.d.ts.map +1 -1
  180. package/dist/components/SwipeButton/SwipeButton.js +1 -1
  181. package/dist/components/SwipeButton/SwipeButton.stories.d.ts +0 -43
  182. package/dist/components/SwipeButton/SwipeButton.stories.d.ts.map +1 -1
  183. package/dist/components/SwipeButton/index.d.ts +1 -1
  184. package/dist/components/SwipeButton/index.d.ts.map +1 -1
  185. package/dist/components/Switch/Switch.d.ts +19 -0
  186. package/dist/components/Switch/Switch.d.ts.map +1 -1
  187. package/dist/components/Switch/Switch.stories.d.ts.map +1 -1
  188. package/dist/components/Tag/Tag.d.ts +17 -1
  189. package/dist/components/Tag/Tag.d.ts.map +1 -1
  190. package/dist/components/Tag/Tag.js +4 -4
  191. package/dist/components/Tag/Tag.stories.d.ts.map +1 -1
  192. package/dist/components/TextEditor/EditorToolbar.js +1 -1
  193. package/dist/components/TextEditor/LinkBubbleMenu.d.ts +4 -1
  194. package/dist/components/TextEditor/LinkBubbleMenu.d.ts.map +1 -1
  195. package/dist/components/TextEditor/LinkBubbleMenu.js +116 -92
  196. package/dist/components/TextEditor/TextEditor.d.ts +5 -2
  197. package/dist/components/TextEditor/TextEditor.d.ts.map +1 -1
  198. package/dist/components/TextEditor/TextEditor.js +129 -121
  199. package/dist/components/TextEditor/TextEditor.stories.d.ts.map +1 -1
  200. package/dist/components/Textarea/Textarea.d.ts +9 -2
  201. package/dist/components/Textarea/Textarea.d.ts.map +1 -1
  202. package/dist/components/Textarea/Textarea.stories.d.ts.map +1 -1
  203. package/dist/components/TimePicker/TimePicker.d.ts +23 -1
  204. package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
  205. package/dist/components/TimePicker/TimePicker.js +1 -4
  206. package/dist/components/TimePicker/TimePicker.stories.d.ts.map +1 -1
  207. package/dist/components/Toast/Toast.d.ts +21 -1
  208. package/dist/components/Toast/Toast.d.ts.map +1 -1
  209. package/dist/components/Toast/Toast.js +7 -7
  210. package/dist/components/Toast/Toast.stories.d.ts.map +1 -1
  211. package/dist/components/Toast/ToastContainer.d.ts +12 -1
  212. package/dist/components/Toast/ToastContainer.d.ts.map +1 -1
  213. package/dist/components/Toast/index.d.ts +1 -1
  214. package/dist/components/Toast/index.d.ts.map +1 -1
  215. package/dist/components/Toggle/Toggle.d.ts +17 -1
  216. package/dist/components/Toggle/Toggle.d.ts.map +1 -1
  217. package/dist/components/Toggle/Toggle.js +6 -6
  218. package/dist/components/Toggle/Toggle.stories.d.ts.map +1 -1
  219. package/dist/components/Toggle/index.d.ts +1 -1
  220. package/dist/components/Toggle/index.d.ts.map +1 -1
  221. package/dist/components/ToggleGroup/ToggleGroup.d.ts +52 -4
  222. package/dist/components/ToggleGroup/ToggleGroup.d.ts.map +1 -1
  223. package/dist/components/ToggleGroup/ToggleGroup.js +1 -1
  224. package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts.map +1 -1
  225. package/dist/components/ToggleGroup/index.d.ts +1 -1
  226. package/dist/components/ToggleGroup/index.d.ts.map +1 -1
  227. package/dist/components/Tooltip/Tooltip.d.ts +38 -3
  228. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  229. package/dist/components/Tooltip/Tooltip.js +5 -7
  230. package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
  231. package/dist/components/Typography/Typography.d.ts +18 -1
  232. package/dist/components/Typography/Typography.d.ts.map +1 -1
  233. package/dist/components/Typography/Typography.stories.d.ts.map +1 -1
  234. package/dist/components/Typography/index.d.ts +1 -1
  235. package/dist/components/Typography/index.d.ts.map +1 -1
  236. package/dist/index.js +191 -184
  237. package/dist/muza-ui.css +1 -1
  238. package/dist/styles/token-sizes.css +4 -0
  239. package/llms-full.md +581 -0
  240. package/llms.txt +36 -0
  241. package/package.json +4 -3
  242. package/CLAUDE_CONSUMER.md +0 -238
@@ -1,10 +1,11 @@
1
1
  import { CSSProperties, ForwardedRef, ReactElement, ReactNode } from 'react';
2
- import { DragControls, TargetAndTransition } from 'motion/react';
2
+ import { AnimatePresenceProps, DragControls, HTMLMotionProps, TargetAndTransition } from 'motion/react';
3
3
  interface ReorderableGroupContextValue<T = unknown> {
4
4
  disabled?: boolean;
5
5
  values?: T[];
6
6
  onReorder?: (newOrder: T[]) => void;
7
7
  axis?: 'x' | 'y';
8
+ animatePresence?: boolean;
8
9
  }
9
10
  declare const useReorderableGroup: <T>() => ReorderableGroupContextValue<T>;
10
11
  interface ReorderableItemContextValue {
@@ -14,62 +15,108 @@ interface ReorderableItemContextValue {
14
15
  }
15
16
  declare const useReorderableItem: () => ReorderableItemContextValue;
16
17
  type ReorderableGroupElement = 'ul' | 'ol' | 'div';
18
+ /**
19
+ * Props for the ReorderableGroup component.
20
+ * @typeParam T - Type of items in the reorderable list
21
+ */
17
22
  export interface ReorderableGroupProps<T> {
18
- /** Items array to reorder */
23
+ /** Array of items to reorder. Each item must be a stable reference for Motion to track. */
19
24
  values: T[];
20
- /** Callback when items are reordered */
25
+ /** Fires when items are reordered with the new array order. */
21
26
  onReorder: (newOrder: T[]) => void;
22
- /** Drag axis - defaults to 'y' */
27
+ /** Controls the drag axis direction. @default 'y' */
23
28
  axis?: 'x' | 'y';
24
- /** HTML element type - defaults to 'ul' */
29
+ /** Specifies the HTML element type to render. @default 'ol' */
25
30
  as?: ReorderableGroupElement;
26
- /** Disable all reordering */
31
+ /** Prevents all reordering interactions for the entire group. @default false */
27
32
  disabled?: boolean;
28
- /** Enable layout scroll measurement for scrollable containers */
33
+ /** Enables layout scroll measurement for scrollable containers. @default false */
29
34
  layoutScroll?: boolean;
30
- /** Inline styles */
35
+ /** Inline styles applied to the group element. */
31
36
  style?: CSSProperties;
32
- /** Additional CSS classes */
37
+ /**
38
+ * Wraps children with AnimatePresence to enable exit animations on ReorderableItems.
39
+ * Pass `true` for defaults (`mode="popLayout"`, `initial={false}`) or an object for custom config.
40
+ */
41
+ animatePresence?: boolean | Omit<AnimatePresenceProps, 'children'>;
42
+ /** Additional CSS classes. */
33
43
  className?: string;
34
- /** Child elements */
44
+ /** Child elements (ReorderableItem and/or ReorderableStaticItem). */
35
45
  children: ReactNode;
36
46
  }
37
47
  declare const ReorderableGroup: <T>(props: ReorderableGroupProps<T> & {
38
48
  ref?: ForwardedRef<HTMLUListElement>;
39
49
  }) => ReactElement;
40
50
  type ReorderableItemElement = 'li' | 'div' | 'tr';
51
+ /**
52
+ * Custom animation configuration for enter/exit transitions on a ReorderableItem.
53
+ */
54
+ export interface ReorderableItemAnimationConfig {
55
+ /** Mount animation state (motion `initial`). Set `false` to skip enter animation. */
56
+ initial?: HTMLMotionProps<'div'>['initial'];
57
+ /** Target animation state (motion `animate`). */
58
+ animate?: HTMLMotionProps<'div'>['animate'];
59
+ /** Unmount animation state — requires AnimatePresence as a parent. */
60
+ exit?: HTMLMotionProps<'div'>['exit'];
61
+ /** Animation timing configuration for enter/exit transitions. */
62
+ transition?: HTMLMotionProps<'div'>['transition'];
63
+ }
64
+ /**
65
+ * Props for the ReorderableItem component.
66
+ * @typeParam T - Type of the item value, must match the parent group's values type
67
+ */
41
68
  export interface ReorderableItemProps<T> {
42
- /** Item identifier - must match an item in the parent group's values array */
69
+ /** Item identifier. Must match an entry in the parent group's `values` array. */
43
70
  value: T;
44
- /** HTML element type - defaults to 'li' */
71
+ /** Specifies the HTML element type to render. @default 'li' */
45
72
  as?: ReorderableItemElement;
46
- /** Disable this item from being dragged */
73
+ /** Prevents this item from being dragged. @default false */
47
74
  disabled?: boolean;
48
- /** Restrict drag to handle only - when true, item can only be dragged via ReorderableHandle */
75
+ /**
76
+ * Restricts drag to handle only. When `true`, the item can only be dragged
77
+ * via a nested ReorderableHandle.
78
+ * @default false
79
+ */
49
80
  dragListenerDisabled?: boolean;
50
- /** Additional styles to apply while dragging (merged with default whileDrag styles) */
81
+ /**
82
+ * Additional Motion styles applied while dragging, merged with default
83
+ * whileDrag styles (zIndex, position).
84
+ * @see TargetAndTransition
85
+ */
51
86
  whileDrag?: TargetAndTransition;
52
- /** Additional CSS classes */
87
+ /**
88
+ * Controls enter/exit animations on this item.
89
+ * - `true`: applies default animation (opacity + scale).
90
+ * - Object: merges with defaults — only override what you need.
91
+ * - `false` or omitted: no animation unless the parent group has `animatePresence` enabled,
92
+ * in which case defaults are applied automatically.
93
+ */
94
+ animation?: boolean | ReorderableItemAnimationConfig;
95
+ /** Additional CSS classes. */
53
96
  className?: string;
54
- /** Child elements */
97
+ /** Child elements. */
55
98
  children: ReactNode;
56
- /** Style */
99
+ /** Inline styles applied to the item element. */
57
100
  style?: CSSProperties;
58
101
  }
59
102
  declare const ReorderableItem: <T>(props: ReorderableItemProps<T> & {
60
103
  ref?: ForwardedRef<HTMLLIElement>;
61
104
  }) => ReactElement;
62
105
  type ReorderableHandleElement = 'button' | 'div' | 'span';
106
+ /**
107
+ * Props for the ReorderableHandle component.
108
+ * Only activates when the parent ReorderableItem has `dragListenerDisabled` set to `true`.
109
+ */
63
110
  export interface ReorderableHandleProps {
64
- /** HTML element type - defaults to 'button' */
111
+ /** Specifies the HTML element type to render. @default 'button' */
65
112
  as?: ReorderableHandleElement;
66
- /** Disable the handle */
113
+ /** Prevents interaction with this handle. @default false */
67
114
  disabled?: boolean;
68
- /** Accessibility label - defaults to 'Drag to reorder' */
115
+ /** Accessibility label for the drag handle. @default translated 'Drag to reorder' */
69
116
  'aria-label'?: string;
70
- /** Additional CSS classes */
117
+ /** Additional CSS classes. */
71
118
  className?: string;
72
- /** Child elements */
119
+ /** Child elements (typically a drag icon). */
73
120
  children?: ReactNode;
74
121
  }
75
122
  declare const ReorderableHandle: import('react').ForwardRefExoticComponent<ReorderableHandleProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -80,19 +127,21 @@ type ReorderableStaticItemElementMap = {
80
127
  tr: HTMLTableRowElement;
81
128
  };
82
129
  /**
83
- * Props for ReorderableStaticItem component.
130
+ * Props for the ReorderableStaticItem component.
84
131
  *
85
132
  * @remarks
86
- * **Limitation:** ReorderableStaticItem must be placed as the first or last item
87
- * in a ReorderableGroup. Placing it in the middle will cause reordering issues
88
- * as Motion's Reorder API doesn't support non-contiguous reorderable items.
133
+ * **Limitation:** Must be placed as the first or last item in a ReorderableGroup.
134
+ * Placing it in the middle causes reordering issues as Motion's Reorder API
135
+ * does not support non-contiguous reorderable items.
136
+ *
137
+ * @typeParam T - HTML element type, constrained to 'li' | 'div' | 'tr'
89
138
  */
90
139
  export interface ReorderableStaticItemProps<T extends ReorderableStaticItemElement = 'li'> {
91
- /** HTML element type - defaults to 'li' */
140
+ /** Specifies the HTML element type to render. @default 'li' */
92
141
  as?: T;
93
- /** Additional CSS classes */
142
+ /** Additional CSS classes. */
94
143
  className?: string;
95
- /** Child elements */
144
+ /** Child elements. */
96
145
  children: ReactNode;
97
146
  }
98
147
  declare const ReorderableStaticItem: <T extends ReorderableStaticItemElement = "li">(props: ReorderableStaticItemProps<T> & {
@@ -1 +1 @@
1
- {"version":3,"file":"Reorderable.d.ts","sourceRoot":"","sources":["../../../src/components/Reorderable/Reorderable.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EAIjB,KAAK,YAAY,EACjB,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AACd,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,mBAAmB,EAGzB,MAAM,cAAc,CAAA;AAIrB,UAAU,4BAA4B,CAAC,CAAC,GAAG,OAAO;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,CAAC,EAAE,CAAA;IACZ,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,IAAI,CAAA;IACnC,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,CAAA;CACjB;AAcD,QAAA,MAAM,mBAAmB,GAAI,CAAC,OACW,4BAA4B,CAAC,CAAC,CAAC,CAAA;AAExE,UAAU,2BAA2B;IACnC,YAAY,EAAE,YAAY,CAAA;IAC1B,oBAAoB,EAAE,OAAO,CAAA;IAC7B,QAAQ,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,CAAA;CACtC;AAKD,QAAA,MAAM,kBAAkB,mCAMvB,CAAA;AAMD,KAAK,uBAAuB,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAA;AAElD,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,6BAA6B;IAC7B,MAAM,EAAE,C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AC/D,EAAE,CAAC,EAAE,CAAC,CAAA;IACN,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,sBAAsB;IACtB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAuBD,QAAA,MAAM,qBAAqB,EAA6C,CACtE,CAAC,SAAS,4BAA4B,GAAG,IAAI,EAE7C,KAAK,EAAE,0BAA0B,CAAC,CAAC,CAAC,GAAG;IACrC,GAAG,CAAC,EAAE,YAAY,CAAC,+BAA+B,CAAC,CAAC,CAAC,CAAC,CAAA;CACvD,KACE,YAAY,CAChB;AAMD,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,GACnB,CAAA"}
@@ -1,199 +1,218 @@
1
1
  import { jsx as u } from "react/jsx-runtime";
2
- import { forwardRef as I, useContext as P, useRef as _, useCallback as A, createContext as E } from "react";
3
- import { useMuzaTranslations as K } from "../../translations/TranslationContext.js";
4
- import { useDragControls as S } from "../../node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.js";
5
- import { motion as O } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
6
- import { cn as x } from "../../utils/cn.js";
7
- import { ReorderGroup as U } from "../../node_modules/framer-motion/dist/es/components/Reorder/Group.js";
8
- import { ReorderItem as Y } from "../../node_modules/framer-motion/dist/es/components/Reorder/Item.js";
9
- const k = E({}), z = 50, N = 3, M = () => P(k), H = E(null), j = () => {
10
- const r = P(H);
2
+ import { forwardRef as A, useContext as K, useRef as X, useCallback as N, createContext as k } from "react";
3
+ import { useMuzaTranslations as M } from "../../translations/TranslationContext.js";
4
+ import { AnimatePresence as O } from "../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.js";
5
+ import { useDragControls as U } from "../../node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.js";
6
+ import { motion as Y } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
7
+ import { cn as C } from "../../utils/cn.js";
8
+ import { ReorderGroup as j } from "../../node_modules/framer-motion/dist/es/components/Reorder/Group.js";
9
+ import { ReorderItem as z } from "../../node_modules/framer-motion/dist/es/components/Reorder/Item.js";
10
+ const w = {
11
+ initial: { opacity: 0, scale: 0.96 },
12
+ animate: { opacity: 1, scale: 1 },
13
+ exit: { opacity: 0, scale: 0.96 },
14
+ transition: { duration: 0.2, ease: "easeOut" }
15
+ }, T = k({}), F = 50, G = 3, _ = () => K(T), P = k(null), V = () => {
16
+ const r = K(P);
11
17
  if (!r)
12
18
  throw new Error("useReorderableItem must be used within a ReorderableItem");
13
19
  return r;
14
- }, V = ({
20
+ }, Z = ({
15
21
  values: r,
16
- onReorder: a,
17
- axis: l = "y",
18
- as: c = "ol",
19
- disabled: o = !1,
20
- layoutScroll: b = !1,
21
- style: D,
22
- className: g,
23
- children: y
24
- }, m) => {
25
- const s = K(), f = {
26
- disabled: o,
22
+ onReorder: s,
23
+ axis: d = "y",
24
+ as: b = "ol",
25
+ disabled: a = !1,
26
+ layoutScroll: n = !1,
27
+ animatePresence: D,
28
+ style: x,
29
+ className: I,
30
+ children: f
31
+ }, v) => {
32
+ const l = M(), c = {
33
+ disabled: a,
27
34
  values: r,
28
- onReorder: o ? void 0 : a,
29
- axis: l
30
- };
35
+ onReorder: a ? void 0 : s,
36
+ axis: d,
37
+ animatePresence: !!D
38
+ }, e = D === !0 ? { mode: "popLayout", initial: !1 } : D || null, m = e ? /* @__PURE__ */ u(O, { ...e, children: f }) : f;
31
39
  return /* @__PURE__ */ u(
32
- k.Provider,
40
+ T.Provider,
33
41
  {
34
- value: f,
42
+ value: c,
35
43
  children: /* @__PURE__ */ u(
36
- U,
44
+ j,
37
45
  {
38
- ref: m,
39
- axis: l,
46
+ ref: v,
47
+ axis: d,
40
48
  values: r,
41
- onReorder: o ? () => {
42
- } : a,
43
- as: c,
44
- layoutScroll: b,
45
- style: D,
49
+ onReorder: a ? () => {
50
+ } : s,
51
+ as: b,
52
+ layoutScroll: n,
53
+ style: x,
46
54
  role: "list",
47
- "aria-label": s.reorderableTable.listAriaLabel,
48
- className: x(g),
49
- children: y
55
+ "aria-label": l.reorderableTable.listAriaLabel,
56
+ className: C(I),
57
+ children: m
50
58
  }
51
59
  )
52
60
  }
53
61
  );
54
- }, Z = I(V);
55
- Z.displayName = "ReorderableGroup";
56
- const q = ({
62
+ }, q = A(Z);
63
+ q.displayName = "ReorderableGroup";
64
+ const B = ({
57
65
  value: r,
58
- as: a = "li",
59
- disabled: l = !1,
60
- dragListenerDisabled: c = !1,
61
- whileDrag: o,
62
- className: b,
63
- children: D,
64
- style: g
65
- }, y) => {
66
+ as: s = "li",
67
+ disabled: d = !1,
68
+ dragListenerDisabled: b = !1,
69
+ whileDrag: a,
70
+ animation: n,
71
+ className: D,
72
+ children: x,
73
+ style: I
74
+ }, f) => {
66
75
  const {
67
- disabled: m,
68
- values: s,
69
- onReorder: f,
70
- axis: p
71
- } = M(), t = S(), v = l || m, d = !v && !c, w = A(
72
- (n) => {
73
- if (!s || !f) return;
74
- const e = s.indexOf(r);
75
- if (e === -1) return;
76
- const i = e + n;
77
- if (i < 0 || i >= s.length) return;
78
- const R = [...s];
79
- R.splice(e, 1), R.splice(i, 0, r), f(R);
76
+ disabled: v,
77
+ values: l,
78
+ onReorder: c,
79
+ axis: e,
80
+ animatePresence: m
81
+ } = _(), E = U(), L = d || v, p = !L && !b, t = n === !1 ? null : n === !0 ? w : typeof n == "object" ? {
82
+ initial: n.initial ?? w.initial,
83
+ animate: n.animate ?? w.animate,
84
+ exit: n.exit ?? w.exit,
85
+ transition: n.transition ?? w.transition
86
+ } : m ? w : null, o = N(
87
+ (i) => {
88
+ if (!l || !c) return;
89
+ const R = l.indexOf(r);
90
+ if (R === -1) return;
91
+ const y = R + i;
92
+ if (y < 0 || y >= l.length) return;
93
+ const g = [...l];
94
+ g.splice(R, 1), g.splice(y, 0, r), c(g);
80
95
  },
81
- [s, f, r]
82
- ), h = A(
83
- (n) => {
84
- if (!d) return;
85
- const e = p === "y" ? "ArrowUp" : "ArrowLeft", i = p === "y" ? "ArrowDown" : "ArrowRight";
86
- n.key === e ? (n.preventDefault(), w(-1)) : n.key === i && (n.preventDefault(), w(1));
96
+ [l, c, r]
97
+ ), h = N(
98
+ (i) => {
99
+ if (!p) return;
100
+ const R = e === "y" ? "ArrowUp" : "ArrowLeft", y = e === "y" ? "ArrowDown" : "ArrowRight";
101
+ i.key === R ? (i.preventDefault(), o(-1)) : i.key === y && (i.preventDefault(), o(1));
87
102
  },
88
- [d, p, w]
103
+ [p, e, o]
89
104
  );
90
105
  return /* @__PURE__ */ u(
91
- H.Provider,
106
+ P.Provider,
92
107
  {
93
- value: { dragControls: t, dragListenerDisabled: c, moveItem: w },
108
+ value: { dragControls: E, dragListenerDisabled: b, moveItem: o },
94
109
  children: /* @__PURE__ */ u(
95
- Y,
110
+ z,
96
111
  {
97
- ref: y,
112
+ ref: f,
98
113
  value: r,
99
- as: a,
100
- dragControls: t,
101
- dragListener: d,
102
- tabIndex: d ? 0 : void 0,
114
+ as: s,
115
+ dragControls: E,
116
+ dragListener: p,
117
+ initial: t == null ? void 0 : t.initial,
118
+ animate: t == null ? void 0 : t.animate,
119
+ exit: t == null ? void 0 : t.exit,
120
+ transition: t == null ? void 0 : t.transition,
121
+ tabIndex: p ? 0 : void 0,
103
122
  role: "listitem",
104
- "aria-disabled": v,
123
+ "aria-disabled": L,
105
124
  onKeyDown: h,
106
- className: x(
107
- d && "cursor-grab active:cursor-grabbing",
108
- d && "focus-visible-default",
109
- b
125
+ className: C(
126
+ p && "cursor-grab active:cursor-grabbing",
127
+ p && "focus-visible-default",
128
+ D
110
129
  ),
111
- style: g,
130
+ style: I,
112
131
  whileDrag: {
113
- zIndex: z,
132
+ zIndex: F,
114
133
  position: "relative",
115
- ...o
134
+ ...a
116
135
  },
117
- children: D
136
+ children: x
118
137
  }
119
138
  )
120
139
  }
121
140
  );
122
- }, B = I(q);
123
- B.displayName = "ReorderableItem";
124
- const F = I(
141
+ }, J = A(B);
142
+ J.displayName = "ReorderableItem";
143
+ const Q = A(
125
144
  ({
126
145
  as: r = "button",
127
- disabled: a = !1,
128
- "aria-label": l,
129
- className: c,
130
- children: o
131
- }, b) => {
132
- const D = K(), g = l ?? D.reorderableTable.dragHandleAriaLabel, { disabled: y, axis: m } = M(), { dragControls: s, dragListenerDisabled: f, moveItem: p } = j(), t = f && !y && !a, v = _(!1), d = (e) => {
133
- if (!t) return;
134
- v.current = !1;
135
- const i = e.clientX, R = e.clientY, L = (G) => {
136
- const T = Math.abs(G.clientX - i), X = Math.abs(G.clientY - R);
137
- (T > N || X > N) && (v.current = !0);
138
- }, C = () => {
139
- document.removeEventListener("pointermove", L), document.removeEventListener("pointerup", C);
146
+ disabled: s = !1,
147
+ "aria-label": d,
148
+ className: b,
149
+ children: a
150
+ }, n) => {
151
+ const D = M(), x = d ?? D.reorderableTable.dragHandleAriaLabel, { disabled: I, axis: f } = _(), { dragControls: v, dragListenerDisabled: l, moveItem: c } = V(), e = l && !I && !s, m = X(!1), E = (o) => {
152
+ if (!e) return;
153
+ m.current = !1;
154
+ const h = o.clientX, i = o.clientY, R = (g) => {
155
+ const S = Math.abs(g.clientX - h), H = Math.abs(g.clientY - i);
156
+ (S > G || H > G) && (m.current = !0);
157
+ }, y = () => {
158
+ document.removeEventListener("pointermove", R), document.removeEventListener("pointerup", y);
140
159
  };
141
- document.addEventListener("pointermove", L), document.addEventListener("pointerup", C), s.start(e);
142
- }, w = (e) => {
143
- v.current && (e.stopPropagation(), v.current = !1);
144
- }, h = A(
145
- (e) => {
146
- if (!t) return;
147
- const i = m === "y" ? "ArrowUp" : "ArrowLeft", R = m === "y" ? "ArrowDown" : "ArrowRight";
148
- e.key === i ? (e.preventDefault(), p(-1)) : e.key === R && (e.preventDefault(), p(1));
160
+ document.addEventListener("pointermove", R), document.addEventListener("pointerup", y), v.start(o);
161
+ }, L = (o) => {
162
+ m.current && (o.stopPropagation(), m.current = !1);
163
+ }, p = N(
164
+ (o) => {
165
+ if (!e) return;
166
+ const h = f === "y" ? "ArrowUp" : "ArrowLeft", i = f === "y" ? "ArrowDown" : "ArrowRight";
167
+ o.key === h ? (o.preventDefault(), c(-1)) : o.key === i && (o.preventDefault(), c(1));
149
168
  },
150
- [t, m, p]
151
- ), n = {
152
- "aria-label": g,
169
+ [e, f, c]
170
+ ), t = {
171
+ "aria-label": x,
153
172
  "aria-roledescription": "sortable",
154
- onPointerDown: d,
155
- onKeyDown: h,
156
- onClick: w,
157
- className: x(
173
+ onPointerDown: E,
174
+ onKeyDown: p,
175
+ onClick: L,
176
+ className: C(
158
177
  "touch-none select-none",
159
- t && "cursor-grab active:cursor-grabbing",
160
- !t && "cursor-default",
161
- t && "focus-visible-default",
162
- c
178
+ e && "cursor-grab active:cursor-grabbing",
179
+ !e && "cursor-default",
180
+ e && "focus-visible-default",
181
+ b
163
182
  )
164
183
  };
165
- return r === "button" ? /* @__PURE__ */ u("button", { ref: b, type: "button", disabled: a, ...n, children: o }) : r === "div" ? /* @__PURE__ */ u(
184
+ return r === "button" ? /* @__PURE__ */ u("button", { ref: n, type: "button", disabled: s, ...t, children: a }) : r === "div" ? /* @__PURE__ */ u(
166
185
  "div",
167
186
  {
168
- ref: b,
169
- tabIndex: t ? 0 : void 0,
170
- role: t ? "button" : void 0,
171
- ...n,
172
- children: o
187
+ ref: n,
188
+ tabIndex: e ? 0 : void 0,
189
+ role: e ? "button" : void 0,
190
+ ...t,
191
+ children: a
173
192
  }
174
193
  ) : /* @__PURE__ */ u(
175
194
  "span",
176
195
  {
177
- ref: b,
178
- tabIndex: t ? 0 : void 0,
179
- role: t ? "button" : void 0,
180
- ...n,
181
- children: o
196
+ ref: n,
197
+ tabIndex: e ? 0 : void 0,
198
+ role: e ? "button" : void 0,
199
+ ...t,
200
+ children: a
182
201
  }
183
202
  );
184
203
  }
185
204
  );
186
- F.displayName = "ReorderableHandle";
187
- const J = ({ as: r = "li", className: a, children: l }, c) => {
188
- const o = O[r];
189
- return /* @__PURE__ */ u(o, { ref: c, layout: !0, role: "listitem", className: x(a), children: l });
190
- }, Q = I(J);
191
- Q.displayName = "ReorderableStaticItem";
205
+ Q.displayName = "ReorderableHandle";
206
+ const W = ({ as: r = "li", className: s, children: d }, b) => {
207
+ const a = Y[r];
208
+ return /* @__PURE__ */ u(a, { ref: b, layout: !0, role: "listitem", className: C(s), children: d });
209
+ }, $ = A(W);
210
+ $.displayName = "ReorderableStaticItem";
192
211
  export {
193
- Z as ReorderableGroup,
194
- F as ReorderableHandle,
195
- B as ReorderableItem,
196
- Q as ReorderableStaticItem,
197
- M as useReorderableGroup,
198
- j as useReorderableItem
212
+ q as ReorderableGroup,
213
+ Q as ReorderableHandle,
214
+ J as ReorderableItem,
215
+ $ as ReorderableStaticItem,
216
+ _ as useReorderableGroup,
217
+ V as useReorderableItem
199
218
  };
@@ -10,5 +10,6 @@ export declare const HorizontalAxis: Story;
10
10
  export declare const TableRows: Story;
11
11
  export declare const ScrollableList: Story;
12
12
  export declare const ContentBlocks: Story;
13
+ export declare const AnimatedItems: Story;
13
14
  export declare const StaticItem: Story;
14
15
  //# sourceMappingURL=Reorderable.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Reorderable.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Reorderable/Reorderable.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAW3D,OAAO,EACL,gBAAgB,EAIjB,MAAM,eAAe,CAAA;AAwFtB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CA0FvC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAU9C,eAAO,MAAM,OAAO,EAAE,KAiCrB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAsCxB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAuCtB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAmC5B,CAAA;AASD,eAAO,MAAM,SAAS,EAAE,KA2FvB,CAAA;AAgBD,eAAO,MAAM,cAAc,EAAE,KAsC5B,CAAA;AAmBD,eAAO,MAAM,aAAa,EAAE,KAgD3B,CAAA;AA4BD,eAAO,MAAM,UAAU,EAAE,KAkDxB,CAAA"}
1
+ {"version":3,"file":"Reorderable.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Reorderable/Reorderable.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAW3D,OAAO,EACL,gBAAgB,EAIjB,MAAM,eAAe,CAAA;AAwFtB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CAuEvC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAU9C,eAAO,MAAM,OAAO,EAAE,KAiCrB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAsCxB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAuCtB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAmC5B,CAAA;AASD,eAAO,MAAM,SAAS,EAAE,KA2FvB,CAAA;AAgBD,eAAO,MAAM,cAAc,EAAE,KAsC5B,CAAA;AAmBD,eAAO,MAAM,aAAa,EAAE,KAgD3B,CAAA;AAGD,eAAO,MAAM,aAAa,EAAE,KA+E3B,CAAA;AA4BD,eAAO,MAAM,UAAU,EAAE,KAkDxB,CAAA"}
@@ -1,2 +1,2 @@
1
- export { ReorderableGroup, ReorderableItem, ReorderableHandle, ReorderableStaticItem, useReorderableGroup, useReorderableItem, type ReorderableGroupProps, type ReorderableItemProps, type ReorderableHandleProps, type ReorderableStaticItemProps, } from './Reorderable';
1
+ export * from './Reorderable';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Reorderable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,GAChC,MAAM,eAAe,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Reorderable/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}