@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.
- package/dist/components/AntAccordion.vue +25 -12
- package/dist/components/AntAccordionItem.vue +28 -13
- package/dist/components/AntAlert.vue +25 -15
- package/dist/components/AntCard.vue +26 -14
- package/dist/components/AntContent.vue +4 -4
- package/dist/components/AntDropdown.vue +41 -23
- package/dist/components/AntIcon.vue +18 -6
- package/dist/components/AntKeycap.vue +31 -16
- package/dist/components/AntListGroup.vue +13 -11
- package/dist/components/AntListGroupItem.vue +19 -9
- package/dist/components/AntModal.vue +26 -15
- package/dist/components/AntPagination.vue +28 -15
- package/dist/components/AntPopover.vue +74 -51
- package/dist/components/AntSkeleton.vue +8 -4
- package/dist/components/AntSpinner.vue +14 -6
- package/dist/components/AntTag.vue +25 -13
- package/dist/components/AntToast.vue +19 -11
- package/dist/components/AntToaster.vue +13 -5
- package/dist/components/AntTooltip.vue +78 -54
- package/dist/components/__stories/AntAccordion.stories.js +4 -4
- package/dist/components/__stories/AntAccordion.stories.mjs +50 -17
- package/dist/components/__stories/AntAlert.stories.mjs +18 -5
- package/dist/components/__stories/AntCard.stories.mjs +36 -10
- package/dist/components/__stories/AntContent.stories.mjs +14 -4
- package/dist/components/__stories/AntDropdown.stories.mjs +20 -4
- package/dist/components/__stories/AntIcon.stories.mjs +38 -12
- package/dist/components/__stories/AntKeycap.stories.mjs +35 -10
- package/dist/components/__stories/AntListGroup.stories.d.ts +1 -1
- package/dist/components/__stories/AntListGroup.stories.mjs +22 -4
- package/dist/components/__stories/AntListGroupItem.stories.mjs +27 -8
- package/dist/components/__stories/AntModal.stories.mjs +17 -4
- package/dist/components/__stories/AntPagination.stories.mjs +21 -6
- package/dist/components/__stories/AntPopover.stories.mjs +20 -4
- package/dist/components/__stories/AntSkeleton.stories.mjs +17 -5
- package/dist/components/__stories/AntSpinner.stories.mjs +33 -9
- package/dist/components/__stories/AntTag.stories.mjs +28 -8
- package/dist/components/__stories/AntToast.stories.mjs +19 -5
- package/dist/components/__stories/AntToaster.stories.d.ts +1 -1
- package/dist/components/__stories/AntToaster.stories.mjs +35 -9
- package/dist/components/__stories/AntTooltip.stories.js +1 -1
- package/dist/components/__stories/AntTooltip.stories.mjs +44 -13
- package/dist/components/buttons/AntActionButton.vue +38 -29
- package/dist/components/buttons/AntButton.vue +34 -13
- package/dist/components/buttons/AntCreateButton.vue +11 -4
- package/dist/components/buttons/AntDeleteButton.vue +11 -4
- package/dist/components/buttons/AntDuplicateButton.vue +11 -4
- package/dist/components/buttons/AntEditButton.vue +11 -4
- package/dist/components/buttons/AntSaveAndNewButton.vue +11 -4
- package/dist/components/buttons/AntSaveButton.vue +11 -4
- package/dist/components/buttons/__stories/AntActionButton.stories.mjs +35 -10
- package/dist/components/buttons/__stories/AntButton.stories.mjs +77 -23
- package/dist/components/buttons/__stories/AntCreateButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntDeleteButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntDuplicateButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntEditButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +25 -7
- package/dist/components/buttons/__stories/AntSaveButton.stories.mjs +25 -7
- package/dist/components/crud/AntCrud.vue +6 -6
- package/dist/components/crud/AntCrudDetail.vue +8 -5
- package/dist/components/crud/AntCrudDetailActions.vue +14 -8
- package/dist/components/crud/AntCrudDetailNav.vue +21 -13
- package/dist/components/crud/AntCrudTableFilter.vue +29 -17
- package/dist/components/crud/AntCrudTableNav.vue +36 -22
- package/dist/components/crud/__stories/AntCrud.stories.mjs +17 -5
- package/dist/components/crud/__stories/AntCrudDetail.stories.mjs +11 -3
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.mjs +10 -2
- package/dist/components/crud/__stories/AntCrudDetailNav.stories.mjs +11 -3
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.mjs +17 -5
- package/dist/components/crud/__stories/AntCrudTableNav.stories.mjs +23 -7
- package/dist/components/dialogs/AntDeleteDialog.vue +13 -5
- package/dist/components/dialogs/AntDialog.vue +23 -13
- package/dist/components/dialogs/__stories/AndDeleteDialog.stories.mjs +12 -3
- package/dist/components/dialogs/__stories/AntDialog.stories.mjs +28 -7
- package/dist/components/forms/AntField.vue +18 -7
- package/dist/components/forms/AntFormGroup.vue +9 -5
- package/dist/components/forms/AntFormGroupLabel.vue +1 -1
- package/dist/components/forms/__stories/AntField.stories.mjs +37 -9
- package/dist/components/forms/__stories/AntFormGroup.stories.mjs +20 -5
- package/dist/components/forms/__stories/AntFormGroupLabel.stories.mjs +11 -3
- package/dist/components/index.d.ts +1 -1
- package/dist/components/inputs/AntCheckbox.vue +60 -36
- package/dist/components/inputs/AntCheckboxGroup.vue +39 -15
- package/dist/components/inputs/AntDateInput.vue +35 -12
- package/dist/components/inputs/AntNumberInput.vue +33 -12
- package/dist/components/inputs/AntPasswordInput.vue +32 -11
- package/dist/components/inputs/AntRadio.vue +57 -34
- package/dist/components/inputs/AntRadioGroup.vue +60 -35
- package/dist/components/inputs/AntRangeSlider.vue +31 -12
- package/dist/components/inputs/AntSearch.vue +19 -7
- package/dist/components/inputs/AntSelect.vue +107 -83
- package/dist/components/inputs/AntSwitch.vue +35 -18
- package/dist/components/inputs/AntSwitcher.vue +30 -15
- package/dist/components/inputs/AntTagInput.vue +91 -61
- package/dist/components/inputs/AntTextInput.vue +31 -11
- package/dist/components/inputs/AntTextarea.vue +53 -25
- package/dist/components/inputs/AntUnitInput.vue +33 -12
- package/dist/components/inputs/Elements/AntBaseInput.vue +47 -18
- package/dist/components/inputs/Elements/AntInputDescription.vue +16 -8
- package/dist/components/inputs/Elements/AntInputLabel.vue +13 -5
- package/dist/components/inputs/Elements/AntInputLimiter.vue +13 -5
- package/dist/components/inputs/Elements/AntSelectMenu.vue +65 -41
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +104 -27
- package/dist/components/inputs/Elements/__stories/AntInputDescription.stories.mjs +33 -9
- package/dist/components/inputs/Elements/__stories/AntInputLabel.stories.mjs +34 -9
- package/dist/components/inputs/Elements/__stories/AntInputLimiter.stories.mjs +33 -9
- package/dist/components/inputs/Elements/index.d.ts +1 -1
- package/dist/components/inputs/__stories/AntCheckbox.stories.mjs +34 -9
- package/dist/components/inputs/__stories/AntCheckboxGroup.stories.mjs +45 -21
- package/dist/components/inputs/__stories/AntDateInput.stories.mjs +52 -14
- package/dist/components/inputs/__stories/AntNumberInput.stories.mjs +66 -17
- package/dist/components/inputs/__stories/AntPasswordInput.stories.mjs +51 -13
- package/dist/components/inputs/__stories/AntRadioGroup.stories.mjs +45 -12
- package/dist/components/inputs/__stories/AntRangeSlider.stories.mjs +16 -5
- package/dist/components/inputs/__stories/AntSearch.stories.mjs +41 -10
- package/dist/components/inputs/__stories/AntSelect.stories.mjs +59 -15
- package/dist/components/inputs/__stories/AntSwitch.stories.js +126 -102
- package/dist/components/inputs/__stories/AntSwitch.stories.mjs +162 -112
- package/dist/components/inputs/__stories/AntSwitcher.stories.mjs +38 -10
- package/dist/components/inputs/__stories/AntTagInput.stories.mjs +46 -12
- package/dist/components/inputs/__stories/AntTextInput.stories.mjs +59 -16
- package/dist/components/inputs/__stories/AntTextarea.stories.mjs +47 -13
- package/dist/components/inputs/__stories/AntUnitInput.stories.mjs +46 -12
- package/dist/components/layouts/AntNavLeftLayout.vue +12 -6
- package/dist/components/layouts/__stories/AntNavLeftLayout.stories.mjs +10 -2
- package/dist/components/navbar/AntNavbar.vue +7 -3
- package/dist/components/navbar/AntNavbarItem.vue +12 -6
- package/dist/components/navbar/__stories/AntNavbar.stories.mjs +59 -37
- package/dist/components/table/AntCollapsibleTableRowContent.vue +7 -5
- package/dist/components/table/AntTable.vue +210 -165
- package/dist/components/table/AntTableSkeleton.vue +126 -0
- package/dist/components/table/AntTableSortButton.vue +22 -13
- package/dist/components/table/AntTd.vue +21 -17
- package/dist/components/table/AntTh.vue +19 -12
- package/dist/components/table/__stories/AntTable.stories.js +1 -1
- package/dist/components/table/__stories/AntTable.stories.mjs +190 -62
- package/dist/components/tabs/AntTabItem.vue +20 -8
- package/dist/components/tabs/AntTabs.vue +35 -21
- package/dist/components/tabs/__stories/AntTabItem.stories.mjs +23 -7
- package/dist/components/tabs/__stories/AntTabs.stories.mjs +45 -13
- package/dist/components/transitions/AntTransitionCollapseHeight.vue +1 -1
- package/dist/composables/useToaster.mjs +25 -7
- package/dist/index.css +1 -0
- package/dist/utils.mjs +3 -1
- package/package.json +23 -16
- package/dist/tailwind.config.d.ts +0 -3
- package/dist/tailwind.config.js +0 -198
- package/dist/tailwind.config.mjs +0 -189
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
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 {
|
|
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: [
|
|
48
|
+
fallbackPlacements: [
|
|
49
|
+
'bottom',
|
|
50
|
+
'left',
|
|
51
|
+
'right',
|
|
52
|
+
],
|
|
37
53
|
fallbackAxisSideDirection: 'none',
|
|
38
54
|
}),
|
|
39
|
-
arrow({
|
|
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:
|
|
46
|
-
right:
|
|
47
|
-
bottom:
|
|
48
|
-
left:
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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:
|
|
166
|
-
content:
|
|
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:
|
|
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:
|
|
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 {
|
|
3
|
+
import {
|
|
4
|
+
CollapseStrategy
|
|
5
|
+
} from "../__types/AntAccordion.types.mjs";
|
|
4
6
|
import AntIcon from "../AntIcon.vue";
|
|
5
|
-
import {
|
|
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: {
|
|
10
|
-
|
|
13
|
+
subcomponents: {
|
|
14
|
+
AntAccordionItem
|
|
15
|
+
},
|
|
16
|
+
parameters: {
|
|
17
|
+
controls: {
|
|
18
|
+
sort: "requiredFirst"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
11
21
|
argTypes: {
|
|
12
22
|
collapseStrategy: {
|
|
13
|
-
control: {
|
|
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: {
|
|
33
|
+
chromatic: {
|
|
34
|
+
disableSnapshot: false
|
|
35
|
+
}
|
|
22
36
|
},
|
|
23
37
|
render: (args) => ({
|
|
24
|
-
components: {
|
|
38
|
+
components: {
|
|
39
|
+
AntAccordion,
|
|
40
|
+
AntAccordionItem
|
|
41
|
+
},
|
|
25
42
|
setup() {
|
|
26
|
-
return {
|
|
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: {
|
|
76
|
+
components: {
|
|
77
|
+
AntAccordion,
|
|
78
|
+
AntAccordionItem
|
|
79
|
+
},
|
|
58
80
|
setup() {
|
|
59
|
-
return {
|
|
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: {
|
|
130
|
+
chromatic: {
|
|
131
|
+
disableSnapshot: false
|
|
132
|
+
}
|
|
107
133
|
},
|
|
108
134
|
render: (args) => ({
|
|
109
|
-
components: {
|
|
135
|
+
components: {
|
|
136
|
+
AntAccordion,
|
|
137
|
+
AntAccordionItem,
|
|
138
|
+
AntIcon
|
|
139
|
+
},
|
|
110
140
|
setup() {
|
|
111
|
-
return {
|
|
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:
|
|
140
|
-
content:
|
|
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:
|
|
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:
|
|
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 {
|
|
2
|
+
import {
|
|
3
|
+
InputState
|
|
4
|
+
} from "../../enums/index.mjs";
|
|
3
5
|
const meta = {
|
|
4
6
|
title: "Components/Alert",
|
|
5
7
|
component: AntAlert,
|
|
6
|
-
parameters: {
|
|
8
|
+
parameters: {
|
|
9
|
+
controls: {
|
|
10
|
+
sort: "requiredFirst"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
7
13
|
argTypes: {
|
|
8
14
|
state: {
|
|
9
|
-
control: {
|
|
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: {
|
|
25
|
+
components: {
|
|
26
|
+
AntAlert
|
|
27
|
+
},
|
|
18
28
|
setup() {
|
|
19
29
|
function logClick() {
|
|
20
30
|
console.log("Clicked close icon");
|
|
21
31
|
}
|
|
22
|
-
return {
|
|
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 {
|
|
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: {
|
|
10
|
+
parameters: {
|
|
11
|
+
controls: {
|
|
12
|
+
sort: "requiredFirst"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
9
15
|
argTypes: {
|
|
10
16
|
size: {
|
|
11
|
-
control: {
|
|
17
|
+
control: {
|
|
18
|
+
type: "select"
|
|
19
|
+
},
|
|
12
20
|
options: Object.values(Size)
|
|
13
21
|
},
|
|
14
22
|
padding: {
|
|
15
|
-
control: {
|
|
23
|
+
control: {
|
|
24
|
+
type: "boolean"
|
|
25
|
+
}
|
|
16
26
|
},
|
|
17
27
|
expanded: {
|
|
18
|
-
control: {
|
|
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: {
|
|
37
|
+
components: {
|
|
38
|
+
AntCard
|
|
39
|
+
},
|
|
26
40
|
setup() {
|
|
27
|
-
return {
|
|
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: {
|
|
61
|
+
chromatic: {
|
|
62
|
+
disableSnapshot: false
|
|
63
|
+
}
|
|
45
64
|
},
|
|
46
65
|
render: (args) => ({
|
|
47
|
-
components: {
|
|
66
|
+
components: {
|
|
67
|
+
AntCard,
|
|
68
|
+
AntFormGroup,
|
|
69
|
+
AntFormGroupLabel
|
|
70
|
+
},
|
|
48
71
|
setup() {
|
|
49
|
-
return {
|
|
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: {
|
|
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: {
|
|
15
|
+
chromatic: {
|
|
16
|
+
disableSnapshot: false
|
|
17
|
+
}
|
|
12
18
|
},
|
|
13
19
|
render: (args) => ({
|
|
14
|
-
components: {
|
|
20
|
+
components: {
|
|
21
|
+
AntContent
|
|
22
|
+
},
|
|
15
23
|
setup() {
|
|
16
|
-
return {
|
|
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 {
|
|
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: {
|
|
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: {
|
|
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 {
|
|
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 {
|
|
3
|
-
|
|
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: {
|
|
11
|
+
parameters: {
|
|
12
|
+
controls: {
|
|
13
|
+
sort: "requiredFirst"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
8
16
|
argTypes: {
|
|
9
17
|
size: {
|
|
10
|
-
control: {
|
|
18
|
+
control: {
|
|
19
|
+
type: "select"
|
|
20
|
+
},
|
|
11
21
|
options: Object.values(IconSize)
|
|
12
22
|
},
|
|
13
23
|
icon: {
|
|
14
|
-
control: {
|
|
24
|
+
control: {
|
|
25
|
+
type: "none"
|
|
26
|
+
},
|
|
15
27
|
description: "Use Font-awesome Icons."
|
|
16
28
|
},
|
|
17
29
|
color: {
|
|
18
|
-
control: {
|
|
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: {
|
|
40
|
+
components: {
|
|
41
|
+
AntIcon
|
|
42
|
+
},
|
|
27
43
|
setup() {
|
|
28
|
-
return {
|
|
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: {
|
|
56
|
+
components: {
|
|
57
|
+
AntIcon
|
|
58
|
+
},
|
|
39
59
|
setup() {
|
|
40
|
-
return {
|
|
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: {
|
|
81
|
+
components: {
|
|
82
|
+
AntIcon
|
|
83
|
+
},
|
|
60
84
|
setup() {
|
|
61
|
-
return {
|
|
85
|
+
return {
|
|
86
|
+
args
|
|
87
|
+
};
|
|
62
88
|
},
|
|
63
89
|
template: `
|
|
64
90
|
<div class="flex items-center gap-2.5">
|