dxd-style-code 0.1.11 → 0.1.13

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 (148) hide show
  1. package/dist/dxd-style-code.js +7470 -6336
  2. package/dist/dxd-style-code.umd.cjs +3 -3
  3. package/dist/style.css +1 -1
  4. package/package.json +2 -2
  5. package/src/components/atoms/DX/DX.stories.js +265 -0
  6. package/src/components/atoms/DX/DX.vue +80 -0
  7. package/src/components/atoms/DX/index.js +2 -0
  8. package/src/components/atoms/DXAvatar/DXAvatar.stories.js +1 -2
  9. package/src/components/atoms/DXBackdrop/DXBackdrop.stories.js +77 -1
  10. package/src/components/atoms/DXBadge/DXBadge.stories.js +83 -1
  11. package/src/components/atoms/DXBlockquote/DXBlockquote.stories.js +67 -1
  12. package/src/components/atoms/DXBox/DXBox.stories.js +1 -1
  13. package/src/components/atoms/DXBox/DXBox.vue +69 -2
  14. package/src/components/atoms/DXButton/DXButton.stories.js +94 -1
  15. package/src/components/atoms/DXButton/DXButton.vue +145 -11
  16. package/src/components/atoms/DXCard/DXCard.stories.js +72 -14
  17. package/src/components/atoms/DXCard/DXCard.vue +3 -4
  18. package/src/components/atoms/DXCheckbox/DXCheckbox.stories.js +85 -1
  19. package/src/components/atoms/DXCode/DXCode.stories.js +67 -1
  20. package/src/components/atoms/DXContainer/DXContainer.stories.js +1 -1
  21. package/src/components/atoms/DXContainer/DXContainer.vue +28 -1
  22. package/src/components/atoms/DXDivider/DXDivider.stories.js +84 -1
  23. package/src/components/atoms/DXFlex/DXFlex.stories.js +1 -1
  24. package/src/components/atoms/DXFlex/DXFlex.vue +57 -3
  25. package/src/components/atoms/DXFormLabel/DXFormLabel.stories.js +70 -1
  26. package/src/components/atoms/DXGrid/DXGrid.stories.js +1 -1
  27. package/src/components/atoms/DXHeading/DXHeading.stories.js +90 -1
  28. package/src/components/atoms/DXIcon/DXIcon.stories.js +74 -0
  29. package/src/components/atoms/DXIconWrapper/DXIconWrapper.stories.js +69 -0
  30. package/src/components/atoms/DXImage/DXImage.stories.js +483 -0
  31. package/src/components/atoms/DXImage/DXImage.vue +294 -0
  32. package/src/components/atoms/DXImage/index.js +2 -0
  33. package/src/components/atoms/DXInputAddon/DXInputAddon.stories.js +86 -1
  34. package/src/components/atoms/DXLabel/DXLabel.stories.js +62 -1
  35. package/src/components/atoms/DXLink/DXLink.stories.js +75 -10
  36. package/src/components/atoms/DXLink/DXLink.vue +59 -3
  37. package/src/components/atoms/DXList/DXList.stories.js +76 -1
  38. package/src/components/atoms/DXLoader/DXLoader.stories.js +75 -1
  39. package/src/components/atoms/DXNav/DXNav.stories.js +236 -0
  40. package/src/components/atoms/DXNav/DXNav.vue +114 -0
  41. package/src/components/atoms/DXNav/index.js +2 -0
  42. package/src/components/atoms/DXProgress/DXProgress.stories.js +76 -1
  43. package/src/components/atoms/DXRadio/DXRadio.stories.js +85 -1
  44. package/src/components/atoms/DXSkeleton/DXSkeleton.stories.js +59 -1
  45. package/src/components/atoms/DXSlider/DXSlider.stories.js +89 -0
  46. package/src/components/atoms/DXSpacer/DXSpacer.stories.js +1 -1
  47. package/src/components/atoms/DXStack/DXStack.stories.js +1 -1
  48. package/src/components/atoms/DXStack/DXStack.vue +5 -2
  49. package/src/components/atoms/DXTags/DXTags.stories.js +77 -0
  50. package/src/components/atoms/DXText/DXText.stories.js +83 -1
  51. package/src/components/atoms/DXToast/DXToast.stories.js +64 -1
  52. package/src/components/atoms/DXToggle/DXToggle.stories.js +84 -1
  53. package/src/components/atoms/DXToggleButton/DXToggleButton.stories.js +78 -1
  54. package/src/components/atoms/DXTooltip/DXTooltip.stories.js +98 -1
  55. package/src/components/atoms/index.js +3 -0
  56. package/src/components/molecules/DXActionButtons/DXActionButtons.stories.js +280 -77
  57. package/src/components/molecules/DXActionButtons/DXActionButtons.vue +31 -31
  58. package/src/components/molecules/DXAlert/DXAlert.stories.js +199 -1
  59. package/src/components/molecules/DXAlert/DXAlert.vue +35 -13
  60. package/src/components/molecules/DXBreadcrumb/DXBreadcrumb.stories.js +125 -1
  61. package/src/components/molecules/DXBreadcrumb/DXBreadcrumb.vue +22 -18
  62. package/src/components/molecules/DXButtonGroup/DXButtonGroup.stories.js +193 -6
  63. package/src/components/molecules/DXButtonGroup/DXButtonGroup.vue +39 -3
  64. package/src/components/molecules/DXCloseButton/DXCloseButton.stories.js +64 -1
  65. package/src/components/molecules/DXComboBox/DXComboBox.stories.js +66 -0
  66. package/src/components/molecules/DXCopyField/DXCopyField.stories.js +128 -1
  67. package/src/components/molecules/DXCopyField/DXCopyField.vue +60 -7
  68. package/src/components/molecules/DXDataFilter/DXDataFilter.vue +8 -6
  69. package/src/components/molecules/DXDatePicker/DXDatePicker.stories.js +58 -0
  70. package/src/components/molecules/DXFileUpload/DXFileUpload.stories.js +66 -0
  71. package/src/components/molecules/DXFilterGroup/DXFilterGroup.stories.js +61 -0
  72. package/src/components/molecules/DXFormControl/DXFormControl.stories.js +76 -0
  73. package/src/components/molecules/DXFormControl/DXFormControl.vue +9 -8
  74. package/src/components/molecules/DXInput/DXInput.stories.js +100 -1
  75. package/src/components/molecules/DXInputGroup/DXInputGroup.stories.js +89 -1
  76. package/src/components/molecules/DXInputMask/DXInputMask.stories.js +67 -0
  77. package/src/components/molecules/DXMenu/DXMenu.stories.js +111 -4
  78. package/src/components/molecules/DXMenu/DXMenu.vue +18 -5
  79. package/src/components/molecules/DXMenu/README.md +1 -1
  80. package/src/components/molecules/DXPagination/DXPagination.stories.js +105 -2
  81. package/src/components/molecules/DXPagination/DXPagination.vue +18 -33
  82. package/src/components/molecules/DXPasswordInput/DXPasswordInput.stories.js +67 -1
  83. package/src/components/molecules/DXRadioCard/DXRadioCard.stories.js +64 -0
  84. package/src/components/molecules/DXRadioGroup/DXRadioGroup.stories.js +84 -0
  85. package/src/components/molecules/DXRating/DXRating.stories.js +3 -2
  86. package/src/components/molecules/DXSearchBar/DXSearchBar.stories.js +1 -1
  87. package/src/components/molecules/DXSearchBar/DXSearchBar.vue +16 -12
  88. package/src/components/molecules/DXSearchSelect/DXSearchSelect.stories.js +71 -0
  89. package/src/components/molecules/DXSegmentedControl/DXSegmentedControl.stories.js +74 -0
  90. package/src/components/molecules/DXSelect/DXSelect.stories.js +92 -1
  91. package/src/components/molecules/DXStatCard/DXStatCard.stories.js +1 -1
  92. package/src/components/molecules/DXStatCard/DXStatCard.vue +30 -26
  93. package/src/components/molecules/DXTableFiltersPanel/index.js +3 -0
  94. package/src/components/molecules/DXTablePagination/DXTablePagination.stories.js +67 -0
  95. package/src/components/molecules/DXTableToolbar/DXTableToolbar.stories.js +71 -0
  96. package/src/components/molecules/DXTextarea/DXTextarea.stories.js +87 -1
  97. package/src/components/molecules/DXTimePicker/DXTimePicker.stories.js +1 -1
  98. package/src/components/molecules/DXValidationIcon/DXValidationIcon.stories.js +59 -1
  99. package/src/components/molecules/index.js +0 -1
  100. package/src/components/organisms/DXAccordion/DXAccordion.stories.js +75 -0
  101. package/src/components/organisms/DXAppLayout/DXAppLayout.stories.js +27 -25
  102. package/src/components/organisms/DXAuthenticationForm/DXAuthenticationForm.stories.js +0 -2
  103. package/src/components/organisms/DXAuthenticationForm/DXAuthenticationForm.vue +5 -8
  104. package/src/components/{molecules → organisms}/DXBaseTable/DXBaseTable.stories.js +78 -1
  105. package/src/components/{molecules → organisms}/DXBaseTable/DXBaseTable.vue +2 -2
  106. package/src/components/organisms/DXChartContainer/DXChartContainer.stories.js +1 -1
  107. package/src/components/organisms/DXChartContainer/DXChartContainer.vue +10 -6
  108. package/src/components/organisms/DXChatInterface/DXChatInterface.stories.js +1 -1
  109. package/src/components/organisms/DXChatInterface/DXChatInterface.vue +6 -4
  110. package/src/components/organisms/DXCommentSection/DXCommentSection.stories.js +1 -1
  111. package/src/components/organisms/DXCommentSection/DXCommentSection.vue +7 -6
  112. package/src/components/organisms/DXDashboardGrid/DXDashboardGrid.stories.js +1 -1
  113. package/src/components/organisms/DXDashboardGrid/DXDashboardGrid.vue +4 -2
  114. package/src/components/organisms/DXDashboardWidget/DXDashboardWidget.stories.js +1 -1
  115. package/src/components/organisms/DXDashboardWidget/DXDashboardWidget.vue +3 -2
  116. package/src/components/organisms/DXDataTable/DXDataTable.stories.js +1 -1
  117. package/src/components/organisms/DXDropdown/DXDropdown.stories.js +84 -1
  118. package/src/components/organisms/DXEmptyState/DXEmptyState.stories.js +64 -0
  119. package/src/components/organisms/DXEmptyState/DXEmptyState.vue +4 -2
  120. package/src/components/organisms/DXHeaderBar/DXHeaderBar.stories.js +409 -3
  121. package/src/components/organisms/DXHeaderBar/DXHeaderBar.vue +261 -52
  122. package/src/components/organisms/DXMediaGallery/DXMediaGallery.stories.js +1 -1
  123. package/src/components/organisms/DXMediaGallery/DXMediaGallery.vue +6 -4
  124. package/src/components/organisms/DXModal/DXModal.stories.js +93 -1
  125. package/src/components/organisms/DXModal/DXModal.vue +3 -2
  126. package/src/components/organisms/DXNotificationCenter/DXNotificationCenter.stories.js +1 -1
  127. package/src/components/organisms/DXNotificationCenter/DXNotificationCenter.vue +2 -1
  128. package/src/components/organisms/DXReportGenerator/DXReportGenerator.vue +4 -3
  129. package/src/components/organisms/DXSettingsPanel/DXSettingsPanel.vue +11 -8
  130. package/src/components/organisms/DXSidebar/DXSidebar.stories.js +1 -1
  131. package/src/components/organisms/DXSidebarMenu/DXSidebarMenu.stories.js +104 -1
  132. package/src/components/organisms/DXSidebarMenu/DXSidebarMenu.vue +14 -4
  133. package/src/components/organisms/DXSidebarMenu/README.md +3 -3
  134. package/src/components/organisms/DXTable/DXTable.stories.js +138 -11
  135. package/src/components/organisms/DXTable/DXTable.vue +1 -1
  136. package/src/components/organisms/DXTabs/DXTabs.stories.js +91 -1
  137. package/src/components/organisms/DXUserProfileCard/DXUserProfileCard.stories.js +1 -1
  138. package/src/components/organisms/DXUserProfileCard/DXUserProfileCard.vue +20 -18
  139. package/src/components/organisms/index.js +1 -0
  140. package/src/components/utilities/DXAnimatePresence/DXAnimatePresence.stories.js +1 -1
  141. package/src/components/utilities/DXBreakpointProvider/DXBreakpointProvider.stories.js +1 -1
  142. package/src/components/utilities/DXObserver/DXObserver.stories.js +1 -1
  143. package/src/components/utilities/DXPortal/DXPortal.stories.js +1 -1
  144. package/src/components/utilities/DXStaggeredAnimation/DXStaggeredAnimation.stories.js +2 -2
  145. package/src/components/utilities/DXThemeProvider/DXThemeProvider.stories.js +1 -1
  146. package/src/components/utilities/DXTransitionGroup/DXTransitionGroup.stories.js +1 -1
  147. package/src/composables/useSize.js +8 -1
  148. /package/src/components/{molecules → organisms}/DXBaseTable/index.js +0 -0
