@nexxtmove/ui 2.6.0 → 2.7.0

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 (223) hide show
  1. package/dist/index.js +49 -126
  2. package/dist/nuxt.js +0 -1
  3. package/package.json +38 -36
  4. package/src/attribute-contract.test.ts +151 -0
  5. package/src/components/atoms/AnimatedNumber/AnimatedNumber.stories.ts +36 -0
  6. package/src/components/atoms/AnimatedNumber/AnimatedNumber.test.ts +21 -0
  7. package/src/components/atoms/Avatar/Avatar.stories.ts +122 -0
  8. package/src/components/atoms/Avatar/Avatar.test.ts +134 -0
  9. package/src/components/atoms/Button/Button.stories.ts +290 -0
  10. package/src/components/atoms/Button/Button.test.ts +406 -0
  11. package/src/components/atoms/Card/Card.stories.ts +45 -0
  12. package/src/components/atoms/Card/Card.test.ts +46 -0
  13. package/src/components/atoms/Checkbox/Checkbox.stories.ts +35 -0
  14. package/src/components/atoms/Checkbox/Checkbox.test.ts +55 -0
  15. package/src/components/atoms/Chip/Chip.stories.ts +274 -0
  16. package/src/components/atoms/Chip/Chip.test.ts +230 -0
  17. package/src/components/atoms/EnergyLabel/EnergyLabel.stories.ts +189 -0
  18. package/src/components/atoms/EnergyLabel/EnergyLabel.test.ts +100 -0
  19. package/src/components/atoms/FloatingPanel/FloatingPanel.stories.ts +677 -0
  20. package/src/components/atoms/FloatingPanel/FloatingPanel.test.ts +864 -0
  21. package/src/components/atoms/Icon/Icon.stories.ts +63 -0
  22. package/src/components/atoms/Icon/Icon.test.ts +89 -0
  23. package/src/components/atoms/Loader/Loader.stories.ts +36 -0
  24. package/src/components/atoms/Loader/Loader.test.ts +40 -0
  25. package/src/components/atoms/PickerItem/PickerItem.stories.ts +172 -0
  26. package/src/components/atoms/PickerItem/PickerItem.test.ts +142 -0
  27. package/src/components/atoms/PickerPreview/PickerPreview.stories.ts +183 -0
  28. package/src/components/atoms/PickerPreview/PickerPreview.test.ts +137 -0
  29. package/src/components/atoms/PresenceIndicator/PresenceIndicator.stories.ts +21 -0
  30. package/src/components/atoms/PropertyListing/PropertyListing.stories.ts +38 -0
  31. package/src/components/atoms/PropertyListing/PropertyListing.test.ts +46 -0
  32. package/src/components/atoms/SelectableOption/SelectableOption.stories.ts +131 -0
  33. package/src/components/atoms/SelectableOption/SelectableOption.test.ts +96 -0
  34. package/src/components/atoms/Skeleton/Skeleton.stories.ts +27 -0
  35. package/src/components/atoms/Skeleton/Skeleton.test.ts +28 -0
  36. package/src/components/atoms/Slider/Slider.stories.ts +151 -0
  37. package/src/components/atoms/Slider/Slider.test.ts +191 -0
  38. package/src/components/atoms/Squircle/Squircle.stories.ts +114 -0
  39. package/src/components/atoms/Squircle/Squircle.test.ts +70 -0
  40. package/src/components/atoms/Switch/Switch.stories.ts +91 -0
  41. package/src/components/atoms/Switch/Switch.test.ts +183 -0
  42. package/src/components/atoms/Tooltip/Tooltip.stories.ts +158 -0
  43. package/src/components/atoms/Tooltip/Tooltip.test.ts +134 -0
  44. package/src/components/editor/atoms/EditorDimensionField/EditorDimensionField.stories.ts +124 -0
  45. package/src/components/editor/atoms/EditorDimensionField/EditorDimensionField.test.ts +464 -0
  46. package/src/components/editor/atoms/EditorSettingsBlock/EditorSettingsBlock.stories.ts +266 -0
  47. package/src/components/editor/atoms/EditorSettingsBlock/EditorSettingsBlock.test.ts +421 -0
  48. package/src/components/editor/atoms/EditorSettingsGroup/EditorSettingsGroup.stories.ts +365 -0
  49. package/src/components/editor/atoms/EditorSettingsGroup/EditorSettingsGroup.test.ts +484 -0
  50. package/src/components/editor/composables/useRadioGrid.test.ts +261 -0
  51. package/src/components/editor/molecules/EditorAlignItems/EditorAlignItems.stories.ts +73 -0
  52. package/src/components/editor/molecules/EditorAlignItems/EditorAlignItems.test.ts +189 -0
  53. package/src/components/editor/molecules/EditorAlignmentGrid/EditorAlignmentGrid.stories.ts +309 -0
  54. package/src/components/editor/molecules/EditorAlignmentGrid/EditorAlignmentGrid.test.ts +359 -0
  55. package/src/components/editor/molecules/EditorAnchor/EditorAnchor.stories.ts +138 -0
  56. package/src/components/editor/molecules/EditorAnchor/EditorAnchor.test.ts +344 -0
  57. package/src/components/editor/molecules/EditorBackgroundSize/EditorBackgroundSize.stories.ts +87 -0
  58. package/src/components/editor/molecules/EditorBackgroundSize/EditorBackgroundSize.test.ts +262 -0
  59. package/src/components/editor/molecules/EditorBlur/EditorBlur.stories.ts +115 -0
  60. package/src/components/editor/molecules/EditorBlur/EditorBlur.test.ts +243 -0
  61. package/src/components/editor/molecules/EditorBorder/EditorBorder.stories.ts +187 -0
  62. package/src/components/editor/molecules/EditorBorder/EditorBorder.test.ts +456 -0
  63. package/src/components/editor/molecules/EditorColor/EditorColor.stories.ts +563 -0
  64. package/src/components/editor/molecules/EditorColor/EditorColor.test.ts +689 -0
  65. package/src/components/editor/molecules/EditorColor/EditorColorGradient.test.ts +793 -0
  66. package/src/components/editor/molecules/EditorColor/gradientClass.test.ts +303 -0
  67. package/src/components/editor/molecules/EditorDashPattern/EditorDashPattern.stories.ts +72 -0
  68. package/src/components/editor/molecules/EditorDashPattern/EditorDashPattern.test.ts +124 -0
  69. package/src/components/editor/molecules/EditorFlexDirection/EditorFlexDirection.stories.ts +46 -0
  70. package/src/components/editor/molecules/EditorFlexDirection/EditorFlexDirection.test.ts +97 -0
  71. package/src/components/editor/molecules/EditorFontSize/EditorFontSize.stories.ts +248 -0
  72. package/src/components/editor/molecules/EditorFontSize/EditorFontSize.test.ts +288 -0
  73. package/src/components/editor/molecules/EditorGap/EditorGap.stories.ts +129 -0
  74. package/src/components/editor/molecules/EditorGap/EditorGap.test.ts +253 -0
  75. package/src/components/editor/molecules/EditorHeadingType/EditorHeadingType.stories.ts +68 -0
  76. package/src/components/editor/molecules/EditorHeadingType/EditorHeadingType.test.ts +150 -0
  77. package/src/components/editor/molecules/EditorJustifyContent/EditorJustifyContent.stories.ts +71 -0
  78. package/src/components/editor/molecules/EditorJustifyContent/EditorJustifyContent.test.ts +161 -0
  79. package/src/components/editor/molecules/EditorLetterSpacing/EditorLetterSpacing.stories.ts +204 -0
  80. package/src/components/editor/molecules/EditorLetterSpacing/EditorLetterSpacing.test.ts +238 -0
  81. package/src/components/editor/molecules/EditorLineHeight/EditorLineHeight.stories.ts +257 -0
  82. package/src/components/editor/molecules/EditorLineHeight/EditorLineHeight.test.ts +286 -0
  83. package/src/components/editor/molecules/EditorLineStyle/EditorLineStyle.stories.ts +135 -0
  84. package/src/components/editor/molecules/EditorLineStyle/EditorLineStyle.test.ts +230 -0
  85. package/src/components/editor/molecules/EditorMaxWidth/EditorMaxWidth.stories.ts +154 -0
  86. package/src/components/editor/molecules/EditorMaxWidth/EditorMaxWidth.test.ts +112 -0
  87. package/src/components/editor/molecules/EditorOverrideStatus/EditorOverrideStatus.stories.ts +206 -0
  88. package/src/components/editor/molecules/EditorOverrideStatus/EditorOverrideStatus.test.ts +332 -0
  89. package/src/components/editor/molecules/EditorPadding/EditorPadding.stories.ts +374 -0
  90. package/src/components/editor/molecules/EditorPadding/EditorPadding.test.ts +712 -0
  91. package/src/components/editor/molecules/EditorRadius/EditorRadius.stories.ts +64 -0
  92. package/src/components/editor/molecules/EditorRadius/EditorRadius.test.ts +137 -0
  93. package/src/components/editor/molecules/EditorShadow/EditorShadow.stories.ts +103 -0
  94. package/src/components/editor/molecules/EditorShadow/EditorShadow.test.ts +168 -0
  95. package/src/components/editor/molecules/EditorSize/EditorSize.stories.ts +84 -0
  96. package/src/components/editor/molecules/EditorSize/EditorSize.test.ts +253 -0
  97. package/src/components/editor/molecules/EditorSizeLimit/EditorSizeLimit.stories.ts +49 -0
  98. package/src/components/editor/molecules/EditorSizeLimit/EditorSizeLimit.test.ts +43 -0
  99. package/src/components/editor/molecules/EditorTextAlign/EditorTextAlign.stories.ts +69 -0
  100. package/src/components/editor/molecules/EditorTextAlign/EditorTextAlign.test.ts +155 -0
  101. package/src/components/molecules/Announcement/Announcement.stories.ts +224 -0
  102. package/src/components/molecules/Announcement/Announcement.test.ts +161 -0
  103. package/src/components/molecules/ContactInfoCard/ContactInfoCard.stories.ts +99 -0
  104. package/src/components/molecules/ContactInfoCard/ContactInfoCard.test.ts +70 -0
  105. package/src/components/molecules/CustomerJourneyTile/CustomerJourneyTile.stories.ts +148 -0
  106. package/src/components/molecules/CustomerJourneyTile/CustomerJourneyTile.test.ts +271 -0
  107. package/src/components/molecules/DoughnutChart/DoughnutChart.stories.ts +45 -0
  108. package/src/components/molecules/DoughnutChart/DoughnutChart.test.ts +205 -0
  109. package/src/components/molecules/InfoBlock/InfoBlock.stories.ts +84 -0
  110. package/src/components/molecules/InfoBlock/InfoBlock.test.ts +101 -0
  111. package/src/components/molecules/InputField/InputField.stories.ts +117 -0
  112. package/src/components/molecules/InputField/InputField.test.ts +138 -0
  113. package/src/components/molecules/InputSelect/InputSelect.stories.ts +116 -0
  114. package/src/components/molecules/InputSelect/InputSelect.test.ts +127 -0
  115. package/src/components/molecules/ModalFooter/ModalFooter.stories.ts +204 -0
  116. package/src/components/molecules/ModalFooter/ModalFooter.test.ts +276 -0
  117. package/src/components/molecules/PageCard/PageCard.stories.ts +100 -0
  118. package/src/components/molecules/PageCard/PageCard.test.ts +91 -0
  119. package/src/components/molecules/PageContainer/PageContainer.stories.ts +90 -0
  120. package/src/components/molecules/PageContainer/PageContainer.test.ts +50 -0
  121. package/src/components/molecules/PageMockup/PageMockup.stories.ts +38 -0
  122. package/src/components/molecules/PageMockup/PageMockup.test.ts +20 -0
  123. package/src/components/molecules/PageTypeTile/PageTypeTile.stories.ts +63 -0
  124. package/src/components/molecules/PageTypeTile/PageTypeTile.test.ts +41 -0
  125. package/src/components/molecules/Pagination/Pagination.stories.ts +72 -0
  126. package/src/components/molecules/Pagination/Pagination.test.ts +130 -0
  127. package/src/components/molecules/PickerGroup/PickerGroup.stories.ts +90 -0
  128. package/src/components/molecules/PickerGroup/PickerGroup.test.ts +145 -0
  129. package/src/components/molecules/PickerList/PickerList.stories.ts +436 -0
  130. package/src/components/molecules/PickerList/PickerList.test.ts +870 -0
  131. package/src/components/molecules/PlaceholderInput/PlaceholderInput.stories.ts +48 -0
  132. package/src/components/molecules/PlaceholderInput/PlaceholderInput.test.ts +107 -0
  133. package/src/components/molecules/PropertyCard/PropertyCard.stories.ts +46 -0
  134. package/src/components/molecules/PropertyCard/PropertyCard.test.ts +59 -0
  135. package/src/components/molecules/Select/Select.stories.ts +264 -0
  136. package/src/components/molecules/Select/Select.test.ts +315 -0
  137. package/src/components/molecules/SidebarMenuItem/SidebarMenuItem.stories.ts +84 -0
  138. package/src/components/molecules/SidebarMenuItem/SidebarMenuItem.test.ts +103 -0
  139. package/src/components/molecules/SkeletonPropertyCard/SkeletonPropertyCard.stories.ts +11 -0
  140. package/src/components/molecules/SkeletonPropertyCard/SkeletonPropertyCard.test.ts +38 -0
  141. package/src/components/molecules/SocialIcons/SocialIcons.stories.ts +28 -0
  142. package/src/components/molecules/SocialIcons/SocialIcons.test.ts +58 -0
  143. package/src/components/molecules/SocialMediaCustomTemplate/SocialMediaCustomTemplate.stories.ts +11 -0
  144. package/src/components/molecules/SocialMediaCustomTemplate/SocialMediaCustomTemplate.test.ts +116 -0
  145. package/src/components/molecules/SocialMediaType/SocialMediaType.stories.ts +37 -0
  146. package/src/components/molecules/SocialMediaType/SocialMediaType.test.ts +126 -0
  147. package/src/components/molecules/Source/Source.stories.ts +35 -0
  148. package/src/components/molecules/Source/Source.test.ts +45 -0
  149. package/src/components/molecules/TabbedContent/TabbedContent.stories.ts +96 -0
  150. package/src/components/molecules/TabbedContent/TabbedContent.test.ts +109 -0
  151. package/src/components/molecules/Tabs/Tabs.stories.ts +230 -0
  152. package/src/components/molecules/Tabs/Tabs.test.ts +280 -0
  153. package/src/components/molecules/TemplateCard/TemplateCard.stories.ts +327 -0
  154. package/src/components/molecules/TemplateCard/TemplateCard.test.ts +339 -0
  155. package/src/components/molecules/Textarea/Textarea.stories.ts +216 -0
  156. package/src/components/molecules/Textarea/Textarea.test.ts +191 -0
  157. package/src/components/molecules/TimelineEvent/TimelineEvent.stories.ts +319 -0
  158. package/src/components/molecules/TimelineEvent/TimelineEvent.test.ts +224 -0
  159. package/src/components/molecules/TimelineLanes/TimelineLanes.stories.ts +29 -0
  160. package/src/components/molecules/TimelineLanes/TimelineLanes.test.ts +30 -0
  161. package/src/components/molecules/Toast/Toast.stories.ts +110 -0
  162. package/src/components/molecules/Toast/Toast.test.ts +103 -0
  163. package/src/components/molecules/ToggleGroup/ToggleGroup.stories.ts +297 -0
  164. package/src/components/molecules/ToggleGroup/ToggleGroup.test.ts +578 -0
  165. package/src/components/molecules/Tree/Tree.stories.ts +884 -0
  166. package/src/components/molecules/Tree/Tree.test.ts +1247 -0
  167. package/src/components/molecules/Tree/tree-drop.test.ts +223 -0
  168. package/src/components/organisms/Calendar/Calendar.stories.ts +108 -0
  169. package/src/components/organisms/Calendar/Calendar.test.ts +279 -0
  170. package/src/components/organisms/Calendar/_CalendarDayView.test.ts +104 -0
  171. package/src/components/organisms/Calendar/_CalendarHeader.test.ts +86 -0
  172. package/src/components/organisms/Calendar/_CalendarMonthView.test.ts +52 -0
  173. package/src/components/organisms/Calendar/_CalendarTimePicker.test.ts +89 -0
  174. package/src/components/organisms/Calendar/_CalendarYearView.test.ts +56 -0
  175. package/src/components/organisms/ColorPicker/ColorPicker.stories.ts +229 -0
  176. package/src/components/organisms/ColorPicker/ColorPicker.test.ts +638 -0
  177. package/src/components/organisms/ColorPicker/gradient.test.ts +67 -0
  178. package/src/components/organisms/ColorPicker/gradientGeometry.test.ts +206 -0
  179. package/src/components/organisms/Combobox/Combobox.stories.ts +234 -0
  180. package/src/components/organisms/Combobox/Combobox.test.ts +512 -0
  181. package/src/components/organisms/Combobox/Combobox.vue +1 -1
  182. package/src/components/organisms/ComboboxPanel/ComboboxPanel.stories.ts +158 -0
  183. package/src/components/organisms/ComboboxPanel/ComboboxPanel.test.ts +524 -0
  184. package/src/components/organisms/ComboboxPanel/ComboboxPanel.vue +1 -1
  185. package/src/components/organisms/CountrySelect/CountrySelect.stories.ts +139 -0
  186. package/src/components/organisms/CountrySelect/CountrySelect.test.ts +149 -0
  187. package/src/components/organisms/DatePicker/DatePicker.stories.ts +163 -0
  188. package/src/components/organisms/DatePicker/DatePicker.test.ts +214 -0
  189. package/src/components/organisms/DropdownButton/DropdownButton.stories.ts +123 -0
  190. package/src/components/organisms/DropdownButton/DropdownButton.test.ts +379 -0
  191. package/src/components/organisms/FontPicker/FontPicker.stories.ts +476 -0
  192. package/src/components/organisms/FontPicker/FontPicker.test.ts +873 -0
  193. package/src/components/organisms/Header/Header.stories.ts +75 -0
  194. package/src/components/organisms/Header/Header.test.ts +233 -0
  195. package/src/components/organisms/IconPicker/IconPicker.stories.ts +734 -0
  196. package/src/components/organisms/IconPicker/IconPicker.test.ts +669 -0
  197. package/src/components/organisms/IconPicker/_IconPickerGrid.test.ts +184 -0
  198. package/src/components/organisms/IconPicker/_IconPickerRail.test.ts +102 -0
  199. package/src/components/organisms/IconPicker/useIconPickerNavigation.test.ts +215 -0
  200. package/src/components/organisms/Modal/Modal.stories.ts +350 -0
  201. package/src/components/organisms/Modal/Modal.test.ts +275 -0
  202. package/src/components/organisms/PickerPanel/PickerPanel.stories.ts +452 -0
  203. package/src/components/organisms/PickerPanel/PickerPanel.test.ts +358 -0
  204. package/src/components/organisms/ProgressBar/ProgressBar.stories.ts +100 -0
  205. package/src/components/organisms/ProgressBar/ProgressBar.test.ts +417 -0
  206. package/src/components/organisms/ReferenceCard/ReferenceCard.stories.ts +191 -0
  207. package/src/components/organisms/ReferenceCard/ReferenceCard.test.ts +165 -0
  208. package/src/components/organisms/SocialMediaTemplate/SocialMediaTemplate.stories.ts +65 -0
  209. package/src/components/organisms/SocialMediaTemplate/SocialMediaTemplate.test.ts +466 -0
  210. package/src/components/organisms/StepperHeader/StepperHeader.stories.ts +91 -0
  211. package/src/components/organisms/StepperHeader/StepperHeader.test.ts +279 -0
  212. package/src/components/organisms/Table/Table.stories.ts +332 -0
  213. package/src/components/organisms/Table/Table.test.ts +320 -0
  214. package/src/components/organisms/TimelinePhaseblock/TimelinePhaseblock.stories.ts +198 -0
  215. package/src/components/organisms/TimelinePhaseblock/TimelinePhaseblock.test.ts +283 -0
  216. package/src/components/organisms/TimelineTrack/TimelineTrack.stories.ts +120 -0
  217. package/src/components/organisms/TimelineTrack/TimelineTrack.test.ts +91 -0
  218. package/src/components/organisms/Toaster/Toaster.stories.ts +51 -0
  219. package/src/components/organisms/Toaster/Toaster.test.ts +75 -0
  220. package/src/components/organisms/VideoControls/VideoControls.stories.ts +792 -0
  221. package/src/components/organisms/VideoControls/VideoControls.test.ts +1056 -0
  222. package/src/components/organisms/VideoPlayer/VideoPlayer.stories.ts +327 -0
  223. package/src/components/organisms/VideoPlayer/VideoPlayer.test.ts +439 -0
