@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.
Files changed (65) hide show
  1. package/dist/banner.d.ts +16 -0
  2. package/dist/banner.js +42 -0
  3. package/dist/button.d.ts +5 -4
  4. package/dist/button.js +20 -14
  5. package/dist/caption.js +9 -8
  6. package/dist/card.d.ts +15 -9
  7. package/dist/card.js +62 -84
  8. package/dist/createLucideIcon-CzehbSja.js +94 -0
  9. package/dist/horizontal-list.d.ts +9 -2
  10. package/dist/horizontal-list.js +47 -115
  11. package/dist/icon-generator.d.ts +2 -1
  12. package/dist/icon-generator.js +180 -147
  13. package/dist/index-CQhYMnjT.js +34 -0
  14. package/dist/index-DlfV3JTY.js +70 -0
  15. package/dist/input.d.ts +7 -0
  16. package/dist/input.js +18 -0
  17. package/dist/masked-image-generator.d.ts +1 -0
  18. package/dist/overlay.d.ts +13 -0
  19. package/dist/overlay.js +27 -0
  20. package/dist/page-header.d.ts +5 -0
  21. package/dist/page-header.js +943 -0
  22. package/dist/page-section.d.ts +14 -0
  23. package/dist/page-section.js +31 -0
  24. package/dist/page.d.ts +7 -0
  25. package/dist/page.js +8 -0
  26. package/dist/search-input.d.ts +7 -0
  27. package/dist/search-input.js +23 -0
  28. package/dist/tag.d.ts +2 -2
  29. package/dist/tag.js +10 -9
  30. package/dist/ui-components.d.ts +84 -29
  31. package/dist/ui-components.js +42 -27
  32. package/package.json +44 -15
  33. package/src/assets/images/image_06.jpg +0 -0
  34. package/src/components/ui/banner.tsx +48 -0
  35. package/src/components/ui/button.tsx +52 -47
  36. package/src/components/ui/card.tsx +131 -147
  37. package/src/components/ui/horizontal-list.tsx +75 -50
  38. package/src/components/ui/icon-generator/generate-tiles.tsx +243 -243
  39. package/src/components/ui/icon-generator/icon-generator.tsx +84 -51
  40. package/src/components/ui/icon-generator/masked-image-generator.tsx +38 -38
  41. package/src/components/ui/icon-generator/types.ts +53 -52
  42. package/src/components/ui/index.ts +11 -4
  43. package/src/components/ui/input.tsx +17 -0
  44. package/src/components/ui/overlay.tsx +29 -0
  45. package/src/components/ui/page-header.tsx +16 -0
  46. package/src/components/ui/page-section.tsx +33 -0
  47. package/src/components/ui/page.tsx +9 -0
  48. package/src/components/ui/search-input.tsx +16 -0
  49. package/src/components/ui/tag.tsx +39 -39
  50. package/src/components/ui/typography/caption.tsx +32 -32
  51. package/src/styles/all.css +4 -4
  52. package/src/styles/colors.css +9 -10
  53. package/src/styles/index.css +7 -7
  54. package/src/styles/theme.css +56 -2
  55. package/src/styles/typography.css +480 -479
  56. package/tsconfig.app.json +37 -37
  57. package/vite.config.ts +51 -44
  58. package/dist/@bccampus-ui-components-0.1.0.tgz +0 -0
  59. package/dist/index-DcqAdr0d.js +0 -102
  60. package/dist/mockServiceWorker.js +0 -348
  61. package/public/mockServiceWorker.js +0 -348
  62. package/src/assets/images/bg_pattern_01.png +0 -0
  63. package/src/assets/images/bg_pattern_02.png +0 -0
  64. package/src/assets/images/bg_pattern_03.png +0 -0
  65. 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 flex flex-col rounded-2xl gap-3", {
