@sakoa/ui 0.1.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/README.md +171 -0
- package/dist/App.d.ts +2 -0
- package/dist/cli/index.js +9243 -0
- package/dist/components/DemoSection.d.ts +30 -0
- package/dist/components/SApiKeyboard.d.ts +22 -0
- package/dist/components/SApiSection.d.ts +21 -0
- package/dist/components/SApiTable.d.ts +46 -0
- package/dist/components/STableOfContents.d.ts +2 -0
- package/dist/components/ui/SAlert.d.ts +76 -0
- package/dist/components/ui/SBadge.d.ts +56 -0
- package/dist/components/ui/SButton.d.ts +67 -0
- package/dist/components/ui/SCheckbox.d.ts +64 -0
- package/dist/components/ui/SChip.d.ts +43 -0
- package/dist/components/ui/SDatePicker.d.ts +77 -0
- package/dist/components/ui/SGlassButton.d.ts +70 -0
- package/dist/components/ui/SIcon.d.ts +29 -0
- package/dist/components/ui/SInput.d.ts +129 -0
- package/dist/components/ui/SKbd.d.ts +24 -0
- package/dist/components/ui/SKbdShortcut.d.ts +14 -0
- package/dist/components/ui/SSelect.d.ts +148 -0
- package/dist/components/ui/SSkeleton.d.ts +37 -0
- package/dist/components/ui/SSwitch.d.ts +61 -0
- package/dist/components/ui/STooltip.d.ts +82 -0
- package/dist/components/ui/accordion/SAccordionContent.d.ts +23 -0
- package/dist/components/ui/accordion/SAccordionItem.d.ts +70 -0
- package/dist/components/ui/accordion/SAccordionTrigger.d.ts +37 -0
- package/dist/components/ui/accordion/index.d.ts +4 -0
- package/dist/components/ui/avatar/SAvatar.d.ts +36 -0
- package/dist/components/ui/avatar/SAvatarFallback.d.ts +26 -0
- package/dist/components/ui/avatar/SAvatarGroup.d.ts +30 -0
- package/dist/components/ui/avatar/SAvatarImage.d.ts +23 -0
- package/dist/components/ui/avatar/index.d.ts +4 -0
- package/dist/components/ui/breadcrumb/SBreadcrumb.d.ts +22 -0
- package/dist/components/ui/breadcrumb/SBreadcrumbEllipsis.d.ts +17 -0
- package/dist/components/ui/breadcrumb/SBreadcrumbItem.d.ts +17 -0
- package/dist/components/ui/breadcrumb/SBreadcrumbLink.d.ts +26 -0
- package/dist/components/ui/breadcrumb/SBreadcrumbList.d.ts +17 -0
- package/dist/components/ui/breadcrumb/SBreadcrumbPage.d.ts +17 -0
- package/dist/components/ui/breadcrumb/SBreadcrumbSeparator.d.ts +17 -0
- package/dist/components/ui/breadcrumb/index.d.ts +7 -0
- package/dist/components/ui/card/SCard.d.ts +103 -0
- package/dist/components/ui/card/SCardActions.d.ts +44 -0
- package/dist/components/ui/card/SCardContent.d.ts +35 -0
- package/dist/components/ui/card/SCardFooter.d.ts +38 -0
- package/dist/components/ui/card/SCardHeader.d.ts +53 -0
- package/dist/components/ui/card/SCardMedia.d.ts +83 -0
- package/dist/components/ui/card/SGlassCard.d.ts +103 -0
- package/dist/components/ui/card/SMorphingCardContent.d.ts +18 -0
- package/dist/components/ui/card/index.d.ts +24 -0
- package/dist/components/ui/carousel/SCarousel.d.ts +166 -0
- package/dist/components/ui/carousel/index.d.ts +2 -0
- package/dist/components/ui/color-picker/SColorPickerAlphaSlider.d.ts +4 -0
- package/dist/components/ui/color-picker/SColorPickerCopy.d.ts +19 -0
- package/dist/components/ui/color-picker/SColorPickerEyeDropper.d.ts +17 -0
- package/dist/components/ui/color-picker/SColorPickerHueSlider.d.ts +4 -0
- package/dist/components/ui/color-picker/SColorPickerInputs.d.ts +2 -0
- package/dist/components/ui/color-picker/SColorPickerPresets.d.ts +9 -0
- package/dist/components/ui/color-picker/SColorPickerPreview.d.ts +2 -0
- package/dist/components/ui/color-picker/SColorPickerRecent.d.ts +7 -0
- package/dist/components/ui/color-picker/SColorPickerSpectrum.d.ts +4 -0
- package/dist/components/ui/color-picker/index.d.ts +11 -0
- package/dist/components/ui/drawer/index.d.ts +11 -0
- package/dist/components/ui/dropdown/SDropdownDivider.d.ts +8 -0
- package/dist/components/ui/dropdown/SDropdownGroup.d.ts +25 -0
- package/dist/components/ui/dropdown/SDropdownItem.d.ts +56 -0
- package/dist/components/ui/dropdown/index.d.ts +4 -0
- package/dist/components/ui/form/SForm.d.ts +38 -0
- package/dist/components/ui/form/SFormField.d.ts +31 -0
- package/dist/components/ui/form/index.d.ts +5 -0
- package/dist/components/ui/modal/index.d.ts +19 -0
- package/dist/components/ui/option/SOption.d.ts +32 -0
- package/dist/components/ui/option/SOptionGroup.d.ts +28 -0
- package/dist/components/ui/option/index.d.ts +2 -0
- package/dist/components/ui/otp/SOTP.d.ts +122 -0
- package/dist/components/ui/otp/SOTPGroup.d.ts +23 -0
- package/dist/components/ui/otp/SOTPSeparator.d.ts +17 -0
- package/dist/components/ui/otp/SOTPSlot.d.ts +49 -0
- package/dist/components/ui/otp/index.d.ts +7 -0
- package/dist/components/ui/otp/types.d.ts +26 -0
- package/dist/components/ui/otp/useOTPContext.d.ts +42 -0
- package/dist/components/ui/pagination/SPagination.d.ts +151 -0
- package/dist/components/ui/pagination/index.d.ts +2 -0
- package/dist/components/ui/progress/SProgress.d.ts +62 -0
- package/dist/components/ui/progress/SProgressRange.d.ts +91 -0
- package/dist/components/ui/progress/index.d.ts +4 -0
- package/dist/components/ui/radio/SRadio.d.ts +58 -0
- package/dist/components/ui/radio/SRadioGroup.d.ts +52 -0
- package/dist/components/ui/radio/index.d.ts +2 -0
- package/dist/components/ui/stepper/SStepper.d.ts +83 -0
- package/dist/components/ui/stepper/SStepperContent.d.ts +24 -0
- package/dist/components/ui/stepper/SStepperDescription.d.ts +20 -0
- package/dist/components/ui/stepper/SStepperIndicator.d.ts +37 -0
- package/dist/components/ui/stepper/SStepperItem.d.ts +37 -0
- package/dist/components/ui/stepper/SStepperSeparator.d.ts +5 -0
- package/dist/components/ui/stepper/SStepperTitle.d.ts +20 -0
- package/dist/components/ui/stepper/SStepperTrigger.d.ts +22 -0
- package/dist/components/ui/stepper/index.d.ts +11 -0
- package/dist/components/ui/table/STableBody.d.ts +27 -0
- package/dist/components/ui/table/STableCell.d.ts +55 -0
- package/dist/components/ui/table/STableColumn.d.ts +87 -0
- package/dist/components/ui/table/STableEmpty.d.ts +54 -0
- package/dist/components/ui/table/STableHeader.d.ts +25 -0
- package/dist/components/ui/table/STableRow.d.ts +38 -0
- package/dist/components/ui/table/STableSkeleton.d.ts +29 -0
- package/dist/components/ui/table/index.d.ts +98 -0
- package/dist/components/ui/table/useDataTable.d.ts +80 -0
- package/dist/components/ui/tabs/STabPane.d.ts +31 -0
- package/dist/components/ui/tabs/STabsContent.d.ts +21 -0
- package/dist/components/ui/tabs/STabsIndicator.d.ts +9 -0
- package/dist/components/ui/tabs/STabsTrigger.d.ts +28 -0
- package/dist/components/ui/tabs/index.d.ts +6 -0
- package/dist/components/ui/toast/SToast.d.ts +49 -0
- package/dist/components/ui/toast/SToastContainer.d.ts +21 -0
- package/dist/components/ui/toast/index.d.ts +2 -0
- package/dist/composables/useAsync.d.ts +134 -0
- package/dist/composables/useClickOutside.d.ts +69 -0
- package/dist/composables/useClipboard.d.ts +46 -0
- package/dist/composables/useDebounce.d.ts +150 -0
- package/dist/composables/useDialog.d.ts +118 -0
- package/dist/composables/useForm.d.ts +204 -0
- package/dist/composables/useHotkey.d.ts +128 -0
- package/dist/composables/useIntersectionObserver.d.ts +156 -0
- package/dist/composables/useLocalStorage.d.ts +120 -0
- package/dist/composables/useMediaQuery.d.ts +115 -0
- package/dist/composables/useTheme.d.ts +8 -0
- package/dist/composables/useToast.d.ts +1619 -0
- package/dist/index.d.ts +71 -0
- package/dist/layouts/UILayout.d.ts +2 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/main.d.ts +0 -0
- package/dist/router.d.ts +2 -0
- package/dist/saka-ui.css +1 -0
- package/dist/saka-ui.js +18513 -0
- package/dist/saka-ui.umd.cjs +38 -0
- package/dist/views/docs/CustomizationView.d.ts +2 -0
- package/dist/views/docs/FormValidationView.d.ts +2 -0
- package/dist/views/docs/StylingGuideView.d.ts +2 -0
- package/dist/views/docs/UseAsyncView.d.ts +2 -0
- package/dist/views/docs/UseClickOutsideView.d.ts +124 -0
- package/dist/views/docs/UseClipboardView.d.ts +4 -0
- package/dist/views/docs/UseDebounceView.d.ts +2 -0
- package/dist/views/docs/UseHotkeyView.d.ts +205 -0
- package/dist/views/docs/UseIntersectionObserverView.d.ts +5 -0
- package/dist/views/docs/UseLocalStorageView.d.ts +2 -0
- package/dist/views/docs/UseMediaQueryView.d.ts +2 -0
- package/dist/views/docs/UseThemeView.d.ts +2 -0
- package/dist/views/examples/AuthFormView.d.ts +2 -0
- package/dist/views/examples/CreditCardFormView.d.ts +6 -0
- package/dist/views/examples/FormFieldExampleView.d.ts +2 -0
- package/dist/views/examples/ProjectFormView.d.ts +2 -0
- package/dist/views/ui/AccordionView.d.ts +2 -0
- package/dist/views/ui/AlertView.d.ts +2 -0
- package/dist/views/ui/AvatarView.d.ts +2 -0
- package/dist/views/ui/BadgeView.d.ts +2 -0
- package/dist/views/ui/BreadcrumbView.d.ts +2 -0
- package/dist/views/ui/ButtonView.d.ts +2 -0
- package/dist/views/ui/CardView.d.ts +2 -0
- package/dist/views/ui/CarouselView.d.ts +274 -0
- package/dist/views/ui/CheckboxView.d.ts +2 -0
- package/dist/views/ui/ChipView.d.ts +2 -0
- package/dist/views/ui/ColorPickerView.d.ts +2 -0
- package/dist/views/ui/DatePickerView.d.ts +2 -0
- package/dist/views/ui/DialogView.d.ts +2 -0
- package/dist/views/ui/DrawerView.d.ts +2 -0
- package/dist/views/ui/DropdownView.d.ts +2 -0
- package/dist/views/ui/GlassButtonView.d.ts +2 -0
- package/dist/views/ui/GlassCardView.d.ts +2 -0
- package/dist/views/ui/HomeView.d.ts +2 -0
- package/dist/views/ui/IconsView.d.ts +2 -0
- package/dist/views/ui/InputView.d.ts +2 -0
- package/dist/views/ui/KbdView.d.ts +2 -0
- package/dist/views/ui/ModalView.d.ts +2 -0
- package/dist/views/ui/MorphingCardView.d.ts +2 -0
- package/dist/views/ui/MorphingModalView.d.ts +2 -0
- package/dist/views/ui/OTPView.d.ts +206 -0
- package/dist/views/ui/PaginationView.d.ts +2 -0
- package/dist/views/ui/ProgressView.d.ts +2 -0
- package/dist/views/ui/RadioView.d.ts +2 -0
- package/dist/views/ui/SelectView.d.ts +2 -0
- package/dist/views/ui/SkeletonView.d.ts +2 -0
- package/dist/views/ui/StepperView.d.ts +2 -0
- package/dist/views/ui/SwitchView.d.ts +2 -0
- package/dist/views/ui/TableView.d.ts +2 -0
- package/dist/views/ui/TabsView.d.ts +2 -0
- package/dist/views/ui/ToastView.d.ts +2 -0
- package/dist/views/ui/TooltipView.d.ts +2 -0
- package/dist/vite.svg +1 -0
- package/package.json +64 -0
- package/registry/components/accordion.json +19 -0
- package/registry/components/alert.json +17 -0
- package/registry/components/avatar.json +18 -0
- package/registry/components/badge.json +14 -0
- package/registry/components/breadcrumb.json +24 -0
- package/registry/components/button.json +17 -0
- package/registry/components/card.json +23 -0
- package/registry/components/carousel.json +19 -0
- package/registry/components/checkbox.json +17 -0
- package/registry/components/chip.json +17 -0
- package/registry/components/color-picker.json +24 -0
- package/registry/components/date-picker.json +17 -0
- package/registry/components/drawer.json +26 -0
- package/registry/components/dropdown.json +21 -0
- package/registry/components/form.json +16 -0
- package/registry/components/glass-button.json +17 -0
- package/registry/components/icon.json +17 -0
- package/registry/components/input.json +17 -0
- package/registry/components/kbd.json +16 -0
- package/registry/components/modal.json +32 -0
- package/registry/components/option.json +16 -0
- package/registry/components/otp.json +23 -0
- package/registry/components/pagination.json +18 -0
- package/registry/components/progress.json +16 -0
- package/registry/components/radio.json +19 -0
- package/registry/components/select.json +17 -0
- package/registry/components/skeleton.json +14 -0
- package/registry/components/switch.json +17 -0
- package/registry/components/table.json +26 -0
- package/registry/components/tabs.json +19 -0
- package/registry/components/toast.json +19 -0
- package/registry/components/tooltip.json +14 -0
- package/registry/index.json +4 -0
- package/registry/source/components/ui/SAlert.vue +388 -0
- package/registry/source/components/ui/SBadge.vue +243 -0
- package/registry/source/components/ui/SButton.vue +387 -0
- package/registry/source/components/ui/SCheckbox.vue +310 -0
- package/registry/source/components/ui/SChip.vue +130 -0
- package/registry/source/components/ui/SDatePicker.vue +1290 -0
- package/registry/source/components/ui/SGlassButton.vue +547 -0
- package/registry/source/components/ui/SIcon.vue +78 -0
- package/registry/source/components/ui/SInput.vue +1054 -0
- package/registry/source/components/ui/SKbd.vue +96 -0
- package/registry/source/components/ui/SKbdShortcut.vue +36 -0
- package/registry/source/components/ui/SSelect.vue +1290 -0
- package/registry/source/components/ui/SSkeleton.vue +185 -0
- package/registry/source/components/ui/SSwitch.vue +275 -0
- package/registry/source/components/ui/STooltip.vue +491 -0
- package/registry/source/components/ui/accordion/SAccordion.vue +248 -0
- package/registry/source/components/ui/accordion/SAccordionItem.vue +353 -0
- package/registry/source/components/ui/accordion/index.ts +5 -0
- package/registry/source/components/ui/avatar/SAvatar.vue +169 -0
- package/registry/source/components/ui/avatar/SAvatarFallback.vue +66 -0
- package/registry/source/components/ui/avatar/SAvatarGroup.vue +69 -0
- package/registry/source/components/ui/avatar/SAvatarImage.vue +92 -0
- package/registry/source/components/ui/avatar/index.ts +5 -0
- package/registry/source/components/ui/breadcrumb/SBreadcrumb.vue +23 -0
- package/registry/source/components/ui/breadcrumb/SBreadcrumbEllipsis.vue +17 -0
- package/registry/source/components/ui/breadcrumb/SBreadcrumbItem.vue +14 -0
- package/registry/source/components/ui/breadcrumb/SBreadcrumbLink.vue +46 -0
- package/registry/source/components/ui/breadcrumb/SBreadcrumbList.vue +17 -0
- package/registry/source/components/ui/breadcrumb/SBreadcrumbPage.vue +15 -0
- package/registry/source/components/ui/breadcrumb/SBreadcrumbSeparator.vue +18 -0
- package/registry/source/components/ui/breadcrumb/index.ts +7 -0
- package/registry/source/components/ui/card/SCard.vue +517 -0
- package/registry/source/components/ui/card/SCardActions.vue +129 -0
- package/registry/source/components/ui/card/SCardContent.vue +117 -0
- package/registry/source/components/ui/card/SCardFooter.vue +103 -0
- package/registry/source/components/ui/card/SCardHeader.vue +163 -0
- package/registry/source/components/ui/card/SCardMedia.vue +312 -0
- package/registry/source/components/ui/card/index.ts +34 -0
- package/registry/source/components/ui/carousel/SCarousel.vue +1069 -0
- package/registry/source/components/ui/carousel/SCarouselSlide.vue +107 -0
- package/registry/source/components/ui/carousel/index.ts +3 -0
- package/registry/source/components/ui/color-picker/SColorPicker.vue +772 -0
- package/registry/source/components/ui/color-picker/SColorPickerAlphaSlider.vue +158 -0
- package/registry/source/components/ui/color-picker/SColorPickerCopy.vue +76 -0
- package/registry/source/components/ui/color-picker/SColorPickerEyeDropper.vue +68 -0
- package/registry/source/components/ui/color-picker/SColorPickerHueSlider.vue +138 -0
- package/registry/source/components/ui/color-picker/SColorPickerInputs.vue +227 -0
- package/registry/source/components/ui/color-picker/SColorPickerPresets.vue +87 -0
- package/registry/source/components/ui/color-picker/SColorPickerPreview.vue +46 -0
- package/registry/source/components/ui/color-picker/SColorPickerRecent.vue +74 -0
- package/registry/source/components/ui/color-picker/SColorPickerSpectrum.vue +149 -0
- package/registry/source/components/ui/color-picker/index.ts +11 -0
- package/registry/source/components/ui/drawer/SDrawer.vue +797 -0
- package/registry/source/components/ui/drawer/SDrawerClose.vue +64 -0
- package/registry/source/components/ui/drawer/SDrawerContent.vue +81 -0
- package/registry/source/components/ui/drawer/SDrawerDescription.vue +40 -0
- package/registry/source/components/ui/drawer/SDrawerFooter.vue +97 -0
- package/registry/source/components/ui/drawer/SDrawerHandle.vue +79 -0
- package/registry/source/components/ui/drawer/SDrawerHeader.vue +117 -0
- package/registry/source/components/ui/drawer/SDrawerTitle.vue +40 -0
- package/registry/source/components/ui/drawer/SDrawerTrigger.vue +51 -0
- package/registry/source/components/ui/drawer/index.ts +20 -0
- package/registry/source/components/ui/dropdown/SDropdown.vue +843 -0
- package/registry/source/components/ui/dropdown/SDropdownDivider.vue +23 -0
- package/registry/source/components/ui/dropdown/SDropdownGroup.vue +53 -0
- package/registry/source/components/ui/dropdown/SDropdownItem.vue +179 -0
- package/registry/source/components/ui/dropdown/index.ts +5 -0
- package/registry/source/components/ui/form/SForm.vue +84 -0
- package/registry/source/components/ui/form/SFormField.vue +78 -0
- package/registry/source/components/ui/form/index.ts +8 -0
- package/registry/source/components/ui/modal/SModal.vue +648 -0
- package/registry/source/components/ui/modal/SModalClose.vue +49 -0
- package/registry/source/components/ui/modal/SModalContent.vue +74 -0
- package/registry/source/components/ui/modal/SModalDescription.vue +39 -0
- package/registry/source/components/ui/modal/SModalFooter.vue +84 -0
- package/registry/source/components/ui/modal/SModalHeader.vue +107 -0
- package/registry/source/components/ui/modal/SModalTitle.vue +39 -0
- package/registry/source/components/ui/modal/SModalTrigger.vue +61 -0
- package/registry/source/components/ui/modal/SMorphingModal.vue +429 -0
- package/registry/source/components/ui/modal/SMorphingModalClose.vue +42 -0
- package/registry/source/components/ui/modal/SMorphingModalDescription.vue +49 -0
- package/registry/source/components/ui/modal/SMorphingModalImage.vue +44 -0
- package/registry/source/components/ui/modal/SMorphingModalSubtitle.vue +29 -0
- package/registry/source/components/ui/modal/SMorphingModalTitle.vue +34 -0
- package/registry/source/components/ui/modal/SMorphingModalTrigger.vue +95 -0
- package/registry/source/components/ui/modal/index.ts +32 -0
- package/registry/source/components/ui/option/SOption.vue +180 -0
- package/registry/source/components/ui/option/SOptionGroup.vue +77 -0
- package/registry/source/components/ui/option/index.ts +3 -0
- package/registry/source/components/ui/otp/SOTP.vue +843 -0
- package/registry/source/components/ui/otp/SOTPGroup.vue +29 -0
- package/registry/source/components/ui/otp/SOTPSeparator.vue +15 -0
- package/registry/source/components/ui/otp/SOTPSlot.vue +462 -0
- package/registry/source/components/ui/otp/index.ts +7 -0
- package/registry/source/components/ui/otp/types.ts +27 -0
- package/registry/source/components/ui/otp/useOTPContext.ts +62 -0
- package/registry/source/components/ui/pagination/SPagination.vue +923 -0
- package/registry/source/components/ui/pagination/index.ts +8 -0
- package/registry/source/components/ui/progress/SProgress.vue +635 -0
- package/registry/source/components/ui/progress/SProgressRange.vue +715 -0
- package/registry/source/components/ui/progress/index.ts +4 -0
- package/registry/source/components/ui/radio/SRadio.vue +407 -0
- package/registry/source/components/ui/radio/SRadioGroup.vue +200 -0
- package/registry/source/components/ui/radio/index.ts +3 -0
- package/registry/source/components/ui/table/SDataTable.vue +828 -0
- package/registry/source/components/ui/table/STableBody.vue +70 -0
- package/registry/source/components/ui/table/STableCell.vue +147 -0
- package/registry/source/components/ui/table/STableColumn.vue +120 -0
- package/registry/source/components/ui/table/STableEmpty.vue +159 -0
- package/registry/source/components/ui/table/STableHeader.vue +132 -0
- package/registry/source/components/ui/table/STableRow.vue +106 -0
- package/registry/source/components/ui/table/STableSkeleton.vue +208 -0
- package/registry/source/components/ui/table/index.ts +126 -0
- package/registry/source/components/ui/table/useDataTable.ts +519 -0
- package/registry/source/components/ui/tabs/STabPane.vue +130 -0
- package/registry/source/components/ui/tabs/STabs.vue +467 -0
- package/registry/source/components/ui/tabs/index.ts +7 -0
- package/registry/source/components/ui/toast/SToast.vue +261 -0
- package/registry/source/components/ui/toast/SToastContainer.vue +209 -0
- package/registry/source/components/ui/toast/index.ts +2 -0
- package/registry/source/composables/useForm.ts +960 -0
- package/registry/source/composables/useTheme.ts +86 -0
- package/registry/source/composables/useToast.ts +440 -0
- package/registry/source/lib/utils.ts +6 -0
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref, provide } from 'vue'
|
|
3
|
+
import { cn } from '../../../lib/utils'
|
|
4
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
5
|
+
import { cardContextKey } from './index'
|
|
6
|
+
|
|
7
|
+
const cardVariants = cva('s-card relative overflow-hidden', {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
elevated: 'bg-card shadow-lg shadow-black/10 dark:shadow-black/40',
|
|
11
|
+
outlined: 'bg-transparent border border-border',
|
|
12
|
+
filled: 'bg-muted',
|
|
13
|
+
ghost: 'bg-transparent',
|
|
14
|
+
glass: 'bg-card/60 dark:bg-card/40 backdrop-blur-xl border border-border'
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
compact: 'p-3',
|
|
18
|
+
default: 'p-4 sm:p-5',
|
|
19
|
+
comfortable: 'p-5 sm:p-6 lg:p-8'
|
|
20
|
+
},
|
|
21
|
+
rounded: {
|
|
22
|
+
none: 'rounded-none',
|
|
23
|
+
sm: 'rounded-sm',
|
|
24
|
+
md: 'rounded-md',
|
|
25
|
+
lg: 'rounded-lg',
|
|
26
|
+
xl: 'rounded-xl',
|
|
27
|
+
'2xl': 'rounded-2xl',
|
|
28
|
+
full: 'rounded-3xl'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
variant: 'elevated',
|
|
33
|
+
size: 'default',
|
|
34
|
+
rounded: 'lg'
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
type CardVariants = VariantProps<typeof cardVariants>
|
|
39
|
+
|
|
40
|
+
interface Props {
|
|
41
|
+
/** Visual style variant */
|
|
42
|
+
variant?: 'elevated' | 'outlined' | 'filled' | 'ghost' | 'glass'
|
|
43
|
+
/** Size preset affecting padding and spacing */
|
|
44
|
+
size?: 'compact' | 'default' | 'comfortable'
|
|
45
|
+
/** Border radius */
|
|
46
|
+
rounded?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full'
|
|
47
|
+
/** Enable hover animation effects */
|
|
48
|
+
hoverable?: boolean
|
|
49
|
+
/** Enable press/click effect */
|
|
50
|
+
pressable?: boolean
|
|
51
|
+
/** Make entire card clickable */
|
|
52
|
+
clickable?: boolean
|
|
53
|
+
/** Show loading skeleton state */
|
|
54
|
+
loading?: boolean
|
|
55
|
+
/** Disabled state */
|
|
56
|
+
disabled?: boolean
|
|
57
|
+
/** Custom background color */
|
|
58
|
+
bgColor?: string
|
|
59
|
+
/** Custom border color */
|
|
60
|
+
borderColor?: string
|
|
61
|
+
/** Gradient border (CSS gradient string) */
|
|
62
|
+
gradientBorder?: string
|
|
63
|
+
/** Gradient background (CSS gradient string) */
|
|
64
|
+
gradientBg?: string
|
|
65
|
+
/** Enable spotlight/glow effect on hover */
|
|
66
|
+
spotlight?: boolean
|
|
67
|
+
/** Spotlight color */
|
|
68
|
+
spotlightColor?: string
|
|
69
|
+
/** Horizontal layout (media on side) */
|
|
70
|
+
horizontal?: boolean
|
|
71
|
+
/** Flip media to right side in horizontal layout */
|
|
72
|
+
mediaRight?: boolean
|
|
73
|
+
/** Card width */
|
|
74
|
+
width?: string
|
|
75
|
+
/** Card height */
|
|
76
|
+
height?: string
|
|
77
|
+
/** Card max-width */
|
|
78
|
+
maxWidth?: string
|
|
79
|
+
/** Custom padding override */
|
|
80
|
+
padding?: string
|
|
81
|
+
/** Enable 3D tilt effect on hover */
|
|
82
|
+
tilt?: boolean
|
|
83
|
+
/** Tag element to render */
|
|
84
|
+
tag?: string
|
|
85
|
+
/** href for link cards */
|
|
86
|
+
href?: string
|
|
87
|
+
/** router-link to */
|
|
88
|
+
to?: string | object
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
92
|
+
variant: 'elevated',
|
|
93
|
+
size: 'default',
|
|
94
|
+
rounded: 'lg',
|
|
95
|
+
hoverable: false,
|
|
96
|
+
pressable: false,
|
|
97
|
+
clickable: false,
|
|
98
|
+
loading: false,
|
|
99
|
+
disabled: false,
|
|
100
|
+
bgColor: undefined,
|
|
101
|
+
borderColor: undefined,
|
|
102
|
+
gradientBorder: undefined,
|
|
103
|
+
gradientBg: undefined,
|
|
104
|
+
spotlight: false,
|
|
105
|
+
spotlightColor: 'var(--s-primary)',
|
|
106
|
+
horizontal: false,
|
|
107
|
+
mediaRight: false,
|
|
108
|
+
width: undefined,
|
|
109
|
+
height: undefined,
|
|
110
|
+
maxWidth: undefined,
|
|
111
|
+
padding: undefined,
|
|
112
|
+
tilt: false,
|
|
113
|
+
tag: 'div',
|
|
114
|
+
href: undefined,
|
|
115
|
+
to: undefined
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
defineOptions({ inheritAttrs: false })
|
|
119
|
+
|
|
120
|
+
const emit = defineEmits<{
|
|
121
|
+
click: [event: MouseEvent]
|
|
122
|
+
}>()
|
|
123
|
+
|
|
124
|
+
// Provide context to child components
|
|
125
|
+
provide(cardContextKey, {
|
|
126
|
+
variant: props.variant,
|
|
127
|
+
hoverable: props.hoverable,
|
|
128
|
+
loading: props.loading,
|
|
129
|
+
horizontal: props.horizontal
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
// Refs for effects
|
|
133
|
+
const cardRef = ref<HTMLElement | null>(null)
|
|
134
|
+
const isHovered = ref(false)
|
|
135
|
+
const isPressed = ref(false)
|
|
136
|
+
const mousePosition = ref({ x: 0, y: 0 })
|
|
137
|
+
const tiltRotation = ref({ x: 0, y: 0 })
|
|
138
|
+
|
|
139
|
+
// Computed component tag
|
|
140
|
+
const componentTag = computed(() => {
|
|
141
|
+
if (props.to) return 'router-link'
|
|
142
|
+
if (props.href) return 'a'
|
|
143
|
+
return props.tag
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
// Component bindings
|
|
147
|
+
const componentBindings = computed(() => {
|
|
148
|
+
const bindings: Record<string, unknown> = {}
|
|
149
|
+
if (props.to) bindings.to = props.to
|
|
150
|
+
if (props.href) bindings.href = props.href
|
|
151
|
+
return bindings
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
// Radius classes (needed for sub-elements like gradient border spans)
|
|
157
|
+
const radiusClasses = computed(() => {
|
|
158
|
+
const radii = {
|
|
159
|
+
none: 'rounded-none',
|
|
160
|
+
sm: 'rounded-sm',
|
|
161
|
+
md: 'rounded-md',
|
|
162
|
+
lg: 'rounded-lg',
|
|
163
|
+
xl: 'rounded-xl',
|
|
164
|
+
'2xl': 'rounded-2xl',
|
|
165
|
+
full: 'rounded-3xl'
|
|
166
|
+
}
|
|
167
|
+
return radii[props.rounded]
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
// Computed variant class for gradient override
|
|
171
|
+
const variantOverride = computed(() => {
|
|
172
|
+
if (props.gradientBorder || props.gradientBg) return 'bg-card'
|
|
173
|
+
return undefined
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
// Computed styles
|
|
177
|
+
const computedStyle = computed(() => {
|
|
178
|
+
const style: Record<string, string> = {}
|
|
179
|
+
|
|
180
|
+
if (props.bgColor) style['--card-bg'] = props.bgColor
|
|
181
|
+
if (props.borderColor) style['--card-border'] = props.borderColor
|
|
182
|
+
if (props.width) style.width = props.width
|
|
183
|
+
if (props.height) style.height = props.height
|
|
184
|
+
if (props.maxWidth) style.maxWidth = props.maxWidth
|
|
185
|
+
if (props.padding) style.padding = props.padding
|
|
186
|
+
if (props.spotlightColor) style['--spotlight-color'] = props.spotlightColor
|
|
187
|
+
|
|
188
|
+
// Spotlight position
|
|
189
|
+
if (props.spotlight && isHovered.value) {
|
|
190
|
+
style['--mouse-x'] = `${mousePosition.value.x}px`
|
|
191
|
+
style['--mouse-y'] = `${mousePosition.value.y}px`
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// 3D tilt transform
|
|
195
|
+
if (props.tilt && isHovered.value) {
|
|
196
|
+
style.transform = `perspective(1000px) rotateX(${tiltRotation.value.x}deg) rotateY(${tiltRotation.value.y}deg) scale3d(1.02, 1.02, 1.02)`
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return style
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
// Event handlers
|
|
203
|
+
const handleMouseEnter = () => {
|
|
204
|
+
if (props.disabled) return
|
|
205
|
+
isHovered.value = true
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const handleMouseLeave = () => {
|
|
209
|
+
isHovered.value = false
|
|
210
|
+
isPressed.value = false
|
|
211
|
+
tiltRotation.value = { x: 0, y: 0 }
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const handleMouseMove = (event: MouseEvent) => {
|
|
215
|
+
if (!cardRef.value || props.disabled) return
|
|
216
|
+
|
|
217
|
+
const rect = cardRef.value.getBoundingClientRect()
|
|
218
|
+
const x = event.clientX - rect.left
|
|
219
|
+
const y = event.clientY - rect.top
|
|
220
|
+
|
|
221
|
+
mousePosition.value = { x, y }
|
|
222
|
+
|
|
223
|
+
// Calculate tilt rotation
|
|
224
|
+
if (props.tilt && isHovered.value) {
|
|
225
|
+
const centerX = rect.width / 2
|
|
226
|
+
const centerY = rect.height / 2
|
|
227
|
+
const rotateX = ((y - centerY) / centerY) * -8
|
|
228
|
+
const rotateY = ((x - centerX) / centerX) * 8
|
|
229
|
+
tiltRotation.value = { x: rotateX, y: rotateY }
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const handleMouseDown = () => {
|
|
234
|
+
if (props.pressable && !props.disabled) {
|
|
235
|
+
isPressed.value = true
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
const handleMouseUp = () => {
|
|
240
|
+
isPressed.value = false
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
const handleClick = (event: MouseEvent) => {
|
|
244
|
+
if (props.disabled) {
|
|
245
|
+
event.preventDefault()
|
|
246
|
+
return
|
|
247
|
+
}
|
|
248
|
+
if (props.clickable || props.href || props.to) {
|
|
249
|
+
emit('click', event)
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Expose for parent access
|
|
254
|
+
defineExpose({
|
|
255
|
+
isHovered,
|
|
256
|
+
isPressed
|
|
257
|
+
})
|
|
258
|
+
</script>
|
|
259
|
+
|
|
260
|
+
<template>
|
|
261
|
+
<component
|
|
262
|
+
:is="componentTag"
|
|
263
|
+
ref="cardRef"
|
|
264
|
+
v-bind="{ ...componentBindings, ...$attrs }"
|
|
265
|
+
:class="cn(
|
|
266
|
+
cardVariants({
|
|
267
|
+
variant: (gradientBorder || gradientBg) ? undefined : variant,
|
|
268
|
+
size: padding ? undefined : size,
|
|
269
|
+
rounded
|
|
270
|
+
}),
|
|
271
|
+
variantOverride,
|
|
272
|
+
{
|
|
273
|
+
// Layout
|
|
274
|
+
'flex': horizontal,
|
|
275
|
+
'flex-row-reverse': horizontal && mediaRight,
|
|
276
|
+
|
|
277
|
+
// Interactive states
|
|
278
|
+
'cursor-pointer': clickable || href || to,
|
|
279
|
+
'cursor-not-allowed opacity-50': disabled,
|
|
280
|
+
|
|
281
|
+
// Hover effects - enhanced animations
|
|
282
|
+
's-card-hoverable': hoverable && !disabled,
|
|
283
|
+
's-card-hoverable-elevated': hoverable && !disabled && variant === 'elevated',
|
|
284
|
+
's-card-hoverable-outlined': hoverable && !disabled && variant === 'outlined',
|
|
285
|
+
's-card-hoverable-filled': hoverable && !disabled && variant === 'filled',
|
|
286
|
+
's-card-hoverable-glass': hoverable && !disabled && variant === 'glass',
|
|
287
|
+
's-card-hoverable-ghost': hoverable && !disabled && variant === 'ghost',
|
|
288
|
+
|
|
289
|
+
// Press effect
|
|
290
|
+
's-card-pressable': pressable && !disabled,
|
|
291
|
+
's-card-pressed': isPressed,
|
|
292
|
+
|
|
293
|
+
// Spotlight
|
|
294
|
+
's-card-spotlight': spotlight,
|
|
295
|
+
|
|
296
|
+
// Gradient styles
|
|
297
|
+
's-card-gradient-border': gradientBorder,
|
|
298
|
+
's-card-gradient-bg': gradientBg
|
|
299
|
+
},
|
|
300
|
+
($attrs.class as string)
|
|
301
|
+
)"
|
|
302
|
+
:style="computedStyle"
|
|
303
|
+
@mouseenter="handleMouseEnter"
|
|
304
|
+
@mouseleave="handleMouseLeave"
|
|
305
|
+
@mousemove="handleMouseMove"
|
|
306
|
+
@mousedown="handleMouseDown"
|
|
307
|
+
@mouseup="handleMouseUp"
|
|
308
|
+
@click="handleClick"
|
|
309
|
+
>
|
|
310
|
+
<!-- Gradient border pseudo-element -->
|
|
311
|
+
<span
|
|
312
|
+
v-if="gradientBorder"
|
|
313
|
+
class="absolute inset-0 -z-10 p-px"
|
|
314
|
+
:class="radiusClasses"
|
|
315
|
+
:style="{ background: gradientBorder }"
|
|
316
|
+
>
|
|
317
|
+
<span
|
|
318
|
+
class="absolute inset-px bg-card"
|
|
319
|
+
:class="radiusClasses"
|
|
320
|
+
/>
|
|
321
|
+
</span>
|
|
322
|
+
|
|
323
|
+
<!-- Gradient background -->
|
|
324
|
+
<span
|
|
325
|
+
v-if="gradientBg"
|
|
326
|
+
class="absolute inset-0 -z-10 opacity-10"
|
|
327
|
+
:style="{ background: gradientBg }"
|
|
328
|
+
/>
|
|
329
|
+
|
|
330
|
+
<!-- Spotlight effect -->
|
|
331
|
+
<span
|
|
332
|
+
v-if="spotlight && isHovered"
|
|
333
|
+
class="s-card-spotlight-effect absolute inset-0 pointer-events-none transition-opacity duration-300"
|
|
334
|
+
:class="{ 'opacity-100': isHovered, 'opacity-0': !isHovered }"
|
|
335
|
+
/>
|
|
336
|
+
|
|
337
|
+
<!-- Shimmer effect for loading -->
|
|
338
|
+
<Transition name="fade">
|
|
339
|
+
<div
|
|
340
|
+
v-if="loading"
|
|
341
|
+
class="absolute inset-0 z-50 bg-card/80 backdrop-blur-sm flex items-center justify-center"
|
|
342
|
+
>
|
|
343
|
+
<div class="s-card-shimmer absolute inset-0" />
|
|
344
|
+
<div class="relative z-10 flex flex-col items-center gap-3">
|
|
345
|
+
<span class="mdi mdi-loading animate-spin text-2xl text-primary" />
|
|
346
|
+
<span class="text-sm text-muted-foreground">Loading...</span>
|
|
347
|
+
</div>
|
|
348
|
+
</div>
|
|
349
|
+
</Transition>
|
|
350
|
+
|
|
351
|
+
<!-- Card content -->
|
|
352
|
+
<slot />
|
|
353
|
+
</component>
|
|
354
|
+
</template>
|
|
355
|
+
|
|
356
|
+
<style scoped>
|
|
357
|
+
.s-card {
|
|
358
|
+
/* Custom property support */
|
|
359
|
+
background-color: var(--card-bg, var(--s-card));
|
|
360
|
+
border-color: var(--card-border, transparent);
|
|
361
|
+
transition:
|
|
362
|
+
transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
|
|
363
|
+
box-shadow 0.3s ease,
|
|
364
|
+
background-color 0.2s ease;
|
|
365
|
+
transform-style: preserve-3d;
|
|
366
|
+
will-change: transform, box-shadow;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/* ===== HOVER ANIMATIONS ===== */
|
|
370
|
+
|
|
371
|
+
/* Base hoverable - smooth lift */
|
|
372
|
+
.s-card-hoverable {
|
|
373
|
+
transition:
|
|
374
|
+
transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
|
|
375
|
+
box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
|
|
376
|
+
background-color 0.2s ease;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.s-card-hoverable:hover {
|
|
380
|
+
transform: translateY(-6px) scale(1.01);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/* Elevated variant - enhanced shadow */
|
|
384
|
+
.s-card-hoverable-elevated:hover {
|
|
385
|
+
box-shadow:
|
|
386
|
+
0 20px 40px -12px rgba(0, 0, 0, 0.2),
|
|
387
|
+
0 8px 16px -8px rgba(0, 0, 0, 0.1),
|
|
388
|
+
0 0 0 1px rgba(var(--s-primary-rgb), 0.05);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
:root.dark .s-card-hoverable-elevated:hover {
|
|
392
|
+
box-shadow:
|
|
393
|
+
0 20px 40px -12px rgba(0, 0, 0, 0.5),
|
|
394
|
+
0 8px 16px -8px rgba(0, 0, 0, 0.3),
|
|
395
|
+
0 0 0 1px rgba(255, 255, 255, 0.05);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/* Outlined variant - border glow */
|
|
399
|
+
.s-card-hoverable-outlined:hover {
|
|
400
|
+
border-color: var(--s-primary);
|
|
401
|
+
box-shadow:
|
|
402
|
+
0 0 0 1px var(--s-primary),
|
|
403
|
+
0 8px 24px -8px rgba(var(--s-primary-rgb), 0.2);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/* Filled variant - subtle lift with bg change */
|
|
407
|
+
.s-card-hoverable-filled:hover {
|
|
408
|
+
background-color: var(--s-accent);
|
|
409
|
+
box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.15);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
:root.dark .s-card-hoverable-filled:hover {
|
|
413
|
+
box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.4);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/* Glass variant - enhanced blur and glow */
|
|
417
|
+
.s-card-hoverable-glass:hover {
|
|
418
|
+
background-color: rgba(255, 255, 255, 0.15);
|
|
419
|
+
backdrop-filter: blur(20px);
|
|
420
|
+
box-shadow:
|
|
421
|
+
0 8px 32px -8px rgba(0, 0, 0, 0.15),
|
|
422
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
:root.dark .s-card-hoverable-glass:hover {
|
|
426
|
+
background-color: rgba(255, 255, 255, 0.08);
|
|
427
|
+
box-shadow:
|
|
428
|
+
0 8px 32px -8px rgba(0, 0, 0, 0.4),
|
|
429
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.05);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/* Ghost variant - subtle bg appear */
|
|
433
|
+
.s-card-hoverable-ghost:hover {
|
|
434
|
+
background-color: var(--s-muted);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/* ===== PRESS EFFECT ===== */
|
|
438
|
+
.s-card-pressable {
|
|
439
|
+
transition:
|
|
440
|
+
transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
|
|
441
|
+
box-shadow 0.15s ease;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.s-card-pressable:active,
|
|
445
|
+
.s-card-pressed {
|
|
446
|
+
transform: translateY(0) scale(0.98) !important;
|
|
447
|
+
box-shadow:
|
|
448
|
+
0 2px 8px -4px rgba(0, 0, 0, 0.2) !important;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/* ===== SPOTLIGHT EFFECT ===== */
|
|
452
|
+
.s-card-spotlight::before {
|
|
453
|
+
content: '';
|
|
454
|
+
position: absolute;
|
|
455
|
+
inset: 0;
|
|
456
|
+
opacity: 0;
|
|
457
|
+
transition: opacity 0.4s ease;
|
|
458
|
+
background: radial-gradient(
|
|
459
|
+
600px circle at var(--mouse-x) var(--mouse-y),
|
|
460
|
+
color-mix(in srgb, var(--spotlight-color) 15%, transparent),
|
|
461
|
+
transparent 40%
|
|
462
|
+
);
|
|
463
|
+
pointer-events: none;
|
|
464
|
+
z-index: 1;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.s-card-spotlight:hover::before {
|
|
468
|
+
opacity: 1;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.s-card-spotlight-effect {
|
|
472
|
+
background: radial-gradient(
|
|
473
|
+
400px circle at var(--mouse-x) var(--mouse-y),
|
|
474
|
+
color-mix(in srgb, var(--spotlight-color) 8%, transparent),
|
|
475
|
+
transparent 50%
|
|
476
|
+
);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/* ===== SHIMMER LOADING ===== */
|
|
480
|
+
.s-card-shimmer {
|
|
481
|
+
background: linear-gradient(
|
|
482
|
+
90deg,
|
|
483
|
+
transparent 0%,
|
|
484
|
+
var(--s-accent) 50%,
|
|
485
|
+
transparent 100%
|
|
486
|
+
);
|
|
487
|
+
background-size: 200% 100%;
|
|
488
|
+
animation: shimmer 1.5s infinite;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
@keyframes shimmer {
|
|
492
|
+
0% {
|
|
493
|
+
background-position: 200% 0;
|
|
494
|
+
}
|
|
495
|
+
100% {
|
|
496
|
+
background-position: -200% 0;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/* Fade transition */
|
|
501
|
+
.fade-enter-active,
|
|
502
|
+
.fade-leave-active {
|
|
503
|
+
transition: opacity 0.3s ease;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
.fade-enter-from,
|
|
507
|
+
.fade-leave-to {
|
|
508
|
+
opacity: 0;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/* Gradient border support */
|
|
512
|
+
.s-card-gradient-border {
|
|
513
|
+
position: relative;
|
|
514
|
+
background: transparent;
|
|
515
|
+
border: none;
|
|
516
|
+
}
|
|
517
|
+
</style>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, inject } from 'vue'
|
|
3
|
+
import { cn } from '../../../lib/utils'
|
|
4
|
+
import { cardContextKey, type CardContext } from './index'
|
|
5
|
+
|
|
6
|
+
defineOptions({ inheritAttrs: false })
|
|
7
|
+
|
|
8
|
+
export interface Props {
|
|
9
|
+
/** Justify content */
|
|
10
|
+
justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'
|
|
11
|
+
/** Alignment */
|
|
12
|
+
align?: 'start' | 'center' | 'end' | 'stretch'
|
|
13
|
+
/** Gap between items */
|
|
14
|
+
gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg'
|
|
15
|
+
/** Direction */
|
|
16
|
+
direction?: 'row' | 'column'
|
|
17
|
+
/** Custom padding */
|
|
18
|
+
padding?: string
|
|
19
|
+
/** Full width buttons */
|
|
20
|
+
fullWidth?: boolean
|
|
21
|
+
/** Stack vertically on mobile */
|
|
22
|
+
stackOnMobile?: boolean
|
|
23
|
+
/** Reversed order */
|
|
24
|
+
reverse?: boolean
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
28
|
+
justify: 'start',
|
|
29
|
+
align: 'center',
|
|
30
|
+
gap: 'sm',
|
|
31
|
+
direction: 'row',
|
|
32
|
+
padding: undefined,
|
|
33
|
+
fullWidth: false,
|
|
34
|
+
stackOnMobile: false,
|
|
35
|
+
reverse: false
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
// Card context available for future enhancements
|
|
39
|
+
inject(cardContextKey, {
|
|
40
|
+
variant: 'elevated',
|
|
41
|
+
hoverable: false,
|
|
42
|
+
loading: false,
|
|
43
|
+
horizontal: false
|
|
44
|
+
} as CardContext)
|
|
45
|
+
|
|
46
|
+
const justifyClasses = computed(() => {
|
|
47
|
+
const justifications = {
|
|
48
|
+
start: 'justify-start',
|
|
49
|
+
center: 'justify-center',
|
|
50
|
+
end: 'justify-end',
|
|
51
|
+
between: 'justify-between',
|
|
52
|
+
around: 'justify-around',
|
|
53
|
+
evenly: 'justify-evenly'
|
|
54
|
+
}
|
|
55
|
+
return justifications[props.justify]
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const alignClasses = computed(() => {
|
|
59
|
+
const alignments = {
|
|
60
|
+
start: 'items-start',
|
|
61
|
+
center: 'items-center',
|
|
62
|
+
end: 'items-end',
|
|
63
|
+
stretch: 'items-stretch'
|
|
64
|
+
}
|
|
65
|
+
return alignments[props.align]
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
const gapClasses = computed(() => {
|
|
69
|
+
const gaps = {
|
|
70
|
+
none: 'gap-0',
|
|
71
|
+
xs: 'gap-1',
|
|
72
|
+
sm: 'gap-2',
|
|
73
|
+
md: 'gap-3',
|
|
74
|
+
lg: 'gap-4'
|
|
75
|
+
}
|
|
76
|
+
return gaps[props.gap]
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
const directionClasses = computed(() => {
|
|
80
|
+
if (props.stackOnMobile) {
|
|
81
|
+
return props.direction === 'row'
|
|
82
|
+
? (props.reverse ? 'flex-col-reverse sm:flex-row-reverse' : 'flex-col sm:flex-row')
|
|
83
|
+
: (props.reverse ? 'flex-row-reverse sm:flex-col-reverse' : 'flex-row sm:flex-col')
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const directions = {
|
|
87
|
+
row: props.reverse ? 'flex-row-reverse' : 'flex-row',
|
|
88
|
+
column: props.reverse ? 'flex-col-reverse' : 'flex-col'
|
|
89
|
+
}
|
|
90
|
+
return directions[props.direction]
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
const computedStyle = computed(() => {
|
|
94
|
+
const style: Record<string, string> = {}
|
|
95
|
+
if (props.padding) style.padding = props.padding
|
|
96
|
+
return style
|
|
97
|
+
})
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
<template>
|
|
101
|
+
<div
|
|
102
|
+
v-bind="$attrs"
|
|
103
|
+
:class="cn(
|
|
104
|
+
's-card-actions flex flex-wrap',
|
|
105
|
+
justifyClasses,
|
|
106
|
+
alignClasses,
|
|
107
|
+
gapClasses,
|
|
108
|
+
directionClasses,
|
|
109
|
+
{
|
|
110
|
+
'w-full': fullWidth
|
|
111
|
+
},
|
|
112
|
+
($attrs.class as string)
|
|
113
|
+
)"
|
|
114
|
+
:style="computedStyle"
|
|
115
|
+
>
|
|
116
|
+
<slot />
|
|
117
|
+
</div>
|
|
118
|
+
</template>
|
|
119
|
+
|
|
120
|
+
<style scoped>
|
|
121
|
+
.s-card-actions {
|
|
122
|
+
/* Inherits from parent */
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* Full width buttons inside */
|
|
126
|
+
.s-card-actions.w-full :deep(> *) {
|
|
127
|
+
flex: 1;
|
|
128
|
+
}
|
|
129
|
+
</style>
|