@antify/ui-module 1.5.0 → 1.5.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 (40) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/AntTooltip.vue +30 -18
  3. package/dist/runtime/components/__stories/AntTooltip.stories.d.ts +1 -1
  4. package/dist/runtime/components/__stories/AntTooltip.stories.mjs +164 -12
  5. package/dist/runtime/components/buttons/AntActionButton.vue +37 -34
  6. package/dist/runtime/components/buttons/AntButton.vue +62 -42
  7. package/dist/runtime/components/buttons/AntCreateButton.vue +18 -6
  8. package/dist/runtime/components/buttons/AntDeleteButton.vue +11 -10
  9. package/dist/runtime/components/buttons/AntDuplicateButton.vue +19 -7
  10. package/dist/runtime/components/buttons/AntEditButton.vue +54 -0
  11. package/dist/runtime/components/buttons/AntSaveAndNewButton.vue +21 -8
  12. package/dist/runtime/components/buttons/AntSaveButton.vue +21 -10
  13. package/dist/runtime/components/buttons/__stories/AntActionButton.stories.d.ts +1 -1
  14. package/dist/runtime/components/buttons/__stories/AntActionButton.stories.mjs +18 -17
  15. package/dist/runtime/components/buttons/__stories/AntButton.stories.d.ts +1 -0
  16. package/dist/runtime/components/buttons/__stories/AntButton.stories.mjs +38 -3
  17. package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.d.ts +1 -0
  18. package/dist/runtime/components/buttons/__stories/AntCreateButton.stories.mjs +13 -4
  19. package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.d.ts +1 -1
  20. package/dist/runtime/components/buttons/__stories/AntDeleteButton.stories.mjs +13 -11
  21. package/dist/runtime/components/buttons/__stories/AntDuplicateButton.stories.d.ts +1 -0
  22. package/dist/runtime/components/buttons/__stories/AntDuplicateButton.stories.mjs +13 -4
  23. package/dist/runtime/components/buttons/__stories/AntEditButton.stories.d.ts +12 -0
  24. package/dist/runtime/components/buttons/__stories/AntEditButton.stories.mjs +76 -0
  25. package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.d.ts +1 -0
  26. package/dist/runtime/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +13 -4
  27. package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.d.ts +1 -0
  28. package/dist/runtime/components/buttons/__stories/AntSaveButton.stories.mjs +13 -4
  29. package/dist/runtime/components/form/AntFormGroup.vue +22 -7
  30. package/package.json +11 -11
  31. package/src/runtime/components/AntTooltip.vue +30 -18
  32. package/src/runtime/components/buttons/AntActionButton.vue +37 -34
  33. package/src/runtime/components/buttons/AntButton.vue +62 -42
  34. package/src/runtime/components/buttons/AntCreateButton.vue +18 -6
  35. package/src/runtime/components/buttons/AntDeleteButton.vue +11 -10
  36. package/src/runtime/components/buttons/AntDuplicateButton.vue +19 -7
  37. package/src/runtime/components/buttons/AntEditButton.vue +54 -0
  38. package/src/runtime/components/buttons/AntSaveAndNewButton.vue +21 -8
  39. package/src/runtime/components/buttons/AntSaveButton.vue +21 -10
  40. package/src/runtime/components/form/AntFormGroup.vue +22 -7
@@ -1,42 +1,54 @@
1
1
  <script lang="ts" setup>
2
- import {Grouped} from '../../enums/Grouped.enum';
3
- import {Size} from '../../enums/Size.enum';
4
2
  import AntActionButton from './AntActionButton.vue';
5
- import {ColorType, Position} from '../../enums';
3
+ import {Position, Size, Grouped, ColorType} from '../../enums';
6
4
  import {faCopy} from '@fortawesome/free-solid-svg-icons';
7
5
 
8
6
  defineEmits(['click', 'blur']);