@@ -1,20 +1,167 @@
1
- import DXActionButtons from './DXActionButtons.vue';
2
- import DXButton from '../../atoms/DXButton/DXButton.vue';
3
- import DXIcon from '../../atoms/DXIcon/DXIcon.vue';
4
- import { ShareIcon, ArrowDownTrayIcon, PrinterIcon } from '@heroicons/vue/24/outline';
1
+ import { DXActionButtons } from '../../molecules';
2
+ import { DXButton, DXIcon, DXHeading, DXText, DXSpacer, DXStack, DXCard } from '../../atoms';
3
+ import { ShareIcon, ArrowDownTrayIcon } from '@heroicons/vue/24/outline';
5
4
 
6
5
  export default {
7
6
  title: 'Molecules/DXActionButtons',
8
7
  component: DXActionButtons,
9
- tags: ['autodocs'],
8
+ tags: ['autodocs', 'category:navigation'],
9
+ parameters: {
10
+ docs: {
11
+ description: {
12
+ component: `
13
+ Компонент для отображения группы кнопок действий (просмотр, редактирование, удаление).
14
+
15
+ ## Назначение
16
+
17
+ DXActionButtons предоставляет стандартизированный набор кнопок действий для работы с элементами интерфейса. Компонент автоматически управляет стилями, размерами и выравниванием кнопок, обеспечивая единообразный вид во всем приложении.
18
+
19
+ ## Архитектура
20
+
21
+ ### Использует
22
+ - \`DXIcon\` - для отображения иконок на кнопках
23
+ - Heroicons - для стандартных иконок действий
24
+
25
+ ### Используется в
26
+ - Таблицы данных - для действий со строками
27
+ - Карточки - для действий с элементами
28
+ - Списки - для действий с элементами списка
29
+ - Модальные окна - для действий с данными
30
+
31
+ ## Внутренняя логика
32
+
33
+ ### Кнопки действий
34
+ Компонент поддерживает три основных действия:
35
+ - **View (Просмотр)** - кнопка для просмотра деталей элемента
36
+ - **Edit (Редактирование)** - кнопка для редактирования элемента
37
+ - **Delete (Удаление)** - кнопка для удаления элемента (красная)
38
+
39
+ ### Размеры
40
+ - \`xs\` - очень маленький размер, подходит для таблиц
41
+ - \`sm\` - маленький размер (по умолчанию)
42
+ - \`md\` - средний размер
43
+
44
+ ### Выравнивание
45
+ - \`left\` - выравнивание по левому краю (по умолчанию)
46
+ - \`center\` - выравнивание по центру
47
+ - \`right\` - выравнивание по правому краю
48
+
49
+ ### Режимы отображения
50
+ - **С текстом** - кнопки с иконками и текстом (по умолчанию)
51
+ - **Только иконки** - компактный режим с иконками без текста (\`iconOnly={true}\`)
52
+
53
+ ## Особенности
54
+
55
+ ### Кастомизация
56
+ - Можно настроить текст каждой кнопки через props
57
+ - Можно заменить иконки через props
58
+ - Можно добавить дополнительные кнопки через default slot
59
+
60
+ ### События
61
+ Компонент эмитит три события:
62
+ - \`@view\` - при клике на кнопку просмотра
63
+ - \`@edit\` - при клике на кнопку редактирования
64
+ - \`@delete\` - при клике на кнопку удаления
65
+
66
+ ### Состояния
67
+ - **Disabled** - все кнопки можно отключить одновременно через prop \`disabled\`
68
+ - **Conditional rendering** - каждая кнопка может быть скрыта через соответствующий prop (\`showView\`, \`showEdit\`, \`showDelete\`)
69
+ `,
70
+ },
71
+ },
72
+ },
10
73
  argTypes: {
74
+ showView: {
75
+ control: 'boolean',
76
+ description: 'Показывать кнопку просмотра',
77
+ table: {
78
+ type: { summary: 'boolean' },
79
+ defaultValue: { summary: 'false' },
80
+ category: 'Visibility',
81
+ },
82
+ },
83
+ showEdit: {
84
+ control: 'boolean',
85
+ description: 'Показывать кнопку редактирования',
86
+ table: {
87
+ type: { summary: 'boolean' },
88
+ defaultValue: { summary: 'true' },
89
+ category: 'Visibility',
90
+ },
91
+ },
92
+ showDelete: {
93
+ control: 'boolean',
94
+ description: 'Показывать кнопку удаления',
95
+ table: {
96
+ type: { summary: 'boolean' },
97
+ defaultValue: { summary: 'true' },
98
+ category: 'Visibility',
99
+ },
100
+ },
101
+ viewLabel: {
102
+ control: 'text',
103
+ description: 'Текст кнопки просмотра',
104
+ table: {
105
+ type: { summary: 'string' },
106
+ defaultValue: { summary: '"Просмотр"' },
107
+ category: 'Labels',
108
+ },
109
+ },
110
+ editLabel: {
111
+ control: 'text',
112
+ description: 'Текст кнопки редактирования',
113
+ table: {
114
+ type: { summary: 'string' },
115
+ defaultValue: { summary: '"Редактировать"' },
116
+ category: 'Labels',
117
+ },
118
+ },
119
+ deleteLabel: {
120
+ control: 'text',
121
+ description: 'Текст кнопки удаления',
122
+ table: {
123
+ type: { summary: 'string' },
124
+ defaultValue: { summary: '"Удалить"' },
125
+ category: 'Labels',
126
+ },
127
+ },
11
128
  size: {
12
129
  control: 'select',
13
130
  options: ['xs', 'sm', 'md'],
131
+ description: 'Размер кнопок',
132
+ table: {
133
+ type: { summary: 'xs | sm | md' },
134
+ defaultValue: { summary: 'sm' },
135
+ category: 'Appearance',
136
+ },
137
+ },
138
+ iconOnly: {
139
+ control: 'boolean',
140
+ description: 'Показывать только иконки без текста',
141
+ table: {
142
+ type: { summary: 'boolean' },
143
+ defaultValue: { summary: 'false' },
144
+ category: 'Appearance',
145
+ },
14
146
  },
15
147
  align: {
16
148
  control: 'select',
17
149
  options: ['left', 'center', 'right'],
150
+ description: 'Выравнивание кнопок',
151
+ table: {
152
+ type: { summary: 'left | center | right' },
153
+ defaultValue: { summary: 'left' },
154
+ category: 'Layout',
155
+ },
156
+ },
157
+ disabled: {
158
+ control: 'boolean',
159
+ description: 'Отключить все кнопки',
160
+ table: {
161
+ type: { summary: 'boolean' },
162
+ defaultValue: { summary: 'false' },
163
+ category: 'State',
164
+ },
18
165
  },
19
166
  },
20
167
  };
