@nanisoft/prism-ui 0.5.0 → 0.6.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.
Files changed (303) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +81 -0
  3. package/THIRD-PARTY-NOTICES.md +48 -0
  4. package/dist/.tsbuildinfo +1 -0
  5. package/dist/blocks/app-shell-01/app-shell.d.ts +38 -0
  6. package/dist/blocks/app-shell-01/app-shell.d.ts.map +1 -0
  7. package/dist/blocks/app-shell-01/app-shell.js +27 -0
  8. package/dist/blocks/app-shell-01/index.d.ts +3 -0
  9. package/dist/blocks/app-shell-01/index.d.ts.map +1 -0
  10. package/dist/blocks/app-shell-01/index.js +1 -0
  11. package/dist/blocks/auth-form-01/auth-form.d.ts +52 -0
  12. package/dist/blocks/auth-form-01/auth-form.d.ts.map +1 -0
  13. package/dist/blocks/auth-form-01/auth-form.js +23 -0
  14. package/dist/blocks/auth-form-01/index.d.ts +3 -0
  15. package/dist/blocks/auth-form-01/index.d.ts.map +1 -0
  16. package/dist/blocks/auth-form-01/index.js +1 -0
  17. package/dist/blocks/cta-01/cta.d.ts +83 -0
  18. package/dist/blocks/cta-01/cta.d.ts.map +1 -0
  19. package/dist/blocks/cta-01/cta.js +29 -0
  20. package/dist/blocks/cta-01/index.d.ts +3 -0
  21. package/dist/blocks/cta-01/index.d.ts.map +1 -0
  22. package/dist/blocks/cta-01/index.js +1 -0
  23. package/dist/blocks/data-table-01/data-table.d.ts +102 -0
  24. package/dist/blocks/data-table-01/data-table.d.ts.map +1 -0
  25. package/dist/blocks/data-table-01/data-table.js +116 -0
  26. package/dist/blocks/data-table-01/index.d.ts +3 -0
  27. package/dist/blocks/data-table-01/index.d.ts.map +1 -0
  28. package/dist/blocks/data-table-01/index.js +1 -0
  29. package/dist/blocks/feature-grid-01/feature-grid.d.ts +78 -0
  30. package/dist/blocks/feature-grid-01/feature-grid.d.ts.map +1 -0
  31. package/dist/blocks/feature-grid-01/feature-grid.js +24 -0
  32. package/dist/blocks/feature-grid-01/index.d.ts +3 -0
  33. package/dist/blocks/feature-grid-01/index.d.ts.map +1 -0
  34. package/dist/blocks/feature-grid-01/index.js +1 -0
  35. package/dist/blocks/hero-01/hero.d.ts +59 -0
  36. package/dist/blocks/hero-01/hero.d.ts.map +1 -0
  37. package/dist/blocks/hero-01/hero.js +24 -0
  38. package/dist/blocks/hero-01/index.d.ts +2 -0
  39. package/dist/blocks/hero-01/index.d.ts.map +1 -0
  40. package/dist/blocks/hero-01/index.js +1 -0
  41. package/dist/blocks/index.d.ts +28 -0
  42. package/dist/blocks/index.d.ts.map +1 -0
  43. package/dist/blocks/index.js +26 -0
  44. package/dist/blocks/instrument-panel-01/index.d.ts +3 -0
  45. package/dist/blocks/instrument-panel-01/index.d.ts.map +1 -0
  46. package/dist/blocks/instrument-panel-01/index.js +1 -0
  47. package/dist/blocks/instrument-panel-01/instrument-panel.d.ts +114 -0
  48. package/dist/blocks/instrument-panel-01/instrument-panel.d.ts.map +1 -0
  49. package/dist/blocks/instrument-panel-01/instrument-panel.js +64 -0
  50. package/dist/blocks/logo-strip-01/index.d.ts +3 -0
  51. package/dist/blocks/logo-strip-01/index.d.ts.map +1 -0
  52. package/dist/blocks/logo-strip-01/index.js +1 -0
  53. package/dist/blocks/logo-strip-01/logo-strip.d.ts +84 -0
  54. package/dist/blocks/logo-strip-01/logo-strip.d.ts.map +1 -0
  55. package/dist/blocks/logo-strip-01/logo-strip.js +40 -0
  56. package/dist/blocks/note-grid-01/index.d.ts +3 -0
  57. package/dist/blocks/note-grid-01/index.d.ts.map +1 -0
  58. package/dist/blocks/note-grid-01/index.js +1 -0
  59. package/dist/blocks/note-grid-01/note-grid.d.ts +79 -0
  60. package/dist/blocks/note-grid-01/note-grid.d.ts.map +1 -0
  61. package/dist/blocks/note-grid-01/note-grid.js +37 -0
  62. package/dist/blocks/page-header-01/index.d.ts +3 -0
  63. package/dist/blocks/page-header-01/index.d.ts.map +1 -0
  64. package/dist/blocks/page-header-01/index.js +1 -0
  65. package/dist/blocks/page-header-01/page-header.d.ts +48 -0
  66. package/dist/blocks/page-header-01/page-header.d.ts.map +1 -0
  67. package/dist/blocks/page-header-01/page-header.js +27 -0
  68. package/dist/blocks/pricing-01/index.d.ts +2 -0
  69. package/dist/blocks/pricing-01/index.d.ts.map +1 -0
  70. package/dist/blocks/pricing-01/index.js +1 -0
  71. package/dist/blocks/pricing-01/pricing.d.ts +35 -0
  72. package/dist/blocks/pricing-01/pricing.d.ts.map +1 -0
  73. package/dist/blocks/pricing-01/pricing.js +20 -0
  74. package/dist/blocks/process-rail-01/index.d.ts +3 -0
  75. package/dist/blocks/process-rail-01/index.d.ts.map +1 -0
  76. package/dist/blocks/process-rail-01/index.js +1 -0
  77. package/dist/blocks/process-rail-01/process-rail.d.ts +99 -0
  78. package/dist/blocks/process-rail-01/process-rail.d.ts.map +1 -0
  79. package/dist/blocks/process-rail-01/process-rail.js +58 -0
  80. package/dist/blocks/product-grid-01/index.d.ts +3 -0
  81. package/dist/blocks/product-grid-01/index.d.ts.map +1 -0
  82. package/dist/blocks/product-grid-01/index.js +1 -0
  83. package/dist/blocks/product-grid-01/product-grid.d.ts +114 -0
  84. package/dist/blocks/product-grid-01/product-grid.d.ts.map +1 -0
  85. package/dist/blocks/product-grid-01/product-grid.js +51 -0
  86. package/dist/blocks/settings-panel-01/index.d.ts +3 -0
  87. package/dist/blocks/settings-panel-01/index.d.ts.map +1 -0
  88. package/dist/blocks/settings-panel-01/index.js +1 -0
  89. package/dist/blocks/settings-panel-01/settings-panel.d.ts +71 -0
  90. package/dist/blocks/settings-panel-01/settings-panel.d.ts.map +1 -0
  91. package/dist/blocks/settings-panel-01/settings-panel.js +38 -0
  92. package/dist/blocks/site-footer/index.d.ts +3 -0
  93. package/dist/blocks/site-footer/index.d.ts.map +1 -0
  94. package/dist/blocks/site-footer/index.js +1 -0
  95. package/dist/blocks/site-footer/site-footer.d.ts +135 -0
  96. package/dist/blocks/site-footer/site-footer.d.ts.map +1 -0
  97. package/dist/blocks/site-footer/site-footer.js +41 -0
  98. package/dist/blocks/site-header/index.d.ts +3 -0
  99. package/dist/blocks/site-header/index.d.ts.map +1 -0
  100. package/dist/blocks/site-header/index.js +1 -0
  101. package/dist/blocks/site-header/site-header.d.ts +142 -0
  102. package/dist/blocks/site-header/site-header.d.ts.map +1 -0
  103. package/dist/blocks/site-header/site-header.js +46 -0
  104. package/dist/blocks/stack-grid-01/index.d.ts +3 -0
  105. package/dist/blocks/stack-grid-01/index.d.ts.map +1 -0
  106. package/dist/blocks/stack-grid-01/index.js +1 -0
  107. package/dist/blocks/stack-grid-01/stack-grid.d.ts +118 -0
  108. package/dist/blocks/stack-grid-01/stack-grid.d.ts.map +1 -0
  109. package/dist/blocks/stack-grid-01/stack-grid.js +49 -0
  110. package/dist/blocks/stats-01/index.d.ts +2 -0
  111. package/dist/blocks/stats-01/index.d.ts.map +1 -0
  112. package/dist/blocks/stats-01/index.js +1 -0
  113. package/dist/blocks/stats-01/stats.d.ts +28 -0
  114. package/dist/blocks/stats-01/stats.d.ts.map +1 -0
  115. package/dist/blocks/stats-01/stats.js +27 -0
  116. package/dist/blocks/status-ledger-01/index.d.ts +3 -0
  117. package/dist/blocks/status-ledger-01/index.d.ts.map +1 -0
  118. package/dist/blocks/status-ledger-01/index.js +1 -0
  119. package/dist/blocks/status-ledger-01/status-ledger.d.ts +131 -0
  120. package/dist/blocks/status-ledger-01/status-ledger.d.ts.map +1 -0
  121. package/dist/blocks/status-ledger-01/status-ledger.js +80 -0
  122. package/dist/catalog.d.ts +28 -0
  123. package/dist/catalog.d.ts.map +1 -0
  124. package/dist/catalog.js +672 -0
  125. package/dist/components/index.d.ts +64 -0
  126. package/dist/components/index.d.ts.map +1 -0
  127. package/dist/components/index.js +43 -0
  128. package/dist/components/ui/accordion.d.ts +65 -0
  129. package/dist/components/ui/accordion.d.ts.map +1 -0
  130. package/dist/components/ui/accordion.js +30 -0
  131. package/dist/components/ui/alert.d.ts +19 -0
  132. package/dist/components/ui/alert.d.ts.map +1 -0
  133. package/dist/components/ui/alert.js +31 -0
  134. package/dist/components/ui/avatar.d.ts +47 -0
  135. package/dist/components/ui/avatar.d.ts.map +1 -0
  136. package/dist/components/ui/avatar.js +30 -0
  137. package/dist/components/ui/badge.d.ts +14 -0
  138. package/dist/components/ui/badge.d.ts.map +1 -0
  139. package/dist/components/ui/badge.js +26 -0
  140. package/dist/components/ui/breadcrumb.d.ts +35 -0
  141. package/dist/components/ui/breadcrumb.d.ts.map +1 -0
  142. package/dist/components/ui/breadcrumb.js +48 -0
  143. package/dist/components/ui/button.d.ts +16 -0
  144. package/dist/components/ui/button.d.ts.map +1 -0
  145. package/dist/components/ui/button.js +63 -0
  146. package/dist/components/ui/card.d.ts +41 -0
  147. package/dist/components/ui/card.d.ts.map +1 -0
  148. package/dist/components/ui/card.js +53 -0
  149. package/dist/components/ui/checkbox.d.ts +43 -0
  150. package/dist/components/ui/checkbox.d.ts.map +1 -0
  151. package/dist/components/ui/checkbox.js +18 -0
  152. package/dist/components/ui/cta-link.d.ts +45 -0
  153. package/dist/components/ui/cta-link.d.ts.map +1 -0
  154. package/dist/components/ui/cta-link.js +81 -0
  155. package/dist/components/ui/diagram.d.ts +154 -0
  156. package/dist/components/ui/diagram.d.ts.map +1 -0
  157. package/dist/components/ui/diagram.js +150 -0
  158. package/dist/components/ui/dialog.d.ts +81 -0
  159. package/dist/components/ui/dialog.d.ts.map +1 -0
  160. package/dist/components/ui/dialog.js +60 -0
  161. package/dist/components/ui/dropdown-menu.d.ts +189 -0
  162. package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
  163. package/dist/components/ui/dropdown-menu.js +67 -0
  164. package/dist/components/ui/fact-list.d.ts +90 -0
  165. package/dist/components/ui/fact-list.d.ts.map +1 -0
  166. package/dist/components/ui/fact-list.js +38 -0
  167. package/dist/components/ui/field.d.ts +36 -0
  168. package/dist/components/ui/field.d.ts.map +1 -0
  169. package/dist/components/ui/field.js +46 -0
  170. package/dist/components/ui/input.d.ts +12 -0
  171. package/dist/components/ui/input.d.ts.map +1 -0
  172. package/dist/components/ui/input.js +14 -0
  173. package/dist/components/ui/kbd.d.ts +10 -0
  174. package/dist/components/ui/kbd.d.ts.map +1 -0
  175. package/dist/components/ui/kbd.js +12 -0
  176. package/dist/components/ui/pagination.d.ts +40 -0
  177. package/dist/components/ui/pagination.d.ts.map +1 -0
  178. package/dist/components/ui/pagination.js +49 -0
  179. package/dist/components/ui/popover.d.ts +56 -0
  180. package/dist/components/ui/popover.d.ts.map +1 -0
  181. package/dist/components/ui/popover.js +25 -0
  182. package/dist/components/ui/product-mark.d.ts +115 -0
  183. package/dist/components/ui/product-mark.d.ts.map +1 -0
  184. package/dist/components/ui/product-mark.js +82 -0
  185. package/dist/components/ui/product-switcher.d.ts +108 -0
  186. package/dist/components/ui/product-switcher.d.ts.map +1 -0
  187. package/dist/components/ui/product-switcher.js +47 -0
  188. package/dist/components/ui/progress.d.ts +38 -0
  189. package/dist/components/ui/progress.d.ts.map +1 -0
  190. package/dist/components/ui/progress.js +17 -0
  191. package/dist/components/ui/prose.d.ts +88 -0
  192. package/dist/components/ui/prose.d.ts.map +1 -0
  193. package/dist/components/ui/prose.js +53 -0
  194. package/dist/components/ui/radio-group.d.ts +66 -0
  195. package/dist/components/ui/radio-group.d.ts.map +1 -0
  196. package/dist/components/ui/radio-group.js +30 -0
  197. package/dist/components/ui/section.d.ts +60 -0
  198. package/dist/components/ui/section.d.ts.map +1 -0
  199. package/dist/components/ui/section.js +21 -0
  200. package/dist/components/ui/select.d.ts +124 -0
  201. package/dist/components/ui/select.d.ts.map +1 -0
  202. package/dist/components/ui/select.js +47 -0
  203. package/dist/components/ui/separator.d.ts +16 -0
  204. package/dist/components/ui/separator.d.ts.map +1 -0
  205. package/dist/components/ui/separator.js +15 -0
  206. package/dist/components/ui/skeleton.d.ts +12 -0
  207. package/dist/components/ui/skeleton.d.ts.map +1 -0
  208. package/dist/components/ui/skeleton.js +14 -0
  209. package/dist/components/ui/slider.d.ts +43 -0
  210. package/dist/components/ui/slider.d.ts.map +1 -0
  211. package/dist/components/ui/slider.js +23 -0
  212. package/dist/components/ui/switch.d.ts +42 -0
  213. package/dist/components/ui/switch.d.ts.map +1 -0
  214. package/dist/components/ui/switch.js +16 -0
  215. package/dist/components/ui/table.d.ts +27 -0
  216. package/dist/components/ui/table.d.ts.map +1 -0
  217. package/dist/components/ui/table.js +43 -0
  218. package/dist/components/ui/tabs.d.ts +66 -0
  219. package/dist/components/ui/tabs.d.ts.map +1 -0
  220. package/dist/components/ui/tabs.js +29 -0
  221. package/dist/components/ui/textarea.d.ts +11 -0
  222. package/dist/components/ui/textarea.d.ts.map +1 -0
  223. package/dist/components/ui/textarea.js +13 -0
  224. package/dist/components/ui/tooltip.d.ts +63 -0
  225. package/dist/components/ui/tooltip.d.ts.map +1 -0
  226. package/dist/components/ui/tooltip.js +25 -0
  227. package/dist/components/ui/typography.d.ts +32 -0
  228. package/dist/components/ui/typography.d.ts.map +1 -0
  229. package/dist/components/ui/typography.js +51 -0
  230. package/dist/index.d.ts +79 -0
  231. package/dist/index.d.ts.map +1 -0
  232. package/dist/index.js +68 -0
  233. package/dist/lib/utils.d.ts +3 -0
  234. package/dist/lib/utils.d.ts.map +1 -0
  235. package/dist/lib/utils.js +5 -0
  236. package/dist/pages/auth-page/index.d.ts +36 -0
  237. package/dist/pages/auth-page/index.d.ts.map +1 -0
  238. package/dist/pages/auth-page/index.js +23 -0
  239. package/dist/pages/blog-post-page/index.d.ts +174 -0
  240. package/dist/pages/blog-post-page/index.d.ts.map +1 -0
  241. package/dist/pages/blog-post-page/index.js +49 -0
  242. package/dist/pages/dashboard-page/index.d.ts +36 -0
  243. package/dist/pages/dashboard-page/index.d.ts.map +1 -0
  244. package/dist/pages/dashboard-page/index.js +24 -0
  245. package/dist/pages/index.d.ts +21 -0
  246. package/dist/pages/index.d.ts.map +1 -0
  247. package/dist/pages/index.js +14 -0
  248. package/dist/pages/marketing-page/index.d.ts +43 -0
  249. package/dist/pages/marketing-page/index.d.ts.map +1 -0
  250. package/dist/pages/marketing-page/index.js +25 -0
  251. package/dist/pages/not-found-page/index.d.ts +112 -0
  252. package/dist/pages/not-found-page/index.d.ts.map +1 -0
  253. package/dist/pages/not-found-page/index.js +46 -0
  254. package/dist/pages/settings-page/index.d.ts +47 -0
  255. package/dist/pages/settings-page/index.d.ts.map +1 -0
  256. package/dist/pages/settings-page/index.js +24 -0
  257. package/dist/provider/index.d.ts +12 -0
  258. package/dist/provider/index.d.ts.map +1 -0
  259. package/dist/provider/index.js +9 -0
  260. package/dist/provider/provider.d.ts +42 -0
  261. package/dist/provider/provider.d.ts.map +1 -0
  262. package/dist/provider/provider.js +178 -0
  263. package/dist/provider/theme-script.d.ts +55 -0
  264. package/dist/provider/theme-script.d.ts.map +1 -0
  265. package/dist/provider/theme-script.js +79 -0
  266. package/dist/styles.css +2894 -0
  267. package/dist/theming/index.d.ts +173 -0
  268. package/dist/theming/index.d.ts.map +1 -0
  269. package/dist/theming/index.js +186 -0
  270. package/package.json +89 -18
  271. package/components.json +0 -21
  272. package/public/r/badge.json +0 -26
  273. package/public/r/button.json +0 -26
  274. package/public/r/card.json +0 -25
  275. package/public/r/cta-01.json +0 -44
  276. package/public/r/feature-grid-01.json +0 -44
  277. package/public/r/hero-01.json +0 -44
  278. package/public/r/pricing-01.json +0 -46
  279. package/public/r/registry.json +0 -294
  280. package/public/r/section.json +0 -25
  281. package/public/r/stats-01.json +0 -44
  282. package/registry.json +0 -294
  283. package/src/components/ds/blocks/cta-01/block.json +0 -8
  284. package/src/components/ds/blocks/cta-01/cta.tsx +0 -62
  285. package/src/components/ds/blocks/cta-01/index.tsx +0 -1
  286. package/src/components/ds/blocks/feature-grid-01/block.json +0 -8
  287. package/src/components/ds/blocks/feature-grid-01/feature-grid.tsx +0 -69
  288. package/src/components/ds/blocks/feature-grid-01/index.tsx +0 -1
  289. package/src/components/ds/blocks/hero-01/block.json +0 -8
  290. package/src/components/ds/blocks/hero-01/hero.tsx +0 -85
  291. package/src/components/ds/blocks/hero-01/index.tsx +0 -1
  292. package/src/components/ds/blocks/pricing-01/block.json +0 -8
  293. package/src/components/ds/blocks/pricing-01/index.tsx +0 -1
  294. package/src/components/ds/blocks/pricing-01/pricing.tsx +0 -122
  295. package/src/components/ds/blocks/section.meta.json +0 -6
  296. package/src/components/ds/blocks/section.tsx +0 -86
  297. package/src/components/ds/blocks/stats-01/block.json +0 -8
  298. package/src/components/ds/blocks/stats-01/index.tsx +0 -1
  299. package/src/components/ds/blocks/stats-01/stats.tsx +0 -92
  300. package/src/components/ui/badge.tsx +0 -37
  301. package/src/components/ui/button.tsx +0 -77
  302. package/src/components/ui/card.tsx +0 -65
  303. package/src/lib/utils.ts +0 -6
