@voicenter-team/voicenter-ui-plus 4.0.0-beta.4 → 4.0.0-beta.6
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 +116 -57
- package/library/assets/assets/sass/main.css +1 -1
- package/library/assets/components/VcAgentRun/UiComponents/VcAgentRunRow.css +1 -1
- package/library/assets/components/VcAgentRun/VcAgentRunCard.css +1 -1
- package/library/assets/components/VcAgentRun/VcAgentRunGroup.css +1 -1
- package/library/assets/components/VcApprovalCard/VcApprovalCard.css +1 -1
- package/library/assets/components/VcAskUserCard/VcAskUserCard.css +1 -1
- package/library/assets/components/VcAutocomplete/VcAutocomplete.css +1 -1
- package/library/assets/components/VcButton/VcButton.css +1 -1
- package/library/assets/components/VcButton/VcButtonIcon.css +1 -1
- package/library/assets/components/VcButton/VcToggleButton.css +1 -1
- package/library/assets/components/VcChatComposer/VcChatComposer.css +1 -1
- package/library/assets/components/VcCheckbox/VcCheckbox.css +1 -1
- package/library/assets/components/VcCodeBlock/VcCodeBlock.css +1 -1
- package/library/assets/components/VcCollapse/VcCollapseItem.css +1 -1
- package/library/assets/components/VcColorPicker/VcColorPicker.css +1 -1
- package/library/assets/components/VcDatePicker/VcDatePicker.css +1 -1
- package/library/assets/components/VcDatePickerPanel/VcDatePickerPanel.css +1 -1
- package/library/assets/components/VcDropdown/VcDropdownItem.css +1 -1
- package/library/assets/components/VcEmojiPicker/VcEmojiPicker.css +1 -1
- package/library/assets/components/VcExtendedDatetimeRangePicker/VcExtendedDatetimeRangePicker.css +1 -1
- package/library/assets/components/VcExtendedDatetimeRangePicker/VcExtendedDatetimeRangePickerQuickOptionsSelection.css +1 -1
- package/library/assets/components/VcFileUploader/VcFileItem.css +1 -1
- package/library/assets/components/VcFileUploader/VcFileUploaderArea.css +1 -1
- package/library/assets/components/VcFileUploader/VcFileUploaderSimple.css +1 -1
- package/library/assets/components/VcForm/UiComponents/VcInputLabel.css +1 -1
- package/library/assets/components/VcHyperLink/VcHyperLink.css +1 -1
- package/library/assets/components/VcImageUploader/VcImageUploader.css +1 -1
- package/library/assets/components/VcInput/VcInput.css +1 -1
- package/library/assets/components/VcInputNumber/VcInputNumber.css +1 -1
- package/library/assets/components/VcJsonSchema/Components/JsonCodeMirror.css +1 -1
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerAuto.css +1 -1
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerCards.css +1 -1
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerKey.css +1 -1
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerState.css +1 -1
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerValue.css +1 -1
- package/library/assets/components/VcJsonViewer/VcJsonViewer.css +1 -1
- package/library/assets/components/VcLightbox/VcLightbox.css +1 -1
- package/library/assets/components/VcMdEditor/ParameterNode.css +1 -1
- package/library/assets/components/VcMdEditor/VcMdEditorContent.css +1 -1
- package/library/assets/components/VcMessage/VcMessage.css +1 -1
- package/library/assets/components/VcMessage/reactions/VcMessageReactionBar.css +1 -1
- package/library/assets/components/VcOtpInput/VcOtpInput.css +1 -1
- package/library/assets/components/VcPdfViewer/VcPdfDocumentViewerFooter.css +1 -1
- package/library/assets/components/VcRadio/VcRadio.css +1 -1
- package/library/assets/components/VcRadioButtons/VcRadioButtonsGroup.css +1 -1
- package/library/assets/components/VcRadioTabs/UiComponents/VcRadioTabsNav.css +1 -1
- package/library/assets/components/VcRadioTabs/VcRadioTabs.css +1 -1
- package/library/assets/components/VcSegmented/VcSegmented.css +1 -1
- package/library/assets/components/VcSelect/VcSelect.css +1 -1
- package/library/assets/components/VcSelect/VcSelectOption.css +1 -1
- package/library/assets/components/VcSipFlow/VcSipFlow.css +1 -1
- package/library/assets/components/VcSoundplayer/VcPlayerPlaybackRate.css +1 -1
- package/library/assets/components/VcSoundplayer/VcSoundPlayerMarker.css +1 -1
- package/library/assets/components/VcSplitButton/VcSplitButton.css +1 -1
- package/library/assets/components/VcSwitch/VcSwitch.css +1 -1
- package/library/assets/components/VcTable/VcTable.css +1 -1
- package/library/assets/components/VcTabs/VcTabNav.css +1 -1
- package/library/assets/components/VcTag/VcTag.css +1 -1
- package/library/assets/components/VcTagInput/VcTagInput.css +1 -1
- package/library/assets/components/VcToolCall/VcToolCall.css +1 -1
- package/library/assets/components/VcTour/VcTour.css +1 -1
- package/library/assets/components/VcTransfer/VcTransfer.css +1 -1
- package/library/assets/components/VcTree/VcTreeSelect.css +1 -1
- package/library/assets/components/VcVerticalTabs/VcVerticalTabs.css +1 -1
- package/library/assets/components/VcVerticalTabs/VerticalTabNav.css +1 -1
- package/library/assets/entity/components/Tabs/VcEntityEditableTabs.css +1 -1
- package/library/assets/node_modules/element-plus/theme-chalk/src/tree.css +1 -1
- package/library/components/VcDatePicker/VcDatePicker.vue.mjs +1 -1
- package/library/components/VcExcelUploader/VcExcelFileProcessLoader.vue.mjs +1 -1
- package/library/components/VcExcelUploader/VcExcelFileUploadBlock.vue.mjs +1 -1
- package/library/components/VcExcelUploader/VcFileImportErrorsCard.vue.mjs +2 -2
- package/library/components/VcExcelUploader/VcFileImportParseResultBlock.vue.mjs +4 -4
- package/library/components/VcExcelUploader/VcFileImportResultBindDataTable.vue.mjs +0 -1
- package/library/components/VcExtendedDatetimeRangePicker/VcExtendedDatetimeRangePicker.vue.mjs +2 -2
- package/library/components/VcHtmlEditor/VcHtmlEditor.vue.mjs +1 -1
- package/library/components/VcIconPicker/VcIconPicker.vue.mjs +2 -2
- package/library/components/VcImageUploader/VcImageUploader.vue.mjs +4 -4
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerSections.vue.mjs +9 -4
- package/library/components/VcMdEditor/ParameterNode.vue.mjs +1 -1
- package/library/components/VcMdEditor/ParameterNode.vue2.mjs +1 -1
- package/library/components/VcMdEditor/VcMdEditor.vue.mjs +1 -1
- package/library/components/VcPdfViewer/VcPdfDocumentCard.vue.mjs +3 -3
- package/library/components/VcPdfViewer/VcPdfDocumentViewerFooter.vue.mjs +2 -2
- package/library/components/VcPdfViewer/VcPdfDocumentViewerToolbar.vue.mjs +4 -4
- package/library/components/VcSegmented/VcSegmented.vue.mjs +88 -41
- package/library/components/VcSelect/VcInfiniteScrollSelect.vue.mjs +1 -1
- package/library/components/VcSipFlow/VcSipFlow.vue.mjs +1 -3
- package/library/components/VcSoundplayer/VcPlayerPlayStopButton.vue.mjs +4 -4
- package/library/components/VcSoundplayer/VcPlayerPlaybackRate.vue.mjs +1 -1
- package/library/components/VcSoundplayer/VcPlayerPlaybackRatePopup.vue.mjs +2 -2
- package/library/components/VcSoundplayer/VcPlayerSkipButtons.vue.mjs +2 -2
- package/library/components/VcSoundplayer/VcSoundPlayer.vue.mjs +2 -2
- package/library/components/VcSoundplayer/VcSoundPlayerMarker.vue.mjs +1 -1
- package/library/components/VcSoundplayer/VcSoundVolume.vue.mjs +2 -2
- package/library/components/VcSoundplayer/player.options.mjs +2 -2
- package/library/components/VcTable/VcTable.vue.mjs +5 -8
- package/library/components/VcTabs/VcTabNav.vue.mjs +45 -32
- package/library/components/VcTabs/VcTabPane.vue.mjs +12 -3
- package/library/components/VcTour/VcTour.vue.mjs +104 -16
- package/library/components/VcTree/VcTree.vue.mjs +1 -1
- package/library/components/VcTree/VcTreeSelect.vue.mjs +1 -1
- package/library/components/VcWizard/VcSummaryProgress.vue.mjs +1 -1
- package/library/components/VcWizard/VcSummaryStep.vue.mjs +3 -3
- package/library/components/VcWizard/VcWizard.vue.mjs +2 -16
- package/library/entity/components/Form/VcEntityVerticalEditForm.vue.mjs +6 -10
- package/library/entity/components/Table/VcEntityListTable.vue.mjs +1 -2
- package/library/entity/components/Tabs/VcEntityEditableTabs.vue.mjs +51 -7
- package/library/font/index.mjs +1 -1
- package/library/index.mjs +49 -52
- package/library/index.mjs.br +0 -0
- package/library/index.mjs.gz +0 -0
- package/library/plugin-components.gen.mjs +133 -136
- package/library/plugin.mjs +49 -52
- package/library/plugin.mjs.br +0 -0
- package/library/plugin.mjs.gz +0 -0
- package/library/style.css +67 -71
- package/library/style.css.br +0 -0
- package/library/style.css.gz +0 -0
- package/library/theme/index.mjs +1 -1
- package/library/theme/index.mjs.br +0 -0
- package/library/theme/index.mjs.gz +0 -0
- package/library/theme/themeMerge.mjs +2 -0
- package/library/theme/themes.json.mjs +33 -144
- package/library/types/components/VcApprovalCard/VcApprovalCard.vue.d.ts +1 -1
- package/library/types/components/VcButton/VcToggleButton.vue.d.ts +1 -1
- package/library/types/components/VcCheckbox/VcCheckboxButtonGroup.vue.d.ts +3 -3
- package/library/types/components/VcCheckboxGroup/VcCheckboxGroup.vue.d.ts +3 -3
- package/library/types/components/VcMdEditor/VcMdEditor.vue.d.ts +1 -1
- package/library/types/components/VcMessage/VcMessage.vue.d.ts +1 -1
- package/library/types/components/VcSegmented/VcSegmented.vue.d.ts +25 -16
- package/library/types/components/VcSelect/VcSelect.vue.d.ts +3 -3
- package/library/types/components/VcTable/VcTable.vue.d.ts +22 -22
- package/library/types/components/VcTabs/VcTabPane.vue.d.ts +8 -0
- package/library/types/components/VcTabs/VcTabs.vue.d.ts +2 -0
- package/library/types/components/VcTag/VcTag.vue.d.ts +1 -1
- package/library/types/components/VcToolCall/VcToolCall.vue.d.ts +1 -1
- package/library/types/components/exports.d.ts +3 -5
- package/library/types/components.gen.d.ts +1 -2
- package/library/types/entity/components/Tabs/VcEntityEditableTabs.vue.d.ts +14 -8
- package/library/types/theme/themes.json.d.ts +31 -136
- package/library/types/types/ExcelParser.types.d.ts +0 -7
- package/library/types/types/Tabs.d.ts +16 -0
- package/library/types/types/VcDatetimeRangePicker.types.d.ts +0 -19
- package/library/types/types/VcTable.types.d.ts +5 -0
- package/library/types/types/VcTabs.types.d.ts +1 -0
- package/library/types/types/VcWizard.types.d.ts +0 -4
- package/library/utils/jsonSchema/jsonSchemaHelpers.mjs +1 -1
- package/library/utils/lucideIcon.mjs +1 -1
- package/package.json +2 -2
- package/src/theme/index.ts +101 -101
- package/src/theme/tailwindScheme.js +10 -2
- package/src/theme/theme.types.ts +31 -31
- package/src/theme/themeMerge.ts +2 -0
- package/src/theme/themes.json +31 -136
- package/tailwind.config.d.ts +5 -5
- package/tailwind.config.js +2 -0
- package/library/assets/components/VcDatetimeRangePicker/VcDatetimeRangePicker.css +0 -1
- package/library/assets/components/VcViewSwitcher/VcViewSwitcher.css +0 -1
- package/library/components/VcDatetimeRangePicker/VcDatetimeRangePicker.vue.mjs +0 -24
- package/library/components/VcDatetimeRangePicker/VcDatetimeRangePicker.vue3.mjs +0 -5
- package/library/components/VcViewSwitcher/VcViewSwitcher.vue.mjs +0 -86
- package/library/components/VcViewSwitcher/VcViewSwitcher.vue3.mjs +0 -5
- package/library/types/components/VcDatetimeRangePicker/VcDatetimeRangePicker.vue.d.ts +0 -2
- package/library/types/components/VcViewSwitcher/VcViewSwitcher.vue.d.ts +0 -74
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.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).
|
|
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); one already on a 4.0 beta follows [Upgrading from a 4.0 beta](#upgrading-from-a-40-beta).
|
|
5
5
|
|
|
6
6
|
## Installation
|
|
7
7
|
|
|
@@ -41,14 +41,14 @@ import { VcButton, VcInput } from '@voicenter-team/voicenter-ui-plus'
|
|
|
41
41
|
```
|
|
42
42
|
Bundlers drop unused components and their CSS. A consumer importing only `VcButton` ships ~50–150 KB JS + ~10–30 KB CSS.
|
|
43
43
|
|
|
44
|
-
The stylesheet sets the default theme (
|
|
44
|
+
The stylesheet sets the default theme (voicenter) on `:root`. Another theme and the text font are two calls, the ones the plugin makes itself:
|
|
45
45
|
|
|
46
46
|
```ts
|
|
47
47
|
import Theme from '@voicenter-team/voicenter-ui-plus/theme'
|
|
48
48
|
import { loadTextFont } from '@voicenter-team/voicenter-ui-plus/font'
|
|
49
49
|
|
|
50
50
|
Theme({ type: 'local', themeName: 'voicenter' }) // any themeConfig, see "Theming specification"
|
|
51
|
-
loadTextFont() // Rubik from Google Fonts
|
|
51
|
+
loadTextFont() // Rubik and DM Mono from Google Fonts
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
If you use `useConfirmModal`, `useConfirmPopup`, or `NotifyService`, mount global overlays in `App.vue`:
|
|
@@ -165,23 +165,23 @@ The `themeConfig` passed to `app.use(VoicenterUI, { themeConfig })`, or to `Them
|
|
|
165
165
|
|
|
166
166
|
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:
|
|
167
167
|
|
|
168
|
-
- `vc-content-*`: text and icons (`primary`, `secondary`, `tertiary`, `disabled`, `success`, `warning`, `danger`, `info`);
|
|
168
|
+
- `vc-content-*`: text and icons (`primary`, `secondary`, `tertiary`, `disabled`, `success`, `warning`, `danger`, `info`); `warning` colours warning text and icons alike; `vc-content-brand` is brand-coloured text and icons (links, active tabs, the text of `primary` outline and borderless buttons), a deeper red than the brand fill (set by voicenter and voicenterDark; a theme that does not set it takes its `vc-action-primary`);
|
|
169
169
|
- `vc-bg-*`: backgrounds (`page`, `surface`, `inset`, `inset-strong`, `field`, `muted`, `overlay`);
|
|
170
170
|
- `vc-action-*`: fills of interactive elements (`primary`, `secondary`, `info`, `success`, `warning`, `danger`);
|
|
171
171
|
- `vc-onfill` and `vc-onfill-{fill}`: text on a solid fill. Every built-in theme sets `vc-onfill-primary` and `vc-onfill-warning`; `vc-onfill-secondary`, `vc-onfill-info`, `vc-onfill-success` and `vc-onfill-danger` are optional, and a fill whose key is not set takes `vc-onfill`;
|
|
172
172
|
- `vc-border`, `vc-border-strong`, `vc-input` (field borders), `vc-ring` (focus ring), `vc-shadow-color`;
|
|
173
|
-
- `vc-mix-anchor` and `vc-mix-anchor-{fill}`: the colour hover and pressed states are mixed toward (black darkens, white lightens). Any fill can have its own anchor: a fill whose `vc-mix-anchor-{fill}` key is not set mixes toward `vc-mix-anchor`. Every built-in theme sets `vc-mix-anchor-primary` and `vc-mix-anchor-warning`, the two fills with their own text colour.
|
|
173
|
+
- `vc-mix-anchor` and `vc-mix-anchor-{fill}`: the colour the hover and pressed states of a fill are mixed toward (black darkens, white lightens). Any fill can have its own anchor: a fill whose `vc-mix-anchor-{fill}` key is not set mixes toward `vc-mix-anchor`. Every built-in theme sets `vc-mix-anchor-primary` and `vc-mix-anchor-warning`, the two fills with their own text colour. Coloured text (links, outline and borderless buttons) has no anchor key: its hover and pressed states mix toward `vc-content-primary`, so they darken on a light theme and lighten on a dark one.
|
|
174
174
|
|
|
175
175
|
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.
|
|
176
176
|
|
|
177
|
-
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 (
|
|
177
|
+
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 (voicenter) 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).
|
|
178
178
|
|
|
179
179
|
### Local
|
|
180
180
|
**Config:**
|
|
181
181
|
```js
|
|
182
182
|
{
|
|
183
183
|
type: 'local'
|
|
184
|
-
themeName: 'voicenter' | '
|
|
184
|
+
themeName: 'voicenter' | 'voicenterDark'
|
|
185
185
|
onSetupCallback: () => {
|
|
186
186
|
console.log('Loaded!')
|
|
187
187
|
}
|
|
@@ -193,7 +193,8 @@ Such configuration will append to the document element the CSS variables from on
|
|
|
193
193
|
|
|
194
194
|
**Params:**
|
|
195
195
|
- **themeName**
|
|
196
|
-
- The name of the theme to be injected. `
|
|
196
|
+
- The name of the theme to be injected. `voicenter` is the default (it is also used when no `themeConfig` is passed); `voicenterDark` is the dark theme. An unknown name logs a warning and keeps the default.
|
|
197
|
+
- `voicenterDark` is the dark counterpart of `voicenter`. Its fills are deep enough for white text on every one of them (`vc-onfill`, `vc-onfill-primary` and `vc-onfill-warning` are white), and their hover and pressed states darken (`vc-mix-anchor` is black). Coloured text never reads a fill: it takes the `content-*` keys and `vc-content-brand`, which are lighter than the fills, and gets lighter still on hover and press.
|
|
197
198
|
- **onSetupCallback**
|
|
198
199
|
- 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
|
|
199
200
|
|
|
@@ -259,10 +260,20 @@ Such configuration will initiate the styling with custom provided theme
|
|
|
259
260
|
|
|
260
261
|
- **Colours** are named by their role, and a theme sets only the base colours: the hover, pressed, disabled and tinted states are mixed from them by the library, with one formula for every colour. The 3.x colour names are gone. Details: [Colour names](#colour-names), [CSS variables](#css-variables), [Tailwind colour classes](#tailwind-colour-classes), [Theme keys](#theme-keys) and [Finding the 3.x names](#finding-the-3x-names).
|
|
261
262
|
- **Icons** are Lucide (`@lucide/vue`), the icons of the 4.0 design, where 3.x drew the `vc-icon-*` font. An icon prop still takes a `vc-icon-*` class. Details: [Icons](#icons).
|
|
262
|
-
- **Corners** take one of
|
|
263
|
+
- **Corners** take one of six radius roles, `control`, `control-sm`, `popup`, `card`, `tag` and `inner`, each a CSS variable (`--vc-radius-control`) and a class of the shipped Tailwind configuration (`rounded-control`). They replace the 3.x radius scale and `--base-border-radius`. The classes read the variables the library stylesheet sets, so a corner drawn with them changes together with the library. Details: [Corners](#corners) and [Styles and component defaults](#styles-and-component-defaults).
|
|
263
264
|
- **Text** has one font key, `main`, which names the role rather than the font, so a font change keeps the class; `font-inter`, `font-heebo` and `font-rubik`, which all drew Rubik, are gone. It takes three weights, `font-normal`, `font-medium` and `font-semibold` (`--vc-font-weight-*`): Rubik is a variable font whose stock weights read heavy, so the first two are lighter than in 3.x. Details: [Text](#text) and [Styles and component defaults](#styles-and-component-defaults).
|
|
264
265
|
- **Focus** is one ring, `shadow-focus` (`shadow-focus-inner` draws it inside), in the theme's `vc-ring` colour. The colour-named focus classes are gone: they all drew that one ring, whatever colour the name gave. Details: [Shadows](#shadows) and [Styles and component defaults](#styles-and-component-defaults).
|
|
265
266
|
- **Component defaults**: the fields default to `primary`, and the colours `primary-alternative` and `active` are gone, since both drew the brand colour, as `primary` does. VcTagInput and VcTreeSelect show their values as the muted chips of a multiple VcSelect, a field's prefix icon follows the size of the field, and the close and copy controls of modals, notifications and code blocks are a VcButtonIcon, with the size, radius and hover of the library's controls. Details: [Styles and component defaults](#styles-and-component-defaults).
|
|
267
|
+
- **Themes**: 4.x has two built-in themes, the light `voicenter` (the default) and the dark `voicenterDark`, so the `themeName` of the application's `themeConfig` changes:
|
|
268
|
+
|
|
269
|
+
| `themeName` in 3.x | 4.x |
|
|
270
|
+
| --- | --- |
|
|
271
|
+
| `voicenterRed` | `voicenter`: the same theme under its 4.x name |
|
|
272
|
+
| `redGreen` (the 3.x default), `red`, `blue` | `voicenter`; an application that has to keep those colours passes them as a `customJson` theme ([Theming specification](#theming-specification)) |
|
|
273
|
+
| `black` | `voicenterDark` |
|
|
274
|
+
| no `themeConfig` | nothing to change: the application is drawn in `voicenter`, where 3.x drew `redGreen` |
|
|
275
|
+
|
|
276
|
+
A 3.x name left in `themeName` does not fail: it logs `No such theme` in the console and the application is drawn in `voicenter`. Search for it (`grep -rnE "themeName|voicenterRed|redGreen" src`), and for code that switches themes by name, such as a dark-mode toggle. The stylesheet sets the default theme on `:root`.
|
|
266
277
|
- **Optional peers**: 3.x installed every peer dependency together with the library. 4.x marks the packages that only some components need optional, and npm does not install them. An application adds to its `dependencies` the packages the documentation page of each component it renders lists ([Optional peers](#optional-peers)), then runs the application: a component whose package is missing fails when it needs it, with the message given there. Also: an application that listed uninstalled peers in `build.rollupOptions.external` removes those entries; a component now renders before its package arrives (plain code, an empty editor area, an empty composer line), so an application test that asserts right after `mount` awaits `flushPromises()` first; an application whose markdown shows math adds KaTeX's stylesheet itself (see there).
|
|
267
278
|
- **Removed**: besides the names above, the theme `blue`, which no application on 3.x selects (only applications still on 0.x do), and the classes of the native close controls. The sections below give what replaces each removed name.
|
|
268
279
|
|
|
@@ -291,9 +302,9 @@ Some 3.x names had a value of their own in the built-in themes and now share a t
|
|
|
291
302
|
- `scrollbar-track`, `scrollbar-thumb` and `scrollbar-thumb-hover` were fixed greys in red, redGreen and black; they are `bg-surface`, `border` and `content-disabled`, so the scrollbar follows the theme.
|
|
292
303
|
- `destructive` and `error` were two colours in redGreen and black; both are `action-danger`.
|
|
293
304
|
|
|
294
|
-
Some names keep their meaning but have a new value in
|
|
305
|
+
Some names keep their meaning but have a new value in voicenter (3.x `voicenterRed`): `destructive`, `error`, `success`, `warning` and `actions-mix-color`, and the `secondary` fill (#4A607A, a darker grey; `secondary` text is `content-secondary`); the `primary` text in voicenter is #C20027 (`content-brand`), a deeper red than the #E80130 fill.
|
|
295
306
|
|
|
296
|
-
For the brand colour, use `action-primary
|
|
307
|
+
For the brand colour, use `action-primary` for fills and `content-brand` for text and icons.
|
|
297
308
|
|
|
298
309
|
### CSS variables
|
|
299
310
|
|
|
@@ -330,22 +341,22 @@ For the brand colour, use `action-primary`.
|
|
|
330
341
|
| `--card-shadow-color` | `color-mix(in srgb, var(--vc-shadow-color) 12%, transparent)` |
|
|
331
342
|
| `--table-shadow-color` | `color-mix(in srgb, var(--vc-shadow-color) 7%, transparent)` |
|
|
332
343
|
| `--actions-mix-color` | `var(--vc-mix-anchor)` |
|
|
333
|
-
| `--primary` | `var(--vc-action-primary)` |
|
|
334
|
-
| `--primary-actions` | `var(--vc-action-primary)` |
|
|
335
|
-
| `--primary-actions--focus` | `var(--vc-action-primary--hover)` |
|
|
336
|
-
| `--primary-actions--pressed` | `var(--vc-action-primary--pressed)` |
|
|
344
|
+
| `--primary` | `var(--vc-action-primary)` (fills); `var(--vc-content-brand)` (text) |
|
|
345
|
+
| `--primary-actions` | `var(--vc-action-primary)` (fills); `var(--vc-content-brand)` (text) |
|
|
346
|
+
| `--primary-actions--focus` | `var(--vc-action-primary--hover)` (fills); `var(--vc-content-brand--hover)` (text) |
|
|
347
|
+
| `--primary-actions--pressed` | `var(--vc-action-primary--pressed)` (fills); `var(--vc-content-brand--pressed)` (text) |
|
|
337
348
|
| `--primary-actions-bg--focus` | `var(--vc-action-primary--subtle-hover)` |
|
|
338
349
|
| `--primary-actions-bg--pressed` | `var(--vc-action-primary--subtle-pressed)` |
|
|
339
|
-
| `--primary-alternative` | `var(--vc-action-primary)` |
|
|
340
|
-
| `--primary-alternative-actions` | `var(--vc-action-primary)` |
|
|
341
|
-
| `--primary-alternative-actions--focus` | `var(--vc-action-primary--hover)` |
|
|
342
|
-
| `--primary-alternative-actions--pressed` | `var(--vc-action-primary--pressed)` |
|
|
350
|
+
| `--primary-alternative` | `var(--vc-action-primary)` (fills); `var(--vc-content-brand)` (text) |
|
|
351
|
+
| `--primary-alternative-actions` | `var(--vc-action-primary)` (fills); `var(--vc-content-brand)` (text) |
|
|
352
|
+
| `--primary-alternative-actions--focus` | `var(--vc-action-primary--hover)` (fills); `var(--vc-content-brand--hover)` (text) |
|
|
353
|
+
| `--primary-alternative-actions--pressed` | `var(--vc-action-primary--pressed)` (fills); `var(--vc-content-brand--pressed)` (text) |
|
|
343
354
|
| `--primary-alternative-actions-bg--focus` | `var(--vc-action-primary--subtle-hover)` |
|
|
344
355
|
| `--primary-alternative-actions-bg--pressed` | `var(--vc-action-primary--subtle-pressed)` |
|
|
345
|
-
| `--secondary` | `var(--vc-action-secondary)` |
|
|
346
|
-
| `--secondary-actions` | `var(--vc-action-secondary)` |
|
|
347
|
-
| `--secondary-actions--focus` | `var(--vc-action-secondary--hover)` |
|
|
348
|
-
| `--secondary-actions--pressed` | `var(--vc-action-secondary--pressed)` |
|
|
356
|
+
| `--secondary` | `var(--vc-action-secondary)` (fills, borders); `var(--vc-content-secondary)` (text) |
|
|
357
|
+
| `--secondary-actions` | `var(--vc-action-secondary)` (fills, borders); `var(--vc-content-secondary)` (text) |
|
|
358
|
+
| `--secondary-actions--focus` | `var(--vc-action-secondary--hover)` (fills); `var(--vc-content-secondary--hover)` (text) |
|
|
359
|
+
| `--secondary-actions--pressed` | `var(--vc-action-secondary--pressed)` (fills); `var(--vc-content-secondary--pressed)` (text) |
|
|
349
360
|
| `--secondary-actions-bg--focus` | `var(--vc-action-secondary--subtle-hover)` |
|
|
350
361
|
| `--secondary-actions-bg--pressed` | `var(--vc-action-secondary--subtle-pressed)` |
|
|
351
362
|
| `--destructive` | `var(--vc-action-danger)` (fills); `var(--vc-content-danger)` (text) |
|
|
@@ -372,9 +383,9 @@ For the brand colour, use `action-primary`.
|
|
|
372
383
|
| `--warning-actions--pressed` | `var(--vc-action-warning--pressed)` |
|
|
373
384
|
| `--warning-actions-bg--focus` | `var(--vc-action-warning--subtle-hover)` |
|
|
374
385
|
| `--warning-actions-bg--pressed` | `var(--vc-action-warning--subtle-pressed)` |
|
|
375
|
-
| `--active-elements` | `var(--vc-action-primary)` |
|
|
376
|
-
| `--active-elements--focus` | `var(--vc-action-primary--hover)` |
|
|
377
|
-
| `--active-elements--pressed` | `var(--vc-action-primary--pressed)` |
|
|
386
|
+
| `--active-elements` | `var(--vc-action-primary)` (fills); `var(--vc-content-brand)` (text) |
|
|
387
|
+
| `--active-elements--focus` | `var(--vc-action-primary--hover)` (fills); `var(--vc-content-brand--hover)` (text) |
|
|
388
|
+
| `--active-elements--pressed` | `var(--vc-action-primary--pressed)` (fills); `var(--vc-content-brand--pressed)` (text) |
|
|
378
389
|
| `--active-elements-bg--focus` | `var(--vc-action-primary--subtle-hover)` |
|
|
379
390
|
| `--active-elements-bg--pressed` | `var(--vc-action-primary--subtle-pressed)` |
|
|
380
391
|
| `--inactive-elements--focus` | `color-mix(in srgb, var(--vc-content-disabled) 80%, var(--vc-mix-anchor))` |
|
|
@@ -387,9 +398,9 @@ For the brand colour, use `action-primary`.
|
|
|
387
398
|
|
|
388
399
|
A colour name works the same after every colour prefix (`text-`, `bg-`, `border-`, `ring-`, `fill-`, `stroke-`, `divide-`, `outline-`, `placeholder-`, …) and with every variant: `text-default-text` becomes `text-content-primary`, `hover:bg-primary-actions-bg--focus` becomes `hover:bg-action-primary-subtle-hover`, `border-ui-lines` becomes `border-border`.
|
|
389
400
|
|
|
390
|
-
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
|
|
401
|
+
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 draws success and warning text and icons darker than the fill.
|
|
391
402
|
|
|
392
|
-
`primary` and `secondary` are not status colours
|
|
403
|
+
`primary` and `secondary` are not status colours. Text and icons in `primary` (links, active tabs, outline and borderless buttons) take `var(--vc-content-brand)`, a deeper red than the `bg-action-primary` fill, with `var(--vc-content-brand--hover)` and `var(--vc-content-brand--pressed)`. Text and icons in `secondary` take `var(--vc-content-secondary)`, with `var(--vc-content-secondary--hover)` and `var(--vc-content-secondary--pressed)`; the border of an outline button is its text colour. The shipped Tailwind scheme has them as classes: `text-content-brand` with `-hover` and `-pressed`, and `text-content-secondary` with `-hover`. `content-secondary` is the 3.x `secondary-text`, a grey.
|
|
393
404
|
|
|
394
405
|
| 3.x colour name | 4.x colour name |
|
|
395
406
|
| --- | --- |
|
|
@@ -424,22 +435,22 @@ Text and icons in a status colour take the `content` name (`text-content-danger`
|
|
|
424
435
|
| `card-shadow-color` | no class; the `shadow-card` and `shadow-table` classes carry it |
|
|
425
436
|
| `table-shadow-color` | no class; the `shadow-table-row` and `shadow-table-header` classes carry it |
|
|
426
437
|
| `actions-mix-color` | no class |
|
|
427
|
-
| `primary` | `action-primary` |
|
|
428
|
-
| `primary-actions` | `action-primary` |
|
|
429
|
-
| `primary-actions--focus` | `action-primary-hover` |
|
|
430
|
-
| `primary-actions--pressed` | `action-primary-pressed` |
|
|
438
|
+
| `primary` | `action-primary` (fills); `content-brand` (text) |
|
|
439
|
+
| `primary-actions` | `action-primary` (fills); `content-brand` (text) |
|
|
440
|
+
| `primary-actions--focus` | `action-primary-hover` (fills); `content-brand-hover` (text) |
|
|
441
|
+
| `primary-actions--pressed` | `action-primary-pressed` (fills); `content-brand-pressed` (text) |
|
|
431
442
|
| `primary-actions-bg--focus` | `action-primary-subtle-hover` |
|
|
432
443
|
| `primary-actions-bg--pressed` | `action-primary-subtle-pressed` |
|
|
433
|
-
| `primary-alternative` | `action-primary` |
|
|
434
|
-
| `primary-alternative-actions` | `action-primary` |
|
|
435
|
-
| `primary-alternative-actions--focus` | `action-primary-hover` |
|
|
436
|
-
| `primary-alternative-actions--pressed` | `action-primary-pressed` |
|
|
444
|
+
| `primary-alternative` | `action-primary` (fills); `content-brand` (text) |
|
|
445
|
+
| `primary-alternative-actions` | `action-primary` (fills); `content-brand` (text) |
|
|
446
|
+
| `primary-alternative-actions--focus` | `action-primary-hover` (fills); `content-brand-hover` (text) |
|
|
447
|
+
| `primary-alternative-actions--pressed` | `action-primary-pressed` (fills); `content-brand-pressed` (text) |
|
|
437
448
|
| `primary-alternative-actions-bg--focus` | `action-primary-subtle-hover` |
|
|
438
449
|
| `primary-alternative-actions-bg--pressed` | `action-primary-subtle-pressed` |
|
|
439
|
-
| `secondary` | `action-secondary` |
|
|
440
|
-
| `secondary-actions` | `action-secondary` |
|
|
441
|
-
| `secondary-actions--focus` | `action-secondary-hover` |
|
|
442
|
-
| `secondary-actions--pressed` | `action-secondary-pressed` |
|
|
450
|
+
| `secondary` | `action-secondary` (fills, borders); `content-secondary` (text) |
|
|
451
|
+
| `secondary-actions` | `action-secondary` (fills, borders); `content-secondary` (text) |
|
|
452
|
+
| `secondary-actions--focus` | `action-secondary-hover` (fills); `content-secondary-hover` (text) |
|
|
453
|
+
| `secondary-actions--pressed` | `action-secondary-pressed` (fills); `var(--vc-content-secondary--pressed)` in a style (text) |
|
|
443
454
|
| `secondary-actions-bg--focus` | `action-secondary-subtle-hover` |
|
|
444
455
|
| `secondary-actions-bg--pressed` | `action-secondary-subtle-pressed` |
|
|
445
456
|
| `destructive` | `action-danger` (fills); `content-danger` (text) |
|
|
@@ -466,9 +477,9 @@ Text and icons in a status colour take the `content` name (`text-content-danger`
|
|
|
466
477
|
| `warning-actions--pressed` | `action-warning-pressed` |
|
|
467
478
|
| `warning-actions-bg--focus` | `action-warning-subtle-hover` |
|
|
468
479
|
| `warning-actions-bg--pressed` | `action-warning-subtle-pressed` |
|
|
469
|
-
| `active-elements` | `action-primary` |
|
|
470
|
-
| `active-elements--focus` | `action-primary-hover` |
|
|
471
|
-
| `active-elements--pressed` | `action-primary-pressed` |
|
|
480
|
+
| `active-elements` | `action-primary` (fills); `content-brand` (text) |
|
|
481
|
+
| `active-elements--focus` | `action-primary-hover` (fills); `content-brand-hover` (text) |
|
|
482
|
+
| `active-elements--pressed` | `action-primary-pressed` (fills); `content-brand-pressed` (text) |
|
|
472
483
|
| `active-elements-bg--focus` | `action-primary-subtle-hover` |
|
|
473
484
|
| `active-elements-bg--pressed` | `action-primary-subtle-pressed` |
|
|
474
485
|
| `inactive-elements--focus` | no class |
|
|
@@ -480,7 +491,7 @@ Text and icons in a status colour take the `content` name (`text-content-danger`
|
|
|
480
491
|
|
|
481
492
|
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.
|
|
482
493
|
|
|
483
|
-
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-
|
|
494
|
+
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`, `vc-content-info` and `vc-content-brand` (the text of the 3.x `primary`, where 4.x draws the text deeper than the fill).
|
|
484
495
|
|
|
485
496
|
A remote branding section gets the `vc-*` keys before the application is upgraded: a 3.x application ignores them, and a 4.x application ignores the 3.x keys, so every key it does not receive takes the default theme's value.
|
|
486
497
|
|
|
@@ -516,10 +527,10 @@ A remote branding section gets the `vc-*` keys before the application is upgrade
|
|
|
516
527
|
| `card-shadow-color` | `vc-shadow-color`: a dark base colour the library mixes down (12% for cards here); the 3.x light-grey value is not reused |
|
|
517
528
|
| `table-shadow-color` | `vc-shadow-color`: a dark base colour the library mixes down (7% for tables here); the 3.x light-grey value is not reused |
|
|
518
529
|
| `actions-mix-color` | `vc-mix-anchor`, and `vc-mix-anchor-{fill}` for a fill with its own anchor (the built-in themes set `vc-mix-anchor-primary` and `vc-mix-anchor-warning`) |
|
|
519
|
-
| `primary` | `vc-action-primary` |
|
|
520
|
-
| `primary-alternative` | `vc-action-primary` |
|
|
521
|
-
| `active-elements` | `vc-action-primary` |
|
|
522
|
-
| `secondary` | `vc-action-secondary` |
|
|
530
|
+
| `primary` | `vc-action-primary` (fills); `vc-content-brand` (text) |
|
|
531
|
+
| `primary-alternative` | `vc-action-primary` (fills); `vc-content-brand` (text) |
|
|
532
|
+
| `active-elements` | `vc-action-primary` (fills); `vc-content-brand` (text) |
|
|
533
|
+
| `secondary` | `vc-action-secondary` (fills, borders); `vc-content-secondary` (text) |
|
|
523
534
|
| `destructive` | `vc-action-danger` (fills); `vc-content-danger` (text) |
|
|
524
535
|
| `error` | `vc-action-danger` (fills); `vc-content-danger` (text) |
|
|
525
536
|
| `success` | `vc-action-success` (fills); `vc-content-success` (text) |
|
|
@@ -563,15 +574,20 @@ The components draw Lucide icons (`@lucide/vue`) where 3.x drew the `vc-icon-*`
|
|
|
563
574
|
| `shadow-hover-outer-active`, `shadow-hover-outer-primary-alternative` | the hover glow of the `active` and `primary-alternative` colours | removed; `shadow-hover-outer-primary` |
|
|
564
575
|
| `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` |
|
|
565
576
|
| The hover outline of VcCard with `hovered` | replaces the card shadow | fades in over the card shadow, which stays |
|
|
566
|
-
| The divider between VcViewSwitcher items | `secondary-actions` | `border` |
|
|
567
577
|
| `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 |
|
|
568
578
|
| `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 |
|
|
569
579
|
| `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 |
|
|
570
580
|
| `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 |
|
|
571
581
|
| `iconClass` of VcSoundPlayerMarker | `'icon-md'` | `'icon-xs'`: the icon sits on a filled circle of the marker colour |
|
|
582
|
+
| The code font of VcCodeBlock, VcJsonViewer, VcToolCall, VcApprovalCard, the code in VcMdEditor and the labels of VcSipFlow | each its own list of system monospace fonts (VcMdEditor `JetBrains Mono` first, VcSipFlow `monospace` and `serif`) | DM Mono (`var(--vc-font-mono)`), loaded with Rubik, the system monospace fonts as fallback; `--vc-json-viewer-mono-font`, `--vc-tool-call-mono-font` and `--vc-approval-card-mono-font` still override it |
|
|
583
|
+
| Icon sizes inside the components: the default `iconClass` of VcPlayerPlayStopButton, the default `iconClasses` of VcPlayerPlaybackRate and VcPlayerPlaybackRatePopup, the `size` icons of VcSoundPlayer, the `large` icon of VcDatePicker, and the icons of VcPdfDocument's footer, VcTree, VcTreeSelect, VcImageUploader, VcIconPicker, VcSummaryStep, VcFileImportErrorsCard and VcExtendedDatetimeRangePicker | `icon-lg` (22px), `icon-2xl` (30px) | `icon-xl` (24px), `icon-2r` (32px): the icon sizes of the design (12 / 14 / 16 / 20 / 24 / 32). The classes themselves keep their sizes; pass the old class to keep the 3.x size |
|
|
572
584
|
| `borderRadius` of VcMeterGroup | `'6px'` | `'var(--vc-radius-inner)'`, the inner radius role |
|
|
573
585
|
| `StatusProgressConfig`, the type of the `statusColorMap` prop of VcProgressCircular | `Record<string, string>` | `Partial<Record<StatusProgress, string>>`: its keys are the `StatusProgress` values, each optional, so an object literal with another key, or code that reads another key, fails the type check |
|
|
574
586
|
| `VcTagInputColor`, exported from the package root | `'active' \| 'primary' \| 'secondary' \| 'destructive'` | removed: no prop took it. The `color` of VcTagInput is `COMPONENT_COLOR_TYPE` and its `tagColor` is `VcTagColorType` |
|
|
587
|
+
| `VcDatetimeRangePicker` and the types `VcPresetRangesType` and `VcDatetimeRangePickerModelType` | the component drew only a notice that it is deprecated | removed. `<VcDatetimeRangePicker>` becomes `<VcDatePicker type="datetimerange">` (or another `type`), or `VcExtendedDatetimeRangePicker` where the field has quick ranges; an import of the component or of the two types is deleted |
|
|
588
|
+
| `beforeStepFn` and `onEnterStepFn` of a `VcWizard` step (`VcWizardStepType`) | read as `validateStepFn` and `initStepFn`, with a console warning | removed, and a step that still sets them is neither validated nor initialised, with no error: rename `beforeStepFn` to `validateStepFn` and `onEnterStepFn` to `initStepFn` |
|
|
589
|
+
| `BindResultObjectType<T>`, exported from the package root | an alias of `BindingRowItemType<T>` | removed; replace it with `BindingRowItemType<T>` |
|
|
590
|
+
| The `columns` prop of VcTable | `ColumnType`: columns of `Record<string, unknown>` rows, whatever the rows of the table | `ColumnType<Row>`, `Row` being the type of the table's `options`: `format` and `sortableFunction` receive the row with its type. Columns declared for another row type than the table's fail the type check; declare them as `ColumnType<Row>` |
|
|
575
591
|
| `TEXT_COLORS`, exported from the package root | the Tailwind text class of each component colour (`text-primary`, `text-secondary-actions`, …) | removed; `textColorClass(color)` returns the text class of a component colour, `vc-text-color--<colour>` from the library stylesheet, and `text-<key>` for a Tailwind colour key |
|
|
576
592
|
| The default slot of VcButton and the value of VcBadgeTag | direct children of `.vc-button--content` and of the badge | inside `span.vc-button__label` and `span.vc-badge-tag__value`, which trim the label box to its capitals so the control centres them; a selector that reaches the slot content as a direct child (`.vc-button--content > span`) no longer matches it |
|
|
577
593
|
| `font-normal`, `font-medium`, `font-semibold` | `400`, `500`, `600` | `380`, `480`, `600` (`--vc-font-weight-*`): the three weights of the components' text, in an application too once it takes `extend.fontWeight` (see "Tailwind") |
|
|
@@ -581,11 +597,11 @@ The components draw Lucide icons (`@lucide/vue`) where 3.x drew the `vc-icon-*`
|
|
|
581
597
|
| The border and clear icon of VcTagInput with a `color` | a glow on hover; when focused, the border of the colour | no glow: for every colour, `info` included, the border warms toward the colour on hover and takes the colour's hover shade when focused; the clear icon is the colour's text colour and darkens from it on hover |
|
|
582
598
|
| `color` and `prefixIconColor` of VcTreeSelect | the field drew the same colour whatever its `color` (the colour class did not reach it); a `prefixIconColor` other than `active`, `primary` and `destructive` drew `active-elements` | the field takes its `color` as VcTagInput does: the border warms toward the colour on hover and takes the colour's hover shade while the tree is open; the prefix icon takes the text colour of its `prefixIconColor`, for every colour |
|
|
583
599
|
| The rings of the `circles` loader of VcLoading with a `color` other than `primary`, `secondary` and `destructive` | three rings of the one colour | the outer ring is the colour, the second and third its hover and pressed shades, as for `primary`, `secondary` and `destructive` |
|
|
584
|
-
| The text of an unchecked VcRadioButtonsGroup button on hover | `primary`: the brand colour itself; the other colours: the hover shade of the fill | the hover shade of the colour's text colour, `primary` included: `primary` darkens on hover (lightens in `black`) as the others do, and `success` and `warning` mix from their text colour, which in voicenter
|
|
585
|
-
| The tick of a checked VcCheckbox, the text of a checked VcCheckboxButton and the text inside a VcProgress bar, for a fill other than `primary` | `btn-filled-text`, on every fill | the on-fill colour of that fill, as on a filled button: on the `warning` fill it is `onfill-warning`, dark in voicenter
|
|
600
|
+
| The text of an unchecked VcRadioButtonsGroup button on hover | `primary`: the brand colour itself; the other colours: the hover shade of the fill | the hover shade of the colour's text colour, `primary` included: `primary` darkens on hover (lightens in `black`) as the others do, and `success` and `warning` mix from their text colour, which in voicenter is darker than the fill |
|
|
601
|
+
| The tick of a checked VcCheckbox, the text of a checked VcCheckboxButton and the text inside a VcProgress bar, for a fill other than `primary` | `btn-filled-text`, on every fill | the on-fill colour of that fill, as on a filled button: on the `warning` fill it is `onfill-warning`, dark in voicenter |
|
|
586
602
|
| A status that the `statusColorMap` of VcProgressCircular leaves out, when the map has no `default` key | `primary-alternative-actions`, the library's default | the fill of that status |
|
|
587
|
-
| The text and underline of a `success` or `warning` VcHyperLink | the fill colour (`success-actions`, `warning-actions`) | the text colour, `content-success` or `content-warning`, for the text and the underline alike: every colour's underline is the colour of its text. In voicenter
|
|
588
|
-
| The clear icon of a VcInput or VcAutocomplete with a `color`, on hover | the hover shade of the fill | the hover shade of the colour's text colour, the colour the icon has at rest: unchanged for `primary`, `secondary`, `destructive` and `info`; for `success` and `warning` in voicenter
|
|
603
|
+
| The text and underline of a `success` or `warning` VcHyperLink | the fill colour (`success-actions`, `warning-actions`) | the text colour, `content-success` or `content-warning`, for the text and the underline alike: every colour's underline is the colour of its text. In voicenter these are darker than the fill |
|
|
604
|
+
| The clear icon of a VcInput or VcAutocomplete with a `color`, on hover | the hover shade of the fill | the hover shade of the colour's text colour, the colour the icon has at rest: unchanged for `primary`, `secondary`, `destructive` and `info`; for `success` and `warning` in voicenter, whose text is darker than the fill, darker than before |
|
|
589
605
|
| Slot content of a VcRadio with a `color` that reads `active-elements` (4.x: `action-primary`) | the radio's colour: the radio redefined `--active-elements` | the brand colour: the radio sets its own `--vc-radio-color` and redefines no theme variable |
|
|
590
606
|
| Slot content of VcFileUploaderArea that reads `icons` (4.x: `content-primary`) | `secondary-text`: the area redefined `--icons` | `content-primary`: the area colours its own label, drop text and file names `content-secondary` and redefines no theme variable |
|
|
591
607
|
|
|
@@ -606,7 +622,21 @@ The components draw Lucide icons (`@lucide/vue`) where 3.x drew the `vc-icon-*`
|
|
|
606
622
|
- **`VcChatMessage.createdAt` is optional.** A message without it starts no date divider and shows no time (AI SDK messages have no timestamp). Code that passes `message.createdAt` on to something that does not accept `undefined` needs a guard, or a message type of your own with a required `createdAt`.
|
|
607
623
|
- **`VcMessageContent` has a `markdown` block** (`{ type: 'markdown', text, streaming? }`). An exhaustive `switch` or a `Record<VcMessageContentType, …>` over the content types needs the new case.
|
|
608
624
|
- **`VcMessage`'s `content` also accepts an array** of blocks, rendered in order in one bubble. `VcChatMessage.content` stays a single block; several blocks in a wrapper go through its `message` slot.
|
|
609
|
-
- **`VcMessage` colours changed.** In 3.x own messages used `--dark-bg` / `--btn-filled-text`, a contrast of 1.13–1.42:1 in every light theme, and the quote of an incoming message used the same pair. In 4.x
|
|
625
|
+
- **`VcMessage` colours changed.** In 3.x own messages used `--dark-bg` / `--btn-filled-text`, a contrast of 1.13–1.42:1 in every light theme, and the quote of an incoming message used the same pair. In 4.x others' bubbles are `--vc-bg-muted` and own ones (`align="end"`) the blue tint `--vc-action-info--subtle-hover`, both with `--vc-content-primary` text, so a bubble shows on a white card; the quote inside is `--vc-bg-surface`. The variables keep their 3.x names (`--vc-message-bg`, `--vc-message-text`, `--vc-message-reply-bg`, `--vc-message-reply-text`): a project that sets them keeps working, with any 3.x theme variable in their values replaced by its 4.x token. Markdown links in bubbles take the text colour. A project that styled around the old dark own bubble (e.g. white icons in a custom `footer`) should check its contrast.
|
|
626
|
+
- **Disabled tabs are no longer faded.** In `VcVerticalTabs` a disabled tab was drawn at 50% opacity; now, as in `VcTabs` and `VcRadioTabs`, its label and icon are `--vc-content-disabled`, with a not-allowed cursor, and hover or focus does not recolour it. A project that adds its own opacity to disabled tabs should remove it.
|
|
627
|
+
- **`VcTour`'s mask is `--vc-bg-overlay`.** `VcModal` already used it; `VcTour`'s mask (black at 50%) now takes it too. A `color` set in `VcTour`'s `mask` prop still wins.
|
|
628
|
+
- **`VcSkeletonLoader` stops its sweep under reduced motion.** When the system asks for reduced motion (`prefers-reduced-motion: reduce`) the shine no longer moves; the grey shapes stay as they were.
|
|
629
|
+
- **`VcViewSwitcher` is removed; `VcSegmented` takes its place.** `<VcViewSwitcher>` becomes `<VcSegmented variant="surface">` with the same `v-model`, `options`, `config` and `disabled`: `variant="surface"` draws the selected segment as the raised pill the switcher had, and `config` takes the same keys (`labelKey`, `valueKey`, `iconKey`, `disabledKey`, `disabledHintKey`). What changes in the template:
|
|
630
|
+
- the slot `tab-item` is `default`; its props are `item` (the option as passed), `option` (the mapped option, as before) and `isActive`;
|
|
631
|
+
- `@change` receives `(value, option)`, where the switcher passed the option alone;
|
|
632
|
+
- `data-test-name="x"` becomes the attribute `data-test="x"`;
|
|
633
|
+
- a style on `.vc-view-switcher`, `.vc-view-switcher-item` and `.vc-view-switcher-item--active` moves to `.vc-segmented`, `.el-segmented__item` and `.el-segmented__item.is-selected`;
|
|
634
|
+
- a segment is as high as a control of its `size`, lower than the switcher was; a row of options too wide for its container goes into a container that scrolls.
|
|
635
|
+
|
|
636
|
+
An application that already used `VcSegmented` checks its `@change`: the second argument is the picked option, where it was the earlier value. `VcSegmented` has no `color` prop: the selected segment is the primary fill (`variant="solid"`) or the surface pill (`variant="surface"`), so `color="…"` is removed from the tag. The selected segment is drawn on the segment itself, and `.el-segmented__item-selected` is shown only while the selection slides to another segment: a style on `.el-segmented__item-selected` moves to `.el-segmented__item.is-selected`, and a colour of the selected segment is set with `--el-segmented-item-selected-bg-color`, which both read.
|
|
637
|
+
- **`VcDatePicker` fills its container.** Date, date-time and range fields had the fixed Element Plus widths (220px a date, 350px a range, 400px a date-time range); a field is now as wide as its container, like `VcInput` and `VcSelect`. In a toolbar or filter bar it takes its width from a class (`class="w-44"`) or from its container.
|
|
638
|
+
- **`VcTable` has three densities, and `compact` is gone.** The `density` prop takes `'compact' | 'default' | 'large'`. A table with no props has the look `compact` gave in 3.x (14px text, rows about 36px), so `compact` is removed from the template. `density="large"` is the 3.x default look (16px text, rows about 43px); `density="compact"` is denser than 3.x had (12px text, rows about 28px, for small buttons and tags in its cells). The class `vc-table--small` is gone: a style written for it moves to `.vc-table--density-default`.
|
|
639
|
+
- **`VcTable` stacks into cards only on phones.** The stacked-card layout (header row hidden, each cell labelled) now starts at 440px of screen width instead of 780px, so a tablet or a narrow window keeps the table. A project that relied on the cards between 441 and 780px should check its tables there.
|
|
610
640
|
- **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.
|
|
611
641
|
- **`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.
|
|
612
642
|
- **Exported types**: `VcFileItemProps` (with the new `errorText`), `VcChatComposerEmits`, and props / emits / slot-props / exposed interfaces of every new component.
|
|
@@ -616,7 +646,34 @@ Fixes in the components 3.x had:
|
|
|
616
646
|
|
|
617
647
|
- **PDFs open without `eval` (CVE-2024-4367).** pdf.js before 4.2.67 compiles font glyphs with `eval`, so a crafted PDF could run JavaScript in the page. `VcPdfDocument` and `VcPdfViewer` now pass `isEvalSupported: false` to `getDocument` (no caller can turn it back on); pdf.js draws the glyphs through its slower interpreted path, the text looks the same. The lasting fix is `pdfjs-dist` 4.2.67 or newer, a separate upgrade of the peer (the library still declares `^2.16.105`).
|
|
618
648
|
- **Lists in `VcMdEditor`** render again with `@milkdown/*` `^7.22.0` (see above).
|
|
619
|
-
- **Code blocks in `VcMdEditor`** take the theme's colours. Copy is a secondary text action (`--vc-
|
|
649
|
+
- **Code blocks in `VcMdEditor`** take the theme's colours. Copy is a secondary text action (`--vc-content-secondary` text and icon, the `--vc-action-secondary--subtle-hover` hover, a focus ring, visible while it has keyboard focus) instead of Crepe's grey pill without hover or focus states; the line numbers, fold markers, folded-code placeholder, cursor and selection use the theme variables instead of One Dark's colours. The syntax colours are unchanged. Read-only, a code block is framed (`--vc-border`, on `--vc-bg-surface` in `--vc-content-primary`) with no line numbers, active line or language button, Copy floats in its corner on hover or focus, a long line scrolls with a visible scrollbar, and inline code wraps instead of running past the column.
|
|
650
|
+
|
|
651
|
+
## Upgrading from a 4.0 beta
|
|
652
|
+
|
|
653
|
+
An application on a 4.0 beta has moved from 3.x with [Migrating from 3.x to 4.x](#migrating-from-3x-to-4x) as its beta shipped it. That section describes the current release; the table below lists what such an application changes or checks on the way there. A row names the last release without the change, so the application takes every row whose release is the one it has installed (the `version` its `package.json` or lock file gives for the library before the upgrade) or a later one: an application on `4.0.0-beta.3` takes the rows of `4.0.0-beta.3`, `4.0.0-beta.4` and `4.0.0-beta.5`.
|
|
654
|
+
|
|
655
|
+
Additions that ask nothing of an application (new components, props, theme keys and classes) are not rows: they are in the sections above and in the [live documentation](https://voicenter-ui-plus.pages.dev/).
|
|
656
|
+
|
|
657
|
+
| Changed after | What changed | What the application does |
|
|
658
|
+
| --- | --- | --- |
|
|
659
|
+
| `4.0.0-beta.1` | The packages that only some components need are optional peers, and npm no longer installs them with the library | The **Optional peers** item of [What changed and why](#what-changed-and-why): the packages of the components it renders go into its own `dependencies` ([Optional peers](#optional-peers)), with the `external` list, the tests and the KaTeX stylesheet that item names |
|
|
660
|
+
| `4.0.0-beta.5` | The default theme is `voicenter`, where the earlier betas had `redGreen` | An application that passes no `themeConfig`, or a tree-shake one that does not call `Theme()`, is drawn in `voicenter` ([Theming specification](#theming-specification)) |
|
|
661
|
+
| `4.0.0-beta.5` | The built-in themes are the light `voicenter` and the dark `voicenterDark`, which is new: `red`, `redGreen`, `black` and `voicenterRed` are removed | An application that passes one of the removed names is drawn in `voicenter` and logs a warning: it passes `voicenter` (light; the colours `voicenterRed` had) or `voicenterDark` (dark), or its own colours as a `customJson` theme ([Theming specification](#theming-specification)) |
|
|
662
|
+
| `4.0.0-beta.5` | The built-in themes no longer set `vc-content-warning-icon` | `var(--vc-content-warning-icon)` and the class `text-content-warning-icon` draw no colour: they become `var(--vc-content-warning)` and `text-content-warning`, the one warning colour of text and icons. A `customJson` or remote theme drops the key |
|
|
663
|
+
| `4.0.0-beta.5` | Brand and grey text have their own tokens: `content-brand` for text and icons in `primary`, `content-secondary` for text and icons in `secondary`; `action-primary` and `action-secondary` draw fills | Text and icons the application colours with `text-action-primary`, `text-action-secondary` or `var(--vc-action-primary)` / `var(--vc-action-secondary)` move to `text-content-brand`, `text-content-secondary` and their variables; fills and borders keep the `action-*` names ([Tailwind colour classes](#tailwind-colour-classes)) |
|
|
664
|
+
| `4.0.0-beta.5` | Disabled controls and disabled tabs are no longer faded: they draw the disabled colours at full opacity | A style of the application that fades a disabled ui-plus control or tab, or reads its opacity, is removed ([AI chat components](#ai-chat-components), the note on disabled tabs) |
|
|
665
|
+
| `4.0.0-beta.5` | `VcMessage` bubbles: others' are `bg-muted`, own ones the blue tint | An application that sets `--vc-message-bg` and the variables beside it keeps its colours; one that styled around the earlier bubble colours checks its contrast ([AI chat components](#ai-chat-components)) |
|
|
666
|
+
| `4.0.0-beta.5` | The default icon classes inside the components are `icon-xl` (24px) and `icon-2r` (32px), where the earlier betas had `icon-lg` (22px) and `icon-2xl` (30px) | Nothing, or the earlier class passed in the component's icon class prop to keep that size ([Styles and component defaults](#styles-and-component-defaults)) |
|
|
667
|
+
| `4.0.0-beta.5` | `VcTable` stacks into cards up to 440px of screen width, where the earlier betas stacked up to 780px | The application checks its tables between 441 and 780px ([AI chat components](#ai-chat-components)) |
|
|
668
|
+
| `4.0.0-beta.5` | The step buttons of `VcTour` are `VcButton` | A style that targets Element Plus's buttons inside the tour (`.el-tour-buttons .el-button`) no longer matches; the buttons take the VcButton classes |
|
|
669
|
+
| `4.0.0-beta.5` | Code in the components is DM Mono, through one variable, `--vc-font-mono`; the plugin and `loadTextFont()` load it with Rubik from Google Fonts | Nothing where the fonts come from the plugin or `loadTextFont()`. An application that loads the fonts itself also loads DM Mono (400 and 500), or sets `--vc-font-mono` on `:root` to its own code font ([Text](#text)) |
|
|
670
|
+
| `4.0.0-beta.5` | `VcTable` takes `density` (`'compact' \| 'default' \| 'large'`) and has no `compact` prop; a table with no props has the look `compact` gave | `compact` is removed from every `VcTable`; a table that had no `compact` takes `density="large"` to keep its look; a style on `.vc-table--small` moves to `.vc-table--density-default` ([AI chat components](#ai-chat-components)) |
|
|
671
|
+
| `4.0.0-beta.5` | `VcDatePicker` is as wide as its container, where the earlier betas had the fixed Element Plus widths | A date picker in a toolbar, a filter bar or any row that relied on the fixed width takes a width class or a sized container ([AI chat components](#ai-chat-components)) |
|
|
672
|
+
| `4.0.0-beta.5` | `VcViewSwitcher` is removed; `VcSegmented` takes icons, disabled hints and the `surface` variant, its `change` passes `(value, option)`, and its `color` prop is removed | Every `<VcViewSwitcher>` becomes `<VcSegmented variant="surface">` by the list under **`VcViewSwitcher` is removed** ([AI chat components](#ai-chat-components)); a `@change` handler of an existing `VcSegmented` that read the earlier value as its second argument is updated, `color` is removed from every `<VcSegmented>`, and a style on `.el-segmented__item-selected` moves to `.el-segmented__item.is-selected` |
|
|
673
|
+
| `4.0.0-beta.5` | `VcDatetimeRangePicker`, the step keys `beforeStepFn` and `onEnterStepFn` of `VcWizard`, and the types `BindResultObjectType`, `VcPresetRangesType` and `VcDatetimeRangePickerModelType` are removed | The application searches for these names (`grep -rnE "VcDatetimeRangePicker|vc-datetime-range-picker|beforeStepFn|onEnterStepFn|BindResultObjectType|VcPresetRangesType" src`) and replaces each hit by its row in **Styles and component defaults** ([Styles and component defaults](#styles-and-component-defaults)); a wizard step with the old keys otherwise skips its validation silently |
|
|
674
|
+
| `4.0.0-beta.5` | The `columns` of `VcTable` are typed by the table's row: `ColumnType<Row>` | Nothing at runtime. Where `vue-tsc` reports the `columns` of a `<VcTable>`, the columns are declared as `ColumnType<Row>` with the type of the table's `options` ([Styles and component defaults](#styles-and-component-defaults)) |
|
|
675
|
+
|
|
676
|
+
After its rows the application runs the search of [Finding the 3.x names](#finding-the-3x-names) again: it finds a 3.x name that the guide of an earlier beta did not list.
|
|
620
677
|
|
|
621
678
|
## Using ui-plus in an application
|
|
622
679
|
|
|
@@ -646,14 +703,15 @@ The installed package is the truth. Read it before saying what ui-plus has or ho
|
|
|
646
703
|
|
|
647
704
|
### Colours
|
|
648
705
|
|
|
649
|
-
- Every colour is a ui-plus token: a Tailwind class from the library scheme (`text-content-primary`, `text-content-secondary`, `
|
|
706
|
+
- Every colour is a ui-plus token: a Tailwind class from the library scheme (`text-content-primary`, `text-content-secondary`, `bg-action-primary`, `text-content-brand` for brand-coloured text, `bg-page`, `bg-surface`, `border-border`, `text-content-success`, `text-content-danger`) or a theme variable in a style (`color: var(--vc-content-primary)`). Status colours, tags, icons and chart series included.
|
|
650
707
|
- Hex values, `rgb()`/`rgba()`, arbitrary classes such as `bg-[#…]` and new colour variables stay out of application code. Such colours already in a project are not a precedent.
|
|
651
708
|
- The theme configuration (`themeConfig`, usually a `colors.json`) sets the library theme. It is not a palette to add colours to.
|
|
652
709
|
|
|
653
710
|
### Corners
|
|
654
711
|
|
|
655
712
|
- A corner takes the radius role of what it draws: `rounded-<role>`, a class of the shipped configuration ([Tailwind](#tailwind)), or `var(--vc-radius-<role>)` in a style:
|
|
656
|
-
- `rounded-control`: buttons, icon, toggle and split buttons, inputs, selects, pickers;
|
|
713
|
+
- `rounded-control`: buttons, icon, toggle and split buttons, inputs, selects, pickers, at the default and large sizes;
|
|
714
|
+
- `rounded-control-sm`: the same controls at the small size (`--vc-size-control-sm`, 24px), and any other control of that height;
|
|
657
715
|
- `rounded-popup`: floating panels (popovers, dropdowns, select panels, tooltips, date-picker panels, notifications);
|
|
658
716
|
- `rounded-card`: cards, the outer frame of a table, modals;
|
|
659
717
|
- `rounded-tag`: tags and chips, drawn as a pill;
|
|
@@ -674,6 +732,7 @@ The installed package is the truth. Read it before saying what ui-plus has or ho
|
|
|
674
732
|
- 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)).
|
|
675
733
|
- 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.
|
|
676
734
|
- `transition-weight` is for text whose weight changes with its state.
|
|
735
|
+
- Code (JSON, code blocks, identifiers) takes `var(--vc-font-mono)` in a stylesheet: DM Mono, loaded with Rubik by the plugin and by `loadTextFont()`, with the system monospace fonts as fallback. An application with a code font of its own sets the variable on `:root`.
|
|
677
736
|
- 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.
|
|
678
737
|
|
|
679
738
|
### Icons
|