tuiuiu.js 0.1.1 → 0.1.4-next.64ff654
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/README.md +67 -36
- package/dist/atoms/button.d.ts.map +1 -1
- package/dist/atoms/button.js +17 -9
- package/dist/atoms/button.js.map +1 -1
- package/dist/atoms/text-input.d.ts +2 -0
- package/dist/atoms/text-input.d.ts.map +1 -1
- package/dist/atoms/text-input.js +13 -7
- package/dist/atoms/text-input.js.map +1 -1
- package/dist/atoms/tooltip.d.ts.map +1 -1
- package/dist/atoms/tooltip.js +2 -1
- package/dist/atoms/tooltip.js.map +1 -1
- package/dist/cli/commands/help.d.ts +5 -0
- package/dist/cli/commands/help.d.ts.map +1 -0
- package/dist/cli/commands/help.js +31 -0
- package/dist/cli/commands/help.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +11 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +21 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/storybook.d.ts +5 -0
- package/dist/cli/commands/storybook.d.ts.map +1 -0
- package/dist/cli/commands/storybook.js +9 -0
- package/dist/cli/commands/storybook.js.map +1 -0
- package/dist/cli/index.d.ts +14 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +50 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/error-boundary.d.ts.map +1 -1
- package/dist/core/error-boundary.js +2 -1
- package/dist/core/error-boundary.js.map +1 -1
- package/dist/core/hotkeys.d.ts +62 -0
- package/dist/core/hotkeys.d.ts.map +1 -0
- package/dist/core/hotkeys.js +0 -0
- package/dist/core/hotkeys.js.map +1 -0
- package/dist/core/index.d.ts +3 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +9 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/screen.d.ts.map +1 -1
- package/dist/core/screen.js +2 -0
- package/dist/core/screen.js.map +1 -1
- package/dist/core/theme.d.ts +79 -0
- package/dist/core/theme.d.ts.map +1 -1
- package/dist/core/theme.js +358 -0
- package/dist/core/theme.js.map +1 -1
- package/dist/design-system/data-display/index.d.ts +9 -6
- package/dist/design-system/data-display/index.d.ts.map +1 -1
- package/dist/design-system/data-display/index.js +16 -7
- package/dist/design-system/data-display/index.js.map +1 -1
- package/dist/design-system/feedback/badge.d.ts +21 -4
- package/dist/design-system/feedback/badge.d.ts.map +1 -1
- package/dist/design-system/feedback/badge.js +15 -2
- package/dist/design-system/feedback/badge.js.map +1 -1
- package/dist/design-system/forms/index.d.ts +11 -8
- package/dist/design-system/forms/index.d.ts.map +1 -1
- package/dist/design-system/forms/index.js +19 -10
- package/dist/design-system/forms/index.js.map +1 -1
- package/dist/design-system/layout/index.d.ts +7 -4
- package/dist/design-system/layout/index.d.ts.map +1 -1
- package/dist/design-system/layout/index.js +18 -6
- package/dist/design-system/layout/index.js.map +1 -1
- package/dist/design-system/media/picture.d.ts.map +1 -1
- package/dist/design-system/media/picture.js +2 -1
- package/dist/design-system/media/picture.js.map +1 -1
- package/dist/design-system/overlays/index.d.ts +6 -3
- package/dist/design-system/overlays/index.d.ts.map +1 -1
- package/dist/design-system/overlays/index.js +9 -3
- package/dist/design-system/overlays/index.js.map +1 -1
- package/dist/design-system/visual/splash-screen.d.ts.map +1 -1
- package/dist/design-system/visual/splash-screen.js +38 -18
- package/dist/design-system/visual/splash-screen.js.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-hotkeys.d.ts +153 -0
- package/dist/hooks/use-hotkeys.d.ts.map +1 -0
- package/dist/hooks/use-hotkeys.js +379 -0
- package/dist/hooks/use-hotkeys.js.map +1 -0
- package/dist/hooks/use-input.d.ts +2 -10
- package/dist/hooks/use-input.d.ts.map +1 -1
- package/dist/hooks/use-input.js +2 -287
- package/dist/hooks/use-input.js.map +1 -1
- package/dist/hooks/use-mouse.d.ts +5 -0
- package/dist/hooks/use-mouse.d.ts.map +1 -1
- package/dist/hooks/use-mouse.js +29 -11
- package/dist/hooks/use-mouse.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -3
- package/dist/index.js.map +1 -1
- package/dist/mcp/docs-data.d.ts +31 -0
- package/dist/mcp/docs-data.d.ts.map +1 -0
- package/dist/mcp/docs-data.js +637 -0
- package/dist/mcp/docs-data.js.map +1 -0
- package/dist/mcp/index.d.ts +14 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +12 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/server.d.ts +31 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +597 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/types.d.ts +114 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +16 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/molecules/autocomplete.d.ts.map +1 -1
- package/dist/molecules/autocomplete.js +2 -1
- package/dist/molecules/autocomplete.js.map +1 -1
- package/dist/molecules/calendar.d.ts.map +1 -1
- package/dist/molecules/calendar.js +5 -3
- package/dist/molecules/calendar.js.map +1 -1
- package/dist/molecules/data-viz/annotations.d.ts +75 -0
- package/dist/molecules/data-viz/annotations.d.ts.map +1 -0
- package/dist/molecules/data-viz/annotations.js +40 -0
- package/dist/molecules/data-viz/annotations.js.map +1 -0
- package/dist/molecules/data-viz/gantt-chart.d.ts +66 -0
- package/dist/molecules/data-viz/gantt-chart.d.ts.map +1 -0
- package/dist/molecules/data-viz/gantt-chart.js +134 -0
- package/dist/molecules/data-viz/gantt-chart.js.map +1 -0
- package/dist/molecules/data-viz/gauge.d.ts +2 -2
- package/dist/molecules/data-viz/gauge.d.ts.map +1 -1
- package/dist/molecules/data-viz/gauge.js +24 -8
- package/dist/molecules/data-viz/gauge.js.map +1 -1
- package/dist/molecules/data-viz/heatmap.d.ts +8 -2
- package/dist/molecules/data-viz/heatmap.d.ts.map +1 -1
- package/dist/molecules/data-viz/heatmap.js +41 -9
- package/dist/molecules/data-viz/heatmap.js.map +1 -1
- package/dist/molecules/data-viz/hooks.d.ts +264 -0
- package/dist/molecules/data-viz/hooks.d.ts.map +1 -0
- package/dist/molecules/data-viz/hooks.js +373 -0
- package/dist/molecules/data-viz/hooks.js.map +1 -0
- package/dist/molecules/data-viz/index.d.ts +14 -0
- package/dist/molecules/data-viz/index.d.ts.map +1 -1
- package/dist/molecules/data-viz/index.js +14 -0
- package/dist/molecules/data-viz/index.js.map +1 -1
- package/dist/molecules/data-viz/legend.d.ts +82 -0
- package/dist/molecules/data-viz/legend.d.ts.map +1 -0
- package/dist/molecules/data-viz/legend.js +146 -0
- package/dist/molecules/data-viz/legend.js.map +1 -0
- package/dist/molecules/data-viz/line-chart.d.ts.map +1 -1
- package/dist/molecules/data-viz/line-chart.js +48 -12
- package/dist/molecules/data-viz/line-chart.js.map +1 -1
- package/dist/molecules/data-viz/radar-chart.d.ts +61 -0
- package/dist/molecules/data-viz/radar-chart.d.ts.map +1 -0
- package/dist/molecules/data-viz/radar-chart.js +86 -0
- package/dist/molecules/data-viz/radar-chart.js.map +1 -0
- package/dist/molecules/data-viz/scatter-plot.d.ts +97 -0
- package/dist/molecules/data-viz/scatter-plot.d.ts.map +1 -0
- package/dist/molecules/data-viz/scatter-plot.js +205 -0
- package/dist/molecules/data-viz/scatter-plot.js.map +1 -0
- package/dist/molecules/data-viz/time-heatmap.d.ts +48 -0
- package/dist/molecules/data-viz/time-heatmap.d.ts.map +1 -0
- package/dist/molecules/data-viz/time-heatmap.js +145 -0
- package/dist/molecules/data-viz/time-heatmap.js.map +1 -0
- package/dist/molecules/select.d.ts +2 -0
- package/dist/molecules/select.d.ts.map +1 -1
- package/dist/molecules/select.js +4 -3
- package/dist/molecules/select.js.map +1 -1
- package/dist/molecules/tabs.d.ts.map +1 -1
- package/dist/molecules/tabs.js +14 -2
- package/dist/molecules/tabs.js.map +1 -1
- package/dist/organisms/command-palette.d.ts.map +1 -1
- package/dist/organisms/command-palette.js +2 -1
- package/dist/organisms/command-palette.js.map +1 -1
- package/dist/storybook/app.d.ts.map +1 -1
- package/dist/storybook/app.js +53 -44
- package/dist/storybook/app.js.map +1 -1
- package/dist/storybook/components/compare-view.d.ts.map +1 -1
- package/dist/storybook/components/compare-view.js +19 -18
- package/dist/storybook/components/compare-view.js.map +1 -1
- package/dist/storybook/components/log-viewer.d.ts.map +1 -1
- package/dist/storybook/components/log-viewer.js +9 -8
- package/dist/storybook/components/log-viewer.js.map +1 -1
- package/dist/storybook/components/preview.d.ts.map +1 -1
- package/dist/storybook/components/preview.js +34 -33
- package/dist/storybook/components/preview.js.map +1 -1
- package/dist/storybook/components/sidebar.d.ts.map +1 -1
- package/dist/storybook/components/sidebar.js +21 -20
- package/dist/storybook/components/sidebar.js.map +1 -1
- package/dist/storybook/stories/apps/index.d.ts.map +1 -1
- package/dist/storybook/stories/apps/index.js +306 -209
- package/dist/storybook/stories/apps/index.js.map +1 -1
- package/dist/storybook/stories/atoms/index.d.ts.map +1 -1
- package/dist/storybook/stories/atoms/index.js.map +1 -1
- package/dist/storybook/stories/molecules/index.d.ts +25 -0
- package/dist/storybook/stories/molecules/index.d.ts.map +1 -1
- package/dist/storybook/stories/molecules/index.js +402 -20
- package/dist/storybook/stories/molecules/index.js.map +1 -1
- package/dist/storybook/stories/organisms/index.d.ts.map +1 -1
- package/dist/storybook/stories/organisms/index.js +1 -1
- package/dist/storybook/stories/organisms/index.js.map +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/system-data.d.ts +73 -0
- package/dist/utils/system-data.d.ts.map +1 -0
- package/dist/utils/system-data.js +367 -0
- package/dist/utils/system-data.js.map +1 -0
- package/dist/version.d.ts +43 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +82 -0
- package/dist/version.js.map +1 -0
- package/package.json +22 -22
- package/dist/components/canvas.d.ts +0 -322
- package/dist/components/canvas.d.ts.map +0 -1
- package/dist/components/canvas.js +0 -833
- package/dist/components/canvas.js.map +0 -1
- package/dist/components/code-block.d.ts +0 -75
- package/dist/components/code-block.d.ts.map +0 -1
- package/dist/components/code-block.js +0 -322
- package/dist/components/code-block.js.map +0 -1
- package/dist/components/components.d.ts +0 -122
- package/dist/components/components.d.ts.map +0 -1
- package/dist/components/components.js +0 -151
- package/dist/components/components.js.map +0 -1
- package/dist/components/data-viz/bar-chart.d.ts +0 -167
- package/dist/components/data-viz/bar-chart.d.ts.map +0 -1
- package/dist/components/data-viz/bar-chart.js +0 -375
- package/dist/components/data-viz/bar-chart.js.map +0 -1
- package/dist/components/data-viz/gauge.d.ts +0 -163
- package/dist/components/data-viz/gauge.d.ts.map +0 -1
- package/dist/components/data-viz/gauge.js +0 -451
- package/dist/components/data-viz/gauge.js.map +0 -1
- package/dist/components/data-viz/heatmap.d.ts +0 -154
- package/dist/components/data-viz/heatmap.d.ts.map +0 -1
- package/dist/components/data-viz/heatmap.js +0 -458
- package/dist/components/data-viz/heatmap.js.map +0 -1
- package/dist/components/data-viz/index.d.ts +0 -16
- package/dist/components/data-viz/index.d.ts.map +0 -1
- package/dist/components/data-viz/index.js +0 -16
- package/dist/components/data-viz/index.js.map +0 -1
- package/dist/components/data-viz/line-chart.d.ts +0 -157
- package/dist/components/data-viz/line-chart.d.ts.map +0 -1
- package/dist/components/data-viz/line-chart.js +0 -578
- package/dist/components/data-viz/line-chart.js.map +0 -1
- package/dist/components/data-viz/sparkline.d.ts +0 -156
- package/dist/components/data-viz/sparkline.d.ts.map +0 -1
- package/dist/components/data-viz/sparkline.js +0 -325
- package/dist/components/data-viz/sparkline.js.map +0 -1
- package/dist/components/grid.d.ts +0 -234
- package/dist/components/grid.d.ts.map +0 -1
- package/dist/components/grid.js +0 -719
- package/dist/components/grid.js.map +0 -1
- package/dist/components/index.d.ts +0 -33
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -69
- package/dist/components/index.js.map +0 -1
- package/dist/components/markdown.d.ts +0 -52
- package/dist/components/markdown.d.ts.map +0 -1
- package/dist/components/markdown.js +0 -341
- package/dist/components/markdown.js.map +0 -1
- package/dist/components/modal.d.ts +0 -237
- package/dist/components/modal.d.ts.map +0 -1
- package/dist/components/modal.js +0 -396
- package/dist/components/modal.js.map +0 -1
- package/dist/components/progress-bar.d.ts +0 -89
- package/dist/components/progress-bar.d.ts.map +0 -1
- package/dist/components/progress-bar.js +0 -288
- package/dist/components/progress-bar.js.map +0 -1
- package/dist/components/select.d.ts +0 -114
- package/dist/components/select.d.ts.map +0 -1
- package/dist/components/select.js +0 -415
- package/dist/components/select.js.map +0 -1
- package/dist/components/spinner.d.ts +0 -71
- package/dist/components/spinner.d.ts.map +0 -1
- package/dist/components/spinner.js +0 -300
- package/dist/components/spinner.js.map +0 -1
- package/dist/components/split-panel.d.ts +0 -175
- package/dist/components/split-panel.d.ts.map +0 -1
- package/dist/components/split-panel.js +0 -322
- package/dist/components/split-panel.js.map +0 -1
- package/dist/components/table.d.ts +0 -103
- package/dist/components/table.d.ts.map +0 -1
- package/dist/components/table.js +0 -359
- package/dist/components/table.js.map +0 -1
- package/dist/components/text-input.d.ts +0 -79
- package/dist/components/text-input.d.ts.map +0 -1
- package/dist/components/text-input.js +0 -332
- package/dist/components/text-input.js.map +0 -1
- package/dist/design-system/data-display/calendar.d.ts +0 -141
- package/dist/design-system/data-display/calendar.d.ts.map +0 -1
- package/dist/design-system/data-display/calendar.js +0 -524
- package/dist/design-system/data-display/calendar.js.map +0 -1
- package/dist/design-system/data-display/code-block.d.ts +0 -75
- package/dist/design-system/data-display/code-block.d.ts.map +0 -1
- package/dist/design-system/data-display/code-block.js +0 -311
- package/dist/design-system/data-display/code-block.js.map +0 -1
- package/dist/design-system/data-display/data-table.d.ts +0 -173
- package/dist/design-system/data-display/data-table.d.ts.map +0 -1
- package/dist/design-system/data-display/data-table.js +0 -428
- package/dist/design-system/data-display/data-table.js.map +0 -1
- package/dist/design-system/data-display/markdown.d.ts +0 -52
- package/dist/design-system/data-display/markdown.d.ts.map +0 -1
- package/dist/design-system/data-display/markdown.js +0 -341
- package/dist/design-system/data-display/markdown.js.map +0 -1
- package/dist/design-system/data-display/table.d.ts +0 -103
- package/dist/design-system/data-display/table.d.ts.map +0 -1
- package/dist/design-system/data-display/table.js +0 -342
- package/dist/design-system/data-display/table.js.map +0 -1
- package/dist/design-system/data-display/tree.d.ts +0 -166
- package/dist/design-system/data-display/tree.d.ts.map +0 -1
- package/dist/design-system/data-display/tree.js +0 -428
- package/dist/design-system/data-display/tree.js.map +0 -1
- package/dist/design-system/forms/autocomplete.d.ts +0 -163
- package/dist/design-system/forms/autocomplete.d.ts.map +0 -1
- package/dist/design-system/forms/autocomplete.js +0 -455
- package/dist/design-system/forms/autocomplete.js.map +0 -1
- package/dist/design-system/forms/button.d.ts +0 -106
- package/dist/design-system/forms/button.d.ts.map +0 -1
- package/dist/design-system/forms/button.js +0 -170
- package/dist/design-system/forms/button.js.map +0 -1
- package/dist/design-system/forms/multi-select.d.ts +0 -102
- package/dist/design-system/forms/multi-select.d.ts.map +0 -1
- package/dist/design-system/forms/multi-select.js +0 -309
- package/dist/design-system/forms/multi-select.js.map +0 -1
- package/dist/design-system/forms/radio-group.d.ts +0 -88
- package/dist/design-system/forms/radio-group.d.ts.map +0 -1
- package/dist/design-system/forms/radio-group.js +0 -145
- package/dist/design-system/forms/radio-group.js.map +0 -1
- package/dist/design-system/forms/select.d.ts +0 -116
- package/dist/design-system/forms/select.d.ts.map +0 -1
- package/dist/design-system/forms/select.js +0 -441
- package/dist/design-system/forms/select.js.map +0 -1
- package/dist/design-system/forms/slider.d.ts +0 -134
- package/dist/design-system/forms/slider.d.ts.map +0 -1
- package/dist/design-system/forms/slider.js +0 -314
- package/dist/design-system/forms/slider.js.map +0 -1
- package/dist/design-system/forms/switch.d.ts +0 -99
- package/dist/design-system/forms/switch.d.ts.map +0 -1
- package/dist/design-system/forms/switch.js +0 -173
- package/dist/design-system/forms/switch.js.map +0 -1
- package/dist/design-system/forms/text-input.d.ts +0 -79
- package/dist/design-system/forms/text-input.d.ts.map +0 -1
- package/dist/design-system/forms/text-input.js +0 -344
- package/dist/design-system/forms/text-input.js.map +0 -1
- package/dist/design-system/layout/collapsible.d.ts +0 -166
- package/dist/design-system/layout/collapsible.d.ts.map +0 -1
- package/dist/design-system/layout/collapsible.js +0 -286
- package/dist/design-system/layout/collapsible.js.map +0 -1
- package/dist/design-system/layout/scroll-area.d.ts +0 -188
- package/dist/design-system/layout/scroll-area.d.ts.map +0 -1
- package/dist/design-system/layout/scroll-area.js +0 -348
- package/dist/design-system/layout/scroll-area.js.map +0 -1
- package/dist/design-system/layout/split-panel.d.ts +0 -183
- package/dist/design-system/layout/split-panel.d.ts.map +0 -1
- package/dist/design-system/layout/split-panel.js +0 -323
- package/dist/design-system/layout/split-panel.js.map +0 -1
- package/dist/design-system/layout/tabs.d.ts +0 -129
- package/dist/design-system/layout/tabs.d.ts.map +0 -1
- package/dist/design-system/layout/tabs.js +0 -373
- package/dist/design-system/layout/tabs.js.map +0 -1
- package/dist/design-system/overlays/command-palette.d.ts +0 -217
- package/dist/design-system/overlays/command-palette.d.ts.map +0 -1
- package/dist/design-system/overlays/command-palette.js +0 -443
- package/dist/design-system/overlays/command-palette.js.map +0 -1
- package/dist/design-system/overlays/modal.d.ts +0 -251
- package/dist/design-system/overlays/modal.d.ts.map +0 -1
- package/dist/design-system/overlays/modal.js +0 -461
- package/dist/design-system/overlays/modal.js.map +0 -1
- package/dist/design-system/overlays/overlay-stack.d.ts +0 -200
- package/dist/design-system/overlays/overlay-stack.d.ts.map +0 -1
- package/dist/design-system/overlays/overlay-stack.js +0 -341
- package/dist/design-system/overlays/overlay-stack.js.map +0 -1
- package/dist/design-system/primitives/box.d.ts +0 -16
- package/dist/design-system/primitives/box.d.ts.map +0 -1
- package/dist/design-system/primitives/box.js +0 -23
- package/dist/design-system/primitives/box.js.map +0 -1
- package/dist/design-system/primitives/divider.d.ts +0 -52
- package/dist/design-system/primitives/divider.d.ts.map +0 -1
- package/dist/design-system/primitives/divider.js +0 -72
- package/dist/design-system/primitives/divider.js.map +0 -1
- package/dist/design-system/primitives/helpers.d.ts +0 -10
- package/dist/design-system/primitives/helpers.d.ts.map +0 -1
- package/dist/design-system/primitives/helpers.js +0 -27
- package/dist/design-system/primitives/helpers.js.map +0 -1
- package/dist/design-system/primitives/index.d.ts +0 -11
- package/dist/design-system/primitives/index.d.ts.map +0 -1
- package/dist/design-system/primitives/index.js +0 -14
- package/dist/design-system/primitives/index.js.map +0 -1
- package/dist/design-system/primitives/slot.d.ts +0 -35
- package/dist/design-system/primitives/slot.d.ts.map +0 -1
- package/dist/design-system/primitives/slot.js +0 -17
- package/dist/design-system/primitives/slot.js.map +0 -1
- package/dist/design-system/primitives/spacer.d.ts +0 -34
- package/dist/design-system/primitives/spacer.d.ts.map +0 -1
- package/dist/design-system/primitives/spacer.js +0 -53
- package/dist/design-system/primitives/spacer.js.map +0 -1
- package/dist/design-system/primitives/text.d.ts +0 -12
- package/dist/design-system/primitives/text.d.ts.map +0 -1
- package/dist/design-system/primitives/text.js +0 -25
- package/dist/design-system/primitives/text.js.map +0 -1
- package/dist/design-system/primitives/utilities.d.ts +0 -70
- package/dist/design-system/primitives/utilities.d.ts.map +0 -1
- package/dist/design-system/primitives/utilities.js +0 -56
- package/dist/design-system/primitives/utilities.js.map +0 -1
- package/dist/storybook/cli.d.ts +0 -10
- package/dist/storybook/cli.d.ts.map +0 -1
- package/dist/storybook/cli.js +0 -14
- package/dist/storybook/cli.js.map +0 -1
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
import { Box, Text, Spacer } from '../../../primitives/nodes.js';
|
|
14
14
|
import { Divider } from '../../../primitives/divider.js';
|
|
15
15
|
import { story, defaultControls } from '../../core/registry.js';
|
|
16
|
+
import { getContrastColor } from '../../../core/theme.js';
|
|
17
|
+
// Helper for background + contrasting text
|
|
18
|
+
const bgText = (bg, text, props = {}) => Text({ color: getContrastColor(bg), backgroundColor: bg, ...props }, text);
|
|
16
19
|
// ============================================================================
|
|
17
20
|
// Navbars & Headers
|
|
18
21
|
// ============================================================================
|
|
@@ -20,24 +23,32 @@ export const navbarStories = [
|
|
|
20
23
|
story('Navbar - Simple')
|
|
21
24
|
.category('Apps')
|
|
22
25
|
.description('Simple top navigation bar')
|
|
23
|
-
.render(() =>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
.render(() => {
|
|
27
|
+
const bg = 'blue';
|
|
28
|
+
const fg = getContrastColor(bg);
|
|
29
|
+
return Box({
|
|
30
|
+
flexDirection: 'row',
|
|
31
|
+
width: 80,
|
|
32
|
+
backgroundColor: bg,
|
|
33
|
+
paddingX: 2,
|
|
34
|
+
paddingY: 1,
|
|
35
|
+
}, Text({ color: fg, backgroundColor: bg, bold: true }, '🚀 MyApp'), Spacer({}), Box({ flexDirection: 'row', gap: 3 }, Text({ color: 'cyan', backgroundColor: bg }, 'Home'), Text({ color: fg, backgroundColor: bg, dim: true }, 'Files'), Text({ color: fg, backgroundColor: bg, dim: true }, 'Settings'), Text({ color: fg, backgroundColor: bg, dim: true }, 'Help')));
|
|
36
|
+
}),
|
|
30
37
|
story('Navbar - With Search')
|
|
31
38
|
.category('Apps')
|
|
32
39
|
.description('Navigation bar with search input')
|
|
33
|
-
.render(() =>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
.render(() => {
|
|
41
|
+
const bg = 'gray';
|
|
42
|
+
const fg = getContrastColor(bg);
|
|
43
|
+
return Box({
|
|
44
|
+
flexDirection: 'row',
|
|
45
|
+
width: 80,
|
|
46
|
+
backgroundColor: bg,
|
|
47
|
+
paddingX: 2,
|
|
48
|
+
paddingY: 1,
|
|
49
|
+
gap: 2,
|
|
50
|
+
}, Text({ color: fg, backgroundColor: bg, bold: true }, '📦 PackageManager'), Box({ borderStyle: 'single', borderColor: fg, paddingX: 1, flexGrow: 1 }, Text({ color: fg, backgroundColor: bg, dim: true }, '🔍 Search packages...')), Box({ flexDirection: 'row', gap: 2 }, Text({ color: 'cyan', backgroundColor: bg }, 'Browse'), Text({ color: fg, backgroundColor: bg, dim: true }, 'Installed'), Text({ color: fg, backgroundColor: bg, dim: true }, 'Updates')));
|
|
51
|
+
}),
|
|
41
52
|
story('Navbar - Breadcrumb Style')
|
|
42
53
|
.category('Apps')
|
|
43
54
|
.description('Navigation with breadcrumb path')
|
|
@@ -57,15 +68,24 @@ export const navbarStories = [
|
|
|
57
68
|
})
|
|
58
69
|
.render((props) => {
|
|
59
70
|
const tabs = ['📄 index.ts', '📄 app.ts', '📄 utils.ts', '📄 types.ts'];
|
|
71
|
+
const barBg = 'gray';
|
|
72
|
+
const activeBg = 'blue';
|
|
73
|
+
const barFg = getContrastColor(barBg);
|
|
74
|
+
const activeFg = getContrastColor(activeBg);
|
|
60
75
|
return Box({
|
|
61
76
|
flexDirection: 'row',
|
|
62
77
|
width: 80,
|
|
63
|
-
backgroundColor:
|
|
64
|
-
}, ...tabs.map((tab, idx) =>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
78
|
+
backgroundColor: barBg,
|
|
79
|
+
}, ...tabs.map((tab, idx) => {
|
|
80
|
+
const isActive = idx === props.activeTab;
|
|
81
|
+
const bg = isActive ? activeBg : barBg;
|
|
82
|
+
const fg = isActive ? activeFg : barFg;
|
|
83
|
+
return Box({
|
|
84
|
+
paddingX: 2,
|
|
85
|
+
paddingY: 1,
|
|
86
|
+
backgroundColor: bg,
|
|
87
|
+
}, Text({ color: fg, backgroundColor: bg }, tab), isActive ? Text({ color: fg, backgroundColor: bg, dim: true }, ' ×') : null);
|
|
88
|
+
}), Spacer({}), Box({ paddingX: 2, paddingY: 1 }, Text({ color: barFg, backgroundColor: barBg }, '+')));
|
|
69
89
|
}),
|
|
70
90
|
];
|
|
71
91
|
// ============================================================================
|
|
@@ -75,19 +95,23 @@ export const sidebarStories = [
|
|
|
75
95
|
story('Sidebar - File Explorer')
|
|
76
96
|
.category('Apps')
|
|
77
97
|
.description('File explorer sidebar')
|
|
78
|
-
.render(() =>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
.render(() => {
|
|
99
|
+
const headerBg = 'blue';
|
|
100
|
+
const headerFg = getContrastColor(headerBg);
|
|
101
|
+
return Box({
|
|
102
|
+
flexDirection: 'column',
|
|
103
|
+
width: 30,
|
|
104
|
+
height: 20,
|
|
105
|
+
borderStyle: 'single',
|
|
106
|
+
borderColor: 'gray',
|
|
107
|
+
},
|
|
108
|
+
// Header
|
|
109
|
+
Box({ paddingX: 1, backgroundColor: headerBg }, Text({ color: headerFg, backgroundColor: headerBg, bold: true }, 'EXPLORER')),
|
|
110
|
+
// Tree
|
|
111
|
+
Box({ flexDirection: 'column', padding: 1, flexGrow: 1 }, Text({ color: 'yellow' }, '▼ 📁 tuiuiu'), Text({ color: 'gray' }, ' ▼ 📁 src'), Text({ color: 'cyan' }, ' ▶ 📁 components'), Text({ color: 'cyan' }, ' ▶ 📁 core'), Text({ inverse: true }, ' 📄 index.ts'), Text({}, ' 📄 types.ts'), Text({ color: 'gray' }, ' ▼ 📁 tests'), Text({}, ' 📄 app.test.ts'), Text({}, ' 📄 package.json'), Text({}, ' 📄 README.md'), Spacer({})),
|
|
112
|
+
// Footer
|
|
113
|
+
Box({ paddingX: 1, borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'gray', dim: true }, '12 files, 4 folders')));
|
|
114
|
+
}),
|
|
91
115
|
story('Sidebar - Navigation Menu')
|
|
92
116
|
.category('Apps')
|
|
93
117
|
.description('Navigation menu sidebar')
|
|
@@ -102,6 +126,8 @@ export const sidebarStories = [
|
|
|
102
126
|
{ icon: '📁', label: 'Files' },
|
|
103
127
|
{ icon: '⚙️', label: 'Settings' },
|
|
104
128
|
];
|
|
129
|
+
const activeBg = 'cyan';
|
|
130
|
+
const activeFg = getContrastColor(activeBg);
|
|
105
131
|
return Box({
|
|
106
132
|
flexDirection: 'column',
|
|
107
133
|
width: 25,
|
|
@@ -112,11 +138,16 @@ export const sidebarStories = [
|
|
|
112
138
|
// Logo
|
|
113
139
|
Box({ paddingX: 2, paddingY: 1, borderStyle: 'single', borderColor: 'cyan' }, Text({ color: 'cyan', bold: true }, '🚀 MyApp')),
|
|
114
140
|
// Menu items
|
|
115
|
-
Box({ flexDirection: 'column', padding: 1, flexGrow: 1 }, ...items.map((item, idx) =>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
141
|
+
Box({ flexDirection: 'column', padding: 1, flexGrow: 1 }, ...items.map((item, idx) => {
|
|
142
|
+
const isActive = idx === props.activeItem;
|
|
143
|
+
const bg = isActive ? activeBg : undefined;
|
|
144
|
+
const fg = isActive ? activeFg : 'gray';
|
|
145
|
+
return Box({
|
|
146
|
+
paddingX: 1,
|
|
147
|
+
paddingY: 0,
|
|
148
|
+
backgroundColor: bg,
|
|
149
|
+
}, Text({ color: fg, backgroundColor: bg }, `${item.icon} ${item.label}`));
|
|
150
|
+
}), Spacer({})),
|
|
120
151
|
// User
|
|
121
152
|
Box({ paddingX: 1, borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'gray' }, '👤 john@example.com')));
|
|
122
153
|
}),
|
|
@@ -149,25 +180,33 @@ export const statusBarStories = [
|
|
|
149
180
|
story('StatusBar - Editor Style')
|
|
150
181
|
.category('Apps')
|
|
151
182
|
.description('VS Code-style status bar')
|
|
152
|
-
.render(() =>
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
183
|
+
.render(() => {
|
|
184
|
+
const bg = 'blue';
|
|
185
|
+
const fg = getContrastColor(bg);
|
|
186
|
+
return Box({
|
|
187
|
+
flexDirection: 'row',
|
|
188
|
+
width: 80,
|
|
189
|
+
backgroundColor: bg,
|
|
190
|
+
paddingX: 1,
|
|
191
|
+
},
|
|
192
|
+
// Left section
|
|
193
|
+
Box({ flexDirection: 'row', gap: 2 }, Text({ color: fg, backgroundColor: bg }, '⎇ main'), Text({ color: fg, backgroundColor: bg }, '↻ 0 ↓ 0'), Text({ color: 'yellow', backgroundColor: bg }, '⚠ 2'), Text({ color: 'red', backgroundColor: bg }, '✗ 1')), Spacer({}),
|
|
194
|
+
// Right section
|
|
195
|
+
Box({ flexDirection: 'row', gap: 2 }, Text({ color: fg, backgroundColor: bg }, 'Ln 42, Col 15'), Text({ color: fg, backgroundColor: bg }, 'UTF-8'), Text({ color: fg, backgroundColor: bg }, 'LF'), Text({ color: fg, backgroundColor: bg }, 'TypeScript'), Text({ color: fg, backgroundColor: bg }, '⚡ Prettier')));
|
|
196
|
+
}),
|
|
162
197
|
story('StatusBar - Terminal Style')
|
|
163
198
|
.category('Apps')
|
|
164
199
|
.description('Terminal-style status bar')
|
|
165
|
-
.render(() =>
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
200
|
+
.render(() => {
|
|
201
|
+
const bg = 'gray';
|
|
202
|
+
const fg = getContrastColor(bg);
|
|
203
|
+
return Box({
|
|
204
|
+
flexDirection: 'row',
|
|
205
|
+
width: 80,
|
|
206
|
+
backgroundColor: bg,
|
|
207
|
+
paddingX: 1,
|
|
208
|
+
}, Box({ flexDirection: 'row', gap: 2 }, Text({ color: 'green', backgroundColor: bg }, '●'), Text({ color: fg, backgroundColor: bg }, 'zsh'), Text({ color: 'cyan', backgroundColor: bg }, '~/projects/tuiuiu')), Spacer({}), Box({ flexDirection: 'row', gap: 2 }, Text({ color: 'yellow', backgroundColor: bg }, '⏱ 0.52s'), Text({ color: fg, backgroundColor: bg }, '🕐 14:32:15')));
|
|
209
|
+
}),
|
|
171
210
|
story('StatusBar - Progress')
|
|
172
211
|
.category('Apps')
|
|
173
212
|
.description('Status bar with progress indicator')
|
|
@@ -181,21 +220,31 @@ export const statusBarStories = [
|
|
|
181
220
|
story('StatusBar - Multi-Section')
|
|
182
221
|
.category('Apps')
|
|
183
222
|
.description('Status bar with multiple sections')
|
|
184
|
-
.render(() =>
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
223
|
+
.render(() => {
|
|
224
|
+
const baseBg = 'gray';
|
|
225
|
+
const baseFg = getContrastColor(baseBg);
|
|
226
|
+
const modeBg = 'green';
|
|
227
|
+
const modeFg = getContrastColor(modeBg);
|
|
228
|
+
const posBg = 'blue';
|
|
229
|
+
const posFg = getContrastColor(posBg);
|
|
230
|
+
const pctBg = 'cyan';
|
|
231
|
+
const pctFg = getContrastColor(pctBg);
|
|
232
|
+
return Box({
|
|
233
|
+
flexDirection: 'row',
|
|
234
|
+
width: 80,
|
|
235
|
+
backgroundColor: baseBg,
|
|
236
|
+
},
|
|
237
|
+
// Mode indicator
|
|
238
|
+
Box({ backgroundColor: modeBg, paddingX: 1 }, Text({ color: modeFg, backgroundColor: modeBg, bold: true }, 'NORMAL')),
|
|
239
|
+
// File info
|
|
240
|
+
Box({ paddingX: 2 }, Text({ color: baseFg, backgroundColor: baseBg }, '📄 index.ts')),
|
|
241
|
+
// Modified indicator
|
|
242
|
+
Box({ paddingX: 1 }, Text({ color: 'yellow', backgroundColor: baseBg }, '[+]')), Spacer({}),
|
|
243
|
+
// Position
|
|
244
|
+
Box({ backgroundColor: posBg, paddingX: 1 }, Text({ color: posFg, backgroundColor: posBg }, '42:15')),
|
|
245
|
+
// Percentage
|
|
246
|
+
Box({ backgroundColor: pctBg, paddingX: 1 }, Text({ color: pctFg, backgroundColor: pctBg }, '68%')));
|
|
247
|
+
}),
|
|
199
248
|
];
|
|
200
249
|
// ============================================================================
|
|
201
250
|
// Command Interfaces
|
|
@@ -246,7 +295,11 @@ export const commandStories = [
|
|
|
246
295
|
borderStyle: 'single',
|
|
247
296
|
borderColor: 'gray',
|
|
248
297
|
marginTop: 0,
|
|
249
|
-
},
|
|
298
|
+
}, (() => {
|
|
299
|
+
const selBg = 'blue';
|
|
300
|
+
const selFg = getContrastColor(selBg);
|
|
301
|
+
return Box({ backgroundColor: selBg, paddingX: 1 }, Text({ color: selFg, backgroundColor: selBg }, 'checkout'), Text({ color: selFg, backgroundColor: selBg, dim: true }, ' Switch branches'));
|
|
302
|
+
})(), Box({ paddingX: 1 }, Text({ color: 'gray' }, 'cherry-pick'), Text({ color: 'gray', dim: true }, ' Apply commits')), Box({ paddingX: 1 }, Text({ color: 'gray' }, 'cherry'), Text({ color: 'gray', dim: true }, ' Find commits'))))),
|
|
250
303
|
story('Command - Palette')
|
|
251
304
|
.category('Apps')
|
|
252
305
|
.description('Command palette with keyboard shortcuts')
|
|
@@ -259,7 +312,11 @@ export const commandStories = [
|
|
|
259
312
|
// Search
|
|
260
313
|
Box({ paddingX: 2, paddingY: 1, borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'gray' }, '> '), Text({ color: 'white' }, 'file'), Text({ color: 'cyan' }, '▋')),
|
|
261
314
|
// Results
|
|
262
|
-
Box({ flexDirection: 'column', padding: 1 },
|
|
315
|
+
Box({ flexDirection: 'column', padding: 1 }, (() => {
|
|
316
|
+
const selBg = 'blue';
|
|
317
|
+
const selFg = getContrastColor(selBg);
|
|
318
|
+
return Box({ backgroundColor: selBg, paddingX: 1, flexDirection: 'row' }, Text({ color: selFg, backgroundColor: selBg }, '📄 New File'), Spacer({}), Text({ color: selFg, backgroundColor: selBg, dim: true }, 'Ctrl+N'));
|
|
319
|
+
})(), Box({ paddingX: 1, flexDirection: 'row' }, Text({ color: 'gray' }, '📂 Open File'), Spacer({}), Text({ color: 'gray' }, 'Ctrl+O')), Box({ paddingX: 1, flexDirection: 'row' }, Text({ color: 'gray' }, '💾 Save File'), Spacer({}), Text({ color: 'gray' }, 'Ctrl+S')), Box({ paddingX: 1, flexDirection: 'row' }, Text({ color: 'gray' }, '📋 Save All Files'), Spacer({}), Text({ color: 'gray' }, 'Ctrl+Shift+S'))),
|
|
263
320
|
// Footer
|
|
264
321
|
Box({ paddingX: 1, borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'gray', dim: true }, '↑↓ Navigate ↵ Select Esc Close')))),
|
|
265
322
|
];
|
|
@@ -270,155 +327,195 @@ export const appShellStories = [
|
|
|
270
327
|
story('Shell - Editor')
|
|
271
328
|
.category('Apps')
|
|
272
329
|
.description('Complete code editor layout')
|
|
273
|
-
.render(() =>
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
330
|
+
.render(() => {
|
|
331
|
+
const tabBarBg = 'gray';
|
|
332
|
+
const tabBarFg = getContrastColor(tabBarBg);
|
|
333
|
+
const activeTabBg = 'blue';
|
|
334
|
+
const activeTabFg = getContrastColor(activeTabBg);
|
|
335
|
+
const sidebarHeaderBg = 'gray';
|
|
336
|
+
const sidebarHeaderFg = getContrastColor(sidebarHeaderBg);
|
|
337
|
+
const statusBg = 'blue';
|
|
338
|
+
const statusFg = getContrastColor(statusBg);
|
|
339
|
+
return Box({
|
|
340
|
+
flexDirection: 'column',
|
|
341
|
+
width: 80,
|
|
342
|
+
height: 24,
|
|
343
|
+
},
|
|
344
|
+
// Top bar (tabs)
|
|
345
|
+
Box({ flexDirection: 'row', backgroundColor: tabBarBg }, Box({ paddingX: 2, backgroundColor: activeTabBg }, Text({ color: activeTabFg, backgroundColor: activeTabBg }, '📄 index.ts ×')), Box({ paddingX: 2 }, Text({ color: tabBarFg, backgroundColor: tabBarBg }, '📄 app.ts')), Box({ paddingX: 2 }, Text({ color: tabBarFg, backgroundColor: tabBarBg }, '📄 utils.ts')), Spacer({})),
|
|
346
|
+
// Main content
|
|
347
|
+
Box({ flexDirection: 'row', flexGrow: 1 },
|
|
348
|
+
// Sidebar
|
|
349
|
+
Box({
|
|
350
|
+
width: 25,
|
|
351
|
+
flexDirection: 'column',
|
|
352
|
+
borderStyle: 'single',
|
|
353
|
+
borderColor: 'gray',
|
|
354
|
+
}, Box({ paddingX: 1, backgroundColor: sidebarHeaderBg }, Text({ color: sidebarHeaderFg, backgroundColor: sidebarHeaderBg }, 'EXPLORER')), Box({ padding: 1, flexDirection: 'column', flexGrow: 1 }, Text({ color: 'yellow' }, '▼ 📁 src'), Text({ inverse: true }, ' 📄 index.ts'), Text({}, ' 📄 app.ts'), Text({}, ' 📄 utils.ts'), Text({ color: 'cyan' }, '▶ 📁 tests'), Spacer({}))),
|
|
355
|
+
// Editor area
|
|
356
|
+
Box({
|
|
357
|
+
flexGrow: 1,
|
|
358
|
+
flexDirection: 'column',
|
|
359
|
+
borderStyle: 'single',
|
|
360
|
+
borderColor: 'gray',
|
|
361
|
+
}, Box({ padding: 1, flexGrow: 1, flexDirection: 'column' }, Text({ color: 'gray' }, ' 1 '), Text({}, ''), Box({ flexDirection: 'row' }, Text({ color: 'gray' }, ' 2 '), Text({ color: 'magenta' }, 'import '), Text({ color: 'cyan' }, '{ App }'), Text({ color: 'magenta' }, ' from '), Text({ color: 'green' }, "'./app'")), Box({ flexDirection: 'row' }, Text({ color: 'gray' }, ' 3 '), Text({})), Box({ flexDirection: 'row' }, Text({ color: 'gray' }, ' 4 '), Text({ color: 'magenta' }, 'export '), Text({ color: 'cyan' }, 'function '), Text({ color: 'yellow' }, 'main'), Text({}, '() {')), Box({ flexDirection: 'row' }, Text({ color: 'gray' }, ' 5 '), Text({}, ' '), Text({ color: 'cyan' }, 'const '), Text({}, 'app = '), Text({ color: 'magenta' }, 'new '), Text({ color: 'yellow' }, 'App'), Text({}, '()▋')), Spacer({})))),
|
|
362
|
+
// Status bar
|
|
363
|
+
Box({ flexDirection: 'row', backgroundColor: statusBg, paddingX: 1 }, Text({ color: statusFg, backgroundColor: statusBg }, '⎇ main'), Text({ color: statusFg, backgroundColor: statusBg }, ' ✓ 0 ⚠ 0'), Spacer({}), Text({ color: statusFg, backgroundColor: statusBg }, 'Ln 5, Col 28'), Text({ color: statusFg, backgroundColor: statusBg }, ' TypeScript')));
|
|
364
|
+
}),
|
|
298
365
|
story('Shell - Dashboard')
|
|
299
366
|
.category('Apps')
|
|
300
367
|
.description('Dashboard application layout')
|
|
301
|
-
.render(() =>
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
368
|
+
.render(() => {
|
|
369
|
+
const headerBg = 'blue';
|
|
370
|
+
const headerFg = getContrastColor(headerBg);
|
|
371
|
+
const activeBg = 'cyan';
|
|
372
|
+
const activeFg = getContrastColor(activeBg);
|
|
373
|
+
const footerBg = 'gray';
|
|
374
|
+
const footerFg = getContrastColor(footerBg);
|
|
375
|
+
return Box({
|
|
376
|
+
flexDirection: 'column',
|
|
377
|
+
width: 80,
|
|
378
|
+
height: 24,
|
|
379
|
+
},
|
|
380
|
+
// Header
|
|
381
|
+
Box({ flexDirection: 'row', backgroundColor: headerBg, paddingX: 2, paddingY: 1 }, Text({ color: headerFg, backgroundColor: headerBg, bold: true }, '📊 Analytics Dashboard'), Spacer({}), Text({ color: 'cyan', backgroundColor: headerBg }, '🔔 3'), Text({ color: headerFg, backgroundColor: headerBg }, ' 👤 Admin')),
|
|
382
|
+
// Main content
|
|
383
|
+
Box({ flexDirection: 'row', flexGrow: 1 },
|
|
384
|
+
// Sidebar
|
|
385
|
+
Box({
|
|
386
|
+
width: 20,
|
|
387
|
+
flexDirection: 'column',
|
|
388
|
+
borderStyle: 'single',
|
|
389
|
+
borderColor: 'gray',
|
|
390
|
+
padding: 1,
|
|
391
|
+
}, Box({ backgroundColor: activeBg, paddingX: 1 }, Text({ color: activeFg, backgroundColor: activeBg }, '🏠 Overview')), Text({ color: 'gray' }, '📈 Analytics'), Text({ color: 'gray' }, '👥 Users'), Text({ color: 'gray' }, '💰 Revenue'), Text({ color: 'gray' }, '📦 Products'), Spacer({}), Divider({ color: 'gray' }), Text({ color: 'gray' }, '⚙️ Settings')),
|
|
392
|
+
// Content area
|
|
393
|
+
Box({
|
|
394
|
+
flexGrow: 1,
|
|
395
|
+
flexDirection: 'column',
|
|
396
|
+
padding: 1,
|
|
397
|
+
gap: 1,
|
|
398
|
+
},
|
|
399
|
+
// Stats row
|
|
400
|
+
Box({ flexDirection: 'row', gap: 1 }, Box({ borderStyle: 'round', borderColor: 'cyan', padding: 1, flexGrow: 1 }, Text({ color: 'gray', dim: true }, 'Users'), Text({}, ''), Text({ color: 'cyan', bold: true }, '12,543')), Box({ borderStyle: 'round', borderColor: 'green', padding: 1, flexGrow: 1 }, Text({ color: 'gray', dim: true }, 'Revenue'), Text({}, ''), Text({ color: 'green', bold: true }, '$45.2k')), Box({ borderStyle: 'round', borderColor: 'yellow', padding: 1, flexGrow: 1 }, Text({ color: 'gray', dim: true }, 'Orders'), Text({}, ''), Text({ color: 'yellow', bold: true }, '892'))),
|
|
401
|
+
// Chart area
|
|
402
|
+
Box({
|
|
403
|
+
borderStyle: 'single',
|
|
404
|
+
borderColor: 'gray',
|
|
405
|
+
padding: 1,
|
|
406
|
+
flexGrow: 1,
|
|
407
|
+
}, Box({ flexDirection: 'column' }, Text({ color: 'white', bold: true }, 'Traffic Overview'), Text({}), Text({ color: 'cyan' }, ' ▂▃▅▇█▇▅▃▂▃▅▇█▇▅▃▂'), Text({ color: 'gray' }, ' 0 ─┼─────────────────────'), Text({ color: 'gray', dim: true }, ' Mon Tue Wed Thu Fri'))))),
|
|
408
|
+
// Footer
|
|
409
|
+
Box({ flexDirection: 'row', backgroundColor: footerBg, paddingX: 1 }, Text({ color: footerFg, backgroundColor: footerBg }, '● Connected'), Spacer({}), Text({ color: footerFg, backgroundColor: footerBg, dim: true }, 'Last updated: 2 min ago')));
|
|
410
|
+
}),
|
|
336
411
|
story('Shell - Terminal')
|
|
337
412
|
.category('Apps')
|
|
338
413
|
.description('Terminal emulator layout')
|
|
339
|
-
.render(() =>
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
414
|
+
.render(() => {
|
|
415
|
+
const titleBg = 'gray';
|
|
416
|
+
const titleFg = getContrastColor(titleBg);
|
|
417
|
+
const terminalBg = 'black';
|
|
418
|
+
const terminalFg = getContrastColor(terminalBg);
|
|
419
|
+
return Box({
|
|
420
|
+
flexDirection: 'column',
|
|
421
|
+
width: 80,
|
|
422
|
+
height: 20,
|
|
423
|
+
borderStyle: 'single',
|
|
424
|
+
borderColor: 'gray',
|
|
425
|
+
},
|
|
426
|
+
// Title bar
|
|
427
|
+
Box({ flexDirection: 'row', backgroundColor: titleBg, paddingX: 1 }, Text({ color: 'red', backgroundColor: titleBg }, '● '), Text({ color: 'yellow', backgroundColor: titleBg }, '● '), Text({ color: 'green', backgroundColor: titleBg }, '● '), Spacer({}), Text({ color: titleFg, backgroundColor: titleBg }, 'Terminal — zsh'), Spacer({}), Text({ color: 'gray' }, ' ')),
|
|
428
|
+
// Terminal content
|
|
429
|
+
Box({ flexDirection: 'column', padding: 1, flexGrow: 1, backgroundColor: 'black' }, Box({ flexDirection: 'row' }, Text({ color: 'green' }, '➜ '), Text({ color: 'cyan' }, '~/projects/tuiuiu '), Text({ color: 'blue' }, 'git:('), Text({ color: 'red' }, 'main'), Text({ color: 'blue' }, ') '), Text({ color: 'yellow' }, '✗ ')), Box({ flexDirection: 'row' }, Text({ color: 'white' }, 'npm test')), Text({}), Text({ color: 'gray' }, '> tuiuiu@0.1.0 test'), Text({ color: 'gray' }, '> vitest'), Text({}), Text({ color: 'green' }, ' ✓ tests/core/signal.test.ts (24 tests) 3ms'), Text({ color: 'green' }, ' ✓ tests/core/layout.test.ts (18 tests) 5ms'), Text({ color: 'green' }, ' ✓ tests/hooks/hooks.test.ts (12 tests) 4ms'), Text({}), Text({ color: 'green', bold: true }, ' Test Files 3 passed (3)'), Text({ color: 'green', bold: true }, ' Tests 54 passed (54)'), Spacer({}), Box({ flexDirection: 'row' }, Text({ color: 'green', backgroundColor: terminalBg }, '➜ '), Text({ color: 'cyan', backgroundColor: terminalBg }, '~/projects/tuiuiu '), Text({ color: terminalFg, backgroundColor: terminalBg }, '▋'))));
|
|
430
|
+
}),
|
|
350
431
|
story('Shell - File Manager')
|
|
351
432
|
.category('Apps')
|
|
352
433
|
.description('Dual-pane file manager layout')
|
|
353
|
-
.render(() =>
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
flexDirection: '
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
434
|
+
.render(() => {
|
|
435
|
+
const menuBg = 'cyan';
|
|
436
|
+
const menuFg = getContrastColor(menuBg);
|
|
437
|
+
const activePaneBg = 'blue';
|
|
438
|
+
const activePaneFg = getContrastColor(activePaneBg);
|
|
439
|
+
const inactivePaneBg = 'gray';
|
|
440
|
+
const inactivePaneFg = getContrastColor(inactivePaneBg);
|
|
441
|
+
const fnKeyBg = 'blue';
|
|
442
|
+
const fnKeyFg = getContrastColor(fnKeyBg);
|
|
443
|
+
const fnKeyHighBg = 'cyan';
|
|
444
|
+
const fnKeyHighFg = getContrastColor(fnKeyHighBg);
|
|
445
|
+
return Box({
|
|
446
|
+
flexDirection: 'column',
|
|
447
|
+
width: 80,
|
|
448
|
+
height: 20,
|
|
449
|
+
},
|
|
450
|
+
// Menu bar
|
|
451
|
+
Box({ flexDirection: 'row', backgroundColor: menuBg, paddingX: 1 }, Text({ color: menuFg, backgroundColor: menuBg }, 'File'), Text({ color: menuFg, backgroundColor: menuBg }, ' Edit'), Text({ color: menuFg, backgroundColor: menuBg }, ' View'), Text({ color: menuFg, backgroundColor: menuBg }, ' Go'), Text({ color: menuFg, backgroundColor: menuBg }, ' Help'), Spacer({})),
|
|
452
|
+
// Dual pane
|
|
453
|
+
Box({ flexDirection: 'row', flexGrow: 1 },
|
|
454
|
+
// Left pane (active)
|
|
455
|
+
Box({
|
|
456
|
+
width: 40,
|
|
457
|
+
flexDirection: 'column',
|
|
458
|
+
borderStyle: 'single',
|
|
459
|
+
borderColor: 'cyan',
|
|
460
|
+
}, Box({ paddingX: 1, backgroundColor: activePaneBg }, Text({ color: activePaneFg, backgroundColor: activePaneBg }, '~/Documents')), Box({ flexDirection: 'column', padding: 1, flexGrow: 1 }, Text({ color: 'yellow' }, '.. <DIR>'), Text({ color: 'yellow' }, 'projects <DIR>'), Text({ inverse: true }, 'notes.txt 4.2K'), Text({}, 'budget.xlsx 12.8K'), Text({}, 'resume.pdf 89.3K'), Spacer({})), Box({ paddingX: 1, backgroundColor: inactivePaneBg }, Text({ color: inactivePaneFg, backgroundColor: inactivePaneBg }, '5 files, 106.3K'))),
|
|
461
|
+
// Right pane (inactive)
|
|
462
|
+
Box({
|
|
463
|
+
width: 40,
|
|
464
|
+
flexDirection: 'column',
|
|
465
|
+
borderStyle: 'single',
|
|
466
|
+
borderColor: 'gray',
|
|
467
|
+
}, Box({ paddingX: 1, backgroundColor: inactivePaneBg }, Text({ color: inactivePaneFg, backgroundColor: inactivePaneBg }, '~/Downloads')), Box({ flexDirection: 'column', padding: 1, flexGrow: 1 }, Text({ color: 'yellow' }, '.. <DIR>'), Text({}, 'image.png 256.4K'), Text({}, 'setup.exe 1.2M'), Text({}, 'data.json 34.1K'), Spacer({})), Box({ paddingX: 1, backgroundColor: inactivePaneBg }, Text({ color: inactivePaneFg, backgroundColor: inactivePaneBg }, '3 files, 1.5M')))),
|
|
468
|
+
// Function key bar
|
|
469
|
+
Box({ flexDirection: 'row', backgroundColor: fnKeyBg }, Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, ' 1'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'Help '), Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, '2'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'Menu '), Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, '3'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'View '), Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, '4'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'Edit '), Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, '5'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'Copy '), Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, '6'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'Move '), Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, '7'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'Mkdir'), Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, '8'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'Del '), Text({ color: fnKeyHighFg, backgroundColor: fnKeyHighBg }, '10'), Text({ color: fnKeyFg, backgroundColor: fnKeyBg }, 'Quit')));
|
|
470
|
+
}),
|
|
378
471
|
story('Shell - Chat App')
|
|
379
472
|
.category('Apps')
|
|
380
473
|
.description('Chat application layout')
|
|
381
|
-
.render(() =>
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
474
|
+
.render(() => {
|
|
475
|
+
const sentBg = 'cyan';
|
|
476
|
+
const sentFg = getContrastColor(sentBg);
|
|
477
|
+
return Box({
|
|
478
|
+
flexDirection: 'column',
|
|
479
|
+
width: 70,
|
|
480
|
+
height: 20,
|
|
481
|
+
borderStyle: 'round',
|
|
482
|
+
borderColor: 'cyan',
|
|
483
|
+
},
|
|
484
|
+
// Header
|
|
485
|
+
Box({ flexDirection: 'row', paddingX: 2, paddingY: 1, borderStyle: 'single', borderColor: 'gray' }, Text({ color: 'green' }, '● '), Text({ color: 'white', bold: true }, 'Alice'), Text({ color: 'gray', dim: true }, ' Online'), Spacer({}), Text({ color: 'gray' }, '📞 📹 ⋮')),
|
|
486
|
+
// Messages
|
|
487
|
+
Box({ flexDirection: 'column', padding: 1, flexGrow: 1 },
|
|
488
|
+
// Received message
|
|
489
|
+
Box({ flexDirection: 'column', marginBottom: 1 }, Box({
|
|
490
|
+
borderStyle: 'round',
|
|
491
|
+
borderColor: 'gray',
|
|
492
|
+
paddingX: 1,
|
|
493
|
+
alignSelf: 'flex-start',
|
|
494
|
+
}, Text({}, 'Hey! How is the TUI coming along?')), Text({ color: 'gray', dim: true }, '10:30 AM')),
|
|
495
|
+
// Sent message
|
|
496
|
+
Box({ flexDirection: 'column', alignItems: 'flex-end', marginBottom: 1 }, Box({
|
|
497
|
+
borderStyle: 'round',
|
|
498
|
+
borderColor: sentBg,
|
|
499
|
+
backgroundColor: sentBg,
|
|
500
|
+
paddingX: 1,
|
|
501
|
+
}, Text({ color: sentFg, backgroundColor: sentBg }, "It's going great! Almost done 🎉")), Text({ color: 'gray', dim: true }, '10:32 AM ✓✓')),
|
|
502
|
+
// Received
|
|
503
|
+
Box({ flexDirection: 'column' }, Box({
|
|
504
|
+
borderStyle: 'round',
|
|
505
|
+
borderColor: 'gray',
|
|
506
|
+
paddingX: 1,
|
|
507
|
+
alignSelf: 'flex-start',
|
|
508
|
+
}, Text({}, "Awesome! Can't wait to try it!")), Text({ color: 'gray', dim: true }, '10:33 AM')), Spacer({})),
|
|
509
|
+
// Input
|
|
510
|
+
Box({
|
|
511
|
+
flexDirection: 'row',
|
|
512
|
+
paddingX: 1,
|
|
513
|
+
paddingY: 1,
|
|
514
|
+
borderStyle: 'single',
|
|
515
|
+
borderColor: 'gray',
|
|
516
|
+
gap: 1,
|
|
517
|
+
}, Text({ color: 'gray' }, '📎'), Box({ flexGrow: 1, borderStyle: 'single', borderColor: 'gray', paddingX: 1 }, Text({ color: 'gray', dim: true }, 'Type a message...')), Text({ color: 'gray' }, '😊'), Text({ color: 'cyan' }, '➤')));
|
|
518
|
+
}),
|
|
422
519
|
];
|
|
423
520
|
/**
|
|
424
521
|
* All app stories
|