@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,288 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Avatar,
|
|
3
|
+
Badge,
|
|
4
|
+
BottomBar,
|
|
5
|
+
Button,
|
|
6
|
+
Card,
|
|
7
|
+
Dock,
|
|
8
|
+
DockItem,
|
|
9
|
+
Field,
|
|
10
|
+
FieldLabel,
|
|
11
|
+
Input,
|
|
12
|
+
Notice,
|
|
13
|
+
Progress,
|
|
14
|
+
Select,
|
|
15
|
+
SelectContent,
|
|
16
|
+
SelectItem,
|
|
17
|
+
SelectTrigger,
|
|
18
|
+
SelectValue,
|
|
19
|
+
SettingGroup,
|
|
20
|
+
SettingRow,
|
|
21
|
+
Switch,
|
|
22
|
+
useNotice,
|
|
23
|
+
} from '@contui/ui';
|
|
24
|
+
import { type FormEvent, useState } from 'react';
|
|
25
|
+
import { owners, PageHead, Workspace } from './workspace';
|
|
26
|
+
|
|
27
|
+
type Area = 'General' | 'Members' | 'Notifications' | 'Billing' | 'Integrations';
|
|
28
|
+
|
|
29
|
+
const areas: { id: Area; description: string }[] = [
|
|
30
|
+
{ id: 'General', description: 'How the workspace shows up for the team and for customers.' },
|
|
31
|
+
{ id: 'Members', description: 'Who works in the workspace, and what each of them may do.' },
|
|
32
|
+
{ id: 'Notifications', description: 'The emails the workspace sends you.' },
|
|
33
|
+
{ id: 'Billing', description: 'What the workspace pays for, and how much of it is used.' },
|
|
34
|
+
{ id: 'Integrations', description: 'The tools the workspace sends its data to.' },
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
const roles = ['Owner', 'Admin', 'Member'];
|
|
38
|
+
|
|
39
|
+
/** The workspace's own plan: what Acme pays for this app, not what its customers pay Acme. */
|
|
40
|
+
const SEATS = 12;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Settings, as small as it goes: each area a view in the dock, its title the area's name, a card
|
|
44
|
+
* per group with a row per setting. Toggles and pickers save as they change and say so in the
|
|
45
|
+
* header bar; the plain values are a form in their card, with its save at the card's foot.
|
|
46
|
+
*/
|
|
47
|
+
export const Settings = () => {
|
|
48
|
+
const [area, setArea] = useState<Area>('General');
|
|
49
|
+
const { notice, show } = useNotice();
|
|
50
|
+
const saved = () => show('Saved');
|
|
51
|
+
const [alerts, setAlerts] = useState({ signups: true, payments: true, summary: false });
|
|
52
|
+
const set = (key: keyof typeof alerts) => (on: boolean) => {
|
|
53
|
+
setAlerts(current => ({ ...current, [key]: on }));
|
|
54
|
+
saved();
|
|
55
|
+
};
|
|
56
|
+
const [tools, setTools] = useState({ slack: true, stripe: true });
|
|
57
|
+
const description = areas.find(item => item.id === area)?.description;
|
|
58
|
+
|
|
59
|
+
const submit = (event: FormEvent) => {
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
saved();
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<Workspace
|
|
66
|
+
bar={
|
|
67
|
+
<BottomBar floating>
|
|
68
|
+
<Dock
|
|
69
|
+
aria-label="Settings areas"
|
|
70
|
+
onValueChange={value => setArea(value as Area)}
|
|
71
|
+
value={area}
|
|
72
|
+
>
|
|
73
|
+
{areas.map(item => (
|
|
74
|
+
<DockItem key={item.id} value={item.id}>
|
|
75
|
+
{item.id}
|
|
76
|
+
</DockItem>
|
|
77
|
+
))}
|
|
78
|
+
</Dock>
|
|
79
|
+
</BottomBar>
|
|
80
|
+
}
|
|
81
|
+
// The block gap: the head with its line over a settings card of four or five rows (General,
|
|
82
|
+
// Members); the three-row cards come to 44, a step from it.
|
|
83
|
+
gap="gap-12"
|
|
84
|
+
notice={<Notice {...notice} />}
|
|
85
|
+
place="settings"
|
|
86
|
+
trail={[{ label: 'Settings', to: 'settings' }, area]}
|
|
87
|
+
width="narrow"
|
|
88
|
+
>
|
|
89
|
+
<PageHead description={description} title={area} />
|
|
90
|
+
|
|
91
|
+
<div className="flex flex-col gap-6">
|
|
92
|
+
{area === 'General' && (
|
|
93
|
+
// Plain values are fields, as in a form, so this card saves with its own button.
|
|
94
|
+
<Card layout="list">
|
|
95
|
+
<form className="flex flex-col gap-5" onSubmit={submit}>
|
|
96
|
+
<p className="text-neutral-600 text-xs">Workspace</p>
|
|
97
|
+
<Field>
|
|
98
|
+
<FieldLabel>Name</FieldLabel>
|
|
99
|
+
<Input defaultValue="Acme Inc." />
|
|
100
|
+
</Field>
|
|
101
|
+
<Field>
|
|
102
|
+
<FieldLabel>Address</FieldLabel>
|
|
103
|
+
<Input defaultValue="acme.app/workspace" />
|
|
104
|
+
</Field>
|
|
105
|
+
<Field>
|
|
106
|
+
<FieldLabel>Language</FieldLabel>
|
|
107
|
+
<Select defaultValue="en">
|
|
108
|
+
<SelectTrigger>
|
|
109
|
+
<SelectValue />
|
|
110
|
+
</SelectTrigger>
|
|
111
|
+
<SelectContent>
|
|
112
|
+
<SelectItem value="en">English</SelectItem>
|
|
113
|
+
<SelectItem value="nl">Nederlands</SelectItem>
|
|
114
|
+
<SelectItem value="de">Deutsch</SelectItem>
|
|
115
|
+
</SelectContent>
|
|
116
|
+
</Select>
|
|
117
|
+
</Field>
|
|
118
|
+
<div className="flex justify-end">
|
|
119
|
+
<Button type="submit">Save changes</Button>
|
|
120
|
+
</div>
|
|
121
|
+
</form>
|
|
122
|
+
</Card>
|
|
123
|
+
)}
|
|
124
|
+
|
|
125
|
+
{area === 'Members' && (
|
|
126
|
+
<Card layout="list">
|
|
127
|
+
<SettingGroup title="Members">
|
|
128
|
+
{owners.map((member, i) => (
|
|
129
|
+
<SettingRow
|
|
130
|
+
control={
|
|
131
|
+
<Select
|
|
132
|
+
defaultValue={
|
|
133
|
+
i === 0 ? 'Owner' : i === 1 ? 'Admin' : 'Member'
|
|
134
|
+
}
|
|
135
|
+
disabled={i === 0}
|
|
136
|
+
onValueChange={saved}
|
|
137
|
+
>
|
|
138
|
+
<SelectTrigger
|
|
139
|
+
aria-label={`${member.name}'s role`}
|
|
140
|
+
className="w-32"
|
|
141
|
+
size="sm"
|
|
142
|
+
>
|
|
143
|
+
<SelectValue />
|
|
144
|
+
</SelectTrigger>
|
|
145
|
+
<SelectContent align="end">
|
|
146
|
+
{roles.map(role => (
|
|
147
|
+
<SelectItem key={role} value={role}>
|
|
148
|
+
{role}
|
|
149
|
+
</SelectItem>
|
|
150
|
+
))}
|
|
151
|
+
</SelectContent>
|
|
152
|
+
</Select>
|
|
153
|
+
}
|
|
154
|
+
description={`${member.name.split(' ')[0]?.toLowerCase()}@acme.app`}
|
|
155
|
+
key={member.name}
|
|
156
|
+
title={
|
|
157
|
+
<span className="flex items-center gap-2">
|
|
158
|
+
<Avatar
|
|
159
|
+
alt={member.name}
|
|
160
|
+
fallback={member.initials}
|
|
161
|
+
shape="round"
|
|
162
|
+
size={24}
|
|
163
|
+
/>
|
|
164
|
+
{member.name}
|
|
165
|
+
</span>
|
|
166
|
+
}
|
|
167
|
+
/>
|
|
168
|
+
))}
|
|
169
|
+
<SettingRow
|
|
170
|
+
control={<Button variant="secondary">Invite people</Button>}
|
|
171
|
+
description={`${owners.length} of ${SEATS} seats taken.`}
|
|
172
|
+
labelControl={false}
|
|
173
|
+
title="Invite"
|
|
174
|
+
/>
|
|
175
|
+
</SettingGroup>
|
|
176
|
+
</Card>
|
|
177
|
+
)}
|
|
178
|
+
|
|
179
|
+
{area === 'Notifications' && (
|
|
180
|
+
<Card layout="list">
|
|
181
|
+
<SettingGroup title="Email">
|
|
182
|
+
<SettingRow
|
|
183
|
+
control={
|
|
184
|
+
<Switch
|
|
185
|
+
checked={alerts.signups}
|
|
186
|
+
onCheckedChange={set('signups')}
|
|
187
|
+
/>
|
|
188
|
+
}
|
|
189
|
+
description="An email the moment a company starts a trial or a plan."
|
|
190
|
+
title="New customers"
|
|
191
|
+
/>
|
|
192
|
+
<SettingRow
|
|
193
|
+
control={
|
|
194
|
+
<Switch
|
|
195
|
+
checked={alerts.payments}
|
|
196
|
+
onCheckedChange={set('payments')}
|
|
197
|
+
/>
|
|
198
|
+
}
|
|
199
|
+
description="When a card is declined or an invoice runs past due."
|
|
200
|
+
title="Failed payments"
|
|
201
|
+
/>
|
|
202
|
+
<SettingRow
|
|
203
|
+
control={
|
|
204
|
+
<Switch
|
|
205
|
+
checked={alerts.summary}
|
|
206
|
+
onCheckedChange={set('summary')}
|
|
207
|
+
/>
|
|
208
|
+
}
|
|
209
|
+
description="Revenue, new customers and churn, every Monday at nine."
|
|
210
|
+
title="Weekly summary"
|
|
211
|
+
/>
|
|
212
|
+
</SettingGroup>
|
|
213
|
+
</Card>
|
|
214
|
+
)}
|
|
215
|
+
|
|
216
|
+
{area === 'Billing' && (
|
|
217
|
+
<Card layout="list">
|
|
218
|
+
<SettingGroup title="Plan">
|
|
219
|
+
{/* The plan in force, a card inside the group's, with the way to change it. */}
|
|
220
|
+
<Card className="flex-row items-center justify-between gap-4">
|
|
221
|
+
<div className="flex min-w-0 flex-col gap-1">
|
|
222
|
+
<span className="flex items-center gap-2 font-medium text-neutral-950 text-sm">
|
|
223
|
+
Pro
|
|
224
|
+
<Badge tone="success">Active</Badge>
|
|
225
|
+
</span>
|
|
226
|
+
<span className="text-neutral-600 text-xs">
|
|
227
|
+
{SEATS} seats, billed yearly. Renews on 1 March 2027.
|
|
228
|
+
</span>
|
|
229
|
+
</div>
|
|
230
|
+
<Button variant="secondary">Change plan</Button>
|
|
231
|
+
</Card>
|
|
232
|
+
<Progress
|
|
233
|
+
caption={`${owners.length} of ${SEATS}`}
|
|
234
|
+
label="Seats"
|
|
235
|
+
value={(owners.length / SEATS) * 100}
|
|
236
|
+
/>
|
|
237
|
+
<SettingRow
|
|
238
|
+
control={<Button variant="secondary">Add seats</Button>}
|
|
239
|
+
description="Each seat is added to the next invoice, pro rata."
|
|
240
|
+
labelControl={false}
|
|
241
|
+
title="More seats"
|
|
242
|
+
/>
|
|
243
|
+
</SettingGroup>
|
|
244
|
+
</Card>
|
|
245
|
+
)}
|
|
246
|
+
|
|
247
|
+
{area === 'Integrations' && (
|
|
248
|
+
<Card layout="list">
|
|
249
|
+
<SettingGroup title="Connected">
|
|
250
|
+
<SettingRow
|
|
251
|
+
control={
|
|
252
|
+
<Switch
|
|
253
|
+
checked={tools.slack}
|
|
254
|
+
onCheckedChange={on => {
|
|
255
|
+
setTools(current => ({ ...current, slack: on }));
|
|
256
|
+
saved();
|
|
257
|
+
}}
|
|
258
|
+
/>
|
|
259
|
+
}
|
|
260
|
+
description="Failed payments and new customers, posted to #revenue."
|
|
261
|
+
title="Slack"
|
|
262
|
+
/>
|
|
263
|
+
<SettingRow
|
|
264
|
+
control={
|
|
265
|
+
<Switch
|
|
266
|
+
checked={tools.stripe}
|
|
267
|
+
onCheckedChange={on => {
|
|
268
|
+
setTools(current => ({ ...current, stripe: on }));
|
|
269
|
+
saved();
|
|
270
|
+
}}
|
|
271
|
+
/>
|
|
272
|
+
}
|
|
273
|
+
description="Payments and invoices, read every hour."
|
|
274
|
+
title="Stripe"
|
|
275
|
+
/>
|
|
276
|
+
<SettingRow
|
|
277
|
+
control={<Button variant="secondary">Connect</Button>}
|
|
278
|
+
description="Customers and owners, kept in step with the CRM."
|
|
279
|
+
labelControl={false}
|
|
280
|
+
title="HubSpot"
|
|
281
|
+
/>
|
|
282
|
+
</SettingGroup>
|
|
283
|
+
</Card>
|
|
284
|
+
)}
|
|
285
|
+
</div>
|
|
286
|
+
</Workspace>
|
|
287
|
+
);
|
|
288
|
+
};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Avatar,
|
|
3
|
+
Breadcrumb,
|
|
4
|
+
BreadcrumbHome,
|
|
5
|
+
BreadcrumbItem,
|
|
6
|
+
BreadcrumbLink,
|
|
7
|
+
BreadcrumbList,
|
|
8
|
+
BreadcrumbPage,
|
|
9
|
+
BreadcrumbSeparator,
|
|
10
|
+
Button,
|
|
11
|
+
cn,
|
|
12
|
+
NavRail,
|
|
13
|
+
NavRailItem,
|
|
14
|
+
NavRailSeparator,
|
|
15
|
+
NavRailToggle,
|
|
16
|
+
pageContentVariants,
|
|
17
|
+
SidebarAccount,
|
|
18
|
+
SidebarFooter,
|
|
19
|
+
} from '@contui/ui';
|
|
20
|
+
import { Bell, ChartColumn, Globe, LayoutGrid, MessagesSquare, Plus } from 'lucide-react';
|
|
21
|
+
import { createContext, Fragment, type ReactNode, useContext, useState } from 'react';
|
|
22
|
+
|
|
23
|
+
/** The screens of the one generic app, by the ids Patterns opens them by. */
|
|
24
|
+
export type ScreenId = 'dashboard' | 'list' | 'detail' | 'form' | 'settings' | 'agent' | 'sign-in';
|
|
25
|
+
|
|
26
|
+
export type ScreenNav = {
|
|
27
|
+
/** Opens another screen of the app, and for the detail the customer it shows. */
|
|
28
|
+
open: (id: ScreenId, customer?: string) => void;
|
|
29
|
+
/** The customer the detail shows, once a row has opened it. */
|
|
30
|
+
customer?: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
* How one screen of the app opens another. Patterns provides it round a screen it shows live, so
|
|
35
|
+
* the sidebar, the rows and the breadcrumb lead where they say; in a tile or on Home there is none,
|
|
36
|
+
* and every link stays where it is.
|
|
37
|
+
*/
|
|
38
|
+
const ScreenNavContext = createContext<ScreenNav>({ open: () => undefined });
|
|
39
|
+
|
|
40
|
+
export const ScreenNavProvider = ScreenNavContext.Provider;
|
|
41
|
+
|
|
42
|
+
export const useScreenNav = () => useContext(ScreenNavContext);
|
|
43
|
+
|
|
44
|
+
const railItems = [
|
|
45
|
+
{ id: 'dashboards', label: 'Dashboards', icon: <LayoutGrid strokeWidth={2} /> },
|
|
46
|
+
{ id: 'analytics', label: 'Analytics', icon: <ChartColumn strokeWidth={2} /> },
|
|
47
|
+
{ id: 'regions', label: 'Regions', icon: <Globe strokeWidth={2} /> },
|
|
48
|
+
{ id: 'feedback', label: 'Feedback', icon: <MessagesSquare strokeWidth={2} /> },
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
/** The floating capsule nav the analytics screens share, 32px from the left, centred. */
|
|
52
|
+
const AnalyticsRail = ({ initial }: { initial: string }) => {
|
|
53
|
+
const [active, setActive] = useState(initial);
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<NavRail aria-label="Main" className="absolute top-1/2 left-8 z-20 -translate-y-1/2">
|
|
57
|
+
<NavRailToggle />
|
|
58
|
+
<NavRailSeparator />
|
|
59
|
+
{railItems.map(item => (
|
|
60
|
+
<NavRailItem
|
|
61
|
+
active={active === item.id}
|
|
62
|
+
aria-current={active === item.id ? 'page' : undefined}
|
|
63
|
+
key={item.id}
|
|
64
|
+
label={item.label}
|
|
65
|
+
onClick={() => setActive(item.id)}
|
|
66
|
+
>
|
|
67
|
+
{item.icon}
|
|
68
|
+
</NavRailItem>
|
|
69
|
+
))}
|
|
70
|
+
<NavRailSeparator />
|
|
71
|
+
<NavRailItem label="Notifications">
|
|
72
|
+
<Bell strokeWidth={2} />
|
|
73
|
+
</NavRailItem>
|
|
74
|
+
<Avatar alt="Northwind" className="mt-1" fallback="N" />
|
|
75
|
+
</NavRail>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Breadcrumb trail plus the "Add to Ask" action that tops every analytics page.
|
|
81
|
+
* Sticky, with the fade the screens draw so content slides out beneath it.
|
|
82
|
+
*/
|
|
83
|
+
export const AnalyticsTopBar = ({ trail }: { trail: string[] }) => (
|
|
84
|
+
<div className="sticky top-0 z-10 flex h-13.5 shrink-0 items-center justify-between gap-4 bg-linear-to-b from-60% from-neutral-50 to-transparent">
|
|
85
|
+
<Breadcrumb>
|
|
86
|
+
<BreadcrumbList>
|
|
87
|
+
<BreadcrumbItem>
|
|
88
|
+
<BreadcrumbLink href="#">
|
|
89
|
+
<BreadcrumbHome />
|
|
90
|
+
</BreadcrumbLink>
|
|
91
|
+
</BreadcrumbItem>
|
|
92
|
+
{trail.map((crumb, i) => (
|
|
93
|
+
<Fragment key={crumb}>
|
|
94
|
+
<BreadcrumbSeparator />
|
|
95
|
+
<BreadcrumbItem>
|
|
96
|
+
{i === trail.length - 1 ? (
|
|
97
|
+
<BreadcrumbPage>{crumb}</BreadcrumbPage>
|
|
98
|
+
) : (
|
|
99
|
+
<BreadcrumbLink href="#">{crumb}</BreadcrumbLink>
|
|
100
|
+
)}
|
|
101
|
+
</BreadcrumbItem>
|
|
102
|
+
</Fragment>
|
|
103
|
+
))}
|
|
104
|
+
</BreadcrumbList>
|
|
105
|
+
</Breadcrumb>
|
|
106
|
+
<Button>
|
|
107
|
+
Add to Ask
|
|
108
|
+
<Plus strokeWidth={2} />
|
|
109
|
+
</Button>
|
|
110
|
+
</div>
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Page frame of the analytics screens: an 896px column centred on the canvas,
|
|
115
|
+
* the rail floating over its left edge and a floating BottomBar pinned to the
|
|
116
|
+
* bottom of the frame. The column scrolls on its own so the rail and the bar
|
|
117
|
+
* stay put in whatever frame holds it.
|
|
118
|
+
*/
|
|
119
|
+
export const AnalyticsPage = ({
|
|
120
|
+
rail,
|
|
121
|
+
children,
|
|
122
|
+
bottomBar,
|
|
123
|
+
}: {
|
|
124
|
+
rail: string;
|
|
125
|
+
children: ReactNode;
|
|
126
|
+
/** A `<BottomBar floating>`; this frame is its positioned parent. */
|
|
127
|
+
bottomBar?: ReactNode;
|
|
128
|
+
}) => (
|
|
129
|
+
<div className="relative h-full min-w-300 bg-neutral-50">
|
|
130
|
+
<AnalyticsRail initial={rail} />
|
|
131
|
+
<div className="h-full overflow-y-auto">
|
|
132
|
+
<div
|
|
133
|
+
className={cn(
|
|
134
|
+
pageContentVariants(),
|
|
135
|
+
'flex flex-col pt-5',
|
|
136
|
+
bottomBar ? 'pb-28' : 'pb-12',
|
|
137
|
+
)}
|
|
138
|
+
>
|
|
139
|
+
{children}
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
{bottomBar}
|
|
143
|
+
</div>
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
/** The week the analytics screens report on: Monday 19 to Sunday 25 October 2026. */
|
|
147
|
+
export const reportWeek = Array.from({ length: 7 }, (_, i) => new Date(2026, 9, 19 + i));
|
|
148
|
+
|
|
149
|
+
/** Weekday names on the x-axis, as the screens were drawn ("Mon", "Tue" …). */
|
|
150
|
+
export const formatWeekday = (date: Date) => date.toLocaleDateString('en-GB', { weekday: 'short' });
|
|
151
|
+
|
|
152
|
+
/** A dark square with a white 16px glyph: the workspace logo in a sidebar footer. */
|
|
153
|
+
export const WorkspaceMark = ({ children }: { children: ReactNode }) => (
|
|
154
|
+
<span className="grid size-full place-items-center bg-neutral-950 text-neutral-50 [&_svg]:size-4">
|
|
155
|
+
{children}
|
|
156
|
+
</span>
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
/** The sidebar footer every app screen shares: who is signed in, and a bell. */
|
|
160
|
+
export const AccountFooter = ({
|
|
161
|
+
avatar,
|
|
162
|
+
name,
|
|
163
|
+
detail,
|
|
164
|
+
}: {
|
|
165
|
+
avatar: ReactNode;
|
|
166
|
+
name: ReactNode;
|
|
167
|
+
detail?: ReactNode;
|
|
168
|
+
}) => (
|
|
169
|
+
<SidebarFooter>
|
|
170
|
+
<SidebarAccount avatar={avatar} name={name} detail={detail} />
|
|
171
|
+
<Button aria-label="Notifications" size="icon" variant="ghost">
|
|
172
|
+
<Bell className="size-4.5" strokeWidth={2} />
|
|
173
|
+
</Button>
|
|
174
|
+
</SidebarFooter>
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
/** Page and section headings as drawn; the system has no Heading component. */
|
|
178
|
+
export const PageTitle = ({ children }: { children: ReactNode }) => (
|
|
179
|
+
<h1 className="font-medium text-2xl text-neutral-950">{children}</h1>
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
const titleSizes = { sm: 'text-sm', base: 'text-base', lg: 'text-lg' } as const;
|
|
183
|
+
|
|
184
|
+
export const SectionTitle = ({
|
|
185
|
+
title,
|
|
186
|
+
description,
|
|
187
|
+
as: Tag = 'h2',
|
|
188
|
+
size = 'base',
|
|
189
|
+
lead = false,
|
|
190
|
+
}: {
|
|
191
|
+
title: ReactNode;
|
|
192
|
+
description?: ReactNode;
|
|
193
|
+
as?: 'h1' | 'h2';
|
|
194
|
+
size?: keyof typeof titleSizes;
|
|
195
|
+
/** Sets the description at 16px, as the report generator draws it. */
|
|
196
|
+
lead?: boolean;
|
|
197
|
+
}) => (
|
|
198
|
+
<div className={cn('flex max-w-125 flex-col', lead ? 'gap-2' : 'gap-1.5')}>
|
|
199
|
+
<Tag className={cn('font-medium text-neutral-950', titleSizes[size])}>{title}</Tag>
|
|
200
|
+
{description && (
|
|
201
|
+
<p className={cn('text-neutral-600', lead ? 'text-base' : 'text-sm')}>{description}</p>
|
|
202
|
+
)}
|
|
203
|
+
</div>
|
|
204
|
+
);
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Button,
|
|
3
|
+
Card,
|
|
4
|
+
Checkbox,
|
|
5
|
+
Field,
|
|
6
|
+
FieldLabel,
|
|
7
|
+
Input,
|
|
8
|
+
Separator,
|
|
9
|
+
SidebarLogo,
|
|
10
|
+
} from '@contui/ui';
|
|
11
|
+
import { Boxes, KeyRound } from 'lucide-react';
|
|
12
|
+
import { useScreenNav } from './shared';
|
|
13
|
+
|
|
14
|
+
const icon = { strokeWidth: 2 } as const;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A sign-in: one card on the canvas, the email and password, and a way in without them. The card
|
|
18
|
+
* is a form, so Enter in either field signs in, and signing in opens the overview.
|
|
19
|
+
*/
|
|
20
|
+
export const SignIn = () => {
|
|
21
|
+
const nav = useScreenNav();
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
// The card is 400 wide where there is room and runs the width on a phone, 16px from either
|
|
25
|
+
// side; centred, the side padding only shows once the card fills the row.
|
|
26
|
+
<div className="flex h-full min-h-full flex-col items-center justify-center gap-6 bg-neutral-100 px-4 py-10">
|
|
27
|
+
<Card className="w-full max-w-100 p-8">
|
|
28
|
+
<form
|
|
29
|
+
className="flex flex-col gap-6"
|
|
30
|
+
onSubmit={event => {
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
nav.open('dashboard');
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<div className="flex flex-col items-start gap-4">
|
|
36
|
+
<SidebarLogo className="-ml-1.5">
|
|
37
|
+
<Boxes {...icon} />
|
|
38
|
+
</SidebarLogo>
|
|
39
|
+
<div className="flex flex-col gap-1.5">
|
|
40
|
+
<h1 className="font-medium text-neutral-950 text-xl">
|
|
41
|
+
Sign in to Acme
|
|
42
|
+
</h1>
|
|
43
|
+
<p className="text-neutral-600 text-sm">
|
|
44
|
+
Welcome back. Use your work email.
|
|
45
|
+
</p>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div className="flex flex-col gap-5">
|
|
50
|
+
<Field>
|
|
51
|
+
<FieldLabel>Work email</FieldLabel>
|
|
52
|
+
<Input autoComplete="email" defaultValue="maya@acme.app" type="email" />
|
|
53
|
+
</Field>
|
|
54
|
+
<Field>
|
|
55
|
+
<div className="flex items-baseline justify-between gap-3">
|
|
56
|
+
<FieldLabel>Password</FieldLabel>
|
|
57
|
+
<button
|
|
58
|
+
className="cursor-pointer text-neutral-600 text-xs hover:text-neutral-950"
|
|
59
|
+
type="button"
|
|
60
|
+
>
|
|
61
|
+
Forgot it?
|
|
62
|
+
</button>
|
|
63
|
+
</div>
|
|
64
|
+
{/* Empty, as a sign-in opens: a filled password field makes the browser offer to save it. */}
|
|
65
|
+
<Input
|
|
66
|
+
autoComplete="current-password"
|
|
67
|
+
placeholder="Your password"
|
|
68
|
+
type="password"
|
|
69
|
+
/>
|
|
70
|
+
</Field>
|
|
71
|
+
<Field className="flex-row items-center gap-2.5">
|
|
72
|
+
<Checkbox defaultChecked />
|
|
73
|
+
<FieldLabel className="font-normal">Keep me signed in</FieldLabel>
|
|
74
|
+
</Field>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div className="flex flex-col gap-4">
|
|
78
|
+
<Button className="w-full" size="lg" type="submit">
|
|
79
|
+
Sign in
|
|
80
|
+
</Button>
|
|
81
|
+
<div className="flex items-center gap-3 text-neutral-600 text-xs">
|
|
82
|
+
<Separator className="flex-1" />
|
|
83
|
+
or
|
|
84
|
+
<Separator className="flex-1" />
|
|
85
|
+
</div>
|
|
86
|
+
<Button className="w-full" size="lg" type="button" variant="secondary">
|
|
87
|
+
<KeyRound {...icon} />
|
|
88
|
+
Continue with single sign-on
|
|
89
|
+
</Button>
|
|
90
|
+
</div>
|
|
91
|
+
</form>
|
|
92
|
+
</Card>
|
|
93
|
+
<p className="text-neutral-600 text-xs">
|
|
94
|
+
No account yet?{' '}
|
|
95
|
+
<button
|
|
96
|
+
className="cursor-pointer font-medium text-neutral-950 hover:underline"
|
|
97
|
+
type="button"
|
|
98
|
+
>
|
|
99
|
+
Start a free trial
|
|
100
|
+
</button>
|
|
101
|
+
</p>
|
|
102
|
+
</div>
|
|
103
|
+
);
|
|
104
|
+
};
|