haze-ui 0.0.0 → 1.0.1
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/README.md +4 -4
- package/dist/components/Avatar/Avatar.js +28 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +26 -0
- package/dist/components/Breadcrumb/BreadcrumbItem.js +17 -0
- package/dist/components/Carousel/Carousel.js +69 -0
- package/dist/components/Carousel/CarouselSlide.js +15 -0
- package/dist/components/Combobox/Combobox.js +50 -0
- package/dist/components/Combobox/ComboboxOption.js +21 -0
- package/dist/components/Datepicker/Calendar.js +105 -0
- package/dist/components/Datepicker/Datepicker.js +42 -0
- package/dist/components/Disclosure/Disclosure.js +25 -0
- package/dist/components/FileInput/FileInput.js +20 -0
- package/dist/components/Flex/Flex.js +20 -0
- package/dist/components/Icon/Icon.js +22 -0
- package/dist/components/Image/Image.js +25 -0
- package/dist/components/List/List.js +21 -0
- package/dist/components/List/ListItem.js +13 -0
- package/dist/components/Menu/Menu.js +34 -0
- package/dist/components/Menu/MenuDivider.js +12 -0
- package/dist/components/Menu/MenuItem.js +17 -0
- package/dist/components/NumberInput/NumberInput.js +56 -0
- package/dist/components/Skeleton/Skeleton.js +24 -0
- package/dist/components/Table/Table.js +18 -0
- package/dist/components/Table/TableBody.js +13 -0
- package/dist/components/Table/TableCell.js +12 -0
- package/dist/components/Table/TableHead.js +13 -0
- package/dist/components/Table/TableRow.js +11 -0
- package/dist/components/Tag/Tag.js +33 -0
- package/dist/components/Toast/Toast.js +33 -0
- package/dist/components/Toast/ToastContainer.js +35 -0
- package/dist/components/Toast/ToastContext.js +10 -0
- package/dist/components/Toast/useToast.js +15 -0
- package/dist/components/Tooltip/Tooltip.js +5 -5
- package/dist/haze-ui.css +1 -1
- package/dist/index.js +30 -2
- package/dist/types/components/Avatar/Avatar.d.ts +10 -0
- package/dist/types/components/Avatar/index.d.ts +2 -0
- package/dist/types/components/Breadcrumb/Breadcrumb.d.ts +8 -0
- package/dist/types/components/Breadcrumb/BreadcrumbItem.d.ts +8 -0
- package/dist/types/components/Breadcrumb/index.d.ts +4 -0
- package/dist/types/components/Carousel/Carousel.d.ts +11 -0
- package/dist/types/components/Carousel/CarouselSlide.d.ts +7 -0
- package/dist/types/components/Carousel/index.d.ts +4 -0
- package/dist/types/components/Combobox/Combobox.d.ts +12 -0
- package/dist/types/components/Combobox/ComboboxOption.d.ts +11 -0
- package/dist/types/components/Combobox/index.d.ts +4 -0
- package/dist/types/components/Datepicker/Calendar.d.ts +8 -0
- package/dist/types/components/Datepicker/Datepicker.d.ts +10 -0
- package/dist/types/components/Datepicker/index.d.ts +2 -0
- package/dist/types/components/Disclosure/Disclosure.d.ts +10 -0
- package/dist/types/components/Disclosure/index.d.ts +2 -0
- package/dist/types/components/FileInput/FileInput.d.ts +6 -0
- package/dist/types/components/FileInput/index.d.ts +2 -0
- package/dist/types/components/Flex/Flex.d.ts +12 -0
- package/dist/types/components/Flex/index.d.ts +2 -0
- package/dist/types/components/Icon/Icon.d.ts +8 -0
- package/dist/types/components/Icon/index.d.ts +2 -0
- package/dist/types/components/Image/Image.d.ts +11 -0
- package/dist/types/components/Image/index.d.ts +2 -0
- package/dist/types/components/List/List.d.ts +8 -0
- package/dist/types/components/List/ListItem.d.ts +7 -0
- package/dist/types/components/List/index.d.ts +4 -0
- package/dist/types/components/Menu/Menu.d.ts +10 -0
- package/dist/types/components/Menu/MenuDivider.d.ts +1 -0
- package/dist/types/components/Menu/MenuItem.d.ts +9 -0
- package/dist/types/components/Menu/index.d.ts +5 -0
- package/dist/types/components/NumberInput/NumberInput.d.ts +11 -0
- package/dist/types/components/NumberInput/index.d.ts +2 -0
- package/dist/types/components/Skeleton/Skeleton.d.ts +8 -0
- package/dist/types/components/Skeleton/index.d.ts +2 -0
- package/dist/types/components/Table/Table.d.ts +9 -0
- package/dist/types/components/Table/TableBody.d.ts +7 -0
- package/dist/types/components/Table/TableCell.d.ts +8 -0
- package/dist/types/components/Table/TableHead.d.ts +7 -0
- package/dist/types/components/Table/TableRow.d.ts +7 -0
- package/dist/types/components/Table/index.d.ts +10 -0
- package/dist/types/components/Tabs/TabPanel.d.ts +1 -1
- package/dist/types/components/Tag/Tag.d.ts +11 -0
- package/dist/types/components/Tag/index.d.ts +2 -0
- package/dist/types/components/Toast/Toast.d.ts +9 -0
- package/dist/types/components/Toast/ToastContainer.d.ts +6 -0
- package/dist/types/components/Toast/ToastContext.d.ts +15 -0
- package/dist/types/components/Toast/index.d.ts +5 -0
- package/dist/types/components/Toast/useToast.d.ts +5 -0
- package/dist/types/index.d.ts +34 -0
- package/package.json +19 -9
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Haze UI
|
|
2
2
|
|
|
3
3
|
> The React UI Component Library with controllable states.
|
|
4
4
|
|
|
@@ -16,15 +16,15 @@ English | [简体中文](./README-zh_CN.md)
|
|
|
16
16
|
### Installation
|
|
17
17
|
|
|
18
18
|
```sh
|
|
19
|
-
npm i
|
|
19
|
+
npm i haze-ui
|
|
20
20
|
// or
|
|
21
|
-
pnpm add
|
|
21
|
+
pnpm add haze-ui
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
### Usage
|
|
25
25
|
|
|
26
26
|
```jsx
|
|
27
|
-
import { Button } from '
|
|
27
|
+
import { Button } from 'haze-ui';
|
|
28
28
|
|
|
29
29
|
export default function MyComponent() {
|
|
30
30
|
return <Button>Start</Button>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { classnames as e } from "babel-runtime-jsx-plus";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import { useState as n } from "react";
|
|
5
|
+
//#region src/lib/components/Avatar/Avatar.tsx
|
|
6
|
+
var r = "b4666vo", i = {
|
|
7
|
+
sm: "sag18gw",
|
|
8
|
+
md: "m7cr8e2",
|
|
9
|
+
lg: "lmhruty"
|
|
10
|
+
}, a = "imhjc6a";
|
|
11
|
+
function o({ src: o, alt: s, size: c = "md", fallback: l, className: u }) {
|
|
12
|
+
let [d, f] = n(!1);
|
|
13
|
+
return /* @__PURE__ */ t("span", {
|
|
14
|
+
className: e([
|
|
15
|
+
r,
|
|
16
|
+
i[c],
|
|
17
|
+
u
|
|
18
|
+
]),
|
|
19
|
+
children: o && !d ? /* @__PURE__ */ t("img", {
|
|
20
|
+
className: a,
|
|
21
|
+
src: o,
|
|
22
|
+
alt: s ?? "",
|
|
23
|
+
onError: () => f(!0)
|
|
24
|
+
}) : l ?? /* @__PURE__ */ t("span", { children: s?.charAt(0).toUpperCase() ?? "?" })
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { o as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { classnames as e } from "babel-runtime-jsx-plus";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
import { Children as r } from "react";
|
|
5
|
+
//#region src/lib/components/Breadcrumb/Breadcrumb.tsx
|
|
6
|
+
var i = "n10d0fjb", a = "l727nxp", o = "sjewi7s";
|
|
7
|
+
function s({ separator: s = "/", className: c, children: l }) {
|
|
8
|
+
let u = r.toArray(l);
|
|
9
|
+
return /* @__PURE__ */ t("nav", {
|
|
10
|
+
"aria-label": "Breadcrumb",
|
|
11
|
+
className: e([i, c]),
|
|
12
|
+
children: /* @__PURE__ */ t("ol", {
|
|
13
|
+
className: a,
|
|
14
|
+
children: u.map((e, r) => /* @__PURE__ */ n("li", {
|
|
15
|
+
"aria-current": r === u.length - 1 ? "page" : void 0,
|
|
16
|
+
children: [e, r < u.length - 1 && /* @__PURE__ */ t("span", {
|
|
17
|
+
className: o,
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
children: s
|
|
20
|
+
})]
|
|
21
|
+
}, r))
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { s as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { classnames as e } from "babel-runtime-jsx-plus";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/lib/components/Breadcrumb/BreadcrumbItem.tsx
|
|
5
|
+
var n = "lr0896i", r = "cpuhw6u";
|
|
6
|
+
function i({ href: i, className: a, children: o }) {
|
|
7
|
+
return i ? /* @__PURE__ */ t("a", {
|
|
8
|
+
href: i,
|
|
9
|
+
className: e([n, a]),
|
|
10
|
+
children: o
|
|
11
|
+
}) : /* @__PURE__ */ t("span", {
|
|
12
|
+
className: e([r, a]),
|
|
13
|
+
children: o
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { i as default };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { classnames as e } from "babel-runtime-jsx-plus";
|
|
3
|
+
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { useControl as i } from "react-use-control";
|
|
5
|
+
import { Children as a, useEffect as o, useRef as s } from "react";
|
|
6
|
+
//#region src/lib/components/Carousel/Carousel.tsx
|
|
7
|
+
var c = "w1vgcode", l = "t1gm45fg", u = "nit1xjh", d = "pabcbhr", f = "nc7ezkr", p = "i1o6048a", m = "dhf6lgj", h = "dooaa69";
|
|
8
|
+
function g({ value: g, autoPlay: _ = !1, interval: v = 5e3, className: y, children: b }) {
|
|
9
|
+
let [x, S] = i(g, 0), C = s(null), w = a.count(b);
|
|
10
|
+
o(() => {
|
|
11
|
+
let e = C.current;
|
|
12
|
+
if (!e) return;
|
|
13
|
+
let t = e.children[x];
|
|
14
|
+
t && t.scrollIntoView({
|
|
15
|
+
behavior: "smooth",
|
|
16
|
+
block: "nearest",
|
|
17
|
+
inline: "start"
|
|
18
|
+
});
|
|
19
|
+
}, [x]), o(() => {
|
|
20
|
+
if (!_ || w <= 1) return;
|
|
21
|
+
let e = setInterval(() => {
|
|
22
|
+
S((e) => (e + 1) % w);
|
|
23
|
+
}, v);
|
|
24
|
+
return () => clearInterval(e);
|
|
25
|
+
}, [
|
|
26
|
+
_,
|
|
27
|
+
v,
|
|
28
|
+
w,
|
|
29
|
+
S
|
|
30
|
+
]);
|
|
31
|
+
let T = () => S((e) => (e - 1 + w) % w), E = () => S((e) => (e + 1) % w);
|
|
32
|
+
return /* @__PURE__ */ r("div", {
|
|
33
|
+
role: "region",
|
|
34
|
+
"aria-roledescription": "carousel",
|
|
35
|
+
"aria-label": "Carousel",
|
|
36
|
+
className: e([c, y]),
|
|
37
|
+
children: [/* @__PURE__ */ n("div", {
|
|
38
|
+
ref: C,
|
|
39
|
+
className: l,
|
|
40
|
+
children: b
|
|
41
|
+
}), w > 1 && /* @__PURE__ */ r(t, { children: [
|
|
42
|
+
/* @__PURE__ */ n("button", {
|
|
43
|
+
type: "button",
|
|
44
|
+
onClick: T,
|
|
45
|
+
"aria-label": "Previous slide",
|
|
46
|
+
className: e([u, d]),
|
|
47
|
+
children: "‹"
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ n("button", {
|
|
50
|
+
type: "button",
|
|
51
|
+
onClick: E,
|
|
52
|
+
"aria-label": "Next slide",
|
|
53
|
+
className: e([u, f]),
|
|
54
|
+
children: "›"
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ n("div", {
|
|
57
|
+
className: p,
|
|
58
|
+
children: Array.from({ length: w }, (t, r) => /* @__PURE__ */ n("button", {
|
|
59
|
+
type: "button",
|
|
60
|
+
onClick: () => S(r),
|
|
61
|
+
"aria-label": `Go to slide ${r + 1}`,
|
|
62
|
+
className: e([m, r === x && h])
|
|
63
|
+
}, r))
|
|
64
|
+
})
|
|
65
|
+
] })]
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export { g as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { classnames as e } from "babel-runtime-jsx-plus";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/lib/components/Carousel/CarouselSlide.tsx
|
|
5
|
+
var n = "s10j4fk7";
|
|
6
|
+
function r({ className: r, children: i }) {
|
|
7
|
+
return /* @__PURE__ */ t("div", {
|
|
8
|
+
role: "group",
|
|
9
|
+
"aria-roledescription": "slide",
|
|
10
|
+
className: e([n, r]),
|
|
11
|
+
children: i
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { r as default };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import e from "./ComboboxOption.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { classnames as t } from "babel-runtime-jsx-plus";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import { useControl as i } from "react-use-control";
|
|
6
|
+
import { useEffect as a, useId as o, useRef as s, useState as c } from "react";
|
|
7
|
+
//#region src/lib/components/Combobox/Combobox.tsx
|
|
8
|
+
var l = "w1hbn1o4", u = "i4sk2nn", d = "luqji2p", f = "h1poubj5";
|
|
9
|
+
function p({ value: p, options: m, placeholder: h, className: g }) {
|
|
10
|
+
let [_, v] = i(p, ""), [y, b] = c(""), [x, S] = c(!1), [C, w] = c(-1), T = o(), E = s(null), D = m.filter((e) => e.label.toLowerCase().includes(y.toLowerCase()));
|
|
11
|
+
a(() => {
|
|
12
|
+
w(-1);
|
|
13
|
+
}, [y]);
|
|
14
|
+
let O = (e) => {
|
|
15
|
+
v(e), b(m.find((t) => t.value === e)?.label ?? e), S(!1), E.current?.focus();
|
|
16
|
+
}, k = (e) => {
|
|
17
|
+
e.key === "ArrowDown" ? (e.preventDefault(), w((e) => Math.min(e + 1, D.length - 1))) : e.key === "ArrowUp" ? (e.preventDefault(), w((e) => Math.max(e - 1, 0))) : e.key === "Enter" && C >= 0 && D[C] ? (e.preventDefault(), O(D[C].value)) : e.key === "Escape" && S(!1);
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ r("div", {
|
|
20
|
+
className: t([l, g]),
|
|
21
|
+
children: [/* @__PURE__ */ n("input", {
|
|
22
|
+
ref: E,
|
|
23
|
+
role: "combobox",
|
|
24
|
+
"aria-expanded": x,
|
|
25
|
+
"aria-controls": T,
|
|
26
|
+
"aria-autocomplete": "list",
|
|
27
|
+
className: u,
|
|
28
|
+
value: y,
|
|
29
|
+
placeholder: h,
|
|
30
|
+
onChange: (e) => {
|
|
31
|
+
b(e.target.value), S(!0);
|
|
32
|
+
},
|
|
33
|
+
onFocus: () => S(!0),
|
|
34
|
+
onKeyDown: k
|
|
35
|
+
}), /* @__PURE__ */ n("div", {
|
|
36
|
+
id: T,
|
|
37
|
+
role: "listbox",
|
|
38
|
+
className: t([d, !x && f]),
|
|
39
|
+
children: D.map((t, r) => /* @__PURE__ */ n(e, {
|
|
40
|
+
value: t.value,
|
|
41
|
+
highlighted: r === C,
|
|
42
|
+
selected: t.value === _,
|
|
43
|
+
onSelect: O,
|
|
44
|
+
children: t.label
|
|
45
|
+
}, t.value))
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { p as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { classnames as e } from "babel-runtime-jsx-plus";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/lib/components/Combobox/ComboboxOption.tsx
|
|
5
|
+
var n = "o1jce0x2", r = "h1rwzud7", i = "s10s5833";
|
|
6
|
+
function a({ value: a, highlighted: o = !1, selected: s = !1, onSelect: c, className: l, children: u }) {
|
|
7
|
+
return /* @__PURE__ */ t("div", {
|
|
8
|
+
role: "option",
|
|
9
|
+
"aria-selected": s,
|
|
10
|
+
onClick: () => c?.(a),
|
|
11
|
+
className: e([
|
|
12
|
+
n,
|
|
13
|
+
o && r,
|
|
14
|
+
s && i,
|
|
15
|
+
l
|
|
16
|
+
]),
|
|
17
|
+
children: u
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { a as default };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { classnames as e } from "babel-runtime-jsx-plus";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
import { useState as r } from "react";
|
|
5
|
+
//#region src/lib/components/Datepicker/Calendar.tsx
|
|
6
|
+
var i = "c1f9h0hb", a = "hrefchg", o = "h144mm7c", s = "hmmnmao", c = "g1f8zgbo", l = "w1onmyfp", u = "d1om8hws", d = "dxg97in", f = "dum096m", p = [
|
|
7
|
+
"Su",
|
|
8
|
+
"Mo",
|
|
9
|
+
"Tu",
|
|
10
|
+
"We",
|
|
11
|
+
"Th",
|
|
12
|
+
"Fr",
|
|
13
|
+
"Sa"
|
|
14
|
+
];
|
|
15
|
+
function m(e, t) {
|
|
16
|
+
return new Date(e, t + 1, 0).getDate();
|
|
17
|
+
}
|
|
18
|
+
function h(e, t, n) {
|
|
19
|
+
return `${e}-${String(t + 1).padStart(2, "0")}-${String(n).padStart(2, "0")}`;
|
|
20
|
+
}
|
|
21
|
+
function g({ value: g, min: _, max: v, onSelect: y }) {
|
|
22
|
+
let b = g ? new Date(g) : /* @__PURE__ */ new Date(), [x, S] = r(b.getFullYear()), [C, w] = r(b.getMonth()), T = m(x, C), E = new Date(x, C, 1).getDay(), D = m(x, C - 1), O = () => {
|
|
23
|
+
w((e) => e === 0 ? (S((e) => e - 1), 11) : e - 1);
|
|
24
|
+
}, k = () => {
|
|
25
|
+
w((e) => e === 11 ? (S((e) => e + 1), 0) : e + 1);
|
|
26
|
+
}, A = (e) => !!(_ && e < _ || v && e > v), j = [];
|
|
27
|
+
for (let e = E - 1; e >= 0; e--) {
|
|
28
|
+
let t = C === 0 ? 11 : C - 1, n = C === 0 ? x - 1 : x;
|
|
29
|
+
j.push({
|
|
30
|
+
day: D - e,
|
|
31
|
+
month: t,
|
|
32
|
+
year: n,
|
|
33
|
+
outside: !0
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
for (let e = 1; e <= T; e++) j.push({
|
|
37
|
+
day: e,
|
|
38
|
+
month: C,
|
|
39
|
+
year: x,
|
|
40
|
+
outside: !1
|
|
41
|
+
});
|
|
42
|
+
let M = 7 - j.length % 7;
|
|
43
|
+
if (M < 7) for (let e = 1; e <= M; e++) {
|
|
44
|
+
let t = C === 11 ? 0 : C + 1, n = C === 11 ? x + 1 : x;
|
|
45
|
+
j.push({
|
|
46
|
+
day: e,
|
|
47
|
+
month: t,
|
|
48
|
+
year: n,
|
|
49
|
+
outside: !0
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
let N = new Date(x, C).toLocaleString("default", {
|
|
53
|
+
month: "long",
|
|
54
|
+
year: "numeric"
|
|
55
|
+
});
|
|
56
|
+
return /* @__PURE__ */ n("div", {
|
|
57
|
+
role: "grid",
|
|
58
|
+
"aria-label": N,
|
|
59
|
+
className: e([i]),
|
|
60
|
+
children: [/* @__PURE__ */ n("div", {
|
|
61
|
+
className: e([a]),
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ t("button", {
|
|
64
|
+
type: "button",
|
|
65
|
+
onClick: O,
|
|
66
|
+
"aria-label": "Previous month",
|
|
67
|
+
className: e([o]),
|
|
68
|
+
children: "‹"
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ t("span", {
|
|
71
|
+
className: e([s]),
|
|
72
|
+
children: N
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ t("button", {
|
|
75
|
+
type: "button",
|
|
76
|
+
onClick: k,
|
|
77
|
+
"aria-label": "Next month",
|
|
78
|
+
className: e([o]),
|
|
79
|
+
children: "›"
|
|
80
|
+
})
|
|
81
|
+
]
|
|
82
|
+
}), /* @__PURE__ */ n("div", {
|
|
83
|
+
className: e([c]),
|
|
84
|
+
children: [p.map((n) => /* @__PURE__ */ t("span", {
|
|
85
|
+
className: e([l]),
|
|
86
|
+
children: n
|
|
87
|
+
}, n)), j.map((n, r) => {
|
|
88
|
+
let i = h(n.year, n.month, n.day);
|
|
89
|
+
return /* @__PURE__ */ t("button", {
|
|
90
|
+
type: "button",
|
|
91
|
+
disabled: A(i),
|
|
92
|
+
onClick: () => y(i),
|
|
93
|
+
className: e([
|
|
94
|
+
u,
|
|
95
|
+
i === g && d,
|
|
96
|
+
n.outside && f
|
|
97
|
+
]),
|
|
98
|
+
children: n.day
|
|
99
|
+
}, r);
|
|
100
|
+
})]
|
|
101
|
+
})]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
export { g as default };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import e from "./Calendar.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { classnames as t } from "babel-runtime-jsx-plus";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
import { useControl as i } from "react-use-control";
|
|
6
|
+
import { useEffect as a, useRef as o, useState as s } from "react";
|
|
7
|
+
//#region src/lib/components/Datepicker/Datepicker.tsx
|
|
8
|
+
var c = "w1m20gol", l = "i1ydf3w1", u = "d1flfxon", d = "hhbkpj1";
|
|
9
|
+
function f({ value: f, min: p, max: m, placeholder: h = "Select date", className: g }) {
|
|
10
|
+
let [_, v] = i(f, ""), [y, b] = s(!1), x = o(null);
|
|
11
|
+
return a(() => {
|
|
12
|
+
if (!y) return;
|
|
13
|
+
let e = (e) => {
|
|
14
|
+
x.current && !x.current.contains(e.target) && b(!1);
|
|
15
|
+
};
|
|
16
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
17
|
+
}, [y]), /* @__PURE__ */ r("div", {
|
|
18
|
+
ref: x,
|
|
19
|
+
className: t([c, g]),
|
|
20
|
+
children: [/* @__PURE__ */ n("input", {
|
|
21
|
+
readOnly: !0,
|
|
22
|
+
className: l,
|
|
23
|
+
value: _,
|
|
24
|
+
placeholder: h,
|
|
25
|
+
onClick: () => b((e) => !e),
|
|
26
|
+
"aria-haspopup": "dialog",
|
|
27
|
+
"aria-expanded": y
|
|
28
|
+
}), /* @__PURE__ */ n("div", {
|
|
29
|
+
className: t([u, !y && d]),
|
|
30
|
+
children: /* @__PURE__ */ n(e, {
|
|
31
|
+
value: _,
|
|
32
|
+
min: p,
|
|
33
|
+
max: m,
|
|
34
|
+
onSelect: (e) => {
|
|
35
|
+
v(e), b(!1);
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { f as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { classnames as e } from "babel-runtime-jsx-plus";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
import { useControl as r } from "react-use-control";
|
|
5
|
+
import { useEffect as i, useRef as a } from "react";
|
|
6
|
+
//#region src/lib/components/Disclosure/Disclosure.tsx
|
|
7
|
+
var o = "d191itnz", s = "s1kaiz9e", c = "cz931n3";
|
|
8
|
+
function l({ open: l, summary: u, className: d, children: f }) {
|
|
9
|
+
let [p] = r(l, !1), m = a(null);
|
|
10
|
+
return i(() => {
|
|
11
|
+
m.current && (m.current.open = p);
|
|
12
|
+
}, [p]), /* @__PURE__ */ n("details", {
|
|
13
|
+
ref: m,
|
|
14
|
+
className: e([o, d]),
|
|
15
|
+
children: [/* @__PURE__ */ t("summary", {
|
|
16
|
+
className: s,
|
|
17
|
+
children: u
|
|
18
|
+
}), /* @__PURE__ */ t("div", {
|
|
19
|
+
className: c,
|
|
20
|
+
children: f
|
|
21
|
+
})]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { l as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { classnames as e } from "babel-runtime-jsx-plus";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
import { useRef as r } from "react";
|
|
5
|
+
//#region src/lib/components/FileInput/FileInput.tsx
|
|
6
|
+
var i = "h17p0ep7", a = "t1nmk3to";
|
|
7
|
+
function o({ children: o, className: s, ...c }) {
|
|
8
|
+
let l = r(null);
|
|
9
|
+
return /* @__PURE__ */ n("label", {
|
|
10
|
+
className: e([a, s]),
|
|
11
|
+
children: [/* @__PURE__ */ t("input", {
|
|
12
|
+
ref: l,
|
|
13
|
+
type: "file",
|
|
14
|
+
className: i,
|
|
15
|
+
...c
|
|
16
|
+
}), o ?? "Choose file"]
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { o as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { classnames as e } from "babel-runtime-jsx-plus";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/lib/components/Flex/Flex.tsx
|
|
5
|
+
var n = "b9t8w6f";
|
|
6
|
+
function r({ direction: r = "row", align: i, justify: a, gap: o, wrap: s = !1, className: c, children: l }) {
|
|
7
|
+
return /* @__PURE__ */ t("div", {
|
|
8
|
+
style: {
|
|
9
|
+
flexDirection: r,
|
|
10
|
+
alignItems: i,
|
|
11
|
+
justifyContent: a,
|
|
12
|
+
gap: typeof o == "number" ? `${o}px` : o,
|
|
13
|
+
flexWrap: s ? "wrap" : void 0
|
|
14
|
+
},
|
|
15
|
+
className: e([n, c]),
|
|
16
|
+
children: l
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { r as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { classnames as e } from "babel-runtime-jsx-plus";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/lib/components/Icon/Icon.tsx
|
|
5
|
+
var n = "b1din3i3", r = {
|
|
6
|
+
sm: "smrq8s4",
|
|
7
|
+
md: "mwqgfs4",
|
|
8
|
+
lg: "l1gcmjlm"
|
|
9
|
+
};
|
|
10
|
+
function i({ size: i = "md", className: a, children: o }) {
|
|
11
|
+
return /* @__PURE__ */ t("span", {
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
className: e([
|
|
14
|
+
n,
|
|
15
|
+
r[i],
|
|
16
|
+
a
|
|
17
|
+
]),
|
|
18
|
+
children: o
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { i as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { classnames as e } from "babel-runtime-jsx-plus";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
import { useState as n } from "react";
|
|
5
|
+
//#region src/lib/components/Image/Image.tsx
|
|
6
|
+
var r = "w184eiu0", i = "ifikscv", a = "f1rrks2c";
|
|
7
|
+
function o({ src: o, alt: s, fallback: c, aspectRatio: l, objectFit: u = "cover", className: d }) {
|
|
8
|
+
let [f, p] = n(!1);
|
|
9
|
+
return /* @__PURE__ */ t("span", {
|
|
10
|
+
style: { aspectRatio: l },
|
|
11
|
+
className: e([r, d]),
|
|
12
|
+
children: f && c ? /* @__PURE__ */ t("span", {
|
|
13
|
+
className: a,
|
|
14
|
+
children: c
|
|
15
|
+
}) : /* @__PURE__ */ t("img", {
|
|
16
|
+
className: i,
|
|
17
|
+
src: o,
|
|
18
|
+
alt: s,
|
|
19
|
+
style: { objectFit: u },
|
|
20
|
+
onError: () => p(!0)
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { o as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { classnames as e } from "babel-runtime-jsx-plus";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/lib/components/List/List.tsx
|
|
5
|
+
var n = "b6y76mu", r = {
|
|
6
|
+
unordered: "u31hqp2",
|
|
7
|
+
ordered: "o1ubwy3d",
|
|
8
|
+
none: "ngsxhlv"
|
|
9
|
+
};
|
|
10
|
+
function i({ variant: i = "unordered", className: a, children: o }) {
|
|
11
|
+
return /* @__PURE__ */ t(i === "ordered" ? "ol" : "ul", {
|
|
12
|
+
className: e([
|
|
13
|
+
n,
|
|
14
|
+
r[i],
|
|
15
|
+
a
|
|
16
|
+
]),
|
|
17
|
+
children: o
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { i as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { classnames as e } from "babel-runtime-jsx-plus";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/lib/components/List/ListItem.tsx
|
|
5
|
+
var n = "inunl6n";
|
|
6
|
+
function r({ className: r, children: i }) {
|
|
7
|
+
return /* @__PURE__ */ t("li", {
|
|
8
|
+
className: e([n, r]),
|
|
9
|
+
children: i
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as default };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { classnames as e } from "babel-runtime-jsx-plus";
|
|
3
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
|
+
import { useControl as r } from "react-use-control";
|
|
5
|
+
import { useEffect as i, useRef as a } from "react";
|
|
6
|
+
//#region src/lib/components/Menu/Menu.tsx
|
|
7
|
+
var o = "czio6g9", s = "p2k9teu", c = "hn79qla";
|
|
8
|
+
function l({ open: l, trigger: u, className: d, children: f }) {
|
|
9
|
+
let [p, m] = r(l, !1), h = a(null);
|
|
10
|
+
return i(() => {
|
|
11
|
+
if (!p) return;
|
|
12
|
+
let e = (e) => {
|
|
13
|
+
h.current && !h.current.contains(e.target) && m(!1);
|
|
14
|
+
};
|
|
15
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
16
|
+
}, [p, m]), /* @__PURE__ */ n("div", {
|
|
17
|
+
ref: h,
|
|
18
|
+
className: o,
|
|
19
|
+
children: [/* @__PURE__ */ t("span", {
|
|
20
|
+
onClick: () => m((e) => !e),
|
|
21
|
+
children: u
|
|
22
|
+
}), /* @__PURE__ */ t("div", {
|
|
23
|
+
role: "menu",
|
|
24
|
+
className: e([
|
|
25
|
+
s,
|
|
26
|
+
!p && c,
|
|
27
|
+
d
|
|
28
|
+
]),
|
|
29
|
+
children: f
|
|
30
|
+
})]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { l as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
//#region src/lib/components/Menu/MenuDivider.tsx
|
|
4
|
+
var t = "d1sgpkj8";
|
|
5
|
+
function n() {
|
|
6
|
+
return /* @__PURE__ */ e("div", {
|
|
7
|
+
className: t,
|
|
8
|
+
role: "separator"
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { classnames as e } from "babel-runtime-jsx-plus";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/lib/components/Menu/MenuItem.tsx
|
|
5
|
+
var n = "iuktz9j";
|
|
6
|
+
function r({ onSelect: r, disabled: i = !1, className: a, children: o }) {
|
|
7
|
+
return /* @__PURE__ */ t("button", {
|
|
8
|
+
type: "button",
|
|
9
|
+
role: "menuitem",
|
|
10
|
+
disabled: i,
|
|
11
|
+
onClick: r,
|
|
12
|
+
className: e([n, a]),
|
|
13
|
+
children: o
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { r as default };
|