@@ -1,6 +0,0 @@
1
- {
2
- "name": "section",
3
- "title": "Section",
4
- "description": "Container and heading primitives that give every block a consistent vertical rhythm.",
5
- "type": "registry:component"
6
- }
@@ -1,86 +0,0 @@
1
- import type { ReactNode } from 'react'
2
- import { cn } from '@/lib/utils'
3
-
4
- /**
5
- * Container primitive. Every block composes its own section from this so vertical
6
- * rhythm stays consistent across the catalog instead of being re-invented per block.
7
- */
8
- export function Section({
9
- className,
10
- children,
11
- ...props
12
- }: React.ComponentProps<'section'>) {
13
- return (
14
- <section
15
- className={cn('py-16 sm:py-24', className)}
16
- {...props}
17
- >
18
- <div className="mx-auto w-full max-w-6xl px-6 lg:px-8">
19
- {children}
20
- </div>
21
- </section>
22
- )
23
- }
24
-
25
- /**
26
- * The six heading levels a block can be composed at.
27
- *
28
- * Every block takes a `headingLevel` prop typed with this and forwards it to the
29
- * one heading it renders, so the surrounding document decides where the block
30
- * sits in the outline rather than the block deciding for itself. `h2` is the
31
- * default because a block is composed, not a page.
32
- *
33
- * A block rendered where the document *already* owns a heading for the same
34
- * content passes one level deeper. A catalog card already names the block in its
35
- * own `h2`, so the copy of the block embedded inside that card passes `h3`: the
36
- * embedded heading then reads as a child of the card that introduces it instead
37
- * of as a second, competing sibling. This is a fact about where the block was
38
- * placed, not about the block, which is why it is a prop and not a default.
39
- */
40
- export type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
41
-
42
- export function SectionHeading({
43
- eyebrow,
44
- title,
45
- as: Heading = 'h2',
46
- description,
47
- align = 'center',
48
- className,
49
- }: {
50
- eyebrow?: ReactNode
51
- title: ReactNode
52
- description?: ReactNode
53
- align?: 'center' | 'left'
54
- /**
55
- * Heading level. Defaults to `h2` because blocks compose under a page heading.
56
- * A page that renders a block as its primary heading passes `as="h1"` — a
57
- * document with no `h1` gives screen-reader and search engines no top-level
58
- * entry point.
59
- */
60
- as?: HeadingLevel
61
- className?: string
62
- }) {
63
- return (
64
- <div
65
- className={cn(
66
- 'flex flex-col gap-4',
67
- align === 'center' ? 'items-center text-center' : 'items-start text-left',
68
- className,
69
- )}
70
- >
71
- {eyebrow ? (
72
- <span className="text-muted-foreground text-sm font-medium tracking-wide uppercase">
73
- {eyebrow}
74
- </span>
75
- ) : null}
76
- <Heading className="text-3xl font-semibold tracking-tight text-balance sm:text-4xl">
77
- {title}
78
- </Heading>
79
- {description ? (
80
- <p className="text-muted-foreground max-w-2xl text-lg text-pretty">
81
- {description}
82
- </p>
83
- ) : null}
84
- </div>
85
- )
86
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "stats-01",
3
- "title": "Stats 01 - KPI Row With Trend",
4
- "description": "A four-up KPI row with optional directional deltas. Every metric is passed in; the block ships no sample data.",
5
- "categories": ["application"],
6
- "registryDependencies": ["card"],
7
- "dependencies": ["lucide-react"]
8
- }
@@ -1 +0,0 @@
1
- export { Stats01, default } from './stats'
@@ -1,92 +0,0 @@
1
- import { ArrowDownRight, ArrowUpRight, Minus } from 'lucide-react'
2
-
3
- import { Card, CardContent } from '@/components/ui/card'
4
- import { Section, SectionHeading, type HeadingLevel } from '@/components/ds/blocks/section'
5
-
6
- export type Stat = {
7
- label: string
8
- value: string
9
- /** Percentage change. Positive reads as growth, negative as decline. */
10
- delta?: number
11
- /** Period the delta compares against, e.g. "vs last month". */
12
- hint?: string
13
- }
14
-
15
- export type Stats01Props = {
16
- eyebrow?: string
17
- title?: string
18
- stats: Stat[]
19
- /** Heading level for the section title. See `HeadingLevel`. */
20
- headingLevel?: HeadingLevel
21
- }
22
-
23
- function Delta({ value }: { value: number }) {
24
- if (value === 0) {
25
- return (
26
- <span className="text-muted-foreground flex items-center gap-1 text-xs">
27
- <Minus className="size-3" />
28
- 0%
29
- </span>
30
- )
31
- }
32
- const up = value > 0
33
- const Icon = up ? ArrowUpRight : ArrowDownRight
34
- return (
35
- <span
36
- className={
37
- up
38
- ? 'text-success flex items-center gap-1 text-xs'
39
- : 'text-destructive flex items-center gap-1 text-xs'
40
- }
41
- >
42
- <Icon className="size-3" />
43
- {Math.abs(value)}%
44
- </span>
45
- )
46
- }
47
-
48
- /**
49
- * A KPI row. Every number is a prop.
50
- *
51
- * This block used to carry a hardcoded set reading "128 blocks shipped" and "9.4k
52
- * weekly installs". Those were invented figures about a library nobody installs
53
- * yet, and because they lived in the component rather than at the call site, a
54
- * consumer who installed the block shipped fabricated metrics into their own
55
- * dashboard. A stat block with invented stats in it is worse than no stat block.
56
- */
57
- export function Stats01({ eyebrow, title, stats, headingLevel = 'h2' }: Stats01Props) {
58
- return (
59
- <Section>
60
- {title ? (
61
- <SectionHeading
62
- as={headingLevel}
63
- eyebrow={eyebrow}
64
- title={title}
65
- align="left"
66
- className="mb-10"
67
- />
68
- ) : null}
69
-
70
- <div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
71
- {stats.map((stat) => (
72
- <Card key={stat.label} className="gap-2 py-5">
73
- <CardContent className="flex flex-col gap-1">
74
- <span className="text-muted-foreground text-sm">{stat.label}</span>
75
- <span className="text-2xl font-semibold tracking-tight">{stat.value}</span>
76
- {stat.delta === undefined && !stat.hint ? null : (
77
- <div className="flex items-center gap-2">
78
- {stat.delta === undefined ? null : <Delta value={stat.delta} />}
79
- {stat.hint ? (
80
- <span className="text-muted-foreground text-xs">{stat.hint}</span>
81
- ) : null}
82
- </div>
83
- )}
84
- </CardContent>
85
- </Card>
86
- ))}
87
- </div>
88
- </Section>
89
- )
90
- }
91
-
92
- export default Stats01
@@ -1,37 +0,0 @@
1
- import { cva, type VariantProps } from 'class-variance-authority'
2
- import type { ComponentProps } from 'react'
3
-
4
- import { cn } from '@/lib/utils'
5
-
6
- const badgeVariants = cva(
7
- 'inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-colors',
8
- {
9
- variants: {
10
- variant: {
11
- default: 'bg-primary text-primary-foreground border-transparent',
12
- secondary: 'bg-secondary text-secondary-foreground border-transparent',
13
- destructive: 'bg-destructive text-destructive-foreground border-transparent',
14
- success: 'bg-success text-success-foreground border-transparent',
15
- warning: 'bg-warning text-warning-foreground border-transparent',
16
- outline: 'text-foreground border-border',
17
- },
18
- },
19
- defaultVariants: { variant: 'default' },
20
- },
21
- )
22
-
23
- function Badge({
24
- className,
25
- variant,
26
- ...props
27
- }: ComponentProps<'span'> & VariantProps<typeof badgeVariants>) {
28
- return (
29
- <span
30
- data-slot="badge"
31
- className={cn(badgeVariants({ variant }), className)}
32
- {...props}
33
- />
34
- )
35
- }
36
-
37
- export { Badge, badgeVariants }
@@ -1,77 +0,0 @@
1
- import { cva, type VariantProps } from 'class-variance-authority'
2
- import type { ComponentProps } from 'react'
3
-
4
- import { cn } from '@/lib/utils'
5
-
6
- const buttonVariants = cva(
7
- // The focus ring is `ring-ring` at full strength, not shadcn's stock
8
- // `focus-visible:ring-ring/50`. The token build pins `--ring` to a step that
9
- // clears 3:1 against the surface, and half alpha throws that away: 50% of this
10
- // ring composites to between 1.14:1 and 2.74:1 against every surface in all
11
- // six themes and clears 3:1 in none of them, which fails WCAG 1.4.11 on the one
12
- // indicator a keyboard user has. The stock value is kept here deliberately as a
13
- // deviation from upstream: a consumer's button must not fail the threshold the
14
- // ring exists to meet.
15
- "inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium outline-none transition-[color,box-shadow,background-color] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring focus-visible:ring-[3px] aria-invalid:ring-destructive/20 aria-invalid:border-destructive",
16
- {
17
- variants: {
18
- variant: {
19
- default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
20
- destructive:
21
- 'bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90',
22
- outline:
23
- 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground',
24
- secondary:
25
- 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
26
- ghost: 'hover:bg-accent hover:text-accent-foreground',
27
- // `primary` is a surface token, not a text token: in the pastel themes it
28
- // compiles to a light tint (e.g. #ec88a0) that fails 4.5:1 on the page
29
- // background. Link text uses the foreground and keeps the underline as its
30
- // affordance, so emphasis comes from weight rather than a failing colour.
31
- link: 'text-foreground underline-offset-4 hover:underline',
32
- },
33
- // Touch targets are enlarged by input method, not by viewport. The
34
- // metrics below are the designed desktop sizes and stay untouched for
35
- // mouse and trackpad; only a coarse pointer — finger or stylus — gets
36
- // the 44px iOS/Android HIG target. `pointer-coarse:` compiles to
37
- // `@media (pointer: coarse)` inside `@layer utilities`, which lands
38
- // after the base utility in the cascade, so it wins without needing
39
- // `!important` or a specificity fight.
40
- //
41
- // `min-w-11` is what makes the second axis safe: an icon-only `default`
42
- // is `size-4` plus `px-3` = 40px wide and an icon-only `sm` is `size-4`
43
- // plus `px-2.5` = 36px, so growing the height alone would still leave
44
- // both under 44px across. The coarse padding step on `default` lifts the
45
- // common cases clear of the floor outright, and `min-w-11` backstops
46
- // whatever content a consumer passes.
47
- size: {
48
- default:
49
- 'h-9 px-4 py-2 has-[>svg]:px-3 pointer-coarse:h-11 pointer-coarse:min-w-11 pointer-coarse:px-5 pointer-coarse:has-[>svg]:px-4',
50
- sm: 'h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5 pointer-coarse:h-11 pointer-coarse:min-w-11',
51
- lg: 'h-10 rounded-md px-6 has-[>svg]:px-4 pointer-coarse:h-11',
52
- icon: 'size-9 pointer-coarse:size-11',
53
- },
54
- },
55
- defaultVariants: {
56
- variant: 'default',
57
- size: 'default',
58
- },
59
- },
60
- )
61
-
62
- function Button({
63
- className,
64
- variant,
65
- size,
66
- ...props
67
- }: ComponentProps<'button'> & VariantProps<typeof buttonVariants>) {
68
- return (
69
- <button
70
- data-slot="button"
71
- className={cn(buttonVariants({ variant, size, className }))}
72
- {...props}
73
- />
74
- )
75
- }
76
-
77
- export { Button, buttonVariants }
@@ -1,65 +0,0 @@
1
- import type { ComponentProps } from 'react'
2
-
3
- import { cn } from '@/lib/utils'
4
-
5
- function Card({ className, ...props }: ComponentProps<'div'>) {
6
- return (
7
- <div
8
- data-slot="card"
9
- className={cn(
10
- 'bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm',
11
- className,
12
- )}
13
- {...props}
14
- />
15
- )
16
- }
17
-
18
- function CardHeader({ className, ...props }: ComponentProps<'div'>) {
19
- return (
20
- <div
21
- data-slot="card-header"
22
- className={cn(
23
- '@container/card-header grid auto-rows-min items-start gap-1.5 px-6',
24
- className,
25
- )}
26
- {...props}
27
- />
28
- )
29
- }
30
-
31
- function CardTitle({ className, ...props }: ComponentProps<'div'>) {
32
- return (
33
- <div
34
- data-slot="card-title"
35
- className={cn('font-semibold leading-none', className)}
36
- {...props}
37
- />
38
- )
39
- }
40
-
41
- function CardDescription({ className, ...props }: ComponentProps<'div'>) {
42
- return (
43
- <div
44
- data-slot="card-description"
45
- className={cn('text-muted-foreground text-sm', className)}
46
- {...props}
47
- />
48
- )
49
- }
50
-
51
- function CardContent({ className, ...props }: ComponentProps<'div'>) {
52
- return <div data-slot="card-content" className={cn('px-6', className)} {...props} />
53
- }
54
-
55
- function CardFooter({ className, ...props }: ComponentProps<'div'>) {
56
- return (
57
- <div
58
- data-slot="card-footer"
59
- className={cn('flex items-center px-6', className)}
60
- {...props}
61
- />
62
- )
63
- }
64
-
65
- export { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter }
package/src/lib/utils.ts DELETED
@@ -1,6 +0,0 @@
1
- import { type ClassValue, clsx } from 'clsx'
2
- import { twMerge } from 'tailwind-merge'
3
-
4
- export function cn(...inputs: ClassValue[]) {
5
- return twMerge(clsx(inputs))
6
- }