@voicenter-team/voicenter-ui-plus 4.0.0-beta.0 → 4.0.0-beta.1
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/README.md +36 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Voicenter UI library for Vue
|
|
2
2
|
This is Vue 3.x + Typescript component library made for Voicenter systems.
|
|
3
3
|
|
|
4
|
-
> **
|
|
4
|
+
> **4.x renames the colour tokens, draws Lucide icons and changes some component defaults.** An application on 3.x follows [Migrating from 3.x to 4.x](#migrating-from-3x-to-4x); one on 2.x first follows [`MIGRATION_v3.md`](./MIGRATION_v3.md).
|
|
5
5
|
|
|
6
6
|
## Installation
|
|
7
7
|
|
|
@@ -10,6 +10,8 @@ npm i @voicenter-team/voicenter-ui-plus
|
|
|
10
10
|
npm i vue@^3.5 element-plus @vueuse/core @lucide/vue dayjs lodash-es libphonenumber-js maska
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
Until 4.0.0 is released, 4.x is published under the npm tag `beta` and `latest` is 3.x: `npm i @voicenter-team/voicenter-ui-plus@beta`, or an exact `4.0.0-beta.N`.
|
|
14
|
+
|
|
13
15
|
### Sass compiler (build-time)
|
|
14
16
|
|
|
15
17
|
This library customizes element-plus theming via SCSS variable injection at build time. Your bundler needs to be able to compile SCSS. If your project doesn't already use Sass, add it as a dev dependency:
|
|
@@ -72,6 +74,16 @@ import { VcButton, VcInput } from '@voicenter-team/voicenter-ui-plus'
|
|
|
72
74
|
```
|
|
73
75
|
Bundlers drop unused components and their CSS. A consumer importing only `VcButton` ships ~50–150 KB JS + ~10–30 KB CSS.
|
|
74
76
|
|
|
77
|
+
The stylesheet sets the default theme (redGreen) on `:root`. Another theme and the text font are two calls, the ones the plugin makes itself:
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
import Theme from '@voicenter-team/voicenter-ui-plus/theme'
|
|
81
|
+
import { loadTextFont } from '@voicenter-team/voicenter-ui-plus/font'
|
|
82
|
+
|
|
83
|
+
Theme({ type: 'local', themeName: 'voicenter' }) // any themeConfig, see "Theming specification"
|
|
84
|
+
loadTextFont() // Rubik from Google Fonts
|
|
85
|
+
```
|
|
86
|
+
|
|
75
87
|
If you use `useConfirmModal`, `useConfirmPopup`, or `NotifyService`, mount global overlays in `App.vue`:
|
|
76
88
|
|
|
77
89
|
```vue
|
|
@@ -153,7 +165,7 @@ module.exports = {
|
|
|
153
165
|
}
|
|
154
166
|
```
|
|
155
167
|
|
|
156
|
-
The library's own `tailwind.config.js` (shipped as `@voicenter-team/voicenter-ui-plus/tailwind.config`) also has keys for the radii, shadows and font weights of the components; [Corners](#corners), [Shadows](#shadows) and [Text](#text) say what each class is for. Their values are the CSS variables the library stylesheet sets on `:root` in both modes, so a class drawn with them changes together with the library. An application takes these keys from the shipped configuration:
|
|
168
|
+
The library's own `tailwind.config.js` (shipped as `@voicenter-team/voicenter-ui-plus/tailwind.config`) also has keys for the radii, shadows, font family and font weights of the components; [Corners](#corners), [Shadows](#shadows) and [Text](#text) say what each class is for. Their values are the CSS variables the library stylesheet sets on `:root` in both modes, so a class drawn with them changes together with the library. An application takes these keys from the shipped configuration:
|
|
157
169
|
|
|
158
170
|
```js
|
|
159
171
|
// tailwind.config.js
|
|
@@ -167,6 +179,7 @@ module.exports = {
|
|
|
167
179
|
borderRadius: uiPlusTheme.borderRadius,
|
|
168
180
|
boxShadow: uiPlusTheme.boxShadow,
|
|
169
181
|
transitionProperty: uiPlusTheme.extend.transitionProperty,
|
|
182
|
+
fontFamily: uiPlusTheme.fontFamily,
|
|
170
183
|
fontWeight: uiPlusTheme.extend.fontWeight
|
|
171
184
|
}
|
|
172
185
|
}
|
|
@@ -175,10 +188,12 @@ module.exports = {
|
|
|
175
188
|
|
|
176
189
|
Import the application's own stylesheet after the library, so the application's utilities win ties of equal specificity with the library's CSS (`.hidden` is the usual one).
|
|
177
190
|
|
|
191
|
+
Tailwind's preflight (`@tailwind base`) in that stylesheet sets `font-family` on `html` again, Tailwind's sans font, after the library set Rubik there. `html { @apply font-main; }` in the application's `@layer base` keeps the library font on the page.
|
|
192
|
+
|
|
178
193
|
The 3.x colour names are not in the scheme; [Migrating from 3.x to 4.x](#migrating-from-3x-to-4x) lists their 4.x names.
|
|
179
194
|
|
|
180
195
|
### Theming specification
|
|
181
|
-
The `themeConfig`
|
|
196
|
+
The `themeConfig` passed to `app.use(VoicenterUI, { themeConfig })`, or to `Theme()` in tree-shake mode, could have the following specifications.
|
|
182
197
|
|
|
183
198
|
A theme is a flat object of colour tokens. Each key is set on the document element as a CSS variable with `--` in front of it: `vc-action-primary` becomes `--vc-action-primary`. The keys are grouped by role:
|
|
184
199
|
|
|
@@ -191,7 +206,7 @@ A theme is a flat object of colour tokens. Each key is set on the document eleme
|
|
|
191
206
|
|
|
192
207
|
Hover, pressed, disabled and tinted states (`--vc-action-primary--hover`, `--vc-action-primary--subtle-hover`, …) are mixed from these values by the library, so a theme sets only the base colours. The Element Plus colour variables (`--el-color-primary`, `--el-bg-color`, `--el-border-color`, …) are filled from the same tokens; a theme can still set an `el-*` key to override one. A theme that does not set `vc-content-success`, `vc-content-warning`, `vc-content-danger` or `vc-content-info` takes its `vc-action-*` of the same status for it.
|
|
193
208
|
|
|
194
|
-
The full list of keys and the values of every built-in theme are in [`src/theme/themes.json`](https://github.com/VoicenterTeam/voicenter-ui-plus/blob/master/src/theme/themes.json). The library's stylesheet sets the keys of the default theme (redGreen) on `:root`. Any other key a theme leaves out takes the default theme's value; after a theme switch at run time, a key the new theme leaves out keeps the previous theme's value. Theme keys of 3.x (`primary`, `default-text`, `ui-lines`, …) are not read: a `customJson` or remote theme passes the `vc-*` keys ([Migrating from 3.x to 4.x](#migrating-from-3x-to-4x) maps them).
|
|
209
|
+
The full list of keys and the values of every built-in theme are in [`src/theme/themes.json`](https://github.com/VoicenterTeam/voicenter-ui-plus/blob/master/src/theme/themes.json). The library's stylesheet sets the keys of the default theme (redGreen) on `:root`. Any other key a theme leaves out takes the default theme's value; after a theme switch at run time, a key the new theme leaves out keeps the previous theme's value. Theme keys of 3.x (`primary`, `default-text`, `ui-lines`, …) are not read, and nothing warns about them: a `customJson` or remote theme with 3.x keys draws the default theme. A theme passes the `vc-*` keys ([Migrating from 3.x to 4.x](#migrating-from-3x-to-4x) maps them).
|
|
195
210
|
|
|
196
211
|
### Local
|
|
197
212
|
**Config:**
|
|
@@ -210,7 +225,7 @@ Such configuration will append to the document element the CSS variables from on
|
|
|
210
225
|
|
|
211
226
|
**Params:**
|
|
212
227
|
- **themeName**
|
|
213
|
-
- The name of the theme to be injected. `redGreen` is the default (it is also used when no `themeConfig` is passed); `black` is a dark theme. An unknown name logs a warning and keeps the default.
|
|
228
|
+
- The name of the theme to be injected. `redGreen` is the default (it is also used when no `themeConfig` is passed); `black` is a dark theme; `voicenter` and `voicenterRed` have the same values. An unknown name logs a warning and keeps the default.
|
|
214
229
|
- **onSetupCallback**
|
|
215
230
|
- The function which will be called right after the variables will be injected into the document element. First parameter of which is the theme object which was set up
|
|
216
231
|
|
|
@@ -405,6 +420,8 @@ A colour name works the same after every colour prefix (`text-`, `bg-`, `border-
|
|
|
405
420
|
|
|
406
421
|
Text and icons in a status colour take the `content` name (`text-content-danger`, `text-content-success`). In most themes it is the same colour as the fill (`bg-action-danger`); voicenter and voicenterRed draw success and warning text and icons darker than the fill.
|
|
407
422
|
|
|
423
|
+
`primary` and `secondary` are not status colours: text and icons in them keep the fill, `text-action-primary` and `text-action-secondary`. `content-secondary` is the 3.x `secondary-text`, a grey.
|
|
424
|
+
|
|
408
425
|
| 3.x colour name | 4.x colour name |
|
|
409
426
|
| --- | --- |
|
|
410
427
|
| `main-bg` | `page` |
|
|
@@ -492,7 +509,7 @@ Text and icons in a status colour take the `content` name (`text-content-danger`
|
|
|
492
509
|
|
|
493
510
|
### Theme keys
|
|
494
511
|
|
|
495
|
-
A `customJson` or `remote` theme passes the 4.x keys ([Theming specification](#theming-specification)). Where several 3.x keys become one 4.x key, the theme sets it once. A 4.x theme sets only base colours: the hover, pressed and tinted states are mixed by the library. A key the theme leaves out takes the default theme's value, as the Theming specification describes.
|
|
512
|
+
A `customJson` or `remote` theme passes the 4.x keys ([Theming specification](#theming-specification)). Where several 3.x keys become one 4.x key, the theme sets it once. When those keys had different values, this is a choice of one colour for all of them, made by whoever owns the theme, not a rename: `default-text`, `primary-text` and `heading-text` are one `vc-content-primary`, `primary` and `primary-alternative` one `vc-action-primary`. An application can also leave its own theme for a built-in one (`type: 'local'`). A 4.x theme sets only base colours: the hover, pressed and tinted states are mixed by the library. A key the theme leaves out takes the default theme's value, as the Theming specification describes.
|
|
496
513
|
|
|
497
514
|
Keys with no 3.x key of their own: `vc-bg-inset`, `vc-ring`, `vc-onfill-warning`, the anchors of single fills `vc-mix-anchor-{fill}` (the built-in themes set `vc-mix-anchor-primary` and `vc-mix-anchor-warning`; set them as `actions-mix-color` was set), `vc-action-info` and `vc-content-info`.
|
|
498
515
|
|
|
@@ -551,9 +568,11 @@ A 3.x name in `@apply` or in `theme('colors.…')` fails the Tailwind build. In
|
|
|
551
568
|
```bash
|
|
552
569
|
n='(main|light|dark|field|overlay)-bg|card-bg-color|skeleton-loader(-animation)?|scrollbar-(track|thumb(-hover)?)|(primary|heading|default|secondary|inactive|btn-filled)-text|headers|icons|table-headings|placeholders|default-loader|(major-)?ui-lines|field-borders|progress-line-(not-)?done|(card|table)-shadow-color|actions-mix-color|(primary(-alternative)?|secondary|destructive|error|success|warning)(-actions)?|(active|inactive)-elements'
|
|
553
570
|
s='(-bg)?(--(focus|pressed))?'
|
|
554
|
-
grep -rnE "(var\(|['\"])--($n)$s[,)'\"]|(^|[^a-zA-Z0-9_-])(text|bg|border(-[xytrblse])?|ring(-offset)?|fill|stroke|divide|outline|placeholder|shadow|from|via|to|caret|accent|decoration)-($n)$s([^a-zA-Z0-9_-]|$)" src
|
|
571
|
+
grep -rnE "(var\(|['\"])--($n)$s[,)'\"]|(^|[^a-zA-Z0-9_-])(text|bg|border(-[xytrblse])?|ring(-offset)?|fill|stroke|divide|outline|placeholder|shadow|from|via|to|caret|accent|decoration)-($n)$s([^a-zA-Z0-9_-]|$)" src index.html tailwind.config.*
|
|
555
572
|
```
|
|
556
573
|
|
|
574
|
+
Add every other folder of the application with templates or styles. The Tailwind configuration counts too: a 3.x variable in its `boxShadow` or `colors` draws nothing, with no error.
|
|
575
|
+
|
|
557
576
|
Colour prop values that name a Tailwind colour (`VcCollapseItem` `color-icon` and `color-border`, `VcLoading` `color`) do not match this pattern; check them separately.
|
|
558
577
|
|
|
559
578
|
The theme keys of a `customJson` configuration (`colors.json`) and of a remote branding section move to the `vc-*` keys of the table above. An application with `type: 'none'` sets the 4.x variables itself. `onSetupCallback(theme)` receives the theme with its `vc-*` keys.
|
|
@@ -568,9 +587,9 @@ The components draw Lucide icons (`@lucide/vue`) where 3.x drew the `vc-icon-*`
|
|
|
568
587
|
| --- | --- | --- |
|
|
569
588
|
| Close and maximize controls of VcModal, the close control of a notification, the copy control of VcCodeBlock | native buttons with the classes `vc-dialog-header-icon`, `vc-link`, `vc-dialog-header-maximize-icon`, `vc-dialog-header-close-icon` and `vc-toast-close-icon`; the copy control read `--code-block-muted` and `--code-block-selection` | a small secondary VcButtonIcon; those classes are gone (`vc-dialog-header-close`, `vc-dialog-header-maximize`, `vc-toast-icon-close` and `vc-code-block__copy` stay), and the copy control takes the colours of VcButtonIcon instead of `--code-block-muted` and `--code-block-selection` |
|
|
570
589
|
| `--base-border-radius` | set on `<html>` by the theme setup | removed; corners read the component radii `--vc-radius-*` (`--vc-radius-control` for controls) |
|
|
571
|
-
| The radius keys of the shipped `tailwind.config.js` | `xs`, `sm` (0.25rem), `md`, `lg`, `xl`, `xxl`, `tag`, `DEFAULT` (`rounded`) and `horizontal-tab-*` | the radius roles (see "Corners"), `none` and `full`. An application keeps Tailwind's own scale, and its `extend.borderRadius` from the shipped configuration adds the roles: `rounded-sm` is Tailwind's, and `rounded-xs`, `rounded-xxl` and `rounded-horizontal-tab-*` are not generated. A configuration that takes the whole shipped file instead of the keys "Tailwind" lists, such as `merge(require('@voicenter-team/voicenter-ui-plus/tailwind.config'), ownConfig)` with lodash `merge`, has only the roles, `none` and `full`. `borderRadius: require('tailwindcss/defaultTheme').borderRadius` in its own `theme` brings Tailwind's scale back beside the roles, since `merge` joins the two objects. With it `rounded-sm` is 0.125rem (3.x: 0.25rem; `rounded` is the 0.25rem one), and `rounded-2xl` and `rounded-3xl` are generated, which 3.x did not generate |
|
|
590
|
+
| The radius keys of the shipped `tailwind.config.js` | `xs`, `sm` (0.25rem), `md`, `lg`, `xl`, `xxl`, `tag`, `DEFAULT` (`rounded`) and `horizontal-tab-*` | the radius roles (see "Corners"), `none` and `full`. An application keeps Tailwind's own scale, and its `extend.borderRadius` from the shipped configuration adds the roles: `rounded-sm` is Tailwind's, and `rounded-xs`, `rounded-xxl` and `rounded-horizontal-tab-*` are not generated. A configuration that takes the whole shipped file instead of the keys "Tailwind" lists, such as `merge(require('@voicenter-team/voicenter-ui-plus/tailwind.config'), ownConfig)` with lodash `merge`, has only the roles, `none` and `full`. `borderRadius: require('tailwindcss/defaultTheme').borderRadius` in its own `theme` brings Tailwind's scale back beside the roles, since `merge` joins the two objects. With it `rounded-sm` is 0.125rem (3.x: 0.25rem; `rounded` is the 0.25rem one), and `rounded-2xl` and `rounded-3xl` are generated, which 3.x did not generate. An application with a `theme.borderRadius` of its own (a copy of the 3.x scale) removes it, takes the roles through `extend.borderRadius` and moves its `rounded-*` classes to the roles ([Corners](#corners)) |
|
|
572
591
|
| The font keys of the shipped `tailwind.config.js` and the font classes of the library stylesheet | `main`, `rubik`, `inter` and `heebo`, all four Rubik | `main` only: `font-inter`, `font-heebo` and `font-rubik` are removed; replace them with `font-main`. `@apply font-inter` (or `font-heebo`, `font-rubik`) and `theme('fontFamily.inter')` fail the build. In a template the class is not generated, and text without it inherits whatever font its container sets, so the class is replaced rather than dropped |
|
|
573
|
-
| The component colours `primary-alternative` and `active`: the value of `color` and of any prop that takes a component colour (`prefixIconColor`, `tagColor`, `buttonColor`, `filledColor`, `confirmActionColor`, the `colorKey` of an option) | `primary-alternative` drew a colour of its own, `active` drew `active-elements` | removed: `componentColors` and `COMPONENT_COLOR_TYPE` no longer list them, and no class is generated for them. A project replaces every `primary-alternative` with `primary`, and every `active` given as a colour (`color="active"`, `prefix-icon-color="active"`) with `primary`: both draw the brand colour. A style that targets their colour classes (`vc-button-color--primary-alternative`, `vc-input--active`, `vc-switch-color-active`, …) targets the `primary` class |
|
|
592
|
+
| The component colours `primary-alternative` and `active`: the value of `color` and of any prop that takes a component colour (`prefixIconColor`, `tagColor`, `buttonColor`, `filledColor`, `confirmActionColor`, the `colorKey` of an option) | `primary-alternative` drew a colour of its own, `active` drew `active-elements` | removed: `componentColors` and `COMPONENT_COLOR_TYPE` no longer list them, and no class is generated for them. A project replaces every `primary-alternative` with `primary`, and every `active` given as a colour (`color="active"`, `prefix-icon-color="active"`) with `primary`: both draw the brand colour, and 4.x has no second accent colour. A style that targets their colour classes (`vc-button-color--primary-alternative`, `vc-input--active`, `vc-switch-color-active`, …) targets the `primary` class |
|
|
574
593
|
| The default `color` of VcInput, VcAutocomplete, VcPhoneInput, VcOtpInput, VcTimeInput, VcTagInput, VcSwitch and VcExtendedDatetimeRangePicker; `DEFAULT_COLOR` | `'active'` | `'primary'` |
|
|
575
594
|
| `shadow-hover-outer-active`, `shadow-hover-outer-primary-alternative` | the hover glow of the `active` and `primary-alternative` colours | removed; `shadow-hover-outer-primary` |
|
|
576
595
|
| `shadow-hover-outer-destructive` | the hover glow of the `destructive` colour | `shadow-hover-outer-danger`: a glow class is named by its fill, as `bg-action-danger` |
|
|
@@ -578,7 +597,7 @@ The components draw Lucide icons (`@lucide/vue`) where 3.x drew the `vc-icon-*`
|
|
|
578
597
|
| The divider between VcViewSwitcher items | `secondary-actions` | `border` |
|
|
579
598
|
| `shadow-focus-outer`, `shadow-focus-outer-{primary,secondary,destructive,success,warning,info}`, `shadow-focus-{primary,secondary,destructive,success,warning}` | a focus glow in the colour the class names | removed; `shadow-focus`, the one focus ring, which has no colour of its own. A project whose Tailwind configuration defines these keys itself keeps them |
|
|
580
599
|
| `shadow-hover`, `shadow-hover-{primary,secondary,destructive,success,warning}` | a hover glow, outside and inside, in the colour the class names | removed: no component used them. `shadow-hover-inner`, `shadow-hover-outer`, `shadow-hover-outer-{colour}` and `shadow-hover-outer-off` stay. A project whose Tailwind configuration defines these keys itself keeps them |
|
|
581
|
-
| `tagBorderless` and `tagColor` of VcTagInput and VcTreeSelect | `false`, `'primary'` | `true`, `''`: a value is a borderless chip with no colour, neutral like a VcSelect multiple value (label and close icon `content-secondary`); set them for bordered, coloured tags. `tag-color="secondary"` draws the secondary colour, `action-secondary`, as on any other tag |
|
|
600
|
+
| `tagBorderless` and `tagColor` of VcTagInput and VcTreeSelect | `false`, `'primary'` | `true`, `''`: a value is a borderless chip with no colour, neutral like a VcSelect multiple value (label and close icon `content-secondary`); set them for bordered, coloured tags. `tag-color="secondary"` draws the secondary colour, `action-secondary`, as on any other tag. A 3.x `tag-color` alone now gives a borderless chip in that colour; `:tag-borderless="false"` brings back the 3.x bordered tag |
|
|
582
601
|
| `DEFAULT_ICON_SIZE`, the default `prefixIconSize` of VcInput, VcAutocomplete, VcPhoneInput and VcExtendedDatetimeRangePicker | `'sm'` | `''`: no size class, so the prefix icon follows the size of the field and is larger at the default size; `prefix-icon-size="sm"` keeps the 3.x size |
|
|
583
602
|
| `iconClass` of VcSoundPlayerMarker | `'icon-md'` | `'icon-xs'`: the icon sits on a filled circle of the marker colour |
|
|
584
603
|
| `borderRadius` of VcMeterGroup | `'6px'` | `'var(--vc-radius-inner)'`, the inner radius role |
|
|
@@ -603,7 +622,7 @@ The components draw Lucide icons (`@lucide/vue`) where 3.x drew the `vc-icon-*`
|
|
|
603
622
|
|
|
604
623
|
### AI chat components
|
|
605
624
|
|
|
606
|
-
4.x adds the components `VcAiReasoning`, `VcToolCall`, `VcApprovalCard`, `VcAskUserCard`, `VcAgentRunCard`, `VcAgentRunGroup`, `VcLightbox` and `VcPdfViewer` (their peers are in [Installation](#installation)). `VcMessage`, `VcMessagesWrapper`, `VcChatComposer` and `VcFileItem` gained props, slots and events for AI chats; existing usages render as before. What can need a change in an application:
|
|
625
|
+
4.x adds the components `VcAiReasoning`, `VcToolCall`, `VcApprovalCard`, `VcAskUserCard`, `VcAgentRunCard`, `VcAgentRunGroup`, `VcJsonViewer`, `VcLightbox` and `VcPdfViewer` (their peers are in [Installation](#installation)). `VcMessage`, `VcMessagesWrapper`, `VcChatComposer` and `VcFileItem` gained props, slots and events for AI chats; existing usages render as before. What can need a change in an application:
|
|
607
626
|
|
|
608
627
|
- **`@milkdown/*` must be `^7.22.0`** (was `^7.15.5`). With the `prosemirror-model` that npm resolves today (1.25.12), milkdown before 7.22.0 fails to parse lists (`RangeError: Expected value of type boolean for attribute spread`), and every list of a `VcMdEditor` disappears. A lockfile that still holds an older `prosemirror-model` hides the problem until the next fresh install.
|
|
609
628
|
- **`VcMdEditor` in `readonly` lays out its text by the text's own direction and treats it as untrusted.** Every paragraph, heading, list, quote, table and cell takes its direction from its own text instead of the page's (`<html dir>` at mount, or the direction button): English text in an RTL page now reads left to right, a Hebrew paragraph in an LTR page right to left, a block without letters follows the text around it, and code reads left to right. A link with a protocol other than http(s), mailto and tel loses its `href`, web links open in a new tab (`target="_blank" rel="noopener noreferrer"`), and the table handles are hidden. An editable editor is unchanged. New in `VcMdEditor`: `streaming` (throttled updates and a caret while an AI answer arrives) and `plain` (no field around the text, for bubbles and cards); `minHeight` takes the number `0` (it fell back to 400px, so callers passed the string `'0'`).
|
|
@@ -622,7 +641,7 @@ The components draw Lucide icons (`@lucide/vue`) where 3.x drew the `vc-icon-*`
|
|
|
622
641
|
- **The `actions` slot of `VcChatComposer` (3.4.8) is `toolbar-start`**, with the slot props `{ disabled, streaming }`; `toolbar-end` (new) sits right before Send / Stop.
|
|
623
642
|
- **`VcMessagesWrapper`'s `scrollToMessage` takes options**, as in 3.4.8: `scrollToMessage(id, 'auto')` of 3.4.7 and earlier becomes `scrollToMessage(id, { behavior: 'auto' })`, and `block` and `offset` place the message. It scrolls only the wrapper, not the page, and the view stays on the message while the list grows below it.
|
|
624
643
|
- **Exported types**: `VcFileItemProps` (with the new `errorText`), `VcChatComposerEmits`, and props / emits / slot-props / exposed interfaces of every new component.
|
|
625
|
-
- **Localization**: the library ships only `en`. An application with another locale adds the new
|
|
644
|
+
- **Localization**: the library ships only `en`. An application with another locale adds the keys new since 3.4.8 with `tVUManage.updateLocaleMessages`: `voicenterUi.jsonViewer.*`, `voicenterUi.aiChat.*`, `voicenterUi.lightbox.*`, `voicenterUi.aiReasoning.*`, `voicenterUi.toolCall.*`, `voicenterUi.approvalCard.*`, `voicenterUi.askUserCard.*`, `voicenterUi.agentRun.*`, `voicenterUi.agentRunGroup.*`, `voicenterUi.pdfViewer.*`, `voicenterUi.messagesWrapper.jumpToBottom`, `voicenterUi.message.download`, `voicenterUi.chatComposer.stop`, `voicenterUi.chatComposer.stopGenerating`, `voicenterUi.chatComposer.unsupportedFile`, `voicenterUi.fileItem.preview`, `voicenterUi.fileItem.remove` (English texts in `src/localization/locales/en.json`). An application on 3.4.7 or earlier also adds the keys of 3.4.8: `voicenterUi.message.video`, `voicenterUi.message.status.*`, `voicenterUi.messagesWrapper.newMessages`.
|
|
626
645
|
|
|
627
646
|
Fixes in the components 3.x had:
|
|
628
647
|
|
|
@@ -642,7 +661,7 @@ The installed package is the truth. Read it before saying what ui-plus has or ho
|
|
|
642
661
|
- **Composables, services, directives, the entity base**: `library/types/composables/`, `library/types/services/`, `library/types/directives/`, `library/types/entity/`.
|
|
643
662
|
- **Types**: prop, event and configuration types are exported from the package root (`import type { UIConfig } from '@voicenter-team/voicenter-ui-plus'`). Generic components take type parameters in the template: `<VcSelect<User, 'id', 'name'> v-model="selected" :options="users" value-key="id" label-key="name" />`.
|
|
644
663
|
- **Colour tokens**: `src/theme/themes.json` (each key is the CSS variable `--<key>`) and `src/theme/tailwindScheme.js` (the Tailwind colour names).
|
|
645
|
-
- **Examples**: the [live documentation](https://voicenter-ui.
|
|
664
|
+
- **Examples**: the [live documentation](https://voicenter-ui-plus.pages.dev/).
|
|
646
665
|
|
|
647
666
|
### Choosing a component
|
|
648
667
|
|
|
@@ -670,7 +689,7 @@ The installed package is the truth. Read it before saying what ui-plus has or ho
|
|
|
670
689
|
- `rounded-card`: cards, the outer frame of a table, modals;
|
|
671
690
|
- `rounded-tag`: tags and chips, drawn as a pill;
|
|
672
691
|
- `rounded-inner`: a part inside a control, popup or card (menu and list items, thumbnails and file icons, inline chips and labels, boxes inside editors and modals, checkbox boxes, colour-picker sliders, tree nodes, skeleton blocks, square tags).
|
|
673
|
-
- Besides the roles the shipped configuration has only `rounded-none` and `rounded-full` (a circle).
|
|
692
|
+
- Besides the roles the shipped configuration has only `rounded-none` and `rounded-full` (a circle). A role takes Tailwind's side and corner prefixes like any radius: `rounded-t-card`, `rounded-s-control`.
|
|
674
693
|
- Pixel radii and arbitrary classes such as `rounded-[6px]` stay out of application code. Such radii already in a project are not a precedent.
|
|
675
694
|
|
|
676
695
|
### Shadows
|
|
@@ -683,7 +702,7 @@ The installed package is the truth. Read it before saying what ui-plus has or ho
|
|
|
683
702
|
|
|
684
703
|
### Text
|
|
685
704
|
|
|
686
|
-
- Text keeps the library font, Rubik, which covers Latin and Hebrew: `font-main`, the one font key of the shipped configuration, set on `<html>`. The plugin (`app.use(VoicenterUI)`) loads it from Google Fonts. The tree-shake entry does not load it
|
|
705
|
+
- Text keeps the library font, Rubik, which covers Latin and Hebrew: `font-main`, the one font key of the shipped configuration, set on `<html>`. The plugin (`app.use(VoicenterUI)`) loads it from Google Fonts. The tree-shake entry does not load it, the stylesheet only names it: `loadTextFont()` loads it ([Tree-shake mode](#tree-shake-mode-recommended)). An application's own Tailwind preflight sets another font on `<html>` ([Tailwind](#tailwind)).
|
|
687
706
|
- Text takes three weights, classes of the shipped configuration ([Tailwind](#tailwind)) read from `--vc-font-weight-*`: `font-normal` (the page text), `font-medium` (table headers, `th`) and `font-semibold` (`b` and `strong`). The other weight classes keep their Tailwind values.
|
|
688
707
|
- `transition-weight` is for text whose weight changes with its state.
|
|
689
708
|
- Other font families and the weights `font-bold` and heavier stay out of application code. Such fonts and weights already in a project are not a precedent.
|
|
@@ -703,7 +722,7 @@ ui-plus follows the `dir` attribute of `<html>`: `useRTL()` reads it and updates
|
|
|
703
722
|
|
|
704
723
|
### AI chat
|
|
705
724
|
|
|
706
|
-
An AI chat is built from the chat components; their props, events and slots are in the installed types, and the [live documentation](https://voicenter-ui.
|
|
725
|
+
An AI chat is built from the chat components; their props, events and slots are in the installed types, and the [live documentation](https://voicenter-ui-plus.pages.dev/) has an example of each.
|
|
707
726
|
|
|
708
727
|
- The conversation: `VcMessagesWrapper` (its `message` slot renders one AI message from several parts, `hideHeader`, `busy`, the jump-to-latest button) with `VcMessage` (`variant="plain"` for the assistant, several content blocks, the `footer` slot for model / tokens / copy).
|
|
709
728
|
- Assistant text: `VcMdEditor` with `readonly hide-toolbar plain`, and `streaming` while it streams (the renderer of the `markdown` block of `VcMessage`). Reasoning: `VcAiReasoning`. Tool calls: `VcToolCall`. Human approval of a tool: `VcApprovalCard`. Questions the agent asks the user: `VcAskUserCard`. Sub-agents: `VcAgentRunCard` / `VcAgentRunGroup`.
|
|
@@ -994,7 +1013,7 @@ inconsistent component surface cannot reach `master`.
|
|
|
994
1013
|
## Documentation
|
|
995
1014
|
|
|
996
1015
|
### Live Documentation
|
|
997
|
-
Visit [documentation](https://voicenter-ui.
|
|
1016
|
+
Visit [documentation](https://voicenter-ui-plus.pages.dev/) for interactive component examples and demos.
|
|
998
1017
|
|
|
999
1018
|
## Project Documentation
|
|
1000
1019
|
For detailed technical documentation, see the [`docs/`](./docs/) directory:
|