@bridge-ui/vue 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/AGENTS.md +1 -1
- package/ai/README.md +1 -1
- package/ai/llms.txt +4 -3
- package/ai/skills/bridge-ui-setup/SKILL.md +9 -8
- package/dist/Adapters/I18n/useI18nAdapter.d.ts +1 -1
- package/dist/Adapters/Icon/mockIconAdapter.d.ts +5 -0
- package/dist/Adapters/Icon/useIconAdapter.d.ts +1 -1
- package/dist/Adapters/RichText/useRichTextAdapter.d.ts +1 -1
- package/dist/Components/ActionFooter/ActionFooter.vue_vue_type_script_setup_true_lang.js +3 -5
- package/dist/Components/ActionFooter/actionFooter.types.d.ts +7 -12
- package/dist/Components/ActionFooter/composables/useActionFooter.d.ts +4 -4
- package/dist/Components/ActionFooter/composables/useActionFooter.js +3 -4
- package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +2 -2
- package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +3 -3
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +2 -0
- package/dist/Components/BaseField/composables/useBaseField.js +1 -0
- package/dist/Components/Checkbox/composables/useCheckbox.js +1 -0
- package/dist/Components/ColorField/ColorField.vue.d.ts +2 -2
- package/dist/Components/ColorField/ColorField.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/ColorField/composables/useColorField.d.ts +2 -2
- package/dist/Components/ColorField/composables/useColorField.js +2 -0
- package/dist/Components/ColorPicker/ColorPicker.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/Components/ColorPicker/colorPicker.types.d.ts +8 -2
- package/dist/Components/ColorPicker/composables/useColorPicker.d.ts +2 -2
- package/dist/Components/ColorPicker/composables/useColorPicker.js +1 -0
- package/dist/Components/DateField/DateField.vue.d.ts +2 -2
- package/dist/Components/DateField/composables/useDateField.d.ts +2 -2
- package/dist/Components/DateField/composables/useDateField.js +2 -0
- package/dist/Components/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/DateRangeField/DateRangeField.vue.d.ts +2 -2
- package/dist/Components/DateRangeField/composables/useDateRangeField.d.ts +2 -2
- package/dist/Components/DateRangeField/composables/useDateRangeField.js +2 -0
- package/dist/Components/DateRangePicker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/DateTimeField/DateTimeField.vue.d.ts +2 -2
- package/dist/Components/DateTimeField/composables/useDateTimeField.d.ts +2 -2
- package/dist/Components/DateTimeField/composables/useDateTimeField.js +2 -0
- package/dist/Components/DateTimePicker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue.d.ts +2 -2
- package/dist/Components/DateTimeRangeField/composables/useDateTimeRangeField.d.ts +2 -2
- package/dist/Components/DateTimeRangeField/composables/useDateTimeRangeField.js +2 -0
- package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/Drawer/Drawer.vue.d.ts +1 -1
- package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -1
- package/dist/Components/FileUpload/FileUpload.vue.d.ts +2 -2
- package/dist/Components/FormControl/composables/useFormControl.js +46 -45
- package/dist/Components/FormField/composables/useFormField.d.ts +1 -1
- package/dist/Components/FormField/composables/useFormField.js +144 -143
- package/dist/Components/ListItem/composables/useListItem.d.ts +1 -1
- package/dist/Components/Listbox/Listbox.vue.d.ts +0 -1
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/Components/Modal/Modal.vue.d.ts +1 -1
- package/dist/Components/Modal/composables/useModal.d.ts +1 -1
- package/dist/Components/NumberField/composables/useNumberField.d.ts +2 -2
- package/dist/Components/NumberField/composables/useNumberField.js +1 -0
- package/dist/Components/OtpField/composables/useOtpField.js +1 -0
- package/dist/Components/PasswordField/composables/usePasswordField.d.ts +2 -2
- package/dist/Components/PasswordField/composables/usePasswordField.js +1 -0
- package/dist/Components/Radio/composables/useRadio.js +1 -0
- package/dist/Components/Rating/composables/useRating.js +1 -0
- package/dist/Components/RichTextEditor/RichTextEditor.vue_vue_type_script_setup_true_lang.js +36 -32
- package/dist/Components/RichTextEditor/composables/useRichTextEditor.d.ts +2 -1
- package/dist/Components/RichTextEditor/composables/useRichTextEditor.js +143 -141
- package/dist/Components/Select/Select.vue.d.ts +2 -2
- package/dist/Components/Select/composables/useSelect.d.ts +3 -3
- package/dist/Components/Select/composables/useSelect.js +2 -0
- package/dist/Components/Slider/composables/useSlider.js +1 -0
- package/dist/Components/Switch/composables/useSwitch.js +1 -0
- package/dist/Components/Tabs/composables/useTabs.d.ts +0 -156
- package/dist/Components/TextField/composables/useTextField.d.ts +2 -2
- package/dist/Components/Textarea/composables/useTextarea.d.ts +2 -2
- package/dist/Components/Textarea/composables/useTextarea.js +1 -0
- package/dist/Components/TimeField/TimeField.vue.d.ts +2 -2
- package/dist/Components/TimeField/composables/useTimeField.d.ts +2 -2
- package/dist/Components/TimeField/composables/useTimeField.js +2 -0
- package/dist/Components/TimePicker/TimePicker.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/TimePicker/composables/useTimePicker.js +1 -0
- package/dist/Components/TimeRangeField/TimeRangeField.vue.d.ts +2 -2
- package/dist/Components/TimeRangeField/composables/useTimeRangeField.d.ts +2 -2
- package/dist/Components/TimeRangeField/composables/useTimeRangeField.js +2 -0
- package/dist/Components/TimeRangePicker/TimeRangePicker.vue_vue_type_script_setup_true_lang.js +2 -0
- package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.js +1 -0
- package/dist/Components/Tooltip/Tooltip.vue.d.ts +0 -1
- package/dist/Components/Tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Utils/index.d.ts +16 -6
- package/dist/Utils/index.js +39 -35
- package/dist/augments.d.ts +1 -1
- package/dist/theme.css +10 -1
- package/docs/README.md +27 -13
- package/docs/components/ActionFooter.md +16 -14
- package/docs/components/BridgeUIProvider.md +108 -16
- package/docs/components/ColorPicker.md +14 -13
- package/docs/components/I18n.md +6 -6
- package/docs/components/Icon.md +10 -10
- package/docs/components/RichTextEditor.md +4 -4
- package/package.json +3 -92
- package/dist/Adapters/Examples/date-date-fns.d.ts +0 -9
- package/dist/Adapters/Examples/date-date-fns.js +0 -151
- package/dist/Adapters/Examples/date-dayjs.d.ts +0 -19
- package/dist/Adapters/Examples/date-dayjs.js +0 -174
- package/dist/Adapters/Examples/date-luxon.d.ts +0 -7
- package/dist/Adapters/Examples/date-luxon.js +0 -164
- package/dist/Adapters/Examples/date-moment.d.ts +0 -19
- package/dist/Adapters/Examples/date-moment.js +0 -172
- package/dist/Adapters/Examples/i18n-dictionary.d.ts +0 -15
- package/dist/Adapters/Examples/i18n-dictionary.js +0 -97
- package/dist/Adapters/Examples/i18n-vue-i18n.d.ts +0 -7
- package/dist/Adapters/Examples/i18n-vue-i18n.js +0 -14
- package/dist/Adapters/Examples/icon-fontawesome.d.ts +0 -19
- package/dist/Adapters/Examples/icon-fontawesome.js +0 -82
- package/dist/Adapters/Examples/icon-heroicons.d.ts +0 -5
- package/dist/Adapters/Examples/icon-heroicons.js +0 -56
- package/dist/Adapters/Examples/icon-lucide.d.ts +0 -5
- package/dist/Adapters/Examples/icon-lucide.js +0 -56
- package/dist/Adapters/Examples/icon-phosphor.d.ts +0 -5
- package/dist/Adapters/Examples/icon-phosphor.js +0 -56
- package/dist/Adapters/Examples/icon-tabler.d.ts +0 -5
- package/dist/Adapters/Examples/icon-tabler.js +0 -56
- package/dist/Adapters/Examples/rich-text-tiptap.d.ts +0 -5
- package/dist/Adapters/Examples/rich-text-tiptap.js +0 -131
package/docs/README.md
CHANGED
|
@@ -86,17 +86,31 @@ Component reference for **Vue**. This folder ships with the npm package.
|
|
|
86
86
|
|
|
87
87
|
## Adapters
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
Ready-made adapters ship in the separate `@bridge-ui/adapters` package. Install it, import from a subpath, and install the matching optional peer (date lib, icon set, i18n lib, TipTap).
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
- `@bridge-ui/vue/
|
|
96
|
-
- `@bridge-ui/vue/
|
|
97
|
-
- `@bridge-ui/vue/
|
|
98
|
-
- `@bridge-ui/vue/
|
|
99
|
-
- `@bridge-ui/vue/
|
|
100
|
-
- `@bridge-ui/vue/
|
|
101
|
-
- `@bridge-ui/vue/
|
|
102
|
-
- `@bridge-ui/vue/
|
|
91
|
+
```bash
|
|
92
|
+
npm install @bridge-ui/adapters
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
- `@bridge-ui/adapters/vue/date-date-fns`
|
|
96
|
+
- `@bridge-ui/adapters/vue/date-dayjs`
|
|
97
|
+
- `@bridge-ui/adapters/vue/date-luxon`
|
|
98
|
+
- `@bridge-ui/adapters/vue/date-moment`
|
|
99
|
+
- `@bridge-ui/adapters/vue/icon-lucide`
|
|
100
|
+
- `@bridge-ui/adapters/vue/icon-heroicons`
|
|
101
|
+
- `@bridge-ui/adapters/vue/icon-tabler`
|
|
102
|
+
- `@bridge-ui/adapters/vue/icon-phosphor`
|
|
103
|
+
- `@bridge-ui/adapters/vue/icon-fontawesome`
|
|
104
|
+
- `@bridge-ui/adapters/vue/i18n-dictionary`
|
|
105
|
+
- `@bridge-ui/adapters/vue/i18n-vue-i18n`
|
|
106
|
+
- `@bridge-ui/adapters/vue/rich-text-tiptap`
|
|
107
|
+
|
|
108
|
+
### Migrating from `Adapters/Examples`
|
|
109
|
+
|
|
110
|
+
`@bridge-ui/vue/Adapters/Examples/*` was removed. Swap the import prefix — factory names are unchanged:
|
|
111
|
+
|
|
112
|
+
| Before | After |
|
|
113
|
+
| ----------------------------------------- | -------------------------------- |
|
|
114
|
+
| `@bridge-ui/vue/Adapters/Examples/<name>` | `@bridge-ui/adapters/vue/<name>` |
|
|
115
|
+
|
|
116
|
+
`@bridge-ui/vue` no longer declares the adapter libraries as peers. Keep them in your app dependencies. No extra Tailwind `@source` is needed: the TipTap editable class ships in `@bridge-ui/vue/theme.css`.
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Cancel / Apply pair used as the default footer in pickers and listboxes. The host keeps the footer bar; `ActionFooter` only renders the buttons.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Both buttons share one `color`; `applyVariant` / `cancelVariant` set their hierarchy. Inside pickers, listboxes and the `RichTextEditor` link editor the footer follows the host `color` (`<DatePicker color="success" show-footer />` gets a green footer). There, `components.ActionFooter.defaultProps.color` does not apply — set `color` on the host (or `global.defaultColor`) instead.
|
|
6
|
+
|
|
7
|
+
Theme the variants once through `components.ActionFooter.defaultProps`. Instance `customProps.applyButton` / `cancelButton` still win, including a per-button `color`.
|
|
6
8
|
|
|
7
9
|
## Import
|
|
8
10
|
|
|
@@ -18,6 +20,8 @@ import { ActionFooter } from "@bridge-ui/vue/Components/ActionFooter";
|
|
|
18
20
|
<ActionFooter v-on:apply="save" v-on:cancel="discard" />
|
|
19
21
|
|
|
20
22
|
<ActionFooter apply-label="Save" cancel-label="Discard" />
|
|
23
|
+
|
|
24
|
+
<ActionFooter color="info" cancel-variant="outline" />
|
|
21
25
|
```
|
|
22
26
|
|
|
23
27
|
### Registry defaults
|
|
@@ -27,9 +31,8 @@ import { ActionFooter } from "@bridge-ui/vue/Components/ActionFooter";
|
|
|
27
31
|
:components="{
|
|
28
32
|
ActionFooter: {
|
|
29
33
|
defaultProps: {
|
|
30
|
-
|
|
31
|
-
cancelVariant: '
|
|
32
|
-
cancelColor: 'secondary',
|
|
34
|
+
applyVariant: 'solid',
|
|
35
|
+
cancelVariant: 'outline',
|
|
33
36
|
},
|
|
34
37
|
},
|
|
35
38
|
}"
|
|
@@ -62,16 +65,15 @@ import { ActionFooter } from "@bridge-ui/vue/Components/ActionFooter";
|
|
|
62
65
|
|
|
63
66
|
## Props
|
|
64
67
|
|
|
65
|
-
| Prop | Type | Default
|
|
66
|
-
| ---------------- | ------------------------- |
|
|
67
|
-
| `apply-
|
|
68
|
-
| `apply-
|
|
69
|
-
| `
|
|
70
|
-
| `cancel-
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
| `
|
|
74
|
-
| `custom-props` | `ActionFooterCustomProps` | — | Extra props for internal parts. |
|
|
68
|
+
| Prop | Type | Default | Description |
|
|
69
|
+
| ---------------- | ------------------------- | ----------- | -------------------------------------------------------- |
|
|
70
|
+
| `apply-label` | `string` | `"Apply"` | Label of the Apply button. Falls back to i18n `Apply`. |
|
|
71
|
+
| `apply-variant` | `ButtonVariant` | — | Variant of the Apply button. Falls back to `Button`. |
|
|
72
|
+
| `cancel-label` | `string` | `"Cancel"` | Label of the Cancel button. Falls back to i18n `Cancel`. |
|
|
73
|
+
| `cancel-variant` | `ButtonVariant` | `"flat"` | Variant of the Cancel button. |
|
|
74
|
+
| `classes` | `ActionFooterClasses` | — | Classes for `root`, `applyButton`, `cancelButton`. |
|
|
75
|
+
| `color` | `ButtonColor` | `"primary"` | Color shared by both buttons. |
|
|
76
|
+
| `custom-props` | `ActionFooterCustomProps` | — | Extra props for internal parts. |
|
|
75
77
|
|
|
76
78
|
## Events
|
|
77
79
|
|
|
@@ -28,11 +28,11 @@ import { BridgeUIProvider, useBridgeUI } from "@bridge-ui/vue";
|
|
|
28
28
|
|
|
29
29
|
### Icon adapter
|
|
30
30
|
|
|
31
|
-
Provide `global.icons` when using semantic icon names (`"clear"`, `"check"`, …). Optional `normalize` converts library-native values (e.g. Font Awesome definitions) so `<Icon :icon="faCoffee" />` works. Ready adapters: `@bridge-ui/vue/
|
|
31
|
+
Provide `global.icons` when using semantic icon names (`"clear"`, `"check"`, …). Optional `normalize` converts library-native values (e.g. Font Awesome definitions) so `<Icon :icon="faCoffee" />` works. Ready adapters: `@bridge-ui/adapters/vue/icon-lucide` (and `icon-heroicons`, `icon-tabler`, `icon-phosphor`, `icon-fontawesome`). Install `@bridge-ui/adapters` and the matching icon library.
|
|
32
32
|
|
|
33
33
|
```ts
|
|
34
34
|
import { createBridgeUI } from "@bridge-ui/vue";
|
|
35
|
-
import { createLucideIconAdapter } from "@bridge-ui/vue/
|
|
35
|
+
import { createLucideIconAdapter } from "@bridge-ui/adapters/vue/icon-lucide";
|
|
36
36
|
|
|
37
37
|
const icons = createLucideIconAdapter();
|
|
38
38
|
|
|
@@ -45,11 +45,11 @@ app.use(
|
|
|
45
45
|
|
|
46
46
|
### i18n adapter
|
|
47
47
|
|
|
48
|
-
Provide `global.i18n` to translate Bridge chrome strings (`"Close"`, `"Hide password"`, …). Lookup is gettext-style (source English text is the key). Without an adapter, the source string is used. `setLocale` updates Bridge `locale` and calls optional `i18n.setLocale` (vue-i18n / i18next / dictionary). Persistence (localStorage, backend) stays in the app. Ready adapters: `@bridge-ui/vue/
|
|
48
|
+
Provide `global.i18n` to translate Bridge chrome strings (`"Close"`, `"Hide password"`, …). Lookup is gettext-style (source English text is the key). Without an adapter, the source string is used. `setLocale` updates Bridge `locale` and calls optional `i18n.setLocale` (vue-i18n / i18next / dictionary). Persistence (localStorage, backend) stays in the app. Ready adapters: `@bridge-ui/adapters/vue/i18n-dictionary` and `@bridge-ui/adapters/vue/i18n-vue-i18n`. See [I18n](./I18n.md).
|
|
49
49
|
|
|
50
50
|
```ts
|
|
51
51
|
import { createBridgeUI } from "@bridge-ui/vue";
|
|
52
|
-
import { createDictionaryI18nAdapter } from "@bridge-ui/vue/
|
|
52
|
+
import { createDictionaryI18nAdapter } from "@bridge-ui/adapters/vue/i18n-dictionary";
|
|
53
53
|
|
|
54
54
|
const i18n = createDictionaryI18nAdapter();
|
|
55
55
|
|
|
@@ -62,7 +62,7 @@ app.use(
|
|
|
62
62
|
|
|
63
63
|
### Date adapter
|
|
64
64
|
|
|
65
|
-
Provide `global.dates` to replace the native `Date` adapter used by calendars and pickers. Without one, each provider creates its own native `Date` adapter. Ready adapters: `@bridge-ui/vue/
|
|
65
|
+
Provide `global.dates` to replace the native `Date` adapter used by calendars and pickers. Without one, each provider creates its own native `Date` adapter. Ready adapters: `@bridge-ui/adapters/vue/date-dayjs` (and `date-date-fns`, `date-luxon`, `date-moment`). Install `@bridge-ui/adapters` and the matching date library. `setTimeZone` updates Bridge `timeZone` and calls optional `dates.setTimeZone`.
|
|
66
66
|
|
|
67
67
|
Bridge locales stay `en-US` / `pt-BR`. Native, Luxon, and date-fns already use those tags. Day.js and Moment want ids like `en` / `pt-br` — pass that map to the factory and import the matching locale files.
|
|
68
68
|
|
|
@@ -74,7 +74,7 @@ import "dayjs/locale/pt-br";
|
|
|
74
74
|
import timezone from "dayjs/plugin/timezone";
|
|
75
75
|
import utc from "dayjs/plugin/utc";
|
|
76
76
|
import { createBridgeUI } from "@bridge-ui/vue";
|
|
77
|
-
import { createDayjsDateAdapter } from "@bridge-ui/vue/
|
|
77
|
+
import { createDayjsDateAdapter } from "@bridge-ui/adapters/vue/date-dayjs";
|
|
78
78
|
|
|
79
79
|
dayjs.extend(utc);
|
|
80
80
|
dayjs.extend(timezone);
|
|
@@ -93,7 +93,7 @@ app.use(
|
|
|
93
93
|
|
|
94
94
|
```ts
|
|
95
95
|
import "moment-timezone";
|
|
96
|
-
import { createMomentDateAdapter } from "@bridge-ui/vue/
|
|
96
|
+
import { createMomentDateAdapter } from "@bridge-ui/adapters/vue/date-moment";
|
|
97
97
|
|
|
98
98
|
const dates = createMomentDateAdapter({
|
|
99
99
|
"en-US": "en",
|
|
@@ -103,11 +103,11 @@ const dates = createMomentDateAdapter({
|
|
|
103
103
|
|
|
104
104
|
### Rich-text adapter
|
|
105
105
|
|
|
106
|
-
Provide `global.richText` when using `RichTextEditor`. There is no native default — mounting without an adapter throws. Ready adapter: `@bridge-ui/vue/
|
|
106
|
+
Provide `global.richText` when using `RichTextEditor`. There is no native default — mounting without an adapter throws. Ready adapter: `@bridge-ui/adapters/vue/rich-text-tiptap`. Install `@bridge-ui/adapters` and the TipTap peers.
|
|
107
107
|
|
|
108
108
|
```ts
|
|
109
109
|
import { createBridgeUI } from "@bridge-ui/vue";
|
|
110
|
-
import { createTiptapRichTextAdapter } from "@bridge-ui/vue/
|
|
110
|
+
import { createTiptapRichTextAdapter } from "@bridge-ui/adapters/vue/rich-text-tiptap";
|
|
111
111
|
|
|
112
112
|
const richText = createTiptapRichTextAdapter();
|
|
113
113
|
|
|
@@ -118,6 +118,33 @@ app.use(
|
|
|
118
118
|
);
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
+
### Custom global values
|
|
122
|
+
|
|
123
|
+
Packages can add their own keys to `global` by augmenting `BridgeUIGlobal`. Nested providers and `setGlobal` merge every key by the same rule:
|
|
124
|
+
|
|
125
|
+
- Plain data (`breakpoints`, `formDefaults`, custom settings objects) is deep-merged.
|
|
126
|
+
- Functions, class instances, and objects with a function member (adapters) are replaced — the last defined value wins, and `undefined` keeps the previous one.
|
|
127
|
+
|
|
128
|
+
Only the top-level members of a value are checked. An object whose functions sit deeper (`{ hooks: { onSave } }`) is deep-merged.
|
|
129
|
+
|
|
130
|
+
```ts
|
|
131
|
+
import "@bridge-ui/core/Config";
|
|
132
|
+
|
|
133
|
+
declare module "@bridge-ui/core/Config" {
|
|
134
|
+
interface BridgeUIGlobal {
|
|
135
|
+
editor?: { format: (value: string) => string };
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
```ts
|
|
141
|
+
app.use(
|
|
142
|
+
createBridgeUI({
|
|
143
|
+
global: { editor: { format: (value) => value.trim() } },
|
|
144
|
+
}),
|
|
145
|
+
);
|
|
146
|
+
```
|
|
147
|
+
|
|
121
148
|
### Form density defaults
|
|
122
149
|
|
|
123
150
|
Set `global.formDefaults` to apply shared `size` / `rounded` to form controls (TextField, Select, Checkbox, FileUpload, Slider, OtpField, …). Does not affect Button, Progress, Modal, etc.
|
|
@@ -138,6 +165,25 @@ app.use(
|
|
|
138
165
|
);
|
|
139
166
|
```
|
|
140
167
|
|
|
168
|
+
### Default color
|
|
169
|
+
|
|
170
|
+
Set `global.defaultColor` to replace the library default `color` (`primary`, `dark`, or `secondary`) on every colorable component: Button, ButtonGroup, Badge, Alert, Avatar, Link, Tabs, ToggleGroup, Snackbar, Progress, Spinner, Stepper, Pagination, Accordion, Calendar, ActionFooter, form fields, and pickers. Divider and Tooltip keep their neutral defaults.
|
|
171
|
+
|
|
172
|
+
Use `"black"` for a monochrome UI. To rebrand `primary`, change the palette in CSS instead.
|
|
173
|
+
|
|
174
|
+
Merge order: instance props → `components.{Name}.defaultProps` → chrome → `formDefaults` → `defaultColor` → library defaults. Explicit props and `invalid` / error states are unaffected.
|
|
175
|
+
|
|
176
|
+
```ts
|
|
177
|
+
import { createBridgeUI } from "@bridge-ui/vue";
|
|
178
|
+
|
|
179
|
+
app.use(
|
|
180
|
+
createBridgeUI({
|
|
181
|
+
global: { defaultColor: "black" },
|
|
182
|
+
components: { Alert: { defaultProps: { color: "info" } } },
|
|
183
|
+
}),
|
|
184
|
+
);
|
|
185
|
+
```
|
|
186
|
+
|
|
141
187
|
### Shared chrome
|
|
142
188
|
|
|
143
189
|
`FormField`, `FormControl`, `BaseField`, and `TimePanel` are registry keys. Set them once to theme a family; a public entry still overrides `defaultProps`. Chrome tokens live on the shared key (`components.FormField.tokens`, `components.BaseField.tokens`). Dropdown tokens live on `components.Listbox`. Set `components.Listbox.defaultProps.matchWidth` so Select / Autocomplete menus match the field width. Cancel / Apply in pickers and listboxes live on `components.ActionFooter`.
|
|
@@ -205,9 +251,8 @@ app.use(
|
|
|
205
251
|
components: {
|
|
206
252
|
ActionFooter: {
|
|
207
253
|
defaultProps: {
|
|
208
|
-
|
|
209
|
-
cancelVariant: "
|
|
210
|
-
cancelColor: "secondary",
|
|
254
|
+
applyVariant: "solid",
|
|
255
|
+
cancelVariant: "outline",
|
|
211
256
|
},
|
|
212
257
|
},
|
|
213
258
|
},
|
|
@@ -215,6 +260,53 @@ app.use(
|
|
|
215
260
|
);
|
|
216
261
|
```
|
|
217
262
|
|
|
263
|
+
### Custom components
|
|
264
|
+
|
|
265
|
+
Components shipped outside Bridge can use the registry too. Augment `BridgeUIComponentsRegistry` so `components.{Name}` is typed, then read it with `useBridgeUIComponent` from `@bridge-ui/vue/Utils`.
|
|
266
|
+
|
|
267
|
+
Pass `chrome` to inherit a shared entry (`FormField`, `FormControl`, `BaseField`, `TimePanel`). Its `defaultProps` apply below the component's own entry, and form chrome (`FormField`, `FormControl`, `BaseField`) also applies `global.formDefaults`. `entry` and `chromeEntry` return the raw registry entries (`classes`, `tokens`).
|
|
268
|
+
|
|
269
|
+
```ts
|
|
270
|
+
import "@bridge-ui/core/Config";
|
|
271
|
+
|
|
272
|
+
declare module "@bridge-ui/core/Config" {
|
|
273
|
+
interface BridgeUIComponentsRegistry {
|
|
274
|
+
Editor: Partial<{
|
|
275
|
+
classes: { root?: string };
|
|
276
|
+
defaultProps: Partial<{ size: "sm" | "md" | "lg" }>;
|
|
277
|
+
}>;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
```ts
|
|
283
|
+
import { useBridgeUIComponent } from "@bridge-ui/vue/Utils";
|
|
284
|
+
|
|
285
|
+
type EditorProps = { size?: "sm" | "md" | "lg"; variant?: string };
|
|
286
|
+
|
|
287
|
+
export function useEditor(props: EditorProps) {
|
|
288
|
+
const { merged, entry, chromeEntry } = useBridgeUIComponent<EditorProps>({
|
|
289
|
+
chrome: "FormField",
|
|
290
|
+
props: () => props,
|
|
291
|
+
componentName: "Editor",
|
|
292
|
+
libDefaults: { size: "md" },
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
return { merged, entry, chromeEntry };
|
|
296
|
+
}
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
```ts
|
|
300
|
+
app.use(
|
|
301
|
+
createBridgeUI({
|
|
302
|
+
components: {
|
|
303
|
+
Editor: { defaultProps: { size: "sm" } },
|
|
304
|
+
FormField: { defaultProps: { variant: "filled" } },
|
|
305
|
+
},
|
|
306
|
+
}),
|
|
307
|
+
);
|
|
308
|
+
```
|
|
309
|
+
|
|
218
310
|
### Runtime updates
|
|
219
311
|
|
|
220
312
|
```ts
|
|
@@ -230,10 +322,10 @@ setGlobal({ mobileBreakpoint: "md" });
|
|
|
230
322
|
|
|
231
323
|
## Props
|
|
232
324
|
|
|
233
|
-
| Prop | Type | Default | Description
|
|
234
|
-
| ------------ | -------------------------- | ------- |
|
|
235
|
-
| `components` | `BridgeUIComponentsConfig` | — | Per-component defaults
|
|
236
|
-
| `global` | `Partial<BridgeUIGlobal>` | — | `theme`, `locale`, `direction`, `timeZone`, `mobileBreakpoint`, `breakpoints`, `icons`, `i18n`, `dates`, `formDefaults` |
|
|
325
|
+
| Prop | Type | Default | Description |
|
|
326
|
+
| ------------ | -------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
327
|
+
| `components` | `BridgeUIComponentsConfig` | — | Per-component defaults |
|
|
328
|
+
| `global` | `Partial<BridgeUIGlobal>` | — | `theme`, `locale`, `direction`, `timeZone`, `mobileBreakpoint`, `breakpoints`, `icons`, `i18n`, `dates`, `formDefaults`, `defaultColor` |
|
|
237
329
|
|
|
238
330
|
App content is passed via the **default slot** (see Usage above).
|
|
239
331
|
|
|
@@ -41,19 +41,20 @@ import { ColorPicker } from "@bridge-ui/vue/Components/ColorPicker";
|
|
|
41
41
|
|
|
42
42
|
## Props
|
|
43
43
|
|
|
44
|
-
| Prop | Type | Default
|
|
45
|
-
| -------------- | ------------------------ |
|
|
46
|
-
| `alpha` | `boolean` | —
|
|
47
|
-
| `classes` | `ColorPickerClasses` | —
|
|
48
|
-
| `
|
|
49
|
-
| `
|
|
50
|
-
| `
|
|
51
|
-
| `
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
44
|
+
| Prop | Type | Default | Description |
|
|
45
|
+
| -------------- | ------------------------ | ----------- | ------------------------------------------------------------------- |
|
|
46
|
+
| `alpha` | `boolean` | — | Shows the alpha slider. Unset: `true` for `hexa` / `rgba` / `hsla`. |
|
|
47
|
+
| `classes` | `ColorPickerClasses` | — | Classes for picker regions. |
|
|
48
|
+
| `color` | `ButtonColor` | `"primary"` | Color of the Cancel / Apply footer actions. |
|
|
49
|
+
| `customProps` | `ColorPickerCustomProps` | — | Extra props for internal parts. |
|
|
50
|
+
| `defaultValue` | `string \| null` | `null` | Uncontrolled initial value. |
|
|
51
|
+
| `disabled` | `boolean` | `false` | Disables the picker. |
|
|
52
|
+
| `fill` | `boolean` | `false` | Fills the container width. |
|
|
53
|
+
| `format` | `ColorFormat` | `"hex"` | Serialized output: `hex`, `hexa`, `rgb`, `rgba`, `hsl`, `hsla`. |
|
|
54
|
+
| `readOnly` | `boolean` | `false` | Prevents selection. |
|
|
55
|
+
| `rounded` | `ColorPickerRounded` | `"md"` | Border radius of the picker shell and swatches. |
|
|
56
|
+
| `showFooter` | `boolean` | `false` | Shows Cancel / Apply. Selection is draft until Apply. |
|
|
57
|
+
| `swatches` | `string[]` | — | Preset colors shown below the sliders. |
|
|
57
58
|
|
|
58
59
|
### v-model
|
|
59
60
|
|
package/docs/components/I18n.md
CHANGED
|
@@ -54,7 +54,7 @@ active locale used by `t`.
|
|
|
54
54
|
|
|
55
55
|
```ts
|
|
56
56
|
import { createBridgeUI } from "@bridge-ui/vue";
|
|
57
|
-
import { createDictionaryI18nAdapter } from "@bridge-ui/vue/
|
|
57
|
+
import { createDictionaryI18nAdapter } from "@bridge-ui/adapters/vue/i18n-dictionary";
|
|
58
58
|
|
|
59
59
|
const i18n = createDictionaryI18nAdapter();
|
|
60
60
|
|
|
@@ -104,7 +104,7 @@ const i18n: I18nAdapter = {
|
|
|
104
104
|
|
|
105
105
|
```ts
|
|
106
106
|
import { createI18n } from "vue-i18n";
|
|
107
|
-
import { createVueI18nAdapter } from "@bridge-ui/vue/
|
|
107
|
+
import { createVueI18nAdapter } from "@bridge-ui/adapters/vue/i18n-vue-i18n";
|
|
108
108
|
|
|
109
109
|
const vueI18n = createI18n({ legacy: false, locale: "en-US", messages: {} });
|
|
110
110
|
const i18n = createVueI18nAdapter(vueI18n.global);
|
|
@@ -118,10 +118,10 @@ setLocale("pt-BR"); // Bridge locale + i18n.locale via adapter.setLocale
|
|
|
118
118
|
|
|
119
119
|
Other ready adapters:
|
|
120
120
|
|
|
121
|
-
| Import
|
|
122
|
-
|
|
|
123
|
-
| `@bridge-ui/vue/
|
|
124
|
-
| `@bridge-ui/vue/
|
|
121
|
+
| Import | Library | Replace / plural |
|
|
122
|
+
| ----------------------------------------- | -------------------------- | ---------------- |
|
|
123
|
+
| `@bridge-ui/adapters/vue/i18n-dictionary` | In-memory dictionary | Yes (`\|` forms) |
|
|
124
|
+
| `@bridge-ui/adapters/vue/i18n-vue-i18n` | vue-i18n (`vue-i18n` peer) | Yes (via lib) |
|
|
125
125
|
|
|
126
126
|
## Chrome strings
|
|
127
127
|
|
package/docs/components/Icon.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Renders an icon from a semantic name (via the icon adapter) or a concrete icon component, with design-system sizing.
|
|
4
4
|
|
|
5
|
-
Semantic names require an icon adapter on `BridgeUIProvider` / `createBridgeUI` (`global.icons`). Import a ready adapter from `@bridge-ui/vue/
|
|
5
|
+
Semantic names require an icon adapter on `BridgeUIProvider` / `createBridgeUI` (`global.icons`). Import a ready adapter from `@bridge-ui/adapters/vue/icon-*` and install the matching icon library.
|
|
6
6
|
|
|
7
7
|
## Import
|
|
8
8
|
|
|
@@ -26,7 +26,7 @@ import { Info } from "@lucide/vue";
|
|
|
26
26
|
|
|
27
27
|
```ts
|
|
28
28
|
import { createBridgeUI } from "@bridge-ui/vue";
|
|
29
|
-
import { createLucideIconAdapter } from "@bridge-ui/vue/
|
|
29
|
+
import { createLucideIconAdapter } from "@bridge-ui/adapters/vue/icon-lucide";
|
|
30
30
|
|
|
31
31
|
const icons = createLucideIconAdapter();
|
|
32
32
|
|
|
@@ -43,13 +43,13 @@ app.use(
|
|
|
43
43
|
|
|
44
44
|
Other ready adapters (same `create*IconAdapter()` shape):
|
|
45
45
|
|
|
46
|
-
| Import
|
|
47
|
-
|
|
|
48
|
-
| `@bridge-ui/vue/
|
|
49
|
-
| `@bridge-ui/vue/
|
|
50
|
-
| `@bridge-ui/vue/
|
|
51
|
-
| `@bridge-ui/vue/
|
|
52
|
-
| `@bridge-ui/vue/
|
|
46
|
+
| Import | Library | Peer |
|
|
47
|
+
| ------------------------------------------ | --------------------------- | ------------------------------ |
|
|
48
|
+
| `@bridge-ui/adapters/vue/icon-lucide` | Lucide | `@lucide/vue` |
|
|
49
|
+
| `@bridge-ui/adapters/vue/icon-heroicons` | Heroicons (24 outline) | `@heroicons/vue` |
|
|
50
|
+
| `@bridge-ui/adapters/vue/icon-tabler` | Tabler Icons | `@tabler/icons-vue` |
|
|
51
|
+
| `@bridge-ui/adapters/vue/icon-phosphor` | Phosphor Icons | `@phosphor-icons/vue` |
|
|
52
|
+
| `@bridge-ui/adapters/vue/icon-fontawesome` | Font Awesome 6 (free solid) | `@fortawesome/vue-fontawesome` |
|
|
53
53
|
|
|
54
54
|
### Font Awesome definitions
|
|
55
55
|
|
|
@@ -58,7 +58,7 @@ With the Font Awesome adapter, pass definitions directly — `normalize` wraps t
|
|
|
58
58
|
```ts
|
|
59
59
|
import { createBridgeUI } from "@bridge-ui/vue";
|
|
60
60
|
import { faCoffee } from "@fortawesome/free-solid-svg-icons";
|
|
61
|
-
import { createFontAwesomeIconAdapter } from "@bridge-ui/vue/
|
|
61
|
+
import { createFontAwesomeIconAdapter } from "@bridge-ui/adapters/vue/icon-fontawesome";
|
|
62
62
|
|
|
63
63
|
const icons = createFontAwesomeIconAdapter();
|
|
64
64
|
|
|
@@ -16,7 +16,7 @@ Provide `global.richText` on `BridgeUIProvider`. Ready adapter:
|
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
18
|
import { BridgeUIProvider } from "@bridge-ui/vue";
|
|
19
|
-
import { createTiptapRichTextAdapter } from "@bridge-ui/vue/
|
|
19
|
+
import { createTiptapRichTextAdapter } from "@bridge-ui/adapters/vue/rich-text-tiptap";
|
|
20
20
|
|
|
21
21
|
const richText = createTiptapRichTextAdapter();
|
|
22
22
|
```
|
|
@@ -27,9 +27,9 @@ const richText = createTiptapRichTextAdapter();
|
|
|
27
27
|
</BridgeUIProvider>
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
| Adapter
|
|
31
|
-
|
|
|
32
|
-
|
|
|
30
|
+
| Adapter | Peer(s) | Notes |
|
|
31
|
+
| ------------------------------------------ | ------------------------------------------------------------------------------------ | ---------------- |
|
|
32
|
+
| `@bridge-ui/adapters/vue/rich-text-tiptap` | `@tiptap/core`, `@tiptap/pm`, `@tiptap/starter-kit`, `@tiptap/extension-placeholder` | ProseMirror JSON |
|
|
33
33
|
|
|
34
34
|
Custom engines can implement `RichTextEditorAdapter` and pass them via `global.richText`.
|
|
35
35
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.15.0",
|
|
5
5
|
"author": "BridgeUI",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"name": "@bridge-ui/vue",
|
|
@@ -58,10 +58,6 @@
|
|
|
58
58
|
"import": "./dist/Adapters/RichText/index.js",
|
|
59
59
|
"types": "./dist/Adapters/RichText/index.d.ts"
|
|
60
60
|
},
|
|
61
|
-
"./Adapters/Examples/*": {
|
|
62
|
-
"import": "./dist/Adapters/Examples/*.js",
|
|
63
|
-
"types": "./dist/Adapters/Examples/*.d.ts"
|
|
64
|
-
},
|
|
65
61
|
"./Actions": {
|
|
66
62
|
"import": "./dist/Actions/index.js",
|
|
67
63
|
"types": "./dist/Actions/index.d.ts"
|
|
@@ -88,84 +84,16 @@
|
|
|
88
84
|
"docs"
|
|
89
85
|
],
|
|
90
86
|
"peerDependencies": {
|
|
91
|
-
"@fortawesome/fontawesome-svg-core": "^7.0.0",
|
|
92
|
-
"@fortawesome/free-solid-svg-icons": "^7.0.0",
|
|
93
|
-
"@fortawesome/vue-fontawesome": "^3.0.0",
|
|
94
|
-
"@heroicons/vue": "^2.2.0",
|
|
95
|
-
"@lucide/vue": "^0.400.0 || ^1.0.0",
|
|
96
|
-
"@phosphor-icons/vue": "^2.2.0",
|
|
97
|
-
"@tabler/icons-vue": "^3.0.0",
|
|
98
87
|
"@tanstack/vue-table": "^9.2.0",
|
|
99
|
-
"
|
|
100
|
-
"@tiptap/extension-placeholder": "^3.0.0",
|
|
101
|
-
"@tiptap/pm": "^3.0.0",
|
|
102
|
-
"@tiptap/starter-kit": "^3.0.0",
|
|
103
|
-
"date-fns": "^4.0.0",
|
|
104
|
-
"dayjs": "^1.11.0",
|
|
105
|
-
"luxon": "^3.0.0",
|
|
106
|
-
"moment": "^2.30.0",
|
|
107
|
-
"moment-timezone": "^0.5.0 || ^0.6.0",
|
|
108
|
-
"vue": "^3.4.0",
|
|
109
|
-
"vue-i18n": "^11.0.0"
|
|
88
|
+
"vue": "^3.4.0"
|
|
110
89
|
},
|
|
111
90
|
"peerDependenciesMeta": {
|
|
112
|
-
"@fortawesome/fontawesome-svg-core": {
|
|
113
|
-
"optional": true
|
|
114
|
-
},
|
|
115
|
-
"@fortawesome/free-solid-svg-icons": {
|
|
116
|
-
"optional": true
|
|
117
|
-
},
|
|
118
|
-
"@fortawesome/vue-fontawesome": {
|
|
119
|
-
"optional": true
|
|
120
|
-
},
|
|
121
|
-
"@heroicons/vue": {
|
|
122
|
-
"optional": true
|
|
123
|
-
},
|
|
124
|
-
"@lucide/vue": {
|
|
125
|
-
"optional": true
|
|
126
|
-
},
|
|
127
|
-
"@phosphor-icons/vue": {
|
|
128
|
-
"optional": true
|
|
129
|
-
},
|
|
130
|
-
"@tabler/icons-vue": {
|
|
131
|
-
"optional": true
|
|
132
|
-
},
|
|
133
91
|
"@tanstack/vue-table": {
|
|
134
92
|
"optional": true
|
|
135
|
-
},
|
|
136
|
-
"@tiptap/core": {
|
|
137
|
-
"optional": true
|
|
138
|
-
},
|
|
139
|
-
"@tiptap/pm": {
|
|
140
|
-
"optional": true
|
|
141
|
-
},
|
|
142
|
-
"@tiptap/starter-kit": {
|
|
143
|
-
"optional": true
|
|
144
|
-
},
|
|
145
|
-
"@tiptap/extension-placeholder": {
|
|
146
|
-
"optional": true
|
|
147
|
-
},
|
|
148
|
-
"date-fns": {
|
|
149
|
-
"optional": true
|
|
150
|
-
},
|
|
151
|
-
"dayjs": {
|
|
152
|
-
"optional": true
|
|
153
|
-
},
|
|
154
|
-
"luxon": {
|
|
155
|
-
"optional": true
|
|
156
|
-
},
|
|
157
|
-
"moment": {
|
|
158
|
-
"optional": true
|
|
159
|
-
},
|
|
160
|
-
"moment-timezone": {
|
|
161
|
-
"optional": true
|
|
162
|
-
},
|
|
163
|
-
"vue-i18n": {
|
|
164
|
-
"optional": true
|
|
165
93
|
}
|
|
166
94
|
},
|
|
167
95
|
"dependencies": {
|
|
168
|
-
"@bridge-ui/core": "^0.
|
|
96
|
+
"@bridge-ui/core": "^0.15.0",
|
|
169
97
|
"@tailwindcss/typography": "^0.5.20",
|
|
170
98
|
"clsx": "^2.1.1",
|
|
171
99
|
"es-toolkit": "^1.52.0",
|
|
@@ -181,34 +109,17 @@
|
|
|
181
109
|
"test:cy:open": "cypress open --component"
|
|
182
110
|
},
|
|
183
111
|
"devDependencies": {
|
|
184
|
-
"@fortawesome/fontawesome-svg-core": "^7.3.1",
|
|
185
|
-
"@fortawesome/free-solid-svg-icons": "^7.3.1",
|
|
186
|
-
"@fortawesome/vue-fontawesome": "^3.3.3",
|
|
187
|
-
"@heroicons/vue": "^2.2.0",
|
|
188
112
|
"@inertiajs/vue3": "^3.7.1",
|
|
189
113
|
"@lucide/vue": "^1.48.0",
|
|
190
|
-
"@phosphor-icons/vue": "^2.2.1",
|
|
191
|
-
"@tabler/icons-vue": "^3.48.0",
|
|
192
114
|
"@tailwindcss/cli": "^4.3.3",
|
|
193
115
|
"@tailwindcss/vite": "^4.3.3",
|
|
194
116
|
"@tanstack/vue-table": "^9.2.4",
|
|
195
|
-
"@tiptap/core": "^3.31.3",
|
|
196
|
-
"@tiptap/extension-placeholder": "^3.31.3",
|
|
197
|
-
"@tiptap/pm": "^3.31.3",
|
|
198
|
-
"@tiptap/starter-kit": "^3.31.3",
|
|
199
|
-
"@types/luxon": "^3.7.5",
|
|
200
117
|
"@types/node": "^26.6.2",
|
|
201
118
|
"@vue/language-core": "^3.3.11",
|
|
202
119
|
"@vue/test-utils": "^2.5.1",
|
|
203
|
-
"date-fns": "^4.4.0",
|
|
204
|
-
"dayjs": "^1.11.23",
|
|
205
|
-
"luxon": "^3.7.2",
|
|
206
|
-
"moment": "^2.31.0",
|
|
207
|
-
"moment-timezone": "^0.6.4",
|
|
208
120
|
"tailwindcss": "^4.3.3",
|
|
209
121
|
"typescript": "^6.0.3",
|
|
210
122
|
"vue": "^3.5.43",
|
|
211
|
-
"vue-i18n": "^11.4.12",
|
|
212
123
|
"vue-tsc": "^3.3.11"
|
|
213
124
|
}
|
|
214
125
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { DateAdapter } from '@bridge-ui/core/Adapters';
|
|
2
|
-
/**
|
|
3
|
-
* Builds a date-fns-backed {@link DateAdapter} (`TDate = Date`) for Bridge calendars.
|
|
4
|
-
* Locale stays unset until {@link DateAdapter.setLocale}.
|
|
5
|
-
*
|
|
6
|
-
* `timeZone` arguments are ignored. Formatting uses the same local calendar as
|
|
7
|
-
* `getDate` / `getHours`.
|
|
8
|
-
*/
|
|
9
|
-
export declare function createDateFnsDateAdapter(): DateAdapter<Date>;
|