9
7
  withDefaults(defineProps<{
8
+ iconVariant?: boolean;
10
9
  size?: Size;
11
10
  disabled?: boolean;
12
11
  grouped?: Grouped;
13
12
  skeleton?: boolean;
14
13
  expanded?: boolean;
15
14
  canDuplicate?: boolean;
16
- invalidPermissionTooltipPosition?: Position;
15
+ tooltipPosition?: Position;
17
16
  }>(), {
17
+ iconVariant: false,
18
18
  canDuplicate: true
19
19
  });
20
20
  </script>
21
21
 
22
22
  <template>
23
23
  <AntActionButton
24
- :icon-left="faCopy"
24
+ :filled="false"
25
25
  :color-type="ColorType.base"
26
26
  :size="size"
27
27
  :disabled="disabled"
28
+ :icon-left="iconVariant ? faCopy : undefined"
28
29
  :grouped="grouped"
29
30
  :skeleton="skeleton"
30
31
  :expanded="expanded"
31
32
  :has-permission="canDuplicate"
32
- :invalid-permission-tooltip-position="invalidPermissionTooltipPosition"
33
- data-e2e="create-button"
33
+ :tooltip-position="tooltipPosition"
34
+ data-e2e="duplicate-button"
34
35
  @click="$emit('click')"
35
36
  @blur="$emit('blur')"
36
37
  >
38
+ <template
39
+ v-if="!iconVariant"
40
+ #default
41
+ >
42
+ Duplicate
43
+ </template>
44
+
37
45
  <template #invalidPermissionTooltipContent>
38
46
  You have no permission to duplicate entries.<br>
39
47
  Please contact your administrator.
40
48
  </template>
49
+
50
+ <template #tooltipContent>
51
+ Duplicate entry
52
+ </template>
41
53
  </AntActionButton>
42
54
  </template>
@@ -0,0 +1,54 @@
1
+ <script lang="ts" setup>
2
+ import AntActionButton from './AntActionButton.vue';
3
+ import {Position, Size, Grouped, ColorType} from '../../enums';
4
+ import {faPencil} from '@fortawesome/free-solid-svg-icons';
5
+
6
+ defineEmits(['click', 'blur']);
7
+ withDefaults(defineProps<{
8
+ iconVariant?: boolean;
9
+ size?: Size;
10
+ disabled?: boolean;
11
+ grouped?: Grouped;
12
+ skeleton?: boolean;
13
+ expanded?: boolean;
14
+ canEdit?: boolean;
15
+ tooltipPosition?: Position;
16
+ }>(), {
17
+ iconVariant: false,
18
+ canEdit: true
19
+ });
20
+ </script>
21
+
22
+ <template>
23
+ <AntActionButton
24
+ :filled="false"
25
+ :color-type="ColorType.base"
26
+ :size="size"
27
+ :disabled="disabled"
28
+ :icon-left="iconVariant ? faPencil : undefined"
29
+ :grouped="grouped"
30
+ :skeleton="skeleton"
31
+ :expanded="expanded"
32
+ :has-permission="canEdit"
33
+ :tooltip-position="tooltipPosition"
34
+ data-e2e="edit-button"
35
+ @click="$emit('click')"
36
+ @blur="$emit('blur')"
37
+ >
38
+ <template
39
+ v-if="!iconVariant"
40
+ #default
41
+ >
42
+ Edit
43
+ </template>
44
+
45
+ <template #invalidPermissionTooltipContent>
46
+ You have no permission to edit entries.<br>
47
+ Please contact your administrator.
48
+ </template>
49
+
50
+ <template #tooltipContent>
51
+ Edit entry
52
+ </template>
53
+ </AntActionButton>
54
+ </template>
@@ -1,42 +1,55 @@
1
1
  <script lang="ts" setup>
2
- import {Grouped} from '../../enums/Grouped.enum';
3
- import {Size} from '../../enums/Size.enum';
4
2
  import AntActionButton from './AntActionButton.vue';
5
- import {Position} from '../../enums';
3
+ import {Position, Size, Grouped, ColorType} from '../../enums';
4
+ import {faFloppyDisk, faPlus} from '@fortawesome/free-solid-svg-icons';
6
5
 
