@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,95 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* SMorphingModalTrigger - Trigger element for morphing modal
|
|
4
|
+
* Captures its position for the morphing animation
|
|
5
|
+
*/
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
defineOptions({ inheritAttrs: false })
|
|
10
|
+
|
|
11
|
+
import { ref, inject, onMounted, onBeforeUnmount, computed } from 'vue'
|
|
12
|
+
import { cn } from '../../../lib/utils'
|
|
13
|
+
import { SMorphingModalContextKey } from './SMorphingModal.vue'
|
|
14
|
+
|
|
15
|
+
export interface Props {
|
|
16
|
+
/** Disable trigger */
|
|
17
|
+
disabled?: boolean
|
|
18
|
+
/** Additional class */
|
|
19
|
+
triggerClass?: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
23
|
+
disabled: false,
|
|
24
|
+
triggerClass: ''
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const emit = defineEmits<{
|
|
28
|
+
'click': [event: MouseEvent]
|
|
29
|
+
}>()
|
|
30
|
+
|
|
31
|
+
const triggerRef = ref<HTMLElement | null>(null)
|
|
32
|
+
const context = inject(SMorphingModalContextKey)
|
|
33
|
+
|
|
34
|
+
// Trigger visibility follows isExpanded state
|
|
35
|
+
// When modal is expanded, trigger is invisible
|
|
36
|
+
// When modal is collapsing, trigger fades back in with the modal
|
|
37
|
+
const triggerOpacity = computed(() => context?.isExpanded.value ? 0 : 1)
|
|
38
|
+
|
|
39
|
+
const handleClick = (event: MouseEvent) => {
|
|
40
|
+
if (props.disabled) return
|
|
41
|
+
|
|
42
|
+
emit('click', event)
|
|
43
|
+
context?.open()
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const handleKeydown = (_event: KeyboardEvent) => {
|
|
47
|
+
if (props.disabled) return
|
|
48
|
+
|
|
49
|
+
context?.open()
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
onMounted(() => {
|
|
53
|
+
if (triggerRef.value) {
|
|
54
|
+
context?.registerTrigger(triggerRef.value)
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
onBeforeUnmount(() => {
|
|
59
|
+
context?.registerTrigger(null)
|
|
60
|
+
})
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<template>
|
|
64
|
+
<div
|
|
65
|
+
ref="triggerRef"
|
|
66
|
+
v-bind="$attrs"
|
|
67
|
+
:class="cn('s-morphing-modal-trigger cursor-pointer outline-none', disabled ? 'opacity-50 cursor-not-allowed' : '', triggerClass, $attrs.class ?? '')"
|
|
68
|
+
:style="{
|
|
69
|
+
opacity: triggerOpacity,
|
|
70
|
+
transitionProperty: 'opacity',
|
|
71
|
+
transitionDuration: '500ms',
|
|
72
|
+
transitionTimingFunction: 'cubic-bezier(0.32, 0.72, 0, 1)'
|
|
73
|
+
}"
|
|
74
|
+
role="button"
|
|
75
|
+
tabindex="0"
|
|
76
|
+
:aria-disabled="disabled"
|
|
77
|
+
@click="handleClick"
|
|
78
|
+
@keydown.enter="handleKeydown"
|
|
79
|
+
@keydown.space.prevent="handleKeydown"
|
|
80
|
+
>
|
|
81
|
+
<slot />
|
|
82
|
+
</div>
|
|
83
|
+
</template>
|
|
84
|
+
|
|
85
|
+
<style scoped>
|
|
86
|
+
.s-morphing-modal-trigger {
|
|
87
|
+
display: inline-block;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.s-morphing-modal-trigger:focus-visible {
|
|
91
|
+
outline: 2px solid var(--s-primary);
|
|
92
|
+
outline-offset: 2px;
|
|
93
|
+
border-radius: 8px;
|
|
94
|
+
}
|
|
95
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Modal Component Exports
|
|
2
|
+
export { default as SModal } from './SModal.vue'
|
|
3
|
+
export { default as SModalHeader } from './SModalHeader.vue'
|
|
4
|
+
export { default as SModalContent } from './SModalContent.vue'
|
|
5
|
+
export { default as SModalFooter } from './SModalFooter.vue'
|
|
6
|
+
export { default as SModalTrigger } from './SModalTrigger.vue'
|
|
7
|
+
export { default as SModalTitle } from './SModalTitle.vue'
|
|
8
|
+
export { default as SModalDescription } from './SModalDescription.vue'
|
|
9
|
+
export { default as SModalClose } from './SModalClose.vue'
|
|
10
|
+
|
|
11
|
+
// Morphing Modal Exports
|
|
12
|
+
export { default as SMorphingModal } from './SMorphingModal.vue'
|
|
13
|
+
export { default as SMorphingModalTrigger } from './SMorphingModalTrigger.vue'
|
|
14
|
+
export { default as SMorphingModalClose } from './SMorphingModalClose.vue'
|
|
15
|
+
export { default as SMorphingModalTitle } from './SMorphingModalTitle.vue'
|
|
16
|
+
export { default as SMorphingModalSubtitle } from './SMorphingModalSubtitle.vue'
|
|
17
|
+
export { default as SMorphingModalDescription } from './SMorphingModalDescription.vue'
|
|
18
|
+
export { default as SMorphingModalImage } from './SMorphingModalImage.vue'
|
|
19
|
+
|
|
20
|
+
// Type exports
|
|
21
|
+
export type {
|
|
22
|
+
ModalSize,
|
|
23
|
+
ModalVariant,
|
|
24
|
+
ModalAnimation,
|
|
25
|
+
ModalPosition,
|
|
26
|
+
SModalContext
|
|
27
|
+
} from './SModal.vue'
|
|
28
|
+
|
|
29
|
+
export { SModalContextKey } from './SModal.vue'
|
|
30
|
+
|
|
31
|
+
export type { SMorphingModalContext } from './SMorphingModal.vue'
|
|
32
|
+
export { SMorphingModalContextKey } from './SMorphingModal.vue'
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ inheritAttrs: false })
|
|
3
|
+
|
|
4
|
+
import { inject, computed, type CSSProperties } from 'vue'
|
|
5
|
+
import { cn } from '../../../lib/utils'
|
|
6
|
+
|
|
7
|
+
export interface Props {
|
|
8
|
+
value: any
|
|
9
|
+
label?: string
|
|
10
|
+
disabled?: boolean
|
|
11
|
+
icon?: string
|
|
12
|
+
description?: string
|
|
13
|
+
color?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
17
|
+
label: undefined,
|
|
18
|
+
disabled: false,
|
|
19
|
+
icon: undefined,
|
|
20
|
+
description: undefined,
|
|
21
|
+
color: undefined
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
// Inject from parent SSelect
|
|
25
|
+
const selectContext = inject<{
|
|
26
|
+
modelValue: any
|
|
27
|
+
multiple: boolean
|
|
28
|
+
highlightedIndex: number
|
|
29
|
+
optionIndex: number
|
|
30
|
+
registerOption: (option: { value: any; label: string; disabled: boolean }) => number
|
|
31
|
+
selectOption: (value: any) => void
|
|
32
|
+
isSelected: (value: any) => boolean
|
|
33
|
+
color: string
|
|
34
|
+
size: string
|
|
35
|
+
}>('s-select-context')
|
|
36
|
+
|
|
37
|
+
// Register this option and get its index
|
|
38
|
+
const displayLabel = computed(() => props.label ?? String(props.value))
|
|
39
|
+
|
|
40
|
+
const optionData = {
|
|
41
|
+
value: props.value,
|
|
42
|
+
label: displayLabel.value,
|
|
43
|
+
disabled: props.disabled
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const index = selectContext?.registerOption(optionData) ?? -1
|
|
47
|
+
|
|
48
|
+
const isSelected = computed(() => selectContext?.isSelected(props.value) ?? false)
|
|
49
|
+
const isHighlighted = computed(() => selectContext?.highlightedIndex === index)
|
|
50
|
+
|
|
51
|
+
const resolvedColor = computed(() => props.color ?? selectContext?.color)
|
|
52
|
+
const hasCustomColor = computed(() => !!resolvedColor.value)
|
|
53
|
+
|
|
54
|
+
const handleClick = () => {
|
|
55
|
+
if (props.disabled) return
|
|
56
|
+
selectContext?.selectOption(props.value)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Size configurations
|
|
60
|
+
const sizeConfig = computed(() => {
|
|
61
|
+
const sizes = {
|
|
62
|
+
small: {
|
|
63
|
+
padding: 'py-1.5 px-3',
|
|
64
|
+
text: 'text-xs',
|
|
65
|
+
icon: 'text-sm',
|
|
66
|
+
gap: 'gap-2'
|
|
67
|
+
},
|
|
68
|
+
medium: {
|
|
69
|
+
padding: 'py-2 px-3',
|
|
70
|
+
text: 'text-sm',
|
|
71
|
+
icon: 'text-base',
|
|
72
|
+
gap: 'gap-2.5'
|
|
73
|
+
},
|
|
74
|
+
large: {
|
|
75
|
+
padding: 'py-2.5 px-4',
|
|
76
|
+
text: 'text-base',
|
|
77
|
+
icon: 'text-lg',
|
|
78
|
+
gap: 'gap-3'
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return sizes[selectContext?.size as keyof typeof sizes] ?? sizes.medium
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
// Background style for selection/highlight
|
|
85
|
+
const bgStyle = computed<CSSProperties>(() => {
|
|
86
|
+
if (isSelected.value && hasCustomColor.value) {
|
|
87
|
+
return {
|
|
88
|
+
backgroundColor: `color-mix(in srgb, ${resolvedColor.value} 15%, transparent)`
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return {}
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
const bgClass = computed(() => {
|
|
95
|
+
if (isSelected.value && !hasCustomColor.value) {
|
|
96
|
+
return 'bg-primary/15'
|
|
97
|
+
}
|
|
98
|
+
if (!isSelected.value && (isHighlighted.value)) {
|
|
99
|
+
return 'bg-accent'
|
|
100
|
+
}
|
|
101
|
+
return ''
|
|
102
|
+
})
|
|
103
|
+
</script>
|
|
104
|
+
|
|
105
|
+
<template>
|
|
106
|
+
<div
|
|
107
|
+
v-bind="$attrs"
|
|
108
|
+
role="option"
|
|
109
|
+
:aria-selected="isSelected"
|
|
110
|
+
:aria-disabled="disabled"
|
|
111
|
+
:class="cn(
|
|
112
|
+
's-option relative flex items-center cursor-pointer transition-all duration-150 select-none',
|
|
113
|
+
sizeConfig.padding,
|
|
114
|
+
sizeConfig.gap,
|
|
115
|
+
{
|
|
116
|
+
'opacity-50 cursor-not-allowed': disabled,
|
|
117
|
+
'text-foreground': isHighlighted || isSelected,
|
|
118
|
+
'text-muted-foreground hover:text-foreground': !isHighlighted && !isSelected && !disabled
|
|
119
|
+
}
|
|
120
|
+
)"
|
|
121
|
+
@click="handleClick"
|
|
122
|
+
>
|
|
123
|
+
<!-- Highlight/Selection background -->
|
|
124
|
+
<div
|
|
125
|
+
v-if="isHighlighted || isSelected"
|
|
126
|
+
class="absolute inset-0 transition-all duration-150 rounded-lg mx-1"
|
|
127
|
+
:class="[
|
|
128
|
+
isSelected ? 'opacity-100' : 'opacity-60',
|
|
129
|
+
bgClass
|
|
130
|
+
]"
|
|
131
|
+
:style="bgStyle"
|
|
132
|
+
/>
|
|
133
|
+
|
|
134
|
+
<!-- Icon -->
|
|
135
|
+
<span
|
|
136
|
+
v-if="icon"
|
|
137
|
+
:class="cn('relative z-10 shrink-0 mdi', `mdi-${icon}`, sizeConfig.icon, isSelected && !hasCustomColor ? 'text-primary' : '')"
|
|
138
|
+
:style="isSelected && hasCustomColor ? { color: resolvedColor } : {}"
|
|
139
|
+
/>
|
|
140
|
+
|
|
141
|
+
<!-- Content -->
|
|
142
|
+
<div class="relative z-10 flex-1 min-w-0">
|
|
143
|
+
<div class="flex items-center gap-2">
|
|
144
|
+
<span :class="sizeConfig.text" class="truncate">
|
|
145
|
+
<slot>{{ displayLabel }}</slot>
|
|
146
|
+
</span>
|
|
147
|
+
<slot name="suffix" />
|
|
148
|
+
</div>
|
|
149
|
+
<p
|
|
150
|
+
v-if="description"
|
|
151
|
+
class="text-xs text-muted-foreground truncate mt-0.5"
|
|
152
|
+
>
|
|
153
|
+
{{ description }}
|
|
154
|
+
</p>
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<!-- Check mark for selected -->
|
|
158
|
+
<Transition
|
|
159
|
+
enter-active-class="transition-all duration-150 ease-out"
|
|
160
|
+
enter-from-class="scale-0 opacity-0"
|
|
161
|
+
enter-to-class="scale-100 opacity-100"
|
|
162
|
+
leave-active-class="transition-all duration-100 ease-in"
|
|
163
|
+
leave-from-class="scale-100 opacity-100"
|
|
164
|
+
leave-to-class="scale-0 opacity-0"
|
|
165
|
+
>
|
|
166
|
+
<span
|
|
167
|
+
v-if="isSelected"
|
|
168
|
+
class="relative z-10 mdi mdi-check shrink-0"
|
|
169
|
+
:class="[sizeConfig.icon, !hasCustomColor ? 'text-primary' : '']"
|
|
170
|
+
:style="hasCustomColor ? { color: resolvedColor } : {}"
|
|
171
|
+
/>
|
|
172
|
+
</Transition>
|
|
173
|
+
</div>
|
|
174
|
+
</template>
|
|
175
|
+
|
|
176
|
+
<style scoped>
|
|
177
|
+
.s-option:focus {
|
|
178
|
+
outline: none;
|
|
179
|
+
}
|
|
180
|
+
</style>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ inheritAttrs: false })
|
|
3
|
+
|
|
4
|
+
import { ref, provide, computed } from 'vue'
|
|
5
|
+
import { cn } from '../../../lib/utils'
|
|
6
|
+
|
|
7
|
+
export interface Props {
|
|
8
|
+
label: string
|
|
9
|
+
disabled?: boolean
|
|
10
|
+
collapsible?: boolean
|
|
11
|
+
defaultCollapsed?: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
15
|
+
disabled: false,
|
|
16
|
+
collapsible: false,
|
|
17
|
+
defaultCollapsed: false
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
const isCollapsed = ref(props.defaultCollapsed)
|
|
21
|
+
|
|
22
|
+
const toggle = () => {
|
|
23
|
+
if (props.collapsible) {
|
|
24
|
+
isCollapsed.value = !isCollapsed.value
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Provide disabled state to child options
|
|
29
|
+
provide('s-option-group-disabled', computed(() => props.disabled))
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<div v-bind="$attrs" :class="cn('s-option-group')">
|
|
34
|
+
<!-- Group Header -->
|
|
35
|
+
<div
|
|
36
|
+
:class="cn(
|
|
37
|
+
'flex items-center gap-2 px-3 py-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground',
|
|
38
|
+
{
|
|
39
|
+
'cursor-pointer hover:text-foreground': collapsible,
|
|
40
|
+
'opacity-50': disabled
|
|
41
|
+
}
|
|
42
|
+
)"
|
|
43
|
+
@click="toggle"
|
|
44
|
+
>
|
|
45
|
+
<slot name="label">
|
|
46
|
+
<span class="flex-1">{{ label }}</span>
|
|
47
|
+
</slot>
|
|
48
|
+
<span
|
|
49
|
+
v-if="collapsible"
|
|
50
|
+
class="mdi transition-transform duration-200"
|
|
51
|
+
:class="isCollapsed ? 'mdi-chevron-right' : 'mdi-chevron-down'"
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<!-- Group Content -->
|
|
56
|
+
<Transition
|
|
57
|
+
enter-active-class="transition-all duration-200 ease-out"
|
|
58
|
+
enter-from-class="opacity-0 max-h-0"
|
|
59
|
+
enter-to-class="opacity-100 max-h-96"
|
|
60
|
+
leave-active-class="transition-all duration-150 ease-in"
|
|
61
|
+
leave-from-class="opacity-100 max-h-96"
|
|
62
|
+
leave-to-class="opacity-0 max-h-0"
|
|
63
|
+
>
|
|
64
|
+
<div v-show="!isCollapsed" class="overflow-hidden">
|
|
65
|
+
<slot />
|
|
66
|
+
</div>
|
|
67
|
+
</Transition>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<style scoped>
|
|
72
|
+
.s-option-group + .s-option-group {
|
|
73
|
+
border-top: 1px solid var(--s-border);
|
|
74
|
+
margin-top: 0.25rem;
|
|
75
|
+
padding-top: 0.25rem;
|
|
76
|
+
}
|
|
77
|
+
</style>
|