@antify/ui 2.2.1 → 2.2.3

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 (147) hide show
  1. package/dist/components/AntAccordion.vue +25 -12
  2. package/dist/components/AntAccordionItem.vue +28 -13
  3. package/dist/components/AntAlert.vue +25 -15
  4. package/dist/components/AntCard.vue +26 -14
  5. package/dist/components/AntContent.vue +4 -4
  6. package/dist/components/AntDropdown.vue +41 -23
  7. package/dist/components/AntIcon.vue +18 -6
  8. package/dist/components/AntKeycap.vue +31 -16
  9. package/dist/components/AntListGroup.vue +13 -11
  10. package/dist/components/AntListGroupItem.vue +19 -9
  11. package/dist/components/AntModal.vue +26 -15
  12. package/dist/components/AntPagination.vue +28 -15
  13. package/dist/components/AntPopover.vue +74 -51
  14. package/dist/components/AntSkeleton.vue +8 -4
  15. package/dist/components/AntSpinner.vue +14 -6
  16. package/dist/components/AntTag.vue +25 -13
  17. package/dist/components/AntToast.vue +19 -11
  18. package/dist/components/AntToaster.vue +13 -5
  19. package/dist/components/AntTooltip.vue +78 -54
  20. package/dist/components/__stories/AntAccordion.stories.js +4 -4
  21. package/dist/components/__stories/AntAccordion.stories.mjs +50 -17
  22. package/dist/components/__stories/AntAlert.stories.mjs +18 -5
  23. package/dist/components/__stories/AntCard.stories.mjs +36 -10
  24. package/dist/components/__stories/AntContent.stories.mjs +14 -4
  25. package/dist/components/__stories/AntDropdown.stories.mjs +20 -4
  26. package/dist/components/__stories/AntIcon.stories.mjs +38 -12
  27. package/dist/components/__stories/AntKeycap.stories.mjs +35 -10
  28. package/dist/components/__stories/AntListGroup.stories.d.ts +1 -1
  29. package/dist/components/__stories/AntListGroup.stories.mjs +22 -4
  30. package/dist/components/__stories/AntListGroupItem.stories.mjs +27 -8
  31. package/dist/components/__stories/AntModal.stories.mjs +17 -4
  32. package/dist/components/__stories/AntPagination.stories.mjs +21 -6
  33. package/dist/components/__stories/AntPopover.stories.mjs +20 -4
  34. package/dist/components/__stories/AntSkeleton.stories.mjs +17 -5
  35. package/dist/components/__stories/AntSpinner.stories.mjs +33 -9
  36. package/dist/components/__stories/AntTag.stories.mjs +28 -8
  37. package/dist/components/__stories/AntToast.stories.mjs +19 -5
  38. package/dist/components/__stories/AntToaster.stories.d.ts +1 -1
  39. package/dist/components/__stories/AntToaster.stories.mjs +35 -9
  40. package/dist/components/__stories/AntTooltip.stories.js +1 -1
  41. package/dist/components/__stories/AntTooltip.stories.mjs +44 -13
  42. package/dist/components/buttons/AntActionButton.vue +38 -29
  43. package/dist/components/buttons/AntButton.vue +34 -13
  44. package/dist/components/buttons/AntCreateButton.vue +11 -4
  45. package/dist/components/buttons/AntDeleteButton.vue +11 -4
  46. package/dist/components/buttons/AntDuplicateButton.vue +11 -4
  47. package/dist/components/buttons/AntEditButton.vue +11 -4
  48. package/dist/components/buttons/AntSaveAndNewButton.vue +11 -4
  49. package/dist/components/buttons/AntSaveButton.vue +11 -4
  50. package/dist/components/buttons/__stories/AntActionButton.stories.mjs +35 -10
  51. package/dist/components/buttons/__stories/AntButton.stories.mjs +77 -23
  52. package/dist/components/buttons/__stories/AntCreateButton.stories.mjs +25 -7
  53. package/dist/components/buttons/__stories/AntDeleteButton.stories.mjs +25 -7
  54. package/dist/components/buttons/__stories/AntDuplicateButton.stories.mjs +25 -7
  55. package/dist/components/buttons/__stories/AntEditButton.stories.mjs +25 -7
  56. package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +25 -7
  57. package/dist/components/buttons/__stories/AntSaveButton.stories.mjs +25 -7
  58. package/dist/components/crud/AntCrud.vue +6 -6
  59. package/dist/components/crud/AntCrudDetail.vue +8 -5
  60. package/dist/components/crud/AntCrudDetailActions.vue +14 -8
  61. package/dist/components/crud/AntCrudDetailNav.vue +21 -13
  62. package/dist/components/crud/AntCrudTableFilter.vue +29 -17
  63. package/dist/components/crud/AntCrudTableNav.vue +36 -22
  64. package/dist/components/crud/__stories/AntCrud.stories.mjs +17 -5
  65. package/dist/components/crud/__stories/AntCrudDetail.stories.mjs +11 -3
  66. package/dist/components/crud/__stories/AntCrudDetailActions.stories.mjs +10 -2
  67. package/dist/components/crud/__stories/AntCrudDetailNav.stories.mjs +11 -3
  68. package/dist/components/crud/__stories/AntCrudTableFilter.stories.mjs +17 -5
  69. package/dist/components/crud/__stories/AntCrudTableNav.stories.mjs +23 -7
  70. package/dist/components/dialogs/AntDeleteDialog.vue +13 -5
  71. package/dist/components/dialogs/AntDialog.vue +23 -13
  72. package/dist/components/dialogs/__stories/AndDeleteDialog.stories.mjs +12 -3
  73. package/dist/components/dialogs/__stories/AntDialog.stories.mjs +28 -7
  74. package/dist/components/forms/AntField.vue +18 -7
  75. package/dist/components/forms/AntFormGroup.vue +9 -5
  76. package/dist/components/forms/AntFormGroupLabel.vue +1 -1
  77. package/dist/components/forms/__stories/AntField.stories.mjs +37 -9
  78. package/dist/components/forms/__stories/AntFormGroup.stories.mjs +20 -5
  79. package/dist/components/forms/__stories/AntFormGroupLabel.stories.mjs +11 -3
  80. package/dist/components/index.d.ts +1 -1
  81. package/dist/components/inputs/AntCheckbox.vue +60 -36
  82. package/dist/components/inputs/AntCheckboxGroup.vue +39 -15
  83. package/dist/components/inputs/AntDateInput.vue +35 -12
  84. package/dist/components/inputs/AntNumberInput.vue +33 -12
  85. package/dist/components/inputs/AntPasswordInput.vue +32 -11
  86. package/dist/components/inputs/AntRadio.vue +57 -34
  87. package/dist/components/inputs/AntRadioGroup.vue +60 -35
  88. package/dist/components/inputs/AntRangeSlider.vue +31 -12
  89. package/dist/components/inputs/AntSearch.vue +19 -7
  90. package/dist/components/inputs/AntSelect.vue +107 -83
  91. package/dist/components/inputs/AntSwitch.vue +35 -18
  92. package/dist/components/inputs/AntSwitcher.vue +30 -15
  93. package/dist/components/inputs/AntTagInput.vue +91 -61
  94. package/dist/components/inputs/AntTextInput.vue +31 -11
  95. package/dist/components/inputs/AntTextarea.vue +53 -25
  96. package/dist/components/inputs/AntUnitInput.vue +33 -12
  97. package/dist/components/inputs/Elements/AntBaseInput.vue +47 -18
  98. package/dist/components/inputs/Elements/AntInputDescription.vue +16 -8
  99. package/dist/components/inputs/Elements/AntInputLabel.vue +13 -5
  100. package/dist/components/inputs/Elements/AntInputLimiter.vue +13 -5
  101. package/dist/components/inputs/Elements/AntSelectMenu.vue +65 -41
  102. package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +104 -27
  103. package/dist/components/inputs/Elements/__stories/AntInputDescription.stories.mjs +33 -9
  104. package/dist/components/inputs/Elements/__stories/AntInputLabel.stories.mjs +34 -9
  105. package/dist/components/inputs/Elements/__stories/AntInputLimiter.stories.mjs +33 -9
  106. package/dist/components/inputs/Elements/index.d.ts +1 -1
  107. package/dist/components/inputs/__stories/AntCheckbox.stories.mjs +34 -9
  108. package/dist/components/inputs/__stories/AntCheckboxGroup.stories.mjs +45 -21
  109. package/dist/components/inputs/__stories/AntDateInput.stories.mjs +52 -14
  110. package/dist/components/inputs/__stories/AntNumberInput.stories.mjs +66 -17
  111. package/dist/components/inputs/__stories/AntPasswordInput.stories.mjs +51 -13
  112. package/dist/components/inputs/__stories/AntRadioGroup.stories.mjs +45 -12
  113. package/dist/components/inputs/__stories/AntRangeSlider.stories.mjs +16 -5
  114. package/dist/components/inputs/__stories/AntSearch.stories.mjs +41 -10
  115. package/dist/components/inputs/__stories/AntSelect.stories.mjs +59 -15
  116. package/dist/components/inputs/__stories/AntSwitch.stories.js +126 -102
  117. package/dist/components/inputs/__stories/AntSwitch.stories.mjs +162 -112
  118. package/dist/components/inputs/__stories/AntSwitcher.stories.mjs +38 -10
  119. package/dist/components/inputs/__stories/AntTagInput.stories.mjs +46 -12
  120. package/dist/components/inputs/__stories/AntTextInput.stories.mjs +59 -16
  121. package/dist/components/inputs/__stories/AntTextarea.stories.mjs +47 -13
  122. package/dist/components/inputs/__stories/AntUnitInput.stories.mjs +46 -12
  123. package/dist/components/layouts/AntNavLeftLayout.vue +12 -6
  124. package/dist/components/layouts/__stories/AntNavLeftLayout.stories.mjs +10 -2
  125. package/dist/components/navbar/AntNavbar.vue +7 -3
  126. package/dist/components/navbar/AntNavbarItem.vue +12 -6
  127. package/dist/components/navbar/__stories/AntNavbar.stories.mjs +59 -37
  128. package/dist/components/table/AntCollapsibleTableRowContent.vue +7 -5
  129. package/dist/components/table/AntTable.vue +210 -165
  130. package/dist/components/table/AntTableSkeleton.vue +126 -0
  131. package/dist/components/table/AntTableSortButton.vue +22 -13
  132. package/dist/components/table/AntTd.vue +21 -17
  133. package/dist/components/table/AntTh.vue +19 -12
  134. package/dist/components/table/__stories/AntTable.stories.js +1 -1
  135. package/dist/components/table/__stories/AntTable.stories.mjs +190 -62
  136. package/dist/components/tabs/AntTabItem.vue +20 -8
  137. package/dist/components/tabs/AntTabs.vue +35 -21
  138. package/dist/components/tabs/__stories/AntTabItem.stories.mjs +23 -7
  139. package/dist/components/tabs/__stories/AntTabs.stories.mjs +45 -13
  140. package/dist/components/transitions/AntTransitionCollapseHeight.vue +1 -1
  141. package/dist/composables/useToaster.mjs +25 -7
  142. package/dist/index.css +1 -0
  143. package/dist/utils.mjs +3 -1
  144. package/package.json +23 -16
  145. package/dist/tailwind.config.d.ts +0 -3
  146. package/dist/tailwind.config.js +0 -198
  147. package/dist/tailwind.config.mjs +0 -189
