livemark 0.25.0 → 0.27.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/README.md +3 -2
- package/build/actions/config/define.d.ts +12 -0
- package/build/actions/config/define.unit.js +8 -1
- package/build/actions/escape/copy.d.ts +11 -0
- package/build/actions/escape/copy.js +29 -0
- package/build/actions/escape/copy.unit.d.ts +1 -0
- package/build/actions/escape/copy.unit.js +37 -0
- package/build/actions/escape/list.d.ts +12 -0
- package/build/actions/escape/list.js +27 -0
- package/build/actions/escape/list.unit.d.ts +1 -0
- package/build/actions/escape/list.unit.js +36 -0
- package/build/actions/target/build.d.ts +9 -26
- package/build/actions/target/build.js +50 -71
- package/build/actions/target/build.unit.d.ts +1 -0
- package/build/actions/target/build.unit.js +76 -0
- package/build/actions/target/clear.d.ts +4 -0
- package/build/actions/target/clear.js +14 -0
- package/build/actions/target/clear.unit.d.ts +1 -0
- package/build/actions/target/clear.unit.js +23 -0
- package/build/commands/build.js +1 -2
- package/build/commands/clear.d.ts +5 -0
- package/build/commands/clear.js +15 -0
- package/build/commands/escape.d.ts +4 -3
- package/build/commands/escape.js +45 -48
- package/build/commands/preview.js +1 -2
- package/build/commands/start.js +1 -2
- package/build/components/Abbr.d.ts +1 -1
- package/build/components/Abbr.js +2 -4
- package/build/components/AnsiCode.d.ts +1 -1
- package/build/components/AnsiCode.js +2 -2
- package/build/components/Article.d.ts +2 -1
- package/build/components/Article.js +7 -14
- package/build/components/BackToTop.d.ts +1 -1
- package/build/components/Banner.d.ts +2 -2
- package/build/components/Banner.js +7 -3
- package/build/components/BlogIndex.d.ts +1 -1
- package/build/components/BlogIndex.js +2 -11
- package/build/components/Breadcrumbs.d.ts +1 -1
- package/build/components/Breadcrumbs.js +2 -3
- package/build/components/Callout.d.ts +1 -1
- package/build/components/Callout.js +5 -9
- package/build/components/Card.d.ts +1 -1
- package/build/components/Card.js +2 -3
- package/build/components/Cards.d.ts +1 -1
- package/build/components/ChangelogIndex.d.ts +1 -1
- package/build/components/ChangelogIndex.js +2 -11
- package/build/components/ChoiceList.d.ts +15 -0
- package/build/components/ChoiceList.js +13 -0
- package/build/components/CodeBlock.d.ts +1 -1
- package/build/components/CodeBlock.js +3 -16
- package/build/components/CodeTabs.d.ts +1 -1
- package/build/components/CodeTabs.js +2 -3
- package/build/components/Column.d.ts +1 -1
- package/build/components/Columns.d.ts +1 -1
- package/build/components/Content.d.ts +1 -1
- package/build/components/ContentTab.d.ts +1 -1
- package/build/components/ContentTabs.d.ts +1 -1
- package/build/components/ContentTabs.js +2 -3
- package/build/components/DefaultCatchBoundary.d.ts +1 -1
- package/build/components/DefaultCatchBoundary.js +5 -7
- package/build/components/DefinitionList.d.ts +3 -3
- package/build/components/Details.d.ts +1 -1
- package/build/components/Details.js +2 -5
- package/build/components/FileTree.d.ts +1 -1
- package/build/components/FileTree.js +3 -5
- package/build/components/Footer.d.ts +1 -1
- package/build/components/Footer.js +2 -5
- package/build/components/FootnoteRef.d.ts +1 -1
- package/build/components/FootnoteRef.js +2 -4
- package/build/components/Header.d.ts +6 -0
- package/build/components/Header.js +26 -0
- package/build/components/HeaderMenu.d.ts +2 -0
- package/build/components/HeaderMenu.js +27 -0
- package/build/components/HeaderNav.d.ts +6 -0
- package/build/components/HeaderNav.js +74 -0
- package/build/components/HeaderSearch.d.ts +4 -0
- package/build/components/HeaderSearch.js +33 -0
- package/build/components/Heading.d.ts +6 -6
- package/build/components/InlineBadge.d.ts +2 -2
- package/build/components/InlineBadge.js +1 -1
- package/build/components/InlineIcon.d.ts +1 -1
- package/build/components/InlineToc.d.ts +1 -1
- package/build/components/InlineToc.js +2 -4
- package/build/components/Layout.d.ts +2 -1
- package/build/components/Layout.js +5 -58
- package/build/components/LinkButton.d.ts +2 -2
- package/build/components/LinkButton.js +1 -1
- package/build/components/MenuSheet.d.ts +22 -0
- package/build/components/MenuSheet.js +27 -0
- package/build/components/Mermaid.d.ts +1 -1
- package/build/components/MermaidRenderer.d.ts +1 -1
- package/build/components/MermaidRenderer.js +20 -8
- package/build/components/NotFound.d.ts +1 -1
- package/build/components/NotFound.js +3 -6
- package/build/components/PackageTabs.d.ts +1 -1
- package/build/components/PackageTabs.js +3 -7
- package/build/components/PageToolbar.d.ts +1 -1
- package/build/components/PageToolbar.js +2 -10
- package/build/components/PrevNext.d.ts +1 -1
- package/build/components/PrevNext.js +2 -10
- package/build/components/Root.d.ts +4 -0
- package/build/components/Root.js +8 -0
- package/build/components/Search.d.ts +5 -2
- package/build/components/Search.js +11 -9
- package/build/components/SearchDialog.d.ts +1 -1
- package/build/components/SearchDialog.js +10 -133
- package/build/components/Section.d.ts +1 -1
- package/build/components/SectionHeader.d.ts +1 -1
- package/build/components/SheetPanel.d.ts +12 -0
- package/build/components/SheetPanel.js +19 -0
- package/build/components/Sidebar.d.ts +1 -1
- package/build/components/Sidebar.js +12 -14
- package/build/components/SidebarArticles.d.ts +4 -1
- package/build/components/SidebarArticles.js +5 -9
- package/build/components/SidebarLinks.d.ts +4 -1
- package/build/components/SidebarLinks.js +6 -9
- package/build/components/SidebarPosts.d.ts +4 -1
- package/build/components/SidebarPosts.js +7 -23
- package/build/components/SidebarReleases.d.ts +4 -1
- package/build/components/SidebarReleases.js +5 -15
- package/build/components/SidebarSectionPicker.d.ts +8 -0
- package/build/components/SidebarSectionPicker.js +31 -0
- package/build/components/SidebarSections.d.ts +1 -1
- package/build/components/SidebarSections.js +5 -9
- package/build/components/SiteLink.d.ts +1 -1
- package/build/components/SiteTitle.d.ts +1 -1
- package/build/components/SiteTitle.js +2 -6
- package/build/components/SortableTable.d.ts +1 -1
- package/build/components/SoundCloud.d.ts +1 -1
- package/build/components/SoundCloud.js +2 -2
- package/build/components/TagIndex.d.ts +1 -1
- package/build/components/TagIndex.js +2 -11
- package/build/components/Theme.d.ts +2 -1
- package/build/components/Theme.js +35 -15
- package/build/components/Toc.d.ts +5 -4
- package/build/components/Toc.js +35 -35
- package/build/components/YouTube.d.ts +1 -1
- package/build/components/YouTube.js +2 -2
- package/build/components/ZoomImage.d.ts +1 -1
- package/build/content/article.js +4 -11
- package/build/content-collections.js +6 -4
- package/build/elements/accordion.d.ts +4 -4
- package/build/elements/accordion.js +2 -3
- package/build/elements/alert-dialog.d.ts +12 -12
- package/build/elements/alert-dialog.js +2 -4
- package/build/elements/alert.d.ts +4 -4
- package/build/elements/alert.js +2 -2
- package/build/elements/aspect-ratio.d.ts +1 -1
- package/build/elements/avatar.d.ts +6 -6
- package/build/elements/badge.d.ts +1 -1
- package/build/elements/badge.js +3 -1
- package/build/elements/breadcrumb.d.ts +6 -6
- package/build/elements/breadcrumb.js +2 -4
- package/build/elements/button-group.d.ts +2 -2
- package/build/elements/button-group.js +5 -5
- package/build/elements/button.d.ts +2 -2
- package/build/elements/button.js +9 -7
- package/build/elements/calendar.d.ts +2 -2
- package/build/elements/calendar.js +2 -2
- package/build/elements/card.d.ts +7 -7
- package/build/elements/card.js +4 -4
- package/build/elements/carousel.d.ts +5 -5
- package/build/elements/carousel.js +3 -7
- package/build/elements/chart.d.ts +6 -6
- package/build/elements/chart.js +5 -11
- package/build/elements/checkbox.d.ts +1 -1
- package/build/elements/collapsible.d.ts +3 -3
- package/build/elements/command.d.ts +9 -9
- package/build/elements/command.js +5 -11
- package/build/elements/context-menu.d.ts +15 -15
- package/build/elements/context-menu.js +6 -9
- package/build/elements/dialog.d.ts +10 -10
- package/build/elements/dialog.js +2 -6
- package/build/elements/drawer.d.ts +14 -12
- package/build/elements/drawer.js +14 -15
- package/build/elements/dropdown-menu.d.ts +15 -15
- package/build/elements/dropdown-menu.js +7 -10
- package/build/elements/empty.d.ts +6 -6
- package/build/elements/empty.js +2 -2
- package/build/elements/field.d.ts +10 -10
- package/build/elements/field.js +3 -4
- package/build/elements/hover-card.d.ts +3 -3
- package/build/elements/hover-card.js +2 -2
- package/build/elements/input-group.d.ts +7 -7
- package/build/elements/input-group.js +5 -5
- package/build/elements/input-otp.d.ts +4 -4
- package/build/elements/input.d.ts +1 -1
- package/build/elements/input.js +2 -2
- package/build/elements/item.d.ts +9 -9
- package/build/elements/item.js +2 -2
- package/build/elements/kbd.d.ts +2 -2
- package/build/elements/label.d.ts +1 -1
- package/build/elements/menubar.d.ts +16 -16
- package/build/elements/menubar.js +9 -11
- package/build/elements/native-select.d.ts +3 -3
- package/build/elements/native-select.js +2 -4
- package/build/elements/navigation-menu.d.ts +8 -8
- package/build/elements/navigation-menu.js +3 -5
- package/build/elements/pagination.d.ts +7 -7
- package/build/elements/pagination.js +4 -10
- package/build/elements/popover.d.ts +6 -6
- package/build/elements/popover.js +2 -2
- package/build/elements/progress.d.ts +5 -5
- package/build/elements/progress.js +2 -3
- package/build/elements/radio-group.d.ts +2 -2
- package/build/elements/resizable.d.ts +3 -3
- package/build/elements/scroll-area.d.ts +2 -2
- package/build/elements/scroll-area.js +2 -4
- package/build/elements/select.d.ts +9 -9
- package/build/elements/select.js +4 -9
- package/build/elements/separator.d.ts +1 -1
- package/build/elements/sheet.d.ts +8 -8
- package/build/elements/sheet.js +2 -6
- package/build/elements/sidebar.d.ts +19 -19
- package/build/elements/sidebar.js +15 -37
- package/build/elements/skeleton.d.ts +1 -1
- package/build/elements/slider.d.ts +2 -1
- package/build/elements/slider.js +2 -3
- package/build/elements/sonner.d.ts +1 -1
- package/build/elements/spinner.d.ts +1 -1
- package/build/elements/switch.d.ts +1 -1
- package/build/elements/table.d.ts +8 -8
- package/build/elements/tabs.d.ts +4 -4
- package/build/elements/tabs.js +3 -3
- package/build/elements/textarea.d.ts +1 -1
- package/build/elements/textarea.js +2 -2
- package/build/elements/toggle-group.d.ts +3 -2
- package/build/elements/toggle-group.js +3 -3
- package/build/elements/toggle.d.ts +1 -1
- package/build/elements/toggle.js +2 -2
- package/build/elements/tooltip.d.ts +4 -4
- package/build/elements/tooltip.js +2 -3
- package/build/head.d.ts +4 -0
- package/build/head.js +6 -0
- package/build/helpers/agent-skills.d.ts +22 -0
- package/build/helpers/agent-skills.js +46 -0
- package/build/helpers/agent-skills.unit.d.ts +1 -0
- package/build/helpers/agent-skills.unit.js +49 -0
- package/build/helpers/article-search.d.ts +19 -0
- package/build/helpers/article-search.js +134 -0
- package/build/helpers/article.d.ts +13 -0
- package/build/helpers/article.js +17 -1
- package/build/helpers/dependency-dir.d.ts +5 -0
- package/build/helpers/dependency-dir.js +20 -0
- package/build/helpers/dependency-dir.unit.d.ts +1 -0
- package/build/helpers/dependency-dir.unit.js +25 -0
- package/build/helpers/dynamic-icon-resolver.d.ts +1 -1
- package/build/helpers/dynamic-icon.d.ts +1 -1
- package/build/helpers/head.d.ts +58 -0
- package/build/helpers/head.js +80 -0
- package/build/helpers/head.unit.d.ts +1 -0
- package/build/helpers/head.unit.js +110 -0
- package/build/helpers/llms.d.ts +33 -0
- package/build/helpers/llms.js +72 -0
- package/build/helpers/llms.unit.d.ts +1 -0
- package/build/helpers/llms.unit.js +98 -0
- package/build/helpers/nav-items.d.ts +11 -0
- package/build/helpers/nav-items.js +65 -0
- package/build/helpers/render-inline-markdown.d.ts +1 -0
- package/build/helpers/render-inline-markdown.js +34 -0
- package/build/helpers/render-inline-markdown.unit.d.ts +1 -0
- package/build/helpers/render-inline-markdown.unit.js +20 -0
- package/build/helpers/search-highlight.d.ts +8 -0
- package/build/helpers/search-highlight.js +59 -0
- package/build/helpers/search-highlight.unit.d.ts +1 -0
- package/build/helpers/search-highlight.unit.js +36 -0
- package/build/helpers/target-export.d.ts +9 -0
- package/build/helpers/target-export.js +24 -0
- package/build/helpers/target-export.unit.d.ts +1 -0
- package/build/helpers/target-export.unit.js +25 -0
- package/build/helpers/theme.d.ts +6 -2
- package/build/helpers/theme.js +40 -7
- package/build/helpers/theme.unit.d.ts +1 -0
- package/build/helpers/theme.unit.js +30 -0
- package/build/hooks/hydrated.d.ts +2 -0
- package/build/hooks/hydrated.js +15 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -1
- package/build/models/config.d.ts +52 -6
- package/build/models/config.js +17 -1
- package/build/models/section.d.ts +4 -2
- package/build/models/section.js +1 -1
- package/build/plugins/vite-agents.d.ts +17 -0
- package/build/plugins/vite-agents.js +109 -0
- package/build/plugins/vite-agents.unit.d.ts +1 -0
- package/build/plugins/vite-agents.unit.js +20 -0
- package/build/plugins/vite-livemark.d.ts +4 -5
- package/build/plugins/vite-livemark.js +56 -90
- package/build/plugins/vite-robots.d.ts +4 -2
- package/build/plugins/vite-robots.js +15 -2
- package/build/plugins/vite-robots.unit.js +5 -1
- package/build/program.js +4 -2
- package/build/routes/$.d.ts +4 -1
- package/build/routes/$.js +20 -9
- package/build/routes/__root.js +29 -63
- package/build/settings.js +2 -1
- package/build/vite.config.js +3 -1
- package/package.json +69 -66
- package/{.agents/skills → skills}/livemark-authoring/SKILL.md +2 -2
- package/{.agents/skills → skills}/livemark-configuration/SKILL.md +16 -5
- package/skills/livemark-customization/SKILL.md +146 -0
- package/source/actions/config/define.unit.ts +9 -0
- package/source/actions/escape/copy.ts +35 -0
- package/source/actions/escape/copy.unit.ts +51 -0
- package/source/actions/escape/list.ts +30 -0
- package/source/actions/escape/list.unit.ts +42 -0
- package/source/actions/target/build.ts +49 -69
- package/source/actions/target/build.unit.ts +95 -0
- package/source/actions/target/clear.ts +14 -0
- package/source/actions/target/clear.unit.ts +25 -0
- package/source/commands/build.ts +0 -1
- package/source/commands/clear.ts +15 -0
- package/source/commands/escape.ts +42 -59
- package/source/commands/preview.ts +0 -1
- package/source/commands/start.ts +0 -1
- package/source/components/AnsiCode.tsx +1 -1
- package/source/components/Article.tsx +8 -4
- package/source/components/Banner.tsx +12 -2
- package/source/components/BlogIndex.tsx +1 -1
- package/source/components/Callout.tsx +4 -6
- package/source/components/ChangelogIndex.tsx +1 -1
- package/source/components/ChoiceList.tsx +69 -0
- package/source/components/CodeBlock.tsx +6 -6
- package/source/components/CodeTabs.tsx +1 -1
- package/source/components/ContentTabs.tsx +1 -1
- package/source/components/DefaultCatchBoundary.tsx +4 -6
- package/source/components/Details.tsx +1 -1
- package/source/components/FileTree.tsx +1 -1
- package/source/components/Header.tsx +52 -0
- package/source/components/HeaderMenu.tsx +41 -0
- package/source/components/HeaderNav.tsx +145 -0
- package/source/components/HeaderSearch.tsx +77 -0
- package/source/components/InlineBadge.tsx +1 -1
- package/source/components/InlineToc.tsx +1 -1
- package/source/components/Layout.tsx +16 -160
- package/source/components/LinkButton.tsx +9 -1
- package/source/components/MenuSheet.tsx +92 -0
- package/source/components/MermaidRenderer.tsx +19 -8
- package/source/components/NotFound.tsx +3 -5
- package/source/components/PackageTabs.tsx +2 -2
- package/source/components/PageToolbar.tsx +11 -3
- package/source/components/PrevNext.tsx +2 -2
- package/source/components/Root.tsx +13 -0
- package/source/components/Search.tsx +28 -8
- package/source/components/SearchDialog.tsx +15 -189
- package/source/components/SheetPanel.tsx +69 -0
- package/source/components/Sidebar.tsx +27 -14
- package/source/components/SidebarArticles.tsx +4 -3
- package/source/components/SidebarLinks.tsx +3 -2
- package/source/components/SidebarPosts.tsx +3 -2
- package/source/components/SidebarReleases.tsx +3 -2
- package/source/components/SidebarSectionPicker.tsx +70 -0
- package/source/components/SiteTitle.tsx +5 -5
- package/source/components/SoundCloud.tsx +1 -1
- package/source/components/TagIndex.tsx +1 -1
- package/source/components/Theme.tsx +55 -29
- package/source/components/Toc.tsx +76 -55
- package/source/components/YouTube.tsx +1 -1
- package/source/content/article.ts +8 -13
- package/source/content-collections.ts +5 -4
- package/source/elements/alert-dialog.tsx +1 -1
- package/source/elements/alert.tsx +1 -1
- package/source/elements/badge.tsx +4 -0
- package/source/elements/button-group.tsx +4 -4
- package/source/elements/button.tsx +10 -6
- package/source/elements/calendar.tsx +1 -1
- package/source/elements/card.tsx +3 -3
- package/source/elements/command.tsx +7 -4
- package/source/elements/context-menu.tsx +5 -5
- package/source/elements/dialog.tsx +1 -1
- package/source/elements/drawer.tsx +59 -43
- package/source/elements/dropdown-menu.tsx +6 -6
- package/source/elements/empty.tsx +1 -1
- package/source/elements/field.tsx +1 -1
- package/source/elements/hover-card.tsx +1 -1
- package/source/elements/input-group.tsx +4 -4
- package/source/elements/input.tsx +1 -1
- package/source/elements/item.tsx +1 -1
- package/source/elements/menubar.tsx +8 -8
- package/source/elements/native-select.tsx +1 -1
- package/source/elements/popover.tsx +1 -1
- package/source/elements/select.tsx +3 -3
- package/source/elements/sidebar.tsx +8 -21
- package/source/elements/tabs.tsx +2 -2
- package/source/elements/textarea.tsx +1 -1
- package/source/elements/toggle-group.tsx +2 -2
- package/source/elements/toggle.tsx +1 -1
- package/source/env.d.ts +1 -0
- package/source/head.ts +7 -0
- package/source/helpers/agent-skills.ts +59 -0
- package/source/helpers/agent-skills.unit.ts +56 -0
- package/source/helpers/article-search.tsx +192 -0
- package/source/helpers/article.ts +17 -0
- package/source/helpers/dependency-dir.ts +20 -0
- package/source/helpers/dependency-dir.unit.ts +39 -0
- package/source/helpers/head.ts +105 -0
- package/source/helpers/head.unit.ts +118 -0
- package/source/helpers/llms.ts +109 -0
- package/source/helpers/llms.unit.ts +115 -0
- package/source/helpers/nav-items.tsx +102 -0
- package/source/helpers/render-inline-markdown.ts +44 -0
- package/source/helpers/render-inline-markdown.unit.ts +30 -0
- package/source/helpers/search-highlight.ts +73 -0
- package/source/helpers/search-highlight.unit.ts +42 -0
- package/source/helpers/target-export.ts +28 -0
- package/source/helpers/target-export.unit.ts +37 -0
- package/source/helpers/theme.ts +40 -6
- package/source/helpers/theme.unit.ts +32 -0
- package/source/hooks/hydrated.ts +18 -0
- package/source/index.ts +1 -0
- package/source/models/config.ts +24 -0
- package/source/models/section.ts +3 -0
- package/source/plugins/vite-agents.ts +135 -0
- package/source/plugins/vite-agents.unit.ts +26 -0
- package/source/plugins/vite-livemark.ts +54 -95
- package/source/plugins/vite-robots.ts +18 -3
- package/source/plugins/vite-robots.unit.ts +7 -0
- package/source/program.ts +2 -0
- package/source/routes/$.tsx +27 -9
- package/source/routes/__root.tsx +51 -71
- package/source/settings.ts +1 -0
- package/source/styles/general.css +59 -11
- package/source/styles/markdown.css +13 -7
- package/source/styles/shape.css +14 -0
- package/source/vite.config.ts +2 -0
- package/.agents/skills/change-review/SKILL.md +0 -47
- package/.agents/skills/livemark-customization/SKILL.md +0 -118
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useEffect, useRef, useState, type ReactNode } from "react"
|
|
1
|
+
import { ChevronUp } from "lucide-react"
|
|
2
|
+
import { useEffect, useRef, useState, type MouseEvent, type ReactNode } from "react"
|
|
3
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../elements/tabs.tsx"
|
|
3
4
|
import type { TocItem } from "../models/toc.ts"
|
|
5
|
+
import { ChoiceList, type Choice } from "./ChoiceList.tsx"
|
|
6
|
+
import { SheetPanel } from "./SheetPanel.tsx"
|
|
4
7
|
|
|
5
8
|
export function Toc(props: { items: TocItem[]; children?: ReactNode }) {
|
|
6
9
|
const activeId = useActiveHeading(props.items)
|
|
@@ -10,7 +13,12 @@ export function Toc(props: { items: TocItem[]; children?: ReactNode }) {
|
|
|
10
13
|
return (
|
|
11
14
|
<aside className="hidden xl:block w-56 shrink-0">
|
|
12
15
|
<div className="sticky top-20 max-h-[calc(100vh-5rem)] overflow-auto [scrollbar-width:none]">
|
|
13
|
-
{props.children
|
|
16
|
+
{props.children && (
|
|
17
|
+
<div className="mb-6">
|
|
18
|
+
<p className="text-sm font-medium mb-3">Actions</p>
|
|
19
|
+
{props.children}
|
|
20
|
+
</div>
|
|
21
|
+
)}
|
|
14
22
|
{props.items.length > 0 && (
|
|
15
23
|
<nav>
|
|
16
24
|
<p className="text-sm font-medium mb-3">Contents</p>
|
|
@@ -34,74 +42,87 @@ export function Toc(props: { items: TocItem[]; children?: ReactNode }) {
|
|
|
34
42
|
)
|
|
35
43
|
}
|
|
36
44
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
45
|
+
const SHEET_ACTIONS =
|
|
46
|
+
"[&_[data-slot=page-toolbar]]:-mx-2 [&_[data-slot=page-toolbar]]:gap-0.5 [&_[data-slot=page-action]]:h-10 [&_[data-slot=page-action]]:gap-2.5 [&_[data-slot=page-action]]:rounded-control [&_[data-slot=page-action]]:px-2 [&_[data-slot=page-action]]:text-base [&_[data-slot=page-action]]:text-foreground [&_[data-slot=page-action]:hover]:bg-muted [&_[data-slot=page-action]_svg]:size-[18px]"
|
|
47
|
+
|
|
48
|
+
/** Mobile-only sticky secondary bar showing the active heading; it opens a
|
|
49
|
+
* bottom sheet with the Contents and page Actions as two tabs. */
|
|
50
|
+
export function MobileToc(props: {
|
|
51
|
+
items: TocItem[]
|
|
52
|
+
title?: string
|
|
53
|
+
children?: ReactNode
|
|
54
|
+
}) {
|
|
40
55
|
const activeId = useActiveHeading(props.items)
|
|
41
56
|
const [open, setOpen] = useState(false)
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
if (!open) return
|
|
46
|
-
const onPointerDown = (event: MouseEvent) => {
|
|
47
|
-
if (!wrapperRef.current?.contains(event.target as Node)) setOpen(false)
|
|
48
|
-
}
|
|
49
|
-
const onKey = (event: KeyboardEvent) => {
|
|
50
|
-
if (event.key === "Escape") setOpen(false)
|
|
51
|
-
}
|
|
52
|
-
document.addEventListener("mousedown", onPointerDown)
|
|
53
|
-
document.addEventListener("keydown", onKey)
|
|
54
|
-
return () => {
|
|
55
|
-
document.removeEventListener("mousedown", onPointerDown)
|
|
56
|
-
document.removeEventListener("keydown", onKey)
|
|
57
|
-
}
|
|
58
|
-
}, [open])
|
|
57
|
+
const [tab, setTab] = useState(props.items.length > 0 ? "contents" : "actions")
|
|
58
|
+
const pendingUrl = useRef<string | null>(null)
|
|
59
59
|
|
|
60
60
|
if (props.items.length === 0 && !props.children) return null
|
|
61
61
|
|
|
62
62
|
const active = props.items.find(item => item.url.slice(1) === activeId)
|
|
63
63
|
const title = active?.title ?? props.items[0]?.title ?? "Contents"
|
|
64
|
+
const choices: Choice[] = props.items.map(item => ({
|
|
65
|
+
id: item.url.slice(1),
|
|
66
|
+
label: item.title,
|
|
67
|
+
href: item.url,
|
|
68
|
+
depth: Math.max(0, item.depth - 2),
|
|
69
|
+
}))
|
|
70
|
+
|
|
71
|
+
// The sheet locks page scroll until it has closed, which swallows a native hash
|
|
72
|
+
// jump made from inside it; navigate once the close has finished.
|
|
73
|
+
const handleSelect = (choice: Choice, event: MouseEvent<HTMLElement>) => {
|
|
74
|
+
event.preventDefault()
|
|
75
|
+
pendingUrl.current = choice.href ?? null
|
|
76
|
+
setOpen(false)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const handleOpenChangeComplete = (isOpen: boolean) => {
|
|
80
|
+
const url = pendingUrl.current
|
|
81
|
+
if (isOpen || !url) return
|
|
82
|
+
pendingUrl.current = null
|
|
83
|
+
history.pushState(null, "", url)
|
|
84
|
+
document.getElementById(url.slice(1))?.scrollIntoView()
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const contents = (
|
|
88
|
+
<ChoiceList choices={choices} selectedId={activeId} onSelect={handleSelect} />
|
|
89
|
+
)
|
|
64
90
|
|
|
65
91
|
return (
|
|
66
|
-
<div
|
|
92
|
+
<div className="xl:hidden sticky top-16 z-20 border-b bg-background">
|
|
67
93
|
<button
|
|
68
94
|
type="button"
|
|
69
|
-
onClick={() => setOpen(
|
|
70
|
-
aria-
|
|
95
|
+
onClick={() => setOpen(true)}
|
|
96
|
+
aria-haspopup="dialog"
|
|
71
97
|
className="flex w-full items-center gap-3 px-4 py-3 text-sm text-muted-foreground"
|
|
72
98
|
>
|
|
73
99
|
<ScrollProgressRing />
|
|
74
100
|
<span className="truncate flex-1 text-left">{title}</span>
|
|
75
|
-
<
|
|
76
|
-
className={`size-4 shrink-0 transition-transform ${open ? "rotate-180" : ""}`}
|
|
77
|
-
/>
|
|
101
|
+
<ChevronUp className="size-4 shrink-0" />
|
|
78
102
|
</button>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
</div>
|
|
103
|
-
</div>
|
|
104
|
-
)}
|
|
103
|
+
<SheetPanel
|
|
104
|
+
open={open}
|
|
105
|
+
onOpenChange={setOpen}
|
|
106
|
+
onOpenChangeComplete={handleOpenChangeComplete}
|
|
107
|
+
title={props.title ?? "On this page"}
|
|
108
|
+
>
|
|
109
|
+
{props.children && props.items.length > 0 ? (
|
|
110
|
+
<Tabs value={tab} onValueChange={value => setTab(String(value))}>
|
|
111
|
+
<TabsList className="mb-2 w-full">
|
|
112
|
+
<TabsTrigger value="contents">Contents</TabsTrigger>
|
|
113
|
+
<TabsTrigger value="actions">Actions</TabsTrigger>
|
|
114
|
+
</TabsList>
|
|
115
|
+
<TabsContent value="contents">{contents}</TabsContent>
|
|
116
|
+
<TabsContent value="actions" className={SHEET_ACTIONS}>
|
|
117
|
+
{props.children}
|
|
118
|
+
</TabsContent>
|
|
119
|
+
</Tabs>
|
|
120
|
+
) : props.children ? (
|
|
121
|
+
<div className={SHEET_ACTIONS}>{props.children}</div>
|
|
122
|
+
) : (
|
|
123
|
+
contents
|
|
124
|
+
)}
|
|
125
|
+
</SheetPanel>
|
|
105
126
|
</div>
|
|
106
127
|
)
|
|
107
128
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Renders a responsive YouTube iframe embed */
|
|
2
2
|
export function YouTube(props: { id: string }) {
|
|
3
3
|
return (
|
|
4
|
-
<div className="not-prose my-4 overflow-hidden rounded-
|
|
4
|
+
<div className="not-prose my-4 overflow-hidden rounded-card border">
|
|
5
5
|
<div className="aspect-video">
|
|
6
6
|
<iframe
|
|
7
7
|
className="h-full w-full"
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { config } from "livemark:virtual"
|
|
2
2
|
import { allArticles } from "content-collections"
|
|
3
3
|
import type { ArticleNode } from "../models/article.ts"
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
buildArticleTree,
|
|
6
|
+
compareArticleDate,
|
|
7
|
+
compareArticleOrder,
|
|
8
|
+
flattenArticleTree,
|
|
9
|
+
} from "../helpers/article.ts"
|
|
5
10
|
import { matchSection, partitionBySection } from "../helpers/section.ts"
|
|
6
11
|
|
|
7
12
|
/**
|
|
@@ -9,9 +14,7 @@ import { matchSection, partitionBySection } from "../helpers/section.ts"
|
|
|
9
14
|
* positive values first (ascending), then unordered, then negative values
|
|
10
15
|
* (so `order: -1` lands at the very end, `-2` just before it, and so on).
|
|
11
16
|
*/
|
|
12
|
-
export const sortedArticles = [...allArticles].sort(
|
|
13
|
-
(a, b) => orderKey(a.order) - orderKey(b.order),
|
|
14
|
-
)
|
|
17
|
+
export const sortedArticles = [...allArticles].sort(compareArticleOrder)
|
|
15
18
|
|
|
16
19
|
/** The article whose path is `/`, if any (rendered in place at the root) */
|
|
17
20
|
export const homeArticle = sortedArticles.find(a => a.path === "/")
|
|
@@ -25,12 +28,6 @@ export const flatArticles = flattenArticleTree(articleTree)
|
|
|
25
28
|
/** The first article in sidebar order, used as the default landing page */
|
|
26
29
|
export const firstArticle = sortedArticles.find(a => a.path === flatArticles[0])
|
|
27
30
|
|
|
28
|
-
function orderKey(order?: number) {
|
|
29
|
-
if (order === undefined) return Number.MAX_SAFE_INTEGER / 2
|
|
30
|
-
if (order < 0) return Number.MAX_SAFE_INTEGER + order
|
|
31
|
-
return order
|
|
32
|
-
}
|
|
33
|
-
|
|
34
31
|
const configSections = config.sections
|
|
35
32
|
|
|
36
33
|
/** Route-bound sections (everything except `custom`). Custom sections
|
|
@@ -53,9 +50,7 @@ if (routedSections.length) {
|
|
|
53
50
|
const section = sectionByPrefix.get(key)
|
|
54
51
|
const sorted =
|
|
55
52
|
section?.type === "blog" || section?.type === "changelog"
|
|
56
|
-
? [...bucket].sort(
|
|
57
|
-
(a, b) => new Date(b.date ?? 0).getTime() - new Date(a.date ?? 0).getTime(),
|
|
58
|
-
)
|
|
53
|
+
? [...bucket].sort(compareArticleDate)
|
|
59
54
|
: bucket
|
|
60
55
|
const tree = buildArticleTree(sorted)
|
|
61
56
|
const flat = flattenArticleTree(tree)
|
|
@@ -49,6 +49,7 @@ import { transformerIcon } from "./plugins/shiki-icon.ts"
|
|
|
49
49
|
import { resolveAssetPath } from "./helpers/resolve-asset-path.ts"
|
|
50
50
|
import { resolveIncludes } from "./helpers/resolve-includes.ts"
|
|
51
51
|
import { extractSearchText } from "./helpers/search-text.ts"
|
|
52
|
+
import { stripLeadingH1 } from "./helpers/llms.ts"
|
|
52
53
|
import { extractToc } from "./helpers/toc.ts"
|
|
53
54
|
|
|
54
55
|
const config = await loadConfig()
|
|
@@ -98,10 +99,6 @@ function getLastUpdated(filePath: string) {
|
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
|
|
101
|
-
function stripLeadingH1(content: string) {
|
|
102
|
-
return content.replace(/^[ \t]*#\s+[^\n]*\n+/, "")
|
|
103
|
-
}
|
|
104
|
-
|
|
105
102
|
function extractTitle(content: string, path: string) {
|
|
106
103
|
const match = /^#\s+(.+)$/m.exec(content)
|
|
107
104
|
if (match) return match[1]!
|
|
@@ -183,6 +180,10 @@ const articles = defineCollection({
|
|
|
183
180
|
light: config.codeThemeLight,
|
|
184
181
|
dark: config.codeThemeDark,
|
|
185
182
|
},
|
|
183
|
+
// A fence with no or an unknown lang is otherwise skipped by Shiki and
|
|
184
|
+
// renders without line padding, theme colours or transformers.
|
|
185
|
+
defaultLanguage: "text",
|
|
186
|
+
fallbackLanguage: "text",
|
|
186
187
|
// Darken catppuccin-latte's green (the colour used for strings and
|
|
187
188
|
// some comments) — the theme default #40A02B lands at 3.2:1 on the
|
|
188
189
|
// code-block background, below the WCAG AA 4.5:1 threshold.
|
|
@@ -46,7 +46,7 @@ function AlertDialogContent({
|
|
|
46
46
|
data-slot="alert-dialog-content"
|
|
47
47
|
data-size={size}
|
|
48
48
|
className={cn(
|
|
49
|
-
"group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-6 rounded-
|
|
49
|
+
"group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-6 rounded-panel bg-popover p-6 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
50
50
|
className,
|
|
51
51
|
)}
|
|
52
52
|
{...props}
|
|
@@ -2,7 +2,7 @@ import { cva, type VariantProps } from "class-variance-authority"
|
|
|
2
2
|
import { cn } from "cn"
|
|
3
3
|
|
|
4
4
|
const alertVariants = cva(
|
|
5
|
-
"grid gap-0.5 rounded-
|
|
5
|
+
"grid gap-0.5 rounded-card border px-4 py-3 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 w-full relative group/alert",
|
|
6
6
|
{
|
|
7
7
|
variants: {
|
|
8
8
|
variant: {
|
|
@@ -12,6 +12,10 @@ const badgeVariants = cva(
|
|
|
12
12
|
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
13
13
|
destructive:
|
|
14
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",
|
|
15
|
+
positive:
|
|
16
|
+
"bg-positive/10 [a]:hover:bg-positive/20 focus-visible:ring-positive/20 dark:focus-visible:ring-positive/40 text-positive-tint-foreground dark:bg-positive/20",
|
|
17
|
+
warning:
|
|
18
|
+
"bg-warning/10 [a]:hover:bg-warning/20 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40 text-warning-tint-foreground dark:bg-warning/20",
|
|
15
19
|
outline:
|
|
16
20
|
"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
17
21
|
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
@@ -6,14 +6,14 @@ import { cn } from "cn"
|
|
|
6
6
|
import { Separator } from "./separator.tsx"
|
|
7
7
|
|
|
8
8
|
const buttonGroupVariants = cva(
|
|
9
|
-
"flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-
|
|
9
|
+
"flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-control [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
|
10
10
|
{
|
|
11
11
|
variants: {
|
|
12
12
|
orientation: {
|
|
13
13
|
horizontal:
|
|
14
|
-
"*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-
|
|
14
|
+
"*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-control! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0",
|
|
15
15
|
vertical:
|
|
16
|
-
"flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-
|
|
16
|
+
"flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-control! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0",
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
defaultVariants: {
|
|
@@ -48,7 +48,7 @@ function ButtonGroupText({
|
|
|
48
48
|
props: mergeProps<"div">(
|
|
49
49
|
{
|
|
50
50
|
className: cn(
|
|
51
|
-
"flex items-center gap-2 rounded-
|
|
51
|
+
"flex items-center gap-2 rounded-control border bg-muted px-2.5 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
52
52
|
className,
|
|
53
53
|
),
|
|
54
54
|
},
|
|
@@ -3,7 +3,7 @@ import { cva, type VariantProps } from "class-variance-authority"
|
|
|
3
3
|
import { cn } from "cn"
|
|
4
4
|
|
|
5
5
|
const buttonVariants = cva(
|
|
6
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-
|
|
6
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-control border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",
|
|
7
7
|
{
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
@@ -16,19 +16,23 @@ const buttonVariants = cva(
|
|
|
16
16
|
"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",
|
|
17
17
|
destructive:
|
|
18
18
|
"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",
|
|
19
|
+
positive:
|
|
20
|
+
"bg-positive/10 hover:bg-positive/20 focus-visible:ring-positive/20 dark:focus-visible:ring-positive/40 dark:bg-positive/20 text-positive-tint-foreground focus-visible:border-positive/40 dark:hover:bg-positive/30",
|
|
21
|
+
warning:
|
|
22
|
+
"bg-warning/10 hover:bg-warning/20 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40 dark:bg-warning/20 text-warning-tint-foreground focus-visible:border-warning/40 dark:hover:bg-warning/30",
|
|
19
23
|
link: "text-primary underline-offset-4 hover:underline",
|
|
20
24
|
},
|
|
21
25
|
size: {
|
|
22
26
|
default:
|
|
23
|
-
"h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-
|
|
24
|
-
xs: "h-6 gap-1 rounded-
|
|
25
|
-
sm: "h-8 gap-1 rounded-
|
|
27
|
+
"h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-control has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
28
|
+
xs: "h-6 gap-1 rounded-control-xs px-2 text-xs in-data-[slot=button-group]:rounded-control has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
29
|
+
sm: "h-8 gap-1 rounded-control-sm px-2.5 in-data-[slot=button-group]:rounded-control has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
|
|
26
30
|
lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
|
|
27
31
|
icon: "size-9",
|
|
28
32
|
"icon-xs":
|
|
29
|
-
"size-6 rounded-
|
|
33
|
+
"size-6 rounded-control-xs in-data-[slot=button-group]:rounded-control [&_svg:not([class*='size-'])]:size-3",
|
|
30
34
|
"icon-sm":
|
|
31
|
-
"size-8 rounded-
|
|
35
|
+
"size-8 rounded-control-sm in-data-[slot=button-group]:rounded-control",
|
|
32
36
|
"icon-lg": "size-10",
|
|
33
37
|
},
|
|
34
38
|
},
|
|
@@ -79,7 +79,7 @@ function Calendar({
|
|
|
79
79
|
: "cn-calendar-caption-label flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
|
|
80
80
|
defaultClassNames.caption_label,
|
|
81
81
|
),
|
|
82
|
-
|
|
82
|
+
month_grid: "w-full border-collapse",
|
|
83
83
|
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
84
84
|
weekday: cn(
|
|
85
85
|
"flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none",
|
package/source/elements/card.tsx
CHANGED
|
@@ -11,7 +11,7 @@ function Card({
|
|
|
11
11
|
data-slot="card"
|
|
12
12
|
data-size={size}
|
|
13
13
|
className={cn(
|
|
14
|
-
"ring-foreground/10 bg-card text-card-foreground gap-6 overflow-hidden rounded-
|
|
14
|
+
"ring-foreground/10 bg-card text-card-foreground gap-6 overflow-hidden rounded-card py-6 text-sm shadow-xs ring-1 has-[>img:first-child]:pt-0 data-[size=sm]:gap-4 data-[size=sm]:py-4 *:[img:first-child]:rounded-t-card *:[img:last-child]:rounded-b-card group/card flex flex-col",
|
|
15
15
|
className,
|
|
16
16
|
)}
|
|
17
17
|
{...props}
|
|
@@ -24,7 +24,7 @@ function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
24
24
|
<div
|
|
25
25
|
data-slot="card-header"
|
|
26
26
|
className={cn(
|
|
27
|
-
"gap-1 rounded-t-
|
|
27
|
+
"gap-1 rounded-t-card px-6 group-data-[size=sm]/card:px-4 [.border-b]:pb-6 group-data-[size=sm]/card:[.border-b]:pb-4 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",
|
|
28
28
|
className,
|
|
29
29
|
)}
|
|
30
30
|
{...props}
|
|
@@ -83,7 +83,7 @@ function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
83
83
|
<div
|
|
84
84
|
data-slot="card-footer"
|
|
85
85
|
className={cn(
|
|
86
|
-
"rounded-b-
|
|
86
|
+
"rounded-b-card px-6 group-data-[size=sm]/card:px-4 [.border-t]:pt-6 group-data-[size=sm]/card:[.border-t]:pt-4 flex items-center",
|
|
87
87
|
className,
|
|
88
88
|
)}
|
|
89
89
|
{...props}
|
|
@@ -17,7 +17,7 @@ function Command({ className, ...props }: React.ComponentProps<typeof CommandPri
|
|
|
17
17
|
<CommandPrimitive
|
|
18
18
|
data-slot="command"
|
|
19
19
|
className={cn(
|
|
20
|
-
"flex size-full flex-col overflow-hidden rounded-
|
|
20
|
+
"flex size-full flex-col overflow-hidden rounded-menu! bg-popover p-1 text-popover-foreground",
|
|
21
21
|
className,
|
|
22
22
|
)}
|
|
23
23
|
{...props}
|
|
@@ -50,7 +50,10 @@ function CommandDialog({
|
|
|
50
50
|
<DialogDescription>{description}</DialogDescription>
|
|
51
51
|
</DialogHeader>
|
|
52
52
|
<DialogContent
|
|
53
|
-
className={cn(
|
|
53
|
+
className={cn(
|
|
54
|
+
"top-1/3 translate-y-0 overflow-hidden rounded-panel! p-0",
|
|
55
|
+
className,
|
|
56
|
+
)}
|
|
54
57
|
showCloseButton={showCloseButton}
|
|
55
58
|
>
|
|
56
59
|
<Command shouldFilter={shouldFilter} loop={loop}>
|
|
@@ -71,7 +74,7 @@ function CommandInput({
|
|
|
71
74
|
const showClear = !!props.value
|
|
72
75
|
return (
|
|
73
76
|
<div data-slot="command-input-wrapper" className="p-1 pb-2">
|
|
74
|
-
<InputGroup className="h-12! rounded-
|
|
77
|
+
<InputGroup className="h-12! rounded-control! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-3!">
|
|
75
78
|
<CommandPrimitive.Input
|
|
76
79
|
data-slot="command-input"
|
|
77
80
|
className={cn(
|
|
@@ -164,7 +167,7 @@ function CommandItem({
|
|
|
164
167
|
<CommandPrimitive.Item
|
|
165
168
|
data-slot="command-item"
|
|
166
169
|
className={cn(
|
|
167
|
-
"group/command-item relative flex cursor-pointer items-center gap-2 rounded-
|
|
170
|
+
"group/command-item relative flex cursor-pointer items-center gap-2 rounded-menu-item px-2 py-1.5 text-sm outline-hidden select-none bg-muted/50 in-data-[slot=dialog-content]:rounded-menu-item! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-primary/10 data-[selected=true]:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[selected=true]:**:[svg]:text-foreground",
|
|
168
171
|
className,
|
|
169
172
|
)}
|
|
170
173
|
{...props}
|
|
@@ -46,7 +46,7 @@ function ContextMenuContent({
|
|
|
46
46
|
<ContextMenuPrimitive.Popup
|
|
47
47
|
data-slot="context-menu-content"
|
|
48
48
|
className={cn(
|
|
49
|
-
"cn-menu-target cn-menu-translucent z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-
|
|
49
|
+
"cn-menu-target cn-menu-translucent z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-menu bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
50
50
|
className,
|
|
51
51
|
)}
|
|
52
52
|
{...props}
|
|
@@ -95,7 +95,7 @@ function ContextMenuItem({
|
|
|
95
95
|
data-inset={inset}
|
|
96
96
|
data-variant={variant}
|
|
97
97
|
className={cn(
|
|
98
|
-
"group/context-menu-item relative flex cursor-default items-center gap-2 rounded-
|
|
98
|
+
"group/context-menu-item relative flex cursor-default items-center gap-2 rounded-menu-item px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive",
|
|
99
99
|
className,
|
|
100
100
|
)}
|
|
101
101
|
{...props}
|
|
@@ -120,7 +120,7 @@ function ContextMenuSubTrigger({
|
|
|
120
120
|
data-slot="context-menu-sub-trigger"
|
|
121
121
|
data-inset={inset}
|
|
122
122
|
className={cn(
|
|
123
|
-
"flex cursor-default items-center rounded-
|
|
123
|
+
"flex cursor-default items-center rounded-menu-item px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
124
124
|
className,
|
|
125
125
|
)}
|
|
126
126
|
{...props}
|
|
@@ -158,7 +158,7 @@ function ContextMenuCheckboxItem({
|
|
|
158
158
|
data-slot="context-menu-checkbox-item"
|
|
159
159
|
data-inset={inset}
|
|
160
160
|
className={cn(
|
|
161
|
-
"relative flex cursor-default items-center gap-2 rounded-
|
|
161
|
+
"relative flex cursor-default items-center gap-2 rounded-menu-item py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
162
162
|
className,
|
|
163
163
|
)}
|
|
164
164
|
checked={checked}
|
|
@@ -193,7 +193,7 @@ function ContextMenuRadioItem({
|
|
|
193
193
|
data-slot="context-menu-radio-item"
|
|
194
194
|
data-inset={inset}
|
|
195
195
|
className={cn(
|
|
196
|
-
"relative flex cursor-default items-center gap-2 rounded-
|
|
196
|
+
"relative flex cursor-default items-center gap-2 rounded-menu-item py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
197
197
|
className,
|
|
198
198
|
)}
|
|
199
199
|
{...props}
|
|
@@ -46,7 +46,7 @@ function DialogContent({
|
|
|
46
46
|
<DialogPrimitive.Popup
|
|
47
47
|
data-slot="dialog-content"
|
|
48
48
|
className={cn(
|
|
49
|
-
"bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-6 rounded-
|
|
49
|
+
"bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-6 rounded-panel p-6 text-sm ring-1 duration-100 sm:max-w-md fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",
|
|
50
50
|
className,
|
|
51
51
|
)}
|
|
52
52
|
{...props}
|