@vkzstudio/muza-ui 1.0.6 → 1.0.8
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/Button/buttonVariants.d.ts +1 -1
- package/dist/components/Calendar/Calendar.d.ts +2 -2
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +158 -150
- package/dist/components/Chip/Chip.d.ts +43 -0
- package/dist/components/Chip/Chip.d.ts.map +1 -0
- package/dist/components/Chip/Chip.js +98 -0
- package/dist/components/Chip/Chip.stories.d.ts +9 -0
- package/dist/components/Chip/Chip.stories.d.ts.map +1 -0
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/Chip/index.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.d.ts +23 -0
- package/dist/components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.js +101 -0
- package/dist/components/DataTable/DataTable.stories.d.ts +14 -0
- package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -0
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DataTable/index.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.js +28 -26
- package/dist/components/ExpandableTable/Table.d.ts +1 -1
- package/dist/components/FileUpload/FileItem.d.ts.map +1 -1
- package/dist/components/FileUpload/FileItem.js +81 -77
- package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
- package/dist/components/FileUpload/FileUpload.js +98 -94
- package/dist/components/Flex/Flex.d.ts +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +51 -50
- package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts +19 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.d.ts.map +1 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.js +19 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.stories.d.ts +10 -0
- package/dist/components/MuzaUIProvider/MuzaUIProvider.stories.d.ts.map +1 -0
- package/dist/components/MuzaUIProvider/index.d.ts +2 -0
- package/dist/components/MuzaUIProvider/index.d.ts.map +1 -0
- package/dist/components/Reorderable/Reorderable.d.ts +100 -0
- package/dist/components/Reorderable/Reorderable.d.ts.map +1 -0
- package/dist/components/Reorderable/Reorderable.js +197 -0
- package/dist/components/Reorderable/Reorderable.stories.d.ts +14 -0
- package/dist/components/Reorderable/Reorderable.stories.d.ts.map +1 -0
- package/dist/components/Reorderable/index.d.ts +2 -0
- package/dist/components/Reorderable/index.d.ts.map +1 -0
- package/dist/components/ReorderableTable/ReorderableTable.d.ts +40 -0
- package/dist/components/ReorderableTable/ReorderableTable.d.ts.map +1 -0
- package/dist/components/ReorderableTable/ReorderableTable.js +175 -0
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts +18 -0
- package/dist/components/ReorderableTable/ReorderableTable.stories.d.ts.map +1 -0
- package/dist/components/ReorderableTable/index.d.ts +2 -0
- package/dist/components/ReorderableTable/index.d.ts.map +1 -0
- package/dist/components/Searchbar/Searchbar.d.ts +1 -1
- package/dist/components/Searchbar/Searchbar.d.ts.map +1 -1
- package/dist/components/Searchbar/Searchbar.js +50 -49
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +43 -42
- package/dist/components/Stepper/Stepper.d.ts +1 -1
- package/dist/components/Stepper/Stepper.d.ts.map +1 -1
- package/dist/components/Stepper/Stepper.js +43 -42
- package/dist/components/SwipeButton/SwipeButton.d.ts +1 -1
- package/dist/components/SwipeButton/SwipeButton.d.ts.map +1 -1
- package/dist/components/SwipeButton/SwipeButton.js +85 -84
- package/dist/components/SwipeButton/SwipeButton.stories.d.ts +1 -1
- package/dist/components/Typography/Typography.d.ts +1 -1
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.js +217 -189
- package/dist/muza-ui.css +1 -1
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +11 -0
- package/dist/node_modules/date-fns/constants.js +4 -0
- package/dist/node_modules/date-fns/constructFrom.js +8 -0
- package/dist/node_modules/date-fns/isSameWeek.js +14 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/formatDistance.js +275 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/formatLong.js +33 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/formatRelative.js +25 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/localize.js +167 -0
- package/dist/node_modules/date-fns/locale/cs/_lib/match.js +109 -0
- package/dist/node_modules/date-fns/locale/cs.js +21 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/formatDistance.js +158 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/formatLong.js +33 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/formatRelative.js +60 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/localize.js +175 -0
- package/dist/node_modules/date-fns/locale/sk/_lib/match.js +111 -0
- package/dist/node_modules/date-fns/locale/sk.js +21 -0
- package/dist/node_modules/date-fns/startOfWeek.js +11 -0
- package/dist/node_modules/date-fns/toDate.js +8 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/Group.js +38 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/Item.js +29 -0
- package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.js +17 -0
- package/dist/node_modules/framer-motion/dist/es/context/ReorderContext.js +5 -0
- package/dist/node_modules/motion-utils/dist/es/array.js +15 -6
- package/dist/translations/TranslationContext.d.ts +61 -0
- package/dist/translations/TranslationContext.d.ts.map +1 -0
- package/dist/translations/TranslationContext.js +74 -0
- package/dist/translations/index.d.ts +6 -0
- package/dist/translations/index.d.ts.map +1 -0
- package/dist/translations/locales/cs.d.ts +3 -0
- package/dist/translations/locales/cs.d.ts.map +1 -0
- package/dist/translations/locales/cs.js +56 -0
- package/dist/translations/locales/en.d.ts +3 -0
- package/dist/translations/locales/en.d.ts.map +1 -0
- package/dist/translations/locales/en.js +56 -0
- package/dist/translations/locales/sk.d.ts +3 -0
- package/dist/translations/locales/sk.d.ts.map +1 -0
- package/dist/translations/locales/sk.js +56 -0
- package/dist/translations/types.d.ts +126 -0
- package/dist/translations/types.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { CSSProperties, ForwardedRef, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { DragControls, TargetAndTransition } from 'motion/react';
|
|
3
|
+
interface ReorderableGroupContextValue<T = unknown> {
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
values?: T[];
|
|
6
|
+
onReorder?: (newOrder: T[]) => void;
|
|
7
|
+
axis?: 'x' | 'y';
|
|
8
|
+
}
|
|
9
|
+
declare const useReorderableGroup: <T>() => ReorderableGroupContextValue<T>;
|
|
10
|
+
interface ReorderableItemContextValue {
|
|
11
|
+
dragControls: DragControls;
|
|
12
|
+
dragListenerDisabled: boolean;
|
|
13
|
+
moveItem: (direction: -1 | 1) => void;
|
|
14
|
+
}
|
|
15
|
+
declare const useReorderableItem: () => ReorderableItemContextValue;
|
|
16
|
+
type ReorderableGroupElement = 'ul' | 'ol' | 'div';
|
|
17
|
+
export interface ReorderableGroupProps<T> {
|
|
18
|
+
/** Items array to reorder */
|
|
19
|
+
values: T[];
|
|
20
|
+
/** Callback when items are reordered */
|
|
21
|
+
onReorder: (newOrder: T[]) => void;
|
|
22
|
+
/** Drag axis - defaults to 'y' */
|
|
23
|
+
axis?: 'x' | 'y';
|
|
24
|
+
/** HTML element type - defaults to 'ul' */
|
|
25
|
+
as?: ReorderableGroupElement;
|
|
26
|
+
/** Disable all reordering */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** Enable layout scroll measurement for scrollable containers */
|
|
29
|
+
layoutScroll?: boolean;
|
|
30
|
+
/** Inline styles */
|
|
31
|
+
style?: CSSProperties;
|
|
32
|
+
/** Additional CSS classes */
|
|
33
|
+
className?: string;
|
|
34
|
+
/** Child elements */
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
declare const ReorderableGroup: <T>(props: ReorderableGroupProps<T> & {
|
|
38
|
+
ref?: ForwardedRef<HTMLUListElement>;
|
|
39
|
+
}) => ReactElement;
|
|
40
|
+
type ReorderableItemElement = 'li' | 'div' | 'tr';
|
|
41
|
+
export interface ReorderableItemProps<T> {
|
|
42
|
+
/** Item identifier - must match an item in the parent group's values array */
|
|
43
|
+
value: T;
|
|
44
|
+
/** HTML element type - defaults to 'li' */
|
|
45
|
+
as?: ReorderableItemElement;
|
|
46
|
+
/** Disable this item from being dragged */
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
/** Restrict drag to handle only - when true, item can only be dragged via ReorderableHandle */
|
|
49
|
+
dragListenerDisabled?: boolean;
|
|
50
|
+
/** Additional styles to apply while dragging (merged with default whileDrag styles) */
|
|
51
|
+
whileDrag?: TargetAndTransition;
|
|
52
|
+
/** Additional CSS classes */
|
|
53
|
+
className?: string;
|
|
54
|
+
/** Child elements */
|
|
55
|
+
children: ReactNode;
|
|
56
|
+
}
|
|
57
|
+
declare const ReorderableItem: <T>(props: ReorderableItemProps<T> & {
|
|
58
|
+
ref?: ForwardedRef<HTMLLIElement>;
|
|
59
|
+
}) => ReactElement;
|
|
60
|
+
type ReorderableHandleElement = 'button' | 'div' | 'span';
|
|
61
|
+
export interface ReorderableHandleProps {
|
|
62
|
+
/** HTML element type - defaults to 'button' */
|
|
63
|
+
as?: ReorderableHandleElement;
|
|
64
|
+
/** Disable the handle */
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
/** Accessibility label - defaults to 'Drag to reorder' */
|
|
67
|
+
'aria-label'?: string;
|
|
68
|
+
/** Additional CSS classes */
|
|
69
|
+
className?: string;
|
|
70
|
+
/** Child elements */
|
|
71
|
+
children?: ReactNode;
|
|
72
|
+
}
|
|
73
|
+
declare const ReorderableHandle: import('react').ForwardRefExoticComponent<ReorderableHandleProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
74
|
+
type ReorderableStaticItemElement = 'li' | 'div' | 'tr';
|
|
75
|
+
type ReorderableStaticItemElementMap = {
|
|
76
|
+
li: HTMLLIElement;
|
|
77
|
+
div: HTMLDivElement;
|
|
78
|
+
tr: HTMLTableRowElement;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Props for ReorderableStaticItem component.
|
|
82
|
+
*
|
|
83
|
+
* @remarks
|
|
84
|
+
* **Limitation:** ReorderableStaticItem must be placed as the first or last item
|
|
85
|
+
* in a ReorderableGroup. Placing it in the middle will cause reordering issues
|
|
86
|
+
* as Motion's Reorder API doesn't support non-contiguous reorderable items.
|
|
87
|
+
*/
|
|
88
|
+
export interface ReorderableStaticItemProps<T extends ReorderableStaticItemElement = 'li'> {
|
|
89
|
+
/** HTML element type - defaults to 'li' */
|
|
90
|
+
as?: T;
|
|
91
|
+
/** Additional CSS classes */
|
|
92
|
+
className?: string;
|
|
93
|
+
/** Child elements */
|
|
94
|
+
children: ReactNode;
|
|
95
|
+
}
|
|
96
|
+
declare const ReorderableStaticItem: <T extends ReorderableStaticItemElement = "li">(props: ReorderableStaticItemProps<T> & {
|
|
97
|
+
ref?: ForwardedRef<ReorderableStaticItemElementMap[T]>;
|
|
98
|
+
}) => ReactElement;
|
|
99
|
+
export { ReorderableGroup, ReorderableItem, ReorderableHandle, ReorderableStaticItem, useReorderableGroup, useReorderableItem, };
|
|
100
|
+
//# sourceMappingURL=Reorderable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Reorderable.d.ts","sourceRoot":"","sources":["../../../src/components/Reorderable/Reorderable.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as y, 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 I } 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);
|
|
11
|
+
if (!r)
|
|
12
|
+
throw new Error("useReorderableItem must be used within a ReorderableItem");
|
|
13
|
+
return r;
|
|
14
|
+
}, V = ({
|
|
15
|
+
values: r,
|
|
16
|
+
onReorder: s,
|
|
17
|
+
axis: l = "y",
|
|
18
|
+
as: c = "ol",
|
|
19
|
+
disabled: o = !1,
|
|
20
|
+
layoutScroll: b = !1,
|
|
21
|
+
style: w,
|
|
22
|
+
className: D,
|
|
23
|
+
children: g
|
|
24
|
+
}, n) => {
|
|
25
|
+
const m = K(), f = {
|
|
26
|
+
disabled: o,
|
|
27
|
+
values: r,
|
|
28
|
+
onReorder: o ? void 0 : s,
|
|
29
|
+
axis: l
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ u(
|
|
32
|
+
k.Provider,
|
|
33
|
+
{
|
|
34
|
+
value: f,
|
|
35
|
+
children: /* @__PURE__ */ u(
|
|
36
|
+
U,
|
|
37
|
+
{
|
|
38
|
+
ref: n,
|
|
39
|
+
axis: l,
|
|
40
|
+
values: r,
|
|
41
|
+
onReorder: o ? () => {
|
|
42
|
+
} : s,
|
|
43
|
+
as: c,
|
|
44
|
+
layoutScroll: b,
|
|
45
|
+
style: w,
|
|
46
|
+
role: "list",
|
|
47
|
+
"aria-label": m.reorderableTable.listAriaLabel,
|
|
48
|
+
className: I(D),
|
|
49
|
+
children: g
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}, Z = y(V);
|
|
55
|
+
Z.displayName = "ReorderableGroup";
|
|
56
|
+
const q = ({
|
|
57
|
+
value: r,
|
|
58
|
+
as: s = "li",
|
|
59
|
+
disabled: l = !1,
|
|
60
|
+
dragListenerDisabled: c = !1,
|
|
61
|
+
whileDrag: o,
|
|
62
|
+
className: b,
|
|
63
|
+
children: w
|
|
64
|
+
}, D) => {
|
|
65
|
+
const {
|
|
66
|
+
disabled: g,
|
|
67
|
+
values: n,
|
|
68
|
+
onReorder: m,
|
|
69
|
+
axis: f
|
|
70
|
+
} = M(), v = S(), t = l || g, a = !t && !c, R = A(
|
|
71
|
+
(d) => {
|
|
72
|
+
if (!n || !m) return;
|
|
73
|
+
const i = n.indexOf(r);
|
|
74
|
+
if (i === -1) return;
|
|
75
|
+
const e = i + d;
|
|
76
|
+
if (e < 0 || e >= n.length) return;
|
|
77
|
+
const p = [...n];
|
|
78
|
+
p.splice(i, 1), p.splice(e, 0, r), m(p);
|
|
79
|
+
},
|
|
80
|
+
[n, m, r]
|
|
81
|
+
), x = A(
|
|
82
|
+
(d) => {
|
|
83
|
+
if (!a) return;
|
|
84
|
+
const i = f === "y" ? "ArrowUp" : "ArrowLeft", e = f === "y" ? "ArrowDown" : "ArrowRight";
|
|
85
|
+
d.key === i ? (d.preventDefault(), R(-1)) : d.key === e && (d.preventDefault(), R(1));
|
|
86
|
+
},
|
|
87
|
+
[a, f, R]
|
|
88
|
+
);
|
|
89
|
+
return /* @__PURE__ */ u(
|
|
90
|
+
H.Provider,
|
|
91
|
+
{
|
|
92
|
+
value: { dragControls: v, dragListenerDisabled: c, moveItem: R },
|
|
93
|
+
children: /* @__PURE__ */ u(
|
|
94
|
+
Y,
|
|
95
|
+
{
|
|
96
|
+
ref: D,
|
|
97
|
+
value: r,
|
|
98
|
+
as: s,
|
|
99
|
+
dragControls: v,
|
|
100
|
+
dragListener: a,
|
|
101
|
+
tabIndex: a ? 0 : void 0,
|
|
102
|
+
role: "listitem",
|
|
103
|
+
"aria-disabled": t,
|
|
104
|
+
onKeyDown: x,
|
|
105
|
+
className: I(
|
|
106
|
+
a && "cursor-grab active:cursor-grabbing",
|
|
107
|
+
a && "focus-visible-default",
|
|
108
|
+
b
|
|
109
|
+
),
|
|
110
|
+
whileDrag: {
|
|
111
|
+
zIndex: z,
|
|
112
|
+
position: "relative",
|
|
113
|
+
...o
|
|
114
|
+
},
|
|
115
|
+
children: w
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
}, B = y(q);
|
|
121
|
+
B.displayName = "ReorderableItem";
|
|
122
|
+
const F = y(
|
|
123
|
+
({
|
|
124
|
+
as: r = "button",
|
|
125
|
+
disabled: s = !1,
|
|
126
|
+
"aria-label": l,
|
|
127
|
+
className: c,
|
|
128
|
+
children: o
|
|
129
|
+
}, b) => {
|
|
130
|
+
const w = K(), D = l ?? w.reorderableTable.dragHandleAriaLabel, { disabled: g, axis: n } = M(), { dragControls: m, dragListenerDisabled: f, moveItem: v } = j(), t = f && !g && !s, a = _(!1), R = (e) => {
|
|
131
|
+
if (!t) return;
|
|
132
|
+
a.current = !1;
|
|
133
|
+
const p = e.clientX, h = e.clientY, L = (G) => {
|
|
134
|
+
const T = Math.abs(G.clientX - p), X = Math.abs(G.clientY - h);
|
|
135
|
+
(T > N || X > N) && (a.current = !0);
|
|
136
|
+
}, C = () => {
|
|
137
|
+
document.removeEventListener("pointermove", L), document.removeEventListener("pointerup", C);
|
|
138
|
+
};
|
|
139
|
+
document.addEventListener("pointermove", L), document.addEventListener("pointerup", C), m.start(e);
|
|
140
|
+
}, x = (e) => {
|
|
141
|
+
a.current && (e.stopPropagation(), a.current = !1);
|
|
142
|
+
}, d = A(
|
|
143
|
+
(e) => {
|
|
144
|
+
if (!t) return;
|
|
145
|
+
const p = n === "y" ? "ArrowUp" : "ArrowLeft", h = n === "y" ? "ArrowDown" : "ArrowRight";
|
|
146
|
+
e.key === p ? (e.preventDefault(), v(-1)) : e.key === h && (e.preventDefault(), v(1));
|
|
147
|
+
},
|
|
148
|
+
[t, n, v]
|
|
149
|
+
), i = {
|
|
150
|
+
"aria-label": D,
|
|
151
|
+
"aria-roledescription": "sortable",
|
|
152
|
+
onPointerDown: R,
|
|
153
|
+
onKeyDown: d,
|
|
154
|
+
onClick: x,
|
|
155
|
+
className: I(
|
|
156
|
+
"touch-none select-none",
|
|
157
|
+
t && "cursor-grab active:cursor-grabbing",
|
|
158
|
+
!t && "cursor-default",
|
|
159
|
+
t && "focus-visible-default",
|
|
160
|
+
c
|
|
161
|
+
)
|
|
162
|
+
};
|
|
163
|
+
return r === "button" ? /* @__PURE__ */ u("button", { ref: b, type: "button", disabled: s, ...i, children: o }) : r === "div" ? /* @__PURE__ */ u(
|
|
164
|
+
"div",
|
|
165
|
+
{
|
|
166
|
+
ref: b,
|
|
167
|
+
tabIndex: t ? 0 : void 0,
|
|
168
|
+
role: t ? "button" : void 0,
|
|
169
|
+
...i,
|
|
170
|
+
children: o
|
|
171
|
+
}
|
|
172
|
+
) : /* @__PURE__ */ u(
|
|
173
|
+
"span",
|
|
174
|
+
{
|
|
175
|
+
ref: b,
|
|
176
|
+
tabIndex: t ? 0 : void 0,
|
|
177
|
+
role: t ? "button" : void 0,
|
|
178
|
+
...i,
|
|
179
|
+
children: o
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
F.displayName = "ReorderableHandle";
|
|
185
|
+
const J = ({ as: r = "li", className: s, children: l }, c) => {
|
|
186
|
+
const o = O[r];
|
|
187
|
+
return /* @__PURE__ */ u(o, { ref: c, layout: !0, role: "listitem", className: I(s), children: l });
|
|
188
|
+
}, Q = y(J);
|
|
189
|
+
Q.displayName = "ReorderableStaticItem";
|
|
190
|
+
export {
|
|
191
|
+
Z as ReorderableGroup,
|
|
192
|
+
F as ReorderableHandle,
|
|
193
|
+
B as ReorderableItem,
|
|
194
|
+
Q as ReorderableStaticItem,
|
|
195
|
+
M as useReorderableGroup,
|
|
196
|
+
j as useReorderableItem
|
|
197
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { ReorderableGroup } from './Reorderable';
|
|
3
|
+
declare const meta: Meta<typeof ReorderableGroup>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ReorderableGroup>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithHandle: Story;
|
|
8
|
+
export declare const Disabled: Story;
|
|
9
|
+
export declare const HorizontalAxis: Story;
|
|
10
|
+
export declare const TableRows: Story;
|
|
11
|
+
export declare const ScrollableList: Story;
|
|
12
|
+
export declare const ContentBlocks: Story;
|
|
13
|
+
export declare const StaticItem: Story;
|
|
14
|
+
//# sourceMappingURL=Reorderable.stories.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { ReorderableGroup, ReorderableItem, ReorderableHandle, ReorderableStaticItem, useReorderableGroup, useReorderableItem, type ReorderableGroupProps, type ReorderableItemProps, type ReorderableHandleProps, type ReorderableStaticItemProps, } from './Reorderable';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ForwardedRef, ReactNode } from 'react';
|
|
2
|
+
export interface ReorderableTableColumn<T> {
|
|
3
|
+
/** Key from data object */
|
|
4
|
+
dataKey: keyof T;
|
|
5
|
+
/** Column header text */
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
/** CSS classes for cells in this column */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Text truncation: true/1 = line-clamp-1, 2 = line-clamp-2 */
|
|
10
|
+
lineClamp?: boolean | 1 | 2;
|
|
11
|
+
/** Custom cell rendering */
|
|
12
|
+
render?: (value: T[keyof T], rowData: T, rowIndex: number) => ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export interface ReorderableTableProps<T extends {
|
|
15
|
+
id: string | number;
|
|
16
|
+
}> extends Omit<React.HTMLAttributes<HTMLTableElement>, 'children'> {
|
|
17
|
+
/** Array of data objects - each must have an `id` field */
|
|
18
|
+
data: T[];
|
|
19
|
+
/** Callback when rows are reordered */
|
|
20
|
+
onReorder: (newOrder: T[]) => void;
|
|
21
|
+
/** Column definitions */
|
|
22
|
+
columns: ReorderableTableColumn<T>[];
|
|
23
|
+
/** Show table header - defaults to false */
|
|
24
|
+
showHeader?: boolean;
|
|
25
|
+
/** Disable all reordering */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** Function to determine if a specific row is disabled */
|
|
28
|
+
isRowDisabled?: (rowData: T, rowIndex: number) => boolean;
|
|
29
|
+
/** Custom CSS classes for table container */
|
|
30
|
+
className?: string;
|
|
31
|
+
/** Show/hide drag handle column with animation - defaults to true */
|
|
32
|
+
isMovable?: boolean;
|
|
33
|
+
}
|
|
34
|
+
declare const ReorderableTable: <T extends {
|
|
35
|
+
id: string | number;
|
|
36
|
+
}>(props: ReorderableTableProps<T> & {
|
|
37
|
+
ref?: ForwardedRef<HTMLTableElement>;
|
|
38
|
+
}) => React.ReactElement;
|
|
39
|
+
export { ReorderableTable };
|
|
40
|
+
//# sourceMappingURL=ReorderableTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReorderableTable.d.ts","sourceRoot":"","sources":["../../../src/components/ReorderableTable/ReorderableTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAc,MAAM,OAAO,CAAA;AAWrE,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAC,CAAA;IAChB,yBAAyB;IACzB,KAAK,EAAE,SAAS,CAAA;IAChB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,GAAG,CAAC,GAAG,CAAC,CAAA;IAC3B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,SAAS,CAAA;CACxE;AAED,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CACtE,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAChE,2DAA2D;IAC3D,IAAI,EAAE,CAAC,EAAE,CAAA;IACT,uCAAuC;IACvC,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC,EAAE,KAAK,IAAI,CAAA;IAClC,yBAAyB;IACzB,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC,EAAE,CAAA;IACpC,4CAA4C;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,0DAA0D;IAC1D,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAA;IACzD,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,qEAAqE;IACrE,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAkND,QAAA,MAAM,gBAAgB,EAAwC,CAC5D,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,EAEjC,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,CAAA;CAAE,KACvE,KAAK,CAAC,YAAY,CACtB;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as I } from "react";
|
|
3
|
+
import { typographyVariants as T, Typography as w } from "../Typography/Typography.js";
|
|
4
|
+
import { ReorderableGroup as A, ReorderableItem as C, ReorderableHandle as H } from "../Reorderable/Reorderable.js";
|
|
5
|
+
import { Reorder as O } from "../Icons/CustomIcons.js";
|
|
6
|
+
import { cn as s } from "../../utils/cn.js";
|
|
7
|
+
import { motion as n } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
8
|
+
const p = 72, u = 20, k = 24, E = 4, D = ({
|
|
9
|
+
data: b,
|
|
10
|
+
onReorder: N,
|
|
11
|
+
columns: o,
|
|
12
|
+
showHeader: x = !1,
|
|
13
|
+
disabled: h = !1,
|
|
14
|
+
isRowDisabled: l,
|
|
15
|
+
className: y,
|
|
16
|
+
isMovable: i = !0,
|
|
17
|
+
...g
|
|
18
|
+
}, L) => /* @__PURE__ */ e("div", { className: "w-full", children: /* @__PURE__ */ m(
|
|
19
|
+
"table",
|
|
20
|
+
{
|
|
21
|
+
ref: L,
|
|
22
|
+
className: s(
|
|
23
|
+
"-my-sm w-full border-separate border-spacing-y-sm",
|
|
24
|
+
y
|
|
25
|
+
),
|
|
26
|
+
...g,
|
|
27
|
+
children: [
|
|
28
|
+
x && /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ m("tr", { children: [
|
|
29
|
+
o.map((r, d) => /* @__PURE__ */ e(
|
|
30
|
+
"th",
|
|
31
|
+
{
|
|
32
|
+
className: s(
|
|
33
|
+
T({
|
|
34
|
+
size: "sm",
|
|
35
|
+
uppercase: !0,
|
|
36
|
+
variant: "body",
|
|
37
|
+
weight: "medium"
|
|
38
|
+
}),
|
|
39
|
+
"px-comp-table-p text-left text-text-dark-secondary",
|
|
40
|
+
r.className
|
|
41
|
+
),
|
|
42
|
+
children: r.title
|
|
43
|
+
},
|
|
44
|
+
d
|
|
45
|
+
)),
|
|
46
|
+
/* @__PURE__ */ e(
|
|
47
|
+
n.th,
|
|
48
|
+
{
|
|
49
|
+
initial: !1,
|
|
50
|
+
animate: {
|
|
51
|
+
width: i ? p : u
|
|
52
|
+
},
|
|
53
|
+
transition: { duration: 0.3, ease: "easeInOut" },
|
|
54
|
+
className: "overflow-hidden"
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
] }) }),
|
|
58
|
+
/* @__PURE__ */ e(
|
|
59
|
+
A,
|
|
60
|
+
{
|
|
61
|
+
values: b,
|
|
62
|
+
onReorder: N,
|
|
63
|
+
disabled: h,
|
|
64
|
+
as: "div",
|
|
65
|
+
className: "contents",
|
|
66
|
+
children: b.map((r, d) => {
|
|
67
|
+
const _ = (l == null ? void 0 : l(r, d)) ?? !1, t = h || _;
|
|
68
|
+
return /* @__PURE__ */ m(
|
|
69
|
+
C,
|
|
70
|
+
{
|
|
71
|
+
value: r,
|
|
72
|
+
as: "tr",
|
|
73
|
+
disabled: t,
|
|
74
|
+
dragListenerDisabled: !0,
|
|
75
|
+
whileDrag: t ? void 0 : { boxShadow: "0 8px 32px 0 rgba(59, 18, 107, 0.2)" },
|
|
76
|
+
className: "group rounded-2xl",
|
|
77
|
+
children: [
|
|
78
|
+
o.map((a, c) => {
|
|
79
|
+
const v = c === 0, f = c === o.length - 1;
|
|
80
|
+
return /* @__PURE__ */ e(
|
|
81
|
+
n.td,
|
|
82
|
+
{
|
|
83
|
+
initial: !1,
|
|
84
|
+
animate: f ? {
|
|
85
|
+
paddingRight: i ? k : E
|
|
86
|
+
} : void 0,
|
|
87
|
+
transition: { duration: 0.3, ease: "easeInOut" },
|
|
88
|
+
className: s(
|
|
89
|
+
"h-comp-table-h border-y border-stroke-base-secondary bg-surface-base-primary align-middle",
|
|
90
|
+
f ? "pl-2xl" : "px-2xl",
|
|
91
|
+
{
|
|
92
|
+
"rounded-l-xl border-l": v,
|
|
93
|
+
"group-focus-within:border-icon-brand-focus group-hover:border-icon-brand-hover": !t
|
|
94
|
+
},
|
|
95
|
+
a.className
|
|
96
|
+
),
|
|
97
|
+
children: a.render ? a.render(
|
|
98
|
+
r[a.dataKey],
|
|
99
|
+
r,
|
|
100
|
+
d
|
|
101
|
+
) : /* @__PURE__ */ e(
|
|
102
|
+
w,
|
|
103
|
+
{
|
|
104
|
+
variant: "body",
|
|
105
|
+
size: "base",
|
|
106
|
+
weight: "regular",
|
|
107
|
+
component: "span",
|
|
108
|
+
className: s(
|
|
109
|
+
t && "text-text-dark-disabled",
|
|
110
|
+
{
|
|
111
|
+
"line-clamp-1": a.lineClamp === !0 || a.lineClamp === 1,
|
|
112
|
+
"line-clamp-2": a.lineClamp === 2
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
children: r[a.dataKey]
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
},
|
|
119
|
+
c
|
|
120
|
+
);
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ e(
|
|
123
|
+
n.td,
|
|
124
|
+
{
|
|
125
|
+
initial: !1,
|
|
126
|
+
animate: {
|
|
127
|
+
width: i ? p : u
|
|
128
|
+
},
|
|
129
|
+
transition: { duration: 0.3, ease: "easeInOut" },
|
|
130
|
+
className: s(
|
|
131
|
+
// min-w-[20px] matches HANDLE_COLUMN_MIN_WIDTH constant (Figma design)
|
|
132
|
+
"h-comp-table-h min-w-[20px] rounded-r-xl border-y border-r border-stroke-base-secondary bg-surface-base-primary align-middle",
|
|
133
|
+
{
|
|
134
|
+
"group-focus-within:border-icon-brand-focus group-hover:border-icon-brand-hover": !t
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
children: /* @__PURE__ */ e(
|
|
138
|
+
n.div,
|
|
139
|
+
{
|
|
140
|
+
initial: !1,
|
|
141
|
+
animate: {
|
|
142
|
+
opacity: i ? 1 : 0,
|
|
143
|
+
width: i ? p : 0
|
|
144
|
+
},
|
|
145
|
+
transition: { duration: 0.3, ease: "easeInOut" },
|
|
146
|
+
className: "flex h-full items-center justify-center overflow-hidden border-l border-stroke-base-secondary",
|
|
147
|
+
children: /* @__PURE__ */ e(
|
|
148
|
+
H,
|
|
149
|
+
{
|
|
150
|
+
disabled: !i || t,
|
|
151
|
+
className: s(
|
|
152
|
+
"flex h-comp-button-h-sm w-comp-button-w-sm items-center justify-center focus-visible-default",
|
|
153
|
+
t ? "text-text-dark-disabled" : "text-text-brand-def"
|
|
154
|
+
),
|
|
155
|
+
children: /* @__PURE__ */ e(O, { className: "size-icon-default" })
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
r.id
|
|
165
|
+
);
|
|
166
|
+
})
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
) }), R = I(D);
|
|
172
|
+
R.displayName = "ReorderableTable";
|
|
173
|
+
export {
|
|
174
|
+
R as ReorderableTable
|
|
175
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { ReorderableTable } from './ReorderableTable';
|
|
3
|
+
interface IBenefit {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
image: string;
|
|
7
|
+
lastEdited: string;
|
|
8
|
+
text: string;
|
|
9
|
+
status: 'active' | 'inactive';
|
|
10
|
+
}
|
|
11
|
+
declare const meta: Meta<typeof ReorderableTable>;
|
|
12
|
+
export default meta;
|
|
13
|
+
type Story = StoryObj<typeof ReorderableTable<IBenefit>>;
|
|
14
|
+
export declare const Default: Story;
|
|
15
|
+
export declare const WithoutHeader: Story;
|
|
16
|
+
export declare const WithDisabledRow: Story;
|
|
17
|
+
export declare const FullyDisabled: Story;
|
|
18
|
+
//# sourceMappingURL=ReorderableTable.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReorderableTable.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ReorderableTable/ReorderableTable.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAM3D,OAAO,EACL,gBAAgB,EAEjB,MAAM,oBAAoB,CAAA;AAE3B,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,QAAQ,GAAG,UAAU,CAAA;CAC9B;AAyCD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,gBAAgB,CA6DvC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAA;AAExD,eAAO,MAAM,OAAO,EAAE,KAkHrB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAsG3B,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KA2G7B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAkG3B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ReorderableTable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAA"}
|
|
@@ -9,6 +9,6 @@ export interface SearchbarProps extends Omit<InputProps, 'type' | 'onSubmit' | '
|
|
|
9
9
|
searchButtonAriaLabel?: string;
|
|
10
10
|
onSubmit?: (e: React.FormEvent<HTMLFormElement>) => void;
|
|
11
11
|
}
|
|
12
|
-
declare const Searchbar: ({ className, error, size, showButtons, clearButtonAriaLabel, searchButtonAriaLabel, disabled, value, defaultValue, name, placeholder, onChange, onSubmit, ...props }: SearchbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const Searchbar: ({ className, error, size, showButtons, clearButtonAriaLabel: clearButtonAriaLabelProp, searchButtonAriaLabel: searchButtonAriaLabelProp, disabled, value, defaultValue, name, placeholder, onChange, onSubmit, ...props }: SearchbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export { Searchbar };
|
|
14
14
|
//# sourceMappingURL=Searchbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Searchbar.d.ts","sourceRoot":"","sources":["../../../src/components/Searchbar/Searchbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Searchbar.d.ts","sourceRoot":"","sources":["../../../src/components/Searchbar/Searchbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,UAAU,CAAA;AAEjD,MAAM,WAAW,cACf,SAAQ,IAAI,CACV,UAAU,EACV,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,cAAc,GAAG,QAAQ,CAC1D;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAA;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,IAAI,CAAA;CACzD;AAED,QAAA,MAAM,SAAS,GAAI,2NAehB,cAAc,4CAuGhB,CAAA;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
|