@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,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { CheckIcon, ChevronDownIcon, CircleAlertIcon, CircleDashedIcon, WrenchIcon } from "lucide-react";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { cn, sx } from "../lib/cn.js";
|
|
6
|
+
import { CodeBlock } from "./code-block.js";
|
|
7
|
+
import { Collapsible, CollapsiblePanel, CollapsibleTrigger } from "./collapsible.js";
|
|
8
|
+
import { useMessages } from "./locale.js";
|
|
9
|
+
import { Spinner } from "./spinner.js";
|
|
10
|
+
import { Tag } from "./tag.js";
|
|
11
|
+
const defaultMessages = {
|
|
12
|
+
pending: "Pending",
|
|
13
|
+
running: "Running",
|
|
14
|
+
completed: "Completed",
|
|
15
|
+
error: "Error",
|
|
16
|
+
parameters: "Parameters",
|
|
17
|
+
result: "Result",
|
|
18
|
+
failure: "Error",
|
|
19
|
+
};
|
|
20
|
+
/** Whether the call's input and output colour their code: set once on ToolCall. */
|
|
21
|
+
const HighlightContext = React.createContext(false);
|
|
22
|
+
/** The tool call's words, its `labels` included, for the headings of its input and output. */
|
|
23
|
+
const MessagesContext = React.createContext(null);
|
|
24
|
+
/**
|
|
25
|
+
* ToolCall — a tool the model used, as a 20px card: the tool's name in mono, its status as a
|
|
26
|
+
* tag (a spinner while it runs, a green check when done, red on error), and, folded under it,
|
|
27
|
+
* what it was called with and what it returned.
|
|
28
|
+
*
|
|
29
|
+
* The rule people break: opening every tool call by default. Most readers want the answer;
|
|
30
|
+
* the calls are there to check it.
|
|
31
|
+
*/
|
|
32
|
+
export function ToolCall({ name, status, icon, labels, highlight = true, className, children, ...props }) {
|
|
33
|
+
const text = useMessages("toolCall", defaultMessages, labels);
|
|
34
|
+
const label = text[status];
|
|
35
|
+
return (_jsx(MessagesContext.Provider, { value: text, children: _jsx(HighlightContext.Provider, { value: highlight, children: _jsxs(Collapsible, { "data-slot": "tool-call", "data-status": status, className: sx("overflow-hidden surface-card [--card-padding:0]", className), ...props, children: [_jsxs(CollapsibleTrigger, { "data-slot": "tool-call-trigger", showIcon: false, className: "w-full justify-between gap-3 px-4 py-2.5 text-foreground", children: [_jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [_jsx("span", { "aria-hidden": true, className: "flex shrink-0 text-muted-foreground [&_svg]:size-3.5", children: icon ?? _jsx(WrenchIcon, {}) }), _jsx("span", { className: "truncate", children: name })] }), _jsxs("span", { className: "flex shrink-0 items-center gap-2", children: [_jsxs(Tag, { "data-slot": "tool-call-status", variant: status === "error" ? "destructive" : status === "completed" ? "default" : "muted", children: [status === "running" ? (_jsx(Spinner, { size: "sm", label: label })) : status === "completed" ? (_jsx(CheckIcon, { "aria-hidden": true, className: "text-success" })) : status === "error" ? (_jsx(CircleAlertIcon, { "aria-hidden": true })) : (_jsx(CircleDashedIcon, { "aria-hidden": true })), _jsx("span", { "aria-hidden": status === "running" || undefined, children: label })] }), _jsx(ChevronDownIcon, { "aria-hidden": true, className: "size-3.5 text-muted-foreground transition-[rotate] duration-(--duration) ease-(--ease) group-data-panel-open/collapsible-trigger:rotate-180" })] })] }), _jsx(CollapsiblePanel, { "data-slot": "tool-call-panel", children: _jsx("div", { className: "flex flex-col gap-4 border-t border-border/60 p-4", children: children }) })] }) }) }));
|
|
36
|
+
}
|
|
37
|
+
function Section({ label, children, slot, }) {
|
|
38
|
+
return (_jsxs("section", { "data-slot": slot, className: "flex min-w-0 flex-col gap-2", children: [_jsx("h4", { className: "m-0 eyebrow text-[11px]", children: label }), children] }));
|
|
39
|
+
}
|
|
40
|
+
/** A value as text: strings as they are, the rest as JSON — a BigInt as its digits, and a value
|
|
41
|
+
* JSON cannot hold (one that contains itself) as `String(value)`, never an error. */
|
|
42
|
+
function asCode(value) {
|
|
43
|
+
if (typeof value === "string")
|
|
44
|
+
return value;
|
|
45
|
+
try {
|
|
46
|
+
return JSON.stringify(value, (_key, v) => (typeof v === "bigint" ? v.toString() : v), 2);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return String(value);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** A value as a CodeBlock: objects as JSON, strings in `language` if one is given. */
|
|
53
|
+
function ValueCode({ value, language }) {
|
|
54
|
+
const highlight = React.useContext(HighlightContext);
|
|
55
|
+
return (_jsx(CodeBlock, { code: asCode(value), language: language ?? (typeof value === "string" ? undefined : "json"), highlight: highlight }));
|
|
56
|
+
}
|
|
57
|
+
/** What the model called the tool with, as a code block. */
|
|
58
|
+
export function ToolCallInput({ input, label, language }) {
|
|
59
|
+
const own = useMessages("toolCall", defaultMessages);
|
|
60
|
+
const text = React.useContext(MessagesContext) ?? own;
|
|
61
|
+
return (_jsx(Section, { slot: "tool-call-input", label: label ?? text.parameters, children: _jsx(ValueCode, { value: input, language: language }) }));
|
|
62
|
+
}
|
|
63
|
+
/** What the tool returned: a code block, your own rendering as children, or the error. */
|
|
64
|
+
export function ToolCallOutput({ output, errorText, label, language, children }) {
|
|
65
|
+
const own = useMessages("toolCall", defaultMessages);
|
|
66
|
+
const text = React.useContext(MessagesContext) ?? own;
|
|
67
|
+
return (_jsx(Section, { slot: "tool-call-output", label: label ?? (errorText ? text.failure : text.result), children: errorText ? (_jsxs("p", { className: "m-0 flex items-start gap-2 text-sm text-destructive", children: [_jsx(CircleAlertIcon, { "aria-hidden": true, className: "mt-0.5 size-4 shrink-0" }), errorText] })) : children != null ? (_jsx("div", { className: cn("min-w-0 text-sm text-foreground-soft"), children: children })) : (_jsx(ValueCode, { value: output, language: language })) }));
|
|
68
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Toolbar as BaseToolbar } from "@base-ui/react/toolbar";
|
|
2
|
+
/**
|
|
3
|
+
* Toolbar — a dense row of related commands (editor formatting, table actions, view options).
|
|
4
|
+
*
|
|
5
|
+
* A 12px surface in the shared material holding 30px `ToolbarButton`s. Off, a button is flat
|
|
6
|
+
* and muted; hover only brightens its text and icon; on (`aria-pressed`) it is raised; a press
|
|
7
|
+
* shows the pressed inset (styles in parts/navigation.css). Arrow keys move between items; Tab leaves the toolbar.
|
|
8
|
+
* The rule people break: mixing 38px controls into it. A toolbar is a dense surface — every
|
|
9
|
+
* control inside is 30px (`size="sm"` on `Select`, `Input` and `Button`).
|
|
10
|
+
*/
|
|
11
|
+
export declare function Toolbar({ className, ...props }: BaseToolbar.Root.Props): import("react").JSX.Element;
|
|
12
|
+
/** A 30px command. Icon-only buttons need an `aria-label`. Toggles set `aria-pressed`. */
|
|
13
|
+
export declare function ToolbarButton({ className, ...props }: BaseToolbar.Button.Props): import("react").JSX.Element;
|
|
14
|
+
/** A run of related buttons, e.g. bold / italic / underline. */
|
|
15
|
+
export declare function ToolbarGroup({ className, ...props }: BaseToolbar.Group.Props): import("react").JSX.Element;
|
|
16
|
+
/** A hairline between groups. It orients itself across the toolbar. */
|
|
17
|
+
export declare function ToolbarSeparator({ className, ...props }: BaseToolbar.Separator.Props): import("react").JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Toolbar as BaseToolbar } from "@base-ui/react/toolbar";
|
|
4
|
+
import { sx } from "../lib/cn.js";
|
|
5
|
+
/**
|
|
6
|
+
* Toolbar — a dense row of related commands (editor formatting, table actions, view options).
|
|
7
|
+
*
|
|
8
|
+
* A 12px surface in the shared material holding 30px `ToolbarButton`s. Off, a button is flat
|
|
9
|
+
* and muted; hover only brightens its text and icon; on (`aria-pressed`) it is raised; a press
|
|
10
|
+
* shows the pressed inset (styles in parts/navigation.css). Arrow keys move between items; Tab leaves the toolbar.
|
|
11
|
+
* The rule people break: mixing 38px controls into it. A toolbar is a dense surface — every
|
|
12
|
+
* control inside is 30px (`size="sm"` on `Select`, `Input` and `Button`).
|
|
13
|
+
*/
|
|
14
|
+
export function Toolbar({ className, ...props }) {
|
|
15
|
+
return (_jsx(BaseToolbar.Root, { "data-slot": "toolbar", className: sx([
|
|
16
|
+
"inline-flex w-fit max-w-full items-center gap-1 rounded-button p-1 surface-container data-[orientation=vertical]:flex-col",
|
|
17
|
+
// More than fits — a phone, a taller theme — scrolls inside the bar (its 4px inset keeps
|
|
18
|
+
// focus outlines whole) instead of pushing the page wider.
|
|
19
|
+
"scroll-px-1 [scrollbar-width:none] data-[orientation=horizontal]:overflow-x-auto data-[orientation=horizontal]:overflow-y-hidden [&::-webkit-scrollbar]:hidden",
|
|
20
|
+
], className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
/** A 30px command. Icon-only buttons need an `aria-label`. Toggles set `aria-pressed`. */
|
|
23
|
+
export function ToolbarButton({ className, ...props }) {
|
|
24
|
+
return (_jsx(BaseToolbar.Button, { "data-slot": "toolbar-button", className: sx([
|
|
25
|
+
"inline-flex min-h-(--control-h-sm) min-w-(--control-h-sm) shrink-0 cursor-pointer items-center justify-center gap-1.5 rounded-item px-2 font-body text-[13px] leading-none whitespace-nowrap focus-ring select-none",
|
|
26
|
+
// A disabled toolbar button stays focusable (Base UI) and still takes hover, so a tooltip
|
|
27
|
+
// can say why; its clicks stay inert. Only a natively disabled one ignores the pointer.
|
|
28
|
+
"disabled:pointer-events-none data-disabled:cursor-not-allowed data-disabled:opacity-50",
|
|
29
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
30
|
+
], className), ...props }));
|
|
31
|
+
}
|
|
32
|
+
/** A run of related buttons, e.g. bold / italic / underline. */
|
|
33
|
+
export function ToolbarGroup({ className, ...props }) {
|
|
34
|
+
return (_jsx(BaseToolbar.Group, { "data-slot": "toolbar-group", className: sx("flex items-center gap-0.5 data-[orientation=vertical]:flex-col", className), ...props }));
|
|
35
|
+
}
|
|
36
|
+
/** A hairline between groups. It orients itself across the toolbar. */
|
|
37
|
+
export function ToolbarSeparator({ className, ...props }) {
|
|
38
|
+
return (_jsx(BaseToolbar.Separator, { "data-slot": "toolbar-separator", className: sx("shrink-0 bg-border data-[orientation=horizontal]:my-1 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-4 data-[orientation=vertical]:mx-1 data-[orientation=vertical]:h-4 data-[orientation=vertical]:w-px", className), ...props }));
|
|
39
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Tooltip as BaseTooltip } from "@base-ui/react/tooltip";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/**
|
|
4
|
+
* TooltipProvider — shares one quick delay across every tooltip below it, so moving from one
|
|
5
|
+
* icon button to the next opens the next tooltip instantly. Wrap the app (or a toolbar) once.
|
|
6
|
+
*/
|
|
7
|
+
export declare function TooltipProvider({ delay, closeDelay, ...props }: BaseTooltip.Provider.Props): React.JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Tooltip — a short label for a control that has no visible text, shown on hover and focus.
|
|
10
|
+
*
|
|
11
|
+
* The rule people break: putting essential information or interactive content in it. Tooltips
|
|
12
|
+
* are invisible on touch; anything people must read or click belongs in a `Popover` or on the page.
|
|
13
|
+
*/
|
|
14
|
+
export declare const Tooltip: <Payload>(props: BaseTooltip.Root.Props<Payload>) => React.JSX.Element;
|
|
15
|
+
/**
|
|
16
|
+
* The element the tooltip describes. Compose with a control: `render={<Button size="icon" … />}`.
|
|
17
|
+
* It opens after the provider's delay, or the same quick 150ms without one; pass `delay` for a
|
|
18
|
+
* tooltip that should wait longer.
|
|
19
|
+
*/
|
|
20
|
+
export declare function TooltipTrigger({ delay, ...props }: BaseTooltip.Trigger.Props): React.JSX.Element;
|
|
21
|
+
declare const tooltipVariants: {
|
|
22
|
+
/** 12px Licht Mono — labels, shortcuts, values. */
|
|
23
|
+
readonly mono: "font-mono text-xs leading-4 tracking-normal";
|
|
24
|
+
/** 13px Licht Sans — a short sentence. */
|
|
25
|
+
readonly text: "font-body text-[13px] leading-snug";
|
|
26
|
+
};
|
|
27
|
+
export interface TooltipContentProps extends BaseTooltip.Popup.Props {
|
|
28
|
+
variant?: keyof typeof tooltipVariants;
|
|
29
|
+
side?: BaseTooltip.Positioner.Props["side"];
|
|
30
|
+
align?: BaseTooltip.Positioner.Props["align"];
|
|
31
|
+
sideOffset?: BaseTooltip.Positioner.Props["sideOffset"];
|
|
32
|
+
alignOffset?: BaseTooltip.Positioner.Props["alignOffset"];
|
|
33
|
+
/** Any other positioner props: `collisionPadding`, `sticky`, `anchor` … */
|
|
34
|
+
positioner?: Omit<BaseTooltip.Positioner.Props, "children">;
|
|
35
|
+
/** Props for the portal (e.g. `container`). */
|
|
36
|
+
portal?: Omit<BaseTooltip.Portal.Props, "children">;
|
|
37
|
+
/** Draw a small notch pointing at the trigger. */
|
|
38
|
+
arrow?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/** Portal + Positioner + Popup. Menu material at the 7px item radius, `popup-motion`. */
|
|
41
|
+
export declare function TooltipContent({ variant, side, align, sideOffset, alignOffset, positioner, portal, arrow, className, children, dir, ...props }: TooltipContentProps): React.JSX.Element;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Tooltip as BaseTooltip } from "@base-ui/react/tooltip";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { sx, triggerSlot } from "../lib/cn.js";
|
|
6
|
+
import { overlayArrow, usePopupDir } from "./_overlay.js";
|
|
7
|
+
/** The quick open delay (ms): long enough to pass over a control without a flash, short enough to feel immediate. */
|
|
8
|
+
const TOOLTIP_DELAY = 150;
|
|
9
|
+
/** True below a TooltipProvider, whose delay a trigger then inherits. */
|
|
10
|
+
const InProviderContext = React.createContext(false);
|
|
11
|
+
/**
|
|
12
|
+
* TooltipProvider — shares one quick delay across every tooltip below it, so moving from one
|
|
13
|
+
* icon button to the next opens the next tooltip instantly. Wrap the app (or a toolbar) once.
|
|
14
|
+
*/
|
|
15
|
+
export function TooltipProvider({ delay = TOOLTIP_DELAY, closeDelay = 0, ...props }) {
|
|
16
|
+
return (_jsx(InProviderContext.Provider, { value: true, children: _jsx(BaseTooltip.Provider, { delay: delay, closeDelay: closeDelay, ...props }) }));
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Tooltip — a short label for a control that has no visible text, shown on hover and focus.
|
|
20
|
+
*
|
|
21
|
+
* The rule people break: putting essential information or interactive content in it. Tooltips
|
|
22
|
+
* are invisible on touch; anything people must read or click belongs in a `Popover` or on the page.
|
|
23
|
+
*/
|
|
24
|
+
export const Tooltip = BaseTooltip.Root;
|
|
25
|
+
/**
|
|
26
|
+
* The element the tooltip describes. Compose with a control: `render={<Button size="icon" … />}`.
|
|
27
|
+
* It opens after the provider's delay, or the same quick 150ms without one; pass `delay` for a
|
|
28
|
+
* tooltip that should wait longer.
|
|
29
|
+
*/
|
|
30
|
+
export function TooltipTrigger({ delay, ...props }) {
|
|
31
|
+
const inProvider = React.useContext(InProviderContext);
|
|
32
|
+
return (_jsx(BaseTooltip.Trigger, { ...triggerSlot("tooltip-trigger", props.render), delay: delay ?? (inProvider ? undefined : TOOLTIP_DELAY), ...props }));
|
|
33
|
+
}
|
|
34
|
+
const tooltipVariants = {
|
|
35
|
+
/** 12px Licht Mono — labels, shortcuts, values. */
|
|
36
|
+
mono: "font-mono text-xs leading-4 tracking-normal",
|
|
37
|
+
/** 13px Licht Sans — a short sentence. */
|
|
38
|
+
text: "font-body text-[13px] leading-snug",
|
|
39
|
+
};
|
|
40
|
+
/** Portal + Positioner + Popup. Menu material at the 7px item radius, `popup-motion`. */
|
|
41
|
+
export function TooltipContent({ variant = "mono", side = "top", align = "center", sideOffset = 6, alignOffset = 0, positioner, portal, arrow = false, className, children, dir, ...props }) {
|
|
42
|
+
const popupDir = usePopupDir(dir);
|
|
43
|
+
return (_jsx(BaseTooltip.Portal, { ...portal, children: _jsx(BaseTooltip.Positioner, { side: side, align: align, sideOffset: sideOffset, alignOffset: alignOffset, arrowPadding: 8, collisionPadding: 8, dir: popupDir, ...positioner, className: "z-50 outline-none", children: _jsxs(BaseTooltip.Popup, { "data-slot": "tooltip-content", "data-variant": variant, className: sx([
|
|
44
|
+
"relative max-w-64 popup-motion rounded-item material-menu px-2 py-1 break-words text-foreground outline-none select-none",
|
|
45
|
+
tooltipVariants[variant],
|
|
46
|
+
], className), ...props, children: [arrow && _jsx(BaseTooltip.Arrow, { "data-slot": "tooltip-arrow", className: overlayArrow }), children] }) }) }));
|
|
47
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Popover as BasePopover } from "@base-ui/react/popover";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface TourMessages {
|
|
4
|
+
back: string;
|
|
5
|
+
next: string;
|
|
6
|
+
/** The last step's primary. */
|
|
7
|
+
done: string;
|
|
8
|
+
skip: string;
|
|
9
|
+
/** "Step 2 of 5", for screen readers beside the visible "02 / 05". */
|
|
10
|
+
progress: (step: number, count: number) => string;
|
|
11
|
+
}
|
|
12
|
+
declare module "./locale" {
|
|
13
|
+
interface Messages {
|
|
14
|
+
tour: TourMessages;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/** What a step points at: a selector, a ref, or a function that finds the element. */
|
|
18
|
+
export type TourTarget = string | React.RefObject<Element | null> | (() => Element | null);
|
|
19
|
+
type Side = NonNullable<BasePopover.Positioner.Props["side"]>;
|
|
20
|
+
type Align = NonNullable<BasePopover.Positioner.Props["align"]>;
|
|
21
|
+
export interface TourStep {
|
|
22
|
+
/**
|
|
23
|
+
* The element the step is about. Leave it out for a step in the middle of the screen — a welcome
|
|
24
|
+
* or a last word. A target that is not on the page (not rendered, or hidden) is skipped.
|
|
25
|
+
*/
|
|
26
|
+
target?: TourTarget | null;
|
|
27
|
+
title: React.ReactNode;
|
|
28
|
+
body?: React.ReactNode;
|
|
29
|
+
/** Which side of the target the popover takes; it flips when there is no room. Defaults to `bottom`. */
|
|
30
|
+
side?: Side;
|
|
31
|
+
align?: Align;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A box on screen for the popover to point at, read again each time the popover is placed — as an
|
|
35
|
+
* element's box is. `contextElement` is what it moves with, so the popover follows it as the page
|
|
36
|
+
* scrolls and the element resizes.
|
|
37
|
+
*/
|
|
38
|
+
export interface TourAnchor {
|
|
39
|
+
getBoundingClientRect(): DOMRect;
|
|
40
|
+
contextElement?: Element;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The step as a guide's speech bubble: the popover points at the guide (its head) instead of the
|
|
44
|
+
* target, with a tail where the arrow was. A guide that places the steps stands by the target
|
|
45
|
+
* itself; the spotlight stays on the target.
|
|
46
|
+
*/
|
|
47
|
+
export interface TourGuidePlacement {
|
|
48
|
+
/** The step it is for. A step the guide has not placed waits, out of sight. */
|
|
49
|
+
step: number;
|
|
50
|
+
/** What the tail points at: the guide's head, an element or a box. */
|
|
51
|
+
anchor: Element | TourAnchor;
|
|
52
|
+
/** The side of the anchor the bubble takes, and how it lines up there. Defaults to `top`, `center`. */
|
|
53
|
+
side?: Side;
|
|
54
|
+
align?: Align;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the guide is there to say it. While it is false — the guide on its way — the bubble
|
|
57
|
+
* waits out of sight; when it turns true the bubble comes out of its tail. Under reduced motion it
|
|
58
|
+
* just appears.
|
|
59
|
+
*/
|
|
60
|
+
ready: boolean;
|
|
61
|
+
}
|
|
62
|
+
/** What a guide — a companion that walks through the tour beside the popover — is told. */
|
|
63
|
+
export interface TourGuideState {
|
|
64
|
+
/** The step shown, 0-based, and where it is among the steps on the page: `position` + 1 of `count`. */
|
|
65
|
+
step: number;
|
|
66
|
+
position: number;
|
|
67
|
+
count: number;
|
|
68
|
+
/** The element the step points at; null for a step in the middle of the screen. */
|
|
69
|
+
target: Element | null;
|
|
70
|
+
/** The popover (the step's dialog), to stand beside; null while it is not on the page. */
|
|
71
|
+
popover: HTMLElement | null;
|
|
72
|
+
/** True from a change of step until the popover has arrived at the new one, the page scrolled. */
|
|
73
|
+
moving: boolean;
|
|
74
|
+
/** "open" while the tour shows; how it ended once it has, while the guide is still on the page. */
|
|
75
|
+
status: "open" | "complete" | "skip" | "closed";
|
|
76
|
+
/** Take the guide off the page, once it has played its way out (it goes after 4 seconds anyway). */
|
|
77
|
+
release: () => void;
|
|
78
|
+
/**
|
|
79
|
+
* Make the popover the guide's speech bubble, placed by the guide (`null`: back to the popover at
|
|
80
|
+
* the target). With a guide the tour opens once the guide has placed the first step, or a tenth
|
|
81
|
+
* of a second on if it does not. From then, at each change of step the bubble goes, `moving` is
|
|
82
|
+
* true while the page scrolls, and the next step waits for the guide to place it.
|
|
83
|
+
*/
|
|
84
|
+
place: (placement: TourGuidePlacement | null) => void;
|
|
85
|
+
}
|
|
86
|
+
export interface TourProps {
|
|
87
|
+
steps: TourStep[];
|
|
88
|
+
/** Whether the tour is showing. */
|
|
89
|
+
open?: boolean;
|
|
90
|
+
defaultOpen?: boolean;
|
|
91
|
+
onOpenChange?: (open: boolean) => void;
|
|
92
|
+
/** The step shown, 0-based. */
|
|
93
|
+
step?: number;
|
|
94
|
+
defaultStep?: number;
|
|
95
|
+
onStepChange?: (step: number) => void;
|
|
96
|
+
/** Done on the last step. */
|
|
97
|
+
onComplete?: () => void;
|
|
98
|
+
/** Skip, or Escape, on the step given. */
|
|
99
|
+
onSkip?: (step: number) => void;
|
|
100
|
+
/** Dim the page around the target. Defaults to `true`. */
|
|
101
|
+
spotlight?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* A companion that goes through the tour with it — a mascot that moves when the step does
|
|
104
|
+
* (`TippyGuide` from `@zonsh/ui/tippy`). Rendered in a layer over the page that takes no clicks
|
|
105
|
+
* and is hidden from assistive technology. A guide can stand by the target itself and say each
|
|
106
|
+
* step: the popover becomes its speech bubble (`place`).
|
|
107
|
+
*/
|
|
108
|
+
guide?: (state: TourGuideState) => React.ReactNode;
|
|
109
|
+
/** Interface text; a LocaleProvider sets it for every Tour. */
|
|
110
|
+
labels?: Partial<TourMessages>;
|
|
111
|
+
/** Classes for the popover. */
|
|
112
|
+
className?: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Tour — a guided walk through a product, one step at a time: each step a small popover in the
|
|
116
|
+
* menu material anchored to the thing it explains, with its title, a sentence or two, a mono
|
|
117
|
+
* "02 / 05", Back, Next (Done on the last) and Skip. A spotlight dims the page around the target;
|
|
118
|
+
* between steps the popover glides to the next target and the spotlight's hole moves with it, a
|
|
119
|
+
* far target scrolled into view first. The popover follows its target as the page scrolls and
|
|
120
|
+
* resizes. A step whose target is not on the page is skipped. The arrow keys move between steps;
|
|
121
|
+
* Escape skips. A `guide` can walk the tour alongside — a mascot such as Tippy.
|
|
122
|
+
*
|
|
123
|
+
* The rule people break: a tour that explains what the interface should say itself. Keep it to the
|
|
124
|
+
* few things people cannot find, and let them skip it at any step.
|
|
125
|
+
*/
|
|
126
|
+
export declare function Tour({ steps, open: openProp, defaultOpen, onOpenChange, step: stepProp, defaultStep, onStepChange, onComplete, onSkip, spotlight, guide, labels, className, }: TourProps): React.JSX.Element;
|
|
127
|
+
export {};
|