@nexxtmove/ui 2.5.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.
- package/dist/components/editor/molecules/EditorBorder/EditorBorder.vue.d.ts +12 -0
- package/dist/components/editor/molecules/EditorColor/_ThemeRoleSwatches.vue.d.ts +16 -0
- package/dist/index.js +1094 -1135
- 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/EditorBorder/EditorBorder.vue +58 -2
- package/src/components/editor/molecules/EditorColor/EditorColor.stories.ts +563 -0
- package/src/components/editor/molecules/EditorColor/EditorColor.test.ts +689 -0
- package/src/components/editor/molecules/EditorColor/EditorColorGradient.test.ts +793 -0
- package/src/components/editor/molecules/EditorColor/_ColorField.vue +7 -29
- package/src/components/editor/molecules/EditorColor/_ThemeRoleSwatches.vue +57 -0
- 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 +638 -0
- 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
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import CustomerJourneyTile from './CustomerJourneyTile.vue'
|
|
4
|
+
|
|
5
|
+
const stubs = {
|
|
6
|
+
NexxtIcon: { template: '<span :data-name="name" />', props: ['name'] },
|
|
7
|
+
NexxtAnimatedNumber: {
|
|
8
|
+
name: 'NexxtAnimatedNumber',
|
|
9
|
+
template: '{{ value }}',
|
|
10
|
+
props: ['value', 'delay'],
|
|
11
|
+
},
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const mountTile = (props = {}) =>
|
|
15
|
+
mount(CustomerJourneyTile, {
|
|
16
|
+
props: { ...props },
|
|
17
|
+
global: { stubs },
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
describe('CustomerJourneyTile', () => {
|
|
21
|
+
describe('rendering', () => {
|
|
22
|
+
it('renders a div element by default', () => {
|
|
23
|
+
const wrapper = mountTile({ title: 'Latent' })
|
|
24
|
+
expect(wrapper.element.tagName).toBe('DIV')
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
it('renders as a button when as="button"', () => {
|
|
28
|
+
const wrapper = mountTile({ as: 'button', title: 'Latent' })
|
|
29
|
+
expect(wrapper.element.tagName).toBe('BUTTON')
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
it('renders the title label', () => {
|
|
33
|
+
const wrapper = mountTile({ title: 'Wonen' })
|
|
34
|
+
expect(wrapper.text()).toContain('Wonen')
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it('does not render title label when title is omitted', () => {
|
|
38
|
+
const wrapper = mountTile({ amount: 100 })
|
|
39
|
+
expect(wrapper.find('span:not(.heading-1)').exists()).toBe(false)
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
it('does not render the icon div when title is omitted', () => {
|
|
43
|
+
const wrapper = mountTile({ amount: 100 })
|
|
44
|
+
expect(wrapper.find('.bg-purple-100').exists()).toBe(false)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
it('does not render the icon div when title does not match a phase', () => {
|
|
48
|
+
const wrapper = mountTile({ title: 'Custom Title' })
|
|
49
|
+
expect(wrapper.find('.bg-purple-100').exists()).toBe(false)
|
|
50
|
+
expect(wrapper.text()).toContain('Custom Title')
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
it('renders the correct icon for each phase-matching title', () => {
|
|
54
|
+
const cases: Array<[string, string]> = [
|
|
55
|
+
['Latent', 'eye-closed'],
|
|
56
|
+
['Oriëntatie', 'building-magnifying-glass'],
|
|
57
|
+
['Actief zoeken', 'house-person-return'],
|
|
58
|
+
['Selectie', 'handshake'],
|
|
59
|
+
['Transactie', 'pencil-mechanical'],
|
|
60
|
+
['Wonen', 'house-heart'],
|
|
61
|
+
]
|
|
62
|
+
for (const [title, expectedIcon] of cases) {
|
|
63
|
+
const wrapper = mountTile({ title })
|
|
64
|
+
expect(wrapper.find(`[data-name="${expectedIcon}"]`).exists()).toBe(true)
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
it('marks the icon as aria-hidden', () => {
|
|
69
|
+
const wrapper = mountTile({ title: 'Latent' })
|
|
70
|
+
expect(wrapper.find('[aria-hidden="true"]').exists()).toBe(true)
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
describe('accessibility', () => {
|
|
75
|
+
it('has an aria-label with the title', () => {
|
|
76
|
+
const wrapper = mountTile({ title: 'Wonen' })
|
|
77
|
+
expect(wrapper.attributes('aria-label')).toBe('Wonen')
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
it('includes amount in the aria-label', () => {
|
|
81
|
+
const wrapper = mountTile({ title: 'Latent', amount: 270 })
|
|
82
|
+
expect(wrapper.attributes('aria-label')).toBe('Latent, 270 contacten')
|
|
83
|
+
})
|
|
84
|
+
|
|
85
|
+
it('includes positive percentage in the aria-label', () => {
|
|
86
|
+
const wrapper = mountTile({
|
|
87
|
+
title: 'Latent',
|
|
88
|
+
percentage: 14,
|
|
89
|
+
percentageExplanaition: 'vorige maand',
|
|
90
|
+
})
|
|
91
|
+
expect(wrapper.attributes('aria-label')).toBe('Latent, +14% vorige maand')
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
it('includes negative percentage in the aria-label', () => {
|
|
95
|
+
const wrapper = mountTile({ title: 'Latent', percentage: -8 })
|
|
96
|
+
expect(wrapper.attributes('aria-label')).toBe('Latent, -8%')
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
it('has a visible focus ring via focus-visible classes', () => {
|
|
100
|
+
const wrapper = mountTile({ title: 'Latent' })
|
|
101
|
+
expect(wrapper.classes()).toContain('focus-visible:outline-2')
|
|
102
|
+
expect(wrapper.classes()).toContain('focus-visible:outline-offset-2')
|
|
103
|
+
expect(wrapper.classes()).toContain('focus-visible:outline-cornflower-blue-500')
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
it('applies standard padding when no icon is present', () => {
|
|
107
|
+
const wrapper = mountTile({ amount: 100 })
|
|
108
|
+
expect(wrapper.classes()).toContain('p-4')
|
|
109
|
+
expect(wrapper.classes()).not.toContain('gap-6')
|
|
110
|
+
expect(wrapper.classes()).not.toContain('p-1.5')
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
it('applies layout gap and small padding when icon is present', () => {
|
|
114
|
+
const wrapper = mountTile({ title: 'Latent', amount: 100 })
|
|
115
|
+
expect(wrapper.classes()).toContain('gap-6')
|
|
116
|
+
expect(wrapper.classes()).toContain('p-1.5')
|
|
117
|
+
expect(wrapper.classes()).not.toContain('p-4')
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
describe('amount', () => {
|
|
122
|
+
it('renders the amount when provided', () => {
|
|
123
|
+
const wrapper = mountTile({ title: 'Latent', amount: 270 })
|
|
124
|
+
expect(wrapper.text()).toContain('270')
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
it('renders amount 0 when provided', () => {
|
|
128
|
+
const wrapper = mountTile({ amount: 0 })
|
|
129
|
+
expect(wrapper.find('.heading-1').exists()).toBe(true)
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
it('renders the amount with purple color when a phase-matching title is provided', () => {
|
|
133
|
+
const wrapper = mountTile({ title: 'Latent', amount: 270 })
|
|
134
|
+
expect(wrapper.find('.heading-1').classes()).toContain('text-purple-500')
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
it('renders the amount with standard text color when title is not a known phase', () => {
|
|
138
|
+
const wrapper = mountTile({ title: 'Custom Title', amount: 270 })
|
|
139
|
+
expect(wrapper.find('.heading-1').classes()).toContain('text-sapphire-900')
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
it('renders the amount with standard text color when title is omitted', () => {
|
|
143
|
+
const wrapper = mountTile({ amount: 270 })
|
|
144
|
+
expect(wrapper.find('.heading-1').classes()).toContain('text-sapphire-900')
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
it('does not render an amount element when omitted', () => {
|
|
148
|
+
const wrapper = mountTile({ title: 'Latent' })
|
|
149
|
+
expect(wrapper.find('.heading-1').exists()).toBe(false)
|
|
150
|
+
})
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
describe('percentage', () => {
|
|
154
|
+
it('renders a positive percentage with a + prefix', () => {
|
|
155
|
+
const wrapper = mountTile({ percentage: 14 })
|
|
156
|
+
expect(wrapper.text()).toContain('+14%')
|
|
157
|
+
})
|
|
158
|
+
|
|
159
|
+
it('renders a negative percentage without a + prefix', () => {
|
|
160
|
+
const wrapper = mountTile({ percentage: -8 })
|
|
161
|
+
expect(wrapper.text()).toContain('-8%')
|
|
162
|
+
expect(wrapper.text()).not.toContain('+-8%')
|
|
163
|
+
})
|
|
164
|
+
|
|
165
|
+
it('renders zero percentage', () => {
|
|
166
|
+
const wrapper = mountTile({ percentage: 0 })
|
|
167
|
+
expect(wrapper.text()).toContain('0%')
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
it('applies green color class for a positive percentage', () => {
|
|
171
|
+
const wrapper = mountTile({ percentage: 14 })
|
|
172
|
+
expect(wrapper.find('.text-green-500').exists()).toBe(true)
|
|
173
|
+
})
|
|
174
|
+
|
|
175
|
+
it('applies red color class for a negative percentage', () => {
|
|
176
|
+
const wrapper = mountTile({ percentage: -8 })
|
|
177
|
+
expect(wrapper.find('.text-brick-500').exists()).toBe(true)
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
it('applies orange color class for zero percentage', () => {
|
|
181
|
+
const wrapper = mountTile({ percentage: 0 })
|
|
182
|
+
expect(wrapper.find('.text-orange-500').exists()).toBe(true)
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
it('does not render the percentage block when omitted', () => {
|
|
186
|
+
const wrapper = mountTile()
|
|
187
|
+
expect(wrapper.find('.text-green-500').exists()).toBe(false)
|
|
188
|
+
expect(wrapper.find('.text-brick-500').exists()).toBe(false)
|
|
189
|
+
expect(wrapper.find('.text-orange-500').exists()).toBe(false)
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
it('applies red color class for a positive percentage when invertPercentageColor is true', () => {
|
|
193
|
+
const wrapper = mountTile({ percentage: 14, invertPercentageColor: true })
|
|
194
|
+
expect(wrapper.find('.text-brick-500').exists()).toBe(true)
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
it('applies green color class for a negative percentage when invertPercentageColor is true', () => {
|
|
198
|
+
const wrapper = mountTile({ percentage: -8, invertPercentageColor: true })
|
|
199
|
+
expect(wrapper.find('.text-green-500').exists()).toBe(true)
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
it('applies orange color class for zero percentage when invertPercentageColor is true', () => {
|
|
203
|
+
const wrapper = mountTile({ percentage: 0, invertPercentageColor: true })
|
|
204
|
+
expect(wrapper.find('.text-orange-500').exists()).toBe(true)
|
|
205
|
+
})
|
|
206
|
+
})
|
|
207
|
+
|
|
208
|
+
describe('variant', () => {
|
|
209
|
+
it('applies information outline by default', () => {
|
|
210
|
+
const wrapper = mountTile({ title: 'Latent' })
|
|
211
|
+
expect(wrapper.classes()).toContain('outline-gray-200')
|
|
212
|
+
})
|
|
213
|
+
|
|
214
|
+
it('applies display outline when variant is display', () => {
|
|
215
|
+
const wrapper = mountTile({ title: 'Latent', variant: 'display' })
|
|
216
|
+
expect(wrapper.classes()).toContain('outline-purple-50')
|
|
217
|
+
})
|
|
218
|
+
|
|
219
|
+
it('applies selected display outline when variant is display and selected is true', () => {
|
|
220
|
+
const wrapper = mountTile({ title: 'Latent', variant: 'display', selected: true })
|
|
221
|
+
expect(wrapper.classes()).toContain('outline-purple-500')
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
it('applies information icon colors by default', () => {
|
|
225
|
+
const wrapper = mountTile({ title: 'Latent' })
|
|
226
|
+
const iconDiv = wrapper.find('.bg-purple-100')
|
|
227
|
+
expect(iconDiv.exists()).toBe(true)
|
|
228
|
+
expect(iconDiv.classes()).toContain('text-purple-500')
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
it('applies display icon colors when variant is display', () => {
|
|
232
|
+
const wrapper = mountTile({ title: 'Latent', variant: 'display' })
|
|
233
|
+
const iconDiv = wrapper.find('.bg-purple-50')
|
|
234
|
+
expect(iconDiv.exists()).toBe(true)
|
|
235
|
+
expect(iconDiv.classes()).toContain('text-purple-100')
|
|
236
|
+
})
|
|
237
|
+
|
|
238
|
+
it('applies selected display icon colors when variant is display and selected is true', () => {
|
|
239
|
+
const wrapper = mountTile({ title: 'Latent', variant: 'display', selected: true })
|
|
240
|
+
const iconDiv = wrapper.find('.bg-purple-500')
|
|
241
|
+
expect(iconDiv.exists()).toBe(true)
|
|
242
|
+
expect(iconDiv.classes()).toContain('text-white')
|
|
243
|
+
})
|
|
244
|
+
})
|
|
245
|
+
|
|
246
|
+
describe('delay', () => {
|
|
247
|
+
it('passes delay to NexxtAnimatedNumber when provided', () => {
|
|
248
|
+
const wrapper = mountTile({ amount: 100, animated: true, delay: 300 })
|
|
249
|
+
const animatedNumber = wrapper.findComponent({ name: 'NexxtAnimatedNumber' })
|
|
250
|
+
expect(animatedNumber.props('delay')).toBe(300)
|
|
251
|
+
})
|
|
252
|
+
|
|
253
|
+
it('passes no delay to NexxtAnimatedNumber when omitted', () => {
|
|
254
|
+
const wrapper = mountTile({ amount: 100 })
|
|
255
|
+
const animatedNumber = wrapper.findComponent({ name: 'NexxtAnimatedNumber' })
|
|
256
|
+
expect(animatedNumber.props('delay')).toBeUndefined()
|
|
257
|
+
})
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
describe('percentageExplanaition', () => {
|
|
261
|
+
it('renders the explanation when provided alongside percentage', () => {
|
|
262
|
+
const wrapper = mountTile({ percentage: 14, percentageExplanaition: 'vorige maand' })
|
|
263
|
+
expect(wrapper.text()).toContain('vorige maand')
|
|
264
|
+
})
|
|
265
|
+
|
|
266
|
+
it('does not render the explanation when omitted', () => {
|
|
267
|
+
const wrapper = mountTile({ percentage: 14 })
|
|
268
|
+
expect(wrapper.text()).not.toContain('vorige maand')
|
|
269
|
+
})
|
|
270
|
+
})
|
|
271
|
+
})
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
|
2
|
+
import DoughnutChart from './DoughnutChart.vue'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/Molecules/Doughnut Chart',
|
|
6
|
+
component: DoughnutChart,
|
|
7
|
+
} satisfies Meta<typeof DoughnutChart>
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof DoughnutChart>
|
|
10
|
+
|
|
11
|
+
export const Default: Story = {
|
|
12
|
+
args: {
|
|
13
|
+
value: 142,
|
|
14
|
+
percentage: 75,
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const WithDelay: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
value: 142,
|
|
21
|
+
percentage: 75,
|
|
22
|
+
color: '#6366f1',
|
|
23
|
+
delay: 1000,
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const Large: Story = {
|
|
28
|
+
args: {
|
|
29
|
+
value: 89,
|
|
30
|
+
percentage: 60,
|
|
31
|
+
color: '#22c55e',
|
|
32
|
+
size: 240,
|
|
33
|
+
thickness: 28,
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const Small: Story = {
|
|
38
|
+
args: {
|
|
39
|
+
value: 31,
|
|
40
|
+
percentage: 40,
|
|
41
|
+
color: '#f59e0b',
|
|
42
|
+
size: 96,
|
|
43
|
+
thickness: 12,
|
|
44
|
+
},
|
|
45
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import DoughnutChart from './DoughnutChart.vue'
|
|
4
|
+
|
|
5
|
+
describe('DoughnutChart', () => {
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
vi.useFakeTimers()
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
afterEach(() => {
|
|
11
|
+
vi.useRealTimers()
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
it('renders an SVG with the correct size', () => {
|
|
15
|
+
const wrapper = mount(DoughnutChart, {
|
|
16
|
+
props: { value: 80, percentage: 75 },
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
const svg = wrapper.find('svg')
|
|
20
|
+
expect(svg.attributes('width')).toBe('160')
|
|
21
|
+
expect(svg.attributes('height')).toBe('160')
|
|
22
|
+
expect(svg.attributes('viewBox')).toBe('0 0 160 160')
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
it('respects custom size and thickness props', () => {
|
|
26
|
+
const wrapper = mount(DoughnutChart, {
|
|
27
|
+
props: { value: 50, percentage: 50, size: 240, thickness: 28 },
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const svg = wrapper.find('svg')
|
|
31
|
+
expect(svg.attributes('width')).toBe('240')
|
|
32
|
+
expect(svg.attributes('height')).toBe('240')
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('sets aria-label to the value prop', () => {
|
|
36
|
+
const wrapper = mount(DoughnutChart, {
|
|
37
|
+
props: { value: 142, percentage: 75 },
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
expect(wrapper.find('svg').attributes('aria-label')).toBe('142')
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
it('renders the value in the default slot', () => {
|
|
44
|
+
const wrapper = mount(DoughnutChart, {
|
|
45
|
+
props: { value: 142, percentage: 75 },
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
expect(wrapper.text()).toContain('142')
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it('renders custom slot content instead of the default value', () => {
|
|
52
|
+
const wrapper = mount(DoughnutChart, {
|
|
53
|
+
props: { value: 142, percentage: 75 },
|
|
54
|
+
slots: { default: '<span>custom label</span>' },
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
expect(wrapper.text()).toContain('custom label')
|
|
58
|
+
expect(wrapper.text()).not.toContain('142')
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
it('resolves a Tailwind color token to a CSS variable', () => {
|
|
62
|
+
const wrapper = mount(DoughnutChart, {
|
|
63
|
+
props: { value: 50, percentage: 50, color: 'purple-500' },
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
const arc = wrapper.findAll('circle')[0]
|
|
67
|
+
expect(arc!.attributes('stroke')).toBe('var(--color-purple-500)')
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
it('passes a hex color through as-is', () => {
|
|
71
|
+
const wrapper = mount(DoughnutChart, {
|
|
72
|
+
props: { value: 50, percentage: 50, color: '#ff0000' },
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const arc = wrapper.findAll('circle')[0]
|
|
76
|
+
expect(arc!.attributes('stroke')).toBe('#ff0000')
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
it('passes a CSS named color through as-is', () => {
|
|
80
|
+
const wrapper = mount(DoughnutChart, {
|
|
81
|
+
props: { value: 50, percentage: 50, color: 'transparent' },
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
const arc = wrapper.findAll('circle')[0]
|
|
85
|
+
expect(arc!.attributes('stroke')).toBe('transparent')
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
it('passes an rgb color through as-is', () => {
|
|
89
|
+
const wrapper = mount(DoughnutChart, {
|
|
90
|
+
props: { value: 50, percentage: 50, color: 'rgb(255, 0, 0)' },
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
const arc = wrapper.findAll('circle')[0]
|
|
94
|
+
expect(arc!.attributes('stroke')).toBe('rgb(255, 0, 0)')
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
it('does not render the background circle when backgroundColor is not set', () => {
|
|
98
|
+
const wrapper = mount(DoughnutChart, {
|
|
99
|
+
props: { value: 50, percentage: 50 },
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
expect(wrapper.findAll('circle')).toHaveLength(1)
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
it('renders the background circle when backgroundColor is set', () => {
|
|
106
|
+
const wrapper = mount(DoughnutChart, {
|
|
107
|
+
props: { value: 50, percentage: 50, backgroundColor: 'gray-100' },
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
const circles = wrapper.findAll('circle')
|
|
111
|
+
expect(circles).toHaveLength(2)
|
|
112
|
+
expect(circles[0]!.attributes('stroke')).toBe('var(--color-gray-100)')
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
it('starts with a zero arc before mounting', () => {
|
|
116
|
+
const wrapper = mount(DoughnutChart, {
|
|
117
|
+
props: { value: 50, percentage: 50 },
|
|
118
|
+
attachTo: document.body,
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
// Before timers run the dasharray should start at "0 circumference"
|
|
122
|
+
const arc = wrapper.findAll('circle')[0]
|
|
123
|
+
expect(arc!.attributes('stroke-dasharray')).toMatch(/^0 /)
|
|
124
|
+
|
|
125
|
+
wrapper.unmount()
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
it('animates to the correct arc after mount', async () => {
|
|
129
|
+
const wrapper = mount(DoughnutChart, {
|
|
130
|
+
props: { value: 50, percentage: 50 },
|
|
131
|
+
attachTo: document.body,
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
await vi.runAllTimersAsync()
|
|
135
|
+
|
|
136
|
+
const arc = wrapper.findAll('circle')[0]
|
|
137
|
+
const dasharray = arc!.attributes('stroke-dasharray') ?? ''
|
|
138
|
+
const [drawn] = dasharray.split(' ').map(Number)
|
|
139
|
+
// 50% of circumference for radius (160-20)/2 = 70 → C = 2π*70 ≈ 439.82 → half ≈ 219.91
|
|
140
|
+
expect(drawn).toBeCloseTo(Math.PI * 70, 0)
|
|
141
|
+
|
|
142
|
+
wrapper.unmount()
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
it('respects the delay prop before animating', async () => {
|
|
146
|
+
const wrapper = mount(DoughnutChart, {
|
|
147
|
+
props: { value: 50, percentage: 50, delay: 1000 },
|
|
148
|
+
attachTo: document.body,
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
// Before delay the arc should still be 0
|
|
152
|
+
await vi.advanceTimersByTimeAsync(500)
|
|
153
|
+
const arcBefore = wrapper.findAll('circle')[0]
|
|
154
|
+
expect(arcBefore!.attributes('stroke-dasharray')).toMatch(/^0 /)
|
|
155
|
+
|
|
156
|
+
// After delay the arc should be filled
|
|
157
|
+
await vi.advanceTimersByTimeAsync(500)
|
|
158
|
+
const arcAfter = wrapper.findAll('circle')[0]
|
|
159
|
+
expect(arcAfter!.attributes('stroke-dasharray')).not.toMatch(/^0 /)
|
|
160
|
+
|
|
161
|
+
wrapper.unmount()
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
it('clamps percentage below 0 to 0', async () => {
|
|
165
|
+
const wrapper = mount(DoughnutChart, {
|
|
166
|
+
props: { value: 0, percentage: -20 },
|
|
167
|
+
attachTo: document.body,
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
await vi.runAllTimersAsync()
|
|
171
|
+
|
|
172
|
+
const arc = wrapper.findAll('circle')[0]
|
|
173
|
+
const [drawn] = (arc!.attributes('stroke-dasharray') ?? '').split(' ').map(Number)
|
|
174
|
+
expect(drawn).toBe(0)
|
|
175
|
+
|
|
176
|
+
wrapper.unmount()
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
it('clamps percentage above 100 to full circumference', async () => {
|
|
180
|
+
const wrapper = mount(DoughnutChart, {
|
|
181
|
+
props: { value: 100, percentage: 150 },
|
|
182
|
+
attachTo: document.body,
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
await vi.runAllTimersAsync()
|
|
186
|
+
|
|
187
|
+
const radius = (160 - 20) / 2
|
|
188
|
+
const circumference = 2 * Math.PI * radius
|
|
189
|
+
|
|
190
|
+
const arc = wrapper.findAll('circle')[0]
|
|
191
|
+
const [drawn] = (arc!.attributes('stroke-dasharray') ?? '').split(' ').map(Number)
|
|
192
|
+
expect(drawn).toBeCloseTo(circumference, 0)
|
|
193
|
+
|
|
194
|
+
wrapper.unmount()
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
it("applies the correct transform for 12 o'clock counter-clockwise direction", () => {
|
|
198
|
+
const wrapper = mount(DoughnutChart, {
|
|
199
|
+
props: { value: 50, percentage: 50 },
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
const g = wrapper.find('g')
|
|
203
|
+
expect(g.attributes('transform')).toBe('scale(-1, 1) translate(-160, 0) rotate(-90, 80, 80)')
|
|
204
|
+
})
|
|
205
|
+
})
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
|
2
|
+
import InfoBlock from './InfoBlock.vue'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/Molecules/Info Block',
|
|
6
|
+
component: InfoBlock,
|
|
7
|
+
} satisfies Meta<typeof InfoBlock>
|
|
8
|
+
|
|
9
|
+
type Story = StoryObj<typeof InfoBlock>
|
|
10
|
+
|
|
11
|
+
const TEMPLATE =
|
|
12
|
+
'<span class="heading-4 text-yale-blue-500 inline">Tip!</span> <span class="body-medium text-gray-700">Koopwoningen doen het goed als post of reel</span>'
|
|
13
|
+
|
|
14
|
+
export const Green: Story = {
|
|
15
|
+
args: {
|
|
16
|
+
icon: 'bell',
|
|
17
|
+
color: 'green',
|
|
18
|
+
},
|
|
19
|
+
render: (args) => ({
|
|
20
|
+
components: { InfoBlock },
|
|
21
|
+
setup() {
|
|
22
|
+
return { args }
|
|
23
|
+
},
|
|
24
|
+
template: `
|
|
25
|
+
<InfoBlock v-bind="args">
|
|
26
|
+
${TEMPLATE}
|
|
27
|
+
</InfoBlock>
|
|
28
|
+
`,
|
|
29
|
+
}),
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const Purple: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
icon: 'circle-video',
|
|
35
|
+
color: 'purple',
|
|
36
|
+
},
|
|
37
|
+
render: (args) => ({
|
|
38
|
+
components: { InfoBlock },
|
|
39
|
+
setup() {
|
|
40
|
+
return { args }
|
|
41
|
+
},
|
|
42
|
+
template: `
|
|
43
|
+
<InfoBlock v-bind="args">
|
|
44
|
+
${TEMPLATE}
|
|
45
|
+
</InfoBlock>
|
|
46
|
+
`,
|
|
47
|
+
}),
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const Blue: Story = {
|
|
51
|
+
args: {
|
|
52
|
+
icon: 'info',
|
|
53
|
+
color: 'blue',
|
|
54
|
+
},
|
|
55
|
+
render: (args) => ({
|
|
56
|
+
components: { InfoBlock },
|
|
57
|
+
setup() {
|
|
58
|
+
return { args }
|
|
59
|
+
},
|
|
60
|
+
template: `
|
|
61
|
+
<InfoBlock v-bind="args">
|
|
62
|
+
${TEMPLATE}
|
|
63
|
+
</InfoBlock>
|
|
64
|
+
`,
|
|
65
|
+
}),
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const Rose: Story = {
|
|
69
|
+
args: {
|
|
70
|
+
icon: 'info',
|
|
71
|
+
color: 'rose',
|
|
72
|
+
},
|
|
73
|
+
render: (args) => ({
|
|
74
|
+
components: { InfoBlock },
|
|
75
|
+
setup() {
|
|
76
|
+
return { args }
|
|
77
|
+
},
|
|
78
|
+
template: `
|
|
79
|
+
<InfoBlock v-bind="args">
|
|
80
|
+
${TEMPLATE}
|
|
81
|
+
</InfoBlock>
|
|
82
|
+
`,
|
|
83
|
+
}),
|
|
84
|
+
}
|