@bccampus/ui-components 0.2.0 → 0.4.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/composite.d.ts +151 -0
- package/dist/composite.js +472 -0
- package/dist/generate-tiles-DuagGD1d.js +244 -0
- package/dist/horizontal-list.js +32 -32
- package/dist/icon-generator.js +43 -270
- package/dist/igenerate-tiles.d.ts +43 -0
- package/dist/igenerate-tiles.js +7 -0
- 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 +17 -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/composite/CompositeData.ts +215 -0
- package/src/components/ui/composite/CompositeDataItem.ts +144 -0
- package/src/components/ui/composite/composite-component-item.tsx +50 -0
- package/src/components/ui/composite/composite-component.tsx +100 -0
- package/src/components/ui/composite/composite-data-context.tsx +31 -0
- package/src/components/ui/composite/index.ts +4 -0
- package/src/components/ui/composite/types.ts +81 -0
- 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/components/ui/popover.tsx +46 -0
- package/src/hooks/use-effect-after-mount.ts +27 -0
- package/src/hooks/use-id.ts +5 -0
- package/src/hooks/use-keyboard-event.ts +144 -0
- package/src/lib/object.ts +48 -0
- package/src/lib/set-operations.ts +52 -0
- package/src/styles/theme.css +7 -7
- package/src/styles/typography.css +334 -341
- package/tsconfig.node.json +25 -25
- package/vite.config.ts +7 -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/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,303 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
MosaicCircle: 3,
|
|
9
|
-
MosaicDiamond: 4,
|
|
10
|
-
Square: 6,
|
|
11
|
-
Circle: 7,
|
|
12
|
-
Diamond: 8,
|
|
13
|
-
Hexagon: 9,
|
|
14
|
-
RandBasic: 10,
|
|
15
|
-
TriangleSE: 11,
|
|
16
|
-
TriangleSW: 12,
|
|
17
|
-
TriangleNW: 13,
|
|
18
|
-
TriangleNE: 14,
|
|
19
|
-
TriangleRand: 15,
|
|
20
|
-
CaretN: 16,
|
|
21
|
-
CaretE: 17,
|
|
22
|
-
CaretS: 18,
|
|
23
|
-
CaretW: 19,
|
|
24
|
-
CaretRand: 20,
|
|
25
|
-
PieSE: 21,
|
|
26
|
-
PieSW: 22,
|
|
27
|
-
PieNW: 23,
|
|
28
|
-
PieNE: 24,
|
|
29
|
-
PieRand: 25
|
|
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
|
-
], N = {
|
|
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
|
-
"rect",
|
|
51
|
-
{
|
|
52
|
-
x: a * c,
|
|
53
|
-
y: a * r,
|
|
54
|
-
width: a * s.scale,
|
|
55
|
-
height: a * s.scale,
|
|
56
|
-
className: d("fill-current stroke-none", s?.className)
|
|
57
|
-
},
|
|
58
|
-
`tile-${c}-${r}`
|
|
59
|
-
),
|
|
60
|
-
[$.Circle]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
|
|
61
|
-
"circle",
|
|
62
|
-
{
|
|
63
|
-
cx: a * (c + 0.5 * s.scale),
|
|
64
|
-
cy: a * (r + 0.5 * s.scale),
|
|
65
|
-
r: a / 2 * s.scale,
|
|
66
|
-
className: d("fill-current stroke-none", s?.className)
|
|
67
|
-
},
|
|
68
|
-
`tile-${c}-${r}`
|
|
69
|
-
),
|
|
70
|
-
[$.Diamond]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
|
|
71
|
-
"path",
|
|
72
|
-
{
|
|
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
|
-
},
|
|
79
|
-
`tile-${c}-${r}`
|
|
80
|
-
),
|
|
81
|
-
[$.Hexagon]: (c, r, a, s) => {
|
|
82
|
-
const o = a / Math.sqrt(3), m = (a - o) / 2;
|
|
83
|
-
return /* @__PURE__ */ h.jsx(
|
|
84
|
-
"path",
|
|
85
|
-
{
|
|
86
|
-
rotate: 45,
|
|
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
|
-
},
|
|
95
|
-
`tile-${c}-${r}`
|
|
96
|
-
);
|
|
97
|
-
},
|
|
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
|
-
"path",
|
|
101
|
-
{
|
|
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
|
-
},
|
|
107
|
-
`tile-${c}-${r}`
|
|
108
|
-
),
|
|
109
|
-
[$.TriangleSW]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
|
|
110
|
-
"path",
|
|
111
|
-
{
|
|
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
|
-
},
|
|
117
|
-
`tile-${c}-${r}`
|
|
118
|
-
),
|
|
119
|
-
[$.TriangleNW]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
|
|
120
|
-
"path",
|
|
121
|
-
{
|
|
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
|
-
},
|
|
127
|
-
`tile-${c}-${r}`
|
|
128
|
-
),
|
|
129
|
-
[$.TriangleNE]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
|
|
130
|
-
"path",
|
|
131
|
-
{
|
|
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
|
-
},
|
|
137
|
-
`tile-${c}-${r}`
|
|
138
|
-
),
|
|
139
|
-
[$.TriangleRand]: (c, r, a, s) => N[$.TriangleSE + Math.floor(Math.random() * 4)](
|
|
140
|
-
c,
|
|
141
|
-
r,
|
|
142
|
-
a,
|
|
143
|
-
s
|
|
144
|
-
),
|
|
145
|
-
[$.CaretN]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
|
|
146
|
-
"path",
|
|
147
|
-
{
|
|
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
|
-
},
|
|
153
|
-
`tile-${c}-${r}`
|
|
154
|
-
),
|
|
155
|
-
[$.CaretE]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
|
|
156
|
-
"path",
|
|
157
|
-
{
|
|
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
|
-
},
|
|
163
|
-
`tile-${c}-${r}`
|
|
164
|
-
),
|
|
165
|
-
[$.CaretS]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
|
|
166
|
-
"path",
|
|
167
|
-
{
|
|
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
|
-
},
|
|
173
|
-
`tile-${c}-${r}`
|
|
174
|
-
),
|
|
175
|
-
[$.CaretW]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
|
|
176
|
-
"path",
|
|
177
|
-
{
|
|
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
|
-
},
|
|
183
|
-
`tile-${c}-${r}`
|
|
184
|
-
),
|
|
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
|
-
"path",
|
|
188
|
-
{
|
|
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
|
-
},
|
|
194
|
-
`tile-${c}-${r}`
|
|
195
|
-
),
|
|
196
|
-
[$.PieSW]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
|
|
197
|
-
"path",
|
|
198
|
-
{
|
|
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
|
-
},
|
|
204
|
-
`tile-${c}-${r}`
|
|
205
|
-
),
|
|
206
|
-
[$.PieNW]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
|
|
207
|
-
"path",
|
|
208
|
-
{
|
|
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
|
-
},
|
|
214
|
-
`tile-${c}-${r}`
|
|
215
|
-
),
|
|
216
|
-
[$.PieNE]: (c, r, a, s) => /* @__PURE__ */ h.jsx(
|
|
217
|
-
"path",
|
|
218
|
-
{
|
|
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
|
-
},
|
|
224
|
-
`tile-${c}-${r}`
|
|
225
|
-
),
|
|
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
|
-
})
|
|
232
|
-
).flat(), E = [
|
|
233
|
-
[$.PieRand, $.PieRand],
|
|
234
|
-
[$.PieRand, $.PieRand]
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as r } from "react";
|
|
3
|
+
import { T as o, g as l } from "./generate-tiles-DuagGD1d.js";
|
|
4
|
+
import { c as m } from "./utils-CRiPKpXj.js";
|
|
5
|
+
const k = [
|
|
6
|
+
[o.PieRand, o.PieRand],
|
|
7
|
+
[o.PieRand, o.PieRand]
|
|
235
8
|
];
|
|
236
|
-
function
|
|
237
|
-
pattern:
|
|
238
|
-
tileSize:
|
|
239
|
-
tileClassName:
|
|
240
|
-
tileBgClassName:
|
|
241
|
-
renderChildren:
|
|
242
|
-
fit:
|
|
243
|
-
...
|
|
9
|
+
function b({
|
|
10
|
+
pattern: e = k,
|
|
11
|
+
tileSize: h = 64,
|
|
12
|
+
tileClassName: s,
|
|
13
|
+
tileBgClassName: c,
|
|
14
|
+
renderChildren: d,
|
|
15
|
+
fit: i = "none",
|
|
16
|
+
...g
|
|
244
17
|
}) {
|
|
245
|
-
const
|
|
18
|
+
const t = r(
|
|
246
19
|
() => ({
|
|
247
|
-
width:
|
|
248
|
-
height:
|
|
20
|
+
width: e.reduce((n, v) => Math.max(n, v.length), 0) * h,
|
|
21
|
+
height: e.length * h
|
|
249
22
|
}),
|
|
250
|
-
[
|
|
251
|
-
),
|
|
252
|
-
const
|
|
253
|
-
return
|
|
254
|
-
/* @__PURE__ */
|
|
23
|
+
[e, h]
|
|
24
|
+
), a = r(() => {
|
|
25
|
+
const n = l(e, h, s);
|
|
26
|
+
return c && n.unshift(
|
|
27
|
+
/* @__PURE__ */ u(
|
|
255
28
|
"rect",
|
|
256
29
|
{
|
|
257
30
|
x: 0,
|
|
258
31
|
y: 0,
|
|
259
|
-
width:
|
|
260
|
-
height:
|
|
261
|
-
className:
|
|
32
|
+
width: t.width,
|
|
33
|
+
height: t.height,
|
|
34
|
+
className: m("fill-black stroke-2 stroke-black", c)
|
|
262
35
|
},
|
|
263
36
|
"svg-mask-invert"
|
|
264
37
|
)
|
|
265
|
-
),
|
|
266
|
-
}, [
|
|
267
|
-
switch (
|
|
38
|
+
), n;
|
|
39
|
+
}, [e, t, s, c, h]), w = r(() => {
|
|
40
|
+
switch (i) {
|
|
268
41
|
case "fill":
|
|
269
|
-
return
|
|
42
|
+
return t.width <= t.height ? "100%" : void 0;
|
|
270
43
|
case "width":
|
|
271
44
|
return "100%";
|
|
272
45
|
case "none":
|
|
273
|
-
return
|
|
46
|
+
return t.width;
|
|
274
47
|
default:
|
|
275
48
|
return;
|
|
276
49
|
}
|
|
277
|
-
}, [
|
|
278
|
-
switch (
|
|
50
|
+
}, [i, t]), f = r(() => {
|
|
51
|
+
switch (i) {
|
|
279
52
|
case "fill":
|
|
280
|
-
return
|
|
53
|
+
return t.height < t.width ? "100%" : void 0;
|
|
281
54
|
case "height":
|
|
282
55
|
return "100%";
|
|
283
56
|
case "none":
|
|
284
|
-
return
|
|
57
|
+
return t.height;
|
|
285
58
|
default:
|
|
286
59
|
return;
|
|
287
60
|
}
|
|
288
|
-
}, [
|
|
289
|
-
return /* @__PURE__ */
|
|
61
|
+
}, [i, t]);
|
|
62
|
+
return /* @__PURE__ */ u(
|
|
290
63
|
"svg",
|
|
291
64
|
{
|
|
292
|
-
width:
|
|
293
|
-
height:
|
|
294
|
-
viewBox: `0 0 ${
|
|
65
|
+
width: w,
|
|
66
|
+
height: f,
|
|
67
|
+
viewBox: `0 0 ${t.width} ${t.height}`,
|
|
295
68
|
overflow: "visible",
|
|
296
|
-
...
|
|
297
|
-
children:
|
|
69
|
+
...g,
|
|
70
|
+
children: d ? d(a, t.width, t.height) : a
|
|
298
71
|
}
|
|
299
72
|
);
|
|
300
73
|
}
|
|
301
74
|
export {
|
|
302
|
-
|
|
75
|
+
b as IconGenerator
|
|
303
76
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
|
|
3
|
+
export declare const generateIconPattern: (width: number, height: number, tileConfig: TileShape | TileConfig) => (TileShape | TileConfig)[][];
|
|
4
|
+
|
|
5
|
+
export declare const generateTiles: (pattern: (TileShape | TileConfig)[][], tileSize: number, tileClassName?: string) => (JSX.Element | null)[];
|
|
6
|
+
|
|
7
|
+
declare interface TileConfig {
|
|
8
|
+
shape: TileShape;
|
|
9
|
+
scale?: number;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare const TileShape: {
|
|
14
|
+
readonly Blank: 0;
|
|
15
|
+
readonly Rand: 1;
|
|
16
|
+
readonly Mosaic: 2;
|
|
17
|
+
readonly MosaicCircle: 3;
|
|
18
|
+
readonly MosaicDiamond: 4;
|
|
19
|
+
readonly Square: 6;
|
|
20
|
+
readonly Circle: 7;
|
|
21
|
+
readonly Diamond: 8;
|
|
22
|
+
readonly Hexagon: 9;
|
|
23
|
+
readonly RandBasic: 10;
|
|
24
|
+
readonly TriangleSE: 11;
|
|
25
|
+
readonly TriangleSW: 12;
|
|
26
|
+
readonly TriangleNW: 13;
|
|
27
|
+
readonly TriangleNE: 14;
|
|
28
|
+
readonly TriangleRand: 15;
|
|
29
|
+
readonly CaretN: 16;
|
|
30
|
+
readonly CaretE: 17;
|
|
31
|
+
readonly CaretS: 18;
|
|
32
|
+
readonly CaretW: 19;
|
|
33
|
+
readonly CaretRand: 20;
|
|
34
|
+
readonly PieSE: 21;
|
|
35
|
+
readonly PieSW: 22;
|
|
36
|
+
readonly PieNW: 23;
|
|
37
|
+
readonly PieNE: 24;
|
|
38
|
+
readonly PieRand: 25;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
declare type TileShape = (typeof TileShape)[keyof typeof TileShape];
|
|
42
|
+
|
|
43
|
+
export { }
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as i from "react";
|
|
2
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
3
|
+
function d(e, t) {
|
|
4
|
+
if (typeof e == "function")
|
|
5
|
+
return e(t);
|
|
6
|
+
e != null && (e.current = t);
|
|
7
|
+
}
|
|
8
|
+
function y(...e) {
|
|
9
|
+
return (t) => {
|
|
10
|
+
let r = !1;
|
|
11
|
+
const o = e.map((n) => {
|
|
12
|
+
const l = d(n, t);
|
|
13
|
+
return !r && typeof l == "function" && (r = !0), l;
|
|
14
|
+
});
|
|
15
|
+
if (r)
|
|
16
|
+
return () => {
|
|
17
|
+
for (let n = 0; n < o.length; n++) {
|
|
18
|
+
const l = o[n];
|
|
19
|
+
typeof l == "function" ? l() : d(e[n], null);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function V(...e) {
|
|
25
|
+
return i.useCallback(y(...e), e);
|
|
26
|
+
}
|
|
27
|
+
// @__NO_SIDE_EFFECTS__
|
|
28
|
+
function C(e) {
|
|
29
|
+
const t = /* @__PURE__ */ S(e), r = i.forwardRef((o, n) => {
|
|
30
|
+
const { children: l, ...c } = o, s = i.Children.toArray(l), a = s.find(E);
|
|
31
|
+
if (a) {
|
|
32
|
+
const u = a.props.children, m = s.map((f) => f === a ? i.Children.count(u) > 1 ? i.Children.only(null) : i.isValidElement(u) ? u.props.children : null : f);
|
|
33
|
+
return /* @__PURE__ */ p(t, { ...c, ref: n, children: i.isValidElement(u) ? i.cloneElement(u, void 0, m) : null });
|
|
34
|
+
}
|
|
35
|
+
return /* @__PURE__ */ p(t, { ...c, ref: n, children: l });
|
|
36
|
+
});
|
|
37
|
+
return r.displayName = `${e}.Slot`, r;
|
|
38
|
+
}
|
|
39
|
+
var x = /* @__PURE__ */ C("Slot");
|
|
40
|
+
// @__NO_SIDE_EFFECTS__
|
|
41
|
+
function S(e) {
|
|
42
|
+
const t = i.forwardRef((r, o) => {
|
|
43
|
+
const { children: n, ...l } = r;
|
|
44
|
+
if (i.isValidElement(n)) {
|
|
45
|
+
const c = h(n), s = R(l, n.props);
|
|
46
|
+
return n.type !== i.Fragment && (s.ref = o ? y(o, c) : c), i.cloneElement(n, s);
|
|
47
|
+
}
|
|
48
|
+
return i.Children.count(n) > 1 ? i.Children.only(null) : null;
|
|
49
|
+
});
|
|
50
|
+
return t.displayName = `${e}.SlotClone`, t;
|
|
51
|
+
}
|
|
52
|
+
var g = Symbol("radix.slottable");
|
|
53
|
+
function E(e) {
|
|
54
|
+
return i.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === g;
|
|
55
|
+
}
|
|
56
|
+
function R(e, t) {
|
|
57
|
+
const r = { ...t };
|
|
58
|
+
for (const o in t) {
|
|
59
|
+
const n = e[o], l = t[o];
|
|
60
|
+
/^on[A-Z]/.test(o) ? n && l ? r[o] = (...s) => {
|
|
61
|
+
const a = l(...s);
|
|
62
|
+
return n(...s), a;
|
|
63
|
+
} : n && (r[o] = n) : o === "style" ? r[o] = { ...n, ...l } : o === "className" && (r[o] = [n, l].filter(Boolean).join(" "));
|
|
64
|
+
}
|
|
65
|
+
return { ...e, ...r };
|
|
66
|
+
}
|
|
67
|
+
function h(e) {
|
|
68
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning;
|
|
69
|
+
return r ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
x as S,
|
|
73
|
+
y as a,
|
|
74
|
+
C as c,
|
|
75
|
+
V as u
|
|
76
|
+
};
|
package/dist/input.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { c as i } from "./utils-CRiPKpXj.js";
|
|
3
|
-
function
|
|
4
|
-
return /* @__PURE__ */ n
|
|
3
|
+
function s({ className: r, ...e }) {
|
|
4
|
+
return /* @__PURE__ */ n(
|
|
5
5
|
"input",
|
|
6
6
|
{
|
|
7
7
|
className: i(
|
|
@@ -14,5 +14,5 @@ function t({ className: r, ...e }) {
|
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
s as Input
|
|
18
18
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useId as
|
|
3
|
-
import { IconGenerator as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
src:
|
|
7
|
-
imageFit:
|
|
8
|
-
imagePosition:
|
|
9
|
-
maskType:
|
|
1
|
+
import { jsx as o, jsxs as c, Fragment as d } from "react/jsx-runtime";
|
|
2
|
+
import { useId as p, useMemo as l } from "react";
|
|
3
|
+
import { IconGenerator as M } from "./icon-generator.js";
|
|
4
|
+
const h = { cover: "slice", contain: "meet", fill: "none" }, k = { top: "xMidYMin", center: "xMidYMid", bottom: "xMidYMax" };
|
|
5
|
+
function u({
|
|
6
|
+
src: n,
|
|
7
|
+
imageFit: e = "cover",
|
|
8
|
+
imagePosition: r = "top",
|
|
9
|
+
maskType: s = "alpha",
|
|
10
10
|
...a
|
|
11
11
|
}) {
|
|
12
|
-
const t =
|
|
13
|
-
() =>
|
|
14
|
-
[
|
|
12
|
+
const t = p(), i = l(
|
|
13
|
+
() => e !== "fill" ? `${k[r]} ${h[e]}` : "none",
|
|
14
|
+
[e, r]
|
|
15
15
|
);
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
|
|
16
|
+
return /* @__PURE__ */ o(
|
|
17
|
+
M,
|
|
18
18
|
{
|
|
19
19
|
...a,
|
|
20
|
-
renderChildren: (m) => /* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
/* @__PURE__ */
|
|
20
|
+
renderChildren: (m) => /* @__PURE__ */ c(d, { children: [
|
|
21
|
+
/* @__PURE__ */ o("mask", { id: `svg-mask${t}`, "mask-type": s, children: m }),
|
|
22
|
+
/* @__PURE__ */ o("image", { href: n, width: "100%", height: "100%", mask: `url(#svg-mask${t})`, preserveAspectRatio: i })
|
|
23
23
|
] })
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
27
|
export {
|
|
28
|
-
|
|
28
|
+
u as MaskedImageGenerator
|
|
29
29
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
3
|
+
|
|
4
|
+
export declare function NavigationMenu({ className, children, noViewport, mega, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
|
|
5
|
+
noViewport?: boolean;
|
|
6
|
+
mega?: boolean;
|
|
7
|
+
}): JSX.Element;
|
|
8
|
+
|
|
9
|
+
export declare function NavigationMenuContent({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>): JSX.Element;
|
|
10
|
+
|
|
11
|
+
export declare function NavigationMenuIndicator({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>): JSX.Element;
|
|
12
|
+
|
|
13
|
+
export declare function NavigationMenuItem({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>): JSX.Element;
|
|
14
|
+
|
|
15
|
+
export declare function NavigationMenuLink({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>): JSX.Element;
|
|
16
|
+
|
|
17
|
+
export declare function NavigationMenuList({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.List>): JSX.Element;
|
|
18
|
+
|
|
19
|
+
export declare function NavigationMenuTrigger({ className, children, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>): JSX.Element;
|
|
20
|
+
|
|
21
|
+
export declare const navigationMenuTriggerStyle: string;
|
|
22
|
+
|
|
23
|
+
export declare function NavigationMenuViewport({ className, mega, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport> & {
|
|
24
|
+
mega?: boolean;
|
|
25
|
+
}): JSX.Element;
|
|
26
|
+
|
|
27
|
+
export { }
|