@bccampus/ui-components 0.2.0 → 0.3.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.js +14 -14
- package/dist/button.d.ts +1 -1
- package/dist/button.js +17 -17
- package/dist/caption.js +7 -8
- package/dist/card.js +34 -34
- package/dist/horizontal-list.js +32 -32
- package/dist/icon-generator.js +38 -38
- package/dist/index-U7DVCmS_.js +76 -0
- package/dist/input.js +4 -4
- package/dist/masked-image-generator.js +18 -18
- package/dist/navigation-menu.d.ts +27 -0
- package/dist/navigation-menu.js +1139 -0
- package/dist/overlay.js +2 -2
- package/dist/page-header.d.ts +5 -1
- package/dist/page-header.js +10 -9
- package/dist/page-section.js +14 -14
- package/dist/page.js +4 -4
- package/dist/search-input.js +11 -11
- package/dist/tag.js +8 -9
- package/dist/ui-components.d.ts +30 -2
- package/dist/ui-components.js +47 -37
- package/package.json +6 -1
- package/src/components/ui/banner.tsx +2 -2
- package/src/components/ui/button.tsx +8 -7
- package/src/components/ui/card.tsx +5 -5
- package/src/components/ui/horizontal-list.tsx +2 -2
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/navigation-menu.tsx +165 -0
- package/src/components/ui/page-header.tsx +13 -5
- package/src/components/ui/page-section.tsx +8 -8
- package/src/components/ui/page.tsx +3 -1
- package/src/styles/theme.css +7 -7
- package/src/styles/typography.css +334 -341
- package/vite.config.ts +5 -3
- package/vite.ladle.config.ts +17 -0
- package/dist/index-DlfV3JTY.js +0 -70
- package/dist/jsx-runtime-BzflLqGi.js +0 -282
package/dist/overlay.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { c as e } from "./utils-CRiPKpXj.js";
|
|
3
3
|
import { c as n } from "./index-CQhYMnjT.js";
|
|
4
4
|
const i = n("absolute w-fit h-fit z-1 overflow-hidden p-0.25", {
|
|
@@ -20,7 +20,7 @@ const i = n("absolute w-fit h-fit z-1 overflow-hidden p-0.25", {
|
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
function p({ className: t, position: o, ...r }) {
|
|
23
|
-
return /* @__PURE__ */ a
|
|
23
|
+
return /* @__PURE__ */ a("div", { className: e(i({ position: o }), t), ...r });
|
|
24
24
|
}
|
|
25
25
|
export {
|
|
26
26
|
p as Overlay
|
package/dist/page-header.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { JSX } from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
|
-
export declare function PageHeader({ children, ...props }:
|
|
3
|
+
export declare function PageHeader({ children, asChild, ...props }: PageHeaderProps): JSX.Element;
|
|
4
|
+
|
|
5
|
+
export declare type PageHeaderProps = React.ComponentProps<"div"> & {
|
|
6
|
+
asChild?: boolean;
|
|
7
|
+
};
|
|
4
8
|
|
|
5
9
|
export { }
|
package/dist/page-header.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as s, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { S as i } from "./index-U7DVCmS_.js";
|
|
3
|
+
import { PageSection as u } from "./page-section.js";
|
|
3
4
|
import e, { useMemo as h } from "react";
|
|
4
5
|
const l = {
|
|
5
6
|
DarkBlue: "#174467",
|
|
@@ -7,7 +8,7 @@ const l = {
|
|
|
7
8
|
Light: "#ffffff",
|
|
8
9
|
Dark: "#000000"
|
|
9
10
|
};
|
|
10
|
-
function
|
|
11
|
+
function g({ size: c, style: a, color: t, colors: m, viewBox: n, children: p, ...d }) {
|
|
11
12
|
const r = h(() => t ? { "--svg-c0": t } : m ? Object.fromEntries(m.map((N, v) => [`--svg-c${v}`, N])) : {}, [t, m]), E = h(
|
|
12
13
|
() => ({
|
|
13
14
|
width: c,
|
|
@@ -29,7 +30,7 @@ function i({ size: c, style: a, color: t, colors: m, viewBox: n, children: p, ..
|
|
|
29
30
|
p
|
|
30
31
|
);
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
+
function f({ variant: c, colors: a, ...t }) {
|
|
33
34
|
const m = h(() => {
|
|
34
35
|
switch (c) {
|
|
35
36
|
case "white":
|
|
@@ -43,7 +44,7 @@ function g({ variant: c, colors: a, ...t }) {
|
|
|
43
44
|
}
|
|
44
45
|
}, [c, a]);
|
|
45
46
|
return /* @__PURE__ */ e.createElement(
|
|
46
|
-
|
|
47
|
+
g,
|
|
47
48
|
{
|
|
48
49
|
...t,
|
|
49
50
|
viewBox: "0 0 761.23999 180.62666",
|
|
@@ -932,12 +933,12 @@ function g({ variant: c, colors: a, ...t }) {
|
|
|
932
933
|
)))
|
|
933
934
|
);
|
|
934
935
|
}
|
|
935
|
-
function
|
|
936
|
-
return /* @__PURE__ */ s
|
|
937
|
-
/* @__PURE__ */ s
|
|
936
|
+
function k({ children: c, asChild: a, ...t }) {
|
|
937
|
+
return /* @__PURE__ */ s(u, { py: "none", className: "sticky top-0 right-0 left-0 z-50 bg-background", ...t, children: /* @__PURE__ */ o(a ? i : "div", { className: "h-page-nav overflow-hidden flex flex-row flex-nowrap border-b-1 border-b-complement-1-50 gap-2 sm:gap-12 justify-between items-center sm:justify-start", children: [
|
|
938
|
+
/* @__PURE__ */ s("div", { className: "py-4 h-full", children: /* @__PURE__ */ s(f, { height: "100%", variant: "color" }) }),
|
|
938
939
|
c
|
|
939
940
|
] }) });
|
|
940
941
|
}
|
|
941
942
|
export {
|
|
942
|
-
|
|
943
|
+
k as PageHeader
|
|
943
944
|
};
|
package/dist/page-section.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as
|
|
3
|
-
import { c as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { c as p } from "./utils-CRiPKpXj.js";
|
|
3
|
+
import { c as e } from "./index-CQhYMnjT.js";
|
|
4
|
+
const c = e("group @container/page-section relative w-full", {
|
|
5
5
|
variants: {
|
|
6
6
|
px: {
|
|
7
7
|
none: "px-0",
|
|
8
|
-
default: "px-section",
|
|
9
|
-
sm: "px-
|
|
10
|
-
lg: "px-section-lg",
|
|
11
|
-
xl: "px-section-xl"
|
|
8
|
+
default: "px-(--spacing-section)",
|
|
9
|
+
sm: "px-(--spacing-section-sm)",
|
|
10
|
+
lg: "px-(--spacing-section-lg)",
|
|
11
|
+
xl: "px-(--spacing-section-xl)"
|
|
12
12
|
},
|
|
13
13
|
py: {
|
|
14
14
|
none: "py-0",
|
|
15
|
-
default: "py-section",
|
|
16
|
-
sm: "py-
|
|
17
|
-
lg: "py-section-lg",
|
|
18
|
-
xl: "py-section-xl"
|
|
15
|
+
default: "py-(--spacing-section)",
|
|
16
|
+
sm: "py-(--spacing-section-sm)",
|
|
17
|
+
lg: "py-(--spacing-section-lg)",
|
|
18
|
+
xl: "py-(--spacing-section-xl)"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
defaultVariants: {
|
|
@@ -23,8 +23,8 @@ const p = i("group @container/page-section relative w-full", {
|
|
|
23
23
|
py: "default"
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
function r({ className:
|
|
27
|
-
return /* @__PURE__ */
|
|
26
|
+
function r({ className: n, px: a, py: s, ...t }) {
|
|
27
|
+
return /* @__PURE__ */ i("div", { "data-slot": "page-section", className: p(c({ px: a, py: s }), n), ...t });
|
|
28
28
|
}
|
|
29
29
|
export {
|
|
30
30
|
r as PageSection
|
package/dist/page.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as
|
|
3
|
-
function i({ className: a, ...
|
|
4
|
-
return /* @__PURE__ */
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as o } from "./utils-CRiPKpXj.js";
|
|
3
|
+
function i({ className: a, ...e }) {
|
|
4
|
+
return /* @__PURE__ */ r("div", { "data-slot": "page", className: o("group/page @container/page relative w-full", a), ...e });
|
|
5
5
|
}
|
|
6
6
|
export {
|
|
7
7
|
i as Page
|
package/dist/search-input.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c } from "./utils-CRiPKpXj.js";
|
|
3
|
-
import { Input as
|
|
4
|
-
import { c as
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { c as o } from "./utils-CRiPKpXj.js";
|
|
3
|
+
import { Input as a } from "./input.js";
|
|
4
|
+
import { c as n } from "./createLucideIcon-CzehbSja.js";
|
|
5
5
|
/**
|
|
6
6
|
* @license lucide-react v0.544.0 - ISC
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the ISC license.
|
|
9
9
|
* See the LICENSE file in the root directory of this source tree.
|
|
10
10
|
*/
|
|
11
|
-
const
|
|
11
|
+
const s = [
|
|
12
12
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
13
13
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
14
|
-
],
|
|
15
|
-
function
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */ e
|
|
18
|
-
/* @__PURE__ */ e
|
|
14
|
+
], i = n("search", s);
|
|
15
|
+
function h({ className: r, ...t }) {
|
|
16
|
+
return /* @__PURE__ */ c("div", { className: o("relative", r), children: [
|
|
17
|
+
/* @__PURE__ */ e(a, { ...t }),
|
|
18
|
+
/* @__PURE__ */ e(i, { className: "absolute size-4 top-1/2 right-3 -translate-y-1/2 pointer-events-none text-primary" })
|
|
19
19
|
] });
|
|
20
20
|
}
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
h as SearchInput
|
|
23
23
|
};
|
package/dist/tag.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as
|
|
3
|
-
import { c as
|
|
4
|
-
import { c as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { S as n } from "./index-U7DVCmS_.js";
|
|
3
|
+
import { c as o } from "./index-CQhYMnjT.js";
|
|
4
|
+
import { c as l } from "./utils-CRiPKpXj.js";
|
|
5
|
+
const p = o(
|
|
6
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",
|
|
7
7
|
{
|
|
8
8
|
variants: {
|
|
@@ -23,11 +23,10 @@ const d = l(
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
|
-
function u({ className: i, size:
|
|
27
|
-
|
|
28
|
-
return /* @__PURE__ */ n.jsx(r, { "data-slot": "tag", className: p(d({ variant: e, size: t }), i), ...a });
|
|
26
|
+
function u({ className: i, size: e, variant: t, asChild: s = !1, ...a }) {
|
|
27
|
+
return /* @__PURE__ */ r(s ? n : "div", { "data-slot": "tag", className: l(p({ variant: t, size: e }), i), ...a });
|
|
29
28
|
}
|
|
30
29
|
export {
|
|
31
30
|
u as Tag,
|
|
32
|
-
|
|
31
|
+
p as tagVariants
|
|
33
32
|
};
|
package/dist/ui-components.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ClassProp } from 'class-variance-authority/types';
|
|
2
2
|
import { JSX } from 'react';
|
|
3
3
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
4
|
+
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
4
5
|
import { VariantProps } from 'class-variance-authority';
|
|
5
6
|
|
|
6
7
|
export declare function Banner({ className, size, variant, dismissible, children, ...props }: BannerProps): JSX_2.Element | null;
|
|
@@ -21,7 +22,7 @@ export declare type ButtonProps = React.ComponentProps<"button"> & VariantProps<
|
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
export declare const buttonVariants: (props?: ({
|
|
24
|
-
variant?: "default" | "secondary" | "outline" | "ghost" | "destructive" | null | undefined;
|
|
25
|
+
variant?: "default" | "secondary" | "outline" | "ghost" | "item" | "destructive" | null | undefined;
|
|
25
26
|
block?: boolean | null | undefined;
|
|
26
27
|
size?: "text" | "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
27
28
|
} & ClassProp) | undefined) => string;
|
|
@@ -110,6 +111,29 @@ declare interface MaskedImageGeneratorProps extends IconGeneratorProps {
|
|
|
110
111
|
maskType?: "alpha" | "luminance";
|
|
111
112
|
}
|
|
112
113
|
|
|
114
|
+
export declare function NavigationMenu({ className, children, noViewport, mega, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
|
|
115
|
+
noViewport?: boolean;
|
|
116
|
+
mega?: boolean;
|
|
117
|
+
}): JSX_2.Element;
|
|
118
|
+
|
|
119
|
+
export declare function NavigationMenuContent({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>): JSX_2.Element;
|
|
120
|
+
|
|
121
|
+
export declare function NavigationMenuIndicator({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>): JSX_2.Element;
|
|
122
|
+
|
|
123
|
+
export declare function NavigationMenuItem({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>): JSX_2.Element;
|
|
124
|
+
|
|
125
|
+
export declare function NavigationMenuLink({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>): JSX_2.Element;
|
|
126
|
+
|
|
127
|
+
export declare function NavigationMenuList({ className, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.List>): JSX_2.Element;
|
|
128
|
+
|
|
129
|
+
export declare function NavigationMenuTrigger({ className, children, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>): JSX_2.Element;
|
|
130
|
+
|
|
131
|
+
export declare const navigationMenuTriggerStyle: string;
|
|
132
|
+
|
|
133
|
+
export declare function NavigationMenuViewport({ className, mega, ...props }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport> & {
|
|
134
|
+
mega?: boolean;
|
|
135
|
+
}): JSX_2.Element;
|
|
136
|
+
|
|
113
137
|
export declare function Overlay({ className, position, ...props }: OverlayProps): JSX_2.Element;
|
|
114
138
|
|
|
115
139
|
export declare type OverlayProps = React.ComponentProps<"div"> & VariantProps<typeof overlayVariants>;
|
|
@@ -120,7 +144,11 @@ declare const overlayVariants: (props?: ({
|
|
|
120
144
|
|
|
121
145
|
export declare function Page({ className, ...props }: PageProps): JSX_2.Element;
|
|
122
146
|
|
|
123
|
-
export declare function PageHeader({ children, ...props }:
|
|
147
|
+
export declare function PageHeader({ children, asChild, ...props }: PageHeaderProps): JSX_2.Element;
|
|
148
|
+
|
|
149
|
+
export declare type PageHeaderProps = React.ComponentProps<"div"> & {
|
|
150
|
+
asChild?: boolean;
|
|
151
|
+
};
|
|
124
152
|
|
|
125
153
|
export declare type PageProps = React.ComponentProps<"div">;
|
|
126
154
|
|
package/dist/ui-components.js
CHANGED
|
@@ -1,44 +1,54 @@
|
|
|
1
|
-
import { IconGenerator as
|
|
1
|
+
import { IconGenerator as o } from "./icon-generator.js";
|
|
2
2
|
import { MaskedImageGenerator as e } from "./masked-image-generator.js";
|
|
3
|
-
import { Caption as
|
|
4
|
-
import { Banner as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { Card as
|
|
7
|
-
import { HorizontalList as
|
|
3
|
+
import { Caption as i, captionVariants as p } from "./caption.js";
|
|
4
|
+
import { Banner as m } from "./banner.js";
|
|
5
|
+
import { Button as u, buttonVariants as C } from "./button.js";
|
|
6
|
+
import { Card as x, CardArea as M, CardCaption as v, CardContent as I, CardImage as N, CardItemGroup as c, CardMedia as l, CardMeta as s, CardSubcaption as S, CardSubtitle as T, CardTitle as b, CardToolbar as V } from "./card.js";
|
|
7
|
+
import { HorizontalList as L } from "./horizontal-list.js";
|
|
8
8
|
import { Input as k } from "./input.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
9
|
+
import { NavigationMenu as B, NavigationMenuContent as H, NavigationMenuIndicator as h, NavigationMenuItem as w, NavigationMenuLink as z, NavigationMenuList as A, NavigationMenuTrigger as O, NavigationMenuViewport as j, navigationMenuTriggerStyle as q } from "./navigation-menu.js";
|
|
10
|
+
import { Overlay as E } from "./overlay.js";
|
|
11
|
+
import { PageHeader as J } from "./page-header.js";
|
|
12
|
+
import { PageSection as Q } from "./page-section.js";
|
|
13
|
+
import { Page as U } from "./page.js";
|
|
14
|
+
import { SearchInput as X } from "./search-input.js";
|
|
15
|
+
import { Tag as Z, tagVariants as _ } from "./tag.js";
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
m as Banner,
|
|
18
|
+
u as Button,
|
|
19
|
+
i as Caption,
|
|
20
|
+
x as Card,
|
|
21
|
+
M as CardArea,
|
|
22
|
+
v as CardCaption,
|
|
23
|
+
I as CardContent,
|
|
24
|
+
N as CardImage,
|
|
25
|
+
c as CardItemGroup,
|
|
26
|
+
l as CardMedia,
|
|
27
|
+
s as CardMeta,
|
|
28
|
+
S as CardSubcaption,
|
|
29
|
+
T as CardSubtitle,
|
|
30
|
+
b as CardTitle,
|
|
30
31
|
V as CardToolbar,
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
L as HorizontalList,
|
|
33
|
+
o as IconGenerator,
|
|
33
34
|
k as Input,
|
|
34
35
|
e as MaskedImageGenerator,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
B as NavigationMenu,
|
|
37
|
+
H as NavigationMenuContent,
|
|
38
|
+
h as NavigationMenuIndicator,
|
|
39
|
+
w as NavigationMenuItem,
|
|
40
|
+
z as NavigationMenuLink,
|
|
41
|
+
A as NavigationMenuList,
|
|
42
|
+
O as NavigationMenuTrigger,
|
|
43
|
+
j as NavigationMenuViewport,
|
|
44
|
+
E as Overlay,
|
|
45
|
+
U as Page,
|
|
46
|
+
J as PageHeader,
|
|
47
|
+
Q as PageSection,
|
|
48
|
+
X as SearchInput,
|
|
49
|
+
Z as Tag,
|
|
50
|
+
C as buttonVariants,
|
|
51
|
+
p as captionVariants,
|
|
52
|
+
q as navigationMenuTriggerStyle,
|
|
53
|
+
_ as tagVariants
|
|
44
54
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bccampus/ui-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"packageManager": "yarn@4.10.3",
|
|
6
6
|
"exports": {
|
|
@@ -40,6 +40,10 @@
|
|
|
40
40
|
"types": "./dist/input.d.ts",
|
|
41
41
|
"import": "./dist/input.js"
|
|
42
42
|
},
|
|
43
|
+
"./navigation-menu": {
|
|
44
|
+
"types": "./dist/navigation-menu.d.ts",
|
|
45
|
+
"import": "./dist/navigation-menu.js"
|
|
46
|
+
},
|
|
43
47
|
"./overlay": {
|
|
44
48
|
"types": "./dist/overlay.d.ts",
|
|
45
49
|
"import": "./dist/overlay.js"
|
|
@@ -85,6 +89,7 @@
|
|
|
85
89
|
"@bcgov/bc-sans": "^2.1.0",
|
|
86
90
|
"@fontsource-variable/inter-tight": "^5.2.7",
|
|
87
91
|
"@ladle/react": "^5.0.3",
|
|
92
|
+
"@radix-ui/react-navigation-menu": "^1.2.14",
|
|
88
93
|
"@radix-ui/react-slot": "^1.2.3",
|
|
89
94
|
"class-variance-authority": "^0.7.1",
|
|
90
95
|
"clsx": "^2.1.1",
|
|
@@ -4,7 +4,7 @@ import { useState } from "react";
|
|
|
4
4
|
import { Button } from "./button";
|
|
5
5
|
import { X } from "lucide-react";
|
|
6
6
|
|
|
7
|
-
const bannerVariants = cva("flex flex-row items-center justify-between px-section text-sm", {
|
|
7
|
+
const bannerVariants = cva("flex flex-row items-center justify-between px-(--spacing-section) text-sm", {
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
10
|
default: "bg-complement-3 text-white",
|
|
@@ -32,7 +32,7 @@ function Banner({ className, size, variant, dismissible, children, ...props }: B
|
|
|
32
32
|
if (dismissed) return null;
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
|
-
<div className={cn(bannerVariants({ variant, size }), className)} {...props}>
|
|
35
|
+
<div data-slot="banner" className={cn(bannerVariants({ variant, size }), className)} {...props}>
|
|
36
36
|
<div className="flex-auto text-center">{children}</div>
|
|
37
37
|
{dismissible && (
|
|
38
38
|
<div>
|
|
@@ -4,7 +4,7 @@ import { cva, type VariantProps } from "class-variance-authority";
|
|
|
4
4
|
import { cn } from "@/lib/utils";
|
|
5
5
|
|
|
6
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",
|
|
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 px-6 has-[>svg]:px-4 [&_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
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
@@ -15,6 +15,7 @@ const buttonVariants = cva(
|
|
|
15
15
|
outline:
|
|
16
16
|
"border border-primary bg-transparent hover:border-secondary hover:bg-secondary/10 dark:border-input dark:hover:bg-input/50",
|
|
17
17
|
ghost: "text-primary hover:text-secondary dark:text-foreground dark:hover:bg-complement-1-800",
|
|
18
|
+
item: "justify-between px-2 has-[>svg]:px-2 text-primary hover:bg-complement-1-50 dark:text-foreground dark:hover:bg-complement-1-800",
|
|
18
19
|
destructive:
|
|
19
20
|
"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
|
},
|
|
@@ -23,17 +24,17 @@ const buttonVariants = cva(
|
|
|
23
24
|
true: "w-full",
|
|
24
25
|
},
|
|
25
26
|
size: {
|
|
26
|
-
default: "h-9
|
|
27
|
-
sm: "h-8
|
|
28
|
-
lg: "h-10
|
|
27
|
+
default: "h-9",
|
|
28
|
+
sm: "h-8 gap-1.5",
|
|
29
|
+
lg: "h-10 text-base",
|
|
29
30
|
icon: "size-9",
|
|
30
|
-
text: "
|
|
31
|
+
text: "h-9 text-base",
|
|
31
32
|
},
|
|
32
33
|
},
|
|
33
34
|
defaultVariants: {
|
|
34
|
-
variant: "default",
|
|
35
35
|
size: "default",
|
|
36
36
|
block: false,
|
|
37
|
+
variant: "default",
|
|
37
38
|
},
|
|
38
39
|
}
|
|
39
40
|
);
|
|
@@ -46,7 +47,7 @@ export type ButtonProps = React.ComponentProps<"button"> &
|
|
|
46
47
|
function Button({ className, variant, size, block, asChild = false, ...props }: ButtonProps) {
|
|
47
48
|
const Comp = asChild ? Slot : "button";
|
|
48
49
|
|
|
49
|
-
return <Comp data-slot="button" className={cn(buttonVariants({
|
|
50
|
+
return <Comp data-slot="button" className={cn(buttonVariants({ size, block, variant }), className)} {...props} />;
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
export { Button, buttonVariants };
|
|
@@ -2,10 +2,10 @@ import { cn } from "@/lib/utils";
|
|
|
2
2
|
import { Caption } from "./typography/caption";
|
|
3
3
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
4
|
|
|
5
|
-
const cardVariants = cva("group @container/card w-full max-w-full bg-card text-card-foreground grid gap-card", {
|
|
5
|
+
const cardVariants = cva("group @container/card w-full max-w-full bg-card text-card-foreground grid gap-(--gap-card)", {
|
|
6
6
|
variants: {
|
|
7
7
|
bordered: {
|
|
8
|
-
true: "p-card border border-complement-1-100 dark:border-brand-1-900 ",
|
|
8
|
+
true: "p-(--spacing-card) border border-complement-1-100 dark:border-brand-1-900 ",
|
|
9
9
|
false: "",
|
|
10
10
|
},
|
|
11
11
|
rounded: {
|
|
@@ -40,14 +40,14 @@ function CardArea({ name, className, ...props }: CardAreaProps) {
|
|
|
40
40
|
return (
|
|
41
41
|
<div
|
|
42
42
|
style={{ gridArea: name }}
|
|
43
|
-
className={cn("relative flex flex-col gap-(--card-area
|
|
43
|
+
className={cn("@container/card-area relative flex flex-col gap-(--gap-card-area)", className)}
|
|
44
44
|
{...props}
|
|
45
45
|
/>
|
|
46
46
|
);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
function CardItemGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
50
|
-
return <div className={cn("flex flex-col gap-(--card-item-group
|
|
50
|
+
return <div className={cn("flex flex-col gap-(--gap-card-item-group)", className)} {...props} />;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
type CardTitleProps = React.ComponentProps<"div"> & { size?: "sm" | "md" | "lg" };
|
|
@@ -100,7 +100,7 @@ function CardContent(props: React.ComponentProps<"div">) {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
function CardToolbar({ className, ...props }: React.ComponentProps<"div">) {
|
|
103
|
-
return <div className={cn("flex flex-wrap items-center gap-(--card-item-group
|
|
103
|
+
return <div className={cn("flex flex-wrap items-center gap-(--gap-card-item-group)", className)} {...props} />;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
function CardMedia({ className, ...props }: React.ComponentProps<"div">) {
|
|
@@ -5,12 +5,12 @@ import { useCallback, useRef } from "react";
|
|
|
5
5
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
6
6
|
|
|
7
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",
|
|
8
|
+
"scrollbar-hidden overscroll-x-contain flex flex-row flex-nowrap py-1 gap-(--gap-card) overflow-x-auto snap-x snap-mandatory touch-pan-x scroll-smooth *:shrink-0 *:grow-0 *:snap-center *:select-none",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
12
|
contain: "w-full ",
|
|
13
|
-
overflow: "w-screen px-section -ms-section scroll-px-(--section
|
|
13
|
+
overflow: "w-screen px-(--spacing-section) -ms-(--spacing-section) scroll-px-(--spacing-section)",
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
defaultVariants: {
|
|
@@ -6,6 +6,7 @@ export * from './button.tsx'
|
|
|
6
6
|
export * from './card.tsx'
|
|
7
7
|
export * from './horizontal-list.tsx'
|
|
8
8
|
export * from './input.tsx'
|
|
9
|
+
export * from './navigation-menu.tsx'
|
|
9
10
|
export * from './overlay.tsx'
|
|
10
11
|
export * from './page-header.tsx'
|
|
11
12
|
export * from './page-section.tsx'
|