livemark 0.2.0 → 0.7.1

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.
Files changed (348) hide show
  1. package/LICENSE.md +9 -0
  2. package/README.md +5 -1
  3. package/build/actions/changelog/build.d.ts +14 -0
  4. package/build/actions/changelog/build.js +158 -0
  5. package/build/actions/changelog/build.unit.js +66 -0
  6. package/build/actions/config/define.d.ts +6 -0
  7. package/build/actions/config/define.js +8 -0
  8. package/build/actions/config/define.unit.js +29 -0
  9. package/build/actions/config/load.d.ts +5 -0
  10. package/build/actions/config/load.js +25 -0
  11. package/build/actions/config/load.unit.js +23 -0
  12. package/build/commands/build.d.ts +5 -0
  13. package/build/commands/build.js +14 -0
  14. package/build/commands/escape.d.ts +9 -0
  15. package/build/commands/escape.js +56 -0
  16. package/build/commands/preview.d.ts +5 -0
  17. package/build/commands/preview.js +18 -0
  18. package/build/commands/start.d.ts +5 -0
  19. package/build/commands/start.js +19 -0
  20. package/build/docs/markdown/includes/example.d.ts +58 -0
  21. package/build/docs/markdown/includes/example.js +5 -0
  22. package/build/entrypoints/main.d.ts +2 -0
  23. package/build/entrypoints/main.js +12 -0
  24. package/build/helpers/program.d.ts +2 -0
  25. package/build/helpers/program.js +5 -0
  26. package/build/index.d.ts +1 -4
  27. package/build/index.js +2 -5
  28. package/build/livemark.config.d.ts +58 -0
  29. package/build/livemark.config.js +25 -0
  30. package/build/models/config.d.ts +340 -0
  31. package/build/models/config.js +34 -0
  32. package/build/models/link.d.ts +13 -0
  33. package/build/models/link.js +9 -0
  34. package/build/models/patch.d.ts +21 -0
  35. package/build/models/patch.js +7 -0
  36. package/build/models/section.d.ts +75 -0
  37. package/build/models/section.js +26 -0
  38. package/build/models/theme.d.ts +72 -0
  39. package/build/models/theme.js +73 -0
  40. package/build/program.d.ts +2 -0
  41. package/build/program.js +16 -0
  42. package/build/vite.config.d.ts +2 -0
  43. package/build/vite.config.js +48 -0
  44. package/build/website/assets/logo.svg +117 -0
  45. package/build/website/client.tsx +10 -0
  46. package/build/website/components/Abbr.tsx +17 -0
  47. package/build/website/components/AnsiCode.tsx +15 -0
  48. package/build/website/components/Article.tsx +172 -0
  49. package/build/website/components/BackToTop.tsx +32 -0
  50. package/build/website/components/Banner.tsx +32 -0
  51. package/build/website/components/BlogIndex.tsx +121 -0
  52. package/build/website/components/BlogSidebar.tsx +162 -0
  53. package/build/website/components/Breadcrumbs.tsx +22 -0
  54. package/build/website/components/Callout.tsx +72 -0
  55. package/build/website/components/Card.tsx +48 -0
  56. package/build/website/components/Cards.tsx +8 -0
  57. package/build/website/components/ChangelogIndex.tsx +111 -0
  58. package/build/website/components/ChangelogSidebar.tsx +120 -0
  59. package/build/website/components/CodeBlock.tsx +135 -0
  60. package/build/website/components/CodeTabs.tsx +83 -0
  61. package/build/website/components/Column.tsx +4 -0
  62. package/build/website/components/Columns.tsx +12 -0
  63. package/build/website/components/Content.tsx +7 -0
  64. package/build/website/components/ContentTab.tsx +7 -0
  65. package/build/website/components/ContentTabs.tsx +82 -0
  66. package/build/website/components/DefaultCatchBoundary.tsx +54 -0
  67. package/build/website/components/DefinitionList.tsx +21 -0
  68. package/build/website/components/Details.tsx +30 -0
  69. package/build/website/components/FileTree.tsx +52 -0
  70. package/build/website/components/Footer.tsx +16 -0
  71. package/build/website/components/FootnoteRef.tsx +52 -0
  72. package/build/website/components/Heading.tsx +20 -0
  73. package/build/website/components/InlineBadge.tsx +9 -0
  74. package/build/website/components/InlineIcon.tsx +10 -0
  75. package/build/website/components/InlineToc.tsx +31 -0
  76. package/build/website/components/Layout.tsx +190 -0
  77. package/build/website/components/LinkButton.tsx +31 -0
  78. package/build/website/components/Mermaid.tsx +18 -0
  79. package/build/website/components/MermaidRenderer.tsx +37 -0
  80. package/build/website/components/MiniSidebar.tsx +49 -0
  81. package/build/website/components/NotFound.tsx +27 -0
  82. package/build/website/components/PackageTabs.tsx +74 -0
  83. package/build/website/components/PageToolbar.tsx +75 -0
  84. package/build/website/components/PrevNext.tsx +60 -0
  85. package/build/website/components/Search.tsx +28 -0
  86. package/build/website/components/SearchDialog.tsx +245 -0
  87. package/build/website/components/Section.tsx +24 -0
  88. package/build/website/components/SectionHeader.tsx +35 -0
  89. package/build/website/components/Sidebar.tsx +160 -0
  90. package/build/website/components/SidebarLinks.tsx +70 -0
  91. package/build/website/components/SidebarSections.tsx +71 -0
  92. package/build/website/components/SiteTitle.tsx +21 -0
  93. package/build/website/components/SortableTable.tsx +81 -0
  94. package/build/website/components/SoundCloud.tsx +16 -0
  95. package/build/website/components/TagIndex.tsx +120 -0
  96. package/build/website/components/Theme.tsx +39 -0
  97. package/build/website/components/Toc.tsx +226 -0
  98. package/build/website/components/YouTube.tsx +16 -0
  99. package/build/website/components/ZoomImage.tsx +25 -0
  100. package/build/website/content/article.ts +78 -0
  101. package/build/website/content/tag.ts +29 -0
  102. package/build/website/content-collections.ts +208 -0
  103. package/build/website/elements/accordion.tsx +78 -0
  104. package/build/website/elements/alert-dialog.tsx +185 -0
  105. package/build/website/elements/alert.tsx +74 -0
  106. package/build/website/elements/aspect-ratio.tsx +22 -0
  107. package/build/website/elements/avatar.tsx +107 -0
  108. package/build/website/elements/badge.tsx +51 -0
  109. package/build/website/elements/breadcrumb.tsx +120 -0
  110. package/build/website/elements/button-group.tsx +87 -0
  111. package/build/website/elements/button.tsx +57 -0
  112. package/build/website/elements/calendar.tsx +229 -0
  113. package/build/website/elements/card.tsx +102 -0
  114. package/build/website/elements/carousel.tsx +240 -0
  115. package/build/website/elements/chart.tsx +372 -0
  116. package/build/website/elements/checkbox.tsx +26 -0
  117. package/build/website/elements/collapsible.tsx +19 -0
  118. package/build/website/elements/command.tsx +210 -0
  119. package/build/website/elements/context-menu.tsx +270 -0
  120. package/build/website/elements/dialog.tsx +152 -0
  121. package/build/website/elements/direction.tsx +4 -0
  122. package/build/website/elements/drawer.tsx +127 -0
  123. package/build/website/elements/dropdown-menu.tsx +260 -0
  124. package/build/website/elements/empty.tsx +104 -0
  125. package/build/website/elements/field.tsx +235 -0
  126. package/build/website/elements/hover-card.tsx +49 -0
  127. package/build/website/elements/input-group.tsx +171 -0
  128. package/build/website/elements/input-otp.tsx +84 -0
  129. package/build/website/elements/input.tsx +18 -0
  130. package/build/website/elements/item.tsx +199 -0
  131. package/build/website/elements/kbd.tsx +26 -0
  132. package/build/website/elements/label.tsx +17 -0
  133. package/build/website/elements/menubar.tsx +282 -0
  134. package/build/website/elements/native-select.tsx +56 -0
  135. package/build/website/elements/navigation-menu.tsx +171 -0
  136. package/build/website/elements/pagination.tsx +133 -0
  137. package/build/website/elements/popover.tsx +88 -0
  138. package/build/website/elements/progress.tsx +81 -0
  139. package/build/website/elements/radio-group.tsx +36 -0
  140. package/build/website/elements/resizable.tsx +48 -0
  141. package/build/website/elements/scroll-area.tsx +51 -0
  142. package/build/website/elements/select.tsx +200 -0
  143. package/build/website/elements/separator.tsx +22 -0
  144. package/build/website/elements/sheet.tsx +130 -0
  145. package/build/website/elements/sidebar.tsx +717 -0
  146. package/build/website/elements/skeleton.tsx +13 -0
  147. package/build/website/elements/slider.tsx +57 -0
  148. package/build/website/elements/sonner.tsx +40 -0
  149. package/build/website/elements/spinner.tsx +16 -0
  150. package/build/website/elements/switch.tsx +30 -0
  151. package/build/website/elements/table.tsx +112 -0
  152. package/build/website/elements/tabs.tsx +79 -0
  153. package/build/website/elements/textarea.tsx +16 -0
  154. package/build/website/elements/toggle-group.tsx +87 -0
  155. package/build/website/elements/toggle.tsx +43 -0
  156. package/build/website/elements/tooltip.tsx +67 -0
  157. package/build/website/env.d.ts +14 -0
  158. package/build/website/helpers/article-icon.ts +61 -0
  159. package/build/website/helpers/article.ts +90 -0
  160. package/build/website/helpers/changelog-source.ts +16 -0
  161. package/build/website/helpers/changelog-source.unit.ts +38 -0
  162. package/build/website/helpers/dynamic-icon-resolver.tsx +19 -0
  163. package/build/website/helpers/dynamic-icon.tsx +12 -0
  164. package/build/website/helpers/favicon.ts +7 -0
  165. package/build/website/helpers/model.ts +4 -0
  166. package/build/website/helpers/resolve-asset-path.ts +9 -0
  167. package/build/website/helpers/resolve-includes.ts +131 -0
  168. package/build/website/helpers/resolve-includes.unit.ts +126 -0
  169. package/build/website/helpers/search-text.ts +15 -0
  170. package/build/website/helpers/section.ts +50 -0
  171. package/build/website/helpers/section.unit.ts +71 -0
  172. package/build/website/helpers/style.ts +6 -0
  173. package/build/website/helpers/theme.ts +27 -0
  174. package/build/website/helpers/toc-context.ts +10 -0
  175. package/build/website/helpers/toc.ts +46 -0
  176. package/build/website/helpers/toc.unit.ts +74 -0
  177. package/build/website/hooks/in-view.ts +30 -0
  178. package/build/website/hooks/media.ts +19 -0
  179. package/build/website/models/article.ts +55 -0
  180. package/build/website/models/toc.ts +5 -0
  181. package/build/website/plugins/rehype-inline-code.ts +107 -0
  182. package/build/website/plugins/rehype-task-list-a11y.ts +33 -0
  183. package/build/website/plugins/remark-abbr.ts +46 -0
  184. package/build/website/plugins/remark-abbr.unit.ts +99 -0
  185. package/build/website/plugins/remark-ansi.ts +248 -0
  186. package/build/website/plugins/remark-ansi.unit.ts +197 -0
  187. package/build/website/plugins/remark-badge.ts +50 -0
  188. package/build/website/plugins/remark-badge.unit.ts +96 -0
  189. package/build/website/plugins/remark-button.ts +60 -0
  190. package/build/website/plugins/remark-button.unit.ts +147 -0
  191. package/build/website/plugins/remark-callout.ts +57 -0
  192. package/build/website/plugins/remark-card.ts +80 -0
  193. package/build/website/plugins/remark-code-tabs.ts +87 -0
  194. package/build/website/plugins/remark-columns.ts +66 -0
  195. package/build/website/plugins/remark-custom-heading-id.ts +70 -0
  196. package/build/website/plugins/remark-custom-heading-id.unit.ts +131 -0
  197. package/build/website/plugins/remark-deflist.ts +36 -0
  198. package/build/website/plugins/remark-details.ts +49 -0
  199. package/build/website/plugins/remark-filetree.ts +89 -0
  200. package/build/website/plugins/remark-filetree.unit.ts +137 -0
  201. package/build/website/plugins/remark-github-callout.ts +71 -0
  202. package/build/website/plugins/remark-icon.ts +42 -0
  203. package/build/website/plugins/remark-image.ts +34 -0
  204. package/build/website/plugins/remark-media.ts +62 -0
  205. package/build/website/plugins/remark-media.unit.ts +74 -0
  206. package/build/website/plugins/remark-mermaid.ts +23 -0
  207. package/build/website/plugins/remark-npm.ts +52 -0
  208. package/build/website/plugins/remark-steps.ts +36 -0
  209. package/build/website/plugins/remark-steps.unit.ts +97 -0
  210. package/build/website/plugins/remark-tab.ts +100 -0
  211. package/build/website/plugins/remark-tab.unit.ts +181 -0
  212. package/build/website/plugins/remark-toc.ts +39 -0
  213. package/build/website/plugins/remark-toc.unit.ts +82 -0
  214. package/build/website/plugins/shiki-icon.ts +82 -0
  215. package/build/website/plugins/shiki-line-highlight.ts +174 -0
  216. package/build/website/plugins/vite-livemark.ts +91 -0
  217. package/build/website/routeTree.gen.ts +86 -0
  218. package/build/website/router.tsx +34 -0
  219. package/build/website/routes/$.tsx +92 -0
  220. package/build/website/routes/__root.tsx +97 -0
  221. package/build/website/server.ts +7 -0
  222. package/build/website/styles/general.css +163 -0
  223. package/build/website/styles/markdown.css +214 -0
  224. package/build/website/vite.config.ts +71 -0
  225. package/package.json +120 -12
  226. package/skills/authoring/SKILL.md +97 -0
  227. package/skills/configuration/SKILL.md +120 -0
  228. package/skills/customization/SKILL.md +118 -0
  229. package/build/descriptor/index.d.ts +0 -3
  230. package/build/descriptor/index.js +0 -4
  231. package/build/descriptor/load.d.ts +0 -8
  232. package/build/descriptor/load.js +0 -40
  233. package/build/descriptor/node.d.ts +0 -125
  234. package/build/descriptor/node.js +0 -9
  235. package/build/descriptor/save.d.ts +0 -8
  236. package/build/descriptor/save.js +0 -17
  237. package/build/descriptor/save.spec.js +0 -80
  238. package/build/descriptor/validate.d.ts +0 -9
  239. package/build/descriptor/validate.js +0 -14
  240. package/build/descriptor/validate.spec.js +0 -124
  241. package/build/dialect/Dialect.d.ts +0 -88
  242. package/build/dialect/Dialect.js +0 -2
  243. package/build/dialect/index.d.ts +0 -3
  244. package/build/dialect/index.js +0 -3
  245. package/build/dialect/load.d.ts +0 -4
  246. package/build/dialect/load.js +0 -7
  247. package/build/dialect/save.d.ts +0 -9
  248. package/build/dialect/save.js +0 -13
  249. package/build/dialect/validate.d.ts +0 -1
  250. package/build/dialect/validate.js +0 -4
  251. package/build/metadata/index.d.ts +0 -3
  252. package/build/metadata/index.js +0 -4
  253. package/build/metadata/load.d.ts +0 -10
  254. package/build/metadata/load.js +0 -55
  255. package/build/metadata/node.d.ts +0 -125
  256. package/build/metadata/node.js +0 -9
  257. package/build/metadata/save.d.ts +0 -8
  258. package/build/metadata/save.js +0 -17
  259. package/build/metadata/save.spec.js +0 -80
  260. package/build/metadata/validate.d.ts +0 -9
  261. package/build/metadata/validate.js +0 -14
  262. package/build/metadata/validate.spec.d.ts +0 -1
  263. package/build/metadata/validate.spec.js +0 -124
  264. package/build/package/Contributor.d.ts +0 -21
  265. package/build/package/Contributor.js +0 -2
  266. package/build/package/Package.d.ts +0 -65
  267. package/build/package/Package.js +0 -2
  268. package/build/package/index.d.ts +0 -4
  269. package/build/package/index.js +0 -3
  270. package/build/package/load.d.ts +0 -4
  271. package/build/package/load.js +0 -7
  272. package/build/package/save.d.ts +0 -9
  273. package/build/package/save.js +0 -13
  274. package/build/package/validate.d.ts +0 -1
  275. package/build/package/validate.js +0 -4
  276. package/build/resource/License.d.ts +0 -18
  277. package/build/resource/License.js +0 -2
  278. package/build/resource/Resource.d.ts +0 -67
  279. package/build/resource/Resource.js +0 -2
  280. package/build/resource/Source.d.ts +0 -17
  281. package/build/resource/Source.js +0 -2
  282. package/build/resource/index.d.ts +0 -5
  283. package/build/resource/index.js +0 -2
  284. package/build/resource/load.d.ts +0 -1
  285. package/build/resource/load.js +0 -2
  286. package/build/resource/save.d.ts +0 -9
  287. package/build/resource/save.js +0 -13
  288. package/build/resource/types/index.d.ts +0 -1
  289. package/build/resource/types/index.js +0 -2
  290. package/build/resource/types/table.d.ts +0 -29
  291. package/build/resource/types/table.js +0 -2
  292. package/build/resource/validate.d.ts +0 -1
  293. package/build/resource/validate.js +0 -4
  294. package/build/schema/Field.d.ts +0 -5
  295. package/build/schema/Field.js +0 -2
  296. package/build/schema/Schema.d.ts +0 -55
  297. package/build/schema/Schema.js +0 -2
  298. package/build/schema/fields/any.d.ts +0 -20
  299. package/build/schema/fields/any.js +0 -2
  300. package/build/schema/fields/array.d.ts +0 -32
  301. package/build/schema/fields/array.js +0 -2
  302. package/build/schema/fields/base.d.ts +0 -42
  303. package/build/schema/fields/base.js +0 -2
  304. package/build/schema/fields/boolean.d.ts +0 -28
  305. package/build/schema/fields/boolean.js +0 -2
  306. package/build/schema/fields/date.d.ts +0 -35
  307. package/build/schema/fields/date.js +0 -2
  308. package/build/schema/fields/datetime.d.ts +0 -35
  309. package/build/schema/fields/datetime.js +0 -2
  310. package/build/schema/fields/duration.d.ts +0 -28
  311. package/build/schema/fields/duration.js +0 -2
  312. package/build/schema/fields/geojson.d.ts +0 -26
  313. package/build/schema/fields/geojson.js +0 -2
  314. package/build/schema/fields/geopoint.d.ts +0 -27
  315. package/build/schema/fields/geopoint.js +0 -2
  316. package/build/schema/fields/index.d.ts +0 -16
  317. package/build/schema/fields/index.js +0 -17
  318. package/build/schema/fields/integer.d.ts +0 -37
  319. package/build/schema/fields/integer.js +0 -2
  320. package/build/schema/fields/list.d.ts +0 -36
  321. package/build/schema/fields/list.js +0 -2
  322. package/build/schema/fields/number.d.ts +0 -40
  323. package/build/schema/fields/number.js +0 -2
  324. package/build/schema/fields/object.d.ts +0 -32
  325. package/build/schema/fields/object.js +0 -2
  326. package/build/schema/fields/string.d.ts +0 -40
  327. package/build/schema/fields/string.js +0 -2
  328. package/build/schema/fields/time.d.ts +0 -35
  329. package/build/schema/fields/time.js +0 -2
  330. package/build/schema/fields/year.d.ts +0 -28
  331. package/build/schema/fields/year.js +0 -2
  332. package/build/schema/fields/yearmonth.d.ts +0 -28
  333. package/build/schema/fields/yearmonth.js +0 -2
  334. package/build/schema/index.d.ts +0 -4
  335. package/build/schema/index.js +0 -2
  336. package/build/schema/load.d.ts +0 -1
  337. package/build/schema/load.js +0 -2
  338. package/build/schema/save.d.ts +0 -9
  339. package/build/schema/save.js +0 -13
  340. package/build/schema/validate.d.ts +0 -1
  341. package/build/schema/validate.js +0 -4
  342. package/build/tsconfig.tsbuildinfo +0 -1
  343. package/index.ts +0 -0
  344. package/tsconfig.json +0 -10
  345. package/typedoc.json +0 -4
  346. /package/build/{descriptor/save.spec.d.ts → actions/changelog/build.unit.d.ts} +0 -0
  347. /package/build/{descriptor/validate.spec.d.ts → actions/config/define.unit.d.ts} +0 -0
  348. /package/build/{metadata/save.spec.d.ts → actions/config/load.unit.d.ts} +0 -0
