@bccampus/ui-components 0.1.0 → 0.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.
Files changed (65) hide show
  1. package/dist/banner.d.ts +16 -0
  2. package/dist/banner.js +42 -0
  3. package/dist/button.d.ts +5 -4
  4. package/dist/button.js +20 -14
  5. package/dist/caption.js +9 -8
  6. package/dist/card.d.ts +15 -9
  7. package/dist/card.js +62 -84
  8. package/dist/createLucideIcon-CzehbSja.js +94 -0
  9. package/dist/horizontal-list.d.ts +9 -2
  10. package/dist/horizontal-list.js +47 -115
  11. package/dist/icon-generator.d.ts +2 -1
  12. package/dist/icon-generator.js +180 -147
  13. package/dist/index-CQhYMnjT.js +34 -0
  14. package/dist/index-DlfV3JTY.js +70 -0
  15. package/dist/input.d.ts +7 -0
  16. package/dist/input.js +18 -0
  17. package/dist/masked-image-generator.d.ts +1 -0
  18. package/dist/overlay.d.ts +13 -0
  19. package/dist/overlay.js +27 -0
  20. package/dist/page-header.d.ts +5 -0
  21. package/dist/page-header.js +943 -0
  22. package/dist/page-section.d.ts +14 -0
  23. package/dist/page-section.js +31 -0
  24. package/dist/page.d.ts +7 -0
  25. package/dist/page.js +8 -0
  26. package/dist/search-input.d.ts +7 -0
  27. package/dist/search-input.js +23 -0
  28. package/dist/tag.d.ts +2 -2
  29. package/dist/tag.js +10 -9
  30. package/dist/ui-components.d.ts +84 -29
  31. package/dist/ui-components.js +42 -27
  32. package/package.json +44 -15
  33. package/src/assets/images/image_06.jpg +0 -0
  34. package/src/components/ui/banner.tsx +48 -0
  35. package/src/components/ui/button.tsx +52 -47
  36. package/src/components/ui/card.tsx +131 -147
  37. package/src/components/ui/horizontal-list.tsx +75 -50
  38. package/src/components/ui/icon-generator/generate-tiles.tsx +243 -243
  39. package/src/components/ui/icon-generator/icon-generator.tsx +84 -51
  40. package/src/components/ui/icon-generator/masked-image-generator.tsx +38 -38
  41. package/src/components/ui/icon-generator/types.ts +53 -52
  42. package/src/components/ui/index.ts +11 -4
  43. package/src/components/ui/input.tsx +17 -0
  44. package/src/components/ui/overlay.tsx +29 -0
  45. package/src/components/ui/page-header.tsx +16 -0
  46. package/src/components/ui/page-section.tsx +33 -0
  47. package/src/components/ui/page.tsx +9 -0
  48. package/src/components/ui/search-input.tsx +16 -0
  49. package/src/components/ui/tag.tsx +39 -39
  50. package/src/components/ui/typography/caption.tsx +32 -32
  51. package/src/styles/all.css +4 -4
  52. package/src/styles/colors.css +9 -10
  53. package/src/styles/index.css +7 -7
  54. package/src/styles/theme.css +56 -2
  55. package/src/styles/typography.css +480 -479
  56. package/tsconfig.app.json +37 -37
  57. package/vite.config.ts +51 -44
  58. package/dist/@bccampus-ui-components-0.1.0.tgz +0 -0
  59. package/dist/index-DcqAdr0d.js +0 -102
  60. package/dist/mockServiceWorker.js +0 -348
  61. package/public/mockServiceWorker.js +0 -348
  62. package/src/assets/images/bg_pattern_01.png +0 -0
  63. package/src/assets/images/bg_pattern_02.png +0 -0
  64. package/src/assets/images/bg_pattern_03.png +0 -0
  65. package/src/assets/images/bg_pattern_04.png +0 -0
@@ -1,145 +1,77 @@
1
- import { j as a } from "./jsx-runtime-BzflLqGi.js";
2
- import { c as m } from "./utils-CRiPKpXj.js";
3
- import { Button as u } from "./button.js";
4
- import { forwardRef as d, createElement as l, useRef as v, useCallback as f } from "react";
1
+ import { j as o } from "./jsx-runtime-BzflLqGi.js";
2
+ import { c as n } from "./utils-CRiPKpXj.js";
3
+ import { Button as r } from "./button.js";
4
+ import { useRef as p, useCallback as c } from "react";
5
+ import { c as d } from "./index-CQhYMnjT.js";
6
+ import { c as a } from "./createLucideIcon-CzehbSja.js";
5
7
  /**
6
8
  * @license lucide-react v0.544.0 - ISC
7
9
  *
8
10
  * This source code is licensed under the ISC license.
9
11
  * See the LICENSE file in the root directory of this source tree.
10
12
  */
