@plexui/ui 0.7.98 → 0.9.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/es/components/Card/Card.js +42 -0
- package/dist/es/components/Card/Card.js.map +1 -0
- package/dist/es/components/Card/Card.module.css +125 -0
- package/dist/es/components/Card/index.js +2 -0
- package/dist/es/components/Card/index.js.map +1 -0
- package/dist/es/components/EmptyMessage/EmptyMessage.module.css +7 -7
- package/dist/es/components/Separator/Separator.js +10 -0
- package/dist/es/components/Separator/Separator.js.map +1 -0
- package/dist/es/components/Separator/Separator.module.css +16 -0
- package/dist/es/components/Separator/index.js +2 -0
- package/dist/es/components/Separator/index.js.map +1 -0
- package/dist/es/styles/variables-components.css +21 -0
- package/dist/types/components/Card/Card.d.ts +62 -0
- package/dist/types/components/Card/index.d.ts +1 -0
- package/dist/types/components/Separator/Separator.d.ts +18 -0
- package/dist/types/components/Separator/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import {} from "react";
|
|
5
|
+
import { useLinkComponent } from "../PlexUIProvider/internal";
|
|
6
|
+
import s from "./Card.module.css";
|
|
7
|
+
const hasHref = (props) => typeof props.href === "string";
|
|
8
|
+
const CardRoot = (props) => {
|
|
9
|
+
const { variant = "outline", size = "md", interactive, className, } = props;
|
|
10
|
+
const sharedProps = {
|
|
11
|
+
"className": clsx(s.Card, className),
|
|
12
|
+
"data-variant": variant,
|
|
13
|
+
"data-size": size,
|
|
14
|
+
"data-interactive": (interactive || hasHref(props)) ? "" : undefined,
|
|
15
|
+
};
|
|
16
|
+
if (hasHref(props)) {
|
|
17
|
+
const { variant: _v, size: _s, interactive: _i, className: _c, href, external, as: OverrideComponent, ref, ...restProps } = props;
|
|
18
|
+
const isExternal = external ?? /^https?:\/\//.test(href);
|
|
19
|
+
const DefaultLink = useLinkComponent();
|
|
20
|
+
const LinkComponent = OverrideComponent || (isExternal ? "a" : DefaultLink);
|
|
21
|
+
const linkAttrs = isExternal
|
|
22
|
+
? { target: "_blank", rel: "noopener noreferrer", href }
|
|
23
|
+
: { href };
|
|
24
|
+
return (_jsx(LinkComponent, { ref: ref, ...sharedProps, ...linkAttrs, ...restProps }));
|
|
25
|
+
}
|
|
26
|
+
const { variant: _v, size: _s, interactive: _i, className: _c, ref, ...restProps } = props;
|
|
27
|
+
return _jsx("div", { ref: ref, ...sharedProps, ...restProps });
|
|
28
|
+
};
|
|
29
|
+
const CardHeader = ({ className, ref, ...restProps }) => (_jsx("div", { ref: ref, className: clsx(s.Header, className), ...restProps }));
|
|
30
|
+
const CardTitle = ({ className, ref, ...restProps }) => (_jsx("h3", { ref: ref, className: clsx(s.Title, className), ...restProps }));
|
|
31
|
+
const CardDescription = ({ className, ref, ...restProps }) => (_jsx("p", { ref: ref, className: clsx(s.Description, className), ...restProps }));
|
|
32
|
+
const CardContent = ({ className, ref, ...restProps }) => (_jsx("div", { ref: ref, className: clsx(s.Content, className), ...restProps }));
|
|
33
|
+
const CardFooter = ({ className, ref, ...restProps }) => (_jsx("div", { ref: ref, className: clsx(s.Footer, className), ...restProps }));
|
|
34
|
+
const CardAction = ({ className, ref, ...restProps }) => (_jsx("div", { ref: ref, className: clsx(s.Action, className), ...restProps }));
|
|
35
|
+
export const Card = CardRoot;
|
|
36
|
+
Card.Header = CardHeader;
|
|
37
|
+
Card.Title = CardTitle;
|
|
38
|
+
Card.Description = CardDescription;
|
|
39
|
+
Card.Content = CardContent;
|
|
40
|
+
Card.Footer = CardFooter;
|
|
41
|
+
Card.Action = CardAction;
|
|
42
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAA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,CACvE,cAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,KAAM,SAAS,GAAI,CACxE,CAAA;AAED,MAAM,UAAU,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,SAAS,EAAiB,EAAE,EAAE,CAAC,CACtE,cAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,KAAM,SAAS,GAAI,CACvE,CAAA;AAED,MAAM,UAAU,GAAG,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,SAAS,EAAiB,EAAE,EAAE,CAAC,CACtE,cAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,KAAM,SAAS,GAAI,CACvE,CAAA;AAeD,MAAM,CAAC,MAAM,IAAI,GAAG,QAAyB,CAAA;AAC7C,IAAI,CAAC,MAAM,GAAG,UAAU,CAAA;AACxB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAA;AACtB,IAAI,CAAC,WAAW,GAAG,eAAe,CAAA;AAClC,IAAI,CAAC,OAAO,GAAG,WAAW,CAAA;AAC1B,IAAI,CAAC,MAAM,GAAG,UAAU,CAAA;AACxB,IAAI,CAAC,MAAM,GAAG,UAAU,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport {\n type AnchorHTMLAttributes,\n type ComponentProps,\n type ComponentType,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n} from \"react\"\nimport { useLinkComponent } from \"../PlexUIProvider/internal\"\nimport s from \"./Card.module.css\"\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport type CardVariant = \"outline\" | \"solid\" | \"ghost\"\nexport type CardSize = \"sm\" | \"md\" | \"lg\"\n\ntype CardCommonProps = {\n /**\n * Visual variant of the card.\n * - `\"outline\"` — 1px border, transparent background (default)\n * - `\"solid\"` — muted background, no border\n * - `\"ghost\"` — no border, no background (hover-only surface)\n * @default \"outline\"\n */\n variant?: CardVariant\n /**\n * Padding scale.\n * @default \"md\"\n */\n size?: CardSize\n /**\n * When true, adds hover/focus affordances. Automatic when `href` is provided.\n * @default false\n */\n interactive?: boolean\n /** Class applied to the card container */\n className?: string\n}\n\nexport type CardDivProps = CardCommonProps &\n Omit<HTMLAttributes<HTMLDivElement>, \"className\"> & {\n ref?: Ref<HTMLDivElement>\n }\n\nexport type CardLinkProps<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T extends ComponentType<any> | \"a\" = \"a\",\n> = CardCommonProps &\n Omit<AnchorHTMLAttributes<HTMLAnchorElement>, \"className\" | \"href\"> & {\n /** When provided, the Card renders as a link. */\n href: string\n /** Explicitly flag as external — otherwise detected from `href`. */\n external?: boolean\n /** Override the rendered link component (e.g. next/link). */\n as?: T\n ref?: Ref<HTMLAnchorElement>\n } & ComponentProps<T>\n\nexport type CardProps = CardDivProps | CardLinkProps\n\nconst hasHref = (props: CardProps): props is CardLinkProps =>\n typeof (props as CardLinkProps).href === \"string\"\n\nconst CardRoot = (props: CardProps): ReactNode => {\n const {\n variant = \"outline\",\n size = \"md\",\n interactive,\n className,\n } = props as CardCommonProps\n\n const sharedProps = {\n \"className\": clsx(s.Card, className),\n \"data-variant\": variant,\n \"data-size\": size,\n \"data-interactive\":\n (interactive || hasHref(props)) ? \"\" : undefined,\n }\n\n if (hasHref(props)) {\n const {\n variant: _v,\n size: _s,\n interactive: _i,\n className: _c,\n href,\n external,\n as: OverrideComponent,\n ref,\n ...restProps\n } = props\n const isExternal = external ?? /^https?:\\/\\//.test(href)\n const DefaultLink = useLinkComponent()\n const LinkComponent = OverrideComponent || (isExternal ? \"a\" : DefaultLink)\n const linkAttrs = isExternal\n ? { target: \"_blank\", rel: \"noopener noreferrer\", href }\n : { href }\n\n return (\n <LinkComponent ref={ref} {...sharedProps} {...linkAttrs} {...restProps} />\n )\n }\n\n const {\n variant: _v,\n size: _s,\n interactive: _i,\n className: _c,\n ref,\n ...restProps\n } = props as CardDivProps\n\n return <div ref={ref} {...sharedProps} {...restProps} />\n}\n\n/* ------------------------------------------------------------------ */\n/* Compound parts */\n/* ------------------------------------------------------------------ */\n\nexport type CardSlotProps = HTMLAttributes<HTMLDivElement> & { ref?: Ref<HTMLDivElement> }\n\nconst CardHeader = ({ className, ref, ...restProps }: CardSlotProps) => (\n <div ref={ref} className={clsx(s.Header, className)} {...restProps} />\n)\n\nconst CardTitle = ({\n className,\n ref,\n ...restProps\n}: HTMLAttributes<HTMLHeadingElement> & { ref?: Ref<HTMLHeadingElement> }) => (\n <h3 ref={ref} className={clsx(s.Title, className)} {...restProps} />\n)\n\nconst CardDescription = ({\n className,\n ref,\n ...restProps\n}: HTMLAttributes<HTMLParagraphElement> & { ref?: Ref<HTMLParagraphElement> }) => (\n <p ref={ref} className={clsx(s.Description, className)} {...restProps} />\n)\n\nconst CardContent = ({ className, ref, ...restProps }: CardSlotProps) => (\n <div ref={ref} className={clsx(s.Content, className)} {...restProps} />\n)\n\nconst CardFooter = ({ className, ref, ...restProps }: CardSlotProps) => (\n <div ref={ref} className={clsx(s.Footer, className)} {...restProps} />\n)\n\nconst CardAction = ({ className, ref, ...restProps }: CardSlotProps) => (\n <div ref={ref} className={clsx(s.Action, className)} {...restProps} />\n)\n\n/* ------------------------------------------------------------------ */\n/* Export — compound API */\n/* ------------------------------------------------------------------ */\n\ntype CardComponent = typeof CardRoot & {\n Header: typeof CardHeader\n Title: typeof CardTitle\n Description: typeof CardDescription\n Content: typeof CardContent\n Footer: typeof CardFooter\n Action: typeof CardAction\n}\n\nexport const Card = CardRoot as CardComponent\nCard.Header = CardHeader\nCard.Title = CardTitle\nCard.Description = CardDescription\nCard.Content = CardContent\nCard.Footer = CardFooter\nCard.Action = CardAction\n"]}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
@layer components {.Card {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--card-gap);
|
|
5
|
+
width: 100%;
|
|
6
|
+
min-width: 0;
|
|
7
|
+
padding: var(--card-padding);
|
|
8
|
+
border-radius: var(--card-radius);
|
|
9
|
+
background: var(--card-background);
|
|
10
|
+
color: var(--card-text-color);
|
|
11
|
+
box-shadow: 0 0 0 1px var(--card-border-color) inset;
|
|
12
|
+
font-size: var(--card-font-size);
|
|
13
|
+
line-height: var(--font-text-sm-line-height);
|
|
14
|
+
transition-duration: var(--transition-duration-basic);
|
|
15
|
+
transition-property: background-color, box-shadow, border-color;
|
|
16
|
+
transition-timing-function: var(--transition-ease-basic);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* When used as a link, flatten anchor defaults */
|
|
20
|
+
.Card:where(a) {
|
|
21
|
+
color: inherit;
|
|
22
|
+
text-decoration: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* =============================================
|
|
26
|
+
Interactive
|
|
27
|
+
============================================= */
|
|
28
|
+
.Card:where([data-interactive]) {
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.Card:where([data-interactive]):hover {
|
|
33
|
+
--card-background: var(--card-background-hover);
|
|
34
|
+
--card-border-color: var(--card-border-color-hover);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.Card:where([data-interactive]):focus-visible {
|
|
38
|
+
outline: 2px solid var(--color-ring);
|
|
39
|
+
outline-offset: 2px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* =============================================
|
|
43
|
+
Sizes
|
|
44
|
+
============================================= */
|
|
45
|
+
.Card:where([data-size="sm"]) {
|
|
46
|
+
--card-padding: calc(var(--spacing) * 4);
|
|
47
|
+
--card-gap: calc(var(--spacing) * 3);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.Card:where([data-size="md"]) {
|
|
51
|
+
--card-padding: calc(var(--spacing) * 5);
|
|
52
|
+
--card-gap: calc(var(--spacing) * 4);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.Card:where([data-size="lg"]) {
|
|
56
|
+
--card-padding: calc(var(--spacing) * 6);
|
|
57
|
+
--card-gap: calc(var(--spacing) * 5);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* =============================================
|
|
61
|
+
Variants
|
|
62
|
+
============================================= */
|
|
63
|
+
.Card:where([data-variant="outline"]) {
|
|
64
|
+
--card-background: var(--color-surface);
|
|
65
|
+
--card-border-color: var(--color-border);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.Card:where([data-variant="solid"]) {
|
|
69
|
+
--card-background: var(--color-surface-secondary);
|
|
70
|
+
--card-border-color: transparent;
|
|
71
|
+
box-shadow: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.Card:where([data-variant="ghost"]) {
|
|
75
|
+
--card-background: transparent;
|
|
76
|
+
--card-border-color: transparent;
|
|
77
|
+
box-shadow: none;
|
|
78
|
+
padding: 0;
|
|
79
|
+
}/* ================================================
|
|
80
|
+
Header — stacked title + description
|
|
81
|
+
================================================ */.Header {
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
position: relative;
|
|
85
|
+
min-width: 0;
|
|
86
|
+
}.Title {
|
|
87
|
+
margin: 0;
|
|
88
|
+
color: var(--card-title-color);
|
|
89
|
+
font-size: var(--card-title-font-size);
|
|
90
|
+
font-weight: var(--card-title-font-weight);
|
|
91
|
+
line-height: var(--font-heading-xs-line-height);
|
|
92
|
+
letter-spacing: var(--font-heading-xs-tracking);
|
|
93
|
+
text-wrap: balance;
|
|
94
|
+
}.Description {
|
|
95
|
+
margin: 0;
|
|
96
|
+
color: var(--card-description-color);
|
|
97
|
+
font-size: var(--card-description-font-size);
|
|
98
|
+
line-height: var(--font-text-sm-line-height);
|
|
99
|
+
text-wrap: pretty;
|
|
100
|
+
}/* ================================================
|
|
101
|
+
Content — primary body
|
|
102
|
+
================================================ */.Content {
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-direction: column;
|
|
105
|
+
gap: calc(var(--spacing) * 3);
|
|
106
|
+
min-width: 0;
|
|
107
|
+
}/* ================================================
|
|
108
|
+
Footer — aligned actions
|
|
109
|
+
================================================ */.Footer {
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
gap: calc(var(--spacing) * 2);
|
|
113
|
+
min-width: 0;
|
|
114
|
+
margin-top: calc(var(--spacing) * 3);
|
|
115
|
+
}/* ================================================
|
|
116
|
+
Action — top-right slot in Header
|
|
117
|
+
================================================ */.Action {
|
|
118
|
+
position: absolute;
|
|
119
|
+
top: 0;
|
|
120
|
+
right: 0;
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
gap: calc(var(--spacing) * 1);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Card/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,GAKL,MAAM,QAAQ,CAAA","sourcesContent":["export {\n Card,\n type CardProps,\n type CardSlotProps,\n type CardVariant,\n type CardSize,\n} from \"./Card\"\n"]}
|
|
@@ -53,10 +53,11 @@
|
|
|
53
53
|
--badge-background-color: var(--color-background-danger-soft);
|
|
54
54
|
--badge-text-color: var(--color-text-danger-soft);
|
|
55
55
|
}.Title {
|
|
56
|
-
max-width: 90%;
|
|
57
56
|
color: var(--color-text);
|
|
58
|
-
font-size:
|
|
57
|
+
font-size: var(--font-heading-xs-size);
|
|
59
58
|
font-weight: var(--font-weight-semibold);
|
|
59
|
+
line-height: 1.25;
|
|
60
|
+
letter-spacing: var(--font-heading-xs-tracking);
|
|
60
61
|
text-align: center;
|
|
61
62
|
text-wrap: balance;
|
|
62
63
|
}
|
|
@@ -68,13 +69,12 @@
|
|
|
68
69
|
.Title:where([data-color="warning"]) {
|
|
69
70
|
color: var(--color-text-warning);
|
|
70
71
|
}.Description {
|
|
71
|
-
max-width: 90%;
|
|
72
72
|
margin: 0;
|
|
73
|
-
color: var(--color-text-
|
|
74
|
-
font-size:
|
|
75
|
-
line-height:
|
|
73
|
+
color: var(--color-text-tertiary);
|
|
74
|
+
font-size: var(--font-text-sm-size);
|
|
75
|
+
line-height: var(--font-text-sm-line-height);
|
|
76
76
|
text-align: center;
|
|
77
|
-
text-wrap:
|
|
77
|
+
text-wrap: pretty;
|
|
78
78
|
}.ActionRow {
|
|
79
79
|
margin-top: calc(var(--spacing) * 4);
|
|
80
80
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import {} from "react";
|
|
5
|
+
import { Separator as RadixSeparator } from "radix-ui";
|
|
6
|
+
import s from "./Separator.module.css";
|
|
7
|
+
export const Separator = ({ orientation = "horizontal", decorative = true, className, ...restProps }) => {
|
|
8
|
+
return (_jsx(RadixSeparator.Root, { orientation: orientation, decorative: decorative, className: clsx(s.Separator, className), ...restProps }));
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=Separator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Separator.js","sourceRoot":"","sources":["../../../../src/components/Separator/Separator.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAuB,MAAM,OAAO,CAAA;AAC3C,OAAO,EAAE,SAAS,IAAI,cAAc,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,CAAC,MAAM,wBAAwB,CAAA;AAqBtC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EACxB,WAAW,GAAG,YAAY,EAC1B,UAAU,GAAG,IAAI,EACjB,SAAS,EACT,GAAG,SAAS,EACG,EAAE,EAAE;IACnB,OAAO,CACL,KAAC,cAAc,CAAC,IAAI,IAClB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,KACnC,SAAS,GACb,CACH,CAAA;AACH,CAAC,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport { type ComponentProps } from \"react\"\nimport { Separator as RadixSeparator } from \"radix-ui\"\nimport s from \"./Separator.module.css\"\n\nexport type SeparatorProps = Omit<\n ComponentProps<typeof RadixSeparator.Root>,\n \"children\"\n> & {\n /**\n * Direction of the separator.\n * @default horizontal\n */\n orientation?: \"horizontal\" | \"vertical\"\n /**\n * When `true`, the separator is ignored by assistive technologies.\n * Leave `true` for purely visual dividers; set `false` when the separator\n * conveys meaningful grouping (it will render with `role=\"separator\"`).\n * @default true\n */\n decorative?: boolean\n className?: string\n}\n\nexport const Separator = ({\n orientation = \"horizontal\",\n decorative = true,\n className,\n ...restProps\n}: SeparatorProps) => {\n return (\n <RadixSeparator.Root\n orientation={orientation}\n decorative={decorative}\n className={clsx(s.Separator, className)}\n {...restProps}\n />\n )\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@layer components {.Separator {
|
|
2
|
+
flex-shrink: 0;
|
|
3
|
+
background: var(--separator-color);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.Separator[data-orientation="horizontal"] {
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: var(--separator-thickness);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.Separator[data-orientation="vertical"] {
|
|
12
|
+
width: var(--separator-thickness);
|
|
13
|
+
height: 100%;
|
|
14
|
+
min-height: 1em;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Separator/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAuB,MAAM,aAAa,CAAA","sourcesContent":["export { Separator, type SeparatorProps } from \"./Separator\"\n"]}
|
|
@@ -86,6 +86,27 @@
|
|
|
86
86
|
--button-gap-lg: 6px;
|
|
87
87
|
--button-font-weight: var(--font-weight-medium);
|
|
88
88
|
|
|
89
|
+
/* =============================================
|
|
90
|
+
Card
|
|
91
|
+
============================================= */
|
|
92
|
+
--card-radius: var(--radius-xl);
|
|
93
|
+
--card-background: var(--color-surface);
|
|
94
|
+
--card-background-hover: var(--color-surface-secondary);
|
|
95
|
+
--card-border-color: var(--color-border);
|
|
96
|
+
--card-border-color-hover: var(--color-border-primary-outline-hover);
|
|
97
|
+
--card-text-color: var(--color-text);
|
|
98
|
+
--card-font-size: var(--font-text-sm-size);
|
|
99
|
+
--card-title-color: var(--color-text);
|
|
100
|
+
--card-title-font-size: var(--font-heading-xs-size);
|
|
101
|
+
--card-title-font-weight: var(--font-weight-semibold);
|
|
102
|
+
--card-description-color: var(--color-text-tertiary);
|
|
103
|
+
--card-description-font-size: var(--font-text-sm-size);
|
|
104
|
+
|
|
105
|
+
/* =============================================
|
|
106
|
+
Separator
|
|
107
|
+
============================================= */
|
|
108
|
+
--separator-color: var(--color-border);
|
|
109
|
+
--separator-thickness: 1px;
|
|
89
110
|
|
|
90
111
|
/* =============================================
|
|
91
112
|
Checkbox
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type AnchorHTMLAttributes, type ComponentProps, type ComponentType, type HTMLAttributes, type ReactNode, type Ref } from "react";
|
|
2
|
+
export type CardVariant = "outline" | "solid" | "ghost";
|
|
3
|
+
export type CardSize = "sm" | "md" | "lg";
|
|
4
|
+
type CardCommonProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Visual variant of the card.
|
|
7
|
+
* - `"outline"` — 1px border, transparent background (default)
|
|
8
|
+
* - `"solid"` — muted background, no border
|
|
9
|
+
* - `"ghost"` — no border, no background (hover-only surface)
|
|
10
|
+
* @default "outline"
|
|
11
|
+
*/
|
|
12
|
+
variant?: CardVariant;
|
|
13
|
+
/**
|
|
14
|
+
* Padding scale.
|
|
15
|
+
* @default "md"
|
|
16
|
+
*/
|
|
17
|
+
size?: CardSize;
|
|
18
|
+
/**
|
|
19
|
+
* When true, adds hover/focus affordances. Automatic when `href` is provided.
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
interactive?: boolean;
|
|
23
|
+
/** Class applied to the card container */
|
|
24
|
+
className?: string;
|
|
25
|
+
};
|
|
26
|
+
export type CardDivProps = CardCommonProps & Omit<HTMLAttributes<HTMLDivElement>, "className"> & {
|
|
27
|
+
ref?: Ref<HTMLDivElement>;
|
|
28
|
+
};
|
|
29
|
+
export type CardLinkProps<T extends ComponentType<any> | "a" = "a"> = CardCommonProps & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "className" | "href"> & {
|
|
30
|
+
/** When provided, the Card renders as a link. */
|
|
31
|
+
href: string;
|
|
32
|
+
/** Explicitly flag as external — otherwise detected from `href`. */
|
|
33
|
+
external?: boolean;
|
|
34
|
+
/** Override the rendered link component (e.g. next/link). */
|
|
35
|
+
as?: T;
|
|
36
|
+
ref?: Ref<HTMLAnchorElement>;
|
|
37
|
+
} & ComponentProps<T>;
|
|
38
|
+
export type CardProps = CardDivProps | CardLinkProps;
|
|
39
|
+
declare const CardRoot: (props: CardProps) => ReactNode;
|
|
40
|
+
export type CardSlotProps = HTMLAttributes<HTMLDivElement> & {
|
|
41
|
+
ref?: Ref<HTMLDivElement>;
|
|
42
|
+
};
|
|
43
|
+
declare const CardHeader: ({ className, ref, ...restProps }: CardSlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
declare const CardTitle: ({ className, ref, ...restProps }: HTMLAttributes<HTMLHeadingElement> & {
|
|
45
|
+
ref?: Ref<HTMLHeadingElement>;
|
|
46
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
declare const CardDescription: ({ className, ref, ...restProps }: HTMLAttributes<HTMLParagraphElement> & {
|
|
48
|
+
ref?: Ref<HTMLParagraphElement>;
|
|
49
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
declare const CardContent: ({ className, ref, ...restProps }: CardSlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
declare const CardFooter: ({ className, ref, ...restProps }: CardSlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
declare const CardAction: ({ className, ref, ...restProps }: CardSlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
type CardComponent = typeof CardRoot & {
|
|
54
|
+
Header: typeof CardHeader;
|
|
55
|
+
Title: typeof CardTitle;
|
|
56
|
+
Description: typeof CardDescription;
|
|
57
|
+
Content: typeof CardContent;
|
|
58
|
+
Footer: typeof CardFooter;
|
|
59
|
+
Action: typeof CardAction;
|
|
60
|
+
};
|
|
61
|
+
export declare const Card: CardComponent;
|
|
62
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Card, type CardProps, type CardSlotProps, type CardVariant, type CardSize, } from "./Card";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ComponentProps } from "react";
|
|
2
|
+
import { Separator as RadixSeparator } from "radix-ui";
|
|
3
|
+
export type SeparatorProps = Omit<ComponentProps<typeof RadixSeparator.Root>, "children"> & {
|
|
4
|
+
/**
|
|
5
|
+
* Direction of the separator.
|
|
6
|
+
* @default horizontal
|
|
7
|
+
*/
|
|
8
|
+
orientation?: "horizontal" | "vertical";
|
|
9
|
+
/**
|
|
10
|
+
* When `true`, the separator is ignored by assistive technologies.
|
|
11
|
+
* Leave `true` for purely visual dividers; set `false` when the separator
|
|
12
|
+
* conveys meaningful grouping (it will render with `role="separator"`).
|
|
13
|
+
* @default true
|
|
14
|
+
*/
|
|
15
|
+
decorative?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare const Separator: ({ orientation, decorative, className, ...restProps }: SeparatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Separator, type SeparatorProps } from "./Separator";
|