7
6
  defineEmits(['click', 'blur']);
8
7
  withDefaults(defineProps<{
8
+ iconVariant?: boolean;
9
9
  size?: Size;
10
10
  disabled?: boolean;
11
11
  grouped?: Grouped;
12
12
  skeleton?: boolean;
13
13
  expanded?: boolean;
14
14
  canSave?: boolean;
15
- invalidPermissionTooltipPosition?: Position;
15
+ tooltipPosition?: Position;
16
16
  }>(), {
17
+ iconVariant: false,
17
18
  canSave: true
18
19
  });
19
20
  </script>
20
21
 
21
22
  <template>
22
23
  <AntActionButton
24
+ :filled="false"
25
+ :color-type="ColorType.primary"
23
26
  :size="size"
24
27
  :disabled="disabled"
28
+ :icon-left="iconVariant ? faFloppyDisk : undefined"
29
+ :icon-right="iconVariant ? faPlus : undefined"
25
30
  :grouped="grouped"
26
31
  :skeleton="skeleton"
27
32
  :expanded="expanded"
28
- :filled="false"
29
33
  :has-permission="canSave"
30
- :invalid-permission-tooltip-position="invalidPermissionTooltipPosition"
34
+ :tooltip-position="tooltipPosition"
31
35
  data-e2e="save-and-new-button"
32
36
  @click="$emit('click')"
33
37
  @blur="$emit('blur')"
34
38
  >
35
- <template #default>Save and new</template>
39
+ <template
40
+ v-if="!iconVariant"
41
+ #default
42
+ >
43
+ Save and new
44
+ </template>
36
45
 
37
46
  <template #invalidPermissionTooltipContent>
38
- You have no permission to save this entry.<br>
47
+ You have no permission to save entries.<br>
39
48
  Please contact your administrator.
40
49
  </template>
50
+
51
+ <template #tooltipContent>
52
+ Save entry
53
+ </template>
41
54
  </AntActionButton>
42
55
  </template>
@@ -1,43 +1,54 @@
1
1
  <script lang="ts" setup>
2
- import {Grouped} from '../../enums/Grouped.enum';
3
- import {Size} from '../../enums/Size.enum';
4
- import {ColorType} from '../../enums/ColorType.enum';
5
2
  import AntActionButton from './AntActionButton.vue';
6
- import {Position} from '../../enums';
3
+ import {Position, Size, Grouped, ColorType} from '../../enums';
4
+ import {faFloppyDisk} from '@fortawesome/free-solid-svg-icons';
7
5
 
8
6
  defineEmits(['click', 'blur']);
9
7
  withDefaults(defineProps<{
8
+ iconVariant?: boolean;
10
9
  size?: Size;
11
10
  disabled?: boolean;
12
11
  grouped?: Grouped;
13
12
  skeleton?: boolean;
14
13
  expanded?: boolean;
15
14
  canSave?: boolean;
16
- invalidPermissionTooltipPosition?: Position;
15
+ tooltipPosition?: Position;
17
16
  }>(), {
17
+ iconVariant: false,
18
18
  canSave: true
19
19
  });
20
20
  </script>
21
21
 
22
22
  <template>
23
23
  <AntActionButton
24
+ :filled="true"
25
+ :color-type="ColorType.primary"
24
26
  :size="size"
25
27
  :disabled="disabled"
28
+ :icon-left="iconVariant ? faFloppyDisk : undefined"
26
29
  :grouped="grouped"
27
30
  :skeleton="skeleton"
28
31
  :expanded="expanded"
29
- :color-type="ColorType.primary"
30
- data-e2e="save-button"
31
32
  :has-permission="canSave"
32
- :invalid-permission-tooltip-position="invalidPermissionTooltipPosition"
33
+ :tooltip-position="tooltipPosition"
34
+ data-e2e="save-button"
33
35
  @click="$emit('click')"
34
36
  @blur="$emit('blur')"
35
37
  >
