@zonsh/ui 0.0.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +43 -0
- package/README.md +81 -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/bottom-nav.d.ts +86 -0
- package/dist/components/bottom-nav.js +175 -0
- package/dist/components/breadcrumb.d.ts +31 -0
- package/dist/components/breadcrumb.js +37 -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 +179 -0
- package/dist/components/card.d.ts +42 -0
- package/dist/components/card.js +76 -0
- package/dist/components/carousel.d.ts +109 -0
- package/dist/components/carousel.js +231 -0
- package/dist/components/chart.d.ts +189 -0
- package/dist/components/chart.js +323 -0
- package/dist/components/checkbox.d.ts +23 -0
- package/dist/components/checkbox.js +43 -0
- package/dist/components/code-block.d.ts +55 -0
- package/dist/components/code-block.js +100 -0
- package/dist/components/collapsible.d.ts +20 -0
- package/dist/components/collapsible.js +32 -0
- package/dist/components/color-picker.d.ts +107 -0
- package/dist/components/color-picker.js +428 -0
- package/dist/components/combobox.d.ts +99 -0
- package/dist/components/combobox.js +172 -0
- package/dist/components/command.d.ts +132 -0
- package/dist/components/command.js +257 -0
- package/dist/components/context-menu.d.ts +29 -0
- package/dist/components/context-menu.js +35 -0
- package/dist/components/conversation.d.ts +36 -0
- package/dist/components/conversation.js +303 -0
- package/dist/components/copy-button.d.ts +55 -0
- package/dist/components/copy-button.js +133 -0
- package/dist/components/data-table.d.ts +235 -0
- package/dist/components/data-table.js +655 -0
- package/dist/components/date-picker.d.ts +160 -0
- package/dist/components/date-picker.js +338 -0
- package/dist/components/dialog.d.ts +57 -0
- package/dist/components/dialog.js +95 -0
- package/dist/components/direction.d.ts +16 -0
- package/dist/components/direction.js +18 -0
- package/dist/components/drawer.d.ts +69 -0
- package/dist/components/drawer.js +79 -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 +34 -0
- package/dist/components/field.js +81 -0
- package/dist/components/file-drop.d.ts +77 -0
- package/dist/components/file-drop.js +258 -0
- package/dist/components/filter-bar.d.ts +153 -0
- package/dist/components/filter-bar.js +334 -0
- package/dist/components/form.d.ts +35 -0
- package/dist/components/form.js +56 -0
- package/dist/components/graph.d.ts +146 -0
- package/dist/components/graph.js +825 -0
- package/dist/components/illustration.d.ts +85 -0
- package/dist/components/illustration.js +165 -0
- package/dist/components/input-group.d.ts +138 -0
- package/dist/components/input-group.js +312 -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 +50 -0
- package/dist/components/kbd.js +45 -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/lightbox.d.ts +100 -0
- package/dist/components/lightbox.js +439 -0
- package/dist/components/locale.d.ts +44 -0
- package/dist/components/locale.js +37 -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 +140 -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 +59 -0
- package/dist/components/meter.d.ts +31 -0
- package/dist/components/meter.js +27 -0
- package/dist/components/money-input.d.ts +80 -0
- package/dist/components/money-input.js +253 -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 +55 -0
- package/dist/components/number-field.js +164 -0
- package/dist/components/otp-field.d.ts +48 -0
- package/dist/components/otp-field.js +102 -0
- package/dist/components/pagination.d.ts +37 -0
- package/dist/components/pagination.js +81 -0
- package/dist/components/pdf-viewer.d.ts +134 -0
- package/dist/components/pdf-viewer.js +996 -0
- package/dist/components/phone-input.d.ts +79 -0
- package/dist/components/phone-input.js +282 -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 +25 -0
- package/dist/components/prompt-input.d.ts +156 -0
- package/dist/components/prompt-input.js +415 -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/rating.d.ts +73 -0
- package/dist/components/rating.js +124 -0
- package/dist/components/reasoning.d.ts +46 -0
- package/dist/components/reasoning.js +73 -0
- package/dist/components/resizable.d.ts +47 -0
- package/dist/components/resizable.js +44 -0
- package/dist/components/response.d.ts +41 -0
- package/dist/components/response.js +566 -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 +71 -0
- package/dist/components/separator.d.ts +14 -0
- package/dist/components/separator.js +17 -0
- package/dist/components/sidebar.d.ts +163 -0
- package/dist/components/sidebar.js +505 -0
- package/dist/components/site-header.d.ts +93 -0
- package/dist/components/site-header.js +121 -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 +131 -0
- package/dist/components/sortable.d.ts +178 -0
- package/dist/components/sortable.js +1258 -0
- package/dist/components/sources.d.ts +40 -0
- package/dist/components/sources.js +42 -0
- package/dist/components/spinner.d.ts +48 -0
- package/dist/components/spinner.js +75 -0
- package/dist/components/stat.d.ts +91 -0
- package/dist/components/stat.js +141 -0
- package/dist/components/stepper.d.ts +71 -0
- package/dist/components/stepper.js +101 -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 +172 -0
- package/dist/components/table.js +895 -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 +56 -0
- package/dist/components/tags-input.js +271 -0
- package/dist/components/textarea.d.ts +13 -0
- package/dist/components/textarea.js +16 -0
- package/dist/components/theme.d.ts +55 -0
- package/dist/components/theme.js +120 -0
- package/dist/components/time-field.d.ts +70 -0
- package/dist/components/time-field.js +450 -0
- package/dist/components/timeline.d.ts +92 -0
- package/dist/components/timeline.js +108 -0
- package/dist/components/tippy.d.ts +48 -0
- package/dist/components/tippy.js +648 -0
- package/dist/components/toast.d.ts +88 -0
- package/dist/components/toast.js +205 -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 +63 -0
- package/dist/components/tool-call.js +68 -0
- package/dist/components/toolbar.d.ts +17 -0
- package/dist/components/toolbar.js +39 -0
- package/dist/components/tooltip.d.ts +42 -0
- package/dist/components/tooltip.js +47 -0
- package/dist/components/tour.d.ts +127 -0
- package/dist/components/tour.js +648 -0
- package/dist/components/tree.d.ts +75 -0
- package/dist/components/tree.js +649 -0
- package/dist/components/typography.d.ts +134 -0
- package/dist/components/typography.js +176 -0
- package/dist/components/video-player.d.ts +284 -0
- package/dist/components/video-player.js +1392 -0
- package/dist/illustration.d.ts +2 -0
- package/dist/illustration.js +7 -0
- package/dist/index.d.ts +93 -0
- package/dist/index.js +94 -0
- package/dist/lib/cn.d.ts +20 -0
- package/dist/lib/cn.js +38 -0
- package/dist/lib/code-highlight.d.ts +18 -0
- package/dist/lib/code-highlight.js +174 -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/field-errors.d.ts +28 -0
- package/dist/lib/field-errors.js +24 -0
- package/dist/lib/field-value.d.ts +13 -0
- package/dist/lib/field-value.js +44 -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 +209 -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/money.d.ts +73 -0
- package/dist/lib/money.js +343 -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/phone-countries.d.ts +1 -0
- package/dist/lib/phone-countries.js +281 -0
- package/dist/lib/phone.d.ts +90 -0
- package/dist/lib/phone.js +286 -0
- package/dist/lib/platform.d.ts +38 -0
- package/dist/lib/platform.js +75 -0
- package/dist/lib/room.d.ts +25 -0
- package/dist/lib/room.js +46 -0
- package/dist/lib/row-index.d.ts +15 -0
- package/dist/lib/row-index.js +136 -0
- package/dist/lib/table-fit.d.ts +143 -0
- package/dist/lib/table-fit.js +596 -0
- package/dist/lib/theme-script.d.ts +31 -0
- package/dist/lib/theme-script.js +49 -0
- package/dist/lib/tippy/pixels.d.ts +47 -0
- package/dist/lib/tippy/pixels.js +187 -0
- package/dist/lib/tippy/sprite.d.ts +86 -0
- package/dist/lib/tippy/sprite.js +753 -0
- package/dist/messages/de.d.ts +12 -0
- package/dist/messages/de.js +326 -0
- package/dist/styles/expressive.css +203 -0
- package/dist/styles/fonts.css +145 -0
- package/dist/styles/index.css +207 -0
- package/dist/styles/material.css +317 -0
- package/dist/styles/parts/ai.css +361 -0
- package/dist/styles/parts/brand.css +75 -0
- package/dist/styles/parts/controls.css +774 -0
- package/dist/styles/parts/data.css +222 -0
- package/dist/styles/parts/editorial.css +120 -0
- package/dist/styles/parts/feedback.css +340 -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 +424 -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/tokens.css +299 -0
- package/dist/vite.d.ts +66 -0
- package/dist/vite.js +29 -0
- package/package.json +183 -5
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
import { cn } from "../lib/cn.js";
|
|
4
|
+
/**
|
|
5
|
+
* Label — a standalone `<label>` for a control that lives outside a `Field`: a switch in a
|
|
6
|
+
* toolbar, a checkbox in a table header, a native input in a third-party widget.
|
|
7
|
+
*
|
|
8
|
+
* Licht Sans 14px medium in foreground. It dims to 55% when the control it labels is disabled —
|
|
9
|
+
* either a following `peer` control, a control nested inside it, or a `group` marked
|
|
10
|
+
* `data-disabled`. The rule people break: using it inside a form. There, use `FieldLabel`,
|
|
11
|
+
* which wires the label, description and error to the control for you.
|
|
12
|
+
*/
|
|
13
|
+
export function Label({ render, ref, className, ...props }) {
|
|
14
|
+
return useRender({
|
|
15
|
+
defaultTagName: "label",
|
|
16
|
+
render,
|
|
17
|
+
ref,
|
|
18
|
+
props: {
|
|
19
|
+
"data-slot": "label",
|
|
20
|
+
...props,
|
|
21
|
+
className: cn("inline-flex items-center gap-2.5 text-sm leading-snug font-medium text-foreground select-none", "peer-disabled:cursor-not-allowed peer-disabled:opacity-55 peer-data-disabled:cursor-not-allowed peer-data-disabled:opacity-55", "group-data-disabled:pointer-events-none group-data-disabled:opacity-55", "has-disabled:cursor-not-allowed has-disabled:opacity-55 has-data-disabled:cursor-not-allowed has-data-disabled:opacity-55", className),
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -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,100 @@
|
|
|
1
|
+
import { Button as BaseButton } from "@base-ui/react/button";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface LightboxMessages {
|
|
4
|
+
/** The viewer's accessible name. */
|
|
5
|
+
title: string;
|
|
6
|
+
close: string;
|
|
7
|
+
previous: string;
|
|
8
|
+
next: string;
|
|
9
|
+
zoomIn: string;
|
|
10
|
+
zoomOut: string;
|
|
11
|
+
download: string;
|
|
12
|
+
/** Said while the large image loads. */
|
|
13
|
+
loading: string;
|
|
14
|
+
/** "Image 3 of 12", read out on every change, before the image's alt text. */
|
|
15
|
+
position: (index: number, count: number) => string;
|
|
16
|
+
}
|
|
17
|
+
declare module "./locale" {
|
|
18
|
+
interface Messages {
|
|
19
|
+
lightbox: LightboxMessages;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export interface LightboxImage {
|
|
23
|
+
/** The large image. */
|
|
24
|
+
src: string;
|
|
25
|
+
/** What the image shows — its name in the grid and in the viewer. Required: describe it. */
|
|
26
|
+
alt: string;
|
|
27
|
+
/** A smaller file for the grid; the large one is loaded only when it is opened. */
|
|
28
|
+
thumbnail?: string;
|
|
29
|
+
/** A line or two under the image in the viewer. */
|
|
30
|
+
caption?: React.ReactNode;
|
|
31
|
+
/** The large image's `srcSet` and `sizes`, for screens of every density. */
|
|
32
|
+
srcSet?: string;
|
|
33
|
+
sizes?: string;
|
|
34
|
+
/** What Download saves — another file, the original say. Defaults to `src`. `false` hides it for this image. */
|
|
35
|
+
download?: string | false;
|
|
36
|
+
}
|
|
37
|
+
export interface LightboxProps {
|
|
38
|
+
/** The images, in order. */
|
|
39
|
+
images: LightboxImage[];
|
|
40
|
+
/** The image shown, 0-based. */
|
|
41
|
+
index?: number;
|
|
42
|
+
defaultIndex?: number;
|
|
43
|
+
onIndexChange?: (index: number) => void;
|
|
44
|
+
/** Whether the viewer is open. */
|
|
45
|
+
open?: boolean;
|
|
46
|
+
defaultOpen?: boolean;
|
|
47
|
+
onOpenChange?: (open: boolean) => void;
|
|
48
|
+
/** Next on the last image goes to the first, and back. */
|
|
49
|
+
loop?: boolean;
|
|
50
|
+
/** Show a Download button for each image (an image can opt out with `download: false`). */
|
|
51
|
+
download?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Classes for the large image in the viewer: `invert` for black line art on a transparent
|
|
54
|
+
* ground, `bg-white` under a logo — either would otherwise vanish on the black.
|
|
55
|
+
*/
|
|
56
|
+
imageClassName?: string;
|
|
57
|
+
/** Interface text; a LocaleProvider sets it for every Lightbox. */
|
|
58
|
+
labels?: Partial<LightboxMessages>;
|
|
59
|
+
/** The thumbnails: a `LightboxGrid`, or your own `LightboxTrigger`s. */
|
|
60
|
+
children?: React.ReactNode;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Lightbox — images opened large over the page, one at a time: the photos of a listing, the
|
|
64
|
+
* figures of an article, the attachments of a report.
|
|
65
|
+
*
|
|
66
|
+
* Thumbnails (`LightboxGrid`, or `LightboxTrigger`s around your own) open a full-screen viewer on
|
|
67
|
+
* a black ground in either theme, with a mono "03 / 12" counter, previous and next buttons, the
|
|
68
|
+
* arrow keys and a swipe, zoom by double click or tap, wheel or pinch with a drag to pan, a
|
|
69
|
+
* caption and an optional download. It is a modal Dialog: focus stays inside, Escape closes it,
|
|
70
|
+
* and focus returns to the thumbnail of the image last shown.
|
|
71
|
+
*
|
|
72
|
+
* The rule people break: an empty `alt`. Every image is named, in the grid and in the viewer.
|
|
73
|
+
*/
|
|
74
|
+
export declare function Lightbox({ images, index: indexProp, defaultIndex, onIndexChange, open: openProp, defaultOpen, onOpenChange, loop, download, imageClassName, labels, children, }: LightboxProps): React.JSX.Element;
|
|
75
|
+
export interface LightboxTriggerProps extends BaseButton.Props {
|
|
76
|
+
/** The image it opens, 0-based. */
|
|
77
|
+
index: number;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Opens the viewer at one image. Put the thumbnail inside, with its `alt`: it names the button.
|
|
81
|
+
* Compose with `render` to draw it as something else.
|
|
82
|
+
*/
|
|
83
|
+
export declare function LightboxTrigger({ index, className, onClick, ref, ...props }: LightboxTriggerProps): React.JSX.Element;
|
|
84
|
+
declare const gridColumns: {
|
|
85
|
+
readonly 2: "grid-cols-2";
|
|
86
|
+
readonly 3: "grid-cols-2 sm:grid-cols-3";
|
|
87
|
+
readonly 4: "grid-cols-2 sm:grid-cols-3 md:grid-cols-4";
|
|
88
|
+
readonly 5: "grid-cols-3 sm:grid-cols-4 md:grid-cols-5";
|
|
89
|
+
readonly 6: "grid-cols-3 sm:grid-cols-4 md:grid-cols-6";
|
|
90
|
+
};
|
|
91
|
+
export interface LightboxGridProps extends React.ComponentProps<"ul"> {
|
|
92
|
+
/** Columns at full width; fewer on a phone. */
|
|
93
|
+
columns?: keyof typeof gridColumns;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The thumbnails of every image as a grid of square buttons, each cropped to fill its square and
|
|
97
|
+
* edged with a `--field-edge` hairline at 12px.
|
|
98
|
+
*/
|
|
99
|
+
export declare function LightboxGrid({ columns, className, ...props }: LightboxGridProps): React.JSX.Element;
|
|
100
|
+
export {};
|