@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.
- package/dist/components/Accordion/Accordion.d.ts +57 -4
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion/Accordion.js +1 -4
- package/dist/components/Accordion/Accordion.stories.d.ts.map +1 -1
- package/dist/components/Alert/Alert.d.ts +13 -2
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Alert/Alert.js +4 -4
- package/dist/components/Alert/Alert.stories.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.d.ts +12 -1
- package/dist/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/Avatar/Avatar.stories.d.ts.map +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +23 -8
- package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +3 -12
- package/dist/components/Button/Button.d.ts +30 -0
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.d.ts +39 -3
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +1 -1
- package/dist/components/Calendar/utils/formatDate.d.ts +4 -0
- package/dist/components/Calendar/utils/formatDate.d.ts.map +1 -1
- package/dist/components/Calendar/utils/formatDateRange.d.ts +5 -0
- package/dist/components/Calendar/utils/formatDateRange.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +25 -3
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Checkbox/Checkbox.stories.d.ts.map +1 -1
- package/dist/components/Chip/Chip.d.ts +3 -6
- package/dist/components/Chip/Chip.d.ts.map +1 -1
- package/dist/components/Chip/Chip.js +6 -6
- package/dist/components/Chip/Chip.stories.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.d.ts +40 -1
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.js +1 -1
- package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -1
- package/dist/components/DataTable/index.d.ts +1 -1
- package/dist/components/DataTable/index.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +59 -4
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +7 -7
- package/dist/components/DatePicker/DatePicker.stories.d.ts.map +1 -1
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/utils/getDateRange.d.ts +9 -0
- package/dist/components/DatePicker/utils/getDateRange.d.ts.map +1 -1
- package/dist/components/DatePicker/utils/getDateRange.js +28 -15
- package/dist/components/Dialog/Dialog.d.ts +39 -2
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.js +176 -60
- package/dist/components/Dialog/Dialog.stories.d.ts +2 -0
- package/dist/components/Dialog/Dialog.stories.d.ts.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +73 -11
- package/dist/components/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.js +2 -8
- package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +10 -26
- package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts.map +1 -1
- package/dist/components/EdgeButton/EdgeButton.d.ts +18 -0
- package/dist/components/EdgeButton/EdgeButton.d.ts.map +1 -1
- package/dist/components/EdgeButton/EdgeButton.js +4 -4
- package/dist/components/EdgeButton/EdgeButton.stories.d.ts.map +1 -1
- package/dist/components/EdgeButton/index.d.ts +1 -1
- package/dist/components/EdgeButton/index.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts +10 -0
- package/dist/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.js +6 -6
- package/dist/components/EmptyState/EmptyState.stories.d.ts.map +1 -1
- package/dist/components/ExpandableTable/ExpandableTable.d.ts +54 -0
- package/dist/components/ExpandableTable/ExpandableTable.d.ts.map +1 -1
- package/dist/components/ExpandableTable/ExpandableTable.js +2 -2
- package/dist/components/ExpandableTable/ExpandableTable.stories.d.ts +0 -3
- package/dist/components/ExpandableTable/ExpandableTable.stories.d.ts.map +1 -1
- package/dist/components/ExpandableTable/Table.js +1 -1
- package/dist/components/ExpandableTable/index.d.ts +1 -1
- package/dist/components/ExpandableTable/index.d.ts.map +1 -1
- package/dist/components/FileUpload/FileItem.js +1 -1
- package/dist/components/FileUpload/FileUpload.d.ts +51 -0
- package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/components/FileUpload/FileUpload.stories.d.ts.map +1 -1
- package/dist/components/FileUpload/index.d.ts +1 -1
- package/dist/components/FileUpload/index.d.ts.map +1 -1
- package/dist/components/Flex/Flex.d.ts +49 -1
- package/dist/components/Flex/Flex.d.ts.map +1 -1
- package/dist/components/Flex/Flex.stories.d.ts.map +1 -1
- package/dist/components/Flex/index.d.ts +1 -1
- package/dist/components/Flex/index.d.ts.map +1 -1
- package/dist/components/Icons/CustomIcons.d.ts +166 -1
- package/dist/components/Icons/CustomIcons.d.ts.map +1 -1
- package/dist/components/Icons/CustomIcons.js +110 -97
- package/dist/components/InfoCard/InfoCard.d.ts +17 -0
- package/dist/components/InfoCard/InfoCard.d.ts.map +1 -0
- package/dist/components/InfoCard/index.d.ts +2 -0
- package/dist/components/InfoCard/index.d.ts.map +1 -0
- package/dist/components/Input/Input.d.ts +26 -0
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts +16 -0
- package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts.map +1 -1
- package/dist/components/LanguageSwitcher/LanguageSwitcher.stories.d.ts.map +1 -1
- package/dist/components/Lightbox/Lightbox.d.ts +15 -2
- package/dist/components/Lightbox/Lightbox.d.ts.map +1 -1
- package/dist/components/Lightbox/Lightbox.js +22 -20
- package/dist/components/Loader/Loader.d.ts +3 -0
- package/dist/components/Loader/Loader.d.ts.map +1 -1
- package/dist/components/Loader/Loader.stories.d.ts.map +1 -1
- package/dist/components/LoginScreen/LoginScreen.d.ts +18 -0
- package/dist/components/LoginScreen/LoginScreen.d.ts.map +1 -1
- package/dist/components/LoginScreen/LoginScreen.stories.d.ts.map +1 -1
- package/dist/components/LoginScreen/LoginScreenItem.d.ts +5 -0
- package/dist/components/LoginScreen/LoginScreenItem.d.ts.map +1 -1
- package/dist/components/LoginScreen/index.d.ts +2 -2
- package/dist/components/LoginScreen/index.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +25 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +8 -8
- package/dist/components/MultiSelect/MultiSelect.stories.d.ts.map +1 -1
- package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts +26 -1
- package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.d.ts +5 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.stories.d.ts.map +1 -1
- package/dist/components/PinIndicator/PinIndicator.d.ts +15 -0
- package/dist/components/PinIndicator/PinIndicator.d.ts.map +1 -1
- package/dist/components/PinIndicator/PinIndicator.stories.d.ts.map +1 -1
- package/dist/components/Popover/Popover.d.ts +36 -1
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/Popover/Popover.stories.d.ts.map +1 -1
- package/dist/components/Radio/Radio.d.ts +28 -3
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Radio/Radio.js +2 -5
- package/dist/components/Radio/Radio.stories.d.ts.map +1 -1
- package/dist/components/Reorderable/Reorderable.d.ts +79 -30
- package/dist/components/Reorderable/Reorderable.d.ts.map +1 -1
- package/dist/components/Reorderable/Reorderable.js +162 -143
- package/dist/components/Reorderable/Reorderable.stories.d.ts +1 -0
- package/dist/components/Reorderable/Reorderable.stories.d.ts.map +1 -1
- package/dist/components/Reorderable/index.d.ts +1 -1
- package/dist/components/Reorderable/index.d.ts.map +1 -1
- package/dist/components/ReorderableTable/ReorderableTable.d.ts +47 -13
- package/dist/components/ReorderableTable/ReorderableTable.d.ts.map +1 -1
- package/dist/components/ReorderableTable/ReorderableTable.js +44 -43
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts +1 -0
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts.map +1 -1
- package/dist/components/ReorderableTable/index.d.ts +1 -1
- package/dist/components/ReorderableTable/index.d.ts.map +1 -1
- package/dist/components/Searchbar/Searchbar.d.ts +11 -0
- package/dist/components/Searchbar/Searchbar.d.ts.map +1 -1
- package/dist/components/Searchbar/Searchbar.stories.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +35 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.js +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.stories.d.ts.map +1 -1
- package/dist/components/SegmentedControl/index.d.ts +1 -1
- package/dist/components/SegmentedControl/index.d.ts.map +1 -1
- package/dist/components/SegmentedIconControl/SegmentedIconControl.d.ts +38 -1
- package/dist/components/SegmentedIconControl/SegmentedIconControl.d.ts.map +1 -1
- package/dist/components/SegmentedIconControl/SegmentedIconControl.stories.d.ts.map +1 -1
- package/dist/components/SegmentedIconControl/index.d.ts +1 -1
- package/dist/components/SegmentedIconControl/index.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +25 -0
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Select/index.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +9 -6
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.stories.d.ts.map +1 -1
- package/dist/components/SliderIndicators/SliderIndicators.d.ts +9 -0
- package/dist/components/SliderIndicators/SliderIndicators.d.ts.map +1 -1
- package/dist/components/SliderIndicators/SliderIndicators.stories.d.ts.map +1 -1
- package/dist/components/Stepper/Stepper.d.ts +38 -0
- package/dist/components/Stepper/Stepper.d.ts.map +1 -1
- package/dist/components/Stepper/Stepper.js +5 -5
- package/dist/components/Stepper/Stepper.stories.d.ts.map +1 -1
- package/dist/components/Stepper/index.d.ts +1 -1
- package/dist/components/Stepper/index.d.ts.map +1 -1
- package/dist/components/SwipeButton/SwipeButton.d.ts +39 -0
- package/dist/components/SwipeButton/SwipeButton.d.ts.map +1 -1
- package/dist/components/SwipeButton/SwipeButton.js +1 -1
- package/dist/components/SwipeButton/SwipeButton.stories.d.ts +0 -43
- package/dist/components/SwipeButton/SwipeButton.stories.d.ts.map +1 -1
- package/dist/components/SwipeButton/index.d.ts +1 -1
- package/dist/components/SwipeButton/index.d.ts.map +1 -1
- package/dist/components/Switch/Switch.d.ts +19 -0
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Switch/Switch.stories.d.ts.map +1 -1
- package/dist/components/Tag/Tag.d.ts +17 -1
- package/dist/components/Tag/Tag.d.ts.map +1 -1
- package/dist/components/Tag/Tag.js +4 -4
- package/dist/components/Tag/Tag.stories.d.ts.map +1 -1
- package/dist/components/TextEditor/EditorToolbar.js +1 -1
- package/dist/components/TextEditor/LinkBubbleMenu.d.ts +4 -1
- package/dist/components/TextEditor/LinkBubbleMenu.d.ts.map +1 -1
- package/dist/components/TextEditor/LinkBubbleMenu.js +116 -92
- package/dist/components/TextEditor/TextEditor.d.ts +5 -2
- package/dist/components/TextEditor/TextEditor.d.ts.map +1 -1
- package/dist/components/TextEditor/TextEditor.js +129 -121
- package/dist/components/TextEditor/TextEditor.stories.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +9 -2
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.stories.d.ts.map +1 -1
- package/dist/components/TimePicker/TimePicker.d.ts +23 -1
- package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/components/TimePicker/TimePicker.js +1 -4
- package/dist/components/TimePicker/TimePicker.stories.d.ts.map +1 -1
- package/dist/components/Toast/Toast.d.ts +21 -1
- package/dist/components/Toast/Toast.d.ts.map +1 -1
- package/dist/components/Toast/Toast.js +7 -7
- package/dist/components/Toast/Toast.stories.d.ts.map +1 -1
- package/dist/components/Toast/ToastContainer.d.ts +12 -1
- package/dist/components/Toast/ToastContainer.d.ts.map +1 -1
- package/dist/components/Toast/index.d.ts +1 -1
- package/dist/components/Toast/index.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.d.ts +17 -1
- package/dist/components/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.js +6 -6
- package/dist/components/Toggle/Toggle.stories.d.ts.map +1 -1
- package/dist/components/Toggle/index.d.ts +1 -1
- package/dist/components/Toggle/index.d.ts.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +52 -4
- package/dist/components/ToggleGroup/ToggleGroup.d.ts.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.js +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts.map +1 -1
- package/dist/components/ToggleGroup/index.d.ts +1 -1
- package/dist/components/ToggleGroup/index.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +38 -3
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +5 -7
- package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
- package/dist/components/Typography/Typography.d.ts +18 -1
- package/dist/components/Typography/Typography.d.ts.map +1 -1
- package/dist/components/Typography/Typography.stories.d.ts.map +1 -1
- package/dist/components/Typography/index.d.ts +1 -1
- package/dist/components/Typography/index.d.ts.map +1 -1
- package/dist/index.js +191 -184
- package/dist/muza-ui.css +1 -1
- package/dist/styles/token-sizes.css +4 -0
- package/llms-full.md +581 -0
- package/llms.txt +36 -0
- package/package.json +4 -3
- 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
|
-
/**
|
|
23
|
+
/** Array of items to reorder. Each item must be a stable reference for Motion to track. */
|
|
19
24
|
values: T[];
|
|
20
|
-
/**
|
|
25
|
+
/** Fires when items are reordered with the new array order. */
|
|
21
26
|
onReorder: (newOrder: T[]) => void;
|
|
22
|
-
/**
|
|
27
|
+
/** Controls the drag axis direction. @default 'y' */
|
|
23
28
|
axis?: 'x' | 'y';
|
|
24
|
-
/** HTML element type
|
|
29
|
+
/** Specifies the HTML element type to render. @default 'ol' */
|
|
25
30
|
as?: ReorderableGroupElement;
|
|
26
|
-
/**
|
|
31
|
+
/** Prevents all reordering interactions for the entire group. @default false */
|
|
27
32
|
disabled?: boolean;
|
|
28
|
-
/**
|
|
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
|
-
/**
|
|
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
|
|
69
|
+
/** Item identifier. Must match an entry in the parent group's `values` array. */
|
|
43
70
|
value: T;
|
|
44
|
-
/** HTML element type
|
|
71
|
+
/** Specifies the HTML element type to render. @default 'li' */
|
|
45
72
|
as?: ReorderableItemElement;
|
|
46
|
-
/**
|
|
73
|
+
/** Prevents this item from being dragged. @default false */
|
|
47
74
|
disabled?: boolean;
|
|
48
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
|
111
|
+
/** Specifies the HTML element type to render. @default 'button' */
|
|
65
112
|
as?: ReorderableHandleElement;
|
|
66
|
-
/**
|
|
113
|
+
/** Prevents interaction with this handle. @default false */
|
|
67
114
|
disabled?: boolean;
|
|
68
|
-
/** Accessibility label
|
|
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:**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
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
|
|
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,
|
|
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,EAEL,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,eAAe,EAEpB,KAAK,mBAAmB,EAGzB,MAAM,cAAc,CAAA;AAWrB,UAAU,4BAA4B,CAAC,CAAC,GAAG,OAAO;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,CAAC,EAAE,CAAA;IACZ,SAAS,CAAC,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
|
|
1
1
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useMuzaTranslations as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
},
|
|
20
|
+
}, Z = ({
|
|
15
21
|
values: r,
|
|
16
|
-
onReorder:
|
|
17
|
-
axis:
|
|
18
|
-
as:
|
|
19
|
-
disabled:
|
|
20
|
-
layoutScroll:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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:
|
|
29
|
-
axis:
|
|
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
|
-
|
|
40
|
+
T.Provider,
|
|
33
41
|
{
|
|
34
|
-
value:
|
|
42
|
+
value: c,
|
|
35
43
|
children: /* @__PURE__ */ u(
|
|
36
|
-
|
|
44
|
+
j,
|
|
37
45
|
{
|
|
38
|
-
ref:
|
|
39
|
-
axis:
|
|
46
|
+
ref: v,
|
|
47
|
+
axis: d,
|
|
40
48
|
values: r,
|
|
41
|
-
onReorder:
|
|
42
|
-
} :
|
|
43
|
-
as:
|
|
44
|
-
layoutScroll:
|
|
45
|
-
style:
|
|
49
|
+
onReorder: a ? () => {
|
|
50
|
+
} : s,
|
|
51
|
+
as: b,
|
|
52
|
+
layoutScroll: n,
|
|
53
|
+
style: x,
|
|
46
54
|
role: "list",
|
|
47
|
-
"aria-label":
|
|
48
|
-
className:
|
|
49
|
-
children:
|
|
55
|
+
"aria-label": l.reorderableTable.listAriaLabel,
|
|
56
|
+
className: C(I),
|
|
57
|
+
children: m
|
|
50
58
|
}
|
|
51
59
|
)
|
|
52
60
|
}
|
|
53
61
|
);
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
const
|
|
62
|
+
}, q = A(Z);
|
|
63
|
+
q.displayName = "ReorderableGroup";
|
|
64
|
+
const B = ({
|
|
57
65
|
value: r,
|
|
58
|
-
as:
|
|
59
|
-
disabled:
|
|
60
|
-
dragListenerDisabled:
|
|
61
|
-
whileDrag:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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:
|
|
68
|
-
values:
|
|
69
|
-
onReorder:
|
|
70
|
-
axis:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
[
|
|
82
|
-
), h =
|
|
83
|
-
(
|
|
84
|
-
if (!
|
|
85
|
-
const
|
|
86
|
-
|
|
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
|
-
[
|
|
103
|
+
[p, e, o]
|
|
89
104
|
);
|
|
90
105
|
return /* @__PURE__ */ u(
|
|
91
|
-
|
|
106
|
+
P.Provider,
|
|
92
107
|
{
|
|
93
|
-
value: { dragControls:
|
|
108
|
+
value: { dragControls: E, dragListenerDisabled: b, moveItem: o },
|
|
94
109
|
children: /* @__PURE__ */ u(
|
|
95
|
-
|
|
110
|
+
z,
|
|
96
111
|
{
|
|
97
|
-
ref:
|
|
112
|
+
ref: f,
|
|
98
113
|
value: r,
|
|
99
|
-
as:
|
|
100
|
-
dragControls:
|
|
101
|
-
dragListener:
|
|
102
|
-
|
|
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":
|
|
123
|
+
"aria-disabled": L,
|
|
105
124
|
onKeyDown: h,
|
|
106
|
-
className:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
125
|
+
className: C(
|
|
126
|
+
p && "cursor-grab active:cursor-grabbing",
|
|
127
|
+
p && "focus-visible-default",
|
|
128
|
+
D
|
|
110
129
|
),
|
|
111
|
-
style:
|
|
130
|
+
style: I,
|
|
112
131
|
whileDrag: {
|
|
113
|
-
zIndex:
|
|
132
|
+
zIndex: F,
|
|
114
133
|
position: "relative",
|
|
115
|
-
...
|
|
134
|
+
...a
|
|
116
135
|
},
|
|
117
|
-
children:
|
|
136
|
+
children: x
|
|
118
137
|
}
|
|
119
138
|
)
|
|
120
139
|
}
|
|
121
140
|
);
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
const
|
|
141
|
+
}, J = A(B);
|
|
142
|
+
J.displayName = "ReorderableItem";
|
|
143
|
+
const Q = A(
|
|
125
144
|
({
|
|
126
145
|
as: r = "button",
|
|
127
|
-
disabled:
|
|
128
|
-
"aria-label":
|
|
129
|
-
className:
|
|
130
|
-
children:
|
|
131
|
-
},
|
|
132
|
-
const D =
|
|
133
|
-
if (!
|
|
134
|
-
|
|
135
|
-
const
|
|
136
|
-
const
|
|
137
|
-
(
|
|
138
|
-
},
|
|
139
|
-
document.removeEventListener("pointermove",
|
|
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",
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
},
|
|
145
|
-
(
|
|
146
|
-
if (!
|
|
147
|
-
const
|
|
148
|
-
|
|
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
|
-
[
|
|
151
|
-
),
|
|
152
|
-
"aria-label":
|
|
169
|
+
[e, f, c]
|
|
170
|
+
), t = {
|
|
171
|
+
"aria-label": x,
|
|
153
172
|
"aria-roledescription": "sortable",
|
|
154
|
-
onPointerDown:
|
|
155
|
-
onKeyDown:
|
|
156
|
-
onClick:
|
|
157
|
-
className:
|
|
173
|
+
onPointerDown: E,
|
|
174
|
+
onKeyDown: p,
|
|
175
|
+
onClick: L,
|
|
176
|
+
className: C(
|
|
158
177
|
"touch-none select-none",
|
|
159
|
-
|
|
160
|
-
!
|
|
161
|
-
|
|
162
|
-
|
|
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:
|
|
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:
|
|
169
|
-
tabIndex:
|
|
170
|
-
role:
|
|
171
|
-
...
|
|
172
|
-
children:
|
|
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:
|
|
178
|
-
tabIndex:
|
|
179
|
-
role:
|
|
180
|
-
...
|
|
181
|
-
children:
|
|
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
|
-
|
|
187
|
-
const
|
|
188
|
-
const
|
|
189
|
-
return /* @__PURE__ */ u(
|
|
190
|
-
},
|
|
191
|
-
|
|
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
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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,
|
|
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
|
|
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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Reorderable/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|