@antify/ui-module 1.2.0 → 1.3.0

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.
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "ui-module",
3
3
  "configKey": "uiModule",
4
- "version": "1.2.0"
4
+ "version": "1.3.0"
5
5
  }
package/dist/module.mjs CHANGED
@@ -169,12 +169,16 @@ const tailwindcss = {
169
169
  // For module dev
170
170
  "./src/runtime/**/*.{vue,js,ts,jsx,tsx}",
171
171
  "./src/runtime/**/*.stories.ts",
172
- "./playground/**/*.{vue,js,ts,jsx,tsx}",
172
+ "./playground/app.vue",
173
+ "./playground/components/**/*.{vue,js,ts,jsx,tsx}",
174
+ "./playground/pages/**/*.{vue,js,ts,jsx,tsx}",
175
+ "./playground/layouts/**/*.{vue,js,ts,jsx,tsx}",
173
176
  "../ui-module/src/**/*.{vue,js,ts,jsx,tsx}",
174
177
  // For project dev
175
178
  "./app.vue",
176
179
  "./components/**/*.{vue,js,ts,jsx,tsx}",
177
180
  "./pages/**/*.{vue,js,ts,jsx,tsx}",
181
+ "./layouts/**/*.{vue,js,ts,jsx,tsx}",
178
182
  // If this config is used in a project
179
183
  "./node_modules/@antify/*/dist/**/*.{js,vue,ts}",
180
184
  "./node_modules/@antify/*/src/**/*.{js,vue,ts}"
@@ -0,0 +1,41 @@
1
+ <script lang="ts" setup>
2
+ /**
3
+ * This button is used for everything what is the primary
4
+ * action like save, confirm, create, etc.
5
+ */
6
+ import {Grouped} from '../../enums/Grouped.enum';
7
+ import {Size} from '../../enums/Size.enum';
8
+ import {ColorType} from '../../enums/ColorType.enum';
9
+ import AntButton from './AntButton.vue';
10
+
11
+ defineEmits(['click', 'blur']);
12
+ withDefaults(
13
+ defineProps<{
14
+ size?: Size;
15
+ disabled?: boolean;
16
+ grouped?: Grouped;
17
+ colorType?: ColorType;
18
+ skeleton?: boolean;
19
+ expanded?: boolean;
20
+ }>(), {
21
+ colorType: ColorType.primary,
22
+ }
23
+ )
24
+ </script>
25
+
26
+ <template>
27
+ <AntButton
28
+ :size="size"
29
+ :disabled="disabled"
30
+ :grouped="grouped"
31
+ :skeleton="skeleton"
32
+ :expanded="expanded"
33
+ :color-type="colorType"
34
+ filled
35
+ data-e2e="action-button"
36
+ @click="$emit('click')"
37
+ @blur="$emit('blur')"
38
+ >
39
+ <slot />
40
+ </AntButton>
41
+ </template>
@@ -1,8 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import {Grouped} from '../../enums/Grouped.enum';
3
3
  import {Size} from '../../enums/Size.enum';
4
- import {ColorType} from '../../enums/ColorType.enum';
5
- import AntButton from './AntButton.vue';
4
+ import AntActionButton from './AntActionButton.vue';
6
5
 
7
6
  defineEmits(['click', 'blur']);
8
7
  defineProps<{
@@ -15,18 +14,16 @@ defineProps<{
15
14
  </script>
16
15
 
17
16
  <template>
18
- <AntButton
17
+ <AntActionButton
19
18
  :size="size"
20
19
  :disabled="disabled"
21
20
  :grouped="grouped"
22
21
  :skeleton="skeleton"
23
22
  :expanded="expanded"
24
- :color-type="ColorType.primary"
25
- filled
26
23
  data-e2e="create-button"
27
24
  @click="$emit('click')"
28
25
  @blur="$emit('blur')"
29
26
  >
30
27
  Create
31
- </AntButton>
28
+ </AntActionButton>
32
29
  </template>
@@ -2,7 +2,7 @@
2
2
  import {Grouped} from '../../enums/Grouped.enum';
3
3
  import {Size} from '../../enums/Size.enum';
4
4
  import {ColorType} from '../../enums/ColorType.enum';
5
- import AntButton from './AntButton.vue';
5
+ import AntActionButton from './AntActionButton.vue';
6
6
 
7
7
  defineEmits(['click', 'blur']);
8
8
  defineProps<{
@@ -15,18 +15,17 @@ defineProps<{
15
15
  </script>
16
16
 
17
17
  <template>
18
- <AntButton
18
+ <AntActionButton
19
19
  :size="size"
20
20
  :disabled="disabled"
21
21
  :grouped="grouped"
22
22
  :skeleton="skeleton"
23
23
  :expanded="expanded"
24
24
  :color-type="ColorType.danger"
25
- filled
26
25
  data-e2e="delete-button"
27
26
  @click="$emit('click')"
28
27
  @blur="$emit('blur')"
29
28
  >
30
29
  Delete
31
- </AntButton>
30
+ </AntActionButton>
32
31
  </template>
@@ -1,8 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import {Grouped} from '../../enums/Grouped.enum';
3
3
  import {Size} from '../../enums/Size.enum';
4
- import {ColorType} from '../../enums/ColorType.enum';
5
- import AntButton from './AntButton.vue';
4
+ import AntActionButton from './AntActionButton.vue';
6
5
 
7
6
  defineEmits(['click', 'blur']);
8
7
  defineProps<{
@@ -15,18 +14,16 @@ defineProps<{
15
14
  </script>
16
15
 
17
16
  <template>
18
- <AntButton
17
+ <AntActionButton
19
18
  :size="size"
20
19
  :disabled="disabled"
21
20
  :grouped="grouped"
22
21
  :skeleton="skeleton"
23
22
  :expanded="expanded"
24
- :color-type="ColorType.primary"
25
- filled
26
23
  data-e2e="save-and-new-button"
27
24
  @click="$emit('click')"
28
25
  @blur="$emit('blur')"
29
26
  >
30
27
  Save and new
31
- </AntButton>
28
+ </AntActionButton>
32
29
  </template>
@@ -2,7 +2,7 @@
2
2
  import {Grouped} from '../../enums/Grouped.enum';
3
3
  import {Size} from '../../enums/Size.enum';
4
4
  import {ColorType} from '../../enums/ColorType.enum';
5
- import AntButton from './AntButton.vue';
5
+ import AntActionButton from './AntActionButton.vue';
6
6
 
7
7
  defineEmits(['click', 'blur']);
8
8
  defineProps<{
@@ -15,7 +15,7 @@ defineProps<{
15
15
  </script>
16
16
 
17
17
  <template>
18
- <AntButton
18
+ <AntActionButton
19
19
  :size="size"
20
20
  :disabled="disabled"
21
21
  :grouped="grouped"
@@ -27,5 +27,5 @@ defineProps<{
27
27
  @blur="$emit('blur')"
28
28
  >
29
29
  Save
30
- </AntButton>
30
+ </AntActionButton>
31
31
  </template>
@@ -0,0 +1,10 @@
1
+ import AntActionButton from '../AntActionButton.vue';
2
+ import { type Meta, type StoryObj } from '@storybook/vue3';
3
+ declare const meta: Meta<typeof AntActionButton>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof AntActionButton>;
6
+ export declare const Docs: Story;
7
+ export declare const Disabled: Story;
8
+ export declare const Grouped: Story;
9
+ export declare const Skeleton: Story;
10
+ export declare const Expanded: Story;
@@ -0,0 +1,57 @@
1
+ import AntActionButton from "../AntActionButton.vue";
2
+ import { Size } from "../../../enums/Size.enum.mjs";
3
+ import { Grouped as _Grouped } from "../../../enums/Grouped.enum.mjs";
4
+ const meta = {
5
+ title: "Components/Buttons/Action Button",
6
+ component: AntActionButton,
7
+ parameters: { controls: { sort: "requiredFirst" } },
8
+ argTypes: {
9
+ size: {
10
+ control: { type: "radio" },
11
+ options: Object.values(Size)
12
+ },
13
+ grouped: {
14
+ control: { type: "select" },
15
+ options: Object.values(_Grouped)
16
+ }
17
+ }
18
+ };
19
+ export default meta;
20
+ export const Docs = {
21
+ render: (args) => ({
22
+ components: { AntActionButton },
23
+ setup() {
24
+ return { args };
25
+ },
26
+ template: '<AntActionButton v-bind="args">Action Button</AntActionButton>'
27
+ }),
28
+ args: {}
29
+ };
30
+ export const Disabled = {
31
+ render: Docs.render,
32
+ args: {
33
+ ...Docs.args,
34
+ disabled: true
35
+ }
36
+ };
37
+ export const Grouped = {
38
+ render: Docs.render,
39
+ args: {
40
+ ...Docs.args,
41
+ grouped: _Grouped.left
42
+ }
43
+ };
44
+ export const Skeleton = {
45
+ render: Docs.render,
46
+ args: {
47
+ ...Docs.args,
48
+ skeleton: true
49
+ }
50
+ };
51
+ export const Expanded = {
52
+ render: Docs.render,
53
+ args: {
54
+ ...Docs.args,
55
+ expanded: true
56
+ }
57
+ };
@@ -167,12 +167,16 @@ export default {
167
167
  // For module dev
168
168
  "./src/runtime/**/*.{vue,js,ts,jsx,tsx}",
169
169
  "./src/runtime/**/*.stories.ts",
170
- "./playground/**/*.{vue,js,ts,jsx,tsx}",
170
+ "./playground/app.vue",
171
+ "./playground/components/**/*.{vue,js,ts,jsx,tsx}",
172
+ "./playground/pages/**/*.{vue,js,ts,jsx,tsx}",
173
+ "./playground/layouts/**/*.{vue,js,ts,jsx,tsx}",
171
174
  "../ui-module/src/**/*.{vue,js,ts,jsx,tsx}",
172
175
  // For project dev
173
176
  "./app.vue",
174
177
  "./components/**/*.{vue,js,ts,jsx,tsx}",
175
178
  "./pages/**/*.{vue,js,ts,jsx,tsx}",
179
+ "./layouts/**/*.{vue,js,ts,jsx,tsx}",
176
180
  // If this config is used in a project
177
181
  "./node_modules/@antify/*/dist/**/*.{js,vue,ts}",
178
182
  "./node_modules/@antify/*/src/**/*.{js,vue,ts}"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@antify/ui-module",
3
3
  "private": false,
4
- "version": "1.2.0",
4
+ "version": "1.3.0",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "exports": {
@@ -0,0 +1,41 @@
1
+ <script lang="ts" setup>
2
+ /**
3
+ * This button is used for everything what is the primary
4
+ * action like save, confirm, create, etc.
5
+ */
6
+ import {Grouped} from '../../enums/Grouped.enum';
7
+ import {Size} from '../../enums/Size.enum';
8
+ import {ColorType} from '../../enums/ColorType.enum';
9
+ import AntButton from './AntButton.vue';
10
+
11
+ defineEmits(['click', 'blur']);
12
+ withDefaults(
13
+ defineProps<{
14
+ size?: Size;
15
+ disabled?: boolean;
16
+ grouped?: Grouped;
17
+ colorType?: ColorType;
18
+ skeleton?: boolean;
19
+ expanded?: boolean;
20
+ }>(), {
21
+ colorType: ColorType.primary,
22
+ }
23
+ )
24
+ </script>
25
+
26
+ <template>
27
+ <AntButton
28
+ :size="size"
29
+ :disabled="disabled"
30
+ :grouped="grouped"
31
+ :skeleton="skeleton"
32
+ :expanded="expanded"
33
+ :color-type="colorType"
34
+ filled
35
+ data-e2e="action-button"
36
+ @click="$emit('click')"
37
+ @blur="$emit('blur')"
38
+ >
39
+ <slot />
40
+ </AntButton>
41
+ </template>
@@ -1,8 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import {Grouped} from '../../enums/Grouped.enum';
3
3
  import {Size} from '../../enums/Size.enum';
4
- import {ColorType} from '../../enums/ColorType.enum';
5
- import AntButton from './AntButton.vue';
4
+ import AntActionButton from './AntActionButton.vue';
6
5
 
7
6
  defineEmits(['click', 'blur']);
8
7
  defineProps<{
@@ -15,18 +14,16 @@ defineProps<{
15
14
  </script>
16
15
 
17
16
  <template>
18
- <AntButton
17
+ <AntActionButton
19
18
  :size="size"
20
19
  :disabled="disabled"
21
20
  :grouped="grouped"
22
21
  :skeleton="skeleton"
23
22
  :expanded="expanded"
24
- :color-type="ColorType.primary"
25
- filled
26
23
  data-e2e="create-button"
27
24
  @click="$emit('click')"
28
25
  @blur="$emit('blur')"
29
26
  >
30
27
  Create
31
- </AntButton>
28
+ </AntActionButton>
32
29
  </template>
@@ -2,7 +2,7 @@
2
2
  import {Grouped} from '../../enums/Grouped.enum';
3
3
  import {Size} from '../../enums/Size.enum';
4
4
  import {ColorType} from '../../enums/ColorType.enum';
5
- import AntButton from './AntButton.vue';
5
+ import AntActionButton from './AntActionButton.vue';
6
6
 
7
7
  defineEmits(['click', 'blur']);
8
8
  defineProps<{
@@ -15,18 +15,17 @@ defineProps<{
15
15
  </script>
16
16
 
17
17
  <template>
18
- <AntButton
18
+ <AntActionButton
19
19
  :size="size"
20
20
  :disabled="disabled"
21
21
  :grouped="grouped"
22
22
  :skeleton="skeleton"
23
23
  :expanded="expanded"
24
24
  :color-type="ColorType.danger"
25
- filled
26
25
  data-e2e="delete-button"
27
26
  @click="$emit('click')"
28
27
  @blur="$emit('blur')"
29
28
  >
30
29
  Delete
31
- </AntButton>
30
+ </AntActionButton>
32
31
  </template>
@@ -1,8 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import {Grouped} from '../../enums/Grouped.enum';
3
3
  import {Size} from '../../enums/Size.enum';
4
- import {ColorType} from '../../enums/ColorType.enum';
5
- import AntButton from './AntButton.vue';
4
+ import AntActionButton from './AntActionButton.vue';
6
5
 
7
6
  defineEmits(['click', 'blur']);
8
7
  defineProps<{
@@ -15,18 +14,16 @@ defineProps<{
15
14
  </script>
16
15
 
17
16
  <template>
18
- <AntButton
17
+ <AntActionButton
19
18
  :size="size"
20
19
  :disabled="disabled"
21
20
  :grouped="grouped"
22
21
  :skeleton="skeleton"
23
22
  :expanded="expanded"
24
- :color-type="ColorType.primary"
25
- filled
26
23
  data-e2e="save-and-new-button"
27
24
  @click="$emit('click')"
28
25
  @blur="$emit('blur')"
29
26
  >
30
27
  Save and new
31
- </AntButton>
28
+ </AntActionButton>
32
29
  </template>
@@ -2,7 +2,7 @@
2
2
  import {Grouped} from '../../enums/Grouped.enum';
3
3
  import {Size} from '../../enums/Size.enum';
4
4
  import {ColorType} from '../../enums/ColorType.enum';
5
- import AntButton from './AntButton.vue';
5
+ import AntActionButton from './AntActionButton.vue';
6
6
 
7
7
  defineEmits(['click', 'blur']);
8
8
  defineProps<{
@@ -15,7 +15,7 @@ defineProps<{
15
15
  </script>
16
16
 
17
17
  <template>
18
- <AntButton
18
+ <AntActionButton
19
19
  :size="size"
20
20
  :disabled="disabled"
21
21
  :grouped="grouped"
@@ -27,5 +27,5 @@ defineProps<{
27
27
  @blur="$emit('blur')"
28
28
  >
29
29
  Save
30
- </AntButton>
30
+ </AntActionButton>
31
31
  </template>