@volverjs/ui-vue 0.0.10-beta.31 → 0.0.10-beta.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +1 -131
  2. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +4 -3
  3. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  4. package/dist/components/VvAlert/VvAlert.es.js +5 -5
  5. package/dist/components/VvAlert/VvAlert.umd.js +1 -1
  6. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +6 -7
  7. package/dist/components/VvAlertGroup/VvAlertGroup.umd.js +1 -1
  8. package/dist/components/VvAvatar/VvAvatar.es.js +1 -6
  9. package/dist/components/VvAvatar/VvAvatar.umd.js +1 -1
  10. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +4 -8
  11. package/dist/components/VvAvatarGroup/VvAvatarGroup.umd.js +1 -1
  12. package/dist/components/VvBadge/VvBadge.es.js +2 -8
  13. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  14. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +3 -8
  15. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  16. package/dist/components/VvButton/VvButton.es.js +0 -22
  17. package/dist/components/VvButton/VvButton.umd.js +1 -1
  18. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +16 -7
  19. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  20. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +7 -0
  21. package/dist/components/VvButtonGroup/index.d.ts +3 -0
  22. package/dist/components/VvCard/VvCard.es.js +1 -6
  23. package/dist/components/VvCard/VvCard.umd.js +1 -1
  24. package/dist/components/VvCheckbox/VvCheckbox.es.js +2 -23
  25. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  26. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +6 -24
  27. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  28. package/dist/components/VvCombobox/VvCombobox.es.js +12 -31
  29. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  30. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +29 -23
  31. package/dist/components/VvCombobox/index.d.ts +7 -7
  32. package/dist/components/VvDialog/VvDialog.es.js +1 -6
  33. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  34. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +23 -23
  35. package/dist/components/VvDropdown/index.d.ts +7 -7
  36. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +0 -5
  37. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  38. package/dist/components/VvIcon/VvIcon.es.js +1 -6
  39. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  40. package/dist/components/VvInputFile/VvInputFile.es.js +0 -22
  41. package/dist/components/VvInputFile/VvInputFile.umd.js +1 -1
  42. package/dist/components/VvInputText/VvInputText.es.js +16 -4
  43. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  44. package/dist/components/VvNav/VvNav.es.js +8 -10
  45. package/dist/components/VvNav/VvNav.umd.js +1 -1
  46. package/dist/components/VvNavItem/VvNavItem.es.js +4 -1
  47. package/dist/components/VvNavItem/VvNavItem.umd.js +1 -1
  48. package/dist/components/VvProgress/VvProgress.es.js +3 -3
  49. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  50. package/dist/components/VvRadio/VvRadio.es.js +0 -22
  51. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  52. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +4 -23
  53. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  54. package/dist/components/VvTab/VvTab.es.js +7 -9
  55. package/dist/components/VvTab/VvTab.umd.js +1 -1
  56. package/dist/components/index.es.js +87 -69
  57. package/dist/components/index.umd.js +1 -1
  58. package/dist/icons.es.js +3 -3
  59. package/dist/icons.umd.js +1 -1
  60. package/dist/props/index.d.ts +7 -7
  61. package/dist/stories/Accordion/Accordion.settings.d.ts +2 -57
  62. package/dist/stories/AccordionGroup/AccordionGroup.settings.d.ts +2 -66
  63. package/dist/stories/AccordionGroup/AccordionGroup.stories.d.ts +2 -181
  64. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +370 -11
  65. package/dist/stories/Alert/Alert.settings.d.ts +2 -109
  66. package/dist/stories/AlertGroup/AlertGroup.settings.d.ts +2 -85
  67. package/dist/stories/AvatarGroup/AvatarGroup.settings.d.ts +2 -38
  68. package/dist/stories/Badge/Badge.settings.d.ts +2 -26
  69. package/dist/stories/Breadcrumb/Breadcrumb.settings.d.ts +2 -18
  70. package/dist/stories/Breadcrumb/Breadcrumb.test.d.ts +1 -1
  71. package/dist/stories/Button/Button.settings.d.ts +2 -193
  72. package/dist/stories/ButtonGroup/ButtonGroup.settings.d.ts +2 -40
  73. package/dist/stories/Card/Card.settings.d.ts +2 -63
  74. package/dist/stories/Checkbox/Checkbox.settings.d.ts +2 -132
  75. package/dist/stories/CheckboxGroup/CheckboxGroup.settings.d.ts +1 -141
  76. package/dist/stories/Combobox/Combobox.settings.d.ts +2 -617
  77. package/dist/stories/Dialog/Dialog.settings.d.ts +2 -47
  78. package/dist/stories/Dropdown/Dropdown.settings.d.ts +2 -205
  79. package/dist/stories/Icon/Icon.settings.d.ts +2 -68
  80. package/dist/stories/InputFile/InputFile.settings.d.ts +2 -52
  81. package/dist/stories/InputText/InputText.settings.d.ts +2 -438
  82. package/dist/stories/Nav/Nav.settings.d.ts +2 -10
  83. package/dist/stories/Progress/Progress.settings.d.ts +2 -27
  84. package/dist/stories/Radio/Radio.settings.d.ts +1 -110
  85. package/dist/stories/RadioGroup/RadioGroup.settings.d.ts +1 -141
  86. package/dist/stories/Select/Select.settings.d.ts +2 -246
  87. package/dist/stories/Textarea/Textarea.settings.d.ts +2 -287
  88. package/dist/stories/argTypes.d.ts +27 -866
  89. package/package.json +45 -45
  90. package/src/assets/icons/detailed.json +1 -1
  91. package/src/assets/icons/normal.json +1 -1
  92. package/src/assets/icons/simple.json +1 -1
  93. package/src/components/VvAlert/index.ts +4 -4
  94. package/src/components/VvAlertGroup/VvAlertGroup.vue +0 -1
  95. package/src/components/VvBadge/VvBadge.vue +1 -1
  96. package/src/components/VvButtonGroup/VvButtonGroup.vue +11 -2
  97. package/src/components/VvButtonGroup/index.ts +1 -0
  98. package/src/components/VvCheckbox/VvCheckbox.vue +2 -5
  99. package/src/components/VvCombobox/VvCombobox.vue +2 -1
  100. package/src/components/VvInputText/VvInputText.vue +18 -3
  101. package/src/components/VvNav/VvNav.vue +1 -6
  102. package/src/components/VvNav/VvNavItem.vue +1 -1
  103. package/src/components/VvProgress/VvProgress.vue +0 -1
  104. package/src/composables/alert/useAlert.ts +3 -3
  105. package/src/stories/Accordion/Accordion.settings.ts +3 -2
  106. package/src/stories/AccordionGroup/AccordionGroup.settings.ts +4 -3
  107. package/src/stories/AccordionGroup/AccordionGroup.stories.ts +4 -2
  108. package/src/stories/AccordionGroup/AccordionGroup.test.ts +2 -6
  109. package/src/stories/Alert/Alert.settings.ts +8 -7
  110. package/src/stories/Alert/Alert.test.ts +1 -3
  111. package/src/stories/AlertGroup/AlertGroup.settings.ts +3 -1
  112. package/src/stories/AlertGroup/AlertGroup.test.ts +5 -7
  113. package/src/stories/Avatar/Avatar.test.ts +1 -3
  114. package/src/stories/Avatar/AvatarModifiers.stories.ts +1 -0
  115. package/src/stories/AvatarGroup/AvatarGroup.settings.ts +2 -1
  116. package/src/stories/AvatarGroup/AvatarGroup.test.ts +1 -3
  117. package/src/stories/AvatarGroup/AvatarGroupModifiers.stories.ts +1 -0
  118. package/src/stories/Badge/Badge.settings.ts +2 -1
  119. package/src/stories/Badge/Badge.stories.ts +2 -2
  120. package/src/stories/Badge/Badge.test.ts +1 -1
  121. package/src/stories/Breadcrumb/Breadcrumb.settings.ts +2 -1
  122. package/src/stories/Breadcrumb/Breadcrumb.stories.ts +1 -1
  123. package/src/stories/Breadcrumb/Breadcrumb.test.ts +1 -1
  124. package/src/stories/Button/Button.settings.ts +6 -6
  125. package/src/stories/Button/Button.stories.ts +1 -1
  126. package/src/stories/Button/Button.test.ts +1 -3
  127. package/src/stories/ButtonGroup/ButtonGroup.settings.ts +11 -1
  128. package/src/stories/ButtonGroup/ButtonGroup.stories.ts +1 -1
  129. package/src/stories/ButtonGroup/ButtonGroup.test.ts +2 -6
  130. package/src/stories/Card/Card.settings.ts +2 -1
  131. package/src/stories/Card/Card.test.ts +1 -3
  132. package/src/stories/Checkbox/Checkbox.settings.ts +5 -3
  133. package/src/stories/Checkbox/Checkbox.test.ts +2 -6
  134. package/src/stories/Checkbox/CheckboxBinary.stories.ts +1 -1
  135. package/src/stories/CheckboxGroup/CheckboxGroup.test.ts +2 -6
  136. package/src/stories/Combobox/Combobox.settings.ts +10 -10
  137. package/src/stories/Combobox/Combobox.test.ts +2 -6
  138. package/src/stories/Dialog/Dialog.settings.ts +2 -1
  139. package/src/stories/Dialog/Dialog.test.ts +3 -8
  140. package/src/stories/Dropdown/Dropdown.settings.ts +2 -1
  141. package/src/stories/Dropdown/Dropdown.test.ts +2 -6
  142. package/src/stories/Dropdown/DropdownSlots.stories.ts +1 -1
  143. package/src/stories/Icon/Icon.settings.ts +2 -1
  144. package/src/stories/Icon/Icon.stories.ts +0 -1
  145. package/src/stories/InputFile/InputFile.settings.ts +2 -1
  146. package/src/stories/InputText/InputText.settings.ts +8 -6
  147. package/src/stories/InputText/InputText.test.ts +2 -6
  148. package/src/stories/InputText/InputTextMinMax.stories.ts +1 -1
  149. package/src/stories/Nav/Nav.settings.ts +2 -2
  150. package/src/stories/Nav/Nav.stories.ts +1 -1
  151. package/src/stories/Nav/Nav.test.ts +2 -4
  152. package/src/stories/Progress/Progress.settings.ts +2 -1
  153. package/src/stories/Radio/Radio.test.ts +2 -6
  154. package/src/stories/RadioGroup/RadioGroup.stories.ts +1 -2
  155. package/src/stories/RadioGroup/RadioGroup.test.ts +2 -6
  156. package/src/stories/RadioGroup/RadioGroupOptions.stories.ts +1 -1
  157. package/src/stories/Select/Select.settings.ts +4 -3
  158. package/src/stories/Select/Select.test.ts +3 -9
  159. package/src/stories/Select/SelectIconPosition.stories.ts +2 -2
  160. package/src/stories/Select/SelectOptions.stories.ts +0 -1
  161. package/src/stories/Tab/Tab.test.ts +3 -5
  162. package/src/stories/Textarea/Textarea.settings.ts +5 -3
  163. package/src/stories/Textarea/Textarea.test.ts +2 -6
  164. package/src/stories/Tooltip/Tooltip.settings.ts +1 -1
  165. package/src/stories/Tooltip/Tooltip.test.ts +3 -5
  166. package/src/stories/argTypes.ts +47 -46
