@nanisoft/prism-ui 0.5.0 → 0.5.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.
- 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 +23 -0
- package/dist/blocks/cta-01/cta.d.ts.map +1 -0
- package/dist/blocks/cta-01/cta.js +24 -0
- package/dist/blocks/cta-01/index.d.ts +2 -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 +27 -0
- package/dist/blocks/feature-grid-01/feature-grid.d.ts.map +1 -0
- package/dist/blocks/feature-grid-01/feature-grid.js +14 -0
- package/dist/blocks/feature-grid-01/index.d.ts +2 -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 +30 -0
- package/dist/blocks/hero-01/hero.d.ts.map +1 -0
- package/dist/blocks/hero-01/hero.js +12 -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 +18 -0
- package/dist/blocks/index.d.ts.map +1 -0
- package/dist/blocks/index.js +17 -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/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/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/catalog.d.ts +28 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +502 -0
- package/dist/components/index.d.ts +53 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +37 -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 +16 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +28 -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/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/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/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/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 +37 -0
- package/dist/components/ui/section.d.ts.map +1 -0
- package/dist/components/ui/section.js +12 -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 +17 -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 +55 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -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/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 +17 -0
- package/dist/pages/index.d.ts.map +1 -0
- package/dist/pages/index.js +12 -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/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 +37 -0
- package/dist/provider/provider.d.ts.map +1 -0
- package/dist/provider/provider.js +87 -0
- package/dist/provider/theme-script.d.ts +17 -0
- package/dist/provider/theme-script.d.ts.map +1 -0
- package/dist/provider/theme-script.js +28 -0
- package/dist/styles.css +2413 -0
- package/dist/theming/index.d.ts +43 -0
- package/dist/theming/index.d.ts.map +1 -0
- package/dist/theming/index.js +60 -0
- package/package.json +79 -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,62 +0,0 @@
|
|
|
1
|
-
import { ArrowRight } from 'lucide-react'
|
|
2
|
-
|
|
3
|
-
import { Button } from '@/components/ui/button'
|
|
4
|
-
import { Section, type HeadingLevel } from '@/components/ds/blocks/section'
|
|
5
|
-
|
|
6
|
-
export type Cta01Props = {
|
|
7
|
-
title: string
|
|
8
|
-
description?: string
|
|
9
|
-
action?: { label: string; href?: string; variant?: 'default' | 'secondary' | 'outline' }
|
|
10
|
-
/** Heading level for the headline. See `HeadingLevel`. */
|
|
11
|
-
headingLevel?: HeadingLevel
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* A closing call to action on a filled primary surface.
|
|
16
|
-
*
|
|
17
|
-
* The copy and the action are props. It previously shipped the catalog's own
|
|
18
|
-
* pitch ("Start with one block, keep the tokens") and a hardcoded "Browse the
|
|
19
|
-
* catalog" button, both of which described the library rather than whatever
|
|
20
|
-
* product installed the block.
|
|
21
|
-
*/
|
|
22
|
-
export function Cta01({ title, description, action, headingLevel = 'h2' }: Cta01Props) {
|
|
23
|
-
/*
|
|
24
|
-
* The same mechanism `SectionHeading` uses for its own `as` prop, which this
|
|
25
|
-
* block cannot borrow: its copy sits on a filled `bg-primary` surface, where
|
|
26
|
-
* `SectionHeading`'s muted-surface description colour and `gap-4` would be
|
|
27
|
-
* wrong. So the tag is resolved here and the classes stay surface-specific
|
|
28
|
-
* rather than the heading level being the reason the markup stays hardcoded.
|
|
29
|
-
*/
|
|
30
|
-
const Heading = headingLevel
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<Section className="py-20">
|
|
34
|
-
<div className="bg-primary text-primary-foreground relative overflow-hidden rounded-2xl px-8 py-16 text-center">
|
|
35
|
-
<div
|
|
36
|
-
aria-hidden
|
|
37
|
-
className="from-primary-foreground/15 pointer-events-none absolute inset-0 bg-gradient-to-tr to-transparent"
|
|
38
|
-
/>
|
|
39
|
-
<div className="relative flex flex-col items-center gap-6">
|
|
40
|
-
<Heading className="max-w-2xl text-3xl font-semibold tracking-tight text-balance sm:text-4xl">
|
|
41
|
-
{title}
|
|
42
|
-
</Heading>
|
|
43
|
-
{description ? (
|
|
44
|
-
<p className="max-w-xl text-lg text-pretty opacity-90">{description}</p>
|
|
45
|
-
) : null}
|
|
46
|
-
{action ? (
|
|
47
|
-
<Button
|
|
48
|
-
size="lg"
|
|
49
|
-
variant={action.variant ?? 'secondary'}
|
|
50
|
-
className="group"
|
|
51
|
-
>
|
|
52
|
-
{action.label}
|
|
53
|
-
<ArrowRight className="motion-safe:transition-transform size-4 group-hover:translate-x-0.5" />
|
|
54
|
-
</Button>
|
|
55
|
-
) : null}
|
|
56
|
-
</div>
|
|
57
|
-
</div>
|
|
58
|
-
</Section>
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export default Cta01
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Cta01, default } from './cta'
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "feature-grid-01",
|
|
3
|
-
"title": "Feature Grid 01 - Four Up With Icons",
|
|
4
|
-
"description": "A four-up feature grid with icon tiles. Pass the items in; the section heading is optional.",
|
|
5
|
-
"categories": ["marketing"],
|
|
6
|
-
"registryDependencies": ["card"],
|
|
7
|
-
"dependencies": ["lucide-react"]
|
|
8
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { LucideIcon } from 'lucide-react'
|
|
2
|
-
|
|
3
|
-
import { Card, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
|
4
|
-
import { Section, SectionHeading, type HeadingLevel } from '@/components/ds/blocks/section'
|
|
5
|
-
|
|
6
|
-
export type Feature = {
|
|
7
|
-
icon: LucideIcon
|
|
8
|
-
title: string
|
|
9
|
-
body: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type FeatureGrid01Props = {
|
|
13
|
-
eyebrow?: string
|
|
14
|
-
title?: string
|
|
15
|
-
description?: string
|
|
16
|
-
features: Feature[]
|
|
17
|
-
/** `icon` tiles read well at 2-up; `bare` leans on the type alone. */
|
|
18
|
-
variant?: 'icon' | 'bare'
|
|
19
|
-
/** Heading level for the section title. See `HeadingLevel`. */
|
|
20
|
-
headingLevel?: HeadingLevel
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* A grid of short feature blurbs.
|
|
25
|
-
*
|
|
26
|
-
* The feature list is a prop. It previously hardcoded the catalog's own selling
|
|
27
|
-
* points under the heading "Why this catalog", so an installed block argued for
|
|
28
|
-
* the library inside the consumer's product.
|
|
29
|
-
*/
|
|
30
|
-
export function FeatureGrid01({
|
|
31
|
-
eyebrow,
|
|
32
|
-
title,
|
|
33
|
-
description,
|
|
34
|
-
features,
|
|
35
|
-
variant = 'icon',
|
|
36
|
-
headingLevel = 'h2',
|
|
37
|
-
}: FeatureGrid01Props) {
|
|
38
|
-
return (
|
|
39
|
-
<Section>
|
|
40
|
-
{title ? (
|
|
41
|
-
<SectionHeading
|
|
42
|
-
as={headingLevel}
|
|
43
|
-
eyebrow={eyebrow}
|
|
44
|
-
title={title}
|
|
45
|
-
description={description}
|
|
46
|
-
className="mb-12"
|
|
47
|
-
/>
|
|
48
|
-
) : null}
|
|
49
|
-
|
|
50
|
-
<div className="grid gap-6 sm:grid-cols-2">
|
|
51
|
-
{features.map((feature) => (
|
|
52
|
-
<Card key={feature.title} className="gap-4 py-6">
|
|
53
|
-
<CardHeader>
|
|
54
|
-
{variant === 'icon' ? (
|
|
55
|
-
<span className="bg-accent text-accent-foreground mb-2 flex size-10 items-center justify-center rounded-lg">
|
|
56
|
-
<feature.icon className="size-5" />
|
|
57
|
-
</span>
|
|
58
|
-
) : null}
|
|
59
|
-
<CardTitle>{feature.title}</CardTitle>
|
|
60
|
-
<CardDescription>{feature.body}</CardDescription>
|
|
61
|
-
</CardHeader>
|
|
62
|
-
</Card>
|
|
63
|
-
))}
|
|
64
|
-
</div>
|
|
65
|
-
</Section>
|
|
66
|
-
)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export default FeatureGrid01
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { FeatureGrid01, default } from './feature-grid'
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "hero-01",
|
|
3
|
-
"title": "Hero 01 - Centered Marketing Hero",
|
|
4
|
-
"description": "A centered hero with an optional eyebrow, headline, supporting line and one or two actions. All copy is passed in as props.",
|
|
5
|
-
"categories": ["marketing"],
|
|
6
|
-
"registryDependencies": ["button"],
|
|
7
|
-
"dependencies": ["lucide-react"]
|
|
8
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { ArrowRight } from 'lucide-react'
|
|
2
|
-
|
|
3
|
-
import { Button } from '@/components/ui/button'
|
|
4
|
-
import { Section, SectionHeading, type HeadingLevel } from '@/components/ds/blocks/section'
|
|
5
|
-
|
|
6
|
-
export type HeroAction = {
|
|
7
|
-
label: string
|
|
8
|
-
href?: string
|
|
9
|
-
variant?: 'default' | 'outline' | 'secondary' | 'ghost'
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type Hero01Props = {
|
|
13
|
-
/**
|
|
14
|
-
* Optional label above the headline. Intentionally has no default: an earlier
|
|
15
|
-
* version shipped a hardcoded "Now in open beta" pill, which meant every
|
|
16
|
-
* consumer who installed this block inherited a status badge making a claim
|
|
17
|
-
* about their product. Pass one if you mean it.
|
|
18
|
-
*/
|
|
19
|
-
eyebrow?: string
|
|
20
|
-
title: string
|
|
21
|
-
description?: string
|
|
22
|
-
actions?: HeroAction[]
|
|
23
|
-
/**
|
|
24
|
-
* Heading level for the title. Defaults to `h2` because a block is composed,
|
|
25
|
-
* not a page: it installs into a consumer's layout via `shadcn add` and renders
|
|
26
|
-
* inside catalog previews, so the surrounding document already owns the `h1`.
|
|
27
|
-
* A page that uses this block as its top-level heading opts in with
|
|
28
|
-
* `headingLevel="h1"`; a document that already names this section in its own
|
|
29
|
-
* heading passes one level deeper. See `HeadingLevel`.
|
|
30
|
-
*/
|
|
31
|
-
headingLevel?: HeadingLevel
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function Hero01({
|
|
35
|
-
eyebrow,
|
|
36
|
-
title,
|
|
37
|
-
description,
|
|
38
|
-
actions = [],
|
|
39
|
-
headingLevel = 'h2',
|
|
40
|
-
}: Hero01Props) {
|
|
41
|
-
return (
|
|
42
|
-
<Section className="relative overflow-hidden">
|
|
43
|
-
<div
|
|
44
|
-
aria-hidden
|
|
45
|
-
className="from-primary/5 pointer-events-none absolute inset-0 -z-10 bg-gradient-to-b to-transparent"
|
|
46
|
-
/>
|
|
47
|
-
<div className="flex flex-col items-center gap-10 text-center">
|
|
48
|
-
{eyebrow ? (
|
|
49
|
-
<span className="bg-muted text-muted-foreground rounded-full px-3 py-1 text-xs font-medium">
|
|
50
|
-
{eyebrow}
|
|
51
|
-
</span>
|
|
52
|
-
) : null}
|
|
53
|
-
|
|
54
|
-
<SectionHeading
|
|
55
|
-
as={headingLevel}
|
|
56
|
-
title={title}
|
|
57
|
-
description={description}
|
|
58
|
-
/>
|
|
59
|
-
|
|
60
|
-
{actions.length ? (
|
|
61
|
-
<div className="flex flex-col gap-3 sm:flex-row">
|
|
62
|
-
{actions.map((action, index) => (
|
|
63
|
-
// Positional, for the same reason as `pricing-01`'s feature list:
|
|
64
|
-
// the label is display content, and two actions may share one.
|
|
65
|
-
// Safe here because the list is static and never reordered.
|
|
66
|
-
<Button
|
|
67
|
-
key={index}
|
|
68
|
-
size="lg"
|
|
69
|
-
variant={action.variant ?? (index === 0 ? 'default' : 'outline')}
|
|
70
|
-
className="group"
|
|
71
|
-
>
|
|
72
|
-
{action.label}
|
|
73
|
-
{index === 0 ? (
|
|
74
|
-
<ArrowRight className="motion-safe:transition-transform size-4 group-hover:translate-x-0.5" />
|
|
75
|
-
) : null}
|
|
76
|
-
</Button>
|
|
77
|
-
))}
|
|
78
|
-
</div>
|
|
79
|
-
) : null}
|
|
80
|
-
</div>
|
|
81
|
-
</Section>
|
|
82
|
-
)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export default Hero01
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Hero01, default } from './hero'
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "pricing-01",
|
|
3
|
-
"title": "Pricing 01 - Three Tier With Highlight",
|
|
4
|
-
"description": "A three-up plan comparison with one plan lifted. Plans, prices, features and actions are all passed in as props.",
|
|
5
|
-
"categories": ["marketing"],
|
|
6
|
-
"registryDependencies": ["button", "badge", "card"],
|
|
7
|
-
"dependencies": ["lucide-react"]
|
|
8
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Pricing01, default } from './pricing'
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { Check } from 'lucide-react'
|
|
2
|
-
|
|
3
|
-
import { Badge } from '@/components/ui/badge'
|
|
4
|
-
import { Button } from '@/components/ui/button'
|
|
5
|
-
import {
|
|
6
|
-
Card,
|
|
7
|
-
CardContent,
|
|
8
|
-
CardDescription,
|
|
9
|
-
CardFooter,
|
|
10
|
-
CardHeader,
|
|
11
|
-
CardTitle,
|
|
12
|
-
} from '@/components/ui/card'
|
|
13
|
-
import { Section, SectionHeading, type HeadingLevel } from '@/components/ds/blocks/section'
|
|
14
|
-
|
|
15
|
-
export type Plan = {
|
|
16
|
-
name: string
|
|
17
|
-
price: string
|
|
18
|
-
/** Rendered after the price, e.g. " / month". Omit for a one-off figure. */
|
|
19
|
-
period?: string
|
|
20
|
-
body?: string
|
|
21
|
-
features: string[]
|
|
22
|
-
cta: string
|
|
23
|
-
/** Lifts the plan with a primary border and a filled button. */
|
|
24
|
-
featured?: boolean
|
|
25
|
-
/** Overrides the "Popular" badge on the featured plan. */
|
|
26
|
-
badge?: string
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export type Pricing01Props = {
|
|
30
|
-
eyebrow?: string
|
|
31
|
-
title?: string
|
|
32
|
-
description?: string
|
|
33
|
-
plans: Plan[]
|
|
34
|
-
/** Heading level for the section title. See `HeadingLevel`. */
|
|
35
|
-
headingLevel?: HeadingLevel
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* A three-up plan comparison.
|
|
40
|
-
*
|
|
41
|
-
* Every plan is a prop, including the price and the call to action. It previously
|
|
42
|
-
* hardcoded "$0 / $24 / $68", "Talk to us", "MIT licence" and "Figma library",
|
|
43
|
-
* and shipped a heading reading "Pricing" above a title already reading "Pick a
|
|
44
|
-
* plan". A shared library has no plans to sell, so those strings described a
|
|
45
|
-
* business that does not exist here, and every consumer who installed the block
|
|
46
|
-
* inherited them.
|
|
47
|
-
*/
|
|
48
|
-
export function Pricing01({
|
|
49
|
-
eyebrow,
|
|
50
|
-
title,
|
|
51
|
-
description,
|
|
52
|
-
plans,
|
|
53
|
-
headingLevel = 'h2',
|
|
54
|
-
}: Pricing01Props) {
|
|
55
|
-
return (
|
|
56
|
-
<Section>
|
|
57
|
-
{title ? (
|
|
58
|
-
<SectionHeading
|
|
59
|
-
as={headingLevel}
|
|
60
|
-
eyebrow={eyebrow}
|
|
61
|
-
title={title}
|
|
62
|
-
description={description}
|
|
63
|
-
className="mb-12"
|
|
64
|
-
/>
|
|
65
|
-
) : null}
|
|
66
|
-
|
|
67
|
-
<div className="grid gap-6 lg:grid-cols-3">
|
|
68
|
-
{plans.map((plan) => (
|
|
69
|
-
<Card
|
|
70
|
-
key={plan.name}
|
|
71
|
-
className={plan.featured ? 'border-primary shadow-md' : undefined}
|
|
72
|
-
>
|
|
73
|
-
<CardHeader>
|
|
74
|
-
<div className="flex items-center justify-between">
|
|
75
|
-
<CardTitle>{plan.name}</CardTitle>
|
|
76
|
-
{plan.featured ? <Badge>{plan.badge ?? 'Popular'}</Badge> : null}
|
|
77
|
-
</div>
|
|
78
|
-
{plan.body ? <CardDescription>{plan.body}</CardDescription> : null}
|
|
79
|
-
<p className="mt-2 text-3xl font-semibold tracking-tight">
|
|
80
|
-
{plan.price}
|
|
81
|
-
{plan.period ? (
|
|
82
|
-
<span className="text-muted-foreground text-sm font-normal">
|
|
83
|
-
{plan.period}
|
|
84
|
-
</span>
|
|
85
|
-
) : null}
|
|
86
|
-
</p>
|
|
87
|
-
</CardHeader>
|
|
88
|
-
|
|
89
|
-
<CardContent className="flex flex-col gap-3">
|
|
90
|
-
{/*
|
|
91
|
-
Keyed by position, not by the feature string. The string is display
|
|
92
|
-
content rather than identity, and a plan is free to list the same
|
|
93
|
-
line twice; keying on it logged React's duplicate-key error and let
|
|
94
|
-
React drop and reorder rows. `key={index}` is correct here because
|
|
95
|
-
this list is static: it is rendered once from props and never
|
|
96
|
-
reordered, filtered or appended to, so there is no state to
|
|
97
|
-
preserve across a reorder that a positional key could lose.
|
|
98
|
-
*/}
|
|
99
|
-
{plan.features.map((feature, index) => (
|
|
100
|
-
<p key={index} className="flex items-start gap-2 text-sm">
|
|
101
|
-
<Check className="text-success mt-0.5 size-4 shrink-0" />
|
|
102
|
-
{feature}
|
|
103
|
-
</p>
|
|
104
|
-
))}
|
|
105
|
-
</CardContent>
|
|
106
|
-
|
|
107
|
-
<CardFooter className="mt-auto">
|
|
108
|
-
<Button
|
|
109
|
-
className="w-full"
|
|
110
|
-
variant={plan.featured ? 'default' : 'outline'}
|
|
111
|
-
>
|
|
112
|
-
{plan.cta}
|
|
113
|
-
</Button>
|
|
114
|
-
</CardFooter>
|
|
115
|
-
</Card>
|
|
116
|
-
))}
|
|
117
|
-
</div>
|
|
118
|
-
</Section>
|
|
119
|
-
)
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export default Pricing01
|
|
@@ -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 }
|