@volverjs/ui-vue 0.0.3 → 0.0.5-beta.1

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 (236) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +54 -15
  3. package/auto-imports.d.ts +12 -3
  4. package/bin/icons.cjs +1 -73
  5. package/dist/Volver.d.ts +23 -11
  6. package/dist/components/VvAccordion/VvAccordion.es.js +180 -74
  7. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  8. package/dist/components/VvAccordion/VvAccordion.vue.d.ts +4 -1
  9. package/dist/components/VvAccordion/index.d.ts +8 -3
  10. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +280 -122
  11. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  12. package/dist/components/VvAccordionGroup/VvAccordionGroup.vue.d.ts +15 -12
  13. package/dist/components/VvAccordionGroup/index.d.ts +8 -0
  14. package/dist/components/VvAction/VvAction.es.js +338 -0
  15. package/dist/components/VvAction/VvAction.umd.js +1 -0
  16. package/dist/components/VvAction/VvAction.vue.d.ts +63 -0
  17. package/dist/components/VvAction/index.d.ts +24 -0
  18. package/dist/components/VvBadge/VvBadge.es.js +251 -22
  19. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  20. package/dist/components/VvBadge/VvBadge.vue.d.ts +2 -2
  21. package/dist/components/VvBadge/index.d.ts +1 -1
  22. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +280 -62
  23. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  24. package/dist/components/VvBreadcrumb/VvBreadcrumb.vue.d.ts +11 -11
  25. package/dist/components/VvBreadcrumb/index.d.ts +1 -1
  26. package/dist/components/VvButton/VvButton.es.js +720 -261
  27. package/dist/components/VvButton/VvButton.umd.js +1 -1
  28. package/dist/components/VvButton/VvButton.vue.d.ts +54 -54
  29. package/dist/components/VvButton/index.d.ts +30 -75
  30. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +296 -49
  31. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  32. package/dist/components/VvButtonGroup/VvButtonGroup.vue.d.ts +2 -2
  33. package/dist/components/VvButtonGroup/index.d.ts +1 -1
  34. package/dist/components/VvCard/VvCard.es.js +60 -28
  35. package/dist/components/VvCard/VvCard.umd.js +1 -1
  36. package/dist/components/VvCheckbox/VvCheckbox.es.js +630 -172
  37. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  38. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +4 -4
  39. package/dist/components/VvCheckbox/index.d.ts +6 -6
  40. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +736 -228
  41. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  42. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +9 -9
  43. package/dist/components/VvCheckboxGroup/index.d.ts +4 -4
  44. package/dist/components/VvCombobox/VvCombobox.es.js +1673 -768
  45. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  46. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +159 -61
  47. package/dist/components/VvCombobox/index.d.ts +54 -23
  48. package/dist/components/VvDialog/VvDialog.es.js +426 -115
  49. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  50. package/dist/components/VvDialog/VvDialog.vue.d.ts +12 -3
  51. package/dist/components/VvDialog/index.d.ts +4 -1
  52. package/dist/components/VvDropdown/VvDropdown.es.js +504 -190
  53. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  54. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +114 -42
  55. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +61 -0
  56. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +52 -0
  57. package/dist/components/VvDropdown/index.d.ts +35 -14
  58. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +454 -0
  59. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -0
  60. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +48 -18
  61. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  62. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +361 -0
  63. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -0
  64. package/dist/components/VvIcon/VvIcon.es.js +116 -52
  65. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  66. package/dist/components/VvIcon/VvIcon.vue.d.ts +7 -7
  67. package/dist/components/VvIcon/index.d.ts +2 -2
  68. package/dist/components/VvInputText/VvInputPasswordAction.d.ts +2 -2
  69. package/dist/components/VvInputText/VvInputStepAction.d.ts +1 -1
  70. package/dist/components/VvInputText/VvInputText.es.js +1054 -376
  71. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  72. package/dist/components/VvInputText/VvInputText.vue.d.ts +107 -20
  73. package/dist/components/VvInputText/VvInputTextActions.d.ts +1 -1
  74. package/dist/components/VvInputText/index.d.ts +67 -3
  75. package/dist/components/VvProgress/VvProgress.es.js +254 -23
  76. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  77. package/dist/components/VvProgress/VvProgress.vue.d.ts +2 -2
  78. package/dist/components/VvProgress/index.d.ts +1 -1
  79. package/dist/components/VvRadio/VvRadio.es.js +568 -137
  80. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  81. package/dist/components/VvRadio/VvRadio.vue.d.ts +4 -4
  82. package/dist/components/VvRadio/index.d.ts +6 -6
  83. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +674 -193
  84. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  85. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +9 -9
  86. package/dist/components/VvRadioGroup/index.d.ts +4 -4
  87. package/dist/components/VvSelect/VvSelect.es.js +703 -251
  88. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  89. package/dist/components/VvSelect/VvSelect.vue.d.ts +24 -17
  90. package/dist/components/VvSelect/index.d.ts +8 -8
  91. package/dist/components/VvTextarea/VvTextarea.es.js +747 -272
  92. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  93. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +21 -14
  94. package/dist/components/VvTextarea/index.d.ts +7 -7
  95. package/dist/components/VvTooltip/VvTooltip.es.js +252 -24
  96. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  97. package/dist/components/VvTooltip/VvTooltip.vue.d.ts +7 -7
  98. package/dist/components/VvTooltip/index.d.ts +2 -2
  99. package/dist/components/index.es.js +3676 -2007
  100. package/dist/components/index.umd.js +1 -1
  101. package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
  102. package/dist/composables/dropdown/useProvideDropdown.d.ts +3 -3
  103. package/dist/composables/group/useInjectedGroupState.d.ts +2 -2
  104. package/dist/composables/group/useProvideGroupState.d.ts +1 -1
  105. package/dist/composables/useComponentFocus.d.ts +1 -1
  106. package/dist/composables/useComponentIcon.d.ts +7 -7
  107. package/dist/composables/useDebouncedInput.d.ts +4 -1
  108. package/dist/composables/useDefaults.d.ts +2 -0
  109. package/dist/composables/useModifiers.d.ts +1 -1
  110. package/dist/composables/useOptions.d.ts +2 -2
  111. package/dist/composables/useTextCount.d.ts +3 -3
  112. package/dist/composables/useUniqueId.d.ts +1 -1
  113. package/dist/composables/useVolver.d.ts +1 -1
  114. package/dist/constants.d.ts +30 -0
  115. package/dist/directives/index.es.js +288 -0
  116. package/dist/directives/index.umd.js +1 -0
  117. package/dist/directives/v-tooltip.es.js +285 -0
  118. package/dist/directives/v-tooltip.umd.js +1 -0
  119. package/dist/icons.es.js +38 -23
  120. package/dist/icons.umd.js +1 -1
  121. package/dist/index.d.ts +0 -1
  122. package/dist/index.es.js +115 -3269
  123. package/dist/index.umd.js +1 -1
  124. package/dist/props/index.d.ts +215 -23
  125. package/dist/resolvers/unplugin.d.ts +14 -8
  126. package/dist/resolvers/unplugin.es.js +94 -33
  127. package/dist/resolvers/unplugin.umd.js +1 -1
  128. package/dist/stories/Combobox/Combobox.settings.d.ts +44 -0
  129. package/dist/stories/Dropdown/Dropdown.settings.d.ts +3 -2
  130. package/dist/stories/InputText/InputText.settings.d.ts +53 -0
  131. package/dist/stories/argTypes.d.ts +1 -1
  132. package/package.json +167 -63
  133. package/src/Volver.ts +60 -26
  134. package/src/assets/icons/detailed.json +1 -1
  135. package/src/assets/icons/normal.json +1 -1
  136. package/src/assets/icons/simple.json +1 -1
  137. package/src/components/VvAccordion/VvAccordion.vue +19 -22
  138. package/src/components/VvAccordion/index.ts +12 -4
  139. package/src/components/VvAccordionGroup/VvAccordionGroup.vue +19 -10
  140. package/src/components/VvAccordionGroup/index.ts +8 -0
  141. package/src/components/VvAction/VvAction.vue +144 -0
  142. package/src/components/VvAction/index.ts +5 -0
  143. package/src/components/VvBadge/VvBadge.vue +2 -2
  144. package/src/components/VvBadge/index.ts +1 -1
  145. package/src/components/VvBreadcrumb/VvBreadcrumb.vue +3 -3
  146. package/src/components/VvButton/VvButton.vue +41 -124
  147. package/src/components/VvButton/index.ts +16 -88
  148. package/src/components/VvButtonGroup/VvButtonGroup.vue +4 -7
  149. package/src/components/VvButtonGroup/index.ts +1 -1
  150. package/src/components/VvCard/VvCard.vue +2 -2
  151. package/src/components/VvCheckbox/VvCheckbox.vue +3 -7
  152. package/src/components/VvCheckbox/index.ts +11 -7
  153. package/src/components/VvCheckboxGroup/VvCheckboxGroup.vue +7 -10
  154. package/src/components/VvCheckboxGroup/index.ts +1 -1
  155. package/src/components/VvCombobox/VvCombobox.vue +85 -57
  156. package/src/components/VvCombobox/index.ts +12 -10
  157. package/src/components/VvDialog/VvDialog.vue +28 -11
  158. package/src/components/VvDialog/index.ts +5 -2
  159. package/src/components/VvDropdown/VvDropdown.vue +6 -5
  160. package/src/components/VvDropdown/VvDropdownAction.vue +46 -0
  161. package/src/components/VvDropdown/VvDropdownOption.vue +72 -0
  162. package/src/components/VvDropdown/index.ts +6 -11
  163. package/src/components/VvIcon/VvIcon.vue +3 -3
  164. package/src/components/VvIcon/index.ts +3 -3
  165. package/src/components/VvInputText/VvInputClearAction.ts +2 -2
  166. package/src/components/VvInputText/VvInputPasswordAction.ts +3 -4
  167. package/src/components/VvInputText/VvInputStepAction.ts +3 -2
  168. package/src/components/VvInputText/VvInputText.vue +128 -35
  169. package/src/components/VvInputText/VvInputTextActions.ts +5 -8
  170. package/src/components/VvInputText/index.ts +62 -1
  171. package/src/components/VvProgress/VvProgress.vue +2 -2
  172. package/src/components/VvProgress/index.ts +1 -1
  173. package/src/components/VvRadio/VvRadio.vue +3 -7
  174. package/src/components/VvRadio/index.ts +11 -7
  175. package/src/components/VvRadioGroup/VvRadioGroup.vue +7 -10
  176. package/src/components/VvRadioGroup/index.ts +1 -1
  177. package/src/components/VvSelect/VvSelect.vue +4 -4
  178. package/src/components/VvSelect/index.ts +3 -5
  179. package/src/components/VvTextarea/VvTextarea.vue +4 -4
  180. package/src/components/VvTextarea/index.ts +1 -1
  181. package/src/components/VvTooltip/VvTooltip.vue +2 -2
  182. package/src/components/VvTooltip/index.ts +3 -3
  183. package/src/composables/dropdown/useInjectDropdown.ts +2 -2
  184. package/src/composables/dropdown/useProvideDropdown.ts +9 -11
  185. package/src/composables/group/useInjectedGroupState.ts +1 -1
  186. package/src/composables/group/useProvideGroupState.ts +1 -1
  187. package/src/composables/useComponentIcon.ts +1 -1
  188. package/src/composables/useDebouncedInput.ts +10 -3
  189. package/src/composables/useDefaults.ts +89 -0
  190. package/src/composables/useModifiers.ts +8 -9
  191. package/src/composables/useOptions.ts +1 -1
  192. package/src/composables/useVolver.ts +2 -2
  193. package/src/constants.ts +36 -0
  194. package/src/directives/index.ts +1 -1
  195. package/src/directives/v-tooltip.ts +2 -2
  196. package/src/index.ts +0 -2
  197. package/src/props/index.ts +111 -19
  198. package/src/resolvers/unplugin.ts +96 -49
  199. package/src/stories/Accordion/Accordion.stories.mdx +8 -2
  200. package/src/stories/Accordion/Accordion.test.ts +21 -15
  201. package/src/stories/Accordion/AccordionSlots.stories.mdx +8 -8
  202. package/src/stories/AccordionGroup/AccordionGroup.stories.mdx +17 -1
  203. package/src/stories/AccordionGroup/AccordionGroup.test.ts +18 -12
  204. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +3 -2
  205. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +2 -1
  206. package/src/stories/Button/Button.stories.mdx +4 -2
  207. package/src/stories/Button/Button.test.ts +3 -1
  208. package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
  209. package/src/stories/Button/ButtonSlots.stories.mdx +8 -7
  210. package/src/stories/Button/ButtonState.stories.mdx +2 -11
  211. package/src/stories/Card/Card.stories.mdx +2 -1
  212. package/src/stories/Checkbox/Checkbox.stories.mdx +2 -1
  213. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +2 -1
  214. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +2 -1
  215. package/src/stories/Combobox/Combobox.settings.ts +44 -0
  216. package/src/stories/Combobox/Combobox.stories.mdx +40 -1
  217. package/src/stories/Dialog/Dialog.stories.mdx +2 -1
  218. package/src/stories/Dropdown/Dropdown.settings.ts +3 -2
  219. package/src/stories/Dropdown/Dropdown.stories.mdx +14 -12
  220. package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +56 -0
  221. package/src/stories/Dropdown/DropdownSlots.stories.mdx +14 -13
  222. package/src/stories/Icon/Icon.stories.mdx +2 -1
  223. package/src/stories/Icon/IconsCollection.stories.mdx +2 -1
  224. package/src/stories/InputText/InputText.settings.ts +53 -0
  225. package/src/stories/InputText/InputText.stories.mdx +42 -1
  226. package/src/stories/InputText/InputText.test.ts +5 -2
  227. package/src/stories/Progress/Progress.stories.mdx +2 -1
  228. package/src/stories/Radio/Radio.stories.mdx +2 -1
  229. package/src/stories/RadioGroup/RadioGroup.stories.mdx +2 -1
  230. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +2 -1
  231. package/src/stories/Select/Select.stories.mdx +2 -1
  232. package/src/stories/Textarea/Textarea.stories.mdx +2 -1
  233. package/src/stories/Tooltip/Tooltip.stories.mdx +2 -1
  234. package/src/stories/Tooltip/TooltipDirective.stories.mdx +2 -1
  235. package/src/stories/argTypes.ts +2 -2
  236. package/src/types/group.d.ts +5 -0
