@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,181 @@
|
|
|
1
|
+
# Select
|
|
2
|
+
|
|
3
|
+
Dropdown select with single/multiple value, search, and async data.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Select } from "@bridge-ui/vue/Components/Select";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<Select label="Country" :options="countries" placeholder="Select a country" />
|
|
17
|
+
|
|
18
|
+
<Select
|
|
19
|
+
multiple
|
|
20
|
+
searchable
|
|
21
|
+
label="Frameworks"
|
|
22
|
+
v-model="selected"
|
|
23
|
+
:options="frameworks"
|
|
24
|
+
/>
|
|
25
|
+
|
|
26
|
+
<Select error label="Country" error-message="Please select a valid country." />
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Searchable
|
|
30
|
+
|
|
31
|
+
```vue
|
|
32
|
+
<Select
|
|
33
|
+
searchable
|
|
34
|
+
label="Country"
|
|
35
|
+
:options="countries"
|
|
36
|
+
placeholder="Type to filter..."
|
|
37
|
+
/>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Async data
|
|
41
|
+
|
|
42
|
+
```vue
|
|
43
|
+
<Select
|
|
44
|
+
label="City (async)"
|
|
45
|
+
placeholder="Type to search cities..."
|
|
46
|
+
:async-data="{
|
|
47
|
+
search: asyncSearch,
|
|
48
|
+
resolve: asyncResolveSelected,
|
|
49
|
+
}"
|
|
50
|
+
/>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Custom option slot
|
|
54
|
+
|
|
55
|
+
```vue
|
|
56
|
+
<Select
|
|
57
|
+
label="Framework"
|
|
58
|
+
:options="frameworks"
|
|
59
|
+
placeholder="Custom rendered options"
|
|
60
|
+
>
|
|
61
|
+
<template #option="{ option, selected }">
|
|
62
|
+
<span class="flex w-full items-center justify-between gap-2">
|
|
63
|
+
<span class="truncate font-medium">{{ option.label }}</span>
|
|
64
|
+
|
|
65
|
+
<span v-if="selected" class="text-primary-600 shrink-0 text-xs font-semibold">
|
|
66
|
+
Selected
|
|
67
|
+
</span>
|
|
68
|
+
</span>
|
|
69
|
+
</template>
|
|
70
|
+
</Select>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Grouped options
|
|
74
|
+
|
|
75
|
+
`options` may mix standalone options and section groups (`{ title, options, sticky? }`). Search filters within sections and drops empty ones.
|
|
76
|
+
|
|
77
|
+
```vue
|
|
78
|
+
<Select
|
|
79
|
+
searchable
|
|
80
|
+
label="Produce"
|
|
81
|
+
:options="[
|
|
82
|
+
{
|
|
83
|
+
title: 'Fruits',
|
|
84
|
+
sticky: true,
|
|
85
|
+
options: [
|
|
86
|
+
{ label: 'Apple', value: 'apple' },
|
|
87
|
+
{ label: 'Banana', value: 'banana' },
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
title: 'Vegetables',
|
|
92
|
+
options: [{ label: 'Carrot', value: 'carrot' }],
|
|
93
|
+
},
|
|
94
|
+
{ label: 'Other', value: 'other' },
|
|
95
|
+
]"
|
|
96
|
+
/>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Composed list (default slot)
|
|
100
|
+
|
|
101
|
+
Use the default slot with `ListSection` / `ListItem` to build the dropdown list manually. Set `value` on each `ListItem` so it registers as a selectable option. Declarative `SelectOption` children still feed the `options` data path; only `ListSection` / `ListItem` (and similar) count as composed list content. The `#option` slot remains for customizing items rendered from the `options` prop.
|
|
102
|
+
|
|
103
|
+
```vue
|
|
104
|
+
<Select label="Status" v-model="status">
|
|
105
|
+
<ListSection sticky title="Workflow" />
|
|
106
|
+
<ListItem value="open" primary="Open" />
|
|
107
|
+
<ListItem value="closed" primary="Closed" />
|
|
108
|
+
</Select>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### customProps
|
|
112
|
+
|
|
113
|
+
```vue
|
|
114
|
+
<Select
|
|
115
|
+
label="Country"
|
|
116
|
+
:options="countries"
|
|
117
|
+
placeholder="Select a country"
|
|
118
|
+
:custom-props="{
|
|
119
|
+
root: { id: 'country-field' },
|
|
120
|
+
input: { name: 'country', autocomplete: 'country' },
|
|
121
|
+
}"
|
|
122
|
+
/>
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Props
|
|
126
|
+
|
|
127
|
+
### Select-specific
|
|
128
|
+
|
|
129
|
+
| Prop | Type | Default | Description |
|
|
130
|
+
| ------------------- | --------------------- | ------------- | ------------------------------------------------------------------------------------------------------- |
|
|
131
|
+
| `asyncData` | `SelectAsyncData` | — | Remote data source. Implies `searchable`. |
|
|
132
|
+
| `clearable` | `boolean` | `true` | Whether the value can be cleared. |
|
|
133
|
+
| `defaultValue` | `SelectModel` | — | Initial value when uncontrolled. |
|
|
134
|
+
| `disableMaxHeight` | `boolean` | `false` | When true, the dropdown options list is not height-limited. Forwarded to the internal `Listbox`. |
|
|
135
|
+
| `emptyMessage` | `string` | "No options" | Message when the filtered list is empty. |
|
|
136
|
+
| `flipOptions` | `boolean` | `false` | Inverts the visual order of options. |
|
|
137
|
+
| `hideEmptyMessage` | `boolean` | `false` | Hides the empty-state message. |
|
|
138
|
+
| `loading` | `boolean` | — | External or async loading state. |
|
|
139
|
+
| `maxHeight` | `string` | "max-h-60" | Tailwind max-height class for the dropdown options area. Forwarded to the internal `Listbox`. |
|
|
140
|
+
| `minItemsForSearch` | `number` | 11 | Minimum option count before search UI is enabled. |
|
|
141
|
+
| `multiple` | `boolean` | `false` | Whether multiple values can be selected. |
|
|
142
|
+
| `optionDescription` | `string` | "description" | Key used to read the description from option objects. |
|
|
143
|
+
| `optionLabel` | `string` | "label" | Key used to read the label from option objects. |
|
|
144
|
+
| `options` | `ListboxOptionsInput` | — | Options to display. May include section groups (`{ title, options, sticky? }`) mixed with flat options. |
|
|
145
|
+
| `optionValue` | `string` | "value" | Key used to read the value from option objects. |
|
|
146
|
+
| `placeholder` | `string` | — | Placeholder shown when no value is selected. |
|
|
147
|
+
| `searchable` | `boolean` | `false` | Whether options can be filtered via the trigger input. |
|
|
148
|
+
|
|
149
|
+
### v-model
|
|
150
|
+
|
|
151
|
+
| Prop / Event | Type | Default | Description |
|
|
152
|
+
| ------------------- | ------------------------------------------------------- | ------- | ---------------------------------------------------------------------------- |
|
|
153
|
+
| `modelValue` | `SelectValue \| SelectValue[] \| null` | — | Bound with `v-model`. |
|
|
154
|
+
| `update:modelValue` | `(value: SelectValue \| SelectValue[] \| null) => void` | — | Emitted when `v-model` should update. Listen with `v-on:update:model-value`. |
|
|
155
|
+
|
|
156
|
+
### Inherited from FormField
|
|
157
|
+
|
|
158
|
+
See [FormField](./FormField.md) (building-block chrome). Field tokens live on `components.Select` (`size`, `color`, `rounded`, `variant`, …). Dropdown option tokens are nested under `components.Select.tokens.listbox`.
|
|
159
|
+
|
|
160
|
+
## Slots
|
|
161
|
+
|
|
162
|
+
| Slot | Scope | Description |
|
|
163
|
+
| --------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
164
|
+
| `default` | — | Composed list content (`ListSection` / `ListItem` with `value`). Replaces mapped `options` in the listbox. |
|
|
165
|
+
| `option` | `{ option: SelectOption; selected: boolean }` | Custom option content when rendering from the `options` prop. |
|
|
166
|
+
|
|
167
|
+
## Events
|
|
168
|
+
|
|
169
|
+
| Event | Payload | Description |
|
|
170
|
+
| --------------- | ------------------------ | ----------------------------------------------------- |
|
|
171
|
+
| `v-on:change` | `(value: SelectModel)` | Emitted when the selection changes. |
|
|
172
|
+
| `v-on:clear` | — | Emitted when the value is cleared. |
|
|
173
|
+
| `v-on:close` | — | Emitted when the menu closes. |
|
|
174
|
+
| `v-on:deselect` | `(option: SelectOption)` | Emitted when an option is deselected (multiple mode). |
|
|
175
|
+
| `v-on:open` | — | Emitted when the menu opens. |
|
|
176
|
+
| `v-on:search` | `(query: string)` | Emitted when the search query changes. |
|
|
177
|
+
| `v-on:select` | `(option: SelectOption)` | Emitted when an option is selected. |
|
|
178
|
+
|
|
179
|
+
## Related components
|
|
180
|
+
|
|
181
|
+
Menu, List, ListItem, ListSection, FormField
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Skeleton
|
|
2
|
+
|
|
3
|
+
Placeholder block for loading states. Size it with Tailwind height/width classes.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Skeleton } from "@bridge-ui/vue/Components/Skeleton";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<Skeleton class="h-4 w-32" />
|
|
17
|
+
|
|
18
|
+
<Skeleton rounded="full" class="h-10 w-10" />
|
|
19
|
+
|
|
20
|
+
<Skeleton rounded="lg" class="h-24 w-full" />
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Custom classes
|
|
24
|
+
|
|
25
|
+
```vue
|
|
26
|
+
<Skeleton class="h-4 w-48 bg-primary-200 dark:bg-primary-800" />
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Props
|
|
30
|
+
|
|
31
|
+
| Prop | Type | Default | Description |
|
|
32
|
+
| --------- | ----------------- | ------- | ------------------------------------- |
|
|
33
|
+
| `classes` | `SkeletonClasses` | — | The classes to apply to the skeleton. |
|
|
34
|
+
| `rounded` | `SkeletonRounded` | `"md"` | The roundedness of the skeleton. |
|
|
35
|
+
|
|
36
|
+
## Related components
|
|
37
|
+
|
|
38
|
+
Avatar, Card
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Slider
|
|
2
|
+
|
|
3
|
+
Horizontal slider for selecting a single value or a range. Label, corner,
|
|
4
|
+
start/end slots, description, and error chrome are rendered via the shared
|
|
5
|
+
`BaseField` layout; tooltips and stop marks are optional.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { Slider } from "@bridge-ui/vue/Components/Slider";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Examples
|
|
14
|
+
|
|
15
|
+
### Usage
|
|
16
|
+
|
|
17
|
+
```vue
|
|
18
|
+
<Slider label="Volume" />
|
|
19
|
+
|
|
20
|
+
<Slider
|
|
21
|
+
v-model="opacity"
|
|
22
|
+
label="Opacity"
|
|
23
|
+
corner="%"
|
|
24
|
+
description="Adjust transparency."
|
|
25
|
+
/>
|
|
26
|
+
|
|
27
|
+
<Slider error label="Volume" error-message="Value is required." />
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Range
|
|
31
|
+
|
|
32
|
+
```vue
|
|
33
|
+
<Slider range v-model="range" label="Price range" />
|
|
34
|
+
|
|
35
|
+
<Slider range :default-value="[20, 80]" label="Range" />
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Min, max, and step
|
|
39
|
+
|
|
40
|
+
```vue
|
|
41
|
+
<Slider :min="0" :max="100" :step="10" label="Rating" />
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Colors and sizes
|
|
45
|
+
|
|
46
|
+
```vue
|
|
47
|
+
<Slider color="primary" label="Primary" />
|
|
48
|
+
<Slider color="secondary" label="Secondary" />
|
|
49
|
+
<Slider size="sm" label="Small" />
|
|
50
|
+
<Slider size="lg" label="Large" />
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Stops and tooltips
|
|
54
|
+
|
|
55
|
+
```vue
|
|
56
|
+
<Slider
|
|
57
|
+
show-stops
|
|
58
|
+
label="Rating"
|
|
59
|
+
:stops="[
|
|
60
|
+
{ value: 0, label: 'Low' },
|
|
61
|
+
{ value: 100, label: 'High' },
|
|
62
|
+
]"
|
|
63
|
+
/>
|
|
64
|
+
|
|
65
|
+
<Slider :show-tooltip="false" label="Volume" />
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### customProps
|
|
69
|
+
|
|
70
|
+
```vue
|
|
71
|
+
<Slider
|
|
72
|
+
label="Volume"
|
|
73
|
+
description="Track uses name via customProps."
|
|
74
|
+
:custom-props="{
|
|
75
|
+
track: { 'data-testid': 'volume-track' },
|
|
76
|
+
}"
|
|
77
|
+
/>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Props
|
|
81
|
+
|
|
82
|
+
### Slider-specific
|
|
83
|
+
|
|
84
|
+
| Prop | Type | Default | Description |
|
|
85
|
+
| -------------- | ---------------------------- | ----------- | ------------------------------------------------------- |
|
|
86
|
+
| `classes` | `SliderClasses` | — | Classes for the field chrome and slider control. |
|
|
87
|
+
| `color` | token | `"primary"` | Bar and thumb color. |
|
|
88
|
+
| `defaultValue` | `number \| [number, number]` | min | Initial value when `v-model` is unbound. |
|
|
89
|
+
| `max` | `number` | `100` | Maximum value. |
|
|
90
|
+
| `min` | `number` | `0` | Minimum value. |
|
|
91
|
+
| `range` | `boolean` | `false` | Two-thumb range selection. |
|
|
92
|
+
| `rounded` | token | `"full"` | Track and bar border radius. |
|
|
93
|
+
| `showStops` | `boolean` | `false` | Render stop marks on the track. |
|
|
94
|
+
| `showTooltip` | `boolean` | `true` | Show value tooltip on each thumb while focused/hovered. |
|
|
95
|
+
| `size` | token | `"md"` | Track/thumb size and chrome typography. |
|
|
96
|
+
| `step` | `number` | `1` | Step increment between values. |
|
|
97
|
+
| `stops` | `SliderStopInput[]` | — | Custom stop marks (numbers become `{ value }`). |
|
|
98
|
+
|
|
99
|
+
### Binding
|
|
100
|
+
|
|
101
|
+
| Prop | Type | Default | Description |
|
|
102
|
+
| ------------ | ---------------------------- | ------- | -------------------------- |
|
|
103
|
+
| `modelValue` | `number \| [number, number]` | — | Current value (`v-model`). |
|
|
104
|
+
|
|
105
|
+
### Field chrome
|
|
106
|
+
|
|
107
|
+
| Prop | Type | Default | Description |
|
|
108
|
+
| ------------------ | --------- | ------- | --------------------------------------- |
|
|
109
|
+
| `controlId` | `string` | auto | Id for the control and related labels. |
|
|
110
|
+
| `corner` | `string` | — | Secondary header text. |
|
|
111
|
+
| `customProps` | object | — | Extra props for internal parts. |
|
|
112
|
+
| `description` | `string` | — | Helper text below the control. |
|
|
113
|
+
| `disabled` | `boolean` | `false` | Disables interaction. |
|
|
114
|
+
| `error` | `boolean` | `false` | Invalid styling. |
|
|
115
|
+
| `errorMessage` | `string` | — | Error message below the control. |
|
|
116
|
+
| `hideErrorMessage` | `boolean` | `false` | Hides the error message row. |
|
|
117
|
+
| `label` | `string` | — | Primary label above the control. |
|
|
118
|
+
| `readonly` | `boolean` | `false` | Read-only (no pointer interaction). |
|
|
119
|
+
| `required` | `boolean` | `false` | Shows a required asterisk on the label. |
|
|
120
|
+
|
|
121
|
+
## Slots
|
|
122
|
+
|
|
123
|
+
| Slot | Description |
|
|
124
|
+
| --------------- | ---------------------------------------- |
|
|
125
|
+
| `#label` | Primary label content. |
|
|
126
|
+
| `#corner` | Secondary header text at the inline end. |
|
|
127
|
+
| `#description` | Helper text below the control. |
|
|
128
|
+
| `#errorMessage` | Error message below the control. |
|
|
129
|
+
| `#thumb` | Custom thumb content (replaces knob). |
|
|
130
|
+
|
|
131
|
+
## Events
|
|
132
|
+
|
|
133
|
+
| Event | Payload | Description |
|
|
134
|
+
| ------------------- | ---------------------------- | ------------------------------- |
|
|
135
|
+
| `change` | `number \| [number, number]` | Emitted when the value changes. |
|
|
136
|
+
| `update:modelValue` | `number \| [number, number]` | Emitted for `v-model` updates. |
|
|
137
|
+
|
|
138
|
+
## Related components
|
|
139
|
+
|
|
140
|
+
BaseField, OtpField, NumberField, Label
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Snackbar
|
|
2
|
+
|
|
3
|
+
Toast notification portaled to the viewport. Sets `role="status"` and `aria-live="polite"` by default.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Snackbar } from "@bridge-ui/vue/Components/Snackbar";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<Button v-on:click="open = true">Show snackbar</Button>
|
|
17
|
+
|
|
18
|
+
<Snackbar
|
|
19
|
+
title="Saved"
|
|
20
|
+
v-model="open"
|
|
21
|
+
description="Your changes were saved successfully."
|
|
22
|
+
/>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Duration and progressbar
|
|
26
|
+
|
|
27
|
+
```vue
|
|
28
|
+
<Snackbar progressbar v-model="open" :duration="3000" title="Auto dismiss" />
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Slots
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<Snackbar v-model="open">
|
|
35
|
+
<template #icon>
|
|
36
|
+
<Icon size="md" :icon="Info" />
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<template #actions>
|
|
40
|
+
<Button size="sm" variant="flat" v-on:click="open = false">
|
|
41
|
+
Undo
|
|
42
|
+
</Button>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
Custom children below the description.
|
|
46
|
+
</Snackbar>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### customProps
|
|
50
|
+
|
|
51
|
+
```vue
|
|
52
|
+
<Snackbar
|
|
53
|
+
v-model="open"
|
|
54
|
+
title="customProps"
|
|
55
|
+
:custom-props="{
|
|
56
|
+
root: { id: 'snackbar-root' },
|
|
57
|
+
title: { id: 'snackbar-title' },
|
|
58
|
+
}"
|
|
59
|
+
/>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Props
|
|
63
|
+
|
|
64
|
+
| Prop | Type | Default | Description |
|
|
65
|
+
| -------------- | ------------------------- | --------------- | ------------------------------------------------------------------------------ |
|
|
66
|
+
| `classes` | `SnackbarClasses` | — | The classes to apply to the snackbar. |
|
|
67
|
+
| `closeButton` | `boolean` | `true` | Whether to show the close button. |
|
|
68
|
+
| `color` | `SnackbarColor` | "primary" | Tint color for the default icon. |
|
|
69
|
+
| `customProps` | `SnackbarCustomProps` | — | Extra props for internal parts (`icon`, `title`, `description`, etc.). |
|
|
70
|
+
| `description` | `string` | — | Body text below the title. |
|
|
71
|
+
| `duration` | `number \| false` | 5000 | Auto-dismiss delay in ms. `false` disables the timer. |
|
|
72
|
+
| `icon` | `LucideIcon \| null` | — | The icon to display. Use `null` to hide the icon. |
|
|
73
|
+
| `img` | `string` | — | Avatar image URL (shown instead of icon when set). |
|
|
74
|
+
| `onShowChange` | `(show: boolean) => void` | — | Called when `v-model` visibility should change (controlled state). |
|
|
75
|
+
| `padding` | `SnackbarPadding` | "medium" | Padding for the content area. |
|
|
76
|
+
| `position` | `SnackbarPosition` | "bottom-center" | Viewport anchor when portaled (standalone). Ignored when `teleportTo={false}`. |
|
|
77
|
+
| `progressbar` | `boolean` | `true` | Whether to show the countdown progress bar when `duration` is set. |
|
|
78
|
+
| `rounded` | `SnackbarRounded` | "lg" | The roundedness of the snackbar panel. |
|
|
79
|
+
| `stackId` | `string` | — | Pre-assigned stack id (BridgeSnackbarHost). |
|
|
80
|
+
| `teleportTo` | `string \| false` | "body" | Portal target. `false` renders inline without layer stack. |
|
|
81
|
+
| `title` | `string` | — | Headline text. |
|
|
82
|
+
| `transition` | `SnackbarTransition` | "slide" | Enter/leave animation preset. |
|
|
83
|
+
|
|
84
|
+
### v-model
|
|
85
|
+
|
|
86
|
+
| Prop / Event | Type | Default | Description |
|
|
87
|
+
| ------------------- | -------------------------- | ------- | ---------------------------------------------------------------------------- |
|
|
88
|
+
| `modelValue` | `boolean` | `false` | Whether the snackbar is visible. Bound with `v-model`. |
|
|
89
|
+
| `update:modelValue` | `(value: boolean) => void` | — | Emitted when `v-model` should update. Listen with `v-on:update:model-value`. |
|
|
90
|
+
|
|
91
|
+
## Events
|
|
92
|
+
|
|
93
|
+
| Event | Payload | Description |
|
|
94
|
+
| ------------ | ------- | -------------------------------------------- |
|
|
95
|
+
| `v-on:close` | — | Emitted when the snackbar requests to close. |
|
|
96
|
+
|
|
97
|
+
## Related components
|
|
98
|
+
|
|
99
|
+
useSnackbarAction, Alert, Button
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Spinner
|
|
2
|
+
|
|
3
|
+
Circular progress indicator for determinate and indeterminate loading states.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Spinner } from "@bridge-ui/vue/Components/Spinner";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Indeterminate
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<Spinner aria-label="Loading…" />
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Determinate
|
|
20
|
+
|
|
21
|
+
```vue
|
|
22
|
+
<Spinner :value="40" variant="determinate" aria-label="Export data" />
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### With track
|
|
26
|
+
|
|
27
|
+
```vue
|
|
28
|
+
<Spinner enable-track aria-label="Loading…" />
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Disable shrink
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<Spinner disable-shrink aria-label="Loading…" />
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Color and size
|
|
38
|
+
|
|
39
|
+
```vue
|
|
40
|
+
<Spinner size="lg" color="success" aria-label="Saving…" />
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Props
|
|
44
|
+
|
|
45
|
+
| Prop | Type | Default | Description |
|
|
46
|
+
| --------------- | -------------------- | ----------------- | ------------------------------------------------- |
|
|
47
|
+
| `classes` | `SpinnerClasses` | — | Classes for `root`, `svg`, `circle`, and `track`. |
|
|
48
|
+
| `color` | `SpinnerColor` | `"primary"` | Semantic color of the circle (and track). |
|
|
49
|
+
| `customProps` | `SpinnerCustomProps` | — | Extra props for internal parts. |
|
|
50
|
+
| `disableShrink` | `boolean` | `false` | Disables indeterminate circle shrink animation. |
|
|
51
|
+
| `enableTrack` | `boolean` | `false` | Shows a subtle track circle behind the progress. |
|
|
52
|
+
| `size` | `SpinnerSize` | `"md"` | Width/height of the spinner. |
|
|
53
|
+
| `thickness` | `number` | `3.6` | Stroke thickness of the circle. |
|
|
54
|
+
| `value` | `number` | — | Progress 0–100 (`determinate` variant). |
|
|
55
|
+
| `variant` | `SpinnerVariant` | `"indeterminate"` | Visual mode of the indicator. |
|
|
56
|
+
|
|
57
|
+
Pass `aria-label` or `aria-labelledby` for an accessible name.
|
|
58
|
+
|
|
59
|
+
## Related components
|
|
60
|
+
|
|
61
|
+
Progress, Skeleton
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Switch
|
|
2
|
+
|
|
3
|
+
Toggle switch. Extends FormControl props.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Switch } from "@bridge-ui/vue/Components/Switch";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<Switch end-label="Dark mode" description="Use dark theme across the app." />
|
|
17
|
+
|
|
18
|
+
<Switch v-model="enabled" end-label="Enable notifications" />
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Required and error
|
|
22
|
+
|
|
23
|
+
```vue
|
|
24
|
+
<Switch required end-label="Required field" />
|
|
25
|
+
|
|
26
|
+
<Switch
|
|
27
|
+
error
|
|
28
|
+
end-label="Invalid option"
|
|
29
|
+
error-message="You must enable this setting."
|
|
30
|
+
/>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### customProps
|
|
34
|
+
|
|
35
|
+
```vue
|
|
36
|
+
<Switch
|
|
37
|
+
end-label="Airplane mode"
|
|
38
|
+
:custom-props="{
|
|
39
|
+
input: { name: 'airplane' },
|
|
40
|
+
control: { 'data-testid': 'airplane-switch' },
|
|
41
|
+
}"
|
|
42
|
+
/>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Props
|
|
46
|
+
|
|
47
|
+
### Switch-specific
|
|
48
|
+
|
|
49
|
+
| Prop | Type | Default | Description |
|
|
50
|
+
| ------------- | ------------------- | --------- | ------------------------------------------------------------------------------------------ |
|
|
51
|
+
| `checked` | `boolean` | — | Whether the switch is on. |
|
|
52
|
+
| `classes` | `SwitchClasses` | — | Classes for the form control chrome and the switch control. |
|
|
53
|
+
| `color` | `SwitchColor` | "primary" | The color to apply to the switch. |
|
|
54
|
+
| `customProps` | `SwitchCustomProps` | — | Extra props for internal parts. |
|
|
55
|
+
| `rounded` | `SwitchRounded` | "full" | The roundedness of the switch track. |
|
|
56
|
+
| `size` | `SwitchSize` | "md" | Size of the control and of form control labels (`2xs` … `2xl`, same scale as `FormField`). |
|
|
57
|
+
| `slots` | `SwitchSlots` | — | Chrome slots and the control slot. |
|
|
58
|
+
|
|
59
|
+
### v-model
|
|
60
|
+
|
|
61
|
+
| Prop / Event | Type | Default | Description |
|
|
62
|
+
| ------------------- | -------------------------- | ------- | ---------------------------------------------------------------------------- |
|
|
63
|
+
| `modelValue` | `boolean` | — | Bound with `v-model`. |
|
|
64
|
+
| `update:modelValue` | `(value: boolean) => void` | — | Emitted when `v-model` should update. Listen with `v-on:update:model-value`. |
|
|
65
|
+
|
|
66
|
+
### Inherited from FormControl
|
|
67
|
+
|
|
68
|
+
See [FormControl](./FormControl.md).
|
|
69
|
+
|
|
70
|
+
## Related components
|
|
71
|
+
|
|
72
|
+
Checkbox, FormControl
|