@antify/ui 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/LICENSE +21 -0
- package/README.md +14 -0
- package/dist/components/AntAccordion.vue +64 -0
- package/dist/components/AntAccordionItem.vue +119 -0
- package/dist/components/AntAlert.vue +146 -0
- package/dist/components/AntCard.vue +34 -0
- package/dist/components/AntContent.vue +16 -0
- package/dist/components/AntDropdown.vue +100 -0
- package/dist/components/AntIcon.vue +56 -0
- package/dist/components/AntKeycap.vue +45 -0
- package/dist/components/AntListGroup.vue +24 -0
- package/dist/components/AntListGroupItem.vue +83 -0
- package/dist/components/AntModal.vue +130 -0
- package/dist/components/AntPagination.vue +205 -0
- package/dist/components/AntPopover.vue +135 -0
- package/dist/components/AntSkeleton.vue +38 -0
- package/dist/components/AntSpinner.vue +101 -0
- package/dist/components/AntTag.vue +114 -0
- package/dist/components/AntToast.vue +119 -0
- package/dist/components/AntToaster.vue +71 -0
- package/dist/components/AntTooltip.vue +189 -0
- package/dist/components/Main.stories.d.ts +7 -0
- package/dist/components/Main.stories.js +15 -0
- package/dist/components/Main.stories.mjs +8 -0
- package/dist/components/__stories/AntAccordion.stories.d.ts +9 -0
- package/dist/components/__stories/AntAccordion.stories.js +120 -0
- package/dist/components/__stories/AntAccordion.stories.mjs +101 -0
- package/dist/components/__stories/AntAlert.stories.d.ts +11 -0
- package/dist/components/__stories/AntAlert.stories.js +99 -0
- package/dist/components/__stories/AntAlert.stories.mjs +81 -0
- package/dist/components/__stories/AntCard.stories.d.ts +7 -0
- package/dist/components/__stories/AntCard.stories.js +118 -0
- package/dist/components/__stories/AntCard.stories.mjs +87 -0
- package/dist/components/__stories/AntContent.stories.d.ts +6 -0
- package/dist/components/__stories/AntContent.stories.js +43 -0
- package/dist/components/__stories/AntContent.stories.mjs +26 -0
- package/dist/components/__stories/AntDropdown.stories.d.ts +6 -0
- package/dist/components/__stories/AntDropdown.stories.js +71 -0
- package/dist/components/__stories/AntDropdown.stories.mjs +52 -0
- package/dist/components/__stories/AntIcon.stories.d.ts +8 -0
- package/dist/components/__stories/AntIcon.stories.js +122 -0
- package/dist/components/__stories/AntIcon.stories.mjs +93 -0
- package/dist/components/__stories/AntKeycap.stories.d.ts +9 -0
- package/dist/components/__stories/AntKeycap.stories.js +98 -0
- package/dist/components/__stories/AntKeycap.stories.mjs +69 -0
- package/dist/components/__stories/AntListGroup.stories.d.ts +7 -0
- package/dist/components/__stories/AntListGroup.stories.js +56 -0
- package/dist/components/__stories/AntListGroup.stories.mjs +36 -0
- package/dist/components/__stories/AntListGroupItem.stories.d.ts +10 -0
- package/dist/components/__stories/AntListGroupItem.stories.js +83 -0
- package/dist/components/__stories/AntListGroupItem.stories.mjs +62 -0
- package/dist/components/__stories/AntModal.stories.d.ts +7 -0
- package/dist/components/__stories/AntModal.stories.js +96 -0
- package/dist/components/__stories/AntModal.stories.mjs +78 -0
- package/dist/components/__stories/AntPagination.stories.d.ts +8 -0
- package/dist/components/__stories/AntPagination.stories.js +57 -0
- package/dist/components/__stories/AntPagination.stories.mjs +41 -0
- package/dist/components/__stories/AntPopover.stories.d.ts +6 -0
- package/dist/components/__stories/AntPopover.stories.js +67 -0
- package/dist/components/__stories/AntPopover.stories.mjs +47 -0
- package/dist/components/__stories/AntSkeleton.stories.d.ts +8 -0
- package/dist/components/__stories/AntSkeleton.stories.js +60 -0
- package/dist/components/__stories/AntSkeleton.stories.mjs +43 -0
- package/dist/components/__stories/AntSpinner.stories.d.ts +6 -0
- package/dist/components/__stories/AntSpinner.stories.js +61 -0
- package/dist/components/__stories/AntSpinner.stories.mjs +34 -0
- package/dist/components/__stories/AntTag.stories.d.ts +7 -0
- package/dist/components/__stories/AntTag.stories.js +65 -0
- package/dist/components/__stories/AntTag.stories.mjs +43 -0
- package/dist/components/__stories/AntToast.stories.d.ts +8 -0
- package/dist/components/__stories/AntToast.stories.js +85 -0
- package/dist/components/__stories/AntToast.stories.mjs +66 -0
- package/dist/components/__stories/AntToaster.stories.d.ts +42 -0
- package/dist/components/__stories/AntToaster.stories.js +128 -0
- package/dist/components/__stories/AntToaster.stories.mjs +110 -0
- package/dist/components/__stories/AntTooltip.stories.d.ts +16 -0
- package/dist/components/__stories/AntTooltip.stories.js +283 -0
- package/dist/components/__stories/AntTooltip.stories.mjs +241 -0
- package/dist/components/__types/AntAccordion.types.d.ts +4 -0
- package/dist/components/__types/AntAccordion.types.js +11 -0
- package/dist/components/__types/AntAccordion.types.mjs +5 -0
- package/dist/components/__types/AntIcon.types.d.ts +8 -0
- package/dist/components/__types/AntIcon.types.js +15 -0
- package/dist/components/__types/AntIcon.types.mjs +9 -0
- package/dist/components/__types/AntKeycap.types.d.ts +4 -0
- package/dist/components/__types/AntKeycap.types.js +11 -0
- package/dist/components/__types/AntKeycap.types.mjs +5 -0
- package/dist/components/__types/AntListGroupItem.types.d.ts +9 -0
- package/dist/components/__types/AntListGroupItem.types.js +16 -0
- package/dist/components/__types/AntListGroupItem.types.mjs +10 -0
- package/dist/components/__types/AntSpinner.types.d.ts +10 -0
- package/dist/components/__types/AntSpinner.types.js +17 -0
- package/dist/components/__types/AntSpinner.types.mjs +11 -0
- package/dist/components/__types/AntTag.types.d.ts +17 -0
- package/dist/components/__types/AntTag.types.js +25 -0
- package/dist/components/__types/AntTag.types.mjs +19 -0
- package/dist/components/__types/AntToaster.types.d.ts +8 -0
- package/dist/components/__types/AntToaster.types.js +1 -0
- package/dist/components/__types/AntToaster.types.mjs +0 -0
- package/dist/components/__types/index.d.ts +7 -0
- package/dist/components/__types/index.js +82 -0
- package/dist/components/__types/index.mjs +7 -0
- package/dist/components/buttons/AntActionButton.vue +74 -0
- package/dist/components/buttons/AntButton.vue +257 -0
- package/dist/components/buttons/AntCreateButton.vue +54 -0
- package/dist/components/buttons/AntDeleteButton.vue +54 -0
- package/dist/components/buttons/AntDuplicateButton.vue +54 -0
- package/dist/components/buttons/AntEditButton.vue +54 -0
- package/dist/components/buttons/AntSaveAndNewButton.vue +56 -0
- package/dist/components/buttons/AntSaveButton.vue +55 -0
- package/dist/components/buttons/__stories/AntActionButton.stories.d.ts +11 -0
- package/dist/components/buttons/__stories/AntActionButton.stories.js +111 -0
- package/dist/components/buttons/__stories/AntActionButton.stories.mjs +86 -0
- package/dist/components/buttons/__stories/AntButton.stories.d.ts +16 -0
- package/dist/components/buttons/__stories/AntButton.stories.js +361 -0
- package/dist/components/buttons/__stories/AntButton.stories.mjs +313 -0
- package/dist/components/buttons/__stories/AntCreateButton.stories.d.ts +12 -0
- package/dist/components/buttons/__stories/AntCreateButton.stories.js +97 -0
- package/dist/components/buttons/__stories/AntCreateButton.stories.mjs +76 -0
- package/dist/components/buttons/__stories/AntDeleteButton.stories.d.ts +12 -0
- package/dist/components/buttons/__stories/AntDeleteButton.stories.js +97 -0
- package/dist/components/buttons/__stories/AntDeleteButton.stories.mjs +76 -0
- package/dist/components/buttons/__stories/AntDuplicateButton.stories.d.ts +12 -0
- package/dist/components/buttons/__stories/AntDuplicateButton.stories.js +97 -0
- package/dist/components/buttons/__stories/AntDuplicateButton.stories.mjs +76 -0
- package/dist/components/buttons/__stories/AntEditButton.stories.d.ts +12 -0
- package/dist/components/buttons/__stories/AntEditButton.stories.js +97 -0
- package/dist/components/buttons/__stories/AntEditButton.stories.mjs +76 -0
- package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.d.ts +12 -0
- package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.js +97 -0
- package/dist/components/buttons/__stories/AntSaveAndNewButton.stories.mjs +76 -0
- package/dist/components/buttons/__stories/AntSaveButton.stories.d.ts +12 -0
- package/dist/components/buttons/__stories/AntSaveButton.stories.js +97 -0
- package/dist/components/buttons/__stories/AntSaveButton.stories.mjs +76 -0
- package/dist/components/buttons/__types/AntButton.types.d.ts +4 -0
- package/dist/components/buttons/__types/AntButton.types.js +11 -0
- package/dist/components/buttons/__types/AntButton.types.mjs +5 -0
- package/dist/components/buttons/__types/index.d.ts +1 -0
- package/dist/components/buttons/__types/index.js +16 -0
- package/dist/components/buttons/__types/index.mjs +1 -0
- package/dist/components/crud/AntCrud.vue +75 -0
- package/dist/components/crud/AntCrudDetail.vue +11 -0
- package/dist/components/crud/AntCrudDetailActions.vue +58 -0
- package/dist/components/crud/AntCrudDetailNav.vue +64 -0
- package/dist/components/crud/AntCrudTableFilter.vue +122 -0
- package/dist/components/crud/AntCrudTableNav.vue +149 -0
- package/dist/components/crud/__stories/AntCrud.stories.d.ts +6 -0
- package/dist/components/crud/__stories/AntCrud.stories.js +131 -0
- package/dist/components/crud/__stories/AntCrud.stories.mjs +130 -0
- package/dist/components/crud/__stories/AntCrudDetail.stories.d.ts +7 -0
- package/dist/components/crud/__stories/AntCrudDetail.stories.js +90 -0
- package/dist/components/crud/__stories/AntCrudDetail.stories.mjs +84 -0
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.d.ts +6 -0
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.js +38 -0
- package/dist/components/crud/__stories/AntCrudDetailActions.stories.mjs +25 -0
- package/dist/components/crud/__stories/AntCrudDetailNav.stories.d.ts +6 -0
- package/dist/components/crud/__stories/AntCrudDetailNav.stories.js +51 -0
- package/dist/components/crud/__stories/AntCrudDetailNav.stories.mjs +45 -0
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.d.ts +6 -0
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.js +42 -0
- package/dist/components/crud/__stories/AntCrudTableFilter.stories.mjs +27 -0
- package/dist/components/crud/__stories/AntCrudTableNav.stories.d.ts +8 -0
- package/dist/components/crud/__stories/AntCrudTableNav.stories.js +77 -0
- package/dist/components/crud/__stories/AntCrudTableNav.stories.mjs +58 -0
- package/dist/components/dialogs/AntDeleteDialog.vue +29 -0
- package/dist/components/dialogs/AntDialog.vue +182 -0
- package/dist/components/dialogs/__stories/AndDeleteDialog.stories.d.ts +6 -0
- package/dist/components/dialogs/__stories/AndDeleteDialog.stories.js +48 -0
- package/dist/components/dialogs/__stories/AndDeleteDialog.stories.mjs +32 -0
- package/dist/components/dialogs/__stories/AntDialog.stories.d.ts +6 -0
- package/dist/components/dialogs/__stories/AntDialog.stories.js +84 -0
- package/dist/components/dialogs/__stories/AntDialog.stories.mjs +60 -0
- package/dist/components/forms/AntField.vue +123 -0
- package/dist/components/forms/AntFormGroup.vue +36 -0
- package/dist/components/forms/AntFormGroupLabel.vue +5 -0
- package/dist/components/forms/__stories/AntField.stories.d.ts +6 -0
- package/dist/components/forms/__stories/AntField.stories.js +110 -0
- package/dist/components/forms/__stories/AntField.stories.mjs +80 -0
- package/dist/components/forms/__stories/AntFormGroup.stories.d.ts +6 -0
- package/dist/components/forms/__stories/AntFormGroup.stories.js +53 -0
- package/dist/components/forms/__stories/AntFormGroup.stories.mjs +33 -0
- package/dist/components/forms/__stories/AntFormGroupLabel.stories.d.ts +6 -0
- package/dist/components/forms/__stories/AntFormGroupLabel.stories.js +35 -0
- package/dist/components/forms/__stories/AntFormGroupLabel.stories.mjs +20 -0
- package/dist/components/index.d.ts +62 -0
- package/dist/components/index.js +433 -0
- package/dist/components/index.mjs +124 -0
- package/dist/components/inputs/AntCheckbox.vue +201 -0
- package/dist/components/inputs/AntCheckboxGroup.vue +117 -0
- package/dist/components/inputs/AntDateInput.vue +104 -0
- package/dist/components/inputs/AntNumberInput.vue +157 -0
- package/dist/components/inputs/AntPasswordInput.vue +107 -0
- package/dist/components/inputs/AntRadio.vue +214 -0
- package/dist/components/inputs/AntRadioGroup.vue +127 -0
- package/dist/components/inputs/AntRangeSlider.vue +121 -0
- package/dist/components/inputs/AntRichTextEditor.vue +237 -0
- package/dist/components/inputs/AntSearch.vue +75 -0
- package/dist/components/inputs/AntSelect.vue +319 -0
- package/dist/components/inputs/AntSwitch.vue +192 -0
- package/dist/components/inputs/AntSwitcher.vue +196 -0
- package/dist/components/inputs/AntTagInput.vue +339 -0
- package/dist/components/inputs/AntTextInput.vue +75 -0
- package/dist/components/inputs/AntTextarea.vue +191 -0
- package/dist/components/inputs/AntUnitInput.vue +96 -0
- package/dist/components/inputs/Elements/AntBaseInput.vue +319 -0
- package/dist/components/inputs/Elements/AntDropDown.vue +189 -0
- package/dist/components/inputs/Elements/AntInputDescription.vue +58 -0
- package/dist/components/inputs/Elements/AntInputLabel.vue +62 -0
- package/dist/components/inputs/Elements/AntInputLimiter.vue +58 -0
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.d.ts +11 -0
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.js +311 -0
- package/dist/components/inputs/Elements/__stories/AntBaseInput.stories.mjs +234 -0
- package/dist/components/inputs/Elements/__stories/AntInputDescription.stories.d.ts +6 -0
- package/dist/components/inputs/Elements/__stories/AntInputDescription.stories.js +61 -0
- package/dist/components/inputs/Elements/__stories/AntInputDescription.stories.mjs +34 -0
- package/dist/components/inputs/Elements/__stories/AntInputLabel.stories.d.ts +7 -0
- package/dist/components/inputs/Elements/__stories/AntInputLabel.stories.js +76 -0
- package/dist/components/inputs/Elements/__stories/AntInputLabel.stories.mjs +46 -0
- package/dist/components/inputs/Elements/__stories/AntInputLimiter.stories.d.ts +6 -0
- package/dist/components/inputs/Elements/__stories/AntInputLimiter.stories.js +64 -0
- package/dist/components/inputs/Elements/__stories/AntInputLimiter.stories.mjs +37 -0
- package/dist/components/inputs/Elements/__types/AntBaseInput.types.d.ts +17 -0
- package/dist/components/inputs/Elements/__types/AntBaseInput.types.js +24 -0
- package/dist/components/inputs/Elements/__types/AntBaseInput.types.mjs +18 -0
- package/dist/components/inputs/Elements/__types/index.d.ts +1 -0
- package/dist/components/inputs/Elements/__types/index.js +16 -0
- package/dist/components/inputs/Elements/__types/index.mjs +1 -0
- package/dist/components/inputs/Elements/index.d.ts +6 -0
- package/dist/components/inputs/Elements/index.js +41 -0
- package/dist/components/inputs/Elements/index.mjs +12 -0
- package/dist/components/inputs/__stories/AntCheckbox.stories.d.ts +8 -0
- package/dist/components/inputs/__stories/AntCheckbox.stories.js +415 -0
- package/dist/components/inputs/__stories/AntCheckbox.stories.mjs +382 -0
- package/dist/components/inputs/__stories/AntCheckboxGroup.stories.d.ts +7 -0
- package/dist/components/inputs/__stories/AntCheckboxGroup.stories.js +107 -0
- package/dist/components/inputs/__stories/AntCheckboxGroup.stories.mjs +84 -0
- package/dist/components/inputs/__stories/AntDateInput.stories.d.ts +8 -0
- package/dist/components/inputs/__stories/AntDateInput.stories.js +233 -0
- package/dist/components/inputs/__stories/AntDateInput.stories.mjs +193 -0
- package/dist/components/inputs/__stories/AntNumberInput.stories.d.ts +10 -0
- package/dist/components/inputs/__stories/AntNumberInput.stories.js +301 -0
- package/dist/components/inputs/__stories/AntNumberInput.stories.mjs +246 -0
- package/dist/components/inputs/__stories/AntPasswordInput.stories.d.ts +8 -0
- package/dist/components/inputs/__stories/AntPasswordInput.stories.js +206 -0
- package/dist/components/inputs/__stories/AntPasswordInput.stories.mjs +156 -0
- package/dist/components/inputs/__stories/AntRadioGroup.stories.d.ts +8 -0
- package/dist/components/inputs/__stories/AntRadioGroup.stories.js +279 -0
- package/dist/components/inputs/__stories/AntRadioGroup.stories.mjs +251 -0
- package/dist/components/inputs/__stories/AntRangeSlider.stories.d.ts +7 -0
- package/dist/components/inputs/__stories/AntRangeSlider.stories.js +86 -0
- package/dist/components/inputs/__stories/AntRangeSlider.stories.mjs +67 -0
- package/dist/components/inputs/__stories/AntRichTextEditor.stories-old.d.ts +0 -0
- package/dist/components/inputs/__stories/AntRichTextEditor.stories-old.js +1 -0
- package/dist/components/inputs/__stories/AntRichTextEditor.stories-old.mjs +0 -0
- package/dist/components/inputs/__stories/AntSearch.stories.d.ts +7 -0
- package/dist/components/inputs/__stories/AntSearch.stories.js +137 -0
- package/dist/components/inputs/__stories/AntSearch.stories.mjs +103 -0
- package/dist/components/inputs/__stories/AntSelect.stories.d.ts +13 -0
- package/dist/components/inputs/__stories/AntSelect.stories.js +287 -0
- package/dist/components/inputs/__stories/AntSelect.stories.mjs +255 -0
- package/dist/components/inputs/__stories/AntSwitch.stories.d.ts +8 -0
- package/dist/components/inputs/__stories/AntSwitch.stories.js +376 -0
- package/dist/components/inputs/__stories/AntSwitch.stories.mjs +344 -0
- package/dist/components/inputs/__stories/AntSwitcher.stories.d.ts +8 -0
- package/dist/components/inputs/__stories/AntSwitcher.stories.js +252 -0
- package/dist/components/inputs/__stories/AntSwitcher.stories.mjs +235 -0
- package/dist/components/inputs/__stories/AntTagInput.stories.d.ts +9 -0
- package/dist/components/inputs/__stories/AntTagInput.stories.js +256 -0
- package/dist/components/inputs/__stories/AntTagInput.stories.mjs +228 -0
- package/dist/components/inputs/__stories/AntTextInput.stories.d.ts +9 -0
- package/dist/components/inputs/__stories/AntTextInput.stories.js +271 -0
- package/dist/components/inputs/__stories/AntTextInput.stories.mjs +225 -0
- package/dist/components/inputs/__stories/AntTextarea.stories.d.ts +9 -0
- package/dist/components/inputs/__stories/AntTextarea.stories.js +189 -0
- package/dist/components/inputs/__stories/AntTextarea.stories.mjs +144 -0
- package/dist/components/inputs/__stories/AntUnitInput.stories.d.ts +9 -0
- package/dist/components/inputs/__stories/AntUnitInput.stories.js +158 -0
- package/dist/components/inputs/__stories/AntUnitInput.stories.mjs +116 -0
- package/dist/components/inputs/__types/AntCheckbox.types.d.ts +6 -0
- package/dist/components/inputs/__types/AntCheckbox.types.js +1 -0
- package/dist/components/inputs/__types/AntCheckbox.types.mjs +0 -0
- package/dist/components/inputs/__types/AntDateInput.types.d.ts +7 -0
- package/dist/components/inputs/__types/AntDateInput.types.js +14 -0
- package/dist/components/inputs/__types/AntDateInput.types.mjs +8 -0
- package/dist/components/inputs/__types/AntRadio.types.d.ts +9 -0
- package/dist/components/inputs/__types/AntRadio.types.js +1 -0
- package/dist/components/inputs/__types/AntRadio.types.mjs +0 -0
- package/dist/components/inputs/__types/AntSelect.types.d.ts +4 -0
- package/dist/components/inputs/__types/AntSelect.types.js +1 -0
- package/dist/components/inputs/__types/AntSelect.types.mjs +0 -0
- package/dist/components/inputs/__types/AntSwitcher.types.d.ts +4 -0
- package/dist/components/inputs/__types/AntSwitcher.types.js +1 -0
- package/dist/components/inputs/__types/AntSwitcher.types.mjs +0 -0
- package/dist/components/inputs/__types/AntTagInput.types.d.ts +5 -0
- package/dist/components/inputs/__types/AntTagInput.types.js +12 -0
- package/dist/components/inputs/__types/AntTagInput.types.mjs +6 -0
- package/dist/components/inputs/__types/AntTextInput.types.d.ts +6 -0
- package/dist/components/inputs/__types/AntTextInput.types.js +13 -0
- package/dist/components/inputs/__types/AntTextInput.types.mjs +7 -0
- package/dist/components/inputs/__types/index.d.ts +7 -0
- package/dist/components/inputs/__types/index.js +82 -0
- package/dist/components/inputs/__types/index.mjs +7 -0
- package/dist/components/layouts/AntNavLeftLayout.vue +36 -0
- package/dist/components/layouts/__stories/AntNavLeftLayout.stories.d.ts +7 -0
- package/dist/components/layouts/__stories/AntNavLeftLayout.stories.js +77 -0
- package/dist/components/layouts/__stories/AntNavLeftLayout.stories.mjs +68 -0
- package/dist/components/navbar/AntNavbar.vue +25 -0
- package/dist/components/navbar/AntNavbarItem.vue +78 -0
- package/dist/components/navbar/__stories/AntNavbar.stories.d.ts +6 -0
- package/dist/components/navbar/__stories/AntNavbar.stories.js +73 -0
- package/dist/components/navbar/__stories/AntNavbar.stories.mjs +64 -0
- package/dist/components/navbar/__types/NavbarItem.types.d.ts +10 -0
- package/dist/components/navbar/__types/NavbarItem.types.js +1 -0
- package/dist/components/navbar/__types/NavbarItem.types.mjs +0 -0
- package/dist/components/navbar/__types/index.d.ts +1 -0
- package/dist/components/navbar/__types/index.js +16 -0
- package/dist/components/navbar/__types/index.mjs +1 -0
- package/dist/components/table/AntTable.vue +218 -0
- package/dist/components/table/AntTableSortButton.vue +48 -0
- package/dist/components/table/AntTd.vue +81 -0
- package/dist/components/table/AntTh.vue +78 -0
- package/dist/components/table/__stories/AntTable.stories.d.ts +9 -0
- package/dist/components/table/__stories/AntTable.stories.js +308 -0
- package/dist/components/table/__stories/AntTable.stories.mjs +273 -0
- package/dist/components/table/__types/TableHeader.types.d.ts +36 -0
- package/dist/components/table/__types/TableHeader.types.js +31 -0
- package/dist/components/table/__types/TableHeader.types.mjs +25 -0
- package/dist/components/table/__types/index.d.ts +1 -0
- package/dist/components/table/__types/index.js +16 -0
- package/dist/components/table/__types/index.mjs +1 -0
- package/dist/components/tabs/AntTabItem.vue +118 -0
- package/dist/components/tabs/AntTabs.vue +47 -0
- package/dist/components/tabs/__stories/AntTabItem.stories.d.ts +6 -0
- package/dist/components/tabs/__stories/AntTabItem.stories.js +52 -0
- package/dist/components/tabs/__stories/AntTabItem.stories.mjs +36 -0
- package/dist/components/tabs/__stories/AntTabs.stories.d.ts +9 -0
- package/dist/components/tabs/__stories/AntTabs.stories.js +183 -0
- package/dist/components/tabs/__stories/AntTabs.stories.mjs +179 -0
- package/dist/components/tabs/__types/AntTabItem.types.d.ts +17 -0
- package/dist/components/tabs/__types/AntTabItem.types.js +12 -0
- package/dist/components/tabs/__types/AntTabItem.types.mjs +6 -0
- package/dist/components/tabs/__types/index.d.ts +1 -0
- package/dist/components/tabs/__types/index.js +16 -0
- package/dist/components/tabs/__types/index.mjs +1 -0
- package/dist/components/transitions/AntTransitionCollapseHeight.vue +96 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.js +16 -0
- package/dist/composables/index.mjs +1 -0
- package/dist/composables/useToaster.d.ts +21 -0
- package/dist/composables/useToaster.js +72 -0
- package/dist/composables/useToaster.mjs +53 -0
- package/dist/enums/Direction.enum.d.ts +4 -0
- package/dist/enums/Direction.enum.js +11 -0
- package/dist/enums/Direction.enum.mjs +5 -0
- package/dist/enums/Grouped.enum.d.ts +6 -0
- package/dist/enums/Grouped.enum.js +13 -0
- package/dist/enums/Grouped.enum.mjs +7 -0
- package/dist/enums/Position.enum.d.ts +12 -0
- package/dist/enums/Position.enum.js +20 -0
- package/dist/enums/Position.enum.mjs +14 -0
- package/dist/enums/Size.enum.d.ts +7 -0
- package/dist/enums/Size.enum.js +14 -0
- package/dist/enums/Size.enum.mjs +8 -0
- package/dist/enums/State.enum.d.ts +16 -0
- package/dist/enums/State.enum.js +24 -0
- package/dist/enums/State.enum.mjs +18 -0
- package/dist/enums/index.d.ts +5 -0
- package/dist/enums/index.js +60 -0
- package/dist/enums/index.mjs +5 -0
- package/dist/handler.d.ts +1 -0
- package/dist/handler.js +11 -0
- package/dist/handler.mjs +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +60 -0
- package/dist/index.mjs +5 -0
- package/dist/install.d.ts +3 -0
- package/dist/install.js +17 -0
- package/dist/install.mjs +9 -0
- package/dist/tailwind.config.d.ts +2 -0
- package/dist/tailwind.config.js +198 -0
- package/dist/tailwind.config.mjs +189 -0
- package/dist/types.d.ts +8 -0
- package/dist/types.js +93 -0
- package/dist/types.mjs +8 -0
- package/dist/utils.d.ts +20 -0
- package/dist/utils.js +49 -0
- package/dist/utils.mjs +41 -0
- package/package.json +100 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 antify
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Antify UI
|
|
2
|
+
|
|
3
|
+
The antify ui is a vue component library for applications based on tailwindcss.
|
|
4
|
+
|
|
5
|
+
# Development
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
pnpm i && pnpm dev
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Useful links:
|
|
12
|
+
|
|
13
|
+
- Chromatic docu: https://www.chromatic.com/docs/
|
|
14
|
+
- Storybook docu: https://storybook.js.org/docs/vue/get-started/introduction
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import AntAccordionItem from './AntAccordionItem.vue';
|
|
3
|
+
import {onMounted, ref} from 'vue';
|
|
4
|
+
import {CollapseStrategy} from './__types/AntAccordion.types';
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(defineProps<{
|
|
7
|
+
items: {
|
|
8
|
+
label?: string;
|
|
9
|
+
content?: string;
|
|
10
|
+
isOpen?: boolean;
|
|
11
|
+
iconLeft?: boolean;
|
|
12
|
+
}[];
|
|
13
|
+
collapseStrategy?: CollapseStrategy;
|
|
14
|
+
}>(), {
|
|
15
|
+
collapseStrategy: CollapseStrategy.single
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const openItems = ref<number[]>([]);
|
|
19
|
+
|
|
20
|
+
onMounted(() => {
|
|
21
|
+
openItems.value = props.items
|
|
22
|
+
.map((item, index) => item.isOpen ? index : -1)
|
|
23
|
+
.filter((index) => index !== -1);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
function onOpen(index: number) {
|
|
27
|
+
if (props.collapseStrategy === CollapseStrategy.single) {
|
|
28
|
+
openItems.value = [index];
|
|
29
|
+
} else {
|
|
30
|
+
openItems.value = [...openItems.value, index];
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function onClose(index: number) {
|
|
35
|
+
if (props.collapseStrategy === CollapseStrategy.single) {
|
|
36
|
+
openItems.value = [];
|
|
37
|
+
} else {
|
|
38
|
+
openItems.value = openItems.value.filter((item) => item !== index);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<template>
|
|
44
|
+
<div class="w-full h-full flex flex-col bg-neutral-300 gap-px">
|
|
45
|
+
<slot>
|
|
46
|
+
<AntAccordionItem
|
|
47
|
+
v-for="(item, index) in items"
|
|
48
|
+
:key="`accordion-item-${index}`"
|
|
49
|
+
:label="item.label"
|
|
50
|
+
:is-open="openItems.includes(index)"
|
|
51
|
+
:icon-left="item.iconLeft"
|
|
52
|
+
@open="() => onOpen(index)"
|
|
53
|
+
@close="() => onClose(index)"
|
|
54
|
+
>
|
|
55
|
+
<slot
|
|
56
|
+
name="item-content"
|
|
57
|
+
v-bind="{item, index}"
|
|
58
|
+
>
|
|
59
|
+
<div v-html="item.content"/>
|
|
60
|
+
</slot>
|
|
61
|
+
</AntAccordionItem>
|
|
62
|
+
</slot>
|
|
63
|
+
</div>
|
|
64
|
+
</template>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {faAngleDown, faAngleUp, faQuestionCircle} from '@fortawesome/free-solid-svg-icons';
|
|
3
|
+
import AntIcon from './AntIcon.vue';
|
|
4
|
+
import AntTransitionCollapseHeight from './transitions/AntTransitionCollapseHeight.vue';
|
|
5
|
+
import {IconSize} from './__types/AntIcon.types';
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<{
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
label?: string;
|
|
10
|
+
collapseTransition?: string;
|
|
11
|
+
iconLeft: boolean;
|
|
12
|
+
}>(), {
|
|
13
|
+
collapseTransition: 'slide',
|
|
14
|
+
iconLeft: false,
|
|
15
|
+
});
|
|
16
|
+
const emit = defineEmits(['close', 'open']);
|
|
17
|
+
|
|
18
|
+
// TODO:: Stehengeblieben: delays machen
|
|
19
|
+
function onClick() {
|
|
20
|
+
if (props.isOpen) {
|
|
21
|
+
emit('close');
|
|
22
|
+
} else {
|
|
23
|
+
emit('open');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<div
|
|
30
|
+
class="p-2 select-none cursor-pointer transition-colors"
|
|
31
|
+
:class="{'bg-primary-500 text-primary-500-font': isOpen, 'bg-white text-for-white-bg-font': !isOpen}"
|
|
32
|
+
@click="onClick"
|
|
33
|
+
>
|
|
34
|
+
<slot
|
|
35
|
+
name="label"
|
|
36
|
+
v-bind="{ isOpen: isOpen }"
|
|
37
|
+
>
|
|
38
|
+
<div
|
|
39
|
+
class="hover:text-gray-800 flex justify-between items-center"
|
|
40
|
+
>
|
|
41
|
+
<div class="flex items-center gap-2">
|
|
42
|
+
<AntIcon
|
|
43
|
+
v-if="iconLeft"
|
|
44
|
+
:size="IconSize.sm"
|
|
45
|
+
:icon="faQuestionCircle"
|
|
46
|
+
:color="isOpen ? 'text-primary-500-font' : 'text-for-white-bg-font'"
|
|
47
|
+
/>
|
|
48
|
+
|
|
49
|
+
<span class="text-sm font-semibold">
|
|
50
|
+
{{ label }}
|
|
51
|
+
</span>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<AntIcon
|
|
55
|
+
:icon="isOpen ? faAngleUp : faAngleDown"
|
|
56
|
+
:color="isOpen ? 'text-primary-500-font' : undefined"
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
</slot>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<AntTransitionCollapseHeight>
|
|
63
|
+
<div
|
|
64
|
+
v-show="isOpen"
|
|
65
|
+
class="bg-white overflow-hidden -mt-px"
|
|
66
|
+
>
|
|
67
|
+
<Transition name="bounce">
|
|
68
|
+
<div
|
|
69
|
+
v-show="isOpen"
|
|
70
|
+
class="p-2 text-sm bg-white text-for-white-bg-font"
|
|
71
|
+
>
|
|
72
|
+
<slot/>
|
|
73
|
+
</div>
|
|
74
|
+
</Transition>
|
|
75
|
+
</div>
|
|
76
|
+
</AntTransitionCollapseHeight>
|
|
77
|
+
</template>
|
|
78
|
+
|
|
79
|
+
<style scoped>
|
|
80
|
+
.bounce-enter-active {
|
|
81
|
+
animation: bounce .6s;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.bounce-leave-active {
|
|
85
|
+
animation: bounce .6s reverse;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@keyframes bounce {
|
|
89
|
+
0% {
|
|
90
|
+
transform: translateY(-100%);
|
|
91
|
+
opacity: 0;
|
|
92
|
+
}
|
|
93
|
+
50% {
|
|
94
|
+
transform: translateY(5%);
|
|
95
|
+
opacity: 1;
|
|
96
|
+
}
|
|
97
|
+
100% {
|
|
98
|
+
transform: translateY(0%);
|
|
99
|
+
opacity: 1;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.slide-enter-active {
|
|
104
|
+
animation: slide 1s;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.slide-leave-active {
|
|
108
|
+
animation: slide 1s reverse;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/*@keyframes slide {
|
|
112
|
+
0% {
|
|
113
|
+
//transform: translateY(-100%); max-height: 0; opacity: 0;
|
|
114
|
+
}
|
|
115
|
+
100% {
|
|
116
|
+
//transform: translateY(0%); max-height: 100%; opacity: 1;
|
|
117
|
+
}
|
|
118
|
+
}*/
|
|
119
|
+
</style>
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {computed, onMounted, useSlots} from 'vue';
|
|
3
|
+
import {handleEnumValidation} from '../handler';
|
|
4
|
+
import {
|
|
5
|
+
faCheckCircle,
|
|
6
|
+
faCircleQuestion,
|
|
7
|
+
faExclamationCircle,
|
|
8
|
+
faExclamationTriangle,
|
|
9
|
+
faInfoCircle,
|
|
10
|
+
faXmark
|
|
11
|
+
} from '@fortawesome/free-solid-svg-icons';
|
|
12
|
+
import AntIcon from './AntIcon.vue';
|
|
13
|
+
import AntTooltip from './AntTooltip.vue';
|
|
14
|
+
import AntSkeleton from './AntSkeleton.vue';
|
|
15
|
+
import {InputState, Position} from '../enums';
|
|
16
|
+
import {IconSize} from './__types';
|
|
17
|
+
|
|
18
|
+
defineEmits(['close']);
|
|
19
|
+
|
|
20
|
+
const props = withDefaults(defineProps<{
|
|
21
|
+
title?: string | null,
|
|
22
|
+
state?: InputState,
|
|
23
|
+
icon?: boolean,
|
|
24
|
+
expanded?: boolean,
|
|
25
|
+
questionMarkText?: string | null,
|
|
26
|
+
skeleton?: boolean,
|
|
27
|
+
dismissBtn?: boolean,
|
|
28
|
+
}>(), {
|
|
29
|
+
title: null,
|
|
30
|
+
state: InputState.base,
|
|
31
|
+
icon: true,
|
|
32
|
+
expanded: false,
|
|
33
|
+
questionMarkText: null,
|
|
34
|
+
skeleton: false,
|
|
35
|
+
dismissBtn: true,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const icons = {
|
|
39
|
+
[InputState.base]: faInfoCircle,
|
|
40
|
+
[InputState.info]: faInfoCircle,
|
|
41
|
+
[InputState.danger]: faExclamationCircle,
|
|
42
|
+
[InputState.warning]: faExclamationTriangle,
|
|
43
|
+
[InputState.success]: faCheckCircle,
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const _icon = computed(() => icons[props.state]);
|
|
47
|
+
const classes = computed(() => {
|
|
48
|
+
const variants: Record<InputState, string> = {
|
|
49
|
+
[InputState.danger]: 'bg-danger-100 text-danger-700',
|
|
50
|
+
[InputState.info]: 'bg-info-100 text-info-700',
|
|
51
|
+
[InputState.base]: 'bg-neutral-100 text-neutral-100-font',
|
|
52
|
+
[InputState.success]: 'bg-success-100 text-success-700',
|
|
53
|
+
[InputState.warning]: 'bg-warning-100 text-warning-700',
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
'inline-flex flex-col gap-2 rounded-md p-2 transition-colors text-sm relative': true,
|
|
58
|
+
'w-full': props.expanded,
|
|
59
|
+
[variants[props.state]]: true,
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
const hasDefaultSlot = computed(() => useSlots()['default'] || false);
|
|
63
|
+
const hasQuestionMark = computed(() => (useSlots()['question-mark-text'] || false) || props.questionMarkText);
|
|
64
|
+
const iconColor = computed(() => {
|
|
65
|
+
const variants = {
|
|
66
|
+
[InputState.base]: 'text-neutral-100-font',
|
|
67
|
+
[InputState.danger]: 'text-danger-700',
|
|
68
|
+
[InputState.info]: 'text-info-700',
|
|
69
|
+
[InputState.success]: 'text-success-700',
|
|
70
|
+
[InputState.warning]: 'text-warning-700',
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
return variants[props.state];
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
onMounted(() => {
|
|
77
|
+
handleEnumValidation(props.state, InputState, 'state');
|
|
78
|
+
});
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<template>
|
|
82
|
+
<div
|
|
83
|
+
:class="classes"
|
|
84
|
+
data-e2e="alert"
|
|
85
|
+
>
|
|
86
|
+
<AntSkeleton
|
|
87
|
+
v-if="skeleton"
|
|
88
|
+
absolute
|
|
89
|
+
rounded
|
|
90
|
+
/>
|
|
91
|
+
|
|
92
|
+
<div
|
|
93
|
+
v-if="icon || hasQuestionMark || dismissBtn || title"
|
|
94
|
+
class="inline-flex items-center justify-between w-content gap-2"
|
|
95
|
+
:class="{'invisible': skeleton}"
|
|
96
|
+
>
|
|
97
|
+
<div class="inline-flex items-center gap-2">
|
|
98
|
+
<AntIcon
|
|
99
|
+
v-if="icon"
|
|
100
|
+
:icon="_icon"
|
|
101
|
+
:color="iconColor"
|
|
102
|
+
:size="IconSize.sm"
|
|
103
|
+
/>
|
|
104
|
+
|
|
105
|
+
<div
|
|
106
|
+
:class="{'font-semibold': hasDefaultSlot}"
|
|
107
|
+
>
|
|
108
|
+
<slot name="title">
|
|
109
|
+
{{ title }}
|
|
110
|
+
</slot>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<div class="flex gap-2">
|
|
115
|
+
<div v-if="hasQuestionMark">
|
|
116
|
+
<slot name="questionMarkText">
|
|
117
|
+
<AntTooltip :position="Position.bottom">
|
|
118
|
+
<AntIcon
|
|
119
|
+
:icon="faCircleQuestion"
|
|
120
|
+
:color="iconColor"
|
|
121
|
+
:size="IconSize.sm"
|
|
122
|
+
/>
|
|
123
|
+
|
|
124
|
+
<template #content>
|
|
125
|
+
{{ questionMarkText }}
|
|
126
|
+
</template>
|
|
127
|
+
</AntTooltip>
|
|
128
|
+
</slot>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
<AntIcon
|
|
132
|
+
v-if="dismissBtn"
|
|
133
|
+
:icon="faXmark"
|
|
134
|
+
class="cursor-pointer"
|
|
135
|
+
:color="iconColor"
|
|
136
|
+
:size="IconSize.sm"
|
|
137
|
+
@click="() => $emit('close')"
|
|
138
|
+
/>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
<div v-if="hasDefaultSlot">
|
|
143
|
+
<slot/>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
</template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {computed} from 'vue';
|
|
3
|
+
import {Size} from '../enums/Size.enum';
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(defineProps<{
|
|
6
|
+
size?: Size;
|
|
7
|
+
padding?: boolean;
|
|
8
|
+
expanded?: boolean;
|
|
9
|
+
}>(), {
|
|
10
|
+
size: Size.md,
|
|
11
|
+
padding: true,
|
|
12
|
+
expanded: false
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const cardClass = computed(() => ({
|
|
16
|
+
'inline-block': true,
|
|
17
|
+
'w-full': props.expanded,
|
|
18
|
+
'p-0': !props.padding,
|
|
19
|
+
'p-2.5': props.size === Size.lg && props.padding,
|
|
20
|
+
'p-2': props.size === Size.md && props.padding,
|
|
21
|
+
'p-1.5': props.size === Size.sm || props.size === Size.xs && props.padding,
|
|
22
|
+
'p-1': props.size === Size.xs2 && props.padding,
|
|
23
|
+
})
|
|
24
|
+
);
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<div
|
|
29
|
+
:class="cardClass"
|
|
30
|
+
class="bg-white border border-neutral-300 rounded-md"
|
|
31
|
+
>
|
|
32
|
+
<slot/>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
/**
|
|
3
|
+
* TODO:: Emit if there's enough space for the dropdown content. If not, reposition it automatically like the
|
|
4
|
+
* browsers select dropdown content does.
|
|
5
|
+
* TODO:: Known issue: open dropdown, click between button and dropdown. Dropdown will not click.
|
|
6
|
+
* The v-on-click-outside does not trigger, because it think it's the dropdown itself.
|
|
7
|
+
* Solution is using margin only (calc(50% + 0.625rem)) and not padding.
|
|
8
|
+
*/
|
|
9
|
+
import {computed, onMounted} from 'vue';
|
|
10
|
+
import {handleEnumValidation} from '../handler';
|
|
11
|
+
import {Position} from '../enums';
|
|
12
|
+
import {classesToObjectSyntax} from '../utils';
|
|
13
|
+
import {vOnClickOutside} from '@vueuse/components';
|
|
14
|
+
import {onKeyStroke} from '@vueuse/core';
|
|
15
|
+
|
|
16
|
+
const props = withDefaults(defineProps<{
|
|
17
|
+
showDropdown: boolean,
|
|
18
|
+
position?: Position,
|
|
19
|
+
dropdownClasses?: string | Record<string, boolean>,
|
|
20
|
+
contentPadding?: boolean
|
|
21
|
+
}>(), {
|
|
22
|
+
showDropdown: false,
|
|
23
|
+
contentPadding: true,
|
|
24
|
+
position: Position.bottom,
|
|
25
|
+
dropdownClasses: '',
|
|
26
|
+
});
|
|
27
|
+
const emit = defineEmits(['update:showDropdown']);
|
|
28
|
+
|
|
29
|
+
const _dropdownClasses = computed(() => ({
|
|
30
|
+
'absolute min-w-[10rem]': true,
|
|
31
|
+
'bottom-0 left-0 mb-[50%] pb-2.5': props.position === Position.top,
|
|
32
|
+
'top-0 left-0 mt-[50%] pt-2.5': props.position === Position.bottom,
|
|
33
|
+
'right-0 top-0 mr-[100%] pr-2.5': props.position === Position.left,
|
|
34
|
+
'left-0 top-0 ml-[100%] pl-2.5': props.position === Position.right,
|
|
35
|
+
...classesToObjectSyntax(props.dropdownClasses)
|
|
36
|
+
}));
|
|
37
|
+
|
|
38
|
+
onMounted(() => {
|
|
39
|
+
handleEnumValidation(props.position, Position, 'Position');
|
|
40
|
+
});
|
|
41
|
+
onKeyStroke('Escape', (e: KeyboardEvent) => {
|
|
42
|
+
if (props.showDropdown) {
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
emit('update:showDropdown', false);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
function onClickOutside() {
|
|
49
|
+
emit('update:showDropdown', false);
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<div
|
|
55
|
+
v-on-click-outside="onClickOutside"
|
|
56
|
+
class="relative inline-flex justify-center items-end z-40"
|
|
57
|
+
data-e2e="dropdown"
|
|
58
|
+
>
|
|
59
|
+
<slot/>
|
|
60
|
+
|
|
61
|
+
<Transition name="bounce">
|
|
62
|
+
<div
|
|
63
|
+
v-if="showDropdown"
|
|
64
|
+
:class="_dropdownClasses"
|
|
65
|
+
>
|
|
66
|
+
<div
|
|
67
|
+
class="shadow-lg border border-neutral-300 rounded-md text-sm relative inline-flex flex-col relative bg-white text-for-white-bg-font w-full"
|
|
68
|
+
:class="{'p-2': contentPadding}"
|
|
69
|
+
>
|
|
70
|
+
<slot name="content"/>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</Transition>
|
|
74
|
+
</div>
|
|
75
|
+
</template>
|
|
76
|
+
|
|
77
|
+
<style scoped>
|
|
78
|
+
.bounce-enter-active {
|
|
79
|
+
animation: bounce-in .4s;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.bounce-leave-active {
|
|
83
|
+
animation: bounce-in .4s reverse;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@keyframes bounce-in {
|
|
87
|
+
0% {
|
|
88
|
+
transform: scale(0);
|
|
89
|
+
opacity: 0;
|
|
90
|
+
}
|
|
91
|
+
50% {
|
|
92
|
+
transform: scale(1.05);
|
|
93
|
+
opacity: 1;
|
|
94
|
+
}
|
|
95
|
+
100% {
|
|
96
|
+
transform: scale(1);
|
|
97
|
+
opacity: 1;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
</style>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import {computed, onMounted} from 'vue';
|
|
3
|
+
import {handleEnumValidation} from '../handler';
|
|
4
|
+
import {type IconDefinition} from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
import {IconSize} from './__types/AntIcon.types';
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(defineProps<{
|
|
8
|
+
icon: IconDefinition;
|
|
9
|
+
size?: IconSize;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A css text-* class
|
|
13
|
+
*/
|
|
14
|
+
color?: string;
|
|
15
|
+
}>(), {
|
|
16
|
+
size: IconSize.sm,
|
|
17
|
+
color: 'text-for-white-bg-font'
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const containerClasses = computed(() => ({
|
|
21
|
+
'inline-flex items-center justify-center': true,
|
|
22
|
+
'w-3 h-3': props.size === IconSize.xs2,
|
|
23
|
+
'w-4 h-4': props.size === IconSize.xs,
|
|
24
|
+
'w-5 h-5': props.size === IconSize.sm,
|
|
25
|
+
'w-6 h-6': props.size === IconSize.md,
|
|
26
|
+
'w-7 h-7': props.size === IconSize.lg,
|
|
27
|
+
'w-9 h-9': props.size === IconSize.xl3,
|
|
28
|
+
[props.color]: true,
|
|
29
|
+
}));
|
|
30
|
+
|
|
31
|
+
const iconClasses = computed(() => ({
|
|
32
|
+
'transition-colors': true,
|
|
33
|
+
'text-2xs': props.size === IconSize.xs2,
|
|
34
|
+
'text-xs': props.size === IconSize.xs,
|
|
35
|
+
'text-sm': props.size === IconSize.sm,
|
|
36
|
+
'text-md': props.size === IconSize.md,
|
|
37
|
+
'text-lg': props.size === IconSize.lg,
|
|
38
|
+
'text-3xl': props.size === IconSize.xl3,
|
|
39
|
+
}));
|
|
40
|
+
|
|
41
|
+
onMounted(() => {
|
|
42
|
+
handleEnumValidation(props.size, IconSize, 'size');
|
|
43
|
+
});
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<span
|
|
48
|
+
v-if="icon"
|
|
49
|
+
:class="containerClasses"
|
|
50
|
+
>
|
|
51
|
+
<FaIcon
|
|
52
|
+
:icon="icon"
|
|
53
|
+
:class="iconClasses"
|
|
54
|
+
/>
|
|
55
|
+
</span>
|
|
56
|
+
</template>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
// TODO:: Fix typo KeyCap with upperchar C
|
|
3
|
+
import AntIcon from './AntIcon.vue';
|
|
4
|
+
import {type IconDefinition} from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
import {IconSize} from './__types';
|
|
6
|
+
import {AntKeycapSize} from './__types/AntKeycap.types';
|
|
7
|
+
import {computed} from 'vue';
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(defineProps<{
|
|
10
|
+
icon?: IconDefinition
|
|
11
|
+
size: AntKeycapSize
|
|
12
|
+
|
|
13
|
+
}>(), {
|
|
14
|
+
size: AntKeycapSize.sm
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const classes = computed(() => {
|
|
18
|
+
return {
|
|
19
|
+
'text-sm px-px min-w-5': props.size === AntKeycapSize.sm,
|
|
20
|
+
'text-2xs px-px py-0.5 min-w-[18px]': props.size === AntKeycapSize.xs,
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
const iconClasses = computed(() => {
|
|
24
|
+
if (props.size === AntKeycapSize.sm) {
|
|
25
|
+
return IconSize.sm;
|
|
26
|
+
} else {
|
|
27
|
+
return IconSize.xs2;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<span
|
|
34
|
+
class="inline-block bg-neutral-300 rounded-md text-center text-neutral-500-font font-medium"
|
|
35
|
+
:class="classes"
|
|
36
|
+
>
|
|
37
|
+
<AntIcon
|
|
38
|
+
v-if="icon"
|
|
39
|
+
:icon="icon"
|
|
40
|
+
:size="iconClasses"
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
<slot v-else/>
|
|
44
|
+
</span>
|
|
45
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import AntSkeleton from './AntSkeleton.vue';
|
|
3
|
+
|
|
4
|
+
withDefaults(
|
|
5
|
+
defineProps<{
|
|
6
|
+
skeleton?: boolean
|
|
7
|
+
}>(), {
|
|
8
|
+
skeleton: false
|
|
9
|
+
}
|
|
10
|
+
)
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<div class="relative">
|
|
15
|
+
<AntSkeleton v-if="skeleton" absolute rounded/>
|
|
16
|
+
|
|
17
|
+
<div
|
|
18
|
+
class="flex flex-col rounded-md bg-neutral-300 gap-px relative border border-neutral-300 overflow-hidden"
|
|
19
|
+
:class="{'invisible': skeleton}"
|
|
20
|
+
>
|
|
21
|
+
<slot/>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|