@empreint/ui 1.1.0 → 1.2.0
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/breadcrumb/breadcrumb.js +29 -0
- package/dist/components/breadcrumb/breadcrumb.module.js +8 -0
- package/dist/components/button/button.js +14 -0
- package/dist/components/button/button.module.js +3 -0
- package/dist/components/card/card.js +23 -0
- package/dist/components/card/card.module.js +8 -0
- package/dist/components/checkbox/checkbox.js +18 -0
- package/dist/components/checkbox/checkbox.module.js +7 -0
- package/dist/components/chip/chip.js +25 -0
- package/dist/components/chip/chip.module.js +6 -0
- package/dist/components/collapsible/collapsible.js +51 -0
- package/dist/components/collapsible/collapsible.module.js +9 -0
- package/dist/components/container/container.js +12 -0
- package/dist/components/container/container.module.js +3 -0
- package/dist/components/dropdown-menu/dropdown-menu.js +59 -0
- package/dist/components/dropdown-menu/dropdown-menu.module.js +8 -0
- package/dist/components/dropzone/dropzone.js +99 -0
- package/dist/components/dropzone/dropzone.module.js +9 -0
- package/dist/components/flex/flex.js +17 -0
- package/dist/components/flex/flex.module.js +3 -0
- package/dist/components/grid/grid.js +16 -0
- package/dist/components/grid/grid.module.js +3 -0
- package/dist/components/input/input.js +44 -0
- package/dist/components/input/input.module.js +8 -0
- package/dist/components/language-selector/language-selector.js +19 -0
- package/dist/components/language-selector/language-selector.module.js +3 -0
- package/dist/components/list/list.js +15 -0
- package/dist/components/list/list.module.js +6 -0
- package/dist/components/loader/loader.js +21 -0
- package/dist/components/loader/loader.module.js +8 -0
- package/dist/components/modal/modal.js +69 -0
- package/dist/components/modal/modal.module.js +10 -0
- package/dist/components/pagination/pagination.js +77 -0
- package/dist/components/pagination/pagination.module.js +6 -0
- package/dist/components/popover/popover.js +38 -0
- package/dist/components/popover/popover.module.js +7 -0
- package/dist/components/radio-group/radio-group.js +43 -0
- package/dist/components/radio-group/radio-group.module.js +8 -0
- package/dist/components/select/select.js +75 -0
- package/dist/components/select/select.module.js +10 -0
- package/dist/components/separator/separator.js +14 -0
- package/dist/components/separator/separator.module.js +3 -0
- package/dist/components/sidebar/sidebar.js +31 -0
- package/dist/components/sidebar/sidebar.module.js +9 -0
- package/dist/components/slot/slot.js +39 -0
- package/dist/components/table/table.js +45 -0
- package/dist/components/table/table.module.js +10 -0
- package/dist/components/tabs/tabs.js +45 -0
- package/dist/components/tabs/tabs.module.js +8 -0
- package/dist/components/text/text.js +14 -0
- package/dist/components/text/text.module.js +3 -0
- package/dist/components/title/title.js +15 -0
- package/dist/components/title/title.module.js +3 -0
- package/dist/components/wizard/wizard.js +108 -0
- package/dist/components/wizard/wizard.module.js +8 -0
- package/dist/hooks/use-breadcrumb/use-breadcrumb.js +13 -0
- package/dist/hooks/use-disclosure/use-disclosure.js +20 -0
- package/dist/hooks/use-match-device/use-match-device.js +13 -0
- package/dist/hooks/use-match-resolution/use-match-resolution.js +53 -0
- package/dist/hooks/use-outside-alerter/use-outside-alerter.js +20 -0
- package/dist/hooks/use-pagination/use-pagination.js +31 -0
- package/dist/hooks/use-scroll-to/use-scroll-to.js +6 -0
- package/dist/hooks/use-visible/use-visible.js +13 -0
- package/dist/hooks/use-wizard/use-wizard.js +14 -0
- package/dist/index.d.ts +183 -297
- package/dist/index.js +40 -0
- package/dist/styles.css +2 -0
- package/package.json +18 -27
- package/LICENSE.md +0 -674
- package/README.md +0 -27
- package/dist/empreint.css +0 -2
- package/dist/empreint.js +0 -958
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { usePagination as e } from "../../hooks/use-pagination/use-pagination.js";
|
|
3
|
+
import t from "./pagination.module.js";
|
|
4
|
+
import n from "clsx";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
import { createContext as i, createElement as a, useContext as o } from "react";
|
|
7
|
+
//#region src/components/pagination/pagination.tsx
|
|
8
|
+
var s = i(null), c = ({ children: i, className: a, page: o, totalRecords: c, maxRecordsPerPage: l, itemNeighbours: u, minItems: d, onChange: f, ...p }) => /* @__PURE__ */ r(s, {
|
|
9
|
+
value: e({
|
|
10
|
+
page: o,
|
|
11
|
+
totalRecords: c,
|
|
12
|
+
maxRecordsPerPage: l,
|
|
13
|
+
itemNeighbours: u,
|
|
14
|
+
minItems: d,
|
|
15
|
+
onChange: f
|
|
16
|
+
}),
|
|
17
|
+
children: /* @__PURE__ */ r("nav", {
|
|
18
|
+
...p,
|
|
19
|
+
className: n(t.pagination, a),
|
|
20
|
+
"aria-label": p["aria-label"] ?? "Pagination",
|
|
21
|
+
children: i
|
|
22
|
+
})
|
|
23
|
+
}), l = ({ children: e, className: i, ...a }) => {
|
|
24
|
+
let c = o(s);
|
|
25
|
+
return c?.isFirst ? null : /* @__PURE__ */ r("button", {
|
|
26
|
+
...a,
|
|
27
|
+
type: "button",
|
|
28
|
+
className: n(t.item, i),
|
|
29
|
+
onClick: c?.goToFirst,
|
|
30
|
+
"aria-label": a["aria-label"] ?? "First page",
|
|
31
|
+
children: e
|
|
32
|
+
});
|
|
33
|
+
}, u = ({ children: e, className: i, ...a }) => {
|
|
34
|
+
let c = o(s);
|
|
35
|
+
return c?.isFirst ? null : /* @__PURE__ */ r("button", {
|
|
36
|
+
...a,
|
|
37
|
+
type: "button",
|
|
38
|
+
className: n(t.item, i),
|
|
39
|
+
onClick: c?.goToPrevious,
|
|
40
|
+
"aria-label": a["aria-label"] ?? "Previous page",
|
|
41
|
+
children: e
|
|
42
|
+
});
|
|
43
|
+
}, d = ({ className: e, ...r }) => {
|
|
44
|
+
let i = o(s);
|
|
45
|
+
return i?.items.map((o) => /* @__PURE__ */ a("button", {
|
|
46
|
+
...r,
|
|
47
|
+
type: "button",
|
|
48
|
+
"aria-current": o === i?.currentPage ? "page" : void 0,
|
|
49
|
+
"aria-label": `Page ${o}`,
|
|
50
|
+
className: n(t.item, e),
|
|
51
|
+
"data-active": o === i?.currentPage || void 0,
|
|
52
|
+
key: o,
|
|
53
|
+
onClick: () => i?.goToPage(o)
|
|
54
|
+
}, o));
|
|
55
|
+
}, f = ({ children: e, className: i, ...a }) => {
|
|
56
|
+
let c = o(s);
|
|
57
|
+
return c?.isLast ? null : /* @__PURE__ */ r("button", {
|
|
58
|
+
...a,
|
|
59
|
+
type: "button",
|
|
60
|
+
className: n(t.item, i),
|
|
61
|
+
onClick: c?.goToNext,
|
|
62
|
+
"aria-label": a["aria-label"] ?? "Next page",
|
|
63
|
+
children: e
|
|
64
|
+
});
|
|
65
|
+
}, p = ({ children: e, className: i, ...a }) => {
|
|
66
|
+
let c = o(s);
|
|
67
|
+
return c?.isLast ? null : /* @__PURE__ */ r("button", {
|
|
68
|
+
...a,
|
|
69
|
+
type: "button",
|
|
70
|
+
className: n(t.item, i),
|
|
71
|
+
onClick: c?.goToLast,
|
|
72
|
+
"aria-label": a["aria-label"] ?? "Last page",
|
|
73
|
+
children: e
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
//#endregion
|
|
77
|
+
export { c as Pagination, l as PaginationFirst, d as PaginationItems, p as PaginationLast, f as PaginationNext, u as PaginationPrevious };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useDisclosure as e } from "../../hooks/use-disclosure/use-disclosure.js";
|
|
3
|
+
import { Slot as t } from "../slot/slot.js";
|
|
4
|
+
import n from "./popover.module.js";
|
|
5
|
+
import r from "clsx";
|
|
6
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
7
|
+
import { createContext as a, useContext as o } from "react";
|
|
8
|
+
//#region src/components/popover/popover.tsx
|
|
9
|
+
var s = a(null), c = ({ children: t, className: a, ...o }) => {
|
|
10
|
+
let { isOpen: c, onToggle: l, onClose: u, ref: d } = e();
|
|
11
|
+
return /* @__PURE__ */ i(s, {
|
|
12
|
+
value: {
|
|
13
|
+
isOpen: c,
|
|
14
|
+
onToggle: l,
|
|
15
|
+
onClose: u
|
|
16
|
+
},
|
|
17
|
+
children: /* @__PURE__ */ i("div", {
|
|
18
|
+
...o,
|
|
19
|
+
className: r(n.popover, a),
|
|
20
|
+
ref: d,
|
|
21
|
+
children: t
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
}, l = ({ children: e, className: a, ...c }) => {
|
|
25
|
+
let l = o(s);
|
|
26
|
+
return /* @__PURE__ */ i(t, {
|
|
27
|
+
...c,
|
|
28
|
+
onClick: l?.onToggle,
|
|
29
|
+
className: r(n.trigger, a),
|
|
30
|
+
children: e
|
|
31
|
+
});
|
|
32
|
+
}, u = ({ children: e, className: t, ...a }) => o(s)?.isOpen ? /* @__PURE__ */ i("div", {
|
|
33
|
+
...a,
|
|
34
|
+
className: r(n.content, t),
|
|
35
|
+
children: e
|
|
36
|
+
}) : null;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { c as Popover, u as PopoverContent, l as PopoverTrigger };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import e from "./radio-group.module.js";
|
|
3
|
+
import t from "clsx";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import { createContext as i, useContext as a, useId as o, useState as s } from "react";
|
|
6
|
+
//#region src/components/radio-group/radio-group.tsx
|
|
7
|
+
var c = i(null), l = ({ children: r, onChange: i, defaultValue: a, orientation: l = "vertical", className: u, ...d }) => {
|
|
8
|
+
let [f, p] = s(a);
|
|
9
|
+
return /* @__PURE__ */ n(c, {
|
|
10
|
+
value: {
|
|
11
|
+
value: f,
|
|
12
|
+
name: o(),
|
|
13
|
+
onChange: (e) => {
|
|
14
|
+
i?.(e), p(e);
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
children: /* @__PURE__ */ n("div", {
|
|
18
|
+
...d,
|
|
19
|
+
role: d.role ?? "radiogroup",
|
|
20
|
+
"data-orientation": l,
|
|
21
|
+
className: t(e.group, u),
|
|
22
|
+
children: r
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
}, u = ({ children: i, value: o, className: s, ...l }) => {
|
|
26
|
+
let u = a(c);
|
|
27
|
+
return /* @__PURE__ */ r("label", {
|
|
28
|
+
className: t(e.item, s),
|
|
29
|
+
children: [/* @__PURE__ */ n("input", {
|
|
30
|
+
...l,
|
|
31
|
+
name: u?.name,
|
|
32
|
+
className: e.radio,
|
|
33
|
+
type: "radio",
|
|
34
|
+
checked: o === u?.value,
|
|
35
|
+
onChange: () => u?.onChange(o)
|
|
36
|
+
}), /* @__PURE__ */ n("span", {
|
|
37
|
+
className: e.label,
|
|
38
|
+
children: i
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { l as RadioGroup, u as RadioGroupItem };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useDisclosure as e } from "../../hooks/use-disclosure/use-disclosure.js";
|
|
3
|
+
import t from "./select.module.js";
|
|
4
|
+
import n from "clsx";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
import { ChevronDown as a } from "lucide-react";
|
|
7
|
+
import { createContext as o, useCallback as s, useContext as c, useEffect as l, useState as u } from "react";
|
|
8
|
+
//#region src/components/select/select.tsx
|
|
9
|
+
var d = o(null), f = ({ children: i, defaultValue: a, onChange: o, className: c, ...l }) => {
|
|
10
|
+
let { isOpen: f, onToggle: p, onClose: m, ref: h } = e(), [g, _] = u();
|
|
11
|
+
return /* @__PURE__ */ r(d, {
|
|
12
|
+
value: {
|
|
13
|
+
option: g,
|
|
14
|
+
defaultValue: a,
|
|
15
|
+
initDefaultValue: s((e) => _(e), []),
|
|
16
|
+
isOpen: f,
|
|
17
|
+
onToggle: p,
|
|
18
|
+
onClose: m,
|
|
19
|
+
onChange: (e) => {
|
|
20
|
+
o?.(e), _(e), m();
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
children: /* @__PURE__ */ r("div", {
|
|
24
|
+
...l,
|
|
25
|
+
className: n(t.select, c),
|
|
26
|
+
ref: h,
|
|
27
|
+
"data-open": f,
|
|
28
|
+
children: i
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
}, p = ({ icon: e = a, className: o, ...s }) => {
|
|
32
|
+
let l = c(d);
|
|
33
|
+
return /* @__PURE__ */ i("button", {
|
|
34
|
+
...s,
|
|
35
|
+
type: "button",
|
|
36
|
+
className: n(t.trigger, o),
|
|
37
|
+
onClick: l?.onToggle,
|
|
38
|
+
children: [/* @__PURE__ */ r("span", { children: l?.option?.label }), /* @__PURE__ */ r(e, {
|
|
39
|
+
className: t.icon,
|
|
40
|
+
"aria-hidden": !0
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
}, m = ({ children: e, className: i, ...a }) => /* @__PURE__ */ r("ul", {
|
|
44
|
+
...a,
|
|
45
|
+
className: n(t.content, i),
|
|
46
|
+
children: e
|
|
47
|
+
}), h = ({ children: e, value: i, className: a, ...o }) => {
|
|
48
|
+
let s = c(d);
|
|
49
|
+
return l(() => {
|
|
50
|
+
i === s?.defaultValue && s.initDefaultValue({
|
|
51
|
+
label: e,
|
|
52
|
+
value: i
|
|
53
|
+
});
|
|
54
|
+
}, [
|
|
55
|
+
s?.defaultValue,
|
|
56
|
+
s?.initDefaultValue,
|
|
57
|
+
i,
|
|
58
|
+
e
|
|
59
|
+
]), /* @__PURE__ */ r("li", {
|
|
60
|
+
...o,
|
|
61
|
+
className: n(t.item, a),
|
|
62
|
+
"data-selected": s?.option?.value === i,
|
|
63
|
+
children: /* @__PURE__ */ r("button", {
|
|
64
|
+
type: "button",
|
|
65
|
+
className: t.option,
|
|
66
|
+
onClick: () => s?.onChange({
|
|
67
|
+
label: e,
|
|
68
|
+
value: i
|
|
69
|
+
}),
|
|
70
|
+
children: e
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
//#endregion
|
|
75
|
+
export { f as Select, m as SelectContent, h as SelectItem, p as SelectTrigger };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import e from "./separator.module.js";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/separator/separator.tsx
|
|
5
|
+
var r = ({ children: r, orientation: i = "horizontal", size: a = "sm", className: o, ...s }) => /* @__PURE__ */ n("div", {
|
|
6
|
+
...s,
|
|
7
|
+
"data-orientation": i,
|
|
8
|
+
"data-size": a,
|
|
9
|
+
"data-has-label": r ? "" : void 0,
|
|
10
|
+
className: t(e.separator, o),
|
|
11
|
+
children: r
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { r as Separator };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Slot as e } from "../slot/slot.js";
|
|
3
|
+
import t from "./sidebar.module.js";
|
|
4
|
+
import n from "clsx";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/sidebar/sidebar.tsx
|
|
7
|
+
var i = ({ children: e, className: i, ...a }) => /* @__PURE__ */ r("nav", {
|
|
8
|
+
...a,
|
|
9
|
+
className: n(t.sidebar, i),
|
|
10
|
+
children: e
|
|
11
|
+
}), a = ({ children: e, className: i, ...a }) => /* @__PURE__ */ r("header", {
|
|
12
|
+
...a,
|
|
13
|
+
className: n(t.header, i),
|
|
14
|
+
children: e
|
|
15
|
+
}), o = ({ children: e, className: i, ...a }) => /* @__PURE__ */ r("ul", {
|
|
16
|
+
...a,
|
|
17
|
+
className: n(t.group, i),
|
|
18
|
+
children: e
|
|
19
|
+
}), s = ({ children: e, className: i, ...a }) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r("button", {
|
|
20
|
+
...a,
|
|
21
|
+
type: "button",
|
|
22
|
+
className: n(t.item, i),
|
|
23
|
+
children: e
|
|
24
|
+
}) }), c = ({ children: i, isActive: a, className: o, ...s }) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(e, {
|
|
25
|
+
...s,
|
|
26
|
+
className: n(t.link, o),
|
|
27
|
+
"data-active": a || void 0,
|
|
28
|
+
children: i
|
|
29
|
+
}) });
|
|
30
|
+
//#endregion
|
|
31
|
+
export { i as Sidebar, o as SidebarGroup, a as SidebarHeader, s as SidebarItem, c as SidebarLink };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Children as e, cloneElement as t, isValidElement as n } from "react";
|
|
2
|
+
//#region src/components/slot/slot.tsx
|
|
3
|
+
var r = ({ children: r, ref: s, ...c }) => {
|
|
4
|
+
if (!n(r)) return null;
|
|
5
|
+
let l = e.only(r), u = o(l), d = i(l.props, c);
|
|
6
|
+
return (s || u) && (d.ref = a(s, u)), t(l, d);
|
|
7
|
+
};
|
|
8
|
+
function i(e, t) {
|
|
9
|
+
let n = { ...e };
|
|
10
|
+
for (let r in t) {
|
|
11
|
+
let i = t[r], a = e[r];
|
|
12
|
+
s(r, i) ? n[r] = (...e) => {
|
|
13
|
+
a?.(...e), i(...e);
|
|
14
|
+
} : c(r, i) ? n[r] = [a, i].filter(Boolean).join(" ") : l(r, i) ? n[r] = {
|
|
15
|
+
...a,
|
|
16
|
+
...i
|
|
17
|
+
} : i !== void 0 && (n[r] = i);
|
|
18
|
+
}
|
|
19
|
+
return n;
|
|
20
|
+
}
|
|
21
|
+
function a(...e) {
|
|
22
|
+
return (t) => {
|
|
23
|
+
for (let n of e) typeof n == "function" ? n(t) : n != null && (n.current = t);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function o(e) {
|
|
27
|
+
return e.props.ref ?? e.ref;
|
|
28
|
+
}
|
|
29
|
+
function s(e, t) {
|
|
30
|
+
return /^on[A-Z]/.test(e) && typeof t == "function";
|
|
31
|
+
}
|
|
32
|
+
function c(e, t) {
|
|
33
|
+
return e === "className" && typeof t == "string";
|
|
34
|
+
}
|
|
35
|
+
function l(e, t) {
|
|
36
|
+
return e === "style" && typeof t == "object" && !!t;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { r as Slot };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import e from "./table.module.js";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/table/table.tsx
|
|
5
|
+
var i = ({ className: i, columns: c, records: l, uniqueKey: u, renderHeader: d = () => null, renderFooter: f = () => null, renderColumnsCell: p = (e, t) => /* @__PURE__ */ n(a, { children: e.label }, t), renderRecordsCell: m = (e, t) => /* @__PURE__ */ n(s, { children: e }, t), renderRecordsEmptyCell: h = (e) => /* @__PURE__ */ n(s, { children: "X" }, e), renderNoRecords: g = () => null, ..._ }) => {
|
|
6
|
+
let v = () => /* @__PURE__ */ n("tr", { children: c.map((e) => p(e, `column-${e.name}`)) }), y = () => {
|
|
7
|
+
let e = c.map((e) => e.name);
|
|
8
|
+
return l.map((t, r) => {
|
|
9
|
+
let i = u ? t[u] : r;
|
|
10
|
+
return /* @__PURE__ */ n(o, { children: e.map((e) => {
|
|
11
|
+
let n = t[e], r = `row-${i}-cell-${e}`;
|
|
12
|
+
return n ? m(n, r) : h(r);
|
|
13
|
+
}) }, `row-${i}`);
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ r("div", {
|
|
17
|
+
..._,
|
|
18
|
+
className: t(e.container, i),
|
|
19
|
+
children: [
|
|
20
|
+
d(),
|
|
21
|
+
l.length === 0 ? g() : /* @__PURE__ */ r("table", {
|
|
22
|
+
className: e.main,
|
|
23
|
+
children: [/* @__PURE__ */ n("thead", { children: v() }), /* @__PURE__ */ n("tbody", {
|
|
24
|
+
className: e.tbody,
|
|
25
|
+
children: y()
|
|
26
|
+
})]
|
|
27
|
+
}),
|
|
28
|
+
f()
|
|
29
|
+
]
|
|
30
|
+
});
|
|
31
|
+
}, a = ({ children: r, className: i, ...a }) => /* @__PURE__ */ n("th", {
|
|
32
|
+
...a,
|
|
33
|
+
className: t(e.th, i),
|
|
34
|
+
children: r
|
|
35
|
+
}), o = ({ children: r, className: i, ...a }) => /* @__PURE__ */ n("tr", {
|
|
36
|
+
...a,
|
|
37
|
+
className: t(e.tr, i),
|
|
38
|
+
children: r
|
|
39
|
+
}), s = ({ children: r, className: i, ...a }) => /* @__PURE__ */ n("td", {
|
|
40
|
+
...a,
|
|
41
|
+
className: t(e.td, i),
|
|
42
|
+
children: r
|
|
43
|
+
});
|
|
44
|
+
//#endregion
|
|
45
|
+
export { i as Table, s as TableTd, a as TableTh, o as TableTr };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import e from "./tabs.module.js";
|
|
3
|
+
import t from "clsx";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
import { createContext as r, useContext as i, useState as a } from "react";
|
|
6
|
+
//#region src/components/tabs/tabs.tsx
|
|
7
|
+
var o = r(null), s = ({ children: r, defaultValue: i, onChange: s, className: c, ...l }) => {
|
|
8
|
+
let [u, d] = a(i);
|
|
9
|
+
return /* @__PURE__ */ n(o, {
|
|
10
|
+
value: {
|
|
11
|
+
currentValue: u,
|
|
12
|
+
onChange: (e) => {
|
|
13
|
+
s?.(e), d(e);
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
children: /* @__PURE__ */ n("div", {
|
|
17
|
+
...l,
|
|
18
|
+
className: t(e.tabs, c),
|
|
19
|
+
children: r
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
}, c = ({ children: r, className: i, ...a }) => /* @__PURE__ */ n("ul", {
|
|
23
|
+
...a,
|
|
24
|
+
className: t(e.items, i),
|
|
25
|
+
children: r
|
|
26
|
+
}), l = ({ children: r, value: a, className: s, ...c }) => {
|
|
27
|
+
let l = i(o);
|
|
28
|
+
return /* @__PURE__ */ n("li", {
|
|
29
|
+
...c,
|
|
30
|
+
className: t(e.item, s),
|
|
31
|
+
"data-active": a === l?.currentValue || void 0,
|
|
32
|
+
children: /* @__PURE__ */ n("button", {
|
|
33
|
+
type: "button",
|
|
34
|
+
className: e.trigger,
|
|
35
|
+
onClick: () => l?.onChange(a),
|
|
36
|
+
children: r
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
}, u = ({ children: r, value: a, className: s, ...c }) => a === i(o)?.currentValue ? /* @__PURE__ */ n("div", {
|
|
40
|
+
...c,
|
|
41
|
+
className: t(e.content, s),
|
|
42
|
+
children: r
|
|
43
|
+
}) : null;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { s as Tabs, u as TabsContent, l as TabsItem, c as TabsItems };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import e from "./text.module.js";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/text/text.tsx
|
|
5
|
+
var r = ({ children: r, as: i = "p", size: a = "2", align: o, weight: s, className: c, ...l }) => /* @__PURE__ */ n(i, {
|
|
6
|
+
...l,
|
|
7
|
+
className: t(e.text, c),
|
|
8
|
+
"data-size": a,
|
|
9
|
+
"data-align": o,
|
|
10
|
+
"data-weight": s,
|
|
11
|
+
children: r
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { r as Text };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import e from "./title.module.js";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/title/title.tsx
|
|
5
|
+
var r = ({ children: r, as: i = "h1", size: a = "4", align: o, weight: s, className: c, ...l }) => /* @__PURE__ */ n(i, {
|
|
6
|
+
...l,
|
|
7
|
+
className: t(e.title, c),
|
|
8
|
+
"data-as": i,
|
|
9
|
+
"data-size": a,
|
|
10
|
+
"data-align": o,
|
|
11
|
+
"data-weight": s,
|
|
12
|
+
children: r
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { r as Title };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useWizard as e } from "../../hooks/use-wizard/use-wizard.js";
|
|
3
|
+
import { Slot as t } from "../slot/slot.js";
|
|
4
|
+
import { Title as n } from "../title/title.js";
|
|
5
|
+
import r from "./wizard.module.js";
|
|
6
|
+
import i from "clsx";
|
|
7
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
8
|
+
import { createContext as s, useCallback as c, useContext as l, useEffect as u, useState as d } from "react";
|
|
9
|
+
//#region src/components/wizard/wizard.tsx
|
|
10
|
+
var f = s(null), p = ({ children: t, initialStep: n, className: o, ...s }) => {
|
|
11
|
+
let [l, u] = d([]), p = l.length, { currentIndex: m, nextStep: h, previousStep: g, isFirstStep: _, isLastStep: v } = e({
|
|
12
|
+
step: n,
|
|
13
|
+
totalSteps: p
|
|
14
|
+
});
|
|
15
|
+
return /* @__PURE__ */ a(f, {
|
|
16
|
+
value: {
|
|
17
|
+
currentStep: l[m - 1] ?? null,
|
|
18
|
+
currentIndex: m,
|
|
19
|
+
totalSteps: p,
|
|
20
|
+
steps: l,
|
|
21
|
+
onAddStep: c((e) => {
|
|
22
|
+
u((t) => t.some((t) => t.name === e.name) ? t : [...t, e]);
|
|
23
|
+
}, []),
|
|
24
|
+
onRemoveStep: c((e) => {
|
|
25
|
+
u((t) => t.some((t) => t.name === e) ? t.filter((t) => t.name !== e) : t);
|
|
26
|
+
}, []),
|
|
27
|
+
onNext: h,
|
|
28
|
+
onPrevious: g,
|
|
29
|
+
isFirstStep: _,
|
|
30
|
+
isLastStep: v
|
|
31
|
+
},
|
|
32
|
+
children: /* @__PURE__ */ a("div", {
|
|
33
|
+
...s,
|
|
34
|
+
className: i(r.wizard, o),
|
|
35
|
+
children: t
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
}, m = ({ children: e, className: t, ...n }) => /* @__PURE__ */ a("div", {
|
|
39
|
+
...n,
|
|
40
|
+
className: i(r.header, t),
|
|
41
|
+
children: e
|
|
42
|
+
}), h = ({ className: e, ...t }) => {
|
|
43
|
+
let o = l(f);
|
|
44
|
+
return /* @__PURE__ */ a(n, {
|
|
45
|
+
...t,
|
|
46
|
+
className: i(r.title, e),
|
|
47
|
+
children: o?.currentStep?.title
|
|
48
|
+
});
|
|
49
|
+
}, g = ({ className: e, ...t }) => {
|
|
50
|
+
let n = l(f);
|
|
51
|
+
return n?.totalSteps === 0 ? null : /* @__PURE__ */ o("span", {
|
|
52
|
+
...t,
|
|
53
|
+
className: e,
|
|
54
|
+
children: [
|
|
55
|
+
n?.currentIndex,
|
|
56
|
+
" / ",
|
|
57
|
+
n?.totalSteps
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
}, _ = ({ children: e, name: t, title: n, className: o, ...s }) => {
|
|
61
|
+
let c = l(f);
|
|
62
|
+
return u(() => (c?.onAddStep({
|
|
63
|
+
name: t,
|
|
64
|
+
title: n
|
|
65
|
+
}), () => {
|
|
66
|
+
c?.onRemoveStep(t);
|
|
67
|
+
}), [
|
|
68
|
+
t,
|
|
69
|
+
n,
|
|
70
|
+
c?.onAddStep,
|
|
71
|
+
c?.onRemoveStep
|
|
72
|
+
]), c?.currentStep?.name === t ? /* @__PURE__ */ a("div", {
|
|
73
|
+
...s,
|
|
74
|
+
className: i(r.step, o),
|
|
75
|
+
children: e
|
|
76
|
+
}) : null;
|
|
77
|
+
}, v = ({ children: e, className: t, ...n }) => /* @__PURE__ */ a("div", {
|
|
78
|
+
...n,
|
|
79
|
+
className: i(r.footer, t),
|
|
80
|
+
children: e
|
|
81
|
+
}), y = ({ children: e, onClick: n, className: r, ...i }) => {
|
|
82
|
+
let o = l(f), s = () => {
|
|
83
|
+
n && n(), o?.onNext();
|
|
84
|
+
};
|
|
85
|
+
return o?.isLastStep ? null : /* @__PURE__ */ a(t, {
|
|
86
|
+
...i,
|
|
87
|
+
className: r,
|
|
88
|
+
onClick: s,
|
|
89
|
+
children: e
|
|
90
|
+
});
|
|
91
|
+
}, b = ({ children: e, onClick: n, className: r, ...i }) => {
|
|
92
|
+
let o = l(f), s = () => {
|
|
93
|
+
n && n(), o?.onPrevious();
|
|
94
|
+
};
|
|
95
|
+
return o?.isFirstStep ? null : /* @__PURE__ */ a(t, {
|
|
96
|
+
...i,
|
|
97
|
+
className: r,
|
|
98
|
+
onClick: s,
|
|
99
|
+
children: e
|
|
100
|
+
});
|
|
101
|
+
}, x = ({ children: e, onClick: n, className: r, ...i }) => l(f)?.isLastStep ? /* @__PURE__ */ a(t, {
|
|
102
|
+
...i,
|
|
103
|
+
className: r,
|
|
104
|
+
onClick: n,
|
|
105
|
+
children: e
|
|
106
|
+
}) : null;
|
|
107
|
+
//#endregion
|
|
108
|
+
export { p as Wizard, x as WizardFinalize, v as WizardFooter, m as WizardHeader, g as WizardIndicator, y as WizardNext, b as WizardPrevious, _ as WizardStep, h as WizardTitle };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/hooks/use-breadcrumb/use-breadcrumb.ts
|
|
2
|
+
var e = ({ url: e = new URL(location.href), mapping: t }) => {
|
|
3
|
+
let n = e.pathname.split("/").slice(1), r = "";
|
|
4
|
+
return n.map((e) => {
|
|
5
|
+
let n = t?.find(({ path: t }) => e === t)?.label ?? e, i = `${r}/${e}`;
|
|
6
|
+
return r = i, {
|
|
7
|
+
label: n,
|
|
8
|
+
url: i
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { e as useBreadcrumb };
|