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,587 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Molecules Stories
|
|
3
|
+
*
|
|
4
|
+
* Molecules are simple combinations of atoms that form functional units:
|
|
5
|
+
* - Utility components (When, Each, Fragment)
|
|
6
|
+
* - Form controls (TextInput, Checkbox, RadioGroup, Select)
|
|
7
|
+
* - ProgressBar: Task progress indicator
|
|
8
|
+
* - Alert: Status messages
|
|
9
|
+
* - Toast: Notification popups
|
|
10
|
+
* - Tabs: Tab navigation
|
|
11
|
+
* - Sparkline & Gauge: Simple data visualizations
|
|
12
|
+
*/
|
|
13
|
+
import { Box, Text, When, Each, Fragment, Spacer } from '../../../primitives/nodes.js';
|
|
14
|
+
import { Divider } from '../../../primitives/divider.js';
|
|
15
|
+
import { TextInput, Checkbox, Select, RadioGroup } from '../../../design-system/forms/index.js';
|
|
16
|
+
import { story, defaultControls } from '../../core/registry.js';
|
|
17
|
+
// Chart helpers
|
|
18
|
+
const sparklineChars = ['โ', 'โ', 'โ', 'โ', 'โ
', 'โ', 'โ', 'โ'];
|
|
19
|
+
function textSparkline(data) {
|
|
20
|
+
if (data.length === 0)
|
|
21
|
+
return '';
|
|
22
|
+
const min = Math.min(...data);
|
|
23
|
+
const max = Math.max(...data);
|
|
24
|
+
const range = max - min || 1;
|
|
25
|
+
return data.map((v) => {
|
|
26
|
+
const idx = Math.floor(((v - min) / range) * 7);
|
|
27
|
+
return sparklineChars[idx];
|
|
28
|
+
}).join('');
|
|
29
|
+
}
|
|
30
|
+
function textProgressBar(value, max, width, filled = 'โ', empty = 'โ') {
|
|
31
|
+
const filledWidth = Math.round((value / max) * width);
|
|
32
|
+
return filled.repeat(filledWidth) + empty.repeat(width - filledWidth);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Utility components stories (When, Each, Fragment)
|
|
36
|
+
*/
|
|
37
|
+
export const utilityStories = [
|
|
38
|
+
story('When - Conditional')
|
|
39
|
+
.category('Molecules')
|
|
40
|
+
.description('Conditional rendering with When')
|
|
41
|
+
.controls({
|
|
42
|
+
show: defaultControls.boolean('Show Content', true),
|
|
43
|
+
})
|
|
44
|
+
.render((props) => Box({ flexDirection: 'column' }, Text({}, 'Always visible'), When(props.show, Text({ color: 'green' }, 'Conditionally visible')), Text({}, 'Also always visible'))),
|
|
45
|
+
story('Each - List Rendering')
|
|
46
|
+
.category('Molecules')
|
|
47
|
+
.description('Render lists with Each')
|
|
48
|
+
.controls({
|
|
49
|
+
count: defaultControls.range('Item Count', 5, 1, 10),
|
|
50
|
+
})
|
|
51
|
+
.render((props) => Box({ flexDirection: 'column' }, Each(Array.from({ length: props.count }, (_, i) => `Item ${i + 1}`), (item, index) => Box({}, Text({ color: index % 2 === 0 ? 'cyan' : 'gray' }, `${index + 1}. ${item}`))))),
|
|
52
|
+
story('Fragment - Grouping')
|
|
53
|
+
.category('Molecules')
|
|
54
|
+
.description('Group elements without wrapper')
|
|
55
|
+
.render(() => Box({ flexDirection: 'column' }, Text({}, 'Before fragment'), Fragment(Text({ color: 'cyan' }, 'Inside fragment 1'), Text({ color: 'green' }, 'Inside fragment 2'), Text({ color: 'yellow' }, 'Inside fragment 3')), Text({}, 'After fragment'))),
|
|
56
|
+
];
|
|
57
|
+
/**
|
|
58
|
+
* TextInput component stories
|
|
59
|
+
*/
|
|
60
|
+
export const textInputStories = [
|
|
61
|
+
story('TextInput - Basic')
|
|
62
|
+
.category('Molecules')
|
|
63
|
+
.description('Basic text input field')
|
|
64
|
+
.controls({
|
|
65
|
+
initialValue: defaultControls.text('Initial Value', 'Hello, World!'),
|
|
66
|
+
placeholder: defaultControls.text('Placeholder', 'Enter text...'),
|
|
67
|
+
})
|
|
68
|
+
.render((props) => TextInput({
|
|
69
|
+
initialValue: props.initialValue,
|
|
70
|
+
placeholder: props.placeholder,
|
|
71
|
+
onChange: (val) => console.log('Input changed:', val),
|
|
72
|
+
onSubmit: (val) => console.log('Input submitted:', val),
|
|
73
|
+
})),
|
|
74
|
+
story('TextInput - Password')
|
|
75
|
+
.category('Molecules')
|
|
76
|
+
.description('Password input with masked characters')
|
|
77
|
+
.controls({
|
|
78
|
+
initialValue: defaultControls.text('Initial Value', 'secret'),
|
|
79
|
+
maskChar: defaultControls.text('Mask Char', '*'),
|
|
80
|
+
})
|
|
81
|
+
.render((props) => TextInput({
|
|
82
|
+
initialValue: props.initialValue,
|
|
83
|
+
password: true,
|
|
84
|
+
maskChar: props.maskChar,
|
|
85
|
+
onChange: (val) => console.log('Password changed:', val),
|
|
86
|
+
})),
|
|
87
|
+
story('TextInput - Multi-line')
|
|
88
|
+
.category('Molecules')
|
|
89
|
+
.description('Multi-line text input (Shift+Enter for newline)')
|
|
90
|
+
.controls({
|
|
91
|
+
initialValue: defaultControls.text('Initial Value', 'Line 1\nLine 2'),
|
|
92
|
+
})
|
|
93
|
+
.render((props) => TextInput({
|
|
94
|
+
initialValue: props.initialValue,
|
|
95
|
+
multiline: true,
|
|
96
|
+
onChange: (val) => console.log('Multi-line changed:', val),
|
|
97
|
+
})),
|
|
98
|
+
story('TextInput - With Label')
|
|
99
|
+
.category('Molecules')
|
|
100
|
+
.description('TextInput with label and full-width')
|
|
101
|
+
.controls({
|
|
102
|
+
label: defaultControls.text('Label', 'Username:'),
|
|
103
|
+
initialValue: defaultControls.text('Initial Value', 'john_doe'),
|
|
104
|
+
})
|
|
105
|
+
.render((props) => Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'cyan' }, props.label), TextInput({
|
|
106
|
+
initialValue: props.initialValue,
|
|
107
|
+
fullWidth: true,
|
|
108
|
+
onChange: (val) => console.log('Input changed:', val),
|
|
109
|
+
}))),
|
|
110
|
+
];
|
|
111
|
+
/**
|
|
112
|
+
* Checkbox stories
|
|
113
|
+
*/
|
|
114
|
+
export const checkboxStories = [
|
|
115
|
+
story('Checkbox - Basic')
|
|
116
|
+
.category('Molecules')
|
|
117
|
+
.description('Basic interactive checkbox')
|
|
118
|
+
.controls({
|
|
119
|
+
label: defaultControls.text('Label', 'Accept terms'),
|
|
120
|
+
})
|
|
121
|
+
.render((props) => Checkbox({
|
|
122
|
+
items: [{ label: props.label, value: 'accept', description: 'Click me!' }],
|
|
123
|
+
onChange: (val) => console.log('Checkbox changed:', val),
|
|
124
|
+
showCount: false,
|
|
125
|
+
searchable: false,
|
|
126
|
+
cursorIndicator: ' ', // Hide cursor for simple checkbox feel
|
|
127
|
+
})),
|
|
128
|
+
story('Checkbox - List')
|
|
129
|
+
.category('Molecules')
|
|
130
|
+
.description('Multiple checkboxes in a list')
|
|
131
|
+
.render(() => Checkbox({
|
|
132
|
+
items: [
|
|
133
|
+
{ label: 'Option 1', value: '1' },
|
|
134
|
+
{ label: 'Option 2', value: '2' },
|
|
135
|
+
{ label: 'Option 3', value: '3', disabled: true },
|
|
136
|
+
{ label: 'Option 4', value: '4' },
|
|
137
|
+
],
|
|
138
|
+
initialValue: ['1', '3'],
|
|
139
|
+
onChange: (vals) => console.log('Selected:', vals),
|
|
140
|
+
showCount: true,
|
|
141
|
+
searchable: false,
|
|
142
|
+
})),
|
|
143
|
+
];
|
|
144
|
+
/**
|
|
145
|
+
* RadioGroup stories
|
|
146
|
+
*/
|
|
147
|
+
export const radioStories = [
|
|
148
|
+
story('RadioGroup - Basic')
|
|
149
|
+
.category('Molecules')
|
|
150
|
+
.description('Basic radio button group')
|
|
151
|
+
.render(() => RadioGroup({
|
|
152
|
+
options: [
|
|
153
|
+
{ value: '1', label: 'Option 1' },
|
|
154
|
+
{ value: '2', label: 'Option 2' },
|
|
155
|
+
{ value: '3', label: 'Option 3' },
|
|
156
|
+
],
|
|
157
|
+
initialValue: '1',
|
|
158
|
+
onChange: (val) => console.log('Radio changed:', val),
|
|
159
|
+
})),
|
|
160
|
+
story('RadioGroup - Horizontal')
|
|
161
|
+
.category('Molecules')
|
|
162
|
+
.description('Radio buttons in horizontal layout')
|
|
163
|
+
.render(() => RadioGroup({
|
|
164
|
+
direction: 'horizontal',
|
|
165
|
+
gap: 2,
|
|
166
|
+
options: [
|
|
167
|
+
{ value: 'xs', label: 'XS' },
|
|
168
|
+
{ value: 'sm', label: 'SM' },
|
|
169
|
+
{ value: 'md', label: 'MD' },
|
|
170
|
+
{ value: 'lg', label: 'LG' },
|
|
171
|
+
{ value: 'xl', label: 'XL' },
|
|
172
|
+
],
|
|
173
|
+
initialValue: 'md',
|
|
174
|
+
})),
|
|
175
|
+
];
|
|
176
|
+
/**
|
|
177
|
+
* Select component stories
|
|
178
|
+
*/
|
|
179
|
+
export const selectStories = [
|
|
180
|
+
story('Select - Basic')
|
|
181
|
+
.category('Molecules')
|
|
182
|
+
.description('Basic dropdown selection')
|
|
183
|
+
.render(() => Select({
|
|
184
|
+
items: [
|
|
185
|
+
{ label: 'Option 1', value: '1' },
|
|
186
|
+
{ label: 'Option 2', value: '2' },
|
|
187
|
+
{ label: 'Option 3', value: '3' },
|
|
188
|
+
{ label: 'Option 4', value: '4' },
|
|
189
|
+
],
|
|
190
|
+
searchable: true,
|
|
191
|
+
})),
|
|
192
|
+
story('Select - With Categories')
|
|
193
|
+
.category('Molecules')
|
|
194
|
+
.description('Select with grouped options')
|
|
195
|
+
.render(() => Select({
|
|
196
|
+
items: [
|
|
197
|
+
{ label: 'Apple', value: 'apple', group: 'Fruits' },
|
|
198
|
+
{ label: 'Banana', value: 'banana', group: 'Fruits' },
|
|
199
|
+
{ label: 'Carrot', value: 'carrot', group: 'Vegetables' },
|
|
200
|
+
{ label: 'Broccoli', value: 'broccoli', group: 'Vegetables' },
|
|
201
|
+
],
|
|
202
|
+
initialValue: 'apple',
|
|
203
|
+
})),
|
|
204
|
+
story('Select - Multi-Select')
|
|
205
|
+
.category('Molecules')
|
|
206
|
+
.description('Select multiple items')
|
|
207
|
+
.render(() => Select({
|
|
208
|
+
multiple: true,
|
|
209
|
+
items: [
|
|
210
|
+
{ label: 'JavaScript', value: 'js' },
|
|
211
|
+
{ label: 'TypeScript', value: 'ts' },
|
|
212
|
+
{ label: 'Python', value: 'py' },
|
|
213
|
+
{ label: 'Rust', value: 'rs' },
|
|
214
|
+
{ label: 'Go', value: 'go' },
|
|
215
|
+
],
|
|
216
|
+
initialValue: ['js', 'ts', 'go'],
|
|
217
|
+
})),
|
|
218
|
+
];
|
|
219
|
+
/**
|
|
220
|
+
* ProgressBar stories
|
|
221
|
+
*/
|
|
222
|
+
export const progressBarStories = [
|
|
223
|
+
story('ProgressBar - Basic')
|
|
224
|
+
.category('Molecules')
|
|
225
|
+
.description('Basic progress bar')
|
|
226
|
+
.controls({
|
|
227
|
+
value: defaultControls.range('Progress', 65, 0, 100),
|
|
228
|
+
width: defaultControls.range('Width', 30, 15, 50),
|
|
229
|
+
})
|
|
230
|
+
.render((props) => Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'cyan' }, textProgressBar(props.value, 100, props.width)), Text({ color: 'cyan' }, `${props.value}%`))),
|
|
231
|
+
story('ProgressBar - Colors')
|
|
232
|
+
.category('Molecules')
|
|
233
|
+
.description('Progress bar with custom colors')
|
|
234
|
+
.controls({
|
|
235
|
+
value: defaultControls.range('Progress', 75, 0, 100),
|
|
236
|
+
color: defaultControls.color('Color', 'green'),
|
|
237
|
+
})
|
|
238
|
+
.render((props) => Box({ flexDirection: 'row', gap: 1 }, Text({ color: props.color }, textProgressBar(props.value, 100, 30)), Text({ color: props.color }, `${props.value}%`))),
|
|
239
|
+
story('ProgressBar - With Label')
|
|
240
|
+
.category('Molecules')
|
|
241
|
+
.description('Progress bar with label')
|
|
242
|
+
.controls({
|
|
243
|
+
value: defaultControls.range('Progress', 42, 0, 100),
|
|
244
|
+
showLabel: defaultControls.boolean('Show Label', true),
|
|
245
|
+
})
|
|
246
|
+
.render((props) => Box({ flexDirection: 'column', gap: 1 }, Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'gray' }, 'Progress:'), Text({ color: 'cyan' }, textProgressBar(props.value, 100, 25)), props.showLabel ? Text({ color: 'cyan' }, `${props.value}%`) : null))),
|
|
247
|
+
story('ProgressBar - Multiple')
|
|
248
|
+
.category('Molecules')
|
|
249
|
+
.description('Multiple progress bars')
|
|
250
|
+
.render(() => Box({ flexDirection: 'column', gap: 1 }, Box({ flexDirection: 'row', gap: 1 }, Box({ width: 12 }, Text({ color: 'gray' }, 'Downloading:')), Text({ color: 'blue' }, textProgressBar(75, 100, 20)), Text({ color: 'blue' }, '75%')), Box({ flexDirection: 'row', gap: 1 }, Box({ width: 12 }, Text({ color: 'gray' }, 'Installing:')), Text({ color: 'green' }, textProgressBar(45, 100, 20)), Text({ color: 'green' }, '45%')), Box({ flexDirection: 'row', gap: 1 }, Box({ width: 12 }, Text({ color: 'gray' }, 'Configuring:')), Text({ color: 'yellow' }, textProgressBar(10, 100, 20)), Text({ color: 'yellow' }, '10%')))),
|
|
251
|
+
story('ProgressBar - Indeterminate Styles')
|
|
252
|
+
.category('Molecules')
|
|
253
|
+
.description('Different indeterminate loading styles')
|
|
254
|
+
.controls({
|
|
255
|
+
style: defaultControls.select('Style', ['classic', 'marquee', 'fill-and-clear'], 'marquee'),
|
|
256
|
+
fillStep: defaultControls.range('Fill Step', 1, 1, 5),
|
|
257
|
+
width: defaultControls.range('Width', 30, 10, 50),
|
|
258
|
+
})
|
|
259
|
+
.animated(50)
|
|
260
|
+
.render((props, frame = 0) => {
|
|
261
|
+
// Simulate indeterminate animation logic for story preview
|
|
262
|
+
const { style, fillStep, width } = props;
|
|
263
|
+
let barContent = '';
|
|
264
|
+
const t = Math.floor(Date.now() / 50); // Use real time or frame for consistency
|
|
265
|
+
if (style === 'marquee') {
|
|
266
|
+
const blockWidth = Math.max(3, Math.floor(width * 0.25));
|
|
267
|
+
const totalWidth = width + blockWidth;
|
|
268
|
+
const pos = Math.floor(frame / 1.5) % totalWidth; // Slow down a bit
|
|
269
|
+
const start = Math.max(0, pos - blockWidth);
|
|
270
|
+
const end = Math.min(width, pos);
|
|
271
|
+
const length = Math.max(0, end - start);
|
|
272
|
+
const emptyLeft = Math.max(0, start);
|
|
273
|
+
const emptyRight = Math.max(0, width - end);
|
|
274
|
+
barContent = 'โ'.repeat(emptyLeft) + 'โ'.repeat(length) + 'โ'.repeat(emptyRight);
|
|
275
|
+
}
|
|
276
|
+
else if (style === 'fill-and-clear') {
|
|
277
|
+
const totalSteps = Math.ceil(width / fillStep);
|
|
278
|
+
const rawCycle = Math.floor(frame) % ((totalSteps * 2) + 4);
|
|
279
|
+
const effectiveCycle = rawCycle * fillStep;
|
|
280
|
+
if (rawCycle < totalSteps) {
|
|
281
|
+
const filledLen = Math.min(width, effectiveCycle);
|
|
282
|
+
barContent = 'โ'.repeat(filledLen) + 'โ'.repeat(width - filledLen);
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
const emptyLeftLen = Math.min(width, effectiveCycle - width);
|
|
286
|
+
const filledLen = Math.max(0, width - emptyLeftLen);
|
|
287
|
+
barContent = 'โ'.repeat(emptyLeftLen) + 'โ'.repeat(filledLen);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
// Classic
|
|
292
|
+
const frames = ['[ ]', '[= ]', '[== ]', '[=== ]', '[ ===]', '[ ==]', '[ =]', '[ ]'];
|
|
293
|
+
barContent = frames[frame % frames.length].padEnd(width, ' ');
|
|
294
|
+
}
|
|
295
|
+
return Box({ flexDirection: 'column', gap: 1 }, Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'cyan' }, barContent), Text({ color: 'gray' }, style)), style === 'fill-and-clear' ? Text({ color: 'gray', dim: true }, `Step: ${fillStep}`) : null);
|
|
296
|
+
}),
|
|
297
|
+
story('ProgressBar - Thresholds')
|
|
298
|
+
.category('Molecules')
|
|
299
|
+
.description('Progress bar with color thresholds')
|
|
300
|
+
.controls({
|
|
301
|
+
value: defaultControls.range('Value', 80, 0, 100),
|
|
302
|
+
})
|
|
303
|
+
.render((props) => {
|
|
304
|
+
const color = props.value > 80 ? 'red' : props.value > 60 ? 'yellow' : 'green';
|
|
305
|
+
const status = props.value > 80 ? 'Critical!' : props.value > 60 ? 'Warning' : 'Normal';
|
|
306
|
+
return Box({ flexDirection: 'column', gap: 1 }, Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'gray' }, 'Memory:'), Text({ color }, textProgressBar(props.value, 100, 25)), Text({ color }, `${props.value}%`)), Text({ color, dim: true }, status));
|
|
307
|
+
}),
|
|
308
|
+
];
|
|
309
|
+
/**
|
|
310
|
+
* Alert stories
|
|
311
|
+
*/
|
|
312
|
+
export const alertStories = [
|
|
313
|
+
story('Alert - Info')
|
|
314
|
+
.category('Molecules')
|
|
315
|
+
.description('Information alert')
|
|
316
|
+
.controls({
|
|
317
|
+
message: defaultControls.text('Message', 'This is an informational message.'),
|
|
318
|
+
})
|
|
319
|
+
.render((props) => Box({
|
|
320
|
+
borderStyle: 'single',
|
|
321
|
+
borderColor: 'blue',
|
|
322
|
+
padding: 1,
|
|
323
|
+
width: 50,
|
|
324
|
+
}, Text({ color: 'blue' }, 'โน '), Text({ color: 'white' }, props.message))),
|
|
325
|
+
story('Alert - Success')
|
|
326
|
+
.category('Molecules')
|
|
327
|
+
.description('Success alert')
|
|
328
|
+
.render(() => Box({
|
|
329
|
+
borderStyle: 'round',
|
|
330
|
+
borderColor: 'green',
|
|
331
|
+
backgroundColor: 'green',
|
|
332
|
+
padding: 1,
|
|
333
|
+
width: 50,
|
|
334
|
+
}, Text({ color: 'white', bold: true }, 'โ Operation completed successfully!'))),
|
|
335
|
+
story('Alert - Warning')
|
|
336
|
+
.category('Molecules')
|
|
337
|
+
.description('Warning alert')
|
|
338
|
+
.render(() => Box({
|
|
339
|
+
borderStyle: 'single',
|
|
340
|
+
borderColor: 'yellow',
|
|
341
|
+
padding: 1,
|
|
342
|
+
width: 50,
|
|
343
|
+
}, Box({ flexDirection: 'column' }, Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'yellow', bold: true }, 'โ Warning')), Text({ color: 'yellow' }, 'This action may have unintended consequences.')))),
|
|
344
|
+
story('Alert - Error')
|
|
345
|
+
.category('Molecules')
|
|
346
|
+
.description('Error alert')
|
|
347
|
+
.render(() => Box({
|
|
348
|
+
borderStyle: 'bold',
|
|
349
|
+
borderColor: 'red',
|
|
350
|
+
padding: 1,
|
|
351
|
+
width: 50,
|
|
352
|
+
}, Box({ flexDirection: 'column' }, Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'red', bold: true }, 'โ Error')), Text({ color: 'red' }, 'Failed to complete the operation.'), Text({ color: 'gray', dim: true }, 'Error code: E_CONNECTION_TIMEOUT')))),
|
|
353
|
+
story('Alert - Dismissible')
|
|
354
|
+
.category('Molecules')
|
|
355
|
+
.description('Alert with dismiss action')
|
|
356
|
+
.render(() => Box({
|
|
357
|
+
borderStyle: 'single',
|
|
358
|
+
borderColor: 'cyan',
|
|
359
|
+
padding: 1,
|
|
360
|
+
width: 50,
|
|
361
|
+
}, Box({ flexDirection: 'row', justifyContent: 'space-between' }, Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'cyan' }, 'โน'), Text({ color: 'white' }, 'New updates available.')), Text({ color: 'gray' }, '[x]')))),
|
|
362
|
+
];
|
|
363
|
+
/**
|
|
364
|
+
* Toast notification stories
|
|
365
|
+
*/
|
|
366
|
+
export const toastStories = [
|
|
367
|
+
story('Toast - Stack')
|
|
368
|
+
.category('Molecules')
|
|
369
|
+
.description('Stack of toast notifications')
|
|
370
|
+
.render(() => Box({ flexDirection: 'column', gap: 1, alignItems: 'flex-end', width: 50 }, Box({
|
|
371
|
+
borderStyle: 'round',
|
|
372
|
+
borderColor: 'green',
|
|
373
|
+
paddingX: 2,
|
|
374
|
+
paddingY: 0,
|
|
375
|
+
}, Text({ color: 'green' }, 'โ File saved successfully')), Box({
|
|
376
|
+
borderStyle: 'round',
|
|
377
|
+
borderColor: 'blue',
|
|
378
|
+
paddingX: 2,
|
|
379
|
+
paddingY: 0,
|
|
380
|
+
}, Text({ color: 'blue' }, 'โน 3 new messages')), Box({
|
|
381
|
+
borderStyle: 'round',
|
|
382
|
+
borderColor: 'yellow',
|
|
383
|
+
paddingX: 2,
|
|
384
|
+
paddingY: 0,
|
|
385
|
+
}, Text({ color: 'yellow' }, 'โ Low disk space')))),
|
|
386
|
+
story('Toast - With Actions')
|
|
387
|
+
.category('Molecules')
|
|
388
|
+
.description('Toast with action buttons')
|
|
389
|
+
.render(() => Box({
|
|
390
|
+
borderStyle: 'single',
|
|
391
|
+
borderColor: 'cyan',
|
|
392
|
+
padding: 1,
|
|
393
|
+
width: 45,
|
|
394
|
+
}, Box({ flexDirection: 'column', gap: 1 }, Text({ color: 'white' }, 'New version available (v2.0.0)'), Box({ flexDirection: 'row', gap: 2 }, Text({ color: 'cyan', inverse: true }, ' Update '), Text({ color: 'gray' }, 'Dismiss'))))),
|
|
395
|
+
];
|
|
396
|
+
/**
|
|
397
|
+
* Tabs stories
|
|
398
|
+
*/
|
|
399
|
+
export const tabsStories = [
|
|
400
|
+
story('Tabs - Basic')
|
|
401
|
+
.category('Molecules')
|
|
402
|
+
.description('Basic tabbed interface')
|
|
403
|
+
.controls({
|
|
404
|
+
activeTab: defaultControls.range('Active Tab', 0, 0, 2),
|
|
405
|
+
})
|
|
406
|
+
.render((props) => {
|
|
407
|
+
const tabs = ['Overview', 'Details', 'Settings'];
|
|
408
|
+
return Box({ width: 50, flexDirection: 'column' }, Box({ flexDirection: 'row', borderStyle: 'single', borderColor: 'gray' }, ...tabs.map((tab, idx) => Box({
|
|
409
|
+
paddingX: 2,
|
|
410
|
+
backgroundColor: idx === props.activeTab ? 'blue' : undefined,
|
|
411
|
+
}, Text({
|
|
412
|
+
color: idx === props.activeTab ? 'white' : 'gray',
|
|
413
|
+
bold: idx === props.activeTab,
|
|
414
|
+
}, tab)))), Box({ borderStyle: 'single', borderColor: 'blue', padding: 1, height: 5 }, Text({}, `${tabs[props.activeTab]} content here...`)));
|
|
415
|
+
}),
|
|
416
|
+
story('Tabs - With Icons')
|
|
417
|
+
.category('Molecules')
|
|
418
|
+
.description('Tabs with icons')
|
|
419
|
+
.render(() => Box({ width: 50, flexDirection: 'column' }, Box({ flexDirection: 'row', borderStyle: 'single', borderColor: 'gray' }, Box({ paddingX: 2, backgroundColor: 'blue' }, Text({ color: 'white', bold: true }, '๐ Home')), Box({ paddingX: 2 }, Text({ color: 'gray' }, '๐ Files')), Box({ paddingX: 2 }, Text({ color: 'gray' }, 'โ๏ธ Settings'))), Box({ borderStyle: 'single', borderColor: 'blue', padding: 1, height: 5 }, Text({}, 'Home content')))),
|
|
420
|
+
story('Tabs - Styled')
|
|
421
|
+
.category('Molecules')
|
|
422
|
+
.description('Tabs with custom styling')
|
|
423
|
+
.controls({
|
|
424
|
+
activeColor: defaultControls.color('Active Color', 'cyan'),
|
|
425
|
+
})
|
|
426
|
+
.render((props) => Box({ width: 50, flexDirection: 'column' }, Box({ flexDirection: 'row', gap: 1 }, Text({ color: props.activeColor, inverse: true }, ' Tab 1 '), Text({ color: 'gray' }, 'Tab 2'), Text({ color: 'gray' }, 'Tab 3')), Box({ borderStyle: 'single', borderColor: props.activeColor, padding: 1, marginTop: 1 }, Text({}, 'Content 1')))),
|
|
427
|
+
];
|
|
428
|
+
/**
|
|
429
|
+
* Sparkline stories
|
|
430
|
+
*/
|
|
431
|
+
export const sparklineStories = [
|
|
432
|
+
story('Sparkline - Basic')
|
|
433
|
+
.category('Molecules')
|
|
434
|
+
.description('Inline sparkline chart using block characters')
|
|
435
|
+
.render(() => {
|
|
436
|
+
const data = [5, 10, 8, 15, 12, 18, 14, 22, 19, 25];
|
|
437
|
+
return Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'gray' }, 'Trend:'), Text({ color: 'cyan' }, textSparkline(data)));
|
|
438
|
+
}),
|
|
439
|
+
story('Sparkline - Colors')
|
|
440
|
+
.category('Molecules')
|
|
441
|
+
.description('Sparklines with different colors')
|
|
442
|
+
.controls({
|
|
443
|
+
color: defaultControls.color('Color', 'green'),
|
|
444
|
+
})
|
|
445
|
+
.render((props) => {
|
|
446
|
+
const data = [3, 7, 4, 9, 6, 8, 5, 10, 7, 12];
|
|
447
|
+
return Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'gray' }, 'Data:'), Text({ color: props.color }, textSparkline(data)));
|
|
448
|
+
}),
|
|
449
|
+
story('Sparkline - Multiple')
|
|
450
|
+
.category('Molecules')
|
|
451
|
+
.description('Multiple sparklines for comparison')
|
|
452
|
+
.render(() => {
|
|
453
|
+
const revenue = [30, 45, 38, 52, 48, 55, 60, 58, 65, 70];
|
|
454
|
+
const costs = [25, 28, 32, 30, 35, 38, 40, 42, 45, 48];
|
|
455
|
+
const profit = [5, 17, 6, 22, 13, 17, 20, 16, 20, 22];
|
|
456
|
+
return Box({ flexDirection: 'column', gap: 1 }, Box({ flexDirection: 'row', gap: 1 }, Box({ width: 10 }, Text({ color: 'gray' }, 'Revenue:')), Text({ color: 'green' }, textSparkline(revenue))), Box({ flexDirection: 'row', gap: 1 }, Box({ width: 10 }, Text({ color: 'gray' }, 'Costs:')), Text({ color: 'red' }, textSparkline(costs))), Box({ flexDirection: 'row', gap: 1 }, Box({ width: 10 }, Text({ color: 'gray' }, 'Profit:')), Text({ color: 'cyan' }, textSparkline(profit))));
|
|
457
|
+
}),
|
|
458
|
+
];
|
|
459
|
+
/**
|
|
460
|
+
* Gauge stories
|
|
461
|
+
*/
|
|
462
|
+
export const gaugeStories = [
|
|
463
|
+
story('Gauge - Linear')
|
|
464
|
+
.category('Molecules')
|
|
465
|
+
.description('Linear gauge indicator')
|
|
466
|
+
.controls({
|
|
467
|
+
value: defaultControls.range('Value', 65, 0, 100),
|
|
468
|
+
})
|
|
469
|
+
.render((props) => Box({ flexDirection: 'column', gap: 1 }, Text({ color: 'gray' }, 'Progress'), Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'cyan' }, textProgressBar(props.value, 100, 30)), Text({ color: 'cyan' }, `${props.value}%`)))),
|
|
470
|
+
story('Gauge - Thresholds')
|
|
471
|
+
.category('Molecules')
|
|
472
|
+
.description('Gauge with color thresholds')
|
|
473
|
+
.controls({
|
|
474
|
+
value: defaultControls.range('Value', 80, 0, 100),
|
|
475
|
+
})
|
|
476
|
+
.render((props) => {
|
|
477
|
+
const color = props.value > 80 ? 'red' :
|
|
478
|
+
props.value > 60 ? 'yellow' :
|
|
479
|
+
'green';
|
|
480
|
+
const status = props.value > 80 ? 'Critical!' :
|
|
481
|
+
props.value > 60 ? 'Warning' :
|
|
482
|
+
'Normal';
|
|
483
|
+
return Box({ flexDirection: 'column', gap: 1 }, Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'gray' }, 'Memory:'), Text({ color }, textProgressBar(props.value, 100, 25)), Text({ color }, `${props.value}%`)), Text({ color, dim: true }, status));
|
|
484
|
+
}),
|
|
485
|
+
story('Gauge - Dashboard')
|
|
486
|
+
.category('Molecules')
|
|
487
|
+
.description('Multiple gauges dashboard style')
|
|
488
|
+
.render(() => Box({ flexDirection: 'column', gap: 1 }, Box({ flexDirection: 'row', gap: 1 }, Box({ width: 8 }, Text({ color: 'gray' }, 'CPU:')), Text({ color: 'green' }, textProgressBar(45, 100, 20)), Text({ color: 'green' }, ' 45%')), Box({ flexDirection: 'row', gap: 1 }, Box({ width: 8 }, Text({ color: 'gray' }, 'Memory:')), Text({ color: 'yellow' }, textProgressBar(72, 100, 20)), Text({ color: 'yellow' }, ' 72%')), Box({ flexDirection: 'row', gap: 1 }, Box({ width: 8 }, Text({ color: 'gray' }, 'Disk:')), Text({ color: 'cyan' }, textProgressBar(28, 100, 20)), Text({ color: 'cyan' }, ' 28%')))),
|
|
489
|
+
];
|
|
490
|
+
/**
|
|
491
|
+
* Mouse interaction stories
|
|
492
|
+
* Demonstrates useMouse hook capabilities for terminal mouse input
|
|
493
|
+
*/
|
|
494
|
+
export const mouseStories = [
|
|
495
|
+
story('Mouse - Basic Click')
|
|
496
|
+
.category('Molecules')
|
|
497
|
+
.description('Detect mouse clicks with position')
|
|
498
|
+
.render(() => Box({ flexDirection: 'column', gap: 1, padding: 1, borderStyle: 'round', borderColor: 'cyan' }, Text({ bold: true, color: 'cyan' }, '๐ฑ๏ธ Mouse Click Detection'), Divider({}), Text({ color: 'gray' }, 'Click anywhere in the terminal to see:'), Spacer({ size: 1 }), Box({ flexDirection: 'column', gap: 0 }, Text({}, ' Position: x=12, y=5'), Text({}, ' Button: left'), Text({}, ' Action: click')), Spacer({ size: 1 }), Text({ color: 'gray', dim: true }, 'useMouse((event) => { ... })'))),
|
|
499
|
+
story('Mouse - All Buttons')
|
|
500
|
+
.category('Molecules')
|
|
501
|
+
.description('Detect left, right, and middle clicks')
|
|
502
|
+
.render(() => Box({ flexDirection: 'column', gap: 1, padding: 1, borderStyle: 'single' }, Text({ bold: true }, 'Mouse Button Detection'), Divider({}), Box({ flexDirection: 'row', gap: 2 }, Box({ flexDirection: 'column', padding: 1, borderStyle: 'round', borderColor: 'green' }, Text({ color: 'green', bold: true }, ' LEFT '), Text({ color: 'gray', dim: true }, 'Clicks: 3')), Box({ flexDirection: 'column', padding: 1, borderStyle: 'round', borderColor: 'yellow' }, Text({ color: 'yellow', bold: true }, ' MIDDLE '), Text({ color: 'gray', dim: true }, 'Clicks: 1')), Box({ flexDirection: 'column', padding: 1, borderStyle: 'round', borderColor: 'red' }, Text({ color: 'red', bold: true }, ' RIGHT '), Text({ color: 'gray', dim: true }, 'Clicks: 0'))), Text({ color: 'gray', dim: true }, "event.button === 'left' | 'middle' | 'right'"))),
|
|
503
|
+
story('Mouse - Position Tracker')
|
|
504
|
+
.category('Molecules')
|
|
505
|
+
.description('Real-time mouse position tracking')
|
|
506
|
+
.render(() => Box({ flexDirection: 'column', gap: 1, padding: 1, borderStyle: 'double', borderColor: 'magenta' }, Text({ bold: true, color: 'magenta' }, '๐ Mouse Position Tracker'), Divider({}), Box({ flexDirection: 'row', gap: 4 }, Box({ flexDirection: 'column' }, Text({ color: 'gray' }, 'X Position'), Text({ color: 'cyan', bold: true }, ' 24 ')), Box({ flexDirection: 'column' }, Text({ color: 'gray' }, 'Y Position'), Text({ color: 'cyan', bold: true }, ' 12 '))), Spacer({ size: 1 }), Box({ flexDirection: 'column', backgroundColor: 'gray' }, Text({ color: 'white' }, ' '), Text({ color: 'white' }, ' Move mouse here... '), Text({ color: 'white' }, ' โ '), Text({ color: 'white' }, ' ')), Text({ color: 'gray', dim: true }, "action === 'move' for tracking"))),
|
|
507
|
+
story('Mouse - Double Click')
|
|
508
|
+
.category('Molecules')
|
|
509
|
+
.description('Detect double-click events')
|
|
510
|
+
.render(() => Box({ flexDirection: 'column', gap: 1, padding: 1, borderStyle: 'round', borderColor: 'yellow' }, Text({ bold: true, color: 'yellow' }, 'โก Double Click Detection'), Divider({}), Box({ padding: 2, borderStyle: 'single', borderColor: 'cyan' }, Text({ color: 'cyan' }, ' Double-click this area ')), Spacer({ size: 1 }), Text({}, 'Last action: double-click'), Text({ color: 'green' }, 'โ Double-click detected!'), Spacer({ size: 1 }), Text({ color: 'gray', dim: true }, "event.action === 'double-click'"))),
|
|
511
|
+
story('Mouse - Drag Events')
|
|
512
|
+
.category('Molecules')
|
|
513
|
+
.description('Handle mouse drag operations')
|
|
514
|
+
.render(() => Box({ flexDirection: 'column', gap: 1, padding: 1, borderStyle: 'round', borderColor: 'blue' }, Text({ bold: true, color: 'blue' }, 'โ๏ธ Drag Detection'), Divider({}), Text({ color: 'gray' }, 'Drag state: dragging'), Box({ flexDirection: 'row', gap: 1 }, Text({}, 'Start: (5, 10)'), Text({ color: 'gray' }, 'โ'), Text({}, 'Current: (25, 10)')), Spacer({ size: 1 }), Box({ flexDirection: 'column' }, Text({ color: 'gray' }, 'โโโโโโโโโโโโโโโโโโโโโโโโโโโโ'), Text({ color: 'gray' }, 'โ โ'), Text({ color: 'gray' }, 'โ โโโโโโโโโโโโโโ โ'), Text({ color: 'gray' }, 'โ โ'), Text({ color: 'gray' }, 'โโโโโโโโโโโโโโโโโโโโโโโโโโโโ')), Text({ color: 'gray', dim: true }, "action === 'drag' | 'release'"))),
|
|
515
|
+
story('Mouse - Scroll Wheel')
|
|
516
|
+
.category('Molecules')
|
|
517
|
+
.description('Detect scroll up/down events')
|
|
518
|
+
.render(() => Box({ flexDirection: 'column', gap: 1, padding: 1, borderStyle: 'single' }, Text({ bold: true }, '๐ Scroll Wheel Events'), Divider({}), Box({ flexDirection: 'row', gap: 2 }, Box({ flexDirection: 'column', alignItems: 'center' }, Text({ color: 'green' }, 'โฒ'), Text({ color: 'gray', dim: true }, 'scroll-up'), Text({ color: 'cyan' }, 'ร5')), Box({ width: 1 }, Text({ color: 'gray' }, 'โ')), Box({ flexDirection: 'column', alignItems: 'center' }, Text({ color: 'red' }, 'โผ'), Text({ color: 'gray', dim: true }, 'scroll-down'), Text({ color: 'cyan' }, 'ร12'))), Spacer({ size: 1 }), Text({}, 'Scroll position: 72'), Text({ color: 'gray', dim: true }, "button === 'scroll-up' | 'scroll-down'"))),
|
|
519
|
+
story('Mouse - With Modifiers')
|
|
520
|
+
.category('Molecules')
|
|
521
|
+
.description('Detect Ctrl, Shift, Alt + click')
|
|
522
|
+
.render(() => Box({ flexDirection: 'column', gap: 1, padding: 1, borderStyle: 'round', borderColor: 'cyan' }, Text({ bold: true, color: 'cyan' }, 'โจ๏ธ Mouse + Modifiers'), Divider({}), Box({ flexDirection: 'column', gap: 0 }, Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'green' }, 'โ'), Text({}, 'Ctrl + Click'), Text({ color: 'gray', dim: true }, '- Open in new tab')), Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'gray' }, 'โ'), Text({}, 'Shift + Click'), Text({ color: 'gray', dim: true }, '- Select range')), Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'gray' }, 'โ'), Text({}, 'Alt + Click'), Text({ color: 'gray', dim: true }, '- Quick action')), Box({ flexDirection: 'row', gap: 1 }, Text({ color: 'gray' }, 'โ'), Text({}, 'Ctrl + Shift + Click'), Text({ color: 'gray', dim: true }, '- Advanced mode'))), Spacer({ size: 1 }), Text({ color: 'gray', dim: true }, 'event.modifiers.ctrl | shift | alt'))),
|
|
523
|
+
story('Mouse - Click Hitbox')
|
|
524
|
+
.category('Molecules')
|
|
525
|
+
.description('Detect clicks on specific regions')
|
|
526
|
+
.render(() => Box({ flexDirection: 'column', gap: 1, padding: 1, borderStyle: 'single' }, Text({ bold: true }, '๐ฏ Hitbox Detection'), Divider({}), Box({ flexDirection: 'row', gap: 1 }, Box({ padding: 1, borderStyle: 'round', borderColor: 'green', backgroundColor: 'green' }, Text({ color: 'white', bold: true }, ' Button 1 ')), Box({ padding: 1, borderStyle: 'round', borderColor: 'blue' }, Text({ color: 'blue' }, ' Button 2 ')), Box({ padding: 1, borderStyle: 'round', borderColor: 'red' }, Text({ color: 'red' }, ' Button 3 '))), Spacer({ size: 1 }), Text({}, 'Clicked: Button 1'), Text({ color: 'gray', dim: true }, 'Check x,y against element bounds'))),
|
|
527
|
+
story('Mouse - Interactive Canvas')
|
|
528
|
+
.category('Molecules')
|
|
529
|
+
.description('Draw with mouse clicks')
|
|
530
|
+
.render(() => {
|
|
531
|
+
// Simulated canvas with some "drawn" points
|
|
532
|
+
const canvasLines = [
|
|
533
|
+
'โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ',
|
|
534
|
+
'โ โ',
|
|
535
|
+
'โ โ โโโ โ',
|
|
536
|
+
'โ โโโโโโโโ โ',
|
|
537
|
+
'โ โโโโโโ โโโ โ',
|
|
538
|
+
'โ โโโ โโโโโ โ',
|
|
539
|
+
'โ โโโ โ',
|
|
540
|
+
'โ โ',
|
|
541
|
+
'โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ',
|
|
542
|
+
];
|
|
543
|
+
return Box({ flexDirection: 'column', gap: 1, padding: 1, borderStyle: 'round', borderColor: 'magenta' }, Text({ bold: true, color: 'magenta' }, '๐จ Interactive Canvas'), Divider({}), Box({ flexDirection: 'row', gap: 2 }, Text({ color: isActive('pen') ? 'cyan' : 'gray' }, '[โ๏ธ Pen]'), Text({ color: 'gray' }, '[๐งน Eraser]'), Text({ color: 'gray' }, '[โฌ Clear]')), Spacer({ size: 1 }), Box({ flexDirection: 'column' }, ...canvasLines.map((line) => Text({ color: 'cyan' }, line))), Text({ color: 'gray', dim: true }, 'Click to draw, drag for lines'));
|
|
544
|
+
function isActive(tool) {
|
|
545
|
+
return tool === 'pen';
|
|
546
|
+
}
|
|
547
|
+
}),
|
|
548
|
+
story('Mouse - Event Log')
|
|
549
|
+
.category('Molecules')
|
|
550
|
+
.description('Log all mouse events')
|
|
551
|
+
.render(() => Box({ flexDirection: 'column', gap: 1, padding: 1, borderStyle: 'single' }, Text({ bold: true }, '๐ Mouse Event Log'), Divider({}), Box({ flexDirection: 'column', height: 8, borderStyle: 'round', borderColor: 'gray', padding: 1 }, Text({ color: 'cyan' }, '[12:34:56] click left @ (24, 8)'), Text({ color: 'cyan' }, '[12:34:57] release @ (24, 8)'), Text({ color: 'yellow' }, '[12:34:58] scroll-down @ (24, 8)'), Text({ color: 'green' }, '[12:34:59] double-click left @ (24, 8)'), Text({ color: 'magenta' }, '[12:35:00] drag @ (25, 8)'), Text({ color: 'magenta' }, '[12:35:00] drag @ (26, 8)'), Text({ color: 'cyan' }, '[12:35:01] release @ (28, 8)')), Box({ flexDirection: 'row', gap: 2 }, Text({ color: 'gray' }, 'Events: 7'), Text({ color: 'gray' }, '|'), Text({ color: 'gray' }, '[Clear Log]')))),
|
|
552
|
+
story('Mouse - Hover State')
|
|
553
|
+
.category('Molecules')
|
|
554
|
+
.description('Track hover state over elements')
|
|
555
|
+
.render(() => Box({ flexDirection: 'column', gap: 1, padding: 1, borderStyle: 'single' }, Text({ bold: true }, '๐ Hover Detection'), Divider({}), Box({ flexDirection: 'row', gap: 2 }, Box({ padding: 1, borderStyle: 'round', borderColor: 'cyan', backgroundColor: 'blue' }, Text({ color: 'white', bold: true }, ' Hovered! ')), Box({ padding: 1, borderStyle: 'round', borderColor: 'gray' }, Text({ color: 'gray' }, ' Normal ')), Box({ padding: 1, borderStyle: 'round', borderColor: 'gray' }, Text({ color: 'gray' }, ' Normal '))), Spacer({ size: 1 }), Text({ color: 'gray' }, 'Hovering: Item 1'), Text({ color: 'gray', dim: true }, "Track mouse position for hover effects"))),
|
|
556
|
+
story('Mouse - Context Menu')
|
|
557
|
+
.category('Molecules')
|
|
558
|
+
.description('Right-click context menu trigger')
|
|
559
|
+
.render(() => Box({ flexDirection: 'column', gap: 1, padding: 1, borderStyle: 'single' }, Text({ bold: true }, '๐ Context Menu'), Divider({}), Box({ flexDirection: 'row', gap: 0 }, Box({ flexDirection: 'column', width: 20 }, Text({}, ' ๐ Document.txt'), Text({}, ' ๐ Folder'), Text({ backgroundColor: 'blue', color: 'white' }, ' ๐ Selected.md ')), Box({ flexDirection: 'column', borderStyle: 'single', borderColor: 'cyan', padding: 1 }, Text({ color: 'cyan' }, ' Open '), Text({}, ' Edit '), Text({}, ' Copy '), Text({ color: 'gray' }, ' โโโโโโโโโโ '), Text({ color: 'red' }, ' Delete '))), Text({ color: 'gray', dim: true }, "if (event.button === 'right') showMenu()"))),
|
|
560
|
+
story('Mouse - Drag & Drop')
|
|
561
|
+
.category('Molecules')
|
|
562
|
+
.description('Visual drag and drop interface')
|
|
563
|
+
.render(() => Box({ flexDirection: 'column', gap: 1, padding: 1, borderStyle: 'round', borderColor: 'green' }, Text({ bold: true, color: 'green' }, '๐ฆ Drag & Drop'), Divider({}), Box({ flexDirection: 'row', gap: 2 }, Box({ flexDirection: 'column', borderStyle: 'single', borderColor: 'gray', padding: 1 }, Text({ color: 'gray', dim: true }, 'Source'), Text({}, ' ๐ File 1'), Text({ color: 'yellow' }, ' ๐ Dragging...'), Text({}, ' ๐ File 3')), Box({ flexDirection: 'column', alignItems: 'center', justifyContent: 'center' }, Text({ color: 'yellow' }, 'โโโ'), Text({ color: 'yellow', dim: true }, '๐')), Box({ flexDirection: 'column', borderStyle: 'double', borderColor: 'green', padding: 1 }, Text({ color: 'green' }, 'Drop Zone'), Text({}, ' ๐ Existing'), Text({ color: 'green', dim: true }, ' โโโโโโโโ'))), Text({ color: 'gray', dim: true }, 'Combine drag events with position tracking'))),
|
|
564
|
+
story('Mouse - Selection Box')
|
|
565
|
+
.category('Molecules')
|
|
566
|
+
.description('Drag to create selection rectangle')
|
|
567
|
+
.render(() => Box({ flexDirection: 'column', gap: 1, padding: 1, borderStyle: 'single' }, Text({ bold: true }, 'โฌ Selection Box'), Divider({}), Box({ flexDirection: 'column' }, Text({ color: 'gray' }, 'โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ'), Text({ color: 'gray' }, 'โ โ โ โ โ โ'), Text({ color: 'gray' }, 'โ โโโโโโโโโโโโโ โ'), Text({ color: 'gray' }, 'โ โ โ โ โ โ โ โ'), Text({ color: 'gray' }, 'โ โ โ โ โ'), Text({ color: 'gray' }, 'โ โโโโโโโโโโโโโ โ โ'), Text({ color: 'gray' }, 'โ โ โ โ'), Text({ color: 'gray' }, 'โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ')), Text({ color: 'cyan' }, 'Selected: 4 items'), Text({ color: 'gray', dim: true }, 'Track start & end drag positions'))),
|
|
568
|
+
];
|
|
569
|
+
/**
|
|
570
|
+
* All molecule stories
|
|
571
|
+
*/
|
|
572
|
+
export const allMoleculeStories = [
|
|
573
|
+
...utilityStories,
|
|
574
|
+
...textInputStories,
|
|
575
|
+
...checkboxStories,
|
|
576
|
+
...radioStories,
|
|
577
|
+
...selectStories,
|
|
578
|
+
...progressBarStories,
|
|
579
|
+
...alertStories,
|
|
580
|
+
...toastStories,
|
|
581
|
+
...tabsStories,
|
|
582
|
+
...sparklineStories,
|
|
583
|
+
...gaugeStories,
|
|
584
|
+
...mouseStories,
|
|
585
|
+
];
|
|
586
|
+
export default allMoleculeStories;
|
|
587
|
+
//# sourceMappingURL=index.js.map
|