@zonsh/ui 0.0.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +75 -1
- package/assets/illustrations/drawing/bracket-construction-dark.svg +77 -0
- package/assets/illustrations/drawing/bracket-construction-filled-dark.svg +50 -0
- package/assets/illustrations/drawing/bracket-construction-filled.svg +50 -0
- package/assets/illustrations/drawing/bracket-construction.svg +77 -0
- package/assets/illustrations/drawing/crescent-dark.svg +28 -0
- package/assets/illustrations/drawing/crescent-guides-dark.svg +33 -0
- package/assets/illustrations/drawing/crescent-guides.svg +33 -0
- package/assets/illustrations/drawing/crescent.svg +28 -0
- package/assets/illustrations/drawing/eclipse-dark.svg +187 -0
- package/assets/illustrations/drawing/eclipse-guides-dark.svg +191 -0
- package/assets/illustrations/drawing/eclipse-guides.svg +191 -0
- package/assets/illustrations/drawing/eclipse.svg +187 -0
- package/assets/illustrations/drawing/elevation-guides-dark.svg +31 -0
- package/assets/illustrations/drawing/elevation-guides-plain-dark.svg +9 -0
- package/assets/illustrations/drawing/elevation-guides-plain.svg +9 -0
- package/assets/illustrations/drawing/elevation-guides.svg +31 -0
- package/assets/illustrations/drawing/horizon-dark.svg +30 -0
- package/assets/illustrations/drawing/horizon.svg +30 -0
- package/assets/illustrations/drawing/nib-study-dark.svg +107 -0
- package/assets/illustrations/drawing/nib-study-plain-dark.svg +93 -0
- package/assets/illustrations/drawing/nib-study-plain.svg +93 -0
- package/assets/illustrations/drawing/nib-study.svg +107 -0
- package/assets/illustrations/editorial/assistant-640.webp +0 -0
- package/assets/illustrations/editorial/assistant.webp +0 -0
- package/assets/illustrations/editorial/automation-640.webp +0 -0
- package/assets/illustrations/editorial/automation.webp +0 -0
- package/assets/illustrations/editorial/bracket-left-640.webp +0 -0
- package/assets/illustrations/editorial/bracket-left.webp +0 -0
- package/assets/illustrations/editorial/bracket-right-640.webp +0 -0
- package/assets/illustrations/editorial/bracket-right.webp +0 -0
- package/assets/illustrations/editorial/custom-software-640.webp +0 -0
- package/assets/illustrations/editorial/custom-software.webp +0 -0
- package/assets/illustrations/editorial/digitalization-640.webp +0 -0
- package/assets/illustrations/editorial/digitalization.webp +0 -0
- package/assets/illustrations/editorial/integration-640.webp +0 -0
- package/assets/illustrations/editorial/integration.webp +0 -0
- package/assets/illustrations/editorial/problem-640.webp +0 -0
- package/assets/illustrations/editorial/problem.webp +0 -0
- package/assets/illustrations/editorial/process-analysis-640.webp +0 -0
- package/assets/illustrations/editorial/process-analysis.webp +0 -0
- package/assets/illustrations/editorial/process-concept-640.webp +0 -0
- package/assets/illustrations/editorial/process-concept.webp +0 -0
- package/assets/illustrations/editorial/process-development-640.webp +0 -0
- package/assets/illustrations/editorial/process-development.webp +0 -0
- package/assets/illustrations/editorial/process-discovery-640.webp +0 -0
- package/assets/illustrations/editorial/process-discovery.webp +0 -0
- package/assets/illustrations/editorial/process-maintenance-640.webp +0 -0
- package/assets/illustrations/editorial/process-maintenance.webp +0 -0
- package/assets/illustrations/editorial/process-prototype-640.webp +0 -0
- package/assets/illustrations/editorial/process-prototype.webp +0 -0
- package/assets/illustrations/editorial/process-testing-640.webp +0 -0
- package/assets/illustrations/editorial/process-testing.webp +0 -0
- package/assets/illustrations/iso/automation-dark.svg +6 -0
- package/assets/illustrations/iso/automation.svg +6 -0
- package/assets/illustrations/iso/bar-chart-dark.svg +6 -0
- package/assets/illustrations/iso/bar-chart.svg +6 -0
- package/assets/illustrations/iso/brackets-classic-dark.svg +6 -0
- package/assets/illustrations/iso/brackets-classic.svg +6 -0
- package/assets/illustrations/iso/brackets-dark.svg +6 -0
- package/assets/illustrations/iso/brackets.svg +6 -0
- package/assets/illustrations/iso/city-dark.svg +6 -0
- package/assets/illustrations/iso/city.svg +6 -0
- package/assets/illustrations/iso/conveyor-dark.svg +6 -0
- package/assets/illustrations/iso/conveyor.svg +6 -0
- package/assets/illustrations/iso/database-dark.svg +6 -0
- package/assets/illustrations/iso/database.svg +6 -0
- package/assets/illustrations/iso/documents-dark.svg +6 -0
- package/assets/illustrations/iso/documents.svg +6 -0
- package/assets/illustrations/iso/inbox-dark.svg +6 -0
- package/assets/illustrations/iso/inbox.svg +6 -0
- package/assets/illustrations/iso/laptop-dark.svg +6 -0
- package/assets/illustrations/iso/laptop.svg +6 -0
- package/assets/illustrations/iso/monitor-dark.svg +6 -0
- package/assets/illustrations/iso/monitor.svg +6 -0
- package/assets/illustrations/iso/pipeline-dark.svg +6 -0
- package/assets/illustrations/iso/pipeline.svg +6 -0
- package/assets/illustrations/iso/platform-dark.svg +6 -0
- package/assets/illustrations/iso/platform.svg +6 -0
- package/assets/illustrations/iso/server-dark.svg +6 -0
- package/assets/illustrations/iso/server.svg +6 -0
- package/assets/illustrations/iso/spreadsheet-dark.svg +6 -0
- package/assets/illustrations/iso/spreadsheet.svg +6 -0
- package/assets/illustrations/iso/timeline-dark.svg +6 -0
- package/assets/illustrations/iso/timeline.svg +6 -0
- package/assets/illustrations/sheet/construction.svg +115 -0
- package/assets/illustrations/sheet/crescent.svg +40 -0
- package/assets/illustrations/sheet/limb.svg +42 -0
- package/assets/illustrations/sheet/stress-axis.svg +119 -0
- package/assets/illustrations/sheet/totality.svg +215 -0
- package/assets/illustrations/sheet/vertical-metrics.svg +43 -0
- package/assets/logo-left.svg +1 -0
- package/assets/logo-right.svg +1 -0
- package/assets/logo.svg +1 -0
- package/dist/components/_overlay.d.ts +47 -0
- package/dist/components/_overlay.js +59 -0
- package/dist/components/accordion.d.ts +32 -0
- package/dist/components/accordion.js +39 -0
- package/dist/components/alert-dialog.d.ts +45 -0
- package/dist/components/alert-dialog.js +56 -0
- package/dist/components/alert.d.ts +35 -0
- package/dist/components/alert.js +42 -0
- package/dist/components/ascii-field.d.ts +34 -0
- package/dist/components/ascii-field.js +410 -0
- package/dist/components/aspect-ratio.d.ts +14 -0
- package/dist/components/aspect-ratio.js +17 -0
- package/dist/components/avatar.d.ts +42 -0
- package/dist/components/avatar.js +55 -0
- package/dist/components/badge.d.ts +70 -0
- package/dist/components/badge.js +62 -0
- package/dist/components/breadcrumb.d.ts +22 -0
- package/dist/components/breadcrumb.js +32 -0
- package/dist/components/button-group.d.ts +30 -0
- package/dist/components/button-group.js +47 -0
- package/dist/components/button.d.ts +53 -0
- package/dist/components/button.js +130 -0
- package/dist/components/calendar.d.ts +26 -0
- package/dist/components/calendar.js +164 -0
- package/dist/components/card.d.ts +42 -0
- package/dist/components/card.js +76 -0
- package/dist/components/carousel.d.ts +90 -0
- package/dist/components/carousel.js +213 -0
- package/dist/components/chart.d.ts +180 -0
- package/dist/components/chart.js +286 -0
- package/dist/components/checkbox.d.ts +23 -0
- package/dist/components/checkbox.js +43 -0
- package/dist/components/code-block.d.ts +45 -0
- package/dist/components/code-block.js +58 -0
- package/dist/components/code-highlight.d.ts +13 -0
- package/dist/components/code-highlight.js +107 -0
- package/dist/components/collapsible.d.ts +20 -0
- package/dist/components/collapsible.js +32 -0
- package/dist/components/color-picker.d.ts +85 -0
- package/dist/components/color-picker.js +407 -0
- package/dist/components/combobox.d.ts +81 -0
- package/dist/components/combobox.js +100 -0
- package/dist/components/command.d.ts +112 -0
- package/dist/components/command.js +212 -0
- package/dist/components/context-menu.d.ts +29 -0
- package/dist/components/context-menu.js +35 -0
- package/dist/components/conversation.d.ts +27 -0
- package/dist/components/conversation.js +293 -0
- package/dist/components/copy-button.d.ts +46 -0
- package/dist/components/copy-button.js +118 -0
- package/dist/components/data-table.d.ts +175 -0
- package/dist/components/data-table.js +302 -0
- package/dist/components/date-picker.d.ts +91 -0
- package/dist/components/date-picker.js +207 -0
- package/dist/components/dialog.d.ts +48 -0
- package/dist/components/dialog.js +92 -0
- package/dist/components/direction.d.ts +16 -0
- package/dist/components/direction.js +18 -0
- package/dist/components/drawer.d.ts +60 -0
- package/dist/components/drawer.js +76 -0
- package/dist/components/empty.d.ts +31 -0
- package/dist/components/empty.js +50 -0
- package/dist/components/feature-list.d.ts +54 -0
- package/dist/components/feature-list.js +43 -0
- package/dist/components/field.d.ts +15 -0
- package/dist/components/field.js +36 -0
- package/dist/components/file-drop.d.ts +55 -0
- package/dist/components/file-drop.js +197 -0
- package/dist/components/filter-bar.d.ts +106 -0
- package/dist/components/filter-bar.js +296 -0
- package/dist/components/form.d.ts +33 -0
- package/dist/components/form.js +34 -0
- package/dist/components/graph.d.ts +105 -0
- package/dist/components/graph.js +786 -0
- package/dist/components/illustration.d.ts +85 -0
- package/dist/components/illustration.js +165 -0
- package/dist/components/input-group.d.ts +127 -0
- package/dist/components/input-group.js +292 -0
- package/dist/components/input.d.ts +16 -0
- package/dist/components/input.js +25 -0
- package/dist/components/item.d.ts +64 -0
- package/dist/components/item.js +116 -0
- package/dist/components/kbd.d.ts +33 -0
- package/dist/components/kbd.js +38 -0
- package/dist/components/label.d.ts +12 -0
- package/dist/components/label.js +24 -0
- package/dist/components/layout.d.ts +136 -0
- package/dist/components/layout.js +162 -0
- package/dist/components/logo.d.ts +54 -0
- package/dist/components/logo.js +96 -0
- package/dist/components/menu.d.ts +60 -0
- package/dist/components/menu.js +138 -0
- package/dist/components/menubar.d.ts +62 -0
- package/dist/components/menubar.js +223 -0
- package/dist/components/message.d.ts +42 -0
- package/dist/components/message.js +56 -0
- package/dist/components/meter.d.ts +31 -0
- package/dist/components/meter.js +25 -0
- package/dist/components/native-select.d.ts +26 -0
- package/dist/components/native-select.js +35 -0
- package/dist/components/navigation-menu.d.ts +42 -0
- package/dist/components/navigation-menu.js +97 -0
- package/dist/components/number-field.d.ts +36 -0
- package/dist/components/number-field.js +153 -0
- package/dist/components/otp-field.d.ts +35 -0
- package/dist/components/otp-field.js +94 -0
- package/dist/components/pagination.d.ts +31 -0
- package/dist/components/pagination.js +70 -0
- package/dist/components/pdf-viewer.d.ts +69 -0
- package/dist/components/pdf-viewer.js +929 -0
- package/dist/components/popover.d.ts +33 -0
- package/dist/components/popover.js +48 -0
- package/dist/components/preview-card.d.ts +25 -0
- package/dist/components/preview-card.js +22 -0
- package/dist/components/progress.d.ts +27 -0
- package/dist/components/progress.js +23 -0
- package/dist/components/prompt-input.d.ts +131 -0
- package/dist/components/prompt-input.js +403 -0
- package/dist/components/quote.d.ts +22 -0
- package/dist/components/quote.js +15 -0
- package/dist/components/radio-group.d.ts +18 -0
- package/dist/components/radio-group.js +34 -0
- package/dist/components/reasoning.d.ts +31 -0
- package/dist/components/reasoning.js +70 -0
- package/dist/components/resizable.d.ts +38 -0
- package/dist/components/resizable.js +41 -0
- package/dist/components/response.d.ts +30 -0
- package/dist/components/response.js +538 -0
- package/dist/components/scroll-area.d.ts +33 -0
- package/dist/components/scroll-area.js +31 -0
- package/dist/components/select.d.ts +35 -0
- package/dist/components/select.js +60 -0
- package/dist/components/separator.d.ts +14 -0
- package/dist/components/separator.js +17 -0
- package/dist/components/sidebar.d.ts +147 -0
- package/dist/components/sidebar.js +489 -0
- package/dist/components/site-header.d.ts +59 -0
- package/dist/components/site-header.js +67 -0
- package/dist/components/skeleton.d.ts +31 -0
- package/dist/components/skeleton.js +29 -0
- package/dist/components/slider.d.ts +24 -0
- package/dist/components/slider.js +129 -0
- package/dist/components/sources.d.ts +25 -0
- package/dist/components/sources.js +35 -0
- package/dist/components/spinner.d.ts +36 -0
- package/dist/components/spinner.js +72 -0
- package/dist/components/suggestions.d.ts +20 -0
- package/dist/components/suggestions.js +18 -0
- package/dist/components/switch.d.ts +14 -0
- package/dist/components/switch.js +26 -0
- package/dist/components/table.d.ts +162 -0
- package/dist/components/table.js +758 -0
- package/dist/components/tabs.d.ts +25 -0
- package/dist/components/tabs.js +162 -0
- package/dist/components/tag.d.ts +41 -0
- package/dist/components/tag.js +88 -0
- package/dist/components/tags-input.d.ts +40 -0
- package/dist/components/tags-input.js +239 -0
- package/dist/components/textarea.d.ts +13 -0
- package/dist/components/textarea.js +16 -0
- package/dist/components/theme.d.ts +41 -0
- package/dist/components/theme.js +112 -0
- package/dist/components/time-field.d.ts +51 -0
- package/dist/components/time-field.js +437 -0
- package/dist/components/timeline.d.ts +76 -0
- package/dist/components/timeline.js +99 -0
- package/dist/components/toast.d.ts +72 -0
- package/dist/components/toast.js +196 -0
- package/dist/components/toggle-group.d.ts +41 -0
- package/dist/components/toggle-group.js +140 -0
- package/dist/components/toggle.d.ts +23 -0
- package/dist/components/toggle.js +35 -0
- package/dist/components/tool-call.d.ts +52 -0
- package/dist/components/tool-call.js +57 -0
- package/dist/components/toolbar.d.ts +17 -0
- package/dist/components/toolbar.js +34 -0
- package/dist/components/tooltip.d.ts +42 -0
- package/dist/components/tooltip.js +47 -0
- package/dist/components/tree.d.ts +75 -0
- package/dist/components/tree.js +636 -0
- package/dist/components/typography.d.ts +134 -0
- package/dist/components/typography.js +176 -0
- package/dist/components/video-player.d.ts +276 -0
- package/dist/components/video-player.js +1352 -0
- package/dist/components/whiteboard.d.ts +80 -0
- package/dist/components/whiteboard.js +389 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.js +86 -0
- package/dist/lib/cn.d.ts +20 -0
- package/dist/lib/cn.js +38 -0
- package/dist/lib/code-highlight.d.ts +31 -0
- package/dist/lib/code-highlight.js +24 -0
- package/dist/lib/code-theme.d.ts +19 -0
- package/dist/lib/code-theme.js +140 -0
- package/dist/lib/collapse-row.d.ts +9 -0
- package/dist/lib/collapse-row.js +129 -0
- package/dist/lib/digit-roll.d.ts +21 -0
- package/dist/lib/digit-roll.js +31 -0
- package/dist/lib/editorial-assets.d.ts +16 -0
- package/dist/lib/editorial-assets.js +56 -0
- package/dist/lib/figure/catalog.d.ts +127 -0
- package/dist/lib/figure/catalog.js +130 -0
- package/dist/lib/figure/figures/automation.d.ts +7 -0
- package/dist/lib/figure/figures/automation.js +143 -0
- package/dist/lib/figure/figures/bar-chart.d.ts +7 -0
- package/dist/lib/figure/figures/bar-chart.js +99 -0
- package/dist/lib/figure/figures/brackets-classic.d.ts +11 -0
- package/dist/lib/figure/figures/brackets-classic.js +170 -0
- package/dist/lib/figure/figures/brackets.d.ts +8 -0
- package/dist/lib/figure/figures/brackets.js +84 -0
- package/dist/lib/figure/figures/city.d.ts +7 -0
- package/dist/lib/figure/figures/city.js +93 -0
- package/dist/lib/figure/figures/conveyor.d.ts +7 -0
- package/dist/lib/figure/figures/conveyor.js +97 -0
- package/dist/lib/figure/figures/database.d.ts +7 -0
- package/dist/lib/figure/figures/database.js +65 -0
- package/dist/lib/figure/figures/documents.d.ts +7 -0
- package/dist/lib/figure/figures/documents.js +83 -0
- package/dist/lib/figure/figures/inbox.d.ts +7 -0
- package/dist/lib/figure/figures/inbox.js +92 -0
- package/dist/lib/figure/figures/laptop.d.ts +7 -0
- package/dist/lib/figure/figures/laptop.js +67 -0
- package/dist/lib/figure/figures/monitor.d.ts +7 -0
- package/dist/lib/figure/figures/monitor.js +59 -0
- package/dist/lib/figure/figures/pipeline.d.ts +8 -0
- package/dist/lib/figure/figures/pipeline.js +117 -0
- package/dist/lib/figure/figures/platform.d.ts +7 -0
- package/dist/lib/figure/figures/platform.js +117 -0
- package/dist/lib/figure/figures/server.d.ts +7 -0
- package/dist/lib/figure/figures/server.js +115 -0
- package/dist/lib/figure/figures/spreadsheet.d.ts +7 -0
- package/dist/lib/figure/figures/spreadsheet.js +87 -0
- package/dist/lib/figure/figures/timeline.d.ts +7 -0
- package/dist/lib/figure/figures/timeline.js +65 -0
- package/dist/lib/figure/kernel.d.ts +152 -0
- package/dist/lib/figure/kernel.js +576 -0
- package/dist/lib/figure/parts.d.ts +42 -0
- package/dist/lib/figure/parts.js +126 -0
- package/dist/lib/form-reset.d.ts +11 -0
- package/dist/lib/form-reset.js +22 -0
- package/dist/lib/glide.d.ts +53 -0
- package/dist/lib/glide.js +138 -0
- package/dist/lib/graph-layout.d.ts +58 -0
- package/dist/lib/graph-layout.js +200 -0
- package/dist/lib/illustration-drawings.d.ts +89 -0
- package/dist/lib/illustration-drawings.js +539 -0
- package/dist/lib/illustration-info.d.ts +37 -0
- package/dist/lib/illustration-info.js +22 -0
- package/dist/lib/illustration-library.d.ts +87 -0
- package/dist/lib/illustration-library.js +352 -0
- package/dist/lib/logo-geometry.d.ts +29 -0
- package/dist/lib/logo-geometry.js +67 -0
- package/dist/lib/markdown-guard.d.ts +16 -0
- package/dist/lib/markdown-guard.js +123 -0
- package/dist/lib/merge-refs.d.ts +10 -0
- package/dist/lib/merge-refs.js +26 -0
- package/dist/lib/motion.d.ts +6 -0
- package/dist/lib/motion.js +12 -0
- package/dist/lib/pdf-worker.d.ts +1 -0
- package/dist/lib/pdf-worker.js +6 -0
- package/dist/lib/pdf.d.ts +19 -0
- package/dist/lib/pdf.js +58 -0
- package/dist/lib/platform.d.ts +33 -0
- package/dist/lib/platform.js +68 -0
- package/dist/lib/room.d.ts +25 -0
- package/dist/lib/room.js +46 -0
- package/dist/lib/table-fit.d.ts +143 -0
- package/dist/lib/table-fit.js +577 -0
- package/dist/lib/theme-script.d.ts +18 -0
- package/dist/lib/theme-script.js +29 -0
- package/dist/styles/expressive.css +188 -0
- package/dist/styles/fonts.css +145 -0
- package/dist/styles/index.css +206 -0
- package/dist/styles/material.css +313 -0
- package/dist/styles/parts/ai.css +360 -0
- package/dist/styles/parts/brand.css +75 -0
- package/dist/styles/parts/controls.css +725 -0
- package/dist/styles/parts/data.css +222 -0
- package/dist/styles/parts/editorial.css +120 -0
- package/dist/styles/parts/feedback.css +273 -0
- package/dist/styles/parts/foundations.css +166 -0
- package/dist/styles/parts/graph.css +214 -0
- package/dist/styles/parts/inputs.css +261 -0
- package/dist/styles/parts/isometric.css +124 -0
- package/dist/styles/parts/navigation.css +232 -0
- package/dist/styles/parts/overlays.css +250 -0
- package/dist/styles/parts/pdf.css +154 -0
- package/dist/styles/parts/react-flow.css +519 -0
- package/dist/styles/parts/whiteboard.css +855 -0
- package/dist/styles/tokens.css +290 -0
- package/dist/vite.d.ts +116 -0
- package/dist/vite.js +129 -0
- package/package.json +188 -5
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
type RegionTag = "div" | "section" | "main" | "header" | "footer" | "article" | "aside" | "nav";
|
|
3
|
+
export interface ContainerProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
as?: RegionTag;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Container — the page column: centred, max 1280px, with 24px gutters, 40px at `sm` and
|
|
8
|
+
* 64px at `lg`.
|
|
9
|
+
*
|
|
10
|
+
* Use one per horizontal band of the page. The rule people break: nesting containers, which
|
|
11
|
+
* doubles the gutters. Put full-bleed art outside the Container and content inside it.
|
|
12
|
+
*/
|
|
13
|
+
export declare function Container({ as: Tag, className, ...props }: ContainerProps): import("react").JSX.Element;
|
|
14
|
+
export interface SectionProps extends Omit<HTMLAttributes<HTMLElement>, "title"> {
|
|
15
|
+
/** Short label shown as an eyebrow above the content: "The foundation". */
|
|
16
|
+
label?: ReactNode;
|
|
17
|
+
/** Step index shown before the label, zero-padded: `1` → "01 / THE FOUNDATION". */
|
|
18
|
+
index?: number | string;
|
|
19
|
+
/** The final section of a run: adds the closing rule underneath. */
|
|
20
|
+
last?: boolean;
|
|
21
|
+
as?: RegionTag;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Section — a band of content separated by a top hairline and `--section-pad` vertical
|
|
25
|
+
* padding (56–112px). The last section of a run also closes with a bottom rule.
|
|
26
|
+
*
|
|
27
|
+
* This is the default way to group content: a rule and whitespace, not a box.
|
|
28
|
+
* The rule people break: wrapping each section in a card or adding a background to tell
|
|
29
|
+
* them apart. The hairline already does that.
|
|
30
|
+
*/
|
|
31
|
+
export declare function Section({ label, index, last, as: Tag, className, children, ...props }: SectionProps): import("react").JSX.Element;
|
|
32
|
+
export interface GridProps extends HTMLAttributes<HTMLDivElement> {
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Grid — the 12-column page grid. Gutters follow the spacing rhythm: 16px, 24px at `sm`,
|
|
36
|
+
* 32px at `lg`; rows are 48px apart. Place children with `GridItem` or `col-span-*`.
|
|
37
|
+
*
|
|
38
|
+
* The rule people break: using it for a row of three buttons. Grid is for page layout; use
|
|
39
|
+
* flex and `gap` for controls.
|
|
40
|
+
*/
|
|
41
|
+
export declare function Grid({ className, ...props }: GridProps): import("react").JSX.Element;
|
|
42
|
+
type Span = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
43
|
+
export interface GridItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
44
|
+
/**
|
|
45
|
+
* Columns to span, mobile-first. A number spans at every width; an object sets breakpoints
|
|
46
|
+
* and each one inherits the one before it: `{ base: 12, md: 6, lg: 4 }`.
|
|
47
|
+
*/
|
|
48
|
+
span?: Span | {
|
|
49
|
+
base?: Span;
|
|
50
|
+
sm?: Span;
|
|
51
|
+
md?: Span;
|
|
52
|
+
lg?: Span;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* GridItem — a cell of `Grid` with a responsive column span. Defaults to the full row.
|
|
57
|
+
*/
|
|
58
|
+
export declare function GridItem({ span, className, style, ...props }: GridItemProps): import("react").JSX.Element;
|
|
59
|
+
export interface RailsProps extends HTMLAttributes<HTMLElement> {
|
|
60
|
+
as?: RegionTag;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Rails — two vertical hairlines framing a column, the drawing-board edge of zon.sh.
|
|
64
|
+
* Combine with `Container` to rule the page column, and with `Crosshairs` to mark where
|
|
65
|
+
* rails meet section rules.
|
|
66
|
+
*
|
|
67
|
+
* The rule people break: adding rails inside rails. One pair frames a page.
|
|
68
|
+
*/
|
|
69
|
+
export declare function Rails({ as: Tag, className, ...props }: RailsProps): import("react").JSX.Element;
|
|
70
|
+
export interface PlusMarkProps extends HTMLAttributes<HTMLSpanElement> {
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* PlusMark — an 11px crosshair of two 1px lines in `muted-foreground`, absolutely
|
|
74
|
+
* positioned. Place it on the intersection of two rules with `top-*`/`left-*`.
|
|
75
|
+
*
|
|
76
|
+
* Decorative: always `aria-hidden`, never interactive. The rule people break: scattering
|
|
77
|
+
* them as ornament. A mark sits where two lines meet, or not at all.
|
|
78
|
+
*/
|
|
79
|
+
export declare function PlusMark({ className, ...props }: PlusMarkProps): import("react").JSX.Element;
|
|
80
|
+
export interface CrosshairsProps extends HTMLAttributes<HTMLSpanElement> {
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Crosshairs — four PlusMarks on the corners of the nearest positioned ancestor, offset
|
|
84
|
+
* -6px so their centres sit on a 1px border's corner intersections.
|
|
85
|
+
*
|
|
86
|
+
* The parent must be `relative` (or otherwise positioned). The rule people break: using it
|
|
87
|
+
* on a rounded card. Crosshairs mark square regions; on a 20px radius they float in space.
|
|
88
|
+
*/
|
|
89
|
+
export declare function Crosshairs({ className, ...props }: CrosshairsProps): import("react").JSX.Element;
|
|
90
|
+
export interface BlueprintProps extends HTMLAttributes<HTMLDivElement> {
|
|
91
|
+
/** Grid cell size. A number is pixels. Default 64. */
|
|
92
|
+
cell?: number | string;
|
|
93
|
+
/** Light the grid under the pointer. Only ever active on hover-capable fine pointers. Default true. */
|
|
94
|
+
interactive?: boolean;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Blueprint — the drawing-board grid: faint `--grid-line` cells that brighten in a soft
|
|
98
|
+
* circle under the pointer. Content placed inside sits above the grid.
|
|
99
|
+
*
|
|
100
|
+
* The light follows the mouse only on hover-capable fine pointers with motion allowed;
|
|
101
|
+
* touch and reduced-motion users get the static grid. The rule people break: putting
|
|
102
|
+
* reading text over the lit area. Use it behind headlines and art, not paragraphs.
|
|
103
|
+
*/
|
|
104
|
+
export declare function Blueprint({ cell, interactive, className, style, children, onPointerMove, onPointerLeave, ...props }: BlueprintProps): import("react").JSX.Element;
|
|
105
|
+
export interface DotFieldProps extends HTMLAttributes<HTMLDivElement> {
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* DotField — a 24px field of 1px dots in `--grid-bright`, a quieter alternative to the
|
|
109
|
+
* blueprint grid. With no children it is a decorative layer and `aria-hidden`; make it
|
|
110
|
+
* `absolute inset-0` to sit behind content.
|
|
111
|
+
*
|
|
112
|
+
* The rule people break: stacking it with Blueprint. One texture per composition.
|
|
113
|
+
*/
|
|
114
|
+
export declare function DotField({ className, children, ...props }: DotFieldProps): import("react").JSX.Element;
|
|
115
|
+
export interface GrainProps extends HTMLAttributes<HTMLDivElement> {
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Grain — an animated film-grain overlay that fills its positioned parent. It is
|
|
119
|
+
* `aria-hidden`, ignores the pointer and holds still under reduced motion.
|
|
120
|
+
*
|
|
121
|
+
* Use it on dark or large expressive regions to take the digital edge off a flat ground.
|
|
122
|
+
* The rule people break: putting it over small text, where it costs contrast.
|
|
123
|
+
*/
|
|
124
|
+
export declare function Grain({ className, ...props }: GrainProps): import("react").JSX.Element;
|
|
125
|
+
export interface DividerProps extends HTMLAttributes<HTMLDivElement> {
|
|
126
|
+
/** Optional label centred on the rule, set as a mono eyebrow: "or", "Phase two". */
|
|
127
|
+
label?: ReactNode;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Divider — a horizontal hairline, optionally with a short centred mono label.
|
|
131
|
+
*
|
|
132
|
+
* The rule people break: dividing things that whitespace already separates. Prefer a
|
|
133
|
+
* `Section` for page bands; use Divider inside a column.
|
|
134
|
+
*/
|
|
135
|
+
export declare function Divider({ label, className, ...props }: DividerProps): import("react").JSX.Element;
|
|
136
|
+
export {};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useEffect, useRef, } from "react";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
/**
|
|
6
|
+
* Container — the page column: centred, max 1280px, with 24px gutters, 40px at `sm` and
|
|
7
|
+
* 64px at `lg`.
|
|
8
|
+
*
|
|
9
|
+
* Use one per horizontal band of the page. The rule people break: nesting containers, which
|
|
10
|
+
* doubles the gutters. Put full-bleed art outside the Container and content inside it.
|
|
11
|
+
*/
|
|
12
|
+
export function Container({ as: Tag = "div", className, ...props }) {
|
|
13
|
+
return _jsx(Tag, { "data-slot": "container", className: cn("container-page", className), ...props });
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Section — a band of content separated by a top hairline and `--section-pad` vertical
|
|
17
|
+
* padding (56–112px). The last section of a run also closes with a bottom rule.
|
|
18
|
+
*
|
|
19
|
+
* This is the default way to group content: a rule and whitespace, not a box.
|
|
20
|
+
* The rule people break: wrapping each section in a card or adding a background to tell
|
|
21
|
+
* them apart. The hairline already does that.
|
|
22
|
+
*/
|
|
23
|
+
export function Section({ label, index, last = false, as: Tag = "section", className, children, ...props }) {
|
|
24
|
+
const idx = typeof index === "number" ? String(index).padStart(2, "0") : index;
|
|
25
|
+
return (_jsxs(Tag, { "data-slot": "section", "data-last": last || undefined, className: cn("py-(--section-pad) hairline", last && "border-b border-b-border/70", className), ...props, children: [(label != null || idx != null) && (_jsxs("p", { "data-slot": "section-label", className: "mb-8 eyebrow break-words md:mb-12", children: [idx != null && (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-foreground tabular-nums", children: idx }), label != null && _jsx("span", { "aria-hidden": "true", children: " / " })] })), label] })), children] }));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Grid — the 12-column page grid. Gutters follow the spacing rhythm: 16px, 24px at `sm`,
|
|
29
|
+
* 32px at `lg`; rows are 48px apart. Place children with `GridItem` or `col-span-*`.
|
|
30
|
+
*
|
|
31
|
+
* The rule people break: using it for a row of three buttons. Grid is for page layout; use
|
|
32
|
+
* flex and `gap` for controls.
|
|
33
|
+
*/
|
|
34
|
+
export function Grid({ className, ...props }) {
|
|
35
|
+
return (_jsx("div", { "data-slot": "grid", className: cn("grid grid-cols-12 gap-x-4 gap-y-12 sm:gap-x-6 lg:gap-x-8", className), ...props }));
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* GridItem — a cell of `Grid` with a responsive column span. Defaults to the full row.
|
|
39
|
+
*/
|
|
40
|
+
export function GridItem({ span = 12, className, style, ...props }) {
|
|
41
|
+
const s = typeof span === "number" ? { base: span } : span;
|
|
42
|
+
const base = s.base ?? 12;
|
|
43
|
+
const sm = s.sm ?? base;
|
|
44
|
+
const md = s.md ?? sm;
|
|
45
|
+
const lg = s.lg ?? md;
|
|
46
|
+
return (_jsx("div", { "data-slot": "grid-item", className: cn("col-span-(--span) min-w-0 sm:col-span-(--span-sm) md:col-span-(--span-md) lg:col-span-(--span-lg)", className), style: { "--span": base, "--span-sm": sm, "--span-md": md, "--span-lg": lg, ...style }, ...props }));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Rails — two vertical hairlines framing a column, the drawing-board edge of zon.sh.
|
|
50
|
+
* Combine with `Container` to rule the page column, and with `Crosshairs` to mark where
|
|
51
|
+
* rails meet section rules.
|
|
52
|
+
*
|
|
53
|
+
* The rule people break: adding rails inside rails. One pair frames a page.
|
|
54
|
+
*/
|
|
55
|
+
export function Rails({ as: Tag = "div", className, ...props }) {
|
|
56
|
+
return _jsx(Tag, { "data-slot": "rails", className: cn("rails", className), ...props });
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* PlusMark — an 11px crosshair of two 1px lines in `muted-foreground`, absolutely
|
|
60
|
+
* positioned. Place it on the intersection of two rules with `top-*`/`left-*`.
|
|
61
|
+
*
|
|
62
|
+
* Decorative: always `aria-hidden`, never interactive. The rule people break: scattering
|
|
63
|
+
* them as ornament. A mark sits where two lines meet, or not at all.
|
|
64
|
+
*/
|
|
65
|
+
export function PlusMark({ className, ...props }) {
|
|
66
|
+
return (_jsxs("span", { "data-slot": "plus-mark", "aria-hidden": "true", className: cn("pointer-events-none absolute size-[11px] text-muted-foreground", className), ...props, children: [_jsx("span", { className: "absolute inset-x-0 top-[5px] h-px bg-current" }), _jsx("span", { className: "absolute inset-y-0 left-[5px] w-px bg-current" })] }));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Crosshairs — four PlusMarks on the corners of the nearest positioned ancestor, offset
|
|
70
|
+
* -6px so their centres sit on a 1px border's corner intersections.
|
|
71
|
+
*
|
|
72
|
+
* The parent must be `relative` (or otherwise positioned). The rule people break: using it
|
|
73
|
+
* on a rounded card. Crosshairs mark square regions; on a 20px radius they float in space.
|
|
74
|
+
*/
|
|
75
|
+
export function Crosshairs({ className, ...props }) {
|
|
76
|
+
return (_jsxs("span", { "data-slot": "crosshairs", "aria-hidden": "true", className: cn("pointer-events-none absolute inset-0 z-[1]", className), ...props, children: [_jsx(PlusMark, { className: "-top-[6px] -left-[6px]" }), _jsx(PlusMark, { className: "-top-[6px] -right-[6px]" }), _jsx(PlusMark, { className: "-bottom-[6px] -left-[6px]" }), _jsx(PlusMark, { className: "-right-[6px] -bottom-[6px]" })] }));
|
|
77
|
+
}
|
|
78
|
+
/* ── Blueprint ─────────────────────────────────────────────────────────────── */
|
|
79
|
+
const LIT_QUERY = "(hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference)";
|
|
80
|
+
/**
|
|
81
|
+
* Blueprint — the drawing-board grid: faint `--grid-line` cells that brighten in a soft
|
|
82
|
+
* circle under the pointer. Content placed inside sits above the grid.
|
|
83
|
+
*
|
|
84
|
+
* The light follows the mouse only on hover-capable fine pointers with motion allowed;
|
|
85
|
+
* touch and reduced-motion users get the static grid. The rule people break: putting
|
|
86
|
+
* reading text over the lit area. Use it behind headlines and art, not paragraphs.
|
|
87
|
+
*/
|
|
88
|
+
export function Blueprint({ cell, interactive = true, className, style, children, onPointerMove, onPointerLeave, ...props }) {
|
|
89
|
+
const ref = useRef(null);
|
|
90
|
+
const enabled = useRef(false);
|
|
91
|
+
const frame = useRef(0);
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
if (!interactive || typeof window === "undefined" || !window.matchMedia)
|
|
94
|
+
return;
|
|
95
|
+
const mq = window.matchMedia(LIT_QUERY);
|
|
96
|
+
const sync = () => {
|
|
97
|
+
enabled.current = mq.matches;
|
|
98
|
+
if (!mq.matches && ref.current)
|
|
99
|
+
ref.current.dataset.lit = "false";
|
|
100
|
+
};
|
|
101
|
+
sync();
|
|
102
|
+
mq.addEventListener("change", sync);
|
|
103
|
+
return () => {
|
|
104
|
+
mq.removeEventListener("change", sync);
|
|
105
|
+
cancelAnimationFrame(frame.current);
|
|
106
|
+
};
|
|
107
|
+
}, [interactive]);
|
|
108
|
+
const handleMove = useCallback((e) => {
|
|
109
|
+
onPointerMove?.(e);
|
|
110
|
+
const el = ref.current;
|
|
111
|
+
if (!interactive || !enabled.current || !el || e.pointerType !== "mouse")
|
|
112
|
+
return;
|
|
113
|
+
const { clientX, clientY } = e;
|
|
114
|
+
cancelAnimationFrame(frame.current);
|
|
115
|
+
frame.current = requestAnimationFrame(() => {
|
|
116
|
+
const r = el.getBoundingClientRect();
|
|
117
|
+
el.style.setProperty("--mx", `${clientX - r.left}px`);
|
|
118
|
+
el.style.setProperty("--my", `${clientY - r.top}px`);
|
|
119
|
+
el.dataset.lit = "true";
|
|
120
|
+
});
|
|
121
|
+
}, [interactive, onPointerMove]);
|
|
122
|
+
const handleLeave = useCallback((e) => {
|
|
123
|
+
onPointerLeave?.(e);
|
|
124
|
+
cancelAnimationFrame(frame.current);
|
|
125
|
+
if (ref.current)
|
|
126
|
+
ref.current.dataset.lit = "false";
|
|
127
|
+
}, [onPointerLeave]);
|
|
128
|
+
const cellValue = typeof cell === "number" ? `${cell}px` : cell;
|
|
129
|
+
return (_jsx("div", { ref: ref, "data-slot": "blueprint", "data-lit": "false", "aria-hidden": children == null ? true : undefined, className: cn("blueprint", className), style: cellValue ? { "--cell": cellValue, ...style } : style, onPointerMove: handleMove, onPointerLeave: handleLeave, ...props, children: children }));
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* DotField — a 24px field of 1px dots in `--grid-bright`, a quieter alternative to the
|
|
133
|
+
* blueprint grid. With no children it is a decorative layer and `aria-hidden`; make it
|
|
134
|
+
* `absolute inset-0` to sit behind content.
|
|
135
|
+
*
|
|
136
|
+
* The rule people break: stacking it with Blueprint. One texture per composition.
|
|
137
|
+
*/
|
|
138
|
+
export function DotField({ className, children, ...props }) {
|
|
139
|
+
return (_jsx("div", { "data-slot": "dot-field", "aria-hidden": children == null ? true : undefined, className: cn("dots", children == null && "pointer-events-none", className), ...props, children: children }));
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Grain — an animated film-grain overlay that fills its positioned parent. It is
|
|
143
|
+
* `aria-hidden`, ignores the pointer and holds still under reduced motion.
|
|
144
|
+
*
|
|
145
|
+
* Use it on dark or large expressive regions to take the digital edge off a flat ground.
|
|
146
|
+
* The rule people break: putting it over small text, where it costs contrast.
|
|
147
|
+
*/
|
|
148
|
+
export function Grain({ className, ...props }) {
|
|
149
|
+
return _jsx("div", { "data-slot": "grain", "aria-hidden": "true", className: cn("grain", className), ...props });
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Divider — a horizontal hairline, optionally with a short centred mono label.
|
|
153
|
+
*
|
|
154
|
+
* The rule people break: dividing things that whitespace already separates. Prefer a
|
|
155
|
+
* `Section` for page bands; use Divider inside a column.
|
|
156
|
+
*/
|
|
157
|
+
export function Divider({ label, className, ...props }) {
|
|
158
|
+
if (label == null) {
|
|
159
|
+
return (_jsx("div", { "data-slot": "divider", role: "separator", "aria-orientation": "horizontal", className: cn("w-full hairline", className), ...props }));
|
|
160
|
+
}
|
|
161
|
+
return (_jsxs("div", { "data-slot": "divider", className: cn("flex w-full items-center gap-4", className), ...props, children: [_jsx("span", { "aria-hidden": "true", className: "flex-1 hairline" }), _jsx("span", { "data-slot": "divider-label", className: "shrink-0 eyebrow", children: label }), _jsx("span", { "aria-hidden": "true", className: "flex-1 hairline" })] }));
|
|
162
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
import type { SVGProps } from "react";
|
|
3
|
+
export interface LogoArtProps extends Omit<SVGProps<SVGSVGElement>, "width" | "height"> {
|
|
4
|
+
/** Visible artwork height in px. The width follows from the original proportions. Default 24. */
|
|
5
|
+
size?: number;
|
|
6
|
+
/** Accessible name. Without it the artwork is decorative (`aria-hidden`). */
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* LogoMark — the zon mark: a crescent moon, flat and in one colour, its opening turned 14°. It
|
|
11
|
+
* takes `--logo`: the ink on a light ground, the light on a dark one.
|
|
12
|
+
*
|
|
13
|
+
* `size` is the moon's height. Start at 16px and leave a quarter of its height clear around it.
|
|
14
|
+
* The rule people break: recolouring it, or rotating it further. Pass `size`; never set width and
|
|
15
|
+
* height independently.
|
|
16
|
+
*/
|
|
17
|
+
export declare function LogoMark({ size, label, className, ...props }: LogoArtProps): import("react").JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* LogoLeft — the left bracket, kept as art (the Spinner's `brackets` face and the bracket
|
|
20
|
+
* illustrations draw on it). Identical in height, stroke and baseline to `LogoRight` at the same
|
|
21
|
+
* `size`, in `currentColor`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function LogoLeft({ size, ...props }: LogoArtProps): import("react").JSX.Element;
|
|
24
|
+
/** LogoRight — the right bracket, kept as art. Identical in height, stroke and baseline to `LogoLeft`. */
|
|
25
|
+
export declare function LogoRight({ size, ...props }: LogoArtProps): import("react").JSX.Element;
|
|
26
|
+
export interface LogoProps extends useRender.ComponentProps<"a"> {
|
|
27
|
+
/**
|
|
28
|
+
* `default` shows the mark and the wordmark. `compact` shows the mark only; on hover or
|
|
29
|
+
* keyboard focus the wordmark slides out beside it.
|
|
30
|
+
*/
|
|
31
|
+
variant?: "default" | "compact";
|
|
32
|
+
/** The mark's height in px. Default 20 — a site header. */
|
|
33
|
+
size?: number;
|
|
34
|
+
/**
|
|
35
|
+
* A product lockup: `product="ui"` sets the wordmark as "zon/ui". Pass only the product's own
|
|
36
|
+
* name — the "zon/" is added for you.
|
|
37
|
+
*/
|
|
38
|
+
product?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Compact only: hold the wordmark out, exactly as hover and focus do. For an intro or a demo
|
|
41
|
+
* that opens the lockup on its own schedule.
|
|
42
|
+
*/
|
|
43
|
+
open?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Logo — the lockup: the zon mark and the wordmark **zon** in Licht Light. With `href` it renders a
|
|
47
|
+
* link; pass `render` to use a router link instead.
|
|
48
|
+
*
|
|
49
|
+
* `variant="compact"` is the header logo: the mark only, the name sliding out on hover and focus,
|
|
50
|
+
* or while `open` is set. The name stays in the accessibility tree in both variants. With
|
|
51
|
+
* `product`, the wordmark names the product: "zon/ui".
|
|
52
|
+
* The rule people break: setting the wordmark bold, or in mono. It is Licht Light, as every headline.
|
|
53
|
+
*/
|
|
54
|
+
export declare function Logo({ variant, size, product, open, render, ref, className, style, ...props }: LogoProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
import { bracketGeometry, useDevicePixelRatio } from "../lib/logo-geometry.js";
|
|
6
|
+
/*
|
|
7
|
+
* The zon mark is the crescent from zon.sh/logo.svg: the moon less an offset circle, flat and in
|
|
8
|
+
* one colour, its opening turned 14°. It is drawn in --logo, the ink on light grounds and the
|
|
9
|
+
* light on dark ones.
|
|
10
|
+
*
|
|
11
|
+
* The brackets (LogoLeft, LogoRight) are kept as art: ../lib/logo-geometry holds their exact
|
|
12
|
+
* rectangles, snapped to whole device pixels.
|
|
13
|
+
*/
|
|
14
|
+
/** Space between the mark and the wordmark, as a fraction of the mark's height. */
|
|
15
|
+
const GAP = 0.42;
|
|
16
|
+
/** Wordmark size relative to the mark. Licht, trimmed to its x-height, centred on the moon. */
|
|
17
|
+
const WORDMARK = 1.12;
|
|
18
|
+
/**
|
|
19
|
+
* The crescent in its 32-unit canvas: the moon (radius 12, centred) less a circle of radius 9.312
|
|
20
|
+
* moved 2.812 toward the opening, so the light is 5.5 wide at its widest and the opening 30°, all
|
|
21
|
+
* turned 14°. The moon spans 4–28 on both axes, which is the mark's box.
|
|
22
|
+
*/
|
|
23
|
+
const CRESCENT = "M16.209 4.002A12 12 0 1 1 10.182 5.505A9.312 9.312 0 1 0 16.209 4.002Z";
|
|
24
|
+
const px = (n) => Math.round(n * 1000) / 1000;
|
|
25
|
+
const labelled = (label) => (label ? { role: "img", "aria-label": label } : { "aria-hidden": true });
|
|
26
|
+
/**
|
|
27
|
+
* LogoMark — the zon mark: a crescent moon, flat and in one colour, its opening turned 14°. It
|
|
28
|
+
* takes `--logo`: the ink on a light ground, the light on a dark one.
|
|
29
|
+
*
|
|
30
|
+
* `size` is the moon's height. Start at 16px and leave a quarter of its height clear around it.
|
|
31
|
+
* The rule people break: recolouring it, or rotating it further. Pass `size`; never set width and
|
|
32
|
+
* height independently.
|
|
33
|
+
*/
|
|
34
|
+
export function LogoMark({ size = 24, label, className, ...props }) {
|
|
35
|
+
return (_jsx("svg", { "data-slot": "logo-mark", xmlns: "http://www.w3.org/2000/svg", viewBox: "4 4 24 24", width: px(size), height: px(size), fill: "var(--logo)", focusable: "false", ...labelled(label), className: cn("block shrink-0", className), ...props, children: _jsx("path", { d: CRESCENT }) }));
|
|
36
|
+
}
|
|
37
|
+
function Bracket({ slot, w, h, rects, label, className, ...props }) {
|
|
38
|
+
return (_jsx("svg", { "data-slot": slot, xmlns: "http://www.w3.org/2000/svg", viewBox: `0 0 ${px(w)} ${px(h)}`, width: px(w), height: px(h), fill: "currentColor", shapeRendering: "crispEdges", focusable: "false", ...labelled(label), className: cn("block shrink-0", className), ...props, children: rects.map(([x, y, rw, rh]) => (_jsx("rect", { x: px(x), y: px(y), width: px(rw), height: px(rh) }, `${x},${y},${rw}`))) }));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* LogoLeft — the left bracket, kept as art (the Spinner's `brackets` face and the bracket
|
|
42
|
+
* illustrations draw on it). Identical in height, stroke and baseline to `LogoRight` at the same
|
|
43
|
+
* `size`, in `currentColor`.
|
|
44
|
+
*/
|
|
45
|
+
export function LogoLeft({ size = 24, ...props }) {
|
|
46
|
+
const g = bracketGeometry(size, useDevicePixelRatio());
|
|
47
|
+
return _jsx(Bracket, { slot: "logo-left", w: g.w, h: g.h, rects: g.left, ...props });
|
|
48
|
+
}
|
|
49
|
+
/** LogoRight — the right bracket, kept as art. Identical in height, stroke and baseline to `LogoLeft`. */
|
|
50
|
+
export function LogoRight({ size = 24, ...props }) {
|
|
51
|
+
const g = bracketGeometry(size, useDevicePixelRatio());
|
|
52
|
+
return _jsx(Bracket, { slot: "logo-right", w: g.w, h: g.h, rects: g.right, ...props });
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Logo — the lockup: the zon mark and the wordmark **zon** in Licht Light. With `href` it renders a
|
|
56
|
+
* link; pass `render` to use a router link instead.
|
|
57
|
+
*
|
|
58
|
+
* `variant="compact"` is the header logo: the mark only, the name sliding out on hover and focus,
|
|
59
|
+
* or while `open` is set. The name stays in the accessibility tree in both variants. With
|
|
60
|
+
* `product`, the wordmark names the product: "zon/ui".
|
|
61
|
+
* The rule people break: setting the wordmark bold, or in mono. It is Licht Light, as every headline.
|
|
62
|
+
*/
|
|
63
|
+
export function Logo({ variant = "default", size = 20, product, open = false, render, ref, className, style, ...props }) {
|
|
64
|
+
const compact = variant === "compact";
|
|
65
|
+
const vars = { "--logo-gap": `${px(size * GAP)}px`, ...style };
|
|
66
|
+
const reveal = "duration-(--duration-reveal) ease-(--ease) motion-reduce:transition-none";
|
|
67
|
+
const children = (_jsxs(_Fragment, { children: [_jsx(LogoMark, { size: size }), _jsx("span", { "data-slot": "logo-wordmark-track", className: cn("grid", compact
|
|
68
|
+
? [
|
|
69
|
+
"grid-cols-[0fr] transition-[grid-template-columns,padding]",
|
|
70
|
+
"group-hover/logo:grid-cols-[1fr] group-hover/logo:ps-(--logo-gap)",
|
|
71
|
+
"group-focus-visible/logo:grid-cols-[1fr] group-focus-visible/logo:ps-(--logo-gap)",
|
|
72
|
+
"group-data-open/logo:grid-cols-[1fr] group-data-open/logo:ps-(--logo-gap)",
|
|
73
|
+
reveal,
|
|
74
|
+
]
|
|
75
|
+
: "grid-cols-[1fr] ps-(--logo-gap)"), children: _jsx("span", { className: "min-w-0 overflow-x-clip", children: _jsx("span", { "data-slot": "logo-wordmark", className: cn(
|
|
76
|
+
// Licht Light, like every headline. Trimmed to its x-height, so the lowercase
|
|
77
|
+
// letters sit centred on the moon.
|
|
78
|
+
"block font-heading leading-none font-light tracking-[-0.02em] whitespace-nowrap [text-box:trim-both_ex_alphabetic]", compact && [
|
|
79
|
+
"opacity-0 transition-opacity group-hover/logo:opacity-100 group-focus-visible/logo:opacity-100 group-data-open/logo:opacity-100",
|
|
80
|
+
reveal,
|
|
81
|
+
]), style: { fontSize: `${px(size * WORDMARK)}px` }, children: product ? `zon/${product}` : "zon" }) }) })] }));
|
|
82
|
+
return useRender({
|
|
83
|
+
defaultTagName: props.href ? "a" : "span",
|
|
84
|
+
render,
|
|
85
|
+
ref,
|
|
86
|
+
props: {
|
|
87
|
+
...props,
|
|
88
|
+
"data-slot": "logo",
|
|
89
|
+
"data-variant": variant,
|
|
90
|
+
"data-open": compact && open ? "" : undefined,
|
|
91
|
+
className: cn("group/logo inline-flex shrink-0 items-center text-foreground no-underline focus-ring select-none", className),
|
|
92
|
+
style: vars,
|
|
93
|
+
children,
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Menu as BaseMenu } from "@base-ui/react/menu";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { type MenuFrameProps } from "./_overlay.js";
|
|
4
|
+
/**
|
|
5
|
+
* Menu — a list of actions opened from a button: "Rename", "Duplicate", "Delete project".
|
|
6
|
+
* Menu material at 12px, items at 7px and 38px tall, the highlighted item raised like `SelectItem`.
|
|
7
|
+
*
|
|
8
|
+
* The rule people break: using a menu to pick a value. A menu *does* things; to choose a value
|
|
9
|
+
* use `Select` (or `MenuRadioGroup` when the choice is a view setting next to other actions).
|
|
10
|
+
*/
|
|
11
|
+
export declare function Menu(props: BaseMenu.Root.Props): React.JSX.Element;
|
|
12
|
+
/** Opens the menu. Compose with a button: `render={<Button variant="secondary" />}`. */
|
|
13
|
+
export declare function MenuTrigger({ ref, ...props }: BaseMenu.Trigger.Props): React.JSX.Element;
|
|
14
|
+
export type MenuContentProps = Omit<MenuFrameProps, "slot">;
|
|
15
|
+
/** Portal + Positioner + Popup. Opens below the trigger, aligned to its start edge. */
|
|
16
|
+
export declare function MenuContent({ align, sideOffset, ...props }: MenuContentProps): React.JSX.Element;
|
|
17
|
+
declare const itemVariants: {
|
|
18
|
+
readonly default: "";
|
|
19
|
+
/** Destructive ink for irreversible actions. Stays monochrome on the surface. */
|
|
20
|
+
readonly destructive: "text-destructive data-highlighted:text-destructive [&>svg]:text-destructive data-highlighted:[&>svg]:text-destructive";
|
|
21
|
+
};
|
|
22
|
+
export type MenuItemVariant = keyof typeof itemVariants;
|
|
23
|
+
export interface MenuItemProps extends BaseMenu.Item.Props {
|
|
24
|
+
variant?: MenuItemVariant;
|
|
25
|
+
}
|
|
26
|
+
/** One action. Put a 16px lucide icon first and a `MenuShortcut` last if it has one. */
|
|
27
|
+
export declare function MenuItem({ variant, className, ...props }: MenuItemProps): React.JSX.Element;
|
|
28
|
+
/** A menu item that is a link. Use for navigation so middle-click and "open in new tab" work. */
|
|
29
|
+
export declare function MenuLinkItem({ className, ...props }: BaseMenu.LinkItem.Props): React.JSX.Element;
|
|
30
|
+
/** A toggle inside a menu ("Show grid"). The check sits at the trailing edge, like `SelectItem`. */
|
|
31
|
+
export declare function MenuCheckboxItem({ className, children, ...props }: BaseMenu.CheckboxItem.Props): React.JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* Groups `MenuRadioItem`s that share one value (`value` / `onValueChange`). The group draws one
|
|
34
|
+
* dot, which glides up or down to the option picked; it appears in place when the menu opens.
|
|
35
|
+
*/
|
|
36
|
+
export declare function MenuRadioGroup({ className, children, ref, ...props }: BaseMenu.RadioGroup.Props): React.JSX.Element;
|
|
37
|
+
/** One option of a `MenuRadioGroup`. The group's dot sits at the current option's trailing edge. */
|
|
38
|
+
export declare function MenuRadioItem({ className, children, ...props }: BaseMenu.RadioItem.Props): React.JSX.Element;
|
|
39
|
+
/** Groups related items so assistive tech announces them together. Label it with `MenuGroupLabel`. */
|
|
40
|
+
export declare function MenuGroup(props: BaseMenu.Group.Props): React.JSX.Element;
|
|
41
|
+
/** An eyebrow above a group: 11px mono, uppercase, tracked. */
|
|
42
|
+
export declare function MenuGroupLabel({ className, ...props }: BaseMenu.GroupLabel.Props): React.JSX.Element;
|
|
43
|
+
/** A hairline between groups of items. */
|
|
44
|
+
export declare function MenuSeparator({ className, ...props }: BaseMenu.Separator.Props): React.JSX.Element;
|
|
45
|
+
/** A keyboard hint at the trailing edge of an item: mono, muted. Decorative — wire the keys yourself. */
|
|
46
|
+
export interface MenuShortcutProps extends React.ComponentProps<"span"> {
|
|
47
|
+
/**
|
|
48
|
+
* The shortcut as keys, written for the device: `["mod", "D"]` reads ⌘D on Apple devices and
|
|
49
|
+
* Ctrl+D elsewhere, and is hidden on a touch-only phone or tablet. Or pass the text as children.
|
|
50
|
+
*/
|
|
51
|
+
keys?: string[];
|
|
52
|
+
}
|
|
53
|
+
export declare function MenuShortcut({ keys, className, children, ...props }: MenuShortcutProps): React.JSX.Element | null;
|
|
54
|
+
/** A nested menu. Holds a `MenuSubTrigger` and a `MenuSubContent`. */
|
|
55
|
+
export declare const MenuSub: typeof BaseMenu.SubmenuRoot;
|
|
56
|
+
/** The item that opens a submenu; shows a chevron and stays raised while its submenu is open. */
|
|
57
|
+
export declare function MenuSubTrigger({ className, children, ...props }: BaseMenu.SubmenuTrigger.Props): React.JSX.Element;
|
|
58
|
+
/** The submenu popup. Opens to the inline end, its first item level with the trigger. */
|
|
59
|
+
export declare function MenuSubContent({ sideOffset, alignOffset, ...props }: MenuContentProps): React.JSX.Element;
|
|
60
|
+
export {};
|