@@ -125,7 +125,7 @@ import { argTypes, defaultArgs } from './Button.settings'
125
125
  },
126
126
  template: /*html*/ `
127
127
  <div class="bg-black p-md">
128
- <vv-button v-bind="args" />
128
+ <vv-button v-bind="args" data-testId="element" />
129
129
  </div>
130
130
  `,
131
131
  }
@@ -158,7 +158,7 @@ import { argTypes, defaultArgs } from './Button.settings'
158
158
  },
159
159
  template: /*html*/ `
160
160
  <div class="bg-white p-md">
161
- <vv-button v-bind="args" />
161
+ <vv-button v-bind="args" data-testId="element" />
162
162
  </div>
163
163
  `,
164
164
  }
@@ -46,11 +46,12 @@ import { argTypes, defaultArgs } from './Button.settings'
46
46
  return { args }
47
47
  },
48
48
  components: { VvButton, VvBadge },
49
- template: /*html*/ `<vv-button v-bind="args">
50
- <template #before>
51
- <vv-badge value="12" modifiers="danger" />
52
- </template>
53
- </vv-button>`,
49
+ template: /*html*/ `
50
+ <vv-button v-bind="args" data-testId="element">
51
+ <template #before>
52
+ <vv-badge value="12" modifiers="danger" />
53
+ </template>
54
+ </vv-button>`,
54
55
  }
