sander-ui 0.1.3 → 0.1.4
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.css +1 -1
- package/dist/index.js +75 -1611
- package/dist/index10.js +39 -0
- package/dist/index11.js +24 -0
- package/dist/index12.js +79 -0
- package/dist/index13.js +172 -0
- package/dist/index14.js +25 -0
- package/dist/index15.js +22 -0
- package/dist/index16.js +77 -0
- package/dist/index17.js +64 -0
- package/dist/index18.js +43 -0
- package/dist/index19.js +34 -0
- package/dist/index20.js +29 -0
- package/dist/index21.js +21 -0
- package/dist/index22.js +42 -0
- package/dist/index23.js +49 -0
- package/dist/index24.js +134 -0
- package/dist/index25.js +20 -0
- package/dist/index26.js +25 -0
- package/dist/index27.js +57 -0
- package/dist/index28.js +21 -0
- package/dist/index29.js +48 -0
- package/dist/index3.js +67 -0
- package/dist/index30.js +7 -0
- package/dist/index31.js +19 -0
- package/dist/index32.js +10 -0
- package/dist/index33.js +6 -0
- package/dist/index34.js +29 -0
- package/dist/index35.js +28 -0
- package/dist/index36.js +21 -0
- package/dist/index37.js +25 -0
- package/dist/index38.js +10 -0
- package/dist/index39.js +16 -0
- package/dist/index4.js +50 -0
- package/dist/index40.js +10 -0
- package/dist/index41.js +9 -0
- package/dist/index42.js +9 -0
- package/dist/index43.js +28 -0
- package/dist/index44.js +15 -0
- package/dist/index45.js +42 -0
- package/dist/index46.js +25 -0
- package/dist/index47.js +29 -0
- package/dist/index48.js +15 -0
- package/dist/index49.js +23 -0
- package/dist/index5.js +62 -0
- package/dist/index50.js +17 -0
- package/dist/index51.js +6 -0
- package/dist/index52.js +19 -0
- package/dist/index53.js +28 -0
- package/dist/index54.js +17 -0
- package/dist/index55.js +15 -0
- package/dist/index56.js +44 -0
- package/dist/index57.js +6 -0
- package/dist/index58.js +19 -0
- package/dist/index59.js +19 -0
- package/dist/index6.js +42 -0
- package/dist/index60.js +25 -0
- package/dist/index61.js +23 -0
- package/dist/index62.js +19 -0
- package/dist/index63.js +15 -0
- package/dist/index64.js +33 -0
- package/dist/index65.js +37 -0
- package/dist/index66.js +4 -0
- package/dist/index67.js +6 -0
- package/dist/index68.js +23 -0
- package/dist/index69.js +4 -0
- package/dist/index7.js +44 -0
- package/dist/index70.js +4 -0
- package/dist/index71.js +8 -0
- package/dist/index72.js +36 -0
- package/dist/index73.js +14 -0
- package/dist/index74.js +9 -0
- package/dist/index75.js +7 -0
- package/dist/index8.js +30 -0
- package/dist/index9.js +41 -0
- package/package.json +1 -1
package/dist/index10.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs as f, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import p from "./index30.js";
|
|
3
|
+
import { forwardRef as x, useRef as v, useEffect as N } from "react";
|
|
4
|
+
import e from "./index62.js";
|
|
5
|
+
const y = x(
|
|
6
|
+
({ label: l, description: t, error: c, indeterminate: a, id: o, className: h, ...u }, i) => {
|
|
7
|
+
const n = v(null);
|
|
8
|
+
N(() => {
|
|
9
|
+
const r = n.current;
|
|
10
|
+
r && (r.indeterminate = !!a);
|
|
11
|
+
}, [a]);
|
|
12
|
+
const d = c ? `${o}-error` : void 0, m = t ? `${o}-description` : void 0, b = [m, d].filter(Boolean).join(" ") || void 0;
|
|
13
|
+
return /* @__PURE__ */ f("div", { className: p(e.wrapper, h), children: [
|
|
14
|
+
/* @__PURE__ */ f("div", { className: e.row, children: [
|
|
15
|
+
/* @__PURE__ */ s(
|
|
16
|
+
"input",
|
|
17
|
+
{
|
|
18
|
+
id: o,
|
|
19
|
+
ref: (r) => {
|
|
20
|
+
n.current = r, typeof i == "function" ? i(r) : i && (i.current = r);
|
|
21
|
+
},
|
|
22
|
+
type: "checkbox",
|
|
23
|
+
"aria-invalid": c ? !0 : void 0,
|
|
24
|
+
"aria-describedby": b,
|
|
25
|
+
className: p(e.checkbox, c && e.checkboxError),
|
|
26
|
+
...u
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
l && /* @__PURE__ */ s("label", { htmlFor: o, className: e.label, children: l })
|
|
30
|
+
] }),
|
|
31
|
+
t && /* @__PURE__ */ s("p", { id: m, className: e.description, children: t }),
|
|
32
|
+
c && /* @__PURE__ */ s("p", { id: d, className: e.error, role: "alert", children: c })
|
|
33
|
+
] });
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
y.displayName = "Checkbox";
|
|
37
|
+
export {
|
|
38
|
+
y as Checkbox
|
|
39
|
+
};
|
package/dist/index11.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsxs as e, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Modal as s, ModalHeader as f, ModalBody as u, ModalFooter as M } from "./index16.js";
|
|
3
|
+
import { Button as d } from "./index8.js";
|
|
4
|
+
const b = ({
|
|
5
|
+
open: i,
|
|
6
|
+
onClose: o,
|
|
7
|
+
onConfirm: a,
|
|
8
|
+
title: l = "Are you sure?",
|
|
9
|
+
description: t = "This action cannot be undone.",
|
|
10
|
+
confirmLabel: c = "Confirm",
|
|
11
|
+
cancelLabel: h = "Cancel",
|
|
12
|
+
variant: m = "danger",
|
|
13
|
+
loading: n = !1
|
|
14
|
+
}) => /* @__PURE__ */ e(s, { open: i, onClose: o, children: [
|
|
15
|
+
/* @__PURE__ */ r(f, { onClose: o, children: l }),
|
|
16
|
+
/* @__PURE__ */ r(u, { children: t }),
|
|
17
|
+
/* @__PURE__ */ e(M, { children: [
|
|
18
|
+
/* @__PURE__ */ r(d, { variant: "ghost", onClick: o, disabled: n, children: h }),
|
|
19
|
+
/* @__PURE__ */ r(d, { variant: m, onClick: a, loading: n, children: c })
|
|
20
|
+
] })
|
|
21
|
+
] });
|
|
22
|
+
export {
|
|
23
|
+
b as ConfirmModal
|
|
24
|
+
};
|
package/dist/index12.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as l, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import n from "./index30.js";
|
|
3
|
+
import { useRef as v, useState as d, useEffect as g } from "react";
|
|
4
|
+
import { createPortal as w } from "react-dom";
|
|
5
|
+
import r from "./index45.js";
|
|
6
|
+
import D from "./index42.js";
|
|
7
|
+
const B = ({
|
|
8
|
+
open: s,
|
|
9
|
+
onClose: t,
|
|
10
|
+
children: o,
|
|
11
|
+
side: c = "right",
|
|
12
|
+
size: h = "md",
|
|
13
|
+
className: p,
|
|
14
|
+
...N
|
|
15
|
+
}) => {
|
|
16
|
+
const a = v(null), [f, m] = d(!1), [i, u] = d(!1);
|
|
17
|
+
return g(() => {
|
|
18
|
+
s ? (m(!0), u(!1)) : m((e) => (e && u(!0), e));
|
|
19
|
+
}, [s]), g(() => {
|
|
20
|
+
const e = a.current;
|
|
21
|
+
f && !i && e && !e.open && e.showModal();
|
|
22
|
+
}, [f, i]), f ? w(
|
|
23
|
+
/* @__PURE__ */ l(
|
|
24
|
+
"dialog",
|
|
25
|
+
{
|
|
26
|
+
ref: a,
|
|
27
|
+
className: n(
|
|
28
|
+
r.dialog,
|
|
29
|
+
r[c],
|
|
30
|
+
r[`size-${h}`],
|
|
31
|
+
i && r.closing,
|
|
32
|
+
p
|
|
33
|
+
),
|
|
34
|
+
onAnimationEnd: () => {
|
|
35
|
+
i && (a.current?.close(), m(!1), u(!1));
|
|
36
|
+
},
|
|
37
|
+
onCancel: (e) => {
|
|
38
|
+
e.preventDefault(), t();
|
|
39
|
+
},
|
|
40
|
+
onClick: (e) => {
|
|
41
|
+
e.target === a.current && t();
|
|
42
|
+
},
|
|
43
|
+
...N,
|
|
44
|
+
children: /* @__PURE__ */ l("div", { className: r.content, children: o })
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
document.body
|
|
48
|
+
) : null;
|
|
49
|
+
}, E = ({
|
|
50
|
+
children: s,
|
|
51
|
+
onClose: t,
|
|
52
|
+
className: o,
|
|
53
|
+
...c
|
|
54
|
+
}) => /* @__PURE__ */ b("div", { className: n(r.header, o), ...c, children: [
|
|
55
|
+
/* @__PURE__ */ l("h2", { className: r.title, children: s }),
|
|
56
|
+
t && /* @__PURE__ */ l(
|
|
57
|
+
"button",
|
|
58
|
+
{
|
|
59
|
+
onClick: t,
|
|
60
|
+
"aria-label": "Close",
|
|
61
|
+
className: r.closeButton,
|
|
62
|
+
children: /* @__PURE__ */ l(D, { size: 20 })
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
] }), R = ({
|
|
66
|
+
children: s,
|
|
67
|
+
className: t,
|
|
68
|
+
...o
|
|
69
|
+
}) => /* @__PURE__ */ l("div", { className: n(r.body, t), ...o, children: s }), A = ({
|
|
70
|
+
children: s,
|
|
71
|
+
className: t,
|
|
72
|
+
...o
|
|
73
|
+
}) => /* @__PURE__ */ l("div", { className: n(r.footer, t), ...o, children: s });
|
|
74
|
+
export {
|
|
75
|
+
B as Drawer,
|
|
76
|
+
R as DrawerBody,
|
|
77
|
+
A as DrawerFooter,
|
|
78
|
+
E as DrawerHeader
|
|
79
|
+
};
|
package/dist/index13.js
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { jsx as w } from "react/jsx-runtime";
|
|
2
|
+
import b from "./index30.js";
|
|
3
|
+
import { useState as h, useRef as v, useId as R, useEffect as k, cloneElement as E, createContext as I, useContext as y } from "react";
|
|
4
|
+
import m from "./index36.js";
|
|
5
|
+
const C = I(null);
|
|
6
|
+
function x() {
|
|
7
|
+
const t = y(C);
|
|
8
|
+
if (!t)
|
|
9
|
+
throw new Error("Dropdown components must be used within <Dropdown>");
|
|
10
|
+
return t;
|
|
11
|
+
}
|
|
12
|
+
const L = ({ children: t }) => {
|
|
13
|
+
const [i, r] = h(!1), [c, a] = h(!1), u = v(null), f = v(null), g = v([]), e = v(0), l = v(null), n = R(), D = (s) => {
|
|
14
|
+
l.current = s, r(!0), a(!1);
|
|
15
|
+
}, o = (s = !0) => {
|
|
16
|
+
a(!0), s && u.current?.focus();
|
|
17
|
+
}, d = v(o);
|
|
18
|
+
return d.current = o, k(() => {
|
|
19
|
+
if (!i || c) return;
|
|
20
|
+
function s(p) {
|
|
21
|
+
f.current && !f.current.contains(p.target) && d.current(!1);
|
|
22
|
+
}
|
|
23
|
+
return document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s);
|
|
24
|
+
}, [i, c]), /* @__PURE__ */ w(
|
|
25
|
+
C.Provider,
|
|
26
|
+
{
|
|
27
|
+
value: {
|
|
28
|
+
visible: i,
|
|
29
|
+
closing: c,
|
|
30
|
+
menuId: n,
|
|
31
|
+
triggerRef: u,
|
|
32
|
+
openMenu: D,
|
|
33
|
+
closeMenu: o,
|
|
34
|
+
setVisible: r,
|
|
35
|
+
setClosing: a,
|
|
36
|
+
itemRefs: g,
|
|
37
|
+
itemCount: e,
|
|
38
|
+
pendingFocusIndex: l
|
|
39
|
+
},
|
|
40
|
+
children: /* @__PURE__ */ w("div", { ref: f, className: m.wrapper, children: t })
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}, P = ({
|
|
44
|
+
asChild: t,
|
|
45
|
+
children: i
|
|
46
|
+
}) => {
|
|
47
|
+
const { visible: r, menuId: c, triggerRef: a, openMenu: u, closeMenu: f } = x(), l = {
|
|
48
|
+
ref: (n) => {
|
|
49
|
+
a.current = n;
|
|
50
|
+
},
|
|
51
|
+
"aria-haspopup": "menu",
|
|
52
|
+
"aria-expanded": r,
|
|
53
|
+
"aria-controls": r ? c : void 0,
|
|
54
|
+
onClick: () => r ? f() : u(0),
|
|
55
|
+
onKeyDown: (n) => {
|
|
56
|
+
switch (n.key) {
|
|
57
|
+
case "ArrowDown":
|
|
58
|
+
case "Enter":
|
|
59
|
+
case " ":
|
|
60
|
+
n.preventDefault(), u(0);
|
|
61
|
+
break;
|
|
62
|
+
case "ArrowUp":
|
|
63
|
+
n.preventDefault(), u(-1);
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
return t ? E(i, l) : /* @__PURE__ */ w("button", { ...l, className: m.trigger, children: i });
|
|
69
|
+
}, B = ({
|
|
70
|
+
align: t = "right",
|
|
71
|
+
children: i
|
|
72
|
+
}) => {
|
|
73
|
+
const {
|
|
74
|
+
visible: r,
|
|
75
|
+
closing: c,
|
|
76
|
+
menuId: a,
|
|
77
|
+
closeMenu: u,
|
|
78
|
+
setVisible: f,
|
|
79
|
+
setClosing: g,
|
|
80
|
+
itemRefs: e,
|
|
81
|
+
itemCount: l,
|
|
82
|
+
pendingFocusIndex: n
|
|
83
|
+
} = x();
|
|
84
|
+
l.current = 0, e.current = [], k(() => {
|
|
85
|
+
if (!r || c || n.current === null) return;
|
|
86
|
+
const o = n.current;
|
|
87
|
+
n.current = null;
|
|
88
|
+
const d = e.current.filter(Boolean), s = o < 0 ? d.length + o : o;
|
|
89
|
+
d[s]?.focus();
|
|
90
|
+
}, [r, c, e, n]);
|
|
91
|
+
const D = (o) => {
|
|
92
|
+
const d = e.current.findIndex(
|
|
93
|
+
(p) => p === document.activeElement
|
|
94
|
+
), s = e.current.filter(Boolean).length;
|
|
95
|
+
switch (o.key) {
|
|
96
|
+
case "ArrowDown": {
|
|
97
|
+
o.preventDefault();
|
|
98
|
+
const p = (d + 1) % s;
|
|
99
|
+
e.current[p]?.focus();
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
case "ArrowUp": {
|
|
103
|
+
o.preventDefault();
|
|
104
|
+
const p = (d - 1 + s) % s;
|
|
105
|
+
e.current[p]?.focus();
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
case "Home":
|
|
109
|
+
o.preventDefault(), e.current[0]?.focus();
|
|
110
|
+
break;
|
|
111
|
+
case "End":
|
|
112
|
+
o.preventDefault(), e.current[s - 1]?.focus();
|
|
113
|
+
break;
|
|
114
|
+
case "Escape":
|
|
115
|
+
case "Tab":
|
|
116
|
+
u();
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
return r ? /* @__PURE__ */ w(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
id: a,
|
|
124
|
+
role: "menu",
|
|
125
|
+
onKeyDown: D,
|
|
126
|
+
onAnimationEnd: () => {
|
|
127
|
+
c && (f(!1), g(!1));
|
|
128
|
+
},
|
|
129
|
+
className: b(
|
|
130
|
+
m.menu,
|
|
131
|
+
t === "right" ? m.alignRight : m.alignLeft,
|
|
132
|
+
c && m.closing
|
|
133
|
+
),
|
|
134
|
+
children: i
|
|
135
|
+
}
|
|
136
|
+
) : null;
|
|
137
|
+
}, F = ({
|
|
138
|
+
children: t,
|
|
139
|
+
onClick: i,
|
|
140
|
+
href: r,
|
|
141
|
+
className: c,
|
|
142
|
+
...a
|
|
143
|
+
}) => {
|
|
144
|
+
const { closeMenu: u, itemRefs: f, itemCount: g } = x(), e = g.current++, l = {
|
|
145
|
+
ref: (n) => {
|
|
146
|
+
f.current[e] = n;
|
|
147
|
+
},
|
|
148
|
+
role: "menuitem",
|
|
149
|
+
tabIndex: -1,
|
|
150
|
+
className: b(m.item, c)
|
|
151
|
+
};
|
|
152
|
+
return r ? /* @__PURE__ */ w("a", { ...l, ...a, href: r, onClick: () => u(!1), children: t }) : /* @__PURE__ */ w(
|
|
153
|
+
"button",
|
|
154
|
+
{
|
|
155
|
+
...l,
|
|
156
|
+
...a,
|
|
157
|
+
onClick: () => {
|
|
158
|
+
u(!1), i?.();
|
|
159
|
+
},
|
|
160
|
+
children: t
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
}, S = ({
|
|
164
|
+
className: t
|
|
165
|
+
}) => /* @__PURE__ */ w("div", { role: "separator", className: b(m.divider, t) });
|
|
166
|
+
export {
|
|
167
|
+
L as Dropdown,
|
|
168
|
+
B as DropdownContent,
|
|
169
|
+
F as DropdownItem,
|
|
170
|
+
S as DropdownSeparator,
|
|
171
|
+
P as DropdownTrigger
|
|
172
|
+
};
|
package/dist/index14.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsxs as m, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import p from "./index30.js";
|
|
3
|
+
import { forwardRef as n } from "react";
|
|
4
|
+
import a from "./index44.js";
|
|
5
|
+
const c = n(
|
|
6
|
+
({ label: s, error: r, id: e, className: t, ...l }, o) => /* @__PURE__ */ m("div", { className: a.wrapper, children: [
|
|
7
|
+
s && /* @__PURE__ */ i("label", { htmlFor: e, className: a.label, children: s }),
|
|
8
|
+
/* @__PURE__ */ i(
|
|
9
|
+
"input",
|
|
10
|
+
{
|
|
11
|
+
id: e,
|
|
12
|
+
ref: o,
|
|
13
|
+
"aria-invalid": r ? !0 : void 0,
|
|
14
|
+
"aria-describedby": r ? `${e}-error` : void 0,
|
|
15
|
+
className: p(a.input, r && a.inputError, t),
|
|
16
|
+
...l
|
|
17
|
+
}
|
|
18
|
+
),
|
|
19
|
+
r && /* @__PURE__ */ i("p", { id: `${e}-error`, role: "alert", className: a.error, children: r })
|
|
20
|
+
] })
|
|
21
|
+
);
|
|
22
|
+
c.displayName = "Input";
|
|
23
|
+
export {
|
|
24
|
+
c as Input
|
|
25
|
+
};
|
package/dist/index15.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import a from "./index30.js";
|
|
3
|
+
import r from "./index47.js";
|
|
4
|
+
const u = ({
|
|
5
|
+
variant: t = "primary",
|
|
6
|
+
size: o = "md",
|
|
7
|
+
children: m,
|
|
8
|
+
className: n,
|
|
9
|
+
href: s,
|
|
10
|
+
...i
|
|
11
|
+
}) => /* @__PURE__ */ p(
|
|
12
|
+
"a",
|
|
13
|
+
{
|
|
14
|
+
href: s,
|
|
15
|
+
className: a(r.button, r[t], r[o], n),
|
|
16
|
+
...i,
|
|
17
|
+
children: m
|
|
18
|
+
}
|
|
19
|
+
);
|
|
20
|
+
export {
|
|
21
|
+
u as LinkButton
|
|
22
|
+
};
|
package/dist/index16.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx as l, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import i from "./index30.js";
|
|
3
|
+
import { useRef as h, useState as u, useEffect as g } from "react";
|
|
4
|
+
import { createPortal as v } from "react-dom";
|
|
5
|
+
import o from "./index43.js";
|
|
6
|
+
import M from "./index42.js";
|
|
7
|
+
const B = ({
|
|
8
|
+
open: s,
|
|
9
|
+
onClose: t,
|
|
10
|
+
children: r,
|
|
11
|
+
size: c = "sm",
|
|
12
|
+
className: p,
|
|
13
|
+
...N
|
|
14
|
+
}) => {
|
|
15
|
+
const a = h(null), [f, d] = u(!1), [n, m] = u(!1);
|
|
16
|
+
return g(() => {
|
|
17
|
+
s ? (d(!0), m(!1)) : d((e) => (e && m(!0), e));
|
|
18
|
+
}, [s]), g(() => {
|
|
19
|
+
const e = a.current;
|
|
20
|
+
f && !n && e && !e.open && e.showModal();
|
|
21
|
+
}, [f, n]), f ? v(
|
|
22
|
+
/* @__PURE__ */ l(
|
|
23
|
+
"dialog",
|
|
24
|
+
{
|
|
25
|
+
ref: a,
|
|
26
|
+
className: i(
|
|
27
|
+
o.dialog,
|
|
28
|
+
o[`size-${c}`],
|
|
29
|
+
n && o.closing,
|
|
30
|
+
p
|
|
31
|
+
),
|
|
32
|
+
onAnimationEnd: () => {
|
|
33
|
+
n && (a.current?.close(), d(!1), m(!1));
|
|
34
|
+
},
|
|
35
|
+
onCancel: (e) => {
|
|
36
|
+
e.preventDefault(), t();
|
|
37
|
+
},
|
|
38
|
+
onClick: (e) => {
|
|
39
|
+
e.target === a.current && t();
|
|
40
|
+
},
|
|
41
|
+
...N,
|
|
42
|
+
children: /* @__PURE__ */ l("div", { className: o.content, children: r })
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
document.body
|
|
46
|
+
) : null;
|
|
47
|
+
}, E = ({
|
|
48
|
+
children: s,
|
|
49
|
+
onClose: t,
|
|
50
|
+
className: r,
|
|
51
|
+
...c
|
|
52
|
+
}) => /* @__PURE__ */ b("div", { className: i(o.header, r), ...c, children: [
|
|
53
|
+
/* @__PURE__ */ l("h2", { className: o.title, children: s }),
|
|
54
|
+
t && /* @__PURE__ */ l(
|
|
55
|
+
"button",
|
|
56
|
+
{
|
|
57
|
+
onClick: t,
|
|
58
|
+
"aria-label": "Close",
|
|
59
|
+
className: o.closeButton,
|
|
60
|
+
children: /* @__PURE__ */ l(M, { size: 20 })
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
] }), R = ({
|
|
64
|
+
children: s,
|
|
65
|
+
className: t,
|
|
66
|
+
...r
|
|
67
|
+
}) => /* @__PURE__ */ l("div", { className: i(o.body, t), ...r, children: s }), w = ({
|
|
68
|
+
children: s,
|
|
69
|
+
className: t,
|
|
70
|
+
...r
|
|
71
|
+
}) => /* @__PURE__ */ l("div", { className: i(o.footer, t), ...r, children: s });
|
|
72
|
+
export {
|
|
73
|
+
B as Modal,
|
|
74
|
+
R as ModalBody,
|
|
75
|
+
w as ModalFooter,
|
|
76
|
+
E as ModalHeader
|
|
77
|
+
};
|
package/dist/index17.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsxs as f, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import u from "./index30.js";
|
|
3
|
+
import n from "./index50.js";
|
|
4
|
+
import h from "./index51.js";
|
|
5
|
+
import d from "./index33.js";
|
|
6
|
+
function b(i, r, a) {
|
|
7
|
+
const s = [], c = Math.max(2, i - a), t = Math.min(r - 1, i + a);
|
|
8
|
+
s.push(1), c > 2 && s.push("ellipsis");
|
|
9
|
+
for (let o = c; o <= t; o++)
|
|
10
|
+
s.push(o);
|
|
11
|
+
return t < r - 1 && s.push("ellipsis"), r > 1 && s.push(r), s;
|
|
12
|
+
}
|
|
13
|
+
const j = ({
|
|
14
|
+
page: i,
|
|
15
|
+
totalPages: r,
|
|
16
|
+
onChange: a,
|
|
17
|
+
siblings: s = 1,
|
|
18
|
+
className: c,
|
|
19
|
+
...t
|
|
20
|
+
}) => {
|
|
21
|
+
if (r <= 1) return null;
|
|
22
|
+
const o = b(i, r, s);
|
|
23
|
+
return /* @__PURE__ */ f("nav", { "aria-label": "Pagination", className: u(n.pagination, c), ...t, children: [
|
|
24
|
+
/* @__PURE__ */ e(
|
|
25
|
+
"button",
|
|
26
|
+
{
|
|
27
|
+
"aria-label": "Previous page",
|
|
28
|
+
disabled: i <= 1,
|
|
29
|
+
onClick: () => a(i - 1),
|
|
30
|
+
className: n.arrow,
|
|
31
|
+
children: /* @__PURE__ */ e(h, { className: n.icon })
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
o.map((l, m) => {
|
|
35
|
+
if (l === "ellipsis")
|
|
36
|
+
return /* @__PURE__ */ e("span", { className: n.ellipsis, children: "..." }, `ellipsis-${m}`);
|
|
37
|
+
const p = l === i;
|
|
38
|
+
return /* @__PURE__ */ e(
|
|
39
|
+
"button",
|
|
40
|
+
{
|
|
41
|
+
"aria-label": `Page ${l}`,
|
|
42
|
+
"aria-current": p ? "page" : void 0,
|
|
43
|
+
onClick: () => a(l),
|
|
44
|
+
className: u(n.page, p && n.active),
|
|
45
|
+
children: l
|
|
46
|
+
},
|
|
47
|
+
l
|
|
48
|
+
);
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ e(
|
|
51
|
+
"button",
|
|
52
|
+
{
|
|
53
|
+
"aria-label": "Next page",
|
|
54
|
+
disabled: i >= r,
|
|
55
|
+
onClick: () => a(i + 1),
|
|
56
|
+
className: n.arrow,
|
|
57
|
+
children: /* @__PURE__ */ e(d, { className: n.icon })
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
] });
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
j as Pagination
|
|
64
|
+
};
|
package/dist/index18.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import o from "./index30.js";
|
|
3
|
+
import r from "./index46.js";
|
|
4
|
+
const N = ({
|
|
5
|
+
value: e,
|
|
6
|
+
max: d = 100,
|
|
7
|
+
label: s,
|
|
8
|
+
size: c = "md",
|
|
9
|
+
className: l,
|
|
10
|
+
...m
|
|
11
|
+
}) => {
|
|
12
|
+
const a = e === void 0, t = a ? 0 : Math.round(e / d * 100);
|
|
13
|
+
return /* @__PURE__ */ i("div", { className: o(r.wrapper, l), ...m, children: [
|
|
14
|
+
s && /* @__PURE__ */ i("div", { className: r.header, children: [
|
|
15
|
+
/* @__PURE__ */ n("span", { className: r.label, children: s }),
|
|
16
|
+
!a && /* @__PURE__ */ i("span", { className: r.value, children: [
|
|
17
|
+
t,
|
|
18
|
+
"%"
|
|
19
|
+
] })
|
|
20
|
+
] }),
|
|
21
|
+
/* @__PURE__ */ n(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
role: "progressbar",
|
|
25
|
+
"aria-valuenow": a ? void 0 : e,
|
|
26
|
+
"aria-valuemin": 0,
|
|
27
|
+
"aria-valuemax": d,
|
|
28
|
+
"aria-label": s || "Progress",
|
|
29
|
+
className: o(r.track, r[c]),
|
|
30
|
+
children: /* @__PURE__ */ n(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: o(r.bar, a && r.indeterminate),
|
|
34
|
+
style: a ? void 0 : { width: `${t}%` }
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
] });
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
N as Progress
|
|
43
|
+
};
|
package/dist/index19.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs as d, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import c from "./index30.js";
|
|
3
|
+
import { forwardRef as h } from "react";
|
|
4
|
+
import a from "./index60.js";
|
|
5
|
+
const v = h(
|
|
6
|
+
({ label: i, error: s, options: m, value: n, onChange: o, name: r, className: p, ...t }, u) => /* @__PURE__ */ d("fieldset", { className: c(a.fieldset, p), children: [
|
|
7
|
+
i && /* @__PURE__ */ l("legend", { className: a.legend, children: i }),
|
|
8
|
+
/* @__PURE__ */ l("div", { className: a.options, children: m.map((e) => /* @__PURE__ */ d("label", { className: a.option, children: [
|
|
9
|
+
/* @__PURE__ */ l(
|
|
10
|
+
"input",
|
|
11
|
+
{
|
|
12
|
+
ref: u,
|
|
13
|
+
type: "radio",
|
|
14
|
+
name: r,
|
|
15
|
+
value: e.value,
|
|
16
|
+
checked: n === e.value,
|
|
17
|
+
onChange: () => o?.(e.value),
|
|
18
|
+
"aria-describedby": e.description ? `${r}-${e.value}-description` : void 0,
|
|
19
|
+
className: c(a.radio, s && a.radioError),
|
|
20
|
+
...t
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
/* @__PURE__ */ d("div", { className: a.labels, children: [
|
|
24
|
+
/* @__PURE__ */ l("span", { className: a.label, children: e.label }),
|
|
25
|
+
e.description && /* @__PURE__ */ l("span", { id: `${r}-${e.value}-description`, className: a.description, children: e.description })
|
|
26
|
+
] })
|
|
27
|
+
] }, e.value)) }),
|
|
28
|
+
s && /* @__PURE__ */ l("p", { role: "alert", className: a.error, children: s })
|
|
29
|
+
] })
|
|
30
|
+
);
|
|
31
|
+
v.displayName = "RadioGroup";
|
|
32
|
+
export {
|
|
33
|
+
v as RadioGroup
|
|
34
|
+
};
|
package/dist/index20.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsxs as t, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import p from "./index30.js";
|
|
3
|
+
import { forwardRef as v } from "react";
|
|
4
|
+
import l from "./index63.js";
|
|
5
|
+
const u = v(
|
|
6
|
+
({ label: i, error: e, id: r, options: m, placeholder: c, className: o, ...d }, n) => /* @__PURE__ */ t("div", { className: l.wrapper, children: [
|
|
7
|
+
i && /* @__PURE__ */ a("label", { htmlFor: r, className: l.label, children: i }),
|
|
8
|
+
/* @__PURE__ */ t(
|
|
9
|
+
"select",
|
|
10
|
+
{
|
|
11
|
+
id: r,
|
|
12
|
+
ref: n,
|
|
13
|
+
"aria-invalid": e ? !0 : void 0,
|
|
14
|
+
"aria-describedby": e ? `${r}-error` : void 0,
|
|
15
|
+
className: p(l.select, e && l.selectError, o),
|
|
16
|
+
...d,
|
|
17
|
+
children: [
|
|
18
|
+
c && /* @__PURE__ */ a("option", { value: "", disabled: !0, children: c }),
|
|
19
|
+
m.map((s) => /* @__PURE__ */ a("option", { value: s.value, children: s.label }, s.value))
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
e && /* @__PURE__ */ a("p", { id: `${r}-error`, role: "alert", className: l.error, children: e })
|
|
24
|
+
] })
|
|
25
|
+
);
|
|
26
|
+
u.displayName = "Select";
|
|
27
|
+
export {
|
|
28
|
+
u as Select
|
|
29
|
+
};
|
package/dist/index21.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import n from "./index30.js";
|
|
3
|
+
import t from "./index55.js";
|
|
4
|
+
const c = ({
|
|
5
|
+
width: e,
|
|
6
|
+
height: r,
|
|
7
|
+
variant: o = "text",
|
|
8
|
+
className: s,
|
|
9
|
+
...m
|
|
10
|
+
}) => /* @__PURE__ */ i(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
"aria-hidden": "true",
|
|
14
|
+
className: n(t.skeleton, t[o], s),
|
|
15
|
+
style: { width: e, height: r },
|
|
16
|
+
...m
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
export {
|
|
20
|
+
c as Skeleton
|
|
21
|
+
};
|
package/dist/index22.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import i from "./index30.js";
|
|
3
|
+
import r from "./index59.js";
|
|
4
|
+
const m = ({
|
|
5
|
+
size: s = "md",
|
|
6
|
+
className: n,
|
|
7
|
+
...o
|
|
8
|
+
}) => /* @__PURE__ */ t(
|
|
9
|
+
"svg",
|
|
10
|
+
{
|
|
11
|
+
className: i(r.spinner, r[s], n),
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
fill: "none",
|
|
14
|
+
viewBox: "0 0 24 24",
|
|
15
|
+
"aria-hidden": "true",
|
|
16
|
+
...o,
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ e(
|
|
19
|
+
"circle",
|
|
20
|
+
{
|
|
21
|
+
className: r.spinnerTrack,
|
|
22
|
+
cx: "12",
|
|
23
|
+
cy: "12",
|
|
24
|
+
r: "10",
|
|
25
|
+
stroke: "currentColor",
|
|
26
|
+
strokeWidth: "4"
|
|
27
|
+
}
|
|
28
|
+
),
|
|
29
|
+
/* @__PURE__ */ e(
|
|
30
|
+
"path",
|
|
31
|
+
{
|
|
32
|
+
className: r.spinnerHead,
|
|
33
|
+
fill: "currentColor",
|
|
34
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
export {
|
|
41
|
+
m as Spinner
|
|
42
|
+
};
|