@bccampus/ui-components 0.2.0 → 0.3.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/banner.js +14 -14
- package/dist/button.d.ts +1 -1
- package/dist/button.js +17 -17
- package/dist/caption.js +7 -8
- package/dist/card.js +34 -34
- package/dist/horizontal-list.js +32 -32
- package/dist/icon-generator.js +38 -38
- package/dist/index-U7DVCmS_.js +76 -0
- package/dist/input.js +4 -4
- package/dist/masked-image-generator.js +18 -18
- package/dist/navigation-menu.d.ts +27 -0
- package/dist/navigation-menu.js +1139 -0
- package/dist/overlay.js +2 -2
- package/dist/page-header.d.ts +5 -1
- package/dist/page-header.js +10 -9
- package/dist/page-section.js +14 -14
- package/dist/page.js +4 -4
- package/dist/search-input.js +11 -11
- package/dist/tag.js +8 -9
- package/dist/ui-components.d.ts +30 -2
- package/dist/ui-components.js +47 -37
- package/package.json +6 -1
- package/src/components/ui/banner.tsx +2 -2
- package/src/components/ui/button.tsx +8 -7
- package/src/components/ui/card.tsx +5 -5
- package/src/components/ui/horizontal-list.tsx +2 -2
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/navigation-menu.tsx +165 -0
- package/src/components/ui/page-header.tsx +13 -5
- package/src/components/ui/page-section.tsx +8 -8
- package/src/components/ui/page.tsx +3 -1
- package/src/styles/theme.css +7 -7
- package/src/styles/typography.css +334 -341
- package/vite.config.ts +5 -3
- package/vite.ladle.config.ts +17 -0
- package/dist/index-DlfV3JTY.js +0 -70
- package/dist/jsx-runtime-BzflLqGi.js +0 -282
package/dist/banner.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as
|
|
3
|
-
import { c as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { c as
|
|
1
|
+
import { jsxs as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { c as l } from "./index-CQhYMnjT.js";
|
|
3
|
+
import { c as d } from "./utils-CRiPKpXj.js";
|
|
4
|
+
import { useState as f } from "react";
|
|
5
|
+
import { Button as p } from "./button.js";
|
|
6
|
+
import { c as u } from "./createLucideIcon-CzehbSja.js";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.544.0 - ISC
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the ISC license.
|
|
11
11
|
* See the LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
13
|
+
const x = [
|
|
14
14
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
15
15
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
16
|
-
],
|
|
16
|
+
], b = u("x", x), v = l("flex flex-row items-center justify-between px-(--spacing-section) text-sm", {
|
|
17
17
|
variants: {
|
|
18
18
|
variant: {
|
|
19
19
|
default: "bg-complement-3 text-white",
|
|
@@ -30,13 +30,13 @@ const p = [
|
|
|
30
30
|
size: "default"
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
|
-
function
|
|
34
|
-
const [o, c] =
|
|
35
|
-
return o ? null : /* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */ t
|
|
37
|
-
|
|
33
|
+
function N({ className: e, size: a, variant: s, dismissible: i, children: n, ...r }) {
|
|
34
|
+
const [o, c] = f(!1);
|
|
35
|
+
return o ? null : /* @__PURE__ */ m("div", { "data-slot": "banner", className: d(v({ variant: s, size: a }), e), ...r, children: [
|
|
36
|
+
/* @__PURE__ */ t("div", { className: "flex-auto text-center", children: n }),
|
|
37
|
+
i && /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(p, { variant: "ghost", size: "icon", className: "size-6 text-white", onClick: () => c(!0), children: /* @__PURE__ */ t(b, {}) }) })
|
|
38
38
|
] });
|
|
39
39
|
}
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
N as Banner
|
|
42
42
|
};
|
package/dist/button.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare type ButtonProps = React.ComponentProps<"button"> & VariantProps<
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export declare const buttonVariants: (props?: ({
|
|
12
|
-
variant?: "default" | "secondary" | "outline" | "ghost" | "destructive" | null | undefined;
|
|
12
|
+
variant?: "default" | "secondary" | "outline" | "ghost" | "item" | "destructive" | null | undefined;
|
|
13
13
|
block?: boolean | null | undefined;
|
|
14
14
|
size?: "text" | "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
15
15
|
} & ClassProp) | undefined) => string;
|
package/dist/button.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as
|
|
3
|
-
import { c } from "./index-CQhYMnjT.js";
|
|
4
|
-
import { c
|
|
5
|
-
const
|
|
6
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-sm text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { S as s } from "./index-U7DVCmS_.js";
|
|
3
|
+
import { c as d } from "./index-CQhYMnjT.js";
|
|
4
|
+
import { c } from "./utils-CRiPKpXj.js";
|
|
5
|
+
const u = d(
|
|
6
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-sm text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 px-6 has-[>svg]:px-4 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
7
7
|
{
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
@@ -11,6 +11,7 @@ const v = c(
|
|
|
11
11
|
secondary: "bg-secondary text-secondary-foreground hover:bg-background hover:text-primary dark:bg-complement-1-500 dark:text-foreground dark:hover:bg-complement-1-600",
|
|
12
12
|
outline: "border border-primary bg-transparent hover:border-secondary hover:bg-secondary/10 dark:border-input dark:hover:bg-input/50",
|
|
13
13
|
ghost: "text-primary hover:text-secondary dark:text-foreground dark:hover:bg-complement-1-800",
|
|
14
|
+
item: "justify-between px-2 has-[>svg]:px-2 text-primary hover:bg-complement-1-50 dark:text-foreground dark:hover:bg-complement-1-800",
|
|
14
15
|
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60"
|
|
15
16
|
},
|
|
16
17
|
block: {
|
|
@@ -18,25 +19,24 @@ const v = c(
|
|
|
18
19
|
true: "w-full"
|
|
19
20
|
},
|
|
20
21
|
size: {
|
|
21
|
-
default: "h-9
|
|
22
|
-
sm: "h-8
|
|
23
|
-
lg: "h-10
|
|
22
|
+
default: "h-9",
|
|
23
|
+
sm: "h-8 gap-1.5",
|
|
24
|
+
lg: "h-10 text-base",
|
|
24
25
|
icon: "size-9",
|
|
25
|
-
text: "
|
|
26
|
+
text: "h-9 text-base"
|
|
26
27
|
}
|
|
27
28
|
},
|
|
28
29
|
defaultVariants: {
|
|
29
|
-
variant: "default",
|
|
30
30
|
size: "default",
|
|
31
|
-
block: !1
|
|
31
|
+
block: !1,
|
|
32
|
+
variant: "default"
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
);
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
return /* @__PURE__ */ s.jsx(n, { "data-slot": "button", className: u(v({ variant: r, size: t, block: o }), e), ...a });
|
|
36
|
+
function p({ className: e, variant: r, size: t, block: o, asChild: a = !1, ...i }) {
|
|
37
|
+
return /* @__PURE__ */ n(a ? s : "button", { "data-slot": "button", className: c(u({ size: t, block: o, variant: r }), e), ...i });
|
|
38
38
|
}
|
|
39
39
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
p as Button,
|
|
41
|
+
u as buttonVariants
|
|
42
42
|
};
|
package/dist/caption.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as i } from "./index-
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { S as i } from "./index-U7DVCmS_.js";
|
|
3
3
|
import { c as e } from "./index-CQhYMnjT.js";
|
|
4
4
|
import { c as m } from "./utils-CRiPKpXj.js";
|
|
5
|
-
const
|
|
5
|
+
const s = e("tracking-tight text-balance", {
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
8
8
|
default: "scroll-mr-5 text-lg/5 font-bold text-secondary dark:text-foreground",
|
|
@@ -13,16 +13,15 @@ const l = e("tracking-tight text-balance", {
|
|
|
13
13
|
variant: "default"
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
function
|
|
16
|
+
function x({
|
|
17
17
|
className: t,
|
|
18
18
|
variant: a,
|
|
19
19
|
asChild: r = !1,
|
|
20
20
|
...o
|
|
21
21
|
}) {
|
|
22
|
-
|
|
23
|
-
return /* @__PURE__ */ s.jsx(n, { className: m(l({ variant: a, className: t })), ...o });
|
|
22
|
+
return /* @__PURE__ */ n(r ? i : "div", { className: m(s({ variant: a, className: t })), ...o });
|
|
24
23
|
}
|
|
25
24
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
x as Caption,
|
|
26
|
+
s as captionVariants
|
|
28
27
|
};
|
package/dist/card.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { c as t } from "./utils-CRiPKpXj.js";
|
|
3
3
|
import { Caption as d } from "./caption.js";
|
|
4
|
-
import { c as
|
|
5
|
-
const
|
|
4
|
+
import { c as u } from "./index-CQhYMnjT.js";
|
|
5
|
+
const m = u("group @container/card w-full max-w-full bg-card text-card-foreground grid gap-(--gap-card)", {
|
|
6
6
|
variants: {
|
|
7
7
|
bordered: {
|
|
8
|
-
true: "p-card border border-complement-1-100 dark:border-brand-1-900 ",
|
|
8
|
+
true: "p-(--spacing-card) border border-complement-1-100 dark:border-brand-1-900 ",
|
|
9
9
|
false: ""
|
|
10
10
|
},
|
|
11
11
|
rounded: {
|
|
@@ -18,28 +18,28 @@ const u = s("group @container/card w-full max-w-full bg-card text-card-foregroun
|
|
|
18
18
|
rounded: !1
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
|
-
function
|
|
22
|
-
const i = a ? "a" : "div",
|
|
21
|
+
function C({ className: r, asLink: a, bordered: n, rounded: o, ...c }) {
|
|
22
|
+
const i = a ? "a" : "div", l = a ? "transition-all hover:bg-complement-1-50 dark:hover:bg-gray-900" : "";
|
|
23
23
|
return (
|
|
24
24
|
//@ts-expect-error: props type will be correct
|
|
25
|
-
/* @__PURE__ */ e
|
|
25
|
+
/* @__PURE__ */ e(i, { "data-slot": "card", className: t(m({ bordered: n, rounded: o }), l, r), ...c })
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return /* @__PURE__ */ e
|
|
28
|
+
function b({ name: r, className: a, ...n }) {
|
|
29
|
+
return /* @__PURE__ */ e(
|
|
30
30
|
"div",
|
|
31
31
|
{
|
|
32
32
|
style: { gridArea: r },
|
|
33
|
-
className: t("relative flex flex-col gap-(--card-area
|
|
33
|
+
className: t("@container/card-area relative flex flex-col gap-(--gap-card-area)", a),
|
|
34
34
|
...n
|
|
35
35
|
}
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
return /* @__PURE__ */ e
|
|
38
|
+
function h({ className: r, ...a }) {
|
|
39
|
+
return /* @__PURE__ */ e("div", { className: t("flex flex-col gap-(--gap-card-item-group)", r), ...a });
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return /* @__PURE__ */ e
|
|
41
|
+
function x({ size: r = "md", className: a, ...n }) {
|
|
42
|
+
return /* @__PURE__ */ e(
|
|
43
43
|
"div",
|
|
44
44
|
{
|
|
45
45
|
className: t(
|
|
@@ -54,8 +54,8 @@ function b({ size: r = "md", className: a, ...n }) {
|
|
|
54
54
|
}
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return /* @__PURE__ */ e
|
|
57
|
+
function N({ size: r = "md", className: a, ...n }) {
|
|
58
|
+
return /* @__PURE__ */ e(
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
61
|
className: t(
|
|
@@ -71,38 +71,38 @@ function h({ size: r = "md", className: a, ...n }) {
|
|
|
71
71
|
}
|
|
72
72
|
);
|
|
73
73
|
}
|
|
74
|
-
function N(r) {
|
|
75
|
-
return /* @__PURE__ */ e.jsx(d, { ...r });
|
|
76
|
-
}
|
|
77
74
|
function w(r) {
|
|
78
|
-
return /* @__PURE__ */ e
|
|
75
|
+
return /* @__PURE__ */ e(d, { ...r });
|
|
76
|
+
}
|
|
77
|
+
function j(r) {
|
|
78
|
+
return /* @__PURE__ */ e(d, { variant: "light", ...r });
|
|
79
79
|
}
|
|
80
80
|
function y(r) {
|
|
81
|
-
return /* @__PURE__ */ e
|
|
81
|
+
return /* @__PURE__ */ e(d, { variant: "light", ...r });
|
|
82
82
|
}
|
|
83
83
|
function k(r) {
|
|
84
|
-
return /* @__PURE__ */ e
|
|
84
|
+
return /* @__PURE__ */ e("div", { ...r });
|
|
85
85
|
}
|
|
86
86
|
function A({ className: r, ...a }) {
|
|
87
|
-
return /* @__PURE__ */ e
|
|
87
|
+
return /* @__PURE__ */ e("div", { className: t("flex flex-wrap items-center gap-(--gap-card-item-group)", r), ...a });
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
return /* @__PURE__ */ e
|
|
89
|
+
function s({ className: r, ...a }) {
|
|
90
|
+
return /* @__PURE__ */ e("div", { className: t("relative w-full h-full", r), ...a });
|
|
91
91
|
}
|
|
92
92
|
function I({ className: r, ...a }) {
|
|
93
|
-
return /* @__PURE__ */ e
|
|
93
|
+
return /* @__PURE__ */ e(s, { children: /* @__PURE__ */ e("img", { className: t("w-full h-full rounded-lg aspect-9/5 object-cover object-top", r), ...a }) });
|
|
94
94
|
}
|
|
95
95
|
export {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
C as Card,
|
|
97
|
+
b as CardArea,
|
|
98
|
+
w as CardCaption,
|
|
99
99
|
k as CardContent,
|
|
100
100
|
I as CardImage,
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
h as CardItemGroup,
|
|
102
|
+
s as CardMedia,
|
|
103
103
|
y as CardMeta,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
104
|
+
j as CardSubcaption,
|
|
105
|
+
N as CardSubtitle,
|
|
106
|
+
x as CardTitle,
|
|
107
107
|
A as CardToolbar
|
|
108
108
|
};
|
package/dist/horizontal-list.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { c as
|
|
6
|
-
import { c as
|
|
1
|
+
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as r } from "./utils-CRiPKpXj.js";
|
|
3
|
+
import { Button as c } from "./button.js";
|
|
4
|
+
import { useRef as u, useCallback as a } from "react";
|
|
5
|
+
import { c as v } from "./index-CQhYMnjT.js";
|
|
6
|
+
import { c as i } from "./createLucideIcon-CzehbSja.js";
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.544.0 - ISC
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the ISC license.
|
|
11
11
|
* See the LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
13
|
+
const x = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], g = i("chevron-left", x);
|
|
14
14
|
/**
|
|
15
15
|
* @license lucide-react v0.544.0 - ISC
|
|
16
16
|
*
|
|
17
17
|
* This source code is licensed under the ISC license.
|
|
18
18
|
* See the LICENSE file in the root directory of this source tree.
|
|
19
19
|
*/
|
|
20
|
-
const
|
|
21
|
-
"scrollbar-hidden overscroll-x-contain flex flex-row flex-nowrap py-1 gap-card overflow-x-auto snap-x snap-mandatory touch-pan-x scroll-smooth *:shrink-0 *:grow-0 *:snap-center *:select-none",
|
|
20
|
+
const w = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], N = i("chevron-right", w), k = v(
|
|
21
|
+
"scrollbar-hidden overscroll-x-contain flex flex-row flex-nowrap py-1 gap-(--gap-card) overflow-x-auto snap-x snap-mandatory touch-pan-x scroll-smooth *:shrink-0 *:grow-0 *:snap-center *:select-none",
|
|
22
22
|
{
|
|
23
23
|
variants: {
|
|
24
24
|
variant: {
|
|
25
25
|
contain: "w-full ",
|
|
26
|
-
overflow: "w-screen px-section -ms-section scroll-px-(--section
|
|
26
|
+
overflow: "w-screen px-(--spacing-section) -ms-(--spacing-section) scroll-px-(--spacing-section)"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
defaultVariants: {
|
|
@@ -31,47 +31,47 @@ const j = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], g = a("chevron-righ
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
);
|
|
34
|
-
function
|
|
35
|
-
variant:
|
|
36
|
-
className:
|
|
37
|
-
children:
|
|
34
|
+
function _({
|
|
35
|
+
variant: l,
|
|
36
|
+
className: f,
|
|
37
|
+
children: m,
|
|
38
38
|
toolbarLocation: t = "bottom",
|
|
39
39
|
scrollBy: e = 360,
|
|
40
|
-
...
|
|
40
|
+
...p
|
|
41
41
|
}) {
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
}, [e]),
|
|
45
|
-
|
|
42
|
+
const n = u(null), h = a(() => {
|
|
43
|
+
n.current?.scrollBy({ left: -e });
|
|
44
|
+
}, [e]), d = a(() => {
|
|
45
|
+
n.current?.scrollBy({ left: e });
|
|
46
46
|
}, [e]);
|
|
47
|
-
return /* @__PURE__ */
|
|
47
|
+
return /* @__PURE__ */ s(
|
|
48
48
|
"div",
|
|
49
49
|
{
|
|
50
|
-
className:
|
|
50
|
+
className: r("flex gap-4", {
|
|
51
51
|
"flex-col": t === "bottom",
|
|
52
52
|
"flex-col-reverse": t === "top"
|
|
53
53
|
}),
|
|
54
54
|
children: [
|
|
55
|
-
/* @__PURE__ */ o
|
|
55
|
+
/* @__PURE__ */ o(
|
|
56
56
|
"div",
|
|
57
57
|
{
|
|
58
|
-
ref:
|
|
59
|
-
className:
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
ref: n,
|
|
59
|
+
className: r(
|
|
60
|
+
k({ variant: l }),
|
|
61
|
+
f
|
|
62
62
|
),
|
|
63
|
-
...
|
|
64
|
-
children:
|
|
63
|
+
...p,
|
|
64
|
+
children: m
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */ o
|
|
69
|
-
/* @__PURE__ */ o
|
|
67
|
+
/* @__PURE__ */ s("div", { className: "flex justify-center sm:justify-start", children: [
|
|
68
|
+
/* @__PURE__ */ o(c, { size: "icon", variant: "ghost", className: "rounded-full", onClick: h, children: /* @__PURE__ */ o(g, { className: "size-9" }) }),
|
|
69
|
+
/* @__PURE__ */ o(c, { size: "icon", variant: "ghost", className: "rounded-full", onClick: d, children: /* @__PURE__ */ o(N, { className: "size-9" }) })
|
|
70
70
|
] })
|
|
71
71
|
]
|
|
72
72
|
}
|
|
73
73
|
);
|
|
74
74
|
}
|
|
75
75
|
export {
|
|
76
|
-
|
|
76
|
+
_ as HorizontalList
|
|
77
77
|
};
|
package/dist/icon-generator.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as M } from "react";
|
|
3
3
|
import { c as d } from "./utils-CRiPKpXj.js";
|
|
4
4
|
const $ = {
|
|
@@ -27,7 +27,7 @@ const $ = {
|
|
|
27
27
|
PieNW: 23,
|
|
28
28
|
PieNE: 24,
|
|
29
29
|
PieRand: 25
|
|
30
|
-
},
|
|
30
|
+
}, p = [
|
|
31
31
|
$.Square,
|
|
32
32
|
$.Circle,
|
|
33
33
|
$.Diamond,
|
|
@@ -42,11 +42,11 @@ const $ = {
|
|
|
42
42
|
$.PieNE
|
|
43
43
|
], N = {
|
|
44
44
|
[$.Blank]: () => null,
|
|
45
|
-
[$.Rand]: (c, r, a, s) => N[
|
|
45
|
+
[$.Rand]: (c, r, a, s) => N[p[Math.floor(Math.random() * p.length)]](c, r, a, s),
|
|
46
46
|
[$.Mosaic]: (c, r, a, s) => N[Math.random() > 0.8 ? $.Blank : $.Square](c, r, a, s),
|
|
47
47
|
[$.MosaicCircle]: (c, r, a, s) => N[Math.random() > 0.8 ? $.Blank : $.Circle](c, r, a, s),
|
|
48
48
|
[$.MosaicDiamond]: (c, r, a, s) => N[Math.random() > 0.8 ? $.Blank : $.Diamond](c, r, a, s),
|
|
49
|
-
[$.Square]: (c, r, a, s) => /* @__PURE__ */ h
|
|
49
|
+
[$.Square]: (c, r, a, s) => /* @__PURE__ */ h(
|
|
50
50
|
"rect",
|
|
51
51
|
{
|
|
52
52
|
x: a * c,
|
|
@@ -57,7 +57,7 @@ const $ = {
|
|
|
57
57
|
},
|
|
58
58
|
`tile-${c}-${r}`
|
|
59
59
|
),
|
|
60
|
-
[$.Circle]: (c, r, a, s) => /* @__PURE__ */ h
|
|
60
|
+
[$.Circle]: (c, r, a, s) => /* @__PURE__ */ h(
|
|
61
61
|
"circle",
|
|
62
62
|
{
|
|
63
63
|
cx: a * (c + 0.5 * s.scale),
|
|
@@ -67,7 +67,7 @@ const $ = {
|
|
|
67
67
|
},
|
|
68
68
|
`tile-${c}-${r}`
|
|
69
69
|
),
|
|
70
|
-
[$.Diamond]: (c, r, a, s) => /* @__PURE__ */ h
|
|
70
|
+
[$.Diamond]: (c, r, a, s) => /* @__PURE__ */ h(
|
|
71
71
|
"path",
|
|
72
72
|
{
|
|
73
73
|
d: `M ${a * (c + 0.5 * s.scale)} ${a * r}
|
|
@@ -80,7 +80,7 @@ const $ = {
|
|
|
80
80
|
),
|
|
81
81
|
[$.Hexagon]: (c, r, a, s) => {
|
|
82
82
|
const o = a / Math.sqrt(3), m = (a - o) / 2;
|
|
83
|
-
return /* @__PURE__ */ h
|
|
83
|
+
return /* @__PURE__ */ h(
|
|
84
84
|
"path",
|
|
85
85
|
{
|
|
86
86
|
rotate: 45,
|
|
@@ -96,7 +96,7 @@ const $ = {
|
|
|
96
96
|
);
|
|
97
97
|
},
|
|
98
98
|
[$.RandBasic]: (c, r, a, s) => N[$.Square + Math.floor(Math.random() * 4)](c, r, a, s),
|
|
99
|
-
[$.TriangleSE]: (c, r, a, s) => /* @__PURE__ */ h
|
|
99
|
+
[$.TriangleSE]: (c, r, a, s) => /* @__PURE__ */ h(
|
|
100
100
|
"path",
|
|
101
101
|
{
|
|
102
102
|
d: `M ${a * (c + s.scale)} ${a * r}
|
|
@@ -106,7 +106,7 @@ const $ = {
|
|
|
106
106
|
},
|
|
107
107
|
`tile-${c}-${r}`
|
|
108
108
|
),
|
|
109
|
-
[$.TriangleSW]: (c, r, a, s) => /* @__PURE__ */ h
|
|
109
|
+
[$.TriangleSW]: (c, r, a, s) => /* @__PURE__ */ h(
|
|
110
110
|
"path",
|
|
111
111
|
{
|
|
112
112
|
d: `M ${a * c} ${a * r}
|
|
@@ -116,7 +116,7 @@ const $ = {
|
|
|
116
116
|
},
|
|
117
117
|
`tile-${c}-${r}`
|
|
118
118
|
),
|
|
119
|
-
[$.TriangleNW]: (c, r, a, s) => /* @__PURE__ */ h
|
|
119
|
+
[$.TriangleNW]: (c, r, a, s) => /* @__PURE__ */ h(
|
|
120
120
|
"path",
|
|
121
121
|
{
|
|
122
122
|
d: `M ${a * (c + s.scale)} ${a * r}
|
|
@@ -126,7 +126,7 @@ const $ = {
|
|
|
126
126
|
},
|
|
127
127
|
`tile-${c}-${r}`
|
|
128
128
|
),
|
|
129
|
-
[$.TriangleNE]: (c, r, a, s) => /* @__PURE__ */ h
|
|
129
|
+
[$.TriangleNE]: (c, r, a, s) => /* @__PURE__ */ h(
|
|
130
130
|
"path",
|
|
131
131
|
{
|
|
132
132
|
d: `M ${a * c} ${a * r}
|
|
@@ -142,7 +142,7 @@ const $ = {
|
|
|
142
142
|
a,
|
|
143
143
|
s
|
|
144
144
|
),
|
|
145
|
-
[$.CaretN]: (c, r, a, s) => /* @__PURE__ */ h
|
|
145
|
+
[$.CaretN]: (c, r, a, s) => /* @__PURE__ */ h(
|
|
146
146
|
"path",
|
|
147
147
|
{
|
|
148
148
|
d: `M ${a * c} ${a * (r + s.scale)}
|
|
@@ -152,7 +152,7 @@ const $ = {
|
|
|
152
152
|
},
|
|
153
153
|
`tile-${c}-${r}`
|
|
154
154
|
),
|
|
155
|
-
[$.CaretE]: (c, r, a, s) => /* @__PURE__ */ h
|
|
155
|
+
[$.CaretE]: (c, r, a, s) => /* @__PURE__ */ h(
|
|
156
156
|
"path",
|
|
157
157
|
{
|
|
158
158
|
d: `M ${a * c} ${a * r}
|
|
@@ -162,7 +162,7 @@ const $ = {
|
|
|
162
162
|
},
|
|
163
163
|
`tile-${c}-${r}`
|
|
164
164
|
),
|
|
165
|
-
[$.CaretS]: (c, r, a, s) => /* @__PURE__ */ h
|
|
165
|
+
[$.CaretS]: (c, r, a, s) => /* @__PURE__ */ h(
|
|
166
166
|
"path",
|
|
167
167
|
{
|
|
168
168
|
d: `M ${a * c} ${a * r}
|
|
@@ -172,7 +172,7 @@ const $ = {
|
|
|
172
172
|
},
|
|
173
173
|
`tile-${c}-${r}`
|
|
174
174
|
),
|
|
175
|
-
[$.CaretW]: (c, r, a, s) => /* @__PURE__ */ h
|
|
175
|
+
[$.CaretW]: (c, r, a, s) => /* @__PURE__ */ h(
|
|
176
176
|
"path",
|
|
177
177
|
{
|
|
178
178
|
d: `M ${a * (c + s.scale)} ${a * r}
|
|
@@ -183,7 +183,7 @@ const $ = {
|
|
|
183
183
|
`tile-${c}-${r}`
|
|
184
184
|
),
|
|
185
185
|
[$.CaretRand]: (c, r, a, s) => N[$.CaretN + Math.floor(Math.random() * 4)](c, r, a, s),
|
|
186
|
-
[$.PieSE]: (c, r, a, s) => /* @__PURE__ */ h
|
|
186
|
+
[$.PieSE]: (c, r, a, s) => /* @__PURE__ */ h(
|
|
187
187
|
"path",
|
|
188
188
|
{
|
|
189
189
|
d: `M ${a * s.scale + a * c} ${a * r}
|
|
@@ -193,7 +193,7 @@ const $ = {
|
|
|
193
193
|
},
|
|
194
194
|
`tile-${c}-${r}`
|
|
195
195
|
),
|
|
196
|
-
[$.PieSW]: (c, r, a, s) => /* @__PURE__ */ h
|
|
196
|
+
[$.PieSW]: (c, r, a, s) => /* @__PURE__ */ h(
|
|
197
197
|
"path",
|
|
198
198
|
{
|
|
199
199
|
d: `M ${a * s.scale + a * c} ${a * s.scale + a * r}
|
|
@@ -203,7 +203,7 @@ const $ = {
|
|
|
203
203
|
},
|
|
204
204
|
`tile-${c}-${r}`
|
|
205
205
|
),
|
|
206
|
-
[$.PieNW]: (c, r, a, s) => /* @__PURE__ */ h
|
|
206
|
+
[$.PieNW]: (c, r, a, s) => /* @__PURE__ */ h(
|
|
207
207
|
"path",
|
|
208
208
|
{
|
|
209
209
|
d: `M ${a * c} ${a * s.scale + a * r}
|
|
@@ -213,7 +213,7 @@ const $ = {
|
|
|
213
213
|
},
|
|
214
214
|
`tile-${c}-${r}`
|
|
215
215
|
),
|
|
216
|
-
[$.PieNE]: (c, r, a, s) => /* @__PURE__ */ h
|
|
216
|
+
[$.PieNE]: (c, r, a, s) => /* @__PURE__ */ h(
|
|
217
217
|
"path",
|
|
218
218
|
{
|
|
219
219
|
d: `M ${a * c} ${a * r}
|
|
@@ -224,34 +224,34 @@ const $ = {
|
|
|
224
224
|
`tile-${c}-${r}`
|
|
225
225
|
),
|
|
226
226
|
[$.PieRand]: (c, r, a, s) => N[$.PieSE + Math.floor(Math.random() * 4)](c, r, a, s)
|
|
227
|
-
},
|
|
228
|
-
(s, o) => s.map((m,
|
|
227
|
+
}, w = (c, r, a) => c.map(
|
|
228
|
+
(s, o) => s.map((m, L) => {
|
|
229
229
|
const n = typeof m == "object" ? { className: d(a, m.className), scale: m.scale ?? 1, shape: m.shape } : { className: a, scale: 1, shape: m };
|
|
230
|
-
return N[n.shape](
|
|
230
|
+
return N[n.shape](L, o, r, n);
|
|
231
231
|
})
|
|
232
|
-
).flat(),
|
|
232
|
+
).flat(), R = [
|
|
233
233
|
[$.PieRand, $.PieRand],
|
|
234
234
|
[$.PieRand, $.PieRand]
|
|
235
235
|
];
|
|
236
|
-
function
|
|
237
|
-
pattern: c =
|
|
236
|
+
function x({
|
|
237
|
+
pattern: c = R,
|
|
238
238
|
tileSize: r = 64,
|
|
239
239
|
tileClassName: a,
|
|
240
240
|
tileBgClassName: s,
|
|
241
241
|
renderChildren: o,
|
|
242
242
|
fit: m = "none",
|
|
243
|
-
...
|
|
243
|
+
...L
|
|
244
244
|
}) {
|
|
245
245
|
const n = M(
|
|
246
246
|
() => ({
|
|
247
|
-
width: c.reduce((u,
|
|
247
|
+
width: c.reduce((u, E) => Math.max(u, E.length), 0) * r,
|
|
248
248
|
height: c.length * r
|
|
249
249
|
}),
|
|
250
250
|
[c, r]
|
|
251
|
-
),
|
|
252
|
-
const u =
|
|
251
|
+
), k = M(() => {
|
|
252
|
+
const u = w(c, r, a);
|
|
253
253
|
return s && u.unshift(
|
|
254
|
-
/* @__PURE__ */ h
|
|
254
|
+
/* @__PURE__ */ h(
|
|
255
255
|
"rect",
|
|
256
256
|
{
|
|
257
257
|
x: 0,
|
|
@@ -263,7 +263,7 @@ function Z({
|
|
|
263
263
|
"svg-mask-invert"
|
|
264
264
|
)
|
|
265
265
|
), u;
|
|
266
|
-
}, [c, n, a, s, r]),
|
|
266
|
+
}, [c, n, a, s, r]), P = M(() => {
|
|
267
267
|
switch (m) {
|
|
268
268
|
case "fill":
|
|
269
269
|
return n.width <= n.height ? "100%" : void 0;
|
|
@@ -274,7 +274,7 @@ function Z({
|
|
|
274
274
|
default:
|
|
275
275
|
return;
|
|
276
276
|
}
|
|
277
|
-
}, [m, n]),
|
|
277
|
+
}, [m, n]), T = M(() => {
|
|
278
278
|
switch (m) {
|
|
279
279
|
case "fill":
|
|
280
280
|
return n.height < n.width ? "100%" : void 0;
|
|
@@ -286,18 +286,18 @@ function Z({
|
|
|
286
286
|
return;
|
|
287
287
|
}
|
|
288
288
|
}, [m, n]);
|
|
289
|
-
return /* @__PURE__ */ h
|
|
289
|
+
return /* @__PURE__ */ h(
|
|
290
290
|
"svg",
|
|
291
291
|
{
|
|
292
|
-
width:
|
|
293
|
-
height:
|
|
292
|
+
width: P,
|
|
293
|
+
height: T,
|
|
294
294
|
viewBox: `0 0 ${n.width} ${n.height}`,
|
|
295
295
|
overflow: "visible",
|
|
296
|
-
...
|
|
297
|
-
children: o ? o(
|
|
296
|
+
...L,
|
|
297
|
+
children: o ? o(k, n.width, n.height) : k
|
|
298
298
|
}
|
|
299
299
|
);
|
|
300
300
|
}
|
|
301
301
|
export {
|
|
302
|
-
|
|
302
|
+
x as IconGenerator
|
|
303
303
|
};
|