@contui/ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +30 -0
- package/README.md +150 -2
- package/cli/contui.mjs +250 -0
- package/dist/charts/area-chart.d.ts +8 -0
- package/dist/charts/area-chart.js +9 -0
- package/dist/charts/bar-chart.d.ts +9 -0
- package/dist/charts/bar-chart.js +10 -0
- package/dist/charts/bubble-chart.d.ts +60 -0
- package/dist/charts/bubble-chart.js +392 -0
- package/dist/charts/bullet-chart.d.ts +53 -0
- package/dist/charts/bullet-chart.js +123 -0
- package/dist/charts/candlestick-chart.d.ts +77 -0
- package/dist/charts/candlestick-chart.js +558 -0
- package/dist/charts/cartesian.d.ts +121 -0
- package/dist/charts/cartesian.js +625 -0
- package/dist/charts/chart-card.d.ts +80 -0
- package/dist/charts/chart-card.js +114 -0
- package/dist/charts/donut-chart.d.ts +40 -0
- package/dist/charts/donut-chart.js +88 -0
- package/dist/charts/funnel-chart.d.ts +16 -0
- package/dist/charts/funnel-chart.js +164 -0
- package/dist/charts/horizontal-bar-chart.d.ts +67 -0
- package/dist/charts/horizontal-bar-chart.js +481 -0
- package/dist/charts/index.d.ts +21 -0
- package/dist/charts/index.js +32 -0
- package/dist/charts/legend.d.ts +23 -0
- package/dist/charts/legend.js +22 -0
- package/dist/charts/lib/candlestick-window.d.ts +15 -0
- package/dist/charts/lib/candlestick-window.js +23 -0
- package/dist/charts/lib/color.d.ts +39 -0
- package/dist/charts/lib/color.js +83 -0
- package/dist/charts/lib/format.d.ts +11 -0
- package/dist/charts/lib/format.js +33 -0
- package/dist/charts/lib/frame.d.ts +6 -0
- package/dist/charts/lib/frame.js +6 -0
- package/dist/charts/lib/layout.d.ts +11 -0
- package/dist/charts/lib/layout.js +71 -0
- package/dist/charts/lib/path.d.ts +35 -0
- package/dist/charts/lib/path.js +203 -0
- package/dist/charts/lib/scale.d.ts +41 -0
- package/dist/charts/lib/scale.js +80 -0
- package/dist/charts/lib/use-active.d.ts +18 -0
- package/dist/charts/lib/use-active.js +71 -0
- package/dist/charts/lib/use-size.d.ts +9 -0
- package/dist/charts/lib/use-size.js +40 -0
- package/dist/charts/line-chart.d.ts +7 -0
- package/dist/charts/line-chart.js +8 -0
- package/dist/charts/radar-chart.d.ts +27 -0
- package/dist/charts/radar-chart.js +165 -0
- package/dist/charts/rose-chart.d.ts +35 -0
- package/dist/charts/rose-chart.js +242 -0
- package/dist/charts/sparkline.d.ts +35 -0
- package/dist/charts/sparkline.js +110 -0
- package/dist/charts/tooltip.d.ts +35 -0
- package/dist/charts/tooltip.js +22 -0
- package/dist/charts/treemap.d.ts +28 -0
- package/dist/charts/treemap.js +103 -0
- package/dist/charts/uptime-strip.d.ts +40 -0
- package/dist/charts/uptime-strip.js +178 -0
- package/dist/components/accordion.d.ts +31 -0
- package/dist/components/accordion.js +34 -0
- package/dist/components/activity-item.d.ts +12 -0
- package/dist/components/activity-item.js +6 -0
- package/dist/components/alert.d.ts +21 -0
- package/dist/components/alert.js +58 -0
- package/dist/components/assistant-answer.d.ts +52 -0
- package/dist/components/assistant-answer.js +40 -0
- package/dist/components/assistant-prompt.d.ts +63 -0
- package/dist/components/assistant-prompt.js +122 -0
- package/dist/components/avatar.d.ts +28 -0
- package/dist/components/avatar.js +75 -0
- package/dist/components/badge.d.ts +16 -0
- package/dist/components/badge.js +33 -0
- package/dist/components/bar-list.d.ts +65 -0
- package/dist/components/bar-list.js +119 -0
- package/dist/components/block-slider.d.ts +43 -0
- package/dist/components/block-slider.js +63 -0
- package/dist/components/branch-graph.d.ts +87 -0
- package/dist/components/branch-graph.js +231 -0
- package/dist/components/breadcrumb.d.ts +41 -0
- package/dist/components/breadcrumb.js +53 -0
- package/dist/components/button.d.ts +23 -0
- package/dist/components/button.js +108 -0
- package/dist/components/calendar.d.ts +5 -0
- package/dist/components/calendar.js +90 -0
- package/dist/components/card.d.ts +65 -0
- package/dist/components/card.js +104 -0
- package/dist/components/chat-attachment.d.ts +47 -0
- package/dist/components/chat-attachment.js +63 -0
- package/dist/components/chat-event.d.ts +7 -0
- package/dist/components/chat-event.js +7 -0
- package/dist/components/chat-message.d.ts +59 -0
- package/dist/components/chat-message.js +91 -0
- package/dist/components/chat-reference.d.ts +20 -0
- package/dist/components/chat-reference.js +41 -0
- package/dist/components/chat-shared.d.ts +21 -0
- package/dist/components/chat-shared.js +23 -0
- package/dist/components/chat-suggestions.d.ts +59 -0
- package/dist/components/chat-suggestions.js +88 -0
- package/dist/components/chat-thread.d.ts +39 -0
- package/dist/components/chat-thread.js +172 -0
- package/dist/components/chat-typing.d.ts +35 -0
- package/dist/components/chat-typing.js +66 -0
- package/dist/components/checkbox.d.ts +18 -0
- package/dist/components/checkbox.js +33 -0
- package/dist/components/checklist.d.ts +26 -0
- package/dist/components/checklist.js +18 -0
- package/dist/components/chip.d.ts +29 -0
- package/dist/components/chip.js +61 -0
- package/dist/components/code-input.d.ts +40 -0
- package/dist/components/code-input.js +285 -0
- package/dist/components/color-picker.d.ts +38 -0
- package/dist/components/color-picker.js +855 -0
- package/dist/components/combobox.d.ts +75 -0
- package/dist/components/combobox.js +112 -0
- package/dist/components/command-menu.d.ts +58 -0
- package/dist/components/command-menu.js +166 -0
- package/dist/components/copy-button.d.ts +16 -0
- package/dist/components/copy-button.js +31 -0
- package/dist/components/data-grid.d.ts +50 -0
- package/dist/components/data-grid.js +599 -0
- package/dist/components/date-picker.d.ts +109 -0
- package/dist/components/date-picker.js +268 -0
- package/dist/components/description-list.d.ts +12 -0
- package/dist/components/description-list.js +10 -0
- package/dist/components/dialog.d.ts +57 -0
- package/dist/components/dialog.js +140 -0
- package/dist/components/dock.d.ts +45 -0
- package/dist/components/dock.js +79 -0
- package/dist/components/drop-zone.d.ts +46 -0
- package/dist/components/drop-zone.js +101 -0
- package/dist/components/dropdown-menu.d.ts +50 -0
- package/dist/components/dropdown-menu.js +78 -0
- package/dist/components/editable-cell.d.ts +34 -0
- package/dist/components/editable-cell.js +89 -0
- package/dist/components/empty-state.d.ts +17 -0
- package/dist/components/empty-state.js +9 -0
- package/dist/components/field.d.ts +43 -0
- package/dist/components/field.js +75 -0
- package/dist/components/filter-condition.d.ts +188 -0
- package/dist/components/filter-condition.js +113 -0
- package/dist/components/filter-menu.d.ts +57 -0
- package/dist/components/filter-menu.js +46 -0
- package/dist/components/header-bar.d.ts +84 -0
- package/dist/components/header-bar.js +94 -0
- package/dist/components/hold-button.d.ts +15 -0
- package/dist/components/hold-button.js +88 -0
- package/dist/components/icon-tile.d.ts +12 -0
- package/dist/components/icon-tile.js +29 -0
- package/dist/components/info-tip.d.ts +13 -0
- package/dist/components/info-tip.js +26 -0
- package/dist/components/input.d.ts +17 -0
- package/dist/components/input.js +83 -0
- package/dist/components/kbd.d.ts +6 -0
- package/dist/components/kbd.js +7 -0
- package/dist/components/menu-item.d.ts +56 -0
- package/dist/components/menu-item.js +94 -0
- package/dist/components/message-composer.d.ts +75 -0
- package/dist/components/message-composer.js +199 -0
- package/dist/components/nav-rail.d.ts +31 -0
- package/dist/components/nav-rail.js +85 -0
- package/dist/components/notice.d.ts +45 -0
- package/dist/components/notice.js +66 -0
- package/dist/components/optimistic-undo.d.ts +28 -0
- package/dist/components/optimistic-undo.js +43 -0
- package/dist/components/option-row.d.ts +15 -0
- package/dist/components/option-row.js +14 -0
- package/dist/components/page-content.d.ts +11 -0
- package/dist/components/page-content.js +31 -0
- package/dist/components/pagination.d.ts +34 -0
- package/dist/components/pagination.js +41 -0
- package/dist/components/popover.d.ts +27 -0
- package/dist/components/popover.js +25 -0
- package/dist/components/progress.d.ts +33 -0
- package/dist/components/progress.js +75 -0
- package/dist/components/radio-group.d.ts +7 -0
- package/dist/components/radio-group.js +33 -0
- package/dist/components/readonly-field.d.ts +33 -0
- package/dist/components/readonly-field.js +80 -0
- package/dist/components/segmented-control.d.ts +21 -0
- package/dist/components/segmented-control.js +108 -0
- package/dist/components/select.d.ts +42 -0
- package/dist/components/select.js +86 -0
- package/dist/components/separator.d.ts +10 -0
- package/dist/components/separator.js +7 -0
- package/dist/components/setting-row.d.ts +53 -0
- package/dist/components/setting-row.js +93 -0
- package/dist/components/sidebar-switcher.d.ts +47 -0
- package/dist/components/sidebar-switcher.js +20 -0
- package/dist/components/sidebar.d.ts +220 -0
- package/dist/components/sidebar.js +327 -0
- package/dist/components/skeleton.d.ts +18 -0
- package/dist/components/skeleton.js +23 -0
- package/dist/components/slider.d.ts +15 -0
- package/dist/components/slider.js +28 -0
- package/dist/components/spinner.d.ts +14 -0
- package/dist/components/spinner.js +19 -0
- package/dist/components/status-dot.d.ts +24 -0
- package/dist/components/status-dot.js +35 -0
- package/dist/components/stepper.d.ts +60 -0
- package/dist/components/stepper.js +197 -0
- package/dist/components/switch.d.ts +9 -0
- package/dist/components/switch.js +26 -0
- package/dist/components/table-cell.d.ts +38 -0
- package/dist/components/table-cell.js +107 -0
- package/dist/components/table-context.d.ts +48 -0
- package/dist/components/table-context.js +69 -0
- package/dist/components/table-head.d.ts +42 -0
- package/dist/components/table-head.js +188 -0
- package/dist/components/table-tree.d.ts +96 -0
- package/dist/components/table-tree.js +137 -0
- package/dist/components/table.d.ts +78 -0
- package/dist/components/table.js +119 -0
- package/dist/components/tabs.d.ts +27 -0
- package/dist/components/tabs.js +79 -0
- package/dist/components/textarea.d.ts +3 -0
- package/dist/components/textarea.js +20 -0
- package/dist/components/theme.d.ts +41 -0
- package/dist/components/theme.js +60 -0
- package/dist/components/thinking.d.ts +68 -0
- package/dist/components/thinking.js +94 -0
- package/dist/components/toast.d.ts +39 -0
- package/dist/components/toast.js +110 -0
- package/dist/components/toolbar.d.ts +25 -0
- package/dist/components/toolbar.js +92 -0
- package/dist/components/tooltip.d.ts +23 -0
- package/dist/components/tooltip.js +27 -0
- package/dist/components/top-nav.d.ts +129 -0
- package/dist/components/top-nav.js +211 -0
- package/dist/components/truncate.d.ts +29 -0
- package/dist/components/truncate.js +138 -0
- package/dist/deprecated.d.ts +43 -0
- package/dist/deprecated.js +47 -0
- package/dist/index.d.ts +93 -0
- package/dist/index.js +93 -0
- package/dist/lib/cn.d.ts +5 -0
- package/dist/lib/cn.js +14 -0
- package/dist/lib/color.d.ts +136 -0
- package/dist/lib/color.js +307 -0
- package/dist/lib/contrast.d.ts +53 -0
- package/dist/lib/contrast.js +169 -0
- package/dist/lib/create-theme.d.ts +240 -0
- package/dist/lib/create-theme.js +461 -0
- package/dist/lib/harmony.d.ts +102 -0
- package/dist/lib/harmony.js +426 -0
- package/dist/lib/import-theme.d.ts +22 -0
- package/dist/lib/import-theme.js +221 -0
- package/dist/lib/overflow-scroll.d.ts +25 -0
- package/dist/lib/overflow-scroll.js +66 -0
- package/dist/lib/radio-toggle-render.d.ts +3 -0
- package/dist/lib/radio-toggle-render.js +9 -0
- package/dist/lib/reorder.d.ts +38 -0
- package/dist/lib/reorder.js +193 -0
- package/dist/lib/spacing.d.ts +101 -0
- package/dist/lib/spacing.js +118 -0
- package/dist/lib/tailwind-palette.d.ts +5 -0
- package/dist/lib/tailwind-palette.js +351 -0
- package/dist/lib/truncate.d.ts +18 -0
- package/dist/lib/truncate.js +69 -0
- package/dist/lib/use-single-value.d.ts +5 -0
- package/dist/lib/use-single-value.js +17 -0
- package/dist/styles.css +7988 -0
- package/mcp/server.mjs +87590 -0
- package/package.json +58 -5
- package/skills/continuum-fix-padding/SKILL.md +69 -0
- package/skills/continuum-fix-padding/scripts/compute.ts +155 -0
- package/skills/continuum-fix-padding/scripts/spacing.ts +189 -0
- package/skills/continuum-taste/SKILL.md +186 -0
- package/skills/continuum-taste/assets/tokens.css +647 -0
- package/skills/continuum-taste/references/charts.md +375 -0
- package/skills/continuum-taste/references/components.md +1369 -0
- package/skills/continuum-taste/references/foundations.md +539 -0
- package/skills/continuum-taste/references/media/canvas.md +75 -0
- package/skills/continuum-taste/references/media/css.md +61 -0
- package/skills/continuum-taste/references/media/react.md +161 -0
- package/skills/continuum-taste/references/method.md +87 -0
- package/skills/continuum-taste/references/pages.md +391 -0
- package/skills/continuum-taste/references/patterns.md +77 -0
- package/skills/continuum-taste/references/screens/agent.tsx +450 -0
- package/skills/continuum-taste/references/screens/analytics-overview.tsx +377 -0
- package/skills/continuum-taste/references/screens/checkout-funnel.tsx +193 -0
- package/skills/continuum-taste/references/screens/customer.tsx +475 -0
- package/skills/continuum-taste/references/screens/customers.tsx +608 -0
- package/skills/continuum-taste/references/screens/index.tsx +72 -0
- package/skills/continuum-taste/references/screens/invoice-editor.tsx +558 -0
- package/skills/continuum-taste/references/screens/new-customer.tsx +205 -0
- package/skills/continuum-taste/references/screens/overview.tsx +196 -0
- package/skills/continuum-taste/references/screens/report-generator.tsx +329 -0
- package/skills/continuum-taste/references/screens/risk-report.tsx +577 -0
- package/skills/continuum-taste/references/screens/sequence-editor.tsx +455 -0
- package/skills/continuum-taste/references/screens/settings.tsx +288 -0
- package/skills/continuum-taste/references/screens/shared.tsx +204 -0
- package/skills/continuum-taste/references/screens/sign-in.tsx +104 -0
- package/skills/continuum-taste/references/screens/workspace.tsx +596 -0
- package/skills/continuum-taste/references/theming.md +95 -0
- package/src/charts/area-chart.tsx +17 -0
- package/src/charts/bar-chart.tsx +15 -0
- package/src/charts/bubble-chart.tsx +913 -0
- package/src/charts/bullet-chart.tsx +419 -0
- package/src/charts/candlestick-chart.tsx +1242 -0
- package/src/charts/cartesian.tsx +1437 -0
- package/src/charts/chart-card.tsx +394 -0
- package/src/charts/donut-chart.tsx +299 -0
- package/src/charts/funnel-chart.tsx +373 -0
- package/src/charts/horizontal-bar-chart.tsx +991 -0
- package/src/charts/index.ts +76 -0
- package/src/charts/legend.tsx +59 -0
- package/src/charts/lib/candlestick-window.ts +42 -0
- package/src/charts/lib/color.ts +110 -0
- package/src/charts/lib/format.ts +42 -0
- package/src/charts/lib/frame.ts +6 -0
- package/src/charts/lib/layout.ts +78 -0
- package/src/charts/lib/path.ts +225 -0
- package/src/charts/lib/scale.ts +91 -0
- package/src/charts/lib/use-active.ts +87 -0
- package/src/charts/lib/use-size.ts +45 -0
- package/src/charts/line-chart.tsx +16 -0
- package/src/charts/radar-chart.tsx +485 -0
- package/src/charts/rose-chart.tsx +553 -0
- package/src/charts/sparkline.tsx +293 -0
- package/src/charts/tooltip.tsx +105 -0
- package/src/charts/treemap.tsx +271 -0
- package/src/charts/uptime-strip.tsx +469 -0
- package/src/components/accordion.tsx +136 -0
- package/src/components/activity-item.tsx +43 -0
- package/src/components/alert.tsx +135 -0
- package/src/components/assistant-answer.tsx +185 -0
- package/src/components/assistant-prompt.tsx +352 -0
- package/src/components/avatar.tsx +157 -0
- package/src/components/badge.tsx +55 -0
- package/src/components/bar-list.tsx +350 -0
- package/src/components/block-slider.tsx +189 -0
- package/src/components/branch-graph.tsx +580 -0
- package/src/components/breadcrumb.tsx +173 -0
- package/src/components/button.tsx +157 -0
- package/src/components/calendar.tsx +154 -0
- package/src/components/card.tsx +296 -0
- package/src/components/chat-attachment.tsx +255 -0
- package/src/components/chat-event.tsx +34 -0
- package/src/components/chat-message.tsx +332 -0
- package/src/components/chat-reference.tsx +100 -0
- package/src/components/chat-shared.ts +41 -0
- package/src/components/chat-suggestions.tsx +188 -0
- package/src/components/chat-thread.tsx +348 -0
- package/src/components/chat-typing.tsx +155 -0
- package/src/components/checkbox.tsx +83 -0
- package/src/components/checklist.tsx +146 -0
- package/src/components/chip.tsx +152 -0
- package/src/components/code-input.tsx +406 -0
- package/src/components/color-picker.tsx +1385 -0
- package/src/components/combobox.tsx +420 -0
- package/src/components/command-menu.tsx +405 -0
- package/src/components/copy-button.tsx +87 -0
- package/src/components/data-grid.tsx +965 -0
- package/src/components/date-picker.tsx +652 -0
- package/src/components/description-list.tsx +39 -0
- package/src/components/dialog.tsx +367 -0
- package/src/components/dock.tsx +192 -0
- package/src/components/drop-zone.tsx +283 -0
- package/src/components/dropdown-menu.tsx +323 -0
- package/src/components/editable-cell.tsx +219 -0
- package/src/components/empty-state.tsx +50 -0
- package/src/components/field.tsx +148 -0
- package/src/components/filter-condition.tsx +463 -0
- package/src/components/filter-menu.tsx +196 -0
- package/src/components/header-bar.tsx +220 -0
- package/src/components/hold-button.tsx +146 -0
- package/src/components/icon-tile.tsx +43 -0
- package/src/components/info-tip.tsx +87 -0
- package/src/components/input.tsx +136 -0
- package/src/components/kbd.tsx +17 -0
- package/src/components/menu-item.tsx +216 -0
- package/src/components/message-composer.tsx +458 -0
- package/src/components/nav-rail.tsx +235 -0
- package/src/components/notice.tsx +133 -0
- package/src/components/optimistic-undo.ts +68 -0
- package/src/components/option-row.tsx +54 -0
- package/src/components/page-content.tsx +44 -0
- package/src/components/pagination.tsx +182 -0
- package/src/components/popover.tsx +113 -0
- package/src/components/progress.tsx +222 -0
- package/src/components/radio-group.tsx +80 -0
- package/src/components/readonly-field.tsx +251 -0
- package/src/components/segmented-control.tsx +205 -0
- package/src/components/select.tsx +259 -0
- package/src/components/separator.tsx +30 -0
- package/src/components/setting-row.tsx +277 -0
- package/src/components/sidebar-switcher.tsx +134 -0
- package/src/components/sidebar.tsx +804 -0
- package/src/components/skeleton.tsx +57 -0
- package/src/components/slider.tsx +106 -0
- package/src/components/spinner.tsx +43 -0
- package/src/components/status-dot.tsx +100 -0
- package/src/components/stepper.tsx +459 -0
- package/src/components/switch.tsx +54 -0
- package/src/components/table-cell.tsx +239 -0
- package/src/components/table-context.ts +135 -0
- package/src/components/table-head.tsx +393 -0
- package/src/components/table-tree.tsx +357 -0
- package/src/components/table.tsx +295 -0
- package/src/components/tabs.tsx +191 -0
- package/src/components/textarea.tsx +44 -0
- package/src/components/theme.tsx +120 -0
- package/src/components/thinking.tsx +295 -0
- package/src/components/toast.tsx +308 -0
- package/src/components/toolbar.tsx +166 -0
- package/src/components/tooltip.tsx +84 -0
- package/src/components/top-nav.tsx +660 -0
- package/src/components/truncate.tsx +234 -0
- package/src/deprecated.ts +61 -0
- package/src/index.ts +184 -0
- package/src/lib/cn.ts +22 -0
- package/src/lib/color.ts +469 -0
- package/src/lib/contrast.ts +220 -0
- package/src/lib/create-theme.ts +659 -0
- package/src/lib/harmony.ts +609 -0
- package/src/lib/import-theme.ts +272 -0
- package/src/lib/overflow-scroll.tsx +108 -0
- package/src/lib/radio-toggle-render.tsx +15 -0
- package/src/lib/reorder.ts +222 -0
- package/src/lib/spacing.ts +189 -0
- package/src/lib/tailwind-palette.ts +355 -0
- package/src/lib/truncate.ts +79 -0
- package/src/lib/use-single-value.ts +23 -0
- package/src/styles/continuum.css +3 -0
- package/src/styles/theme.css +524 -0
- package/src/styles/tokens.css +647 -0
|
@@ -0,0 +1,596 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AppPanel,
|
|
3
|
+
AppShell,
|
|
4
|
+
Badge,
|
|
5
|
+
Breadcrumb,
|
|
6
|
+
BreadcrumbHome,
|
|
7
|
+
BreadcrumbItem,
|
|
8
|
+
BreadcrumbLink,
|
|
9
|
+
BreadcrumbList,
|
|
10
|
+
BreadcrumbPage,
|
|
11
|
+
BreadcrumbSeparator,
|
|
12
|
+
cn,
|
|
13
|
+
HeaderBar,
|
|
14
|
+
PageContent,
|
|
15
|
+
SheetArea,
|
|
16
|
+
Sidebar,
|
|
17
|
+
SidebarGroup,
|
|
18
|
+
SidebarHeader,
|
|
19
|
+
SidebarItem,
|
|
20
|
+
SidebarLogo,
|
|
21
|
+
SidebarToggle,
|
|
22
|
+
} from '@contui/ui';
|
|
23
|
+
import {
|
|
24
|
+
Boxes,
|
|
25
|
+
ChartColumn,
|
|
26
|
+
Inbox,
|
|
27
|
+
LayoutDashboard,
|
|
28
|
+
LifeBuoy,
|
|
29
|
+
Receipt,
|
|
30
|
+
Settings,
|
|
31
|
+
Sparkles,
|
|
32
|
+
Users,
|
|
33
|
+
} from 'lucide-react';
|
|
34
|
+
import { Fragment, type ReactNode, type RefObject, useLayoutEffect, useState } from 'react';
|
|
35
|
+
import { AccountFooter, type ScreenId, useScreenNav, WorkspaceMark } from './shared';
|
|
36
|
+
|
|
37
|
+
/*
|
|
38
|
+
* The generic app every screen belongs to: one workspace with one sidebar, a
|
|
39
|
+
* header bar that shows where the page sits, and the page in a centred column.
|
|
40
|
+
* Nothing in it is drawn by hand: every colour, corner and font is a token, so
|
|
41
|
+
* a previewed theme changes all of it at once.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
const icon = { strokeWidth: 2 } as const;
|
|
45
|
+
|
|
46
|
+
export type Place =
|
|
47
|
+
| 'overview'
|
|
48
|
+
| 'customers'
|
|
49
|
+
| 'invoices'
|
|
50
|
+
| 'reports'
|
|
51
|
+
| 'inbox'
|
|
52
|
+
| 'agent'
|
|
53
|
+
| 'settings';
|
|
54
|
+
|
|
55
|
+
export const places: { id: Place; label: string; icon: ReactNode; count?: number }[] = [
|
|
56
|
+
{ id: 'overview', label: 'Overview', icon: <LayoutDashboard {...icon} /> },
|
|
57
|
+
{ id: 'customers', label: 'Customers', icon: <Users {...icon} /> },
|
|
58
|
+
{ id: 'invoices', label: 'Invoices', icon: <Receipt {...icon} /> },
|
|
59
|
+
{ id: 'reports', label: 'Reports', icon: <ChartColumn {...icon} /> },
|
|
60
|
+
{ id: 'inbox', label: 'Inbox', icon: <Inbox {...icon} />, count: 4 },
|
|
61
|
+
{ id: 'agent', label: 'Agent', icon: <Sparkles {...icon} /> },
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
/** The places that have a screen of their own; the rest are drawn but lead nowhere yet. */
|
|
65
|
+
const placeScreens: Partial<Record<Place, ScreenId>> = {
|
|
66
|
+
overview: 'dashboard',
|
|
67
|
+
customers: 'list',
|
|
68
|
+
agent: 'agent',
|
|
69
|
+
settings: 'settings',
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The sidebar every screen shares: the places, settings and the account. It holds no action of
|
|
74
|
+
* its own: each page has its one primary action, and a second here would make two.
|
|
75
|
+
*/
|
|
76
|
+
export const WorkspaceSidebar = ({ place }: { place: Place }) => {
|
|
77
|
+
const nav = useScreenNav();
|
|
78
|
+
const go = (to: Place) => () => {
|
|
79
|
+
const screen = placeScreens[to];
|
|
80
|
+
if (screen) nav.open(screen);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<Sidebar>
|
|
85
|
+
<SidebarHeader>
|
|
86
|
+
<SidebarLogo>
|
|
87
|
+
<Boxes {...icon} />
|
|
88
|
+
</SidebarLogo>
|
|
89
|
+
<SidebarToggle />
|
|
90
|
+
</SidebarHeader>
|
|
91
|
+
<SidebarGroup aria-label="Main">
|
|
92
|
+
{places.map(item => (
|
|
93
|
+
<SidebarItem
|
|
94
|
+
active={place === item.id}
|
|
95
|
+
icon={item.icon}
|
|
96
|
+
key={item.id}
|
|
97
|
+
onClick={go(item.id)}
|
|
98
|
+
trailing={
|
|
99
|
+
item.count ? <Badge variant="count">{item.count}</Badge> : undefined
|
|
100
|
+
}
|
|
101
|
+
>
|
|
102
|
+
{item.label}
|
|
103
|
+
</SidebarItem>
|
|
104
|
+
))}
|
|
105
|
+
</SidebarGroup>
|
|
106
|
+
<SidebarGroup aria-label="Workspace" label="Workspace">
|
|
107
|
+
<SidebarItem
|
|
108
|
+
active={place === 'settings'}
|
|
109
|
+
icon={<Settings {...icon} />}
|
|
110
|
+
onClick={go('settings')}
|
|
111
|
+
>
|
|
112
|
+
Settings
|
|
113
|
+
</SidebarItem>
|
|
114
|
+
<SidebarItem icon={<LifeBuoy {...icon} />}>Help and support</SidebarItem>
|
|
115
|
+
</SidebarGroup>
|
|
116
|
+
<AccountFooter
|
|
117
|
+
avatar={
|
|
118
|
+
<WorkspaceMark>
|
|
119
|
+
<Boxes {...icon} />
|
|
120
|
+
</WorkspaceMark>
|
|
121
|
+
}
|
|
122
|
+
name="Acme Inc."
|
|
123
|
+
detail="Pro plan"
|
|
124
|
+
/>
|
|
125
|
+
</Sidebar>
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/** A step of the trail: its label, and the screen it opens when there is one. */
|
|
130
|
+
export type Crumb = string | { label: string; to?: ScreenId };
|
|
131
|
+
|
|
132
|
+
const crumbLabel = (crumb: Crumb) => (typeof crumb === 'string' ? crumb : crumb.label);
|
|
133
|
+
|
|
134
|
+
/** Where the page sits: the home, then each step down to the page itself. */
|
|
135
|
+
export const Trail = ({ trail }: { trail: Crumb[] }) => {
|
|
136
|
+
const nav = useScreenNav();
|
|
137
|
+
|
|
138
|
+
return (
|
|
139
|
+
<Breadcrumb>
|
|
140
|
+
<BreadcrumbList>
|
|
141
|
+
<BreadcrumbItem>
|
|
142
|
+
<BreadcrumbLink href="#" onClick={() => nav.open('dashboard')}>
|
|
143
|
+
<BreadcrumbHome />
|
|
144
|
+
</BreadcrumbLink>
|
|
145
|
+
</BreadcrumbItem>
|
|
146
|
+
{trail.map((crumb, i) => {
|
|
147
|
+
const to = typeof crumb === 'string' ? undefined : crumb.to;
|
|
148
|
+
return (
|
|
149
|
+
<Fragment key={crumbLabel(crumb)}>
|
|
150
|
+
<BreadcrumbSeparator />
|
|
151
|
+
<BreadcrumbItem>
|
|
152
|
+
{i === trail.length - 1 ? (
|
|
153
|
+
<BreadcrumbPage>{crumbLabel(crumb)}</BreadcrumbPage>
|
|
154
|
+
) : (
|
|
155
|
+
<BreadcrumbLink
|
|
156
|
+
href="#"
|
|
157
|
+
onClick={to ? () => nav.open(to) : undefined}
|
|
158
|
+
>
|
|
159
|
+
{crumbLabel(crumb)}
|
|
160
|
+
</BreadcrumbLink>
|
|
161
|
+
)}
|
|
162
|
+
</BreadcrumbItem>
|
|
163
|
+
</Fragment>
|
|
164
|
+
);
|
|
165
|
+
})}
|
|
166
|
+
</BreadcrumbList>
|
|
167
|
+
</Breadcrumb>
|
|
168
|
+
);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
type WorkspaceProps = {
|
|
172
|
+
place: Place;
|
|
173
|
+
trail: Crumb[];
|
|
174
|
+
/** A `Notice` for the save state, hung from the header bar's hairline. */
|
|
175
|
+
notice?: ReactNode;
|
|
176
|
+
/** The column's width, as dense as the page is: 896 unless a table needs the room. */
|
|
177
|
+
width?: 'narrow' | 'default' | 'wide' | 'dense';
|
|
178
|
+
/**
|
|
179
|
+
* The gap down the column: the block gap under the page head, each side claiming room by what
|
|
180
|
+
* it holds, so it is the page's own and never one number for all. A page whose later blocks
|
|
181
|
+
* stand apart by another gap groups them in a column of their own.
|
|
182
|
+
*/
|
|
183
|
+
gap: `gap-${number}`;
|
|
184
|
+
/** A bar floating at the panel's foot, over the page as it scrolls: bulk actions, say. */
|
|
185
|
+
bar?: ReactNode;
|
|
186
|
+
children: ReactNode;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
/** One screen of the app: the shared sidebar, the trail in the header bar, the page below it. */
|
|
190
|
+
export const Workspace = ({
|
|
191
|
+
place,
|
|
192
|
+
trail,
|
|
193
|
+
notice,
|
|
194
|
+
width = 'default',
|
|
195
|
+
gap,
|
|
196
|
+
bar,
|
|
197
|
+
children,
|
|
198
|
+
}: WorkspaceProps) => (
|
|
199
|
+
<AppShell className="h-full min-h-0">
|
|
200
|
+
<WorkspaceSidebar place={place} />
|
|
201
|
+
<AppPanel>
|
|
202
|
+
<HeaderBar>
|
|
203
|
+
<Trail trail={trail} />
|
|
204
|
+
{notice}
|
|
205
|
+
</HeaderBar>
|
|
206
|
+
{/* The area a sheet floats in, under the header bar: a detail's history opens here. */}
|
|
207
|
+
<SheetArea className="min-h-0 flex-1 overflow-auto">
|
|
208
|
+
<PageContent className={cn('flex flex-col pb-24', gap)} width={width}>
|
|
209
|
+
{children}
|
|
210
|
+
</PageContent>
|
|
211
|
+
</SheetArea>
|
|
212
|
+
{bar}
|
|
213
|
+
</AppPanel>
|
|
214
|
+
</AppShell>
|
|
215
|
+
);
|
|
216
|
+
|
|
217
|
+
type PageHeadProps = {
|
|
218
|
+
title: ReactNode;
|
|
219
|
+
description?: ReactNode;
|
|
220
|
+
/** The page's own actions, at the right of its title: its primary, or a control the page reads by. */
|
|
221
|
+
children?: ReactNode;
|
|
222
|
+
/** Actions a phone can do without, before the others: they hide in a compact shell. */
|
|
223
|
+
secondary?: ReactNode;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* A page's title and the line under it, with its actions beside it. In a compact shell the head
|
|
228
|
+
* stacks (title, line, then the actions under them) and the secondary actions hide, so a row of
|
|
229
|
+
* actions never squeezes the title and a phone keeps only what the page is for.
|
|
230
|
+
*/
|
|
231
|
+
export const PageHead = ({ title, description, children, secondary }: PageHeadProps) => (
|
|
232
|
+
<div className="flex @max-shell-compact/shell:flex-col @max-shell-compact/shell:items-start items-end justify-between @max-shell-compact/shell:gap-4 gap-6">
|
|
233
|
+
<div className="flex min-w-0 flex-col gap-1.5">
|
|
234
|
+
<h1 className="font-medium text-2xl text-neutral-950">{title}</h1>
|
|
235
|
+
{description && <p className="text-neutral-600 text-sm">{description}</p>}
|
|
236
|
+
</div>
|
|
237
|
+
{(children || secondary) && (
|
|
238
|
+
<div
|
|
239
|
+
className={cn(
|
|
240
|
+
'flex shrink-0 items-center gap-2',
|
|
241
|
+
// Holding nothing but secondaries, the row goes with them, and its gap too.
|
|
242
|
+
!children && '@max-shell-compact/shell:hidden',
|
|
243
|
+
)}
|
|
244
|
+
>
|
|
245
|
+
{secondary && (
|
|
246
|
+
<span className="contents @max-shell-compact/shell:hidden">{secondary}</span>
|
|
247
|
+
)}
|
|
248
|
+
{children}
|
|
249
|
+
</div>
|
|
250
|
+
)}
|
|
251
|
+
</div>
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Whether the shell round `ref` is compact, narrower than the shell's compact size, for what a
|
|
256
|
+
* container query cannot do: change which controls a page offers, not only how they sit. Outside
|
|
257
|
+
* a shell it is never compact, as the shell's own variants never match there.
|
|
258
|
+
*/
|
|
259
|
+
export const useShellCompact = (ref: RefObject<HTMLElement | null>) => {
|
|
260
|
+
const [compact, setCompact] = useState(false);
|
|
261
|
+
|
|
262
|
+
// Measured before paint, so a phone never sees the wide controls for a frame.
|
|
263
|
+
useLayoutEffect(() => {
|
|
264
|
+
const shell = ref.current?.closest<HTMLElement>('[data-slot="app-shell"]');
|
|
265
|
+
if (!shell) return;
|
|
266
|
+
const limit =
|
|
267
|
+
Number.parseFloat(
|
|
268
|
+
getComputedStyle(shell).getPropertyValue('--container-shell-compact'),
|
|
269
|
+
) || 640;
|
|
270
|
+
const measure = () => setCompact(shell.clientWidth < limit);
|
|
271
|
+
measure();
|
|
272
|
+
const observer = new ResizeObserver(measure);
|
|
273
|
+
observer.observe(shell);
|
|
274
|
+
return () => observer.disconnect();
|
|
275
|
+
}, [ref]);
|
|
276
|
+
|
|
277
|
+
return compact;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
/** A section's title and the line under it, as every screen sets them. */
|
|
281
|
+
export const SectionHead = ({
|
|
282
|
+
title,
|
|
283
|
+
description,
|
|
284
|
+
}: {
|
|
285
|
+
title: ReactNode;
|
|
286
|
+
description?: ReactNode;
|
|
287
|
+
}) => (
|
|
288
|
+
<div className="flex flex-col gap-1">
|
|
289
|
+
<h2 className="font-medium text-base text-neutral-950">{title}</h2>
|
|
290
|
+
{description && <p className="text-neutral-600 text-xs">{description}</p>}
|
|
291
|
+
</div>
|
|
292
|
+
);
|
|
293
|
+
|
|
294
|
+
/* ---------- The workspace's data ---------- */
|
|
295
|
+
|
|
296
|
+
export type Status = 'Active' | 'Trial' | 'Past due' | 'Churned';
|
|
297
|
+
|
|
298
|
+
/** Status colours mean status: a trial is information, past due a warning, churned nothing more. */
|
|
299
|
+
export const statusTone: Record<Status, 'success' | 'primary' | 'warning' | 'neutral'> = {
|
|
300
|
+
Active: 'success',
|
|
301
|
+
Trial: 'primary',
|
|
302
|
+
'Past due': 'warning',
|
|
303
|
+
Churned: 'neutral',
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
export type Plan = 'Starter' | 'Pro' | 'Enterprise';
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* What each plan costs, the one price list every screen reads: Starter is flat, the others are
|
|
310
|
+
* paid per seat, so a customer's monthly revenue is its seats times the price.
|
|
311
|
+
*/
|
|
312
|
+
export const plans: { id: Plan; price: string; terms: string }[] = [
|
|
313
|
+
{ id: 'Starter', price: '€29 a month', terms: 'for a team of up to five' },
|
|
314
|
+
{ id: 'Pro', price: '€20 a seat a month', terms: 'with reports and an API' },
|
|
315
|
+
{ id: 'Enterprise', price: '€40 a seat a month', terms: 'with single sign-on and a contract' },
|
|
316
|
+
];
|
|
317
|
+
|
|
318
|
+
/** What a customer pays a month: nothing on a trial or after it has left. */
|
|
319
|
+
export const monthlyRevenue = (plan: Plan, seats: number, status: Status) => {
|
|
320
|
+
if (status === 'Trial' || status === 'Churned') return 0;
|
|
321
|
+
return plan === 'Starter' ? 29 : seats * (plan === 'Pro' ? 20 : 40);
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
export type Customer = {
|
|
325
|
+
id: string;
|
|
326
|
+
name: string;
|
|
327
|
+
domain: string;
|
|
328
|
+
initials: string;
|
|
329
|
+
plan: Plan;
|
|
330
|
+
status: Status;
|
|
331
|
+
/** The seats the plan pays for; Starter's five are included. */
|
|
332
|
+
seats: number;
|
|
333
|
+
/** Monthly recurring revenue, in euros: the seats times the plan's price. */
|
|
334
|
+
mrr: number;
|
|
335
|
+
owner: string;
|
|
336
|
+
ownerInitials: string;
|
|
337
|
+
seen: string;
|
|
338
|
+
/** Whole days since anyone from it was last seen, for the "Last seen" filter. */
|
|
339
|
+
seenDays: number;
|
|
340
|
+
/** The month it became a customer. */
|
|
341
|
+
since: string;
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
/** The account managers who look after the customers. */
|
|
345
|
+
export const owners = [
|
|
346
|
+
{ name: 'Maya Chen', initials: 'MC' },
|
|
347
|
+
{ name: 'Liam Ortiz', initials: 'LO' },
|
|
348
|
+
{ name: 'Sara Kim', initials: 'SK' },
|
|
349
|
+
{ name: 'Noah Patel', initials: 'NP' },
|
|
350
|
+
];
|
|
351
|
+
|
|
352
|
+
/** The first page of customers, written out: the screens and the component pieces use these. */
|
|
353
|
+
export const customers: Customer[] = [
|
|
354
|
+
{
|
|
355
|
+
id: 'northwind',
|
|
356
|
+
name: 'Northwind Traders',
|
|
357
|
+
domain: 'northwind.com',
|
|
358
|
+
initials: 'NT',
|
|
359
|
+
plan: 'Enterprise',
|
|
360
|
+
status: 'Active',
|
|
361
|
+
seats: 120,
|
|
362
|
+
mrr: 4800,
|
|
363
|
+
owner: 'Maya Chen',
|
|
364
|
+
ownerInitials: 'MC',
|
|
365
|
+
seen: '2 min ago',
|
|
366
|
+
seenDays: 0,
|
|
367
|
+
since: 'March 2023',
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
id: 'globex',
|
|
371
|
+
name: 'Globex',
|
|
372
|
+
domain: 'globex.io',
|
|
373
|
+
initials: 'GX',
|
|
374
|
+
plan: 'Pro',
|
|
375
|
+
status: 'Active',
|
|
376
|
+
seats: 62,
|
|
377
|
+
mrr: 1240,
|
|
378
|
+
owner: 'Liam Ortiz',
|
|
379
|
+
ownerInitials: 'LO',
|
|
380
|
+
seen: '18 min ago',
|
|
381
|
+
seenDays: 0,
|
|
382
|
+
since: 'June 2024',
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
id: 'initech',
|
|
386
|
+
name: 'Initech',
|
|
387
|
+
domain: 'initech.co',
|
|
388
|
+
initials: 'IN',
|
|
389
|
+
plan: 'Pro',
|
|
390
|
+
status: 'Past due',
|
|
391
|
+
seats: 49,
|
|
392
|
+
mrr: 980,
|
|
393
|
+
owner: 'Sara Kim',
|
|
394
|
+
ownerInitials: 'SK',
|
|
395
|
+
seen: '1 hour ago',
|
|
396
|
+
seenDays: 0,
|
|
397
|
+
since: 'January 2025',
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
id: 'umbrella',
|
|
401
|
+
name: 'Umbrella Health',
|
|
402
|
+
domain: 'umbrella.health',
|
|
403
|
+
initials: 'UH',
|
|
404
|
+
plan: 'Enterprise',
|
|
405
|
+
status: 'Active',
|
|
406
|
+
seats: 155,
|
|
407
|
+
mrr: 6200,
|
|
408
|
+
owner: 'Maya Chen',
|
|
409
|
+
ownerInitials: 'MC',
|
|
410
|
+
seen: '3 hours ago',
|
|
411
|
+
seenDays: 0,
|
|
412
|
+
since: 'September 2022',
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
id: 'hooli',
|
|
416
|
+
name: 'Hooli',
|
|
417
|
+
domain: 'hooli.xyz',
|
|
418
|
+
initials: 'HO',
|
|
419
|
+
plan: 'Starter',
|
|
420
|
+
status: 'Trial',
|
|
421
|
+
seats: 5,
|
|
422
|
+
mrr: 0,
|
|
423
|
+
owner: 'Liam Ortiz',
|
|
424
|
+
ownerInitials: 'LO',
|
|
425
|
+
seen: 'Yesterday',
|
|
426
|
+
seenDays: 1,
|
|
427
|
+
since: 'October 2026',
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
id: 'soylent',
|
|
431
|
+
name: 'Soylent Labs',
|
|
432
|
+
domain: 'soylent.dev',
|
|
433
|
+
initials: 'SL',
|
|
434
|
+
plan: 'Pro',
|
|
435
|
+
status: 'Active',
|
|
436
|
+
seats: 78,
|
|
437
|
+
mrr: 1560,
|
|
438
|
+
owner: 'Noah Patel',
|
|
439
|
+
ownerInitials: 'NP',
|
|
440
|
+
seen: 'Yesterday',
|
|
441
|
+
seenDays: 1,
|
|
442
|
+
since: 'April 2024',
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
id: 'stark',
|
|
446
|
+
name: 'Stark Logistics',
|
|
447
|
+
domain: 'starklogistics.com',
|
|
448
|
+
initials: 'SK',
|
|
449
|
+
plan: 'Enterprise',
|
|
450
|
+
status: 'Active',
|
|
451
|
+
seats: 135,
|
|
452
|
+
mrr: 5400,
|
|
453
|
+
owner: 'Sara Kim',
|
|
454
|
+
ownerInitials: 'SK',
|
|
455
|
+
seen: '2 days ago',
|
|
456
|
+
seenDays: 2,
|
|
457
|
+
since: 'November 2023',
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
id: 'wayne',
|
|
461
|
+
name: 'Wayne Studio',
|
|
462
|
+
domain: 'waynestudio.co',
|
|
463
|
+
initials: 'WS',
|
|
464
|
+
plan: 'Starter',
|
|
465
|
+
status: 'Trial',
|
|
466
|
+
seats: 5,
|
|
467
|
+
mrr: 0,
|
|
468
|
+
owner: 'Noah Patel',
|
|
469
|
+
ownerInitials: 'NP',
|
|
470
|
+
seen: '3 days ago',
|
|
471
|
+
seenDays: 3,
|
|
472
|
+
since: 'October 2026',
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
id: 'cyberdyne',
|
|
476
|
+
name: 'Cyberdyne',
|
|
477
|
+
domain: 'cyberdyne.ai',
|
|
478
|
+
initials: 'CY',
|
|
479
|
+
plan: 'Pro',
|
|
480
|
+
status: 'Churned',
|
|
481
|
+
seats: 0,
|
|
482
|
+
mrr: 0,
|
|
483
|
+
owner: 'Liam Ortiz',
|
|
484
|
+
ownerInitials: 'LO',
|
|
485
|
+
seen: '2 weeks ago',
|
|
486
|
+
seenDays: 14,
|
|
487
|
+
since: 'February 2024',
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
id: 'tyrell',
|
|
491
|
+
name: 'Tyrell & Co',
|
|
492
|
+
domain: 'tyrell.co',
|
|
493
|
+
initials: 'TC',
|
|
494
|
+
plan: 'Starter',
|
|
495
|
+
status: 'Active',
|
|
496
|
+
seats: 5,
|
|
497
|
+
mrr: 29,
|
|
498
|
+
owner: 'Maya Chen',
|
|
499
|
+
ownerInitials: 'MC',
|
|
500
|
+
seen: '5 min ago',
|
|
501
|
+
seenDays: 0,
|
|
502
|
+
since: 'October 2026',
|
|
503
|
+
},
|
|
504
|
+
];
|
|
505
|
+
|
|
506
|
+
// The rest of the book, one line each: name, domain, plan, status, seats, owner, days since seen.
|
|
507
|
+
const more: [string, string, Plan, Status, number, number, number][] = [
|
|
508
|
+
['Acorn Analytics', 'acorn.io', 'Enterprise', 'Active', 110, 1, 0],
|
|
509
|
+
['Bluebird Freight', 'bluebird.co', 'Pro', 'Active', 120, 2, 1],
|
|
510
|
+
['Copperleaf', 'copperleaf.com', 'Starter', 'Active', 5, 3, 4],
|
|
511
|
+
['Driftwood Studio', 'driftwood.studio', 'Starter', 'Active', 3, 0, 9],
|
|
512
|
+
['Elm & Oak', 'elmandoak.com', 'Pro', 'Active', 95, 1, 2],
|
|
513
|
+
['Fernhill Foods', 'fernhill.eu', 'Starter', 'Past due', 4, 2, 21],
|
|
514
|
+
['Granite Labs', 'granitelabs.dev', 'Enterprise', 'Active', 95, 3, 0],
|
|
515
|
+
['Harbour Supply', 'harboursupply.com', 'Pro', 'Active', 88, 0, 1],
|
|
516
|
+
['Ironwood', 'ironwood.io', 'Starter', 'Active', 5, 1, 6],
|
|
517
|
+
['Juniper Health', 'juniper.health', 'Pro', 'Past due', 80, 2, 12],
|
|
518
|
+
['Kestrel Air', 'kestrel.aero', 'Starter', 'Active', 2, 3, 30],
|
|
519
|
+
['Lumen Energy', 'lumen.energy', 'Pro', 'Active', 74, 0, 0],
|
|
520
|
+
['Marlow & Finch', 'marlowfinch.com', 'Starter', 'Active', 5, 1, 3],
|
|
521
|
+
['Northgate Retail', 'northgate.shop', 'Enterprise', 'Active', 80, 2, 1],
|
|
522
|
+
['Oakridge Legal', 'oakridge.law', 'Starter', 'Active', 4, 3, 45],
|
|
523
|
+
['Pinecrest', 'pinecrest.co', 'Pro', 'Active', 70, 0, 5],
|
|
524
|
+
['Quarry Works', 'quarry.works', 'Starter', 'Active', 5, 1, 2],
|
|
525
|
+
['Riverbend Media', 'riverbend.media', 'Pro', 'Trial', 10, 2, 0],
|
|
526
|
+
['Saltmarsh', 'saltmarsh.io', 'Starter', 'Active', 3, 3, 15],
|
|
527
|
+
['Tidewater', 'tidewater.com', 'Pro', 'Active', 64, 0, 3],
|
|
528
|
+
['Upland Coffee', 'upland.coffee', 'Starter', 'Active', 5, 1, 60],
|
|
529
|
+
['Vantage Point', 'vantagepoint.io', 'Pro', 'Past due', 60, 2, 33],
|
|
530
|
+
['Willow Care', 'willowcare.nl', 'Starter', 'Active', 5, 3, 7],
|
|
531
|
+
['Yellowfin', 'yellowfin.app', 'Pro', 'Active', 52, 0, 1],
|
|
532
|
+
['Zephyr Cloud', 'zephyr.cloud', 'Starter', 'Past due', 5, 1, 90],
|
|
533
|
+
['Alder Bikes', 'alder.bike', 'Starter', 'Active', 2, 2, 11],
|
|
534
|
+
['Birchway', 'birchway.com', 'Pro', 'Active', 46, 3, 4],
|
|
535
|
+
['Cobalt Systems', 'cobalt.systems', 'Starter', 'Active', 5, 0, 0],
|
|
536
|
+
['Dune Travel', 'dune.travel', 'Starter', 'Trial', 5, 1, 2],
|
|
537
|
+
['Ember Games', 'ember.gg', 'Pro', 'Active', 30, 2, 8],
|
|
538
|
+
['Foxglove', 'foxglove.design', 'Starter', 'Active', 4, 3, 20],
|
|
539
|
+
['Gullwing', 'gullwing.io', 'Pro', 'Active', 26, 0, 2],
|
|
540
|
+
['Heron Books', 'heron.books', 'Starter', 'Active', 5, 1, 100],
|
|
541
|
+
['Indigo Print', 'indigo.print', 'Starter', 'Active', 3, 2, 5],
|
|
542
|
+
['Jasper & Lane', 'jasperlane.com', 'Pro', 'Trial', 12, 3, 1],
|
|
543
|
+
['Kite Robotics', 'kite.ai', 'Starter', 'Active', 5, 0, 14],
|
|
544
|
+
['Lark Music', 'lark.fm', 'Pro', 'Churned', 0, 1, 120],
|
|
545
|
+
['Moss Architects', 'moss.archi', 'Starter', 'Active', 5, 2, 25],
|
|
546
|
+
];
|
|
547
|
+
|
|
548
|
+
const months = ['January', 'March', 'May', 'July', 'September', 'November'];
|
|
549
|
+
|
|
550
|
+
const seenLabel = (days: number) =>
|
|
551
|
+
days === 0
|
|
552
|
+
? 'Today'
|
|
553
|
+
: days === 1
|
|
554
|
+
? 'Yesterday'
|
|
555
|
+
: days < 14
|
|
556
|
+
? `${days} days ago`
|
|
557
|
+
: `${Math.floor(days / 7)} weeks ago`;
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* Every customer of the workspace: the first page above, then the rest. Their monthly revenue adds
|
|
561
|
+
* up to the overview's €48,260, and their statuses to the list's views.
|
|
562
|
+
*/
|
|
563
|
+
export const allCustomers: Customer[] = [
|
|
564
|
+
...customers,
|
|
565
|
+
...more.map(([name, domain, plan, status, seats, owner, seenDays], i) => {
|
|
566
|
+
const manager = owners[owner] ?? owners[0];
|
|
567
|
+
const words = name.split(' ').filter(word => /^\w/.test(word));
|
|
568
|
+
return {
|
|
569
|
+
id: domain.split('.')[0] ?? name,
|
|
570
|
+
name,
|
|
571
|
+
domain,
|
|
572
|
+
initials: words
|
|
573
|
+
.slice(0, 2)
|
|
574
|
+
.map(word => word[0])
|
|
575
|
+
.join('')
|
|
576
|
+
.toUpperCase(),
|
|
577
|
+
plan,
|
|
578
|
+
status,
|
|
579
|
+
seats,
|
|
580
|
+
mrr: monthlyRevenue(plan, seats, status),
|
|
581
|
+
owner: manager?.name ?? '',
|
|
582
|
+
ownerInitials: manager?.initials ?? '',
|
|
583
|
+
seen: seenLabel(seenDays),
|
|
584
|
+
seenDays,
|
|
585
|
+
since: `${months[i % months.length]} ${2022 + (i % 4)}`,
|
|
586
|
+
};
|
|
587
|
+
}),
|
|
588
|
+
];
|
|
589
|
+
|
|
590
|
+
const euro = new Intl.NumberFormat('en-GB', {
|
|
591
|
+
style: 'currency',
|
|
592
|
+
currency: 'EUR',
|
|
593
|
+
maximumFractionDigits: 0,
|
|
594
|
+
});
|
|
595
|
+
|
|
596
|
+
export const formatEuro = (value: number) => euro.format(value);
|