livemark 0.23.0 → 0.24.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/build/actions/changelog/build.js +4 -8
- package/build/actions/config/load.js +1 -1
- package/build/actions/config/load.unit.js +1 -1
- package/build/actions/target/build.js +2 -5
- package/build/commands/build.js +1 -1
- package/build/commands/escape.js +1 -1
- package/build/commands/preview.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/components/Abbr.js +2 -2
- package/build/components/Article.js +2 -2
- package/build/components/BlogIndex.js +2 -4
- package/build/components/Callout.js +1 -1
- package/build/components/ChangelogIndex.js +1 -1
- package/build/components/CodeBlock.js +3 -5
- package/build/components/CodeTabs.js +1 -1
- package/build/components/Columns.js +2 -4
- package/build/components/Content.js +2 -2
- package/build/components/ContentTab.js +1 -1
- package/build/components/ContentTabs.js +1 -1
- package/build/components/DefinitionList.js +1 -1
- package/build/components/FileTree.js +1 -1
- package/build/components/FootnoteRef.js +2 -2
- package/build/components/InlineToc.js +1 -1
- package/build/components/Layout.js +1 -1
- package/build/components/LinkButton.js +1 -1
- package/build/components/Mermaid.js +1 -1
- package/build/components/PackageTabs.js +2 -2
- package/build/components/PageToolbar.js +2 -2
- package/build/components/PrevNext.js +3 -7
- package/build/components/SearchDialog.js +1 -1
- package/build/components/SectionHeader.js +1 -1
- package/build/components/Sidebar.js +2 -2
- package/build/components/SidebarArticles.js +2 -2
- package/build/components/SidebarLinks.js +2 -2
- package/build/components/TagIndex.js +2 -4
- package/build/components/Toc.js +1 -1
- package/build/content/article.js +1 -1
- package/build/content-collections.js +2 -4
- package/build/elements/alert-dialog.js +4 -4
- package/build/elements/alert.js +1 -1
- package/build/elements/avatar.d.ts +1 -1
- package/build/elements/avatar.js +2 -2
- package/build/elements/badge.js +1 -1
- package/build/elements/breadcrumb.js +1 -1
- package/build/elements/button-group.d.ts +1 -1
- package/build/elements/button-group.js +2 -2
- package/build/elements/calendar.js +4 -4
- package/build/elements/carousel.js +1 -1
- package/build/elements/chart.js +4 -14
- package/build/elements/collapsible.js +3 -3
- package/build/elements/command.js +1 -1
- package/build/elements/context-menu.js +4 -4
- package/build/elements/dialog.js +1 -1
- package/build/elements/direction.d.ts +1 -1
- package/build/elements/direction.js +2 -2
- package/build/elements/drawer.js +1 -1
- package/build/elements/dropdown-menu.js +2 -2
- package/build/elements/empty.d.ts +1 -1
- package/build/elements/empty.js +2 -2
- package/build/elements/field.js +1 -1
- package/build/elements/hover-card.js +2 -2
- package/build/elements/input-group.js +1 -1
- package/build/elements/item.js +1 -1
- package/build/elements/menubar.js +1 -1
- package/build/elements/native-select.js +1 -1
- package/build/elements/navigation-menu.js +1 -1
- package/build/elements/pagination.js +2 -2
- package/build/elements/popover.js +1 -1
- package/build/elements/progress.d.ts +1 -1
- package/build/elements/progress.js +2 -2
- package/build/elements/resizable.js +2 -2
- package/build/elements/scroll-area.js +1 -1
- package/build/elements/select.js +1 -1
- package/build/elements/sheet.js +1 -1
- package/build/elements/sidebar.js +2 -3
- package/build/elements/table.js +1 -1
- package/build/elements/toggle-group.js +1 -1
- package/build/elements/tooltip.js +1 -1
- package/build/helpers/changelog-source.js +1 -1
- package/build/helpers/dynamic-icon-resolver.js +1 -1
- package/build/helpers/resolve-asset-path.unit.js +1 -1
- package/build/helpers/resolve-base.unit.js +2 -2
- package/build/helpers/resolve-includes.js +2 -2
- package/build/helpers/resolve-includes.unit.js +1 -1
- package/build/helpers/rss.js +2 -4
- package/build/helpers/rss.unit.js +1 -1
- package/build/helpers/section.js +2 -3
- package/build/helpers/section.unit.js +4 -13
- package/build/helpers/toc.unit.js +2 -4
- package/build/plugins/rehype-inline-code.js +2 -2
- package/build/plugins/rehype-task-list-a11y.js +1 -1
- package/build/plugins/remark-abbr.js +2 -4
- package/build/plugins/remark-ansi.js +2 -4
- package/build/plugins/remark-ansi.unit.js +1 -1
- package/build/plugins/remark-badge.js +2 -4
- package/build/plugins/remark-button.unit.js +1 -1
- package/build/plugins/remark-callout.js +1 -1
- package/build/plugins/remark-card.js +1 -1
- package/build/plugins/remark-code-tabs.js +4 -8
- package/build/plugins/remark-columns.js +1 -1
- package/build/plugins/remark-custom-heading-id.unit.js +1 -1
- package/build/plugins/remark-deflist.js +1 -1
- package/build/plugins/remark-details.js +2 -4
- package/build/plugins/remark-filetree.js +1 -1
- package/build/plugins/remark-filetree.unit.js +1 -1
- package/build/plugins/remark-media.js +3 -7
- package/build/plugins/remark-media.unit.js +1 -1
- package/build/plugins/remark-steps.unit.js +1 -1
- package/build/plugins/remark-tab.js +4 -2
- package/build/plugins/remark-tab.unit.js +3 -7
- package/build/plugins/remark-toc.unit.js +1 -1
- package/build/plugins/shiki-icon.js +1 -1
- package/build/plugins/shiki-line-highlight.js +1 -1
- package/build/plugins/vite-livemark.js +1 -1
- package/build/plugins/vite-robots.js +1 -1
- package/build/plugins/vite-robots.unit.js +1 -1
- package/build/routes/$.js +1 -1
- package/build/vite.config.js +3 -8
- package/package.json +2 -2
- package/skills/configuration/SKILL.md +1 -3
- package/source/actions/changelog/build.ts +4 -20
- package/source/actions/config/load.ts +1 -3
- package/source/actions/config/load.unit.ts +2 -7
- package/source/actions/target/build.ts +1 -4
- package/source/commands/build.ts +1 -7
- package/source/commands/escape.ts +3 -8
- package/source/commands/preview.ts +1 -7
- package/source/commands/start.ts +1 -7
- package/source/components/Abbr.tsx +1 -5
- package/source/components/Article.tsx +1 -5
- package/source/components/BlogIndex.tsx +3 -9
- package/source/components/Callout.tsx +1 -6
- package/source/components/ChangelogIndex.tsx +1 -3
- package/source/components/CodeBlock.tsx +4 -14
- package/source/components/CodeTabs.tsx +1 -3
- package/source/components/Columns.tsx +1 -3
- package/source/components/Content.tsx +1 -5
- package/source/components/ContentTab.tsx +1 -4
- package/source/components/ContentTabs.tsx +3 -10
- package/source/components/DefinitionList.tsx +1 -4
- package/source/components/FileTree.tsx +1 -5
- package/source/components/FootnoteRef.tsx +1 -5
- package/source/components/InlineToc.tsx +1 -4
- package/source/components/Layout.tsx +3 -10
- package/source/components/LinkButton.tsx +1 -7
- package/source/components/Mermaid.tsx +1 -3
- package/source/components/PackageTabs.tsx +1 -5
- package/source/components/PageToolbar.tsx +1 -5
- package/source/components/PrevNext.tsx +2 -6
- package/source/components/SearchDialog.tsx +2 -6
- package/source/components/SectionHeader.tsx +1 -7
- package/source/components/Sidebar.tsx +2 -7
- package/source/components/SidebarArticles.tsx +4 -20
- package/source/components/SidebarLinks.tsx +2 -6
- package/source/components/TagIndex.tsx +3 -9
- package/source/components/Toc.tsx +2 -7
- package/source/content/article.ts +1 -2
- package/source/content-collections.ts +2 -5
- package/source/elements/alert-dialog.tsx +7 -29
- package/source/elements/alert.tsx +1 -4
- package/source/elements/avatar.tsx +4 -20
- package/source/elements/badge.tsx +2 -4
- package/source/elements/breadcrumb.tsx +3 -13
- package/source/elements/button-group.tsx +1 -6
- package/source/elements/calendar.tsx +6 -23
- package/source/elements/carousel.tsx +3 -10
- package/source/elements/chart.tsx +8 -33
- package/source/elements/collapsible.tsx +2 -6
- package/source/elements/command.tsx +3 -12
- package/source/elements/context-menu.tsx +7 -24
- package/source/elements/dialog.tsx +3 -13
- package/source/elements/direction.tsx +1 -4
- package/source/elements/drawer.tsx +3 -9
- package/source/elements/dropdown-menu.tsx +4 -18
- package/source/elements/empty.tsx +2 -12
- package/source/elements/field.tsx +2 -6
- package/source/elements/hover-card.tsx +1 -3
- package/source/elements/input-group.tsx +14 -27
- package/source/elements/item.tsx +3 -12
- package/source/elements/menubar.tsx +4 -13
- package/source/elements/native-select.tsx +3 -14
- package/source/elements/navigation-menu.tsx +1 -4
- package/source/elements/pagination.tsx +3 -13
- package/source/elements/popover.tsx +1 -4
- package/source/elements/progress.tsx +3 -15
- package/source/elements/resizable.tsx +3 -11
- package/source/elements/scroll-area.tsx +1 -5
- package/source/elements/select.tsx +3 -13
- package/source/elements/sheet.tsx +2 -9
- package/source/elements/sidebar.tsx +6 -24
- package/source/elements/table.tsx +3 -12
- package/source/elements/toggle-group.tsx +1 -3
- package/source/elements/tooltip.tsx +2 -9
- package/source/helpers/changelog-source.ts +1 -3
- package/source/helpers/dynamic-icon-resolver.tsx +1 -4
- package/source/helpers/resolve-asset-path.unit.ts +6 -12
- package/source/helpers/resolve-base.unit.ts +1 -2
- package/source/helpers/resolve-includes.ts +2 -8
- package/source/helpers/resolve-includes.unit.ts +9 -36
- package/source/helpers/rss.ts +3 -9
- package/source/helpers/rss.unit.ts +1 -3
- package/source/helpers/section.ts +1 -4
- package/source/helpers/section.unit.ts +5 -18
- package/source/helpers/toc.unit.ts +1 -3
- package/source/plugins/rehype-inline-code.ts +5 -21
- package/source/plugins/rehype-task-list-a11y.ts +1 -2
- package/source/plugins/remark-abbr.ts +1 -3
- package/source/plugins/remark-ansi.ts +2 -5
- package/source/plugins/remark-ansi.unit.ts +6 -18
- package/source/plugins/remark-badge.ts +1 -3
- package/source/plugins/remark-button.unit.ts +3 -9
- package/source/plugins/remark-callout.ts +35 -40
- package/source/plugins/remark-card.ts +25 -29
- package/source/plugins/remark-code-tabs.ts +3 -7
- package/source/plugins/remark-columns.ts +13 -17
- package/source/plugins/remark-custom-heading-id.unit.ts +2 -6
- package/source/plugins/remark-deflist.ts +1 -2
- package/source/plugins/remark-details.ts +28 -34
- package/source/plugins/remark-filetree.ts +28 -34
- package/source/plugins/remark-filetree.unit.ts +1 -4
- package/source/plugins/remark-media.ts +2 -6
- package/source/plugins/remark-media.unit.ts +2 -6
- package/source/plugins/remark-steps.unit.ts +2 -7
- package/source/plugins/remark-tab.ts +26 -30
- package/source/plugins/remark-tab.unit.ts +2 -6
- package/source/plugins/remark-toc.unit.ts +1 -3
- package/source/plugins/shiki-icon.ts +1 -4
- package/source/plugins/shiki-line-highlight.ts +4 -11
- package/source/plugins/vite-livemark.ts +3 -10
- package/source/plugins/vite-robots.ts +1 -6
- package/source/plugins/vite-robots.unit.ts +1 -3
- package/source/routes/$.tsx +1 -3
- package/source/styles/general.css +1 -5
- package/source/vite.config.ts +2 -7
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { config } from "livemark:virtual"
|
|
2
2
|
import { Link, useLocation } from "@tanstack/react-router"
|
|
3
3
|
import { ChevronRight } from "lucide-react"
|
|
4
|
-
import {
|
|
5
|
-
articleTree,
|
|
6
|
-
currentSection,
|
|
7
|
-
sectionArticleTrees,
|
|
8
|
-
} from "../content/article.ts"
|
|
4
|
+
import { articleTree, currentSection, sectionArticleTrees } from "../content/article.ts"
|
|
9
5
|
import {
|
|
10
6
|
Collapsible,
|
|
11
7
|
CollapsibleContent,
|
|
@@ -61,11 +57,7 @@ function isActive(articlePathname: string, currentPath: string) {
|
|
|
61
57
|
return articlePathname === normalized
|
|
62
58
|
}
|
|
63
59
|
|
|
64
|
-
function NavNode(props: {
|
|
65
|
-
node: ArticleNode
|
|
66
|
-
currentPath: string
|
|
67
|
-
depth?: number
|
|
68
|
-
}) {
|
|
60
|
+
function NavNode(props: { node: ArticleNode; currentPath: string; depth?: number }) {
|
|
69
61
|
const { node, currentPath, depth = 0 } = props
|
|
70
62
|
const Icon = resolveArticleIcon(node.icon)
|
|
71
63
|
const active = isActive(node.path, currentPath)
|
|
@@ -79,11 +71,7 @@ function NavNode(props: {
|
|
|
79
71
|
if (node.children.length === 0) {
|
|
80
72
|
return (
|
|
81
73
|
<Item>
|
|
82
|
-
<Button
|
|
83
|
-
isActive={active}
|
|
84
|
-
className={active ? "" : "opacity-75"}
|
|
85
|
-
render={link}
|
|
86
|
-
>
|
|
74
|
+
<Button isActive={active} className={active ? "" : "opacity-75"} render={link}>
|
|
87
75
|
{!isSub && Icon && <Icon className="size-4" />}
|
|
88
76
|
{label}
|
|
89
77
|
</Button>
|
|
@@ -94,11 +82,7 @@ function NavNode(props: {
|
|
|
94
82
|
return (
|
|
95
83
|
<Item>
|
|
96
84
|
<Collapsible defaultOpen className="group/collapsible">
|
|
97
|
-
<Button
|
|
98
|
-
isActive={active}
|
|
99
|
-
className={active ? "" : "opacity-75"}
|
|
100
|
-
render={link}
|
|
101
|
-
>
|
|
85
|
+
<Button isActive={active} className={active ? "" : "opacity-75"} render={link}>
|
|
102
86
|
{!isSub && Icon && <Icon className="size-4" />}
|
|
103
87
|
{label}
|
|
104
88
|
</Button>
|
|
@@ -19,9 +19,7 @@ export function SidebarLinks() {
|
|
|
19
19
|
const pathname = useLocation({ select: l => l.pathname })
|
|
20
20
|
const section = currentSection(`/${pathname.replace(/^\/|\/$/g, "")}/`)
|
|
21
21
|
const links =
|
|
22
|
-
config.links?.filter(
|
|
23
|
-
link => !link.prefix || link.prefix === section?.prefix,
|
|
24
|
-
) ?? []
|
|
22
|
+
config.links?.filter(link => !link.prefix || link.prefix === section?.prefix) ?? []
|
|
25
23
|
|
|
26
24
|
if (!links.length) return null
|
|
27
25
|
const hasDesktopItems = links.some(l => l.position === "sidebar")
|
|
@@ -44,9 +42,7 @@ export function SidebarLinks() {
|
|
|
44
42
|
className="text-muted-foreground"
|
|
45
43
|
render={<a href={prefixUrl(link.url, config.base)} />}
|
|
46
44
|
>
|
|
47
|
-
{link.icon &&
|
|
48
|
-
<DynamicIcon name={link.icon} className="size-4" />
|
|
49
|
-
)}
|
|
45
|
+
{link.icon && <DynamicIcon name={link.icon} className="size-4" />}
|
|
50
46
|
<span>{link.title}</span>
|
|
51
47
|
</SidebarMenuButton>
|
|
52
48
|
</SidebarMenuItem>
|
|
@@ -30,9 +30,7 @@ export function TagIndex(props: { sectionPrefix: string; tag: string }) {
|
|
|
30
30
|
const parts = [`## ${post.title}`]
|
|
31
31
|
if (post.date) parts.push(formatDate(post.date))
|
|
32
32
|
if (post.author) {
|
|
33
|
-
parts.push(
|
|
34
|
-
Array.isArray(post.author) ? post.author.join(", ") : post.author,
|
|
35
|
-
)
|
|
33
|
+
parts.push(Array.isArray(post.author) ? post.author.join(", ") : post.author)
|
|
36
34
|
}
|
|
37
35
|
if (post.description) parts.push("", post.description)
|
|
38
36
|
return parts.join("\n")
|
|
@@ -76,16 +74,12 @@ export function TagIndex(props: { sectionPrefix: string; tag: string }) {
|
|
|
76
74
|
{post.date && <span>{formatDate(post.date)}</span>}
|
|
77
75
|
{post.author && (
|
|
78
76
|
<span>
|
|
79
|
-
{Array.isArray(post.author)
|
|
80
|
-
? post.author.join(", ")
|
|
81
|
-
: post.author}
|
|
77
|
+
{Array.isArray(post.author) ? post.author.join(", ") : post.author}
|
|
82
78
|
</span>
|
|
83
79
|
)}
|
|
84
80
|
</p>
|
|
85
81
|
{post.description && (
|
|
86
|
-
<p className="text-muted-foreground mt-2">
|
|
87
|
-
{post.description}
|
|
88
|
-
</p>
|
|
82
|
+
<p className="text-muted-foreground mt-2">{post.description}</p>
|
|
89
83
|
)}
|
|
90
84
|
</article>
|
|
91
85
|
))}
|
|
@@ -63,10 +63,7 @@ export function MobileToc(props: { items: TocItem[]; children?: ReactNode }) {
|
|
|
63
63
|
const title = active?.title ?? props.items[0]?.title ?? "Contents"
|
|
64
64
|
|
|
65
65
|
return (
|
|
66
|
-
<div
|
|
67
|
-
ref={wrapperRef}
|
|
68
|
-
className="xl:hidden sticky top-16 z-20 border-b bg-background"
|
|
69
|
-
>
|
|
66
|
+
<div ref={wrapperRef} className="xl:hidden sticky top-16 z-20 border-b bg-background">
|
|
70
67
|
<button
|
|
71
68
|
type="button"
|
|
72
69
|
onClick={() => setOpen(v => !v)}
|
|
@@ -91,9 +88,7 @@ export function MobileToc(props: { items: TocItem[]; children?: ReactNode }) {
|
|
|
91
88
|
<li key={item.url}>
|
|
92
89
|
<a
|
|
93
90
|
href={item.url}
|
|
94
|
-
data-active={
|
|
95
|
-
activeId === item.url.slice(1) || undefined
|
|
96
|
-
}
|
|
91
|
+
data-active={activeId === item.url.slice(1) || undefined}
|
|
97
92
|
onClick={() => setOpen(false)}
|
|
98
93
|
className={`-ms-px block border-l border-transparent py-1.5 text-muted-foreground transition-colors hover:text-foreground data-[active]:border-primary data-[active]:font-medium data-[active]:text-primary ${item.depth <= 2 ? "ps-3" : item.depth === 3 ? "ps-6" : "ps-8"}`}
|
|
99
94
|
>
|
|
@@ -54,8 +54,7 @@ if (routedSections.length) {
|
|
|
54
54
|
const sorted =
|
|
55
55
|
section?.type === "blog" || section?.type === "changelog"
|
|
56
56
|
? [...bucket].sort(
|
|
57
|
-
(a, b) =>
|
|
58
|
-
new Date(b.date ?? 0).getTime() - new Date(a.date ?? 0).getTime(),
|
|
57
|
+
(a, b) => new Date(b.date ?? 0).getTime() - new Date(a.date ?? 0).getTime(),
|
|
59
58
|
)
|
|
60
59
|
: bucket
|
|
61
60
|
const tree = buildArticleTree(sorted)
|
|
@@ -53,15 +53,12 @@ import { extractToc } from "./helpers/toc.ts"
|
|
|
53
53
|
|
|
54
54
|
const config = await loadConfig()
|
|
55
55
|
|
|
56
|
-
const changelogSections =
|
|
57
|
-
config.sections?.filter(s => s.type === "changelog") ?? []
|
|
56
|
+
const changelogSections = config.sections?.filter(s => s.type === "changelog") ?? []
|
|
58
57
|
for (const section of changelogSections) {
|
|
59
58
|
await buildChangelog(section, config)
|
|
60
59
|
}
|
|
61
60
|
|
|
62
|
-
const configInclude = Array.isArray(config.include)
|
|
63
|
-
? config.include
|
|
64
|
-
: [config.include]
|
|
61
|
+
const configInclude = Array.isArray(config.include) ? config.include : [config.include]
|
|
65
62
|
const include = changelogSections.length
|
|
66
63
|
? [...configInclude, cacheIncludeGlob(config)]
|
|
67
64
|
: configInclude
|
|
@@ -9,15 +9,11 @@ function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props) {
|
|
12
|
-
return
|
|
13
|
-
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
14
|
-
)
|
|
12
|
+
return <AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props) {
|
|
18
|
-
return
|
|
19
|
-
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
20
|
-
)
|
|
16
|
+
return <AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
21
17
|
}
|
|
22
18
|
|
|
23
19
|
function AlertDialogOverlay({
|
|
@@ -59,10 +55,7 @@ function AlertDialogContent({
|
|
|
59
55
|
)
|
|
60
56
|
}
|
|
61
57
|
|
|
62
|
-
function AlertDialogHeader({
|
|
63
|
-
className,
|
|
64
|
-
...props
|
|
65
|
-
}: React.ComponentProps<"div">) {
|
|
58
|
+
function AlertDialogHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
66
59
|
return (
|
|
67
60
|
<div
|
|
68
61
|
data-slot="alert-dialog-header"
|
|
@@ -75,10 +68,7 @@ function AlertDialogHeader({
|
|
|
75
68
|
)
|
|
76
69
|
}
|
|
77
70
|
|
|
78
|
-
function AlertDialogFooter({
|
|
79
|
-
className,
|
|
80
|
-
...props
|
|
81
|
-
}: React.ComponentProps<"div">) {
|
|
71
|
+
function AlertDialogFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
82
72
|
return (
|
|
83
73
|
<div
|
|
84
74
|
data-slot="alert-dialog-footer"
|
|
@@ -91,10 +81,7 @@ function AlertDialogFooter({
|
|
|
91
81
|
)
|
|
92
82
|
}
|
|
93
83
|
|
|
94
|
-
function AlertDialogMedia({
|
|
95
|
-
className,
|
|
96
|
-
...props
|
|
97
|
-
}: React.ComponentProps<"div">) {
|
|
84
|
+
function AlertDialogMedia({ className, ...props }: React.ComponentProps<"div">) {
|
|
98
85
|
return (
|
|
99
86
|
<div
|
|
100
87
|
data-slot="alert-dialog-media"
|
|
@@ -139,17 +126,8 @@ function AlertDialogDescription({
|
|
|
139
126
|
)
|
|
140
127
|
}
|
|
141
128
|
|
|
142
|
-
function AlertDialogAction({
|
|
143
|
-
className
|
|
144
|
-
...props
|
|
145
|
-
}: React.ComponentProps<typeof Button>) {
|
|
146
|
-
return (
|
|
147
|
-
<Button
|
|
148
|
-
data-slot="alert-dialog-action"
|
|
149
|
-
className={cn(className)}
|
|
150
|
-
{...props}
|
|
151
|
-
/>
|
|
152
|
-
)
|
|
129
|
+
function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof Button>) {
|
|
130
|
+
return <Button data-slot="alert-dialog-action" className={cn(className)} {...props} />
|
|
153
131
|
}
|
|
154
132
|
|
|
155
133
|
function AlertDialogCancel({
|
|
@@ -45,10 +45,7 @@ function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
45
45
|
)
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
function AlertDescription({
|
|
49
|
-
className,
|
|
50
|
-
...props
|
|
51
|
-
}: React.ComponentProps<"div">) {
|
|
48
|
+
function AlertDescription({ className, ...props }: React.ComponentProps<"div">) {
|
|
52
49
|
return (
|
|
53
50
|
<div
|
|
54
51
|
data-slot="alert-description"
|
|
@@ -27,19 +27,13 @@ function AvatarImage({ className, ...props }: AvatarPrimitive.Image.Props) {
|
|
|
27
27
|
return (
|
|
28
28
|
<AvatarPrimitive.Image
|
|
29
29
|
data-slot="avatar-image"
|
|
30
|
-
className={cn(
|
|
31
|
-
"aspect-square size-full rounded-full object-cover",
|
|
32
|
-
className,
|
|
33
|
-
)}
|
|
30
|
+
className={cn("aspect-square size-full rounded-full object-cover", className)}
|
|
34
31
|
{...props}
|
|
35
32
|
/>
|
|
36
33
|
)
|
|
37
34
|
}
|
|
38
35
|
|
|
39
|
-
function AvatarFallback({
|
|
40
|
-
className,
|
|
41
|
-
...props
|
|
42
|
-
}: AvatarPrimitive.Fallback.Props) {
|
|
36
|
+
function AvatarFallback({ className, ...props }: AvatarPrimitive.Fallback.Props) {
|
|
43
37
|
return (
|
|
44
38
|
<AvatarPrimitive.Fallback
|
|
45
39
|
data-slot="avatar-fallback"
|
|
@@ -81,10 +75,7 @@ function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
81
75
|
)
|
|
82
76
|
}
|
|
83
77
|
|
|
84
|
-
function AvatarGroupCount({
|
|
85
|
-
className,
|
|
86
|
-
...props
|
|
87
|
-
}: React.ComponentProps<"div">) {
|
|
78
|
+
function AvatarGroupCount({ className, ...props }: React.ComponentProps<"div">) {
|
|
88
79
|
return (
|
|
89
80
|
<div
|
|
90
81
|
data-slot="avatar-group-count"
|
|
@@ -97,11 +88,4 @@ function AvatarGroupCount({
|
|
|
97
88
|
)
|
|
98
89
|
}
|
|
99
90
|
|
|
100
|
-
export {
|
|
101
|
-
Avatar,
|
|
102
|
-
AvatarImage,
|
|
103
|
-
AvatarFallback,
|
|
104
|
-
AvatarGroup,
|
|
105
|
-
AvatarGroupCount,
|
|
106
|
-
AvatarBadge,
|
|
107
|
-
}
|
|
91
|
+
export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge }
|
|
@@ -9,14 +9,12 @@ const badgeVariants = cva(
|
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
11
|
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
12
|
-
secondary:
|
|
13
|
-
"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
12
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
14
13
|
destructive:
|
|
15
14
|
"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",
|
|
16
15
|
outline:
|
|
17
16
|
"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
18
|
-
ghost:
|
|
19
|
-
"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
17
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
20
18
|
link: "text-primary underline-offset-4 hover:underline",
|
|
21
19
|
},
|
|
22
20
|
},
|
|
@@ -37,11 +37,7 @@ function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
|
|
|
37
37
|
)
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
function BreadcrumbLink({
|
|
41
|
-
className,
|
|
42
|
-
render,
|
|
43
|
-
...props
|
|
44
|
-
}: useRender.ComponentProps<"a">) {
|
|
40
|
+
function BreadcrumbLink({ className, render, ...props }: useRender.ComponentProps<"a">) {
|
|
45
41
|
return useRender({
|
|
46
42
|
defaultTagName: "a",
|
|
47
43
|
props: mergeProps<"a">(
|
|
@@ -88,19 +84,13 @@ function BreadcrumbSeparator({
|
|
|
88
84
|
)
|
|
89
85
|
}
|
|
90
86
|
|
|
91
|
-
function BreadcrumbEllipsis({
|
|
92
|
-
className,
|
|
93
|
-
...props
|
|
94
|
-
}: React.ComponentProps<"span">) {
|
|
87
|
+
function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<"span">) {
|
|
95
88
|
return (
|
|
96
89
|
<span
|
|
97
90
|
data-slot="breadcrumb-ellipsis"
|
|
98
91
|
role="presentation"
|
|
99
92
|
aria-hidden="true"
|
|
100
|
-
className={cn(
|
|
101
|
-
"size-5 [&>svg]:size-4 flex items-center justify-center",
|
|
102
|
-
className,
|
|
103
|
-
)}
|
|
93
|
+
className={cn("size-5 [&>svg]:size-4 flex items-center justify-center", className)}
|
|
104
94
|
{...props}
|
|
105
95
|
>
|
|
106
96
|
<MoreHorizontalIcon />
|
|
@@ -5,11 +5,7 @@ import {
|
|
|
5
5
|
type DayButton,
|
|
6
6
|
type Locale,
|
|
7
7
|
} from "react-day-picker"
|
|
8
|
-
import {
|
|
9
|
-
ChevronDownIcon,
|
|
10
|
-
ChevronLeftIcon,
|
|
11
|
-
ChevronRightIcon,
|
|
12
|
-
} from "lucide-react"
|
|
8
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react"
|
|
13
9
|
|
|
14
10
|
import { cn } from "../utils/style.ts"
|
|
15
11
|
import { Button, buttonVariants } from "./button.tsx"
|
|
@@ -47,10 +43,7 @@ function Calendar({
|
|
|
47
43
|
}}
|
|
48
44
|
classNames={{
|
|
49
45
|
root: cn("w-fit", defaultClassNames.root),
|
|
50
|
-
months: cn(
|
|
51
|
-
"relative flex flex-col gap-4 md:flex-row",
|
|
52
|
-
defaultClassNames.months,
|
|
53
|
-
),
|
|
46
|
+
months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
|
|
54
47
|
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
55
48
|
nav: cn(
|
|
56
49
|
"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
@@ -78,10 +71,7 @@ function Calendar({
|
|
|
78
71
|
"cn-calendar-dropdown-root relative rounded-(--cell-radius)",
|
|
79
72
|
defaultClassNames.dropdown_root,
|
|
80
73
|
),
|
|
81
|
-
dropdown: cn(
|
|
82
|
-
"absolute inset-0 bg-popover opacity-0",
|
|
83
|
-
defaultClassNames.dropdown,
|
|
84
|
-
),
|
|
74
|
+
dropdown: cn("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
|
|
85
75
|
caption_label: cn(
|
|
86
76
|
"font-medium select-none",
|
|
87
77
|
captionLayout === "label"
|
|
@@ -128,10 +118,7 @@ function Calendar({
|
|
|
128
118
|
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
129
119
|
defaultClassNames.outside,
|
|
130
120
|
),
|
|
131
|
-
disabled: cn(
|
|
132
|
-
"text-muted-foreground opacity-50",
|
|
133
|
-
defaultClassNames.disabled,
|
|
134
|
-
),
|
|
121
|
+
disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
|
|
135
122
|
hidden: cn("invisible", defaultClassNames.hidden),
|
|
136
123
|
...classNames,
|
|
137
124
|
}}
|
|
@@ -165,13 +152,9 @@ function Calendar({
|
|
|
165
152
|
)
|
|
166
153
|
}
|
|
167
154
|
|
|
168
|
-
return (
|
|
169
|
-
<ChevronDownIcon className={cn("size-4", className)} {...props} />
|
|
170
|
-
)
|
|
155
|
+
return <ChevronDownIcon className={cn("size-4", className)} {...props} />
|
|
171
156
|
},
|
|
172
|
-
DayButton: ({ ...props }) =>
|
|
173
|
-
<CalendarDayButton locale={locale} {...props} />
|
|
174
|
-
),
|
|
157
|
+
DayButton: ({ ...props }) => <CalendarDayButton locale={locale} {...props} />,
|
|
175
158
|
WeekNumber: ({ children, ...props }) => {
|
|
176
159
|
return (
|
|
177
160
|
<td {...props}>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
-
import useEmblaCarousel, {
|
|
3
|
-
type UseEmblaCarouselType,
|
|
4
|
-
} from "embla-carousel-react"
|
|
2
|
+
import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react"
|
|
5
3
|
import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react"
|
|
6
4
|
|
|
7
5
|
import { cn } from "../utils/style.ts"
|
|
@@ -108,8 +106,7 @@ function Carousel({
|
|
|
108
106
|
carouselRef,
|
|
109
107
|
api: api,
|
|
110
108
|
opts,
|
|
111
|
-
orientation:
|
|
112
|
-
orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
109
|
+
orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
|
|
113
110
|
scrollPrev,
|
|
114
111
|
scrollNext,
|
|
115
112
|
canScrollPrev,
|
|
@@ -134,11 +131,7 @@ function CarouselContent({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
134
131
|
const { carouselRef, orientation } = useCarousel()
|
|
135
132
|
|
|
136
133
|
return (
|
|
137
|
-
<div
|
|
138
|
-
ref={carouselRef}
|
|
139
|
-
className="overflow-hidden"
|
|
140
|
-
data-slot="carousel-content"
|
|
141
|
-
>
|
|
134
|
+
<div ref={carouselRef} className="overflow-hidden" data-slot="carousel-content">
|
|
142
135
|
<div
|
|
143
136
|
className={cn(
|
|
144
137
|
"flex",
|
|
@@ -46,9 +46,7 @@ function ChartContainer({
|
|
|
46
46
|
...props
|
|
47
47
|
}: React.ComponentProps<"div"> & {
|
|
48
48
|
config: ChartConfig
|
|
49
|
-
children: React.ComponentProps<
|
|
50
|
-
typeof RechartsPrimitive.ResponsiveContainer
|
|
51
|
-
>["children"]
|
|
49
|
+
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"]
|
|
52
50
|
initialDimension?: {
|
|
53
51
|
width: number
|
|
54
52
|
height: number
|
|
@@ -69,9 +67,7 @@ function ChartContainer({
|
|
|
69
67
|
{...props}
|
|
70
68
|
>
|
|
71
69
|
<ChartStyle id={chartId} config={config} />
|
|
72
|
-
<RechartsPrimitive.ResponsiveContainer
|
|
73
|
-
initialDimension={initialDimension}
|
|
74
|
-
>
|
|
70
|
+
<RechartsPrimitive.ResponsiveContainer initialDimension={initialDimension}>
|
|
75
71
|
{children}
|
|
76
72
|
</RechartsPrimitive.ResponsiveContainer>
|
|
77
73
|
</div>
|
|
@@ -99,8 +95,7 @@ ${prefix} [data-chart=${id}] {
|
|
|
99
95
|
${colorConfig
|
|
100
96
|
.map(([key, itemConfig]) => {
|
|
101
97
|
const color =
|
|
102
|
-
itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ??
|
|
103
|
-
itemConfig.color
|
|
98
|
+
itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ?? itemConfig.color
|
|
104
99
|
return color ? ` --color-${key}: ${color};` : null
|
|
105
100
|
})
|
|
106
101
|
.join("\n")}
|
|
@@ -137,10 +132,7 @@ function ChartTooltipContent({
|
|
|
137
132
|
nameKey?: string
|
|
138
133
|
labelKey?: string
|
|
139
134
|
} & Omit<
|
|
140
|
-
RechartsPrimitive.DefaultTooltipContentProps<
|
|
141
|
-
TooltipValueType,
|
|
142
|
-
TooltipNameType
|
|
143
|
-
>,
|
|
135
|
+
RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>,
|
|
144
136
|
"accessibilityLayer"
|
|
145
137
|
>) {
|
|
146
138
|
const { config } = useChart()
|
|
@@ -171,15 +163,7 @@ function ChartTooltipContent({
|
|
|
171
163
|
}
|
|
172
164
|
|
|
173
165
|
return <div className={cn("font-medium", labelClassName)}>{value}</div>
|
|
174
|
-
}, [
|
|
175
|
-
label,
|
|
176
|
-
labelFormatter,
|
|
177
|
-
payload,
|
|
178
|
-
hideLabel,
|
|
179
|
-
labelClassName,
|
|
180
|
-
config,
|
|
181
|
-
labelKey,
|
|
182
|
-
])
|
|
166
|
+
}, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey])
|
|
183
167
|
|
|
184
168
|
if (!active || !payload?.length) {
|
|
185
169
|
return null
|
|
@@ -326,11 +310,7 @@ function ChartLegendContent({
|
|
|
326
310
|
)
|
|
327
311
|
}
|
|
328
312
|
|
|
329
|
-
function getPayloadConfigFromPayload(
|
|
330
|
-
config: ChartConfig,
|
|
331
|
-
payload: unknown,
|
|
332
|
-
key: string,
|
|
333
|
-
) {
|
|
313
|
+
function getPayloadConfigFromPayload(config: ChartConfig, payload: unknown, key: string) {
|
|
334
314
|
if (typeof payload !== "object" || payload === null) {
|
|
335
315
|
return undefined
|
|
336
316
|
}
|
|
@@ -344,19 +324,14 @@ function getPayloadConfigFromPayload(
|
|
|
344
324
|
|
|
345
325
|
let configLabelKey: string = key
|
|
346
326
|
|
|
347
|
-
if (
|
|
348
|
-
key in payload &&
|
|
349
|
-
typeof payload[key as keyof typeof payload] === "string"
|
|
350
|
-
) {
|
|
327
|
+
if (key in payload && typeof payload[key as keyof typeof payload] === "string") {
|
|
351
328
|
configLabelKey = payload[key as keyof typeof payload] as string
|
|
352
329
|
} else if (
|
|
353
330
|
payloadPayload &&
|
|
354
331
|
key in payloadPayload &&
|
|
355
332
|
typeof payloadPayload[key as keyof typeof payloadPayload] === "string"
|
|
356
333
|
) {
|
|
357
|
-
configLabelKey = payloadPayload[
|
|
358
|
-
key as keyof typeof payloadPayload
|
|
359
|
-
] as string
|
|
334
|
+
configLabelKey = payloadPayload[key as keyof typeof payloadPayload] as string
|
|
360
335
|
}
|
|
361
336
|
|
|
362
337
|
return configLabelKey in config ? config[configLabelKey] : config[key]
|
|
@@ -5,15 +5,11 @@ function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props) {
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props) {
|
|
8
|
-
return
|
|
9
|
-
<CollapsiblePrimitive.Trigger data-slot="collapsible-trigger" {...props} />
|
|
10
|
-
)
|
|
8
|
+
return <CollapsiblePrimitive.Trigger data-slot="collapsible-trigger" {...props} />
|
|
11
9
|
}
|
|
12
10
|
|
|
13
11
|
function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props) {
|
|
14
|
-
return
|
|
15
|
-
<CollapsiblePrimitive.Panel data-slot="collapsible-content" {...props} />
|
|
16
|
-
)
|
|
12
|
+
return <CollapsiblePrimitive.Panel data-slot="collapsible-content" {...props} />
|
|
17
13
|
}
|
|
18
14
|
|
|
19
15
|
export { Collapsible, CollapsibleTrigger, CollapsibleContent }
|
|
@@ -12,10 +12,7 @@ import {
|
|
|
12
12
|
} from "./dialog.tsx"
|
|
13
13
|
import { InputGroup, InputGroupAddon } from "./input-group.tsx"
|
|
14
14
|
|
|
15
|
-
function Command({
|
|
16
|
-
className,
|
|
17
|
-
...props
|
|
18
|
-
}: React.ComponentProps<typeof CommandPrimitive>) {
|
|
15
|
+
function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
|
|
19
16
|
return (
|
|
20
17
|
<CommandPrimitive
|
|
21
18
|
data-slot="command"
|
|
@@ -53,10 +50,7 @@ function CommandDialog({
|
|
|
53
50
|
<DialogDescription>{description}</DialogDescription>
|
|
54
51
|
</DialogHeader>
|
|
55
52
|
<DialogContent
|
|
56
|
-
className={cn(
|
|
57
|
-
"top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0",
|
|
58
|
-
className,
|
|
59
|
-
)}
|
|
53
|
+
className={cn("top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0", className)}
|
|
60
54
|
showCloseButton={showCloseButton}
|
|
61
55
|
>
|
|
62
56
|
<Command shouldFilter={shouldFilter} loop={loop}>
|
|
@@ -181,10 +175,7 @@ function CommandItem({
|
|
|
181
175
|
)
|
|
182
176
|
}
|
|
183
177
|
|
|
184
|
-
function CommandShortcut({
|
|
185
|
-
className,
|
|
186
|
-
...props
|
|
187
|
-
}: React.ComponentProps<"span">) {
|
|
178
|
+
function CommandShortcut({ className, ...props }: React.ComponentProps<"span">) {
|
|
188
179
|
return (
|
|
189
180
|
<span
|
|
190
181
|
data-slot="command-shortcut"
|
|
@@ -9,15 +9,10 @@ function ContextMenu({ ...props }: ContextMenuPrimitive.Root.Props) {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
function ContextMenuPortal({ ...props }: ContextMenuPrimitive.Portal.Props) {
|
|
12
|
-
return
|
|
13
|
-
<ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />
|
|
14
|
-
)
|
|
12
|
+
return <ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />
|
|
15
13
|
}
|
|
16
14
|
|
|
17
|
-
function ContextMenuTrigger({
|
|
18
|
-
className,
|
|
19
|
-
...props
|
|
20
|
-
}: ContextMenuPrimitive.Trigger.Props) {
|
|
15
|
+
function ContextMenuTrigger({ className, ...props }: ContextMenuPrimitive.Trigger.Props) {
|
|
21
16
|
return (
|
|
22
17
|
<ContextMenuPrimitive.Trigger
|
|
23
18
|
data-slot="context-menu-trigger"
|
|
@@ -62,9 +57,7 @@ function ContextMenuContent({
|
|
|
62
57
|
}
|
|
63
58
|
|
|
64
59
|
function ContextMenuGroup({ ...props }: ContextMenuPrimitive.Group.Props) {
|
|
65
|
-
return
|
|
66
|
-
<ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />
|
|
67
|
-
)
|
|
60
|
+
return <ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />
|
|
68
61
|
}
|
|
69
62
|
|
|
70
63
|
function ContextMenuLabel({
|
|
@@ -111,9 +104,7 @@ function ContextMenuItem({
|
|
|
111
104
|
}
|
|
112
105
|
|
|
113
106
|
function ContextMenuSub({ ...props }: ContextMenuPrimitive.SubmenuRoot.Props) {
|
|
114
|
-
return
|
|
115
|
-
<ContextMenuPrimitive.SubmenuRoot data-slot="context-menu-sub" {...props} />
|
|
116
|
-
)
|
|
107
|
+
return <ContextMenuPrimitive.SubmenuRoot data-slot="context-menu-sub" {...props} />
|
|
117
108
|
}
|
|
118
109
|
|
|
119
110
|
function ContextMenuSubTrigger({
|
|
@@ -183,14 +174,9 @@ function ContextMenuCheckboxItem({
|
|
|
183
174
|
)
|
|
184
175
|
}
|
|
185
176
|
|
|
186
|
-
function ContextMenuRadioGroup({
|
|
187
|
-
...props
|
|
188
|
-
}: ContextMenuPrimitive.RadioGroup.Props) {
|
|
177
|
+
function ContextMenuRadioGroup({ ...props }: ContextMenuPrimitive.RadioGroup.Props) {
|
|
189
178
|
return (
|
|
190
|
-
<ContextMenuPrimitive.RadioGroup
|
|
191
|
-
data-slot="context-menu-radio-group"
|
|
192
|
-
{...props}
|
|
193
|
-
/>
|
|
179
|
+
<ContextMenuPrimitive.RadioGroup data-slot="context-menu-radio-group" {...props} />
|
|
194
180
|
)
|
|
195
181
|
}
|
|
196
182
|
|
|
@@ -235,10 +221,7 @@ function ContextMenuSeparator({
|
|
|
235
221
|
)
|
|
236
222
|
}
|
|
237
223
|
|
|
238
|
-
function ContextMenuShortcut({
|
|
239
|
-
className,
|
|
240
|
-
...props
|
|
241
|
-
}: React.ComponentProps<"span">) {
|
|
224
|
+
function ContextMenuShortcut({ className, ...props }: React.ComponentProps<"span">) {
|
|
242
225
|
return (
|
|
243
226
|
<span
|
|
244
227
|
data-slot="context-menu-shortcut"
|