@bridge-ui/vue 0.0.7 → 0.0.8
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/AGENTS.md +31 -0
- package/ai/README.md +35 -0
- package/ai/guidelines/core.md +44 -0
- package/ai/llms.txt +38 -0
- package/ai/skills/bridge-ui-components/SKILL.md +37 -0
- package/ai/skills/bridge-ui-forms/SKILL.md +38 -0
- package/ai/skills/bridge-ui-overlays/SKILL.md +37 -0
- package/ai/skills/bridge-ui-setup/SKILL.md +38 -0
- package/bin/__tests__/ai.test.ts +319 -0
- package/bin/ai.mjs +469 -0
- package/dist/Adapters/I18n/useI18nAdapter.d.ts +1 -1
- package/dist/Adapters/Icon/useIconAdapter.d.ts +1 -1
- package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +5 -5
- package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +3 -2
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +6 -2
- package/dist/Components/Avatar/composables/useAvatar.d.ts +1 -1
- package/dist/Components/BaseField/BaseField.js +5 -0
- package/dist/Components/BaseField/BaseField.vue.d.ts +15 -0
- package/dist/Components/BaseField/BaseField.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/Components/BaseField/BaseFieldLabel.js +5 -0
- package/dist/Components/{OtpField/OtpFieldLabel.vue.d.ts → BaseField/BaseFieldLabel.vue.d.ts} +2 -2
- package/dist/Components/{OtpField/OtpFieldLabel.vue_vue_type_script_setup_true_lang.js → BaseField/BaseFieldLabel.vue_vue_type_script_setup_true_lang.js} +2 -2
- package/dist/Components/BaseField/baseField.types.d.ts +222 -0
- package/dist/Components/BaseField/composables/useBaseField.d.ts +55 -0
- package/dist/Components/BaseField/composables/useBaseField.js +131 -0
- package/dist/Components/BaseField/index.d.ts +4 -0
- package/dist/Components/BaseField/index.js +3 -0
- package/dist/Components/Button/composables/useButton.d.ts +1 -1
- package/dist/Components/Checkbox/composables/useCheckbox.d.ts +1 -1
- package/dist/Components/Checkbox/composables/useCheckbox.js +1 -1
- package/dist/Components/Chip/Chip.vue.d.ts +1 -1
- package/dist/Components/Chip/composables/useChip.d.ts +1 -1
- package/dist/Components/Drawer/Drawer.vue.d.ts +2 -2
- package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -1
- package/dist/Components/FormControl/composables/useFormControl.d.ts +11 -2
- package/dist/Components/FormControl/composables/useFormControl.js +57 -53
- package/dist/Components/FormControl/index.d.ts +1 -1
- package/dist/Components/FormField/composables/useFormField.d.ts +5 -1
- package/dist/Components/FormField/composables/useFormField.js +1 -1
- package/dist/Components/ListItem/ListItem.vue.d.ts +1 -1
- package/dist/Components/ListItem/composables/useListItem.d.ts +1 -1
- package/dist/Components/Listbox/Listbox.vue.d.ts +3 -3
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/Components/Listbox/composables/useListbox.d.ts +10 -1
- package/dist/Components/Listbox/composables/useListbox.js +20 -20
- package/dist/Components/Listbox/index.d.ts +1 -0
- package/dist/Components/Listbox/listbox.types.d.ts +6 -0
- package/dist/Components/Menu/Menu.vue.d.ts +2 -2
- package/dist/Components/Modal/Modal.vue.d.ts +2 -2
- package/dist/Components/Modal/composables/useModal.d.ts +1 -1
- package/dist/Components/NumberField/NumberField.vue.d.ts +2 -2
- package/dist/Components/NumberField/composables/useNumberField.d.ts +2 -2
- package/dist/Components/NumberField/composables/useNumberField.js +4 -1
- package/dist/Components/OtpField/OtpField.vue.d.ts +3 -3
- package/dist/Components/OtpField/OtpField.vue_vue_type_script_setup_true_lang.js +34 -52
- package/dist/Components/OtpField/composables/useOtpField.d.ts +40 -213
- package/dist/Components/OtpField/composables/useOtpField.js +92 -150
- package/dist/Components/OtpField/otpField.types.d.ts +10 -180
- package/dist/Components/PasswordField/composables/usePasswordField.d.ts +2 -2
- package/dist/Components/PasswordField/composables/usePasswordField.js +4 -1
- package/dist/Components/Radio/composables/useRadio.d.ts +1 -1
- package/dist/Components/Radio/composables/useRadio.js +1 -1
- package/dist/Components/Select/Select.vue.d.ts +4 -4
- package/dist/Components/Select/composables/useSelect.d.ts +3 -2
- package/dist/Components/Select/composables/useSelect.js +6 -2
- package/dist/Components/Slider/Slider.js +5 -0
- package/dist/Components/Slider/Slider.vue.d.ts +25 -0
- package/dist/Components/Slider/Slider.vue_vue_type_script_setup_true_lang.js +113 -0
- package/dist/Components/Slider/composables/useSlider.d.ts +482 -0
- package/dist/Components/Slider/composables/useSlider.js +287 -0
- package/dist/Components/Slider/index.d.ts +4 -0
- package/dist/Components/Slider/index.js +3 -0
- package/dist/Components/Slider/slider.types.d.ts +169 -0
- package/dist/Components/Snackbar/Snackbar.vue.d.ts +2 -2
- package/dist/Components/Switch/composables/useSwitch.d.ts +1 -1
- package/dist/Components/Switch/composables/useSwitch.js +1 -1
- package/dist/Components/Tabs/Tabs.vue.d.ts +2 -2
- package/dist/Components/TextField/composables/useTextField.d.ts +2 -2
- package/dist/Components/TextField/composables/useTextField.js +1 -1
- package/dist/Components/Textarea/composables/useTextarea.d.ts +2 -2
- package/dist/Components/Textarea/composables/useTextarea.js +1 -0
- package/dist/Utils/index.d.ts +3 -3
- package/dist/Utils/index.js +5 -2
- package/dist/augments.d.ts +29 -17
- package/dist/index.d.ts +5 -1
- package/dist/index.js +59 -55
- package/docs/README.md +56 -0
- package/docs/components/Alert.md +96 -0
- package/docs/components/Autocomplete.md +198 -0
- package/docs/components/Avatar.md +60 -0
- package/docs/components/Badge.md +47 -0
- package/docs/components/BaseField.md +126 -0
- package/docs/components/BridgeUIProvider.md +151 -0
- package/docs/components/Button.md +93 -0
- package/docs/components/Card.md +287 -0
- package/docs/components/Checkbox.md +87 -0
- package/docs/components/Divider.md +56 -0
- package/docs/components/Drawer.md +137 -0
- package/docs/components/FormControl.md +66 -0
- package/docs/components/FormField.md +71 -0
- package/docs/components/I18n.md +125 -0
- package/docs/components/Icon.md +88 -0
- package/docs/components/Label.md +31 -0
- package/docs/components/Link.md +71 -0
- package/docs/components/List.md +167 -0
- package/docs/components/Menu.md +97 -0
- package/docs/components/Modal.md +154 -0
- package/docs/components/NumberField.md +80 -0
- package/docs/components/OtpField.md +133 -0
- package/docs/components/PasswordField.md +82 -0
- package/docs/components/Progress.md +68 -0
- package/docs/components/Radio.md +91 -0
- package/docs/components/Select.md +181 -0
- package/docs/components/Skeleton.md +38 -0
- package/docs/components/Slider.md +140 -0
- package/docs/components/Snackbar.md +99 -0
- package/docs/components/Spinner.md +61 -0
- package/docs/components/Switch.md +72 -0
- package/docs/components/Tabs.md +207 -0
- package/docs/components/TextField.md +72 -0
- package/docs/components/Textarea.md +80 -0
- package/docs/components/Tooltip.md +125 -0
- package/docs/components/useBreakpoint.md +100 -0
- package/docs/components/useDialogAction.md +97 -0
- package/docs/components/useDrawerAction.md +75 -0
- package/docs/components/useModalAction.md +75 -0
- package/docs/components/useSnackbarAction.md +85 -0
- package/docs/examples/i18n-dictionary.ts +48 -0
- package/docs/examples/i18n-vue-i18n.ts +34 -0
- package/docs/examples/icon-fontawesome.ts +112 -0
- package/docs/examples/icon-heroicons.ts +57 -0
- package/docs/examples/icon-lucide.ts +57 -0
- package/docs/examples/icon-phosphor.ts +57 -0
- package/docs/examples/icon-tabler.ts +57 -0
- package/package.json +12 -5
- package/dist/Components/OtpField/OtpFieldLabel.js +0 -5
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
# Card
|
|
2
|
+
|
|
3
|
+
Surface container with optional title, action, and footer.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Card } from "@bridge-ui/vue/Components/Card";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<Card title="Card title">
|
|
17
|
+
Card body content goes here.
|
|
18
|
+
</Card>
|
|
19
|
+
|
|
20
|
+
<Card variant="outlined" title="Outlined card">
|
|
21
|
+
Outlined surface with a visible border.
|
|
22
|
+
</Card>
|
|
23
|
+
|
|
24
|
+
<Card title="Confirm changes">
|
|
25
|
+
Review your changes before saving.
|
|
26
|
+
|
|
27
|
+
<template #footer>
|
|
28
|
+
<div class="flex justify-end gap-2">
|
|
29
|
+
<Button size="sm" variant="flat">Cancel</Button>
|
|
30
|
+
|
|
31
|
+
<Button size="sm">Save</Button>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
</Card>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Borderless
|
|
38
|
+
|
|
39
|
+
```vue
|
|
40
|
+
<div class="grid gap-4 sm:grid-cols-2">
|
|
41
|
+
<Card title="With dividers (default)">
|
|
42
|
+
Default card with header and footer dividers.
|
|
43
|
+
|
|
44
|
+
<template #footer>
|
|
45
|
+
<div class="flex justify-end gap-2">
|
|
46
|
+
<Button size="sm" variant="flat">Cancel</Button>
|
|
47
|
+
|
|
48
|
+
<Button size="sm">Save</Button>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
</Card>
|
|
52
|
+
|
|
53
|
+
<Card borderless title="Borderless">
|
|
54
|
+
Header and footer borders are removed.
|
|
55
|
+
|
|
56
|
+
<template #footer>
|
|
57
|
+
<Button size="sm" variant="flat">Cancel</Button>
|
|
58
|
+
|
|
59
|
+
<Button size="sm">Save</Button>
|
|
60
|
+
</template>
|
|
61
|
+
</Card>
|
|
62
|
+
</div>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Title
|
|
66
|
+
|
|
67
|
+
```vue
|
|
68
|
+
<Card title="Via title prop">
|
|
69
|
+
Content rendered via the title prop.
|
|
70
|
+
</Card>
|
|
71
|
+
|
|
72
|
+
<Card>
|
|
73
|
+
<template #title>
|
|
74
|
+
<span class="text-primary-600">Custom title slot</span>
|
|
75
|
+
</template>
|
|
76
|
+
|
|
77
|
+
Content with a custom title slot.
|
|
78
|
+
</Card>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Action slot
|
|
82
|
+
|
|
83
|
+
```vue
|
|
84
|
+
<Card title="Card with actions">
|
|
85
|
+
<template #action>
|
|
86
|
+
<Button
|
|
87
|
+
size="sm"
|
|
88
|
+
variant="flat"
|
|
89
|
+
density="mini"
|
|
90
|
+
aria-label="More options"
|
|
91
|
+
>
|
|
92
|
+
<MoreHorizontal class="size-4" />
|
|
93
|
+
</Button>
|
|
94
|
+
</template>
|
|
95
|
+
|
|
96
|
+
Use the action slot for header controls.
|
|
97
|
+
</Card>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Footer slot
|
|
101
|
+
|
|
102
|
+
```vue
|
|
103
|
+
<Card title="Confirm changes">
|
|
104
|
+
Are you sure you want to proceed?
|
|
105
|
+
|
|
106
|
+
<template #footer>
|
|
107
|
+
<Button size="sm" variant="flat">Cancel</Button>
|
|
108
|
+
|
|
109
|
+
<Button size="sm" color="primary">Confirm</Button>
|
|
110
|
+
</template>
|
|
111
|
+
</Card>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Custom header slot
|
|
115
|
+
|
|
116
|
+
```vue
|
|
117
|
+
<Card>
|
|
118
|
+
<template #header>
|
|
119
|
+
<div
|
|
120
|
+
class="border-secondary-200 bg-primary-50 dark:border-secondary-600 dark:bg-primary-950/30 flex items-center gap-3 border-b px-4 py-3"
|
|
121
|
+
>
|
|
122
|
+
<div
|
|
123
|
+
class="bg-primary-500 flex size-10 items-center justify-center rounded-full text-sm font-semibold text-white"
|
|
124
|
+
>
|
|
125
|
+
JD
|
|
126
|
+
</div>
|
|
127
|
+
<div>
|
|
128
|
+
<p class="font-medium">Jane Doe</p>
|
|
129
|
+
<p class="text-secondary-500 text-sm">Custom header area</p>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
</template>
|
|
133
|
+
|
|
134
|
+
Replaces the default title row entirely.
|
|
135
|
+
</Card>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Full composition
|
|
139
|
+
|
|
140
|
+
```vue
|
|
141
|
+
<Card shadow="lg" rounded="2xl" title="Project settings">
|
|
142
|
+
<template #action>
|
|
143
|
+
<Button size="sm" variant="outline">Edit</Button>
|
|
144
|
+
</template>
|
|
145
|
+
|
|
146
|
+
Title, action, body, and footer together with elevated styling.
|
|
147
|
+
|
|
148
|
+
<template #footer>
|
|
149
|
+
<Button size="sm" color="error" variant="flat">Delete</Button>
|
|
150
|
+
|
|
151
|
+
<Button size="sm" color="primary">Save changes</Button>
|
|
152
|
+
</template>
|
|
153
|
+
</Card>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Partial layouts
|
|
157
|
+
|
|
158
|
+
```vue
|
|
159
|
+
<Card title="Title only (no body children)" />
|
|
160
|
+
|
|
161
|
+
<Card>Card with body content only.</Card>
|
|
162
|
+
|
|
163
|
+
<Card>
|
|
164
|
+
<template #footer>
|
|
165
|
+
<p class="text-secondary-500 text-sm">Footer only</p>
|
|
166
|
+
</template>
|
|
167
|
+
</Card>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Classes
|
|
171
|
+
|
|
172
|
+
```vue
|
|
173
|
+
<Card
|
|
174
|
+
title="Styled parts"
|
|
175
|
+
:classes="{
|
|
176
|
+
footer: 'bg-secondary-50',
|
|
177
|
+
body: 'text-secondary-600',
|
|
178
|
+
root: 'ring-2 ring-primary-200',
|
|
179
|
+
title: 'text-xl font-bold tracking-tight',
|
|
180
|
+
header: 'bg-primary-50 dark:bg-primary-950/20',
|
|
181
|
+
}"
|
|
182
|
+
>
|
|
183
|
+
Body text with custom classes applied.
|
|
184
|
+
|
|
185
|
+
<template #footer>
|
|
186
|
+
<span class="text-sm">Custom footer classes</span>
|
|
187
|
+
</template>
|
|
188
|
+
</Card>
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### customProps
|
|
192
|
+
|
|
193
|
+
```vue
|
|
194
|
+
<Card
|
|
195
|
+
title="Forwarded part attributes"
|
|
196
|
+
:custom-props="{
|
|
197
|
+
title: { id: 'card-demo-title' },
|
|
198
|
+
root: { 'data-testid': 'card-root' },
|
|
199
|
+
header: { 'aria-label': 'Card header' },
|
|
200
|
+
footer: { 'data-testid': 'card-footer' },
|
|
201
|
+
body: { role: 'region', 'aria-labelledby': 'card-demo-title' },
|
|
202
|
+
}"
|
|
203
|
+
>
|
|
204
|
+
Card body with forwarded attributes on each part.
|
|
205
|
+
|
|
206
|
+
<template #footer>
|
|
207
|
+
<span>Inspect DOM for data attributes on each part.</span>
|
|
208
|
+
</template>
|
|
209
|
+
</Card>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Root HTML attributes
|
|
213
|
+
|
|
214
|
+
```vue
|
|
215
|
+
<Card
|
|
216
|
+
id="demo-card"
|
|
217
|
+
role="article"
|
|
218
|
+
class="max-w-md"
|
|
219
|
+
title="Root attrs"
|
|
220
|
+
aria-label="Demo card"
|
|
221
|
+
>
|
|
222
|
+
class and other root HTML props are merged onto the root element.
|
|
223
|
+
</Card>
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Combined
|
|
227
|
+
|
|
228
|
+
```vue
|
|
229
|
+
<Card
|
|
230
|
+
borderless
|
|
231
|
+
shadow="xl"
|
|
232
|
+
rounded="2xl"
|
|
233
|
+
padding="large"
|
|
234
|
+
variant="tonal"
|
|
235
|
+
title="Tonal card"
|
|
236
|
+
:classes="{ body: 'leading-relaxed' }"
|
|
237
|
+
>
|
|
238
|
+
Large padding, 2xl rounded, xl shadow (elevated only — here variant is
|
|
239
|
+
tonal so shadow is ignored), borderless, and custom body classes.
|
|
240
|
+
|
|
241
|
+
<template #action>
|
|
242
|
+
<Button size="sm" variant="flat">Options</Button>
|
|
243
|
+
</template>
|
|
244
|
+
|
|
245
|
+
<template #footer>
|
|
246
|
+
<Button full size="sm">Continue</Button>
|
|
247
|
+
</template>
|
|
248
|
+
</Card>
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### customProps
|
|
252
|
+
|
|
253
|
+
```vue
|
|
254
|
+
<Card
|
|
255
|
+
title="Forwarded part attributes"
|
|
256
|
+
:custom-props="{
|
|
257
|
+
title: { id: 'card-demo-title' },
|
|
258
|
+
root: { 'data-testid': 'card-root' },
|
|
259
|
+
header: { 'aria-label': 'Card header' },
|
|
260
|
+
footer: { 'data-testid': 'card-footer' },
|
|
261
|
+
body: { role: 'region', 'aria-labelledby': 'card-demo-title' },
|
|
262
|
+
}"
|
|
263
|
+
>
|
|
264
|
+
Card body with forwarded attributes on each part.
|
|
265
|
+
|
|
266
|
+
<template #footer>
|
|
267
|
+
<span>Inspect DOM for data attributes on each part.</span>
|
|
268
|
+
</template>
|
|
269
|
+
</Card>
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
## Props
|
|
273
|
+
|
|
274
|
+
| Prop | Type | Default | Description |
|
|
275
|
+
| ------------- | ----------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
276
|
+
| `borderless` | `boolean` | `false` | Removes header and footer borders. |
|
|
277
|
+
| `classes` | `CardClasses` | — | The classes to apply to the card. |
|
|
278
|
+
| `customProps` | `CardCustomProps` | — | Extra props for internal parts (`header`, `title`, `body`, `footer`, etc.). Root HTML attributes stay on the component top level. |
|
|
279
|
+
| `padding` | `CardPadding` | "medium" | Padding for header, body, and footer (horizontal alignment is shared). |
|
|
280
|
+
| `rounded` | `CardRounded` | "sm" | The roundedness of the card. |
|
|
281
|
+
| `shadow` | `CardShadow` | "sm" | Shadow size. Only applied when `variant` is `elevated`. |
|
|
282
|
+
| `title` | `string` | — | The title to apply to the card. |
|
|
283
|
+
| `variant` | `CardVariant` | "elevated" | Visual style of the card. |
|
|
284
|
+
|
|
285
|
+
## Related components
|
|
286
|
+
|
|
287
|
+
Modal, List
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Checkbox
|
|
2
|
+
|
|
3
|
+
Checkbox input with labels and form chrome. Extends FormControl props.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Checkbox } from "@bridge-ui/vue/Components/Checkbox";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<Checkbox
|
|
17
|
+
end-label="Accept terms"
|
|
18
|
+
description="Receive updates about your account."
|
|
19
|
+
/>
|
|
20
|
+
|
|
21
|
+
<Checkbox v-model="terms" end-label="Remember me" />
|
|
22
|
+
|
|
23
|
+
<Checkbox indeterminate end-label="Select all" />
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Required and error
|
|
27
|
+
|
|
28
|
+
```vue
|
|
29
|
+
<Checkbox required end-label="Required field" />
|
|
30
|
+
|
|
31
|
+
<Checkbox
|
|
32
|
+
error
|
|
33
|
+
end-label="Invalid option"
|
|
34
|
+
error-message="You must accept to continue."
|
|
35
|
+
/>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### States
|
|
39
|
+
|
|
40
|
+
```vue
|
|
41
|
+
<Checkbox disabled :model-value="true" end-label="Disabled" />
|
|
42
|
+
|
|
43
|
+
<Checkbox readonly :model-value="true" end-label="Read-only" />
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### customProps
|
|
47
|
+
|
|
48
|
+
```vue
|
|
49
|
+
<Checkbox
|
|
50
|
+
end-label="Accept terms"
|
|
51
|
+
:custom-props="{
|
|
52
|
+
icon: { 'aria-hidden': true },
|
|
53
|
+
input: { name: 'terms', value: 'yes' },
|
|
54
|
+
control: { 'data-testid': 'terms-control' },
|
|
55
|
+
}"
|
|
56
|
+
/>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Props
|
|
60
|
+
|
|
61
|
+
### Checkbox-specific
|
|
62
|
+
|
|
63
|
+
| Prop | Type | Default | Description |
|
|
64
|
+
| --------------- | --------------------- | --------- | ------------------------------------------------------------------------------------------ |
|
|
65
|
+
| `checked` | `boolean` | — | Whether the checkbox is checked. |
|
|
66
|
+
| `classes` | `CheckboxClasses` | — | Classes for the form control chrome and the checkbox control. |
|
|
67
|
+
| `color` | `CheckboxColor` | "primary" | The color to apply to the checkbox. |
|
|
68
|
+
| `customProps` | `CheckboxCustomProps` | — | Extra props for internal parts. |
|
|
69
|
+
| `indeterminate` | `boolean` | `false` | Whether the checkbox is in an indeterminate state. |
|
|
70
|
+
| `rounded` | `CheckboxRounded` | "sm" | The roundedness of the checkbox control. |
|
|
71
|
+
| `size` | `CheckboxSize` | "md" | Size of the control and of form control labels (`2xs` … `2xl`, same scale as `FormField`). |
|
|
72
|
+
| `slots` | `CheckboxSlots` | — | Chrome slots and the control slot. |
|
|
73
|
+
|
|
74
|
+
### v-model
|
|
75
|
+
|
|
76
|
+
| Prop / Event | Type | Default | Description |
|
|
77
|
+
| ------------------- | -------------------------- | ------- | ---------------------------------------------------------------------------- |
|
|
78
|
+
| `modelValue` | `boolean` | — | Bound with `v-model`. |
|
|
79
|
+
| `update:modelValue` | `(value: boolean) => void` | — | Emitted when `v-model` should update. Listen with `v-on:update:model-value`. |
|
|
80
|
+
|
|
81
|
+
### Inherited from FormControl
|
|
82
|
+
|
|
83
|
+
See [FormControl](./FormControl.md).
|
|
84
|
+
|
|
85
|
+
## Related components
|
|
86
|
+
|
|
87
|
+
FormControl, Radio, Switch
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Divider
|
|
2
|
+
|
|
3
|
+
Horizontal or vertical separator for grouping content.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Divider } from "@bridge-ui/vue/Components/Divider";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<div class="space-y-4">
|
|
17
|
+
<p>Section one</p>
|
|
18
|
+
<Divider />
|
|
19
|
+
<p>Section two</p>
|
|
20
|
+
</div>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Vertical
|
|
24
|
+
|
|
25
|
+
```vue
|
|
26
|
+
<div class="flex h-8 items-center gap-4">
|
|
27
|
+
<span>Left</span>
|
|
28
|
+
<Divider orientation="vertical" />
|
|
29
|
+
<span>Right</span>
|
|
30
|
+
</div>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Color
|
|
34
|
+
|
|
35
|
+
```vue
|
|
36
|
+
<Divider color="primary" />
|
|
37
|
+
<Divider color="error" />
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Custom classes
|
|
41
|
+
|
|
42
|
+
```vue
|
|
43
|
+
<Divider class="my-6 h-0.5 bg-primary-500" />
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Props
|
|
47
|
+
|
|
48
|
+
| Prop | Type | Default | Description |
|
|
49
|
+
| ------------- | -------------------- | -------------- | ------------------------------------ |
|
|
50
|
+
| `classes` | `DividerClasses` | — | The classes to apply to the divider. |
|
|
51
|
+
| `color` | `DividerColor` | `"dark"` | The fill color of the divider. |
|
|
52
|
+
| `orientation` | `DividerOrientation` | `"horizontal"` | The orientation of the divider. |
|
|
53
|
+
|
|
54
|
+
## Related components
|
|
55
|
+
|
|
56
|
+
Card, ListItem, Menu
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Drawer
|
|
2
|
+
|
|
3
|
+
Drawer overlay docked to a viewport edge, with portal, backdrop, and focus management. Put any content inside.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Drawer } from "@bridge-ui/vue/Components/Drawer";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<Button v-on:click="open = true">Open drawer</Button>
|
|
17
|
+
|
|
18
|
+
<Drawer v-model="open">
|
|
19
|
+
<Card title="Filters" :on-close="() => (open = false)">
|
|
20
|
+
Drawer content goes here.
|
|
21
|
+
</Card>
|
|
22
|
+
</Drawer>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Persistent
|
|
26
|
+
|
|
27
|
+
```vue
|
|
28
|
+
<Drawer persistent v-model="open">
|
|
29
|
+
<Card title="Persistent drawer" :on-close="() => (open = false)">
|
|
30
|
+
Clicking the backdrop or pressing Escape has no effect.
|
|
31
|
+
</Card>
|
|
32
|
+
</Drawer>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Placement
|
|
36
|
+
|
|
37
|
+
```vue
|
|
38
|
+
<Drawer v-model="open" placement="right">
|
|
39
|
+
<Card title="Right drawer" :on-close="() => (open = false)">
|
|
40
|
+
Docks to the right edge instead of the default left.
|
|
41
|
+
</Card>
|
|
42
|
+
</Drawer>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Bottom sheet
|
|
46
|
+
|
|
47
|
+
```vue
|
|
48
|
+
<Drawer v-model="open" placement="bottom">
|
|
49
|
+
<Card title="Bottom sheet" :on-close="() => (open = false)">
|
|
50
|
+
Docks to the bottom edge; `size` controls the sheet height.
|
|
51
|
+
</Card>
|
|
52
|
+
</Drawer>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Full composition (Card)
|
|
56
|
+
|
|
57
|
+
```vue
|
|
58
|
+
<Drawer blur="md" size="lg" v-model="open" transition="slide">
|
|
59
|
+
<Card
|
|
60
|
+
borderless
|
|
61
|
+
shadow="lg"
|
|
62
|
+
rounded="none"
|
|
63
|
+
padding="large"
|
|
64
|
+
variant="elevated"
|
|
65
|
+
title="Edit filters"
|
|
66
|
+
>
|
|
67
|
+
Large drawer with Card title, body, and footer slots.
|
|
68
|
+
|
|
69
|
+
<template #footer>
|
|
70
|
+
<Button size="sm" color="error" variant="flat" v-on:click="open = false">
|
|
71
|
+
Discard
|
|
72
|
+
</Button>
|
|
73
|
+
|
|
74
|
+
<Button size="sm" color="primary" v-on:click="open = false">Save</Button>
|
|
75
|
+
</template>
|
|
76
|
+
</Card>
|
|
77
|
+
</Drawer>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### customProps
|
|
81
|
+
|
|
82
|
+
```vue
|
|
83
|
+
<Drawer
|
|
84
|
+
v-model="open"
|
|
85
|
+
:custom-props="{
|
|
86
|
+
root: { id: 'drawer-root' },
|
|
87
|
+
panel: { id: 'drawer-panel' },
|
|
88
|
+
overlay: { id: 'drawer-overlay' },
|
|
89
|
+
}"
|
|
90
|
+
>
|
|
91
|
+
<Card title="customProps" :on-close="() => (open = false)">
|
|
92
|
+
Inspect the DOM for ids on each drawer part.
|
|
93
|
+
</Card>
|
|
94
|
+
</Drawer>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Props
|
|
98
|
+
|
|
99
|
+
| Prop | Type | Default | Description |
|
|
100
|
+
| --------------------- | ------------------- | ------- | ------------------------------------------------------------------------------------------ |
|
|
101
|
+
| `ariaLabel` | `string` | — | Accessible name for the dialog (`aria-label`). |
|
|
102
|
+
| `ariaLabelledBy` | `string` | — | Id of the element that labels the dialog (`aria-labelledby`). |
|
|
103
|
+
| `autoFocus` | `boolean` | `false` | When true, focuses the first focusable element inside the drawer on open. |
|
|
104
|
+
| `blur` | `DrawerBlur` | "none" | Backdrop blur on the overlay. |
|
|
105
|
+
| `classes` | `DrawerClasses` | — | The classes to apply to the drawer. |
|
|
106
|
+
| `closeOnEscape` | `boolean` | `true` | Whether the drawer closes on escape key press. |
|
|
107
|
+
| `closeOnOverlay` | `boolean` | `true` | Whether the drawer closes on overlay click. |
|
|
108
|
+
| `customProps` | `DrawerCustomProps` | — | Props forwarded to each drawer part. |
|
|
109
|
+
| `disableEnforceFocus` | `boolean` | `false` | When true, focus is not trapped inside the drawer while open. |
|
|
110
|
+
| `disableRestoreFocus` | `boolean` | `false` | When true, focus is not restored to the previously focused element on close. |
|
|
111
|
+
| `disableScrollLock` | `boolean` | `false` | When true, body scroll is not locked while the drawer is open. |
|
|
112
|
+
| `hideBackdrop` | `boolean` | `false` | When true, the backdrop overlay is not rendered. |
|
|
113
|
+
| `keepMounted` | `boolean` | `false` | When true, the drawer stays mounted in the DOM after closing (hidden). |
|
|
114
|
+
| `persistent` | `boolean` | `false` | When true, escape and overlay clicks do not close the drawer. |
|
|
115
|
+
| `placement` | `DrawerPlacement` | "left" | Edge the panel docks to. |
|
|
116
|
+
| `scroll` | `DrawerScroll` | "paper" | Where scroll happens: the page (`body`) or the drawer panel (`paper`). |
|
|
117
|
+
| `size` | `DrawerSize` | "md" | Panel size along the placement axis (width for `left`/`right`, height for `top`/`bottom`). |
|
|
118
|
+
| `teleportTo` | `string \| false` | "body" | Where to teleport the drawer. Pass `false` to render in place. |
|
|
119
|
+
| `transition` | `DrawerTransition` | "slide" | Enter/leave animation for overlay and panel. |
|
|
120
|
+
|
|
121
|
+
### v-model
|
|
122
|
+
|
|
123
|
+
| Prop / Event | Type | Default | Description |
|
|
124
|
+
| ------------------- | -------------------------- | ------- | ---------------------------------------------------------------------------- |
|
|
125
|
+
| `modelValue` | `boolean` | `false` | Whether the drawer is visible. Bound with `v-model`. |
|
|
126
|
+
| `update:modelValue` | `(value: boolean) => void` | — | Emitted when `v-model` should update. Listen with `v-on:update:model-value`. |
|
|
127
|
+
|
|
128
|
+
## Events
|
|
129
|
+
|
|
130
|
+
| Event | Payload | Description |
|
|
131
|
+
| ------------------ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
132
|
+
| `v-on:close` | — | Emitted when the user dismisses the drawer (overlay or Escape). Not emitted when the parent sets `v-model` to `false` directly. |
|
|
133
|
+
| `v-on:show-change` | `(show: boolean)` | Emitted when visibility should change (controlled state). Listen with `v-on:show-change`. |
|
|
134
|
+
|
|
135
|
+
## Related components
|
|
136
|
+
|
|
137
|
+
Card, useDialogAction, useDrawerAction, useModalAction
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# FormControl
|
|
2
|
+
|
|
3
|
+
> Building block for toggle-row chrome. Prefer `Checkbox`, `Radio`, and `Switch` in apps; FormControl remains exported for advanced composition. Not a registry key — theme chrome via `tokens.formControl` on the public parent (e.g. `components.Checkbox.tokens.formControl`).
|
|
4
|
+
|
|
5
|
+
Low-level form control chrome (labels, description, error) for Checkbox, Radio, and Switch.
|
|
6
|
+
|
|
7
|
+
Control tokens stay on the parent (`tokens.color`, `tokens.invalidated`, …).
|
|
8
|
+
|
|
9
|
+
## Import
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { FormControl } from "@bridge-ui/vue";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
|
|
17
|
+
### Usage
|
|
18
|
+
|
|
19
|
+
```vue
|
|
20
|
+
<FormControl
|
|
21
|
+
end-label="Email notifications"
|
|
22
|
+
description="Receive product updates."
|
|
23
|
+
>
|
|
24
|
+
<Checkbox :default-checked="true" />
|
|
25
|
+
</FormControl>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### customProps
|
|
29
|
+
|
|
30
|
+
```vue
|
|
31
|
+
<FormControl
|
|
32
|
+
end-label="Email notifications"
|
|
33
|
+
description="Receive product updates."
|
|
34
|
+
:custom-props="{
|
|
35
|
+
root: { id: 'notify-control' },
|
|
36
|
+
endLabel: { id: 'notify-label' },
|
|
37
|
+
description: { id: 'notify-desc', 'aria-live': 'polite' },
|
|
38
|
+
}"
|
|
39
|
+
>
|
|
40
|
+
<Checkbox :default-checked="true" />
|
|
41
|
+
</FormControl>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Props
|
|
45
|
+
|
|
46
|
+
| Prop | Type | Default | Description |
|
|
47
|
+
| ------------------ | ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
48
|
+
| `classes` | `FormControlClasses` | — | Classes for labels, description, error, and layout chrome. |
|
|
49
|
+
| `controlId` | `string` | — | Associates labels and helper text with a form control. When omitted, an id is generated automatically. |
|
|
50
|
+
| `customProps` | `FormControlCustomProps` | — | Extra props for internal parts (`row`, `endLabel`, `description`, …). |
|
|
51
|
+
| `description` | `string` | — | Helper text below the control row (hidden when invalid). |
|
|
52
|
+
| `disabled` | `boolean` | `false` | Whether the control is disabled. |
|
|
53
|
+
| `endLabel` | `string` | — | Inline-end label after the control (right in LTR, left in RTL). |
|
|
54
|
+
| `error` | `boolean` | `false` | When `true`, applies invalid styling on labels and hides description. |
|
|
55
|
+
| `errorMessage` | `string` | — | Error message below the control row. |
|
|
56
|
+
| `field` | `UseFormControlReturn` | — | Pre-composed form control API from a parent composable. Used by `<FormControl :field="…" />`; not set on Checkbox, Radio, or Switch. |
|
|
57
|
+
| `hideErrorMessage` | `boolean` | `false` | When `true`, does not reserve space below the row for error messages. |
|
|
58
|
+
| `readonly` | `boolean` | `false` | Whether the control is read-only. |
|
|
59
|
+
| `required` | `boolean` | `false` | Sets the native `required` attribute on the control and shows a required asterisk on labels. |
|
|
60
|
+
| `size` | `LabelSize` | "md" | Typography scale for labels, description, and error text (aligned with `FormField` / `Label`). |
|
|
61
|
+
| `slots` | `FormControlSlots` | — | Chrome slots (`startLabel`, `endLabel`, `description`, `errorMessage`, …) and the control. |
|
|
62
|
+
| `startLabel` | `string` | — | Inline-start label before the control (left in LTR, right in RTL). |
|
|
63
|
+
|
|
64
|
+
## Related components
|
|
65
|
+
|
|
66
|
+
Checkbox, Radio, Switch, Label
|