@bridge-ui/vue 0.14.0 → 0.16.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 +3 -3
- package/ai/skills/bridge-ui-components/SKILL.md +2 -1
- package/ai/skills/bridge-ui-setup/SKILL.md +9 -8
- package/dist/Actions/Snackbar/BridgeSnackbarItem.vue_vue_type_script_setup_true_lang.js +42 -44
- package/dist/Actions/Snackbar/createBridgeSnackbarApi.js +1 -1
- 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/index.d.ts +0 -1
- package/dist/Adapters/index.js +1 -2
- package/dist/Components/Accordion/composables/useAccordion.js +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 +250 -258
- package/dist/Components/BaseField/composables/useBaseField.js +1 -0
- package/dist/Components/Chart/Chart.js +5 -0
- package/dist/Components/Chart/Chart.vue.d.ts +14 -0
- package/dist/Components/Chart/Chart.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/Components/Chart/chart.types.d.ts +126 -0
- package/dist/Components/Chart/chartInjectionKey.d.ts +94 -0
- package/dist/Components/Chart/chartInjectionKey.js +10 -0
- package/dist/Components/Chart/composables/useChart.d.ts +40 -0
- package/dist/Components/Chart/composables/useChart.js +344 -0
- package/dist/Components/Chart/echartsChart.d.ts +14 -0
- package/dist/Components/Chart/echartsChart.js +199 -0
- package/dist/Components/Chart/index.d.ts +4 -0
- package/dist/Components/Chart/index.js +4 -0
- package/dist/Components/ChartAxis/ChartAxis.js +5 -0
- package/dist/Components/ChartAxis/ChartAxis.vue.d.ts +7 -0
- package/dist/Components/ChartAxis/ChartAxis.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/Components/ChartAxis/chartAxis.types.d.ts +56 -0
- package/dist/Components/ChartAxis/composables/useChartAxis.d.ts +5 -0
- package/dist/Components/ChartAxis/composables/useChartAxis.js +28 -0
- package/dist/Components/ChartAxis/index.d.ts +3 -0
- package/dist/Components/ChartAxis/index.js +3 -0
- package/dist/Components/ChartLegend/ChartLegend.js +5 -0
- package/dist/Components/ChartLegend/ChartLegend.vue.d.ts +6 -0
- package/dist/Components/ChartLegend/ChartLegend.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/Components/ChartLegend/chartLegend.types.d.ts +71 -0
- package/dist/Components/ChartLegend/composables/useChartLegend.d.ts +16 -0
- package/dist/Components/ChartLegend/composables/useChartLegend.js +98 -0
- package/dist/Components/ChartLegend/index.d.ts +3 -0
- package/dist/Components/ChartLegend/index.js +3 -0
- package/dist/Components/ChartSeries/ChartSeries.js +5 -0
- package/dist/Components/ChartSeries/ChartSeries.vue.d.ts +4 -0
- package/dist/Components/ChartSeries/ChartSeries.vue_vue_type_script_setup_true_lang.js +24 -0
- package/dist/Components/ChartSeries/chartSeries.types.d.ts +37 -0
- package/dist/Components/ChartSeries/composables/useChartSeries.d.ts +10 -0
- package/dist/Components/ChartSeries/composables/useChartSeries.js +29 -0
- package/dist/Components/ChartSeries/index.d.ts +3 -0
- package/dist/Components/ChartSeries/index.js +3 -0
- package/dist/Components/ChartTooltip/ChartTooltip.js +5 -0
- package/dist/Components/ChartTooltip/ChartTooltip.vue.d.ts +11 -0
- package/dist/Components/ChartTooltip/ChartTooltip.vue_vue_type_script_setup_true_lang.js +25 -0
- package/dist/Components/ChartTooltip/chartTooltip.types.d.ts +82 -0
- package/dist/Components/ChartTooltip/composables/useChartTooltip.d.ts +15 -0
- package/dist/Components/ChartTooltip/composables/useChartTooltip.js +110 -0
- package/dist/Components/ChartTooltip/index.d.ts +3 -0
- package/dist/Components/ChartTooltip/index.js +3 -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/DataTable/DataTableCellContent.vue.d.ts +1 -5
- package/dist/Components/DataTable/DataTableCellContent.vue_vue_type_script_setup_true_lang.js +24 -25
- package/dist/Components/DataTable/composables/useDataTable.d.ts +1 -1
- package/dist/Components/DataTable/composables/useDataTable.js +76 -74
- package/dist/Components/DataTable/composables/useDataTablePagination.js +1 -1
- 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/Drawer.vue_vue_type_script_setup_true_lang.js +3 -4
- 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/Menu/Menu.vue_vue_type_script_setup_true_lang.js +5 -3
- package/dist/Components/Modal/Modal.vue.d.ts +1 -1
- package/dist/Components/Modal/Modal.vue_vue_type_script_setup_true_lang.js +3 -4
- 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/Pagination/composables/usePagination.js +1 -1
- 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.d.ts +1 -1
- package/dist/Components/RichTextEditor/RichTextEditor.vue_vue_type_script_setup_true_lang.js +30 -26
- package/dist/Components/RichTextEditor/composables/useRichTextEditor.d.ts +4 -3
- package/dist/Components/RichTextEditor/composables/useRichTextEditor.js +131 -135
- package/dist/Components/RichTextEditor/richTextEditor.types.d.ts +1 -1
- package/dist/Components/RichTextEditor/tiptapEditor.d.ts +111 -0
- package/dist/Components/RichTextEditor/tiptapEditor.js +121 -0
- 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 +149 -157
- package/dist/Components/Slider/composables/useSlider.js +1 -0
- package/dist/Components/Snackbar/Snackbar.vue.d.ts +1 -1
- package/dist/Components/Snackbar/Snackbar.vue_vue_type_script_setup_true_lang.js +6 -7
- package/dist/Components/Stepper/composables/useStepper.js +1 -1
- package/dist/Components/Switch/composables/useSwitch.js +1 -0
- package/dist/Components/Table/composables/useTableCell.d.ts +1 -1
- package/dist/Components/Tabs/composables/useTabs.d.ts +0 -156
- package/dist/Components/Tabs/composables/useTabs.js +1 -1
- 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/ToggleGroup/composables/useToggleGroup.js +3 -3
- package/dist/Components/Tooltip/Tooltip.vue.d.ts +0 -1
- package/dist/Components/Tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +7 -5
- package/dist/Utils/index.d.ts +16 -6
- package/dist/Utils/index.js +39 -35
- package/dist/augments.d.ts +20 -2
- package/dist/index.d.ts +0 -3
- package/dist/index.js +180 -183
- package/dist/theme.css +10 -1
- package/docs/README.md +27 -13
- package/docs/components/ActionFooter.md +16 -14
- package/docs/components/BridgeUIProvider.md +95 -20
- package/docs/components/Chart.md +252 -0
- 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 +2 -23
- package/package.json +8 -76
- 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/dist/Adapters/RichText/index.d.ts +0 -1
- package/dist/Adapters/RichText/index.js +0 -2
- package/dist/Adapters/RichText/mockRichTextAdapter.d.ts +0 -5
- package/dist/Adapters/RichText/useRichTextAdapter.d.ts +0 -12
- package/dist/Adapters/RichText/useRichTextAdapter.js +0 -13
|
@@ -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",
|
|
@@ -101,19 +101,29 @@ const dates = createMomentDateAdapter({
|
|
|
101
101
|
});
|
|
102
102
|
```
|
|
103
103
|
|
|
104
|
-
###
|
|
104
|
+
### Custom global values
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
Packages can add their own keys to `global` by augmenting `BridgeUIGlobal`. Nested providers and `setGlobal` merge every key by the same rule:
|
|
107
|
+
|
|
108
|
+
- Plain data (`breakpoints`, `formDefaults`, custom settings objects) is deep-merged.
|
|
109
|
+
- Functions, class instances, and objects with a function member (adapters) are replaced — the last defined value wins, and `undefined` keeps the previous one.
|
|
110
|
+
|
|
111
|
+
Only the top-level members of a value are checked. An object whose functions sit deeper (`{ hooks: { onSave } }`) is deep-merged.
|
|
107
112
|
|
|
108
113
|
```ts
|
|
109
|
-
import
|
|
110
|
-
import { createTiptapRichTextAdapter } from "@bridge-ui/vue/Adapters/Examples/rich-text-tiptap";
|
|
114
|
+
import "@bridge-ui/core/Config";
|
|
111
115
|
|
|
112
|
-
|
|
116
|
+
declare module "@bridge-ui/core/Config" {
|
|
117
|
+
interface BridgeUIGlobal {
|
|
118
|
+
editor?: { format: (value: string) => string };
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
113
122
|
|
|
123
|
+
```ts
|
|
114
124
|
app.use(
|
|
115
125
|
createBridgeUI({
|
|
116
|
-
global: {
|
|
126
|
+
global: { editor: { format: (value) => value.trim() } },
|
|
117
127
|
}),
|
|
118
128
|
);
|
|
119
129
|
```
|
|
@@ -138,6 +148,25 @@ app.use(
|
|
|
138
148
|
);
|
|
139
149
|
```
|
|
140
150
|
|
|
151
|
+
### Default color
|
|
152
|
+
|
|
153
|
+
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.
|
|
154
|
+
|
|
155
|
+
Use `"black"` for a monochrome UI. To rebrand `primary`, change the palette in CSS instead.
|
|
156
|
+
|
|
157
|
+
Merge order: instance props → `components.{Name}.defaultProps` → chrome → `formDefaults` → `defaultColor` → library defaults. Explicit props and `invalid` / error states are unaffected.
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
import { createBridgeUI } from "@bridge-ui/vue";
|
|
161
|
+
|
|
162
|
+
app.use(
|
|
163
|
+
createBridgeUI({
|
|
164
|
+
global: { defaultColor: "black" },
|
|
165
|
+
components: { Alert: { defaultProps: { color: "info" } } },
|
|
166
|
+
}),
|
|
167
|
+
);
|
|
168
|
+
```
|
|
169
|
+
|
|
141
170
|
### Shared chrome
|
|
142
171
|
|
|
143
172
|
`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 +234,8 @@ app.use(
|
|
|
205
234
|
components: {
|
|
206
235
|
ActionFooter: {
|
|
207
236
|
defaultProps: {
|
|
208
|
-
|
|
209
|
-
cancelVariant: "
|
|
210
|
-
cancelColor: "secondary",
|
|
237
|
+
applyVariant: "solid",
|
|
238
|
+
cancelVariant: "outline",
|
|
211
239
|
},
|
|
212
240
|
},
|
|
213
241
|
},
|
|
@@ -215,6 +243,53 @@ app.use(
|
|
|
215
243
|
);
|
|
216
244
|
```
|
|
217
245
|
|
|
246
|
+
### Custom components
|
|
247
|
+
|
|
248
|
+
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`.
|
|
249
|
+
|
|
250
|
+
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`).
|
|
251
|
+
|
|
252
|
+
```ts
|
|
253
|
+
import "@bridge-ui/core/Config";
|
|
254
|
+
|
|
255
|
+
declare module "@bridge-ui/core/Config" {
|
|
256
|
+
interface BridgeUIComponentsRegistry {
|
|
257
|
+
Editor: Partial<{
|
|
258
|
+
classes: { root?: string };
|
|
259
|
+
defaultProps: Partial<{ size: "sm" | "md" | "lg" }>;
|
|
260
|
+
}>;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
```ts
|
|
266
|
+
import { useBridgeUIComponent } from "@bridge-ui/vue/Utils";
|
|
267
|
+
|
|
268
|
+
type EditorProps = { size?: "sm" | "md" | "lg"; variant?: string };
|
|
269
|
+
|
|
270
|
+
export function useEditor(props: EditorProps) {
|
|
271
|
+
const { merged, entry, chromeEntry } = useBridgeUIComponent<EditorProps>({
|
|
272
|
+
chrome: "FormField",
|
|
273
|
+
props: () => props,
|
|
274
|
+
componentName: "Editor",
|
|
275
|
+
libDefaults: { size: "md" },
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
return { merged, entry, chromeEntry };
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
```ts
|
|
283
|
+
app.use(
|
|
284
|
+
createBridgeUI({
|
|
285
|
+
components: {
|
|
286
|
+
Editor: { defaultProps: { size: "sm" } },
|
|
287
|
+
FormField: { defaultProps: { variant: "filled" } },
|
|
288
|
+
},
|
|
289
|
+
}),
|
|
290
|
+
);
|
|
291
|
+
```
|
|
292
|
+
|
|
218
293
|
### Runtime updates
|
|
219
294
|
|
|
220
295
|
```ts
|
|
@@ -230,10 +305,10 @@ setGlobal({ mobileBreakpoint: "md" });
|
|
|
230
305
|
|
|
231
306
|
## Props
|
|
232
307
|
|
|
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` |
|
|
308
|
+
| Prop | Type | Default | Description |
|
|
309
|
+
| ------------ | -------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
310
|
+
| `components` | `BridgeUIComponentsConfig` | — | Per-component defaults |
|
|
311
|
+
| `global` | `Partial<BridgeUIGlobal>` | — | `theme`, `locale`, `direction`, `timeZone`, `mobileBreakpoint`, `breakpoints`, `icons`, `i18n`, `dates`, `formDefaults`, `defaultColor` |
|
|
237
312
|
|
|
238
313
|
App content is passed via the **default slot** (see Usage above).
|
|
239
314
|
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
# Chart
|
|
2
|
+
|
|
3
|
+
Composable line, bar, and area charts. Bridge owns the legend, tooltip, tokens, dark mode, and a11y (summary, keyboard navigation, data table). The plot engine is ECharts.
|
|
4
|
+
|
|
5
|
+
Compose `Chart` with `ChartSeries`, `ChartAxis`, `ChartLegend`, and `ChartTooltip`.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { Chart } from "@bridge-ui/vue/Components/Chart";
|
|
11
|
+
import { ChartAxis } from "@bridge-ui/vue/Components/ChartAxis";
|
|
12
|
+
import { ChartLegend } from "@bridge-ui/vue/Components/ChartLegend";
|
|
13
|
+
import { ChartSeries } from "@bridge-ui/vue/Components/ChartSeries";
|
|
14
|
+
import { ChartTooltip } from "@bridge-ui/vue/Components/ChartTooltip";
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Install `echarts` next to `@bridge-ui/vue` when you use `Chart`. The import is tree-shaken (line, bar, grid, SVG renderer). `Chart` stays off the `@bridge-ui/vue` root so apps that never import it do not load `echarts`.
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
|
|
21
|
+
### Usage
|
|
22
|
+
|
|
23
|
+
```vue
|
|
24
|
+
<script setup lang="ts">
|
|
25
|
+
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"];
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<Chart :categories="months">
|
|
30
|
+
<ChartSeries name="Revenue" :data="[120, 180, 150, 220, 260, 240]" />
|
|
31
|
+
<ChartLegend />
|
|
32
|
+
<ChartTooltip />
|
|
33
|
+
</Chart>
|
|
34
|
+
</template>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Bar
|
|
38
|
+
|
|
39
|
+
```vue
|
|
40
|
+
<Chart :height="320" :categories="months">
|
|
41
|
+
<ChartSeries type="bar" name="Online" :data="online" />
|
|
42
|
+
<ChartSeries type="bar" name="Retail" :data="retail" />
|
|
43
|
+
<ChartLegend align="start" position="top" />
|
|
44
|
+
<ChartTooltip />
|
|
45
|
+
</Chart>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Area
|
|
49
|
+
|
|
50
|
+
```vue
|
|
51
|
+
<Chart :categories="months">
|
|
52
|
+
<ChartSeries type="area" curve="smooth" name="Visitors" :data="visitors" />
|
|
53
|
+
<ChartTooltip />
|
|
54
|
+
</Chart>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Mixed series
|
|
58
|
+
|
|
59
|
+
Bars and lines share the value axis.
|
|
60
|
+
|
|
61
|
+
```vue
|
|
62
|
+
<Chart :categories="months">
|
|
63
|
+
<ChartSeries type="bar" name="Orders" :data="orders" />
|
|
64
|
+
<ChartSeries name="Returns" :data="returns" />
|
|
65
|
+
<ChartLegend />
|
|
66
|
+
<ChartTooltip />
|
|
67
|
+
</Chart>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Gaps
|
|
71
|
+
|
|
72
|
+
`null` values leave a gap in lines and areas and are skipped in the tooltip.
|
|
73
|
+
|
|
74
|
+
```vue
|
|
75
|
+
<ChartSeries name="Costs" :data="[80, 90, null, 140, 150, 170]" />
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Axes
|
|
79
|
+
|
|
80
|
+
```vue
|
|
81
|
+
<Chart :categories="months">
|
|
82
|
+
<ChartSeries name="Revenue" :data="revenue" />
|
|
83
|
+
<ChartAxis position="x" label="Month" />
|
|
84
|
+
<ChartAxis :min="0" position="y" :format-tick="(value) => `$${value}`" />
|
|
85
|
+
</Chart>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`format-tick` receives the category on `x` and the value on `y`. Grid lines are on for `y` and off for `x` by default.
|
|
89
|
+
|
|
90
|
+
### Colors
|
|
91
|
+
|
|
92
|
+
Series take palette colors in order. Override the palette on `Chart`, or pass a token key or any CSS color to `ChartSeries`.
|
|
93
|
+
|
|
94
|
+
```vue
|
|
95
|
+
<Chart :categories="months" :palette="['info', 'warning']">
|
|
96
|
+
<ChartSeries name="Plan" :data="plan" />
|
|
97
|
+
<ChartSeries name="Actual" :data="actual" color="#8b5cf6" />
|
|
98
|
+
</Chart>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Token keys (`primary`, `info`, `success`, `warning`, `error`, `secondary`, `dark`, `black`) follow light and dark mode automatically.
|
|
102
|
+
|
|
103
|
+
### Legend
|
|
104
|
+
|
|
105
|
+
Legend entries are toggle buttons: click to hide or show a series, hover or focus to emphasize it.
|
|
106
|
+
|
|
107
|
+
```vue
|
|
108
|
+
<ChartLegend :interactive="false" />
|
|
109
|
+
<ChartLegend align="end" position="top" />
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Tooltip
|
|
113
|
+
|
|
114
|
+
```vue
|
|
115
|
+
<ChartTooltip :format-value="(value) => currency.format(value)" />
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
```vue
|
|
119
|
+
<ChartTooltip>
|
|
120
|
+
<template #content="{ category, items }">
|
|
121
|
+
<span>{{ category }}: {{ items.length }} series</span>
|
|
122
|
+
</template>
|
|
123
|
+
</ChartTooltip>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Loading and empty
|
|
127
|
+
|
|
128
|
+
```vue
|
|
129
|
+
<Chart :loading="isLoading" :categories="months">
|
|
130
|
+
<ChartSeries name="Revenue" :data="revenue" />
|
|
131
|
+
</Chart>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
```vue
|
|
135
|
+
<Chart :categories="months">
|
|
136
|
+
<template #empty>No sales in this period</template>
|
|
137
|
+
</Chart>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Summary
|
|
141
|
+
|
|
142
|
+
`Chart` generates a text summary (series names and category range) for screen readers. Pass `summary` to describe the takeaway instead.
|
|
143
|
+
|
|
144
|
+
```vue
|
|
145
|
+
<Chart :categories="months" summary="Revenue doubled from January to June.">
|
|
146
|
+
<ChartSeries name="Revenue" :data="revenue" />
|
|
147
|
+
</Chart>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Registry defaults
|
|
151
|
+
|
|
152
|
+
```vue
|
|
153
|
+
<BridgeUIProvider
|
|
154
|
+
:components="{
|
|
155
|
+
ChartSeries: { defaultProps: { curve: 'smooth' } },
|
|
156
|
+
ChartLegend: { defaultProps: { position: 'top' } },
|
|
157
|
+
Chart: { defaultProps: { height: 320, palette: ['primary', 'success'] } },
|
|
158
|
+
}"
|
|
159
|
+
>
|
|
160
|
+
<App />
|
|
161
|
+
</BridgeUIProvider>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Theme tokens (`Chart.tokens.theme`) set the grid, axis, and label colors as Tailwind text-color classes:
|
|
165
|
+
|
|
166
|
+
```vue
|
|
167
|
+
<BridgeUIProvider
|
|
168
|
+
:components="{
|
|
169
|
+
Chart: { tokens: { theme: { grid: 'text-dark-100 dark:text-dark-800' } } },
|
|
170
|
+
}"
|
|
171
|
+
>
|
|
172
|
+
<App />
|
|
173
|
+
</BridgeUIProvider>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Accessibility
|
|
177
|
+
|
|
178
|
+
- The root is a `figure`; the plot is a focusable `img` labelled by `summary` (or the generated summary).
|
|
179
|
+
- Arrow keys move between categories, `Home` / `End` jump to the edges, `Escape` clears. The tooltip follows the keyboard, and the values are announced through a live region.
|
|
180
|
+
- A data table with every value is always rendered, visually hidden.
|
|
181
|
+
- The tooltip is decorative (`aria-hidden`); the same information is in the table and announcements.
|
|
182
|
+
- Engine animation is off under `prefers-reduced-motion`.
|
|
183
|
+
|
|
184
|
+
## Props (`Chart`)
|
|
185
|
+
|
|
186
|
+
| Prop | Type | Default | Description |
|
|
187
|
+
| ------------- | -------------------- | ------------------------ | --------------------------------------------------- |
|
|
188
|
+
| `animation` | `boolean` | `true` | Engine transitions (always off for reduced motion). |
|
|
189
|
+
| `categories` | `string[]` | required | Category labels; one value per category per series. |
|
|
190
|
+
| `classes` | `ChartClasses` | — | `root`, `plot`, `loading`, `empty`, `table`. |
|
|
191
|
+
| `height` | `number \| string` | `280` | Plot height. |
|
|
192
|
+
| `loading` | `boolean` | `false` | Shows the loading overlay. |
|
|
193
|
+
| `palette` | `ChartSeriesColor[]` | primary, info, success … | Series colors in order. |
|
|
194
|
+
| `size` | `ChartSize` | `"md"` | Density of labels, legend, and tooltip. |
|
|
195
|
+
| `summary` | `string` | generated | Accessible description of the plot. |
|
|
196
|
+
| `width` | `number \| string` | `"100%"` | Root width. |
|
|
197
|
+
| `customProps` | `ChartCustomProps` | — | Extra props for `root` and `plot`. |
|
|
198
|
+
|
|
199
|
+
### Slots (`Chart`)
|
|
200
|
+
|
|
201
|
+
| Slot | Description |
|
|
202
|
+
| --------- | ---------------------------------------------------------- |
|
|
203
|
+
| `default` | `ChartSeries`, `ChartAxis`, `ChartLegend`, `ChartTooltip`. |
|
|
204
|
+
| `empty` | Content shown when there is nothing to plot. |
|
|
205
|
+
| `loading` | Content shown while `loading` is true. |
|
|
206
|
+
|
|
207
|
+
## Props (`ChartSeries`)
|
|
208
|
+
|
|
209
|
+
| Prop | Type | Default | Description |
|
|
210
|
+
| ------- | --------------------------- | ---------- | ---------------------------------------- |
|
|
211
|
+
| `color` | `ChartSeriesColor` | palette | Token key or CSS color. |
|
|
212
|
+
| `curve` | `"linear" \| "smooth"` | `"linear"` | Line interpolation for `line` / `area`. |
|
|
213
|
+
| `data` | `(number \| null)[]` | required | One value per category; `null` is a gap. |
|
|
214
|
+
| `name` | `string` | required | Legend, tooltip, and table label. |
|
|
215
|
+
| `type` | `"line" \| "bar" \| "area"` | `"line"` | Series family. |
|
|
216
|
+
|
|
217
|
+
## Props (`ChartAxis`)
|
|
218
|
+
|
|
219
|
+
| Prop | Type | Default | Description |
|
|
220
|
+
| ------------ | ------------------------------------- | ----------------------------- | --------------------------------- |
|
|
221
|
+
| `formatTick` | `(value: number \| string) => string` | — | Tick label formatter. |
|
|
222
|
+
| `grid` | `boolean` | `true` on `y`, `false` on `x` | Grid lines. |
|
|
223
|
+
| `hidden` | `boolean` | `false` | Hides the axis line and labels. |
|
|
224
|
+
| `label` | `string` | — | Axis title. |
|
|
225
|
+
| `max` | `number` | auto | Value axis upper bound. |
|
|
226
|
+
| `min` | `number` | auto | Value axis lower bound. |
|
|
227
|
+
| `position` | `"x" \| "y"` | required | Categories (`x`) or values (`y`). |
|
|
228
|
+
| `tickCount` | `number` | auto | Preferred number of ticks. |
|
|
229
|
+
|
|
230
|
+
## Props (`ChartLegend`)
|
|
231
|
+
|
|
232
|
+
| Prop | Type | Default | Description |
|
|
233
|
+
| ------------- | ------------------------------ | ---------- | ------------------------------------------ |
|
|
234
|
+
| `align` | `"start" \| "center" \| "end"` | `"center"` | Horizontal alignment. |
|
|
235
|
+
| `classes` | `ChartLegendClasses` | — | `root`, `item`, `swatch`, `label`. |
|
|
236
|
+
| `interactive` | `boolean` | `true` | Entries toggle and emphasize their series. |
|
|
237
|
+
| `position` | `"top" \| "bottom"` | `"bottom"` | Above or below the plot. |
|
|
238
|
+
| `customProps` | `ChartLegendCustomProps` | — | Extra props for `root` and `item`. |
|
|
239
|
+
|
|
240
|
+
## Props (`ChartTooltip`)
|
|
241
|
+
|
|
242
|
+
| Prop | Type | Default | Description |
|
|
243
|
+
| ------------- | --------------------------------- | -------------------- | ---------------------------------------------------- |
|
|
244
|
+
| `classes` | `ChartTooltipClasses` | — | `root`, `title`, `item`, `swatch`, `label`, `value`. |
|
|
245
|
+
| `formatValue` | `(value: number, item) => string` | locale number format | Value formatter. |
|
|
246
|
+
| `customProps` | `ChartTooltipCustomProps` | — | Extra props for `root`. |
|
|
247
|
+
|
|
248
|
+
### Slots (`ChartTooltip`)
|
|
249
|
+
|
|
250
|
+
| Slot | Props | Description |
|
|
251
|
+
| --------- | ---------------------------- | ---------------------------- |
|
|
252
|
+
| `content` | `{ category, index, items }` | Replaces the title and rows. |
|
|
@@ -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
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# RichTextEditor
|
|
2
2
|
|
|
3
|
-
Formatted text input with FormField chrome
|
|
3
|
+
Formatted text input with FormField chrome. Bridge owns the toolbar, tokens, and a11y. The document engine is TipTap.
|
|
4
4
|
|
|
5
5
|
Sanitize HTML before rendering it outside the editor — XSS prevention stays in the app.
|
|
6
6
|
|
|
@@ -10,28 +10,7 @@ Sanitize HTML before rendering it outside the editor — XSS prevention stays in
|
|
|
10
10
|
import { RichTextEditor } from "@bridge-ui/vue/Components/RichTextEditor";
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Provide `global.richText` on `BridgeUIProvider`. Ready adapter:
|
|
16
|
-
|
|
17
|
-
```ts
|
|
18
|
-
import { BridgeUIProvider } from "@bridge-ui/vue";
|
|
19
|
-
import { createTiptapRichTextAdapter } from "@bridge-ui/vue/Adapters/Examples/rich-text-tiptap";
|
|
20
|
-
|
|
21
|
-
const richText = createTiptapRichTextAdapter();
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
```vue
|
|
25
|
-
<BridgeUIProvider :global="{ richText }">
|
|
26
|
-
<App />
|
|
27
|
-
</BridgeUIProvider>
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
| Adapter | Peer(s) | Notes |
|
|
31
|
-
| ------------------------------------ | ------------------------------------------------------------------------------------ | --------------------------------- |
|
|
32
|
-
| `Adapters/Examples/rich-text-tiptap` | `@tiptap/core`, `@tiptap/pm`, `@tiptap/starter-kit`, `@tiptap/extension-placeholder` | Shipped example; ProseMirror JSON |
|
|
33
|
-
|
|
34
|
-
Custom engines can implement `RichTextEditorAdapter` and pass them via `global.richText`.
|
|
13
|
+
Install `@tiptap/core`, `@tiptap/pm`, `@tiptap/starter-kit`, and `@tiptap/extension-placeholder` next to `@bridge-ui/vue` when you use `RichTextEditor`.
|
|
35
14
|
|
|
36
15
|
## Examples
|
|
37
16
|
|