36
- <template #default>Save</template>
38
+ <template
39
+ v-if="!iconVariant"
40
+ #default
41
+ >
42
+ Save
43
+ </template>
37
44
 
38
45
  <template #invalidPermissionTooltipContent>
39
- You have no permission to save this entry.<br>
46
+ You have no permission to save entries.<br>
40
47
  Please contact your administrator.
41
48
  </template>
49
+
50
+ <template #tooltipContent>
51
+ Save entry
52
+ </template>
42
53
  </AntActionButton>
43
54
  </template>
@@ -8,4 +8,4 @@ export declare const Disabled: Story;
8
8
  export declare const Grouped: Story;
9
9
  export declare const Skeleton: Story;
10
10
  export declare const Expanded: Story;
11
- export declare const WithPermissionTooltip: Story;
11
+ export declare const WithoutPermission: Story;
@@ -1,12 +1,15 @@
1
1
  import AntActionButton from "../AntActionButton.vue";
2
- import { Size } from "../../../enums/Size.enum.mjs";
3
2
  import { Grouped as _Grouped } from "../../../enums/Grouped.enum.mjs";
4
- import { Position } from "../../../enums/Position.enum.mjs";
3
+ import { ColorType, InputColorType, Position, Size } from "../../../enums/index.mjs";
5
4
  const meta = {
6
5
  title: "Components/Buttons/Action Button",
7
6
  component: AntActionButton,
8
7
  parameters: { controls: { sort: "requiredFirst" } },
9
8
  argTypes: {
9
+ colorType: {
10
+ control: { type: "select" },
11
+ options: Object.values(ColorType)
12
+ },
10
13
  size: {
11
14
  control: { type: "radio" },
12
15
  options: Object.values(Size)
@@ -15,9 +18,13 @@ const meta = {
15
18
  control: { type: "select" },
16
19
  options: Object.values(_Grouped)
17
20
  },
18
- invalidPermissionTooltipPosition: {
21
+ tooltipPosition: {
19
22
  control: { type: "select" },
20
23
  options: Object.values(Position)
24
+ },
25
+ tooltipColorType: {
26
+ control: { type: "select" },
27
+ options: Object.values(InputColorType)
21
28
  }
22
29
  }
23
30
  };
@@ -28,10 +35,14 @@ export const Docs = {
28
35
  setup() {
29
36
  return { args };
30
37
  },
31
- template: '<AntActionButton v-bind="args">Action Button</AntActionButton>'
38
+ template: `<AntActionButton v-bind="args">
39
+ <template #default>Action Button</template>
40
+ <template #tooltipContent>This is an action button</template>
41
+ <template #invalidPermissionTooltipContent>You have no permission <br>to click this button</template>
42
+ </AntActionButton>`
32
43
  }),
33
44
  args: {
34
- invalidPermissionTooltipPosition: Position.right
45
+ tooltipPosition: Position.right
35
46
  }
36
47
  };
37
48
  export const Disabled = {
@@ -62,18 +73,8 @@ export const Expanded = {
62
73
  expanded: true
63
74
  }
64
75
  };
