@empreint/ui 1.0.3 → 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 -954
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import e from "./breadcrumb.module.js";
|
|
3
|
+
import { Slot as t } from "../slot/slot.js";
|
|
4
|
+
import n from "clsx";
|
|
5
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/breadcrumb/breadcrumb.tsx
|
|
7
|
+
var i = ({ children: t, className: i, ...a }) => /* @__PURE__ */ r("nav", {
|
|
8
|
+
...a,
|
|
9
|
+
"aria-label": a["aria-label"] ?? "Breadcrumb",
|
|
10
|
+
className: n(e.breadcrumb, i),
|
|
11
|
+
children: /* @__PURE__ */ r("ol", {
|
|
12
|
+
className: e.list,
|
|
13
|
+
children: t
|
|
14
|
+
})
|
|
15
|
+
}), a = ({ children: i, current: a, className: o, ...s }) => /* @__PURE__ */ r("li", { children: /* @__PURE__ */ r(t, {
|
|
16
|
+
...s,
|
|
17
|
+
className: n(e.item, o),
|
|
18
|
+
"data-current": a || void 0,
|
|
19
|
+
"aria-current": a ? "page" : void 0,
|
|
20
|
+
children: i
|
|
21
|
+
}) }), o = ({ children: t, className: i, ...a }) => /* @__PURE__ */ r("li", {
|
|
22
|
+
...a,
|
|
23
|
+
role: "presentation",
|
|
24
|
+
"aria-hidden": "true",
|
|
25
|
+
className: n(e.separator, i),
|
|
26
|
+
children: t ?? "/"
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
export { i as Breadcrumb, a as BreadcrumbItem, o as BreadcrumbSeparator };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import e from "./button.module.js";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/button/button.tsx
|
|
5
|
+
var r = ({ children: r, type: i = "button", variant: a = "primary", size: o = "2", className: s, ...c }) => /* @__PURE__ */ n("button", {
|
|
6
|
+
...c,
|
|
7
|
+
type: i,
|
|
8
|
+
className: t(e.button, s),
|
|
9
|
+
"data-variant": a,
|
|
10
|
+
"data-size": o,
|
|
11
|
+
children: r
|
|
12
|
+
});
|
|
13
|
+
//#endregion
|
|
14
|
+
export { r as Button };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import e from "./card.module.js";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/card/card.tsx
|
|
5
|
+
var r = ({ children: r, className: i, ...a }) => /* @__PURE__ */ n("div", {
|
|
6
|
+
...a,
|
|
7
|
+
className: t(e.card, i),
|
|
8
|
+
children: r
|
|
9
|
+
}), i = ({ children: r, className: i, ...a }) => /* @__PURE__ */ n("div", {
|
|
10
|
+
...a,
|
|
11
|
+
className: t(e.header, i),
|
|
12
|
+
children: r
|
|
13
|
+
}), a = ({ children: r, className: i, ...a }) => /* @__PURE__ */ n("div", {
|
|
14
|
+
...a,
|
|
15
|
+
className: t(e.body, i),
|
|
16
|
+
children: r
|
|
17
|
+
}), o = ({ children: r, className: i, ...a }) => /* @__PURE__ */ n("div", {
|
|
18
|
+
...a,
|
|
19
|
+
className: t(e.footer, i),
|
|
20
|
+
children: r
|
|
21
|
+
});
|
|
22
|
+
//#endregion
|
|
23
|
+
export { r as Card, a as CardBody, o as CardFooter, i as CardHeader };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import e from "./checkbox.module.js";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/checkbox/checkbox.tsx
|
|
5
|
+
var i = ({ children: i, size: a = "md", className: o, ...s }) => /* @__PURE__ */ r("label", {
|
|
6
|
+
className: t(e.checkbox, o),
|
|
7
|
+
"data-size": a,
|
|
8
|
+
children: [/* @__PURE__ */ n("input", {
|
|
9
|
+
...s,
|
|
10
|
+
className: e.input,
|
|
11
|
+
type: "checkbox"
|
|
12
|
+
}), /* @__PURE__ */ n("span", {
|
|
13
|
+
className: e.label,
|
|
14
|
+
children: i
|
|
15
|
+
})]
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
export { i as Checkbox };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import e from "./chip.module.js";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { X as i } from "lucide-react";
|
|
5
|
+
//#region src/components/chip/chip.tsx
|
|
6
|
+
var a = ({ children: a, size: o = "md", onRemove: s, closeAriaLabel: c = "Remove", className: l, ...u }) => /* @__PURE__ */ r("div", {
|
|
7
|
+
...u,
|
|
8
|
+
className: t(e.chip, l),
|
|
9
|
+
"data-size": o,
|
|
10
|
+
children: [/* @__PURE__ */ n("span", {
|
|
11
|
+
className: e.label,
|
|
12
|
+
children: a
|
|
13
|
+
}), s && /* @__PURE__ */ n("button", {
|
|
14
|
+
type: "button",
|
|
15
|
+
className: e.close,
|
|
16
|
+
"aria-label": c,
|
|
17
|
+
onClick: s,
|
|
18
|
+
children: /* @__PURE__ */ n(i, {
|
|
19
|
+
size: 16,
|
|
20
|
+
"aria-hidden": !0
|
|
21
|
+
})
|
|
22
|
+
})]
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { a as Chip };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useDisclosure as e } from "../../hooks/use-disclosure/use-disclosure.js";
|
|
3
|
+
import t from "./collapsible.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, useContext as s } from "react";
|
|
8
|
+
//#region src/components/collapsible/collapsible.tsx
|
|
9
|
+
var c = o(null), l = ({ children: i, className: a, ...o }) => {
|
|
10
|
+
let { isOpen: s, onToggle: l, onClose: u } = e({ closeOnOutsideClick: !1 });
|
|
11
|
+
return /* @__PURE__ */ r(c, {
|
|
12
|
+
value: {
|
|
13
|
+
isOpen: s,
|
|
14
|
+
onToggle: l,
|
|
15
|
+
onClose: u
|
|
16
|
+
},
|
|
17
|
+
children: /* @__PURE__ */ r("div", {
|
|
18
|
+
...o,
|
|
19
|
+
className: n(t.collapsible, a),
|
|
20
|
+
"data-open": s,
|
|
21
|
+
children: i
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
}, u = ({ children: e, icon: o = a, className: l, ...u }) => {
|
|
25
|
+
let d = s(c);
|
|
26
|
+
return /* @__PURE__ */ i("button", {
|
|
27
|
+
...u,
|
|
28
|
+
type: "button",
|
|
29
|
+
"aria-expanded": d?.isOpen,
|
|
30
|
+
className: n(t.trigger, l),
|
|
31
|
+
onClick: d?.onToggle,
|
|
32
|
+
children: [/* @__PURE__ */ r("span", {
|
|
33
|
+
className: t.label,
|
|
34
|
+
children: e
|
|
35
|
+
}), /* @__PURE__ */ r(o, { className: t.icon })]
|
|
36
|
+
});
|
|
37
|
+
}, d = ({ children: e, className: i, ...a }) => {
|
|
38
|
+
let o = s(c);
|
|
39
|
+
return /* @__PURE__ */ r("div", {
|
|
40
|
+
...a,
|
|
41
|
+
className: n(t.content, i),
|
|
42
|
+
inert: !o?.isOpen,
|
|
43
|
+
children: e
|
|
44
|
+
});
|
|
45
|
+
}, f = ({ children: e, className: i, ...a }) => /* @__PURE__ */ r("div", {
|
|
46
|
+
...a,
|
|
47
|
+
className: n(t.item, i),
|
|
48
|
+
children: e
|
|
49
|
+
});
|
|
50
|
+
//#endregion
|
|
51
|
+
export { l as Collapsible, d as CollapsibleContent, f as CollapsibleItem, u as CollapsibleTrigger };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import e from "./container.module.js";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/container/container.tsx
|
|
5
|
+
var r = ({ children: r, size: i, className: a, ...o }) => /* @__PURE__ */ n("div", {
|
|
6
|
+
...o,
|
|
7
|
+
className: t(e.container, a),
|
|
8
|
+
"data-size": i,
|
|
9
|
+
children: r
|
|
10
|
+
});
|
|
11
|
+
//#endregion
|
|
12
|
+
export { r as Container };
|
|
@@ -0,0 +1,59 @@
|
|
|
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 "./dropdown-menu.module.js";
|
|
5
|
+
import r from "clsx";
|
|
6
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
7
|
+
import { ChevronDown as a } from "lucide-react";
|
|
8
|
+
import { createContext as o, useContext as s } from "react";
|
|
9
|
+
//#region src/components/dropdown-menu/dropdown-menu.tsx
|
|
10
|
+
var c = o(null), l = ({ children: t, className: a, ...o }) => {
|
|
11
|
+
let { isOpen: s, onToggle: l, onClose: u, ref: d } = e();
|
|
12
|
+
return /* @__PURE__ */ i(c, {
|
|
13
|
+
value: {
|
|
14
|
+
isOpen: s,
|
|
15
|
+
onToggle: l,
|
|
16
|
+
onClose: u
|
|
17
|
+
},
|
|
18
|
+
children: /* @__PURE__ */ i("div", {
|
|
19
|
+
...o,
|
|
20
|
+
className: r(n["dropdown-menu"], a),
|
|
21
|
+
ref: d,
|
|
22
|
+
"data-open": s,
|
|
23
|
+
children: t
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
}, u = ({ children: e, ...n }) => {
|
|
27
|
+
let r = s(c);
|
|
28
|
+
return /* @__PURE__ */ i(t, {
|
|
29
|
+
...n,
|
|
30
|
+
"aria-expanded": r?.isOpen,
|
|
31
|
+
onClick: r?.onToggle,
|
|
32
|
+
children: e
|
|
33
|
+
});
|
|
34
|
+
}, d = ({ icon: e = a, className: t, ...o }) => {
|
|
35
|
+
let l = s(c);
|
|
36
|
+
return /* @__PURE__ */ i(e, {
|
|
37
|
+
...o,
|
|
38
|
+
className: r(n.icon, t),
|
|
39
|
+
"data-open": l?.isOpen,
|
|
40
|
+
"aria-hidden": !0
|
|
41
|
+
});
|
|
42
|
+
}, f = ({ children: e, className: t, ...a }) => s(c)?.isOpen && /* @__PURE__ */ i("ul", {
|
|
43
|
+
...a,
|
|
44
|
+
className: r(n.content, t),
|
|
45
|
+
children: e
|
|
46
|
+
}), p = ({ children: e, onClick: t, className: a, ...o }) => {
|
|
47
|
+
let l = s(c), u = () => {
|
|
48
|
+
t(), l?.onClose();
|
|
49
|
+
};
|
|
50
|
+
return /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i("button", {
|
|
51
|
+
...o,
|
|
52
|
+
type: "button",
|
|
53
|
+
className: r(n.item, a),
|
|
54
|
+
onClick: u,
|
|
55
|
+
children: e
|
|
56
|
+
}) });
|
|
57
|
+
};
|
|
58
|
+
//#endregion
|
|
59
|
+
export { l as DropdownMenu, f as DropdownMenuContent, d as DropdownMenuIcon, p as DropdownMenuItem, u as DropdownMenuTrigger };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Slot as e } from "../slot/slot.js";
|
|
3
|
+
import t from "./dropzone.module.js";
|
|
4
|
+
import n from "clsx";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
import { createContext as a, useContext as o, useEffect as s, useId as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
7
|
+
//#region src/components/dropzone/dropzone.tsx
|
|
8
|
+
var f = a(null), p = ({ children: e, onChange: a, className: o, ...p }) => {
|
|
9
|
+
let [m, h] = d(), [g, _] = d(!1), v = l(() => m ? URL.createObjectURL(m) : void 0, [m]), y = u(null), b = c(), x = () => {
|
|
10
|
+
y.current?.click();
|
|
11
|
+
}, S = (e) => {
|
|
12
|
+
e.preventDefault();
|
|
13
|
+
let t = e.dataTransfer.files[0];
|
|
14
|
+
h(t), _(!1), a(t);
|
|
15
|
+
}, C = (e) => {
|
|
16
|
+
let { target: t } = e;
|
|
17
|
+
if (t?.files && t?.files.length > 0) {
|
|
18
|
+
let e = t.files[0];
|
|
19
|
+
h(e), a(e);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return s(() => () => {
|
|
23
|
+
v && URL.revokeObjectURL(v);
|
|
24
|
+
}, [v]), /* @__PURE__ */ r(f, {
|
|
25
|
+
value: {
|
|
26
|
+
file: m,
|
|
27
|
+
preview: v,
|
|
28
|
+
inputId: b,
|
|
29
|
+
onOpenFilePicker: x,
|
|
30
|
+
onDrop: S,
|
|
31
|
+
onDragOver: (e) => {
|
|
32
|
+
e.preventDefault(), _(!0);
|
|
33
|
+
},
|
|
34
|
+
onDragLeave: () => _(!1),
|
|
35
|
+
onRemove: () => {
|
|
36
|
+
h(void 0), a(void 0), y.current && (y.current.value = "");
|
|
37
|
+
},
|
|
38
|
+
onChange: C
|
|
39
|
+
},
|
|
40
|
+
children: /* @__PURE__ */ i("div", {
|
|
41
|
+
...p,
|
|
42
|
+
className: n(t.dropzone, o),
|
|
43
|
+
"data-dragging": g,
|
|
44
|
+
children: [e, /* @__PURE__ */ r("input", {
|
|
45
|
+
type: "file",
|
|
46
|
+
ref: y,
|
|
47
|
+
id: b,
|
|
48
|
+
onChange: C,
|
|
49
|
+
hidden: !0
|
|
50
|
+
})]
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
}, m = ({ children: e, className: i, ...a }) => {
|
|
54
|
+
let s = o(f);
|
|
55
|
+
return /* @__PURE__ */ r("label", {
|
|
56
|
+
...a,
|
|
57
|
+
className: n(t.label, i),
|
|
58
|
+
htmlFor: s?.inputId,
|
|
59
|
+
children: e
|
|
60
|
+
});
|
|
61
|
+
}, h = ({ children: e, className: i, ...a }) => {
|
|
62
|
+
let s = o(f);
|
|
63
|
+
return /* @__PURE__ */ r("button", {
|
|
64
|
+
...a,
|
|
65
|
+
type: "button",
|
|
66
|
+
className: n(t.area, i),
|
|
67
|
+
onClick: s?.onOpenFilePicker,
|
|
68
|
+
onDrop: s?.onDrop,
|
|
69
|
+
onDragOver: s?.onDragOver,
|
|
70
|
+
onDragLeave: s?.onDragLeave,
|
|
71
|
+
"aria-label": a["aria-label"] ?? "Upload a file",
|
|
72
|
+
children: e
|
|
73
|
+
});
|
|
74
|
+
}, g = ({ className: e, ...i }) => {
|
|
75
|
+
let a = o(f);
|
|
76
|
+
return a?.file ? /* @__PURE__ */ r("div", {
|
|
77
|
+
...i,
|
|
78
|
+
className: n(t.preview, e),
|
|
79
|
+
children: /* @__PURE__ */ r("img", {
|
|
80
|
+
alt: "preview file",
|
|
81
|
+
className: t.file,
|
|
82
|
+
src: a.preview
|
|
83
|
+
})
|
|
84
|
+
}) : null;
|
|
85
|
+
}, _ = ({ children: e, className: i, ...a }) => o(f)?.file ? null : /* @__PURE__ */ r("div", {
|
|
86
|
+
...a,
|
|
87
|
+
className: n(t.empty, i),
|
|
88
|
+
children: e
|
|
89
|
+
}), v = ({ children: i, className: a, ...s }) => {
|
|
90
|
+
let c = o(f);
|
|
91
|
+
return c?.file ? /* @__PURE__ */ r(e, {
|
|
92
|
+
...s,
|
|
93
|
+
className: n(t.remove, a),
|
|
94
|
+
onClick: c?.onRemove,
|
|
95
|
+
children: i
|
|
96
|
+
}) : null;
|
|
97
|
+
};
|
|
98
|
+
//#endregion
|
|
99
|
+
export { p as Dropzone, h as DropzoneArea, _ as DropzoneEmpty, m as DropzoneLabel, g as DropzonePreview, v as DropzoneRemove };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import e from "./flex.module.js";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/flex/flex.tsx
|
|
5
|
+
var r = ({ children: r, direction: i, justify: a, align: o, wrap: s, gap: c, inline: l, className: u, ...d }) => /* @__PURE__ */ n("div", {
|
|
6
|
+
...d,
|
|
7
|
+
className: t(e.flex, u),
|
|
8
|
+
"data-direction": i,
|
|
9
|
+
"data-justify": a,
|
|
10
|
+
"data-align": o,
|
|
11
|
+
"data-wrap": s,
|
|
12
|
+
"data-gap": c || void 0,
|
|
13
|
+
"data-inline": l || void 0,
|
|
14
|
+
children: r
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
export { r as Flex };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import e from "./grid.module.js";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/grid/grid.tsx
|
|
5
|
+
var r = ({ children: r, cols: i, gap: a, className: o, style: s, ...c }) => /* @__PURE__ */ n("div", {
|
|
6
|
+
...c,
|
|
7
|
+
className: t(e.grid, o),
|
|
8
|
+
"data-gap": a,
|
|
9
|
+
style: {
|
|
10
|
+
...s,
|
|
11
|
+
gridTemplateColumns: typeof i == "number" ? `repeat(${i}, 1fr)` : i
|
|
12
|
+
},
|
|
13
|
+
children: r
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
export { r as Grid };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import e from "./input.module.js";
|
|
3
|
+
import t from "clsx";
|
|
4
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
5
|
+
import { createContext as r, useContext as i, useId as a } from "react";
|
|
6
|
+
//#region src/components/input/input.tsx
|
|
7
|
+
var o = r(null), s = ({ children: r, status: i = "default", className: s, ...c }) => /* @__PURE__ */ n(o, {
|
|
8
|
+
value: {
|
|
9
|
+
fieldId: a(),
|
|
10
|
+
status: i
|
|
11
|
+
},
|
|
12
|
+
children: /* @__PURE__ */ n("div", {
|
|
13
|
+
...c,
|
|
14
|
+
className: t(e.input, s),
|
|
15
|
+
"data-status": i,
|
|
16
|
+
children: r
|
|
17
|
+
})
|
|
18
|
+
}), c = ({ className: r, ...a }) => {
|
|
19
|
+
let s = i(o);
|
|
20
|
+
return /* @__PURE__ */ n("input", {
|
|
21
|
+
...a,
|
|
22
|
+
id: s?.fieldId,
|
|
23
|
+
"aria-invalid": s?.status === "error",
|
|
24
|
+
className: t(e.field, r)
|
|
25
|
+
});
|
|
26
|
+
}, l = ({ children: r, className: a, ...s }) => {
|
|
27
|
+
let c = i(o);
|
|
28
|
+
return /* @__PURE__ */ n("label", {
|
|
29
|
+
...s,
|
|
30
|
+
htmlFor: c?.fieldId,
|
|
31
|
+
className: t(e.label, a),
|
|
32
|
+
children: r
|
|
33
|
+
});
|
|
34
|
+
}, u = ({ children: r, className: a, ...s }) => {
|
|
35
|
+
let c = i(o);
|
|
36
|
+
return /* @__PURE__ */ n("p", {
|
|
37
|
+
...s,
|
|
38
|
+
role: c?.status === "error" ? "alert" : void 0,
|
|
39
|
+
className: t(e.message, a),
|
|
40
|
+
children: r
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { s as Input, c as InputField, l as InputLabel, u as InputMessage };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import e from "./language-selector.module.js";
|
|
3
|
+
import { Select as t, SelectContent as n, SelectItem as r, SelectTrigger as i } from "../select/select.js";
|
|
4
|
+
import a from "clsx";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/language-selector/language-selector.tsx
|
|
7
|
+
var c = ({ languages: c, ...l }) => /* @__PURE__ */ s(t, {
|
|
8
|
+
...l,
|
|
9
|
+
children: [/* @__PURE__ */ o(i, {}), /* @__PURE__ */ o(n, { children: c.map((t) => /* @__PURE__ */ o(r, {
|
|
10
|
+
value: t,
|
|
11
|
+
children: /* @__PURE__ */ o("span", {
|
|
12
|
+
role: "img",
|
|
13
|
+
className: a(e.flag, `fi fi-${t}`),
|
|
14
|
+
"aria-label": t
|
|
15
|
+
})
|
|
16
|
+
}, t)) })]
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
export { c as LanguageSelector };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import e from "./list.module.js";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/list/list.tsx
|
|
5
|
+
var r = ({ children: r, className: i, ...a }) => /* @__PURE__ */ n("ul", {
|
|
6
|
+
...a,
|
|
7
|
+
className: t(e.list, i),
|
|
8
|
+
children: r
|
|
9
|
+
}), i = ({ children: r, className: i, ...a }) => /* @__PURE__ */ n("li", {
|
|
10
|
+
...a,
|
|
11
|
+
className: t(e.item, i),
|
|
12
|
+
children: r
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { r as List, i as ListItem };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import e from "./loader.module.js";
|
|
2
|
+
import t from "clsx";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import { LoaderCircle as r } from "lucide-react";
|
|
5
|
+
//#region src/components/loader/loader.tsx
|
|
6
|
+
var i = ({ children: r, className: i, ...a }) => /* @__PURE__ */ n("div", {
|
|
7
|
+
...a,
|
|
8
|
+
className: t(e.overlay, i),
|
|
9
|
+
children: /* @__PURE__ */ n("div", {
|
|
10
|
+
className: e.loader,
|
|
11
|
+
children: r
|
|
12
|
+
})
|
|
13
|
+
}), a = ({ size: i = "md", className: a, ...o }) => /* @__PURE__ */ n(r, {
|
|
14
|
+
...o,
|
|
15
|
+
role: "status",
|
|
16
|
+
"aria-label": "Loading",
|
|
17
|
+
"data-size": i,
|
|
18
|
+
className: t(e.spinner, a)
|
|
19
|
+
});
|
|
20
|
+
//#endregion
|
|
21
|
+
export { i as Loader, a as LoaderSpinner };
|
|
@@ -0,0 +1,69 @@
|
|
|
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 "./modal.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/modal/modal.tsx
|
|
9
|
+
var s = a(null), c = ({ children: t, className: n, ...r }) => {
|
|
10
|
+
let { isOpen: a, onToggle: o, onClose: c, ref: l } = e();
|
|
11
|
+
return /* @__PURE__ */ i(s, {
|
|
12
|
+
value: {
|
|
13
|
+
isOpen: a,
|
|
14
|
+
onToggle: o,
|
|
15
|
+
onClose: c,
|
|
16
|
+
ref: l
|
|
17
|
+
},
|
|
18
|
+
children: /* @__PURE__ */ i("div", {
|
|
19
|
+
...r,
|
|
20
|
+
className: n,
|
|
21
|
+
"data-open": a,
|
|
22
|
+
children: t
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
}, l = ({ children: e, className: a, ...c }) => {
|
|
26
|
+
let l = o(s);
|
|
27
|
+
return /* @__PURE__ */ i(t, {
|
|
28
|
+
...c,
|
|
29
|
+
className: r(n.trigger, a),
|
|
30
|
+
onClick: l?.onToggle,
|
|
31
|
+
children: e
|
|
32
|
+
});
|
|
33
|
+
}, u = ({ children: e, className: t, ...a }) => {
|
|
34
|
+
let c = o(s);
|
|
35
|
+
return c?.isOpen ? /* @__PURE__ */ i("div", {
|
|
36
|
+
...a,
|
|
37
|
+
className: r(n.content, t),
|
|
38
|
+
ref: c?.ref,
|
|
39
|
+
role: "dialog",
|
|
40
|
+
"aria-modal": "true",
|
|
41
|
+
"aria-label": a["aria-label"] ?? "Modal",
|
|
42
|
+
children: e
|
|
43
|
+
}) : null;
|
|
44
|
+
}, d = ({ className: e, ...t }) => o(s)?.isOpen && /* @__PURE__ */ i("div", {
|
|
45
|
+
...t,
|
|
46
|
+
className: r(n.overlay, e)
|
|
47
|
+
}), f = ({ children: e, className: a, ...c }) => {
|
|
48
|
+
let l = o(s);
|
|
49
|
+
return /* @__PURE__ */ i(t, {
|
|
50
|
+
...c,
|
|
51
|
+
className: r(n.close, a),
|
|
52
|
+
onClick: l?.onClose,
|
|
53
|
+
children: e
|
|
54
|
+
});
|
|
55
|
+
}, p = ({ children: e, className: t, ...a }) => /* @__PURE__ */ i("div", {
|
|
56
|
+
...a,
|
|
57
|
+
className: r(n.body, t),
|
|
58
|
+
children: e
|
|
59
|
+
}), m = ({ children: e, className: t, ...a }) => /* @__PURE__ */ i("div", {
|
|
60
|
+
...a,
|
|
61
|
+
className: r(n.header, t),
|
|
62
|
+
children: e
|
|
63
|
+
}), h = ({ children: e, className: t, ...a }) => /* @__PURE__ */ i("div", {
|
|
64
|
+
...a,
|
|
65
|
+
className: r(n.footer, t),
|
|
66
|
+
children: e
|
|
67
|
+
});
|
|
68
|
+
//#endregion
|
|
69
|
+
export { c as Modal, p as ModalBody, f as ModalClose, u as ModalContent, h as ModalFooter, m as ModalHeader, d as ModalOverlay, l as ModalTrigger };
|