@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
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
2
|
+
import { JSX } from 'react/jsx-runtime';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
|
|
5
|
+
export declare function PageSection({ className, px, py, ...props }: PageSectionProps): JSX.Element;
|
|
6
|
+
|
|
7
|
+
export declare type PageSectionProps = React.ComponentProps<"div"> & VariantProps<typeof pageSectionVariants>;
|
|
8
|
+
|
|
9
|
+
declare const pageSectionVariants: (props?: ({
|
|
10
|
+
px?: "none" | "default" | "sm" | "lg" | "xl" | null | undefined;
|
|
11
|
+
py?: "none" | "default" | "sm" | "lg" | "xl" | null | undefined;
|
|
12
|
+
} & ClassProp) | undefined) => string;
|
|
13
|
+
|
|
14
|
+
export { }
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { j as s } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
+
import { c as a } from "./utils-CRiPKpXj.js";
|
|
3
|
+
import { c as i } from "./index-CQhYMnjT.js";
|
|
4
|
+
const p = i("group @container/page-section relative w-full", {
|
|
5
|
+
variants: {
|
|
6
|
+
px: {
|
|
7
|
+
none: "px-0",
|
|
8
|
+
default: "px-section",
|
|
9
|
+
sm: "px-sextion-sm",
|
|
10
|
+
lg: "px-section-lg",
|
|
11
|
+
xl: "px-section-xl"
|
|
12
|
+
},
|
|
13
|
+
py: {
|
|
14
|
+
none: "py-0",
|
|
15
|
+
default: "py-section",
|
|
16
|
+
sm: "py-sextion-sm",
|
|
17
|
+
lg: "py-section-lg",
|
|
18
|
+
xl: "py-section-xl"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
px: "default",
|
|
23
|
+
py: "default"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
function r({ className: t, px: e, py: n, ...o }) {
|
|
27
|
+
return /* @__PURE__ */ s.jsx("div", { "data-slot": "page-section", className: a(p({ px: e, py: n }), t), ...o });
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
r as PageSection
|
|
31
|
+
};
|
package/dist/page.d.ts
ADDED
package/dist/page.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { j as t } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
+
import { c as e } from "./utils-CRiPKpXj.js";
|
|
3
|
+
function i({ className: a, ...r }) {
|
|
4
|
+
return /* @__PURE__ */ t.jsx("div", { "data-slot": "page", className: e("group @container/page relative w-full", a), ...r });
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
i as Page
|
|
8
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
+
import { c } from "./utils-CRiPKpXj.js";
|
|
3
|
+
import { Input as o } from "./input.js";
|
|
4
|
+
import { c as s } from "./createLucideIcon-CzehbSja.js";
|
|
5
|
+
/**
|
|
6
|
+
* @license lucide-react v0.544.0 - ISC
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the ISC license.
|
|
9
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/
|
|
11
|
+
const a = [
|
|
12
|
+
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
13
|
+
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
14
|
+
], n = s("search", a);
|
|
15
|
+
function u({ className: r, ...t }) {
|
|
16
|
+
return /* @__PURE__ */ e.jsxs("div", { className: c("relative", r), children: [
|
|
17
|
+
/* @__PURE__ */ e.jsx(o, { ...t }),
|
|
18
|
+
/* @__PURE__ */ e.jsx(n, { className: "absolute size-4 top-1/2 right-3 -translate-y-1/2 pointer-events-none text-primary" })
|
|
19
|
+
] });
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
u as SearchInput
|
|
23
|
+
};
|
package/dist/tag.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
|
|
5
5
|
export declare function Tag({ className, size, variant, asChild, ...props }: TagProps): JSX.Element;
|
|
6
6
|
|
|
7
|
-
declare interface TagProps extends VariantProps<typeof tagVariants>, React.ComponentProps<"div"> {
|
|
7
|
+
export declare interface TagProps extends VariantProps<typeof tagVariants>, React.ComponentProps<"div"> {
|
|
8
8
|
asChild?: boolean;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
export declare const tagVariants: (props?: ({
|
|
12
|
-
variant?: "
|
|
12
|
+
variant?: "button" | "default" | null | undefined;
|
|
13
13
|
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
14
14
|
} & ClassProp) | undefined) => string;
|
|
15
15
|
|
package/dist/tag.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import {
|
|
3
|
-
import { c as
|
|
4
|
-
|
|
1
|
+
import { j as n } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
+
import { S as o } from "./index-DlfV3JTY.js";
|
|
3
|
+
import { c as l } from "./index-CQhYMnjT.js";
|
|
4
|
+
import { c as p } from "./utils-CRiPKpXj.js";
|
|
5
|
+
const d = l(
|
|
5
6
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-sm text-sm bg-complement-3 text-white [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0",
|
|
6
7
|
{
|
|
7
8
|
variants: {
|
|
@@ -22,11 +23,11 @@ const p = o(
|
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
);
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
return /* @__PURE__ */
|
|
26
|
+
function u({ className: i, size: t, variant: e, asChild: s = !1, ...a }) {
|
|
27
|
+
const r = s ? o : "div";
|
|
28
|
+
return /* @__PURE__ */ n.jsx(r, { "data-slot": "tag", className: p(d({ variant: e, size: t }), i), ...a });
|
|
28
29
|
}
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
u as Tag,
|
|
32
|
+
d as tagVariants
|
|
32
33
|
};
|
package/dist/ui-components.d.ts
CHANGED
|
@@ -1,79 +1,107 @@
|
|
|
1
1
|
import { ClassProp } from 'class-variance-authority/types';
|
|
2
|
-
import { JSX } from 'react
|
|
3
|
-
import { JSX as JSX_2 } from 'react';
|
|
2
|
+
import { JSX } from 'react';
|
|
3
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function Banner({ className, size, variant, dismissible, children, ...props }: BannerProps): JSX_2.Element | null;
|
|
7
7
|
|
|
8
|
-
declare
|
|
8
|
+
export declare interface BannerProps extends VariantProps<typeof bannerVariants>, React.ComponentProps<"div"> {
|
|
9
|
+
dismissible?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare const bannerVariants: (props?: ({
|
|
13
|
+
variant?: "default" | "alert" | null | undefined;
|
|
14
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
15
|
+
} & ClassProp) | undefined) => string;
|
|
16
|
+
|
|
17
|
+
export declare function Button({ className, variant, size, block, asChild, ...props }: ButtonProps): JSX_2.Element;
|
|
18
|
+
|
|
19
|
+
export declare type ButtonProps = React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
9
20
|
asChild?: boolean;
|
|
10
21
|
};
|
|
11
22
|
|
|
12
23
|
export declare const buttonVariants: (props?: ({
|
|
13
|
-
variant?: "default" | "secondary" | "outline" | "ghost" | "
|
|
14
|
-
|
|
24
|
+
variant?: "default" | "secondary" | "outline" | "ghost" | "destructive" | null | undefined;
|
|
25
|
+
block?: boolean | null | undefined;
|
|
26
|
+
size?: "text" | "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
15
27
|
} & ClassProp) | undefined) => string;
|
|
16
28
|
|
|
17
29
|
export declare function Caption({ className, variant, asChild, ...props }: React.ComponentProps<"div"> & VariantProps<typeof captionVariants> & {
|
|
18
30
|
asChild?: boolean;
|
|
19
|
-
}):
|
|
31
|
+
}): JSX_2.Element;
|
|
20
32
|
|
|
21
33
|
export declare const captionVariants: (props?: ({
|
|
22
34
|
variant?: "default" | "light" | null | undefined;
|
|
23
35
|
} & ClassProp) | undefined) => string;
|
|
24
36
|
|
|
25
|
-
export declare function Card<T extends boolean = false>({ className, asLink,
|
|
37
|
+
export declare function Card<T extends boolean = false>({ className, asLink, bordered, rounded, ...props }: CardProps<T>): JSX_2.Element;
|
|
26
38
|
|
|
27
|
-
export declare function
|
|
39
|
+
export declare function CardArea({ name, className, ...props }: CardAreaProps): JSX_2.Element;
|
|
28
40
|
|
|
29
|
-
|
|
41
|
+
declare type CardAreaProps = React.ComponentProps<"div"> & {
|
|
42
|
+
name: string;
|
|
43
|
+
};
|
|
30
44
|
|
|
31
|
-
export declare function
|
|
45
|
+
export declare function CardCaption(props: React.ComponentProps<"div">): JSX_2.Element;
|
|
32
46
|
|
|
33
|
-
export declare function
|
|
47
|
+
export declare function CardContent(props: React.ComponentProps<"div">): JSX_2.Element;
|
|
34
48
|
|
|
35
|
-
export declare function
|
|
49
|
+
export declare function CardImage({ className, ...props }: React.ComponentProps<"img">): JSX_2.Element;
|
|
36
50
|
|
|
37
|
-
export declare function
|
|
51
|
+
export declare function CardItemGroup({ className, ...props }: React.ComponentProps<"div">): JSX_2.Element;
|
|
38
52
|
|
|
39
|
-
export declare function CardMedia({ className, ...props }: React.ComponentProps<"div">):
|
|
53
|
+
export declare function CardMedia({ className, ...props }: React.ComponentProps<"div">): JSX_2.Element;
|
|
40
54
|
|
|
41
|
-
export declare function CardMeta(props: React.ComponentProps<"div">):
|
|
55
|
+
export declare function CardMeta(props: React.ComponentProps<"div">): JSX_2.Element;
|
|
42
56
|
|
|
43
|
-
declare type CardProps<T extends boolean> = (T extends true ? React.ComponentProps<"a"> : React.ComponentProps<"div">) & VariantProps<typeof cardVariants> & {
|
|
57
|
+
export declare type CardProps<T extends boolean> = (T extends true ? React.ComponentProps<"a"> : React.ComponentProps<"div">) & VariantProps<typeof cardVariants> & {
|
|
44
58
|
asLink?: T;
|
|
45
59
|
};
|
|
46
60
|
|
|
47
|
-
export declare function
|
|
61
|
+
export declare function CardSubcaption(props: React.ComponentProps<"div">): JSX_2.Element;
|
|
48
62
|
|
|
49
|
-
export declare function
|
|
63
|
+
export declare function CardSubtitle({ size, className, ...props }: CardTitleProps): JSX_2.Element;
|
|
64
|
+
|
|
65
|
+
export declare function CardTitle({ size, className, ...props }: CardTitleProps): JSX_2.Element;
|
|
50
66
|
|
|
51
67
|
declare type CardTitleProps = React.ComponentProps<"div"> & {
|
|
52
68
|
size?: "sm" | "md" | "lg";
|
|
53
69
|
};
|
|
54
70
|
|
|
71
|
+
export declare function CardToolbar({ className, ...props }: React.ComponentProps<"div">): JSX_2.Element;
|
|
72
|
+
|
|
55
73
|
declare const cardVariants: (props?: ({
|
|
56
|
-
|
|
57
|
-
|
|
74
|
+
bordered?: boolean | null | undefined;
|
|
75
|
+
rounded?: boolean | null | undefined;
|
|
58
76
|
} & ClassProp) | undefined) => string;
|
|
59
77
|
|
|
60
|
-
export declare function HorizontalList({ className, children, toolbarLocation, ...props }: HorizontalListProps):
|
|
78
|
+
export declare function HorizontalList({ variant, className, children, toolbarLocation, scrollBy, ...props }: HorizontalListProps): JSX_2.Element;
|
|
61
79
|
|
|
62
|
-
declare interface HorizontalListProps extends React.ComponentProps<"div"> {
|
|
80
|
+
export declare interface HorizontalListProps extends VariantProps<typeof horizontalListVariants>, React.ComponentProps<"div"> {
|
|
63
81
|
toolbarLocation?: "bottom" | "top";
|
|
82
|
+
scrollBy?: number;
|
|
64
83
|
}
|
|
65
84
|
|
|
66
|
-
|
|
85
|
+
declare const horizontalListVariants: (props?: ({
|
|
86
|
+
variant?: "overflow" | "contain" | null | undefined;
|
|
87
|
+
} & ClassProp) | undefined) => string;
|
|
88
|
+
|
|
89
|
+
export declare function IconGenerator({ pattern, tileSize, tileClassName, tileBgClassName, renderChildren, fit, ...props }: IconGeneratorProps): JSX_2.Element;
|
|
67
90
|
|
|
68
91
|
declare interface IconGeneratorProps extends Omit<React.ComponentProps<"svg">, "children" | "width" | "height" | "overflow"> {
|
|
69
92
|
pattern?: (TileShape | TileConfig)[][];
|
|
70
93
|
tileSize?: number;
|
|
71
94
|
tileClassName?: string;
|
|
72
95
|
tileBgClassName?: string;
|
|
73
|
-
|
|
96
|
+
fit?: "none" | "fill" | "width" | "height";
|
|
97
|
+
renderChildren?: (paths: (JSX.Element | null)[], width: number, height: number) => React.ReactNode;
|
|
74
98
|
}
|
|
75
99
|
|
|
76
|
-
export declare function
|
|
100
|
+
export declare function Input({ className, ...props }: InputProps): JSX_2.Element;
|
|
101
|
+
|
|
102
|
+
export declare type InputProps = React.ComponentProps<"input">;
|
|
103
|
+
|
|
104
|
+
export declare function MaskedImageGenerator({ src, imageFit, imagePosition, maskType, ...props }: MaskedImageGeneratorProps): JSX_2.Element;
|
|
77
105
|
|
|
78
106
|
declare interface MaskedImageGeneratorProps extends IconGeneratorProps {
|
|
79
107
|
src: string;
|
|
@@ -82,14 +110,41 @@ declare interface MaskedImageGeneratorProps extends IconGeneratorProps {
|
|
|
82
110
|
maskType?: "alpha" | "luminance";
|
|
83
111
|
}
|
|
84
112
|
|
|
85
|
-
export declare function
|
|
113
|
+
export declare function Overlay({ className, position, ...props }: OverlayProps): JSX_2.Element;
|
|
114
|
+
|
|
115
|
+
export declare type OverlayProps = React.ComponentProps<"div"> & VariantProps<typeof overlayVariants>;
|
|
116
|
+
|
|
117
|
+
declare const overlayVariants: (props?: ({
|
|
118
|
+
position?: "b" | "br" | "tr" | "r" | "t" | "l" | "tl" | "bl" | "c" | null | undefined;
|
|
119
|
+
} & ClassProp) | undefined) => string;
|
|
120
|
+
|
|
121
|
+
export declare function Page({ className, ...props }: PageProps): JSX_2.Element;
|
|
122
|
+
|
|
123
|
+
export declare function PageHeader({ children, ...props }: React.ComponentProps<"div">): JSX_2.Element;
|
|
124
|
+
|
|
125
|
+
export declare type PageProps = React.ComponentProps<"div">;
|
|
126
|
+
|
|
127
|
+
export declare function PageSection({ className, px, py, ...props }: PageSectionProps): JSX_2.Element;
|
|
128
|
+
|
|
129
|
+
export declare type PageSectionProps = React.ComponentProps<"div"> & VariantProps<typeof pageSectionVariants>;
|
|
130
|
+
|
|
131
|
+
declare const pageSectionVariants: (props?: ({
|
|
132
|
+
px?: "none" | "default" | "sm" | "lg" | "xl" | null | undefined;
|
|
133
|
+
py?: "none" | "default" | "sm" | "lg" | "xl" | null | undefined;
|
|
134
|
+
} & ClassProp) | undefined) => string;
|
|
135
|
+
|
|
136
|
+
export declare function SearchInput({ className, ...props }: SearchInputProps): JSX_2.Element;
|
|
137
|
+
|
|
138
|
+
export declare type SearchInputProps = React.ComponentProps<"input">;
|
|
139
|
+
|
|
140
|
+
export declare function Tag({ className, size, variant, asChild, ...props }: TagProps): JSX_2.Element;
|
|
86
141
|
|
|
87
|
-
declare interface TagProps extends VariantProps<typeof tagVariants>, React.ComponentProps<"div"> {
|
|
142
|
+
export declare interface TagProps extends VariantProps<typeof tagVariants>, React.ComponentProps<"div"> {
|
|
88
143
|
asChild?: boolean;
|
|
89
144
|
}
|
|
90
145
|
|
|
91
146
|
export declare const tagVariants: (props?: ({
|
|
92
|
-
variant?: "
|
|
147
|
+
variant?: "button" | "default" | null | undefined;
|
|
93
148
|
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
94
149
|
} & ClassProp) | undefined) => string;
|
|
95
150
|
|
package/dist/ui-components.js
CHANGED
|
@@ -1,29 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { IconGenerator as a } from "./icon-generator.js";
|
|
2
|
+
import { MaskedImageGenerator as e } from "./masked-image-generator.js";
|
|
3
|
+
import { Caption as n, captionVariants as m } from "./caption.js";
|
|
4
|
+
import { Banner as C } from "./banner.js";
|
|
5
|
+
import { Button as x, buttonVariants as i } from "./button.js";
|
|
6
|
+
import { Card as u, CardArea as I, CardCaption as c, CardContent as l, CardImage as s, CardItemGroup as b, CardMedia as S, CardMeta as G, CardSubcaption as M, CardSubtitle as P, CardTitle as T, CardToolbar as V } from "./card.js";
|
|
7
|
+
import { HorizontalList as H } from "./horizontal-list.js";
|
|
8
|
+
import { Input as k } from "./input.js";
|
|
9
|
+
import { Overlay as y } from "./overlay.js";
|
|
10
|
+
import { PageHeader as A } from "./page-header.js";
|
|
11
|
+
import { PageSection as O } from "./page-section.js";
|
|
12
|
+
import { Page as q } from "./page.js";
|
|
13
|
+
import { SearchInput as D } from "./search-input.js";
|
|
14
|
+
import { Tag as F, tagVariants as J } from "./tag.js";
|
|
8
15
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
s as
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
C as Banner,
|
|
17
|
+
x as Button,
|
|
18
|
+
n as Caption,
|
|
19
|
+
u as Card,
|
|
20
|
+
I as CardArea,
|
|
21
|
+
c as CardCaption,
|
|
22
|
+
l as CardContent,
|
|
23
|
+
s as CardImage,
|
|
24
|
+
b as CardItemGroup,
|
|
25
|
+
S as CardMedia,
|
|
26
|
+
G as CardMeta,
|
|
27
|
+
M as CardSubcaption,
|
|
28
|
+
P as CardSubtitle,
|
|
29
|
+
T as CardTitle,
|
|
30
|
+
V as CardToolbar,
|
|
31
|
+
H as HorizontalList,
|
|
32
|
+
a as IconGenerator,
|
|
33
|
+
k as Input,
|
|
34
|
+
e as MaskedImageGenerator,
|
|
35
|
+
y as Overlay,
|
|
36
|
+
q as Page,
|
|
37
|
+
A as PageHeader,
|
|
38
|
+
O as PageSection,
|
|
39
|
+
D as SearchInput,
|
|
40
|
+
F as Tag,
|
|
41
|
+
i as buttonVariants,
|
|
42
|
+
m as captionVariants,
|
|
43
|
+
J as tagVariants
|
|
29
44
|
};
|
package/package.json
CHANGED
|
@@ -1,40 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bccampus/ui-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"packageManager": "yarn@4.10.
|
|
5
|
+
"packageManager": "yarn@4.10.3",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
8
|
"types": "./dist/ui-components.d.ts",
|
|
9
9
|
"import": "./dist/ui-components.js"
|
|
10
10
|
},
|
|
11
|
-
"./
|
|
12
|
-
"types": "./dist/
|
|
13
|
-
"import": "./dist/
|
|
11
|
+
"./icon-generator": {
|
|
12
|
+
"types": "./dist/icon-generator.d.ts",
|
|
13
|
+
"import": "./dist/icon-generator.js"
|
|
14
|
+
},
|
|
15
|
+
"./masked-image-generator": {
|
|
16
|
+
"types": "./dist/masked-image-generator.d.ts",
|
|
17
|
+
"import": "./dist/masked-image-generator.js"
|
|
14
18
|
},
|
|
15
19
|
"./caption": {
|
|
16
20
|
"types": "./dist/caption.d.ts",
|
|
17
21
|
"import": "./dist/caption.js"
|
|
18
22
|
},
|
|
23
|
+
"./banner": {
|
|
24
|
+
"types": "./dist/banner.d.ts",
|
|
25
|
+
"import": "./dist/banner.js"
|
|
26
|
+
},
|
|
27
|
+
"./button": {
|
|
28
|
+
"types": "./dist/button.d.ts",
|
|
29
|
+
"import": "./dist/button.js"
|
|
30
|
+
},
|
|
19
31
|
"./card": {
|
|
20
32
|
"types": "./dist/card.d.ts",
|
|
21
33
|
"import": "./dist/card.js"
|
|
22
34
|
},
|
|
23
|
-
"./tag": {
|
|
24
|
-
"types": "./dist/tag.d.ts",
|
|
25
|
-
"import": "./dist/tag.js"
|
|
26
|
-
},
|
|
27
35
|
"./horizontal-list": {
|
|
28
36
|
"types": "./dist/horizontal-list.d.ts",
|
|
29
37
|
"import": "./dist/horizontal-list.js"
|
|
30
38
|
},
|
|
31
|
-
"./
|
|
32
|
-
"types": "./dist/
|
|
33
|
-
"import": "./dist/
|
|
39
|
+
"./input": {
|
|
40
|
+
"types": "./dist/input.d.ts",
|
|
41
|
+
"import": "./dist/input.js"
|
|
34
42
|
},
|
|
35
|
-
"./
|
|
36
|
-
"types": "./dist/
|
|
37
|
-
"import": "./dist/
|
|
43
|
+
"./overlay": {
|
|
44
|
+
"types": "./dist/overlay.d.ts",
|
|
45
|
+
"import": "./dist/overlay.js"
|
|
46
|
+
},
|
|
47
|
+
"./page-header": {
|
|
48
|
+
"types": "./dist/page-header.d.ts",
|
|
49
|
+
"import": "./dist/page-header.js"
|
|
50
|
+
},
|
|
51
|
+
"./page-section": {
|
|
52
|
+
"types": "./dist/page-section.d.ts",
|
|
53
|
+
"import": "./dist/page-section.js"
|
|
54
|
+
},
|
|
55
|
+
"./page": {
|
|
56
|
+
"types": "./dist/page.d.ts",
|
|
57
|
+
"import": "./dist/page.js"
|
|
58
|
+
},
|
|
59
|
+
"./search-input": {
|
|
60
|
+
"types": "./dist/search-input.d.ts",
|
|
61
|
+
"import": "./dist/search-input.js"
|
|
62
|
+
},
|
|
63
|
+
"./tag": {
|
|
64
|
+
"types": "./dist/tag.d.ts",
|
|
65
|
+
"import": "./dist/tag.js"
|
|
38
66
|
},
|
|
39
67
|
"./utils": {
|
|
40
68
|
"types": "./dist/utils.d.ts",
|
|
@@ -53,6 +81,7 @@
|
|
|
53
81
|
"preview": "vite preview"
|
|
54
82
|
},
|
|
55
83
|
"dependencies": {
|
|
84
|
+
"@bccampus/media-kit": "^0.1.1",
|
|
56
85
|
"@bcgov/bc-sans": "^2.1.0",
|
|
57
86
|
"@fontsource-variable/inter-tight": "^5.2.7",
|
|
58
87
|
"@ladle/react": "^5.0.3",
|
|
Binary file
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
2
|
+
import { cn } from "@/lib/utils";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Button } from "./button";
|
|
5
|
+
import { X } from "lucide-react";
|
|
6
|
+
|
|
7
|
+
const bannerVariants = cva("flex flex-row items-center justify-between px-section text-sm", {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "bg-complement-3 text-white",
|
|
11
|
+
alert: "bg-complement-2-200 text-black",
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
default: "py-2",
|
|
15
|
+
sm: "py-1",
|
|
16
|
+
lg: "py-3 text-md font-semibold",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: {
|
|
20
|
+
variant: "default",
|
|
21
|
+
size: "default",
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export interface BannerProps extends VariantProps<typeof bannerVariants>, React.ComponentProps<"div"> {
|
|
26
|
+
dismissible?: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function Banner({ className, size, variant, dismissible, children, ...props }: BannerProps) {
|
|
30
|
+
const [dismissed, setDismissed] = useState(false);
|
|
31
|
+
|
|
32
|
+
if (dismissed) return null;
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<div className={cn(bannerVariants({ variant, size }), className)} {...props}>
|
|
36
|
+
<div className="flex-auto text-center">{children}</div>
|
|
37
|
+
{dismissible && (
|
|
38
|
+
<div>
|
|
39
|
+
<Button variant="ghost" size="icon" className="size-6 text-white" onClick={() => setDismissed(true)}>
|
|
40
|
+
<X />
|
|
41
|
+
</Button>
|
|
42
|
+
</div>
|
|
43
|
+
)}
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { Banner };
|
|
@@ -1,47 +1,52 @@
|
|
|
1
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
-
|
|
4
|
-
import { cn } from "@/lib/utils";
|
|
5
|
-
|
|
6
|
-
const buttonVariants = cva(
|
|
7
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-sm text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default:
|
|
12
|
-
"bg-primary text-primary-foreground hover:bg-secondary dark:bg-complement-1-
|
|
13
|
-
secondary:
|
|
14
|
-
"bg-secondary text-secondary-foreground hover:bg-background hover:text-primary dark:bg-complement-1-500 dark:text-foreground dark:hover:bg-complement-1-600",
|
|
15
|
-
outline:
|
|
16
|
-
"border border-primary bg-transparent hover:border-secondary hover:bg-secondary/10 dark:border-input dark:hover:bg-input/50",
|
|
17
|
-
ghost: "text-
|
|
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
|
-
|
|
1
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils";
|
|
5
|
+
|
|
6
|
+
const buttonVariants = cva(
|
|
7
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-sm text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default:
|
|
12
|
+
"bg-primary text-primary-foreground hover:bg-secondary dark:bg-complement-1-100 dark:text-brand-1 dark:hover:bg-complement-1-50",
|
|
13
|
+
secondary:
|
|
14
|
+
"bg-secondary text-secondary-foreground hover:bg-background hover:text-primary dark:bg-complement-1-500 dark:text-foreground dark:hover:bg-complement-1-600",
|
|
15
|
+
outline:
|
|
16
|
+
"border border-primary bg-transparent hover:border-secondary hover:bg-secondary/10 dark:border-input dark:hover:bg-input/50",
|
|
17
|
+
ghost: "text-primary hover:text-secondary dark:text-foreground dark:hover:bg-complement-1-800",
|
|
18
|
+
destructive:
|
|
19
|
+
"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
20
|
+
},
|
|
21
|
+
block: {
|
|
22
|
+
false: "w-fit",
|
|
23
|
+
true: "w-full",
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
default: "h-9 px-6 py-2 has-[>svg]:px-3",
|
|
27
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
28
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
29
|
+
icon: "size-9",
|
|
30
|
+
text: "py-2",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
variant: "default",
|
|
35
|
+
size: "default",
|
|
36
|
+
block: false,
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export type ButtonProps = React.ComponentProps<"button"> &
|
|
42
|
+
VariantProps<typeof buttonVariants> & {
|
|
43
|
+
asChild?: boolean;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
function Button({ className, variant, size, block, asChild = false, ...props }: ButtonProps) {
|
|
47
|
+
const Comp = asChild ? Slot : "button";
|
|
48
|
+
|
|
49
|
+
return <Comp data-slot="button" className={cn(buttonVariants({ variant, size, block }), className)} {...props} />;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { Button, buttonVariants };
|