11
- const j = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), y = (t) => t.replace(
12
- /^([A-Z])|[\s-_]+(\w)/g,
13
- (e, o, r) => r ? r.toUpperCase() : o.toLowerCase()
14
- ), p = (t) => {
15
- const e = y(t);
16
- return e.charAt(0).toUpperCase() + e.slice(1);
17
- }, h = (...t) => t.filter((e, o, r) => !!e && e.trim() !== "" && r.indexOf(e) === o).join(" ").trim(), k = (t) => {
18
- for (const e in t)
19
- if (e.startsWith("aria-") || e === "role" || e === "title")
20
- return !0;
21
- };
22
- /**
23
- * @license lucide-react v0.544.0 - ISC
24
- *
25
- * This source code is licensed under the ISC license.
26
- * See the LICENSE file in the root directory of this source tree.
27
- */
28
- var N = {
29
- xmlns: "http://www.w3.org/2000/svg",
30
- width: 24,
31
- height: 24,
32
- viewBox: "0 0 24 24",
33
- fill: "none",
34
- stroke: "currentColor",
35
- strokeWidth: 2,
36
- strokeLinecap: "round",
37
- strokeLinejoin: "round"
38
- };
13
+ const u = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], v = a("chevron-left", u);
39
14
  /**
40
15
  * @license lucide-react v0.544.0 - ISC
41
16
  *
42
17
  * This source code is licensed under the ISC license.
43
18
  * See the LICENSE file in the root directory of this source tree.
44
19
  */
