@bccampus/ui-components 0.1.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/README.md +69 -0
- package/components.json +22 -0
- package/dist/@bccampus-ui-components-0.1.0.tgz +0 -0
- package/dist/button.d.ts +16 -0
- package/dist/button.js +36 -0
- package/dist/caption.d.ts +13 -0
- package/dist/caption.js +27 -0
- package/dist/card.d.ts +40 -0
- package/dist/card.js +130 -0
- package/dist/horizontal-list.d.ts +9 -0
- package/dist/horizontal-list.js +145 -0
- package/dist/icon-generator.d.ts +50 -0
- package/dist/icon-generator.js +270 -0
- package/dist/index-DcqAdr0d.js +102 -0
- package/dist/jsx-runtime-BzflLqGi.js +282 -0
- package/dist/masked-image-generator.d.ts +57 -0
- package/dist/masked-image-generator.js +29 -0
- package/dist/mockServiceWorker.js +348 -0
- package/dist/tag.d.ts +16 -0
- package/dist/tag.js +32 -0
- package/dist/ui-components.d.ts +132 -0
- package/dist/ui-components.js +29 -0
- package/dist/utils-CRiPKpXj.js +2743 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +4 -0
- package/eslint.config.js +31 -0
- package/index.html +13 -0
- package/package.json +85 -0
- package/public/mockServiceWorker.js +348 -0
- package/src/App.tsx +14 -0
- package/src/assets/icons/icon_01.svg +6 -0
- package/src/assets/icons/icon_02.svg +6 -0
- package/src/assets/icons/icon_03.svg +6 -0
- package/src/assets/icons/icon_04.svg +6 -0
- package/src/assets/icons/icon_05.svg +4 -0
- package/src/assets/icons/icon_06.svg +4 -0
- package/src/assets/images/bg_pattern_01.png +0 -0
- package/src/assets/images/bg_pattern_02.png +0 -0
- package/src/assets/images/bg_pattern_03.png +0 -0
- package/src/assets/images/bg_pattern_04.png +0 -0
- package/src/assets/images/image_01.jpg +0 -0
- package/src/assets/images/image_02.jpg +0 -0
- package/src/assets/images/image_03.webp +0 -0
- package/src/assets/images/image_04.png +0 -0
- package/src/assets/images/image_05.jpg +0 -0
- package/src/components/ui/button.tsx +47 -0
- package/src/components/ui/card.tsx +147 -0
- package/src/components/ui/horizontal-list.tsx +50 -0
- package/src/components/ui/icon-generator/generate-tiles.tsx +243 -0
- package/src/components/ui/icon-generator/icon-generator.tsx +51 -0
- package/src/components/ui/icon-generator/masked-image-generator.tsx +38 -0
- package/src/components/ui/icon-generator/types.ts +53 -0
- package/src/components/ui/index.ts +7 -0
- package/src/components/ui/tag.tsx +39 -0
- package/src/components/ui/typography/caption.tsx +32 -0
- package/src/lib/utils.ts +6 -0
- package/src/main.tsx +12 -0
- package/src/styles/all.css +4 -0
- package/src/styles/colors.css +106 -0
- package/src/styles/fonts.css +9 -0
- package/src/styles/index.css +7 -0
- package/src/styles/theme.css +126 -0
- package/src/styles/typography.css +479 -0
- package/src/vite-env.d.ts +1 -0
- package/tsconfig.app.json +38 -0
- package/tsconfig.json +19 -0
- package/tsconfig.node.json +25 -0
- package/vite.config.ts +44 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
+
import { useId as c, useMemo as d } from "react";
|
|
3
|
+
import { IconGenerator as p } from "./icon-generator.js";
|
|
4
|
+
const x = { cover: "slice", contain: "meet", fill: "none" }, l = { top: "xMidYMin", center: "xMidYMid", bottom: "xMidYMax" };
|
|
5
|
+
function f({
|
|
6
|
+
src: r,
|
|
7
|
+
imageFit: o = "cover",
|
|
8
|
+
imagePosition: s = "top",
|
|
9
|
+
maskType: n = "alpha",
|
|
10
|
+
...a
|
|
11
|
+
}) {
|
|
12
|
+
const t = c(), i = d(
|
|
13
|
+
() => o !== "fill" ? `${l[s]} ${x[o]}` : "none",
|
|
14
|
+
[o, s]
|
|
15
|
+
);
|
|
16
|
+
return /* @__PURE__ */ e.jsx(
|
|
17
|
+
p,
|
|
18
|
+
{
|
|
19
|
+
...a,
|
|
20
|
+
renderChildren: (m) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
21
|
+
/* @__PURE__ */ e.jsx("mask", { id: `svg-mask${t}`, "mask-type": n, children: m }),
|
|
22
|
+
/* @__PURE__ */ e.jsx("image", { href: r, width: "100%", height: "100%", mask: `url(#svg-mask${t})`, preserveAspectRatio: i })
|
|
23
|
+
] })
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
f as MaskedImageGenerator
|
|
29
|
+
};
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Mock Service Worker.
|
|
6
|
+
* @see https://github.com/mswjs/msw
|
|
7
|
+
* - Please do NOT modify this file.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const PACKAGE_VERSION = '2.11.2'
|
|
11
|
+
const INTEGRITY_CHECKSUM = '4db4a41e972cec1b64cc569c66952d82'
|
|
12
|
+
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
|
|
13
|
+
const activeClientIds = new Set()
|
|
14
|
+
|
|
15
|
+
addEventListener('install', function () {
|
|
16
|
+
self.skipWaiting()
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
addEventListener('activate', function (event) {
|
|
20
|
+
event.waitUntil(self.clients.claim())
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
addEventListener('message', async function (event) {
|
|
24
|
+
const clientId = Reflect.get(event.source || {}, 'id')
|
|
25
|
+
|
|
26
|
+
if (!clientId || !self.clients) {
|
|
27
|
+
return
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const client = await self.clients.get(clientId)
|
|
31
|
+
|
|
32
|
+
if (!client) {
|
|
33
|
+
return
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const allClients = await self.clients.matchAll({
|
|
37
|
+
type: 'window',
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
switch (event.data) {
|
|
41
|
+
case 'KEEPALIVE_REQUEST': {
|
|
42
|
+
sendToClient(client, {
|
|
43
|
+
type: 'KEEPALIVE_RESPONSE',
|
|
44
|
+
})
|
|
45
|
+
break
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
case 'INTEGRITY_CHECK_REQUEST': {
|
|
49
|
+
sendToClient(client, {
|
|
50
|
+
type: 'INTEGRITY_CHECK_RESPONSE',
|
|
51
|
+
payload: {
|
|
52
|
+
packageVersion: PACKAGE_VERSION,
|
|
53
|
+
checksum: INTEGRITY_CHECKSUM,
|
|
54
|
+
},
|
|
55
|
+
})
|
|
56
|
+
break
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
case 'MOCK_ACTIVATE': {
|
|
60
|
+
activeClientIds.add(clientId)
|
|
61
|
+
|
|
62
|
+
sendToClient(client, {
|
|
63
|
+
type: 'MOCKING_ENABLED',
|
|
64
|
+
payload: {
|
|
65
|
+
client: {
|
|
66
|
+
id: client.id,
|
|
67
|
+
frameType: client.frameType,
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
})
|
|
71
|
+
break
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
case 'CLIENT_CLOSED': {
|
|
75
|
+
activeClientIds.delete(clientId)
|
|
76
|
+
|
|
77
|
+
const remainingClients = allClients.filter((client) => {
|
|
78
|
+
return client.id !== clientId
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
// Unregister itself when there are no more clients
|
|
82
|
+
if (remainingClients.length === 0) {
|
|
83
|
+
self.registration.unregister()
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
break
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
addEventListener('fetch', function (event) {
|
|
92
|
+
const requestInterceptedAt = Date.now()
|
|
93
|
+
|
|
94
|
+
// Bypass navigation requests.
|
|
95
|
+
if (event.request.mode === 'navigate') {
|
|
96
|
+
return
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Opening the DevTools triggers the "only-if-cached" request
|
|
100
|
+
// that cannot be handled by the worker. Bypass such requests.
|
|
101
|
+
if (
|
|
102
|
+
event.request.cache === 'only-if-cached' &&
|
|
103
|
+
event.request.mode !== 'same-origin'
|
|
104
|
+
) {
|
|
105
|
+
return
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Bypass all requests when there are no active clients.
|
|
109
|
+
// Prevents the self-unregistered worked from handling requests
|
|
110
|
+
// after it's been terminated (still remains active until the next reload).
|
|
111
|
+
if (activeClientIds.size === 0) {
|
|
112
|
+
return
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const requestId = crypto.randomUUID()
|
|
116
|
+
event.respondWith(handleRequest(event, requestId, requestInterceptedAt))
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @param {FetchEvent} event
|
|
121
|
+
* @param {string} requestId
|
|
122
|
+
* @param {number} requestInterceptedAt
|
|
123
|
+
*/
|
|
124
|
+
async function handleRequest(event, requestId, requestInterceptedAt) {
|
|
125
|
+
const client = await resolveMainClient(event)
|
|
126
|
+
const requestCloneForEvents = event.request.clone()
|
|
127
|
+
const response = await getResponse(
|
|
128
|
+
event,
|
|
129
|
+
client,
|
|
130
|
+
requestId,
|
|
131
|
+
requestInterceptedAt,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
// Send back the response clone for the "response:*" life-cycle events.
|
|
135
|
+
// Ensure MSW is active and ready to handle the message, otherwise
|
|
136
|
+
// this message will pend indefinitely.
|
|
137
|
+
if (client && activeClientIds.has(client.id)) {
|
|
138
|
+
const serializedRequest = await serializeRequest(requestCloneForEvents)
|
|
139
|
+
|
|
140
|
+
// Clone the response so both the client and the library could consume it.
|
|
141
|
+
const responseClone = response.clone()
|
|
142
|
+
|
|
143
|
+
sendToClient(
|
|
144
|
+
client,
|
|
145
|
+
{
|
|
146
|
+
type: 'RESPONSE',
|
|
147
|
+
payload: {
|
|
148
|
+
isMockedResponse: IS_MOCKED_RESPONSE in response,
|
|
149
|
+
request: {
|
|
150
|
+
id: requestId,
|
|
151
|
+
...serializedRequest,
|
|
152
|
+
},
|
|
153
|
+
response: {
|
|
154
|
+
type: responseClone.type,
|
|
155
|
+
status: responseClone.status,
|
|
156
|
+
statusText: responseClone.statusText,
|
|
157
|
+
headers: Object.fromEntries(responseClone.headers.entries()),
|
|
158
|
+
body: responseClone.body,
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
responseClone.body ? [serializedRequest.body, responseClone.body] : [],
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return response
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Resolve the main client for the given event.
|
|
171
|
+
* Client that issues a request doesn't necessarily equal the client
|
|
172
|
+
* that registered the worker. It's with the latter the worker should
|
|
173
|
+
* communicate with during the response resolving phase.
|
|
174
|
+
* @param {FetchEvent} event
|
|
175
|
+
* @returns {Promise<Client | undefined>}
|
|
176
|
+
*/
|
|
177
|
+
async function resolveMainClient(event) {
|
|
178
|
+
const client = await self.clients.get(event.clientId)
|
|
179
|
+
|
|
180
|
+
if (activeClientIds.has(event.clientId)) {
|
|
181
|
+
return client
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
if (client?.frameType === 'top-level') {
|
|
185
|
+
return client
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const allClients = await self.clients.matchAll({
|
|
189
|
+
type: 'window',
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
return allClients
|
|
193
|
+
.filter((client) => {
|
|
194
|
+
// Get only those clients that are currently visible.
|
|
195
|
+
return client.visibilityState === 'visible'
|
|
196
|
+
})
|
|
197
|
+
.find((client) => {
|
|
198
|
+
// Find the client ID that's recorded in the
|
|
199
|
+
// set of clients that have registered the worker.
|
|
200
|
+
return activeClientIds.has(client.id)
|
|
201
|
+
})
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* @param {FetchEvent} event
|
|
206
|
+
* @param {Client | undefined} client
|
|
207
|
+
* @param {string} requestId
|
|
208
|
+
* @returns {Promise<Response>}
|
|
209
|
+
*/
|
|
210
|
+
async function getResponse(event, client, requestId, requestInterceptedAt) {
|
|
211
|
+
// Clone the request because it might've been already used
|
|
212
|
+
// (i.e. its body has been read and sent to the client).
|
|
213
|
+
const requestClone = event.request.clone()
|
|
214
|
+
|
|
215
|
+
function passthrough() {
|
|
216
|
+
// Cast the request headers to a new Headers instance
|
|
217
|
+
// so the headers can be manipulated with.
|
|
218
|
+
const headers = new Headers(requestClone.headers)
|
|
219
|
+
|
|
220
|
+
// Remove the "accept" header value that marked this request as passthrough.
|
|
221
|
+
// This prevents request alteration and also keeps it compliant with the
|
|
222
|
+
// user-defined CORS policies.
|
|
223
|
+
const acceptHeader = headers.get('accept')
|
|
224
|
+
if (acceptHeader) {
|
|
225
|
+
const values = acceptHeader.split(',').map((value) => value.trim())
|
|
226
|
+
const filteredValues = values.filter(
|
|
227
|
+
(value) => value !== 'msw/passthrough',
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
if (filteredValues.length > 0) {
|
|
231
|
+
headers.set('accept', filteredValues.join(', '))
|
|
232
|
+
} else {
|
|
233
|
+
headers.delete('accept')
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return fetch(requestClone, { headers })
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Bypass mocking when the client is not active.
|
|
241
|
+
if (!client) {
|
|
242
|
+
return passthrough()
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// Bypass initial page load requests (i.e. static assets).
|
|
246
|
+
// The absence of the immediate/parent client in the map of the active clients
|
|
247
|
+
// means that MSW hasn't dispatched the "MOCK_ACTIVATE" event yet
|
|
248
|
+
// and is not ready to handle requests.
|
|
249
|
+
if (!activeClientIds.has(client.id)) {
|
|
250
|
+
return passthrough()
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Notify the client that a request has been intercepted.
|
|
254
|
+
const serializedRequest = await serializeRequest(event.request)
|
|
255
|
+
const clientMessage = await sendToClient(
|
|
256
|
+
client,
|
|
257
|
+
{
|
|
258
|
+
type: 'REQUEST',
|
|
259
|
+
payload: {
|
|
260
|
+
id: requestId,
|
|
261
|
+
interceptedAt: requestInterceptedAt,
|
|
262
|
+
...serializedRequest,
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
[serializedRequest.body],
|
|
266
|
+
)
|
|
267
|
+
|
|
268
|
+
switch (clientMessage.type) {
|
|
269
|
+
case 'MOCK_RESPONSE': {
|
|
270
|
+
return respondWithMock(clientMessage.data)
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
case 'PASSTHROUGH': {
|
|
274
|
+
return passthrough()
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
return passthrough()
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* @param {Client} client
|
|
283
|
+
* @param {any} message
|
|
284
|
+
* @param {Array<Transferable>} transferrables
|
|
285
|
+
* @returns {Promise<any>}
|
|
286
|
+
*/
|
|
287
|
+
function sendToClient(client, message, transferrables = []) {
|
|
288
|
+
return new Promise((resolve, reject) => {
|
|
289
|
+
const channel = new MessageChannel()
|
|
290
|
+
|
|
291
|
+
channel.port1.onmessage = (event) => {
|
|
292
|
+
if (event.data && event.data.error) {
|
|
293
|
+
return reject(event.data.error)
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
resolve(event.data)
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
client.postMessage(message, [
|
|
300
|
+
channel.port2,
|
|
301
|
+
...transferrables.filter(Boolean),
|
|
302
|
+
])
|
|
303
|
+
})
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* @param {Response} response
|
|
308
|
+
* @returns {Response}
|
|
309
|
+
*/
|
|
310
|
+
function respondWithMock(response) {
|
|
311
|
+
// Setting response status code to 0 is a no-op.
|
|
312
|
+
// However, when responding with a "Response.error()", the produced Response
|
|
313
|
+
// instance will have status code set to 0. Since it's not possible to create
|
|
314
|
+
// a Response instance with status code 0, handle that use-case separately.
|
|
315
|
+
if (response.status === 0) {
|
|
316
|
+
return Response.error()
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
const mockedResponse = new Response(response.body, response)
|
|
320
|
+
|
|
321
|
+
Reflect.defineProperty(mockedResponse, IS_MOCKED_RESPONSE, {
|
|
322
|
+
value: true,
|
|
323
|
+
enumerable: true,
|
|
324
|
+
})
|
|
325
|
+
|
|
326
|
+
return mockedResponse
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* @param {Request} request
|
|
331
|
+
*/
|
|
332
|
+
async function serializeRequest(request) {
|
|
333
|
+
return {
|
|
334
|
+
url: request.url,
|
|
335
|
+
mode: request.mode,
|
|
336
|
+
method: request.method,
|
|
337
|
+
headers: Object.fromEntries(request.headers.entries()),
|
|
338
|
+
cache: request.cache,
|
|
339
|
+
credentials: request.credentials,
|
|
340
|
+
destination: request.destination,
|
|
341
|
+
integrity: request.integrity,
|
|
342
|
+
redirect: request.redirect,
|
|
343
|
+
referrer: request.referrer,
|
|
344
|
+
referrerPolicy: request.referrerPolicy,
|
|
345
|
+
body: await request.arrayBuffer(),
|
|
346
|
+
keepalive: request.keepalive,
|
|
347
|
+
}
|
|
348
|
+
}
|
package/dist/tag.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
2
|
+
import { JSX } from 'react/jsx-runtime';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
export declare function Tag({ className, size, variant, asChild, ...props }: TagProps): JSX.Element;
|
|
6
|
+
|
|
7
|
+
declare interface TagProps extends VariantProps<typeof tagVariants>, React.ComponentProps<"div"> {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export declare const tagVariants: (props?: ({
|
|
12
|
+
variant?: "default" | "button" | null | undefined;
|
|
13
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
14
|
+
} & ClassProp) | undefined) => string;
|
|
15
|
+
|
|
16
|
+
export { }
|
package/dist/tag.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { j as r } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
+
import { c as o, S as l } from "./index-DcqAdr0d.js";
|
|
3
|
+
import { c as d } from "./utils-CRiPKpXj.js";
|
|
4
|
+
const p = o(
|
|
5
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-sm text-sm bg-complement-3 text-white [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0",
|
|
6
|
+
{
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "",
|
|
10
|
+
button: "hover:bg-primary transition-all disabled:pointer-events-none disabled:opacity-50 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
|
|
11
|
+
},
|
|
12
|
+
size: {
|
|
13
|
+
default: "h-8 px-4 py-1.5 has-[>svg]:px-3",
|
|
14
|
+
sm: "h-6 gap-1 px-3 has-[>svg]:px-2.5",
|
|
15
|
+
lg: "scroll-mr-6 text-xl/5 font-medium h-16 px-8 has-[>svg]:px-4",
|
|
16
|
+
icon: "size-8"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
variant: "default",
|
|
21
|
+
size: "default"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
function m({ className: i, size: e, variant: t, asChild: s = !1, ...a }) {
|
|
26
|
+
const n = s ? l : "div";
|
|
27
|
+
return /* @__PURE__ */ r.jsx(n, { "data-slot": "tag", className: d(p({ variant: t, size: e, className: i })), ...a });
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
m as Tag,
|
|
31
|
+
p as tagVariants
|
|
32
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
2
|
+
import { JSX } from 'react/jsx-runtime';
|
|
3
|
+
import { JSX as JSX_2 } from 'react';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
export declare function Button({ className, variant, size, asChild, ...props }: ButtonProps): JSX.Element;
|
|
7
|
+
|
|
8
|
+
declare type ButtonProps = React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export declare const buttonVariants: (props?: ({
|
|
13
|
+
variant?: "default" | "secondary" | "outline" | "ghost" | "link" | "destructive" | null | undefined;
|
|
14
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
15
|
+
} & ClassProp) | undefined) => string;
|
|
16
|
+
|
|
17
|
+
export declare function Caption({ className, variant, asChild, ...props }: React.ComponentProps<"div"> & VariantProps<typeof captionVariants> & {
|
|
18
|
+
asChild?: boolean;
|
|
19
|
+
}): JSX.Element;
|
|
20
|
+
|
|
21
|
+
export declare const captionVariants: (props?: ({
|
|
22
|
+
variant?: "default" | "light" | null | undefined;
|
|
23
|
+
} & ClassProp) | undefined) => string;
|
|
24
|
+
|
|
25
|
+
export declare function Card<T extends boolean = false>({ className, asLink, variant, noBorder, ...props }: CardProps<T>): JSX.Element;
|
|
26
|
+
|
|
27
|
+
export declare function CardBody({ className, ...props }: React.ComponentProps<"div">): JSX.Element;
|
|
28
|
+
|
|
29
|
+
export declare function CardCaption(props: React.ComponentProps<"div">): JSX.Element;
|
|
30
|
+
|
|
31
|
+
export declare function CardContent(props: React.ComponentProps<"div">): JSX.Element;
|
|
32
|
+
|
|
33
|
+
export declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): JSX.Element;
|
|
34
|
+
|
|
35
|
+
export declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): JSX.Element;
|
|
36
|
+
|
|
37
|
+
export declare function CardImage({ className, ...props }: React.ComponentProps<"img">): JSX.Element;
|
|
38
|
+
|
|
39
|
+
export declare function CardMedia({ className, ...props }: React.ComponentProps<"div">): JSX.Element;
|
|
40
|
+
|
|
41
|
+
export declare function CardMeta(props: React.ComponentProps<"div">): JSX.Element;
|
|
42
|
+
|
|
43
|
+
declare type CardProps<T extends boolean> = (T extends true ? React.ComponentProps<"a"> : React.ComponentProps<"div">) & VariantProps<typeof cardVariants> & {
|
|
44
|
+
asLink?: T;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export declare function CardSubtitle({ size, className, ...props }: CardTitleProps): JSX.Element;
|
|
48
|
+
|
|
49
|
+
export declare function CardTitle({ size, className, ...props }: CardTitleProps): JSX.Element;
|
|
50
|
+
|
|
51
|
+
declare type CardTitleProps = React.ComponentProps<"div"> & {
|
|
52
|
+
size?: "sm" | "md" | "lg";
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
declare const cardVariants: (props?: ({
|
|
56
|
+
variant?: "default" | "dark" | null | undefined;
|
|
57
|
+
noBorder?: boolean | null | undefined;
|
|
58
|
+
} & ClassProp) | undefined) => string;
|
|
59
|
+
|
|
60
|
+
export declare function HorizontalList({ className, children, toolbarLocation, ...props }: HorizontalListProps): JSX.Element;
|
|
61
|
+
|
|
62
|
+
declare interface HorizontalListProps extends React.ComponentProps<"div"> {
|
|
63
|
+
toolbarLocation?: "bottom" | "top";
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export declare function IconGenerator({ pattern, tileSize, tileClassName, tileBgClassName, renderChildren, ...props }: IconGeneratorProps): JSX.Element;
|
|
67
|
+
|
|
68
|
+
declare interface IconGeneratorProps extends Omit<React.ComponentProps<"svg">, "children" | "width" | "height" | "overflow"> {
|
|
69
|
+
pattern?: (TileShape | TileConfig)[][];
|
|
70
|
+
tileSize?: number;
|
|
71
|
+
tileClassName?: string;
|
|
72
|
+
tileBgClassName?: string;
|
|
73
|
+
renderChildren?: (paths: (JSX_2.Element | null)[], width: number, height: number) => React.ReactNode;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export declare function MaskedImageGenerator({ src, imageFit, imagePosition, maskType, ...props }: MaskedImageGeneratorProps): JSX.Element;
|
|
77
|
+
|
|
78
|
+
declare interface MaskedImageGeneratorProps extends IconGeneratorProps {
|
|
79
|
+
src: string;
|
|
80
|
+
imageFit?: "cover" | "contain" | "fill";
|
|
81
|
+
imagePosition?: "top" | "center" | "bottom";
|
|
82
|
+
maskType?: "alpha" | "luminance";
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export declare function Tag({ className, size, variant, asChild, ...props }: TagProps): JSX.Element;
|
|
86
|
+
|
|
87
|
+
declare interface TagProps extends VariantProps<typeof tagVariants>, React.ComponentProps<"div"> {
|
|
88
|
+
asChild?: boolean;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export declare const tagVariants: (props?: ({
|
|
92
|
+
variant?: "default" | "button" | null | undefined;
|
|
93
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
94
|
+
} & ClassProp) | undefined) => string;
|
|
95
|
+
|
|
96
|
+
declare interface TileConfig {
|
|
97
|
+
shape: TileShape;
|
|
98
|
+
scale?: number;
|
|
99
|
+
className?: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
declare const TileShape: {
|
|
103
|
+
readonly Blank: 0;
|
|
104
|
+
readonly Rand: 1;
|
|
105
|
+
readonly Mosaic: 2;
|
|
106
|
+
readonly MosaicCircle: 3;
|
|
107
|
+
readonly MosaicDiamond: 4;
|
|
108
|
+
readonly Square: 6;
|
|
109
|
+
readonly Circle: 7;
|
|
110
|
+
readonly Diamond: 8;
|
|
111
|
+
readonly Hexagon: 9;
|
|
112
|
+
readonly RandBasic: 10;
|
|
113
|
+
readonly TriangleSE: 11;
|
|
114
|
+
readonly TriangleSW: 12;
|
|
115
|
+
readonly TriangleNW: 13;
|
|
116
|
+
readonly TriangleNE: 14;
|
|
117
|
+
readonly TriangleRand: 15;
|
|
118
|
+
readonly CaretN: 16;
|
|
119
|
+
readonly CaretE: 17;
|
|
120
|
+
readonly CaretS: 18;
|
|
121
|
+
readonly CaretW: 19;
|
|
122
|
+
readonly CaretRand: 20;
|
|
123
|
+
readonly PieSE: 21;
|
|
124
|
+
readonly PieSW: 22;
|
|
125
|
+
readonly PieNW: 23;
|
|
126
|
+
readonly PieNE: 24;
|
|
127
|
+
readonly PieRand: 25;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
declare type TileShape = (typeof TileShape)[keyof typeof TileShape];
|
|
131
|
+
|
|
132
|
+
export { }
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Button as t, buttonVariants as o } from "./button.js";
|
|
2
|
+
import { Caption as d, captionVariants as n } from "./caption.js";
|
|
3
|
+
import { Card as i, CardBody as p, CardCaption as m, CardContent as f, CardFooter as x, CardHeader as s, CardImage as g, CardMedia as l, CardMeta as u, CardSubtitle as I, CardTitle as M } from "./card.js";
|
|
4
|
+
import { Tag as b, tagVariants as c } from "./tag.js";
|
|
5
|
+
import { HorizontalList as G } from "./horizontal-list.js";
|
|
6
|
+
import { IconGenerator as T } from "./icon-generator.js";
|
|
7
|
+
import { MaskedImageGenerator as y } from "./masked-image-generator.js";
|
|
8
|
+
export {
|
|
9
|
+
t as Button,
|
|
10
|
+
d as Caption,
|
|
11
|
+
i as Card,
|
|
12
|
+
p as CardBody,
|
|
13
|
+
m as CardCaption,
|
|
14
|
+
f as CardContent,
|
|
15
|
+
x as CardFooter,
|
|
16
|
+
s as CardHeader,
|
|
17
|
+
g as CardImage,
|
|
18
|
+
l as CardMedia,
|
|
19
|
+
u as CardMeta,
|
|
20
|
+
I as CardSubtitle,
|
|
21
|
+
M as CardTitle,
|
|
22
|
+
G as HorizontalList,
|
|
23
|
+
T as IconGenerator,
|
|
24
|
+
y as MaskedImageGenerator,
|
|
25
|
+
b as Tag,
|
|
26
|
+
o as buttonVariants,
|
|
27
|
+
n as captionVariants,
|
|
28
|
+
c as tagVariants
|
|
29
|
+
};
|