55
56
  }}
56
57
  </Story>
@@ -78,7 +79,7 @@ import { argTypes, defaultArgs } from './Button.settings'
78
79
  },
79
80
  components: { VvButton, VvBadge },
80
81
  template: /*html*/ `
81
- <vv-button v-bind="args">
82
+ <vv-button v-bind="args" data-testId="element">
82
83
  <template #after>
83
84
  <vv-badge value="12" modifiers="danger" />
84
85
  </template>
@@ -103,7 +104,7 @@ import { argTypes, defaultArgs } from './Button.settings'
103
104
  return { args }
104
105
  },
105
106
  template: /*html*/ `
106
- <vv-button v-bind="args">
107
+ <vv-button v-bind="args" data-testId="element">
107
108
  <template #label>
108
109
  Label <em class="italic">slot!</em>
109
110
  </template>
@@ -19,11 +19,7 @@ import { argTypes, defaultArgs } from './Button.settings'
19
19
  },
20
20
  },
21
21
  }}
22
- play={async (ctx) => {
23
- defaultTest(ctx, {
24
- className: 'vv-button--active',
25
- })
26
- }}
22
+ play={defaultTest}
27
23
  >
28
24
  {Template.bind()}
29
25
  </Story>
@@ -35,7 +31,6 @@ import { argTypes, defaultArgs } from './Button.settings'
35
31
  args={{
36
32
  pressed: true,
37
33
  label: 'Pressed button',
38
- modifiers: 'action-quiet',
39
34
  }}
