@bccampus/ui-components 0.5.5 → 0.5.7
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/components/ui/card.d.ts +9 -6
- package/dist/components/ui/card.js +22 -15
- package/dist/components/ui/overlay.d.ts +2 -1
- package/dist/components/ui/overlay.js +56 -4
- package/package.json +2 -2
- package/src/components/ui/card.tsx +26 -15
- package/src/components/ui/overlay.tsx +55 -3
- package/src/styles/typography.css +35 -15
|
@@ -17,11 +17,14 @@ type CardTitleProps = React.ComponentProps<"div"> & {
|
|
|
17
17
|
};
|
|
18
18
|
declare function CardTitle({ size, className, ...props }: CardTitleProps): import("react").JSX.Element;
|
|
19
19
|
declare function CardSubtitle({ size, className, ...props }: CardTitleProps): import("react").JSX.Element;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
declare function
|
|
24
|
-
declare function
|
|
25
|
-
declare function
|
|
20
|
+
export type CardChildProps = React.ComponentProps<"div"> & {
|
|
21
|
+
asChild?: boolean;
|
|
22
|
+
};
|
|
23
|
+
declare function CardCaption({ asChild, ...props }: CardChildProps): import("react").JSX.Element;
|
|
24
|
+
declare function CardSubcaption({ asChild, ...props }: CardChildProps): import("react").JSX.Element;
|
|
25
|
+
declare function CardMeta({ asChild, ...props }: CardChildProps): import("react").JSX.Element;
|
|
26
|
+
declare function CardContent({ asChild, ...props }: CardChildProps): import("react").JSX.Element;
|
|
27
|
+
declare function CardToolbar({ className, asChild, ...props }: CardChildProps): import("react").JSX.Element;
|
|
28
|
+
declare function CardMedia({ className, asChild, ...props }: CardChildProps): import("react").JSX.Element;
|
|
26
29
|
declare function CardImage({ className, ...props }: React.ComponentProps<"img">): import("react").JSX.Element;
|
|
27
30
|
export { Card, CardArea, CardItemGroup, CardToolbar, CardTitle, CardSubtitle, CardCaption, CardSubcaption, CardMeta, CardContent, CardMedia, CardImage, };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { S as Slot } from "../../_chunks/index.js";
|
|
2
3
|
import { c as cn } from "../../_chunks/utils.js";
|
|
3
4
|
import { Caption } from "./typography/caption.js";
|
|
4
5
|
import { c as cva } from "../../_chunks/index2.js";
|
|
@@ -62,9 +63,9 @@ function CardSubtitle({ size = "md", className, ...props }) {
|
|
|
62
63
|
className: cn(
|
|
63
64
|
"text-secondary",
|
|
64
65
|
{
|
|
65
|
-
"heading-
|
|
66
|
-
"heading-
|
|
67
|
-
"
|
|
66
|
+
"heading-2": size === "lg",
|
|
67
|
+
"heading-3": size === "md",
|
|
68
|
+
"text-base": size === "sm"
|
|
68
69
|
},
|
|
69
70
|
className
|
|
70
71
|
),
|
|
@@ -72,23 +73,29 @@ function CardSubtitle({ size = "md", className, ...props }) {
|
|
|
72
73
|
}
|
|
73
74
|
);
|
|
74
75
|
}
|
|
75
|
-
function CardCaption(props) {
|
|
76
|
-
|
|
76
|
+
function CardCaption({ asChild, ...props }) {
|
|
77
|
+
const Comp = asChild ? Slot : Caption;
|
|
78
|
+
return /* @__PURE__ */ jsx(Comp, { variant: "light", ...props });
|
|
77
79
|
}
|
|
78
|
-
function CardSubcaption(props) {
|
|
79
|
-
|
|
80
|
+
function CardSubcaption({ asChild, ...props }) {
|
|
81
|
+
const Comp = asChild ? Slot : Caption;
|
|
82
|
+
return /* @__PURE__ */ jsx(Comp, { variant: "light", ...props });
|
|
80
83
|
}
|
|
81
|
-
function CardMeta(props) {
|
|
82
|
-
|
|
84
|
+
function CardMeta({ asChild, ...props }) {
|
|
85
|
+
const Comp = asChild ? Slot : Caption;
|
|
86
|
+
return /* @__PURE__ */ jsx(Comp, { variant: "light", ...props });
|
|
83
87
|
}
|
|
84
|
-
function CardContent(props) {
|
|
85
|
-
|
|
88
|
+
function CardContent({ asChild, ...props }) {
|
|
89
|
+
const Comp = asChild ? Slot : "div";
|
|
90
|
+
return /* @__PURE__ */ jsx(Comp, { ...props });
|
|
86
91
|
}
|
|
87
|
-
function CardToolbar({ className, ...props }) {
|
|
88
|
-
|
|
92
|
+
function CardToolbar({ className, asChild, ...props }) {
|
|
93
|
+
const Comp = asChild ? Slot : "div";
|
|
94
|
+
return /* @__PURE__ */ jsx(Comp, { className: cn("flex flex-wrap items-center gap-(--gap-card-item-group)", className), ...props });
|
|
89
95
|
}
|
|
90
|
-
function CardMedia({ className, ...props }) {
|
|
91
|
-
|
|
96
|
+
function CardMedia({ className, asChild, ...props }) {
|
|
97
|
+
const Comp = asChild ? Slot : "div";
|
|
98
|
+
return /* @__PURE__ */ jsx(Comp, { className: cn("relative w-full h-full", className), ...props });
|
|
92
99
|
}
|
|
93
100
|
function CardImage({ className, ...props }) {
|
|
94
101
|
return /* @__PURE__ */ jsx(CardMedia, { children: /* @__PURE__ */ jsx("img", { className: cn("w-full h-full rounded-lg aspect-9/5 object-cover object-top", className), ...props }) });
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
declare const overlayVariants: (props?: ({
|
|
3
3
|
position?: "b" | "br" | "tr" | "r" | "t" | "l" | "tl" | "bl" | "c" | null | undefined;
|
|
4
|
+
rounded?: boolean | null | undefined;
|
|
4
5
|
} & import('class-variance-authority/dist/types').ClassProp) | undefined) => string;
|
|
5
6
|
export type OverlayProps = React.ComponentProps<"div"> & VariantProps<typeof overlayVariants>;
|
|
6
|
-
declare function Overlay({ className, position, ...props }: OverlayProps): import("react").JSX.Element;
|
|
7
|
+
declare function Overlay({ className, position, rounded, ...props }: OverlayProps): import("react").JSX.Element;
|
|
7
8
|
export { Overlay };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as cn } from "../../_chunks/utils.js";
|
|
3
3
|
import { c as cva } from "../../_chunks/index2.js";
|
|
4
|
-
const overlayVariants = cva("absolute w-fit h-fit z-1 overflow-hidden p-0
|
|
4
|
+
const overlayVariants = cva("absolute w-fit h-fit z-1 overflow-hidden p-0", {
|
|
5
5
|
variants: {
|
|
6
6
|
position: {
|
|
7
7
|
t: "top-0 left-1/2 -translate-x-1/2",
|
|
@@ -13,14 +13,66 @@ const overlayVariants = cva("absolute w-fit h-fit z-1 overflow-hidden p-0.25", {
|
|
|
13
13
|
bl: "bottom-0 left-0",
|
|
14
14
|
br: "bottom-0 right-0",
|
|
15
15
|
c: "top-1/2 left-1/2 -translate-1/2"
|
|
16
|
+
},
|
|
17
|
+
rounded: {
|
|
18
|
+
true: null,
|
|
19
|
+
false: null
|
|
16
20
|
}
|
|
17
21
|
},
|
|
22
|
+
compoundVariants: [
|
|
23
|
+
{
|
|
24
|
+
position: "tl",
|
|
25
|
+
rounded: true,
|
|
26
|
+
className: "rounded-tl-lg"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
position: "tr",
|
|
30
|
+
rounded: true,
|
|
31
|
+
className: "rounded-tr-lg"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
position: "bl",
|
|
35
|
+
rounded: true,
|
|
36
|
+
className: "rounded-bl-lg"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
position: "br",
|
|
40
|
+
rounded: true,
|
|
41
|
+
className: "rounded-br-lg"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
position: "t",
|
|
45
|
+
rounded: true,
|
|
46
|
+
className: "rounded-b-lg"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
position: "b",
|
|
50
|
+
rounded: true,
|
|
51
|
+
className: "rounded-t-lg"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
position: "l",
|
|
55
|
+
rounded: true,
|
|
56
|
+
className: "rounded-r-lg"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
position: "r",
|
|
60
|
+
rounded: true,
|
|
61
|
+
className: "rounded-l-lg"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
position: "c",
|
|
65
|
+
rounded: true,
|
|
66
|
+
className: "rounded-lg"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
18
69
|
defaultVariants: {
|
|
19
|
-
position: "br"
|
|
70
|
+
position: "br",
|
|
71
|
+
rounded: false
|
|
20
72
|
}
|
|
21
73
|
});
|
|
22
|
-
function Overlay({ className, position, ...props }) {
|
|
23
|
-
return /* @__PURE__ */ jsx("div", { className: cn(overlayVariants({ position }), className), ...props });
|
|
74
|
+
function Overlay({ className, position, rounded, ...props }) {
|
|
75
|
+
return /* @__PURE__ */ jsx("div", { className: cn(overlayVariants({ position, rounded }), className), ...props });
|
|
24
76
|
}
|
|
25
77
|
export {
|
|
26
78
|
Overlay
|
package/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
1
2
|
import { cn } from "@/lib/utils";
|
|
2
3
|
import { Caption } from "./typography/caption";
|
|
3
4
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
@@ -72,9 +73,9 @@ function CardSubtitle({ size = "md", className, ...props }: CardTitleProps) {
|
|
|
72
73
|
className={cn(
|
|
73
74
|
"text-secondary",
|
|
74
75
|
{
|
|
75
|
-
"heading-
|
|
76
|
-
"heading-
|
|
77
|
-
"
|
|
76
|
+
"heading-2": size === "lg",
|
|
77
|
+
"heading-3": size === "md",
|
|
78
|
+
"text-base": size === "sm",
|
|
78
79
|
},
|
|
79
80
|
className
|
|
80
81
|
)}
|
|
@@ -83,28 +84,38 @@ function CardSubtitle({ size = "md", className, ...props }: CardTitleProps) {
|
|
|
83
84
|
);
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
export type CardChildProps = React.ComponentProps<"div"> & {
|
|
88
|
+
asChild?: boolean;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
function CardCaption({ asChild, ...props }: CardChildProps) {
|
|
92
|
+
const Comp = asChild ? Slot : Caption;
|
|
93
|
+
return <Comp variant="light" {...props} />;
|
|
88
94
|
}
|
|
89
95
|
|
|
90
|
-
function CardSubcaption(props:
|
|
91
|
-
|
|
96
|
+
function CardSubcaption({ asChild, ...props }: CardChildProps) {
|
|
97
|
+
const Comp = asChild ? Slot : Caption;
|
|
98
|
+
return <Comp variant="light" {...props} />;
|
|
92
99
|
}
|
|
93
100
|
|
|
94
|
-
function CardMeta(props:
|
|
95
|
-
|
|
101
|
+
function CardMeta({ asChild, ...props }: CardChildProps) {
|
|
102
|
+
const Comp = asChild ? Slot : Caption;
|
|
103
|
+
return <Comp variant="light" {...props} />;
|
|
96
104
|
}
|
|
97
105
|
|
|
98
|
-
function CardContent(props:
|
|
99
|
-
|
|
106
|
+
function CardContent({ asChild, ...props }: CardChildProps) {
|
|
107
|
+
const Comp = asChild ? Slot : "div";
|
|
108
|
+
return <Comp {...props} />;
|
|
100
109
|
}
|
|
101
110
|
|
|
102
|
-
function CardToolbar({ className, ...props }:
|
|
103
|
-
|
|
111
|
+
function CardToolbar({ className, asChild, ...props }: CardChildProps) {
|
|
112
|
+
const Comp = asChild ? Slot : "div";
|
|
113
|
+
return <Comp className={cn("flex flex-wrap items-center gap-(--gap-card-item-group)", className)} {...props} />;
|
|
104
114
|
}
|
|
105
115
|
|
|
106
|
-
function CardMedia({ className, ...props }:
|
|
107
|
-
|
|
116
|
+
function CardMedia({ className, asChild, ...props }: CardChildProps) {
|
|
117
|
+
const Comp = asChild ? Slot : "div";
|
|
118
|
+
return <Comp className={cn("relative w-full h-full", className)} {...props} />;
|
|
108
119
|
}
|
|
109
120
|
|
|
110
121
|
function CardImage({ className, ...props }: React.ComponentProps<"img">) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "@/lib/utils";
|
|
2
2
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
3
|
|
|
4
|
-
const overlayVariants = cva("absolute w-fit h-fit z-1 overflow-hidden p-0
|
|
4
|
+
const overlayVariants = cva("absolute w-fit h-fit z-1 overflow-hidden p-0", {
|
|
5
5
|
variants: {
|
|
6
6
|
position: {
|
|
7
7
|
t: "top-0 left-1/2 -translate-x-1/2",
|
|
@@ -14,16 +14,68 @@ const overlayVariants = cva("absolute w-fit h-fit z-1 overflow-hidden p-0.25", {
|
|
|
14
14
|
br: "bottom-0 right-0",
|
|
15
15
|
c: "top-1/2 left-1/2 -translate-1/2",
|
|
16
16
|
},
|
|
17
|
+
rounded: {
|
|
18
|
+
true: null,
|
|
19
|
+
false: null,
|
|
20
|
+
},
|
|
17
21
|
},
|
|
22
|
+
compoundVariants: [
|
|
23
|
+
{
|
|
24
|
+
position: "tl",
|
|
25
|
+
rounded: true,
|
|
26
|
+
className: "rounded-tl-lg",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
position: "tr",
|
|
30
|
+
rounded: true,
|
|
31
|
+
className: "rounded-tr-lg",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
position: "bl",
|
|
35
|
+
rounded: true,
|
|
36
|
+
className: "rounded-bl-lg",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
position: "br",
|
|
40
|
+
rounded: true,
|
|
41
|
+
className: "rounded-br-lg",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
position: "t",
|
|
45
|
+
rounded: true,
|
|
46
|
+
className: "rounded-b-lg",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
position: "b",
|
|
50
|
+
rounded: true,
|
|
51
|
+
className: "rounded-t-lg",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
position: "l",
|
|
55
|
+
rounded: true,
|
|
56
|
+
className: "rounded-r-lg",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
position: "r",
|
|
60
|
+
rounded: true,
|
|
61
|
+
className: "rounded-l-lg",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
position: "c",
|
|
65
|
+
rounded: true,
|
|
66
|
+
className: "rounded-lg",
|
|
67
|
+
},
|
|
68
|
+
],
|
|
18
69
|
defaultVariants: {
|
|
19
70
|
position: "br",
|
|
71
|
+
rounded: false,
|
|
20
72
|
},
|
|
21
73
|
});
|
|
22
74
|
|
|
23
75
|
export type OverlayProps = React.ComponentProps<"div"> & VariantProps<typeof overlayVariants>;
|
|
24
76
|
|
|
25
|
-
function Overlay({ className, position, ...props }: OverlayProps) {
|
|
26
|
-
return <div className={cn(overlayVariants({ position }), className)} {...props} />;
|
|
77
|
+
function Overlay({ className, position, rounded, ...props }: OverlayProps) {
|
|
78
|
+
return <div className={cn(overlayVariants({ position, rounded }), className)} {...props} />;
|
|
27
79
|
}
|
|
28
80
|
|
|
29
81
|
export { Overlay };
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
color: var(--primary);
|
|
14
14
|
text-wrap: balance;
|
|
15
15
|
letter-spacing: var(--tracking-tight);
|
|
16
|
-
font-weight: var(--font-weight-
|
|
16
|
+
font-weight: var(--font-weight-normal);
|
|
17
17
|
--tw-tracking: var(--tracking-tight);
|
|
18
18
|
line-height: 1.125em;
|
|
19
19
|
}
|
|
@@ -21,21 +21,36 @@
|
|
|
21
21
|
h1,
|
|
22
22
|
.heading-1 {
|
|
23
23
|
font-size: calc(var(--text-base) * 2.5);
|
|
24
|
-
font-weight: var(--font-weight-semibold);
|
|
25
24
|
|
|
26
|
-
@
|
|
25
|
+
@variant lg {
|
|
27
26
|
font-size: calc(var(--text-base) * 5);
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
h2,
|
|
32
31
|
.heading-2 {
|
|
33
|
-
font-size: calc(var(--text-base) *
|
|
32
|
+
font-size: calc(var(--text-base) * 1.875);
|
|
33
|
+
font-weight: var(--font-weight-semibold);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
h2.big,
|
|
37
|
+
.heading-2.big {
|
|
38
|
+
font-size: calc(var(--text-base) * 1.875);
|
|
39
|
+
font-weight: var(--font-weight-semibold);
|
|
40
|
+
|
|
41
|
+
@variant lg {
|
|
42
|
+
font-size: calc(var(--text-base) * 4.75);
|
|
43
|
+
}
|
|
34
44
|
}
|
|
35
45
|
|
|
36
46
|
h3,
|
|
37
47
|
.heading-3 {
|
|
38
|
-
font-size: calc(var(--text-base) * 1.
|
|
48
|
+
font-size: calc(var(--text-base) * 1.25);
|
|
49
|
+
font-weight: var(--font-weight-medium);
|
|
50
|
+
|
|
51
|
+
@variant lg {
|
|
52
|
+
font-size: calc(var(--text-base) * 1.5);
|
|
53
|
+
}
|
|
39
54
|
}
|
|
40
55
|
|
|
41
56
|
p {
|
|
@@ -308,6 +323,12 @@
|
|
|
308
323
|
border-radius: var(--radius-container);
|
|
309
324
|
}
|
|
310
325
|
|
|
326
|
+
table.no-wrap {
|
|
327
|
+
td {
|
|
328
|
+
white-space: nowrap;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
311
332
|
table {
|
|
312
333
|
table-layout: auto;
|
|
313
334
|
position: relative;
|
|
@@ -352,8 +373,8 @@
|
|
|
352
373
|
padding-inline: --spacing(4);
|
|
353
374
|
padding-block: --spacing(2);
|
|
354
375
|
text-align: left;
|
|
355
|
-
vertical-align:
|
|
356
|
-
white-space:
|
|
376
|
+
vertical-align: top;
|
|
377
|
+
white-space: pre-wrap;
|
|
357
378
|
|
|
358
379
|
&[align="center"] {
|
|
359
380
|
text-align: center;
|
|
@@ -399,7 +420,7 @@
|
|
|
399
420
|
}
|
|
400
421
|
|
|
401
422
|
/* Media */
|
|
402
|
-
:is(img, audio, video) {
|
|
423
|
+
:is(img, audio, video, iframe) {
|
|
403
424
|
border-width: 1px;
|
|
404
425
|
border-radius: var(--radius-container);
|
|
405
426
|
overflow: hidden;
|
|
@@ -407,11 +428,12 @@
|
|
|
407
428
|
margin-inline: auto;
|
|
408
429
|
}
|
|
409
430
|
|
|
410
|
-
:is(audio, video)::-webkit-media-controls-enclosure {
|
|
431
|
+
:is(audio, video, iframe)::-webkit-media-controls-enclosure {
|
|
411
432
|
border-radius: 0px;
|
|
412
433
|
}
|
|
413
434
|
|
|
414
|
-
video
|
|
435
|
+
video,
|
|
436
|
+
iframe {
|
|
415
437
|
object-fit: cover;
|
|
416
438
|
}
|
|
417
439
|
|
|
@@ -444,12 +466,12 @@
|
|
|
444
466
|
}
|
|
445
467
|
}
|
|
446
468
|
|
|
447
|
-
:is(img, audio, video, .bordered-enclosure) {
|
|
469
|
+
:is(img, audio, video, iframe, .bordered-enclosure) {
|
|
448
470
|
border-radius: 0;
|
|
449
471
|
border: none;
|
|
450
472
|
}
|
|
451
473
|
|
|
452
|
-
:is(img, video) {
|
|
474
|
+
:is(img, video, iframe) {
|
|
453
475
|
object-fit: contain;
|
|
454
476
|
}
|
|
455
477
|
}
|
|
@@ -461,10 +483,8 @@
|
|
|
461
483
|
h5,
|
|
462
484
|
h6,
|
|
463
485
|
p,
|
|
464
|
-
table,
|
|
465
|
-
figure,
|
|
466
486
|
pre,
|
|
467
|
-
|
|
487
|
+
figure {
|
|
468
488
|
&:not(:first-child) {
|
|
469
489
|
margin-top: --spacing(4);
|
|
470
490
|
}
|