@nanisoft/prism-ui 0.10.2 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/dist/.tsbuildinfo +1 -1
- package/dist/blocks/app-shell-01/app-shell.js +4 -4
- package/dist/blocks/app-shell-01/index.d.ts +2 -2
- package/dist/blocks/app-shell-01/index.js +1 -1
- package/dist/blocks/auth-form-01/auth-form.d.ts +11 -1
- package/dist/blocks/auth-form-01/auth-form.d.ts.map +1 -1
- package/dist/blocks/auth-form-01/auth-form.js +11 -8
- package/dist/blocks/auth-form-01/index.d.ts +2 -2
- package/dist/blocks/auth-form-01/index.js +1 -1
- package/dist/blocks/cta-01/cta.d.ts +26 -21
- package/dist/blocks/cta-01/cta.d.ts.map +1 -1
- package/dist/blocks/cta-01/cta.js +2 -2
- package/dist/blocks/cta-01/index.d.ts +2 -2
- package/dist/blocks/cta-01/index.js +1 -1
- package/dist/blocks/data-table-01/data-table.js +7 -7
- package/dist/blocks/data-table-01/index.d.ts +2 -2
- package/dist/blocks/data-table-01/index.js +1 -1
- package/dist/blocks/empty-state-01/empty-state.d.ts +143 -0
- package/dist/blocks/empty-state-01/empty-state.d.ts.map +1 -0
- package/dist/blocks/empty-state-01/empty-state.js +104 -0
- package/dist/blocks/empty-state-01/index.d.ts +3 -0
- package/dist/blocks/empty-state-01/index.d.ts.map +1 -0
- package/dist/blocks/empty-state-01/index.js +1 -0
- package/dist/blocks/feature-grid-01/feature-grid.d.ts +28 -1
- package/dist/blocks/feature-grid-01/feature-grid.d.ts.map +1 -1
- package/dist/blocks/feature-grid-01/feature-grid.js +34 -3
- package/dist/blocks/feature-grid-01/index.d.ts +2 -2
- package/dist/blocks/feature-grid-01/index.js +1 -1
- package/dist/blocks/hero-01/hero.d.ts +35 -15
- package/dist/blocks/hero-01/hero.d.ts.map +1 -1
- package/dist/blocks/hero-01/hero.js +14 -9
- package/dist/blocks/hero-01/index.d.ts +2 -1
- package/dist/blocks/hero-01/index.d.ts.map +1 -1
- package/dist/blocks/hero-01/index.js +1 -1
- package/dist/blocks/index.d.ts +20 -20
- package/dist/blocks/index.js +19 -19
- package/dist/blocks/instrument-panel-01/index.d.ts +2 -2
- package/dist/blocks/instrument-panel-01/index.js +1 -1
- package/dist/blocks/instrument-panel-01/instrument-panel.js +1 -1
- package/dist/blocks/logo-strip-01/index.d.ts +2 -2
- package/dist/blocks/logo-strip-01/index.js +1 -1
- package/dist/blocks/logo-strip-01/logo-strip.d.ts +1 -1
- package/dist/blocks/logo-strip-01/logo-strip.js +2 -2
- package/dist/blocks/note-grid-01/index.d.ts +2 -2
- package/dist/blocks/note-grid-01/index.js +1 -1
- package/dist/blocks/note-grid-01/note-grid.d.ts +1 -1
- package/dist/blocks/note-grid-01/note-grid.js +1 -1
- package/dist/blocks/page-header-01/index.d.ts +2 -2
- package/dist/blocks/page-header-01/index.js +1 -1
- package/dist/blocks/page-header-01/page-header.d.ts +1 -1
- package/dist/blocks/page-header-01/page-header.js +4 -4
- package/dist/blocks/pricing-01/index.d.ts +1 -1
- package/dist/blocks/pricing-01/index.js +1 -1
- package/dist/blocks/pricing-01/pricing.d.ts +8 -1
- package/dist/blocks/pricing-01/pricing.d.ts.map +1 -1
- package/dist/blocks/pricing-01/pricing.js +15 -5
- package/dist/blocks/process-flow-01/index.d.ts +3 -0
- package/dist/blocks/process-flow-01/index.d.ts.map +1 -0
- package/dist/blocks/process-flow-01/index.js +1 -0
- package/dist/blocks/process-flow-01/process-flow.d.ts +118 -0
- package/dist/blocks/process-flow-01/process-flow.d.ts.map +1 -0
- package/dist/blocks/process-flow-01/process-flow.js +71 -0
- package/dist/blocks/process-rail-01/index.d.ts +2 -2
- package/dist/blocks/process-rail-01/index.js +1 -1
- package/dist/blocks/process-rail-01/process-rail.d.ts +1 -1
- package/dist/blocks/process-rail-01/process-rail.js +2 -2
- package/dist/blocks/product-grid-01/index.d.ts +2 -2
- package/dist/blocks/product-grid-01/index.js +1 -1
- package/dist/blocks/product-grid-01/product-grid.d.ts +37 -5
- package/dist/blocks/product-grid-01/product-grid.d.ts.map +1 -1
- package/dist/blocks/product-grid-01/product-grid.js +20 -6
- package/dist/blocks/run-console-01/index.d.ts +3 -0
- package/dist/blocks/run-console-01/index.d.ts.map +1 -0
- package/dist/blocks/run-console-01/index.js +1 -0
- package/dist/blocks/run-console-01/run-console.d.ts +111 -0
- package/dist/blocks/run-console-01/run-console.d.ts.map +1 -0
- package/dist/blocks/run-console-01/run-console.js +48 -0
- package/dist/blocks/settings-panel-01/index.d.ts +2 -2
- package/dist/blocks/settings-panel-01/index.js +1 -1
- package/dist/blocks/settings-panel-01/settings-panel.d.ts +11 -1
- package/dist/blocks/settings-panel-01/settings-panel.d.ts.map +1 -1
- package/dist/blocks/settings-panel-01/settings-panel.js +15 -10
- package/dist/blocks/site-footer/index.d.ts +2 -2
- package/dist/blocks/site-footer/index.js +1 -1
- package/dist/blocks/site-footer/site-footer.d.ts +1 -1
- package/dist/blocks/site-footer/site-footer.js +2 -2
- package/dist/blocks/site-header/index.d.ts +2 -2
- package/dist/blocks/site-header/index.js +1 -1
- package/dist/blocks/site-header/site-header.d.ts +2 -2
- package/dist/blocks/site-header/site-header.js +3 -3
- package/dist/blocks/site-navbar/index.d.ts +3 -0
- package/dist/blocks/site-navbar/index.d.ts.map +1 -0
- package/dist/blocks/site-navbar/index.js +1 -0
- package/dist/blocks/site-navbar/mobile-nav.d.ts +48 -0
- package/dist/blocks/site-navbar/mobile-nav.d.ts.map +1 -0
- package/dist/blocks/site-navbar/mobile-nav.js +35 -0
- package/dist/blocks/site-navbar/mode-toggle.d.ts +39 -0
- package/dist/blocks/site-navbar/mode-toggle.d.ts.map +1 -0
- package/dist/blocks/site-navbar/mode-toggle.js +39 -0
- package/dist/blocks/site-navbar/navbar-controls.d.ts +79 -0
- package/dist/blocks/site-navbar/navbar-controls.d.ts.map +1 -0
- package/dist/blocks/site-navbar/navbar-controls.js +40 -0
- package/dist/blocks/site-navbar/search-entry.d.ts +29 -0
- package/dist/blocks/site-navbar/search-entry.d.ts.map +1 -0
- package/dist/blocks/site-navbar/search-entry.js +52 -0
- package/dist/blocks/site-navbar/site-navbar.d.ts +212 -0
- package/dist/blocks/site-navbar/site-navbar.d.ts.map +1 -0
- package/dist/blocks/site-navbar/site-navbar.js +61 -0
- package/dist/blocks/site-navbar/sites-menu.d.ts +40 -0
- package/dist/blocks/site-navbar/sites-menu.d.ts.map +1 -0
- package/dist/blocks/site-navbar/sites-menu.js +48 -0
- package/dist/blocks/site-navbar/theme-menu.d.ts +47 -0
- package/dist/blocks/site-navbar/theme-menu.d.ts.map +1 -0
- package/dist/blocks/site-navbar/theme-menu.js +55 -0
- package/dist/blocks/stack-grid-01/index.d.ts +2 -2
- package/dist/blocks/stack-grid-01/index.js +1 -1
- package/dist/blocks/stack-grid-01/stack-grid.d.ts +42 -11
- package/dist/blocks/stack-grid-01/stack-grid.d.ts.map +1 -1
- package/dist/blocks/stack-grid-01/stack-grid.js +15 -7
- package/dist/blocks/stats-01/index.d.ts +9 -1
- package/dist/blocks/stats-01/index.d.ts.map +1 -1
- package/dist/blocks/stats-01/index.js +8 -1
- package/dist/blocks/stats-01/stats.d.ts +1 -1
- package/dist/blocks/stats-01/stats.js +2 -2
- package/dist/blocks/status-ledger-01/index.d.ts +2 -2
- package/dist/blocks/status-ledger-01/index.js +1 -1
- package/dist/blocks/status-ledger-01/status-ledger.d.ts +1 -1
- package/dist/blocks/status-ledger-01/status-ledger.js +2 -2
- package/dist/catalog.d.ts +1 -1
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +473 -1
- package/dist/components/index.d.ts +104 -66
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +74 -40
- package/dist/components/ui/accordion.js +1 -1
- package/dist/components/ui/alert-dialog.d.ts +119 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +82 -0
- package/dist/components/ui/alert.js +1 -1
- package/dist/components/ui/aspect-ratio.d.ts +60 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.js +61 -0
- package/dist/components/ui/avatar.js +1 -1
- package/dist/components/ui/badge.js +1 -1
- package/dist/components/ui/breadcrumb.js +1 -1
- package/dist/components/ui/button-group.d.ts +68 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button-group.js +54 -0
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/calendar.d.ts +158 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +216 -0
- package/dist/components/ui/card.d.ts +18 -6
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/card.js +23 -8
- package/dist/components/ui/carousel.d.ts +118 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +152 -0
- package/dist/components/ui/chart-frame.d.ts +216 -0
- package/dist/components/ui/chart-frame.d.ts.map +1 -0
- package/dist/components/ui/chart-frame.js +286 -0
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/collapsible.d.ts +97 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +54 -0
- package/dist/components/ui/combobox.d.ts +141 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox.js +243 -0
- package/dist/components/ui/command-palette.d.ts +106 -0
- package/dist/components/ui/command-palette.d.ts.map +1 -0
- package/dist/components/ui/command-palette.js +176 -0
- package/dist/components/ui/command.d.ts +82 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/command.js +37 -0
- package/dist/components/ui/context-menu.d.ts +151 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +97 -0
- package/dist/components/ui/cta-link.js +1 -1
- package/dist/components/ui/date-picker.d.ts +111 -0
- package/dist/components/ui/date-picker.d.ts.map +1 -0
- package/dist/components/ui/date-picker.js +74 -0
- package/dist/components/ui/diagram.d.ts +84 -15
- package/dist/components/ui/diagram.d.ts.map +1 -1
- package/dist/components/ui/diagram.js +77 -7
- package/dist/components/ui/dialog.js +1 -1
- package/dist/components/ui/diff.d.ts +105 -0
- package/dist/components/ui/diff.d.ts.map +1 -0
- package/dist/components/ui/diff.js +113 -0
- package/dist/components/ui/dropdown-menu.d.ts +18 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -1
- package/dist/components/ui/fact-list.js +1 -1
- package/dist/components/ui/field.js +1 -1
- package/dist/components/ui/form.d.ts +151 -0
- package/dist/components/ui/form.d.ts.map +1 -0
- package/dist/components/ui/form.js +73 -0
- package/dist/components/ui/hover-card.d.ts +105 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +49 -0
- package/dist/components/ui/input-group.d.ts +99 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group.js +83 -0
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/item.d.ts +113 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/item.js +61 -0
- package/dist/components/ui/kbd.js +1 -1
- package/dist/components/ui/label.d.ts +58 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +29 -0
- package/dist/components/ui/live-region.d.ts +9 -0
- package/dist/components/ui/live-region.d.ts.map +1 -1
- package/dist/components/ui/live-region.js +10 -2
- package/dist/components/ui/mark.js +1 -1
- package/dist/components/ui/menubar.d.ts +197 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/menubar.js +109 -0
- package/dist/components/ui/meter.d.ts +121 -0
- package/dist/components/ui/meter.d.ts.map +1 -0
- package/dist/components/ui/meter.js +82 -0
- package/dist/components/ui/native-select.d.ts +72 -0
- package/dist/components/ui/native-select.d.ts.map +1 -0
- package/dist/components/ui/native-select.js +55 -0
- package/dist/components/ui/navigation-menu.d.ts +186 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.js +94 -0
- package/dist/components/ui/number-field.d.ts +111 -0
- package/dist/components/ui/number-field.d.ts.map +1 -0
- package/dist/components/ui/number-field.js +84 -0
- package/dist/components/ui/one-time-code.d.ts +127 -0
- package/dist/components/ui/one-time-code.d.ts.map +1 -0
- package/dist/components/ui/one-time-code.js +57 -0
- package/dist/components/ui/pagination.js +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/product-mark.d.ts +1 -1
- package/dist/components/ui/product-mark.js +1 -1
- package/dist/components/ui/product-switcher.d.ts +1 -1
- package/dist/components/ui/product-switcher.js +2 -2
- package/dist/components/ui/progress.js +1 -1
- package/dist/components/ui/prose.js +1 -1
- package/dist/components/ui/pulse-graph.js +1 -1
- package/dist/components/ui/pulse-series.js +1 -1
- package/dist/components/ui/radio-group.js +1 -1
- package/dist/components/ui/resizable.d.ts +129 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/resizable.js +205 -0
- package/dist/components/ui/scroll-area.d.ts +97 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +68 -0
- package/dist/components/ui/search-dialog.d.ts +139 -0
- package/dist/components/ui/search-dialog.d.ts.map +1 -0
- package/dist/components/ui/search-dialog.js +178 -0
- package/dist/components/ui/section.d.ts +26 -0
- package/dist/components/ui/section.d.ts.map +1 -1
- package/dist/components/ui/section.js +32 -1
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/separator.js +1 -1
- package/dist/components/ui/sheet.d.ts +103 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +58 -0
- package/dist/components/ui/sidebar.d.ts +228 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +172 -0
- package/dist/components/ui/signal-field.js +1 -1
- package/dist/components/ui/skeleton.js +1 -1
- package/dist/components/ui/slider.js +1 -1
- package/dist/components/ui/spinner.d.ts +79 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +79 -0
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/table-sort.d.ts +97 -0
- package/dist/components/ui/table-sort.d.ts.map +1 -0
- package/dist/components/ui/table-sort.js +102 -0
- package/dist/components/ui/table.js +1 -1
- package/dist/components/ui/tabs.js +1 -1
- package/dist/components/ui/textarea.js +1 -1
- package/dist/components/ui/timeline.d.ts +106 -0
- package/dist/components/ui/timeline.d.ts.map +1 -0
- package/dist/components/ui/timeline.js +111 -0
- package/dist/components/ui/toast.d.ts +219 -0
- package/dist/components/ui/toast.d.ts.map +1 -0
- package/dist/components/ui/toast.js +270 -0
- package/dist/components/ui/toggle-group.d.ts +118 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +194 -0
- package/dist/components/ui/toggle.d.ts +73 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +44 -0
- package/dist/components/ui/tooltip.js +1 -1
- package/dist/components/ui/tree.js +1 -1
- package/dist/components/ui/typography.js +1 -1
- package/dist/fonts/Inter-OFL.txt +93 -93
- package/dist/index.d.ts +72 -70
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +61 -60
- package/dist/lib/rank.d.ts +69 -0
- package/dist/lib/rank.d.ts.map +1 -0
- package/dist/lib/rank.js +77 -0
- package/dist/live/index.d.ts +22 -0
- package/dist/live/index.d.ts.map +1 -0
- package/dist/live/index.js +20 -0
- package/dist/live/run-stream-01/index.d.ts +3 -0
- package/dist/live/run-stream-01/index.d.ts.map +1 -0
- package/dist/live/run-stream-01/index.js +1 -0
- package/dist/live/run-stream-01/run-stream.d.ts +125 -0
- package/dist/live/run-stream-01/run-stream.d.ts.map +1 -0
- package/dist/live/run-stream-01/run-stream.js +111 -0
- package/dist/pages/auth-page/index.d.ts +15 -2
- package/dist/pages/auth-page/index.d.ts.map +1 -1
- package/dist/pages/auth-page/index.js +8 -4
- package/dist/pages/blog-post-page/index.js +5 -5
- package/dist/pages/dashboard-page/index.d.ts +4 -4
- package/dist/pages/dashboard-page/index.js +4 -4
- package/dist/pages/docs-shell/docs-shell.d.ts +37 -4
- package/dist/pages/docs-shell/docs-shell.d.ts.map +1 -1
- package/dist/pages/docs-shell/docs-shell.js +107 -16
- package/dist/pages/docs-shell/index.d.ts +2 -2
- package/dist/pages/docs-shell/index.js +1 -1
- package/dist/pages/index.d.ts +14 -14
- package/dist/pages/index.js +7 -7
- package/dist/pages/marketing-page/index.d.ts +6 -6
- package/dist/pages/marketing-page/index.js +5 -5
- package/dist/pages/not-found-page/index.js +4 -4
- package/dist/pages/settings-page/index.d.ts +3 -3
- package/dist/pages/settings-page/index.js +4 -4
- package/dist/provider/index.d.ts +4 -4
- package/dist/provider/index.js +2 -2
- package/dist/provider/provider.d.ts +1 -1
- package/dist/provider/provider.js +1 -1
- package/dist/provider/theme-script.d.ts +1 -1
- package/dist/provider/theme-script.js +1 -1
- package/dist/styles.css +689 -0
- package/package.json +9 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ProductMark } from '../../components/ui/product-mark.js';
|
|
3
|
+
import { cn } from '../../lib/utils.js';
|
|
4
|
+
import { NavbarControls } from './navbar-controls.js';
|
|
5
|
+
/**
|
|
6
|
+
* The bar at the top of a product site, with the controls a reader needs on every
|
|
7
|
+
* page of it.
|
|
8
|
+
*
|
|
9
|
+
* It is `SiteHeader` plus the four controls that were missing from it, and it
|
|
10
|
+
* exists because all five NaniSoft sites had the same bar and every one of them had
|
|
11
|
+
* written the missing four separately: Prism's own site had search and a colour
|
|
12
|
+
* chooser and no way to reach its four siblings, and each of the four had a row of
|
|
13
|
+
* product marks where a menu belongs and no search, no mode control and no
|
|
14
|
+
* navigation at all below the width its own row stopped fitting. Five bars, one
|
|
15
|
+
* design language, and no two of them the same bar.
|
|
16
|
+
*
|
|
17
|
+
* Every string is a prop and the Block ships none. There is no site name, no
|
|
18
|
+
* default navigation, no "Search", no list of packs and no list of sites: a bar
|
|
19
|
+
* that hardcoded any of them would hand every consumer a claim about a product that
|
|
20
|
+
* is not theirs, which is the defect this Block exists to remove. The one piece of
|
|
21
|
+
* copy it derives is a pack's own name from its own identifier, and only when the
|
|
22
|
+
* caller names none.
|
|
23
|
+
*
|
|
24
|
+
* **The bar is one flex row that wraps, and it fits by measurement.** The brand
|
|
25
|
+
* lockup and the controls hold their ends, the navigation sits in the middle, and
|
|
26
|
+
* the navigation row is hidden below `lg` where the panel takes over. The brand
|
|
27
|
+
* lockup is the one element that never wraps: a wordmark broken across two lines is
|
|
28
|
+
* not a wordmark, and it is also the one element that yields rather than pushing a
|
|
29
|
+
* control off the right edge of the viewport, which is the harm a header-fit test
|
|
30
|
+
* exists to catch.
|
|
31
|
+
*
|
|
32
|
+
* **The navigation is a `nav` and the sites menu is a second landmark of its own.**
|
|
33
|
+
* A reader who navigates by landmark needs two regions rather than one region with
|
|
34
|
+
* two lists in it, and the two sets are different places: one is where this site
|
|
35
|
+
* goes and the other is where the family goes. The controls are not a region at
|
|
36
|
+
* all, because they are whatever this bar composed plus whatever the consumer put
|
|
37
|
+
* in `actions`, and wrapping them in a landmark would be a claim about content the
|
|
38
|
+
* Block does not own.
|
|
39
|
+
*
|
|
40
|
+
* The bottom hairline is `border-border`, so the bar separates from the page by a
|
|
41
|
+
* line rather than by a fill change, which is how every surface in this system is
|
|
42
|
+
* separated: in the base pack `background` and `card` resolve to the same value, so
|
|
43
|
+
* a fill is not available as a separator. The bar is translucent and blurred, so the
|
|
44
|
+
* content scrolling under it is legible through it rather than hidden by it, which
|
|
45
|
+
* is the reason a sticky bar can be translucent at all.
|
|
46
|
+
*
|
|
47
|
+
* **It is a server Component with one client island inside it.** The lockup and the
|
|
48
|
+
* navigation are rendered on the server and ship no JavaScript; the controls are a
|
|
49
|
+
* single boundary, because a control's state is a reader's state. A site that
|
|
50
|
+
* passes no `search`, `sites`, `theme`, `mode` or `nav` renders the whole bar on the
|
|
51
|
+
* server and ships none, which is the arrangement a static site wants and the reason
|
|
52
|
+
* those props are optional rather than required.
|
|
53
|
+
*/
|
|
54
|
+
export function SiteNavbar({ product, homeHref = '/', defaultPack, defaultMode, nav, navLabel, currentPath, sites, currentSiteId, sitesLabel, search, theme, mode, mobileLabels, actions, sticky = true, className, }) {
|
|
55
|
+
const links = nav ?? [];
|
|
56
|
+
const isCurrent = (link) => link.current ?? (currentPath !== undefined && link.href === currentPath);
|
|
57
|
+
return (_jsx("header", { "data-slot": "site-navbar", className: cn('border-border/80 bg-background/80 sticky top-0 z-20 w-full border-b backdrop-blur', className), children: _jsxs("div", { className: "mx-auto flex h-14 w-full max-w-page items-center gap-2 px-6", children: [_jsx("a", { href: homeHref, className: "focus-visible:border-ring focus-visible:ring-ring shrink-0 rounded-sm focus-visible:ring-[3px] focus-visible:outline-none", children: _jsx(ProductMark, { id: product.id, name: product.name, pack: product.pack, size: "sm" }) }), links.length > 0 ? (_jsx("nav", { "aria-label": navLabel, className: "hidden items-center lg:flex", children: links.map((link) => (_jsx("a", { href: link.href, "aria-current": isCurrent(link) ? 'page' : undefined, rel: link.newTab ? 'noopener noreferrer' : undefined, target: link.newTab ? '_blank' : undefined, className: isCurrent(link)
|
|
58
|
+
? 'bg-accent text-accent-foreground focus-visible:border-ring focus-visible:ring-ring rounded-md px-2 py-1.5 text-sm font-medium transition-colors focus-visible:ring-[3px] focus-visible:outline-none'
|
|
59
|
+
: 'text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:border-ring focus-visible:ring-ring rounded-md px-2 py-1.5 text-sm font-medium transition-colors focus-visible:ring-[3px] focus-visible:outline-none', children: link.label }, link.href))) })) : null, _jsx(NavbarControls, { product: product, nav: links.map((link) => ({ ...link, current: isCurrent(link) })), navLabel: navLabel, sites: sites, currentSiteId: currentSiteId, sitesLabel: sitesLabel, search: search, theme: theme, mode: mode, mobileLabels: mobileLabels, defaultPack: defaultPack, defaultMode: defaultMode, actions: actions })] }) }));
|
|
60
|
+
}
|
|
61
|
+
export default SiteNavbar;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { SwitcherProduct } from '../../components/ui/product-switcher.js';
|
|
2
|
+
/** The props the sites menu takes. */
|
|
3
|
+
export type SitesMenuProps = {
|
|
4
|
+
/** The set to move between, in the order a reader should meet it. */
|
|
5
|
+
sites: readonly SwitcherProduct[];
|
|
6
|
+
/** The `id` of the site the reader is on. Marked `aria-current="page"`. */
|
|
7
|
+
currentId?: string;
|
|
8
|
+
/** The accessible name of the menu and of its trigger. A word a reader hears. */
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The set of sites, as a menu.
|
|
13
|
+
*
|
|
14
|
+
* Prism's own site had no way to reach its four siblings and each of the four had
|
|
15
|
+
* written its own way to reach the other four, so a reader on one site had to know
|
|
16
|
+
* that four other hosts existed before they could be found. This is the one control
|
|
17
|
+
* that states the set, and every site that composes it states the same five.
|
|
18
|
+
*
|
|
19
|
+
* **The trigger is an icon rather than a word, for the same reason Prism's search
|
|
20
|
+
* trigger is.** The bar carries the brand, the site's own destinations and a row of
|
|
21
|
+
* controls, and at the width the row is authored to fit, a fourth labelled control
|
|
22
|
+
* is the difference between fitting and folding the brand onto two lines. A control
|
|
23
|
+
* that is not a destination is the right place to spend that width, because a
|
|
24
|
+
* reader who does not recognise the icon is losing a word rather than a route.
|
|
25
|
+
*
|
|
26
|
+
* **The items are links, not commands, and the current one is marked rather than
|
|
27
|
+
* styled.** A menu item that navigated was a command wearing a link's clothes, and
|
|
28
|
+
* the cost of that is a reader with a middle-click expecting a new tab and getting
|
|
29
|
+
* nothing. `aria-current="page"` on the member the reader is on is the state a
|
|
30
|
+
* screen reader announces, and it is why the set is a list of anchors inside a menu
|
|
31
|
+
* rather than a `ProductSwitcher` row: the switcher renders every mark at once and
|
|
32
|
+
* this renders them on demand, which is what makes room for the icon-only trigger.
|
|
33
|
+
*
|
|
34
|
+
* Each item carries the site's own `ProductMark`, so a reader recognises a
|
|
35
|
+
* destination by its colour before they read its name, and the mark is where a
|
|
36
|
+
* pack boundary is safe: it is a fully rounded disc, so repointing the pack's corner
|
|
37
|
+
* radius beneath it moves nothing about its shape.
|
|
38
|
+
*/
|
|
39
|
+
export declare function SitesMenu({ sites, currentId, label }: SitesMenuProps): import("react").JSX.Element | null;
|
|
40
|
+
//# sourceMappingURL=sites-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sites-menu.d.ts","sourceRoot":"","sources":["../../../src/blocks/site-navbar/sites-menu.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AAE3E,sCAAsC;AACtC,MAAM,MAAM,cAAc,GAAG;IAC3B,qEAAqE;IACrE,KAAK,EAAE,SAAS,eAAe,EAAE,CAAA;IACjC,2EAA2E;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,cAAc,sCAmDpE"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { LayoutGrid } from 'lucide-react';
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger, } from '../../components/ui/dropdown-menu.js';
|
|
5
|
+
import { ProductMark } from '../../components/ui/product-mark.js';
|
|
6
|
+
/**
|
|
7
|
+
* The set of sites, as a menu.
|
|
8
|
+
*
|
|
9
|
+
* Prism's own site had no way to reach its four siblings and each of the four had
|
|
10
|
+
* written its own way to reach the other four, so a reader on one site had to know
|
|
11
|
+
* that four other hosts existed before they could be found. This is the one control
|
|
12
|
+
* that states the set, and every site that composes it states the same five.
|
|
13
|
+
*
|
|
14
|
+
* **The trigger is an icon rather than a word, for the same reason Prism's search
|
|
15
|
+
* trigger is.** The bar carries the brand, the site's own destinations and a row of
|
|
16
|
+
* controls, and at the width the row is authored to fit, a fourth labelled control
|
|
17
|
+
* is the difference between fitting and folding the brand onto two lines. A control
|
|
18
|
+
* that is not a destination is the right place to spend that width, because a
|
|
19
|
+
* reader who does not recognise the icon is losing a word rather than a route.
|
|
20
|
+
*
|
|
21
|
+
* **The items are links, not commands, and the current one is marked rather than
|
|
22
|
+
* styled.** A menu item that navigated was a command wearing a link's clothes, and
|
|
23
|
+
* the cost of that is a reader with a middle-click expecting a new tab and getting
|
|
24
|
+
* nothing. `aria-current="page"` on the member the reader is on is the state a
|
|
25
|
+
* screen reader announces, and it is why the set is a list of anchors inside a menu
|
|
26
|
+
* rather than a `ProductSwitcher` row: the switcher renders every mark at once and
|
|
27
|
+
* this renders them on demand, which is what makes room for the icon-only trigger.
|
|
28
|
+
*
|
|
29
|
+
* Each item carries the site's own `ProductMark`, so a reader recognises a
|
|
30
|
+
* destination by its colour before they read its name, and the mark is where a
|
|
31
|
+
* pack boundary is safe: it is a fully rounded disc, so repointing the pack's corner
|
|
32
|
+
* radius beneath it moves nothing about its shape.
|
|
33
|
+
*/
|
|
34
|
+
export function SitesMenu({ sites, currentId, label }) {
|
|
35
|
+
if (sites.length === 0)
|
|
36
|
+
return null;
|
|
37
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { "data-slot": "site-navbar-sites-trigger", "aria-label": label, className: "border-border bg-card text-muted-foreground hover:bg-accent hover:text-accent-foreground data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground size-11 shrink-0 rounded-full border", children: _jsx(LayoutGrid, { "aria-hidden": true, className: "size-4" }) }), _jsx(DropdownMenuContent, { align: "end", sideOffset: 8, className: "min-w-56", children: _jsxs(DropdownMenuGroup, { children: [_jsx(DropdownMenuLabel, { children: label }), sites.map((site) => {
|
|
38
|
+
const current = site.id === currentId;
|
|
39
|
+
return (_jsx(DropdownMenuItem, {
|
|
40
|
+
/*
|
|
41
|
+
* Rendered AS the link rather than wrapping one. A focusable menu
|
|
42
|
+
* item with an anchor inside it is two tab stops for one row, and a
|
|
43
|
+
* reader who middle-clicks a row that only looks like a link gets no
|
|
44
|
+
* new tab and no way to tell that the row was a link at all.
|
|
45
|
+
*/
|
|
46
|
+
render: _jsx("a", { href: site.href, target: "_blank", rel: "noopener noreferrer", "aria-current": current ? 'page' : undefined, "data-current": current ? 'true' : undefined }), children: _jsx(ProductMark, { id: site.id, name: site.name, pack: site.pack, size: "sm" }) }, site.id));
|
|
47
|
+
})] }) })] }));
|
|
48
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type PackId } from '../../theming/index.js';
|
|
2
|
+
/** One pack the menu offers, and the word a reader reads for it. */
|
|
3
|
+
export type ThemePack = {
|
|
4
|
+
/** The pack identifier, which is a token rather than a string. */
|
|
5
|
+
id: PackId;
|
|
6
|
+
/** The pack's own name. */
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
/** The props the theme menu takes. */
|
|
10
|
+
export type ThemeMenuProps = {
|
|
11
|
+
/** The packs to choose between. Defaults to every published pack. */
|
|
12
|
+
packs?: readonly ThemePack[];
|
|
13
|
+
/** The accessible name of the menu, and of the word on its trigger. */
|
|
14
|
+
label: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The pack chooser, as a menu.
|
|
18
|
+
*
|
|
19
|
+
* **The swatch is a pack boundary rather than a literal colour, and that is the
|
|
20
|
+
* whole of how this component avoids a runtime token read.** The obvious
|
|
21
|
+
* implementation reads each pack's compiled `--primary` and paints it as an inline
|
|
22
|
+
* style, which is what Prism's own documentation site did. A token resolved at
|
|
23
|
+
* runtime does not follow the cascade, so the dot holding a pack's colour is right
|
|
24
|
+
* in one mode and stale in the other, and it is the exact defect the
|
|
25
|
+
* `runtime-token-read` law names: the disagreement is between what is painted and
|
|
26
|
+
* what the cascade says, and only a program that reads the read can see it.
|
|
27
|
+
*
|
|
28
|
+
* `data-pack` on a span carrying `bg-primary` resolves through the cascade, holds
|
|
29
|
+
* every pack at once, and ships no client code. The boundary is safe on this shape
|
|
30
|
+
* and only this shape: a pack repoints its own corner radius as well as its colour,
|
|
31
|
+
* so a boundary on anything that is not fully rounded would quietly restyle that
|
|
32
|
+
* element's corners. A disc is fully rounded, so the radius axis is a no-op here.
|
|
33
|
+
*
|
|
34
|
+
* **It is a radio group rather than a list of commands.** One pack is active at a
|
|
35
|
+
* time out of a known set, which is what a radio group is for, and it is what
|
|
36
|
+
* gives the menu its announced state: a reader who opens the chooser hears which
|
|
37
|
+
* of the packs is in use, where a list of commands would announce six buttons and
|
|
38
|
+
* leave them to work out which one took effect.
|
|
39
|
+
*
|
|
40
|
+
* **The trigger shows the active pack's name, and drops it below `sm`.** Six
|
|
41
|
+
* options side by side need about 380 pixels, which is why this is a menu at all
|
|
42
|
+
* rather than a row of pills, and the name on the trigger is the one place the
|
|
43
|
+
* choice stays visible once the menu is closed. It is hidden rather than shortened
|
|
44
|
+
* below `sm` because a truncated pack name is a word that names nothing.
|
|
45
|
+
*/
|
|
46
|
+
export declare function ThemeMenu({ packs, label }: ThemeMenuProps): import("react").JSX.Element | null;
|
|
47
|
+
//# sourceMappingURL=theme-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-menu.d.ts","sourceRoot":"","sources":["../../../src/blocks/site-navbar/theme-menu.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAS,KAAK,MAAM,EAAE,MAAM,eAAe,CAAA;AAElD,oEAAoE;AACpE,MAAM,MAAM,SAAS,GAAG;IACtB,kEAAkE;IAClE,EAAE,EAAE,MAAM,CAAA;IACV,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,sCAAsC;AACtC,MAAM,MAAM,cAAc,GAAG;IAC3B,qEAAqE;IACrE,KAAK,CAAC,EAAE,SAAS,SAAS,EAAE,CAAA;IAC5B,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAcD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,cAAc,sCA8CzD"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronDown } from 'lucide-react';
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger, } from '../../components/ui/dropdown-menu.js';
|
|
5
|
+
import { usePrismTheme } from '../../provider/provider.js';
|
|
6
|
+
import { PACKS } from '../../theming/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* The name a pack is offered under when the caller names none.
|
|
9
|
+
*
|
|
10
|
+
* Capitalising the identifier is enough rather than a table, because the pack
|
|
11
|
+
* vocabulary is closed and every id in it is the lowercased form of its own name.
|
|
12
|
+
* The alternative is a lookup that could fall through for a pack added after this
|
|
13
|
+
* line was written, and a fallthrough here is a menu item with no readable name.
|
|
14
|
+
*/
|
|
15
|
+
function nameOf(pack) {
|
|
16
|
+
return pack.charAt(0).toUpperCase() + pack.slice(1);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The pack chooser, as a menu.
|
|
20
|
+
*
|
|
21
|
+
* **The swatch is a pack boundary rather than a literal colour, and that is the
|
|
22
|
+
* whole of how this component avoids a runtime token read.** The obvious
|
|
23
|
+
* implementation reads each pack's compiled `--primary` and paints it as an inline
|
|
24
|
+
* style, which is what Prism's own documentation site did. A token resolved at
|
|
25
|
+
* runtime does not follow the cascade, so the dot holding a pack's colour is right
|
|
26
|
+
* in one mode and stale in the other, and it is the exact defect the
|
|
27
|
+
* `runtime-token-read` law names: the disagreement is between what is painted and
|
|
28
|
+
* what the cascade says, and only a program that reads the read can see it.
|
|
29
|
+
*
|
|
30
|
+
* `data-pack` on a span carrying `bg-primary` resolves through the cascade, holds
|
|
31
|
+
* every pack at once, and ships no client code. The boundary is safe on this shape
|
|
32
|
+
* and only this shape: a pack repoints its own corner radius as well as its colour,
|
|
33
|
+
* so a boundary on anything that is not fully rounded would quietly restyle that
|
|
34
|
+
* element's corners. A disc is fully rounded, so the radius axis is a no-op here.
|
|
35
|
+
*
|
|
36
|
+
* **It is a radio group rather than a list of commands.** One pack is active at a
|
|
37
|
+
* time out of a known set, which is what a radio group is for, and it is what
|
|
38
|
+
* gives the menu its announced state: a reader who opens the chooser hears which
|
|
39
|
+
* of the packs is in use, where a list of commands would announce six buttons and
|
|
40
|
+
* leave them to work out which one took effect.
|
|
41
|
+
*
|
|
42
|
+
* **The trigger shows the active pack's name, and drops it below `sm`.** Six
|
|
43
|
+
* options side by side need about 380 pixels, which is why this is a menu at all
|
|
44
|
+
* rather than a row of pills, and the name on the trigger is the one place the
|
|
45
|
+
* choice stays visible once the menu is closed. It is hidden rather than shortened
|
|
46
|
+
* below `sm` because a truncated pack name is a word that names nothing.
|
|
47
|
+
*/
|
|
48
|
+
export function ThemeMenu({ packs, label }) {
|
|
49
|
+
const { pack, setPack } = usePrismTheme();
|
|
50
|
+
const options = packs ?? PACKS.map((id) => ({ id, name: nameOf(id) }));
|
|
51
|
+
const active = options.find((option) => option.id === pack) ?? options[0];
|
|
52
|
+
if (!active)
|
|
53
|
+
return null;
|
|
54
|
+
return (_jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { "data-slot": "site-navbar-theme-trigger", "aria-label": `${label}: ${active.name}`, className: "border-border bg-card text-foreground hover:bg-accent hover:text-accent-foreground data-[popup-open]:bg-accent data-[popup-open]:text-accent-foreground h-11 shrink-0 gap-2 rounded-full border pr-2.5 pl-3", children: [_jsx("span", { "data-pack": active.id, "aria-hidden": true, className: "border-border/60 bg-primary size-3.5 rounded-full border" }), _jsx("span", { className: "hidden sm:inline", children: active.name }), _jsx(ChevronDown, { "aria-hidden": true, className: "size-3.5" })] }), _jsx(DropdownMenuContent, { align: "end", sideOffset: 8, className: "min-w-52", children: _jsxs(DropdownMenuRadioGroup, { value: active.id, onValueChange: (value) => setPack(value), children: [_jsx(DropdownMenuLabel, { children: label }), options.map((option) => (_jsxs(DropdownMenuRadioItem, { value: option.id, closeOnClick: true, children: [_jsx("span", { "data-pack": option.id, "aria-hidden": true, className: "border-border/60 bg-primary size-3.5 shrink-0 rounded-full border" }), _jsx("span", { className: "flex-1", children: option.name })] }, option.id)))] }) })] }));
|
|
55
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { StackGrid01, default } from './stack-grid';
|
|
2
|
-
export type { StackGrid01Props, StackPart, StackOwn } from './stack-grid';
|
|
1
|
+
export { StackGrid01, default } from './stack-grid.js';
|
|
2
|
+
export type { StackGrid01Props, StackPart, StackOwn } from './stack-grid.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { StackGrid01, default } from './stack-grid';
|
|
1
|
+
export { StackGrid01, default } from './stack-grid.js';
|
|
@@ -1,14 +1,40 @@
|
|
|
1
|
-
import { type HeadingLevel } from '../../components/ui/section';
|
|
1
|
+
import { type HeadingLevel } from '../../components/ui/section.js';
|
|
2
2
|
/**
|
|
3
|
-
* One part a product is assembled from: its name
|
|
3
|
+
* One part a product is assembled from: its name, the product it wraps when the
|
|
4
|
+
* name is a codename, and the role it plays.
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
-
* is a role. A survey grid is a claim that a set of parts is
|
|
7
|
-
* halves of that claim are the caller's to make.
|
|
6
|
+
* `name` and `role` are required, and a part with no role is a logo and a part
|
|
7
|
+
* with no name is a role. A survey grid is a claim that a set of parts is
|
|
8
|
+
* sufficient, and both halves of that claim are the caller's to make.
|
|
8
9
|
*/
|
|
9
10
|
export type StackPart = {
|
|
10
11
|
/** The part's own name, as its authors spell it. */
|
|
11
12
|
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* The real product underneath a codename, when the name above is not a name a
|
|
15
|
+
* reader could look up.
|
|
16
|
+
*
|
|
17
|
+
* Optional and additive: a part whose name already is its product's own name
|
|
18
|
+
* omits it, and a tile that omits it renders the two elements it rendered
|
|
19
|
+
* before this field existed, with no line and no space held open for one.
|
|
20
|
+
*
|
|
21
|
+
* It is a field and not a slot, because the value goes inside the tile this
|
|
22
|
+
* Block already draws. A slot is a value that goes in an element the Block does
|
|
23
|
+
* not own, and a `StackPart` is a part's data, which is the `li` the Block
|
|
24
|
+
* renders. It is the same shape as `ProductGrid01`'s `pack` and
|
|
25
|
+
* `StatusLedger01`'s `detail`: one more value in a row the caller owns.
|
|
26
|
+
*
|
|
27
|
+
* Three of the four NaniSoft sites publish their stack under a codename with
|
|
28
|
+
* the product printed beneath it, and the missing field is what made the
|
|
29
|
+
* migration drop eight published names rather than move them. It is also the
|
|
30
|
+
* evidence for the claim the section makes: a grid that says it composes rather
|
|
31
|
+
* than forks can only be checked by a reader who can see what it composed.
|
|
32
|
+
*
|
|
33
|
+
* Pass it when it differs from `name`. The Block renders what it is handed and
|
|
34
|
+
* does not compare the two, so a caller that passes one name twice prints it
|
|
35
|
+
* twice.
|
|
36
|
+
*/
|
|
37
|
+
realName?: string;
|
|
12
38
|
/**
|
|
13
39
|
* One phrase about what the part does here. It is a role rather than a
|
|
14
40
|
* description: the grid is a survey of what a product is built from, not a
|
|
@@ -34,9 +60,9 @@ export type StackOwn = {
|
|
|
34
60
|
/**
|
|
35
61
|
* The props a StackGrid01 takes.
|
|
36
62
|
*
|
|
37
|
-
* Every string is a prop and the Block ships none: no part, no role, no
|
|
38
|
-
* and no default "built in-house" mark. A grid that hardcoded
|
|
39
|
-
* hand every consumer a survey of somebody else's stack.
|
|
63
|
+
* Every string is a prop and the Block ships none: no part, no role, no
|
|
64
|
+
* realName, no blurb and no default "built in-house" mark. A grid that hardcoded
|
|
65
|
+
* a part list would hand every consumer a survey of somebody else's stack.
|
|
40
66
|
*/
|
|
41
67
|
export type StackGrid01Props = {
|
|
42
68
|
/** Optional label above the section title. See the No-Default-Eyebrow Rule. */
|
|
@@ -107,9 +133,14 @@ export type StackGrid01Props = {
|
|
|
107
133
|
* the claim is the caller's words. Three of the four sites write three different
|
|
108
134
|
* ones, and the Block does not choose.
|
|
109
135
|
*
|
|
110
|
-
* A tile carries a name
|
|
111
|
-
*
|
|
112
|
-
*
|
|
136
|
+
* A tile carries a name, the real product behind it when the name is a codename,
|
|
137
|
+
* and a role. The middle value is optional and additive: eight of the sixteen
|
|
138
|
+
* parts on the three sites that draw this section are a codename over a product
|
|
139
|
+
* its reader could look up, and before the field existed the honest answer
|
|
140
|
+
* inside this surface was to lose those names. A part whose *role* needs two
|
|
141
|
+
* lines still belongs in the section's `description`, where it applies to the
|
|
142
|
+
* group rather than to one tile, because that is a claim about every tile rather
|
|
143
|
+
* than a second name for one of them.
|
|
113
144
|
*
|
|
114
145
|
* It is a server Component: no hook, no state and no client code.
|
|
115
146
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-grid.d.ts","sourceRoot":"","sources":["../../../src/blocks/stack-grid-01/stack-grid.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"stack-grid.d.ts","sourceRoot":"","sources":["../../../src/blocks/stack-grid-01/stack-grid.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuC,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAGpG;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAA;IACZ;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,KAAK,EAAE,SAAS,SAAS,EAAE,CAAA;IAC3B;;;;OAIG;IACH,GAAG,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAA;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,KAAK,EACL,WAAW,EACX,KAAK,EACL,GAAG,EACH,QAAQ,EACR,OAAO,EACP,YAAmB,EACnB,SAAS,GACV,EAAE,gBAAgB,+BA6ElB;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Card, CardContent, CardHeader, CardTitle } from '../../components/ui/card';
|
|
3
|
-
import { Section, SectionHeading } from '../../components/ui/section';
|
|
4
|
-
import { cn } from '../../lib/utils';
|
|
2
|
+
import { Card, CardContent, CardHeader, CardTitle } from '../../components/ui/card.js';
|
|
3
|
+
import { Section, SectionHeading, childLevel } from '../../components/ui/section.js';
|
|
4
|
+
import { cn } from '../../lib/utils.js';
|
|
5
5
|
/**
|
|
6
6
|
* A survey of what a product is assembled from, and what it built itself.
|
|
7
7
|
*
|
|
@@ -32,18 +32,26 @@ import { cn } from '../../lib/utils';
|
|
|
32
32
|
* the claim is the caller's words. Three of the four sites write three different
|
|
33
33
|
* ones, and the Block does not choose.
|
|
34
34
|
*
|
|
35
|
-
* A tile carries a name
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* A tile carries a name, the real product behind it when the name is a codename,
|
|
36
|
+
* and a role. The middle value is optional and additive: eight of the sixteen
|
|
37
|
+
* parts on the three sites that draw this section are a codename over a product
|
|
38
|
+
* its reader could look up, and before the field existed the honest answer
|
|
39
|
+
* inside this surface was to lose those names. A part whose *role* needs two
|
|
40
|
+
* lines still belongs in the section's `description`, where it applies to the
|
|
41
|
+
* group rather than to one tile, because that is a claim about every tile rather
|
|
42
|
+
* than a second name for one of them.
|
|
38
43
|
*
|
|
39
44
|
* It is a server Component: no hook, no state and no client code.
|
|
40
45
|
*/
|
|
41
46
|
export function StackGrid01({ eyebrow, title, description, parts, own, ownLabel, caption, headingLevel = 'h2', className, }) {
|
|
47
|
+
// Both groups are sets of tiles under one section, so a tile name is a heading
|
|
48
|
+
// one step below it rather than a sibling of it.
|
|
49
|
+
const Title = childLevel(headingLevel);
|
|
42
50
|
if (own !== undefined && own.length > 0 && !ownLabel) {
|
|
43
51
|
throw new Error('StackGrid01: the in-house group was passed with no ownLabel, so the grid would make the claim ' +
|
|
44
52
|
'"this part is ours" in a shape and leave the words to a reader to infer. Pass the words you mean, ' +
|
|
45
53
|
'or omit the group.');
|
|
46
54
|
}
|
|
47
|
-
return (_jsxs(Section, { children: [title ? (_jsx(SectionHeading, { as: headingLevel, align: "left", eyebrow: eyebrow, title: title, description: description, className: "mb-12" })) : null, _jsxs("div", { "data-slot": "stack-grid", className: cn('flex flex-col gap-10', className), children: [_jsx("ul", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4", children: parts.map((part) => (_jsx("li", { children: _jsxs(Card, { className: "bg-muted h-full gap-2 py-4", children: [
|
|
55
|
+
return (_jsxs(Section, { children: [title ? (_jsx(SectionHeading, { as: headingLevel, align: "left", eyebrow: eyebrow, title: title, description: description, className: "mb-12" })) : null, _jsxs("div", { "data-slot": "stack-grid", className: cn('flex flex-col gap-10', className), children: [_jsx("ul", { className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4", children: parts.map((part) => (_jsx("li", { children: _jsxs(Card, { className: "bg-muted h-full gap-2 py-4", children: [_jsxs(CardHeader, { className: "gap-1", children: [_jsx(CardTitle, { className: "text-sm", children: _jsx(Title, { children: part.name }) }), part.realName ? (_jsx("span", { className: "text-muted-foreground font-mono text-xs", children: part.realName })) : null] }), _jsx(CardContent, { children: _jsx("p", { className: "text-muted-foreground text-pretty text-xs", children: part.role }) })] }) }, part.name))) }), own && own.length > 0 ? (_jsx("ul", { "data-slot": "stack-grid-own", className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4", children: own.map((entry) => (_jsx("li", { children: _jsxs(Card, { className: "border-primary shadow-md h-full gap-2 py-4", children: [_jsxs(CardHeader, { className: "gap-1", children: [_jsx("span", { className: "text-muted-foreground font-mono text-xs", children: ownLabel }), _jsx(CardTitle, { className: "text-sm", children: _jsx(Title, { children: entry.name }) })] }), _jsx(CardContent, { children: _jsx("p", { className: "text-muted-foreground text-pretty text-xs", children: entry.blurb }) })] }) }, entry.name))) })) : null] }), caption ? _jsx("p", { className: "text-muted-foreground mt-6 text-pretty text-sm", children: caption }) : null] }));
|
|
48
56
|
}
|
|
49
57
|
export default StackGrid01;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The subpath exports the Block and its props, and the props are exported because
|
|
3
|
+
* a caller that builds a `Stat[]` has to be able to name the type it is building.
|
|
4
|
+
* A Block whose prop types are only reachable through inference is a Block whose
|
|
5
|
+
* callers annotate their arrays as `any`, which is the point at which a rename
|
|
6
|
+
* stops being caught by the compiler.
|
|
7
|
+
*/
|
|
8
|
+
export { Stats01, default } from './stats.js';
|
|
9
|
+
export type { Stat, Stats01Props } from './stats.js';
|
|
2
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/blocks/stats-01/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/blocks/stats-01/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAC1C,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The subpath exports the Block and its props, and the props are exported because
|
|
3
|
+
* a caller that builds a `Stat[]` has to be able to name the type it is building.
|
|
4
|
+
* A Block whose prop types are only reachable through inference is a Block whose
|
|
5
|
+
* callers annotate their arrays as `any`, which is the point at which a rename
|
|
6
|
+
* stops being caught by the compiler.
|
|
7
|
+
*/
|
|
8
|
+
export { Stats01, default } from './stats.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ArrowDownRight, ArrowUpRight, Minus } from 'lucide-react';
|
|
3
|
-
import { Card, CardContent } from '../../components/ui/card';
|
|
4
|
-
import { Section, SectionHeading } from '../../components/ui/section';
|
|
3
|
+
import { Card, CardContent } from '../../components/ui/card.js';
|
|
4
|
+
import { Section, SectionHeading } from '../../components/ui/section.js';
|
|
5
5
|
function Delta({ value }) {
|
|
6
6
|
if (value === 0) {
|
|
7
7
|
return (_jsxs("span", { className: "text-muted-foreground flex items-center gap-1 text-xs", children: [_jsx(Minus, { className: "size-3" }), "0%"] }));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { StatusLedger01, STATUS_TIERS, default } from './status-ledger';
|
|
2
|
-
export type { StatusLedger01Props, StatusRow, StatusTier } from './status-ledger';
|
|
1
|
+
export { StatusLedger01, STATUS_TIERS, default } from './status-ledger.js';
|
|
2
|
+
export type { StatusLedger01Props, StatusRow, StatusTier } from './status-ledger.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { StatusLedger01, STATUS_TIERS, default } from './status-ledger';
|
|
1
|
+
export { StatusLedger01, STATUS_TIERS, default } from './status-ledger.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Section, SectionHeading } from '../../components/ui/section';
|
|
3
|
-
import { cn } from '../../lib/utils';
|
|
2
|
+
import { Section, SectionHeading } from '../../components/ui/section.js';
|
|
3
|
+
import { cn } from '../../lib/utils.js';
|
|
4
4
|
/**
|
|
5
5
|
* The four tiers a StatusLedger01 row can be in.
|
|
6
6
|
*
|
package/dist/catalog.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* the reverse, so the internal shadcn registry stays derived rather than
|
|
8
8
|
* authoritative. Tooling only: a consumer's runtime UI must not import this.
|
|
9
9
|
*/
|
|
10
|
-
export declare const CATALOG_KINDS: readonly ["component", "block", "page"];
|
|
10
|
+
export declare const CATALOG_KINDS: readonly ["component", "block", "page", "live"];
|
|
11
11
|
export type CatalogKind = (typeof CATALOG_KINDS)[number];
|
|
12
12
|
export declare const COMPONENT_CATEGORIES: readonly ["Call to action", "Forms and inputs", "Feedback", "Layout", "Data display", "Typography", "Miscellaneous"];
|
|
13
13
|
export type ComponentCategory = (typeof COMPONENT_CATEGORIES)[number];
|
package/dist/catalog.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,aAAa,iDAAkD,CAAA;AAC5E,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAA;AAExD,eAAO,MAAM,oBAAoB,sHAQvB,CAAA;AACV,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAErE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,WAAW,CAAA;IACjB,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,MAAM,EAAE,QAAQ,GAAG,YAAY,CAAA;CAChC;AAED,eAAO,MAAM,OAAO,EAAE,SAAS,WAAW,EAisCzC,CAAA;AAED,sEAAsE;AACtE,wBAAgB,YAAY,CAAC,KAAK,GAAE,SAAS,WAAW,EAAY,GAAG,WAAW,EAAE,CAEnF;AAED,eAAO,MAAM,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAE1D,CAAA"}
|