@central-design-system/components 4.0.0-alpha.3 → 4.0.0-alpha.5
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/CHANGELOG.md +6 -0
- package/MIGRATION.md +15 -43
- package/dist/browser/chunks/cdsLegacy-VUz8RzDN.js +120 -0
- package/dist/browser/chunks/useIcons.component-Df4MSurB.js +102 -0
- package/dist/browser/entry.js +34490 -0
- package/dist/browser/iconsets/carbon.js +155 -0
- package/dist/browser/iconsets/cds.js +149 -0
- package/dist/browser/iconsets/cdsLegacy.js +6 -0
- package/dist/browser/iconsets/lucide.js +156 -0
- package/dist/browser/iconsets/mdi.js +154 -0
- package/dist/browser/iconsets/phosphor.js +155 -0
- package/dist/browser/iconsets/remix.js +155 -0
- package/dist/cds.d.ts +119065 -0
- package/dist/cjs/entry.js +10 -10
- package/dist/es/entry.css +0 -18
- package/dist/es/entry.js +132 -122
- package/dist/es/entry.js.map +1 -1
- package/dist/es/src/cds.js +5 -5
- package/dist/es/src/components/CdsApp/CdsApp.css +0 -18
- package/dist/es/src/components/CdsApp/CdsApp.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsApp/api/CdsApp.props.js +2 -1
- package/dist/es/src/components/CdsApp/api/CdsApp.props.js.map +1 -1
- package/dist/es/src/components/CdsAutocomplete/CdsAutocomplete.css +0 -18
- package/dist/es/src/components/CdsAutocomplete/CdsAutocomplete.vue_vue_type_script_setup_true_lang.js +20 -5
- package/dist/es/src/components/CdsAutocomplete/CdsAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsAutocomplete/api/CdsAutocomplete.props.js +9 -2
- package/dist/es/src/components/CdsAutocomplete/api/CdsAutocomplete.props.js.map +1 -1
- package/dist/es/src/components/CdsAvatar/CdsAvatar.css +0 -18
- package/dist/es/src/components/CdsAvatar/CdsAvatar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsAvatar/api/CdsAvatar.props.js +21 -6
- package/dist/es/src/components/CdsAvatar/api/CdsAvatar.props.js.map +1 -1
- package/dist/es/src/components/CdsBadge/CdsBadge.css +0 -18
- package/dist/es/src/components/CdsBadge/CdsBadge.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsBadge/api/CdsBadge.props.js +38 -10
- package/dist/es/src/components/CdsBadge/api/CdsBadge.props.js.map +1 -1
- package/dist/es/src/components/CdsBreadcrumbs/CdsBreadcrumbs.css +0 -18
- package/dist/es/src/components/CdsBreadcrumbs/api/CdsBreadcrumbs.props.js +32 -8
- package/dist/es/src/components/CdsBreadcrumbs/api/CdsBreadcrumbs.props.js.map +1 -1
- package/dist/es/src/components/CdsButton/CdsButton.css +0 -18
- package/dist/es/src/components/CdsButton/CdsButton.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/src/components/CdsButton/CdsButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsButton/api/CdsButton.props.js +29 -8
- package/dist/es/src/components/CdsButton/api/CdsButton.props.js.map +1 -1
- package/dist/es/src/components/CdsButtonGroup/CdsButtonGroup.css +0 -18
- package/dist/es/src/components/CdsButtonGroup/CdsButtonGroup.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsButtonGroup/api/CdsButtonGroup.props.js +5 -2
- package/dist/es/src/components/CdsButtonGroup/api/CdsButtonGroup.props.js.map +1 -1
- package/dist/es/src/components/CdsButtonToggle/CdsButtonToggle.css +0 -18
- package/dist/es/src/components/CdsButtonToggle/CdsButtonToggle.vue_vue_type_script_setup_true_lang.js +20 -5
- package/dist/es/src/components/CdsButtonToggle/CdsButtonToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsCard/CdsCard.css +0 -18
- package/dist/es/src/components/CdsCard/CdsCard.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsCard/CdsCardGroup.vue_vue_type_script_setup_true_lang.js +21 -6
- package/dist/es/src/components/CdsCard/CdsCardGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsCard/api/CdsCard.props.js +85 -21
- package/dist/es/src/components/CdsCard/api/CdsCard.props.js.map +1 -1
- package/dist/es/src/components/CdsCarousel/CdsCarousel.css +0 -18
- package/dist/es/src/components/CdsCarousel/api/CdsCarousel.props.js +36 -9
- package/dist/es/src/components/CdsCarousel/api/CdsCarousel.props.js.map +1 -1
- package/dist/es/src/components/CdsCheckbox/CdsCheckbox.css +0 -18
- package/dist/es/src/components/CdsCheckboxButton/CdsCheckboxButton.css +0 -18
- package/dist/es/src/components/CdsCheckboxButton/api/CdsCheckboxButton.props.js +8 -2
- package/dist/es/src/components/CdsCheckboxButton/api/CdsCheckboxButton.props.js.map +1 -1
- package/dist/es/src/components/CdsCombobox/CdsCombobox.css +0 -18
- package/dist/es/src/components/CdsCombobox/CdsCombobox.vue_vue_type_script_setup_true_lang.js +24 -6
- package/dist/es/src/components/CdsCombobox/CdsCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsCombobox/api/CdsCombobox.props.js +13 -3
- package/dist/es/src/components/CdsCombobox/api/CdsCombobox.props.js.map +1 -1
- package/dist/es/src/components/CdsCounter/CdsCounter.css +0 -18
- package/dist/es/src/components/CdsCounter/api/CdsCounter.props.js +12 -3
- package/dist/es/src/components/CdsCounter/api/CdsCounter.props.js.map +1 -1
- package/dist/es/src/components/CdsDateInput/CdsDateInput.css +0 -18
- package/dist/es/src/components/CdsDateInput/CdsDateInput.vue_vue_type_script_setup_true_lang.js +8 -0
- package/dist/es/src/components/CdsDateInput/CdsDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsDateInput/api/CdsDateInput.props.js +31 -7
- package/dist/es/src/components/CdsDateInput/api/CdsDateInput.props.js.map +1 -1
- package/dist/es/src/components/CdsDatePicker/CdsDatePicker.css +0 -18
- package/dist/es/src/components/CdsDatePicker/CdsDatePicker.vue_vue_type_script_setup_true_lang.js +21 -1
- package/dist/es/src/components/CdsDatePicker/CdsDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsDatePicker/api/CdsDatePicker.props.js +65 -16
- package/dist/es/src/components/CdsDatePicker/api/CdsDatePicker.props.js.map +1 -1
- package/dist/es/src/components/CdsDefaultsProvider/api/CdsDefaultsProvider.props.js +5 -0
- package/dist/es/src/components/CdsDefaultsProvider/api/CdsDefaultsProvider.props.js.map +1 -1
- package/dist/es/src/components/CdsDescription/CdsDescription.css +0 -18
- package/dist/es/src/components/CdsDivider/CdsDivider.css +0 -18
- package/dist/es/src/components/CdsDivider/CdsDivider.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsDivider/CdsDivider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsDivider/api/CdsDivider.props.js +33 -8
- package/dist/es/src/components/CdsDivider/api/CdsDivider.props.js.map +1 -1
- package/dist/es/src/components/CdsDrawer/CdsDrawer.css +0 -18
- package/dist/es/src/components/CdsDrawer/CdsDrawer.vue_vue_type_script_setup_true_lang.js +6 -2
- package/dist/es/src/components/CdsDrawer/CdsDrawer.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsDrawer/api/CdsDrawer.props.js +33 -9
- package/dist/es/src/components/CdsDrawer/api/CdsDrawer.props.js.map +1 -1
- package/dist/es/src/components/CdsEmptyState/CdsEmptyState.css +0 -18
- package/dist/es/src/components/CdsEmptyState/CdsEmptyState.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/src/components/CdsEmptyState/api/CdsEmptyState.props.js +34 -9
- package/dist/es/src/components/CdsEmptyState/api/CdsEmptyState.props.js.map +1 -1
- package/dist/es/src/components/CdsExpandablePanel/CdsExpandablePanel.vue_vue_type_script_setup_true_lang.js +16 -4
- package/dist/es/src/components/CdsExpandablePanel/CdsExpandablePanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsExpandablePanel/CdsExpandablePanelTitle.vue_vue_type_script_setup_true_lang.js +8 -2
- package/dist/es/src/components/CdsExpandablePanel/CdsExpandablePanelTitle.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsExpandablePanel/CdsExpandablePanels.css +0 -18
- package/dist/es/src/components/CdsExpandablePanel/CdsExpandablePanels.vue_vue_type_script_setup_true_lang.js +9 -3
- package/dist/es/src/components/CdsExpandablePanel/CdsExpandablePanels.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsExpandablePanel/api/CdsExpandablePanel.props.js +39 -10
- package/dist/es/src/components/CdsExpandablePanel/api/CdsExpandablePanel.props.js.map +1 -1
- package/dist/es/src/components/CdsField/CdsField.css +0 -18
- package/dist/es/src/components/CdsField/CdsField.vue_vue_type_script_setup_true_lang.js +14 -4
- package/dist/es/src/components/CdsField/CdsField.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsField/api/CdsField.props.js +57 -15
- package/dist/es/src/components/CdsField/api/CdsField.props.js.map +1 -1
- package/dist/es/src/components/CdsField/composables/useAutocomplete.js +1 -0
- package/dist/es/src/components/CdsField/composables/useAutocomplete.js.map +1 -1
- package/dist/es/src/components/CdsFileInput/CdsFileInput.css +0 -18
- package/dist/es/src/components/CdsFileInput/api/CdsFileInput.props.js +40 -10
- package/dist/es/src/components/CdsFileInput/api/CdsFileInput.props.js.map +1 -1
- package/dist/es/src/components/CdsFileInput/composables/useFileFilter.js +4 -1
- package/dist/es/src/components/CdsFileInput/composables/useFileFilter.js.map +1 -1
- package/dist/es/src/components/CdsFileUpload/CdsFileUpload.css +0 -18
- package/dist/es/src/components/CdsFileUpload/CdsFileUpload.vue_vue_type_script_setup_true_lang.js +4 -0
- package/dist/es/src/components/CdsFileUpload/CdsFileUpload.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsFileUpload/api/CdsFileUpload.props.js +85 -21
- package/dist/es/src/components/CdsFileUpload/api/CdsFileUpload.props.js.map +1 -1
- package/dist/es/src/components/CdsFooter/CdsFooter.css +0 -18
- package/dist/es/src/components/CdsFooter/CdsFooter.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/src/components/CdsFooter/api/CdsFooter.props.js +1 -1
- package/dist/es/src/components/CdsForm/CdsForm.css +0 -18
- package/dist/es/src/components/CdsForm/api/CdsForm.props.js +8 -2
- package/dist/es/src/components/CdsForm/api/CdsForm.props.js.map +1 -1
- package/dist/es/src/components/CdsFunctionalButton/CdsFunctionalButton.css +0 -18
- package/dist/es/src/components/CdsFunctionalButton/api/CdsFunctionalButton.props.js +5 -2
- package/dist/es/src/components/CdsFunctionalButton/api/CdsFunctionalButton.props.js.map +1 -1
- package/dist/es/src/components/CdsGrid/CdsCol.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsGrid/api/CdsGrid.props.js +40 -10
- package/dist/es/src/components/CdsGrid/api/CdsGrid.props.js.map +1 -1
- package/dist/es/src/components/CdsGrid/components/CSSGrid.css +0 -18
- package/dist/es/src/components/CdsGrid/components/FlexGrid.css +0 -18
- package/dist/es/src/components/CdsHeader/CdsHeader.css +0 -18
- package/dist/es/src/components/CdsHeader/CdsHeader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsHeader/api/CdsHeader.props.js +1 -1
- package/dist/es/src/components/CdsHighlight/CdsHighlight.css +0 -18
- package/dist/es/src/components/CdsHighlight/api/CdsHighlight.props.js +32 -8
- package/dist/es/src/components/CdsHighlight/api/CdsHighlight.props.js.map +1 -1
- package/dist/es/src/components/CdsIcon/CdsIcon.css +0 -18
- package/dist/es/src/components/CdsIcon/CdsIcon.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsIcon/api/CdsIcon.props.js +18 -5
- package/dist/es/src/components/CdsIcon/api/CdsIcon.props.js.map +1 -1
- package/dist/es/src/components/CdsImage/CdsImage.css +0 -18
- package/dist/es/src/components/CdsImage/CdsImage.vue_vue_type_script_setup_true_lang.js +21 -1
- package/dist/es/src/components/CdsImage/CdsImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsImage/api/CdsImage.props.js +65 -17
- package/dist/es/src/components/CdsImage/api/CdsImage.props.js.map +1 -1
- package/dist/es/src/components/CdsInput/CdsInput.css +0 -18
- package/dist/es/src/components/CdsInput/CdsInput.vue_vue_type_script_setup_true_lang.js +45 -12
- package/dist/es/src/components/CdsInput/CdsInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsInput/api/CdsInput.props.js +49 -13
- package/dist/es/src/components/CdsInput/api/CdsInput.props.js.map +1 -1
- package/dist/es/src/components/CdsLabel/CdsLabel.css +0 -18
- package/dist/es/src/components/CdsLabel/api/CdsLabel.props.js +4 -0
- package/dist/es/src/components/CdsLabel/api/CdsLabel.props.js.map +1 -1
- package/dist/es/src/components/CdsLayout/CdsLayout.css +0 -18
- package/dist/es/src/components/CdsLayout/CdsLayout.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/src/components/CdsLayout/api/CdsLayout.props.js +6 -2
- package/dist/es/src/components/CdsLayout/api/CdsLayout.props.js.map +1 -1
- package/dist/es/src/components/CdsLink/CdsLink.css +0 -18
- package/dist/es/src/components/CdsLink/CdsLink.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsLink/api/CdsLink.props.js +5 -2
- package/dist/es/src/components/CdsLink/api/CdsLink.props.js.map +1 -1
- package/dist/es/src/components/CdsList/CdsList.css +0 -18
- package/dist/es/src/components/CdsList/CdsList.vue_vue_type_script_setup_true_lang.js +25 -7
- package/dist/es/src/components/CdsList/CdsList.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsList/CdsListGroup.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/src/components/CdsList/CdsListGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsList/CdsListItem.css +0 -18
- package/dist/es/src/components/CdsList/CdsListItem.vue_vue_type_script_setup_true_lang.js +29 -8
- package/dist/es/src/components/CdsList/CdsListItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsList/CdsListItemAction.vue_vue_type_script_setup_true_lang.js +8 -2
- package/dist/es/src/components/CdsList/CdsListItemAction.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsList/CdsListItemDivider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsList/CdsListItemMedia.vue_vue_type_script_setup_true_lang.js +8 -2
- package/dist/es/src/components/CdsList/CdsListItemMedia.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsList/CdsListSubheader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsList/api/CdsList.props.js +145 -37
- package/dist/es/src/components/CdsList/api/CdsList.props.js.map +1 -1
- package/dist/es/src/components/CdsList/components/ListChildren.vue_vue_type_script_setup_true_lang.js +8 -2
- package/dist/es/src/components/CdsList/components/ListChildren.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsList/components/ListGroupActivator.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsList/index.js +5 -2
- package/dist/es/src/components/CdsList/index.js.map +1 -1
- package/dist/es/src/components/CdsLoader/CdsLoader.css +0 -18
- package/dist/es/src/components/CdsLoader/CdsLoader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsLoader/api/CdsLoader.props.js +12 -3
- package/dist/es/src/components/CdsLoader/api/CdsLoader.props.js.map +1 -1
- package/dist/es/src/components/CdsMain/CdsMain.css +0 -18
- package/dist/es/src/components/CdsMenu/CdsMenu.css +0 -18
- package/dist/es/src/components/CdsMenu/api/CdsMenu.props.js +8 -2
- package/dist/es/src/components/CdsMenu/api/CdsMenu.props.js.map +1 -1
- package/dist/es/src/components/CdsMessages/CdsMessages.css +0 -18
- package/dist/es/src/components/CdsMessages/api/CdsMessages.props.js +12 -3
- package/dist/es/src/components/CdsMessages/api/CdsMessages.props.js.map +1 -1
- package/dist/es/src/components/CdsModal/CdsModal.css +0 -18
- package/dist/es/src/components/CdsModal/api/CdsModal.props.js +8 -2
- package/dist/es/src/components/CdsModal/api/CdsModal.props.js.map +1 -1
- package/dist/es/src/components/CdsNotification/CdsNotification.css +0 -18
- package/dist/es/src/components/CdsNotification/CdsNotification.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsNotification/api/CdsNotification.props.js +29 -8
- package/dist/es/src/components/CdsNotification/api/CdsNotification.props.js.map +1 -1
- package/dist/es/src/components/CdsNotificationAlert/CdsNotificationAlert.css +0 -18
- package/dist/es/src/components/CdsNotificationAlert/api/CdsNotificationAlert.props.js +28 -7
- package/dist/es/src/components/CdsNotificationAlert/api/CdsNotificationAlert.props.js.map +1 -1
- package/dist/es/src/components/CdsOtpInput/CdsOtpInput.css +0 -18
- package/dist/es/src/components/CdsOtpInput/CdsOtpInput.vue_vue_type_script_setup_true_lang.js +21 -6
- package/dist/es/src/components/CdsOtpInput/CdsOtpInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsOtpInput/api/CdsOtpInput.props.js +53 -14
- package/dist/es/src/components/CdsOtpInput/api/CdsOtpInput.props.js.map +1 -1
- package/dist/es/src/components/CdsOverlay/CdsOverlay.css +0 -18
- package/dist/es/src/components/CdsOverlay/CdsOverlay.vue_vue_type_script_setup_true_lang.js +45 -12
- package/dist/es/src/components/CdsOverlay/CdsOverlay.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsOverlay/api/CdsOverlay.props.js +37 -9
- package/dist/es/src/components/CdsOverlay/api/CdsOverlay.props.js.map +1 -1
- package/dist/es/src/components/CdsOverlay/composables/useActivator.js +25 -6
- package/dist/es/src/components/CdsOverlay/composables/useActivator.js.map +1 -1
- package/dist/es/src/components/CdsOverlay/composables/useLocationStrategies.js +18 -4
- package/dist/es/src/components/CdsOverlay/composables/useLocationStrategies.js.map +1 -1
- package/dist/es/src/components/CdsOverlay/composables/useScrollStrategies.js +4 -1
- package/dist/es/src/components/CdsOverlay/composables/useScrollStrategies.js.map +1 -1
- package/dist/es/src/components/CdsPage/CdsPage.css +0 -18
- package/dist/es/src/components/CdsPage/CdsPage.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsPage/api/CdsPage.props.js +5 -1
- package/dist/es/src/components/CdsPage/api/CdsPage.props.js.map +1 -1
- package/dist/es/src/components/CdsPagination/CdsPagination.css +0 -18
- package/dist/es/src/components/CdsPagination/CdsPagination.vue_vue_type_script_setup_true_lang.js +18 -2
- package/dist/es/src/components/CdsPagination/CdsPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsPagination/api/CdsPagination.props.js +85 -22
- package/dist/es/src/components/CdsPagination/api/CdsPagination.props.js.map +1 -1
- package/dist/es/src/components/CdsProgressBar/CdsProgressBar.css +0 -18
- package/dist/es/src/components/CdsProgressBar/CdsProgressBar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsProgressBar/api/CdsProgressBar.props.js +65 -17
- package/dist/es/src/components/CdsProgressBar/api/CdsProgressBar.props.js.map +1 -1
- package/dist/es/src/components/CdsProgressBar/composables/useChunk.js +4 -0
- package/dist/es/src/components/CdsProgressBar/composables/useChunk.js.map +1 -1
- package/dist/es/src/components/CdsProgressCircle/CdsProgressCircle.css +0 -18
- package/dist/es/src/components/CdsProgressCircle/CdsProgressCircle.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsProgressCircle/api/CdsProgressCircle.props.js +29 -8
- package/dist/es/src/components/CdsProgressCircle/api/CdsProgressCircle.props.js.map +1 -1
- package/dist/es/src/components/CdsRadio/CdsRadio.css +0 -18
- package/dist/es/src/components/CdsRadioGroup/CdsRadioGroup.css +0 -18
- package/dist/es/src/components/CdsRadioGroup/api/CdsRadioGroup.props.js +16 -4
- package/dist/es/src/components/CdsRadioGroup/api/CdsRadioGroup.props.js.map +1 -1
- package/dist/es/src/components/CdsResponsive/CdsResponsive.css +0 -18
- package/dist/es/src/components/CdsResponsive/api/CdsResponsive.props.js +12 -3
- package/dist/es/src/components/CdsResponsive/api/CdsResponsive.props.js.map +1 -1
- package/dist/es/src/components/CdsSelect/CdsSelect.css +0 -18
- package/dist/es/src/components/CdsSelect/CdsSelect.vue_vue_type_script_setup_true_lang.js +16 -4
- package/dist/es/src/components/CdsSelect/CdsSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsSelect/api/CdsSelect.props.js +4 -1
- package/dist/es/src/components/CdsSelect/api/CdsSelect.props.js.map +1 -1
- package/dist/es/src/components/CdsSelect/composables/useMenuActivator.js +8 -2
- package/dist/es/src/components/CdsSelect/composables/useMenuActivator.js.map +1 -1
- package/dist/es/src/components/CdsSelect/composables/useSelect.js +69 -17
- package/dist/es/src/components/CdsSelect/composables/useSelect.js.map +1 -1
- package/dist/es/src/components/CdsSelectionControl/CdsSelectionControl.css +0 -18
- package/dist/es/src/components/CdsSelectionControl/CdsSelectionControl.vue_vue_type_script_setup_true_lang.js +8 -0
- package/dist/es/src/components/CdsSelectionControl/CdsSelectionControl.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsSelectionControl/api/CdsSelectionControl.props.js +12 -3
- package/dist/es/src/components/CdsSelectionControl/api/CdsSelectionControl.props.js.map +1 -1
- package/dist/es/src/components/CdsSelectionControlGroup/CdsSelectionControlGroup.css +0 -18
- package/dist/es/src/components/CdsSelectionControlGroup/api/CdsSelectionControlGroup.props.js +44 -11
- package/dist/es/src/components/CdsSelectionControlGroup/api/CdsSelectionControlGroup.props.js.map +1 -1
- package/dist/es/src/components/CdsSkeletonLoader/CdsSkeletonLoader.css +0 -18
- package/dist/es/src/components/CdsSkeletonLoader/CdsSkeletonLoader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsSkeletonLoader/api/CdsSkeletonLoader.props.js +17 -5
- package/dist/es/src/components/CdsSkeletonLoader/api/CdsSkeletonLoader.props.js.map +1 -1
- package/dist/es/src/components/CdsSkeletonLoader/api/CdsSkeletonLoader.types.js.map +1 -1
- package/dist/es/src/components/CdsSlideGroup/CdsSlideGroup.css +0 -18
- package/dist/es/src/components/CdsSlideGroup/CdsSlideGroup.vue_vue_type_script_setup_true_lang.js +25 -7
- package/dist/es/src/components/CdsSlideGroup/CdsSlideGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsSlideGroup/api/CdsSlideGroup.props.js +26 -7
- package/dist/es/src/components/CdsSlideGroup/api/CdsSlideGroup.props.js.map +1 -1
- package/dist/es/src/components/CdsSlideView/CdsSlideView.css +0 -18
- package/dist/es/src/components/CdsSlideView/CdsSlideView.vue_vue_type_script_setup_true_lang.js +4 -0
- package/dist/es/src/components/CdsSlideView/CdsSlideView.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsSlideView/CdsSlideViewItem.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/es/src/components/CdsSlideView/CdsSlideViewItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsSlideView/api/CdsSlideView.props.js +45 -1
- package/dist/es/src/components/CdsSlideView/api/CdsSlideView.props.js.map +1 -1
- package/dist/es/src/components/CdsStages/CdsStages.css +0 -18
- package/dist/es/src/components/CdsStages/CdsStages.vue_vue_type_script_setup_true_lang.js +9 -1
- package/dist/es/src/components/CdsStages/CdsStages.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsStages/api/CdsStages.props.js +9 -3
- package/dist/es/src/components/CdsStages/api/CdsStages.props.js.map +1 -1
- package/dist/es/src/components/CdsStatus/CdsStatus.css +0 -18
- package/dist/es/src/components/CdsStatus/CdsStatus.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsStatus/api/CdsStatus.props.js +5 -2
- package/dist/es/src/components/CdsStatus/api/CdsStatus.props.js.map +1 -1
- package/dist/es/src/components/CdsSteps/CdsSteps.css +0 -18
- package/dist/es/src/components/CdsSteps/CdsSteps.vue_vue_type_script_setup_true_lang.js +8 -0
- package/dist/es/src/components/CdsSteps/CdsSteps.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsSteps/api/CdsSteps.props.js +45 -12
- package/dist/es/src/components/CdsSteps/api/CdsSteps.props.js.map +1 -1
- package/dist/es/src/components/CdsSurface/CdsSurface.css +0 -18
- package/dist/es/src/components/CdsSurface/CdsSurface.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsSurface/api/CdsSurface.props.js +5 -2
- package/dist/es/src/components/CdsSurface/api/CdsSurface.props.js.map +1 -1
- package/dist/es/src/components/CdsTable/CdsTable.css +0 -18
- package/dist/es/src/components/CdsTable/CdsTable.vue_vue_type_script_setup_true_lang.js +4 -0
- package/dist/es/src/components/CdsTable/CdsTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsTable/api/CdsTable.props.js +1 -1
- package/dist/es/src/components/CdsTable/components/TableProvider.js +2 -2
- package/dist/es/src/components/CdsTable/composable/table.js +47 -0
- package/dist/es/src/components/CdsTable/composable/table.js.map +1 -1
- package/dist/es/src/components/CdsTabs/CdsTabs.css +0 -18
- package/dist/es/src/components/CdsTabs/api/CdsTabs.props.js +56 -0
- package/dist/es/src/components/CdsTabs/api/CdsTabs.props.js.map +1 -1
- package/dist/es/src/components/CdsTag/CdsTag.css +0 -18
- package/dist/es/src/components/CdsTag/CdsTag.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsTag/api/CdsTag.props.js +72 -18
- package/dist/es/src/components/CdsTag/api/CdsTag.props.js.map +1 -1
- package/dist/es/src/components/CdsTagGroup/CdsTagGroup.css +0 -18
- package/dist/es/src/components/CdsTagGroup/CdsTagGroup.vue_vue_type_script_setup_true_lang.js +21 -6
- package/dist/es/src/components/CdsTagGroup/CdsTagGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsTagGroup/api/CdsTagGroup.props.js +12 -4
- package/dist/es/src/components/CdsTagGroup/api/CdsTagGroup.props.js.map +1 -1
- package/dist/es/src/components/CdsTextArea/CdsTextArea.css +0 -18
- package/dist/es/src/components/CdsTextArea/api/CdsTextArea.props.js +52 -13
- package/dist/es/src/components/CdsTextArea/api/CdsTextArea.props.js.map +1 -1
- package/dist/es/src/components/CdsTextInput/CdsTextInput.css +0 -18
- package/dist/es/src/components/CdsTextInput/api/CdsTextInput.props.js +40 -10
- package/dist/es/src/components/CdsTextInput/api/CdsTextInput.props.js.map +1 -1
- package/dist/es/src/components/CdsTimePicker/CdsTimePicker.css +0 -18
- package/dist/es/src/components/CdsTimePicker/CdsTimePicker.vue_vue_type_script_setup_true_lang.js +25 -1
- package/dist/es/src/components/CdsTimePicker/CdsTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsTimePicker/api/CdsTimePicker.props.js +33 -9
- package/dist/es/src/components/CdsTimePicker/api/CdsTimePicker.props.js.map +1 -1
- package/dist/es/src/components/CdsToast/CdsToast.css +0 -18
- package/dist/es/src/components/CdsToast/CdsToast.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsToast/api/CdsToast.props.js +48 -12
- package/dist/es/src/components/CdsToast/api/CdsToast.props.js.map +1 -1
- package/dist/es/src/components/CdsToastQueue/CdsToastQueue.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/src/components/CdsToastQueue/CdsToastQueue.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsToastQueue/api/CdsToastQueue.props.js +28 -7
- package/dist/es/src/components/CdsToastQueue/api/CdsToastQueue.props.js.map +1 -1
- package/dist/es/src/components/CdsToggle/CdsToggle.css +0 -18
- package/dist/es/src/components/CdsToggle/api/CdsToggle.props.js +12 -3
- package/dist/es/src/components/CdsToggle/api/CdsToggle.props.js.map +1 -1
- package/dist/es/src/components/CdsToolbar/CdsToolbar.css +0 -18
- package/dist/es/src/components/CdsToolbar/CdsToolbar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/src/components/CdsToolbar/api/CdsToolbar.props.js +21 -6
- package/dist/es/src/components/CdsToolbar/api/CdsToolbar.props.js.map +1 -1
- package/dist/es/src/components/CdsTooltip/CdsTooltip.css +0 -18
- package/dist/es/src/components/CdsTooltip/api/CdsTooltip.props.js +20 -5
- package/dist/es/src/components/CdsTooltip/api/CdsTooltip.props.js.map +1 -1
- package/dist/es/src/components/CdsTree/CdsTree.css +0 -18
- package/dist/es/src/components/CdsTree/CdsTree.vue_vue_type_script_setup_true_lang.js +17 -1
- package/dist/es/src/components/CdsTree/CdsTree.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsTree/api/CdsTree.props.js +1 -1
- package/dist/es/src/components/CdsTree/composable/tree.js +28 -0
- package/dist/es/src/components/CdsTree/composable/tree.js.map +1 -1
- package/dist/es/src/components/CdsTree/composable/treeNode.js +68 -2
- package/dist/es/src/components/CdsTree/composable/treeNode.js.map +1 -1
- package/dist/es/src/components/CdsUploader/CdsUploader.css +0 -18
- package/dist/es/src/components/CdsUploader/CdsUploader.vue_vue_type_script_setup_true_lang.js +9 -1
- package/dist/es/src/components/CdsUploader/CdsUploader.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsUploader/composables/useUpload.js +104 -26
- package/dist/es/src/components/CdsUploader/composables/useUpload.js.map +1 -1
- package/dist/es/src/components/CdsVirtualScroll/CdsVirtualScroll.css +0 -18
- package/dist/es/src/components/CdsVirtualScroll/CdsVirtualScroll.vue_vue_type_script_setup_true_lang.js +8 -0
- package/dist/es/src/components/CdsVirtualScroll/CdsVirtualScroll.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/es/src/components/CdsVirtualScroll/api/CdsVirtualScroll.props.js +12 -3
- package/dist/es/src/components/CdsVirtualScroll/api/CdsVirtualScroll.props.js.map +1 -1
- package/dist/es/src/components/index.js +2 -1
- package/dist/es/src/components/index.js.map +1 -1
- package/dist/es/src/composables/useAppearance/useAppearance.js +4 -1
- package/dist/es/src/composables/useAppearance/useAppearance.js.map +1 -1
- package/dist/es/src/composables/useColor/useColor.js +20 -5
- package/dist/es/src/composables/useColor/useColor.js.map +1 -1
- package/dist/es/src/composables/useDatetime/useDatetime.js +3 -0
- package/dist/es/src/composables/useDatetime/useDatetime.js.map +1 -1
- package/dist/es/src/composables/useDelay/useDelay.js +8 -2
- package/dist/es/src/composables/useDelay/useDelay.js.map +1 -1
- package/dist/es/src/composables/useDimensions/useDimensions.js +24 -6
- package/dist/es/src/composables/useDimensions/useDimensions.js.map +1 -1
- package/dist/es/src/composables/useDirection/useDirection.js +4 -1
- package/dist/es/src/composables/useDirection/useDirection.js.map +1 -1
- package/dist/es/src/composables/useDisabled/index.js +1 -1
- package/dist/es/src/composables/useDisabled/index.js.map +1 -1
- package/dist/es/src/composables/useDisabled/useDisabled.js +4 -1
- package/dist/es/src/composables/useDisabled/useDisabled.js.map +1 -1
- package/dist/es/src/composables/useDisplay/useDisplay.js +2 -0
- package/dist/es/src/composables/useDisplay/useDisplay.js.map +1 -1
- package/dist/es/src/composables/useFilter/useFilter.js +20 -0
- package/dist/es/src/composables/useFilter/useFilter.js.map +1 -1
- package/dist/es/src/composables/useFocus/useFocus.js +12 -3
- package/dist/es/src/composables/useFocus/useFocus.js.map +1 -1
- package/dist/es/src/composables/useFocus/useFocusTrap.js +8 -2
- package/dist/es/src/composables/useFocus/useFocusTrap.js.map +1 -1
- package/dist/es/src/composables/useForm/useForm.js +45 -0
- package/dist/es/src/composables/useForm/useForm.js.map +1 -1
- package/dist/es/src/composables/useGroup/useGroup.js +24 -6
- package/dist/es/src/composables/useGroup/useGroup.js.map +1 -1
- package/dist/es/src/composables/useGroup/useGroupItem.js +8 -2
- package/dist/es/src/composables/useGroup/useGroupItem.js.map +1 -1
- package/dist/es/src/composables/useHydration/useHydration.js +1 -1
- package/dist/es/src/composables/useItems/useItems.js +32 -8
- package/dist/es/src/composables/useItems/useItems.js.map +1 -1
- package/dist/es/src/composables/useLayout/context.js.map +1 -1
- package/dist/es/src/composables/useLayout/useLayout.js +25 -7
- package/dist/es/src/composables/useLayout/useLayout.js.map +1 -1
- package/dist/es/src/composables/useLazy/useLazy.js +1 -0
- package/dist/es/src/composables/useLazy/useLazy.js.map +1 -1
- package/dist/es/src/composables/useLoader/index.js +1 -1
- package/dist/es/src/composables/useLoader/index.js.map +1 -1
- package/dist/es/src/composables/useLoader/useLoader.js +4 -1
- package/dist/es/src/composables/useLoader/useLoader.js.map +1 -1
- package/dist/es/src/composables/useLocation/index.js +1 -1
- package/dist/es/src/composables/useLocation/index.js.map +1 -1
- package/dist/es/src/composables/useLocation/useLocation.js +4 -1
- package/dist/es/src/composables/useLocation/useLocation.js.map +1 -1
- package/dist/es/src/composables/useNested/useNested.js +44 -11
- package/dist/es/src/composables/useNested/useNested.js.map +1 -1
- package/dist/es/src/composables/usePosition/usePosition.js +4 -0
- package/dist/es/src/composables/usePosition/usePosition.js.map +1 -1
- package/dist/es/src/composables/useReadonly/useReadonly.js +4 -1
- package/dist/es/src/composables/useReadonly/useReadonly.js.map +1 -1
- package/dist/es/src/composables/useReveal/useReveal.js +4 -1
- package/dist/es/src/composables/useReveal/useReveal.js.map +1 -1
- package/dist/es/src/composables/useRouter/index.js +1 -1
- package/dist/es/src/composables/useRouter/index.js.map +1 -1
- package/dist/es/src/composables/useRouter/useRouter.js +16 -4
- package/dist/es/src/composables/useRouter/useRouter.js.map +1 -1
- package/dist/es/src/composables/useSize/useSize.js +4 -1
- package/dist/es/src/composables/useSize/useSize.js.map +1 -1
- package/dist/es/src/composables/useStatus/useStatus.js +4 -1
- package/dist/es/src/composables/useStatus/useStatus.js.map +1 -1
- package/dist/es/src/composables/useText/useText.js +8 -2
- package/dist/es/src/composables/useText/useText.js.map +1 -1
- package/dist/es/src/composables/useTheme/internal/useTheme.constants.js +13 -2
- package/dist/es/src/composables/useTheme/internal/useTheme.constants.js.map +1 -1
- package/dist/es/src/composables/useTheme/useTheme.js +4 -1
- package/dist/es/src/composables/useTheme/useTheme.js.map +1 -1
- package/dist/es/src/composables/useTransition/useTransition.js +4 -1
- package/dist/es/src/composables/useTransition/useTransition.js.map +1 -1
- package/dist/es/src/composables/useValidation/useValidation.js +26 -6
- package/dist/es/src/composables/useValidation/useValidation.js.map +1 -1
- package/dist/es/src/composables/useVirtual/useVirtual.js +13 -4
- package/dist/es/src/composables/useVirtual/useVirtual.js.map +1 -1
- package/dist/es/src/core/defineComponent.js +4 -1
- package/dist/es/src/core/defineComponent.js.map +1 -1
- package/dist/es/src/core/useDefaults.js +3 -1
- package/dist/es/src/locales/adapters/cdsLocaleAdapter.js +2 -1
- package/dist/es/src/locales/adapters/cdsLocaleAdapter.js.map +1 -1
- package/dist/es/src/locales/en.js +70 -0
- package/dist/es/src/locales/en.js.map +1 -0
- package/dist/es/src/locales/index.js +18 -0
- package/dist/es/src/locales/index.js.map +1 -0
- package/dist/es/src/themes/index.js +4 -0
- package/dist/es/src/themes/index.js.map +1 -1
- package/dist/es/src/themes/lumaDark.js +24 -0
- package/dist/es/src/themes/lumaDark.js.map +1 -0
- package/dist/es/src/themes/lumaLight.js +20 -0
- package/dist/es/src/themes/lumaLight.js.map +1 -0
- package/dist/es/src/utils/date/date.js +4 -4
- package/dist/es/src/utils/date/date.js.map +1 -1
- package/dist/esm-node/entry.css +0 -18
- package/dist/esm-node/entry.mjs +132 -122
- package/dist/esm-node/src/assets/icons/cdsLegacy.mjs +1 -1
- package/dist/esm-node/src/cds.mjs +6 -6
- package/dist/esm-node/src/components/CdsApp/CdsApp.css +0 -18
- package/dist/esm-node/src/components/CdsApp/CdsApp.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsApp/api/CdsApp.props.mjs +2 -1
- package/dist/esm-node/src/components/CdsAutocomplete/CdsAutocomplete.css +0 -18
- package/dist/esm-node/src/components/CdsAutocomplete/CdsAutocomplete.vue_vue_type_script_setup_true_lang.mjs +23 -8
- package/dist/esm-node/src/components/CdsAutocomplete/api/CdsAutocomplete.props.mjs +10 -3
- package/dist/esm-node/src/components/CdsAvatar/CdsAvatar.css +0 -18
- package/dist/esm-node/src/components/CdsAvatar/CdsAvatar.vue_vue_type_script_setup_true_lang.mjs +3 -3
- package/dist/esm-node/src/components/CdsAvatar/api/CdsAvatar.props.mjs +21 -6
- package/dist/esm-node/src/components/CdsBadge/CdsBadge.css +0 -18
- package/dist/esm-node/src/components/CdsBadge/CdsBadge.vue_vue_type_script_setup_true_lang.mjs +3 -3
- package/dist/esm-node/src/components/CdsBadge/api/CdsBadge.props.mjs +39 -11
- package/dist/esm-node/src/components/CdsBreadcrumbs/CdsBreadcrumbs.css +0 -18
- package/dist/esm-node/src/components/CdsBreadcrumbs/CdsBreadcrumbs.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsBreadcrumbs/CdsBreadcrumbsDivider.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsBreadcrumbs/CdsBreadcrumbsItem.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsBreadcrumbs/api/CdsBreadcrumbs.props.mjs +33 -9
- package/dist/esm-node/src/components/CdsButton/CdsButton.css +0 -18
- package/dist/esm-node/src/components/CdsButton/CdsButton.vue_vue_type_script_setup_true_lang.mjs +6 -3
- package/dist/esm-node/src/components/CdsButton/api/CdsButton.props.mjs +30 -9
- package/dist/esm-node/src/components/CdsButtonGroup/CdsButtonGroup.css +0 -18
- package/dist/esm-node/src/components/CdsButtonGroup/CdsButtonGroup.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsButtonGroup/api/CdsButtonGroup.props.mjs +6 -3
- package/dist/esm-node/src/components/CdsButtonToggle/CdsButtonToggle.css +0 -18
- package/dist/esm-node/src/components/CdsButtonToggle/CdsButtonToggle.vue_vue_type_script_setup_true_lang.mjs +21 -6
- package/dist/esm-node/src/components/CdsButtonToggle/api/CdsButtonToggle.props.mjs +1 -1
- package/dist/esm-node/src/components/CdsCard/CdsCard.css +0 -18
- package/dist/esm-node/src/components/CdsCard/CdsCard.vue_vue_type_script_setup_true_lang.mjs +3 -3
- package/dist/esm-node/src/components/CdsCard/CdsCardActions.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsCard/CdsCardDivider.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsCard/CdsCardGroup.vue_vue_type_script_setup_true_lang.mjs +22 -7
- package/dist/esm-node/src/components/CdsCard/CdsCardItem.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsCard/CdsCardSubtitle.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsCard/CdsCardText.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsCard/CdsCardTitle.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsCard/api/CdsCard.props.mjs +85 -21
- package/dist/esm-node/src/components/CdsCarousel/CdsCarousel.css +0 -18
- package/dist/esm-node/src/components/CdsCarousel/CdsCarousel.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsCarousel/CdsCarouselItem.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsCarousel/api/CdsCarousel.props.mjs +36 -9
- package/dist/esm-node/src/components/CdsCheckbox/CdsCheckbox.css +0 -18
- package/dist/esm-node/src/components/CdsCheckbox/CdsCheckbox.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsCheckbox/api/CdsCheckbox.props.mjs +1 -1
- package/dist/esm-node/src/components/CdsCheckboxButton/CdsCheckboxButton.css +0 -18
- package/dist/esm-node/src/components/CdsCheckboxButton/CdsCheckboxButton.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsCheckboxButton/api/CdsCheckboxButton.props.mjs +8 -2
- package/dist/esm-node/src/components/CdsCombobox/CdsCombobox.css +0 -18
- package/dist/esm-node/src/components/CdsCombobox/CdsCombobox.vue_vue_type_script_setup_true_lang.mjs +27 -9
- package/dist/esm-node/src/components/CdsCombobox/api/CdsCombobox.props.mjs +14 -4
- package/dist/esm-node/src/components/CdsCounter/CdsCounter.css +0 -18
- package/dist/esm-node/src/components/CdsCounter/CdsCounter.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsCounter/api/CdsCounter.props.mjs +12 -3
- package/dist/esm-node/src/components/CdsDateInput/CdsDateInput.css +0 -18
- package/dist/esm-node/src/components/CdsDateInput/CdsDateInput.vue_vue_type_script_setup_true_lang.mjs +11 -3
- package/dist/esm-node/src/components/CdsDateInput/api/CdsDateInput.props.mjs +32 -8
- package/dist/esm-node/src/components/CdsDatePicker/CdsDatePicker.css +0 -18
- package/dist/esm-node/src/components/CdsDatePicker/CdsDatePicker.vue_vue_type_script_setup_true_lang.mjs +23 -3
- package/dist/esm-node/src/components/CdsDatePicker/api/CdsDatePicker.props.mjs +65 -16
- package/dist/esm-node/src/components/CdsDatePicker/composables/useCalendar.mjs +3 -3
- package/dist/esm-node/src/components/CdsDefaultsProvider/api/CdsDefaultsProvider.props.mjs +5 -0
- package/dist/esm-node/src/components/CdsDescription/CdsDescription.css +0 -18
- package/dist/esm-node/src/components/CdsDescription/CdsDescription.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsDivider/CdsDivider.css +0 -18
- package/dist/esm-node/src/components/CdsDivider/CdsDivider.vue_vue_type_script_setup_true_lang.mjs +3 -3
- package/dist/esm-node/src/components/CdsDivider/api/CdsDivider.props.mjs +33 -8
- package/dist/esm-node/src/components/CdsDrawer/CdsDrawer.css +0 -18
- package/dist/esm-node/src/components/CdsDrawer/CdsDrawer.vue_vue_type_script_setup_true_lang.mjs +8 -4
- package/dist/esm-node/src/components/CdsDrawer/api/CdsDrawer.props.mjs +34 -10
- package/dist/esm-node/src/components/CdsEmptyState/CdsEmptyState.css +0 -18
- package/dist/esm-node/src/components/CdsEmptyState/CdsEmptyState.vue_vue_type_script_setup_true_lang.mjs +5 -5
- package/dist/esm-node/src/components/CdsEmptyState/api/CdsEmptyState.props.mjs +35 -10
- package/dist/esm-node/src/components/CdsExpandablePanel/CdsExpandablePanel.vue_vue_type_script_setup_true_lang.mjs +17 -5
- package/dist/esm-node/src/components/CdsExpandablePanel/CdsExpandablePanelContent.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsExpandablePanel/CdsExpandablePanelTitle.vue_vue_type_script_setup_true_lang.mjs +9 -3
- package/dist/esm-node/src/components/CdsExpandablePanel/CdsExpandablePanels.css +0 -18
- package/dist/esm-node/src/components/CdsExpandablePanel/CdsExpandablePanels.vue_vue_type_script_setup_true_lang.mjs +11 -5
- package/dist/esm-node/src/components/CdsExpandablePanel/api/CdsExpandablePanel.props.mjs +40 -11
- package/dist/esm-node/src/components/CdsField/CdsField.css +0 -18
- package/dist/esm-node/src/components/CdsField/CdsField.vue_vue_type_script_setup_true_lang.mjs +15 -5
- package/dist/esm-node/src/components/CdsField/api/CdsField.props.mjs +58 -16
- package/dist/esm-node/src/components/CdsField/composables/useAutocomplete.mjs +1 -0
- package/dist/esm-node/src/components/CdsFileInput/CdsFileInput.css +0 -18
- package/dist/esm-node/src/components/CdsFileInput/CdsFileInput.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsFileInput/api/CdsFileInput.props.mjs +41 -11
- package/dist/esm-node/src/components/CdsFileInput/composables/useFileFilter.mjs +4 -1
- package/dist/esm-node/src/components/CdsFileUpload/CdsFileUpload.css +0 -18
- package/dist/esm-node/src/components/CdsFileUpload/CdsFileUpload.vue_vue_type_script_setup_true_lang.mjs +6 -2
- package/dist/esm-node/src/components/CdsFileUpload/CdsFileUploadDropzone.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsFileUpload/CdsFileUploadItem.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsFileUpload/CdsFileUploadList.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsFileUpload/api/CdsFileUpload.props.mjs +86 -22
- package/dist/esm-node/src/components/CdsFooter/CdsFooter.css +0 -18
- package/dist/esm-node/src/components/CdsFooter/CdsFooter.vue_vue_type_script_setup_true_lang.mjs +4 -4
- package/dist/esm-node/src/components/CdsFooter/api/CdsFooter.props.mjs +2 -2
- package/dist/esm-node/src/components/CdsForm/CdsForm.css +0 -18
- package/dist/esm-node/src/components/CdsForm/CdsForm.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsForm/api/CdsForm.props.mjs +8 -2
- package/dist/esm-node/src/components/CdsFunctionalButton/CdsFunctionalButton.css +0 -18
- package/dist/esm-node/src/components/CdsFunctionalButton/api/CdsFunctionalButton.props.mjs +6 -3
- package/dist/esm-node/src/components/CdsGrid/CdsCol.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsGrid/CdsRow.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsGrid/api/CdsGrid.props.mjs +41 -11
- package/dist/esm-node/src/components/CdsGrid/components/CSSGrid.css +0 -18
- package/dist/esm-node/src/components/CdsGrid/components/CSSGrid.mjs +1 -1
- package/dist/esm-node/src/components/CdsGrid/components/FlexGrid.css +0 -18
- package/dist/esm-node/src/components/CdsGrid/components/FlexGrid.mjs +1 -1
- package/dist/esm-node/src/components/CdsHeader/CdsHeader.css +0 -18
- package/dist/esm-node/src/components/CdsHeader/CdsHeader.vue_vue_type_script_setup_true_lang.mjs +3 -3
- package/dist/esm-node/src/components/CdsHeader/api/CdsHeader.props.mjs +2 -2
- package/dist/esm-node/src/components/CdsHighlight/CdsHighlight.css +0 -18
- package/dist/esm-node/src/components/CdsHighlight/CdsHighlight.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsHighlight/api/CdsHighlight.props.mjs +32 -8
- package/dist/esm-node/src/components/CdsHighlight/utils/toHighlight.mjs +1 -1
- package/dist/esm-node/src/components/CdsIcon/CdsIcon.css +0 -18
- package/dist/esm-node/src/components/CdsIcon/CdsIcon.vue_vue_type_script_setup_true_lang.mjs +3 -3
- package/dist/esm-node/src/components/CdsIcon/api/CdsIcon.props.mjs +18 -5
- package/dist/esm-node/src/components/CdsImage/CdsImage.css +0 -18
- package/dist/esm-node/src/components/CdsImage/CdsImage.vue_vue_type_script_setup_true_lang.mjs +24 -4
- package/dist/esm-node/src/components/CdsImage/api/CdsImage.props.mjs +65 -17
- package/dist/esm-node/src/components/CdsInput/CdsInput.css +0 -18
- package/dist/esm-node/src/components/CdsInput/CdsInput.vue_vue_type_script_setup_true_lang.mjs +46 -13
- package/dist/esm-node/src/components/CdsInput/CdsInputIcon.mjs +1 -1
- package/dist/esm-node/src/components/CdsInput/api/CdsInput.props.mjs +50 -14
- package/dist/esm-node/src/components/CdsLabel/CdsLabel.css +0 -18
- package/dist/esm-node/src/components/CdsLabel/CdsLabel.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsLabel/api/CdsLabel.props.mjs +5 -1
- package/dist/esm-node/src/components/CdsLayout/CdsLayout.css +0 -18
- package/dist/esm-node/src/components/CdsLayout/CdsLayout.vue_vue_type_script_setup_true_lang.mjs +5 -5
- package/dist/esm-node/src/components/CdsLayout/api/CdsLayout.props.mjs +6 -2
- package/dist/esm-node/src/components/CdsLayout/internal/LayoutResizeObserver.mjs +1 -1
- package/dist/esm-node/src/components/CdsLayout/internal/LayoutScrollObserver.mjs +2 -2
- package/dist/esm-node/src/components/CdsLink/CdsLink.css +0 -18
- package/dist/esm-node/src/components/CdsLink/CdsLink.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsLink/api/CdsLink.props.mjs +5 -2
- package/dist/esm-node/src/components/CdsList/CdsList.css +0 -18
- package/dist/esm-node/src/components/CdsList/CdsList.vue_vue_type_script_setup_true_lang.mjs +27 -9
- package/dist/esm-node/src/components/CdsList/CdsListGroup.vue_vue_type_script_setup_true_lang.mjs +5 -2
- package/dist/esm-node/src/components/CdsList/CdsListItem.css +0 -18
- package/dist/esm-node/src/components/CdsList/CdsListItem.vue_vue_type_script_setup_true_lang.mjs +31 -10
- package/dist/esm-node/src/components/CdsList/CdsListItemAction.vue_vue_type_script_setup_true_lang.mjs +9 -3
- package/dist/esm-node/src/components/CdsList/CdsListItemDivider.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsList/CdsListItemMedia.vue_vue_type_script_setup_true_lang.mjs +9 -3
- package/dist/esm-node/src/components/CdsList/CdsListSubheader.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsList/api/CdsList.props.mjs +146 -38
- package/dist/esm-node/src/components/CdsList/components/ListChildren.vue_vue_type_script_setup_true_lang.mjs +8 -2
- package/dist/esm-node/src/components/CdsList/composables/useList.mjs +1 -1
- package/dist/esm-node/src/components/CdsList/index.mjs +5 -2
- package/dist/esm-node/src/components/CdsLoader/CdsLoader.css +0 -18
- package/dist/esm-node/src/components/CdsLoader/CdsLoader.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsLoader/api/CdsLoader.props.mjs +12 -3
- package/dist/esm-node/src/components/CdsMain/CdsMain.css +0 -18
- package/dist/esm-node/src/components/CdsMain/CdsMain.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsMenu/CdsMenu.css +0 -18
- package/dist/esm-node/src/components/CdsMenu/CdsMenu.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsMenu/api/CdsMenu.props.mjs +9 -3
- package/dist/esm-node/src/components/CdsMessages/CdsMessages.css +0 -18
- package/dist/esm-node/src/components/CdsMessages/CdsMessages.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsMessages/api/CdsMessages.props.mjs +12 -3
- package/dist/esm-node/src/components/CdsModal/CdsModal.css +0 -18
- package/dist/esm-node/src/components/CdsModal/CdsModal.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsModal/api/CdsModal.props.mjs +8 -2
- package/dist/esm-node/src/components/CdsNotification/CdsNotification.css +0 -18
- package/dist/esm-node/src/components/CdsNotification/CdsNotification.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsNotification/api/CdsNotification.props.mjs +30 -9
- package/dist/esm-node/src/components/CdsNotificationAlert/CdsNotificationAlert.css +0 -18
- package/dist/esm-node/src/components/CdsNotificationAlert/CdsNotificationAlert.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsNotificationAlert/api/CdsNotificationAlert.props.mjs +29 -8
- package/dist/esm-node/src/components/CdsOtpInput/CdsOtpField.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsOtpInput/CdsOtpGroup.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsOtpInput/CdsOtpInput.css +0 -18
- package/dist/esm-node/src/components/CdsOtpInput/CdsOtpInput.vue_vue_type_script_setup_true_lang.mjs +23 -8
- package/dist/esm-node/src/components/CdsOtpInput/CdsOtpSeparator.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsOtpInput/api/CdsOtpInput.props.mjs +53 -14
- package/dist/esm-node/src/components/CdsOverlay/CdsOverlay.css +0 -18
- package/dist/esm-node/src/components/CdsOverlay/CdsOverlay.vue_vue_type_script_setup_true_lang.mjs +50 -17
- package/dist/esm-node/src/components/CdsOverlay/api/CdsOverlay.props.mjs +37 -9
- package/dist/esm-node/src/components/CdsOverlay/components/Scrim.mjs +1 -1
- package/dist/esm-node/src/components/CdsOverlay/composables/useActivator.mjs +27 -8
- package/dist/esm-node/src/components/CdsOverlay/composables/useLocationStrategies.mjs +21 -7
- package/dist/esm-node/src/components/CdsOverlay/composables/useScrollStrategies.mjs +7 -4
- package/dist/esm-node/src/components/CdsPage/CdsPage.css +0 -18
- package/dist/esm-node/src/components/CdsPage/CdsPage.vue_vue_type_script_setup_true_lang.mjs +3 -3
- package/dist/esm-node/src/components/CdsPage/api/CdsPage.props.mjs +5 -1
- package/dist/esm-node/src/components/CdsPagination/CdsPagination.css +0 -18
- package/dist/esm-node/src/components/CdsPagination/CdsPagination.vue_vue_type_script_setup_true_lang.mjs +20 -4
- package/dist/esm-node/src/components/CdsPagination/api/CdsPagination.props.mjs +85 -22
- package/dist/esm-node/src/components/CdsProgressBar/CdsProgressBar.css +0 -18
- package/dist/esm-node/src/components/CdsProgressBar/CdsProgressBar.vue_vue_type_script_setup_true_lang.mjs +3 -3
- package/dist/esm-node/src/components/CdsProgressBar/api/CdsProgressBar.props.mjs +65 -17
- package/dist/esm-node/src/components/CdsProgressBar/composables/useChunk.mjs +5 -1
- package/dist/esm-node/src/components/CdsProgressCircle/CdsProgressCircle.css +0 -18
- package/dist/esm-node/src/components/CdsProgressCircle/CdsProgressCircle.vue_vue_type_script_setup_true_lang.mjs +4 -4
- package/dist/esm-node/src/components/CdsProgressCircle/api/CdsProgressCircle.props.mjs +29 -8
- package/dist/esm-node/src/components/CdsRadio/CdsRadio.css +0 -18
- package/dist/esm-node/src/components/CdsRadio/CdsRadio.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsRadioGroup/CdsRadioGroup.css +0 -18
- package/dist/esm-node/src/components/CdsRadioGroup/CdsRadioGroup.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsRadioGroup/api/CdsRadioGroup.props.mjs +17 -5
- package/dist/esm-node/src/components/CdsResponsive/CdsResponsive.css +0 -18
- package/dist/esm-node/src/components/CdsResponsive/CdsResponsive.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsResponsive/api/CdsResponsive.props.mjs +12 -3
- package/dist/esm-node/src/components/CdsResponsive/composables/useAspectStyles.mjs +1 -1
- package/dist/esm-node/src/components/CdsSelect/CdsSelect.css +0 -18
- package/dist/esm-node/src/components/CdsSelect/CdsSelect.vue_vue_type_script_setup_true_lang.mjs +19 -7
- package/dist/esm-node/src/components/CdsSelect/api/CdsSelect.props.mjs +5 -2
- package/dist/esm-node/src/components/CdsSelect/composables/useMenuActivator.mjs +8 -2
- package/dist/esm-node/src/components/CdsSelect/composables/useSelect.mjs +69 -17
- package/dist/esm-node/src/components/CdsSelectionControl/CdsSelectionControl.css +0 -18
- package/dist/esm-node/src/components/CdsSelectionControl/CdsSelectionControl.vue_vue_type_script_setup_true_lang.mjs +10 -2
- package/dist/esm-node/src/components/CdsSelectionControl/api/CdsSelectionControl.props.mjs +13 -4
- package/dist/esm-node/src/components/CdsSelectionControl/composables/useSelectionControl.mjs +1 -1
- package/dist/esm-node/src/components/CdsSelectionControlGroup/CdsSelectionControlGroup.css +0 -18
- package/dist/esm-node/src/components/CdsSelectionControlGroup/CdsSelectionControlGroup.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsSelectionControlGroup/api/CdsSelectionControlGroup.props.mjs +45 -12
- package/dist/esm-node/src/components/CdsSkeletonLoader/CdsSkeletonLoader.css +0 -18
- package/dist/esm-node/src/components/CdsSkeletonLoader/CdsSkeletonLoader.vue_vue_type_script_setup_true_lang.mjs +3 -3
- package/dist/esm-node/src/components/CdsSkeletonLoader/api/CdsSkeletonLoader.props.mjs +17 -5
- package/dist/esm-node/src/components/CdsSlideGroup/CdsSlideGroup.css +0 -18
- package/dist/esm-node/src/components/CdsSlideGroup/CdsSlideGroup.vue_vue_type_script_setup_true_lang.mjs +28 -10
- package/dist/esm-node/src/components/CdsSlideGroup/api/CdsSlideGroup.props.mjs +26 -7
- package/dist/esm-node/src/components/CdsSlideView/CdsSlideView.css +0 -18
- package/dist/esm-node/src/components/CdsSlideView/CdsSlideView.vue_vue_type_script_setup_true_lang.mjs +8 -4
- package/dist/esm-node/src/components/CdsSlideView/CdsSlideViewItem.vue_vue_type_script_setup_true_lang.mjs +7 -3
- package/dist/esm-node/src/components/CdsSlideView/api/CdsSlideView.props.mjs +45 -1
- package/dist/esm-node/src/components/CdsStages/CdsStages.css +0 -18
- package/dist/esm-node/src/components/CdsStages/CdsStages.vue_vue_type_script_setup_true_lang.mjs +10 -2
- package/dist/esm-node/src/components/CdsStages/api/CdsStages.props.mjs +9 -3
- package/dist/esm-node/src/components/CdsStatus/CdsStatus.css +0 -18
- package/dist/esm-node/src/components/CdsStatus/CdsStatus.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsStatus/api/CdsStatus.props.mjs +5 -2
- package/dist/esm-node/src/components/CdsSteps/CdsSteps.css +0 -18
- package/dist/esm-node/src/components/CdsSteps/CdsSteps.vue_vue_type_script_setup_true_lang.mjs +10 -2
- package/dist/esm-node/src/components/CdsSteps/CdsStepsActions.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsSteps/CdsStepsItem.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsSteps/CdsStepsView.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsSteps/CdsStepsViewItem.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsSteps/api/CdsSteps.props.mjs +46 -13
- package/dist/esm-node/src/components/CdsSurface/CdsSurface.css +0 -18
- package/dist/esm-node/src/components/CdsSurface/CdsSurface.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsSurface/api/CdsSurface.props.mjs +5 -2
- package/dist/esm-node/src/components/CdsTable/CdsTable.css +0 -18
- package/dist/esm-node/src/components/CdsTable/CdsTable.vue_vue_type_script_setup_true_lang.mjs +4 -0
- package/dist/esm-node/src/components/CdsTable/api/CdsTable.props.mjs +1 -1
- package/dist/esm-node/src/components/CdsTable/components/Body/BodyRow.mjs +2 -2
- package/dist/esm-node/src/components/CdsTable/components/Cell/Cell.mjs +6 -6
- package/dist/esm-node/src/components/CdsTable/components/Drag/ColumnDragHandle.mjs +1 -1
- package/dist/esm-node/src/components/CdsTable/components/Drag/RowDragHandle.mjs +1 -1
- package/dist/esm-node/src/components/CdsTable/components/Filter/FilterDropdown.mjs +3 -3
- package/dist/esm-node/src/components/CdsTable/components/FixedHolder/FixedHolder.mjs +2 -2
- package/dist/esm-node/src/components/CdsTable/components/Header/DragHandle.mjs +4 -4
- package/dist/esm-node/src/components/CdsTable/components/Header/Header.mjs +1 -1
- package/dist/esm-node/src/components/CdsTable/components/Header/HeaderRow.mjs +1 -1
- package/dist/esm-node/src/components/CdsTable/components/ResizeObserver/ResizeObserver.mjs +1 -1
- package/dist/esm-node/src/components/CdsTable/components/StickyScrollbar/StickyScrollbar.mjs +3 -3
- package/dist/esm-node/src/components/CdsTable/components/Table/InternalTable.mjs +4 -4
- package/dist/esm-node/src/components/CdsTable/components/TableProvider.mjs +6 -6
- package/dist/esm-node/src/components/CdsTable/composable/columns.mjs +1 -1
- package/dist/esm-node/src/components/CdsTable/composable/filter.mjs +1 -1
- package/dist/esm-node/src/components/CdsTable/composable/frame.mjs +1 -1
- package/dist/esm-node/src/components/CdsTable/composable/pagination.mjs +2 -2
- package/dist/esm-node/src/components/CdsTable/composable/scroll.mjs +3 -3
- package/dist/esm-node/src/components/CdsTable/composable/selection.mjs +2 -2
- package/dist/esm-node/src/components/CdsTable/composable/sorter.mjs +1 -1
- package/dist/esm-node/src/components/CdsTable/composable/sticky.mjs +1 -1
- package/dist/esm-node/src/components/CdsTable/composable/table.mjs +47 -0
- package/dist/esm-node/src/components/CdsTable/context/sticky.mjs +1 -1
- package/dist/esm-node/src/components/CdsTable/utils/column.mjs +1 -1
- package/dist/esm-node/src/components/CdsTabs/CdsTab.vue_vue_type_script_setup_true_lang.mjs +3 -3
- package/dist/esm-node/src/components/CdsTabs/CdsTabs.css +0 -18
- package/dist/esm-node/src/components/CdsTabs/CdsTabs.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsTabs/CdsTabsView.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsTabs/CdsTabsViewItem.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsTabs/api/CdsTabs.props.mjs +57 -1
- package/dist/esm-node/src/components/CdsTag/CdsTag.css +0 -18
- package/dist/esm-node/src/components/CdsTag/CdsTag.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsTag/api/CdsTag.props.mjs +73 -19
- package/dist/esm-node/src/components/CdsTagGroup/CdsTagGroup.css +0 -18
- package/dist/esm-node/src/components/CdsTagGroup/CdsTagGroup.vue_vue_type_script_setup_true_lang.mjs +22 -7
- package/dist/esm-node/src/components/CdsTagGroup/api/CdsTagGroup.props.mjs +13 -5
- package/dist/esm-node/src/components/CdsTextArea/CdsTextArea.css +0 -18
- package/dist/esm-node/src/components/CdsTextArea/CdsTextArea.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsTextArea/api/CdsTextArea.props.mjs +53 -14
- package/dist/esm-node/src/components/CdsTextInput/CdsTextInput.css +0 -18
- package/dist/esm-node/src/components/CdsTextInput/CdsTextInput.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsTextInput/api/CdsTextInput.props.mjs +41 -11
- package/dist/esm-node/src/components/CdsTimePicker/CdsTimePicker.css +0 -18
- package/dist/esm-node/src/components/CdsTimePicker/CdsTimePicker.vue_vue_type_script_setup_true_lang.mjs +27 -3
- package/dist/esm-node/src/components/CdsTimePicker/api/CdsTimePicker.props.mjs +33 -9
- package/dist/esm-node/src/components/CdsTimePicker/composables/useTime.mjs +1 -1
- package/dist/esm-node/src/components/CdsToast/CdsToast.css +0 -18
- package/dist/esm-node/src/components/CdsToast/CdsToast.vue_vue_type_script_setup_true_lang.mjs +3 -3
- package/dist/esm-node/src/components/CdsToast/api/CdsToast.props.mjs +49 -13
- package/dist/esm-node/src/components/CdsToastQueue/CdsToastQueue.vue_vue_type_script_setup_true_lang.mjs +5 -2
- package/dist/esm-node/src/components/CdsToastQueue/api/CdsToastQueue.props.mjs +29 -8
- package/dist/esm-node/src/components/CdsToastQueue/composables/useDocumentVisibility.mjs +1 -1
- package/dist/esm-node/src/components/CdsToggle/CdsToggle.css +0 -18
- package/dist/esm-node/src/components/CdsToggle/CdsToggle.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsToggle/api/CdsToggle.props.mjs +13 -4
- package/dist/esm-node/src/components/CdsToolbar/CdsToolbar.css +0 -18
- package/dist/esm-node/src/components/CdsToolbar/CdsToolbar.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsToolbar/CdsToolbarTitle.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsToolbar/api/CdsToolbar.props.mjs +22 -7
- package/dist/esm-node/src/components/CdsTooltip/CdsTooltip.css +0 -18
- package/dist/esm-node/src/components/CdsTooltip/CdsTooltip.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsTooltip/api/CdsTooltip.props.mjs +21 -6
- package/dist/esm-node/src/components/CdsTree/CdsTree.css +0 -18
- package/dist/esm-node/src/components/CdsTree/CdsTree.vue_vue_type_script_setup_true_lang.mjs +19 -3
- package/dist/esm-node/src/components/CdsTree/CdsTreeDirectory.vue_vue_type_script_lang.mjs +3 -3
- package/dist/esm-node/src/components/CdsTree/CdsTreeNode.vue_vue_type_script_lang.mjs +3 -3
- package/dist/esm-node/src/components/CdsTree/api/CdsTree.props.mjs +1 -1
- package/dist/esm-node/src/components/CdsTree/components/DropIndicator.mjs +1 -1
- package/dist/esm-node/src/components/CdsTree/components/NodeList.mjs +1 -1
- package/dist/esm-node/src/components/CdsTree/components/SwitcherIcon.mjs +2 -2
- package/dist/esm-node/src/components/CdsTree/components/TreeProvider.mjs +4 -4
- package/dist/esm-node/src/components/CdsTree/components/VirtualList/Filler.mjs +1 -1
- package/dist/esm-node/src/components/CdsTree/components/VirtualList/Item.mjs +1 -1
- package/dist/esm-node/src/components/CdsTree/components/VirtualList/ResizeObserver.mjs +1 -1
- package/dist/esm-node/src/components/CdsTree/components/VirtualList/ScrollBar.mjs +2 -2
- package/dist/esm-node/src/components/CdsTree/components/VirtualList/VirtualList.mjs +2 -2
- package/dist/esm-node/src/components/CdsTree/components/VirtualList/features/useFrameWheel.mjs +1 -1
- package/dist/esm-node/src/components/CdsTree/components/VirtualList/features/useHeights.mjs +1 -1
- package/dist/esm-node/src/components/CdsTree/components/VirtualList/features/useMobileTouchMove.mjs +1 -1
- package/dist/esm-node/src/components/CdsTree/composable/tree.mjs +28 -0
- package/dist/esm-node/src/components/CdsTree/composable/treeNode.mjs +68 -2
- package/dist/esm-node/src/components/CdsTree/utils/data.mjs +3 -3
- package/dist/esm-node/src/components/CdsUploader/CdsUploader.css +0 -18
- package/dist/esm-node/src/components/CdsUploader/CdsUploader.vue_vue_type_script_setup_true_lang.mjs +10 -2
- package/dist/esm-node/src/components/CdsUploader/components/AjaxUploader.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/dist/esm-node/src/components/CdsUploader/composables/useUpload.mjs +104 -26
- package/dist/esm-node/src/components/CdsVirtualScroll/CdsVirtualScroll.css +0 -18
- package/dist/esm-node/src/components/CdsVirtualScroll/CdsVirtualScroll.vue_vue_type_script_setup_true_lang.mjs +12 -4
- package/dist/esm-node/src/components/CdsVirtualScroll/CdsVirtualScrollItem.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/dist/esm-node/src/components/CdsVirtualScroll/api/CdsVirtualScroll.props.mjs +12 -3
- package/dist/esm-node/src/components/index.mjs +2 -1
- package/dist/esm-node/src/composables/useAppearance/useAppearance.mjs +4 -1
- package/dist/esm-node/src/composables/useColor/useColor.mjs +21 -6
- package/dist/esm-node/src/composables/useDatetime/useDatetime.mjs +5 -2
- package/dist/esm-node/src/composables/useDelay/useDelay.mjs +8 -2
- package/dist/esm-node/src/composables/useDimensions/useDimensions.mjs +25 -7
- package/dist/esm-node/src/composables/useDirection/useDirection.mjs +4 -1
- package/dist/esm-node/src/composables/useDisabled/useDisabled.mjs +4 -1
- package/dist/esm-node/src/composables/useDisplay/internal/useDisplay.helpers.mjs +1 -1
- package/dist/esm-node/src/composables/useDisplay/useDisplay.mjs +3 -1
- package/dist/esm-node/src/composables/useFilter/useFilter.mjs +21 -1
- package/dist/esm-node/src/composables/useFocus/useFocus.mjs +13 -4
- package/dist/esm-node/src/composables/useFocus/useFocusGroup.mjs +1 -1
- package/dist/esm-node/src/composables/useFocus/useFocusTrap.mjs +10 -4
- package/dist/esm-node/src/composables/useForm/useForm.mjs +46 -1
- package/dist/esm-node/src/composables/useGoTo/useGoTo.mjs +3 -3
- package/dist/esm-node/src/composables/useGroup/useGroup.mjs +25 -7
- package/dist/esm-node/src/composables/useGroup/useGroupItem.mjs +8 -2
- package/dist/esm-node/src/composables/useHydration/useHydration.mjs +2 -2
- package/dist/esm-node/src/composables/useIcons/useIcons.mjs +1 -1
- package/dist/esm-node/src/composables/useItems/useItems.mjs +33 -9
- package/dist/esm-node/src/composables/useLayout/useLayout.mjs +26 -8
- package/dist/esm-node/src/composables/useLazy/useLazy.mjs +1 -0
- package/dist/esm-node/src/composables/useLoader/useLoader.mjs +4 -1
- package/dist/esm-node/src/composables/useLocation/useLocation.mjs +5 -2
- package/dist/esm-node/src/composables/useNested/strategies/activeStrategies.mjs +1 -1
- package/dist/esm-node/src/composables/useNested/useNested.mjs +46 -13
- package/dist/esm-node/src/composables/usePosition/usePosition.mjs +4 -0
- package/dist/esm-node/src/composables/useReadonly/useReadonly.mjs +4 -1
- package/dist/esm-node/src/composables/useResizeObserver/useResizeObserver.mjs +1 -1
- package/dist/esm-node/src/composables/useReveal/useReveal.mjs +4 -1
- package/dist/esm-node/src/composables/useRouter/useRouter.mjs +17 -5
- package/dist/esm-node/src/composables/useSize/useSize.mjs +5 -2
- package/dist/esm-node/src/composables/useStatus/useStatus.mjs +4 -1
- package/dist/esm-node/src/composables/useTeleport/useTeleport.mjs +2 -2
- package/dist/esm-node/src/composables/useText/useText.mjs +8 -2
- package/dist/esm-node/src/composables/useTheme/internal/useTheme.constants.mjs +13 -2
- package/dist/esm-node/src/composables/useTheme/internal/useTheme.utils.mjs +2 -2
- package/dist/esm-node/src/composables/useTheme/useTheme.mjs +6 -3
- package/dist/esm-node/src/composables/useTransition/useTransition.mjs +5 -2
- package/dist/esm-node/src/composables/useValidation/useValidation.mjs +27 -7
- package/dist/esm-node/src/composables/useVirtual/useVirtual.mjs +14 -5
- package/dist/esm-node/src/core/defineComponent.mjs +6 -3
- package/dist/esm-node/src/core/getCurrentInstance.mjs +1 -1
- package/dist/esm-node/src/core/useDefaults.mjs +4 -2
- package/dist/esm-node/src/core/useProxyModel.mjs +1 -1
- package/dist/esm-node/src/hooks/createContext/index.mjs +1 -1
- package/dist/esm-node/src/hooks/createObserver/index.mjs +1 -1
- package/dist/esm-node/src/hooks/useBreakpoints/index.mjs +1 -1
- package/dist/esm-node/src/hooks/useEventListener/index.mjs +1 -1
- package/dist/esm-node/src/hooks/useHydration/index.mjs +1 -1
- package/dist/esm-node/src/hooks/useIntersectionObserver/index.mjs +1 -1
- package/dist/esm-node/src/hooks/useResizeObserver/index.mjs +1 -1
- package/dist/esm-node/src/icons.mjs +2 -2
- package/dist/esm-node/src/locales/adapters/cdsLocaleAdapter.mjs +3 -2
- package/dist/esm-node/src/locales/en.mjs +70 -0
- package/dist/esm-node/src/locales/index.mjs +18 -0
- package/dist/esm-node/src/themes/index.mjs +4 -0
- package/dist/esm-node/src/themes/lumaDark.mjs +24 -0
- package/dist/esm-node/src/themes/lumaLight.mjs +20 -0
- package/dist/esm-node/src/transitions/collapseTransition.mjs +1 -1
- package/dist/esm-node/src/transitions/createTransition.mjs +1 -1
- package/dist/esm-node/src/transitions/modalTransition.mjs +1 -1
- package/dist/esm-node/src/utils/colorsUtils/utils.mjs +2 -2
- package/dist/esm-node/src/utils/date/date.mjs +4 -4
- package/dist/esm-node/src/utils/dom/classNames.mjs +1 -1
- package/dist/esm-node/src/utils/dom/console.mjs +1 -1
- package/dist/esm-node/src/utils/dom/dom.mjs +1 -1
- package/dist/iife/entry.js +11 -11
- package/dist/styles/common.css +1 -1
- package/dist/styles/core.css +1 -1
- package/dist/styles/tailwind.css +1 -1
- package/dist/styles.css +2 -2
- package/dist/types/components/CdsApp/api/CdsApp.types.d.ts +4 -1
- package/dist/types/components/CdsAutocomplete/CdsAutocomplete.vue.d.ts +59 -20
- package/dist/types/components/CdsAutocomplete/api/CdsAutocomplete.types.d.ts +60 -15
- package/dist/types/components/CdsAutocomplete/index.d.ts +57 -30
- package/dist/types/components/CdsAvatar/api/CdsAvatar.types.d.ts +8 -2
- package/dist/types/components/CdsBadge/api/CdsBadge.types.d.ts +8 -2
- package/dist/types/components/CdsBreadcrumbs/api/CdsBreadcrumbs.types.d.ts +28 -7
- package/dist/types/components/CdsButton/CdsButton.vue.d.ts +4 -1
- package/dist/types/components/CdsButton/api/CdsButton.types.d.ts +20 -5
- package/dist/types/components/CdsButtonGroup/api/CdsButtonGroup.types.d.ts +4 -1
- package/dist/types/components/CdsButtonToggle/CdsButtonToggle.vue.d.ts +20 -5
- package/dist/types/components/CdsButtonToggle/api/CdsButtonToggle.types.d.ts +8 -2
- package/dist/types/components/CdsCard/CdsCardGroup.vue.d.ts +20 -5
- package/dist/types/components/CdsCard/api/CdsCard.types.d.ts +68 -17
- package/dist/types/components/CdsCarousel/api/CdsCarousel.types.d.ts +12 -3
- package/dist/types/components/CdsCheckbox/api/CdsCheckbox.types.d.ts +8 -2
- package/dist/types/components/CdsCheckboxButton/api/CdsCheckboxButton.types.d.ts +8 -0
- package/dist/types/components/CdsCombobox/CdsCombobox.vue.d.ts +67 -22
- package/dist/types/components/CdsCombobox/api/CdsCombobox.types.d.ts +60 -15
- package/dist/types/components/CdsCombobox/index.d.ts +57 -30
- package/dist/types/components/CdsCounter/api/CdsCounter.types.d.ts +4 -0
- package/dist/types/components/CdsDateInput/CdsDateInput.vue.d.ts +35 -10
- package/dist/types/components/CdsDateInput/api/CdsDateInput.types.d.ts +44 -11
- package/dist/types/components/CdsDateInput/index.d.ts +57 -30
- package/dist/types/components/CdsDatePicker/CdsDatePicker.vue.d.ts +20 -0
- package/dist/types/components/CdsDatePicker/api/CdsDatePicker.types.d.ts +28 -7
- package/dist/types/components/CdsDefaultsProvider/api/CdsDefaultsProvider.types.d.ts +1 -0
- package/dist/types/components/CdsDescription/api/CdsDescription.types.d.ts +4 -0
- package/dist/types/components/CdsDivider/CdsDivider.vue.d.ts +4 -0
- package/dist/types/components/CdsDrawer/CdsDrawer.vue.d.ts +4 -0
- package/dist/types/components/CdsDrawer/api/CdsDrawer.types.d.ts +24 -6
- package/dist/types/components/CdsEmptyState/api/CdsEmptyState.types.d.ts +36 -9
- package/dist/types/components/CdsExpandablePanel/CdsExpandablePanel.vue.d.ts +16 -4
- package/dist/types/components/CdsExpandablePanel/CdsExpandablePanelTitle.vue.d.ts +8 -2
- package/dist/types/components/CdsExpandablePanel/CdsExpandablePanels.vue.d.ts +8 -2
- package/dist/types/components/CdsExpandablePanel/api/CdsExpandablePanel.types.d.ts +56 -14
- package/dist/types/components/CdsField/CdsField.vue.d.ts +18 -2
- package/dist/types/components/CdsField/api/CdsField.types.d.ts +33 -7
- package/dist/types/components/CdsField/index.d.ts +5 -0
- package/dist/types/components/CdsFileInput/CdsFileInput.vue.d.ts +5 -2
- package/dist/types/components/CdsFileInput/api/CdsFileInput.types.d.ts +28 -7
- package/dist/types/components/CdsFileInput/index.d.ts +15 -6
- package/dist/types/components/CdsFileUpload/CdsFileUpload.vue.d.ts +8 -0
- package/dist/types/components/CdsFileUpload/api/CdsFileUpload.types.d.ts +116 -29
- package/dist/types/components/CdsFooter/api/CdsFooter.types.d.ts +12 -3
- package/dist/types/components/CdsForm/api/CdsForm.types.d.ts +20 -5
- package/dist/types/components/CdsFunctionalButton/api/CdsFunctionalButton.types.d.ts +8 -2
- package/dist/types/components/CdsGrid/api/CdsGrid.types.d.ts +12 -0
- package/dist/types/components/CdsHeader/api/CdsHeader.types.d.ts +12 -3
- package/dist/types/components/CdsIcon/api/CdsIcon.types.d.ts +4 -1
- package/dist/types/components/CdsImage/CdsImage.vue.d.ts +20 -0
- package/dist/types/components/CdsImage/api/CdsImage.props.d.ts +4 -1
- package/dist/types/components/CdsImage/api/CdsImage.types.d.ts +28 -7
- package/dist/types/components/CdsInput/CdsInput.vue.d.ts +44 -11
- package/dist/types/components/CdsInput/api/CdsInput.types.d.ts +36 -9
- package/dist/types/components/CdsLabel/api/CdsLabel.types.d.ts +4 -0
- package/dist/types/components/CdsLayout/api/CdsLayout.types.d.ts +16 -4
- package/dist/types/components/CdsLink/api/CdsLink.types.d.ts +8 -2
- package/dist/types/components/CdsList/CdsList.vue.d.ts +24 -6
- package/dist/types/components/CdsList/CdsListGroup.vue.d.ts +4 -1
- package/dist/types/components/CdsList/CdsListItem.vue.d.ts +28 -7
- package/dist/types/components/CdsList/CdsListItemAction.vue.d.ts +20 -5
- package/dist/types/components/CdsList/CdsListItemDivider.vue.d.ts +4 -0
- package/dist/types/components/CdsList/CdsListItemMedia.vue.d.ts +20 -5
- package/dist/types/components/CdsList/CdsListSubheader.vue.d.ts +4 -1
- package/dist/types/components/CdsList/api/CdsList.types.d.ts +84 -21
- package/dist/types/components/CdsList/components/ListChildren.vue.d.ts +16 -4
- package/dist/types/components/CdsList/components/ListGroupActivator.vue.d.ts +4 -1
- package/dist/types/components/CdsList/index.d.ts +76 -0
- package/dist/types/components/CdsMain/api/CdsMain.types.d.ts +4 -1
- package/dist/types/components/CdsMenu/api/CdsMenu.types.d.ts +12 -0
- package/dist/types/components/CdsMessages/api/CdsMessages.types.d.ts +8 -0
- package/dist/types/components/CdsModal/api/CdsModal.types.d.ts +12 -3
- package/dist/types/components/CdsNotification/api/CdsNotification.types.d.ts +36 -9
- package/dist/types/components/CdsNotificationAlert/api/CdsNotificationAlert.types.d.ts +40 -10
- package/dist/types/components/CdsOtpInput/CdsOtpInput.vue.d.ts +20 -5
- package/dist/types/components/CdsOtpInput/api/CdsOtpInput.types.d.ts +36 -9
- package/dist/types/components/CdsOverlay/CdsOverlay.vue.d.ts +44 -11
- package/dist/types/components/CdsOverlay/api/CdsOverlay.types.d.ts +28 -3
- package/dist/types/components/CdsPage/api/CdsPage.types.d.ts +4 -1
- package/dist/types/components/CdsPagination/CdsPagination.vue.d.ts +16 -0
- package/dist/types/components/CdsPagination/api/CdsPagination.types.d.ts +44 -11
- package/dist/types/components/CdsProgressBar/api/CdsProgressBar.types.d.ts +8 -0
- package/dist/types/components/CdsProgressCircle/api/CdsProgressCircle.types.d.ts +4 -1
- package/dist/types/components/CdsRadioGroup/api/CdsRadioGroup.types.d.ts +8 -2
- package/dist/types/components/CdsResponsive/api/CdsResponsive.types.d.ts +8 -2
- package/dist/types/components/CdsSelect/CdsSelect.vue.d.ts +51 -18
- package/dist/types/components/CdsSelect/api/CdsSelect.types.d.ts +60 -15
- package/dist/types/components/CdsSelect/index.d.ts +57 -30
- package/dist/types/components/CdsSelectionControl/CdsSelectionControl.vue.d.ts +8 -0
- package/dist/types/components/CdsSelectionControl/api/CdsSelectionControl.types.d.ts +12 -3
- package/dist/types/components/CdsSelectionControlGroup/api/CdsSelectionControlGroup.types.d.ts +8 -0
- package/dist/types/components/CdsSkeletonLoader/api/CdsSkeletonLoader.types.d.ts +4 -1
- package/dist/types/components/CdsSlideGroup/CdsSlideGroup.vue.d.ts +24 -6
- package/dist/types/components/CdsSlideGroup/api/CdsSlideGroup.types.d.ts +20 -5
- package/dist/types/components/CdsSlideView/CdsSlideView.vue.d.ts +4 -0
- package/dist/types/components/CdsSlideView/CdsSlideViewItem.vue.d.ts +4 -0
- package/dist/types/components/CdsSlideView/api/CdsSlideView.types.d.ts +31 -0
- package/dist/types/components/CdsStages/CdsStages.vue.d.ts +8 -0
- package/dist/types/components/CdsStatus/api/CdsStatus.types.d.ts +4 -1
- package/dist/types/components/CdsSteps/CdsSteps.vue.d.ts +8 -0
- package/dist/types/components/CdsSteps/api/CdsSteps.types.d.ts +72 -18
- package/dist/types/components/CdsSurface/api/CdsSurface.types.d.ts +4 -1
- package/dist/types/components/CdsTable/CdsTable.vue.d.ts +4 -0
- package/dist/types/components/CdsTable/api/CdsTable.types.d.ts +96 -24
- package/dist/types/components/CdsTabs/api/CdsTabs.types.d.ts +32 -0
- package/dist/types/components/CdsTag/api/CdsTag.types.d.ts +64 -16
- package/dist/types/components/CdsTagGroup/CdsTagGroup.vue.d.ts +20 -5
- package/dist/types/components/CdsTagGroup/api/CdsTagGroup.types.d.ts +8 -2
- package/dist/types/components/CdsTextArea/CdsTextArea.vue.d.ts +5 -2
- package/dist/types/components/CdsTextArea/api/CdsTextArea.types.d.ts +24 -6
- package/dist/types/components/CdsTextArea/index.d.ts +15 -6
- package/dist/types/components/CdsTextInput/CdsTextInput.vue.d.ts +7 -4
- package/dist/types/components/CdsTextInput/api/CdsTextInput.types.d.ts +44 -11
- package/dist/types/components/CdsTextInput/index.d.ts +20 -11
- package/dist/types/components/CdsTimePicker/CdsTimePicker.vue.d.ts +24 -0
- package/dist/types/components/CdsTimePicker/api/CdsTimePicker.types.d.ts +4 -1
- package/dist/types/components/CdsToast/api/CdsToast.types.d.ts +40 -10
- package/dist/types/components/CdsToastQueue/CdsToastQueue.vue.d.ts +4 -1
- package/dist/types/components/CdsToastQueue/api/CdsToastQueue.types.d.ts +20 -5
- package/dist/types/components/CdsToggle/api/CdsToggle.types.d.ts +28 -7
- package/dist/types/components/CdsToolbar/api/CdsToolbar.types.d.ts +8 -2
- package/dist/types/components/CdsTooltip/api/CdsTooltip.types.d.ts +4 -0
- package/dist/types/components/CdsTree/CdsTree.vue.d.ts +16 -0
- package/dist/types/components/CdsTree/api/CdsTree.types.d.ts +84 -21
- package/dist/types/components/CdsUploader/CdsUploader.vue.d.ts +8 -0
- package/dist/types/components/CdsUploader/api/CdsUploader.types.d.ts +68 -17
- package/dist/types/components/CdsVirtualScroll/CdsVirtualScroll.vue.d.ts +8 -0
- package/dist/types/components/CdsVirtualScroll/api/CdsVirtualScroll.types.d.ts +20 -5
- package/dist/types/composables/useForm/useForm.d.ts +33 -0
- package/dist/types/composables/useLayout/context.d.ts +61 -0
- package/dist/types/composables/useNested/useNested.d.ts +8 -2
- package/dist/types/composables/useTheme/internal/useTheme.constants.d.ts +1 -1
- package/dist/types/entry.d.ts +135 -126
- package/dist/types/locales/index.d.ts +1 -0
- package/dist/types/themes/index.d.ts +4 -0
- package/dist/types/themes/lumaDark.d.ts +190 -0
- package/dist/types/themes/lumaLight.d.ts +190 -0
- package/dist/types/utils/date/date.d.ts +1 -1
- package/llms/llms-components.txt +8861 -10675
- package/llms/llms-full.txt +11347 -11488
- package/llms/llms-guides.txt +1942 -483
- package/llms/llms-migration.txt +19 -47
- package/llms/llms-tokens.txt +285 -43
- package/llms/llms.txt +110 -109
- package/package.json +30 -10
- package/src/components/CdsApp/CdsApp.scss +43 -0
- package/src/components/CdsApp/styles/_CdsApp.variables.scss +2 -0
- package/src/components/CdsAutocomplete/CdsAutocomplete.scss +158 -0
- package/src/components/CdsAutocomplete/styles/_CdsAutocomplete.variables.scss +9 -0
- package/src/components/CdsAvatar/CdsAvatar.scss +42 -0
- package/src/components/CdsAvatar/styles/_CdsAvatar.variables.scss +22 -0
- package/src/components/CdsBadge/CdsBadge.scss +69 -0
- package/src/components/CdsBadge/styles/_CdsBadge.variables.scss +22 -0
- package/src/components/CdsBreadcrumbs/CdsBreadcrumbs.scss +49 -0
- package/src/components/CdsBreadcrumbs/styles/_CdsBreadcrumbs.variables.scss +14 -0
- package/src/components/CdsButton/CdsButton.scss +138 -0
- package/src/components/CdsButton/styles/_CdsButton.mixins.scss +76 -0
- package/src/components/CdsButton/styles/_CdsButton.variables.scss +180 -0
- package/src/components/CdsButtonGroup/CdsButtonGroup.scss +62 -0
- package/src/components/CdsButtonGroup/styles/_CdsButtonGroup.variables.scss +7 -0
- package/src/components/CdsButtonToggle/CdsButtonToggle.scss +19 -0
- package/src/components/CdsButtonToggle/styles/_CdsButtonToggle.variables.scss +3 -0
- package/src/components/CdsCard/CdsCard.scss +194 -0
- package/src/components/CdsCard/styles/CdsCard.variables.scss +36 -0
- package/src/components/CdsCarousel/CdsCarousel.scss +76 -0
- package/src/components/CdsCarousel/styles/_CdsCarousel.variables.scss +7 -0
- package/src/components/CdsCheckbox/CdsCheckbox.scss +20 -0
- package/src/components/CdsCheckbox/styles/_CdsCheckbox.mixins.scss +24 -0
- package/src/components/CdsCheckbox/styles/_CdsCheckbox.variables.scss +8 -0
- package/src/components/CdsCheckboxButton/CdsCheckboxButton.scss +78 -0
- package/src/components/CdsCheckboxButton/styles/_CdsCheckboxButton.variables.scss +46 -0
- package/src/components/CdsCombobox/CdsCombobox.scss +158 -0
- package/src/components/CdsCombobox/styles/_CdsCombobox.variables.scss +9 -0
- package/src/components/CdsCounter/CdsCounter.scss +11 -0
- package/src/components/CdsCounter/styles/_CdsCounter.variables.scss +1 -0
- package/src/components/CdsDateInput/CdsDateInput.scss +28 -0
- package/src/components/CdsDateInput/styles/_CdsDateInput.variables.scss +6 -0
- package/src/components/CdsDatePicker/CdsDatePicker.scss +574 -0
- package/src/components/CdsDatePicker/styles/_CdsDatePicker.variables.scss +56 -0
- package/src/components/CdsDescription/CdsDescription.scss +12 -0
- package/src/components/CdsDescription/styles/_CdsDescription.variables.scss +1 -0
- package/src/components/CdsDivider/CdsDivider.scss +83 -0
- package/src/components/CdsDivider/styles/_CdsDivider.variables.scss +28 -0
- package/src/components/CdsDrawer/CdsDrawer.scss +144 -0
- package/src/components/CdsDrawer/styles/_CdsDrawer.variables.scss +17 -0
- package/src/components/CdsEmptyState/CdsEmptyState.scss +103 -0
- package/src/components/CdsEmptyState/styles/_CdsEmptyState.variables.scss +15 -0
- package/src/components/CdsExpandablePanel/CdsExpandablePanel.scss +221 -0
- package/src/components/CdsExpandablePanel/styles/_CdsExpandablePanel.variables.scss +24 -0
- package/src/components/CdsField/CdsField.scss +209 -0
- package/src/components/CdsField/styles/_CdsField.mixins.scss +39 -0
- package/src/components/CdsField/styles/_CdsField.variables.scss +84 -0
- package/src/components/CdsFileInput/CdsFileInput.scss +40 -0
- package/src/components/CdsFileInput/styles/_CdsFileInput.variables.scss +5 -0
- package/src/components/CdsFileUpload/CdsFileUpload.scss +173 -0
- package/src/components/CdsFileUpload/styles/_CdsFileUpload.variables.scss +40 -0
- package/src/components/CdsFooter/CdsFooter.scss +36 -0
- package/src/components/CdsFooter/styles/_CdsFooter.variables.scss +4 -0
- package/src/components/CdsForm/CdsForm.scss +24 -0
- package/src/components/CdsForm/styles/_CdsForm.variables.scss +5 -0
- package/src/components/CdsFunctionalButton/CdsFunctionalButton.scss +49 -0
- package/src/components/CdsFunctionalButton/styles/_CdsFunctionalButton.variables.scss +25 -0
- package/src/components/CdsGrid/components/CSSGrid.scss +3 -0
- package/src/components/CdsGrid/components/FlexGrid.scss +3 -0
- package/src/components/CdsHeader/CdsHeader.scss +36 -0
- package/src/components/CdsHeader/styles/_CdsHeader.variables.scss +3 -0
- package/src/components/CdsHighlight/CdsHighlight.scss +16 -0
- package/src/components/CdsHighlight/styles/_CdsHighlight.variables.scss +8 -0
- package/src/components/CdsIcon/CdsIcon.scss +54 -0
- package/src/components/CdsIcon/styles/_CdsIcon.variables.scss +20 -0
- package/src/components/CdsImage/CdsImage.scss +62 -0
- package/src/components/CdsImage/styles/_CdsImage.variables.scss +4 -0
- package/src/components/CdsInput/CdsInput.scss +108 -0
- package/src/components/CdsInput/styles/_CdsInput.mixins.scss +54 -0
- package/src/components/CdsInput/styles/_CdsInput.variables.scss +98 -0
- package/src/components/CdsLabel/CdsLabel.scss +23 -0
- package/src/components/CdsLabel/styles/_CdsLabel.variables.scss +2 -0
- package/src/components/CdsLayout/CdsLayout.scss +61 -0
- package/src/components/CdsLayout/styles/_CdsLayout.variables.scss +2 -0
- package/src/components/CdsLink/CdsLink.scss +33 -0
- package/src/components/CdsLink/styles/_CdsLink.variables.scss +6 -0
- package/src/components/CdsList/CdsList.scss +104 -0
- package/src/components/CdsList/CdsListItem.scss +330 -0
- package/src/components/CdsList/styles/_CdsList.variables.scss +115 -0
- package/src/components/CdsLoader/CdsLoader.scss +78 -0
- package/src/components/CdsLoader/styles/_CdsLoader.mixins.scss +9 -0
- package/src/components/CdsLoader/styles/_CdsLoader.variables.scss +40 -0
- package/src/components/CdsMain/CdsMain.scss +7 -0
- package/src/components/CdsMenu/CdsMenu.scss +33 -0
- package/src/components/CdsMenu/styles/_CdsMenu.variables.scss +11 -0
- package/src/components/CdsMessages/CdsMessages.scss +20 -0
- package/src/components/CdsMessages/styles/_CdsMessages.variables.scss +5 -0
- package/src/components/CdsModal/CdsModal.scss +106 -0
- package/src/components/CdsModal/styles/_CdsModal.variables.scss +12 -0
- package/src/components/CdsNotification/CdsNotification.scss +99 -0
- package/src/components/CdsNotification/styles/_CdsNotification.variables.scss +13 -0
- package/src/components/CdsNotificationAlert/CdsNotificationAlert.scss +48 -0
- package/src/components/CdsNotificationAlert/styles/_CdsNotificationAlert.variables.scss +5 -0
- package/src/components/CdsOtpInput/CdsOtpInput.scss +192 -0
- package/src/components/CdsOtpInput/styles/_CdsOtpInput.variables.scss +31 -0
- package/src/components/CdsOverlay/CdsOverlay.scss +74 -0
- package/src/components/CdsOverlay/styles/_CdsOverlay.variables.scss +2 -0
- package/src/components/CdsPage/CdsPage.scss +9 -0
- package/src/components/CdsPagination/CdsPagination.scss +69 -0
- package/src/components/CdsPagination/styles/_CdsPagination.variables.scss +10 -0
- package/src/components/CdsProgressBar/CdsProgressBar.scss +285 -0
- package/src/components/CdsProgressBar/styles/_CdsProgressBar.variables.scss +23 -0
- package/src/components/CdsProgressCircle/CdsProgressCircle.scss +116 -0
- package/src/components/CdsProgressCircle/styles/_CdsProgressCircle.variables.scss +21 -0
- package/src/components/CdsRadio/CdsRadio.scss +42 -0
- package/src/components/CdsRadio/styles/_CdsRadio.variables.scss +26 -0
- package/src/components/CdsRadioGroup/CdsRadioGroup.scss +24 -0
- package/src/components/CdsRadioGroup/styles/_CdsRadioGroup.variables.scss +4 -0
- package/src/components/CdsResponsive/CdsResponsive.scss +33 -0
- package/src/components/CdsResponsive/styles/_CdsResponsive.variables.scss +3 -0
- package/src/components/CdsSelect/CdsSelect.scss +149 -0
- package/src/components/CdsSelect/styles/_CdsSelect.variables.scss +7 -0
- package/src/components/CdsSelectionControl/CdsSelectionControl.scss +104 -0
- package/src/components/CdsSelectionControlGroup/CdsSelectionControlGroup.scss +17 -0
- package/src/components/CdsSkeletonLoader/CdsSkeletonLoader.scss +292 -0
- package/src/components/CdsSkeletonLoader/styles/_CdsSkeletonLoader.variables.scss +52 -0
- package/src/components/CdsSlideGroup/CdsSlideGroup.scss +63 -0
- package/src/components/CdsSlideGroup/styles/_CdsSlideGroup.variables.scss +1 -0
- package/src/components/CdsSlideView/CdsSlideView.scss +183 -0
- package/src/components/CdsSlideView/styles/_CdsSlideView.variables.scss +4 -0
- package/src/components/CdsStages/CdsStages.scss +109 -0
- package/src/components/CdsStages/styles/_CdsStages.variables.scss +17 -0
- package/src/components/CdsStatus/CdsStatus.scss +49 -0
- package/src/components/CdsStatus/styles/_CdsStatus.variables.scss +7 -0
- package/src/components/CdsSteps/CdsSteps.scss +216 -0
- package/src/components/CdsSteps/styles/_CdsSteps.variables.scss +42 -0
- package/src/components/CdsSurface/CdsSurface.scss +16 -0
- package/src/components/CdsTable/CdsTable.scss +1140 -0
- package/src/components/CdsTable/styles/_CdsTable.mixins.scss +86 -0
- package/src/components/CdsTable/styles/_CdsTable.variables.scss +82 -0
- package/src/components/CdsTabs/CdsTabs.scss +94 -0
- package/src/components/CdsTabs/styles/_CdsTabs.variables.scss +30 -0
- package/src/components/CdsTag/CdsTag.scss +141 -0
- package/src/components/CdsTag/styles/_CdsTag.variables.scss +57 -0
- package/src/components/CdsTagGroup/CdsTagGroup.scss +32 -0
- package/src/components/CdsTagGroup/styles/_CdsTagGroup.variables.scss +8 -0
- package/src/components/CdsTextArea/CdsTextArea.scss +129 -0
- package/src/components/CdsTextArea/styles/_CdsTextArea.variables.scss +6 -0
- package/src/components/CdsTextInput/CdsTextInput.scss +84 -0
- package/src/components/CdsTextInput/styles/_CdsTextInput.variables.scss +7 -0
- package/src/components/CdsTimePicker/CdsTimePicker.scss +93 -0
- package/src/components/CdsTimePicker/styles/_CdsTimePicker.variables.scss +13 -0
- package/src/components/CdsToast/CdsToast.scss +207 -0
- package/src/components/CdsToast/styles/_CdsToast.variables.scss +16 -0
- package/src/components/CdsToggle/CdsToggle.scss +192 -0
- package/src/components/CdsToggle/styles/_CdsToggle.variables.scss +81 -0
- package/src/components/CdsToolbar/CdsToolbar.scss +72 -0
- package/src/components/CdsToolbar/styles/_CdsToolbar.variables.scss +3 -0
- package/src/components/CdsTooltip/CdsTooltip.scss +111 -0
- package/src/components/CdsTooltip/styles/_CdsTooltip.variables.scss +15 -0
- package/src/components/CdsTree/CdsTree.scss +290 -0
- package/src/components/CdsTree/styles/_CdsTree.variables.scss +29 -0
- package/src/components/CdsUploader/CdsUploader.scss +109 -0
- package/src/components/CdsUploader/styles/_CdsUploader.variables.scss +16 -0
- package/src/components/CdsVirtualScroll/CdsVirtualScroll.scss +16 -0
- package/src/components/CdsVirtualScroll/styles/_CdsVirtualScroll.variables.scss +3 -0
- package/src/styles/component-settings.scss +75 -0
- package/src/styles/generic/_fonts.scss +2 -2
- package/src/styles/settings/_index.scss +6 -0
- package/src/styles/tools/_absolute.sass +9 -0
- package/src/styles/tools/_border.sass +10 -0
- package/src/styles/tools/_motion.scss +11 -17
- package/src/styles/utilities/grid/_config.scss +0 -1
- package/src/themes/css/lumaDark.css +184 -0
- package/src/themes/css/lumaLight.css +184 -0
- package/src/themes/index.ts +4 -0
- package/src/themes/lumaDark.ts +21 -0
- package/src/themes/lumaLight.ts +17 -0
- package/dist/styles/breakpoints.css +0 -1
- package/dist/styles/index.css +0 -1
package/llms/llms-guides.txt
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
# Central Design System (CDS 4) —
|
|
1
|
+
# Central Design System (CDS 4) — guides
|
|
2
2
|
|
|
3
|
-
>
|
|
4
|
-
>
|
|
5
|
-
>
|
|
3
|
+
> Version: 4.0.0-alpha.5
|
|
4
|
+
> Setup, conventions, forms, theming, Tailwind CSS, tree-shaking, and responsiveness.
|
|
5
|
+
> Generated automatically (`bun run generate:meta` → `bun run generate:llms`). Do not edit manually.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
#
|
|
9
|
+
# Setup and themes
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## Installation
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
|
|
15
|
-
# или npm i / yarn add / pnpm add
|
|
14
|
+
npm install @central-design-system/components
|
|
16
15
|
```
|
|
17
16
|
|
|
18
|
-
##
|
|
17
|
+
## Wiring it into the app
|
|
19
18
|
|
|
20
19
|
```ts
|
|
21
20
|
import { createApp } from 'vue';
|
|
@@ -27,31 +26,32 @@ const cds = createCds({ components, directives });
|
|
|
27
26
|
createApp(App).use(cds).mount('#app');
|
|
28
27
|
```
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
After that every component is available globally: `<CdsButton appearance="primary">Click me</CdsButton>`.
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
This is the full registration — it pulls in the entire library. For production
|
|
32
|
+
apps register components individually, see the Tree-shaking guide.
|
|
34
33
|
|
|
35
|
-
##
|
|
34
|
+
## Style entry points
|
|
36
35
|
|
|
37
|
-
|
|
|
36
|
+
| Import | What it provides |
|
|
38
37
|
| --- | --- |
|
|
39
|
-
| `@central-design-system/components/styles` |
|
|
40
|
-
| `@central-design-system/components/styles/common.css` |
|
|
41
|
-
| `@central-design-system/components/styles/core` |
|
|
42
|
-
| `@central-design-system/components/styles/utilities` |
|
|
43
|
-
| `@central-design-system/components/styles/tailwind` |
|
|
44
|
-
| `@central-design-system/components/styles/legacy` | Legacy
|
|
38
|
+
| `@central-design-system/components/styles` | Aggregate: CSS of every component (~556 KB). Quick start, tree-shaking disabled |
|
|
39
|
+
| `@central-design-system/components/styles/common.css` | Base layer (~9 KB): layers, reset, fonts, typography, grid |
|
|
40
|
+
| `@central-design-system/components/styles/core` | Only layers, fonts and reset — no typography |
|
|
41
|
+
| `@central-design-system/components/styles/utilities` | Utility classes |
|
|
42
|
+
| `@central-design-system/components/styles/tailwind` | Tailwind CSS integration layer |
|
|
43
|
+
| `@central-design-system/components/styles/legacy` | Legacy utilities for migrating from CDS 3 |
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
With per-component registration you only include the base layer
|
|
46
|
+
`styles/common.css` — each component ships its own CSS alongside the
|
|
47
|
+
component itself.
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
Tailwind CSS v4 integration (installation, layers, utilities built on CDS
|
|
50
|
+
tokens) is covered in the Tailwind CSS + CDS guide.
|
|
51
51
|
|
|
52
|
-
##
|
|
52
|
+
## Themes
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
The theme is set at initialization via `createCds`:
|
|
55
55
|
|
|
56
56
|
```ts
|
|
57
57
|
const cds = createCds({
|
|
@@ -61,17 +61,17 @@ const cds = createCds({
|
|
|
61
61
|
});
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
`promoLight`, `promoDark`.
|
|
66
|
-
|
|
64
|
+
Built-in themes: `cdsLight` (default), `cdsDark`, `b2bLight`, `b2bDark`,
|
|
65
|
+
`promoLight`, `promoDark`. The values of every color token in each theme
|
|
66
|
+
are listed in ../tokens/themes.md.
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
Custom themes, runtime theme switching and disabling theming are covered in
|
|
69
|
+
the Theming guide.
|
|
70
70
|
|
|
71
|
-
##
|
|
71
|
+
## Icons
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
(`carbon`, `lucide`, `phosphor`, `remix`):
|
|
73
|
+
The built-in `cds` iconpack is active by default. Other packs are available
|
|
74
|
+
too (`carbon`, `lucide`, `phosphor`, `remix`):
|
|
75
75
|
|
|
76
76
|
```ts
|
|
77
77
|
import { createCds, iconsets } from '@central-design-system/components';
|
|
@@ -85,95 +85,96 @@ createCds({
|
|
|
85
85
|
});
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
|
|
89
|
-
|
|
88
|
+
The `@central-design-system/icons` package (CDS 3) is deprecated, see the
|
|
89
|
+
migration guide.
|
|
90
90
|
|
|
91
91
|
---
|
|
92
92
|
|
|
93
|
-
#
|
|
93
|
+
# CDS 4 conventions
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
(`references/components
|
|
97
|
-
|
|
95
|
+
The golden rule: **the source of truth is the component's `api.md`**
|
|
96
|
+
(`references/components/<name>/api.md`). Do not invent props, events or
|
|
97
|
+
slots — if they are not in api.md, they do not exist on the component.
|
|
98
98
|
|
|
99
|
-
##
|
|
99
|
+
## Shared props
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
The props below come from shared composable factories and behave identically
|
|
102
|
+
in every component that has them:
|
|
103
103
|
|
|
104
|
-
|
|
|
104
|
+
| Prop | Semantics |
|
|
105
105
|
| --- | --- |
|
|
106
|
-
| `size` |
|
|
107
|
-
| `appearance` |
|
|
108
|
-
| `color` / `bgColor` |
|
|
109
|
-
| `disabled` |
|
|
110
|
-
| `loading` |
|
|
111
|
-
| `width` / `height` |
|
|
106
|
+
| `size` | Size: `xs` / `sm` / `md` / `lg` / `xl` or a number |
|
|
107
|
+
| `appearance` | Appearance (visual variant); the set of values is component-specific — check the type in api.md |
|
|
108
|
+
| `color` / `bgColor` | Content / background color as a **theme token**, not a CSS value |
|
|
109
|
+
| `disabled` | Disabled state |
|
|
110
|
+
| `loading` | Loading state |
|
|
111
|
+
| `width` / `height` | Dimensions (number → px, or a CSS value as a string) |
|
|
112
112
|
|
|
113
|
-
##
|
|
113
|
+
## Tokens, not raw values
|
|
114
114
|
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
-
|
|
118
|
-
`--cds-*`
|
|
115
|
+
- Set colors via the `color` prop / theme tokens (`--cds-color-*`), never
|
|
116
|
+
arbitrary CSS (`#fff`, `red`). Theme tokens are listed in ../tokens/themes.md.
|
|
117
|
+
- Spacing, radii and other values in custom SCSS go through the global
|
|
118
|
+
`--cds-*` variables, never hardcoded.
|
|
119
119
|
|
|
120
120
|
## Atomic Design
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
`CdsTextInput`
|
|
124
|
-
`CdsMessages` + `CdsInput`,
|
|
125
|
-
|
|
122
|
+
Complex UI is composed from atoms. Example — a form: the ready-made
|
|
123
|
+
`CdsTextInput` "molecule" is internally built as `CdsField` + `CdsLabel` +
|
|
124
|
+
`CdsDescription` + `CdsMessages` + `CdsInput`, and the same atoms are
|
|
125
|
+
available for building your own fields. See the Forms guide
|
|
126
|
+
for details.
|
|
126
127
|
|
|
127
|
-
##
|
|
128
|
+
## Defaults
|
|
128
129
|
|
|
129
|
-
|
|
130
|
+
Prop defaults can be set centrally:
|
|
130
131
|
|
|
131
|
-
-
|
|
132
|
-
-
|
|
132
|
+
- globally — via the `defaults` option in `createCds({ defaults: { CdsButton: { size: 'lg' } } })`;
|
|
133
|
+
- for a subtree — with the `CdsDefaultsProvider` component
|
|
133
134
|
(api).
|
|
134
135
|
|
|
135
|
-
##
|
|
136
|
+
## Deprecated APIs
|
|
136
137
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
Props/components marked `_(deprecated)_` in api.md still work but will be
|
|
139
|
+
removed. In the dev console they emit a warning prefixed `[CDS UPGRADE]`.
|
|
140
|
+
When migrating legacy code, see the migration guide.
|
|
140
141
|
|
|
141
142
|
---
|
|
142
143
|
|
|
143
|
-
#
|
|
144
|
+
# Forms with CDS 4
|
|
144
145
|
|
|
145
|
-
##
|
|
146
|
+
## Ready-made controls
|
|
146
147
|
|
|
147
|
-
|
|
148
|
-
`examples.md`
|
|
148
|
+
For typical forms use the ready-made "molecules" (each has its own `api.md`
|
|
149
|
+
and `examples.md` in `references/components/`):
|
|
149
150
|
|
|
150
|
-
|
|
|
151
|
+
| Control | Purpose |
|
|
151
152
|
| --- | --- |
|
|
152
|
-
| CdsTextInput |
|
|
153
|
-
| CdsSelect |
|
|
154
|
-
| CdsAutocomplete |
|
|
155
|
-
| CdsCombobox |
|
|
156
|
-
| CdsCheckbox |
|
|
157
|
-
| CdsRadioGroup |
|
|
158
|
-
| CdsToggle |
|
|
159
|
-
| CdsDatePicker / CdsTimePicker |
|
|
153
|
+
| CdsTextInput | Text field with label / description / messages |
|
|
154
|
+
| CdsSelect | Dropdown (single / multiple) |
|
|
155
|
+
| CdsAutocomplete | Selection with search over the list |
|
|
156
|
+
| CdsCombobox | Selection that also accepts free-form input |
|
|
157
|
+
| CdsCheckbox | Checkbox |
|
|
158
|
+
| CdsRadioGroup | Radio button group |
|
|
159
|
+
| CdsToggle | Toggle |
|
|
160
|
+
| CdsDatePicker / CdsTimePicker | Date / time |
|
|
160
161
|
|
|
161
|
-
## CdsForm:
|
|
162
|
+
## CdsForm: aggregation and validation
|
|
162
163
|
|
|
163
|
-
`CdsForm`
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
(
|
|
164
|
+
`CdsForm` groups fields, aggregates their validation (`v-model` — form
|
|
165
|
+
validity) and exposes `validate` / `reset` / `resetValidation` methods via
|
|
166
|
+
slot props and the exposed API. Validation rules are set on the fields with
|
|
167
|
+
the `rules` prop (an array of functions `value → true | 'error text'`).
|
|
167
168
|
|
|
168
|
-
|
|
169
|
+
A verified example (from Storybook):
|
|
169
170
|
|
|
170
171
|
```html
|
|
171
172
|
<CdsForm v-model="valid" @submit.prevent>
|
|
172
173
|
<template #default="{ reset }">
|
|
173
|
-
<CdsTextInput v-model="name" :rules="rules.name" label="
|
|
174
|
-
<CdsTextInput v-model="email" :rules="rules.email" label="Email" placeholder="
|
|
175
|
-
<CdsButton appearance="secondary" @click="reset"
|
|
176
|
-
<CdsButton type="submit"
|
|
174
|
+
<CdsTextInput v-model="name" :rules="rules.name" label="Name" placeholder="Enter name" />
|
|
175
|
+
<CdsTextInput v-model="email" :rules="rules.email" label="Email" placeholder="Enter Email" />
|
|
176
|
+
<CdsButton appearance="secondary" @click="reset">Clear</CdsButton>
|
|
177
|
+
<CdsButton type="submit">Submit</CdsButton>
|
|
177
178
|
</template>
|
|
178
179
|
</CdsForm>
|
|
179
180
|
```
|
|
@@ -185,111 +186,116 @@ const email = ref('');
|
|
|
185
186
|
|
|
186
187
|
const rules = {
|
|
187
188
|
name: [
|
|
188
|
-
(value: string) => !!value || '
|
|
189
|
-
(value: string) => value.length <= 10 || '
|
|
189
|
+
(value: string) => !!value || 'Must not be empty',
|
|
190
|
+
(value: string) => value.length <= 10 || 'No more than 10 characters'
|
|
190
191
|
],
|
|
191
192
|
email: [
|
|
192
|
-
(value: string) => !!value || '
|
|
193
|
-
(value: string) => /.+@.+\..+/.test(value) || '
|
|
193
|
+
(value: string) => !!value || 'Must not be empty',
|
|
194
|
+
(value: string) => /.+@.+\..+/.test(value) || 'Invalid format'
|
|
194
195
|
]
|
|
195
196
|
};
|
|
196
197
|
```
|
|
197
198
|
|
|
198
|
-
|
|
199
|
+
Useful modes (full list in api.md):
|
|
199
200
|
|
|
200
|
-
- `first-fail` —
|
|
201
|
-
- `disabled` / `readonly`
|
|
201
|
+
- `first-fail` — validation stops at the first invalid field;
|
|
202
|
+
- `disabled` / `readonly` on the form propagate to every nested field.
|
|
202
203
|
|
|
203
|
-
CdsForm
|
|
204
|
+
CdsForm also works with external validators (vuelidate, vee-validate) — see
|
|
204
205
|
examples.md.
|
|
205
206
|
|
|
206
|
-
##
|
|
207
|
+
## Building your own field from atoms
|
|
207
208
|
|
|
208
|
-
|
|
209
|
+
When no ready-made molecule fits, assemble the field from atoms:
|
|
209
210
|
|
|
210
|
-
|
|
|
211
|
+
| Atom | Role |
|
|
211
212
|
| --- | --- |
|
|
212
|
-
| CdsField |
|
|
213
|
-
| CdsLabel |
|
|
214
|
-
| CdsDescription |
|
|
215
|
-
| CdsMessages |
|
|
216
|
-
| CdsInput |
|
|
213
|
+
| CdsField | Field wrapper: wires up label/control/messages, states |
|
|
214
|
+
| CdsLabel | Field label |
|
|
215
|
+
| CdsDescription | Supporting description |
|
|
216
|
+
| CdsMessages | Error messages / hints |
|
|
217
|
+
| CdsInput | Bare input control |
|
|
217
218
|
|
|
218
|
-
|
|
219
|
-
|
|
219
|
+
Before assembling, open the `api.md` of every atom — take the set of props
|
|
220
|
+
and slots only from there.
|
|
220
221
|
|
|
221
222
|
---
|
|
222
223
|
|
|
223
|
-
#
|
|
224
|
+
# CDS 3 → CDS 4 migration (digest)
|
|
224
225
|
|
|
225
|
-
|
|
226
|
-
`MIGRATION.md`
|
|
226
|
+
This is a short digest. **The full version with Before/After for every
|
|
227
|
+
change is `MIGRATION.md` at the root of the
|
|
228
|
+
`@central-design-system/components` npm package.**
|
|
227
229
|
|
|
228
|
-
##
|
|
230
|
+
## Severity legend
|
|
229
231
|
|
|
230
|
-
|
|
|
232
|
+
| Marker | Meaning |
|
|
231
233
|
| --- | --- |
|
|
232
|
-
| ⚠️ **BREAKING** |
|
|
233
|
-
| 🔁 **RENAMED** |
|
|
234
|
-
| 🟠 **DEPRECATED** |
|
|
235
|
-
| ✨ **NEW** |
|
|
234
|
+
| ⚠️ **BREAKING** | Breaks existing code — action required |
|
|
235
|
+
| 🔁 **RENAMED** | Rename — mechanical search & replace |
|
|
236
|
+
| 🟠 **DEPRECATED** | Works in 4.x, will be removed in 5.x |
|
|
237
|
+
| ✨ **NEW** | New capability, nothing breaks |
|
|
236
238
|
|
|
237
|
-
##
|
|
239
|
+
## Quick checklist
|
|
238
240
|
|
|
239
|
-
- [ ]
|
|
241
|
+
- [ ] Replace the CSS import: `@central-design-system/components/dist/cds.css` →
|
|
240
242
|
`@central-design-system/components/styles` (⚠️ breaking).
|
|
241
|
-
- [ ]
|
|
242
|
-
|
|
243
|
-
- [ ]
|
|
244
|
-
- [ ]
|
|
245
|
-
|
|
243
|
+
- [ ] If you use `@central-design-system/icons` — the package is 🟠 deprecated;
|
|
244
|
+
switch to iconpacks via `createCds({ icons })` (see setup.md).
|
|
245
|
+
- [ ] Go through the component rename index below.
|
|
246
|
+
- [ ] Run the build and check the dev console: `[CDS UPGRADE]` warnings
|
|
247
|
+
point at deprecated props.
|
|
246
248
|
|
|
247
|
-
##
|
|
249
|
+
## Key breaking changes
|
|
248
250
|
|
|
249
|
-
- ⚠️
|
|
250
|
-
|
|
251
|
-
- ⚠️ **Legacy reset
|
|
251
|
+
- ⚠️ **CSS import path** — `dist/cds.css` is no longer a public entry point;
|
|
252
|
+
import `@central-design-system/components/styles` instead.
|
|
253
|
+
- ⚠️ **Legacy reset is off by default** — the global reset from CDS 3 is now
|
|
252
254
|
opt-in: `@use '@central-design-system/components/styles' with ($legacy-reset: true);`.
|
|
253
|
-
- ⚠️ **CSS
|
|
254
|
-
`@layer`;
|
|
255
|
-
|
|
255
|
+
- ⚠️ **CSS architecture on ITCSS + CSS Layers** — the cascade is driven by
|
|
256
|
+
native `@layer`; global overrides of CDS styles without `!important` may
|
|
257
|
+
now resolve differently.
|
|
256
258
|
|
|
257
|
-
##
|
|
259
|
+
## Component rename and removal index
|
|
258
260
|
|
|
259
261
|
| CDS 3 | CDS 4 |
|
|
260
262
|
| --- | --- |
|
|
261
|
-
| `CdsDropdown` | 🔁 `CdsSelect` (
|
|
263
|
+
| `CdsDropdown` | 🔁 `CdsSelect` (the native `<select>` from CDS 3 — via the `native-select` prop) |
|
|
262
264
|
| `CdsRadioButton` | 🔁 `CdsRadioGroup` |
|
|
263
265
|
| `CdsProgress` | 🔁 `CdsProgressBar` |
|
|
264
266
|
| `CdsTabsV2` | 🔁 `CdsTabs` |
|
|
265
|
-
| `CdsCheckboxGroup` | ⚠️
|
|
266
|
-
| `CdsContainer` | ⚠️
|
|
267
|
-
| `CdsBadge` | 🔁
|
|
267
|
+
| `CdsCheckboxGroup` | ⚠️ removed (use `CdsCheckbox` on its own) |
|
|
268
|
+
| `CdsContainer` | ⚠️ removed |
|
|
269
|
+
| `CdsBadge` | 🔁 props: `count`→`content`, `limited`→`:max`; ⚠️ `invertColor` removed |
|
|
268
270
|
|
|
269
|
-
|
|
270
|
-
`../components/` —
|
|
271
|
+
After renaming, double-check the `api.md` of the new component in
|
|
272
|
+
`../components/` — prop contracts may have changed.
|
|
271
273
|
|
|
272
274
|
---
|
|
273
275
|
|
|
276
|
+
---
|
|
277
|
+
sourceHash: abc11a2cdeb9c401a04b865e6fd89a2c3f36d3a5
|
|
278
|
+
---
|
|
279
|
+
|
|
274
280
|
# Tailwind CSS v4 + CDS 4
|
|
275
281
|
|
|
276
|
-
|
|
277
|
-
[Installing Tailwind CSS with Vite](https://tailwindcss.com/docs/installation/using-vite).
|
|
282
|
+
For Vite projects, install Tailwind CSS v4 by following the official Tailwind
|
|
283
|
+
guide: [Installing Tailwind CSS with Vite](https://tailwindcss.com/docs/installation/using-vite).
|
|
278
284
|
|
|
279
|
-
|
|
285
|
+
Below is the recommended way to integrate CDS 4 with Tailwind CSS v4.
|
|
280
286
|
|
|
281
|
-
- Vite
|
|
282
|
-
- CSS
|
|
287
|
+
- The Vite plugin goes into `vite.config.ts`
|
|
288
|
+
- Tailwind's CSS layer goes into `main.ts`
|
|
283
289
|
|
|
284
|
-
## 1.
|
|
290
|
+
## 1. Install Tailwind CSS
|
|
285
291
|
|
|
286
292
|
```bash
|
|
287
293
|
npm install -D tailwindcss @tailwindcss/vite
|
|
288
294
|
```
|
|
289
295
|
|
|
290
|
-
## 2.
|
|
296
|
+
## 2. Add the Vite plugin
|
|
291
297
|
|
|
292
|
-
|
|
298
|
+
Add `@tailwindcss/vite` to `vite.config.ts`:
|
|
293
299
|
|
|
294
300
|
```ts
|
|
295
301
|
import { defineConfig } from 'vite';
|
|
@@ -300,9 +306,9 @@ export default defineConfig({
|
|
|
300
306
|
});
|
|
301
307
|
```
|
|
302
308
|
|
|
303
|
-
## 3.
|
|
309
|
+
## 3. Create a `tailwind.css` file
|
|
304
310
|
|
|
305
|
-
|
|
311
|
+
For example, `src/tailwind.css`:
|
|
306
312
|
|
|
307
313
|
```css
|
|
308
314
|
@import "@central-design-system/components/styles/tailwind";
|
|
@@ -310,9 +316,10 @@ export default defineConfig({
|
|
|
310
316
|
@import "tailwindcss/utilities" layer(cds-utilities.tailwind);
|
|
311
317
|
```
|
|
312
318
|
|
|
313
|
-
|
|
319
|
+
This wires CDS tokens into Tailwind. You don't need `preflight` separately —
|
|
320
|
+
the base reset styles already come from `@central-design-system/components/styles`.
|
|
314
321
|
|
|
315
|
-
## 4.
|
|
322
|
+
## 4. Import the styles in your app entry point
|
|
316
323
|
|
|
317
324
|
```ts
|
|
318
325
|
import { createApp } from 'vue';
|
|
@@ -332,45 +339,57 @@ const cds = createCds({
|
|
|
332
339
|
createApp(App).use(cds).mount('#app');
|
|
333
340
|
```
|
|
334
341
|
|
|
335
|
-
## 5.
|
|
342
|
+
## 5. Use Tailwind utilities and CDS tokens together
|
|
336
343
|
|
|
337
344
|
```html
|
|
338
345
|
<template>
|
|
339
|
-
<div class="flex flex-col gap-
|
|
346
|
+
<div class="flex flex-col gap-3 rounded-200 bg-surface-primary p-4 text-content-primary">
|
|
340
347
|
<h1 class="text-900 font-bold text-brand-primary">Hello CDS + Tailwind</h1>
|
|
341
|
-
<CdsButton
|
|
348
|
+
<CdsButton>Click me</CdsButton>
|
|
342
349
|
</div>
|
|
343
350
|
</template>
|
|
344
351
|
```
|
|
345
352
|
|
|
346
|
-
|
|
353
|
+
Once this is set up, you get both at the same time:
|
|
354
|
+
|
|
355
|
+
- standard Tailwind utilities: `flex`, `font-bold`, `gap-3`, `p-4`
|
|
356
|
+
- utility classes built from CDS tokens: `bg-surface-primary`, `text-content-primary`, `rounded-200`
|
|
347
357
|
|
|
348
|
-
|
|
349
|
-
-
|
|
358
|
+
Write spacing with the standard Tailwind numeric scale (`gap-2`, `p-4`,
|
|
359
|
+
`mt-2`): the CDS spacing scale matches it, so there is no need for
|
|
360
|
+
`gap-200`/`p-400`-style spacing classes. Token-based classes remain for
|
|
361
|
+
color, radius, and typography.
|
|
350
362
|
|
|
351
|
-
CDS
|
|
352
|
-
|
|
363
|
+
The CDS configuration stays in sync with the active CDS theme automatically, so
|
|
364
|
+
color utility classes switch along with the theme.
|
|
353
365
|
|
|
354
366
|
---
|
|
355
367
|
|
|
356
|
-
|
|
368
|
+
---
|
|
369
|
+
sourceHash: 41872192eda1479740145bb7f4bcb9dbb28f0462
|
|
370
|
+
---
|
|
357
371
|
|
|
358
|
-
|
|
372
|
+
# Theming
|
|
359
373
|
|
|
360
|
-
|
|
374
|
+
The design system lets you switch themes or configure your own theme
|
|
375
|
+
programmatically, including at runtime.
|
|
361
376
|
|
|
362
|
-
|
|
377
|
+
## How it works
|
|
378
|
+
|
|
379
|
+
A theme in CDS 4 is a set of **semantic tokens** that are turned into CSS
|
|
380
|
+
variables when the application starts:
|
|
363
381
|
|
|
364
382
|
```
|
|
365
|
-
ThemeDefinition (TS) → --cds-color-* / --cds-* (CSS
|
|
383
|
+
ThemeDefinition (TS) → --cds-color-* / --cds-* (CSS variables) → component styles
|
|
366
384
|
↓
|
|
367
|
-
@theme (Tailwind CSS v4) → bg-surface-primary,
|
|
385
|
+
@theme (Tailwind CSS v4) → bg-surface-primary, rounded-200, …
|
|
368
386
|
```
|
|
369
387
|
|
|
370
|
-
|
|
388
|
+
Colors are written into the variables as **RGB channels** rather than finished
|
|
389
|
+
colors — that's what makes opacity control possible:
|
|
371
390
|
|
|
372
391
|
```css
|
|
373
|
-
/*
|
|
392
|
+
/* generated by CDS */
|
|
374
393
|
:root {
|
|
375
394
|
--cds-color-brand-primary: 0,90,178;
|
|
376
395
|
--cds-color-surface-primary: 255,255,255;
|
|
@@ -378,7 +397,7 @@ ThemeDefinition (TS) → --cds-color-* / --cds-* (CSS-переменные)
|
|
|
378
397
|
--cds-border-radius-200: 0.25rem;
|
|
379
398
|
}
|
|
380
399
|
|
|
381
|
-
/*
|
|
400
|
+
/* usage */
|
|
382
401
|
.my-block {
|
|
383
402
|
background: rgb(var(--cds-color-surface-primary));
|
|
384
403
|
border: var(--cds-border-100) solid rgb(var(--cds-color-brand-primary) / 0.4);
|
|
@@ -386,24 +405,27 @@ ThemeDefinition (TS) → --cds-color-* / --cds-* (CSS-переменные)
|
|
|
386
405
|
}
|
|
387
406
|
```
|
|
388
407
|
|
|
389
|
-
|
|
408
|
+
Theme styles are injected into `<style id="cds-theme-stylesheet">` and are
|
|
409
|
+
recalculated reactively when the theme changes.
|
|
390
410
|
|
|
391
|
-
##
|
|
411
|
+
## Enabling a theme
|
|
392
412
|
|
|
393
|
-
CDS 4
|
|
413
|
+
CDS 4 ships eight ready-made themes:
|
|
394
414
|
|
|
395
|
-
|
|
|
396
|
-
| -------------
|
|
397
|
-
| `cdsLight` |
|
|
398
|
-
| `cdsDark` |
|
|
399
|
-
| `b2bLight` |
|
|
400
|
-
| `b2bDark` |
|
|
401
|
-
| `
|
|
402
|
-
| `
|
|
415
|
+
| Theme | Description |
|
|
416
|
+
| ------------- |-----------------------------------------|
|
|
417
|
+
| `cdsLight` | light theme, used by default |
|
|
418
|
+
| `cdsDark` | dark theme |
|
|
419
|
+
| `b2bLight` | light theme for B2B-Center applications |
|
|
420
|
+
| `b2bDark` | dark theme for B2B-Center applications |
|
|
421
|
+
| `lumaLight` | light Luma theme |
|
|
422
|
+
| `lumaDark` | dark Luma theme |
|
|
423
|
+
| `promoLight` | light promo theme |
|
|
424
|
+
| `promoDark` | dark promo theme |
|
|
403
425
|
|
|
404
|
-
>
|
|
426
|
+
> `cdsLight` is used by default — you don't need to enable it.
|
|
405
427
|
|
|
406
|
-
|
|
428
|
+
To switch to another theme, pass its name in the `createCds` options:
|
|
407
429
|
|
|
408
430
|
```ts
|
|
409
431
|
import { createApp } from 'vue';
|
|
@@ -423,7 +445,7 @@ const cds = createCds({
|
|
|
423
445
|
createApp(App).use(cds);
|
|
424
446
|
```
|
|
425
447
|
|
|
426
|
-
##
|
|
448
|
+
## Theming options
|
|
427
449
|
|
|
428
450
|
```ts
|
|
429
451
|
createCds({
|
|
@@ -442,22 +464,24 @@ createCds({
|
|
|
442
464
|
});
|
|
443
465
|
```
|
|
444
466
|
|
|
445
|
-
|
|
|
467
|
+
| Option | Type | Default | Purpose |
|
|
446
468
|
| --------------- | ---------------------------------------------------------- | ----------------------- | -------------------------------------------------------------------------- |
|
|
447
|
-
| `defaultTheme` | `ThemeName \| string` | `'cdsLight'` |
|
|
448
|
-
| `prefix` | `string` | `'cds'` |
|
|
449
|
-
| `themes` | `Record<string, ThemeDefinition>` |
|
|
450
|
-
| `variations` | `false \| { colors: string[]; lighten: number; darken: number }` | `false` |
|
|
451
|
-
| `utilities` | `boolean` | `true` |
|
|
452
|
-
| `legacyClasses` | `boolean` | `false` |
|
|
453
|
-
| `scoped` | `boolean` | `false` |
|
|
454
|
-
| `scope` | `string` | — |
|
|
455
|
-
| `stylesheetId` | `string` | `'cds-theme-stylesheet'`| `id`
|
|
456
|
-
| `cspNonce` | `string` | — | `nonce`
|
|
457
|
-
|
|
458
|
-
##
|
|
459
|
-
|
|
460
|
-
|
|
469
|
+
| `defaultTheme` | `ThemeName \| string` | `'cdsLight'` | Theme active at startup |
|
|
470
|
+
| `prefix` | `string` | `'cds'` | Prefix of the generated CSS variables (`--cds-color-*`) |
|
|
471
|
+
| `themes` | `Record<string, ThemeDefinition>` | built-in themes | Your own themes; merged with the built-in ones |
|
|
472
|
+
| `variations` | `false \| { colors: string[]; lighten: number; darken: number }` | `false` | Auto-generation of lighter/darker color variations |
|
|
473
|
+
| `utilities` | `boolean` | `true` | Generation of background/text utility classes from theme tokens |
|
|
474
|
+
| `legacyClasses` | `boolean` | `false` | CDS 3 legacy classes (`cds-bg-*`, `cds-text-*`, `cds-border-*`) |
|
|
475
|
+
| `scoped` | `boolean` | `false` | Don't write the variables into `:root` |
|
|
476
|
+
| `scope` | `string` | — | Limit theme selectors to a subtree (`:where(<scope>)`) |
|
|
477
|
+
| `stylesheetId` | `string` | `'cds-theme-stylesheet'`| `id` of the `<style>` tag holding the theme |
|
|
478
|
+
| `cspNonce` | `string` | — | `nonce` for Content Security Policy |
|
|
479
|
+
|
|
480
|
+
## Creating your own theme
|
|
481
|
+
|
|
482
|
+
A custom theme is a `ThemeDefinition` object with the fields `dark`, `colors` and
|
|
483
|
+
`variables`. You only need to specify the **overrides**: missing tokens are
|
|
484
|
+
inherited from `cdsLight` / `cdsDark`.
|
|
461
485
|
|
|
462
486
|
```ts
|
|
463
487
|
import { createApp } from 'vue';
|
|
@@ -470,7 +494,7 @@ import App from './App.vue';
|
|
|
470
494
|
const myCustomGreenTheme: ThemeDefinition = {
|
|
471
495
|
dark: false,
|
|
472
496
|
colors: {
|
|
473
|
-
//
|
|
497
|
+
// Main brand colors of the new theme
|
|
474
498
|
'brand-primary': '#2C8926',
|
|
475
499
|
'brand-primary-hover': '#3C9C2C',
|
|
476
500
|
'brand-primary-active': '#50A946',
|
|
@@ -480,11 +504,11 @@ const myCustomGreenTheme: ThemeDefinition = {
|
|
|
480
504
|
'brand-secondary-hover': '#A5DD98',
|
|
481
505
|
'brand-secondary-active': '#97D283',
|
|
482
506
|
'brand-secondary-border': '#BCE8AB',
|
|
483
|
-
//
|
|
507
|
+
// Surfaces
|
|
484
508
|
'page-primary': '#F2F8F0',
|
|
485
509
|
'surface-secondary': '#E8F3E4'
|
|
486
510
|
},
|
|
487
|
-
//
|
|
511
|
+
// Variables: typography, spacing, radii, shadows
|
|
488
512
|
variables: {
|
|
489
513
|
'font-family': 'Roboto, sans-serif',
|
|
490
514
|
'border-radius-200': '0.625rem'
|
|
@@ -505,26 +529,30 @@ const cds = createCds({
|
|
|
505
529
|
createApp(App).use(cds);
|
|
506
530
|
```
|
|
507
531
|
|
|
508
|
-
|
|
532
|
+
Every registered theme also gets a `.cds-theme--<name>` class — use it to enable
|
|
533
|
+
the theme on an arbitrary part of the markup.
|
|
509
534
|
|
|
510
|
-
###
|
|
535
|
+
### Token groups
|
|
511
536
|
|
|
512
|
-
`colors` —
|
|
537
|
+
`colors` — semantic colors:
|
|
513
538
|
|
|
514
|
-
- `brand-*` —
|
|
515
|
-
- `surface-*`, `page-*`, `fill-*` —
|
|
516
|
-
- `content-*` —
|
|
517
|
-
- `line-*` —
|
|
518
|
-
- `status-{success,warning,progress,info,danger,indication}-*` —
|
|
519
|
-
- `other-*` —
|
|
539
|
+
- `brand-*` — brand (`primary`, `secondary` and their `hover` / `active` / `border` / `content`)
|
|
540
|
+
- `surface-*`, `page-*`, `fill-*` — surfaces and fills
|
|
541
|
+
- `content-*` — text, icons, links
|
|
542
|
+
- `line-*` — borders, dividers, focus and selection
|
|
543
|
+
- `status-{success,warning,progress,info,danger,indication}-*` — statuses
|
|
544
|
+
- `other-*` — additional accent palettes
|
|
520
545
|
|
|
521
|
-
`variables` —
|
|
546
|
+
`variables` — dimensions: `spacing-*`, `font-size-*`, `font-line-height-*`,
|
|
547
|
+
`font-weight-*`, `border-*`, `border-radius-*`, `shadow-{x,y,blur}-*`,
|
|
548
|
+
`font-family`, `base-unit`.
|
|
522
549
|
|
|
523
|
-
|
|
550
|
+
For the full token list of a specific theme, see the package sources:
|
|
551
|
+
`@central-design-system/components/src/themes/cdsLight.ts`.
|
|
524
552
|
|
|
525
|
-
##
|
|
553
|
+
## Switching the theme
|
|
526
554
|
|
|
527
|
-
|
|
555
|
+
You can change the theme at runtime through the `useTheme` composable:
|
|
528
556
|
|
|
529
557
|
```vue
|
|
530
558
|
<script setup lang="ts">
|
|
@@ -538,34 +566,39 @@ function toggleTheme(): void {
|
|
|
538
566
|
</script>
|
|
539
567
|
|
|
540
568
|
<template>
|
|
541
|
-
<cds-button @click="toggleTheme"
|
|
569
|
+
<cds-button @click="toggleTheme">Toggle theme</cds-button>
|
|
542
570
|
</template>
|
|
543
571
|
```
|
|
544
572
|
|
|
545
|
-
|
|
573
|
+
You can also change the theme of a single component by passing it the `theme`
|
|
574
|
+
prop. Keep in mind that the theme applies not only to the component itself but to
|
|
575
|
+
everything nested inside it:
|
|
546
576
|
|
|
547
577
|
```vue
|
|
548
578
|
<template>
|
|
549
579
|
<cds-notification theme="b2bLight">
|
|
550
|
-
<!--
|
|
580
|
+
<!-- the button will use the b2bLight theme -->
|
|
551
581
|
<cds-button>Button</cds-button>
|
|
552
582
|
</cds-notification>
|
|
553
583
|
</template>
|
|
554
584
|
```
|
|
555
585
|
|
|
556
|
-
|
|
586
|
+
The `theme` prop is supported by container components and most visual components:
|
|
587
|
+
`CdsApp`, `CdsLayout`, `CdsPage`, `CdsSurface`, `CdsCard`, `CdsDrawer`,
|
|
588
|
+
`CdsModal`, `CdsOverlay`, `CdsButton`, `CdsField`, `CdsTable` and others.
|
|
557
589
|
|
|
558
|
-
##
|
|
590
|
+
## Using theme tokens in your own code
|
|
559
591
|
|
|
560
592
|
### Tailwind CSS v4
|
|
561
593
|
|
|
562
|
-
|
|
594
|
+
Theme tokens are mapped into Tailwind's `@theme`, so utilities switch along with
|
|
595
|
+
the theme automatically:
|
|
563
596
|
|
|
564
597
|
```html
|
|
565
|
-
<div class="bg-surface-primary text-content-primary p-
|
|
598
|
+
<div class="bg-surface-primary text-content-primary p-4 rounded-200">…</div>
|
|
566
599
|
```
|
|
567
600
|
|
|
568
|
-
|
|
601
|
+
Setup is described in Tailwind CSS v4 + CDS 4.
|
|
569
602
|
|
|
570
603
|
### CSS / SCSS
|
|
571
604
|
|
|
@@ -578,7 +611,8 @@ function toggleTheme(): void {
|
|
|
578
611
|
}
|
|
579
612
|
```
|
|
580
613
|
|
|
581
|
-
|
|
614
|
+
When you override CDS component styles, put them into the `cds-overrides` layer —
|
|
615
|
+
that way they are guaranteed to win over the library's styles:
|
|
582
616
|
|
|
583
617
|
```scss
|
|
584
618
|
@layer cds-overrides {
|
|
@@ -588,9 +622,10 @@ function toggleTheme(): void {
|
|
|
588
622
|
}
|
|
589
623
|
```
|
|
590
624
|
|
|
591
|
-
###
|
|
625
|
+
### CDS 3 legacy classes
|
|
592
626
|
|
|
593
|
-
|
|
627
|
+
The CDS 3 utility classes (`cds-bg-*`, `cds-text-*`, `cds-border-*`) are **off by
|
|
628
|
+
default** in CDS 4. To bring them back for the duration of a migration:
|
|
594
629
|
|
|
595
630
|
```ts
|
|
596
631
|
import '@central-design-system/components/styles/legacy';
|
|
@@ -600,9 +635,11 @@ const cds = createCds({
|
|
|
600
635
|
});
|
|
601
636
|
```
|
|
602
637
|
|
|
603
|
-
##
|
|
638
|
+
## Disabling theming
|
|
604
639
|
|
|
605
|
-
|
|
640
|
+
Pass `false` to the `theme` option. This prevents the generation of CSS variables
|
|
641
|
+
and theme classes and disables runtime theme switching — the `<style>` tag is not
|
|
642
|
+
created at all.
|
|
606
643
|
|
|
607
644
|
```ts
|
|
608
645
|
import { createCds } from '@central-design-system/components';
|
|
@@ -612,56 +649,59 @@ const cds = createCds({
|
|
|
612
649
|
});
|
|
613
650
|
```
|
|
614
651
|
|
|
615
|
-
|
|
652
|
+
With theming disabled, `theme.isDisabled === true` and `themeClasses` returns
|
|
653
|
+
`undefined`.
|
|
616
654
|
|
|
617
|
-
##
|
|
655
|
+
## Theme instance interface
|
|
618
656
|
|
|
619
|
-
`useTheme()`
|
|
657
|
+
`useTheme()` returns a `ThemeInstance` — access to the current theme and its
|
|
658
|
+
settings.
|
|
620
659
|
|
|
621
660
|
```ts
|
|
622
661
|
interface ThemeInstance {
|
|
623
|
-
/**
|
|
662
|
+
/** Whether theming is enabled (`false` with `theme: false`) */
|
|
624
663
|
readonly isDisabled: boolean;
|
|
625
664
|
|
|
626
665
|
/**
|
|
627
|
-
* Raw
|
|
628
|
-
*
|
|
666
|
+
* Raw object of the installed themes
|
|
667
|
+
* Themes can be added and modified
|
|
629
668
|
*/
|
|
630
669
|
readonly themes: Ref<Record<string, InternalThemeDefinition>>;
|
|
631
670
|
|
|
632
671
|
/**
|
|
633
|
-
*
|
|
634
|
-
*
|
|
672
|
+
* Name of the current theme
|
|
673
|
+
* Inherited from the parent component
|
|
635
674
|
*/
|
|
636
675
|
readonly name: Readonly<Ref<string>>;
|
|
637
676
|
|
|
638
677
|
/**
|
|
639
|
-
*
|
|
640
|
-
*
|
|
678
|
+
* Processed object of the current theme
|
|
679
|
+
* Includes the automatically generated colors
|
|
641
680
|
*/
|
|
642
681
|
readonly current: DeepReadonly<Ref<InternalThemeDefinition>>;
|
|
643
682
|
readonly computedThemes: DeepReadonly<Ref<Record<string, InternalThemeDefinition>>>;
|
|
644
683
|
|
|
645
|
-
/**
|
|
684
|
+
/** Class of the current theme — `cds-theme--<name>` */
|
|
646
685
|
readonly themeClasses: Readonly<ComputedRef<string | undefined>>;
|
|
647
686
|
|
|
648
|
-
/**
|
|
687
|
+
/** Generated CSS of the current theme */
|
|
649
688
|
readonly styles: Readonly<ComputedRef<string>>;
|
|
650
689
|
|
|
651
690
|
readonly global: {
|
|
652
|
-
/**
|
|
691
|
+
/** Name of the current global theme in the application (writable) */
|
|
653
692
|
readonly name: Ref<string>;
|
|
654
693
|
|
|
655
694
|
/**
|
|
656
|
-
*
|
|
657
|
-
*
|
|
695
|
+
* Processed object of the current global theme in the application
|
|
696
|
+
* Also available from `theme.computedThemes.value[theme.global.name.value]`
|
|
658
697
|
*/
|
|
659
698
|
readonly current: DeepReadonly<Ref<InternalThemeDefinition>>;
|
|
660
699
|
};
|
|
661
700
|
}
|
|
662
701
|
```
|
|
663
702
|
|
|
664
|
-
|
|
703
|
+
The theme instance is also available on the object returned by `createCds()` —
|
|
704
|
+
handy outside of a component context:
|
|
665
705
|
|
|
666
706
|
```ts
|
|
667
707
|
const cds = createCds({ theme: { defaultTheme: 'cdsLight' } });
|
|
@@ -671,33 +711,39 @@ cds.theme.global.name.value = 'cdsDark';
|
|
|
671
711
|
|
|
672
712
|
---
|
|
673
713
|
|
|
714
|
+
---
|
|
715
|
+
sourceHash: b1ba0f5864509842881b42ebf6cfb46aadcba96f
|
|
716
|
+
---
|
|
717
|
+
|
|
674
718
|
# Tree-shaking
|
|
675
719
|
|
|
676
|
-
CDS 4
|
|
677
|
-
|
|
678
|
-
(Vite, webpack, Rollup)
|
|
720
|
+
CDS 4 is published as an ESM bundle with its module structure preserved: every
|
|
721
|
+
component is a separate chunk with its own CSS next to it. That lets the bundler
|
|
722
|
+
(Vite, webpack, Rollup) drop everything your application doesn't use.
|
|
679
723
|
|
|
680
|
-
|
|
724
|
+
For this to work, follow two rules:
|
|
681
725
|
|
|
682
|
-
1.
|
|
683
|
-
2.
|
|
726
|
+
1. **Register only the components you actually need in `createCds`.**
|
|
727
|
+
2. **Include the base styles selectively** rather than the whole `styles.css`.
|
|
684
728
|
|
|
685
|
-
|
|
729
|
+
Below is how to do that and how much it saves.
|
|
686
730
|
|
|
687
|
-
##
|
|
731
|
+
## How it works
|
|
688
732
|
|
|
689
|
-
- ESM
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
733
|
+
- The ESM bundle is built with `chunkSplitPlugin({ strategy: 'unbundle' })` — the
|
|
734
|
+
library's module structure is preserved and components are not glued into a
|
|
735
|
+
single file.
|
|
736
|
+
- `package.json` declares `sideEffects`, so the bundler knows the library's JS
|
|
737
|
+
modules are pure and safe to remove.
|
|
738
|
+
- During the build, each component's chunk gets an import of its own CSS
|
|
739
|
+
appended. That's why `import { CdsButton }` pulls in exactly `CdsButton.css`,
|
|
740
|
+
not the styles of the entire library.
|
|
695
741
|
|
|
696
|
-
|
|
742
|
+
No special build or plugin is required — ordinary named imports are enough.
|
|
697
743
|
|
|
698
|
-
##
|
|
744
|
+
## Selective component registration
|
|
699
745
|
|
|
700
|
-
|
|
746
|
+
Pass only the components you use to `createCds`:
|
|
701
747
|
|
|
702
748
|
```ts
|
|
703
749
|
import { createApp } from 'vue';
|
|
@@ -714,25 +760,25 @@ const cds = createCds({
|
|
|
714
760
|
createApp(App).use(cds).mount('#app');
|
|
715
761
|
```
|
|
716
762
|
|
|
717
|
-
|
|
718
|
-
|
|
763
|
+
Components registered this way are available in templates globally — just as with
|
|
764
|
+
full registration:
|
|
719
765
|
|
|
720
766
|
```html
|
|
721
767
|
<template>
|
|
722
768
|
<CdsCard>
|
|
723
|
-
<CdsButton
|
|
769
|
+
<CdsButton>Click me</CdsButton>
|
|
724
770
|
</CdsCard>
|
|
725
771
|
</template>
|
|
726
772
|
```
|
|
727
773
|
|
|
728
|
-
>
|
|
729
|
-
>
|
|
730
|
-
>
|
|
774
|
+
> **Important:** `createCds` does not register components on its own. The set is
|
|
775
|
+
> always defined by the caller. That's deliberate: if the factory referenced the
|
|
776
|
+
> full component list, the bundler could not remove a single one of them.
|
|
731
777
|
|
|
732
|
-
###
|
|
778
|
+
### Alternative: a local import in an SFC
|
|
733
779
|
|
|
734
|
-
|
|
735
|
-
|
|
780
|
+
If you need a component in one or two places, global registration is optional —
|
|
781
|
+
import it right inside the component:
|
|
736
782
|
|
|
737
783
|
```html
|
|
738
784
|
<script setup lang="ts">
|
|
@@ -740,17 +786,18 @@ import { CdsButton } from '@central-design-system/components';
|
|
|
740
786
|
</script>
|
|
741
787
|
|
|
742
788
|
<template>
|
|
743
|
-
<CdsButton
|
|
789
|
+
<CdsButton>Click me</CdsButton>
|
|
744
790
|
</template>
|
|
745
791
|
```
|
|
746
792
|
|
|
747
|
-
`createCds`
|
|
748
|
-
|
|
793
|
+
You still need `createCds` in the entry point — it supplies themes, locales,
|
|
794
|
+
icons and breakpoints through `provide`. But you don't have to pass `components`
|
|
795
|
+
to it at all.
|
|
749
796
|
|
|
750
|
-
##
|
|
797
|
+
## Full registration
|
|
751
798
|
|
|
752
|
-
|
|
753
|
-
|
|
799
|
+
When the set of components is not known in advance (internal admin panels,
|
|
800
|
+
sandboxes, documentation), it's easier to register everything:
|
|
754
801
|
|
|
755
802
|
```ts
|
|
756
803
|
import { createCds, components, directives } from '@central-design-system/components';
|
|
@@ -758,46 +805,47 @@ import { createCds, components, directives } from '@central-design-system/compon
|
|
|
758
805
|
const cds = createCds({ components, directives });
|
|
759
806
|
```
|
|
760
807
|
|
|
761
|
-
|
|
762
|
-
|
|
808
|
+
Such a call disables component tree-shaking: the `components` namespace import
|
|
809
|
+
keeps the whole library in the bundle.
|
|
763
810
|
|
|
764
|
-
##
|
|
811
|
+
## Styles
|
|
765
812
|
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
813
|
+
Component styles are included automatically along with the components themselves.
|
|
814
|
+
The only thing you have to include manually is the **base layer** — reset, fonts,
|
|
815
|
+
CSS layer order and global element styles:
|
|
769
816
|
|
|
770
817
|
```ts
|
|
771
818
|
import '@central-design-system/components/styles/common.css';
|
|
772
819
|
```
|
|
773
820
|
|
|
774
|
-
|
|
775
|
-
|
|
821
|
+
The base layer is mandatory: it's where the `@layer` order is declared, and the
|
|
822
|
+
correct cascade of component styles depends on it.
|
|
776
823
|
|
|
777
|
-
|
|
778
|
-
(`h1`–`h6`)
|
|
824
|
+
Take `common.css`, not `core.css`: `core.css` has no typography, so headings
|
|
825
|
+
(`h1`–`h6`) keep browser sizes instead of the CDS scale.
|
|
779
826
|
|
|
780
|
-
|
|
827
|
+
Available options:
|
|
781
828
|
|
|
782
|
-
|
|
|
829
|
+
| Import | Size | What's inside |
|
|
783
830
|
| --- | --- | --- |
|
|
784
|
-
| `styles/common.css` | ~9 KB |
|
|
785
|
-
| `styles/core.css` | ~2 KB |
|
|
786
|
-
| `styles/tailwind.css` | ~12 KB | CDS
|
|
787
|
-
| `styles/legacy.css` | ~253 KB |
|
|
831
|
+
| `styles/common.css` | ~9 KB | The recommended base: `core` + typography + grid utilities |
|
|
832
|
+
| `styles/core.css` | ~2 KB | Layers, fonts and reset only — **no typography** |
|
|
833
|
+
| `styles/tailwind.css` | ~12 KB | CDS tokens for Tailwind CSS v4 |
|
|
834
|
+
| `styles/legacy.css` | ~253 KB | Compatibility with legacy CDS 3 markup |
|
|
788
835
|
|
|
789
|
-
>
|
|
790
|
-
>
|
|
791
|
-
>
|
|
836
|
+
> **Don't use `@central-design-system/components/styles` in a tree-shaking
|
|
837
|
+
> scenario.** It's a ~556 KB aggregate containing the CSS of every component in
|
|
838
|
+
> the library. It's convenient for a quick start, but it completely defeats
|
|
839
|
+
> selective registration.
|
|
792
840
|
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
841
|
+
Color tokens (`--cds-color-*` and the rest) are not in the CSS files — they are
|
|
842
|
+
generated and injected into the document by `createCds` at runtime, based on the
|
|
843
|
+
active theme. There is nothing extra to include.
|
|
796
844
|
|
|
797
|
-
##
|
|
845
|
+
## Directives
|
|
798
846
|
|
|
799
|
-
|
|
800
|
-
|
|
847
|
+
Directives (`ClickOutside`, `Intersect`, `Touch`) are named exports and are
|
|
848
|
+
registered just as selectively:
|
|
801
849
|
|
|
802
850
|
```ts
|
|
803
851
|
import { createCds, ClickOutside } from '@central-design-system/components';
|
|
@@ -808,107 +856,355 @@ const cds = createCds({
|
|
|
808
856
|
});
|
|
809
857
|
```
|
|
810
858
|
|
|
811
|
-
|
|
812
|
-
`ClickOutside`, `Intersect`
|
|
813
|
-
`CdsSelect`, `CdsMenu`, `CdsTooltip`, `CdsSlideView`,
|
|
814
|
-
|
|
815
|
-
`createCds`
|
|
816
|
-
`v-touch`
|
|
859
|
+
The library's own components don't need you to register directives — the ones
|
|
860
|
+
that use `ClickOutside`, `Intersect` and `Touch` internally (`CdsOverlay` and
|
|
861
|
+
everything built on it: `CdsSelect`, `CdsMenu`, `CdsTooltip`, `CdsSlideView`,
|
|
862
|
+
input fields) import them themselves and register them locally. Pass `directives`
|
|
863
|
+
to `createCds` only for your own markup — `v-click-outside`, `v-intersect`,
|
|
864
|
+
`v-touch` in the application's templates.
|
|
817
865
|
|
|
818
|
-
>
|
|
819
|
-
>
|
|
820
|
-
>
|
|
821
|
-
>
|
|
866
|
+
> **In `4.0.0-alpha.0`:** local registration inside components didn't work, and
|
|
867
|
+
> the `CdsSelect` / `CdsMenu` menus wouldn't close on an outside click unless
|
|
868
|
+
> `directives` was passed to `createCds`. If you can't upgrade, add
|
|
869
|
+
> `directives: { ClickOutside, Touch }` to the registration.
|
|
822
870
|
|
|
823
|
-
##
|
|
871
|
+
## How much it saves
|
|
824
872
|
|
|
825
|
-
|
|
826
|
-
|
|
873
|
+
Measurements on Vite 5 (production, minified, styles in a separate file, Vue
|
|
874
|
+
included in the bundle, the base `common.css` not counted):
|
|
827
875
|
|
|
828
|
-
|
|
|
876
|
+
| Scenario | JS | JS (gzip) | CSS | CSS (gzip) |
|
|
829
877
|
| --- | --- | --- | --- | --- |
|
|
830
|
-
|
|
|
831
|
-
| `createCds` + 3
|
|
832
|
-
| `createCds` + 1
|
|
833
|
-
| 1
|
|
878
|
+
| Full registration (`components`, `directives`) | 625 KB | 203 KB | 208 KB | 24.6 KB |
|
|
879
|
+
| `createCds` + 3 components | 196 KB | 62.6 KB | 27.6 KB | 4.1 KB |
|
|
880
|
+
| `createCds` + 1 component | 162 KB | 51.4 KB | 12.6 KB | 1.9 KB |
|
|
881
|
+
| 1 component without `createCds` | 63 KB | 23.4 KB | 12.6 KB | 1.9 KB |
|
|
834
882
|
|
|
835
|
-
|
|
836
|
-
(`CdsTable`, `CdsAutocomplete`, `CdsDatePicker`)
|
|
883
|
+
The numbers depend on which components exactly you include: composite components
|
|
884
|
+
(`CdsTable`, `CdsAutocomplete`, `CdsDatePicker`) pull in more dependencies than
|
|
885
|
+
atoms do.
|
|
837
886
|
|
|
838
|
-
###
|
|
887
|
+
### What isn't tree-shaken
|
|
839
888
|
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
889
|
+
About 99 KB is the core that `createCds` always includes: themes, locales, icons,
|
|
890
|
+
breakpoints (`useDisplay`), `goTo` and the `defaults` system. That volume doesn't
|
|
891
|
+
depend on the number of components — it is exactly the difference between the
|
|
892
|
+
"1 component without `createCds`" (63 KB) and "`createCds` + 1 component"
|
|
893
|
+
(162 KB) rows.
|
|
844
894
|
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
895
|
+
If CDS is used in a couple of places and you don't need the global subsystems,
|
|
896
|
+
you can skip `createCds` entirely. But then there are no themes, no locales and
|
|
897
|
+
no defaults, so that mode only suits pinpoint embeds.
|
|
848
898
|
|
|
849
|
-
##
|
|
899
|
+
## How to verify the result
|
|
850
900
|
|
|
851
901
|
```bash
|
|
852
902
|
npx vite-bundle-visualizer
|
|
853
903
|
```
|
|
854
904
|
|
|
855
|
-
|
|
905
|
+
What to look for:
|
|
856
906
|
|
|
857
|
-
-
|
|
858
|
-
-
|
|
859
|
-
(
|
|
860
|
-
-
|
|
861
|
-
|
|
907
|
+
- the bundle should contain no chunks of components missing from your `createCds`;
|
|
908
|
+
- if an "extra" component shows up, it is most likely imported transitively
|
|
909
|
+
(`CdsSelect` pulls in `CdsMenu` and `CdsList`, for instance) — that's normal;
|
|
910
|
+
- if the whole library ended up in the bundle, look for `components` or
|
|
911
|
+
`import * as` among your imports.
|
|
862
912
|
|
|
863
|
-
##
|
|
913
|
+
## Common mistakes
|
|
864
914
|
|
|
865
|
-
**
|
|
866
|
-
|
|
915
|
+
**A namespace import instead of a named one.** Any `import * as` from the library
|
|
916
|
+
keeps all of it:
|
|
867
917
|
|
|
868
918
|
```ts
|
|
869
|
-
// ❌
|
|
919
|
+
// ❌ pulls in every component
|
|
870
920
|
import * as cdsComponents from '@central-design-system/components';
|
|
871
921
|
|
|
872
922
|
// ✅
|
|
873
923
|
import { CdsButton } from '@central-design-system/components';
|
|
874
924
|
```
|
|
875
925
|
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
926
|
+
**Importing icon packs through `iconsets`.** The `iconsets` object references all
|
|
927
|
+
packs at once, so it is not tree-shaken: the bundle gets the JS of every pack
|
|
928
|
+
(including `cds` — 46 KB) and, since UnoCSS scans them itself, the CSS of all five
|
|
929
|
+
packs (≈370 KB instead of ≈70 KB). Import the pack through its subpath:
|
|
880
930
|
|
|
881
931
|
```ts
|
|
882
|
-
// ❌
|
|
932
|
+
// ❌ pulls in every pack
|
|
883
933
|
import { iconsets } from '@central-design-system/components';
|
|
884
934
|
const aliases = iconsets.remix.aliases;
|
|
885
935
|
|
|
886
|
-
// ✅
|
|
936
|
+
// ✅ remix only
|
|
887
937
|
import { remix } from '@central-design-system/components/iconsets/remix';
|
|
888
938
|
const aliases = remix.aliases;
|
|
889
939
|
```
|
|
890
940
|
|
|
891
|
-
|
|
892
|
-
|
|
941
|
+
**Including the style aggregate.** `@central-design-system/components/styles`
|
|
942
|
+
contains the CSS of every component — use `styles/common.css`.
|
|
943
|
+
|
|
944
|
+
**Your own barrel re-export.** A `src/ui/index.ts` file that re-exports dozens of
|
|
945
|
+
CDS components kills tree-shaking if you import everything from it. Import
|
|
946
|
+
components directly from the library.
|
|
947
|
+
|
|
948
|
+
**A bundler without ESM support.** The CJS bundle (`dist/cjs`) and the IIFE build
|
|
949
|
+
are not tree-shakable by design. Make sure your bundler resolves the `import`
|
|
950
|
+
export condition — Vite, webpack 5 and Rollup do it by default.
|
|
951
|
+
|
|
952
|
+
---
|
|
953
|
+
|
|
954
|
+
---
|
|
955
|
+
sourceHash: 5d3ad246b66c58c6ecd39eb645d52dd6a026eaf2
|
|
956
|
+
---
|
|
957
|
+
|
|
958
|
+
# SASS variables
|
|
959
|
+
|
|
960
|
+
CDS 4 styles are written in SASS/SCSS, and part of the internal setup — the base
|
|
961
|
+
reset, global typography, font, grid and breakpoints — is extracted into SASS
|
|
962
|
+
variables flagged with `!default`. You can override them when building your
|
|
963
|
+
application through the standard
|
|
964
|
+
[module configuration](https://sass-lang.com/documentation/at-rules/use/#configuration)
|
|
965
|
+
mechanism: `@use '…' with (…)`.
|
|
966
|
+
|
|
967
|
+
> SASS variables are the **compile-time** configuration layer. Colors, spacing
|
|
968
|
+
> and the rest of the component design tokens live in CSS variables (`--cds-*`)
|
|
969
|
+
> and are configured by themes at runtime — see Theming. Start
|
|
970
|
+
> with the theme; drop down to SASS variables when you need to change the base
|
|
971
|
+
> layer itself: reset, typography, grid.
|
|
972
|
+
|
|
973
|
+
## Setup
|
|
974
|
+
|
|
975
|
+
Vite compiles SCSS out of the box — you only need the preprocessor itself:
|
|
976
|
+
|
|
977
|
+
```bash
|
|
978
|
+
npm install -D sass-embedded
|
|
979
|
+
```
|
|
980
|
+
|
|
981
|
+
The classic `sass` works too, but `sass-embedded` is noticeably faster. To speed
|
|
982
|
+
up large builds, opt into the modern compiler API:
|
|
983
|
+
|
|
984
|
+
```ts
|
|
985
|
+
// vite.config.ts
|
|
986
|
+
export default defineConfig({
|
|
987
|
+
css: {
|
|
988
|
+
preprocessorOptions: {
|
|
989
|
+
scss: { api: 'modern-compiler' }
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
});
|
|
993
|
+
```
|
|
994
|
+
|
|
995
|
+
## Plugging in with a configuration
|
|
996
|
+
|
|
997
|
+
Normally the base styles are plugged in as ready-made CSS —
|
|
998
|
+
`import '@central-design-system/components/styles'`. To override SASS variables,
|
|
999
|
+
replace that import with your own SCSS file: in SCSS the
|
|
1000
|
+
`@central-design-system/components/styles` entry point resolves to the **sources**
|
|
1001
|
+
of the base layer (the `sass` export condition in `package.json`), and your
|
|
1002
|
+
configuration is applied at compile time.
|
|
1003
|
+
|
|
1004
|
+
```diff
|
|
1005
|
+
// main.ts
|
|
1006
|
+
import { createApp } from 'vue';
|
|
1007
|
+
|
|
1008
|
+
- import '@central-design-system/components/styles';
|
|
1009
|
+
+ import './styles/main.scss';
|
|
1010
|
+
```
|
|
1011
|
+
|
|
1012
|
+
```scss
|
|
1013
|
+
// src/styles/main.scss
|
|
1014
|
+
@use '@central-design-system/components/styles' with (
|
|
1015
|
+
$reset: false,
|
|
1016
|
+
$body-font-family: ('Inter', sans-serif)
|
|
1017
|
+
);
|
|
1018
|
+
```
|
|
1019
|
+
|
|
1020
|
+
The component styles themselves need nothing extra: they are precompiled and ship
|
|
1021
|
+
with the components' JS chunks — both with selective and with full registration
|
|
1022
|
+
(see Tree-shaking).
|
|
1023
|
+
|
|
1024
|
+
> Wrap a value containing commas — `$body-font-family` with several fonts, for
|
|
1025
|
+
> instance — in parentheses, otherwise SASS reads it as several arguments.
|
|
1026
|
+
|
|
1027
|
+
## A settings file
|
|
1028
|
+
|
|
1029
|
+
Module configuration is applied once, on the first load. If you need the values
|
|
1030
|
+
not only in the entry point but also in your application's component styles,
|
|
1031
|
+
extract them into a separate settings file and use that everywhere:
|
|
1032
|
+
|
|
1033
|
+
```scss
|
|
1034
|
+
// src/styles/settings.scss
|
|
1035
|
+
@forward '@central-design-system/components/styles/settings' with (
|
|
1036
|
+
$body-font-family: ('Inter', sans-serif),
|
|
1037
|
+
$grid-gutter: 24px
|
|
1038
|
+
);
|
|
1039
|
+
```
|
|
1040
|
+
|
|
1041
|
+
```scss
|
|
1042
|
+
// src/styles/main.scss
|
|
1043
|
+
@use './settings'; // configures the CDS variables
|
|
1044
|
+
@use '@central-design-system/components/styles'; // the base is built with them
|
|
1045
|
+
```
|
|
1046
|
+
|
|
1047
|
+
```html
|
|
1048
|
+
<!-- Component.vue -->
|
|
1049
|
+
<style lang="scss">
|
|
1050
|
+
@use '@/styles/settings' as s;
|
|
1051
|
+
|
|
1052
|
+
.card {
|
|
1053
|
+
gap: s.$grid-gutter;
|
|
1054
|
+
font-family: s.$body-font-family;
|
|
1055
|
+
}
|
|
1056
|
+
</style>
|
|
1057
|
+
```
|
|
1058
|
+
|
|
1059
|
+
Every `<style>` block is compiled separately, so "configure it in `main.scss` and
|
|
1060
|
+
read it straight from the package" won't work — a direct
|
|
1061
|
+
`@use '@central-design-system/components/styles/settings'` in a component would
|
|
1062
|
+
return the default values. A shared settings file guarantees identical values at
|
|
1063
|
+
every compilation point.
|
|
1064
|
+
|
|
1065
|
+
The `styles/settings` entry contains variables only and emits not a single byte
|
|
1066
|
+
of CSS — it's safe to include in any number of files.
|
|
1067
|
+
|
|
1068
|
+
## Global variables
|
|
1069
|
+
|
|
1070
|
+
| Variable | Default | What it does |
|
|
1071
|
+
| --- | --- | --- |
|
|
1072
|
+
| `$reset` | `true` | Emit the base layer's CSS reset |
|
|
1073
|
+
| `$legacy-reset` | `false` | Reset for compatibility with CDS 3 markup |
|
|
1074
|
+
| `$enable-typography` | `true` | Global typography (`h1`–`h6`, `.h1`–`.h6` and so on) |
|
|
1075
|
+
| `$body-font-family` | `var(--cds-font-family), 'PT Root UI VF', …` | `body` font |
|
|
1076
|
+
| `$font-size-root` | `var(--cds-base-unit)` (16px) | Root font size |
|
|
1077
|
+
| `$line-height-root` | `1.5` | Root line height |
|
|
1078
|
+
| `$border-color-root` | `transparent` | Default border color |
|
|
1079
|
+
| `$border-style-root` | `solid` | Default border style |
|
|
1080
|
+
| `$border-radius-root` | `var(--cds-border-radius-200)` | Base corner radius |
|
|
1081
|
+
| `$size-scale` | `4px` | Step of the size scale |
|
|
1082
|
+
| `$sizes` | `('xs', 'sm', 'md', 'lg', 'xl')` | Size names |
|
|
1083
|
+
| `$standard-easing` | `cubic-bezier(0.4, 0, 0.2, 1)` | Base animation curve |
|
|
1084
|
+
| `$decelerated-easing` | `cubic-bezier(0, 0, 0.2, 1)` | Enter curve |
|
|
1085
|
+
| `$accelerated-easing` | `cubic-bezier(0.4, 0, 1, 1)` | Leave curve |
|
|
1086
|
+
| `$rounded` | map | Radius scale (`sm`, `md`, `lg`, `xl`, `pill`, `circle`, …) |
|
|
1087
|
+
|
|
1088
|
+
## Grid and breakpoints
|
|
1089
|
+
|
|
1090
|
+
| Variable | Default | What it does |
|
|
1091
|
+
| --- | --- | --- |
|
|
1092
|
+
| `$prefix` | `'cds'` | Prefix of the grid CSS classes |
|
|
1093
|
+
| `$flex-grid-columns` | `16` | Number of flex grid columns (`12` is supported too) |
|
|
1094
|
+
| `$grid-gutter` | `32px` | Grid gutter |
|
|
1095
|
+
| `$grid-gutter-condensed` | `1px` | Gutter of the condensed grid |
|
|
1096
|
+
| `$grid-breakpoints` | map | Breakpoints: width, columns and spacing for `xs`–`xl` |
|
|
1097
|
+
|
|
1098
|
+
The grid variables belong to the same settings module, while the breakpoint and
|
|
1099
|
+
grid mixins live in a separate `styles/breakpoints` entry — which emits no CSS
|
|
1100
|
+
either:
|
|
1101
|
+
|
|
1102
|
+
```scss
|
|
1103
|
+
@use '@/styles/settings' as s;
|
|
1104
|
+
@use '@central-design-system/components/styles/breakpoints' as bp;
|
|
1105
|
+
|
|
1106
|
+
.sidebar {
|
|
1107
|
+
gap: s.$grid-gutter;
|
|
1108
|
+
|
|
1109
|
+
@include bp.cds-breakpoint-up('md') {
|
|
1110
|
+
width: 320px;
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
```
|
|
1114
|
+
|
|
1115
|
+
> SASS breakpoints affect your styles and the grid mixins. The runtime
|
|
1116
|
+
> breakpoints of `useDisplay` are configured separately, through the `display`
|
|
1117
|
+
> option of `createCds` (see Display & Platform).
|
|
1118
|
+
> The two sets match by default; when you change one, don't forget the other.
|
|
1119
|
+
|
|
1120
|
+
## Component variables and vite-plugin
|
|
1121
|
+
|
|
1122
|
+
Without the plugin, `@use … with` configures the base layer only: component CSS
|
|
1123
|
+
is precompiled. The `@central-design-system/vite-plugin` plugin lifts that
|
|
1124
|
+
limitation — it recompiles the styles of every component you use with your
|
|
1125
|
+
settings file:
|
|
1126
|
+
|
|
1127
|
+
```ts
|
|
1128
|
+
// vite.config.ts
|
|
1129
|
+
import cds from '@central-design-system/vite-plugin';
|
|
1130
|
+
|
|
1131
|
+
export default defineConfig({
|
|
1132
|
+
plugins: [
|
|
1133
|
+
vue(),
|
|
1134
|
+
cds({ styles: { configFile: 'src/styles/settings.scss' } })
|
|
1135
|
+
]
|
|
1136
|
+
});
|
|
1137
|
+
```
|
|
1138
|
+
|
|
1139
|
+
The settings file is the same, but you have to forward
|
|
1140
|
+
`styles/component-settings` — the aggregate that includes both global and
|
|
1141
|
+
component variables:
|
|
1142
|
+
|
|
1143
|
+
```scss
|
|
1144
|
+
// src/styles/settings.scss
|
|
1145
|
+
@forward '@central-design-system/components/styles/component-settings' with (
|
|
1146
|
+
$border-radius-root: 0, // global
|
|
1147
|
+
$button-border-radius: 9999px // component-level
|
|
1148
|
+
);
|
|
1149
|
+
```
|
|
893
1150
|
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
1151
|
+
With the plugin you don't need to change the
|
|
1152
|
+
`@central-design-system/components/styles` import in `main.ts` — it starts
|
|
1153
|
+
meaning "the configured base layer" on its own, and component styles are rebuilt
|
|
1154
|
+
on the fly. The plugin can also auto-import components from templates
|
|
1155
|
+
(`autoImport: true` by default), which makes registration in
|
|
1156
|
+
`createCds({ components })` optional.
|
|
1157
|
+
|
|
1158
|
+
## What SASS can't configure
|
|
1159
|
+
|
|
1160
|
+
- **Component-local variables** (`$button-border-radius` and friends from
|
|
1161
|
+
`styles/_CdsX.variables.scss`). Unavailable without the plugin: component CSS
|
|
1162
|
+
is published precompiled, so its local variables are frozen at the moment the
|
|
1163
|
+
library was built. With `@central-design-system/vite-plugin` they are
|
|
1164
|
+
configured through `styles/component-settings` — the plugin recompiles the
|
|
1165
|
+
published SCSS sources of the components with your settings file (see above).
|
|
1166
|
+
- **Turning off individual utility classes.** Instead of a toggle map, pick an
|
|
1167
|
+
entry point by content: `styles/core` — layers, fonts and reset only;
|
|
1168
|
+
`styles/common` — plus typography and helpers.
|
|
1169
|
+
- **CSS layers.** `@layer cds-*` is always on: the layer order is declared in the
|
|
1170
|
+
base style layer, and ordinary application CSS (outside `@layer`) always beats
|
|
1171
|
+
the design system's styles — there is nothing to turn off here.
|
|
1172
|
+
|
|
1173
|
+
## Pitfalls
|
|
1174
|
+
|
|
1175
|
+
- **Variables only in the settings file.** Any styles or imports of regular style
|
|
1176
|
+
files inside `settings.scss` get duplicated into every file that includes it.
|
|
1177
|
+
Styles belong in `main.scss`; the settings file holds variables, mixins and
|
|
1178
|
+
functions.
|
|
1179
|
+
- **Configure before the module's first load.** `@use … with` fails with a
|
|
1180
|
+
`module was already loaded` error if the settings module has already been
|
|
1181
|
+
loaded without a configuration higher up the chain. Include the settings file
|
|
1182
|
+
first.
|
|
1183
|
+
- **Build speed.** With ready-made CSS there is nothing to compile; with a
|
|
1184
|
+
configuration the base layer is built together with the application. The volume
|
|
1185
|
+
is small, but the difference shows on cold builds — `sass-embedded` and
|
|
1186
|
+
`api: 'modern-compiler'` keep it to a minimum.
|
|
1187
|
+
- **Resolution assumes a bundler.** Bare imports such as
|
|
1188
|
+
`@use '@central-design-system/components/styles'` are resolved by Vite and
|
|
1189
|
+
webpack (`sass-loader`) through the `sass` export condition. In plain `sass`
|
|
1190
|
+
CLI without a bundler you'll have to point the paths at the files inside
|
|
1191
|
+
`node_modules` by hand.
|
|
897
1192
|
|
|
898
|
-
|
|
899
|
-
by design. Убедитесь, что сборщик резолвит `import`-условие экспорта, — Vite, webpack 5
|
|
900
|
-
и Rollup делают это по умолчанию.
|
|
1193
|
+
---
|
|
901
1194
|
|
|
1195
|
+
---
|
|
1196
|
+
sourceHash: 5822739245a9c6095f09064c0b58dc326ac5c188
|
|
902
1197
|
---
|
|
903
1198
|
|
|
904
|
-
#
|
|
1199
|
+
# Icons
|
|
905
1200
|
|
|
906
|
-
|
|
1201
|
+
CDS v4 supports many popular icon packs out of the box.
|
|
907
1202
|
|
|
908
|
-
##
|
|
1203
|
+
## Usage
|
|
909
1204
|
|
|
910
|
-
|
|
911
|
-
|
|
1205
|
+
You can pick one of the ready-made icon packs or plug in your own.
|
|
1206
|
+
By default CDS uses the `cds` pack — it contains every icon the design system
|
|
1207
|
+
components need.
|
|
912
1208
|
|
|
913
1209
|
```ts
|
|
914
1210
|
import { createCds } from '@central-design-system/components';
|
|
@@ -922,7 +1218,7 @@ const cds = createCds({
|
|
|
922
1218
|
app.use(cds);
|
|
923
1219
|
```
|
|
924
1220
|
|
|
925
|
-
|
|
1221
|
+
After that, use the icon in templates:
|
|
926
1222
|
|
|
927
1223
|
```html
|
|
928
1224
|
<template>
|
|
@@ -930,19 +1226,25 @@ app.use(cds);
|
|
|
930
1226
|
</template>
|
|
931
1227
|
```
|
|
932
1228
|
|
|
933
|
-
##
|
|
1229
|
+
## Installing icon packs through UnoCSS
|
|
934
1230
|
|
|
935
|
-
|
|
1231
|
+
CDS integrates with [UnoCSS Preset Icons](https://unocss.dev/presets/icons), which
|
|
1232
|
+
supports every icon pack available on [Iconify](https://icon-sets.iconify.design/).
|
|
936
1233
|
|
|
937
|
-
|
|
1234
|
+
Icons are tree-shaken, so only the icons you actually use end up in the final CSS
|
|
1235
|
+
bundle. You can register several packs at once and freely mix icons from any of
|
|
1236
|
+
them in your components.
|
|
938
1237
|
|
|
939
|
-
###
|
|
1238
|
+
### Icon packs
|
|
940
1239
|
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
1240
|
+
For the packs listed below, CDS ships iconsets with alias mappings — aliases for
|
|
1241
|
+
the icons CDS components use (checkboxes, dropdowns, radio buttons and so on).
|
|
1242
|
+
Pick one of them as the default pack (`defaultSet`); the alias mappings can be
|
|
1243
|
+
overridden if needed.
|
|
1244
|
+
Additional packs — without aliases — can be plugged in alongside and used freely
|
|
1245
|
+
in your own templates.
|
|
944
1246
|
|
|
945
|
-
|
|
|
1247
|
+
| Icon library | Iconify package | Iconset import | Set name |
|
|
946
1248
|
|------------------------------------------------------------------|------------------------|-----------------------------------------------------------|------------|
|
|
947
1249
|
| [Remix Icon](https://remixicon.com/) | `@iconify-json/ri` | `@central-design-system/components/iconsets/remix` | `ri` |
|
|
948
1250
|
| [Phosphor Icons](https://phosphoricons.com/) | `@iconify-json/ph` | `@central-design-system/components/iconsets/phosphor` | `phosphor` |
|
|
@@ -950,26 +1252,28 @@ app.use(cds);
|
|
|
950
1252
|
| [Carbon](https://carbondesignsystem.com/elements/icons/library/) | `@iconify-json/carbon` | `@central-design-system/components/iconsets/carbon` | `carbon` |
|
|
951
1253
|
| [Material Design Icons](https://pictogrammers.com/library/mdi/) | `@iconify-json/mdi` | `@central-design-system/components/iconsets/mdi` | `mdi` |
|
|
952
1254
|
|
|
953
|
-
|
|
1255
|
+
Each module exports an object named after the pack: `icons` (the pack itself, for
|
|
1256
|
+
`sets`) and `aliases` (the aliases, for `aliases`).
|
|
954
1257
|
|
|
955
|
-
|
|
1258
|
+
Install the pack you need from the table above:
|
|
956
1259
|
|
|
957
1260
|
```bash
|
|
958
1261
|
npm install @iconify-json/ri
|
|
959
1262
|
```
|
|
960
1263
|
|
|
961
|
-
>
|
|
962
|
-
>
|
|
1264
|
+
> Icons from the table run through UnoCSS, so you have to install and configure
|
|
1265
|
+
> UnoCSS first. See the [official documentation](https://unocss.dev/integrations/)
|
|
1266
|
+
> for details.
|
|
963
1267
|
|
|
964
|
-
|
|
1268
|
+
Here is an example integration in a Vite project.
|
|
965
1269
|
|
|
966
|
-
1.
|
|
1270
|
+
1. Install UnoCSS as a dev dependency (see the [Vite integration](https://unocss.dev/integrations/vite)):
|
|
967
1271
|
|
|
968
1272
|
```bash
|
|
969
1273
|
npm install -D unocss
|
|
970
1274
|
```
|
|
971
1275
|
|
|
972
|
-
2.
|
|
1276
|
+
2. Add the UnoCSS plugin to your Vite config:
|
|
973
1277
|
|
|
974
1278
|
```ts
|
|
975
1279
|
// vite.config.ts
|
|
@@ -983,7 +1287,7 @@ export default defineConfig({
|
|
|
983
1287
|
})
|
|
984
1288
|
```
|
|
985
1289
|
|
|
986
|
-
3.
|
|
1290
|
+
3. Create an **unocss.config.ts** file in the project root:
|
|
987
1291
|
|
|
988
1292
|
```ts
|
|
989
1293
|
// unocss.config.ts
|
|
@@ -1000,12 +1304,14 @@ export default defineConfig({
|
|
|
1000
1304
|
})
|
|
1001
1305
|
```
|
|
1002
1306
|
|
|
1003
|
-
>
|
|
1004
|
-
>
|
|
1005
|
-
>
|
|
1307
|
+
> Nothing else needs to go into `unocss.config.ts`: CDS iconsets carry the
|
|
1308
|
+
> `@unocss-include` marker, so UnoCSS scans them on its own — even though they
|
|
1309
|
+
> live in `node_modules` as `.js` files, which are not part of
|
|
1310
|
+
> `content.pipeline.include` by default.
|
|
1006
1311
|
|
|
1007
|
-
4.
|
|
1008
|
-
|
|
1312
|
+
4. Pass the icon pack to `createCds()`.
|
|
1313
|
+
The example uses the **[Remix](https://remixicon.com/)** pack, but you can swap it
|
|
1314
|
+
for any other pack from the table above:
|
|
1009
1315
|
|
|
1010
1316
|
```ts
|
|
1011
1317
|
import { createCds } from '@central-design-system/components';
|
|
@@ -1024,21 +1330,26 @@ const cds = createCds({
|
|
|
1024
1330
|
app.use(cds);
|
|
1025
1331
|
```
|
|
1026
1332
|
|
|
1027
|
-
>
|
|
1028
|
-
>
|
|
1029
|
-
>
|
|
1333
|
+
> Import the pack through the `@central-design-system/components/iconsets/<pack>`
|
|
1334
|
+
> subpath, not from the shared `iconsets` object. The shared object references all
|
|
1335
|
+
> packs at once and is not tree-shaken — you would ship the JS and CSS of all five
|
|
1336
|
+
> packs (≈370 KB instead of ≈70 KB for a single one).
|
|
1030
1337
|
|
|
1031
|
-
|
|
1338
|
+
After that, pick any icon from the pack — for example
|
|
1339
|
+
[ri:settings-3-line](https://icon-sets.iconify.design/ri/?icon-filter=settings-3-line) —
|
|
1340
|
+
and use it in templates:
|
|
1032
1341
|
|
|
1033
1342
|
```html
|
|
1034
1343
|
<CdsButton icon="i-ri:settings-3-line" />
|
|
1035
1344
|
```
|
|
1036
1345
|
|
|
1037
|
-
> UnoCSS
|
|
1346
|
+
> UnoCSS uses the `i-` prefix for icons. CDS uses the same prefix and already
|
|
1347
|
+
> configures its aliases with it — don't change it, or the CDS aliases will stop
|
|
1348
|
+
> working.
|
|
1038
1349
|
|
|
1039
|
-
## Legacy
|
|
1350
|
+
## Legacy icon pack from CDS v3
|
|
1040
1351
|
|
|
1041
|
-
|
|
1352
|
+
If you need the full icon pack from CDS v3, plug it in like this:
|
|
1042
1353
|
|
|
1043
1354
|
```bash
|
|
1044
1355
|
npm install @central-design-system/icons
|
|
@@ -1056,16 +1367,21 @@ app.use(cds);
|
|
|
1056
1367
|
|
|
1057
1368
|
---
|
|
1058
1369
|
|
|
1370
|
+
---
|
|
1371
|
+
sourceHash: 2d02d03da0e4d6f0fcb171775b7b88784a216ac0
|
|
1372
|
+
---
|
|
1373
|
+
|
|
1059
1374
|
# Display & Platform
|
|
1060
1375
|
|
|
1061
|
-
Central Design System
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
(
|
|
1376
|
+
Central Design System exposes reactive information about the **screen**
|
|
1377
|
+
(breakpoints, viewport size, mobile mode) and the **platform** (browser, OS,
|
|
1378
|
+
device type) through a single composable — `useDisplay`. Breakpoints are the same
|
|
1379
|
+
in JavaScript and in styles (the `cds-breakpoint-*` SCSS mixins), so responsive
|
|
1380
|
+
logic in script and CSS always agrees.
|
|
1065
1381
|
|
|
1066
|
-
##
|
|
1382
|
+
## Breakpoints
|
|
1067
1383
|
|
|
1068
|
-
|
|
|
1384
|
+
| Breakpoint | Width range (px) | Start width | Grid columns |
|
|
1069
1385
|
| --- | --- | --- | --- |
|
|
1070
1386
|
| `xs` | `0 … 671` | `0` | 4 |
|
|
1071
1387
|
| `sm` | `672 … 1055` | `672` | 8 |
|
|
@@ -1073,45 +1389,46 @@ Central Design System предоставляет реактивную инфор
|
|
|
1073
1389
|
| `lg` | `1312 … 1583` | `1312` | 16 |
|
|
1074
1390
|
| `xl` | `1584 … ∞` | `1584` | 16 |
|
|
1075
1391
|
|
|
1076
|
-
|
|
1392
|
+
The values have a single source:
|
|
1077
1393
|
|
|
1078
1394
|
- JS — `defaultDisplayOptions.thresholds` (`src/composables/useDisplay/internal/useDisplay.constants.ts`);
|
|
1079
1395
|
- SCSS — `$grid-breakpoints` (`src/styles/utilities/grid/_config.scss`).
|
|
1080
1396
|
|
|
1081
|
-
##
|
|
1397
|
+
## In JavaScript — `useDisplay`
|
|
1082
1398
|
|
|
1083
|
-
|
|
1084
|
-
|
|
1399
|
+
The `useDisplay` composable returns the reactive state of the screen and the
|
|
1400
|
+
platform. It works out of the box as long as the application is initialized
|
|
1401
|
+
through `createCds` (which provides `cds:display`).
|
|
1085
1402
|
|
|
1086
1403
|
```ts
|
|
1087
1404
|
import { useDisplay } from '@central-design-system/components';
|
|
1088
1405
|
|
|
1089
1406
|
const display = useDisplay();
|
|
1090
1407
|
|
|
1091
|
-
display.width.value; //
|
|
1408
|
+
display.width.value; // current viewport width, px
|
|
1092
1409
|
display.name.value; // 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
1093
|
-
display.mobile.value; // true
|
|
1410
|
+
display.mobile.value; // true when width < mobileBreakpoint ('sm' by default)
|
|
1094
1411
|
```
|
|
1095
1412
|
|
|
1096
|
-
###
|
|
1413
|
+
### Available flags
|
|
1097
1414
|
|
|
1098
|
-
|
|
|
1415
|
+
| Flag | Meaning |
|
|
1099
1416
|
| --- | --- |
|
|
1100
|
-
| `xs` / `sm` / `md` / `lg` / `xl` |
|
|
1101
|
-
| `smUp` / `mdUp` / `lgUp` / `xlUp` |
|
|
1102
|
-
| `smDown` / `mdDown` / `lgDown` / `xlDown` |
|
|
1103
|
-
| `name` |
|
|
1104
|
-
| `mobile` |
|
|
1105
|
-
| `mobileBreakpoint` |
|
|
1106
|
-
| `width` / `height` |
|
|
1107
|
-
| `thresholds` |
|
|
1108
|
-
| `platform` |
|
|
1109
|
-
| `update()` |
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
(
|
|
1113
|
-
|
|
1114
|
-
###
|
|
1417
|
+
| `xs` / `sm` / `md` / `lg` / `xl` | exactly one is active — the current breakpoint |
|
|
1418
|
+
| `smUp` / `mdUp` / `lgUp` / `xlUp` | width ≥ the breakpoint's start width ("and up") |
|
|
1419
|
+
| `smDown` / `mdDown` / `lgDown` / `xlDown` | the breakpoint and everything below it ("and down") |
|
|
1420
|
+
| `name` | name of the current breakpoint |
|
|
1421
|
+
| `mobile` | mobile mode (based on `mobileBreakpoint`) |
|
|
1422
|
+
| `mobileBreakpoint` | current mobile mode threshold |
|
|
1423
|
+
| `width` / `height` | viewport size, px |
|
|
1424
|
+
| `thresholds` | current threshold map |
|
|
1425
|
+
| `platform` | platform/browser flags (see [Platform](#platform)) |
|
|
1426
|
+
| `update()` | force a recalculation of size and platform |
|
|
1427
|
+
|
|
1428
|
+
For example, `mdUp` is true when `width ≥ 1056`, and `smDown` when `width < 1056`
|
|
1429
|
+
(that is, it covers the `xs` and `sm` ranges).
|
|
1430
|
+
|
|
1431
|
+
### Example in a component
|
|
1115
1432
|
|
|
1116
1433
|
```tsx
|
|
1117
1434
|
import { useDisplay } from '@central-design-system/components';
|
|
@@ -1125,19 +1442,20 @@ defineRender(() => (
|
|
|
1125
1442
|
));
|
|
1126
1443
|
```
|
|
1127
1444
|
|
|
1128
|
-
###
|
|
1445
|
+
### Mobile mode at the prop level
|
|
1129
1446
|
|
|
1130
|
-
|
|
1131
|
-
`mobileBreakpoint` —
|
|
1447
|
+
Components that mix in `defineDisplayProps()` accept the `mobile` and
|
|
1448
|
+
`mobileBreakpoint` props — use them to override the mobile mode threshold
|
|
1449
|
+
locally:
|
|
1132
1450
|
|
|
1133
1451
|
```html
|
|
1134
|
-
<!--
|
|
1452
|
+
<!-- Mobile mode kicks in below 1056px (md) instead of the global 'sm' -->
|
|
1135
1453
|
<CdsSlideGroup mobile-breakpoint="md" />
|
|
1136
1454
|
```
|
|
1137
1455
|
|
|
1138
|
-
###
|
|
1456
|
+
### Overriding the thresholds globally
|
|
1139
1457
|
|
|
1140
|
-
|
|
1458
|
+
Thresholds and `mobileBreakpoint` are configured at initialization:
|
|
1141
1459
|
|
|
1142
1460
|
```ts
|
|
1143
1461
|
import { createCds } from '@central-design-system/components';
|
|
@@ -1150,75 +1468,79 @@ app.use(createCds({
|
|
|
1150
1468
|
}));
|
|
1151
1469
|
```
|
|
1152
1470
|
|
|
1153
|
-
>
|
|
1154
|
-
>
|
|
1471
|
+
> If you change the thresholds in JS, keep them in sync in SCSS
|
|
1472
|
+
> (`$grid-breakpoints`) — otherwise responsiveness in script and styles will
|
|
1473
|
+
> drift apart.
|
|
1155
1474
|
|
|
1156
|
-
##
|
|
1475
|
+
## In SCSS — the `cds-breakpoint-*` mixins
|
|
1157
1476
|
|
|
1158
|
-
|
|
1477
|
+
The mixins come from a public entry point:
|
|
1159
1478
|
|
|
1160
1479
|
```scss
|
|
1161
1480
|
@use '@central-design-system/components/styles/breakpoints' as breakpoint;
|
|
1162
1481
|
```
|
|
1163
1482
|
|
|
1164
|
-
>
|
|
1483
|
+
> In plain Dart Sass (without a bundler), use the pkg scheme and the Node
|
|
1484
|
+
> importer:
|
|
1165
1485
|
> `@use 'pkg:@central-design-system/components/styles/breakpoints' as breakpoint;`.
|
|
1166
1486
|
|
|
1167
|
-
### `cds-breakpoint-up($name)` —
|
|
1487
|
+
### `cds-breakpoint-up($name)` — "and up"
|
|
1168
1488
|
|
|
1169
1489
|
```scss
|
|
1170
1490
|
.card {
|
|
1171
1491
|
display: none;
|
|
1172
1492
|
|
|
1173
|
-
//
|
|
1493
|
+
// applies at min-width: 1056px (md and up)
|
|
1174
1494
|
@include breakpoint.cds-breakpoint-up(md) {
|
|
1175
1495
|
display: block;
|
|
1176
1496
|
}
|
|
1177
1497
|
}
|
|
1178
1498
|
```
|
|
1179
1499
|
|
|
1180
|
-
### `cds-breakpoint-down($name)` —
|
|
1500
|
+
### `cds-breakpoint-down($name)` — "and down"
|
|
1181
1501
|
|
|
1182
1502
|
```scss
|
|
1183
1503
|
.sidebar {
|
|
1184
|
-
//
|
|
1504
|
+
// applies at max-width: 1055.98px — that is, on sm and xs
|
|
1185
1505
|
@include breakpoint.cds-breakpoint-down(sm) {
|
|
1186
1506
|
display: none;
|
|
1187
1507
|
}
|
|
1188
1508
|
}
|
|
1189
1509
|
```
|
|
1190
1510
|
|
|
1191
|
-
`cds-breakpoint-down('<name>')`
|
|
1192
|
-
(
|
|
1193
|
-
|
|
1511
|
+
`cds-breakpoint-down('<name>')` covers the breakpoint itself **and everything
|
|
1512
|
+
below it** (the upper bound is the start of the next breakpoint minus `0.02px`).
|
|
1513
|
+
No media query is generated for the largest breakpoint (`xl`) — "xl and down" is
|
|
1514
|
+
every width.
|
|
1194
1515
|
|
|
1195
|
-
### `cds-breakpoint-between($lower, $upper)` —
|
|
1516
|
+
### `cds-breakpoint-between($lower, $upper)` — a range
|
|
1196
1517
|
|
|
1197
1518
|
```scss
|
|
1198
1519
|
.banner {
|
|
1199
|
-
// min-width: 672px
|
|
1520
|
+
// min-width: 672px and max-width: 1056px
|
|
1200
1521
|
@include breakpoint.cds-breakpoint-between(sm, md) {
|
|
1201
1522
|
padding: 16px;
|
|
1202
1523
|
}
|
|
1203
1524
|
}
|
|
1204
1525
|
```
|
|
1205
1526
|
|
|
1206
|
-
|
|
1527
|
+
Both mixins also accept a number instead of a name: `cds-breakpoint-up(900px)`.
|
|
1207
1528
|
|
|
1208
|
-
###
|
|
1529
|
+
### Other mixins and functions
|
|
1209
1530
|
|
|
1210
|
-
- `cds-breakpoint($name)` —
|
|
1211
|
-
- `cds-largest-breakpoint` — media query
|
|
1212
|
-
- `breakpoint-next($name)` / `breakpoint-prev($name)` —
|
|
1213
|
-
- `is-smallest-breakpoint($name)` —
|
|
1214
|
-
- `largest-breakpoint-name()` —
|
|
1531
|
+
- `cds-breakpoint($name)` — an alias for `cds-breakpoint-up`.
|
|
1532
|
+
- `cds-largest-breakpoint` — media query for the largest breakpoint.
|
|
1533
|
+
- `breakpoint-next($name)` / `breakpoint-prev($name)` — the neighboring breakpoint.
|
|
1534
|
+
- `is-smallest-breakpoint($name)` — whether `$name` is the smallest one.
|
|
1535
|
+
- `largest-breakpoint-name()` — name of the largest breakpoint.
|
|
1215
1536
|
|
|
1216
|
-
##
|
|
1537
|
+
## JS ↔ CSS correspondence
|
|
1217
1538
|
|
|
1218
|
-
|
|
1219
|
-
|
|
1539
|
+
The `useDisplay` flags and the mixins' media queries cover identical width
|
|
1540
|
+
ranges — that's what lets you write consistent responsive logic in script and
|
|
1541
|
+
styles.
|
|
1220
1542
|
|
|
1221
|
-
| JS (`useDisplay`) | SCSS
|
|
1543
|
+
| JS (`useDisplay`) | SCSS mixin | Width range |
|
|
1222
1544
|
| --- | --- | --- |
|
|
1223
1545
|
| `smUp` | `cds-breakpoint-up(sm)` | `≥ 672` |
|
|
1224
1546
|
| `mdUp` | `cds-breakpoint-up(md)` | `≥ 1056` |
|
|
@@ -1227,19 +1549,20 @@ app.use(createCds({
|
|
|
1227
1549
|
| `smDown` | `cds-breakpoint-down(sm)` | `< 1056` |
|
|
1228
1550
|
| `mdDown` | `cds-breakpoint-down(md)` | `< 1312` |
|
|
1229
1551
|
| `lgDown` | `cds-breakpoint-down(lg)` | `< 1584` |
|
|
1230
|
-
| `xlDown` | `cds-breakpoint-down(xl)` |
|
|
1552
|
+
| `xlDown` | `cds-breakpoint-down(xl)` | every width |
|
|
1231
1553
|
|
|
1232
|
-
>
|
|
1233
|
-
>
|
|
1234
|
-
> `smDown`
|
|
1235
|
-
>
|
|
1236
|
-
>
|
|
1237
|
-
>
|
|
1554
|
+
> **Important (migrating from CDS 3).** In CDS 3 the semantics of
|
|
1555
|
+
> `cds-breakpoint-down` in SCSS differed from JS: `down('sm')` meant "strictly
|
|
1556
|
+
> below `sm`" (only `xs`), whereas `smDown` in JS means "`sm` and down". In CDS 4
|
|
1557
|
+
> the CSS is aligned with JS: `down('<name>')` now always means "`<name>` and
|
|
1558
|
+
> down". If you are porting styles from CDS 3, shift the `down()` argument one
|
|
1559
|
+
> step down (old `down('md')` ⇒ new `down('sm')`).
|
|
1560
|
+
> See the Migration Guide.
|
|
1238
1561
|
|
|
1239
|
-
##
|
|
1562
|
+
## Platform
|
|
1240
1563
|
|
|
1241
|
-
`useDisplay().platform`
|
|
1242
|
-
|
|
1564
|
+
`useDisplay().platform` is a reactive object with device, OS and browser flags.
|
|
1565
|
+
Detection is based on `navigator.userAgent` and touch support.
|
|
1243
1566
|
|
|
1244
1567
|
```ts
|
|
1245
1568
|
import { useDisplay } from '@central-design-system/components';
|
|
@@ -1247,33 +1570,33 @@ import { useDisplay } from '@central-design-system/components';
|
|
|
1247
1570
|
const { platform } = useDisplay();
|
|
1248
1571
|
|
|
1249
1572
|
if (platform.value.ios) {
|
|
1250
|
-
//
|
|
1573
|
+
// special behavior for iOS
|
|
1251
1574
|
}
|
|
1252
1575
|
|
|
1253
1576
|
const isTouchDevice = platform.value.touch;
|
|
1254
1577
|
```
|
|
1255
1578
|
|
|
1256
|
-
###
|
|
1579
|
+
### Fields of the `platform` object
|
|
1257
1580
|
|
|
1258
|
-
|
|
1581
|
+
Every field is a `boolean`.
|
|
1259
1582
|
|
|
1260
|
-
|
|
|
1583
|
+
| Field | Meaning |
|
|
1261
1584
|
| --- | --- |
|
|
1262
|
-
| `android` |
|
|
1263
|
-
| `ios` |
|
|
1264
|
-
| `cordova` |
|
|
1265
|
-
| `electron` |
|
|
1266
|
-
| `chrome` |
|
|
1267
|
-
| `edge` |
|
|
1268
|
-
| `firefox` |
|
|
1269
|
-
| `opera` |
|
|
1270
|
-
| `win` |
|
|
1271
|
-
| `mac` |
|
|
1272
|
-
| `linux` |
|
|
1273
|
-
| `touch` |
|
|
1274
|
-
| `ssr` |
|
|
1275
|
-
|
|
1276
|
-
###
|
|
1585
|
+
| `android` | an Android device |
|
|
1586
|
+
| `ios` | an iOS device (iPhone / iPad / iPod) |
|
|
1587
|
+
| `cordova` | the app runs in Cordova |
|
|
1588
|
+
| `electron` | the app runs in Electron |
|
|
1589
|
+
| `chrome` | Chrome browser |
|
|
1590
|
+
| `edge` | Edge browser |
|
|
1591
|
+
| `firefox` | Firefox browser |
|
|
1592
|
+
| `opera` | Opera browser |
|
|
1593
|
+
| `win` | Windows OS |
|
|
1594
|
+
| `mac` | macOS |
|
|
1595
|
+
| `linux` | Linux OS |
|
|
1596
|
+
| `touch` | the device supports touch |
|
|
1597
|
+
| `ssr` | the value was computed on the server (SSR) |
|
|
1598
|
+
|
|
1599
|
+
### Example: a class on the app root
|
|
1277
1600
|
|
|
1278
1601
|
```tsx
|
|
1279
1602
|
import { useDisplay } from '@central-design-system/components';
|
|
@@ -1293,15 +1616,1151 @@ defineRender(() => (
|
|
|
1293
1616
|
));
|
|
1294
1617
|
```
|
|
1295
1618
|
|
|
1296
|
-
>
|
|
1297
|
-
>
|
|
1298
|
-
> `platform`
|
|
1299
|
-
>
|
|
1300
|
-
>
|
|
1619
|
+
> **Careful with user-agent sniffing.** Detecting the browser or OS from
|
|
1620
|
+
> `userAgent` is unreliable (the string can be spoofed, and new browsers may not
|
|
1621
|
+
> be recognized). Use `platform` for progressive enhancement — say, a fix
|
|
1622
|
+
> specific to iOS Safari — not as the only gate in front of a feature. For
|
|
1623
|
+
> feature detection, prefer capability checks (`'ontouchstart' in window` and the
|
|
1624
|
+
> like).
|
|
1301
1625
|
|
|
1302
1626
|
### SSR
|
|
1303
1627
|
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
`display.update()` (
|
|
1307
|
-
|
|
1628
|
+
During server-side rendering `userAgent` is unavailable, so `platform.ssr === true`
|
|
1629
|
+
and the rest of the flags are `false`. After hydration the values can be
|
|
1630
|
+
recalculated by calling `display.update()` (which recalculates both size and
|
|
1631
|
+
platform). Initial sizes for SSR are set through the second argument of
|
|
1632
|
+
`createDisplay(options, ssr)` or the `ssr` option in `createCds`.
|
|
1633
|
+
|
|
1634
|
+
---
|
|
1635
|
+
|
|
1636
|
+
---
|
|
1637
|
+
sourceHash: 49864e870f2f989420a5ebf7ffc7eb1a3458124a
|
|
1638
|
+
---
|
|
1639
|
+
|
|
1640
|
+
# Global configuration
|
|
1641
|
+
|
|
1642
|
+
CDS 4 lets you set default prop values — globally, for a specific component, or
|
|
1643
|
+
only inside a given subtree. You describe "what buttons look like in our product"
|
|
1644
|
+
once and stop repeating the same props in every template.
|
|
1645
|
+
|
|
1646
|
+
## Setup
|
|
1647
|
+
|
|
1648
|
+
Default values are set through the `defaults` option of `createCds`. The `global`
|
|
1649
|
+
key affects every component; a key named after a component affects only that one.
|
|
1650
|
+
|
|
1651
|
+
```ts
|
|
1652
|
+
import { createApp } from 'vue';
|
|
1653
|
+
import '@central-design-system/components/styles';
|
|
1654
|
+
import { createCds, components, directives } from '@central-design-system/components';
|
|
1655
|
+
|
|
1656
|
+
import App from './App.vue';
|
|
1657
|
+
|
|
1658
|
+
const cds = createCds({
|
|
1659
|
+
components,
|
|
1660
|
+
directives,
|
|
1661
|
+
defaults: {
|
|
1662
|
+
global: {
|
|
1663
|
+
size: 'sm'
|
|
1664
|
+
},
|
|
1665
|
+
CdsButton: {
|
|
1666
|
+
appearance: 'secondary'
|
|
1667
|
+
},
|
|
1668
|
+
CdsTextInput: {
|
|
1669
|
+
hideDetails: 'auto'
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
});
|
|
1673
|
+
|
|
1674
|
+
createApp(App).use(cds);
|
|
1675
|
+
```
|
|
1676
|
+
|
|
1677
|
+
**Important.** Props in `defaults` are written in camelCase: `hideDetails`, not
|
|
1678
|
+
`hide-details`.
|
|
1679
|
+
|
|
1680
|
+
A component key is its name from `defineOptions({ name })` — `CdsButton`,
|
|
1681
|
+
`CdsTextInput`, `CdsCardActions` and so on. Subcomponent names (`CdsCardTitle`,
|
|
1682
|
+
`CdsListItem`) work exactly like root component names.
|
|
1683
|
+
|
|
1684
|
+
### Resolution order
|
|
1685
|
+
|
|
1686
|
+
For every prop, CDS takes the first value that applies:
|
|
1687
|
+
|
|
1688
|
+
1. the prop explicitly passed in the template;
|
|
1689
|
+
2. `defaults.<ComponentName>.<prop>` from the nearest defaults context;
|
|
1690
|
+
3. `defaults.global.<prop>`;
|
|
1691
|
+
4. the default value declared in the component itself.
|
|
1692
|
+
|
|
1693
|
+
An explicitly passed prop always wins — defaults can never override the template.
|
|
1694
|
+
|
|
1695
|
+
### Changing defaults at runtime
|
|
1696
|
+
|
|
1697
|
+
`createCds` returns an instance whose defaults live in a reactive ref. You can
|
|
1698
|
+
change them on the fly — every mounted component recalculates:
|
|
1699
|
+
|
|
1700
|
+
```ts
|
|
1701
|
+
const cds = createCds({ components, directives });
|
|
1702
|
+
|
|
1703
|
+
// for example, turn on compact mode based on a user setting
|
|
1704
|
+
cds.defaults.value = {
|
|
1705
|
+
...cds.defaults.value,
|
|
1706
|
+
global: { size: 'sm' }
|
|
1707
|
+
};
|
|
1708
|
+
```
|
|
1709
|
+
|
|
1710
|
+
## Contextual defaults
|
|
1711
|
+
|
|
1712
|
+
Defaults can be set for components nested inside another component. For example,
|
|
1713
|
+
to make every button inside a card secondary by default:
|
|
1714
|
+
|
|
1715
|
+
```ts
|
|
1716
|
+
createCds({
|
|
1717
|
+
defaults: {
|
|
1718
|
+
CdsCard: {
|
|
1719
|
+
CdsButton: { appearance: 'secondary' }
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
});
|
|
1723
|
+
```
|
|
1724
|
+
|
|
1725
|
+
The rule is simple: a capitalized key is the name of a nested component, a
|
|
1726
|
+
lowercase key is a prop of the current component. Nesting is not limited to one
|
|
1727
|
+
level:
|
|
1728
|
+
|
|
1729
|
+
```ts
|
|
1730
|
+
createCds({
|
|
1731
|
+
defaults: {
|
|
1732
|
+
CdsCard: {
|
|
1733
|
+
CdsCardActions: {
|
|
1734
|
+
CdsButton: { appearance: 'tertiary', size: 'sm' }
|
|
1735
|
+
}
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
});
|
|
1739
|
+
```
|
|
1740
|
+
|
|
1741
|
+
The library uses the same mechanism internally so that grouping components can
|
|
1742
|
+
hand their settings down to their children:
|
|
1743
|
+
|
|
1744
|
+
- `CdsButtonGroup` sets the `appearance`, `color`, `baseColor`, `size` props on nested `CdsButton`s;
|
|
1745
|
+
- `CdsTagGroup` sets the `color`, `activeColor`, `disabled`, `filter` props on `CdsTag`;
|
|
1746
|
+
- `CdsSelectionControlGroup` passes settings to the controls, with the target component name
|
|
1747
|
+
set by the `defaultsTarget` prop (`CdsCheckbox`, `CdsRadio` and so on);
|
|
1748
|
+
- `CdsTabs`, `CdsSteps`, `CdsList`, `CdsBreadcrumbs`, `CdsButtonToggle`,
|
|
1749
|
+
`CdsExpandablePanels`, `CdsOtpInput` work the same way.
|
|
1750
|
+
|
|
1751
|
+
That's why `<CdsButtonGroup size="sm">` makes every button inside small — you
|
|
1752
|
+
don't have to set `size` on each of them.
|
|
1753
|
+
|
|
1754
|
+
## Global class and style
|
|
1755
|
+
|
|
1756
|
+
Besides props, a component's defaults can carry `class` and `style`. It's a
|
|
1757
|
+
convenient way to apply product-specific rules to every instance of a component
|
|
1758
|
+
without touching the templates:
|
|
1759
|
+
|
|
1760
|
+
```ts
|
|
1761
|
+
createCds({
|
|
1762
|
+
defaults: {
|
|
1763
|
+
CdsButton: {
|
|
1764
|
+
class: 'my-button'
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
});
|
|
1768
|
+
```
|
|
1769
|
+
|
|
1770
|
+
Any value Vue accepts works — a string, an object, an array:
|
|
1771
|
+
|
|
1772
|
+
```ts
|
|
1773
|
+
createCds({
|
|
1774
|
+
defaults: {
|
|
1775
|
+
CdsButton: {
|
|
1776
|
+
style: [{ textTransform: 'none' }]
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
});
|
|
1780
|
+
```
|
|
1781
|
+
|
|
1782
|
+
Unlike ordinary props, `class` and `style` are not overwritten by the template
|
|
1783
|
+
but **merged** with it. So `<CdsButton class="mt-2">` gets both `my-button` and
|
|
1784
|
+
`mt-2`.
|
|
1785
|
+
|
|
1786
|
+
**Important.** `class` and `style` only work under a specific component's key. In
|
|
1787
|
+
`global` they are ignored.
|
|
1788
|
+
|
|
1789
|
+
## Aliases
|
|
1790
|
+
|
|
1791
|
+
An alias is the same component registered under a different name with its own
|
|
1792
|
+
defaults. Aliases are a handy way to assemble "product" variants of components.
|
|
1793
|
+
|
|
1794
|
+
```ts
|
|
1795
|
+
import { createCds, components, directives, CdsButton } from '@central-design-system/components';
|
|
1796
|
+
|
|
1797
|
+
const cds = createCds({
|
|
1798
|
+
components,
|
|
1799
|
+
directives,
|
|
1800
|
+
aliases: {
|
|
1801
|
+
CdsButtonPrimary: CdsButton,
|
|
1802
|
+
CdsButtonDanger: CdsButton
|
|
1803
|
+
},
|
|
1804
|
+
defaults: {
|
|
1805
|
+
CdsButtonPrimary: {
|
|
1806
|
+
appearance: 'primary',
|
|
1807
|
+
class: 'my-button--primary'
|
|
1808
|
+
},
|
|
1809
|
+
CdsButtonDanger: {
|
|
1810
|
+
appearance: 'primary',
|
|
1811
|
+
color: 'red',
|
|
1812
|
+
class: 'my-button--danger'
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
});
|
|
1816
|
+
```
|
|
1817
|
+
|
|
1818
|
+
Aliases are registered globally, so you can use them in templates right away:
|
|
1819
|
+
|
|
1820
|
+
```vue
|
|
1821
|
+
<template>
|
|
1822
|
+
<CdsButtonPrimary>Save</CdsButtonPrimary>
|
|
1823
|
+
<CdsButtonDanger class="ml-2">Delete</CdsButtonDanger>
|
|
1824
|
+
</template>
|
|
1825
|
+
```
|
|
1826
|
+
|
|
1827
|
+
**Important.** An alias does not inherit the base component's defaults. If the
|
|
1828
|
+
configuration has `defaults.CdsButton`, it will not apply to `<CdsButtonPrimary>`
|
|
1829
|
+
— defaults are looked up by the alias name. Move shared settings into `global` or
|
|
1830
|
+
duplicate them under the alias key.
|
|
1831
|
+
|
|
1832
|
+
## Defaults for part of the application
|
|
1833
|
+
|
|
1834
|
+
To set defaults for a subtree rather than globally, use the
|
|
1835
|
+
`CdsDefaultsProvider` component. The Controls panel in Storybook is built on it
|
|
1836
|
+
too: the values from the panel are applied to the example's components as
|
|
1837
|
+
defaults.
|
|
1838
|
+
|
|
1839
|
+
```vue
|
|
1840
|
+
<script setup lang="ts">
|
|
1841
|
+
import { CdsButton, CdsDefaultsProvider } from '@central-design-system/components';
|
|
1842
|
+
</script>
|
|
1843
|
+
|
|
1844
|
+
<template>
|
|
1845
|
+
<CdsDefaultsProvider :defaults="{ CdsButton: { appearance: 'tertiary', size: 'sm' } }">
|
|
1846
|
+
<CdsButton>Small tertiary button</CdsButton>
|
|
1847
|
+
</CdsDefaultsProvider>
|
|
1848
|
+
</template>
|
|
1849
|
+
```
|
|
1850
|
+
|
|
1851
|
+
| Prop | Type | Purpose |
|
|
1852
|
+
| ---------- | ------------------- | -------------------------------------------------------------------------------------------- |
|
|
1853
|
+
| `defaults` | `DefaultsOptions` | Defaults for the subtree; merged with the inherited ones by default |
|
|
1854
|
+
| `scoped` | `boolean` | Don't mix with the parent defaults — only the ones set here apply |
|
|
1855
|
+
| `reset` | `number \| string` | Go N levels up the defaults chain |
|
|
1856
|
+
| `root` | `boolean \| string` | Fall back to the root defaults from `createCds`; with a string — to a named group inside them |
|
|
1857
|
+
| `disabled` | `boolean` | Provide nothing — the subtree gets the parent defaults as they are |
|
|
1858
|
+
|
|
1859
|
+
The typical use for `scoped` is an "island" inside someone else's environment:
|
|
1860
|
+
enclosing groups (`CdsButtonGroup`, say) should not impose their settings on your
|
|
1861
|
+
block.
|
|
1862
|
+
|
|
1863
|
+
## Your own components
|
|
1864
|
+
|
|
1865
|
+
Your application's own components can take part in the defaults system too. Pass
|
|
1866
|
+
their props through `useDefaults`:
|
|
1867
|
+
|
|
1868
|
+
```vue
|
|
1869
|
+
<script setup lang="ts">
|
|
1870
|
+
import { useDefaults } from '@central-design-system/components';
|
|
1871
|
+
|
|
1872
|
+
const _props = defineProps<{ foo?: string }>();
|
|
1873
|
+
const props = useDefaults(_props, 'MyComponent');
|
|
1874
|
+
</script>
|
|
1875
|
+
|
|
1876
|
+
<template>
|
|
1877
|
+
<div>I am {{ props.foo }}</div>
|
|
1878
|
+
</template>
|
|
1879
|
+
```
|
|
1880
|
+
|
|
1881
|
+
`useDefaults` takes two arguments, both optional:
|
|
1882
|
+
|
|
1883
|
+
- `props` — the props object returned by `defineProps`;
|
|
1884
|
+
- `name` — the component name used to look up the key in `defaults`. If omitted,
|
|
1885
|
+
the name from `defineOptions({ name })` is used, and failing that, the file name.
|
|
1886
|
+
|
|
1887
|
+
Now the component is configurable from the shared configuration:
|
|
1888
|
+
|
|
1889
|
+
```ts
|
|
1890
|
+
createCds({
|
|
1891
|
+
defaults: {
|
|
1892
|
+
MyComponent: { foo: 'bar' }
|
|
1893
|
+
}
|
|
1894
|
+
});
|
|
1895
|
+
```
|
|
1896
|
+
|
|
1897
|
+
**Important.** In the template, refer to `props.foo`, not `foo`. `useDefaults`
|
|
1898
|
+
returns a proxy over the props, and destructured `defineProps` variables bypass
|
|
1899
|
+
it:
|
|
1900
|
+
|
|
1901
|
+
```diff
|
|
1902
|
+
-<div>I am {{ foo }}</div>
|
|
1903
|
+
+<div>I am {{ props.foo }}</div>
|
|
1904
|
+
```
|
|
1905
|
+
|
|
1906
|
+
### Nested defaults in your own components
|
|
1907
|
+
|
|
1908
|
+
To make your component hand defaults down to its children (the way
|
|
1909
|
+
`CdsButtonGroup` does), just call `useDefaults()` with no arguments — the nested
|
|
1910
|
+
keys from its `defaults` section go into the child context:
|
|
1911
|
+
|
|
1912
|
+
```vue
|
|
1913
|
+
<script setup lang="ts">
|
|
1914
|
+
import { useDefaults } from '@central-design-system/components';
|
|
1915
|
+
|
|
1916
|
+
useDefaults();
|
|
1917
|
+
</script>
|
|
1918
|
+
|
|
1919
|
+
<template>
|
|
1920
|
+
<div class="my-panel">
|
|
1921
|
+
<slot />
|
|
1922
|
+
</div>
|
|
1923
|
+
</template>
|
|
1924
|
+
```
|
|
1925
|
+
|
|
1926
|
+
```ts
|
|
1927
|
+
createCds({
|
|
1928
|
+
defaults: {
|
|
1929
|
+
MyPanel: {
|
|
1930
|
+
CdsButton: { appearance: 'tertiary' }
|
|
1931
|
+
}
|
|
1932
|
+
}
|
|
1933
|
+
});
|
|
1934
|
+
```
|
|
1935
|
+
|
|
1936
|
+
If the children's defaults depend on the component's props, use `provideDefaults`
|
|
1937
|
+
directly:
|
|
1938
|
+
|
|
1939
|
+
```vue
|
|
1940
|
+
<script setup lang="ts">
|
|
1941
|
+
import { provideDefaults } from '@central-design-system/components';
|
|
1942
|
+
import { toRef } from 'vue';
|
|
1943
|
+
|
|
1944
|
+
const props = defineProps<{ size?: 'sm' | 'md' }>();
|
|
1945
|
+
|
|
1946
|
+
provideDefaults({
|
|
1947
|
+
CdsButton: {
|
|
1948
|
+
size: toRef(() => props.size)
|
|
1949
|
+
}
|
|
1950
|
+
});
|
|
1951
|
+
</script>
|
|
1952
|
+
|
|
1953
|
+
<template>
|
|
1954
|
+
<div class="my-toolbar">
|
|
1955
|
+
<slot />
|
|
1956
|
+
</div>
|
|
1957
|
+
</template>
|
|
1958
|
+
```
|
|
1959
|
+
|
|
1960
|
+
## Blueprint — a configuration preset
|
|
1961
|
+
|
|
1962
|
+
If several applications need the same set of options, extract it into a
|
|
1963
|
+
`blueprint`: a plain `createCds` options object that the rest of the
|
|
1964
|
+
configuration is layered on top of.
|
|
1965
|
+
|
|
1966
|
+
```ts
|
|
1967
|
+
import { createCds, components, directives } from '@central-design-system/components';
|
|
1968
|
+
import type { Blueprint } from '@central-design-system/components';
|
|
1969
|
+
|
|
1970
|
+
const productBlueprint: Blueprint = {
|
|
1971
|
+
theme: { defaultTheme: 'b2bLight' },
|
|
1972
|
+
defaults: {
|
|
1973
|
+
CdsButton: { appearance: 'secondary' }
|
|
1974
|
+
}
|
|
1975
|
+
};
|
|
1976
|
+
|
|
1977
|
+
const cds = createCds({
|
|
1978
|
+
blueprint: productBlueprint,
|
|
1979
|
+
components,
|
|
1980
|
+
directives,
|
|
1981
|
+
// overrides the value from the blueprint
|
|
1982
|
+
defaults: {
|
|
1983
|
+
CdsButton: { size: 'sm' }
|
|
1984
|
+
}
|
|
1985
|
+
});
|
|
1986
|
+
```
|
|
1987
|
+
|
|
1988
|
+
Options are merged deeply (`mergeDeep`), so in the example above the buttons keep
|
|
1989
|
+
`appearance: 'secondary'` from the preset and gain `size: 'sm'`.
|
|
1990
|
+
|
|
1991
|
+
---
|
|
1992
|
+
|
|
1993
|
+
---
|
|
1994
|
+
sourceHash: 26c790bd53cd55729b9902cf5d1032b5c6457f6b
|
|
1995
|
+
---
|
|
1996
|
+
|
|
1997
|
+
# Internationalization (i18n)
|
|
1998
|
+
|
|
1999
|
+
CDS components carry texts of their own: "No data available" in a select, the
|
|
2000
|
+
table filter labels, the `aria-label` of a close button, the file counter. They
|
|
2001
|
+
all go through the built-in localization layer, so you can translate them into
|
|
2002
|
+
another language, override a single string for your product, or switch languages
|
|
2003
|
+
on the fly — without rewriting components.
|
|
2004
|
+
|
|
2005
|
+
The library ships two dictionaries — Russian and English. `ru` is active by
|
|
2006
|
+
default, so out of the box everything is in Russian.
|
|
2007
|
+
|
|
2008
|
+
## Setup
|
|
2009
|
+
|
|
2010
|
+
The locale is configured through the `locale` option of `createCds`. Switching to
|
|
2011
|
+
the built-in English is a one-liner — you don't need to pass any dictionaries:
|
|
2012
|
+
|
|
2013
|
+
```ts
|
|
2014
|
+
import { createApp } from 'vue';
|
|
2015
|
+
import '@central-design-system/components/styles';
|
|
2016
|
+
import { createCds, components, directives } from '@central-design-system/components';
|
|
2017
|
+
|
|
2018
|
+
import App from './App.vue';
|
|
2019
|
+
|
|
2020
|
+
const cds = createCds({
|
|
2021
|
+
components,
|
|
2022
|
+
directives,
|
|
2023
|
+
locale: {
|
|
2024
|
+
locale: 'en'
|
|
2025
|
+
}
|
|
2026
|
+
});
|
|
2027
|
+
|
|
2028
|
+
createApp(App).use(cds);
|
|
2029
|
+
```
|
|
2030
|
+
|
|
2031
|
+
Languages the library doesn't have are added as a dictionary in `messages`:
|
|
2032
|
+
|
|
2033
|
+
```ts
|
|
2034
|
+
import de from './locales/cds-de';
|
|
2035
|
+
|
|
2036
|
+
createCds({
|
|
2037
|
+
components,
|
|
2038
|
+
directives,
|
|
2039
|
+
locale: {
|
|
2040
|
+
locale: 'de',
|
|
2041
|
+
fallback: 'en',
|
|
2042
|
+
messages: { de }
|
|
2043
|
+
}
|
|
2044
|
+
});
|
|
2045
|
+
```
|
|
2046
|
+
|
|
2047
|
+
| Option | Type | Purpose |
|
|
2048
|
+
| ------------------ | ------------------------- | ----------------------------------------------------------------------------- |
|
|
2049
|
+
| `locale` | `string` | Active language; `ru` (default) and `en` are available out of the box |
|
|
2050
|
+
| `fallback` | `string` | Language a string is taken from when the active one lacks it; `ru` by default |
|
|
2051
|
+
| `messages` | `LocaleMessages` | Dictionaries of extra languages; a same-named built-in dictionary is replaced entirely |
|
|
2052
|
+
| `decimalSeparator` | `string` | Decimal separator; derived from the active locale by default |
|
|
2053
|
+
| `rtl` | `Record<string, boolean>` | Map of right-to-left languages (see [RTL](#rtl)) |
|
|
2054
|
+
| `adapter` | `LocaleInstance` | Your own translation engine instead of the built-in one (see [Custom adapter](#custom-adapter)) |
|
|
2055
|
+
|
|
2056
|
+
The built-in dictionaries are available to you as well — they live in the
|
|
2057
|
+
`locales` export. Use them as a base for your own language or to fix a couple of
|
|
2058
|
+
strings:
|
|
2059
|
+
|
|
2060
|
+
```ts
|
|
2061
|
+
import { locales } from '@central-design-system/components';
|
|
2062
|
+
|
|
2063
|
+
locales.ru; // Russian dictionary
|
|
2064
|
+
locales.en; // English dictionary
|
|
2065
|
+
```
|
|
2066
|
+
|
|
2067
|
+
For the full set of keys, see [Message keys](#message-keys).
|
|
2068
|
+
|
|
2069
|
+
## How components get their text
|
|
2070
|
+
|
|
2071
|
+
Component strings are keys prefixed with `$cds.` that the library runs through a
|
|
2072
|
+
translation function. Some of the keys are declared as default prop values, so
|
|
2073
|
+
you can see them in the API: `text` on `CdsFileUpload` is `$cds.fileUpload.browse`,
|
|
2074
|
+
`closeLabel` on `CdsNotification` is `$cds.close`, `noDataText` on `CdsSelect` is
|
|
2075
|
+
`$cds.noDataText`.
|
|
2076
|
+
|
|
2077
|
+
That gives you three ways to change a text.
|
|
2078
|
+
|
|
2079
|
+
**Switch the whole language** — with the `locale` option:
|
|
2080
|
+
|
|
2081
|
+
```ts
|
|
2082
|
+
createCds({ locale: { locale: 'en' } });
|
|
2083
|
+
```
|
|
2084
|
+
|
|
2085
|
+
**Change wording across the product** — with a dictionary on top of the built-in
|
|
2086
|
+
one:
|
|
2087
|
+
|
|
2088
|
+
```ts
|
|
2089
|
+
import { createCds, locales } from '@central-design-system/components';
|
|
2090
|
+
|
|
2091
|
+
createCds({
|
|
2092
|
+
locale: {
|
|
2093
|
+
messages: {
|
|
2094
|
+
en: { ...locales.en, noDataText: 'Nothing found' }
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
});
|
|
2098
|
+
```
|
|
2099
|
+
|
|
2100
|
+
**Important.** A language dictionary is replaced entirely, not merged key by key.
|
|
2101
|
+
Without the `...locales.en` spread, the English locale is left with a single key
|
|
2102
|
+
and the rest of the strings turn into their own keys (`$cds.close` instead of
|
|
2103
|
+
"Close"). Spread nested sections separately:
|
|
2104
|
+
`table: { ...locales.en.table, emptyText: '…' }`.
|
|
2105
|
+
|
|
2106
|
+
**Change one label in one place** — with a prop:
|
|
2107
|
+
|
|
2108
|
+
```vue
|
|
2109
|
+
<CdsSelect :items="items" no-data-text="No matching suppliers" />
|
|
2110
|
+
```
|
|
2111
|
+
|
|
2112
|
+
The same prop can be set as the default for every instance of the component — see
|
|
2113
|
+
global configuration:
|
|
2114
|
+
|
|
2115
|
+
```ts
|
|
2116
|
+
createCds({
|
|
2117
|
+
defaults: {
|
|
2118
|
+
CdsSelect: { noDataText: 'Nothing found' }
|
|
2119
|
+
}
|
|
2120
|
+
});
|
|
2121
|
+
```
|
|
2122
|
+
|
|
2123
|
+
The translation function also accepts plain text: a string without the `$cds.`
|
|
2124
|
+
prefix is returned as is, with the parameters substituted. That's how props with
|
|
2125
|
+
a localizable value work the same way with a key and with a ready-made phrase.
|
|
2126
|
+
|
|
2127
|
+
If a key is missing from both the active locale and the `fallback`, the component
|
|
2128
|
+
shows the key itself, and in dev mode a
|
|
2129
|
+
`[CDS: useLocale] Translation key … not found` warning appears in the console.
|
|
2130
|
+
|
|
2131
|
+
## Switching the language at runtime
|
|
2132
|
+
|
|
2133
|
+
`createCds` returns an instance whose locale lives in reactive refs — to switch
|
|
2134
|
+
languages, just write to `current`:
|
|
2135
|
+
|
|
2136
|
+
```ts
|
|
2137
|
+
const cds = createCds({ components, directives });
|
|
2138
|
+
|
|
2139
|
+
// for example, following the user's choice in profile settings
|
|
2140
|
+
cds.locale.current.value = 'en';
|
|
2141
|
+
```
|
|
2142
|
+
|
|
2143
|
+
Inside components, the `useLocale` composable does the same:
|
|
2144
|
+
|
|
2145
|
+
```vue
|
|
2146
|
+
<script setup lang="ts">
|
|
2147
|
+
import { CdsButton, CdsButtonToggle, useLocale } from '@central-design-system/components';
|
|
2148
|
+
|
|
2149
|
+
const { current } = useLocale();
|
|
2150
|
+
</script>
|
|
2151
|
+
|
|
2152
|
+
<template>
|
|
2153
|
+
<CdsButtonToggle v-model="current" appearance="tertiary">
|
|
2154
|
+
<CdsButton value="ru" text="Русский" />
|
|
2155
|
+
<CdsButton value="en" text="English" />
|
|
2156
|
+
</CdsButtonToggle>
|
|
2157
|
+
</template>
|
|
2158
|
+
```
|
|
2159
|
+
|
|
2160
|
+
Every mounted component recalculates its strings on its own — no page reload
|
|
2161
|
+
needed.
|
|
2162
|
+
|
|
2163
|
+
## A locale for part of the application
|
|
2164
|
+
|
|
2165
|
+
A single subtree can get its own language — for example, an English-language
|
|
2166
|
+
widget inside a Russian interface. Call `provideLocale` in a wrapper component:
|
|
2167
|
+
it takes the locale from the context, applies the props you passed and provides
|
|
2168
|
+
the result to the children.
|
|
2169
|
+
|
|
2170
|
+
```vue
|
|
2171
|
+
<script setup lang="ts">
|
|
2172
|
+
import { provideLocale } from '@central-design-system/components';
|
|
2173
|
+
|
|
2174
|
+
const props = defineProps<{ locale?: string; fallback?: string }>();
|
|
2175
|
+
|
|
2176
|
+
provideLocale(props);
|
|
2177
|
+
</script>
|
|
2178
|
+
|
|
2179
|
+
<template>
|
|
2180
|
+
<div>
|
|
2181
|
+
<slot />
|
|
2182
|
+
</div>
|
|
2183
|
+
</template>
|
|
2184
|
+
```
|
|
2185
|
+
|
|
2186
|
+
```vue
|
|
2187
|
+
<template>
|
|
2188
|
+
<LocaleProvider locale="en">
|
|
2189
|
+
<CdsSelect :items="items" />
|
|
2190
|
+
</LocaleProvider>
|
|
2191
|
+
</template>
|
|
2192
|
+
```
|
|
2193
|
+
|
|
2194
|
+
Props you don't pass are inherited from the parent locale, so a wrapper with just
|
|
2195
|
+
a `locale` loses neither the `fallback` nor the dictionaries.
|
|
2196
|
+
|
|
2197
|
+
## useLocale
|
|
2198
|
+
|
|
2199
|
+
The composable hands you the current locale and its functions — use it in your
|
|
2200
|
+
own components so their texts live in the same dictionaries as the CDS ones.
|
|
2201
|
+
|
|
2202
|
+
```vue
|
|
2203
|
+
<script setup lang="ts">
|
|
2204
|
+
import { useLocale } from '@central-design-system/components';
|
|
2205
|
+
|
|
2206
|
+
const { t, n } = useLocale();
|
|
2207
|
+
</script>
|
|
2208
|
+
|
|
2209
|
+
<template>
|
|
2210
|
+
<p>{{ t('$cds.table.emptyText') }}</p>
|
|
2211
|
+
<p>{{ n(1234.56) }}</p>
|
|
2212
|
+
</template>
|
|
2213
|
+
```
|
|
2214
|
+
|
|
2215
|
+
| Property | Type | Purpose |
|
|
2216
|
+
| ------------------ | ---------------------------------------------- | ------------------------------------------------------------- |
|
|
2217
|
+
| `t` | `(key: string, ...params: unknown[]) => string` | Translation of a `$cds.…` key with parameter substitution |
|
|
2218
|
+
| `n` | `(value: number) => string` | Number formatting for the active locale |
|
|
2219
|
+
| `current` | `Ref<string>` | Active language; writing to it switches the language |
|
|
2220
|
+
| `fallback` | `Ref<string>` | Fallback language |
|
|
2221
|
+
| `messages` | `Ref<LocaleMessages>` | Dictionaries; can be extended at runtime |
|
|
2222
|
+
| `decimalSeparator` | `ShallowRef<string>` | Decimal separator of the active locale |
|
|
2223
|
+
|
|
2224
|
+
Parameters in strings are numbered — `{0}`, `{1}`:
|
|
2225
|
+
|
|
2226
|
+
```ts
|
|
2227
|
+
const { t } = useLocale();
|
|
2228
|
+
|
|
2229
|
+
t('$cds.carousel.delimiter', 3, 8); // "Slide 3 of 8"
|
|
2230
|
+
t('Days left: {0}', 5); // "Days left: 5"
|
|
2231
|
+
```
|
|
2232
|
+
|
|
2233
|
+
Under the hood `n` is `Intl.NumberFormat` with the active locale and the
|
|
2234
|
+
`fallback`, so group and decimal separators come from the browser. The library
|
|
2235
|
+
derives `decimalSeparator` from the same locale (`,` for `ru`, `.` for `en`); if
|
|
2236
|
+
your product uses a different one, set it explicitly in `createCds`.
|
|
2237
|
+
|
|
2238
|
+
## Dates
|
|
2239
|
+
|
|
2240
|
+
Month and weekday names live in separate date locales, shipped by `ru` and `en`.
|
|
2241
|
+
Date and time components pick the date locale by the active language, so after
|
|
2242
|
+
`current.value = 'en'` the calendar switches by itself.
|
|
2243
|
+
|
|
2244
|
+
A single component gets its language from the `locale` prop — `CdsDatePicker`,
|
|
2245
|
+
`CdsDateInput` and `CdsTimePicker` all have it:
|
|
2246
|
+
|
|
2247
|
+
```vue
|
|
2248
|
+
<CdsDatePicker v-model="value" locale="en" :first-day-of-week="0" header />
|
|
2249
|
+
```
|
|
2250
|
+
|
|
2251
|
+
The prop accepts not only a language name but also your own date locale object
|
|
2252
|
+
(type `TDateLocale`) — that's how you plug in a language the library doesn't
|
|
2253
|
+
have. The built-in date locales, for reference and reuse, live in the same
|
|
2254
|
+
`locales` export: `locales.ruDate`, `locales.enDate` and the `locales.dateLocales`
|
|
2255
|
+
map.
|
|
2256
|
+
|
|
2257
|
+
```ts
|
|
2258
|
+
const de = {
|
|
2259
|
+
days: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
|
|
2260
|
+
daysShort: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
|
|
2261
|
+
months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
|
|
2262
|
+
monthsLong: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
|
|
2263
|
+
monthsShort: 'Jan_Feb_Mär_Apr_Mai_Jun_Jul_Aug_Sep_Okt_Nov_Dez'.split('_'),
|
|
2264
|
+
today: 'Heute',
|
|
2265
|
+
now: 'Jetzt',
|
|
2266
|
+
firstDayOfWeek: 1,
|
|
2267
|
+
format24h: true,
|
|
2268
|
+
pluralDay: (day = 0) => (day === 1 ? 'Tag' : 'Tage')
|
|
2269
|
+
};
|
|
2270
|
+
```
|
|
2271
|
+
|
|
2272
|
+
```vue
|
|
2273
|
+
<CdsDatePicker v-model="value" :locale="de" />
|
|
2274
|
+
```
|
|
2275
|
+
|
|
2276
|
+
## Table
|
|
2277
|
+
|
|
2278
|
+
`CdsTable` builds its labels from the `$cds.table.*` keys, but it also accepts a
|
|
2279
|
+
pinpoint override through the `locale` prop — which replaces only the strings you
|
|
2280
|
+
pass:
|
|
2281
|
+
|
|
2282
|
+
```vue
|
|
2283
|
+
<CdsTable :columns="columns" :data="data" :locale="{ emptyText: 'No requests yet' }" />
|
|
2284
|
+
```
|
|
2285
|
+
|
|
2286
|
+
## RTL
|
|
2287
|
+
|
|
2288
|
+
Right-to-left languages are described by the `rtl` map: the key is the language,
|
|
2289
|
+
the value is the direction.
|
|
2290
|
+
|
|
2291
|
+
```ts
|
|
2292
|
+
createCds({
|
|
2293
|
+
locale: {
|
|
2294
|
+
locale: 'ar',
|
|
2295
|
+
messages: { ar },
|
|
2296
|
+
rtl: { ar: true }
|
|
2297
|
+
}
|
|
2298
|
+
});
|
|
2299
|
+
```
|
|
2300
|
+
|
|
2301
|
+
Components read the direction through `useRtl` and flip whatever depends on the
|
|
2302
|
+
axis: the side menus and tooltips open to, the pagination arrows, the cell order
|
|
2303
|
+
in `CdsOtpInput`, the fill of `CdsProgressBar`. Spacing and borders in the styles
|
|
2304
|
+
are mostly written with logical properties (`margin-inline`, `inset-inline`) and
|
|
2305
|
+
are mirrored by the browser itself — but the design system does not claim full
|
|
2306
|
+
RTL support yet, and some places will need polishing on your side.
|
|
2307
|
+
|
|
2308
|
+
The library does not set the direction attribute for you — put it on the
|
|
2309
|
+
application root yourself:
|
|
2310
|
+
|
|
2311
|
+
```vue
|
|
2312
|
+
<script setup lang="ts">
|
|
2313
|
+
import { useRtl } from '@central-design-system/components';
|
|
2314
|
+
|
|
2315
|
+
const { isRtl } = useRtl();
|
|
2316
|
+
</script>
|
|
2317
|
+
|
|
2318
|
+
<template>
|
|
2319
|
+
<div :dir="isRtl ? 'rtl' : 'ltr'">
|
|
2320
|
+
<slot />
|
|
2321
|
+
</div>
|
|
2322
|
+
</template>
|
|
2323
|
+
```
|
|
2324
|
+
|
|
2325
|
+
`useRtl` gives you `isRtl` and `rtlClasses` — a ready `cds-locale--is-rtl` /
|
|
2326
|
+
`cds-locale--is-ltr` class for your own styles.
|
|
2327
|
+
|
|
2328
|
+
## Custom adapter
|
|
2329
|
+
|
|
2330
|
+
If your application already has an i18n library, hand the translations over to
|
|
2331
|
+
it: the `adapter` option accepts any object implementing the `LocaleInstance`
|
|
2332
|
+
interface. In that case `messages`, `locale` and `fallback` from `createCds` are
|
|
2333
|
+
unused — your engine becomes the source of truth, and the CDS strings live in the
|
|
2334
|
+
application's shared dictionaries under the `$cds` key.
|
|
2335
|
+
|
|
2336
|
+
```ts
|
|
2337
|
+
import type { LocaleInstance, LocaleOptions } from '@central-design-system/components';
|
|
2338
|
+
import { toRef } from 'vue';
|
|
2339
|
+
import type { I18n } from 'vue-i18n';
|
|
2340
|
+
|
|
2341
|
+
export function createVueI18nAdapter(i18n: I18n<any, any, any, string, false>): LocaleInstance {
|
|
2342
|
+
const format = (value: number) => i18n.global.n(value);
|
|
2343
|
+
|
|
2344
|
+
return {
|
|
2345
|
+
name: 'vue-i18n',
|
|
2346
|
+
current: i18n.global.locale,
|
|
2347
|
+
fallback: i18n.global.fallbackLocale as never,
|
|
2348
|
+
messages: i18n.global.messages as never,
|
|
2349
|
+
decimalSeparator: toRef(() => (format(0.1).includes(',') ? ',' : '.')),
|
|
2350
|
+
t: (key, ...params) => i18n.global.t(key, params as never),
|
|
2351
|
+
n: format,
|
|
2352
|
+
provide: () => createVueI18nAdapter(i18n)
|
|
2353
|
+
};
|
|
2354
|
+
}
|
|
2355
|
+
```
|
|
2356
|
+
|
|
2357
|
+
```ts
|
|
2358
|
+
import { createI18n } from 'vue-i18n';
|
|
2359
|
+
|
|
2360
|
+
const i18n = createI18n({
|
|
2361
|
+
legacy: false,
|
|
2362
|
+
locale: 'en',
|
|
2363
|
+
messages: {
|
|
2364
|
+
en: {
|
|
2365
|
+
$cds: { noDataText: 'No data available' },
|
|
2366
|
+
profile: { title: 'Profile' }
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
});
|
|
2370
|
+
|
|
2371
|
+
const cds = createCds({
|
|
2372
|
+
components,
|
|
2373
|
+
directives,
|
|
2374
|
+
locale: {
|
|
2375
|
+
adapter: createVueI18nAdapter(i18n)
|
|
2376
|
+
}
|
|
2377
|
+
});
|
|
2378
|
+
```
|
|
2379
|
+
|
|
2380
|
+
Required members of `LocaleInstance`: `name` (that's how the adapter is
|
|
2381
|
+
recognized), `current`, `fallback`, `messages`, `decimalSeparator`, `t`, `n` and
|
|
2382
|
+
`provide` — a factory for a nested locale, used by `provideLocale`. If you don't
|
|
2383
|
+
need "a locale in a subtree", `provide` can return the same instance, as in the
|
|
2384
|
+
example above.
|
|
2385
|
+
|
|
2386
|
+
## Message keys
|
|
2387
|
+
|
|
2388
|
+
The built-in English dictionary is a template for translating into a new
|
|
2389
|
+
language. Copy it, translate the values and pass it to `messages` under your
|
|
2390
|
+
language's key; the Russian version is available as `locales.ru`.
|
|
2391
|
+
|
|
2392
|
+
```ts
|
|
2393
|
+
export default {
|
|
2394
|
+
badge: 'Badge',
|
|
2395
|
+
noDataText: 'No data available',
|
|
2396
|
+
selectAll: 'Select all',
|
|
2397
|
+
close: 'Close',
|
|
2398
|
+
open: 'Open',
|
|
2399
|
+
dismiss: 'Dismiss',
|
|
2400
|
+
confirmEdit: {
|
|
2401
|
+
ok: 'OK',
|
|
2402
|
+
cancel: 'Cancel'
|
|
2403
|
+
},
|
|
2404
|
+
carousel: {
|
|
2405
|
+
prev: 'Previous slide',
|
|
2406
|
+
next: 'Next slide',
|
|
2407
|
+
delimiter: 'Slide {0} of {1}'
|
|
2408
|
+
},
|
|
2409
|
+
input: {
|
|
2410
|
+
clear: 'Clear {0}',
|
|
2411
|
+
otp: 'Please enter OTP character',
|
|
2412
|
+
prependAction: '{0} prepended action',
|
|
2413
|
+
appendAction: '{0} appended action'
|
|
2414
|
+
},
|
|
2415
|
+
fileInput: {
|
|
2416
|
+
counter: '{0} files',
|
|
2417
|
+
counterSize: '{0} files ({1} in total)'
|
|
2418
|
+
},
|
|
2419
|
+
fileUpload: {
|
|
2420
|
+
title: 'Drag and drop files here',
|
|
2421
|
+
divider: 'or',
|
|
2422
|
+
browse: 'Browse files'
|
|
2423
|
+
},
|
|
2424
|
+
steps: {
|
|
2425
|
+
prev: 'Back',
|
|
2426
|
+
next: 'Next'
|
|
2427
|
+
},
|
|
2428
|
+
table: {
|
|
2429
|
+
filterTitle: 'Filter menu',
|
|
2430
|
+
filterConfirm: 'OK',
|
|
2431
|
+
filterReset: 'Reset',
|
|
2432
|
+
filterEmptyText: 'No filters',
|
|
2433
|
+
filterCheckAll: 'Select all items',
|
|
2434
|
+
filterSearchPlaceholder: 'Search in filters',
|
|
2435
|
+
emptyText: 'No data',
|
|
2436
|
+
selectAll: 'Select current page',
|
|
2437
|
+
selectInvert: 'Invert current page',
|
|
2438
|
+
selectNone: 'Clear all data',
|
|
2439
|
+
selectionAll: 'Select all data',
|
|
2440
|
+
sortTitle: 'Sort',
|
|
2441
|
+
expand: 'Expand row',
|
|
2442
|
+
collapse: 'Collapse row',
|
|
2443
|
+
triggerDesc: 'Click to sort descending',
|
|
2444
|
+
triggerAsc: 'Click to sort ascending',
|
|
2445
|
+
cancelSort: 'Click to cancel sorting',
|
|
2446
|
+
showed: 'Showed',
|
|
2447
|
+
from: 'from',
|
|
2448
|
+
rowOnPage: 'Row on page'
|
|
2449
|
+
},
|
|
2450
|
+
uploader: {
|
|
2451
|
+
uploading: 'Uploading...',
|
|
2452
|
+
uploadFile: 'Upload file',
|
|
2453
|
+
downloadFile: 'Download file',
|
|
2454
|
+
removeFile: 'Remove file',
|
|
2455
|
+
uploadError: 'Upload error',
|
|
2456
|
+
previewFile: 'Preview file'
|
|
2457
|
+
}
|
|
2458
|
+
};
|
|
2459
|
+
```
|
|
2460
|
+
|
|
2461
|
+
The dictionary may stay incomplete: missing keys are taken from the `fallback` —
|
|
2462
|
+
that is, from Russian by default.
|
|
2463
|
+
|
|
2464
|
+
---
|
|
2465
|
+
|
|
2466
|
+
---
|
|
2467
|
+
sourceHash: 16f5caa5227fd7ac98a4d370070985a7094a8a2b
|
|
2468
|
+
---
|
|
2469
|
+
|
|
2470
|
+
# Date Utils
|
|
2471
|
+
|
|
2472
|
+
Central Design System includes a set of functions for working with the native JS
|
|
2473
|
+
`Date`: mask-based formatting, string parsing, arithmetic, comparison and
|
|
2474
|
+
calendar math. You don't need a separate date library (dayjs, date-fns) for
|
|
2475
|
+
everyday tasks. The date and time components use the very same functions —
|
|
2476
|
+
CdsDateInput, CdsDatePicker,
|
|
2477
|
+
CdsTimePicker — so format masks are identical in
|
|
2478
|
+
the utilities and in the components.
|
|
2479
|
+
|
|
2480
|
+
The functions accept a `Date`, a timestamp (milliseconds) or a date string,
|
|
2481
|
+
return a native `Date` and **never mutate** the arguments you pass — the result
|
|
2482
|
+
is always a new object.
|
|
2483
|
+
|
|
2484
|
+
## Setup
|
|
2485
|
+
|
|
2486
|
+
The utilities are exported from the package under the `utils` namespace:
|
|
2487
|
+
|
|
2488
|
+
```ts
|
|
2489
|
+
import { utils } from '@central-design-system/components';
|
|
2490
|
+
|
|
2491
|
+
const { formatDate, addToDate } = utils;
|
|
2492
|
+
|
|
2493
|
+
formatDate(new Date(2026, 7, 18), 'DD.MM.YYYY'); // '18.08.2026'
|
|
2494
|
+
```
|
|
2495
|
+
|
|
2496
|
+
## Formatting — `formatDate`
|
|
2497
|
+
|
|
2498
|
+
`formatDate(value, mask, dateLocale?)` turns a date into a string using a mask:
|
|
2499
|
+
|
|
2500
|
+
```ts
|
|
2501
|
+
const { formatDate } = utils;
|
|
2502
|
+
|
|
2503
|
+
formatDate(new Date(2026, 7, 18, 14, 30), 'DD.MM.YYYY HH:mm'); // '18.08.2026 14:30'
|
|
2504
|
+
formatDate(Date.now(), 'D MMM YYYY'); // '18 Авг 2026'
|
|
2505
|
+
formatDate(new Date(2026, 7, 18), 'dddd'); // 'Вторник'
|
|
2506
|
+
```
|
|
2507
|
+
|
|
2508
|
+
Without a mask, an ISO-like format is used: `YYYY-MM-DDTHH:mm:ss.SSSZ`.
|
|
2509
|
+
For an invalid value the function returns `undefined`.
|
|
2510
|
+
|
|
2511
|
+
Month and weekday names come from the Russian date locale by default. To print
|
|
2512
|
+
them in another language, pass a date locale as the third argument — the
|
|
2513
|
+
built-in ones live in the `locales` export:
|
|
2514
|
+
|
|
2515
|
+
```ts
|
|
2516
|
+
import { locales, utils } from '@central-design-system/components';
|
|
2517
|
+
|
|
2518
|
+
utils.formatDate(new Date(2026, 7, 18), 'dddd, D MMMM', locales.enDate);
|
|
2519
|
+
// 'Tuesday, 18 August'
|
|
2520
|
+
```
|
|
2521
|
+
|
|
2522
|
+
Your own language is plugged in as a `TDateLocale` object — the same fields as
|
|
2523
|
+
`locales.ruDate`. See the Internationalization
|
|
2524
|
+
guide for more on date locales.
|
|
2525
|
+
|
|
2526
|
+
### Format tokens
|
|
2527
|
+
|
|
2528
|
+
| Unit | Token | Result |
|
|
2529
|
+
| --- | --- | --- |
|
|
2530
|
+
| Year | `YY` / `YYYY` | `26` / `2026` |
|
|
2531
|
+
| Month | `M` / `MM` | `8` / `08` |
|
|
2532
|
+
| Month (name) | `MMM` / `MMMM` | `Авг` / `Август` |
|
|
2533
|
+
| Quarter | `Q` / `Qo` | `3` / `3rd` |
|
|
2534
|
+
| Day of month | `D` / `Do` / `DD` | `18` / `18th` / `18` |
|
|
2535
|
+
| Day of year | `DDD` / `DDDD` | `230` / `230` (zero-padded to 3 digits) |
|
|
2536
|
+
| Day of week | `d` | `2` (0 — Sunday) |
|
|
2537
|
+
| Day of week (name) | `dd` / `ddd` / `dddd` | `Вт` / `Вт` / `Вторник` |
|
|
2538
|
+
| Day of week (ISO) | `E` | `2` (1 — Monday, 7 — Sunday) |
|
|
2539
|
+
| Week of year | `w` / `ww` | `34` / `34` |
|
|
2540
|
+
| Hour (0–23) | `H` / `HH` | `14` / `14` |
|
|
2541
|
+
| Hour (1–12) | `h` / `hh` | `2` / `02` |
|
|
2542
|
+
| Minute | `m` / `mm` | `30` / `30` |
|
|
2543
|
+
| Second | `s` / `ss` | `5` / `05` |
|
|
2544
|
+
| Fractions of a second | `S` / `SS` / `SSS` | `1` / `12` / `123` |
|
|
2545
|
+
| Time zone | `Z` / `ZZ` | `+03:00` / `+0300` |
|
|
2546
|
+
| Meridiem | `A` / `a` / `aa` | `PM` / `pm` / `p.m.` |
|
|
2547
|
+
| Unix time | `X` / `x` | seconds / milliseconds |
|
|
2548
|
+
|
|
2549
|
+
Ordinal suffixes (`Do`, `Qo`) are English (`1st`, `2nd`…) regardless of the
|
|
2550
|
+
locale.
|
|
2551
|
+
|
|
2552
|
+
Arbitrary text inside a mask is escaped with square brackets:
|
|
2553
|
+
|
|
2554
|
+
```ts
|
|
2555
|
+
formatDate(new Date(2026, 7, 18), '[Сегодня] DD.MM'); // 'Сегодня 18.08'
|
|
2556
|
+
```
|
|
2557
|
+
|
|
2558
|
+
## Parsing — `extractDate` and `splitDate`
|
|
2559
|
+
|
|
2560
|
+
`extractDate(str, mask, dateLocale?)` parses a string with a mask and returns a
|
|
2561
|
+
`Date`:
|
|
2562
|
+
|
|
2563
|
+
```ts
|
|
2564
|
+
const { extractDate } = utils;
|
|
2565
|
+
|
|
2566
|
+
extractDate('21.03.1985', 'DD.MM.YYYY'); // Date: 21 March 1985
|
|
2567
|
+
extractDate('2019-10-29 23:12', 'YYYY-MM-DD HH:mm'); // Date: 29 October 2019, 23:12
|
|
2568
|
+
```
|
|
2569
|
+
|
|
2570
|
+
Month and day names inside the string are recognized through the date locale —
|
|
2571
|
+
Russian by default, just like in `formatDate`.
|
|
2572
|
+
|
|
2573
|
+
A non-existent day overflows following the rules of the native `Date`:
|
|
2574
|
+
`extractDate('30.02.2024', 'DD.MM.YYYY')` gives 1 March 2024. When you need
|
|
2575
|
+
strict input validation, format the result back and compare it with the string:
|
|
2576
|
+
|
|
2577
|
+
```ts
|
|
2578
|
+
const strict = (str: string, mask: string) => formatDate(extractDate(str, mask), mask) === str;
|
|
2579
|
+
|
|
2580
|
+
strict('18.08.2026', 'DD.MM.YYYY'); // true
|
|
2581
|
+
strict('30.02.2024', 'DD.MM.YYYY'); // false — overflowed into 01.03.2024
|
|
2582
|
+
```
|
|
2583
|
+
|
|
2584
|
+
If you don't need a `Date`, `splitDate(str, mask, dateLocale?)` splits the string
|
|
2585
|
+
into its parts — an `IRawDate` object with the fields `year`, `month`, `day`,
|
|
2586
|
+
`hour`, `minute`, `second`, `millisecond` (anything not found is `null`):
|
|
2587
|
+
|
|
2588
|
+
```ts
|
|
2589
|
+
const { splitDate } = utils;
|
|
2590
|
+
|
|
2591
|
+
splitDate('18.08.2026', 'DD.MM.YYYY');
|
|
2592
|
+
// { year: 2026, month: 8, day: 18, hour: null, … }
|
|
2593
|
+
```
|
|
2594
|
+
|
|
2595
|
+
## Creating and changing
|
|
2596
|
+
|
|
2597
|
+
### `buildDate`
|
|
2598
|
+
|
|
2599
|
+
`buildDate(modified, utc?)` — the current moment with individual parts replaced.
|
|
2600
|
+
Handy when you need "now, but at 15:00" or "today, but in 2010":
|
|
2601
|
+
|
|
2602
|
+
```ts
|
|
2603
|
+
const { buildDate } = utils;
|
|
2604
|
+
|
|
2605
|
+
buildDate({ year: 2010, day: 5, hour: 15 });
|
|
2606
|
+
// current month, minutes and seconds; year 2010, day 5, hour 15
|
|
2607
|
+
```
|
|
2608
|
+
|
|
2609
|
+
Supported object fields: `year`, `month` (1–12), `day` (or `date`), `hour`,
|
|
2610
|
+
`minute`, `second`, `millisecond`.
|
|
2611
|
+
|
|
2612
|
+
### `adjustDate`
|
|
2613
|
+
|
|
2614
|
+
`adjustDate(date, modified, utc?)` — the same thing, but for an arbitrary date:
|
|
2615
|
+
|
|
2616
|
+
```ts
|
|
2617
|
+
const { adjustDate } = utils;
|
|
2618
|
+
|
|
2619
|
+
adjustDate(new Date(2026, 10, 2), { year: 2010, month: 2 });
|
|
2620
|
+
// Date: 2 February 2010
|
|
2621
|
+
```
|
|
2622
|
+
|
|
2623
|
+
Note that `month` here is 1-based (February is `2`), unlike in the `Date`
|
|
2624
|
+
constructor.
|
|
2625
|
+
|
|
2626
|
+
### `addToDate` / `subtractFromDate`
|
|
2627
|
+
|
|
2628
|
+
Add and subtract intervals. The object fields are the same, but they mean "how
|
|
2629
|
+
much to add" rather than "what to set":
|
|
2630
|
+
|
|
2631
|
+
```ts
|
|
2632
|
+
const { addToDate, subtractFromDate } = utils;
|
|
2633
|
+
|
|
2634
|
+
addToDate(new Date(2026, 2, 7), { day: 7, month: 1 }); // Date: 14 April 2026
|
|
2635
|
+
subtractFromDate(new Date(2026, 2, 7), { hour: 24 }); // Date: 6 March 2026
|
|
2636
|
+
```
|
|
2637
|
+
|
|
2638
|
+
### `startOfDate` / `endOfDate`
|
|
2639
|
+
|
|
2640
|
+
The start and the end of a period — year, month, day, hour, minute or second:
|
|
2641
|
+
|
|
2642
|
+
```ts
|
|
2643
|
+
const { startOfDate, endOfDate } = utils;
|
|
2644
|
+
|
|
2645
|
+
startOfDate(new Date(2026, 7, 18, 14, 30), 'year'); // Date: 1 January 2026, 00:00:00.000
|
|
2646
|
+
endOfDate(new Date(2026, 7, 18, 14, 30), 'month'); // Date: 31 August 2026, 23:59:59.999
|
|
2647
|
+
```
|
|
2648
|
+
|
|
2649
|
+
Period unit: `'year'`, `'month'`, `'day'`, `'hour'`, `'minute'`, `'second'`
|
|
2650
|
+
(the plural form is accepted too).
|
|
2651
|
+
|
|
2652
|
+
## Comparison and ranges
|
|
2653
|
+
|
|
2654
|
+
### `isSameDate`
|
|
2655
|
+
|
|
2656
|
+
Compares dates down to a unit: `'year'` — the year only, `'month'` — month and
|
|
2657
|
+
year, `'day'` — the calendar day, and so on. Without a unit, the timestamps are
|
|
2658
|
+
compared in full.
|
|
2659
|
+
|
|
2660
|
+
```ts
|
|
2661
|
+
const { isSameDate } = utils;
|
|
2662
|
+
|
|
2663
|
+
isSameDate(new Date(2026, 7, 1), new Date(2026, 7, 30), 'month'); // true
|
|
2664
|
+
isSameDate(new Date(2026, 7, 1), new Date(2026, 7, 30), 'day'); // false
|
|
2665
|
+
```
|
|
2666
|
+
|
|
2667
|
+
### `getDateDiff`
|
|
2668
|
+
|
|
2669
|
+
The difference between two dates in the chosen unit (days by default):
|
|
2670
|
+
|
|
2671
|
+
```ts
|
|
2672
|
+
const { getDateDiff } = utils;
|
|
2673
|
+
|
|
2674
|
+
getDateDiff(new Date(2026, 4, 12), new Date(2026, 3, 8)); // 34 (days)
|
|
2675
|
+
getDateDiff(new Date(2026, 4, 12), new Date(2026, 3, 8), 'months'); // 1
|
|
2676
|
+
```
|
|
2677
|
+
|
|
2678
|
+
### `isBetweenDates` / `getDateBetween`
|
|
2679
|
+
|
|
2680
|
+
`isBetweenDates(date, from, to, opts?)` checks whether a date falls inside a
|
|
2681
|
+
range. The bounds are excluded by default; the `inclusiveFrom` and `inclusiveTo`
|
|
2682
|
+
options include them, and `onlyDate: true` compares calendar days only, ignoring
|
|
2683
|
+
the time:
|
|
2684
|
+
|
|
2685
|
+
```ts
|
|
2686
|
+
const { isBetweenDates } = utils;
|
|
2687
|
+
|
|
2688
|
+
isBetweenDates(date, from, to); // strict range
|
|
2689
|
+
isBetweenDates(date, from, to, { inclusiveFrom: true, inclusiveTo: true, onlyDate: true });
|
|
2690
|
+
```
|
|
2691
|
+
|
|
2692
|
+
`getDateBetween(date, min, max)` clamps a date to a range: it returns the date
|
|
2693
|
+
itself if it is inside, otherwise the nearest bound:
|
|
2694
|
+
|
|
2695
|
+
```ts
|
|
2696
|
+
const { getDateBetween } = utils;
|
|
2697
|
+
|
|
2698
|
+
getDateBetween(new Date(2025, 0, 1), new Date(2026, 0, 1), new Date(2026, 11, 31));
|
|
2699
|
+
// Date: 1 January 2026 — the date is below the minimum, so the min bound came back
|
|
2700
|
+
```
|
|
2701
|
+
|
|
2702
|
+
### `getMinDate` / `getMaxDate`
|
|
2703
|
+
|
|
2704
|
+
The smallest and the largest of a set of dates. They return a timestamp (number) —
|
|
2705
|
+
wrap it in `new Date()` if you need a date object:
|
|
2706
|
+
|
|
2707
|
+
```ts
|
|
2708
|
+
const { getMinDate, getMaxDate } = utils;
|
|
2709
|
+
|
|
2710
|
+
const min = getMinDate(new Date(2026, 6, 24), new Date(2026, 5, 20), new Date(2026, 6, 26));
|
|
2711
|
+
new Date(min); // Date: 20 June 2026
|
|
2712
|
+
|
|
2713
|
+
const dates = [/* Date[] */];
|
|
2714
|
+
const max = getMaxDate(dates[0], ...dates.slice(1));
|
|
2715
|
+
```
|
|
2716
|
+
|
|
2717
|
+
## Calendar
|
|
2718
|
+
|
|
2719
|
+
```ts
|
|
2720
|
+
const { getDayOfWeek, getWeekOfYear, getDayOfYear, daysInMonth } = utils;
|
|
2721
|
+
|
|
2722
|
+
getDayOfWeek(new Date(2026, 7, 16)); // 7 — Sunday (ISO: 1 — Monday)
|
|
2723
|
+
getWeekOfYear(new Date(2026, 0, 4)); // 1 — ISO week number in the year
|
|
2724
|
+
getDayOfYear(new Date(2026, 1, 4)); // 35 — ordinal day in the year
|
|
2725
|
+
daysInMonth(new Date(2024, 1, 15)); // 29 — February of a leap year
|
|
2726
|
+
```
|
|
2727
|
+
|
|
2728
|
+
## Other
|
|
2729
|
+
|
|
2730
|
+
### `isValidDate`
|
|
2731
|
+
|
|
2732
|
+
Checks whether a value parses into a date:
|
|
2733
|
+
|
|
2734
|
+
```ts
|
|
2735
|
+
const { isValidDate } = utils;
|
|
2736
|
+
|
|
2737
|
+
isValidDate('2026-08-18'); // true
|
|
2738
|
+
isValidDate('не дата'); // false
|
|
2739
|
+
```
|
|
2740
|
+
|
|
2741
|
+
The check is syntactic — it does not catch non-existent calendar days
|
|
2742
|
+
(see `splitDate` above).
|
|
2743
|
+
|
|
2744
|
+
### `cloneDate`
|
|
2745
|
+
|
|
2746
|
+
A copy of a date. Useful before handing it to third-party code that might mutate
|
|
2747
|
+
the object (CDS utilities themselves never modify their arguments):
|
|
2748
|
+
|
|
2749
|
+
```ts
|
|
2750
|
+
const { cloneDate } = utils;
|
|
2751
|
+
|
|
2752
|
+
const copy = cloneDate(original);
|
|
2753
|
+
```
|
|
2754
|
+
|
|
2755
|
+
### `inferDateFormat`
|
|
2756
|
+
|
|
2757
|
+
Detects the shape of a value — handy for returning the result in the same form
|
|
2758
|
+
the value came in:
|
|
2759
|
+
|
|
2760
|
+
```ts
|
|
2761
|
+
const { inferDateFormat } = utils;
|
|
2762
|
+
|
|
2763
|
+
inferDateFormat(new Date()); // 'date'
|
|
2764
|
+
inferDateFormat(1787059805000); // 'number'
|
|
2765
|
+
inferDateFormat('18.08.2026'); // 'string'
|
|
2766
|
+
```
|