@volverjs/ui-vue 0.0.3 → 0.0.4

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 (145) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +52 -13
  3. package/dist/Volver.d.ts +5 -1
  4. package/dist/components/VvAccordion/VvAccordion.es.js +113 -66
  5. package/dist/components/VvAccordion/VvAccordion.umd.js +1 -1
  6. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +159 -101
  7. package/dist/components/VvAccordionGroup/VvAccordionGroup.umd.js +1 -1
  8. package/dist/components/VvAction/VvAction.es.js +170 -0
  9. package/dist/components/VvAction/VvAction.umd.js +1 -0
  10. package/dist/components/VvAction/VvAction.vue.d.ts +63 -0
  11. package/dist/components/VvAction/index.d.ts +24 -0
  12. package/dist/components/VvBadge/VvBadge.es.js +86 -16
  13. package/dist/components/VvBadge/VvBadge.umd.js +1 -1
  14. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +97 -41
  15. package/dist/components/VvBreadcrumb/VvBreadcrumb.umd.js +1 -1
  16. package/dist/components/VvButton/VvButton.es.js +434 -251
  17. package/dist/components/VvButton/VvButton.umd.js +1 -1
  18. package/dist/components/VvButton/VvButton.vue.d.ts +50 -50
  19. package/dist/components/VvButton/index.d.ts +22 -67
  20. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +118 -43
  21. package/dist/components/VvButtonGroup/VvButtonGroup.umd.js +1 -1
  22. package/dist/components/VvCard/VvCard.es.js +38 -25
  23. package/dist/components/VvCard/VvCard.umd.js +1 -1
  24. package/dist/components/VvCheckbox/VvCheckbox.es.js +334 -154
  25. package/dist/components/VvCheckbox/VvCheckbox.umd.js +1 -1
  26. package/dist/components/VvCheckbox/VvCheckbox.vue.d.ts +2 -2
  27. package/dist/components/VvCheckbox/index.d.ts +1 -1
  28. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +401 -204
  29. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.umd.js +1 -1
  30. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.vue.d.ts +2 -2
  31. package/dist/components/VvCheckboxGroup/index.d.ts +1 -1
  32. package/dist/components/VvCombobox/VvCombobox.es.js +950 -594
  33. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  34. package/dist/components/VvCombobox/VvCombobox.vue.d.ts +54 -30
  35. package/dist/components/VvCombobox/index.d.ts +18 -13
  36. package/dist/components/VvDialog/VvDialog.es.js +139 -64
  37. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  38. package/dist/components/VvDropdown/VvDropdown.es.js +276 -158
  39. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  40. package/dist/components/VvDropdown/VvDropdown.vue.d.ts +9 -9
  41. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +61 -0
  42. package/dist/components/VvDropdown/VvDropdownOption.vue.d.ts +52 -0
  43. package/dist/components/VvDropdown/index.d.ts +6 -9
  44. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +251 -0
  45. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -0
  46. package/dist/components/VvDropdownItem/VvDropdownItem.es.js +30 -15
  47. package/dist/components/VvDropdownItem/VvDropdownItem.umd.js +1 -1
  48. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +176 -0
  49. package/dist/components/VvDropdownOption/VvDropdownOption.umd.js +1 -0
  50. package/dist/components/VvIcon/VvIcon.es.js +48 -32
  51. package/dist/components/VvIcon/VvIcon.umd.js +1 -1
  52. package/dist/components/VvInputText/VvInputText.es.js +508 -344
  53. package/dist/components/VvInputText/VvInputText.umd.js +1 -1
  54. package/dist/components/VvInputText/VvInputText.vue.d.ts +11 -4
  55. package/dist/components/VvInputText/index.d.ts +13 -2
  56. package/dist/components/VvProgress/VvProgress.es.js +90 -20
  57. package/dist/components/VvProgress/VvProgress.umd.js +1 -1
  58. package/dist/components/VvRadio/VvRadio.es.js +305 -125
  59. package/dist/components/VvRadio/VvRadio.umd.js +1 -1
  60. package/dist/components/VvRadio/VvRadio.vue.d.ts +2 -2
  61. package/dist/components/VvRadio/index.d.ts +1 -1
  62. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +372 -175
  63. package/dist/components/VvRadioGroup/VvRadioGroup.umd.js +1 -1
  64. package/dist/components/VvRadioGroup/VvRadioGroup.vue.d.ts +2 -2
  65. package/dist/components/VvRadioGroup/index.d.ts +1 -1
  66. package/dist/components/VvSelect/VvSelect.es.js +371 -216
  67. package/dist/components/VvSelect/VvSelect.umd.js +1 -1
  68. package/dist/components/VvSelect/VvSelect.vue.d.ts +11 -4
  69. package/dist/components/VvSelect/index.d.ts +5 -5
  70. package/dist/components/VvTextarea/VvTextarea.es.js +408 -244
  71. package/dist/components/VvTextarea/VvTextarea.umd.js +1 -1
  72. package/dist/components/VvTextarea/VvTextarea.vue.d.ts +11 -4
  73. package/dist/components/VvTextarea/index.d.ts +5 -5
  74. package/dist/components/VvTooltip/VvTooltip.es.js +88 -18
  75. package/dist/components/VvTooltip/VvTooltip.umd.js +1 -1
  76. package/dist/components/index.es.js +1913 -1521
  77. package/dist/components/index.umd.js +1 -1
  78. package/dist/composables/dropdown/useInjectDropdown.d.ts +1 -1
  79. package/dist/composables/dropdown/useProvideDropdown.d.ts +2 -2
  80. package/dist/constants.d.ts +30 -0
  81. package/dist/directives/index.es.js +128 -0
  82. package/dist/directives/index.umd.js +1 -0
  83. package/dist/directives/v-tooltip.es.js +126 -0
  84. package/dist/directives/v-tooltip.umd.js +1 -0
  85. package/dist/icons.es.js +3 -3
  86. package/dist/icons.umd.js +1 -1
  87. package/dist/index.es.js +2102 -1761
  88. package/dist/index.umd.js +1 -1
  89. package/dist/props/index.d.ts +179 -11
  90. package/dist/resolvers/unplugin.d.ts +8 -8
  91. package/dist/resolvers/unplugin.es.js +51 -30
  92. package/dist/resolvers/unplugin.umd.js +1 -1
  93. package/dist/stories/Combobox/Combobox.settings.d.ts +44 -0
  94. package/dist/stories/Dropdown/Dropdown.settings.d.ts +3 -2
  95. package/package.json +60 -34
  96. package/src/Volver.ts +12 -5
  97. package/src/assets/icons/detailed.json +1 -1
  98. package/src/assets/icons/normal.json +1 -1
  99. package/src/assets/icons/simple.json +1 -1
  100. package/src/components/VvAction/VvAction.vue +144 -0
  101. package/src/components/VvAction/index.ts +5 -0
  102. package/src/components/VvButton/VvButton.vue +31 -114
  103. package/src/components/VvButton/index.ts +6 -79
  104. package/src/components/VvCombobox/VvCombobox.vue +54 -42
  105. package/src/components/VvCombobox/index.ts +11 -9
  106. package/src/components/VvDropdown/VvDropdownAction.vue +44 -0
  107. package/src/components/VvDropdown/VvDropdownOption.vue +65 -0
  108. package/src/components/VvDropdown/index.ts +4 -9
  109. package/src/components/VvSelect/index.ts +2 -4
  110. package/src/composables/dropdown/useInjectDropdown.ts +1 -1
  111. package/src/composables/dropdown/useProvideDropdown.ts +7 -9
  112. package/src/composables/useModifiers.ts +4 -7
  113. package/src/constants.ts +36 -0
  114. package/src/props/index.ts +106 -14
  115. package/src/resolvers/unplugin.ts +81 -48
  116. package/src/stories/Accordion/AccordionSlots.stories.mdx +2 -2
  117. package/src/stories/AccordionGroup/AccordionGroupSlots.stories.mdx +2 -1
  118. package/src/stories/Breadcrumb/Breadcrumb.stories.mdx +2 -1
  119. package/src/stories/Button/Button.stories.mdx +4 -2
  120. package/src/stories/Button/Button.test.ts +3 -1
  121. package/src/stories/Button/ButtonModifiers.stories.mdx +2 -2
  122. package/src/stories/Button/ButtonSlots.stories.mdx +8 -7
  123. package/src/stories/Button/ButtonState.stories.mdx +2 -11
  124. package/src/stories/Card/Card.stories.mdx +2 -1
  125. package/src/stories/Checkbox/Checkbox.stories.mdx +2 -1
  126. package/src/stories/CheckboxGroup/CheckboxGroup.stories.mdx +2 -1
  127. package/src/stories/CheckboxGroup/CheckboxGroupSlots.stories.mdx +2 -1
  128. package/src/stories/Combobox/Combobox.settings.ts +44 -0
  129. package/src/stories/Combobox/Combobox.stories.mdx +40 -1
  130. package/src/stories/Dialog/Dialog.stories.mdx +2 -1
  131. package/src/stories/Dropdown/Dropdown.settings.ts +3 -2
  132. package/src/stories/Dropdown/Dropdown.stories.mdx +14 -12
  133. package/src/stories/Dropdown/DropdownMultilevel.stories.mdx +56 -0
  134. package/src/stories/Dropdown/DropdownSlots.stories.mdx +14 -13
  135. package/src/stories/Icon/Icon.stories.mdx +2 -1
  136. package/src/stories/Icon/IconsCollection.stories.mdx +2 -1
  137. package/src/stories/InputText/InputText.stories.mdx +2 -1
  138. package/src/stories/Progress/Progress.stories.mdx +2 -1
  139. package/src/stories/Radio/Radio.stories.mdx +2 -1
  140. package/src/stories/RadioGroup/RadioGroup.stories.mdx +2 -1
  141. package/src/stories/RadioGroup/RadioGroupSlots.stories.mdx +2 -1
  142. package/src/stories/Select/Select.stories.mdx +2 -1
  143. package/src/stories/Textarea/Textarea.stories.mdx +2 -1
  144. package/src/stories/Tooltip/Tooltip.stories.mdx +2 -1
  145. package/src/stories/Tooltip/TooltipDirective.stories.mdx +2 -1
@@ -5,7 +5,9 @@ import { expect } from '@/test/expect'
5
5
  export async function defaultTest(
6
6
  { canvasElement, args }: PlayAttributes = {} as PlayAttributes,
7
7
  ) {
8
- const element = await within(canvasElement).findByRole('button')
8
+ const element = (await within(canvasElement).findByTestId(
9
+ 'element',
10
+ )) as HTMLElement
9
11
 
10
12
  const modifiers =
11
13
  !args.modifiers || Array.isArray(args.modifiers)
@@ -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)
@@ -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 }
@@ -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 }
@@ -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 }