@hub-kit/core 0.3.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 +125 -0
- package/cli/hub-kit.mjs +112 -0
- package/dist/adapters/bank-reconciliation.d.ts +100 -0
- package/dist/adapters/bank-reconciliation.js +1 -0
- package/dist/adapters/bank-sync-log.d.ts +46 -0
- package/dist/adapters/bank-sync-log.js +1 -0
- package/dist/adapters/category-rules.d.ts +94 -0
- package/dist/adapters/category-rules.js +1 -0
- package/dist/adapters/companies.d.ts +85 -0
- package/dist/adapters/companies.js +3 -0
- package/dist/adapters/customers.d.ts +71 -0
- package/dist/adapters/customers.js +1 -0
- package/dist/adapters/exclusion-rules.d.ts +34 -0
- package/dist/adapters/exclusion-rules.js +15 -0
- package/dist/adapters/file-naming.d.ts +36 -0
- package/dist/adapters/file-naming.js +1 -0
- package/dist/adapters/index.d.ts +24 -0
- package/dist/adapters/index.js +1 -0
- package/dist/adapters/invoice-detail.d.ts +126 -0
- package/dist/adapters/invoice-detail.js +1 -0
- package/dist/adapters/invoice-list.d.ts +63 -0
- package/dist/adapters/invoice-list.js +1 -0
- package/dist/adapters/invoice-upload.d.ts +26 -0
- package/dist/adapters/invoice-upload.js +1 -0
- package/dist/adapters/manual-bookings.d.ts +56 -0
- package/dist/adapters/manual-bookings.js +1 -0
- package/dist/adapters/notifications.d.ts +31 -0
- package/dist/adapters/notifications.js +1 -0
- package/dist/adapters/open-items.d.ts +42 -0
- package/dist/adapters/open-items.js +1 -0
- package/dist/adapters/opos-whitelist.d.ts +38 -0
- package/dist/adapters/opos-whitelist.js +1 -0
- package/dist/adapters/outgoing-invoices.d.ts +32 -0
- package/dist/adapters/outgoing-invoices.js +1 -0
- package/dist/adapters/overview.d.ts +68 -0
- package/dist/adapters/overview.js +1 -0
- package/dist/adapters/processing-log.d.ts +48 -0
- package/dist/adapters/processing-log.js +1 -0
- package/dist/adapters/properties.d.ts +87 -0
- package/dist/adapters/properties.js +1 -0
- package/dist/adapters/supplier-detail.d.ts +64 -0
- package/dist/adapters/supplier-detail.js +1 -0
- package/dist/adapters/supplier-list.d.ts +21 -0
- package/dist/adapters/supplier-list.js +1 -0
- package/dist/adapters/team.d.ts +79 -0
- package/dist/adapters/team.js +1 -0
- package/dist/adapters/trash.d.ts +26 -0
- package/dist/adapters/trash.js +1 -0
- package/dist/adapters/vat-rules.d.ts +83 -0
- package/dist/adapters/vat-rules.js +1 -0
- package/dist/components/access/index.d.ts +3 -0
- package/dist/components/access/index.js +3 -0
- package/dist/components/access/permission-checklist.d.ts +13 -0
- package/dist/components/access/permission-checklist.js +19 -0
- package/dist/components/access/permission-matrix.d.ts +12 -0
- package/dist/components/access/permission-matrix.js +18 -0
- package/dist/components/access/types.d.ts +15 -0
- package/dist/components/access/types.js +1 -0
- package/dist/components/dashboard/date-range-calendar.d.ts +19 -0
- package/dist/components/dashboard/date-range-calendar.js +97 -0
- package/dist/components/dashboard/index.d.ts +23 -0
- package/dist/components/dashboard/index.js +14 -0
- package/dist/components/dashboard/kpi-card.d.ts +13 -0
- package/dist/components/dashboard/kpi-card.js +7 -0
- package/dist/components/dashboard/money-cards-row.d.ts +29 -0
- package/dist/components/dashboard/money-cards-row.js +28 -0
- package/dist/components/dashboard/money-trend-chart.d.ts +13 -0
- package/dist/components/dashboard/money-trend-chart.js +16 -0
- package/dist/components/dashboard/panel.d.ts +9 -0
- package/dist/components/dashboard/panel.js +5 -0
- package/dist/components/dashboard/period-picker.d.ts +25 -0
- package/dist/components/dashboard/period-picker.js +82 -0
- package/dist/components/dashboard/periods.d.ts +13 -0
- package/dist/components/dashboard/periods.js +63 -0
- package/dist/components/dashboard/pipeline-stages-panel.d.ts +14 -0
- package/dist/components/dashboard/pipeline-stages-panel.js +12 -0
- package/dist/components/dashboard/processing-summary-panel.d.ts +34 -0
- package/dist/components/dashboard/processing-summary-panel.js +11 -0
- package/dist/components/dashboard/ranked-bars.d.ts +15 -0
- package/dist/components/dashboard/ranked-bars.js +16 -0
- package/dist/components/dashboard/ranked-list-panel.d.ts +14 -0
- package/dist/components/dashboard/ranked-list-panel.js +9 -0
- package/dist/components/dashboard/stage-tiles.d.ts +15 -0
- package/dist/components/dashboard/stage-tiles.js +6 -0
- package/dist/components/dashboard/stat-rows-panel.d.ts +25 -0
- package/dist/components/dashboard/stat-rows-panel.js +7 -0
- package/dist/components/dashboard/stat-tile.d.ts +20 -0
- package/dist/components/dashboard/stat-tile.js +9 -0
- package/dist/components/feedback/index.d.ts +4 -0
- package/dist/components/feedback/index.js +2 -0
- package/dist/components/feedback/query-states.d.ts +27 -0
- package/dist/components/feedback/query-states.js +38 -0
- package/dist/components/feedback/table-pagination.d.ts +20 -0
- package/dist/components/feedback/table-pagination.js +15 -0
- package/dist/components/invoice-queue/index.d.ts +5 -0
- package/dist/components/invoice-queue/index.js +3 -0
- package/dist/components/invoice-queue/next-action-cell.d.ts +5 -0
- package/dist/components/invoice-queue/next-action-cell.js +9 -0
- package/dist/components/invoice-queue/queue-kpi-card.d.ts +19 -0
- package/dist/components/invoice-queue/queue-kpi-card.js +31 -0
- package/dist/components/invoice-queue/queue-kpi-row.d.ts +22 -0
- package/dist/components/invoice-queue/queue-kpi-row.js +12 -0
- package/dist/components/notifications/alerts.d.ts +25 -0
- package/dist/components/notifications/alerts.js +66 -0
- package/dist/components/notifications/bell.d.ts +14 -0
- package/dist/components/notifications/bell.js +17 -0
- package/dist/components/notifications/highlight.d.ts +4 -0
- package/dist/components/notifications/highlight.js +7 -0
- package/dist/components/notifications/index.d.ts +7 -0
- package/dist/components/notifications/index.js +6 -0
- package/dist/components/notifications/reminder-dialog.d.ts +24 -0
- package/dist/components/notifications/reminder-dialog.js +54 -0
- package/dist/components/notifications/types.d.ts +27 -0
- package/dist/components/notifications/types.js +1 -0
- package/dist/components/notifications/use-notification-acks.d.ts +7 -0
- package/dist/components/notifications/use-notification-acks.js +37 -0
- package/dist/components/shell/breadcrumbs.d.ts +7 -0
- package/dist/components/shell/breadcrumbs.js +38 -0
- package/dist/components/shell/index.d.ts +3 -0
- package/dist/components/shell/index.js +3 -0
- package/dist/components/shell/shell.d.ts +30 -0
- package/dist/components/shell/shell.js +110 -0
- package/dist/components/shell/types.d.ts +23 -0
- package/dist/components/shell/types.js +3 -0
- package/dist/components/tour/find-target.d.ts +1 -0
- package/dist/components/tour/find-target.js +3 -0
- package/dist/components/tour/index.d.ts +14 -0
- package/dist/components/tour/index.js +8 -0
- package/dist/components/tour/labels.d.ts +10 -0
- package/dist/components/tour/labels.js +9 -0
- package/dist/components/tour/seen-store.d.ts +3 -0
- package/dist/components/tour/seen-store.js +34 -0
- package/dist/components/tour/tour-blocks.d.ts +4 -0
- package/dist/components/tour/tour-blocks.js +27 -0
- package/dist/components/tour/tour-button.d.ts +4 -0
- package/dist/components/tour/tour-button.js +12 -0
- package/dist/components/tour/tour-card.d.ts +11 -0
- package/dist/components/tour/tour-card.js +7 -0
- package/dist/components/tour/tour-context.d.ts +16 -0
- package/dist/components/tour/tour-context.js +2 -0
- package/dist/components/tour/tour-overlay.d.ts +1 -0
- package/dist/components/tour/tour-overlay.js +165 -0
- package/dist/components/tour/tour-provider.d.ts +9 -0
- package/dist/components/tour/tour-provider.js +80 -0
- package/dist/components/tour/types.d.ts +44 -0
- package/dist/components/tour/types.js +1 -0
- package/dist/components/tour/use-tour.d.ts +3 -0
- package/dist/components/tour/use-tour.js +9 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +15 -0
- package/dist/i18n/index.d.ts +15 -0
- package/dist/i18n/index.js +15 -0
- package/dist/lib/bank-import/classify.d.ts +8 -0
- package/dist/lib/bank-import/classify.js +89 -0
- package/dist/lib/bank-import/column-guess.d.ts +2 -0
- package/dist/lib/bank-import/column-guess.js +40 -0
- package/dist/lib/bank-import/csv.d.ts +3 -0
- package/dist/lib/bank-import/csv.js +20 -0
- package/dist/lib/bank-import/duplicates.d.ts +2 -0
- package/dist/lib/bank-import/duplicates.js +21 -0
- package/dist/lib/bank-import/index.d.ts +12 -0
- package/dist/lib/bank-import/index.js +9 -0
- package/dist/lib/bank-import/mapping-storage.d.ts +3 -0
- package/dist/lib/bank-import/mapping-storage.js +29 -0
- package/dist/lib/bank-import/normalize.d.ts +4 -0
- package/dist/lib/bank-import/normalize.js +82 -0
- package/dist/lib/bank-import/parse-file.d.ts +7 -0
- package/dist/lib/bank-import/parse-file.js +23 -0
- package/dist/lib/bank-import/types.d.ts +31 -0
- package/dist/lib/bank-import/types.js +1 -0
- package/dist/lib/bank-import/xlsx.d.ts +2 -0
- package/dist/lib/bank-import/xlsx.js +25 -0
- package/dist/lib/class-names.d.ts +2 -0
- package/dist/lib/class-names.js +5 -0
- package/dist/lib/download.d.ts +2 -0
- package/dist/lib/download.js +14 -0
- package/dist/lib/formatters.d.ts +6 -0
- package/dist/lib/formatters.js +24 -0
- package/dist/lib/index.d.ts +9 -0
- package/dist/lib/index.js +6 -0
- package/dist/lib/opos-whitelist/index.d.ts +2 -0
- package/dist/lib/opos-whitelist/index.js +1 -0
- package/dist/lib/opos-whitelist/opos.d.ts +14 -0
- package/dist/lib/opos-whitelist/opos.js +49 -0
- package/dist/lib/query-result.d.ts +12 -0
- package/dist/lib/query-result.js +1 -0
- package/dist/lib/tour-placeholders/index.d.ts +2 -0
- package/dist/lib/tour-placeholders/index.js +1 -0
- package/dist/lib/tour-placeholders/overview.d.ts +12 -0
- package/dist/lib/tour-placeholders/overview.js +139 -0
- package/dist/pages/bank-accounts/BankAccountsPage.d.ts +7 -0
- package/dist/pages/bank-accounts/BankAccountsPage.js +21 -0
- package/dist/pages/bank-accounts/index.d.ts +4 -0
- package/dist/pages/bank-accounts/index.js +2 -0
- package/dist/pages/bank-accounts/labels.d.ts +15 -0
- package/dist/pages/bank-accounts/labels.js +14 -0
- package/dist/pages/bank-import/BankImportWizard.d.ts +9 -0
- package/dist/pages/bank-import/BankImportWizard.js +158 -0
- package/dist/pages/bank-import/index.d.ts +4 -0
- package/dist/pages/bank-import/index.js +2 -0
- package/dist/pages/bank-import/labels.d.ts +44 -0
- package/dist/pages/bank-import/labels.js +43 -0
- package/dist/pages/bank-sync-log/BankSyncLogPage.d.ts +7 -0
- package/dist/pages/bank-sync-log/BankSyncLogPage.js +77 -0
- package/dist/pages/bank-sync-log/index.d.ts +4 -0
- package/dist/pages/bank-sync-log/index.js +2 -0
- package/dist/pages/bank-sync-log/labels.d.ts +21 -0
- package/dist/pages/bank-sync-log/labels.js +20 -0
- package/dist/pages/bank-transactions/BankMatchPanel.d.ts +8 -0
- package/dist/pages/bank-transactions/BankMatchPanel.js +75 -0
- package/dist/pages/bank-transactions/BankTransactionsPage.d.ts +7 -0
- package/dist/pages/bank-transactions/BankTransactionsPage.js +59 -0
- package/dist/pages/bank-transactions/badges.d.ts +8 -0
- package/dist/pages/bank-transactions/badges.js +24 -0
- package/dist/pages/bank-transactions/index.d.ts +6 -0
- package/dist/pages/bank-transactions/index.js +4 -0
- package/dist/pages/bank-transactions/labels.d.ts +41 -0
- package/dist/pages/bank-transactions/labels.js +40 -0
- package/dist/pages/bank-transactions/sort-control.d.ts +17 -0
- package/dist/pages/bank-transactions/sort-control.js +8 -0
- package/dist/pages/bank-transactions/use-table-view.d.ts +23 -0
- package/dist/pages/bank-transactions/use-table-view.js +54 -0
- package/dist/pages/category-rules/CategoryRulesPage.d.ts +7 -0
- package/dist/pages/category-rules/CategoryRulesPage.js +160 -0
- package/dist/pages/category-rules/index.d.ts +4 -0
- package/dist/pages/category-rules/index.js +2 -0
- package/dist/pages/category-rules/labels.d.ts +66 -0
- package/dist/pages/category-rules/labels.js +72 -0
- package/dist/pages/companies/company-detail-page.d.ts +10 -0
- package/dist/pages/companies/company-detail-page.js +184 -0
- package/dist/pages/companies/company-form.d.ts +20 -0
- package/dist/pages/companies/company-form.js +23 -0
- package/dist/pages/companies/company-list-page.d.ts +9 -0
- package/dist/pages/companies/company-list-page.js +109 -0
- package/dist/pages/companies/known-spellings-card.d.ts +8 -0
- package/dist/pages/companies/known-spellings-card.js +65 -0
- package/dist/pages/companies/labels.d.ts +105 -0
- package/dist/pages/companies/labels.js +104 -0
- package/dist/pages/companies/sort-control.d.ts +17 -0
- package/dist/pages/companies/sort-control.js +8 -0
- package/dist/pages/companies/use-infinite-rows.d.ts +6 -0
- package/dist/pages/companies/use-infinite-rows.js +24 -0
- package/dist/pages/companies/use-table-view.d.ts +23 -0
- package/dist/pages/companies/use-table-view.js +56 -0
- package/dist/pages/customers/company-chip.d.ts +6 -0
- package/dist/pages/customers/company-chip.js +9 -0
- package/dist/pages/customers/copy-button.d.ts +6 -0
- package/dist/pages/customers/copy-button.js +31 -0
- package/dist/pages/customers/customer-detail-page.d.ts +10 -0
- package/dist/pages/customers/customer-detail-page.js +83 -0
- package/dist/pages/customers/customer-list-page.d.ts +9 -0
- package/dist/pages/customers/customer-list-page.js +65 -0
- package/dist/pages/customers/edit-customer-dialog.d.ts +9 -0
- package/dist/pages/customers/edit-customer-dialog.js +72 -0
- package/dist/pages/customers/form-hints.d.ts +6 -0
- package/dist/pages/customers/form-hints.js +9 -0
- package/dist/pages/customers/invoice-status-badge.d.ts +10 -0
- package/dist/pages/customers/invoice-status-badge.js +22 -0
- package/dist/pages/customers/labels.d.ts +116 -0
- package/dist/pages/customers/labels.js +117 -0
- package/dist/pages/customers/new-customer-dialog.d.ts +6 -0
- package/dist/pages/customers/new-customer-dialog.js +93 -0
- package/dist/pages/customers/sort-control.d.ts +14 -0
- package/dist/pages/customers/sort-control.js +9 -0
- package/dist/pages/customers/use-table-view.d.ts +23 -0
- package/dist/pages/customers/use-table-view.js +56 -0
- package/dist/pages/exclusion-rules/exclusion-rules-page.d.ts +7 -0
- package/dist/pages/exclusion-rules/exclusion-rules-page.js +114 -0
- package/dist/pages/exclusion-rules/labels.d.ts +53 -0
- package/dist/pages/exclusion-rules/labels.js +61 -0
- package/dist/pages/file-naming/build-filename.d.ts +3 -0
- package/dist/pages/file-naming/build-filename.js +82 -0
- package/dist/pages/file-naming/file-naming-page.d.ts +10 -0
- package/dist/pages/file-naming/file-naming-page.js +120 -0
- package/dist/pages/file-naming/labels.d.ts +44 -0
- package/dist/pages/file-naming/labels.js +44 -0
- package/dist/pages/index.d.ts +63 -0
- package/dist/pages/index.js +48 -0
- package/dist/pages/invoice-detail/InvoiceDetailPage.d.ts +11 -0
- package/dist/pages/invoice-detail/InvoiceDetailPage.js +292 -0
- package/dist/pages/invoice-detail/OutgoingInvoiceFlag.d.ts +26 -0
- package/dist/pages/invoice-detail/OutgoingInvoiceFlag.js +16 -0
- package/dist/pages/invoice-detail/ReviewBadge.d.ts +15 -0
- package/dist/pages/invoice-detail/ReviewBadge.js +23 -0
- package/dist/pages/invoice-detail/ReviewCard.d.ts +17 -0
- package/dist/pages/invoice-detail/ReviewCard.js +12 -0
- package/dist/pages/invoice-detail/SideBySide.d.ts +5 -0
- package/dist/pages/invoice-detail/SideBySide.js +5 -0
- package/dist/pages/invoice-detail/WorkflowHistoryList.d.ts +23 -0
- package/dist/pages/invoice-detail/WorkflowHistoryList.js +32 -0
- package/dist/pages/invoice-detail/WorkflowLadder.d.ts +20 -0
- package/dist/pages/invoice-detail/WorkflowLadder.js +16 -0
- package/dist/pages/invoice-detail/history.d.ts +23 -0
- package/dist/pages/invoice-detail/history.js +76 -0
- package/dist/pages/invoice-detail/index.d.ts +21 -0
- package/dist/pages/invoice-detail/index.js +11 -0
- package/dist/pages/invoice-detail/labels.d.ts +79 -0
- package/dist/pages/invoice-detail/labels.js +139 -0
- package/dist/pages/invoice-detail/pipeline-types.d.ts +58 -0
- package/dist/pages/invoice-detail/pipeline-types.js +1 -0
- package/dist/pages/invoice-detail/review-recheck.d.ts +8 -0
- package/dist/pages/invoice-detail/review-recheck.js +103 -0
- package/dist/pages/invoice-detail/review.d.ts +91 -0
- package/dist/pages/invoice-detail/review.js +310 -0
- package/dist/pages/invoice-list/badges.d.ts +23 -0
- package/dist/pages/invoice-list/badges.js +26 -0
- package/dist/pages/invoice-list/index.d.ts +5 -0
- package/dist/pages/invoice-list/index.js +3 -0
- package/dist/pages/invoice-list/invoice-list-page.d.ts +13 -0
- package/dist/pages/invoice-list/invoice-list-page.js +114 -0
- package/dist/pages/invoice-list/labels.d.ts +36 -0
- package/dist/pages/invoice-list/labels.js +29 -0
- package/dist/pages/invoice-list/sort-control.d.ts +17 -0
- package/dist/pages/invoice-list/sort-control.js +8 -0
- package/dist/pages/invoice-list/use-table-view.d.ts +23 -0
- package/dist/pages/invoice-list/use-table-view.js +54 -0
- package/dist/pages/invoice-upload/InvoiceUploadPage.d.ts +7 -0
- package/dist/pages/invoice-upload/InvoiceUploadPage.js +115 -0
- package/dist/pages/invoice-upload/index.d.ts +4 -0
- package/dist/pages/invoice-upload/index.js +2 -0
- package/dist/pages/invoice-upload/labels.d.ts +29 -0
- package/dist/pages/invoice-upload/labels.js +28 -0
- package/dist/pages/manual-bookings/ManualBookingsPage.d.ts +7 -0
- package/dist/pages/manual-bookings/ManualBookingsPage.js +161 -0
- package/dist/pages/manual-bookings/index.d.ts +4 -0
- package/dist/pages/manual-bookings/index.js +2 -0
- package/dist/pages/manual-bookings/labels.d.ts +53 -0
- package/dist/pages/manual-bookings/labels.js +52 -0
- package/dist/pages/notifications/labels.d.ts +22 -0
- package/dist/pages/notifications/labels.js +21 -0
- package/dist/pages/notifications/notifications-page.d.ts +14 -0
- package/dist/pages/notifications/notifications-page.js +81 -0
- package/dist/pages/open-items/OpenItemsPage.d.ts +11 -0
- package/dist/pages/open-items/OpenItemsPage.js +110 -0
- package/dist/pages/open-items/index.d.ts +6 -0
- package/dist/pages/open-items/index.js +3 -0
- package/dist/pages/open-items/labels.d.ts +37 -0
- package/dist/pages/open-items/labels.js +36 -0
- package/dist/pages/open-items/urgency.d.ts +8 -0
- package/dist/pages/open-items/urgency.js +27 -0
- package/dist/pages/opos-whitelist/OposWhitelistPage.d.ts +7 -0
- package/dist/pages/opos-whitelist/OposWhitelistPage.js +165 -0
- package/dist/pages/opos-whitelist/index.d.ts +4 -0
- package/dist/pages/opos-whitelist/index.js +2 -0
- package/dist/pages/opos-whitelist/labels.d.ts +56 -0
- package/dist/pages/opos-whitelist/labels.js +70 -0
- package/dist/pages/outgoing-invoices/OutgoingInvoicesPage.d.ts +7 -0
- package/dist/pages/outgoing-invoices/OutgoingInvoicesPage.js +169 -0
- package/dist/pages/outgoing-invoices/index.d.ts +4 -0
- package/dist/pages/outgoing-invoices/index.js +2 -0
- package/dist/pages/outgoing-invoices/labels.d.ts +43 -0
- package/dist/pages/outgoing-invoices/labels.js +42 -0
- package/dist/pages/outgoing-invoices/sort-control.d.ts +17 -0
- package/dist/pages/outgoing-invoices/sort-control.js +8 -0
- package/dist/pages/outgoing-invoices/use-table-view.d.ts +23 -0
- package/dist/pages/outgoing-invoices/use-table-view.js +54 -0
- package/dist/pages/overview/labels.d.ts +35 -0
- package/dist/pages/overview/labels.js +34 -0
- package/dist/pages/overview/overview-page.d.ts +22 -0
- package/dist/pages/overview/overview-page.js +127 -0
- package/dist/pages/processing-log/labels.d.ts +54 -0
- package/dist/pages/processing-log/labels.js +53 -0
- package/dist/pages/processing-log/mail-parsing.d.ts +21 -0
- package/dist/pages/processing-log/mail-parsing.js +52 -0
- package/dist/pages/processing-log/processing-log-page.d.ts +9 -0
- package/dist/pages/processing-log/processing-log-page.js +206 -0
- package/dist/pages/properties/badges.d.ts +20 -0
- package/dist/pages/properties/badges.js +45 -0
- package/dist/pages/properties/company-assignment-field.d.ts +11 -0
- package/dist/pages/properties/company-assignment-field.js +13 -0
- package/dist/pages/properties/form-field.d.ts +6 -0
- package/dist/pages/properties/form-field.js +9 -0
- package/dist/pages/properties/labels.d.ts +124 -0
- package/dist/pages/properties/labels.js +128 -0
- package/dist/pages/properties/name-variants-card.d.ts +7 -0
- package/dist/pages/properties/name-variants-card.js +60 -0
- package/dist/pages/properties/property-detail-page.d.ts +10 -0
- package/dist/pages/properties/property-detail-page.js +150 -0
- package/dist/pages/properties/property-list-page.d.ts +13 -0
- package/dist/pages/properties/property-list-page.js +201 -0
- package/dist/pages/properties/sort-control.d.ts +14 -0
- package/dist/pages/properties/sort-control.js +9 -0
- package/dist/pages/properties/use-infinite-rows.d.ts +6 -0
- package/dist/pages/properties/use-infinite-rows.js +26 -0
- package/dist/pages/properties/use-table-view.d.ts +23 -0
- package/dist/pages/properties/use-table-view.js +56 -0
- package/dist/pages/supplier-detail/SupplierDetailPage.d.ts +10 -0
- package/dist/pages/supplier-detail/SupplierDetailPage.js +157 -0
- package/dist/pages/supplier-detail/index.d.ts +4 -0
- package/dist/pages/supplier-detail/index.js +2 -0
- package/dist/pages/supplier-detail/labels.d.ts +46 -0
- package/dist/pages/supplier-detail/labels.js +45 -0
- package/dist/pages/supplier-list/SupplierListPage.d.ts +9 -0
- package/dist/pages/supplier-list/SupplierListPage.js +102 -0
- package/dist/pages/supplier-list/index.d.ts +4 -0
- package/dist/pages/supplier-list/index.js +2 -0
- package/dist/pages/supplier-list/labels.d.ts +33 -0
- package/dist/pages/supplier-list/labels.js +32 -0
- package/dist/pages/supplier-list/sort-control.d.ts +17 -0
- package/dist/pages/supplier-list/sort-control.js +8 -0
- package/dist/pages/supplier-list/use-table-view.d.ts +23 -0
- package/dist/pages/supplier-list/use-table-view.js +54 -0
- package/dist/pages/team/account-dialogs.d.ts +12 -0
- package/dist/pages/team/account-dialogs.js +49 -0
- package/dist/pages/team/employee-editor.d.ts +19 -0
- package/dist/pages/team/employee-editor.js +124 -0
- package/dist/pages/team/labels.d.ts +99 -0
- package/dist/pages/team/labels.js +98 -0
- package/dist/pages/team/new-employee.d.ts +8 -0
- package/dist/pages/team/new-employee.js +103 -0
- package/dist/pages/team/roles-tab.d.ts +6 -0
- package/dist/pages/team/roles-tab.js +46 -0
- package/dist/pages/team/team-page.d.ts +7 -0
- package/dist/pages/team/team-page.js +81 -0
- package/dist/pages/team/temp-password-dialog.d.ts +11 -0
- package/dist/pages/team/temp-password-dialog.js +23 -0
- package/dist/pages/trash/labels.d.ts +68 -0
- package/dist/pages/trash/labels.js +69 -0
- package/dist/pages/trash/trash-page.d.ts +9 -0
- package/dist/pages/trash/trash-page.js +259 -0
- package/dist/pages/vat-rules/labels.d.ts +110 -0
- package/dist/pages/vat-rules/labels.js +109 -0
- package/dist/pages/vat-rules/new-rule-dialog.d.ts +7 -0
- package/dist/pages/vat-rules/new-rule-dialog.js +134 -0
- package/dist/pages/vat-rules/rule-row.d.ts +20 -0
- package/dist/pages/vat-rules/rule-row.js +120 -0
- package/dist/pages/vat-rules/vat-rules-page.d.ts +9 -0
- package/dist/pages/vat-rules/vat-rules-page.js +61 -0
- package/dist/ui/alert-dialog.d.ts +20 -0
- package/dist/ui/alert-dialog.js +41 -0
- package/dist/ui/badge.d.ts +9 -0
- package/dist/ui/badge.js +20 -0
- package/dist/ui/breadcrumb.d.ts +19 -0
- package/dist/ui/breadcrumb.js +23 -0
- package/dist/ui/button.d.ts +11 -0
- package/dist/ui/button.js +33 -0
- package/dist/ui/calendar.d.ts +8 -0
- package/dist/ui/calendar.js +75 -0
- package/dist/ui/card.d.ts +8 -0
- package/dist/ui/card.js +16 -0
- package/dist/ui/chart.d.ts +62 -0
- package/dist/ui/chart.js +118 -0
- package/dist/ui/checkbox.d.ts +4 -0
- package/dist/ui/checkbox.js +11 -0
- package/dist/ui/collapsible.d.ts +5 -0
- package/dist/ui/collapsible.js +5 -0
- package/dist/ui/combobox.d.ts +24 -0
- package/dist/ui/combobox.js +55 -0
- package/dist/ui/command.d.ts +80 -0
- package/dist/ui/command.js +29 -0
- package/dist/ui/dialog.d.ts +19 -0
- package/dist/ui/dialog.js +58 -0
- package/dist/ui/dropdown-menu.d.ts +27 -0
- package/dist/ui/dropdown-menu.js +33 -0
- package/dist/ui/field-context.d.ts +4 -0
- package/dist/ui/field-context.js +6 -0
- package/dist/ui/field.d.ts +3 -0
- package/dist/ui/field.js +8 -0
- package/dist/ui/icon-action.d.ts +3 -0
- package/dist/ui/icon-action.js +8 -0
- package/dist/ui/index.d.ts +32 -0
- package/dist/ui/index.js +32 -0
- package/dist/ui/input.d.ts +3 -0
- package/dist/ui/input.js +11 -0
- package/dist/ui/label.d.ts +5 -0
- package/dist/ui/label.js +15 -0
- package/dist/ui/multi-combobox.d.ts +18 -0
- package/dist/ui/multi-combobox.js +40 -0
- package/dist/ui/popover.d.ts +9 -0
- package/dist/ui/popover.js +12 -0
- package/dist/ui/scroll-area.d.ts +5 -0
- package/dist/ui/scroll-area.js +9 -0
- package/dist/ui/scroll-shadow.d.ts +8 -0
- package/dist/ui/scroll-shadow.js +57 -0
- package/dist/ui/select.d.ts +13 -0
- package/dist/ui/select.js +31 -0
- package/dist/ui/separator.d.ts +4 -0
- package/dist/ui/separator.js +7 -0
- package/dist/ui/sheet.d.ts +25 -0
- package/dist/ui/sheet.js +40 -0
- package/dist/ui/sidebar.d.ts +65 -0
- package/dist/ui/sidebar.js +207 -0
- package/dist/ui/skeleton.d.ts +2 -0
- package/dist/ui/skeleton.js +6 -0
- package/dist/ui/sonner.d.ts +5 -0
- package/dist/ui/sonner.js +13 -0
- package/dist/ui/switch.d.ts +4 -0
- package/dist/ui/switch.js +7 -0
- package/dist/ui/table.d.ts +12 -0
- package/dist/ui/table.js +24 -0
- package/dist/ui/tabs.d.ts +7 -0
- package/dist/ui/tabs.js +12 -0
- package/dist/ui/textarea.d.ts +3 -0
- package/dist/ui/textarea.js +11 -0
- package/dist/ui/tooltip.d.ts +7 -0
- package/dist/ui/tooltip.js +11 -0
- package/package.json +80 -0
- package/themes/TOKENS.md +57 -0
- package/themes/default.css +60 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useEffect, useMemo, useRef, useState, } from "react";
|
|
3
|
+
import { Link, useRouterState } from "@tanstack/react-router";
|
|
4
|
+
import { ChevronDown, X } from "lucide-react";
|
|
5
|
+
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, } from "../../ui/breadcrumb.js";
|
|
6
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../ui/collapsible.js";
|
|
7
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger, } from "../../ui/dropdown-menu.js";
|
|
8
|
+
import { Separator } from "../../ui/separator.js";
|
|
9
|
+
import { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarHeader, SidebarInset, SidebarMenu, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarTrigger, useSidebar, } from "../../ui/sidebar.js";
|
|
10
|
+
import { Toaster } from "../../ui/sonner.js";
|
|
11
|
+
import { TooltipProvider } from "../../ui/tooltip.js";
|
|
12
|
+
import { cn } from "../../lib/class-names.js";
|
|
13
|
+
import { buildCrumbs } from "./breadcrumbs.js";
|
|
14
|
+
import { isShellGroup, } from "./types.js";
|
|
15
|
+
const ShellLeafLabelContext = createContext(() => { });
|
|
16
|
+
export function useShellLeafLabel(label) {
|
|
17
|
+
const set = useContext(ShellLeafLabelContext);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
set(label);
|
|
20
|
+
return () => set(null);
|
|
21
|
+
}, [set, label]);
|
|
22
|
+
}
|
|
23
|
+
export function ShellFooterGroup({ label, icon: Icon, items, active, }) {
|
|
24
|
+
const pathname = useRouterState({ select: (state) => state.location.pathname });
|
|
25
|
+
const { state, isMobile, setOpenMobile } = useSidebar();
|
|
26
|
+
const [open, setOpen] = useState(false);
|
|
27
|
+
const groupRef = useRef(null);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!open)
|
|
30
|
+
return;
|
|
31
|
+
const onPointerDown = (event) => {
|
|
32
|
+
if (!groupRef.current?.contains(event.target))
|
|
33
|
+
setOpen(false);
|
|
34
|
+
};
|
|
35
|
+
const onKeyDown = (event) => {
|
|
36
|
+
if (event.key === "Escape")
|
|
37
|
+
setOpen(false);
|
|
38
|
+
};
|
|
39
|
+
document.addEventListener("pointerdown", onPointerDown);
|
|
40
|
+
document.addEventListener("keydown", onKeyDown);
|
|
41
|
+
return () => {
|
|
42
|
+
document.removeEventListener("pointerdown", onPointerDown);
|
|
43
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
44
|
+
};
|
|
45
|
+
}, [open]);
|
|
46
|
+
if (state === "collapsed" && !isMobile) {
|
|
47
|
+
return (_jsx(SidebarMenuItem, { children: _jsx(ShellRailMenu, { label: label, icon: Icon, items: items, active: active, align: "end" }) }));
|
|
48
|
+
}
|
|
49
|
+
return (_jsx(Collapsible, { open: open, onOpenChange: setOpen, className: "group/collapsible", children: _jsxs(SidebarMenuItem, { ref: groupRef, className: "flex flex-col", children: [_jsx(CollapsibleContent, { className: "overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down", children: _jsx(SidebarMenuSub, { className: "mx-1 mb-1 gap-0.5 rounded-md border border-l-4 border-border border-l-primary bg-popover p-1 shadow-xl", children: items.map((child) => {
|
|
50
|
+
const childActive = child.to === "/" ? pathname === "/" : pathname.startsWith(child.to);
|
|
51
|
+
return (_jsx(SidebarMenuSubItem, { children: _jsx(SidebarMenuSubButton, { asChild: true, isActive: childActive, children: _jsxs(Link, { to: child.to, "aria-current": childActive ? "page" : undefined, onClick: () => isMobile && setOpenMobile(false), children: [_jsx(child.icon, { className: "size-4" }), _jsx("span", { children: child.label })] }) }) }, child.key));
|
|
52
|
+
}) }) }), _jsx(CollapsibleTrigger, { asChild: true, children: _jsxs(SidebarMenuButton, { children: [_jsx(Icon, {}), _jsx("span", { children: label }), _jsx(ChevronDown, { className: "ml-auto size-4 shrink-0 opacity-60 transition-transform group-data-[state=open]/collapsible:rotate-180" })] }) })] }) }));
|
|
53
|
+
}
|
|
54
|
+
export function ShellRailMenu({ label, icon: Icon, items, active, align = "start", }) {
|
|
55
|
+
const pathname = useRouterState({ select: (state) => state.location.pathname });
|
|
56
|
+
const { isMobile, setOpenMobile } = useSidebar();
|
|
57
|
+
return (_jsxs(DropdownMenu, { modal: false, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(SidebarMenuButton, { isActive: active, children: [_jsx(Icon, {}), _jsx("span", { children: label })] }) }), _jsxs(DropdownMenuContent, { side: isMobile ? "top" : "right", align: isMobile ? "start" : align, sideOffset: isMobile ? 8 : 10, collisionPadding: 12, className: cn("min-w-52 max-w-[calc(100vw-2rem)] overflow-visible border-l-4 border-l-primary shadow-xl", "relative before:absolute before:h-0 before:w-0 before:content-['']", "data-[side=right]:before:-left-2 data-[side=right]:before:border-y-8 data-[side=right]:before:border-r-8 data-[side=right]:before:border-y-transparent data-[side=right]:before:border-r-primary", "data-[side=right]:data-[align=start]:before:top-4 data-[side=right]:data-[align=end]:before:bottom-4", "data-[side=top]:before:-bottom-2 data-[side=top]:before:left-5 data-[side=top]:before:border-x-8 data-[side=top]:before:border-t-8 data-[side=top]:before:border-x-transparent data-[side=top]:before:border-t-primary"), children: [_jsx(DropdownMenuLabel, { children: label }), items.map((child) => {
|
|
58
|
+
const childActive = child.to === "/" ? pathname === "/" : pathname.startsWith(child.to);
|
|
59
|
+
return (_jsx(DropdownMenuItem, { asChild: true, children: _jsxs(Link, { to: child.to, "aria-current": childActive ? "page" : undefined, onClick: () => isMobile && setOpenMobile(false), className: cn("cursor-pointer", childActive && "font-medium text-brand"), children: [_jsx(child.icon, { className: "size-4" }), child.label] }) }, child.key));
|
|
60
|
+
})] })] }));
|
|
61
|
+
}
|
|
62
|
+
export function Shell({ nav, logo, footer, headerActions, badges, homeLabel, staticLeafLabels, breadcrumbAriaLabel, closeLabel, children, }) {
|
|
63
|
+
const pathname = useRouterState({ select: (s) => s.location.pathname });
|
|
64
|
+
const [leafLabel, setLeafLabel] = useState(null);
|
|
65
|
+
const crumbs = useMemo(() => {
|
|
66
|
+
const built = buildCrumbs({ nav, pathname, homeLabel, staticLeafLabels });
|
|
67
|
+
if (leafLabel && built.length > 1) {
|
|
68
|
+
built[built.length - 1] = { ...built[built.length - 1], label: leafLabel };
|
|
69
|
+
}
|
|
70
|
+
return built;
|
|
71
|
+
}, [nav, pathname, homeLabel, staticLeafLabels, leafLabel]);
|
|
72
|
+
return (_jsx(TooltipProvider, { delayDuration: 200, children: _jsx(ShellLeafLabelContext.Provider, { value: setLeafLabel, children: _jsxs(SidebarProvider, { children: [_jsx(ShellSidebar, { nav: nav, logo: logo, footer: footer, badges: badges, closeLabel: closeLabel }), _jsxs(SidebarInset, { className: "min-w-0 bg-brand-wash", children: [_jsxs("header", { className: "sticky top-0 z-30 flex h-14 shrink-0 items-center gap-2 border-b border-sidebar-border bg-header/90 px-4 backdrop-blur-sm", children: [_jsx(SidebarTrigger, { className: "-ml-1 shrink-0" }), _jsx(Separator, { orientation: "vertical", className: "mr-1 h-4 shrink-0" }), _jsxs(Breadcrumb, { "aria-label": breadcrumbAriaLabel, className: "min-w-0", children: [_jsx(BreadcrumbList, { className: "flex-nowrap sm:hidden", children: _jsx(BreadcrumbItem, { className: "min-w-0", children: _jsx(BreadcrumbPage, { className: "truncate", children: crumbs[crumbs.length - 1]?.label }) }) }), _jsx(BreadcrumbList, { className: "hidden flex-nowrap sm:flex", children: crumbs.map((crumb, i) => {
|
|
73
|
+
const last = i === crumbs.length - 1;
|
|
74
|
+
return (_jsxs(BreadcrumbItem, { className: "min-w-0", children: [last ? (_jsx(BreadcrumbPage, { className: "truncate", children: crumb.label })) : crumb.to ? (_jsx(BreadcrumbLink, { asChild: true, children: _jsx(Link, { to: crumb.to, className: "truncate", children: crumb.label }) })) : (_jsx("span", { className: "truncate text-muted-foreground", children: crumb.label })), !last && _jsx(BreadcrumbSeparator, { className: "shrink-0" })] }, `${crumb.label}-${i}`));
|
|
75
|
+
}) })] }), headerActions && (_jsx("div", { className: "ml-auto flex shrink-0 items-center gap-2 pl-2", children: headerActions }))] }), _jsx("main", { className: "w-full min-w-0 px-4 py-4 sm:px-6", children: children }), _jsx(Toaster, { position: "bottom-right" })] })] }) }) }));
|
|
76
|
+
}
|
|
77
|
+
function ShellSidebar({ nav, logo, footer, badges, closeLabel, }) {
|
|
78
|
+
const pathname = useRouterState({ select: (s) => s.location.pathname });
|
|
79
|
+
const { state, isMobile, setOpenMobile } = useSidebar();
|
|
80
|
+
const closeOnMobile = () => {
|
|
81
|
+
if (isMobile)
|
|
82
|
+
setOpenMobile(false);
|
|
83
|
+
};
|
|
84
|
+
const railCollapsed = state === "collapsed" && !isMobile;
|
|
85
|
+
const isActive = (to) => (to === "/" ? pathname === "/" : pathname.startsWith(to));
|
|
86
|
+
return (_jsxs(Sidebar, { collapsible: "icon", children: [_jsxs(SidebarHeader, { className: "h-14 flex-row items-center justify-between px-3", children: [logo, isMobile && (_jsx("button", { type: "button", onClick: () => setOpenMobile(false), "aria-label": closeLabel, className: "-mr-1 shrink-0 cursor-pointer rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-foreground", children: _jsx(X, { className: "size-5" }) }))] }), _jsx(SidebarContent, { children: _jsx(SidebarGroup, { children: _jsx(SidebarMenu, { children: nav.map((item) => {
|
|
87
|
+
const badge = badges?.[item.key];
|
|
88
|
+
const showBadge = !!badge && badge.count > 0;
|
|
89
|
+
if (!isShellGroup(item)) {
|
|
90
|
+
const active = isActive(item.to);
|
|
91
|
+
return (_jsxs(SidebarMenuItem, { children: [_jsx(SidebarMenuButton, { asChild: true, isActive: active, children: _jsxs(Link, { to: item.to, "aria-current": active ? "page" : undefined, onClick: closeOnMobile, children: [_jsx(item.icon, {}), _jsx("span", { children: item.label })] }) }), showBadge && _jsx(ShellBadgePill, { badge: badge })] }, item.key));
|
|
92
|
+
}
|
|
93
|
+
const groupActive = item.items.some((c) => isActive(c.to));
|
|
94
|
+
if (railCollapsed) {
|
|
95
|
+
return (_jsxs(SidebarMenuItem, { children: [_jsx(ShellRailMenu, { label: item.label, icon: item.icon, items: item.items, active: groupActive }), showBadge && _jsx(ShellBadgePill, { badge: badge })] }, item.key));
|
|
96
|
+
}
|
|
97
|
+
return (_jsx(ShellNavGroupItem, { item: item, groupActive: groupActive, isActive: isActive, closeOnMobile: closeOnMobile, badge: showBadge ? badge : undefined }, item.key));
|
|
98
|
+
}) }) }) }), footer && _jsx(SidebarFooter, { className: "gap-2", children: footer }), _jsx(SidebarRail, {})] }));
|
|
99
|
+
}
|
|
100
|
+
function ShellNavGroupItem({ item, groupActive, isActive, closeOnMobile, badge, }) {
|
|
101
|
+
const [open, setOpen] = useState(groupActive);
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (groupActive)
|
|
104
|
+
setOpen(true);
|
|
105
|
+
}, [groupActive]);
|
|
106
|
+
return (_jsx(Collapsible, { open: open, onOpenChange: setOpen, className: "group/collapsible", children: _jsxs(SidebarMenuItem, { children: [_jsx(CollapsibleTrigger, { asChild: true, children: _jsxs(SidebarMenuButton, { children: [_jsx(item.icon, {}), _jsx("span", { children: item.label }), _jsx(ChevronDown, { className: "ml-auto size-4 shrink-0 opacity-60 transition-transform group-data-[state=open]/collapsible:rotate-180" })] }) }), badge && _jsx(ShellBadgePill, { badge: badge, className: "right-8" }), _jsx(CollapsibleContent, { className: "overflow-hidden data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down", children: _jsx(SidebarMenuSub, { children: item.items.map((child) => (_jsx(SidebarMenuSubItem, { children: _jsx(SidebarMenuSubButton, { asChild: true, isActive: isActive(child.to), children: _jsxs(Link, { to: child.to, "aria-current": isActive(child.to) ? "page" : undefined, onClick: closeOnMobile, children: [_jsx(child.icon, { className: "size-4" }), _jsx("span", { children: child.label })] }) }) }, child.key))) }) })] }) }));
|
|
107
|
+
}
|
|
108
|
+
function ShellBadgePill({ badge, className }) {
|
|
109
|
+
return (_jsx(SidebarMenuBadge, { title: badge.title, className: cn("pointer-events-none bg-amber-500 text-white", className), children: badge.count }));
|
|
110
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { LucideIcon } from "lucide-react";
|
|
2
|
+
export type ShellNavLink = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
to: string;
|
|
6
|
+
icon: LucideIcon;
|
|
7
|
+
};
|
|
8
|
+
export type ShellNavGroup = {
|
|
9
|
+
key: string;
|
|
10
|
+
label: string;
|
|
11
|
+
icon: LucideIcon;
|
|
12
|
+
items: ShellNavLink[];
|
|
13
|
+
};
|
|
14
|
+
export type ShellNavEntry = ShellNavLink | ShellNavGroup;
|
|
15
|
+
export declare function isShellGroup(entry: ShellNavEntry): entry is ShellNavGroup;
|
|
16
|
+
export type ShellBadge = {
|
|
17
|
+
count: number;
|
|
18
|
+
title?: string;
|
|
19
|
+
};
|
|
20
|
+
export type Crumb = {
|
|
21
|
+
label: string;
|
|
22
|
+
to?: string;
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function findTourTarget(target: string): HTMLElement | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type { TourContentBlock, TourDefinition, TourMap, TourPlacement, TourStep, } from "./types";
|
|
2
|
+
export { TourProvider } from "./tour-provider";
|
|
3
|
+
export type { TourProviderProps } from "./tour-provider";
|
|
4
|
+
export type { TourState } from "./tour-context";
|
|
5
|
+
export { findTourTarget } from "./find-target";
|
|
6
|
+
export { useTour, useTourPlaceholderData } from "./use-tour";
|
|
7
|
+
export { TourButton } from "./tour-button";
|
|
8
|
+
export type { TourButtonProps } from "./tour-button";
|
|
9
|
+
export { TourOverlay } from "./tour-overlay";
|
|
10
|
+
export { TourCard } from "./tour-card";
|
|
11
|
+
export type { TourCardProps } from "./tour-card";
|
|
12
|
+
export { englishTourLabels } from "./labels";
|
|
13
|
+
export type { TourLabels } from "./labels";
|
|
14
|
+
export { hasSeenTour, markTourSeen, resetSeenTours } from "./seen-store";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { TourProvider } from "./tour-provider.js";
|
|
2
|
+
export { findTourTarget } from "./find-target.js";
|
|
3
|
+
export { useTour, useTourPlaceholderData } from "./use-tour.js";
|
|
4
|
+
export { TourButton } from "./tour-button.js";
|
|
5
|
+
export { TourOverlay } from "./tour-overlay.js";
|
|
6
|
+
export { TourCard } from "./tour-card.js";
|
|
7
|
+
export { englishTourLabels } from "./labels.js";
|
|
8
|
+
export { hasSeenTour, markTourSeen, resetSeenTours } from "./seen-store.js";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const STORAGE_KEY = "hub-kit.tour.seen";
|
|
2
|
+
function readSeenIds() {
|
|
3
|
+
try {
|
|
4
|
+
const raw = localStorage.getItem(STORAGE_KEY);
|
|
5
|
+
const parsed = raw ? JSON.parse(raw) : null;
|
|
6
|
+
return Array.isArray(parsed) ? parsed.filter((id) => typeof id === "string") : [];
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export function hasSeenTour(tourId) {
|
|
13
|
+
return readSeenIds().includes(tourId);
|
|
14
|
+
}
|
|
15
|
+
export function markTourSeen(tourId) {
|
|
16
|
+
const ids = readSeenIds();
|
|
17
|
+
if (ids.includes(tourId)) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify([...ids, tourId]));
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export function resetSeenTours() {
|
|
28
|
+
try {
|
|
29
|
+
localStorage.removeItem(STORAGE_KEY);
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Info, TriangleAlert } from "lucide-react";
|
|
3
|
+
export function TourBlock({ block }) {
|
|
4
|
+
switch (block.kind) {
|
|
5
|
+
case "paragraph":
|
|
6
|
+
return _jsx("p", { className: "text-[13px] leading-relaxed text-muted-foreground sm:text-[15px]", children: block.text });
|
|
7
|
+
case "list":
|
|
8
|
+
return (_jsx("ul", { className: "list-disc space-y-1 pl-5 text-[13px] text-muted-foreground sm:text-sm", children: block.items.map((item) => (_jsx("li", { children: item }, item))) }));
|
|
9
|
+
case "image":
|
|
10
|
+
return (_jsx("img", { src: block.src, alt: block.alt, className: "max-h-40 w-full rounded-md border object-cover" }));
|
|
11
|
+
case "video":
|
|
12
|
+
return (_jsxs("figure", { className: "space-y-1", children: [_jsx("video", { src: block.src, controls: true, className: "w-full rounded-md border" }), block.caption && (_jsx("figcaption", { className: "text-xs text-muted-foreground", children: block.caption }))] }));
|
|
13
|
+
case "link":
|
|
14
|
+
return (_jsx("a", { href: block.href, target: block.newTab ? "_blank" : undefined, rel: block.newTab ? "noreferrer" : undefined, className: "text-[13px] font-medium text-primary underline-offset-4 hover:underline sm:text-sm", children: block.label }));
|
|
15
|
+
case "keyValueList":
|
|
16
|
+
return (_jsx("dl", { className: "space-y-1 text-[13px] sm:text-sm", children: block.pairs.map((pair) => (_jsxs("div", { className: "flex justify-between gap-3", children: [_jsx("dt", { className: "text-muted-foreground", children: pair.label }), _jsx("dd", { className: "font-medium", children: pair.value })] }, pair.label))) }));
|
|
17
|
+
case "callout":
|
|
18
|
+
return _jsx(TourCallout, { tone: block.tone, text: block.text });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function TourCallout({ tone, text }) {
|
|
22
|
+
const isWarning = tone === "warning";
|
|
23
|
+
const Icon = isWarning ? TriangleAlert : Info;
|
|
24
|
+
return (_jsxs("div", { className: isWarning
|
|
25
|
+
? "flex gap-2 rounded-md bg-[var(--warning-soft)] p-2 text-[13px] text-[var(--warning)] sm:text-sm"
|
|
26
|
+
: "flex gap-2 rounded-md bg-accent p-2 text-[13px] text-accent-foreground sm:text-sm", children: [_jsx(Icon, { className: "mt-0.5 size-4 shrink-0", "aria-hidden": "true" }), _jsx("span", { children: text })] }));
|
|
27
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { HelpCircle } from "lucide-react";
|
|
3
|
+
import { Button } from "../../ui/button.js";
|
|
4
|
+
import { cn } from "../../lib/class-names.js";
|
|
5
|
+
import { useTour } from "./use-tour.js";
|
|
6
|
+
export function TourButton({ className }) {
|
|
7
|
+
const tour = useTour();
|
|
8
|
+
if (!tour || !tour.tour || tour.stepCount === 0) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return (_jsxs(Button, { type: "button", variant: "ghost", size: "sm", className: cn("gap-1.5", className), onClick: tour.start, children: [_jsx(HelpCircle, { "aria-hidden": "true" }), tour.labels.openTour] }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TourLabels } from "./labels";
|
|
2
|
+
import type { TourStep } from "./types";
|
|
3
|
+
export interface TourCardProps {
|
|
4
|
+
step: TourStep;
|
|
5
|
+
stepIndex: number;
|
|
6
|
+
stepCount: number;
|
|
7
|
+
labels: TourLabels;
|
|
8
|
+
onNext: () => void;
|
|
9
|
+
onSkip: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function TourCard({ step, stepIndex, stepCount, labels, onNext, onSkip }: TourCardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "../../ui/button.js";
|
|
3
|
+
import { TourBlock } from "./tour-blocks.js";
|
|
4
|
+
export function TourCard({ step, stepIndex, stepCount, labels, onNext, onSkip }) {
|
|
5
|
+
const isLastStep = stepIndex + 1 >= stepCount;
|
|
6
|
+
return (_jsxs("div", { children: [_jsx("span", { className: "inline-flex rounded-full bg-[var(--tour-accent,var(--primary))] px-2 py-0.5 text-[11px] font-semibold text-primary-foreground sm:text-xs", children: labels.stepCounter(stepIndex + 1, stepCount) }), _jsx("h2", { className: "mt-2 text-[15px] font-semibold leading-snug text-popover-foreground sm:text-[17px]", children: step.title }), _jsx("div", { className: "mt-2 max-h-[min(70vh,calc(var(--radix-popover-content-available-height,70vh)-6rem))] space-y-2 overflow-y-auto pr-3 pb-1", children: step.content.map((block, index) => (_jsx(TourBlock, { block: block }, index))) }), _jsxs("div", { className: "mt-2 flex items-center justify-between gap-2", children: [_jsx("button", { type: "button", onClick: onSkip, className: "cursor-pointer text-[12px] text-muted-foreground transition-colors hover:text-foreground sm:text-sm", children: labels.skip }), _jsx(Button, { type: "button", onClick: onNext, className: "h-7 rounded-lg bg-[var(--tour-accent,var(--primary))] px-3.5 text-[12px] sm:h-8 sm:px-5 sm:text-sm", children: isLastStep ? labels.finish : labels.next })] })] }));
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TourLabels } from "./labels";
|
|
2
|
+
import type { TourDefinition, TourStep } from "./types";
|
|
3
|
+
export interface TourState {
|
|
4
|
+
tour: TourDefinition | null;
|
|
5
|
+
step: TourStep | null;
|
|
6
|
+
stepIndex: number;
|
|
7
|
+
stepCount: number;
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
showsPlaceholderData: boolean;
|
|
10
|
+
labels: TourLabels;
|
|
11
|
+
start: () => void;
|
|
12
|
+
next: () => void;
|
|
13
|
+
back: () => void;
|
|
14
|
+
skip: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const TourContext: import("react").Context<TourState | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function TourOverlay(): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { Popover, PopoverAnchor, PopoverArrow, PopoverContent } from "../../ui/popover.js";
|
|
4
|
+
import { findTourTarget } from "./find-target.js";
|
|
5
|
+
import { TourCard } from "./tour-card.js";
|
|
6
|
+
import { useTour } from "./use-tour.js";
|
|
7
|
+
const SPOTLIGHT_PADDING = 6;
|
|
8
|
+
const MOVE_DURATION = "220ms";
|
|
9
|
+
const TALL_TARGET_GAP = 0.45;
|
|
10
|
+
const MAX_CARD_WIDTH = 352;
|
|
11
|
+
const SCREEN_MARGIN = 32;
|
|
12
|
+
const ESTIMATED_CARD_HEIGHT = 240;
|
|
13
|
+
const CARD_GAP = 12;
|
|
14
|
+
export function TourOverlay() {
|
|
15
|
+
const tour = useTour();
|
|
16
|
+
const step = tour?.step ?? null;
|
|
17
|
+
const target = step?.target ?? null;
|
|
18
|
+
const [rect, setRect] = useState(null);
|
|
19
|
+
const [viewport, setViewport] = useState({ width: 0, height: 0 });
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
const readViewport = () => setViewport({ width: window.innerWidth, height: window.innerHeight });
|
|
22
|
+
readViewport();
|
|
23
|
+
window.addEventListener("resize", readViewport);
|
|
24
|
+
return () => window.removeEventListener("resize", readViewport);
|
|
25
|
+
}, []);
|
|
26
|
+
const cardRef = useRef(null);
|
|
27
|
+
const skipMissingStep = useRef(() => { });
|
|
28
|
+
skipMissingStep.current = tour ? tour.next : () => { };
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (!target) {
|
|
31
|
+
setRect(null);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
let stopMeasuring;
|
|
35
|
+
const watch = (element) => {
|
|
36
|
+
if (element.getBoundingClientRect().height > window.innerHeight * 0.6) {
|
|
37
|
+
revealTallTarget(element);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
element.scrollIntoView({ block: "center", behavior: "smooth" });
|
|
41
|
+
}
|
|
42
|
+
let frame = 0;
|
|
43
|
+
const measure = () => {
|
|
44
|
+
const box = element.getBoundingClientRect();
|
|
45
|
+
setRect((current) => current &&
|
|
46
|
+
current.top === box.top &&
|
|
47
|
+
current.left === box.left &&
|
|
48
|
+
current.width === box.width &&
|
|
49
|
+
current.height === box.height
|
|
50
|
+
? current
|
|
51
|
+
: { top: box.top, left: box.left, width: box.width, height: box.height });
|
|
52
|
+
frame = requestAnimationFrame(measure);
|
|
53
|
+
};
|
|
54
|
+
measure();
|
|
55
|
+
stopMeasuring = () => cancelAnimationFrame(frame);
|
|
56
|
+
};
|
|
57
|
+
const element = findTourTarget(target);
|
|
58
|
+
if (element) {
|
|
59
|
+
watch(element);
|
|
60
|
+
return () => stopMeasuring?.();
|
|
61
|
+
}
|
|
62
|
+
setRect(null);
|
|
63
|
+
const frame = requestAnimationFrame(() => {
|
|
64
|
+
const lateElement = findTourTarget(target);
|
|
65
|
+
if (lateElement) {
|
|
66
|
+
watch(lateElement);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
skipMissingStep.current();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return () => {
|
|
73
|
+
cancelAnimationFrame(frame);
|
|
74
|
+
stopMeasuring?.();
|
|
75
|
+
};
|
|
76
|
+
}, [target]);
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
const wrapper = cardRef.current?.closest("[data-radix-popper-content-wrapper]");
|
|
79
|
+
if (wrapper) {
|
|
80
|
+
wrapper.style.transition = `transform ${MOVE_DURATION} ease`;
|
|
81
|
+
}
|
|
82
|
+
}, [target]);
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
if (!tour?.isOpen) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const onKeyDown = (event) => {
|
|
88
|
+
if (event.key === "Escape") {
|
|
89
|
+
tour.skip();
|
|
90
|
+
}
|
|
91
|
+
else if (event.key === "ArrowRight") {
|
|
92
|
+
tour.next();
|
|
93
|
+
}
|
|
94
|
+
else if (event.key === "ArrowLeft") {
|
|
95
|
+
tour.back();
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
document.addEventListener("keydown", onKeyDown);
|
|
99
|
+
return () => document.removeEventListener("keydown", onKeyDown);
|
|
100
|
+
}, [tour]);
|
|
101
|
+
if (!tour || !tour.isOpen || !step || !rect) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
return (_jsxs("div", { className: "fixed inset-0 z-50", role: "presentation", children: [_jsx("div", { className: "absolute inset-0", style: { background: "var(--tour-backdrop, rgb(0 0 0 / 0.5))" } }), _jsx("div", { className: "absolute", style: {
|
|
105
|
+
top: rect.top - SPOTLIGHT_PADDING,
|
|
106
|
+
left: rect.left - SPOTLIGHT_PADDING,
|
|
107
|
+
width: rect.width + SPOTLIGHT_PADDING * 2,
|
|
108
|
+
height: rect.height + SPOTLIGHT_PADDING * 2,
|
|
109
|
+
borderRadius: "var(--tour-spotlight-radius, calc(var(--radius) + 4px))",
|
|
110
|
+
transition: `top ${MOVE_DURATION} ease, left ${MOVE_DURATION} ease, width ${MOVE_DURATION} ease, height ${MOVE_DURATION} ease`,
|
|
111
|
+
boxShadow: [
|
|
112
|
+
"0 0 0 3px var(--tour-ring-gap, var(--background))",
|
|
113
|
+
"0 0 0 5px var(--tour-accent, var(--primary))",
|
|
114
|
+
].join(", "),
|
|
115
|
+
} }), _jsxs(Popover, { open: true, children: [_jsx(PopoverAnchor, { asChild: true, children: _jsx("div", { className: "absolute", style: { top: rect.top, left: rect.left, width: rect.width, height: rect.height } }) }), _jsxs(PopoverContent, { ref: cardRef, side: sideForScreen(step.placement, rect, viewport), align: "center", sideOffset: 12, arrowPadding: 16, collisionPadding: 16, className: "w-[min(var(--tour-card-width,22rem),calc(100vw-2rem))] rounded-2xl border-0 px-4 pt-4 pb-2.5 shadow-xl sm:px-5 sm:pt-5 sm:pb-3.5", onOpenAutoFocus: (event) => event.preventDefault(), onEscapeKeyDown: (event) => event.preventDefault(), onPointerDownOutside: (event) => event.preventDefault(), onInteractOutside: (event) => event.preventDefault(), "aria-label": tour.labels.cardTitle, children: [_jsx(TourCard, { step: step, stepIndex: tour.stepIndex, stepCount: tour.stepCount, labels: tour.labels, onNext: tour.next, onSkip: tour.skip }), _jsx(PopoverArrow, { width: 18, height: 9, style: { fill: "var(--popover)" } })] })] })] }));
|
|
116
|
+
}
|
|
117
|
+
function sideForScreen(placement, rect, viewport) {
|
|
118
|
+
if (viewport.width === 0) {
|
|
119
|
+
return placement ?? "bottom";
|
|
120
|
+
}
|
|
121
|
+
const cardWidth = Math.min(MAX_CARD_WIDTH, viewport.width - SCREEN_MARGIN);
|
|
122
|
+
const space = {
|
|
123
|
+
top: rect.top,
|
|
124
|
+
bottom: viewport.height - (rect.top + rect.height),
|
|
125
|
+
left: rect.left,
|
|
126
|
+
right: viewport.width - (rect.left + rect.width),
|
|
127
|
+
};
|
|
128
|
+
const fits = {
|
|
129
|
+
top: space.top >= ESTIMATED_CARD_HEIGHT + CARD_GAP,
|
|
130
|
+
bottom: space.bottom >= ESTIMATED_CARD_HEIGHT + CARD_GAP,
|
|
131
|
+
left: space.left >= cardWidth + CARD_GAP,
|
|
132
|
+
right: space.right >= cardWidth + CARD_GAP,
|
|
133
|
+
};
|
|
134
|
+
if (placement && fits[placement]) {
|
|
135
|
+
return placement;
|
|
136
|
+
}
|
|
137
|
+
if (fits.bottom)
|
|
138
|
+
return "bottom";
|
|
139
|
+
if (fits.top)
|
|
140
|
+
return "top";
|
|
141
|
+
if (fits.right)
|
|
142
|
+
return "right";
|
|
143
|
+
if (fits.left)
|
|
144
|
+
return "left";
|
|
145
|
+
return space.bottom >= space.top ? "bottom" : "top";
|
|
146
|
+
}
|
|
147
|
+
function scrollingAncestor(element) {
|
|
148
|
+
let node = element.parentElement;
|
|
149
|
+
while (node) {
|
|
150
|
+
const overflowY = getComputedStyle(node).overflowY;
|
|
151
|
+
if ((overflowY === "auto" || overflowY === "scroll") && node.scrollHeight > node.clientHeight) {
|
|
152
|
+
return node;
|
|
153
|
+
}
|
|
154
|
+
node = node.parentElement;
|
|
155
|
+
}
|
|
156
|
+
return document.scrollingElement ?? document.documentElement;
|
|
157
|
+
}
|
|
158
|
+
function revealTallTarget(element) {
|
|
159
|
+
const container = scrollingAncestor(element);
|
|
160
|
+
const isPageScroll = container === document.scrollingElement || container === document.documentElement;
|
|
161
|
+
const containerTop = isPageScroll ? 0 : container.getBoundingClientRect().top;
|
|
162
|
+
const gapAbove = window.innerHeight * TALL_TARGET_GAP;
|
|
163
|
+
const delta = element.getBoundingClientRect().top - containerTop - gapAbove;
|
|
164
|
+
container.scrollBy({ top: delta, behavior: "smooth" });
|
|
165
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type TourLabels } from "./labels";
|
|
3
|
+
import type { TourMap } from "./types";
|
|
4
|
+
export interface TourProviderProps {
|
|
5
|
+
tours: TourMap;
|
|
6
|
+
labels?: TourLabels;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function TourProvider({ tours, labels, children }: TourProviderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
|
+
import { useRouterState } from "@tanstack/react-router";
|
|
4
|
+
import { englishTourLabels } from "./labels.js";
|
|
5
|
+
import { findTourTarget } from "./find-target.js";
|
|
6
|
+
import { hasSeenTour, markTourSeen } from "./seen-store.js";
|
|
7
|
+
import { TourContext } from "./tour-context.js";
|
|
8
|
+
import { TourOverlay } from "./tour-overlay.js";
|
|
9
|
+
export function TourProvider({ tours, labels = englishTourLabels, children }) {
|
|
10
|
+
const pathname = useRouterState({ select: (state) => state.location.pathname });
|
|
11
|
+
const tour = tours[pathname] ?? null;
|
|
12
|
+
const [openTourId, setOpenTourId] = useState(null);
|
|
13
|
+
const [stepIndex, setStepIndex] = useState(0);
|
|
14
|
+
const isOpen = tour !== null && openTourId === tour.id;
|
|
15
|
+
const close = useCallback(() => {
|
|
16
|
+
setOpenTourId(null);
|
|
17
|
+
setStepIndex(0);
|
|
18
|
+
}, []);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
close();
|
|
21
|
+
}, [pathname, close]);
|
|
22
|
+
const tourId = tour?.id ?? null;
|
|
23
|
+
const autoStartAllowed = tour?.autoStart !== false;
|
|
24
|
+
const firstTarget = tour?.steps[0]?.target ?? null;
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (!tourId || !firstTarget || !autoStartAllowed || hasSeenTour(tourId)) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const frame = requestAnimationFrame(() => {
|
|
30
|
+
if (findTourTarget(firstTarget)) {
|
|
31
|
+
setStepIndex(0);
|
|
32
|
+
setOpenTourId(tourId);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return () => cancelAnimationFrame(frame);
|
|
36
|
+
}, [tourId, firstTarget, autoStartAllowed]);
|
|
37
|
+
const start = useCallback(() => {
|
|
38
|
+
if (!tour || tour.steps.length === 0) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
setStepIndex(0);
|
|
42
|
+
setOpenTourId(tour.id);
|
|
43
|
+
}, [tour]);
|
|
44
|
+
const finish = useCallback(() => {
|
|
45
|
+
if (tour) {
|
|
46
|
+
markTourSeen(tour.id);
|
|
47
|
+
}
|
|
48
|
+
close();
|
|
49
|
+
}, [tour, close]);
|
|
50
|
+
const next = useCallback(() => {
|
|
51
|
+
if (!tour) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (stepIndex + 1 >= tour.steps.length) {
|
|
55
|
+
finish();
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
setStepIndex(stepIndex + 1);
|
|
59
|
+
}, [tour, stepIndex, finish]);
|
|
60
|
+
const back = useCallback(() => {
|
|
61
|
+
setStepIndex((index) => (index > 0 ? index - 1 : index));
|
|
62
|
+
}, []);
|
|
63
|
+
const value = useMemo(() => {
|
|
64
|
+
const step = isOpen && tour ? (tour.steps[stepIndex] ?? null) : null;
|
|
65
|
+
return {
|
|
66
|
+
tour,
|
|
67
|
+
step,
|
|
68
|
+
stepIndex,
|
|
69
|
+
stepCount: tour ? tour.steps.length : 0,
|
|
70
|
+
isOpen,
|
|
71
|
+
showsPlaceholderData: step?.showPlaceholderData === true,
|
|
72
|
+
labels,
|
|
73
|
+
start,
|
|
74
|
+
next,
|
|
75
|
+
back,
|
|
76
|
+
skip: finish,
|
|
77
|
+
};
|
|
78
|
+
}, [tour, stepIndex, isOpen, labels, start, next, back, finish]);
|
|
79
|
+
return (_jsxs(TourContext.Provider, { value: value, children: [children, _jsx(TourOverlay, {})] }));
|
|
80
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type TourContentBlock = {
|
|
2
|
+
kind: "paragraph";
|
|
3
|
+
text: string;
|
|
4
|
+
} | {
|
|
5
|
+
kind: "list";
|
|
6
|
+
items: string[];
|
|
7
|
+
} | {
|
|
8
|
+
kind: "image";
|
|
9
|
+
src: string;
|
|
10
|
+
alt: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: "video";
|
|
13
|
+
src: string;
|
|
14
|
+
caption?: string;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "link";
|
|
17
|
+
href: string;
|
|
18
|
+
label: string;
|
|
19
|
+
newTab?: boolean;
|
|
20
|
+
} | {
|
|
21
|
+
kind: "keyValueList";
|
|
22
|
+
pairs: {
|
|
23
|
+
label: string;
|
|
24
|
+
value: string;
|
|
25
|
+
}[];
|
|
26
|
+
} | {
|
|
27
|
+
kind: "callout";
|
|
28
|
+
tone: "info" | "warning";
|
|
29
|
+
text: string;
|
|
30
|
+
};
|
|
31
|
+
export type TourPlacement = "top" | "bottom" | "left" | "right";
|
|
32
|
+
export interface TourStep {
|
|
33
|
+
target: string;
|
|
34
|
+
title: string;
|
|
35
|
+
content: TourContentBlock[];
|
|
36
|
+
placement?: TourPlacement;
|
|
37
|
+
showPlaceholderData?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface TourDefinition {
|
|
40
|
+
id: string;
|
|
41
|
+
steps: TourStep[];
|
|
42
|
+
autoStart?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export type TourMap = Record<string, TourDefinition>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|