@krizaka/ui 2.6.0 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -4
- package/dist/achievement.d.ts +54 -0
- package/dist/achievement.js +73 -0
- package/dist/achievement.js.map +1 -0
- package/dist/app-shell.d.ts +203 -0
- package/dist/app-shell.js +137 -0
- package/dist/app-shell.js.map +1 -0
- package/dist/auth-layout.d.ts +136 -0
- package/dist/auth-layout.js +75 -0
- package/dist/auth-layout.js.map +1 -0
- package/dist/choice-grid.d.ts +84 -0
- package/dist/choice-grid.js +141 -0
- package/dist/choice-grid.js.map +1 -0
- package/dist/chunk-555LWYIN.js +11 -0
- package/dist/chunk-555LWYIN.js.map +1 -0
- package/dist/chunk-AZPKXP3O.js +36 -0
- package/dist/chunk-AZPKXP3O.js.map +1 -0
- package/dist/chunk-NOVUREEC.js +274 -0
- package/dist/chunk-NOVUREEC.js.map +1 -0
- package/dist/chunk-VCAAHCHL.js +17 -0
- package/dist/chunk-VCAAHCHL.js.map +1 -0
- package/dist/code-block.js +23 -44
- package/dist/code-block.js.map +1 -1
- package/dist/continue-prompt.d.ts +48 -0
- package/dist/continue-prompt.js +200 -0
- package/dist/continue-prompt.js.map +1 -0
- package/dist/dashboard-layout.d.ts +139 -0
- package/dist/dashboard-layout.js +68 -0
- package/dist/dashboard-layout.js.map +1 -0
- package/dist/detail-layout.d.ts +126 -0
- package/dist/detail-layout.js +48 -0
- package/dist/detail-layout.js.map +1 -0
- package/dist/docs-layout.d.ts +78 -0
- package/dist/docs-layout.js +60 -0
- package/dist/docs-layout.js.map +1 -0
- package/dist/geometry-CXrAW34x.d.ts +19 -0
- package/dist/goal-gauge.d.ts +38 -0
- package/dist/goal-gauge.js +53 -0
- package/dist/goal-gauge.js.map +1 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.js +89 -4
- package/dist/index.js.map +1 -1
- package/dist/landscape.d.ts +41 -0
- package/dist/landscape.js +836 -0
- package/dist/landscape.js.map +1 -0
- package/dist/marketing-layout.d.ts +60 -0
- package/dist/marketing-layout.js +25 -0
- package/dist/marketing-layout.js.map +1 -0
- package/dist/mascot-quote.d.ts +4 -3
- package/dist/mascot-quote.js +21 -1
- package/dist/mascot-quote.js.map +1 -1
- package/dist/mascot-state.d.ts +128 -0
- package/dist/mascot-state.js +95 -0
- package/dist/mascot-state.js.map +1 -0
- package/dist/mascots.d.ts +18 -20
- package/dist/mascots.js +65 -221
- package/dist/mascots.js.map +1 -1
- package/dist/native.d.ts +124 -7
- package/dist/native.js +641 -239
- package/dist/native.js.map +1 -1
- package/dist/profile-card.d.ts +85 -0
- package/dist/profile-card.js +87 -0
- package/dist/profile-card.js.map +1 -0
- package/dist/promise-card.d.ts +28 -0
- package/dist/promise-card.js +29 -0
- package/dist/promise-card.js.map +1 -0
- package/dist/scroll-stage.d.ts +603 -0
- package/dist/scroll-stage.js +59 -0
- package/dist/scroll-stage.js.map +1 -0
- package/dist/settings-layout.d.ts +154 -0
- package/dist/settings-layout.js +57 -0
- package/dist/settings-layout.js.map +1 -0
- package/dist/split-view.d.ts +106 -0
- package/dist/split-view.js +41 -0
- package/dist/split-view.js.map +1 -0
- package/dist/stage-banner.d.ts +34 -0
- package/dist/stage-banner.js +26 -0
- package/dist/stage-banner.js.map +1 -0
- package/dist/story-variant-CLn4H5Nt.d.ts +4 -0
- package/dist/story.css +432 -0
- package/package.json +267 -10
- package/registry/achievement.json +322 -0
- package/registry/action-bar.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/app-shell.json +451 -0
- package/registry/argument-card.json +1 -1
- package/registry/audio-player.json +1 -1
- package/registry/auth-layout.json +230 -0
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/button.json +5 -5
- package/registry/card-grid.json +5 -5
- package/registry/card.json +3 -3
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +318 -0
- package/registry/code-block.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.json +1 -1
- package/registry/confirm-button.json +3 -3
- package/registry/continue-prompt.json +312 -0
- package/registry/countdown.json +1 -1
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +273 -0
- package/registry/data-table.json +1 -1
- package/registry/date-picker.json +1 -1
- package/registry/decision-list.json +1 -1
- package/registry/detail-layout.json +233 -0
- package/registry/dialog.json +1 -1
- package/registry/docs-layout.json +148 -0
- package/registry/dropdown-menu.json +3 -3
- package/registry/empty-state.json +1 -1
- package/registry/examples/achievement/arcade.d.ts +4 -0
- package/registry/examples/achievement/arcade.js +15 -0
- package/registry/examples/achievement/arcade.tsx +12 -0
- package/registry/examples/achievement/milestones.d.ts +4 -0
- package/registry/examples/achievement/milestones.js +15 -0
- package/registry/examples/achievement/milestones.tsx +12 -0
- package/registry/examples/app-shell/admin-console.d.ts +4 -0
- package/registry/examples/app-shell/admin-console.js +52 -0
- package/registry/examples/app-shell/admin-console.tsx +64 -0
- package/registry/examples/app-shell/basic.d.ts +4 -0
- package/registry/examples/app-shell/basic.js +37 -0
- package/registry/examples/app-shell/basic.tsx +31 -0
- package/registry/examples/app-shell/orochia-studio.d.ts +4 -0
- package/registry/examples/app-shell/orochia-studio.js +89 -0
- package/registry/examples/app-shell/orochia-studio.tsx +101 -0
- package/registry/examples/auth-layout/onboarding.d.ts +4 -0
- package/registry/examples/auth-layout/onboarding.js +56 -0
- package/registry/examples/auth-layout/onboarding.tsx +47 -0
- package/registry/examples/auth-layout/sign-in.d.ts +4 -0
- package/registry/examples/auth-layout/sign-in.js +55 -0
- package/registry/examples/auth-layout/sign-in.tsx +47 -0
- package/registry/examples/auth-layout/verify.d.ts +4 -0
- package/registry/examples/auth-layout/verify.js +23 -0
- package/registry/examples/auth-layout/verify.tsx +19 -0
- package/registry/examples/choice-grid/line-up.d.ts +4 -0
- package/registry/examples/choice-grid/line-up.js +37 -0
- package/registry/examples/choice-grid/line-up.tsx +32 -0
- package/registry/examples/choice-grid/plans.d.ts +4 -0
- package/registry/examples/choice-grid/plans.js +28 -0
- package/registry/examples/choice-grid/plans.tsx +24 -0
- package/registry/examples/continue-prompt/arcade.d.ts +4 -0
- package/registry/examples/continue-prompt/arcade.js +28 -0
- package/registry/examples/continue-prompt/arcade.tsx +25 -0
- package/registry/examples/continue-prompt/offer.d.ts +4 -0
- package/registry/examples/continue-prompt/offer.js +24 -0
- package/registry/examples/continue-prompt/offer.tsx +19 -0
- package/registry/examples/dashboard-layout/orazaka-eric.d.ts +4 -0
- package/registry/examples/dashboard-layout/orazaka-eric.js +58 -0
- package/registry/examples/dashboard-layout/orazaka-eric.tsx +80 -0
- package/registry/examples/dashboard-layout/widgets.d.ts +4 -0
- package/registry/examples/dashboard-layout/widgets.js +17 -0
- package/registry/examples/dashboard-layout/widgets.tsx +22 -0
- package/registry/examples/detail-layout/job.d.ts +4 -0
- package/registry/examples/detail-layout/job.js +25 -0
- package/registry/examples/detail-layout/job.tsx +20 -0
- package/registry/examples/detail-layout/video.d.ts +4 -0
- package/registry/examples/detail-layout/video.js +44 -0
- package/registry/examples/detail-layout/video.tsx +53 -0
- package/registry/examples/docs-layout/page.d.ts +4 -0
- package/registry/examples/docs-layout/page.js +26 -0
- package/registry/examples/docs-layout/page.tsx +30 -0
- package/registry/examples/goal-gauge/arcade.d.ts +4 -0
- package/registry/examples/goal-gauge/arcade.js +11 -0
- package/registry/examples/goal-gauge/arcade.tsx +10 -0
- package/registry/examples/goal-gauge/challenge.d.ts +4 -0
- package/registry/examples/goal-gauge/challenge.js +11 -0
- package/registry/examples/goal-gauge/challenge.tsx +10 -0
- package/registry/examples/goal-gauge/drain.d.ts +4 -0
- package/registry/examples/goal-gauge/drain.js +11 -0
- package/registry/examples/goal-gauge/drain.tsx +10 -0
- package/registry/examples/goal-gauge/native/default.d.ts +4 -0
- package/registry/examples/goal-gauge/native/default.dark.png +0 -0
- package/registry/examples/goal-gauge/native/default.js +15 -0
- package/registry/examples/goal-gauge/native/default.light.png +0 -0
- package/registry/examples/goal-gauge/native/default.tsx +12 -0
- package/registry/examples/landscape/backdrop.d.ts +4 -0
- package/registry/examples/landscape/backdrop.js +14 -0
- package/registry/examples/landscape/backdrop.tsx +11 -0
- package/registry/examples/landscape/brand.d.ts +4 -0
- package/registry/examples/landscape/brand.js +11 -0
- package/registry/examples/landscape/brand.tsx +10 -0
- package/registry/examples/marketing-layout/basic.d.ts +4 -0
- package/registry/examples/marketing-layout/basic.js +31 -0
- package/registry/examples/marketing-layout/basic.tsx +28 -0
- package/registry/examples/marketing-layout/docs-hub.d.ts +4 -0
- package/registry/examples/marketing-layout/docs-hub.js +37 -0
- package/registry/examples/marketing-layout/docs-hub.tsx +44 -0
- package/registry/examples/marketing-layout/pricing.d.ts +4 -0
- package/registry/examples/marketing-layout/pricing.js +45 -0
- package/registry/examples/marketing-layout/pricing.tsx +55 -0
- package/registry/examples/marketing-layout/product-page.d.ts +4 -0
- package/registry/examples/marketing-layout/product-page.js +79 -0
- package/registry/examples/marketing-layout/product-page.tsx +83 -0
- package/registry/examples/mascot-state/empty.d.ts +4 -0
- package/registry/examples/mascot-state/empty.js +22 -0
- package/registry/examples/mascot-state/empty.tsx +20 -0
- package/registry/examples/mascot-state/error.d.ts +4 -0
- package/registry/examples/mascot-state/error.js +23 -0
- package/registry/examples/mascot-state/error.tsx +21 -0
- package/registry/examples/mascot-state/loading.d.ts +4 -0
- package/registry/examples/mascot-state/loading.js +22 -0
- package/registry/examples/mascot-state/loading.tsx +16 -0
- package/registry/examples/mascot-state/native/default.d.ts +4 -0
- package/registry/examples/mascot-state/native/default.dark.png +0 -0
- package/registry/examples/mascot-state/native/default.js +25 -0
- package/registry/examples/mascot-state/native/default.light.png +0 -0
- package/registry/examples/mascot-state/native/default.tsx +19 -0
- package/registry/examples/mascot-state/success.d.ts +4 -0
- package/registry/examples/mascot-state/success.js +21 -0
- package/registry/examples/mascot-state/success.tsx +19 -0
- package/registry/examples/mascot-state/welcome.d.ts +4 -0
- package/registry/examples/mascot-state/welcome.js +21 -0
- package/registry/examples/mascot-state/welcome.tsx +19 -0
- package/registry/examples/mascots/flock.tsx +1 -1
- package/registry/examples/mascots/lovebird.d.ts +4 -0
- package/registry/examples/mascots/lovebird.js +19 -0
- package/registry/examples/mascots/lovebird.tsx +18 -0
- package/registry/examples/mascots/native/lovebird.d.ts +4 -0
- package/registry/examples/mascots/native/lovebird.dark.png +0 -0
- package/registry/examples/mascots/native/lovebird.js +21 -0
- package/registry/examples/mascots/native/lovebird.light.png +0 -0
- package/registry/examples/mascots/native/lovebird.tsx +18 -0
- package/registry/examples/mascots/native/phoenix.d.ts +4 -0
- package/registry/examples/mascots/native/phoenix.dark.png +0 -0
- package/registry/examples/mascots/native/phoenix.js +21 -0
- package/registry/examples/mascots/native/phoenix.light.png +0 -0
- package/registry/examples/mascots/native/phoenix.tsx +18 -0
- package/registry/examples/mascots/phoenix.d.ts +4 -0
- package/registry/examples/mascots/phoenix.js +14 -0
- package/registry/examples/mascots/phoenix.tsx +11 -0
- package/registry/examples/profile-card/arcade.d.ts +4 -0
- package/registry/examples/profile-card/arcade.js +25 -0
- package/registry/examples/profile-card/arcade.tsx +19 -0
- package/registry/examples/profile-card/creator.d.ts +4 -0
- package/registry/examples/profile-card/creator.js +31 -0
- package/registry/examples/profile-card/creator.tsx +26 -0
- package/registry/examples/profile-card/match.d.ts +4 -0
- package/registry/examples/profile-card/match.js +25 -0
- package/registry/examples/profile-card/match.tsx +19 -0
- package/registry/examples/profile-card/native/default.d.ts +4 -0
- package/registry/examples/profile-card/native/default.dark.png +0 -0
- package/registry/examples/profile-card/native/default.js +27 -0
- package/registry/examples/profile-card/native/default.light.png +0 -0
- package/registry/examples/profile-card/native/default.tsx +22 -0
- package/registry/examples/promise-card/arcade.d.ts +4 -0
- package/registry/examples/promise-card/arcade.js +25 -0
- package/registry/examples/promise-card/arcade.tsx +19 -0
- package/registry/examples/promise-card/guarantee.d.ts +4 -0
- package/registry/examples/promise-card/guarantee.js +23 -0
- package/registry/examples/promise-card/guarantee.tsx +17 -0
- package/registry/examples/scroll-stage/arcade.d.ts +4 -0
- package/registry/examples/scroll-stage/arcade.js +16 -0
- package/registry/examples/scroll-stage/arcade.tsx +15 -0
- package/registry/examples/scroll-stage/chapters.d.ts +4 -0
- package/registry/examples/scroll-stage/chapters.js +25 -0
- package/registry/examples/scroll-stage/chapters.tsx +22 -0
- package/registry/examples/settings-layout/account.d.ts +4 -0
- package/registry/examples/settings-layout/account.js +51 -0
- package/registry/examples/settings-layout/account.tsx +50 -0
- package/registry/examples/settings-layout/sections.d.ts +4 -0
- package/registry/examples/settings-layout/sections.js +27 -0
- package/registry/examples/settings-layout/sections.tsx +24 -0
- package/registry/examples/split-view/empty.d.ts +4 -0
- package/registry/examples/split-view/empty.js +19 -0
- package/registry/examples/split-view/empty.tsx +13 -0
- package/registry/examples/split-view/messages.d.ts +4 -0
- package/registry/examples/split-view/messages.js +49 -0
- package/registry/examples/split-view/messages.tsx +52 -0
- package/registry/examples/stage-banner/round.d.ts +4 -0
- package/registry/examples/stage-banner/round.js +14 -0
- package/registry/examples/stage-banner/round.tsx +11 -0
- package/registry/examples/stage-banner/steps.d.ts +4 -0
- package/registry/examples/stage-banner/steps.js +14 -0
- package/registry/examples/stage-banner/steps.tsx +11 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +322 -0
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +337 -5
- package/registry/iso.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/landscape.json +189 -0
- package/registry/link-card.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/marketing-layout.json +172 -0
- package/registry/marquee.json +1 -1
- package/registry/mascot-quote.json +6 -6
- package/registry/mascot-state.json +1249 -0
- package/registry/mascots.json +140 -23
- package/registry/media-capture.json +1 -1
- package/registry/meter.json +1 -1
- package/registry/nav-bar.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +3 -3
- package/registry/page.json +5 -5
- package/registry/pagination.json +1 -1
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/profile-card.json +501 -0
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +228 -0
- package/registry/radio-group.json +1 -1
- package/registry/scroll-stage.json +197 -0
- package/registry/search-field.json +1 -1
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/settings-layout.json +231 -0
- package/registry/skeleton.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +233 -0
- package/registry/stage-banner.json +221 -0
- package/registry/stat.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/terminal-replay.json +1 -1
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/video-player.json +1 -1
- package/registry/video-trimmer.json +1 -1
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dashboard-layout",
|
|
3
|
+
"type": "primitive",
|
|
4
|
+
"title": "Dashboard layout",
|
|
5
|
+
"summary": "A dashboard: the screen's heading with its actions and filters, then a responsive grid of widgets — one column on a phone, two from sm, four from xl — each a titled region that spans one to four columns.",
|
|
6
|
+
"description": "A dashboard: the screen's heading with its actions and filters, then a responsive grid of widgets — one column on a phone, two from sm, four from xl — each a titled region that spans one to four columns.",
|
|
7
|
+
"status": "beta",
|
|
8
|
+
"category": "layouts",
|
|
9
|
+
"platforms": "web",
|
|
10
|
+
"whenToUse": [
|
|
11
|
+
"The home of a signed-in product: figures, what is running, what needs attention.",
|
|
12
|
+
"A console's overview above its tables."
|
|
13
|
+
],
|
|
14
|
+
"whenNotToUse": [
|
|
15
|
+
{
|
|
16
|
+
"when": "For one object's page.",
|
|
17
|
+
"use": "detail-layout"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"when": "For a list to work through.",
|
|
21
|
+
"use": "split-view"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"bestPractices": [
|
|
25
|
+
"The most important figures first: on a phone they are read first.",
|
|
26
|
+
"One sentence under the title that says what changed (`Three sales since yesterday`).",
|
|
27
|
+
"Charts from @krizaka/charts and tables in `span={2}` or `full` widgets; a single figure in a one-column widget."
|
|
28
|
+
],
|
|
29
|
+
"accessibility": {
|
|
30
|
+
"keyboard": [],
|
|
31
|
+
"notes": [
|
|
32
|
+
"Each widget is a `section` named by its title.",
|
|
33
|
+
"The heading is the screen's `h1`, or an `h2` inside an AppShell (`headingAs`)."
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"related": [
|
|
37
|
+
"app-shell",
|
|
38
|
+
"stat",
|
|
39
|
+
"data-table"
|
|
40
|
+
],
|
|
41
|
+
"web": {
|
|
42
|
+
"entry": "@krizaka/ui/dashboard-layout",
|
|
43
|
+
"import": "import { DashboardLayout, Widget } from \"@krizaka/ui/dashboard-layout\";",
|
|
44
|
+
"props": [
|
|
45
|
+
{
|
|
46
|
+
"component": "DashboardLayout",
|
|
47
|
+
"description": "A dashboard screen: heading, actions, filters, then the grid of widgets.",
|
|
48
|
+
"props": [
|
|
49
|
+
{
|
|
50
|
+
"name": "title",
|
|
51
|
+
"type": "ReactNode",
|
|
52
|
+
"default": null,
|
|
53
|
+
"description": "The screen's title: `Good morning, Eric`.",
|
|
54
|
+
"required": true
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "actions",
|
|
58
|
+
"type": "ReactNode",
|
|
59
|
+
"default": null,
|
|
60
|
+
"description": "The screen's actions (a primary Button, a DropdownMenu).",
|
|
61
|
+
"required": false
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "description",
|
|
65
|
+
"type": "ReactNode",
|
|
66
|
+
"default": null,
|
|
67
|
+
"description": "One sentence under it.",
|
|
68
|
+
"required": false
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "eyebrow",
|
|
72
|
+
"type": "ReactNode",
|
|
73
|
+
"default": null,
|
|
74
|
+
"description": "A mono line above it (the workspace, the date).",
|
|
75
|
+
"required": false
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "headingAs",
|
|
79
|
+
"type": "\"h1\" | \"h2\"",
|
|
80
|
+
"default": "h1",
|
|
81
|
+
"description": "The heading's level: `h1` when the dashboard is the screen, `h2` inside an AppShell whose header holds the h1.",
|
|
82
|
+
"required": false
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "toolbar",
|
|
86
|
+
"type": "ReactNode",
|
|
87
|
+
"default": null,
|
|
88
|
+
"description": "Under the heading: the period, the filters (Segmented tabs, a DateRangePicker, a FilterBar).",
|
|
89
|
+
"required": false
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"component": "Widget",
|
|
95
|
+
"description": "A widget of the dashboard: a titled region on a card.",
|
|
96
|
+
"props": [
|
|
97
|
+
{
|
|
98
|
+
"name": "title",
|
|
99
|
+
"type": "ReactNode",
|
|
100
|
+
"default": null,
|
|
101
|
+
"description": "The widget's title: it names the region.",
|
|
102
|
+
"required": true
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "action",
|
|
106
|
+
"type": "ReactNode",
|
|
107
|
+
"default": null,
|
|
108
|
+
"description": "An action on the right of the title (`See all`).",
|
|
109
|
+
"required": false
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "description",
|
|
113
|
+
"type": "ReactNode",
|
|
114
|
+
"default": null,
|
|
115
|
+
"description": "One line under the title (the period, the source).",
|
|
116
|
+
"required": false
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "level",
|
|
120
|
+
"type": "2 | 3",
|
|
121
|
+
"default": "2",
|
|
122
|
+
"description": "The title's level: one under the dashboard's heading — `2` under an `h1`, `3` inside an AppShell (`headingAs=\"h2\"`).",
|
|
123
|
+
"required": false
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "span",
|
|
127
|
+
"type": "1 | 2 | 3 | \"full\"",
|
|
128
|
+
"default": "1",
|
|
129
|
+
"description": "The columns it takes: 1, 2, 3 or the full row (from `sm`; one column on a phone).",
|
|
130
|
+
"required": false
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"examples": [
|
|
136
|
+
{
|
|
137
|
+
"name": "orazaka-eric",
|
|
138
|
+
"title": "Orazaka · Eric's console",
|
|
139
|
+
"description": "An accountant's on-premise console: requests, latency, credits, running jobs and packs, the period in a chip group.",
|
|
140
|
+
"template": true,
|
|
141
|
+
"path": "examples/dashboard-layout/orazaka-eric.tsx",
|
|
142
|
+
"module": "@krizaka/ui/registry/examples/dashboard-layout/orazaka-eric",
|
|
143
|
+
"code": "import { Badge } from \"@krizaka/ui/badge\";\nimport { Button } from \"@krizaka/ui/button\";\nimport { Chip } from \"@krizaka/ui/chip\";\nimport { DashboardLayout, Widget } from \"@krizaka/ui/dashboard-layout\";\nimport { Meter } from \"@krizaka/ui/meter\";\nimport { Progress } from \"@krizaka/ui/progress\";\nimport { Stat } from \"@krizaka/ui/stat\";\n\nconst JOBS = [\n { name: \"Catalogue summaries\", studio: \"Writing studio\", value: 72, eta: \"about 2 min\" },\n { name: \"Product shots, autumn\", studio: \"Image studio\", value: 35, eta: \"about 6 min\" },\n];\nconst PACKS = [\n { name: \"Customer support\", runs: \"412 answers this week\" },\n { name: \"Law 25 review\", runs: \"38 documents checked\" },\n];\n\n// TEMPLATE — Orazaka's console, Eric's morning (an accountant who runs his firm's AI on its own server): what the\n// engine did, what is running now, the credits left, the packs at work. The period is a single-choice chip group above the grid;\n// on a phone everything stacks in reading order, the running jobs first after the figures.\nexport default function DashboardLayoutOrazakaEric() {\n return (\n <div className=\"brand-orazaka w-full\">\n <DashboardLayout\n eyebrow=\"Tremblay & associés · on-premise\"\n title=\"Good morning, Eric\"\n description=\"Nothing left your server this week: 1,284 requests, all answered locally.\"\n actions={\n <>\n <Button size=\"sm\" variant=\"secondary\" shape=\"cut\">Add a pack</Button>\n <Button size=\"sm\" variant=\"primary\" shape=\"cut\">New job</Button>\n </>\n }\n toolbar={\n <Chip.Group type=\"single\" label=\"Period\" defaultValue=\"7d\" required>\n <Chip value=\"today\">Today</Chip>\n <Chip value=\"7d\">7 days</Chip>\n <Chip value=\"30d\">30 days</Chip>\n </Chip.Group>\n }\n >\n <Widget title=\"Requests\">\n <Stat label=\"7 days\" value=\"1,284\" trend=\"up\" trendLabel=\"+6 %\" />\n </Widget>\n <Widget title=\"Answered locally\">\n <Stat label=\"No cloud call\" value=\"100 %\" hint=\"sovereign mode\" />\n </Widget>\n <Widget title=\"Median answer\">\n <Stat label=\"Chat\" value=\"1.8 s\" trend=\"down\" trendLabel=\"−0.3 s\" />\n </Widget>\n <Widget title=\"Credits\" description=\"Workspace plan\">\n <Meter label=\"Credits used\" value={3800} max={12000} valueText=\"3,800 of 12,000\" showLabel />\n </Widget>\n <Widget title=\"Running now\" span={2} action={<Badge tone=\"accent\" dot>2 jobs</Badge>}>\n <ul className=\"flex flex-col gap-4\">\n {JOBS.map((j) => (\n <li key={j.name} className=\"flex flex-col gap-1.5\">\n <span className=\"flex items-baseline justify-between gap-2 text-sm\">\n <span className=\"font-medium text-fg\">{j.name}</span>\n <span className=\"text-xs text-fg-secondary\">{j.studio}</span>\n </span>\n <Progress value={j.value} label={j.name} eta={j.eta} size=\"sm\" />\n </li>\n ))}\n </ul>\n </Widget>\n <Widget title=\"Packs at work\" span={2} action={<Button size=\"sm\" variant=\"ghost\">All packs</Button>}>\n <ul className=\"divide-y divide-border-subtle\">\n {PACKS.map((p) => (\n <li key={p.name} className=\"flex items-center justify-between gap-3 py-2.5 text-sm\">\n <span className=\"font-medium text-fg\">{p.name}</span>\n <span className=\"text-fg-secondary\">{p.runs}</span>\n </li>\n ))}\n </ul>\n </Widget>\n </DashboardLayout>\n </div>\n );\n}\n"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "widgets",
|
|
147
|
+
"title": "The grid",
|
|
148
|
+
"description": "Four widgets of different spans.",
|
|
149
|
+
"path": "examples/dashboard-layout/widgets.tsx",
|
|
150
|
+
"module": "@krizaka/ui/registry/examples/dashboard-layout/widgets",
|
|
151
|
+
"code": "import { DashboardLayout, Widget } from \"@krizaka/ui/dashboard-layout\";\nimport { Stat } from \"@krizaka/ui/stat\";\n\n// The grid: one column on a phone, two from `sm`, four from `xl`; `span` makes a widget wider (it keeps its order).\nexport default function DashboardLayoutWidgets() {\n return (\n <DashboardLayout className=\"w-full\" title=\"Overview\" description=\"The last 7 days.\">\n <Widget title=\"Requests\">\n <Stat label=\"Today\" value=\"1,284\" trend=\"up\" trendLabel=\"+6 %\" />\n </Widget>\n <Widget title=\"Credits left\">\n <Stat label=\"Workspace\" value=\"8,200\" />\n </Widget>\n <Widget title=\"Usage\" span={2}>\n <p className=\"text-sm text-fg-secondary\">A chart of @krizaka/charts goes here.</p>\n </Widget>\n <Widget title=\"Recent jobs\" span=\"full\">\n <p className=\"text-sm text-fg-secondary\">A DataTable goes here.</p>\n </Widget>\n </DashboardLayout>\n );\n}\n"
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
"native": null,
|
|
156
|
+
"files": [
|
|
157
|
+
{
|
|
158
|
+
"path": "dashboard-layout/dashboard-layout.tsx",
|
|
159
|
+
"content": "// Server-safe. A dashboard, read from the products' home screens (Orochia's creator studio, Orazaka's console for\n// Eric): the screen's heading with its actions and filters, then a responsive grid of widgets — one column on a phone,\n// two from `sm`, four from `xl`; a widget spans 1, 2, 3 columns or the full row, and keeps its order everywhere.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nexport const dashboardLayout = tv({\n slots: {\n root: \"flex w-full flex-col gap-6\",\n head: \"flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between\",\n text: \"flex min-w-0 flex-col gap-1\",\n eyebrow: \"font-mono text-[11px] font-semibold uppercase tracking-[0.16em] text-fg-accent\",\n title: \"font-display text-2xl font-extrabold tracking-tight text-fg sm:text-[1.75rem]\",\n description: \"max-w-2xl text-sm text-fg-secondary\",\n actions: \"flex shrink-0 flex-wrap items-center gap-2\",\n toolbar: \"flex flex-wrap items-center gap-2\",\n grid: \"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-4\",\n widget: \"flex min-w-0 flex-col gap-3 rounded-xl border border-border-default bg-surface-1 p-4 sm:p-5\",\n widgetHead: \"flex items-start justify-between gap-3\",\n widgetTitle: \"text-sm font-semibold text-fg\",\n widgetDescription: \"mt-0.5 text-xs text-fg-secondary\",\n widgetBody: \"min-w-0 flex-1\",\n },\n variants: {\n span: {\n 1: { widget: \"\" },\n 2: { widget: \"sm:col-span-2\" },\n 3: { widget: \"sm:col-span-2 xl:col-span-3\" },\n full: { widget: \"sm:col-span-2 xl:col-span-4\" },\n },\n },\n defaultVariants: { span: 1 },\n});\nconst s = dashboardLayout();\n\nexport type DashboardLayoutProps = Omit<React.ComponentProps<\"div\">, \"title\"> & {\n /** The screen's title: `Good morning, Eric`. */\n title: React.ReactNode;\n /** A mono line above it (the workspace, the date). */\n eyebrow?: React.ReactNode;\n /** One sentence under it. */\n description?: React.ReactNode;\n /** The screen's actions (a primary Button, a DropdownMenu). */\n actions?: React.ReactNode;\n /** Under the heading: the period, the filters (Segmented tabs, a DateRangePicker, a FilterBar). */\n toolbar?: React.ReactNode;\n /**\n * The heading's level: `h1` when the dashboard is the screen, `h2` inside an AppShell whose header holds the h1.\n * @default \"h1\"\n */\n headingAs?: \"h1\" | \"h2\";\n /** The widgets (`Widget`), in reading order. */\n children: React.ReactNode;\n};\n\n/** A dashboard screen: heading, actions, filters, then the grid of widgets. */\nexport function DashboardLayout({ title, eyebrow, description, actions, toolbar, headingAs: H = \"h1\", className, children, ...props }: DashboardLayoutProps) {\n return (\n <div className={s.root({ className })} {...props}>\n <div className={s.head()}>\n <div className={s.text()}>\n {eyebrow && <p className={s.eyebrow()}>{eyebrow}</p>}\n <H className={s.title()}>{title}</H>\n {description && <p className={s.description()}>{description}</p>}\n </div>\n {actions && <div className={s.actions()}>{actions}</div>}\n </div>\n {toolbar && <div className={s.toolbar()}>{toolbar}</div>}\n <div className={s.grid()}>{children}</div>\n </div>\n );\n}\n\nexport type WidgetProps = Omit<React.ComponentProps<\"section\">, \"title\"> & {\n /** The widget's title: it names the region. */\n title: React.ReactNode;\n /** One line under the title (the period, the source). */\n description?: React.ReactNode;\n /** An action on the right of the title (`See all`). */\n action?: React.ReactNode;\n /**\n * The columns it takes: 1, 2, 3 or the full row (from `sm`; one column on a phone).\n * @default 1\n */\n span?: 1 | 2 | 3 | \"full\";\n /**\n * The title's level: one under the dashboard's heading — `2` under an `h1`, `3` inside an AppShell (`headingAs=\"h2\"`).\n * @default 2\n */\n level?: 2 | 3;\n /** The content: a Stat, a chart of @krizaka/charts, a DataTable, a list. */\n children: React.ReactNode;\n};\n\n/** A widget of the dashboard: a titled region on a card. */\nexport function Widget({ title, description, action, span = 1, level = 2, className, children, id, ...props }: WidgetProps) {\n const H = level === 2 ? \"h2\" : \"h3\";\n const sv = dashboardLayout({ span });\n const auto = React.useId();\n const titleId = `${id ?? auto}-title`;\n return (\n <section className={sv.widget({ className })} aria-labelledby={titleId} id={id} {...props}>\n <div className={s.widgetHead()}>\n <div className=\"min-w-0\">\n <H id={titleId} className={s.widgetTitle()}>\n {title}\n </H>\n {description && <p className={s.widgetDescription()}>{description}</p>}\n </div>\n {action}\n </div>\n <div className={s.widgetBody()}>{children}</div>\n </section>\n );\n}\n"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"path": "dashboard-layout/index.ts",
|
|
163
|
+
"content": "/** @krizaka/ui/dashboard-layout — `DashboardLayout` and `Widget`: a heading, filters and a responsive grid of widgets. Server-safe. */\nexport { DashboardLayout, dashboardLayout, type DashboardLayoutProps, Widget, type WidgetProps } from \"./dashboard-layout\";\n"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"path": "dashboard-layout/meta.ts",
|
|
167
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Dashboard layout\",\n summary: \"A dashboard: the screen's heading with its actions and filters, then a responsive grid of widgets — one column on a phone, two from sm, four from xl — each a titled region that spans one to four columns.\",\n status: \"beta\",\n category: \"layouts\",\n platforms: \"web\",\n whenToUse: [\"The home of a signed-in product: figures, what is running, what needs attention.\", \"A console's overview above its tables.\"],\n whenNotToUse: [\n { when: \"For one object's page.\", use: \"detail-layout\" },\n { when: \"For a list to work through.\", use: \"split-view\" },\n ],\n bestPractices: [\"The most important figures first: on a phone they are read first.\", \"One sentence under the title that says what changed (`Three sales since yesterday`).\", \"Charts from @krizaka/charts and tables in `span={2}` or `full` widgets; a single figure in a one-column widget.\"],\n accessibility: {\n keyboard: [],\n notes: [\"Each widget is a `section` named by its title.\", \"The heading is the screen's `h1`, or an `h2` inside an AppShell (`headingAs`).\"],\n },\n related: [\"app-shell\", \"stat\", \"data-table\"],\n web: {\n imports: [\"DashboardLayout\", \"Widget\"],\n examples: [\n { name: \"orazaka-eric\", title: \"Orazaka · Eric's console\", description: \"An accountant's on-premise console: requests, latency, credits, running jobs and packs, the period in a chip group.\", template: true },\n { name: \"widgets\", title: \"The grid\", description: \"Four widgets of different spans.\" },\n ],\n },\n} satisfies ComponentMeta;\n"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"path": "meta.ts",
|
|
171
|
+
"content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which krizaka.com renders as\n// /docs/ui/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"achievement\"\n | \"action-bar\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-layout\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"landscape\"\n | \"link-card\"\n | \"loader\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"radio-group\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its templates.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"layout\" | \"foundations\";\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\nexport interface Example {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its phone\n * version thought out), copied as a starting point — at most 160 lines, listed on krizaka.com/docs/ui/templates.\n */\n readonly template?: boolean;\n}\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"dependencies": [
|
|
175
|
+
"tailwind-variants@^3.3.1"
|
|
176
|
+
],
|
|
177
|
+
"registryDependencies": [],
|
|
178
|
+
"demo": {
|
|
179
|
+
"path": "examples/dashboard-layout/orazaka-eric.tsx",
|
|
180
|
+
"content": "import { Badge } from \"@krizaka/ui/badge\";\nimport { Button } from \"@krizaka/ui/button\";\nimport { Chip } from \"@krizaka/ui/chip\";\nimport { DashboardLayout, Widget } from \"@krizaka/ui/dashboard-layout\";\nimport { Meter } from \"@krizaka/ui/meter\";\nimport { Progress } from \"@krizaka/ui/progress\";\nimport { Stat } from \"@krizaka/ui/stat\";\n\nconst JOBS = [\n { name: \"Catalogue summaries\", studio: \"Writing studio\", value: 72, eta: \"about 2 min\" },\n { name: \"Product shots, autumn\", studio: \"Image studio\", value: 35, eta: \"about 6 min\" },\n];\nconst PACKS = [\n { name: \"Customer support\", runs: \"412 answers this week\" },\n { name: \"Law 25 review\", runs: \"38 documents checked\" },\n];\n\n// TEMPLATE — Orazaka's console, Eric's morning (an accountant who runs his firm's AI on its own server): what the\n// engine did, what is running now, the credits left, the packs at work. The period is a single-choice chip group above the grid;\n// on a phone everything stacks in reading order, the running jobs first after the figures.\nexport default function DashboardLayoutOrazakaEric() {\n return (\n <div className=\"brand-orazaka w-full\">\n <DashboardLayout\n eyebrow=\"Tremblay & associés · on-premise\"\n title=\"Good morning, Eric\"\n description=\"Nothing left your server this week: 1,284 requests, all answered locally.\"\n actions={\n <>\n <Button size=\"sm\" variant=\"secondary\" shape=\"cut\">Add a pack</Button>\n <Button size=\"sm\" variant=\"primary\" shape=\"cut\">New job</Button>\n </>\n }\n toolbar={\n <Chip.Group type=\"single\" label=\"Period\" defaultValue=\"7d\" required>\n <Chip value=\"today\">Today</Chip>\n <Chip value=\"7d\">7 days</Chip>\n <Chip value=\"30d\">30 days</Chip>\n </Chip.Group>\n }\n >\n <Widget title=\"Requests\">\n <Stat label=\"7 days\" value=\"1,284\" trend=\"up\" trendLabel=\"+6 %\" />\n </Widget>\n <Widget title=\"Answered locally\">\n <Stat label=\"No cloud call\" value=\"100 %\" hint=\"sovereign mode\" />\n </Widget>\n <Widget title=\"Median answer\">\n <Stat label=\"Chat\" value=\"1.8 s\" trend=\"down\" trendLabel=\"−0.3 s\" />\n </Widget>\n <Widget title=\"Credits\" description=\"Workspace plan\">\n <Meter label=\"Credits used\" value={3800} max={12000} valueText=\"3,800 of 12,000\" showLabel />\n </Widget>\n <Widget title=\"Running now\" span={2} action={<Badge tone=\"accent\" dot>2 jobs</Badge>}>\n <ul className=\"flex flex-col gap-4\">\n {JOBS.map((j) => (\n <li key={j.name} className=\"flex flex-col gap-1.5\">\n <span className=\"flex items-baseline justify-between gap-2 text-sm\">\n <span className=\"font-medium text-fg\">{j.name}</span>\n <span className=\"text-xs text-fg-secondary\">{j.studio}</span>\n </span>\n <Progress value={j.value} label={j.name} eta={j.eta} size=\"sm\" />\n </li>\n ))}\n </ul>\n </Widget>\n <Widget title=\"Packs at work\" span={2} action={<Button size=\"sm\" variant=\"ghost\">All packs</Button>}>\n <ul className=\"divide-y divide-border-subtle\">\n {PACKS.map((p) => (\n <li key={p.name} className=\"flex items-center justify-between gap-3 py-2.5 text-sm\">\n <span className=\"font-medium text-fg\">{p.name}</span>\n <span className=\"text-fg-secondary\">{p.runs}</span>\n </li>\n ))}\n </ul>\n </Widget>\n </DashboardLayout>\n </div>\n );\n}\n"
|
|
181
|
+
},
|
|
182
|
+
"props": [
|
|
183
|
+
{
|
|
184
|
+
"component": "DashboardLayout",
|
|
185
|
+
"description": "A dashboard screen: heading, actions, filters, then the grid of widgets.",
|
|
186
|
+
"props": [
|
|
187
|
+
{
|
|
188
|
+
"name": "title",
|
|
189
|
+
"type": "ReactNode",
|
|
190
|
+
"default": null,
|
|
191
|
+
"description": "The screen's title: `Good morning, Eric`.",
|
|
192
|
+
"required": true
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"name": "actions",
|
|
196
|
+
"type": "ReactNode",
|
|
197
|
+
"default": null,
|
|
198
|
+
"description": "The screen's actions (a primary Button, a DropdownMenu).",
|
|
199
|
+
"required": false
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"name": "description",
|
|
203
|
+
"type": "ReactNode",
|
|
204
|
+
"default": null,
|
|
205
|
+
"description": "One sentence under it.",
|
|
206
|
+
"required": false
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"name": "eyebrow",
|
|
210
|
+
"type": "ReactNode",
|
|
211
|
+
"default": null,
|
|
212
|
+
"description": "A mono line above it (the workspace, the date).",
|
|
213
|
+
"required": false
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"name": "headingAs",
|
|
217
|
+
"type": "\"h1\" | \"h2\"",
|
|
218
|
+
"default": "h1",
|
|
219
|
+
"description": "The heading's level: `h1` when the dashboard is the screen, `h2` inside an AppShell whose header holds the h1.",
|
|
220
|
+
"required": false
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"name": "toolbar",
|
|
224
|
+
"type": "ReactNode",
|
|
225
|
+
"default": null,
|
|
226
|
+
"description": "Under the heading: the period, the filters (Segmented tabs, a DateRangePicker, a FilterBar).",
|
|
227
|
+
"required": false
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"component": "Widget",
|
|
233
|
+
"description": "A widget of the dashboard: a titled region on a card.",
|
|
234
|
+
"props": [
|
|
235
|
+
{
|
|
236
|
+
"name": "title",
|
|
237
|
+
"type": "ReactNode",
|
|
238
|
+
"default": null,
|
|
239
|
+
"description": "The widget's title: it names the region.",
|
|
240
|
+
"required": true
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"name": "action",
|
|
244
|
+
"type": "ReactNode",
|
|
245
|
+
"default": null,
|
|
246
|
+
"description": "An action on the right of the title (`See all`).",
|
|
247
|
+
"required": false
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"name": "description",
|
|
251
|
+
"type": "ReactNode",
|
|
252
|
+
"default": null,
|
|
253
|
+
"description": "One line under the title (the period, the source).",
|
|
254
|
+
"required": false
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"name": "level",
|
|
258
|
+
"type": "2 | 3",
|
|
259
|
+
"default": "2",
|
|
260
|
+
"description": "The title's level: one under the dashboard's heading — `2` under an `h1`, `3` inside an AppShell (`headingAs=\"h2\"`).",
|
|
261
|
+
"required": false
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"name": "span",
|
|
265
|
+
"type": "1 | 2 | 3 | \"full\"",
|
|
266
|
+
"default": "1",
|
|
267
|
+
"description": "The columns it takes: 1, 2, 3 or the full row (from `sm`; one column on a phone).",
|
|
268
|
+
"required": false
|
|
269
|
+
}
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
]
|
|
273
|
+
}
|
package/registry/data-table.json
CHANGED
|
@@ -308,7 +308,7 @@
|
|
|
308
308
|
},
|
|
309
309
|
{
|
|
310
310
|
"path": "meta.ts",
|
|
311
|
-
"content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which krizaka.com renders as\n// /docs/ui/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"action-bar\"\n | \"alert\"\n | \"argument-card\"\n | \"audio-player\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"cta-panel\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"link-card\"\n | \"loader\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layout\" | \"foundations\";\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\nexport interface Example {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
|
|
311
|
+
"content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which krizaka.com renders as\n// /docs/ui/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"achievement\"\n | \"action-bar\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-layout\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"landscape\"\n | \"link-card\"\n | \"loader\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"radio-group\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its templates.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"layout\" | \"foundations\";\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\nexport interface Example {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its phone\n * version thought out), copied as a starting point — at most 160 lines, listed on krizaka.com/docs/ui/templates.\n */\n readonly template?: boolean;\n}\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
|
|
312
312
|
}
|
|
313
313
|
],
|
|
314
314
|
"dependencies": [
|
|
@@ -549,7 +549,7 @@
|
|
|
549
549
|
},
|
|
550
550
|
{
|
|
551
551
|
"path": "meta.ts",
|
|
552
|
-
"content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which krizaka.com renders as\n// /docs/ui/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"action-bar\"\n | \"alert\"\n | \"argument-card\"\n | \"audio-player\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"cta-panel\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"link-card\"\n | \"loader\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layout\" | \"foundations\";\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\nexport interface Example {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
|
|
552
|
+
"content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which krizaka.com renders as\n// /docs/ui/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"achievement\"\n | \"action-bar\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-layout\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"landscape\"\n | \"link-card\"\n | \"loader\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"radio-group\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its templates.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"layout\" | \"foundations\";\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\nexport interface Example {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its phone\n * version thought out), copied as a starting point — at most 160 lines, listed on krizaka.com/docs/ui/templates.\n */\n readonly template?: boolean;\n}\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
|
|
553
553
|
}
|
|
554
554
|
],
|
|
555
555
|
"dependencies": [
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
},
|
|
102
102
|
{
|
|
103
103
|
"path": "meta.ts",
|
|
104
|
-
"content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which krizaka.com renders as\n// /docs/ui/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"action-bar\"\n | \"alert\"\n | \"argument-card\"\n | \"audio-player\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"countdown\"\n | \"cta-panel\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"dialog\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"link-card\"\n | \"loader\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"progress\"\n | \"radio-group\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"stat\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layout\" | \"foundations\";\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\nexport interface Example {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n}\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
|
|
104
|
+
"content": "// The documentation of a component, carried by its code: each primitive has a `meta.ts` beside its source\n// (`src/<name>/meta.ts`; a component that exists only in React Native: `src/native/meta/<name>.ts`). Never built into\n// the package: `scripts/build-registry.mjs` reads them into `registry/<name>.json`, which krizaka.com renders as\n// /docs/ui/<name>, and `scripts/registry.test.mjs` fails when one is missing or incomplete.\n//\n// Why a typed module and not JSDoc tags: the fields are lists and links (`related`, `whenNotToUse[].use`, examples),\n// which a type checks and a comment does not; the file is plain data (erasable TypeScript), so Node reads it without a\n// compiler, and an editor completes it.\n\n/** Every documented component: the web primitives (one entry of the package each) and the native-only ones. */\nexport type ComponentName =\n | \"achievement\"\n | \"action-bar\"\n | \"alert\"\n | \"app-shell\"\n | \"argument-card\"\n | \"audio-player\"\n | \"auth-layout\"\n | \"avatar\"\n | \"badge\"\n | \"button\"\n | \"card\"\n | \"card-grid\"\n | \"checkbox\"\n | \"chip\"\n | \"chip-link\"\n | \"choice-grid\"\n | \"cn\"\n | \"code-block\"\n | \"combobox\"\n | \"command\"\n | \"confirm-button\"\n | \"continue-prompt\"\n | \"countdown\"\n | \"cta-panel\"\n | \"dashboard-layout\"\n | \"data-table\"\n | \"date-picker\"\n | \"decision-list\"\n | \"detail-layout\"\n | \"dialog\"\n | \"docs-layout\"\n | \"dropdown-menu\"\n | \"empty-state\"\n | \"field\"\n | \"file-upload\"\n | \"filter-bar\"\n | \"glow-card\"\n | \"goal-gauge\"\n | \"image-cropper\"\n | \"iso\"\n | \"kbd\"\n | \"landscape\"\n | \"link-card\"\n | \"loader\"\n | \"marketing-layout\"\n | \"marquee\"\n | \"mascot-quote\"\n | \"mascot-state\"\n | \"mascots\"\n | \"media-capture\"\n | \"meter\"\n | \"nav-bar\"\n | \"number-ticker\"\n | \"page\"\n | \"page-header\"\n | \"page-hero\"\n | \"pagination\"\n | \"pointer-light\"\n | \"popover\"\n | \"profile-card\"\n | \"progress\"\n | \"promise-card\"\n | \"radio-group\"\n | \"scroll-stage\"\n | \"search-field\"\n | \"section-backdrop\"\n | \"segmented\"\n | \"separator\"\n | \"settings-layout\"\n | \"skeleton\"\n | \"slider\"\n | \"slot\"\n | \"spinner\"\n | \"split-view\"\n | \"stage-banner\"\n | \"stat\"\n | \"stepper\"\n | \"switch\"\n | \"tabs\"\n | \"tag-input\"\n | \"terminal-replay\"\n | \"theme\"\n | \"toast\"\n | \"toc\"\n | \"tooltip\"\n | \"txt\"\n | \"video-player\"\n | \"video-trimmer\";\n\n/** Where a component exists: `@krizaka/ui/<name>` (web), `@krizaka/ui/native` (React Native), or both. */\nexport type Platform = \"web\" | \"native\" | \"both\";\n\n/** `stable`: its API only changes in a major. `beta`: it may still change in a minor. */\nexport type Status = \"stable\" | \"beta\";\n\n/**\n * The group of the catalogue. `media`: video, sound, camera, files, cropping. `blocks`: the page blocks — the frame,\n * the hero, sections, cards that lead or argue, decisions, code, calls to act — that every page of a site is made of.\n * `layouts`: the shells of whole screens — an application, a dashboard, settings, sign-in, an object, a list and its\n * item, a site's page, a documentation page — each with its templates.\n */\nexport type Category = \"actions\" | \"forms\" | \"navigation\" | \"overlays\" | \"feedback\" | \"data-display\" | \"media\" | \"blocks\" | \"layouts\" | \"layout\" | \"foundations\";\n\n/**\n * A named example: the file `registry/examples/<component>/<name>.tsx` (web) or\n * `registry/examples/<component>/native/<name>.tsx` (React Native) — at most 40 lines, imported by the stories and\n * shown (live, with its code) by the documentation.\n */\nexport interface Example {\n /** The file name, kebab-case (`primary`, `icon-button`). */\n readonly name: string;\n /** A short title (`Primary`, `Icon button`). */\n readonly title: string;\n /** One or two sentences: when this variant is the right one. */\n readonly description: string;\n /**\n * A template: a whole screen of a product composed from the platform (a layout and its blocks, real words, its phone\n * version thought out), copied as a starting point — at most 160 lines, listed on krizaka.com/docs/ui/templates.\n */\n readonly template?: boolean;\n}\n\n/** One platform's side of a component. */\nexport interface PlatformDocs {\n /** The names to import (`[\"Button\", \"IconButton\"]`): from `@krizaka/ui/<name>` on the web, `@krizaka/ui/native` in React Native. */\n readonly imports: readonly string[];\n /** The examples, in reading order; the first one is the component's preview. */\n readonly examples: readonly Example[];\n}\n\n/** The React Native side: the same concept, and what differs from the web API. */\nexport interface NativeDocs extends PlatformDocs {\n /**\n * The entry to import from when it is not `@krizaka/ui/native`: a component that needs an Expo module (an optional\n * peer) has its own, `@krizaka/ui/native/<name>`, so an app that does not use it never installs the module.\n */\n readonly entry?: string;\n /** What differs from the web API (`label` instead of children…); empty for a native-only component. */\n readonly differences: readonly string[];\n}\n\nexport interface KeyboardInteraction {\n /** The keys, as written on a keyboard: `Space`, `Enter`, `Arrow keys`, `Esc`, `Tab`. */\n readonly keys: string;\n /** What they do. */\n readonly action: string;\n}\n\nexport interface ComponentMeta {\n /** The display name: `Button`, `Dropdown menu`. */\n readonly title: string;\n /** One sentence: what it is. */\n readonly summary: string;\n readonly status: Status;\n readonly category: Category;\n /** Must match the sides below: `both` ⇔ `web` and `native`. */\n readonly platforms: Platform;\n /** When to reach for it: concrete situations, one per item. */\n readonly whenToUse: readonly string[];\n /** When not to — and what to use instead (`use`), when another component is the answer. */\n readonly whenNotToUse: readonly { readonly when: string; readonly use?: ComponentName }[];\n /** How to use it well: wording, placement, composition. */\n readonly bestPractices: readonly string[];\n readonly accessibility: {\n /** The keyboard, when it does more than Tab and Enter. */\n readonly keyboard: readonly KeyboardInteraction[];\n /** Roles, names and announcements: what the component does, what the app must provide. */\n readonly notes: readonly string[];\n };\n /** The components a reader of this page should know about. */\n readonly related: readonly ComponentName[];\n readonly web?: PlatformDocs;\n readonly native?: NativeDocs;\n}\n"
|
|
105
105
|
}
|
|
106
106
|
],
|
|
107
107
|
"dependencies": [],
|