@zonsh/ui 0.5.0 → 0.6.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/CHANGELOG.md +643 -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,285 @@
|
|
|
1
|
+
# Timeline
|
|
2
|
+
|
|
3
|
+
```tsx
|
|
4
|
+
import { Timeline, TimelineComment, TimelineContent, TimelineItem, TimelineTime, TimelineTitle } from "@zonsh/ui";
|
|
5
|
+
|
|
6
|
+
export function Basic() {
|
|
7
|
+
return (
|
|
8
|
+
<Timeline aria-label="Order #1042 history" className="max-w-md">
|
|
9
|
+
<TimelineItem>
|
|
10
|
+
<TimelineTitle>
|
|
11
|
+
<strong>Jonas</strong> marked the order as shipped
|
|
12
|
+
</TimelineTitle>
|
|
13
|
+
<TimelineTime dateTime="2026-10-01T09:40">20 min ago</TimelineTime>
|
|
14
|
+
<TimelineContent>
|
|
15
|
+
<p className="m-0">Two parcels with DHL, tracking 00340 4341 2217.</p>
|
|
16
|
+
</TimelineContent>
|
|
17
|
+
</TimelineItem>
|
|
18
|
+
<TimelineItem>
|
|
19
|
+
<TimelineTitle>
|
|
20
|
+
<strong>Ines Ferreira</strong> left a note
|
|
21
|
+
</TimelineTitle>
|
|
22
|
+
<TimelineTime dateTime="2026-09-30T18:12">Yesterday</TimelineTime>
|
|
23
|
+
<TimelineContent>
|
|
24
|
+
<TimelineComment>
|
|
25
|
+
<p>Could the teapot go in its own box? It is a present.</p>
|
|
26
|
+
</TimelineComment>
|
|
27
|
+
</TimelineContent>
|
|
28
|
+
</TimelineItem>
|
|
29
|
+
<TimelineItem>
|
|
30
|
+
<TimelineTitle>
|
|
31
|
+
<strong>Jonas</strong> packed 3 items
|
|
32
|
+
</TimelineTitle>
|
|
33
|
+
<TimelineTime dateTime="2026-09-30T16:05">Yesterday</TimelineTime>
|
|
34
|
+
</TimelineItem>
|
|
35
|
+
<TimelineItem>
|
|
36
|
+
<TimelineTitle>Payment received by card</TimelineTitle>
|
|
37
|
+
<TimelineTime dateTime="2026-09-29T21:30">29 Sep</TimelineTime>
|
|
38
|
+
</TimelineItem>
|
|
39
|
+
<TimelineItem>
|
|
40
|
+
<TimelineTitle>
|
|
41
|
+
<strong>Ines Ferreira</strong> placed the order
|
|
42
|
+
</TimelineTitle>
|
|
43
|
+
<TimelineTime dateTime="2026-09-29T21:28">29 Sep</TimelineTime>
|
|
44
|
+
</TimelineItem>
|
|
45
|
+
</Timeline>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Icons for the kind of event, a changed field and a comment: a deal's history. */
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
What happened, in order, on a hairline: a marker per entry (an 8px dot, or a 24px key with an icon), a Licht Sans line of who did what, a mono time, and optionally a comment card, a changed field ("Stage Proposal → Won") or any body. No box.
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
import { Timeline, TimelineContent, TimelineItem, TimelineTime, TimelineTitle } from "@zonsh/ui";
|
|
58
|
+
|
|
59
|
+
<Timeline aria-label="Order history">
|
|
60
|
+
<TimelineItem>
|
|
61
|
+
<TimelineTitle>
|
|
62
|
+
<strong>Jonas</strong> marked the order as shipped
|
|
63
|
+
</TimelineTitle>
|
|
64
|
+
<TimelineTime dateTime="2026-10-01T09:40">20 min ago</TimelineTime>
|
|
65
|
+
<TimelineContent>Two parcels with DHL.</TimelineContent>
|
|
66
|
+
</TimelineItem>
|
|
67
|
+
</Timeline>;
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- `TimelineItem.icon` — a raised key with an icon for the kind of event, instead of the dot.
|
|
71
|
+
- `TimelineTime.dateTime` — the machine-readable time; always give it.
|
|
72
|
+
- `Timeline.variant` — `activity` (dense log) or `changelog` (release notes).
|
|
73
|
+
|
|
74
|
+
## When to use
|
|
75
|
+
|
|
76
|
+
- `activity`: a dense log — order history, a deal's calls, edits, deploys. `changelog`: release notes — mono eyebrow, Licht title, 40px apart. `upcoming` for plans.
|
|
77
|
+
- A flow people move through is a `Stepper`; events to sort and filter, a `Table`.
|
|
78
|
+
- Past 100 entries only those near the view are painted (`content-visibility`); all stay findable. Past a few thousand, load more on scroll.
|
|
79
|
+
|
|
80
|
+
## Examples
|
|
81
|
+
|
|
82
|
+
### With icons
|
|
83
|
+
|
|
84
|
+
`TimelineComment` holds what someone wrote; `TimelineChange` a changed field (strings become tags, or pass a `Tag`). `status` colours a status entry's icon; the title says it.
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
import { Tag, Timeline, TimelineChange, TimelineComment, TimelineContent, TimelineItem, TimelineTime, TimelineTitle } from "@zonsh/ui";
|
|
88
|
+
import { CircleCheckIcon, FileTextIcon, MailIcon, MessageSquareIcon, PhoneIcon } from "lucide-react";
|
|
89
|
+
|
|
90
|
+
export function WithIcons() {
|
|
91
|
+
return (
|
|
92
|
+
<Timeline aria-label="Deal history: autumn workshop booking" className="max-w-lg">
|
|
93
|
+
<TimelineItem icon={<CircleCheckIcon />} status="success">
|
|
94
|
+
<TimelineTitle>
|
|
95
|
+
<strong>Mira Castell</strong> won the deal
|
|
96
|
+
</TimelineTitle>
|
|
97
|
+
<TimelineTime dateTime="2026-10-01T10:15">2h ago</TimelineTime>
|
|
98
|
+
<TimelineContent>
|
|
99
|
+
<TimelineChange field="Stage" from="Proposal" to={<Tag tone="success">Won</Tag>} />
|
|
100
|
+
</TimelineContent>
|
|
101
|
+
</TimelineItem>
|
|
102
|
+
<TimelineItem icon={<MessageSquareIcon />}>
|
|
103
|
+
<TimelineTitle>
|
|
104
|
+
<strong>Mira Castell</strong> commented
|
|
105
|
+
</TimelineTitle>
|
|
106
|
+
<TimelineTime dateTime="2026-09-30T15:02">Yesterday</TimelineTime>
|
|
107
|
+
<TimelineContent>
|
|
108
|
+
<TimelineComment>
|
|
109
|
+
<p>
|
|
110
|
+
Amara confirmed 40 seats for the 14 November workshop. Catering stays vegetarian; she will send
|
|
111
|
+
the final list a week before.
|
|
112
|
+
</p>
|
|
113
|
+
</TimelineComment>
|
|
114
|
+
</TimelineContent>
|
|
115
|
+
</TimelineItem>
|
|
116
|
+
<TimelineItem icon={<FileTextIcon />}>
|
|
117
|
+
<TimelineTitle>
|
|
118
|
+
<strong>Mira Castell</strong> sent the proposal
|
|
119
|
+
</TimelineTitle>
|
|
120
|
+
<TimelineTime dateTime="2026-09-24T11:30">24 Sep</TimelineTime>
|
|
121
|
+
<TimelineContent>
|
|
122
|
+
<TimelineChange field="Value" from="€3,200" to="€4,100" />
|
|
123
|
+
</TimelineContent>
|
|
124
|
+
</TimelineItem>
|
|
125
|
+
<TimelineItem icon={<PhoneIcon />}>
|
|
126
|
+
<TimelineTitle>
|
|
127
|
+
Call with <strong>Amara Okafor</strong>, 25 min
|
|
128
|
+
</TimelineTitle>
|
|
129
|
+
<TimelineTime dateTime="2026-09-19T14:00">19 Sep</TimelineTime>
|
|
130
|
+
</TimelineItem>
|
|
131
|
+
<TimelineItem icon={<MailIcon />}>
|
|
132
|
+
<TimelineTitle>
|
|
133
|
+
<strong>Amara Okafor</strong> asked about dates in November
|
|
134
|
+
</TimelineTitle>
|
|
135
|
+
<TimelineTime dateTime="2026-09-16T08:47">16 Sep</TimelineTime>
|
|
136
|
+
</TimelineItem>
|
|
137
|
+
</Timeline>
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* The roomier changelog: the version and date as an eyebrow, a Licht title, reading type. */
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Changelog
|
|
145
|
+
|
|
146
|
+
Render titles as headings (`render={<h3 />}`) to jump between releases.
|
|
147
|
+
|
|
148
|
+
```tsx
|
|
149
|
+
import { Timeline, TimelineContent, TimelineItem, TimelineTime, TimelineTitle } from "@zonsh/ui";
|
|
150
|
+
|
|
151
|
+
export function Changelog() {
|
|
152
|
+
return (
|
|
153
|
+
<Timeline variant="changelog" aria-label="Changelog" className="max-w-xl">
|
|
154
|
+
<TimelineItem>
|
|
155
|
+
<TimelineTime dateTime="2026-09-28">v2.4 · 28 Sep 2026</TimelineTime>
|
|
156
|
+
<TimelineTitle render={<h3 />}>Offline notebooks</TimelineTitle>
|
|
157
|
+
<TimelineContent>
|
|
158
|
+
<p className="m-0">
|
|
159
|
+
Notebooks you opened in the last week now open without a connection. Edits are kept on the device
|
|
160
|
+
and sync when you are back online; a conflict shows both versions side by side.
|
|
161
|
+
</p>
|
|
162
|
+
</TimelineContent>
|
|
163
|
+
</TimelineItem>
|
|
164
|
+
<TimelineItem>
|
|
165
|
+
<TimelineTime dateTime="2026-08-12">v2.3 · 12 Aug 2026</TimelineTime>
|
|
166
|
+
<TimelineTitle render={<h3 />}>Tables you can sort</TimelineTitle>
|
|
167
|
+
<TimelineContent>
|
|
168
|
+
<ul className="m-0 flex list-disc flex-col gap-1.5 pl-5">
|
|
169
|
+
<li>Click a column header to sort; click again to reverse.</li>
|
|
170
|
+
<li>Number columns sort by value, not as text.</li>
|
|
171
|
+
<li>Fixed: pasting from a spreadsheet kept empty trailing rows.</li>
|
|
172
|
+
</ul>
|
|
173
|
+
</TimelineContent>
|
|
174
|
+
</TimelineItem>
|
|
175
|
+
<TimelineItem>
|
|
176
|
+
<TimelineTime dateTime="2026-07-03">v2.2 · 3 Jul 2026</TimelineTime>
|
|
177
|
+
<TimelineTitle render={<h3 />}>Shared folders</TimelineTitle>
|
|
178
|
+
<TimelineContent>
|
|
179
|
+
<p className="m-0">Invite people to a folder instead of each notebook in it.</p>
|
|
180
|
+
</TimelineContent>
|
|
181
|
+
</TimelineItem>
|
|
182
|
+
</Timeline>
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Milestones with status and the ones still to come: a release that failed and was redone. */
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Milestones
|
|
190
|
+
|
|
191
|
+
`upcoming` for what is planned; say so in the title, as the marker is hidden.
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
import { Timeline, TimelineItem, TimelineTime, TimelineTitle } from "@zonsh/ui";
|
|
195
|
+
import { CircleCheckIcon, CircleXIcon, FileTextIcon, GitCommitHorizontalIcon, RocketIcon } from "lucide-react";
|
|
196
|
+
|
|
197
|
+
export function Milestones() {
|
|
198
|
+
return (
|
|
199
|
+
<Timeline aria-label="Release 3.0 milestones" className="max-w-md">
|
|
200
|
+
<TimelineItem icon={<GitCommitHorizontalIcon />}>
|
|
201
|
+
<TimelineTitle>Feature freeze</TimelineTitle>
|
|
202
|
+
<TimelineTime dateTime="2026-09-15">15 Sep</TimelineTime>
|
|
203
|
+
</TimelineItem>
|
|
204
|
+
<TimelineItem icon={<CircleXIcon />} status="destructive">
|
|
205
|
+
<TimelineTitle>Beta build failed: migration tests</TimelineTitle>
|
|
206
|
+
<TimelineTime dateTime="2026-09-22">22 Sep</TimelineTime>
|
|
207
|
+
</TimelineItem>
|
|
208
|
+
<TimelineItem icon={<CircleCheckIcon />} status="success">
|
|
209
|
+
<TimelineTitle>Beta published</TimelineTitle>
|
|
210
|
+
<TimelineTime dateTime="2026-09-24">24 Sep</TimelineTime>
|
|
211
|
+
</TimelineItem>
|
|
212
|
+
<TimelineItem icon={<FileTextIcon />} upcoming>
|
|
213
|
+
<TimelineTitle>Release notes review planned</TimelineTitle>
|
|
214
|
+
<TimelineTime dateTime="2026-10-08">8 Oct</TimelineTime>
|
|
215
|
+
</TimelineItem>
|
|
216
|
+
<TimelineItem icon={<RocketIcon />} upcoming>
|
|
217
|
+
<TimelineTitle>3.0 release planned</TimelineTitle>
|
|
218
|
+
<TimelineTime dateTime="2026-10-15">15 Oct</TimelineTime>
|
|
219
|
+
</TimelineItem>
|
|
220
|
+
</Timeline>
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Loading and empty
|
|
226
|
+
|
|
227
|
+
`loading` adds three placeholders after the entries and sets `aria-busy` ("Loading"). Empty, the line holds a hollow marker and `emptyMessage`: say what will appear and when.
|
|
228
|
+
|
|
229
|
+
```tsx
|
|
230
|
+
import { Timeline } from "@zonsh/ui";
|
|
231
|
+
|
|
232
|
+
/** A deal's history while it loads, and a new deal with none yet. */
|
|
233
|
+
export function States() {
|
|
234
|
+
return (
|
|
235
|
+
<div className="grid w-full max-w-3xl gap-10 sm:grid-cols-2">
|
|
236
|
+
<Timeline loading aria-label="History of the Harbour Books deal" />
|
|
237
|
+
<Timeline
|
|
238
|
+
aria-label="History of the Linden Bakery deal"
|
|
239
|
+
emptyMessage="No activity yet. Calls, emails and stage changes show here as they happen."
|
|
240
|
+
/>
|
|
241
|
+
</div>
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Props
|
|
247
|
+
|
|
248
|
+
| Prop | Type | Default |
|
|
249
|
+
| ---------------------------- | ---------------------------------------------------------------- | ------------ |
|
|
250
|
+
| `Timeline.variant` | `"activity" \| "changelog"` | `"activity"` |
|
|
251
|
+
| `Timeline.loading` | `boolean` — placeholder entries, `aria-busy` | `false` |
|
|
252
|
+
| `Timeline.emptyMessage` | `ReactNode` — shown when there are no entries | English |
|
|
253
|
+
| `Timeline.labels` | `Partial<TimelineMessages>` — `loading`, `empty` | English |
|
|
254
|
+
| `TimelineItem.icon` | `ReactNode` — a 14px icon in a 24px key, instead of the dot | — |
|
|
255
|
+
| `TimelineItem.status` | `"default" \| "success" \| "warning" \| "info" \| "destructive"` | `"default"` |
|
|
256
|
+
| `TimelineItem.upcoming` | `boolean` | `false` |
|
|
257
|
+
| `TimelineTime.dateTime` | `string` — the machine-readable time | — |
|
|
258
|
+
| `TimelineChange.field` | `ReactNode` | — |
|
|
259
|
+
| `TimelineChange.from` / `to` | `ReactNode` — a string becomes a muted / default `Tag` | — |
|
|
260
|
+
|
|
261
|
+
`Timeline` is an `<ol>`, `TimelineItem` an `<li>`, `TimelineTitle` a `<p>` (`render` swaps it for a heading), `TimelineTime` a `<time>`, `TimelineContent` a `<div>`; each forwards its element's props. `data-slot`s: `timeline`, `timeline-item`, `timeline-marker`, `timeline-connector`, `timeline-body`, `timeline-title`, `timeline-time`, `timeline-content`, `timeline-comment`, `timeline-change`. An item has `data-status` and `data-upcoming`, a placeholder `data-placeholder`, and the list `data-empty` with its `timeline-empty` entry.
|
|
262
|
+
|
|
263
|
+
`TimelineChange` takes `labels` (`Partial<TimelineMessages>`: `from`, `to`) for what screen readers hear around the values; `Timeline` takes `loading` and `empty`. A `LocaleProvider` sets them for every timeline (`messages.timeline`).
|
|
264
|
+
|
|
265
|
+
## Brand rules
|
|
266
|
+
|
|
267
|
+
- **Do** write titles as who then what: "Mira Castell sent the proposal".
|
|
268
|
+
- **Do** use relative times for a day or two, then dates; always `dateTime`.
|
|
269
|
+
- **Do** keep markers monochrome; colour only an entry that is a status, and say the status in its title.
|
|
270
|
+
- **Don't** use a category colour per event kind — the icon tells kinds apart.
|
|
271
|
+
- **Don't** box entries; only a comment is a card.
|
|
272
|
+
- **Don't** invent history in examples: no made-up customers, figures or awards.
|
|
273
|
+
|
|
274
|
+
## Accessibility
|
|
275
|
+
|
|
276
|
+
- An ordered list; name it with `aria-label` ("Order #1042 history") when no heading does.
|
|
277
|
+
- Markers and the line are `aria-hidden`; the title carries the meaning, so a status is never colour alone.
|
|
278
|
+
- `upcoming` is drawn, not announced: word the title as a plan ("3.0 release planned").
|
|
279
|
+
- `TimelineChange` reads "Stage from Proposal to Won": the arrow is hidden, the words are there for screen readers.
|
|
280
|
+
- Pick newest or oldest first per product; say which if not obvious.
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
- Import: `import { Timeline, TimelineItem, TimelineTitle, TimelineTime, TimelineContent, TimelineComment, TimelineChange } from "@zonsh/ui"`
|
|
285
|
+
- Source: `packages/ui/src/components/timeline.tsx`
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
# Tippy
|
|
2
|
+
|
|
3
|
+
```tsx
|
|
4
|
+
import { ToggleGroup, ToggleGroupItem } from "@zonsh/ui";
|
|
5
|
+
import { Tippy, type TippyMove } from "@zonsh/ui/tippy";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
|
|
8
|
+
/* Tippy and a few of its moves: each new one grows out of the last. */
|
|
9
|
+
export function Basic() {
|
|
10
|
+
const [move, setMove] = React.useState<TippyMove>("wave");
|
|
11
|
+
const moves: [TippyMove, string][] = [
|
|
12
|
+
["wave", "Wave"],
|
|
13
|
+
["jump", "Jump"],
|
|
14
|
+
["think", "Think"],
|
|
15
|
+
["nod", "Nod"],
|
|
16
|
+
["success", "Success"],
|
|
17
|
+
];
|
|
18
|
+
return (
|
|
19
|
+
<div className="flex flex-col items-center gap-4">
|
|
20
|
+
<Tippy move={move} />
|
|
21
|
+
<ToggleGroup
|
|
22
|
+
aria-label="Move"
|
|
23
|
+
value={[move]}
|
|
24
|
+
onValueChange={(next) => next[0] && setMove(next[0] as TippyMove)}
|
|
25
|
+
>
|
|
26
|
+
{moves.map(([value, label]) => (
|
|
27
|
+
<ToggleGroupItem key={value} value={value}>
|
|
28
|
+
{label}
|
|
29
|
+
</ToggleGroupItem>
|
|
30
|
+
))}
|
|
31
|
+
</ToggleGroup>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
zon.sh's mascot: the crescent turned over, standing on its horns. A 64-pixel canvas sprite in three inks (near-black, grey, off-white) with an ordered dither and a one-pixel outline, scaled by whole device pixels so pixels stay crisp. An early version, still being drawn.
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { Tippy } from "@zonsh/ui/tippy";
|
|
43
|
+
|
|
44
|
+
<Tippy move="wave" />;
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
- `move` — what it does (`tippyMoves` lists them).
|
|
48
|
+
- `lookAt` — a page point for its eyes.
|
|
49
|
+
- `scale` — CSS px per sprite pixel, at least 1.
|
|
50
|
+
|
|
51
|
+
As a tour guide:
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
import { Tour } from "@zonsh/ui";
|
|
55
|
+
import { TippyGuide } from "@zonsh/ui/tippy";
|
|
56
|
+
|
|
57
|
+
<Tour steps={steps} open={open} onOpenChange={setOpen} guide={(g) => <TippyGuide {...g} />} />;
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Its own entry, `@zonsh/ui/tippy`, costs nothing until imported.
|
|
61
|
+
|
|
62
|
+
The moves: `idle`, `walk`, `run`, `jump`, `sit`, `wave`, `nod`, `shake`, `shrug`, `think`, `look`, `cheer`, `giggle`, `love`, `surprise`, `shy`, `error` and `success`, and for a sign-in form `watch`, `cover` and `away`.
|
|
63
|
+
|
|
64
|
+
It moves with weight at 24fps: it gathers itself before it goes, squashes on landing and springs back. A new move grows out of the old within a third of a second, the face changing behind a blink; its eyes stay in view, square however far it turns. Each eye turns to `lookAt` on its own, converging on something close, its weight following a beat later; `followPointer` watches the pointer otherwise, and with nothing the eyes ease back to their own glances. Off screen it stops drawing.
|
|
65
|
+
|
|
66
|
+
## When to use
|
|
67
|
+
|
|
68
|
+
- To show someone round: `TippyGuide` in a `Tour`.
|
|
69
|
+
- To react: `success` after a long task, `error` for a fault not theirs, `think` while working.
|
|
70
|
+
- In an empty state, as its illustration.
|
|
71
|
+
- Beside a sign-in form; see the Sign in and sign up block, "With Tippy".
|
|
72
|
+
- Not as decoration on every screen, nor in serious moments — a failed payment, a deleted account. Once on a screen is plenty.
|
|
73
|
+
|
|
74
|
+
## Examples
|
|
75
|
+
|
|
76
|
+
### Reactions
|
|
77
|
+
|
|
78
|
+
A hop with a check, a flip under a cross, a hand to the chin, a sway under a heart. Each loops; set another move when the moment passes.
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
import { Tippy, type TippyMove } from "@zonsh/ui/tippy";
|
|
82
|
+
|
|
83
|
+
/* Reactions for what has just happened: something saved, something failed, a question, a thank-you. */
|
|
84
|
+
export function Reactions() {
|
|
85
|
+
const reactions: [TippyMove, string][] = [
|
|
86
|
+
["success", "success"],
|
|
87
|
+
["error", "error"],
|
|
88
|
+
["think", "think"],
|
|
89
|
+
["love", "love"],
|
|
90
|
+
];
|
|
91
|
+
return (
|
|
92
|
+
<div className="@container w-full overflow-x-clip">
|
|
93
|
+
<div className="grid grid-cols-2 gap-x-6 gap-y-2 @md:grid-cols-4">
|
|
94
|
+
{reactions.map(([move, label]) => (
|
|
95
|
+
<figure key={move} className="m-0 flex flex-col items-center gap-1">
|
|
96
|
+
<Tippy move={move} scale={1.5} />
|
|
97
|
+
<figcaption className="font-mono text-[12px] text-muted-foreground">{label}</figcaption>
|
|
98
|
+
</figure>
|
|
99
|
+
))}
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### In an empty state
|
|
107
|
+
|
|
108
|
+
In `EmptyMedia variant="illustration"` at `scale={1.5}`; `look` glances one way and the other, its body a beat late.
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
import { Button, Empty, EmptyActions, EmptyDescription, EmptyMedia, EmptyTitle } from "@zonsh/ui";
|
|
112
|
+
import { Tippy } from "@zonsh/ui/tippy";
|
|
113
|
+
|
|
114
|
+
/* In an empty state, where nothing is wrong yet: Tippy looks round for what will be there. */
|
|
115
|
+
export function EmptyState() {
|
|
116
|
+
return (
|
|
117
|
+
<Empty>
|
|
118
|
+
<EmptyMedia variant="illustration">
|
|
119
|
+
<Tippy move="look" scale={1.5} />
|
|
120
|
+
</EmptyMedia>
|
|
121
|
+
<EmptyTitle>No saved searches yet</EmptyTitle>
|
|
122
|
+
<EmptyDescription>
|
|
123
|
+
Save a search from the results and it shows up here, with what is new since you last looked.
|
|
124
|
+
</EmptyDescription>
|
|
125
|
+
<EmptyActions>
|
|
126
|
+
<Button>Search flats</Button>
|
|
127
|
+
</EmptyActions>
|
|
128
|
+
</Empty>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Watching a field
|
|
134
|
+
|
|
135
|
+
`followPointer` tracks the pointer; with the field focused it plays `watch` with `lookAt` on the caret, and `keystrokes` (a key count) gives each key a bob. Answer a click on the canvas with a short move (a giggle here).
|
|
136
|
+
|
|
137
|
+
While a password is shown: `cover` (eyes shut, hands up, one eye peeking) or `away` (face turned, whistling). Both turn from the side `lookAt` is on; alternate them.
|
|
138
|
+
|
|
139
|
+
```tsx
|
|
140
|
+
import { Field, FieldLabel, Input } from "@zonsh/ui";
|
|
141
|
+
import { Tippy } from "@zonsh/ui/tippy";
|
|
142
|
+
import * as React from "react";
|
|
143
|
+
|
|
144
|
+
/*
|
|
145
|
+
* Watching a field: Tippy follows the pointer with its eyes, and while the field is in focus it
|
|
146
|
+
* watches the caret, taking each key with a bob. Poke it and it giggles.
|
|
147
|
+
*/
|
|
148
|
+
export function WatchingAField() {
|
|
149
|
+
const [focused, setFocused] = React.useState(false);
|
|
150
|
+
const [look, setLook] = React.useState<{ x: number; y: number } | null>(null);
|
|
151
|
+
const [keys, setKeys] = React.useState(0);
|
|
152
|
+
const [poked, setPoked] = React.useState(false);
|
|
153
|
+
const caret = (el: HTMLInputElement) => {
|
|
154
|
+
const r = el.getBoundingClientRect();
|
|
155
|
+
// Roughly where the caret is: one average character on for each typed before it.
|
|
156
|
+
const x = r.left + 12 + Math.min(r.width - 24, (el.selectionEnd ?? el.value.length) * 8);
|
|
157
|
+
setLook({ x, y: r.top + r.height / 2 });
|
|
158
|
+
};
|
|
159
|
+
return (
|
|
160
|
+
<div className="flex w-full max-w-md flex-col items-center gap-2">
|
|
161
|
+
<Tippy
|
|
162
|
+
move={poked ? "giggle" : focused ? "watch" : "idle"}
|
|
163
|
+
lookAt={focused ? look : null}
|
|
164
|
+
followPointer
|
|
165
|
+
keystrokes={keys}
|
|
166
|
+
className="cursor-pointer"
|
|
167
|
+
onPointerDown={() => {
|
|
168
|
+
setPoked(true);
|
|
169
|
+
setTimeout(() => setPoked(false), 1500);
|
|
170
|
+
}}
|
|
171
|
+
/>
|
|
172
|
+
<Field className="w-full">
|
|
173
|
+
<FieldLabel>Name</FieldLabel>
|
|
174
|
+
<Input
|
|
175
|
+
placeholder="Alex Weber"
|
|
176
|
+
onFocus={(e) => {
|
|
177
|
+
setFocused(true);
|
|
178
|
+
caret(e.currentTarget);
|
|
179
|
+
}}
|
|
180
|
+
onBlur={() => setFocused(false)}
|
|
181
|
+
onInput={(e) => {
|
|
182
|
+
caret(e.currentTarget);
|
|
183
|
+
setKeys((k) => k + 1);
|
|
184
|
+
}}
|
|
185
|
+
onKeyUp={(e) => caret(e.currentTarget)}
|
|
186
|
+
/>
|
|
187
|
+
</Field>
|
|
188
|
+
</div>
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### As a tour guide
|
|
194
|
+
|
|
195
|
+
In a `Tour`'s `guide`, each step becomes Tippy's speech bubble. Tippy stands beside the target pointing at it, never over it; a step without a target puts it mid-screen, waving.
|
|
196
|
+
|
|
197
|
+
Between steps the bubble goes back into its tail, Tippy leaps in an arc and lands with a puff of dust, and the next bubble comes out as it lands — words in flight can't be read. Done ends with a hop and a check, Skip with a wave goodbye. See [Tour](tour.md), "With Tippy".
|
|
198
|
+
|
|
199
|
+
## Props
|
|
200
|
+
|
|
201
|
+
### Tippy
|
|
202
|
+
|
|
203
|
+
| Prop | Type | Default |
|
|
204
|
+
| --------------- | -------------------------------------------------------------------------------------- | --------- |
|
|
205
|
+
| `move` | `TippyMove` | `"idle"` |
|
|
206
|
+
| `facing` | `"left" \| "right"` | `"right"` |
|
|
207
|
+
| `scale` | `number` — CSS px to a sprite pixel | `2` |
|
|
208
|
+
| `label` | `string` — a name; without one, hidden | — |
|
|
209
|
+
| `paused` | `boolean` — holds the frame | `false` |
|
|
210
|
+
| `lookAt` | `{ x: number; y: number } \| null` — a point on the page, in client pixels, to look at | `null` |
|
|
211
|
+
| `followPointer` | `boolean` — eyes on the pointer when `lookAt` gives nothing | `false` |
|
|
212
|
+
| `keystrokes` | `number` — keys pressed; each change is a bob, for `watch` | — |
|
|
213
|
+
|
|
214
|
+
The rest go to the `<canvas>`: 128 × 104 sprite pixels, with room to jump, so 256 × 208 CSS pixels at `scale={2}`. `scale` snaps to whole device pixels.
|
|
215
|
+
|
|
216
|
+
### TippyGuide
|
|
217
|
+
|
|
218
|
+
| Prop | Type | Default |
|
|
219
|
+
| ------- | ----------------------------------- | ------- |
|
|
220
|
+
| `scale` | `number` — CSS px to a sprite pixel | `2` |
|
|
221
|
+
|
|
222
|
+
plus the `TourGuideState` a `guide` gets: pass it whole, `{...g}`.
|
|
223
|
+
|
|
224
|
+
Same in both themes. Slots: `data-slot="tippy"` and `data-move`, `data-slot="tippy-guide"`.
|
|
225
|
+
|
|
226
|
+
## Brand rules
|
|
227
|
+
|
|
228
|
+
- **Do** keep its three monochrome inks; never tint it.
|
|
229
|
+
- **Do** give it room: never below `scale={1}`, and its picture includes the space above for a jump.
|
|
230
|
+
- **Don't** turn it up as the logo — that is its `error` move. Use `Logo`.
|
|
231
|
+
- **Don't** give it a character voice ("Tippy says…"); in a tour its bubble holds the step's words, written like the rest of the interface.
|
|
232
|
+
|
|
233
|
+
## Accessibility
|
|
234
|
+
|
|
235
|
+
- Tippy is decoration unless it has a `label`: without one the canvas is `aria-hidden`. Label it only when it carries unique meaning.
|
|
236
|
+
- `TippyGuide` is always decoration, and its layer takes no clicks. Its bubble is the tour's own dialog, so the tour reads the same with Tippy as without.
|
|
237
|
+
- Under `prefers-reduced-motion` it holds the clearest frame of its move; its eyes go to what it is told at once, without easing; it goes to the next target without leaping, the bubble just appears, and it leaves at once when the tour ends.
|
|
238
|
+
- It never flashes: the fastest change is a blink or a few frames of shaking.
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
- Import: `import { Tippy, TippyGuide, tippyMoves } from "@zonsh/ui/tippy"`
|
|
243
|
+
- Source: `packages/ui/src/components/tippy.tsx`
|