@@ -22,6 +169,13 @@ export default {
22
169
  // Базовый вариант
23
170
  export const Default = {
24
171
  args: {},
172
+ parameters: {
173
+ docs: {
174
+ description: {
175
+ story: 'Базовый вариант компонента с кнопками редактирования и удаления (по умолчанию).',
176
+ },
177
+ },
178
+ },
25
179
  };
26
180
 
27
181
  // Только редактирование
@@ -30,6 +184,13 @@ export const EditOnly = {
30
184
  showEdit: true,
31
185
  showDelete: false,
32
186
  },
187
+ parameters: {
188
+ docs: {
189
+ description: {
190
+ story: 'Вариант с только кнопкой редактирования. Полезно, когда удаление недоступно или не требуется.',
191
+ },
192
+ },
193
+ },
33
194
  };
34
195
 
35
196
  // Только удаление
@@ -38,6 +199,13 @@ export const DeleteOnly = {
38
199
  showEdit: false,
39
200
  showDelete: true,
40
201
  },
202
+ parameters: {
203
+ docs: {
204
+ description: {
205
+ story: 'Вариант с только кнопкой удаления. Используется для быстрого удаления элементов без возможности редактирования.',
206
+ },
207
+ },
208
+ },
41
209
  };
42
210
 
43
211
  // С кнопкой просмотра
