@zentauri-ui/zentauri-components 1.4.4 → 1.4.6
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 +64 -1
- package/cli/registry.json +3 -1
- package/dist/ui/search/filter-search-suggestions.d.ts +15 -0
- package/dist/ui/search/filter-search-suggestions.d.ts.map +1 -0
- package/dist/ui/search/index.d.ts +7 -0
- package/dist/ui/search/index.d.ts.map +1 -0
- package/dist/ui/search/search-bar.d.ts +6 -0
- package/dist/ui/search/search-bar.d.ts.map +1 -0
- package/dist/ui/search/search-suggestion-list.d.ts +6 -0
- package/dist/ui/search/search-suggestion-list.d.ts.map +1 -0
- package/dist/ui/search/search-suggestion-utils.d.ts +6 -0
- package/dist/ui/search/search-suggestion-utils.d.ts.map +1 -0
- package/dist/ui/search/types.d.ts +44 -0
- package/dist/ui/search/types.d.ts.map +1 -0
- package/dist/ui/search.js +199 -0
- package/dist/ui/search.js.map +1 -0
- package/dist/ui/search.mjs +194 -0
- package/dist/ui/search.mjs.map +1 -0
- package/dist/ui/typography/blockquote-base.d.ts +6 -0
- package/dist/ui/typography/blockquote-base.d.ts.map +1 -0
- package/dist/ui/typography/blockquote.d.ts +6 -0
- package/dist/ui/typography/blockquote.d.ts.map +1 -0
- package/dist/ui/typography/code-block-base.d.ts +6 -0
- package/dist/ui/typography/code-block-base.d.ts.map +1 -0
- package/dist/ui/typography/code-block.d.ts +6 -0
- package/dist/ui/typography/code-block.d.ts.map +1 -0
- package/dist/ui/typography/heading-base.d.ts +6 -0
- package/dist/ui/typography/heading-base.d.ts.map +1 -0
- package/dist/ui/typography/heading.d.ts +6 -0
- package/dist/ui/typography/heading.d.ts.map +1 -0
- package/dist/ui/typography/index.d.ts +9 -0
- package/dist/ui/typography/index.d.ts.map +1 -0
- package/dist/ui/typography/inline-code-base.d.ts +6 -0
- package/dist/ui/typography/inline-code-base.d.ts.map +1 -0
- package/dist/ui/typography/inline-code.d.ts +6 -0
- package/dist/ui/typography/inline-code.d.ts.map +1 -0
- package/dist/ui/typography/list-base.d.ts +10 -0
- package/dist/ui/typography/list-base.d.ts.map +1 -0
- package/dist/ui/typography/list.d.ts +12 -0
- package/dist/ui/typography/list.d.ts.map +1 -0
- package/dist/ui/typography/text-base.d.ts +6 -0
- package/dist/ui/typography/text-base.d.ts.map +1 -0
- package/dist/ui/typography/text.d.ts +6 -0
- package/dist/ui/typography/text.d.ts.map +1 -0
- package/dist/ui/typography/types.d.ts +56 -0
- package/dist/ui/typography/types.d.ts.map +1 -0
- package/dist/ui/typography/variants.d.ts +16 -0
- package/dist/ui/typography/variants.d.ts.map +1 -0
- package/dist/ui/typography.js +334 -0
- package/dist/ui/typography.js.map +1 -0
- package/dist/ui/typography.mjs +321 -0
- package/dist/ui/typography.mjs.map +1 -0
- package/package.json +3 -3
- package/src/ui/search/filter-search-suggestions.test.ts +48 -0
- package/src/ui/search/filter-search-suggestions.ts +43 -0
- package/src/ui/search/index.ts +11 -0
- package/src/ui/search/search-bar.tsx +83 -0
- package/src/ui/search/search-suggestion-list.tsx +103 -0
- package/src/ui/search/search-suggestion-utils.test.ts +9 -0
- package/src/ui/search/search-suggestion-utils.ts +8 -0
- package/src/ui/search/types.ts +52 -0
- package/src/ui/typography/blockquote-base.tsx +39 -0
- package/src/ui/typography/blockquote.tsx +8 -0
- package/src/ui/typography/code-block-base.tsx +37 -0
- package/src/ui/typography/code-block.tsx +8 -0
- package/src/ui/typography/heading-base.tsx +59 -0
- package/src/ui/typography/heading.tsx +8 -0
- package/src/ui/typography/index.ts +28 -0
- package/src/ui/typography/inline-code-base.tsx +27 -0
- package/src/ui/typography/inline-code.tsx +8 -0
- package/src/ui/typography/list-base.tsx +88 -0
- package/src/ui/typography/list.tsx +15 -0
- package/src/ui/typography/text-base.tsx +43 -0
- package/src/ui/typography/text.tsx +8 -0
- package/src/ui/typography/types.ts +90 -0
- package/src/ui/typography/typography.test.tsx +80 -0
- package/src/ui/typography/variants.ts +72 -0
|
@@ -0,0 +1 @@
|
|
|
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":["cva","jsx","cn","tone","className","children","ref","ordered","marker","rest","jsxs"],"mappings":";;;;;;AAGO,IAAM,sBAAA,GAAyBA,2BAAI,EAAA,EAAI;AAAA,EAC5C,QAAA,EAAU;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,OAAA,EAAS,+BAAA;AAAA,MACT,KAAA,EAAO,gCAAA;AAAA,MACP,OAAA,EAAS,kCAAA;AAAA,MACT,SAAA,EAAW,gCAAA;AAAA,MACX,MAAA,EAAQ,sCAAA;AAAA,MACR,WAAA,EAAa,kCAAA;AAAA,MACb,IAAA,EAAM,gCAAA;AAAA,MACN,OAAA,EAAS,wCAAA;AAAA,MACT,OAAA,EAAS,oCAAA;AAAA,MACT,KAAA,EAAO,gCAAA;AAAA,MACP,sBAAA,EAAwB,gFAAA;AAAA,MACxB,sBAAA,EAAwB,gFAAA;AAAA,MACxB,oBAAA,EAAsB,8EAAA;AAAA,MACtB,qBAAA,EAAuB,+EAAA;AAAA,MACvB,sBAAA,EAAwB,gFAAA;AAAA,MACxB,mBAAA,EAAqB,6EAAA;AAAA,MACrB,sBAAA,EAAwB,gFAAA;AAAA,MACxB,oBAAA,EAAsB;AAAA;AACxB,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,IAAA,EAAM;AAAA;AAEV,CAAC;AAEM,IAAM,oBAAA,GAAuBA,2BAAI,aAAA,EAAe;AAAA,EACrD,QAAA,EAAU;AAAA,IACR,KAAA,EAAO;AAA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AAA;AACnC;AAEA,SAAA,CAAU,WAAA,GAAc,WAAA","file":"typography.js","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"]}
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from '../chunk-DFEZH7TC.mjs';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
var typographyToneVariants = cva("", {
|
|
7
|
+
variants: {
|
|
8
|
+
tone: {
|
|
9
|
+
default: "text-slate-50 border-white/15",
|
|
10
|
+
muted: "text-slate-400 border-white/15",
|
|
11
|
+
primary: "text-cyan-300 border-cyan-300/40",
|
|
12
|
+
secondary: "text-slate-300 border-white/15",
|
|
13
|
+
accent: "text-violet-300 border-violet-300/40",
|
|
14
|
+
destructive: "text-rose-400 border-rose-300/40",
|
|
15
|
+
info: "text-sky-300 border-sky-300/40",
|
|
16
|
+
success: "text-emerald-300 border-emerald-300/40",
|
|
17
|
+
warning: "text-amber-300 border-amber-300/40",
|
|
18
|
+
error: "text-red-300 border-red-300/40",
|
|
19
|
+
"gradient-pink-violet": "bg-linear-to-r from-pink-400 to-violet-400 bg-clip-text text-transparent w-fit",
|
|
20
|
+
"gradient-cyan-violet": "bg-linear-to-r from-cyan-400 to-violet-400 bg-clip-text text-transparent w-fit",
|
|
21
|
+
"gradient-cyan-blue": "bg-linear-to-r from-cyan-400 to-blue-400 bg-clip-text text-transparent w-fit",
|
|
22
|
+
"gradient-cyan-green": "bg-linear-to-r from-cyan-400 to-green-400 bg-clip-text text-transparent w-fit",
|
|
23
|
+
"gradient-cyan-orange": "bg-linear-to-r from-cyan-400 to-orange-400 bg-clip-text text-transparent w-fit",
|
|
24
|
+
"gradient-cyan-red": "bg-linear-to-r from-cyan-400 to-red-400 bg-clip-text text-transparent w-fit",
|
|
25
|
+
"gradient-cyan-purple": "bg-linear-to-r from-cyan-400 to-purple-400 bg-clip-text text-transparent w-fit",
|
|
26
|
+
"gradient-cyan-pink": "bg-linear-to-r from-cyan-400 to-pink-400 bg-clip-text text-transparent w-fit"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
tone: "default"
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
var headingLevelVariants = cva("scroll-m-20", {
|
|
34
|
+
variants: {
|
|
35
|
+
level: {
|
|
36
|
+
1: "text-4xl font-bold tracking-tight md:text-5xl",
|
|
37
|
+
2: "text-3xl font-semibold tracking-tight",
|
|
38
|
+
3: "text-2xl font-semibold tracking-tight",
|
|
39
|
+
4: "text-xl font-semibold tracking-tight",
|
|
40
|
+
5: "text-lg font-medium",
|
|
41
|
+
6: "text-base font-medium"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
var 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
|
+
var unorderedListMarkerVariants = cva("space-y-2 pl-5", {
|
|
58
|
+
variants: {
|
|
59
|
+
marker: {
|
|
60
|
+
disc: "list-disc",
|
|
61
|
+
circle: "[list-style-type:circle]",
|
|
62
|
+
none: "list-none pl-0"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
defaultVariants: {
|
|
66
|
+
marker: "disc"
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
var orderedListVariants = cva("list-decimal space-y-2 pl-5");
|
|
70
|
+
var HEADING_TAGS = {
|
|
71
|
+
1: "h1",
|
|
72
|
+
2: "h2",
|
|
73
|
+
3: "h3",
|
|
74
|
+
4: "h4",
|
|
75
|
+
5: "h5",
|
|
76
|
+
6: "h6"
|
|
77
|
+
};
|
|
78
|
+
var HeadingBase = (props) => {
|
|
79
|
+
const {
|
|
80
|
+
level,
|
|
81
|
+
displayLevel,
|
|
82
|
+
tone,
|
|
83
|
+
bold,
|
|
84
|
+
italic,
|
|
85
|
+
underline,
|
|
86
|
+
strikethrough,
|
|
87
|
+
ref,
|
|
88
|
+
className,
|
|
89
|
+
children,
|
|
90
|
+
...rest
|
|
91
|
+
} = props;
|
|
92
|
+
const Tag = HEADING_TAGS[level];
|
|
93
|
+
const scale = displayLevel ?? level;
|
|
94
|
+
return /* @__PURE__ */ jsx(
|
|
95
|
+
Tag,
|
|
96
|
+
{
|
|
97
|
+
ref,
|
|
98
|
+
"data-slot": "typography-heading",
|
|
99
|
+
"data-level": level,
|
|
100
|
+
className: cn(
|
|
101
|
+
typographyToneVariants({ tone }),
|
|
102
|
+
headingLevelVariants({ level: scale }),
|
|
103
|
+
bold && "font-bold",
|
|
104
|
+
italic && "italic",
|
|
105
|
+
underline && "underline underline-offset-4",
|
|
106
|
+
strikethrough && "line-through",
|
|
107
|
+
className
|
|
108
|
+
),
|
|
109
|
+
...rest,
|
|
110
|
+
children
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
HeadingBase.displayName = "Heading";
|
|
115
|
+
var Heading = (props) => {
|
|
116
|
+
return /* @__PURE__ */ jsx(HeadingBase, { ...props });
|
|
117
|
+
};
|
|
118
|
+
Heading.displayName = "Heading";
|
|
119
|
+
var TextBase = (props) => {
|
|
120
|
+
const {
|
|
121
|
+
as = "p",
|
|
122
|
+
size = "base",
|
|
123
|
+
tone,
|
|
124
|
+
bold,
|
|
125
|
+
italic,
|
|
126
|
+
underline,
|
|
127
|
+
strikethrough,
|
|
128
|
+
highlight,
|
|
129
|
+
className,
|
|
130
|
+
children,
|
|
131
|
+
...rest
|
|
132
|
+
} = props;
|
|
133
|
+
const Component = as;
|
|
134
|
+
return /* @__PURE__ */ jsx(
|
|
135
|
+
Component,
|
|
136
|
+
{
|
|
137
|
+
"data-slot": "typography-text",
|
|
138
|
+
className: cn(
|
|
139
|
+
typographyToneVariants({ tone }),
|
|
140
|
+
textSizeVariants({ size }),
|
|
141
|
+
bold && "font-semibold",
|
|
142
|
+
italic && "italic",
|
|
143
|
+
underline && "underline underline-offset-2",
|
|
144
|
+
strikethrough && "line-through",
|
|
145
|
+
highlight && "rounded bg-amber-400/15 px-0.5",
|
|
146
|
+
className
|
|
147
|
+
),
|
|
148
|
+
...rest,
|
|
149
|
+
children
|
|
150
|
+
}
|
|
151
|
+
);
|
|
152
|
+
};
|
|
153
|
+
TextBase.displayName = "Text";
|
|
154
|
+
var Text = (props) => {
|
|
155
|
+
return /* @__PURE__ */ jsx(TextBase, { ...props });
|
|
156
|
+
};
|
|
157
|
+
Text.displayName = "Text";
|
|
158
|
+
function ListBase(props) {
|
|
159
|
+
if ("ordered" in props && props.ordered === true) {
|
|
160
|
+
const {
|
|
161
|
+
tone: tone2,
|
|
162
|
+
className: className2,
|
|
163
|
+
children: children2,
|
|
164
|
+
ref: ref2,
|
|
165
|
+
ordered: ordered2,
|
|
166
|
+
marker: marker2,
|
|
167
|
+
...rest2
|
|
168
|
+
} = props;
|
|
169
|
+
return /* @__PURE__ */ jsx(
|
|
170
|
+
"ol",
|
|
171
|
+
{
|
|
172
|
+
ref: ref2,
|
|
173
|
+
"data-slot": "typography-list",
|
|
174
|
+
"data-list-type": "ordered",
|
|
175
|
+
className: cn(
|
|
176
|
+
typographyToneVariants({ tone: tone2 }),
|
|
177
|
+
orderedListVariants(),
|
|
178
|
+
className2
|
|
179
|
+
),
|
|
180
|
+
...rest2,
|
|
181
|
+
children: children2
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
const {
|
|
186
|
+
marker = "disc",
|
|
187
|
+
tone,
|
|
188
|
+
className,
|
|
189
|
+
children,
|
|
190
|
+
ref,
|
|
191
|
+
ordered,
|
|
192
|
+
...rest
|
|
193
|
+
} = props;
|
|
194
|
+
return /* @__PURE__ */ jsx(
|
|
195
|
+
"ul",
|
|
196
|
+
{
|
|
197
|
+
ref,
|
|
198
|
+
"data-slot": "typography-list",
|
|
199
|
+
"data-list-type": "unordered",
|
|
200
|
+
className: cn(
|
|
201
|
+
typographyToneVariants({ tone }),
|
|
202
|
+
unorderedListMarkerVariants({ marker }),
|
|
203
|
+
className
|
|
204
|
+
),
|
|
205
|
+
...rest,
|
|
206
|
+
children
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
ListBase.displayName = "List";
|
|
211
|
+
function ListItemBase(props) {
|
|
212
|
+
const { className, children, ref, ...rest } = props;
|
|
213
|
+
return /* @__PURE__ */ jsx(
|
|
214
|
+
"li",
|
|
215
|
+
{
|
|
216
|
+
ref,
|
|
217
|
+
"data-slot": "typography-list-item",
|
|
218
|
+
className: cn("leading-relaxed", className),
|
|
219
|
+
...rest,
|
|
220
|
+
children
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
ListItemBase.displayName = "ListItem";
|
|
225
|
+
var ListItem = ListItemBase;
|
|
226
|
+
function ListRoot(props) {
|
|
227
|
+
return /* @__PURE__ */ jsx(ListBase, { ...props });
|
|
228
|
+
}
|
|
229
|
+
var List = Object.assign(ListRoot, {
|
|
230
|
+
Item: ListItem
|
|
231
|
+
});
|
|
232
|
+
ListRoot.displayName = "List";
|
|
233
|
+
var BlockquoteBase = (props) => {
|
|
234
|
+
const {
|
|
235
|
+
tone,
|
|
236
|
+
attribution,
|
|
237
|
+
className,
|
|
238
|
+
children,
|
|
239
|
+
ref,
|
|
240
|
+
...rest
|
|
241
|
+
} = props;
|
|
242
|
+
return /* @__PURE__ */ jsxs(
|
|
243
|
+
"blockquote",
|
|
244
|
+
{
|
|
245
|
+
ref,
|
|
246
|
+
"data-slot": "typography-blockquote",
|
|
247
|
+
className: cn(
|
|
248
|
+
typographyToneVariants({ tone }),
|
|
249
|
+
"border-l-4 py-1 pl-4 italic",
|
|
250
|
+
className
|
|
251
|
+
),
|
|
252
|
+
...rest,
|
|
253
|
+
children: [
|
|
254
|
+
/* @__PURE__ */ jsx("div", { className: "space-y-2 leading-relaxed", children }),
|
|
255
|
+
attribution ? /* @__PURE__ */ jsx("footer", { className: "mt-3 text-sm not-italic", children: /* @__PURE__ */ jsx("cite", { children: attribution }) }) : null
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
);
|
|
259
|
+
};
|
|
260
|
+
BlockquoteBase.displayName = "Blockquote";
|
|
261
|
+
var Blockquote = (props) => {
|
|
262
|
+
return /* @__PURE__ */ jsx(BlockquoteBase, { ...props });
|
|
263
|
+
};
|
|
264
|
+
Blockquote.displayName = "Blockquote";
|
|
265
|
+
var InlineCodeBase = (props) => {
|
|
266
|
+
const { tone, className, children, ref, ...rest } = props;
|
|
267
|
+
return /* @__PURE__ */ jsx(
|
|
268
|
+
"code",
|
|
269
|
+
{
|
|
270
|
+
ref,
|
|
271
|
+
"data-slot": "typography-inline-code",
|
|
272
|
+
className: cn(
|
|
273
|
+
typographyToneVariants({ tone }),
|
|
274
|
+
"rounded-md border border-white/10 bg-white/6 px-1.5 py-0.5 font-mono text-[0.925em] font-normal",
|
|
275
|
+
className
|
|
276
|
+
),
|
|
277
|
+
...rest,
|
|
278
|
+
children
|
|
279
|
+
}
|
|
280
|
+
);
|
|
281
|
+
};
|
|
282
|
+
InlineCodeBase.displayName = "InlineCode";
|
|
283
|
+
var InlineCode = (props) => {
|
|
284
|
+
return /* @__PURE__ */ jsx(InlineCodeBase, { ...props });
|
|
285
|
+
};
|
|
286
|
+
InlineCode.displayName = "InlineCode";
|
|
287
|
+
var CodeBlockBase = (props) => {
|
|
288
|
+
const {
|
|
289
|
+
tone,
|
|
290
|
+
language,
|
|
291
|
+
className,
|
|
292
|
+
children,
|
|
293
|
+
ref,
|
|
294
|
+
...rest
|
|
295
|
+
} = props;
|
|
296
|
+
const ariaLabel = language ? `Code sample (${language})` : "Code sample";
|
|
297
|
+
return /* @__PURE__ */ jsx(
|
|
298
|
+
"pre",
|
|
299
|
+
{
|
|
300
|
+
ref,
|
|
301
|
+
"data-slot": "typography-code-block",
|
|
302
|
+
"aria-label": ariaLabel,
|
|
303
|
+
className: cn(
|
|
304
|
+
typographyToneVariants({ tone }),
|
|
305
|
+
"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",
|
|
306
|
+
className
|
|
307
|
+
),
|
|
308
|
+
...rest,
|
|
309
|
+
children: /* @__PURE__ */ jsx("code", { className: "font-mono text-[0.95em]", children })
|
|
310
|
+
}
|
|
311
|
+
);
|
|
312
|
+
};
|
|
313
|
+
CodeBlockBase.displayName = "CodeBlock";
|
|
314
|
+
var CodeBlock = (props) => {
|
|
315
|
+
return /* @__PURE__ */ jsx(CodeBlockBase, { ...props });
|
|
316
|
+
};
|
|
317
|
+
CodeBlock.displayName = "CodeBlock";
|
|
318
|
+
|
|
319
|
+
export { Blockquote, CodeBlock, Heading, InlineCode, List, ListItem, Text, headingLevelVariants, orderedListVariants, textSizeVariants, typographyToneVariants, unorderedListMarkerVariants };
|
|
320
|
+
//# sourceMappingURL=typography.mjs.map
|
|
321
|
+
//# sourceMappingURL=typography.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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,kCAAA;AAAA,MACT,SAAA,EAAW,gCAAA;AAAA,MACX,MAAA,EAAQ,sCAAA;AAAA,MACR,WAAA,EAAa,kCAAA;AAAA,MACb,IAAA,EAAM,gCAAA;AAAA,MACN,OAAA,EAAS,wCAAA;AAAA,MACT,OAAA,EAAS,oCAAA;AAAA,MACT,KAAA,EAAO,gCAAA;AAAA,MACP,sBAAA,EAAwB,gFAAA;AAAA,MACxB,sBAAA,EAAwB,gFAAA;AAAA,MACxB,oBAAA,EAAsB,8EAAA;AAAA,MACtB,qBAAA,EAAuB,+EAAA;AAAA,MACvB,s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,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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zentauri-ui/zentauri-components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.6",
|
|
4
4
|
"description": "React + Tailwind UI kit with ESM/CJS builds, per-entry exports, and a zentauri-components / zentauri-ui CLI to vendor UI or hook source into your app",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": ["dist", "src/ui", "src/lib", "src/hooks", "cli"],
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"test:watch": "vitest"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"react": "
|
|
49
|
-
"react-dom": "
|
|
48
|
+
"react": ">18",
|
|
49
|
+
"react-dom": ">18",
|
|
50
50
|
"class-variance-authority": "*",
|
|
51
51
|
"clsx": "*",
|
|
52
52
|
"tailwind-merge": "*",
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
|
|
3
|
+
import { filterSearchSuggestions } from "./filter-search-suggestions";
|
|
4
|
+
import type { SearchFilterable } from "./types";
|
|
5
|
+
|
|
6
|
+
const sampleItems: SearchFilterable[] = [
|
|
7
|
+
{ id: "1", label: "Installation", href: "/preview/installation", keywords: ["npm", "setup"] },
|
|
8
|
+
{ id: "2", label: "Modal", href: "/preview/components/modal" },
|
|
9
|
+
{ id: "3", label: "GitHub", href: "https://example.com/repo", keywords: ["github", "source"] },
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
describe("filterSearchSuggestions", () => {
|
|
13
|
+
it("returns empty list for whitespace-only query", () => {
|
|
14
|
+
expect(filterSearchSuggestions({ query: " ", items: sampleItems })).toEqual([]);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("returns empty list for empty query", () => {
|
|
18
|
+
expect(filterSearchSuggestions({ query: "", items: sampleItems })).toEqual([]);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("matches label case-insensitively", () => {
|
|
22
|
+
expect(filterSearchSuggestions({ query: "modal", items: sampleItems })).toEqual([
|
|
23
|
+
{ id: "2", label: "Modal", href: "/preview/components/modal" },
|
|
24
|
+
]);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("matches href substring", () => {
|
|
28
|
+
expect(filterSearchSuggestions({ query: "installation", items: sampleItems })).toEqual([
|
|
29
|
+
{ id: "1", label: "Installation", href: "/preview/installation", keywords: ["npm", "setup"] },
|
|
30
|
+
]);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("matches keywords", () => {
|
|
34
|
+
expect(filterSearchSuggestions({ query: "github", items: sampleItems })).toEqual([
|
|
35
|
+
{ id: "3", label: "GitHub", href: "https://example.com/repo", keywords: ["github", "source"] },
|
|
36
|
+
]);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("respects maxResults", () => {
|
|
40
|
+
const many: SearchFilterable[] = Array.from({ length: 30 }, (_, index) => ({
|
|
41
|
+
id: `x-${index}`,
|
|
42
|
+
label: `Item ${index}`,
|
|
43
|
+
href: `/x/${index}`,
|
|
44
|
+
keywords: ["alpha"],
|
|
45
|
+
}));
|
|
46
|
+
expect(filterSearchSuggestions({ query: "alpha", items: many, options: { maxResults: 5 } })).toHaveLength(5);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { SearchFilterable } from "./types";
|
|
2
|
+
|
|
3
|
+
export type FilterSearchSuggestionsOptions = {
|
|
4
|
+
/** Maximum number of matches returned. */
|
|
5
|
+
maxResults?: number;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Returns items whose label, description, href, or keywords contain the query (case-insensitive).
|
|
10
|
+
* Whitespace-only query matches no items.
|
|
11
|
+
*/
|
|
12
|
+
export function filterSearchSuggestions<T extends SearchFilterable>({
|
|
13
|
+
query,
|
|
14
|
+
items,
|
|
15
|
+
options = { maxResults: 20 },
|
|
16
|
+
}: {
|
|
17
|
+
query: string;
|
|
18
|
+
items: readonly T[];
|
|
19
|
+
options?: FilterSearchSuggestionsOptions;
|
|
20
|
+
}): T[] {
|
|
21
|
+
const maxResults = options.maxResults ?? 20;
|
|
22
|
+
const normalized = query.trim().toLowerCase();
|
|
23
|
+
if (!normalized) {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const matches: T[] = [];
|
|
28
|
+
for (const item of items) {
|
|
29
|
+
const isMatch =
|
|
30
|
+
item.label.toLowerCase().includes(normalized) ||
|
|
31
|
+
(item.description?.toLowerCase().includes(normalized)) ||
|
|
32
|
+
(item.href?.toLowerCase().includes(normalized)) ||
|
|
33
|
+
(item.keywords?.some((k) => k.toLowerCase().includes(normalized)));
|
|
34
|
+
|
|
35
|
+
if (isMatch) {
|
|
36
|
+
matches.push(item);
|
|
37
|
+
if (matches.length >= maxResults || maxResults <= 0) {
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return matches;
|
|
43
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { SearchBar } from "./search-bar";
|
|
2
|
+
export { SearchSuggestionList } from "./search-suggestion-list";
|
|
3
|
+
export { searchSuggestionOptionDomId } from "./search-suggestion-utils";
|
|
4
|
+
export { filterSearchSuggestions } from "./filter-search-suggestions";
|
|
5
|
+
export type {
|
|
6
|
+
SearchBarProps,
|
|
7
|
+
SearchSuggestionItem,
|
|
8
|
+
SearchSuggestionListProps,
|
|
9
|
+
SearchFilterable,
|
|
10
|
+
} from "./types";
|
|
11
|
+
export type { FilterSearchSuggestionsOptions } from "./filter-search-suggestions";
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "../../lib/utils";
|
|
6
|
+
import { inputVariants } from "../inputs/variants";
|
|
7
|
+
|
|
8
|
+
import type { SearchBarProps } from "./types";
|
|
9
|
+
|
|
10
|
+
export const SearchBar = function SearchBar(
|
|
11
|
+
{
|
|
12
|
+
value,
|
|
13
|
+
onValueChange,
|
|
14
|
+
leadingSlot,
|
|
15
|
+
className,
|
|
16
|
+
inputClassName,
|
|
17
|
+
appearance = "default",
|
|
18
|
+
inputSize = "md",
|
|
19
|
+
ring = true,
|
|
20
|
+
id,
|
|
21
|
+
onChange,
|
|
22
|
+
disabled,
|
|
23
|
+
type,
|
|
24
|
+
comboboxListboxId,
|
|
25
|
+
comboboxActiveOptionId,
|
|
26
|
+
comboboxExpanded,
|
|
27
|
+
ref,
|
|
28
|
+
...rest
|
|
29
|
+
}: SearchBarProps,
|
|
30
|
+
) {
|
|
31
|
+
const generatedId = useId();
|
|
32
|
+
const controlId = id ?? generatedId;
|
|
33
|
+
const combobox = Boolean(comboboxListboxId);
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<div
|
|
37
|
+
data-slot="search-bar"
|
|
38
|
+
className={cn("relative flex w-full min-w-0 items-center", className)}
|
|
39
|
+
>
|
|
40
|
+
{leadingSlot ? (
|
|
41
|
+
<span
|
|
42
|
+
className="pointer-events-none absolute left-3 top-1/2 z-1 flex -translate-y-1/2 text-slate-400 [&_svg]:size-4"
|
|
43
|
+
aria-hidden
|
|
44
|
+
>
|
|
45
|
+
{leadingSlot}
|
|
46
|
+
</span>
|
|
47
|
+
) : null}
|
|
48
|
+
<input
|
|
49
|
+
ref={ref}
|
|
50
|
+
id={controlId}
|
|
51
|
+
type={type ?? "search"}
|
|
52
|
+
autoComplete="off"
|
|
53
|
+
spellCheck={false}
|
|
54
|
+
disabled={disabled}
|
|
55
|
+
value={value}
|
|
56
|
+
data-slot="search-bar-input"
|
|
57
|
+
className={cn(
|
|
58
|
+
inputVariants({ appearance, size: inputSize, ring, as: "input" }),
|
|
59
|
+
leadingSlot ? "pl-10" : null,
|
|
60
|
+
inputClassName,
|
|
61
|
+
)}
|
|
62
|
+
onChange={(event) => {
|
|
63
|
+
onChange?.(event);
|
|
64
|
+
onValueChange?.(event.target.value);
|
|
65
|
+
}}
|
|
66
|
+
{...(combobox
|
|
67
|
+
? {
|
|
68
|
+
role: "combobox" as const,
|
|
69
|
+
"aria-autocomplete": "list" as const,
|
|
70
|
+
"aria-controls": comboboxListboxId,
|
|
71
|
+
"aria-expanded": comboboxExpanded ?? false,
|
|
72
|
+
...(comboboxActiveOptionId
|
|
73
|
+
? { "aria-activedescendant": comboboxActiveOptionId }
|
|
74
|
+
: {}),
|
|
75
|
+
}
|
|
76
|
+
: {})}
|
|
77
|
+
{...rest}
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
SearchBar.displayName = "SearchBar";
|