@zonsh/ui 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +639 -0
- package/README.md +49 -21
- package/dist/brand.d.ts +3 -0
- package/dist/brand.js +7 -0
- package/dist/components/_breadcrumb-more.d.ts +6 -0
- package/dist/components/_breadcrumb-more.js +5 -0
- package/dist/components/_drawing-svg.d.ts +11 -0
- package/dist/components/_drawing-svg.js +30 -0
- package/dist/components/_media.d.ts +159 -0
- package/dist/components/_media.js +266 -0
- package/dist/components/_overlay.d.ts +8 -5
- package/dist/components/_overlay.js +11 -6
- package/dist/components/_scheduler-calendar.d.ts +71 -0
- package/dist/components/_scheduler-calendar.js +940 -0
- package/dist/components/_scheduler-editor.d.ts +29 -0
- package/dist/components/_scheduler-editor.js +111 -0
- package/dist/components/_scheduler-menu.d.ts +16 -0
- package/dist/components/_scheduler-menu.js +18 -0
- package/dist/components/_scheduler-parts.d.ts +164 -0
- package/dist/components/_scheduler-parts.js +327 -0
- package/dist/components/_suggest-list.d.ts +142 -0
- package/dist/components/_suggest-list.js +159 -0
- package/dist/components/_toolbar-more.d.ts +24 -0
- package/dist/components/_toolbar-more.js +25 -0
- package/dist/components/accordion.d.ts +1 -1
- package/dist/components/accordion.js +6 -6
- package/dist/components/action-sheet.d.ts +88 -0
- package/dist/components/action-sheet.js +124 -0
- package/dist/components/alert-dialog.js +3 -1
- package/dist/components/alert.d.ts +11 -18
- package/dist/components/alert.js +9 -6
- package/dist/components/app-bar.d.ts +93 -0
- package/dist/components/app-bar.js +175 -0
- package/dist/components/audio-player.d.ts +134 -0
- package/dist/components/audio-player.js +618 -0
- package/dist/components/avatar.d.ts +6 -6
- package/dist/components/avatar.js +13 -11
- package/dist/components/badge.d.ts +12 -12
- package/dist/components/badge.js +7 -5
- package/dist/components/bottom-nav.d.ts +53 -11
- package/dist/components/bottom-nav.js +388 -23
- package/dist/components/breadcrumb.d.ts +11 -2
- package/dist/components/breadcrumb.js +60 -6
- package/dist/components/button-group.js +5 -1
- package/dist/components/button.d.ts +23 -6
- package/dist/components/button.js +63 -7
- package/dist/components/calendar.js +8 -6
- package/dist/components/card.d.ts +10 -8
- package/dist/components/card.js +15 -14
- package/dist/components/carousel.d.ts +2 -2
- package/dist/components/carousel.js +21 -8
- package/dist/components/chart.d.ts +27 -1
- package/dist/components/chart.js +15 -5
- package/dist/components/checkbox.js +2 -2
- package/dist/components/code-block.d.ts +9 -2
- package/dist/components/code-block.js +26 -7
- package/dist/components/collapsible.js +3 -3
- package/dist/components/color-picker.d.ts +2 -2
- package/dist/components/color-picker.js +5 -5
- package/dist/components/combobox.d.ts +26 -7
- package/dist/components/combobox.js +32 -13
- package/dist/components/command.d.ts +29 -5
- package/dist/components/command.js +35 -10
- package/dist/components/context-menu.d.ts +5 -2
- package/dist/components/context-menu.js +24 -3
- package/dist/components/conversation.d.ts +1 -1
- package/dist/components/conversation.js +67 -13
- package/dist/components/copy-button.d.ts +1 -1
- package/dist/components/copy-button.js +1 -1
- package/dist/components/data-table.d.ts +6 -6
- package/dist/components/data-table.js +41 -15
- package/dist/components/date-picker.d.ts +31 -9
- package/dist/components/date-picker.js +100 -18
- package/dist/components/dialog.d.ts +17 -10
- package/dist/components/dialog.js +20 -13
- package/dist/components/drawer.d.ts +26 -8
- package/dist/components/drawer.js +75 -16
- package/dist/components/drawing.d.ts +25 -0
- package/dist/components/drawing.js +32 -0
- package/dist/components/empty.js +2 -2
- package/dist/components/feature-list.d.ts +65 -13
- package/dist/components/feature-list.js +116 -15
- package/dist/components/field.js +2 -2
- package/dist/components/file-drop.d.ts +9 -7
- package/dist/components/file-drop.js +8 -43
- package/dist/components/filter-bar.d.ts +10 -9
- package/dist/components/filter-bar.js +42 -25
- package/dist/components/graph.d.ts +19 -3
- package/dist/components/graph.js +170 -25
- package/dist/components/illustration.js +3 -28
- package/dist/components/input-group.d.ts +5 -10
- package/dist/components/input-group.js +16 -16
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +3 -3
- package/dist/components/item.d.ts +9 -6
- package/dist/components/item.js +13 -8
- package/dist/components/kbd.d.ts +1 -1
- package/dist/components/kbd.js +1 -1
- package/dist/components/lightbox.d.ts +76 -9
- package/dist/components/lightbox.js +333 -45
- package/dist/components/locale.d.ts +6 -6
- package/dist/components/logo.d.ts +21 -1
- package/dist/components/logo.js +32 -2
- package/dist/components/markdown-editor.d.ts +275 -0
- package/dist/components/markdown-editor.js +831 -0
- package/dist/components/mentions.d.ts +153 -0
- package/dist/components/mentions.js +507 -0
- package/dist/components/menu.d.ts +2 -1
- package/dist/components/menu.js +5 -4
- package/dist/components/menubar.d.ts +23 -5
- package/dist/components/menubar.js +97 -22
- package/dist/components/message.d.ts +62 -11
- package/dist/components/message.js +49 -13
- package/dist/components/meter.js +1 -1
- package/dist/components/money-input.d.ts +1 -1
- package/dist/components/money-input.js +1 -1
- package/dist/components/native-select.d.ts +2 -2
- package/dist/components/native-select.js +4 -4
- package/dist/components/navigation-menu.d.ts +3 -1
- package/dist/components/navigation-menu.js +23 -12
- package/dist/components/number-field.d.ts +2 -9
- package/dist/components/number-field.js +86 -36
- package/dist/components/number-roll.d.ts +26 -0
- package/dist/components/number-roll.js +81 -0
- package/dist/components/otp-field.d.ts +1 -1
- package/dist/components/otp-field.js +24 -3
- package/dist/components/pagination.d.ts +11 -3
- package/dist/components/pagination.js +59 -13
- package/dist/components/pdf-viewer.d.ts +1 -1
- package/dist/components/pdf-viewer.js +8 -8
- package/dist/components/phone-input.d.ts +1 -1
- package/dist/components/phone-input.js +2 -2
- package/dist/components/popover.js +5 -3
- package/dist/components/preview-card.d.ts +37 -2
- package/dist/components/preview-card.js +226 -2
- package/dist/components/progress.js +1 -1
- package/dist/components/prompt-input.d.ts +1 -1
- package/dist/components/prompt-input.js +24 -14
- package/dist/components/pull-to-refresh.d.ts +50 -0
- package/dist/components/pull-to-refresh.js +189 -0
- package/dist/components/quote.d.ts +6 -1
- package/dist/components/quote.js +3 -2
- package/dist/components/radio-group.js +1 -1
- package/dist/components/rating.d.ts +4 -1
- package/dist/components/rating.js +131 -10
- package/dist/components/reasoning.d.ts +1 -1
- package/dist/components/reasoning.js +7 -3
- package/dist/components/resizable.d.ts +1 -1
- package/dist/components/resizable.js +2 -2
- package/dist/components/response.d.ts +1 -1
- package/dist/components/response.js +18 -6
- package/dist/components/scheduler.d.ts +352 -0
- package/dist/components/scheduler.js +1717 -0
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/select.d.ts +17 -4
- package/dist/components/select.js +140 -9
- package/dist/components/separator.d.ts +1 -1
- package/dist/components/separator.js +3 -3
- package/dist/components/sidebar.d.ts +44 -3
- package/dist/components/sidebar.js +57 -17
- package/dist/components/site-header.d.ts +18 -13
- package/dist/components/site-header.js +23 -11
- package/dist/components/skeleton.d.ts +17 -7
- package/dist/components/skeleton.js +22 -7
- package/dist/components/slider.js +2 -2
- package/dist/components/sortable.d.ts +55 -4
- package/dist/components/sortable.js +172 -103
- package/dist/components/sources.d.ts +1 -1
- package/dist/components/sources.js +2 -2
- package/dist/components/spinner.d.ts +4 -4
- package/dist/components/spinner.js +4 -4
- package/dist/components/stat.d.ts +21 -4
- package/dist/components/stat.js +17 -8
- package/dist/components/stepper.d.ts +1 -1
- package/dist/components/stepper.js +8 -7
- package/dist/components/suggestions.d.ts +11 -3
- package/dist/components/suggestions.js +10 -4
- package/dist/components/swipe-actions.d.ts +66 -0
- package/dist/components/swipe-actions.js +292 -0
- package/dist/components/switch.js +1 -1
- package/dist/components/table.d.ts +12 -6
- package/dist/components/table.js +78 -30
- package/dist/components/tabs.js +7 -4
- package/dist/components/tag.d.ts +19 -20
- package/dist/components/tag.js +9 -5
- package/dist/components/tags-input.d.ts +2 -7
- package/dist/components/tags-input.js +11 -8
- package/dist/components/textarea.d.ts +3 -2
- package/dist/components/textarea.js +4 -3
- package/dist/components/theme.d.ts +49 -6
- package/dist/components/theme.js +147 -9
- package/dist/components/time-field.d.ts +4 -9
- package/dist/components/time-field.js +6 -6
- package/dist/components/timeline.d.ts +19 -3
- package/dist/components/timeline.js +21 -9
- package/dist/components/tippy.d.ts +17 -1
- package/dist/components/tippy.js +95 -15
- package/dist/components/toast.d.ts +2 -7
- package/dist/components/toast.js +12 -8
- package/dist/components/toggle-group.d.ts +7 -1
- package/dist/components/toggle-group.js +16 -5
- package/dist/components/toggle.d.ts +2 -2
- package/dist/components/toggle.js +3 -2
- package/dist/components/tool-call.d.ts +1 -1
- package/dist/components/tool-call.js +4 -4
- package/dist/components/toolbar.d.ts +57 -4
- package/dist/components/toolbar.js +216 -16
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +4 -2
- package/dist/components/tour.d.ts +1 -1
- package/dist/components/tour.js +36 -15
- package/dist/components/tree.js +5 -5
- package/dist/components/typography.d.ts +31 -8
- package/dist/components/typography.js +21 -10
- package/dist/components/video-player.d.ts +7 -2
- package/dist/components/video-player.js +121 -220
- package/dist/index.d.ts +99 -92
- package/dist/index.js +99 -92
- package/dist/lib/calendar.d.ts +153 -0
- package/dist/lib/calendar.js +312 -0
- package/dist/lib/cn.d.ts +3 -1
- package/dist/lib/cn.js +5 -0
- package/dist/lib/code-highlight.d.ts +14 -0
- package/dist/lib/code-highlight.js +81 -18
- package/dist/lib/drag.d.ts +39 -0
- package/dist/lib/drag.js +96 -0
- package/dist/lib/editorial-assets.js +16 -8
- package/dist/lib/figure/figures/automation.js +25 -6
- package/dist/lib/figure/figures/bar-chart.js +6 -1
- package/dist/lib/figure/figures/brackets-classic.js +4 -1
- package/dist/lib/figure/figures/city.js +12 -2
- package/dist/lib/figure/figures/conveyor.js +17 -4
- package/dist/lib/figure/figures/database.js +5 -2
- package/dist/lib/figure/figures/documents.js +11 -3
- package/dist/lib/figure/figures/inbox.js +5 -2
- package/dist/lib/figure/figures/laptop.js +3 -1
- package/dist/lib/figure/figures/pipeline.js +45 -10
- package/dist/lib/figure/figures/platform.js +62 -7
- package/dist/lib/figure/figures/server.js +21 -5
- package/dist/lib/figure/figures/spreadsheet.js +29 -5
- package/dist/lib/figure/kernel.d.ts +4 -2
- package/dist/lib/figure/kernel.js +10 -5
- package/dist/lib/figure/parts.js +6 -2
- package/dist/lib/files.d.ts +31 -0
- package/dist/lib/files.js +60 -0
- package/dist/lib/gesture.d.ts +70 -0
- package/dist/lib/gesture.js +141 -0
- package/dist/lib/glide.d.ts +5 -0
- package/dist/lib/glide.js +9 -1
- package/dist/lib/icons.d.ts +1 -0
- package/dist/lib/icons.js +6 -0
- package/dist/lib/illustration-library.js +1 -6
- package/dist/lib/markdown-edit.d.ts +112 -0
- package/dist/lib/markdown-edit.js +557 -0
- package/dist/lib/markdown-rich-editor.d.ts +188 -0
- package/dist/lib/markdown-rich-editor.js +1153 -0
- package/dist/lib/markdown-rich.d.ts +63 -0
- package/dist/lib/markdown-rich.js +534 -0
- package/dist/lib/mentions.d.ts +100 -0
- package/dist/lib/mentions.js +246 -0
- package/dist/lib/motion.d.ts +18 -0
- package/dist/lib/motion.js +43 -5
- package/dist/lib/number-roll.d.ts +89 -0
- package/dist/lib/number-roll.js +391 -0
- package/dist/lib/platform.d.ts +6 -0
- package/dist/lib/platform.js +14 -0
- package/dist/lib/portal-container.d.ts +9 -0
- package/dist/lib/portal-container.js +10 -0
- package/dist/lib/press.d.ts +5 -0
- package/dist/lib/press.js +186 -0
- package/dist/lib/scheduler.d.ts +128 -0
- package/dist/lib/scheduler.js +272 -0
- package/dist/lib/scroll-edges.d.ts +9 -0
- package/dist/lib/scroll-edges.js +50 -0
- package/dist/lib/table-fit.d.ts +1 -1
- package/dist/lib/table-fit.js +65 -8
- package/dist/lib/theme-preset.d.ts +267 -0
- package/dist/lib/theme-preset.js +1046 -0
- package/dist/lib/theme-script.d.ts +23 -3
- package/dist/lib/theme-script.js +17 -5
- package/dist/lib/tippy/sprite.d.ts +36 -4
- package/dist/lib/tippy/sprite.js +188 -15
- package/dist/lib/tone.d.ts +4 -0
- package/dist/lib/tone.js +1 -0
- package/dist/messages/de.d.ts +3 -3
- package/dist/messages/de.js +274 -3
- package/dist/skills/zon-ui/SKILL.md +279 -0
- package/dist/skills/zon-ui/references/authoring.md +265 -0
- package/dist/skills/zon-ui/references/brand.md +416 -0
- package/dist/skills/zon-ui/references/components/accordion.md +199 -0
- package/dist/skills/zon-ui/references/components/action-sheet.md +268 -0
- package/dist/skills/zon-ui/references/components/alert-dialog.md +276 -0
- package/dist/skills/zon-ui/references/components/alert.md +167 -0
- package/dist/skills/zon-ui/references/components/app-bar.md +307 -0
- package/dist/skills/zon-ui/references/components/ascii-field.md +121 -0
- package/dist/skills/zon-ui/references/components/aspect-ratio.md +112 -0
- package/dist/skills/zon-ui/references/components/audio-player.md +231 -0
- package/dist/skills/zon-ui/references/components/avatar.md +98 -0
- package/dist/skills/zon-ui/references/components/badge.md +227 -0
- package/dist/skills/zon-ui/references/components/bottom-nav.md +709 -0
- package/dist/skills/zon-ui/references/components/breadcrumb.md +143 -0
- package/dist/skills/zon-ui/references/components/button-group.md +216 -0
- package/dist/skills/zon-ui/references/components/button.md +309 -0
- package/dist/skills/zon-ui/references/components/calendar.md +296 -0
- package/dist/skills/zon-ui/references/components/card.md +158 -0
- package/dist/skills/zon-ui/references/components/carousel.md +297 -0
- package/dist/skills/zon-ui/references/components/chart.md +739 -0
- package/dist/skills/zon-ui/references/components/chat.md +417 -0
- package/dist/skills/zon-ui/references/components/checkbox.md +219 -0
- package/dist/skills/zon-ui/references/components/code-block.md +143 -0
- package/dist/skills/zon-ui/references/components/code-highlight.md +118 -0
- package/dist/skills/zon-ui/references/components/collapsible.md +146 -0
- package/dist/skills/zon-ui/references/components/color-picker.md +200 -0
- package/dist/skills/zon-ui/references/components/combobox.md +455 -0
- package/dist/skills/zon-ui/references/components/command.md +326 -0
- package/dist/skills/zon-ui/references/components/contact-form.md +562 -0
- package/dist/skills/zon-ui/references/components/context-menu.md +159 -0
- package/dist/skills/zon-ui/references/components/conversation.md +146 -0
- package/dist/skills/zon-ui/references/components/copy-button.md +162 -0
- package/dist/skills/zon-ui/references/components/crm.md +1022 -0
- package/dist/skills/zon-ui/references/components/dashboard.md +612 -0
- package/dist/skills/zon-ui/references/components/data-table.md +776 -0
- package/dist/skills/zon-ui/references/components/date-picker.md +444 -0
- package/dist/skills/zon-ui/references/components/dialog.md +335 -0
- package/dist/skills/zon-ui/references/components/direction.md +165 -0
- package/dist/skills/zon-ui/references/components/drawer.md +276 -0
- package/dist/skills/zon-ui/references/components/drawing.md +94 -0
- package/dist/skills/zon-ui/references/components/empty.md +225 -0
- package/dist/skills/zon-ui/references/components/feature-list.md +412 -0
- package/dist/skills/zon-ui/references/components/field.md +209 -0
- package/dist/skills/zon-ui/references/components/file-drop.md +234 -0
- package/dist/skills/zon-ui/references/components/filter-bar.md +485 -0
- package/dist/skills/zon-ui/references/components/form.md +970 -0
- package/dist/skills/zon-ui/references/components/graph.md +339 -0
- package/dist/skills/zon-ui/references/components/illustration.md +497 -0
- package/dist/skills/zon-ui/references/components/inbox.md +263 -0
- package/dist/skills/zon-ui/references/components/input-group.md +339 -0
- package/dist/skills/zon-ui/references/components/input.md +189 -0
- package/dist/skills/zon-ui/references/components/item.md +277 -0
- package/dist/skills/zon-ui/references/components/kanban.md +626 -0
- package/dist/skills/zon-ui/references/components/kbd.md +116 -0
- package/dist/skills/zon-ui/references/components/label.md +104 -0
- package/dist/skills/zon-ui/references/components/layout.md +291 -0
- package/dist/skills/zon-ui/references/components/lightbox.md +235 -0
- package/dist/skills/zon-ui/references/components/locale.md +279 -0
- package/dist/skills/zon-ui/references/components/logo.md +257 -0
- package/dist/skills/zon-ui/references/components/markdown-editor.md +558 -0
- package/dist/skills/zon-ui/references/components/mentions.md +512 -0
- package/dist/skills/zon-ui/references/components/menu.md +218 -0
- package/dist/skills/zon-ui/references/components/menubar.md +292 -0
- package/dist/skills/zon-ui/references/components/message.md +243 -0
- package/dist/skills/zon-ui/references/components/meter.md +105 -0
- package/dist/skills/zon-ui/references/components/money-input.md +333 -0
- package/dist/skills/zon-ui/references/components/native-select.md +197 -0
- package/dist/skills/zon-ui/references/components/navigation-menu.md +253 -0
- package/dist/skills/zon-ui/references/components/number-field.md +210 -0
- package/dist/skills/zon-ui/references/components/number-roll.md +175 -0
- package/dist/skills/zon-ui/references/components/onboarding.md +896 -0
- package/dist/skills/zon-ui/references/components/otp-field.md +166 -0
- package/dist/skills/zon-ui/references/components/pagination.md +109 -0
- package/dist/skills/zon-ui/references/components/pdf-viewer.md +177 -0
- package/dist/skills/zon-ui/references/components/phone-input.md +252 -0
- package/dist/skills/zon-ui/references/components/popover.md +176 -0
- package/dist/skills/zon-ui/references/components/preview-card.md +193 -0
- package/dist/skills/zon-ui/references/components/pricing.md +724 -0
- package/dist/skills/zon-ui/references/components/progress.md +92 -0
- package/dist/skills/zon-ui/references/components/prompt-input.md +307 -0
- package/dist/skills/zon-ui/references/components/pull-to-refresh.md +188 -0
- package/dist/skills/zon-ui/references/components/quote.md +115 -0
- package/dist/skills/zon-ui/references/components/radio-group.md +215 -0
- package/dist/skills/zon-ui/references/components/rating.md +260 -0
- package/dist/skills/zon-ui/references/components/reasoning.md +102 -0
- package/dist/skills/zon-ui/references/components/resizable.md +213 -0
- package/dist/skills/zon-ui/references/components/response.md +170 -0
- package/dist/skills/zon-ui/references/components/scheduler.md +732 -0
- package/dist/skills/zon-ui/references/components/scroll-area.md +122 -0
- package/dist/skills/zon-ui/references/components/select.md +351 -0
- package/dist/skills/zon-ui/references/components/separator.md +103 -0
- package/dist/skills/zon-ui/references/components/settings.md +793 -0
- package/dist/skills/zon-ui/references/components/shop.md +1715 -0
- package/dist/skills/zon-ui/references/components/sidebar.md +813 -0
- package/dist/skills/zon-ui/references/components/sign-in.md +1639 -0
- package/dist/skills/zon-ui/references/components/site-header.md +303 -0
- package/dist/skills/zon-ui/references/components/skeleton.md +256 -0
- package/dist/skills/zon-ui/references/components/slider.md +172 -0
- package/dist/skills/zon-ui/references/components/sortable.md +405 -0
- package/dist/skills/zon-ui/references/components/sources.md +106 -0
- package/dist/skills/zon-ui/references/components/spinner.md +222 -0
- package/dist/skills/zon-ui/references/components/stat.md +267 -0
- package/dist/skills/zon-ui/references/components/stepper.md +285 -0
- package/dist/skills/zon-ui/references/components/suggestions.md +146 -0
- package/dist/skills/zon-ui/references/components/swipe-actions.md +344 -0
- package/dist/skills/zon-ui/references/components/switch.md +160 -0
- package/dist/skills/zon-ui/references/components/table.md +999 -0
- package/dist/skills/zon-ui/references/components/tabs.md +258 -0
- package/dist/skills/zon-ui/references/components/tag.md +115 -0
- package/dist/skills/zon-ui/references/components/tags-input.md +216 -0
- package/dist/skills/zon-ui/references/components/textarea.md +95 -0
- package/dist/skills/zon-ui/references/components/theme-editor.md +3940 -0
- package/dist/skills/zon-ui/references/components/theme.md +362 -0
- package/dist/skills/zon-ui/references/components/time-field.md +222 -0
- package/dist/skills/zon-ui/references/components/timeline.md +285 -0
- package/dist/skills/zon-ui/references/components/tippy.md +243 -0
- package/dist/skills/zon-ui/references/components/toast.md +220 -0
- package/dist/skills/zon-ui/references/components/toggle-group.md +261 -0
- package/dist/skills/zon-ui/references/components/toggle.md +167 -0
- package/dist/skills/zon-ui/references/components/tool-call.md +146 -0
- package/dist/skills/zon-ui/references/components/toolbar.md +260 -0
- package/dist/skills/zon-ui/references/components/tooltip.md +172 -0
- package/dist/skills/zon-ui/references/components/tour.md +423 -0
- package/dist/skills/zon-ui/references/components/tree.md +481 -0
- package/dist/skills/zon-ui/references/components/typography.md +347 -0
- package/dist/skills/zon-ui/references/components/video-player.md +386 -0
- package/dist/skills/zon-ui/references/marketing.md +467 -0
- package/dist/skills/zon-ui/references/motion.md +455 -0
- package/dist/skills/zon-ui/references/recipes.md +1232 -0
- package/dist/skills/zon-ui/references/tokens.md +866 -0
- package/dist/sources/accordion.css +4 -0
- package/dist/sources/action-sheet.css +11 -0
- package/dist/sources/alert-dialog.css +6 -0
- package/dist/sources/alert.css +3 -0
- package/dist/sources/app-bar.css +14 -0
- package/dist/sources/ascii-field.css +3 -0
- package/dist/sources/aspect-ratio.css +3 -0
- package/dist/sources/audio-player.css +20 -0
- package/dist/sources/avatar.css +3 -0
- package/dist/sources/badge.css +3 -0
- package/dist/sources/bottom-nav.css +9 -0
- package/dist/sources/breadcrumb.css +14 -0
- package/dist/sources/button-group.css +3 -0
- package/dist/sources/button.css +9 -0
- package/dist/sources/calendar.css +13 -0
- package/dist/sources/card.css +3 -0
- package/dist/sources/carousel.css +11 -0
- package/dist/sources/chart.css +5 -0
- package/dist/sources/checkbox.css +6 -0
- package/dist/sources/code-block.css +13 -0
- package/dist/sources/collapsible.css +4 -0
- package/dist/sources/color-picker.css +13 -0
- package/dist/sources/combobox.css +13 -0
- package/dist/sources/command.css +13 -0
- package/dist/sources/context-menu.css +12 -0
- package/dist/sources/conversation.css +10 -0
- package/dist/sources/copy-button.css +10 -0
- package/dist/sources/data-table.css +27 -0
- package/dist/sources/date-picker.css +20 -0
- package/dist/sources/dialog.css +9 -0
- package/dist/sources/direction.css +2 -0
- package/dist/sources/drawer.css +9 -0
- package/dist/sources/drawing.css +5 -0
- package/dist/sources/empty.css +3 -0
- package/dist/sources/feature-list.css +4 -0
- package/dist/sources/field.css +4 -0
- package/dist/sources/file-drop.css +15 -0
- package/dist/sources/filter-bar.css +30 -0
- package/dist/sources/form.css +4 -0
- package/dist/sources/graph.css +19 -0
- package/dist/sources/illustration.css +28 -0
- package/dist/sources/input-group.css +7 -0
- package/dist/sources/input.css +3 -0
- package/dist/sources/item.css +4 -0
- package/dist/sources/kbd.css +5 -0
- package/dist/sources/label.css +3 -0
- package/dist/sources/layout.css +3 -0
- package/dist/sources/lightbox.css +33 -0
- package/dist/sources/locale.css +2 -0
- package/dist/sources/logo.css +4 -0
- package/dist/sources/markdown-editor.css +41 -0
- package/dist/sources/mentions.css +13 -0
- package/dist/sources/menu.css +11 -0
- package/dist/sources/menubar.css +14 -0
- package/dist/sources/message.css +16 -0
- package/dist/sources/meter.css +4 -0
- package/dist/sources/money-input.css +10 -0
- package/dist/sources/native-select.css +4 -0
- package/dist/sources/navigation-menu.css +8 -0
- package/dist/sources/number-field.css +8 -0
- package/dist/sources/number-roll.css +6 -0
- package/dist/sources/otp-field.css +5 -0
- package/dist/sources/pagination.css +11 -0
- package/dist/sources/pdf-viewer.css +30 -0
- package/dist/sources/phone-input.css +20 -0
- package/dist/sources/popover.css +7 -0
- package/dist/sources/preview-card.css +7 -0
- package/dist/sources/progress.css +4 -0
- package/dist/sources/prompt-input.css +15 -0
- package/dist/sources/pull-to-refresh.css +14 -0
- package/dist/sources/quote.css +3 -0
- package/dist/sources/radio-group.css +5 -0
- package/dist/sources/rating.css +6 -0
- package/dist/sources/reasoning.css +6 -0
- package/dist/sources/resizable.css +4 -0
- package/dist/sources/response.css +16 -0
- package/dist/sources/scheduler.css +44 -0
- package/dist/sources/scroll-area.css +3 -0
- package/dist/sources/select.css +12 -0
- package/dist/sources/separator.css +3 -0
- package/dist/sources/sidebar.css +19 -0
- package/dist/sources/site-header.css +15 -0
- package/dist/sources/skeleton.css +3 -0
- package/dist/sources/slider.css +6 -0
- package/dist/sources/sortable.css +12 -0
- package/dist/sources/sources.css +6 -0
- package/dist/sources/spinner.css +6 -0
- package/dist/sources/stat.css +9 -0
- package/dist/sources/stepper.css +6 -0
- package/dist/sources/suggestions.css +10 -0
- package/dist/sources/swipe-actions.css +20 -0
- package/dist/sources/switch.css +5 -0
- package/dist/sources/table.css +7 -0
- package/dist/sources/tabs.css +5 -0
- package/dist/sources/tag.css +3 -0
- package/dist/sources/tags-input.css +6 -0
- package/dist/sources/textarea.css +3 -0
- package/dist/sources/theme.css +13 -0
- package/dist/sources/time-field.css +7 -0
- package/dist/sources/timeline.css +7 -0
- package/dist/sources/tippy.css +6 -0
- package/dist/sources/toast.css +6 -0
- package/dist/sources/toggle-group.css +5 -0
- package/dist/sources/toggle.css +3 -0
- package/dist/sources/tool-call.css +16 -0
- package/dist/sources/toolbar.css +14 -0
- package/dist/sources/tooltip.css +6 -0
- package/dist/sources/tour.css +14 -0
- package/dist/sources/tree.css +6 -0
- package/dist/sources/typography.css +4 -0
- package/dist/sources/video-player.css +21 -0
- package/dist/styles/ai.css +3 -0
- package/dist/styles/brand.css +98 -0
- package/dist/styles/core.css +266 -0
- package/dist/styles/editor.css +3 -0
- package/dist/styles/expressive.css +35 -56
- package/dist/styles/fonts.css +61 -117
- package/dist/styles/graph.css +4 -0
- package/dist/styles/illustration.css +4 -0
- package/dist/styles/index.css +11 -201
- package/dist/styles/material.css +138 -12
- package/dist/styles/parts/ai.css +18 -13
- package/dist/styles/parts/brand.css +2 -2
- package/dist/styles/parts/controls.css +29 -20
- package/dist/styles/parts/data.css +13 -9
- package/dist/styles/parts/editor.css +372 -0
- package/dist/styles/parts/feedback.css +32 -2
- package/dist/styles/parts/foundations.css +12 -7
- package/dist/styles/parts/graph.css +25 -9
- package/dist/styles/parts/inputs.css +172 -9
- package/dist/styles/parts/isometric.css +6 -5
- package/dist/styles/parts/navigation.css +206 -27
- package/dist/styles/parts/overlays.css +19 -4
- package/dist/styles/parts/pdf.css +2 -2
- package/dist/styles/pdf.css +3 -0
- package/dist/styles/prose.css +3 -0
- package/dist/styles/tokens.css +89 -14
- package/dist/theme.d.ts +1 -0
- package/dist/theme.js +5 -0
- package/dist/vite.d.ts +48 -59
- package/dist/vite.js +54 -21
- package/package.json +69 -2
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Alert
|
|
2
|
+
|
|
3
|
+
```tsx
|
|
4
|
+
import { Alert, AlertDescription, AlertTitle } from "@zonsh/ui";
|
|
5
|
+
import { CalendarClockIcon } from "lucide-react";
|
|
6
|
+
|
|
7
|
+
export function Basic() {
|
|
8
|
+
return (
|
|
9
|
+
<Alert className="max-w-xl">
|
|
10
|
+
<CalendarClockIcon />
|
|
11
|
+
<AlertTitle>Sync pauses on Sunday from 02:00 to 04:00</AlertTitle>
|
|
12
|
+
<AlertDescription>
|
|
13
|
+
We are moving the database to a new server. Changes made in that window are queued and sent once the
|
|
14
|
+
sync is back.
|
|
15
|
+
</AlertDescription>
|
|
16
|
+
</Alert>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
An inline message about a part of the page — a notice above a form, a failed export. It is a square **region** in `surface-container`, not an object: an icon column, a medium title, a muted description and an optional action.
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { Alert, AlertDescription, AlertTitle } from "@zonsh/ui";
|
|
27
|
+
import { CalendarClockIcon } from "lucide-react";
|
|
28
|
+
|
|
29
|
+
<Alert>
|
|
30
|
+
<CalendarClockIcon />
|
|
31
|
+
<AlertTitle>Sync pauses on Sunday from 02:00 to 04:00</AlertTitle>
|
|
32
|
+
<AlertDescription>Changes made in that window are queued and sent afterwards.</AlertDescription>
|
|
33
|
+
</Alert>;
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The props you'll reach for: `tone`, `role`, and a lucide icon as the first child (sized and placed for you).
|
|
37
|
+
|
|
38
|
+
## When to use
|
|
39
|
+
|
|
40
|
+
- `default` — a notice with no status.
|
|
41
|
+
- `success` — something finished or is set up.
|
|
42
|
+
- `warning` — something will need attention: an expiring key, a nearly reached limit.
|
|
43
|
+
- `info` — neutral news: a maintenance window.
|
|
44
|
+
- `destructive` — something failed or is blocked and needs the reader.
|
|
45
|
+
- A short confirmation of what the user just did is a `toast()`; a decision before going on is an `AlertDialog`; a field's validation is a `FieldError`.
|
|
46
|
+
|
|
47
|
+
## Examples
|
|
48
|
+
|
|
49
|
+
### With action
|
|
50
|
+
|
|
51
|
+
`AlertAction` takes one small `secondary` or `ghost` button — never a primary competing with the page's own.
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
import { Alert, AlertAction, AlertDescription, AlertTitle, Button } from "@zonsh/ui";
|
|
55
|
+
import { GitBranchIcon } from "lucide-react";
|
|
56
|
+
|
|
57
|
+
export function WithAction() {
|
|
58
|
+
return (
|
|
59
|
+
<Alert className="max-w-xl">
|
|
60
|
+
<GitBranchIcon />
|
|
61
|
+
<AlertTitle>A newer version of this template is available</AlertTitle>
|
|
62
|
+
<AlertDescription>
|
|
63
|
+
It adds a table of contents and fixes the page numbers in the footer.
|
|
64
|
+
</AlertDescription>
|
|
65
|
+
<AlertAction>
|
|
66
|
+
<Button size="sm" variant="secondary">
|
|
67
|
+
Review changes
|
|
68
|
+
</Button>
|
|
69
|
+
</AlertAction>
|
|
70
|
+
</Alert>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Status
|
|
76
|
+
|
|
77
|
+
Tones colour only the icon and title. Without colour, each alert still says what kind it is, and a `destructive` one what to do next.
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
import { Alert, AlertDescription, AlertTitle } from "@zonsh/ui";
|
|
81
|
+
import { CircleAlertIcon, CircleCheckIcon, InfoIcon, TriangleAlertIcon } from "lucide-react";
|
|
82
|
+
|
|
83
|
+
export function Status() {
|
|
84
|
+
return (
|
|
85
|
+
<div className="flex max-w-xl flex-col gap-3">
|
|
86
|
+
<Alert tone="info">
|
|
87
|
+
<InfoIcon />
|
|
88
|
+
<AlertTitle>Drafts are visible to your team only</AlertTitle>
|
|
89
|
+
</Alert>
|
|
90
|
+
<Alert tone="success">
|
|
91
|
+
<CircleCheckIcon />
|
|
92
|
+
<AlertTitle>Deployment finished</AlertTitle>
|
|
93
|
+
<AlertDescription>
|
|
94
|
+
Version 2.4 is live. <a href="#changelog">Read the change log</a>.
|
|
95
|
+
</AlertDescription>
|
|
96
|
+
</Alert>
|
|
97
|
+
<Alert tone="warning">
|
|
98
|
+
<TriangleAlertIcon />
|
|
99
|
+
<AlertTitle>The API key for your shop expires in 7 days</AlertTitle>
|
|
100
|
+
<AlertDescription>Create a new key in the shop settings and paste it here.</AlertDescription>
|
|
101
|
+
</Alert>
|
|
102
|
+
<Alert tone="destructive">
|
|
103
|
+
<CircleAlertIcon />
|
|
104
|
+
<AlertTitle>The export failed</AlertTitle>
|
|
105
|
+
<AlertDescription>
|
|
106
|
+
Three rows have no date, and the spreadsheet needs one in every row. Fill them in and export again.
|
|
107
|
+
</AlertDescription>
|
|
108
|
+
</Alert>
|
|
109
|
+
</div>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Description only
|
|
115
|
+
|
|
116
|
+
A one-line notice can drop the title.
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
import { Alert, AlertDescription } from "@zonsh/ui";
|
|
120
|
+
import { InfoIcon } from "lucide-react";
|
|
121
|
+
|
|
122
|
+
export function DescriptionOnly() {
|
|
123
|
+
return (
|
|
124
|
+
<Alert className="max-w-xl">
|
|
125
|
+
<InfoIcon />
|
|
126
|
+
<AlertDescription>
|
|
127
|
+
Imports run every night at 01:00. You can also start one by hand from the toolbar.
|
|
128
|
+
</AlertDescription>
|
|
129
|
+
</Alert>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Props
|
|
135
|
+
|
|
136
|
+
| Prop | Type | Default |
|
|
137
|
+
| --------- | ---------------------------------------------------------------- | ------------------------------------------ |
|
|
138
|
+
| `tone` | `"default" \| "success" \| "warning" \| "info" \| "destructive"` | `"default"` |
|
|
139
|
+
| `role` | `string` | `"status"`, or `"alert"` for `destructive` |
|
|
140
|
+
|
|
141
|
+
All parts forward `<div>` props. Data attributes: `data-slot="alert"`, `data-tone`.
|
|
142
|
+
|
|
143
|
+
| Part | Renders | Notes |
|
|
144
|
+
| ------------------ | ------- | ------------------------------------------------------------------------ |
|
|
145
|
+
| `AlertTitle` | `div` | Licht Sans 14px medium, foreground (the status colour in a status tone). |
|
|
146
|
+
| `AlertDescription` | `div` | Muted 14px; links take the brand underline. |
|
|
147
|
+
| `AlertAction` | `div` | End column, vertically centred; small buttons only. |
|
|
148
|
+
|
|
149
|
+
## Brand rules
|
|
150
|
+
|
|
151
|
+
- **Do** keep the surface monochrome; a status tone colours only the icon and the title.
|
|
152
|
+
- **Do** write what happened and what to do next, in plain words.
|
|
153
|
+
- **Do** pair each status with its icon: `InfoIcon`, `CircleCheckIcon`, `TriangleAlertIcon`, `CircleAlertIcon`.
|
|
154
|
+
- **Don't** add a tinted or coloured fill, or pick a tone for its colour — `warning` is not "important".
|
|
155
|
+
- **Don't** round it or give it a shadow; it is part of the page, a square region.
|
|
156
|
+
- **Don't** stack several alerts where one would do, or use one as decoration.
|
|
157
|
+
|
|
158
|
+
## Accessibility
|
|
159
|
+
|
|
160
|
+
- `destructive` is `role="alert"`; every other tone is `role="status"`. Live regions announce content added after load; an alert present from the start is read in order. Pass `role` to override, e.g. `role="note"` for static guidance.
|
|
161
|
+
- Meaning is in the text, never only the red ink: "The export failed", not just a red icon.
|
|
162
|
+
- The icon is decorative; lucide icons render `aria-hidden` by default.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
- Import: `import { Alert, AlertTitle, AlertDescription, AlertAction } from "@zonsh/ui"`
|
|
167
|
+
- Source: `packages/ui/src/components/alert.tsx`
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
# App Bar
|
|
2
|
+
|
|
3
|
+
```tsx
|
|
4
|
+
import { AppBar, AppBarAction, AppBarSearch } from "@zonsh/ui";
|
|
5
|
+
import { PlusIcon } from "lucide-react";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A phone-sized screen for the demos: 390px wide, its content scrolling inside. The AppBar sticks
|
|
10
|
+
* to the top of this scroller, as it would to the top of a phone's page.
|
|
11
|
+
*/
|
|
12
|
+
function Phone({ label, children }: { label: string; children: React.ReactNode }) {
|
|
13
|
+
return (
|
|
14
|
+
<div className="relative mx-auto h-[600px] w-full max-w-[390px] overflow-hidden border border-field-edge">
|
|
15
|
+
{/* Focusable, so the screen scrolls from the keyboard too. */}
|
|
16
|
+
<div
|
|
17
|
+
role="region"
|
|
18
|
+
aria-label={label}
|
|
19
|
+
tabIndex={0}
|
|
20
|
+
data-slot="demo-phone-screen"
|
|
21
|
+
className="h-full overflow-y-auto focus-ring"
|
|
22
|
+
>
|
|
23
|
+
{children}
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const notes = [
|
|
30
|
+
{ title: "Sourdough schedule", meta: "Feed the starter at 8, bake at 18:00", when: "Today" },
|
|
31
|
+
{ title: "Flat viewing questions", meta: "Heating costs, the bike room, notice period", when: "Today" },
|
|
32
|
+
{ title: "Reading list", meta: "The Overstory, Piranesi, A Swim in a Pond in the Rain", when: "Yesterday" },
|
|
33
|
+
{ title: "Allotment plan", meta: "Beans along the fence, squash in the far bed", when: "Mon" },
|
|
34
|
+
{ title: "Gift ideas", meta: "Linen apron for Jun, a fountain pen for Theo", when: "Sun" },
|
|
35
|
+
{ title: "Trip to Porto", meta: "Train from Lisbon 09:39, two nights in Ribeira", when: "Sat" },
|
|
36
|
+
{ title: "Running log", meta: "5 km easy on Tuesday, intervals on Thursday", when: "Fri" },
|
|
37
|
+
{ title: "Kitchen shelves", meta: "Measure the alcove: 84 cm wide, 30 deep", when: "Thu" },
|
|
38
|
+
{ title: "Spanish verbs", meta: "Ser and estar, with ten example sentences", when: "Wed" },
|
|
39
|
+
{ title: "Bike service", meta: "Brake pads, chain, the rear wheel is out of true", when: "Oct 12" },
|
|
40
|
+
{ title: "Book club, November", meta: "Tomorrow, and Tomorrow, and Tomorrow — at Ana's", when: "Oct 9" },
|
|
41
|
+
{ title: "Tax return", meta: "Receipts for the desk and the train pass", when: "Oct 2" },
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
/** Whether a row's words contain what was typed, ignoring case and the spaces around it. */
|
|
45
|
+
const matches = (query: string, ...fields: string[]) =>
|
|
46
|
+
fields.join(" ").toLowerCase().includes(query.trim().toLowerCase());
|
|
47
|
+
|
|
48
|
+
function NoMatch({ children }: { children: React.ReactNode }) {
|
|
49
|
+
return (
|
|
50
|
+
<p className="px-4 py-8 text-center text-13 text-muted-foreground" aria-live="polite">
|
|
51
|
+
{children}
|
|
52
|
+
</p>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function NoteRows({ query }: { query: string }) {
|
|
57
|
+
const shown = notes.filter((note) => matches(query, note.title, note.meta));
|
|
58
|
+
if (!shown.length) return <NoMatch>No notes match “{query.trim()}”.</NoMatch>;
|
|
59
|
+
return (
|
|
60
|
+
<ul className="px-4 pb-8">
|
|
61
|
+
{shown.map((note) => (
|
|
62
|
+
<li key={note.title} className="border-t border-border/60 py-3.5 first:border-t-0">
|
|
63
|
+
<div className="flex items-baseline justify-between gap-3">
|
|
64
|
+
<p className="truncate text-15 text-foreground">{note.title}</p>
|
|
65
|
+
<span className="shrink-0 font-mono text-11 text-muted-foreground">{note.when}</span>
|
|
66
|
+
</div>
|
|
67
|
+
<p className="mt-0.5 truncate text-13 text-muted-foreground">{note.meta}</p>
|
|
68
|
+
</li>
|
|
69
|
+
))}
|
|
70
|
+
</ul>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function Basic() {
|
|
75
|
+
const [query, setQuery] = React.useState("");
|
|
76
|
+
return (
|
|
77
|
+
<Phone label="Notes screen">
|
|
78
|
+
<AppBar
|
|
79
|
+
title="Notes"
|
|
80
|
+
largeTitle
|
|
81
|
+
actions={<AppBarAction icon={<PlusIcon />} label="New note" />}
|
|
82
|
+
search={<AppBarSearch value={query} onChange={(event) => setQuery(event.target.value)} />}
|
|
83
|
+
/>
|
|
84
|
+
<NoteRows query={query} />
|
|
85
|
+
</Phone>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The top of a phone screen: what you can go back to at the start, the screen's title in the middle, and up to three actions at the end. It sticks to the top of whatever scrolls, clear of the status bar and the rounded corners of the screen (the safe-area insets). At the top it is part of the page; as soon as the content runs under it, it takes the page ground and, once the title has gone under, a hairline — tied to the scroll position itself, as a scrolled `SiteHeader` is, never to a timer.
|
|
91
|
+
|
|
92
|
+
With `largeTitle` the title starts large under the bar, in Licht, and the bar's own small title fades in as the large one goes under it. `search` puts a field under the title that scrolls away with it. The field reports what is typed through `onChange`, and the screen filters its own list: the demo above filters its notes as you type. Once there is text, a round clear button empties the field and keeps the keyboard up.
|
|
93
|
+
|
|
94
|
+
Every button in the bar answers a finger the moment it lands: the ghost material sinks at once rather than once the browser is sure the touch is not a scroll, and lets go if the finger moves.
|
|
95
|
+
|
|
96
|
+
## When to use
|
|
97
|
+
|
|
98
|
+
- The top of every phone screen in an app: a list's top level with `largeTitle` (Inbox, Notes, Library), a screen pushed from it with `AppBarBack` and the title in the bar.
|
|
99
|
+
- A desktop page or a marketing site: `SiteHeader`. In an app shell on a wide screen, the `Sidebar` and the page's own heading.
|
|
100
|
+
- Switching between top-level places: a `BottomNav` at the bottom, never tabs in the bar.
|
|
101
|
+
|
|
102
|
+
## Usage
|
|
103
|
+
|
|
104
|
+
```tsx
|
|
105
|
+
import { AppBar, AppBarAction, AppBarBack, AppBarSearch } from "@zonsh/ui";
|
|
106
|
+
import { PlusIcon } from "lucide-react";
|
|
107
|
+
|
|
108
|
+
<main className="h-dvh overflow-y-auto">
|
|
109
|
+
<AppBar
|
|
110
|
+
title="Notes"
|
|
111
|
+
largeTitle
|
|
112
|
+
actions={<AppBarAction icon={<PlusIcon />} label="New note" />}
|
|
113
|
+
search={<AppBarSearch value={query} onChange={(e) => setQuery(e.target.value)} />}
|
|
114
|
+
/>
|
|
115
|
+
…the list…
|
|
116
|
+
</main>;
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Put the bar first in the element that scrolls (or the page), beside the content, not in a wrapper of its own: it renders the sticky bar and, with `largeTitle`, the large title after it, so the bar stays while the title scrolls away. It follows the nearest scrolling ancestor, or the window. The safe areas need `viewport-fit=cover` in the viewport meta.
|
|
120
|
+
|
|
121
|
+
## Examples
|
|
122
|
+
|
|
123
|
+
### A pushed screen
|
|
124
|
+
|
|
125
|
+
`AppBarBack` with the previous screen's title beside the chevron ("Notes"); its name reads "Back to Notes". The title is in the bar from the start, and the hairline comes in as the text scrolls under it.
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
import { AppBar, AppBarAction, AppBarBack, Text } from "@zonsh/ui";
|
|
129
|
+
import { EllipsisIcon, ShareIcon } from "lucide-react";
|
|
130
|
+
import * as React from "react";
|
|
131
|
+
|
|
132
|
+
// Phone: as in the first example on this page that uses them.
|
|
133
|
+
|
|
134
|
+
export function Detail() {
|
|
135
|
+
return (
|
|
136
|
+
<Phone label="Note screen">
|
|
137
|
+
<AppBar
|
|
138
|
+
title="Sourdough schedule"
|
|
139
|
+
back={<AppBarBack>Notes</AppBarBack>}
|
|
140
|
+
actions={
|
|
141
|
+
<>
|
|
142
|
+
<AppBarAction icon={<ShareIcon />} label="Share" />
|
|
143
|
+
<AppBarAction icon={<EllipsisIcon />} label="More" />
|
|
144
|
+
</>
|
|
145
|
+
}
|
|
146
|
+
/>
|
|
147
|
+
<div className="flex flex-col gap-4 px-5 pt-4 pb-10">
|
|
148
|
+
{[
|
|
149
|
+
"Feed the starter at 8 in the morning: 50 g flour, 50 g water, and leave it by the radiator.",
|
|
150
|
+
"Mix the dough at noon — 500 g flour, 350 g water, 100 g starter — and rest it for an hour before the salt.",
|
|
151
|
+
"Four sets of stretch and fold, half an hour apart. Then let it rise until it has grown by half.",
|
|
152
|
+
"Shape it, put it in the banneton and into the fridge overnight, or for two hours if baking today.",
|
|
153
|
+
"Bake at 250 °C in the cast-iron pot: 20 minutes with the lid on, 25 without, until it sounds hollow.",
|
|
154
|
+
"Let it cool for an hour before cutting, however good it smells.",
|
|
155
|
+
"Next time: try 10% rye, and a little less water if the kitchen is warm.",
|
|
156
|
+
].map((line) => (
|
|
157
|
+
<Text key={line} size="sm">
|
|
158
|
+
{line}
|
|
159
|
+
</Text>
|
|
160
|
+
))}
|
|
161
|
+
</div>
|
|
162
|
+
</Phone>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Search in the bar
|
|
168
|
+
|
|
169
|
+
Without `largeTitle`, `search` sits in the bar itself, under the title, and stays: for a screen that is mostly a search. `AppBarBack` with no children is the chevron alone, named "Back".
|
|
170
|
+
|
|
171
|
+
```tsx
|
|
172
|
+
import { AppBar, AppBarAction, AppBarBack, AppBarSearch } from "@zonsh/ui";
|
|
173
|
+
import { SlidersHorizontalIcon } from "lucide-react";
|
|
174
|
+
import * as React from "react";
|
|
175
|
+
|
|
176
|
+
// Phone, matches, NoMatch: as in the first example on this page that uses them.
|
|
177
|
+
|
|
178
|
+
const ceramics = [
|
|
179
|
+
["Speckled mug, 350 ml", "€24"],
|
|
180
|
+
["Shallow bowl, oat glaze", "€32"],
|
|
181
|
+
["Serving plate, 28 cm", "€48"],
|
|
182
|
+
["Bud vase, celadon", "€18"],
|
|
183
|
+
["Teapot, 1 litre", "€64"],
|
|
184
|
+
["Pasta bowls, set of two", "€44"],
|
|
185
|
+
["Butter dish with lid", "€29"],
|
|
186
|
+
["Espresso cups, set of four", "€38"],
|
|
187
|
+
["Pitcher, 600 ml", "€36"],
|
|
188
|
+
["Salad bowl, 30 cm", "€58"],
|
|
189
|
+
] as const;
|
|
190
|
+
|
|
191
|
+
export function Filters() {
|
|
192
|
+
const [query, setQuery] = React.useState("");
|
|
193
|
+
const shown = ceramics.filter(([title]) => matches(query, title));
|
|
194
|
+
return (
|
|
195
|
+
<Phone label="Shop screen">
|
|
196
|
+
<AppBar
|
|
197
|
+
title="Ceramics"
|
|
198
|
+
back={<AppBarBack />}
|
|
199
|
+
actions={<AppBarAction icon={<SlidersHorizontalIcon />} label="Filter" />}
|
|
200
|
+
search={
|
|
201
|
+
<AppBarSearch
|
|
202
|
+
placeholder="Search ceramics"
|
|
203
|
+
value={query}
|
|
204
|
+
onChange={(event) => setQuery(event.target.value)}
|
|
205
|
+
/>
|
|
206
|
+
}
|
|
207
|
+
/>
|
|
208
|
+
{shown.length === 0 && <NoMatch>Nothing in ceramics matches “{query.trim()}”.</NoMatch>}
|
|
209
|
+
<ul className="px-4 pb-8">
|
|
210
|
+
{shown.map(([title, price]) => (
|
|
211
|
+
<li
|
|
212
|
+
key={title}
|
|
213
|
+
className="flex items-baseline justify-between gap-3 border-t border-border/60 py-3.5 first:border-t-0"
|
|
214
|
+
>
|
|
215
|
+
<span className="truncate text-15">{title}</span>
|
|
216
|
+
<span className="font-mono text-13 text-muted-foreground tabular-nums">{price}</span>
|
|
217
|
+
</li>
|
|
218
|
+
))}
|
|
219
|
+
</ul>
|
|
220
|
+
</Phone>
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Router links
|
|
226
|
+
|
|
227
|
+
`AppBarBack` takes `href` for a plain link, or the router's link as `render`:
|
|
228
|
+
|
|
229
|
+
```tsx
|
|
230
|
+
import { Link } from "react-router";
|
|
231
|
+
|
|
232
|
+
<AppBar title="Sourdough schedule" back={<AppBarBack render={<Link to="/notes" />}>Notes</AppBarBack>} />;
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## Props
|
|
236
|
+
|
|
237
|
+
### AppBar
|
|
238
|
+
|
|
239
|
+
| Prop | Type | Default | Notes |
|
|
240
|
+
| -------------- | ---------------------------- | ------- | ----------------------------------------------------------------------------------------------------- |
|
|
241
|
+
| `title` | `ReactNode` | — | The screen's name, one short line. Its heading. |
|
|
242
|
+
| `largeTitle` | `boolean` | `false` | The title large under the bar, folding into it as the content scrolls. For a screen's top level. |
|
|
243
|
+
| `back` | `ReactNode` | — | The leading control: an `AppBarBack`, or one `AppBarAction`. |
|
|
244
|
+
| `actions` | `ReactNode` | — | One to three `AppBarAction`s, or a text `Button` ("Done"). |
|
|
245
|
+
| `search` | `ReactNode` | — | An `AppBarSearch` under the title: under the large title it scrolls away with it; otherwise it stays. |
|
|
246
|
+
| `headingLevel` | `1 \| 2 \| 3 \| 4 \| 5 \| 6` | `1` | The title's heading level. |
|
|
247
|
+
| `scrolled` | `boolean` | — | Force the scrolled look (ground, hairline, small title) on or off instead of following the scroll. |
|
|
248
|
+
| `ref` | `Ref<HTMLElement>` | — | The `<header>`. |
|
|
249
|
+
|
|
250
|
+
Every other prop goes to the `<header>`.
|
|
251
|
+
|
|
252
|
+
### AppBarBack
|
|
253
|
+
|
|
254
|
+
| Prop | Type | Default | Notes |
|
|
255
|
+
| ---------- | ------------------------- | ------- | ----------------------------------------------------------------------------- |
|
|
256
|
+
| `children` | `ReactNode` | — | The previous screen's title beside the chevron. Without it, the chevron only. |
|
|
257
|
+
| `href` | `string` | — | Renders an `<a>`. |
|
|
258
|
+
| `render` | `ReactElement` | — | A router link. |
|
|
259
|
+
| `labels` | `Partial<AppBarMessages>` | — | `back` ("Back") and `backTo(title)` ("Back to Notes"), its name. |
|
|
260
|
+
|
|
261
|
+
Every other prop goes to the `Button`.
|
|
262
|
+
|
|
263
|
+
### AppBarAction
|
|
264
|
+
|
|
265
|
+
| Prop | Type | Default | Notes |
|
|
266
|
+
| ------- | ----------- | ------- | ----------------------------------- |
|
|
267
|
+
| `icon` | `ReactNode` | — | A lucide icon, drawn at 20px. |
|
|
268
|
+
| `label` | `string` | — | What it does, read aloud. Required. |
|
|
269
|
+
|
|
270
|
+
Every other prop goes to the round ghost `Button`.
|
|
271
|
+
|
|
272
|
+
### AppBarSearch
|
|
273
|
+
|
|
274
|
+
| Prop | Type | Default | Notes |
|
|
275
|
+
| ---------------- | ------------------------- | ------- | -------------------------------------------------------------------------------------- |
|
|
276
|
+
| `labels` | `Partial<AppBarMessages>` | — | `search`: the placeholder and name; `clear`: the clear button's name ("Clear search"). |
|
|
277
|
+
| `groupClassName` | `string` | — | Classes for the field around the input. |
|
|
278
|
+
|
|
279
|
+
Every other prop goes to the `<input type="search">`: `value` or `defaultValue`, `onChange`, `placeholder`. The clear button calls `onChange` with an empty value, as typing would, so a controlled field empties too.
|
|
280
|
+
|
|
281
|
+
## Brand rules
|
|
282
|
+
|
|
283
|
+
- **Do** keep the bar to a back button, a title and at most three actions, icons people know. Anything more goes behind one "More" action in a `Menu` or an `ActionSheet`.
|
|
284
|
+
- **Do** name the large title as the screen's place, one or two words, in Licht; the bar never takes a logo or a colour.
|
|
285
|
+
- **Don't** draw a fill, a shadow or a blur on it: it is the page ground behind a hairline, and only once something runs under it.
|
|
286
|
+
- **Don't** put a primary button in the bar. A screen's one main action is a `BottomNavAction`, or a text "Done" or "Save" as a ghost `Button` in `actions`.
|
|
287
|
+
|
|
288
|
+
## Accessibility
|
|
289
|
+
|
|
290
|
+
- A `<header>` with the title as a heading (`h1` by default). With `largeTitle` the large title is the heading and the bar's small copy is hidden from screen readers, so the title is read once.
|
|
291
|
+
- `AppBarBack` is named "Back", or "Back to Notes" when it shows the previous title; its chevron mirrors right to left. Each `AppBarAction` is named by its `label`.
|
|
292
|
+
- `AppBarSearch` is a search field named by its placeholder, at 16px so a phone does not zoom in, with the keyboard's Search key. Its clear button is named "Clear search" and leaves focus in the field.
|
|
293
|
+
- Round 36px buttons take a 44px tap area on a touch screen; focus shows the 2px outline.
|
|
294
|
+
- In forced colours the scrolled hairline is drawn in `CanvasText`.
|
|
295
|
+
|
|
296
|
+
### Keyboard
|
|
297
|
+
|
|
298
|
+
| Key | What it does |
|
|
299
|
+
| --------------- | --------------------------------------------------------------- |
|
|
300
|
+
| Tab / Shift+Tab | Moves through the back button, the actions and the search field |
|
|
301
|
+
| Enter / Space | Presses the focused button, or follows the back link |
|
|
302
|
+
| Escape | In the search field: empties it; on an empty field, leaves it |
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
- Import: `import { AppBar, AppBarBack, AppBarAction, AppBarSearch } from "@zonsh/ui"`
|
|
307
|
+
- Source: `packages/ui/src/components/app-bar.tsx`
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# AsciiField
|
|
2
|
+
|
|
3
|
+
```tsx
|
|
4
|
+
import { AsciiField } from "@zonsh/ui/brand";
|
|
5
|
+
|
|
6
|
+
export function Brackets() {
|
|
7
|
+
return (
|
|
8
|
+
<div className="relative h-[420px] w-full overflow-hidden">
|
|
9
|
+
<AsciiField />
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
A canvas of Licht Mono characters whose densest gather into a soft silhouette — the two brackets or the zon crescent — while a few flicker and the field brightens under the pointer. It inks with `currentColor` at low alpha, so it follows the theme (and `.theme-night` / `.theme-dark` scopes). The brackets come from `assets/logo.svg`, never stretched; on wide containers they open apart to frame centred content.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import { AsciiField } from "@zonsh/ui/brand";
|
|
21
|
+
|
|
22
|
+
<section className="relative min-h-[560px]">
|
|
23
|
+
<AsciiField mask="crescent" />
|
|
24
|
+
{/* the headline and actions, above it */}
|
|
25
|
+
</section>;
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
It fills its nearest positioned ancestor (`absolute inset-0`): give that parent `relative` and a height. The props you'll reach for: `mask`, `spread`, `intensity`.
|
|
29
|
+
|
|
30
|
+
## When to use
|
|
31
|
+
|
|
32
|
+
- Behind a home page's opening view, or a closing CTA on a dark ground.
|
|
33
|
+
- Once per page; a second makes it wallpaper.
|
|
34
|
+
|
|
35
|
+
## Examples
|
|
36
|
+
|
|
37
|
+
### Crescent
|
|
38
|
+
|
|
39
|
+
`mask="crescent"`: the mark, tilted 14°, the dark side empty with a faint limb. `spread` does not apply.
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { AsciiField } from "@zonsh/ui/brand";
|
|
43
|
+
|
|
44
|
+
export function Crescent() {
|
|
45
|
+
return (
|
|
46
|
+
<div className="relative h-[420px] w-full overflow-hidden">
|
|
47
|
+
<AsciiField mask="crescent" />
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Logo spacing
|
|
54
|
+
|
|
55
|
+
`spread={0}` keeps the logo's spacing, for square or portrait frames.
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { AsciiField } from "@zonsh/ui/brand";
|
|
59
|
+
|
|
60
|
+
export function LogoSpacing() {
|
|
61
|
+
return (
|
|
62
|
+
<div className="relative mx-auto aspect-square w-full max-w-[420px] overflow-hidden">
|
|
63
|
+
<AsciiField spread={0} density={1.4} />
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Texture
|
|
70
|
+
|
|
71
|
+
`mask="none"`: an even texture, no silhouette.
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
import { AsciiField } from "@zonsh/ui/brand";
|
|
75
|
+
|
|
76
|
+
export function Texture() {
|
|
77
|
+
return (
|
|
78
|
+
<div className="relative h-[240px] w-full overflow-hidden">
|
|
79
|
+
<AsciiField mask="none" intensity={0.8} />
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Props
|
|
86
|
+
|
|
87
|
+
| Prop | Type | Default |
|
|
88
|
+
| ----------- | ------------------------------------ | ------------ |
|
|
89
|
+
| `density` | `number` (0.5–1.6) | `1` (13px) |
|
|
90
|
+
| `intensity` | `number` (0–1.5) | `1` |
|
|
91
|
+
| `mask` | `"brackets" \| "crescent" \| "none"` | `"brackets"` |
|
|
92
|
+
| `spread` | `number` (0–1) | `1` |
|
|
93
|
+
| `seed` | `number` | `7` |
|
|
94
|
+
| `className` | `string` | — |
|
|
95
|
+
|
|
96
|
+
Colour comes from `currentColor`: change it with a text class (`text-foreground-soft`), not a prop. All other `<div>` props are forwarded. Slot: `ascii-field`; `data-mask` reflects the mask.
|
|
97
|
+
|
|
98
|
+
## Motion and performance
|
|
99
|
+
|
|
100
|
+
- Canvas at `devicePixelRatio` (max 2), drawn from a glyph atlas at ~30fps.
|
|
101
|
+
- Pauses when offscreen (`IntersectionObserver`) and when the tab is hidden.
|
|
102
|
+
- **Fully static** under `prefers-reduced-motion`, on coarse pointers and below 768px: one frame, redrawn only on resize or theme change.
|
|
103
|
+
- Re-inks on theme change and once Licht Mono loads.
|
|
104
|
+
|
|
105
|
+
## Brand rules
|
|
106
|
+
|
|
107
|
+
- **Do** keep it quiet; the headline above it is the first read.
|
|
108
|
+
- **Do** use it on its own — not with a `Starfield` or `GlowOrb` in the same composition.
|
|
109
|
+
- **Don't** use it as or in place of the logo; it is an illustration of the logo's silhouette. The logo always uses the supplied vectors.
|
|
110
|
+
- **Don't** tint it: colour on a backdrop is decoration — no hues, no neon, no gradients.
|
|
111
|
+
- **Don't** set body text or headlines in ASCII; it is a supporting visual language.
|
|
112
|
+
|
|
113
|
+
## Accessibility
|
|
114
|
+
|
|
115
|
+
- Always `aria-hidden` and `pointer-events-none`; it never takes focus or pointer events from the content above.
|
|
116
|
+
- No motion under `prefers-reduced-motion`.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
- Import: `import { AsciiField } from "@zonsh/ui/brand"`
|
|
121
|
+
- Source: `packages/ui/src/components/ascii-field.tsx`
|