@@ -47,6 +215,13 @@ export const WithView = {
47
215
  showEdit: true,
48
216
  showDelete: true,
49
217
  },
218
+ parameters: {
219
+ docs: {
220
+ description: {
221
+ story: 'Полный набор кнопок: просмотр, редактирование и удаление. Используется когда нужен доступ ко всем действиям.',
222
+ },
223
+ },
224
+ },
50
225
  };
51
226
 
52
227
  // Только иконки
@@ -57,26 +232,43 @@ export const IconOnly = {
57
232
  showEdit: true,
58
233
  showDelete: true,
59
234
  },
235
+ parameters: {
236
+ docs: {
237
+ description: {
238
+ story: 'Компактный режим с только иконками. Идеально подходит для таблиц и ограниченного пространства.',
239
+ },
240
+ },
241
+ },
60
242
  };
61
243
 
62
244
  // Размеры
63
245
  export const Sizes = {
246
+ parameters: {
247
+ docs: {
248
+ description: {
249
+ story: 'Демонстрация всех доступных размеров компонента. Размер влияет на padding и размер текста кнопок.',
250
+ },
251
+ },
252
+ },
64
253
  render: () => ({
65
- components: { DXActionButtons },
254
+ components: { DXActionButtons, DXText, DXSpacer },
66
255
  template: `
67
256
  <div class="space-y-6">
68
257
  <div>
69
- <p class="text-xs text-slate-500 mb-2">Extra Small (xs)</p>
258
+ <DXText size="xs" color="muted">Extra Small (xs)</DXText>
259
+ <DXSpacer size="md"/>
70
260
  <DXActionButtons size="xs" />
71
261
  </div>
72
262
 
73
263
  <div>
74
- <p class="text-xs text-slate-500 mb-2">Small (sm) - Default</p>
264
+ <DXText size="xs" color="muted">Small (sm) - Default</DXText>
265
+ <DXSpacer size="md"/>
75
266
  <DXActionButtons size="sm" />
76
267
  </div>
77
268
 
78
269
  <div>
79
- <p class="text-xs text-slate-500 mb-2">Medium (md)</p>
270
+ <DXText size="xs" color="muted">Medium (md)</DXText>
271
+ <DXSpacer size="md"/>
80
272
  <DXActionButtons size="md" />
81
273
  </div>
82
274
  </div>
@@ -86,31 +278,48 @@ export const Sizes = {
86
278
 
87
279
  // Выравнивание
88
280
  export const Alignment = {
281
+ parameters: {
282
+ docs: {
283
+ description: {
284
+ story: 'Различные варианты выравнивания кнопок. Выравнивание по правому краю часто используется в таблицах.',
285
+ },
286
+ },
287
+ },
89
288
  render: () => ({
90
- components: { DXActionButtons },
289
+ components: { DXActionButtons, DXText, DXStack, DXCard, DXSpacer },
91
290
  template: `
92
- <div class="space-y-6">
93
- <div class="p-4 border border-slate-200 rounded-xl">
94
- <p class="text-xs text-slate-500 mb-2">Left (default)</p>
291
+ <DXStack gap="lg" direction="vertical">
292
+ <DXCard padding="md" variant="bordered">
293
+ <DXText size="xs" color="muted">Left (default)</DXText>
294
+ <DXSpacer size="sm"/>
95
295
  <DXActionButtons align="left" />
96
- </div>
296
+ </DXCard>
97
297
 
98
- <div class="p-4 border border-slate-200 rounded-xl">
99
- <p class="text-xs text-slate-500 mb-2">Center</p>
298
+ <DXCard padding="md" variant="bordered">
299
+ <DXText size="xs" color="muted">Center</DXText>
300
+ <DXSpacer size="sm"/>
100
301
  <DXActionButtons align="center" />
101
- </div>
302
+ </DXCard>
102
303
 
103
- <div class="p-4 border border-slate-200 rounded-xl">
104
- <p class="text-xs text-slate-500 mb-2">Right</p>
304
+ <DXCard padding="md" variant="bordered">
305
+ <DXText size="xs" color="muted">Right</DXText>
306
+ <DXSpacer size="sm"/>
105
307
  <DXActionButtons align="right" />
106
- </div>
107
- </div>
308
+ </DXCard>
309
+ </DXStack>
108
310
  `,
109
311
  }),
110
312
  };
111
313
 
112
314
  // С дополнительными кнопками (slot)
113
315
  export const WithCustomButtons = {
316
+ parameters: {
317
+ docs: {
318
+ description: {
319
+ story: 'Добавление дополнительных кнопок через default slot. Позволяет расширить функциональность компонента кастомными действиями.',
320
+ },
321
+ },
322
+ },
114
323
  render: () => ({
115
324
  components: { DXActionButtons, DXButton, DXIcon },
116
325
  setup() {
@@ -133,6 +342,13 @@ export const WithCustomButtons = {
133
342
 
134
343
  // В таблице
135
344
  export const InTable = {
345
+ parameters: {
346
+ docs: {
347
+ description: {
348
+ story: 'Использование компонента в таблице данных. Обычно используется размер `xs` и выравнивание `right` для компактного отображения в колонке действий.',
349
+ },
350
+ },
351
+ },
136
352
  render: () => ({
137
353
  components: { DXActionButtons },
138
354
  template: `
@@ -180,19 +396,26 @@ export const InTable = {
180
396
 
181
397
  // В карточках
182
398
  export const InCards = {
399
+ parameters: {
400
+ docs: {
401
+ description: {
402
+ story: 'Использование компонента в карточках. Компонент размещается в нижней части карточки для действий с элементом.',
403
+ },
404
+ },
405
+ },
183
406
  render: () => ({
184
- components: { DXActionButtons },
407
+ components: { DXActionButtons, DXHeading, DXText },
185
408
  template: `
186
409
  <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
187
410
  <div class="p-6 border border-slate-200 rounded-xl bg-white">
188
- <h3 class="text-lg font-semibold text-slate-900 mb-2">Product Title</h3>
189
- <p class="text-sm text-slate-600 mb-4">Product description goes here...</p>
411
+ <DXHeading level="3" size="lg" weight="semibold" color="default" class="mb-2">Product Title</DXHeading>
412
+ <DXText tag="p" size="sm" color="muted" class="mb-4">Product description goes here...</DXText>
190
413
  <DXActionButtons show-view />
191
414
  </div>
192
415
 
193
416
  <div class="p-6 border border-slate-200 rounded-xl bg-white">
194
- <h3 class="text-lg font-semibold text-slate-900 mb-2">Another Product</h3>
195
- <p class="text-sm text-slate-600 mb-4">Another product description...</p>
417
+ <DXHeading level="3" size="lg" weight="semibold" color="default" class="mb-2">Another Product</DXHeading>
418
+ <DXText tag="p" size="sm" color="muted" class="mb-4">Another product description...</DXText>
196
419
  <DXActionButtons show-view />
197
420
  </div>
198
421
  </div>
@@ -206,12 +429,26 @@ export const Disabled = {
206
429
  disabled: true,
207
430
  showView: true,
208
431
  },
432
+ parameters: {
433
+ docs: {
434
+ description: {
435
+ story: 'Состояние, когда все кнопки отключены. Используется когда действия недоступны (например, нет прав доступа).',
436
+ },
437
+ },
438
+ },
209
439
  };
210
440
 
211
441
  // Интерактивный пример
212
442
  export const Interactive = {
443
+ parameters: {
444
+ docs: {
445
+ description: {
446
+ story: 'Интерактивный пример с обработчиками событий. Демонстрирует работу всех событий компонента: `@view`, `@edit`, `@delete`, а также кастомную кнопку через slot.',
447
+ },
448
+ },
449
+ },
213
450
  render: () => ({
214
- components: { DXActionButtons },
451
+ components: { DXActionButtons, DXButton, DXIcon },
215
452
  setup() {
216
453
  const handleView = () => alert('View clicked!');
217
454
  const handleEdit = () => alert('Edit clicked!');
@@ -220,8 +457,17 @@ export const Interactive = {
220
457
  alert('Item deleted!');
221
458
  }
222
459
  };
460
+ const handleShare = () => {
461
+ alert('Share clicked! Custom button action.');
462
+ };
223
463
 
224
- return { handleView, handleEdit, handleDelete };
464
+ return {
465
+ handleView,
466
+ handleEdit,
467
+ handleDelete,
468
+ handleShare,
469
+ ShareIcon
470
+ };
225
471
  },
226
472
  template: `
227
473
  <div class="p-6 bg-slate-50 rounded-xl">
@@ -231,58 +477,15 @@ export const Interactive = {
231
477
  @view="handleView"
232
478
  @edit="handleEdit"
233
479
  @delete="handleDelete"
234
- />
480
+ >
481
+ <DXButton variant="outline" size="sm" @click="handleShare">
482
+ <DXIcon :icon="ShareIcon" size="xs" />
483
+ Share
484
+ </DXButton>
485
+ </DXActionButtons>
235
486
  </div>
236
487
  `,
237
488
  }),
238
489
  };
239
490
 
240
- // Все варианты
241
- export const AllVariants = {
242
- render: () => ({
243
- components: { DXActionButtons },
244
- template: `
245
- <div class="space-y-8">
246
- <div>
247
- <h3 class="text-sm font-semibold text-slate-900 mb-3">Standard (Edit + Delete)</h3>
248
- <DXActionButtons />
249
- </div>
250
-
251
- <div>
252
- <h3 class="text-sm font-semibold text-slate-900 mb-3">With View</h3>
253
- <DXActionButtons show-view />
254
- </div>
255
-
256
- <div>
257
- <h3 class="text-sm font-semibold text-slate-900 mb-3">Icon Only</h3>
258
- <DXActionButtons icon-only show-view />
259
- </div>
260
-
261
- <div>
262
- <h3 class="text-sm font-semibold text-slate-900 mb-3">Different Sizes</h3>
263
- <div class="space-y-3">
264
- <DXActionButtons size="xs" />
265
- <DXActionButtons size="sm" />
266
- <DXActionButtons size="md" />
267
- </div>
268
- </div>
269
-
270
- <div>
271
- <h3 class="text-sm font-semibold text-slate-900 mb-3">Alignment</h3>
272
- <div class="space-y-3">
273
- <div class="p-3 border border-slate-200 rounded">
274
- <DXActionButtons align="left" />
275
- </div>
276
- <div class="p-3 border border-slate-200 rounded">
277
- <DXActionButtons align="center" />
278
- </div>
279
- <div class="p-3 border border-slate-200 rounded">
280
- <DXActionButtons align="right" />
281
- </div>
282
- </div>
283
- </div>
284
- </div>
285
- `,
286
- }),
287
- };
288
491
 
@@ -1,51 +1,53 @@
1
1
  <template>
2
- <div class="flex gap-2" :class="{ 'justify-end': align === 'right', 'justify-center': align === 'center' }" data-component="DXActionButtons">
2
+ <DXFlex :justify="justifyValue" gap="sm" align="center" data-component="DXActionButtons">
3
3
  <!-- View Button -->
4
- <button
4
+ <DXButton
5
5
  v-if="showView"
6
- type="button"
7
- class="inline-flex items-center gap-1.5 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2"
8
- :class="buttonSizeClass"
6
+ variant="soft"
7
+ :size="size"
8
+ :icon-only="iconOnly"
9
9
  :disabled="disabled"
10
10
  @click="$emit('view')"
11
11
  >
12
12
  <DXIcon :icon="viewIcon" :size="iconSize" animation="scale" />
13
13
  <span v-if="!iconOnly">{{ viewLabel }}</span>
14
- </button>
14
+ </DXButton>
15
15
 
16
16
  <!-- Edit Button -->
17
- <button
17
+ <DXButton
18
18
  v-if="showEdit"
19
- type="button"
20
- class="inline-flex items-center gap-1.5 border border-slate-200 text-slate-700 hover:border-slate-300 hover:bg-slate-50 bg-white transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-slate-400 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed"
21
- :class="buttonSizeClass"
19
+ variant="outline"
20
+ :size="size"
21
+ :icon-only="iconOnly"
22
22
  :disabled="disabled"
23
23
  @click="$emit('edit')"
24
24
  >
25
25
  <DXIcon :icon="editIcon" :size="iconSize" animation="wiggle" />
26
26
  <span v-if="!iconOnly">{{ editLabel }}</span>
27
- </button>
27
+ </DXButton>
28
28
 
29
29
  <!-- Delete Button -->
30
- <button
30
+ <DXButton
31
31
  v-if="showDelete"
32
- type="button"
33
- class="inline-flex items-center gap-1.5 bg-rose-600 text-white hover:bg-rose-500 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-rose-500 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed"
34
- :class="buttonSizeClass"
32
+ variant="danger"
33
+ :size="size"
34
+ :icon-only="iconOnly"
35
35
  :disabled="disabled"
36
36
  @click="$emit('delete')"
37
37
  >
38
38
  <DXIcon :icon="deleteIcon" :size="iconSize" animation="scale" />
39
39
  <span v-if="!iconOnly">{{ deleteLabel }}</span>
40
- </button>
40
+ </DXButton>
41
41
 
42
42
  <!-- Дополнительные кнопки через slot -->
43
43
  <slot />
44
- </div>
44
+ </DXFlex>
45
45
  </template>
46
46
 
47
47
  <script setup>
48
48
  import { computed } from "vue";
49
+ import DXFlex from "../../atoms/DXFlex/DXFlex.vue";
50
+ import DXButton from "../../atoms/DXButton/DXButton.vue";
49
51
  import DXIcon from "../../atoms/DXIcon/DXIcon.vue";
50
52
  import { PencilIcon, TrashIcon, EyeIcon } from "@heroicons/vue/24/outline";
51
53
 
@@ -83,24 +85,22 @@ const props = defineProps({
83
85
 
84
86
  defineEmits(["view", "edit", "delete"]);
85
87
 
88
+ /**
89
+ * Маппинг align prop в justify prop для DXFlex
90
+ */
91
+ const justifyValue = computed(() => {
92
+ const alignMap = {
93
+ left: "start",
94
+ center: "center",
95
+ right: "end",
96
+ };
97
+ return alignMap[props.align] || "start";
98
+ });
99
+
86
100
  const iconSize = computed(() => {
87
101
  if (props.size === "xs") return "xs";
88
102
  if (props.size === "md") return "sm";
89
103
  return "xs";
90
104
  });
91
-
92
- const buttonSizeClass = computed(() => {
93
- const baseClasses = "font-semibold rounded-xl";
94
-
95
- if (props.iconOnly) {
96
- if (props.size === "xs") return `${baseClasses} p-1.5`;
97
- if (props.size === "md") return `${baseClasses} p-2.5`;
98
- return `${baseClasses} p-2`;
99
- }
100
-
101
- if (props.size === "xs") return `${baseClasses} px-2 py-1 text-xs`;
102
- if (props.size === "md") return `${baseClasses} px-4 py-2.5 text-sm`;
103
- return `${baseClasses} px-3 py-2 text-xs`;
104
- });
105
105
  </script>
106
106