65
- export const WithPermissionTooltip = {
66
- render: (args) => ({
67
- components: { AntActionButton },
68
- setup() {
69
- return { args };
70
- },
71
- template: `<AntActionButton v-bind="args">
72
- Action Button
73
-
74
- <template #invalidPermissionTooltipContent>You have no permission to do this</template>
75
- </AntActionButton>`
76
- }),
76
+ export const WithoutPermission = {
77
+ render: Docs.render,
77
78
  args: {
78
79
  ...Docs.args,
79
80
  hasPermission: false
@@ -12,4 +12,5 @@ export declare const Skeleton: Story;
12
12
  export declare const ReadOnly: Story;
13
13
  export declare const Expanded: Story;
14
14
  export declare const WithoutBorder: Story;
15
+ export declare const WithTooltip: Story;
15
16
  export declare const Summary: Story;
@@ -4,7 +4,8 @@ import AntFormGroup from "../../form/AntFormGroup.vue";
4
4
  import { faCaretRight, faCaretLeft } from "@fortawesome/free-solid-svg-icons";
5
5
  import { Size } from "../../../enums/Size.enum.mjs";
6
6
  import { Grouped as _Grouped } from "../../../enums/Grouped.enum.mjs";
7
- import { ColorType } from "../../../enums/index.mjs";
7
+ import { ColorType, InputColorType, Position } from "../../../enums/index.mjs";
8
+ import { within } from "@storybook/test";
8
9
  const meta = {
9
10
  component: AntButton,
10
11
  title: "Components/Buttons/Button",
@@ -39,6 +40,16 @@ const meta = {
39
40
  },
40
41
  submit: {
41
42
  description: 'Change the button type to type="submit"'
43
+ },
44
+ tooltipPosition: {
45
+ control: { type: "select" },
46
+ options: Object.values(Position),
47
+ description: "The tooltips position. Tooltip is only shown if a tooltip-content slot is provided."
48
+ },
49
+ tooltipColorType: {
50
+ control: { type: "select" },
51
+ options: Object.values(InputColorType),
52
+ description: "The tooltips color type. Tooltip is only shown if a tooltip-content slot is provided."
42
53
  }
43
54
  }
44
55
  };
@@ -138,6 +149,29 @@ export const WithoutBorder = {
138
149
  outlined: false
139
150
  }
140
151
  };
152
+ export const WithTooltip = {
153
+ render: (args) => ({
154
+ components: { AntButton },
155
+ setup() {
156
+ return { args };
157
+ },
158
+ template: `
159
+ <AntButton v-bind="args">
160
+ <template #default>Button</template>
161
+
162
+ <template #tooltip-content>This is a button</template>
163
+ </AntButton>`
164
+ }),
165
+ play: async ({ canvasElement, step }) => {
166
+ const canvas = within(canvasElement);
167
+ },
168
+ args: {
169
+ tooltipDelay: 800
170
+ },
171
+ parameters: {
172
+ chromatic: { disableSnapshot: false }
173
+ }
174
+ };
141
175
  export const Summary = {
142
176
  parameters: {
143
177
  chromatic: { disableSnapshot: false }
@@ -154,7 +188,7 @@ export const Summary = {
154
188
  template: `
155
189
  <div class="flex flex-col gap-2.5">
156
190
  <AntFormGroup>
157
- <AntFormGroupLabel class="text-xl">
191
+ <AntFormGroupLabel>
158
192
  Grouped | Filled | Outlined combinations
159
193
  </AntFormGroupLabel>
160
194
  <div class="flex">
@@ -256,8 +290,9 @@ export const Summary = {
256
290
  </AntButton>
257
291
  </div>
258
292
  </AntFormGroup>
293
+
259
294
  <AntFormGroup>
260
- <AntFormGroupLabel class="text-xl">
295
+ <AntFormGroupLabel>
261
296
  Size
262
297
  </AntFormGroupLabel>
263
298
  <AntFormGroup direction="row">
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof AntCreateButton>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof AntCreateButton>;
6
6
  export declare const Docs: Story;
7
+ export declare const IconVariant: Story;
7
8
  export declare const Disabled: Story;
8
9
  export declare const Grouped: Story;
9
10
  export declare const Skeleton: Story;
@@ -1,7 +1,5 @@
1
1
  import AntCreateButton from "../AntCreateButton.vue";
2
- import { Size } from "../../../enums/Size.enum.mjs";
3
- import { Grouped as _Grouped } from "../../../enums/Grouped.enum.mjs";
4
- import { Position } from "../../../enums/index.mjs";
2
+ import { Position, Grouped as _Grouped, Size } from "../../../enums/index.mjs";
5
3
  const meta = {
6
4
  title: "Components/Buttons/Create Button",
7
5
  component: AntCreateButton,
@@ -14,6 +12,10 @@ const meta = {
14
12
  grouped: {
15
13
  control: { type: "select" },
16
14
  options: Object.values(_Grouped)
15
+ },
16
+ tooltipPosition: {
17
+ control: { type: "select" },
18
+ options: Object.values(Position)
17
19
  }
18
20
  }
19
21
  };
@@ -27,7 +29,14 @@ export const Docs = {
27
29
  template: '<AntCreateButton v-bind="args"/>'
28
30
  }),
29
31
  args: {
30
- invalidPermissionTooltipPosition: Position.right
32
+ tooltipPosition: Position.right
33
+ }
34
+ };
35
+ export const IconVariant = {
36
+ render: Docs.render,
37
+ args: {
38
+ ...Docs.args,
39
+ iconVariant: true
31
40
  }
32
41
  };
33
42
  export const Disabled = {
@@ -4,9 +4,9 @@ declare const meta: Meta<typeof AntDeleteButton>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof AntDeleteButton>;
6
6
  export declare const Docs: Story;
7
+ export declare const IconVariant: Story;
7
8
  export declare const Disabled: Story;
8
9
  export declare const Grouped: Story;
9
10
  export declare const Skeleton: Story;
10
11
  export declare const Expanded: Story;
11
- export declare const IconVariant: Story;
12
12
  export declare const InvalidPermission: Story;
@@ -1,7 +1,5 @@
1
1
  import AntDeleteButton from "../AntDeleteButton.vue";
2
- import { Size } from "../../../enums/Size.enum.mjs";
3
- import { Grouped as _Grouped } from "../../../enums/Grouped.enum.mjs";
4
- import { Position } from "../../../enums/index.mjs";
2
+ import { Position, Grouped as _Grouped, Size } from "../../../enums/index.mjs";
5
3
  const meta = {
6
4
  title: "Components/Buttons/Delete Button",
7
5
  component: AntDeleteButton,
@@ -14,6 +12,10 @@ const meta = {
14
12
  grouped: {
15
13
  control: { type: "select" },
16
14
  options: Object.values(_Grouped)
15
+ },
16
+ tooltipPosition: {
17
+ control: { type: "select" },
18
+ options: Object.values(Position)
17
19
  }
18
20
  }
19
21
  };
@@ -27,7 +29,14 @@ export const Docs = {
27
29
  template: '<AntDeleteButton v-bind="args"/>'
28
30
  }),
29
31
  args: {
30
- invalidPermissionTooltipPosition: Position.right
32
+ tooltipPosition: Position.right
33
+ }
34
+ };
35
+ export const IconVariant = {
36
+ render: Docs.render,
37
+ args: {
38
+ ...Docs.args,
39
+ iconVariant: true
31
40
  }
32
41
  };
33
42
  export const Disabled = {
@@ -58,13 +67,6 @@ export const Expanded = {
58
67
  expanded: true
59
68
  }
60
69
  };
61
- export const IconVariant = {
62
- render: Docs.render,
63
- args: {
64
- ...Docs.args,
65
- iconVariant: true
66
- }
67
- };
68
70
  export const InvalidPermission = {
69
71
  render: Docs.render,
70
72
  args: {
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof AntDuplicateButton>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof AntDuplicateButton>;
6
6
  export declare const Docs: Story;
7
+ export declare const IconVariant: Story;
7
8
  export declare const Disabled: Story;
8
9
  export declare const Grouped: Story;
9
10
  export declare const Skeleton: Story;
@@ -1,7 +1,5 @@
1
1
  import AntDuplicateButton from "../AntDuplicateButton.vue";
2
- import { Size } from "../../../enums/Size.enum.mjs";
3
- import { Grouped as _Grouped } from "../../../enums/Grouped.enum.mjs";
4
- import { Position } from "../../../enums/index.mjs";
2
+ import { Position, Grouped as _Grouped, Size } from "../../../enums/index.mjs";
5
3
  const meta = {
6
4
  title: "Components/Buttons/Duplicate Button",
7
5
  component: AntDuplicateButton,
@@ -14,6 +12,10 @@ const meta = {
14
12
  grouped: {
15
13
  control: { type: "select" },
16
14
  options: Object.values(_Grouped)
15
+ },
16
+ tooltipPosition: {
17
+ control: { type: "select" },
18
+ options: Object.values(Position)
17
19
  }
18
20
  }
19
21
  };
@@ -27,7 +29,14 @@ export const Docs = {
27
29
  template: '<AntDuplicateButton v-bind="args"/>'
28
30
  }),
29
31
  args: {
30
- invalidPermissionTooltipPosition: Position.right
32
+ tooltipPosition: Position.right
33
+ }
34
+ };
35
+ export const IconVariant = {
36
+ render: Docs.render,
37
+ args: {
38
+ ...Docs.args,
39
+ iconVariant: true
31
40
  }
32
41
  };
33
42
  export const Disabled = {
@@ -0,0 +1,12 @@
1
+ import AntEditButton from '../AntEditButton.vue';
2
+ import { type Meta, type StoryObj } from '@storybook/vue3';
3
+ declare const meta: Meta<typeof AntEditButton>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof AntEditButton>;
6
+ export declare const Docs: Story;
7
+ export declare const IconVariant: Story;
8
+ export declare const Disabled: Story;
9
+ export declare const Grouped: Story;
10
+ export declare const Skeleton: Story;
11
+ export declare const Expanded: Story;
12
+ export declare const InvalidPermission: Story;
@@ -0,0 +1,76 @@
1
+ import AntEditButton from "../AntEditButton.vue";
2
+ import { Position, Grouped as _Grouped, Size } from "../../../enums/index.mjs";
3
+ const meta = {
4
+ title: "Components/Buttons/Edit Button",
5
+ component: AntEditButton,
6
+ parameters: { controls: { sort: "requiredFirst" } },
7
+ argTypes: {
8
+ size: {
9
+ control: { type: "radio" },
10
+ options: Object.values(Size)
11
+ },
12
+ grouped: {
13
+ control: { type: "select" },
14
+ options: Object.values(_Grouped)
15
+ },
16
+ tooltipPosition: {
17
+ control: { type: "select" },
18
+ options: Object.values(Position)
19
+ }
20
+ }
21
+ };
22
+ export default meta;
23
+ export const Docs = {
24
+ render: (args) => ({
25
+ components: { AntEditButton },
26
+ setup() {
27
+ return { args };
28
+ },
29
+ template: '<AntEditButton v-bind="args"/>'
30
+ }),
31
+ args: {
32
+ tooltipPosition: Position.right
33
+ }
34
+ };
35
+ export const IconVariant = {
36
+ render: Docs.render,
37
+ args: {
38
+ ...Docs.args,
39
+ iconVariant: true
40
+ }
41
+ };
42
+ export const Disabled = {
43
+ render: Docs.render,
44
+ args: {
45
+ ...Docs.args,
46
+ disabled: true
47
+ }
48
+ };
49
+ export const Grouped = {
50
+ render: Docs.render,
51
+ args: {
52
+ ...Docs.args,
53
+ grouped: _Grouped.left
54
+ }
55
+ };
56
+ export const Skeleton = {
57
+ render: Docs.render,
58
+ args: {
59
+ ...Docs.args,
60
+ skeleton: true
61
+ }
62
+ };
63
+ export const Expanded = {
64
+ render: Docs.render,
65
+ args: {
66
+ ...Docs.args,
67
+ expanded: true
68
+ }
69
+ };
70
+ export const InvalidPermission = {
71
+ render: Docs.render,
72
+ args: {
73
+ ...Docs.args,
74
+ canEdit: false
75
+ }
76
+ };
@@ -4,6 +4,7 @@ declare const meta: Meta<typeof AntSaveAndNewButton>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof AntSaveAndNewButton>;
6
6
  export declare const Docs: Story;
7
+ export declare const IconVariant: Story;
7
8
  export declare const Disabled: Story;
8
9
  export declare const Grouped: Story;
9
10
  export declare const Skeleton: Story;