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,264 @@
1
+ /**
2
+ * Vue transition конфигурации
3
+ */
4
+ export const COLLAPSE_TRANSITION = {
5
+ enterActiveClass: 'transition-all duration-200 ease-out',
6
+ enterFromClass: 'opacity-0 max-h-0',
7
+ enterToClass: 'opacity-100 max-h-96',
8
+ leaveActiveClass: 'transition-all duration-200 ease-in',
9
+ leaveFromClass: 'opacity-100 max-h-96',
10
+ leaveToClass: 'opacity-0 max-h-0',
11
+ };
12
+
13
+ export const FADE_TRANSITION = {
14
+ enterActiveClass: 'transition-opacity duration-200 ease-out',
15
+ enterFromClass: 'opacity-0',
16
+ enterToClass: 'opacity-100',
17
+ leaveActiveClass: 'transition-opacity duration-200 ease-in',
18
+ leaveFromClass: 'opacity-100',
19
+ leaveToClass: 'opacity-0',
20
+ };
21
+
22
+ export const FADE_SCALE_TRANSITION = {
23
+ enterActiveClass: 'transition-all duration-200 ease-out',
24
+ enterFromClass: 'opacity-0 scale-95',
25
+ enterToClass: 'opacity-100 scale-100',
26
+ leaveActiveClass: 'transition-all duration-200 ease-in',
27
+ leaveFromClass: 'opacity-100 scale-100',
28
+ leaveToClass: 'opacity-0 scale-95',
29
+ };
30
+
31
+ export const SLIDE_RIGHT_TRANSITION = {
32
+ enterActiveClass: 'transition-all duration-300 ease-out',
33
+ enterFromClass: 'opacity-0 translate-x-full',
34
+ enterToClass: 'opacity-100 translate-x-0',
35
+ leaveActiveClass: 'transition-all duration-300 ease-in',
36
+ leaveFromClass: 'opacity-100 translate-x-0',
37
+ leaveToClass: 'opacity-0 translate-x-full',
38
+ };
39
+
40
+ export const SLIDE_LEFT_TRANSITION = {
41
+ enterActiveClass: 'transition-all duration-300 ease-out',
42
+ enterFromClass: 'opacity-0 -translate-x-full',
43
+ enterToClass: 'opacity-100 translate-x-0',
44
+ leaveActiveClass: 'transition-all duration-300 ease-in',
45
+ leaveFromClass: 'opacity-100 translate-x-0',
46
+ leaveToClass: 'opacity-0 -translate-x-full',
47
+ };
48
+
49
+ export const SLIDE_UP_TRANSITION = {
50
+ enterActiveClass: 'transition-all duration-300 ease-out',
51
+ enterFromClass: 'opacity-0 translate-y-full',
52
+ enterToClass: 'opacity-100 translate-y-0',
53
+ leaveActiveClass: 'transition-all duration-300 ease-in',
54
+ leaveFromClass: 'opacity-100 translate-y-0',
55
+ leaveToClass: 'opacity-0 translate-y-full',
56
+ };
57
+
58
+ export const SLIDE_DOWN_TRANSITION = {
59
+ enterActiveClass: 'transition-all duration-300 ease-out',
60
+ enterFromClass: 'opacity-0 -translate-y-full',
61
+ enterToClass: 'opacity-100 translate-y-0',
62
+ leaveActiveClass: 'transition-all duration-300 ease-in',
63
+ leaveFromClass: 'opacity-100 translate-y-0',
64
+ leaveToClass: 'opacity-0 -translate-y-full',
65
+ };
66
+
67
+ /**
68
+ * Кастомная анимация для tooltip (fade + translate)
69
+ * Оптимизирована для GPU-ускорения и плавности
70
+ * Использует transition-all для плавной анимации без скачков
71
+ *
72
+ * @param {string} position - Позиция tooltip: top | bottom | left | right
73
+ * @returns {Object} Transition конфигурация
74
+ */
75
+ export function useTooltipCustomTransition(position = 'top') {
76
+ // Определяем направление анимации в зависимости от позиции
77
+ const directionClasses = {
78
+ top: {
79
+ enterFrom: 'opacity-0 translate-y-1',
80
+ enterTo: 'opacity-100 translate-y-0',
81
+ leaveFrom: 'opacity-100 translate-y-0',
82
+ leaveTo: 'opacity-0 translate-y-1',
83
+ },
84
+ bottom: {
85
+ enterFrom: 'opacity-0 -translate-y-1',
86
+ enterTo: 'opacity-100 translate-y-0',
87
+ leaveFrom: 'opacity-100 translate-y-0',
88
+ leaveTo: 'opacity-0 -translate-y-1',
89
+ },
90
+ left: {
91
+ enterFrom: 'opacity-0 translate-x-1',
92
+ enterTo: 'opacity-100 translate-x-0',
93
+ leaveFrom: 'opacity-100 translate-x-0',
94
+ leaveTo: 'opacity-0 translate-x-1',
95
+ },
96
+ right: {
97
+ enterFrom: 'opacity-0 -translate-x-1',
98
+ enterTo: 'opacity-100 translate-x-0',
99
+ leaveFrom: 'opacity-100 translate-x-0',
100
+ leaveTo: 'opacity-0 -translate-x-1',
101
+ },
102
+ };
103
+
104
+ const classes = directionClasses[position] || directionClasses.top;
105
+
106
+ return {
107
+ enterActiveClass: 'transition-all duration-150 ease-out',
108
+ enterFromClass: classes.enterFrom,
109
+ enterToClass: classes.enterTo,
110
+ leaveActiveClass: 'transition-all duration-150 ease-in',
111
+ leaveFromClass: classes.leaveFrom,
112
+ leaveToClass: classes.leaveTo,
113
+ };
114
+ }
115
+
116
+ /**
117
+ * @deprecated Используйте useTooltipCustomTransition(position) для адаптивной анимации
118
+ * Кастомная анимация для tooltip (fade + translateY) - только для top позиции
119
+ */
120
+ export const TOOLTIP_CUSTOM_TRANSITION = {
121
+ enterActiveClass: 'transition-all duration-150 ease-out',
122
+ enterFromClass: 'opacity-0 translate-y-1',
123
+ enterToClass: 'opacity-100 translate-y-0',
124
+ leaveActiveClass: 'transition-all duration-150 ease-in',
125
+ leaveFromClass: 'opacity-100 translate-y-0',
126
+ leaveToClass: 'opacity-0 translate-y-1',
127
+ };
128
+
129
+ /**
130
+ * Get transition configuration by name
131
+ *
132
+ * @param {string} name - Transition name: collapse | fade | fade-scale | slide-right | slide-left | slide-up | slide-down | tooltip-custom
133
+ * @returns {Object} Transition configuration object
134
+ *
135
+ * @example
136
+ * import { useAnimationTransition } from '@/composables/useAnimation';
137
+ *
138
+ * const transitionProps = useAnimationTransition('collapse');
139
+ *
140
+ * <Transition v-bind="transitionProps">
141
+ * <div v-show="isOpen">Content</div>
142
+ * </Transition>
143
+ */
144
+ export function useAnimationTransition(name = 'fade') {
145
+ const transitions = {
146
+ collapse: COLLAPSE_TRANSITION,
147
+ fade: FADE_TRANSITION,
148
+ 'fade-scale': FADE_SCALE_TRANSITION,
149
+ 'slide-right': SLIDE_RIGHT_TRANSITION,
150
+ 'slide-left': SLIDE_LEFT_TRANSITION,
151
+ 'slide-up': SLIDE_UP_TRANSITION,
152
+ 'slide-down': SLIDE_DOWN_TRANSITION,
153
+ 'tooltip-custom': TOOLTIP_CUSTOM_TRANSITION,
154
+ };
155
+
156
+ return transitions[name] || transitions.fade;
157
+ }
158
+
159
+ /**
160
+ * @deprecated Use useAnimationTransition instead. This alias is kept for backward compatibility.
161
+ * Get transition configuration by name
162
+ *
163
+ * @param {string} name - Transition name: collapse | fade | fade-scale | slide-right | slide-left | slide-up | slide-down | tooltip-custom
164
+ * @returns {Object} Transition configuration object
165
+ */
166
+ export const useTransition = useAnimationTransition;
167
+
168
+ /**
169
+ * Универсальный composable для управления классами анимаций
170
+ * @param {string} animation - тип анимации (none | wiggle | scale | rotate | fade | slide | bounce | pulse | spin | shake | stripes | custom | smooth)
171
+ * @param {string} type - тип компонента (icon | button | general | progress | tooltip | toggle) - определяет префикс классов
172
+ * @param {boolean} groupHover - использовать group-hover вместо обычного hover (только для hover-анимаций)
173
+ * @returns {string} CSS класс для анимации
174
+ */
175
+ export function useAnimation(animation = 'none', type = 'icon', groupHover = false) {
176
+ // Анимации для иконок (hover-based)
177
+ const iconAnimations = {
178
+ none: "",
179
+ wiggle: "dx-icon-wiggle",
180
+ scale: "dx-icon-scale",
181
+ rotate: "dx-icon-rotate",
182
+ };
183
+
184
+ const iconGroupAnimations = {
185
+ none: "",
186
+ wiggle: "dx-icon-wiggle-group",
187
+ scale: "dx-icon-scale-group",
188
+ rotate: "dx-icon-rotate-group",
189
+ };
190
+
191
+ // Анимации для кнопок (hover-based)
192
+ const buttonAnimations = {
193
+ none: "",
194
+ wiggle: "dx-btn-wiggle",
195
+ scale: "dx-btn-scale",
196
+ rotate: "dx-btn-rotate",
197
+ };
198
+
199
+ const buttonGroupAnimations = {
200
+ none: "",
201
+ wiggle: "dx-btn-wiggle-group",
202
+ scale: "dx-btn-scale-group",
203
+ rotate: "dx-btn-rotate-group",
204
+ };
205
+
206
+ // Общие анимации (не hover-based)
207
+ const generalAnimations = {
208
+ none: "",
209
+ fade: "dx-animate-fade-in",
210
+ 'fade-out': "dx-animate-fade-out",
211
+ slide: "dx-animate-slide-in",
212
+ bounce: "dx-animate-bounce-slow",
213
+ pulse: "dx-animate-pulse",
214
+ spin: "dx-animate-spin",
215
+ shake: "dx-animate-shake",
216
+ };
217
+
218
+ // Анимации для progress bar
219
+ const progressAnimations = {
220
+ none: "",
221
+ stripes: "dx-animate-stripes",
222
+ };
223
+
224
+ // Анимации для tooltip (кастомные CSS классы, если нужны)
225
+ const tooltipAnimations = {
226
+ none: "",
227
+ custom: "dx-tooltip-custom", // Можно использовать для кастомных анимаций через CSS
228
+ };
229
+
230
+ // Анимации для toggle
231
+ const toggleAnimations = {
232
+ none: "",
233
+ smooth: "transition-transform duration-200 ease-in-out", // Плавная анимация движения индикатора
234
+ };
235
+
236
+ // Выбор правильного набора анимаций
237
+ if (type === 'icon') {
238
+ return groupHover
239
+ ? (iconGroupAnimations[animation] || "")
240
+ : (iconAnimations[animation] || "");
241
+ }
242
+
243
+ if (type === 'button') {
244
+ return groupHover
245
+ ? (buttonGroupAnimations[animation] || "")
246
+ : (buttonAnimations[animation] || "");
247
+ }
248
+
249
+ if (type === 'progress') {
250
+ return progressAnimations[animation] || "";
251
+ }
252
+
253
+ if (type === 'tooltip') {
254
+ return tooltipAnimations[animation] || "";
255
+ }
256
+
257
+ if (type === 'toggle') {
258
+ return toggleAnimations[animation] || toggleAnimations.smooth;
259
+ }
260
+
261
+ // Для general типа не используется groupHover
262
+ return generalAnimations[animation] || "";
263
+ }
264
+
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Composable for merging BASE_CLASSES and additional classes
3
+ * Accepts base classes and any number of additional class sources
4
+ *
5
+ * @param {string} baseClasses - Base classes that are always applied
6
+ * @param {...(string|Array|Object)} additionalClasses - Any number of additional class sources
7
+ * @returns {Array} Array of class strings/objects suitable for Vue :class binding
8
+ *
9
+ * @example
10
+ * // Single additional class source
11
+ * useClassComposition(BASE_CLASSES, VARIANT_CLASSES[props.variant])
12
+ *
13
+ * @example
14
+ * // Multiple class sources
15
+ * useClassComposition(
16
+ * BASE_CLASSES,
17
+ * SIZE_CLASSES[props.size],
18
+ * VARIANT_CLASSES[props.variant],
19
+ * props.class
20
+ * )
21
+ */
22
+ export function useClassComposition(baseClasses, ...additionalClasses) {
23
+ const classes = [baseClasses];
24
+
25
+ // Add all additional classes, filtering out empty values
26
+ additionalClasses.forEach(classSource => {
27
+ if (classSource) {
28
+ classes.push(classSource);
29
+ }
30
+ });
31
+
32
+ return classes;
33
+ }
34
+
35
+
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Composable for generating data-attributes from component props
3
+ * Creates consistent data-* attributes for debugging and testing
4
+ *
5
+ * @param {Object} props - Component props object
6
+ * @param {Array<string>} attributeNames - Array of prop names to convert to data-attributes
7
+ * @returns {Object} Object with data-* attributes
8
+ *
9
+ * @example
10
+ * const dataAttrs = useDataAttributes(props, ['variant', 'size', 'disabled']);
11
+ * // Returns: { 'data-variant': 'primary', 'data-size': 'md', 'data-disabled': true }
12
+ *
13
+ * <div v-bind="dataAttrs">...</div>
14
+ */
15
+ export function useDataAttributes(props, attributeNames = []) {
16
+ const attributes = {};
17
+
18
+ attributeNames.forEach(name => {
19
+ const value = props[name];
20
+
21
+ // Only add if value exists and is not null/undefined
22
+ if (value !== undefined && value !== null) {
23
+ // Convert camelCase to kebab-case for data attributes
24
+ const attrName = `data-${name.replace(/([A-Z])/g, '-$1').toLowerCase()}`;
25
+ attributes[attrName] = value;
26
+ }
27
+ });
28
+
29
+ return attributes;
30
+ }
31
+
32
+ /**
33
+ * Generate data-attributes with custom logic
34
+ *
35
+ * @param {Object} attributesMap - Object mapping data-attribute names to their values
36
+ * @returns {Object} Object with data-* attributes
37
+ *
38
+ * @example
39
+ * const dataAttrs = useCustomDataAttributes({
40
+ * variant: props.variant,
41
+ * size: props.size,
42
+ * active: isActive.value,
43
+ * disabled: props.disabled || props.loading
44
+ * });
45
+ */
46
+ export function useCustomDataAttributes(attributesMap = {}) {
47
+ const attributes = {};
48
+
49
+ Object.entries(attributesMap).forEach(([name, value]) => {
50
+ if (value !== undefined && value !== null && value !== false) {
51
+ const attrName = name.startsWith('data-') ? name : `data-${name}`;
52
+ attributes[attrName] = value;
53
+ }
54
+ });
55
+
56
+ return attributes;
57
+ }
58
+
59
+ /**
60
+ * Convert boolean props to data-attributes (omits false values)
61
+ *
62
+ * @param {Object} props - Component props
63
+ * @param {Array<string>} booleanPropNames - Array of boolean prop names
64
+ * @returns {Object} Object with data-* attributes for truthy values only
65
+ *
66
+ * @example
67
+ * const dataAttrs = useBooleanDataAttributes(props, ['disabled', 'loading', 'active']);
68
+ * // If props.disabled = true, props.loading = false
69
+ * // Returns: { 'data-disabled': true }
70
+ */
71
+ export function useBooleanDataAttributes(props, booleanPropNames = []) {
72
+ const attributes = {};
73
+
74
+ booleanPropNames.forEach(name => {
75
+ if (props[name] === true) {
76
+ const attrName = `data-${name.replace(/([A-Z])/g, '-$1').toLowerCase()}`;
77
+ attributes[attrName] = true;
78
+ }
79
+ });
80
+
81
+ return attributes;
82
+ }
83
+
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Composable для управления меню (sidebar и embedded)
3
+ * Предоставляет переиспользуемую логику для DXSidebarMenu и DXMenu
4
+ */
5
+
6
+ import { ref, computed, onMounted, provide } from 'vue';
7
+
8
+ export function useMenu(props, emit) {
9
+ // Reactive state
10
+ const searchQuery = ref('');
11
+ const internalCompact = ref(props.compact);
12
+
13
+ // Computed для compact mode
14
+ const compact = computed(() => internalCompact.value);
15
+
16
+ // Check if vue-router is available
17
+ let hasRouter = false;
18
+ onMounted(() => {
19
+ try {
20
+ hasRouter = !!window?.$router || false;
21
+ } catch (e) {
22
+ hasRouter = false;
23
+ }
24
+ });
25
+
26
+ provide('hasRouter', hasRouter);
27
+
28
+ // Filtered sections based on search query
29
+ const filteredSections = computed(() => {
30
+ if (!searchQuery.value.trim()) return props.sections;
31
+
32
+ const query = searchQuery.value.toLowerCase();
33
+ return props.sections
34
+ .map(section => ({
35
+ ...section,
36
+ items: section.items.filter(item => {
37
+ const labelMatch = item.label?.toLowerCase().includes(query);
38
+ const childrenMatch = item.children?.some(child =>
39
+ child.label?.toLowerCase().includes(query)
40
+ );
41
+ return labelMatch || childrenMatch;
42
+ })
43
+ }))
44
+ .filter(section => section.items.length > 0);
45
+ });
46
+
47
+ // Check if item is active
48
+ const isItemActive = (item) => {
49
+ if (!props.activeItem) return false;
50
+
51
+ // Проверка основного элемента
52
+ if (item.to === props.activeItem || item.id === props.activeItem) {
53
+ return true;
54
+ }
55
+
56
+ // Проверка дочерних элементов
57
+ if (item.children) {
58
+ return item.children.some(child =>
59
+ child.to === props.activeItem || child.id === props.activeItem
60
+ );
61
+ }
62
+
63
+ return false;
64
+ };
65
+
66
+ // Toggle compact mode
67
+ const toggleCompact = () => {
68
+ internalCompact.value = !internalCompact.value;
69
+ emit('update:compact', internalCompact.value);
70
+ };
71
+
72
+ // Handle item click
73
+ const handleItemClick = (item, event) => {
74
+ emit('item-click', item, event);
75
+ };
76
+
77
+ return {
78
+ searchQuery,
79
+ internalCompact,
80
+ compact,
81
+ filteredSections,
82
+ isItemActive,
83
+ toggleCompact,
84
+ handleItemClick,
85
+ hasRouter
86
+ };
87
+ }
88
+
@@ -0,0 +1,135 @@
1
+ /**
2
+ * Композабл для унификации размеров компонентов
3
+ * @param {string} size - xs | sm | md | lg | xl (для spacing также доступен none)
4
+ * @param {string} type - button | buttonIcon | input | icon | text | checkbox | radio | avatar | spacing | loader | progress | inputAddon | sliderTrack | sliderThumb | tooltip | toggle | badge
5
+ * @returns {string|Object} Tailwind CSS классы или объект с классами для track и thumb (для toggle)
6
+ */
7
+ export function useSize(size, type = 'input') {
8
+ const sizes = {
9
+ button: {
10
+ xs: 'h-7 px-2.5 py-1 text-xs',
11
+ sm: 'h-8 px-3 py-1.5 text-xs',
12
+ md: 'h-10 px-4 py-2.5 text-sm',
13
+ lg: 'h-12 px-5 py-3 text-base',
14
+ xl: 'h-14 px-6 py-3.5 text-lg',
15
+ },
16
+ buttonIcon: {
17
+ xs: 'h-7 w-7 text-xs',
18
+ sm: 'h-8 w-8 text-xs',
19
+ md: 'h-10 w-10 text-sm',
20
+ lg: 'h-12 w-12 text-sm',
21
+ xl: 'h-14 w-14 text-base',
22
+ },
23
+ input: {
24
+ xs: 'h-7 px-2.5 py-1 text-xs',
25
+ sm: 'h-8 px-3 py-1.5 text-xs',
26
+ md: 'h-10 px-4 py-2.5 text-sm',
27
+ lg: 'h-12 px-5 py-3 text-base',
28
+ xl: 'h-14 px-6 py-3.5 text-lg',
29
+ },
30
+ icon: {
31
+ xs: 'w-3 h-3',
32
+ sm: 'w-4 h-4',
33
+ md: 'w-5 h-5',
34
+ lg: 'w-6 h-6',
35
+ xl: 'w-8 h-8',
36
+ },
37
+ text: {
38
+ xs: 'text-xs',
39
+ sm: 'text-sm',
40
+ md: 'text-base',
41
+ lg: 'text-lg',
42
+ xl: 'text-xl',
43
+ },
44
+ checkbox: {
45
+ xs: 'h-3 w-3',
46
+ sm: 'h-4 w-4',
47
+ md: 'h-5 w-5',
48
+ lg: 'h-6 w-6',
49
+ xl: 'h-6 w-6',
50
+ },
51
+ radio: {
52
+ xs: 'h-3 w-3',
53
+ sm: 'h-3.5 w-3.5',
54
+ md: 'h-4 w-4',
55
+ lg: 'h-5 w-5',
56
+ xl: 'h-6 w-6',
57
+ },
58
+ avatar: {
59
+ xs: 'h-6 w-6',
60
+ sm: 'h-8 w-8',
61
+ md: 'h-10 w-10',
62
+ lg: 'h-12 w-12',
63
+ xl: 'h-16 w-16',
64
+ },
65
+ loader: {
66
+ xs: 'w-2 h-2',
67
+ sm: 'w-3 h-3',
68
+ md: 'w-4 h-4',
69
+ lg: 'w-5 h-5',
70
+ xl: 'w-6 h-6',
71
+ },
72
+ progress: {
73
+ xs: 'h-1',
74
+ sm: 'h-2',
75
+ md: 'h-3',
76
+ lg: 'h-4',
77
+ },
78
+ inputAddon: {
79
+ xs: 'h-7',
80
+ sm: 'h-8',
81
+ md: 'h-10',
82
+ lg: 'h-12',
83
+ xl: 'h-14',
84
+ },
85
+ sliderTrack: {
86
+ xs: 'h-1', // 4px
87
+ sm: 'h-1.5', // 6px
88
+ md: 'h-2', // 8px
89
+ lg: 'h-2.5', // 10px
90
+ xl: 'h-3', // 12px
91
+ },
92
+ sliderThumb: {
93
+ xs: 'w-3 h-3', // 12px
94
+ sm: 'w-4 h-4', // 16px
95
+ md: 'w-5 h-5', // 20px
96
+ lg: 'w-6 h-6', // 24px
97
+ xl: 'w-7 h-7', // 28px
98
+ },
99
+ spacing: {
100
+ none: 'gap-0',
101
+ xs: 'gap-1',
102
+ sm: 'gap-2',
103
+ md: 'gap-4',
104
+ lg: 'gap-6',
105
+ xl: 'gap-8',
106
+ },
107
+ tooltip: {
108
+ xs: 'px-2 py-1 text-xs',
109
+ sm: 'px-2.5 py-1.5 text-xs',
110
+ md: 'px-3 py-2 text-sm',
111
+ lg: 'px-4 py-3 text-base',
112
+ xl: 'px-5 py-4 text-lg',
113
+ },
114
+ toggle: {
115
+ xs: { track: 'h-4 w-7', thumb: 'h-3 w-3' },
116
+ sm: { track: 'h-5 w-9', thumb: 'h-3.5 w-3.5' },
117
+ md: { track: 'h-6 w-11', thumb: 'h-4 w-4' },
118
+ lg: { track: 'h-7 w-14', thumb: 'h-5 w-5' },
119
+ xl: { track: 'h-8 w-16', thumb: 'h-6 w-6' },
120
+ },
121
+ badge: {
122
+ sm: 'px-2 py-1 text-[11px]',
123
+ md: 'px-2.5 py-1.5 text-xs',
124
+ },
125
+ };
126
+
127
+ // Для toggle возвращаем объект, для остальных - строку
128
+ if (type === 'toggle') {
129
+ return sizes[type]?.[size] || sizes[type]?.md || { track: '', thumb: '' };
130
+ }
131
+
132
+ return sizes[type]?.[size] || sizes[type]?.md || '';
133
+ }
134
+
135
+
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Композабл для унификации padding и margin классов
3
+ * @param {string} size - none | xs | sm | md | lg | xl
4
+ * @param {string} type - padding | paddingX | paddingY | margin | marginX | marginY
5
+ * @returns {string} Tailwind CSS классы
6
+ */
7
+ export function useSpacing(size, type = 'padding') {
8
+ const spacingMap = {
9
+ none: '0',
10
+ xs: '1', // 4px
11
+ sm: '2', // 8px
12
+ md: '4', // 16px
13
+ lg: '6', // 24px
14
+ xl: '8', // 32px
15
+ };
16
+
17
+ const prefix = {
18
+ padding: 'p',
19
+ paddingX: 'px',
20
+ paddingY: 'py',
21
+ margin: 'm',
22
+ marginX: 'mx',
23
+ marginY: 'my',
24
+ };
25
+
26
+ if (size === 'none') {
27
+ return `${prefix[type]}-0`;
28
+ }
29
+
30
+ const spacingValue = spacingMap[size];
31
+ if (!spacingValue) {
32
+ return '';
33
+ }
34
+
35
+ return `${prefix[type]}-${spacingValue}`;
36
+ }
37
+