@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,117 @@
|
|
|
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
|
+
/** Custom padding */
|
|
10
|
+
padding?: string
|
|
11
|
+
/** Text alignment */
|
|
12
|
+
align?: 'left' | 'center' | 'right' | 'justify'
|
|
13
|
+
/** Make content scrollable with max height */
|
|
14
|
+
maxHeight?: string
|
|
15
|
+
/** Show skeleton loading state */
|
|
16
|
+
skeleton?: boolean
|
|
17
|
+
/** Number of skeleton lines */
|
|
18
|
+
skeletonLines?: number
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
22
|
+
padding: undefined,
|
|
23
|
+
align: 'left',
|
|
24
|
+
maxHeight: undefined,
|
|
25
|
+
skeleton: false,
|
|
26
|
+
skeletonLines: 3
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const cardContext = inject(cardContextKey, {
|
|
30
|
+
variant: 'elevated',
|
|
31
|
+
hoverable: false,
|
|
32
|
+
loading: false,
|
|
33
|
+
horizontal: false
|
|
34
|
+
} as CardContext)
|
|
35
|
+
|
|
36
|
+
const alignClasses = computed(() => {
|
|
37
|
+
const alignments = {
|
|
38
|
+
left: 'text-left',
|
|
39
|
+
center: 'text-center',
|
|
40
|
+
right: 'text-right',
|
|
41
|
+
justify: 'text-justify'
|
|
42
|
+
}
|
|
43
|
+
return alignments[props.align]
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
const computedStyle = computed(() => {
|
|
47
|
+
const style: Record<string, string> = {}
|
|
48
|
+
if (props.padding) style.padding = props.padding
|
|
49
|
+
if (props.maxHeight) {
|
|
50
|
+
style.maxHeight = props.maxHeight
|
|
51
|
+
style.overflowY = 'auto'
|
|
52
|
+
}
|
|
53
|
+
return style
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
// Generate random widths for skeleton lines
|
|
57
|
+
const skeletonWidths = computed(() => {
|
|
58
|
+
const widths = ['100%', '80%', '90%', '70%', '85%', '75%', '95%']
|
|
59
|
+
return Array.from({ length: props.skeletonLines }, (_, i) =>
|
|
60
|
+
widths[i % widths.length]
|
|
61
|
+
)
|
|
62
|
+
})
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<template>
|
|
66
|
+
<div
|
|
67
|
+
v-bind="$attrs"
|
|
68
|
+
:class="cn(
|
|
69
|
+
's-card-content text-muted-foreground',
|
|
70
|
+
alignClasses,
|
|
71
|
+
($attrs.class as string)
|
|
72
|
+
)"
|
|
73
|
+
:style="computedStyle"
|
|
74
|
+
>
|
|
75
|
+
<!-- Skeleton loading state -->
|
|
76
|
+
<template v-if="skeleton || cardContext.loading">
|
|
77
|
+
<div class="space-y-3 animate-pulse">
|
|
78
|
+
<div
|
|
79
|
+
v-for="(width, index) in skeletonWidths"
|
|
80
|
+
:key="index"
|
|
81
|
+
class="h-4 bg-accent rounded"
|
|
82
|
+
:style="{ width }"
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
</template>
|
|
86
|
+
|
|
87
|
+
<!-- Normal content -->
|
|
88
|
+
<template v-else>
|
|
89
|
+
<slot />
|
|
90
|
+
</template>
|
|
91
|
+
</div>
|
|
92
|
+
</template>
|
|
93
|
+
|
|
94
|
+
<style scoped>
|
|
95
|
+
.s-card-content {
|
|
96
|
+
line-height: 1.6;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* Custom scrollbar for scrollable content */
|
|
100
|
+
.s-card-content::-webkit-scrollbar {
|
|
101
|
+
width: 6px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.s-card-content::-webkit-scrollbar-track {
|
|
105
|
+
background: var(--s-accent);
|
|
106
|
+
border-radius: 3px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.s-card-content::-webkit-scrollbar-thumb {
|
|
110
|
+
background: var(--s-input);
|
|
111
|
+
border-radius: 3px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.s-card-content::-webkit-scrollbar-thumb:hover {
|
|
115
|
+
background: var(--s-muted-foreground);
|
|
116
|
+
}
|
|
117
|
+
</style>
|
|
@@ -0,0 +1,103 @@
|
|
|
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
|
+
/** Show divider above footer */
|
|
10
|
+
divider?: boolean
|
|
11
|
+
/** Justify content */
|
|
12
|
+
justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'
|
|
13
|
+
/** Alignment */
|
|
14
|
+
align?: 'start' | 'center' | 'end' | 'stretch'
|
|
15
|
+
/** Gap between items */
|
|
16
|
+
gap?: 'none' | 'sm' | 'md' | 'lg'
|
|
17
|
+
/** Custom padding */
|
|
18
|
+
padding?: string
|
|
19
|
+
/** Stack items vertically on mobile */
|
|
20
|
+
stackOnMobile?: boolean
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
24
|
+
divider: false,
|
|
25
|
+
justify: 'end',
|
|
26
|
+
align: 'center',
|
|
27
|
+
gap: 'md',
|
|
28
|
+
padding: undefined,
|
|
29
|
+
stackOnMobile: false
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
// Card context available for future enhancements
|
|
33
|
+
inject(cardContextKey, {
|
|
34
|
+
variant: 'elevated',
|
|
35
|
+
hoverable: false,
|
|
36
|
+
loading: false,
|
|
37
|
+
horizontal: false
|
|
38
|
+
} as CardContext)
|
|
39
|
+
|
|
40
|
+
const justifyClasses = computed(() => {
|
|
41
|
+
const justifications = {
|
|
42
|
+
start: 'justify-start',
|
|
43
|
+
center: 'justify-center',
|
|
44
|
+
end: 'justify-end',
|
|
45
|
+
between: 'justify-between',
|
|
46
|
+
around: 'justify-around',
|
|
47
|
+
evenly: 'justify-evenly'
|
|
48
|
+
}
|
|
49
|
+
return justifications[props.justify]
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
const alignClasses = computed(() => {
|
|
53
|
+
const alignments = {
|
|
54
|
+
start: 'items-start',
|
|
55
|
+
center: 'items-center',
|
|
56
|
+
end: 'items-end',
|
|
57
|
+
stretch: 'items-stretch'
|
|
58
|
+
}
|
|
59
|
+
return alignments[props.align]
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
const gapClasses = computed(() => {
|
|
63
|
+
const gaps = {
|
|
64
|
+
none: 'gap-0',
|
|
65
|
+
sm: 'gap-2',
|
|
66
|
+
md: 'gap-3',
|
|
67
|
+
lg: 'gap-4'
|
|
68
|
+
}
|
|
69
|
+
return gaps[props.gap]
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
const computedStyle = computed(() => {
|
|
73
|
+
const style: Record<string, string> = {}
|
|
74
|
+
if (props.padding) style.padding = props.padding
|
|
75
|
+
return style
|
|
76
|
+
})
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<template>
|
|
80
|
+
<div
|
|
81
|
+
v-bind="$attrs"
|
|
82
|
+
:class="cn(
|
|
83
|
+
's-card-footer flex flex-wrap',
|
|
84
|
+
justifyClasses,
|
|
85
|
+
alignClasses,
|
|
86
|
+
gapClasses,
|
|
87
|
+
{
|
|
88
|
+
'pt-4 mt-4 border-t border-border': divider,
|
|
89
|
+
'flex-col sm:flex-row': stackOnMobile
|
|
90
|
+
},
|
|
91
|
+
($attrs.class as string)
|
|
92
|
+
)"
|
|
93
|
+
:style="computedStyle"
|
|
94
|
+
>
|
|
95
|
+
<slot />
|
|
96
|
+
</div>
|
|
97
|
+
</template>
|
|
98
|
+
|
|
99
|
+
<style scoped>
|
|
100
|
+
.s-card-footer {
|
|
101
|
+
/* Inherits from parent */
|
|
102
|
+
}
|
|
103
|
+
</style>
|
|
@@ -0,0 +1,163 @@
|
|
|
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
|
+
/** Title text */
|
|
10
|
+
title?: string
|
|
11
|
+
/** Subtitle text */
|
|
12
|
+
subtitle?: string
|
|
13
|
+
/** Avatar image URL */
|
|
14
|
+
avatar?: string
|
|
15
|
+
/** Avatar fallback text (initials) */
|
|
16
|
+
avatarFallback?: string
|
|
17
|
+
/** Icon name (MDI) */
|
|
18
|
+
icon?: string
|
|
19
|
+
/** Icon color */
|
|
20
|
+
iconColor?: string
|
|
21
|
+
/** Show divider below header */
|
|
22
|
+
divider?: boolean
|
|
23
|
+
/** Layout direction */
|
|
24
|
+
layout?: 'horizontal' | 'vertical'
|
|
25
|
+
/** Alignment */
|
|
26
|
+
align?: 'start' | 'center' | 'end'
|
|
27
|
+
/** Custom padding */
|
|
28
|
+
padding?: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
32
|
+
title: undefined,
|
|
33
|
+
subtitle: undefined,
|
|
34
|
+
avatar: undefined,
|
|
35
|
+
avatarFallback: undefined,
|
|
36
|
+
icon: undefined,
|
|
37
|
+
iconColor: 'var(--s-primary)',
|
|
38
|
+
divider: false,
|
|
39
|
+
layout: 'horizontal',
|
|
40
|
+
align: 'start'
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
// Card context available for future enhancements
|
|
44
|
+
inject(cardContextKey, {
|
|
45
|
+
variant: 'elevated',
|
|
46
|
+
hoverable: false,
|
|
47
|
+
loading: false,
|
|
48
|
+
horizontal: false
|
|
49
|
+
} as CardContext)
|
|
50
|
+
|
|
51
|
+
const alignmentClasses = computed(() => {
|
|
52
|
+
if (props.layout === 'vertical') {
|
|
53
|
+
const alignments = {
|
|
54
|
+
start: 'items-start text-left',
|
|
55
|
+
center: 'items-center text-center',
|
|
56
|
+
end: 'items-end text-right'
|
|
57
|
+
}
|
|
58
|
+
return alignments[props.align]
|
|
59
|
+
}
|
|
60
|
+
return ''
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
const computedStyle = computed(() => {
|
|
64
|
+
const style: Record<string, string> = {}
|
|
65
|
+
if (props.padding) style.padding = props.padding
|
|
66
|
+
return style
|
|
67
|
+
})
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<template>
|
|
71
|
+
<div
|
|
72
|
+
v-bind="$attrs"
|
|
73
|
+
:class="cn(
|
|
74
|
+
's-card-header',
|
|
75
|
+
{
|
|
76
|
+
'flex items-center gap-3': layout === 'horizontal',
|
|
77
|
+
'flex flex-col gap-2': layout === 'vertical',
|
|
78
|
+
'pb-4 border-b border-border': divider
|
|
79
|
+
},
|
|
80
|
+
alignmentClasses,
|
|
81
|
+
($attrs.class as string)
|
|
82
|
+
)"
|
|
83
|
+
:style="computedStyle"
|
|
84
|
+
>
|
|
85
|
+
<!-- Avatar/Icon -->
|
|
86
|
+
<div
|
|
87
|
+
v-if="avatar || avatarFallback || icon || $slots.avatar"
|
|
88
|
+
class="shrink-0"
|
|
89
|
+
>
|
|
90
|
+
<slot name="avatar">
|
|
91
|
+
<!-- Avatar with image -->
|
|
92
|
+
<div
|
|
93
|
+
v-if="avatar"
|
|
94
|
+
class="w-10 h-10 rounded-full overflow-hidden ring-2 ring-border"
|
|
95
|
+
>
|
|
96
|
+
<img
|
|
97
|
+
:src="avatar"
|
|
98
|
+
:alt="title || 'Avatar'"
|
|
99
|
+
class="w-full h-full object-cover"
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<!-- Avatar with fallback -->
|
|
104
|
+
<div
|
|
105
|
+
v-else-if="avatarFallback"
|
|
106
|
+
class="w-10 h-10 rounded-full bg-accent flex items-center justify-center text-sm font-semibold text-muted-foreground"
|
|
107
|
+
>
|
|
108
|
+
{{ avatarFallback }}
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<!-- Icon -->
|
|
112
|
+
<div
|
|
113
|
+
v-else-if="icon"
|
|
114
|
+
class="w-10 h-10 rounded-xl bg-primary/15 flex items-center justify-center"
|
|
115
|
+
>
|
|
116
|
+
<span
|
|
117
|
+
class="mdi text-xl"
|
|
118
|
+
:class="`mdi-${icon}`"
|
|
119
|
+
:style="{ color: iconColor }"
|
|
120
|
+
/>
|
|
121
|
+
</div>
|
|
122
|
+
</slot>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
<!-- Text content -->
|
|
126
|
+
<div class="flex-1 min-w-0">
|
|
127
|
+
<slot name="title">
|
|
128
|
+
<h3
|
|
129
|
+
v-if="title"
|
|
130
|
+
class="text-base font-semibold text-foreground leading-tight truncate"
|
|
131
|
+
>
|
|
132
|
+
{{ title }}
|
|
133
|
+
</h3>
|
|
134
|
+
</slot>
|
|
135
|
+
|
|
136
|
+
<slot name="subtitle">
|
|
137
|
+
<p
|
|
138
|
+
v-if="subtitle"
|
|
139
|
+
class="text-sm text-muted-foreground mt-0.5 truncate"
|
|
140
|
+
>
|
|
141
|
+
{{ subtitle }}
|
|
142
|
+
</p>
|
|
143
|
+
</slot>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<!-- Actions slot (right side) -->
|
|
147
|
+
<div
|
|
148
|
+
v-if="$slots.actions"
|
|
149
|
+
class="shrink-0 flex items-center gap-2"
|
|
150
|
+
>
|
|
151
|
+
<slot name="actions" />
|
|
152
|
+
</div>
|
|
153
|
+
|
|
154
|
+
<!-- Default slot for custom content -->
|
|
155
|
+
<slot />
|
|
156
|
+
</div>
|
|
157
|
+
</template>
|
|
158
|
+
|
|
159
|
+
<style scoped>
|
|
160
|
+
.s-card-header {
|
|
161
|
+
/* Inherits from parent */
|
|
162
|
+
}
|
|
163
|
+
</style>
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, inject, ref } 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
|
+
/** Image source URL */
|
|
10
|
+
src?: string
|
|
11
|
+
/** Video source URL */
|
|
12
|
+
video?: string
|
|
13
|
+
/** Alt text for image */
|
|
14
|
+
alt?: string
|
|
15
|
+
/** Aspect ratio */
|
|
16
|
+
ratio?: 'auto' | '1/1' | '4/3' | '16/9' | '21/9' | '3/4' | '9/16'
|
|
17
|
+
/** Height override */
|
|
18
|
+
height?: string
|
|
19
|
+
/** Object fit */
|
|
20
|
+
fit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down'
|
|
21
|
+
/** Enable zoom on hover */
|
|
22
|
+
zoom?: boolean
|
|
23
|
+
/** Zoom scale factor */
|
|
24
|
+
zoomScale?: number
|
|
25
|
+
/** Overlay color (gradient or solid) */
|
|
26
|
+
overlay?: string
|
|
27
|
+
/** Overlay opacity (0-1) */
|
|
28
|
+
overlayOpacity?: number
|
|
29
|
+
/** Show overlay content always or on hover */
|
|
30
|
+
overlayMode?: 'always' | 'hover'
|
|
31
|
+
/** Position in card layout */
|
|
32
|
+
position?: 'top' | 'bottom' | 'left' | 'right' | 'background'
|
|
33
|
+
/** Border radius override */
|
|
34
|
+
rounded?: 'none' | 'inherit' | 'sm' | 'md' | 'lg' | 'xl'
|
|
35
|
+
/** Video autoplay */
|
|
36
|
+
autoplay?: boolean
|
|
37
|
+
/** Video loop */
|
|
38
|
+
loop?: boolean
|
|
39
|
+
/** Video muted */
|
|
40
|
+
muted?: boolean
|
|
41
|
+
/** Video controls */
|
|
42
|
+
controls?: boolean
|
|
43
|
+
/** Lazy load image */
|
|
44
|
+
lazy?: boolean
|
|
45
|
+
/** Placeholder blur */
|
|
46
|
+
placeholder?: string
|
|
47
|
+
/** Skeleton loading */
|
|
48
|
+
skeleton?: boolean
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
52
|
+
src: undefined,
|
|
53
|
+
video: undefined,
|
|
54
|
+
alt: '',
|
|
55
|
+
ratio: 'auto',
|
|
56
|
+
height: undefined,
|
|
57
|
+
fit: 'cover',
|
|
58
|
+
zoom: false,
|
|
59
|
+
zoomScale: 1.1,
|
|
60
|
+
overlay: undefined,
|
|
61
|
+
overlayOpacity: 0.5,
|
|
62
|
+
overlayMode: 'always',
|
|
63
|
+
position: 'top',
|
|
64
|
+
rounded: 'inherit',
|
|
65
|
+
autoplay: false,
|
|
66
|
+
loop: true,
|
|
67
|
+
muted: true,
|
|
68
|
+
controls: false,
|
|
69
|
+
lazy: true,
|
|
70
|
+
placeholder: undefined,
|
|
71
|
+
skeleton: false
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
const cardContext = inject(cardContextKey, {
|
|
75
|
+
variant: 'elevated',
|
|
76
|
+
hoverable: false,
|
|
77
|
+
loading: false,
|
|
78
|
+
horizontal: false
|
|
79
|
+
} as CardContext)
|
|
80
|
+
|
|
81
|
+
const isLoaded = ref(!props.lazy)
|
|
82
|
+
const isHovered = ref(false)
|
|
83
|
+
const hasError = ref(false)
|
|
84
|
+
|
|
85
|
+
const aspectRatioClasses = computed(() => {
|
|
86
|
+
if (props.height || props.ratio === 'auto') return ''
|
|
87
|
+
|
|
88
|
+
const ratios = {
|
|
89
|
+
'1/1': 'aspect-square',
|
|
90
|
+
'4/3': 'aspect-[4/3]',
|
|
91
|
+
'16/9': 'aspect-video',
|
|
92
|
+
'21/9': 'aspect-[21/9]',
|
|
93
|
+
'3/4': 'aspect-[3/4]',
|
|
94
|
+
'9/16': 'aspect-[9/16]',
|
|
95
|
+
'auto': ''
|
|
96
|
+
}
|
|
97
|
+
return ratios[props.ratio]
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
const fitClasses = computed(() => {
|
|
101
|
+
const fits = {
|
|
102
|
+
cover: 'object-cover',
|
|
103
|
+
contain: 'object-contain',
|
|
104
|
+
fill: 'object-fill',
|
|
105
|
+
none: 'object-none',
|
|
106
|
+
'scale-down': 'object-scale-down'
|
|
107
|
+
}
|
|
108
|
+
return fits[props.fit]
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
const roundedClasses = computed(() => {
|
|
112
|
+
const radii = {
|
|
113
|
+
none: 'rounded-none',
|
|
114
|
+
inherit: '',
|
|
115
|
+
sm: 'rounded-sm',
|
|
116
|
+
md: 'rounded-md',
|
|
117
|
+
lg: 'rounded-lg',
|
|
118
|
+
xl: 'rounded-xl'
|
|
119
|
+
}
|
|
120
|
+
return radii[props.rounded]
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
const positionClasses = computed(() => {
|
|
124
|
+
const positions = {
|
|
125
|
+
top: '-mx-4 -mt-4 sm:-mx-5 sm:-mt-5 mb-4',
|
|
126
|
+
bottom: '-mx-4 -mb-4 sm:-mx-5 sm:-mb-5 mt-4',
|
|
127
|
+
left: '',
|
|
128
|
+
right: '',
|
|
129
|
+
background: 'absolute inset-0 -z-10'
|
|
130
|
+
}
|
|
131
|
+
return positions[props.position]
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
const computedStyle = computed(() => {
|
|
135
|
+
const style: Record<string, string> = {}
|
|
136
|
+
if (props.height) style.height = props.height
|
|
137
|
+
return style
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
const overlayStyle = computed(() => {
|
|
141
|
+
if (!props.overlay) return {}
|
|
142
|
+
|
|
143
|
+
const style: Record<string, string> = {
|
|
144
|
+
background: props.overlay.includes('gradient')
|
|
145
|
+
? props.overlay
|
|
146
|
+
: props.overlay,
|
|
147
|
+
opacity: String(props.overlayOpacity)
|
|
148
|
+
}
|
|
149
|
+
return style
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
const handleLoad = () => {
|
|
153
|
+
isLoaded.value = true
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const handleError = () => {
|
|
157
|
+
hasError.value = true
|
|
158
|
+
isLoaded.value = true
|
|
159
|
+
}
|
|
160
|
+
</script>
|
|
161
|
+
|
|
162
|
+
<template>
|
|
163
|
+
<div
|
|
164
|
+
v-bind="$attrs"
|
|
165
|
+
:class="cn(
|
|
166
|
+
's-card-media relative overflow-hidden',
|
|
167
|
+
aspectRatioClasses,
|
|
168
|
+
roundedClasses,
|
|
169
|
+
positionClasses,
|
|
170
|
+
{
|
|
171
|
+
'rounded-t-lg': position === 'top' && rounded === 'inherit',
|
|
172
|
+
'rounded-b-lg': position === 'bottom' && rounded === 'inherit',
|
|
173
|
+
'w-1/3 shrink-0': cardContext.horizontal && (position === 'left' || position === 'right')
|
|
174
|
+
},
|
|
175
|
+
($attrs.class as string)
|
|
176
|
+
)"
|
|
177
|
+
:style="computedStyle"
|
|
178
|
+
@mouseenter="isHovered = true"
|
|
179
|
+
@mouseleave="isHovered = false"
|
|
180
|
+
>
|
|
181
|
+
<!-- Skeleton loading -->
|
|
182
|
+
<div
|
|
183
|
+
v-if="skeleton || cardContext.loading || (!isLoaded && !hasError)"
|
|
184
|
+
class="absolute inset-0 bg-accent animate-pulse"
|
|
185
|
+
>
|
|
186
|
+
<div class="absolute inset-0 s-card-media-shimmer" />
|
|
187
|
+
</div>
|
|
188
|
+
|
|
189
|
+
<!-- Placeholder/blur while loading -->
|
|
190
|
+
<img
|
|
191
|
+
v-if="placeholder && !isLoaded"
|
|
192
|
+
:src="placeholder"
|
|
193
|
+
:alt="alt"
|
|
194
|
+
class="absolute inset-0 w-full h-full blur-lg scale-110"
|
|
195
|
+
:class="fitClasses"
|
|
196
|
+
/>
|
|
197
|
+
|
|
198
|
+
<!-- Main image -->
|
|
199
|
+
<img
|
|
200
|
+
v-if="src && !hasError"
|
|
201
|
+
:src="src"
|
|
202
|
+
:alt="alt"
|
|
203
|
+
:loading="lazy ? 'lazy' : 'eager'"
|
|
204
|
+
class="w-full h-full transition-all duration-500"
|
|
205
|
+
:class="[
|
|
206
|
+
fitClasses,
|
|
207
|
+
{
|
|
208
|
+
'opacity-0': !isLoaded,
|
|
209
|
+
'opacity-100': isLoaded,
|
|
210
|
+
'scale-100': !isHovered || !zoom,
|
|
211
|
+
'scale-110': isHovered && zoom
|
|
212
|
+
}
|
|
213
|
+
]"
|
|
214
|
+
:style="{ transform: zoom && isHovered ? `scale(${zoomScale})` : undefined }"
|
|
215
|
+
@load="handleLoad"
|
|
216
|
+
@error="handleError"
|
|
217
|
+
/>
|
|
218
|
+
|
|
219
|
+
<!-- Video -->
|
|
220
|
+
<video
|
|
221
|
+
v-if="video"
|
|
222
|
+
:src="video"
|
|
223
|
+
:autoplay="autoplay"
|
|
224
|
+
:loop="loop"
|
|
225
|
+
:muted="muted"
|
|
226
|
+
:controls="controls"
|
|
227
|
+
playsinline
|
|
228
|
+
class="w-full h-full transition-transform duration-500"
|
|
229
|
+
:class="[
|
|
230
|
+
fitClasses,
|
|
231
|
+
{
|
|
232
|
+
'scale-100': !isHovered || !zoom,
|
|
233
|
+
'scale-110': isHovered && zoom
|
|
234
|
+
}
|
|
235
|
+
]"
|
|
236
|
+
@loadeddata="handleLoad"
|
|
237
|
+
@error="handleError"
|
|
238
|
+
/>
|
|
239
|
+
|
|
240
|
+
<!-- Error state -->
|
|
241
|
+
<div
|
|
242
|
+
v-if="hasError"
|
|
243
|
+
class="absolute inset-0 flex flex-col items-center justify-center bg-accent text-muted-foreground"
|
|
244
|
+
>
|
|
245
|
+
<span class="mdi mdi-image-broken-variant text-4xl mb-2" />
|
|
246
|
+
<span class="text-sm">Failed to load media</span>
|
|
247
|
+
</div>
|
|
248
|
+
|
|
249
|
+
<!-- Overlay -->
|
|
250
|
+
<div
|
|
251
|
+
v-if="overlay || $slots.overlay"
|
|
252
|
+
class="absolute inset-0 flex items-end transition-opacity duration-300"
|
|
253
|
+
:class="{
|
|
254
|
+
'opacity-0': overlayMode === 'hover' && !isHovered,
|
|
255
|
+
'opacity-100': overlayMode === 'always' || isHovered
|
|
256
|
+
}"
|
|
257
|
+
:style="overlayStyle"
|
|
258
|
+
>
|
|
259
|
+
<slot name="overlay" />
|
|
260
|
+
</div>
|
|
261
|
+
|
|
262
|
+
<!-- Content overlay (for text on image) -->
|
|
263
|
+
<div
|
|
264
|
+
v-if="$slots.default"
|
|
265
|
+
class="absolute inset-0 flex items-center justify-center p-4"
|
|
266
|
+
>
|
|
267
|
+
<slot />
|
|
268
|
+
</div>
|
|
269
|
+
|
|
270
|
+
<!-- Badge slot (top corner) -->
|
|
271
|
+
<div
|
|
272
|
+
v-if="$slots.badge"
|
|
273
|
+
class="absolute top-3 right-3 z-10"
|
|
274
|
+
>
|
|
275
|
+
<slot name="badge" />
|
|
276
|
+
</div>
|
|
277
|
+
|
|
278
|
+
<!-- Action slot (bottom) -->
|
|
279
|
+
<div
|
|
280
|
+
v-if="$slots.actions"
|
|
281
|
+
class="absolute bottom-0 left-0 right-0 p-4 bg-gradient-to-t from-black/60 to-transparent transition-opacity duration-300"
|
|
282
|
+
:class="{
|
|
283
|
+
'opacity-0': overlayMode === 'hover' && !isHovered,
|
|
284
|
+
'opacity-100': overlayMode === 'always' || isHovered
|
|
285
|
+
}"
|
|
286
|
+
>
|
|
287
|
+
<slot name="actions" />
|
|
288
|
+
</div>
|
|
289
|
+
</div>
|
|
290
|
+
</template>
|
|
291
|
+
|
|
292
|
+
<style scoped>
|
|
293
|
+
.s-card-media-shimmer {
|
|
294
|
+
background: linear-gradient(
|
|
295
|
+
90deg,
|
|
296
|
+
transparent 0%,
|
|
297
|
+
var(--s-muted) 50%,
|
|
298
|
+
transparent 100%
|
|
299
|
+
);
|
|
300
|
+
background-size: 200% 100%;
|
|
301
|
+
animation: shimmer 1.5s infinite;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
@keyframes shimmer {
|
|
305
|
+
0% {
|
|
306
|
+
background-position: 200% 0;
|
|
307
|
+
}
|
|
308
|
+
100% {
|
|
309
|
+
background-position: -200% 0;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
</style>
|