@yamada-ui/reorder 0.2.5 → 0.2.6
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/index.d.mts +6 -0
- package/dist/reorder-item.d.mts +21 -0
- package/dist/reorder-trigger.d.mts +7 -0
- package/dist/reorder.d.mts +30 -0
- package/package.json +5 -5
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Reorder, ReorderProps } from './reorder.mjs';
|
|
2
|
+
export { ReorderItem, ReorderItemProps } from './reorder-item.mjs';
|
|
3
|
+
export { ReorderTrigger, ReorderTriggerProps } from './reorder-trigger.mjs';
|
|
4
|
+
import 'react';
|
|
5
|
+
import '@yamada-ui/core';
|
|
6
|
+
import '@yamada-ui/motion';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLUIProps } from '@yamada-ui/core';
|
|
3
|
+
import { HTMLMotionProps, DragControls } from '@yamada-ui/motion';
|
|
4
|
+
|
|
5
|
+
type ReorderItemContext = {
|
|
6
|
+
register: (node: HTMLElement | null) => void;
|
|
7
|
+
isDrag: boolean;
|
|
8
|
+
dragControls: DragControls;
|
|
9
|
+
};
|
|
10
|
+
declare const ReorderItemProvider: react.Provider<ReorderItemContext>;
|
|
11
|
+
declare const useReorderItemContext: () => ReorderItemContext;
|
|
12
|
+
type ReorderItemOptions = {
|
|
13
|
+
/**
|
|
14
|
+
* The label of the reorder item.
|
|
15
|
+
*/
|
|
16
|
+
label: string | number;
|
|
17
|
+
};
|
|
18
|
+
type ReorderItemProps = Omit<HTMLUIProps<'li'>, 'as'> & Omit<HTMLMotionProps<'li'>, 'as' | 'layout'> & ReorderItemOptions;
|
|
19
|
+
declare const ReorderItem: react.ForwardRefExoticComponent<Omit<HTMLUIProps<"li">, "as"> & Omit<HTMLMotionProps<"li">, "as" | "layout"> & ReorderItemOptions & react.RefAttributes<HTMLLIElement>>;
|
|
20
|
+
|
|
21
|
+
export { ReorderItem, ReorderItemProps, ReorderItemProvider, useReorderItemContext };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
|
+
import { HTMLUIProps } from '@yamada-ui/core';
|
|
3
|
+
|
|
4
|
+
type ReorderTriggerProps = HTMLUIProps<'div'>;
|
|
5
|
+
declare const ReorderTrigger: _yamada_ui_core.Component<"div", ReorderTriggerProps>;
|
|
6
|
+
|
|
7
|
+
export { ReorderTrigger, ReorderTriggerProps };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLUIProps, ThemeProps, CSSUIObject } from '@yamada-ui/core';
|
|
3
|
+
import { HTMLMotionProps } from '@yamada-ui/motion';
|
|
4
|
+
|
|
5
|
+
type ReorderContext = {
|
|
6
|
+
orientation: 'vertical' | 'horizontal';
|
|
7
|
+
styles: Record<string, CSSUIObject>;
|
|
8
|
+
};
|
|
9
|
+
declare const ReorderProvider: react.Provider<ReorderContext>;
|
|
10
|
+
declare const useReorderContext: () => ReorderContext;
|
|
11
|
+
type ReorderOptions = {
|
|
12
|
+
/**
|
|
13
|
+
* The orientation of the reorder.
|
|
14
|
+
*
|
|
15
|
+
* @default 'vertical'
|
|
16
|
+
*/
|
|
17
|
+
orientation?: 'vertical' | 'horizontal';
|
|
18
|
+
/**
|
|
19
|
+
* The callback invoked when reorder items are moved.
|
|
20
|
+
*/
|
|
21
|
+
onChange?: (labels: (string | number)[]) => void;
|
|
22
|
+
/**
|
|
23
|
+
* The callback invoked when the movement of reorder items is completed.
|
|
24
|
+
*/
|
|
25
|
+
onCompleteChange?: (labels: (string | number)[]) => void;
|
|
26
|
+
};
|
|
27
|
+
type ReorderProps = Omit<HTMLUIProps<'ul'>, 'as' | 'onChange'> & Omit<HTMLMotionProps<'ul'>, 'as' | 'onChange'> & ThemeProps<'Reorder'> & ReorderOptions;
|
|
28
|
+
declare const Reorder: react.ForwardRefExoticComponent<Omit<HTMLUIProps<"ul">, "as" | "onChange"> & Omit<HTMLMotionProps<"ul">, "as" | "onChange"> & ThemeProps<"Reorder"> & ReorderOptions & react.RefAttributes<HTMLUListElement>>;
|
|
29
|
+
|
|
30
|
+
export { Reorder, ReorderProps, ReorderProvider, useReorderContext };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/reorder",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Yamada UI reorder component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yamada",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"url": "https://github.com/hirotomoyamada/yamada-ui/issues"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@yamada-ui/core": "0.
|
|
39
|
-
"@yamada-ui/utils": "0.1.
|
|
40
|
-
"@yamada-ui/motion": "0.3.
|
|
41
|
-
"@yamada-ui/icon": "0.2.
|
|
38
|
+
"@yamada-ui/core": "0.5.0",
|
|
39
|
+
"@yamada-ui/utils": "0.1.3",
|
|
40
|
+
"@yamada-ui/motion": "0.3.3",
|
|
41
|
+
"@yamada-ui/icon": "0.2.5"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"react": "^18.0.0",
|