@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,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Select as BaseSelect } from "@base-ui/react/select";
|
|
4
|
+
import { CheckIcon, ChevronDownIcon, ChevronsUpDownIcon, ChevronUpIcon } from "lucide-react";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { cn, sx } from "../lib/cn.js";
|
|
7
|
+
import { useFormReset } from "../lib/form-reset.js";
|
|
8
|
+
import { mergeRefs } from "../lib/merge-refs.js";
|
|
9
|
+
import { usePopupDir } from "./_overlay.js";
|
|
10
|
+
import { ScrollArea } from "./scroll-area.js";
|
|
11
|
+
/**
|
|
12
|
+
* Select — pick one option from a list. Use `ToggleGroup` instead when there are 2–5 short
|
|
13
|
+
* options and seeing them side by side is the point.
|
|
14
|
+
*
|
|
15
|
+
* Pass `items` to `<Select>` so `<SelectValue>` can render the selected label.
|
|
16
|
+
*/
|
|
17
|
+
export function Select({ inputRef, ...props }) {
|
|
18
|
+
// A form's reset remounts it from its defaults (lib/form-reset); its hidden input finds the form.
|
|
19
|
+
const [resetKey, formRef] = useFormReset();
|
|
20
|
+
const refs = React.useMemo(() => mergeRefs(formRef, inputRef), [formRef, inputRef]);
|
|
21
|
+
const items = props.items;
|
|
22
|
+
const count = Array.isArray(items) ? items.length : items ? Object.keys(items).length : 0;
|
|
23
|
+
if (process.env.NODE_ENV !== "production" && count > MANY_OPTIONS && !warned) {
|
|
24
|
+
warned = true;
|
|
25
|
+
console.warn(`Select: ${count} options. A Select draws every option each time it opens, which takes most of ` +
|
|
26
|
+
"a second from about a thousand. Use a Combobox: people can type to narrow the list, and it " +
|
|
27
|
+
"draws only the options in view.");
|
|
28
|
+
}
|
|
29
|
+
return _jsx(BaseSelect.Root, { inputRef: refs, ...props }, resetKey);
|
|
30
|
+
}
|
|
31
|
+
/** Past this many options, development warns once (see Select). */
|
|
32
|
+
const MANY_OPTIONS = 500;
|
|
33
|
+
let warned = false;
|
|
34
|
+
const triggerSizes = {
|
|
35
|
+
sm: "min-h-(--control-h-sm) px-2.5 text-[13px]",
|
|
36
|
+
default: "min-h-(--control-h) ps-3.5 pe-2.5 text-[15px]",
|
|
37
|
+
};
|
|
38
|
+
export function SelectTrigger({ size = "default", className, children, ...props }) {
|
|
39
|
+
return (_jsxs(BaseSelect.Trigger, { "data-slot": "select-trigger", "data-size": size, className: sx([
|
|
40
|
+
"group/trigger inline-flex w-full min-w-40 material-field cursor-pointer items-center justify-between gap-3 rounded-control font-body leading-none whitespace-nowrap outline-none select-none",
|
|
41
|
+
triggerSizes[size],
|
|
42
|
+
], className), ...props, children: [children, _jsx(BaseSelect.Icon, { className: "flex text-muted-foreground transition-colors duration-(--duration) ease-(--ease) group-hover/trigger:not-group-data-disabled/trigger:text-foreground", children: _jsx(ChevronsUpDownIcon, { className: "size-4" }) })] }));
|
|
43
|
+
}
|
|
44
|
+
export function SelectValue({ className, ...props }) {
|
|
45
|
+
return (_jsx(BaseSelect.Value, { "data-slot": "select-value", className: sx(["truncate data-placeholder:text-control-muted"], className), ...props }));
|
|
46
|
+
}
|
|
47
|
+
export function SelectContent({ className, children, alignItemWithTrigger = false, positioner, dir, ...props }) {
|
|
48
|
+
const popupDir = usePopupDir(dir);
|
|
49
|
+
return (_jsx(BaseSelect.Portal, { children: _jsx(BaseSelect.Positioner, { sideOffset: 6, alignItemWithTrigger: alignItemWithTrigger, dir: popupDir, ...positioner, className: "z-50 outline-none select-none", children: _jsxs(BaseSelect.Popup, { "data-slot": "select-content", className: sx([
|
|
50
|
+
// As wide as the trigger, or wider for long options — up to 24rem (or the trigger, if
|
|
51
|
+
// wider) and never past the window, so the popup never spans the screen.
|
|
52
|
+
"relative max-w-[min(var(--available-width),max(var(--anchor-width),24rem))] min-w-(--anchor-width) popup-motion overflow-hidden rounded-button material-menu p-1 font-body outline-none",
|
|
53
|
+
], className), ...props, children: [_jsx(BaseSelect.ScrollUpArrow, { className: "start-0 top-0 z-1 hidden h-6 w-full cursor-default items-center justify-center bg-control-menu text-muted-foreground data-[side=none]:flex", children: _jsx(ChevronUpIcon, { className: "size-3.5" }) }), _jsx(ScrollArea, { className: "h-full max-h-[calc(var(--available-height)-0.625rem)] in-data-[side=none]:max-h-none", viewportRender: _jsx(BaseSelect.List, { "data-slot": "select-list", role: "listbox", className: "scroll-py-1 data-has-overflow-y:pe-3" }), children: children }), _jsx(BaseSelect.ScrollDownArrow, { className: "start-0 bottom-0 z-1 hidden h-6 w-full cursor-default items-center justify-center bg-control-menu text-muted-foreground data-[side=none]:flex", children: _jsx(ChevronDownIcon, { className: "size-3.5" }) })] }) }) }));
|
|
54
|
+
}
|
|
55
|
+
export function SelectItem({ className, children, ...props }) {
|
|
56
|
+
return (_jsxs(BaseSelect.Item, { "data-slot": "select-item", className: sx([
|
|
57
|
+
"grid min-h-(--control-h) cursor-pointer grid-cols-[1fr_1rem] items-center gap-3 rounded-item border border-transparent px-2.5 py-[clamp(0px,calc((var(--control-h)-22px)/2),6px)] text-sm text-foreground-soft outline-none select-none",
|
|
58
|
+
"data-highlighted:border-control-inner-edge data-highlighted:bg-control-hover data-highlighted:text-foreground data-highlighted:shadow-highlight",
|
|
59
|
+
"data-disabled:pointer-events-none data-disabled:opacity-50 data-selected:text-foreground",
|
|
60
|
+
], className), ...props, children: [_jsx(BaseSelect.ItemText, { className: "col-start-1 line-clamp-2 [overflow-wrap:anywhere]", children: children }), _jsx(BaseSelect.ItemIndicator, { className: "col-start-2 flex", children: _jsx(CheckIcon, { className: "size-4" }) })] }));
|
|
61
|
+
}
|
|
62
|
+
export function SelectGroup({ className, ...props }) {
|
|
63
|
+
return _jsx(BaseSelect.Group, { "data-slot": "select-group", className: className, ...props });
|
|
64
|
+
}
|
|
65
|
+
export function SelectGroupLabel({ className, ...props }) {
|
|
66
|
+
return (_jsx(BaseSelect.GroupLabel, { "data-slot": "select-group-label", className: sx(["px-2.5 pt-2.5 pb-1.5 eyebrow text-[11px] [overflow-wrap:anywhere]"], className), ...props }));
|
|
67
|
+
}
|
|
68
|
+
export function SelectSeparator({ className, ...props }) {
|
|
69
|
+
return (_jsx(BaseSelect.Separator, { "data-slot": "select-separator", className: cn("-mx-1 my-1 h-px bg-border", className), ...props }));
|
|
70
|
+
}
|
|
71
|
+
export const SelectLabel = BaseSelect.Label;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Separator as BaseSeparator } from "@base-ui/react/separator";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
export interface SeparatorProps extends BaseSeparator.Props {
|
|
4
|
+
/** A short mono label centred on a horizontal rule, e.g. `"or"` or `"02 — Chapters"`. */
|
|
5
|
+
label?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Separator — the hairline rule, which is the default way to group content here.
|
|
9
|
+
*
|
|
10
|
+
* `border/60`, 1px, horizontal or vertical. An optional mono label sits in the middle of a
|
|
11
|
+
* horizontal rule. The rule people break: reaching for a box (a boxed `Card`) where
|
|
12
|
+
* a rule and whitespace would do. Use this first.
|
|
13
|
+
*/
|
|
14
|
+
export declare function Separator({ orientation, label, className, ...props }: SeparatorProps): React.JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Separator as BaseSeparator } from "@base-ui/react/separator";
|
|
4
|
+
import { sx } from "../lib/cn.js";
|
|
5
|
+
/**
|
|
6
|
+
* Separator — the hairline rule, which is the default way to group content here.
|
|
7
|
+
*
|
|
8
|
+
* `border/60`, 1px, horizontal or vertical. An optional mono label sits in the middle of a
|
|
9
|
+
* horizontal rule. The rule people break: reaching for a box (a boxed `Card`) where
|
|
10
|
+
* a rule and whitespace would do. Use this first.
|
|
11
|
+
*/
|
|
12
|
+
export function Separator({ orientation = "horizontal", label, className, ...props }) {
|
|
13
|
+
if (label != null && orientation === "horizontal") {
|
|
14
|
+
return (_jsx(BaseSeparator, { "data-slot": "separator", "data-labelled": "", "aria-label": typeof label === "string" ? label : undefined, orientation: orientation, className: sx("flex w-full items-center gap-4 eyebrow text-[11px] before:h-px before:flex-1 before:bg-border/60 before:content-[''] after:h-px after:flex-1 after:bg-border/60 after:content-['']", className), ...props, children: _jsx("span", { className: "shrink-0", children: label }) }));
|
|
15
|
+
}
|
|
16
|
+
return (_jsx(BaseSeparator, { "data-slot": "separator", orientation: orientation, className: sx("shrink-0 bg-border/60 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:min-h-4 data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch", className), ...props }));
|
|
17
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { type ButtonProps } from "./button.js";
|
|
4
|
+
import { type ScrollAreaProps } from "./scroll-area.js";
|
|
5
|
+
import { type SeparatorProps } from "./separator.js";
|
|
6
|
+
export interface SidebarMessages {
|
|
7
|
+
/** The mobile sheet's title, when the sidebar has no `aria-label`. */
|
|
8
|
+
navigation: string;
|
|
9
|
+
/** SidebarTrigger's and SidebarRail's name. */
|
|
10
|
+
toggle: string;
|
|
11
|
+
}
|
|
12
|
+
declare module "./locale" {
|
|
13
|
+
interface Messages {
|
|
14
|
+
sidebar: SidebarMessages;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* How the sidebar collapses on desktop. `offcanvas` slides it away entirely, `icon` shrinks it to
|
|
19
|
+
* a rail of 38px icon squares with tooltips, `none` keeps it open. On mobile, `offcanvas` and
|
|
20
|
+
* `icon` both become a sheet.
|
|
21
|
+
*/
|
|
22
|
+
export type SidebarCollapsible = "offcanvas" | "icon" | "none";
|
|
23
|
+
export interface SidebarContextValue {
|
|
24
|
+
/** `expanded` or `collapsed` — the desktop state. */
|
|
25
|
+
state: "expanded" | "collapsed";
|
|
26
|
+
/** Desktop open state. */
|
|
27
|
+
open: boolean;
|
|
28
|
+
setOpen: (open: boolean) => void;
|
|
29
|
+
/** Mobile sheet open state. */
|
|
30
|
+
openMobile: boolean;
|
|
31
|
+
setOpenMobile: (open: boolean) => void;
|
|
32
|
+
/** Below 768px the sidebar is a sheet. */
|
|
33
|
+
isMobile: boolean;
|
|
34
|
+
/** Toggles the sheet on mobile and the panel on desktop. */
|
|
35
|
+
toggleSidebar: () => void;
|
|
36
|
+
collapsible: SidebarCollapsible;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* useSidebar — the app shell's state, for building your own trigger or reacting to collapse:
|
|
40
|
+
* `{ state, open, setOpen, openMobile, setOpenMobile, isMobile, toggleSidebar, collapsible }`.
|
|
41
|
+
* Must be used inside a `SidebarProvider`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function useSidebar(): SidebarContextValue;
|
|
44
|
+
export interface SidebarProviderProps extends React.ComponentProps<"div"> {
|
|
45
|
+
/** Initial desktop state when uncontrolled. Pass the cookie value here when rendering on a server. */
|
|
46
|
+
defaultOpen?: boolean;
|
|
47
|
+
/** Controlled desktop state. */
|
|
48
|
+
open?: boolean;
|
|
49
|
+
onOpenChange?: (open: boolean) => void;
|
|
50
|
+
/** How the sidebar collapses on desktop. Defaults to `offcanvas`. */
|
|
51
|
+
collapsible?: SidebarCollapsible;
|
|
52
|
+
/**
|
|
53
|
+
* Where the desktop state is remembered (localStorage and a cookie of this name). `null`
|
|
54
|
+
* turns persistence off. Defaults to `"zon-sidebar"`.
|
|
55
|
+
*/
|
|
56
|
+
storageKey?: string | null;
|
|
57
|
+
/**
|
|
58
|
+
* Key that toggles the sidebar with ⌘ on Apple devices and Ctrl elsewhere — never the other, so
|
|
59
|
+
* Ctrl+B still moves the caret back in a Mac's text field. `false` turns it off. Defaults to `"b"`.
|
|
60
|
+
*/
|
|
61
|
+
keyboardShortcut?: string | false;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* SidebarProvider — turns a `Sidebar` into an app shell: open state, collapse (`offcanvas`,
|
|
65
|
+
* `icon` or `none`), ⌘B on a Mac and Ctrl+B elsewhere, a sheet on mobile and a remembered state.
|
|
66
|
+
*
|
|
67
|
+
* It renders the shell's flex row; put the `Sidebar` and a `SidebarInset` inside. The shell is
|
|
68
|
+
* at least the viewport tall (`min-h-svh`) — give it a fixed height (`h-[560px] min-h-0`) to
|
|
69
|
+
* embed it in a page. Widths come from `--sidebar-width` (16rem) and `--sidebar-width-icon`.
|
|
70
|
+
*/
|
|
71
|
+
export declare function SidebarProvider({ defaultOpen, open: openProp, onOpenChange, collapsible, storageKey, keyboardShortcut, className, style, children, ...props }: SidebarProviderProps): React.JSX.Element;
|
|
72
|
+
export interface SidebarProps extends React.ComponentProps<"nav"> {
|
|
73
|
+
/** In an app shell: which edge the panel sits on. Put a right sidebar after the `SidebarInset`. */
|
|
74
|
+
side?: "left" | "right";
|
|
75
|
+
/**
|
|
76
|
+
* In an app shell: `sidebar` (default) divides the panel from the page with a hairline;
|
|
77
|
+
* `inset` drops the hairline and sets the page beside it as a raised 20px panel with an 8px
|
|
78
|
+
* margin, so the sidebar reads as the ground the work sits on; `floating` is the reverse — the
|
|
79
|
+
* sidebar itself is the raised 20px panel, 8px from the shell's edges, beside a flat page.
|
|
80
|
+
* Desktop only.
|
|
81
|
+
*/
|
|
82
|
+
variant?: "sidebar" | "inset" | "floating";
|
|
83
|
+
/**
|
|
84
|
+
* `default` 38px rows; `sm` the dense sidebar: 30px rows, 13px labels, tighter groups and a
|
|
85
|
+
* narrower icon rail, for tools with many sections. Controls inside (a search field, a
|
|
86
|
+
* button in the header) take the 30px height too.
|
|
87
|
+
*/
|
|
88
|
+
size?: "default" | "sm";
|
|
89
|
+
/**
|
|
90
|
+
* What hovering a row does: `text` (default) only brightens its label; `glide` also lays one
|
|
91
|
+
* soft fill under it that follows the pointer from row to row.
|
|
92
|
+
*/
|
|
93
|
+
hover?: "text" | "glide";
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Sidebar — section navigation for docs, settings and dashboards.
|
|
97
|
+
*
|
|
98
|
+
* A `<nav>` of `SidebarGroup`s, each with an eyebrow `SidebarGroupLabel` and 38px
|
|
99
|
+
* `SidebarItem` rows at 12px radius. Rows are flat at rest, only their label brightens on hover
|
|
100
|
+
* (`hover="glide"` adds one soft fill that follows the pointer), and take the raised material when current. The rule people break: marking the current page with a flat fill or
|
|
101
|
+
* a bold weight. Set `current` (it writes `aria-current="page"`) and let the material show it.
|
|
102
|
+
* A sidebar never shows a scrollbar: a long one goes in `<ScrollArea scrollbar={false}>`.
|
|
103
|
+
*
|
|
104
|
+
* Inside a `SidebarProvider` it becomes the app shell's panel: a full-height column divided from
|
|
105
|
+
* the page by a hairline, holding `SidebarHeader`, `SidebarContent` and `SidebarFooter`. It
|
|
106
|
+
* collapses on desktop and turns into a sheet on mobile.
|
|
107
|
+
*/
|
|
108
|
+
export declare function Sidebar({ side, variant, size, hover, className, children, ...props }: SidebarProps): React.JSX.Element;
|
|
109
|
+
/** The top of an app-shell sidebar: a logo, a workspace switcher, a search row. Never scrolls. */
|
|
110
|
+
export declare function SidebarHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
111
|
+
/** The bottom of an app-shell sidebar: the account, settings, help. Never scrolls. */
|
|
112
|
+
export declare function SidebarFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
113
|
+
export interface SidebarContentProps extends ScrollAreaProps {
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The scrolling middle of an app-shell sidebar, holding the `SidebarGroup`s 28px apart. It is a
|
|
117
|
+
* `ScrollArea` with `scrollbar={false}`: it scrolls, never shows a bar, and fades at the edges.
|
|
118
|
+
*/
|
|
119
|
+
export declare function SidebarContent({ className, contentClassName, ...props }: SidebarContentProps): React.JSX.Element;
|
|
120
|
+
/** A hairline between the header, content and footer, inset 12px to line up with the rows. Inside `SidebarContent` pass `mx-0`. */
|
|
121
|
+
export declare function SidebarSeparator({ className, ...props }: SeparatorProps): React.JSX.Element;
|
|
122
|
+
/** A labelled group of rows. Pair it with a `SidebarGroupLabel`. */
|
|
123
|
+
export declare function SidebarGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
124
|
+
/**
|
|
125
|
+
* The eyebrow above a group: 12px mono, uppercase, 0.18em tracking. In the icon rail it fades
|
|
126
|
+
* and folds away with the panel's width (a negative margin of its own fixed height), so the rows
|
|
127
|
+
* glide up instead of jumping; screen readers still hear it.
|
|
128
|
+
*/
|
|
129
|
+
export declare function SidebarGroupLabel({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
130
|
+
export interface SidebarItemProps extends useRender.ComponentProps<"a"> {
|
|
131
|
+
/** The current page. Sets `aria-current="page"` and the raised treatment. */
|
|
132
|
+
current?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* In an icon-collapsed sidebar, the tooltip beside the 38px square. Defaults to the row's text.
|
|
135
|
+
* `false` turns it off.
|
|
136
|
+
*/
|
|
137
|
+
tooltip?: React.ReactNode;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* One navigation row. Renders an `<a>`; pass `render={<Link to="…" />}` for router links.
|
|
141
|
+
* Leading icons are 16px; a trailing `Kbd`, `Tag` or `SidebarMenuBadge` is pushed to the end
|
|
142
|
+
* with `ms-auto`. In an icon-collapsed app shell it shrinks to a 38px square with a tooltip.
|
|
143
|
+
*/
|
|
144
|
+
export declare function SidebarItem({ current, tooltip, render, ref, className, children, onClick, ...props }: SidebarItemProps): React.JSX.Element;
|
|
145
|
+
/** A count at the end of a row ("12"): mono, tabular, muted. Hidden in the icon rail. */
|
|
146
|
+
export declare function SidebarMenuBadge({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
147
|
+
/**
|
|
148
|
+
* The button that opens and closes the sidebar: a circular ghost icon button, usually first in
|
|
149
|
+
* the inset's toolbar. On mobile it opens the sheet. Shows the ⌘B / Ctrl+B shortcut's action.
|
|
150
|
+
*/
|
|
151
|
+
export declare function SidebarTrigger({ variant, size, className, children, onClick, ...props }: ButtonProps): React.JSX.Element;
|
|
152
|
+
/**
|
|
153
|
+
* A thin strip along the sidebar's inner edge: hover shows the hairline in `--control-focus`,
|
|
154
|
+
* click toggles the sidebar. A pointer convenience — keyboard users have the trigger and ⌘B.
|
|
155
|
+
*/
|
|
156
|
+
export declare function SidebarRail({ className, onClick, ...props }: React.ComponentProps<"button">): React.JSX.Element | null;
|
|
157
|
+
/**
|
|
158
|
+
* The main area beside an app-shell sidebar: a `<main>` column that takes the remaining width.
|
|
159
|
+
* Put a toolbar row (with `SidebarTrigger`) first, then the page. Beside a `variant="inset"`
|
|
160
|
+
* sidebar it becomes a raised 20px panel with an 8px margin (styles in parts/navigation.css).
|
|
161
|
+
* Otherwise it has no fill of its own: the page ground shows through.
|
|
162
|
+
*/
|
|
163
|
+
export declare function SidebarInset({ className, ...props }: React.ComponentProps<"main">): React.JSX.Element;
|