moonhead 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/dist/components/layout/app-header.d.ts +1 -0
- package/dist/components/layout/app-header.js +1 -0
- package/dist/components/layout/app-sidebar.d.ts +9 -0
- package/dist/components/layout/app-sidebar.js +1 -0
- package/dist/components/layout/brand-logo.d.ts +2 -0
- package/dist/components/layout/brand-logo.js +1 -0
- package/dist/components/layout/user-menu.d.ts +6 -0
- package/dist/components/layout/user-menu.js +1 -0
- package/dist/components/ui/action-form.d.ts +10 -0
- package/dist/components/ui/action-form.js +1 -0
- package/dist/components/ui/alert-dialog.d.ts +14 -0
- package/dist/components/ui/alert-dialog.js +1 -0
- package/dist/components/ui/alert.d.ts +12 -0
- package/dist/components/ui/alert.js +1 -0
- package/dist/components/ui/avatar.d.ts +12 -0
- package/dist/components/ui/avatar.js +1 -0
- package/dist/components/ui/badge.d.ts +2 -0
- package/dist/components/ui/badge.js +1 -0
- package/dist/components/ui/button.d.ts +12 -0
- package/dist/components/ui/button.js +1 -0
- package/dist/components/ui/card.d.ts +2 -0
- package/dist/components/ui/card.js +1 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/checkbox.js +1 -0
- package/dist/components/ui/combobox.d.ts +18 -0
- package/dist/components/ui/combobox.js +1 -0
- package/dist/components/ui/copy-button.d.ts +8 -0
- package/dist/components/ui/copy-button.js +1 -0
- package/dist/components/ui/country-select.d.ts +12 -0
- package/dist/components/ui/country-select.js +1 -0
- package/dist/components/ui/data-table.d.ts +11 -0
- package/dist/components/ui/data-table.js +1 -0
- package/dist/components/ui/date-range-picker.d.ts +25 -0
- package/dist/components/ui/date-range-picker.js +1 -0
- package/dist/components/ui/dialog.d.ts +19 -0
- package/dist/components/ui/dialog.js +1 -0
- package/dist/components/ui/drawer.d.ts +24 -0
- package/dist/components/ui/drawer.js +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +17 -0
- package/dist/components/ui/dropdown-menu.js +1 -0
- package/dist/components/ui/field.d.ts +7 -0
- package/dist/components/ui/field.js +1 -0
- package/dist/components/ui/fieldset.d.ts +4 -0
- package/dist/components/ui/fieldset.js +1 -0
- package/dist/components/ui/form-field.d.ts +17 -0
- package/dist/components/ui/form-field.js +1 -0
- package/dist/components/ui/form.d.ts +3 -0
- package/dist/components/ui/form.js +1 -0
- package/dist/components/ui/icon-tile.d.ts +5 -0
- package/dist/components/ui/icon-tile.js +1 -0
- package/dist/components/ui/identity.d.ts +6 -0
- package/dist/components/ui/identity.js +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.js +1 -0
- package/dist/components/ui/number-input.d.ts +19 -0
- package/dist/components/ui/number-input.js +1 -0
- package/dist/components/ui/otp-field.d.ts +6 -0
- package/dist/components/ui/otp-field.js +1 -0
- package/dist/components/ui/page-toolbar.d.ts +9 -0
- package/dist/components/ui/page-toolbar.js +1 -0
- package/dist/components/ui/password-input.d.ts +7 -0
- package/dist/components/ui/password-input.js +1 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/radio-group.js +1 -0
- package/dist/components/ui/search-input.d.ts +4 -0
- package/dist/components/ui/search-input.js +1 -0
- package/dist/components/ui/section-card.d.ts +7 -0
- package/dist/components/ui/section-card.js +1 -0
- package/dist/components/ui/select-field.d.ts +19 -0
- package/dist/components/ui/select-field.js +1 -0
- package/dist/components/ui/select.d.ts +17 -0
- package/dist/components/ui/select.js +1 -0
- package/dist/components/ui/sidebar.d.ts +27 -0
- package/dist/components/ui/sidebar.js +1 -0
- package/dist/components/ui/slider.d.ts +10 -0
- package/dist/components/ui/slider.js +1 -0
- package/dist/components/ui/sort-button.d.ts +5 -0
- package/dist/components/ui/sort-button.js +1 -0
- package/dist/components/ui/spinner.d.ts +4 -0
- package/dist/components/ui/spinner.js +1 -0
- package/dist/components/ui/status-badge.d.ts +11 -0
- package/dist/components/ui/status-badge.js +1 -0
- package/dist/components/ui/switch-field.d.ts +18 -0
- package/dist/components/ui/switch-field.js +1 -0
- package/dist/components/ui/switch.d.ts +3 -0
- package/dist/components/ui/switch.js +1 -0
- package/dist/components/ui/table-pagination.d.ts +9 -0
- package/dist/components/ui/table-pagination.js +1 -0
- package/dist/components/ui/table.d.ts +18 -0
- package/dist/components/ui/table.js +1 -0
- package/dist/components/ui/tabs.d.ts +8 -0
- package/dist/components/ui/tabs.js +1 -0
- package/dist/components/ui/tag-input.d.ts +9 -0
- package/dist/components/ui/tag-input.js +1 -0
- package/dist/components/ui/text-link.d.ts +10 -0
- package/dist/components/ui/text-link.js +1 -0
- package/dist/components/ui/textarea.d.ts +2 -0
- package/dist/components/ui/textarea.js +1 -0
- package/dist/components/ui/toast.d.ts +1 -0
- package/dist/components/ui/toast.js +1 -0
- package/dist/components/ui/tree.d.ts +32 -0
- package/dist/components/ui/tree.js +1 -0
- package/dist/db/client.d.ts +8 -0
- package/dist/db/client.js +1 -0
- package/dist/db/index.d.ts +3 -0
- package/dist/db/index.js +1 -0
- package/dist/db/logger.d.ts +2 -0
- package/dist/db/logger.js +1 -0
- package/dist/db/migrations/20260628182304_wonderful_groot/migration.sql +289 -0
- package/dist/db/migrations/20260628182304_wonderful_groot/snapshot.json +3750 -0
- package/dist/db/migrations/20260630082829_wet_robin_chapel/migration.sql +2 -0
- package/dist/db/migrations/20260630082829_wet_robin_chapel/snapshot.json +3791 -0
- package/dist/db/migrations/20260702132335_wooden_iron_monger/migration.sql +48 -0
- package/dist/db/migrations/20260702132335_wooden_iron_monger/snapshot.json +4407 -0
- package/dist/db/migrations/20260702142948_vengeful_rhino/migration.sql +1 -0
- package/dist/db/migrations/20260702142948_vengeful_rhino/snapshot.json +4420 -0
- package/dist/db/migrations/20260702185813_curved_pyro/migration.sql +16 -0
- package/dist/db/migrations/20260702185813_curved_pyro/snapshot.json +4646 -0
- package/dist/db/migrations/20260702192041_shiny_franklin_storm/migration.sql +16 -0
- package/dist/db/migrations/20260702192041_shiny_franklin_storm/snapshot.json +4872 -0
- package/dist/db/migrations/20260704101548_bizarre_namorita/migration.sql +1 -0
- package/dist/db/migrations/20260704101548_bizarre_namorita/snapshot.json +4885 -0
- package/dist/db/migrations/20260704105911_sleepy_juggernaut/migration.sql +1 -0
- package/dist/db/migrations/20260704105911_sleepy_juggernaut/snapshot.json +4898 -0
- package/dist/db/migrations/20260704115959_lean_sandman/migration.sql +1 -0
- package/dist/db/migrations/20260704115959_lean_sandman/snapshot.json +4885 -0
- package/dist/db/migrations/20260707231532_daffy_captain_stacy/migration.sql +10 -0
- package/dist/db/migrations/20260707231532_daffy_captain_stacy/snapshot.json +4919 -0
- package/dist/db/migrations/20260708190355_spooky_jimmy_woo/migration.sql +3 -0
- package/dist/db/migrations/20260708190355_spooky_jimmy_woo/snapshot.json +4970 -0
- package/dist/db/migrations/20260711145212_drop_legacy_earning_status/migration.sql +7 -0
- package/dist/db/migrations/20260711145212_drop_legacy_earning_status/snapshot.json +4968 -0
- package/dist/db/migrations/20260712161249_dashboard_stat_indexes/migration.sql +3 -0
- package/dist/db/migrations/20260712161249_dashboard_stat_indexes/snapshot.json +5038 -0
- package/dist/db/migrations/20260713013911_add_payout_paid_at/migration.sql +2 -0
- package/dist/db/migrations/20260713013911_add_payout_paid_at/snapshot.json +5072 -0
- package/dist/db/schema/analytics-outbox.d.ts +145 -0
- package/dist/db/schema/analytics-outbox.js +1 -0
- package/dist/db/schema/audit-logs.d.ts +204 -0
- package/dist/db/schema/audit-logs.js +1 -0
- package/dist/db/schema/campaigns.d.ts +180 -0
- package/dist/db/schema/campaigns.js +1 -0
- package/dist/db/schema/casinos.d.ts +129 -0
- package/dist/db/schema/casinos.js +1 -0
- package/dist/db/schema/commission-rule-groups.d.ts +84 -0
- package/dist/db/schema/commission-rule-groups.js +1 -0
- package/dist/db/schema/commission-rules.d.ts +145 -0
- package/dist/db/schema/commission-rules.js +1 -0
- package/dist/db/schema/commissions.d.ts +242 -0
- package/dist/db/schema/commissions.js +1 -0
- package/dist/db/schema/conversions.d.ts +302 -0
- package/dist/db/schema/conversions.js +1 -0
- package/dist/db/schema/deals.d.ts +180 -0
- package/dist/db/schema/deals.js +1 -0
- package/dist/db/schema/earnings.d.ts +262 -0
- package/dist/db/schema/earnings.js +1 -0
- package/dist/db/schema/groups.d.ts +214 -0
- package/dist/db/schema/groups.js +1 -0
- package/dist/db/schema/index.d.ts +18 -0
- package/dist/db/schema/index.js +1 -0
- package/dist/db/schema/payouts.d.ts +182 -0
- package/dist/db/schema/payouts.js +1 -0
- package/dist/db/schema/platform-settings.d.ts +84 -0
- package/dist/db/schema/platform-settings.js +1 -0
- package/dist/db/schema/player-activity.d.ts +159 -0
- package/dist/db/schema/player-activity.js +1 -0
- package/dist/db/schema/revshare-carryover.d.ts +129 -0
- package/dist/db/schema/revshare-carryover.js +1 -0
- package/dist/db/schema/sessions.d.ts +213 -0
- package/dist/db/schema/sessions.js +1 -0
- package/dist/db/schema/table.d.ts +1 -0
- package/dist/db/schema/table.js +1 -0
- package/dist/db/schema/users.d.ts +609 -0
- package/dist/db/schema/users.js +1 -0
- package/dist/db/schema/verification-tokens.d.ts +106 -0
- package/dist/db/schema/verification-tokens.js +1 -0
- package/dist/db/types/branded.d.ts +3 -0
- package/dist/db/types/branded.js +0 -0
- package/dist/db/types/commission-rules.d.ts +70 -0
- package/dist/db/types/commission-rules.js +1 -0
- package/dist/db/types/index.d.ts +2 -0
- package/dist/db/types/index.js +1 -0
- package/dist/emails/admin/support-message.d.ts +39 -0
- package/dist/emails/admin/support-message.js +5 -0
- package/dist/emails/affiliate/activated.d.ts +33 -0
- package/dist/emails/affiliate/activated.js +1 -0
- package/dist/emails/affiliate/deal-notice.d.ts +35 -0
- package/dist/emails/affiliate/deal-notice.js +1 -0
- package/dist/emails/affiliate/invite.d.ts +35 -0
- package/dist/emails/affiliate/invite.js +1 -0
- package/dist/emails/affiliate/signup-verify.d.ts +35 -0
- package/dist/emails/affiliate/signup-verify.js +1 -0
- package/dist/emails/auth/password-reset.d.ts +37 -0
- package/dist/emails/auth/password-reset.js +1 -0
- package/dist/emails/layout.d.ts +10 -0
- package/dist/emails/layout.js +1 -0
- package/dist/emails/manager/affiliate-activated.d.ts +33 -0
- package/dist/emails/manager/affiliate-activated.js +1 -0
- package/dist/emails/manager/bulk-affiliates-activated.d.ts +33 -0
- package/dist/emails/manager/bulk-affiliates-activated.js +1 -0
- package/dist/emails/manager/invite.d.ts +35 -0
- package/dist/emails/manager/invite.js +1 -0
- package/dist/emails/manager/pending-approval.d.ts +33 -0
- package/dist/emails/manager/pending-approval.js +1 -0
- package/dist/emails/preview-env.d.ts +2 -0
- package/dist/emails/preview-env.js +1 -0
- package/dist/features/affiliates/actions.d.ts +60 -0
- package/dist/features/affiliates/actions.js +1 -0
- package/dist/features/affiliates/activation-email.d.ts +8 -0
- package/dist/features/affiliates/activation-email.js +1 -0
- package/dist/features/affiliates/bulk-approve.d.ts +2 -0
- package/dist/features/affiliates/bulk-approve.js +1 -0
- package/dist/features/affiliates/components/affiliate-actions-menu.d.ts +6 -0
- package/dist/features/affiliates/components/affiliate-actions-menu.js +1 -0
- package/dist/features/affiliates/components/affiliate-create-button.d.ts +1 -0
- package/dist/features/affiliates/components/affiliate-create-button.js +1 -0
- package/dist/features/affiliates/components/affiliate-detail-tabs.d.ts +6 -0
- package/dist/features/affiliates/components/affiliate-detail-tabs.js +1 -0
- package/dist/features/affiliates/components/affiliate-dialog.d.ts +11 -0
- package/dist/features/affiliates/components/affiliate-dialog.js +1 -0
- package/dist/features/affiliates/components/affiliate-profile-fields.d.ts +6 -0
- package/dist/features/affiliates/components/affiliate-profile-fields.js +1 -0
- package/dist/features/affiliates/components/affiliate-status-badge.d.ts +4 -0
- package/dist/features/affiliates/components/affiliate-status-badge.js +1 -0
- package/dist/features/affiliates/components/affiliate-status-tabs.d.ts +4 -0
- package/dist/features/affiliates/components/affiliate-status-tabs.js +1 -0
- package/dist/features/affiliates/components/affiliates-table.d.ts +10 -0
- package/dist/features/affiliates/components/affiliates-table.js +1 -0
- package/dist/features/affiliates/components/assign-parent-dialog.d.ts +5 -0
- package/dist/features/affiliates/components/assign-parent-dialog.js +1 -0
- package/dist/features/affiliates/components/detach-affiliate-confirm.d.ts +5 -0
- package/dist/features/affiliates/components/detach-affiliate-confirm.js +1 -0
- package/dist/features/affiliates/components/reject-affiliate-confirm.d.ts +5 -0
- package/dist/features/affiliates/components/reject-affiliate-confirm.js +1 -0
- package/dist/features/affiliates/components/sub-affiliate-invite-button.d.ts +3 -0
- package/dist/features/affiliates/components/sub-affiliate-invite-button.js +1 -0
- package/dist/features/affiliates/invite.d.ts +6 -0
- package/dist/features/affiliates/invite.js +1 -0
- package/dist/features/affiliates/list-params.d.ts +27 -0
- package/dist/features/affiliates/list-params.js +1 -0
- package/dist/features/affiliates/pending-notification.d.ts +18 -0
- package/dist/features/affiliates/pending-notification.js +1 -0
- package/dist/features/affiliates/sub-invite.d.ts +7 -0
- package/dist/features/affiliates/sub-invite.js +1 -0
- package/dist/features/audit/action-labels.d.ts +15 -0
- package/dist/features/audit/action-labels.js +1 -0
- package/dist/features/audit/components/audit-log-table.d.ts +5 -0
- package/dist/features/audit/components/audit-log-table.js +1 -0
- package/dist/features/audit/list-params.d.ts +2 -0
- package/dist/features/audit/list-params.js +1 -0
- package/dist/features/audit/read.d.ts +27 -0
- package/dist/features/audit/read.js +1 -0
- package/dist/features/auth/actions.d.ts +33 -0
- package/dist/features/auth/actions.js +1 -0
- package/dist/features/auth/authorization.d.ts +14 -0
- package/dist/features/auth/authorization.js +1 -0
- package/dist/features/auth/components/accept-invite-form.d.ts +3 -0
- package/dist/features/auth/components/accept-invite-form.js +1 -0
- package/dist/features/auth/components/forgot-password-form.d.ts +1 -0
- package/dist/features/auth/components/forgot-password-form.js +1 -0
- package/dist/features/auth/components/permissions-form.d.ts +5 -0
- package/dist/features/auth/components/permissions-form.js +1 -0
- package/dist/features/auth/components/reset-password-form.d.ts +3 -0
- package/dist/features/auth/components/reset-password-form.js +1 -0
- package/dist/features/auth/components/signin-form.d.ts +5 -0
- package/dist/features/auth/components/signin-form.js +1 -0
- package/dist/features/auth/components/signup-form.d.ts +1 -0
- package/dist/features/auth/components/signup-form.js +1 -0
- package/dist/features/auth/components/verify-email-form.d.ts +3 -0
- package/dist/features/auth/components/verify-email-form.js +1 -0
- package/dist/features/auth/password-reset.d.ts +6 -0
- package/dist/features/auth/password-reset.js +1 -0
- package/dist/features/auth/permissions.d.ts +49 -0
- package/dist/features/auth/permissions.js +1 -0
- package/dist/features/auth/require.d.ts +3 -0
- package/dist/features/auth/require.js +1 -0
- package/dist/features/auth/signup-email.d.ts +6 -0
- package/dist/features/auth/signup-email.js +1 -0
- package/dist/features/campaigns/actions.d.ts +53 -0
- package/dist/features/campaigns/actions.js +1 -0
- package/dist/features/campaigns/components/campaign-dialog.d.ts +7 -0
- package/dist/features/campaigns/components/campaign-dialog.js +1 -0
- package/dist/features/campaigns/components/campaign-row-actions.d.ts +8 -0
- package/dist/features/campaigns/components/campaign-row-actions.js +1 -0
- package/dist/features/campaigns/components/campaign-status-badge.d.ts +6 -0
- package/dist/features/campaigns/components/campaign-status-badge.js +1 -0
- package/dist/features/campaigns/components/campaign-status-tabs.d.ts +1 -0
- package/dist/features/campaigns/components/campaign-status-tabs.js +1 -0
- package/dist/features/campaigns/components/campaigns-table.d.ts +7 -0
- package/dist/features/campaigns/components/campaigns-table.js +1 -0
- package/dist/features/campaigns/components/create-campaign-button.d.ts +5 -0
- package/dist/features/campaigns/components/create-campaign-button.js +1 -0
- package/dist/features/campaigns/components/sub-id-builder.d.ts +4 -0
- package/dist/features/campaigns/components/sub-id-builder.js +1 -0
- package/dist/features/campaigns/components/tracking-link-box.d.ts +3 -0
- package/dist/features/campaigns/components/tracking-link-box.js +1 -0
- package/dist/features/campaigns/components/tracking-link-cell.d.ts +4 -0
- package/dist/features/campaigns/components/tracking-link-cell.js +1 -0
- package/dist/features/campaigns/components/tracking-link-dialog.d.ts +6 -0
- package/dist/features/campaigns/components/tracking-link-dialog.js +1 -0
- package/dist/features/campaigns/list-params.d.ts +14 -0
- package/dist/features/campaigns/list-params.js +1 -0
- package/dist/features/campaigns/tracking-url.d.ts +8 -0
- package/dist/features/campaigns/tracking-url.js +1 -0
- package/dist/features/casinos/actions.d.ts +39 -0
- package/dist/features/casinos/actions.js +1 -0
- package/dist/features/casinos/components/casino-create-button.d.ts +1 -0
- package/dist/features/casinos/components/casino-create-button.js +1 -0
- package/dist/features/casinos/components/casino-dialog.d.ts +11 -0
- package/dist/features/casinos/components/casino-dialog.js +1 -0
- package/dist/features/casinos/components/casino-form-fields.d.ts +7 -0
- package/dist/features/casinos/components/casino-form-fields.js +1 -0
- package/dist/features/casinos/components/casino-status-tabs.d.ts +1 -0
- package/dist/features/casinos/components/casino-status-tabs.js +1 -0
- package/dist/features/casinos/components/casinos-table.d.ts +6 -0
- package/dist/features/casinos/components/casinos-table.js +1 -0
- package/dist/features/casinos/components/delete-casino-confirm.d.ts +5 -0
- package/dist/features/casinos/components/delete-casino-confirm.js +1 -0
- package/dist/features/casinos/list-params.d.ts +14 -0
- package/dist/features/casinos/list-params.js +1 -0
- package/dist/features/commissions/actions.d.ts +76 -0
- package/dist/features/commissions/actions.js +1 -0
- package/dist/features/commissions/components/casino-bindings-field.d.ts +10 -0
- package/dist/features/commissions/components/casino-bindings-field.js +1 -0
- package/dist/features/commissions/components/commission-create-button.d.ts +1 -0
- package/dist/features/commissions/components/commission-create-button.js +1 -0
- package/dist/features/commissions/components/commission-detail-dialog.d.ts +5 -0
- package/dist/features/commissions/components/commission-detail-dialog.js +1 -0
- package/dist/features/commissions/components/commission-editor.d.ts +8 -0
- package/dist/features/commissions/components/commission-editor.js +1 -0
- package/dist/features/commissions/components/commission-read-view.d.ts +5 -0
- package/dist/features/commissions/components/commission-read-view.js +1 -0
- package/dist/features/commissions/components/commission-status-badge.d.ts +4 -0
- package/dist/features/commissions/components/commission-status-badge.js +1 -0
- package/dist/features/commissions/components/commission-status-tabs.d.ts +1 -0
- package/dist/features/commissions/components/commission-status-tabs.js +1 -0
- package/dist/features/commissions/components/commissions-table.d.ts +14 -0
- package/dist/features/commissions/components/commissions-table.js +1 -0
- package/dist/features/commissions/components/delete-commission-confirm.d.ts +5 -0
- package/dist/features/commissions/components/delete-commission-confirm.js +1 -0
- package/dist/features/commissions/components/duplicate-commission-dialog.d.ts +6 -0
- package/dist/features/commissions/components/duplicate-commission-dialog.js +1 -0
- package/dist/features/commissions/components/rule-editor/conditions-block.d.ts +9 -0
- package/dist/features/commissions/components/rule-editor/conditions-block.js +1 -0
- package/dist/features/commissions/components/rule-editor/modifiers-block.d.ts +9 -0
- package/dist/features/commissions/components/rule-editor/modifiers-block.js +1 -0
- package/dist/features/commissions/components/rule-editor/qualifiers-block.d.ts +9 -0
- package/dist/features/commissions/components/rule-editor/qualifiers-block.js +1 -0
- package/dist/features/commissions/components/rule-editor/reducer.d.ts +102 -0
- package/dist/features/commissions/components/rule-editor/reducer.js +1 -0
- package/dist/features/commissions/components/rule-editor/rewards-block.d.ts +9 -0
- package/dist/features/commissions/components/rule-editor/rewards-block.js +1 -0
- package/dist/features/commissions/components/rule-editor/rule-card.d.ts +10 -0
- package/dist/features/commissions/components/rule-editor/rule-card.js +1 -0
- package/dist/features/commissions/components/rule-editor/rule-editor.d.ts +7 -0
- package/dist/features/commissions/components/rule-editor/rule-editor.js +1 -0
- package/dist/features/commissions/components/rule-editor/rule-group-card.d.ts +9 -0
- package/dist/features/commissions/components/rule-editor/rule-group-card.js +1 -0
- package/dist/features/commissions/components/rule-editor/state.d.ts +21 -0
- package/dist/features/commissions/components/rule-editor/state.js +1 -0
- package/dist/features/commissions/components/rule-groups-read-view.d.ts +4 -0
- package/dist/features/commissions/components/rule-groups-read-view.js +1 -0
- package/dist/features/commissions/list-params.d.ts +14 -0
- package/dist/features/commissions/list-params.js +1 -0
- package/dist/features/commissions/rule-validation.d.ts +173 -0
- package/dist/features/commissions/rule-validation.js +1 -0
- package/dist/features/dashboard/affiliate-queries.d.ts +14 -0
- package/dist/features/dashboard/affiliate-queries.js +1 -0
- package/dist/features/dashboard/clickhouse.d.ts +3 -0
- package/dist/features/dashboard/clickhouse.js +2 -0
- package/dist/features/dashboard/components/affiliate-charts.d.ts +5 -0
- package/dist/features/dashboard/components/affiliate-charts.js +1 -0
- package/dist/features/dashboard/components/affiliate-stats.d.ts +5 -0
- package/dist/features/dashboard/components/affiliate-stats.js +1 -0
- package/dist/features/dashboard/components/charts/funnel-chart.d.ts +11 -0
- package/dist/features/dashboard/components/charts/funnel-chart.js +1 -0
- package/dist/features/dashboard/components/charts/rank-bar-chart.d.ts +10 -0
- package/dist/features/dashboard/components/charts/rank-bar-chart.js +1 -0
- package/dist/features/dashboard/components/charts/time-series-chart.d.ts +12 -0
- package/dist/features/dashboard/components/charts/time-series-chart.js +1 -0
- package/dist/features/dashboard/components/charts-grid.d.ts +8 -0
- package/dist/features/dashboard/components/charts-grid.js +1 -0
- package/dist/features/dashboard/components/dashboard-charts.d.ts +4 -0
- package/dist/features/dashboard/components/dashboard-charts.js +1 -0
- package/dist/features/dashboard/components/dashboard-period-tabs.d.ts +1 -0
- package/dist/features/dashboard/components/dashboard-period-tabs.js +1 -0
- package/dist/features/dashboard/components/money-stat-card.d.ts +6 -0
- package/dist/features/dashboard/components/money-stat-card.js +1 -0
- package/dist/features/dashboard/components/stat-card.d.ts +6 -0
- package/dist/features/dashboard/components/stat-card.js +1 -0
- package/dist/features/dashboard/components/top-affiliates.d.ts +4 -0
- package/dist/features/dashboard/components/top-affiliates.js +1 -0
- package/dist/features/dashboard/list-params.d.ts +24 -0
- package/dist/features/dashboard/list-params.js +1 -0
- package/dist/features/dashboard/queries.d.ts +63 -0
- package/dist/features/dashboard/queries.js +1 -0
- package/dist/features/dashboard/series.d.ts +32 -0
- package/dist/features/dashboard/series.js +1 -0
- package/dist/features/deals/actions.d.ts +60 -0
- package/dist/features/deals/actions.js +1 -0
- package/dist/features/deals/components/affiliate-deals.d.ts +10 -0
- package/dist/features/deals/components/affiliate-deals.js +1 -0
- package/dist/features/deals/components/assign-deal-button.d.ts +9 -0
- package/dist/features/deals/components/assign-deal-button.js +1 -0
- package/dist/features/deals/components/deal-dialog.d.ts +19 -0
- package/dist/features/deals/components/deal-dialog.js +1 -0
- package/dist/features/deals/components/deal-row-actions.d.ts +6 -0
- package/dist/features/deals/components/deal-row-actions.js +1 -0
- package/dist/features/deals/components/deal-status-badge.d.ts +10 -0
- package/dist/features/deals/components/deal-status-badge.js +1 -0
- package/dist/features/deals/components/deal-status-tabs.d.ts +1 -0
- package/dist/features/deals/components/deal-status-tabs.js +1 -0
- package/dist/features/deals/components/delegate-deal-button.d.ts +8 -0
- package/dist/features/deals/components/delegate-deal-button.js +1 -0
- package/dist/features/deals/deal-assigned-email.d.ts +11 -0
- package/dist/features/deals/deal-assigned-email.js +1 -0
- package/dist/features/deals/deal-delegated-email.d.ts +13 -0
- package/dist/features/deals/deal-delegated-email.js +1 -0
- package/dist/features/deals/list-params.d.ts +14 -0
- package/dist/features/deals/list-params.js +1 -0
- package/dist/features/earnings/components/earnings-balances.d.ts +4 -0
- package/dist/features/earnings/components/earnings-balances.js +1 -0
- package/dist/features/earnings/components/earnings-ledger.d.ts +5 -0
- package/dist/features/earnings/components/earnings-ledger.js +1 -0
- package/dist/features/earnings/components/earnings-status-badge.d.ts +4 -0
- package/dist/features/earnings/components/earnings-status-badge.js +1 -0
- package/dist/features/earnings/components/earnings-status-tabs.d.ts +1 -0
- package/dist/features/earnings/components/earnings-status-tabs.js +1 -0
- package/dist/features/earnings/components/sub-affiliate-earnings.d.ts +4 -0
- package/dist/features/earnings/components/sub-affiliate-earnings.js +1 -0
- package/dist/features/earnings/list-params.d.ts +14 -0
- package/dist/features/earnings/list-params.js +1 -0
- package/dist/features/earnings/queries.d.ts +30 -0
- package/dist/features/earnings/queries.js +1 -0
- package/dist/features/groups/actions.d.ts +36 -0
- package/dist/features/groups/actions.js +1 -0
- package/dist/features/groups/components/delete-group-confirm.d.ts +5 -0
- package/dist/features/groups/components/delete-group-confirm.js +1 -0
- package/dist/features/groups/components/group-create-button.d.ts +1 -0
- package/dist/features/groups/components/group-create-button.js +1 -0
- package/dist/features/groups/components/group-dialog.d.ts +11 -0
- package/dist/features/groups/components/group-dialog.js +1 -0
- package/dist/features/groups/components/group-form-fields.d.ts +10 -0
- package/dist/features/groups/components/group-form-fields.js +1 -0
- package/dist/features/groups/components/group-status-tabs.d.ts +1 -0
- package/dist/features/groups/components/group-status-tabs.js +1 -0
- package/dist/features/groups/components/groups-table.d.ts +9 -0
- package/dist/features/groups/components/groups-table.js +1 -0
- package/dist/features/groups/list-params.d.ts +14 -0
- package/dist/features/groups/list-params.js +1 -0
- package/dist/features/managers/actions.d.ts +43 -0
- package/dist/features/managers/actions.js +1 -0
- package/dist/features/managers/components/manager-create-button.d.ts +1 -0
- package/dist/features/managers/components/manager-create-button.js +1 -0
- package/dist/features/managers/components/manager-dialog.d.ts +11 -0
- package/dist/features/managers/components/manager-dialog.js +1 -0
- package/dist/features/managers/components/manager-permissions-dialog.d.ts +7 -0
- package/dist/features/managers/components/manager-permissions-dialog.js +1 -0
- package/dist/features/managers/components/manager-profile-fields.d.ts +7 -0
- package/dist/features/managers/components/manager-profile-fields.js +1 -0
- package/dist/features/managers/components/manager-status-tabs.d.ts +1 -0
- package/dist/features/managers/components/manager-status-tabs.js +1 -0
- package/dist/features/managers/components/managers-table.d.ts +8 -0
- package/dist/features/managers/components/managers-table.js +1 -0
- package/dist/features/managers/invite.d.ts +6 -0
- package/dist/features/managers/invite.js +1 -0
- package/dist/features/managers/list-params.d.ts +14 -0
- package/dist/features/managers/list-params.js +1 -0
- package/dist/features/payouts/actions.d.ts +12 -0
- package/dist/features/payouts/actions.js +1 -0
- package/dist/features/payouts/balance.d.ts +2 -0
- package/dist/features/payouts/balance.js +1 -0
- package/dist/features/payouts/components/my-payouts-table.d.ts +5 -0
- package/dist/features/payouts/components/my-payouts-table.js +1 -0
- package/dist/features/payouts/components/payout-row-actions.d.ts +5 -0
- package/dist/features/payouts/components/payout-row-actions.js +1 -0
- package/dist/features/payouts/components/payout-status-badge.d.ts +4 -0
- package/dist/features/payouts/components/payout-status-badge.js +1 -0
- package/dist/features/payouts/components/payout-status-tabs.d.ts +1 -0
- package/dist/features/payouts/components/payout-status-tabs.js +1 -0
- package/dist/features/payouts/components/payouts-table.d.ts +6 -0
- package/dist/features/payouts/components/payouts-table.js +1 -0
- package/dist/features/payouts/components/request-payout-dialog.d.ts +4 -0
- package/dist/features/payouts/components/request-payout-dialog.js +1 -0
- package/dist/features/payouts/constants.d.ts +2 -0
- package/dist/features/payouts/constants.js +1 -0
- package/dist/features/payouts/list-params.d.ts +14 -0
- package/dist/features/payouts/list-params.js +1 -0
- package/dist/features/payouts/my-queries.d.ts +14 -0
- package/dist/features/payouts/my-queries.js +1 -0
- package/dist/features/payouts/queries.d.ts +14 -0
- package/dist/features/payouts/queries.js +1 -0
- package/dist/features/postbacks/actions.d.ts +27 -0
- package/dist/features/postbacks/actions.js +1 -0
- package/dist/features/postbacks/components/integration-dialog.d.ts +6 -0
- package/dist/features/postbacks/components/integration-dialog.js +1 -0
- package/dist/features/postbacks/components/postback-editor.d.ts +5 -0
- package/dist/features/postbacks/components/postback-editor.js +1 -0
- package/dist/features/postbacks/components/postbacks-table.d.ts +4 -0
- package/dist/features/postbacks/components/postbacks-table.js +1 -0
- package/dist/features/settings/actions.d.ts +2 -0
- package/dist/features/settings/actions.js +1 -0
- package/dist/features/settings/components/affiliate-approval-setting.d.ts +3 -0
- package/dist/features/settings/components/affiliate-approval-setting.js +1 -0
- package/dist/features/settings/components/manager-totp-setting.d.ts +3 -0
- package/dist/features/settings/components/manager-totp-setting.js +1 -0
- package/dist/features/support/actions.d.ts +12 -0
- package/dist/features/support/actions.js +1 -0
- package/dist/features/support/components/support-page.d.ts +4 -0
- package/dist/features/support/components/support-page.js +1 -0
- package/dist/features/support/email.d.ts +13 -0
- package/dist/features/support/email.js +1 -0
- package/dist/features/users/actions.d.ts +4 -0
- package/dist/features/users/actions.js +1 -0
- package/dist/features/users/components/password-section.d.ts +1 -0
- package/dist/features/users/components/password-section.js +1 -0
- package/dist/features/users/components/preferences-section.d.ts +4 -0
- package/dist/features/users/components/preferences-section.js +1 -0
- package/dist/features/users/components/settings-tabs.d.ts +1 -0
- package/dist/features/users/components/settings-tabs.js +1 -0
- package/dist/features/users/components/totp-section.d.ts +4 -0
- package/dist/features/users/components/totp-section.js +1 -0
- package/dist/features/users/list-params.d.ts +12 -0
- package/dist/features/users/list-params.js +1 -0
- package/dist/features/users/totp.d.ts +7 -0
- package/dist/features/users/totp.js +1 -0
- package/dist/i18n/config.d.ts +5 -0
- package/dist/i18n/config.js +1 -0
- package/dist/i18n/get-locale.d.ts +3 -0
- package/dist/i18n/get-locale.js +1 -0
- package/dist/i18n/locale.d.ts +2 -0
- package/dist/i18n/locale.js +1 -0
- package/dist/lib/actions/parse-form.d.ts +3 -0
- package/dist/lib/actions/parse-form.js +1 -0
- package/dist/lib/actions/state.d.ts +22 -0
- package/dist/lib/actions/state.js +0 -0
- package/dist/lib/audit/actions.d.ts +9 -0
- package/dist/lib/audit/actions.js +1 -0
- package/dist/lib/audit/record.d.ts +4 -0
- package/dist/lib/audit/record.js +1 -0
- package/dist/lib/auth/action.d.ts +45 -0
- package/dist/lib/auth/action.js +1 -0
- package/dist/lib/auth/config.d.ts +24 -0
- package/dist/lib/auth/config.js +1 -0
- package/dist/lib/auth/jwt.d.ts +17 -0
- package/dist/lib/auth/jwt.js +1 -0
- package/dist/lib/auth/password-options.d.ts +6 -0
- package/dist/lib/auth/password-options.js +1 -0
- package/dist/lib/auth/password.d.ts +3 -0
- package/dist/lib/auth/password.js +1 -0
- package/dist/lib/auth/session.d.ts +26 -0
- package/dist/lib/auth/session.js +1 -0
- package/dist/lib/auth/tokens.d.ts +43 -0
- package/dist/lib/auth/tokens.js +1 -0
- package/dist/lib/auth/totp-challenge.d.ts +4 -0
- package/dist/lib/auth/totp-challenge.js +1 -0
- package/dist/lib/auth/totp.d.ts +7 -0
- package/dist/lib/auth/totp.js +1 -0
- package/dist/lib/auth/verification-tokens.d.ts +19 -0
- package/dist/lib/auth/verification-tokens.js +1 -0
- package/dist/lib/cn.d.ts +2 -0
- package/dist/lib/cn.js +1 -0
- package/dist/lib/countries.d.ts +18 -0
- package/dist/lib/countries.js +1 -0
- package/dist/lib/currencies.d.ts +6 -0
- package/dist/lib/currencies.js +1 -0
- package/dist/lib/data/countries-by-continent.json +257 -0
- package/dist/lib/db/errors.d.ts +4 -0
- package/dist/lib/db/errors.js +1 -0
- package/dist/lib/email/client.d.ts +6 -0
- package/dist/lib/email/client.js +1 -0
- package/dist/lib/email/env.d.ts +12 -0
- package/dist/lib/email/env.js +1 -0
- package/dist/lib/email/format.d.ts +5 -0
- package/dist/lib/email/format.js +1 -0
- package/dist/lib/email/locale.d.ts +3 -0
- package/dist/lib/email/locale.js +1 -0
- package/dist/lib/email/send.d.ts +12 -0
- package/dist/lib/email/send.js +1 -0
- package/dist/lib/env.d.ts +20 -0
- package/dist/lib/env.js +1 -0
- package/dist/lib/errors/codes.d.ts +72 -0
- package/dist/lib/errors/codes.js +1 -0
- package/dist/lib/errors/server.d.ts +10 -0
- package/dist/lib/errors/server.js +1 -0
- package/dist/lib/format.d.ts +3 -0
- package/dist/lib/format.js +1 -0
- package/dist/lib/hooks/use-deferred-dialog.d.ts +11 -0
- package/dist/lib/hooks/use-deferred-dialog.js +1 -0
- package/dist/lib/hooks/use-form-reset.d.ts +2 -0
- package/dist/lib/hooks/use-form-reset.js +1 -0
- package/dist/lib/hooks/use-form-toast.d.ts +2 -0
- package/dist/lib/hooks/use-form-toast.js +1 -0
- package/dist/lib/i18n/format-datetime.d.ts +1 -0
- package/dist/lib/i18n/format-datetime.js +1 -0
- package/dist/lib/i18n/relative-time.d.ts +1 -0
- package/dist/lib/i18n/relative-time.js +1 -0
- package/dist/lib/list-params.d.ts +51 -0
- package/dist/lib/list-params.js +1 -0
- package/dist/lib/money.d.ts +2 -0
- package/dist/lib/money.js +1 -0
- package/dist/lib/platform-settings.d.ts +5 -0
- package/dist/lib/platform-settings.js +1 -0
- package/dist/lib/preferences/actions.d.ts +1 -0
- package/dist/lib/preferences/actions.js +1 -0
- package/dist/lib/preferences/index.d.ts +15 -0
- package/dist/lib/preferences/index.js +1 -0
- package/dist/lib/preferences/read.d.ts +2 -0
- package/dist/lib/preferences/read.js +1 -0
- package/dist/lib/slug.d.ts +1 -0
- package/dist/lib/slug.js +1 -0
- package/dist/lib/toast.d.ts +13 -0
- package/dist/lib/toast.js +1 -0
- package/dist/lib/tracking-cache.d.ts +2 -0
- package/dist/lib/tracking-cache.js +1 -0
- package/dist/lib/users.d.ts +12 -0
- package/dist/lib/users.js +1 -0
- package/dist/lib/validation/zod.d.ts +30 -0
- package/dist/lib/validation/zod.js +1 -0
- package/dist/messages/de/emails.json +136 -0
- package/dist/messages/de/index.json +1104 -0
- package/dist/messages/en/emails.json +136 -0
- package/dist/messages/en/index.json +1104 -0
- package/dist/theme/config.d.ts +8 -0
- package/dist/theme/config.js +1 -0
- package/dist/theme/get-theme.d.ts +3 -0
- package/dist/theme/get-theme.js +1 -0
- package/dist/theme/theme.d.ts +2 -0
- package/dist/theme/theme.js +1 -0
- package/package.json +131 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
export declare const controlClasses = "rounded-md border border-border bg-input px-3 text-sm text-foreground outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card disabled:cursor-not-allowed disabled:opacity-50 data-invalid:border-destructive";
|
|
4
|
+
export declare function Input({ className, ...props }: React.ComponentProps<typeof InputPrimitive>): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import{Input as r}from"@base-ui/react/input";import{cn as t}from"../../lib/cn.js";const i="rounded-md border border-border bg-input px-3 text-sm text-foreground outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card disabled:cursor-not-allowed disabled:opacity-50 data-invalid:border-destructive";function p({className:o,...e}){return n(r,{className:t("h-10",i,o),...e})}export{p as Input,i as controlClasses};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NumberField as NumberFieldPrimitive } from "@base-ui/react/number-field";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
type NumberInputProps = Omit<React.ComponentProps<typeof NumberFieldPrimitive.Input>, "value" | "defaultValue" | "onChange" | "min" | "max" | "step"> & Pick<React.ComponentProps<typeof NumberFieldPrimitive.Root>, "min" | "max" | "step" | "disabled" | "required" | "readOnly" | "name"> & {
|
|
4
|
+
value: number;
|
|
5
|
+
onValueChange: (value: number) => void;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Controlled numeric input built on base-ui's `NumberField`, which handles the
|
|
9
|
+
* fiddly parts natively: an empty/in-progress field stays empty while focused
|
|
10
|
+
* (no snapping back to 0), `min`/`max` clamp on blur, and the value is parsed
|
|
11
|
+
* and formatted for the active locale — so a German user can type "5,5".
|
|
12
|
+
*
|
|
13
|
+
* The editor model stores a non-null number, so an emptied field (`null`) is
|
|
14
|
+
* coalesced to 0; `NumberField` normalises/clamps on blur. `locale` is taken
|
|
15
|
+
* from next-intl rather than the runtime default so SSR and the app language
|
|
16
|
+
* agree.
|
|
17
|
+
*/
|
|
18
|
+
export declare function NumberInput({ value, onValueChange, min, max, step, disabled, required, readOnly, name, className, ...inputProps }: NumberInputProps): React.JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as t}from"react/jsx-runtime";import{NumberField as e}from"@base-ui/react/number-field";import{useLocale as f}from"next-intl";import{controlClasses as v}from"./input.js";import{cn as N}from"../../lib/cn.js";function R({value:o,onValueChange:r,min:i,max:n,step:a,disabled:m,required:s,readOnly:u,name:l,className:p,...d}){const c=f();return t(e.Root,{locale:c,value:o,onValueChange:b=>r(b??0),min:i,max:n,step:a,disabled:m,required:s,readOnly:u,name:l,className:"contents",children:t(e.Input,{...d,className:N("h-10",v,p)})})}export{R as NumberInput};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { OTPFieldPreview as OTPFieldPrimitive } from "@base-ui/react/otp-field";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare const OTPField: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").OTPFieldRootProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare function OTPFieldGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
|
+
declare function OTPFieldInput({ className, ...props }: React.ComponentProps<typeof OTPFieldPrimitive.Input>): React.JSX.Element;
|
|
6
|
+
export { OTPField, OTPFieldGroup, OTPFieldInput };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as i}from"react/jsx-runtime";import{OTPFieldPreview as r}from"@base-ui/react/otp-field";import{cn as t}from"../../lib/cn.js";const n=r.Root;function d({className:e,...o}){return i("div",{className:t("flex items-center gap-2",e),...o})}function s({className:e,...o}){return i(r.Input,{className:t("size-12 rounded-md border border-border bg-input text-center font-mono text-lg text-foreground outline-none","transition-colors placeholder:text-muted-foreground","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card","data-filled:border-foreground/20","data-invalid:border-destructive","disabled:cursor-not-allowed disabled:opacity-50",e),...o})}export{n as OTPField,d as OTPFieldGroup,s as OTPFieldInput};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Horizontal bar that pairs a primary slot (tabs, title) with optional
|
|
4
|
+
* right-aligned action buttons. Used at the top of list pages.
|
|
5
|
+
*/
|
|
6
|
+
export declare function PageToolbar({ children, actions, }: {
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
actions?: ReactNode;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as a,jsxs as t}from"react/jsx-runtime";function c({children:i,actions:e}){return t("div",{className:"flex items-center justify-between gap-3",children:[a("div",{className:"min-w-0 flex-1",children:i}),e?a("div",{className:"flex shrink-0 items-center gap-2",children:e}):null]})}export{c as PageToolbar};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
import { Input } from "./input.js";
|
|
3
|
+
export declare function PasswordInput({ className, inputClassName, showLabel, hideLabel, ...props }: Omit<React.ComponentProps<typeof Input>, "type"> & {
|
|
4
|
+
inputClassName?: string;
|
|
5
|
+
showLabel?: string;
|
|
6
|
+
hideLabel?: string;
|
|
7
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as t,jsxs as v}from"react/jsx-runtime";import{IconEye as u,IconEyeOff as f}from"@tabler/icons-react";import{useTranslations as c}from"next-intl";import{useState as d}from"react";import{Button as g}from"./button.js";import{Input as h}from"./input.js";import{cn as r}from"../../lib/cn.js";function P({className:s,inputClassName:a,showLabel:n,hideLabel:i,...p}){const o=c("Common"),[e,m]=d(!1);return v("div",{className:r("relative",s),children:[t(h,{type:e?"text":"password",className:r("w-full pr-10",a),...p}),t(g,{type:"button",size:"icon",variant:"ghost","aria-label":e?i??o("hidePassword"):n??o("showPassword"),onClick:()=>m(l=>!l),className:"absolute top-0 right-0 text-muted-foreground hover:bg-transparent hover:text-foreground",children:e?t(f,{size:16}):t(u,{size:16})})]})}export{P as PasswordInput};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Radio as RadioPrimitive } from "@base-ui/react/radio";
|
|
2
|
+
import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group";
|
|
3
|
+
import type * as React from "react";
|
|
4
|
+
export declare function RadioGroup({ className, ...props }: React.ComponentProps<typeof RadioGroupPrimitive>): React.JSX.Element;
|
|
5
|
+
export declare function RadioGroupItem({ className, ...props }: React.ComponentProps<typeof RadioPrimitive.Root>): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as r}from"react/jsx-runtime";import{Radio as e}from"@base-ui/react/radio";import{RadioGroup as a}from"@base-ui/react/radio-group";import{cn as t}from"../../lib/cn.js";function c({className:o,...i}){return r(a,{className:t("flex flex-col gap-1.5",o),...i})}function l({className:o,...i}){return r(e.Root,{className:t("inline-flex h-4 w-4 shrink-0 cursor-pointer items-center justify-center rounded-full border border-border bg-input outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card","data-checked:border-primary","data-disabled:cursor-not-allowed data-disabled:opacity-50",o),...i,children:r(e.Indicator,{className:"block h-2 w-2 rounded-full bg-primary data-unchecked:hidden"})})}export{c as RadioGroup,l as RadioGroupItem};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as d}from"react/jsx-runtime";import{IconSearch as p}from"@tabler/icons-react";import{useQueryStates as m}from"nuqs";import{useTransition as c}from"react";import{Input as u}from"./input.js";import{Spinner as f}from"./spinner.js";import{cn as h}from"../../lib/cn.js";import{listSearchParsers as t}from"../../lib/list-params.js";function P({placeholder:r,className:a}){const[s,n]=c(),[{q:o},i]=m({q:t.q.withOptions({throttleMs:300}),page:t.page},{shallow:!1,clearOnDefault:!0,startTransition:n});return d("div",{className:h("relative",a),children:[e("span",{"aria-hidden":!0,className:"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-muted-foreground",children:s?e(f,{size:16}):e(p,{size:16})}),e(u,{type:"search",value:o,onChange:l=>i({q:l.target.value,page:null}),placeholder:r,className:"pl-9"})]})}export{P as SearchInput};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Card as r}from"./card.js";import{IconTile as c}from"./icon-tile.js";function m({icon:o,title:a,description:i,children:l}){return t(r,{className:"flex flex-col gap-5",children:[t("div",{className:"flex items-start gap-3",children:[e(c,{icon:o}),t("div",{className:"flex flex-col gap-1",children:[e("h2",{className:"text-base font-semibold text-foreground",children:a}),e("p",{className:"text-sm text-muted-foreground",children:i})]})]}),e("div",{className:"flex flex-col gap-4",children:l})]})}export{m as SectionCard};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
type Option<V extends string> = {
|
|
3
|
+
value: V;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
type SelectFieldProps<V extends string> = {
|
|
7
|
+
label: string;
|
|
8
|
+
help?: string;
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
value: V;
|
|
11
|
+
options: ReadonlyArray<Option<V>>;
|
|
12
|
+
onValueChange: (next: V) => void;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
triggerClassName?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function SelectField<V extends string>({ label, help, icon, value, options, onValueChange, placeholder, disabled, triggerClassName, className, }: SelectFieldProps<V>): import("react").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as l,jsxs as n}from"react/jsx-runtime";import{Field as x,FieldLabel as b}from"./field.js";import{IconTile as V}from"./icon-tile.js";import{Select as S,SelectContent as v,SelectItem as N,SelectTrigger as y,SelectValue as F}from"./select.js";import{cn as a}from"../../lib/cn.js";function R({label:r,help:s,icon:o,value:m,options:i,onValueChange:u,placeholder:d,disabled:c,triggerClassName:g,className:p}){const t=o!==void 0,f=new Map(i.map(e=>[e.value,e.label]));return n(x,{className:a("flex-row justify-between gap-4 border border-border bg-card",t?"items-start rounded-lg p-6 shadow-2xs":"items-center rounded-md p-3",p),children:[n("div",{className:a("flex flex-1",t?"gap-3":null),children:[t?l(V,{icon:o}):null,n("div",{className:"flex flex-col gap-0.5",children:[l(b,{className:a(t?"text-base font-semibold text-foreground":"font-medium text-foreground",!c&&"cursor-pointer"),children:r}),s?l("span",{className:a(t?"text-sm":"text-xs","text-muted-foreground"),children:s}):null]})]}),n(S,{value:m,onValueChange:e=>u(e),disabled:c,children:[l(y,{className:a("min-w-40",g),"aria-label":r,children:l(F,{placeholder:d,children:e=>e?f.get(e)??null:d??null})}),l(v,{align:"end",children:i.map(e=>l(N,{value:e.value,children:e.label},e.value))})]})]})}export{R as SelectField};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Select as SelectPrimitive } from "@base-ui/react/select";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare const Select: typeof SelectPrimitive.Root;
|
|
4
|
+
declare const SelectValue: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SelectValueProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
declare const SelectPortal: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SelectPortalProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const SelectGroup: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SelectGroupProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const SelectGroupLabel: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").SelectGroupLabelProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const SelectItemText: React.NamedExoticComponent<Omit<import("@base-ui/react").SelectItemTextProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare function SelectTrigger({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Trigger>): React.JSX.Element;
|
|
10
|
+
declare function SelectPositioner({ className, sideOffset, align, ...props }: React.ComponentProps<typeof SelectPrimitive.Positioner>): React.JSX.Element;
|
|
11
|
+
declare function SelectPopup({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Popup>): React.JSX.Element;
|
|
12
|
+
declare function SelectContent({ className, children, sideOffset, align, ...props }: React.ComponentProps<typeof SelectPrimitive.Popup> & {
|
|
13
|
+
sideOffset?: number;
|
|
14
|
+
align?: "start" | "center" | "end";
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
declare function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>): React.JSX.Element;
|
|
17
|
+
export { Select, SelectContent, SelectGroup, SelectGroupLabel, SelectItem, SelectItemText, SelectPopup, SelectPortal, SelectPositioner, SelectTrigger, SelectValue, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as t,jsxs as m}from"react/jsx-runtime";import{Select as e}from"@base-ui/react/select";import{IconCheck as u,IconChevronDown as f}from"@tabler/icons-react";import{cn as n}from"../../lib/cn.js";const g=e.Root,P=e.Value,s=e.Portal,S=e.Group,b=e.GroupLabel,c=e.ItemText;function v({className:o,children:i,...r}){return m(e.Trigger,{className:n("inline-flex h-10 min-w-0 cursor-pointer items-center justify-between gap-2 rounded-md border border-border bg-input px-2.5 text-sm text-foreground outline-none","transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card","data-disabled:cursor-not-allowed data-disabled:opacity-50",o),...r,children:[t("span",{className:"min-w-0 flex-1 truncate text-left",children:i}),t(e.Icon,{className:"shrink-0",children:t(f,{size:14,className:"opacity-60","aria-hidden":!0})})]})}function l({className:o,sideOffset:i=4,align:r="start",...a}){return t(e.Positioner,{className:n("z-40 outline-none",o),sideOffset:i,align:r,...a})}function d({className:o,...i}){return t(e.Popup,{className:n("min-w-(--anchor-width) max-w-md overflow-hidden rounded-md border border-border bg-popover p-1 text-sm text-popover-foreground shadow-md outline-none","transition-[opacity,transform] duration-fast ease-out","data-starting-style:scale-95 data-starting-style:opacity-0","data-ending-style:scale-95 data-ending-style:opacity-0",o),...i})}function h({className:o,children:i,sideOffset:r,align:a,...p}){return t(s,{children:t(l,{sideOffset:r,align:a,children:t(d,{className:o,...p,children:i})})})}function x({className:o,children:i,...r}){return m(e.Item,{className:n("relative flex h-7 cursor-pointer items-center justify-between gap-2 rounded-sm px-2 text-sm text-foreground/80 outline-none transition-colors","data-highlighted:bg-accent data-highlighted:text-accent-foreground","data-disabled:cursor-not-allowed data-disabled:opacity-50",o),...r,children:[t("span",{className:"min-w-0 flex-1 truncate",children:t(c,{children:i})}),t(e.ItemIndicator,{className:"flex shrink-0 items-center",children:t(u,{size:14,"aria-hidden":!0})})]})}export{g as Select,h as SelectContent,S as SelectGroup,b as SelectGroupLabel,x as SelectItem,c as SelectItemText,d as SelectPopup,s as SelectPortal,l as SelectPositioner,v as SelectTrigger,P as SelectValue};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
|
|
2
|
+
type SidebarDrawerHandle = ReturnType<typeof DrawerPrimitive.createHandle>;
|
|
3
|
+
type SidebarContextValue = {
|
|
4
|
+
drawerHandle: SidebarDrawerHandle;
|
|
5
|
+
collapsed: boolean;
|
|
6
|
+
toggleCollapsed: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function useSidebar(): SidebarContextValue;
|
|
9
|
+
export declare function SidebarProvider({ defaultCollapsed, className, children, }: {
|
|
10
|
+
defaultCollapsed?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
export declare function Sidebar({ title, className, children, }: {
|
|
15
|
+
title: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
export declare function SidebarTrigger({ className, ...props }: Omit<React.ComponentProps<typeof DrawerPrimitive.Trigger>, "handle">): import("react").JSX.Element;
|
|
20
|
+
export declare function SidebarInset({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
21
|
+
export declare function SidebarHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
22
|
+
export declare function SidebarContent({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
23
|
+
export declare function SidebarCollapseToggle({ className, label, ...props }: Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onClick"> & {
|
|
24
|
+
label: string;
|
|
25
|
+
}): import("react").JSX.Element;
|
|
26
|
+
export declare function SidebarFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{Fragment as M,jsx as e,jsxs as u}from"react/jsx-runtime";import{Drawer as l}from"@base-ui/react/drawer";import{ScrollArea as c}from"@base-ui/react/scroll-area";import{IconChevronsLeft as h,IconMenu2 as S}from"@tabler/icons-react";import{createContext as C,useCallback as b,useContext as H,useEffect as T,useMemo as y,useState as g}from"react";import{DrawerBackdrop as D}from"./drawer.js";import{cn as a}from"../../lib/cn.js";import{setUserSidebarCollapsed as N}from"../../lib/preferences/actions.js";const v=C(null);function m(){const r=H(v);if(!r)throw new Error("Sidebar components must be used inside <SidebarProvider>");return r}function z({defaultCollapsed:r=!1,className:t,children:i}){const[o]=g(()=>l.createHandle()),[n,f]=g(r),d=b(()=>{const s=!n;f(s),N(s)},[n]);T(()=>{const s=window.matchMedia("(min-width: 1024px)");s.matches&&o.close();const p=w=>{w.matches&&o.close()};return s.addEventListener("change",p),()=>s.removeEventListener("change",p)},[o]);const x=y(()=>({drawerHandle:o,collapsed:n,toggleCollapsed:d}),[o,n,d]);return e(v.Provider,{value:x,children:e("div",{className:a("flex h-full",t),children:i})})}function B({title:r,className:t,children:i}){const{drawerHandle:o,collapsed:n}=m(),f=b(d=>{d.target.closest("a")&&o.close()},[o]);return u(M,{children:[e("aside",{"data-collapsed":n||void 0,className:a("hidden shrink-0 overflow-hidden bg-sidebar text-sidebar-foreground","lg:sticky lg:top-0 lg:flex lg:h-svh","w-64 transition-[width] duration-slow ease-out data-collapsed:w-16",t),children:e("div",{className:"flex h-full min-h-0 w-full flex-col lg:py-2",children:i})}),e(l.Root,{handle:o,swipeDirection:"left",children:u(l.Portal,{children:[e(D,{}),e(l.Viewport,{children:u(l.Popup,{className:a("fixed top-0 left-0 z-40 flex h-full w-72 flex-col bg-sidebar text-sidebar-foreground shadow-lg outline-none","transition-transform duration-slow ease-out","data-starting-style:[--drawer-x:-100%] data-ending-style:[--drawer-x:-100%]","data-swiping:transition-none",t),style:{transform:"translateX(var(--drawer-x, min(0px, var(--drawer-swipe-movement-x, 0px))))"},children:[e(l.Title,{className:"sr-only",children:r}),e("div",{className:"flex h-full min-h-0 flex-col",onClickCapture:f,children:i})]})})]})})]})}function I({className:r,...t}){const{drawerHandle:i}=m();return e(l.Trigger,{handle:i,className:a("inline-flex h-9 w-9 cursor-pointer items-center justify-center rounded-md border border-transparent text-muted-foreground outline-none lg:hidden","hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card",r),...t,children:e(S,{size:18,"aria-hidden":!0})})}function O({className:r,...t}){return e("div",{className:a("flex min-h-0 min-w-0 flex-1 flex-col",r),...t})}function j({className:r,...t}){return e("div",{className:a("flex h-14 shrink-0 items-center gap-3 border-b border-sidebar-border px-4",r),...t})}function q({className:r,children:t,...i}){return u(c.Root,{className:a("relative min-h-0 flex-1 overflow-hidden",r),...i,children:[e(c.Viewport,{className:"size-full overscroll-contain",children:t}),e(c.Scrollbar,{orientation:"vertical",className:"flex w-1.5 touch-none select-none rounded-full bg-sidebar-foreground/5 p-px transition-opacity data-[orientation=vertical]:my-2",children:e(c.Thumb,{className:"flex-1 rounded-full bg-sidebar-foreground/20 transition-colors hover:bg-sidebar-foreground/30"})})]})}function F({className:r,label:t,...i}){const{collapsed:o,toggleCollapsed:n}=m();return e("button",{type:"button",onClick:n,"aria-label":t,"aria-pressed":o,className:a("inline-flex cursor-pointer items-center justify-center rounded-md border border-transparent text-muted-foreground outline-none","hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-sidebar",r),...i,children:e(h,{size:16,"aria-hidden":!0,className:a("transition-transform duration-slow",o&&"rotate-180")})})}function Q({className:r,...t}){return e("div",{className:a("flex flex-col gap-2 border-t border-sidebar-border px-2 py-4 transition-[gap] duration-slow ease-out in-data-collapsed:gap-0",r),...t})}export{B as Sidebar,F as SidebarCollapseToggle,q as SidebarContent,Q as SidebarFooter,j as SidebarHeader,O as SidebarInset,z as SidebarProvider,I as SidebarTrigger,m as useSidebar};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Slider as SliderPrimitive } from "@base-ui/react/slider";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
type SliderRootProps = Omit<React.ComponentProps<typeof SliderPrimitive.Root>, "value" | "defaultValue" | "onValueChange" | "onValueCommitted"> & {
|
|
4
|
+
defaultValue?: number;
|
|
5
|
+
value?: number;
|
|
6
|
+
onValueChange?: (value: number) => void;
|
|
7
|
+
onValueCommitted?: (value: number) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function Slider({ className, ...props }: SliderRootProps): React.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as o,jsxs as t}from"react/jsx-runtime";import{Slider as e}from"@base-ui/react/slider";import{cn as i}from"../../lib/cn.js";function s({className:r,...l}){return o(e.Root,{className:i("flex w-full items-center",r),...l,children:t(e.Control,{className:"relative flex h-5 w-full grow cursor-pointer items-center transition-opacity data-disabled:cursor-not-allowed data-disabled:opacity-70",children:[o(e.Track,{className:"h-2 w-full overflow-hidden rounded-full bg-control-track",children:o(e.Indicator,{className:"block h-full rounded-full bg-primary transition-colors"})}),o(e.Thumb,{className:i("block size-4 rounded-full bg-primary shadow-sm outline-none transition-transform","data-dragging:scale-110","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card")})]})})}export{s as Slider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as A,jsxs as I}from"react/jsx-runtime";import{IconArrowDown as f,IconArrowsSort as d,IconArrowUp as u}from"@tabler/icons-react";import p from"next/link";import{useSearchParams as h}from"next/navigation";import{createSerializer as g,useQueryStates as S}from"nuqs";import{useMemo as v}from"react";import{cn as x}from"../../lib/cn.js";import{listSearchParsers as o}from"../../lib/list-params.js";const w=g(o);function L({column:r,children:n,className:c}){const s=h(),[{sort:a,dir:t}]=S({sort:o.sort,dir:o.dir}),e=a===r,i=e&&t==="asc"?"desc":"asc",l=v(()=>w(s,{sort:r,dir:i,page:null}),[s,r,i]),m=e?t==="desc"?f:u:d;return I(p,{href:l,scroll:!1,prefetch:!1,className:x("inline-flex cursor-pointer items-center gap-1 rounded-sm outline-none transition-colors hover:text-foreground hover:underline","focus-visible:text-foreground focus-visible:underline",e&&"text-foreground",c),children:[n,A(m,{size:12,"aria-hidden":!0,className:"opacity-60"})]})}export{L as SortButton};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{IconLoader2 as r}from"@tabler/icons-react";import{cn as e}from"../../lib/cn.js";function s({size:n=14,className:i}){return a(r,{size:n,className:e("animate-spin",i),"aria-hidden":!0})}export{s as Spinner};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare const statusBadgeVariants: (props?: ({
|
|
4
|
+
tone?: "success" | "warning" | "danger" | "neutral" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export type BadgeTone = NonNullable<VariantProps<typeof statusBadgeVariants>["tone"]>;
|
|
7
|
+
export interface StatusBadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof statusBadgeVariants> {
|
|
8
|
+
showDot?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function StatusBadge({ tone, showDot, className, children, ...props }: StatusBadgeProps): React.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as d,jsxs as g}from"react/jsx-runtime";import{cva as e}from"class-variance-authority";import{cn as o}from"../../lib/cn.js";const u=e("inline-flex w-fit items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium",{variants:{tone:{success:"bg-success/10 text-success",danger:"bg-destructive/10 text-destructive",warning:"bg-warning/10 text-warning",neutral:"bg-muted text-muted-foreground"}},defaultVariants:{tone:"neutral"}}),i=e("size-1.5 rounded-full",{variants:{tone:{success:"bg-success",danger:"bg-destructive",warning:"bg-warning",neutral:"bg-muted-foreground"}},defaultVariants:{tone:"neutral"}});function l({tone:t,showDot:a=!0,className:n,children:s,...r}){return g("span",{className:o(u({tone:t}),n),...r,children:[a&&d("span",{"aria-hidden":!0,className:i({tone:t})}),s]})}export{l as StatusBadge};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
type SwitchFieldProps = {
|
|
3
|
+
label: string;
|
|
4
|
+
help?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
10
|
+
} & ({
|
|
11
|
+
checked: boolean;
|
|
12
|
+
defaultChecked?: never;
|
|
13
|
+
} | {
|
|
14
|
+
checked?: never;
|
|
15
|
+
defaultChecked?: boolean;
|
|
16
|
+
});
|
|
17
|
+
export declare function SwitchField({ name, label, help, icon, checked: controlledChecked, defaultChecked, disabled, className, onCheckedChange, }: SwitchFieldProps): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as o,jsxs as t}from"react/jsx-runtime";import{useState as k}from"react";import{Field as C,FieldLabel as v}from"./field.js";import{IconTile as N}from"./icon-tile.js";import{Switch as w}from"./switch.js";import{cn as n}from"../../lib/cn.js";function P({name:d,label:l,help:a,icon:r,checked:s,defaultChecked:u,disabled:i=!1,className:h,onCheckedChange:p}){const c=s!==void 0,[b,g]=k(u??!1),f=c?s:b,x=m=>{c||g(m),p?.(m)},e=r!==void 0;return t(C,{className:n("flex-row justify-between gap-4 border border-border bg-card",e?"items-start rounded-lg p-6 shadow-2xs":"items-center rounded-md p-3",h),children:[t("div",{className:n("flex flex-1",e?"gap-3":null),children:[e?o(N,{icon:r}):null,t("div",{className:"flex flex-col gap-0.5",children:[o(v,{className:n(e?"text-base font-semibold text-foreground":"font-medium text-foreground",!i&&"cursor-pointer"),children:l}),a?o("span",{className:n(e?"text-sm":"text-xs","text-muted-foreground"),children:a}):null]})]}),d?o("input",{type:"hidden",name:d,value:f?"true":"false"}):null,o(w,{checked:f,onCheckedChange:x,disabled:i,"aria-label":l})]})}export{P as SwitchField};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as t}from"react/jsx-runtime";import{Switch as r}from"@base-ui/react/switch";import{cn as o}from"../../lib/cn.js";function s({className:e,...i}){return t(r.Root,{className:o("relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border border-transparent bg-control-track outline-none transition-colors duration-base","not-data-disabled:hover:bg-control-track-hover","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card","data-checked:bg-primary","data-disabled:cursor-not-allowed data-disabled:opacity-70",e),...i,children:t(r.Thumb,{className:o("pointer-events-none block size-5 translate-x-0.5 rounded-full bg-control-knob shadow-[0_1px_2px_rgba(0,0,0,0.18),0_0_0_0.5px_rgba(0,0,0,0.06)] ring-0 transition-transform duration-base","data-checked:translate-x-5 data-checked:bg-primary-foreground")})})}export{s as Switch};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
page: number;
|
|
3
|
+
pageSize: number;
|
|
4
|
+
totalPages: number;
|
|
5
|
+
pageSizeOptions: readonly number[];
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function TablePagination({ page, pageSize, totalPages, pageSizeOptions, className, }: Props): import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as o}from"react/jsx-runtime";import{IconChevronLeft as N,IconChevronRight as S,IconChevronsLeft as P,IconChevronsRight as C}from"@tabler/icons-react";import{useTranslations as y}from"next-intl";import{useQueryStates as T}from"nuqs";import{useTransition as I}from"react";import{Button as r}from"./button.js";import{Select as k,SelectContent as B,SelectItem as w,SelectTrigger as M,SelectValue as L}from"./select.js";import{cn as O}from"../../lib/cn.js";import{listSearchParsers as f}from"../../lib/list-params.js";function E({page:s,pageSize:c,totalPages:b,pageSizeOptions:m,className:h}){const t=y("Common"),[i,v]=I(),[,d]=T({page:f.page,pageSize:f.pageSize},{shallow:!1,clearOnDefault:!0,startTransition:v}),n=Math.max(1,b),g=s>1,p=s<n;function l(a){const u=Math.max(1,Math.min(n,a));d({page:u})}function z(a){d({pageSize:a,page:null})}const x=m.includes(c)?m:[...m,c].sort((a,u)=>a-u);return o("div",{className:O("flex flex-wrap items-center justify-between gap-4",h),children:[e("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:o(k,{value:c.toString(),onValueChange:a=>z(Number(a)),children:[e("label",{htmlFor:"table-page-size",className:"max-sm:sr-only",children:t("pageSize")}),e(M,{id:"table-page-size",className:"h-8 min-w-16",children:e(L,{})}),e(B,{children:x.map(a=>e(w,{value:a.toString(),className:"h-7",children:a},a))})]})}),e("nav",{"aria-label":t("pagination"),children:o("ul",{className:"flex items-center gap-1",children:[e("li",{children:e(r,{variant:"secondary",size:"icon",className:"size-8",onClick:()=>l(1),disabled:i||!g,"aria-label":t("firstPage"),children:e(P,{size:14,"aria-hidden":!0})})}),e("li",{children:e(r,{variant:"secondary",size:"icon",className:"size-8",onClick:()=>l(s-1),disabled:i||!g,"aria-label":t("previous"),children:e(N,{size:14,"aria-hidden":!0})})}),o("li",{"aria-live":"polite",className:"px-2 text-sm tabular-nums text-muted-foreground",children:[e("span",{className:"text-foreground",children:s})," ",t("paginationOf")," ",e("span",{className:"text-foreground",children:n})]}),e("li",{children:e(r,{variant:"secondary",size:"icon",className:"size-8",onClick:()=>l(s+1),disabled:i||!p,"aria-label":t("next"),children:e(S,{size:14,"aria-hidden":!0})})}),e("li",{children:e(r,{variant:"secondary",size:"icon",className:"size-8",onClick:()=>l(n),disabled:i||!p,"aria-label":t("lastPage"),children:e(C,{size:14,"aria-hidden":!0})})})]})})]})}export{E as TablePagination};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
export declare function Table({ className, ...props }: React.ComponentProps<"table">): React.JSX.Element;
|
|
3
|
+
export declare function TableHeader({ className, ...props }: React.ComponentProps<"thead">): React.JSX.Element;
|
|
4
|
+
export declare function TableBody({ className, ...props }: React.ComponentProps<"tbody">): React.JSX.Element;
|
|
5
|
+
export declare function TableRow({ className, ...props }: React.ComponentProps<"tr">): React.JSX.Element;
|
|
6
|
+
type TablePin = "left" | "right";
|
|
7
|
+
export declare function TableHead({ pin, className, ...props }: React.ComponentProps<"th"> & {
|
|
8
|
+
pin?: TablePin;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
export declare function TableCell({ pin, className, ...props }: React.ComponentProps<"td"> & {
|
|
11
|
+
pin?: TablePin;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
export declare function TableEmptyState({ colSpan, className, children, }: {
|
|
14
|
+
colSpan: number;
|
|
15
|
+
className?: string;
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}): React.JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{cn as o}from"../../lib/cn.js";function b({className:e,...t}){return r("div",{className:o("relative min-w-0 overflow-auto overscroll-x-none rounded-xl border border-border bg-card","scrollbar-none [&::-webkit-scrollbar]:hidden",e),children:r("table",{className:"w-full border-collapse text-sm",...t})})}function i({className:e,...t}){return r("thead",{className:o("sticky top-0 z-20 bg-muted text-left text-muted-foreground [&_tr]:border-b [&_tr]:border-border",e),...t})}function p({className:e,...t}){return r("tbody",{className:e,...t})}function c({className:e,...t}){return r("tr",{className:o("group border-b border-border/50 transition-colors last:border-b-0 hover:bg-muted/50 data-[state=selected]:bg-muted/40",e),...t})}const n="group-hover:bg-[color-mix(in_srgb,var(--muted)_50%,var(--card))]",l="group-data-[state=selected]:bg-[color-mix(in_srgb,var(--muted)_40%,var(--card))]";function m({pin:e,className:t,...a}){return r("th",{className:o("px-4 py-2.5 text-left text-2xs font-medium tracking-widest whitespace-nowrap text-muted-foreground uppercase",e==="left"&&"sticky left-0 z-20 bg-muted",e==="right"&&"sticky right-0 z-20 bg-muted",t),...a})}function s({pin:e,className:t,...a}){return r("td",{className:o("px-4 py-3 align-middle whitespace-nowrap",e==="left"&&["sticky left-0 z-10 bg-card transition-colors",n,l],e==="right"&&["sticky right-0 z-10 bg-card transition-colors",n,l],t),...a})}function u({colSpan:e,className:t,children:a}){return r(c,{className:"hover:bg-transparent",children:r(s,{colSpan:e,className:o("text-center text-muted-foreground",t),children:a})})}export{b as Table,p as TableBody,s as TableCell,u as TableEmptyState,m as TableHead,i as TableHeader,c as TableRow};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare const Tabs: React.ForwardRefExoticComponent<Omit<import("@base-ui/react").TabsRootProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare function TabsList({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.List>): React.JSX.Element;
|
|
5
|
+
declare function TabsTab({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Tab>): React.JSX.Element;
|
|
6
|
+
declare function TabsIndicator({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Indicator>): React.JSX.Element;
|
|
7
|
+
declare function TabsPanel({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Panel>): React.JSX.Element;
|
|
8
|
+
export { Tabs, TabsIndicator, TabsList, TabsPanel, TabsTab };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as a}from"react/jsx-runtime";import{Tabs as o}from"@base-ui/react/tabs";import{cn as r}from"../../lib/cn.js";const i=o.Root;function n({className:e,...t}){return a(o.List,{className:r("relative flex items-center gap-1 overflow-x-auto border-b border-border scrollbar-none [&::-webkit-scrollbar]:hidden",e),...t})}function s({className:e,...t}){return a(o.Tab,{className:r("relative cursor-pointer whitespace-nowrap rounded-md border border-transparent px-3 py-2 text-sm font-medium outline-none transition-colors","text-muted-foreground hover:text-foreground","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset","data-selected:text-foreground",e),...t})}function b({className:e,...t}){return a(o.Indicator,{className:r("absolute bottom-0 left-0 z-0 h-0.5 bg-primary","w-(--active-tab-width) translate-x-(--active-tab-left)",e),...t})}function c({className:e,...t}){return a(o.Panel,{className:r("mt-6 outline-none",e),...t})}export{i as Tabs,b as TabsIndicator,n as TabsList,c as TabsPanel,s as TabsTab};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function TagInput({ name, defaultValue, disabled, placeholder, maxTagLength, ariaLabel, className, }: {
|
|
2
|
+
name: string;
|
|
3
|
+
defaultValue?: readonly string[];
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
maxTagLength?: number;
|
|
7
|
+
ariaLabel?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as i,jsxs as f}from"react/jsx-runtime";import{IconX as h}from"@tabler/icons-react";import{useState as u}from"react";import{cn as v}from"../../lib/cn.js";function N({name:c,defaultValue:d=[],disabled:o=!1,placeholder:g,maxTagLength:m=60,ariaLabel:p,className:b}){const[n,s]=u([...d]),[r,a]=u(""),l=e=>{const t=e.trim().slice(0,m);t&&(n.includes(t)||s([...n,t]))},x=e=>{s(n.filter(t=>t!==e))},y=e=>{e.key==="Enter"||e.key===","?(e.preventDefault(),l(r),a("")):e.key==="Tab"&&r.trim()!==""?(l(r),a("")):e.key==="Backspace"&&r===""&&n.length>0&&!o&&(e.preventDefault(),s(n.slice(0,-1)))};return f("div",{className:v("flex min-h-10 flex-wrap items-center gap-1.5 rounded-md border border-border bg-input px-3 py-1.5 text-sm","focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2 focus-within:ring-offset-card",o&&"cursor-not-allowed opacity-60",b),children:[i("input",{type:"hidden",name:c,value:n.join(",")}),n.map(e=>f("span",{className:"inline-flex h-5 items-center gap-1 rounded-sm bg-foreground/10 px-1.5 text-xs font-medium text-foreground",children:[e,!o&&i("button",{type:"button",onClick:t=>{t.stopPropagation(),x(e)},className:"inline-flex size-3.5 cursor-pointer items-center justify-center rounded text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card","aria-label":`Remove ${e}`,children:i(h,{size:10,"aria-hidden":!0})})]},e)),i("input",{type:"text",value:r,onChange:e=>a(e.target.value),onKeyDown:y,placeholder:n.length===0?g:void 0,disabled:o,"aria-label":p,className:"flex-1 min-w-20 bg-transparent text-sm text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed"})]})}export{N as TagInput};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import Link from "next/link";
|
|
3
|
+
import type * as React from "react";
|
|
4
|
+
export declare const textLinkVariants: (props?: ({
|
|
5
|
+
tone?: "default" | "muted" | "plain" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
export type TextLinkProps = React.ComponentProps<typeof Link> & VariantProps<typeof textLinkVariants>;
|
|
8
|
+
export declare function TextLink({ className, tone, ...props }: TextLinkProps): React.JSX.Element;
|
|
9
|
+
export type TextButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type"> & VariantProps<typeof textLinkVariants>;
|
|
10
|
+
export declare function TextButton({ className, tone, ...props }: TextButtonProps): React.JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{cva as u}from"class-variance-authority";import a from"next/link";import{cn as n}from"../../lib/cn.js";const r=u("rounded-sm outline-none hover:underline focus-visible:underline",{variants:{tone:{default:"font-medium text-foreground underline-offset-4",muted:"text-muted-foreground underline-offset-4 hover:text-foreground focus-visible:text-foreground",plain:""}},defaultVariants:{tone:"default"}});function x({className:t,tone:e,...o}){return i(a,{...o,className:n(r({tone:e}),t)})}function m({className:t,tone:e,...o}){return i("button",{type:"button",...o,className:n(r({tone:e}),"cursor-pointer text-left",t)})}export{m as TextButton,x as TextLink,r as textLinkVariants};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{Field as a}from"@base-ui/react/field";import{controlClasses as m}from"./input.js";import{cn as n}from"../../lib/cn.js";function c({className:t,...r}){return e(a.Control,{render:o=>e("textarea",{...o,...r}),className:n("min-h-20 py-2",m,t)})}export{c as Textarea};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Toaster(): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as t,jsxs as i}from"react/jsx-runtime";import{Toast as e}from"@base-ui/react/toast";import{IconAlertTriangleFilled as l,IconCircleCheckFilled as d,IconX as m}from"@tabler/icons-react";import{useTranslations as f}from"next-intl";import{cn as a}from"../../lib/cn.js";import{toast as u}from"../../lib/toast.js";function P(){return t(e.Provider,{toastManager:u,children:t(e.Portal,{children:t(e.Viewport,{className:"fixed top-4 right-4 z-50 w-88 max-w-[calc(100vw-2rem)]",children:t(p,{})})})})}function p(){const{toasts:o}=e.useToastManager();return o.map(s=>t(v,{toast:s},s.id))}function v({toast:o}){const s=f(),r=(o.data?.kind??"success")==="error",n=r?l:d,c=r?"Toasts.errorTitle":"Toasts.successTitle";return i(e.Root,{toast:o,swipeDirection:["right"],className:a("transform-[translateY(calc(var(--toast-offset-y)+var(--toast-index)*0.5rem))_translate(var(--toast-swipe-movement-x,0px),var(--toast-swipe-movement-y,0px))]","data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+150%))_translateY(calc(var(--toast-offset-y)+var(--toast-index)*0.5rem))]","absolute inset-x-0 top-0 isolate flex items-start gap-3 overflow-hidden","rounded-lg border border-border bg-card py-3 pr-3 pl-4","shadow-2xl ring-1 ring-foreground/5","before:absolute before:inset-y-0 before:left-0 before:w-0.75",r?"before:bg-destructive":"before:bg-success","transition-[transform,opacity] duration-slow ease-out","data-starting-style:opacity-0 data-ending-style:opacity-0"),children:[t(n,{size:18,"aria-hidden":!0,className:a("shrink-0",r?"text-destructive":"text-success")}),i("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[t(e.Title,{className:"text-sm font-semibold text-foreground",children:s(c)}),t(e.Description,{className:"text-sm text-muted-foreground",children:o.description})]}),t(e.Close,{"aria-label":s("Common.close"),className:a("flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md border border-transparent outline-none","text-muted-foreground transition-colors","hover:bg-accent hover:text-accent-foreground","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-card"),children:t(m,{size:14,"aria-hidden":!0})})]})}export{P as Toaster};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
|
|
2
|
+
import type * as React from "react";
|
|
3
|
+
declare function TreeBranch({ className, children, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
4
|
+
declare function TreeActions({ className, children, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
|
+
declare function TreeCollapsible({ className, ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>): React.JSX.Element;
|
|
6
|
+
declare function TreeChevron({ className, ...props }: Omit<React.ComponentProps<typeof CollapsiblePrimitive.Trigger>, "render" | "children">): React.JSX.Element;
|
|
7
|
+
declare function TreeChevronSpacer(): React.JSX.Element;
|
|
8
|
+
declare function TreePanel({ className, children, ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Panel>): React.JSX.Element;
|
|
9
|
+
declare function TreeRow({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
declare function TreeSectionHeader({ title, count, onAdd, addLabel, }: {
|
|
11
|
+
title: string;
|
|
12
|
+
count: number;
|
|
13
|
+
onAdd?: () => void;
|
|
14
|
+
addLabel?: string;
|
|
15
|
+
}): React.JSX.Element;
|
|
16
|
+
declare function TreeItemHeader({ index, badge, summary, actions, }: {
|
|
17
|
+
index: number;
|
|
18
|
+
badge: string;
|
|
19
|
+
summary?: string;
|
|
20
|
+
actions?: React.ReactNode;
|
|
21
|
+
}): React.JSX.Element;
|
|
22
|
+
declare function TreeIconButton({ icon, label, onClick, disabled, className, }: {
|
|
23
|
+
icon: React.ReactNode;
|
|
24
|
+
label: string;
|
|
25
|
+
onClick: () => void;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
className?: string;
|
|
28
|
+
}): React.JSX.Element;
|
|
29
|
+
declare function TreeEmptyState({ message }: {
|
|
30
|
+
message: string;
|
|
31
|
+
}): React.JSX.Element;
|
|
32
|
+
export { TreeActions, TreeBranch, TreeChevron, TreeChevronSpacer, TreeCollapsible, TreeEmptyState, TreeIconButton, TreeItemHeader, TreePanel, TreeRow, TreeSectionHeader, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as n,jsxs as i}from"react/jsx-runtime";import{Collapsible as s}from"@base-ui/react/collapsible";import{IconChevronDown as u,IconChevronRight as g,IconPlus as b}from"@tabler/icons-react";import{Children as v,isValidElement as x}from"react";import{Badge as h}from"./badge.js";import{Button as c}from"./button.js";import{cn as a}from"../../lib/cn.js";const m="ml-1.5 flex flex-col gap-1 sm:ml-3",N=a("relative pl-2 sm:pl-4","before:absolute before:left-0 before:top-0 before:w-px before:bg-border before:content-['']","before:h-[calc(100%+0.25rem)] last:before:h-3.5","after:absolute after:left-0 after:top-3.5 after:h-px after:bg-border after:content-['']","after:w-2 sm:after:w-4");function C({children:e}){return n("div",{className:N,children:e})}function p(e){return v.toArray(e).map((t,r)=>x(t)?n(C,{children:t},t.key??r):t)}function d({className:e,children:t,...r}){return n("div",{className:a(m,e),...r,children:p(t)})}function R({className:e,children:t,...r}){return i("div",{className:a("ml-1.5 flex flex-wrap items-center gap-2 pl-2 sm:ml-3 sm:pl-4",e),...r,children:[n(l,{}),t]})}function T({className:e,...t}){return n(s.Root,{className:a("flex flex-col gap-1",e),...t})}function P({className:e,...t}){return i(s.Trigger,{className:a("group inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground transition-colors","hover:bg-accent hover:text-foreground","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-card",e),...t,children:[n(g,{size:14,"aria-hidden":!0,className:"group-data-panel-open:hidden"}),n(u,{size:14,"aria-hidden":!0,className:"hidden group-data-panel-open:inline"})]})}function l(){return n("span",{"aria-hidden":!0,className:"size-5 shrink-0"})}function y({className:e,children:t,...r}){return n(s.Panel,{className:a(m,"data-ending-style:animate-out data-starting-style:animate-in",e),...r,children:p(t)})}function w({className:e,...t}){return n("div",{className:a("flex min-h-7 flex-wrap items-center gap-2",e),...t})}function k({title:e,count:t,onAdd:r,addLabel:o}){return i("div",{className:"flex min-h-7 items-center gap-2 whitespace-nowrap",children:[n("span",{className:"text-sm text-foreground",children:e}),i("span",{className:"text-xs text-muted-foreground",children:["(",t,")"]}),r?n(c,{type:"button",variant:"ghost",onClick:r,"aria-label":o??`Add to ${e}`,className:"size-7 shrink-0 p-0",children:n(b,{size:14,"aria-hidden":!0})}):null]})}function B({index:e,badge:t,summary:r,actions:o}){return i("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[i("span",{className:"text-xs font-medium text-foreground",children:["#",e+1]}),n(h,{children:t}),r?i("span",{className:"hidden text-xs text-muted-foreground sm:inline",children:["(",r,")"]}):null,o?n("span",{className:"ml-auto flex shrink-0 items-center gap-1",children:o}):null]})}function z({icon:e,label:t,onClick:r,disabled:o,className:f}){return n(c,{type:"button",variant:"ghost",onClick:r,disabled:o,"aria-label":t,className:a("size-7 shrink-0 p-0",f),children:e})}function I({message:e}){return n(d,{children:i("div",{className:"flex min-h-7 items-center gap-2 text-xs text-muted-foreground",children:[n(l,{}),n("span",{children:e})]})})}export{R as TreeActions,d as TreeBranch,P as TreeChevron,l as TreeChevronSpacer,T as TreeCollapsible,I as TreeEmptyState,z as TreeIconButton,B as TreeItemHeader,y as TreePanel,w as TreeRow,k as TreeSectionHeader};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import postgres from "postgres";
|
|
2
|
+
export declare const db: import("drizzle-orm/postgres-js").PostgresJsDatabase<import("drizzle-orm").EmptyRelations> & {
|
|
3
|
+
$client: postgres.Sql<{}>;
|
|
4
|
+
};
|
|
5
|
+
export type Db = typeof db;
|
|
6
|
+
export type Tx = Parameters<Parameters<typeof db.transaction>[0]>[0];
|
|
7
|
+
export type Executor = Db | Tx;
|
|
8
|
+
export declare function closeDb(): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{drizzle as n}from"drizzle-orm/postgres-js";import s from"postgres";import{prettyLogger as i}from"./logger.js";const e=process.env.NODE_ENV==="production",o=process.env.DATABASE_URL;!e&&!o&&console.warn("DATABASE_URL not set");const r=globalThis,t=r.__affDbClient??s(o,{max:e?20:1,idle_timeout:20,max_lifetime:1800});e||(r.__affDbClient=t);const c=n({client:t,logger:e?!1:i});async function l(){await t.end({timeout:5})}export{l as closeDb,c as db};
|
package/dist/db/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{closeDb as r,db as t}from"./client.js";export*from"./schema/index.js";export*from"./types/index.js";export{r as closeDb,t as db};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={reset:"\x1B[0m",dim:"\x1B[2m",bold:"\x1B[1m",cyan:"\x1B[36m",green:"\x1B[32m",yellow:"\x1B[33m",red:"\x1B[31m",magenta:"\x1B[35m",blue:"\x1B[34m",white:"\x1B[37m"},p={SELECT:e.green,COUNT:e.blue,INSERT:e.yellow,UPDATE:e.yellow,DELETE:e.red,WITH:e.magenta},w=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function d(t){if(t==null)return"null";if(typeof t=="boolean"||typeof t=="number")return String(t);if(t instanceof Date)return t.toISOString();const n=String(t);return w.test(n)?`'${n.slice(0,4)}\u2026${n.slice(-4)}'`:n.length>30?`'${n.slice(0,27)}\u2026'`:`'${n}'`}function h(t){const n=t.replace(/^\(+/,"").trim();if(/^select\s+count\s*\(/i.test(n))return"COUNT";const s=n.match(/^(select|insert|update|delete|with)\b/i);return s?s[1].toUpperCase():"QUERY"}function x(t,n){const s=new Set,o=r=>{for(const m of t.matchAll(r))s.add(m[1])};return n==="INSERT"?o(/into\s+"?([\w.]+)"?/gi):n==="UPDATE"?(o(/update\s+"?([\w.]+)"?/gi),o(/from\s+"?([\w.]+)"?/gi),o(/join\s+"?([\w.]+)"?/gi)):(o(/from\s+"?([\w.]+)"?/gi),o(/join\s+"?([\w.]+)"?/gi)),s.size>0?[...s]:["?"]}function y(t,n){const s=[],o=new Set,r=/"?(\w+)"?\."?(\w+)"?\s*=\s*\$(\d+)/g;for(const i of t.matchAll(r)){const c=i[2],u=Number(i[3])-1,l=d(n[u]),f=`${c}=${l}`;o.has(f)||(o.add(f),s.push(`${c}=${l}`))}const m=/"?(\w+)"?\s+ilike\s+\$(\d+)/gi;for(const i of t.matchAll(m)){const c=i[1],u=Number(i[2])-1,l=`${c}~${n[u]}`;o.has(l)||(o.add(l),s.push(`${c}~${d(n[u])}`))}const a=/"?(\w+)"?\."?(\w+)"?\s+is\s+(not\s+)?null/gi;for(const i of t.matchAll(a)){const c=i[2],u=i[3],l=`${c}-null-${!!u}`;o.has(l)||(o.add(l),s.push(`${c} ${u?"IS NOT NULL":"IS NULL"}`))}return s}function E(t){const n=t.match(/order\s+by\s+"?(\w+)"?\."?(\w+)"?\s+(asc|desc)/i);return n?`${n[2]} ${n[3].toLowerCase()}`:null}function N(t,n){const s=t.match(/limit\s+(\d+)/i);if(s)return Number(s[1]);const o=t.match(/limit\s+\$(\d+)/i);if(o){const r=n[Number(o[1])-1];return typeof r=="number"?r:Number(r)||null}return null}const L={logQuery(t,n){if(/analytics_outbox/i.test(t)&&/skip locked/i.test(t))return;const s=h(t),o=x(t,s),r=y(t,n),m=E(t),a=N(t,n),i=`${e.dim} \xB7 ${e.reset}`,c=p[s]??e.cyan,u=`${e.bold}${e.cyan}[DB]${e.reset}`,l=`${e.bold}${c}${s.padEnd(6)}${e.reset}`,f=`${e.dim}+${e.reset}`,b=o.map(g=>`${e.white}${g}${e.reset}`).join(f),$=[`${u} ${l} ${b}`];r.length>0&&$.push(r.map(g=>`${e.cyan}${g}${e.reset}`).join(i)),m&&$.push(`${e.magenta}\u2193 ${m}${e.reset}`),a!==null&&$.push(`${e.yellow}limit=${a}${e.reset}`),console.log($.join(i))}};export{L as prettyLogger};
|