@uoguelph/react-components 1.0.0-rc.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 +3 -0
- package/dist/accordion-button.d.ts +16 -0
- package/dist/accordion-button.js +42 -0
- package/dist/accordion-content.d.ts +15 -0
- package/dist/accordion-content.js +14 -0
- package/dist/accordion-context.d.ts +9 -0
- package/dist/accordion-context.js +5 -0
- package/dist/accordion.d.ts +42 -0
- package/dist/accordion.js +16 -0
- package/dist/alert-footer.d.ts +16 -0
- package/dist/alert-footer.js +10 -0
- package/dist/alert-message.d.ts +16 -0
- package/dist/alert-message.js +13 -0
- package/dist/alert-subtitle.d.ts +16 -0
- package/dist/alert-subtitle.js +10 -0
- package/dist/alert-title.d.ts +22 -0
- package/dist/alert-title.js +50 -0
- package/dist/alert.d.ts +70 -0
- package/dist/alert.js +18 -0
- package/dist/blockquote.d.ts +22 -0
- package/dist/blockquote.js +43 -0
- package/dist/breadcrumb-home.d.ts +32 -0
- package/dist/breadcrumb-home.js +21 -0
- package/dist/breadcrumb.d.ts +32 -0
- package/dist/breadcrumb.js +30 -0
- package/dist/breadcrumbs.d.ts +54 -0
- package/dist/breadcrumbs.js +15 -0
- package/dist/button.d.ts +51 -0
- package/dist/button.js +218 -0
- package/dist/card-content.d.ts +15 -0
- package/dist/card-content.js +20 -0
- package/dist/card-context.d.ts +10 -0
- package/dist/card-context.js +5 -0
- package/dist/card-footer.d.ts +16 -0
- package/dist/card-footer.js +20 -0
- package/dist/card-image.d.ts +40 -0
- package/dist/card-image.js +45 -0
- package/dist/card-title.d.ts +16 -0
- package/dist/card-title.js +20 -0
- package/dist/card.d.ts +105 -0
- package/dist/card.js +45 -0
- package/dist/carousel.d.ts +25 -0
- package/dist/carousel.js +113 -0
- package/dist/checkbox.d.ts +39 -0
- package/dist/checkbox.js +99 -0
- package/dist/contact-email.d.ts +17 -0
- package/dist/contact-email.js +21 -0
- package/dist/contact-name.d.ts +16 -0
- package/dist/contact-name.js +10 -0
- package/dist/contact-phone.d.ts +19 -0
- package/dist/contact-phone.js +25 -0
- package/dist/contact-title.d.ts +16 -0
- package/dist/contact-title.js +10 -0
- package/dist/contact.d.ts +73 -0
- package/dist/contact.js +18 -0
- package/dist/container.d.ts +32 -0
- package/dist/container.js +25 -0
- package/dist/divider.d.ts +6 -0
- package/dist/divider.js +30 -0
- package/dist/embedded-video-context.d.ts +10 -0
- package/dist/embedded-video-context.js +5 -0
- package/dist/embedded-video-modal-button.d.ts +54 -0
- package/dist/embedded-video-modal-button.js +25 -0
- package/dist/embedded-video.d.ts +81 -0
- package/dist/embedded-video.js +108 -0
- package/dist/hero-caption.d.ts +15 -0
- package/dist/hero-caption.js +8 -0
- package/dist/hero-content.d.ts +20 -0
- package/dist/hero-content.js +47 -0
- package/dist/hero-context.d.ts +9 -0
- package/dist/hero-context.js +5 -0
- package/dist/hero-link.d.ts +29 -0
- package/dist/hero-link.js +26 -0
- package/dist/hero-title.d.ts +24 -0
- package/dist/hero-title.js +26 -0
- package/dist/hero-video.d.ts +22 -0
- package/dist/hero-video.js +27 -0
- package/dist/hero.d.ts +141 -0
- package/dist/hero.js +52 -0
- package/dist/image-overlay.d.ts +66 -0
- package/dist/image-overlay.js +144 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +33 -0
- package/dist/info.d.ts +19 -0
- package/dist/info.js +24 -0
- package/dist/link-carousel-content.d.ts +11 -0
- package/dist/link-carousel-content.js +20 -0
- package/dist/link-carousel-context.d.ts +30 -0
- package/dist/link-carousel-context.js +5 -0
- package/dist/link-carousel-item.d.ts +15 -0
- package/dist/link-carousel-item.js +21 -0
- package/dist/link-carousel-link.d.ts +34 -0
- package/dist/link-carousel-link.js +39 -0
- package/dist/link-carousel-links.d.ts +11 -0
- package/dist/link-carousel-links.js +24 -0
- package/dist/link-carousel.d.ts +83 -0
- package/dist/link-carousel.js +57 -0
- package/dist/link.d.ts +30 -0
- package/dist/link.js +28 -0
- package/dist/list-item.d.ts +17 -0
- package/dist/list-item.js +9 -0
- package/dist/list.d.ts +39 -0
- package/dist/list.js +31 -0
- package/dist/loading-indicator.d.ts +23 -0
- package/dist/loading-indicator.js +75 -0
- package/dist/math-utils-BwzyIQRL.js +50 -0
- package/dist/media-caption.d.ts +110 -0
- package/dist/media-caption.js +129 -0
- package/dist/modal.d.ts +18 -0
- package/dist/modal.js +39 -0
- package/dist/navigation-link.d.ts +29 -0
- package/dist/navigation-link.js +40 -0
- package/dist/navigation.d.ts +40 -0
- package/dist/navigation.js +15 -0
- package/dist/radio-context.d.ts +9 -0
- package/dist/radio-context.js +5 -0
- package/dist/radio-group.d.ts +28 -0
- package/dist/radio-group.js +37 -0
- package/dist/radio.d.ts +13 -0
- package/dist/radio.js +36 -0
- package/dist/regular-CYeGUuiO.js +91 -0
- package/dist/solid-DM6GVhkF.js +80 -0
- package/dist/typography.d.ts +29 -0
- package/dist/typography.js +31 -0
- package/package.json +76 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { twJoin as o, twMerge as a } from "tailwind-merge";
|
|
3
|
+
import { Container as c } from "./container.js";
|
|
4
|
+
import { Breadcrumb as w } from "./breadcrumb.js";
|
|
5
|
+
import { BreadcrumbHome as l } from "./breadcrumb-home.js";
|
|
6
|
+
function n({ className: e, children: t }) {
|
|
7
|
+
const m = o("tw:flex tw:w-full tw:flex-wrap tw:items-center tw:gap-2");
|
|
8
|
+
return /* @__PURE__ */ r(c, { centered: !0, children: /* @__PURE__ */ r("ol", { className: a(m, e), children: t }) });
|
|
9
|
+
}
|
|
10
|
+
n.displayName = "Breadcrumbs";
|
|
11
|
+
export {
|
|
12
|
+
w as Breadcrumb,
|
|
13
|
+
l as BreadcrumbHome,
|
|
14
|
+
n as Breadcrumbs
|
|
15
|
+
};
|
package/dist/button.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { ElementType } from 'react';
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
import { PropsWithChildren } from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The Button component is a interactive component designed to capture user actions (such as submitting forms). It can
|
|
8
|
+
* also function as a link to another page or resource.
|
|
9
|
+
*/
|
|
10
|
+
export declare function Button<T extends ButtonElementType = typeof defaultElement>({ as, color, outlined, children, className, disabled, ...rest }: ButtonProps<T>): JSX.Element;
|
|
11
|
+
|
|
12
|
+
export declare namespace Button {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare type ButtonElementType = ElementType<{
|
|
17
|
+
href?: string;
|
|
18
|
+
}, 'a'> | 'button';
|
|
19
|
+
|
|
20
|
+
export declare type ButtonProps<T extends ButtonElementType = typeof defaultElement> = PropsWithChildren<ButtonPropsAs<T> & ComponentPropsWithoutRef<T> & ButtonPropsBase>;
|
|
21
|
+
|
|
22
|
+
declare type ButtonPropsAs<T extends ButtonElementType> = {
|
|
23
|
+
as?: T;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
declare type ButtonPropsBase = {
|
|
27
|
+
/**
|
|
28
|
+
* The color of the button
|
|
29
|
+
*
|
|
30
|
+
* @default 'red'
|
|
31
|
+
*/
|
|
32
|
+
color?: 'red' | 'yellow' | 'blue' | 'green' | 'light-grey' | 'dark-grey' | 'black' | 'white';
|
|
33
|
+
/**
|
|
34
|
+
* Whether the button should be outlined
|
|
35
|
+
*
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
outlined?: boolean;
|
|
39
|
+
/** Additional classes to apply to the button */
|
|
40
|
+
className?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Whether the button is disabled
|
|
43
|
+
*
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
declare const defaultElement = "button";
|
|
50
|
+
|
|
51
|
+
export { }
|
package/dist/button.js
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import { twMerge as w } from "tailwind-merge";
|
|
3
|
+
import { tv as d } from "tailwind-variants";
|
|
4
|
+
const n = "button";
|
|
5
|
+
function g({
|
|
6
|
+
as: t,
|
|
7
|
+
color: l = "red",
|
|
8
|
+
outlined: s = !1,
|
|
9
|
+
children: o,
|
|
10
|
+
className: r,
|
|
11
|
+
disabled: e = !1,
|
|
12
|
+
...i
|
|
13
|
+
}) {
|
|
14
|
+
const c = t ?? n, a = d({
|
|
15
|
+
base: "tw:font-medium tw:shadow-sm tw:inline-flex tw:items-center tw:justify-center tw:px-6 tw:py-4 tw:text-lg tw:no-underline tw:transition-colors tw:focus-visible:outline-none tw:focus-visible:ring-2 tw:focus-visible:ring-offset-2",
|
|
16
|
+
variants: {
|
|
17
|
+
color: {
|
|
18
|
+
red: "tw:focus-visible:ring-red",
|
|
19
|
+
yellow: "tw:focus-visible:ring-yellow",
|
|
20
|
+
blue: "tw:focus-visible:ring-blue",
|
|
21
|
+
green: "tw:focus-visible:ring-green",
|
|
22
|
+
"light-grey": "tw:focus-visible:ring-light-grey",
|
|
23
|
+
"dark-grey": "tw:focus-visible:ring-dark-grey",
|
|
24
|
+
black: "tw:focus-visible:ring-black",
|
|
25
|
+
white: "tw:focus-visible:ring-white"
|
|
26
|
+
},
|
|
27
|
+
outlined: {
|
|
28
|
+
true: "tw:border-2"
|
|
29
|
+
},
|
|
30
|
+
disabled: {
|
|
31
|
+
true: "tw:cursor-not-allowed tw:opacity-50"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
compoundVariants: [
|
|
35
|
+
{
|
|
36
|
+
color: "red",
|
|
37
|
+
outlined: !1,
|
|
38
|
+
class: "tw:bg-red tw:text-red-contrast"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
color: "red",
|
|
42
|
+
outlined: !0,
|
|
43
|
+
class: "tw:border-red tw:text-red"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
color: "red",
|
|
47
|
+
outlined: !1,
|
|
48
|
+
disabled: !1,
|
|
49
|
+
class: "tw:hocus-visible:bg-red-focus"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
color: "red",
|
|
53
|
+
outlined: !0,
|
|
54
|
+
disabled: !1,
|
|
55
|
+
class: "tw:hocus-visible:bg-red tw:hocus-visible:text-red-contrast"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
color: "yellow",
|
|
59
|
+
outlined: !1,
|
|
60
|
+
class: "tw:bg-yellow tw:text-yellow-contrast"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
color: "yellow",
|
|
64
|
+
outlined: !0,
|
|
65
|
+
class: "tw:border-yellow tw:text-yellow"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
color: "yellow",
|
|
69
|
+
outlined: !1,
|
|
70
|
+
disabled: !1,
|
|
71
|
+
class: "tw:hocus-visible:bg-yellow-focus"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
color: "yellow",
|
|
75
|
+
outlined: !0,
|
|
76
|
+
disabled: !1,
|
|
77
|
+
class: "tw:hocus-visible:bg-yellow tw:hocus-visible:text-yellow-contrast"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
color: "blue",
|
|
81
|
+
outlined: !1,
|
|
82
|
+
class: "tw:bg-blue tw:text-blue-contrast"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
color: "blue",
|
|
86
|
+
outlined: !0,
|
|
87
|
+
class: "tw:border-blue tw:text-blue"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
color: "blue",
|
|
91
|
+
outlined: !1,
|
|
92
|
+
disabled: !1,
|
|
93
|
+
class: "tw:hocus-visible:bg-blue-focus"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
color: "blue",
|
|
97
|
+
outlined: !0,
|
|
98
|
+
disabled: !1,
|
|
99
|
+
class: "tw:hocus-visible:bg-blue tw:hocus-visible:text-blue-contrast"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
color: "green",
|
|
103
|
+
outlined: !1,
|
|
104
|
+
class: "tw:bg-green tw:text-green-contrast"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
color: "green",
|
|
108
|
+
outlined: !0,
|
|
109
|
+
class: "tw:border-green tw:text-green"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
color: "green",
|
|
113
|
+
outlined: !1,
|
|
114
|
+
disabled: !1,
|
|
115
|
+
class: "tw:hocus-visible:bg-green-focus"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
color: "green",
|
|
119
|
+
outlined: !0,
|
|
120
|
+
disabled: !1,
|
|
121
|
+
class: "tw:hocus-visible:bg-green tw:hocus-visible:text-green-contrast"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
color: "light-grey",
|
|
125
|
+
outlined: !1,
|
|
126
|
+
class: "tw:bg-light-grey tw:text-light-grey-contrast"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
color: "light-grey",
|
|
130
|
+
outlined: !0,
|
|
131
|
+
class: "tw:border-light-grey tw:text-light-grey"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
color: "light-grey",
|
|
135
|
+
outlined: !1,
|
|
136
|
+
disabled: !1,
|
|
137
|
+
class: "tw:hocus-visible:bg-light-grey-focus"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
color: "light-grey",
|
|
141
|
+
outlined: !0,
|
|
142
|
+
disabled: !1,
|
|
143
|
+
class: "tw:hocus-visible:bg-light-grey tw:hocus-visible:text-light-grey-contrast"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
color: "dark-grey",
|
|
147
|
+
outlined: !1,
|
|
148
|
+
class: "tw:bg-dark-grey tw:text-dark-grey-contrast"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
color: "dark-grey",
|
|
152
|
+
outlined: !0,
|
|
153
|
+
class: "tw:border-dark-grey tw:text-dark-grey"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
color: "dark-grey",
|
|
157
|
+
outlined: !1,
|
|
158
|
+
disabled: !1,
|
|
159
|
+
class: "tw:hocus-visible:bg-dark-grey-focus"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
color: "dark-grey",
|
|
163
|
+
outlined: !0,
|
|
164
|
+
disabled: !1,
|
|
165
|
+
class: "tw:hocus-visible:bg-dark-grey tw:hocus-visible:text-dark-grey-contrast"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
color: "black",
|
|
169
|
+
outlined: !1,
|
|
170
|
+
class: "tw:bg-black tw:text-black-contrast"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
color: "black",
|
|
174
|
+
outlined: !0,
|
|
175
|
+
class: "tw:border-black tw:text-black"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
color: "black",
|
|
179
|
+
outlined: !1,
|
|
180
|
+
disabled: !1,
|
|
181
|
+
class: "tw:hocus-visible:bg-black-focus"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
color: "black",
|
|
185
|
+
outlined: !0,
|
|
186
|
+
disabled: !1,
|
|
187
|
+
class: "tw:hocus-visible:bg-black tw:hocus-visible:text-black-contrast"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
color: "white",
|
|
191
|
+
outlined: !1,
|
|
192
|
+
class: "tw:bg-white tw:text-white-contrast"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
color: "white",
|
|
196
|
+
outlined: !0,
|
|
197
|
+
class: "tw:border-white tw:text-white"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
color: "white",
|
|
201
|
+
outlined: !1,
|
|
202
|
+
disabled: !1,
|
|
203
|
+
class: "tw:hocus-visible:bg-white-focus"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
color: "white",
|
|
207
|
+
outlined: !0,
|
|
208
|
+
disabled: !1,
|
|
209
|
+
class: "tw:hocus-visible:bg-white tw:hocus-visible:text-white-contrast"
|
|
210
|
+
}
|
|
211
|
+
]
|
|
212
|
+
}), u = w(a({ color: l, outlined: s, disabled: e }), r);
|
|
213
|
+
return /* @__PURE__ */ b(c, { className: `uofg-button ${u}`, disabled: e, ...i, children: o });
|
|
214
|
+
}
|
|
215
|
+
g.displayName = "Button";
|
|
216
|
+
export {
|
|
217
|
+
g as Button
|
|
218
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
export declare function CardContent({ children, className }: CardContentProps): JSX.Element;
|
|
5
|
+
|
|
6
|
+
export declare namespace CardContent {
|
|
7
|
+
var displayName: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export declare type CardContentProps = PropsWithChildren<{
|
|
11
|
+
/** Additional classes to apply to the card content */
|
|
12
|
+
className?: string;
|
|
13
|
+
}>;
|
|
14
|
+
|
|
15
|
+
export { }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as s } from "react";
|
|
3
|
+
import { twMerge as n } from "tailwind-merge";
|
|
4
|
+
import { tv as a } from "tailwind-variants";
|
|
5
|
+
import { CardContext as l } from "./card-context.js";
|
|
6
|
+
function m({ children: o, className: r }) {
|
|
7
|
+
const t = s(l), e = a({
|
|
8
|
+
base: "tw:flex tw:flex-col tw:gap-2 tw:bg-light-grey-bg tw:p-5 tw:text-light-grey-contrast",
|
|
9
|
+
variants: {
|
|
10
|
+
isLink: {
|
|
11
|
+
true: "tw:transition-colors tw:group-hocus-visible:bg-yellow tw:group-hocus-visible:text-yellow-contrast"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
return /* @__PURE__ */ i("div", { className: n(e({ isLink: (t == null ? void 0 : t.isLink) ?? !1 }), r), children: o });
|
|
16
|
+
}
|
|
17
|
+
m.displayName = "CardContent";
|
|
18
|
+
export {
|
|
19
|
+
m as CardContent
|
|
20
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
/** The CardFooter component is used to display additional information or actions at the bottom of a card. */
|
|
5
|
+
export declare function CardFooter({ children, className }: CardFooterProps): JSX.Element;
|
|
6
|
+
|
|
7
|
+
export declare namespace CardFooter {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export declare type CardFooterProps = PropsWithChildren<{
|
|
12
|
+
/** Additional classes to apply to the card footer */
|
|
13
|
+
className?: string;
|
|
14
|
+
}>;
|
|
15
|
+
|
|
16
|
+
export { }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as i } from "react";
|
|
3
|
+
import { twMerge as n } from "tailwind-merge";
|
|
4
|
+
import { tv as s } from "tailwind-variants";
|
|
5
|
+
import { CardContext as m } from "./card-context.js";
|
|
6
|
+
function c({ children: r, className: e }) {
|
|
7
|
+
const t = i(m), o = s({
|
|
8
|
+
base: "tw:flex tw:gap-2 tw:bg-light-grey tw:px-5 tw:py-2 tw:text-light-grey-contrast tw:transition-colors",
|
|
9
|
+
variants: {
|
|
10
|
+
centered: {
|
|
11
|
+
true: "tw:justify-center"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
return /* @__PURE__ */ a("div", { className: n(o({ centered: (t == null ? void 0 : t.centered) ?? !1 }), e), children: r });
|
|
16
|
+
}
|
|
17
|
+
c.displayName = "CardFooter";
|
|
18
|
+
export {
|
|
19
|
+
c as CardFooter
|
|
20
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { ElementType } from 'react';
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
/** The CardImage component is used to display an image within a card. */
|
|
6
|
+
export declare function CardImage<T extends CardImageElementType = typeof defaultCardImageElement>({ as, src, alt, width, height, className, ...rest }: CardImageProps<T>): JSX.Element;
|
|
7
|
+
|
|
8
|
+
export declare namespace CardImage {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare type CardImageElementType = ElementType<{
|
|
13
|
+
src: string;
|
|
14
|
+
alt: string;
|
|
15
|
+
width?: string;
|
|
16
|
+
height?: string;
|
|
17
|
+
}, 'img'>;
|
|
18
|
+
|
|
19
|
+
export declare type CardImageProps<T extends CardImageElementType = typeof defaultCardImageElement> = {
|
|
20
|
+
/**
|
|
21
|
+
* The element to render the image as
|
|
22
|
+
*
|
|
23
|
+
* @default 'img'
|
|
24
|
+
*/
|
|
25
|
+
as?: T;
|
|
26
|
+
/** The source URL of the image */
|
|
27
|
+
src: string;
|
|
28
|
+
/** An accessible description of the image, used primarily for screen readers */
|
|
29
|
+
alt: string;
|
|
30
|
+
/** The width of the image in pixels */
|
|
31
|
+
width?: string;
|
|
32
|
+
/** The height of the image in pixels */
|
|
33
|
+
height?: string;
|
|
34
|
+
/** Additional classes to apply to the image */
|
|
35
|
+
className?: string;
|
|
36
|
+
} & ComponentPropsWithoutRef<T>;
|
|
37
|
+
|
|
38
|
+
declare const defaultCardImageElement = "img";
|
|
39
|
+
|
|
40
|
+
export { }
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as f } from "react";
|
|
3
|
+
import { twMerge as u } from "tailwind-merge";
|
|
4
|
+
import { tv as g } from "tailwind-variants";
|
|
5
|
+
import { CardContext as v } from "./card-context.js";
|
|
6
|
+
const C = "img";
|
|
7
|
+
function h({
|
|
8
|
+
as: e,
|
|
9
|
+
src: a,
|
|
10
|
+
alt: o,
|
|
11
|
+
width: i,
|
|
12
|
+
height: n,
|
|
13
|
+
className: s,
|
|
14
|
+
...m
|
|
15
|
+
}) {
|
|
16
|
+
const l = e ?? C, r = f(v), w = g({
|
|
17
|
+
slots: {
|
|
18
|
+
container: "tw:w-full tw:overflow-hidden",
|
|
19
|
+
wrapper: "tw:w-full tw:overflow-hidden",
|
|
20
|
+
image: "tw:w-full"
|
|
21
|
+
},
|
|
22
|
+
variants: {
|
|
23
|
+
isLink: {
|
|
24
|
+
true: {
|
|
25
|
+
wrapper: "tw:ease-in-out tw:transition-transform tw:duration-200 tw:group-hover:scale-110"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}), { container: d, wrapper: p, image: c } = w({ isLink: (r == null ? void 0 : r.isLink) ?? !1 });
|
|
30
|
+
return /* @__PURE__ */ t("div", { className: d(), children: /* @__PURE__ */ t("div", { className: p(), children: /* @__PURE__ */ t(
|
|
31
|
+
l,
|
|
32
|
+
{
|
|
33
|
+
...m,
|
|
34
|
+
src: a,
|
|
35
|
+
alt: o,
|
|
36
|
+
width: i,
|
|
37
|
+
height: n,
|
|
38
|
+
className: u(c(), s)
|
|
39
|
+
}
|
|
40
|
+
) }) });
|
|
41
|
+
}
|
|
42
|
+
h.displayName = "CardImage";
|
|
43
|
+
export {
|
|
44
|
+
h as CardImage
|
|
45
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
/** The CardTitle component is used to display a title for a card. */
|
|
5
|
+
export declare function CardTitle({ children, className }: CardTitleProps): JSX.Element;
|
|
6
|
+
|
|
7
|
+
export declare namespace CardTitle {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export declare type CardTitleProps = PropsWithChildren<{
|
|
12
|
+
/** Additional classes to apply to the card title */
|
|
13
|
+
className?: string;
|
|
14
|
+
}>;
|
|
15
|
+
|
|
16
|
+
export { }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as m } from "react";
|
|
3
|
+
import { twMerge as n } from "tailwind-merge";
|
|
4
|
+
import { tv as a } from "tailwind-variants";
|
|
5
|
+
import { CardContext as s } from "./card-context.js";
|
|
6
|
+
function f({ children: e, className: r }) {
|
|
7
|
+
const t = m(s), o = a({
|
|
8
|
+
base: "tw:flex tw:flex-1 tw:font-bold tw:text-lg",
|
|
9
|
+
variants: {
|
|
10
|
+
centered: {
|
|
11
|
+
true: "tw:items-center tw:justify-center"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
return /* @__PURE__ */ i("div", { className: n(o({ centered: (t == null ? void 0 : t.centered) ?? !1 }), r), children: e });
|
|
16
|
+
}
|
|
17
|
+
f.displayName = "CardTitle";
|
|
18
|
+
export {
|
|
19
|
+
f as CardTitle
|
|
20
|
+
};
|
package/dist/card.d.ts
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { ElementType } from 'react';
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
import { PropsWithChildren } from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The Card component is a container used to group related content like text, images, and actions in a styled, organized
|
|
8
|
+
* layout
|
|
9
|
+
*/
|
|
10
|
+
export declare function Card<T extends CardElementType = typeof defaultElement>({ as, className, centered, children, ...rest }: CardProps<T>): JSX.Element;
|
|
11
|
+
|
|
12
|
+
export declare namespace Card {
|
|
13
|
+
var displayName: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare function CardContent({ children, className }: CardContentProps): JSX.Element;
|
|
17
|
+
|
|
18
|
+
export declare namespace CardContent {
|
|
19
|
+
var displayName: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare type CardContentProps = PropsWithChildren<{
|
|
23
|
+
/** Additional classes to apply to the card content */
|
|
24
|
+
className?: string;
|
|
25
|
+
}>;
|
|
26
|
+
|
|
27
|
+
declare type CardElementType = ElementType<{
|
|
28
|
+
href?: string;
|
|
29
|
+
}, 'a'> | 'div' | 'article';
|
|
30
|
+
|
|
31
|
+
/** The CardFooter component is used to display additional information or actions at the bottom of a card. */
|
|
32
|
+
export declare function CardFooter({ children, className }: CardFooterProps): JSX.Element;
|
|
33
|
+
|
|
34
|
+
export declare namespace CardFooter {
|
|
35
|
+
var displayName: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare type CardFooterProps = PropsWithChildren<{
|
|
39
|
+
/** Additional classes to apply to the card footer */
|
|
40
|
+
className?: string;
|
|
41
|
+
}>;
|
|
42
|
+
|
|
43
|
+
/** The CardImage component is used to display an image within a card. */
|
|
44
|
+
export declare function CardImage<T extends CardImageElementType = typeof defaultCardImageElement>({ as, src, alt, width, height, className, ...rest }: CardImageProps<T>): JSX.Element;
|
|
45
|
+
|
|
46
|
+
export declare namespace CardImage {
|
|
47
|
+
var displayName: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare type CardImageElementType = ElementType<{
|
|
51
|
+
src: string;
|
|
52
|
+
alt: string;
|
|
53
|
+
width?: string;
|
|
54
|
+
height?: string;
|
|
55
|
+
}, 'img'>;
|
|
56
|
+
|
|
57
|
+
declare type CardImageProps<T extends CardImageElementType = typeof defaultCardImageElement> = {
|
|
58
|
+
/**
|
|
59
|
+
* The element to render the image as
|
|
60
|
+
*
|
|
61
|
+
* @default 'img'
|
|
62
|
+
*/
|
|
63
|
+
as?: T;
|
|
64
|
+
/** The source URL of the image */
|
|
65
|
+
src: string;
|
|
66
|
+
/** An accessible description of the image, used primarily for screen readers */
|
|
67
|
+
alt: string;
|
|
68
|
+
/** The width of the image in pixels */
|
|
69
|
+
width?: string;
|
|
70
|
+
/** The height of the image in pixels */
|
|
71
|
+
height?: string;
|
|
72
|
+
/** Additional classes to apply to the image */
|
|
73
|
+
className?: string;
|
|
74
|
+
} & ComponentPropsWithoutRef<T>;
|
|
75
|
+
|
|
76
|
+
export declare type CardProps<T extends CardElementType = typeof defaultElement> = PropsWithChildren<{
|
|
77
|
+
/** The element to render the card as */
|
|
78
|
+
as?: T;
|
|
79
|
+
/** Additional classes to apply to the card */
|
|
80
|
+
className?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Whether the card content should be centered
|
|
83
|
+
*
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
centered?: boolean;
|
|
87
|
+
} & ComponentPropsWithoutRef<T>>;
|
|
88
|
+
|
|
89
|
+
/** The CardTitle component is used to display a title for a card. */
|
|
90
|
+
export declare function CardTitle({ children, className }: CardTitleProps): JSX.Element;
|
|
91
|
+
|
|
92
|
+
export declare namespace CardTitle {
|
|
93
|
+
var displayName: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare type CardTitleProps = PropsWithChildren<{
|
|
97
|
+
/** Additional classes to apply to the card title */
|
|
98
|
+
className?: string;
|
|
99
|
+
}>;
|
|
100
|
+
|
|
101
|
+
declare const defaultCardImageElement = "img";
|
|
102
|
+
|
|
103
|
+
declare const defaultElement = "div";
|
|
104
|
+
|
|
105
|
+
export { }
|
package/dist/card.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Children as u } from "react";
|
|
3
|
+
import { twMerge as c } from "tailwind-merge";
|
|
4
|
+
import { tv as d } from "tailwind-variants";
|
|
5
|
+
import { CardContent as j } from "./card-content.js";
|
|
6
|
+
import { CardContext as p } from "./card-context.js";
|
|
7
|
+
import { CardFooter as A } from "./card-footer.js";
|
|
8
|
+
import { CardImage as w } from "./card-image.js";
|
|
9
|
+
import { CardTitle as F } from "./card-title.js";
|
|
10
|
+
const g = "div";
|
|
11
|
+
function C({
|
|
12
|
+
as: i,
|
|
13
|
+
className: n,
|
|
14
|
+
centered: s,
|
|
15
|
+
children: t,
|
|
16
|
+
...o
|
|
17
|
+
}) {
|
|
18
|
+
const a = i ?? g, m = d({
|
|
19
|
+
base: "tw:group tw:ease-in-out tw:focus-visible:ring-light-blue tw:flex tw:flex-col tw:justify-center tw:transition tw:duration-200 tw:focus-visible:ring-2 tw:focus-visible:ring-offset-2 tw:focus-visible:outline-none",
|
|
20
|
+
variants: {
|
|
21
|
+
isLink: {
|
|
22
|
+
true: ""
|
|
23
|
+
},
|
|
24
|
+
hasImage: {
|
|
25
|
+
true: ""
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
compoundVariants: [
|
|
29
|
+
{
|
|
30
|
+
isLink: !0,
|
|
31
|
+
hasImage: !1,
|
|
32
|
+
class: "tw:transition-colors tw:group-hover:bg-yellow"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}), r = "href" in o, f = u.toArray(t).some((l) => l.type === w);
|
|
36
|
+
return /* @__PURE__ */ e(a, { ...o, className: c(m({ isLink: r, hasImage: f }), n), children: /* @__PURE__ */ e(p.Provider, { value: { isLink: r, centered: s ?? !1 }, children: t }) });
|
|
37
|
+
}
|
|
38
|
+
C.displayName = "Card";
|
|
39
|
+
export {
|
|
40
|
+
C as Card,
|
|
41
|
+
j as CardContent,
|
|
42
|
+
A as CardFooter,
|
|
43
|
+
w as CardImage,
|
|
44
|
+
F as CardTitle
|
|
45
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The Carousel component is used to display a series of items in a horizontal row, allowing the user to scroll through
|
|
6
|
+
* them.
|
|
7
|
+
*/
|
|
8
|
+
export declare function Carousel({ children, display, loop }: CarouselProps): JSX.Element;
|
|
9
|
+
|
|
10
|
+
export declare type CarouselProps = PropsWithChildren<{
|
|
11
|
+
/**
|
|
12
|
+
* The number of items to display at once
|
|
13
|
+
*
|
|
14
|
+
* @default 1
|
|
15
|
+
*/
|
|
16
|
+
display?: number;
|
|
17
|
+
/**
|
|
18
|
+
* The looping behavior of the carousel
|
|
19
|
+
*
|
|
20
|
+
* @default 'none'
|
|
21
|
+
*/
|
|
22
|
+
loop?: 'jump' | 'continuous' | 'none';
|
|
23
|
+
}>;
|
|
24
|
+
|
|
25
|
+
export { }
|