@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,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ inheritAttrs: false })
|
|
3
|
+
|
|
4
|
+
import { cn } from '../../../lib/utils'
|
|
5
|
+
|
|
6
|
+
export interface Props {
|
|
7
|
+
/** Custom margin */
|
|
8
|
+
margin?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
withDefaults(defineProps<Props>(), {
|
|
12
|
+
margin: '4px'
|
|
13
|
+
})
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<div
|
|
18
|
+
:class="cn('s-dropdown-divider h-px bg-border/60', $attrs.class ?? '')"
|
|
19
|
+
role="separator"
|
|
20
|
+
:style="{ marginTop: margin, marginBottom: margin }"
|
|
21
|
+
v-bind="$attrs"
|
|
22
|
+
/>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ inheritAttrs: false })
|
|
3
|
+
|
|
4
|
+
import { inject, computed } from 'vue'
|
|
5
|
+
import { cn } from '../../../lib/utils'
|
|
6
|
+
import { SDropdownContextKey, type SDropdownContext } from './SDropdown.vue'
|
|
7
|
+
|
|
8
|
+
export interface Props {
|
|
9
|
+
/** Group header label */
|
|
10
|
+
label: string
|
|
11
|
+
/** Icon for the header */
|
|
12
|
+
icon?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
16
|
+
icon: undefined
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
// Inject context from parent dropdown
|
|
20
|
+
const context = inject<SDropdownContext>(SDropdownContextKey)
|
|
21
|
+
|
|
22
|
+
const sizeConfig = computed(() => ({
|
|
23
|
+
small: 'px-2 pt-1.5 pb-0.5 text-[10px]',
|
|
24
|
+
medium: 'px-2.5 pt-2 pb-1 text-[11px]',
|
|
25
|
+
large: 'px-3 pt-2.5 pb-1 text-xs'
|
|
26
|
+
}[context?.size ?? 'medium']))
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<div :class="cn('s-dropdown-group', $attrs.class ?? '')" v-bind="$attrs">
|
|
31
|
+
<!-- Group header -->
|
|
32
|
+
<div
|
|
33
|
+
class="font-semibold uppercase tracking-wider text-muted-foreground flex items-center gap-2 sticky top-0 bg-background/95 backdrop-blur-sm"
|
|
34
|
+
:class="sizeConfig"
|
|
35
|
+
>
|
|
36
|
+
<span v-if="icon" :class="['mdi', `mdi-${icon}`, 'text-xs']" />
|
|
37
|
+
<span>{{ label }}</span>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<!-- Group items -->
|
|
41
|
+
<div class="s-dropdown-group-content">
|
|
42
|
+
<slot />
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<style scoped>
|
|
48
|
+
.s-dropdown-group + .s-dropdown-group {
|
|
49
|
+
margin-top: 4px;
|
|
50
|
+
padding-top: 4px;
|
|
51
|
+
border-top: 1px solid var(--s-border);
|
|
52
|
+
}
|
|
53
|
+
</style>
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineOptions({ inheritAttrs: false })
|
|
3
|
+
|
|
4
|
+
import { inject, computed, onMounted, onBeforeUnmount } from 'vue'
|
|
5
|
+
import { cn } from '../../../lib/utils'
|
|
6
|
+
import { SDropdownContextKey, type SDropdownContext } from './SDropdown.vue'
|
|
7
|
+
|
|
8
|
+
export interface Props {
|
|
9
|
+
/** Unique key for the item */
|
|
10
|
+
itemKey: string
|
|
11
|
+
/** Item label text */
|
|
12
|
+
label?: string
|
|
13
|
+
/** Leading icon (MDI icon name) */
|
|
14
|
+
icon?: string
|
|
15
|
+
/** Trailing icon */
|
|
16
|
+
trailingIcon?: string
|
|
17
|
+
/** Description text below label */
|
|
18
|
+
description?: string
|
|
19
|
+
/** Keyboard shortcut display */
|
|
20
|
+
shortcut?: string
|
|
21
|
+
/** Disable the item */
|
|
22
|
+
disabled?: boolean
|
|
23
|
+
/** Danger/destructive styling */
|
|
24
|
+
danger?: boolean
|
|
25
|
+
/** Checkable state (undefined = not checkable) */
|
|
26
|
+
checked?: boolean
|
|
27
|
+
/** Custom color for this item */
|
|
28
|
+
color?: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
32
|
+
label: undefined,
|
|
33
|
+
icon: undefined,
|
|
34
|
+
trailingIcon: undefined,
|
|
35
|
+
description: undefined,
|
|
36
|
+
shortcut: undefined,
|
|
37
|
+
disabled: false,
|
|
38
|
+
danger: false,
|
|
39
|
+
checked: undefined,
|
|
40
|
+
color: undefined
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
const emit = defineEmits<{
|
|
44
|
+
'click': [event: MouseEvent]
|
|
45
|
+
'update:checked': [checked: boolean]
|
|
46
|
+
}>()
|
|
47
|
+
|
|
48
|
+
// Inject context from parent dropdown
|
|
49
|
+
const context = inject<SDropdownContext>(SDropdownContextKey)
|
|
50
|
+
|
|
51
|
+
// Register with parent
|
|
52
|
+
let itemIndex = -1
|
|
53
|
+
|
|
54
|
+
onMounted(() => {
|
|
55
|
+
if (context) {
|
|
56
|
+
itemIndex = context.registerItem({
|
|
57
|
+
key: props.itemKey,
|
|
58
|
+
disabled: props.disabled
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
onBeforeUnmount(() => {
|
|
64
|
+
if (context) {
|
|
65
|
+
context.unregisterItem(props.itemKey)
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
// Size configurations - reduced padding for tighter, cleaner look
|
|
70
|
+
const sizeConfig = computed(() => ({
|
|
71
|
+
small: {
|
|
72
|
+
item: 'px-2 py-1 text-xs',
|
|
73
|
+
icon: 'text-sm'
|
|
74
|
+
},
|
|
75
|
+
medium: {
|
|
76
|
+
item: 'px-2.5 py-1.5 text-sm',
|
|
77
|
+
icon: 'text-base'
|
|
78
|
+
},
|
|
79
|
+
large: {
|
|
80
|
+
item: 'px-3 py-2 text-base',
|
|
81
|
+
icon: 'text-lg'
|
|
82
|
+
}
|
|
83
|
+
}[context?.size ?? 'medium']))
|
|
84
|
+
|
|
85
|
+
const accentColor = computed(() => props.color ?? context?.color ?? 'var(--s-primary)')
|
|
86
|
+
|
|
87
|
+
const isHighlighted = computed(() => {
|
|
88
|
+
if (!context) return false
|
|
89
|
+
return context.highlightedIndex.value === itemIndex
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
const handleClick = (event: MouseEvent) => {
|
|
93
|
+
if (props.disabled) return
|
|
94
|
+
|
|
95
|
+
emit('click', event)
|
|
96
|
+
|
|
97
|
+
if (props.checked !== undefined) {
|
|
98
|
+
emit('update:checked', !props.checked)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (context) {
|
|
102
|
+
context.selectItem(props.itemKey)
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
</script>
|
|
106
|
+
|
|
107
|
+
<template>
|
|
108
|
+
<div
|
|
109
|
+
role="menuitem"
|
|
110
|
+
:tabindex="disabled ? -1 : 0"
|
|
111
|
+
:class="cn('s-dropdown-item relative flex items-center cursor-pointer transition-all duration-150 select-none rounded-lg group', sizeConfig.item, {
|
|
112
|
+
'opacity-50 cursor-not-allowed': disabled,
|
|
113
|
+
'text-red-500 hover:bg-red-500/10': danger && !disabled,
|
|
114
|
+
'text-foreground hover:bg-accent': !danger && !disabled,
|
|
115
|
+
'bg-accent': isHighlighted && !disabled
|
|
116
|
+
}, $attrs.class ?? '')"
|
|
117
|
+
v-bind="$attrs"
|
|
118
|
+
@click="handleClick"
|
|
119
|
+
>
|
|
120
|
+
<!-- Checkbox for checkable items -->
|
|
121
|
+
<span
|
|
122
|
+
v-if="checked !== undefined"
|
|
123
|
+
class="mdi mr-2.5 transition-all duration-150"
|
|
124
|
+
:class="[
|
|
125
|
+
checked ? 'mdi-checkbox-marked' : 'mdi-checkbox-blank-outline',
|
|
126
|
+
sizeConfig.icon,
|
|
127
|
+
checked ? '' : 'text-muted-foreground'
|
|
128
|
+
]"
|
|
129
|
+
:style="checked ? { color: accentColor } : {}"
|
|
130
|
+
/>
|
|
131
|
+
|
|
132
|
+
<!-- Leading icon -->
|
|
133
|
+
<span
|
|
134
|
+
v-else-if="icon"
|
|
135
|
+
:class="['mdi', `mdi-${icon}`, sizeConfig.icon, 'mr-2.5', danger ? '' : 'text-muted-foreground group-hover:text-foreground']"
|
|
136
|
+
/>
|
|
137
|
+
|
|
138
|
+
<!-- Content -->
|
|
139
|
+
<div class="flex-1 min-w-0">
|
|
140
|
+
<slot>
|
|
141
|
+
<div class="truncate">{{ label }}</div>
|
|
142
|
+
</slot>
|
|
143
|
+
<div
|
|
144
|
+
v-if="description"
|
|
145
|
+
class="text-xs truncate mt-0.5"
|
|
146
|
+
:class="danger ? 'text-red-400' : 'text-muted-foreground'"
|
|
147
|
+
>
|
|
148
|
+
{{ description }}
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
|
|
152
|
+
<!-- Trailing content -->
|
|
153
|
+
<div class="flex items-center gap-2 ml-4 shrink-0">
|
|
154
|
+
<!-- Keyboard shortcut -->
|
|
155
|
+
<kbd
|
|
156
|
+
v-if="shortcut"
|
|
157
|
+
class="px-1.5 py-0.5 text-[10px] font-mono rounded bg-background text-muted-foreground border border-border"
|
|
158
|
+
>
|
|
159
|
+
{{ shortcut }}
|
|
160
|
+
</kbd>
|
|
161
|
+
|
|
162
|
+
<!-- Trailing icon -->
|
|
163
|
+
<span
|
|
164
|
+
v-if="trailingIcon"
|
|
165
|
+
:class="['mdi', `mdi-${trailingIcon}`, sizeConfig.icon, 'text-muted-foreground']"
|
|
166
|
+
/>
|
|
167
|
+
|
|
168
|
+
<!-- Custom trailing slot -->
|
|
169
|
+
<slot name="trailing" />
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
</template>
|
|
173
|
+
|
|
174
|
+
<style scoped>
|
|
175
|
+
.s-dropdown-item:focus-visible {
|
|
176
|
+
outline: none;
|
|
177
|
+
background-color: var(--s-accent);
|
|
178
|
+
}
|
|
179
|
+
</style>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Re-export components for convenience
|
|
2
|
+
export { default as SDropdown } from './SDropdown.vue'
|
|
3
|
+
export { default as SDropdownDivider } from './SDropdownDivider.vue'
|
|
4
|
+
export { default as SDropdownGroup } from './SDropdownGroup.vue'
|
|
5
|
+
export { default as SDropdownItem } from './SDropdownItem.vue'
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { provide, computed } from 'vue'
|
|
3
|
+
import type { FormState } from '../../../composables/useForm'
|
|
4
|
+
import { FORM_CONTEXT_KEY } from './index'
|
|
5
|
+
import { cn } from '../../../lib/utils'
|
|
6
|
+
|
|
7
|
+
defineOptions({ inheritAttrs: false })
|
|
8
|
+
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
+
export interface Props {
|
|
11
|
+
/** Form state from useForm */
|
|
12
|
+
form: FormState<any>
|
|
13
|
+
/** Whether the form is disabled */
|
|
14
|
+
disabled?: boolean
|
|
15
|
+
/** Gap between form fields */
|
|
16
|
+
gap?: 'none' | 'sm' | 'md' | 'lg'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
20
|
+
disabled: false,
|
|
21
|
+
gap: 'md'
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const emit = defineEmits<{
|
|
25
|
+
/** Emitted when the form is submitted and validation passes */
|
|
26
|
+
submit: [values: Record<string, unknown>]
|
|
27
|
+
}>()
|
|
28
|
+
|
|
29
|
+
// Provide form context to child FormFields
|
|
30
|
+
provide(FORM_CONTEXT_KEY, props.form)
|
|
31
|
+
|
|
32
|
+
// Handle native form submission
|
|
33
|
+
const handleSubmit = async (event: Event) => {
|
|
34
|
+
event.preventDefault()
|
|
35
|
+
|
|
36
|
+
if (props.disabled || props.form.isSubmitting?.value) {
|
|
37
|
+
return
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const isValid = await props.form.validate()
|
|
41
|
+
if (isValid) {
|
|
42
|
+
emit('submit', props.form.getValues())
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Gap class mapping
|
|
47
|
+
const gapClass = computed(() => {
|
|
48
|
+
const gaps = {
|
|
49
|
+
none: 'gap-0',
|
|
50
|
+
sm: 'gap-2',
|
|
51
|
+
md: 'gap-3',
|
|
52
|
+
lg: 'gap-4'
|
|
53
|
+
}
|
|
54
|
+
return gaps[props.gap]
|
|
55
|
+
})
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<template>
|
|
59
|
+
<form
|
|
60
|
+
v-bind="$attrs"
|
|
61
|
+
:class="cn('s-form', gapClass, { 's-form--disabled': disabled })"
|
|
62
|
+
@submit="handleSubmit"
|
|
63
|
+
>
|
|
64
|
+
<slot
|
|
65
|
+
:is-submitting="form.isSubmitting?.value ?? false"
|
|
66
|
+
:is-valid="form.valid.value"
|
|
67
|
+
:is-dirty="form.dirty.value"
|
|
68
|
+
:errors="form.errors.value"
|
|
69
|
+
/>
|
|
70
|
+
</form>
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
<style scoped>
|
|
74
|
+
.s-form {
|
|
75
|
+
width: 100%;
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.s-form--disabled {
|
|
81
|
+
opacity: 0.6;
|
|
82
|
+
pointer-events: none;
|
|
83
|
+
}
|
|
84
|
+
</style>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { inject, computed, provide, type InjectionKey } from 'vue'
|
|
3
|
+
import type { FormState, FieldState } from '../../../composables/useForm'
|
|
4
|
+
import { FORM_CONTEXT_KEY } from './index'
|
|
5
|
+
import { cn } from '../../../lib/utils'
|
|
6
|
+
|
|
7
|
+
defineOptions({ inheritAttrs: false })
|
|
8
|
+
|
|
9
|
+
export interface Props {
|
|
10
|
+
/** Field name matching the key in useFormValidation config */
|
|
11
|
+
name: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const props = defineProps<Props>()
|
|
15
|
+
|
|
16
|
+
// Get form context from parent SForm
|
|
17
|
+
const form = inject<FormState | null>(FORM_CONTEXT_KEY, null)
|
|
18
|
+
|
|
19
|
+
if (!form) {
|
|
20
|
+
console.warn('[SFormField] Must be used inside SForm component')
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Get field state
|
|
24
|
+
const field = computed<FieldState | null>(() => {
|
|
25
|
+
if (!form) return null
|
|
26
|
+
return form.fields[props.name] || null
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
// Display error from field
|
|
30
|
+
const displayError = computed(() => field.value?.error.value || '')
|
|
31
|
+
|
|
32
|
+
// Validation state for styling
|
|
33
|
+
const validationState = computed<'error' | 'success' | null>(() => {
|
|
34
|
+
if (!field.value) return null
|
|
35
|
+
if (field.value.error.value) return 'error'
|
|
36
|
+
if (field.value.valid.value && field.value.dirty.value) return 'success'
|
|
37
|
+
return null
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
// Handle blur event for validation
|
|
41
|
+
const handleBlur = () => {
|
|
42
|
+
if (field.value) {
|
|
43
|
+
field.value.touched.value = true
|
|
44
|
+
field.value.validate()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Handle input event for validation
|
|
49
|
+
const handleInput = () => {
|
|
50
|
+
// Validation happens automatically via watchers in useFormValidation
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Provide field context to child components (for advanced use cases)
|
|
54
|
+
const FIELD_CONTEXT_KEY: InjectionKey<FieldState | null> = Symbol('field-context')
|
|
55
|
+
provide(FIELD_CONTEXT_KEY, field.value)
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<template>
|
|
59
|
+
<div v-bind="$attrs" :class="cn('s-form-field')">
|
|
60
|
+
<!-- Slot for the actual input/component -->
|
|
61
|
+
<slot
|
|
62
|
+
:field="field"
|
|
63
|
+
:value="field?.value.value"
|
|
64
|
+
:error="displayError || undefined"
|
|
65
|
+
:validation-state="validationState"
|
|
66
|
+
:model-value="field?.value.value"
|
|
67
|
+
:on-update="(val: unknown) => { if (field) field.value.value = val }"
|
|
68
|
+
:on-blur="handleBlur"
|
|
69
|
+
:on-input="handleInput"
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
73
|
+
|
|
74
|
+
<style scoped>
|
|
75
|
+
.s-form-field {
|
|
76
|
+
@apply w-full;
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { InjectionKey } from 'vue'
|
|
2
|
+
import type { FormState } from '../../../composables/useForm'
|
|
3
|
+
|
|
4
|
+
export const FORM_CONTEXT_KEY: InjectionKey<FormState> = Symbol('form-context')
|
|
5
|
+
|
|
6
|
+
// Re-export components for convenience
|
|
7
|
+
export { default as SForm } from './SForm.vue'
|
|
8
|
+
export { default as SFormField } from './SFormField.vue'
|