@bccampus/ui-components 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/banner.d.ts +16 -0
- package/dist/banner.js +42 -0
- package/dist/button.d.ts +5 -4
- package/dist/button.js +20 -14
- package/dist/caption.js +9 -8
- package/dist/card.d.ts +15 -9
- package/dist/card.js +62 -84
- package/dist/createLucideIcon-CzehbSja.js +94 -0
- package/dist/horizontal-list.d.ts +9 -2
- package/dist/horizontal-list.js +47 -115
- package/dist/icon-generator.d.ts +2 -1
- package/dist/icon-generator.js +180 -147
- package/dist/index-CQhYMnjT.js +34 -0
- package/dist/index-DlfV3JTY.js +70 -0
- package/dist/input.d.ts +7 -0
- package/dist/input.js +18 -0
- package/dist/masked-image-generator.d.ts +1 -0
- package/dist/overlay.d.ts +13 -0
- package/dist/overlay.js +27 -0
- package/dist/page-header.d.ts +5 -0
- package/dist/page-header.js +943 -0
- package/dist/page-section.d.ts +14 -0
- package/dist/page-section.js +31 -0
- package/dist/page.d.ts +7 -0
- package/dist/page.js +8 -0
- package/dist/search-input.d.ts +7 -0
- package/dist/search-input.js +23 -0
- package/dist/tag.d.ts +2 -2
- package/dist/tag.js +10 -9
- package/dist/ui-components.d.ts +84 -29
- package/dist/ui-components.js +42 -27
- package/package.json +44 -15
- package/src/assets/images/image_06.jpg +0 -0
- package/src/components/ui/banner.tsx +48 -0
- package/src/components/ui/button.tsx +52 -47
- package/src/components/ui/card.tsx +131 -147
- package/src/components/ui/horizontal-list.tsx +75 -50
- package/src/components/ui/icon-generator/generate-tiles.tsx +243 -243
- package/src/components/ui/icon-generator/icon-generator.tsx +84 -51
- package/src/components/ui/icon-generator/masked-image-generator.tsx +38 -38
- package/src/components/ui/icon-generator/types.ts +53 -52
- package/src/components/ui/index.ts +11 -4
- package/src/components/ui/input.tsx +17 -0
- package/src/components/ui/overlay.tsx +29 -0
- package/src/components/ui/page-header.tsx +16 -0
- package/src/components/ui/page-section.tsx +33 -0
- package/src/components/ui/page.tsx +9 -0
- package/src/components/ui/search-input.tsx +16 -0
- package/src/components/ui/tag.tsx +39 -39
- package/src/components/ui/typography/caption.tsx +32 -32
- package/src/styles/all.css +4 -4
- package/src/styles/colors.css +9 -10
- package/src/styles/index.css +7 -7
- package/src/styles/theme.css +56 -2
- package/src/styles/typography.css +480 -479
- package/tsconfig.app.json +37 -37
- package/vite.config.ts +51 -44
- package/dist/@bccampus-ui-components-0.1.0.tgz +0 -0
- package/dist/index-DcqAdr0d.js +0 -102
- package/dist/mockServiceWorker.js +0 -348
- package/public/mockServiceWorker.js +0 -348
- 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
|
@@ -1,147 +1,131 @@
|
|
|
1
|
-
import { cn } from "@/lib/utils";
|
|
2
|
-
import { Caption } from "./typography/caption";
|
|
3
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
|
-
|
|
5
|
-
const cardVariants = cva("group @container/card
|
|
6
|
-
variants: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
true: "",
|
|
13
|
-
false: "
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
defaultVariants: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
type CardProps<T extends boolean> = (T extends true ? React.ComponentProps<"a"> : React.ComponentProps<"div">) &
|
|
23
|
-
VariantProps<typeof cardVariants> & {
|
|
24
|
-
asLink?: T;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
function Card<T extends boolean = false>({ className, asLink,
|
|
28
|
-
const Comp = asLink ? "a" : "div";
|
|
29
|
-
|
|
30
|
-
const linkClassName = asLink ? "transition-all hover:bg-complement-1-50 dark:hover:
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
//@ts-expect-error: props type will be correct
|
|
34
|
-
<Comp data-slot="card" className={cn(cardVariants({
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export {
|
|
136
|
-
Card,
|
|
137
|
-
CardHeader,
|
|
138
|
-
CardBody,
|
|
139
|
-
CardFooter,
|
|
140
|
-
CardTitle,
|
|
141
|
-
CardSubtitle,
|
|
142
|
-
CardCaption,
|
|
143
|
-
CardMeta,
|
|
144
|
-
CardContent,
|
|
145
|
-
CardMedia,
|
|
146
|
-
CardImage,
|
|
147
|
-
};
|
|
1
|
+
import { cn } from "@/lib/utils";
|
|
2
|
+
import { Caption } from "./typography/caption";
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
|
+
|
|
5
|
+
const cardVariants = cva("group @container/card w-full max-w-full bg-card text-card-foreground grid gap-card", {
|
|
6
|
+
variants: {
|
|
7
|
+
bordered: {
|
|
8
|
+
true: "p-card border border-complement-1-100 dark:border-brand-1-900 ",
|
|
9
|
+
false: "",
|
|
10
|
+
},
|
|
11
|
+
rounded: {
|
|
12
|
+
true: "rounded-2xl",
|
|
13
|
+
false: "",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
bordered: false,
|
|
18
|
+
rounded: false,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export type CardProps<T extends boolean> = (T extends true ? React.ComponentProps<"a"> : React.ComponentProps<"div">) &
|
|
23
|
+
VariantProps<typeof cardVariants> & {
|
|
24
|
+
asLink?: T;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
function Card<T extends boolean = false>({ className, asLink, bordered, rounded, ...props }: CardProps<T>) {
|
|
28
|
+
const Comp = asLink ? "a" : "div";
|
|
29
|
+
|
|
30
|
+
const linkClassName = asLink ? "transition-all hover:bg-complement-1-50 dark:hover:bg-gray-900" : "";
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
//@ts-expect-error: props type will be correct
|
|
34
|
+
<Comp data-slot="card" className={cn(cardVariants({ bordered, rounded }), linkClassName, className)} {...props} />
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type CardAreaProps = React.ComponentProps<"div"> & { name: string };
|
|
39
|
+
function CardArea({ name, className, ...props }: CardAreaProps) {
|
|
40
|
+
return (
|
|
41
|
+
<div
|
|
42
|
+
style={{ gridArea: name }}
|
|
43
|
+
className={cn("relative flex flex-col gap-(--card-area-gap)", className)}
|
|
44
|
+
{...props}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function CardItemGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
50
|
+
return <div className={cn("flex flex-col gap-(--card-item-group-gap)", className)} {...props} />;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
type CardTitleProps = React.ComponentProps<"div"> & { size?: "sm" | "md" | "lg" };
|
|
54
|
+
function CardTitle({ size = "md", className, ...props }: CardTitleProps) {
|
|
55
|
+
return (
|
|
56
|
+
<div
|
|
57
|
+
className={cn(
|
|
58
|
+
{
|
|
59
|
+
"heading-1": size === "lg",
|
|
60
|
+
"heading-2": size === "md",
|
|
61
|
+
"heading-3": size === "sm",
|
|
62
|
+
},
|
|
63
|
+
className
|
|
64
|
+
)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
function CardSubtitle({ size = "md", className, ...props }: CardTitleProps) {
|
|
70
|
+
return (
|
|
71
|
+
<div
|
|
72
|
+
className={cn(
|
|
73
|
+
"text-secondary",
|
|
74
|
+
{
|
|
75
|
+
"heading-1": size === "lg",
|
|
76
|
+
"heading-2": size === "md",
|
|
77
|
+
"heading-3": size === "sm",
|
|
78
|
+
},
|
|
79
|
+
className
|
|
80
|
+
)}
|
|
81
|
+
{...props}
|
|
82
|
+
/>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function CardCaption(props: React.ComponentProps<"div">) {
|
|
87
|
+
return <Caption {...props} />;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function CardSubcaption(props: React.ComponentProps<"div">) {
|
|
91
|
+
return <Caption variant="light" {...props} />;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function CardMeta(props: React.ComponentProps<"div">) {
|
|
95
|
+
return <Caption variant="light" {...props} />;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function CardContent(props: React.ComponentProps<"div">) {
|
|
99
|
+
return <div {...props} />;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function CardToolbar({ className, ...props }: React.ComponentProps<"div">) {
|
|
103
|
+
return <div className={cn("flex flex-wrap items-center gap-(--card-item-group-gap)", className)} {...props} />;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function CardMedia({ className, ...props }: React.ComponentProps<"div">) {
|
|
107
|
+
return <div className={cn("relative w-full h-full", className)} {...props} />;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function CardImage({ className, ...props }: React.ComponentProps<"img">) {
|
|
111
|
+
return (
|
|
112
|
+
<CardMedia>
|
|
113
|
+
<img className={cn("w-full h-full rounded-lg aspect-9/5 object-cover object-top", className)} {...props} />
|
|
114
|
+
</CardMedia>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export {
|
|
119
|
+
Card,
|
|
120
|
+
CardArea,
|
|
121
|
+
CardItemGroup,
|
|
122
|
+
CardToolbar,
|
|
123
|
+
CardTitle,
|
|
124
|
+
CardSubtitle,
|
|
125
|
+
CardCaption,
|
|
126
|
+
CardSubcaption,
|
|
127
|
+
CardMeta,
|
|
128
|
+
CardContent,
|
|
129
|
+
CardMedia,
|
|
130
|
+
CardImage,
|
|
131
|
+
};
|
|
@@ -1,50 +1,75 @@
|
|
|
1
|
-
import { cn } from "@/lib/utils";
|
|
2
|
-
import { Button } from "./button";
|
|
3
|
-
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
4
|
-
import { useCallback, useRef } from "react";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
import { cn } from "@/lib/utils";
|
|
2
|
+
import { Button } from "./button";
|
|
3
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
4
|
+
import { useCallback, useRef } from "react";
|
|
5
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
6
|
+
|
|
7
|
+
const horizontalListVariants = cva(
|
|
8
|
+
"scrollbar-hidden overscroll-x-contain flex flex-row flex-nowrap py-1 gap-card overflow-x-auto snap-x snap-mandatory touch-pan-x scroll-smooth *:shrink-0 *:grow-0 *:snap-center *:select-none",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
contain: "w-full ",
|
|
13
|
+
overflow: "w-screen px-section -ms-section scroll-px-(--section-p)",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: "contain",
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export interface HorizontalListProps extends VariantProps<typeof horizontalListVariants>, React.ComponentProps<"div"> {
|
|
23
|
+
toolbarLocation?: "bottom" | "top";
|
|
24
|
+
scrollBy?: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function HorizontalList({
|
|
28
|
+
variant,
|
|
29
|
+
className,
|
|
30
|
+
children,
|
|
31
|
+
toolbarLocation = "bottom",
|
|
32
|
+
scrollBy = 360,
|
|
33
|
+
...props
|
|
34
|
+
}: HorizontalListProps) {
|
|
35
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
36
|
+
|
|
37
|
+
const scrollLeft = useCallback(() => {
|
|
38
|
+
containerRef.current?.scrollBy({ left: -scrollBy });
|
|
39
|
+
}, [scrollBy]);
|
|
40
|
+
|
|
41
|
+
const scrollRight = useCallback(() => {
|
|
42
|
+
containerRef.current?.scrollBy({ left: scrollBy });
|
|
43
|
+
}, [scrollBy]);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<div
|
|
47
|
+
className={cn("flex gap-4", {
|
|
48
|
+
"flex-col": toolbarLocation === "bottom",
|
|
49
|
+
"flex-col-reverse": toolbarLocation === "top",
|
|
50
|
+
})}
|
|
51
|
+
>
|
|
52
|
+
<div
|
|
53
|
+
ref={containerRef}
|
|
54
|
+
className={cn(
|
|
55
|
+
horizontalListVariants({ variant }),
|
|
56
|
+
|
|
57
|
+
className
|
|
58
|
+
)}
|
|
59
|
+
{...props}
|
|
60
|
+
>
|
|
61
|
+
{children}
|
|
62
|
+
</div>
|
|
63
|
+
<div className="flex justify-center sm:justify-start">
|
|
64
|
+
<Button size="icon" variant="ghost" className="rounded-full" onClick={scrollLeft}>
|
|
65
|
+
<ChevronLeft className="size-9" />
|
|
66
|
+
</Button>
|
|
67
|
+
<Button size="icon" variant="ghost" className="rounded-full" onClick={scrollRight}>
|
|
68
|
+
<ChevronRight className="size-9" />
|
|
69
|
+
</Button>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { HorizontalList };
|