@imaginario27/air-ui-ds 1.0.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/assets/css/defaults.css +55 -0
- package/assets/css/main.css +238 -0
- package/assets/css/theme/colors.css +106 -0
- package/assets/css/theme/primitives.css +105 -0
- package/assets/css/theme/ui-theme.css +454 -0
- package/assets/images/placeholders/missing-image-placeholder.png +0 -0
- package/components/accordions/Accordion.vue +31 -0
- package/components/accordions/AccordionGroup.vue +78 -0
- package/components/accordions/AccordionItem.vue +39 -0
- package/components/action-panels/ActionPanel.vue +49 -0
- package/components/alerts/Alert.vue +159 -0
- package/components/avatars/Avatar.vue +152 -0
- package/components/avatars/AvatarStack.vue +97 -0
- package/components/avatars/AvatarStackCounter.vue +74 -0
- package/components/badges/Badge.vue +221 -0
- package/components/badges/BadgeStack.vue +110 -0
- package/components/badges/IconBadge.vue +57 -0
- package/components/badges/IconTextBadge.vue +50 -0
- package/components/breadcrumbs/Breadcrumbs.vue +54 -0
- package/components/buttons/ActionButton.vue +395 -0
- package/components/buttons/ActionIconButton.vue +283 -0
- package/components/buttons/AlertButton.vue +125 -0
- package/components/buttons/AlertIconButton.vue +105 -0
- package/components/buttons/PaginationButton.vue +45 -0
- package/components/buttons/options/OptionButton.vue +61 -0
- package/components/buttons/options/OptionButtonGroup.vue +155 -0
- package/components/buttons/options/OptionButtonSlider.vue +154 -0
- package/components/buttons/toggle/ToggleButton.vue +142 -0
- package/components/buttons/toggle/ToggleButtonGroup.vue +73 -0
- package/components/cards/Card.vue +33 -0
- package/components/cards/CardActions.vue +5 -0
- package/components/cards/CardBody.vue +5 -0
- package/components/cards/CardFooter.vue +20 -0
- package/components/cards/CardHeader.vue +5 -0
- package/components/cards/CardTitle.vue +13 -0
- package/components/cards/specific/ContactDetailsCard.vue +47 -0
- package/components/cards/specific/FeatureCard.vue +59 -0
- package/components/cards/specific/HelpTopicCard.vue +62 -0
- package/components/cards/specific/MetricCard.vue +42 -0
- package/components/cards/specific/TestimonialCard.vue +57 -0
- package/components/cards/specific/subscription/CurrentActiveSubscriptionCard.vue +105 -0
- package/components/cards/specific/subscription/SubscriptionPlanCard.vue +178 -0
- package/components/cards/specific/subscription/UniqueSubscriptionPlanCard.vue +106 -0
- package/components/collapsibles/Collapsible.vue +33 -0
- package/components/content/ContentItem.vue +144 -0
- package/components/content/ContentItemImage.vue +125 -0
- package/components/dividers/Divider.vue +35 -0
- package/components/dividers/TextLineDivider.vue +58 -0
- package/components/dropdowns/DropdownMenu.vue +207 -0
- package/components/dropdowns/DropdownMenuActions.vue +11 -0
- package/components/dropdowns/DropdownMenuItem.vue +240 -0
- package/components/dropdowns/DropdownSelect.vue +469 -0
- package/components/dropdowns/DropdownSelectItem.vue +182 -0
- package/components/empty-states/EmptyState.vue +170 -0
- package/components/features/Feature.vue +77 -0
- package/components/forms/DataDetails.vue +7 -0
- package/components/forms/DataDetailsActions.vue +23 -0
- package/components/forms/DataDetailsFieldGroup.vue +35 -0
- package/components/forms/DataDetailsRow.vue +22 -0
- package/components/forms/Form.vue +25 -0
- package/components/forms/FormActions.vue +23 -0
- package/components/forms/FormFieldGroup.vue +35 -0
- package/components/forms/FormRow.vue +22 -0
- package/components/forms/fields/ButtonField.vue +119 -0
- package/components/forms/fields/CheckboxField.vue +205 -0
- package/components/forms/fields/DataField.vue +99 -0
- package/components/forms/fields/FileUploadField.vue +326 -0
- package/components/forms/fields/InputField.vue +371 -0
- package/components/forms/fields/OptionButtonsGroupField.vue +120 -0
- package/components/forms/fields/RepeaterField.vue +109 -0
- package/components/forms/fields/SearchField.vue +184 -0
- package/components/forms/fields/SelectField.vue +233 -0
- package/components/forms/fields/SliderField.vue +759 -0
- package/components/forms/fields/SwitchField.vue +257 -0
- package/components/forms/fields/TextareaField.vue +205 -0
- package/components/forms/fields/ToggleButtonsGroupField.vue +65 -0
- package/components/forms/fields/radio/RadioButtonField.vue +238 -0
- package/components/forms/fields/radio/RadioField.vue +157 -0
- package/components/forms/fields/radio/RadioGroupField.vue +156 -0
- package/components/icons/ContainedIcon.vue +130 -0
- package/components/images/QRCode.vue +124 -0
- package/components/layouts/ContainerWrapper.vue +13 -0
- package/components/layouts/ContentBody.vue +30 -0
- package/components/layouts/Grid.vue +25 -0
- package/components/layouts/Heading.vue +159 -0
- package/components/layouts/MainContent.vue +26 -0
- package/components/layouts/MaxWidthContainer.vue +15 -0
- package/components/layouts/Overtitle.vue +25 -0
- package/components/layouts/headers/CompactHeader.vue +181 -0
- package/components/layouts/headers/PageHeader.vue +102 -0
- package/components/layouts/headers/WebAppHeader.vue +54 -0
- package/components/layouts/section/Section.vue +90 -0
- package/components/layouts/section/SectionBody.vue +12 -0
- package/components/layouts/section/SectionHeader.vue +12 -0
- package/components/layouts/section/SectionTitle.vue +13 -0
- package/components/lists/List.vue +69 -0
- package/components/lists/ListItem.vue +58 -0
- package/components/loaders/Loading.vue +83 -0
- package/components/loaders/LoadingScreen.vue +285 -0
- package/components/modals/DangerModalDialog.vue +149 -0
- package/components/modals/InfoModalDialog.vue +143 -0
- package/components/modals/ModalActions.vue +22 -0
- package/components/modals/ModalContent.vue +5 -0
- package/components/modals/ModalDescription.vue +5 -0
- package/components/modals/ModalDialog.vue +122 -0
- package/components/modals/ModalHeaderGroup.vue +19 -0
- package/components/modals/ModalHeadings.vue +5 -0
- package/components/modals/ModalSubtitle.vue +14 -0
- package/components/modals/ModalTitle.vue +14 -0
- package/components/modals/SuccessModalDialog.vue +90 -0
- package/components/modules/AppLogo.vue +46 -0
- package/components/modules/SVGImage.vue +44 -0
- package/components/navigation/links/NavLink.vue +112 -0
- package/components/navigation/nav-menu/NavFooterMenu.vue +91 -0
- package/components/navigation/nav-menu/NavMenu.vue +36 -0
- package/components/navigation/nav-menu/NavMenuItem.vue +44 -0
- package/components/navigation/nav-sidebar/BottomUserNavBar.vue +83 -0
- package/components/navigation/nav-sidebar/NavSidebar.vue +172 -0
- package/components/navigation/nav-sidebar/NavSidebarMenu.vue +14 -0
- package/components/navigation/nav-sidebar/NavSidebarMenuItem.vue +76 -0
- package/components/navigation/nav-sidebar/NavSidebarMenuSectionTitle.vue +54 -0
- package/components/navigation/table-of-contents/TableOfContents.vue +35 -0
- package/components/navigation/table-of-contents/TableOfContentsItem.vue +40 -0
- package/components/navigation/table-of-contents/TableOfContentsSidebar.vue +29 -0
- package/components/pagination/ButtonPagination.vue +274 -0
- package/components/pagination/RowsPerPage.vue +60 -0
- package/components/pagination/SimplePagination.vue +97 -0
- package/components/password/SecurePasswordCondition.vue +41 -0
- package/components/password/SecurePasswordConditions.vue +83 -0
- package/components/placeholders/ContentPlaceholder.vue +41 -0
- package/components/popovers/Popover.vue +128 -0
- package/components/rating/InteractiveRating.vue +94 -0
- package/components/rating/Rating.vue +60 -0
- package/components/rating/RatingItem.vue +54 -0
- package/components/skeletons/Skeleton.vue +11 -0
- package/components/spinners/Spinner.vue +13 -0
- package/components/steppers/CircleStepper.vue +122 -0
- package/components/steppers/Step.vue +72 -0
- package/components/steppers/StepIndicator.vue +228 -0
- package/components/steppers/TabStepper.vue +126 -0
- package/components/steppers/vertical-stepper/VerticalStep.vue +223 -0
- package/components/steppers/vertical-stepper/VerticalStepper.vue +63 -0
- package/components/tables/Table.vue +26 -0
- package/components/tables/TableBody.vue +5 -0
- package/components/tables/TableCell.vue +34 -0
- package/components/tables/TableCellActions.vue +7 -0
- package/components/tables/TableHeader.vue +5 -0
- package/components/tables/TableHeaderCell.vue +15 -0
- package/components/tables/TableRow.vue +14 -0
- package/components/tables/TableWrapper.vue +12 -0
- package/components/tabs/Tab.vue +145 -0
- package/components/tabs/TabBar.vue +64 -0
- package/components/tabs/TabContent.vue +5 -0
- package/components/tabs/TabsContainer.vue +5 -0
- package/components/transitions/HorizontalExpansionTransition.vue +12 -0
- package/components/transitions/VerticalExpansionTransition.vue +14 -0
- package/components/users/Author.vue +113 -0
- package/components/users/User.vue +53 -0
- package/composables/useAccordion.ts +12 -0
- package/composables/useDarkMode.ts +9 -0
- package/composables/useDropdownMenu.ts +25 -0
- package/composables/useForm.ts +134 -0
- package/composables/useFormValidationMode.ts +11 -0
- package/composables/useIsMobile.ts +27 -0
- package/composables/useMobileSidebar.ts +32 -0
- package/composables/useShiki.ts +12 -0
- package/composables/useTableOfContents.ts +50 -0
- package/composables/useToastifyConfig.ts +7 -0
- package/eslint.config.mjs +14 -0
- package/models/constants/app.ts +8 -0
- package/models/constants/form.ts +22 -0
- package/models/enums/alerts.ts +6 -0
- package/models/enums/aspect-ratios.ts +9 -0
- package/models/enums/avatars.ts +21 -0
- package/models/enums/badges.ts +10 -0
- package/models/enums/buttons.ts +38 -0
- package/models/enums/colors.ts +9 -0
- package/models/enums/content.ts +4 -0
- package/models/enums/counters.ts +4 -0
- package/models/enums/dividers.ts +9 -0
- package/models/enums/dropdowns.ts +18 -0
- package/models/enums/effects.ts +6 -0
- package/models/enums/emptyPlaceholders.ts +5 -0
- package/models/enums/formFields.ts +19 -0
- package/models/enums/formValidations.ts +4 -0
- package/models/enums/headings.ts +11 -0
- package/models/enums/icons.ts +22 -0
- package/models/enums/images.ts +16 -0
- package/models/enums/lists.ts +10 -0
- package/models/enums/loaders.ts +15 -0
- package/models/enums/navigation.ts +18 -0
- package/models/enums/order.ts +10 -0
- package/models/enums/orientations.ts +4 -0
- package/models/enums/pages.ts +10 -0
- package/models/enums/positions.ts +21 -0
- package/models/enums/rating.ts +12 -0
- package/models/enums/sections.ts +8 -0
- package/models/enums/selects.ts +16 -0
- package/models/enums/sliders.ts +4 -0
- package/models/enums/steppers.ts +20 -0
- package/models/enums/tabs.ts +11 -0
- package/models/enums/triggers.ts +4 -0
- package/models/types/accordions.ts +6 -0
- package/models/types/avatars.ts +4 -0
- package/models/types/badges.ts +4 -0
- package/models/types/buttons.ts +26 -0
- package/models/types/dropdowns.ts +20 -0
- package/models/types/forms.ts +14 -0
- package/models/types/navigation.ts +11 -0
- package/models/types/pagination.ts +4 -0
- package/models/types/pdfExportTable.ts +6 -0
- package/models/types/radio.ts +9 -0
- package/models/types/selects.ts +14 -0
- package/models/types/steppers.ts +17 -0
- package/models/types/tableOfContent.ts +6 -0
- package/models/types/tabs.ts +7 -0
- package/nuxt.config.ts +40 -0
- package/package.json +57 -0
- package/plugins/vue3-toastify.ts +14 -0
- package/tsconfig.json +7 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="dynamicComponent"
|
|
4
|
+
v-bind="{
|
|
5
|
+
...componentProps,
|
|
6
|
+
...$attrs,
|
|
7
|
+
...(actionType === DropdownActionType.ACTION ? { onClick: emitClick } : {})
|
|
8
|
+
}"
|
|
9
|
+
:class="[
|
|
10
|
+
'flex flex-col justify-center',
|
|
11
|
+
'px-3',
|
|
12
|
+
'text-sm',
|
|
13
|
+
'hover:bg-background-neutral-hover-subtle hover:cursor-pointer',
|
|
14
|
+
'w-full',
|
|
15
|
+
sizeClass,
|
|
16
|
+
typeClass,
|
|
17
|
+
hasSeparator ? 'border-b border-border-default' : undefined,
|
|
18
|
+
helpText ? 'py-2' : undefined,
|
|
19
|
+
]"
|
|
20
|
+
>
|
|
21
|
+
<div class="flex items-center gap-3 w-full">
|
|
22
|
+
<MdiIcon
|
|
23
|
+
v-if="icon && (type === DropdownItemType.ICON || type === DropdownItemType.DANGER_ICON)"
|
|
24
|
+
:icon="icon"
|
|
25
|
+
size="20"
|
|
26
|
+
preserveAspectRatio="xMidYMid meet"
|
|
27
|
+
:class="[
|
|
28
|
+
'min-w-[20px]',
|
|
29
|
+
iconColorClass
|
|
30
|
+
]"
|
|
31
|
+
/>
|
|
32
|
+
<template v-if="type === DropdownItemType.IMAGE">
|
|
33
|
+
<img
|
|
34
|
+
v-if="imgUrl && isImageLoaded"
|
|
35
|
+
:src="imgUrl"
|
|
36
|
+
:alt
|
|
37
|
+
class="w-[24px] h-[24px] rounded"
|
|
38
|
+
@load="handleImageLoad"
|
|
39
|
+
@error="handleImageError"
|
|
40
|
+
>
|
|
41
|
+
<img
|
|
42
|
+
v-else
|
|
43
|
+
:src="missingImagePlaceholder"
|
|
44
|
+
:alt
|
|
45
|
+
class="w-[24px] h-[24px] rounded"
|
|
46
|
+
>
|
|
47
|
+
</template>
|
|
48
|
+
<span v-if="type !== DropdownItemType.USER" class="text-sm">
|
|
49
|
+
{{ text }}
|
|
50
|
+
</span>
|
|
51
|
+
<User
|
|
52
|
+
v-if="userDisplayName && type === DropdownItemType.USER"
|
|
53
|
+
:displayName="userDisplayName"
|
|
54
|
+
:imgUrl="userProfileImg"
|
|
55
|
+
:size="AvatarSize.XS"
|
|
56
|
+
/>
|
|
57
|
+
</div>
|
|
58
|
+
<p
|
|
59
|
+
v-if="helpText"
|
|
60
|
+
class="text-xs text-text-neutral-subtle mt-2"
|
|
61
|
+
>
|
|
62
|
+
{{ helpText }}
|
|
63
|
+
</p>
|
|
64
|
+
</component>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<script setup lang="ts">
|
|
68
|
+
// Imports
|
|
69
|
+
//@ts-ignore
|
|
70
|
+
import JsonExcel from "vue-json-excel3"
|
|
71
|
+
import missingImagePlaceholder from "@/assets/images/placeholders/missing-image-placeholder.png"
|
|
72
|
+
import { NuxtLink } from '#components'
|
|
73
|
+
|
|
74
|
+
// Component options
|
|
75
|
+
defineOptions({
|
|
76
|
+
inheritAttrs: false, // Prevents Vue from automatically applying attributes incorrectly
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
// Props
|
|
80
|
+
const props = defineProps({
|
|
81
|
+
actionType: {
|
|
82
|
+
type: String as PropType<DropdownActionType>,
|
|
83
|
+
default: DropdownActionType.LINK,
|
|
84
|
+
validator: (value: DropdownActionType) => Object.values(DropdownActionType).includes(value),
|
|
85
|
+
},
|
|
86
|
+
text: {
|
|
87
|
+
type: String as PropType<string>,
|
|
88
|
+
default: "Menu item text",
|
|
89
|
+
},
|
|
90
|
+
icon: {
|
|
91
|
+
type: String as PropType<any>,
|
|
92
|
+
default: "mdiHelp",
|
|
93
|
+
},
|
|
94
|
+
size: {
|
|
95
|
+
type: String as PropType<DropdownItemSize>,
|
|
96
|
+
default: DropdownItemSize.MD,
|
|
97
|
+
validator: (value: DropdownItemSize) => Object.values(DropdownItemSize).includes(value),
|
|
98
|
+
},
|
|
99
|
+
type: {
|
|
100
|
+
type: String as PropType<DropdownItemType>,
|
|
101
|
+
default: DropdownItemType.TEXT,
|
|
102
|
+
validator: (value: DropdownItemType) => Object.values(DropdownItemType).includes(value),
|
|
103
|
+
},
|
|
104
|
+
userDisplayName: {
|
|
105
|
+
type: String as PropType<string>,
|
|
106
|
+
default: "Test user",
|
|
107
|
+
},
|
|
108
|
+
userProfileImg: String as PropType<string>,
|
|
109
|
+
imgUrl: String as PropType<string>,
|
|
110
|
+
alt: {
|
|
111
|
+
type: String as PropType<string>,
|
|
112
|
+
default: "Menu item image",
|
|
113
|
+
},
|
|
114
|
+
helpText: String as PropType<string>,
|
|
115
|
+
to: {
|
|
116
|
+
type: String as PropType<string>,
|
|
117
|
+
default: "/",
|
|
118
|
+
},
|
|
119
|
+
isExternal: {
|
|
120
|
+
type: Boolean as PropType<boolean>,
|
|
121
|
+
default: false,
|
|
122
|
+
},
|
|
123
|
+
exportData: {
|
|
124
|
+
type: Array as PropType<Record<string, any>[]>,
|
|
125
|
+
default: () => [],
|
|
126
|
+
},
|
|
127
|
+
exportFields: {
|
|
128
|
+
type: Object as PropType<Record<string, any>>,
|
|
129
|
+
default: () => ({}),
|
|
130
|
+
},
|
|
131
|
+
exportType: {
|
|
132
|
+
type: String as PropType<string>,
|
|
133
|
+
default: "xls",
|
|
134
|
+
},
|
|
135
|
+
exportFileName: {
|
|
136
|
+
type: String as PropType<string>,
|
|
137
|
+
default: "exported-data",
|
|
138
|
+
},
|
|
139
|
+
hasSeparator: {
|
|
140
|
+
type: Boolean as PropType<boolean>,
|
|
141
|
+
default: false,
|
|
142
|
+
},
|
|
143
|
+
})
|
|
144
|
+
|
|
145
|
+
// States
|
|
146
|
+
const isImageLoaded = ref(true)
|
|
147
|
+
|
|
148
|
+
// Emits
|
|
149
|
+
const emit = defineEmits(["click", "close"])
|
|
150
|
+
const emitClick = () => {
|
|
151
|
+
if (props.actionType === DropdownActionType.ACTION) {
|
|
152
|
+
emit("click")
|
|
153
|
+
emit("close")
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* // Shallow ref - Avoid issues with SSR and JsonExcel
|
|
158
|
+
const JsonExcel = shallowRef() */
|
|
159
|
+
|
|
160
|
+
// Handlers for image load and error
|
|
161
|
+
const handleImageLoad = () => {
|
|
162
|
+
isImageLoaded.value = true
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const handleImageError = () => {
|
|
166
|
+
isImageLoaded.value = false
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Computed attributes
|
|
170
|
+
const sizeClass = computed(() => {
|
|
171
|
+
const sizeVariant = {
|
|
172
|
+
[DropdownItemSize.MD]: "min-h-[36px]",
|
|
173
|
+
[DropdownItemSize.LG]: "min-h-[40px]",
|
|
174
|
+
}
|
|
175
|
+
return sizeVariant[props.size as DropdownItemSize] || "min-h-[36px]"
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
const typeClass = computed(() => {
|
|
179
|
+
const typeVariant = {
|
|
180
|
+
[DropdownItemType.DANGER_ICON]: "text-text-delete",
|
|
181
|
+
[DropdownItemType.TEXT]: "text-text-default",
|
|
182
|
+
[DropdownItemType.ICON]: "text-text-default",
|
|
183
|
+
[DropdownItemType.IMAGE]: "text-text-default",
|
|
184
|
+
[DropdownItemType.USER]: "text-text-default",
|
|
185
|
+
}
|
|
186
|
+
return typeVariant[props.type as DropdownItemType] || "text-text-default"
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
const iconColorClass = computed(() => {
|
|
190
|
+
const colorVariant = {
|
|
191
|
+
[DropdownItemType.DANGER_ICON]: "text-icon-delete",
|
|
192
|
+
[DropdownItemType.TEXT]: "text-icon-neutral-subtle",
|
|
193
|
+
[DropdownItemType.ICON]: "text-icon-neutral-subtle",
|
|
194
|
+
[DropdownItemType.IMAGE]: undefined,
|
|
195
|
+
[DropdownItemType.USER]: undefined,
|
|
196
|
+
}
|
|
197
|
+
return colorVariant[props.type as DropdownItemType] || "text-icon-neutral-subtle"
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
// Determine the dynamic component
|
|
201
|
+
const dynamicComponent = computed(() => {
|
|
202
|
+
switch (props.actionType) {
|
|
203
|
+
case DropdownActionType.LINK:
|
|
204
|
+
return NuxtLink
|
|
205
|
+
case DropdownActionType.EXPORT_EXCEL:
|
|
206
|
+
return JsonExcel
|
|
207
|
+
case DropdownActionType.ACTION:
|
|
208
|
+
return "div"
|
|
209
|
+
default:
|
|
210
|
+
return "div"
|
|
211
|
+
}
|
|
212
|
+
})
|
|
213
|
+
|
|
214
|
+
// Props for the dynamic component
|
|
215
|
+
const componentProps = computed(() => {
|
|
216
|
+
if (props.actionType === DropdownActionType.LINK) {
|
|
217
|
+
return {
|
|
218
|
+
to: props.to,
|
|
219
|
+
target: props.isExternal ? '_blank' : '_self',
|
|
220
|
+
rel: props.isExternal ? 'noopener noreferrer' : undefined,
|
|
221
|
+
external: props.isExternal,
|
|
222
|
+
}
|
|
223
|
+
} else if (props.actionType === DropdownActionType.EXPORT_EXCEL) {
|
|
224
|
+
return {
|
|
225
|
+
data: props.exportData,
|
|
226
|
+
fields: props.exportFields,
|
|
227
|
+
name: `${props.exportFileName}.${props.exportType}`,
|
|
228
|
+
}
|
|
229
|
+
} else {
|
|
230
|
+
return {}
|
|
231
|
+
}
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
/* onMounted(async () => {
|
|
235
|
+
//@ts-ignore
|
|
236
|
+
const module = await import('vue-json-excel3')
|
|
237
|
+
JsonExcel.value = module.default
|
|
238
|
+
})
|
|
239
|
+
*/
|
|
240
|
+
</script>
|