@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.
- package/LICENSE +21 -0
- package/README.md +81 -0
- package/THIRD-PARTY-NOTICES.md +48 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/blocks/app-shell-01/app-shell.d.ts +38 -0
- package/dist/blocks/app-shell-01/app-shell.d.ts.map +1 -0
- package/dist/blocks/app-shell-01/app-shell.js +27 -0
- package/dist/blocks/app-shell-01/index.d.ts +3 -0
- package/dist/blocks/app-shell-01/index.d.ts.map +1 -0
- package/dist/blocks/app-shell-01/index.js +1 -0
- package/dist/blocks/auth-form-01/auth-form.d.ts +52 -0
- package/dist/blocks/auth-form-01/auth-form.d.ts.map +1 -0
- package/dist/blocks/auth-form-01/auth-form.js +23 -0
- package/dist/blocks/auth-form-01/index.d.ts +3 -0
- package/dist/blocks/auth-form-01/index.d.ts.map +1 -0
- package/dist/blocks/auth-form-01/index.js +1 -0
- package/dist/blocks/cta-01/cta.d.ts +83 -0
- package/dist/blocks/cta-01/cta.d.ts.map +1 -0
- package/dist/blocks/cta-01/cta.js +29 -0
- package/dist/blocks/cta-01/index.d.ts +3 -0
- package/dist/blocks/cta-01/index.d.ts.map +1 -0
- package/dist/blocks/cta-01/index.js +1 -0
- package/dist/blocks/data-table-01/data-table.d.ts +102 -0
- package/dist/blocks/data-table-01/data-table.d.ts.map +1 -0
- package/dist/blocks/data-table-01/data-table.js +116 -0
- package/dist/blocks/data-table-01/index.d.ts +3 -0
- package/dist/blocks/data-table-01/index.d.ts.map +1 -0
- package/dist/blocks/data-table-01/index.js +1 -0
- package/dist/blocks/feature-grid-01/feature-grid.d.ts +78 -0
- package/dist/blocks/feature-grid-01/feature-grid.d.ts.map +1 -0
- package/dist/blocks/feature-grid-01/feature-grid.js +24 -0
- package/dist/blocks/feature-grid-01/index.d.ts +3 -0
- package/dist/blocks/feature-grid-01/index.d.ts.map +1 -0
- package/dist/blocks/feature-grid-01/index.js +1 -0
- package/dist/blocks/hero-01/hero.d.ts +59 -0
- package/dist/blocks/hero-01/hero.d.ts.map +1 -0
- package/dist/blocks/hero-01/hero.js +24 -0
- package/dist/blocks/hero-01/index.d.ts +2 -0
- package/dist/blocks/hero-01/index.d.ts.map +1 -0
- package/dist/blocks/hero-01/index.js +1 -0
- package/dist/blocks/index.d.ts +28 -0
- package/dist/blocks/index.d.ts.map +1 -0
- package/dist/blocks/index.js +26 -0
- package/dist/blocks/instrument-panel-01/index.d.ts +3 -0
- package/dist/blocks/instrument-panel-01/index.d.ts.map +1 -0
- package/dist/blocks/instrument-panel-01/index.js +1 -0
- package/dist/blocks/instrument-panel-01/instrument-panel.d.ts +114 -0
- package/dist/blocks/instrument-panel-01/instrument-panel.d.ts.map +1 -0
- package/dist/blocks/instrument-panel-01/instrument-panel.js +64 -0
- package/dist/blocks/logo-strip-01/index.d.ts +3 -0
- package/dist/blocks/logo-strip-01/index.d.ts.map +1 -0
- package/dist/blocks/logo-strip-01/index.js +1 -0
- package/dist/blocks/logo-strip-01/logo-strip.d.ts +84 -0
- package/dist/blocks/logo-strip-01/logo-strip.d.ts.map +1 -0
- package/dist/blocks/logo-strip-01/logo-strip.js +40 -0
- package/dist/blocks/note-grid-01/index.d.ts +3 -0
- package/dist/blocks/note-grid-01/index.d.ts.map +1 -0
- package/dist/blocks/note-grid-01/index.js +1 -0
- package/dist/blocks/note-grid-01/note-grid.d.ts +79 -0
- package/dist/blocks/note-grid-01/note-grid.d.ts.map +1 -0
- package/dist/blocks/note-grid-01/note-grid.js +37 -0
- package/dist/blocks/page-header-01/index.d.ts +3 -0
- package/dist/blocks/page-header-01/index.d.ts.map +1 -0
- package/dist/blocks/page-header-01/index.js +1 -0
- package/dist/blocks/page-header-01/page-header.d.ts +48 -0
- package/dist/blocks/page-header-01/page-header.d.ts.map +1 -0
- package/dist/blocks/page-header-01/page-header.js +27 -0
- package/dist/blocks/pricing-01/index.d.ts +2 -0
- package/dist/blocks/pricing-01/index.d.ts.map +1 -0
- package/dist/blocks/pricing-01/index.js +1 -0
- package/dist/blocks/pricing-01/pricing.d.ts +35 -0
- package/dist/blocks/pricing-01/pricing.d.ts.map +1 -0
- package/dist/blocks/pricing-01/pricing.js +20 -0
- package/dist/blocks/process-rail-01/index.d.ts +3 -0
- package/dist/blocks/process-rail-01/index.d.ts.map +1 -0
- package/dist/blocks/process-rail-01/index.js +1 -0
- package/dist/blocks/process-rail-01/process-rail.d.ts +99 -0
- package/dist/blocks/process-rail-01/process-rail.d.ts.map +1 -0
- package/dist/blocks/process-rail-01/process-rail.js +58 -0
- package/dist/blocks/product-grid-01/index.d.ts +3 -0
- package/dist/blocks/product-grid-01/index.d.ts.map +1 -0
- package/dist/blocks/product-grid-01/index.js +1 -0
- package/dist/blocks/product-grid-01/product-grid.d.ts +114 -0
- package/dist/blocks/product-grid-01/product-grid.d.ts.map +1 -0
- package/dist/blocks/product-grid-01/product-grid.js +51 -0
- package/dist/blocks/settings-panel-01/index.d.ts +3 -0
- package/dist/blocks/settings-panel-01/index.d.ts.map +1 -0
- package/dist/blocks/settings-panel-01/index.js +1 -0
- package/dist/blocks/settings-panel-01/settings-panel.d.ts +71 -0
- package/dist/blocks/settings-panel-01/settings-panel.d.ts.map +1 -0
- package/dist/blocks/settings-panel-01/settings-panel.js +38 -0
- package/dist/blocks/site-footer/index.d.ts +3 -0
- package/dist/blocks/site-footer/index.d.ts.map +1 -0
- package/dist/blocks/site-footer/index.js +1 -0
- package/dist/blocks/site-footer/site-footer.d.ts +135 -0
- package/dist/blocks/site-footer/site-footer.d.ts.map +1 -0
- package/dist/blocks/site-footer/site-footer.js +41 -0
- package/dist/blocks/site-header/index.d.ts +3 -0
- package/dist/blocks/site-header/index.d.ts.map +1 -0
- package/dist/blocks/site-header/index.js +1 -0
- package/dist/blocks/site-header/site-header.d.ts +142 -0
- package/dist/blocks/site-header/site-header.d.ts.map +1 -0
- package/dist/blocks/site-header/site-header.js +46 -0
- package/dist/blocks/stack-grid-01/index.d.ts +3 -0
- package/dist/blocks/stack-grid-01/index.d.ts.map +1 -0
- package/dist/blocks/stack-grid-01/index.js +1 -0
- package/dist/blocks/stack-grid-01/stack-grid.d.ts +118 -0
- package/dist/blocks/stack-grid-01/stack-grid.d.ts.map +1 -0
- package/dist/blocks/stack-grid-01/stack-grid.js +49 -0
- package/dist/blocks/stats-01/index.d.ts +2 -0
- package/dist/blocks/stats-01/index.d.ts.map +1 -0
- package/dist/blocks/stats-01/index.js +1 -0
- package/dist/blocks/stats-01/stats.d.ts +28 -0
- package/dist/blocks/stats-01/stats.d.ts.map +1 -0
- package/dist/blocks/stats-01/stats.js +27 -0
- package/dist/blocks/status-ledger-01/index.d.ts +3 -0
- package/dist/blocks/status-ledger-01/index.d.ts.map +1 -0
- package/dist/blocks/status-ledger-01/index.js +1 -0
- package/dist/blocks/status-ledger-01/status-ledger.d.ts +131 -0
- package/dist/blocks/status-ledger-01/status-ledger.d.ts.map +1 -0
- package/dist/blocks/status-ledger-01/status-ledger.js +80 -0
- package/dist/catalog.d.ts +28 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +672 -0
- package/dist/components/index.d.ts +64 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +43 -0
- package/dist/components/ui/accordion.d.ts +65 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +30 -0
- package/dist/components/ui/alert.d.ts +19 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +31 -0
- package/dist/components/ui/avatar.d.ts +47 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +30 -0
- package/dist/components/ui/badge.d.ts +14 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +26 -0
- package/dist/components/ui/breadcrumb.d.ts +35 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +48 -0
- package/dist/components/ui/button.d.ts +16 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +63 -0
- package/dist/components/ui/card.d.ts +41 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +53 -0
- package/dist/components/ui/checkbox.d.ts +43 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +18 -0
- package/dist/components/ui/cta-link.d.ts +45 -0
- package/dist/components/ui/cta-link.d.ts.map +1 -0
- package/dist/components/ui/cta-link.js +81 -0
- package/dist/components/ui/diagram.d.ts +154 -0
- package/dist/components/ui/diagram.d.ts.map +1 -0
- package/dist/components/ui/diagram.js +150 -0
- package/dist/components/ui/dialog.d.ts +81 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +60 -0
- package/dist/components/ui/dropdown-menu.d.ts +189 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +67 -0
- package/dist/components/ui/fact-list.d.ts +90 -0
- package/dist/components/ui/fact-list.d.ts.map +1 -0
- package/dist/components/ui/fact-list.js +38 -0
- package/dist/components/ui/field.d.ts +36 -0
- package/dist/components/ui/field.d.ts.map +1 -0
- package/dist/components/ui/field.js +46 -0
- package/dist/components/ui/input.d.ts +12 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +14 -0
- package/dist/components/ui/kbd.d.ts +10 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/kbd.js +12 -0
- package/dist/components/ui/pagination.d.ts +40 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +49 -0
- package/dist/components/ui/popover.d.ts +56 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +25 -0
- package/dist/components/ui/product-mark.d.ts +115 -0
- package/dist/components/ui/product-mark.d.ts.map +1 -0
- package/dist/components/ui/product-mark.js +82 -0
- package/dist/components/ui/product-switcher.d.ts +108 -0
- package/dist/components/ui/product-switcher.d.ts.map +1 -0
- package/dist/components/ui/product-switcher.js +47 -0
- package/dist/components/ui/progress.d.ts +38 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +17 -0
- package/dist/components/ui/prose.d.ts +88 -0
- package/dist/components/ui/prose.d.ts.map +1 -0
- package/dist/components/ui/prose.js +53 -0
- package/dist/components/ui/radio-group.d.ts +66 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +30 -0
- package/dist/components/ui/section.d.ts +60 -0
- package/dist/components/ui/section.d.ts.map +1 -0
- package/dist/components/ui/section.js +21 -0
- package/dist/components/ui/select.d.ts +124 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +47 -0
- package/dist/components/ui/separator.d.ts +16 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +15 -0
- package/dist/components/ui/skeleton.d.ts +12 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +14 -0
- package/dist/components/ui/slider.d.ts +43 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +23 -0
- package/dist/components/ui/switch.d.ts +42 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +16 -0
- package/dist/components/ui/table.d.ts +27 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +43 -0
- package/dist/components/ui/tabs.d.ts +66 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +29 -0
- package/dist/components/ui/textarea.d.ts +11 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +13 -0
- package/dist/components/ui/tooltip.d.ts +63 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +25 -0
- package/dist/components/ui/typography.d.ts +32 -0
- package/dist/components/ui/typography.d.ts.map +1 -0
- package/dist/components/ui/typography.js +51 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +68 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +5 -0
- package/dist/pages/auth-page/index.d.ts +36 -0
- package/dist/pages/auth-page/index.d.ts.map +1 -0
- package/dist/pages/auth-page/index.js +23 -0
- package/dist/pages/blog-post-page/index.d.ts +174 -0
- package/dist/pages/blog-post-page/index.d.ts.map +1 -0
- package/dist/pages/blog-post-page/index.js +49 -0
- package/dist/pages/dashboard-page/index.d.ts +36 -0
- package/dist/pages/dashboard-page/index.d.ts.map +1 -0
- package/dist/pages/dashboard-page/index.js +24 -0
- package/dist/pages/index.d.ts +21 -0
- package/dist/pages/index.d.ts.map +1 -0
- package/dist/pages/index.js +14 -0
- package/dist/pages/marketing-page/index.d.ts +43 -0
- package/dist/pages/marketing-page/index.d.ts.map +1 -0
- package/dist/pages/marketing-page/index.js +25 -0
- package/dist/pages/not-found-page/index.d.ts +112 -0
- package/dist/pages/not-found-page/index.d.ts.map +1 -0
- package/dist/pages/not-found-page/index.js +46 -0
- package/dist/pages/settings-page/index.d.ts +47 -0
- package/dist/pages/settings-page/index.d.ts.map +1 -0
- package/dist/pages/settings-page/index.js +24 -0
- package/dist/provider/index.d.ts +12 -0
- package/dist/provider/index.d.ts.map +1 -0
- package/dist/provider/index.js +9 -0
- package/dist/provider/provider.d.ts +42 -0
- package/dist/provider/provider.d.ts.map +1 -0
- package/dist/provider/provider.js +178 -0
- package/dist/provider/theme-script.d.ts +55 -0
- package/dist/provider/theme-script.d.ts.map +1 -0
- package/dist/provider/theme-script.js +79 -0
- package/dist/styles.css +2894 -0
- package/dist/theming/index.d.ts +173 -0
- package/dist/theming/index.d.ts.map +1 -0
- package/dist/theming/index.js +186 -0
- package/package.json +89 -18
- package/components.json +0 -21
- package/public/r/badge.json +0 -26
- package/public/r/button.json +0 -26
- package/public/r/card.json +0 -25
- package/public/r/cta-01.json +0 -44
- package/public/r/feature-grid-01.json +0 -44
- package/public/r/hero-01.json +0 -44
- package/public/r/pricing-01.json +0 -46
- package/public/r/registry.json +0 -294
- package/public/r/section.json +0 -25
- package/public/r/stats-01.json +0 -44
- package/registry.json +0 -294
- package/src/components/ds/blocks/cta-01/block.json +0 -8
- package/src/components/ds/blocks/cta-01/cta.tsx +0 -62
- package/src/components/ds/blocks/cta-01/index.tsx +0 -1
- package/src/components/ds/blocks/feature-grid-01/block.json +0 -8
- package/src/components/ds/blocks/feature-grid-01/feature-grid.tsx +0 -69
- package/src/components/ds/blocks/feature-grid-01/index.tsx +0 -1
- package/src/components/ds/blocks/hero-01/block.json +0 -8
- package/src/components/ds/blocks/hero-01/hero.tsx +0 -85
- package/src/components/ds/blocks/hero-01/index.tsx +0 -1
- package/src/components/ds/blocks/pricing-01/block.json +0 -8
- package/src/components/ds/blocks/pricing-01/index.tsx +0 -1
- package/src/components/ds/blocks/pricing-01/pricing.tsx +0 -122
- package/src/components/ds/blocks/section.meta.json +0 -6
- package/src/components/ds/blocks/section.tsx +0 -86
- package/src/components/ds/blocks/stats-01/block.json +0 -8
- package/src/components/ds/blocks/stats-01/index.tsx +0 -1
- package/src/components/ds/blocks/stats-01/stats.tsx +0 -92
- package/src/components/ui/badge.tsx +0 -37
- package/src/components/ui/button.tsx +0 -77
- package/src/components/ui/card.tsx +0 -65
- package/src/lib/utils.ts +0 -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 }
|