@volverjs/ui-vue 0.0.10-beta.2 → 0.0.10-beta.20
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/LICENSE +1 -1
- package/README.md +98 -3
- package/auto-imports.d.ts +6 -2
- package/bin/icons.cjs +1 -1
- package/bin/icons.js +23 -16
- package/dist/Volver.d.ts +1 -1
- package/dist/components/VvAccordion/VvAccordion.es.js +67 -13
- package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
- package/dist/components/VvAccordion/VvAccordion.vue.d.ts +13 -6
- package/dist/components/VvAccordion/index.d.ts +4 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +111 -37
- package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
- package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -8
- package/dist/components/VvAccordionGroup/index.d.ts +4 -1
- package/dist/components/VvAction/VvAction.es.js +56 -12
- package/dist/components/VvAction/VvAction.umd.js +1 -1
- package/dist/components/VvAction/VvAction.vue.d.ts +59 -12
- package/dist/components/VvAction/index.d.ts +25 -4
- package/dist/components/VvAlert/VvAlert.es.js +188 -152
- package/dist/components/VvAlert/VvAlert.umd.js +1 -1
- package/dist/components/VvAlert/VvAlert.vue.d.ts +18 -8
- package/dist/components/VvAlert/index.d.ts +9 -5
- package/dist/components/VvAlertGroup/VvAlertGroup.es.js +230 -174
- package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
- package/dist/components/VvAlertGroup/VvAlertGroup.vue.d.ts +13 -6
- package/dist/components/VvAlertGroup/index.d.ts +6 -2
- package/dist/components/VvAvatar/VvAvatar.es.js +54 -9
- package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
- package/dist/components/VvAvatar/VvAvatar.vue.d.ts +12 -4
- package/dist/components/VvAvatar/index.d.ts +4 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +111 -36
- package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
- package/dist/components/VvAvatarGroup/VvAvatarGroup.vue.d.ts +10 -3
- package/dist/components/VvAvatarGroup/index.d.ts +4 -1
- package/dist/components/VvBadge/VvBadge.es.js +71 -16
- package/dist/components/VvBadge/VvBadge.umd.js +1 -1
- package/dist/components/VvBadge/VvBadge.vue.d.ts +12 -4
- package/dist/components/VvBadge/index.d.ts +4 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +257 -49
- package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
- package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +27 -7
- package/dist/components/VvBreadcrumb/index.d.ts +6 -10
- package/dist/components/VvButton/VvButton.es.js +165 -137
- package/dist/components/VvButton/VvButton.umd.js +1 -1
- package/dist/components/VvButton/VvButton.vue.d.ts +101 -27
- package/dist/components/VvButton/index.d.ts +41 -14
- package/dist/components/VvButtonGroup/VvButtonGroup.es.js +67 -15
- package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
- package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +23 -10
- package/dist/components/VvButtonGroup/index.d.ts +8 -2
- package/dist/components/VvCard/VvCard.es.js +79 -24
- package/dist/components/VvCard/VvCard.umd.js +1 -1
- package/dist/components/VvCard/VvCard.vue.d.ts +12 -4
- package/dist/components/VvCard/index.d.ts +4 -1
- package/dist/components/VvCheckbox/VvCheckbox.es.js +89 -21
- package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
- package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +104 -32
- package/dist/components/VvCheckbox/index.d.ts +45 -12
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +168 -66
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
- package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +100 -29
- package/dist/components/VvCheckboxGroup/index.d.ts +45 -12
- package/dist/components/VvCombobox/VvCombobox.es.js +721 -527
- package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
- package/dist/components/VvCombobox/VvCombobox.vue.d.ts +145 -72
- package/dist/components/VvCombobox/index.d.ts +53 -22
- package/dist/components/VvDialog/VvDialog.es.js +133 -141
- package/dist/components/VvDialog/VvDialog.umd.js +1 -1
- package/dist/components/VvDialog/VvDialog.vue.d.ts +4 -4
- package/dist/components/VvDropdown/VvDropdown.es.js +121 -55
- package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
- package/dist/components/VvDropdown/VvDropdown.vue.d.ts +61 -35
- package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +72 -11
- package/dist/components/VvDropdown/VvDropdownItem.vue.d.ts +1 -1
- package/dist/components/VvDropdown/VvDropdownOptgroup.vue.d.ts +12 -4
- package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +26 -7
- package/dist/components/VvDropdown/index.d.ts +16 -11
- package/dist/components/VvDropdownAction/VvDropdownAction.es.js +80 -21
- package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
- package/dist/components/VvDropdownItem/VvDropdownItem.es.js +13 -7
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +56 -8
- package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.umd.js +1 -1
- package/dist/components/VvDropdownOption/VvDropdownOption.es.js +76 -17
- package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.es.js +23 -96
- package/dist/components/VvIcon/VvIcon.umd.js +1 -1
- package/dist/components/VvIcon/VvIcon.vue.d.ts +23 -66
- package/dist/components/VvIcon/index.d.ts +21 -48
- package/dist/components/VvInputFile/VvInputFile.es.js +1558 -0
- package/dist/components/VvInputFile/VvInputFile.umd.js +1 -0
- package/dist/components/VvInputFile/VvInputFile.vue.d.ts +190 -0
- package/dist/components/VvInputFile/index.d.ts +74 -0
- package/dist/components/VvInputText/VvInputClearAction.d.ts +2 -2
- package/dist/components/VvInputText/VvInputPasswordAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
- package/dist/components/VvInputText/VvInputText.es.js +266 -242
- package/dist/components/VvInputText/VvInputText.umd.js +1 -1
- package/dist/components/VvInputText/VvInputText.vue.d.ts +153 -46
- package/dist/components/VvInputText/index.d.ts +69 -18
- package/dist/components/VvNav/VvNav.es.js +150 -73
- package/dist/components/VvNav/VvNav.umd.js +1 -1
- package/dist/components/VvNav/VvNav.vue.d.ts +41 -14
- package/dist/components/VvNav/VvNavItem.vue.d.ts +9 -0
- package/dist/components/VvNav/{VvNavSeparator.d.ts → VvNavSeparator.vue.d.ts} +1 -1
- package/dist/components/VvNav/index.d.ts +5 -13
- package/dist/components/VvNavItem/VvNavItem.es.js +435 -0
- package/dist/components/VvNavItem/VvNavItem.umd.js +1 -0
- package/dist/components/VvNavSeparator/VvNavSeparator.es.js +24 -0
- package/dist/components/VvNavSeparator/VvNavSeparator.umd.js +1 -0
- package/dist/components/VvProgress/VvProgress.es.js +65 -14
- package/dist/components/VvProgress/VvProgress.umd.js +1 -1
- package/dist/components/VvProgress/VvProgress.vue.d.ts +10 -3
- package/dist/components/VvProgress/index.d.ts +4 -1
- package/dist/components/VvRadio/VvRadio.es.js +89 -21
- package/dist/components/VvRadio/VvRadio.umd.js +1 -1
- package/dist/components/VvRadio/VvRadio.vue.d.ts +102 -30
- package/dist/components/VvRadio/index.d.ts +44 -11
- package/dist/components/VvRadioGroup/VvRadioGroup.es.js +168 -66
- package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
- package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +100 -29
- package/dist/components/VvRadioGroup/index.d.ts +45 -12
- package/dist/components/VvSelect/VvSelect.es.js +244 -226
- package/dist/components/VvSelect/VvSelect.umd.js +1 -1
- package/dist/components/VvSelect/VvSelect.vue.d.ts +112 -39
- package/dist/components/VvSelect/index.d.ts +48 -14
- package/dist/components/VvTab/VvTab.es.js +251 -110
- package/dist/components/VvTab/VvTab.umd.js +1 -1
- package/dist/components/VvTab/VvTab.vue.d.ts +50 -13
- package/dist/components/VvTab/index.d.ts +13 -4
- package/dist/components/VvTextarea/VvTextarea.es.js +225 -212
- package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
- package/dist/components/VvTextarea/VvTextarea.vue.d.ts +155 -48
- package/dist/components/VvTextarea/index.d.ts +68 -19
- package/dist/components/VvTooltip/VvTooltip.es.js +72 -17
- package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
- package/dist/components/VvTooltip/VvTooltip.vue.d.ts +10 -3
- package/dist/components/VvTooltip/index.d.ts +4 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.es.js +2635 -1301
- package/dist/components/index.umd.js +1 -1
- package/dist/composables/alert/useAlert.d.ts +37 -4
- package/dist/composables/dropdown/useProvideDropdown.d.ts +1 -1
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.es.js +88 -1
- package/dist/composables/index.umd.js +1 -1
- package/dist/composables/useBlurhash.d.ts +7 -0
- package/dist/composables/useComponentIcon.d.ts +9 -8
- package/dist/composables/useVolver.d.ts +1 -1
- package/dist/directives/index.d.ts +3 -5
- package/dist/directives/index.es.js +92 -31
- package/dist/directives/index.umd.js +1 -1
- package/dist/directives/v-tooltip.es.js +90 -26
- package/dist/directives/v-tooltip.umd.js +1 -1
- package/dist/icons.es.js +6 -6
- package/dist/icons.umd.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.es.js +81 -16
- package/dist/index.umd.js +1 -1
- package/dist/props/index.d.ts +287 -73
- package/dist/resolvers/unplugin.d.ts +6 -1
- package/dist/resolvers/unplugin.es.js +78 -10
- package/dist/resolvers/unplugin.umd.js +1 -1
- package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +72 -84
- package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +623 -461
- package/dist/stories/AlertGroup/AlertGroupWithComposable.stories.d.ts +1 -1
- package/dist/stories/Blurhash/BlurhashComposable.stories.d.ts +4 -0
- package/dist/stories/Combobox/Combobox.settings.d.ts +8 -0
- package/dist/stories/Icon/Icon.settings.d.ts +1 -0
- package/dist/stories/InputFile/InputFile.settings.d.ts +56 -0
- package/dist/stories/InputFile/InputFile.stories.d.ts +13 -0
- package/dist/stories/InputFile/InputFileModifiers.stories.d.ts +9 -0
- package/dist/stories/InputFile/InputFileSlots.stories.d.ts +6 -0
- package/dist/stories/Tab/Tab.settings.d.ts +4 -37
- package/dist/types/alert.d.ts +13 -0
- package/dist/types/blurhash.d.ts +12 -0
- package/dist/types/floating-ui.d.ts +6 -0
- package/dist/types/generic.d.ts +4 -0
- package/dist/types/group.d.ts +37 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/input-file.d.ts +14 -0
- package/dist/types/nav.d.ts +18 -0
- package/dist/utils/ObjectUtilities.d.ts +0 -1
- package/dist/workers/blurhash.d.ts +1 -0
- package/package.json +91 -74
- package/src/Volver.ts +31 -20
- package/src/assets/icons/detailed.json +1 -1
- package/src/assets/icons/normal.json +1 -1
- package/src/assets/icons/simple.json +1 -1
- package/src/components/VvAccordion/VvAccordion.vue +2 -2
- package/src/components/VvAction/VvAction.vue +5 -2
- package/src/components/VvAlert/index.ts +1 -3
- package/src/components/VvAlertGroup/index.ts +2 -1
- package/src/components/VvBreadcrumb/VvBreadcrumb.vue +20 -19
- package/src/components/VvBreadcrumb/index.ts +2 -8
- package/src/components/VvButton/VvButton.vue +6 -6
- package/src/components/VvButton/index.ts +2 -4
- package/src/components/VvCombobox/VvCombobox.vue +24 -16
- package/src/components/VvCombobox/index.ts +4 -0
- package/src/components/VvIcon/VvIcon.vue +2 -2
- package/src/components/VvIcon/index.ts +22 -48
- package/src/components/VvInputFile/VvInputFile.vue +302 -0
- package/src/components/VvInputFile/index.ts +38 -0
- package/src/components/VvInputText/VvInputText.vue +13 -14
- package/src/components/VvNav/VvNav.vue +30 -50
- package/src/components/VvNav/VvNavItem.vue +18 -0
- package/src/components/VvNav/VvNavSeparator.vue +11 -0
- package/src/components/VvNav/index.ts +2 -15
- package/src/components/VvSelect/VvSelect.vue +5 -8
- package/src/components/VvTab/VvTab.vue +63 -35
- package/src/components/VvTab/index.ts +10 -4
- package/src/components/VvTextarea/VvTextarea.vue +6 -9
- package/src/components/index.ts +10 -0
- package/src/composables/index.ts +1 -0
- package/src/composables/useBlurhash.ts +76 -0
- package/src/composables/useComponentIcon.ts +15 -14
- package/src/composables/useUniqueId.ts +2 -2
- package/src/directives/index.ts +3 -6
- package/src/directives/v-tooltip.ts +19 -10
- package/src/index.ts +3 -1
- package/src/props/index.ts +115 -27
- package/src/resolvers/unplugin.ts +24 -14
- package/src/stories/AlertGroup/AlertGroupWithComposable.stories.ts +2 -2
- package/src/stories/Blurhash/BlurhashComposable.stories.ts +195 -0
- package/src/stories/Combobox/Combobox.settings.ts +8 -0
- package/src/stories/Icon/Icon.settings.ts +3 -3
- package/src/stories/InputFile/InputFile.settings.ts +36 -0
- package/src/stories/InputFile/InputFile.stories.ts +98 -0
- package/src/stories/InputFile/InputFileModifiers.stories.ts +51 -0
- package/src/stories/InputFile/InputFileSlots.stories.ts +25 -0
- package/src/stories/Nav/Nav.settings.ts +3 -4
- package/src/stories/Nav/Nav.test.ts +4 -15
- package/src/stories/Tab/Tab.settings.ts +9 -9
- package/src/stories/Tab/Tab.stories.ts +2 -2
- package/src/stories/Tab/Tab.test.ts +6 -14
- package/src/stories/argTypes.ts +1 -1
- package/src/types/blurhash.ts +21 -0
- package/src/types/generic.ts +6 -0
- package/src/types/index.ts +7 -0
- package/src/types/input-file.ts +16 -0
- package/src/types/nav.ts +20 -0
- package/src/utils/ObjectUtilities.ts +0 -11
- package/src/workers/blurhash.ts +9 -0
- package/dist/components/VvNav/VvNavItemTitle.vue.d.ts +0 -6
- package/dist/components/VvNavItemTitle/VvNavItemTitle.es.js +0 -19
- package/dist/components/VvNavItemTitle/VvNavItemTitle.umd.js +0 -1
- package/src/components/VvNav/VvNavItemTitle.vue +0 -11
- package/src/components/VvNav/VvNavSeparator.ts +0 -8
- package/src/types/generic.d.ts +0 -6
- /package/src/types/{alert.d.ts → alert.ts} +0 -0
- /package/src/types/{floating-ui.d.ts → floating-ui.ts} +0 -0
- /package/src/types/{group.d.ts → group.ts} +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import VvInputFile from '@/components/VvInputFile/VvInputFile.vue'
|
|
3
|
+
import { defaultArgs, argTypes } from './InputFile.settings'
|
|
4
|
+
|
|
5
|
+
const meta: Meta = {
|
|
6
|
+
title: 'Components/InputFile',
|
|
7
|
+
component: VvInputFile,
|
|
8
|
+
args: defaultArgs,
|
|
9
|
+
argTypes,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default meta
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof VvInputFile>
|
|
16
|
+
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
args: {
|
|
19
|
+
...defaultArgs,
|
|
20
|
+
},
|
|
21
|
+
render: (args) => ({
|
|
22
|
+
components: { VvInputFile },
|
|
23
|
+
setup() {
|
|
24
|
+
const files = ref([])
|
|
25
|
+
return {
|
|
26
|
+
args,
|
|
27
|
+
files,
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
template: /* html */ `
|
|
31
|
+
<div class="w-1/4">
|
|
32
|
+
<vv-input-file v-bind="args" v-model="files">
|
|
33
|
+
<template #drop-area v-if="args['drop-area']"><div v-html="args['drop-area']"></div></template>
|
|
34
|
+
<template #hint v-if="args['hint']"><div v-html="args['hint']"></div></template>
|
|
35
|
+
</vv-input-file>
|
|
36
|
+
</div>
|
|
37
|
+
`,
|
|
38
|
+
}),
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const Readonly: Story = {
|
|
42
|
+
...Default,
|
|
43
|
+
args: {
|
|
44
|
+
...defaultArgs,
|
|
45
|
+
readonly: true,
|
|
46
|
+
},
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const Valid: Story = {
|
|
50
|
+
...Default,
|
|
51
|
+
args: {
|
|
52
|
+
...defaultArgs,
|
|
53
|
+
valid: true,
|
|
54
|
+
validLabel: 'The field is valid.',
|
|
55
|
+
},
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const Invalid: Story = {
|
|
59
|
+
...Default,
|
|
60
|
+
args: {
|
|
61
|
+
...defaultArgs,
|
|
62
|
+
invalid: true,
|
|
63
|
+
invalidLabel: 'The field is required.',
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const Hint: Story = {
|
|
68
|
+
...Default,
|
|
69
|
+
args: {
|
|
70
|
+
...defaultArgs,
|
|
71
|
+
hintLabel: 'Please upload a file.',
|
|
72
|
+
},
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const Loading: Story = {
|
|
76
|
+
...Default,
|
|
77
|
+
args: {
|
|
78
|
+
...defaultArgs,
|
|
79
|
+
loading: true,
|
|
80
|
+
loadingLabel: 'Loading...',
|
|
81
|
+
},
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export const IconLeft: Story = {
|
|
85
|
+
...Default,
|
|
86
|
+
args: {
|
|
87
|
+
...defaultArgs,
|
|
88
|
+
iconLeft: 'material-symbols:cloud-outline',
|
|
89
|
+
},
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export const IconRight: Story = {
|
|
93
|
+
...Default,
|
|
94
|
+
args: {
|
|
95
|
+
...defaultArgs,
|
|
96
|
+
iconRight: 'akar-icons:heart',
|
|
97
|
+
},
|
|
98
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import VvInputFile from '@/components/VvInputFile/VvInputFile.vue'
|
|
3
|
+
import { Default } from './InputFile.stories'
|
|
4
|
+
import { argTypes, defaultArgs } from './InputFile.settings'
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof VvInputFile> = {
|
|
7
|
+
title: 'Components/InputFile/Modifiers',
|
|
8
|
+
component: VvInputFile,
|
|
9
|
+
args: defaultArgs,
|
|
10
|
+
argTypes,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default meta
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof VvInputFile>
|
|
16
|
+
|
|
17
|
+
export const DropArea: Story = {
|
|
18
|
+
...Default,
|
|
19
|
+
args: {
|
|
20
|
+
...Default.args,
|
|
21
|
+
label: 'Drop area',
|
|
22
|
+
modifiers: 'drop-area',
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const DropAreaHidden: Story = {
|
|
27
|
+
...Default,
|
|
28
|
+
args: {
|
|
29
|
+
...Default.args,
|
|
30
|
+
label: 'Drop area hidden',
|
|
31
|
+
modifiers: 'drop-area hidden',
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const DropAreaSquare: Story = {
|
|
36
|
+
...Default,
|
|
37
|
+
args: {
|
|
38
|
+
...Default.args,
|
|
39
|
+
label: 'Drop area square',
|
|
40
|
+
modifiers: 'drop-area square hidden',
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const DropAreaCircle: Story = {
|
|
45
|
+
...Default,
|
|
46
|
+
args: {
|
|
47
|
+
...Default.args,
|
|
48
|
+
label: 'Drop area circle',
|
|
49
|
+
modifiers: 'drop-area circle hidden',
|
|
50
|
+
},
|
|
51
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
+
import VvInputFile from '@/components/VvInputFile/VvInputFile.vue'
|
|
3
|
+
import { Default as DefaultStory } from './InputFile.stories'
|
|
4
|
+
import { argTypes, defaultArgs } from './InputFile.settings'
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof VvInputFile> = {
|
|
7
|
+
title: 'Components/InputFile/Slots',
|
|
8
|
+
component: VvInputFile,
|
|
9
|
+
args: defaultArgs,
|
|
10
|
+
argTypes,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default meta
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof VvInputFile>
|
|
16
|
+
|
|
17
|
+
export const DropArea: Story = {
|
|
18
|
+
...DefaultStory,
|
|
19
|
+
args: {
|
|
20
|
+
...DefaultStory.args,
|
|
21
|
+
'drop-area':
|
|
22
|
+
'<div class="text-20 font-weight">Drop here your file</div>',
|
|
23
|
+
modifiers: 'drop-area hidden square',
|
|
24
|
+
},
|
|
25
|
+
}
|
|
@@ -7,16 +7,15 @@ export const defaultArgs: Meta<typeof VvNav>['args'] = {
|
|
|
7
7
|
...propsToObject(VvNavProps),
|
|
8
8
|
items: [
|
|
9
9
|
{
|
|
10
|
-
|
|
10
|
+
label: 'Item 1',
|
|
11
11
|
href: 'javascript:void(0)',
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
|
|
14
|
+
label: 'Item 2',
|
|
15
15
|
to: 'about',
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
|
-
|
|
19
|
-
to: 'contacts',
|
|
18
|
+
label: 'Item 3',
|
|
20
19
|
on: {
|
|
21
20
|
click: () => {
|
|
22
21
|
// eslint-disable-next-line no-console
|
|
@@ -1,31 +1,20 @@
|
|
|
1
1
|
import type { PlayAttributes } from '@/test/types'
|
|
2
2
|
import { expect } from '@/test/expect'
|
|
3
|
-
import { within
|
|
3
|
+
import { within } from '@storybook/testing-library'
|
|
4
4
|
|
|
5
5
|
export async function defaultTest({ canvasElement, args }: PlayAttributes) {
|
|
6
6
|
const element = (await within(canvasElement).findByTestId(
|
|
7
7
|
'element',
|
|
8
8
|
)) as HTMLElement
|
|
9
9
|
|
|
10
|
+
const menuEl = element.getElementsByClassName('vv-nav__menu')[0]
|
|
11
|
+
|
|
10
12
|
if (!args.items || !args.items?.length) {
|
|
11
13
|
throw new Error('No items passed')
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
// check children number the same of items prop
|
|
15
|
-
expect(
|
|
16
|
-
|
|
17
|
-
// take firse and second elements
|
|
18
|
-
const firstEl = await element.getElementsByTagName('a')?.[0]
|
|
19
|
-
const secondEl = await element.getElementsByTagName('router-link')?.[1]
|
|
20
|
-
// check they have not current class
|
|
21
|
-
const secondElHasCurrentClass = secondEl.classList.contains('current')
|
|
22
|
-
const firstElHasCurrentClass = firstEl.classList.contains('current')
|
|
23
|
-
|
|
24
|
-
await expect(firstElHasCurrentClass).toBe(false)
|
|
25
|
-
await expect(secondElHasCurrentClass).toBe(false)
|
|
26
|
-
// click first item and check "current" css class
|
|
27
|
-
await userEvent.click(firstEl)
|
|
28
|
-
await expect(firstEl).toHaveClass('current')
|
|
17
|
+
expect(menuEl.children.length).toEqual(args.items?.length)
|
|
29
18
|
|
|
30
19
|
// check accessibility
|
|
31
20
|
await expect(element).toHaveNoViolations()
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
+
import type { ArgTypes, Meta } from '@storybook/vue3'
|
|
2
|
+
import type { VvTab } from '@/components'
|
|
1
3
|
import { VvTabProps } from '@/components/VvTab'
|
|
2
4
|
|
|
3
|
-
export const defaultArgs = {
|
|
5
|
+
export const defaultArgs: Meta<typeof VvTab>['args'] = {
|
|
4
6
|
...propsToObject(VvTabProps),
|
|
5
7
|
items: [
|
|
6
8
|
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
tab: 'tab-1',
|
|
10
|
+
label: 'Item 1',
|
|
9
11
|
},
|
|
10
12
|
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
tab: 'tab-2',
|
|
14
|
+
label: 'Item 2',
|
|
13
15
|
},
|
|
14
16
|
{
|
|
15
|
-
|
|
16
|
-
title: 'Item 3',
|
|
17
|
-
to: 'contacts',
|
|
17
|
+
label: 'Item 3',
|
|
18
18
|
on: {
|
|
19
19
|
click: () => {
|
|
20
20
|
// eslint-disable-next-line no-console
|
|
@@ -25,7 +25,7 @@ export const defaultArgs = {
|
|
|
25
25
|
],
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
export const defaultArgTypes = {
|
|
28
|
+
export const defaultArgTypes: ArgTypes = {
|
|
29
29
|
tabId: {
|
|
30
30
|
description: 'Slot by tab-id',
|
|
31
31
|
control: {
|
|
@@ -27,7 +27,7 @@ export const Default: Story = {
|
|
|
27
27
|
template: /* html */ `
|
|
28
28
|
<div class="m-md w-1/2">
|
|
29
29
|
<vv-tab v-bind="args" data-testId="element">
|
|
30
|
-
<template #tab-
|
|
30
|
+
<template #panel::tab-1>
|
|
31
31
|
<span class="text-20 font-semibold">Tab 1</span>
|
|
32
32
|
<p>
|
|
33
33
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla
|
|
@@ -39,7 +39,7 @@ export const Default: Story = {
|
|
|
39
39
|
elit libero, a pharetra augue.
|
|
40
40
|
</p>
|
|
41
41
|
</template>
|
|
42
|
-
<template #tab-
|
|
42
|
+
<template #panel::tab-2>
|
|
43
43
|
<span class="text-20 font-semibold">Tab 2</span>
|
|
44
44
|
<p>
|
|
45
45
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PlayAttributes } from '@/test/types'
|
|
2
2
|
import { expect } from '@/test/expect'
|
|
3
|
-
import { within
|
|
3
|
+
import { within } from '@storybook/testing-library'
|
|
4
4
|
|
|
5
5
|
export async function defaultTest({ canvasElement, args }: PlayAttributes) {
|
|
6
6
|
const element = (await within(canvasElement).findByTestId(
|
|
@@ -16,21 +16,13 @@ export async function defaultTest({ canvasElement, args }: PlayAttributes) {
|
|
|
16
16
|
expect(childrenEls?.children[0].children.length).toEqual(args.items?.length)
|
|
17
17
|
|
|
18
18
|
// take firse and second elements
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const secondElHasCurrentClass = secondEl.classList.contains('current')
|
|
23
|
-
const firstElHasCurrentClass = firstEl.classList.contains('current')
|
|
24
|
-
|
|
25
|
-
await expect(firstElHasCurrentClass).toBe(false)
|
|
26
|
-
await expect(secondElHasCurrentClass).toBe(false)
|
|
27
|
-
// click first item and check "current" css class
|
|
28
|
-
await userEvent.click(firstEl)
|
|
29
|
-
await expect(firstEl).toHaveClass('current')
|
|
19
|
+
const firstNavItemLabelEl =
|
|
20
|
+
await element.getElementsByClassName('vv-nav__item-label')?.[0]
|
|
21
|
+
await expect(firstNavItemLabelEl.classList.contains('current')).toBe(true)
|
|
30
22
|
|
|
31
23
|
// check tab content to include "Tab 1"
|
|
32
|
-
const
|
|
33
|
-
await expect(
|
|
24
|
+
const firstTabPanelEl = element.getElementsByClassName('vv-tab__panel')?.[0]
|
|
25
|
+
await expect(firstTabPanelEl.classList.contains('target')).toBe(true)
|
|
34
26
|
|
|
35
27
|
// check accessibility
|
|
36
28
|
await expect(element).toHaveNoViolations()
|
package/src/stories/argTypes.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
class ValidationError extends Error {}
|
|
2
|
+
export type BlurhashWorkerType = {
|
|
3
|
+
encode: (
|
|
4
|
+
pixels: Uint8ClampedArray,
|
|
5
|
+
width: number,
|
|
6
|
+
height: number,
|
|
7
|
+
componentX: number,
|
|
8
|
+
componentY: number,
|
|
9
|
+
) => string
|
|
10
|
+
decode: (
|
|
11
|
+
blurhash: string,
|
|
12
|
+
width: number,
|
|
13
|
+
height: number,
|
|
14
|
+
punch?: number,
|
|
15
|
+
) => Uint8ClampedArray
|
|
16
|
+
isBlurhashValid: (blurhash: string) => {
|
|
17
|
+
result: boolean
|
|
18
|
+
errorReason?: string
|
|
19
|
+
}
|
|
20
|
+
ValidationError: ValidationError
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type UploadedFile<Source = undefined> = Source extends undefined
|
|
2
|
+
? {
|
|
3
|
+
name: string
|
|
4
|
+
size: number
|
|
5
|
+
type: string
|
|
6
|
+
url: string
|
|
7
|
+
lastModified?: number
|
|
8
|
+
}
|
|
9
|
+
: {
|
|
10
|
+
name: string
|
|
11
|
+
size: number
|
|
12
|
+
type: string
|
|
13
|
+
url: string
|
|
14
|
+
lastModified?: number
|
|
15
|
+
source: Source
|
|
16
|
+
}
|
package/src/types/nav.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AnchorTarget } from '@/constants'
|
|
2
|
+
|
|
3
|
+
export type NavItem = {
|
|
4
|
+
label: string
|
|
5
|
+
ariaLabel?: string
|
|
6
|
+
title?: string
|
|
7
|
+
to?: string | Record<string, unknown>
|
|
8
|
+
href?: string
|
|
9
|
+
target?: `${AnchorTarget}`
|
|
10
|
+
rel?: string
|
|
11
|
+
disabled?: boolean
|
|
12
|
+
current?: boolean
|
|
13
|
+
class?: string | string[]
|
|
14
|
+
on?: Record<'click' | string, () => void>
|
|
15
|
+
data?: Record<string, unknown>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type NavItemTab = NavItem & {
|
|
19
|
+
tab?: string
|
|
20
|
+
}
|
|
@@ -275,14 +275,3 @@ export function filterArray<T = Record<string, unknown>>(
|
|
|
275
275
|
})
|
|
276
276
|
})
|
|
277
277
|
}
|
|
278
|
-
|
|
279
|
-
export function kebabCase(value: string) {
|
|
280
|
-
if (value) {
|
|
281
|
-
return value
|
|
282
|
-
.match(
|
|
283
|
-
/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g,
|
|
284
|
-
)
|
|
285
|
-
?.join('-')
|
|
286
|
-
?.toLowerCase()
|
|
287
|
-
}
|
|
288
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{
|
|
2
|
-
title: StringConstructor;
|
|
3
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
4
|
-
title: StringConstructor;
|
|
5
|
-
}>>, {}, {}>;
|
|
6
|
-
export default _default;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock, toDisplayString } from "vue";
|
|
2
|
-
const _hoisted_1 = {
|
|
3
|
-
class: "vv-nav__heading-label",
|
|
4
|
-
"aria-hidden": "true"
|
|
5
|
-
};
|
|
6
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
-
__name: "VvNavItemTitle",
|
|
8
|
-
props: {
|
|
9
|
-
title: String
|
|
10
|
-
},
|
|
11
|
-
setup(__props) {
|
|
12
|
-
return (_ctx, _cache) => {
|
|
13
|
-
return openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(__props.title), 1);
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
export {
|
|
18
|
-
_sfc_main as default
|
|
19
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue")):"function"==typeof define&&define.amd?define(["vue"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).VvNavItemTitle=t(e.vue)}(this,(function(e){"use strict";const t={class:"vv-nav__heading-label","aria-hidden":"true"};return e.defineComponent({__name:"VvNavItemTitle",props:{title:String},setup:n=>(i,o)=>(e.openBlock(),e.createElementBlock("span",t,e.toDisplayString(n.title),1))})}));
|
package/src/types/generic.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|