@voicenter-team/voicenter-ui-plus 3.4.8 → 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 +1023 -558
- package/library/assets/assets/sass/main.css +1 -1
- package/library/assets/components/VcAgentRun/UiComponents/VcAgentRunMetrics.css +1 -0
- package/library/assets/components/VcAgentRun/UiComponents/VcAgentRunRow.css +1 -0
- package/library/assets/components/VcAgentRun/VcAgentRunCard.css +1 -0
- package/library/assets/components/VcAgentRun/VcAgentRunGroup.css +1 -0
- package/library/assets/components/VcAiReasoning/VcAiReasoning.css +1 -0
- package/library/assets/components/VcApprovalCard/VcApprovalCard.css +1 -0
- package/library/assets/components/VcAskUserCard/VcAskUserCard.css +1 -0
- package/library/assets/components/VcAutocomplete/VcAutocomplete.css +1 -1
- package/library/assets/components/VcAvatar/VcAvatar.css +1 -1
- package/library/assets/components/VcBadgeTag/VcBadgeTag.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/VcCard/VcCard.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/VcCheckbox/VcCheckboxButton.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/VcDatetimeRangePicker/VcDatetimeRangePicker.css +1 -1
- package/library/assets/components/VcDropdown/VcDropdown.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/VcInputError.css +1 -1
- package/library/assets/components/VcForm/UiComponents/VcInputLabel.css +1 -1
- package/library/assets/components/VcForm/VcFormItem.css +1 -1
- package/library/assets/components/VcHtmlEditor/VcHtmlEditor.css +1 -1
- package/library/assets/components/VcHyperLink/VcHyperLink.css +1 -1
- package/library/assets/components/VcIconPicker/VcIconPicker.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/VcJsonSchema/Components/JsonSchemaEditor.css +1 -1
- package/library/assets/components/VcJsonSchema/VcJsonSchema.css +1 -1
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerAuto.css +1 -0
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerCards.css +1 -0
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerFields.css +1 -0
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerKey.css +1 -0
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerMore.css +1 -0
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerObject.css +1 -0
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerSections.css +1 -0
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerState.css +1 -0
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerTable.css +1 -0
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerTree.css +1 -0
- package/library/assets/components/VcJsonViewer/UiComponents/VcJsonViewerValue.css +1 -0
- package/library/assets/components/VcJsonViewer/VcJsonViewer.css +1 -0
- package/library/assets/components/VcLightbox/VcLightbox.css +1 -0
- package/library/assets/components/VcLoading/Loaders/Circles.css +1 -1
- package/library/assets/components/VcLoading/Loaders/DotSpinner.css +1 -1
- package/library/assets/components/VcLoading/Loaders/LdsSpinner.css +1 -1
- package/library/assets/components/VcLoading/Loaders/LoadIcon.css +1 -1
- package/library/assets/components/VcLoading/Loaders/Stretch.css +1 -1
- package/library/assets/components/VcLoading/VcLoading.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/content/VcMessageFileBlock.css +1 -1
- package/library/assets/components/VcMessage/content/VcMessageImageBlock.css +1 -1
- package/library/assets/components/VcMessage/content/VcMessageMarkdownBlock.css +1 -0
- package/library/assets/components/VcMessage/content/VcMessageTextBlock.css +1 -1
- package/library/assets/components/VcMessage/content/VcMessageVideoBlock.css +1 -1
- package/library/assets/components/VcMessage/reactions/VcMessageEmojiPicker.css +1 -1
- package/library/assets/components/VcMessage/reactions/VcMessageReactionBar.css +1 -1
- package/library/assets/components/VcMessagesWrapper/VcMessagesWrapper.css +1 -1
- package/library/assets/components/VcMeterGroup/VcMeterGroup.css +1 -1
- package/library/assets/components/VcModal/VcModal.css +1 -1
- package/library/assets/components/VcNotification/VcNotification.css +1 -1
- package/library/assets/components/VcOtpInput/VcOtpInput.css +1 -1
- package/library/assets/components/VcPdfViewer/UiComponents/VcPdfViewerToolbar.css +1 -0
- package/library/assets/components/VcPdfViewer/VcPdfDocument.css +1 -1
- package/library/assets/components/VcPdfViewer/VcPdfDocumentCard.css +1 -1
- package/library/assets/components/VcPdfViewer/VcPdfDocumentViewerFooter.css +1 -1
- package/library/assets/components/VcPdfViewer/VcPdfViewer.css +1 -0
- package/library/assets/components/VcPhoneInput/VcFlagLabel.css +1 -1
- package/library/assets/components/VcPhoneInput/VcPhoneInput.css +1 -1
- package/library/assets/components/VcPopover/VcConfirmPopover.css +1 -1
- package/library/assets/components/VcPopover/VcPopover.css +1 -1
- package/library/assets/components/VcPopover/VcSelectPopover.css +1 -1
- package/library/assets/components/VcProgress/VcProgress.css +1 -1
- package/library/assets/components/VcProgress/VcProgressCircular.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/VcRadioGroup/VcRadioGroup.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/VcSkeletonLoader/Loaders/Card.css +1 -1
- package/library/assets/components/VcSkeletonLoader/Loaders/Circle.css +1 -1
- package/library/assets/components/VcSkeletonLoader/Loaders/Row.css +1 -1
- package/library/assets/components/VcSkeletonLoader/Loaders/Square.css +1 -1
- package/library/assets/components/VcSkeletonLoader/Loaders/Text.css +1 -1
- package/library/assets/components/VcSlider/VcSlider.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/VcSystemUserPrompt/VcSystemUserPrompt.css +1 -1
- package/library/assets/components/VcTable/VcTable.css +1 -1
- package/library/assets/components/VcTable/VcTable2.css +1 -1
- package/library/assets/components/VcTabs/VcTabNav.css +1 -1
- package/library/assets/components/VcTabs/VcTabs.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/VcTimeInput/VcTimeInput.css +1 -1
- package/library/assets/components/VcToolCall/UiComponents/VcToolCallValue.css +1 -0
- package/library/assets/components/VcToolCall/VcToolCall.css +1 -0
- package/library/assets/components/VcTour/VcTour.css +1 -1
- package/library/assets/components/VcTransfer/VcTransfer.css +1 -1
- package/library/assets/components/VcTree/VcTree.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/components/VcViewSwitcher/VcViewSwitcher.css +1 -1
- package/library/assets/components/VcWizard/VcSummaryProgress.css +1 -1
- package/library/assets/components/VcWizard/VcWizard.css +1 -1
- package/library/assets/components/VcWizard/VcWizardNavigation.css +1 -1
- package/library/assets/components/VcWizard/VcWizardSummary.css +1 -1
- package/library/assets/entity/components/Form/VcBaseVerticalForm.css +1 -1
- package/library/assets/entity/components/Table/VcEntityListTable.css +1 -1
- package/library/assets/entity/components/Tabs/VcEntityEditableTabs.css +1 -1
- package/library/assets/node_modules/element-plus/theme-chalk/src/autocomplete.css +1 -1
- package/library/assets/node_modules/element-plus/theme-chalk/src/base.css +1 -1
- package/library/assets/node_modules/element-plus/theme-chalk/src/button.css +1 -1
- package/library/assets/node_modules/element-plus/theme-chalk/src/checkbox.css +1 -1
- package/library/assets/node_modules/element-plus/theme-chalk/src/date-picker-panel.css +1 -1
- package/library/assets/node_modules/element-plus/theme-chalk/src/image-viewer.css +1 -0
- package/library/assets/node_modules/element-plus/theme-chalk/src/input-number.css +1 -1
- package/library/assets/node_modules/element-plus/theme-chalk/src/input.css +1 -1
- package/library/assets/node_modules/element-plus/theme-chalk/src/option.css +1 -1
- package/library/assets/node_modules/element-plus/theme-chalk/src/popover.css +1 -1
- package/library/assets/node_modules/element-plus/theme-chalk/src/popper.css +1 -1
- package/library/assets/node_modules/element-plus/theme-chalk/src/radio-button.css +1 -1
- package/library/assets/node_modules/element-plus/theme-chalk/src/radio.css +1 -1
- package/library/assets/node_modules/element-plus/theme-chalk/src/select.css +1 -1
- package/library/assets/node_modules/element-plus/theme-chalk/src/tree.css +1 -1
- package/library/components/VcAgentRun/UiComponents/VcAgentRunMetrics.vue.mjs +110 -0
- package/library/components/VcAgentRun/UiComponents/VcAgentRunMetrics.vue3.mjs +5 -0
- package/library/components/VcAgentRun/UiComponents/VcAgentRunRow.vue.mjs +70 -0
- package/library/components/VcAgentRun/UiComponents/VcAgentRunRow.vue3.mjs +5 -0
- package/library/components/VcAgentRun/VcAgentRunCard.vue.mjs +423 -0
- package/library/components/VcAgentRun/VcAgentRunCard.vue3.mjs +5 -0
- package/library/components/VcAgentRun/VcAgentRunGroup.vue.mjs +210 -0
- package/library/components/VcAgentRun/VcAgentRunGroup.vue3.mjs +5 -0
- package/library/components/VcAgentRun/agentRunStatus.mjs +39 -0
- package/library/components/VcAiReasoning/VcAiReasoning.vue.mjs +227 -0
- package/library/components/VcAiReasoning/VcAiReasoning.vue3.mjs +5 -0
- package/library/components/VcApprovalCard/VcApprovalCard.vue.mjs +419 -0
- package/library/components/VcApprovalCard/VcApprovalCard.vue3.mjs +5 -0
- package/library/components/VcAskUserCard/UiComponents/VcAskUserConfirm.vue.mjs +69 -0
- package/library/components/VcAskUserCard/UiComponents/VcAskUserConfirm.vue2.mjs +4 -0
- package/library/components/VcAskUserCard/UiComponents/VcAskUserMultiSelect.vue.mjs +177 -0
- package/library/components/VcAskUserCard/UiComponents/VcAskUserMultiSelect.vue2.mjs +4 -0
- package/library/components/VcAskUserCard/UiComponents/VcAskUserQuestionList.vue.mjs +98 -0
- package/library/components/VcAskUserCard/UiComponents/VcAskUserQuestionList.vue2.mjs +4 -0
- package/library/components/VcAskUserCard/UiComponents/VcAskUserRankPriorities.vue.mjs +142 -0
- package/library/components/VcAskUserCard/UiComponents/VcAskUserRankPriorities.vue2.mjs +4 -0
- package/library/components/VcAskUserCard/UiComponents/VcAskUserSingleSelect.vue.mjs +156 -0
- package/library/components/VcAskUserCard/UiComponents/VcAskUserSingleSelect.vue2.mjs +4 -0
- package/library/components/VcAskUserCard/UiComponents/VcAskUserText.vue.mjs +76 -0
- package/library/components/VcAskUserCard/UiComponents/VcAskUserText.vue2.mjs +4 -0
- package/library/components/VcAskUserCard/VcAskUserCard.vue.mjs +382 -0
- package/library/components/VcAskUserCard/VcAskUserCard.vue3.mjs +5 -0
- package/library/components/VcAskUserCard/askUserAnswers.mjs +224 -0
- package/library/components/VcAutocomplete/VcAutocomplete.vue.mjs +4 -2
- package/library/components/VcAvatar/VcAvatar.vue.mjs +3 -3
- package/library/components/VcBadgeTag/VcBadgeTag.vue.mjs +8 -5
- package/library/components/VcButton/VcButton.vue.mjs +10 -4
- package/library/components/VcButton/VcButtonIcon.vue.mjs +3 -4
- package/library/components/VcButton/VcToggleButton.vue.mjs +5 -4
- package/library/components/VcChatComposer/VcChatComposer.vue.mjs +154 -51
- package/library/components/VcCodeBlock/VcCodeBlock.vue.mjs +27 -35
- package/library/components/VcCollapse/VcCollapseItem.vue.mjs +12 -7
- package/library/components/VcDatePicker/VcDatePicker.vue.mjs +40 -11
- package/library/components/VcDatePickerPanel/VcDatePickerPanel.vue.mjs +49 -32
- package/library/components/VcExcelUploader/VcExcelFileProcessLoader.vue.mjs +2 -2
- package/library/components/VcExcelUploader/VcExcelFileUploadBlock.vue.mjs +11 -7
- package/library/components/VcExcelUploader/VcExcelFileUploader.vue.mjs +7 -6
- package/library/components/VcExcelUploader/VcFileImportErrorsCard.vue.mjs +8 -4
- package/library/components/VcExcelUploader/VcFileImportParseResultBlock.vue.mjs +2 -1
- package/library/components/VcExcelUploader/VcFileImportResultBindDataTable.vue.mjs +13 -12
- package/library/components/VcExtendedDatetimeRangePicker/ExtendedDatetimeRangePickerPart.vue.mjs +6 -5
- package/library/components/VcExtendedDatetimeRangePicker/ExtendedDatetimeRangePickerRelative.vue.mjs +4 -3
- package/library/components/VcExtendedDatetimeRangePicker/VcExtendedDatetimeRangePicker.vue.mjs +7 -3
- package/library/components/VcExtendedDatetimeRangePicker/VcExtendedDatetimeRangePickerQuickOptionsSelection.vue.mjs +3 -2
- package/library/components/VcFileUploader/VcFileItem.vue.mjs +59 -31
- package/library/components/VcFileUploader/VcFileUploader.vue.mjs +2 -1
- package/library/components/VcFileUploader/VcFileUploaderArea.vue.mjs +2 -2
- package/library/components/VcFileUploader/VcFileUploaderSimple.vue.mjs +1 -1
- package/library/components/VcFileUploader/VcFileUploaderSimple.vue2.mjs +2 -1
- package/library/components/VcFileUploader/VcSimpleUploaderAction.vue.mjs +4 -3
- package/library/components/VcForm/UiComponents/VcInputLabel.vue.mjs +6 -2
- package/library/components/VcHtmlEditor/VcHtmlEditor.vue.mjs +4 -1
- package/library/components/VcHtmlEditor/VcHtmlEditorToolbar.vue.mjs +19 -31
- package/library/components/VcHtmlEditor/htmlEditor.config.mjs +13 -10
- package/library/components/VcHyperLink/VcHyperLink.vue.mjs +1 -1
- package/library/components/VcIconPicker/VcIconPicker.vue.mjs +1 -1
- package/library/components/VcImageUploader/VcImageUploader.vue.mjs +27 -14
- package/library/components/VcInput/VcInput.vue.mjs +4 -2
- package/library/components/VcInputNumber/VcInputNumber.vue.mjs +29 -4
- package/library/components/VcJsonSchema/Components/ImportJsonSchemaModal.vue.mjs +5 -4
- package/library/components/VcJsonSchema/Components/JsonSchemaEditor.vue.mjs +1 -2
- package/library/components/VcJsonSchema/Components/JsonSchemaManageModal.vue.mjs +6 -9
- package/library/components/VcJsonSchema/PropertySetup/JsonSchemaPropertyModal.vue.mjs +9 -10
- package/library/components/VcJsonSchema/VcJsonSchema.vue.mjs +0 -1
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerAuto.vue.mjs +98 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerAuto.vue3.mjs +5 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerCards.vue.mjs +164 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerCards.vue3.mjs +5 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerFields.vue.mjs +50 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerFields.vue3.mjs +5 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerKey.vue.mjs +25 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerKey.vue3.mjs +5 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerMore.vue.mjs +64 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerMore.vue3.mjs +5 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerObject.vue.mjs +53 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerObject.vue3.mjs +5 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerSections.vue.mjs +104 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerSections.vue3.mjs +5 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerState.vue.mjs +45 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerState.vue3.mjs +5 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerTable.vue.mjs +259 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerTable.vue3.mjs +5 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerTree.vue.mjs +179 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerTree.vue3.mjs +5 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerValue.vue.mjs +146 -0
- package/library/components/VcJsonViewer/UiComponents/VcJsonViewerValue.vue3.mjs +5 -0
- package/library/components/VcJsonViewer/VcJsonViewer.vue.mjs +454 -0
- package/library/components/VcJsonViewer/VcJsonViewer.vue3.mjs +5 -0
- package/library/components/VcJsonViewer/jsonViewerText.mjs +41 -0
- package/library/components/VcJsonViewer/jsonViewerUtils.mjs +568 -0
- package/library/components/VcJsonViewer/useJsonViewerContext.mjs +25 -0
- package/library/components/VcLightbox/VcLightbox.vue.mjs +417 -0
- package/library/components/VcLightbox/VcLightbox.vue3.mjs +5 -0
- package/library/components/VcLoading/Loaders/Circles.vue.mjs +1 -1
- package/library/components/VcLoading/Loaders/Circles.vue2.mjs +3 -2
- package/library/components/VcLoading/Loaders/DotSpinner.vue.mjs +1 -1
- package/library/components/VcLoading/Loaders/DotSpinner.vue2.mjs +5 -4
- package/library/components/VcLoading/Loaders/LdsSpinner.vue.mjs +1 -1
- package/library/components/VcLoading/Loaders/LdsSpinner.vue2.mjs +3 -2
- package/library/components/VcLoading/Loaders/LoadIcon.vue.mjs +1 -1
- package/library/components/VcLoading/Loaders/LoadIcon.vue2.mjs +5 -4
- package/library/components/VcLoading/Loaders/Stretch.vue.mjs +1 -1
- package/library/components/VcLoading/Loaders/Stretch.vue2.mjs +4 -3
- package/library/components/VcLoading/VcLoading.vue.mjs +1 -1
- package/library/components/VcMdEditor/ParameterNode.vue.mjs +1 -1
- package/library/components/VcMdEditor/ParameterNode.vue2.mjs +3 -3
- package/library/components/VcMdEditor/VcMdEditor.vue.mjs +37 -12
- package/library/components/VcMdEditor/VcMdEditorContent.vue.mjs +10 -0
- package/library/components/VcMdEditor/VcMdEditorToolbar.vue.mjs +6 -6
- package/library/components/VcMdEditor/ltrNumbersPlugin.mjs +55 -0
- package/library/components/VcMdEditor/readonlyMarkdown.mjs +81 -0
- package/library/components/VcMdEditor/streamingInterval.mjs +12 -0
- package/library/components/VcMessage/VcMessage.vue.mjs +75 -42
- package/library/components/VcMessage/content/VcMessageFileBlock.vue.mjs +99 -14
- package/library/components/VcMessage/content/VcMessageMarkdownBlock.vue.mjs +5 -0
- package/library/components/VcMessage/content/VcMessageMarkdownBlock.vue2.mjs +33 -0
- package/library/components/VcMessage/content/VcMessageTextBlock.vue.mjs +21 -3
- package/library/components/VcMessage/content/markdownPreview.mjs +32 -0
- package/library/components/VcMessage/content/messageContentComponents.mjs +3 -1
- package/library/components/VcMessagesWrapper/VcMessagesWrapper.vue.mjs +120 -52
- package/library/components/VcMessagesWrapper/VcMessagesWrapperRow.vue.mjs +49 -29
- package/library/components/VcMeterGroup/VcMeterGroup.vue.mjs +1 -1
- package/library/components/VcModal/VcConfirmModal.vue.mjs +10 -9
- package/library/components/VcModal/VcModal.vue.mjs +21 -22
- package/library/components/VcNotification/VcNotification.vue.mjs +2 -2
- package/library/components/VcNotification/VcNotificationMessage.vue.mjs +14 -11
- package/library/components/VcPagination/VcPagination.vue.mjs +5 -4
- package/library/components/VcPdfViewer/UiComponents/VcPdfViewerToolbar.vue.mjs +166 -0
- package/library/components/VcPdfViewer/UiComponents/VcPdfViewerToolbar.vue3.mjs +5 -0
- package/library/components/VcPdfViewer/VcPdfDocument.vue.mjs +12 -76
- package/library/components/VcPdfViewer/VcPdfDocumentCard.vue.mjs +18 -8
- package/library/components/VcPdfViewer/VcPdfDocumentViewerFooter.vue.mjs +23 -7
- package/library/components/VcPdfViewer/VcPdfDocumentViewerToolbar.vue.mjs +23 -10
- package/library/components/VcPdfViewer/VcPdfViewer.vue.mjs +581 -0
- package/library/components/VcPdfViewer/VcPdfViewer.vue3.mjs +5 -0
- package/library/components/VcPdfViewer/pdfDocumentActions.mjs +90 -0
- package/library/components/VcPdfViewer/pdfDocumentParams.mjs +11 -0
- package/library/components/VcPdfViewer/pdfStandardFonts.mjs +21 -0
- package/library/components/VcPdfViewer/standard_fonts/FoxitDingbats.pfb +0 -0
- package/library/components/VcPdfViewer/standard_fonts/FoxitSymbol.pfb +0 -0
- package/library/components/VcPdfViewer/standard_fonts/LICENSE_FOXIT +27 -0
- package/library/components/VcPhoneInput/VcPhoneInput.vue.mjs +12 -6
- package/library/components/VcPopover/VcConfirmPopover.vue.mjs +3 -3
- package/library/components/VcPopover/VcSelectPopover.vue.mjs +2 -1
- package/library/components/VcProgress/VcProgress.vue.mjs +11 -20
- package/library/components/VcProgress/VcProgressCircular.vue.mjs +14 -23
- package/library/components/VcProgress/progress.options.mjs +21 -21
- package/library/components/VcSelect/VcInfiniteScrollSelect.vue.mjs +13 -7
- package/library/components/VcSelect/VcSelect.vue.mjs +18 -19
- package/library/components/VcSelect/VcSelectGrouped.vue.mjs +8 -5
- package/library/components/VcSkeletonLoader/Loaders/Card.vue.mjs +1 -1
- package/library/components/VcSkeletonLoader/Loaders/Circle.vue.mjs +1 -1
- package/library/components/VcSkeletonLoader/Loaders/Row.vue.mjs +1 -1
- package/library/components/VcSkeletonLoader/Loaders/Square.vue.mjs +1 -1
- package/library/components/VcSkeletonLoader/Loaders/Text.vue.mjs +1 -1
- package/library/components/VcSkeletonLoader/Loaders/Text.vue2.mjs +1 -1
- package/library/components/VcSoundplayer/VcPlayerPlayStopButton.vue.mjs +7 -6
- package/library/components/VcSoundplayer/VcPlayerPlaybackRatePopup.vue.mjs +2 -2
- package/library/components/VcSoundplayer/VcPlayerSkipButtons.vue.mjs +5 -4
- package/library/components/VcSoundplayer/VcSoundPlayer.vue.mjs +26 -23
- package/library/components/VcSoundplayer/VcSoundPlayerError.vue.mjs +5 -4
- package/library/components/VcSoundplayer/VcSoundPlayerMarker.vue.mjs +1 -1
- package/library/components/VcSoundplayer/VcSoundPlayerProgress.vue.mjs +1 -1
- package/library/components/VcSoundplayer/VcSoundPlayerWrapper.vue.mjs +5 -3
- package/library/components/VcSoundplayer/VcSoundVolume.vue.mjs +5 -4
- package/library/components/VcSoundplayer/player.options.mjs +13 -5
- package/library/components/VcSparkline/VcBarLine.vue.mjs +2 -2
- package/library/components/VcSparkline/VcTrendLine.vue.mjs +2 -2
- package/library/components/VcSplitButton/VcSplitButton.vue.mjs +18 -19
- package/library/components/VcSwitch/VcSwitch.vue.mjs +1 -1
- package/library/components/VcTable/VcTable.vue.mjs +18 -11
- package/library/components/VcTabs/VcTabNav.vue.mjs +11 -9
- package/library/components/VcTag/VcTag.vue.mjs +6 -4
- package/library/components/VcTagInput/VcTagInput.vue.mjs +10 -7
- package/library/components/VcTimeInput/VcTimeInput.vue.mjs +18 -8
- package/library/components/VcToolCall/UiComponents/VcToolCallValue.vue.mjs +64 -0
- package/library/components/VcToolCall/UiComponents/VcToolCallValue.vue3.mjs +5 -0
- package/library/components/VcToolCall/VcToolCall.vue.mjs +328 -0
- package/library/components/VcToolCall/VcToolCall.vue3.mjs +5 -0
- package/library/components/VcTree/VcTree.vue.mjs +8 -4
- package/library/components/VcTree/VcTreeSelect.vue.mjs +11 -7
- package/library/components/VcWizard/VcSummaryProgress.vue.mjs +10 -7
- package/library/components/VcWizard/VcSummaryStep.vue.mjs +8 -4
- package/library/components/VcWizard/VcWizardNavigation.vue.mjs +12 -8
- package/library/composables/input/useInputColor.mjs +3 -3
- package/library/composables/useElapsed.mjs +47 -0
- package/library/composables/useThrottledText.mjs +22 -0
- package/library/entity/components/Button/VcEntityAddButton.vue.mjs +4 -3
- package/library/entity/components/Button/VcEntityCancelButton.vue.mjs +4 -3
- package/library/entity/components/Button/VcEntityEditIconButton.vue.mjs +3 -2
- package/library/entity/components/Form/VcBaseVerticalForm.vue.mjs +6 -5
- package/library/entity/components/Form/VcEntityEditPageForm.vue.mjs +4 -3
- package/library/entity/components/Form/VcEntityVerticalEditForm.vue.mjs +7 -6
- package/library/entity/components/Table/VcEntityListTable.vue.mjs +15 -15
- package/library/enum/constants.mjs +5 -11
- package/library/enum/fileTypes.mjs +24 -39
- package/library/enum/inputDefaults.mjs +2 -2
- package/library/index.mjs +263 -235
- package/library/index.mjs.br +0 -0
- package/library/index.mjs.gz +0 -0
- package/library/localization/index.mjs.gz +0 -0
- package/library/localization/locales/en.json.mjs +172 -1
- package/library/plugin-components.gen.mjs +95 -68
- package/library/plugin.mjs +261 -233
- package/library/plugin.mjs.br +0 -0
- package/library/plugin.mjs.gz +0 -0
- package/library/style.css +174 -122
- package/library/style.css.br +0 -0
- package/library/style.css.gz +0 -0
- package/library/theme/index.mjs.gz +0 -0
- package/library/theme/themeMerge.mjs +32 -16
- package/library/theme/themes.json.mjs +172 -222
- package/library/tokens/tokens.mjs +2 -0
- package/library/types/components/VcAgentRun/UiComponents/VcAgentRunMetrics.vue.d.ts +46 -0
- package/library/types/components/VcAgentRun/UiComponents/VcAgentRunRow.vue.d.ts +20 -0
- package/library/types/components/VcAgentRun/VcAgentRunCard.vue.d.ts +104 -0
- package/library/types/components/VcAgentRun/VcAgentRunGroup.vue.d.ts +53 -0
- package/library/types/components/VcAgentRun/agentRunStatus.d.ts +13 -0
- package/library/types/components/VcAiReasoning/VcAiReasoning.vue.d.ts +85 -0
- package/library/types/components/VcApprovalCard/VcApprovalCard.vue.d.ts +101 -0
- package/library/types/components/VcAskUserCard/UiComponents/VcAskUserConfirm.vue.d.ts +41 -0
- package/library/types/components/VcAskUserCard/UiComponents/VcAskUserMultiSelect.vue.d.ts +42 -0
- package/library/types/components/VcAskUserCard/UiComponents/VcAskUserQuestionList.vue.d.ts +53 -0
- package/library/types/components/VcAskUserCard/UiComponents/VcAskUserRankPriorities.vue.d.ts +42 -0
- package/library/types/components/VcAskUserCard/UiComponents/VcAskUserSingleSelect.vue.d.ts +42 -0
- package/library/types/components/VcAskUserCard/UiComponents/VcAskUserText.vue.d.ts +42 -0
- package/library/types/components/VcAskUserCard/UiComponents/askUserControl.d.ts +25 -0
- package/library/types/components/VcAskUserCard/VcAskUserCard.vue.d.ts +84 -0
- package/library/types/components/VcAskUserCard/askUserAnswers.d.ts +57 -0
- package/library/types/components/VcAutocomplete/VcAutocomplete.vue.d.ts +72 -72
- package/library/types/components/VcAvatar/VcAvatar.vue.d.ts +1 -1
- package/library/types/components/VcBadgeTag/VcBadgeTag.vue.d.ts +1 -1
- package/library/types/components/VcButton/VcButton.vue.d.ts +7 -7
- package/library/types/components/VcButton/VcButtonIcon.vue.d.ts +12 -13
- package/library/types/components/VcButton/VcToggleButton.vue.d.ts +4 -4
- package/library/types/components/VcChatComposer/VcChatComposer.vue.d.ts +43 -15
- package/library/types/components/VcCheckbox/VcCheckbox.vue.d.ts +24 -24
- package/library/types/components/VcCheckbox/VcCheckboxButton.vue.d.ts +18 -18
- package/library/types/components/VcCheckbox/VcCheckboxButtonGroup.vue.d.ts +15 -15
- package/library/types/components/VcCheckboxGroup/VcCheckboxGroup.vue.d.ts +12 -12
- package/library/types/components/VcCodeBlock/VcCodeBlock.vue.d.ts +1 -1
- package/library/types/components/VcCollapse/VcCollapseItem.vue.d.ts +3 -3
- package/library/types/components/VcColorPicker/VcColorPicker.vue.d.ts +1 -1
- package/library/types/components/VcDatePicker/VcDatePicker.vue.d.ts +21 -21
- package/library/types/components/VcDatePickerPanel/VcDatePickerPanel.vue.d.ts +18 -18
- package/library/types/components/VcDropdown/VcDropdown.vue.d.ts +4 -4
- package/library/types/components/VcEmojiPicker/VcEmojiPicker.vue.d.ts +1 -1
- package/library/types/components/VcExcelUploader/VcExcelFileProcessLoader.vue.d.ts +1 -1
- package/library/types/components/VcExcelUploader/VcExcelFileUploader.vue.d.ts +6 -5
- package/library/types/components/VcExtendedDatetimeRangePicker/ExtendedDatetimeRangePickerPart.vue.d.ts +1 -1
- package/library/types/components/VcExtendedDatetimeRangePicker/ExtendedDatetimeRangePickerRelative.vue.d.ts +4 -4
- package/library/types/components/VcExtendedDatetimeRangePicker/VcExtendedDatetimeRangePicker.vue.d.ts +11 -11
- package/library/types/components/VcFileUploader/VcFileItem.vue.d.ts +10 -45
- package/library/types/components/VcFileUploader/VcFileUploader.vue.d.ts +6 -6
- package/library/types/components/VcFileUploader/VcFileUploaderArea.vue.d.ts +6 -6
- package/library/types/components/VcFileUploader/VcFileUploaderSimple.vue.d.ts +6 -6
- package/library/types/components/VcFileUploader/VcSimpleUploaderAction.vue.d.ts +2 -2
- package/library/types/components/VcForm/VcForm.vue.d.ts +3 -3
- package/library/types/components/VcHtmlEditor/VcHtmlEditor.vue.d.ts +2 -2
- package/library/types/components/VcHtmlEditor/VcHtmlEditorToolbar.vue.d.ts +1 -1
- package/library/types/components/VcHtmlEditor/htmlEditor.config.d.ts +3 -3
- package/library/types/components/VcHyperLink/VcHyperLink.vue.d.ts +3 -3
- package/library/types/components/VcIconPicker/VcIconPicker.vue.d.ts +6 -6
- package/library/types/components/VcImageUploader/VcImageUploader.vue.d.ts +3 -3
- package/library/types/components/VcInput/VcInput.vue.d.ts +11 -11
- package/library/types/components/VcInputNumber/VcInputNumber.vue.d.ts +3 -3
- package/library/types/components/VcJsonViewer/UiComponents/VcJsonViewerAuto.vue.d.ts +42 -0
- package/library/types/components/VcJsonViewer/UiComponents/VcJsonViewerCards.vue.d.ts +18 -0
- package/library/types/components/VcJsonViewer/UiComponents/VcJsonViewerFields.vue.d.ts +32 -0
- package/library/types/components/VcJsonViewer/UiComponents/VcJsonViewerKey.vue.d.ts +31 -0
- package/library/types/components/VcJsonViewer/UiComponents/VcJsonViewerMore.vue.d.ts +25 -0
- package/library/types/components/VcJsonViewer/UiComponents/VcJsonViewerObject.vue.d.ts +34 -0
- package/library/types/components/VcJsonViewer/UiComponents/VcJsonViewerSections.vue.d.ts +39 -0
- package/library/types/components/VcJsonViewer/UiComponents/VcJsonViewerState.vue.d.ts +46 -0
- package/library/types/components/VcJsonViewer/UiComponents/VcJsonViewerTable.vue.d.ts +18 -0
- package/library/types/components/VcJsonViewer/UiComponents/VcJsonViewerTree.vue.d.ts +18 -0
- package/library/types/components/VcJsonViewer/UiComponents/VcJsonViewerValue.vue.d.ts +37 -0
- package/library/types/components/VcJsonViewer/VcJsonViewer.vue.d.ts +162 -0
- package/library/types/components/VcJsonViewer/jsonViewerText.d.ts +8 -0
- package/library/types/components/VcJsonViewer/jsonViewerUtils.d.ts +127 -0
- package/library/types/components/VcJsonViewer/useJsonViewerContext.d.ts +5 -0
- package/library/types/components/VcLightbox/VcLightbox.vue.d.ts +90 -0
- package/library/types/components/VcLoading/Loaders/LoadIcon.vue.d.ts +2 -2
- package/library/types/components/VcLoading/VcLoading.vue.d.ts +2 -2
- package/library/types/components/VcLoading/enum.d.ts +2 -2
- package/library/types/components/VcMdEditor/VcMdEditor.vue.d.ts +111 -55
- package/library/types/components/VcMdEditor/VcMdEditorContent.vue.d.ts +3 -3
- package/library/types/components/VcMdEditor/VcMdEditorToolbar.vue.d.ts +1 -1
- package/library/types/components/VcMdEditor/ltrNumbersPlugin.d.ts +16 -0
- package/library/types/components/VcMdEditor/readonlyMarkdown.d.ts +7 -0
- package/library/types/components/VcMdEditor/streamingInterval.d.ts +7 -0
- package/library/types/components/VcMessage/VcMessage.vue.d.ts +24 -3
- package/library/types/components/VcMessage/content/VcMessageFileBlock.vue.d.ts +6 -2
- package/library/types/components/VcMessage/content/VcMessageMarkdownBlock.vue.d.ts +24 -0
- package/library/types/components/VcMessage/content/markdownPreview.d.ts +1 -0
- package/library/types/components/VcMessage/reactions/VcMessageEmojiPicker.vue.d.ts +1 -1
- package/library/types/components/VcMessagesWrapper/VcMessagesWrapper.vue.d.ts +223 -84
- package/library/types/components/VcMessagesWrapper/VcMessagesWrapperRow.vue.d.ts +89 -42
- package/library/types/components/VcMeterGroup/VcMeterGroup.vue.d.ts +2 -2
- package/library/types/components/VcMeterGroup/VcMeterGroupLabel.vue.d.ts +1 -1
- package/library/types/components/VcModal/VcModal.vue.d.ts +3 -3
- package/library/types/components/VcNotification/VcNotification.vue.d.ts +1 -1
- package/library/types/components/VcOtpInput/VcOtpInput.vue.d.ts +8 -8
- package/library/types/components/VcPagination/VcPagination.vue.d.ts +1 -1
- package/library/types/components/VcPagination/VcPaginationButton.vue.d.ts +4 -4
- package/library/types/components/VcPdfViewer/UiComponents/VcPdfViewerToolbar.vue.d.ts +64 -0
- package/library/types/components/VcPdfViewer/VcPdfDocumentViewerToolbar.vue.d.ts +1 -1
- package/library/types/components/VcPdfViewer/VcPdfViewer.vue.d.ts +114 -0
- package/library/types/components/VcPdfViewer/pdfDocumentActions.d.ts +29 -0
- package/library/types/components/VcPdfViewer/pdfDocumentParams.d.ts +14 -0
- package/library/types/components/VcPdfViewer/pdfStandardFonts.d.ts +9 -0
- package/library/types/components/VcPhoneInput/VcPhoneInput.vue.d.ts +8 -8
- package/library/types/components/VcPopover/VcConfirmPopover.vue.d.ts +1 -1
- package/library/types/components/VcPopover/VcPopover.vue.d.ts +1 -1
- package/library/types/components/VcPopover/VcSelectPopover.vue.d.ts +3 -3
- package/library/types/components/VcProgress/VcProgress.vue.d.ts +1 -1
- package/library/types/components/VcProgress/VcProgressCircular.vue.d.ts +4 -4
- package/library/types/components/VcProgress/progress.options.d.ts +9 -7
- package/library/types/components/VcRadio/VcRadio.vue.d.ts +15 -15
- package/library/types/components/VcRadioButtons/VcRadioButtonsGroup.vue.d.ts +9 -9
- package/library/types/components/VcRadioGroup/VcRadioGroup.vue.d.ts +12 -12
- package/library/types/components/VcRadioTabs/VcRadioTabs.vue.d.ts +6 -6
- package/library/types/components/VcSegmented/VcSegmented.vue.d.ts +18 -18
- package/library/types/components/VcSelect/VcInfiniteScrollSelect.vue.d.ts +42 -42
- package/library/types/components/VcSelect/VcSelect.vue.d.ts +51 -51
- package/library/types/components/VcSelect/VcSelectGrouped.vue.d.ts +48 -48
- package/library/types/components/VcSelect/VcSelectOption.vue.d.ts +9 -9
- package/library/types/components/VcSkeletonLoader/VcSkeletonLoader.vue.d.ts +1 -1
- package/library/types/components/VcSoundplayer/VcPlayerPlayStopButton.vue.d.ts +6 -6
- package/library/types/components/VcSoundplayer/VcPlayerSkipButtons.vue.d.ts +4 -4
- package/library/types/components/VcSoundplayer/VcSoundPlayerMarker.vue.d.ts +2 -2
- package/library/types/components/VcSoundplayer/VcSoundVolume.vue.d.ts +4 -4
- package/library/types/components/VcSoundplayer/player.options.d.ts +1 -0
- package/library/types/components/VcSparkline/VcBarLine.vue.d.ts +4 -4
- package/library/types/components/VcSparkline/VcSparkline.vue.d.ts +4 -4
- package/library/types/components/VcSparkline/VcTrendLine.vue.d.ts +4 -4
- package/library/types/components/VcSplitButton/VcSplitButton.vue.d.ts +6 -6
- package/library/types/components/VcSwitch/VcSwitch.vue.d.ts +24 -24
- package/library/types/components/VcSystemUserPrompt/VcSystemUserPrompt.vue.d.ts +4 -4
- package/library/types/components/VcTable/VcTable.vue.d.ts +6 -3
- package/library/types/components/VcTabs/VcTabPane.vue.d.ts +1 -1
- package/library/types/components/VcTabs/VcTabs.vue.d.ts +1 -1
- package/library/types/components/VcTag/VcTag.vue.d.ts +3 -3
- package/library/types/components/VcTagInput/VcTagInput.vue.d.ts +14 -14
- package/library/types/components/VcTimeInput/VcTimeInput.vue.d.ts +5 -5
- package/library/types/components/VcToolCall/UiComponents/VcToolCallValue.vue.d.ts +66 -0
- package/library/types/components/VcToolCall/VcToolCall.vue.d.ts +91 -0
- package/library/types/components/VcTour/VcTour.vue.d.ts +1 -1
- package/library/types/components/VcTransfer/VcTransfer.vue.d.ts +3 -3
- package/library/types/components/VcTree/VcTree.vue.d.ts +18 -18
- package/library/types/components/VcTree/VcTreeSelect.vue.d.ts +42 -42
- package/library/types/components/VcVerticalTabs/VcVerticalTabs.vue.d.ts +3 -3
- package/library/types/components/VcVerticalTabs/VerticalTabNav.vue.d.ts +3 -3
- package/library/types/components/VcViewSwitcher/VcViewSwitcher.vue.d.ts +9 -9
- package/library/types/components/VcWizard/VcSummaryProgress.vue.d.ts +2 -2
- package/library/types/components/VcWizard/VcWizardSummary.vue.d.ts +1 -1
- package/library/types/components/exports.d.ts +19 -1
- package/library/types/components.gen.d.ts +9 -0
- package/library/types/composables/input/useFileUploader.d.ts +2 -2
- package/library/types/composables/useElapsed.d.ts +38 -0
- package/library/types/composables/useThrottledText.d.ts +16 -0
- package/library/types/entity/components/Table/VcEntityListTable.vue.d.ts +3 -3
- package/library/types/entity/components/Tabs/VcEntityEditableTabs.vue.d.ts +3 -3
- package/library/types/enum/constants.d.ts +2 -10
- package/library/types/enum/inputDefaults.d.ts +2 -2
- package/library/types/localization/locales/en.json.d.ts +365 -194
- package/library/types/theme/themes.json.d.ts +177 -227
- package/library/types/tokens/tokens.d.ts +2 -1
- package/library/types/types/VcAgentRun.types.d.ts +197 -0
- package/library/types/types/VcAiChat.types.d.ts +5 -0
- package/library/types/types/VcAiReasoning.types.d.ts +67 -0
- package/library/types/types/VcApprovalCard.types.d.ts +109 -0
- package/library/types/types/VcAskUserCard.types.d.ts +166 -0
- package/library/types/types/VcChatComposer.types.d.ts +86 -0
- package/library/types/types/VcDropdown.types.d.ts +1 -1
- package/library/types/types/VcFileUploader.types.d.ts +26 -0
- package/library/types/types/VcJsonViewer.types.d.ts +41 -0
- package/library/types/types/VcLightbox.types.d.ts +112 -0
- package/library/types/types/VcMessage.types.d.ts +42 -4
- package/library/types/types/VcMessagesWrapper.types.d.ts +100 -12
- package/library/types/types/VcOtpInput.types.d.ts +1 -1
- package/library/types/types/VcPdfViewer.types.d.ts +138 -0
- package/library/types/types/VcProgress.types.d.ts +1 -1
- package/library/types/types/VcToolCall.types.d.ts +102 -0
- package/library/types/types/index.d.ts +9 -1
- package/library/types/utils/aiChat.d.ts +50 -0
- package/library/types/utils/download.d.ts +5 -0
- package/library/types/utils/elementPlusIcons.d.ts +9 -0
- package/library/types/utils/fileAccept.d.ts +30 -0
- package/library/types/utils/i18nParams.d.ts +8 -0
- package/library/types/utils/numberRuns.d.ts +21 -0
- package/library/types/utils/themeColor.d.ts +1 -0
- package/library/utils/UniqueComponentId.mjs +2 -2
- package/library/utils/aiChat.mjs +121 -0
- package/library/utils/download.mjs +13 -0
- package/library/utils/elementPlusIcons.mjs +14 -0
- package/library/utils/fileAccept.mjs +66 -0
- package/library/utils/i18nParams.mjs +6 -0
- package/library/utils/jsonSchema/index.mjs.gz +0 -0
- package/library/utils/numberRuns.mjs +63 -0
- package/library/utils/themeColor.mjs +9 -0
- package/package.json +216 -215
- package/src/theme/index.ts +101 -101
- package/src/theme/tailwindScheme.js +70 -37
- package/src/theme/theme.types.ts +31 -31
- package/src/theme/themeMerge.ts +61 -40
- package/src/theme/themes.json +177 -227
- package/tailwind.config.d.ts +5 -5
- package/tailwind.config.js +176 -192
- package/library/types/types/VcTagInput.types.d.ts +0 -1
package/README.md
CHANGED
|
@@ -1,558 +1,1023 @@
|
|
|
1
|
-
# Voicenter UI library for Vue
|
|
2
|
-
This is Vue 3.x + Typescript component library made for Voicenter systems.
|
|
3
|
-
|
|
4
|
-
> **
|
|
5
|
-
|
|
6
|
-
## Installation
|
|
7
|
-
|
|
8
|
-
```bash
|
|
9
|
-
npm i @voicenter-team/voicenter-ui-plus
|
|
10
|
-
npm i vue@^3.5 element-plus @vueuse/core dayjs lodash-es libphonenumber-js maska
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
|
28
|
-
|
|
29
|
-
| `
|
|
30
|
-
| `
|
|
31
|
-
| `
|
|
32
|
-
| `
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
###
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
-
|
|
197
|
-
|
|
198
|
-
-
|
|
199
|
-
|
|
200
|
-
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
-
|
|
253
|
-
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
-
|
|
258
|
-
-
|
|
259
|
-
- The
|
|
260
|
-
|
|
261
|
-
###
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
'
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
-
|
|
502
|
-
-
|
|
503
|
-
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
`
|
|
524
|
-
|
|
525
|
-
`
|
|
526
|
-
`
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
`
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
-
|
|
558
|
-
-
|
|
1
|
+
# Voicenter UI library for Vue
|
|
2
|
+
This is Vue 3.x + Typescript component library made for Voicenter systems.
|
|
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).
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm i @voicenter-team/voicenter-ui-plus
|
|
10
|
+
npm i vue@^3.5 element-plus @vueuse/core @lucide/vue dayjs lodash-es libphonenumber-js maska
|
|
11
|
+
```
|
|
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
|
+
|
|
15
|
+
### Sass compiler (build-time)
|
|
16
|
+
|
|
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:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm i -D sass-embedded
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This is a **build-time only** requirement — it doesn't add anything to your runtime bundle. Most Vue 3 / Vite projects already have it.
|
|
24
|
+
|
|
25
|
+
Optional peer deps — install only for the heavy components you use:
|
|
26
|
+
|
|
27
|
+
| Component | Peer deps |
|
|
28
|
+
|---|---|
|
|
29
|
+
| `VcPdfDocument` / `VcPdfViewer` | `pdfjs-dist@^2.16.105` |
|
|
30
|
+
| `VcSoundPlayer` | `wavesurfer.js` |
|
|
31
|
+
| `VcExcelFileUploader` | `xlsx` |
|
|
32
|
+
| `VcImageUploader` | `vue-advanced-cropper` |
|
|
33
|
+
| `VcHtmlEditor` / `VcJsonSchema` | `codemirror @codemirror/lang-html @codemirror/lang-json @codemirror/lang-markdown vue-codemirror6` |
|
|
34
|
+
| `VcMdEditor` | `@milkdown/crepe @milkdown/kit @milkdown/utils @milkdown/vue` (all `^7.22.0`: older releases lose every list with the current `prosemirror-model`) `@prosemirror-adapter/vue codemirror @codemirror/lang-markdown vue-codemirror6` |
|
|
35
|
+
| `VcAiReasoning` | the `VcMdEditor` peers |
|
|
36
|
+
| `VcAgentRunCard` / `VcAgentRunGroup` | the `VcMdEditor` peers and `highlight.js` (tool steps and response data through `VcJsonViewer` / `VcCodeBlock`) |
|
|
37
|
+
| `VcToolCall` / `VcApprovalCard` | `highlight.js` (through `VcJsonViewer` / `VcCodeBlock`) |
|
|
38
|
+
| `VcMessage` | the `VcMdEditor` peers, only when a message has a `markdown` block (the block is loaded on demand) |
|
|
39
|
+
| `VcChatComposer` | `@tiptap/core @tiptap/pm @tiptap/vue-3 @tiptap/extension-document @tiptap/extension-paragraph @tiptap/extension-text @tiptap/extension-bold @tiptap/extension-italic @tiptap/extension-strike @tiptap/extension-code @tiptap/extension-mention @tiptap/extensions @tiptap/suggestion @floating-ui/dom emojibase-data wavesurfer.js` |
|
|
40
|
+
| `VcLightbox` | `element-plus` (its `ElImageViewer`; already a required peer) |
|
|
41
|
+
|
|
42
|
+
### If you're on Vite 8 / rolldown (and skipping some optional peers)
|
|
43
|
+
|
|
44
|
+
Vite 8's rolldown-based bundler validates named imports against optional-peer-dep stubs and fails the build with `MISSING_EXPORT` errors when a heavy component's peer is uninstalled — even when you don't use that component. Add the unused optional peers to `build.rollupOptions.external` in your `vite.config.ts`:
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
// vite.config.ts
|
|
48
|
+
import { defineConfig } from 'vite'
|
|
49
|
+
import vue from '@vitejs/plugin-vue'
|
|
50
|
+
|
|
51
|
+
export default defineConfig({
|
|
52
|
+
plugins: [ vue() ],
|
|
53
|
+
build: {
|
|
54
|
+
rollupOptions: {
|
|
55
|
+
external: [
|
|
56
|
+
// List only the heavy peers you DON'T install
|
|
57
|
+
/^@milkdown\//, /^@prosemirror/, /^@codemirror\//, /^codemirror/,
|
|
58
|
+
/^vue-codemirror6/, /^vue-advanced-cropper/,
|
|
59
|
+
'wavesurfer.js', 'xlsx', 'pdfjs-dist', /^pdfjs-dist\//
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Earlier Vite versions (5, 6, 7 with rollup) and webpack 5+ don't require this — the older rollup variant warns but doesn't error on optional-peer named imports.
|
|
67
|
+
|
|
68
|
+
## Usage
|
|
69
|
+
|
|
70
|
+
### Tree-shake mode (recommended)
|
|
71
|
+
```ts
|
|
72
|
+
import { VcButton, VcInput } from '@voicenter-team/voicenter-ui-plus'
|
|
73
|
+
// Use as local components — no app.use() needed.
|
|
74
|
+
```
|
|
75
|
+
Bundlers drop unused components and their CSS. A consumer importing only `VcButton` ships ~50–150 KB JS + ~10–30 KB CSS.
|
|
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
|
+
|
|
87
|
+
If you use `useConfirmModal`, `useConfirmPopup`, or `NotifyService`, mount global overlays in `App.vue`:
|
|
88
|
+
|
|
89
|
+
```vue
|
|
90
|
+
<script setup lang="ts">
|
|
91
|
+
import { VcPluginOverlays } from '@voicenter-team/voicenter-ui-plus'
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<template>
|
|
95
|
+
<RouterView />
|
|
96
|
+
<VcPluginOverlays />
|
|
97
|
+
</template>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Plugin mode (global registration)
|
|
101
|
+
```ts
|
|
102
|
+
import VoicenterUI from '@voicenter-team/voicenter-ui-plus/plugin'
|
|
103
|
+
import '@voicenter-team/voicenter-ui-plus/style.css'
|
|
104
|
+
|
|
105
|
+
// Overlay composables can be imported from the same entry:
|
|
106
|
+
// import { useConfirmModal, useConfirmPopup, VcPluginOverlays } from '@voicenter-team/voicenter-ui-plus/plugin'
|
|
107
|
+
|
|
108
|
+
app.use(VoicenterUI, {
|
|
109
|
+
themeConfig, // theme config (see below)
|
|
110
|
+
lang: 'en', // localization
|
|
111
|
+
injectIconFont: true // the vc-icon-* font, for vc-icon-* classes
|
|
112
|
+
})
|
|
113
|
+
// Confirm modals/popovers/notifications: auto-mounted via VcPluginOverlays
|
|
114
|
+
// (mountOverlays: true by default). Opt out with mountOverlays: false and
|
|
115
|
+
// add <VcPluginOverlays /> to App.vue — also registered globally by the plugin.
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Global overlays
|
|
119
|
+
|
|
120
|
+
Several APIs are **state-only** — they update global reactive singletons but do not render UI by themselves:
|
|
121
|
+
|
|
122
|
+
| API | Overlay component |
|
|
123
|
+
|---|---|
|
|
124
|
+
| `useConfirmModal` | `VcConfirmModal` |
|
|
125
|
+
| `useConfirmPopup` | `VcConfirmPopover` |
|
|
126
|
+
| `NotifyService` / `$notify` | `VcNotification` |
|
|
127
|
+
|
|
128
|
+
**Plugin mode:** mounted automatically on `app.use()` (default). Pass `mountOverlays: false` to mount manually.
|
|
129
|
+
|
|
130
|
+
**Notifications:** one top-right host by default. For multiple positions, use `overlayNotifications` in plugin config or mount your own:
|
|
131
|
+
|
|
132
|
+
```ts
|
|
133
|
+
app.use(VoicenterUI, {
|
|
134
|
+
overlayNotifications: [
|
|
135
|
+
{ group: 'top-right', position: 'top-right' },
|
|
136
|
+
{ group: 'bottom-right', position: 'bottom-right' },
|
|
137
|
+
],
|
|
138
|
+
})
|
|
139
|
+
// NotifyService.add({ group: 'bottom-right', ... })
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Or `overlayNotifications: 'none'` and put `<VcNotification />` in App.vue (confirms still auto-mount).
|
|
143
|
+
|
|
144
|
+
**Tree-shake mode:** add `<VcPluginOverlays />` to `App.vue` (bundles confirm hosts; configure via `notifications` prop).
|
|
145
|
+
|
|
146
|
+
Entity components such as `VcEntityListTable` call `useConfirmModal` internally — delete confirmations require overlays to be mounted.
|
|
147
|
+
|
|
148
|
+
### Tailwind
|
|
149
|
+
|
|
150
|
+
The scheme and the shipped `tailwind.config.js` are Tailwind 3 configurations: an application installs `tailwindcss@3`, `postcss` and `autoprefixer` (`npx tailwindcss init -p` creates its configuration).
|
|
151
|
+
|
|
152
|
+
Tailwind's colours come from the library scheme, so the utility classes and the theme are one set of tokens. `theme.colors` replaces Tailwind's own palette on purpose: only the library's colours exist as classes.
|
|
153
|
+
|
|
154
|
+
```js
|
|
155
|
+
// tailwind.config.js
|
|
156
|
+
const voiceTailwindScheme = require('@voicenter-team/voicenter-ui-plus/src/theme/tailwindScheme')
|
|
157
|
+
|
|
158
|
+
module.exports = {
|
|
159
|
+
...yourConfiguration,
|
|
160
|
+
theme: {
|
|
161
|
+
colors: { ...voiceTailwindScheme },
|
|
162
|
+
borderColor: { ...voiceTailwindScheme },
|
|
163
|
+
fill: voiceTailwindScheme
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
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:
|
|
169
|
+
|
|
170
|
+
```js
|
|
171
|
+
// tailwind.config.js
|
|
172
|
+
const uiPlusTheme = require('@voicenter-team/voicenter-ui-plus/tailwind.config').theme
|
|
173
|
+
|
|
174
|
+
module.exports = {
|
|
175
|
+
...yourConfiguration,
|
|
176
|
+
theme: {
|
|
177
|
+
// colours as above
|
|
178
|
+
extend: {
|
|
179
|
+
borderRadius: uiPlusTheme.borderRadius,
|
|
180
|
+
boxShadow: uiPlusTheme.boxShadow,
|
|
181
|
+
transitionProperty: uiPlusTheme.extend.transitionProperty,
|
|
182
|
+
fontFamily: uiPlusTheme.fontFamily,
|
|
183
|
+
fontWeight: uiPlusTheme.extend.fontWeight
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
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).
|
|
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
|
+
|
|
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.
|
|
194
|
+
|
|
195
|
+
### Theming specification
|
|
196
|
+
The `themeConfig` passed to `app.use(VoicenterUI, { themeConfig })`, or to `Theme()` in tree-shake mode, could have the following specifications.
|
|
197
|
+
|
|
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:
|
|
199
|
+
|
|
200
|
+
- `vc-content-*`: text and icons (`primary`, `secondary`, `tertiary`, `disabled`, `success`, `warning`, `danger`, `info`); the built-in themes also set `vc-content-warning-icon`, which no component reads;
|
|
201
|
+
- `vc-bg-*`: backgrounds (`page`, `surface`, `inset`, `inset-strong`, `field`, `muted`, `overlay`);
|
|
202
|
+
- `vc-action-*`: fills of interactive elements (`primary`, `secondary`, `info`, `success`, `warning`, `danger`);
|
|
203
|
+
- `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`;
|
|
204
|
+
- `vc-border`, `vc-border-strong`, `vc-input` (field borders), `vc-ring` (focus ring), `vc-shadow-color`;
|
|
205
|
+
- `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.
|
|
206
|
+
|
|
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.
|
|
208
|
+
|
|
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).
|
|
210
|
+
|
|
211
|
+
### Local
|
|
212
|
+
**Config:**
|
|
213
|
+
```js
|
|
214
|
+
{
|
|
215
|
+
type: 'local'
|
|
216
|
+
themeName: 'voicenter' | 'voicenterRed' | 'red' | 'redGreen' | 'black'
|
|
217
|
+
onSetupCallback: () => {
|
|
218
|
+
console.log('Loaded!')
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
**Description:**
|
|
223
|
+
|
|
224
|
+
Such configuration will append to the document element the CSS variables from one of the configuration passed in `themeName` parameter which it will get from theme specification delivered alongside with library
|
|
225
|
+
|
|
226
|
+
**Params:**
|
|
227
|
+
- **themeName**
|
|
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.
|
|
229
|
+
- **onSetupCallback**
|
|
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
|
|
231
|
+
|
|
232
|
+
### Remote
|
|
233
|
+
**Config:**
|
|
234
|
+
```js
|
|
235
|
+
{
|
|
236
|
+
type: 'remote'
|
|
237
|
+
brandingSectionName: 'someName'
|
|
238
|
+
apiUrl: 'someUrl'
|
|
239
|
+
brandingSectionName: {
|
|
240
|
+
property: 'data'
|
|
241
|
+
}
|
|
242
|
+
onSetupCallback: () => {
|
|
243
|
+
console.log('Loaded!')
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
```
|
|
247
|
+
**Description:**
|
|
248
|
+
|
|
249
|
+
Such configuration will initiate the call to the specified apiUrl in order to retrieve the JSON object with key-value properties of the CSS variables to inject to document element
|
|
250
|
+
|
|
251
|
+
**Params:**
|
|
252
|
+
- **brandingSectionName**
|
|
253
|
+
- [Optional] The name of the section (tagSection) in the database configuration which will be passed to the API in payload and on response retrieved replaced from resulted values
|
|
254
|
+
- **apiUrl**
|
|
255
|
+
- The API url to which the POST request will be initiated
|
|
256
|
+
- **onSetupCallback**
|
|
257
|
+
- 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
|
|
258
|
+
- **brandingSectionName**
|
|
259
|
+
- [Optional] The payload data that will be sent to the request
|
|
260
|
+
|
|
261
|
+
### Custom JSON
|
|
262
|
+
**Config:**
|
|
263
|
+
```js
|
|
264
|
+
{
|
|
265
|
+
type: 'customJson'
|
|
266
|
+
config: {
|
|
267
|
+
'vc-action-primary': '#E80130',
|
|
268
|
+
'vc-content-primary': '#1F2937'
|
|
269
|
+
}
|
|
270
|
+
onSetupCallback: () => {
|
|
271
|
+
console.log('Loaded!')
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
```
|
|
275
|
+
**Description:**
|
|
276
|
+
|
|
277
|
+
Such configuration will initiate the styling with custom provided theme
|
|
278
|
+
|
|
279
|
+
**Params:**
|
|
280
|
+
- **config**
|
|
281
|
+
- The object where the key is the variable to be set and the value is the variable value. The keys are the theme keys described above; check the [themes object](https://github.com/VoicenterTeam/voicenter-ui-plus/blob/master/src/theme/themes.json) for the full list.
|
|
282
|
+
- **onSetupCallback**
|
|
283
|
+
- 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
|
|
284
|
+
|
|
285
|
+
### None
|
|
286
|
+
`{ type: 'none', onSetupCallback?: (theme) => void }` injects no theme variables; the application sets them itself.
|
|
287
|
+
|
|
288
|
+
## Migrating from 3.x to 4.x
|
|
289
|
+
|
|
290
|
+
### What changed and why
|
|
291
|
+
|
|
292
|
+
- **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).
|
|
293
|
+
- **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).
|
|
294
|
+
- **Corners** take one of five radius roles, `control`, `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).
|
|
295
|
+
- **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).
|
|
296
|
+
- **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).
|
|
297
|
+
- **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).
|
|
298
|
+
- **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.
|
|
299
|
+
|
|
300
|
+
### Colour names
|
|
301
|
+
|
|
302
|
+
In 4.x the colours are named by their role: `content` for text and icons, `bg` for backgrounds, `action` for the fills of interactive elements, `onfill` for text on a fill, and `border`, `input` and `ring` for lines. The 3.x colour names are gone: a 3.x CSS variable is not set, a 3.x Tailwind colour class is not generated and a 3.x theme key is not read. An application moves every colour it takes from ui-plus to the 4.x name in the tables below.
|
|
303
|
+
|
|
304
|
+
Hover, pressed and tinted states keep one pattern. In CSS variables, `--focus` (hover) becomes `--hover`, `--pressed` stays `--pressed`, and `-bg--focus` and `-bg--pressed` (the 10% and 20% washes) become `--subtle-hover` and `--subtle-pressed`: `--primary-actions-bg--focus` is `--vc-action-primary--subtle-hover`. Tailwind names use one dash: `bg-action-primary-hover`, `bg-action-primary-subtle-hover`. `destructive` and `error` are both `danger`; `primary-alternative` and `active-elements` are both `primary`.
|
|
305
|
+
|
|
306
|
+
What keeps its name:
|
|
307
|
+
|
|
308
|
+
- the `color` prop values of the components: `primary`, `secondary`, `destructive`, `success` and `warning`; `info` is new, and `active` and `primary-alternative` are removed (see "Styles and component defaults");
|
|
309
|
+
- the shadow classes (`shadow-card`, `shadow-table`, `shadow-hover-outer-primary`, …) apart from the focus classes, `shadow-hover`, `shadow-hover-{colour}` and `shadow-hover-outer-destructive` (see "Styles and component defaults"): they read the 4.x tokens;
|
|
310
|
+
- the Element Plus variables (`--el-color-primary`, `--el-border-color`, …): the library fills them from the 4.x tokens.
|
|
311
|
+
|
|
312
|
+
Props that take a Tailwind colour name take the 4.x name: `VcCollapseItem` `color-icon="action-primary"` and `color-border="border"` (the defaults). The `color` of `VcLoading` takes a component colour (`primary`, `destructive`, …) or a 4.x Tailwind colour name (`content-secondary`).
|
|
313
|
+
|
|
314
|
+
Some 3.x names had a value of their own in the built-in themes and now share a token, so they draw differently:
|
|
315
|
+
|
|
316
|
+
- `icons` and `table-headings` were an accent colour of their own in red and black and the brand colour in redGreen, and `headers` an accent colour in black; they are `content-primary`, the body text colour.
|
|
317
|
+
- `default-text` (red, voicenterRed) and `heading-text` (red) differed from `primary-text`; all three are `content-primary`.
|
|
318
|
+
- `primary-alternative` had a colour of its own in every theme; it is `action-primary`.
|
|
319
|
+
- `active-elements` had a colour of its own in red; it is `action-primary`.
|
|
320
|
+
- `inactive-elements` was the secondary colour in red, redGreen and black; it is `content-disabled`.
|
|
321
|
+
- `progress-line-done` was a neutral grey in red, redGreen and black; it is `action-success`. `progress-line-not-done` was the secondary colour in red and redGreen and a dark grey in black; it is `border`.
|
|
322
|
+
- `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.
|
|
323
|
+
- `destructive` and `error` were two colours in redGreen and black; both are `action-danger`.
|
|
324
|
+
|
|
325
|
+
Some names keep their meaning but have a new value in some themes: `dark-bg` (`bg-inset-strong`) in red and redGreen; `destructive`, `error`, `success`, `warning` and `actions-mix-color` in voicenterRed. The 3.x theme `blue` is not a 4.x theme: `themeName: 'blue'` logs a warning and the default theme is used.
|
|
326
|
+
|
|
327
|
+
For the brand colour, use `action-primary`.
|
|
328
|
+
|
|
329
|
+
### CSS variables
|
|
330
|
+
|
|
331
|
+
| 3.x variable | 4.x |
|
|
332
|
+
| --- | --- |
|
|
333
|
+
| `--main-bg` | `var(--vc-bg-page)` |
|
|
334
|
+
| `--light-bg` | `var(--vc-bg-surface)` |
|
|
335
|
+
| `--card-bg-color` | `var(--vc-bg-surface)` |
|
|
336
|
+
| `--dark-bg` | `var(--vc-bg-inset-strong)` |
|
|
337
|
+
| `--field-bg` | `var(--vc-bg-field)` |
|
|
338
|
+
| `--overlay-bg` | `var(--vc-bg-overlay)`: it carries its own transparency (3.x components mixed `--overlay-bg` to 40%, so a 3.x value `X` becomes `color-mix(in srgb, X 40%, transparent)`) |
|
|
339
|
+
| `--skeleton-loader` | `var(--vc-bg-muted)` |
|
|
340
|
+
| `--skeleton-loader-animation` | `var(--vc-bg-skeleton-shine)` |
|
|
341
|
+
| `--scrollbar-track` | `var(--vc-bg-surface)` |
|
|
342
|
+
| `--primary-text` | `var(--vc-content-primary)` |
|
|
343
|
+
| `--heading-text` | `var(--vc-content-primary)` |
|
|
344
|
+
| `--headers` | `var(--vc-content-primary)` |
|
|
345
|
+
| `--icons` | `var(--vc-content-primary)` |
|
|
346
|
+
| `--table-headings` | `var(--vc-content-primary)` |
|
|
347
|
+
| `--default-text` | `var(--vc-content-primary)` |
|
|
348
|
+
| `--secondary-text` | `var(--vc-content-secondary)` |
|
|
349
|
+
| `--placeholders` | `var(--vc-content-tertiary)` |
|
|
350
|
+
| `--inactive-text` | `var(--vc-content-disabled)` |
|
|
351
|
+
| `--inactive-elements` | `var(--vc-content-disabled)` |
|
|
352
|
+
| `--btn-filled-text` | `var(--vc-onfill-primary, var(--vc-onfill))` |
|
|
353
|
+
| `--default-loader` | `var(--vc-onfill-primary, var(--vc-onfill))` |
|
|
354
|
+
| `--ui-lines` | `var(--vc-border)` |
|
|
355
|
+
| `--major-ui-lines` | `var(--vc-border-strong)` |
|
|
356
|
+
| `--field-borders` | `var(--vc-input)` |
|
|
357
|
+
| `--scrollbar-thumb` | `var(--vc-border)` |
|
|
358
|
+
| `--scrollbar-thumb-hover` | `var(--vc-content-disabled)` |
|
|
359
|
+
| `--progress-line-done` | `var(--vc-action-success)` |
|
|
360
|
+
| `--progress-line-not-done` | `var(--vc-border)` |
|
|
361
|
+
| `--card-shadow-color` | `color-mix(in srgb, var(--vc-shadow-color) 12%, transparent)` |
|
|
362
|
+
| `--table-shadow-color` | `color-mix(in srgb, var(--vc-shadow-color) 7%, transparent)` |
|
|
363
|
+
| `--actions-mix-color` | `var(--vc-mix-anchor)` |
|
|
364
|
+
| `--primary` | `var(--vc-action-primary)` |
|
|
365
|
+
| `--primary-actions` | `var(--vc-action-primary)` |
|
|
366
|
+
| `--primary-actions--focus` | `var(--vc-action-primary--hover)` |
|
|
367
|
+
| `--primary-actions--pressed` | `var(--vc-action-primary--pressed)` |
|
|
368
|
+
| `--primary-actions-bg--focus` | `var(--vc-action-primary--subtle-hover)` |
|
|
369
|
+
| `--primary-actions-bg--pressed` | `var(--vc-action-primary--subtle-pressed)` |
|
|
370
|
+
| `--primary-alternative` | `var(--vc-action-primary)` |
|
|
371
|
+
| `--primary-alternative-actions` | `var(--vc-action-primary)` |
|
|
372
|
+
| `--primary-alternative-actions--focus` | `var(--vc-action-primary--hover)` |
|
|
373
|
+
| `--primary-alternative-actions--pressed` | `var(--vc-action-primary--pressed)` |
|
|
374
|
+
| `--primary-alternative-actions-bg--focus` | `var(--vc-action-primary--subtle-hover)` |
|
|
375
|
+
| `--primary-alternative-actions-bg--pressed` | `var(--vc-action-primary--subtle-pressed)` |
|
|
376
|
+
| `--secondary` | `var(--vc-action-secondary)` |
|
|
377
|
+
| `--secondary-actions` | `var(--vc-action-secondary)` |
|
|
378
|
+
| `--secondary-actions--focus` | `var(--vc-action-secondary--hover)` |
|
|
379
|
+
| `--secondary-actions--pressed` | `var(--vc-action-secondary--pressed)` |
|
|
380
|
+
| `--secondary-actions-bg--focus` | `var(--vc-action-secondary--subtle-hover)` |
|
|
381
|
+
| `--secondary-actions-bg--pressed` | `var(--vc-action-secondary--subtle-pressed)` |
|
|
382
|
+
| `--destructive` | `var(--vc-action-danger)` (fills); `var(--vc-content-danger)` (text) |
|
|
383
|
+
| `--destructive-actions` | `var(--vc-action-danger)` (fills); `var(--vc-content-danger)` (text) |
|
|
384
|
+
| `--destructive-actions--focus` | `var(--vc-action-danger--hover)` |
|
|
385
|
+
| `--destructive-actions--pressed` | `var(--vc-action-danger--pressed)` |
|
|
386
|
+
| `--destructive-actions-bg--focus` | `var(--vc-action-danger--subtle-hover)` |
|
|
387
|
+
| `--destructive-actions-bg--pressed` | `var(--vc-action-danger--subtle-pressed)` |
|
|
388
|
+
| `--error` | `var(--vc-action-danger)` (fills); `var(--vc-content-danger)` (text) |
|
|
389
|
+
| `--error-actions` | `var(--vc-action-danger)` (fills); `var(--vc-content-danger)` (text) |
|
|
390
|
+
| `--error-actions--focus` | `var(--vc-action-danger--hover)` |
|
|
391
|
+
| `--error-actions--pressed` | `var(--vc-action-danger--pressed)` |
|
|
392
|
+
| `--error-actions-bg--focus` | `var(--vc-action-danger--subtle-hover)` |
|
|
393
|
+
| `--error-actions-bg--pressed` | `var(--vc-action-danger--subtle-pressed)` |
|
|
394
|
+
| `--success` | `var(--vc-action-success)` (fills); `var(--vc-content-success)` (text) |
|
|
395
|
+
| `--success-actions` | `var(--vc-action-success)` (fills); `var(--vc-content-success)` (text) |
|
|
396
|
+
| `--success-actions--focus` | `var(--vc-action-success--hover)` |
|
|
397
|
+
| `--success-actions--pressed` | `var(--vc-action-success--pressed)` |
|
|
398
|
+
| `--success-actions-bg--focus` | `var(--vc-action-success--subtle-hover)` |
|
|
399
|
+
| `--success-actions-bg--pressed` | `var(--vc-action-success--subtle-pressed)` |
|
|
400
|
+
| `--warning` | `var(--vc-action-warning)` (fills); `var(--vc-content-warning)` (text) |
|
|
401
|
+
| `--warning-actions` | `var(--vc-action-warning)` (fills); `var(--vc-content-warning)` (text) |
|
|
402
|
+
| `--warning-actions--focus` | `var(--vc-action-warning--hover)` |
|
|
403
|
+
| `--warning-actions--pressed` | `var(--vc-action-warning--pressed)` |
|
|
404
|
+
| `--warning-actions-bg--focus` | `var(--vc-action-warning--subtle-hover)` |
|
|
405
|
+
| `--warning-actions-bg--pressed` | `var(--vc-action-warning--subtle-pressed)` |
|
|
406
|
+
| `--active-elements` | `var(--vc-action-primary)` |
|
|
407
|
+
| `--active-elements--focus` | `var(--vc-action-primary--hover)` |
|
|
408
|
+
| `--active-elements--pressed` | `var(--vc-action-primary--pressed)` |
|
|
409
|
+
| `--active-elements-bg--focus` | `var(--vc-action-primary--subtle-hover)` |
|
|
410
|
+
| `--active-elements-bg--pressed` | `var(--vc-action-primary--subtle-pressed)` |
|
|
411
|
+
| `--inactive-elements--focus` | `color-mix(in srgb, var(--vc-content-disabled) 80%, var(--vc-mix-anchor))` |
|
|
412
|
+
| `--inactive-elements--pressed` | `color-mix(in srgb, var(--vc-content-disabled) 65%, var(--vc-mix-anchor))` |
|
|
413
|
+
| `--inactive-elements-bg--focus` | `color-mix(in srgb, var(--vc-content-disabled) 10%, transparent)` |
|
|
414
|
+
| `--inactive-elements-bg--pressed` | `color-mix(in srgb, var(--vc-content-disabled) 20%, transparent)` |
|
|
415
|
+
| `--input-font-weight` (the weight of field text, `500`) | `--input-font-weight`, now the normal weight step `var(--vc-font-weight-normal)` |
|
|
416
|
+
|
|
417
|
+
### Tailwind colour classes
|
|
418
|
+
|
|
419
|
+
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`.
|
|
420
|
+
|
|
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.
|
|
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
|
+
|
|
425
|
+
| 3.x colour name | 4.x colour name |
|
|
426
|
+
| --- | --- |
|
|
427
|
+
| `main-bg` | `page` |
|
|
428
|
+
| `light-bg` | `surface` |
|
|
429
|
+
| `card-bg-color` | `surface` |
|
|
430
|
+
| `dark-bg` | `inset-strong` |
|
|
431
|
+
| `field-bg` | `field` |
|
|
432
|
+
| `overlay-bg` | `overlay` (it carries its own transparency, as above) |
|
|
433
|
+
| `skeleton-loader` | `muted` |
|
|
434
|
+
| `skeleton-loader-animation` | no class |
|
|
435
|
+
| `scrollbar-track` | `surface` |
|
|
436
|
+
| `primary-text` | `content-primary` |
|
|
437
|
+
| `heading-text` | `content-primary` |
|
|
438
|
+
| `headers` | `content-primary` |
|
|
439
|
+
| `icons` | `content-primary` |
|
|
440
|
+
| `table-headings` | `content-primary` |
|
|
441
|
+
| `default-text` | `content-primary` |
|
|
442
|
+
| `secondary-text` | `content-secondary` |
|
|
443
|
+
| `placeholders` | `content-tertiary` |
|
|
444
|
+
| `inactive-text` | `content-disabled` |
|
|
445
|
+
| `inactive-elements` | `content-disabled` |
|
|
446
|
+
| `btn-filled-text` | `onfill-primary` |
|
|
447
|
+
| `default-loader` | `onfill-primary` |
|
|
448
|
+
| `ui-lines` | `border` |
|
|
449
|
+
| `major-ui-lines` | `border-strong` |
|
|
450
|
+
| `field-borders` | `input` |
|
|
451
|
+
| `scrollbar-thumb` | `border` |
|
|
452
|
+
| `scrollbar-thumb-hover` | `content-disabled` |
|
|
453
|
+
| `progress-line-done` | `action-success` |
|
|
454
|
+
| `progress-line-not-done` | `border` |
|
|
455
|
+
| `card-shadow-color` | no class; the `shadow-card` and `shadow-table` classes carry it |
|
|
456
|
+
| `table-shadow-color` | no class; the `shadow-table-row` and `shadow-table-header` classes carry it |
|
|
457
|
+
| `actions-mix-color` | no class |
|
|
458
|
+
| `primary` | `action-primary` |
|
|
459
|
+
| `primary-actions` | `action-primary` |
|
|
460
|
+
| `primary-actions--focus` | `action-primary-hover` |
|
|
461
|
+
| `primary-actions--pressed` | `action-primary-pressed` |
|
|
462
|
+
| `primary-actions-bg--focus` | `action-primary-subtle-hover` |
|
|
463
|
+
| `primary-actions-bg--pressed` | `action-primary-subtle-pressed` |
|
|
464
|
+
| `primary-alternative` | `action-primary` |
|
|
465
|
+
| `primary-alternative-actions` | `action-primary` |
|
|
466
|
+
| `primary-alternative-actions--focus` | `action-primary-hover` |
|
|
467
|
+
| `primary-alternative-actions--pressed` | `action-primary-pressed` |
|
|
468
|
+
| `primary-alternative-actions-bg--focus` | `action-primary-subtle-hover` |
|
|
469
|
+
| `primary-alternative-actions-bg--pressed` | `action-primary-subtle-pressed` |
|
|
470
|
+
| `secondary` | `action-secondary` |
|
|
471
|
+
| `secondary-actions` | `action-secondary` |
|
|
472
|
+
| `secondary-actions--focus` | `action-secondary-hover` |
|
|
473
|
+
| `secondary-actions--pressed` | `action-secondary-pressed` |
|
|
474
|
+
| `secondary-actions-bg--focus` | `action-secondary-subtle-hover` |
|
|
475
|
+
| `secondary-actions-bg--pressed` | `action-secondary-subtle-pressed` |
|
|
476
|
+
| `destructive` | `action-danger` (fills); `content-danger` (text) |
|
|
477
|
+
| `destructive-actions` | `action-danger` (fills); `content-danger` (text) |
|
|
478
|
+
| `destructive-actions--focus` | `action-danger-hover` |
|
|
479
|
+
| `destructive-actions--pressed` | `action-danger-pressed` |
|
|
480
|
+
| `destructive-actions-bg--focus` | `action-danger-subtle-hover` |
|
|
481
|
+
| `destructive-actions-bg--pressed` | `action-danger-subtle-pressed` |
|
|
482
|
+
| `error` | `action-danger` (fills); `content-danger` (text) |
|
|
483
|
+
| `error-actions` | `action-danger` (fills); `content-danger` (text) |
|
|
484
|
+
| `error-actions--focus` | `action-danger-hover` |
|
|
485
|
+
| `error-actions--pressed` | `action-danger-pressed` |
|
|
486
|
+
| `error-actions-bg--focus` | `action-danger-subtle-hover` |
|
|
487
|
+
| `error-actions-bg--pressed` | `action-danger-subtle-pressed` |
|
|
488
|
+
| `success` | `action-success` (fills); `content-success` (text) |
|
|
489
|
+
| `success-actions` | `action-success` (fills); `content-success` (text) |
|
|
490
|
+
| `success-actions--focus` | `action-success-hover` |
|
|
491
|
+
| `success-actions--pressed` | `action-success-pressed` |
|
|
492
|
+
| `success-actions-bg--focus` | `action-success-subtle-hover` |
|
|
493
|
+
| `success-actions-bg--pressed` | `action-success-subtle-pressed` |
|
|
494
|
+
| `warning` | `action-warning` (fills); `content-warning` (text) |
|
|
495
|
+
| `warning-actions` | `action-warning` (fills); `content-warning` (text) |
|
|
496
|
+
| `warning-actions--focus` | `action-warning-hover` |
|
|
497
|
+
| `warning-actions--pressed` | `action-warning-pressed` |
|
|
498
|
+
| `warning-actions-bg--focus` | `action-warning-subtle-hover` |
|
|
499
|
+
| `warning-actions-bg--pressed` | `action-warning-subtle-pressed` |
|
|
500
|
+
| `active-elements` | `action-primary` |
|
|
501
|
+
| `active-elements--focus` | `action-primary-hover` |
|
|
502
|
+
| `active-elements--pressed` | `action-primary-pressed` |
|
|
503
|
+
| `active-elements-bg--focus` | `action-primary-subtle-hover` |
|
|
504
|
+
| `active-elements-bg--pressed` | `action-primary-subtle-pressed` |
|
|
505
|
+
| `inactive-elements--focus` | no class |
|
|
506
|
+
| `inactive-elements--pressed` | no class |
|
|
507
|
+
| `inactive-elements-bg--focus` | no class; disabled fields use `bg-inset` |
|
|
508
|
+
| `inactive-elements-bg--pressed` | no class |
|
|
509
|
+
|
|
510
|
+
### Theme keys
|
|
511
|
+
|
|
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.
|
|
513
|
+
|
|
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`.
|
|
515
|
+
|
|
516
|
+
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.
|
|
517
|
+
|
|
518
|
+
| 3.x theme key | 4.x theme key |
|
|
519
|
+
| --- | --- |
|
|
520
|
+
| `main-bg` | `vc-bg-page` |
|
|
521
|
+
| `light-bg` | `vc-bg-surface` |
|
|
522
|
+
| `card-bg-color` | `vc-bg-surface` |
|
|
523
|
+
| `dark-bg` | `vc-bg-inset-strong` |
|
|
524
|
+
| `field-bg` | `vc-bg-field` |
|
|
525
|
+
| `overlay-bg` | `vc-bg-overlay`: it carries its own transparency (3.x components mixed `--overlay-bg` to 40%, so a 3.x value `X` becomes `color-mix(in srgb, X 40%, transparent)`) |
|
|
526
|
+
| `skeleton-loader` | `vc-bg-muted` |
|
|
527
|
+
| `skeleton-loader-animation` | none: mixed from `vc-bg-surface` |
|
|
528
|
+
| `scrollbar-track` | `vc-bg-surface` |
|
|
529
|
+
| `default-text` | `vc-content-primary` |
|
|
530
|
+
| `primary-text` | `vc-content-primary` |
|
|
531
|
+
| `heading-text` | `vc-content-primary` |
|
|
532
|
+
| `headers` | `vc-content-primary` |
|
|
533
|
+
| `icons` | `vc-content-primary` |
|
|
534
|
+
| `table-headings` | `vc-content-primary` |
|
|
535
|
+
| `secondary-text` | `vc-content-secondary` |
|
|
536
|
+
| `placeholders` | `vc-content-tertiary` |
|
|
537
|
+
| `inactive-text` | `vc-content-disabled` |
|
|
538
|
+
| `inactive-elements` | `vc-content-disabled` |
|
|
539
|
+
| `scrollbar-thumb-hover` | `vc-content-disabled` |
|
|
540
|
+
| `btn-filled-text` | `vc-onfill-primary` (text on the primary fill); `vc-onfill` for the other fills |
|
|
541
|
+
| `default-loader` | `vc-onfill-primary` |
|
|
542
|
+
| `ui-lines` | `vc-border` |
|
|
543
|
+
| `scrollbar-thumb` | `vc-border` |
|
|
544
|
+
| `major-ui-lines` | `vc-border-strong` |
|
|
545
|
+
| `progress-line-not-done` | `vc-border` |
|
|
546
|
+
| `field-borders` | `vc-input` |
|
|
547
|
+
| `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 |
|
|
548
|
+
| `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 |
|
|
549
|
+
| `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`) |
|
|
550
|
+
| `primary` | `vc-action-primary` |
|
|
551
|
+
| `primary-alternative` | `vc-action-primary` |
|
|
552
|
+
| `active-elements` | `vc-action-primary` |
|
|
553
|
+
| `secondary` | `vc-action-secondary` |
|
|
554
|
+
| `destructive` | `vc-action-danger` (fills); `vc-content-danger` (text) |
|
|
555
|
+
| `error` | `vc-action-danger` (fills); `vc-content-danger` (text) |
|
|
556
|
+
| `success` | `vc-action-success` (fills); `vc-content-success` (text) |
|
|
557
|
+
| `progress-line-done` | `vc-action-success` |
|
|
558
|
+
| `warning` | `vc-action-warning` (fills); `vc-content-warning` (text and icons) |
|
|
559
|
+
| `transparent` | none: not a theme key |
|
|
560
|
+
| `current` | none: not a theme key |
|
|
561
|
+
| `white` | none: not a theme key |
|
|
562
|
+
| `black` | none: not a theme key |
|
|
563
|
+
|
|
564
|
+
### Finding the 3.x names
|
|
565
|
+
|
|
566
|
+
A 3.x name in `@apply` or in `theme('colors.…')` fails the Tailwind build. In a template class or in `var(--…)` it fails silently: the class is not generated and the variable is not set. This finds them in an application (any hit is a 3.x name; the 4.x names do not match):
|
|
567
|
+
|
|
568
|
+
```bash
|
|
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'
|
|
570
|
+
s='(-bg)?(--(focus|pressed))?'
|
|
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.*
|
|
572
|
+
```
|
|
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
|
+
|
|
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.
|
|
577
|
+
|
|
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.
|
|
579
|
+
|
|
580
|
+
### Icons
|
|
581
|
+
|
|
582
|
+
The components draw Lucide icons (`@lucide/vue`) where 3.x drew the `vc-icon-*` font, and the default icon of an icon prop is a Lucide component. A style that targets a `vc-icon-*` class inside a component no longer matches. An icon prop still takes a `vc-icon-*` class, drawn by the icon font that `injectIconFont` loads.
|
|
583
|
+
|
|
584
|
+
### Styles and component defaults
|
|
585
|
+
|
|
586
|
+
| What | 3.x | 4.x |
|
|
587
|
+
| --- | --- | --- |
|
|
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` |
|
|
589
|
+
| `--base-border-radius` | set on `<html>` by the theme setup | removed; corners read the component radii `--vc-radius-*` (`--vc-radius-control` for controls) |
|
|
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)) |
|
|
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 |
|
|
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 |
|
|
593
|
+
| The default `color` of VcInput, VcAutocomplete, VcPhoneInput, VcOtpInput, VcTimeInput, VcTagInput, VcSwitch and VcExtendedDatetimeRangePicker; `DEFAULT_COLOR` | `'active'` | `'primary'` |
|
|
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` |
|
|
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` |
|
|
596
|
+
| The hover outline of VcCard with `hovered` | replaces the card shadow | fades in over the card shadow, which stays |
|
|
597
|
+
| The divider between VcViewSwitcher items | `secondary-actions` | `border` |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
602
|
+
| `iconClass` of VcSoundPlayerMarker | `'icon-md'` | `'icon-xs'`: the icon sits on a filled circle of the marker colour |
|
|
603
|
+
| `borderRadius` of VcMeterGroup | `'6px'` | `'var(--vc-radius-inner)'`, the inner radius role |
|
|
604
|
+
| `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 |
|
|
605
|
+
| `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` |
|
|
606
|
+
| `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 |
|
|
607
|
+
| 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 |
|
|
608
|
+
| `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") |
|
|
609
|
+
| Page text, `b` and `strong`, table headers (`th`) | `400`, `bolder`, the browser's bold | `font-normal`, `font-semibold`, `font-medium` |
|
|
610
|
+
| `font-bold`, `font-extrabold`, `font-black`; `font-thin`, `font-extralight`, `font-light` in an application | Tailwind's weights | unchanged; the 4.x text has the three weights above, so replace the first three with `font-semibold` and the other three with `font-normal` |
|
|
611
|
+
| The colour of an `info` or `warning` notification (`NotifyService`, `$notify`) | `info`: `primary-actions`, the brand colour; `warning`: `warning` | `content-info` and `content-warning`: a notification takes the text colour of the component colour of its type, as `success` takes `content-success` and `error` takes `content-danger` |
|
|
612
|
+
| 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 |
|
|
613
|
+
| `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 |
|
|
614
|
+
| 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` |
|
|
615
|
+
| 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 and voicenterRed is darker than the fill |
|
|
616
|
+
| 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 and voicenterRed |
|
|
617
|
+
| 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 |
|
|
618
|
+
| 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 and voicenterRed these are darker than the fill |
|
|
619
|
+
| 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 and voicenterRed, whose text is darker than the fill, darker than before |
|
|
620
|
+
| 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 |
|
|
621
|
+
| 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 |
|
|
622
|
+
|
|
623
|
+
### AI chat components
|
|
624
|
+
|
|
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:
|
|
626
|
+
|
|
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.
|
|
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'`).
|
|
629
|
+
- **`VcMessagesWrapper` is generic** over the message type: extend `VcChatMessage` with your own fields and the slots and events keep your type. `InstanceType<typeof VcMessagesWrapper>` no longer type-checks for a template ref; use the exported interface:
|
|
630
|
+
|
|
631
|
+
```diff
|
|
632
|
+
- const wrapper = ref<InstanceType<typeof VcMessagesWrapper>>()
|
|
633
|
+
+ import type { VcMessagesWrapperExposed } from '@voicenter-team/voicenter-ui-plus'
|
|
634
|
+
+ const wrapper = ref<VcMessagesWrapperExposed>()
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
- **`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`.
|
|
638
|
+
- **`VcMessageContent` has a `markdown` block** (`{ type: 'markdown', text, streaming? }`). An exhaustive `switch` or a `Record<VcMessageContentType, …>` over the content types needs the new case.
|
|
639
|
+
- **`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.
|
|
640
|
+
- **`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 both sides are neutral, with `--vc-content-primary` text: others on `--vc-bg-surface`, own messages on `--vc-bg-muted`, and the quote takes the other side's background (`--vc-bg-muted` in others' messages, `--vc-bg-surface` in own). 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.
|
|
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.
|
|
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.
|
|
643
|
+
- **Exported types**: `VcFileItemProps` (with the new `errorText`), `VcChatComposerEmits`, and props / emits / slot-props / exposed interfaces of every new component.
|
|
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`.
|
|
645
|
+
|
|
646
|
+
Fixes in the components 3.x had:
|
|
647
|
+
|
|
648
|
+
- **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`).
|
|
649
|
+
- **Lists in `VcMdEditor`** render again with `@milkdown/*` `^7.22.0` (see above).
|
|
650
|
+
- **Code blocks in `VcMdEditor`** take the theme's colours. Copy is a secondary text action (`--vc-action-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.
|
|
651
|
+
|
|
652
|
+
## Using ui-plus in an application
|
|
653
|
+
|
|
654
|
+
How an application builds its UI with ui-plus. Agents working in a consuming project read this section before any UI work; it describes the version installed next to it.
|
|
655
|
+
|
|
656
|
+
### Where the facts are
|
|
657
|
+
|
|
658
|
+
The installed package is the truth. Read it before saying what ui-plus has or how a component behaves.
|
|
659
|
+
|
|
660
|
+
- **Every component**: `library/types/components/exports.d.ts`. One component's props, events and slots: `library/types/components/<VcName>/<VcName>.vue.d.ts`.
|
|
661
|
+
- **Composables, services, directives, the entity base**: `library/types/composables/`, `library/types/services/`, `library/types/directives/`, `library/types/entity/`.
|
|
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" />`.
|
|
663
|
+
- **Colour tokens**: `src/theme/themes.json` (each key is the CSS variable `--<key>`) and `src/theme/tailwindScheme.js` (the Tailwind colour names).
|
|
664
|
+
- **Examples**: the [live documentation](https://voicenter-ui-plus.pages.dev/).
|
|
665
|
+
|
|
666
|
+
### Choosing a component
|
|
667
|
+
|
|
668
|
+
- Interaction components come from ui-plus: buttons, inputs, selects, date pickers, checkboxes, tabs, tables, modals, drawers, tooltips, popovers, uploaders, notifications, confirmations. Search `exports.d.ts` by what the user is shown (a picker of people, an on/off switch, a list with a search) before concluding a component is missing.
|
|
669
|
+
- A component is used **as the library draws it**: through its props, slots and variants. Fitting it into the layout is free: width, spacing, wrapping, alignment.
|
|
670
|
+
- A **custom control** needs the project owner's explicit yes, asked before it is written: which element is needed, what was searched in ui-plus, why nothing fits. Custom means any of:
|
|
671
|
+
- a new interaction component;
|
|
672
|
+
- a ui-plus component whose own CSS variables (`--el-*`, the ones ui-plus sets on `.vc-*`) or internal classes are overridden to change how it looks or behaves as a control: its track, rows, selected, hover or active state, shape or indicator;
|
|
673
|
+
- a ui-plus component used for a role it is not built for, such as a segmented switcher drawn as a searchable list.
|
|
674
|
+
- Until that yes, the closest ui-plus component is used as drawn, and the difference from the design is the first open point of the report: what the design draws, which component was used, how they differ. No agent or orchestrator gives this approval in the owner's place.
|
|
675
|
+
- A report names a control by what is on screen: a restyled ui-plus component is reported as custom.
|
|
676
|
+
- A design hand-off (Figma, mock-up, screenshot, a specification) says what the user should see. It never justifies a restyle or a custom control.
|
|
677
|
+
|
|
678
|
+
### Colours
|
|
679
|
+
|
|
680
|
+
- Every colour is a ui-plus token: a Tailwind class from the library scheme (`text-content-primary`, `text-content-secondary`, `text-action-primary`, `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.
|
|
681
|
+
- 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.
|
|
682
|
+
- The theme configuration (`themeConfig`, usually a `colors.json`) sets the library theme. It is not a palette to add colours to.
|
|
683
|
+
|
|
684
|
+
### Corners
|
|
685
|
+
|
|
686
|
+
- 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:
|
|
687
|
+
- `rounded-control`: buttons, icon, toggle and split buttons, inputs, selects, pickers;
|
|
688
|
+
- `rounded-popup`: floating panels (popovers, dropdowns, select panels, tooltips, date-picker panels, notifications);
|
|
689
|
+
- `rounded-card`: cards, the outer frame of a table, modals;
|
|
690
|
+
- `rounded-tag`: tags and chips, drawn as a pill;
|
|
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).
|
|
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`.
|
|
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.
|
|
694
|
+
|
|
695
|
+
### Shadows
|
|
696
|
+
|
|
697
|
+
- A shadow is a class of the shipped configuration ([Tailwind](#tailwind)):
|
|
698
|
+
- elevation: `shadow-raised` for an element lifted on hover or drag and `shadow-overlay` for a floating panel, read from `--vc-shadow-raised` and `--vc-shadow-overlay`; `shadow-card` for a card;
|
|
699
|
+
- focus: `shadow-focus` draws the one focus ring `--vc-focus-ring`, the theme's `--vc-ring` colour at `--vc-focus-ring-width`, and `shadow-focus-inner` draws it inside.
|
|
700
|
+
- `shadow-vertical-tab-item-hover` is the raised elevation; `shadow-focus-outer-off` is not a focus ring and keeps its own glow.
|
|
701
|
+
- A hand-written `box-shadow` and arbitrary classes such as `shadow-[…]` stay out of application code. Such shadows already in a project are not a precedent.
|
|
702
|
+
|
|
703
|
+
### Text
|
|
704
|
+
|
|
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)).
|
|
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.
|
|
707
|
+
- `transition-weight` is for text whose weight changes with its state.
|
|
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.
|
|
709
|
+
|
|
710
|
+
### Icons
|
|
711
|
+
|
|
712
|
+
- Icons are Lucide (`@lucide/vue`). An icon the application passes to a component or draws itself is a Lucide component imported by name: `import { Search } from '@lucide/vue'`, then `<VcButton :icon="Search">` or `<VcIcon :icon="Search" />`.
|
|
713
|
+
- The type of an icon prop is `TIcon`, exported from the package root.
|
|
714
|
+
|
|
715
|
+
### Notifications and confirmations
|
|
716
|
+
|
|
717
|
+
`NotifyService`, `useConfirmModal` and `useConfirmPopup` render only through the hosts described in [Global overlays](#global-overlays), mounted once in the application. A `VcNotification` host shows only the messages of its own `group`, so where the application mounts one host per group, every notification names one of those groups.
|
|
718
|
+
|
|
719
|
+
### Text direction
|
|
720
|
+
|
|
721
|
+
ui-plus follows the `dir` attribute of `<html>`: `useRTL()` reads it and updates when it changes. The application sets the direction there, once.
|
|
722
|
+
|
|
723
|
+
### AI chat
|
|
724
|
+
|
|
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.
|
|
726
|
+
|
|
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).
|
|
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`.
|
|
729
|
+
- Input: `VcChatComposer` with `streaming` (Stop instead of Send). Attachments open in `VcLightbox` (images) or `VcPdfViewer` (an inline PDF viewer for a tab or a panel).
|
|
730
|
+
- The library ships only English texts: an application in another language adds the keys of these components with `tVUManage.updateLocaleMessages` (the list is in [AI chat components](#ai-chat-components)).
|
|
731
|
+
|
|
732
|
+
### Server-side rendering
|
|
733
|
+
|
|
734
|
+
ui-plus is built and tested for client-rendered Vue applications. Its composables read `document` and `window` when they are called (`useRTL` among them), and the package ships no Nuxt module. An application with server-side rendering proves one page that uses ui-plus in development and in a production build before relying on it, and reports what fails.
|
|
735
|
+
|
|
736
|
+
### Troubleshooting
|
|
737
|
+
|
|
738
|
+
- **Component not found or a blank page**: in tree-shake mode a component is a local import, never a globally registered tag. In plugin mode both `app.use(VoicenterUI, …)` and `import '@voicenter-team/voicenter-ui-plus/style.css'` are present.
|
|
739
|
+
- **`Cannot find module 'pdfjs-dist'` (or another optional peer) at build time**: install the peer, or stop importing its component.
|
|
740
|
+
- **Duplicate styles, a huge CSS payload**: the two modes are mixed (named imports plus the global `style.css`). Pick one (`MIGRATION_v3.md`, §1).
|
|
741
|
+
- **`InstanceType<typeof VcMessagesWrapper>` does not type-check**: a generic component (`VcMessagesWrapper` since 4.0) has no constructor type. Type its template ref with the exported interface: `ref<VcMessagesWrapperExposed>()`. The other chat components with exposed methods export the same kind of interface (`VcChatComposerExposed`, `VcLightboxExposed`, `VcPdfViewerExposed`, …).
|
|
742
|
+
- **Lists missing from `VcMdEditor` or an AI answer** (`RangeError: Expected value of type boolean for attribute spread` in the console): `@milkdown/*` is older than 7.22.0. Install `^7.22.0` ([AI chat components](#ai-chat-components)).
|
|
743
|
+
- **PDF.js worker not loading, or Symbol / ZapfDingbats glyphs (✓, ✗, ★, Greek letters) drawn with another font or as boxes**: the worker and the standard font data of those two fonts are sibling assets resolved with `new URL('./pdf.worker.min.js', import.meta.url)` and `new URL('./standard_fonts/FoxitDingbats.pfb', import.meta.url)` (and `FoxitSymbol.pfb`); the bundler must support that pattern (Vite, webpack 5+, Rollup and esbuild do) and emits them as assets of the application.
|
|
744
|
+
|
|
745
|
+
## Date Handling
|
|
746
|
+
|
|
747
|
+
This library uses **dayjs** for all date operations and formatting. When working with date-related components, use dayjs format tokens (NOT date-fns format tokens).
|
|
748
|
+
|
|
749
|
+
### Format Tokens
|
|
750
|
+
|
|
751
|
+
**Important**: Use dayjs format tokens:
|
|
752
|
+
- `DD` - Day of month (2 digits) - **NOT** `dd`
|
|
753
|
+
- `YYYY` - 4-digit year - **NOT** `yyyy`
|
|
754
|
+
- `MM` - Month (2 digits)
|
|
755
|
+
- `HH` - 24-hour format
|
|
756
|
+
- `mm` - Minutes
|
|
757
|
+
- `ss` - Seconds
|
|
758
|
+
|
|
759
|
+
### Common Formats
|
|
760
|
+
|
|
761
|
+
```typescript
|
|
762
|
+
'DD/MM/YYYY' // 31/12/2024
|
|
763
|
+
'DD-MM-YYYY' // 31-12-2024
|
|
764
|
+
'YYYY-MM-DD' // 2024-12-31
|
|
765
|
+
'DD/MM/YYYY, HH:mm' // 31/12/2024, 14:30
|
|
766
|
+
'DD/MM/YYYY HH:mm:ss' // 31/12/2024 14:30:45
|
|
767
|
+
```
|
|
768
|
+
|
|
769
|
+
### Usage Example
|
|
770
|
+
|
|
771
|
+
```vue
|
|
772
|
+
<VcDatePicker
|
|
773
|
+
v-model="date"
|
|
774
|
+
format="DD/MM/YYYY"
|
|
775
|
+
input-date-format="DD/MM/YYYY"
|
|
776
|
+
input-time-format="HH:mm"
|
|
777
|
+
/>
|
|
778
|
+
```
|
|
779
|
+
|
|
780
|
+
## Date Utility Functions
|
|
781
|
+
|
|
782
|
+
The library provides a comprehensive set of date utility functions built on dayjs. These utilities are available for use in external projects.
|
|
783
|
+
|
|
784
|
+
### Import Date Utilities
|
|
785
|
+
|
|
786
|
+
```typescript
|
|
787
|
+
import {
|
|
788
|
+
formatDate,
|
|
789
|
+
parseDate,
|
|
790
|
+
addDays,
|
|
791
|
+
subtractDays,
|
|
792
|
+
getHours,
|
|
793
|
+
getMinutes,
|
|
794
|
+
getSeconds,
|
|
795
|
+
setTime,
|
|
796
|
+
isAfter,
|
|
797
|
+
isSameAfter,
|
|
798
|
+
isBefore,
|
|
799
|
+
isSameBefore,
|
|
800
|
+
format,
|
|
801
|
+
add,
|
|
802
|
+
sub,
|
|
803
|
+
addFp,
|
|
804
|
+
subFp
|
|
805
|
+
} from '@voicenter-team/voicenter-ui-plus'
|
|
806
|
+
```
|
|
807
|
+
|
|
808
|
+
### Basic Date Operations
|
|
809
|
+
|
|
810
|
+
#### Formatting Dates
|
|
811
|
+
|
|
812
|
+
```typescript
|
|
813
|
+
// Format a date with default format (YYYY-MM-DD)
|
|
814
|
+
const formatted = formatDate(new Date())
|
|
815
|
+
// Result: "2024-12-31"
|
|
816
|
+
|
|
817
|
+
// Format with custom format
|
|
818
|
+
const custom = formatDate(new Date(), 'DD/MM/YYYY')
|
|
819
|
+
// Result: "31/12/2024"
|
|
820
|
+
|
|
821
|
+
// Using format function (alias)
|
|
822
|
+
const formatted2 = format(new Date(), 'DD/MM/YYYY HH:mm')
|
|
823
|
+
// Result: "31/12/2024 14:30"
|
|
824
|
+
```
|
|
825
|
+
|
|
826
|
+
#### Parsing Dates
|
|
827
|
+
|
|
828
|
+
```typescript
|
|
829
|
+
// Parse a date string with format
|
|
830
|
+
const date = parseDate('31/12/2024', 'DD/MM/YYYY')
|
|
831
|
+
// Returns: Date object
|
|
832
|
+
```
|
|
833
|
+
|
|
834
|
+
### Date Arithmetic
|
|
835
|
+
|
|
836
|
+
#### Adding/Subtracting Days
|
|
837
|
+
|
|
838
|
+
```typescript
|
|
839
|
+
// Add days
|
|
840
|
+
const futureDate = addDays(new Date(), 7)
|
|
841
|
+
// Returns: Date 7 days from now
|
|
842
|
+
|
|
843
|
+
// Subtract days
|
|
844
|
+
const pastDate = subtractDays(new Date(), 5)
|
|
845
|
+
// Returns: Date 5 days ago
|
|
846
|
+
```
|
|
847
|
+
|
|
848
|
+
#### Adding/Subtracting Time Units
|
|
849
|
+
|
|
850
|
+
```typescript
|
|
851
|
+
// Add multiple time units
|
|
852
|
+
const newDate = add(new Date(), {
|
|
853
|
+
years: 1,
|
|
854
|
+
months: 2,
|
|
855
|
+
days: 5,
|
|
856
|
+
hours: 3,
|
|
857
|
+
minutes: 30
|
|
858
|
+
})
|
|
859
|
+
|
|
860
|
+
// Subtract multiple time units
|
|
861
|
+
const earlierDate = sub(new Date(), {
|
|
862
|
+
weeks: 2,
|
|
863
|
+
days: 3,
|
|
864
|
+
hours: 12
|
|
865
|
+
})
|
|
866
|
+
|
|
867
|
+
// Functional programming style (reversed arguments)
|
|
868
|
+
const fpDate = addFp({ days: 7 }, new Date())
|
|
869
|
+
const fpDate2 = subFp({ hours: 5 }, new Date())
|
|
870
|
+
```
|
|
871
|
+
|
|
872
|
+
### Time Operations
|
|
873
|
+
|
|
874
|
+
#### Getting Time Components
|
|
875
|
+
|
|
876
|
+
```typescript
|
|
877
|
+
const date = new Date('2024-12-31T14:30:45')
|
|
878
|
+
|
|
879
|
+
const hours = getHours(date) // 14
|
|
880
|
+
const minutes = getMinutes(date) // 30
|
|
881
|
+
const seconds = getSeconds(date) // 45
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
#### Setting Time
|
|
885
|
+
|
|
886
|
+
```typescript
|
|
887
|
+
// Set time on a date (returns new Date object)
|
|
888
|
+
const newDate = setTime(new Date(), {
|
|
889
|
+
hours: 14,
|
|
890
|
+
minutes: 30,
|
|
891
|
+
seconds: 0
|
|
892
|
+
})
|
|
893
|
+
```
|
|
894
|
+
|
|
895
|
+
### Date Comparisons
|
|
896
|
+
|
|
897
|
+
```typescript
|
|
898
|
+
const date1 = new Date('2024-12-31')
|
|
899
|
+
const date2 = new Date('2025-01-01')
|
|
900
|
+
|
|
901
|
+
// Check if date1 is after date2
|
|
902
|
+
const isLater = isAfter(date1, date2, 'day')
|
|
903
|
+
// Returns: false
|
|
904
|
+
|
|
905
|
+
// Check if date1 is same or after date2
|
|
906
|
+
const isSameOrLater = isSameAfter(date1, date2, 'day')
|
|
907
|
+
// Returns: false
|
|
908
|
+
|
|
909
|
+
// Check if date1 is before date2
|
|
910
|
+
const isEarlier = isBefore(date1, date2, 'day')
|
|
911
|
+
// Returns: true
|
|
912
|
+
|
|
913
|
+
// Check if date1 is same or before date2
|
|
914
|
+
const isSameOrEarlier = isSameBefore(date1, date2, 'day')
|
|
915
|
+
// Returns: true
|
|
916
|
+
```
|
|
917
|
+
|
|
918
|
+
**Comparison Units**: The comparison functions accept a `units` parameter (default: `'minute'`). Valid units:
|
|
919
|
+
- `'year'`, `'month'`, `'week'`, `'day'`
|
|
920
|
+
- `'hour'`, `'minute'`, `'second'`
|
|
921
|
+
|
|
922
|
+
### Complete Usage Example
|
|
923
|
+
|
|
924
|
+
```typescript
|
|
925
|
+
import {
|
|
926
|
+
formatDate,
|
|
927
|
+
addDays,
|
|
928
|
+
isAfter,
|
|
929
|
+
format,
|
|
930
|
+
add,
|
|
931
|
+
getHours,
|
|
932
|
+
setTime
|
|
933
|
+
} from '@voicenter-team/voicenter-ui-plus'
|
|
934
|
+
|
|
935
|
+
// Format today's date
|
|
936
|
+
const today = formatDate(new Date(), 'DD/MM/YYYY')
|
|
937
|
+
|
|
938
|
+
// Get date 30 days from now
|
|
939
|
+
const futureDate = addDays(new Date(), 30)
|
|
940
|
+
|
|
941
|
+
// Check if a date is in the future
|
|
942
|
+
const isFuture = isAfter(futureDate, new Date(), 'day')
|
|
943
|
+
|
|
944
|
+
// Add 2 weeks and 3 days
|
|
945
|
+
const deadline = add(new Date(), {
|
|
946
|
+
weeks: 2,
|
|
947
|
+
days: 3
|
|
948
|
+
})
|
|
949
|
+
|
|
950
|
+
// Get current hour
|
|
951
|
+
const currentHour = getHours(new Date())
|
|
952
|
+
|
|
953
|
+
// Set specific time
|
|
954
|
+
const meetingTime = setTime(new Date(), {
|
|
955
|
+
hours: 14,
|
|
956
|
+
minutes: 30
|
|
957
|
+
})
|
|
958
|
+
|
|
959
|
+
// Format the result
|
|
960
|
+
const formattedDeadline = format(deadline, 'DD/MM/YYYY HH:mm')
|
|
961
|
+
```
|
|
962
|
+
|
|
963
|
+
### Notes
|
|
964
|
+
|
|
965
|
+
- All functions accept `Date`, `string`, or `number` as date input
|
|
966
|
+
- All date manipulation functions return new `Date` objects (immutable)
|
|
967
|
+
- Format strings use dayjs format tokens (see Format Tokens section above)
|
|
968
|
+
- These utilities are built on dayjs and maintain compatibility with dayjs format patterns
|
|
969
|
+
|
|
970
|
+
## Contributing: adding a new component
|
|
971
|
+
|
|
972
|
+
The public component surface is defined in **one place**: [`script/components-manifest.mjs`](./script/components-manifest.mjs) — one line per component.
|
|
973
|
+
|
|
974
|
+
```js
|
|
975
|
+
{ name: 'VcMyThing', path: 'components/VcMyThing/VcMyThing.vue' },
|
|
976
|
+
```
|
|
977
|
+
|
|
978
|
+
`npm run generate:entries` materializes the manifest into three fully
|
|
979
|
+
generated files (never edit them by hand — the next generator run
|
|
980
|
+
overwrites them, and the verifier fails the build until they match):
|
|
981
|
+
|
|
982
|
+
- `src/components.gen.ts` — named exports, re-exported by `src/index.ts`
|
|
983
|
+
(tree-shake mode);
|
|
984
|
+
- `src/plugin-components.gen.ts` — `registerComponents(app)`, called by
|
|
985
|
+
the plugin's install (global registration mode);
|
|
986
|
+
- `src/components/exports.ts` — the `GlobalComponents` template typing.
|
|
987
|
+
|
|
988
|
+
`src/index.ts` and `src/plugin.ts` themselves stay hand-written and small.
|
|
989
|
+
The `.gen` modules are safe to route through only because
|
|
990
|
+
`rewriteCssImports()` in `vite.config.ts` strips the CSS imports that
|
|
991
|
+
`vite-plugin-lib-inject-css` aggregates onto them — each component's CSS
|
|
992
|
+
stays in its own chunk, so per-component CSS tree-shaking survives. Don't
|
|
993
|
+
rename the `.gen` files without updating that strip list (the verifier
|
|
994
|
+
guards this wiring too).
|
|
995
|
+
|
|
996
|
+
Typical flows:
|
|
997
|
+
|
|
998
|
+
- **New component**: `node script/create-component.mjs` — scaffolds the
|
|
999
|
+
component folder, adds the manifest line, and regenerates all entries.
|
|
1000
|
+
- **Existing .vue file**: add one line to the manifest, then
|
|
1001
|
+
`npm run generate:entries`.
|
|
1002
|
+
|
|
1003
|
+
Every manifest entry is exported from the package root AND registered
|
|
1004
|
+
globally in plugin mode — there are no partial modes.
|
|
1005
|
+
|
|
1006
|
+
`npm run verify:entries` is the safety net: it independently cross-checks
|
|
1007
|
+
the manifest, the three generated files and the filesystem (a component
|
|
1008
|
+
file that exists but is missing from the manifest fails too). It runs in
|
|
1009
|
+
the pre-commit hook (together with `lint-staged` and `ts-check`; hooks are
|
|
1010
|
+
installed automatically by `npm install` via husky) and in CI, so an
|
|
1011
|
+
inconsistent component surface cannot reach `master`.
|
|
1012
|
+
|
|
1013
|
+
## Documentation
|
|
1014
|
+
|
|
1015
|
+
### Live Documentation
|
|
1016
|
+
Visit [documentation](https://voicenter-ui-plus.pages.dev/) for interactive component examples and demos.
|
|
1017
|
+
|
|
1018
|
+
## Project Documentation
|
|
1019
|
+
For detailed technical documentation, see the [`docs/`](./docs/) directory:
|
|
1020
|
+
|
|
1021
|
+
- **[Quick Start Guide](./docs/AGENTS_QUICK_START.md)** - For developers working on the library
|
|
1022
|
+
- **[Architecture Overview](./docs/ARCHITECTURE.md)** - Project structure and technical details
|
|
1023
|
+
- **[Documentation Guide](./docs/DOCUMENTATION_GUIDE.md)** - Working with the documentation system
|