tuiuiu.js 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +324 -0
- package/dist/app/index.d.ts +9 -0
- package/dist/app/index.d.ts.map +1 -0
- package/dist/app/index.js +12 -0
- package/dist/app/index.js.map +1 -0
- package/dist/app/render-loop.d.ts +51 -0
- package/dist/app/render-loop.d.ts.map +1 -0
- package/dist/app/render-loop.js +263 -0
- package/dist/app/render-loop.js.map +1 -0
- package/dist/atoms/button.d.ts +109 -0
- package/dist/atoms/button.d.ts.map +1 -0
- package/dist/atoms/button.js +173 -0
- package/dist/atoms/button.js.map +1 -0
- package/dist/atoms/index.d.ts +29 -0
- package/dist/atoms/index.d.ts.map +1 -0
- package/dist/atoms/index.js +53 -0
- package/dist/atoms/index.js.map +1 -0
- package/dist/atoms/progress-bar.d.ts +96 -0
- package/dist/atoms/progress-bar.d.ts.map +1 -0
- package/dist/atoms/progress-bar.js +443 -0
- package/dist/atoms/progress-bar.js.map +1 -0
- package/dist/atoms/slider.d.ts +137 -0
- package/dist/atoms/slider.d.ts.map +1 -0
- package/dist/atoms/slider.js +317 -0
- package/dist/atoms/slider.js.map +1 -0
- package/dist/atoms/spinner.d.ts +91 -0
- package/dist/atoms/spinner.d.ts.map +1 -0
- package/dist/atoms/spinner.js +650 -0
- package/dist/atoms/spinner.js.map +1 -0
- package/dist/atoms/switch.d.ts +102 -0
- package/dist/atoms/switch.d.ts.map +1 -0
- package/dist/atoms/switch.js +176 -0
- package/dist/atoms/switch.js.map +1 -0
- package/dist/atoms/text-input.d.ts +82 -0
- package/dist/atoms/text-input.d.ts.map +1 -0
- package/dist/atoms/text-input.js +347 -0
- package/dist/atoms/text-input.js.map +1 -0
- package/dist/atoms/timer.d.ts +178 -0
- package/dist/atoms/timer.d.ts.map +1 -0
- package/dist/atoms/timer.js +355 -0
- package/dist/atoms/timer.js.map +1 -0
- package/dist/atoms/tooltip.d.ts +191 -0
- package/dist/atoms/tooltip.d.ts.map +1 -0
- package/dist/atoms/tooltip.js +279 -0
- package/dist/atoms/tooltip.js.map +1 -0
- package/dist/components/canvas.d.ts +322 -0
- package/dist/components/canvas.d.ts.map +1 -0
- package/dist/components/canvas.js +833 -0
- package/dist/components/canvas.js.map +1 -0
- package/dist/components/code-block.d.ts +75 -0
- package/dist/components/code-block.d.ts.map +1 -0
- package/dist/components/code-block.js +322 -0
- package/dist/components/code-block.js.map +1 -0
- package/dist/components/components.d.ts +122 -0
- package/dist/components/components.d.ts.map +1 -0
- package/dist/components/components.js +151 -0
- package/dist/components/components.js.map +1 -0
- package/dist/components/data-viz/bar-chart.d.ts +167 -0
- package/dist/components/data-viz/bar-chart.d.ts.map +1 -0
- package/dist/components/data-viz/bar-chart.js +375 -0
- package/dist/components/data-viz/bar-chart.js.map +1 -0
- package/dist/components/data-viz/gauge.d.ts +163 -0
- package/dist/components/data-viz/gauge.d.ts.map +1 -0
- package/dist/components/data-viz/gauge.js +451 -0
- package/dist/components/data-viz/gauge.js.map +1 -0
- package/dist/components/data-viz/heatmap.d.ts +154 -0
- package/dist/components/data-viz/heatmap.d.ts.map +1 -0
- package/dist/components/data-viz/heatmap.js +458 -0
- package/dist/components/data-viz/heatmap.js.map +1 -0
- package/dist/components/data-viz/index.d.ts +16 -0
- package/dist/components/data-viz/index.d.ts.map +1 -0
- package/dist/components/data-viz/index.js +16 -0
- package/dist/components/data-viz/index.js.map +1 -0
- package/dist/components/data-viz/line-chart.d.ts +157 -0
- package/dist/components/data-viz/line-chart.d.ts.map +1 -0
- package/dist/components/data-viz/line-chart.js +578 -0
- package/dist/components/data-viz/line-chart.js.map +1 -0
- package/dist/components/data-viz/sparkline.d.ts +156 -0
- package/dist/components/data-viz/sparkline.d.ts.map +1 -0
- package/dist/components/data-viz/sparkline.js +325 -0
- package/dist/components/data-viz/sparkline.js.map +1 -0
- package/dist/components/grid.d.ts +234 -0
- package/dist/components/grid.d.ts.map +1 -0
- package/dist/components/grid.js +719 -0
- package/dist/components/grid.js.map +1 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +69 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/markdown.d.ts +52 -0
- package/dist/components/markdown.d.ts.map +1 -0
- package/dist/components/markdown.js +341 -0
- package/dist/components/markdown.js.map +1 -0
- package/dist/components/modal.d.ts +237 -0
- package/dist/components/modal.d.ts.map +1 -0
- package/dist/components/modal.js +396 -0
- package/dist/components/modal.js.map +1 -0
- package/dist/components/progress-bar.d.ts +89 -0
- package/dist/components/progress-bar.d.ts.map +1 -0
- package/dist/components/progress-bar.js +288 -0
- package/dist/components/progress-bar.js.map +1 -0
- package/dist/components/select.d.ts +114 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +415 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/spinner.d.ts +71 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +300 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/split-panel.d.ts +175 -0
- package/dist/components/split-panel.d.ts.map +1 -0
- package/dist/components/split-panel.js +322 -0
- package/dist/components/split-panel.js.map +1 -0
- package/dist/components/table.d.ts +103 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +359 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/text-input.d.ts +79 -0
- package/dist/components/text-input.d.ts.map +1 -0
- package/dist/components/text-input.js +332 -0
- package/dist/components/text-input.js.map +1 -0
- package/dist/core/animation.d.ts +262 -0
- package/dist/core/animation.d.ts.map +1 -0
- package/dist/core/animation.js +626 -0
- package/dist/core/animation.js.map +1 -0
- package/dist/core/buffer.d.ts +179 -0
- package/dist/core/buffer.d.ts.map +1 -0
- package/dist/core/buffer.js +549 -0
- package/dist/core/buffer.js.map +1 -0
- package/dist/core/capabilities.d.ts +184 -0
- package/dist/core/capabilities.d.ts.map +1 -0
- package/dist/core/capabilities.js +393 -0
- package/dist/core/capabilities.js.map +1 -0
- package/dist/core/colors.d.ts +111 -0
- package/dist/core/colors.d.ts.map +1 -0
- package/dist/core/colors.js +417 -0
- package/dist/core/colors.js.map +1 -0
- package/dist/core/command-palette.d.ts +220 -0
- package/dist/core/command-palette.d.ts.map +1 -0
- package/dist/core/command-palette.js +564 -0
- package/dist/core/command-palette.js.map +1 -0
- package/dist/core/constraint.d.ts +315 -0
- package/dist/core/constraint.d.ts.map +1 -0
- package/dist/core/constraint.js +651 -0
- package/dist/core/constraint.js.map +1 -0
- package/dist/core/delta-render.d.ts +64 -0
- package/dist/core/delta-render.d.ts.map +1 -0
- package/dist/core/delta-render.js +367 -0
- package/dist/core/delta-render.js.map +1 -0
- package/dist/core/dirty.d.ts +181 -0
- package/dist/core/dirty.d.ts.map +1 -0
- package/dist/core/dirty.js +335 -0
- package/dist/core/dirty.js.map +1 -0
- package/dist/core/error-boundary.d.ts +79 -0
- package/dist/core/error-boundary.d.ts.map +1 -0
- package/dist/core/error-boundary.js +258 -0
- package/dist/core/error-boundary.js.map +1 -0
- package/dist/core/events.d.ts +206 -0
- package/dist/core/events.d.ts.map +1 -0
- package/dist/core/events.js +411 -0
- package/dist/core/events.js.map +1 -0
- package/dist/core/focus.d.ts +294 -0
- package/dist/core/focus.d.ts.map +1 -0
- package/dist/core/focus.js +589 -0
- package/dist/core/focus.js.map +1 -0
- package/dist/core/graphics.d.ts +146 -0
- package/dist/core/graphics.d.ts.map +1 -0
- package/dist/core/graphics.js +561 -0
- package/dist/core/graphics.js.map +1 -0
- package/dist/core/highlighter.d.ts +148 -0
- package/dist/core/highlighter.d.ts.map +1 -0
- package/dist/core/highlighter.js +2726 -0
- package/dist/core/highlighter.js.map +1 -0
- package/dist/core/hit-test.d.ts +126 -0
- package/dist/core/hit-test.d.ts.map +1 -0
- package/dist/core/hit-test.js +336 -0
- package/dist/core/hit-test.js.map +1 -0
- package/dist/core/index.d.ts +58 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +254 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/input.d.ts +241 -0
- package/dist/core/input.d.ts.map +1 -0
- package/dist/core/input.js +768 -0
- package/dist/core/input.js.map +1 -0
- package/dist/core/keybindings.d.ts +256 -0
- package/dist/core/keybindings.d.ts.map +1 -0
- package/dist/core/keybindings.js +532 -0
- package/dist/core/keybindings.js.map +1 -0
- package/dist/core/layout.d.ts +30 -0
- package/dist/core/layout.d.ts.map +1 -0
- package/dist/core/layout.js +347 -0
- package/dist/core/layout.js.map +1 -0
- package/dist/core/overlay.d.ts +318 -0
- package/dist/core/overlay.d.ts.map +1 -0
- package/dist/core/overlay.js +794 -0
- package/dist/core/overlay.js.map +1 -0
- package/dist/core/query.d.ts +155 -0
- package/dist/core/query.d.ts.map +1 -0
- package/dist/core/query.js +616 -0
- package/dist/core/query.js.map +1 -0
- package/dist/core/renderer.d.ts +28 -0
- package/dist/core/renderer.d.ts.map +1 -0
- package/dist/core/renderer.js +403 -0
- package/dist/core/renderer.js.map +1 -0
- package/dist/core/router.d.ts +401 -0
- package/dist/core/router.d.ts.map +1 -0
- package/dist/core/router.js +766 -0
- package/dist/core/router.js.map +1 -0
- package/dist/core/screen.d.ts +302 -0
- package/dist/core/screen.d.ts.map +1 -0
- package/dist/core/screen.js +537 -0
- package/dist/core/screen.js.map +1 -0
- package/dist/core/signal.d.ts +136 -0
- package/dist/core/signal.d.ts.map +1 -0
- package/dist/core/signal.js +336 -0
- package/dist/core/signal.js.map +1 -0
- package/dist/core/theme.d.ts +220 -0
- package/dist/core/theme.d.ts.map +1 -0
- package/dist/core/theme.js +499 -0
- package/dist/core/theme.js.map +1 -0
- package/dist/core/tick.d.ts +107 -0
- package/dist/core/tick.d.ts.map +1 -0
- package/dist/core/tick.js +174 -0
- package/dist/core/tick.js.map +1 -0
- package/dist/core/transitions.d.ts +335 -0
- package/dist/core/transitions.d.ts.map +1 -0
- package/dist/core/transitions.js +650 -0
- package/dist/core/transitions.js.map +1 -0
- package/dist/core/virtual-scroll.d.ts +241 -0
- package/dist/core/virtual-scroll.d.ts.map +1 -0
- package/dist/core/virtual-scroll.js +476 -0
- package/dist/core/virtual-scroll.js.map +1 -0
- package/dist/core/visualization.d.ts +248 -0
- package/dist/core/visualization.d.ts.map +1 -0
- package/dist/core/visualization.js +709 -0
- package/dist/core/visualization.js.map +1 -0
- package/dist/design-system/core/index.d.ts +6 -0
- package/dist/design-system/core/index.d.ts.map +1 -0
- package/dist/design-system/core/index.js +6 -0
- package/dist/design-system/core/index.js.map +1 -0
- package/dist/design-system/core/layout.d.ts +30 -0
- package/dist/design-system/core/layout.d.ts.map +1 -0
- package/dist/design-system/core/layout.js +344 -0
- package/dist/design-system/core/layout.js.map +1 -0
- package/dist/design-system/core/renderer.d.ts +28 -0
- package/dist/design-system/core/renderer.d.ts.map +1 -0
- package/dist/design-system/core/renderer.js +418 -0
- package/dist/design-system/core/renderer.js.map +1 -0
- package/dist/design-system/data-display/calendar.d.ts +141 -0
- package/dist/design-system/data-display/calendar.d.ts.map +1 -0
- package/dist/design-system/data-display/calendar.js +524 -0
- package/dist/design-system/data-display/calendar.js.map +1 -0
- package/dist/design-system/data-display/code-block.d.ts +75 -0
- package/dist/design-system/data-display/code-block.d.ts.map +1 -0
- package/dist/design-system/data-display/code-block.js +311 -0
- package/dist/design-system/data-display/code-block.js.map +1 -0
- package/dist/design-system/data-display/data-table.d.ts +173 -0
- package/dist/design-system/data-display/data-table.d.ts.map +1 -0
- package/dist/design-system/data-display/data-table.js +428 -0
- package/dist/design-system/data-display/data-table.js.map +1 -0
- package/dist/design-system/data-display/index.d.ts +10 -0
- package/dist/design-system/data-display/index.d.ts.map +1 -0
- package/dist/design-system/data-display/index.js +16 -0
- package/dist/design-system/data-display/index.js.map +1 -0
- package/dist/design-system/data-display/markdown.d.ts +52 -0
- package/dist/design-system/data-display/markdown.d.ts.map +1 -0
- package/dist/design-system/data-display/markdown.js +341 -0
- package/dist/design-system/data-display/markdown.js.map +1 -0
- package/dist/design-system/data-display/table.d.ts +103 -0
- package/dist/design-system/data-display/table.d.ts.map +1 -0
- package/dist/design-system/data-display/table.js +342 -0
- package/dist/design-system/data-display/table.js.map +1 -0
- package/dist/design-system/data-display/tree.d.ts +166 -0
- package/dist/design-system/data-display/tree.d.ts.map +1 -0
- package/dist/design-system/data-display/tree.js +428 -0
- package/dist/design-system/data-display/tree.js.map +1 -0
- package/dist/design-system/feedback/badge.d.ts +21 -0
- package/dist/design-system/feedback/badge.d.ts.map +1 -0
- package/dist/design-system/feedback/badge.js +9 -0
- package/dist/design-system/feedback/badge.js.map +1 -0
- package/dist/design-system/feedback/index.d.ts +8 -0
- package/dist/design-system/feedback/index.d.ts.map +1 -0
- package/dist/design-system/feedback/index.js +12 -0
- package/dist/design-system/feedback/index.js.map +1 -0
- package/dist/design-system/feedback/progress-bar.d.ts +93 -0
- package/dist/design-system/feedback/progress-bar.d.ts.map +1 -0
- package/dist/design-system/feedback/progress-bar.js +440 -0
- package/dist/design-system/feedback/progress-bar.js.map +1 -0
- package/dist/design-system/feedback/spinner.d.ts +88 -0
- package/dist/design-system/feedback/spinner.d.ts.map +1 -0
- package/dist/design-system/feedback/spinner.js +679 -0
- package/dist/design-system/feedback/spinner.js.map +1 -0
- package/dist/design-system/feedback/timer.d.ts +175 -0
- package/dist/design-system/feedback/timer.d.ts.map +1 -0
- package/dist/design-system/feedback/timer.js +352 -0
- package/dist/design-system/feedback/timer.js.map +1 -0
- package/dist/design-system/forms/autocomplete.d.ts +163 -0
- package/dist/design-system/forms/autocomplete.d.ts.map +1 -0
- package/dist/design-system/forms/autocomplete.js +455 -0
- package/dist/design-system/forms/autocomplete.js.map +1 -0
- package/dist/design-system/forms/button.d.ts +106 -0
- package/dist/design-system/forms/button.d.ts.map +1 -0
- package/dist/design-system/forms/button.js +170 -0
- package/dist/design-system/forms/button.js.map +1 -0
- package/dist/design-system/forms/index.d.ts +12 -0
- package/dist/design-system/forms/index.d.ts.map +1 -0
- package/dist/design-system/forms/index.js +20 -0
- package/dist/design-system/forms/index.js.map +1 -0
- package/dist/design-system/forms/multi-select.d.ts +102 -0
- package/dist/design-system/forms/multi-select.d.ts.map +1 -0
- package/dist/design-system/forms/multi-select.js +309 -0
- package/dist/design-system/forms/multi-select.js.map +1 -0
- package/dist/design-system/forms/radio-group.d.ts +88 -0
- package/dist/design-system/forms/radio-group.d.ts.map +1 -0
- package/dist/design-system/forms/radio-group.js +145 -0
- package/dist/design-system/forms/radio-group.js.map +1 -0
- package/dist/design-system/forms/select.d.ts +116 -0
- package/dist/design-system/forms/select.d.ts.map +1 -0
- package/dist/design-system/forms/select.js +441 -0
- package/dist/design-system/forms/select.js.map +1 -0
- package/dist/design-system/forms/slider.d.ts +134 -0
- package/dist/design-system/forms/slider.d.ts.map +1 -0
- package/dist/design-system/forms/slider.js +314 -0
- package/dist/design-system/forms/slider.js.map +1 -0
- package/dist/design-system/forms/switch.d.ts +99 -0
- package/dist/design-system/forms/switch.d.ts.map +1 -0
- package/dist/design-system/forms/switch.js +173 -0
- package/dist/design-system/forms/switch.js.map +1 -0
- package/dist/design-system/forms/text-input.d.ts +79 -0
- package/dist/design-system/forms/text-input.d.ts.map +1 -0
- package/dist/design-system/forms/text-input.js +344 -0
- package/dist/design-system/forms/text-input.js.map +1 -0
- package/dist/design-system/index.d.ts +23 -0
- package/dist/design-system/index.d.ts.map +1 -0
- package/dist/design-system/index.js +74 -0
- package/dist/design-system/index.js.map +1 -0
- package/dist/design-system/layout/app.d.ts +205 -0
- package/dist/design-system/layout/app.d.ts.map +1 -0
- package/dist/design-system/layout/app.js +286 -0
- package/dist/design-system/layout/app.js.map +1 -0
- package/dist/design-system/layout/collapsible.d.ts +166 -0
- package/dist/design-system/layout/collapsible.d.ts.map +1 -0
- package/dist/design-system/layout/collapsible.js +286 -0
- package/dist/design-system/layout/collapsible.js.map +1 -0
- package/dist/design-system/layout/grid.d.ts +232 -0
- package/dist/design-system/layout/grid.d.ts.map +1 -0
- package/dist/design-system/layout/grid.js +333 -0
- package/dist/design-system/layout/grid.js.map +1 -0
- package/dist/design-system/layout/index.d.ts +27 -0
- package/dist/design-system/layout/index.d.ts.map +1 -0
- package/dist/design-system/layout/index.js +34 -0
- package/dist/design-system/layout/index.js.map +1 -0
- package/dist/design-system/layout/scroll-area.d.ts +188 -0
- package/dist/design-system/layout/scroll-area.d.ts.map +1 -0
- package/dist/design-system/layout/scroll-area.js +348 -0
- package/dist/design-system/layout/scroll-area.js.map +1 -0
- package/dist/design-system/layout/split-panel.d.ts +183 -0
- package/dist/design-system/layout/split-panel.d.ts.map +1 -0
- package/dist/design-system/layout/split-panel.js +323 -0
- package/dist/design-system/layout/split-panel.js.map +1 -0
- package/dist/design-system/layout/stack.d.ts +189 -0
- package/dist/design-system/layout/stack.d.ts.map +1 -0
- package/dist/design-system/layout/stack.js +170 -0
- package/dist/design-system/layout/stack.js.map +1 -0
- package/dist/design-system/layout/tabs.d.ts +129 -0
- package/dist/design-system/layout/tabs.d.ts.map +1 -0
- package/dist/design-system/layout/tabs.js +373 -0
- package/dist/design-system/layout/tabs.js.map +1 -0
- package/dist/design-system/media/index.d.ts +13 -0
- package/dist/design-system/media/index.d.ts.map +1 -0
- package/dist/design-system/media/index.js +23 -0
- package/dist/design-system/media/index.js.map +1 -0
- package/dist/design-system/media/picture.d.ts +304 -0
- package/dist/design-system/media/picture.d.ts.map +1 -0
- package/dist/design-system/media/picture.js +681 -0
- package/dist/design-system/media/picture.js.map +1 -0
- package/dist/design-system/navigation/file-manager.d.ts +492 -0
- package/dist/design-system/navigation/file-manager.d.ts.map +1 -0
- package/dist/design-system/navigation/file-manager.js +807 -0
- package/dist/design-system/navigation/file-manager.js.map +1 -0
- package/dist/design-system/navigation/index.d.ts +13 -0
- package/dist/design-system/navigation/index.d.ts.map +1 -0
- package/dist/design-system/navigation/index.js +19 -0
- package/dist/design-system/navigation/index.js.map +1 -0
- package/dist/design-system/overlays/command-palette.d.ts +217 -0
- package/dist/design-system/overlays/command-palette.d.ts.map +1 -0
- package/dist/design-system/overlays/command-palette.js +443 -0
- package/dist/design-system/overlays/command-palette.js.map +1 -0
- package/dist/design-system/overlays/index.d.ts +7 -0
- package/dist/design-system/overlays/index.d.ts.map +1 -0
- package/dist/design-system/overlays/index.js +10 -0
- package/dist/design-system/overlays/index.js.map +1 -0
- package/dist/design-system/overlays/modal.d.ts +251 -0
- package/dist/design-system/overlays/modal.d.ts.map +1 -0
- package/dist/design-system/overlays/modal.js +461 -0
- package/dist/design-system/overlays/modal.js.map +1 -0
- package/dist/design-system/overlays/overlay-stack.d.ts +200 -0
- package/dist/design-system/overlays/overlay-stack.d.ts.map +1 -0
- package/dist/design-system/overlays/overlay-stack.js +341 -0
- package/dist/design-system/overlays/overlay-stack.js.map +1 -0
- package/dist/design-system/primitives/box.d.ts +16 -0
- package/dist/design-system/primitives/box.d.ts.map +1 -0
- package/dist/design-system/primitives/box.js +23 -0
- package/dist/design-system/primitives/box.js.map +1 -0
- package/dist/design-system/primitives/divider.d.ts +52 -0
- package/dist/design-system/primitives/divider.d.ts.map +1 -0
- package/dist/design-system/primitives/divider.js +72 -0
- package/dist/design-system/primitives/divider.js.map +1 -0
- package/dist/design-system/primitives/helpers.d.ts +10 -0
- package/dist/design-system/primitives/helpers.d.ts.map +1 -0
- package/dist/design-system/primitives/helpers.js +27 -0
- package/dist/design-system/primitives/helpers.js.map +1 -0
- package/dist/design-system/primitives/index.d.ts +11 -0
- package/dist/design-system/primitives/index.d.ts.map +1 -0
- package/dist/design-system/primitives/index.js +14 -0
- package/dist/design-system/primitives/index.js.map +1 -0
- package/dist/design-system/primitives/slot.d.ts +35 -0
- package/dist/design-system/primitives/slot.d.ts.map +1 -0
- package/dist/design-system/primitives/slot.js +17 -0
- package/dist/design-system/primitives/slot.js.map +1 -0
- package/dist/design-system/primitives/spacer.d.ts +34 -0
- package/dist/design-system/primitives/spacer.d.ts.map +1 -0
- package/dist/design-system/primitives/spacer.js +53 -0
- package/dist/design-system/primitives/spacer.js.map +1 -0
- package/dist/design-system/primitives/text.d.ts +12 -0
- package/dist/design-system/primitives/text.d.ts.map +1 -0
- package/dist/design-system/primitives/text.js +25 -0
- package/dist/design-system/primitives/text.js.map +1 -0
- package/dist/design-system/primitives/utilities.d.ts +70 -0
- package/dist/design-system/primitives/utilities.d.ts.map +1 -0
- package/dist/design-system/primitives/utilities.js +56 -0
- package/dist/design-system/primitives/utilities.js.map +1 -0
- package/dist/design-system/visual/big-text.d.ts +151 -0
- package/dist/design-system/visual/big-text.d.ts.map +1 -0
- package/dist/design-system/visual/big-text.js +578 -0
- package/dist/design-system/visual/big-text.js.map +1 -0
- package/dist/design-system/visual/digits.d.ts +159 -0
- package/dist/design-system/visual/digits.d.ts.map +1 -0
- package/dist/design-system/visual/digits.js +287 -0
- package/dist/design-system/visual/digits.js.map +1 -0
- package/dist/design-system/visual/index.d.ts +20 -0
- package/dist/design-system/visual/index.d.ts.map +1 -0
- package/dist/design-system/visual/index.js +23 -0
- package/dist/design-system/visual/index.js.map +1 -0
- package/dist/design-system/visual/splash-screen.d.ts +93 -0
- package/dist/design-system/visual/splash-screen.d.ts.map +1 -0
- package/dist/design-system/visual/splash-screen.js +219 -0
- package/dist/design-system/visual/splash-screen.js.map +1 -0
- package/dist/design-system/visual/tooltip.d.ts +188 -0
- package/dist/design-system/visual/tooltip.d.ts.map +1 -0
- package/dist/design-system/visual/tooltip.js +276 -0
- package/dist/design-system/visual/tooltip.js.map +1 -0
- package/dist/dev-tools/debugger.d.ts +223 -0
- package/dist/dev-tools/debugger.d.ts.map +1 -0
- package/dist/dev-tools/debugger.js +489 -0
- package/dist/dev-tools/debugger.js.map +1 -0
- package/dist/dev-tools/index.d.ts +22 -0
- package/dist/dev-tools/index.d.ts.map +1 -0
- package/dist/dev-tools/index.js +63 -0
- package/dist/dev-tools/index.js.map +1 -0
- package/dist/dev-tools/mouse-simulator.d.ts +155 -0
- package/dist/dev-tools/mouse-simulator.d.ts.map +1 -0
- package/dist/dev-tools/mouse-simulator.js +314 -0
- package/dist/dev-tools/mouse-simulator.js.map +1 -0
- package/dist/dev-tools/testing.d.ts +262 -0
- package/dist/dev-tools/testing.d.ts.map +1 -0
- package/dist/dev-tools/testing.js +858 -0
- package/dist/dev-tools/testing.js.map +1 -0
- package/dist/hooks/context.d.ts +47 -0
- package/dist/hooks/context.d.ts.map +1 -0
- package/dist/hooks/context.js +108 -0
- package/dist/hooks/context.js.map +1 -0
- package/dist/hooks/focus-context.d.ts +65 -0
- package/dist/hooks/focus-context.d.ts.map +1 -0
- package/dist/hooks/focus-context.js +79 -0
- package/dist/hooks/focus-context.js.map +1 -0
- package/dist/hooks/index.d.ts +16 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +22 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/types.d.ts +76 -0
- package/dist/hooks/types.d.ts.map +1 -0
- package/dist/hooks/types.js +5 -0
- package/dist/hooks/types.js.map +1 -0
- package/dist/hooks/use-app.d.ts +27 -0
- package/dist/hooks/use-app.d.ts.map +1 -0
- package/dist/hooks/use-app.js +179 -0
- package/dist/hooks/use-app.js.map +1 -0
- package/dist/hooks/use-effect.d.ts +20 -0
- package/dist/hooks/use-effect.d.ts.map +1 -0
- package/dist/hooks/use-effect.js +55 -0
- package/dist/hooks/use-effect.js.map +1 -0
- package/dist/hooks/use-focus.d.ts +48 -0
- package/dist/hooks/use-focus.d.ts.map +1 -0
- package/dist/hooks/use-focus.js +152 -0
- package/dist/hooks/use-focus.js.map +1 -0
- package/dist/hooks/use-input.d.ts +35 -0
- package/dist/hooks/use-input.d.ts.map +1 -0
- package/dist/hooks/use-input.js +352 -0
- package/dist/hooks/use-input.js.map +1 -0
- package/dist/hooks/use-mouse.d.ts +82 -0
- package/dist/hooks/use-mouse.d.ts.map +1 -0
- package/dist/hooks/use-mouse.js +328 -0
- package/dist/hooks/use-mouse.js.map +1 -0
- package/dist/hooks/use-navigation.d.ts +206 -0
- package/dist/hooks/use-navigation.d.ts.map +1 -0
- package/dist/hooks/use-navigation.js +319 -0
- package/dist/hooks/use-navigation.js.map +1 -0
- package/dist/hooks/use-state.d.ts +15 -0
- package/dist/hooks/use-state.d.ts.map +1 -0
- package/dist/hooks/use-state.js +29 -0
- package/dist/hooks/use-state.js.map +1 -0
- package/dist/hooks/use-terminal-size.d.ts +12 -0
- package/dist/hooks/use-terminal-size.d.ts.map +1 -0
- package/dist/hooks/use-terminal-size.js +20 -0
- package/dist/hooks/use-terminal-size.js.map +1 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +334 -0
- package/dist/index.js.map +1 -0
- package/dist/molecules/autocomplete.d.ts +166 -0
- package/dist/molecules/autocomplete.d.ts.map +1 -0
- package/dist/molecules/autocomplete.js +458 -0
- package/dist/molecules/autocomplete.js.map +1 -0
- package/dist/molecules/calendar.d.ts +144 -0
- package/dist/molecules/calendar.d.ts.map +1 -0
- package/dist/molecules/calendar.js +527 -0
- package/dist/molecules/calendar.js.map +1 -0
- package/dist/molecules/code-block.d.ts +88 -0
- package/dist/molecules/code-block.d.ts.map +1 -0
- package/dist/molecules/code-block.js +324 -0
- package/dist/molecules/code-block.js.map +1 -0
- package/dist/molecules/collapsible.d.ts +169 -0
- package/dist/molecules/collapsible.d.ts.map +1 -0
- package/dist/molecules/collapsible.js +289 -0
- package/dist/molecules/collapsible.js.map +1 -0
- package/dist/molecules/data-viz/bar-chart.d.ts +167 -0
- package/dist/molecules/data-viz/bar-chart.d.ts.map +1 -0
- package/dist/molecules/data-viz/bar-chart.js +375 -0
- package/dist/molecules/data-viz/bar-chart.js.map +1 -0
- package/dist/molecules/data-viz/gauge.d.ts +163 -0
- package/dist/molecules/data-viz/gauge.d.ts.map +1 -0
- package/dist/molecules/data-viz/gauge.js +451 -0
- package/dist/molecules/data-viz/gauge.js.map +1 -0
- package/dist/molecules/data-viz/heatmap.d.ts +154 -0
- package/dist/molecules/data-viz/heatmap.d.ts.map +1 -0
- package/dist/molecules/data-viz/heatmap.js +458 -0
- package/dist/molecules/data-viz/heatmap.js.map +1 -0
- package/dist/molecules/data-viz/index.d.ts +16 -0
- package/dist/molecules/data-viz/index.d.ts.map +1 -0
- package/dist/molecules/data-viz/index.js +16 -0
- package/dist/molecules/data-viz/index.js.map +1 -0
- package/dist/molecules/data-viz/line-chart.d.ts +157 -0
- package/dist/molecules/data-viz/line-chart.d.ts.map +1 -0
- package/dist/molecules/data-viz/line-chart.js +578 -0
- package/dist/molecules/data-viz/line-chart.js.map +1 -0
- package/dist/molecules/data-viz/sparkline.d.ts +156 -0
- package/dist/molecules/data-viz/sparkline.d.ts.map +1 -0
- package/dist/molecules/data-viz/sparkline.js +325 -0
- package/dist/molecules/data-viz/sparkline.js.map +1 -0
- package/dist/molecules/index.d.ts +22 -0
- package/dist/molecules/index.d.ts.map +1 -0
- package/dist/molecules/index.js +26 -0
- package/dist/molecules/index.js.map +1 -0
- package/dist/molecules/markdown.d.ts +61 -0
- package/dist/molecules/markdown.d.ts.map +1 -0
- package/dist/molecules/markdown.js +350 -0
- package/dist/molecules/markdown.js.map +1 -0
- package/dist/molecules/multi-select.d.ts +105 -0
- package/dist/molecules/multi-select.d.ts.map +1 -0
- package/dist/molecules/multi-select.js +312 -0
- package/dist/molecules/multi-select.js.map +1 -0
- package/dist/molecules/radio-group.d.ts +91 -0
- package/dist/molecules/radio-group.d.ts.map +1 -0
- package/dist/molecules/radio-group.js +148 -0
- package/dist/molecules/radio-group.js.map +1 -0
- package/dist/molecules/select.d.ts +119 -0
- package/dist/molecules/select.d.ts.map +1 -0
- package/dist/molecules/select.js +444 -0
- package/dist/molecules/select.js.map +1 -0
- package/dist/molecules/table.d.ts +106 -0
- package/dist/molecules/table.d.ts.map +1 -0
- package/dist/molecules/table.js +345 -0
- package/dist/molecules/table.js.map +1 -0
- package/dist/molecules/tabs.d.ts +132 -0
- package/dist/molecules/tabs.d.ts.map +1 -0
- package/dist/molecules/tabs.js +376 -0
- package/dist/molecules/tabs.js.map +1 -0
- package/dist/molecules/tree.d.ts +169 -0
- package/dist/molecules/tree.d.ts.map +1 -0
- package/dist/molecules/tree.js +431 -0
- package/dist/molecules/tree.js.map +1 -0
- package/dist/organisms/command-palette.d.ts +217 -0
- package/dist/organisms/command-palette.d.ts.map +1 -0
- package/dist/organisms/command-palette.js +443 -0
- package/dist/organisms/command-palette.js.map +1 -0
- package/dist/organisms/data-table.d.ts +173 -0
- package/dist/organisms/data-table.d.ts.map +1 -0
- package/dist/organisms/data-table.js +428 -0
- package/dist/organisms/data-table.js.map +1 -0
- package/dist/organisms/file-browser.d.ts +492 -0
- package/dist/organisms/file-browser.d.ts.map +1 -0
- package/dist/organisms/file-browser.js +807 -0
- package/dist/organisms/file-browser.js.map +1 -0
- package/dist/organisms/grid.d.ts +234 -0
- package/dist/organisms/grid.d.ts.map +1 -0
- package/dist/organisms/grid.js +719 -0
- package/dist/organisms/grid.js.map +1 -0
- package/dist/organisms/index.d.ts +30 -0
- package/dist/organisms/index.d.ts.map +1 -0
- package/dist/organisms/index.js +92 -0
- package/dist/organisms/index.js.map +1 -0
- package/dist/organisms/modal.d.ts +251 -0
- package/dist/organisms/modal.d.ts.map +1 -0
- package/dist/organisms/modal.js +461 -0
- package/dist/organisms/modal.js.map +1 -0
- package/dist/organisms/overlay-stack.d.ts +200 -0
- package/dist/organisms/overlay-stack.d.ts.map +1 -0
- package/dist/organisms/overlay-stack.js +341 -0
- package/dist/organisms/overlay-stack.js.map +1 -0
- package/dist/organisms/scroll-area.d.ts +188 -0
- package/dist/organisms/scroll-area.d.ts.map +1 -0
- package/dist/organisms/scroll-area.js +348 -0
- package/dist/organisms/scroll-area.js.map +1 -0
- package/dist/organisms/split-panel.d.ts +183 -0
- package/dist/organisms/split-panel.d.ts.map +1 -0
- package/dist/organisms/split-panel.js +323 -0
- package/dist/organisms/split-panel.js.map +1 -0
- package/dist/primitives/canvas.d.ts +322 -0
- package/dist/primitives/canvas.d.ts.map +1 -0
- package/dist/primitives/canvas.js +833 -0
- package/dist/primitives/canvas.js.map +1 -0
- package/dist/primitives/context.d.ts +83 -0
- package/dist/primitives/context.d.ts.map +1 -0
- package/dist/primitives/context.js +101 -0
- package/dist/primitives/context.js.map +1 -0
- package/dist/primitives/divider.d.ts +52 -0
- package/dist/primitives/divider.d.ts.map +1 -0
- package/dist/primitives/divider.js +71 -0
- package/dist/primitives/divider.js.map +1 -0
- package/dist/primitives/index.d.ts +10 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +10 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/nodes.d.ts +152 -0
- package/dist/primitives/nodes.d.ts.map +1 -0
- package/dist/primitives/nodes.js +164 -0
- package/dist/primitives/nodes.js.map +1 -0
- package/dist/primitives/signal.d.ts +136 -0
- package/dist/primitives/signal.d.ts.map +1 -0
- package/dist/primitives/signal.js +338 -0
- package/dist/primitives/signal.js.map +1 -0
- package/dist/primitives/store.d.ts +86 -0
- package/dist/primitives/store.d.ts.map +1 -0
- package/dist/primitives/store.js +147 -0
- package/dist/primitives/store.js.map +1 -0
- package/dist/storybook/app.d.ts +16 -0
- package/dist/storybook/app.d.ts.map +1 -0
- package/dist/storybook/app.js +697 -0
- package/dist/storybook/app.js.map +1 -0
- package/dist/storybook/cli.d.ts +10 -0
- package/dist/storybook/cli.d.ts.map +1 -0
- package/dist/storybook/cli.js +14 -0
- package/dist/storybook/cli.js.map +1 -0
- package/dist/storybook/components/compare-view.d.ts +46 -0
- package/dist/storybook/components/compare-view.d.ts.map +1 -0
- package/dist/storybook/components/compare-view.js +235 -0
- package/dist/storybook/components/compare-view.js.map +1 -0
- package/dist/storybook/components/index.d.ts +7 -0
- package/dist/storybook/components/index.d.ts.map +1 -0
- package/dist/storybook/components/index.js +7 -0
- package/dist/storybook/components/index.js.map +1 -0
- package/dist/storybook/components/log-viewer.d.ts +9 -0
- package/dist/storybook/components/log-viewer.d.ts.map +1 -0
- package/dist/storybook/components/log-viewer.js +46 -0
- package/dist/storybook/components/log-viewer.js.map +1 -0
- package/dist/storybook/components/preview.d.ts +28 -0
- package/dist/storybook/components/preview.d.ts.map +1 -0
- package/dist/storybook/components/preview.js +248 -0
- package/dist/storybook/components/preview.js.map +1 -0
- package/dist/storybook/components/sidebar.d.ts +29 -0
- package/dist/storybook/components/sidebar.d.ts.map +1 -0
- package/dist/storybook/components/sidebar.js +176 -0
- package/dist/storybook/components/sidebar.js.map +1 -0
- package/dist/storybook/core/comparatives.d.ts +94 -0
- package/dist/storybook/core/comparatives.d.ts.map +1 -0
- package/dist/storybook/core/comparatives.js +301 -0
- package/dist/storybook/core/comparatives.js.map +1 -0
- package/dist/storybook/core/index.d.ts +8 -0
- package/dist/storybook/core/index.d.ts.map +1 -0
- package/dist/storybook/core/index.js +8 -0
- package/dist/storybook/core/index.js.map +1 -0
- package/dist/storybook/core/navigator.d.ts +64 -0
- package/dist/storybook/core/navigator.d.ts.map +1 -0
- package/dist/storybook/core/navigator.js +279 -0
- package/dist/storybook/core/navigator.js.map +1 -0
- package/dist/storybook/core/playground.d.ts +73 -0
- package/dist/storybook/core/playground.d.ts.map +1 -0
- package/dist/storybook/core/playground.js +338 -0
- package/dist/storybook/core/playground.js.map +1 -0
- package/dist/storybook/core/registry.d.ts +87 -0
- package/dist/storybook/core/registry.d.ts.map +1 -0
- package/dist/storybook/core/registry.js +222 -0
- package/dist/storybook/core/registry.js.map +1 -0
- package/dist/storybook/data/ascii-art.d.ts +18 -0
- package/dist/storybook/data/ascii-art.d.ts.map +1 -0
- package/dist/storybook/data/ascii-art.js +62 -0
- package/dist/storybook/data/ascii-art.js.map +1 -0
- package/dist/storybook/data/tuiuiu-bird-colored.d.ts +13 -0
- package/dist/storybook/data/tuiuiu-bird-colored.d.ts.map +1 -0
- package/dist/storybook/data/tuiuiu-bird-colored.js +12 -0
- package/dist/storybook/data/tuiuiu-bird-colored.js.map +1 -0
- package/dist/storybook/index.d.ts +33 -0
- package/dist/storybook/index.d.ts.map +1 -0
- package/dist/storybook/index.js +44 -0
- package/dist/storybook/index.js.map +1 -0
- package/dist/storybook/store.d.ts +39 -0
- package/dist/storybook/store.d.ts.map +1 -0
- package/dist/storybook/store.js +91 -0
- package/dist/storybook/store.js.map +1 -0
- package/dist/storybook/stories/apps/index.d.ts +24 -0
- package/dist/storybook/stories/apps/index.d.ts.map +1 -0
- package/dist/storybook/stories/apps/index.js +434 -0
- package/dist/storybook/stories/apps/index.js.map +1 -0
- package/dist/storybook/stories/atoms/index.d.ts +40 -0
- package/dist/storybook/stories/atoms/index.d.ts.map +1 -0
- package/dist/storybook/stories/atoms/index.js +462 -0
- package/dist/storybook/stories/atoms/index.js.map +1 -0
- package/dist/storybook/stories/index.d.ts +37 -0
- package/dist/storybook/stories/index.d.ts.map +1 -0
- package/dist/storybook/stories/index.js +56 -0
- package/dist/storybook/stories/index.js.map +1 -0
- package/dist/storybook/stories/molecules/index.d.ts +68 -0
- package/dist/storybook/stories/molecules/index.d.ts.map +1 -0
- package/dist/storybook/stories/molecules/index.js +587 -0
- package/dist/storybook/stories/molecules/index.js.map +1 -0
- package/dist/storybook/stories/organisms/index.d.ts +29 -0
- package/dist/storybook/stories/organisms/index.d.ts.map +1 -0
- package/dist/storybook/stories/organisms/index.js +677 -0
- package/dist/storybook/stories/organisms/index.js.map +1 -0
- package/dist/storybook/types.d.ts +40 -0
- package/dist/storybook/types.d.ts.map +1 -0
- package/dist/storybook/types.js +5 -0
- package/dist/storybook/types.js.map +1 -0
- package/dist/styling/index.d.ts +12 -0
- package/dist/styling/index.d.ts.map +1 -0
- package/dist/styling/index.js +24 -0
- package/dist/styling/index.js.map +1 -0
- package/dist/styling/parser.d.ts +217 -0
- package/dist/styling/parser.d.ts.map +1 -0
- package/dist/styling/parser.js +901 -0
- package/dist/styling/parser.js.map +1 -0
- package/dist/styling/resolver.d.ts +217 -0
- package/dist/styling/resolver.d.ts.map +1 -0
- package/dist/styling/resolver.js +628 -0
- package/dist/styling/resolver.js.map +1 -0
- package/dist/styling/tokenizer.d.ts +121 -0
- package/dist/styling/tokenizer.d.ts.map +1 -0
- package/dist/styling/tokenizer.js +553 -0
- package/dist/styling/tokenizer.js.map +1 -0
- package/dist/templates/app.d.ts +205 -0
- package/dist/templates/app.d.ts.map +1 -0
- package/dist/templates/app.js +286 -0
- package/dist/templates/app.js.map +1 -0
- package/dist/templates/index.d.ts +30 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +40 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/stack.d.ts +189 -0
- package/dist/templates/stack.d.ts.map +1 -0
- package/dist/templates/stack.js +170 -0
- package/dist/templates/stack.js.map +1 -0
- package/dist/utils/batcher.d.ts +88 -0
- package/dist/utils/batcher.d.ts.map +1 -0
- package/dist/utils/batcher.js +172 -0
- package/dist/utils/batcher.js.map +1 -0
- package/dist/utils/cursor.d.ts +28 -0
- package/dist/utils/cursor.d.ts.map +1 -0
- package/dist/utils/cursor.js +86 -0
- package/dist/utils/cursor.js.map +1 -0
- package/dist/utils/fs-storage.d.ts +23 -0
- package/dist/utils/fs-storage.d.ts.map +1 -0
- package/dist/utils/fs-storage.js +34 -0
- package/dist/utils/fs-storage.js.map +1 -0
- package/dist/utils/index.d.ts +14 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +15 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/log-update.d.ts +31 -0
- package/dist/utils/log-update.d.ts.map +1 -0
- package/dist/utils/log-update.js +147 -0
- package/dist/utils/log-update.js.map +1 -0
- package/dist/utils/text-utils.d.ts +151 -0
- package/dist/utils/text-utils.d.ts.map +1 -0
- package/dist/utils/text-utils.js +699 -0
- package/dist/utils/text-utils.js.map +1 -0
- package/dist/utils/types.d.ts +205 -0
- package/dist/utils/types.d.ts.map +1 -0
- package/dist/utils/types.js +430 -0
- package/dist/utils/types.js.map +1 -0
- package/package.json +142 -0
|
@@ -0,0 +1,677 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Organisms Stories
|
|
3
|
+
*
|
|
4
|
+
* Organisms are complex UI components composed of atoms and molecules.
|
|
5
|
+
* They represent distinct sections of an interface:
|
|
6
|
+
* - Form patterns (Login, Settings)
|
|
7
|
+
* - Layout components (SplitPanel, Grid, Stack)
|
|
8
|
+
* - Complex charts (BarChart, Heatmap)
|
|
9
|
+
* - UI patterns (Dashboard, File Browser, Chat, Command Palette, Navigation)
|
|
10
|
+
*/
|
|
11
|
+
import { Box, Text, Spacer } from '../../../primitives/nodes.js';
|
|
12
|
+
import { Divider } from '../../../primitives/divider.js';
|
|
13
|
+
import { story, defaultControls } from '../../core/registry.js';
|
|
14
|
+
// Chart helper
|
|
15
|
+
function textBar(value, max, width, filled = '█', empty = '░') {
|
|
16
|
+
const filledWidth = Math.round((value / max) * width);
|
|
17
|
+
return filled.repeat(filledWidth) + empty.repeat(width - filledWidth);
|
|
18
|
+
}
|
|
19
|
+
// ============================================================================
|
|
20
|
+
// Form Patterns
|
|
21
|
+
// ============================================================================
|
|
22
|
+
export const formPatternStories = [
|
|
23
|
+
story('Form - Login')
|
|
24
|
+
.category('Organisms')
|
|
25
|
+
.description('Login form pattern')
|
|
26
|
+
.render(() => Box({
|
|
27
|
+
flexDirection: 'column',
|
|
28
|
+
borderStyle: 'round',
|
|
29
|
+
borderColor: 'cyan',
|
|
30
|
+
padding: 2,
|
|
31
|
+
width: 40,
|
|
32
|
+
}, Box({ marginBottom: 1 }, Text({ color: 'cyan', bold: true }, 'Login')), Box({ flexDirection: 'column', marginBottom: 1 }, Text({ color: 'gray' }, 'Username:'), Box({ borderStyle: 'single', borderColor: 'gray', paddingX: 1 }, Text({}, 'user@example.com'))), Box({ flexDirection: 'column', marginBottom: 1 }, Text({ color: 'gray' }, 'Password:'), Box({ borderStyle: 'single', borderColor: 'gray', paddingX: 1 }, Text({}, '********'))), Box({ flexDirection: 'row', gap: 2 }, Box({ backgroundColor: 'blue', paddingX: 2 }, Text({ color: 'white', bold: true }, 'Login')), Text({ color: 'gray', dim: true }, 'Forgot password?')))),
|
|
33
|
+
story('Form - Settings')
|
|
34
|
+
.category('Organisms')
|
|
35
|
+
.description('Settings form pattern')
|
|
36
|
+
.render(() => Box({
|
|
37
|
+
flexDirection: 'column',
|
|
38
|
+
borderStyle: 'single',
|
|
39
|
+
borderColor: 'gray',
|
|
40
|
+
padding: 1,
|
|
41
|
+
width: 50,
|
|
42
|
+
}, Box({ marginBottom: 1 }, Text({ color: 'white', bold: true }, 'Settings')), Box({ flexDirection: 'row', justifyContent: 'space-between', marginBottom: 1 }, Text({}, 'Dark Mode'), Text({ color: 'green' }, '[ON]')), Box({ flexDirection: 'row', justifyContent: 'space-between', marginBottom: 1 }, Text({}, 'Notifications'), Text({ color: 'red' }, '[OFF]')), Box({ flexDirection: 'row', justifyContent: 'space-between', marginBottom: 1 }, Text({}, 'Language'), Text({ color: 'cyan' }, 'English ▼')), Box({ flexDirection: 'row', justifyContent: 'space-between' }, Text({}, 'Volume'), Text({ color: 'yellow' }, '████████░░ 80%')))),
|
|
43
|
+
];
|
|
44
|
+
// ============================================================================
|
|
45
|
+
// Layout Components
|
|
46
|
+
// ============================================================================
|
|
47
|
+
export const splitPanelStories = [
|
|
48
|
+
story('SplitPanel - Horizontal')
|
|
49
|
+
.category('Organisms')
|
|
50
|
+
.description('Horizontal split with resizable divider')
|
|
51
|
+
.controls({
|
|
52
|
+
ratio: defaultControls.range('Ratio %', 50, 10, 90),
|
|
53
|
+
})
|
|
54
|
+
.render((props) => {
|
|
55
|
+
const leftWidth = Math.floor(58 * (props.ratio / 100));
|
|
56
|
+
const rightWidth = 58 - leftWidth - 1;
|
|
57
|
+
return Box({ width: 60, height: 10, borderStyle: 'single', borderColor: 'gray' }, Box({ width: leftWidth, height: '100%', backgroundColor: 'blue', padding: 1 }, Text({ color: 'white' }, 'Left Panel')), Box({ width: 1, height: '100%', backgroundColor: 'gray' }, Text({ color: 'white' }, '│')), Box({ width: rightWidth, height: '100%', backgroundColor: 'green', padding: 1 }, Text({ color: 'white' }, 'Right Panel')));
|
|
58
|
+
}),
|
|
59
|
+
story('SplitPanel - Vertical')
|
|
60
|
+
.category('Organisms')
|
|
61
|
+
.description('Vertical split with resizable divider')
|
|
62
|
+
.controls({
|
|
63
|
+
ratio: defaultControls.range('Ratio %', 50, 10, 90),
|
|
64
|
+
})
|
|
65
|
+
.render((props) => {
|
|
66
|
+
const topHeight = Math.floor(13 * (props.ratio / 100));
|
|
67
|
+
const bottomHeight = 13 - topHeight - 1;
|
|
68
|
+
return Box({
|
|
69
|
+
width: 40,
|
|
70
|
+
height: 15,
|
|
71
|
+
flexDirection: 'column',
|
|
72
|
+
borderStyle: 'single',
|
|
73
|
+
borderColor: 'gray',
|
|
74
|
+
}, Box({ height: topHeight, width: '100%', backgroundColor: 'blue', padding: 1 }, Text({ color: 'white' }, 'Top Panel')), Box({ width: '100%' }, Text({ color: 'gray' }, '─'.repeat(38))), Box({ height: bottomHeight, width: '100%', backgroundColor: 'green', padding: 1 }, Text({ color: 'white' }, 'Bottom Panel')));
|
|
75
|
+
}),
|
|
76
|
+
story('SplitPanel - Nested')
|
|
77
|
+
.category('Organisms')
|
|
78
|
+
.description('Nested split panels')
|
|
79
|
+
.render(() => Box({ width: 60, height: 15, borderStyle: 'single', borderColor: 'gray' }, Box({ width: 17, height: '100%', backgroundColor: 'blue', padding: 1 }, Text({ color: 'white' }, 'Sidebar')), Box({ width: 1, height: '100%' }, Text({ color: 'gray' }, '│')), Box({ flexGrow: 1, height: '100%', flexDirection: 'column' }, Box({ height: 9, width: '100%', backgroundColor: 'green', padding: 1 }, Text({ color: 'white' }, 'Main Content')), Box({ width: '100%' }, Text({ color: 'gray' }, '─'.repeat(40))), Box({ height: 3, width: '100%', backgroundColor: 'magenta', padding: 1 }, Text({ color: 'white' }, 'Footer'))))),
|
|
80
|
+
];
|
|
81
|
+
export const gridStories = [
|
|
82
|
+
story('Grid - Basic')
|
|
83
|
+
.category('Organisms')
|
|
84
|
+
.description('Basic grid layout')
|
|
85
|
+
.controls({
|
|
86
|
+
columns: defaultControls.range('Columns', 3, 1, 6),
|
|
87
|
+
gap: defaultControls.range('Gap', 1, 0, 3),
|
|
88
|
+
})
|
|
89
|
+
.render((props) => {
|
|
90
|
+
const cellWidth = Math.floor((50 - (props.columns - 1) * props.gap) / props.columns);
|
|
91
|
+
const cells = Array.from({ length: 9 }, (_, i) => i + 1);
|
|
92
|
+
const colors = ['blue', 'green', 'magenta'];
|
|
93
|
+
return Box({ flexDirection: 'column', gap: props.gap, width: 50 }, ...Array.from({ length: Math.ceil(cells.length / props.columns) }, (_, rowIdx) => Box({ flexDirection: 'row', gap: props.gap }, ...cells
|
|
94
|
+
.slice(rowIdx * props.columns, (rowIdx + 1) * props.columns)
|
|
95
|
+
.map((cell, colIdx) => Box({
|
|
96
|
+
width: cellWidth,
|
|
97
|
+
backgroundColor: colors[(rowIdx * props.columns + colIdx) % 3],
|
|
98
|
+
padding: 1,
|
|
99
|
+
}, Text({ color: 'white' }, `Cell ${cell}`))))));
|
|
100
|
+
}),
|
|
101
|
+
story('Grid - Dashboard Layout')
|
|
102
|
+
.category('Organisms')
|
|
103
|
+
.description('Dashboard-style grid layout')
|
|
104
|
+
.render(() => Box({ flexDirection: 'column', gap: 1, width: 60 }, Box({ flexDirection: 'row', gap: 1 }, Box({ backgroundColor: 'blue', padding: 1, flexGrow: 1 }, Text({ color: 'white', bold: true }, 'Users: 1.2k')), Box({ backgroundColor: 'green', padding: 1, flexGrow: 1 }, Text({ color: 'white', bold: true }, 'Revenue: $45k')), Box({ backgroundColor: 'magenta', padding: 1, flexGrow: 1 }, Text({ color: 'white', bold: true }, 'Orders: 892'))), Box({ flexDirection: 'row', gap: 1 }, Box({ backgroundColor: 'gray', padding: 1, width: 38 }, Text({ color: 'white' }, 'Chart Area\n▂▃▅▇█▇▅▃▂▃▅▇')), Box({ backgroundColor: 'cyan', padding: 1, flexGrow: 1 }, Text({ color: 'white' }, 'Activity\n• New user\n• Sale\n• Comment'))))),
|
|
105
|
+
];
|
|
106
|
+
export const stackStories = [
|
|
107
|
+
story('VStack - Basic')
|
|
108
|
+
.category('Organisms')
|
|
109
|
+
.description('Vertical stack layout')
|
|
110
|
+
.controls({
|
|
111
|
+
gap: defaultControls.range('Gap', 1, 0, 5),
|
|
112
|
+
})
|
|
113
|
+
.render((props) => Box({ flexDirection: 'column', gap: props.gap }, Box({ backgroundColor: 'blue', padding: 1 }, Text({ color: 'white' }, 'Item 1')), Box({ backgroundColor: 'green', padding: 1 }, Text({ color: 'white' }, 'Item 2')), Box({ backgroundColor: 'magenta', padding: 1 }, Text({ color: 'white' }, 'Item 3')))),
|
|
114
|
+
story('HStack - Basic')
|
|
115
|
+
.category('Organisms')
|
|
116
|
+
.description('Horizontal stack layout')
|
|
117
|
+
.controls({
|
|
118
|
+
gap: defaultControls.range('Gap', 2, 0, 5),
|
|
119
|
+
justify: defaultControls.select('Justify', ['flex-start', 'center', 'flex-end', 'space-between'], 'flex-start'),
|
|
120
|
+
})
|
|
121
|
+
.render((props) => Box({ flexDirection: 'row', gap: props.gap, justifyContent: props.justify, width: 50 }, Box({ backgroundColor: 'blue', padding: 1 }, Text({ color: 'white' }, 'A')), Box({ backgroundColor: 'green', padding: 1 }, Text({ color: 'white' }, 'B')), Box({ backgroundColor: 'magenta', padding: 1 }, Text({ color: 'white' }, 'C')))),
|
|
122
|
+
story('Stack - Nested')
|
|
123
|
+
.category('Organisms')
|
|
124
|
+
.description('Nested stacks for complex layouts')
|
|
125
|
+
.render(() => Box({ flexDirection: 'column', gap: 1 }, Box({ flexDirection: 'row', gap: 2, justifyContent: 'space-between', width: 50 }, Text({ color: 'cyan', bold: true }, 'App Title'), Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'gray' }, 'Home'), Text({ color: 'gray' }, 'About'), Text({ color: 'gray' }, 'Contact'))), Divider({}), Box({ flexDirection: 'row', gap: 2 }, Box({ flexDirection: 'column', gap: 1, width: 15 }, Text({ color: 'cyan' }, '> Dashboard'), Text({ color: 'gray' }, ' Users'), Text({ color: 'gray' }, ' Settings')), Box({ flexDirection: 'column', gap: 1 }, Text({ bold: true }, 'Dashboard'), Text({ color: 'gray' }, 'Welcome to your dashboard.'))))),
|
|
126
|
+
];
|
|
127
|
+
export const layoutPatternStories = [
|
|
128
|
+
story('Layout - Holy Grail')
|
|
129
|
+
.category('Organisms')
|
|
130
|
+
.description('Classic header-sidebar-main-footer layout')
|
|
131
|
+
.render(() => Box({ flexDirection: 'column', width: 60, height: 15 }, Box({ backgroundColor: 'blue', paddingX: 1, width: '100%' }, Text({ color: 'white', bold: true }, 'Header')), Box({ flexDirection: 'row', flexGrow: 1 }, Box({ backgroundColor: 'green', width: 12, padding: 1 }, Text({ color: 'white' }, 'Sidebar')), Box({ flexGrow: 1, padding: 1 }, Text({}, 'Main Content Area')), Box({ backgroundColor: 'magenta', width: 12, padding: 1 }, Text({ color: 'white' }, 'Aside'))), Box({ backgroundColor: 'cyan', paddingX: 1, width: '100%' }, Text({ color: 'white' }, 'Footer')))),
|
|
132
|
+
story('Layout - Sidebar Toggle')
|
|
133
|
+
.category('Organisms')
|
|
134
|
+
.description('Layout with collapsible sidebar')
|
|
135
|
+
.controls({
|
|
136
|
+
sidebarOpen: defaultControls.boolean('Sidebar Open', true),
|
|
137
|
+
})
|
|
138
|
+
.render((props) => Box({ flexDirection: 'row', width: 60, height: 12 }, props.sidebarOpen
|
|
139
|
+
? Box({
|
|
140
|
+
backgroundColor: 'blue',
|
|
141
|
+
width: 20,
|
|
142
|
+
padding: 1,
|
|
143
|
+
flexDirection: 'column',
|
|
144
|
+
}, Text({ color: 'white', bold: true }, 'Navigation'), Text({ color: 'cyan' }, '> Home'), Text({ color: 'gray' }, ' Files'), Text({ color: 'gray' }, ' Settings'))
|
|
145
|
+
: null, Box({ flexGrow: 1, padding: 1, flexDirection: 'column' }, Text({ bold: true }, 'Content'), Text({ color: 'gray' }, props.sidebarOpen ? 'Sidebar is open' : 'Sidebar is closed'), Box({ marginTop: 1 }, Text({ color: 'gray', dim: true }, '[Toggle sidebar with control]'))))),
|
|
146
|
+
story('Layout - Card Grid')
|
|
147
|
+
.category('Organisms')
|
|
148
|
+
.description('Responsive card grid layout')
|
|
149
|
+
.render(() => Box({ flexDirection: 'row', flexWrap: 'wrap', gap: 1, width: 60 }, ...Array.from({ length: 6 }, (_, i) => Box({
|
|
150
|
+
width: 18,
|
|
151
|
+
borderStyle: 'round',
|
|
152
|
+
borderColor: ['cyan', 'green', 'magenta', 'yellow', 'blue', 'red'][i],
|
|
153
|
+
padding: 1,
|
|
154
|
+
flexDirection: 'column',
|
|
155
|
+
}, Text({ bold: true }, `Card ${i + 1}`), Text({ color: 'gray', dim: true }, 'Card content...'))))),
|
|
156
|
+
];
|
|
157
|
+
// ============================================================================
|
|
158
|
+
// Complex Charts
|
|
159
|
+
// ============================================================================
|
|
160
|
+
export const barChartStories = [
|
|
161
|
+
story('BarChart - Horizontal')
|
|
162
|
+
.category('Organisms')
|
|
163
|
+
.description('Horizontal bar chart')
|
|
164
|
+
.controls({
|
|
165
|
+
width: defaultControls.range('Width', 20, 10, 40),
|
|
166
|
+
})
|
|
167
|
+
.render((props) => {
|
|
168
|
+
const data = [
|
|
169
|
+
{ label: 'JavaScript', value: 85 },
|
|
170
|
+
{ label: 'Python', value: 72 },
|
|
171
|
+
{ label: 'TypeScript', value: 68 },
|
|
172
|
+
{ label: 'Rust', value: 45 },
|
|
173
|
+
{ label: 'Go', value: 38 },
|
|
174
|
+
];
|
|
175
|
+
const max = Math.max(...data.map((d) => d.value));
|
|
176
|
+
return Box({ flexDirection: 'column', gap: 1 }, ...data.map((item) => Box({ flexDirection: 'row', gap: 1 }, Box({ width: 12 }, Text({ color: 'gray' }, item.label)), Text({ color: 'cyan' }, textBar(item.value, max, props.width)), Text({ color: 'gray', dim: true }, ` ${item.value}%`))));
|
|
177
|
+
}),
|
|
178
|
+
story('BarChart - Colored')
|
|
179
|
+
.category('Organisms')
|
|
180
|
+
.description('Bar chart with colors')
|
|
181
|
+
.render(() => {
|
|
182
|
+
const data = [
|
|
183
|
+
{ label: 'Success', value: 85, color: 'green' },
|
|
184
|
+
{ label: 'Warning', value: 45, color: 'yellow' },
|
|
185
|
+
{ label: 'Error', value: 12, color: 'red' },
|
|
186
|
+
{ label: 'Info', value: 30, color: 'cyan' },
|
|
187
|
+
];
|
|
188
|
+
const max = 100;
|
|
189
|
+
return Box({ flexDirection: 'column', gap: 1 }, ...data.map((item) => Box({ flexDirection: 'row', gap: 1 }, Box({ width: 10 }, Text({ color: 'gray' }, item.label)), Text({ color: item.color }, textBar(item.value, max, 25)), Text({ color: item.color }, ` ${item.value}%`))));
|
|
190
|
+
}),
|
|
191
|
+
story('BarChart - Stacked')
|
|
192
|
+
.category('Organisms')
|
|
193
|
+
.description('Stacked bar chart representation')
|
|
194
|
+
.render(() => Box({ flexDirection: 'column', gap: 1 }, Box({ flexDirection: 'row', gap: 1 }, Box({ width: 6 }, Text({ color: 'gray' }, 'Q1:')), Text({ backgroundColor: 'blue', color: 'white' }, '████████'), Text({ backgroundColor: 'green', color: 'white' }, '████'), Text({ backgroundColor: 'yellow', color: 'black' }, '██')), Box({ flexDirection: 'row', gap: 1 }, Box({ width: 6 }, Text({ color: 'gray' }, 'Q2:')), Text({ backgroundColor: 'blue', color: 'white' }, '██████████'), Text({ backgroundColor: 'green', color: 'white' }, '██████'), Text({ backgroundColor: 'yellow', color: 'black' }, '███')), Box({ flexDirection: 'row', gap: 1 }, Box({ width: 6 }, Text({ color: 'gray' }, 'Q3:')), Text({ backgroundColor: 'blue', color: 'white' }, '████████████'), Text({ backgroundColor: 'green', color: 'white' }, '████████'), Text({ backgroundColor: 'yellow', color: 'black' }, '████')), Box({ marginTop: 1, flexDirection: 'row', gap: 2 }, Box({}, Text({ color: 'blue' }, '■'), Text({ color: 'gray' }, ' Sales')), Box({}, Text({ color: 'green' }, '■'), Text({ color: 'gray' }, ' Marketing')), Box({}, Text({ color: 'yellow' }, '■'), Text({ color: 'gray' }, ' Support'))))),
|
|
195
|
+
];
|
|
196
|
+
export const heatmapStories = [
|
|
197
|
+
story('Heatmap - Basic')
|
|
198
|
+
.category('Organisms')
|
|
199
|
+
.description('Color-coded data grid')
|
|
200
|
+
.render(() => {
|
|
201
|
+
const data = [
|
|
202
|
+
[1, 3, 5, 7, 9],
|
|
203
|
+
[2, 4, 6, 8, 10],
|
|
204
|
+
[3, 5, 7, 9, 11],
|
|
205
|
+
[4, 6, 8, 10, 12],
|
|
206
|
+
];
|
|
207
|
+
const getColor = (value) => {
|
|
208
|
+
if (value > 9)
|
|
209
|
+
return 'red';
|
|
210
|
+
if (value > 6)
|
|
211
|
+
return 'yellow';
|
|
212
|
+
if (value > 3)
|
|
213
|
+
return 'green';
|
|
214
|
+
return 'cyan';
|
|
215
|
+
};
|
|
216
|
+
return Box({ flexDirection: 'column' }, ...data.map((row) => Box({ flexDirection: 'row' }, ...row.map((value) => Text({ backgroundColor: getColor(value), color: 'white' }, ` ${value.toString().padStart(2)} `)))));
|
|
217
|
+
}),
|
|
218
|
+
story('Heatmap - Activity Grid')
|
|
219
|
+
.category('Organisms')
|
|
220
|
+
.description('GitHub-style activity heatmap')
|
|
221
|
+
.render(() => {
|
|
222
|
+
const blocks = ['░', '▒', '▓', '█'];
|
|
223
|
+
const colors = ['gray', 'green', 'greenBright', 'greenBright'];
|
|
224
|
+
const days = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
|
|
225
|
+
const weeks = 5;
|
|
226
|
+
const getRandomIntensity = () => Math.floor(Math.random() * 4);
|
|
227
|
+
return Box({ flexDirection: 'column' }, Box({ marginBottom: 1 }, Text({ color: 'gray' }, 'Activity (last 5 weeks)')), ...days.map((day) => Box({ flexDirection: 'row' }, Box({ width: 4 }, Text({ color: 'gray' }, day)), ...Array.from({ length: weeks }, () => {
|
|
228
|
+
const intensity = getRandomIntensity();
|
|
229
|
+
return Text({ color: colors[intensity] }, blocks[intensity] + ' ');
|
|
230
|
+
}))), Box({ marginTop: 1, flexDirection: 'row', gap: 1 }, Text({ color: 'gray', dim: true }, 'Less'), Text({ color: 'gray' }, '░'), Text({ color: 'green' }, '▒'), Text({ color: 'greenBright' }, '▓'), Text({ color: 'greenBright' }, '█'), Text({ color: 'gray', dim: true }, 'More')));
|
|
231
|
+
}),
|
|
232
|
+
];
|
|
233
|
+
// ============================================================================
|
|
234
|
+
// UI Patterns
|
|
235
|
+
// ============================================================================
|
|
236
|
+
export const dashboardStories = [
|
|
237
|
+
story('Pattern - Stats Cards')
|
|
238
|
+
.category('Organisms')
|
|
239
|
+
.description('Dashboard stats cards layout')
|
|
240
|
+
.render(() => Box({ flexDirection: 'row', gap: 2 }, Box({
|
|
241
|
+
borderStyle: 'round',
|
|
242
|
+
borderColor: 'cyan',
|
|
243
|
+
padding: 1,
|
|
244
|
+
width: 18,
|
|
245
|
+
}, Box({ flexDirection: 'column' }, Text({ color: 'gray', dim: true }, 'Total Users'), Text({ color: 'cyan', bold: true }, '12,543'), Text({ color: 'green', dim: true }, '↑ 12.5%'))), Box({
|
|
246
|
+
borderStyle: 'round',
|
|
247
|
+
borderColor: 'green',
|
|
248
|
+
padding: 1,
|
|
249
|
+
width: 18,
|
|
250
|
+
}, Box({ flexDirection: 'column' }, Text({ color: 'gray', dim: true }, 'Revenue'), Text({ color: 'green', bold: true }, '$45,231'), Text({ color: 'green', dim: true }, '↑ 8.2%'))), Box({
|
|
251
|
+
borderStyle: 'round',
|
|
252
|
+
borderColor: 'yellow',
|
|
253
|
+
padding: 1,
|
|
254
|
+
width: 18,
|
|
255
|
+
}, Box({ flexDirection: 'column' }, Text({ color: 'gray', dim: true }, 'Orders'), Text({ color: 'yellow', bold: true }, '892'), Text({ color: 'red', dim: true }, '↓ 3.1%'))))),
|
|
256
|
+
story('Pattern - Table')
|
|
257
|
+
.category('Organisms')
|
|
258
|
+
.description('Data table pattern')
|
|
259
|
+
.render(() => Box({
|
|
260
|
+
flexDirection: 'column',
|
|
261
|
+
borderStyle: 'single',
|
|
262
|
+
borderColor: 'gray',
|
|
263
|
+
width: 60,
|
|
264
|
+
}, Box({ flexDirection: 'row', backgroundColor: 'blue', paddingX: 1 }, Box({ width: 20 }, Text({ color: 'white', bold: true }, 'Name')), Box({ width: 15 }, Text({ color: 'white', bold: true }, 'Status')), Box({ width: 10 }, Text({ color: 'white', bold: true }, 'Role')), Text({ color: 'white', bold: true }, 'Actions')), Box({ flexDirection: 'row', paddingX: 1 }, Box({ width: 20 }, Text({}, 'Alice Johnson')), Box({ width: 15 }, Text({ color: 'green' }, '● Active')), Box({ width: 10 }, Text({}, 'Admin')), Text({ color: 'cyan' }, 'Edit | Del')), Box({ flexDirection: 'row', paddingX: 1, backgroundColor: 'gray' }, Box({ width: 20 }, Text({}, 'Bob Smith')), Box({ width: 15 }, Text({ color: 'green' }, '● Active')), Box({ width: 10 }, Text({}, 'User')), Text({ color: 'cyan' }, 'Edit | Del')), Box({ flexDirection: 'row', paddingX: 1 }, Box({ width: 20 }, Text({}, 'Carol White')), Box({ width: 15 }, Text({ color: 'yellow' }, '○ Pending')), Box({ width: 10 }, Text({}, 'User')), Text({ color: 'cyan' }, 'Edit | Del')), Box({ flexDirection: 'row', paddingX: 1, backgroundColor: 'gray' }, Box({ width: 20 }, Text({}, 'David Brown')), Box({ width: 15 }, Text({ color: 'red' }, '○ Inactive')), Box({ width: 10 }, Text({}, 'User')), Text({ color: 'cyan' }, 'Edit | Del')))),
|
|
265
|
+
story('Pattern - Activity Feed')
|
|
266
|
+
.category('Organisms')
|
|
267
|
+
.description('Activity feed pattern')
|
|
268
|
+
.render(() => Box({
|
|
269
|
+
flexDirection: 'column',
|
|
270
|
+
borderStyle: 'single',
|
|
271
|
+
borderColor: 'gray',
|
|
272
|
+
padding: 1,
|
|
273
|
+
width: 45,
|
|
274
|
+
}, Text({ color: 'white', bold: true }, 'Recent Activity'), Box({ marginTop: 1 }), Box({ flexDirection: 'row', gap: 1, marginBottom: 1 }, Text({ color: 'cyan' }, '●'), Box({ flexDirection: 'column' }, Text({}, 'Alice uploaded a file'), Text({ color: 'gray', dim: true }, '2 minutes ago'))), Box({ flexDirection: 'row', gap: 1, marginBottom: 1 }, Text({ color: 'green' }, '●'), Box({ flexDirection: 'column' }, Text({}, 'Bob completed a task'), Text({ color: 'gray', dim: true }, '15 minutes ago'))), Box({ flexDirection: 'row', gap: 1, marginBottom: 1 }, Text({ color: 'yellow' }, '●'), Box({ flexDirection: 'column' }, Text({}, 'Carol added a comment'), Text({ color: 'gray', dim: true }, '1 hour ago'))), Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'magenta' }, '●'), Box({ flexDirection: 'column' }, Text({}, 'David joined the team'), Text({ color: 'gray', dim: true }, '3 hours ago'))))),
|
|
275
|
+
];
|
|
276
|
+
export const fileBrowserStories = [
|
|
277
|
+
story('Pattern - File Tree')
|
|
278
|
+
.category('Organisms')
|
|
279
|
+
.description('File tree navigation pattern')
|
|
280
|
+
.render(() => Box({
|
|
281
|
+
flexDirection: 'column',
|
|
282
|
+
borderStyle: 'single',
|
|
283
|
+
borderColor: 'gray',
|
|
284
|
+
padding: 1,
|
|
285
|
+
width: 40,
|
|
286
|
+
}, Text({ color: 'white', bold: true }, 'Files'), Box({ marginTop: 1 }), Text({ color: 'yellow' }, '▼ 📁 src'), Text({ color: 'gray' }, ' ▼ 📁 components'), Text({ color: 'cyan' }, ' ▶ 📁 ui'), Text({}, ' 📄 button.ts'), Text({ inverse: true }, ' 📄 input.ts'), Text({}, ' 📄 modal.ts'), Text({ color: 'cyan' }, ' ▶ 📁 layout'), Text({ color: 'gray' }, ' ▼ 📁 utils'), Text({}, ' 📄 helpers.ts'), Text({ color: 'cyan' }, '▶ 📁 tests'), Text({}, '📄 package.json'), Text({}, '📄 README.md'))),
|
|
287
|
+
story('Pattern - File Preview')
|
|
288
|
+
.category('Organisms')
|
|
289
|
+
.description('File browser with preview pane')
|
|
290
|
+
.render(() => Box({ flexDirection: 'row', width: 70, height: 15 }, Box({
|
|
291
|
+
width: 25,
|
|
292
|
+
borderStyle: 'single',
|
|
293
|
+
borderColor: 'gray',
|
|
294
|
+
flexDirection: 'column',
|
|
295
|
+
}, Box({ paddingX: 1, backgroundColor: 'blue' }, Text({ color: 'white', bold: true }, 'Files')), Box({ padding: 1, flexDirection: 'column' }, Text({ color: 'yellow' }, '📁 src'), Text({ color: 'yellow' }, '📁 tests'), Text({ inverse: true }, '📄 package.json'), Text({}, '📄 README.md'), Text({}, '📄 tsconfig.json'))), Box({
|
|
296
|
+
flexGrow: 1,
|
|
297
|
+
borderStyle: 'single',
|
|
298
|
+
borderColor: 'cyan',
|
|
299
|
+
flexDirection: 'column',
|
|
300
|
+
}, Box({ paddingX: 1, backgroundColor: 'cyan' }, Text({ color: 'white', bold: true }, 'package.json')), Box({ padding: 1, flexDirection: 'column' }, Text({ color: 'gray' }, '{'), Box({ flexDirection: 'row' }, Text({ color: 'cyan' }, ' "name": '), Text({ color: 'green' }, '"tuiuiu"')), Box({ flexDirection: 'row' }, Text({ color: 'cyan' }, ' "version": '), Text({ color: 'green' }, '"0.1.0"')), Box({ flexDirection: 'row' }, Text({ color: 'cyan' }, ' "type": '), Text({ color: 'green' }, '"module"')), Text({ color: 'gray' }, ' ...'))))),
|
|
301
|
+
story('Pattern - Breadcrumbs')
|
|
302
|
+
.category('Organisms')
|
|
303
|
+
.description('Breadcrumb navigation pattern')
|
|
304
|
+
.render(() => Box({ flexDirection: 'column', gap: 2 }, Box({ flexDirection: 'row' }, Text({ color: 'cyan' }, 'Home'), Text({ color: 'gray' }, ' > '), Text({ color: 'cyan' }, 'Documents'), Text({ color: 'gray' }, ' > '), Text({ color: 'cyan' }, 'Projects'), Text({ color: 'gray' }, ' > '), Text({ color: 'white', bold: true }, 'Report.pdf')), Box({ flexDirection: 'row' }, Text({ color: 'cyan' }, '🏠'), Text({ color: 'gray' }, ' / '), Text({ color: 'cyan' }, '📁 src'), Text({ color: 'gray' }, ' / '), Text({ color: 'cyan' }, '📁 components'), Text({ color: 'gray' }, ' / '), Text({ color: 'white', bold: true }, '📄 button.ts')))),
|
|
305
|
+
];
|
|
306
|
+
export const chatStories = [
|
|
307
|
+
story('Pattern - Chat Messages')
|
|
308
|
+
.category('Organisms')
|
|
309
|
+
.description('Chat message list pattern')
|
|
310
|
+
.render(() => Box({
|
|
311
|
+
flexDirection: 'column',
|
|
312
|
+
borderStyle: 'single',
|
|
313
|
+
borderColor: 'gray',
|
|
314
|
+
padding: 1,
|
|
315
|
+
width: 50,
|
|
316
|
+
}, Box({ flexDirection: 'column', marginBottom: 1 }, Text({ color: 'cyan', bold: true }, 'Alice'), Box({
|
|
317
|
+
borderStyle: 'round',
|
|
318
|
+
borderColor: 'gray',
|
|
319
|
+
paddingX: 1,
|
|
320
|
+
marginLeft: 2,
|
|
321
|
+
}, Text({}, 'Hey, how are you?')), Text({ color: 'gray', dim: true }, ' 10:30 AM')), Box({ flexDirection: 'column', alignItems: 'flex-end', marginBottom: 1 }, Text({ color: 'green', bold: true }, 'You'), Box({
|
|
322
|
+
borderStyle: 'round',
|
|
323
|
+
borderColor: 'green',
|
|
324
|
+
paddingX: 1,
|
|
325
|
+
marginRight: 2,
|
|
326
|
+
}, Text({}, "I'm good, thanks! Working on the TUI.")), Text({ color: 'gray', dim: true }, '10:32 AM ')), Box({ flexDirection: 'column' }, Text({ color: 'cyan', bold: true }, 'Alice'), Box({
|
|
327
|
+
borderStyle: 'round',
|
|
328
|
+
borderColor: 'gray',
|
|
329
|
+
paddingX: 1,
|
|
330
|
+
marginLeft: 2,
|
|
331
|
+
}, Text({}, "That sounds interesting! Can't wait to see it.")), Text({ color: 'gray', dim: true }, ' 10:33 AM')))),
|
|
332
|
+
story('Pattern - Chat Input')
|
|
333
|
+
.category('Organisms')
|
|
334
|
+
.description('Chat input with actions')
|
|
335
|
+
.render(() => Box({
|
|
336
|
+
flexDirection: 'row',
|
|
337
|
+
borderStyle: 'single',
|
|
338
|
+
borderColor: 'cyan',
|
|
339
|
+
padding: 1,
|
|
340
|
+
width: 50,
|
|
341
|
+
gap: 1,
|
|
342
|
+
}, Text({ color: 'gray' }, '📎'), Box({ flexGrow: 1 }, Text({ color: 'gray', dim: true }, 'Type a message...')), Text({ color: 'gray' }, '😊'), Text({ color: 'cyan' }, '➤'))),
|
|
343
|
+
story('Pattern - Typing Indicator')
|
|
344
|
+
.category('Organisms')
|
|
345
|
+
.description('Typing indicator pattern')
|
|
346
|
+
.render(() => Box({ flexDirection: 'column', gap: 1 }, Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'gray', dim: true }, 'Alice is typing'), Text({ color: 'gray' }, '...')), Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'cyan' }, '●'), Text({ color: 'cyan', dim: true }, '●'), Text({ color: 'gray', dim: true }, '●')))),
|
|
347
|
+
];
|
|
348
|
+
export const commandPaletteStories = [
|
|
349
|
+
story('Pattern - Command Palette')
|
|
350
|
+
.category('Organisms')
|
|
351
|
+
.description('Command palette pattern')
|
|
352
|
+
.render(() => Box({
|
|
353
|
+
flexDirection: 'column',
|
|
354
|
+
borderStyle: 'round',
|
|
355
|
+
borderColor: 'cyan',
|
|
356
|
+
width: 50,
|
|
357
|
+
}, Box({
|
|
358
|
+
paddingX: 1,
|
|
359
|
+
paddingY: 1,
|
|
360
|
+
borderStyle: 'single',
|
|
361
|
+
borderColor: 'gray',
|
|
362
|
+
}, Text({ color: 'gray' }, '> '), Text({ color: 'white' }, 'open file'), Text({ color: 'gray', dim: true }, '...')), Box({ flexDirection: 'column', padding: 1 }, Box({ backgroundColor: 'blue', paddingX: 1, flexDirection: 'row' }, Text({ color: 'white' }, '📄 Open File'), Spacer({}), Text({ color: 'gray' }, 'Ctrl+O')), Box({ paddingX: 1, flexDirection: 'row' }, Text({}, '📁 Open Folder'), Spacer({}), Text({ color: 'gray' }, 'Ctrl+K O')), Box({ paddingX: 1, flexDirection: 'row' }, Text({}, '📝 Open Recent'), Spacer({}), Text({ color: 'gray' }, 'Ctrl+R')), Box({ paddingX: 1, flexDirection: 'row' }, Text({}, '🔍 Open in Explorer'), Spacer({}), Text({ color: 'gray' }, 'Ctrl+Shift+E'))), Box({ paddingX: 1, borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'gray', dim: true }, '↑↓ Navigate '), Text({ color: 'gray', dim: true }, '↵ Select '), Text({ color: 'gray', dim: true }, 'Esc Close')))),
|
|
363
|
+
story('Pattern - Quick Actions')
|
|
364
|
+
.category('Organisms')
|
|
365
|
+
.description('Quick action menu pattern')
|
|
366
|
+
.render(() => Box({
|
|
367
|
+
flexDirection: 'column',
|
|
368
|
+
borderStyle: 'single',
|
|
369
|
+
borderColor: 'gray',
|
|
370
|
+
width: 35,
|
|
371
|
+
}, Box({ paddingX: 1, backgroundColor: 'blue' }, Text({ color: 'white', bold: true }, 'Quick Actions')), Box({ flexDirection: 'column', padding: 1 }, Box({ flexDirection: 'row' }, Text({ color: 'cyan' }, '[N] '), Text({}, 'New File')), Box({ flexDirection: 'row' }, Text({ color: 'cyan' }, '[S] '), Text({}, 'Save')), Box({ flexDirection: 'row' }, Text({ color: 'cyan' }, '[F] '), Text({}, 'Find')), Box({ flexDirection: 'row' }, Text({ color: 'cyan' }, '[R] '), Text({}, 'Replace')), Divider({}), Box({ flexDirection: 'row' }, Text({ color: 'cyan' }, '[Q] '), Text({ color: 'gray' }, 'Quit'))))),
|
|
372
|
+
];
|
|
373
|
+
export const navigationStories = [
|
|
374
|
+
story('Pattern - Sidebar Nav')
|
|
375
|
+
.category('Organisms')
|
|
376
|
+
.description('Sidebar navigation pattern')
|
|
377
|
+
.render(() => Box({
|
|
378
|
+
flexDirection: 'column',
|
|
379
|
+
borderStyle: 'single',
|
|
380
|
+
borderColor: 'gray',
|
|
381
|
+
width: 25,
|
|
382
|
+
height: 15,
|
|
383
|
+
}, Box({ paddingX: 1, backgroundColor: 'blue' }, Text({ color: 'white', bold: true }, '🚀 AppName')), Box({ flexDirection: 'column', padding: 1, flexGrow: 1 }, Box({ backgroundColor: 'cyan', paddingX: 1 }, Text({ color: 'white' }, '🏠 Dashboard')), Box({ paddingX: 1 }, Text({ color: 'gray' }, '📊 Analytics')), Box({ paddingX: 1 }, Text({ color: 'gray' }, '👥 Users')), Box({ paddingX: 1 }, Text({ color: 'gray' }, '📁 Files')), Box({ paddingX: 1 }, Text({ color: 'gray' }, '⚙️ Settings')), Spacer({})), Box({ paddingX: 1, borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'gray', dim: true }, '? Help')))),
|
|
384
|
+
story('Pattern - Tab Bar')
|
|
385
|
+
.category('Organisms')
|
|
386
|
+
.description('Tab bar navigation pattern')
|
|
387
|
+
.render(() => Box({ flexDirection: 'column', width: 50 }, Box({ flexDirection: 'row', borderStyle: 'single', borderColor: 'gray' }, Box({ backgroundColor: 'blue', paddingX: 2 }, Text({ color: 'white', bold: true }, 'Overview')), Box({ paddingX: 2 }, Text({ color: 'gray' }, 'Details')), Box({ paddingX: 2 }, Text({ color: 'gray' }, 'Settings')), Box({ paddingX: 2 }, Text({ color: 'gray' }, 'Logs'))), Box({
|
|
388
|
+
borderStyle: 'single',
|
|
389
|
+
borderColor: 'blue',
|
|
390
|
+
padding: 1,
|
|
391
|
+
height: 8,
|
|
392
|
+
}, Text({}, 'Overview content goes here...')))),
|
|
393
|
+
story('Pattern - Pagination')
|
|
394
|
+
.category('Organisms')
|
|
395
|
+
.description('Pagination controls pattern')
|
|
396
|
+
.render(() => Box({ flexDirection: 'row', gap: 1, justifyContent: 'center', width: 50 }, Text({ color: 'gray' }, '« First'), Text({ color: 'cyan' }, '‹ Prev'), Text({ color: 'gray' }, '1'), Text({ color: 'white', inverse: true }, ' 2 '), Text({ color: 'gray' }, '3'), Text({ color: 'gray' }, '4'), Text({ color: 'gray' }, '...'), Text({ color: 'gray' }, '10'), Text({ color: 'cyan' }, 'Next ›'), Text({ color: 'gray' }, 'Last »'))),
|
|
397
|
+
];
|
|
398
|
+
/**
|
|
399
|
+
* Overlay stories - Modal, Popup, Tooltip, Toast
|
|
400
|
+
*/
|
|
401
|
+
const overlayStories = [
|
|
402
|
+
story('Modal - Basic')
|
|
403
|
+
.category('Organisms')
|
|
404
|
+
.description('Basic modal dialog')
|
|
405
|
+
.controls({
|
|
406
|
+
title: defaultControls.text('Title', 'Confirm Action'),
|
|
407
|
+
showClose: defaultControls.boolean('Show Close', true),
|
|
408
|
+
})
|
|
409
|
+
.render((props) => Box({ flexDirection: 'column', width: 50, height: 15 },
|
|
410
|
+
// Backdrop simulation
|
|
411
|
+
Box({
|
|
412
|
+
flexGrow: 1,
|
|
413
|
+
backgroundColor: 'gray',
|
|
414
|
+
justifyContent: 'center',
|
|
415
|
+
alignItems: 'center',
|
|
416
|
+
},
|
|
417
|
+
// Modal window
|
|
418
|
+
Box({
|
|
419
|
+
flexDirection: 'column',
|
|
420
|
+
width: 40,
|
|
421
|
+
borderStyle: 'double',
|
|
422
|
+
borderColor: 'cyan',
|
|
423
|
+
backgroundColor: 'black',
|
|
424
|
+
},
|
|
425
|
+
// Header
|
|
426
|
+
Box({ paddingX: 1, justifyContent: 'space-between', borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'cyan', bold: true }, props.title), props.showClose && Text({ color: 'gray' }, '[×]')),
|
|
427
|
+
// Body
|
|
428
|
+
Box({ padding: 1, flexGrow: 1 }, Text({}, 'Are you sure you want to proceed with this action?')),
|
|
429
|
+
// Footer
|
|
430
|
+
Box({ paddingX: 1, paddingY: 1, gap: 2, justifyContent: 'flex-end', borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'gray', inverse: true }, ' Cancel '), Text({ color: 'cyan', inverse: true }, ' Confirm ')))))),
|
|
431
|
+
story('Modal - Alert')
|
|
432
|
+
.category('Organisms')
|
|
433
|
+
.description('Alert modal with icon')
|
|
434
|
+
.controls({
|
|
435
|
+
type: defaultControls.select('Type', ['info', 'warning', 'error', 'success'], 'warning'),
|
|
436
|
+
})
|
|
437
|
+
.render((props) => {
|
|
438
|
+
const alertType = props.type || 'warning';
|
|
439
|
+
const icons = { info: 'ℹ', warning: '⚠', error: '✗', success: '✓' };
|
|
440
|
+
const colors = { info: 'cyan', warning: 'yellow', error: 'red', success: 'green' };
|
|
441
|
+
const icon = icons[alertType] || '⚠';
|
|
442
|
+
const color = colors[alertType] || 'yellow';
|
|
443
|
+
return Box({
|
|
444
|
+
flexDirection: 'column',
|
|
445
|
+
width: 45,
|
|
446
|
+
borderStyle: 'double',
|
|
447
|
+
borderColor: color,
|
|
448
|
+
}, Box({ padding: 1, alignItems: 'center', gap: 1 }, Text({ color: color, bold: true }, icon), Text({ color: color, bold: true }, String(alertType).toUpperCase())), Box({ paddingX: 1, paddingBottom: 1 }, Text({}, 'This is an important message that requires your attention.')), Box({ paddingX: 1, paddingBottom: 1, justifyContent: 'center' }, Text({ color: color, inverse: true }, ' OK ')));
|
|
449
|
+
}),
|
|
450
|
+
story('Tooltip - Basic')
|
|
451
|
+
.category('Organisms')
|
|
452
|
+
.description('Tooltip on hover/focus')
|
|
453
|
+
.controls({
|
|
454
|
+
position: defaultControls.select('Position', ['top', 'bottom', 'left', 'right'], 'top'),
|
|
455
|
+
})
|
|
456
|
+
.render((props) => {
|
|
457
|
+
const renderTooltip = () => Box({
|
|
458
|
+
borderStyle: 'single',
|
|
459
|
+
borderColor: 'yellow',
|
|
460
|
+
backgroundColor: 'yellow',
|
|
461
|
+
paddingX: 1,
|
|
462
|
+
}, Text({ color: 'black' }, 'Helpful tooltip text'));
|
|
463
|
+
return Box({ flexDirection: 'column', alignItems: 'center', gap: 1, padding: 2 }, props.position === 'top' && renderTooltip(), Box({ flexDirection: 'row', gap: 1 }, props.position === 'left' && renderTooltip(), Box({ borderStyle: 'single', borderColor: 'cyan', paddingX: 2, paddingY: 1 }, Text({ color: 'cyan' }, 'Hover me')), props.position === 'right' && renderTooltip()), props.position === 'bottom' && renderTooltip());
|
|
464
|
+
}),
|
|
465
|
+
story('Toast - Notification')
|
|
466
|
+
.category('Organisms')
|
|
467
|
+
.description('Toast notification messages')
|
|
468
|
+
.controls({
|
|
469
|
+
type: defaultControls.select('Type', ['info', 'success', 'warning', 'error'], 'success'),
|
|
470
|
+
})
|
|
471
|
+
.render((props) => {
|
|
472
|
+
const icons = { info: 'ℹ', success: '✓', warning: '⚠', error: '✗' };
|
|
473
|
+
const colors = { info: 'cyan', success: 'green', warning: 'yellow', error: 'red' };
|
|
474
|
+
const messages = {
|
|
475
|
+
info: 'New update available',
|
|
476
|
+
success: 'Changes saved successfully!',
|
|
477
|
+
warning: 'Your session will expire soon',
|
|
478
|
+
error: 'Failed to save changes',
|
|
479
|
+
};
|
|
480
|
+
const icon = icons[props.type];
|
|
481
|
+
const color = colors[props.type];
|
|
482
|
+
const message = messages[props.type];
|
|
483
|
+
return Box({ flexDirection: 'column', alignItems: 'flex-end', width: 50, height: 10 }, Box({
|
|
484
|
+
borderStyle: 'round',
|
|
485
|
+
borderColor: color,
|
|
486
|
+
paddingX: 1,
|
|
487
|
+
width: 35,
|
|
488
|
+
}, Text({ color: color }, `${icon} `), Text({}, message), Text({ color: 'gray', dim: true }, ' ×')));
|
|
489
|
+
}),
|
|
490
|
+
story('Toast - Stack')
|
|
491
|
+
.category('Organisms')
|
|
492
|
+
.description('Multiple stacked toasts')
|
|
493
|
+
.render(() => Box({ flexDirection: 'column', alignItems: 'flex-end', gap: 1, width: 50 }, Box({ borderStyle: 'round', borderColor: 'green', paddingX: 1, width: 35 }, Text({ color: 'green' }, '✓ '), Text({}, 'File uploaded'), Text({ color: 'gray' }, ' ×')), Box({ borderStyle: 'round', borderColor: 'cyan', paddingX: 1, width: 35 }, Text({ color: 'cyan' }, 'ℹ '), Text({}, '2 new messages'), Text({ color: 'gray' }, ' ×')), Box({ borderStyle: 'round', borderColor: 'yellow', paddingX: 1, width: 35 }, Text({ color: 'yellow' }, '⚠ '), Text({}, 'Low disk space'), Text({ color: 'gray' }, ' ×')))),
|
|
494
|
+
story('Popup - Dropdown Menu')
|
|
495
|
+
.category('Organisms')
|
|
496
|
+
.description('Dropdown popup menu')
|
|
497
|
+
.render(() => Box({ flexDirection: 'column', width: 40 },
|
|
498
|
+
// Trigger
|
|
499
|
+
Box({ borderStyle: 'single', borderColor: 'cyan', paddingX: 1 }, Text({ color: 'cyan' }, '⚙ Settings ▼')),
|
|
500
|
+
// Dropdown
|
|
501
|
+
Box({
|
|
502
|
+
flexDirection: 'column',
|
|
503
|
+
borderStyle: 'single',
|
|
504
|
+
borderColor: 'gray',
|
|
505
|
+
marginLeft: 2,
|
|
506
|
+
width: 25,
|
|
507
|
+
}, Box({ paddingX: 1, backgroundColor: 'blue' }, Text({ color: 'white' }, '👤 Profile')), Box({ paddingX: 1 }, Text({ color: 'gray' }, '🔔 Notifications')), Box({ paddingX: 1 }, Text({ color: 'gray' }, '🎨 Appearance')), Divider({ color: 'gray' }), Box({ paddingX: 1 }, Text({ color: 'red' }, '🚪 Logout'))))),
|
|
508
|
+
story('Popup - Context Menu')
|
|
509
|
+
.category('Organisms')
|
|
510
|
+
.description('Right-click context menu')
|
|
511
|
+
.render(() => Box({ flexDirection: 'column', width: 50, height: 12 }, Text({ color: 'gray', dim: true }, 'Right-click area simulation:'), Box({ flexDirection: 'row', marginTop: 1 }, Box({ width: 20, height: 8, borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'gray', dim: true }, 'Content...')), Box({
|
|
512
|
+
flexDirection: 'column',
|
|
513
|
+
borderStyle: 'single',
|
|
514
|
+
borderColor: 'cyan',
|
|
515
|
+
marginLeft: 2,
|
|
516
|
+
width: 20,
|
|
517
|
+
}, Box({ paddingX: 1 }, Text({}, '📋 Copy')), Box({ paddingX: 1 }, Text({}, '✂️ Cut')), Box({ paddingX: 1 }, Text({}, '📄 Paste')), Divider({ color: 'gray' }), Box({ paddingX: 1 }, Text({}, '🗑️ Delete')), Box({ paddingX: 1 }, Text({}, 'ℹ️ Properties')))))),
|
|
518
|
+
];
|
|
519
|
+
/**
|
|
520
|
+
* Status bar stories
|
|
521
|
+
*/
|
|
522
|
+
const statusBarStories = [
|
|
523
|
+
story('StatusBar - Basic')
|
|
524
|
+
.category('Organisms')
|
|
525
|
+
.description('Application status bar')
|
|
526
|
+
.render(() => Box({ flexDirection: 'column', width: 60 },
|
|
527
|
+
// Content area
|
|
528
|
+
Box({ height: 5, borderStyle: 'single', borderColor: 'gray', padding: 1 }, Text({ color: 'gray' }, 'Main content area...')),
|
|
529
|
+
// Status bar
|
|
530
|
+
Box({ backgroundColor: 'blue', paddingX: 1, justifyContent: 'space-between' }, Box({ gap: 2 }, Text({ color: 'white' }, 'NORMAL'), Text({ color: 'white' }, 'main.ts'), Text({ color: 'white' }, 'TypeScript')), Box({ gap: 2 }, Text({ color: 'white' }, 'Ln 42, Col 15'), Text({ color: 'white' }, 'UTF-8'), Text({ color: 'white' }, 'LF'))))),
|
|
531
|
+
story('StatusBar - With Icons')
|
|
532
|
+
.category('Organisms')
|
|
533
|
+
.description('Status bar with status icons')
|
|
534
|
+
.render(() => Box({
|
|
535
|
+
backgroundColor: 'gray',
|
|
536
|
+
paddingX: 1,
|
|
537
|
+
width: 60,
|
|
538
|
+
justifyContent: 'space-between',
|
|
539
|
+
}, Box({ gap: 2 }, Text({ color: 'green' }, '✓ Connected'), Text({ color: 'cyan' }, '↻ Syncing...'), Text({ color: 'yellow' }, '⚠ 2 warnings')), Box({ gap: 2 }, Text({ color: 'white' }, '🔋 85%'), Text({ color: 'white' }, '📶 Strong'), Text({ color: 'white' }, '14:32')))),
|
|
540
|
+
story('StatusBar - Progress')
|
|
541
|
+
.category('Organisms')
|
|
542
|
+
.description('Status bar with progress indicator')
|
|
543
|
+
.controls({
|
|
544
|
+
progress: defaultControls.range('Progress', 65, 0, 100),
|
|
545
|
+
})
|
|
546
|
+
.render((props) => {
|
|
547
|
+
const width = 20;
|
|
548
|
+
const filled = Math.floor((props.progress / 100) * width);
|
|
549
|
+
const bar = '█'.repeat(filled) + '░'.repeat(width - filled);
|
|
550
|
+
return Box({
|
|
551
|
+
backgroundColor: 'blue',
|
|
552
|
+
paddingX: 1,
|
|
553
|
+
width: 60,
|
|
554
|
+
justifyContent: 'space-between',
|
|
555
|
+
}, Box({ gap: 1 }, Text({ color: 'white' }, 'Building...'), Text({ color: 'cyan' }, `[${bar}]`), Text({ color: 'white' }, `${props.progress}%`)), Text({ color: 'yellow' }, 'Press Ctrl+C to cancel'));
|
|
556
|
+
}),
|
|
557
|
+
story('Window - Basic')
|
|
558
|
+
.category('Organisms')
|
|
559
|
+
.description('Window with title bar')
|
|
560
|
+
.controls({
|
|
561
|
+
title: defaultControls.text('Title', 'My Window'),
|
|
562
|
+
focused: defaultControls.boolean('Focused', true),
|
|
563
|
+
})
|
|
564
|
+
.render((props) => Box({
|
|
565
|
+
flexDirection: 'column',
|
|
566
|
+
width: 45,
|
|
567
|
+
height: 12,
|
|
568
|
+
borderStyle: 'double',
|
|
569
|
+
borderColor: props.focused ? 'cyan' : 'gray',
|
|
570
|
+
},
|
|
571
|
+
// Title bar
|
|
572
|
+
Box({
|
|
573
|
+
backgroundColor: props.focused ? 'blue' : 'gray',
|
|
574
|
+
paddingX: 1,
|
|
575
|
+
justifyContent: 'space-between',
|
|
576
|
+
}, Text({ color: 'white', bold: props.focused }, props.title), Box({ gap: 1 }, Text({ color: 'white' }, '─'), Text({ color: 'white' }, '□'), Text({ color: 'red' }, '×'))),
|
|
577
|
+
// Content
|
|
578
|
+
Box({ padding: 1, flexGrow: 1 }, Text({ color: 'gray' }, 'Window content goes here...')))),
|
|
579
|
+
story('Window - With Menu')
|
|
580
|
+
.category('Organisms')
|
|
581
|
+
.description('Window with menu bar')
|
|
582
|
+
.render(() => Box({
|
|
583
|
+
flexDirection: 'column',
|
|
584
|
+
width: 50,
|
|
585
|
+
height: 15,
|
|
586
|
+
borderStyle: 'double',
|
|
587
|
+
borderColor: 'cyan',
|
|
588
|
+
},
|
|
589
|
+
// Title bar
|
|
590
|
+
Box({ backgroundColor: 'blue', paddingX: 1, justifyContent: 'space-between' }, Text({ color: 'white', bold: true }, 'Text Editor'), Box({ gap: 1 }, Text({ color: 'white' }, '─ □ ×'))),
|
|
591
|
+
// Menu bar
|
|
592
|
+
Box({ borderStyle: 'single', borderColor: 'gray', paddingX: 1, gap: 2 }, Text({ color: 'white', underline: true }, 'F'), Text({ color: 'gray' }, 'ile'), Text({ color: 'white', underline: true }, 'E'), Text({ color: 'gray' }, 'dit'), Text({ color: 'white', underline: true }, 'V'), Text({ color: 'gray' }, 'iew'), Text({ color: 'white', underline: true }, 'H'), Text({ color: 'gray' }, 'elp')),
|
|
593
|
+
// Content
|
|
594
|
+
Box({ padding: 1, flexGrow: 1 }, Text({ color: 'gray' }, 'Document content...')),
|
|
595
|
+
// Status bar
|
|
596
|
+
Box({ backgroundColor: 'gray', paddingX: 1, justifyContent: 'space-between' }, Text({ color: 'white' }, 'Ready'), Text({ color: 'white' }, 'Ln 1, Col 1')))),
|
|
597
|
+
story('Window - Dialog')
|
|
598
|
+
.category('Organisms')
|
|
599
|
+
.description('Dialog window with buttons')
|
|
600
|
+
.render(() => Box({
|
|
601
|
+
flexDirection: 'column',
|
|
602
|
+
width: 40,
|
|
603
|
+
borderStyle: 'double',
|
|
604
|
+
borderColor: 'yellow',
|
|
605
|
+
},
|
|
606
|
+
// Title bar
|
|
607
|
+
Box({ backgroundColor: 'yellow', paddingX: 1 }, Text({ color: 'black', bold: true }, '⚠ Warning')),
|
|
608
|
+
// Content
|
|
609
|
+
Box({ padding: 1 }, Text({}, 'Are you sure you want to delete this file? This action cannot be undone.')),
|
|
610
|
+
// Buttons
|
|
611
|
+
Box({ paddingX: 1, paddingBottom: 1, gap: 2, justifyContent: 'flex-end' }, Text({ color: 'gray', inverse: true }, ' No '), Text({ color: 'red', inverse: true }, ' Yes ')))),
|
|
612
|
+
];
|
|
613
|
+
/**
|
|
614
|
+
* Real-time Dashboard stories
|
|
615
|
+
* Note: For actual real-time animation, run: pnpm tsx examples/realtime-dashboard.ts
|
|
616
|
+
*/
|
|
617
|
+
const realtimeDashboardStories = [
|
|
618
|
+
story('Dashboard - Metrics')
|
|
619
|
+
.category('Organisms')
|
|
620
|
+
.description('Dashboard with live metrics (static preview)')
|
|
621
|
+
.render(() => {
|
|
622
|
+
const sparkChars = ['▁', '▂', '▃', '▄', '▅', '▆', '▇', '█'];
|
|
623
|
+
const randomSparkline = (len) => Array.from({ length: len }, () => sparkChars[Math.floor(Math.random() * 8)]).join('');
|
|
624
|
+
return Box({ flexDirection: 'column', gap: 1 },
|
|
625
|
+
// Header
|
|
626
|
+
Box({ borderStyle: 'double', borderColor: 'cyan', paddingX: 1 }, Text({ color: 'cyan', bold: true }, '🖥️ Real-time Dashboard'), Spacer({}), Text({ color: 'green' }, '● Live'), Text({ color: 'gray' }, ' | '), Text({ color: 'gray', dim: true }, 'Uptime: 02:34:56')),
|
|
627
|
+
// Row 1
|
|
628
|
+
Box({ flexDirection: 'row', gap: 1 }, Box({ borderStyle: 'round', borderColor: 'green', padding: 1, width: 28 }, Box({ flexDirection: 'column' }, Text({ color: 'gray', dim: true }, 'CPU Usage'), Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'green' }, '[████████████░░░░░░░░]'), Text({ color: 'green', bold: true }, '58.3%')), Text({ color: 'green', dim: true }, randomSparkline(25)))), Box({ borderStyle: 'round', borderColor: 'cyan', padding: 1, width: 28 }, Box({ flexDirection: 'column' }, Text({ color: 'gray', dim: true }, 'Memory'), Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'cyan' }, '[██████████░░░░░░░░░░]'), Text({ color: 'cyan', bold: true }, '52.1%')), Text({ color: 'gray' }, '8.3 GB / 16.0 GB')))),
|
|
629
|
+
// Row 2
|
|
630
|
+
Box({ flexDirection: 'row', gap: 1 }, Box({ borderStyle: 'round', borderColor: 'blue', padding: 1, width: 40 }, Box({ flexDirection: 'column' }, Box({ flexDirection: 'row' }, Text({ color: 'gray', dim: true }, 'Requests/sec'), Spacer({}), Text({ color: 'gray', dim: true }, 'Total: 1.2M')), Text({ color: 'blue', bold: true }, '892 req/s'), Text({ color: 'blue' }, randomSparkline(35)))), Box({ borderStyle: 'round', borderColor: 'yellow', padding: 1, width: 18 }, Box({ flexDirection: 'column' }, Text({ color: 'gray', dim: true }, 'Active Spinners'), Text({ color: 'cyan' }, '⠋ Fetching...'), Text({ color: 'green' }, '◜ Processing...'), Text({ color: 'yellow' }, '🕐 Syncing...')))),
|
|
631
|
+
// Footer
|
|
632
|
+
Box({ backgroundColor: 'blue', paddingX: 1 }, Text({ color: 'white' }, '● 234 connections'), Spacer({}), Text({ color: 'white' }, 'Render: 30 FPS'), Text({ color: 'gray' }, ' | '), Text({ color: 'white' }, '14:32:45')));
|
|
633
|
+
}),
|
|
634
|
+
story('Dashboard - Gauges')
|
|
635
|
+
.category('Organisms')
|
|
636
|
+
.description('Gauge widgets for metrics')
|
|
637
|
+
.render(() => Box({ flexDirection: 'row', gap: 2 },
|
|
638
|
+
// CPU Gauge
|
|
639
|
+
Box({ borderStyle: 'round', borderColor: 'green', padding: 1, width: 20 }, Box({ flexDirection: 'column', alignItems: 'center' }, Text({ color: 'gray', dim: true }, 'CPU'), Text({ color: 'green', bold: true }, '58%'), Text({ color: 'green' }, '▁▂▃▄▅▆▇█▇▆▅▄▃▂▁'))),
|
|
640
|
+
// Memory Gauge
|
|
641
|
+
Box({ borderStyle: 'round', borderColor: 'cyan', padding: 1, width: 20 }, Box({ flexDirection: 'column', alignItems: 'center' }, Text({ color: 'gray', dim: true }, 'Memory'), Text({ color: 'cyan', bold: true }, '8.3GB'), Text({ color: 'cyan' }, '████████░░░░░░░░'))),
|
|
642
|
+
// Disk Gauge
|
|
643
|
+
Box({ borderStyle: 'round', borderColor: 'yellow', padding: 1, width: 20 }, Box({ flexDirection: 'column', alignItems: 'center' }, Text({ color: 'gray', dim: true }, 'Disk'), Text({ color: 'yellow', bold: true }, '78%'), Text({ color: 'yellow' }, '████████████░░░░'))))),
|
|
644
|
+
story('Dashboard - Sparklines')
|
|
645
|
+
.category('Organisms')
|
|
646
|
+
.description('Sparkline charts for time series')
|
|
647
|
+
.controls({
|
|
648
|
+
showLabels: defaultControls.boolean('Show Labels', true),
|
|
649
|
+
})
|
|
650
|
+
.render((props) => Box({ flexDirection: 'column', gap: 1, width: 50 }, Box({ flexDirection: 'row', gap: 1 }, props.showLabels && Box({ width: 10 }, Text({ color: 'gray' }, 'CPU:')), Text({ color: 'green' }, '▁▂▃▄▅▆▇█▇▆▅▄▃▂▁▂▃▄▅▆▇█▇▆▅▄▃▂▁▂▃'), Text({ color: 'green', bold: true }, ' 58%')), Box({ flexDirection: 'row', gap: 1 }, props.showLabels && Box({ width: 10 }, Text({ color: 'gray' }, 'Memory:')), Text({ color: 'cyan' }, '▄▄▄▄▅▅▅▅▅▅▆▆▆▆▆▆▅▅▅▅▅▅▄▄▄▄▄▄▄▄▄'), Text({ color: 'cyan', bold: true }, ' 52%')), Box({ flexDirection: 'row', gap: 1 }, props.showLabels && Box({ width: 10 }, Text({ color: 'gray' }, 'Network:')), Text({ color: 'magenta' }, '▂▃▅▇█▆▄▂▁▂▃▅▇█▆▄▂▁▂▃▅▇█▆▄▂▁▂▃▅'), Text({ color: 'magenta', bold: true }, ' 45MB/s')), Box({ flexDirection: 'row', gap: 1 }, props.showLabels && Box({ width: 10 }, Text({ color: 'gray' }, 'Errors:')), Text({ color: 'red' }, '▁▁▁▁▁▁▁▁▂▁▁▁▁▁▁▁▁▁▁▃▁▁▁▁▁▁▁▁▁▁▁'), Text({ color: 'green', bold: true }, ' 0.1%')))),
|
|
651
|
+
story('Spinner - Animated')
|
|
652
|
+
.category('Organisms')
|
|
653
|
+
.description('Spinner styles (run real example for animation)')
|
|
654
|
+
.render(() => Box({ flexDirection: 'column', gap: 1 }, Text({ color: 'gray', dim: true }, 'Note: For real animation, run: pnpm tsx examples/realtime-dashboard.ts'), Box({ marginTop: 1 }), Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'cyan' }, '⠋'), Text({}, 'dots - Braille dots')), Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'green' }, '◜'), Text({}, 'arc - Arc spinner')), Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'yellow' }, '◐'), Text({}, 'circle - Circle')), Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'magenta' }, '🕐'), Text({}, 'clock - Clock emoji')), Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'blue' }, '🌍'), Text({}, 'earth - Globe')), Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'red' }, '←'), Text({}, 'arrow - Directional')), Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'cyan' }, '[=== ]'), Text({}, 'bouncingBar - Progress bar')))),
|
|
655
|
+
];
|
|
656
|
+
/**
|
|
657
|
+
* All organism stories
|
|
658
|
+
*/
|
|
659
|
+
export const allOrganismStories = [
|
|
660
|
+
...formPatternStories,
|
|
661
|
+
...splitPanelStories,
|
|
662
|
+
...gridStories,
|
|
663
|
+
...stackStories,
|
|
664
|
+
...layoutPatternStories,
|
|
665
|
+
...barChartStories,
|
|
666
|
+
...heatmapStories,
|
|
667
|
+
...dashboardStories,
|
|
668
|
+
...fileBrowserStories,
|
|
669
|
+
...chatStories,
|
|
670
|
+
...commandPaletteStories,
|
|
671
|
+
...navigationStories,
|
|
672
|
+
...overlayStories,
|
|
673
|
+
...statusBarStories,
|
|
674
|
+
...realtimeDashboardStories,
|
|
675
|
+
];
|
|
676
|
+
export default allOrganismStories;
|
|
677
|
+
//# sourceMappingURL=index.js.map
|