dxd-style-code 0.1.7 → 0.1.9

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.
Files changed (335) hide show
  1. package/dist/dxd-style-code.js +11974 -3725
  2. package/dist/dxd-style-code.umd.cjs +10 -1
  3. package/dist/style.css +1 -1
  4. package/package.json +14 -6
  5. package/src/components/atoms/DXAvatar/DXAvatar.stories.js +319 -0
  6. package/src/components/atoms/DXAvatar/DXAvatar.vue +167 -0
  7. package/src/components/atoms/DXAvatar/index.js +2 -0
  8. package/src/components/atoms/DXBackdrop/DXBackdrop.stories.js +341 -0
  9. package/src/components/atoms/DXBackdrop/DXBackdrop.vue +102 -0
  10. package/src/components/atoms/DXBackdrop/index.js +2 -0
  11. package/src/components/atoms/DXBadge/DXBadge.stories.js +239 -0
  12. package/src/components/atoms/DXBadge/DXBadge.vue +45 -0
  13. package/src/components/atoms/DXBadge/index.js +2 -0
  14. package/src/components/atoms/DXButton/DXButton.stories.js +178 -0
  15. package/src/components/atoms/DXButton/DXButton.vue +84 -0
  16. package/src/components/atoms/DXButton/index.js +2 -0
  17. package/src/components/atoms/DXCard/DXCard.stories.js +133 -0
  18. package/src/components/atoms/DXCard/DXCard.vue +46 -0
  19. package/src/components/atoms/DXCard/index.js +2 -0
  20. package/src/components/atoms/DXCheckbox/DXCheckbox.stories.js +294 -0
  21. package/src/components/atoms/DXCheckbox/DXCheckbox.vue +191 -0
  22. package/src/components/atoms/DXCheckbox/index.js +2 -0
  23. package/src/components/atoms/DXDivider/DXDivider.stories.js +135 -0
  24. package/src/components/atoms/DXDivider/DXDivider.vue +74 -0
  25. package/src/components/atoms/DXDivider/index.js +2 -0
  26. package/src/components/atoms/DXDropdownItem/DXDropdownItem.vue +116 -0
  27. package/src/components/atoms/DXDropdownItem/index.js +2 -0
  28. package/src/components/atoms/DXFormLabel/DXFormLabel.stories.js +194 -0
  29. package/src/components/atoms/DXFormLabel/DXFormLabel.vue +94 -0
  30. package/src/components/atoms/DXFormLabel/index.js +2 -0
  31. package/src/components/atoms/DXIcon/DXIcon.stories.js +156 -0
  32. package/src/components/atoms/DXIcon/DXIcon.vue +102 -0
  33. package/src/components/atoms/DXIcon/index.js +3 -0
  34. package/src/components/atoms/DXIconWrapper/DXIconWrapper.stories.js +237 -0
  35. package/src/components/atoms/DXIconWrapper/DXIconWrapper.vue +79 -0
  36. package/src/components/atoms/DXIconWrapper/index.js +2 -0
  37. package/src/components/atoms/DXInputAddon/DXInputAddon.stories.js +230 -0
  38. package/src/components/atoms/DXInputAddon/DXInputAddon.vue +64 -0
  39. package/src/components/atoms/DXInputAddon/index.js +2 -0
  40. package/src/components/atoms/DXLink/DXLink.stories.js +475 -0
  41. package/src/components/atoms/DXLink/DXLink.vue +229 -0
  42. package/src/components/atoms/DXLink/index.js +2 -0
  43. package/src/components/atoms/DXLoader/DXLoader.stories.js +280 -0
  44. package/src/components/atoms/DXLoader/DXLoader.vue +78 -0
  45. package/src/components/atoms/DXLoader/index.js +2 -0
  46. package/src/components/atoms/DXProgress/DXProgress.stories.js +312 -0
  47. package/src/components/atoms/DXProgress/DXProgress.vue +85 -0
  48. package/src/components/atoms/DXProgress/index.js +2 -0
  49. package/src/components/atoms/DXQuote/DXQuote.stories.js +255 -0
  50. package/src/components/atoms/DXQuote/DXQuote.vue +97 -0
  51. package/src/components/atoms/DXQuote/index.js +2 -0
  52. package/src/components/atoms/DXRadio/DXRadio.stories.js +277 -0
  53. package/src/components/atoms/DXRadio/DXRadio.vue +144 -0
  54. package/src/components/atoms/DXRadio/index.js +2 -0
  55. package/src/components/atoms/DXSkeleton/DXSkeleton.stories.js +50 -0
  56. package/src/components/atoms/DXSkeleton/DXSkeleton.vue +19 -0
  57. package/src/components/atoms/DXSkeleton/index.js +2 -0
  58. package/src/components/atoms/DXSlider/DXSlider.stories.js +522 -0
  59. package/src/components/atoms/DXSlider/DXSlider.vue +338 -0
  60. package/src/components/atoms/DXSlider/index.js +2 -0
  61. package/src/components/atoms/DXTags/DXTags.stories.js +206 -0
  62. package/src/components/atoms/DXTags/DXTags.vue +111 -0
  63. package/src/components/atoms/DXTags/index.js +2 -0
  64. package/src/components/atoms/DXToast/DXToast.stories.js +40 -0
  65. package/src/components/atoms/DXToast/DXToast.vue +32 -0
  66. package/src/components/atoms/DXToast/index.js +2 -0
  67. package/src/components/atoms/DXToggle/DXToggle.stories.js +143 -0
  68. package/src/components/atoms/DXToggle/DXToggle.vue +142 -0
  69. package/src/components/atoms/DXToggle/index.js +2 -0
  70. package/src/components/atoms/DXToggleButton/DXToggleButton.stories.js +513 -0
  71. package/src/components/atoms/DXToggleButton/DXToggleButton.vue +140 -0
  72. package/src/components/atoms/DXToggleButton/index.js +2 -0
  73. package/src/components/atoms/DXTooltip/DXTooltip.stories.js +243 -0
  74. package/src/components/atoms/DXTooltip/DXTooltip.vue +151 -0
  75. package/src/components/atoms/DXTooltip/index.js +2 -0
  76. package/src/components/atoms/index.js +24 -0
  77. package/src/components/index.js +20 -0
  78. package/src/components/layout/DXBox/DXBox.stories.js +238 -0
  79. package/src/components/layout/DXBox/DXBox.vue +198 -0
  80. package/src/components/layout/DXBox/index.js +2 -0
  81. package/src/components/layout/DXContainer/DXContainer.stories.js +147 -0
  82. package/src/components/layout/DXContainer/DXContainer.vue +83 -0
  83. package/src/components/layout/DXContainer/index.js +2 -0
  84. package/src/components/layout/DXFlex/DXFlex.stories.js +210 -0
  85. package/src/components/layout/DXFlex/DXFlex.vue +149 -0
  86. package/src/components/layout/DXFlex/index.js +2 -0
  87. package/src/components/layout/DXGrid/DXGrid.stories.js +238 -0
  88. package/src/components/layout/DXGrid/DXGrid.vue +167 -0
  89. package/src/components/layout/DXGrid/index.js +2 -0
  90. package/src/components/layout/DXSpacer/DXSpacer.stories.js +187 -0
  91. package/src/components/layout/DXSpacer/DXSpacer.vue +102 -0
  92. package/src/components/layout/DXSpacer/index.js +2 -0
  93. package/src/components/layout/DXStack/DXStack.stories.js +199 -0
  94. package/src/components/layout/DXStack/DXStack.vue +140 -0
  95. package/src/components/layout/DXStack/index.js +2 -0
  96. package/src/components/layout/index.js +8 -0
  97. package/src/components/molecules/DXActionButtons/DXActionButtons.stories.js +288 -0
  98. package/src/components/molecules/DXActionButtons/DXActionButtons.vue +106 -0
  99. package/src/components/molecules/DXActionButtons/index.js +2 -0
  100. package/src/components/molecules/DXAlert/DXAlert.stories.js +70 -0
  101. package/src/components/molecules/DXAlert/DXAlert.vue +116 -0
  102. package/src/components/molecules/DXAlert/index.js +2 -0
  103. package/src/components/molecules/DXBaseTable/DXBaseTable.stories.js +433 -0
  104. package/src/components/molecules/DXBaseTable/DXBaseTable.vue +459 -0
  105. package/src/components/molecules/DXBaseTable/index.js +4 -0
  106. package/src/components/molecules/DXBreadcrumb/DXBreadcrumb.stories.js +227 -0
  107. package/src/components/molecules/DXBreadcrumb/DXBreadcrumb.vue +96 -0
  108. package/src/components/molecules/DXBreadcrumb/index.js +2 -0
  109. package/src/components/molecules/DXButtonGroup/DXButtonGroup.stories.js +26 -0
  110. package/src/components/molecules/DXButtonGroup/DXButtonGroup.vue +78 -0
  111. package/src/components/molecules/DXButtonGroup/index.js +2 -0
  112. package/src/components/molecules/DXCloseButton/DXCloseButton.stories.js +53 -0
  113. package/src/components/molecules/DXCloseButton/DXCloseButton.vue +62 -0
  114. package/src/components/molecules/DXCloseButton/index.js +3 -0
  115. package/src/components/molecules/DXComboBox/DXComboBox.stories.js +62 -0
  116. package/src/components/molecules/DXComboBox/DXComboBox.vue +167 -0
  117. package/src/components/molecules/DXComboBox/index.js +2 -0
  118. package/src/components/molecules/DXCopyField/DXCopyField.stories.js +231 -0
  119. package/src/components/molecules/DXCopyField/DXCopyField.vue +75 -0
  120. package/src/components/molecules/DXCopyField/index.js +2 -0
  121. package/src/components/molecules/DXDataFilter/DXDataFilter.stories.js +275 -0
  122. package/src/components/molecules/DXDataFilter/DXDataFilter.vue +385 -0
  123. package/src/components/molecules/DXDataFilter/index.js +2 -0
  124. package/src/components/molecules/DXDatePicker/DXDatePicker.stories.js +42 -0
  125. package/src/components/molecules/DXDatePicker/DXDatePicker.vue +121 -0
  126. package/src/components/molecules/DXDatePicker/index.js +2 -0
  127. package/src/components/molecules/DXDropdownDivider/DXDropdownDivider.vue +30 -0
  128. package/src/components/molecules/DXDropdownDivider/index.js +2 -0
  129. package/src/components/molecules/DXFileUpload/DXFileUpload.stories.js +53 -0
  130. package/src/components/molecules/DXFileUpload/DXFileUpload.vue +199 -0
  131. package/src/components/molecules/DXFileUpload/index.js +2 -0
  132. package/src/components/molecules/DXFilterGroup/DXFilterGroup.stories.js +43 -0
  133. package/src/components/molecules/DXFilterGroup/DXFilterGroup.vue +43 -0
  134. package/src/components/molecules/DXFilterGroup/index.js +2 -0
  135. package/src/components/molecules/DXFormControl/DXFormControl.stories.js +69 -0
  136. package/src/components/molecules/DXFormControl/DXFormControl.vue +72 -0
  137. package/src/components/molecules/DXFormControl/index.js +2 -0
  138. package/src/components/molecules/DXInput/DXInput.stories.js +291 -0
  139. package/src/components/molecules/DXInput/DXInput.vue +156 -0
  140. package/src/components/molecules/DXInput/index.js +3 -0
  141. package/src/components/molecules/DXInputGroup/DXInputGroup.stories.js +228 -0
  142. package/src/components/molecules/DXInputGroup/DXInputGroup.vue +64 -0
  143. package/src/components/molecules/DXInputGroup/index.js +2 -0
  144. package/src/components/molecules/DXInputMask/DXInputMask.stories.js +53 -0
  145. package/src/components/molecules/DXInputMask/DXInputMask.vue +89 -0
  146. package/src/components/molecules/DXInputMask/index.js +2 -0
  147. package/src/components/molecules/DXMenu/DXMenu.stories.js +379 -0
  148. package/src/components/molecules/DXMenu/DXMenu.vue +331 -0
  149. package/src/components/molecules/DXMenu/README.md +479 -0
  150. package/src/components/molecules/DXMenu/index.js +2 -0
  151. package/src/components/molecules/DXPagination/DXPagination.stories.js +62 -0
  152. package/src/components/molecules/DXPagination/DXPagination.vue +123 -0
  153. package/src/components/molecules/DXPagination/index.js +2 -0
  154. package/src/components/molecules/DXPasswordInput/DXPasswordInput.stories.js +42 -0
  155. package/src/components/molecules/DXPasswordInput/DXPasswordInput.vue +74 -0
  156. package/src/components/molecules/DXPasswordInput/index.js +2 -0
  157. package/src/components/molecules/DXRadioCard/DXRadioCard.stories.js +60 -0
  158. package/src/components/molecules/DXRadioCard/DXRadioCard.vue +71 -0
  159. package/src/components/molecules/DXRadioCard/index.js +2 -0
  160. package/src/components/molecules/DXRadioGroup/DXRadioGroup.stories.js +297 -0
  161. package/src/components/molecules/DXRadioGroup/DXRadioGroup.vue +73 -0
  162. package/src/components/molecules/DXRadioGroup/index.js +2 -0
  163. package/src/components/molecules/DXRating/DXRating.stories.js +322 -0
  164. package/src/components/molecules/DXRating/DXRating.vue +402 -0
  165. package/src/components/molecules/DXRating/index.js +2 -0
  166. package/src/components/molecules/DXSearchBar/DXSearchBar.stories.js +357 -0
  167. package/src/components/molecules/DXSearchBar/DXSearchBar.vue +525 -0
  168. package/src/components/molecules/DXSearchBar/index.js +2 -0
  169. package/src/components/molecules/DXSearchSelect/DXSearchSelect.stories.js +50 -0
  170. package/src/components/molecules/DXSearchSelect/DXSearchSelect.vue +207 -0
  171. package/src/components/molecules/DXSearchSelect/index.js +2 -0
  172. package/src/components/molecules/DXSegmentedControl/DXSegmentedControl.stories.js +326 -0
  173. package/src/components/molecules/DXSegmentedControl/DXSegmentedControl.vue +116 -0
  174. package/src/components/molecules/DXSegmentedControl/index.js +2 -0
  175. package/src/components/molecules/DXSelect/DXSelect.stories.js +259 -0
  176. package/src/components/molecules/DXSelect/DXSelect.vue +149 -0
  177. package/src/components/molecules/DXSelect/index.js +3 -0
  178. package/src/components/molecules/DXStatCard/DXStatCard.stories.js +335 -0
  179. package/src/components/molecules/DXStatCard/DXStatCard.vue +309 -0
  180. package/src/components/molecules/DXStatCard/index.js +2 -0
  181. package/src/components/molecules/DXTableFiltersPanel/DXTableFiltersPanel.vue +72 -0
  182. package/src/components/molecules/DXTableFiltersPanel/index.js +7 -0
  183. package/src/components/molecules/DXTablePagination/DXTablePagination.stories.js +236 -0
  184. package/src/components/molecules/DXTablePagination/DXTablePagination.vue +93 -0
  185. package/src/components/molecules/DXTablePagination/index.js +2 -0
  186. package/src/components/molecules/DXTableToolbar/DXTableToolbar.stories.js +271 -0
  187. package/src/components/molecules/DXTableToolbar/DXTableToolbar.vue +102 -0
  188. package/src/components/molecules/DXTableToolbar/index.js +2 -0
  189. package/src/components/molecules/DXTextarea/DXTextarea.stories.js +239 -0
  190. package/src/components/molecules/DXTextarea/DXTextarea.vue +158 -0
  191. package/src/components/molecules/DXTextarea/index.js +3 -0
  192. package/src/components/molecules/DXTimePicker/DXTimePicker.stories.js +282 -0
  193. package/src/components/molecules/DXTimePicker/DXTimePicker.vue +640 -0
  194. package/src/components/molecules/DXTimePicker/index.js +2 -0
  195. package/src/components/molecules/DXValidationIcon/DXValidationIcon.stories.js +60 -0
  196. package/src/components/molecules/DXValidationIcon/DXValidationIcon.vue +53 -0
  197. package/src/components/molecules/DXValidationIcon/index.js +3 -0
  198. package/src/components/molecules/index.js +34 -0
  199. package/src/components/organisms/DXAccordion/DXAccordion.stories.js +33 -0
  200. package/src/components/organisms/DXAccordion/DXAccordion.vue +104 -0
  201. package/src/components/organisms/DXAccordion/index.js +2 -0
  202. package/src/components/organisms/DXAppLayout/DXAppLayout.stories.js +689 -0
  203. package/src/components/organisms/DXAppLayout/DXAppLayout.vue +460 -0
  204. package/src/components/organisms/DXAppLayout/index.js +2 -0
  205. package/src/components/organisms/DXAuthenticationForm/DXAuthenticationForm.stories.js +232 -0
  206. package/src/components/organisms/DXAuthenticationForm/DXAuthenticationForm.vue +458 -0
  207. package/src/components/organisms/DXAuthenticationForm/index.js +2 -0
  208. package/src/components/organisms/DXChartContainer/DXChartContainer.stories.js +286 -0
  209. package/src/components/organisms/DXChartContainer/DXChartContainer.vue +273 -0
  210. package/src/components/organisms/DXChartContainer/index.js +2 -0
  211. package/src/components/organisms/DXChatInterface/DXChatInterface.stories.js +164 -0
  212. package/src/components/organisms/DXChatInterface/DXChatInterface.vue +583 -0
  213. package/src/components/organisms/DXChatInterface/index.js +2 -0
  214. package/src/components/organisms/DXCommentSection/DXCommentSection.stories.js +173 -0
  215. package/src/components/organisms/DXCommentSection/DXCommentSection.vue +487 -0
  216. package/src/components/organisms/DXCommentSection/index.js +2 -0
  217. package/src/components/organisms/DXDashboardGrid/DXDashboardGrid.stories.js +331 -0
  218. package/src/components/organisms/DXDashboardGrid/DXDashboardGrid.vue +309 -0
  219. package/src/components/organisms/DXDashboardGrid/index.js +2 -0
  220. package/src/components/organisms/DXDashboardWidget/DXDashboardWidget.stories.js +271 -0
  221. package/src/components/organisms/DXDashboardWidget/DXDashboardWidget.vue +260 -0
  222. package/src/components/organisms/DXDashboardWidget/index.js +2 -0
  223. package/src/components/organisms/DXDataTable/DXDataTable.stories.js +247 -0
  224. package/src/components/organisms/DXDataTable/DXDataTable.vue +496 -0
  225. package/src/components/organisms/DXDataTable/index.js +2 -0
  226. package/src/components/organisms/DXDropdown/DXDropdown.stories.js +795 -0
  227. package/src/components/organisms/DXDropdown/DXDropdown.vue +238 -0
  228. package/src/components/organisms/DXDropdown/index.js +2 -0
  229. package/src/components/organisms/DXEmptyState/DXEmptyState.stories.js +37 -0
  230. package/src/components/organisms/DXEmptyState/DXEmptyState.vue +41 -0
  231. package/src/components/organisms/DXEmptyState/index.js +2 -0
  232. package/src/components/organisms/DXFormWizard/DXFormWizard.stories.js +378 -0
  233. package/src/components/organisms/DXFormWizard/DXFormWizard.vue +578 -0
  234. package/src/components/organisms/DXFormWizard/index.js +2 -0
  235. package/src/components/organisms/DXHeaderBar/DXHeaderBar.stories.js +448 -0
  236. package/src/components/organisms/DXHeaderBar/DXHeaderBar.vue +190 -0
  237. package/src/components/organisms/DXHeaderBar/index.js +2 -0
  238. package/src/components/organisms/DXMediaGallery/DXMediaGallery.stories.js +347 -0
  239. package/src/components/organisms/DXMediaGallery/DXMediaGallery.vue +422 -0
  240. package/src/components/organisms/DXMediaGallery/index.js +2 -0
  241. package/src/components/organisms/DXModal/DXModal.stories.js +138 -0
  242. package/src/components/organisms/DXModal/DXModal.vue +213 -0
  243. package/src/components/organisms/DXModal/index.js +2 -0
  244. package/src/components/organisms/DXNotificationCenter/DXNotificationCenter.stories.js +183 -0
  245. package/src/components/organisms/DXNotificationCenter/DXNotificationCenter.vue +566 -0
  246. package/src/components/organisms/DXNotificationCenter/index.js +2 -0
  247. package/src/components/organisms/DXReportGenerator/DXReportGenerator.stories.js +199 -0
  248. package/src/components/organisms/DXReportGenerator/DXReportGenerator.vue +344 -0
  249. package/src/components/organisms/DXReportGenerator/index.js +2 -0
  250. package/src/components/organisms/DXSettingsPanel/DXSettingsPanel.stories.js +245 -0
  251. package/src/components/organisms/DXSettingsPanel/DXSettingsPanel.vue +454 -0
  252. package/src/components/organisms/DXSettingsPanel/index.js +2 -0
  253. package/src/components/organisms/DXSidebar/DXSidebar.stories.js +316 -0
  254. package/src/components/organisms/DXSidebar/DXSidebar.vue +212 -0
  255. package/src/components/organisms/DXSidebar/index.js +2 -0
  256. package/src/components/organisms/DXSidebarMenu/DATA_STRUCTURE.md +299 -0
  257. package/src/components/organisms/DXSidebarMenu/DXSidebarMenu.stories.js +729 -0
  258. package/src/components/organisms/DXSidebarMenu/DXSidebarMenu.vue +257 -0
  259. package/src/components/organisms/DXSidebarMenu/DXSidebarMenuItem.vue +249 -0
  260. package/src/components/organisms/DXSidebarMenu/README.md +333 -0
  261. package/src/components/organisms/DXSidebarMenu/index.js +3 -0
  262. package/src/components/organisms/DXTable/DXTable.stories.js +550 -0
  263. package/src/components/organisms/DXTable/DXTable.vue +324 -0
  264. package/src/components/organisms/DXTable/index.js +2 -0
  265. package/src/components/organisms/DXTabs/DXTabs.stories.js +407 -0
  266. package/src/components/organisms/DXTabs/DXTabs.vue +301 -0
  267. package/src/components/organisms/DXTabs/index.js +2 -0
  268. package/src/components/organisms/DXUserProfileCard/DXUserProfileCard.stories.js +194 -0
  269. package/src/components/organisms/DXUserProfileCard/DXUserProfileCard.vue +403 -0
  270. package/src/components/organisms/DXUserProfileCard/index.js +2 -0
  271. package/src/components/organisms/DXWizard/DXWizard.stories.js +212 -0
  272. package/src/components/organisms/DXWizard/DXWizard.vue +615 -0
  273. package/src/components/organisms/DXWizard/index.js +2 -0
  274. package/src/components/organisms/index.js +25 -0
  275. package/src/components/typography/DXBlockquote/DXBlockquote.stories.js +33 -0
  276. package/src/components/typography/DXBlockquote/DXBlockquote.vue +44 -0
  277. package/src/components/typography/DXBlockquote/index.js +2 -0
  278. package/src/components/typography/DXCode/DXCode.stories.js +29 -0
  279. package/src/components/typography/DXCode/DXCode.vue +46 -0
  280. package/src/components/typography/DXCode/index.js +2 -0
  281. package/src/components/typography/DXHeading/DXHeading.stories.js +54 -0
  282. package/src/components/typography/DXHeading/DXHeading.vue +68 -0
  283. package/src/components/typography/DXHeading/index.js +2 -0
  284. package/src/components/typography/DXLabel/DXLabel.stories.js +40 -0
  285. package/src/components/typography/DXLabel/DXLabel.vue +49 -0
  286. package/src/components/typography/DXLabel/index.js +2 -0
  287. package/src/components/typography/DXList/DXList.stories.js +50 -0
  288. package/src/components/typography/DXList/DXList.vue +55 -0
  289. package/src/components/typography/DXList/index.js +2 -0
  290. package/src/components/typography/DXText/DXText.stories.js +47 -0
  291. package/src/components/typography/DXText/DXText.vue +67 -0
  292. package/src/components/typography/DXText/index.js +2 -0
  293. package/src/components/typography/index.js +8 -0
  294. package/src/components/utilities/DXAnimatePresence/DXAnimatePresence.stories.js +335 -0
  295. package/src/components/utilities/DXAnimatePresence/DXAnimatePresence.vue +207 -0
  296. package/src/components/utilities/DXAnimatePresence/index.js +2 -0
  297. package/src/components/utilities/DXBreakpointProvider/DXBreakpointProvider.stories.js +321 -0
  298. package/src/components/utilities/DXBreakpointProvider/DXBreakpointProvider.vue +158 -0
  299. package/src/components/utilities/DXBreakpointProvider/index.js +2 -0
  300. package/src/components/utilities/DXObserver/DXObserver.stories.js +324 -0
  301. package/src/components/utilities/DXObserver/DXObserver.vue +182 -0
  302. package/src/components/utilities/DXObserver/index.js +2 -0
  303. package/src/components/utilities/DXPortal/DXPortal.stories.js +267 -0
  304. package/src/components/utilities/DXPortal/DXPortal.vue +69 -0
  305. package/src/components/utilities/DXPortal/index.js +2 -0
  306. package/src/components/utilities/DXStaggeredAnimation/DXStaggeredAnimation.stories.js +339 -0
  307. package/src/components/utilities/DXStaggeredAnimation/DXStaggeredAnimation.vue +155 -0
  308. package/src/components/utilities/DXStaggeredAnimation/index.js +2 -0
  309. package/src/components/utilities/DXThemeProvider/DXThemeProvider.stories.js +327 -0
  310. package/src/components/utilities/DXThemeProvider/DXThemeProvider.vue +227 -0
  311. package/src/components/utilities/DXThemeProvider/index.js +2 -0
  312. package/src/components/utilities/DXTransitionGroup/DXTransitionGroup.stories.js +368 -0
  313. package/src/components/utilities/DXTransitionGroup/DXTransitionGroup.vue +212 -0
  314. package/src/components/utilities/DXTransitionGroup/index.js +2 -0
  315. package/src/components/utilities/index.js +9 -0
  316. package/src/composables/useAnimation.js +264 -0
  317. package/src/composables/useClassComposition.js +35 -0
  318. package/src/composables/useDataAttributes.js +83 -0
  319. package/src/composables/useMenu.js +88 -0
  320. package/src/composables/useSize.js +135 -0
  321. package/src/composables/useSpacing.js +37 -0
  322. package/src/composables/useTableColumns.js +88 -0
  323. package/src/composables/useTableData.js +82 -0
  324. package/src/composables/useTableFilter.js +158 -0
  325. package/src/composables/useTablePagination.js +89 -0
  326. package/src/composables/useTableSelection.js +77 -0
  327. package/src/composables/useTableSort.js +75 -0
  328. package/src/composables/useTabsScroll.js +88 -0
  329. package/src/composables/useVariant.js +700 -0
  330. package/src/index.js +86 -0
  331. package/src/styles/animations.css +171 -0
  332. package/src/styles/index.css +99 -0
  333. package/src/styles/tokens.js +123 -0
  334. package/src/utils/propTypes.js +77 -0
  335. package/src/utils/toggleButtonPresets.js +115 -0
