@yamada-ui/reorder 0.3.15 → 0.3.17
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/{chunk-77SPIQMS.mjs → chunk-UAVAC3SQ.mjs} +7 -7
- package/dist/{chunk-4I76OVZ3.mjs → chunk-ZW25IJKF.mjs} +2 -2
- package/dist/index.js +8 -8
- package/dist/index.mjs +2 -2
- package/dist/reorder-item.d.mts +1 -1
- package/dist/reorder-item.d.ts +1 -1
- package/dist/reorder-item.js +7 -7
- package/dist/reorder-item.mjs +1 -1
- package/dist/reorder-trigger.d.mts +1 -1
- package/dist/reorder-trigger.d.ts +1 -1
- package/dist/reorder-trigger.js +8 -8
- package/dist/reorder-trigger.mjs +2 -2
- package/dist/reorder.d.mts +3 -3
- package/dist/reorder.d.ts +3 -3
- package/package.json +4 -4
|
@@ -31,17 +31,17 @@ var ReorderItem = forwardRef(
|
|
|
31
31
|
[]
|
|
32
32
|
);
|
|
33
33
|
useEffect(() => {
|
|
34
|
-
x.
|
|
34
|
+
const unsubscribeX = x.on("change", (x2) => {
|
|
35
35
|
if (orientation === "horizontal")
|
|
36
|
-
setIsDrag(
|
|
36
|
+
setIsDrag(x2 !== 0);
|
|
37
37
|
});
|
|
38
|
-
y.
|
|
38
|
+
const unsubscribeY = y.on("change", (y2) => {
|
|
39
39
|
if (orientation === "vertical")
|
|
40
|
-
setIsDrag(
|
|
40
|
+
setIsDrag(y2 !== 0);
|
|
41
41
|
});
|
|
42
42
|
return () => {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
unsubscribeX();
|
|
44
|
+
unsubscribeY();
|
|
45
45
|
};
|
|
46
46
|
}, [orientation, x, y]);
|
|
47
47
|
const css = {
|
|
@@ -59,7 +59,7 @@ var ReorderItem = forwardRef(
|
|
|
59
59
|
{
|
|
60
60
|
ref,
|
|
61
61
|
as: MotionReorder.Item,
|
|
62
|
-
className: cx("ui-
|
|
62
|
+
className: cx("ui-reorder__item", className),
|
|
63
63
|
value: label,
|
|
64
64
|
__css: css,
|
|
65
65
|
...rest,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
useReorderItemContext
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UAVAC3SQ.mjs";
|
|
5
5
|
import {
|
|
6
6
|
useReorderContext
|
|
7
7
|
} from "./chunk-Q3OZOO4X.mjs";
|
|
@@ -29,7 +29,7 @@ var ReorderTrigger = forwardRef(
|
|
|
29
29
|
ui.div,
|
|
30
30
|
{
|
|
31
31
|
ref: mergeRefs(register, ref),
|
|
32
|
-
className: cx("ui-
|
|
32
|
+
className: cx("ui-reorder__trigger", className),
|
|
33
33
|
__css: css,
|
|
34
34
|
...rest,
|
|
35
35
|
"data-selected": dataAttr(isDrag),
|
package/dist/index.js
CHANGED
|
@@ -144,17 +144,17 @@ var ReorderItem = (0, import_react2.forwardRef)(
|
|
|
144
144
|
[]
|
|
145
145
|
);
|
|
146
146
|
(0, import_react2.useEffect)(() => {
|
|
147
|
-
x.
|
|
147
|
+
const unsubscribeX = x.on("change", (x2) => {
|
|
148
148
|
if (orientation === "horizontal")
|
|
149
|
-
setIsDrag(
|
|
149
|
+
setIsDrag(x2 !== 0);
|
|
150
150
|
});
|
|
151
|
-
y.
|
|
151
|
+
const unsubscribeY = y.on("change", (y2) => {
|
|
152
152
|
if (orientation === "vertical")
|
|
153
|
-
setIsDrag(
|
|
153
|
+
setIsDrag(y2 !== 0);
|
|
154
154
|
});
|
|
155
155
|
return () => {
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
unsubscribeX();
|
|
157
|
+
unsubscribeY();
|
|
158
158
|
};
|
|
159
159
|
}, [orientation, x, y]);
|
|
160
160
|
const css = {
|
|
@@ -172,7 +172,7 @@ var ReorderItem = (0, import_react2.forwardRef)(
|
|
|
172
172
|
{
|
|
173
173
|
ref,
|
|
174
174
|
as: import_motion2.MotionReorder.Item,
|
|
175
|
-
className: (0, import_utils2.cx)("ui-
|
|
175
|
+
className: (0, import_utils2.cx)("ui-reorder__item", className),
|
|
176
176
|
value: label,
|
|
177
177
|
__css: css,
|
|
178
178
|
...rest,
|
|
@@ -209,7 +209,7 @@ var ReorderTrigger = (0, import_core3.forwardRef)(
|
|
|
209
209
|
import_core3.ui.div,
|
|
210
210
|
{
|
|
211
211
|
ref: (0, import_utils3.mergeRefs)(register, ref),
|
|
212
|
-
className: (0, import_utils3.cx)("ui-
|
|
212
|
+
className: (0, import_utils3.cx)("ui-reorder__trigger", className),
|
|
213
213
|
__css: css,
|
|
214
214
|
...rest,
|
|
215
215
|
"data-selected": (0, import_utils3.dataAttr)(isDrag),
|
package/dist/index.mjs
CHANGED
package/dist/reorder-item.d.mts
CHANGED
|
@@ -15,7 +15,7 @@ type ReorderItemOptions = {
|
|
|
15
15
|
*/
|
|
16
16
|
label: string | number;
|
|
17
17
|
};
|
|
18
|
-
type ReorderItemProps = Omit<HTMLUIProps<
|
|
18
|
+
type ReorderItemProps = Omit<HTMLUIProps<"li">, "as"> & Omit<HTMLMotionProps<"li">, "as" | "layout"> & ReorderItemOptions;
|
|
19
19
|
declare const ReorderItem: react.ForwardRefExoticComponent<Omit<HTMLUIProps<"li">, "as"> & Omit<HTMLMotionProps<"li">, "as" | "layout"> & ReorderItemOptions & react.RefAttributes<HTMLLIElement>>;
|
|
20
20
|
|
|
21
21
|
export { ReorderItem, ReorderItemProps, ReorderItemProvider, useReorderItemContext };
|
package/dist/reorder-item.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ type ReorderItemOptions = {
|
|
|
15
15
|
*/
|
|
16
16
|
label: string | number;
|
|
17
17
|
};
|
|
18
|
-
type ReorderItemProps = Omit<HTMLUIProps<
|
|
18
|
+
type ReorderItemProps = Omit<HTMLUIProps<"li">, "as"> & Omit<HTMLMotionProps<"li">, "as" | "layout"> & ReorderItemOptions;
|
|
19
19
|
declare const ReorderItem: react.ForwardRefExoticComponent<Omit<HTMLUIProps<"li">, "as"> & Omit<HTMLMotionProps<"li">, "as" | "layout"> & ReorderItemOptions & react.RefAttributes<HTMLLIElement>>;
|
|
20
20
|
|
|
21
21
|
export { ReorderItem, ReorderItemProps, ReorderItemProvider, useReorderItemContext };
|
package/dist/reorder-item.js
CHANGED
|
@@ -144,17 +144,17 @@ var ReorderItem = (0, import_react2.forwardRef)(
|
|
|
144
144
|
[]
|
|
145
145
|
);
|
|
146
146
|
(0, import_react2.useEffect)(() => {
|
|
147
|
-
x.
|
|
147
|
+
const unsubscribeX = x.on("change", (x2) => {
|
|
148
148
|
if (orientation === "horizontal")
|
|
149
|
-
setIsDrag(
|
|
149
|
+
setIsDrag(x2 !== 0);
|
|
150
150
|
});
|
|
151
|
-
y.
|
|
151
|
+
const unsubscribeY = y.on("change", (y2) => {
|
|
152
152
|
if (orientation === "vertical")
|
|
153
|
-
setIsDrag(
|
|
153
|
+
setIsDrag(y2 !== 0);
|
|
154
154
|
});
|
|
155
155
|
return () => {
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
unsubscribeX();
|
|
157
|
+
unsubscribeY();
|
|
158
158
|
};
|
|
159
159
|
}, [orientation, x, y]);
|
|
160
160
|
const css = {
|
|
@@ -172,7 +172,7 @@ var ReorderItem = (0, import_react2.forwardRef)(
|
|
|
172
172
|
{
|
|
173
173
|
ref,
|
|
174
174
|
as: import_motion2.MotionReorder.Item,
|
|
175
|
-
className: (0, import_utils2.cx)("ui-
|
|
175
|
+
className: (0, import_utils2.cx)("ui-reorder__item", className),
|
|
176
176
|
value: label,
|
|
177
177
|
__css: css,
|
|
178
178
|
...rest,
|
package/dist/reorder-item.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
2
|
import { HTMLUIProps } from '@yamada-ui/core';
|
|
3
3
|
|
|
4
|
-
type ReorderTriggerProps = HTMLUIProps<
|
|
4
|
+
type ReorderTriggerProps = HTMLUIProps<"div">;
|
|
5
5
|
declare const ReorderTrigger: _yamada_ui_core.Component<"div", ReorderTriggerProps>;
|
|
6
6
|
|
|
7
7
|
export { ReorderTrigger, ReorderTriggerProps };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _yamada_ui_core from '@yamada-ui/core';
|
|
2
2
|
import { HTMLUIProps } from '@yamada-ui/core';
|
|
3
3
|
|
|
4
|
-
type ReorderTriggerProps = HTMLUIProps<
|
|
4
|
+
type ReorderTriggerProps = HTMLUIProps<"div">;
|
|
5
5
|
declare const ReorderTrigger: _yamada_ui_core.Component<"div", ReorderTriggerProps>;
|
|
6
6
|
|
|
7
7
|
export { ReorderTrigger, ReorderTriggerProps };
|
package/dist/reorder-trigger.js
CHANGED
|
@@ -145,17 +145,17 @@ var ReorderItem = (0, import_react2.forwardRef)(
|
|
|
145
145
|
[]
|
|
146
146
|
);
|
|
147
147
|
(0, import_react2.useEffect)(() => {
|
|
148
|
-
x.
|
|
148
|
+
const unsubscribeX = x.on("change", (x2) => {
|
|
149
149
|
if (orientation === "horizontal")
|
|
150
|
-
setIsDrag(
|
|
150
|
+
setIsDrag(x2 !== 0);
|
|
151
151
|
});
|
|
152
|
-
y.
|
|
152
|
+
const unsubscribeY = y.on("change", (y2) => {
|
|
153
153
|
if (orientation === "vertical")
|
|
154
|
-
setIsDrag(
|
|
154
|
+
setIsDrag(y2 !== 0);
|
|
155
155
|
});
|
|
156
156
|
return () => {
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
unsubscribeX();
|
|
158
|
+
unsubscribeY();
|
|
159
159
|
};
|
|
160
160
|
}, [orientation, x, y]);
|
|
161
161
|
const css = {
|
|
@@ -173,7 +173,7 @@ var ReorderItem = (0, import_react2.forwardRef)(
|
|
|
173
173
|
{
|
|
174
174
|
ref,
|
|
175
175
|
as: import_motion2.MotionReorder.Item,
|
|
176
|
-
className: (0, import_utils2.cx)("ui-
|
|
176
|
+
className: (0, import_utils2.cx)("ui-reorder__item", className),
|
|
177
177
|
value: label,
|
|
178
178
|
__css: css,
|
|
179
179
|
...rest,
|
|
@@ -207,7 +207,7 @@ var ReorderTrigger = (0, import_core3.forwardRef)(
|
|
|
207
207
|
import_core3.ui.div,
|
|
208
208
|
{
|
|
209
209
|
ref: (0, import_utils3.mergeRefs)(register, ref),
|
|
210
|
-
className: (0, import_utils3.cx)("ui-
|
|
210
|
+
className: (0, import_utils3.cx)("ui-reorder__trigger", className),
|
|
211
211
|
__css: css,
|
|
212
212
|
...rest,
|
|
213
213
|
"data-selected": (0, import_utils3.dataAttr)(isDrag),
|
package/dist/reorder-trigger.mjs
CHANGED
package/dist/reorder.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import { HTMLUIProps, ThemeProps, CSSUIObject } from '@yamada-ui/core';
|
|
|
3
3
|
import { HTMLMotionProps } from '@yamada-ui/motion';
|
|
4
4
|
|
|
5
5
|
type ReorderContext = {
|
|
6
|
-
orientation:
|
|
6
|
+
orientation: "vertical" | "horizontal";
|
|
7
7
|
styles: Record<string, CSSUIObject>;
|
|
8
8
|
};
|
|
9
9
|
declare const ReorderProvider: react.Provider<ReorderContext>;
|
|
@@ -14,7 +14,7 @@ type ReorderOptions = {
|
|
|
14
14
|
*
|
|
15
15
|
* @default 'vertical'
|
|
16
16
|
*/
|
|
17
|
-
orientation?:
|
|
17
|
+
orientation?: "vertical" | "horizontal";
|
|
18
18
|
/**
|
|
19
19
|
* The callback invoked when reorder items are moved.
|
|
20
20
|
*/
|
|
@@ -24,7 +24,7 @@ type ReorderOptions = {
|
|
|
24
24
|
*/
|
|
25
25
|
onCompleteChange?: (labels: (string | number)[]) => void;
|
|
26
26
|
};
|
|
27
|
-
type ReorderProps = Omit<HTMLUIProps<
|
|
27
|
+
type ReorderProps = Omit<HTMLUIProps<"ul">, "as" | "onChange"> & Omit<HTMLMotionProps<"ul">, "as" | "onChange"> & ThemeProps<"Reorder"> & ReorderOptions;
|
|
28
28
|
declare const Reorder: react.ForwardRefExoticComponent<Omit<HTMLUIProps<"ul">, "as" | "onChange"> & Omit<HTMLMotionProps<"ul">, "as" | "onChange"> & ThemeProps<"Reorder"> & ReorderOptions & react.RefAttributes<HTMLUListElement>>;
|
|
29
29
|
|
|
30
30
|
export { Reorder, ReorderProps, ReorderProvider, useReorderContext };
|
package/dist/reorder.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { HTMLUIProps, ThemeProps, CSSUIObject } from '@yamada-ui/core';
|
|
|
3
3
|
import { HTMLMotionProps } from '@yamada-ui/motion';
|
|
4
4
|
|
|
5
5
|
type ReorderContext = {
|
|
6
|
-
orientation:
|
|
6
|
+
orientation: "vertical" | "horizontal";
|
|
7
7
|
styles: Record<string, CSSUIObject>;
|
|
8
8
|
};
|
|
9
9
|
declare const ReorderProvider: react.Provider<ReorderContext>;
|
|
@@ -14,7 +14,7 @@ type ReorderOptions = {
|
|
|
14
14
|
*
|
|
15
15
|
* @default 'vertical'
|
|
16
16
|
*/
|
|
17
|
-
orientation?:
|
|
17
|
+
orientation?: "vertical" | "horizontal";
|
|
18
18
|
/**
|
|
19
19
|
* The callback invoked when reorder items are moved.
|
|
20
20
|
*/
|
|
@@ -24,7 +24,7 @@ type ReorderOptions = {
|
|
|
24
24
|
*/
|
|
25
25
|
onCompleteChange?: (labels: (string | number)[]) => void;
|
|
26
26
|
};
|
|
27
|
-
type ReorderProps = Omit<HTMLUIProps<
|
|
27
|
+
type ReorderProps = Omit<HTMLUIProps<"ul">, "as" | "onChange"> & Omit<HTMLMotionProps<"ul">, "as" | "onChange"> & ThemeProps<"Reorder"> & ReorderOptions;
|
|
28
28
|
declare const Reorder: react.ForwardRefExoticComponent<Omit<HTMLUIProps<"ul">, "as" | "onChange"> & Omit<HTMLMotionProps<"ul">, "as" | "onChange"> & ThemeProps<"Reorder"> & ReorderOptions & react.RefAttributes<HTMLUListElement>>;
|
|
29
29
|
|
|
30
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.3.
|
|
3
|
+
"version": "0.3.17",
|
|
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.12.
|
|
38
|
+
"@yamada-ui/core": "0.12.6",
|
|
39
39
|
"@yamada-ui/utils": "0.3.3",
|
|
40
|
-
"@yamada-ui/motion": "0.4.
|
|
41
|
-
"@yamada-ui/icon": "0.3.
|
|
40
|
+
"@yamada-ui/motion": "0.4.16",
|
|
41
|
+
"@yamada-ui/icon": "0.3.16"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"react": "^18.0.0",
|