@volverjs/ui-vue 0.0.10-beta.36 → 0.0.10-beta.38

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.
@@ -49,6 +49,7 @@ export default {
49
49
  <slot name="before" />
50
50
  <TransitionGroup
51
51
  tag="div"
52
+ role="group"
52
53
  :name="hasTransition"
53
54
  class="vv-alert-group__list"
54
55
  v-on="alertGroupTransitionHandlers"
@@ -40,14 +40,14 @@ export const VvAlertGroupProps = {
40
40
 
41
41
  export const VvAlertGroupEvents = [
42
42
  'close',
43
- 'before-enter',
44
- 'after-leave',
43
+ 'beforeEnter',
44
+ 'afterLeave',
45
45
  'enter',
46
- 'after-enter',
47
- 'enter-cancelled',
48
- 'before-leave',
46
+ 'afterEnter',
47
+ 'enterCancelled',
48
+ 'beforeLeave',
49
49
  'leave',
50
- 'leave-cancelled',
50
+ 'leaveCancelled',
51
51
  ]
52
52
 
53
53
  export function useVvAlertGroup(props: Readonly<ExtractPropTypes<typeof VvAlertGroupProps>>, emit: (event: string, ...args: unknown[]) => void) {
@@ -27,19 +27,28 @@ const isOpened = computed({
27
27
  // template ref
28
28
  const modalWrapper = ref(null)
29
29
 
30
- // styles
30
+ /**
31
+ * @description Define component classes with BEM style.
32
+ * @returns {Array} The component classes.
33
+ */
34
+ const { modifiers } = toRefs(props)
35
+ const bemCssClasses = useModifiers(
36
+ 'vv-dialog',
37
+ modifiers,
38
+ computed(() => {
39
+ if (props.size) {
40
+ return { [props.size]: !!props.size }
41
+ }
42
+ return {}
43
+ }),
44
+ )
45
+
31
46
  const dialogAttrs = computed(() => {
32
47
  const { id } = props
33
48
  return {
34
49
  id,
35
50
  } as DialogHTMLAttributes
36
51
  })
37
- const dialogClass = computed(() => {
38
- if (!props.size) {
39
- return 'vv-dialog'
40
- }
41
- return ['vv-dialog', `vv-dialog--${props.size}`]
42
- })
43
52
 
44
53
  // transitions
45
54
  const transitioName = computed(() => `vv-dialog--${props.transition}`)
@@ -114,7 +123,7 @@ export default {
114
123
  v-show="isOpened"
115
124
  v-bind="dialogAttrs"
116
125
  ref="dialogEl"
117
- :class="dialogClass"
126
+ :class="bemCssClasses"
118
127
  @cancel.stop.prevent="onCancel"
119
128
  >
120
129
  <article ref="modalWrapper" class="vv-dialog__wrapper">
@@ -1,20 +1,21 @@
1
- import { IdProps } from '../../props'
1
+ import { IdProps, ModifiersProps } from '@/props'
2
2
 
3
3
  export const VvDialogEvents = [
4
4
  'open',
5
5
  'close',
6
6
  'update:modelValue',
7
- 'before-enter',
8
- 'after-leave',
7
+ 'beforeEnter',
8
+ 'afterLeave',
9
9
  'enter',
10
- 'after-enter',
11
- 'enter-cancelled',
12
- 'before-leave',
10
+ 'afterEnter',
11
+ 'enterCancelled',
12
+ 'beforeLeave',
13
13
  'leave',
14
- 'leave-cancelled',
14
+ 'leaveCancelled',
15
15
  ]
16
16
 
17
17
  export const VvDialogProps = {
18
+ ...ModifiersProps,
18
19
  ...IdProps,
19
20
  /**
20
21
  * Dialog title
@@ -1,5 +1,5 @@
1
1
  import type { ArgTypes } from '@storybook/vue3'
2
- import { DefaultSlotArgTypes } from '@/stories/argTypes'
2
+ import { DefaultSlotArgTypes, ModifiersArgTypes } from '@/stories/argTypes'
3
3
 
4
4
  export const defaultArgs = {
5
5
  id: 'dialog',
@@ -16,6 +16,14 @@ export const argTypes: ArgTypes = {
16
16
  control: 'radio',
17
17
  options: ['fade-block', 'fade-inline', 'scale'],
18
18
  },
19
+ modifiers: {
20
+ ...ModifiersArgTypes.modifiers,
21
+ options: [
22
+ 'standard',
23
+ 'small',
24
+ 'fullscreen',
25
+ ],
26
+ },
19
27
  size: {
20
28
  control: 'radio',
21
29
  options: ['standard', 'small', 'fullscreen'],
@@ -0,0 +1,42 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3'
2
+ import { Default } from './Dialog.stories'
3
+ import { argTypes, defaultArgs } from './Dialog.settings'
4
+ import VvDialog from '@/components/VvDialog/VvDialog.vue'
5
+
6
+ const meta: Meta<typeof VvDialog> = {
7
+ title: 'Components/Dialog/Modifiers',
8
+ component: VvDialog,
9
+ args: defaultArgs,
10
+ argTypes,
11
+ }
12
+
13
+ export default meta
14
+
15
+ type Story = StoryObj<typeof VvDialog>
16
+
17
+ export const Standard: Story = {
18
+ ...Default,
19
+ args: {
20
+ ...Default.args,
21
+ title: 'Standard',
22
+ modifiers: 'standard',
23
+ },
24
+ }
25
+
26
+ export const Small: Story = {
27
+ ...Default,
28
+ args: {
29
+ ...Default.args,
30
+ title: 'Small',
31
+ modifiers: 'small',
32
+ },
33
+ }
34
+
35
+ export const Fullscreen: Story = {
36
+ ...Default,
37
+ args: {
38
+ ...Default.args,
39
+ title: 'Fullscreen',
40
+ modifiers: 'fullscreen',
41
+ },
42
+ }