@@ -5,12 +5,8 @@ import { within } from '@storybook/test'
5
5
  export async function defaultTest(
6
6
  { canvasElement, args }: PlayAttributes = {} as PlayAttributes,
7
7
  ) {
8
- const buttonGroup = (await within(canvasElement).findByTestId(
9
- 'button-group',
10
- )) as HTMLElement
11
- const firstButton = (await within(canvasElement).findByTestId(
12
- 'first-button',
13
- )) as HTMLElement
8
+ const buttonGroup = await within(canvasElement).findByTestId('button-group')
9
+ const firstButton = await within(canvasElement).findByTestId('first-button')
14
10
  const modifiers =
15
11
  !args.modifiers || Array.isArray(args.modifiers)
16
12
  ? args.modifiers
@@ -1,4 +1,5 @@
1
1
  import { DefaultSlotArgTypes, ModifiersArgTypes } from '@/stories/argTypes'
2
+ import type { ArgTypes } from '@storybook/vue3'
2
3
 
3
4
  export const defaultArgs = {
4
5
  title: 'Card title',
@@ -6,7 +7,7 @@ export const defaultArgs = {
6
7
  'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean turpis diam, tempor non sem ut, suscipit gravida mi.',
7
8
  }
8
9
 
9
- export const argTypes = {
10
+ export const argTypes: ArgTypes = {
10
11
  modifiers: {
11
12
  ...ModifiersArgTypes.modifiers,
12
13
  options: ['glass'],
@@ -3,9 +3,7 @@ import { expect } from '@/test/expect'
3
3
  import { within } from '@storybook/test'
4
4
 
5
5
  export async function defaulTest({ canvasElement, args }: PlayAttributes) {
6
- const element = (await within(canvasElement).findByTestId(
7
- 'card',
8
- )) as HTMLElement
6
+ const element = await within(canvasElement).findByTestId('card')
9
7
  const modifiers =
10
8
  !args.modifiers || Array.isArray(args.modifiers)
11
9
  ? args.modifiers
@@ -1,4 +1,5 @@
1
1
  import { CheckboxRadioArgTypes } from '@/stories/argTypes'
2
+ import type { ArgTypes } from '@storybook/vue3'
2
3
 
3
4
  export const defaultArgs = {
4
5
  name: 'checkbox',
@@ -14,13 +15,14 @@ export const defaultArgs = {
14
15
  uncheckedValue: undefined,
15
16
  }
16
17
 
17
- export const argTypes = {
18
+ // @ts-ignore
19
+ export const argTypes: ArgTypes = {
18
20
  ...CheckboxRadioArgTypes,
19
21
  indeterminate: {
20
22
  description: 'If true, the input will be indeterminated',
21
23
  table: {
22
24
  defaultValue: {
23
- summary: false,
25
+ summary: 'false',
24
26
  },
25
27
  },
26
28
  },
@@ -34,7 +36,7 @@ export const argTypes = {
34
36
  description: 'If true, the input will be displayed as a switch.',
35
37
  table: {
36
38
  defaultValue: {
37
- summary: false,
39
+ summary: 'false',
38
40
  },
39
41
  },
40
42
  },
@@ -4,12 +4,8 @@ import { sleep } from '@/test/sleep'
4
4
  import { within } from '@storybook/test'
5
5
 
6
6
  export async function defaultTest({ canvasElement, args }: PlayAttributes) {
7
- const element = (await within(canvasElement).findByTestId(
8
- 'element',
9
- )) as HTMLElement
10
- const value = (await within(canvasElement).findByTestId(
11
- 'value',
12
- )) as HTMLElement
7
+ const element = await within(canvasElement).findByTestId('element')
8
+ const value = await within(canvasElement).findByTestId('value')
13
9
  const input = element.getElementsByTagName('input')[0]
14
10
  const hint = element.getElementsByClassName('vv-checkbox__hint')[0]
15
11
 
@@ -30,4 +30,4 @@ export const YesNo: Story = {
30
30
  value: 'Yes',
31
31
  uncheckedValue: 'No',
32
32
  },
33
- }
33
+ }
@@ -5,12 +5,8 @@ import { within } from '@storybook/test'
5
5
  import { getOptionValue } from '@/test/options'
6
6
 
7
7
  export async function defaultTest({ canvasElement, args }: PlayAttributes) {
8
- const element = (await within(canvasElement).findByTestId(
9
- 'element',
10
- )) as HTMLElement
11
- const value = (await within(canvasElement).findByTestId(
12
- 'value',
13
- )) as HTMLElement
8
+ const element = await within(canvasElement).findByTestId('element')
9
+ const value = await within(canvasElement).findByTestId('value')
14
10
  const checkbox = element.getElementsByClassName('vv-checkbox')[0]
15
11
  const input = checkbox.getElementsByTagName('input')[0]
16
12
  const hint = element.getElementsByClassName('vv-checkbox-group__hint')[0]
@@ -1,5 +1,5 @@
1
1
  import type { VvCombobox } from '@/components'
2
- import type { Meta } from '@storybook/vue3'
2
+ import type { ArgTypes, Meta } from '@storybook/vue3'
3
3
  import {
4
4
  ValidArgTypes,
5
5
  InvalidArgTypes,
@@ -48,7 +48,7 @@ export const defaultArgs: Meta<typeof VvCombobox>['args'] = {
48
48
  strategy: 'fixed',
49
49
  }
50
50
 
51
- export const argTypes = {
51
+ export const argTypes: ArgTypes = {
52
52
  ...TabindexArgTypes,
53
53
  ...ValidArgTypes,
54
54
  ...InvalidArgTypes,
@@ -66,7 +66,7 @@ export const argTypes = {
66
66
  ...DropdownArgTypes.triggerWidth,
67
67
  table: {
68
68
  defaultValue: {
69
- summary: true,
69
+ summary: 'true',
70
70
  },
71
71
  },
72
72
  },
@@ -75,7 +75,7 @@ export const argTypes = {
75
75
  ' This Boolean attribute indicates that multiple options can be selected in the list.',
76
76
  table: {
77
77
  defaultValue: {
78
- summary: false,
78
+ summary: 'false',
79
79
  },
80
80
  },
81
81
  },
@@ -183,7 +183,7 @@ export const argTypes = {
183
183
  description: 'Enable search in options',
184
184
  table: {
185
185
  defaultValue: {
186
- summary: false,
186
+ summary: 'false',
187
187
  },
188
188
  },
189
189
  },
@@ -235,7 +235,7 @@ export const argTypes = {
235
235
  description: 'Show native select',
236
236
  table: {
237
237
  defaultValue: {
238
- summary: false,
238
+ summary: 'false',
239
239
  },
240
240
  },
241
241
  },
@@ -243,7 +243,7 @@ export const argTypes = {
243
243
  description: 'Show badges for selected values',
244
244
  table: {
245
245
  defaultValue: {
246
- summary: false,
246
+ summary: 'false',
247
247
  },
248
248
  },
249
249
  },
@@ -284,7 +284,7 @@ export const argTypes = {
284
284
  description: 'Open dropdown on focus',
285
285
  table: {
286
286
  defaultValue: {
287
- summary: false,
287
+ summary: 'false',
288
288
  },
289
289
  },
290
290
  },
@@ -292,7 +292,7 @@ export const argTypes = {
292
292
  description: 'Keep open dropdown on signle select',
293
293
  table: {
294
294
  defaultValue: {
295
- summary: false,
295
+ summary: 'false',
296
296
  },
297
297
  },
298
298
  },
@@ -300,7 +300,7 @@ export const argTypes = {
300
300
  description: 'Autofocus first option on open dropdown',
301
301
  table: {
302
302
  defaultValue: {
303
- summary: true,
303
+ summary: 'true',
304
304
  },
305
305
  },
306
306
  },
@@ -11,12 +11,8 @@ export async function defaultTest({ canvasElement, args }: PlayAttributes) {
11
11
  return
12
12
  }
13
13
 
14
- const element = (await within(canvasElement).findByTestId(
15
- 'element',
16
- )) as HTMLElement
17
- const value = (await within(canvasElement).findByTestId(
18
- 'value',
19
- )) as HTMLElement
14
+ const element = await within(canvasElement).findByTestId('element')
15
+ const value = await within(canvasElement).findByTestId('value')
20
16
  const dropdown = element.getElementsByClassName(
21
17
  'vv-dropdown',
22
18
  )[0] as HTMLElement
@@ -1,4 +1,5 @@
1
1
  import { DefaultSlotArgTypes } from '@/stories/argTypes'
2
+ import type { ArgTypes } from '@storybook/vue3'
2
3
 
3
4
  export const defaultArgs = {
4
5
  id: 'dialog',
@@ -9,7 +10,7 @@ export const defaultArgs = {
9
10
  default: 'Default slot content',
10
11
  }
11
12
 
12
- export const argTypes = {
13
+ export const argTypes: ArgTypes = {
13
14
  title: { control: 'text' },
14
15
  transition: {
15
16
  control: 'radio',
@@ -1,18 +1,13 @@
1
1
  import type { PlayAttributes } from '@/test/types'
2
2
  import { expect } from '@/test/expect'
3
- import { userEvent } from '@storybook/test'
4
- import { within } from '@storybook/test'
3
+ import { userEvent, within } from '@storybook/test'
5
4
  import { sleep } from '@/test/sleep'
6
5
 
7
6
  export async function defaultTest(
8
7
  { canvasElement, args }: PlayAttributes = {} as PlayAttributes,
9
8
  ) {
10
- const element = (await within(canvasElement).findByTestId(
11
- 'element',
12
- )) as HTMLDialogElement
13
- const button = (await within(canvasElement).findByTestId(
14
- 'button',
15
- )) as HTMLButtonElement
9
+ const element = await within(canvasElement).findByTestId('element')
10
+ const button = await within(canvasElement).findByTestId('button')
16
11
 
17
12
  // hidden
18
13
  await expect(element?.style.display).toEqual('none')
@@ -1,12 +1,13 @@
1
1
  import { VvDropdownProps } from '@/components/VvDropdown'
2
2
  import { DropdownRole } from '@/constants'
3
3
  import { DropdownArgTypes } from '../argTypes'
4
+ import type { ArgTypes } from '@storybook/vue3'
4
5
 
5
6
  export const defaultArgs = {
6
7
  ...propsToObject(VvDropdownProps),
7
8
  }
8
9
 
9
- export const argTypes = {
10
+ export const argTypes: ArgTypes = {
10
11
  ...DropdownArgTypes,
11
12
  role: {
12
13
  description: 'Dropdown role',
@@ -4,12 +4,8 @@ import { sleep } from '@/test/sleep'
4
4
  import { within } from '@storybook/test'
5
5
 
6
6
  export async function defaultTest({ canvasElement }: PlayAttributes) {
7
- const wrapper = (await within(canvasElement).findByTestId(
8
- 'wrapper',
9
- )) as HTMLElement
10
- const trigger = (await within(canvasElement).findByTestId(
11
- 'trigger',
12
- )) as HTMLElement
7
+ const wrapper = await within(canvasElement).findByTestId('wrapper')
8
+ const trigger = await within(canvasElement).findByTestId('trigger')
13
9
 
14
10
  await expect(trigger).toBeClicked()
15
11
  await sleep(100)
@@ -92,4 +92,4 @@ export const After: Story = {
92
92
  ...Default.args,
93
93
  after: '<div class="bg-danger text-white p-xs text-center">After</div>',
94
94
  },
95
- }
95
+ }
@@ -1,6 +1,7 @@
1
1
  import { VvIconPropsDefaults } from '@/components/VvIcon'
2
2
  import normal from '@/assets/icons/normal.json'
3
3
  import { ModifiersArgTypes } from '@/stories/argTypes'
4
+ import type { ArgTypes } from '@storybook/vue3'
4
5
 
5
6
  export const defaultArgs = {
6
7
  ...VvIconPropsDefaults,
@@ -8,7 +9,7 @@ export const defaultArgs = {
8
9
  width: 48,
9
10
  }
10
11
 
11
- export const argTypes = {
12
+ export const argTypes: ArgTypes = {
12
13
  name: {
13
14
  options: Object.keys(normal.icons),
14
15
  control: {
@@ -45,4 +45,3 @@ export const Inline: Story = {
45
45
  svg: `<svg viewBox="0 0 24 24">${NormalIcons.icons.bell.body}</svg>`,
46
46
  },
47
47
  }
48
-
@@ -1,5 +1,6 @@
1
1
  import { HintArgTypes, ModifiersArgTypes } from '@/stories/argTypes'
2
2
  import { VvInputFileProps } from '@/components/VvInputFile'
3
+ import type { ArgTypes } from '@storybook/vue3'
3
4
 
4
5
  export const defaultArgs = {
5
6
  ...propsToObject(VvInputFileProps),
@@ -7,7 +8,7 @@ export const defaultArgs = {
7
8
  label: 'Upload file',
8
9
  }
9
10
 
10
- export const argTypes = {
11
+ export const argTypes: ArgTypes = {
11
12
  ...HintArgTypes,
12
13
  modifiers: {
13
14
  ...ModifiersArgTypes.modifiers,
@@ -1,6 +1,7 @@
1
1
  import { HintArgTypes, InputTextareaArgTypes } from '@/stories/argTypes'
2
2
  import { VvInputTextProps } from '@/components/VvInputText'
3
3
  import normal from '@/assets/icons/normal.json'
4
+ import type { ArgTypes } from '@storybook/vue3'
4
5
 
5
6
  export const defaultArgs = {
6
7
  ...propsToObject(VvInputTextProps),
@@ -13,7 +14,8 @@ export const defaultArgs = {
13
14
  maxlength: undefined,
14
15
  }
15
16
 
16
- export const argTypes = {
17
+ // @ts-ignore
18
+ export const argTypes: ArgTypes = {
17
19
  ...InputTextareaArgTypes,
18
20
  ...HintArgTypes,
19
21
  type: {
@@ -61,7 +63,7 @@ export const argTypes = {
61
63
  'Incremental values that are valid. Available for input types: date, month, week, time, datetime-local and number.',
62
64
  table: {
63
65
  defaultValue: {
64
- summary: 1,
66
+ summary: '1',
65
67
  },
66
68
  },
67
69
  },
@@ -77,7 +79,7 @@ export const argTypes = {
77
79
  'Whether to allow multiple values. Available for input type email.',
78
80
  table: {
79
81
  defaultValue: {
80
- summary: false,
82
+ summary: 'false',
81
83
  },
82
84
  },
83
85
  },
@@ -193,7 +195,7 @@ export const argTypes = {
193
195
  },
194
196
  table: {
195
197
  defaultValue: {
196
- summary: false,
198
+ summary: 'false',
197
199
  },
198
200
  type: {
199
201
  summary: 'boolean',
@@ -207,7 +209,7 @@ export const argTypes = {
207
209
  },
208
210
  table: {
209
211
  defaultValue: {
210
- summary: false,
212
+ summary: 'false',
211
213
  },
212
214
  type: {
213
215
  summary: 'boolean',
@@ -227,7 +229,7 @@ export const argTypes = {
227
229
  },
228
230
  table: {
229
231
  defaultValue: {
230
- summary: false,
232
+ summary: 'false',
231
233
  },
232
234
  type: {
233
235
  summary: 'boolean',
@@ -50,12 +50,8 @@ const valueByType = (type: InputType, mask?: string, id?: string) => {
50
50
  }
51
51
 
52
52
  export async function defaultTest({ canvasElement, args }: PlayAttributes) {
53
- const element = (await within(canvasElement).findByTestId(
54
- 'element',
55
- )) as HTMLElement
56
- const value = (await within(canvasElement).findByTestId(
57
- 'value',
58
- )) as HTMLElement
53
+ const element = await within(canvasElement).findByTestId('element')
54
+ const value = await within(canvasElement).findByTestId('value')
59
55
  const input = element.getElementsByTagName('input')[0]
60
56
  const hint = element.getElementsByClassName('vv-input-text__hint')[0]
61
57
 
@@ -48,4 +48,4 @@ export const MaxDate: Story = {
48
48
  type: 'date',
49
49
  max: new Date().toISOString().split('T')[0],
50
50
  },
51
- }
51
+ }
@@ -1,4 +1,4 @@
1
- import type { Meta } from '@storybook/vue3'
1
+ import type { ArgTypes, Meta } from '@storybook/vue3'
2
2
  import type { VvNav } from '@/components'
3
3
  import { VvNavProps } from '@/components/VvNav'
4
4
  import { ModifiersArgTypes } from '@/stories/argTypes'
@@ -27,7 +27,7 @@ export const defaultArgs: Meta<typeof VvNav>['args'] = {
27
27
  modifiers: 'sidebar',
28
28
  }
29
29
 
30
- export const argTypes = {
30
+ export const argTypes: ArgTypes = {
31
31
  modifiers: {
32
32
  ...ModifiersArgTypes.modifiers,
33
33
  options: ['sidebar', 'aside', 'tabs', 'full'],
@@ -30,4 +30,4 @@ export const Default: Story = {
30
30
  </div>`,
31
31
  }),
32
32
  play: defaultTest,
33
- }
33
+ }
@@ -3,13 +3,11 @@ import { expect } from '@/test/expect'
3
3
  import { within } from '@storybook/test'
4
4
 
5
5
  export async function defaultTest({ canvasElement, args }: PlayAttributes) {
6
- const element = (await within(canvasElement).findByTestId(
7
- 'element',
8
- )) as HTMLElement
6
+ const element = await within(canvasElement).findByTestId('element')
9
7
 
10
8
  const menuEl = element.getElementsByClassName('vv-nav__menu')[0]
11
9
 
12
- if (!args.items || !args.items?.length) {
10
+ if (!args.items?.length) {
13
11
  throw new Error('No items passed')
14
12
  }
15
13
 
@@ -1,11 +1,12 @@
1
1
  import { ModifiersArgTypes } from '@/stories/argTypes'
2
+ import type { ArgTypes } from '@storybook/vue3'
2
3
 
3
4
  export const defaultArgs = {
4
5
  max: undefined,
5
6
  value: undefined,
6
7
  label: 'Progress bar',
7
8
  }
8
- export const argTypes = {
9
+ export const argTypes: ArgTypes = {
9
10
  ...ModifiersArgTypes,
10
11
  max: {
11
12
  description:
@@ -4,12 +4,8 @@ import { sleep } from '@/test/sleep'
4
4
  import { within } from '@storybook/test'
5
5
 
6
6
  export async function defaultTest({ canvasElement, args }: PlayAttributes) {
7
- const element = (await within(canvasElement).findByTestId(
8
- 'element',
9
- )) as HTMLElement
10
- const value = (await within(canvasElement).findByTestId(
11
- 'value',
12
- )) as HTMLElement
7
+ const element = await within(canvasElement).findByTestId('element')
8
+ const value = await within(canvasElement).findByTestId('value')
13
9
  const input = element.getElementsByTagName('input')[0]
14
10
  const hint = element.getElementsByClassName('vv-radio__hint')[0]
15
11
 
@@ -69,7 +69,6 @@ export const Invalid: Story = {
69
69
  },
70
70
  }
71
71
 
72
-
73
72
  export const Valid: Story = {
74
73
  ...Default,
75
74
  args: {
@@ -85,4 +84,4 @@ export const Hint: Story = {
85
84
  ...defaultArgs,
86
85
  hintLabel: 'Please fill the input above.',
87
86
  },
88
- }
87
+ }
@@ -5,12 +5,8 @@ import { within } from '@storybook/test'
5
5
  import { getOptionValue } from '@/test/options'
6
6
 
7
7
  export async function defaultTest({ canvasElement, args }: PlayAttributes) {
8
- const element = (await within(canvasElement).findByTestId(
9
- 'element',
10
- )) as HTMLElement
11
- const value = (await within(canvasElement).findByTestId(
12
- 'value',
13
- )) as HTMLElement
8
+ const element = await within(canvasElement).findByTestId('element')
9
+ const value = await within(canvasElement).findByTestId('value')
14
10
  const radio = element.getElementsByClassName('vv-radio')[0]
15
11
  const input = radio.getElementsByTagName('input')[0]
16
12
  const hint = element.getElementsByClassName('vv-radio-group__hint')[0]
@@ -50,4 +50,4 @@ export const OptionValueKey: Story = {
50
50
  { id: 'third', label: 'Third' },
51
51
  ],
52
52
  },
53
- }
53
+ }
@@ -16,6 +16,7 @@ import {
16
16
  AutocompleteArgTypes,
17
17
  } from '@/stories/argTypes'
18
18
  import { VvSelectProps } from '@/components/VvSelect'
19
+ import type { ArgTypes } from '@storybook/vue3'
19
20
 
20
21
  export const defaultArgs = {
21
22
  ...propsToObject(VvSelectProps),
@@ -24,7 +25,7 @@ export const defaultArgs = {
24
25
  placeholder: 'Select an option',
25
26
  label: 'Select label',
26
27
  }
27
- export const argTypes = {
28
+ export const argTypes: ArgTypes = {
28
29
  ...IdNameArgTypes,
29
30
  ...AutofocusArgTypes,
30
31
  ...AutocompleteArgTypes,
@@ -45,7 +46,7 @@ export const argTypes = {
45
46
  'This Boolean attribute indicates that multiple options can be selected in the list.',
46
47
  table: {
47
48
  defaultValue: {
48
- summary: false,
49
+ summary: 'false',
49
50
  },
50
51
  },
51
52
  },
@@ -54,7 +55,7 @@ export const argTypes = {
54
55
  'A Boolean attribute indicating that an option with a non-empty string value must be selected.',
55
56
  table: {
56
57
  defaultValue: {
57
- summary: false,
58
+ summary: 'false',
58
59
  },
59
60
  },
60
61
  },
@@ -4,15 +4,9 @@ import { expect } from '@/test/expect'
4
4
  import { sleep } from '@/test/sleep'
5
5
 
6
6
  export async function defaultTest({ canvasElement, args }: PlayAttributes) {
7
- const element = (await within(canvasElement).findByTestId(
8
- 'element',
9
- )) as HTMLElement
10
- const value = (await within(canvasElement).findByTestId(
11
- 'value',
12
- )) as HTMLElement
13
- const select = element.getElementsByTagName(
14
- 'select',
15
- )[0] as HTMLSelectElement
7
+ const element = await within(canvasElement).findByTestId('element')
8
+ const value = await within(canvasElement).findByTestId('value')
9
+ const select = element.getElementsByTagName('select')[0]
16
10
  const hint = element.getElementsByClassName('vv-select__hint')[0]
17
11
 
18
12
  const { getOptionValue } = useOptions(args)
@@ -22,7 +22,7 @@ export const DefaultIconPosition: Story = {
22
22
  },
23
23
  }
24
24
 
25
- export const After: Story ={
25
+ export const After: Story = {
26
26
  ...Default,
27
27
  args: {
28
28
  ...Default.args,
@@ -40,4 +40,4 @@ export const Src: Story = {
40
40
  src: 'https://raw.githubusercontent.com/google/material-design-icons/master/src/social/engineering/materialicons/24px.svg',
41
41
  },
42
42
  },
43
- }
43
+ }
@@ -49,7 +49,6 @@ export const OptionValueKey: Story = {
49
49
  { id: 'second', label: 'Second' },
50
50
  { id: 'third', label: 'Third' },
51
51
  ],
52
-
53
52
  },
54
53
  }
55
54
 
@@ -3,11 +3,9 @@ import { expect } from '@/test/expect'
3
3
  import { within } from '@storybook/test'
4
4
 
5
5
  export async function defaultTest({ canvasElement, args }: PlayAttributes) {
6
- const element = (await within(canvasElement).findByTestId(
7
- 'element',
8
- )) as HTMLElement
6
+ const element = await within(canvasElement).findByTestId('element')
9
7
 
10
- if (!args.items || !args.items?.length) {
8
+ if (!args.items?.length) {
11
9
  throw new Error('No items passed')
12
10
  }
13
11
 
@@ -17,7 +15,7 @@ export async function defaultTest({ canvasElement, args }: PlayAttributes) {
17
15
 
18
16
  // take firse and second elements
19
17
  const firstNavItemLabelEl =
20
- await element.getElementsByClassName('vv-nav__item-label')?.[0]
18
+ element.getElementsByClassName('vv-nav__item-label')?.[0]
21
19
  await expect(firstNavItemLabelEl.classList.contains('current')).toBe(true)
22
20
 
23
21
  // check tab content to include "Tab 1"
@@ -1,5 +1,6 @@
1
1
  import { HintArgTypes, InputTextareaArgTypes } from '@/stories/argTypes'
2
2
  import { VvTextareaProps } from '@/components/VvTextarea'
3
+ import type { ArgTypes } from '@storybook/vue3'
3
4
 
4
5
  export const defaultArgs = {
5
6
  ...propsToObject(VvTextareaProps),
@@ -10,7 +11,8 @@ export const defaultArgs = {
10
11
  maxlength: undefined,
11
12
  }
12
13
 
13
- export const argTypes = {
14
+ // @ts-ignore
15
+ export const argTypes: ArgTypes = {
14
16
  ...InputTextareaArgTypes,
15
17
  ...HintArgTypes,
16
18
  cols: {
@@ -21,7 +23,7 @@ export const argTypes = {
21
23
  },
22
24
  table: {
23
25
  defaultValue: {
24
- summary: 20,
26
+ summary: '20',
25
27
  },
26
28
  },
27
29
  },
@@ -33,7 +35,7 @@ export const argTypes = {
33
35
  },
34
36
  table: {
35
37
  defaultValue: {
36
- summary: 2,
38
+ summary: '2',
37
39
  },
38
40
  },
39
41
  },