@bridge-ui/vue 0.13.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-forms/SKILL.md +3 -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.d.ts +2 -2
- package/dist/Components/BaseField/composables/useBaseField.js +1 -0
- package/dist/Components/Calendar/Calendar.vue.d.ts +14 -6
- package/dist/Components/Calendar/Calendar.vue_vue_type_script_setup_true_lang.js +78 -74
- package/dist/Components/Calendar/calendar.types.d.ts +12 -7
- package/dist/Components/Calendar/composables/useCalendar.d.ts +5 -9
- package/dist/Components/Calendar/composables/useCalendar.js +144 -143
- package/dist/Components/CalendarDate/CalendarDate.vue.d.ts +14 -6
- package/dist/Components/CalendarDate/CalendarDate.vue_vue_type_script_setup_true_lang.js +20 -16
- package/dist/Components/CalendarDate/calendarDate.types.d.ts +13 -8
- package/dist/Components/CalendarDate/composables/useCalendarDate.d.ts +4 -8
- package/dist/Components/CalendarDate/composables/useCalendarDate.js +105 -105
- package/dist/Components/CalendarMonth/CalendarMonth.vue.d.ts +9 -2
- package/dist/Components/CalendarMonth/CalendarMonth.vue_vue_type_script_setup_true_lang.js +19 -12
- package/dist/Components/CalendarMonth/calendarMonth.types.d.ts +14 -8
- package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +4 -7
- package/dist/Components/CalendarMonth/composables/useCalendarMonth.js +92 -89
- package/dist/Components/CalendarRange/CalendarRange.vue.d.ts +14 -6
- package/dist/Components/CalendarRange/CalendarRange.vue_vue_type_script_setup_true_lang.js +109 -105
- package/dist/Components/CalendarRange/calendarRange.types.d.ts +12 -7
- package/dist/Components/CalendarRange/composables/useCalendarRange.d.ts +5 -9
- package/dist/Components/CalendarRange/composables/useCalendarRange.js +181 -154
- package/dist/Components/CalendarYear/CalendarYear.vue.d.ts +9 -2
- package/dist/Components/CalendarYear/CalendarYear.vue_vue_type_script_setup_true_lang.js +20 -13
- package/dist/Components/CalendarYear/calendarYear.types.d.ts +12 -6
- package/dist/Components/CalendarYear/composables/useCalendarYear.d.ts +4 -7
- package/dist/Components/CalendarYear/composables/useCalendarYear.js +91 -88
- package/dist/Components/Carousel/composables/useCarousel.js +117 -117
- 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 +4 -2
- 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.d.ts +9 -2
- package/dist/Components/ColorPicker/ColorPicker.vue_vue_type_script_setup_true_lang.js +53 -45
- package/dist/Components/ColorPicker/colorPicker.types.d.ts +20 -9
- package/dist/Components/ColorPicker/composables/useColorPicker.d.ts +4 -4
- package/dist/Components/ColorPicker/composables/useColorPicker.js +151 -150
- package/dist/Components/DateField/DateField.vue.d.ts +2 -2
- package/dist/Components/DateField/DateField.vue_vue_type_script_setup_true_lang.js +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.d.ts +12 -4
- package/dist/Components/DatePicker/DatePicker.vue_vue_type_script_setup_true_lang.js +57 -51
- package/dist/Components/DatePicker/composables/useDatePicker.d.ts +3 -3
- package/dist/Components/DatePicker/composables/useDatePicker.js +52 -25
- package/dist/Components/DatePicker/datePicker.types.d.ts +12 -7
- package/dist/Components/DateRangeField/DateRangeField.vue.d.ts +2 -2
- package/dist/Components/DateRangeField/DateRangeField.vue_vue_type_script_setup_true_lang.js +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.d.ts +12 -4
- package/dist/Components/DateRangePicker/DateRangePicker.vue_vue_type_script_setup_true_lang.js +56 -50
- package/dist/Components/DateRangePicker/composables/useDateRangePicker.d.ts +3 -3
- package/dist/Components/DateRangePicker/composables/useDateRangePicker.js +26 -26
- package/dist/Components/DateRangePicker/dateRangePicker.types.d.ts +12 -7
- package/dist/Components/DateTimeField/DateTimeField.vue.d.ts +2 -2
- package/dist/Components/DateTimeField/DateTimeField.vue_vue_type_script_setup_true_lang.js +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.d.ts +9 -2
- package/dist/Components/DateTimePicker/DateTimePicker.vue_vue_type_script_setup_true_lang.js +84 -78
- package/dist/Components/DateTimePicker/composables/useDateTimePicker.d.ts +3 -3
- package/dist/Components/DateTimePicker/composables/useDateTimePicker.js +64 -63
- package/dist/Components/DateTimePicker/dateTimePicker.types.d.ts +12 -7
- package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue.d.ts +2 -2
- package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue_vue_type_script_setup_true_lang.js +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.d.ts +12 -4
- package/dist/Components/DateTimeRangePicker/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +112 -106
- package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.d.ts +3 -3
- package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.js +71 -70
- package/dist/Components/DateTimeRangePicker/dateTimeRangePicker.types.d.ts +12 -7
- 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/FileUpload/FileUpload.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/FileUpload/fileUpload.types.d.ts +1 -1
- 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/Rating.js +5 -0
- package/dist/Components/Rating/Rating.vue.d.ts +20 -0
- package/dist/Components/Rating/Rating.vue_vue_type_script_setup_true_lang.js +62 -0
- package/dist/Components/Rating/composables/useRating.d.ts +112 -0
- package/dist/Components/Rating/composables/useRating.js +191 -0
- package/dist/Components/Rating/index.d.ts +4 -0
- package/dist/Components/Rating/index.js +3 -0
- package/dist/Components/Rating/rating.types.d.ts +107 -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/Sidebar/composables/useSidebar.js +1 -1
- package/dist/Components/Slider/composables/useSlider.d.ts +1 -1
- 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/TimeField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/TimeField/composables/useTimeField.d.ts +2 -2
- package/dist/Components/TimeField/composables/useTimeField.js +2 -0
- package/dist/Components/TimePanel/TimePanel.vue.d.ts +10 -2
- package/dist/Components/TimePanel/TimePanel.vue_vue_type_script_setup_true_lang.js +37 -34
- package/dist/Components/TimePanel/composables/useTimePanel.d.ts +5 -5
- package/dist/Components/TimePanel/composables/useTimePanel.js +108 -109
- package/dist/Components/TimePanel/timePanel.types.d.ts +10 -4
- package/dist/Components/TimePicker/TimePicker.vue.d.ts +10 -2
- package/dist/Components/TimePicker/TimePicker.vue_vue_type_script_setup_true_lang.js +48 -42
- package/dist/Components/TimePicker/composables/useTimePicker.d.ts +3 -3
- package/dist/Components/TimePicker/composables/useTimePicker.js +37 -36
- package/dist/Components/TimePicker/timePicker.types.d.ts +12 -7
- package/dist/Components/TimeRangeField/TimeRangeField.vue.d.ts +2 -2
- package/dist/Components/TimeRangeField/TimeRangeField.vue_vue_type_script_setup_true_lang.js +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.d.ts +12 -4
- package/dist/Components/TimeRangePicker/TimeRangePicker.vue_vue_type_script_setup_true_lang.js +74 -68
- package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.d.ts +4 -4
- package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.js +88 -87
- package/dist/Components/TimeRangePicker/timeRangePicker.types.d.ts +12 -7
- 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/index.d.ts +2 -0
- package/dist/index.js +69 -67
- package/dist/theme.css +10 -1
- package/docs/README.md +28 -13
- package/docs/components/ActionFooter.md +16 -14
- package/docs/components/BaseField.md +3 -3
- package/docs/components/BridgeUIProvider.md +108 -16
- package/docs/components/Calendar.md +0 -1
- package/docs/components/CalendarDate.md +0 -1
- package/docs/components/CalendarMonth.md +0 -1
- package/docs/components/CalendarRange.md +0 -1
- package/docs/components/CalendarYear.md +0 -1
- package/docs/components/ColorPicker.md +27 -27
- package/docs/components/DatePicker.md +0 -1
- package/docs/components/DateRangePicker.md +0 -1
- package/docs/components/DateTimePicker.md +0 -1
- package/docs/components/DateTimeRangePicker.md +0 -1
- package/docs/components/I18n.md +6 -6
- package/docs/components/Icon.md +10 -10
- package/docs/components/Rating.md +86 -0
- package/docs/components/RichTextEditor.md +4 -4
- package/docs/components/TimePanel.md +0 -1
- package/docs/components/TimePicker.md +0 -1
- package/docs/components/TimeRangePicker.md +0 -1
- package/package.json +3 -102
- 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 -81
- package/dist/Adapters/Examples/icon-heroicons.d.ts +0 -5
- package/dist/Adapters/Examples/icon-heroicons.js +0 -55
- package/dist/Adapters/Examples/icon-lucide.d.ts +0 -5
- package/dist/Adapters/Examples/icon-lucide.js +0 -55
- package/dist/Adapters/Examples/icon-phosphor.d.ts +0 -5
- package/dist/Adapters/Examples/icon-phosphor.js +0 -55
- package/dist/Adapters/Examples/icon-tabler.d.ts +0 -5
- package/dist/Adapters/Examples/icon-tabler.js +0 -55
- package/dist/Adapters/Examples/rich-text-tiptap.d.ts +0 -5
- package/dist/Adapters/Examples/rich-text-tiptap.js +0 -138
|
@@ -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
|
|
|
@@ -75,7 +75,6 @@ import { Calendar } from "@bridge-ui/vue/Components/Calendar";
|
|
|
75
75
|
| `slots` | `CalendarDateSlots` | — | Named slots forwarded to `CalendarDate` (`day`). |
|
|
76
76
|
| `startOfWeek` | `StartOfWeek` | `0` | First day of the week (`0` = Sunday). |
|
|
77
77
|
| `timeZone` | `string` | — | IANA time zone. |
|
|
78
|
-
| `value` | `DatePickerModel` | — | Controlled selection model. |
|
|
79
78
|
| `view` | `CalendarView` | — | Controlled panel view. Pair with `view-change`. |
|
|
80
79
|
| `viewDate` | `Date` | — | Controlled displayed month. Pair with `view-date-change`. |
|
|
81
80
|
|
|
@@ -48,7 +48,6 @@ import { CalendarDate } from "@bridge-ui/vue/Components/CalendarDate";
|
|
|
48
48
|
| `slots` | `{ day?: … }` | — | Named slots (`day`). |
|
|
49
49
|
| `startOfWeek` | `StartOfWeek` | `0` | First day of the week. |
|
|
50
50
|
| `timeZone` | `string` | — | IANA time zone. |
|
|
51
|
-
| `value` | `DatePickerModel` | — | Controlled selection model. |
|
|
52
51
|
| `viewDate` | `Date` | — | Month currently displayed in the grid. |
|
|
53
52
|
|
|
54
53
|
### v-model
|
|
@@ -37,7 +37,6 @@ import { CalendarMonth } from "@bridge-ui/vue/Components/CalendarMonth";
|
|
|
37
37
|
| `rounded` | `CalendarRounded` | `"md"` | Border radius of month tiles. |
|
|
38
38
|
| `selection` | `DatePickerModel` | — | Date model used to highlight tiles on the commit panel. |
|
|
39
39
|
| `timeZone` | `string` | — | IANA time zone. |
|
|
40
|
-
| `value` | `number` | — | Selected month (`0`–`11`). |
|
|
41
40
|
| `year` | `number` | current year | Year context for min/max month disabling. |
|
|
42
41
|
|
|
43
42
|
### v-model
|
|
@@ -66,7 +66,6 @@ import { CalendarRange } from "@bridge-ui/vue/Components/CalendarRange";
|
|
|
66
66
|
| `slots` | `CalendarRangeSlots` | — | Named slots (`day`, optional `startAside` / `endAside`). |
|
|
67
67
|
| `startOfWeek` | `StartOfWeek` | `0` | First day of the week. |
|
|
68
68
|
| `timeZone` | `string` | — | IANA time zone. |
|
|
69
|
-
| `value` | `DateRangeValue \| null` | — | Controlled range value (`[start, end]`). |
|
|
70
69
|
| `viewDate` | `Date` | — | Controlled start (left) displayed month. |
|
|
71
70
|
|
|
72
71
|
### v-model
|
|
@@ -38,7 +38,6 @@ import { CalendarYear } from "@bridge-ui/vue/Components/CalendarYear";
|
|
|
38
38
|
| `selection` | `DatePickerModel` | — | Date model used to highlight tiles on the commit panel. |
|
|
39
39
|
| `startYear` | `number` | — | First year of the visible page. |
|
|
40
40
|
| `timeZone` | `string` | — | IANA time zone. |
|
|
41
|
-
| `value` | `number` | — | Selected year. |
|
|
42
41
|
|
|
43
42
|
### v-model
|
|
44
43
|
|
|
@@ -15,23 +15,16 @@ import { ColorPicker } from "@bridge-ui/vue/Components/ColorPicker";
|
|
|
15
15
|
```vue
|
|
16
16
|
<ColorPicker />
|
|
17
17
|
|
|
18
|
-
<ColorPicker
|
|
18
|
+
<ColorPicker v-model="color" />
|
|
19
19
|
|
|
20
|
-
<ColorPicker
|
|
21
|
-
alpha
|
|
22
|
-
show-footer
|
|
23
|
-
format="rgba"
|
|
24
|
-
:value="color"
|
|
25
|
-
v-on:change="color = $event"
|
|
26
|
-
/>
|
|
20
|
+
<ColorPicker alpha show-footer format="rgba" v-model="color" />
|
|
27
21
|
```
|
|
28
22
|
|
|
29
23
|
### Preset swatches
|
|
30
24
|
|
|
31
25
|
```vue
|
|
32
26
|
<ColorPicker
|
|
33
|
-
|
|
34
|
-
v-on:change="color = $event"
|
|
27
|
+
v-model="color"
|
|
35
28
|
:swatches="['#0f766e', '#2563eb', '#dc2626', '#000000']"
|
|
36
29
|
/>
|
|
37
30
|
```
|
|
@@ -39,29 +32,36 @@ import { ColorPicker } from "@bridge-ui/vue/Components/ColorPicker";
|
|
|
39
32
|
### Output format
|
|
40
33
|
|
|
41
34
|
```vue
|
|
42
|
-
<ColorPicker format="hex"
|
|
35
|
+
<ColorPicker format="hex" v-model="color" />
|
|
43
36
|
|
|
44
|
-
<ColorPicker format="rgb"
|
|
37
|
+
<ColorPicker format="rgb" v-model="color" />
|
|
45
38
|
|
|
46
|
-
<ColorPicker format="rgba"
|
|
39
|
+
<ColorPicker format="rgba" v-model="color" />
|
|
47
40
|
```
|
|
48
41
|
|
|
49
42
|
## Props
|
|
50
43
|
|
|
51
|
-
| Prop | Type | Default
|
|
52
|
-
| -------------- | ------------------------ |
|
|
53
|
-
| `alpha` | `boolean` | —
|
|
54
|
-
| `classes` | `ColorPickerClasses` | —
|
|
55
|
-
| `
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
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. |
|
|
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. |
|
|
65
65
|
|
|
66
66
|
Picker tokens live on `components.ColorPicker` (`rounded`, `size`).
|
|
67
67
|
|
|
@@ -76,7 +76,6 @@ Call `apply()` to commit and close the overlay, or `cancel()` to discard and clo
|
|
|
76
76
|
| `slots` | `DatePickerSlots` | — | Named slots (`day` on the calendar, `footer` for Cancel / Apply). |
|
|
77
77
|
| `startOfWeek` | `StartOfWeek` | `0` | First day of the week. |
|
|
78
78
|
| `timeZone` | `string` | — | IANA time zone. |
|
|
79
|
-
| `value` | `DatePickerModel` | — | Controlled value. |
|
|
80
79
|
|
|
81
80
|
### v-model
|
|
82
81
|
|
|
@@ -55,7 +55,6 @@ import { DateRangePicker } from "@bridge-ui/vue/Components/DateRangePicker";
|
|
|
55
55
|
| `slots` | `DateRangePickerSlots` | — | Named slots (`day` on the calendars, `footer` for Cancel / Apply). |
|
|
56
56
|
| `startOfWeek` | `StartOfWeek` | `0` | First day of the week. |
|
|
57
57
|
| `timeZone` | `string` | — | IANA time zone. |
|
|
58
|
-
| `value` | `DateRangeValue \| null` | — | Controlled value (`[start, end]`). |
|
|
59
58
|
|
|
60
59
|
### v-model
|
|
61
60
|
|
|
@@ -54,7 +54,6 @@ import { DateTimePicker } from "@bridge-ui/vue/Components/DateTimePicker";
|
|
|
54
54
|
| `slots` | `DateTimePickerSlots` | — | Named slots (`day` on the calendar, `footer` for Cancel / Apply). |
|
|
55
55
|
| `startOfWeek` | `StartOfWeek` | `0` | First day of the week. |
|
|
56
56
|
| `timeZone` | `string` | — | IANA time zone. |
|
|
57
|
-
| `value` | `Date \| null` | — | Controlled date-time value. |
|
|
58
57
|
|
|
59
58
|
### v-model
|
|
60
59
|
|
|
@@ -54,7 +54,6 @@ import { DateTimeRangePicker } from "@bridge-ui/vue/Components/DateTimeRangePick
|
|
|
54
54
|
| `slots` | `DateTimeRangePickerSlots` | — | Named slots (`day` on the calendars, `footer` for Cancel / Apply). |
|
|
55
55
|
| `startOfWeek` | `StartOfWeek` | `0` | First day of the week. |
|
|
56
56
|
| `timeZone` | `string` | — | IANA time zone. |
|
|
57
|
-
| `value` | `DateRangeValue \| null` | — | Controlled value (`[start, end]` date-times). |
|
|
58
57
|
|
|
59
58
|
### v-model
|
|
60
59
|
|
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
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Rating
|
|
2
|
+
|
|
3
|
+
Star rating field. Extends BaseField props. The value is a number from above 0 through `max`, or `null` when empty. A fraction fills the next item by that amount: `1.5` fills the first item and half of the second. `step` sets how fine a click or arrow key can be. Choosing the current value again clears it.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Rating } from "@bridge-ui/vue/Components/Rating";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
```vue
|
|
16
|
+
<Rating label="Quality" />
|
|
17
|
+
|
|
18
|
+
<Rating name="score" v-model="score" label="Quality" />
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Read-only and scale
|
|
22
|
+
|
|
23
|
+
```vue
|
|
24
|
+
<Rating readonly :max="5" label="Quality" :model-value="4" />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Fractional value
|
|
28
|
+
|
|
29
|
+
```vue
|
|
30
|
+
<Rating readonly label="Quality" :model-value="1.5" />
|
|
31
|
+
|
|
32
|
+
<Rating :step="0.5" label="Quality" />
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Required and error
|
|
36
|
+
|
|
37
|
+
```vue
|
|
38
|
+
<Rating required label="Quality" />
|
|
39
|
+
|
|
40
|
+
<Rating error label="Quality" error-message="Choose a score." />
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### customProps
|
|
44
|
+
|
|
45
|
+
```vue
|
|
46
|
+
<Rating
|
|
47
|
+
label="Quality"
|
|
48
|
+
:custom-props="{
|
|
49
|
+
input: { id: 'score' },
|
|
50
|
+
item: { 'data-testid': 'rating-item' },
|
|
51
|
+
}"
|
|
52
|
+
/>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Props
|
|
56
|
+
|
|
57
|
+
### Rating-specific
|
|
58
|
+
|
|
59
|
+
| Prop | Type | Default | Description |
|
|
60
|
+
| ------------- | ------------------- | --------- | ---------------------------------------------------------------------- |
|
|
61
|
+
| `classes` | `RatingClasses` | — | Classes for the field chrome and the rating parts. |
|
|
62
|
+
| `color` | `RatingColor` | "primary" | The color applied to selected icons. |
|
|
63
|
+
| `customProps` | `RatingCustomProps` | — | Extra props for internal parts. |
|
|
64
|
+
| `icon` | `IconSource` | "star" | Icon used for every item. |
|
|
65
|
+
| `max` | `number` | `5` | Number of items. The value runs from above 0 through `max`. |
|
|
66
|
+
| `name` | `string` | — | The `name` of the hidden input submitted with the form. |
|
|
67
|
+
| `size` | `RatingSize` | "md" | Size of the icons and of the field label (`2xs` … `2xl`). |
|
|
68
|
+
| `slots` | `RatingSlots` | — | Chrome slots. |
|
|
69
|
+
| `step` | `number` | `1` | Increment for pointer and keyboard selection. `0.5` selects each half. |
|
|
70
|
+
|
|
71
|
+
### Binding
|
|
72
|
+
|
|
73
|
+
| Prop | Type | Default | Description |
|
|
74
|
+
| -------------- | ---------------- | ------- | -------------------------------------------------------------------------------------------------------------- |
|
|
75
|
+
| `defaultValue` | `number \| null` | — | Initial value for uncontrolled usage. |
|
|
76
|
+
| `modelValue` | `number \| null` | — | Selected value. `null` clears the rating. A fraction fills the next item partway (`1.5` fills item 2 halfway). |
|
|
77
|
+
|
|
78
|
+
Hover previews the value under the pointer. Arrow keys move by `step` (horizontal arrows follow direction). Home selects the first step. End selects `max`. A move at or below the first step clears the rating.
|
|
79
|
+
|
|
80
|
+
### Inherited from BaseField
|
|
81
|
+
|
|
82
|
+
See [BaseField](./BaseField.md). `readonly` and `disabled` block changes.
|
|
83
|
+
|
|
84
|
+
## Related components
|
|
85
|
+
|
|
86
|
+
BaseField, Slider
|
|
@@ -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
|
|
|
@@ -37,7 +37,6 @@ import { TimePanel } from "@bridge-ui/vue/Components/TimePanel";
|
|
|
37
37
|
| `rounded` | `CalendarRounded` | `"md"` | Border radius of time tiles. |
|
|
38
38
|
| `showSeconds` | `boolean` | `false` | Shows seconds in the panel and formatted value. |
|
|
39
39
|
| `timeZone` | `string` | — | IANA time zone. |
|
|
40
|
-
| `value` | `Date \| null` | — | Selected time (`Date` wall clock). |
|
|
41
40
|
|
|
42
41
|
### v-model
|
|
43
42
|
|
|
@@ -42,7 +42,6 @@ import { TimePicker } from "@bridge-ui/vue/Components/TimePicker";
|
|
|
42
42
|
| `showSeconds` | `boolean` | `false` | Shows seconds in the panel and formatted value. |
|
|
43
43
|
| `slots` | `TimePickerSlots` | — | Named slots (`footer` for Cancel / Apply). |
|
|
44
44
|
| `timeZone` | `string` | — | IANA time zone. |
|
|
45
|
-
| `value` | `Date \| null` | — | Controlled value. |
|
|
46
45
|
|
|
47
46
|
### v-model
|
|
48
47
|
|
|
@@ -44,7 +44,6 @@ import { TimeRangePicker } from "@bridge-ui/vue/Components/TimeRangePicker";
|
|
|
44
44
|
| `slots` | `TimeRangePickerSlots` | — | Named slots (`footer` for Cancel / Apply). |
|
|
45
45
|
| `startTitle` | `string` | `"Start time"` | Label above the start time panel. |
|
|
46
46
|
| `timeZone` | `string` | — | IANA time zone. |
|
|
47
|
-
| `value` | `TimeRangeValue \| null` | — | Controlled value (`[start, end]`). |
|
|
48
47
|
|
|
49
48
|
### v-model
|
|
50
49
|
|