@volverjs/ui-vue 0.0.9-beta.2 → 0.0.9-beta.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 (78) hide show
  1. package/dist/components/VvAccordion/VvAccordion.es.js +7 -0
  2. package/dist/components/VvAccordionGroup/VvAccordionGroup.es.js +7 -0
  3. package/dist/components/VvAction/VvAction.es.js +9 -1
  4. package/dist/components/VvAction/VvAction.umd.js +1 -1
  5. package/dist/components/VvAction/VvAction.vue.d.ts +9 -0
  6. package/dist/components/VvAction/index.d.ts +4 -0
  7. package/dist/components/VvAlert/VvAlert.es.js +7 -0
  8. package/dist/components/VvAlertGroup/VvAlertGroup.es.js +7 -0
  9. package/dist/components/VvAvatar/VvAvatar.es.js +7 -0
  10. package/dist/components/VvAvatarGroup/VvAvatarGroup.es.js +7 -0
  11. package/dist/components/VvBadge/VvBadge.es.js +7 -0
  12. package/dist/components/VvBreadcrumb/VvBreadcrumb.es.js +7 -0
  13. package/dist/components/VvButton/VvButton.es.js +11 -2
  14. package/dist/components/VvButton/VvButton.umd.js +1 -1
  15. package/dist/components/VvButton/VvButton.vue.d.ts +9 -0
  16. package/dist/components/VvButton/index.d.ts +4 -0
  17. package/dist/components/VvButtonGroup/VvButtonGroup.es.js +7 -0
  18. package/dist/components/VvCard/VvCard.es.js +7 -0
  19. package/dist/components/VvCheckbox/VvCheckbox.es.js +7 -0
  20. package/dist/components/VvCheckboxGroup/VvCheckboxGroup.es.js +7 -0
  21. package/dist/components/VvCombobox/VvCombobox.es.js +17 -4
  22. package/dist/components/VvCombobox/VvCombobox.umd.js +1 -1
  23. package/dist/components/VvDialog/VvDialog.es.js +22 -15
  24. package/dist/components/VvDialog/VvDialog.umd.js +1 -1
  25. package/dist/components/VvDropdown/VvDropdown.es.js +13 -2
  26. package/dist/components/VvDropdown/VvDropdown.umd.js +1 -1
  27. package/dist/components/VvDropdown/VvDropdownAction.vue.d.ts +9 -0
  28. package/dist/components/VvDropdownAction/VvDropdownAction.es.js +9 -1
  29. package/dist/components/VvDropdownAction/VvDropdownAction.umd.js +1 -1
  30. package/dist/components/VvDropdownOptgroup/VvDropdownOptgroup.es.js +7 -0
  31. package/dist/components/VvDropdownOption/VvDropdownOption.es.js +7 -0
  32. package/dist/components/VvInputText/VvInputText.es.js +7 -0
  33. package/dist/components/VvNav/VvNav.es.js +10 -2
  34. package/dist/components/VvNav/VvNav.umd.js +1 -1
  35. package/dist/components/VvNav/index.d.ts +1 -1
  36. package/dist/components/VvProgress/VvProgress.es.js +7 -0
  37. package/dist/components/VvRadio/VvRadio.es.js +7 -0
  38. package/dist/components/VvRadioGroup/VvRadioGroup.es.js +7 -0
  39. package/dist/components/VvSelect/VvSelect.es.js +7 -0
  40. package/dist/components/VvTab/VvTab.es.js +10 -2
  41. package/dist/components/VvTab/VvTab.umd.js +1 -1
  42. package/dist/components/VvTextarea/VvTextarea.es.js +7 -0
  43. package/dist/components/VvTooltip/VvTooltip.es.js +7 -0
  44. package/dist/components/index.d.ts +5 -0
  45. package/dist/components/index.es.js +728 -322
  46. package/dist/components/index.umd.js +1 -1
  47. package/dist/directives/index.es.js +7 -0
  48. package/dist/directives/v-tooltip.es.js +7 -0
  49. package/dist/icons.es.js +3 -3
  50. package/dist/icons.umd.js +1 -1
  51. package/dist/props/index.d.ts +7 -0
  52. package/dist/stories/AccordionGroup/AccordionGroupSlots.stories.d.ts +43 -258
  53. package/dist/stories/Alert/Alert.settings.d.ts +3 -7
  54. package/dist/stories/Button/Button.settings.d.ts +3 -13
  55. package/dist/stories/Combobox/Combobox.settings.d.ts +3 -7
  56. package/dist/stories/Nav/Nav.settings.d.ts +3 -21
  57. package/package.json +28 -28
  58. package/src/assets/icons/detailed.json +1 -1
  59. package/src/assets/icons/normal.json +1 -1
  60. package/src/assets/icons/simple.json +1 -1
  61. package/src/components/VvAction/VvAction.vue +2 -1
  62. package/src/components/VvButton/VvButton.vue +1 -0
  63. package/src/components/VvDialog/VvDialog.vue +14 -14
  64. package/src/components/VvDropdown/VvDropdown.vue +6 -2
  65. package/src/components/VvNav/VvNav.vue +1 -1
  66. package/src/components/VvNav/index.ts +1 -1
  67. package/src/components/index.ts +5 -0
  68. package/src/props/index.ts +7 -0
  69. package/src/stories/Alert/Alert.settings.ts +3 -1
  70. package/src/stories/Button/Button.settings.ts +5 -3
  71. package/src/stories/Combobox/Combobox.settings.ts +4 -1
  72. package/src/stories/Nav/Nav.settings.ts +3 -1
  73. package/src/stories/Tab/Tab.stories.ts +3 -3
  74. package/src/stories/Textarea/TextareaLength.stories.ts +1 -1
  75. /package/dist/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue.d.ts +0 -0
  76. /package/dist/components/{VvNavSeparator → VvNav}/VvNavSeparator.d.ts +0 -0
  77. /package/src/components/{VvNavItemTitle → VvNav}/VvNavItemTitle.vue +0 -0
  78. /package/src/components/{VvNavSeparator → VvNav}/VvNavSeparator.ts +0 -0