@@ -1,14 +1,24 @@
1
1
  <script lang="ts" setup>
2
- import {computed, ref} from 'vue';
3
- import {InputState} from '../enums';
4
- import {arrow, autoUpdate, flip, offset, useFloating} from "@floating-ui/vue";
5
- import {hasSlotContent} from '../utils';
6
- import {classesToObjectSyntax} from '../utils';
2
+ import {
3
+ computed, ref,
4
+ } from 'vue';
5
+ import {
6
+ InputState,
7
+ } from '../enums';
8
+ import {
9
+ arrow, autoUpdate, flip, offset, useFloating,
10
+ } from '@floating-ui/vue';
11
+ import {
12
+ hasSlotContent,
13
+ } from '../utils';
14
+ import {
15
+ classesToObjectSyntax,
16
+ } from '../utils';
7
17
 
8
18
  const props = withDefaults(defineProps<{
9
- state?: InputState,
10
- delay?: number,
11
- tooltipClasses?: string | Record<string, boolean>
19
+ state?: InputState;
20
+ delay?: number;
21
+ tooltipClasses?: string | Record<string, boolean>;
12
22
  disabled?: boolean;
13
23
  }>(), {
14
24
  state: InputState.base,
@@ -17,46 +27,54 @@ const props = withDefaults(defineProps<{
17
27
  disabled: false,
18
28
  });
19
29
 
20
- const floatOpen = ref<boolean>(false)
30
+ const floatOpen = ref<boolean>(false);
21
31
  const clickLock = ref(false);
22
32
  const timeout = ref<number | undefined>();
23
- const hoverFloat = ref<boolean>(false)
24
- const hoverReference = ref<boolean>(false)
33
+ const hoverFloat = ref<boolean>(false);
34
+ const hoverReference = ref<boolean>(false);
25
35
 
26
- const reference = ref<HTMLElement | null>(null)
27
- const floating = ref<HTMLElement | null>(null)
36
+ const reference = ref<HTMLElement | null>(null);
37
+ const floating = ref<HTMLElement | null>(null);
28
38
  const floatingArrow = ref<HTMLElement | null>(null);
29
39
 
30
- const {floatingStyles, middlewareData, placement} = useFloating(reference, floating, {
40
+ const {
41
+ floatingStyles, middlewareData, placement,
42
+ } = useFloating(reference, floating, {
31
43
  placement: 'top',
32
44
  whileElementsMounted: autoUpdate,
33
45
  middleware: [
34
46
  offset(() => 16),
35
47
  flip({
36
- fallbackPlacements: ['bottom', 'left', 'right'],
48
+ fallbackPlacements: [
49
+ 'bottom',
50
+ 'left',
51
+ 'right',
52
+ ],
37
53
  fallbackAxisSideDirection: 'none',
38
54
  }),
39
- arrow({element: floatingArrow})
40
- ]
55
+ arrow({
56
+ element: floatingArrow,
57
+ }),
58
+ ],
41
59
  });
42
60
  const side = computed(() => placement.value.split('-')[0]);
43
61
  const staticSide = computed(() => {
44
62
  return {
45
- top: "bottom",
46
- right: "left",
47
- bottom: "top",
48
- left: "right"
49
- }[side.value] as string
50
- })
63
+ top: 'bottom',
64
+ right: 'left',
65
+ bottom: 'top',
66
+ left: 'right',
67
+ }[side.value] as string;
68
+ });
51
69
  const arrowTransform = computed(() => {
52
70
  if (placement.value === 'bottom') {
53
- return 'rotate(0deg)'
71
+ return 'rotate(0deg)';
54
72
  } else if (placement.value === 'top') {
55
- return 'rotate(180deg)'
73
+ return 'rotate(180deg)';
56
74
  } else if (placement.value === 'left') {
57
- return 'rotate(90deg)'
75
+ return 'rotate(90deg)';
58
76
  } else {
59
- return 'rotate(270deg)'
77
+ return 'rotate(270deg)';
60
78
  }
61
79
  });