@@ -0,0 +1,338 @@
1
+ <template>
2
+ <div
3
+ class="w-full"
4
+ data-component="DXSlider"
5
+ :data-size="size"
6
+ :data-variant="variant"
7
+ >
8
+ <div :class="['flex items-center justify-between', labelSpacing]">
9
+ <label v-if="label" :class="[textSize, 'font-medium', sliderVariant.text]">{{ label }}</label>
10
+ <span v-if="showValue" :class="[textSize, 'font-semibold', sliderVariant.textValue]">
11
+ {{ displayValue }}
12
+ </span>
13
+ </div>
14
+
15
+ <div :class="['relative', trackSpacing]">
16
+ <!-- Visual ticks (засечки на линии) -->
17
+ <div v-if="ticks" class="absolute top-1/2 w-full pointer-events-none" style="transform: translateY(-50%)">
18
+ <div
19
+ v-for="(tick, index) in tickValues"
20
+ :key="`tick-${index}`"
21
+ :class="['absolute w-0.5 h-3 rounded-full', sliderVariant.tick]"
22
+ :style="getTickStyle(tick)"
23
+ />
24
+ </div>
25
+
26
+ <input
27
+ type="range"
28
+ :value="modelValue"
29
+ :min="min"
30
+ :max="max"
31
+ :step="step"
32
+ :disabled="disabled"
33
+ class="slider w-full appearance-none cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed relative z-10"
34
+ :style="sliderStyles"
35
+ @input="handleInput"
36
+ />
37
+ </div>
38
+
39
+ <!-- Labels for ticks -->
40
+ <div v-if="ticks && (showTickLabels || tickIcons)" :class="['relative w-full', tickLabelSpacing]" style="min-height: 3rem;">
41
+ <span
42
+ v-for="(tick, index) in tickValues"
43
+ :key="tick"
44
+ class="absolute flex flex-col items-center gap-0.5 transition-transform duration-200"
45
+ :class="{ 'scale-110': isActiveIcon(index) }"
46
+ :style="getTickStyle(tick)"
47
+ >
48
+ <DXIcon
49
+ v-if="tickIcons && tickIcons[index]"
50
+ :icon="tickIcons[index]"
51
+ :size="size"
52
+ :animation="getIconAnimation(index)"
53
+ :class="isActiveIcon(index) ? sliderVariant.textActive : sliderVariant.text"
54
+ />
55
+ <span
56
+ v-if="showTickLabels"
57
+ :class="[
58
+ textSize,
59
+ 'transition-colors duration-200 whitespace-nowrap',
60
+ isActiveIcon(index) ? [sliderVariant.textActive, 'font-semibold'] : sliderVariant.text
61
+ ]"
62
+ >
63
+ {{ tick }}{{ unit }}
64
+ </span>
65
+ </span>
66
+ </div>
67
+
68
+ <p v-if="helper" :class="[textSize, tickLabelSpacing, sliderVariant.text]">{{ helper }}</p>
69
+ </div>
70
+ </template>
71
+
72
+ <script setup>
73
+ import { computed } from "vue";
74
+ import { useSize } from "@/composables/useSize";
75
+ import { useVariantSlider } from "@/composables/useVariant";
76
+ import { useSpacing } from "@/composables/useSpacing";
77
+ import DXIcon from "../DXIcon/DXIcon.vue";
78
+
79
+ const props = defineProps({
80
+ /** Значение (v-model) */
81
+ modelValue: { type: Number, default: 0 },
82
+ /** Минимум */
83
+ min: { type: Number, default: 0 },
84
+ /** Максимум */
85
+ max: { type: Number, default: 100 },
86
+ /** Шаг */
87
+ step: { type: Number, default: 1 },
88
+ /** Лейбл */
89
+ label: { type: String, default: "" },
90
+ /** Вспомогательный текст */
91
+ helper: { type: String, default: "" },
92
+ /** Показывать текущее значение */
93
+ showValue: { type: Boolean, default: true },
94
+ /** Показывать засечки (ticks) */
95
+ ticks: { type: Boolean, default: false },
96
+ /** Показывать подписи к засечкам */
97
+ showTickLabels: { type: Boolean, default: true },
98
+ /** Количество засечек */
99
+ tickCount: { type: Number, default: 5 },
100
+ /** Массив иконок для засечек (Heroicon компоненты) */
101
+ tickIcons: { type: Array, default: null },
102
+ /** Анимация активной иконки: wiggle | scale | rotate | none */
103
+ tickIconAnimation: { type: String, default: "wiggle" },
104
+ /** Единица измерения */
105
+ unit: { type: String, default: "" },
106
+ /** Отключенное состояние */
107
+ disabled: { type: Boolean, default: false },
108
+ /** Размер: xs | sm | md | lg | xl */
109
+ size: {
110
+ type: String,
111
+ default: "md",
112
+ validator: (v) => ['xs', 'sm', 'md', 'lg', 'xl'].includes(v)
113
+ },
114
+ /** Вариант цвета: slate | primary | success | danger | warning | info */
115
+ variant: {
116
+ type: String,
117
+ default: "primary",
118
+ validator: (v) => ['slate', 'primary', 'success', 'danger', 'warning', 'info', 'default'].includes(v)
119
+ },
120
+ /** Отступы между элементами: none | xs | sm | md | lg | xl */
121
+ spacing: {
122
+ type: String,
123
+ default: "sm",
124
+ validator: (v) => ['none', 'xs', 'sm', 'md', 'lg', 'xl'].includes(v)
125
+ },
126
+ });
127
+
128
+ const emit = defineEmits(["update:modelValue"]);
129
+
130
+ // Используем composables
131
+ const sliderVariant = useVariantSlider(props.variant);
132
+ const trackHeight = useSize(props.size, 'sliderTrack');
133
+ const thumbSize = useSize(props.size, 'sliderThumb');
134
+ const textSize = useSize(props.size, 'text');
135
+ const labelSpacing = useSpacing(props.spacing, 'marginY');
136
+ const trackSpacing = useSpacing(props.spacing, 'paddingY');
137
+ const tickLabelSpacing = useSpacing(props.spacing, 'marginTop');
138
+
139
+ // Получаем размер thumb в пикселях для расчета позиций
140
+ const thumbSizePx = computed(() => {
141
+ const sizeMap = { xs: 12, sm: 16, md: 20, lg: 24, xl: 28 };
142
+ return sizeMap[props.size] || 20;
143
+ });
144
+
145
+ // Получаем высоту трека в пикселях
146
+ const trackHeightPx = computed(() => {
147
+ const heightMap = { xs: 4, sm: 6, md: 8, lg: 10, xl: 12 };
148
+ return heightMap[props.size] || 8;
149
+ });
150
+
151
+ const displayValue = computed(() => `${props.modelValue}${props.unit}`);
152
+
153
+ // CSS переменные для динамических стилей
154
+ const sliderStyles = computed(() => {
155
+ // Извлекаем цвета из классов Tailwind
156
+ const getColorFromClass = (className) => {
157
+ // Простая маппинг для основных цветов
158
+ const colorMap = {
159
+ 'bg-slate-200': '#e2e8f0',
160
+ 'bg-slate-900': '#0f172a',
161
+ 'bg-slate-800': '#1e293b',
162
+ 'bg-slate-700': '#334155',
163
+ 'bg-slate-600': '#475569',
164
+ 'bg-blue-200': '#bfdbfe',
165
+ 'bg-blue-600': '#2563eb',
166
+ 'bg-blue-500': '#3b82f6',
167
+ 'bg-blue-400': '#60a5fa',
168
+ 'bg-emerald-200': '#a7f3d0',
169
+ 'bg-emerald-600': '#059669',
170
+ 'bg-emerald-500': '#10b981',
171
+ 'bg-emerald-400': '#34d399',
172
+ 'bg-amber-200': '#fde68a',
173
+ 'bg-amber-600': '#d97706',
174
+ 'bg-amber-500': '#f59e0b',
175
+ 'bg-amber-400': '#fbbf24',
176
+ 'bg-rose-200': '#fecdd3',
177
+ 'bg-rose-600': '#e11d48',
178
+ 'bg-rose-500': '#f43f5e',
179
+ 'bg-rose-400': '#fb7185',
180
+ };
181
+ return colorMap[className] || '#0f172a';
182
+ };
183
+
184
+ return {
185
+ '--slider-track-color': getColorFromClass(sliderVariant.track),
186
+ '--slider-thumb-color': getColorFromClass(sliderVariant.thumb),
187
+ '--slider-thumb-hover-color': getColorFromClass(sliderVariant.thumbHover),
188
+ '--slider-thumb-size': `${thumbSizePx.value}px`,
189
+ '--slider-track-height': `${trackHeightPx.value}px`,
190
+ '--slider-thumb-margin-top': `${(thumbSizePx.value - trackHeightPx.value) / 2}px`,
191
+ };
192
+ });
193
+
194
+ const tickValues = computed(() => {
195
+ if (!props.ticks) return [];
196
+ const count = props.tickCount;
197
+ const step = (props.max - props.min) / (count - 1);
198
+ return Array.from({ length: count }, (_, i) => Math.round(props.min + step * i));
199
+ });
200
+
201
+ const handleInput = (event) => {
202
+ emit("update:modelValue", Number(event.target.value));
203
+ };
204
+
205
+ // Определяет, какая иконка активна (ближайшая к текущему значению)
206
+ const getClosestTickIndex = computed(() => {
207
+ if (!props.ticks || !tickValues.value.length) return -1;
208
+
209
+ let closestIndex = 0;
210
+ let minDistance = Math.abs(props.modelValue - tickValues.value[0]);
211
+
212
+ tickValues.value.forEach((tick, index) => {
213
+ const distance = Math.abs(props.modelValue - tick);
214
+ if (distance < minDistance) {
215
+ minDistance = distance;
216
+ closestIndex = index;
217
+ }
218
+ });
219
+
220
+ return closestIndex;
221
+ });
222
+
223
+ const isActiveIcon = (index) => {
224
+ return getClosestTickIndex.value === index;
225
+ };
226
+
227
+ const getIconAnimation = (index) => {
228
+ // Активная иконка анимируется выбранной анимацией
229
+ if (isActiveIcon(index)) {
230
+ return props.tickIconAnimation;
231
+ }
232
+ return 'none';
233
+ };
234
+
235
+ // Рассчитывает позицию засечки с учетом размера thumb
236
+ const getTickStyle = (tickValue) => {
237
+ const range = props.max - props.min;
238
+ if (range === 0) return { left: '0', transform: 'translateX(-50%)' };
239
+
240
+ // Процент от диапазона значений
241
+ const percentage = ((tickValue - props.min) / range) * 100;
242
+
243
+ // Используем динамический размер thumb
244
+ const thumbSize = thumbSizePx.value;
245
+
246
+ // Вычисляем offset в процентах от ширины контейнера
247
+ // На краях thumb центрируется, поэтому его половина выходит за край
248
+ // Формула: процент * (1 - thumbSize/containerWidth) + половина thumbSize
249
+ // Упрощенная формула для CSS: используем calc
250
+
251
+ return {
252
+ left: `calc(${percentage}% + ${(0.5 - percentage / 100) * thumbSize}px)`,
253
+ transform: 'translateX(-50%)'
254
+ };
255
+ };
256
+ </script>
257
+
258
+ <style scoped>
259
+ /* Input range base */
260
+ .slider {
261
+ height: var(--slider-thumb-size, 20px); /* Высота для правильного центрирования thumb */
262
+ background: transparent;
263
+ }
264
+
265
+ /* Webkit (Chrome, Safari, Edge) */
266
+ .slider::-webkit-slider-runnable-track {
267
+ width: 100%;
268
+ height: var(--slider-track-height, 8px);
269
+ background: var(--slider-track-color, #e2e8f0);
270
+ border-radius: 4px;
271
+ }
272
+
273
+ .slider::-webkit-slider-thumb {
274
+ appearance: none;
275
+ width: var(--slider-thumb-size, 20px);
276
+ height: var(--slider-thumb-size, 20px);
277
+ border-radius: 50%;
278
+ background: var(--slider-thumb-color, #0f172a);
279
+ cursor: pointer;
280
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
281
+ transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
282
+ margin-top: calc(var(--slider-thumb-margin-top, -6px) * -1);
283
+ }
284
+
285
+ .slider::-webkit-slider-thumb:hover {
286
+ transform: scale(1.1);
287
+ background: var(--slider-thumb-hover-color, var(--slider-thumb-color, #0f172a));
288
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
289
+ }
290
+
291
+ .slider::-webkit-slider-thumb:active {
292
+ transform: scale(0.95);
293
+ }
294
+
295
+ /* Firefox */
296
+ .slider::-moz-range-track {
297
+ width: 100%;
298
+ height: var(--slider-track-height, 8px);
299
+ background: var(--slider-track-color, #e2e8f0);
300
+ border-radius: 4px;
301
+ border: none;
302
+ }
303
+
304
+ .slider::-moz-range-thumb {
305
+ width: var(--slider-thumb-size, 20px);
306
+ height: var(--slider-thumb-size, 20px);
307
+ border-radius: 50%;
308
+ background: var(--slider-thumb-color, #0f172a);
309
+ cursor: pointer;
310
+ border: none;
311
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
312
+ transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
313
+ }
314
+
315
+ .slider::-moz-range-thumb:hover {
316
+ transform: scale(1.1);
317
+ background: var(--slider-thumb-hover-color, var(--slider-thumb-color, #0f172a));
318
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
319
+ }
320
+
321
+ .slider::-moz-range-thumb:active {
322
+ transform: scale(0.95);
323
+ }
324
+
325
+ /* Focus styles */
326
+ .slider:focus {
327
+ outline: none;
328
+ }
329
+
330
+ .slider:focus::-webkit-slider-thumb {
331
+ box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
332
+ }
333
+
334
+ .slider:focus::-moz-range-thumb {
335
+ box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
336
+ }
337
+ </style>
338
+
@@ -0,0 +1,2 @@
1
+ export { default } from './DXSlider.vue';
2
+
@@ -0,0 +1,206 @@
1
+ import DXTags from "./DXTags.vue";
2
+ import { ref } from "vue";
3
+ import {
4
+ TagIcon,
5
+ CodeBracketIcon,
6
+ CpuChipIcon,
7
+ CloudIcon,
8
+ LockClosedIcon,
9
+ RocketLaunchIcon,
10
+ SparklesIcon,
11
+ CheckBadgeIcon,
12
+ ExclamationTriangleIcon,
13
+ FireIcon,
14
+ } from "@heroicons/vue/24/outline";
15
+
16
+ export default {
17
+ title: "Atoms/DXTags",
18
+ component: DXTags,
19
+ tags: ["autodocs"],
20
+ };
21
+
22
+ export const Default = {
23
+ args: {
24
+ tags: ["Vue.js", "React", "Angular", "TypeScript"],
25
+ },
26
+ };
27
+
28
+ export const Large = {
29
+ args: {
30
+ tags: ["Frontend", "Backend", "DevOps"],
31
+ variant: "large",
32
+ },
33
+ };
34
+
35
+ export const WithIcons = {
36
+ args: {
37
+ tags: [
38
+ { label: "Frontend", icon: CodeBracketIcon },
39
+ { label: "Backend", icon: CpuChipIcon },
40
+ { label: "Cloud", icon: CloudIcon },
41
+ { label: "Security", icon: LockClosedIcon },
42
+ ],
43
+ },
44
+ };
45
+
46
+ export const WithAnimatedIcons = {
47
+ args: {
48
+ tags: [
49
+ { label: "Vue.js", icon: CodeBracketIcon, iconAnimation: "wiggle" },
50
+ { label: "React", icon: CodeBracketIcon, iconAnimation: "scale" },
51
+ { label: "Angular", icon: CodeBracketIcon, iconAnimation: "rotate" },
52
+ ],
53
+ variant: "large",
54
+ },
55
+ };
56
+
57
+ export const Colored = {
58
+ args: {
59
+ tags: [
60
+ { label: "Default", color: "default" },
61
+ { label: "Primary", color: "primary" },
62
+ { label: "Success", color: "success" },
63
+ { label: "Warning", color: "warning" },
64
+ { label: "Danger", color: "danger" },
65
+ { label: "Info", color: "info" },
66
+ ],
67
+ },
68
+ };
69
+
70
+ export const ColoredWithIcons = {
71
+ args: {
72
+ tags: [
73
+ { label: "Verified", icon: CheckBadgeIcon, color: "success" },
74
+ { label: "Warning", icon: ExclamationTriangleIcon, color: "warning" },
75
+ { label: "Critical", icon: FireIcon, color: "danger" },
76
+ { label: "Info", icon: SparklesIcon, color: "info" },
77
+ ],
78
+ variant: "large",
79
+ },
80
+ };
81
+
82
+ export const Closable = {
83
+ render: () => ({
84
+ components: { DXTags },
85
+ setup() {
86
+ const tags = ref(["Vue.js", "React", "Angular", "TypeScript", "Node.js"]);
87
+
88
+ const handleRemove = ({ index }) => {
89
+ tags.value.splice(index, 1);
90
+ };
91
+
92
+ return { tags, handleRemove };
93
+ },
94
+ template: `
95
+ <div class="space-y-4">
96
+ <DXTags :tags="tags" closable @remove="handleRemove" />
97
+ <p class="text-sm text-slate-600">
98
+ {{ tags.length }} tags remaining
99
+ </p>
100
+ </div>
101
+ `,
102
+ }),
103
+ };
104
+
105
+ export const ClosableWithIcons = {
106
+ render: () => ({
107
+ components: { DXTags },
108
+ setup() {
109
+ const tags = ref([
110
+ { label: "Frontend", icon: CodeBracketIcon },
111
+ { label: "Backend", icon: CpuChipIcon },
112
+ { label: "Cloud", icon: CloudIcon },
113
+ { label: "Security", icon: LockClosedIcon },
114
+ ]);
115
+
116
+ const handleRemove = ({ index }) => {
117
+ tags.value.splice(index, 1);
118
+ };
119
+
120
+ return { tags, handleRemove };
121
+ },
122
+ template: `
123
+ <DXTags :tags="tags" closable @remove="handleRemove" variant="large" />
124
+ `,
125
+ }),
126
+ };
127
+
128
+ export const MixedStyles = {
129
+ args: {
130
+ tags: [
131
+ {
132
+ label: "Active",
133
+ icon: CheckBadgeIcon,
134
+ color: "success",
135
+ closable: false,
136
+ },
137
+ {
138
+ label: "Pending",
139
+ icon: SparklesIcon,
140
+ color: "warning",
141
+ closable: true,
142
+ },
143
+ {
144
+ label: "Featured",
145
+ icon: RocketLaunchIcon,
146
+ color: "primary",
147
+ iconAnimation: "wiggle",
148
+ },
149
+ { label: "Hot", icon: FireIcon, color: "danger", iconAnimation: "scale" },
150
+ ],
151
+ variant: "large",
152
+ },
153
+ };
154
+
155
+ export const AllVariants = {
156
+ render: () => ({
157
+ components: { DXTags },
158
+ setup() {
159
+ const simpleTags = ref(["Vue", "React", "Angular"]);
160
+ const iconTags = [
161
+ { label: "Frontend", icon: CodeBracketIcon },
162
+ { label: "Backend", icon: CpuChipIcon },
163
+ ];
164
+ const coloredTags = [
165
+ { label: "Success", color: "success" },
166
+ { label: "Warning", color: "warning" },
167
+ { label: "Danger", color: "danger" },
168
+ ];
169
+ const closableTags = ref([
170
+ { label: "Tag 1", icon: TagIcon },
171
+ { label: "Tag 2", icon: TagIcon },
172
+ { label: "Tag 3", icon: TagIcon },
173
+ ]);
174
+
175
+ const handleRemove = ({ index }) => {
176
+ closableTags.value.splice(index, 1);
177
+ };
178
+
179
+ return { simpleTags, iconTags, coloredTags, closableTags, handleRemove };
180
+ },
181
+ template: `
182
+ <div class="space-y-6">
183
+ <div>
184
+ <h3 class="text-sm font-semibold text-slate-900 mb-2">Simple Tags</h3>
185
+ <DXTags :tags="simpleTags" />
186
+ </div>
187
+
188
+ <div>
189
+ <h3 class="text-sm font-semibold text-slate-900 mb-2">With Icons</h3>
190
+ <DXTags :tags="iconTags" variant="large" />
191
+ </div>
192
+
193
+ <div>
194
+ <h3 class="text-sm font-semibold text-slate-900 mb-2">Colored</h3>
195
+ <DXTags :tags="coloredTags" />
196
+ </div>
197
+
198
+ <div>
199
+ <h3 class="text-sm font-semibold text-slate-900 mb-2">Closable with Icons</h3>
200
+ <DXTags :tags="closableTags" closable @remove="handleRemove" variant="large" />
201
+ <p class="text-xs text-slate-500 mt-2">{{ closableTags.length }} tags remaining</p>
202
+ </div>
203
+ </div>
204
+ `,
205
+ }),
206
+ };
@@ -0,0 +1,111 @@
1
+ <template>
2
+ <div class="flex flex-wrap gap-2" data-component="DXTags">
3
+ <span
4
+ v-for="(tag, index) in normalizedTags"
5
+ :key="getTagKey(tag, index)"
6
+ :class="getTagClasses(tag)"
7
+ class="group inline-flex items-center gap-1.5 transition-all duration-200"
8
+ >
9
+ <!-- Left Icon -->
10
+ <DXIcon
11
+ v-if="tag.icon"
12
+ :icon="tag.icon"
13
+ :size="variant === 'large' ? 'sm' : 'xs'"
14
+ :animation="tag.iconAnimation || 'none'"
15
+ :group-hover="true"
16
+ />
17
+
18
+ <!-- Tag Label -->
19
+ <span>{{ tag.label }}</span>
20
+
21
+ <!-- Close Button -->
22
+ <button
23
+ v-if="tag.closable"
24
+ type="button"
25
+ @click="handleRemove(tag, index)"
26
+ class="ml-0.5 -mr-1 hover:bg-slate-200/50 rounded-full p-0.5 transition-colors"
27
+ :aria-label="`Remove ${tag.label}`"
28
+ >
29
+ <DXIcon
30
+ :icon="XMarkIcon"
31
+ size="xs"
32
+ animation="scale"
33
+ />
34
+ </button>
35
+ </span>
36
+ </div>
37
+ </template>
38
+
39
+ <script setup>
40
+ import { computed } from "vue";
41
+ import { useSize } from "@/composables/useSize";
42
+ import { useVariantTag } from "@/composables/useVariant";
43
+ import { useClassComposition } from "@/composables/useClassComposition";
44
+ import { XMarkIcon } from "@heroicons/vue/24/solid";
45
+ import DXIcon from "../DXIcon/DXIcon.vue";
46
+
47
+ const props = defineProps({
48
+ /** Массив тегов: строки или объекты { label, icon?, closable?, color?, iconAnimation? } */
49
+ tags: { type: Array, default: () => [] },
50
+ /** Размер тегов: default | large */
51
+ variant: { type: String, default: "default" },
52
+ /** Цвет по умолчанию: default | primary | success | warning | danger | info */
53
+ color: { type: String, default: "default" },
54
+ /** Все теги удаляемые */
55
+ closable: { type: Boolean, default: false },
56
+ });
57
+
58
+ const emit = defineEmits(["remove"]);
59
+
60
+ /**
61
+ * Нормализация тегов: строки преобразуются в объекты
62
+ */
63
+ const normalizedTags = computed(() => {
64
+ return props.tags.map(tag => {
65
+ if (typeof tag === "string") {
66
+ return {
67
+ label: tag,
68
+ icon: null,
69
+ closable: props.closable,
70
+ color: props.color,
71
+ iconAnimation: 'none',
72
+ };
73
+ }
74
+ return {
75
+ label: tag.label || tag,
76
+ icon: tag.icon || null,
77
+ closable: tag.closable !== undefined ? tag.closable : props.closable,
78
+ color: tag.color || props.color,
79
+ iconAnimation: tag.iconAnimation || 'none',
80
+ };
81
+ });
82
+ });
83
+
84
+ /**
85
+ * Получить ключ для тега
86
+ */
87
+ const getTagKey = (tag, index) => {
88
+ return `${tag.label}-${index}`;
89
+ };
90
+
91
+ /**
92
+ * Получить классы для тега
93
+ */
94
+ const getTagClasses = (tag) => {
95
+ const tagSize = props.variant === 'large' ? 'md' : 'sm';
96
+
97
+ return useClassComposition(
98
+ 'rounded-full border',
99
+ useSize(tagSize, 'badge'),
100
+ useVariantTag(tag.color)
101
+ );
102
+ };
103
+
104
+ /**
105
+ * Обработчик удаления тега
106
+ */
107
+ const handleRemove = (tag, index) => {
108
+ emit("remove", { tag, index });
109
+ };
110
+ </script>
111
+
@@ -0,0 +1,2 @@
1
+ export { default } from './DXTags.vue';
2
+
@@ -0,0 +1,40 @@
1
+ import DXToast from "./DXToast.vue";
2
+
3
+ export default {
4
+ title: "Atoms/DXToast",
5
+ component: DXToast,
6
+ tags: ["autodocs"],
7
+ };
8
+
9
+ export const Success = {
10
+ args: { variant: "success", message: "Operation completed successfully!" },
11
+ };
12
+
13
+ export const Error = {
14
+ args: {
15
+ variant: "error",
16
+ message: "Something went wrong. Please try again.",
17
+ },
18
+ };
19
+
20
+ export const Warning = {
21
+ args: { variant: "warning", message: "Please review before continuing." },
22
+ };
23
+
24
+ export const Info = {
25
+ args: { variant: "info", message: "New features are available." },
26
+ };
27
+
28
+ export const AllVariants = {
29
+ render: () => ({
30
+ components: { DXToast },
31
+ template: `
32
+ <div class="space-y-4">
33
+ <DXToast variant="success" message="Success toast message" />
34
+ <DXToast variant="error" message="Error toast message" />
35
+ <DXToast variant="warning" message="Warning toast message" />
36
+ <DXToast variant="info" message="Info toast message" />
37
+ </div>
38
+ `,
39
+ }),
40
+ };