@bridge-ui/vue 0.4.0 → 0.5.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/ai/skills/bridge-ui-components/SKILL.md +3 -1
- package/dist/Components/Accordion/accordionInjectionKey.d.ts +1 -0
- package/dist/Components/Accordion/composables/useAccordion.js +3 -2
- package/dist/Components/AccordionItem/composables/useAccordionItem.js +1 -0
- package/dist/Components/DataTable/DataTable.vue.d.ts +1 -1
- package/dist/Components/DataTable/DataTable.vue_vue_type_script_setup_true_lang.js +96 -92
- package/dist/Components/DataTable/composables/useDataTable.d.ts +1 -1
- package/dist/Components/DataTable/composables/useDataTable.js +1 -1
- package/dist/Components/EmptyState/EmptyState.js +5 -0
- package/dist/Components/EmptyState/EmptyState.vue.d.ts +16 -0
- package/dist/Components/EmptyState/EmptyState.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/Components/EmptyState/composables/useEmptyState.d.ts +24 -0
- package/dist/Components/EmptyState/composables/useEmptyState.js +76 -0
- package/dist/Components/EmptyState/emptyState.types.d.ts +140 -0
- package/dist/Components/EmptyState/index.d.ts +3 -0
- package/dist/Components/EmptyState/index.js +3 -0
- package/dist/Components/List/composables/useList.d.ts +3 -1
- package/dist/Components/List/composables/useList.js +2 -2
- package/dist/Components/ListItem/ListItem.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/Components/ListSection/ListSection.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/Components/ListSection/composables/useListSection.d.ts +1 -0
- package/dist/Components/ListSection/composables/useListSection.js +30 -28
- package/dist/Components/ListSection/listSectionInjectionKey.d.ts +5 -0
- package/dist/Components/ListSection/listSectionInjectionKey.js +4 -0
- package/dist/Components/Sidebar/Sidebar.js +5 -0
- package/dist/Components/Sidebar/Sidebar.vue.d.ts +16 -0
- package/dist/Components/Sidebar/Sidebar.vue_vue_type_script_setup_true_lang.js +59 -0
- package/dist/Components/Sidebar/SidebarInset.js +5 -0
- package/dist/Components/Sidebar/SidebarInset.vue.d.ts +11 -0
- package/dist/Components/Sidebar/SidebarInset.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/Components/Sidebar/SidebarList.js +5 -0
- package/dist/Components/Sidebar/SidebarList.vue.d.ts +16 -0
- package/dist/Components/Sidebar/SidebarList.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/Components/Sidebar/SidebarListItem.js +5 -0
- package/dist/Components/Sidebar/SidebarListItem.vue.d.ts +13 -0
- package/dist/Components/Sidebar/SidebarListItem.vue_vue_type_script_setup_true_lang.js +120 -0
- package/dist/Components/Sidebar/SidebarProvider.js +5 -0
- package/dist/Components/Sidebar/SidebarProvider.vue.d.ts +24 -0
- package/dist/Components/Sidebar/SidebarProvider.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/Components/Sidebar/SidebarTrigger.js +5 -0
- package/dist/Components/Sidebar/SidebarTrigger.vue.d.ts +11 -0
- package/dist/Components/Sidebar/SidebarTrigger.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/Components/Sidebar/composables/useSidebar.d.ts +6 -0
- package/dist/Components/Sidebar/composables/useSidebar.js +10 -0
- package/dist/Components/Sidebar/composables/useSidebarInset.d.ts +7 -0
- package/dist/Components/Sidebar/composables/useSidebarInset.js +32 -0
- package/dist/Components/Sidebar/composables/useSidebarList.d.ts +8 -0
- package/dist/Components/Sidebar/composables/useSidebarList.js +27 -0
- package/dist/Components/Sidebar/composables/useSidebarListItem.d.ts +15 -0
- package/dist/Components/Sidebar/composables/useSidebarListItem.js +44 -0
- package/dist/Components/Sidebar/composables/useSidebarProvider.d.ts +18 -0
- package/dist/Components/Sidebar/composables/useSidebarProvider.js +88 -0
- package/dist/Components/Sidebar/composables/useSidebarShell.d.ts +41 -0
- package/dist/Components/Sidebar/composables/useSidebarShell.js +116 -0
- package/dist/Components/Sidebar/composables/useSidebarTrigger.d.ts +10 -0
- package/dist/Components/Sidebar/composables/useSidebarTrigger.js +25 -0
- package/dist/Components/Sidebar/index.d.ts +15 -0
- package/dist/Components/Sidebar/index.js +15 -0
- package/dist/Components/Sidebar/sidebar.types.d.ts +244 -0
- package/dist/Components/Sidebar/sidebarInjectionKey.d.ts +80 -0
- package/dist/Components/Sidebar/sidebarInjectionKey.js +4 -0
- package/dist/Components/Sidebar/sidebarListInjectionKey.d.ts +5 -0
- package/dist/Components/Sidebar/sidebarListInjectionKey.js +4 -0
- package/dist/Components/Slider/Slider.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/augments.d.ts +10 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +79 -64
- package/docs/README.md +2 -0
- package/docs/ScrollUtilities.md +1 -1
- package/docs/components/DataTable.md +1 -1
- package/docs/components/Drawer.md +1 -1
- package/docs/components/EmptyState.md +125 -0
- package/docs/components/List.md +1 -1
- package/docs/components/Sidebar.md +281 -0
- package/docs/examples/icon-fontawesome.ts +1 -0
- package/docs/examples/icon-heroicons.ts +2 -0
- package/docs/examples/icon-lucide.ts +2 -0
- package/docs/examples/icon-phosphor.ts +2 -0
- package/docs/examples/icon-tabler.ts +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# EmptyState
|
|
2
|
+
|
|
3
|
+
Placeholder when a list, table, or view has no data. Title, description, optional media, and actions. Pass illustration through the `media` slot or `icon` — Bridge does not ship a stock set.
|
|
4
|
+
|
|
5
|
+
Does not set `role` by default. Pass `role="status"` when the empty state is a live update.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { EmptyState } from "@bridge-ui/vue/Components/EmptyState";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Usage
|
|
16
|
+
|
|
17
|
+
```vue
|
|
18
|
+
<EmptyState
|
|
19
|
+
icon="search"
|
|
20
|
+
title="No projects yet"
|
|
21
|
+
description="Create your first project to get started."
|
|
22
|
+
>
|
|
23
|
+
<template #action>
|
|
24
|
+
<Button color="primary">New project</Button>
|
|
25
|
+
</template>
|
|
26
|
+
</EmptyState>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Compact
|
|
30
|
+
|
|
31
|
+
```vue
|
|
32
|
+
<EmptyState size="sm" title="No results" description="Try another filter." />
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Alignment
|
|
36
|
+
|
|
37
|
+
```vue
|
|
38
|
+
<EmptyState
|
|
39
|
+
align="start"
|
|
40
|
+
title="No files"
|
|
41
|
+
description="Drop a file here to get started."
|
|
42
|
+
/>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Heading
|
|
46
|
+
|
|
47
|
+
Use `title-as` when the page outline needs a heading. The default is `p` so the block is safe inside tables and lists.
|
|
48
|
+
|
|
49
|
+
```vue
|
|
50
|
+
<EmptyState title-as="h2" title="No projects yet" />
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Media slot
|
|
54
|
+
|
|
55
|
+
```vue
|
|
56
|
+
<EmptyState
|
|
57
|
+
title="No projects yet"
|
|
58
|
+
description="Create your first project to get started."
|
|
59
|
+
>
|
|
60
|
+
<template #media>
|
|
61
|
+
<Icon icon="search" />
|
|
62
|
+
</template>
|
|
63
|
+
<template #action>
|
|
64
|
+
<Button color="primary">New project</Button>
|
|
65
|
+
<Button variant="flat">Learn more</Button>
|
|
66
|
+
</template>
|
|
67
|
+
</EmptyState>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### DataTable
|
|
71
|
+
|
|
72
|
+
Override the DataTable default with a richer `EmptyState` via `#empty`.
|
|
73
|
+
|
|
74
|
+
```vue
|
|
75
|
+
<DataTable :rows="[]" :columns="columns">
|
|
76
|
+
<template #empty>
|
|
77
|
+
<EmptyState
|
|
78
|
+
size="sm"
|
|
79
|
+
title="No users"
|
|
80
|
+
description="Invite a teammate to get started."
|
|
81
|
+
>
|
|
82
|
+
<template #action>
|
|
83
|
+
<Button size="sm">Invite</Button>
|
|
84
|
+
</template>
|
|
85
|
+
</EmptyState>
|
|
86
|
+
</template>
|
|
87
|
+
</DataTable>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### customProps
|
|
91
|
+
|
|
92
|
+
```vue
|
|
93
|
+
<EmptyState
|
|
94
|
+
title="No results"
|
|
95
|
+
description="Try another filter."
|
|
96
|
+
:custom-props="{
|
|
97
|
+
title: { id: 'empty-title' },
|
|
98
|
+
media: { 'aria-hidden': true },
|
|
99
|
+
root: { id: 'empty-root', role: 'status' },
|
|
100
|
+
description: { 'aria-describedby': 'empty-title' },
|
|
101
|
+
}"
|
|
102
|
+
/>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Props
|
|
106
|
+
|
|
107
|
+
| Prop | Type | Default | Description |
|
|
108
|
+
| ----------------- | ----------------------- | ---------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
109
|
+
| `align` | `EmptyStateAlign` | `"center"` | Horizontal alignment of the stack (`start`, `center`, `end`). |
|
|
110
|
+
| `classes` | `EmptyStateClasses` | — | Part classes (`root`, `media`, `title`, `description`, `actions`, `icon`). |
|
|
111
|
+
| `customProps` | `EmptyStateCustomProps` | — | Extra props for internal parts (`media`, `title`, `description`, etc.). Root HTML attributes stay on the component top level. |
|
|
112
|
+
| `description` | `string` | — | Supporting copy below the title. |
|
|
113
|
+
| `icon` | `IconSource` | — | Default media icon. Use the `media` slot to replace it. |
|
|
114
|
+
| `mediaDecorative` | `boolean` | `true` | When true, the media wrapper is hidden from assistive tech. |
|
|
115
|
+
| `size` | `EmptyStateSize` | `"md"` | Spacing and typography scale (`sm`, `md`, `lg`). |
|
|
116
|
+
| `title` | `string` | — | Primary heading copy. |
|
|
117
|
+
| `titleAs` | `"p" \| "h1"` … `"h6"` | `"p"` | Element used to render `title`. |
|
|
118
|
+
|
|
119
|
+
## Accessibility
|
|
120
|
+
|
|
121
|
+
Keep default media decorative (`media-decorative`). Set `media-decorative` to `false` when the illustration conveys meaning that is not in the title or description. Use `title-as` with a heading level when the empty state is the main content of the view. For live updates after a filter or fetch, pass `role="status"`.
|
|
122
|
+
|
|
123
|
+
## Related components
|
|
124
|
+
|
|
125
|
+
Alert, Card, DataTable, Icon, List, Skeleton, Table
|
package/docs/components/List.md
CHANGED
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
# Sidebar
|
|
2
|
+
|
|
3
|
+
Persistent app-shell rail. Mount `SidebarProvider` around `Sidebar` and `SidebarInset` as siblings. Put `SidebarList` / `Accordion` in the default slot. On small viewports the panel opens as a `Drawer`.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import {
|
|
9
|
+
Sidebar,
|
|
10
|
+
SidebarInset,
|
|
11
|
+
SidebarList,
|
|
12
|
+
SidebarListItem,
|
|
13
|
+
SidebarProvider,
|
|
14
|
+
SidebarTrigger,
|
|
15
|
+
useSidebar,
|
|
16
|
+
} from "@bridge-ui/vue/Components/Sidebar";
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Prerequisites
|
|
20
|
+
|
|
21
|
+
Mount `SidebarProvider` around the app shell (`Sidebar` and `SidebarInset` as siblings) before using `SidebarTrigger` or `useSidebar`.
|
|
22
|
+
|
|
23
|
+
`BridgeUIProvider` still holds theme, tokens, and `defaultProps`. It does not own instance `open` state.
|
|
24
|
+
|
|
25
|
+
## Examples
|
|
26
|
+
|
|
27
|
+
### Usage
|
|
28
|
+
|
|
29
|
+
```vue
|
|
30
|
+
<SidebarProvider>
|
|
31
|
+
<Sidebar>
|
|
32
|
+
<SidebarList>
|
|
33
|
+
<SidebarListItem interactive primary="Home" />
|
|
34
|
+
<SidebarListItem interactive primary="Settings" />
|
|
35
|
+
</SidebarList>
|
|
36
|
+
</Sidebar>
|
|
37
|
+
<SidebarInset>
|
|
38
|
+
<SidebarTrigger />
|
|
39
|
+
<slot />
|
|
40
|
+
</SidebarInset>
|
|
41
|
+
</SidebarProvider>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Header and footer
|
|
45
|
+
|
|
46
|
+
Put brand and account rows in `#header` / `#footer`. `SidebarList` collapses those rows to the start avatar. The end chevron hides while collapsed. Header and footer lists use `classes.root` `p-0` because those slots are already padded.
|
|
47
|
+
|
|
48
|
+
```vue
|
|
49
|
+
<template>
|
|
50
|
+
<SidebarList :classes="{ root: 'p-0' }">
|
|
51
|
+
<SidebarListItem interactive primary="Acme Inc" secondary="Enterprise">
|
|
52
|
+
<template #end>
|
|
53
|
+
<Icon icon="chevronUpDown" />
|
|
54
|
+
</template>
|
|
55
|
+
<template #start>
|
|
56
|
+
<Avatar size="sm" rounded="lg" fallback="A" color="primary" />
|
|
57
|
+
</template>
|
|
58
|
+
</SidebarListItem>
|
|
59
|
+
</SidebarList>
|
|
60
|
+
</template>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```vue
|
|
64
|
+
<template>
|
|
65
|
+
<SidebarList :classes="{ root: 'p-0' }">
|
|
66
|
+
<SidebarListItem
|
|
67
|
+
interactive
|
|
68
|
+
primary="Ada Lovelace"
|
|
69
|
+
secondary="ada@example.com"
|
|
70
|
+
>
|
|
71
|
+
<template #end>
|
|
72
|
+
<Icon icon="chevronUpDown" />
|
|
73
|
+
</template>
|
|
74
|
+
<template #start>
|
|
75
|
+
<Avatar size="sm" rounded="lg" fallback="AL" />
|
|
76
|
+
</template>
|
|
77
|
+
</SidebarListItem>
|
|
78
|
+
</SidebarList>
|
|
79
|
+
</template>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
```vue
|
|
83
|
+
<SidebarProvider>
|
|
84
|
+
<Sidebar collapsible="icon">
|
|
85
|
+
<template #header>
|
|
86
|
+
<Brand />
|
|
87
|
+
</template>
|
|
88
|
+
<SidebarList>
|
|
89
|
+
<SidebarListItem interactive primary="Home" />
|
|
90
|
+
</SidebarList>
|
|
91
|
+
<template #footer>
|
|
92
|
+
<Account />
|
|
93
|
+
</template>
|
|
94
|
+
</Sidebar>
|
|
95
|
+
<SidebarInset>
|
|
96
|
+
<SidebarTrigger />
|
|
97
|
+
<slot />
|
|
98
|
+
</SidebarInset>
|
|
99
|
+
</SidebarProvider>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Icon collapse
|
|
103
|
+
|
|
104
|
+
Use `SidebarList` / `SidebarListItem` when `collapsible="icon"`. Collapsed items keep `primary` as an `aria-label` and show it in a `Tooltip` on the whole item. Nested `SidebarList` is hidden. The mobile drawer keeps labels.
|
|
105
|
+
|
|
106
|
+
```vue
|
|
107
|
+
<template>
|
|
108
|
+
<SidebarList>
|
|
109
|
+
<ListSection title="Application" />
|
|
110
|
+
<SidebarListItem interactive primary="Home">
|
|
111
|
+
<template #start>
|
|
112
|
+
<Icon icon="user" />
|
|
113
|
+
</template>
|
|
114
|
+
</SidebarListItem>
|
|
115
|
+
</SidebarList>
|
|
116
|
+
</template>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```vue
|
|
120
|
+
<SidebarProvider>
|
|
121
|
+
<Sidebar collapsible="icon">
|
|
122
|
+
<template #header>
|
|
123
|
+
<Brand />
|
|
124
|
+
</template>
|
|
125
|
+
<Nav />
|
|
126
|
+
<template #footer>
|
|
127
|
+
<Account />
|
|
128
|
+
</template>
|
|
129
|
+
</Sidebar>
|
|
130
|
+
<SidebarInset>
|
|
131
|
+
<SidebarTrigger />
|
|
132
|
+
<slot />
|
|
133
|
+
</SidebarInset>
|
|
134
|
+
</SidebarProvider>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Controlled
|
|
138
|
+
|
|
139
|
+
```vue
|
|
140
|
+
<SidebarProvider v-model="open">
|
|
141
|
+
<Sidebar>
|
|
142
|
+
<SidebarList>
|
|
143
|
+
<SidebarListItem interactive primary="Home" />
|
|
144
|
+
</SidebarList>
|
|
145
|
+
</Sidebar>
|
|
146
|
+
<SidebarInset>
|
|
147
|
+
<SidebarTrigger />
|
|
148
|
+
<slot />
|
|
149
|
+
</SidebarInset>
|
|
150
|
+
</SidebarProvider>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Right side
|
|
154
|
+
|
|
155
|
+
```vue
|
|
156
|
+
<SidebarProvider>
|
|
157
|
+
<Sidebar side="right">
|
|
158
|
+
<SidebarList>
|
|
159
|
+
<SidebarListItem interactive primary="Inbox" />
|
|
160
|
+
</SidebarList>
|
|
161
|
+
</Sidebar>
|
|
162
|
+
<SidebarInset>
|
|
163
|
+
<SidebarTrigger />
|
|
164
|
+
<slot />
|
|
165
|
+
</SidebarInset>
|
|
166
|
+
</SidebarProvider>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Inset variant
|
|
170
|
+
|
|
171
|
+
```vue
|
|
172
|
+
<SidebarProvider>
|
|
173
|
+
<Sidebar variant="inset">
|
|
174
|
+
<SidebarList>
|
|
175
|
+
<SidebarListItem interactive primary="Home" />
|
|
176
|
+
</SidebarList>
|
|
177
|
+
</Sidebar>
|
|
178
|
+
<SidebarInset>
|
|
179
|
+
<SidebarTrigger />
|
|
180
|
+
<slot />
|
|
181
|
+
</SidebarInset>
|
|
182
|
+
</SidebarProvider>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Collapsible groups
|
|
186
|
+
|
|
187
|
+
```vue
|
|
188
|
+
<SidebarProvider>
|
|
189
|
+
<Sidebar>
|
|
190
|
+
<Accordion variant="plain">
|
|
191
|
+
<AccordionItem title="Projects" value="projects">
|
|
192
|
+
<SidebarList :classes="{ root: 'p-0' }">
|
|
193
|
+
<SidebarListItem interactive primary="Alpha" />
|
|
194
|
+
<SidebarListItem interactive primary="Beta" />
|
|
195
|
+
</SidebarList>
|
|
196
|
+
</AccordionItem>
|
|
197
|
+
</Accordion>
|
|
198
|
+
</Sidebar>
|
|
199
|
+
<SidebarInset>
|
|
200
|
+
<SidebarTrigger />
|
|
201
|
+
<slot />
|
|
202
|
+
</SidebarInset>
|
|
203
|
+
</SidebarProvider>
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Props (`SidebarProvider`)
|
|
207
|
+
|
|
208
|
+
| Prop | Type | Default | Description |
|
|
209
|
+
| ------------------ | ---------------------------- | ------- | -------------------------------------------- |
|
|
210
|
+
| `classes` | `SidebarProviderClasses` | — | Part classes (`root`). |
|
|
211
|
+
| `customProps` | `SidebarProviderCustomProps` | — | Extra props for the layout wrapper. |
|
|
212
|
+
| `defaultOpen` | `boolean` | `true` | Uncontrolled initial desktop expanded state. |
|
|
213
|
+
| `v-model` | `boolean` | — | Controlled desktop expanded state. |
|
|
214
|
+
| `v-on:open-change` | `(open: boolean)` | — | Emitted when desktop `open` should change. |
|
|
215
|
+
|
|
216
|
+
## Props (`Sidebar`)
|
|
217
|
+
|
|
218
|
+
| Prop | Type | Default | Description |
|
|
219
|
+
| ------------- | --------------------------------- | ------------- | ------------------------------------------------------ |
|
|
220
|
+
| `ariaLabel` | `string` | `"Sidebar"` | Accessible name for the `aside` and the mobile drawer. |
|
|
221
|
+
| `classes` | `SidebarClasses` | — | Part classes (`root`, `header`, `content`, …). |
|
|
222
|
+
| `collapsible` | `"icon" \| "none" \| "offcanvas"` | `"offcanvas"` | How the desktop rail hides. |
|
|
223
|
+
| `customProps` | `SidebarCustomProps` | — | Extra props for internal parts. |
|
|
224
|
+
| `side` | `"left" \| "right"` | `"left"` | Edge the rail docks to. |
|
|
225
|
+
| `variant` | `"inset" \| "sidebar"` | `"sidebar"` | Flush rail or padded main column. |
|
|
226
|
+
|
|
227
|
+
## Slots (`Sidebar`)
|
|
228
|
+
|
|
229
|
+
| Slot | Description |
|
|
230
|
+
| --------- | ------------------------------------------- |
|
|
231
|
+
| `default` | Rail content (`SidebarList` / `Accordion`). |
|
|
232
|
+
| `footer` | Sticky footer. |
|
|
233
|
+
| `header` | Sticky header. |
|
|
234
|
+
|
|
235
|
+
## Props (`SidebarInset`)
|
|
236
|
+
|
|
237
|
+
| Prop | Type | Default | Description |
|
|
238
|
+
| ------------- | ------------------------- | ------- | ------------------------------- |
|
|
239
|
+
| `classes` | `SidebarInsetClasses` | — | Part classes (`root`). |
|
|
240
|
+
| `customProps` | `SidebarInsetCustomProps` | — | Extra props for the inset root. |
|
|
241
|
+
|
|
242
|
+
## Props (`SidebarTrigger`)
|
|
243
|
+
|
|
244
|
+
Renders a `Button`. Forwards native button attributes. Default accessible name is `Toggle sidebar`.
|
|
245
|
+
|
|
246
|
+
## Props (`SidebarList`)
|
|
247
|
+
|
|
248
|
+
Same as `List`, plus `icon-only`. Sets `icon-only` when the icon rail is collapsed on desktop. Applies stacked nav chrome (gap, compact rows, nested guide). Override with `icon-only`. Nested `SidebarList` is hidden while collapsed. `ListSection` labels are hidden while collapsed.
|
|
249
|
+
|
|
250
|
+
## Props (`SidebarListItem`)
|
|
251
|
+
|
|
252
|
+
Same as `ListItem`, plus `tooltip` / `tooltip-placement`. Applies compact nav chrome. Tooltips only show while the icon rail is collapsed (`primary`, or `tooltip` to override).
|
|
253
|
+
|
|
254
|
+
## `useSidebar`
|
|
255
|
+
|
|
256
|
+
Must be called under `SidebarProvider`. Returns a computed context object (`sidebar.value.open`, …).
|
|
257
|
+
|
|
258
|
+
| Field | Type | Description |
|
|
259
|
+
| --------------- | --------------------------------- | ---------------------------------------------- |
|
|
260
|
+
| `collapsible` | `"icon" \| "none" \| "offcanvas"` | Mode from the nearest `Sidebar`. |
|
|
261
|
+
| `isMobile` | `boolean` | Viewport is below `md` (desktop rail CSS). |
|
|
262
|
+
| `open` | `boolean` | Desktop expanded state. |
|
|
263
|
+
| `openMobile` | `boolean` | Mobile drawer visibility. |
|
|
264
|
+
| `setOpen` | `(open: boolean) => void` | Sets desktop `open`. |
|
|
265
|
+
| `setOpenMobile` | `(open: boolean) => void` | Sets mobile drawer visibility. |
|
|
266
|
+
| `side` | `"left" \| "right"` | Dock edge. |
|
|
267
|
+
| `state` | `"collapsed" \| "expanded"` | Desktop visual state. |
|
|
268
|
+
| `toggleSidebar` | `() => void` | Toggles desktop `open` or mobile `openMobile`. |
|
|
269
|
+
| `variant` | `"inset" \| "sidebar"` | Visual variant. |
|
|
270
|
+
|
|
271
|
+
## Accessibility
|
|
272
|
+
|
|
273
|
+
- Desktop panel is an `aside` with `aria-label`
|
|
274
|
+
- Offcanvas collapsed panel is `inert` (out of the tab order)
|
|
275
|
+
- Mobile uses `Drawer` (dialog, overlay, Escape)
|
|
276
|
+
- Trigger sets `aria-expanded` and `aria-controls`
|
|
277
|
+
- `SidebarListItem` copies string `primary` to `aria-label` when collapsed
|
|
278
|
+
|
|
279
|
+
## Related components
|
|
280
|
+
|
|
281
|
+
Accordion, Avatar, Button, Drawer, List, ListItem, ListSection, Tooltip
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import {
|
|
9
9
|
ArrowDownTrayIcon,
|
|
10
10
|
ArrowPathIcon,
|
|
11
|
+
Bars3Icon,
|
|
11
12
|
BellIcon,
|
|
12
13
|
CalendarDaysIcon,
|
|
13
14
|
CheckCircleIcon,
|
|
@@ -51,6 +52,7 @@ const icons = {
|
|
|
51
52
|
filter: FunnelIcon,
|
|
52
53
|
palette: SwatchIcon,
|
|
53
54
|
eyeOff: EyeSlashIcon,
|
|
55
|
+
panelLeft: Bars3Icon,
|
|
54
56
|
loader: ArrowPathIcon,
|
|
55
57
|
success: CheckCircleIcon,
|
|
56
58
|
chevronUp: ChevronUpIcon,
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
Loader2,
|
|
28
28
|
Minus,
|
|
29
29
|
Palette,
|
|
30
|
+
PanelLeft,
|
|
30
31
|
Plus,
|
|
31
32
|
Search,
|
|
32
33
|
TriangleAlert,
|
|
@@ -60,6 +61,7 @@ const icons = {
|
|
|
60
61
|
download: Download,
|
|
61
62
|
success: CircleCheck,
|
|
62
63
|
chevronUp: ChevronUp,
|
|
64
|
+
panelLeft: PanelLeft,
|
|
63
65
|
warning: TriangleAlert,
|
|
64
66
|
chevronDown: ChevronDown,
|
|
65
67
|
chevronLeft: ChevronLeft,
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
PhMinus,
|
|
27
27
|
PhPalette,
|
|
28
28
|
PhPlus,
|
|
29
|
+
PhSidebar,
|
|
29
30
|
PhSpinnerGap,
|
|
30
31
|
PhUser,
|
|
31
32
|
PhWarning,
|
|
@@ -56,6 +57,7 @@ const icons = {
|
|
|
56
57
|
warning: PhWarning,
|
|
57
58
|
loader: PhSpinnerGap,
|
|
58
59
|
chevronUp: PhCaretUp,
|
|
60
|
+
panelLeft: PhSidebar,
|
|
59
61
|
alert: PhWarningCircle,
|
|
60
62
|
success: PhCheckCircle,
|
|
61
63
|
chevronDown: PhCaretDown,
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
IconEyeOff,
|
|
25
25
|
IconFilter,
|
|
26
26
|
IconInfoCircle,
|
|
27
|
+
IconLayoutSidebar,
|
|
27
28
|
IconLoader2,
|
|
28
29
|
IconMinus,
|
|
29
30
|
IconPalette,
|
|
@@ -62,6 +63,7 @@ const icons = {
|
|
|
62
63
|
warning: IconAlertTriangle,
|
|
63
64
|
chevronUpDown: IconSelector,
|
|
64
65
|
calendar: IconCalendarMonth,
|
|
66
|
+
panelLeft: IconLayoutSidebar,
|
|
65
67
|
chevronDown: IconChevronDown,
|
|
66
68
|
chevronLeft: IconChevronLeft,
|
|
67
69
|
chevronRight: IconChevronRight,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"author": "BridgeUI",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"name": "@bridge-ui/vue",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@bridge-ui/core": "^0.
|
|
92
|
+
"@bridge-ui/core": "^0.5.0",
|
|
93
93
|
"clsx": "^2.1.1",
|
|
94
94
|
"es-toolkit": "^1.50.0",
|
|
95
95
|
"tailwind-merge": "^3.6.0"
|