@zentauri-ui/zentauri-components 1.4.6 → 1.4.51
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/README.md +1 -63
- package/cli/registry.json +1 -2
- package/dist/ui/search/search-suggestion-list.d.ts.map +1 -1
- package/dist/ui/search.js +6 -10
- package/dist/ui/search.js.map +1 -1
- package/dist/ui/search.mjs +6 -10
- package/dist/ui/search.mjs.map +1 -1
- package/package.json +1 -1
- package/src/ui/search/search-bar.tsx +1 -1
- package/src/ui/search/search-suggestion-list.tsx +6 -14
- package/dist/ui/typography/blockquote-base.d.ts +0 -6
- package/dist/ui/typography/blockquote-base.d.ts.map +0 -1
- package/dist/ui/typography/blockquote.d.ts +0 -6
- package/dist/ui/typography/blockquote.d.ts.map +0 -1
- package/dist/ui/typography/code-block-base.d.ts +0 -6
- package/dist/ui/typography/code-block-base.d.ts.map +0 -1
- package/dist/ui/typography/code-block.d.ts +0 -6
- package/dist/ui/typography/code-block.d.ts.map +0 -1
- package/dist/ui/typography/heading-base.d.ts +0 -6
- package/dist/ui/typography/heading-base.d.ts.map +0 -1
- package/dist/ui/typography/heading.d.ts +0 -6
- package/dist/ui/typography/heading.d.ts.map +0 -1
- package/dist/ui/typography/index.d.ts +0 -9
- package/dist/ui/typography/index.d.ts.map +0 -1
- package/dist/ui/typography/inline-code-base.d.ts +0 -6
- package/dist/ui/typography/inline-code-base.d.ts.map +0 -1
- package/dist/ui/typography/inline-code.d.ts +0 -6
- package/dist/ui/typography/inline-code.d.ts.map +0 -1
- package/dist/ui/typography/list-base.d.ts +0 -10
- package/dist/ui/typography/list-base.d.ts.map +0 -1
- package/dist/ui/typography/list.d.ts +0 -12
- package/dist/ui/typography/list.d.ts.map +0 -1
- package/dist/ui/typography/text-base.d.ts +0 -6
- package/dist/ui/typography/text-base.d.ts.map +0 -1
- package/dist/ui/typography/text.d.ts +0 -6
- package/dist/ui/typography/text.d.ts.map +0 -1
- package/dist/ui/typography/types.d.ts +0 -56
- package/dist/ui/typography/types.d.ts.map +0 -1
- package/dist/ui/typography/variants.d.ts +0 -16
- package/dist/ui/typography/variants.d.ts.map +0 -1
- package/dist/ui/typography.js +0 -334
- package/dist/ui/typography.js.map +0 -1
- package/dist/ui/typography.mjs +0 -321
- package/dist/ui/typography.mjs.map +0 -1
- package/src/ui/typography/blockquote-base.tsx +0 -39
- package/src/ui/typography/blockquote.tsx +0 -8
- package/src/ui/typography/code-block-base.tsx +0 -37
- package/src/ui/typography/code-block.tsx +0 -8
- package/src/ui/typography/heading-base.tsx +0 -59
- package/src/ui/typography/heading.tsx +0 -8
- package/src/ui/typography/index.ts +0 -28
- package/src/ui/typography/inline-code-base.tsx +0 -27
- package/src/ui/typography/inline-code.tsx +0 -8
- package/src/ui/typography/list-base.tsx +0 -88
- package/src/ui/typography/list.tsx +0 -15
- package/src/ui/typography/text-base.tsx +0 -43
- package/src/ui/typography/text.tsx +0 -8
- package/src/ui/typography/types.ts +0 -90
- package/src/ui/typography/typography.test.tsx +0 -80
- package/src/ui/typography/variants.ts +0 -72
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/typography/variants.ts","../../src/ui/typography/heading-base.tsx","../../src/ui/typography/heading.tsx","../../src/ui/typography/text-base.tsx","../../src/ui/typography/text.tsx","../../src/ui/typography/list-base.tsx","../../src/ui/typography/list.tsx","../../src/ui/typography/blockquote-base.tsx","../../src/ui/typography/blockquote.tsx","../../src/ui/typography/inline-code-base.tsx","../../src/ui/typography/inline-code.tsx","../../src/ui/typography/code-block-base.tsx","../../src/ui/typography/code-block.tsx"],"names":["jsx","tone","className","children","ref","ordered","marker","rest"],"mappings":";;;;AAGO,IAAM,sBAAA,GAAyB,IAAI,EAAA,EAAI;AAAA,EAC5C,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,OAAA,EAAS,+BAAA;AAAA,MACT,KAAA,EAAO,gCAAA;AAAA,MACP,OAAA,EAAS,kCA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AAY,QAAA,GAAW,CAAA,aAAA,EAAgB,QAAQ,CAAA,CAAA,CAAA,GAAM,aAAA;AAE3D,EAAA,uBACEA,GAAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,GAAA;AAAA,MACA,WAAA,EAAU,uBAAA;AAAA,MACV,YAAA,EAAY,SAAA;AAAA,MACZ,SAAA,EAAW,EAAA;AAAA,QACT,sBAAA,CAAuB,EAAE,IAAA,EAAM,CAAA;AAAA,QAC/B,gIAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG,IAAA;AAAA,MAEJ,QAAA,kBAAAA,GAAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,2BAA2B,QAAA,EAAS;AAAA;AAAA,GACtD;AAEN,CAAA;AAEA,aAAA,CAAc,WAAA,GAAc,WAAA;ACjCrB,IAAM,SAAA,GAAY,CAAC,KAAA,KAA0B;AAClD,EAAA,uBAAOA,GAAAA,CAAC,aAAA,EAAA,EAAe,GAAG,KAAA,EAAO,CAAA;AACnC;AAEA,SAAA,CAAU,WAAA,GAAc,WAAA","file":"typography.mjs","sourcesContent":["import { cva } from \"class-variance-authority\";\n\n/** Semantic text colors aligned with slate/cyan/violet accents used across the kit (dark-first). */\nexport const typographyToneVariants = cva(\"\", {\n variants: {\n tone: {\n default: \"text-slate-50 border-white/15\",\n muted: \"text-slate-400 border-white/15\",\n primary: \"text-cyan-300 border-cyan-300/40\",\n secondary: \"text-slate-300 border-white/15\",\n accent: \"text-violet-300 border-violet-300/40\",\n destructive: \"text-rose-400 border-rose-300/40\",\n info: \"text-sky-300 border-sky-300/40\",\n success: \"text-emerald-300 border-emerald-300/40\",\n warning: \"text-amber-300 border-amber-300/40\",\n error: \"text-red-300 border-red-300/40\",\n \"gradient-pink-violet\": \"bg-linear-to-r from-pink-400 to-violet-400 bg-clip-text text-transparent w-fit\",\n \"gradient-cyan-violet\": \"bg-linear-to-r from-cyan-400 to-violet-400 bg-clip-text text-transparent w-fit\",\n \"gradient-cyan-blue\": \"bg-linear-to-r from-cyan-400 to-blue-400 bg-clip-text text-transparent w-fit\",\n \"gradient-cyan-green\": \"bg-linear-to-r from-cyan-400 to-green-400 bg-clip-text text-transparent w-fit\",\n \"gradient-cyan-orange\": \"bg-linear-to-r from-cyan-400 to-orange-400 bg-clip-text text-transparent w-fit\",\n \"gradient-cyan-red\": \"bg-linear-to-r from-cyan-400 to-red-400 bg-clip-text text-transparent w-fit\",\n \"gradient-cyan-purple\": \"bg-linear-to-r from-cyan-400 to-purple-400 bg-clip-text text-transparent w-fit\",\n \"gradient-cyan-pink\": \"bg-linear-to-r from-cyan-400 to-pink-400 bg-clip-text text-transparent w-fit\",\n },\n },\n defaultVariants: {\n tone: \"default\",\n },\n});\n\nexport const headingLevelVariants = cva(\"scroll-m-20\", {\n variants: {\n level: {\n 1: \"text-4xl font-bold tracking-tight md:text-5xl\",\n 2: \"text-3xl font-semibold tracking-tight\",\n 3: \"text-2xl font-semibold tracking-tight\",\n 4: \"text-xl font-semibold tracking-tight\",\n 5: \"text-lg font-medium\",\n 6: \"text-base font-medium\",\n },\n },\n});\n\nexport const textSizeVariants = cva(\"\", {\n variants: {\n size: {\n sm: \"text-sm leading-relaxed\",\n base: \"text-base leading-relaxed\",\n lg: \"text-lg leading-relaxed\",\n },\n },\n defaultVariants: {\n size: \"base\",\n },\n});\n\n/** Marker style for unordered lists; ignored when `ordered` is true (decimal numbering). */\nexport const unorderedListMarkerVariants = cva(\"space-y-2 pl-5\", {\n variants: {\n marker: {\n disc: \"list-disc\",\n circle: \"[list-style-type:circle]\",\n none: \"list-none pl-0\",\n },\n },\n defaultVariants: {\n marker: \"disc\",\n },\n});\n\nexport const orderedListVariants = cva(\"list-decimal space-y-2 pl-5\");\n","import { forwardRef } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nimport type { HeadingProps } from \"./types\";\nimport {\n headingLevelVariants,\n typographyToneVariants,\n} from \"./variants\";\n\nconst HEADING_TAGS = {\n 1: \"h1\",\n 2: \"h2\",\n 3: \"h3\",\n 4: \"h4\",\n 5: \"h5\",\n 6: \"h6\",\n} as const;\n\nexport const HeadingBase = (props: HeadingProps) => {\n const {\n level,\n displayLevel,\n tone,\n bold,\n italic,\n underline,\n strikethrough,\n ref,\n className,\n children,\n ...rest\n } = props;\n\n const Tag = HEADING_TAGS[level];\n const scale = displayLevel ?? level;\n\n return (\n <Tag\n ref={ref}\n data-slot=\"typography-heading\"\n data-level={level}\n className={cn(\n typographyToneVariants({ tone }),\n headingLevelVariants({ level: scale }),\n bold && \"font-bold\",\n italic && \"italic\",\n underline && \"underline underline-offset-4\",\n strikethrough && \"line-through\",\n className,\n )}\n {...rest}\n >\n {children}\n </Tag>\n );\n};\n\nHeadingBase.displayName = \"Heading\";\n","import { HeadingBase } from \"./heading-base\";\nimport type { HeadingProps } from \"./types\";\n\nexport const Heading = (props: HeadingProps) => {\n return <HeadingBase {...props} />;\n};\n\nHeading.displayName = \"Heading\";\n","import { cn } from \"../../lib/utils\";\n\nimport type { TextProps } from \"./types\";\nimport { textSizeVariants, typographyToneVariants } from \"./variants\";\n\nexport const TextBase = (props: TextProps) => {\n const {\n as = \"p\",\n size = \"base\",\n tone,\n bold,\n italic,\n underline,\n strikethrough,\n highlight,\n className,\n children,\n ...rest\n } = props;\n\n const Component = as;\n\n return (\n <Component\n data-slot=\"typography-text\"\n className={cn(\n typographyToneVariants({ tone }),\n textSizeVariants({ size }),\n bold && \"font-semibold\",\n italic && \"italic\",\n underline && \"underline underline-offset-2\",\n strikethrough && \"line-through\",\n highlight && \"rounded bg-amber-400/15 px-0.5\",\n className,\n )}\n {...rest}\n >\n {children}\n </Component>\n );\n};\n\nTextBase.displayName = \"Text\";\n","import { TextBase } from \"./text-base\";\nimport type { TextProps } from \"./types\";\n\nexport const Text = (props: TextProps) => {\n return <TextBase {...props} />;\n};\n\nText.displayName = \"Text\";\n","import { cn } from \"../../lib/utils\";\n\nimport type { ListProps, ListItemProps } from \"./types\";\nimport {\n orderedListVariants,\n typographyToneVariants,\n unorderedListMarkerVariants,\n} from \"./variants\";\n\nexport function ListBase(props: ListProps) {\n if (\"ordered\" in props && props.ordered === true) {\n const {\n tone,\n className,\n children,\n ref,\n ordered,\n marker,\n ...rest\n } = props;\n\n void ordered;\n void marker;\n\n return (\n <ol\n ref={ref}\n data-slot=\"typography-list\"\n data-list-type=\"ordered\"\n className={cn(\n typographyToneVariants({ tone }),\n orderedListVariants(),\n className,\n )}\n {...rest}\n >\n {children}\n </ol>\n );\n }\n\n const {\n marker = \"disc\",\n tone,\n className,\n children,\n ref,\n ordered,\n ...rest\n } = props;\n\n void ordered;\n\n return (\n <ul\n ref={ref}\n data-slot=\"typography-list\"\n data-list-type=\"unordered\"\n className={cn(\n typographyToneVariants({ tone }),\n unorderedListMarkerVariants({ marker }),\n className,\n )}\n {...rest}\n >\n {children}\n </ul>\n );\n}\n\nListBase.displayName = \"List\";\n\nexport function ListItemBase(props: ListItemProps) {\n const { className, children, ref, ...rest } = props;\n\n return (\n <li\n ref={ref}\n data-slot=\"typography-list-item\"\n className={cn(\"leading-relaxed\", className)}\n {...rest}\n >\n {children}\n </li>\n );\n}\n\nListItemBase.displayName = \"ListItem\";\n","import type { ListProps } from \"./types\";\n\nimport { ListBase, ListItemBase } from \"./list-base\";\n\nexport const ListItem = ListItemBase;\n\nfunction ListRoot(props: ListProps) {\n return <ListBase {...props} />;\n}\n\nexport const List = Object.assign(ListRoot, {\n Item: ListItem,\n});\n\nListRoot.displayName = \"List\";\n","import { forwardRef } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nimport type { BlockquoteProps } from \"./types\";\nimport { typographyToneVariants } from \"./variants\";\n\nexport const BlockquoteBase = (props: BlockquoteProps) => {\n const {\n tone,\n attribution,\n className,\n children,\n ref,\n ...rest\n } = props;\n\n return (\n <blockquote\n ref={ref}\n data-slot=\"typography-blockquote\"\n className={cn(\n typographyToneVariants({ tone }),\n \"border-l-4 py-1 pl-4 italic\",\n className,\n )}\n {...rest}\n >\n <div className=\"space-y-2 leading-relaxed\">{children}</div>\n {attribution ? (\n <footer className=\"mt-3 text-sm not-italic\">\n <cite>{attribution}</cite>\n </footer>\n ) : null}\n </blockquote>\n );\n};\n\nBlockquoteBase.displayName = \"Blockquote\";\n","import { BlockquoteBase } from \"./blockquote-base\";\nimport type { BlockquoteProps } from \"./types\";\n\nexport const Blockquote = (props: BlockquoteProps) => {\n return <BlockquoteBase {...props} />;\n};\n\nBlockquote.displayName = \"Blockquote\";\n","import { forwardRef } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nimport type { InlineCodeProps } from \"./types\";\nimport { typographyToneVariants } from \"./variants\";\n\nexport const InlineCodeBase = (props: InlineCodeProps) => {\n const { tone, className, children, ref, ...rest } = props;\n\n return (\n <code\n ref={ref}\n data-slot=\"typography-inline-code\"\n className={cn(\n typographyToneVariants({ tone }),\n \"rounded-md border border-white/10 bg-white/6 px-1.5 py-0.5 font-mono text-[0.925em] font-normal\",\n className,\n )}\n {...rest}\n >\n {children}\n </code>\n );\n};\n\nInlineCodeBase.displayName = \"InlineCode\";\n","import { InlineCodeBase } from \"./inline-code-base\";\nimport type { InlineCodeProps } from \"./types\";\n\nexport const InlineCode = (props: InlineCodeProps) => {\n return <InlineCodeBase {...props} />;\n};\n\nInlineCode.displayName = \"InlineCode\";\n","import { forwardRef } from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nimport type { CodeBlockProps } from \"./types\";\nimport { typographyToneVariants } from \"./variants\";\n\nexport const CodeBlockBase = (props: CodeBlockProps) => {\n const {\n tone,\n language,\n className,\n children,\n ref,\n ...rest\n } = props;\n\n const ariaLabel = language ? `Code sample (${language})` : \"Code sample\";\n\n return (\n <pre\n ref={ref}\n data-slot=\"typography-code-block\"\n aria-label={ariaLabel}\n className={cn(\n typographyToneVariants({ tone }),\n \"overflow-x-auto rounded-xl border border-white/10 bg-slate-950/80 p-4 text-sm leading-relaxed shadow-inner shadow-slate-950/40\",\n className,\n )}\n {...rest}\n >\n <code className=\"font-mono text-[0.95em]\">{children}</code>\n </pre>\n );\n};\n\nCodeBlockBase.displayName = \"CodeBlock\";\n","import { CodeBlockBase } from \"./code-block-base\";\nimport type { CodeBlockProps } from \"./types\";\n\nexport const CodeBlock = (props: CodeBlockProps) => {\n return <CodeBlockBase {...props} />;\n};\n\nCodeBlock.displayName = \"CodeBlock\";\n"]}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { forwardRef } from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
|
|
5
|
-
import type { BlockquoteProps } from "./types";
|
|
6
|
-
import { typographyToneVariants } from "./variants";
|
|
7
|
-
|
|
8
|
-
export const BlockquoteBase = (props: BlockquoteProps) => {
|
|
9
|
-
const {
|
|
10
|
-
tone,
|
|
11
|
-
attribution,
|
|
12
|
-
className,
|
|
13
|
-
children,
|
|
14
|
-
ref,
|
|
15
|
-
...rest
|
|
16
|
-
} = props;
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<blockquote
|
|
20
|
-
ref={ref}
|
|
21
|
-
data-slot="typography-blockquote"
|
|
22
|
-
className={cn(
|
|
23
|
-
typographyToneVariants({ tone }),
|
|
24
|
-
"border-l-4 py-1 pl-4 italic",
|
|
25
|
-
className,
|
|
26
|
-
)}
|
|
27
|
-
{...rest}
|
|
28
|
-
>
|
|
29
|
-
<div className="space-y-2 leading-relaxed">{children}</div>
|
|
30
|
-
{attribution ? (
|
|
31
|
-
<footer className="mt-3 text-sm not-italic">
|
|
32
|
-
<cite>{attribution}</cite>
|
|
33
|
-
</footer>
|
|
34
|
-
) : null}
|
|
35
|
-
</blockquote>
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
BlockquoteBase.displayName = "Blockquote";
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { forwardRef } from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
|
|
5
|
-
import type { CodeBlockProps } from "./types";
|
|
6
|
-
import { typographyToneVariants } from "./variants";
|
|
7
|
-
|
|
8
|
-
export const CodeBlockBase = (props: CodeBlockProps) => {
|
|
9
|
-
const {
|
|
10
|
-
tone,
|
|
11
|
-
language,
|
|
12
|
-
className,
|
|
13
|
-
children,
|
|
14
|
-
ref,
|
|
15
|
-
...rest
|
|
16
|
-
} = props;
|
|
17
|
-
|
|
18
|
-
const ariaLabel = language ? `Code sample (${language})` : "Code sample";
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<pre
|
|
22
|
-
ref={ref}
|
|
23
|
-
data-slot="typography-code-block"
|
|
24
|
-
aria-label={ariaLabel}
|
|
25
|
-
className={cn(
|
|
26
|
-
typographyToneVariants({ tone }),
|
|
27
|
-
"overflow-x-auto rounded-xl border border-white/10 bg-slate-950/80 p-4 text-sm leading-relaxed shadow-inner shadow-slate-950/40",
|
|
28
|
-
className,
|
|
29
|
-
)}
|
|
30
|
-
{...rest}
|
|
31
|
-
>
|
|
32
|
-
<code className="font-mono text-[0.95em]">{children}</code>
|
|
33
|
-
</pre>
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
CodeBlockBase.displayName = "CodeBlock";
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { forwardRef } from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
|
|
5
|
-
import type { HeadingProps } from "./types";
|
|
6
|
-
import {
|
|
7
|
-
headingLevelVariants,
|
|
8
|
-
typographyToneVariants,
|
|
9
|
-
} from "./variants";
|
|
10
|
-
|
|
11
|
-
const HEADING_TAGS = {
|
|
12
|
-
1: "h1",
|
|
13
|
-
2: "h2",
|
|
14
|
-
3: "h3",
|
|
15
|
-
4: "h4",
|
|
16
|
-
5: "h5",
|
|
17
|
-
6: "h6",
|
|
18
|
-
} as const;
|
|
19
|
-
|
|
20
|
-
export const HeadingBase = (props: HeadingProps) => {
|
|
21
|
-
const {
|
|
22
|
-
level,
|
|
23
|
-
displayLevel,
|
|
24
|
-
tone,
|
|
25
|
-
bold,
|
|
26
|
-
italic,
|
|
27
|
-
underline,
|
|
28
|
-
strikethrough,
|
|
29
|
-
ref,
|
|
30
|
-
className,
|
|
31
|
-
children,
|
|
32
|
-
...rest
|
|
33
|
-
} = props;
|
|
34
|
-
|
|
35
|
-
const Tag = HEADING_TAGS[level];
|
|
36
|
-
const scale = displayLevel ?? level;
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<Tag
|
|
40
|
-
ref={ref}
|
|
41
|
-
data-slot="typography-heading"
|
|
42
|
-
data-level={level}
|
|
43
|
-
className={cn(
|
|
44
|
-
typographyToneVariants({ tone }),
|
|
45
|
-
headingLevelVariants({ level: scale }),
|
|
46
|
-
bold && "font-bold",
|
|
47
|
-
italic && "italic",
|
|
48
|
-
underline && "underline underline-offset-4",
|
|
49
|
-
strikethrough && "line-through",
|
|
50
|
-
className,
|
|
51
|
-
)}
|
|
52
|
-
{...rest}
|
|
53
|
-
>
|
|
54
|
-
{children}
|
|
55
|
-
</Tag>
|
|
56
|
-
);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
HeadingBase.displayName = "Heading";
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export { Heading } from "./heading";
|
|
2
|
-
export { Text } from "./text";
|
|
3
|
-
export { List, ListItem } from "./list";
|
|
4
|
-
export { Blockquote } from "./blockquote";
|
|
5
|
-
export { InlineCode } from "./inline-code";
|
|
6
|
-
export { CodeBlock } from "./code-block";
|
|
7
|
-
|
|
8
|
-
export type {
|
|
9
|
-
BlockquoteProps,
|
|
10
|
-
CodeBlockProps,
|
|
11
|
-
HeadingLevel,
|
|
12
|
-
HeadingProps,
|
|
13
|
-
InlineCodeProps,
|
|
14
|
-
ListItemProps,
|
|
15
|
-
ListProps,
|
|
16
|
-
TextElement,
|
|
17
|
-
TextProps,
|
|
18
|
-
TypographyTone,
|
|
19
|
-
UnorderedMarker,
|
|
20
|
-
} from "./types";
|
|
21
|
-
|
|
22
|
-
export {
|
|
23
|
-
headingLevelVariants,
|
|
24
|
-
orderedListVariants,
|
|
25
|
-
textSizeVariants,
|
|
26
|
-
typographyToneVariants,
|
|
27
|
-
unorderedListMarkerVariants,
|
|
28
|
-
} from "./variants";
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { forwardRef } from "react";
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
|
|
5
|
-
import type { InlineCodeProps } from "./types";
|
|
6
|
-
import { typographyToneVariants } from "./variants";
|
|
7
|
-
|
|
8
|
-
export const InlineCodeBase = (props: InlineCodeProps) => {
|
|
9
|
-
const { tone, className, children, ref, ...rest } = props;
|
|
10
|
-
|
|
11
|
-
return (
|
|
12
|
-
<code
|
|
13
|
-
ref={ref}
|
|
14
|
-
data-slot="typography-inline-code"
|
|
15
|
-
className={cn(
|
|
16
|
-
typographyToneVariants({ tone }),
|
|
17
|
-
"rounded-md border border-white/10 bg-white/6 px-1.5 py-0.5 font-mono text-[0.925em] font-normal",
|
|
18
|
-
className,
|
|
19
|
-
)}
|
|
20
|
-
{...rest}
|
|
21
|
-
>
|
|
22
|
-
{children}
|
|
23
|
-
</code>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
InlineCodeBase.displayName = "InlineCode";
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { cn } from "../../lib/utils";
|
|
2
|
-
|
|
3
|
-
import type { ListProps, ListItemProps } from "./types";
|
|
4
|
-
import {
|
|
5
|
-
orderedListVariants,
|
|
6
|
-
typographyToneVariants,
|
|
7
|
-
unorderedListMarkerVariants,
|
|
8
|
-
} from "./variants";
|
|
9
|
-
|
|
10
|
-
export function ListBase(props: ListProps) {
|
|
11
|
-
if ("ordered" in props && props.ordered === true) {
|
|
12
|
-
const {
|
|
13
|
-
tone,
|
|
14
|
-
className,
|
|
15
|
-
children,
|
|
16
|
-
ref,
|
|
17
|
-
ordered,
|
|
18
|
-
marker,
|
|
19
|
-
...rest
|
|
20
|
-
} = props;
|
|
21
|
-
|
|
22
|
-
void ordered;
|
|
23
|
-
void marker;
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<ol
|
|
27
|
-
ref={ref}
|
|
28
|
-
data-slot="typography-list"
|
|
29
|
-
data-list-type="ordered"
|
|
30
|
-
className={cn(
|
|
31
|
-
typographyToneVariants({ tone }),
|
|
32
|
-
orderedListVariants(),
|
|
33
|
-
className,
|
|
34
|
-
)}
|
|
35
|
-
{...rest}
|
|
36
|
-
>
|
|
37
|
-
{children}
|
|
38
|
-
</ol>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const {
|
|
43
|
-
marker = "disc",
|
|
44
|
-
tone,
|
|
45
|
-
className,
|
|
46
|
-
children,
|
|
47
|
-
ref,
|
|
48
|
-
ordered,
|
|
49
|
-
...rest
|
|
50
|
-
} = props;
|
|
51
|
-
|
|
52
|
-
void ordered;
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<ul
|
|
56
|
-
ref={ref}
|
|
57
|
-
data-slot="typography-list"
|
|
58
|
-
data-list-type="unordered"
|
|
59
|
-
className={cn(
|
|
60
|
-
typographyToneVariants({ tone }),
|
|
61
|
-
unorderedListMarkerVariants({ marker }),
|
|
62
|
-
className,
|
|
63
|
-
)}
|
|
64
|
-
{...rest}
|
|
65
|
-
>
|
|
66
|
-
{children}
|
|
67
|
-
</ul>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
ListBase.displayName = "List";
|
|
72
|
-
|
|
73
|
-
export function ListItemBase(props: ListItemProps) {
|
|
74
|
-
const { className, children, ref, ...rest } = props;
|
|
75
|
-
|
|
76
|
-
return (
|
|
77
|
-
<li
|
|
78
|
-
ref={ref}
|
|
79
|
-
data-slot="typography-list-item"
|
|
80
|
-
className={cn("leading-relaxed", className)}
|
|
81
|
-
{...rest}
|
|
82
|
-
>
|
|
83
|
-
{children}
|
|
84
|
-
</li>
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
ListItemBase.displayName = "ListItem";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ListProps } from "./types";
|
|
2
|
-
|
|
3
|
-
import { ListBase, ListItemBase } from "./list-base";
|
|
4
|
-
|
|
5
|
-
export const ListItem = ListItemBase;
|
|
6
|
-
|
|
7
|
-
function ListRoot(props: ListProps) {
|
|
8
|
-
return <ListBase {...props} />;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const List = Object.assign(ListRoot, {
|
|
12
|
-
Item: ListItem,
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
ListRoot.displayName = "List";
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { cn } from "../../lib/utils";
|
|
2
|
-
|
|
3
|
-
import type { TextProps } from "./types";
|
|
4
|
-
import { textSizeVariants, typographyToneVariants } from "./variants";
|
|
5
|
-
|
|
6
|
-
export const TextBase = (props: TextProps) => {
|
|
7
|
-
const {
|
|
8
|
-
as = "p",
|
|
9
|
-
size = "base",
|
|
10
|
-
tone,
|
|
11
|
-
bold,
|
|
12
|
-
italic,
|
|
13
|
-
underline,
|
|
14
|
-
strikethrough,
|
|
15
|
-
highlight,
|
|
16
|
-
className,
|
|
17
|
-
children,
|
|
18
|
-
...rest
|
|
19
|
-
} = props;
|
|
20
|
-
|
|
21
|
-
const Component = as;
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<Component
|
|
25
|
-
data-slot="typography-text"
|
|
26
|
-
className={cn(
|
|
27
|
-
typographyToneVariants({ tone }),
|
|
28
|
-
textSizeVariants({ size }),
|
|
29
|
-
bold && "font-semibold",
|
|
30
|
-
italic && "italic",
|
|
31
|
-
underline && "underline underline-offset-2",
|
|
32
|
-
strikethrough && "line-through",
|
|
33
|
-
highlight && "rounded bg-amber-400/15 px-0.5",
|
|
34
|
-
className,
|
|
35
|
-
)}
|
|
36
|
-
{...rest}
|
|
37
|
-
>
|
|
38
|
-
{children}
|
|
39
|
-
</Component>
|
|
40
|
-
);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
TextBase.displayName = "Text";
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { VariantProps } from "class-variance-authority";
|
|
2
|
-
import type {
|
|
3
|
-
ComponentProps,
|
|
4
|
-
HTMLAttributes,
|
|
5
|
-
RefObject,
|
|
6
|
-
} from "react";
|
|
7
|
-
|
|
8
|
-
import type {
|
|
9
|
-
textSizeVariants,
|
|
10
|
-
typographyToneVariants,
|
|
11
|
-
unorderedListMarkerVariants,
|
|
12
|
-
} from "./variants";
|
|
13
|
-
|
|
14
|
-
export type TypographyTone = NonNullable<
|
|
15
|
-
VariantProps<typeof typographyToneVariants>["tone"]
|
|
16
|
-
>;
|
|
17
|
-
|
|
18
|
-
export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
19
|
-
|
|
20
|
-
export type HeadingProps = Omit<
|
|
21
|
-
ComponentProps<"h1">,
|
|
22
|
-
"color"
|
|
23
|
-
> & {
|
|
24
|
-
level: HeadingLevel;
|
|
25
|
-
/** Visual scale; defaults to `level`. */
|
|
26
|
-
displayLevel?: HeadingLevel;
|
|
27
|
-
tone?: TypographyTone;
|
|
28
|
-
bold?: boolean;
|
|
29
|
-
italic?: boolean;
|
|
30
|
-
underline?: boolean;
|
|
31
|
-
strikethrough?: boolean;
|
|
32
|
-
ref?: RefObject<HTMLHeadingElement>;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export type TextElement = "p" | "span" | "div" | "label";
|
|
36
|
-
|
|
37
|
-
export type TextProps = Omit<HTMLAttributes<HTMLElement>, "color"> & {
|
|
38
|
-
as?: TextElement;
|
|
39
|
-
size?: NonNullable<VariantProps<typeof textSizeVariants>["size"]>;
|
|
40
|
-
tone?: TypographyTone;
|
|
41
|
-
bold?: boolean;
|
|
42
|
-
italic?: boolean;
|
|
43
|
-
underline?: boolean;
|
|
44
|
-
strikethrough?: boolean;
|
|
45
|
-
highlight?: boolean;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export type UnorderedMarker = NonNullable<
|
|
49
|
-
VariantProps<typeof unorderedListMarkerVariants>["marker"]
|
|
50
|
-
>;
|
|
51
|
-
|
|
52
|
-
export type ListProps =
|
|
53
|
-
| (Omit<ComponentProps<"ul">, "color"> & {
|
|
54
|
-
ordered?: false;
|
|
55
|
-
marker?: UnorderedMarker;
|
|
56
|
-
tone?: TypographyTone;
|
|
57
|
-
})
|
|
58
|
-
| (Omit<ComponentProps<"ol">, "color"> & {
|
|
59
|
-
ordered: true;
|
|
60
|
-
marker?: undefined;
|
|
61
|
-
tone?: TypographyTone;
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
export type ListItemProps = ComponentProps<"li"> & {
|
|
65
|
-
ref?: RefObject<HTMLLIElement>;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export type BlockquoteProps = ComponentProps<"blockquote"> & {
|
|
69
|
-
tone?: TypographyTone;
|
|
70
|
-
/** Attribution label shown in a footer (distinct from the HTML `cite` URL attribute). */
|
|
71
|
-
attribution?: string;
|
|
72
|
-
ref?: RefObject<HTMLQuoteElement>;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export type InlineCodeProps = Omit<
|
|
76
|
-
ComponentProps<"code">,
|
|
77
|
-
"color"
|
|
78
|
-
> & {
|
|
79
|
-
tone?: TypographyTone;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export type CodeBlockProps = Omit<
|
|
83
|
-
ComponentProps<"pre">,
|
|
84
|
-
"color"
|
|
85
|
-
> & {
|
|
86
|
-
tone?: TypographyTone;
|
|
87
|
-
/** Hint for stacked highlighting stacks / aria-labels. */
|
|
88
|
-
language?: string;
|
|
89
|
-
ref?: RefObject<HTMLPreElement>;
|
|
90
|
-
};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { render, screen } from "@testing-library/react";
|
|
2
|
-
import { describe, expect, it } from "vitest";
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
Blockquote,
|
|
6
|
-
CodeBlock,
|
|
7
|
-
Heading,
|
|
8
|
-
InlineCode,
|
|
9
|
-
List,
|
|
10
|
-
ListItem,
|
|
11
|
-
Text,
|
|
12
|
-
} from "./index";
|
|
13
|
-
|
|
14
|
-
describe("Typography primitives", () => {
|
|
15
|
-
it("should render Heading as the requested level with displayName", () => {
|
|
16
|
-
render(<Heading level={2}>Section</Heading>);
|
|
17
|
-
expect(
|
|
18
|
-
screen.getByRole("heading", { level: 2, name: "Section" }),
|
|
19
|
-
).toBeInTheDocument();
|
|
20
|
-
expect(Heading.displayName).toBe("Heading");
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it("should apply tone classes on Text", () => {
|
|
24
|
-
const { container } = render(
|
|
25
|
-
<Text tone="muted" data-testid="muted-text">
|
|
26
|
-
Body
|
|
27
|
-
</Text>,
|
|
28
|
-
);
|
|
29
|
-
const node = container.querySelector('[data-testid="muted-text"]');
|
|
30
|
-
expect(node?.className).toMatch(/text-slate-400/);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it("should render unordered List with list marker utilities", () => {
|
|
34
|
-
const { container } = render(
|
|
35
|
-
<List>
|
|
36
|
-
<ListItem>Alpha</ListItem>
|
|
37
|
-
</List>,
|
|
38
|
-
);
|
|
39
|
-
const ul = container.querySelector('[data-slot="typography-list"]');
|
|
40
|
-
expect(ul?.tagName).toBe("UL");
|
|
41
|
-
expect(ul?.className).toMatch(/list-disc/);
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it("should render ordered List as ol", () => {
|
|
45
|
-
const { container } = render(
|
|
46
|
-
<List ordered>
|
|
47
|
-
<ListItem>One</ListItem>
|
|
48
|
-
</List>,
|
|
49
|
-
);
|
|
50
|
-
const ol = container.querySelector('[data-slot="typography-list"]');
|
|
51
|
-
expect(ol?.tagName).toBe("OL");
|
|
52
|
-
expect(ol?.className).toMatch(/list-decimal/);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it("should render Blockquote with optional attribution footer", () => {
|
|
56
|
-
render(
|
|
57
|
-
<Blockquote attribution="Source">
|
|
58
|
-
<p>Quoted</p>
|
|
59
|
-
</Blockquote>,
|
|
60
|
-
);
|
|
61
|
-
expect(screen.getByText("Quoted")).toBeInTheDocument();
|
|
62
|
-
expect(screen.getByText("Source")).toBeInTheDocument();
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it("should render InlineCode with monospace styling token", () => {
|
|
66
|
-
const { container } = render(<InlineCode>npm i</InlineCode>);
|
|
67
|
-
const code = container.querySelector('[data-slot="typography-inline-code"]');
|
|
68
|
-
expect(code?.tagName).toBe("CODE");
|
|
69
|
-
expect(code?.className).toMatch(/font-mono/);
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it("should render CodeBlock with nested code element", () => {
|
|
73
|
-
const { container } = render(
|
|
74
|
-
<CodeBlock language="tsx">{`const x = 1;`}</CodeBlock>,
|
|
75
|
-
);
|
|
76
|
-
const pre = container.querySelector('[data-slot="typography-code-block"]');
|
|
77
|
-
expect(pre?.tagName).toBe("PRE");
|
|
78
|
-
expect(pre?.querySelector("code")?.textContent).toContain("const x");
|
|
79
|
-
});
|
|
80
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { cva } from "class-variance-authority";
|
|
2
|
-
|
|
3
|
-
/** Semantic text colors aligned with slate/cyan/violet accents used across the kit (dark-first). */
|
|
4
|
-
export const typographyToneVariants = cva("", {
|
|
5
|
-
variants: {
|
|
6
|
-
tone: {
|
|
7
|
-
default: "text-slate-50 border-white/15",
|
|
8
|
-
muted: "text-slate-400 border-white/15",
|
|
9
|
-
primary: "text-cyan-300 border-cyan-300/40",
|
|
10
|
-
secondary: "text-slate-300 border-white/15",
|
|
11
|
-
accent: "text-violet-300 border-violet-300/40",
|
|
12
|
-
destructive: "text-rose-400 border-rose-300/40",
|
|
13
|
-
info: "text-sky-300 border-sky-300/40",
|
|
14
|
-
success: "text-emerald-300 border-emerald-300/40",
|
|
15
|
-
warning: "text-amber-300 border-amber-300/40",
|
|
16
|
-
error: "text-red-300 border-red-300/40",
|
|
17
|
-
"gradient-pink-violet": "bg-linear-to-r from-pink-400 to-violet-400 bg-clip-text text-transparent w-fit",
|
|
18
|
-
"gradient-cyan-violet": "bg-linear-to-r from-cyan-400 to-violet-400 bg-clip-text text-transparent w-fit",
|
|
19
|
-
"gradient-cyan-blue": "bg-linear-to-r from-cyan-400 to-blue-400 bg-clip-text text-transparent w-fit",
|
|
20
|
-
"gradient-cyan-green": "bg-linear-to-r from-cyan-400 to-green-400 bg-clip-text text-transparent w-fit",
|
|
21
|
-
"gradient-cyan-orange": "bg-linear-to-r from-cyan-400 to-orange-400 bg-clip-text text-transparent w-fit",
|
|
22
|
-
"gradient-cyan-red": "bg-linear-to-r from-cyan-400 to-red-400 bg-clip-text text-transparent w-fit",
|
|
23
|
-
"gradient-cyan-purple": "bg-linear-to-r from-cyan-400 to-purple-400 bg-clip-text text-transparent w-fit",
|
|
24
|
-
"gradient-cyan-pink": "bg-linear-to-r from-cyan-400 to-pink-400 bg-clip-text text-transparent w-fit",
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
defaultVariants: {
|
|
28
|
-
tone: "default",
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export const headingLevelVariants = cva("scroll-m-20", {
|
|
33
|
-
variants: {
|
|
34
|
-
level: {
|
|
35
|
-
1: "text-4xl font-bold tracking-tight md:text-5xl",
|
|
36
|
-
2: "text-3xl font-semibold tracking-tight",
|
|
37
|
-
3: "text-2xl font-semibold tracking-tight",
|
|
38
|
-
4: "text-xl font-semibold tracking-tight",
|
|
39
|
-
5: "text-lg font-medium",
|
|
40
|
-
6: "text-base font-medium",
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
export const textSizeVariants = cva("", {
|
|
46
|
-
variants: {
|
|
47
|
-
size: {
|
|
48
|
-
sm: "text-sm leading-relaxed",
|
|
49
|
-
base: "text-base leading-relaxed",
|
|
50
|
-
lg: "text-lg leading-relaxed",
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
defaultVariants: {
|
|
54
|
-
size: "base",
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
/** Marker style for unordered lists; ignored when `ordered` is true (decimal numbering). */
|
|
59
|
-
export const unorderedListMarkerVariants = cva("space-y-2 pl-5", {
|
|
60
|
-
variants: {
|
|
61
|
-
marker: {
|
|
62
|
-
disc: "list-disc",
|
|
63
|
-
circle: "[list-style-type:circle]",
|
|
64
|
-
none: "list-none pl-0",
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
defaultVariants: {
|
|
68
|
-
marker: "disc",
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
export const orderedListVariants = cva("list-decimal space-y-2 pl-5");
|