create-tauri-ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -0
- package/dist/index.mjs +53 -0
- package/index.js +3 -0
- package/package.json +62 -0
- package/templates/next/.env +1 -0
- package/templates/next/.github/workflows/release.yml +108 -0
- package/templates/next/.vscode/extensions.json +3 -0
- package/templates/next/LICENSE +21 -0
- package/templates/next/README.md +82 -0
- package/templates/next/app-icon.png +0 -0
- package/templates/next/next-env.d.ts +5 -0
- package/templates/next/next.config.js +17 -0
- package/templates/next/package.json +82 -0
- package/templates/next/pnpm-lock.yaml +4318 -0
- package/templates/next/postcss.config.js +6 -0
- package/templates/next/prettier.config.js +35 -0
- package/templates/next/public/avatars/01.png +0 -0
- package/templates/next/public/avatars/02.png +0 -0
- package/templates/next/public/avatars/03.png +0 -0
- package/templates/next/public/avatars/04.png +0 -0
- package/templates/next/public/avatars/05.png +0 -0
- package/templates/next/src/app/examples/authentication/components/user-auth-form.tsx +71 -0
- package/templates/next/src/app/examples/authentication/page.tsx +80 -0
- package/templates/next/src/app/examples/cards/components/cookie-settings.tsx +60 -0
- package/templates/next/src/app/examples/cards/components/create-account.tsx +60 -0
- package/templates/next/src/app/examples/cards/components/date-picker.tsx +18 -0
- package/templates/next/src/app/examples/cards/components/github-card.tsx +81 -0
- package/templates/next/src/app/examples/cards/components/notifications.tsx +51 -0
- package/templates/next/src/app/examples/cards/components/payment-method.tsx +117 -0
- package/templates/next/src/app/examples/cards/components/report-an-issue.tsx +82 -0
- package/templates/next/src/app/examples/cards/components/share-document.tsx +116 -0
- package/templates/next/src/app/examples/cards/components/team-members.tsx +147 -0
- package/templates/next/src/app/examples/cards/page.tsx +75 -0
- package/templates/next/src/app/examples/cards/styles.css +63 -0
- package/templates/next/src/app/examples/dashboard/components/date-range-picker.tsx +66 -0
- package/templates/next/src/app/examples/dashboard/components/main-nav.tsx +38 -0
- package/templates/next/src/app/examples/dashboard/components/overview.tsx +78 -0
- package/templates/next/src/app/examples/dashboard/components/recent-sales.tsx +67 -0
- package/templates/next/src/app/examples/dashboard/components/search.tsx +13 -0
- package/templates/next/src/app/examples/dashboard/components/team-switcher.tsx +205 -0
- package/templates/next/src/app/examples/dashboard/components/user-nav.tsx +67 -0
- package/templates/next/src/app/examples/dashboard/page.tsx +147 -0
- package/templates/next/src/app/examples/forms/account/account-form.tsx +219 -0
- package/templates/next/src/app/examples/forms/account/page.tsx +18 -0
- package/templates/next/src/app/examples/forms/appearance/appearance-form.tsx +164 -0
- package/templates/next/src/app/examples/forms/appearance/page.tsx +18 -0
- package/templates/next/src/app/examples/forms/components/sidebar-nav.tsx +43 -0
- package/templates/next/src/app/examples/forms/display/display-form.tsx +132 -0
- package/templates/next/src/app/examples/forms/display/page.tsx +17 -0
- package/templates/next/src/app/examples/forms/layout.tsx +57 -0
- package/templates/next/src/app/examples/forms/notifications/notifications-form.tsx +221 -0
- package/templates/next/src/app/examples/forms/notifications/page.tsx +18 -0
- package/templates/next/src/app/examples/forms/page.tsx +17 -0
- package/templates/next/src/app/examples/forms/profile-form.tsx +190 -0
- package/templates/next/src/app/examples/layout.tsx +7 -0
- package/templates/next/src/app/examples/music/components/album-artwork.tsx +84 -0
- package/templates/next/src/app/examples/music/components/menu.tsx +178 -0
- package/templates/next/src/app/examples/music/components/podcast-empty-placeholder.tsx +53 -0
- package/templates/next/src/app/examples/music/components/sidebar.tsx +100 -0
- package/templates/next/src/app/examples/music/data/albums.ts +71 -0
- package/templates/next/src/app/examples/music/data/playlists.ts +16 -0
- package/templates/next/src/app/examples/music/page.tsx +134 -0
- package/templates/next/src/app/examples/music/styles.css +65 -0
- package/templates/next/src/app/examples/playground/components/code-viewer.tsx +89 -0
- package/templates/next/src/app/examples/playground/components/icons.tsx +153 -0
- package/templates/next/src/app/examples/playground/components/maxlength-selector.tsx +55 -0
- package/templates/next/src/app/examples/playground/components/model-selector.tsx +163 -0
- package/templates/next/src/app/examples/playground/components/preset-actions.tsx +124 -0
- package/templates/next/src/app/examples/playground/components/preset-save.tsx +44 -0
- package/templates/next/src/app/examples/playground/components/preset-selector.tsx +82 -0
- package/templates/next/src/app/examples/playground/components/preset-share.tsx +46 -0
- package/templates/next/src/app/examples/playground/components/temperature-selector.tsx +57 -0
- package/templates/next/src/app/examples/playground/components/top-p-selector.tsx +54 -0
- package/templates/next/src/app/examples/playground/data/models.ts +62 -0
- package/templates/next/src/app/examples/playground/data/presets.ts +47 -0
- package/templates/next/src/app/examples/playground/page.tsx +160 -0
- package/templates/next/src/app/examples/playground/styles.css +65 -0
- package/templates/next/src/app/examples/tasks/components/columns.tsx +120 -0
- package/templates/next/src/app/examples/tasks/components/data-table-column-header.tsx +66 -0
- package/templates/next/src/app/examples/tasks/components/data-table-faceted-filter.tsx +147 -0
- package/templates/next/src/app/examples/tasks/components/data-table-pagination.tsx +97 -0
- package/templates/next/src/app/examples/tasks/components/data-table-row-actions.tsx +82 -0
- package/templates/next/src/app/examples/tasks/components/data-table-toolbar.tsx +63 -0
- package/templates/next/src/app/examples/tasks/components/data-table-view-options.tsx +59 -0
- package/templates/next/src/app/examples/tasks/components/data-table.tsx +126 -0
- package/templates/next/src/app/examples/tasks/components/user-nav.tsx +67 -0
- package/templates/next/src/app/examples/tasks/data/data.tsx +71 -0
- package/templates/next/src/app/examples/tasks/data/schema.ts +13 -0
- package/templates/next/src/app/examples/tasks/data/seed.ts +20 -0
- package/templates/next/src/app/examples/tasks/data/tasks.json +702 -0
- package/templates/next/src/app/examples/tasks/page.tsx +47 -0
- package/templates/next/src/app/layout.tsx +43 -0
- package/templates/next/src/app/page.tsx +5 -0
- package/templates/next/src/assets/Inter.var.woff2 +0 -0
- package/templates/next/src/assets/logo.png +0 -0
- package/templates/next/src/components/examples/.eslintrc.json +6 -0
- package/templates/next/src/components/examples/accordion/demo.tsx +32 -0
- package/templates/next/src/components/examples/alert/demo.tsx +15 -0
- package/templates/next/src/components/examples/alert/destructive.tsx +15 -0
- package/templates/next/src/components/examples/alert-dialog/demo.tsx +35 -0
- package/templates/next/src/components/examples/aspect-ratio/demo.tsx +16 -0
- package/templates/next/src/components/examples/avatar/demo.tsx +10 -0
- package/templates/next/src/components/examples/badge/demo.tsx +5 -0
- package/templates/next/src/components/examples/badge/destructive.tsx +5 -0
- package/templates/next/src/components/examples/badge/outline.tsx +5 -0
- package/templates/next/src/components/examples/badge/secondary.tsx +5 -0
- package/templates/next/src/components/examples/button/as-child.tsx +10 -0
- package/templates/next/src/components/examples/button/demo.tsx +5 -0
- package/templates/next/src/components/examples/button/destructive.tsx +5 -0
- package/templates/next/src/components/examples/button/ghost.tsx +5 -0
- package/templates/next/src/components/examples/button/link.tsx +5 -0
- package/templates/next/src/components/examples/button/loading.tsx +12 -0
- package/templates/next/src/components/examples/button/outline.tsx +5 -0
- package/templates/next/src/components/examples/button/secondary.tsx +5 -0
- package/templates/next/src/components/examples/button/with-icon.tsx +11 -0
- package/templates/next/src/components/examples/calendar/date-picker.tsx +43 -0
- package/templates/next/src/components/examples/calendar/date-range-picker.tsx +65 -0
- package/templates/next/src/components/examples/calendar/demo.tsx +18 -0
- package/templates/next/src/components/examples/calendar/react-hook-form.tsx +101 -0
- package/templates/next/src/components/examples/calendar/with-presets.tsx +62 -0
- package/templates/next/src/components/examples/card/demo.tsx +79 -0
- package/templates/next/src/components/examples/card/with-form.tsx +59 -0
- package/templates/next/src/components/examples/checkbox/demo.tsx +17 -0
- package/templates/next/src/components/examples/checkbox/disabled.tsx +15 -0
- package/templates/next/src/components/examples/checkbox/react-hook-form-multiple.tsx +127 -0
- package/templates/next/src/components/examples/checkbox/react-hook-form-single.tsx +72 -0
- package/templates/next/src/components/examples/checkbox/with-text.tsx +22 -0
- package/templates/next/src/components/examples/collapsible/demo.tsx +46 -0
- package/templates/next/src/components/examples/combobox/demo.tsx +90 -0
- package/templates/next/src/components/examples/combobox/dropdown-menu.tsx +110 -0
- package/templates/next/src/components/examples/combobox/popover.tsx +124 -0
- package/templates/next/src/components/examples/combobox/react-hook-form.tsx +135 -0
- package/templates/next/src/components/examples/command/combobox.tsx +90 -0
- package/templates/next/src/components/examples/command/demo.tsx +62 -0
- package/templates/next/src/components/examples/command/dialog.tsx +86 -0
- package/templates/next/src/components/examples/command/dropdown-menu.tsx +110 -0
- package/templates/next/src/components/examples/command/popover.tsx +124 -0
- package/templates/next/src/components/examples/context-menu/demo.tsx +67 -0
- package/templates/next/src/components/examples/data-table/columns.tsx +110 -0
- package/templates/next/src/components/examples/data-table/data-table.tsx +185 -0
- package/templates/next/src/components/examples/data-table/demo.tsx +41 -0
- package/templates/next/src/components/examples/date-picker/demo.tsx +43 -0
- package/templates/next/src/components/examples/date-picker/react-hook-form.tsx +101 -0
- package/templates/next/src/components/examples/date-picker/with-presets.tsx +62 -0
- package/templates/next/src/components/examples/date-picker/with-range.tsx +65 -0
- package/templates/next/src/components/examples/dialog/demo.tsx +47 -0
- package/templates/next/src/components/examples/dropdown-menu/checkboxes.tsx +53 -0
- package/templates/next/src/components/examples/dropdown-menu/demo.tsx +122 -0
- package/templates/next/src/components/examples/dropdown-menu/radio-group.tsx +37 -0
- package/templates/next/src/components/examples/hover-card/demo.tsx +39 -0
- package/templates/next/src/components/examples/index.tsx +213 -0
- package/templates/next/src/components/examples/input/demo.tsx +5 -0
- package/templates/next/src/components/examples/input/disabled.tsx +5 -0
- package/templates/next/src/components/examples/input/file.tsx +11 -0
- package/templates/next/src/components/examples/input/react-hook-form.tsx +65 -0
- package/templates/next/src/components/examples/input/with-button.tsx +11 -0
- package/templates/next/src/components/examples/input/with-label.tsx +11 -0
- package/templates/next/src/components/examples/input/with-text.tsx +12 -0
- package/templates/next/src/components/examples/label/demo.tsx +13 -0
- package/templates/next/src/components/examples/menubar/demo.tsx +107 -0
- package/templates/next/src/components/examples/navigation-menu/demo.tsx +144 -0
- package/templates/next/src/components/examples/popover/demo.tsx +67 -0
- package/templates/next/src/components/examples/progress/demo.tsx +16 -0
- package/templates/next/src/components/examples/radio-group/demo.tsx +21 -0
- package/templates/next/src/components/examples/radio-group/react-hook-form.tsx +88 -0
- package/templates/next/src/components/examples/scroll-area/demo.tsx +26 -0
- package/templates/next/src/components/examples/select/demo.tsx +31 -0
- package/templates/next/src/components/examples/select/react-hook-form.tsx +83 -0
- package/templates/next/src/components/examples/separator/demo.tsx +22 -0
- package/templates/next/src/components/examples/sheet/demo.tsx +47 -0
- package/templates/next/src/components/examples/sheet/position.tsx +75 -0
- package/templates/next/src/components/examples/sheet/size.tsx +75 -0
- package/templates/next/src/components/examples/skeleton/demo.tsx +13 -0
- package/templates/next/src/components/examples/slider/demo.tsx +16 -0
- package/templates/next/src/components/examples/switch/demo.tsx +11 -0
- package/templates/next/src/components/examples/switch/react-hook-form.tsx +101 -0
- package/templates/next/src/components/examples/table/demo.tsx +80 -0
- package/templates/next/src/components/examples/tabs/demo.tsx +69 -0
- package/templates/next/src/components/examples/textarea/demo.tsx +5 -0
- package/templates/next/src/components/examples/textarea/disabled.tsx +5 -0
- package/templates/next/src/components/examples/textarea/react-hook-form.tsx +77 -0
- package/templates/next/src/components/examples/textarea/with-button.tsx +11 -0
- package/templates/next/src/components/examples/textarea/with-label.tsx +11 -0
- package/templates/next/src/components/examples/textarea/with-text.tsx +14 -0
- package/templates/next/src/components/examples/toast/demo.tsx +26 -0
- package/templates/next/src/components/examples/toast/destructive.tsx +25 -0
- package/templates/next/src/components/examples/toast/simple.tsx +21 -0
- package/templates/next/src/components/examples/toast/with-action.tsx +24 -0
- package/templates/next/src/components/examples/toast/with-title.tsx +22 -0
- package/templates/next/src/components/examples/toggle/demo.tsx +11 -0
- package/templates/next/src/components/examples/toggle/disabled.tsx +11 -0
- package/templates/next/src/components/examples/toggle/lg.tsx +11 -0
- package/templates/next/src/components/examples/toggle/outline.tsx +11 -0
- package/templates/next/src/components/examples/toggle/sm.tsx +11 -0
- package/templates/next/src/components/examples/toggle/with-text.tsx +12 -0
- package/templates/next/src/components/examples/tooltip/demo.tsx +27 -0
- package/templates/next/src/components/examples/typography/blockquote.tsx +8 -0
- package/templates/next/src/components/examples/typography/demo.tsx +119 -0
- package/templates/next/src/components/examples/typography/h1.tsx +7 -0
- package/templates/next/src/components/examples/typography/h2.tsx +7 -0
- package/templates/next/src/components/examples/typography/h3.tsx +7 -0
- package/templates/next/src/components/examples/typography/h4.tsx +7 -0
- package/templates/next/src/components/examples/typography/inline-code.tsx +7 -0
- package/templates/next/src/components/examples/typography/large.tsx +5 -0
- package/templates/next/src/components/examples/typography/lead.tsx +8 -0
- package/templates/next/src/components/examples/typography/list.tsx +9 -0
- package/templates/next/src/components/examples/typography/muted.tsx +5 -0
- package/templates/next/src/components/examples/typography/p.tsx +8 -0
- package/templates/next/src/components/examples/typography/small.tsx +5 -0
- package/templates/next/src/components/examples/typography/table.tsx +44 -0
- package/templates/next/src/components/examples-nav.tsx +70 -0
- package/templates/next/src/components/greeting.tsx +21 -0
- package/templates/next/src/components/icons.tsx +154 -0
- package/templates/next/src/components/menu-mode-toggle.tsx +46 -0
- package/templates/next/src/components/menu.tsx +268 -0
- package/templates/next/src/components/mode-toggle.tsx +43 -0
- package/templates/next/src/components/page-header.tsx +50 -0
- package/templates/next/src/components/react-hook-form/form.tsx +176 -0
- package/templates/next/src/components/style-switcher.tsx +19 -0
- package/templates/next/src/components/tailwind-indicator.tsx +18 -0
- package/templates/next/src/components/theme-provider.tsx +9 -0
- package/templates/next/src/components/ui/accordion.tsx +60 -0
- package/templates/next/src/components/ui/alert-dialog.tsx +150 -0
- package/templates/next/src/components/ui/alert.tsx +61 -0
- package/templates/next/src/components/ui/aspect-ratio.tsx +7 -0
- package/templates/next/src/components/ui/avatar.tsx +50 -0
- package/templates/next/src/components/ui/badge.tsx +36 -0
- package/templates/next/src/components/ui/button.tsx +51 -0
- package/templates/next/src/components/ui/calendar.tsx +64 -0
- package/templates/next/src/components/ui/card.tsx +81 -0
- package/templates/next/src/components/ui/checkbox.tsx +30 -0
- package/templates/next/src/components/ui/collapsible.tsx +11 -0
- package/templates/next/src/components/ui/command.tsx +155 -0
- package/templates/next/src/components/ui/context-menu.tsx +200 -0
- package/templates/next/src/components/ui/dialog.tsx +128 -0
- package/templates/next/src/components/ui/dropdown-menu.tsx +200 -0
- package/templates/next/src/components/ui/hover-card.tsx +29 -0
- package/templates/next/src/components/ui/input.tsx +27 -0
- package/templates/next/src/components/ui/label.tsx +26 -0
- package/templates/next/src/components/ui/menubar.tsx +236 -0
- package/templates/next/src/components/ui/navigation-menu.tsx +130 -0
- package/templates/next/src/components/ui/popover.tsx +31 -0
- package/templates/next/src/components/ui/progress.tsx +28 -0
- package/templates/next/src/components/ui/radio-group.tsx +44 -0
- package/templates/next/src/components/ui/scroll-area.tsx +48 -0
- package/templates/next/src/components/ui/select.tsx +120 -0
- package/templates/next/src/components/ui/separator.tsx +31 -0
- package/templates/next/src/components/ui/sheet.tsx +230 -0
- package/templates/next/src/components/ui/skeleton.tsx +17 -0
- package/templates/next/src/components/ui/slider.tsx +28 -0
- package/templates/next/src/components/ui/switch.tsx +29 -0
- package/templates/next/src/components/ui/table.tsx +114 -0
- package/templates/next/src/components/ui/tabs.tsx +55 -0
- package/templates/next/src/components/ui/textarea.tsx +26 -0
- package/templates/next/src/components/ui/toast.tsx +129 -0
- package/templates/next/src/components/ui/toaster.tsx +35 -0
- package/templates/next/src/components/ui/toggle.tsx +45 -0
- package/templates/next/src/components/ui/tooltip.tsx +30 -0
- package/templates/next/src/components/ui/use-toast.ts +191 -0
- package/templates/next/src/data/albums.ts +71 -0
- package/templates/next/src/data/playlists.ts +16 -0
- package/templates/next/src/hooks/use-lock-body.ts +12 -0
- package/templates/next/src/hooks/use-mounted.ts +11 -0
- package/templates/next/src/hooks/use-mutation-observer.ts +20 -0
- package/templates/next/src/lib/fonts.ts +11 -0
- package/templates/next/src/lib/utils.ts +19 -0
- package/templates/next/src/styles/globals.css +124 -0
- package/templates/next/src-tauri/Cargo.lock +3636 -0
- package/templates/next/src-tauri/Cargo.toml +36 -0
- package/templates/next/src-tauri/build.rs +3 -0
- package/templates/next/src-tauri/icons/128x128.png +0 -0
- package/templates/next/src-tauri/icons/128x128@2x.png +0 -0
- package/templates/next/src-tauri/icons/32x32.png +0 -0
- package/templates/next/src-tauri/icons/Square107x107Logo.png +0 -0
- package/templates/next/src-tauri/icons/Square142x142Logo.png +0 -0
- package/templates/next/src-tauri/icons/Square150x150Logo.png +0 -0
- package/templates/next/src-tauri/icons/Square284x284Logo.png +0 -0
- package/templates/next/src-tauri/icons/Square30x30Logo.png +0 -0
- package/templates/next/src-tauri/icons/Square310x310Logo.png +0 -0
- package/templates/next/src-tauri/icons/Square44x44Logo.png +0 -0
- package/templates/next/src-tauri/icons/Square71x71Logo.png +0 -0
- package/templates/next/src-tauri/icons/Square89x89Logo.png +0 -0
- package/templates/next/src-tauri/icons/StoreLogo.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/next/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/templates/next/src-tauri/icons/icon.icns +0 -0
- package/templates/next/src-tauri/icons/icon.ico +0 -0
- package/templates/next/src-tauri/icons/icon.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-20x20@1x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-20x20@2x-1.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-20x20@2x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-20x20@3x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-29x29@1x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-29x29@2x-1.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-29x29@2x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-29x29@3x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-40x40@1x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-40x40@2x-1.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-40x40@2x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-40x40@3x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-512@2x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-60x60@2x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-60x60@3x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-76x76@1x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-76x76@2x.png +0 -0
- package/templates/next/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png +0 -0
- package/templates/next/src-tauri/src/main.rs +19 -0
- package/templates/next/src-tauri/tauri.conf.json +63 -0
- package/templates/next/tailwind.config.js +80 -0
- package/templates/next/tsconfig.json +35 -0
- package/templates/vite/.github/workflows/release.yml +108 -0
- package/templates/vite/.vscode/extensions.json +3 -0
- package/templates/vite/README.md +7 -0
- package/templates/vite/app-icon.png +0 -0
- package/templates/vite/index.html +16 -0
- package/templates/vite/package.json +75 -0
- package/templates/vite/pnpm-lock.yaml +4569 -0
- package/templates/vite/postcss.config.js +6 -0
- package/templates/vite/prettier.config.cjs +35 -0
- package/templates/vite/src/App.tsx +39 -0
- package/templates/vite/src/aa +34 -0
- package/templates/vite/src/assets/Inter.var.woff2 +0 -0
- package/templates/vite/src/components/icons.tsx +154 -0
- package/templates/vite/src/components/menu-mode-toggle.tsx +46 -0
- package/templates/vite/src/components/menu.tsx +232 -0
- package/templates/vite/src/components/tailwind-indicator.tsx +18 -0
- package/templates/vite/src/components/theme-provider.tsx +9 -0
- package/templates/vite/src/components/ui/accordion.tsx +60 -0
- package/templates/vite/src/components/ui/alert-dialog.tsx +150 -0
- package/templates/vite/src/components/ui/alert.tsx +61 -0
- package/templates/vite/src/components/ui/aspect-ratio.tsx +7 -0
- package/templates/vite/src/components/ui/avatar.tsx +50 -0
- package/templates/vite/src/components/ui/badge.tsx +36 -0
- package/templates/vite/src/components/ui/button.tsx +51 -0
- package/templates/vite/src/components/ui/calendar.tsx +64 -0
- package/templates/vite/src/components/ui/card.tsx +81 -0
- package/templates/vite/src/components/ui/checkbox.tsx +30 -0
- package/templates/vite/src/components/ui/collapsible.tsx +11 -0
- package/templates/vite/src/components/ui/command.tsx +155 -0
- package/templates/vite/src/components/ui/context-menu.tsx +200 -0
- package/templates/vite/src/components/ui/dialog.tsx +128 -0
- package/templates/vite/src/components/ui/dropdown-menu.tsx +200 -0
- package/templates/vite/src/components/ui/hover-card.tsx +29 -0
- package/templates/vite/src/components/ui/input.tsx +27 -0
- package/templates/vite/src/components/ui/label.tsx +26 -0
- package/templates/vite/src/components/ui/menubar.tsx +236 -0
- package/templates/vite/src/components/ui/navigation-menu.tsx +130 -0
- package/templates/vite/src/components/ui/popover.tsx +31 -0
- package/templates/vite/src/components/ui/progress.tsx +28 -0
- package/templates/vite/src/components/ui/radio-group.tsx +44 -0
- package/templates/vite/src/components/ui/scroll-area.tsx +48 -0
- package/templates/vite/src/components/ui/select.tsx +120 -0
- package/templates/vite/src/components/ui/separator.tsx +31 -0
- package/templates/vite/src/components/ui/sheet.tsx +230 -0
- package/templates/vite/src/components/ui/skeleton.tsx +17 -0
- package/templates/vite/src/components/ui/slider.tsx +28 -0
- package/templates/vite/src/components/ui/switch.tsx +29 -0
- package/templates/vite/src/components/ui/table.tsx +114 -0
- package/templates/vite/src/components/ui/tabs.tsx +55 -0
- package/templates/vite/src/components/ui/textarea.tsx +26 -0
- package/templates/vite/src/components/ui/toast.tsx +129 -0
- package/templates/vite/src/components/ui/toaster.tsx +35 -0
- package/templates/vite/src/components/ui/toggle.tsx +45 -0
- package/templates/vite/src/components/ui/tooltip.tsx +30 -0
- package/templates/vite/src/components/ui/use-toast.ts +191 -0
- package/templates/vite/src/dashboard/components/date-range-picker.tsx +66 -0
- package/templates/vite/src/dashboard/components/main-nav.tsx +38 -0
- package/templates/vite/src/dashboard/components/overview.tsx +78 -0
- package/templates/vite/src/dashboard/components/recent-sales.tsx +67 -0
- package/templates/vite/src/dashboard/components/search.tsx +13 -0
- package/templates/vite/src/dashboard/components/team-switcher.tsx +205 -0
- package/templates/vite/src/dashboard/components/user-nav.tsx +67 -0
- package/templates/vite/src/dashboard/page.tsx +140 -0
- package/templates/vite/src/lib/utils.ts +19 -0
- package/templates/vite/src/main.tsx +10 -0
- package/templates/vite/src/styles/globals.css +124 -0
- package/templates/vite/src/vite-env.d.ts +1 -0
- package/templates/vite/src-tauri/Cargo.lock +3636 -0
- package/templates/vite/src-tauri/Cargo.toml +33 -0
- package/templates/vite/src-tauri/build.rs +3 -0
- package/templates/vite/src-tauri/icons/128x128.png +0 -0
- package/templates/vite/src-tauri/icons/128x128@2x.png +0 -0
- package/templates/vite/src-tauri/icons/32x32.png +0 -0
- package/templates/vite/src-tauri/icons/Square107x107Logo.png +0 -0
- package/templates/vite/src-tauri/icons/Square142x142Logo.png +0 -0
- package/templates/vite/src-tauri/icons/Square150x150Logo.png +0 -0
- package/templates/vite/src-tauri/icons/Square284x284Logo.png +0 -0
- package/templates/vite/src-tauri/icons/Square30x30Logo.png +0 -0
- package/templates/vite/src-tauri/icons/Square310x310Logo.png +0 -0
- package/templates/vite/src-tauri/icons/Square44x44Logo.png +0 -0
- package/templates/vite/src-tauri/icons/Square71x71Logo.png +0 -0
- package/templates/vite/src-tauri/icons/Square89x89Logo.png +0 -0
- package/templates/vite/src-tauri/icons/StoreLogo.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- package/templates/vite/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/templates/vite/src-tauri/icons/icon.icns +0 -0
- package/templates/vite/src-tauri/icons/icon.ico +0 -0
- package/templates/vite/src-tauri/icons/icon.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-20x20@1x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-20x20@2x-1.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-20x20@2x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-20x20@3x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-29x29@1x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-29x29@2x-1.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-29x29@2x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-29x29@3x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-40x40@1x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-40x40@2x-1.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-40x40@2x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-40x40@3x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-512@2x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-60x60@2x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-60x60@3x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-76x76@1x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-76x76@2x.png +0 -0
- package/templates/vite/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png +0 -0
- package/templates/vite/src-tauri/src/main.rs +16 -0
- package/templates/vite/src-tauri/tauri.conf.json +63 -0
- package/templates/vite/tailwind.config.js +78 -0
- package/templates/vite/tsconfig.json +26 -0
- package/templates/vite/tsconfig.node.json +9 -0
- package/templates/vite/vite.config.ts +33 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { ColumnDef } from "@tanstack/react-table"
|
|
4
|
+
|
|
5
|
+
import { Badge } from "@/components/ui/badge"
|
|
6
|
+
import { Checkbox } from "@/components/ui/checkbox"
|
|
7
|
+
|
|
8
|
+
import { labels, priorities, statuses } from "../data/data"
|
|
9
|
+
import { Task } from "../data/schema"
|
|
10
|
+
import { DataTableColumnHeader } from "./data-table-column-header"
|
|
11
|
+
import { DataTableRowActions } from "./data-table-row-actions"
|
|
12
|
+
|
|
13
|
+
export const columns: ColumnDef<Task>[] = [
|
|
14
|
+
{
|
|
15
|
+
id: "select",
|
|
16
|
+
header: ({ table }) => (
|
|
17
|
+
<Checkbox
|
|
18
|
+
checked={table.getIsAllPageRowsSelected()}
|
|
19
|
+
onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}
|
|
20
|
+
aria-label="Select all"
|
|
21
|
+
className="translate-y-[2px]"
|
|
22
|
+
/>
|
|
23
|
+
),
|
|
24
|
+
cell: ({ row }) => (
|
|
25
|
+
<Checkbox
|
|
26
|
+
checked={row.getIsSelected()}
|
|
27
|
+
onCheckedChange={(value) => row.toggleSelected(!!value)}
|
|
28
|
+
aria-label="Select row"
|
|
29
|
+
className="translate-y-[2px]"
|
|
30
|
+
/>
|
|
31
|
+
),
|
|
32
|
+
enableSorting: false,
|
|
33
|
+
enableHiding: false,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
accessorKey: "id",
|
|
37
|
+
header: ({ column }) => (
|
|
38
|
+
<DataTableColumnHeader column={column} title="Task" />
|
|
39
|
+
),
|
|
40
|
+
cell: ({ row }) => <div className="w-[80px]">{row.getValue("id")}</div>,
|
|
41
|
+
enableSorting: false,
|
|
42
|
+
enableHiding: false,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
accessorKey: "title",
|
|
46
|
+
header: ({ column }) => (
|
|
47
|
+
<DataTableColumnHeader column={column} title="Title" />
|
|
48
|
+
),
|
|
49
|
+
cell: ({ row }) => {
|
|
50
|
+
const label = labels.find((label) => label.value === row.original.label)
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<div className="flex space-x-2">
|
|
54
|
+
{label && <Badge variant="outline">{label.label}</Badge>}
|
|
55
|
+
<span className="max-w-[500px] truncate font-medium">
|
|
56
|
+
{row.getValue("title")}
|
|
57
|
+
</span>
|
|
58
|
+
</div>
|
|
59
|
+
)
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
accessorKey: "status",
|
|
64
|
+
header: ({ column }) => (
|
|
65
|
+
<DataTableColumnHeader column={column} title="Status" />
|
|
66
|
+
),
|
|
67
|
+
cell: ({ row }) => {
|
|
68
|
+
const status = statuses.find(
|
|
69
|
+
(status) => status.value === row.getValue("status")
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
if (!status) {
|
|
73
|
+
return null
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<div className="flex w-[100px] items-center">
|
|
78
|
+
{status.icon && (
|
|
79
|
+
<status.icon className="mr-2 h-4 w-4 text-muted-foreground" />
|
|
80
|
+
)}
|
|
81
|
+
<span>{status.label}</span>
|
|
82
|
+
</div>
|
|
83
|
+
)
|
|
84
|
+
},
|
|
85
|
+
filterFn: (row, id, value) => {
|
|
86
|
+
return value.includes(row.getValue(id))
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
accessorKey: "priority",
|
|
91
|
+
header: ({ column }) => (
|
|
92
|
+
<DataTableColumnHeader column={column} title="Priority" />
|
|
93
|
+
),
|
|
94
|
+
cell: ({ row }) => {
|
|
95
|
+
const priority = priorities.find(
|
|
96
|
+
(priority) => priority.value === row.getValue("priority")
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
if (!priority) {
|
|
100
|
+
return null
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<div className="flex items-center">
|
|
105
|
+
{priority.icon && (
|
|
106
|
+
<priority.icon className="mr-2 h-4 w-4 text-muted-foreground" />
|
|
107
|
+
)}
|
|
108
|
+
<span>{priority.label}</span>
|
|
109
|
+
</div>
|
|
110
|
+
)
|
|
111
|
+
},
|
|
112
|
+
filterFn: (row, id, value) => {
|
|
113
|
+
return value.includes(row.getValue(id))
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: "actions",
|
|
118
|
+
cell: ({ row }) => <DataTableRowActions row={row} />,
|
|
119
|
+
},
|
|
120
|
+
]
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Column } from "@tanstack/react-table"
|
|
2
|
+
import { ChevronsUpDown, EyeOff, SortAsc, SortDesc } from "lucide-react"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
import { Button } from "@/components/ui/button"
|
|
6
|
+
import {
|
|
7
|
+
DropdownMenu,
|
|
8
|
+
DropdownMenuContent,
|
|
9
|
+
DropdownMenuItem,
|
|
10
|
+
DropdownMenuSeparator,
|
|
11
|
+
DropdownMenuTrigger,
|
|
12
|
+
} from "@/components/ui/dropdown-menu"
|
|
13
|
+
|
|
14
|
+
interface DataTableColumnHeaderProps<TData, TValue>
|
|
15
|
+
extends React.HTMLAttributes<HTMLDivElement> {
|
|
16
|
+
column: Column<TData, TValue>
|
|
17
|
+
title: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function DataTableColumnHeader<TData, TValue>({
|
|
21
|
+
column,
|
|
22
|
+
title,
|
|
23
|
+
className,
|
|
24
|
+
}: DataTableColumnHeaderProps<TData, TValue>) {
|
|
25
|
+
if (!column.getCanSort()) {
|
|
26
|
+
return <div className={cn(className)}>{title}</div>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div className={cn("flex items-center space-x-2", className)}>
|
|
31
|
+
<DropdownMenu>
|
|
32
|
+
<DropdownMenuTrigger asChild>
|
|
33
|
+
<Button
|
|
34
|
+
variant="ghost"
|
|
35
|
+
size="sm"
|
|
36
|
+
className="-ml-3 h-8 data-[state=open]:bg-accent"
|
|
37
|
+
>
|
|
38
|
+
<span>{title}</span>
|
|
39
|
+
{column.getIsSorted() === "desc" ? (
|
|
40
|
+
<SortDesc className="ml-2 h-4 w-4" />
|
|
41
|
+
) : column.getIsSorted() === "asc" ? (
|
|
42
|
+
<SortAsc className="ml-2 h-4 w-4" />
|
|
43
|
+
) : (
|
|
44
|
+
<ChevronsUpDown className="ml-2 h-4 w-4" />
|
|
45
|
+
)}
|
|
46
|
+
</Button>
|
|
47
|
+
</DropdownMenuTrigger>
|
|
48
|
+
<DropdownMenuContent align="start">
|
|
49
|
+
<DropdownMenuItem onClick={() => column.toggleSorting(false)}>
|
|
50
|
+
<SortAsc className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
|
|
51
|
+
Asc
|
|
52
|
+
</DropdownMenuItem>
|
|
53
|
+
<DropdownMenuItem onClick={() => column.toggleSorting(true)}>
|
|
54
|
+
<SortDesc className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
|
|
55
|
+
Desc
|
|
56
|
+
</DropdownMenuItem>
|
|
57
|
+
<DropdownMenuSeparator />
|
|
58
|
+
<DropdownMenuItem onClick={() => column.toggleVisibility(false)}>
|
|
59
|
+
<EyeOff className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
|
|
60
|
+
Hide
|
|
61
|
+
</DropdownMenuItem>
|
|
62
|
+
</DropdownMenuContent>
|
|
63
|
+
</DropdownMenu>
|
|
64
|
+
</div>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Column } from "@tanstack/react-table"
|
|
3
|
+
import { Check, LucideIcon, PlusCircle } from "lucide-react"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
import { Badge } from "@/components/ui/badge"
|
|
7
|
+
import { Button } from "@/components/ui/button"
|
|
8
|
+
import {
|
|
9
|
+
Command,
|
|
10
|
+
CommandEmpty,
|
|
11
|
+
CommandGroup,
|
|
12
|
+
CommandInput,
|
|
13
|
+
CommandItem,
|
|
14
|
+
CommandList,
|
|
15
|
+
CommandSeparator,
|
|
16
|
+
} from "@/components/ui/command"
|
|
17
|
+
import {
|
|
18
|
+
Popover,
|
|
19
|
+
PopoverContent,
|
|
20
|
+
PopoverTrigger,
|
|
21
|
+
} from "@/components/ui/popover"
|
|
22
|
+
import { Separator } from "@/components/ui/separator"
|
|
23
|
+
|
|
24
|
+
interface DataTableFacetedFilter<TData, TValue> {
|
|
25
|
+
column?: Column<TData, TValue>
|
|
26
|
+
title?: string
|
|
27
|
+
options: {
|
|
28
|
+
label: string
|
|
29
|
+
value: string
|
|
30
|
+
icon?: LucideIcon
|
|
31
|
+
}[]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function DataTableFacetedFilter<TData, TValue>({
|
|
35
|
+
column,
|
|
36
|
+
title,
|
|
37
|
+
options,
|
|
38
|
+
}: DataTableFacetedFilter<TData, TValue>) {
|
|
39
|
+
const facets = column?.getFacetedUniqueValues()
|
|
40
|
+
const selectedValues = new Set(column?.getFilterValue() as string[])
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<Popover>
|
|
44
|
+
<PopoverTrigger asChild>
|
|
45
|
+
<Button variant="outline" size="sm" className="h-8 border-dashed">
|
|
46
|
+
<PlusCircle className="mr-2 h-4 w-4" />
|
|
47
|
+
{title}
|
|
48
|
+
{selectedValues?.size > 0 && (
|
|
49
|
+
<>
|
|
50
|
+
<Separator orientation="vertical" className="mx-2 h-4" />
|
|
51
|
+
<Badge
|
|
52
|
+
variant="secondary"
|
|
53
|
+
className="rounded-sm px-1 font-normal lg:hidden"
|
|
54
|
+
>
|
|
55
|
+
{selectedValues.size}
|
|
56
|
+
</Badge>
|
|
57
|
+
<div className="hidden space-x-1 lg:flex">
|
|
58
|
+
{selectedValues.size > 2 ? (
|
|
59
|
+
<Badge
|
|
60
|
+
variant="secondary"
|
|
61
|
+
className="rounded-sm px-1 font-normal"
|
|
62
|
+
>
|
|
63
|
+
{selectedValues.size} selected
|
|
64
|
+
</Badge>
|
|
65
|
+
) : (
|
|
66
|
+
options
|
|
67
|
+
.filter((option) => selectedValues.has(option.value))
|
|
68
|
+
.map((option) => (
|
|
69
|
+
<Badge
|
|
70
|
+
variant="secondary"
|
|
71
|
+
key={option.value}
|
|
72
|
+
className="rounded-sm px-1 font-normal"
|
|
73
|
+
>
|
|
74
|
+
{option.label}
|
|
75
|
+
</Badge>
|
|
76
|
+
))
|
|
77
|
+
)}
|
|
78
|
+
</div>
|
|
79
|
+
</>
|
|
80
|
+
)}
|
|
81
|
+
</Button>
|
|
82
|
+
</PopoverTrigger>
|
|
83
|
+
<PopoverContent className="w-[200px] p-0" align="start">
|
|
84
|
+
<Command>
|
|
85
|
+
<CommandInput placeholder={title} />
|
|
86
|
+
<CommandList>
|
|
87
|
+
<CommandEmpty>No results found.</CommandEmpty>
|
|
88
|
+
<CommandGroup>
|
|
89
|
+
{options.map((option) => {
|
|
90
|
+
const isSelected = selectedValues.has(option.value)
|
|
91
|
+
return (
|
|
92
|
+
<CommandItem
|
|
93
|
+
key={option.value}
|
|
94
|
+
onSelect={() => {
|
|
95
|
+
if (isSelected) {
|
|
96
|
+
selectedValues.delete(option.value)
|
|
97
|
+
} else {
|
|
98
|
+
selectedValues.add(option.value)
|
|
99
|
+
}
|
|
100
|
+
const filterValues = Array.from(selectedValues)
|
|
101
|
+
column?.setFilterValue(
|
|
102
|
+
filterValues.length ? filterValues : undefined
|
|
103
|
+
)
|
|
104
|
+
}}
|
|
105
|
+
>
|
|
106
|
+
<div
|
|
107
|
+
className={cn(
|
|
108
|
+
"mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",
|
|
109
|
+
isSelected
|
|
110
|
+
? "bg-primary text-primary-foreground"
|
|
111
|
+
: "opacity-50 [&_svg]:invisible"
|
|
112
|
+
)}
|
|
113
|
+
>
|
|
114
|
+
<Check className={cn("h-4 w-4")} />
|
|
115
|
+
</div>
|
|
116
|
+
{option.icon && (
|
|
117
|
+
<option.icon className="mr-2 h-4 w-4 text-muted-foreground" />
|
|
118
|
+
)}
|
|
119
|
+
<span>{option.label}</span>
|
|
120
|
+
{facets?.get(option.value) && (
|
|
121
|
+
<span className="ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs">
|
|
122
|
+
{facets.get(option.value)}
|
|
123
|
+
</span>
|
|
124
|
+
)}
|
|
125
|
+
</CommandItem>
|
|
126
|
+
)
|
|
127
|
+
})}
|
|
128
|
+
</CommandGroup>
|
|
129
|
+
{selectedValues.size > 0 && (
|
|
130
|
+
<>
|
|
131
|
+
<CommandSeparator />
|
|
132
|
+
<CommandGroup>
|
|
133
|
+
<CommandItem
|
|
134
|
+
onSelect={() => column?.setFilterValue(undefined)}
|
|
135
|
+
className="justify-center text-center"
|
|
136
|
+
>
|
|
137
|
+
Clear filters
|
|
138
|
+
</CommandItem>
|
|
139
|
+
</CommandGroup>
|
|
140
|
+
</>
|
|
141
|
+
)}
|
|
142
|
+
</CommandList>
|
|
143
|
+
</Command>
|
|
144
|
+
</PopoverContent>
|
|
145
|
+
</Popover>
|
|
146
|
+
)
|
|
147
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Table } from "@tanstack/react-table"
|
|
2
|
+
import {
|
|
3
|
+
ChevronLeft,
|
|
4
|
+
ChevronRight,
|
|
5
|
+
ChevronsLeft,
|
|
6
|
+
ChevronsRight,
|
|
7
|
+
} from "lucide-react"
|
|
8
|
+
|
|
9
|
+
import { Button } from "@/components/ui/button"
|
|
10
|
+
import {
|
|
11
|
+
Select,
|
|
12
|
+
SelectContent,
|
|
13
|
+
SelectItem,
|
|
14
|
+
SelectTrigger,
|
|
15
|
+
SelectValue,
|
|
16
|
+
} from "@/components/ui/select"
|
|
17
|
+
|
|
18
|
+
interface DataTablePaginationProps<TData> {
|
|
19
|
+
table: Table<TData>
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function DataTablePagination<TData>({
|
|
23
|
+
table,
|
|
24
|
+
}: DataTablePaginationProps<TData>) {
|
|
25
|
+
return (
|
|
26
|
+
<div className="flex items-center justify-between px-2">
|
|
27
|
+
<div className="flex-1 text-sm text-muted-foreground">
|
|
28
|
+
{table.getFilteredSelectedRowModel().rows.length} of{" "}
|
|
29
|
+
{table.getFilteredRowModel().rows.length} row(s) selected.
|
|
30
|
+
</div>
|
|
31
|
+
<div className="flex items-center space-x-6 lg:space-x-8">
|
|
32
|
+
<div className="flex items-center space-x-2">
|
|
33
|
+
<p className="text-sm font-medium">Rows per page</p>
|
|
34
|
+
<Select
|
|
35
|
+
value={`${table.getState().pagination.pageSize}`}
|
|
36
|
+
onValueChange={(value) => {
|
|
37
|
+
table.setPageSize(Number(value))
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
<SelectTrigger className="h-8 w-[70px]">
|
|
41
|
+
<SelectValue placeholder={table.getState().pagination.pageSize} />
|
|
42
|
+
</SelectTrigger>
|
|
43
|
+
<SelectContent side="top">
|
|
44
|
+
{[10, 20, 30, 40, 50].map((pageSize) => (
|
|
45
|
+
<SelectItem key={pageSize} value={`${pageSize}`}>
|
|
46
|
+
{pageSize}
|
|
47
|
+
</SelectItem>
|
|
48
|
+
))}
|
|
49
|
+
</SelectContent>
|
|
50
|
+
</Select>
|
|
51
|
+
</div>
|
|
52
|
+
<div className="flex w-[100px] items-center justify-center text-sm font-medium">
|
|
53
|
+
Page {table.getState().pagination.pageIndex + 1} of{" "}
|
|
54
|
+
{table.getPageCount()}
|
|
55
|
+
</div>
|
|
56
|
+
<div className="flex items-center space-x-2">
|
|
57
|
+
<Button
|
|
58
|
+
variant="outline"
|
|
59
|
+
className="hidden h-8 w-8 p-0 lg:flex"
|
|
60
|
+
onClick={() => table.setPageIndex(0)}
|
|
61
|
+
disabled={!table.getCanPreviousPage()}
|
|
62
|
+
>
|
|
63
|
+
<span className="sr-only">Go to first page</span>
|
|
64
|
+
<ChevronsLeft className="h-4 w-4" />
|
|
65
|
+
</Button>
|
|
66
|
+
<Button
|
|
67
|
+
variant="outline"
|
|
68
|
+
className="h-8 w-8 p-0"
|
|
69
|
+
onClick={() => table.previousPage()}
|
|
70
|
+
disabled={!table.getCanPreviousPage()}
|
|
71
|
+
>
|
|
72
|
+
<span className="sr-only">Go to previous page</span>
|
|
73
|
+
<ChevronLeft className="h-4 w-4" />
|
|
74
|
+
</Button>
|
|
75
|
+
<Button
|
|
76
|
+
variant="outline"
|
|
77
|
+
className="h-8 w-8 p-0"
|
|
78
|
+
onClick={() => table.nextPage()}
|
|
79
|
+
disabled={!table.getCanNextPage()}
|
|
80
|
+
>
|
|
81
|
+
<span className="sr-only">Go to next page</span>
|
|
82
|
+
<ChevronRight className="h-4 w-4" />
|
|
83
|
+
</Button>
|
|
84
|
+
<Button
|
|
85
|
+
variant="outline"
|
|
86
|
+
className="hidden h-8 w-8 p-0 lg:flex"
|
|
87
|
+
onClick={() => table.setPageIndex(table.getPageCount() - 1)}
|
|
88
|
+
disabled={!table.getCanNextPage()}
|
|
89
|
+
>
|
|
90
|
+
<span className="sr-only">Go to last page</span>
|
|
91
|
+
<ChevronsRight className="h-4 w-4" />
|
|
92
|
+
</Button>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { Row } from "@tanstack/react-table"
|
|
4
|
+
import { Copy, MoreHorizontal, Pen, Star, Tags, Trash } from "lucide-react"
|
|
5
|
+
|
|
6
|
+
import { Button } from "@/components/ui/button"
|
|
7
|
+
import {
|
|
8
|
+
DropdownMenu,
|
|
9
|
+
DropdownMenuContent,
|
|
10
|
+
DropdownMenuItem,
|
|
11
|
+
DropdownMenuRadioGroup,
|
|
12
|
+
DropdownMenuRadioItem,
|
|
13
|
+
DropdownMenuSeparator,
|
|
14
|
+
DropdownMenuShortcut,
|
|
15
|
+
DropdownMenuSub,
|
|
16
|
+
DropdownMenuSubContent,
|
|
17
|
+
DropdownMenuSubTrigger,
|
|
18
|
+
DropdownMenuTrigger,
|
|
19
|
+
} from "@/components/ui/dropdown-menu"
|
|
20
|
+
|
|
21
|
+
import { labels } from "../data/data"
|
|
22
|
+
import { taskSchema } from "../data/schema"
|
|
23
|
+
|
|
24
|
+
interface DataTableRowActionsProps<TData> {
|
|
25
|
+
row: Row<TData>
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function DataTableRowActions<TData>({
|
|
29
|
+
row,
|
|
30
|
+
}: DataTableRowActionsProps<TData>) {
|
|
31
|
+
const task = taskSchema.parse(row.original)
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<DropdownMenu>
|
|
35
|
+
<DropdownMenuTrigger asChild>
|
|
36
|
+
<Button
|
|
37
|
+
variant="ghost"
|
|
38
|
+
className="flex h-8 w-8 p-0 data-[state=open]:bg-muted"
|
|
39
|
+
>
|
|
40
|
+
<MoreHorizontal className="h-4 w-4" />
|
|
41
|
+
<span className="sr-only">Open menu</span>
|
|
42
|
+
</Button>
|
|
43
|
+
</DropdownMenuTrigger>
|
|
44
|
+
<DropdownMenuContent align="end" className="w-[160px]">
|
|
45
|
+
<DropdownMenuItem>
|
|
46
|
+
<Pen className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
|
|
47
|
+
Edit
|
|
48
|
+
</DropdownMenuItem>
|
|
49
|
+
<DropdownMenuItem>
|
|
50
|
+
<Copy className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
|
|
51
|
+
Make a copy
|
|
52
|
+
</DropdownMenuItem>
|
|
53
|
+
<DropdownMenuItem>
|
|
54
|
+
<Star className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
|
|
55
|
+
Favorite
|
|
56
|
+
</DropdownMenuItem>
|
|
57
|
+
<DropdownMenuSeparator />
|
|
58
|
+
<DropdownMenuSub>
|
|
59
|
+
<DropdownMenuSubTrigger>
|
|
60
|
+
<Tags className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
|
|
61
|
+
Labels
|
|
62
|
+
</DropdownMenuSubTrigger>
|
|
63
|
+
<DropdownMenuSubContent>
|
|
64
|
+
<DropdownMenuRadioGroup value={task.label}>
|
|
65
|
+
{labels.map((label) => (
|
|
66
|
+
<DropdownMenuRadioItem key={label.value} value={label.value}>
|
|
67
|
+
{label.label}
|
|
68
|
+
</DropdownMenuRadioItem>
|
|
69
|
+
))}
|
|
70
|
+
</DropdownMenuRadioGroup>
|
|
71
|
+
</DropdownMenuSubContent>
|
|
72
|
+
</DropdownMenuSub>
|
|
73
|
+
<DropdownMenuSeparator />
|
|
74
|
+
<DropdownMenuItem>
|
|
75
|
+
<Trash className="mr-2 h-3.5 w-3.5 text-muted-foreground/70" />
|
|
76
|
+
Delete
|
|
77
|
+
<DropdownMenuShortcut>⌘⌫</DropdownMenuShortcut>
|
|
78
|
+
</DropdownMenuItem>
|
|
79
|
+
</DropdownMenuContent>
|
|
80
|
+
</DropdownMenu>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { Table } from "@tanstack/react-table"
|
|
4
|
+
import { X } from "lucide-react"
|
|
5
|
+
|
|
6
|
+
import { Button } from "@/components/ui/button"
|
|
7
|
+
import { Input } from "@/components/ui/input"
|
|
8
|
+
import { DataTableViewOptions } from "@/app/examples/tasks/components/data-table-view-options"
|
|
9
|
+
|
|
10
|
+
import { priorities, statuses } from "../data/data"
|
|
11
|
+
import { DataTableFacetedFilter } from "./data-table-faceted-filter"
|
|
12
|
+
|
|
13
|
+
interface DataTableToolbarProps<TData> {
|
|
14
|
+
table: Table<TData>
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function DataTableToolbar<TData>({
|
|
18
|
+
table,
|
|
19
|
+
}: DataTableToolbarProps<TData>) {
|
|
20
|
+
const isFiltered =
|
|
21
|
+
table.getPreFilteredRowModel().rows.length >
|
|
22
|
+
table.getFilteredRowModel().rows.length
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div className="flex items-center justify-between">
|
|
26
|
+
<div className="flex flex-1 items-center space-x-2">
|
|
27
|
+
<Input
|
|
28
|
+
placeholder="Filter tasks..."
|
|
29
|
+
value={(table.getColumn("title")?.getFilterValue() as string) ?? ""}
|
|
30
|
+
onChange={(event) =>
|
|
31
|
+
table.getColumn("title")?.setFilterValue(event.target.value)
|
|
32
|
+
}
|
|
33
|
+
className="h-8 w-[150px] lg:w-[250px]"
|
|
34
|
+
/>
|
|
35
|
+
{table.getColumn("status") && (
|
|
36
|
+
<DataTableFacetedFilter
|
|
37
|
+
column={table.getColumn("status")}
|
|
38
|
+
title="Status"
|
|
39
|
+
options={statuses}
|
|
40
|
+
/>
|
|
41
|
+
)}
|
|
42
|
+
{table.getColumn("priority") && (
|
|
43
|
+
<DataTableFacetedFilter
|
|
44
|
+
column={table.getColumn("priority")}
|
|
45
|
+
title="Priority"
|
|
46
|
+
options={priorities}
|
|
47
|
+
/>
|
|
48
|
+
)}
|
|
49
|
+
{isFiltered && (
|
|
50
|
+
<Button
|
|
51
|
+
variant="ghost"
|
|
52
|
+
onClick={() => table.resetColumnFilters()}
|
|
53
|
+
className="h-8 px-2 lg:px-3"
|
|
54
|
+
>
|
|
55
|
+
Reset
|
|
56
|
+
<X className="ml-2 h-4 w-4" />
|
|
57
|
+
</Button>
|
|
58
|
+
)}
|
|
59
|
+
</div>
|
|
60
|
+
<DataTableViewOptions table={table} />
|
|
61
|
+
</div>
|
|
62
|
+
)
|
|
63
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { DropdownMenuTrigger } from "@radix-ui/react-dropdown-menu"
|
|
4
|
+
import { Table } from "@tanstack/react-table"
|
|
5
|
+
import { SlidersHorizontal } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
import { Button } from "@/components/ui/button"
|
|
8
|
+
import {
|
|
9
|
+
DropdownMenu,
|
|
10
|
+
DropdownMenuCheckboxItem,
|
|
11
|
+
DropdownMenuContent,
|
|
12
|
+
DropdownMenuLabel,
|
|
13
|
+
DropdownMenuSeparator,
|
|
14
|
+
} from "@/components/ui/dropdown-menu"
|
|
15
|
+
|
|
16
|
+
interface DataTableViewOptionsProps<TData> {
|
|
17
|
+
table: Table<TData>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function DataTableViewOptions<TData>({
|
|
21
|
+
table,
|
|
22
|
+
}: DataTableViewOptionsProps<TData>) {
|
|
23
|
+
return (
|
|
24
|
+
<DropdownMenu>
|
|
25
|
+
<DropdownMenuTrigger asChild>
|
|
26
|
+
<Button
|
|
27
|
+
variant="outline"
|
|
28
|
+
size="sm"
|
|
29
|
+
className="ml-auto hidden h-8 lg:flex"
|
|
30
|
+
>
|
|
31
|
+
<SlidersHorizontal className="mr-2 h-4 w-4" />
|
|
32
|
+
View
|
|
33
|
+
</Button>
|
|
34
|
+
</DropdownMenuTrigger>
|
|
35
|
+
<DropdownMenuContent align="end" className="w-[150px]">
|
|
36
|
+
<DropdownMenuLabel>Toggle columns</DropdownMenuLabel>
|
|
37
|
+
<DropdownMenuSeparator />
|
|
38
|
+
{table
|
|
39
|
+
.getAllColumns()
|
|
40
|
+
.filter(
|
|
41
|
+
(column) =>
|
|
42
|
+
typeof column.accessorFn !== "undefined" && column.getCanHide()
|
|
43
|
+
)
|
|
44
|
+
.map((column) => {
|
|
45
|
+
return (
|
|
46
|
+
<DropdownMenuCheckboxItem
|
|
47
|
+
key={column.id}
|
|
48
|
+
className="capitalize"
|
|
49
|
+
checked={column.getIsVisible()}
|
|
50
|
+
onCheckedChange={(value) => column.toggleVisibility(!!value)}
|
|
51
|
+
>
|
|
52
|
+
{column.id}
|
|
53
|
+
</DropdownMenuCheckboxItem>
|
|
54
|
+
)
|
|
55
|
+
})}
|
|
56
|
+
</DropdownMenuContent>
|
|
57
|
+
</DropdownMenu>
|
|
58
|
+
)
|
|
59
|
+
}
|