@adea-ai/ui 0.61.0 → 0.62.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/README.md +44 -6
- package/dist/LICENSE +201 -0
- package/dist/NOTICE +50 -0
- package/dist/components/composites/account-menu/index.js +2 -0
- package/dist/components/composites/list-row/index.js +2 -0
- package/dist/components/composites/settings/index.js +2 -0
- package/dist/components/composites/stat/index.js +2 -0
- package/dist/components/composites/update-dialog/index.js +2 -0
- package/dist/components/composites/workspace-mark/index.js +2 -0
- package/dist/components/conversation/index.js +6 -0
- package/dist/components/layout/app-shell/index.js +2 -0
- package/dist/components/layout/page/index.js +2 -0
- package/dist/components/layout/panel/index.js +2 -0
- package/dist/components/layout/side-rail/index.js +3 -0
- package/dist/components/layout/sidebar-nav/index.js +2 -0
- package/dist/components/layout/status-bar/index.js +2 -0
- package/dist/components/layout/top-bar/index.js +2 -0
- package/dist/components/motion/index.js +2 -2
- package/dist/components/theme/index.js +5 -0
- package/dist/components/ui/accordion/index.js +2 -0
- package/dist/components/ui/alert/index.js +2 -0
- package/dist/components/ui/alert-dialog/index.js +2 -0
- package/dist/components/ui/aspect-ratio/index.js +2 -0
- package/dist/components/ui/avatar/index.js +2 -0
- package/dist/components/ui/badge/index.js +2 -0
- package/dist/components/ui/board/index.js +2 -0
- package/dist/components/ui/breadcrumb/index.js +2 -0
- package/dist/components/ui/button/index.js +2 -0
- package/dist/components/ui/button-group/index.js +2 -0
- package/dist/components/ui/calendar/index.js +2 -0
- package/dist/components/ui/card/index.js +2 -0
- package/dist/components/ui/carousel/index.js +2 -0
- package/dist/components/ui/chart/index.js +2 -0
- package/dist/components/ui/checkbox/index.js +2 -0
- package/dist/components/ui/code-block/index.js +2 -0
- package/dist/components/ui/collapsible/index.js +2 -0
- package/dist/components/ui/combobox/index.js +2 -0
- package/dist/components/ui/command/index.js +2 -0
- package/dist/components/ui/context-menu/index.js +2 -0
- package/dist/components/ui/detail-panel/index.js +2 -0
- package/dist/components/ui/dialog/index.js +2 -0
- package/dist/components/ui/diff-block/index.js +2 -0
- package/dist/components/ui/drawer/index.js +2 -0
- package/dist/components/ui/dropdown-menu/index.js +2 -0
- package/dist/components/ui/empty/index.js +2 -0
- package/dist/components/ui/entity-icon/index.js +2 -0
- package/dist/components/ui/field/index.js +2 -0
- package/dist/components/ui/hover-card/index.js +2 -0
- package/dist/components/ui/input/index.js +2 -0
- package/dist/components/ui/input-group/index.js +2 -0
- package/dist/components/ui/input-otp/index.js +2 -0
- package/dist/components/ui/item/index.js +2 -0
- package/dist/components/ui/kbd/index.js +2 -0
- package/dist/components/ui/label/index.js +2 -0
- package/dist/components/ui/menubar/index.js +2 -0
- package/dist/components/ui/modal-dialog/index.js +2 -0
- package/dist/components/ui/navigation-menu/index.js +2 -0
- package/dist/components/ui/pagination/index.js +2 -0
- package/dist/components/ui/popover/index.js +2 -0
- package/dist/components/ui/progress/index.js +2 -0
- package/dist/components/ui/radio-group/index.js +2 -0
- package/dist/components/ui/resizable/index.js +2 -0
- package/dist/components/ui/scroll-area/index.js +2 -0
- package/dist/components/ui/select/index.js +2 -0
- package/dist/components/ui/separator/index.js +2 -0
- package/dist/components/ui/sheet/index.js +2 -0
- package/dist/components/ui/skeleton/index.js +2 -0
- package/dist/components/ui/slider/index.js +2 -0
- package/dist/components/ui/spinner/index.js +2 -0
- package/dist/components/ui/status-chip/index.js +2 -0
- package/dist/components/ui/switch/index.js +2 -0
- package/dist/components/ui/table/index.js +2 -0
- package/dist/components/ui/tabs/index.js +2 -0
- package/dist/components/ui/textarea/index.js +2 -0
- package/dist/components/ui/toast/index.js +2 -0
- package/dist/components/ui/toggle/index.js +2 -0
- package/dist/components/ui/toggle-group/index.js +2 -0
- package/dist/components/ui/tooltip/index.js +2 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/r/accordion.json +3 -1
- package/dist/r/account-menu.json +2 -1
- package/dist/r/alert-dialog.json +3 -1
- package/dist/r/alert.json +3 -1
- package/dist/r/app-shell.json +3 -1
- package/dist/r/aspect-ratio.json +3 -1
- package/dist/r/avatar.json +3 -1
- package/dist/r/badge.json +3 -1
- package/dist/r/board.json +3 -1
- package/dist/r/breadcrumb.json +3 -1
- package/dist/r/button-group.json +2 -1
- package/dist/r/button.json +3 -1
- package/dist/r/calendar.json +2 -1
- package/dist/r/card.json +3 -1
- package/dist/r/carousel.json +2 -1
- package/dist/r/chart.json +3 -1
- package/dist/r/checkbox.json +3 -1
- package/dist/r/code-block.json +2 -1
- package/dist/r/collapsible.json +3 -1
- package/dist/r/combobox.json +3 -1
- package/dist/r/command.json +3 -1
- package/dist/r/context-menu.json +3 -1
- package/dist/r/conversation.json +2 -1
- package/dist/r/detail-panel.json +2 -1
- package/dist/r/dialog.json +3 -1
- package/dist/r/diff-block.json +3 -1
- package/dist/r/drawer.json +3 -1
- package/dist/r/dropdown-menu.json +3 -1
- package/dist/r/empty.json +3 -1
- package/dist/r/entity-icon.json +3 -1
- package/dist/r/field.json +3 -1
- package/dist/r/hover-card.json +3 -1
- package/dist/r/input-group.json +3 -1
- package/dist/r/input-otp.json +3 -1
- package/dist/r/input.json +3 -1
- package/dist/r/item.json +3 -1
- package/dist/r/kbd.json +3 -1
- package/dist/r/label.json +3 -1
- package/dist/r/lib.json +50 -0
- package/dist/r/list-row.json +3 -1
- package/dist/r/menubar.json +3 -1
- package/dist/r/modal-dialog.json +2 -1
- package/dist/r/motion.json +22 -0
- package/dist/r/navigation-menu.json +3 -1
- package/dist/r/page.json +3 -1
- package/dist/r/pagination.json +3 -1
- package/dist/r/panel.json +3 -1
- package/dist/r/popover.json +3 -1
- package/dist/r/progress.json +3 -1
- package/dist/r/radio-group.json +3 -1
- package/dist/r/registry.json +320 -73
- package/dist/r/resizable.json +3 -1
- package/dist/r/scroll-area.json +3 -1
- package/dist/r/select.json +3 -1
- package/dist/r/separator.json +3 -1
- package/dist/r/settings.json +3 -1
- package/dist/r/sheet.json +2 -1
- package/dist/r/side-rail.json +3 -1
- package/dist/r/sidebar-nav.json +3 -1
- package/dist/r/skeleton.json +3 -1
- package/dist/r/slider.json +3 -1
- package/dist/r/spinner.json +3 -1
- package/dist/r/src/components/composites/account-menu/account-menu.tsx +150 -0
- package/dist/r/src/components/composites/account-menu/index.ts +1 -0
- package/dist/r/src/components/composites/list-row/index.ts +1 -0
- package/dist/r/src/components/composites/list-row/list-row.tsx +116 -0
- package/dist/r/src/components/composites/settings/index.ts +1 -0
- package/dist/r/src/components/composites/settings/settings.tsx +142 -0
- package/dist/r/src/components/composites/stat/index.ts +9 -0
- package/dist/r/src/components/composites/stat/stat.tsx +155 -0
- package/dist/r/src/components/composites/update-dialog/index.ts +7 -0
- package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +529 -0
- package/dist/r/src/components/composites/workspace-mark/index.ts +1 -0
- package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +72 -0
- package/dist/r/src/components/conversation/conversation-avatar.tsx +60 -0
- package/dist/r/src/components/conversation/conversation-surface.tsx +107 -0
- package/dist/r/src/components/conversation/index.ts +25 -0
- package/dist/r/src/components/conversation/message-composer.tsx +239 -0
- package/dist/r/src/components/conversation/message-row.tsx +387 -0
- package/dist/r/src/components/conversation/thread-panel.tsx +141 -0
- package/dist/r/src/components/layout/app-shell/app-shell.tsx +92 -0
- package/dist/r/src/components/layout/app-shell/index.ts +1 -0
- package/dist/r/src/components/layout/page/index.ts +9 -0
- package/dist/r/src/components/layout/page/page.tsx +122 -0
- package/dist/r/src/components/layout/panel/index.ts +12 -0
- package/dist/r/src/components/layout/panel/panel.tsx +166 -0
- package/dist/r/src/components/layout/side-rail/index.ts +12 -0
- package/dist/r/src/components/layout/side-rail/side-rail-context.ts +42 -0
- package/dist/r/src/components/layout/side-rail/side-rail.tsx +405 -0
- package/dist/r/src/components/layout/sidebar-nav/index.ts +14 -0
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +244 -0
- package/dist/r/src/components/layout/status-bar/index.ts +1 -0
- package/dist/r/src/components/layout/status-bar/status-bar.tsx +73 -0
- package/dist/r/src/components/layout/top-bar/index.ts +10 -0
- package/dist/r/src/components/layout/top-bar/top-bar.tsx +166 -0
- package/dist/r/src/components/motion/index.ts +2 -0
- package/dist/r/src/components/motion/presence.tsx +32 -0
- package/dist/r/src/components/theme/appearance-panel.tsx +179 -0
- package/dist/r/src/components/theme/index.ts +22 -0
- package/dist/r/src/components/theme/theme-picker.tsx +174 -0
- package/dist/r/src/components/theme/theme-provider.tsx +309 -0
- package/dist/r/src/components/theme/theme-toggle.tsx +64 -0
- package/dist/r/src/components/ui/accordion/accordion.tsx +66 -0
- package/dist/r/src/components/ui/accordion/index.ts +1 -0
- package/dist/r/src/components/ui/alert/alert.tsx +95 -0
- package/dist/r/src/components/ui/alert/index.ts +1 -0
- package/dist/r/src/components/ui/alert-dialog/alert-dialog.tsx +176 -0
- package/dist/r/src/components/ui/alert-dialog/index.ts +13 -0
- package/dist/r/src/components/ui/aspect-ratio/aspect-ratio.tsx +38 -0
- package/dist/r/src/components/ui/aspect-ratio/index.ts +1 -0
- package/dist/r/src/components/ui/avatar/avatar.tsx +114 -0
- package/dist/r/src/components/ui/avatar/index.ts +9 -0
- package/dist/r/src/components/ui/badge/badge.tsx +59 -0
- package/dist/r/src/components/ui/badge/index.ts +1 -0
- package/dist/r/src/components/ui/board/board.tsx +254 -0
- package/dist/r/src/components/ui/board/index.ts +10 -0
- package/dist/r/src/components/ui/breadcrumb/breadcrumb.tsx +117 -0
- package/dist/r/src/components/ui/breadcrumb/index.ts +9 -0
- package/dist/r/src/components/ui/button/button.tsx +89 -0
- package/dist/r/src/components/ui/button/index.ts +1 -0
- package/dist/r/src/components/ui/button-group/button-group.tsx +92 -0
- package/dist/r/src/components/ui/button-group/index.ts +6 -0
- package/dist/r/src/components/ui/calendar/calendar.tsx +277 -0
- package/dist/r/src/components/ui/calendar/index.ts +1 -0
- package/dist/r/src/components/ui/card/card.tsx +82 -0
- package/dist/r/src/components/ui/card/index.ts +10 -0
- package/dist/r/src/components/ui/carousel/carousel.tsx +209 -0
- package/dist/r/src/components/ui/carousel/index.ts +1 -0
- package/dist/r/src/components/ui/chart/chart.tsx +413 -0
- package/dist/r/src/components/ui/chart/index.ts +17 -0
- package/dist/r/src/components/ui/checkbox/checkbox.tsx +99 -0
- package/dist/r/src/components/ui/checkbox/index.ts +1 -0
- package/dist/r/src/components/ui/code-block/code-block.tsx +238 -0
- package/dist/r/src/components/ui/code-block/index.ts +1 -0
- package/dist/r/src/components/ui/collapsible/collapsible.tsx +54 -0
- package/dist/r/src/components/ui/collapsible/index.ts +1 -0
- package/dist/r/src/components/ui/combobox/combobox.tsx +142 -0
- package/dist/r/src/components/ui/combobox/index.ts +10 -0
- package/dist/r/src/components/ui/command/command.tsx +214 -0
- package/dist/r/src/components/ui/command/index.ts +12 -0
- package/dist/r/src/components/ui/context-menu/context-menu.tsx +163 -0
- package/dist/r/src/components/ui/context-menu/index.ts +15 -0
- package/dist/r/src/components/ui/detail-panel/detail-panel.tsx +161 -0
- package/dist/r/src/components/ui/detail-panel/index.ts +9 -0
- package/dist/r/src/components/ui/dialog/dialog.tsx +138 -0
- package/dist/r/src/components/ui/dialog/index.ts +14 -0
- package/dist/r/src/components/ui/diff-block/diff-block.tsx +286 -0
- package/dist/r/src/components/ui/diff-block/index.ts +11 -0
- package/dist/r/src/components/ui/drawer/drawer.tsx +144 -0
- package/dist/r/src/components/ui/drawer/index.ts +13 -0
- package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +203 -0
- package/dist/r/src/components/ui/dropdown-menu/index.ts +18 -0
- package/dist/r/src/components/ui/empty/empty.tsx +104 -0
- package/dist/r/src/components/ui/empty/index.ts +10 -0
- package/dist/r/src/components/ui/entity-icon/entity-icon.tsx +154 -0
- package/dist/r/src/components/ui/entity-icon/index.ts +1 -0
- package/dist/r/src/components/ui/field/field.tsx +131 -0
- package/dist/r/src/components/ui/field/index.ts +11 -0
- package/dist/r/src/components/ui/hover-card/hover-card.tsx +48 -0
- package/dist/r/src/components/ui/hover-card/index.ts +1 -0
- package/dist/r/src/components/ui/input/index.ts +1 -0
- package/dist/r/src/components/ui/input/input.tsx +41 -0
- package/dist/r/src/components/ui/input-group/index.ts +8 -0
- package/dist/r/src/components/ui/input-group/input-group.tsx +111 -0
- package/dist/r/src/components/ui/input-otp/index.ts +1 -0
- package/dist/r/src/components/ui/input-otp/input-otp.tsx +108 -0
- package/dist/r/src/components/ui/item/index.ts +10 -0
- package/dist/r/src/components/ui/item/item.tsx +146 -0
- package/dist/r/src/components/ui/kbd/index.ts +1 -0
- package/dist/r/src/components/ui/kbd/kbd.tsx +42 -0
- package/dist/r/src/components/ui/label/index.ts +1 -0
- package/dist/r/src/components/ui/label/label.tsx +36 -0
- package/dist/r/src/components/ui/menubar/index.ts +16 -0
- package/dist/r/src/components/ui/menubar/menubar.tsx +190 -0
- package/dist/r/src/components/ui/modal-dialog/index.ts +1 -0
- package/dist/r/src/components/ui/modal-dialog/modal-dialog.tsx +95 -0
- package/dist/r/src/components/ui/navigation-menu/index.ts +13 -0
- package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +229 -0
- package/dist/r/src/components/ui/pagination/index.ts +8 -0
- package/dist/r/src/components/ui/pagination/pagination.tsx +144 -0
- package/dist/r/src/components/ui/popover/index.ts +10 -0
- package/dist/r/src/components/ui/popover/popover.tsx +81 -0
- package/dist/r/src/components/ui/progress/index.ts +1 -0
- package/dist/r/src/components/ui/progress/progress.tsx +67 -0
- package/dist/r/src/components/ui/radio-group/index.ts +1 -0
- package/dist/r/src/components/ui/radio-group/radio-group.tsx +78 -0
- package/dist/r/src/components/ui/resizable/index.ts +6 -0
- package/dist/r/src/components/ui/resizable/resizable.tsx +74 -0
- package/dist/r/src/components/ui/scroll-area/index.ts +1 -0
- package/dist/r/src/components/ui/scroll-area/scroll-area.tsx +66 -0
- package/dist/r/src/components/ui/select/index.ts +11 -0
- package/dist/r/src/components/ui/select/select.tsx +188 -0
- package/dist/r/src/components/ui/separator/index.ts +1 -0
- package/dist/r/src/components/ui/separator/separator.tsx +40 -0
- package/dist/r/src/components/ui/sheet/index.ts +13 -0
- package/dist/r/src/components/ui/sheet/sheet.tsx +132 -0
- package/dist/r/src/components/ui/skeleton/index.ts +1 -0
- package/dist/r/src/components/ui/skeleton/skeleton.tsx +28 -0
- package/dist/r/src/components/ui/slider/index.ts +1 -0
- package/dist/r/src/components/ui/slider/slider.tsx +81 -0
- package/dist/r/src/components/ui/spinner/index.ts +1 -0
- package/dist/r/src/components/ui/spinner/spinner.tsx +58 -0
- package/dist/r/src/components/ui/status-chip/index.ts +8 -0
- package/dist/r/src/components/ui/status-chip/status-chip.tsx +142 -0
- package/dist/r/src/components/ui/switch/index.ts +1 -0
- package/dist/r/src/components/ui/switch/switch.tsx +100 -0
- package/dist/r/src/components/ui/table/index.ts +11 -0
- package/dist/r/src/components/ui/table/table.tsx +125 -0
- package/dist/r/src/components/ui/tabs/index.ts +8 -0
- package/dist/r/src/components/ui/tabs/tabs.tsx +77 -0
- package/dist/r/src/components/ui/textarea/index.ts +1 -0
- package/dist/r/src/components/ui/textarea/textarea.tsx +36 -0
- package/dist/r/src/components/ui/toast/index.ts +1 -0
- package/dist/r/src/components/ui/toast/toast.tsx +220 -0
- package/dist/r/src/components/ui/toggle/index.ts +1 -0
- package/dist/r/src/components/ui/toggle/toggle.tsx +60 -0
- package/dist/r/src/components/ui/toggle-group/index.ts +6 -0
- package/dist/r/src/components/ui/toggle-group/toggle-group.tsx +66 -0
- package/dist/r/src/components/ui/tooltip/index.ts +9 -0
- package/dist/r/src/components/ui/tooltip/tooltip.tsx +102 -0
- package/dist/r/src/lib/keyed-rows.ts +68 -0
- package/dist/r/src/lib/overlay.ts +70 -0
- package/dist/r/src/lib/themes.ts +490 -0
- package/dist/r/src/lib/tokens.ts +688 -0
- package/dist/r/src/lib/utils.ts +76 -0
- package/dist/r/src/lib/variants.ts +62 -0
- package/dist/r/src/lib/version-notes.ts +65 -0
- package/dist/r/src/styles/base.css +644 -0
- package/dist/r/src/styles/fonts.css +26 -0
- package/dist/r/src/styles/globals.css +18 -0
- package/dist/r/src/styles/theme.css +864 -0
- package/dist/r/stat.json +3 -1
- package/dist/r/status-bar.json +3 -1
- package/dist/r/status-chip.json +2 -1
- package/dist/r/switch.json +3 -1
- package/dist/r/table.json +3 -1
- package/dist/r/tabs.json +3 -1
- package/dist/r/textarea.json +3 -1
- package/dist/r/theming.json +42 -0
- package/dist/r/toast.json +3 -1
- package/dist/r/toggle-group.json +2 -1
- package/dist/r/toggle.json +3 -1
- package/dist/r/tooltip.json +3 -1
- package/dist/r/top-bar.json +3 -1
- package/dist/r/update-dialog.json +2 -1
- package/dist/r/workspace-mark.json +2 -1
- package/package.json +10 -9
- package/registry.json +320 -73
- package/src/index.ts +2 -4
- package/dist/components/ui/diff-block/diff-block.test.d.ts +0 -2
- package/dist/components/ui/diff-block/diff-block.test.d.ts.map +0 -1
- package/dist/lib/keyed-rows.test.d.ts +0 -2
- package/dist/lib/keyed-rows.test.d.ts.map +0 -1
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { ComponentProps, JSX } from 'solid-js'
|
|
2
|
+
import { Show, splitProps } from 'solid-js'
|
|
3
|
+
import { cn } from '../../../lib/utils'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* PageHeader.
|
|
7
|
+
*
|
|
8
|
+
* The title block at the top of a scrollable page: where the user is, what this
|
|
9
|
+
* page is, and the actions that apply to the whole of it.
|
|
10
|
+
*
|
|
11
|
+
* The action slot is single and singular on purpose. A page header with four
|
|
12
|
+
* equally-weighted buttons has not decided what the page is for; the design
|
|
13
|
+
* system can only make that look tidy, not make it true. Put the primary action
|
|
14
|
+
* here and the rest in an overflow menu or on the rows they belong to.
|
|
15
|
+
*/
|
|
16
|
+
export function PageHeader(props: ComponentProps<'header'>) {
|
|
17
|
+
const [local, rest] = splitProps(props, ['class'])
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<header
|
|
21
|
+
data-slot="page-header"
|
|
22
|
+
class={cn(
|
|
23
|
+
'flex shrink-0 flex-wrap items-start justify-between gap-x-4 gap-y-3 px-5 pt-5 pb-4',
|
|
24
|
+
local.class
|
|
25
|
+
)}
|
|
26
|
+
{...rest}
|
|
27
|
+
/>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function PageHeaderContent(props: ComponentProps<'div'>) {
|
|
32
|
+
const [local, rest] = splitProps(props, ['class'])
|
|
33
|
+
return (
|
|
34
|
+
<div
|
|
35
|
+
data-slot="page-header-content"
|
|
36
|
+
class={cn('flex min-w-0 flex-col gap-1', local.class)}
|
|
37
|
+
{...rest}
|
|
38
|
+
/>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function PageHeaderTitle(props: ComponentProps<'h1'>) {
|
|
43
|
+
const [local, rest] = splitProps(props, ['class'])
|
|
44
|
+
return (
|
|
45
|
+
<h1
|
|
46
|
+
data-slot="page-header-title"
|
|
47
|
+
class={cn('text-xl font-semibold tracking-tight', local.class)}
|
|
48
|
+
{...rest}
|
|
49
|
+
/>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function PageHeaderDescription(props: ComponentProps<'p'>) {
|
|
54
|
+
const [local, rest] = splitProps(props, ['class'])
|
|
55
|
+
return (
|
|
56
|
+
<p
|
|
57
|
+
data-slot="page-header-description"
|
|
58
|
+
class={cn('max-w-prose text-sm text-muted-foreground text-pretty', local.class)}
|
|
59
|
+
{...rest}
|
|
60
|
+
/>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** The trailing action group. One primary action, at most. */
|
|
65
|
+
export function PageHeaderActions(props: ComponentProps<'div'>) {
|
|
66
|
+
const [local, rest] = splitProps(props, ['class'])
|
|
67
|
+
return (
|
|
68
|
+
<div
|
|
69
|
+
data-slot="page-header-actions"
|
|
70
|
+
class={cn('flex shrink-0 items-center gap-2', local.class)}
|
|
71
|
+
{...rest}
|
|
72
|
+
/>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* A section inside a page, with an optional title and a description.
|
|
78
|
+
* Sections are separated by space rather than by rules — a page of boxed
|
|
79
|
+
* sections reads as a dashboard, and most pages are not one.
|
|
80
|
+
*/
|
|
81
|
+
export function PageSection(
|
|
82
|
+
props: ComponentProps<'section'> & { title?: string; description?: string; action?: JSX.Element }
|
|
83
|
+
) {
|
|
84
|
+
const [local, rest] = splitProps(props, ['class', 'title', 'description', 'action', 'children'])
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<section
|
|
88
|
+
data-slot="page-section"
|
|
89
|
+
class={cn('flex flex-col gap-3 px-5 py-4', local.class)}
|
|
90
|
+
{...rest}
|
|
91
|
+
>
|
|
92
|
+
<Show when={local.title}>
|
|
93
|
+
<div class="flex items-baseline justify-between gap-3">
|
|
94
|
+
<div class="flex min-w-0 flex-col gap-0.5">
|
|
95
|
+
<h2 class="text-base font-semibold tracking-tight">{local.title}</h2>
|
|
96
|
+
<Show when={local.description}>
|
|
97
|
+
<p class="max-w-prose text-sm text-muted-foreground text-pretty">
|
|
98
|
+
{local.description}
|
|
99
|
+
</p>
|
|
100
|
+
</Show>
|
|
101
|
+
</div>
|
|
102
|
+
<Show when={local.action}>
|
|
103
|
+
<div class="flex shrink-0 items-center gap-2">{local.action}</div>
|
|
104
|
+
</Show>
|
|
105
|
+
</div>
|
|
106
|
+
</Show>
|
|
107
|
+
{local.children}
|
|
108
|
+
</section>
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** The scroll container a page's header and sections sit in. */
|
|
113
|
+
export function Page(props: ComponentProps<'div'>) {
|
|
114
|
+
const [local, rest] = splitProps(props, ['class'])
|
|
115
|
+
return (
|
|
116
|
+
<div
|
|
117
|
+
data-slot="page"
|
|
118
|
+
class={cn('flex min-h-0 flex-1 flex-col overflow-y-auto', local.class)}
|
|
119
|
+
{...rest}
|
|
120
|
+
/>
|
|
121
|
+
)
|
|
122
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import type { ComponentProps } from 'solid-js'
|
|
2
|
+
import { Show, splitProps } from 'solid-js'
|
|
3
|
+
import { cn } from '../../../lib/utils'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Panel.
|
|
7
|
+
*
|
|
8
|
+
* A titled region inside the content area — an editor, an inspector, a list, a
|
|
9
|
+
* terminal. It is the third level of surface after the shell and the sidebar,
|
|
10
|
+
* and like them its parts are fixed: a header with a title and a toolbar, a
|
|
11
|
+
* scrolling body, an optional footer.
|
|
12
|
+
*
|
|
13
|
+
* The body scrolls and the header does not, which is the whole reason this is a
|
|
14
|
+
* component. A panel whose header scrolls away loses the name of what the user
|
|
15
|
+
* is looking at, and every hand-built panel gets this wrong at least once.
|
|
16
|
+
*
|
|
17
|
+
* Component props are `title`-agnostic on purpose: the panel does not decide
|
|
18
|
+
* how large its title is, so an inspector's title and an editor's title agree.
|
|
19
|
+
*/
|
|
20
|
+
export function Panel(props: ComponentProps<'section'>) {
|
|
21
|
+
const [local, rest] = splitProps(props, ['class'])
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<section
|
|
25
|
+
data-slot="panel"
|
|
26
|
+
class={cn(
|
|
27
|
+
'bg-surface flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-hidden',
|
|
28
|
+
local.class
|
|
29
|
+
)}
|
|
30
|
+
{...rest}
|
|
31
|
+
/>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** A panel whose surface is raised, for a panel floating over the canvas. */
|
|
36
|
+
export function PanelCard(props: ComponentProps<'section'>) {
|
|
37
|
+
const [local, rest] = splitProps(props, ['class'])
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Panel
|
|
41
|
+
class={cn(
|
|
42
|
+
'bg-card m-2 h-[calc(100%-1rem)] rounded-xl border border-border shadow-xs',
|
|
43
|
+
local.class
|
|
44
|
+
)}
|
|
45
|
+
{...rest}
|
|
46
|
+
/>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function PanelHeader(props: ComponentProps<'header'>) {
|
|
51
|
+
const [local, rest] = splitProps(props, ['class'])
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<header
|
|
55
|
+
data-slot="panel-header"
|
|
56
|
+
class={cn(
|
|
57
|
+
'flex min-h-(--topbar-height) shrink-0 items-center gap-2 border-b border-border px-3',
|
|
58
|
+
local.class
|
|
59
|
+
)}
|
|
60
|
+
{...rest}
|
|
61
|
+
/>
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function PanelTitle(props: ComponentProps<'h2'>) {
|
|
66
|
+
const [local, rest] = splitProps(props, ['class'])
|
|
67
|
+
return (
|
|
68
|
+
<h2
|
|
69
|
+
data-slot="panel-title"
|
|
70
|
+
class={cn('min-w-0 truncate text-sm font-semibold tracking-tight', local.class)}
|
|
71
|
+
{...rest}
|
|
72
|
+
/>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function PanelDescription(props: ComponentProps<'p'>) {
|
|
77
|
+
const [local, rest] = splitProps(props, ['class'])
|
|
78
|
+
return (
|
|
79
|
+
<p
|
|
80
|
+
data-slot="panel-description"
|
|
81
|
+
class={cn('truncate text-xs text-muted-foreground', local.class)}
|
|
82
|
+
{...rest}
|
|
83
|
+
/>
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** The trailing group in a panel header: buttons, tabs, a menu. */
|
|
88
|
+
export function PanelActions(props: ComponentProps<'div'>) {
|
|
89
|
+
const [local, rest] = splitProps(props, ['class'])
|
|
90
|
+
return (
|
|
91
|
+
<div
|
|
92
|
+
data-slot="panel-actions"
|
|
93
|
+
class={cn('ms-auto flex shrink-0 items-center gap-1', local.class)}
|
|
94
|
+
{...rest}
|
|
95
|
+
/>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** A secondary row under the header: a toolbar, tabs, a filter bar. */
|
|
100
|
+
export function PanelToolbar(props: ComponentProps<'div'>) {
|
|
101
|
+
const [local, rest] = splitProps(props, ['class'])
|
|
102
|
+
return (
|
|
103
|
+
<div
|
|
104
|
+
data-slot="panel-toolbar"
|
|
105
|
+
class={cn(
|
|
106
|
+
'flex min-h-9 shrink-0 items-center gap-1.5 border-b border-border px-2',
|
|
107
|
+
local.class
|
|
108
|
+
)}
|
|
109
|
+
{...rest}
|
|
110
|
+
/>
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The scrolling region.
|
|
116
|
+
*
|
|
117
|
+
* `min-h-0` is required and easy to omit: a flex child's default `min-height`
|
|
118
|
+
* is its content, so without it a long body pushes the panel past its parent
|
|
119
|
+
* instead of scrolling.
|
|
120
|
+
*/
|
|
121
|
+
export function PanelBody(
|
|
122
|
+
props: ComponentProps<'div'> & { /** Remove the default padding. */ bare?: boolean }
|
|
123
|
+
) {
|
|
124
|
+
const [local, rest] = splitProps(props, ['class', 'bare'])
|
|
125
|
+
|
|
126
|
+
return (
|
|
127
|
+
<div
|
|
128
|
+
data-slot="panel-body"
|
|
129
|
+
class={cn('min-h-0 flex-1 overflow-y-auto', { 'p-3': !local.bare }, local.class)}
|
|
130
|
+
{...rest}
|
|
131
|
+
/>
|
|
132
|
+
)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function PanelFooter(props: ComponentProps<'footer'>) {
|
|
136
|
+
const [local, rest] = splitProps(props, ['class'])
|
|
137
|
+
return (
|
|
138
|
+
<footer
|
|
139
|
+
data-slot="panel-footer"
|
|
140
|
+
class={cn('flex shrink-0 items-center gap-2 border-t border-border px-3 py-2', local.class)}
|
|
141
|
+
{...rest}
|
|
142
|
+
/>
|
|
143
|
+
)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* The centered message a panel shows when it has no content. Distinct from
|
|
148
|
+
* `Empty`, which is a full-page state with room for media and actions; this is
|
|
149
|
+
* the in-pane version, sized for a column.
|
|
150
|
+
*/
|
|
151
|
+
export function PanelPlaceholder(props: ComponentProps<'div'>) {
|
|
152
|
+
const [local, rest] = splitProps(props, ['class', 'children'])
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
<div
|
|
156
|
+
data-slot="panel-placeholder"
|
|
157
|
+
class={cn(
|
|
158
|
+
'text-muted-foreground flex h-full min-h-32 flex-col items-center justify-center gap-2 p-6 text-center text-sm',
|
|
159
|
+
local.class
|
|
160
|
+
)}
|
|
161
|
+
{...rest}
|
|
162
|
+
>
|
|
163
|
+
<Show when={local.children}>{local.children}</Show>
|
|
164
|
+
</div>
|
|
165
|
+
)
|
|
166
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createContext, createMemo, useContext } from 'solid-js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The side rail's collapse state, shared with its items.
|
|
5
|
+
*
|
|
6
|
+
* A rail has two forms — icon-only and labelled — and every item has to agree
|
|
7
|
+
* about which is showing. Threading a `collapsed` prop through each item would
|
|
8
|
+
* work in a demo and break in practice, because an app composes its rail from
|
|
9
|
+
* several components (a brand, a section, a footer) and would have to remember
|
|
10
|
+
* to pass the flag to all of them.
|
|
11
|
+
*
|
|
12
|
+
* Context makes the rail's form a property of the rail rather than an argument
|
|
13
|
+
* every caller repeats. The items still decide what to *do* about it: a hidden
|
|
14
|
+
* label must become a tooltip, not simply disappear.
|
|
15
|
+
*/
|
|
16
|
+
type SideRailContextValue = {
|
|
17
|
+
collapsed: () => boolean
|
|
18
|
+
/** Width the rail occupies, so a layout can reserve it without measuring. */
|
|
19
|
+
width: () => string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const SideRailContext = createContext<SideRailContextValue>()
|
|
23
|
+
|
|
24
|
+
export function useSideRail(): SideRailContextValue {
|
|
25
|
+
const value = useContext(SideRailContext)
|
|
26
|
+
if (!value) {
|
|
27
|
+
throw new Error('useSideRail must be called inside a <SideRail>.')
|
|
28
|
+
}
|
|
29
|
+
return value
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { SideRailContext }
|
|
33
|
+
|
|
34
|
+
export function createSideRailValue(
|
|
35
|
+
collapsed: () => boolean,
|
|
36
|
+
width: () => string
|
|
37
|
+
): SideRailContextValue {
|
|
38
|
+
return {
|
|
39
|
+
collapsed: createMemo(() => collapsed()),
|
|
40
|
+
width,
|
|
41
|
+
}
|
|
42
|
+
}
|