40
35
  argTypes={{
41
36
  pressed: {
@@ -44,11 +39,7 @@ import { argTypes, defaultArgs } from './Button.settings'
44
39
  },
45
40
  },
46
41
  }}
47
- play={async (ctx) => {
48
- defaultTest(ctx, {
49
- className: 'vv-button--pressed',
50
- })
51
- }}
42
+ play={defaultTest}
52
43
  >
53
44
  {Template.bind()}
54
45
  </Story>
@@ -10,7 +10,8 @@ import { defaultArgs, argTypes } from './Card.settings'
10
10
  argTypes={argTypes}
11
11
  />
12
12
 
13
- export const Template = (args) => ({
13
+ export const Template = (args, { argTypes }) => ({
14
+ props: Object.keys(argTypes),
14
15
  components: { VvCard },
15
16
  setup() {
16
17
  return { args }
@@ -10,7 +10,8 @@ import { defaultTest } from './Checkbox.test'
10
10
  argTypes={argTypes}
11
11
  />
12
12
 
13
- export const Template = (args) => ({
13
+ export const Template = (args, { argTypes }) => ({
14
+ props: Object.keys(argTypes),
14
15
  components: { VvCheckbox },
15
16
  setup() {
16
17
  return { args }
@@ -10,7 +10,8 @@ import { defaultTest } from './CheckboxGroup.test'
10
10
  argTypes={argTypes}
11
11
  />
12
12
 
13
- export const Template = (args) => ({
13
+ export const Template = (args, { argTypes }) => ({
14
+ props: Object.keys(argTypes),
14
15
  components: { VvCheckboxGroup },
15
16
  setup() {
16
17
  return { args }
@@ -11,7 +11,8 @@ import { defaultTest } from './CheckboxGroup.test'
11
11
  argTypes={argTypes}
12
12
  />
13
13
 
14
- export const Template = (args) => ({
14
+ export const Template = (args, { argTypes }) => ({
15
+ props: Object.keys(argTypes),
15
16
  components: { VvCheckboxGroup, VvCheckbox },
16
17
  setup() {
17
18
  return { args }
@@ -208,6 +208,28 @@ export const argTypes = {
208
208
  },
209
209
  },
210
210
  },
211
+ 'dropdown::before': {
212
+ control: {
213
+ type: 'text',
214
+ },
215
+ table: {
216
+ category: 'Slots',
217
+ type: {
218
+ summary: 'html',
219
+ },
220
+ },
221
+ },
222
+ 'dropdown::after': {
223
+ control: {
224
+ type: 'text',
225
+ },
226
+ table: {
227
+ category: 'Slots',
228
+ type: {
229
+ summary: 'html',
230
+ },
231
+ },
232
+ },
211
233
  value: {
212
234
  control: {
213
235
  type: 'text',
@@ -230,4 +252,26 @@ export const argTypes = {
230
252
  },
231
253
  },
232
254
  },
255
+ 'no-options': {
256
+ control: {
257
+ type: 'text',
258
+ },
259
+ table: {
260
+ category: 'Slots',
261
+ type: {
262
+ summary: 'html',
263
+ },
264
+ },
265
+ },
266
+ 'no-results': {
267
+ control: {
268
+ type: 'text',
269
+ },
270
+ table: {
271
+ category: 'Slots',
272
+ type: {
273
+ summary: 'html',
274
+ },
275
+ },
276
+ },
233
277
  }
@@ -11,7 +11,8 @@ import { defaultArgs, argTypes } from './Combobox.settings'
11
11
 
12
12
  />
13
13
 
14
- export const Template = (args) => ({
14
+ export const Template = (args, { argTypes }) => ({
15
+ props: Object.keys(argTypes),
15
16
  components: { VvCombobox },
16
17
  setup() {
17
18
  return { args }
@@ -23,6 +24,8 @@ export const Template = (args) => ({
23
24
  },
24
25
  template: /*html*/ `
25
26
  <vv-combobox v-bind="args" v-model="inputValue" :data-testData="inputValue" data-testId="element">
27
+ <template #dropdown::before v-if="args['dropdown::before']"><div class="flex" v-html="args['dropdown::before']"></div></template>
28
+ <template #dropdown::after v-if="args['dropdown::after']"><div class="flex" v-html="args['dropdown::after']"></div></template>
26
29
  <template #before v-if="args.before"><div class="flex" v-html="args.before"></div></template>
27
30
  <template #after v-if="args.after"><div class="flex" v-html="args.after"></div></template>
28
31
  <template #hint v-if="args.hint"><span v-html="args.hint"></span></template>
@@ -283,3 +286,39 @@ export const Template = (args) => ({
283
286
  {Template.bind()}
284
287
  </Story>
285
288
  </Canvas>
289
+
290
+ <Canvas>
291
+ <Story
292
+ name="Size"
293
+ args={{
294
+ 'dropdown::before':
295
+ '<div class="bg-brand text-white flex-1 text-center uppercase">Before</div>',
296
+ 'dropdown::after':
297
+ '<div class="bg-brand text-white flex-1 text-center uppercase">After</div>',
298
+ options: Array.from({ length: 30 }, (_, i) => ({
299
+ label: `Option ${i + 1}`,
300
+ value: String(i + 1),
301
+ })),
302
+ }}
303
+ argTypes={{
304
+ 'dropdown::before': {
305
+ control: {
306
+ disable: true,
307
+ },
308
+ },
309
+ 'dropdown::after': {
310
+ control: {
311
+ disable: true,
312
+ },
313
+ },
314
+ options: {
315
+ control: {
316
+ disable: true,
317
+ },
318
+ },
319
+ }}
320
+ play={defaultTest}
321
+ >
322
+ {Template.bind()}
323
+ </Story>
324
+ </Canvas>
@@ -10,7 +10,8 @@ import { defaultArgs, argTypes } from './Dialog.settings'
10
10
  argTypes={argTypes}
11
11
  />
12
12
 
13
- export const Template = (args) => ({
13
+ export const Template = (args, { argTypes }) => ({
14
+ props: Object.keys(argTypes),
14
15
  components: { VvDialog },
15
16
  setup() {
16
17
  return { args }
@@ -1,4 +1,5 @@
1
- import { DROPDOWN_ROLES, VvDropdownProps } from '@/components/VvDropdown'
1
+ import { VvDropdownProps } from '@/components/VvDropdown'
2
+ import { DropdownRole } from '@/constants'
2
3
  import { DropdownArgTypes } from '../argTypes'
3
4
 
4
5
  export const defaultArgs = {
@@ -9,7 +10,7 @@ export const argTypes = {
9
10
  ...DropdownArgTypes,
10
11
  role: {
11
12
  description: 'Dropdown role',
12
- options: DROPDOWN_ROLES,
13
+ options: Object.values(DropdownRole),
13
14
  control: {
14
15
  type: 'select',
15
16
  },
@@ -1,8 +1,9 @@
1
1
  import { ref } from 'vue'
2
2
  import { Meta, Story } from '@storybook/addon-docs'
3
3
  import VvDropdown from '@/components/VvDropdown/VvDropdown.vue'
4
+ import VvDropdownAction from '@/components/VvDropdown/VvDropdownAction.vue'
5
+ import VvIcon from '@/components/VvIcon/VvIcon.vue'
4
6
  import VvButton from '@/components/VvButton/VvButton.vue'
5
- import VvDropdownItem from '@/components/VvDropdown/VvDropdownItem.vue'
6
7
  import { defaultTest } from './Dropdown.test'
7
8
  import { defaultArgs, argTypes } from './Dropdown.settings'
8
9
 
@@ -13,8 +14,9 @@ import { defaultArgs, argTypes } from './Dropdown.settings'
13
14
  args={defaultArgs}
14
15
  />
15
16
 
16
- export const Template = (args) => ({
17
- components: { VvDropdown, VvDropdownItem, VvButton },
17
+ export const Template = (args, { argTypes }) => ({
18
+ props: Object.keys(argTypes),
19
+ components: { VvDropdown, VvDropdownAction, VvIcon, VvButton },
18
20
  setup() {
19
21
  const expanded = ref(false)
20
22
  return { args, expanded }
@@ -48,15 +50,15 @@ export const Template = (args) => ({
48
50
  Toggle dropdown
49
51
  </vv-button>
50
52
  <template #items>
51
- <vv-dropdown-item>
52
- <vv-button modifiers="link" icon="add" label="Create" class="p-md w-full justify-start" />
53
- </vv-dropdown-item>
54
- <vv-dropdown-item>
55
- <vv-button modifiers="link" icon="edit" label="Update" class="p-md w-full justify-start" />
56
- </vv-dropdown-item>
57
- <vv-dropdown-item>
58
- <vv-button modifiers="link" icon="trash" label="Delete" class="p-md w-full justify-start" />
59
- </vv-dropdown-item>
53
+ <vv-dropdown-action>
54
+ <vv-icon name="add" /> Create
55
+ </vv-dropdown-action>
56
+ <vv-dropdown-action>
57
+ <vv-icon name="edit" /> Update
58
+ </vv-dropdown-action>
59
+ <vv-dropdown-action>
60
+ <vv-icon name="trash" /> Delete
61
+ </vv-dropdown-action>
60
62
  </template>
61
63
  </vv-dropdown>
62
64
  </div>
@@ -0,0 +1,56 @@
1
+ import { ref } from 'vue'
2
+ import { Meta, Story } from '@storybook/addon-docs'
3
+ import VvDropdown from '@/components/VvDropdown/VvDropdown.vue'
4
+ import VvDropdownAction from '@/components/VvDropdown/VvDropdownAction.vue'
5
+ import VvIcon from '@/components/VvIcon/VvIcon.vue'
6
+ import VvButton from '@/components/VvButton/VvButton.vue'
7
+ import { defaultTest } from './Dropdown.test'
8
+ import { defaultArgs, argTypes } from './Dropdown.settings'
9
+
10
+ <Meta
11
+ title="Components/Dropdown/Multilevel"
12
+ component={VvDropdown}
13
+ argTypes={argTypes}
14
+ args={defaultArgs}
15
+ />
16
+
17
+ export const Template = (args, { argTypes }) => ({
18
+ props: Object.keys(argTypes),
19
+ components: { VvDropdown, VvDropdownAction, VvIcon, VvButton },
20
+ setup() {
21
+ const expanded = ref(false)
22
+ return { args, expanded }
23
+ },
24
+ template: /* html */ `
25
+ <vv-dropdown v-model="expanded" v-bind="args">
26
+ <vv-button ref="toggle" class="absolute top-1/2 left-1/2 -translate-1/2" modifiers="full-bleed" data-testId="trigger">
27
+ Toggle dropdown
28
+ </vv-button>
29
+ <template #items>
30
+ <vv-dropdown-action>
31
+ <vv-icon name="edit" /> Update
32
+ </vv-dropdown-action>
33
+ <vv-dropdown-action>
34
+ <vv-icon name="trash" /> Delete
35
+ </vv-dropdown-action>
36
+ <vv-dropdown placement="right-start" offset="5" arrow>
37
+ <vv-dropdown-action>
38
+ <vv-icon name="more-vertical" /> More
39
+ </vv-dropdown-action>
40
+ <template #items>
41
+ <vv-dropdown-action>
42
+ <vv-icon name="add" /> Create
43
+ </vv-dropdown-action>
44
+ <vv-dropdown-action>
45
+ <vv-icon name="eye-on" /> Publish
46
+ </vv-dropdown-action>
47
+ </template>
48
+ </vv-dropdown>
49
+ </template>
50
+ </vv-dropdown>
51
+ `,
52
+ })
53
+
54
+ <Canvas>
55
+ <Story name="Default">{Template.bind()}</Story>
56
+ </Canvas>
@@ -1,8 +1,8 @@
1
1
  import { ref } from 'vue'
2
2
  import { Meta, Story } from '@storybook/addon-docs'
3
3
  import VvDropdown from '@/components/VvDropdown/VvDropdown.vue'
4
- import VvButton from '@/components/VvButton/VvButton.vue'
5
- import VvDropdownItem from '@/components/VvDropdown/VvDropdownItem.vue'
4
+ import VvIcon from '@/components/VvIcon/VvIcon.vue'
5
+ import VvDropdownAction from '@/components/VvDropdown/VvDropdownAction.vue'
6
6
  import { defaultTest } from './Dropdown.test'
7
7
  import { defaultArgs, argTypes } from './Dropdown.settings'
8
8
 
@@ -13,8 +13,9 @@ import { defaultArgs, argTypes } from './Dropdown.settings'
13
13
  args={defaultArgs}
14
14
  />
15
15
 
16
- export const Template = (args) => ({
17
- components: { VvDropdown, VvDropdownItem, VvButton },
16
+ export const Template = (args, { argTypes }) => ({
17
+ props: Object.keys(argTypes),
18
+ components: { VvDropdown, VvDropdownAction, VvIcon },
18
19
  setup() {
19
20
  const expanded = ref(false)
20
21
  return { args, expanded }
@@ -51,15 +52,15 @@ export const Template = (args) => ({
51
52
  </button>
52
53
  </template>
53
54
  <template #items>
54
- <vv-dropdown-item>
55
- <vv-button modifiers="link" icon="add" label="Create" class="p-md" />
56
- </vv-dropdown-item>
57
- <vv-dropdown-item>
58
- <vv-button modifiers="link" icon="edit" label="Update" class="p-md" />
59
- </vv-dropdown-item>
60
- <vv-dropdown-item>
61
- <vv-button modifiers="link" icon="trash" label="Delete" class="p-md" />
62
- </vv-dropdown-item>
55
+ <vv-dropdown-action>
56
+ <vv-icon name="add" /> Create
57
+ </vv-dropdown-action>
58
+ <vv-dropdown-action>
59
+ <vv-icon name="edit" /> Update
60
+ </vv-dropdown-action>
61
+ <vv-dropdown-action>
62
+ <vv-icon name="trash" /> Delete
63
+ </vv-dropdown-action>
63
64
  </template>
64
65
  <template #after v-if="args.after"><div v-html="args.after"></div></template>
65
66
  </vv-dropdown>
@@ -10,7 +10,8 @@ import NormalIcons from '@/assets/icons/normal.json'
10
10
  argTypes={argTypes}
11
11
  />
12
12
 
13
- export const Template = (args) => ({
13
+ export const Template = (args, { argTypes }) => ({
14
+ props: Object.keys(argTypes),
14
15
  components: { VvIcon },
15
16
  setup() {
16
17
  return { args }
@@ -11,7 +11,8 @@ import { defaultArgs, argTypes } from './Icon.settings'
11
11
  argTypes={argTypes}
12
12
  />
13
13
 
14
- export const Template = (args) => ({
14
+ export const Template = (args, { argTypes }) => ({
15
+ props: Object.keys(argTypes),
15
16
  components: { VvIcon },
16
17
  setup() {
17
18
  const allIcons = Object.keys(NormalIcons)
@@ -196,6 +196,59 @@ export const argTypes = {
196
196
  },
197
197
  },
198
198
  },
199
+ mask: {
200
+ description: 'Input mask, only for text type',
201
+ type: {
202
+ summary: 'string',
203
+ },
204
+ control: {
205
+ type: 'text',
206
+ },
207
+ },
208
+ maskEager: {
209
+ description: 'Show mask before typing',
210
+ type: {
211
+ summary: 'boolean',
212
+ },
213
+ table: {
214
+ defaultValue: {
215
+ summary: false,
216
+ },
217
+ },
218
+ },
219
+ maskReversed: {
220
+ description: 'Write typing reverse (ex. for numbers)',
221
+ type: {
222
+ summary: 'boolean',
223
+ },
224
+ table: {
225
+ defaultValue: {
226
+ summary: false,
227
+ },
228
+ },
229
+ },
230
+ maskTokens: {
231
+ description: 'Add mask custom tokens',
232
+ type: {
233
+ summary: 'Object',
234
+ },
235
+ table: {
236
+ defaultValue: {
237
+ summary: 'undefined',
238
+ },
239
+ },
240
+ },
241
+ maskTokensReplace: {
242
+ description: 'Replace default tokens',
243
+ type: {
244
+ summary: 'boolean',
245
+ },
246
+ table: {
247
+ defaultValue: {
248
+ summary: false,
249
+ },
250
+ },
251
+ },
199
252
  before: {
200
253
  control: {
201
254
  type: 'text',
@@ -11,7 +11,8 @@ import { Position } from '@/constants'
11
11
  argTypes={argTypes}
12
12
  />
13
13
 
14
- export const Template = (args) => ({
14
+ export const Template = (args, { argTypes }) => ({
15
+ props: Object.keys(argTypes),
15
16
  components: { VvInputText },
16
17
  setup() {
17
18
  return { args }
@@ -168,3 +169,43 @@ export const Template = (args) => ({
168
169
  {Template.bind()}
169
170
  </Story>
170
171
  </Canvas>
172
+
173
+ <Canvas>
174
+ <Story
175
+ name="Mask"
176
+ args={{
177
+ mask: '##-###-##',
178
+ }}
179
+ argTypes={{
180
+ mask: {
181
+ control: {
182
+ disable: true,
183
+ },
184
+ },
185
+ }}
186
+ play={defaultTest}
187
+ >
188
+ {Template.bind()}
189
+ </Story>
190
+ </Canvas>
191
+
192
+ <Canvas>
193
+ <Story
194
+ name="Unit"
195
+ args={{
196
+ unit: 'km',
197
+ autoWidth: true,
198
+ type: 'number',
199
+ }}
200
+ argTypes={{
201
+ unit: {
202
+ control: {
203
+ disable: true,
204
+ },
205
+ },
206
+ }}
207
+ play={defaultTest}
208
+ >
209
+ {Template.bind()}
210
+ </Story>
211
+ </Canvas>
@@ -4,7 +4,10 @@ import { sleep } from '@/test/sleep'
4
4
  import { within, userEvent } from '@storybook/testing-library'
5
5
  import { INPUT_TYPES, type InputType } from '@/components/VvInputText'
6
6
 
7
- const valueByType = (type: InputType) => {
7
+ const valueByType = (type: InputType, mask?: string) => {
8
+ if (mask) {
9
+ return '1234567'
10
+ }
8
11
  switch (type) {
9
12
  case INPUT_TYPES.TEXT:
10
13
  case INPUT_TYPES.PASSWORD:
@@ -42,7 +45,7 @@ export async function defaultTest({ canvasElement, args }: PlayAttributes) {
42
45
 
43
46
  // value
44
47
  if (!args.invalid && !args.disabled && !args.readonly) {
45
- const inputValue = valueByType(args.type)
48
+ const inputValue = valueByType(args.type, args.mask)
46
49
  if (inputValue) {
47
50
  await expect(input).toBeClicked()
48
51
  await userEvent.keyboard(inputValue)
@@ -10,7 +10,8 @@ import { defaultArgs, argTypes } from './Progress.settings'
10
10
  argTypes={argTypes}
11
11
  />
12
12
 
13
- export const Template = (args) => ({
13
+ export const Template = (args, { argTypes }) => ({
14
+ props: Object.keys(argTypes),
14
15
  components: { VvProgress },
15
16
  setup() {
16
17
  return { args }
@@ -10,7 +10,8 @@ import { defaultTest } from './Radio.test'
10
10
  argTypes={argTypes}
11
11
  />
12
12
 
13
- export const Template = (args) => ({
13
+ export const Template = (args, { argTypes }) => ({
14
+ props: Object.keys(argTypes),
14
15
  components: { VvRadio },
15
16
  setup() {
16
17
  return { args }
@@ -10,7 +10,8 @@ import { defaultTest } from './RadioGroup.test'
10
10
  argTypes={argTypes}
11
11
  />
12
12
 
13
- export const Template = (args) => ({
13
+ export const Template = (args, { argTypes }) => ({
14
+ props: Object.keys(argTypes),
14
15
  components: { VvRadioGroup },
15
16
  setup() {
16
17
  return { args }
@@ -11,7 +11,8 @@ import { defaultTest } from './RadioGroup.test'
11
11
  argTypes={argTypes}
12
12
  />
13
13
 
14
- export const Template = (args) => ({
14
+ export const Template = (args, { argTypes }) => ({
15
+ props: Object.keys(argTypes),
15
16
  components: { VvRadioGroup, VvRadio },
16
17
  setup() {
17
18
  return { args }
@@ -10,7 +10,8 @@ import { defaultArgs, argTypes } from './Select.settings'
10
10
  argTypes={argTypes}
11
11
  />
12
12
 
13
- export const Template = (args) => ({
13
+ export const Template = (args, { argTypes }) => ({
14
+ props: Object.keys(argTypes),
14
15
  components: { VvSelect },
15
16
  setup() {
16
17
  return { args }
@@ -10,7 +10,8 @@ import { defaultTest } from './Textarea.test'
10
10
  argTypes={argTypes}
11
11
  />
12
12
 
13
- export const Template = (args) => ({
13
+ export const Template = (args, { argTypes }) => ({
14
+ props: Object.keys(argTypes),
14
15
  components: { VvTextarea },
15
16
  setup() {
16
17
  return { args }
@@ -11,7 +11,8 @@ import { defaultTest } from './Tooltip.test'
11
11
  argTypes={argTypes}
12
12
  />
13
13
 
14
- export const Template = (args) => ({
14
+ export const Template = (args, { argTypes }) => ({
15
+ props: Object.keys(argTypes),
15
16
  components: { VvTooltip, VvButton },
16
17
  setup() {
17
18
  return { args }