@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,129 @@
|
|
|
1
|
+
import { jsxs as u, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { twMerge as a } from "tailwind-merge";
|
|
3
|
+
import { tv as y } from "tailwind-variants";
|
|
4
|
+
import { EmbeddedVideo as x } from "./embedded-video.js";
|
|
5
|
+
const v = "img";
|
|
6
|
+
function h({
|
|
7
|
+
as: e,
|
|
8
|
+
size: t = "small",
|
|
9
|
+
position: s = "left",
|
|
10
|
+
background: r = "none",
|
|
11
|
+
children: n,
|
|
12
|
+
src: l,
|
|
13
|
+
className: c,
|
|
14
|
+
mediaClassName: d,
|
|
15
|
+
...p
|
|
16
|
+
}) {
|
|
17
|
+
const i = e ?? v;
|
|
18
|
+
t = (i instanceof x ? "video" : "image") === "video" && t === "small" ? "medium" : t;
|
|
19
|
+
const m = y({
|
|
20
|
+
slots: {
|
|
21
|
+
base: "tw:flex tw:flex-col",
|
|
22
|
+
mediaWrapper: "",
|
|
23
|
+
media: "tw:w-full tw:object-cover",
|
|
24
|
+
caption: "tw:p-4"
|
|
25
|
+
},
|
|
26
|
+
variants: {
|
|
27
|
+
size: {
|
|
28
|
+
small: {},
|
|
29
|
+
medium: {},
|
|
30
|
+
large: {}
|
|
31
|
+
},
|
|
32
|
+
position: {
|
|
33
|
+
left: {
|
|
34
|
+
base: "tw:md:grid"
|
|
35
|
+
},
|
|
36
|
+
right: {
|
|
37
|
+
base: "tw:md:grid",
|
|
38
|
+
mediaWrapper: "tw:col-start-2 tw:row-start-1",
|
|
39
|
+
caption: "tw:col-start-1 tw:row-start-1"
|
|
40
|
+
},
|
|
41
|
+
above: {
|
|
42
|
+
caption: "tw:flex-1"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
background: {
|
|
46
|
+
"light-grey": {
|
|
47
|
+
caption: "tw:bg-light-grey-bg tw:text-body-copy"
|
|
48
|
+
},
|
|
49
|
+
"dark-grey": {
|
|
50
|
+
caption: "tw:bg-dark-grey-bg tw:text-body-copy-on-dark"
|
|
51
|
+
},
|
|
52
|
+
none: {}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
compoundVariants: [
|
|
56
|
+
{
|
|
57
|
+
size: "small",
|
|
58
|
+
position: "left",
|
|
59
|
+
class: {
|
|
60
|
+
base: "tw:grid-cols-[1fr_4fr]"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
size: "medium",
|
|
65
|
+
position: "left",
|
|
66
|
+
class: {
|
|
67
|
+
base: "tw:grid-cols-[1fr_2fr]"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
size: "large",
|
|
72
|
+
position: "left",
|
|
73
|
+
class: {
|
|
74
|
+
base: "tw:grid-cols-[1fr_1fr]"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
size: "small",
|
|
79
|
+
position: "right",
|
|
80
|
+
class: {
|
|
81
|
+
base: "tw:grid-cols-[4fr_1fr]"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
size: "medium",
|
|
86
|
+
position: "right",
|
|
87
|
+
class: {
|
|
88
|
+
base: "tw:grid-cols-[2fr_1fr]"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
size: "large",
|
|
93
|
+
position: "right",
|
|
94
|
+
class: {
|
|
95
|
+
base: "tw:grid-cols-[1fr_1fr]"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
background: "none",
|
|
100
|
+
position: "left",
|
|
101
|
+
class: {
|
|
102
|
+
caption: "tw:md:px-4 tw:py-0"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
background: "none",
|
|
107
|
+
position: "right",
|
|
108
|
+
class: {
|
|
109
|
+
caption: "tw:md:px-4 tw:py-0"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
background: "none",
|
|
114
|
+
position: "above",
|
|
115
|
+
class: {
|
|
116
|
+
caption: "tw:px-0"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
}), { base: g, mediaWrapper: w, media: f, caption: b } = m({ size: t, position: s, background: r });
|
|
121
|
+
return /* @__PURE__ */ u("div", { className: a(g(), c), children: [
|
|
122
|
+
/* @__PURE__ */ o("div", { className: w(), children: /* @__PURE__ */ o(i, { ...p, src: l, className: a(f(), d) }) }),
|
|
123
|
+
/* @__PURE__ */ o("div", { className: b(), children: n })
|
|
124
|
+
] });
|
|
125
|
+
}
|
|
126
|
+
h.displayName = "MediaCaption";
|
|
127
|
+
export {
|
|
128
|
+
h as MediaCaption
|
|
129
|
+
};
|
package/dist/modal.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
export declare function Modal({ open, onClose, role, labelledBy, centered, children }: ModalProps): JSX.Element;
|
|
5
|
+
|
|
6
|
+
export declare namespace Modal {
|
|
7
|
+
var displayName: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export declare type ModalProps = PropsWithChildren<{
|
|
11
|
+
open: boolean;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
role?: 'dialog' | 'alertdialog';
|
|
14
|
+
labelledBy?: string;
|
|
15
|
+
centered?: boolean;
|
|
16
|
+
}>;
|
|
17
|
+
|
|
18
|
+
export { }
|
package/dist/modal.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { g as f } from "./solid-DM6GVhkF.js";
|
|
3
|
+
import { FontAwesomeIcon as b } from "@fortawesome/react-fontawesome";
|
|
4
|
+
import { Dialog as x, DialogBackdrop as g, CloseButton as h, DialogPanel as y } from "@headlessui/react";
|
|
5
|
+
import { tv as N } from "tailwind-variants";
|
|
6
|
+
function v({ open: r, onClose: a = () => {
|
|
7
|
+
}, role: o = "dialog", labelledBy: l, centered: w, children: s }) {
|
|
8
|
+
const i = N({
|
|
9
|
+
slots: {
|
|
10
|
+
base: "tw:ease-out tw:relative tw:z-50 tw:transition tw:duration-300 tw:data-[closed]:opacity-0",
|
|
11
|
+
backdrop: "tw:ease-out tw:fixed tw:inset-0 tw:bg-black/40 tw:transition tw:duration-300 tw:data-[closed]:opacity-0",
|
|
12
|
+
wrapper: "tw:fixed tw:inset-0 tw:flex tw:w-screen tw:justify-center tw:md:p-4",
|
|
13
|
+
panelWrapper: "tw:relative tw:w-full tw:flex tw:flex-col tw:items-center",
|
|
14
|
+
panel: "",
|
|
15
|
+
closeButton: "tw:bg-dark-grey-bg tw:md:absolute tw:border-b tw:border-white/40 tw:top-0 tw:right-0 tw:flex tw:h-9 tw:w-full tw:md:w-9 tw:items-center tw:justify-center tw:md:rounded-full tw:text-xl tw:text-white tw:transition-colors tw:hover:bg-red tw:gap-1"
|
|
16
|
+
},
|
|
17
|
+
variants: {
|
|
18
|
+
centered: {
|
|
19
|
+
true: {
|
|
20
|
+
panelWrapper: "tw:justify-center"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}), { base: n, backdrop: c, wrapper: d, panelWrapper: p, panel: m, closeButton: u } = i({ centered: w });
|
|
25
|
+
return /* @__PURE__ */ e(x, { transition: !0, open: r, role: o, onClose: a, className: n(), "aria-labelledby": l, children: [
|
|
26
|
+
/* @__PURE__ */ t(g, { transition: !0, className: c() }),
|
|
27
|
+
/* @__PURE__ */ t("div", { className: d(), children: /* @__PURE__ */ e("div", { className: p(), children: [
|
|
28
|
+
/* @__PURE__ */ e(h, { onClick: a, className: u(), children: [
|
|
29
|
+
/* @__PURE__ */ t(b, { icon: f }),
|
|
30
|
+
/* @__PURE__ */ t("span", { className: "tw:md:sr-only tw:text-base", children: "Close Modal" })
|
|
31
|
+
] }),
|
|
32
|
+
/* @__PURE__ */ t(y, { className: m(), children: s })
|
|
33
|
+
] }) })
|
|
34
|
+
] });
|
|
35
|
+
}
|
|
36
|
+
v.displayName = "Modal";
|
|
37
|
+
export {
|
|
38
|
+
v as Modal
|
|
39
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { ElementType } from 'react';
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
import { PropsWithChildren } from 'react';
|
|
5
|
+
|
|
6
|
+
declare const defaultElement = "a";
|
|
7
|
+
|
|
8
|
+
export declare function NavigationLink<T extends NavigationLinkElementType = typeof defaultElement>({ as, active, href, children, className, ...rest }: NavigationLinkProps<T>): JSX.Element;
|
|
9
|
+
|
|
10
|
+
export declare namespace NavigationLink {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare type NavigationLinkElementType = ElementType<{
|
|
15
|
+
href?: string;
|
|
16
|
+
}, 'a'>;
|
|
17
|
+
|
|
18
|
+
export declare type NavigationLinkProps<T extends NavigationLinkElementType = typeof defaultElement> = PropsWithChildren<{
|
|
19
|
+
/** The element to render the link as */
|
|
20
|
+
as?: T;
|
|
21
|
+
/** If true, the link will be styled as active */
|
|
22
|
+
active?: boolean;
|
|
23
|
+
/** The href of the link */
|
|
24
|
+
href: string;
|
|
25
|
+
/** Additional classes to add the link */
|
|
26
|
+
className?: string;
|
|
27
|
+
} & ComponentPropsWithoutRef<T>>;
|
|
28
|
+
|
|
29
|
+
export { }
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { twMerge as g } from "tailwind-merge";
|
|
3
|
+
import { tv as m } from "tailwind-variants";
|
|
4
|
+
const b = "a";
|
|
5
|
+
function f({
|
|
6
|
+
as: o,
|
|
7
|
+
active: t,
|
|
8
|
+
href: n,
|
|
9
|
+
children: i,
|
|
10
|
+
className: l,
|
|
11
|
+
...r
|
|
12
|
+
}) {
|
|
13
|
+
const w = o ?? b, s = m({
|
|
14
|
+
slots: {
|
|
15
|
+
listItem: "tw:contents tw:flex-1",
|
|
16
|
+
link: "tw:rounded-t-sm tw:bg-light-grey-bg tw:font-bold tw:hocus-visible:bg-light-grey tw:mb-1 tw:flex tw:items-center tw:justify-center tw:px-4 tw:py-3 tw:text-center tw:text-lg tw:text-black tw:transition-colors tw:focus:outline-none tw:flex-1"
|
|
17
|
+
},
|
|
18
|
+
variants: {
|
|
19
|
+
active: {
|
|
20
|
+
true: {
|
|
21
|
+
link: "tw:mb-0 tw:border-2 tw:border-yellow tw:bg-yellow tw:text-yellow-contrast tw:hocus-visible:bg-yellow"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}), { listItem: a, link: c } = s({ active: t });
|
|
26
|
+
return /* @__PURE__ */ e("li", { className: a(), children: /* @__PURE__ */ e(
|
|
27
|
+
w,
|
|
28
|
+
{
|
|
29
|
+
...r,
|
|
30
|
+
href: n,
|
|
31
|
+
className: `uofg-navigation-link ${g(c(), l)}`,
|
|
32
|
+
"aria-current": t ? "page" : void 0,
|
|
33
|
+
children: i
|
|
34
|
+
}
|
|
35
|
+
) });
|
|
36
|
+
}
|
|
37
|
+
f.displayName = "NavigationLink";
|
|
38
|
+
export {
|
|
39
|
+
f as NavigationLink
|
|
40
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { ElementType } from 'react';
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
import { PropsWithChildren } from 'react';
|
|
5
|
+
|
|
6
|
+
declare const defaultElement = "a";
|
|
7
|
+
|
|
8
|
+
export declare function Navigation({ className, children }: NavigationProps): JSX.Element;
|
|
9
|
+
|
|
10
|
+
export declare namespace Navigation {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export declare function NavigationLink<T extends NavigationLinkElementType = typeof defaultElement>({ as, active, href, children, className, ...rest }: NavigationLinkProps<T>): JSX.Element;
|
|
15
|
+
|
|
16
|
+
export declare namespace NavigationLink {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare type NavigationLinkElementType = ElementType<{
|
|
21
|
+
href?: string;
|
|
22
|
+
}, 'a'>;
|
|
23
|
+
|
|
24
|
+
declare type NavigationLinkProps<T extends NavigationLinkElementType = typeof defaultElement> = PropsWithChildren<{
|
|
25
|
+
/** The element to render the link as */
|
|
26
|
+
as?: T;
|
|
27
|
+
/** If true, the link will be styled as active */
|
|
28
|
+
active?: boolean;
|
|
29
|
+
/** The href of the link */
|
|
30
|
+
href: string;
|
|
31
|
+
/** Additional classes to add the link */
|
|
32
|
+
className?: string;
|
|
33
|
+
} & ComponentPropsWithoutRef<T>>;
|
|
34
|
+
|
|
35
|
+
export declare type NavigationProps = PropsWithChildren<{
|
|
36
|
+
/** Additional classes to add the navigation */
|
|
37
|
+
className?: string;
|
|
38
|
+
}>;
|
|
39
|
+
|
|
40
|
+
export { }
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { twMerge as e } from "tailwind-merge";
|
|
3
|
+
import { NavigationLink as s } from "./navigation-link.js";
|
|
4
|
+
function n({ className: o, children: a }) {
|
|
5
|
+
const i = e(
|
|
6
|
+
"tw:md:flex-row tw:flex tw:flex-col tw:gap-1 tw:border-b-4 tw:border-yellow tw:w-full",
|
|
7
|
+
o
|
|
8
|
+
);
|
|
9
|
+
return /* @__PURE__ */ t("nav", { className: "uofg-navigation tw:contents", children: /* @__PURE__ */ t("ul", { className: `uofg-navigation-list ${i}`, children: a }) });
|
|
10
|
+
}
|
|
11
|
+
n.displayName = "Navigation";
|
|
12
|
+
export {
|
|
13
|
+
n as Navigation,
|
|
14
|
+
s as NavigationLink
|
|
15
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
export declare function Radio<T>({ selected, children, value }: RadioProps<T>): JSX.Element;
|
|
5
|
+
|
|
6
|
+
export declare function RadioGroup<T>({ name, inline, onChange, children }: RadioGroupProps<T>): JSX.Element;
|
|
7
|
+
|
|
8
|
+
export declare namespace RadioGroup {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export declare type RadioGroupProps<T> = PropsWithChildren<{
|
|
13
|
+
/** The name of the radio group. This is used for when the radio group is part of a form. */
|
|
14
|
+
name?: string;
|
|
15
|
+
/** Whether the radios should be displayed inline or not. */
|
|
16
|
+
inline?: boolean;
|
|
17
|
+
/** The callback to call when the selected radio changes. */
|
|
18
|
+
onChange?: (value: T | null) => void;
|
|
19
|
+
}>;
|
|
20
|
+
|
|
21
|
+
declare type RadioProps<T> = PropsWithChildren<{
|
|
22
|
+
/** Whether the radio is selected or not initially. */
|
|
23
|
+
selected?: boolean;
|
|
24
|
+
/** The value of the radio. */
|
|
25
|
+
value: T;
|
|
26
|
+
}>;
|
|
27
|
+
|
|
28
|
+
export { }
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { RadioGroup as c } from "@headlessui/react";
|
|
3
|
+
import { useState as f, useMemo as u } from "react";
|
|
4
|
+
import { tv as n } from "tailwind-variants";
|
|
5
|
+
import { RadioContext as x } from "./radio-context.js";
|
|
6
|
+
import { Radio as y } from "./radio.js";
|
|
7
|
+
function R({ name: s, inline: a = !1, onChange: o, children: i }) {
|
|
8
|
+
const [l, t] = f(null), m = u(() => ({ setSelected: t }), [t]), p = n({
|
|
9
|
+
slots: {
|
|
10
|
+
base: "tw:flex tw:gap-2"
|
|
11
|
+
},
|
|
12
|
+
variants: {
|
|
13
|
+
inline: {
|
|
14
|
+
false: {
|
|
15
|
+
base: "tw:flex-col"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}), { base: d } = p({ inline: a });
|
|
20
|
+
return /* @__PURE__ */ r(
|
|
21
|
+
c,
|
|
22
|
+
{
|
|
23
|
+
name: s,
|
|
24
|
+
value: l,
|
|
25
|
+
onChange: (e) => {
|
|
26
|
+
t(e), o == null || o(e);
|
|
27
|
+
},
|
|
28
|
+
className: d(),
|
|
29
|
+
children: /* @__PURE__ */ r(x.Provider, { value: m, children: i })
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
R.displayName = "RadioGroup";
|
|
34
|
+
export {
|
|
35
|
+
y as Radio,
|
|
36
|
+
R as RadioGroup
|
|
37
|
+
};
|
package/dist/radio.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
export declare function Radio<T>({ selected, children, value }: RadioProps<T>): JSX.Element;
|
|
5
|
+
|
|
6
|
+
export declare type RadioProps<T> = PropsWithChildren<{
|
|
7
|
+
/** Whether the radio is selected or not initially. */
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
/** The value of the radio. */
|
|
10
|
+
value: T;
|
|
11
|
+
}>;
|
|
12
|
+
|
|
13
|
+
export { }
|
package/dist/radio.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Field as w, Radio as f, Label as m } from "@headlessui/react";
|
|
3
|
+
import { useContext as b, useEffect as u, Fragment as p } from "react";
|
|
4
|
+
import { tv as g } from "tailwind-variants";
|
|
5
|
+
import { RadioContext as h } from "./radio-context.js";
|
|
6
|
+
function j({ selected: i, children: s, value: r }) {
|
|
7
|
+
const t = b(h);
|
|
8
|
+
u(() => {
|
|
9
|
+
i && (t == null || t.setSelected(r));
|
|
10
|
+
}, [t, i, r]);
|
|
11
|
+
const a = g({
|
|
12
|
+
slots: {
|
|
13
|
+
field: "tw:flex tw:items-center tw:gap-2",
|
|
14
|
+
radio: "tw:block tw:aspect-square tw:rounded-full tw:border tw:border-blue tw:p-1.5 tw:focus-visible:ring-2 tw:focus-visible:ring-blue tw:focus-visible:ring-offset-2",
|
|
15
|
+
circle: "tw:block tw:h-2 tw:w-2 tw:rounded-full"
|
|
16
|
+
},
|
|
17
|
+
variants: {
|
|
18
|
+
checked: {
|
|
19
|
+
true: {
|
|
20
|
+
radio: "tw:bg-blue",
|
|
21
|
+
circle: "tw:bg-white"
|
|
22
|
+
},
|
|
23
|
+
false: {
|
|
24
|
+
circle: "tw:bg-transparent"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}), { field: l, radio: c, circle: n } = a();
|
|
29
|
+
return /* @__PURE__ */ d(w, { className: l(), children: [
|
|
30
|
+
/* @__PURE__ */ e(f, { value: r, as: p, children: ({ checked: o }) => /* @__PURE__ */ e("span", { className: c({ checked: o }), children: /* @__PURE__ */ e("span", { className: n({ checked: o }) }) }) }),
|
|
31
|
+
/* @__PURE__ */ e(m, { children: s })
|
|
32
|
+
] });
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
j as Radio
|
|
36
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
var a = {
|
|
2
|
+
prefix: "far",
|
|
3
|
+
iconName: "check",
|
|
4
|
+
icon: [
|
|
5
|
+
448,
|
|
6
|
+
512,
|
|
7
|
+
[10003, 10004],
|
|
8
|
+
"f00c",
|
|
9
|
+
"M441 103c9.4 9.4 9.4 24.6 0 33.9L177 401c-9.4 9.4-24.6 9.4-33.9 0L7 265c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l119 119L407 103c9.4-9.4 24.6-9.4 33.9 0z"
|
|
10
|
+
]
|
|
11
|
+
}, e = {
|
|
12
|
+
prefix: "far",
|
|
13
|
+
iconName: "circle-plus",
|
|
14
|
+
icon: [
|
|
15
|
+
512,
|
|
16
|
+
512,
|
|
17
|
+
["plus-circle"],
|
|
18
|
+
"f055",
|
|
19
|
+
"M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM232 344c0 13.3 10.7 24 24 24s24-10.7 24-24l0-64 64 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-64 0 0-64c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 64-64 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l64 0 0 64z"
|
|
20
|
+
]
|
|
21
|
+
}, l = {
|
|
22
|
+
prefix: "far",
|
|
23
|
+
iconName: "spinner",
|
|
24
|
+
icon: [
|
|
25
|
+
512,
|
|
26
|
+
512,
|
|
27
|
+
[],
|
|
28
|
+
"f110",
|
|
29
|
+
"M288 32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0 448a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM448 256a32 32 0 1 0 64 0 32 32 0 1 0 -64 0zM32 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM75 437a32 32 0 1 0 45.3-45.3A32 32 0 1 0 75 437zm316.8 0A32 32 0 1 0 437 391.8 32 32 0 1 0 391.8 437zM75 75a32 32 0 1 0 45.3 45.3A32 32 0 1 0 75 75z"
|
|
30
|
+
]
|
|
31
|
+
}, i = {
|
|
32
|
+
prefix: "far",
|
|
33
|
+
iconName: "chevron-right",
|
|
34
|
+
icon: [
|
|
35
|
+
320,
|
|
36
|
+
512,
|
|
37
|
+
[9002],
|
|
38
|
+
"f054",
|
|
39
|
+
"M305 239c9.4 9.4 9.4 24.6 0 33.9L113 465c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l175-175L79 81c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0L305 239z"
|
|
40
|
+
]
|
|
41
|
+
}, c = {
|
|
42
|
+
prefix: "far",
|
|
43
|
+
iconName: "house",
|
|
44
|
+
icon: [
|
|
45
|
+
576,
|
|
46
|
+
512,
|
|
47
|
+
[63498, 63500, 127968, "home", "home-alt", "home-lg-alt"],
|
|
48
|
+
"f015",
|
|
49
|
+
"M303.5 5.7c-9-7.6-22.1-7.6-31.1 0l-264 224c-10.1 8.6-11.3 23.7-2.8 33.8s23.7 11.3 33.8 2.8L64 245.5 64 432c0 44.2 35.8 80 80 80l288 0c44.2 0 80-35.8 80-80l0-186.5 24.5 20.8c10.1 8.6 25.3 7.3 33.8-2.8s7.3-25.3-2.8-33.8l-264-224zM112 432l0-227.2L288 55.5 464 204.8 464 432c0 17.7-14.3 32-32 32l-48 0 0-152c0-22.1-17.9-40-40-40l-112 0c-22.1 0-40 17.9-40 40l0 152-48 0c-17.7 0-32-14.3-32-32zm128 32l0-144 96 0 0 144-96 0z"
|
|
50
|
+
]
|
|
51
|
+
}, r = c, f = {
|
|
52
|
+
prefix: "far",
|
|
53
|
+
iconName: "envelope",
|
|
54
|
+
icon: [
|
|
55
|
+
512,
|
|
56
|
+
512,
|
|
57
|
+
[9993, 61443, 128386],
|
|
58
|
+
"f0e0",
|
|
59
|
+
"M64 112c-8.8 0-16 7.2-16 16l0 22.1L220.5 291.7c20.7 17 50.4 17 71.1 0L464 150.1l0-22.1c0-8.8-7.2-16-16-16L64 112zM48 212.2L48 384c0 8.8 7.2 16 16 16l384 0c8.8 0 16-7.2 16-16l0-171.8L322 328.8c-38.4 31.5-93.7 31.5-132 0L48 212.2zM0 128C0 92.7 28.7 64 64 64l384 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L64 448c-35.3 0-64-28.7-64-64L0 128z"
|
|
60
|
+
]
|
|
61
|
+
}, n = {
|
|
62
|
+
prefix: "far",
|
|
63
|
+
iconName: "circle-exclamation",
|
|
64
|
+
icon: [
|
|
65
|
+
512,
|
|
66
|
+
512,
|
|
67
|
+
["exclamation-circle"],
|
|
68
|
+
"f06a",
|
|
69
|
+
"M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"
|
|
70
|
+
]
|
|
71
|
+
}, o = {
|
|
72
|
+
prefix: "far",
|
|
73
|
+
iconName: "circle-minus",
|
|
74
|
+
icon: [
|
|
75
|
+
512,
|
|
76
|
+
512,
|
|
77
|
+
["minus-circle"],
|
|
78
|
+
"f056",
|
|
79
|
+
"M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM184 232c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z"
|
|
80
|
+
]
|
|
81
|
+
};
|
|
82
|
+
export {
|
|
83
|
+
e as a,
|
|
84
|
+
n as b,
|
|
85
|
+
r as c,
|
|
86
|
+
i as d,
|
|
87
|
+
a as e,
|
|
88
|
+
o as f,
|
|
89
|
+
f as g,
|
|
90
|
+
l as h
|
|
91
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
var a = {
|
|
2
|
+
prefix: "fas",
|
|
3
|
+
iconName: "chevron-right",
|
|
4
|
+
icon: [
|
|
5
|
+
320,
|
|
6
|
+
512,
|
|
7
|
+
[9002],
|
|
8
|
+
"f054",
|
|
9
|
+
"M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"
|
|
10
|
+
]
|
|
11
|
+
}, l = {
|
|
12
|
+
prefix: "fas",
|
|
13
|
+
iconName: "chevron-left",
|
|
14
|
+
icon: [
|
|
15
|
+
320,
|
|
16
|
+
512,
|
|
17
|
+
[9001],
|
|
18
|
+
"f053",
|
|
19
|
+
"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"
|
|
20
|
+
]
|
|
21
|
+
}, e = {
|
|
22
|
+
prefix: "fas",
|
|
23
|
+
iconName: "quote-left",
|
|
24
|
+
icon: [
|
|
25
|
+
448,
|
|
26
|
+
512,
|
|
27
|
+
[8220, "quote-left-alt"],
|
|
28
|
+
"f10d",
|
|
29
|
+
"M0 216C0 149.7 53.7 96 120 96l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-30.9 0-56 25.1-56 56l0 8 64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64l0-32 0-32 0-72zm256 0c0-66.3 53.7-120 120-120l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-30.9 0-56 25.1-56 56l0 8 64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64l0-32 0-32 0-72z"
|
|
30
|
+
]
|
|
31
|
+
}, c = {
|
|
32
|
+
prefix: "fas",
|
|
33
|
+
iconName: "xmark",
|
|
34
|
+
icon: [
|
|
35
|
+
384,
|
|
36
|
+
512,
|
|
37
|
+
[215, 10005, 10006, 10060, 128473, "close", "multiply", "remove", "times"],
|
|
38
|
+
"f00d",
|
|
39
|
+
"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"
|
|
40
|
+
]
|
|
41
|
+
}, f = c, s = {
|
|
42
|
+
prefix: "fas",
|
|
43
|
+
iconName: "play",
|
|
44
|
+
icon: [
|
|
45
|
+
384,
|
|
46
|
+
512,
|
|
47
|
+
[9654],
|
|
48
|
+
"f04b",
|
|
49
|
+
"M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80L0 432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"
|
|
50
|
+
]
|
|
51
|
+
}, i = {
|
|
52
|
+
prefix: "fas",
|
|
53
|
+
iconName: "quote-right",
|
|
54
|
+
icon: [
|
|
55
|
+
448,
|
|
56
|
+
512,
|
|
57
|
+
[8221, "quote-right-alt"],
|
|
58
|
+
"f10e",
|
|
59
|
+
"M448 296c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72zm-256 0c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72z"
|
|
60
|
+
]
|
|
61
|
+
}, o = {
|
|
62
|
+
prefix: "fas",
|
|
63
|
+
iconName: "phone",
|
|
64
|
+
icon: [
|
|
65
|
+
512,
|
|
66
|
+
512,
|
|
67
|
+
[128222, 128379],
|
|
68
|
+
"f095",
|
|
69
|
+
"M164.9 24.6c-7.7-18.6-28-28.5-47.4-23.2l-88 24C12.1 30.2 0 46 0 64C0 311.4 200.6 512 448 512c18 0 33.8-12.1 38.6-29.5l24-88c5.3-19.4-4.6-39.7-23.2-47.4l-96-40c-16.3-6.8-35.2-2.1-46.3 11.6L304.7 368C234.3 334.7 177.3 277.7 144 207.3L193.3 167c13.7-11.2 18.4-30 11.6-46.3l-40-96z"
|
|
70
|
+
]
|
|
71
|
+
};
|
|
72
|
+
export {
|
|
73
|
+
i as a,
|
|
74
|
+
l as b,
|
|
75
|
+
a as c,
|
|
76
|
+
o as d,
|
|
77
|
+
s as e,
|
|
78
|
+
e as f,
|
|
79
|
+
f as g
|
|
80
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { JSX } from 'react/jsx-runtime';
|
|
3
|
+
import { PropsWithChildren } from 'react';
|
|
4
|
+
|
|
5
|
+
declare const defaultElement = "span";
|
|
6
|
+
|
|
7
|
+
/** The Typography component is a typographic component used to display headings or blocks of text. */
|
|
8
|
+
export declare function Typography<T extends TypographyElementType = typeof defaultElement>({ type, children, className, as, ...rest }: TypographyProps<T>): JSX.Element;
|
|
9
|
+
|
|
10
|
+
export declare namespace Typography {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export declare type TypographyElementType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span' | 'p';
|
|
15
|
+
|
|
16
|
+
export declare type TypographyProps<T extends TypographyElementType = typeof defaultElement> = PropsWithChildren<{
|
|
17
|
+
/**
|
|
18
|
+
* The element to render the text as.
|
|
19
|
+
*
|
|
20
|
+
* @default 'span'
|
|
21
|
+
*/
|
|
22
|
+
as?: T;
|
|
23
|
+
/** The text style */
|
|
24
|
+
type: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body';
|
|
25
|
+
/** Additional classes to apply to the text. */
|
|
26
|
+
className?: string;
|
|
27
|
+
} & ComponentPropsWithoutRef<T>>;
|
|
28
|
+
|
|
29
|
+
export { }
|