62
80
  const svgPathClasses = computed(() => {
@@ -68,7 +86,9 @@ const svgPathClasses = computed(() => {
68
86
  [InputState.warning]: 'fill-warning-500 stroke-warning-500',
69
87
  };
70
88
 
71
- return {[variants[props.state]]: true};
89
+ return {
90
+ [variants[props.state]]: true,
91
+ };
72
92
  });
73
93
  const arrowSvgPathClasses = computed(() => {
74
94
  const variants: Record<InputState, string> = {
@@ -79,7 +99,9 @@ const arrowSvgPathClasses = computed(() => {
79
99
  [InputState.warning]: 'stroke-warning-500',
80
100
  };
81
101
 
82
- return {[variants[props.state]]: true};
102
+ return {
103
+ [variants[props.state]]: true,
104
+ };
83
105
  });
84
106
  const contentClasses = computed(() => {
85
107
  const variants: Record<InputState, string> = {
@@ -90,11 +112,13 @@ const contentClasses = computed(() => {
90
112
  [InputState.warning]: 'text-warning-500-font bg-warning-500 border-warning-500',
91
113
  };
92
114
 
93
- return {[variants[props.state]]: true};
115
+ return {
116
+ [variants[props.state]]: true,
117
+ };
94
118
  });
95
119
  const _tooltipClasses = computed(() => ({
96
120
  'w-max inline-flex shadow-lg text-sm z-[90] rounded-md': true,
97
- ...classesToObjectSyntax(props.tooltipClasses)
121
+ ...classesToObjectSyntax(props.tooltipClasses),
98
122
  }));
99
123
 
100
124
  function onMouseOver() {
@@ -112,7 +136,7 @@ function onMouseLeave() {
112
136
 
113
137
  timeout.value = setTimeout(() => {
114
138
  if (!hoverFloat.value) {
115
- floatOpen.value = false
139
+ floatOpen.value = false;
116
140
  clickLock.value = false;
117
141
  }
118
142
  }, props.delay) as unknown as number;
@@ -129,7 +153,7 @@ function onMouseLeaveTooltip() {
129
153
 
130
154
  timeout.value = setTimeout(() => {
131
155
  if (!hoverReference.value) {
132
- floatOpen.value = false
156
+ floatOpen.value = false;
133
157
  clickLock.value = false;
134
158
  }
135
159
  }, props.delay) as unknown as number;
@@ -154,46 +178,46 @@ function onClick() {
154
178
  @mouseleave="() => onMouseLeave()"
155
179
  @click="() => onClick()"
156
180
  >
157
- <slot/>
181
+ <slot />
158
182
  </div>
159
183
 
160
184
  <teleport to="body">
161
185
  <div
162
186
  v-if="floatOpen && hasSlotContent($slots.content) && !disabled"
163
- :class="_tooltipClasses"
164
187
  ref="floating"
188
+ :class="_tooltipClasses"
165
189
  :style="{
166
- ...floatingStyles,
167
- display: floatOpen
168
- ? 'block'
169
- : 'none',
190
+ ...floatingStyles,
191
+ display: floatOpen
192
+ ? 'block'
193
+ : 'none',
170
194
  }"
195
+ data-e2e="tooltip-content"
171
196
  @mouseenter="() => onMouseEnterTooltip()"
172
197
  @mouseleave="() => onMouseLeaveTooltip()"
173
- data-e2e="tooltip-content"
174
198
  >
175
199
  <div
176
200
  class="p-2 rounded-md border"
177
201
  :class="contentClasses"
178
202
  >
179
- <slot name="content"/>
203
+ <slot name="content" />
180
204
  </div>
181
205
  <div
182
- class="flex items-center justify-center"
183
206
  ref="floatingArrow"
207
+ class="flex items-center justify-center"
184
208
  :style="{
185
- position: 'absolute',
186
- left:
187
- middlewareData.arrow?.x != null
188
- ? `${middlewareData.arrow.x}px`
189
- : '',
190
- top:
191
- middlewareData.arrow?.y != null
192
- ? `${middlewareData.arrow.y}px`
193
- : '',
194
- [staticSide]: '-2px',
195
- transform: arrowTransform
196
- }"
209
+ position: 'absolute',
210
+ left:
211
+ middlewareData.arrow?.x != null
212
+ ? `${middlewareData.arrow.x}px`
213
+ : '',
214
+ top:
215
+ middlewareData.arrow?.y != null
216
+ ? `${middlewareData.arrow.y}px`
217
+ : '',
218
+ [staticSide]: '-2px',
219
+ transform: arrowTransform
220
+ }"
197
221
  >
198
222
  <div
199
223
  class="flex items-center justify-center"
@@ -162,8 +162,8 @@ const mixedVariants = exports.mixedVariants = {
162
162
  items: [{
163
163
  label: "First entry"
164
164
  }, {
165
- label: `Second entry`,
166
- content: `<div class="bg-success-100 p-4"><span class="font-bold text-success-500">Success</span> Content</div>`,
165
+ label: "Second entry",
166
+ content: '<div class="bg-success-100 p-4"><span class="font-bold text-success-500">Success</span> Content</div>',
167
167
  iconLeft: true,
168
168
  activeLabelClasses: "bg-success-500 text-success-500-font",
169
169
  activeIconClasses: "text-success-500-font",
@@ -172,14 +172,14 @@ const mixedVariants = exports.mixedVariants = {
172
172
  contentPadding: false
173
173
  }, {
174
174
  label: "Third entry",
175
- content: `<div class="bg-warning-100 p-4"><span class="font-bold text-warning-500">Warning</span> Content</div>`,
175
+ content: '<div class="bg-warning-100 p-4"><span class="font-bold text-warning-500">Warning</span> Content</div>',
176
176
  activeLabelClasses: "bg-warning-500 text-warning-500-font",
177
177
  activeIconClasses: "text-warning-500-font",
178
178
  inactiveLabelClasses: "bg-warning-200 text-warning-200-font",
179
179
  inactiveIconClasses: "text-warning-200-font"
180
180
  }, {
181
181
  label: "Fourth entry",
182
- content: `<div class="bg-danger-100 p-8"><span class="font-bold text-danger-500">Danger</span> Content</div>`,
182
+ content: '<div class="bg-danger-100 p-8"><span class="font-bold text-danger-500">Danger</span> Content</div>',
183
183
  activeLabelClasses: "bg-danger-500 text-danger-500-font",
184
184
  activeIconClasses: "text-danger-500-font",
185
185
  inactiveLabelClasses: "bg-danger-200 text-danger-200-font",
@@ -1,16 +1,28 @@
1
1
  import AntAccordion from "../AntAccordion.vue";
2
2
  import AntAccordionItem from "../AntAccordionItem.vue";
3
- import { CollapseStrategy } from "../__types/AntAccordion.types.mjs";
3
+ import {
4
+ CollapseStrategy
5
+ } from "../__types/AntAccordion.types.mjs";
4
6
  import AntIcon from "../AntIcon.vue";
5
- import { faEye } from "@fortawesome/free-solid-svg-icons";
7
+ import {
8
+ faEye
9
+ } from "@fortawesome/free-solid-svg-icons";
6
10
  const meta = {
7
11
  title: "Components/Accordion",
8
12
  component: AntAccordion,
9
- subcomponents: { AntAccordionItem },
10
- parameters: { controls: { sort: "requiredFirst" } },
13
+ subcomponents: {
14
+ AntAccordionItem
15
+ },
16
+ parameters: {
17
+ controls: {
18
+ sort: "requiredFirst"
19
+ }
20
+ },
11
21
  argTypes: {
12
22
  collapseStrategy: {
13
- control: { type: "select" },
23
+ control: {
24
+ type: "select"
25
+ },
14
26
  options: Object.values(CollapseStrategy)
15
27
  }
16
28
  }
@@ -18,12 +30,19 @@ const meta = {
18
30
  export default meta;
19
31
  export const Docs = {
20
32
  parameters: {
21
- chromatic: { disableSnapshot: false }
33
+ chromatic: {
34
+ disableSnapshot: false
35
+ }
22
36
  },
23
37
  render: (args) => ({
24
- components: { AntAccordion, AntAccordionItem },
38
+ components: {
39
+ AntAccordion,
40
+ AntAccordionItem
41
+ },
25
42
  setup() {
26
- return { args };
43
+ return {
44
+ args
45
+ };
27
46
  },
28
47
  template: `
29
48
  <div class="p-4">
@@ -54,9 +73,14 @@ export const Docs = {
54
73
  };
55
74
  export const CustomContent = {
56
75
  render: (args) => ({
57
- components: { AntAccordion, AntAccordionItem },
76
+ components: {
77
+ AntAccordion,
78
+ AntAccordionItem
79
+ },
58
80
  setup() {
59
- return { args };
81
+ return {
82
+ args
83
+ };
60
84
  },
61
85
  template: `
62
86
  <div class="p-4">
@@ -103,12 +127,21 @@ export const htmlInContent = {
103
127
  };
104
128
  export const mixedVariants = {
105
129
  parameters: {
106
- chromatic: { disableSnapshot: false }
130
+ chromatic: {
131
+ disableSnapshot: false
132
+ }
107
133
  },
108
134
  render: (args) => ({
109
- components: { AntAccordion, AntAccordionItem, AntIcon },
135
+ components: {
136
+ AntAccordion,
137
+ AntAccordionItem,
138
+ AntIcon
139
+ },
110
140
  setup() {
111
- return { args, faEye };
141
+ return {
142
+ args,
143
+ faEye
144
+ };
112
145
  },
113
146
  template: `
114
147
  <AntAccordion
@@ -136,8 +169,8 @@ export const mixedVariants = {
136
169
  label: "First entry"
137
170
  },
138
171
  {
139
- label: `Second entry`,
140
- content: `<div class="bg-success-100 p-4"><span class="font-bold text-success-500">Success</span> Content</div>`,
172
+ label: "Second entry",
173
+ content: '<div class="bg-success-100 p-4"><span class="font-bold text-success-500">Success</span> Content</div>',
141
174
  iconLeft: true,
142
175
  activeLabelClasses: "bg-success-500 text-success-500-font",
143
176
  activeIconClasses: "text-success-500-font",
@@ -147,7 +180,7 @@ export const mixedVariants = {
147
180
  },
148
181
  {
149
182
  label: "Third entry",
150
- content: `<div class="bg-warning-100 p-4"><span class="font-bold text-warning-500">Warning</span> Content</div>`,
183
+ content: '<div class="bg-warning-100 p-4"><span class="font-bold text-warning-500">Warning</span> Content</div>',
151
184
  activeLabelClasses: "bg-warning-500 text-warning-500-font",
152
185
  activeIconClasses: "text-warning-500-font",
153
186
  inactiveLabelClasses: "bg-warning-200 text-warning-200-font",
@@ -155,7 +188,7 @@ export const mixedVariants = {
155
188
  },
156
189
  {
157
190
  label: "Fourth entry",
158
- content: `<div class="bg-danger-100 p-8"><span class="font-bold text-danger-500">Danger</span> Content</div>`,
191
+ content: '<div class="bg-danger-100 p-8"><span class="font-bold text-danger-500">Danger</span> Content</div>',
159
192
  activeLabelClasses: "bg-danger-500 text-danger-500-font",
160
193
  activeIconClasses: "text-danger-500-font",
161
194
  inactiveLabelClasses: "bg-danger-200 text-danger-200-font",
@@ -1,12 +1,20 @@
1
1
  import AntAlert from "../AntAlert.vue";
2
- import { InputState } from "../../enums/index.mjs";
2
+ import {
3
+ InputState
4
+ } from "../../enums/index.mjs";
3
5
  const meta = {
4
6
  title: "Components/Alert",
5
7
  component: AntAlert,
6
- parameters: { controls: { sort: "requiredFirst" } },
8
+ parameters: {
9
+ controls: {
10
+ sort: "requiredFirst"
11
+ }
12
+ },
7
13
  argTypes: {
8
14
  state: {
9
- control: { type: "select" },
15
+ control: {
16
+ type: "select"
17
+ },
10
18
  options: Object.values(InputState)
11
19
  }
12
20
  }
@@ -14,12 +22,17 @@ const meta = {
14
22
  export default meta;
15
23
  export const Docs = {
16
24
  render: (args) => ({
17
- components: { AntAlert },
25
+ components: {
26
+ AntAlert
27
+ },
18
28
  setup() {
19
29
  function logClick() {
20
30
  console.log("Clicked close icon");
21
31
  }
22
- return { args, logClick };
32
+ return {
33
+ args,
34
+ logClick
35
+ };
23
36
  },
24
37
  template: `
25
38
  <AntAlert v-bind="args" @close="logClick">
@@ -1,30 +1,47 @@
1
1
  import AntCard from "../AntCard.vue";
2
- import { Size } from "../../enums/index.mjs";
2
+ import {
3
+ Size
4
+ } from "../../enums/index.mjs";
3
5
  import AntFormGroup from "../forms/AntFormGroup.vue";
4
6
  import AntFormGroupLabel from "../forms/AntFormGroupLabel.vue";
5
7
  const meta = {
6
8
  title: "Components/Card",
7
9
  component: AntCard,
8
- parameters: { controls: { sort: "requiredFirst" } },
10
+ parameters: {
11
+ controls: {
12
+ sort: "requiredFirst"
13
+ }
14
+ },
9
15
  argTypes: {
10
16
  size: {
11
- control: { type: "select" },
17
+ control: {
18
+ type: "select"
19
+ },
12
20
  options: Object.values(Size)
13
21
  },
14
22
  padding: {
15
- control: { type: "boolean" }
23
+ control: {
24
+ type: "boolean"
25
+ }
16
26
  },
17
27
  expanded: {
18
- control: { type: "boolean" }
28
+ control: {
29
+ type: "boolean"
30
+ }
19
31
  }
20
32
  }
21
33
  };
22
34
  export default meta;
23
35
  export const Docs = {
24
36
  render: (args) => ({
25
- components: { AntCard },
37
+ components: {
38
+ AntCard
39
+ },
26
40
  setup() {
27
- return { args, Size };
41
+ return {
42
+ args,
43
+ Size
44
+ };
28
45
  },
29
46
  template: `
30
47
  <AntCard v-bind="args">
@@ -41,12 +58,21 @@ export const Docs = {
41
58
  };
42
59
  export const Summary = {
43
60
  parameters: {
44
- chromatic: { disableSnapshot: false }
61
+ chromatic: {
62
+ disableSnapshot: false
63
+ }
45
64
  },
46
65
  render: (args) => ({
47
- components: { AntCard, AntFormGroup, AntFormGroupLabel },
66
+ components: {
67
+ AntCard,
68
+ AntFormGroup,
69
+ AntFormGroupLabel
70
+ },
48
71
  setup() {
49
- return { args, Size };
72
+ return {
73
+ args,
74
+ Size
75
+ };
50
76
  },
51
77
  template: `
52
78
  <AntFormGroup direction="column">
@@ -2,18 +2,28 @@ import AntContent from "../AntContent.vue";
2
2
  const meta = {
3
3
  title: "Components/Content",
4
4
  component: AntContent,
5
- parameters: { controls: { sort: "requiredFirst" } },
5
+ parameters: {
6
+ controls: {
7
+ sort: "requiredFirst"
8
+ }
9
+ },
6
10
  argTypes: {}
7
11
  };
8
12
  export default meta;
9
13
  export const Docs = {
10
14
  parameters: {
11
- chromatic: { disableSnapshot: false }
15
+ chromatic: {
16
+ disableSnapshot: false
17
+ }
12
18
  },
13
19
  render: (args) => ({
14
- components: { AntContent },
20
+ components: {
21
+ AntContent
22
+ },
15
23
  setup() {
16
- return { args };
24
+ return {
25
+ args
26
+ };
17
27
  },
18
28
  template: `
19
29
  <div class="outline outline-base-300">
@@ -1,11 +1,19 @@
1
1
  import AntDropdown from "../AntDropdown.vue";
2
2
  import AntButton from "../buttons/AntButton.vue";
3
3
  import AntTextInput from "../inputs/AntTextInput.vue";
4
- import { computed, onMounted, ref } from "vue";
4
+ import {
5
+ computed,
6
+ onMounted,
7
+ ref
8
+ } from "vue";
5
9
  const meta = {
6
10
  title: "Components/Dropdown",
7
11
  component: AntDropdown,
8
- parameters: { controls: { sort: "requiredFirst" } },
12
+ parameters: {
13
+ controls: {
14
+ sort: "requiredFirst"
15
+ }
16
+ },
9
17
  argTypes: {
10
18
  contentPadding: {
11
19
  description: "If the content require a paddingless dropdown to expand over the whole size, set this to false"
@@ -15,7 +23,11 @@ const meta = {
15
23
  export default meta;
16
24
  export const Docs = {
17
25
  render: (args) => ({
18
- components: { AntDropdown, AntButton, AntTextInput },
26
+ components: {
27
+ AntDropdown,
28
+ AntButton,
29
+ AntTextInput
30
+ },
19
31
  setup() {
20
32
  const showDropdown = computed({
21
33
  get() {
@@ -32,7 +44,11 @@ export const Docs = {
32
44
  scrollContainer.value.scrollTop = (scrollContainer.value.scrollHeight - scrollContainer.value.clientHeight) / 2;
33
45
  }
34
46
  });
35
- return { args, showDropdown, scrollContainer };
47
+ return {
48
+ args,
49
+ showDropdown,
50
+ scrollContainer
51
+ };
36
52
  },
37
53
  template: `
38
54
  <div ref="scrollContainer" class="dashed overflow-scroll" :style="{height: '500px', width: '500px'}">
@@ -1,21 +1,35 @@
1
1
  import AntIcon from "../AntIcon.vue";
2
- import { faTag } from "@fortawesome/free-solid-svg-icons";
3
- import { IconSize } from "../__types/AntIcon.types.mjs";
2
+ import {
3
+ faTag
4
+ } from "@fortawesome/free-solid-svg-icons";
5
+ import {
6
+ IconSize
7
+ } from "../__types/AntIcon.types.mjs";
4
8
  const meta = {
5
9
  title: "Components/Icon",
6
10
  component: AntIcon,
7
- parameters: { controls: { sort: "requiredFirst" } },
11
+ parameters: {
12
+ controls: {
13
+ sort: "requiredFirst"
14
+ }
15
+ },
8
16
  argTypes: {
9
17
  size: {
10
- control: { type: "select" },
18
+ control: {
19
+ type: "select"
20
+ },
11
21
  options: Object.values(IconSize)
12
22
  },
13
23
  icon: {
14
- control: { type: "none" },
24
+ control: {
25
+ type: "none"
26
+ },
15
27
  description: "Use Font-awesome Icons."
16
28
  },
17
29
  color: {
18
- control: { type: "text" },
30
+ control: {
31
+ type: "text"
32
+ },
19
33
  description: "A text-* css class to change the color of the icon."
20
34
  }
21
35
  }
@@ -23,9 +37,13 @@ const meta = {
23
37
  export default meta;
24
38
  export const Docs = {
25
39
  render: (args) => ({
26
- components: { AntIcon },
40
+ components: {
41
+ AntIcon
42
+ },
27
43
  setup() {
28
- return { args };
44
+ return {
45
+ args
46
+ };
29
47
  },
30
48
  template: '<AntIcon v-bind="args"/>'
31
49
  }),
@@ -35,9 +53,13 @@ export const Docs = {
35
53
  };
36
54
  export const Size = {
37
55
  render: (args) => ({
38
- components: { AntIcon },
56
+ components: {
57
+ AntIcon
58
+ },
39
59
  setup() {
40
- return { args };
60
+ return {
61
+ args
62
+ };
41
63
  },
42
64
  template: `
43
65
  <div class="flex flex-col gap-2.5">
@@ -56,9 +78,13 @@ export const Size = {
56
78
  };
57
79
  export const Color = {
58
80
  render: (args) => ({
59
- components: { AntIcon },
81
+ components: {
82
+ AntIcon
83
+ },
60
84
  setup() {
61
- return { args };
85
+ return {
86
+ args
87
+ };
62
88
  },
63
89
  template: `
64
90
  <div class="flex items-center gap-2.5">