@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,207 @@
|
|
|
1
|
+
# Tabs
|
|
2
|
+
|
|
3
|
+
Organize related content into tabbed views. Use with `TabList`, `Tab`, and `TabPanel`. Selected accent uses the semantic `color` palette; inactive tabs use `dark-*`.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Tabs } from "@bridge-ui/vue/Components/Tabs";
|
|
9
|
+
import { Tab } from "@bridge-ui/vue/Components/Tab";
|
|
10
|
+
import { TabItem } from "@bridge-ui/vue/Components/TabItem";
|
|
11
|
+
import { TabList } from "@bridge-ui/vue/Components/TabList";
|
|
12
|
+
import { TabPanel } from "@bridge-ui/vue/Components/TabPanel";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
|
|
17
|
+
### Usage
|
|
18
|
+
|
|
19
|
+
```vue
|
|
20
|
+
<Tabs v-model="pkg">
|
|
21
|
+
<TabList aria-label="Package manager">
|
|
22
|
+
<Tab value="bun">bun</Tab>
|
|
23
|
+
<Tab value="npm">npm</Tab>
|
|
24
|
+
<Tab value="pnpm">pnpm</Tab>
|
|
25
|
+
</TabList>
|
|
26
|
+
<TabPanel value="bun">bun install</TabPanel>
|
|
27
|
+
<TabPanel value="npm">npm install</TabPanel>
|
|
28
|
+
<TabPanel value="pnpm">pnpm install</TabPanel>
|
|
29
|
+
</Tabs>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### TabItem shortcut
|
|
33
|
+
|
|
34
|
+
```vue
|
|
35
|
+
<Tabs v-model="pkg">
|
|
36
|
+
<TabItem label="bun" value="bun">bun install</TabItem>
|
|
37
|
+
<TabItem label="npm" value="npm">npm install</TabItem>
|
|
38
|
+
</Tabs>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### With icons
|
|
42
|
+
|
|
43
|
+
```vue
|
|
44
|
+
<Tabs v-model="section">
|
|
45
|
+
<TabList aria-label="Settings">
|
|
46
|
+
<Tab :start-icon="User" value="account">My Account</Tab>
|
|
47
|
+
<Tab :start-icon="Building2" value="company">Company</Tab>
|
|
48
|
+
<Tab :start-icon="Users" value="team">Team Members</Tab>
|
|
49
|
+
</TabList>
|
|
50
|
+
<TabPanel value="account">Account</TabPanel>
|
|
51
|
+
<TabPanel value="company">Company</TabPanel>
|
|
52
|
+
<TabPanel value="team">Team</TabPanel>
|
|
53
|
+
</Tabs>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### TabItem with icons and slots
|
|
57
|
+
|
|
58
|
+
```vue
|
|
59
|
+
<Tabs v-model="section">
|
|
60
|
+
<TabItem :start-icon="Inbox" label="Inbox" value="inbox">Inbox</TabItem>
|
|
61
|
+
<TabItem label="Alerts" value="alerts" :end-icon="ChevronDown">
|
|
62
|
+
<template #start>
|
|
63
|
+
<Avatar size="sm" fallback="A" />
|
|
64
|
+
</template>
|
|
65
|
+
Alerts
|
|
66
|
+
</TabItem>
|
|
67
|
+
</Tabs>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Custom start / end on Tab
|
|
71
|
+
|
|
72
|
+
```vue
|
|
73
|
+
<Tabs v-model="tab">
|
|
74
|
+
<TabList>
|
|
75
|
+
<Tab value="one">
|
|
76
|
+
<template #start>
|
|
77
|
+
<Avatar size="sm" fallback="1" />
|
|
78
|
+
</template>
|
|
79
|
+
One
|
|
80
|
+
<template #end>
|
|
81
|
+
<Badge>3</Badge>
|
|
82
|
+
</template>
|
|
83
|
+
</Tab>
|
|
84
|
+
<Tab value="two" :end-icon="ChevronRight">Two</Tab>
|
|
85
|
+
</TabList>
|
|
86
|
+
<TabPanel value="one">First</TabPanel>
|
|
87
|
+
<TabPanel value="two">Second</TabPanel>
|
|
88
|
+
</Tabs>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Variants
|
|
92
|
+
|
|
93
|
+
`line` (default), `plain`, `pill`, `solid`, `enclosed`.
|
|
94
|
+
|
|
95
|
+
```vue
|
|
96
|
+
<Tabs v-model="tab" variant="line" color="primary">
|
|
97
|
+
<TabList>
|
|
98
|
+
<Tab value="one">One</Tab>
|
|
99
|
+
<Tab value="two">Two</Tab>
|
|
100
|
+
</TabList>
|
|
101
|
+
<TabPanel value="one">First</TabPanel>
|
|
102
|
+
<TabPanel value="two">Second</TabPanel>
|
|
103
|
+
</Tabs>
|
|
104
|
+
|
|
105
|
+
<Tabs color="dark" v-model="tab" variant="pill">
|
|
106
|
+
<TabList>
|
|
107
|
+
<Tab value="one">One</Tab>
|
|
108
|
+
<Tab value="two">Two</Tab>
|
|
109
|
+
</TabList>
|
|
110
|
+
<TabPanel value="one">First</TabPanel>
|
|
111
|
+
<TabPanel value="two">Second</TabPanel>
|
|
112
|
+
</Tabs>
|
|
113
|
+
|
|
114
|
+
<Tabs v-model="tab" variant="enclosed">
|
|
115
|
+
<TabList>
|
|
116
|
+
<Tab value="one">One</Tab>
|
|
117
|
+
<Tab value="two">Two</Tab>
|
|
118
|
+
</TabList>
|
|
119
|
+
<TabPanel value="one">First</TabPanel>
|
|
120
|
+
<TabPanel value="two">Second</TabPanel>
|
|
121
|
+
</Tabs>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Vertical
|
|
125
|
+
|
|
126
|
+
```vue
|
|
127
|
+
<Tabs v-model="section" orientation="vertical">
|
|
128
|
+
<TabList aria-label="Account">
|
|
129
|
+
<Tab value="account">Account</Tab>
|
|
130
|
+
<Tab value="settings">Settings</Tab>
|
|
131
|
+
</TabList>
|
|
132
|
+
<TabPanel value="account">Account content</TabPanel>
|
|
133
|
+
<TabPanel value="settings">Settings content</TabPanel>
|
|
134
|
+
</Tabs>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Manual activation
|
|
138
|
+
|
|
139
|
+
```vue
|
|
140
|
+
<Tabs v-model="letter" activation="manual">
|
|
141
|
+
<TabList>
|
|
142
|
+
<Tab value="a">A</Tab>
|
|
143
|
+
<Tab value="b">B</Tab>
|
|
144
|
+
</TabList>
|
|
145
|
+
<TabPanel value="a">Panel A</TabPanel>
|
|
146
|
+
<TabPanel value="b">Panel B</TabPanel>
|
|
147
|
+
</Tabs>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Props (`Tabs`)
|
|
151
|
+
|
|
152
|
+
| Prop | Type | Default |
|
|
153
|
+
| ------------- | ----------------- | -------------- |
|
|
154
|
+
| `activation` | `TabsActivation` | `"automatic"` |
|
|
155
|
+
| `color` | `TabsColor` | `"primary"` |
|
|
156
|
+
| `keepMounted` | `boolean` | `true` |
|
|
157
|
+
| `orientation` | `TabsOrientation` | `"horizontal"` |
|
|
158
|
+
| `size` | `TabsSize` | `"md"` |
|
|
159
|
+
| `variant` | `TabsVariant` | `"line"` |
|
|
160
|
+
|
|
161
|
+
### v-model
|
|
162
|
+
|
|
163
|
+
| Prop / Event | Type | Default | Description |
|
|
164
|
+
| ------------------- | ------------------------- | -------------------- | ---------------------------------------------------------------------------- |
|
|
165
|
+
| `modelValue` | `string` | first registered tab | The selected tab value. Bound with `v-model`. |
|
|
166
|
+
| `update:modelValue` | `(value: string) => void` | — | Emitted when `v-model` should update. Listen with `v-on:update:model-value`. |
|
|
167
|
+
|
|
168
|
+
## Events
|
|
169
|
+
|
|
170
|
+
| Event | Payload | Description |
|
|
171
|
+
| ------------- | ----------------- | ------------------------------------------ |
|
|
172
|
+
| `v-on:change` | `(value: string)` | Emitted whenever the selected tab changes. |
|
|
173
|
+
|
|
174
|
+
## Props (`Tab`)
|
|
175
|
+
|
|
176
|
+
| Prop | Type | Default |
|
|
177
|
+
| ----------- | ------------ | -------- |
|
|
178
|
+
| `value` | `string` | required |
|
|
179
|
+
| `startIcon` | `LucideIcon` | — |
|
|
180
|
+
| `endIcon` | `LucideIcon` | — |
|
|
181
|
+
| `disabled` | `boolean` | `false` |
|
|
182
|
+
|
|
183
|
+
Slots: `#default` (label), `#start`, `#end`. `#start` / `#end` are used when the matching Lucide icon prop is omitted.
|
|
184
|
+
|
|
185
|
+
## Props (`TabList`)
|
|
186
|
+
|
|
187
|
+
HTML attributes on the `role="tablist"` container (`aria-label`, `class`, etc.).
|
|
188
|
+
|
|
189
|
+
## Props (`TabPanel`)
|
|
190
|
+
|
|
191
|
+
| Prop | Type | Default |
|
|
192
|
+
| ------------- | --------- | -------------------- |
|
|
193
|
+
| `value` | `string` | required |
|
|
194
|
+
| `keepMounted` | `boolean` | inherits from `Tabs` |
|
|
195
|
+
|
|
196
|
+
## Props (`TabItem`)
|
|
197
|
+
|
|
198
|
+
| Prop | Type | Default |
|
|
199
|
+
| ------------- | ------------ | -------------------- |
|
|
200
|
+
| `value` | `string` | required |
|
|
201
|
+
| `label` | `string` | or `#label` slot |
|
|
202
|
+
| `startIcon` | `LucideIcon` | — |
|
|
203
|
+
| `endIcon` | `LucideIcon` | — |
|
|
204
|
+
| `disabled` | `boolean` | `false` |
|
|
205
|
+
| `keepMounted` | `boolean` | inherits from `Tabs` |
|
|
206
|
+
|
|
207
|
+
Slots: `#default` (panel), `#label`, `#start`, `#end`.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# TextField
|
|
2
|
+
|
|
3
|
+
Single-line text input with FormField chrome, icons, and adornments.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { TextField } from "@bridge-ui/vue/Components/TextField";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<TextField label="Email" placeholder="you@example.com" />
|
|
17
|
+
|
|
18
|
+
<TextField
|
|
19
|
+
v-model="name"
|
|
20
|
+
label="Display name"
|
|
21
|
+
description="This is how your name will appear."
|
|
22
|
+
/>
|
|
23
|
+
|
|
24
|
+
<TextField error label="Email" error-message="Enter a valid email address." />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Icons and adornments
|
|
28
|
+
|
|
29
|
+
```vue
|
|
30
|
+
<TextField label="Search" :start-icon="Search" placeholder="Search..." />
|
|
31
|
+
|
|
32
|
+
<TextField label="Website" start="https://" placeholder="example" />
|
|
33
|
+
|
|
34
|
+
<TextField end="EUR" label="Amount" placeholder="0.00" />
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Input types
|
|
38
|
+
|
|
39
|
+
```vue
|
|
40
|
+
<TextField type="email" label="Email" placeholder="you@example.com" />
|
|
41
|
+
|
|
42
|
+
<TextField type="tel" label="Phone" placeholder="+351 900 000 000" />
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### customProps
|
|
46
|
+
|
|
47
|
+
```vue
|
|
48
|
+
<TextField
|
|
49
|
+
label="Username"
|
|
50
|
+
placeholder="johndoe"
|
|
51
|
+
:custom-props="{
|
|
52
|
+
input: { autocomplete: 'username', name: 'username' },
|
|
53
|
+
}"
|
|
54
|
+
/>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Props
|
|
58
|
+
|
|
59
|
+
### v-model
|
|
60
|
+
|
|
61
|
+
| Prop / Event | Type | Default | Description |
|
|
62
|
+
| ------------------- | --------------------------------- | ------- | ---------------------------------------------------------------------------- |
|
|
63
|
+
| `modelValue` | `string \| null` | — | Bound with `v-model`. |
|
|
64
|
+
| `update:modelValue` | `(value: string \| null) => void` | — | Emitted when `v-model` should update. Listen with `v-on:update:model-value`. |
|
|
65
|
+
|
|
66
|
+
### Inherited from FormField
|
|
67
|
+
|
|
68
|
+
See [FormField](./FormField.md).
|
|
69
|
+
|
|
70
|
+
## Related components
|
|
71
|
+
|
|
72
|
+
FormField, PasswordField, NumberField, Textarea, Select
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Textarea
|
|
2
|
+
|
|
3
|
+
Multiline text input. Extends FormField props.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Textarea } from "@bridge-ui/vue/Components/Textarea";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<Textarea :rows="3" label="Notes" placeholder="Add details..." />
|
|
17
|
+
|
|
18
|
+
<Textarea
|
|
19
|
+
:rows="4"
|
|
20
|
+
label="Bio"
|
|
21
|
+
v-model="bio"
|
|
22
|
+
description="Tell us about yourself."
|
|
23
|
+
/>
|
|
24
|
+
|
|
25
|
+
<Textarea
|
|
26
|
+
error
|
|
27
|
+
:rows="3"
|
|
28
|
+
label="Message"
|
|
29
|
+
error-message="Please enter at least 10 characters."
|
|
30
|
+
/>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Autosize
|
|
34
|
+
|
|
35
|
+
```vue
|
|
36
|
+
<Textarea
|
|
37
|
+
autosize
|
|
38
|
+
:rows="2"
|
|
39
|
+
label="Growing textarea"
|
|
40
|
+
placeholder="Add more lines to see autosize..."
|
|
41
|
+
/>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### customProps
|
|
45
|
+
|
|
46
|
+
```vue
|
|
47
|
+
<Textarea
|
|
48
|
+
:rows="3"
|
|
49
|
+
label="Feedback"
|
|
50
|
+
placeholder="maxlength 200"
|
|
51
|
+
:custom-props="{
|
|
52
|
+
input: { maxlength: 200, name: 'demo-textarea' },
|
|
53
|
+
}"
|
|
54
|
+
/>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Props
|
|
58
|
+
|
|
59
|
+
### Textarea-specific
|
|
60
|
+
|
|
61
|
+
| Prop | Type | Default | Description |
|
|
62
|
+
| ----------- | ---------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
63
|
+
| `autosize` | `boolean` | — | Whether the textarea automatically resizes with its content. Defaults to `true` when `likeInput` is set; otherwise `false`. |
|
|
64
|
+
| `likeInput` | `boolean` | `false` | Use compact TextField-like sizing instead of the default multiline textarea profile. Enables `autosize` and `rows={1}` by default; both can be overridden explicitly. |
|
|
65
|
+
| `resize` | `TextareaResize` | "none" | Native resize handle (`resize` CSS). Ignored when `autosize` is `true`. |
|
|
66
|
+
|
|
67
|
+
### v-model
|
|
68
|
+
|
|
69
|
+
| Prop / Event | Type | Default | Description |
|
|
70
|
+
| ------------------- | --------------------------------- | ------- | ---------------------------------------------------------------------------- |
|
|
71
|
+
| `modelValue` | `string \| null` | — | Bound with `v-model`. |
|
|
72
|
+
| `update:modelValue` | `(value: string \| null) => void` | — | Emitted when `v-model` should update. Listen with `v-on:update:model-value`. |
|
|
73
|
+
|
|
74
|
+
### Inherited from FormField
|
|
75
|
+
|
|
76
|
+
See [FormField](./FormField.md).
|
|
77
|
+
|
|
78
|
+
## Related components
|
|
79
|
+
|
|
80
|
+
TextField, FormField
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Tooltip
|
|
2
|
+
|
|
3
|
+
Anchored hint that appears on hover or focus. Put the opener in the `trigger` slot (or pass `anchorEl`). Use `content` for plain text, or the default slot for custom panel body (default slot wins when both are set). Visibility uses `v-model` (omit for uncontrolled hover/focus when using `trigger`).
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Tooltip } from "@bridge-ui/vue/Components/Tooltip";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<Tooltip content="Save changes">
|
|
17
|
+
<template #trigger>
|
|
18
|
+
<Button>Save</Button>
|
|
19
|
+
</template>
|
|
20
|
+
</Tooltip>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Placement
|
|
24
|
+
|
|
25
|
+
```vue
|
|
26
|
+
<Tooltip content="Top end" placement="top-end">
|
|
27
|
+
<template #trigger>
|
|
28
|
+
<Button>Hover me</Button>
|
|
29
|
+
</template>
|
|
30
|
+
</Tooltip>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Without arrow
|
|
34
|
+
|
|
35
|
+
```vue
|
|
36
|
+
<Tooltip :arrow="false" content="No arrow">
|
|
37
|
+
<template #trigger>
|
|
38
|
+
<Button>Save</Button>
|
|
39
|
+
</template>
|
|
40
|
+
</Tooltip>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Controlled
|
|
44
|
+
|
|
45
|
+
```vue
|
|
46
|
+
<Tooltip v-model="open" content="Controlled">
|
|
47
|
+
<template #trigger>
|
|
48
|
+
<Button>Save</Button>
|
|
49
|
+
</template>
|
|
50
|
+
</Tooltip>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### anchorEl
|
|
54
|
+
|
|
55
|
+
```vue
|
|
56
|
+
<button ref="anchorRef">External anchor</button>
|
|
57
|
+
|
|
58
|
+
<Tooltip v-model="open" content="From anchor" :anchor-el="anchorRef">
|
|
59
|
+
</Tooltip>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Custom default slot
|
|
63
|
+
|
|
64
|
+
```vue
|
|
65
|
+
<Tooltip>
|
|
66
|
+
<template #trigger>
|
|
67
|
+
<Button>Save</Button>
|
|
68
|
+
</template>
|
|
69
|
+
<span class="font-bold">Custom body</span>
|
|
70
|
+
</Tooltip>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Color and size
|
|
74
|
+
|
|
75
|
+
```vue
|
|
76
|
+
<Tooltip size="lg" color="primary" content="Primary tip">
|
|
77
|
+
<template #trigger>
|
|
78
|
+
<Button>Save</Button>
|
|
79
|
+
</template>
|
|
80
|
+
</Tooltip>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Props
|
|
84
|
+
|
|
85
|
+
| Prop | Type | Default | Description |
|
|
86
|
+
| ------------- | --------------------- | --------- | ---------------------------------------------------------------------------------------------------- |
|
|
87
|
+
| `anchorEl` | `HTMLElement \| null` | — | Element that anchors the tooltip panel. When set, it is used for positioning instead of the trigger. |
|
|
88
|
+
| `arrow` | `boolean` | `true` | Whether the tooltip shows an arrow pointing at the trigger. |
|
|
89
|
+
| `classes` | `TooltipClasses` | — | Classes for `root`, `trigger`, `content`, and `arrow`. |
|
|
90
|
+
| `closeDelay` | `number` | `0` | Delay in ms before closing after pointer leave / blur. |
|
|
91
|
+
| `color` | `TooltipColor` | `"dark"` | Semantic color of the tooltip panel. |
|
|
92
|
+
| `content` | `string` | — | Plain text for the tooltip panel. Prefer the default slot for custom markup. |
|
|
93
|
+
| `customProps` | `TooltipCustomProps` | — | Extra props for internal parts. |
|
|
94
|
+
| `disabled` | `boolean` | `false` | When true, the tooltip does not open on hover or focus. |
|
|
95
|
+
| `offset` | `number` | `8` | Gap between the trigger and the tooltip panel (px). |
|
|
96
|
+
| `openDelay` | `number` | `200` | Delay in ms before opening after pointer enter / focus. |
|
|
97
|
+
| `placement` | `PositionPlacement` | `"top"` | Preferred placement of the tooltip relative to the anchor. |
|
|
98
|
+
| `rounded` | `TooltipRounded` | `"md"` | The roundedness of the tooltip panel. |
|
|
99
|
+
| `size` | `TooltipSize` | `"md"` | Padding and typography of the tooltip panel. |
|
|
100
|
+
| `strategy` | `PositionStrategy` | `"fixed"` | CSS position strategy for the floating panel. |
|
|
101
|
+
| `teleportTo` | `string \| false` | `"body"` | Where to portal the tooltip panel. Pass `false` to render in place. |
|
|
102
|
+
|
|
103
|
+
### Binding
|
|
104
|
+
|
|
105
|
+
| Prop | Type | Default | Description |
|
|
106
|
+
| -------------- | ------------------------- | ------- | ---------------------------------------------------------------------------------- |
|
|
107
|
+
| `v-model` | `boolean` | `false` | Whether the tooltip is visible. Omit for uncontrolled hover/focus with `#trigger`. |
|
|
108
|
+
| `onShowChange` | `(show: boolean) => void` | — | Called when visibility should change (without relying on `v-model`). |
|
|
109
|
+
|
|
110
|
+
## Events
|
|
111
|
+
|
|
112
|
+
| Event | Payload | Description |
|
|
113
|
+
| ------------- | --------- | -------------------------------------- |
|
|
114
|
+
| `show-change` | `boolean` | Emitted when visibility should change. |
|
|
115
|
+
|
|
116
|
+
## Slots
|
|
117
|
+
|
|
118
|
+
| Slot | Description |
|
|
119
|
+
| --------- | ------------------------------------------------------------------ |
|
|
120
|
+
| `default` | Custom panel body. Wins over the `content` prop when both are set. |
|
|
121
|
+
| `trigger` | The trigger element that opens the tooltip. |
|
|
122
|
+
|
|
123
|
+
## Related components
|
|
124
|
+
|
|
125
|
+
Menu, Spinner
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# useBreakpoint
|
|
2
|
+
|
|
3
|
+
Reactive viewport breakpoints aligned with Tailwind `--breakpoint-*` tokens.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { useBreakpoint } from "@bridge-ui/vue";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<script setup>
|
|
17
|
+
import { useBreakpoint } from "@bridge-ui/vue";
|
|
18
|
+
|
|
19
|
+
const breakpoint = useBreakpoint();
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<p v-if="breakpoint.mobile">Mobile layout</p>
|
|
24
|
+
<p v-else-if="breakpoint.greaterOrEqual('lg')">Large layout</p>
|
|
25
|
+
</template>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Responsive Modal
|
|
29
|
+
|
|
30
|
+
```vue
|
|
31
|
+
<script setup>
|
|
32
|
+
import { useBreakpoint } from "@bridge-ui/vue";
|
|
33
|
+
|
|
34
|
+
const breakpoint = useBreakpoint();
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<template>
|
|
38
|
+
<Modal
|
|
39
|
+
v-model="open"
|
|
40
|
+
:align="breakpoint.mobile ? 'bottom-center' : 'middle-center'"
|
|
41
|
+
>
|
|
42
|
+
…
|
|
43
|
+
</Modal>
|
|
44
|
+
</template>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Global defaults
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
app.use(
|
|
51
|
+
createBridgeUI({
|
|
52
|
+
global: {
|
|
53
|
+
mobileBreakpoint: "md",
|
|
54
|
+
breakpoints: { "3xl": "120rem" },
|
|
55
|
+
},
|
|
56
|
+
}),
|
|
57
|
+
);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Composable options override the provider when passed:
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
useBreakpoint({
|
|
64
|
+
mobileBreakpoint: "lg",
|
|
65
|
+
breakpoints: { sm: "30rem" },
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## API
|
|
70
|
+
|
|
71
|
+
| Member | Type | Description |
|
|
72
|
+
| ---------------------- | --------------------------------------- | ----------------------------------------------- |
|
|
73
|
+
| `name` | `string` | Active band (`xs` or a breakpoint key) |
|
|
74
|
+
| `width` | `number` | Viewport width (px) |
|
|
75
|
+
| `height` | `number` | Viewport height (px) |
|
|
76
|
+
| `mobile` | `boolean` | `width < mobileBreakpoint` |
|
|
77
|
+
| `thresholds` | `Record<string, number>` | Resolved min-widths (px) |
|
|
78
|
+
| `lessThan(name)` | `(name: string) => boolean` | `width <` threshold |
|
|
79
|
+
| `lessOrEqual(name)` | `(name: string) => boolean` | `width <=` threshold |
|
|
80
|
+
| `greaterThan(name)` | `(name: string) => boolean` | `width >` threshold |
|
|
81
|
+
| `greaterOrEqual(name)` | `(name: string) => boolean` | `width >=` threshold (Tailwind `sm:` semantics) |
|
|
82
|
+
| `between(min, max)` | `(min: string, max: string) => boolean` | `>= min` and `< max` |
|
|
83
|
+
|
|
84
|
+
Returns a **reactive object** — read properties on the object (do not destructure helpers) so updates stay reactive in script.
|
|
85
|
+
|
|
86
|
+
On the server (and before mount), `width`/`height` are `0` and `mobile` is `true`.
|
|
87
|
+
|
|
88
|
+
### Options
|
|
89
|
+
|
|
90
|
+
| Option | Type | Default | Description |
|
|
91
|
+
| ------------------ | ------------------------ | --------------- | -------------------------------------------- |
|
|
92
|
+
| `mobileBreakpoint` | `string` | global / `"sm"` | Threshold for `mobile` |
|
|
93
|
+
| `breakpoints` | `Record<string, string>` | global / `{}` | Extra or overridden CSS lengths (`40rem`, …) |
|
|
94
|
+
|
|
95
|
+
Breakpoints are read from `--breakpoint-*` (export via `@theme static` in Bridge themes). Custom names work when the CSS variable exists or is passed in `breakpoints`.
|
|
96
|
+
|
|
97
|
+
## Related
|
|
98
|
+
|
|
99
|
+
- [Modal](./Modal.md)
|
|
100
|
+
- [BridgeUIProvider](./BridgeUIProvider.md)
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# useDialogAction
|
|
2
|
+
|
|
3
|
+
Imperative API to open preset confirmation dialogs. Requires `BridgeUIHosts` and `BridgeDialogHost`.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { useDialogAction } from "@bridge-ui/vue/Actions";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Prerequisites
|
|
12
|
+
|
|
13
|
+
Mount `BridgeUIHosts` with the matching host (`BridgeDialogHost`, `BridgeModalHost`, or `BridgeSnackbarHost`) inside `BridgeUIProvider`.
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
|
|
17
|
+
### Usage
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
const dialog = useDialogAction();
|
|
21
|
+
|
|
22
|
+
const id = dialog.open({
|
|
23
|
+
title: "Delete item?",
|
|
24
|
+
description: "This action cannot be undone.",
|
|
25
|
+
actions: {
|
|
26
|
+
reject: { label: "Cancel" },
|
|
27
|
+
accept: { label: "Delete", color: "error" },
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### open
|
|
33
|
+
|
|
34
|
+
```vue
|
|
35
|
+
<Button v-on:click="openBasic">Open basic</Button>
|
|
36
|
+
|
|
37
|
+
<Button variant="outline" v-on:click="openDestructive">
|
|
38
|
+
Open destructive
|
|
39
|
+
</Button>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### close / closeTop
|
|
43
|
+
|
|
44
|
+
```vue
|
|
45
|
+
<Button
|
|
46
|
+
variant="outline"
|
|
47
|
+
:disabled="!lastId"
|
|
48
|
+
v-on:click="lastId && dialog.close(lastId)"
|
|
49
|
+
>
|
|
50
|
+
close(lastId)
|
|
51
|
+
</Button>
|
|
52
|
+
|
|
53
|
+
<Button variant="outline" v-on:click="dialog.closeTop()">
|
|
54
|
+
closeTop()
|
|
55
|
+
</Button>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### update
|
|
59
|
+
|
|
60
|
+
```vue
|
|
61
|
+
<Button v-on:click="openUpdateDemo">Open update demo</Button>
|
|
62
|
+
|
|
63
|
+
<Button
|
|
64
|
+
variant="outline"
|
|
65
|
+
:disabled="!updateDemoId"
|
|
66
|
+
v-on:click="
|
|
67
|
+
dialog.update(updateDemoId, {
|
|
68
|
+
props: { title: 'Updated title' },
|
|
69
|
+
})
|
|
70
|
+
"
|
|
71
|
+
>
|
|
72
|
+
update props
|
|
73
|
+
</Button>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Nested stack
|
|
77
|
+
|
|
78
|
+
```vue
|
|
79
|
+
<Button v-on:click="openNested">Open nested example</Button>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## API
|
|
83
|
+
|
|
84
|
+
| Method | Description |
|
|
85
|
+
| ------------------- | ----------------------------- |
|
|
86
|
+
| `open(options)` | Push a dialog onto the stack |
|
|
87
|
+
| `close(id)` | Close a specific dialog |
|
|
88
|
+
| `closeTop()` | Close the topmost dialog |
|
|
89
|
+
| `isOpen(id)` | Whether an id is open |
|
|
90
|
+
| `update(id, patch)` | Update props or modal options |
|
|
91
|
+
| `stackSize` | Current stack depth |
|
|
92
|
+
|
|
93
|
+
**open() options:** `title`, `description`, `color`, `modal` (`size`, `transition`, `persistent`, `align`), `actions.accept`, `actions.reject`, `onClose`, `onClosed`
|
|
94
|
+
|
|
95
|
+
## Related components
|
|
96
|
+
|
|
97
|
+
Modal, useModalAction, BridgeUIProvider
|