@nexxtmove/ui 2.6.0 → 2.8.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.
- package/dist/components/editor/molecules/EditorColor/EditorColor.vue.d.ts +7 -5
- package/dist/components/editor/molecules/EditorColor/_ColorField.vue.d.ts +4 -1
- package/dist/components/organisms/ColorPicker/ColorPicker.vue.d.ts +3 -1
- package/dist/index.js +95 -172
- package/dist/nuxt.js +0 -1
- package/package.json +38 -36
- package/src/attribute-contract.test.ts +151 -0
- package/src/components/atoms/AnimatedNumber/AnimatedNumber.stories.ts +36 -0
- package/src/components/atoms/AnimatedNumber/AnimatedNumber.test.ts +21 -0
- package/src/components/atoms/Avatar/Avatar.stories.ts +122 -0
- package/src/components/atoms/Avatar/Avatar.test.ts +134 -0
- package/src/components/atoms/Button/Button.stories.ts +290 -0
- package/src/components/atoms/Button/Button.test.ts +406 -0
- package/src/components/atoms/Card/Card.stories.ts +45 -0
- package/src/components/atoms/Card/Card.test.ts +46 -0
- package/src/components/atoms/Checkbox/Checkbox.stories.ts +35 -0
- package/src/components/atoms/Checkbox/Checkbox.test.ts +55 -0
- package/src/components/atoms/Chip/Chip.stories.ts +274 -0
- package/src/components/atoms/Chip/Chip.test.ts +230 -0
- package/src/components/atoms/EnergyLabel/EnergyLabel.stories.ts +189 -0
- package/src/components/atoms/EnergyLabel/EnergyLabel.test.ts +100 -0
- package/src/components/atoms/FloatingPanel/FloatingPanel.stories.ts +677 -0
- package/src/components/atoms/FloatingPanel/FloatingPanel.test.ts +864 -0
- package/src/components/atoms/Icon/Icon.stories.ts +63 -0
- package/src/components/atoms/Icon/Icon.test.ts +89 -0
- package/src/components/atoms/Loader/Loader.stories.ts +36 -0
- package/src/components/atoms/Loader/Loader.test.ts +40 -0
- package/src/components/atoms/PickerItem/PickerItem.stories.ts +172 -0
- package/src/components/atoms/PickerItem/PickerItem.test.ts +142 -0
- package/src/components/atoms/PickerPreview/PickerPreview.stories.ts +183 -0
- package/src/components/atoms/PickerPreview/PickerPreview.test.ts +137 -0
- package/src/components/atoms/PresenceIndicator/PresenceIndicator.stories.ts +21 -0
- package/src/components/atoms/PropertyListing/PropertyListing.stories.ts +38 -0
- package/src/components/atoms/PropertyListing/PropertyListing.test.ts +46 -0
- package/src/components/atoms/SelectableOption/SelectableOption.stories.ts +131 -0
- package/src/components/atoms/SelectableOption/SelectableOption.test.ts +96 -0
- package/src/components/atoms/Skeleton/Skeleton.stories.ts +27 -0
- package/src/components/atoms/Skeleton/Skeleton.test.ts +28 -0
- package/src/components/atoms/Slider/Slider.stories.ts +151 -0
- package/src/components/atoms/Slider/Slider.test.ts +191 -0
- package/src/components/atoms/Squircle/Squircle.stories.ts +114 -0
- package/src/components/atoms/Squircle/Squircle.test.ts +70 -0
- package/src/components/atoms/Switch/Switch.stories.ts +91 -0
- package/src/components/atoms/Switch/Switch.test.ts +183 -0
- package/src/components/atoms/Tooltip/Tooltip.stories.ts +158 -0
- package/src/components/atoms/Tooltip/Tooltip.test.ts +134 -0
- package/src/components/editor/atoms/EditorDimensionField/EditorDimensionField.stories.ts +124 -0
- package/src/components/editor/atoms/EditorDimensionField/EditorDimensionField.test.ts +464 -0
- package/src/components/editor/atoms/EditorSettingsBlock/EditorSettingsBlock.stories.ts +266 -0
- package/src/components/editor/atoms/EditorSettingsBlock/EditorSettingsBlock.test.ts +421 -0
- package/src/components/editor/atoms/EditorSettingsGroup/EditorSettingsGroup.stories.ts +365 -0
- package/src/components/editor/atoms/EditorSettingsGroup/EditorSettingsGroup.test.ts +484 -0
- package/src/components/editor/composables/useRadioGrid.test.ts +261 -0
- package/src/components/editor/molecules/EditorAlignItems/EditorAlignItems.stories.ts +73 -0
- package/src/components/editor/molecules/EditorAlignItems/EditorAlignItems.test.ts +189 -0
- package/src/components/editor/molecules/EditorAlignmentGrid/EditorAlignmentGrid.stories.ts +309 -0
- package/src/components/editor/molecules/EditorAlignmentGrid/EditorAlignmentGrid.test.ts +359 -0
- package/src/components/editor/molecules/EditorAnchor/EditorAnchor.stories.ts +138 -0
- package/src/components/editor/molecules/EditorAnchor/EditorAnchor.test.ts +344 -0
- package/src/components/editor/molecules/EditorBackgroundSize/EditorBackgroundSize.stories.ts +87 -0
- package/src/components/editor/molecules/EditorBackgroundSize/EditorBackgroundSize.test.ts +262 -0
- package/src/components/editor/molecules/EditorBlur/EditorBlur.stories.ts +115 -0
- package/src/components/editor/molecules/EditorBlur/EditorBlur.test.ts +243 -0
- package/src/components/editor/molecules/EditorBorder/EditorBorder.stories.ts +187 -0
- package/src/components/editor/molecules/EditorBorder/EditorBorder.test.ts +456 -0
- package/src/components/editor/molecules/EditorColor/EditorColor.stories.ts +633 -0
- package/src/components/editor/molecules/EditorColor/EditorColor.test.ts +776 -0
- package/src/components/editor/molecules/EditorColor/EditorColor.vue +7 -5
- package/src/components/editor/molecules/EditorColor/EditorColorGradient.test.ts +832 -0
- package/src/components/editor/molecules/EditorColor/_ColorField.vue +20 -15
- package/src/components/editor/molecules/EditorColor/gradientClass.test.ts +303 -0
- package/src/components/editor/molecules/EditorDashPattern/EditorDashPattern.stories.ts +72 -0
- package/src/components/editor/molecules/EditorDashPattern/EditorDashPattern.test.ts +124 -0
- package/src/components/editor/molecules/EditorFlexDirection/EditorFlexDirection.stories.ts +46 -0
- package/src/components/editor/molecules/EditorFlexDirection/EditorFlexDirection.test.ts +97 -0
- package/src/components/editor/molecules/EditorFontSize/EditorFontSize.stories.ts +248 -0
- package/src/components/editor/molecules/EditorFontSize/EditorFontSize.test.ts +288 -0
- package/src/components/editor/molecules/EditorGap/EditorGap.stories.ts +129 -0
- package/src/components/editor/molecules/EditorGap/EditorGap.test.ts +253 -0
- package/src/components/editor/molecules/EditorHeadingType/EditorHeadingType.stories.ts +68 -0
- package/src/components/editor/molecules/EditorHeadingType/EditorHeadingType.test.ts +150 -0
- package/src/components/editor/molecules/EditorJustifyContent/EditorJustifyContent.stories.ts +71 -0
- package/src/components/editor/molecules/EditorJustifyContent/EditorJustifyContent.test.ts +161 -0
- package/src/components/editor/molecules/EditorLetterSpacing/EditorLetterSpacing.stories.ts +204 -0
- package/src/components/editor/molecules/EditorLetterSpacing/EditorLetterSpacing.test.ts +238 -0
- package/src/components/editor/molecules/EditorLineHeight/EditorLineHeight.stories.ts +257 -0
- package/src/components/editor/molecules/EditorLineHeight/EditorLineHeight.test.ts +286 -0
- package/src/components/editor/molecules/EditorLineStyle/EditorLineStyle.stories.ts +135 -0
- package/src/components/editor/molecules/EditorLineStyle/EditorLineStyle.test.ts +230 -0
- package/src/components/editor/molecules/EditorMaxWidth/EditorMaxWidth.stories.ts +154 -0
- package/src/components/editor/molecules/EditorMaxWidth/EditorMaxWidth.test.ts +112 -0
- package/src/components/editor/molecules/EditorOverrideStatus/EditorOverrideStatus.stories.ts +206 -0
- package/src/components/editor/molecules/EditorOverrideStatus/EditorOverrideStatus.test.ts +332 -0
- package/src/components/editor/molecules/EditorPadding/EditorPadding.stories.ts +374 -0
- package/src/components/editor/molecules/EditorPadding/EditorPadding.test.ts +712 -0
- package/src/components/editor/molecules/EditorRadius/EditorRadius.stories.ts +64 -0
- package/src/components/editor/molecules/EditorRadius/EditorRadius.test.ts +137 -0
- package/src/components/editor/molecules/EditorShadow/EditorShadow.stories.ts +103 -0
- package/src/components/editor/molecules/EditorShadow/EditorShadow.test.ts +168 -0
- package/src/components/editor/molecules/EditorSize/EditorSize.stories.ts +84 -0
- package/src/components/editor/molecules/EditorSize/EditorSize.test.ts +253 -0
- package/src/components/editor/molecules/EditorSizeLimit/EditorSizeLimit.stories.ts +49 -0
- package/src/components/editor/molecules/EditorSizeLimit/EditorSizeLimit.test.ts +43 -0
- package/src/components/editor/molecules/EditorTextAlign/EditorTextAlign.stories.ts +69 -0
- package/src/components/editor/molecules/EditorTextAlign/EditorTextAlign.test.ts +155 -0
- package/src/components/molecules/Announcement/Announcement.stories.ts +224 -0
- package/src/components/molecules/Announcement/Announcement.test.ts +161 -0
- package/src/components/molecules/ContactInfoCard/ContactInfoCard.stories.ts +99 -0
- package/src/components/molecules/ContactInfoCard/ContactInfoCard.test.ts +70 -0
- package/src/components/molecules/CustomerJourneyTile/CustomerJourneyTile.stories.ts +148 -0
- package/src/components/molecules/CustomerJourneyTile/CustomerJourneyTile.test.ts +271 -0
- package/src/components/molecules/DoughnutChart/DoughnutChart.stories.ts +45 -0
- package/src/components/molecules/DoughnutChart/DoughnutChart.test.ts +205 -0
- package/src/components/molecules/InfoBlock/InfoBlock.stories.ts +84 -0
- package/src/components/molecules/InfoBlock/InfoBlock.test.ts +101 -0
- package/src/components/molecules/InputField/InputField.stories.ts +117 -0
- package/src/components/molecules/InputField/InputField.test.ts +138 -0
- package/src/components/molecules/InputSelect/InputSelect.stories.ts +116 -0
- package/src/components/molecules/InputSelect/InputSelect.test.ts +127 -0
- package/src/components/molecules/ModalFooter/ModalFooter.stories.ts +204 -0
- package/src/components/molecules/ModalFooter/ModalFooter.test.ts +276 -0
- package/src/components/molecules/PageCard/PageCard.stories.ts +100 -0
- package/src/components/molecules/PageCard/PageCard.test.ts +91 -0
- package/src/components/molecules/PageContainer/PageContainer.stories.ts +90 -0
- package/src/components/molecules/PageContainer/PageContainer.test.ts +50 -0
- package/src/components/molecules/PageMockup/PageMockup.stories.ts +38 -0
- package/src/components/molecules/PageMockup/PageMockup.test.ts +20 -0
- package/src/components/molecules/PageTypeTile/PageTypeTile.stories.ts +63 -0
- package/src/components/molecules/PageTypeTile/PageTypeTile.test.ts +41 -0
- package/src/components/molecules/Pagination/Pagination.stories.ts +72 -0
- package/src/components/molecules/Pagination/Pagination.test.ts +130 -0
- package/src/components/molecules/PickerGroup/PickerGroup.stories.ts +90 -0
- package/src/components/molecules/PickerGroup/PickerGroup.test.ts +145 -0
- package/src/components/molecules/PickerList/PickerList.stories.ts +436 -0
- package/src/components/molecules/PickerList/PickerList.test.ts +870 -0
- package/src/components/molecules/PlaceholderInput/PlaceholderInput.stories.ts +48 -0
- package/src/components/molecules/PlaceholderInput/PlaceholderInput.test.ts +107 -0
- package/src/components/molecules/PropertyCard/PropertyCard.stories.ts +46 -0
- package/src/components/molecules/PropertyCard/PropertyCard.test.ts +59 -0
- package/src/components/molecules/Select/Select.stories.ts +264 -0
- package/src/components/molecules/Select/Select.test.ts +315 -0
- package/src/components/molecules/SidebarMenuItem/SidebarMenuItem.stories.ts +84 -0
- package/src/components/molecules/SidebarMenuItem/SidebarMenuItem.test.ts +103 -0
- package/src/components/molecules/SkeletonPropertyCard/SkeletonPropertyCard.stories.ts +11 -0
- package/src/components/molecules/SkeletonPropertyCard/SkeletonPropertyCard.test.ts +38 -0
- package/src/components/molecules/SocialIcons/SocialIcons.stories.ts +28 -0
- package/src/components/molecules/SocialIcons/SocialIcons.test.ts +58 -0
- package/src/components/molecules/SocialMediaCustomTemplate/SocialMediaCustomTemplate.stories.ts +11 -0
- package/src/components/molecules/SocialMediaCustomTemplate/SocialMediaCustomTemplate.test.ts +116 -0
- package/src/components/molecules/SocialMediaType/SocialMediaType.stories.ts +37 -0
- package/src/components/molecules/SocialMediaType/SocialMediaType.test.ts +126 -0
- package/src/components/molecules/Source/Source.stories.ts +35 -0
- package/src/components/molecules/Source/Source.test.ts +45 -0
- package/src/components/molecules/TabbedContent/TabbedContent.stories.ts +96 -0
- package/src/components/molecules/TabbedContent/TabbedContent.test.ts +109 -0
- package/src/components/molecules/Tabs/Tabs.stories.ts +230 -0
- package/src/components/molecules/Tabs/Tabs.test.ts +280 -0
- package/src/components/molecules/TemplateCard/TemplateCard.stories.ts +327 -0
- package/src/components/molecules/TemplateCard/TemplateCard.test.ts +339 -0
- package/src/components/molecules/Textarea/Textarea.stories.ts +216 -0
- package/src/components/molecules/Textarea/Textarea.test.ts +191 -0
- package/src/components/molecules/TimelineEvent/TimelineEvent.stories.ts +319 -0
- package/src/components/molecules/TimelineEvent/TimelineEvent.test.ts +224 -0
- package/src/components/molecules/TimelineLanes/TimelineLanes.stories.ts +29 -0
- package/src/components/molecules/TimelineLanes/TimelineLanes.test.ts +30 -0
- package/src/components/molecules/Toast/Toast.stories.ts +110 -0
- package/src/components/molecules/Toast/Toast.test.ts +103 -0
- package/src/components/molecules/ToggleGroup/ToggleGroup.stories.ts +297 -0
- package/src/components/molecules/ToggleGroup/ToggleGroup.test.ts +578 -0
- package/src/components/molecules/Tree/Tree.stories.ts +884 -0
- package/src/components/molecules/Tree/Tree.test.ts +1247 -0
- package/src/components/molecules/Tree/tree-drop.test.ts +223 -0
- package/src/components/organisms/Calendar/Calendar.stories.ts +108 -0
- package/src/components/organisms/Calendar/Calendar.test.ts +279 -0
- package/src/components/organisms/Calendar/_CalendarDayView.test.ts +104 -0
- package/src/components/organisms/Calendar/_CalendarHeader.test.ts +86 -0
- package/src/components/organisms/Calendar/_CalendarMonthView.test.ts +52 -0
- package/src/components/organisms/Calendar/_CalendarTimePicker.test.ts +89 -0
- package/src/components/organisms/Calendar/_CalendarYearView.test.ts +56 -0
- package/src/components/organisms/ColorPicker/ColorPicker.stories.ts +229 -0
- package/src/components/organisms/ColorPicker/ColorPicker.test.ts +696 -0
- package/src/components/organisms/ColorPicker/ColorPicker.vue +12 -3
- package/src/components/organisms/ColorPicker/gradient.test.ts +67 -0
- package/src/components/organisms/ColorPicker/gradientGeometry.test.ts +206 -0
- package/src/components/organisms/Combobox/Combobox.stories.ts +234 -0
- package/src/components/organisms/Combobox/Combobox.test.ts +512 -0
- package/src/components/organisms/Combobox/Combobox.vue +1 -1
- package/src/components/organisms/ComboboxPanel/ComboboxPanel.stories.ts +158 -0
- package/src/components/organisms/ComboboxPanel/ComboboxPanel.test.ts +524 -0
- package/src/components/organisms/ComboboxPanel/ComboboxPanel.vue +1 -1
- package/src/components/organisms/CountrySelect/CountrySelect.stories.ts +139 -0
- package/src/components/organisms/CountrySelect/CountrySelect.test.ts +149 -0
- package/src/components/organisms/DatePicker/DatePicker.stories.ts +163 -0
- package/src/components/organisms/DatePicker/DatePicker.test.ts +214 -0
- package/src/components/organisms/DropdownButton/DropdownButton.stories.ts +123 -0
- package/src/components/organisms/DropdownButton/DropdownButton.test.ts +379 -0
- package/src/components/organisms/FontPicker/FontPicker.stories.ts +476 -0
- package/src/components/organisms/FontPicker/FontPicker.test.ts +873 -0
- package/src/components/organisms/Header/Header.stories.ts +75 -0
- package/src/components/organisms/Header/Header.test.ts +233 -0
- package/src/components/organisms/IconPicker/IconPicker.stories.ts +734 -0
- package/src/components/organisms/IconPicker/IconPicker.test.ts +669 -0
- package/src/components/organisms/IconPicker/_IconPickerGrid.test.ts +184 -0
- package/src/components/organisms/IconPicker/_IconPickerRail.test.ts +102 -0
- package/src/components/organisms/IconPicker/useIconPickerNavigation.test.ts +215 -0
- package/src/components/organisms/Modal/Modal.stories.ts +350 -0
- package/src/components/organisms/Modal/Modal.test.ts +275 -0
- package/src/components/organisms/PickerPanel/PickerPanel.stories.ts +452 -0
- package/src/components/organisms/PickerPanel/PickerPanel.test.ts +358 -0
- package/src/components/organisms/ProgressBar/ProgressBar.stories.ts +100 -0
- package/src/components/organisms/ProgressBar/ProgressBar.test.ts +417 -0
- package/src/components/organisms/ReferenceCard/ReferenceCard.stories.ts +191 -0
- package/src/components/organisms/ReferenceCard/ReferenceCard.test.ts +165 -0
- package/src/components/organisms/SocialMediaTemplate/SocialMediaTemplate.stories.ts +65 -0
- package/src/components/organisms/SocialMediaTemplate/SocialMediaTemplate.test.ts +466 -0
- package/src/components/organisms/StepperHeader/StepperHeader.stories.ts +91 -0
- package/src/components/organisms/StepperHeader/StepperHeader.test.ts +279 -0
- package/src/components/organisms/Table/Table.stories.ts +332 -0
- package/src/components/organisms/Table/Table.test.ts +320 -0
- package/src/components/organisms/TimelinePhaseblock/TimelinePhaseblock.stories.ts +198 -0
- package/src/components/organisms/TimelinePhaseblock/TimelinePhaseblock.test.ts +283 -0
- package/src/components/organisms/TimelineTrack/TimelineTrack.stories.ts +120 -0
- package/src/components/organisms/TimelineTrack/TimelineTrack.test.ts +91 -0
- package/src/components/organisms/Toaster/Toaster.stories.ts +51 -0
- package/src/components/organisms/Toaster/Toaster.test.ts +75 -0
- package/src/components/organisms/VideoControls/VideoControls.stories.ts +792 -0
- package/src/components/organisms/VideoControls/VideoControls.test.ts +1056 -0
- package/src/components/organisms/VideoPlayer/VideoPlayer.stories.ts +327 -0
- package/src/components/organisms/VideoPlayer/VideoPlayer.test.ts +439 -0
package/dist/nuxt.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexxtmove/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.8.0",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@floating-ui/vue": "^2.0.1",
|
|
24
24
|
"@number-flow/vue": "^0.5.2",
|
|
25
|
-
"@vueuse/core": "^
|
|
25
|
+
"@vueuse/core": "^15.0.0",
|
|
26
26
|
"date-fns": "^4.4.0",
|
|
27
27
|
"date-fns-tz": "^3.2.0",
|
|
28
|
-
"reka-ui": "^2.
|
|
28
|
+
"reka-ui": "^2.11.0",
|
|
29
29
|
"vite-svg-loader": "^5.1.1"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
@@ -35,46 +35,47 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@awesome.me/kit-37b149f3ef": "^1.0.8",
|
|
37
37
|
"@eslint/js": "^10.0.1",
|
|
38
|
-
"@nuxt/kit": "^4.
|
|
39
|
-
"@nuxt/schema": "^4.
|
|
40
|
-
"@storybook/addon-a11y": "^10.6.
|
|
41
|
-
"@storybook/addon-
|
|
42
|
-
"@storybook/addon-
|
|
43
|
-
"@storybook/
|
|
44
|
-
"@storybook/
|
|
45
|
-
"@storybook/vue3-vite": "^10.6.0",
|
|
38
|
+
"@nuxt/kit": "^4.6.3",
|
|
39
|
+
"@nuxt/schema": "^4.6.3",
|
|
40
|
+
"@storybook/addon-a11y": "^10.6.5",
|
|
41
|
+
"@storybook/addon-docs": "^10.6.5",
|
|
42
|
+
"@storybook/addon-vitest": "^10.6.5",
|
|
43
|
+
"@storybook/builder-vite": "^10.6.5",
|
|
44
|
+
"@storybook/vue3-vite": "^10.6.5",
|
|
46
45
|
"@tailwindcss/vite": "^4.3.3",
|
|
47
|
-
"@types/node": "^26.
|
|
48
|
-
"@types/react": "^19.
|
|
49
|
-
"@types/react-dom": "^19.
|
|
50
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
51
|
-
"@vitest/browser": "^
|
|
52
|
-
"@vitest/browser-playwright": "^
|
|
53
|
-
"@vitest/coverage-v8": "^
|
|
46
|
+
"@types/node": "^26.6.6",
|
|
47
|
+
"@types/react": "^19.3.0",
|
|
48
|
+
"@types/react-dom": "^19.3.0",
|
|
49
|
+
"@vitejs/plugin-vue": "^6.0.10",
|
|
50
|
+
"@vitest/browser": "^5.0.5",
|
|
51
|
+
"@vitest/browser-playwright": "^5.0.5",
|
|
52
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
54
53
|
"@vue/eslint-config-typescript": "^14.9.0",
|
|
55
|
-
"@vue/test-utils": "^2.
|
|
54
|
+
"@vue/test-utils": "^2.5.1",
|
|
56
55
|
"@vue/tsconfig": "^0.9.1",
|
|
57
56
|
"consola": "^3.4.2",
|
|
58
|
-
"eslint": "^10.
|
|
57
|
+
"eslint": "^10.14.0",
|
|
59
58
|
"eslint-config-prettier": "^10.1.8",
|
|
60
|
-
"eslint-plugin-better-tailwindcss": "4.
|
|
61
|
-
"eslint-plugin-prettier": "^5.5.
|
|
62
|
-
"eslint-plugin-storybook": "10.6.
|
|
63
|
-
"eslint-plugin-vue": "^10.
|
|
64
|
-
"flag-icons": "^7.
|
|
65
|
-
"globals": "^17.
|
|
66
|
-
"jsdom": "^
|
|
67
|
-
"playwright": "^1.
|
|
68
|
-
"prettier": "^3.9.
|
|
59
|
+
"eslint-plugin-better-tailwindcss": "4.10.0",
|
|
60
|
+
"eslint-plugin-prettier": "^5.5.7",
|
|
61
|
+
"eslint-plugin-storybook": "10.6.5",
|
|
62
|
+
"eslint-plugin-vue": "^10.12.0",
|
|
63
|
+
"flag-icons": "^7.6.0",
|
|
64
|
+
"globals": "^17.14.0",
|
|
65
|
+
"jsdom": "^30.1.3",
|
|
66
|
+
"playwright": "^1.64.1",
|
|
67
|
+
"prettier": "^3.9.10",
|
|
69
68
|
"prettier-plugin-tailwindcss": "^0.8.1",
|
|
70
|
-
"react": "^19.
|
|
71
|
-
"react-dom": "^19.
|
|
69
|
+
"react": "^19.3.1",
|
|
70
|
+
"react-dom": "^19.3.1",
|
|
72
71
|
"remark-frontmatter": "^5.0.0",
|
|
73
|
-
"storybook": "^10.6.
|
|
74
|
-
"typescript
|
|
75
|
-
"
|
|
76
|
-
"vite
|
|
77
|
-
"
|
|
72
|
+
"storybook": "^10.6.5",
|
|
73
|
+
"typescript": "~6.0.3",
|
|
74
|
+
"typescript-eslint": "^8.72.1",
|
|
75
|
+
"vite": "^8.3.5",
|
|
76
|
+
"vite-plugin-dts": "^5.1.2",
|
|
77
|
+
"vitest": "^5.0.5",
|
|
78
|
+
"vue-tsc": "^3.3.14"
|
|
78
79
|
},
|
|
79
80
|
"engines": {
|
|
80
81
|
"node": ">=22.18.0"
|
|
@@ -87,6 +88,7 @@
|
|
|
87
88
|
"generate:index": "node --experimental-strip-types ./scripts/generate-index.ts",
|
|
88
89
|
"lint": "eslint .",
|
|
89
90
|
"lint:fix": "eslint . --fix",
|
|
91
|
+
"typecheck": "vue-tsc --noEmit",
|
|
90
92
|
"storybook": "storybook dev -p 6006 --no-open",
|
|
91
93
|
"storybook:build": "storybook build"
|
|
92
94
|
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { beforeAll, describe, expect, it } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import type { Component } from 'vue'
|
|
4
|
+
|
|
5
|
+
import Checkbox from './components/atoms/Checkbox/Checkbox.vue'
|
|
6
|
+
import FloatingPanel from './components/atoms/FloatingPanel/FloatingPanel.vue'
|
|
7
|
+
import InputField from './components/molecules/InputField/InputField.vue'
|
|
8
|
+
import InputSelect from './components/molecules/InputSelect/InputSelect.vue'
|
|
9
|
+
import Loader from './components/atoms/Loader/Loader.vue'
|
|
10
|
+
import PageContainer from './components/molecules/PageContainer/PageContainer.vue'
|
|
11
|
+
import SelectableOption from './components/atoms/SelectableOption/SelectableOption.vue'
|
|
12
|
+
import Slider from './components/atoms/Slider/Slider.vue'
|
|
13
|
+
import Switch from './components/atoms/Switch/Switch.vue'
|
|
14
|
+
|
|
15
|
+
// Where a consumer's `class`, `id` and `data-*` land is part of the rendered
|
|
16
|
+
// contract, and moving them is invisible to every other gate in this repo. The
|
|
17
|
+
// props are unchanged, so a prop-diff sees nothing. The existing tests pass,
|
|
18
|
+
// because they assert their own component's markup rather than a consumer's
|
|
19
|
+
// attributes. The build is green. A screenshot is pixel-identical, because the
|
|
20
|
+
// styling did not move -- only the element carrying the attribute did.
|
|
21
|
+
//
|
|
22
|
+
// Adding `inheritAttrs: false` to a component does exactly that. Six components
|
|
23
|
+
// here bind `$attrs` explicitly. Four of them also let Vue apply attributes to
|
|
24
|
+
// the root, so a consumer's attributes currently land in *two* places; adding
|
|
25
|
+
// `inheritAttrs: false` collapses that to one, at every call site at once.
|
|
26
|
+
//
|
|
27
|
+
// This file records where they land today, per element. It is a contract, not a
|
|
28
|
+
// preference: if a change is intentional, update the expectation, say so in the
|
|
29
|
+
// PR, and treat it as a coordinated minor rather than a patch.
|
|
30
|
+
|
|
31
|
+
const PROBE_CLASS = 'attr-probe'
|
|
32
|
+
const PROBE_ID = 'attr-probe-id'
|
|
33
|
+
const PROBE_DATA = 'data-attr-probe'
|
|
34
|
+
|
|
35
|
+
const probeAttrs = {
|
|
36
|
+
class: PROBE_CLASS,
|
|
37
|
+
id: PROBE_ID,
|
|
38
|
+
[PROBE_DATA]: 'yes',
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface ContractCase {
|
|
42
|
+
name: string
|
|
43
|
+
component: Component
|
|
44
|
+
props?: Record<string, unknown>
|
|
45
|
+
/**
|
|
46
|
+
* Tag names of the elements carrying each probe attribute, in document order.
|
|
47
|
+
* Two entries means the attribute is applied twice -- once by Vue's automatic
|
|
48
|
+
* inheritance onto the root, once by an explicit `v-bind="$attrs"`.
|
|
49
|
+
*/
|
|
50
|
+
expected: { class: string[]; id: string[]; data: string[] }
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// `wrapper.findAll` walks the whole rendered tree, so this works for the
|
|
54
|
+
// multi-root components too, where there is no single root to inspect.
|
|
55
|
+
const describePlacement = (testCase: ContractCase) => {
|
|
56
|
+
const wrapper = mount(testCase.component, {
|
|
57
|
+
props: testCase.props,
|
|
58
|
+
attrs: probeAttrs,
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
const tags = (selector: string) =>
|
|
62
|
+
wrapper.findAll(selector).map((el) => el.element.tagName.toLowerCase())
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
class: tags(`.${PROBE_CLASS}`),
|
|
66
|
+
id: tags(`#${PROBE_ID}`),
|
|
67
|
+
data: tags(`[${PROBE_DATA}]`),
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Keep in step with:
|
|
72
|
+
// grep -rln 'v-bind="$attrs"' src/components/*/*.vue
|
|
73
|
+
const CASES: ContractCase[] = [
|
|
74
|
+
// InputField and InputSelect route explicitly: `class` and `style` position
|
|
75
|
+
// the field in the consumer's layout so they go to the wrapper, everything
|
|
76
|
+
// else describes the control so it goes to the input. Nothing lands on both.
|
|
77
|
+
//
|
|
78
|
+
// This expectation was deliberately changed, not re-baselined. It previously
|
|
79
|
+
// read `['div', 'input']` for all three, which recorded a defect: `id` was
|
|
80
|
+
// duplicated across two elements, and a consumer's layout class landed on an
|
|
81
|
+
// input that is already `w-full`. A class describing where the field sits
|
|
82
|
+
// belongs on the wrapper, so the rendered result is unchanged while the
|
|
83
|
+
// duplication is gone.
|
|
84
|
+
{
|
|
85
|
+
name: 'InputField',
|
|
86
|
+
component: InputField,
|
|
87
|
+
expected: { class: ['div'], id: ['input'], data: ['input'] },
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'Checkbox',
|
|
91
|
+
component: Checkbox,
|
|
92
|
+
expected: { class: ['label', 'input'], id: ['label', 'input'], data: ['label', 'input'] },
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'InputSelect',
|
|
96
|
+
component: InputSelect,
|
|
97
|
+
expected: { class: ['div'], id: ['input'], data: ['input'] },
|
|
98
|
+
},
|
|
99
|
+
// Multi-root, so Vue cannot inherit automatically; only the explicit
|
|
100
|
+
// v-bind on the trigger applies.
|
|
101
|
+
{
|
|
102
|
+
name: 'FloatingPanel',
|
|
103
|
+
component: FloatingPanel,
|
|
104
|
+
expected: { class: ['span'], id: ['span'], data: ['span'] },
|
|
105
|
+
},
|
|
106
|
+
// Already set `inheritAttrs: false`, so attributes reach the control only.
|
|
107
|
+
// These two are what the other four would look like after W1c.
|
|
108
|
+
{
|
|
109
|
+
name: 'Switch',
|
|
110
|
+
component: Switch,
|
|
111
|
+
expected: { class: ['input'], id: ['input'], data: ['input'] },
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'Slider',
|
|
115
|
+
component: Slider,
|
|
116
|
+
expected: { class: ['span'], id: ['span'], data: ['span'] },
|
|
117
|
+
},
|
|
118
|
+
// Single-root svg; consumers size it with a class on the root.
|
|
119
|
+
{
|
|
120
|
+
name: 'Loader',
|
|
121
|
+
component: Loader,
|
|
122
|
+
expected: { class: ['svg'], id: ['svg'], data: ['svg'] },
|
|
123
|
+
},
|
|
124
|
+
// Single-root div; the layout flex wrapper carries the consumer's attributes.
|
|
125
|
+
{
|
|
126
|
+
name: 'PageContainer',
|
|
127
|
+
component: PageContainer,
|
|
128
|
+
expected: { class: ['div'], id: ['div'], data: ['div'] },
|
|
129
|
+
},
|
|
130
|
+
// Single-root button; consumers rely on `class` for padding and layout.
|
|
131
|
+
{
|
|
132
|
+
name: 'SelectableOption',
|
|
133
|
+
component: SelectableOption,
|
|
134
|
+
expected: { class: ['button'], id: ['button'], data: ['button'] },
|
|
135
|
+
},
|
|
136
|
+
]
|
|
137
|
+
|
|
138
|
+
describe('attribute contract', () => {
|
|
139
|
+
beforeAll(() => {
|
|
140
|
+
// jsdom ships no ResizeObserver; reka-ui's slider observes its track.
|
|
141
|
+
global.ResizeObserver ??= class {
|
|
142
|
+
observe() {}
|
|
143
|
+
unobserve() {}
|
|
144
|
+
disconnect() {}
|
|
145
|
+
} as unknown as typeof ResizeObserver
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
it.each(CASES)('$name applies class, id and data-* to the same elements as always', (c) => {
|
|
149
|
+
expect(describePlacement(c)).toEqual(c.expected)
|
|
150
|
+
})
|
|
151
|
+
})
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
|
2
|
+
import AnimatedNumber from './AnimatedNumber.vue'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/Atoms/Animated Number',
|
|
6
|
+
component: AnimatedNumber,
|
|
7
|
+
} satisfies Meta<typeof AnimatedNumber>
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof AnimatedNumber>
|
|
10
|
+
|
|
11
|
+
export const Default: Story = {
|
|
12
|
+
args: {
|
|
13
|
+
value: 4,
|
|
14
|
+
},
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const LargeNumber: Story = {
|
|
18
|
+
args: {
|
|
19
|
+
value: 12345,
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const SlowDuration: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
value: 100,
|
|
26
|
+
duration: 2000,
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const WithDelay: Story = {
|
|
31
|
+
args: {
|
|
32
|
+
value: 42,
|
|
33
|
+
duration: 500,
|
|
34
|
+
delay: 1000,
|
|
35
|
+
},
|
|
36
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import AnimatedNumber from './AnimatedNumber.vue'
|
|
4
|
+
|
|
5
|
+
describe('AnimatedNumber', () => {
|
|
6
|
+
it('renders the correct value', () => {
|
|
7
|
+
const wrapper = mount(AnimatedNumber, { props: { value: 123 } })
|
|
8
|
+
expect(wrapper.text()).toContain('123')
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
it('accepts updated value prop without errors', async () => {
|
|
12
|
+
const wrapper = mount(AnimatedNumber, { props: { value: 9 } })
|
|
13
|
+
await expect(wrapper.setProps({ value: 42 })).resolves.not.toThrow()
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
it('accepts duration and delay props without errors', () => {
|
|
17
|
+
expect(() =>
|
|
18
|
+
mount(AnimatedNumber, { props: { value: 10, duration: 800, delay: 200 } }),
|
|
19
|
+
).not.toThrow()
|
|
20
|
+
})
|
|
21
|
+
})
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
|
2
|
+
import Avatar from './Avatar.vue'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/Atoms/Avatar',
|
|
6
|
+
component: Avatar,
|
|
7
|
+
argTypes: {
|
|
8
|
+
size: {
|
|
9
|
+
control: 'select',
|
|
10
|
+
options: ['xs', 'sm', 'md', 'lg', 'xl'],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
} satisfies Meta<typeof Avatar>
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof Avatar>
|
|
16
|
+
|
|
17
|
+
export const ExtraSmall: Story = {
|
|
18
|
+
args: {
|
|
19
|
+
name: 'A',
|
|
20
|
+
size: 'xs',
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const Small: Story = {
|
|
25
|
+
args: {
|
|
26
|
+
name: 'B',
|
|
27
|
+
size: 'sm',
|
|
28
|
+
},
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const Medium: Story = {
|
|
32
|
+
args: {
|
|
33
|
+
name: 'C',
|
|
34
|
+
size: 'md',
|
|
35
|
+
},
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const Large: Story = {
|
|
39
|
+
args: {
|
|
40
|
+
name: 'D',
|
|
41
|
+
size: 'lg',
|
|
42
|
+
},
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const ExtraLarge: Story = {
|
|
46
|
+
args: {
|
|
47
|
+
name: 'E',
|
|
48
|
+
size: 'xl',
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const WithSpecialCharacters: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
name: 'Bastiaansen Van den Bemd Makelaars (test)',
|
|
55
|
+
size: 'md',
|
|
56
|
+
},
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const WithImage: Story = {
|
|
60
|
+
args: {
|
|
61
|
+
name: 'Peter Vink',
|
|
62
|
+
src: 'https://i.pravatar.cc/300',
|
|
63
|
+
size: 'md',
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const WithBrokenImage: Story = {
|
|
68
|
+
args: {
|
|
69
|
+
name: 'Peter Vink',
|
|
70
|
+
src: 'https://example.com/does-not-exist.jpg',
|
|
71
|
+
size: 'md',
|
|
72
|
+
},
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const SquircleWithImage: Story = {
|
|
76
|
+
args: {
|
|
77
|
+
name: 'Peter Vink',
|
|
78
|
+
src: 'https://i.pravatar.cc/300',
|
|
79
|
+
size: 'md',
|
|
80
|
+
squircle: true,
|
|
81
|
+
},
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const SquircleExtraSmall: Story = {
|
|
85
|
+
args: {
|
|
86
|
+
name: 'A',
|
|
87
|
+
size: 'xs',
|
|
88
|
+
squircle: true,
|
|
89
|
+
},
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export const SquircleSmall: Story = {
|
|
93
|
+
args: {
|
|
94
|
+
name: 'B',
|
|
95
|
+
size: 'sm',
|
|
96
|
+
squircle: true,
|
|
97
|
+
},
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export const SquircleMedium: Story = {
|
|
101
|
+
args: {
|
|
102
|
+
name: 'C',
|
|
103
|
+
size: 'md',
|
|
104
|
+
squircle: true,
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const SquircleLarge: Story = {
|
|
109
|
+
args: {
|
|
110
|
+
name: 'D',
|
|
111
|
+
size: 'lg',
|
|
112
|
+
squircle: true,
|
|
113
|
+
},
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const SquircleExtraLarge: Story = {
|
|
117
|
+
args: {
|
|
118
|
+
name: 'E',
|
|
119
|
+
size: 'xl',
|
|
120
|
+
squircle: true,
|
|
121
|
+
},
|
|
122
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import Avatar from './Avatar.vue'
|
|
4
|
+
|
|
5
|
+
describe('Avatar', () => {
|
|
6
|
+
it('generates 2 character initials from name with multiple words', () => {
|
|
7
|
+
const wrapper = mount(Avatar, {
|
|
8
|
+
props: {
|
|
9
|
+
name: 'Peter Vink',
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
expect(wrapper.text()).toContain('PV')
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
it('generates 2 character initials from name with single word', () => {
|
|
17
|
+
const wrapper = mount(Avatar, {
|
|
18
|
+
props: {
|
|
19
|
+
name: 'Peter',
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
expect(wrapper.text()).toContain('PE')
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
it('generates 2 character initials picking first and last words for names with tussenvoegsels', () => {
|
|
27
|
+
const wrapper = mount(Avatar, {
|
|
28
|
+
props: {
|
|
29
|
+
name: 'Peter van der Sloot',
|
|
30
|
+
},
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
expect(wrapper.text()).toContain('PS')
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it('handles empty strings gracefully by returning no text', () => {
|
|
37
|
+
const wrapper = mount(Avatar, {
|
|
38
|
+
props: {
|
|
39
|
+
name: '',
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
expect(wrapper.text()).toBe('')
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it('handles whitespace-only strings gracefully by returning no text', () => {
|
|
47
|
+
const wrapper = mount(Avatar, {
|
|
48
|
+
props: {
|
|
49
|
+
name: ' ',
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
expect(wrapper.text()).toBe('')
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it('ignores special characters when generating initials', () => {
|
|
57
|
+
const wrapper = mount(Avatar, {
|
|
58
|
+
props: {
|
|
59
|
+
name: 'Bastiaansen Van den Bemd Makelaars (test)',
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
// "Bastiaansen Van den Bemd Makelaars test" -> B and T
|
|
64
|
+
expect(wrapper.text()).toContain('BT')
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
it('renders as a div with rounded-full by default', () => {
|
|
68
|
+
const wrapper = mount(Avatar, {
|
|
69
|
+
props: { name: 'Peter Vink' },
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
expect(wrapper.element.tagName).toBe('DIV')
|
|
73
|
+
expect(wrapper.classes()).toContain('rounded-full')
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
it('renders as a NexxtSquircle when squircle prop is true', () => {
|
|
77
|
+
const wrapper = mount(Avatar, {
|
|
78
|
+
props: { name: 'Peter Vink', squircle: true },
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
expect(wrapper.findComponent({ name: 'NexxtSquircle' }).exists()).toBe(true)
|
|
82
|
+
expect(wrapper.classes()).not.toContain('rounded-full')
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
it('renders the image instead of the initials when src is given', () => {
|
|
86
|
+
const wrapper = mount(Avatar, {
|
|
87
|
+
props: { name: 'Peter Vink', src: 'https://example.com/peter.jpg' },
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
const image = wrapper.find('img')
|
|
91
|
+
expect(image.exists()).toBe(true)
|
|
92
|
+
expect(image.attributes('src')).toBe('https://example.com/peter.jpg')
|
|
93
|
+
expect(wrapper.text()).toBe('')
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
it('uses the name as the image alt text', () => {
|
|
97
|
+
const wrapper = mount(Avatar, {
|
|
98
|
+
props: { name: 'Peter Vink', src: 'https://example.com/peter.jpg' },
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
expect(wrapper.find('img').attributes('alt')).toBe('Peter Vink')
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
it('renders the image inside the squircle', () => {
|
|
105
|
+
const wrapper = mount(Avatar, {
|
|
106
|
+
props: { name: 'Peter Vink', src: 'https://example.com/peter.jpg', squircle: true },
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
expect(wrapper.findComponent({ name: 'NexxtSquircle' }).exists()).toBe(true)
|
|
110
|
+
expect(wrapper.find('img').exists()).toBe(true)
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
it('falls back to the initials when the image fails to load', async () => {
|
|
114
|
+
const wrapper = mount(Avatar, {
|
|
115
|
+
props: { name: 'Peter Vink', src: 'https://example.com/broken.jpg' },
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
await wrapper.find('img').trigger('error')
|
|
119
|
+
|
|
120
|
+
expect(wrapper.find('img').exists()).toBe(false)
|
|
121
|
+
expect(wrapper.text()).toContain('PV')
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
it('retries the image when src changes after a failure', async () => {
|
|
125
|
+
const wrapper = mount(Avatar, {
|
|
126
|
+
props: { name: 'Peter Vink', src: 'https://example.com/broken.jpg' },
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
await wrapper.find('img').trigger('error')
|
|
130
|
+
await wrapper.setProps({ src: 'https://example.com/peter.jpg' })
|
|
131
|
+
|
|
132
|
+
expect(wrapper.find('img').exists()).toBe(true)
|
|
133
|
+
})
|
|
134
|
+
})
|