@@ -66,7 +66,8 @@
66
66
  const hasProps = computed(() => {
67
67
  const toReturn = {
68
68
  ...dropdownAria?.value,
69
- 'aria-pressed': pressed.value ? true : undefined,
69
+ ariaPressed: pressed.value ? true : undefined,
70
+ ariaLabel: props.ariaLabel,
70
71
  role: role?.value,
71
72
  }
72
73
  switch (hasTag.value) {
@@ -118,6 +118,7 @@
118
118
  href,
119
119
  target,
120
120
  rel,
121
+ ariaLabel,
121
122
  }"
122
123
  :id="hasId"
123
124
  ref="element"
@@ -15,16 +15,16 @@
15
15
  const dialogEl: Ref<HTMLDialogElement | undefined> = ref()
16
16
 
17
17
  // data
18
+ const modelValue = useVModel(props, 'modelValue', emit)
18
19
  const localModelValue = ref(false)
19
- const modelValue = computed({
20
- get() {
21
- return props.modelValue ?? localModelValue.value
22
- },
23
- set(value) {
24
- if (props.modelValue === undefined) {
25
- localModelValue.value = value
20
+ const opened = computed({
21
+ get: () => modelValue.value ?? localModelValue.value,
22
+ set: (newValue) => {
23
+ if (modelValue.value === undefined) {
24
+ localModelValue.value = newValue
25
+ return
26
26
  }
27
- emit('update:modelValue', value)
27
+ modelValue.value = newValue
28
28
  },
29
29
  })
30
30
 
@@ -80,24 +80,24 @@
80
80
 
81
81
  // methods
82
82
  onClickOutside(modalWrapper, () => {
83
- if (!props.keepOpen) {
84
- modelValue.value = false
83
+ if (!props.keepOpen && opened.value) {
84
+ opened.value = false
85
85
  }
86
86
  })
87
87
 
88
88
  function close() {
89
- modelValue.value = false
89
+ opened.value = false
90
90
  }
91
91
 
92
92
  function open() {
93
- modelValue.value = true
93
+ opened.value = true
94
94
  }
95
95
 
96
96
  defineExpose({ close, open })
97
97
 
98
98
  // keyboard
99
99
  onKeyStroke('Escape', (e) => {
100
- if (modelValue.value) {
100
+ if (opened.value) {
101
101
  e.preventDefault()
102
102
  close()
103
103
  }
@@ -107,7 +107,7 @@
107
107
  <template>
108
108
  <Transition :name="transitioName" v-on="dialogTransitionHandlers">
109
109
  <dialog
110
- v-show="modelValue"
110
+ v-show="opened"
111
111
  v-bind="dialogAttrs"
112
112
  ref="dialogEl"
113
113
  :class="dialogClass"
@@ -161,7 +161,11 @@
161
161
  referenceEl,
162
162
  floatingEl,
163
163
  {
164
- whileElementsMounted: autoUpdate,
164
+ whileElementsMounted: (...args) => {
165
+ return autoUpdate(...args, {
166
+ animationFrame: props.strategy === 'fixed',
167
+ })
168
+ },
165
169
  placement: computed(() => props.placement),
166
170
  strategy: computed(() => props.strategy),
167
171
  middleware,
@@ -266,7 +270,7 @@
266
270
  onClickOutside(
267
271
  floatingEl,
268
272
  () => {
269
- if (!props.keepOpen) {
273
+ if (!props.keepOpen && expanded.value) {
270
274
  expanded.value = false
271
275
  }
272
276
  },
@@ -55,7 +55,7 @@
55
55
  disabled: navItem.disabled,
56
56
  }"
57
57
  class="vv-nav__item-label"
58
- v-on="navItem.on || {}"
58
+ v-on="navItem.on"
59
59
  @click="onClick(navItem)"
60
60
  >
61
61
  {{ navItem.title }}
@@ -6,7 +6,7 @@ export type NavItem = {
6
6
  to?: string | { [key: string]: unknown }
7
7
  href?: string
8
8
  disabled?: boolean
9
- on: () => void
9
+ on?: Record<string, () => void>
10
10
  }
11
11
 
12
12
  export const VvNavProps = {
@@ -1,5 +1,7 @@
1
1
  export { default as VvAccordion } from './VvAccordion/VvAccordion.vue'
2
2
  export { default as VvAccordionGroup } from './VvAccordionGroup/VvAccordionGroup.vue'
3
+ export { default as VvAction } from './VvAction/VvAction.vue'
4
+ export { default as VvAlert } from './VvAlert/VvAlert.vue'
3
5
  export { default as VvBadge } from './VvBadge/VvBadge.vue'
4
6
  export { default as VvBreadcrumb } from './VvBreadcrumb/VvBreadcrumb.vue'
5
7
  export { default as VvButton } from './VvButton/VvButton.vue'
@@ -12,8 +14,11 @@ export { default as VvDialog } from './VvDialog/VvDialog.vue'
12
14
  export { default as VvDropdown } from './VvDropdown/VvDropdown.vue'
13
15
  export { default as VvIcon } from './VvIcon/VvIcon.vue'
14
16
  export { default as VvInputText } from './VvInputText/VvInputText.vue'
17
+ export { default as VvNav } from './VvNav/VvNav.vue'
15
18
  export { default as VvProgress } from './VvProgress/VvProgress.vue'
16
19
  export { default as VvRadio } from './VvRadio/VvRadio.vue'
17
20
  export { default as VvRadioGroup } from './VvRadioGroup/VvRadioGroup.vue'
18
21
  export { default as VvSelect } from './VvSelect/VvSelect.vue'
22
+ export { default as VvTab } from './VvTab/VvTab.vue'
19
23
  export { default as VvTextarea } from './VvTextarea/VvTextarea.vue'
24
+ export { default as VvTooltip } from './VvTooltip/VvTooltip.vue'
@@ -457,4 +457,11 @@ export const ActionProps = {
457
457
  validator: (value: ButtonType) =>
458
458
  Object.values(ButtonType).includes(value),
459
459
  },
460
+ /**
461
+ * Button aria-label
462
+ */
463
+ ariaLabel: {
464
+ type: String,
465
+ default: undefined,
466
+ },
460
467
  }
@@ -1,7 +1,9 @@
1
+ import type { Meta } from '@storybook/vue3'
2
+ import type { VvAlert } from '@/components'
1
3
  import { IconArgTypes } from '../argTypes'
2
4
  import { ModifiersArgTypes } from '../argTypes'
3
5
 
4
- export const defaultArgs = {
6
+ export const defaultArgs: Meta<typeof VvAlert>['args'] = {
5
7
  title: 'Alert title!',
6
8
  content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
7
9
  dismissable: false,
@@ -1,3 +1,5 @@
1
+ import type { Meta } from '@storybook/vue3'
2
+ import type { VvButton } from '@/components'
1
3
  import {
2
4
  DefaultSlotArgTypes,
3
5
  ModifiersArgTypes,
@@ -7,7 +9,7 @@ import {
7
9
  } from '@/stories/argTypes'
8
10
  import normal from '@/assets/icons/normal.json'
9
11
 
10
- export const defaultArgs = {
12
+ export const defaultArgs: Meta<typeof VvButton>['args'] = {
11
13
  label: 'Button',
12
14
  type: 'button',
13
15
  toggle: false,
@@ -22,7 +24,7 @@ export const defaultArgs = {
22
24
  }
23
25
 
24
26
  export const argTypes = {
25
- modifiers: {
27
+ modifiers: {
26
28
  ...ModifiersArgTypes.modifiers,
27
29
  options: [
28
30
  'primary',
@@ -153,5 +155,5 @@ export const argTypes = {
153
155
  summary: 'html',
154
156
  },
155
157
  },
156
- },
158
+ },
157
159
  }
@@ -1,3 +1,5 @@
1
+ import type { VvCombobox } from '@/components'
2
+ import type { Meta } from '@storybook/vue3'
1
3
  import {
2
4
  ValidArgTypes,
3
5
  InvalidArgTypes,
@@ -15,7 +17,7 @@ import {
15
17
  } from '@/stories/argTypes'
16
18
  import { VvComboboxProps } from '@/components/VvCombobox'
17
19
 
18
- export const defaultArgs = {
20
+ export const defaultArgs: Meta<typeof VvCombobox>['args'] = {
19
21
  ...propsToObject(VvComboboxProps),
20
22
  name: 'vv-combobox',
21
23
  maxValues: undefined,
@@ -43,6 +45,7 @@ export const defaultArgs = {
43
45
  ],
44
46
  placeholder: 'Select an option',
45
47
  label: 'Combobox label',
48
+ strategy: 'fixed',
46
49
  }
47
50
 
48
51
  export const argTypes = {
@@ -1,7 +1,9 @@
1
+ import type { Meta } from '@storybook/vue3'
2
+ import type { VvNav } from '@/components'
1
3
  import { VvNavProps } from '@/components/VvNav'
2
4
  import { ModifiersArgTypes } from '@/stories/argTypes'
3
5
 
4
- export const defaultArgs = {
6
+ export const defaultArgs: Meta<typeof VvNav>['args'] = {
5
7
  ...propsToObject(VvNavProps),
6
8
  items: [
7
9
  {
@@ -20,9 +20,9 @@ export const Default: Story = {
20
20
  ...defaultArgs,
21
21
  },
22
22
  render: (args) => ({
23
- components: {VvTab},
23
+ components: { VvTab },
24
24
  setup() {
25
- return {args}
25
+ return { args }
26
26
  },
27
27
  template: /* html */ `
28
28
  <div class="m-md w-1/2">
@@ -64,7 +64,7 @@ export const Default: Story = {
64
64
  </p>
65
65
  </template>
66
66
  </vv-tab>
67
- </div>`
67
+ </div>`,
68
68
  }),
69
69
  play: defaultTest,
70
70
  }
@@ -35,7 +35,7 @@ export const Count: Story = {
35
35
  args: {
36
36
  ...Default.args,
37
37
  count: true,
38
- minLength: 100,
38
+ minlength: 100,
39
39
  },
40
40
  }
41
41