@tailor-platform/app-shell 1.15.0 → 1.17.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/dist/app-shell-core.css +1 -1
- package/dist/app-shell.d.ts +811 -131
- package/dist/app-shell.js +7155 -5797
- package/dist/{appshell-DLVBFo5J.js → appshell-CahhZy7v.js} +656 -524
- package/dist/semantic-contrast.test.ts +154 -0
- package/dist/style-entry.d.ts +147 -92
- package/dist/testing.d.ts +152 -95
- package/dist/testing.js +1 -1
- package/dist/theme-bridge.test.ts +101 -1
- package/dist/theme.bridge.css +91 -0
- package/dist/theme.css +6 -1
- package/dist/themes/_template.css +7 -1
- package/dist/themes/bloom.css +0 -6
- package/dist/themes/cream.css +0 -6
- package/dist/themes/default.css +389 -69
- package/dist/vite-plugin.d.ts +147 -92
- package/package.json +8 -8
- package/skills/app-shell-patterns/SKILL.md +108 -19
- package/skills/app-shell-patterns/references/api/create-ai-gateway-client.md +115 -0
- package/skills/app-shell-patterns/references/api/create-typed-paths.md +117 -0
- package/skills/app-shell-patterns/references/api/define-i18n-labels.md +143 -0
- package/skills/app-shell-patterns/references/api/define-module.md +247 -0
- package/skills/app-shell-patterns/references/api/define-resource.md +307 -0
- package/skills/app-shell-patterns/references/api/guards/hidden.md +202 -0
- package/skills/app-shell-patterns/references/api/guards/overview.md +354 -0
- package/skills/app-shell-patterns/references/api/guards/pass.md +129 -0
- package/skills/app-shell-patterns/references/api/guards/redirect-to.md +307 -0
- package/skills/app-shell-patterns/references/api/router/use-location.md +240 -0
- package/skills/app-shell-patterns/references/api/router/use-navigate.md +138 -0
- package/skills/app-shell-patterns/references/api/router/use-params.md +218 -0
- package/skills/app-shell-patterns/references/api/use-ai-chat.md +110 -0
- package/skills/app-shell-patterns/references/api/use-app-shell-config.md +132 -0
- package/skills/app-shell-patterns/references/api/use-app-shell-data.md +150 -0
- package/skills/app-shell-patterns/references/api/use-app-shell.md +150 -0
- package/skills/app-shell-patterns/references/api/use-auth.md +145 -0
- package/skills/app-shell-patterns/references/api/use-override-breadcrumb.md +74 -0
- package/skills/app-shell-patterns/references/api/use-page-meta.md +96 -0
- package/skills/app-shell-patterns/references/api/use-register-command-palette-actions.md +90 -0
- package/skills/app-shell-patterns/references/api/use-resolved-locale.md +67 -0
- package/skills/app-shell-patterns/references/api/use-route-error.md +214 -0
- package/skills/app-shell-patterns/references/api/use-theme.md +108 -0
- package/skills/app-shell-patterns/references/api/use-time-zone.md +80 -0
- package/skills/app-shell-patterns/references/api/use-toast.md +104 -0
- package/skills/app-shell-patterns/references/components/action-panel.md +168 -0
- package/skills/app-shell-patterns/references/components/activity-card.md +142 -0
- package/skills/app-shell-patterns/references/components/ai-chat.md +315 -0
- package/skills/app-shell-patterns/references/components/alert.md +202 -0
- package/skills/app-shell-patterns/references/components/app-shell.md +530 -0
- package/skills/app-shell-patterns/references/components/appearance-switcher.md +87 -0
- package/skills/app-shell-patterns/references/components/attachment.md +138 -0
- package/skills/app-shell-patterns/references/components/autocomplete.md +278 -0
- package/skills/app-shell-patterns/references/components/avatar.md +80 -0
- package/skills/app-shell-patterns/references/components/badge.md +309 -0
- package/skills/app-shell-patterns/references/components/button.md +164 -0
- package/skills/app-shell-patterns/references/components/card.md +181 -0
- package/skills/app-shell-patterns/references/components/checkbox.md +169 -0
- package/skills/app-shell-patterns/references/components/combobox.md +318 -0
- package/skills/app-shell-patterns/references/components/command-palette.md +413 -0
- package/skills/app-shell-patterns/references/components/csv-importer.md +214 -0
- package/skills/app-shell-patterns/references/components/data-table.md +1168 -0
- package/skills/app-shell-patterns/references/components/date-picker.md +259 -0
- package/skills/app-shell-patterns/references/components/default-header.md +75 -0
- package/skills/app-shell-patterns/references/components/default-sidebar.md +136 -0
- package/skills/app-shell-patterns/references/components/description-card.md +569 -0
- package/skills/app-shell-patterns/references/components/dialog.md +164 -0
- package/skills/app-shell-patterns/references/components/document-progress-card.md +154 -0
- package/skills/app-shell-patterns/references/components/filter-rail.md +165 -0
- package/skills/app-shell-patterns/references/components/form.md +378 -0
- package/skills/app-shell-patterns/references/components/global-header-layout.md +132 -0
- package/skills/app-shell-patterns/references/components/grid.md +184 -0
- package/skills/app-shell-patterns/references/components/input.md +83 -0
- package/skills/app-shell-patterns/references/components/layout.md +539 -0
- package/skills/app-shell-patterns/references/components/menu.md +218 -0
- package/skills/app-shell-patterns/references/components/metric-card.md +94 -0
- package/skills/app-shell-patterns/references/components/select.md +283 -0
- package/skills/app-shell-patterns/references/components/sheet.md +237 -0
- package/skills/app-shell-patterns/references/components/sidebar-group.md +472 -0
- package/skills/app-shell-patterns/references/components/sidebar-item.md +458 -0
- package/skills/app-shell-patterns/references/components/sidebar-layout.md +258 -0
- package/skills/app-shell-patterns/references/components/sidebar-section.md +114 -0
- package/skills/app-shell-patterns/references/components/spinner.md +81 -0
- package/skills/app-shell-patterns/references/components/table.md +188 -0
- package/skills/app-shell-patterns/references/components/tabs.md +158 -0
- package/skills/app-shell-patterns/references/components/textarea.md +122 -0
- package/skills/app-shell-patterns/references/components/timeline.md +317 -0
- package/skills/app-shell-patterns/references/components/toolbar.md +138 -0
- package/skills/app-shell-patterns/references/components/tooltip.md +144 -0
- package/skills/app-shell-patterns/references/components/with-guard.md +445 -0
- package/skills/app-shell-patterns/references/concepts/authentication.md +301 -0
- package/skills/app-shell-patterns/references/concepts/custom-components.md +59 -0
- package/skills/app-shell-patterns/references/concepts/file-based-routing.md +356 -0
- package/skills/app-shell-patterns/references/{fundamental → concepts}/graphql.md +31 -18
- package/skills/app-shell-patterns/references/concepts/modules-and-resources.md +229 -0
- package/skills/app-shell-patterns/references/concepts/routing-navigation.md +425 -0
- package/skills/app-shell-patterns/references/concepts/sidebar-navigation.md +420 -0
- package/skills/app-shell-patterns/references/concepts/styling-theming.md +785 -0
- package/skills/app-shell-patterns/references/migrations.md +55 -0
- package/skills/app-shell-patterns/references/pages/{detail.md → document-detail.md} +10 -33
- package/skills/app-shell-patterns/references/patterns/form-composer.md +43 -45
- package/skills/app-shell-patterns/references/patterns/form-modal.md +37 -92
- package/skills/app-shell-patterns/references/patterns/form-sectioned.md +12 -38
- package/skills/app-shell-patterns/references/patterns/form-single-page.md +11 -32
- package/skills/app-shell-patterns/references/patterns/form-wizard.md +12 -53
- package/skills/app-shell-patterns/references/patterns/interaction-confirm.md +11 -27
- package/skills/app-shell-patterns/references/patterns/interaction-multi-select.md +136 -139
- package/skills/app-shell-patterns/references/patterns/interaction-toast.md +10 -34
- package/skills/app-shell-patterns/references/patterns/list-dense-scan.md +13 -88
- package/skills/app-shell-patterns/references/fundamental/components.md +0 -1009
- package/skills/app-shell-patterns/references/fundamental/design-system.md +0 -440
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Toolbar
|
|
3
|
+
description: Full-width action bars with composable rows, grouped controls, and keyboard navigation
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- GENERATED by docs-kit from docs-src/components/toolbar.docs.outline.md — do not edit by hand. -->
|
|
7
|
+
|
|
8
|
+
# Toolbar
|
|
9
|
+
|
|
10
|
+
`Toolbar` is a full-width action bar. It is independent of `DataTable`: place any AppShell or application control in it, including buttons, search fields, selects, comboboxes, and tabs.
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import { Toolbar } from "@tailor-platform/app-shell";
|
|
14
|
+
|
|
15
|
+
<Toolbar.Root>
|
|
16
|
+
<Toolbar.Row justify="between" aria-label="Order actions">
|
|
17
|
+
<Toolbar.Group>
|
|
18
|
+
<Button variant="outline">Export</Button>
|
|
19
|
+
</Toolbar.Group>
|
|
20
|
+
<Toolbar.Group>
|
|
21
|
+
<Button>New order</Button>
|
|
22
|
+
</Toolbar.Group>
|
|
23
|
+
</Toolbar.Row>
|
|
24
|
+
</Toolbar.Root>;
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Structure
|
|
28
|
+
|
|
29
|
+
`Toolbar.Root` stacks rows. `Toolbar.Row` is one horizontal, keyboard-navigable action row. Use `Toolbar.Group` to keep related controls together and `Toolbar.Separator` to divide groups.
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
<Toolbar.Root>
|
|
33
|
+
<Toolbar.Row justify="between" aria-label="Text formatting">
|
|
34
|
+
<Toolbar.Group>
|
|
35
|
+
<Button>Bold</Button>
|
|
36
|
+
<Button>Italic</Button>
|
|
37
|
+
<Toolbar.Separator />
|
|
38
|
+
<Button>Copy</Button>
|
|
39
|
+
</Toolbar.Group>
|
|
40
|
+
|
|
41
|
+
<Toolbar.Group>
|
|
42
|
+
<Button>Save</Button>
|
|
43
|
+
</Toolbar.Group>
|
|
44
|
+
</Toolbar.Row>
|
|
45
|
+
|
|
46
|
+
<Toolbar.Row aria-label="Active filters">
|
|
47
|
+
<Toolbar.Group>
|
|
48
|
+
<Button variant="secondary">Status: Open</Button>
|
|
49
|
+
</Toolbar.Group>
|
|
50
|
+
</Toolbar.Row>
|
|
51
|
+
</Toolbar.Root>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Row alignment
|
|
55
|
+
|
|
56
|
+
Use `justify="between"` when a row has one leading and one trailing group. The row places those outer groups at opposite edges. The default, `"start"`, keeps every group at the leading edge.
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
<Toolbar.Row justify="between" aria-label="List actions">
|
|
60
|
+
<Toolbar.Group>{/* search and filters */}</Toolbar.Group>
|
|
61
|
+
<Toolbar.Group>{/* export and create actions */}</Toolbar.Group>
|
|
62
|
+
</Toolbar.Row>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Keep controls that belong to the leading region in the same group. `justify="between"` distributes **direct** groups, so a separator should also stay inside that group.
|
|
66
|
+
|
|
67
|
+
### Sizing fields
|
|
68
|
+
|
|
69
|
+
`Input` keeps its normal `w-full` behavior inside a toolbar. Give a field an explicit layout box when it shares a group with other controls.
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
<Toolbar.Group>
|
|
73
|
+
<div className="w-52">
|
|
74
|
+
<Input placeholder="Search orders" />
|
|
75
|
+
</div>
|
|
76
|
+
<Combobox className="w-40" items={users} placeholder="Assignee" />
|
|
77
|
+
<Select className="w-40" items={sortOptions} />
|
|
78
|
+
</Toolbar.Group>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Keyboard navigation
|
|
82
|
+
|
|
83
|
+
Every row has `role="toolbar"` and supports `ArrowLeft`, `ArrowRight`, `Home`, and `End` for registered AppShell controls. Disabled controls are skipped and focus loops at either end.
|
|
84
|
+
|
|
85
|
+
AppShell `Button`, `Input`, `Select`, `Combobox`, and `Tabs.Tab` register automatically when rendered inside a row. Composite controls retain their own directional keys: arrows move the caret in an input, move between tabs, or navigate an open select/combobox. Use `Tab` to leave a composite control.
|
|
86
|
+
|
|
87
|
+
Each row should have an accessible name via `aria-label` or `aria-labelledby`.
|
|
88
|
+
|
|
89
|
+
## DataTable example
|
|
90
|
+
|
|
91
|
+
`DataTable.Filters` and `DataTable.ColumnSettings` are ordinary toolbar controls. They can be placed wherever the layout requires.
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
<DataTable.Root value={table}>
|
|
95
|
+
<Toolbar.Root>
|
|
96
|
+
<Toolbar.Row justify="between" aria-label="Invoice table controls">
|
|
97
|
+
<Toolbar.Group>
|
|
98
|
+
<DataTable.Filters />
|
|
99
|
+
</Toolbar.Group>
|
|
100
|
+
<Toolbar.Group>
|
|
101
|
+
<DataTable.ColumnSettings />
|
|
102
|
+
</Toolbar.Group>
|
|
103
|
+
</Toolbar.Row>
|
|
104
|
+
</Toolbar.Root>
|
|
105
|
+
<DataTable.Table />
|
|
106
|
+
</DataTable.Root>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
When a generic toolbar is a direct child of `DataTable.Root`, DataTable retains its outer top corners and turns the toolbar border into only the divider beneath the toolbar.
|
|
110
|
+
|
|
111
|
+
## API
|
|
112
|
+
|
|
113
|
+
### `Toolbar.Root`
|
|
114
|
+
|
|
115
|
+
| Prop | Type | Default | Description |
|
|
116
|
+
| ----------- | ----------- | ------- | ------------------------------------------------ |
|
|
117
|
+
| `children` | `ReactNode` | — | One or more `Toolbar.Row` elements. |
|
|
118
|
+
| `className` | `string` | — | Additional classes for the full-width container. |
|
|
119
|
+
|
|
120
|
+
### `Toolbar.Row`
|
|
121
|
+
|
|
122
|
+
| Prop | Type | Default | Description |
|
|
123
|
+
| -------------------------------- | ---------------------- | --------- | ------------------------------------------------------- |
|
|
124
|
+
| `children` | `ReactNode` | — | Groups and separators in this horizontal row. |
|
|
125
|
+
| `justify` | `"start" \| "between"` | `"start"` | Align direct groups at the start, or at opposite edges. |
|
|
126
|
+
| `aria-label` / `aria-labelledby` | `string` | — | Accessible name for this toolbar row. |
|
|
127
|
+
| `className` | `string` | — | Additional classes for the row. |
|
|
128
|
+
|
|
129
|
+
### `Toolbar.Group`
|
|
130
|
+
|
|
131
|
+
| Prop | Type | Default | Description |
|
|
132
|
+
| ----------- | ----------- | ------- | ----------------------------------------------------------- |
|
|
133
|
+
| `children` | `ReactNode` | — | Related controls arranged horizontally and allowed to wrap. |
|
|
134
|
+
| `className` | `string` | — | Additional classes for the group. |
|
|
135
|
+
|
|
136
|
+
### `Toolbar.Separator`
|
|
137
|
+
|
|
138
|
+
A vertical, accessible separator between related control groups. It accepts `className` for visual customization.
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Tooltip
|
|
3
|
+
description: Hover/focus tooltip with configurable placement and shared delay via Tooltip.Provider
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- GENERATED by docs-kit from docs-src/components/tooltip.docs.outline.md — do not edit by hand. -->
|
|
7
|
+
|
|
8
|
+
# Tooltip
|
|
9
|
+
|
|
10
|
+
The `Tooltip` component displays contextual information on hover or focus. It is backed by Base UI's Tooltip primitive.
|
|
11
|
+
|
|
12
|
+
## Import
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
import { Tooltip } from "@tailor-platform/app-shell";
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Basic Usage
|
|
19
|
+
|
|
20
|
+
<example-preview name="basic-usage"></example-preview>
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
function BasicUsage() {
|
|
24
|
+
return (
|
|
25
|
+
<Tooltip.Root>
|
|
26
|
+
<Tooltip.Trigger render={<Button variant="outline" />}>Hover me</Tooltip.Trigger>
|
|
27
|
+
<Tooltip.Content>Helpful information</Tooltip.Content>
|
|
28
|
+
</Tooltip.Root>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Sub-components
|
|
34
|
+
|
|
35
|
+
| Sub-component | Description |
|
|
36
|
+
| ------------------ | ----------------------------------------------------------- |
|
|
37
|
+
| `Tooltip.Provider` | Provides shared delay configuration for all nested tooltips |
|
|
38
|
+
| `Tooltip.Root` | Manages tooltip open/close state |
|
|
39
|
+
| `Tooltip.Trigger` | Element that shows the tooltip on hover or focus |
|
|
40
|
+
| `Tooltip.Content` | The tooltip popup containing the help text |
|
|
41
|
+
|
|
42
|
+
## Props
|
|
43
|
+
|
|
44
|
+
### Tooltip.Provider Props
|
|
45
|
+
|
|
46
|
+
Wrap a section of your UI (e.g. a toolbar) with `Tooltip.Provider` to share delay settings across multiple tooltips.
|
|
47
|
+
|
|
48
|
+
| Prop | Type | Default | Description |
|
|
49
|
+
| ------------ | ----------------- | ------- | --------------------------------------------------- |
|
|
50
|
+
| `delay` | `number` | `0` | Delay in ms before the tooltip opens (milliseconds) |
|
|
51
|
+
| `closeDelay` | `number` | - | Delay in ms before the tooltip closes |
|
|
52
|
+
| `timeout` | `number` | - | Timeout in ms after which the tooltip auto-closes |
|
|
53
|
+
| `children` | `React.ReactNode` | - | Nested tooltip components |
|
|
54
|
+
|
|
55
|
+
### Tooltip.Root Props
|
|
56
|
+
|
|
57
|
+
| Prop | Type | Default | Description |
|
|
58
|
+
| -------------- | ------------------------- | ------- | --------------------------------- |
|
|
59
|
+
| `open` | `boolean` | - | Controlled open state |
|
|
60
|
+
| `defaultOpen` | `boolean` | `false` | Initial open state (uncontrolled) |
|
|
61
|
+
| `onOpenChange` | `(open: boolean) => void` | - | Callback when open state changes |
|
|
62
|
+
| `children` | `React.ReactNode` | - | Tooltip sub-components |
|
|
63
|
+
|
|
64
|
+
### Tooltip.Content Props
|
|
65
|
+
|
|
66
|
+
| Prop | Type | Default | Description |
|
|
67
|
+
| ------------ | ---------------------------------------- | ---------- | -------------------------------------------------------- |
|
|
68
|
+
| `side` | `"top" \| "right" \| "bottom" \| "left"` | `"top"` | Preferred placement of the tooltip |
|
|
69
|
+
| `align` | `"start" \| "center" \| "end"` | `"center"` | Alignment along the placement axis |
|
|
70
|
+
| `sideOffset` | `number` | `5` | Distance in px from the trigger |
|
|
71
|
+
| `noArrow` | `boolean` | `false` | When `true`, suppresses the arrow indicator on the popup |
|
|
72
|
+
| `className` | `string` | - | Additional CSS classes |
|
|
73
|
+
| `children` | `React.ReactNode` | - | Tooltip text or content |
|
|
74
|
+
|
|
75
|
+
## Placement
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
<Tooltip.Root>
|
|
79
|
+
<Tooltip.Trigger render={<Button />}>Trigger</Tooltip.Trigger>
|
|
80
|
+
<Tooltip.Content side="right" align="start">
|
|
81
|
+
Appears on the right
|
|
82
|
+
</Tooltip.Content>
|
|
83
|
+
</Tooltip.Root>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Shared Delay with Provider
|
|
87
|
+
|
|
88
|
+
Use `Tooltip.Provider` to avoid tooltips opening immediately in dense UIs like toolbars:
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
<Tooltip.Provider delay={300}>
|
|
92
|
+
<Toolbar>
|
|
93
|
+
<Tooltip.Root>
|
|
94
|
+
<Tooltip.Trigger render={<Button size="icon" />}>
|
|
95
|
+
<BoldIcon />
|
|
96
|
+
</Tooltip.Trigger>
|
|
97
|
+
<Tooltip.Content>Bold</Tooltip.Content>
|
|
98
|
+
</Tooltip.Root>
|
|
99
|
+
<Tooltip.Root>
|
|
100
|
+
<Tooltip.Trigger render={<Button size="icon" />}>
|
|
101
|
+
<ItalicIcon />
|
|
102
|
+
</Tooltip.Trigger>
|
|
103
|
+
<Tooltip.Content>Italic</Tooltip.Content>
|
|
104
|
+
</Tooltip.Root>
|
|
105
|
+
</Toolbar>
|
|
106
|
+
</Tooltip.Provider>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Examples
|
|
110
|
+
|
|
111
|
+
### Icon Button with Tooltip
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
import { PencilIcon } from "lucide-react";
|
|
115
|
+
|
|
116
|
+
<Tooltip.Root>
|
|
117
|
+
<Tooltip.Trigger render={<Button size="icon" variant="ghost" />}>
|
|
118
|
+
<PencilIcon />
|
|
119
|
+
<span className="sr-only">Edit</span>
|
|
120
|
+
</Tooltip.Trigger>
|
|
121
|
+
<Tooltip.Content>Edit order</Tooltip.Content>
|
|
122
|
+
</Tooltip.Root>;
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Controlled Tooltip
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
const [open, setOpen] = useState(false);
|
|
129
|
+
|
|
130
|
+
<Tooltip.Root open={open} onOpenChange={setOpen}>
|
|
131
|
+
<Tooltip.Trigger render={<Button />}>Info</Tooltip.Trigger>
|
|
132
|
+
<Tooltip.Content>Additional details here</Tooltip.Content>
|
|
133
|
+
</Tooltip.Root>;
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Accessibility
|
|
137
|
+
|
|
138
|
+
- Tooltip content is rendered in a portal
|
|
139
|
+
- Trigger receives focus and keyboard activation support
|
|
140
|
+
- `sr-only` text on icon-only triggers is recommended for screen readers
|
|
141
|
+
|
|
142
|
+
## Related Components
|
|
143
|
+
|
|
144
|
+
- [Button](./button.md) - Common trigger element for tooltips
|