@@ -0,0 +1,199 @@
1
+ import { mergeProps } from "@base-ui/react/merge-props"
2
+ import { useRender } from "@base-ui/react/use-render"
3
+ import { cva, type VariantProps } from "class-variance-authority"
4
+ import { cn } from "../helpers/style.ts"
5
+ import { Separator } from "./separator.tsx"
6
+
7
+ function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
8
+ return (
9
+ <div
10
+ role="list"
11
+ data-slot="item-group"
12
+ className={cn(
13
+ "gap-4 has-[[data-size=sm]]:gap-2.5 has-[[data-size=xs]]:gap-2 group/item-group flex w-full flex-col",
14
+ className,
15
+ )}
16
+ {...props}
17
+ />
18
+ )
19
+ }
20
+
21
+ function ItemSeparator({
22
+ className,
23
+ ...props
24
+ }: React.ComponentProps<typeof Separator>) {
25
+ return (
26
+ <Separator
27
+ data-slot="item-separator"
28
+ orientation="horizontal"
29
+ className={cn("my-2", className)}
30
+ {...props}
31
+ />
32
+ )
33
+ }
34
+
35
+ const itemVariants = cva(
36
+ "[a]:hover:bg-muted rounded-md border text-sm w-full group/item focus-visible:border-ring focus-visible:ring-ring/50 flex items-center flex-wrap outline-none transition-colors duration-100 focus-visible:ring-[3px] [a]:transition-colors",
37
+ {
38
+ variants: {
39
+ variant: {
40
+ default: "border-transparent",
41
+ outline: "border-border",
42
+ muted: "bg-muted/50 border-transparent",
43
+ },
44
+ size: {
45
+ default: "gap-3.5 px-4 py-3.5",
46
+ sm: "gap-2.5 px-3 py-2.5",
47
+ xs: "gap-2 px-2.5 py-2 [[data-slot=dropdown-menu-content]_&]:p-0",
48
+ },
49
+ },
50
+ defaultVariants: {
51
+ variant: "default",
52
+ size: "default",
53
+ },
54
+ },
55
+ )
56
+
57
+ function Item({
58
+ className,
59
+ variant = "default",
60
+ size = "default",
61
+ render,
62
+ ...props
63
+ }: useRender.ComponentProps<"div"> & VariantProps<typeof itemVariants>) {
64
+ return useRender({
65
+ defaultTagName: "div",
66
+ props: mergeProps<"div">(
67
+ {
68
+ className: cn(itemVariants({ variant, size, className })),
69
+ },
70
+ props,
71
+ ),
72
+ render,
73
+ state: {
74
+ slot: "item",
75
+ variant,
76
+ size,
77
+ },
78
+ })
79
+ }
80
+
81
+ const itemMediaVariants = cva(
82
+ "gap-2 group-has-[[data-slot=item-description]]/item:translate-y-0.5 group-has-[[data-slot=item-description]]/item:self-start flex shrink-0 items-center justify-center [&_svg]:pointer-events-none",
83
+ {
84
+ variants: {
85
+ variant: {
86
+ default: "bg-transparent",
87
+ icon: "[&_svg:not([class*='size-'])]:size-4",
88
+ image:
89
+ "size-10 overflow-hidden rounded-sm group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 [&_img]:size-full [&_img]:object-cover",
90
+ },
91
+ },
92
+ defaultVariants: {
93
+ variant: "default",
94
+ },
95
+ },
96
+ )
97
+
98
+ function ItemMedia({
99
+ className,
100
+ variant = "default",
101
+ ...props
102
+ }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>) {
103
+ return (
104
+ <div
105
+ data-slot="item-media"
106
+ data-variant={variant}
107
+ className={cn(itemMediaVariants({ variant, className }))}
108
+ {...props}
109
+ />
110
+ )
111
+ }
112
+
113
+ function ItemContent({ className, ...props }: React.ComponentProps<"div">) {
114
+ return (
115
+ <div
116
+ data-slot="item-content"
117
+ className={cn(
118
+ "gap-1 group-data-[size=xs]/item:gap-0 flex flex-1 flex-col [&+[data-slot=item-content]]:flex-none",
119
+ className,
120
+ )}
121
+ {...props}
122
+ />
123
+ )
124
+ }
125
+
126
+ function ItemTitle({ className, ...props }: React.ComponentProps<"div">) {
127
+ return (
128
+ <div
129
+ data-slot="item-title"
130
+ className={cn(
131
+ "gap-2 text-sm leading-snug font-medium underline-offset-4 line-clamp-1 flex w-fit items-center",
132
+ className,
133
+ )}
134
+ {...props}
135
+ />
136
+ )
137
+ }
138
+
139
+ function ItemDescription({ className, ...props }: React.ComponentProps<"p">) {
140
+ return (
141
+ <p
142
+ data-slot="item-description"
143
+ className={cn(
144
+ "text-muted-foreground text-left text-sm leading-normal group-data-[size=xs]/item:text-xs [&>a:hover]:text-primary line-clamp-2 font-normal [&>a]:underline [&>a]:underline-offset-4",
145
+ className,
146
+ )}
147
+ {...props}
148
+ />
149
+ )
150
+ }
151
+
152
+ function ItemActions({ className, ...props }: React.ComponentProps<"div">) {
153
+ return (
154
+ <div
155
+ data-slot="item-actions"
156
+ className={cn("gap-2 flex items-center", className)}
157
+ {...props}
158
+ />
159
+ )
160
+ }
161
+
162
+ function ItemHeader({ className, ...props }: React.ComponentProps<"div">) {
163
+ return (
164
+ <div
165
+ data-slot="item-header"
166
+ className={cn(
167
+ "gap-2 flex basis-full items-center justify-between",
168
+ className,
169
+ )}
170
+ {...props}
171
+ />
172
+ )
173
+ }
174
+
175
+ function ItemFooter({ className, ...props }: React.ComponentProps<"div">) {
176
+ return (
177
+ <div
178
+ data-slot="item-footer"
179
+ className={cn(
180
+ "gap-2 flex basis-full items-center justify-between",
181
+ className,
182
+ )}
183
+ {...props}
184
+ />
185
+ )
186
+ }
187
+
188
+ export {
189
+ Item,
190
+ ItemMedia,
191
+ ItemContent,
192
+ ItemActions,
193
+ ItemGroup,
194
+ ItemSeparator,
195
+ ItemTitle,
196
+ ItemDescription,
197
+ ItemHeader,
198
+ ItemFooter,
199
+ }
@@ -0,0 +1,26 @@
1
+ import { cn } from "../helpers/style.ts"
2
+
3
+ function Kbd({ className, ...props }: React.ComponentProps<"kbd">) {
4
+ return (
5
+ <kbd
6
+ data-slot="kbd"
7
+ className={cn(
8
+ "bg-muted text-muted-foreground [[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10 h-5 w-fit min-w-5 gap-1 rounded-sm px-1 font-sans text-xs font-medium [&_svg:not([class*='size-'])]:size-3 pointer-events-none inline-flex items-center justify-center select-none",
9
+ className,
10
+ )}
11
+ {...props}
12
+ />
13
+ )
14
+ }
15
+
16
+ function KbdGroup({ className, ...props }: React.ComponentProps<"div">) {
17
+ return (
18
+ <kbd
19
+ data-slot="kbd-group"
20
+ className={cn("gap-1 inline-flex items-center", className)}
21
+ {...props}
22
+ />
23
+ )
24
+ }
25
+
26
+ export { Kbd, KbdGroup }
@@ -0,0 +1,17 @@
1
+ // biome-ignore-all lint: shadcn
2
+ import { cn } from "../helpers/style.ts"
3
+
4
+ function Label({ className, ...props }: React.ComponentProps<"label">) {
5
+ return (
6
+ <label
7
+ data-slot="label"
8
+ className={cn(
9
+ "gap-2 text-sm leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed",
10
+ className,
11
+ )}
12
+ {...props}
13
+ />
14
+ )
15
+ }
16
+
17
+ export { Label }
@@ -0,0 +1,282 @@
1
+ import * as React from "react"
2
+ import { Menu as MenuPrimitive } from "@base-ui/react/menu"
3
+ import { Menubar as MenubarPrimitive } from "@base-ui/react/menubar"
4
+ import { CheckIcon } from "lucide-react"
5
+
6
+ import { cn } from "../helpers/style.ts"
7
+ import {
8
+ DropdownMenu,
9
+ DropdownMenuContent,
10
+ DropdownMenuGroup,
11
+ DropdownMenuItem,
12
+ DropdownMenuLabel,
13
+ DropdownMenuPortal,
14
+ DropdownMenuRadioGroup,
15
+ DropdownMenuSeparator,
16
+ DropdownMenuShortcut,
17
+ DropdownMenuSub,
18
+ DropdownMenuSubContent,
19
+ DropdownMenuSubTrigger,
20
+ DropdownMenuTrigger,
21
+ } from "./dropdown-menu.tsx"
22
+
23
+ function Menubar({ className, ...props }: MenubarPrimitive.Props) {
24
+ return (
25
+ <MenubarPrimitive
26
+ data-slot="menubar"
27
+ className={cn(
28
+ "flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",
29
+ className,
30
+ )}
31
+ {...props}
32
+ />
33
+ )
34
+ }
35
+
36
+ function MenubarMenu({ ...props }: React.ComponentProps<typeof DropdownMenu>) {
37
+ return <DropdownMenu data-slot="menubar-menu" {...props} />
38
+ }
39
+
40
+ function MenubarGroup({
41
+ ...props
42
+ }: React.ComponentProps<typeof DropdownMenuGroup>) {
43
+ return <DropdownMenuGroup data-slot="menubar-group" {...props} />
44
+ }
45
+
46
+ function MenubarPortal({
47
+ ...props
48
+ }: React.ComponentProps<typeof DropdownMenuPortal>) {
49
+ return <DropdownMenuPortal data-slot="menubar-portal" {...props} />
50
+ }
51
+
52
+ function MenubarTrigger({
53
+ className,
54
+ ...props
55
+ }: React.ComponentProps<typeof DropdownMenuTrigger>) {
56
+ return (
57
+ <DropdownMenuTrigger
58
+ data-slot="menubar-trigger"
59
+ className={cn(
60
+ "flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none hover:bg-muted aria-expanded:bg-muted",
61
+ className,
62
+ )}
63
+ {...props}
64
+ />
65
+ )
66
+ }
67
+
68
+ function MenubarContent({
69
+ className,
70
+ align = "start",
71
+ alignOffset = -4,
72
+ sideOffset = 8,
73
+ ...props
74
+ }: React.ComponentProps<typeof DropdownMenuContent>) {
75
+ return (
76
+ <DropdownMenuContent
77
+ data-slot="menubar-content"
78
+ align={align}
79
+ alignOffset={alignOffset}
80
+ sideOffset={sideOffset}
81
+ className={cn(
82
+ "cn-menu-target cn-menu-translucent min-w-36 rounded-md 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",
83
+ className,
84
+ )}
85
+ {...props}
86
+ />
87
+ )
88
+ }
89
+
90
+ function MenubarItem({
91
+ className,
92
+ inset,
93
+ variant = "default",
94
+ ...props
95
+ }: React.ComponentProps<typeof DropdownMenuItem>) {
96
+ return (
97
+ <DropdownMenuItem
98
+ data-slot="menubar-item"
99
+ data-inset={inset}
100
+ data-variant={variant}
101
+ className={cn(
102
+ "group/menubar-item gap-2 rounded-sm px-2 py-1.5 text-sm focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]: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:opacity-50 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive!",
103
+ className,
104
+ )}
105
+ {...props}
106
+ />
107
+ )
108
+ }
109
+
110
+ function MenubarCheckboxItem({
111
+ className,
112
+ children,
113
+ checked,
114
+ inset,
115
+ ...props
116
+ }: MenuPrimitive.CheckboxItem.Props & {
117
+ inset?: boolean
118
+ }) {
119
+ return (
120
+ <MenuPrimitive.CheckboxItem
121
+ data-slot="menubar-checkbox-item"
122
+ data-inset={inset}
123
+ className={cn(
124
+ "relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
125
+ className,
126
+ )}
127
+ checked={checked}
128
+ {...props}
129
+ >
130
+ <span className="pointer-events-none absolute left-2 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4">
131
+ <MenuPrimitive.CheckboxItemIndicator>
132
+ <CheckIcon />
133
+ </MenuPrimitive.CheckboxItemIndicator>
134
+ </span>
135
+ {children}
136
+ </MenuPrimitive.CheckboxItem>
137
+ )
138
+ }
139
+
140
+ function MenubarRadioGroup({
141
+ ...props
142
+ }: React.ComponentProps<typeof DropdownMenuRadioGroup>) {
143
+ return <DropdownMenuRadioGroup data-slot="menubar-radio-group" {...props} />
144
+ }
145
+
146
+ function MenubarRadioItem({
147
+ className,
148
+ children,
149
+ inset,
150
+ ...props
151
+ }: MenuPrimitive.RadioItem.Props & {
152
+ inset?: boolean
153
+ }) {
154
+ return (
155
+ <MenuPrimitive.RadioItem
156
+ data-slot="menubar-radio-item"
157
+ data-inset={inset}
158
+ className={cn(
159
+ "relative flex cursor-default items-center gap-2 rounded-md py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground 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",
160
+ className,
161
+ )}
162
+ {...props}
163
+ >
164
+ <span className="pointer-events-none absolute left-2 flex size-4 items-center justify-center [&_svg:not([class*='size-'])]:size-4">
165
+ <MenuPrimitive.RadioItemIndicator>
166
+ <CheckIcon />
167
+ </MenuPrimitive.RadioItemIndicator>
168
+ </span>
169
+ {children}
170
+ </MenuPrimitive.RadioItem>
171
+ )
172
+ }
173
+
174
+ function MenubarLabel({
175
+ className,
176
+ inset,
177
+ ...props
178
+ }: React.ComponentProps<typeof DropdownMenuLabel> & {
179
+ inset?: boolean
180
+ }) {
181
+ return (
182
+ <DropdownMenuLabel
183
+ data-slot="menubar-label"
184
+ data-inset={inset}
185
+ className={cn(
186
+ "px-2 py-1.5 text-sm font-medium data-inset:pl-8",
187
+ className,
188
+ )}
189
+ {...props}
190
+ />
191
+ )
192
+ }
193
+
194
+ function MenubarSeparator({
195
+ className,
196
+ ...props
197
+ }: React.ComponentProps<typeof DropdownMenuSeparator>) {
198
+ return (
199
+ <DropdownMenuSeparator
200
+ data-slot="menubar-separator"
201
+ className={cn("-mx-1 my-1 h-px bg-border", className)}
202
+ {...props}
203
+ />
204
+ )
205
+ }
206
+
207
+ function MenubarShortcut({
208
+ className,
209
+ ...props
210
+ }: React.ComponentProps<typeof DropdownMenuShortcut>) {
211
+ return (
212
+ <DropdownMenuShortcut
213
+ data-slot="menubar-shortcut"
214
+ className={cn(
215
+ "ml-auto text-xs tracking-widest text-muted-foreground group-focus/menubar-item:text-accent-foreground",
216
+ className,
217
+ )}
218
+ {...props}
219
+ />
220
+ )
221
+ }
222
+
223
+ function MenubarSub({
224
+ ...props
225
+ }: React.ComponentProps<typeof DropdownMenuSub>) {
226
+ return <DropdownMenuSub data-slot="menubar-sub" {...props} />
227
+ }
228
+
229
+ function MenubarSubTrigger({
230
+ className,
231
+ inset,
232
+ ...props
233
+ }: React.ComponentProps<typeof DropdownMenuSubTrigger> & {
234
+ inset?: boolean
235
+ }) {
236
+ return (
237
+ <DropdownMenuSubTrigger
238
+ data-slot="menubar-sub-trigger"
239
+ data-inset={inset}
240
+ className={cn(
241
+ "gap-2 rounded-sm px-2 py-1.5 text-sm focus:bg-accent focus:text-accent-foreground data-inset:pl-8 data-open:bg-accent data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4",
242
+ className,
243
+ )}
244
+ {...props}
245
+ />
246
+ )
247
+ }
248
+
249
+ function MenubarSubContent({
250
+ className,
251
+ ...props
252
+ }: React.ComponentProps<typeof DropdownMenuSubContent>) {
253
+ return (
254
+ <DropdownMenuSubContent
255
+ data-slot="menubar-sub-content"
256
+ className={cn(
257
+ "cn-menu-target cn-menu-translucent min-w-32 rounded-md bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-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",
258
+ className,
259
+ )}
260
+ {...props}
261
+ />
262
+ )
263
+ }
264
+
265
+ export {
266
+ Menubar,
267
+ MenubarPortal,
268
+ MenubarMenu,
269
+ MenubarTrigger,
270
+ MenubarContent,
271
+ MenubarGroup,
272
+ MenubarSeparator,
273
+ MenubarLabel,
274
+ MenubarItem,
275
+ MenubarShortcut,
276
+ MenubarCheckboxItem,
277
+ MenubarRadioGroup,
278
+ MenubarRadioItem,
279
+ MenubarSub,
280
+ MenubarSubTrigger,
281
+ MenubarSubContent,
282
+ }
@@ -0,0 +1,56 @@
1
+ import * as React from "react"
2
+ import { ChevronDownIcon } from "lucide-react"
3
+
4
+ import { cn } from "../helpers/style.ts"
5
+
6
+ type NativeSelectProps = Omit<React.ComponentProps<"select">, "size"> & {
7
+ size?: "sm" | "default"
8
+ }
9
+
10
+ function NativeSelect({
11
+ className,
12
+ size = "default",
13
+ ...props
14
+ }: NativeSelectProps) {
15
+ return (
16
+ <div
17
+ className={cn(
18
+ "group/native-select relative w-fit has-[select:disabled]:opacity-50",
19
+ className,
20
+ )}
21
+ data-slot="native-select-wrapper"
22
+ data-size={size}
23
+ >
24
+ <select
25
+ data-slot="native-select"
26
+ data-size={size}
27
+ className="h-9 w-full min-w-0 appearance-none rounded-md border border-input bg-transparent py-1 pr-8 pl-2.5 text-sm shadow-xs transition-[color,box-shadow] outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=sm]:h-8 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40"
28
+ {...props}
29
+ />
30
+ <ChevronDownIcon
31
+ className="pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground select-none"
32
+ aria-hidden="true"
33
+ data-slot="native-select-icon"
34
+ />
35
+ </div>
36
+ )
37
+ }
38
+
39
+ function NativeSelectOption({ ...props }: React.ComponentProps<"option">) {
40
+ return <option data-slot="native-select-option" {...props} />
41
+ }
42
+
43
+ function NativeSelectOptGroup({
44
+ className,
45
+ ...props
46
+ }: React.ComponentProps<"optgroup">) {
47
+ return (
48
+ <optgroup
49
+ data-slot="native-select-optgroup"
50
+ className={cn(className)}
51
+ {...props}
52
+ />
53
+ )
54
+ }
55
+
56
+ export { NativeSelect, NativeSelectOptGroup, NativeSelectOption }