@geniusdynamics/ns8-ui-lib 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +167 -0
- package/dist/index.d.ts +14 -0
- package/dist/ns8-ui-lib.es.js +4278 -0
- package/dist/ns8-ui-lib.es.js.map +1 -0
- package/dist/ns8-ui-lib.umd.js +7 -0
- package/dist/ns8-ui-lib.umd.js.map +1 -0
- package/dist/src/App.vue.d.ts +2 -0
- package/dist/src/components/HelloWorld.vue.d.ts +5 -0
- package/dist/src/components/NS/cards/NSBackupCard.vue.d.ts +51 -0
- package/dist/src/components/NS/cards/NSSystemInfoCard.vue.d.ts +58 -0
- package/dist/src/components/NS/cards/NSSystemdServiceCard.vue.d.ts +47 -0
- package/dist/src/components/NS/cards/index.d.ts +3 -0
- package/dist/src/components/NS/checkbox/NSCheckbox.vue.d.ts +37 -0
- package/dist/src/components/NS/checkbox/index.d.ts +1 -0
- package/dist/src/components/NS/data-table/NSDataTable.vue.d.ts +98 -0
- package/dist/src/components/NS/data-table/index.d.ts +1 -0
- package/dist/src/components/NS/empty-state/NSEmptyState.vue.d.ts +45 -0
- package/dist/src/components/NS/empty-state/index.d.ts +1 -0
- package/dist/src/components/NS/index.d.ts +35 -0
- package/dist/src/components/NS/inline-notification/NSInlineNotification.vue.d.ts +44 -0
- package/dist/src/components/NS/inline-notification/index.d.ts +1 -0
- package/dist/src/components/NS/lottie-animation/NSLottieAnimation.vue.d.ts +75 -0
- package/dist/src/components/NS/lottie-animation/index.d.ts +1 -0
- package/dist/src/components/NS/modal/NSModal.vue.d.ts +56 -0
- package/dist/src/components/NS/modal/NSModalTrigger.vue.d.ts +64 -0
- package/dist/src/components/NS/modal/index.d.ts +2 -0
- package/dist/src/components/NS/pagination/NSPagination.vue.d.ts +36 -0
- package/dist/src/components/NS/pagination/index.d.ts +1 -0
- package/dist/src/components/NS/progress/NSProgress.vue.d.ts +37 -0
- package/dist/src/components/NS/progress/NSProgressBar.vue.d.ts +39 -0
- package/dist/src/components/NS/progress/index.d.ts +2 -0
- package/dist/src/components/NS/slider/NSByteSlider.vue.d.ts +50 -0
- package/dist/src/components/NS/slider/NSSlider.vue.d.ts +49 -0
- package/dist/src/components/NS/slider/index.d.ts +2 -0
- package/dist/src/components/NS/tag/NSTag.vue.d.ts +41 -0
- package/dist/src/components/NS/tag/index.d.ts +1 -0
- package/dist/src/components/NS/text-input/NSTextInput.vue.d.ts +67 -0
- package/dist/src/components/NS/text-input/index.d.ts +1 -0
- package/dist/src/components/NS/toast-notification/NSToastNotification.vue.d.ts +44 -0
- package/dist/src/components/NS/toast-notification/index.d.ts +1 -0
- package/dist/src/components/NS/toggle/NSToggle.vue.d.ts +51 -0
- package/dist/src/components/NS/toggle/index.d.ts +1 -0
- package/dist/src/components/NS/wizard/NSWizard.vue.d.ts +86 -0
- package/dist/src/components/NS/wizard/index.d.ts +1 -0
- package/dist/src/components/ui/button/Button.vue.d.ts +27 -0
- package/dist/src/components/ui/button/index.d.ts +7 -0
- package/dist/src/components/ui/card/Card.vue.d.ts +21 -0
- package/dist/src/components/ui/card/CardAction.vue.d.ts +21 -0
- package/dist/src/components/ui/card/CardContent.vue.d.ts +21 -0
- package/dist/src/components/ui/card/CardDescription.vue.d.ts +21 -0
- package/dist/src/components/ui/card/CardFooter.vue.d.ts +21 -0
- package/dist/src/components/ui/card/CardHeader.vue.d.ts +21 -0
- package/dist/src/components/ui/card/CardTitle.vue.d.ts +21 -0
- package/dist/src/components/ui/card/index.d.ts +7 -0
- package/dist/src/components/ui/checkbox/NsCheckbox.vue.d.ts +49 -0
- package/dist/src/components/ui/checkbox/index.d.ts +11 -0
- package/dist/src/components/ui/dialog/Dialog.vue.d.ts +28 -0
- package/dist/src/components/ui/dialog/index.d.ts +1 -0
- package/dist/src/components/ui/empty-state/NsEmptyState.vue.d.ts +45 -0
- package/dist/src/components/ui/empty-state/index.d.ts +11 -0
- package/dist/src/components/ui/inline-notification/NsInlineNotification.vue.d.ts +45 -0
- package/dist/src/components/ui/inline-notification/index.d.ts +6 -0
- package/dist/src/components/ui/input/Input.vue.d.ts +12 -0
- package/dist/src/components/ui/input/index.d.ts +1 -0
- package/dist/src/components/ui/input-group/InputGroup.vue.d.ts +21 -0
- package/dist/src/components/ui/input-group/InputGroupAddon.vue.d.ts +25 -0
- package/dist/src/components/ui/input-group/InputGroupButton.vue.d.ts +22 -0
- package/dist/src/components/ui/input-group/InputGroupInput.vue.d.ts +6 -0
- package/dist/src/components/ui/input-group/InputGroupText.vue.d.ts +21 -0
- package/dist/src/components/ui/input-group/InputGroupTextarea.vue.d.ts +6 -0
- package/dist/src/components/ui/input-group/index.d.ts +22 -0
- package/dist/src/components/ui/item/Item.vue.d.ts +27 -0
- package/dist/src/components/ui/item/ItemActions.vue.d.ts +21 -0
- package/dist/src/components/ui/item/ItemContent.vue.d.ts +21 -0
- package/dist/src/components/ui/item/ItemDescription.vue.d.ts +21 -0
- package/dist/src/components/ui/item/ItemFooter.vue.d.ts +21 -0
- package/dist/src/components/ui/item/ItemGroup.vue.d.ts +21 -0
- package/dist/src/components/ui/item/ItemHeader.vue.d.ts +21 -0
- package/dist/src/components/ui/item/ItemMedia.vue.d.ts +23 -0
- package/dist/src/components/ui/item/ItemSeparator.vue.d.ts +7 -0
- package/dist/src/components/ui/item/ItemTitle.vue.d.ts +21 -0
- package/dist/src/components/ui/item/index.d.ts +20 -0
- package/dist/src/components/ui/label/Label.vue.d.ts +22 -0
- package/dist/src/components/ui/label/index.d.ts +1 -0
- package/dist/src/components/ui/scroll-area/ScrollArea.vue.d.ts +22 -0
- package/dist/src/components/ui/scroll-area/ScrollBar.vue.d.ts +9 -0
- package/dist/src/components/ui/scroll-area/index.d.ts +2 -0
- package/dist/src/components/ui/select/Select.vue.d.ts +28 -0
- package/dist/src/components/ui/select/SelectContent.vue.d.ts +32 -0
- package/dist/src/components/ui/select/SelectGroup.vue.d.ts +18 -0
- package/dist/src/components/ui/select/SelectItem.vue.d.ts +23 -0
- package/dist/src/components/ui/select/SelectItemText.vue.d.ts +18 -0
- package/dist/src/components/ui/select/SelectLabel.vue.d.ts +22 -0
- package/dist/src/components/ui/select/SelectScrollDownButton.vue.d.ts +22 -0
- package/dist/src/components/ui/select/SelectScrollUpButton.vue.d.ts +22 -0
- package/dist/src/components/ui/select/SelectSeparator.vue.d.ts +7 -0
- package/dist/src/components/ui/select/SelectTrigger.vue.d.ts +25 -0
- package/dist/src/components/ui/select/SelectValue.vue.d.ts +18 -0
- package/dist/src/components/ui/select/index.d.ts +11 -0
- package/dist/src/components/ui/separator/Separator.vue.d.ts +10 -0
- package/dist/src/components/ui/separator/index.d.ts +1 -0
- package/dist/src/components/ui/sheet/Sheet.vue.d.ts +25 -0
- package/dist/src/components/ui/sheet/SheetClose.vue.d.ts +18 -0
- package/dist/src/components/ui/sheet/SheetContent.vue.d.ts +39 -0
- package/dist/src/components/ui/sheet/SheetDescription.vue.d.ts +22 -0
- package/dist/src/components/ui/sheet/SheetFooter.vue.d.ts +21 -0
- package/dist/src/components/ui/sheet/SheetHeader.vue.d.ts +21 -0
- package/dist/src/components/ui/sheet/SheetOverlay.vue.d.ts +22 -0
- package/dist/src/components/ui/sheet/SheetTitle.vue.d.ts +22 -0
- package/dist/src/components/ui/sheet/SheetTrigger.vue.d.ts +18 -0
- package/dist/src/components/ui/sheet/index.d.ts +8 -0
- package/dist/src/components/ui/sidebar/Sidebar.vue.d.ts +24 -0
- package/dist/src/components/ui/sidebar/SidebarContent.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarFooter.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarGroup.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarGroupAction.vue.d.ts +22 -0
- package/dist/src/components/ui/sidebar/SidebarGroupContent.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarGroupLabel.vue.d.ts +22 -0
- package/dist/src/components/ui/sidebar/SidebarHeader.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarInput.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarInset.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarMenu.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarMenuAction.vue.d.ts +25 -0
- package/dist/src/components/ui/sidebar/SidebarMenuBadge.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarMenuButton.vue.d.ts +27 -0
- package/dist/src/components/ui/sidebar/SidebarMenuButtonChild.vue.d.ts +30 -0
- package/dist/src/components/ui/sidebar/SidebarMenuItem.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarMenuSkeleton.vue.d.ts +7 -0
- package/dist/src/components/ui/sidebar/SidebarMenuSub.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarMenuSubButton.vue.d.ts +27 -0
- package/dist/src/components/ui/sidebar/SidebarMenuSubItem.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarProvider.vue.d.ts +30 -0
- package/dist/src/components/ui/sidebar/SidebarRail.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarSeparator.vue.d.ts +21 -0
- package/dist/src/components/ui/sidebar/SidebarTrigger.vue.d.ts +6 -0
- package/dist/src/components/ui/sidebar/index.d.ts +37 -0
- package/dist/src/components/ui/sidebar/utils.d.ts +56 -0
- package/dist/src/components/ui/skeleton/Skeleton.vue.d.ts +6 -0
- package/dist/src/components/ui/skeleton/index.d.ts +1 -0
- package/dist/src/components/ui/sonner/Sonner.vue.d.ts +3 -0
- package/dist/src/components/ui/sonner/index.d.ts +1 -0
- package/dist/src/components/ui/switch/Switch.vue.d.ts +28 -0
- package/dist/src/components/ui/switch/index.d.ts +1 -0
- package/dist/src/components/ui/table/Table.vue.d.ts +21 -0
- package/dist/src/components/ui/table/TableBody.vue.d.ts +21 -0
- package/dist/src/components/ui/table/TableCaption.vue.d.ts +21 -0
- package/dist/src/components/ui/table/TableCell.vue.d.ts +21 -0
- package/dist/src/components/ui/table/TableEmpty.vue.d.ts +24 -0
- package/dist/src/components/ui/table/TableFooter.vue.d.ts +21 -0
- package/dist/src/components/ui/table/TableHead.vue.d.ts +21 -0
- package/dist/src/components/ui/table/TableHeader.vue.d.ts +21 -0
- package/dist/src/components/ui/table/TableRow.vue.d.ts +21 -0
- package/dist/src/components/ui/table/index.d.ts +9 -0
- package/dist/src/components/ui/table/utils.d.ts +3 -0
- package/dist/src/components/ui/tabs/Tabs.vue.d.ts +28 -0
- package/dist/src/components/ui/tabs/TabsContent.vue.d.ts +22 -0
- package/dist/src/components/ui/tabs/TabsList.vue.d.ts +22 -0
- package/dist/src/components/ui/tabs/TabsTrigger.vue.d.ts +22 -0
- package/dist/src/components/ui/tabs/index.d.ts +4 -0
- package/dist/src/components/ui/tag/NsTag.vue.d.ts +42 -0
- package/dist/src/components/ui/tag/index.d.ts +8 -0
- package/dist/src/components/ui/text-input/NsTextInput.vue.d.ts +79 -0
- package/dist/src/components/ui/text-input/index.d.ts +15 -0
- package/dist/src/components/ui/textarea/Textarea.vue.d.ts +12 -0
- package/dist/src/components/ui/textarea/index.d.ts +1 -0
- package/dist/src/components/ui/toggle/NsToggle.vue.d.ts +54 -0
- package/dist/src/components/ui/toggle/index.d.ts +15 -0
- package/dist/src/components/ui/tooltip/Tooltip.vue.d.ts +24 -0
- package/dist/src/components/ui/tooltip/TooltipContent.vue.d.ts +30 -0
- package/dist/src/components/ui/tooltip/TooltipProvider.vue.d.ts +20 -0
- package/dist/src/components/ui/tooltip/TooltipTrigger.vue.d.ts +18 -0
- package/dist/src/components/ui/tooltip/index.d.ts +4 -0
- package/dist/src/composables/index.d.ts +8 -0
- package/dist/src/composables/useDateTimeService.d.ts +10 -0
- package/dist/src/composables/useFilterService.d.ts +8 -0
- package/dist/src/composables/useIconService.d.ts +153 -0
- package/dist/src/composables/usePageTitleService.d.ts +3 -0
- package/dist/src/composables/useQueryParamService.d.ts +13 -0
- package/dist/src/composables/useStorageService.d.ts +5 -0
- package/dist/src/composables/useTaskService.d.ts +18 -0
- package/dist/src/composables/useUtilService.d.ts +27 -0
- package/dist/src/lib/utils.d.ts +2 -0
- package/dist/src/main.d.ts +0 -0
- package/dist/vite.svg +1 -0
- package/package.json +80 -0
- package/src/App.vue +30 -0
- package/src/components/HelloWorld.vue +41 -0
- package/src/components/NS/CompleteDemo.vue +475 -0
- package/src/components/NS/Demo.vue +191 -0
- package/src/components/NS/cards/NSBackupCard.vue +272 -0
- package/src/components/NS/cards/NSSystemInfoCard.vue +252 -0
- package/src/components/NS/cards/NSSystemdServiceCard.vue +250 -0
- package/src/components/NS/checkbox/NSCheckbox.vue +104 -0
- package/src/components/NS/data-table/NSDataTable.vue +434 -0
- package/src/components/NS/empty-state/NSEmptyState.vue +188 -0
- package/src/components/NS/inline-notification/NSInlineNotification.vue +162 -0
- package/src/components/NS/lottie-animation/NSLottieAnimation.vue +255 -0
- package/src/components/NS/modal/NSModal.vue +193 -0
- package/src/components/NS/modal/NSModalTrigger.vue +109 -0
- package/src/components/NS/pagination/NSPagination.vue +247 -0
- package/src/components/NS/progress/NSProgress.vue +115 -0
- package/src/components/NS/progress/NSProgressBar.vue +137 -0
- package/src/components/NS/slider/NSByteSlider.vue +144 -0
- package/src/components/NS/slider/NSSlider.vue +142 -0
- package/src/components/NS/tag/NSTag.vue +139 -0
- package/src/components/NS/text-input/NSTextInput.vue +242 -0
- package/src/components/NS/toast-notification/NSToastNotification.vue +163 -0
- package/src/components/NS/toggle/NSToggle.vue +156 -0
- package/src/components/NS/wizard/NSWizard.vue +399 -0
- package/src/components/ui/button/Button.vue +29 -0
- package/src/components/ui/card/Card.vue +22 -0
- package/src/components/ui/card/CardAction.vue +17 -0
- package/src/components/ui/card/CardContent.vue +17 -0
- package/src/components/ui/card/CardDescription.vue +17 -0
- package/src/components/ui/card/CardFooter.vue +17 -0
- package/src/components/ui/card/CardHeader.vue +17 -0
- package/src/components/ui/card/CardTitle.vue +17 -0
- package/src/components/ui/checkbox/NsCheckbox.vue +123 -0
- package/src/components/ui/dialog/Dialog.vue +68 -0
- package/src/components/ui/empty-state/NsEmptyState.vue +149 -0
- package/src/components/ui/inline-notification/NsInlineNotification.vue +163 -0
- package/src/components/ui/input/Input.vue +33 -0
- package/src/components/ui/input-group/InputGroup.vue +35 -0
- package/src/components/ui/input-group/InputGroupAddon.vue +36 -0
- package/src/components/ui/input-group/InputGroupButton.vue +21 -0
- package/src/components/ui/input-group/InputGroupInput.vue +19 -0
- package/src/components/ui/input-group/InputGroupText.vue +19 -0
- package/src/components/ui/input-group/InputGroupTextarea.vue +19 -0
- package/src/components/ui/item/Item.vue +27 -0
- package/src/components/ui/item/ItemActions.vue +17 -0
- package/src/components/ui/item/ItemContent.vue +17 -0
- package/src/components/ui/item/ItemDescription.vue +21 -0
- package/src/components/ui/item/ItemFooter.vue +17 -0
- package/src/components/ui/item/ItemGroup.vue +18 -0
- package/src/components/ui/item/ItemHeader.vue +17 -0
- package/src/components/ui/item/ItemMedia.vue +21 -0
- package/src/components/ui/item/ItemSeparator.vue +18 -0
- package/src/components/ui/item/ItemTitle.vue +17 -0
- package/src/components/ui/label/Label.vue +26 -0
- package/src/components/ui/scroll-area/ScrollArea.vue +33 -0
- package/src/components/ui/scroll-area/ScrollBar.vue +32 -0
- package/src/components/ui/select/Select.vue +19 -0
- package/src/components/ui/select/SelectContent.vue +51 -0
- package/src/components/ui/select/SelectGroup.vue +15 -0
- package/src/components/ui/select/SelectItem.vue +44 -0
- package/src/components/ui/select/SelectItemText.vue +15 -0
- package/src/components/ui/select/SelectLabel.vue +17 -0
- package/src/components/ui/select/SelectScrollDownButton.vue +26 -0
- package/src/components/ui/select/SelectScrollUpButton.vue +26 -0
- package/src/components/ui/select/SelectSeparator.vue +19 -0
- package/src/components/ui/select/SelectTrigger.vue +33 -0
- package/src/components/ui/select/SelectValue.vue +15 -0
- package/src/components/ui/separator/Separator.vue +29 -0
- package/src/components/ui/sheet/Sheet.vue +19 -0
- package/src/components/ui/sheet/SheetClose.vue +15 -0
- package/src/components/ui/sheet/SheetContent.vue +62 -0
- package/src/components/ui/sheet/SheetDescription.vue +21 -0
- package/src/components/ui/sheet/SheetFooter.vue +16 -0
- package/src/components/ui/sheet/SheetHeader.vue +15 -0
- package/src/components/ui/sheet/SheetOverlay.vue +21 -0
- package/src/components/ui/sheet/SheetTitle.vue +21 -0
- package/src/components/ui/sheet/SheetTrigger.vue +15 -0
- package/src/components/ui/sidebar/Sidebar.vue +96 -0
- package/src/components/ui/sidebar/SidebarContent.vue +18 -0
- package/src/components/ui/sidebar/SidebarFooter.vue +18 -0
- package/src/components/ui/sidebar/SidebarGroup.vue +18 -0
- package/src/components/ui/sidebar/SidebarGroupAction.vue +27 -0
- package/src/components/ui/sidebar/SidebarGroupContent.vue +18 -0
- package/src/components/ui/sidebar/SidebarGroupLabel.vue +25 -0
- package/src/components/ui/sidebar/SidebarHeader.vue +18 -0
- package/src/components/ui/sidebar/SidebarInput.vue +22 -0
- package/src/components/ui/sidebar/SidebarInset.vue +21 -0
- package/src/components/ui/sidebar/SidebarMenu.vue +18 -0
- package/src/components/ui/sidebar/SidebarMenuAction.vue +35 -0
- package/src/components/ui/sidebar/SidebarMenuBadge.vue +26 -0
- package/src/components/ui/sidebar/SidebarMenuButton.vue +48 -0
- package/src/components/ui/sidebar/SidebarMenuButtonChild.vue +36 -0
- package/src/components/ui/sidebar/SidebarMenuItem.vue +18 -0
- package/src/components/ui/sidebar/SidebarMenuSkeleton.vue +35 -0
- package/src/components/ui/sidebar/SidebarMenuSub.vue +22 -0
- package/src/components/ui/sidebar/SidebarMenuSubButton.vue +36 -0
- package/src/components/ui/sidebar/SidebarMenuSubItem.vue +18 -0
- package/src/components/ui/sidebar/SidebarProvider.vue +82 -0
- package/src/components/ui/sidebar/SidebarRail.vue +33 -0
- package/src/components/ui/sidebar/SidebarSeparator.vue +19 -0
- package/src/components/ui/sidebar/SidebarTrigger.vue +27 -0
- package/src/components/ui/skeleton/Skeleton.vue +17 -0
- package/src/components/ui/sonner/Sonner.vue +42 -0
- package/src/components/ui/switch/Switch.vue +38 -0
- package/src/components/ui/table/Table.vue +16 -0
- package/src/components/ui/table/TableBody.vue +17 -0
- package/src/components/ui/table/TableCaption.vue +17 -0
- package/src/components/ui/table/TableCell.vue +22 -0
- package/src/components/ui/table/TableEmpty.vue +34 -0
- package/src/components/ui/table/TableFooter.vue +17 -0
- package/src/components/ui/table/TableHead.vue +17 -0
- package/src/components/ui/table/TableHeader.vue +17 -0
- package/src/components/ui/table/TableRow.vue +17 -0
- package/src/components/ui/tabs/Tabs.vue +24 -0
- package/src/components/ui/tabs/TabsContent.vue +21 -0
- package/src/components/ui/tabs/TabsList.vue +24 -0
- package/src/components/ui/tabs/TabsTrigger.vue +26 -0
- package/src/components/ui/tag/NsTag.vue +114 -0
- package/src/components/ui/text-input/NsTextInput.vue +269 -0
- package/src/components/ui/textarea/Textarea.vue +28 -0
- package/src/components/ui/toggle/NsToggle.vue +126 -0
- package/src/components/ui/tooltip/Tooltip.vue +19 -0
- package/src/components/ui/tooltip/TooltipContent.vue +34 -0
- package/src/components/ui/tooltip/TooltipProvider.vue +14 -0
- package/src/components/ui/tooltip/TooltipTrigger.vue +15 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, useId } from 'vue'
|
|
3
|
+
import { SwitchRoot, SwitchThumb } from 'radix-vue'
|
|
4
|
+
import { cn } from '@/lib/utils'
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
modelValue?: boolean
|
|
8
|
+
checked?: boolean
|
|
9
|
+
defaultChecked?: boolean
|
|
10
|
+
disabled?: boolean
|
|
11
|
+
required?: boolean
|
|
12
|
+
name?: string
|
|
13
|
+
value?: string
|
|
14
|
+
id?: string
|
|
15
|
+
label?: string
|
|
16
|
+
hideLabel?: boolean
|
|
17
|
+
description?: string
|
|
18
|
+
leftText?: string
|
|
19
|
+
rightText?: string
|
|
20
|
+
variant?: 'default' | 'destructive' | 'success' | 'warning'
|
|
21
|
+
size?: 'default' | 'sm' | 'lg'
|
|
22
|
+
class?: string
|
|
23
|
+
labelClass?: string
|
|
24
|
+
containerClass?: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
28
|
+
variant: 'default',
|
|
29
|
+
size: 'default',
|
|
30
|
+
leftText: 'Off',
|
|
31
|
+
rightText: 'On',
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
const emit = defineEmits<{
|
|
35
|
+
'update:modelValue': [value: boolean]
|
|
36
|
+
'update:checked': [value: boolean]
|
|
37
|
+
}>()
|
|
38
|
+
|
|
39
|
+
const uniqueId = useId()
|
|
40
|
+
const toggleId = props.id || uniqueId
|
|
41
|
+
|
|
42
|
+
const isChecked = computed({
|
|
43
|
+
get: () => props.modelValue ?? props.checked ?? false,
|
|
44
|
+
set: (value: boolean) => {
|
|
45
|
+
emit('update:modelValue', value)
|
|
46
|
+
emit('update:checked', value)
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
const toggleClasses = computed(() => {
|
|
51
|
+
const baseClasses = 'peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50'
|
|
52
|
+
|
|
53
|
+
const variantClasses = {
|
|
54
|
+
default: 'data-[state=checked]:bg-primary data-[state=unchecked]:bg-input',
|
|
55
|
+
destructive: 'data-[state=checked]:bg-destructive data-[state=unchecked]:bg-input',
|
|
56
|
+
success: 'data-[state=checked]:bg-green-500 data-[state=unchecked]:bg-input',
|
|
57
|
+
warning: 'data-[state=checked]:bg-orange-500 data-[state=unchecked]:bg-input'
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const sizeClasses = {
|
|
61
|
+
default: 'h-6 w-11',
|
|
62
|
+
sm: 'h-5 w-9',
|
|
63
|
+
lg: 'h-7 w-13'
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return cn(baseClasses, variantClasses[props.variant], sizeClasses[props.size])
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
const thumbClasses = computed(() => {
|
|
70
|
+
const baseClasses = 'pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0'
|
|
71
|
+
|
|
72
|
+
const sizeClasses = {
|
|
73
|
+
default: 'h-5 w-5 data-[state=checked]:translate-x-5',
|
|
74
|
+
sm: 'h-4 w-4 data-[state=checked]:translate-x-4',
|
|
75
|
+
lg: 'h-6 w-6 data-[state=checked]:translate-x-6'
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return cn(baseClasses, sizeClasses[props.size])
|
|
79
|
+
})
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<template>
|
|
83
|
+
<div :class="cn('flex items-center gap-3', containerClass)">
|
|
84
|
+
<SwitchRoot
|
|
85
|
+
:id="toggleId"
|
|
86
|
+
v-model:checked="isChecked"
|
|
87
|
+
:default-checked="defaultChecked"
|
|
88
|
+
:disabled="disabled"
|
|
89
|
+
:required="required"
|
|
90
|
+
:name="name"
|
|
91
|
+
:value="value"
|
|
92
|
+
:class="toggleClasses"
|
|
93
|
+
>
|
|
94
|
+
<SwitchThumb :class="thumbClasses" />
|
|
95
|
+
</SwitchRoot>
|
|
96
|
+
|
|
97
|
+
<div class="grid gap-1.5">
|
|
98
|
+
<label
|
|
99
|
+
v-if="label || $slots.label"
|
|
100
|
+
:for="toggleId"
|
|
101
|
+
:class="cn(
|
|
102
|
+
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer',
|
|
103
|
+
{
|
|
104
|
+
'sr-only': hideLabel,
|
|
105
|
+
'cursor-not-allowed': disabled,
|
|
106
|
+
'text-destructive': variant === 'destructive',
|
|
107
|
+
'text-green-600': variant === 'success',
|
|
108
|
+
'text-orange-600': variant === 'warning'
|
|
109
|
+
},
|
|
110
|
+
labelClass
|
|
111
|
+
)"
|
|
112
|
+
>
|
|
113
|
+
<slot name="label">{{ label }}</slot>
|
|
114
|
+
</label>
|
|
115
|
+
|
|
116
|
+
<div
|
|
117
|
+
v-if="!hideLabel && (leftText || rightText || $slots['left-text'] || $slots['right-text'])"
|
|
118
|
+
:class="cn(
|
|
119
|
+
'flex items-center gap-2 text-xs font-medium',
|
|
120
|
+
{
|
|
121
|
+
'text-muted-foreground': !isChecked,
|
|
122
|
+
'text-primary': isChecked,
|
|
123
|
+
'text-destructive': variant === 'destructive' && isChecked,
|
|
124
|
+
'text-green-600': variant === 'success' && isChecked,
|
|
125
|
+
'text-orange-600': variant === 'warning' && isChecked,
|
|
126
|
+
}
|
|
127
|
+
)"
|
|
128
|
+
>
|
|
129
|
+
<span :class="{ 'opacity-50': isChecked }">
|
|
130
|
+
<slot name="left-text">{{ leftText }}</slot>
|
|
131
|
+
</span>
|
|
132
|
+
|
|
133
|
+
<div :class="cn(
|
|
134
|
+
'w-8 h-px bg-current',
|
|
135
|
+
{
|
|
136
|
+
'opacity-20': !isChecked,
|
|
137
|
+
'opacity-100': isChecked
|
|
138
|
+
}
|
|
139
|
+
)" />
|
|
140
|
+
|
|
141
|
+
<span :class="{ 'opacity-50': !isChecked }">
|
|
142
|
+
<slot name="right-text">{{ rightText }}</slot>
|
|
143
|
+
</span>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<p
|
|
147
|
+
v-if="description"
|
|
148
|
+
class="text-sm text-muted-foreground"
|
|
149
|
+
>
|
|
150
|
+
{{ description }}
|
|
151
|
+
</p>
|
|
152
|
+
|
|
153
|
+
<slot name="extra" />
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</template>
|
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref, watch } from 'vue'
|
|
3
|
+
import { ChevronLeft, ChevronRight, Check } from 'lucide-vue-next'
|
|
4
|
+
import { Button } from '@/components/ui/button'
|
|
5
|
+
import { Separator } from '@/components/ui/separator'
|
|
6
|
+
import { cn } from '@/lib/utils'
|
|
7
|
+
|
|
8
|
+
interface WizardStep {
|
|
9
|
+
id: string
|
|
10
|
+
title: string
|
|
11
|
+
description?: string
|
|
12
|
+
icon?: any
|
|
13
|
+
disabled?: boolean
|
|
14
|
+
valid?: boolean
|
|
15
|
+
onValidate?: () => boolean | Promise<boolean>
|
|
16
|
+
onEnter?: () => void
|
|
17
|
+
onLeave?: () => void
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface Props {
|
|
21
|
+
modelValue?: number
|
|
22
|
+
steps?: WizardStep[]
|
|
23
|
+
vertical?: boolean
|
|
24
|
+
showStepNumbers?: boolean
|
|
25
|
+
showStepIcons?: boolean
|
|
26
|
+
showNavigation?: boolean
|
|
27
|
+
showProgressBar?: boolean
|
|
28
|
+
allowSkip?: boolean
|
|
29
|
+
hidePreviousOnFirst?: boolean
|
|
30
|
+
hideNextOnLast?: boolean
|
|
31
|
+
finishButtonText?: string
|
|
32
|
+
nextButtonText?: string
|
|
33
|
+
previousButtonText?: string
|
|
34
|
+
skipButtonText?: string
|
|
35
|
+
disabled?: boolean
|
|
36
|
+
class?: string
|
|
37
|
+
stepClass?: string
|
|
38
|
+
navigationClass?: string
|
|
39
|
+
contentClass?: string
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
43
|
+
modelValue: 0,
|
|
44
|
+
steps: () => [],
|
|
45
|
+
vertical: false,
|
|
46
|
+
showStepNumbers: true,
|
|
47
|
+
showStepIcons: false,
|
|
48
|
+
showNavigation: true,
|
|
49
|
+
showProgressBar: true,
|
|
50
|
+
allowSkip: false,
|
|
51
|
+
hidePreviousOnFirst: true,
|
|
52
|
+
hideNextOnLast: false,
|
|
53
|
+
finishButtonText: 'Finish',
|
|
54
|
+
nextButtonText: 'Next',
|
|
55
|
+
previousButtonText: 'Previous',
|
|
56
|
+
skipButtonText: 'Skip',
|
|
57
|
+
disabled: false,
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
const emit = defineEmits<{
|
|
61
|
+
'update:modelValue': [step: number]
|
|
62
|
+
'step-change': [step: number, previousStep: number]
|
|
63
|
+
'finish': [data: any]
|
|
64
|
+
'skip': [step: number]
|
|
65
|
+
'validate': [step: number, valid: boolean]
|
|
66
|
+
}>()
|
|
67
|
+
|
|
68
|
+
const currentStep = computed({
|
|
69
|
+
get: () => props.modelValue || 0,
|
|
70
|
+
set: (step: number) => {
|
|
71
|
+
if (step >= 0 && step < props.steps.length && !props.disabled) {
|
|
72
|
+
const previousStep = currentStep.value
|
|
73
|
+
|
|
74
|
+
// Call onLeave for current step
|
|
75
|
+
if (props.steps[previousStep]?.onLeave) {
|
|
76
|
+
props.steps[previousStep].onLeave()
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Update step
|
|
80
|
+
emit('update:modelValue', step)
|
|
81
|
+
emit('step-change', step, previousStep)
|
|
82
|
+
|
|
83
|
+
// Call onEnter for new step
|
|
84
|
+
if (props.steps[step]?.onEnter) {
|
|
85
|
+
props.steps[step].onEnter()
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
const currentStepData = computed(() => {
|
|
92
|
+
return props.steps[currentStep.value] || {}
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
const isFirstStep = computed(() => currentStep.value === 0)
|
|
96
|
+
const isLastStep = computed(() => currentStep.value === props.steps.length - 1)
|
|
97
|
+
|
|
98
|
+
const progressPercentage = computed(() => {
|
|
99
|
+
return ((currentStep.value + 1) / props.steps.length) * 100
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
const containerClasses = computed(() => {
|
|
103
|
+
const baseClasses = 'w-full'
|
|
104
|
+
|
|
105
|
+
return cn(baseClasses, props.class)
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
const wizardClasses = computed(() => {
|
|
109
|
+
const baseClasses = 'flex'
|
|
110
|
+
|
|
111
|
+
return cn(
|
|
112
|
+
baseClasses,
|
|
113
|
+
props.vertical ? 'flex-col' : 'flex-col lg:flex-row gap-8'
|
|
114
|
+
)
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
const stepsClasses = computed(() => {
|
|
118
|
+
const baseClasses = 'flex'
|
|
119
|
+
|
|
120
|
+
return cn(
|
|
121
|
+
baseClasses,
|
|
122
|
+
props.vertical ? 'flex-col space-y-4' : 'flex-row lg:flex-col lg:space-y-4'
|
|
123
|
+
)
|
|
124
|
+
})
|
|
125
|
+
|
|
126
|
+
const contentClasses = computed(() => {
|
|
127
|
+
const baseClasses = 'flex-1 min-w-0'
|
|
128
|
+
|
|
129
|
+
return cn(baseClasses, props.contentClass)
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
const navigationClasses = computed(() => {
|
|
133
|
+
const baseClasses = 'flex justify-between items-center pt-6'
|
|
134
|
+
|
|
135
|
+
return cn(baseClasses, props.navigationClass)
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
const stepClasses = computed(() => {
|
|
139
|
+
return cn(
|
|
140
|
+
'flex items-center gap-3 cursor-pointer transition-colors',
|
|
141
|
+
props.stepClass,
|
|
142
|
+
{
|
|
143
|
+
'opacity-50 cursor-not-allowed': props.disabled
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
const getStepState = (index: number) => {
|
|
149
|
+
const step = props.steps[index]
|
|
150
|
+
|
|
151
|
+
if (!step) return 'disabled'
|
|
152
|
+
|
|
153
|
+
if (index < currentStep.value) return 'completed'
|
|
154
|
+
if (index === currentStep.value) return 'active'
|
|
155
|
+
if (step.disabled) return 'disabled'
|
|
156
|
+
return 'pending'
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const getStepClasses = (index: number) => {
|
|
160
|
+
const state = getStepState(index)
|
|
161
|
+
|
|
162
|
+
const baseClasses = 'flex items-center justify-center rounded-full transition-colors'
|
|
163
|
+
|
|
164
|
+
const stateClasses = {
|
|
165
|
+
completed: 'bg-primary text-primary-foreground',
|
|
166
|
+
active: 'bg-primary text-primary-foreground ring-2 ring-ring ring-offset-2',
|
|
167
|
+
pending: 'bg-muted text-muted-foreground border-2 border-border',
|
|
168
|
+
disabled: 'bg-muted text-muted-foreground opacity-50 border-2 border-border'
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return cn(baseClasses, stateClasses[state])
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const canGoNext = computed(() => {
|
|
175
|
+
if (props.disabled) return false
|
|
176
|
+
if (isLastStep.value) return false
|
|
177
|
+
|
|
178
|
+
const step = props.steps[currentStep.value]
|
|
179
|
+
if (step?.disabled) return false
|
|
180
|
+
|
|
181
|
+
// Check if current step is valid
|
|
182
|
+
if (step?.valid === false) return false
|
|
183
|
+
|
|
184
|
+
return true
|
|
185
|
+
})
|
|
186
|
+
|
|
187
|
+
const canGoPrevious = computed(() => {
|
|
188
|
+
if (props.disabled) return false
|
|
189
|
+
if (isFirstStep.value) return false
|
|
190
|
+
|
|
191
|
+
return true
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
const canSkip = computed(() => {
|
|
195
|
+
if (props.disabled) return false
|
|
196
|
+
if (!props.allowSkip) return false
|
|
197
|
+
|
|
198
|
+
const step = props.steps[currentStep.value]
|
|
199
|
+
if (step?.disabled) return false
|
|
200
|
+
|
|
201
|
+
return true
|
|
202
|
+
})
|
|
203
|
+
|
|
204
|
+
const goToStep = async (index: number) => {
|
|
205
|
+
if (index < 0 || index >= props.steps.length) return
|
|
206
|
+
|
|
207
|
+
const step = props.steps[index]
|
|
208
|
+
if (step?.disabled) return
|
|
209
|
+
|
|
210
|
+
// Validate current step if moving forward
|
|
211
|
+
if (index > currentStep.value) {
|
|
212
|
+
const currentStepData = props.steps[currentStep.value]
|
|
213
|
+
if (currentStepData?.onValidate) {
|
|
214
|
+
try {
|
|
215
|
+
const isValid = await currentStepData.onValidate()
|
|
216
|
+
emit('validate', currentStep.value, isValid)
|
|
217
|
+
if (!isValid) return
|
|
218
|
+
} catch (error) {
|
|
219
|
+
emit('validate', currentStep.value, false)
|
|
220
|
+
return
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
currentStep.value = index
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const handleNext = async () => {
|
|
229
|
+
if (!canGoNext.value) return
|
|
230
|
+
|
|
231
|
+
const currentStepData = props.steps[currentStep.value]
|
|
232
|
+
|
|
233
|
+
// Validate current step
|
|
234
|
+
if (currentStepData?.onValidate) {
|
|
235
|
+
try {
|
|
236
|
+
const isValid = await currentStepData.onValidate()
|
|
237
|
+
emit('validate', currentStep.value, isValid)
|
|
238
|
+
if (!isValid) return
|
|
239
|
+
} catch (error) {
|
|
240
|
+
emit('validate', currentStep.value, false)
|
|
241
|
+
return
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (isLastStep.value) {
|
|
246
|
+
emit('finish', {})
|
|
247
|
+
} else {
|
|
248
|
+
currentStep.value++
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
const handlePrevious = () => {
|
|
253
|
+
if (canGoPrevious.value) {
|
|
254
|
+
currentStep.value--
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const handleSkip = () => {
|
|
259
|
+
if (canSkip.value) {
|
|
260
|
+
emit('skip', currentStep.value)
|
|
261
|
+
if (!isLastStep.value) {
|
|
262
|
+
currentStep.value++
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Watch for step changes
|
|
268
|
+
watch(currentStep, (newStep, oldStep) => {
|
|
269
|
+
if (newStep !== oldStep) {
|
|
270
|
+
// Auto-validate new step
|
|
271
|
+
const step = props.steps[newStep]
|
|
272
|
+
if (step?.onValidate) {
|
|
273
|
+
step.onValidate().then(isValid => {
|
|
274
|
+
emit('validate', newStep, isValid)
|
|
275
|
+
})
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}, { immediate: true })
|
|
279
|
+
</script>
|
|
280
|
+
|
|
281
|
+
<template>
|
|
282
|
+
<div :class="containerClasses">
|
|
283
|
+
<!-- Progress bar -->
|
|
284
|
+
<div v-if="showProgressBar" class="mb-8">
|
|
285
|
+
<div class="relative h-2 w-full overflow-hidden rounded-full bg-secondary">
|
|
286
|
+
<div
|
|
287
|
+
class="h-full w-full bg-primary transition-all duration-300 ease-in-out"
|
|
288
|
+
:style="{ width: `${progressPercentage}%` }"
|
|
289
|
+
/>
|
|
290
|
+
</div>
|
|
291
|
+
<div class="mt-2 text-sm text-muted-foreground">
|
|
292
|
+
Step {{ currentStep + 1 }} of {{ steps.length }}
|
|
293
|
+
</div>
|
|
294
|
+
</div>
|
|
295
|
+
|
|
296
|
+
<div :class="wizardClasses">
|
|
297
|
+
<!-- Steps navigation -->
|
|
298
|
+
<div :class="stepsClasses">
|
|
299
|
+
<div
|
|
300
|
+
v-for="(step, index) in steps"
|
|
301
|
+
:key="step.id"
|
|
302
|
+
:class="stepClasses"
|
|
303
|
+
@click="goToStep(index)"
|
|
304
|
+
>
|
|
305
|
+
<!-- Step indicator -->
|
|
306
|
+
<div :class="getStepClasses(index)" class="w-8 h-8 text-sm font-medium">
|
|
307
|
+
<Check v-if="getStepState(index) === 'completed'" class="h-4 w-4" />
|
|
308
|
+
<component v-else-if="showStepIcons && step.icon" :is="step.icon" class="h-4 w-4" />
|
|
309
|
+
<span v-else-if="showStepNumbers">{{ index + 1 }}</span>
|
|
310
|
+
</div>
|
|
311
|
+
|
|
312
|
+
<!-- Step info -->
|
|
313
|
+
<div class="text-left">
|
|
314
|
+
<div class="font-medium text-sm">{{ step.title }}</div>
|
|
315
|
+
<div v-if="step.description" class="text-xs text-muted-foreground">
|
|
316
|
+
{{ step.description }}
|
|
317
|
+
</div>
|
|
318
|
+
</div>
|
|
319
|
+
</div>
|
|
320
|
+
</div>
|
|
321
|
+
|
|
322
|
+
<!-- Separator -->
|
|
323
|
+
<Separator
|
|
324
|
+
v-if="!vertical"
|
|
325
|
+
orientation="vertical"
|
|
326
|
+
class="hidden lg:block"
|
|
327
|
+
/>
|
|
328
|
+
|
|
329
|
+
<!-- Content -->
|
|
330
|
+
<div :class="contentClasses">
|
|
331
|
+
<!-- Current step content -->
|
|
332
|
+
<div class="space-y-6">
|
|
333
|
+
<slot
|
|
334
|
+
:name="`step-${currentStepData.id}`"
|
|
335
|
+
:step="currentStepData"
|
|
336
|
+
:index="currentStep"
|
|
337
|
+
:isFirst="isFirstStep"
|
|
338
|
+
:isLast="isLastStep"
|
|
339
|
+
:next="handleNext"
|
|
340
|
+
:previous="handlePrevious"
|
|
341
|
+
:skip="handleSkip"
|
|
342
|
+
:canGoNext="canGoNext"
|
|
343
|
+
:canGoPrevious="canGoPrevious"
|
|
344
|
+
:canSkip="canSkip"
|
|
345
|
+
>
|
|
346
|
+
<!-- Default step content -->
|
|
347
|
+
<div class="space-y-4">
|
|
348
|
+
<h2 class="text-xl font-semibold">{{ currentStepData.title }}</h2>
|
|
349
|
+
<p v-if="currentStepData.description" class="text-muted-foreground">
|
|
350
|
+
{{ currentStepData.description }}
|
|
351
|
+
</p>
|
|
352
|
+
<div class="text-sm text-muted-foreground">
|
|
353
|
+
Step {{ currentStep + 1 }} of {{ steps.length }}
|
|
354
|
+
</div>
|
|
355
|
+
</div>
|
|
356
|
+
</slot>
|
|
357
|
+
</div>
|
|
358
|
+
|
|
359
|
+
<!-- Navigation buttons -->
|
|
360
|
+
<div v-if="showNavigation" :class="navigationClasses">
|
|
361
|
+
<div class="flex gap-2">
|
|
362
|
+
<!-- Previous button -->
|
|
363
|
+
<Button
|
|
364
|
+
v-if="!hidePreviousOnFirst || !isFirstStep"
|
|
365
|
+
variant="outline"
|
|
366
|
+
:disabled="!canGoPrevious"
|
|
367
|
+
@click="handlePrevious"
|
|
368
|
+
>
|
|
369
|
+
<ChevronLeft class="h-4 w-4" />
|
|
370
|
+
{{ previousButtonText }}
|
|
371
|
+
</Button>
|
|
372
|
+
|
|
373
|
+
<!-- Skip button -->
|
|
374
|
+
<Button
|
|
375
|
+
v-if="allowSkip && !isLastStep"
|
|
376
|
+
variant="ghost"
|
|
377
|
+
:disabled="!canSkip"
|
|
378
|
+
@click="handleSkip"
|
|
379
|
+
>
|
|
380
|
+
{{ skipButtonText }}
|
|
381
|
+
</Button>
|
|
382
|
+
</div>
|
|
383
|
+
|
|
384
|
+
<div class="flex gap-2">
|
|
385
|
+
<!-- Next/Finish button -->
|
|
386
|
+
<Button
|
|
387
|
+
:disabled="!canGoNext"
|
|
388
|
+
@click="handleNext"
|
|
389
|
+
>
|
|
390
|
+
{{ isLastStep ? finishButtonText : nextButtonText }}
|
|
391
|
+
<ChevronRight v-if="!isLastStep" class="h-4 w-4" />
|
|
392
|
+
<Check v-else class="h-4 w-4" />
|
|
393
|
+
</Button>
|
|
394
|
+
</div>
|
|
395
|
+
</div>
|
|
396
|
+
</div>
|
|
397
|
+
</div>
|
|
398
|
+
</div>
|
|
399
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { PrimitiveProps } from "reka-ui"
|
|
3
|
+
import type { HTMLAttributes } from "vue"
|
|
4
|
+
import type { ButtonVariants } from "."
|
|
5
|
+
import { Primitive } from "reka-ui"
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
import { buttonVariants } from "."
|
|
8
|
+
|
|
9
|
+
interface Props extends PrimitiveProps {
|
|
10
|
+
variant?: ButtonVariants["variant"]
|
|
11
|
+
size?: ButtonVariants["size"]
|
|
12
|
+
class?: HTMLAttributes["class"]
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
16
|
+
as: "button",
|
|
17
|
+
})
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<Primitive
|
|
22
|
+
data-slot="button"
|
|
23
|
+
:as="as"
|
|
24
|
+
:as-child="asChild"
|
|
25
|
+
:class="cn(buttonVariants({ variant, size }), props.class)"
|
|
26
|
+
>
|
|
27
|
+
<slot />
|
|
28
|
+
</Primitive>
|
|
29
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div
|
|
12
|
+
data-slot="card"
|
|
13
|
+
:class="
|
|
14
|
+
cn(
|
|
15
|
+
'bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm',
|
|
16
|
+
props.class,
|
|
17
|
+
)
|
|
18
|
+
"
|
|
19
|
+
>
|
|
20
|
+
<slot />
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div
|
|
12
|
+
data-slot="card-action"
|
|
13
|
+
:class="cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', props.class)"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div
|
|
12
|
+
data-slot="card-content"
|
|
13
|
+
:class="cn('px-6', props.class)"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<p
|
|
12
|
+
data-slot="card-description"
|
|
13
|
+
:class="cn('text-muted-foreground text-sm', props.class)"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</p>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div
|
|
12
|
+
data-slot="card-footer"
|
|
13
|
+
:class="cn('flex items-center px-6 [.border-t]:pt-6', props.class)"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "vue"
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const props = defineProps<{
|
|
6
|
+
class?: HTMLAttributes["class"]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div
|
|
12
|
+
data-slot="card-header"
|
|
13
|
+
:class="cn('@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6', props.class)"
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|