@podosoft/podokit 0.3.0 → 0.5.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 +2 -2
- package/dist/add.d.ts +2 -0
- package/dist/add.js +5 -1
- package/dist/assemble.d.ts +14 -0
- package/dist/assemble.js +60 -0
- package/dist/create.d.ts +2 -0
- package/dist/create.js +7 -0
- package/dist/eject.d.ts +11 -0
- package/dist/eject.js +27 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +122 -1
- package/dist/inspect.d.ts +43 -0
- package/dist/inspect.js +82 -0
- package/dist/lockfile.d.ts +80 -0
- package/dist/lockfile.js +193 -0
- package/dist/templates/base/dot-env.example +11 -6
- package/dist/templates/fullstack-nest-svelte/README.md +2 -2
- package/dist/templates/fullstack-nest-svelte/apps/api/package.json +21 -2
- package/dist/templates/fullstack-nest-svelte/apps/api/src/app.module.ts +6 -3
- package/dist/templates/fullstack-nest-svelte/apps/api/src/common/app-exception.ts +4 -12
- package/dist/templates/fullstack-nest-svelte/apps/api/src/config/env.validation.ts +1 -1
- package/dist/templates/fullstack-nest-svelte/apps/api/src/main.ts +1 -1
- package/dist/templates/fullstack-nest-svelte/apps/api/tsconfig.json +14 -5
- package/dist/templates/fullstack-nest-svelte/apps/web/package.json +4 -3
- package/dist/templates/fullstack-nest-svelte/apps/web/src/lib/api.ts +5 -0
- package/dist/templates/fullstack-nest-svelte/apps/web/src/lib/components/ui/select/select-content.svelte +1 -1
- package/dist/templates/fullstack-nest-svelte/apps/web/src/lib/components/ui/select/select-item.svelte +1 -1
- package/dist/templates/fullstack-nest-svelte/apps/web/src/lib/components/ui/switch/index.ts +7 -0
- package/dist/templates/fullstack-nest-svelte/apps/web/src/lib/components/ui/switch/switch.svelte +29 -0
- package/dist/templates/fullstack-nest-svelte/apps/web/src/lib/server/api.ts +19 -0
- package/dist/templates/fullstack-nest-svelte/apps/web/src/lib/server/backend-proxy.ts +44 -5
- package/dist/templates/fullstack-nest-svelte/apps/web/src/routes/+page.svelte +8 -3
- package/dist/templates/fullstack-nest-svelte/apps/web/src/routes/api/[...path]/+server.ts +12 -0
- package/dist/templates/fullstack-nest-svelte/apps/web/src/routes/api/auth/[...all]/+server.ts +12 -0
- package/dist/templates/fullstack-nest-svelte/dot-env.example +10 -5
- package/dist/templates/fullstack-nest-svelte/dot-gitignore +5 -0
- package/dist/templates/fullstack-nest-svelte/infra/docker/docker-compose.yml +37 -0
- package/dist/templates/fullstack-nest-svelte/infra/docker/sms-sink.mjs +40 -0
- package/dist/templates/fullstack-nest-svelte/package.json +11 -3
- package/dist/templates/fullstack-nest-svelte/tests/README.md +15 -0
- package/dist/templates/fullstack-nest-svelte/tests/api/health.api.spec.ts +14 -0
- package/dist/templates/fullstack-nest-svelte/tests/package.json +15 -0
- package/dist/templates/fullstack-nest-svelte/tests/playwright.config.ts +25 -0
- package/dist/templates/fullstack-nest-svelte/tests/ui/smoke.ui.spec.ts +8 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/app.d.ts +26 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/hooks.server.ts +20 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/app-sidebar.svelte +65 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/data-table.svelte +149 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/language-switch.svelte +33 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/sidebar-user-menu.svelte +44 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/table-pagination.svelte +39 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/table-toolbar.svelte +93 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/theme-toggle.svelte +27 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/collapsible/collapsible-content.svelte +7 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/collapsible/collapsible-trigger.svelte +7 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/collapsible/collapsible.svelte +11 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/collapsible/index.ts +13 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/pagination/index.ts +31 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/pagination/pagination-content.svelte +20 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/pagination/pagination-ellipsis.svelte +22 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/pagination/pagination-item.svelte +14 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/pagination/pagination-link.svelte +42 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/pagination/pagination-next-button.svelte +31 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/pagination/pagination-next.svelte +26 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/pagination/pagination-prev-button.svelte +31 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/pagination/pagination-previous.svelte +26 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/pagination/pagination.svelte +28 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sheet/index.ts +34 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sheet/sheet-close.svelte +7 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sheet/sheet-content.svelte +55 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sheet/sheet-description.svelte +17 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sheet/sheet-footer.svelte +20 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sheet/sheet-header.svelte +20 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sheet/sheet-overlay.svelte +17 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sheet/sheet-portal.svelte +7 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sheet/sheet-title.svelte +17 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sheet/sheet-trigger.svelte +7 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sheet/sheet.svelte +7 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/constants.ts +6 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/context.svelte.ts +81 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/index.ts +75 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-content.svelte +24 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-footer.svelte +21 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-group-action.svelte +33 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-group-content.svelte +21 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-group-label.svelte +33 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-group.svelte +21 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-header.svelte +21 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-input.svelte +21 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-inset.svelte +20 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-menu-action.svelte +37 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-menu-badge.svelte +24 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-menu-button.svelte +102 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-menu-item.svelte +21 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-menu-skeleton.svelte +36 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-menu-sub-button.svelte +39 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-menu-sub-item.svelte +21 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-menu-sub.svelte +21 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-menu.svelte +21 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-provider.svelte +53 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-rail.svelte +36 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-separator.svelte +19 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar-trigger.svelte +36 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sidebar/sidebar.svelte +108 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/user-avatar.svelte +12 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/hooks/is-mobile.svelte.ts +9 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/i18n/index.ts +27 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/i18n/messages.ts +575 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/server/guards.ts +22 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/+layout.server.ts +30 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/+layout.svelte +50 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/accept-invitation/[id]/+page.svelte +36 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/admin/+page.svelte +45 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/admin/account/+page.server.ts +5 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/admin/account/+page.svelte +685 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/admin/audit/+page.server.ts +6 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/admin/audit/+page.svelte +123 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/admin/organizations/+page.server.ts +6 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/admin/organizations/+page.svelte +264 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/admin/sessions/+page.server.ts +7 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/admin/sessions/+page.svelte +156 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/admin/settings/+page.server.ts +26 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/admin/settings/+page.svelte +322 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/admin/users/+page.server.ts +7 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(app)/admin/users/+page.svelte +552 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(auth)/+layout.svelte +13 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(auth)/forgot-password/+page.svelte +61 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(auth)/login/+page.server.ts +14 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(auth)/login/+page.svelte +181 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(auth)/reset-password/+page.svelte +51 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(auth)/signup/+page.svelte +76 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/(auth)/verify-email/+page.svelte +63 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/+layout.server.ts +22 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/+layout.svelte +20 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/+page.svelte +22 -0
- package/dist/templates/modules/admin-dashboard/files/apps/web/src/routes/oauth2/consent/+page.svelte +54 -0
- package/dist/templates/modules/admin-dashboard/files/tests/api/audit.api.spec.ts +97 -0
- package/dist/templates/modules/admin-dashboard/files/tests/api/auth-config.api.spec.ts +80 -0
- package/dist/templates/modules/admin-dashboard/files/tests/api/auth.api.spec.ts +306 -0
- package/dist/templates/modules/admin-dashboard/files/tests/api/email.api.spec.ts +120 -0
- package/dist/templates/modules/admin-dashboard/files/tests/api/users-admin.api.spec.ts +134 -0
- package/dist/templates/modules/admin-dashboard/files/tests/helpers/accounts.ts +6 -0
- package/dist/templates/modules/admin-dashboard/files/tests/helpers/hydration.ts +9 -0
- package/dist/templates/modules/admin-dashboard/files/tests/helpers/mailpit.ts +49 -0
- package/dist/templates/modules/admin-dashboard/files/tests/helpers/sms.ts +35 -0
- package/dist/templates/modules/admin-dashboard/files/tests/helpers/totp.ts +9 -0
- package/dist/templates/modules/admin-dashboard/files/tests/playwright.config.ts +26 -0
- package/dist/templates/modules/admin-dashboard/files/tests/seed.setup.ts +40 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/account.ui.spec.ts +126 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/audit.ui.spec.ts +16 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/auth.ui.spec.ts +45 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/dashboard.ui.spec.ts +25 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/data-table.ui.spec.ts +32 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/email-admin.ui.spec.ts +60 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/email.ui.spec.ts +42 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/guards.ui.spec.ts +22 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/i18n.ui.spec.ts +13 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/oidc.ui.spec.ts +57 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/organizations.ui.spec.ts +52 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/passkey.ui.spec.ts +36 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/sessions.ui.spec.ts +22 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/settings.ui.spec.ts +34 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/sidebar.ui.spec.ts +16 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/table-toolbar.ui.spec.ts +32 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/users-crud.ui.spec.ts +145 -0
- package/dist/templates/modules/admin-dashboard/files/tests/ui/users.ui.spec.ts +51 -0
- package/dist/templates/modules/admin-dashboard/module.manifest.json +47 -0
- package/dist/templates/modules/api-key-auth/module.manifest.json +3 -3
- package/dist/templates/modules/audit-log/files/apps/api/src/audit/README.md +59 -0
- package/dist/templates/modules/audit-log/files/apps/api/src/audit/audit-enabled.ts +16 -0
- package/dist/templates/modules/audit-log/files/apps/api/src/audit/audit-events.ts +34 -0
- package/dist/templates/modules/audit-log/files/apps/api/src/audit/audit-hook.ts +74 -0
- package/dist/templates/modules/audit-log/files/apps/api/src/audit/audit-log.entity.ts +29 -8
- package/dist/templates/modules/audit-log/files/apps/api/src/audit/audit.controller.ts +7 -2
- package/dist/templates/modules/audit-log/files/apps/api/src/audit/audit.decorator.ts +23 -0
- package/dist/templates/modules/audit-log/files/apps/api/src/audit/audit.interceptor.ts +38 -21
- package/dist/templates/modules/audit-log/files/apps/api/src/audit/audit.module.ts +2 -1
- package/dist/templates/modules/audit-log/files/apps/api/src/audit/audit.service.ts +36 -0
- package/dist/templates/modules/audit-log/files/apps/api/src/migrations/1720300000000-InitAuditLogs.ts +10 -4
- package/dist/templates/modules/audit-log/module.manifest.json +37 -8
- package/dist/templates/modules/auth/files/apps/api/src/account/account.controller.ts +85 -3
- package/dist/templates/modules/auth/files/apps/api/src/account/account.module.ts +2 -1
- package/dist/templates/modules/auth/files/apps/api/src/auth/auth-provider.ts +73 -0
- package/dist/templates/modules/auth/files/apps/api/src/auth/auth.ts +199 -31
- package/dist/templates/modules/auth/files/apps/api/src/auth/db.ts +12 -0
- package/dist/templates/modules/auth/files/apps/api/src/auth/feature-gate.ts +56 -0
- package/dist/templates/modules/auth/files/apps/api/src/auth/org-permissions.ts +22 -0
- package/dist/templates/modules/auth/files/apps/api/src/auth/permissions.ts +23 -0
- package/dist/templates/modules/auth/files/apps/api/src/auth-config/auth-config.controller.ts +33 -0
- package/dist/templates/modules/auth/files/apps/api/src/auth-config/auth-config.entity.ts +26 -0
- package/dist/templates/modules/auth/files/apps/api/src/auth-config/auth-config.module.ts +12 -0
- package/dist/templates/modules/auth/files/apps/api/src/auth-config/auth-config.service.ts +118 -0
- package/dist/templates/modules/auth/files/apps/api/src/mail/mailer.ts +65 -0
- package/dist/templates/modules/auth/files/apps/api/src/migrations/1720400000000-InitAppSettings.ts +38 -0
- package/dist/templates/modules/auth/files/apps/api/src/migrations/1720500000000-InitAuthConfig.ts +27 -0
- package/dist/templates/modules/auth/files/apps/api/src/settings/app-setting.entity.ts +16 -0
- package/dist/templates/modules/auth/files/apps/api/src/settings/flag-defaults.ts +25 -0
- package/dist/templates/modules/auth/files/apps/api/src/settings/settings.module.ts +11 -0
- package/dist/templates/modules/auth/files/apps/api/src/settings/settings.service.ts +57 -0
- package/dist/templates/modules/auth/files/apps/api/src/sms/sms.ts +23 -0
- package/dist/templates/modules/auth/module.manifest.json +54 -20
- package/dist/templates/modules/bullmq/files/apps/api/src/jobs/worker.module.ts +6 -3
- package/dist/templates/modules/bullmq/module.manifest.json +4 -4
- package/dist/templates/modules/file-upload/module.manifest.json +3 -3
- package/dist/templates/modules/job-progress/module.manifest.json +9 -9
- package/dist/templates/modules/logging/module.manifest.json +3 -3
- package/dist/templates/modules/object-storage-s3/files/infra/docker/minio.compose.yml +5 -3
- package/dist/templates/modules/object-storage-s3/module.manifest.json +5 -5
- package/dist/templates/modules/rate-limit/module.manifest.json +2 -2
- package/dist/templates/modules/redis/module.manifest.json +4 -4
- package/dist/templates/modules/sse/module.manifest.json +4 -4
- package/dist/templates/todo/README.md +2 -2
- package/dist/templates/todo/apps/api/package.json +21 -2
- package/dist/templates/todo/apps/api/src/app.module.ts +6 -3
- package/dist/templates/todo/apps/api/src/common/app-exception.ts +4 -12
- package/dist/templates/todo/apps/api/src/config/env.validation.ts +1 -1
- package/dist/templates/todo/apps/api/src/main.ts +1 -1
- package/dist/templates/todo/apps/api/tsconfig.json +14 -5
- package/dist/templates/todo/apps/web/package.json +4 -3
- package/dist/templates/todo/apps/web/src/lib/api.ts +5 -0
- package/dist/templates/todo/apps/web/src/lib/components/ui/switch/index.ts +7 -0
- package/dist/templates/todo/apps/web/src/lib/components/ui/switch/switch.svelte +29 -0
- package/dist/templates/todo/apps/web/src/lib/server/api.ts +19 -0
- package/dist/templates/todo/apps/web/src/lib/server/backend-proxy.ts +44 -5
- package/dist/templates/todo/apps/web/src/routes/+page.svelte +19 -18
- package/dist/templates/todo/apps/web/src/routes/api/[...path]/+server.ts +12 -0
- package/dist/templates/todo/apps/web/src/routes/api/auth/[...all]/+server.ts +12 -0
- package/dist/templates/todo/dot-env.example +10 -5
- package/dist/templates/todo/dot-gitignore +5 -0
- package/dist/templates/todo/infra/docker/docker-compose.yml +4 -0
- package/dist/templates/todo/package.json +11 -3
- package/dist/templates/todo/tests/README.md +15 -0
- package/dist/templates/todo/tests/api/health.api.spec.ts +14 -0
- package/dist/templates/todo/tests/package.json +15 -0
- package/dist/templates/todo/tests/playwright.config.ts +25 -0
- package/dist/templates/todo/tests/ui/smoke.ui.spec.ts +8 -0
- package/dist/update.d.ts +49 -0
- package/dist/update.js +158 -0
- package/package.json +2 -2
- package/dist/templates/fullstack-nest-svelte/apps/api/test/health.e2e-spec.ts +0 -23
- package/dist/templates/fullstack-nest-svelte/apps/web/src/routes/api/health/+server.ts +0 -12
- package/dist/templates/todo/apps/api/test/health.e2e-spec.ts +0 -23
- package/dist/templates/todo/apps/web/src/routes/api/health/+server.ts +0 -12
- package/dist/templates/todo/apps/web/src/routes/api/todos/+server.ts +0 -24
- package/dist/templates/todo/apps/web/src/routes/api/todos/[id]/+server.ts +0 -24
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export type ToolbarFilter = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
// First option is the "all" choice (usually value "").
|
|
6
|
+
options: { value: string; label: string }[];
|
|
7
|
+
};
|
|
8
|
+
export type ToolbarSearchField = { value: string; label: string };
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
import { Button } from "$lib/components/ui/button";
|
|
13
|
+
import { Input } from "$lib/components/ui/input";
|
|
14
|
+
import { Label } from "$lib/components/ui/label";
|
|
15
|
+
import * as Select from "$lib/components/ui/select";
|
|
16
|
+
|
|
17
|
+
// Shared toolbar above a DataTable. Filters (enum columns) and search (free-text
|
|
18
|
+
// columns that can't be a filter) both commit together on the Search button /
|
|
19
|
+
// Enter — never per keystroke, so many conditions apply in one pass. The search
|
|
20
|
+
// field itself is a select, so a page can search by Email, Name, ... whatever
|
|
21
|
+
// isn't covered by a filter.
|
|
22
|
+
type Props = {
|
|
23
|
+
filters?: ToolbarFilter[];
|
|
24
|
+
filterValues?: Record<string, string>;
|
|
25
|
+
searchFields?: ToolbarSearchField[]; // ≥1 to show the search row
|
|
26
|
+
searchField?: string; // selected field value (bound)
|
|
27
|
+
searchPlaceholder?: string;
|
|
28
|
+
search?: string; // the query text (bound)
|
|
29
|
+
filterHeading?: string;
|
|
30
|
+
searchHeading?: string;
|
|
31
|
+
searchButton?: string;
|
|
32
|
+
onSearch: () => void; // commit filters + search + field together
|
|
33
|
+
};
|
|
34
|
+
let {
|
|
35
|
+
filters = [],
|
|
36
|
+
filterValues = $bindable({}),
|
|
37
|
+
searchFields = [],
|
|
38
|
+
searchField = $bindable(""),
|
|
39
|
+
searchPlaceholder,
|
|
40
|
+
search = $bindable(""),
|
|
41
|
+
filterHeading = "Filter",
|
|
42
|
+
searchHeading = "Search",
|
|
43
|
+
searchButton = "Search",
|
|
44
|
+
onSearch,
|
|
45
|
+
}: Props = $props();
|
|
46
|
+
|
|
47
|
+
function filterTrigger(f: ToolbarFilter): string {
|
|
48
|
+
return f.options.find((o) => o.value === (filterValues[f.key] ?? ""))?.label ?? f.options[0]?.label ?? "";
|
|
49
|
+
}
|
|
50
|
+
const searchFieldLabel = $derived(
|
|
51
|
+
searchFields.find((f) => f.value === searchField)?.label ?? searchFields[0]?.label ?? "",
|
|
52
|
+
);
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<div class="flex flex-col gap-3 rounded-md border p-3">
|
|
56
|
+
{#if filters.length}
|
|
57
|
+
<div class="flex flex-wrap items-center gap-x-4 gap-y-2">
|
|
58
|
+
<span class="text-muted-foreground w-14 shrink-0 text-sm font-medium">{filterHeading}</span>
|
|
59
|
+
{#each filters as f (f.key)}
|
|
60
|
+
<div class="flex items-center gap-2">
|
|
61
|
+
<Label class="text-sm">{f.label}</Label>
|
|
62
|
+
<Select.Root type="single" bind:value={filterValues[f.key]}>
|
|
63
|
+
<Select.Trigger class="w-36">{filterTrigger(f)}</Select.Trigger>
|
|
64
|
+
<Select.Content>
|
|
65
|
+
{#each f.options as o (o.value)}
|
|
66
|
+
<Select.Item value={o.value}>{o.label}</Select.Item>
|
|
67
|
+
{/each}
|
|
68
|
+
</Select.Content>
|
|
69
|
+
</Select.Root>
|
|
70
|
+
</div>
|
|
71
|
+
{/each}
|
|
72
|
+
</div>
|
|
73
|
+
{/if}
|
|
74
|
+
{#if searchFields.length}
|
|
75
|
+
<form class="flex flex-wrap items-center gap-2" onsubmit={(e) => { e.preventDefault(); onSearch(); }}>
|
|
76
|
+
<span class="text-muted-foreground w-14 shrink-0 text-sm font-medium">{searchHeading}</span>
|
|
77
|
+
{#if searchFields.length > 1}
|
|
78
|
+
<Select.Root type="single" bind:value={searchField}>
|
|
79
|
+
<Select.Trigger class="w-32">{searchFieldLabel}</Select.Trigger>
|
|
80
|
+
<Select.Content>
|
|
81
|
+
{#each searchFields as f (f.value)}
|
|
82
|
+
<Select.Item value={f.value}>{f.label}</Select.Item>
|
|
83
|
+
{/each}
|
|
84
|
+
</Select.Content>
|
|
85
|
+
</Select.Root>
|
|
86
|
+
{:else}
|
|
87
|
+
<Label class="text-sm" for="toolbar-search">{searchFields[0].label}</Label>
|
|
88
|
+
{/if}
|
|
89
|
+
<Input id="toolbar-search" bind:value={search} placeholder={searchPlaceholder} class="max-w-xs flex-1" />
|
|
90
|
+
<Button type="submit">{searchButton}</Button>
|
|
91
|
+
</form>
|
|
92
|
+
{/if}
|
|
93
|
+
</div>
|
package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/theme-toggle.svelte
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { setMode } from "mode-watcher";
|
|
3
|
+
import SunIcon from "@lucide/svelte/icons/sun";
|
|
4
|
+
import MoonIcon from "@lucide/svelte/icons/moon";
|
|
5
|
+
import MonitorIcon from "@lucide/svelte/icons/monitor";
|
|
6
|
+
import * as DropdownMenu from "$lib/components/ui/dropdown-menu";
|
|
7
|
+
import { Button } from "$lib/components/ui/button";
|
|
8
|
+
import { getI18n } from "$lib/i18n";
|
|
9
|
+
|
|
10
|
+
const i18n = getI18n();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<DropdownMenu.Root>
|
|
14
|
+
<DropdownMenu.Trigger>
|
|
15
|
+
{#snippet child({ props })}
|
|
16
|
+
<Button {...props} variant="ghost" size="icon" aria-label={i18n.t.theme.toggle}>
|
|
17
|
+
<SunIcon class="size-4 dark:hidden" />
|
|
18
|
+
<MoonIcon class="hidden size-4 dark:block" />
|
|
19
|
+
</Button>
|
|
20
|
+
{/snippet}
|
|
21
|
+
</DropdownMenu.Trigger>
|
|
22
|
+
<DropdownMenu.Content align="end">
|
|
23
|
+
<DropdownMenu.Item onSelect={() => setMode("light")}><SunIcon class="mr-2 size-4" /> {i18n.t.theme.light}</DropdownMenu.Item>
|
|
24
|
+
<DropdownMenu.Item onSelect={() => setMode("dark")}><MoonIcon class="mr-2 size-4" /> {i18n.t.theme.dark}</DropdownMenu.Item>
|
|
25
|
+
<DropdownMenu.Item onSelect={() => setMode("system")}><MonitorIcon class="mr-2 size-4" /> {i18n.t.theme.system}</DropdownMenu.Item>
|
|
26
|
+
</DropdownMenu.Content>
|
|
27
|
+
</DropdownMenu.Root>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Collapsible as CollapsiblePrimitive } from "bits-ui";
|
|
3
|
+
|
|
4
|
+
let { ref = $bindable(null), ...restProps }: CollapsiblePrimitive.ContentProps = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<CollapsiblePrimitive.Content bind:ref data-slot="collapsible-content" {...restProps} />
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Collapsible as CollapsiblePrimitive } from "bits-ui";
|
|
3
|
+
|
|
4
|
+
let { ref = $bindable(null), ...restProps }: CollapsiblePrimitive.TriggerProps = $props();
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<CollapsiblePrimitive.Trigger bind:ref data-slot="collapsible-trigger" {...restProps} />
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Collapsible as CollapsiblePrimitive } from "bits-ui";
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
ref = $bindable(null),
|
|
6
|
+
open = $bindable(false),
|
|
7
|
+
...restProps
|
|
8
|
+
}: CollapsiblePrimitive.RootProps = $props();
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<CollapsiblePrimitive.Root bind:ref bind:open data-slot="collapsible" {...restProps} />
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Root from "./collapsible.svelte";
|
|
2
|
+
import Trigger from "./collapsible-trigger.svelte";
|
|
3
|
+
import Content from "./collapsible-content.svelte";
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
Root,
|
|
7
|
+
Content,
|
|
8
|
+
Trigger,
|
|
9
|
+
//
|
|
10
|
+
Root as Collapsible,
|
|
11
|
+
Content as CollapsibleContent,
|
|
12
|
+
Trigger as CollapsibleTrigger,
|
|
13
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Root from "./pagination.svelte";
|
|
2
|
+
import Content from "./pagination-content.svelte";
|
|
3
|
+
import Item from "./pagination-item.svelte";
|
|
4
|
+
import Link from "./pagination-link.svelte";
|
|
5
|
+
import PrevButton from "./pagination-prev-button.svelte";
|
|
6
|
+
import NextButton from "./pagination-next-button.svelte";
|
|
7
|
+
import Ellipsis from "./pagination-ellipsis.svelte";
|
|
8
|
+
import Previous from "./pagination-previous.svelte";
|
|
9
|
+
import Next from "./pagination-next.svelte";
|
|
10
|
+
|
|
11
|
+
export {
|
|
12
|
+
Root,
|
|
13
|
+
Content,
|
|
14
|
+
Item,
|
|
15
|
+
Link,
|
|
16
|
+
PrevButton, // old
|
|
17
|
+
NextButton, // old
|
|
18
|
+
Ellipsis,
|
|
19
|
+
Previous,
|
|
20
|
+
Next,
|
|
21
|
+
//
|
|
22
|
+
Root as Pagination,
|
|
23
|
+
Content as PaginationContent,
|
|
24
|
+
Item as PaginationItem,
|
|
25
|
+
Link as PaginationLink,
|
|
26
|
+
PrevButton as PaginationPrevButton, // old
|
|
27
|
+
NextButton as PaginationNextButton, // old
|
|
28
|
+
Ellipsis as PaginationEllipsis,
|
|
29
|
+
Previous as PaginationPrevious,
|
|
30
|
+
Next as PaginationNext,
|
|
31
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import { cn, type WithElementRef } from "$lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLUListElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<ul
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="pagination-content"
|
|
16
|
+
class={cn("gap-0.5 flex items-center", className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</ul>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import { cn, type WithElementRef, type WithoutChildren } from "$lib/utils.js";
|
|
4
|
+
import MoreHorizontalIcon from '@lucide/svelte/icons/more-horizontal';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithoutChildren<WithElementRef<HTMLAttributes<HTMLSpanElement>>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<span
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
aria-hidden="true"
|
|
16
|
+
data-slot="pagination-ellipsis"
|
|
17
|
+
class={cn("size-8 items-center justify-center [&_svg:not([class*='size-'])]:size-4 flex items-center justify-center", className)}
|
|
18
|
+
{...restProps}
|
|
19
|
+
>
|
|
20
|
+
<MoreHorizontalIcon />
|
|
21
|
+
<span class="sr-only">More pages</span>
|
|
22
|
+
</span>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLLiAttributes } from "svelte/elements";
|
|
3
|
+
import type { WithElementRef } from "$lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
children,
|
|
8
|
+
...restProps
|
|
9
|
+
}: WithElementRef<HTMLLiAttributes> = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<li bind:this={ref} data-slot="pagination-item" {...restProps}>
|
|
13
|
+
{@render children?.()}
|
|
14
|
+
</li>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Pagination as PaginationPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "$lib/utils.js";
|
|
4
|
+
import { buttonVariants, type ButtonSize } from "$lib/components/ui/button/index.js";
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
size = "icon",
|
|
9
|
+
isActive,
|
|
10
|
+
page,
|
|
11
|
+
children,
|
|
12
|
+
...restProps
|
|
13
|
+
}: PaginationPrimitive.PageProps & {
|
|
14
|
+
size?: ButtonSize;
|
|
15
|
+
isActive: boolean;
|
|
16
|
+
} = $props();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
{#snippet Fallback()}
|
|
20
|
+
{page.value}
|
|
21
|
+
{/snippet}
|
|
22
|
+
|
|
23
|
+
<PaginationPrimitive.Page
|
|
24
|
+
bind:ref
|
|
25
|
+
{page}
|
|
26
|
+
aria-current={isActive ? "page" : undefined}
|
|
27
|
+
data-slot="pagination-link"
|
|
28
|
+
data-active={isActive}
|
|
29
|
+
data-size={size}
|
|
30
|
+
class={cn(
|
|
31
|
+
buttonVariants({ size, variant: isActive ? "outline" : "ghost" }),
|
|
32
|
+
"cn-pagination-link",
|
|
33
|
+
className
|
|
34
|
+
)}
|
|
35
|
+
{...restProps}
|
|
36
|
+
>
|
|
37
|
+
{#if children}
|
|
38
|
+
{@render children?.()}
|
|
39
|
+
{:else}
|
|
40
|
+
{@render Fallback()}
|
|
41
|
+
{/if}
|
|
42
|
+
</PaginationPrimitive.Page>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Pagination as PaginationPrimitive } from "bits-ui";
|
|
3
|
+
import ChevronRightIcon from '@lucide/svelte/icons/chevron-right';
|
|
4
|
+
import { cn } from "$lib/utils.js";
|
|
5
|
+
import { buttonVariants } from "../button/index.js";
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
class: className,
|
|
10
|
+
children,
|
|
11
|
+
...restProps
|
|
12
|
+
}: PaginationPrimitive.NextButtonProps = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
{#snippet Fallback()}
|
|
16
|
+
<span>Next</span>
|
|
17
|
+
<ChevronRightIcon class={cn("size-4", className)} />
|
|
18
|
+
{/snippet}
|
|
19
|
+
|
|
20
|
+
<PaginationPrimitive.NextButton
|
|
21
|
+
bind:ref
|
|
22
|
+
aria-label="Go to next page"
|
|
23
|
+
class={cn(buttonVariants({ variant: "ghost" }), "pr-1.5!", className)}
|
|
24
|
+
{...restProps}
|
|
25
|
+
>
|
|
26
|
+
{#if children}
|
|
27
|
+
{@render children?.()}
|
|
28
|
+
{:else}
|
|
29
|
+
{@render Fallback()}
|
|
30
|
+
{/if}
|
|
31
|
+
</PaginationPrimitive.NextButton>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Pagination as PaginationPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "$lib/utils.js";
|
|
4
|
+
import { buttonVariants } from "$lib/components/ui/button/index.js";
|
|
5
|
+
import ChevronRightIcon from '@lucide/svelte/icons/chevron-right';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
class: className,
|
|
10
|
+
...restProps
|
|
11
|
+
}: PaginationPrimitive.NextButtonProps = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<PaginationPrimitive.NextButton
|
|
15
|
+
bind:ref
|
|
16
|
+
aria-label="Go to next page"
|
|
17
|
+
class={cn(
|
|
18
|
+
buttonVariants({ variant: "ghost", size: "default" }),
|
|
19
|
+
"pr-1.5!",
|
|
20
|
+
className
|
|
21
|
+
)}
|
|
22
|
+
{...restProps}
|
|
23
|
+
>
|
|
24
|
+
<span class="cn-pagination-next-text hidden sm:block">Next</span>
|
|
25
|
+
<ChevronRightIcon data-icon="inline-end" />
|
|
26
|
+
</PaginationPrimitive.NextButton>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Pagination as PaginationPrimitive } from "bits-ui";
|
|
3
|
+
import ChevronLeftIcon from '@lucide/svelte/icons/chevron-left';
|
|
4
|
+
import { cn } from "$lib/utils.js";
|
|
5
|
+
import { buttonVariants } from "../button/index.js";
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
class: className,
|
|
10
|
+
children,
|
|
11
|
+
...restProps
|
|
12
|
+
}: PaginationPrimitive.PrevButtonProps = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
{#snippet Fallback()}
|
|
16
|
+
<ChevronLeftIcon class={cn("size-4", className)} />
|
|
17
|
+
<span>Previous</span>
|
|
18
|
+
{/snippet}
|
|
19
|
+
|
|
20
|
+
<PaginationPrimitive.PrevButton
|
|
21
|
+
bind:ref
|
|
22
|
+
aria-label="Go to previous page"
|
|
23
|
+
class={cn(buttonVariants({ variant: "ghost" }), "pl-1.5!", className)}
|
|
24
|
+
{...restProps}
|
|
25
|
+
>
|
|
26
|
+
{#if children}
|
|
27
|
+
{@render children?.()}
|
|
28
|
+
{:else}
|
|
29
|
+
{@render Fallback()}
|
|
30
|
+
{/if}
|
|
31
|
+
</PaginationPrimitive.PrevButton>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Pagination as PaginationPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "$lib/utils.js";
|
|
4
|
+
import { buttonVariants } from "$lib/components/ui/button/index.js";
|
|
5
|
+
import ChevronLeftIcon from '@lucide/svelte/icons/chevron-left';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
ref = $bindable(null),
|
|
9
|
+
class: className,
|
|
10
|
+
...restProps
|
|
11
|
+
}: PaginationPrimitive.PrevButtonProps = $props();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<PaginationPrimitive.PrevButton
|
|
15
|
+
bind:ref
|
|
16
|
+
aria-label="Go to previous page"
|
|
17
|
+
class={cn(
|
|
18
|
+
buttonVariants({ variant: "ghost", size: "default" }),
|
|
19
|
+
"pl-1.5!",
|
|
20
|
+
className
|
|
21
|
+
)}
|
|
22
|
+
{...restProps}
|
|
23
|
+
>
|
|
24
|
+
<ChevronLeftIcon data-icon="inline-start" />
|
|
25
|
+
<span class="cn-pagination-previous-text hidden sm:block">Previous</span>
|
|
26
|
+
</PaginationPrimitive.PrevButton>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Pagination as PaginationPrimitive } from "bits-ui";
|
|
3
|
+
|
|
4
|
+
import { cn } from "$lib/utils.js";
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
ref = $bindable(null),
|
|
8
|
+
class: className,
|
|
9
|
+
count = 0,
|
|
10
|
+
perPage = 10,
|
|
11
|
+
page = $bindable(1),
|
|
12
|
+
siblingCount = 1,
|
|
13
|
+
...restProps
|
|
14
|
+
}: PaginationPrimitive.RootProps = $props();
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<PaginationPrimitive.Root
|
|
18
|
+
bind:ref
|
|
19
|
+
bind:page
|
|
20
|
+
role="navigation"
|
|
21
|
+
aria-label="pagination"
|
|
22
|
+
data-slot="pagination"
|
|
23
|
+
{count}
|
|
24
|
+
{perPage}
|
|
25
|
+
{siblingCount}
|
|
26
|
+
class={cn("cn-pagination mx-auto flex w-full justify-center", className)}
|
|
27
|
+
{...restProps}
|
|
28
|
+
/>
|
package/dist/templates/modules/admin-dashboard/files/apps/web/src/lib/components/ui/sheet/index.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Root from "./sheet.svelte";
|
|
2
|
+
import Portal from "./sheet-portal.svelte";
|
|
3
|
+
import Trigger from "./sheet-trigger.svelte";
|
|
4
|
+
import Close from "./sheet-close.svelte";
|
|
5
|
+
import Overlay from "./sheet-overlay.svelte";
|
|
6
|
+
import Content from "./sheet-content.svelte";
|
|
7
|
+
import Header from "./sheet-header.svelte";
|
|
8
|
+
import Footer from "./sheet-footer.svelte";
|
|
9
|
+
import Title from "./sheet-title.svelte";
|
|
10
|
+
import Description from "./sheet-description.svelte";
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
Root,
|
|
14
|
+
Close,
|
|
15
|
+
Trigger,
|
|
16
|
+
Portal,
|
|
17
|
+
Overlay,
|
|
18
|
+
Content,
|
|
19
|
+
Header,
|
|
20
|
+
Footer,
|
|
21
|
+
Title,
|
|
22
|
+
Description,
|
|
23
|
+
//
|
|
24
|
+
Root as Sheet,
|
|
25
|
+
Close as SheetClose,
|
|
26
|
+
Trigger as SheetTrigger,
|
|
27
|
+
Portal as SheetPortal,
|
|
28
|
+
Overlay as SheetOverlay,
|
|
29
|
+
Content as SheetContent,
|
|
30
|
+
Header as SheetHeader,
|
|
31
|
+
Footer as SheetFooter,
|
|
32
|
+
Title as SheetTitle,
|
|
33
|
+
Description as SheetDescription,
|
|
34
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
export type Side = "top" | "right" | "bottom" | "left";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import { Dialog as SheetPrimitive } from "bits-ui";
|
|
7
|
+
import type { Snippet } from "svelte";
|
|
8
|
+
import SheetPortal from "./sheet-portal.svelte";
|
|
9
|
+
import SheetOverlay from "./sheet-overlay.svelte";
|
|
10
|
+
import { Button } from "$lib/components/ui/button/index.js";
|
|
11
|
+
import XIcon from '@lucide/svelte/icons/x';
|
|
12
|
+
import { cn, type WithoutChildrenOrChild } from "$lib/utils.js";
|
|
13
|
+
import type { ComponentProps } from "svelte";
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
ref = $bindable(null),
|
|
17
|
+
class: className,
|
|
18
|
+
side = "right",
|
|
19
|
+
showCloseButton = true,
|
|
20
|
+
portalProps,
|
|
21
|
+
children,
|
|
22
|
+
...restProps
|
|
23
|
+
}: WithoutChildrenOrChild<SheetPrimitive.ContentProps> & {
|
|
24
|
+
portalProps?: WithoutChildrenOrChild<ComponentProps<typeof SheetPortal>>;
|
|
25
|
+
side?: Side;
|
|
26
|
+
showCloseButton?: boolean;
|
|
27
|
+
children: Snippet;
|
|
28
|
+
} = $props();
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<SheetPortal {...portalProps}>
|
|
32
|
+
<SheetOverlay />
|
|
33
|
+
<SheetPrimitive.Content
|
|
34
|
+
bind:ref
|
|
35
|
+
data-slot="sheet-content"
|
|
36
|
+
data-side={side}
|
|
37
|
+
class={cn(
|
|
38
|
+
"bg-popover text-popover-foreground fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10",
|
|
39
|
+
className
|
|
40
|
+
)}
|
|
41
|
+
{...restProps}
|
|
42
|
+
>
|
|
43
|
+
{@render children?.()}
|
|
44
|
+
{#if showCloseButton}
|
|
45
|
+
<SheetPrimitive.Close data-slot="sheet-close">
|
|
46
|
+
{#snippet child({ props })}
|
|
47
|
+
<Button variant="ghost" class="absolute top-3 right-3" size="icon-sm" {...props}>
|
|
48
|
+
<XIcon />
|
|
49
|
+
<span class="sr-only">Close</span>
|
|
50
|
+
</Button>
|
|
51
|
+
{/snippet}
|
|
52
|
+
</SheetPrimitive.Close>
|
|
53
|
+
{/if}
|
|
54
|
+
</SheetPrimitive.Content>
|
|
55
|
+
</SheetPortal>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as SheetPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "$lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: SheetPrimitive.DescriptionProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<SheetPrimitive.Description
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="sheet-description"
|
|
15
|
+
class={cn("text-muted-foreground text-sm", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from "$lib/utils.js";
|
|
3
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="sheet-footer"
|
|
16
|
+
class={cn("gap-2 p-4 mt-auto flex flex-col", className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import { cn, type WithElementRef } from "$lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="sheet-header"
|
|
16
|
+
class={cn("gap-0.5 p-4 flex flex-col", className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as SheetPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "$lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: SheetPrimitive.OverlayProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<SheetPrimitive.Overlay
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="sheet-overlay"
|
|
15
|
+
class={cn("bg-black/10 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as SheetPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "$lib/utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: SheetPrimitive.TitleProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<SheetPrimitive.Title
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="sheet-title"
|
|
15
|
+
class={cn("text-foreground text-base font-medium", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|