45
- const b = d(
46
- ({
47
- color: t = "currentColor",
48
- size: e = 24,
49
- strokeWidth: o = 2,
50
- absoluteStrokeWidth: r,
51
- className: n = "",
52
- children: s,
53
- iconNode: c,
54
- ...i
55
- }, C) => l(
56
- "svg",
57
- {
58
- ref: C,
59
- ...N,
60
- width: e,
61
- height: e,
62
- stroke: t,
63
- strokeWidth: r ? Number(o) * 24 / Number(e) : o,
64
- className: h("lucide", n),
65
- ...!s && !k(i) && { "aria-hidden": "true" },
66
- ...i
20
+ const j = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], g = a("chevron-right", j), w = d(
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",
22
+ {
23
+ variants: {
24
+ variant: {
25
+ contain: "w-full ",
26
+ overflow: "w-screen px-section -ms-section scroll-px-(--section-p)"
27
+ }
67
28
  },
68
- [
69
- ...c.map(([g, w]) => l(g, w)),
70
- ...Array.isArray(s) ? s : [s]
71
- ]
72
- )
29
+ defaultVariants: {
30
+ variant: "contain"
31
+ }
32
+ }
73
33
  );
74
- /**
75
- * @license lucide-react v0.544.0 - ISC
76
- *
77
- * This source code is licensed under the ISC license.
78
- * See the LICENSE file in the root directory of this source tree.
79
- */
80
- const x = (t, e) => {
81
- const o = d(
82
- ({ className: r, ...n }, s) => l(b, {
83
- ref: s,
84
- iconNode: e,
85
- className: h(
86
- `lucide-${j(p(t))}`,
87
- `lucide-${t}`,
88
- r
89
- ),
90
- ...n
91
- })
92
- );
93
- return o.displayName = p(t), o;
94
- };
95
- /**
96
- * @license lucide-react v0.544.0 - ISC
97
- *
98
- * This source code is licensed under the ISC license.
99
- * See the LICENSE file in the root directory of this source tree.
100
- */
101
- const A = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], L = x("chevron-left", A);
102
- /**
103
- * @license lucide-react v0.544.0 - ISC
104
- *
105
- * This source code is licensed under the ISC license.
106
- * See the LICENSE file in the root directory of this source tree.
107
- */
108
- const R = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], B = x("chevron-right", R);
109
- function I({ className: t, children: e, toolbarLocation: o = "bottom", ...r }) {
110
- const n = v(null), s = f(() => {
111
- n.current?.scrollBy({ left: -320 });
112
- }, []), c = f(() => {
113
- n.current?.scrollBy({ left: 320 });
114
- }, []);
115
- return /* @__PURE__ */ a.jsxs(
34
+ function L({
35
+ variant: i,
36
+ className: l,
37
+ children: f,
38
+ toolbarLocation: t = "bottom",
39
+ scrollBy: e = 360,
40
+ ...m
41
+ }) {
42
+ const s = p(null), x = c(() => {
43
+ s.current?.scrollBy({ left: -e });
44
+ }, [e]), h = c(() => {
45
+ s.current?.scrollBy({ left: e });
46
+ }, [e]);
47
+ return /* @__PURE__ */ o.jsxs(
116
48
  "div",
117
49
  {
118
- className: m("flex gap-4", {
119
- "flex-col": o === "bottom",
120
- "flex-col-reverse": o === "top"
50
+ className: n("flex gap-4", {
51
+ "flex-col": t === "bottom",
52
+ "flex-col-reverse": t === "top"
121
53
  }),
122
54
  children: [
123
- /* @__PURE__ */ a.jsx(
55
+ /* @__PURE__ */ o.jsx(
124
56
  "div",
125
57
  {
126
- ref: n,
127
- className: m(
128
- "scrollbar-hidden overscroll-contain -ms-4 py-1 px-4 gap-4 sm:-ms-8 sm:px-8 sm:gap-8 flex flex-row flex-nowrap overflow-x-auto w-screen snap-x snap-mandatory touch-pan-x scroll-smooth",
129
- t
58
+ ref: s,
59
+ className: n(
60
+ w({ variant: i }),
61
+ l
130
62
  ),
131
- ...r,
132
- children: e
63
+ ...m,
64
+ children: f
133
65
  }
134
66
  ),
135
- /* @__PURE__ */ a.jsxs("div", { className: "flex justify-center sm:justify-start", children: [
136
- /* @__PURE__ */ a.jsx(u, { size: "icon", variant: "ghost", className: "rounded-full", onClick: s, children: /* @__PURE__ */ a.jsx(L, { className: "size-9" }) }),
137
- /* @__PURE__ */ a.jsx(u, { size: "icon", variant: "ghost", className: "rounded-full", onClick: c, children: /* @__PURE__ */ a.jsx(B, { className: "size-9" }) })
67
+ /* @__PURE__ */ o.jsxs("div", { className: "flex justify-center sm:justify-start", children: [
68
+ /* @__PURE__ */ o.jsx(r, { size: "icon", variant: "ghost", className: "rounded-full", onClick: x, children: /* @__PURE__ */ o.jsx(v, { className: "size-9" }) }),
69
+ /* @__PURE__ */ o.jsx(r, { size: "icon", variant: "ghost", className: "rounded-full", onClick: h, children: /* @__PURE__ */ o.jsx(g, { className: "size-9" }) })
138
70
  ] })
139
71
  ]
140
72
  }
141
73
  );
142
74
  }
143
75
  export {
144
- I as HorizontalList
76
+ L as HorizontalList
145
77
  };
@@ -1,13 +1,14 @@
1
1
  import { JSX } from 'react';
2
2
  import { JSX as JSX_2 } from 'react/jsx-runtime';
3
3
 
4
- export declare function IconGenerator({ pattern, tileSize, tileClassName, tileBgClassName, renderChildren, ...props }: IconGeneratorProps): JSX_2.Element;
4
+ export declare function IconGenerator({ pattern, tileSize, tileClassName, tileBgClassName, renderChildren, fit, ...props }: IconGeneratorProps): JSX_2.Element;
5
5
 
6
6
  declare interface IconGeneratorProps extends Omit<React.ComponentProps<"svg">, "children" | "width" | "height" | "overflow"> {
7
7
  pattern?: (TileShape | TileConfig)[][];
8
8
  tileSize?: number;
9
9
  tileClassName?: string;
10
10
  tileBgClassName?: string;
11
+ fit?: "none" | "fill" | "width" | "height";
11
12
  renderChildren?: (paths: (JSX.Element | null)[], width: number, height: number) => React.ReactNode;
12
13
  }
13
14
 
@@ -1,7 +1,7 @@
1
1
  import { j as h } from "./jsx-runtime-BzflLqGi.js";
2
- import { useMemo as x } from "react";
3
- import { c as n } from "./utils-CRiPKpXj.js";
4
- const r = {
2
+ import { useMemo as M } from "react";
3
+ import { c as d } from "./utils-CRiPKpXj.js";
4
+ const $ = {
5
5
  Blank: 0,
6
6
  Rand: 1,
7
7
  Mosaic: 2,
@@ -27,244 +27,277 @@ const r = {
27
27
  PieNW: 23,
28
28
  PieNE: 24,
29
29
  PieRand: 25
30
- }, L = [
31
- r.Square,
32
- r.Circle,
33
- r.Diamond,
34
- r.Hexagon,
35
- r.TriangleSE,
36
- r.TriangleSW,
37
- r.TriangleNW,
38
- r.TriangleNE,
39
- r.PieSE,
40
- r.PieSW,
41
- r.PieNW,
42
- r.PieNE
30
+ }, k = [
31
+ $.Square,
32
+ $.Circle,
33
+ $.Diamond,
34
+ $.Hexagon,
35
+ $.TriangleSE,
36
+ $.TriangleSW,
37
+ $.TriangleNW,
38
+ $.TriangleNE,
39
+ $.PieSE,
40
+ $.PieSW,
41
+ $.PieNW,
42
+ $.PieNE
43
43
  ], N = {
44
- [r.Blank]: () => null,
45
- [r.Rand]: (c, $, a, s) => N[L[Math.floor(Math.random() * L.length)]](c, $, a, s),
46
- [r.Mosaic]: (c, $, a, s) => N[Math.random() > 0.8 ? r.Blank : r.Square](c, $, a, s),
47
- [r.MosaicCircle]: (c, $, a, s) => N[Math.random() > 0.8 ? r.Blank : r.Circle](c, $, a, s),
48
- [r.MosaicDiamond]: (c, $, a, s) => N[Math.random() > 0.8 ? r.Blank : r.Diamond](c, $, a, s),
49
- [r.Square]: (c, $, a, s) => /* @__PURE__ */ h.jsx(
44
+ [$.Blank]: () => null,
45
+ [$.Rand]: (c, r, a, s) => N[k[Math.floor(Math.random() * k.length)]](c, r, a, s),
46
+ [$.Mosaic]: (c, r, a, s) => N[Math.random() > 0.8 ? $.Blank : $.Square](c, r, a, s),
47
+ [$.MosaicCircle]: (c, r, a, s) => N[Math.random() > 0.8 ? $.Blank : $.Circle](c, r, a, s),
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.jsx(
50
50
  "rect",
51
51
  {
52
52
  x: a * c,
53
- y: a * $,
53
+ y: a * r,
54
54
  width: a * s.scale,
55
55
  height: a * s.scale,
56
- className: n("fill-current stroke-none", s?.className)
56
+ className: d("fill-current stroke-none", s?.className)
57
57
  },
58
- `tile-${c}-${$}`
58
+ `tile-${c}-${r}`
59
59
  ),
60
- [r.Circle]: (c, $, a, s) => /* @__PURE__ */ h.jsx(
60
+ [$.Circle]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
61
61
  "circle",
62
62
  {
63
63
  cx: a * (c + 0.5 * s.scale),
64
- cy: a * ($ + 0.5 * s.scale),
64
+ cy: a * (r + 0.5 * s.scale),
65
65
  r: a / 2 * s.scale,
66
- className: n("fill-current stroke-none", s?.className)
66
+ className: d("fill-current stroke-none", s?.className)
67
67
  },
68
- `tile-${c}-${$}`
68
+ `tile-${c}-${r}`
69
69
  ),
70
- [r.Diamond]: (c, $, a, s) => /* @__PURE__ */ h.jsx(
70
+ [$.Diamond]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
71
71
  "path",
72
72
  {
73
- d: `M ${a * (c + 0.5 * s.scale)} ${a * $}
74
- L ${a * (c + s.scale)} ${a * ($ + 0.5 * s.scale)}
75
- L ${a * (c + 0.5 * s.scale)} ${a * ($ + s.scale)}
76
- L ${a * c} ${a * ($ + 0.5 * s.scale)} Z`,
77
- className: n("fill-current stroke-none", s?.className)
73
+ d: `M ${a * (c + 0.5 * s.scale)} ${a * r}
74
+ L ${a * (c + s.scale)} ${a * (r + 0.5 * s.scale)}
75
+ L ${a * (c + 0.5 * s.scale)} ${a * (r + s.scale)}
76
+ L ${a * c} ${a * (r + 0.5 * s.scale)} Z`,
77
+ className: d("fill-current stroke-none", s?.className)
78
78
  },
79
- `tile-${c}-${$}`
79
+ `tile-${c}-${r}`
80
80
  ),
81
- [r.Hexagon]: (c, $, a, s) => {
82
- const M = a / Math.sqrt(3), m = (a - M) / 2;
81
+ [$.Hexagon]: (c, r, a, s) => {
82
+ const o = a / Math.sqrt(3), m = (a - o) / 2;
83
83
  return /* @__PURE__ */ h.jsx(
84
84
  "path",
85
85
  {
86
86
  rotate: 45,
87
- d: `M ${a * c + m * s.scale} ${a * $}
88
- L ${a * c + (m + M) * s.scale} ${a * $}
89
- L ${a * (c + s.scale)} ${a * ($ + 0.5 * s.scale)}
90
- L ${a * c + (m + M) * s.scale} ${a * ($ + s.scale)}
91
- L ${a * c + m * s.scale} ${a * ($ + s.scale)}
92
- L ${a * c} ${a * ($ + 0.5 * s.scale)} Z`,
93
- className: n("fill-current stroke-none", s?.className)
87
+ d: `M ${a * c + m * s.scale} ${a * r}
88
+ L ${a * c + (m + o) * s.scale} ${a * r}
89
+ L ${a * (c + s.scale)} ${a * (r + 0.5 * s.scale)}
90
+ L ${a * c + (m + o) * s.scale} ${a * (r + s.scale)}
91
+ L ${a * c + m * s.scale} ${a * (r + s.scale)}
92
+ L ${a * c} ${a * (r + 0.5 * s.scale)} Z`,
93
+ className: d("fill-current stroke-none", s?.className)
94
94
  },
95
- `tile-${c}-${$}`
95
+ `tile-${c}-${r}`
96
96
  );
97
97
  },
98
- [r.RandBasic]: (c, $, a, s) => N[r.Square + Math.floor(Math.random() * 4)](c, $, a, s),
99
- [r.TriangleSE]: (c, $, a, s) => /* @__PURE__ */ h.jsx(
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.jsx(
100
100
  "path",
101
101
  {
102
- d: `M ${a * (c + s.scale)} ${a * $}
103
- L ${a * c} ${a * ($ + s.scale)}
104
- L ${a * (c + s.scale)} ${a * ($ + s.scale)} Z`,
105
- className: n("fill-current stroke-none", s?.className)
102
+ d: `M ${a * (c + s.scale)} ${a * r}
103
+ L ${a * c} ${a * (r + s.scale)}
104
+ L ${a * (c + s.scale)} ${a * (r + s.scale)} Z`,
105
+ className: d("fill-current stroke-none", s?.className)
106
106
  },
107
- `tile-${c}-${$}`
107
+ `tile-${c}-${r}`
108
108
  ),
109
- [r.TriangleSW]: (c, $, a, s) => /* @__PURE__ */ h.jsx(
109
+ [$.TriangleSW]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
110
110
  "path",
111
111
  {
112
- d: `M ${a * c} ${a * $}
113
- L ${a * (c + s.scale)} ${a * ($ + s.scale)}
114
- L ${a * c} ${a * ($ + s.scale)} Z`,
115
- className: n("fill-current stroke-none", s?.className)
112
+ d: `M ${a * c} ${a * r}
113
+ L ${a * (c + s.scale)} ${a * (r + s.scale)}
114
+ L ${a * c} ${a * (r + s.scale)} Z`,
115
+ className: d("fill-current stroke-none", s?.className)
116
116
  },
117
- `tile-${c}-${$}`
117
+ `tile-${c}-${r}`
118
118
  ),
119
- [r.TriangleNW]: (c, $, a, s) => /* @__PURE__ */ h.jsx(
119
+ [$.TriangleNW]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
120
120
  "path",
121
121
  {
122
- d: `M ${a * (c + s.scale)} ${a * $}
123
- L ${a * c} ${a * ($ + s.scale)}
124
- L ${a * c} ${a * $} Z`,
125
- className: n("fill-current stroke-none", s?.className)
122
+ d: `M ${a * (c + s.scale)} ${a * r}
123
+ L ${a * c} ${a * (r + s.scale)}
124
+ L ${a * c} ${a * r} Z`,
125
+ className: d("fill-current stroke-none", s?.className)
126
126
  },
127
- `tile-${c}-${$}`
127
+ `tile-${c}-${r}`
128
128
  ),
129
- [r.TriangleNE]: (c, $, a, s) => /* @__PURE__ */ h.jsx(
129
+ [$.TriangleNE]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
130
130
  "path",
131
131
  {
132
- d: `M ${a * c} ${a * $}
133
- L ${a * (c + s.scale)} ${a * ($ + s.scale)}
134
- L ${a * (c + s.scale)} ${a * $} Z`,
135
- className: n("fill-current stroke-none", s?.className)
132
+ d: `M ${a * c} ${a * r}
133
+ L ${a * (c + s.scale)} ${a * (r + s.scale)}
134
+ L ${a * (c + s.scale)} ${a * r} Z`,
135
+ className: d("fill-current stroke-none", s?.className)
136
136
  },
137
- `tile-${c}-${$}`
137
+ `tile-${c}-${r}`
138
138
  ),
139
- [r.TriangleRand]: (c, $, a, s) => N[r.TriangleSE + Math.floor(Math.random() * 4)](
139
+ [$.TriangleRand]: (c, r, a, s) => N[$.TriangleSE + Math.floor(Math.random() * 4)](
140
140
  c,
141
- $,
141
+ r,
142
142
  a,
143
143
  s
144
144
  ),
145
- [r.CaretN]: (c, $, a, s) => /* @__PURE__ */ h.jsx(
145
+ [$.CaretN]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
146
146
  "path",
147
147
  {
148
- d: `M ${a * c} ${a * ($ + s.scale)}
149
- L ${a * (c + s.scale)} ${a * ($ + s.scale)}
150
- L ${a * (c + 0.5 * s.scale)} ${a * $} Z`,
151
- className: n("fill-current stroke-none", s?.className)
148
+ d: `M ${a * c} ${a * (r + s.scale)}
149
+ L ${a * (c + s.scale)} ${a * (r + s.scale)}
150
+ L ${a * (c + 0.5 * s.scale)} ${a * r} Z`,
151
+ className: d("fill-current stroke-none", s?.className)
152
152
  },
153
- `tile-${c}-${$}`
153
+ `tile-${c}-${r}`
154
154
  ),
155
- [r.CaretE]: (c, $, a, s) => /* @__PURE__ */ h.jsx(
155
+ [$.CaretE]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
156
156
  "path",
157
157
  {
158
- d: `M ${a * c} ${a * $}
159
- L ${a * (c + s.scale)} ${a * ($ + 0.5 * s.scale)}
160
- L ${a * c} ${a * ($ + s.scale)} Z`,
161
- className: n("fill-current stroke-none", s?.className)
158
+ d: `M ${a * c} ${a * r}
159
+ L ${a * (c + s.scale)} ${a * (r + 0.5 * s.scale)}
160
+ L ${a * c} ${a * (r + s.scale)} Z`,
161
+ className: d("fill-current stroke-none", s?.className)
162
162
  },
163
- `tile-${c}-${$}`
163
+ `tile-${c}-${r}`
164
164
  ),
165
- [r.CaretS]: (c, $, a, s) => /* @__PURE__ */ h.jsx(
165
+ [$.CaretS]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
166
166
  "path",
167
167
  {
168
- d: `M ${a * c} ${a * $}
169
- L ${a * (c + s.scale)} ${a * $}
170
- L ${a * (c + 0.5 * s.scale)} ${a * ($ + s.scale)} Z`,
171
- className: n("fill-current stroke-none", s?.className)
168
+ d: `M ${a * c} ${a * r}
169
+ L ${a * (c + s.scale)} ${a * r}
170
+ L ${a * (c + 0.5 * s.scale)} ${a * (r + s.scale)} Z`,
171
+ className: d("fill-current stroke-none", s?.className)
172
172
  },
173
- `tile-${c}-${$}`
173
+ `tile-${c}-${r}`
174
174
  ),
175
- [r.CaretW]: (c, $, a, s) => /* @__PURE__ */ h.jsx(
175
+ [$.CaretW]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
176
176
  "path",
177
177
  {
178
- d: `M ${a * (c + s.scale)} ${a * $}
179
- L ${a * c} ${a * ($ + 0.5 * s.scale)}
180
- L ${a * (c + s.scale)} ${a * ($ + s.scale)} Z`,
181
- className: n("fill-current stroke-none", s?.className)
178
+ d: `M ${a * (c + s.scale)} ${a * r}
179
+ L ${a * c} ${a * (r + 0.5 * s.scale)}
180
+ L ${a * (c + s.scale)} ${a * (r + s.scale)} Z`,
181
+ className: d("fill-current stroke-none", s?.className)
182
182
  },
183
- `tile-${c}-${$}`
183
+ `tile-${c}-${r}`
184
184
  ),
185
- [r.CaretRand]: (c, $, a, s) => N[r.CaretN + Math.floor(Math.random() * 4)](c, $, a, s),
186
- [r.PieSE]: (c, $, a, s) => /* @__PURE__ */ h.jsx(
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.jsx(
187
187
  "path",
188
188
  {
189
- d: `M ${a * s.scale + a * c} ${a * $}
190
- A ${a * s.scale} ${a * s.scale}, 0, 0, 0, ${a * c} ${a * s.scale + a * $}
191
- L ${a * s.scale + a * c} ${a * s.scale + a * $} Z`,
192
- className: n("fill-current stroke-none", s?.className)
189
+ d: `M ${a * s.scale + a * c} ${a * r}
190
+ A ${a * s.scale} ${a * s.scale}, 0, 0, 0, ${a * c} ${a * s.scale + a * r}
191
+ L ${a * s.scale + a * c} ${a * s.scale + a * r} Z`,
192
+ className: d("fill-current stroke-none", s?.className)
193
193
  },
194
- `tile-${c}-${$}`
194
+ `tile-${c}-${r}`
195
195
  ),
196
- [r.PieSW]: (c, $, a, s) => /* @__PURE__ */ h.jsx(
196
+ [$.PieSW]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
197
197
  "path",
198
198
  {
199
- d: `M ${a * s.scale + a * c} ${a * s.scale + a * $}
200
- A ${a * s.scale} ${a * s.scale}, 0, 0, 0, ${a * c} ${a * $}
201
- L ${a * c} ${a * s.scale + a * $} Z`,
202
- className: n("fill-current stroke-none", s?.className)
199
+ d: `M ${a * s.scale + a * c} ${a * s.scale + a * r}
200
+ A ${a * s.scale} ${a * s.scale}, 0, 0, 0, ${a * c} ${a * r}
201
+ L ${a * c} ${a * s.scale + a * r} Z`,
202
+ className: d("fill-current stroke-none", s?.className)
203
203
  },
204
- `tile-${c}-${$}`
204
+ `tile-${c}-${r}`
205
205
  ),
206
- [r.PieNW]: (c, $, a, s) => /* @__PURE__ */ h.jsx(
206
+ [$.PieNW]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
207
207
  "path",
208
208
  {
209
- d: `M ${a * c} ${a * s.scale + a * $}
210
- A ${a * s.scale} ${a * s.scale}, 0, 0, 0, ${a * s.scale + a * c} ${a * $}
211
- L ${a * c} ${a * $} Z`,
212
- className: n("fill-current stroke-none", s?.className)
209
+ d: `M ${a * c} ${a * s.scale + a * r}
210
+ A ${a * s.scale} ${a * s.scale}, 0, 0, 0, ${a * s.scale + a * c} ${a * r}
211
+ L ${a * c} ${a * r} Z`,
212
+ className: d("fill-current stroke-none", s?.className)
213
213
  },
214
- `tile-${c}-${$}`
214
+ `tile-${c}-${r}`
215
215
  ),
216
- [r.PieNE]: (c, $, a, s) => /* @__PURE__ */ h.jsx(
216
+ [$.PieNE]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
217
217
  "path",
218
218
  {
219
- d: `M ${a * c} ${a * $}
220
- A ${a * s.scale} ${a * s.scale}, 0, 0, 0, ${a * s.scale + a * c} ${a * s.scale + a * $}
221
- L ${a * s.scale + a * c} ${a * $} Z`,
222
- className: n("fill-current stroke-none", s?.className)
219
+ d: `M ${a * c} ${a * r}
220
+ A ${a * s.scale} ${a * s.scale}, 0, 0, 0, ${a * s.scale + a * c} ${a * s.scale + a * r}
221
+ L ${a * s.scale + a * c} ${a * r} Z`,
222
+ className: d("fill-current stroke-none", s?.className)
223
223
  },
224
- `tile-${c}-${$}`
224
+ `tile-${c}-${r}`
225
225
  ),
226
- [r.PieRand]: (c, $, a, s) => N[r.PieSE + Math.floor(Math.random() * 4)](c, $, a, s)
227
- }, p = (c, $, a) => c.map(
228
- (s, M) => s.map((m, d) => {
229
- const o = typeof m == "object" ? { className: n(a, m.className), scale: m.scale ?? 1, shape: m.shape } : { className: a, scale: 1, shape: m };
230
- return N[o.shape](d, M, $, o);
226
+ [$.PieRand]: (c, r, a, s) => N[$.PieSE + Math.floor(Math.random() * 4)](c, r, a, s)
227
+ }, T = (c, r, a) => c.map(
228
+ (s, o) => s.map((m, x) => {
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](x, o, r, n);
231
231
  })
232
- ).flat(), j = [
233
- [r.PieRand, r.PieRand],
234
- [r.PieRand, r.PieRand]
232
+ ).flat(), E = [
233
+ [$.PieRand, $.PieRand],
234
+ [$.PieRand, $.PieRand]
235
235
  ];
236
- function R({
237
- pattern: c = j,
238
- tileSize: $ = 64,
236
+ function Z({
237
+ pattern: c = E,
238
+ tileSize: r = 64,
239
239
  tileClassName: a,
240
240
  tileBgClassName: s,
241
- renderChildren: M,
242
- ...m
241
+ renderChildren: o,
242
+ fit: m = "none",
243
+ ...x
243
244
  }) {
244
- const d = x(
245
+ const n = M(
245
246
  () => ({
246
- width: c.reduce((u, k) => Math.max(u, k.length), 0) * $,
247
- height: c.length * $
247
+ width: c.reduce((u, P) => Math.max(u, P.length), 0) * r,
248
+ height: c.length * r
248
249
  }),
249
- [c, $]
250
- ), o = x(() => {
251
- const u = p(c, $, a);
250
+ [c, r]
251
+ ), L = M(() => {
252
+ const u = T(c, r, a);
252
253
  return s && u.unshift(
253
254
  /* @__PURE__ */ h.jsx(
254
255
  "rect",
255
256
  {
256
257
  x: 0,
257
258
  y: 0,
258
- width: d.width,
259
- height: d.height,
260
- className: n("fill-black stroke-2 stroke-black", s)
259
+ width: n.width,
260
+ height: n.height,
261
+ className: d("fill-black stroke-2 stroke-black", s)
261
262
  },
262
263
  "svg-mask-invert"
263
264
  )
264
265
  ), u;
265
- }, [c, d, a, s, $]);
266
- return /* @__PURE__ */ h.jsx("svg", { width: d.width, height: d.height, viewBox: `0 0 ${d.width} ${d.height}`, overflow: "visible", ...m, children: M ? M(o, d.width, d.height) : o });
266
+ }, [c, n, a, s, r]), p = M(() => {
267
+ switch (m) {
268
+ case "fill":
269
+ return n.width <= n.height ? "100%" : void 0;
270
+ case "width":
271
+ return "100%";
272
+ case "none":
273
+ return n.width;
274
+ default:
275
+ return;
276
+ }
277
+ }, [m, n]), j = M(() => {
278
+ switch (m) {
279
+ case "fill":
280
+ return n.height < n.width ? "100%" : void 0;
281
+ case "height":
282
+ return "100%";
283
+ case "none":
284
+ return n.height;
285
+ default:
286
+ return;
287
+ }
288
+ }, [m, n]);
289
+ return /* @__PURE__ */ h.jsx(
290
+ "svg",
291
+ {
292
+ width: p,
293
+ height: j,
294
+ viewBox: `0 0 ${n.width} ${n.height}`,
295
+ overflow: "visible",
296
+ ...x,
297
+ children: o ? o(L, n.width, n.height) : L
298
+ }
299
+ );
267
300
  }
268
301
  export {
269
- R as IconGenerator
302
+ Z as IconGenerator
270
303
  };