6
- variants: {
7
- variant: {
8
- default: "bg-card text-card-foreground",
9
- dark: "bg-card-foreground text-card",
10
- },
11
- noBorder: {
12
- true: "",
13
- false: "border border-complement-1-100 dark:border-complement-1-900",
14
- },
15
- },
16
- defaultVariants: {
17
- variant: "default",
18
- noBorder: false,
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, variant, noBorder, ...props }: CardProps<T>) {
28
- const Comp = asLink ? "a" : "div";
29
-
30
- const linkClassName = asLink ? "transition-all hover:bg-complement-1-50 dark:hover:border-complement-1-950" : "";
31
-
32
- return (
33
- //@ts-expect-error: props type will be correct
34
- <Comp data-slot="card" className={cn(cardVariants({ variant, noBorder }), linkClassName, className)} {...props} />
35
- );
36
- }
37
-
38
- function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
39
- return (
40
- <div
41
- data-slot="card-header"
42
- className={cn("flex flex-col items-start gap-3 px-6 first:pt-6 last:pb-6", className)}
43
- {...props}
44
- />
45
- );
46
- }
47
-
48
- function CardBody({ className, ...props }: React.ComponentProps<"div">) {
49
- return (
50
- <div
51
- data-slot="card-body"
52
- className={cn("flex flex-col items-start gap-3 px-6 first:pt-6 last:pb-6", className)}
53
- {...props}
54
- />
55
- );
56
- }
57
-
58
- type CardTitleProps = React.ComponentProps<"div"> & { size?: "sm" | "md" | "lg" };
59
- function CardTitle({ size = "md", className, ...props }: CardTitleProps) {
60
- return (
61
- <div
62
- data-slot="card-title"
63
- className={cn(
64
- {
65
- "heading-1": size === "lg",
66
- "heading-2": size === "md",
67
- "heading-3": size === "sm",
68
- },
69
- className
70
- )}
71
- {...props}
72
- />
73
- );
74
- }
75
- function CardSubtitle({ size = "md", className, ...props }: CardTitleProps) {
76
- return (
77
- <div
78
- data-slot="card-title"
79
- className={cn(
80
- "text-secondary",
81
- {
82
- "heading-1": size === "lg",
83
- "heading-2": size === "md",
84
- "heading-3": size === "sm",
85
- },
86
- className
87
- )}
88
- {...props}
89
- />
90
- );
91
- }
92
- function CardCaption(props: React.ComponentProps<"div">) {
93
- return <Caption data-slot="card-caption" {...props} />;
94
- }
95
-
96
- function CardMeta(props: React.ComponentProps<"div">) {
97
- return <Caption data-slot="card-meta" variant="light" {...props} />;
98
- }
99
-
100
- function CardContent(props: React.ComponentProps<"div">) {
101
- return <div data-slot="card-content" {...props} />;
102
- }
103
-
104
- function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
105
- return (
106
- <div
107
- data-slot="card-footer"
108
- className={cn("flex flex-wrap items-center gap-2 px-6 pt-3 last:pb-6", className)}
109
- {...props}
110
- />
111
- );
112
- }
113
-
114
- function CardMedia({ className, ...props }: React.ComponentProps<"div">) {
115
- return (
116
- <div
117
- data-slot="card-media"
118
- className={cn(
119
- "relative flex-1 p-6 first:pb-3 last:pt-3 group-[.flex-row]:first:pr-0 group-[.flex-row]:first:pb-6 group-[.flex-row]:last:pl-0 group-[.flex-row]:last:pt-6",
120
- className
121
- )}
122
- {...props}
123
- />
124
- );
125
- }
126
-
127
- function CardImage({ className, ...props }: React.ComponentProps<"img">) {
128
- return (
129
- <CardMedia>
130
- <img className={cn("w-full h-full rounded-lg aspect-9/5 object-cover object-top", className)} {...props} />
131
- </CardMedia>
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
- interface HorizontalListProps extends React.ComponentProps<"div"> {
7
- toolbarLocation?: "bottom" | "top";
8
- }
9
-
10
- function HorizontalList({ className, children, toolbarLocation = "bottom", ...props }: HorizontalListProps) {
11
- const containerRef = useRef<HTMLDivElement>(null);
12
-
13
- const scrollLeft = useCallback(() => {
14
- containerRef.current?.scrollBy({ left: -320 });
15
- }, []);
16
-
17
- const scrollRight = useCallback(() => {
18
- containerRef.current?.scrollBy({ left: 320 });
19
- }, []);
20
-
21
- return (
22
- <div
23
- className={cn("flex gap-4", {
24
- "flex-col": toolbarLocation === "bottom",
25
- "flex-col-reverse": toolbarLocation === "top",
26
- })}
27
- >
28
- <div
29
- ref={containerRef}
30
- className={cn(
31
- "scrollbar-hidden overscroll-contain -ms-4 py-1 px-4 gap-4 sm:-ms-8 sm:px-8 sm:gap-8 flex flex-row flex-nowrap overflow-x-auto w-screen snap-x snap-mandatory touch-pan-x scroll-smooth",
32
- className
33
- )}
34
- {...props}
35
- >
36
- {children}
37
- </div>
38
- <div className="flex justify-center sm:justify-start">
39
- <Button size="icon" variant="ghost" className="rounded-full" onClick={scrollLeft}>
40
- <ChevronLeft className="size-9" />
41
- </Button>
42
- <Button size="icon" variant="ghost" className="rounded-full" onClick={scrollRight}>
43
- <ChevronRight className="size-9" />
44
- </Button>
45
- </div>
46
- </div>
47
- );
48
- }
49
-
50
- export { HorizontalList };
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 };