@@ -0,0 +1,290 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3-vite'
2
+ import Button from './Button.vue'
3
+
4
+ export default {
5
+ title: 'Components/Atoms/Button',
6
+ component: Button,
7
+ } satisfies Meta<typeof Button>
8
+
9
+ type Story = StoryObj<typeof Button>
10
+
11
+ export const Primary: Story = {
12
+ args: {
13
+ default: 'Button',
14
+ variant: 'primary',
15
+ iconRight: false,
16
+ disabled: false,
17
+ loading: false,
18
+ },
19
+ }
20
+
21
+ export const Secondary: Story = {
22
+ args: {
23
+ variant: 'secondary',
24
+ default: 'Secondary Button',
25
+ },
26
+ }
27
+
28
+ export const Success: Story = {
29
+ args: {
30
+ variant: 'success',
31
+ default: 'Success Button',
32
+ },
33
+ }
34
+
35
+ export const Danger: Story = {
36
+ args: {
37
+ variant: 'danger',
38
+ default: 'Danger Button',
39
+ },
40
+ }
41
+
42
+ export const Warning: Story = {
43
+ args: {
44
+ variant: 'warning',
45
+ default: 'Warning Button',
46
+ },
47
+ }
48
+
49
+ export const Link: Story = {
50
+ args: {
51
+ variant: 'link',
52
+ default: 'Link Button',
53
+ },
54
+ }
55
+
56
+ export const WithIcon: Story = {
57
+ args: {
58
+ icon: 'star',
59
+ default: 'With Icon',
60
+ },
61
+ }
62
+
63
+ export const WithIconRight: Story = {
64
+ args: {
65
+ icon: 'arrow-right',
66
+ iconRight: true,
67
+ default: 'Next Step',
68
+ },
69
+ }
70
+
71
+ export const WithIconSecondary: Story = {
72
+ args: {
73
+ variant: 'secondary',
74
+ icon: 'download',
75
+ default: 'Download',
76
+ },
77
+ }
78
+
79
+ export const WithIconSuccess: Story = {
80
+ args: {
81
+ variant: 'success',
82
+ icon: 'check',
83
+ default: 'Success Button',
84
+ },
85
+ }
86
+
87
+ export const WithIconDanger: Story = {
88
+ args: {
89
+ variant: 'danger',
90
+ icon: 'trash',
91
+ default: 'Danger Button',
92
+ },
93
+ }
94
+
95
+ export const WithIconWarning: Story = {
96
+ args: {
97
+ variant: 'warning',
98
+ icon: 'triangle-exclamation',
99
+ default: 'Warning Button',
100
+ },
101
+ }
102
+
103
+ export const WithIconLink: Story = {
104
+ args: {
105
+ variant: 'link',
106
+ icon: 'download',
107
+ default: 'Download',
108
+ },
109
+ }
110
+
111
+ export const IconOnly: Story = {
112
+ args: {
113
+ icon: 'plus',
114
+ },
115
+ }
116
+
117
+ export const IconOnlySecondary: Story = {
118
+ args: {
119
+ variant: 'secondary',
120
+ icon: 'plus',
121
+ },
122
+ }
123
+
124
+ export const IconOnlySuccess: Story = {
125
+ args: {
126
+ variant: 'success',
127
+ icon: 'check',
128
+ },
129
+ }
130
+
131
+ export const IconOnlyDanger: Story = {
132
+ args: {
133
+ variant: 'danger',
134
+ icon: 'trash',
135
+ },
136
+ }
137
+
138
+ export const IconOnlyWarning: Story = {
139
+ args: {
140
+ variant: 'warning',
141
+ icon: 'triangle-exclamation',
142
+ },
143
+ }
144
+
145
+ export const IconOnlyLink: Story = {
146
+ args: {
147
+ variant: 'link',
148
+ icon: 'plus',
149
+ },
150
+ }
151
+
152
+ export const Disabled: Story = {
153
+ args: {
154
+ default: 'Disabled',
155
+ disabled: true,
156
+ },
157
+ }
158
+
159
+ export const DisabledSecondary: Story = {
160
+ args: {
161
+ variant: 'secondary',
162
+ default: 'Secondary Disabled',
163
+ disabled: true,
164
+ },
165
+ }
166
+
167
+ export const DisabledSuccess: Story = {
168
+ args: {
169
+ variant: 'success',
170
+ default: 'Success Disabled',
171
+ disabled: true,
172
+ },
173
+ }
174
+
175
+ export const DisabledDanger: Story = {
176
+ args: {
177
+ variant: 'danger',
178
+ default: 'Danger Disabled',
179
+ disabled: true,
180
+ },
181
+ }
182
+
183
+ export const DisabledWarning: Story = {
184
+ args: {
185
+ variant: 'warning',
186
+ default: 'Warning Disabled',
187
+ disabled: true,
188
+ },
189
+ }
190
+
191
+ export const DisabledLink: Story = {
192
+ args: {
193
+ variant: 'link',
194
+ default: 'Link Disabled',
195
+ disabled: true,
196
+ },
197
+ }
198
+
199
+ export const Loading: Story = {
200
+ args: {
201
+ default: 'Loading',
202
+ loading: true,
203
+ },
204
+ }
205
+
206
+ export const LoadingSecondary: Story = {
207
+ args: {
208
+ variant: 'secondary',
209
+ default: 'Loading',
210
+ loading: true,
211
+ },
212
+ }
213
+
214
+ export const LoadingSuccess: Story = {
215
+ args: {
216
+ variant: 'success',
217
+ default: 'Loading',
218
+ loading: true,
219
+ },
220
+ }
221
+
222
+ export const LoadingDanger: Story = {
223
+ args: {
224
+ variant: 'danger',
225
+ default: 'Loading',
226
+ loading: true,
227
+ },
228
+ }
229
+
230
+ export const LoadingWarning: Story = {
231
+ args: {
232
+ variant: 'warning',
233
+ default: 'Loading',
234
+ loading: true,
235
+ },
236
+ }
237
+
238
+ export const LoadingLink: Story = {
239
+ args: {
240
+ variant: 'link',
241
+ default: 'Link Button',
242
+ loading: true,
243
+ },
244
+ }
245
+
246
+ export const Rounded: Story = {
247
+ args: {
248
+ default: 'Rounded Button',
249
+ rounded: true,
250
+ },
251
+ }
252
+
253
+ export const RoundedSecondary: Story = {
254
+ args: {
255
+ variant: 'secondary',
256
+ default: 'Rounded Button',
257
+ rounded: true,
258
+ },
259
+ }
260
+
261
+ export const RoundedWithIcon: Story = {
262
+ args: {
263
+ icon: 'star',
264
+ default: 'Rounded With Icon',
265
+ rounded: true,
266
+ },
267
+ }
268
+
269
+ export const RoundedIconOnly: Story = {
270
+ args: {
271
+ icon: 'plus',
272
+ rounded: true,
273
+ },
274
+ }
275
+
276
+ export const RoundedDisabled: Story = {
277
+ args: {
278
+ default: 'Rounded Disabled',
279
+ rounded: true,
280
+ disabled: true,
281
+ },
282
+ }
283
+
284
+ export const RoundedLoading: Story = {
285
+ args: {
286
+ default: 'Rounded Loading',
287
+ rounded: true,
288
+ loading: true,
289
+ },
290
+ }
@@ -0,0 +1,406 @@
1
+ import { describe, it, expect } from 'vitest'
2
+ import { mount } from '@vue/test-utils'
3
+ import Button from './Button.vue'
4
+
5
+ describe('Button', () => {
6
+ it('renders slot content', () => {
7
+ const wrapper = mount(Button, {
8
+ slots: {
9
+ default: 'Click me',
10
+ },
11
+ })
12
+
13
+ expect(wrapper.text()).toBe('Click me')
14
+ })
15
+
16
+ it('renders complex slot content', () => {
17
+ const wrapper = mount(Button, {
18
+ slots: {
19
+ default: '<span>Complex</span> <span>Text</span>',
20
+ },
21
+ })
22
+
23
+ expect(wrapper.html()).toContain('<span>Complex</span>')
24
+ expect(wrapper.html()).toContain('<span>Text</span>')
25
+ })
26
+
27
+ it('applies primary variant by default', () => {
28
+ const wrapper = mount(Button, {
29
+ slots: {
30
+ default: 'Click me',
31
+ },
32
+ })
33
+
34
+ expect(wrapper.classes()).toContain('button-primary')
35
+ })
36
+
37
+ it('applies secondary variant when specified', () => {
38
+ const wrapper = mount(Button, {
39
+ props: {
40
+ variant: 'secondary',
41
+ },
42
+ slots: {
43
+ default: 'Click me',
44
+ },
45
+ })
46
+
47
+ expect(wrapper.classes()).toContain('button-secondary')
48
+ })
49
+
50
+ it('applies success variant when specified', () => {
51
+ const wrapper = mount(Button, {
52
+ props: {
53
+ variant: 'success',
54
+ },
55
+ slots: {
56
+ default: 'Click me',
57
+ },
58
+ })
59
+
60
+ expect(wrapper.classes()).toContain('button-success')
61
+ })
62
+
63
+ it('applies danger variant when specified', () => {
64
+ const wrapper = mount(Button, {
65
+ props: {
66
+ variant: 'danger',
67
+ },
68
+ slots: {
69
+ default: 'Click me',
70
+ },
71
+ })
72
+
73
+ expect(wrapper.classes()).toContain('button-danger')
74
+ })
75
+
76
+ it('applies warning variant when specified', () => {
77
+ const wrapper = mount(Button, {
78
+ props: {
79
+ variant: 'warning',
80
+ },
81
+ slots: {
82
+ default: 'Click me',
83
+ },
84
+ })
85
+
86
+ expect(wrapper.classes()).toContain('button-warning')
87
+ })
88
+
89
+ it('applies link variant when specified', () => {
90
+ const wrapper = mount(Button, {
91
+ props: {
92
+ variant: 'link',
93
+ },
94
+ slots: {
95
+ default: 'Click me',
96
+ },
97
+ })
98
+
99
+ expect(wrapper.classes()).toContain('button-link')
100
+ })
101
+
102
+ it('applies link variant special classes', () => {
103
+ const wrapper = mount(Button, {
104
+ props: {
105
+ variant: 'link',
106
+ },
107
+ slots: {
108
+ default: 'Click me',
109
+ },
110
+ })
111
+
112
+ const span = wrapper.find('span')
113
+ expect(span.classes()).toContain('body-link')
114
+ expect(span.classes()).toContain('underline-offset-1')
115
+ expect(span.classes()).toContain('hover:underline-offset-2')
116
+ })
117
+
118
+ it('does not apply hover underline offset when link is disabled', () => {
119
+ const wrapper = mount(Button, {
120
+ props: {
121
+ variant: 'link',
122
+ disabled: true,
123
+ },
124
+ slots: {
125
+ default: 'Click me',
126
+ },
127
+ })
128
+
129
+ const span = wrapper.find('span')
130
+ expect(span.classes()).not.toContain('hover:underline-offset-2')
131
+ })
132
+
133
+ it('renders icon when icon prop is provided', () => {
134
+ const wrapper = mount(Button, {
135
+ props: {
136
+ icon: 'star',
137
+ },
138
+ slots: {
139
+ default: 'Click me',
140
+ },
141
+ })
142
+
143
+ const icon = wrapper.find('i')
144
+ expect(icon.exists()).toBe(true)
145
+ expect(icon.classes()).toContain('fa-light')
146
+ expect(icon.classes()).toContain('fa-star')
147
+ })
148
+
149
+ it('does not render icon when icon prop is not provided', () => {
150
+ const wrapper = mount(Button, {
151
+ slots: {
152
+ default: 'Click me',
153
+ },
154
+ })
155
+
156
+ const icon = wrapper.find('i')
157
+ expect(icon.exists()).toBe(false)
158
+ })
159
+
160
+ it('positions icon on the right when iconRight is true', () => {
161
+ const wrapper = mount(Button, {
162
+ props: {
163
+ icon: 'arrow-right',
164
+ iconRight: true,
165
+ },
166
+ slots: {
167
+ default: 'Next',
168
+ },
169
+ })
170
+
171
+ const icon = wrapper.find('i')
172
+ expect(icon.classes()).toContain('order-last')
173
+ })
174
+
175
+ it('positions icon on the left by default', () => {
176
+ const wrapper = mount(Button, {
177
+ props: {
178
+ icon: 'arrow-right',
179
+ },
180
+ slots: {
181
+ default: 'Back',
182
+ },
183
+ })
184
+
185
+ const icon = wrapper.find('i')
186
+ expect(icon.classes()).not.toContain('order-last')
187
+ })
188
+
189
+ it('renders as button type="button"', () => {
190
+ const wrapper = mount(Button, {
191
+ slots: {
192
+ default: 'Click me',
193
+ },
194
+ })
195
+
196
+ expect(wrapper.element.tagName).toBe('BUTTON')
197
+ expect(wrapper.attributes('type')).toBe('button')
198
+ })
199
+
200
+ it('disables button when disabled prop is true', () => {
201
+ const wrapper = mount(Button, {
202
+ props: {
203
+ disabled: true,
204
+ },
205
+ slots: {
206
+ default: 'Click me',
207
+ },
208
+ })
209
+
210
+ expect(wrapper.attributes('disabled')).toBeDefined()
211
+ expect(wrapper.classes()).toContain('disabled:cursor-not-allowed')
212
+ })
213
+
214
+ it('applies disabled styles for primary variant', () => {
215
+ const wrapper = mount(Button, {
216
+ props: {
217
+ variant: 'primary',
218
+ disabled: true,
219
+ },
220
+ slots: {
221
+ default: 'Click me',
222
+ },
223
+ })
224
+
225
+ expect(wrapper.attributes()).toHaveProperty('disabled')
226
+ })
227
+
228
+ it('hides icon and slot content when loading', () => {
229
+ const wrapper = mount(Button, {
230
+ props: {
231
+ loading: true,
232
+ icon: 'star',
233
+ },
234
+ slots: {
235
+ default: 'Submit',
236
+ },
237
+ })
238
+
239
+ const starIcon = wrapper.find('.fa-star')
240
+ expect(starIcon.classes()).toContain('opacity-0')
241
+
242
+ const label = wrapper.find('span')
243
+ expect(label.classes()).toContain('opacity-0')
244
+ })
245
+
246
+ it('removes hover effects when loading or disabled in link variant', async () => {
247
+ const wrapper = mount(Button, {
248
+ props: {
249
+ variant: 'link',
250
+ loading: true,
251
+ },
252
+ slots: {
253
+ default: 'Link',
254
+ },
255
+ })
256
+
257
+ expect(wrapper.find('span').classes()).not.toContain('hover:underline-offset-2')
258
+
259
+ await wrapper.setProps({ loading: false, disabled: true })
260
+ expect(wrapper.find('span').classes()).not.toContain('hover:underline-offset-2')
261
+
262
+ await wrapper.setProps({ disabled: false })
263
+ expect(wrapper.find('span').classes()).toContain('hover:underline-offset-2')
264
+ })
265
+
266
+ it('renders icon-only button without padding', () => {
267
+ const wrapper = mount(Button, {
268
+ props: {
269
+ icon: 'star',
270
+ },
271
+ })
272
+
273
+ expect(wrapper.classes()).toContain('w-10')
274
+ expect(wrapper.classes()).not.toContain('px-4')
275
+ })
276
+
277
+ it('displays spinner icon when loading is true', () => {
278
+ const wrapper = mount(Button, {
279
+ props: {
280
+ loading: true,
281
+ },
282
+ })
283
+
284
+ const icon = wrapper.find('i')
285
+ expect(icon.exists()).toBe(true)
286
+ expect(icon.classes()).toContain('fa-spinner-third')
287
+ expect(icon.classes()).toContain('fa-spin')
288
+ })
289
+
290
+ it('disables button when loading is true', () => {
291
+ const wrapper = mount(Button, {
292
+ props: {
293
+ loading: true,
294
+ },
295
+ })
296
+
297
+ expect(wrapper.classes()).toContain('pointer-events-none')
298
+ })
299
+
300
+ it('set the button type prop', async () => {
301
+ const wrapper = mount(Button)
302
+
303
+ expect(wrapper.attributes('type')).toBe('button')
304
+
305
+ await wrapper.setProps({ buttonType: 'submit' })
306
+ expect(wrapper.attributes('type')).toBe('submit')
307
+
308
+ await wrapper.setProps({ buttonType: 'reset' })
309
+ expect(wrapper.attributes('type')).toBe('reset')
310
+ })
311
+
312
+ it('no animated span whitout default slot', async () => {
313
+ const wrapper = mount(Button)
314
+
315
+ const slotSpanWrapper = wrapper.find('span')
316
+
317
+ expect(slotSpanWrapper.exists()).toBe(false)
318
+ })
319
+
320
+ it('applies rounded-full when rounded prop is true', () => {
321
+ const wrapper = mount(Button, {
322
+ props: { rounded: true },
323
+ slots: { default: 'Click me' },
324
+ })
325
+
326
+ expect(wrapper.classes()).toContain('rounded-full')
327
+ expect(wrapper.classes()).not.toContain('rounded-lg')
328
+ })
329
+
330
+ it('applies rounded-lg by default when rounded is false', () => {
331
+ const wrapper = mount(Button, {
332
+ slots: { default: 'Click me' },
333
+ })
334
+
335
+ expect(wrapper.classes()).toContain('rounded-lg')
336
+ expect(wrapper.classes()).not.toContain('rounded-full')
337
+ })
338
+
339
+ it('applies rounded-full to the loading overlay when rounded is true', () => {
340
+ const wrapper = mount(Button, {
341
+ props: { rounded: true, loading: true },
342
+ })
343
+
344
+ const overlay = wrapper.find('.absolute.inset-0')
345
+ expect(overlay.classes()).toContain('rounded-full')
346
+ expect(overlay.classes()).not.toContain('rounded-lg')
347
+ })
348
+
349
+ it('applies rounded-lg to the loading overlay by default', () => {
350
+ const wrapper = mount(Button, {
351
+ props: { loading: true },
352
+ })
353
+
354
+ const overlay = wrapper.find('.absolute.inset-0')
355
+ expect(overlay.classes()).toContain('rounded-lg')
356
+ expect(overlay.classes()).not.toContain('rounded-full')
357
+ })
358
+
359
+ it('has animated span with default slot', async () => {
360
+ const wrapper = mount(Button, {
361
+ slots: {
362
+ default: 'text',
363
+ },
364
+ })
365
+
366
+ const slotSpanWrapper = wrapper.find('span')
367
+
368
+ expect(slotSpanWrapper.exists()).toBe(true)
369
+ })
370
+
371
+ describe('fullWidth prop', () => {
372
+ it('applies justify-center and no w-full by default', () => {
373
+ const wrapper = mount(Button, { slots: { default: 'Click me' } })
374
+ expect(wrapper.classes()).toContain('justify-center')
375
+ expect(wrapper.classes()).not.toContain('w-full')
376
+ expect(wrapper.classes()).not.toContain('justify-start')
377
+ })
378
+
379
+ it('applies w-full and justify-start when fullWidth is true', () => {
380
+ const wrapper = mount(Button, {
381
+ props: { fullWidth: true },
382
+ slots: { default: 'Click me' },
383
+ })
384
+ expect(wrapper.classes()).toContain('w-full')
385
+ expect(wrapper.classes()).toContain('justify-start')
386
+ expect(wrapper.classes()).not.toContain('justify-center')
387
+ })
388
+
389
+ it('adds flex-1 and min-w-0 to the slot span when fullWidth is true', () => {
390
+ const wrapper = mount(Button, {
391
+ props: { fullWidth: true },
392
+ slots: { default: 'Click me' },
393
+ })
394
+ const span = wrapper.find('span')
395
+ expect(span.classes()).toContain('flex-1')
396
+ expect(span.classes()).toContain('min-w-0')
397
+ })
398
+
399
+ it('does not add flex-1 or min-w-0 to the slot span by default', () => {
400
+ const wrapper = mount(Button, { slots: { default: 'Click me' } })
401
+ const span = wrapper.find('span')
402
+ expect(span.classes()).not.toContain('flex-1')
403
+ expect(span.classes()).not.toContain('min-w-0')
404
+ })
405
+ })
406
+ })