dxd-style-code 0.1.7 → 0.1.8
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/dist/dxd-style-code.js +11974 -3725
- package/dist/dxd-style-code.umd.cjs +10 -1
- package/dist/style.css +1 -1
- package/package.json +13 -6
- package/src/components/atoms/DXAvatar/DXAvatar.stories.js +319 -0
- package/src/components/atoms/DXAvatar/DXAvatar.vue +167 -0
- package/src/components/atoms/DXAvatar/index.js +2 -0
- package/src/components/atoms/DXBackdrop/DXBackdrop.stories.js +341 -0
- package/src/components/atoms/DXBackdrop/DXBackdrop.vue +102 -0
- package/src/components/atoms/DXBackdrop/index.js +2 -0
- package/src/components/atoms/DXBadge/DXBadge.stories.js +239 -0
- package/src/components/atoms/DXBadge/DXBadge.vue +45 -0
- package/src/components/atoms/DXBadge/index.js +2 -0
- package/src/components/atoms/DXButton/DXButton.stories.js +178 -0
- package/src/components/atoms/DXButton/DXButton.vue +84 -0
- package/src/components/atoms/DXButton/index.js +2 -0
- package/src/components/atoms/DXCard/DXCard.stories.js +133 -0
- package/src/components/atoms/DXCard/DXCard.vue +46 -0
- package/src/components/atoms/DXCard/index.js +2 -0
- package/src/components/atoms/DXCheckbox/DXCheckbox.stories.js +294 -0
- package/src/components/atoms/DXCheckbox/DXCheckbox.vue +191 -0
- package/src/components/atoms/DXCheckbox/index.js +2 -0
- package/src/components/atoms/DXDivider/DXDivider.stories.js +135 -0
- package/src/components/atoms/DXDivider/DXDivider.vue +74 -0
- package/src/components/atoms/DXDivider/index.js +2 -0
- package/src/components/atoms/DXDropdownItem/DXDropdownItem.vue +116 -0
- package/src/components/atoms/DXDropdownItem/index.js +2 -0
- package/src/components/atoms/DXFormLabel/DXFormLabel.stories.js +194 -0
- package/src/components/atoms/DXFormLabel/DXFormLabel.vue +94 -0
- package/src/components/atoms/DXFormLabel/index.js +2 -0
- package/src/components/atoms/DXIcon/DXIcon.stories.js +156 -0
- package/src/components/atoms/DXIcon/DXIcon.vue +102 -0
- package/src/components/atoms/DXIcon/index.js +3 -0
- package/src/components/atoms/DXIconWrapper/DXIconWrapper.stories.js +237 -0
- package/src/components/atoms/DXIconWrapper/DXIconWrapper.vue +79 -0
- package/src/components/atoms/DXIconWrapper/index.js +2 -0
- package/src/components/atoms/DXInputAddon/DXInputAddon.stories.js +230 -0
- package/src/components/atoms/DXInputAddon/DXInputAddon.vue +64 -0
- package/src/components/atoms/DXInputAddon/index.js +2 -0
- package/src/components/atoms/DXLink/DXLink.stories.js +475 -0
- package/src/components/atoms/DXLink/DXLink.vue +229 -0
- package/src/components/atoms/DXLink/index.js +2 -0
- package/src/components/atoms/DXLoader/DXLoader.stories.js +280 -0
- package/src/components/atoms/DXLoader/DXLoader.vue +78 -0
- package/src/components/atoms/DXLoader/index.js +2 -0
- package/src/components/atoms/DXProgress/DXProgress.stories.js +312 -0
- package/src/components/atoms/DXProgress/DXProgress.vue +85 -0
- package/src/components/atoms/DXProgress/index.js +2 -0
- package/src/components/atoms/DXQuote/DXQuote.stories.js +255 -0
- package/src/components/atoms/DXQuote/DXQuote.vue +97 -0
- package/src/components/atoms/DXQuote/index.js +2 -0
- package/src/components/atoms/DXRadio/DXRadio.stories.js +277 -0
- package/src/components/atoms/DXRadio/DXRadio.vue +144 -0
- package/src/components/atoms/DXRadio/index.js +2 -0
- package/src/components/atoms/DXSkeleton/DXSkeleton.stories.js +50 -0
- package/src/components/atoms/DXSkeleton/DXSkeleton.vue +19 -0
- package/src/components/atoms/DXSkeleton/index.js +2 -0
- package/src/components/atoms/DXSlider/DXSlider.stories.js +522 -0
- package/src/components/atoms/DXSlider/DXSlider.vue +338 -0
- package/src/components/atoms/DXSlider/index.js +2 -0
- package/src/components/atoms/DXTags/DXTags.stories.js +206 -0
- package/src/components/atoms/DXTags/DXTags.vue +111 -0
- package/src/components/atoms/DXTags/index.js +2 -0
- package/src/components/atoms/DXToast/DXToast.stories.js +40 -0
- package/src/components/atoms/DXToast/DXToast.vue +32 -0
- package/src/components/atoms/DXToast/index.js +2 -0
- package/src/components/atoms/DXToggle/DXToggle.stories.js +143 -0
- package/src/components/atoms/DXToggle/DXToggle.vue +142 -0
- package/src/components/atoms/DXToggle/index.js +2 -0
- package/src/components/atoms/DXToggleButton/DXToggleButton.stories.js +513 -0
- package/src/components/atoms/DXToggleButton/DXToggleButton.vue +140 -0
- package/src/components/atoms/DXToggleButton/index.js +2 -0
- package/src/components/atoms/DXTooltip/DXTooltip.stories.js +243 -0
- package/src/components/atoms/DXTooltip/DXTooltip.vue +151 -0
- package/src/components/atoms/DXTooltip/index.js +2 -0
- package/src/components/atoms/index.js +24 -0
- package/src/components/layout/DXBox/DXBox.stories.js +238 -0
- package/src/components/layout/DXBox/DXBox.vue +198 -0
- package/src/components/layout/DXBox/index.js +2 -0
- package/src/components/layout/DXContainer/DXContainer.stories.js +147 -0
- package/src/components/layout/DXContainer/DXContainer.vue +83 -0
- package/src/components/layout/DXContainer/index.js +2 -0
- package/src/components/layout/DXFlex/DXFlex.stories.js +210 -0
- package/src/components/layout/DXFlex/DXFlex.vue +149 -0
- package/src/components/layout/DXFlex/index.js +2 -0
- package/src/components/layout/DXGrid/DXGrid.stories.js +238 -0
- package/src/components/layout/DXGrid/DXGrid.vue +167 -0
- package/src/components/layout/DXGrid/index.js +2 -0
- package/src/components/layout/DXSpacer/DXSpacer.stories.js +187 -0
- package/src/components/layout/DXSpacer/DXSpacer.vue +102 -0
- package/src/components/layout/DXSpacer/index.js +2 -0
- package/src/components/layout/DXStack/DXStack.stories.js +199 -0
- package/src/components/layout/DXStack/DXStack.vue +140 -0
- package/src/components/layout/DXStack/index.js +2 -0
- package/src/components/layout/index.js +8 -0
- package/src/components/molecules/DXActionButtons/DXActionButtons.stories.js +288 -0
- package/src/components/molecules/DXActionButtons/DXActionButtons.vue +106 -0
- package/src/components/molecules/DXActionButtons/index.js +2 -0
- package/src/components/molecules/DXAlert/DXAlert.stories.js +70 -0
- package/src/components/molecules/DXAlert/DXAlert.vue +116 -0
- package/src/components/molecules/DXAlert/index.js +2 -0
- package/src/components/molecules/DXBaseTable/DXBaseTable.stories.js +433 -0
- package/src/components/molecules/DXBaseTable/DXBaseTable.vue +459 -0
- package/src/components/molecules/DXBaseTable/index.js +4 -0
- package/src/components/molecules/DXBreadcrumb/DXBreadcrumb.stories.js +227 -0
- package/src/components/molecules/DXBreadcrumb/DXBreadcrumb.vue +96 -0
- package/src/components/molecules/DXBreadcrumb/index.js +2 -0
- package/src/components/molecules/DXButtonGroup/DXButtonGroup.stories.js +26 -0
- package/src/components/molecules/DXButtonGroup/DXButtonGroup.vue +78 -0
- package/src/components/molecules/DXButtonGroup/index.js +2 -0
- package/src/components/molecules/DXCloseButton/DXCloseButton.stories.js +53 -0
- package/src/components/molecules/DXCloseButton/DXCloseButton.vue +62 -0
- package/src/components/molecules/DXCloseButton/index.js +3 -0
- package/src/components/molecules/DXComboBox/DXComboBox.stories.js +62 -0
- package/src/components/molecules/DXComboBox/DXComboBox.vue +167 -0
- package/src/components/molecules/DXComboBox/index.js +2 -0
- package/src/components/molecules/DXCopyField/DXCopyField.stories.js +231 -0
- package/src/components/molecules/DXCopyField/DXCopyField.vue +75 -0
- package/src/components/molecules/DXCopyField/index.js +2 -0
- package/src/components/molecules/DXDataFilter/DXDataFilter.stories.js +275 -0
- package/src/components/molecules/DXDataFilter/DXDataFilter.vue +385 -0
- package/src/components/molecules/DXDataFilter/index.js +2 -0
- package/src/components/molecules/DXDatePicker/DXDatePicker.stories.js +42 -0
- package/src/components/molecules/DXDatePicker/DXDatePicker.vue +121 -0
- package/src/components/molecules/DXDatePicker/index.js +2 -0
- package/src/components/molecules/DXDropdownDivider/DXDropdownDivider.vue +30 -0
- package/src/components/molecules/DXDropdownDivider/index.js +2 -0
- package/src/components/molecules/DXFileUpload/DXFileUpload.stories.js +53 -0
- package/src/components/molecules/DXFileUpload/DXFileUpload.vue +199 -0
- package/src/components/molecules/DXFileUpload/index.js +2 -0
- package/src/components/molecules/DXFilterGroup/DXFilterGroup.stories.js +43 -0
- package/src/components/molecules/DXFilterGroup/DXFilterGroup.vue +43 -0
- package/src/components/molecules/DXFilterGroup/index.js +2 -0
- package/src/components/molecules/DXFormControl/DXFormControl.stories.js +69 -0
- package/src/components/molecules/DXFormControl/DXFormControl.vue +72 -0
- package/src/components/molecules/DXFormControl/index.js +2 -0
- package/src/components/molecules/DXInput/DXInput.stories.js +291 -0
- package/src/components/molecules/DXInput/DXInput.vue +156 -0
- package/src/components/molecules/DXInput/index.js +3 -0
- package/src/components/molecules/DXInputGroup/DXInputGroup.stories.js +228 -0
- package/src/components/molecules/DXInputGroup/DXInputGroup.vue +64 -0
- package/src/components/molecules/DXInputGroup/index.js +2 -0
- package/src/components/molecules/DXInputMask/DXInputMask.stories.js +53 -0
- package/src/components/molecules/DXInputMask/DXInputMask.vue +89 -0
- package/src/components/molecules/DXInputMask/index.js +2 -0
- package/src/components/molecules/DXMenu/DXMenu.stories.js +379 -0
- package/src/components/molecules/DXMenu/DXMenu.vue +331 -0
- package/src/components/molecules/DXMenu/README.md +479 -0
- package/src/components/molecules/DXMenu/index.js +2 -0
- package/src/components/molecules/DXPagination/DXPagination.stories.js +62 -0
- package/src/components/molecules/DXPagination/DXPagination.vue +123 -0
- package/src/components/molecules/DXPagination/index.js +2 -0
- package/src/components/molecules/DXPasswordInput/DXPasswordInput.stories.js +42 -0
- package/src/components/molecules/DXPasswordInput/DXPasswordInput.vue +74 -0
- package/src/components/molecules/DXPasswordInput/index.js +2 -0
- package/src/components/molecules/DXRadioCard/DXRadioCard.stories.js +60 -0
- package/src/components/molecules/DXRadioCard/DXRadioCard.vue +71 -0
- package/src/components/molecules/DXRadioCard/index.js +2 -0
- package/src/components/molecules/DXRadioGroup/DXRadioGroup.stories.js +297 -0
- package/src/components/molecules/DXRadioGroup/DXRadioGroup.vue +73 -0
- package/src/components/molecules/DXRadioGroup/index.js +2 -0
- package/src/components/molecules/DXRating/DXRating.stories.js +322 -0
- package/src/components/molecules/DXRating/DXRating.vue +402 -0
- package/src/components/molecules/DXRating/index.js +2 -0
- package/src/components/molecules/DXSearchBar/DXSearchBar.stories.js +357 -0
- package/src/components/molecules/DXSearchBar/DXSearchBar.vue +525 -0
- package/src/components/molecules/DXSearchBar/index.js +2 -0
- package/src/components/molecules/DXSearchSelect/DXSearchSelect.stories.js +50 -0
- package/src/components/molecules/DXSearchSelect/DXSearchSelect.vue +207 -0
- package/src/components/molecules/DXSearchSelect/index.js +2 -0
- package/src/components/molecules/DXSegmentedControl/DXSegmentedControl.stories.js +326 -0
- package/src/components/molecules/DXSegmentedControl/DXSegmentedControl.vue +116 -0
- package/src/components/molecules/DXSegmentedControl/index.js +2 -0
- package/src/components/molecules/DXSelect/DXSelect.stories.js +259 -0
- package/src/components/molecules/DXSelect/DXSelect.vue +149 -0
- package/src/components/molecules/DXSelect/index.js +3 -0
- package/src/components/molecules/DXStatCard/DXStatCard.stories.js +335 -0
- package/src/components/molecules/DXStatCard/DXStatCard.vue +309 -0
- package/src/components/molecules/DXStatCard/index.js +2 -0
- package/src/components/molecules/DXTableFiltersPanel/DXTableFiltersPanel.vue +72 -0
- package/src/components/molecules/DXTableFiltersPanel/index.js +7 -0
- package/src/components/molecules/DXTablePagination/DXTablePagination.stories.js +236 -0
- package/src/components/molecules/DXTablePagination/DXTablePagination.vue +93 -0
- package/src/components/molecules/DXTablePagination/index.js +2 -0
- package/src/components/molecules/DXTableToolbar/DXTableToolbar.stories.js +271 -0
- package/src/components/molecules/DXTableToolbar/DXTableToolbar.vue +102 -0
- package/src/components/molecules/DXTableToolbar/index.js +2 -0
- package/src/components/molecules/DXTextarea/DXTextarea.stories.js +239 -0
- package/src/components/molecules/DXTextarea/DXTextarea.vue +158 -0
- package/src/components/molecules/DXTextarea/index.js +3 -0
- package/src/components/molecules/DXTimePicker/DXTimePicker.stories.js +282 -0
- package/src/components/molecules/DXTimePicker/DXTimePicker.vue +640 -0
- package/src/components/molecules/DXTimePicker/index.js +2 -0
- package/src/components/molecules/DXValidationIcon/DXValidationIcon.stories.js +60 -0
- package/src/components/molecules/DXValidationIcon/DXValidationIcon.vue +53 -0
- package/src/components/molecules/DXValidationIcon/index.js +3 -0
- package/src/components/molecules/index.js +34 -0
- package/src/components/organisms/DXAccordion/DXAccordion.stories.js +33 -0
- package/src/components/organisms/DXAccordion/DXAccordion.vue +104 -0
- package/src/components/organisms/DXAccordion/index.js +2 -0
- package/src/components/organisms/DXAppLayout/DXAppLayout.stories.js +689 -0
- package/src/components/organisms/DXAppLayout/DXAppLayout.vue +460 -0
- package/src/components/organisms/DXAppLayout/index.js +2 -0
- package/src/components/organisms/DXAuthenticationForm/DXAuthenticationForm.stories.js +232 -0
- package/src/components/organisms/DXAuthenticationForm/DXAuthenticationForm.vue +458 -0
- package/src/components/organisms/DXAuthenticationForm/index.js +2 -0
- package/src/components/organisms/DXChartContainer/DXChartContainer.stories.js +286 -0
- package/src/components/organisms/DXChartContainer/DXChartContainer.vue +273 -0
- package/src/components/organisms/DXChartContainer/index.js +2 -0
- package/src/components/organisms/DXChatInterface/DXChatInterface.stories.js +164 -0
- package/src/components/organisms/DXChatInterface/DXChatInterface.vue +583 -0
- package/src/components/organisms/DXChatInterface/index.js +2 -0
- package/src/components/organisms/DXCommentSection/DXCommentSection.stories.js +173 -0
- package/src/components/organisms/DXCommentSection/DXCommentSection.vue +487 -0
- package/src/components/organisms/DXCommentSection/index.js +2 -0
- package/src/components/organisms/DXDashboardGrid/DXDashboardGrid.stories.js +331 -0
- package/src/components/organisms/DXDashboardGrid/DXDashboardGrid.vue +309 -0
- package/src/components/organisms/DXDashboardGrid/index.js +2 -0
- package/src/components/organisms/DXDashboardWidget/DXDashboardWidget.stories.js +271 -0
- package/src/components/organisms/DXDashboardWidget/DXDashboardWidget.vue +260 -0
- package/src/components/organisms/DXDashboardWidget/index.js +2 -0
- package/src/components/organisms/DXDataTable/DXDataTable.stories.js +247 -0
- package/src/components/organisms/DXDataTable/DXDataTable.vue +496 -0
- package/src/components/organisms/DXDataTable/index.js +2 -0
- package/src/components/organisms/DXDropdown/DXDropdown.stories.js +795 -0
- package/src/components/organisms/DXDropdown/DXDropdown.vue +238 -0
- package/src/components/organisms/DXDropdown/index.js +2 -0
- package/src/components/organisms/DXEmptyState/DXEmptyState.stories.js +37 -0
- package/src/components/organisms/DXEmptyState/DXEmptyState.vue +41 -0
- package/src/components/organisms/DXEmptyState/index.js +2 -0
- package/src/components/organisms/DXFormWizard/DXFormWizard.stories.js +378 -0
- package/src/components/organisms/DXFormWizard/DXFormWizard.vue +578 -0
- package/src/components/organisms/DXFormWizard/index.js +2 -0
- package/src/components/organisms/DXHeaderBar/DXHeaderBar.stories.js +448 -0
- package/src/components/organisms/DXHeaderBar/DXHeaderBar.vue +190 -0
- package/src/components/organisms/DXHeaderBar/index.js +2 -0
- package/src/components/organisms/DXMediaGallery/DXMediaGallery.stories.js +347 -0
- package/src/components/organisms/DXMediaGallery/DXMediaGallery.vue +422 -0
- package/src/components/organisms/DXMediaGallery/index.js +2 -0
- package/src/components/organisms/DXModal/DXModal.stories.js +138 -0
- package/src/components/organisms/DXModal/DXModal.vue +213 -0
- package/src/components/organisms/DXModal/index.js +2 -0
- package/src/components/organisms/DXNotificationCenter/DXNotificationCenter.stories.js +183 -0
- package/src/components/organisms/DXNotificationCenter/DXNotificationCenter.vue +566 -0
- package/src/components/organisms/DXNotificationCenter/index.js +2 -0
- package/src/components/organisms/DXReportGenerator/DXReportGenerator.stories.js +199 -0
- package/src/components/organisms/DXReportGenerator/DXReportGenerator.vue +344 -0
- package/src/components/organisms/DXReportGenerator/index.js +2 -0
- package/src/components/organisms/DXSettingsPanel/DXSettingsPanel.stories.js +245 -0
- package/src/components/organisms/DXSettingsPanel/DXSettingsPanel.vue +454 -0
- package/src/components/organisms/DXSettingsPanel/index.js +2 -0
- package/src/components/organisms/DXSidebar/DXSidebar.stories.js +316 -0
- package/src/components/organisms/DXSidebar/DXSidebar.vue +212 -0
- package/src/components/organisms/DXSidebar/index.js +2 -0
- package/src/components/organisms/DXSidebarMenu/DATA_STRUCTURE.md +299 -0
- package/src/components/organisms/DXSidebarMenu/DXSidebarMenu.stories.js +729 -0
- package/src/components/organisms/DXSidebarMenu/DXSidebarMenu.vue +257 -0
- package/src/components/organisms/DXSidebarMenu/DXSidebarMenuItem.vue +249 -0
- package/src/components/organisms/DXSidebarMenu/README.md +333 -0
- package/src/components/organisms/DXSidebarMenu/index.js +3 -0
- package/src/components/organisms/DXTable/DXTable.stories.js +550 -0
- package/src/components/organisms/DXTable/DXTable.vue +324 -0
- package/src/components/organisms/DXTable/index.js +2 -0
- package/src/components/organisms/DXTabs/DXTabs.stories.js +407 -0
- package/src/components/organisms/DXTabs/DXTabs.vue +301 -0
- package/src/components/organisms/DXTabs/index.js +2 -0
- package/src/components/organisms/DXUserProfileCard/DXUserProfileCard.stories.js +194 -0
- package/src/components/organisms/DXUserProfileCard/DXUserProfileCard.vue +403 -0
- package/src/components/organisms/DXUserProfileCard/index.js +2 -0
- package/src/components/organisms/DXWizard/DXWizard.stories.js +212 -0
- package/src/components/organisms/DXWizard/DXWizard.vue +615 -0
- package/src/components/organisms/DXWizard/index.js +2 -0
- package/src/components/organisms/index.js +25 -0
- package/src/components/typography/DXBlockquote/DXBlockquote.stories.js +33 -0
- package/src/components/typography/DXBlockquote/DXBlockquote.vue +44 -0
- package/src/components/typography/DXBlockquote/index.js +2 -0
- package/src/components/typography/DXCode/DXCode.stories.js +29 -0
- package/src/components/typography/DXCode/DXCode.vue +46 -0
- package/src/components/typography/DXCode/index.js +2 -0
- package/src/components/typography/DXHeading/DXHeading.stories.js +54 -0
- package/src/components/typography/DXHeading/DXHeading.vue +68 -0
- package/src/components/typography/DXHeading/index.js +2 -0
- package/src/components/typography/DXLabel/DXLabel.stories.js +40 -0
- package/src/components/typography/DXLabel/DXLabel.vue +49 -0
- package/src/components/typography/DXLabel/index.js +2 -0
- package/src/components/typography/DXList/DXList.stories.js +50 -0
- package/src/components/typography/DXList/DXList.vue +55 -0
- package/src/components/typography/DXList/index.js +2 -0
- package/src/components/typography/DXText/DXText.stories.js +47 -0
- package/src/components/typography/DXText/DXText.vue +67 -0
- package/src/components/typography/DXText/index.js +2 -0
- package/src/components/typography/index.js +8 -0
- package/src/components/utilities/DXAnimatePresence/DXAnimatePresence.stories.js +335 -0
- package/src/components/utilities/DXAnimatePresence/DXAnimatePresence.vue +207 -0
- package/src/components/utilities/DXAnimatePresence/index.js +2 -0
- package/src/components/utilities/DXBreakpointProvider/DXBreakpointProvider.stories.js +321 -0
- package/src/components/utilities/DXBreakpointProvider/DXBreakpointProvider.vue +158 -0
- package/src/components/utilities/DXBreakpointProvider/index.js +2 -0
- package/src/components/utilities/DXObserver/DXObserver.stories.js +324 -0
- package/src/components/utilities/DXObserver/DXObserver.vue +182 -0
- package/src/components/utilities/DXObserver/index.js +2 -0
- package/src/components/utilities/DXPortal/DXPortal.stories.js +267 -0
- package/src/components/utilities/DXPortal/DXPortal.vue +69 -0
- package/src/components/utilities/DXPortal/index.js +2 -0
- package/src/components/utilities/DXStaggeredAnimation/DXStaggeredAnimation.stories.js +339 -0
- package/src/components/utilities/DXStaggeredAnimation/DXStaggeredAnimation.vue +155 -0
- package/src/components/utilities/DXStaggeredAnimation/index.js +2 -0
- package/src/components/utilities/DXThemeProvider/DXThemeProvider.stories.js +327 -0
- package/src/components/utilities/DXThemeProvider/DXThemeProvider.vue +227 -0
- package/src/components/utilities/DXThemeProvider/index.js +2 -0
- package/src/components/utilities/DXTransitionGroup/DXTransitionGroup.stories.js +368 -0
- package/src/components/utilities/DXTransitionGroup/DXTransitionGroup.vue +212 -0
- package/src/components/utilities/DXTransitionGroup/index.js +2 -0
- package/src/components/utilities/index.js +9 -0
- package/src/composables/useAnimation.js +264 -0
- package/src/composables/useClassComposition.js +35 -0
- package/src/composables/useDataAttributes.js +83 -0
- package/src/composables/useMenu.js +88 -0
- package/src/composables/useSize.js +135 -0
- package/src/composables/useSpacing.js +37 -0
- package/src/composables/useTableColumns.js +88 -0
- package/src/composables/useTableData.js +82 -0
- package/src/composables/useTableFilter.js +158 -0
- package/src/composables/useTablePagination.js +89 -0
- package/src/composables/useTableSelection.js +77 -0
- package/src/composables/useTableSort.js +75 -0
- package/src/composables/useTabsScroll.js +88 -0
- package/src/composables/useVariant.js +700 -0
- package/src/index.js +86 -0
- package/src/styles/animations.css +171 -0
- package/src/styles/index.css +99 -0
- package/src/styles/tokens.js +123 -0
- package/src/utils/propTypes.js +77 -0
- package/src/utils/toggleButtonPresets.js +115 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import DXTooltip from './DXTooltip.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Atoms/DXTooltip',
|
|
5
|
+
component: DXTooltip,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
argTypes: {
|
|
8
|
+
position: { control: { type: 'select' }, options: ['top', 'bottom', 'left', 'right'] },
|
|
9
|
+
color: { control: { type: 'select' }, options: ['dark', 'light', 'primary', 'success', 'danger', 'warning', 'info'] },
|
|
10
|
+
size: { control: { type: 'select' }, options: ['xs', 'sm', 'md', 'lg', 'xl'] },
|
|
11
|
+
animation: { control: { type: 'select' }, options: ['fade', 'fade-scale', 'slide-up', 'slide-down', 'slide-left', 'slide-right', 'tooltip-custom'] },
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const Default = {
|
|
16
|
+
args: { content: 'This is a tooltip' },
|
|
17
|
+
render: (args) => ({
|
|
18
|
+
components: { DXTooltip },
|
|
19
|
+
setup() { return { args }; },
|
|
20
|
+
template: '<DXTooltip v-bind="args"><button class="px-4 py-2 bg-slate-100 rounded">Hover me</button></DXTooltip>',
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const Positions = {
|
|
25
|
+
render: () => ({
|
|
26
|
+
components: { DXTooltip },
|
|
27
|
+
template: `
|
|
28
|
+
<div class="flex gap-8 justify-center py-12">
|
|
29
|
+
<DXTooltip content="Top tooltip" position="top">
|
|
30
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Top</button>
|
|
31
|
+
</DXTooltip>
|
|
32
|
+
<DXTooltip content="Bottom tooltip" position="bottom">
|
|
33
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Bottom</button>
|
|
34
|
+
</DXTooltip>
|
|
35
|
+
<DXTooltip content="Left tooltip" position="left">
|
|
36
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Left</button>
|
|
37
|
+
</DXTooltip>
|
|
38
|
+
<DXTooltip content="Right tooltip" position="right">
|
|
39
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Right</button>
|
|
40
|
+
</DXTooltip>
|
|
41
|
+
</div>
|
|
42
|
+
`,
|
|
43
|
+
}),
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const Colors = {
|
|
47
|
+
render: () => ({
|
|
48
|
+
components: { DXTooltip },
|
|
49
|
+
template: `
|
|
50
|
+
<div class="flex gap-4 justify-center py-12 flex-wrap">
|
|
51
|
+
<DXTooltip content="Dark tooltip" color="dark">
|
|
52
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Dark</button>
|
|
53
|
+
</DXTooltip>
|
|
54
|
+
<DXTooltip content="Light tooltip" color="light">
|
|
55
|
+
<button class="px-4 py-2 bg-slate-800 text-white rounded">Light</button>
|
|
56
|
+
</DXTooltip>
|
|
57
|
+
<DXTooltip content="Primary tooltip" color="primary">
|
|
58
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Primary</button>
|
|
59
|
+
</DXTooltip>
|
|
60
|
+
<DXTooltip content="Info tooltip" color="info">
|
|
61
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Info</button>
|
|
62
|
+
</DXTooltip>
|
|
63
|
+
<DXTooltip content="Success tooltip" color="success">
|
|
64
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Success</button>
|
|
65
|
+
</DXTooltip>
|
|
66
|
+
<DXTooltip content="Warning tooltip" color="warning">
|
|
67
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Warning</button>
|
|
68
|
+
</DXTooltip>
|
|
69
|
+
<DXTooltip content="Danger tooltip" color="danger">
|
|
70
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Danger</button>
|
|
71
|
+
</DXTooltip>
|
|
72
|
+
</div>
|
|
73
|
+
`,
|
|
74
|
+
}),
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const Sizes = {
|
|
78
|
+
render: () => ({
|
|
79
|
+
components: { DXTooltip },
|
|
80
|
+
template: `
|
|
81
|
+
<div class="flex gap-4 justify-center py-12 items-center">
|
|
82
|
+
<DXTooltip content="Extra small tooltip" size="xs">
|
|
83
|
+
<button class="px-4 py-2 bg-slate-100 rounded">XS</button>
|
|
84
|
+
</DXTooltip>
|
|
85
|
+
<DXTooltip content="Small tooltip" size="sm">
|
|
86
|
+
<button class="px-4 py-2 bg-slate-100 rounded">SM</button>
|
|
87
|
+
</DXTooltip>
|
|
88
|
+
<DXTooltip content="Medium tooltip" size="md">
|
|
89
|
+
<button class="px-4 py-2 bg-slate-100 rounded">MD</button>
|
|
90
|
+
</DXTooltip>
|
|
91
|
+
<DXTooltip content="Large tooltip" size="lg">
|
|
92
|
+
<button class="px-4 py-2 bg-slate-100 rounded">LG</button>
|
|
93
|
+
</DXTooltip>
|
|
94
|
+
<DXTooltip content="Extra large tooltip" size="xl">
|
|
95
|
+
<button class="px-4 py-2 bg-slate-100 rounded">XL</button>
|
|
96
|
+
</DXTooltip>
|
|
97
|
+
</div>
|
|
98
|
+
`,
|
|
99
|
+
}),
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const Animations = {
|
|
103
|
+
render: () => ({
|
|
104
|
+
components: { DXTooltip },
|
|
105
|
+
template: `
|
|
106
|
+
<div class="flex gap-4 justify-center py-12 flex-wrap">
|
|
107
|
+
<DXTooltip content="Fade animation" animation="fade">
|
|
108
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Fade</button>
|
|
109
|
+
</DXTooltip>
|
|
110
|
+
<DXTooltip content="Fade scale animation" animation="fade-scale">
|
|
111
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Fade Scale</button>
|
|
112
|
+
</DXTooltip>
|
|
113
|
+
<DXTooltip content="Slide up animation" animation="slide-up">
|
|
114
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Slide Up</button>
|
|
115
|
+
</DXTooltip>
|
|
116
|
+
<DXTooltip content="Slide down animation" animation="slide-down">
|
|
117
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Slide Down</button>
|
|
118
|
+
</DXTooltip>
|
|
119
|
+
<DXTooltip content="Slide left animation" animation="slide-left">
|
|
120
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Slide Left</button>
|
|
121
|
+
</DXTooltip>
|
|
122
|
+
<DXTooltip content="Slide right animation" animation="slide-right">
|
|
123
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Slide Right</button>
|
|
124
|
+
</DXTooltip>
|
|
125
|
+
<DXTooltip content="Custom tooltip animation" animation="tooltip-custom">
|
|
126
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Custom</button>
|
|
127
|
+
</DXTooltip>
|
|
128
|
+
</div>
|
|
129
|
+
`,
|
|
130
|
+
}),
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export const WithSlotContent = {
|
|
134
|
+
render: () => ({
|
|
135
|
+
components: { DXTooltip },
|
|
136
|
+
template: `
|
|
137
|
+
<div class="flex gap-4 justify-center py-12 flex-wrap">
|
|
138
|
+
<DXTooltip>
|
|
139
|
+
<template #content>
|
|
140
|
+
<div class="flex items-center gap-2">
|
|
141
|
+
<span>Custom content with</span>
|
|
142
|
+
<span class="font-semibold">bold text</span>
|
|
143
|
+
</div>
|
|
144
|
+
</template>
|
|
145
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Slot Content</button>
|
|
146
|
+
</DXTooltip>
|
|
147
|
+
<DXTooltip color="info">
|
|
148
|
+
<template #content>
|
|
149
|
+
<div>
|
|
150
|
+
<div class="font-semibold mb-1">Rich Content</div>
|
|
151
|
+
<div class="text-xs opacity-90">With multiple lines and formatting</div>
|
|
152
|
+
</div>
|
|
153
|
+
</template>
|
|
154
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Rich Slot</button>
|
|
155
|
+
</DXTooltip>
|
|
156
|
+
</div>
|
|
157
|
+
`,
|
|
158
|
+
}),
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export const MaxWidth = {
|
|
162
|
+
render: () => ({
|
|
163
|
+
components: { DXTooltip },
|
|
164
|
+
template: `
|
|
165
|
+
<div class="flex gap-4 justify-center py-12 flex-wrap items-center">
|
|
166
|
+
<DXTooltip content="Narrow tooltip with limited width" maxWidth="120px">
|
|
167
|
+
<button class="px-4 py-2 bg-slate-100 rounded">120px</button>
|
|
168
|
+
</DXTooltip>
|
|
169
|
+
<DXTooltip content="Medium width tooltip with more space for content" maxWidth="200px">
|
|
170
|
+
<button class="px-4 py-2 bg-slate-100 rounded">200px</button>
|
|
171
|
+
</DXTooltip>
|
|
172
|
+
<DXTooltip content="Wide tooltip with even more space for longer text content that might wrap to multiple lines" maxWidth="300px">
|
|
173
|
+
<button class="px-4 py-2 bg-slate-100 rounded">300px</button>
|
|
174
|
+
</DXTooltip>
|
|
175
|
+
</div>
|
|
176
|
+
`,
|
|
177
|
+
}),
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export const Combinations = {
|
|
181
|
+
render: () => ({
|
|
182
|
+
components: { DXTooltip },
|
|
183
|
+
template: `
|
|
184
|
+
<div class="space-y-8 py-12">
|
|
185
|
+
<div>
|
|
186
|
+
<h3 class="text-sm font-semibold text-slate-900 mb-4">Color + Size Combinations</h3>
|
|
187
|
+
<div class="flex gap-4 justify-center flex-wrap">
|
|
188
|
+
<DXTooltip content="Success large" color="success" size="lg">
|
|
189
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Success LG</button>
|
|
190
|
+
</DXTooltip>
|
|
191
|
+
<DXTooltip content="Warning small" color="warning" size="sm">
|
|
192
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Warning SM</button>
|
|
193
|
+
</DXTooltip>
|
|
194
|
+
<DXTooltip content="Danger extra small" color="danger" size="xs">
|
|
195
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Danger XS</button>
|
|
196
|
+
</DXTooltip>
|
|
197
|
+
</div>
|
|
198
|
+
</div>
|
|
199
|
+
<div>
|
|
200
|
+
<h3 class="text-sm font-semibold text-slate-900 mb-4">Position + Color Combinations</h3>
|
|
201
|
+
<div class="flex gap-4 justify-center flex-wrap">
|
|
202
|
+
<DXTooltip content="Info top" position="top" color="info">
|
|
203
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Top Info</button>
|
|
204
|
+
</DXTooltip>
|
|
205
|
+
<DXTooltip content="Success bottom" position="bottom" color="success">
|
|
206
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Bottom Success</button>
|
|
207
|
+
</DXTooltip>
|
|
208
|
+
<DXTooltip content="Warning left" position="left" color="warning">
|
|
209
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Left Warning</button>
|
|
210
|
+
</DXTooltip>
|
|
211
|
+
<DXTooltip content="Danger right" position="right" color="danger">
|
|
212
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Right Danger</button>
|
|
213
|
+
</DXTooltip>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
<div>
|
|
217
|
+
<h3 class="text-sm font-semibold text-slate-900 mb-4">Full Featured Example</h3>
|
|
218
|
+
<div class="flex justify-center">
|
|
219
|
+
<DXTooltip
|
|
220
|
+
content="This is a fully customized tooltip with all features combined: large size, success color, and custom animation"
|
|
221
|
+
size="lg"
|
|
222
|
+
color="success"
|
|
223
|
+
animation="fade-scale"
|
|
224
|
+
maxWidth="250px"
|
|
225
|
+
>
|
|
226
|
+
<button class="px-4 py-2 bg-slate-100 rounded">Full Featured</button>
|
|
227
|
+
</DXTooltip>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
`,
|
|
232
|
+
}),
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
export const LightTheme = {
|
|
236
|
+
args: { content: 'Light theme tooltip', color: 'light' },
|
|
237
|
+
render: (args) => ({
|
|
238
|
+
components: { DXTooltip },
|
|
239
|
+
setup() { return { args }; },
|
|
240
|
+
template: '<DXTooltip v-bind="args"><button class="px-4 py-2 bg-slate-800 text-white rounded">Hover me</button></DXTooltip>',
|
|
241
|
+
}),
|
|
242
|
+
};
|
|
243
|
+
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="relative inline-block"
|
|
4
|
+
@mouseenter="handleMouseEnter"
|
|
5
|
+
@mouseleave="handleMouseLeave"
|
|
6
|
+
@focus="handleFocus"
|
|
7
|
+
@blur="handleBlur"
|
|
8
|
+
data-component="DXTooltip"
|
|
9
|
+
>
|
|
10
|
+
<slot />
|
|
11
|
+
<Transition v-bind="transitionProps">
|
|
12
|
+
<div
|
|
13
|
+
v-if="isVisible && hasContent"
|
|
14
|
+
:class="tooltipClasses"
|
|
15
|
+
:style="tooltipStyles"
|
|
16
|
+
role="tooltip"
|
|
17
|
+
>
|
|
18
|
+
<slot name="content">{{ content }}</slot>
|
|
19
|
+
<div :class="arrowClasses" />
|
|
20
|
+
</div>
|
|
21
|
+
</Transition>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script setup>
|
|
26
|
+
import { ref, computed, onUnmounted, useSlots } from "vue";
|
|
27
|
+
import { useSize } from "@/composables/useSize";
|
|
28
|
+
import { useVariantTooltip, useTooltipArrow, useTooltipPosition } from "@/composables/useVariant";
|
|
29
|
+
import { useAnimationTransition, useTooltipCustomTransition } from "@/composables/useAnimation";
|
|
30
|
+
|
|
31
|
+
const props = defineProps({
|
|
32
|
+
/** Текст подсказки */
|
|
33
|
+
content: { type: String, default: "" },
|
|
34
|
+
/** Позиция: top | bottom | left | right */
|
|
35
|
+
position: { type: String, default: "top" },
|
|
36
|
+
/** Цвет: dark | light | primary | success | danger | warning | info */
|
|
37
|
+
color: { type: String, default: "dark" },
|
|
38
|
+
/** Размер: xs | sm | md | lg | xl */
|
|
39
|
+
size: { type: String, default: "md" },
|
|
40
|
+
/** Анимация: fade | fade-scale | slide-up | slide-down | slide-left | slide-right | tooltip-custom */
|
|
41
|
+
animation: { type: String, default: "tooltip-custom" },
|
|
42
|
+
/** Максимальная ширина */
|
|
43
|
+
maxWidth: { type: String, default: "200px" },
|
|
44
|
+
/** Задержка перед показом (мс) */
|
|
45
|
+
delay: { type: Number, default: 100 },
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const slots = useSlots();
|
|
49
|
+
const isVisible = ref(false);
|
|
50
|
+
const showTimeout = ref(null);
|
|
51
|
+
const hideTimeout = ref(null);
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Проверка наличия контента для отображения
|
|
55
|
+
*/
|
|
56
|
+
const hasContent = computed(() => {
|
|
57
|
+
return Boolean(props.content || slots.content);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Обработчик входа мыши
|
|
62
|
+
*/
|
|
63
|
+
const handleMouseEnter = () => {
|
|
64
|
+
// Очищаем таймер скрытия, если он был установлен
|
|
65
|
+
if (hideTimeout.value) {
|
|
66
|
+
clearTimeout(hideTimeout.value);
|
|
67
|
+
hideTimeout.value = null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Устанавливаем задержку перед показом
|
|
71
|
+
showTimeout.value = setTimeout(() => {
|
|
72
|
+
isVisible.value = true;
|
|
73
|
+
}, props.delay);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Обработчик выхода мыши
|
|
78
|
+
*/
|
|
79
|
+
const handleMouseLeave = () => {
|
|
80
|
+
// Очищаем таймер показа
|
|
81
|
+
if (showTimeout.value) {
|
|
82
|
+
clearTimeout(showTimeout.value);
|
|
83
|
+
showTimeout.value = null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Скрываем сразу без задержки
|
|
87
|
+
isVisible.value = false;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Обработчик фокуса
|
|
92
|
+
*/
|
|
93
|
+
const handleFocus = () => {
|
|
94
|
+
handleMouseEnter();
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Обработчик потери фокуса
|
|
99
|
+
*/
|
|
100
|
+
const handleBlur = () => {
|
|
101
|
+
handleMouseLeave();
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Конфигурация transition для анимации
|
|
106
|
+
* Для tooltip-custom использует адаптивную анимацию в зависимости от позиции
|
|
107
|
+
*/
|
|
108
|
+
const transitionProps = computed(() => {
|
|
109
|
+
if (props.animation === 'tooltip-custom') {
|
|
110
|
+
return useTooltipCustomTransition(props.position);
|
|
111
|
+
}
|
|
112
|
+
return useAnimationTransition(props.animation);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Классы для tooltip
|
|
117
|
+
*/
|
|
118
|
+
const tooltipClasses = computed(() => [
|
|
119
|
+
"absolute z-50 rounded-lg whitespace-normal",
|
|
120
|
+
useSize(props.size, "tooltip"),
|
|
121
|
+
useTooltipPosition(props.position),
|
|
122
|
+
useVariantTooltip(props.color),
|
|
123
|
+
]);
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Стили для tooltip
|
|
127
|
+
*/
|
|
128
|
+
const tooltipStyles = computed(() => ({
|
|
129
|
+
maxWidth: props.maxWidth,
|
|
130
|
+
}));
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Классы для стрелки tooltip
|
|
134
|
+
*/
|
|
135
|
+
const arrowClasses = computed(() => {
|
|
136
|
+
return useTooltipArrow(props.position, props.color);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Очистка таймеров при размонтировании компонента
|
|
141
|
+
*/
|
|
142
|
+
onUnmounted(() => {
|
|
143
|
+
if (showTimeout.value) {
|
|
144
|
+
clearTimeout(showTimeout.value);
|
|
145
|
+
}
|
|
146
|
+
if (hideTimeout.value) {
|
|
147
|
+
clearTimeout(hideTimeout.value);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
</script>
|
|
151
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Atom components - basic building blocks
|
|
2
|
+
export { default as DXAvatar } from './DXAvatar';
|
|
3
|
+
export { default as DXBackdrop } from './DXBackdrop';
|
|
4
|
+
export { default as DXBadge } from './DXBadge';
|
|
5
|
+
export { default as DXButton } from './DXButton';
|
|
6
|
+
export { default as DXCard } from './DXCard';
|
|
7
|
+
export { default as DXCheckbox } from './DXCheckbox';
|
|
8
|
+
export { default as DXDivider } from './DXDivider';
|
|
9
|
+
export { default as DXDropdownItem } from './DXDropdownItem';
|
|
10
|
+
export { default as DXFormLabel } from './DXFormLabel';
|
|
11
|
+
export { default as DXIcon } from './DXIcon';
|
|
12
|
+
export { default as DXIconWrapper } from './DXIconWrapper';
|
|
13
|
+
export { default as DXInputAddon } from './DXInputAddon';
|
|
14
|
+
export { default as DXLoader } from './DXLoader';
|
|
15
|
+
export { default as DXLink } from './DXLink';
|
|
16
|
+
export { default as DXProgress } from './DXProgress';
|
|
17
|
+
export { default as DXRadio } from './DXRadio';
|
|
18
|
+
export { default as DXSkeleton } from './DXSkeleton';
|
|
19
|
+
export { default as DXSlider } from './DXSlider';
|
|
20
|
+
export { default as DXTags } from './DXTags';
|
|
21
|
+
export { default as DXToast } from './DXToast';
|
|
22
|
+
export { default as DXToggle } from './DXToggle';
|
|
23
|
+
export { default as DXToggleButton } from './DXToggleButton';
|
|
24
|
+
export { default as DXTooltip } from './DXTooltip';
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import DXBox from './DXBox.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Layout/DXBox',
|
|
5
|
+
component: DXBox,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
parameters: {
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: `
|
|
11
|
+
# DXBox
|
|
12
|
+
|
|
13
|
+
Универсальный контейнер с настраиваемыми отступами, фоном, тенью и скруглением.
|
|
14
|
+
|
|
15
|
+
## Назначение
|
|
16
|
+
|
|
17
|
+
DXBox - базовый layout компонент для создания контейнеров с гибкой системой стилизации.
|
|
18
|
+
Предоставляет единообразный API для управления отступами, фоном, тенями, скруглением и границами.
|
|
19
|
+
|
|
20
|
+
## Архитектура
|
|
21
|
+
|
|
22
|
+
### Использует
|
|
23
|
+
- \`useSpacing\` composable - для унификации отступов (padding, margin)
|
|
24
|
+
- \`useClassComposition\` composable - для объединения классов
|
|
25
|
+
|
|
26
|
+
### Используется в
|
|
27
|
+
- Все layout компоненты как базовый строительный блок
|
|
28
|
+
- Карточки и контейнеры контента
|
|
29
|
+
- Модальные окна и панели
|
|
30
|
+
- Любые компоненты, требующие стилизованный контейнер
|
|
31
|
+
|
|
32
|
+
## Внутренняя логика
|
|
33
|
+
|
|
34
|
+
### Система отступов
|
|
35
|
+
Компонент поддерживает гибкую систему отступов:
|
|
36
|
+
- **Общие отступы**: \`p\` (padding), \`m\` (margin)
|
|
37
|
+
- **Односторонние отступы**: \`px\`, \`py\` (padding), \`mx\`, \`my\` (margin)
|
|
38
|
+
- **Специальное значение**: \`m="auto"\` для центрирования через margin
|
|
39
|
+
|
|
40
|
+
### Динамический HTML тег
|
|
41
|
+
Компонент использует \`<component :is="tag">\` для поддержки различных HTML тегов:
|
|
42
|
+
- По умолчанию: \`div\`
|
|
43
|
+
- Можно использовать: \`section\`, \`article\`, \`aside\`, \`header\`, \`footer\`, и т.д.
|
|
44
|
+
|
|
45
|
+
### Условное применение классов
|
|
46
|
+
Все стили применяются условно - классы добавляются только если соответствующие props указаны.
|
|
47
|
+
Это позволяет создавать минималистичные контейнеры без лишних классов.
|
|
48
|
+
|
|
49
|
+
## Особенности
|
|
50
|
+
|
|
51
|
+
### Гибкая система отступов
|
|
52
|
+
\`\`\`vue
|
|
53
|
+
<DXBox p="md" px="lg" py="sm">Content</DXBox>
|
|
54
|
+
<DXBox m="auto" mx="lg">Centered</DXBox>
|
|
55
|
+
\`\`\`
|
|
56
|
+
|
|
57
|
+
### Семантические теги
|
|
58
|
+
\`\`\`vue
|
|
59
|
+
<DXBox tag="section" p="lg" bg="white">Section content</DXBox>
|
|
60
|
+
<DXBox tag="article" p="md" rounded="lg">Article content</DXBox>
|
|
61
|
+
\`\`\`
|
|
62
|
+
|
|
63
|
+
### Комбинирование стилей
|
|
64
|
+
\`\`\`vue
|
|
65
|
+
<DXBox p="lg" bg="white" rounded="xl" shadow="lg" border>
|
|
66
|
+
Styled container
|
|
67
|
+
</DXBox>
|
|
68
|
+
\`\`\`
|
|
69
|
+
|
|
70
|
+
## Ограничения
|
|
71
|
+
|
|
72
|
+
- Отступы используют предопределенные значения из \`useSpacing\` (none, xs, sm, md, lg, xl)
|
|
73
|
+
- Для кастомных отступов используйте CSS классы через \`class\` prop
|
|
74
|
+
- \`m="auto"\` работает только для горизонтального центрирования
|
|
75
|
+
`,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
argTypes: {
|
|
80
|
+
tag: {
|
|
81
|
+
control: 'text',
|
|
82
|
+
description: 'HTML тег для рендеринга компонента. По умолчанию используется div, но можно использовать любой семантический тег (section, article, aside, header, footer и т.д.).',
|
|
83
|
+
table: {
|
|
84
|
+
type: { summary: 'string' },
|
|
85
|
+
defaultValue: { summary: '"div"' },
|
|
86
|
+
category: 'Layout',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
p: {
|
|
90
|
+
control: 'select',
|
|
91
|
+
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
|
|
92
|
+
description: 'Общий padding (отступ внутри) для всех сторон. Использует систему spacing из useSpacing composable.',
|
|
93
|
+
table: {
|
|
94
|
+
type: { summary: 'string' },
|
|
95
|
+
defaultValue: { summary: '""' },
|
|
96
|
+
category: 'Spacing',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
px: {
|
|
100
|
+
control: 'select',
|
|
101
|
+
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
|
|
102
|
+
description: 'Горизонтальный padding (отступ слева и справа). Имеет приоритет над общим p для горизонтальных отступов.',
|
|
103
|
+
table: {
|
|
104
|
+
type: { summary: 'string' },
|
|
105
|
+
defaultValue: { summary: '""' },
|
|
106
|
+
category: 'Spacing',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
py: {
|
|
110
|
+
control: 'select',
|
|
111
|
+
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl'],
|
|
112
|
+
description: 'Вертикальный padding (отступ сверху и снизу). Имеет приоритет над общим p для вертикальных отступов.',
|
|
113
|
+
table: {
|
|
114
|
+
type: { summary: 'string' },
|
|
115
|
+
defaultValue: { summary: '""' },
|
|
116
|
+
category: 'Spacing',
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
m: {
|
|
120
|
+
control: 'select',
|
|
121
|
+
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl', 'auto'],
|
|
122
|
+
description: 'Общий margin (отступ снаружи) для всех сторон. Поддерживает специальное значение "auto" для центрирования.',
|
|
123
|
+
table: {
|
|
124
|
+
type: { summary: 'string' },
|
|
125
|
+
defaultValue: { summary: '""' },
|
|
126
|
+
category: 'Spacing',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
mx: {
|
|
130
|
+
control: 'select',
|
|
131
|
+
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl', 'auto'],
|
|
132
|
+
description: 'Горизонтальный margin (отступ слева и справа). Поддерживает значение "auto" для горизонтального центрирования.',
|
|
133
|
+
table: {
|
|
134
|
+
type: { summary: 'string' },
|
|
135
|
+
defaultValue: { summary: '""' },
|
|
136
|
+
category: 'Spacing',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
my: {
|
|
140
|
+
control: 'select',
|
|
141
|
+
options: ['none', 'xs', 'sm', 'md', 'lg', 'xl', 'auto'],
|
|
142
|
+
description: 'Вертикальный margin (отступ сверху и снизу). Поддерживает значение "auto" для вертикального центрирования.',
|
|
143
|
+
table: {
|
|
144
|
+
type: { summary: 'string' },
|
|
145
|
+
defaultValue: { summary: '""' },
|
|
146
|
+
category: 'Spacing',
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
rounded: {
|
|
150
|
+
control: 'select',
|
|
151
|
+
options: ['none', 'sm', 'md', 'lg', 'xl', '2xl', 'full'],
|
|
152
|
+
description: 'Скругление углов контейнера. Определяет border-radius через Tailwind классы.',
|
|
153
|
+
table: {
|
|
154
|
+
type: { summary: 'string' },
|
|
155
|
+
defaultValue: { summary: '""' },
|
|
156
|
+
category: 'Appearance',
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
bg: {
|
|
160
|
+
control: 'select',
|
|
161
|
+
options: ['white', 'slate', 'transparent'],
|
|
162
|
+
description: 'Цвет фона контейнера. Предопределенные варианты: white (белый), slate (светло-серый), transparent (прозрачный).',
|
|
163
|
+
table: {
|
|
164
|
+
type: { summary: 'string' },
|
|
165
|
+
defaultValue: { summary: '""' },
|
|
166
|
+
category: 'Appearance',
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
shadow: {
|
|
170
|
+
control: 'select',
|
|
171
|
+
options: ['none', 'sm', 'md', 'lg', 'xl'],
|
|
172
|
+
description: 'Тень контейнера. Определяет box-shadow через Tailwind классы. Используется для создания глубины и визуального разделения.',
|
|
173
|
+
table: {
|
|
174
|
+
type: { summary: 'string' },
|
|
175
|
+
defaultValue: { summary: '""' },
|
|
176
|
+
category: 'Appearance',
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
border: {
|
|
180
|
+
control: 'boolean',
|
|
181
|
+
description: 'Добавляет рамку вокруг контейнера. Применяет класс border border-slate-200 для тонкой серой рамки.',
|
|
182
|
+
table: {
|
|
183
|
+
type: { summary: 'boolean' },
|
|
184
|
+
defaultValue: { summary: 'false' },
|
|
185
|
+
category: 'Appearance',
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export const Default = {
|
|
192
|
+
args: { p: 'md', bg: 'slate', rounded: 'lg' },
|
|
193
|
+
parameters: {
|
|
194
|
+
docs: {
|
|
195
|
+
description: {
|
|
196
|
+
story: 'Базовый пример использования DXBox с padding, фоном и скруглением. Это стандартная конфигурация для создания стилизованного контейнера.',
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
render: (args) => ({
|
|
201
|
+
components: { DXBox },
|
|
202
|
+
setup() { return { args }; },
|
|
203
|
+
template: '<DXBox v-bind="args">Content inside box</DXBox>',
|
|
204
|
+
}),
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export const WithBorder = {
|
|
208
|
+
args: { p: 'lg', bg: 'white', rounded: 'xl', border: true },
|
|
209
|
+
parameters: {
|
|
210
|
+
docs: {
|
|
211
|
+
description: {
|
|
212
|
+
story: 'DXBox с рамкой. Используется для визуального разделения контента. Рамка имеет тонкий серый цвет (border-slate-200).',
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
render: (args) => ({
|
|
217
|
+
components: { DXBox },
|
|
218
|
+
setup() { return { args }; },
|
|
219
|
+
template: '<DXBox v-bind="args">Box with border</DXBox>',
|
|
220
|
+
}),
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
export const WithShadow = {
|
|
224
|
+
args: { p: 'lg', bg: 'white', rounded: 'xl', shadow: 'lg' },
|
|
225
|
+
parameters: {
|
|
226
|
+
docs: {
|
|
227
|
+
description: {
|
|
228
|
+
story: 'DXBox с тенью. Тень создает эффект глубины и поднятия элемента над фоном. Используется для карточек, модальных окон и выделения важного контента.',
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
render: (args) => ({
|
|
233
|
+
components: { DXBox },
|
|
234
|
+
setup() { return { args }; },
|
|
235
|
+
template: '<DXBox v-bind="args">Box with shadow</DXBox>',
|
|
236
|
+
}),
|
|
237
|
+
};
|
|
238
|
+
|