create-tauri-ui 0.1.3 → 0.1.4
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/dist/index.mjs +19 -19
- package/package.json +1 -1
- package/templates/next/README.md +1 -1
- package/templates/sveltekit/.prettierignore +13 -0
- package/templates/sveltekit/.prettierrc +8 -0
- package/templates/sveltekit/README.md +1 -0
- package/templates/sveltekit/app-icon.png +0 -0
- package/templates/sveltekit/package.json +84 -0
- package/templates/sveltekit/pnpm-lock.yaml +5314 -0
- package/templates/sveltekit/postcss.config.cjs +13 -0
- package/templates/sveltekit/src/app.d.ts +18 -0
- package/templates/sveltekit/src/app.html +16 -0
- package/templates/sveltekit/src/assets/Inter.var.woff2 +0 -0
- package/templates/sveltekit/src/content/cli.md +63 -0
- package/templates/sveltekit/src/content/components/accordion.md +59 -0
- package/templates/sveltekit/src/content/components/alert-dialog.md +75 -0
- package/templates/sveltekit/src/content/components/alert.md +67 -0
- package/templates/sveltekit/src/content/components/aspect-ratio.md +51 -0
- package/templates/sveltekit/src/content/components/avatar.md +52 -0
- package/templates/sveltekit/src/content/components/badge.md +104 -0
- package/templates/sveltekit/src/content/components/button.md +165 -0
- package/templates/sveltekit/src/content/components/card.md +82 -0
- package/templates/sveltekit/src/content/components/checkbox.md +71 -0
- package/templates/sveltekit/src/content/components/collapsible.md +55 -0
- package/templates/sveltekit/src/content/components/dialog.md +72 -0
- package/templates/sveltekit/src/content/components/hover-card.md +52 -0
- package/templates/sveltekit/src/content/components/input.md +114 -0
- package/templates/sveltekit/src/content/components/label.md +49 -0
- package/templates/sveltekit/src/content/components/progress.md +49 -0
- package/templates/sveltekit/src/content/components/radio-group.md +59 -0
- package/templates/sveltekit/src/content/components/separator.md +49 -0
- package/templates/sveltekit/src/content/components/sheet.md +95 -0
- package/templates/sveltekit/src/content/components/skeleton.md +42 -0
- package/templates/sveltekit/src/content/components/slider.md +49 -0
- package/templates/sveltekit/src/content/components/switch.md +49 -0
- package/templates/sveltekit/src/content/components/table.md +78 -0
- package/templates/sveltekit/src/content/components/tabs.md +56 -0
- package/templates/sveltekit/src/content/components/textarea.md +102 -0
- package/templates/sveltekit/src/content/components/toggle.md +121 -0
- package/templates/sveltekit/src/content/components/tooltip.md +56 -0
- package/templates/sveltekit/src/content/figma.md +22 -0
- package/templates/sveltekit/src/content/forms/superforms.md +4 -0
- package/templates/sveltekit/src/content/index.md +84 -0
- package/templates/sveltekit/src/content/installation.md +327 -0
- package/templates/sveltekit/src/content/theming.md +189 -0
- package/templates/sveltekit/src/content/typography.md +150 -0
- package/templates/sveltekit/src/index.test.ts +7 -0
- package/templates/sveltekit/src/lib/components/docs/Callout.svelte +17 -0
- package/templates/sveltekit/src/lib/components/docs/CodeBlockWrapper.svelte +30 -0
- package/templates/sveltekit/src/lib/components/docs/ComponentExample.svelte +55 -0
- package/templates/sveltekit/src/lib/components/docs/ComponentSource.svelte +14 -0
- package/templates/sveltekit/src/lib/components/docs/CopyButton.svelte +39 -0
- package/templates/sveltekit/src/lib/components/docs/DocsPager.svelte +51 -0
- package/templates/sveltekit/src/lib/components/docs/HexToChannels.svelte +38 -0
- package/templates/sveltekit/src/lib/components/docs/ManualInstall.svelte +17 -0
- package/templates/sveltekit/src/lib/components/docs/Metadata.svelte +34 -0
- package/templates/sveltekit/src/lib/components/docs/SiteFooter.svelte +42 -0
- package/templates/sveltekit/src/lib/components/docs/SiteHeader.svelte +51 -0
- package/templates/sveltekit/src/lib/components/docs/Steps.svelte +3 -0
- package/templates/sveltekit/src/lib/components/docs/TableOfContents.svelte +55 -0
- package/templates/sveltekit/src/lib/components/docs/TailwindIndicator.svelte +10 -0
- package/templates/sveltekit/src/lib/components/docs/Tree.svelte +31 -0
- package/templates/sveltekit/src/lib/components/docs/charts/Bar.svelte +152 -0
- package/templates/sveltekit/src/lib/components/docs/dashboard/DashboardPage.svelte +124 -0
- package/templates/sveltekit/src/lib/components/docs/dashboard/MainNav.svelte +31 -0
- package/templates/sveltekit/src/lib/components/docs/dashboard/Overview.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/dashboard/RecentSales.svelte +61 -0
- package/templates/sveltekit/src/lib/components/docs/dashboard/Search.svelte +7 -0
- package/templates/sveltekit/src/lib/components/docs/dashboard/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/accordion/AccordionDemo.svelte +27 -0
- package/templates/sveltekit/src/lib/components/docs/examples/accordion/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/alert/AlertDemo.svelte +10 -0
- package/templates/sveltekit/src/lib/components/docs/examples/alert/AlertDemoDestructive.svelte +10 -0
- package/templates/sveltekit/src/lib/components/docs/examples/alert/index.ts +2 -0
- package/templates/sveltekit/src/lib/components/docs/examples/alert-dialog/AlertDialogDemo.svelte +33 -0
- package/templates/sveltekit/src/lib/components/docs/examples/alert-dialog/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/aspect-ratio/AspectRatioDemo.svelte +11 -0
- package/templates/sveltekit/src/lib/components/docs/examples/aspect-ratio/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/avatar/AvatarDemo.svelte +8 -0
- package/templates/sveltekit/src/lib/components/docs/examples/avatar/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/badge/BadgeDemo.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/badge/BadgeDemoDestructive.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/badge/BadgeDemoOutline.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/badge/BadgeDemoSecondary.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/badge/index.ts +4 -0
- package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemo.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoDestructive.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoGhost.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoIcon.svelte +9 -0
- package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoLink.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoLoading.svelte +9 -0
- package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoOutline.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoSecondary.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/button/index.ts +8 -0
- package/templates/sveltekit/src/lib/components/docs/examples/card/CardDemo.svelte +65 -0
- package/templates/sveltekit/src/lib/components/docs/examples/card/CardDemoForm.svelte +0 -0
- package/templates/sveltekit/src/lib/components/docs/examples/card/index.ts +2 -0
- package/templates/sveltekit/src/lib/components/docs/examples/checkbox/CheckboxDemo.svelte +13 -0
- package/templates/sveltekit/src/lib/components/docs/examples/checkbox/CheckboxDemoDisabled.svelte +13 -0
- package/templates/sveltekit/src/lib/components/docs/examples/checkbox/CheckboxDemoText.svelte +18 -0
- package/templates/sveltekit/src/lib/components/docs/examples/checkbox/index.ts +3 -0
- package/templates/sveltekit/src/lib/components/docs/examples/collapsible/CollapsibleDemo.svelte +24 -0
- package/templates/sveltekit/src/lib/components/docs/examples/collapsible/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/dialog/DialogDemo.svelte +41 -0
- package/templates/sveltekit/src/lib/components/docs/examples/dialog/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/hover-card/HoverCardDemo.svelte +28 -0
- package/templates/sveltekit/src/lib/components/docs/examples/hover-card/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/index.ts +27 -0
- package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemo.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemoButton.svelte +9 -0
- package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemoDisabled.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemoFile.svelte +9 -0
- package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemoLabel.svelte +9 -0
- package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemoText.svelte +10 -0
- package/templates/sveltekit/src/lib/components/docs/examples/input/index.ts +6 -0
- package/templates/sveltekit/src/lib/components/docs/examples/label/LabelDemo.svelte +11 -0
- package/templates/sveltekit/src/lib/components/docs/examples/label/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/progress/ProgressDemo.svelte +12 -0
- package/templates/sveltekit/src/lib/components/docs/examples/progress/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/radio-group/RadioGroupDemo.svelte +19 -0
- package/templates/sveltekit/src/lib/components/docs/examples/radio-group/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/separator/SeparatorDemo.svelte +18 -0
- package/templates/sveltekit/src/lib/components/docs/examples/separator/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/sheet/SheetDemo.svelte +44 -0
- package/templates/sveltekit/src/lib/components/docs/examples/sheet/SheetPositionDemo.svelte +62 -0
- package/templates/sveltekit/src/lib/components/docs/examples/sheet/SheetSizeDemo.svelte +62 -0
- package/templates/sveltekit/src/lib/components/docs/examples/sheet/index.ts +3 -0
- package/templates/sveltekit/src/lib/components/docs/examples/skeleton/SkeletonDemo.svelte +11 -0
- package/templates/sveltekit/src/lib/components/docs/examples/skeleton/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/slider/SliderDemo.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/slider/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/switch/SwitchDemo.svelte +9 -0
- package/templates/sveltekit/src/lib/components/docs/examples/switch/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/table/TableDemo.svelte +78 -0
- package/templates/sveltekit/src/lib/components/docs/examples/table/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/tabs/TabsDemo.svelte +67 -0
- package/templates/sveltekit/src/lib/components/docs/examples/tabs/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/textarea/TextareaDemo.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/textarea/TextareaDemoButton.svelte +9 -0
- package/templates/sveltekit/src/lib/components/docs/examples/textarea/TextareaDemoDisabled.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/textarea/TextareaDemoLabel.svelte +9 -0
- package/templates/sveltekit/src/lib/components/docs/examples/textarea/TextareaDemoText.svelte +10 -0
- package/templates/sveltekit/src/lib/components/docs/examples/textarea/index.ts +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemo.svelte +8 -0
- package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemoDisabled.svelte +8 -0
- package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemoLg.svelte +8 -0
- package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemoOutline.svelte +8 -0
- package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemoSm.svelte +8 -0
- package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemoText.svelte +9 -0
- package/templates/sveltekit/src/lib/components/docs/examples/toggle/index.ts +6 -0
- package/templates/sveltekit/src/lib/components/docs/examples/tooltip/TooltipDemo.svelte +19 -0
- package/templates/sveltekit/src/lib/components/docs/examples/tooltip/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/typography/BlockquoteDemo.svelte +4 -0
- package/templates/sveltekit/src/lib/components/docs/examples/typography/H1Demo.svelte +3 -0
- package/templates/sveltekit/src/lib/components/docs/examples/typography/H2Demo.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/typography/H3Demo.svelte +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/typography/H4Demo.svelte +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/typography/InlineCodeDemo.svelte +3 -0
- package/templates/sveltekit/src/lib/components/docs/examples/typography/LargeDemo.svelte +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/typography/LeadDemo.svelte +3 -0
- package/templates/sveltekit/src/lib/components/docs/examples/typography/ListDemo.svelte +5 -0
- package/templates/sveltekit/src/lib/components/docs/examples/typography/MutedDemo.svelte +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/typography/PDemo.svelte +4 -0
- package/templates/sveltekit/src/lib/components/docs/examples/typography/SmallDemo.svelte +1 -0
- package/templates/sveltekit/src/lib/components/docs/examples/typography/TableDemo.svelte +56 -0
- package/templates/sveltekit/src/lib/components/docs/examples/typography/TypographyDemo.svelte +117 -0
- package/templates/sveltekit/src/lib/components/docs/examples/typography/index.ts +14 -0
- package/templates/sveltekit/src/lib/components/docs/examples-nav/ExampleCodeLink.svelte +19 -0
- package/templates/sveltekit/src/lib/components/docs/examples-nav/ExamplesNav.svelte +27 -0
- package/templates/sveltekit/src/lib/components/docs/examples-nav/index.ts +2 -0
- package/templates/sveltekit/src/lib/components/docs/icons/Apple.svelte +12 -0
- package/templates/sveltekit/src/lib/components/docs/icons/Aria.svelte +11 -0
- package/templates/sveltekit/src/lib/components/docs/icons/GitHub.svelte +12 -0
- package/templates/sveltekit/src/lib/components/docs/icons/Google.svelte +12 -0
- package/templates/sveltekit/src/lib/components/docs/icons/Logo.svelte +17 -0
- package/templates/sveltekit/src/lib/components/docs/icons/Minimize.svelte +12 -0
- package/templates/sveltekit/src/lib/components/docs/icons/Npm.svelte +12 -0
- package/templates/sveltekit/src/lib/components/docs/icons/PayPal.svelte +12 -0
- package/templates/sveltekit/src/lib/components/docs/icons/Pnpm.svelte +12 -0
- package/templates/sveltekit/src/lib/components/docs/icons/Radix.svelte +14 -0
- package/templates/sveltekit/src/lib/components/docs/icons/RadixSvelte.svelte +14 -0
- package/templates/sveltekit/src/lib/components/docs/icons/Tailwind.svelte +12 -0
- package/templates/sveltekit/src/lib/components/docs/icons/Yarn.svelte +12 -0
- package/templates/sveltekit/src/lib/components/docs/icons/index.ts +78 -0
- package/templates/sveltekit/src/lib/components/docs/index.ts +23 -0
- package/templates/sveltekit/src/lib/components/docs/light-switch/LightSwitch.svelte +75 -0
- package/templates/sveltekit/src/lib/components/docs/light-switch/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/docs/light-switch/light-switch.ts +87 -0
- package/templates/sveltekit/src/lib/components/docs/light-switch/local-storage-store.ts +81 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/a.svelte +12 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/blockquote.svelte +10 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/h1.svelte +10 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/h2.svelte +16 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/h3.svelte +10 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/h4.svelte +10 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/h5.svelte +10 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/h6.svelte +13 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/hr.svelte +8 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/img.svelte +11 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/index.ts +19 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/li.svelte +10 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/mdsvex.svelte +37 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/ol.svelte +10 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/p.svelte +10 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/pre.svelte +24 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/table.svelte +12 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/td.svelte +16 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/th.svelte +16 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/tr.svelte +10 -0
- package/templates/sveltekit/src/lib/components/docs/mdsvex/ul.svelte +10 -0
- package/templates/sveltekit/src/lib/components/docs/nav/DocsSidebarNav.svelte +24 -0
- package/templates/sveltekit/src/lib/components/docs/nav/DocsSidebarNavItems.svelte +43 -0
- package/templates/sveltekit/src/lib/components/docs/nav/MainNav.svelte +31 -0
- package/templates/sveltekit/src/lib/components/docs/nav/MobileLink.svelte +19 -0
- package/templates/sveltekit/src/lib/components/docs/nav/MobileNav.svelte +56 -0
- package/templates/sveltekit/src/lib/components/docs/nav/index.ts +4 -0
- package/templates/sveltekit/src/lib/components/docs/page-header/PageHeader.svelte +13 -0
- package/templates/sveltekit/src/lib/components/docs/page-header/PageHeaderDescription.svelte +13 -0
- package/templates/sveltekit/src/lib/components/docs/page-header/PageHeaderHeading.svelte +16 -0
- package/templates/sveltekit/src/lib/components/docs/page-header/index.ts +3 -0
- package/templates/sveltekit/src/lib/components/ui/accordion/Accordion.svelte +11 -0
- package/templates/sveltekit/src/lib/components/ui/accordion/AccordionContent.svelte +19 -0
- package/templates/sveltekit/src/lib/components/ui/accordion/AccordionItem.svelte +13 -0
- package/templates/sveltekit/src/lib/components/ui/accordion/AccordionTrigger.svelte +21 -0
- package/templates/sveltekit/src/lib/components/ui/accordion/index.ts +4 -0
- package/templates/sveltekit/src/lib/components/ui/alert/Alert.svelte +29 -0
- package/templates/sveltekit/src/lib/components/ui/alert/AlertDescription.svelte +10 -0
- package/templates/sveltekit/src/lib/components/ui/alert/AlertTitle.svelte +15 -0
- package/templates/sveltekit/src/lib/components/ui/alert/index.ts +3 -0
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogAction.svelte +12 -0
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogCancel.svelte +15 -0
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogContent.svelte +22 -0
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogDescription.svelte +14 -0
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogFooter.svelte +13 -0
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogHeader.svelte +10 -0
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogOverlay.svelte +15 -0
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogPortal.svelte +9 -0
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/AlertDialogTitle.svelte +11 -0
- package/templates/sveltekit/src/lib/components/ui/alert-dialog/index.ts +12 -0
- package/templates/sveltekit/src/lib/components/ui/aspect-ratio/AspectRatio.svelte +13 -0
- package/templates/sveltekit/src/lib/components/ui/aspect-ratio/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/ui/avatar/Avatar.svelte +14 -0
- package/templates/sveltekit/src/lib/components/ui/avatar/AvatarFallback.svelte +14 -0
- package/templates/sveltekit/src/lib/components/ui/avatar/AvatarImage.svelte +17 -0
- package/templates/sveltekit/src/lib/components/ui/avatar/index.ts +3 -0
- package/templates/sveltekit/src/lib/components/ui/badge/Badge.svelte +39 -0
- package/templates/sveltekit/src/lib/components/ui/badge/index.ts +21 -0
- package/templates/sveltekit/src/lib/components/ui/button/Button.svelte +47 -0
- package/templates/sveltekit/src/lib/components/ui/button/index.ts +28 -0
- package/templates/sveltekit/src/lib/components/ui/card/Card.svelte +18 -0
- package/templates/sveltekit/src/lib/components/ui/card/CardContent.svelte +10 -0
- package/templates/sveltekit/src/lib/components/ui/card/CardDescription.svelte +10 -0
- package/templates/sveltekit/src/lib/components/ui/card/CardFooter.svelte +10 -0
- package/templates/sveltekit/src/lib/components/ui/card/CardHeader.svelte +10 -0
- package/templates/sveltekit/src/lib/components/ui/card/CardTitle.svelte +16 -0
- package/templates/sveltekit/src/lib/components/ui/card/index.ts +6 -0
- package/templates/sveltekit/src/lib/components/ui/checkbox/Checkbox.svelte +23 -0
- package/templates/sveltekit/src/lib/components/ui/checkbox/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/ui/collapsible/index.ts +7 -0
- package/templates/sveltekit/src/lib/components/ui/dialog/DialogContent.svelte +29 -0
- package/templates/sveltekit/src/lib/components/ui/dialog/DialogDescription.svelte +14 -0
- package/templates/sveltekit/src/lib/components/ui/dialog/DialogFooter.svelte +13 -0
- package/templates/sveltekit/src/lib/components/ui/dialog/DialogHeader.svelte +10 -0
- package/templates/sveltekit/src/lib/components/ui/dialog/DialogOverlay.svelte +15 -0
- package/templates/sveltekit/src/lib/components/ui/dialog/DialogPortal.svelte +13 -0
- package/templates/sveltekit/src/lib/components/ui/dialog/DialogTitle.svelte +14 -0
- package/templates/sveltekit/src/lib/components/ui/dialog/index.ts +12 -0
- package/templates/sveltekit/src/lib/components/ui/hover-card/HoverCardContent.svelte +24 -0
- package/templates/sveltekit/src/lib/components/ui/hover-card/index.ts +6 -0
- package/templates/sveltekit/src/lib/components/ui/input/Input.svelte +30 -0
- package/templates/sveltekit/src/lib/components/ui/input/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/ui/label/Label.svelte +16 -0
- package/templates/sveltekit/src/lib/components/ui/label/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/ui/progress/Progress.svelte +22 -0
- package/templates/sveltekit/src/lib/components/ui/progress/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/ui/radio-group/RadioGroup.svelte +13 -0
- package/templates/sveltekit/src/lib/components/ui/radio-group/RadioGroupItem.svelte +23 -0
- package/templates/sveltekit/src/lib/components/ui/radio-group/index.ts +2 -0
- package/templates/sveltekit/src/lib/components/ui/select/SelectContent.svelte +26 -0
- package/templates/sveltekit/src/lib/components/ui/select/SelectItem.svelte +29 -0
- package/templates/sveltekit/src/lib/components/ui/select/SelectLabel.svelte +14 -0
- package/templates/sveltekit/src/lib/components/ui/select/SelectSeparator.svelte +9 -0
- package/templates/sveltekit/src/lib/components/ui/select/SelectTrigger.svelte +21 -0
- package/templates/sveltekit/src/lib/components/ui/select/index.ts +10 -0
- package/templates/sveltekit/src/lib/components/ui/separator/Separator.svelte +22 -0
- package/templates/sveltekit/src/lib/components/ui/separator/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/ui/sheet/SheetContent.svelte +27 -0
- package/templates/sveltekit/src/lib/components/ui/sheet/SheetDescription.svelte +11 -0
- package/templates/sveltekit/src/lib/components/ui/sheet/SheetFooter.svelte +13 -0
- package/templates/sveltekit/src/lib/components/ui/sheet/SheetHeader.svelte +10 -0
- package/templates/sveltekit/src/lib/components/ui/sheet/SheetOverlay.svelte +15 -0
- package/templates/sveltekit/src/lib/components/ui/sheet/SheetPortal.svelte +28 -0
- package/templates/sveltekit/src/lib/components/ui/sheet/SheetTitle.svelte +14 -0
- package/templates/sveltekit/src/lib/components/ui/sheet/index.ts +102 -0
- package/templates/sveltekit/src/lib/components/ui/skeleton/Skeleton.svelte +8 -0
- package/templates/sveltekit/src/lib/components/ui/skeleton/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/ui/slider/Slider.svelte +22 -0
- package/templates/sveltekit/src/lib/components/ui/slider/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/ui/switch/Switch.svelte +32 -0
- package/templates/sveltekit/src/lib/components/ui/switch/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/ui/table/Table.svelte +12 -0
- package/templates/sveltekit/src/lib/components/ui/table/TableBody.svelte +10 -0
- package/templates/sveltekit/src/lib/components/ui/table/TableCaption.svelte +10 -0
- package/templates/sveltekit/src/lib/components/ui/table/TableCell.svelte +10 -0
- package/templates/sveltekit/src/lib/components/ui/table/TableFooter.svelte +10 -0
- package/templates/sveltekit/src/lib/components/ui/table/TableHead.svelte +16 -0
- package/templates/sveltekit/src/lib/components/ui/table/TableHeader.svelte +10 -0
- package/templates/sveltekit/src/lib/components/ui/table/TableRow.svelte +16 -0
- package/templates/sveltekit/src/lib/components/ui/table/index.ts +8 -0
- package/templates/sveltekit/src/lib/components/ui/tabs/TabsContent.svelte +20 -0
- package/templates/sveltekit/src/lib/components/ui/tabs/TabsList.svelte +17 -0
- package/templates/sveltekit/src/lib/components/ui/tabs/TabsTrigger.svelte +20 -0
- package/templates/sveltekit/src/lib/components/ui/tabs/index.ts +7 -0
- package/templates/sveltekit/src/lib/components/ui/textarea/Textarea.svelte +30 -0
- package/templates/sveltekit/src/lib/components/ui/textarea/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/ui/toggle/Toggle.svelte +44 -0
- package/templates/sveltekit/src/lib/components/ui/toggle/index.ts +1 -0
- package/templates/sveltekit/src/lib/components/ui/tooltip/TooltipContent.svelte +22 -0
- package/templates/sveltekit/src/lib/components/ui/tooltip/index.ts +6 -0
- package/templates/sveltekit/src/lib/config/components.ts +306 -0
- package/templates/sveltekit/src/lib/config/docs.ts +356 -0
- package/templates/sveltekit/src/lib/config/site.ts +15 -0
- package/templates/sveltekit/src/lib/types/docs.ts +50 -0
- package/templates/sveltekit/src/lib/types/nav.ts +18 -0
- package/templates/sveltekit/src/lib/utils.ts +75 -0
- package/templates/sveltekit/src/routes/+layout.svelte +99 -0
- package/templates/sveltekit/src/routes/+layout.ts +4 -0
- package/templates/sveltekit/src/routes/+page.svelte +0 -0
- package/templates/sveltekit/src/routes/+page.ts +6 -0
- package/templates/sveltekit/src/routes/authentication/+page.svelte +73 -0
- package/templates/sveltekit/src/routes/authentication/+page.ts +7 -0
- package/templates/sveltekit/src/routes/authentication/UserAuthForm.svelte +61 -0
- package/templates/sveltekit/src/routes/cards/+page.svelte +44 -0
- package/templates/sveltekit/src/routes/cards/+page.ts +7 -0
- package/templates/sveltekit/src/routes/cards/CookieSettings.svelte +52 -0
- package/templates/sveltekit/src/routes/cards/CreateAccount.svelte +52 -0
- package/templates/sveltekit/src/routes/cards/DemoContainer.svelte +10 -0
- package/templates/sveltekit/src/routes/cards/Notifications.svelte +38 -0
- package/templates/sveltekit/src/routes/cards/PaymentMethod.svelte +110 -0
- package/templates/sveltekit/src/routes/cards/ReportAnIssue.svelte +71 -0
- package/templates/sveltekit/src/routes/cards/ShareDocument.svelte +91 -0
- package/templates/sveltekit/src/routes/dashboard/+page.svelte +5 -0
- package/templates/sveltekit/src/routes/dashboard/+page.ts +7 -0
- package/templates/sveltekit/src/routes/forms/+page.svelte +0 -0
- package/templates/sveltekit/src/routes/music/+page.svelte +0 -0
- package/templates/sveltekit/src/routes/music/albums.ts +61 -0
- package/templates/sveltekit/src/routes/music/playlists.ts +16 -0
- package/templates/sveltekit/src/routes/playground/+page.svelte +0 -0
- package/templates/sveltekit/src/routes/tasks/+page.svelte +0 -0
- package/templates/sveltekit/src/styles/globals.css +125 -0
- package/templates/sveltekit/src/styles/mdsvex.css +80 -0
- package/templates/sveltekit/src-tauri/Cargo.lock +3639 -0
- package/templates/sveltekit/src-tauri/Cargo.toml +34 -0
- package/templates/sveltekit/src-tauri/build.rs +3 -0
- package/templates/sveltekit/src-tauri/icons/128x128.png +0 -0
- package/templates/sveltekit/src-tauri/icons/128x128@2x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/32x32.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square107x107Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square142x142Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square150x150Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square284x284Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square30x30Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square310x310Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square44x44Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square71x71Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/Square89x89Logo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/StoreLogo.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/sveltekit/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/templates/sveltekit/src-tauri/icons/icon.icns +0 -0
- package/templates/sveltekit/src-tauri/icons/icon.ico +0 -0
- package/templates/sveltekit/src-tauri/icons/icon.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-20x20@1x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-20x20@2x-1.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-20x20@2x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-20x20@3x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-29x29@1x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-29x29@2x-1.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-29x29@2x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-29x29@3x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-40x40@1x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-40x40@2x-1.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-40x40@2x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-40x40@3x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-512@2x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-60x60@2x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-60x60@3x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-76x76@1x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-76x76@2x.png +0 -0
- package/templates/sveltekit/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png +0 -0
- package/templates/sveltekit/src-tauri/src/main.rs +16 -0
- package/templates/sveltekit/src-tauri/tauri.conf.json +62 -0
- package/templates/sveltekit/static/avatars/01.png +0 -0
- package/templates/sveltekit/static/avatars/02.png +0 -0
- package/templates/sveltekit/static/avatars/03.png +0 -0
- package/templates/sveltekit/static/avatars/04.png +0 -0
- package/templates/sveltekit/static/avatars/05.png +0 -0
- package/templates/sveltekit/static/favicon.ico +0 -0
- package/templates/sveltekit/svelte.config.js +22 -0
- package/templates/sveltekit/tailwind.config.js +64 -0
- package/templates/sveltekit/tsconfig.json +13 -0
- package/templates/sveltekit/vite.config.js +6 -0
package/dist/index.mjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import y from"node:fs";import x from"node:path";import{fileURLToPath as ie}from"node:url";import re from"readline";import M from"sisteransi";import ne from"events";import vt from"@iarna/toml";function wt(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function oe(s,t){var e=s;t.slice(0,-1).forEach(function(n){e=e[n]||{}});var i=t[t.length-1];return i in e}function yt(s){return typeof s=="number"||/^0x[0-9a-f]+$/i.test(s)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(s)}function $t(s,t){return t==="constructor"&&typeof s[t]=="function"||t==="__proto__"}var le=function(s,t){t||(t={});var e={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(e.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?e.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(a){e.bools[a]=!0});var i={};function n(a){return i[a].some(function(v){return e.bools[v]})}Object.keys(t.alias||{}).forEach(function(a){i[a]=[].concat(t.alias[a]),i[a].forEach(function(v){i[v]=[a].concat(i[a].filter(function(E){return v!==E}))})}),[].concat(t.string).filter(Boolean).forEach(function(a){e.strings[a]=!0,i[a]&&[].concat(i[a]).forEach(function(v){e.strings[v]=!0})});var o=t.default||{},r={_:[]};function l(a,v){return e.allBools&&/^--[^=]+$/.test(v)||e.strings[a]||e.bools[a]||i[a]}function f(a,v,E){for(var m=a,
|
|
1
|
+
import y from"node:fs";import x from"node:path";import{fileURLToPath as ie}from"node:url";import re from"readline";import M from"sisteransi";import ne from"events";import vt from"@iarna/toml";function wt(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function oe(s,t){var e=s;t.slice(0,-1).forEach(function(n){e=e[n]||{}});var i=t[t.length-1];return i in e}function yt(s){return typeof s=="number"||/^0x[0-9a-f]+$/i.test(s)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(s)}function $t(s,t){return t==="constructor"&&typeof s[t]=="function"||t==="__proto__"}var le=function(s,t){t||(t={});var e={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(e.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?e.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(a){e.bools[a]=!0});var i={};function n(a){return i[a].some(function(v){return e.bools[v]})}Object.keys(t.alias||{}).forEach(function(a){i[a]=[].concat(t.alias[a]),i[a].forEach(function(v){i[v]=[a].concat(i[a].filter(function(E){return v!==E}))})}),[].concat(t.string).filter(Boolean).forEach(function(a){e.strings[a]=!0,i[a]&&[].concat(i[a]).forEach(function(v){e.strings[v]=!0})});var o=t.default||{},r={_:[]};function l(a,v){return e.allBools&&/^--[^=]+$/.test(v)||e.strings[a]||e.bools[a]||i[a]}function f(a,v,E){for(var m=a,J=0;J<v.length-1;J++){var T=v[J];if($t(m,T))return;m[T]===void 0&&(m[T]={}),(m[T]===Object.prototype||m[T]===Number.prototype||m[T]===String.prototype)&&(m[T]={}),m[T]===Array.prototype&&(m[T]=[]),m=m[T]}var I=v[v.length-1];$t(m,I)||((m===Object.prototype||m===Number.prototype||m===String.prototype)&&(m={}),m===Array.prototype&&(m=[]),m[I]===void 0||e.bools[I]||typeof m[I]=="boolean"?m[I]=E:Array.isArray(m[I])?m[I].push(E):m[I]=[m[I],E])}function u(a,v,E){if(!(E&&e.unknownFn&&!l(a,E)&&e.unknownFn(E)===!1)){var m=!e.strings[a]&&yt(v)?Number(v):v;f(r,a.split("."),m),(i[a]||[]).forEach(function(J){f(r,J.split("."),m)})}}Object.keys(e.bools).forEach(function(a){u(a,o[a]===void 0?!1:o[a])});var S=[];s.indexOf("--")!==-1&&(S=s.slice(s.indexOf("--")+1),s=s.slice(0,s.indexOf("--")));for(var g=0;g<s.length;g++){var h=s[g],c,w;if(/^--.+=/.test(h)){var O=h.match(/^--([^=]+)=([\s\S]*)$/);c=O[1];var H=O[2];e.bools[c]&&(H=H!=="false"),u(c,H,h)}else if(/^--no-.+/.test(h))c=h.match(/^--no-(.+)/)[1],u(c,!1,h);else if(/^--.+/.test(h))c=h.match(/^--(.+)/)[1],w=s[g+1],w!==void 0&&!/^(-|--)[^-]/.test(w)&&!e.bools[c]&&!e.allBools&&(!i[c]||!n(c))?(u(c,w,h),g+=1):/^(true|false)$/.test(w)?(u(c,w==="true",h),g+=1):u(c,e.strings[c]?"":!0,h);else if(/^-[^-]+/.test(h)){for(var $=h.slice(1,-1).split(""),j=!1,d=0;d<$.length;d++){if(w=h.slice(d+2),w==="-"){u($[d],w,h);continue}if(/[A-Za-z]/.test($[d])&&w[0]==="="){u($[d],w.slice(1),h),j=!0;break}if(/[A-Za-z]/.test($[d])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(w)){u($[d],w,h),j=!0;break}if($[d+1]&&$[d+1].match(/\W/)){u($[d],h.slice(d+2),h),j=!0;break}else u($[d],e.strings[$[d]]?"":!0,h)}c=h.slice(-1)[0],!j&&c!=="-"&&(s[g+1]&&!/^(-|--)[^-]/.test(s[g+1])&&!e.bools[c]&&(!i[c]||!n(c))?(u(c,s[g+1],h),g+=1):s[g+1]&&/^(true|false)$/.test(s[g+1])?(u(c,s[g+1]==="true",h),g+=1):u(c,e.strings[c]?"":!0,h))}else if((!e.unknownFn||e.unknownFn(h)!==!1)&&r._.push(e.strings._||!yt(h)?h:Number(h)),t.stopEarly){r._.push.apply(r._,s.slice(g+1));break}}return Object.keys(o).forEach(function(a){oe(r,a.split("."))||(f(r,a.split("."),o[a]),(i[a]||[]).forEach(function(v){f(r,v.split("."),o[a])}))}),t["--"]?r["--"]=S.slice():S.forEach(function(a){r._.push(a)}),r};const he=wt(le);var xt={};const{FORCE_COLOR:ae,NODE_DISABLE_COLORS:ue,TERM:ce}=process.env,p={enabled:!ue&&ce!=="dumb"&&ae!=="0",reset:b(0,0),bold:b(1,22),dim:b(2,22),italic:b(3,23),underline:b(4,24),inverse:b(7,27),hidden:b(8,28),strikethrough:b(9,29),black:b(30,39),red:b(31,39),green:b(32,39),yellow:b(33,39),blue:b(34,39),magenta:b(35,39),cyan:b(36,39),white:b(37,39),gray:b(90,39),grey:b(90,39),bgBlack:b(40,49),bgRed:b(41,49),bgGreen:b(42,49),bgYellow:b(43,49),bgBlue:b(44,49),bgMagenta:b(45,49),bgCyan:b(46,49),bgWhite:b(47,49)};function St(s,t){let e=0,i,n="",o="";for(;e<s.length;e++)i=s[e],n+=i.open,o+=i.close,t.includes(i.close)&&(t=t.replace(i.rgx,i.close+i.open));return n+t+o}function de(s,t){let e={has:s,keys:t};return e.reset=p.reset.bind(e),e.bold=p.bold.bind(e),e.dim=p.dim.bind(e),e.italic=p.italic.bind(e),e.underline=p.underline.bind(e),e.inverse=p.inverse.bind(e),e.hidden=p.hidden.bind(e),e.strikethrough=p.strikethrough.bind(e),e.black=p.black.bind(e),e.red=p.red.bind(e),e.green=p.green.bind(e),e.yellow=p.yellow.bind(e),e.blue=p.blue.bind(e),e.magenta=p.magenta.bind(e),e.cyan=p.cyan.bind(e),e.white=p.white.bind(e),e.gray=p.gray.bind(e),e.grey=p.grey.bind(e),e.bgBlack=p.bgBlack.bind(e),e.bgRed=p.bgRed.bind(e),e.bgGreen=p.bgGreen.bind(e),e.bgYellow=p.bgYellow.bind(e),e.bgBlue=p.bgBlue.bind(e),e.bgMagenta=p.bgMagenta.bind(e),e.bgCyan=p.bgCyan.bind(e),e.bgWhite=p.bgWhite.bind(e),e}function b(s,t){let e={open:`\x1B[${s}m`,close:`\x1B[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(s)||(this.has.push(s),this.keys.push(e)),i===void 0?this:p.enabled?St(this.keys,i+""):i+""):i===void 0?de([s],[e]):p.enabled?St([e],i+""):i+""}}var P=p,fe=(s,t)=>{if(!(s.meta&&s.name!=="escape")){if(s.ctrl){if(s.name==="a")return"first";if(s.name==="c"||s.name==="d")return"abort";if(s.name==="e")return"last";if(s.name==="g")return"reset"}if(t){if(s.name==="j")return"down";if(s.name==="k")return"up"}return s.name==="return"||s.name==="enter"?"submit":s.name==="backspace"?"delete":s.name==="delete"?"deleteForward":s.name==="abort"?"abort":s.name==="escape"?"exit":s.name==="tab"?"next":s.name==="pagedown"?"nextPage":s.name==="pageup"?"prevPage":s.name==="home"?"home":s.name==="end"?"end":s.name==="up"?"up":s.name==="down"?"down":s.name==="right"?"right":s.name==="left"?"left":!1}},rt=s=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),e=new RegExp(t,"g");return typeof s=="string"?s.replace(e,""):s};const pe=rt,{erase:Ot,cursor:me}=M,ge=s=>[...pe(s)].length;var be=function(s,t){if(!t)return Ot.line+me.to(0);let e=0;const i=s.split(/\r?\n/);for(let n of i)e+=1+Math.floor(Math.max(ge(n)-1,0)/t);return Ot.lines(e)};const G={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},ve={arrowUp:G.arrowUp,arrowDown:G.arrowDown,arrowLeft:G.arrowLeft,arrowRight:G.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},we=process.platform==="win32"?ve:G;var Mt=we;const k=P,Y=Mt,nt=Object.freeze({password:{scale:1,render:s=>"*".repeat(s.length)},emoji:{scale:2,render:s=>"\u{1F603}".repeat(s.length)},invisible:{scale:0,render:s=>""},default:{scale:1,render:s=>`${s}`}}),ye=s=>nt[s]||nt.default,W=Object.freeze({aborted:k.red(Y.cross),done:k.green(Y.tick),exited:k.yellow(Y.cross),default:k.cyan("?")}),$e=(s,t,e)=>t?W.aborted:e?W.exited:s?W.done:W.default,xe=s=>k.gray(s?Y.ellipsis:Y.pointerSmall),Se=(s,t)=>k.gray(s?t?Y.pointerSmall:"+":Y.line);var Oe={styles:nt,render:ye,symbols:W,symbol:$e,delimiter:xe,item:Se};const Me=rt;var Pe=function(s,t){let e=String(Me(s)||"").split(/\r?\n/);return t?e.map(i=>Math.ceil(i.length/t)).reduce((i,n)=>i+n):e.length},Te=(s,t={})=>{const e=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",i=t.width;return(s||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((o,r)=>(r.length+e.length>=i||o[o.length-1].length+r.length+1<i?o[o.length-1]+=` ${r}`:o.push(`${e}${r}`),o),[e]).join(`
|
|
2
2
|
`)).join(`
|
|
3
|
-
`)},Ce=(s,t,e)=>{e=e||t;let i=Math.min(t-e,s-Math.floor(e/2));i<0&&(i=0);let n=Math.min(i+e,t);return{startIndex:i,endIndex:n}},C={action:fe,clear:be,style:Oe,strip:rt,figures:Mt,lines:Pe,wrap:Te,entriesToDisplay:Ce};const Pt=re,{action:De}=C,Ee=ne,{beep:Ie,cursor:_e}=M,Re=P;let Ae=class extends Ee{constructor(t={}){super(),this.firstRender=!0,this.in=t.stdin||process.stdin,this.out=t.stdout||process.stdout,this.onRender=(t.onRender||(()=>{})).bind(this);const e=Pt.createInterface({input:this.in,escapeCodeTimeout:50});Pt.emitKeypressEvents(this.in,e),this.in.isTTY&&this.in.setRawMode(!0);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(o,r)=>{let l=De(r,i);l===!1?this._&&this._(o,r):typeof this[l]=="function"?this[l](r):this.bell()};this.close=()=>{this.out.write(_e.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(!1),e.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",n)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Ie)}render(){this.onRender(Re),this.firstRender&&(this.firstRender=!1)}};var F=Ae;const X=P,je=F,{erase:Fe,cursor:
|
|
3
|
+
`)},Ce=(s,t,e)=>{e=e||t;let i=Math.min(t-e,s-Math.floor(e/2));i<0&&(i=0);let n=Math.min(i+e,t);return{startIndex:i,endIndex:n}},C={action:fe,clear:be,style:Oe,strip:rt,figures:Mt,lines:Pe,wrap:Te,entriesToDisplay:Ce};const Pt=re,{action:De}=C,Ee=ne,{beep:Ie,cursor:_e}=M,Re=P;let Ae=class extends Ee{constructor(t={}){super(),this.firstRender=!0,this.in=t.stdin||process.stdin,this.out=t.stdout||process.stdout,this.onRender=(t.onRender||(()=>{})).bind(this);const e=Pt.createInterface({input:this.in,escapeCodeTimeout:50});Pt.emitKeypressEvents(this.in,e),this.in.isTTY&&this.in.setRawMode(!0);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(o,r)=>{let l=De(r,i);l===!1?this._&&this._(o,r):typeof this[l]=="function"?this[l](r):this.bell()};this.close=()=>{this.out.write(_e.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(!1),e.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",n)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Ie)}render(){this.onRender(Re),this.firstRender&&(this.firstRender=!1)}};var F=Ae;const X=P,je=F,{erase:Fe,cursor:K}=M,{style:ot,clear:lt,lines:Ne,figures:Le}=C;class Ye extends je{constructor(t={}){super(t),this.transform=ot.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=lt("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=X.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|
4
4
|
`),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
5
|
-
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t)}_(t,e){let i=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${i}${t}${n}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),e=this.value.slice(this.cursor);this.value=`${t}${e}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor),e=this.value.slice(this.cursor+1);this.value=`${t}${e}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(
|
|
5
|
+
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t)}_(t,e){let i=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${i}${t}${n}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),e=this.value.slice(this.cursor);this.value=`${t}${e}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor),e=this.value.slice(this.cursor+1);this.value=`${t}${e}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(K.down(Ne(this.outputError,this.out.columns)-1)+lt(this.outputError,this.out.columns)),this.out.write(lt(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[ot.symbol(this.done,this.aborted),X.bold(this.msg),ot.delimiter(this.done),this.red?X.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
6
6
|
`).reduce((t,e,i)=>t+`
|
|
7
|
-
${i?" ":Le.pointerSmall} ${X.red().italic(e)}`,"")),this.out.write(Fe.line+
|
|
7
|
+
${i?" ":Le.pointerSmall} ${X.red().italic(e)}`,"")),this.out.write(Fe.line+K.to(0)+this.outputText+K.save+this.outputError+K.restore+K.move(this.cursorOffset,0)))}}var Ve=Ye;const _=P,He=F,{style:Tt,clear:Ct,figures:Q,wrap:ke,entriesToDisplay:Be}=C,{cursor:Ue}=M;class ze extends He{constructor(t={}){super(t),this.msg=t.message,this.hint=t.hint||"- Use arrow-keys. Return to submit.",this.warn=t.warn||"- This option is disabled",this.cursor=t.initial||0,this.choices=t.choices.map((e,i)=>(typeof e=="string"&&(e={title:e,value:i}),{title:e&&(e.title||e.value||e),value:e&&(e.value===void 0?i:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled})),this.optionsPerPage=t.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=Ct("",this.out.columns),this.render()}moveCursor(t){this.cursor=t,this.value=this.choices[t].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
8
8
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
9
|
-
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(t,e){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Ue.hide):this.out.write(Ct(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:e}=
|
|
9
|
+
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(t,e){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Ue.hide):this.out.write(Ct(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:e}=Be(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[Tt.symbol(this.done,this.aborted),_.bold(this.msg),Tt.delimiter(!1),this.done?this.selection.title:this.selection.disabled?_.yellow(this.warn):_.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|
10
10
|
`;for(let i=t;i<e;i++){let n,o,r="",l=this.choices[i];i===t&&t>0?o=Q.arrowUp:i===e-1&&e<this.choices.length?o=Q.arrowDown:o=" ",l.disabled?(n=this.cursor===i?_.gray().underline(l.title):_.strikethrough().gray(l.title),o=(this.cursor===i?_.bold().gray(Q.pointer)+" ":" ")+o):(n=this.cursor===i?_.cyan().underline(l.title):l.title,o=(this.cursor===i?_.cyan(Q.pointer)+" ":" ")+o,l.description&&this.cursor===i&&(r=` - ${l.description}`,(o.length+n.length+r.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(r=`
|
|
11
|
-
`+
|
|
11
|
+
`+ke(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${_.gray(r)}
|
|
12
12
|
`}}this.out.write(this.outputText)}}var Je=ze;const tt=P,Ge=F,{style:Dt,clear:We}=C,{cursor:Et,erase:Ke}=M;class Ze extends Ge{constructor(t={}){super(t),this.msg=t.message,this.value=!!t.initial,this.active=t.active||"on",this.inactive=t.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
13
13
|
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
14
14
|
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(t,e){if(t===" ")this.value=!this.value;else if(t==="1")this.value=!0;else if(t==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(Et.hide):this.out.write(We(this.outputText,this.out.columns)),super.render(),this.outputText=[Dt.symbol(this.done,this.aborted),tt.bold(this.msg),Dt.delimiter(this.done),this.value?this.inactive:tt.cyan().underline(this.inactive),tt.gray("/"),this.value?tt.cyan().underline(this.active):this.active].join(" "),this.out.write(Ke.line+Et.to(0)+this.outputText))}}var qe=Ze;let Xe=class bt{constructor({token:t,date:e,parts:i,locales:n}){this.token=t,this.date=e||new Date,this.parts=i||[this],this.locales=n||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find((e,i)=>i>t&&e instanceof bt)}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const e=t.indexOf(this);return t.find((i,n)=>n>e&&i instanceof bt)}toString(){return String(this.date)}};var R=Xe;const Qe=R;let ts=class extends Qe{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}};var es=ts;const ss=R,is=s=>(s=s%10,s===1?"st":s===2?"nd":s===3?"rd":"th");let rs=class extends ss{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate(),e=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+is(t):this.token==="d"?e+1:this.token==="ddd"?this.locales.weekdaysShort[e]:this.token==="dddd"?this.locales.weekdays[e]:t}};var ns=rs;const os=R;let ls=class extends os{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}};var hs=ls;const as=R;let us=class extends as{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};var cs=us;const ds=R;let fs=class extends ds{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}};var ps=fs;const ms=R;let gs=class extends ms{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),e=this.token.length;return e===2?String(t+1).padStart(2,"0"):e===3?this.locales.monthsShort[t]:e===4?this.locales.months[t]:String(t+1)}};var bs=gs;const vs=R;let ws=class extends vs{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}};var ys=ws;const $s=R;let xs=class extends $s{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}};var Ss=xs,Os={DatePart:R,Meridiem:es,Day:ns,Hours:hs,Milliseconds:cs,Minutes:ps,Month:bs,Seconds:ys,Year:Ss};const ht=P,Ms=F,{style:It,clear:_t,figures:Ps}=C,{erase:Ts,cursor:Rt}=M,{DatePart:At,Meridiem:Cs,Day:Ds,Hours:Es,Milliseconds:Is,Minutes:_s,Month:Rs,Seconds:As,Year:js}=Os,Fs=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,jt={1:({token:s})=>s.replace(/\\(.)/g,"$1"),2:s=>new Ds(s),3:s=>new Rs(s),4:s=>new js(s),5:s=>new Cs(s),6:s=>new Es(s),7:s=>new _s(s),8:s=>new As(s),9:s=>new Is(s)},Ns={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class Ls extends Ms{constructor(t={}){super(t),this.msg=t.message,this.cursor=0,this.typed="",this.locales=Object.assign(Ns,t.locales),this._date=t.initial||new Date,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.mask=t.mask||"YYYY-MM-DD HH:mm:ss",this.clear=_t("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(t){t&&this._date.setTime(t.getTime())}set mask(t){let e;for(this.parts=[];e=Fs.exec(t);){let n=e.shift(),o=e.findIndex(r=>r!=null);this.parts.push(o in jt?jt[o]({token:e[o]||n,date:this.date,parts:this.parts,locales:this.locales}):e[o]||n)}let i=this.parts.reduce((n,o)=>(typeof o=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]+=o:n.push(o),n),[]);this.parts.splice(0),this.parts.push(...i),this.reset()}moveCursor(t){this.typed="",this.cursor=t,this.fire()}reset(){this.moveCursor(this.parts.findIndex(t=>t instanceof At)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
15
15
|
`),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
16
16
|
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex(e=>e instanceof At)),this.render()}_(t){/\d/.test(t)&&(this.typed+=t,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(Rt.hide):this.out.write(_t(this.outputText,this.out.columns)),super.render(),this.outputText=[It.symbol(this.done,this.aborted),ht.bold(this.msg),It.delimiter(!1),this.parts.reduce((t,e,i)=>t.concat(i===this.cursor&&!this.done?ht.cyan().underline(e.toString()):e),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
17
17
|
`).reduce((t,e,i)=>t+`
|
|
18
|
-
${i?" ":Ps.pointerSmall} ${ht.red().italic(e)}`,"")),this.out.write(Ts.line+Rt.to(0)+this.outputText))}}var Ys=Ls;const et=P,Vs=F,{cursor:st,erase:Hs}=M,{style:at,figures:
|
|
18
|
+
${i?" ":Ps.pointerSmall} ${ht.red().italic(e)}`,"")),this.out.write(Ts.line+Rt.to(0)+this.outputText))}}var Ys=Ls;const et=P,Vs=F,{cursor:st,erase:Hs}=M,{style:at,figures:ks,clear:Ft,lines:Bs}=C,Us=/[0-9]/,ut=s=>s!==void 0,Nt=(s,t)=>{let e=Math.pow(10,t);return Math.round(s*e)/e};class zs extends Vs{constructor(t={}){super(t),this.transform=at.render(t.style),this.msg=t.message,this.initial=ut(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=ut(t.min)?t.min:-1/0,this.max=ut(t.max)?t.max:1/0,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(t){!t&&t!==0?(this.placeholder=!0,this.rendered=et.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${Nt(t,this.round)}`),this._value=Nt(t,this.round)),this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t==="-"||t==="."&&this.float||Us.test(t)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==""?t:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
19
19
|
`),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let t=this.value;this.value=t!==""?t:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
20
|
-
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(t,e){if(!this.valid(t))return this.bell();const i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=t,this.lastHit=i,this.color="cyan",t===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(st.down(
|
|
20
|
+
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(t,e){if(!this.valid(t))return this.bell();const i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=t,this.lastHit=i,this.color="cyan",t===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(st.down(Bs(this.outputError,this.out.columns)-1)+Ft(this.outputError,this.out.columns)),this.out.write(Ft(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[at.symbol(this.done,this.aborted),et.bold(this.msg),at.delimiter(this.done),!this.done||!this.done&&!this.placeholder?et[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
21
21
|
`).reduce((t,e,i)=>t+`
|
|
22
|
-
${i?" ":
|
|
22
|
+
${i?" ":ks.pointerSmall} ${et.red().italic(e)}`,"")),this.out.write(Hs.line+st.to(0)+this.outputText+st.save+this.outputError+st.restore))}}var Js=zs;const D=P,{cursor:Gs}=M,Ws=F,{clear:Lt,figures:N,style:Yt,wrap:Ks,entriesToDisplay:Zs}=C;let qs=class extends Ws{constructor(t={}){super(t),this.msg=t.message,this.cursor=t.cursor||0,this.scrollIndex=t.cursor||0,this.hint=t.hint||"",this.warn=t.warn||"- This option is disabled -",this.minSelected=t.min,this.showMinError=!1,this.maxChoices=t.max,this.instructions=t.instructions,this.optionsPerPage=t.optionsPerPage||10,this.value=t.choices.map((e,i)=>(typeof e=="string"&&(e={title:e,value:i}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(e.value===void 0?i:e.value),selected:e&&e.selected,disabled:e&&e.disabled})),this.clear=Lt("",this.out.columns),t.overrideRender||this.render()}reset(){this.value.map(t=>!t.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(t=>t.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
23
23
|
`),this.close()}submit(){const t=this.value.filter(e=>e.selected);this.minSelected&&t.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
24
24
|
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const t=!this.value[this.cursor].selected;this.value.filter(e=>!e.disabled).forEach(e=>e.selected=t),this.render()}_(t,e){if(t===" ")this.handleSpaceToggle();else if(t==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
25
25
|
Instructions:
|
|
@@ -29,25 +29,25 @@ Instructions:
|
|
|
29
29
|
`:"")+" enter/return: Complete answer":""}renderOption(t,e,i,n){const o=(e.selected?D.green(N.radioOn):N.radioOff)+" "+n+" ";let r,l;return e.disabled?r=t===i?D.gray().underline(e.title):D.strikethrough().gray(e.title):(r=t===i?D.cyan().underline(e.title):e.title,t===i&&e.description&&(l=` - ${e.description}`,(o.length+r.length+l.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(l=`
|
|
30
30
|
`+Ks(e.description,{margin:o.length,width:this.out.columns})))),o+r+D.gray(l||"")}paginateOptions(t){if(t.length===0)return D.red("No matches for this query.");let{startIndex:e,endIndex:i}=Zs(this.cursor,t.length,this.optionsPerPage),n,o=[];for(let r=e;r<i;r++)r===e&&e>0?n=N.arrowUp:r===i-1&&i<t.length?n=N.arrowDown:n=" ",o.push(this.renderOption(this.cursor,t[r],r,n));return`
|
|
31
31
|
`+o.join(`
|
|
32
|
-
`)}renderOptions(t){return this.done?"":this.paginateOptions(t)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");const t=[D.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(D.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Gs.hide),super.render();let t=[Yt.symbol(this.done,this.aborted),D.bold(this.msg),Yt.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=D.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=Lt(t,this.out.columns)}};var Vt=qs;const
|
|
32
|
+
`)}renderOptions(t){return this.done?"":this.paginateOptions(t)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");const t=[D.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(D.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Gs.hide),super.render();let t=[Yt.symbol(this.done,this.aborted),D.bold(this.msg),Yt.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=D.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=Lt(t,this.out.columns)}};var Vt=qs;const Z=P,Xs=F,{erase:Qs,cursor:Ht}=M,{style:ct,clear:kt,figures:dt,wrap:ti,entriesToDisplay:ei}=C,Bt=(s,t)=>s[t]&&(s[t].value||s[t].title||s[t]),si=(s,t)=>s[t]&&(s[t].title||s[t].value||s[t]),ii=(s,t)=>{const e=s.findIndex(i=>i.value===t||i.title===t);return e>-1?e:void 0};class ri extends Xs{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial=typeof t.initial=="number"?t.initial:ii(t.choices,t.initial),this.select=this.initial||t.cursor||0,this.i18n={noMatches:t.noMatches||"no matches found"},this.fallback=t.fallback||this.initial,this.clearFirst=t.clearFirst||!1,this.suggestions=[],this.input="",this.limit=t.limit||10,this.cursor=0,this.transform=ct.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=kt("",this.out.columns),this.complete(this.render),this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;return typeof this._fb=="number"?t=this.choices[this._fb]:typeof this._fb=="string"&&(t={title:this._fb}),t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t,this.suggestions.length>0?this.value=Bt(this.suggestions,t):this.value=this.fallback.value,this.fire()}async complete(t){const e=this.completing=this.suggest(this.input,this.choices),i=await e;if(this.completing!==e)return;this.suggestions=i.map((o,r,l)=>({title:si(l,r),value:Bt(l,r),description:o.description})),this.completing=!1;const n=Math.max(i.length-1,0);this.moveSelect(Math.min(n,this.select)),t&&t()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
33
33
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
34
34
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
35
|
-
`),this.close()}_(t,e){let i=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${i}${t}${n}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1),e=this.input.slice(this.cursor);this.input=`${t}${e}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),e=this.input.slice(this.cursor+1);this.input=`${t}${e}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(t,e,i,n){let o,r=i?dt.arrowUp:n?dt.arrowDown:" ",l=e?
|
|
36
|
-
`+ti(t.description,{margin:3,width:this.out.columns}))),r+" "+l+
|
|
35
|
+
`),this.close()}_(t,e){let i=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${i}${t}${n}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1),e=this.input.slice(this.cursor);this.input=`${t}${e}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),e=this.input.slice(this.cursor+1);this.input=`${t}${e}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(t,e,i,n){let o,r=i?dt.arrowUp:n?dt.arrowDown:" ",l=e?Z.cyan().underline(t.title):t.title;return r=(e?Z.cyan(dt.pointer)+" ":" ")+r,t.description&&(o=` - ${t.description}`,(r.length+l.length+o.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(o=`
|
|
36
|
+
`+ti(t.description,{margin:3,width:this.out.columns}))),r+" "+l+Z.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Ht.hide):this.out.write(kt(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:e}=ei(this.select,this.choices.length,this.limit);if(this.outputText=[ct.symbol(this.done,this.aborted,this.exited),Z.bold(this.msg),ct.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const i=this.suggestions.slice(t,e).map((n,o)=>this.renderOption(n,this.select===o+t,o===0&&t>0,o+t===e-1&&e<this.choices.length)).join(`
|
|
37
37
|
`);this.outputText+=`
|
|
38
|
-
`+(i||
|
|
38
|
+
`+(i||Z.gray(this.fallback.title))}this.out.write(Qs.line+Ht.to(0)+this.outputText)}}var ni=ri;const A=P,{cursor:oi}=M,li=Vt,{clear:Ut,style:zt,figures:B}=C;class hi extends li{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=Ut("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const e=this.filteredOptions.findIndex(i=>i===t);this.cursor=e<0?0:e,this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions()}_(t,e){t===" "?this.handleSpaceToggle():this.handleInputChange(t)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
39
39
|
Instructions:
|
|
40
|
-
${
|
|
41
|
-
${
|
|
40
|
+
${B.arrowUp}/${B.arrowDown}: Highlight option
|
|
41
|
+
${B.arrowLeft}/${B.arrowRight}/[space]: Toggle selection
|
|
42
42
|
[a,b,c]/delete: Filter choices
|
|
43
43
|
enter/return: Complete answer
|
|
44
44
|
`:""}renderCurrentInput(){return`
|
|
45
45
|
Filtered results for: ${this.inputValue?this.inputValue:A.gray("Enter something to filter")}
|
|
46
|
-
`}renderOption(t,e,i){let n;return e.disabled?n=t===i?A.gray().underline(e.title):A.strikethrough().gray(e.title):n=t===i?A.cyan().underline(e.title):e.title,(e.selected?A.green(
|
|
46
|
+
`}renderOption(t,e,i){let n;return e.disabled?n=t===i?A.gray().underline(e.title):A.strikethrough().gray(e.title):n=t===i?A.cyan().underline(e.title):e.title,(e.selected?A.green(B.radioOn):B.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");const t=[A.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(A.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(oi.hide),super.render();let t=[zt.symbol(this.done,this.aborted),A.bold(this.msg),zt.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=A.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=Ut(t,this.out.columns)}}var ai=hi;const Jt=P,ui=F,{style:Gt,clear:ci}=C,{erase:di,cursor:Wt}=M;class fi extends ui{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
47
47
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
48
|
-
`),this.close()}_(t,e){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Wt.hide):this.out.write(ci(this.outputText,this.out.columns)),super.render(),this.outputText=[Gt.symbol(this.done,this.aborted),Jt.bold(this.msg),Gt.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Jt.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(di.line+Wt.to(0)+this.outputText))}}var pi=fi,mi={TextPrompt:Ve,SelectPrompt:Je,TogglePrompt:qe,DatePrompt:Ys,NumberPrompt:Js,MultiselectPrompt:Vt,AutocompletePrompt:ni,AutocompleteMultiselectPrompt:ai,ConfirmPrompt:pi};(function(s){const t=s,e=mi,i=r=>r;function n(r,l,f={}){return new Promise((u,S)=>{const g=new e[r](l),h=f.onAbort||i,c=f.onSubmit||i,w=f.onExit||i;g.on("state",l.onState||i),g.on("submit",O=>u(c(O))),g.on("exit",O=>u(w(O))),g.on("abort",O=>S(h(O)))})}t.text=r=>n("TextPrompt",r),t.password=r=>(r.style="password",t.text(r)),t.invisible=r=>(r.style="invisible",t.text(r)),t.number=r=>n("NumberPrompt",r),t.date=r=>n("DatePrompt",r),t.confirm=r=>n("ConfirmPrompt",r),t.list=r=>{const l=r.separator||",";return n("TextPrompt",r,{onSubmit:f=>f.split(l).map(u=>u.trim())})},t.toggle=r=>n("TogglePrompt",r),t.select=r=>n("SelectPrompt",r),t.multiselect=r=>{r.choices=[].concat(r.choices||[]);const l=f=>f.filter(u=>u.selected).map(u=>u.value);return n("MultiselectPrompt",r,{onAbort:l,onSubmit:l})},t.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);const l=f=>f.filter(u=>u.selected).map(u=>u.value);return n("AutocompleteMultiselectPrompt",r,{onAbort:l,onSubmit:l})};const o=(r,l)=>Promise.resolve(l.filter(f=>f.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));t.autocomplete=r=>(r.suggest=r.suggest||o,r.choices=[].concat(r.choices||[]),n("AutocompletePrompt",r))})(xt);const ft=xt,gi=["suggest","format","onState","validate","onRender","type"],Kt=()=>{};async function L(s=[],{onSubmit:t=Kt,onCancel:e=Kt}={}){const i={},n=L._override||{};s=[].concat(s);let o,r,l,f,u,S;const g=async(h,c,w=!1)=>{if(!(!w&&h.validate&&h.validate(c)!==!0))return h.format?await h.format(c,i):c};for(r of s)if({name:f,type:u}=r,typeof u=="function"&&(u=await u(o,{...i},r),r.type=u),!!u){for(let h in r){if(gi.includes(h))continue;let c=r[h];r[h]=typeof c=="function"?await c(o,{...i},S):c}if(S=r,typeof r.message!="string")throw new Error("prompt message is required");if({name:f,type:u}=r,ft[u]===void 0)throw new Error(`prompt type (${u}) is not defined`);if(n[r.name]!==void 0&&(o=await g(r,n[r.name]),o!==void 0)){i[f]=o;continue}try{o=L._injected?bi(L._injected,r.initial):await ft[u](r),i[f]=o=await g(r,o,!0),l=await t(r,o,i)}catch{l=!await e(r,i)}if(l)return i}return i}function bi(s,t){const e=s.shift();if(e instanceof Error)throw e;return e===void 0?t:e}function vi(s){L._injected=(L._injected||[]).concat(s)}function wi(s){L._override=Object.assign({},s)}var yi=Object.assign(L,{prompt:L,prompts:ft,inject:vi,override:wi});const $i=wt(yi);let V=!0;const U=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let
|
|
49
|
-
Scaffolding project in ${
|
|
48
|
+
`),this.close()}_(t,e){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Wt.hide):this.out.write(ci(this.outputText,this.out.columns)),super.render(),this.outputText=[Gt.symbol(this.done,this.aborted),Jt.bold(this.msg),Gt.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Jt.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(di.line+Wt.to(0)+this.outputText))}}var pi=fi,mi={TextPrompt:Ve,SelectPrompt:Je,TogglePrompt:qe,DatePrompt:Ys,NumberPrompt:Js,MultiselectPrompt:Vt,AutocompletePrompt:ni,AutocompleteMultiselectPrompt:ai,ConfirmPrompt:pi};(function(s){const t=s,e=mi,i=r=>r;function n(r,l,f={}){return new Promise((u,S)=>{const g=new e[r](l),h=f.onAbort||i,c=f.onSubmit||i,w=f.onExit||i;g.on("state",l.onState||i),g.on("submit",O=>u(c(O))),g.on("exit",O=>u(w(O))),g.on("abort",O=>S(h(O)))})}t.text=r=>n("TextPrompt",r),t.password=r=>(r.style="password",t.text(r)),t.invisible=r=>(r.style="invisible",t.text(r)),t.number=r=>n("NumberPrompt",r),t.date=r=>n("DatePrompt",r),t.confirm=r=>n("ConfirmPrompt",r),t.list=r=>{const l=r.separator||",";return n("TextPrompt",r,{onSubmit:f=>f.split(l).map(u=>u.trim())})},t.toggle=r=>n("TogglePrompt",r),t.select=r=>n("SelectPrompt",r),t.multiselect=r=>{r.choices=[].concat(r.choices||[]);const l=f=>f.filter(u=>u.selected).map(u=>u.value);return n("MultiselectPrompt",r,{onAbort:l,onSubmit:l})},t.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);const l=f=>f.filter(u=>u.selected).map(u=>u.value);return n("AutocompleteMultiselectPrompt",r,{onAbort:l,onSubmit:l})};const o=(r,l)=>Promise.resolve(l.filter(f=>f.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));t.autocomplete=r=>(r.suggest=r.suggest||o,r.choices=[].concat(r.choices||[]),n("AutocompletePrompt",r))})(xt);const ft=xt,gi=["suggest","format","onState","validate","onRender","type"],Kt=()=>{};async function L(s=[],{onSubmit:t=Kt,onCancel:e=Kt}={}){const i={},n=L._override||{};s=[].concat(s);let o,r,l,f,u,S;const g=async(h,c,w=!1)=>{if(!(!w&&h.validate&&h.validate(c)!==!0))return h.format?await h.format(c,i):c};for(r of s)if({name:f,type:u}=r,typeof u=="function"&&(u=await u(o,{...i},r),r.type=u),!!u){for(let h in r){if(gi.includes(h))continue;let c=r[h];r[h]=typeof c=="function"?await c(o,{...i},S):c}if(S=r,typeof r.message!="string")throw new Error("prompt message is required");if({name:f,type:u}=r,ft[u]===void 0)throw new Error(`prompt type (${u}) is not defined`);if(n[r.name]!==void 0&&(o=await g(r,n[r.name]),o!==void 0)){i[f]=o;continue}try{o=L._injected?bi(L._injected,r.initial):await ft[u](r),i[f]=o=await g(r,o,!0),l=await t(r,o,i)}catch{l=!await e(r,i)}if(l)return i}return i}function bi(s,t){const e=s.shift();if(e instanceof Error)throw e;return e===void 0?t:e}function vi(s){L._injected=(L._injected||[]).concat(s)}function wi(s){L._override=Object.assign({},s)}var yi=Object.assign(L,{prompt:L,prompts:ft,inject:vi,override:wi});const $i=wt(yi);let V=!0;const U=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let q=0;if(U.process&&U.process.env&&U.process.stdout){const{FORCE_COLOR:s,NODE_DISABLE_COLORS:t,NO_COLOR:e,TERM:i,COLORTERM:n}=U.process.env;t||e||s==="0"?V=!1:s==="1"||s==="2"||s==="3"?V=!0:i==="dumb"?V=!1:"CI"in U.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(o=>o in U.process.env)?V=!0:V=process.stdout.isTTY,V&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?q=3:i&&(i.endsWith("-256color")||i.endsWith("256"))?q=2:q=1)}let Zt={enabled:V,supportLevel:q};function z(s,t,e=1){const i=`\x1B[${s}m`,n=`\x1B[${t}m`,o=new RegExp(`\\x1b\\[${t}m`,"g");return r=>Zt.enabled&&Zt.supportLevel>=e?i+(""+r).replace(o,i)+n:""+r}const it=z(0,0),qt=z(31,39),xi=z(32,39),Si=z(34,39),Oi=z(90,39),Mi=z(92,39);function Xt(s){return s?.trim().replace(/\/+$/g,"")}function Qt(s,t){y.statSync(s).isDirectory()?Ti(s,t):y.copyFileSync(s,t)}function te(s){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(s)}function Pi(s){return s.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function Ti(s,t){y.mkdirSync(t,{recursive:!0});for(const e of y.readdirSync(s)){const i=x.resolve(s,e),n=x.resolve(t,e);Qt(i,n)}}function Ci(s){const t=y.readdirSync(s);return t.length===0||t.length===1&&t[0]===".git"}function Di(s){if(y.existsSync(s))for(const t of y.readdirSync(s))t!==".git"&&y.rmSync(x.resolve(s,t),{recursive:!0,force:!0})}function Ei(s){if(!s)return;const t=s.split(" ")[0].split("/");return{name:t[0],version:t[1]}}const pt=he(process.argv.slice(2),{string:["_"]}),mt=process.cwd(),ee=[{name:"vite",display:"Vite + React \u26A1",color:Si},{name:"next",display:"Next.js \u25B2",color:Mi},{name:"sveltekit",display:"SvelteKit \u26A1",color:xi}],se=ee.map(s=>s.name),Ii={_gitignore:".gitignore"},gt="tauri-ui";async function _i(){const s=Xt(pt._[0]),t=pt.template||pt.t;let e=s||gt;const i=()=>e==="."?x.basename(x.resolve()):e,n=await $i([{type:s?null:"text",name:"projectName",message:it("Project name:"),initial:gt,onState:d=>{e=Xt(d.value)||gt}},{type:()=>!y.existsSync(e)||Ci(e)?null:"confirm",name:"overwrite",message:()=>(e==="."?"Current directory":`Target directory "${e}"`)+" is not empty. Remove existing files and continue?"},{type:(d,{overwrite:a})=>{if(a===!1)throw new Error(qt("\u2716")+" Operation cancelled");return null},name:"overwriteChecker"},{type:()=>te(i())?null:"text",name:"packageName",message:it("Package name:"),initial:()=>Pi(i()),validate:d=>te(d)||"Invalid package.json name"},{type:t&&se.includes(t)?null:"select",name:"framework",message:typeof t=="string"&&!se.includes(t)?it(`"${t}" isn't a valid template. Please choose from below: `):it("Select a framework:"),initial:0,choices:ee.map(d=>{const a=d.color;return{title:a(d.display||d.name),value:d}})}],{onCancel:()=>{throw new Error(qt("\u2716")+" Operation cancelled")}}),{framework:o,overwrite:r,packageName:l}=n,f=x.join(mt,e);r?Di(f):y.existsSync(f)||y.mkdirSync(f,{recursive:!0});let u=o?.name||t;const S=Ei(process.env.npm_config_user_agent),g=S?S.name:"npm";console.log(`
|
|
49
|
+
Scaffolding project in ${Oi(f)}`);const h=x.resolve(ie(import.meta.url),"../../templates/",u),c=(d,a)=>{const v=x.join(f,Ii[d]??d);a?y.writeFileSync(v,a):Qt(x.join(h,d),v)},w=y.readdirSync(h);for(const d of w.filter(a=>a!=="package.json"||"tauri.conf.json"))c(d);const O=JSON.parse(y.readFileSync(x.join(h,"package.json"),"utf-8"));O.name=l||i(),c("package.json",JSON.stringify(O,null,2)+`
|
|
50
50
|
`);const H=vt.parse(y.readFileSync(x.join(h,"/src-tauri/Cargo.toml"),"utf-8"));H.package.name=l||i(),c("/src-tauri/Cargo.toml",vt.stringify(H)+`
|
|
51
51
|
`);const $=JSON.parse(y.readFileSync(x.join(h,"/src-tauri/tauri.conf.json"),"utf-8"));$.tauri.windows[0].title=l||i(),$.package.productName=l||i(),c("/src-tauri/tauri.conf.json",JSON.stringify($,null,2)+`
|
|
52
52
|
`);const j=x.relative(mt,f);switch(console.log(`
|
|
53
|
-
Done. Now run:`),f!==mt&&console.log(` cd ${j.includes(" ")?`"${j}"`:j}`),g){case"yarn":console.log(" yarn"),console.log(" yarn tauri dev");break;case"pnpm":console.log(" pnpm i"),console.log(" pnpm tauri dev");break;default:console.log(` ${g} install`),console.log(` ${g} run tauri dev`);break}console.log()}
|
|
53
|
+
Done. Now run:`),f!==mt&&console.log(` cd ${j.includes(" ")?`"${j}"`:j}`),g){case"yarn":console.log(" yarn"),console.log(" yarn tauri dev");break;case"pnpm":console.log(" pnpm i"),console.log(" pnpm tauri dev");break;default:console.log(` ${g} install`),console.log(` ${g} run tauri dev`);break}console.log()}_i().catch(s=>{console.error(s)});
|
package/package.json
CHANGED
package/templates/next/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Tauri UI Template is a starting point for building modern desktop applications w
|
|
|
11
11
|
Use [create-tauri-ui](https://github.com/agmmnn/create-tauri-ui) to quickly scaffold a Tauri UI project.
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
|
|
14
|
+
pnpm create tauri-ui
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Or clone the repository:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
## https://github.com/huntabyte/shadcn-svelte
|
|
Binary file
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tauri-ui-svelte",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"private": true,
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "huntabyte",
|
|
7
|
+
"url": "https://twitter.com/huntabyte"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/huntabyte/shadcn-svelte.git",
|
|
12
|
+
"directory": "apps/www"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"scripts": {
|
|
16
|
+
"dev": "vite dev",
|
|
17
|
+
"build": "vite build",
|
|
18
|
+
"preview": "vite preview",
|
|
19
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
|
|
20
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
|
|
21
|
+
"lint": "prettier --plugin-search-dir . --check .",
|
|
22
|
+
"format": "prettier --plugin-search-dir . --write . --ignore-path .gitignore",
|
|
23
|
+
"taze": "taze major -I",
|
|
24
|
+
"taze:minor": "taze minor -w"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@tanstack/svelte-table": "^8.9.1",
|
|
28
|
+
"@tauri-apps/api": "2.0.0-alpha.4",
|
|
29
|
+
"@tauri-apps/plugin-window": "2.0.0-alpha.0",
|
|
30
|
+
"class-variance-authority": "^0.6.0",
|
|
31
|
+
"clsx": "^1.2.1",
|
|
32
|
+
"d3-scale": "^4.0.2",
|
|
33
|
+
"escape-html": "^1.0.3",
|
|
34
|
+
"esm-env": "^1.0.0",
|
|
35
|
+
"hast-util-to-html": "^8.0.4",
|
|
36
|
+
"lucide-svelte": "^0.236.0",
|
|
37
|
+
"mdast-util-to-string": "^3.2.0",
|
|
38
|
+
"radix-svelte": "^0.7.1",
|
|
39
|
+
"rehype-pretty-code": "^0.9.6",
|
|
40
|
+
"rehype-slug": "^5.1.0",
|
|
41
|
+
"rehype-stringify": "^9.0.3",
|
|
42
|
+
"remark-code-import": "^1.2.0",
|
|
43
|
+
"remark-gfm": "^3.0.1",
|
|
44
|
+
"shiki": "^0.14.2",
|
|
45
|
+
"svelte-legos": "^0.2.1",
|
|
46
|
+
"svelte-wrap-balancer": "^0.0.3",
|
|
47
|
+
"tailwind-merge": "^1.13.0",
|
|
48
|
+
"unified": "^10.1.2",
|
|
49
|
+
"unist-builder": "^3.0.1",
|
|
50
|
+
"unist-util-visit": "^4.1.2"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@sveltejs/adapter-auto": "^2.1.0",
|
|
54
|
+
"@sveltejs/adapter-static": "2.0.2",
|
|
55
|
+
"@sveltejs/kit": "^1.20.1",
|
|
56
|
+
"@tauri-apps/cli": "2.0.0-alpha.9",
|
|
57
|
+
"@types/d3-scale": "^4.0.3",
|
|
58
|
+
"@types/escape-html": "^1.0.2",
|
|
59
|
+
"@types/node": "^20.2.5",
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^5.59.8",
|
|
61
|
+
"@typescript-eslint/parser": "^5.59.8",
|
|
62
|
+
"autoprefixer": "^10.4.14",
|
|
63
|
+
"eslint": "^8.42.0",
|
|
64
|
+
"eslint-config-prettier": "^8.8.0",
|
|
65
|
+
"eslint-plugin-svelte": "^2.30.0",
|
|
66
|
+
"mdsvex": "0.10.6",
|
|
67
|
+
"postcss": "^8.4.24",
|
|
68
|
+
"postcss-load-config": "^4.0.1",
|
|
69
|
+
"prettier": "^2.8.8",
|
|
70
|
+
"prettier-plugin-svelte": "^2.10.1",
|
|
71
|
+
"prettier-plugin-tailwindcss": "^0.3.0",
|
|
72
|
+
"svelte": "^3.59.1",
|
|
73
|
+
"svelte-check": "^3.4.3",
|
|
74
|
+
"svelte-preprocess": "^5.0.4",
|
|
75
|
+
"tailwind-scrollbar": "^3.0.4",
|
|
76
|
+
"tailwindcss": "^3.3.2",
|
|
77
|
+
"tailwindcss-animate": "^1.0.5",
|
|
78
|
+
"tslib": "^2.5.3",
|
|
79
|
+
"tsx": "^3.12.7",
|
|
80
|
+
"typescript": "^5.1.3",
|
|
81
|
+
"vite": "^4.3.9",
|
|
82
|
+
"vitest": "^0.31.4"
|
|
83
|
+
}
|
|
84
|
+
}
|