indas-ui 0.0.1 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/auth/ProtectedRoute.js +48 -0
- package/dist/cjs/components/auth/UnauthorizedPage.js +19 -0
- package/dist/cjs/components/auth/index.js +9 -0
- package/dist/cjs/components/chat/ai-messages.js +271 -0
- package/dist/cjs/components/chat/chat-prompt-navigator.js +110 -0
- package/dist/cjs/components/chat/chat.js +1032 -0
- package/dist/cjs/components/chat/index.js +19 -0
- package/dist/cjs/components/chat/multimodal-input.js +119 -0
- package/dist/cjs/components/dashboard/DrillDownModal.js +36 -0
- package/dist/cjs/components/dashboard/FilterBar.js +434 -0
- package/dist/cjs/components/dashboard/Tooltip.js +86 -0
- package/dist/cjs/components/dashboard/charts/Area.js +127 -0
- package/dist/cjs/components/dashboard/charts/Bar.js +111 -0
- package/dist/cjs/components/dashboard/charts/BoxPlot.js +118 -0
- package/dist/cjs/components/dashboard/charts/Bubble.js +102 -0
- package/dist/cjs/components/dashboard/charts/DashboardCard.js +12 -0
- package/dist/cjs/components/dashboard/charts/Donut.js +130 -0
- package/dist/cjs/components/dashboard/charts/FlowMap.js +238 -0
- package/dist/cjs/components/dashboard/charts/Funnel.js +38 -0
- package/dist/cjs/components/dashboard/charts/Gantt.js +271 -0
- package/dist/cjs/components/dashboard/charts/Gauge.js +143 -0
- package/dist/cjs/components/dashboard/charts/GeoMap.js +164 -0
- package/dist/cjs/components/dashboard/charts/Heatmap.js +116 -0
- package/dist/cjs/components/dashboard/charts/Line.js +75 -0
- package/dist/cjs/components/dashboard/charts/Pareto.js +110 -0
- package/dist/cjs/components/dashboard/charts/Radar.js +94 -0
- package/dist/cjs/components/dashboard/charts/Sankey.js +92 -0
- package/dist/cjs/components/dashboard/charts/Scatter.js +128 -0
- package/dist/cjs/components/dashboard/charts/Sparkline.js +134 -0
- package/dist/cjs/components/dashboard/charts/Treemap.js +104 -0
- package/dist/cjs/components/dashboard/charts/index.js +45 -0
- package/dist/cjs/components/dashboard/charts/india-map.js +464 -0
- package/dist/cjs/components/dashboard/charts/theme.js +132 -0
- package/dist/cjs/components/dashboard/config.js +118 -0
- package/dist/cjs/components/dashboard/index.js +39 -0
- package/dist/cjs/components/dashboard/kpi/KpiBeforeAfter.js +16 -0
- package/dist/cjs/components/dashboard/kpi/KpiBreakdown.js +42 -0
- package/dist/cjs/components/dashboard/kpi/KpiComparison.js +41 -0
- package/dist/cjs/components/dashboard/kpi/KpiQuickStats.js +41 -0
- package/dist/cjs/components/dashboard/kpi/KpiRating.js +38 -0
- package/dist/cjs/components/dashboard/kpi/KpiScroll.js +83 -0
- package/dist/cjs/components/dashboard/kpi/KpiTrend.js +37 -0
- package/dist/cjs/components/dashboard/kpi/index.js +22 -0
- package/dist/cjs/components/dashboard/kpi/kpi-shell.js +113 -0
- package/dist/cjs/components/dashboard/time-range.js +126 -0
- package/dist/cjs/components/datagrid/DataGrid.js +1613 -0
- package/dist/cjs/components/datagrid/cells/BooleanCell.js +42 -0
- package/dist/cjs/components/datagrid/cells/CellRenderer.js +142 -0
- package/dist/cjs/components/datagrid/cells/EditableCell.js +217 -0
- package/dist/cjs/components/datagrid/cells/SelectionCell.js +60 -0
- package/dist/cjs/components/datagrid/cells/index.js +6 -0
- package/dist/cjs/components/datagrid/columns/ActionsColumn.js +485 -0
- package/dist/cjs/components/datagrid/columns/ColumnContextMenu.js +341 -0
- package/dist/cjs/components/datagrid/columns/DraggableColumnHeader.js +150 -0
- package/dist/cjs/components/datagrid/controls/AutoResizeButton.js +10 -0
- package/dist/cjs/components/datagrid/controls/PaginationControls.js +38 -0
- package/dist/cjs/components/datagrid/controls/SummaryControls.js +30 -0
- package/dist/cjs/components/datagrid/controls/menu/ActionsMenu.js +16 -0
- package/dist/cjs/components/datagrid/controls/menu/column/ColumnChooserModal.js +25 -0
- package/dist/cjs/components/datagrid/controls/menu/column/ColumnSection.js +10 -0
- package/dist/cjs/components/datagrid/controls/menu/export/ExportSection.js +19 -0
- package/dist/cjs/components/datagrid/controls/menu/export/export.js +227 -0
- package/dist/cjs/components/datagrid/controls/menu/filter/AdvancedFilterModal.js +405 -0
- package/dist/cjs/components/datagrid/controls/menu/filter/FilterSection.js +9 -0
- package/dist/cjs/components/datagrid/controls/menu/grouping/GroupingSection.js +23 -0
- package/dist/cjs/components/datagrid/controls/menu/grouping/index.js +6 -0
- package/dist/cjs/components/datagrid/controls/menu/import/ImportSection.js +75 -0
- package/dist/cjs/components/datagrid/controls/menu/import/import.js +232 -0
- package/dist/cjs/components/datagrid/controls/menu/index.js +24 -0
- package/dist/cjs/components/datagrid/controls/menu/view/CardView.js +176 -0
- package/dist/cjs/components/datagrid/controls/menu/view/ChartView.js +401 -0
- package/dist/cjs/components/datagrid/controls/menu/view/ViewSection.js +12 -0
- package/dist/cjs/components/datagrid/hooks/useCellRangeSelection.js +127 -0
- package/dist/cjs/components/datagrid/hooks/useClipboard.js +154 -0
- package/dist/cjs/components/datagrid/hooks/useDataGridState.js +115 -0
- package/dist/cjs/components/datagrid/hooks/useKeyboardNavigation.js +120 -0
- package/dist/cjs/components/datagrid/index.js +90 -0
- package/dist/cjs/components/datagrid/rows/DraggableRow.js +34 -0
- package/dist/cjs/components/datagrid/rows/ExpandableRow.js +184 -0
- package/dist/cjs/components/datagrid/rows/FilterRow.js +188 -0
- package/dist/cjs/components/datagrid/rows/SelectColumn.js +34 -0
- package/dist/cjs/components/datagrid/rows/SummaryRow.js +34 -0
- package/dist/cjs/components/datagrid/rows/summary.js +67 -0
- package/dist/cjs/components/datagrid/search/InlineSearchCell.js +99 -0
- package/dist/cjs/components/datagrid/search/SearchHighlighter.js +133 -0
- package/dist/cjs/components/datagrid/search/SearchNavigator.js +185 -0
- package/dist/cjs/components/datagrid/search/SearchNewModal.js +238 -0
- package/dist/cjs/components/datagrid/search/advancedSearch.js +112 -0
- package/dist/cjs/components/datagrid/utils/grid-helpers.js +102 -0
- package/dist/cjs/components/datagrid/utils/grid-types.js +3 -0
- package/dist/cjs/components/draft/AutoSaveIndicator.js +70 -0
- package/dist/cjs/components/draft/DraftModal.js +220 -0
- package/dist/cjs/components/forms/date-picker/CalendarView.js +82 -0
- package/dist/cjs/components/forms/date-picker/DatePicker.js +748 -0
- package/dist/cjs/components/forms/date-picker/DateTimePicker.js +174 -0
- package/dist/cjs/components/forms/date-picker/index.js +21 -0
- package/dist/cjs/components/forms/date-picker/shared-utils.js +24 -0
- package/dist/cjs/components/forms/dropdown/Dropdown.js +427 -0
- package/dist/cjs/components/forms/dropdown/MultiSelect.js +136 -0
- package/dist/cjs/components/forms/dropdown/SingleSelect.js +254 -0
- package/dist/cjs/components/forms/dropdown/hooks/useDropdownCreate.js +88 -0
- package/dist/cjs/components/forms/dropdown/hooks/useDropdownFiltering.js +87 -0
- package/dist/cjs/components/forms/dropdown/hooks/useDropdownState.js +63 -0
- package/dist/cjs/components/forms/dropdown/index.js +6 -0
- package/dist/cjs/components/forms/dropdown/types.js +3 -0
- package/dist/cjs/components/forms/file-attachment/EmailPreview.js +419 -0
- package/dist/cjs/components/forms/file-attachment/FileAttachment.js +966 -0
- package/dist/cjs/components/forms/file-attachment/index.js +6 -0
- package/dist/cjs/components/forms/index.js +16 -0
- package/dist/cjs/components/forms/quantity-input-popup.js +135 -0
- package/dist/cjs/components/forms/remark-input/RemarkInput.js +263 -0
- package/dist/cjs/components/forms/remark-input/index.js +8 -0
- package/dist/cjs/components/forms/unified-currency-dropdown.js +202 -0
- package/dist/cjs/components/index.js +41 -0
- package/dist/cjs/components/layout/SidebarContextMenu.js +179 -0
- package/dist/cjs/components/layout/app-shell.js +81 -0
- package/dist/cjs/components/layout/bottom-nav.js +262 -0
- package/dist/cjs/components/layout/floating-action-button.js +77 -0
- package/dist/cjs/components/layout/footer.js +60 -0
- package/dist/cjs/components/layout/index.js +18 -0
- package/dist/cjs/components/layout/mobile-menu-sheet.js +195 -0
- package/dist/cjs/components/layout/side-panel.js +118 -0
- package/dist/cjs/components/layout/sidebar.js +581 -0
- package/dist/cjs/components/layout/top-header.js +270 -0
- package/dist/cjs/components/layout/userprofile-dropdown.js +100 -0
- package/dist/cjs/components/master/editable-cells/EditableCell.js +106 -0
- package/dist/cjs/components/master/editable-cells/index.js +17 -0
- package/dist/cjs/components/master/index.js +9 -0
- package/dist/cjs/components/messaging/conversation-list.js +109 -0
- package/dist/cjs/components/messaging/create-conversation-modal.js +112 -0
- package/dist/cjs/components/messaging/message-bubble.js +69 -0
- package/dist/cjs/components/messaging/message-input.js +154 -0
- package/dist/cjs/components/messaging/message-thread.js +124 -0
- package/dist/cjs/components/messaging/messaging-panel-content.js +69 -0
- package/dist/cjs/components/messaging/thread-panel.js +50 -0
- package/dist/cjs/components/modals/3DModal.js +35 -0
- package/dist/cjs/components/modals/ImageModal.js +587 -0
- package/dist/cjs/components/modals/Modal.js +311 -0
- package/dist/cjs/components/modals/StandardModal.js +28 -0
- package/dist/cjs/components/modals/api-config-modal.js +120 -0
- package/dist/cjs/components/modals/global-api-config-modal.js +127 -0
- package/dist/cjs/components/modals/index.js +17 -0
- package/dist/cjs/components/modals/logout-modal.js +45 -0
- package/dist/cjs/components/modals/modal-alert.js +295 -0
- package/dist/cjs/components/modals/password-reset-modal.js +112 -0
- package/dist/cjs/components/modals/session-expiry-warning.js +18 -0
- package/dist/cjs/components/providers/api-provider.js +19 -0
- package/dist/cjs/components/providers/query-provider.js +29 -0
- package/dist/cjs/components/providers/session-provider.js +119 -0
- package/dist/cjs/components/theme/ThemeCustomizer.js +184 -0
- package/dist/cjs/components/ui/buttons/button.js +264 -0
- package/dist/cjs/components/ui/card.js +58 -0
- package/dist/cjs/components/ui/chart.js +160 -0
- package/dist/cjs/components/ui/display/boolean-badge.js +29 -0
- package/dist/cjs/components/ui/display/card.js +20 -0
- package/dist/cjs/components/ui/display/collapsible.js +44 -0
- package/dist/cjs/components/ui/display/separator.js +44 -0
- package/dist/cjs/components/ui/display/stats-card.js +29 -0
- package/dist/cjs/components/ui/display/text.js +94 -0
- package/dist/cjs/components/ui/feedback/alert.js +61 -0
- package/dist/cjs/components/ui/feedback/badge.js +93 -0
- package/dist/cjs/components/ui/feedback/progress.js +44 -0
- package/dist/cjs/components/ui/feedback/reminder-button.js +111 -0
- package/dist/cjs/components/ui/feedback/skeleton-table.js +20 -0
- package/dist/cjs/components/ui/feedback/skeleton.js +53 -0
- package/dist/cjs/components/ui/feedback/tooltip.js +54 -0
- package/dist/cjs/components/ui/form-toggle.js +47 -0
- package/dist/cjs/components/ui/forms/checkbox.js +24 -0
- package/dist/cjs/components/ui/forms/input.js +111 -0
- package/dist/cjs/components/ui/forms/label.js +10 -0
- package/dist/cjs/components/ui/forms/switch.js +58 -0
- package/dist/cjs/components/ui/forms/textarea.js +49 -0
- package/dist/cjs/components/ui/index.js +157 -0
- package/dist/cjs/components/ui/navigation/dropdown-menu.js +84 -0
- package/dist/cjs/components/ui/navigation/header-steps.js +51 -0
- package/dist/cjs/components/ui/navigation/tabs.js +97 -0
- package/dist/cjs/components/ui/overlays/loading.js +169 -0
- package/dist/cjs/components/ui/select.js +72 -0
- package/dist/cjs/config/api.js +65 -0
- package/dist/cjs/contexts/AppConfigContext.js +37 -0
- package/dist/cjs/contexts/CurrencyContext.js +336 -0
- package/dist/cjs/contexts/DeviceContext.js +106 -0
- package/dist/cjs/contexts/EmailContext.js +727 -0
- package/dist/cjs/contexts/GlobalAlertContext.js +232 -0
- package/dist/cjs/contexts/ImpactAnalysisContext.js +60 -0
- package/dist/cjs/contexts/LanguageContext.js +104 -0
- package/dist/cjs/contexts/MessagingContext.js +726 -0
- package/dist/cjs/contexts/ModuleAuthContext.js +316 -0
- package/dist/cjs/contexts/NavigationContext.js +182 -0
- package/dist/cjs/contexts/NetworkStatusContext.js +95 -0
- package/dist/cjs/contexts/NotificationContext.js +169 -0
- package/dist/cjs/contexts/PageTitleContext.js +28 -0
- package/dist/cjs/contexts/SearchPreferencesContext.js +42 -0
- package/dist/cjs/contexts/SessionAdapterContext.js +24 -0
- package/dist/cjs/contexts/SidebarPreferencesContext.js +116 -0
- package/dist/cjs/contexts/ThemeContext.js +193 -0
- package/dist/cjs/hooks/index.js +50 -0
- package/dist/cjs/hooks/useApproval.js +250 -0
- package/dist/cjs/hooks/useBacchaSearch.js +257 -0
- package/dist/cjs/hooks/useBusinessAudit.js +54 -0
- package/dist/cjs/hooks/useColumnFreezing.js +204 -0
- package/dist/cjs/hooks/useColumnMetadata.js +48 -0
- package/dist/cjs/hooks/useConditionalFormatting.js +197 -0
- package/dist/cjs/hooks/useDebounce.js +49 -0
- package/dist/cjs/hooks/useDraft.js +181 -0
- package/dist/cjs/hooks/useFormValidation.js +68 -0
- package/dist/cjs/hooks/useGridSettings.js +85 -0
- package/dist/cjs/hooks/useGridTheme.js +204 -0
- package/dist/cjs/hooks/useId.js +21 -0
- package/dist/cjs/hooks/useIntelligentColumnSizing.js +315 -0
- package/dist/cjs/hooks/useKeyboardNavigation.js +192 -0
- package/dist/cjs/hooks/useNotifications.js +63 -0
- package/dist/cjs/hooks/usePrevious.js +20 -0
- package/dist/cjs/hooks/useRowSelection.js +150 -0
- package/dist/cjs/hooks/useSignalR.js +53 -0
- package/dist/cjs/hooks/useTheme.js +268 -0
- package/dist/cjs/hooks/useTranslation.js +20 -0
- package/dist/cjs/hooks/useUnsavedChanges.js +88 -0
- package/dist/cjs/index.js +21 -0
- package/dist/cjs/lib/api/activity/audit/audit.js +51 -0
- package/dist/cjs/lib/api/activity/audit/index.js +29 -0
- package/dist/cjs/lib/api/activity/audit/send.js +434 -0
- package/dist/cjs/lib/api/activity/email/client.js +467 -0
- package/dist/cjs/lib/api/activity/email/index.js +31 -0
- package/dist/cjs/lib/api/activity/email/password-reset.js +58 -0
- package/dist/cjs/lib/api/activity/email/templates.js +537 -0
- package/dist/cjs/lib/api/activity/email/types.js +24 -0
- package/dist/cjs/lib/api/activity/index.js +48 -0
- package/dist/cjs/lib/api/activity/messaging/messaging.js +254 -0
- package/dist/cjs/lib/api/activity/notifications/index.js +43 -0
- package/dist/cjs/lib/api/activity/notifications/notifications.js +224 -0
- package/dist/cjs/lib/api/activity/notifications/reminders.js +30 -0
- package/dist/cjs/lib/api/activity/notifications/send.js +267 -0
- package/dist/cjs/lib/api/activity/notifications/types.js +66 -0
- package/dist/cjs/lib/api/activity/notify-and-log.js +63 -0
- package/dist/cjs/lib/api/activity/remarks/index.js +6 -0
- package/dist/cjs/lib/api/activity/remarks/remarks.js +186 -0
- package/dist/cjs/lib/api/activity/storage.js +83 -0
- package/dist/cjs/lib/api/ai/chat.js +227 -0
- package/dist/cjs/lib/api/ai/types.js +6 -0
- package/dist/cjs/lib/api/approval/approvals.js +210 -0
- package/dist/cjs/lib/api/approval/index.js +13 -0
- package/dist/cjs/lib/api/auth/auth.js +154 -0
- package/dist/cjs/lib/api/auth/index.js +11 -0
- package/dist/cjs/lib/api/auth/password-reset-otp.js +192 -0
- package/dist/cjs/lib/api/auth/two-factor-auth.js +94 -0
- package/dist/cjs/lib/api/auth/two-factor.js +186 -0
- package/dist/cjs/lib/api/core/auth-helpers.js +141 -0
- package/dist/cjs/lib/api/core/client.js +305 -0
- package/dist/cjs/lib/api/core/config.js +248 -0
- package/dist/cjs/lib/api/core/index.js +43 -0
- package/dist/cjs/lib/api/core/session-validator.js +98 -0
- package/dist/cjs/lib/api/core/types.js +4 -0
- package/dist/cjs/lib/api/core/utils.js +70 -0
- package/dist/cjs/lib/api/dashboard/costing.js +15 -0
- package/dist/cjs/lib/api/dashboard/management.js +11 -0
- package/dist/cjs/lib/api/dashboard/sales.js +11 -0
- package/dist/cjs/lib/api/draft/drafts.js +279 -0
- package/dist/cjs/lib/api/draft/index.js +13 -0
- package/dist/cjs/lib/api/enquiry/enquiry.js +624 -0
- package/dist/cjs/lib/api/enquiry/index.js +20 -0
- package/dist/cjs/lib/api/enquiry/rate-enquiry.js +78 -0
- package/dist/cjs/lib/api/estimation/categories.js +113 -0
- package/dist/cjs/lib/api/estimation/category-defaults.js +47 -0
- package/dist/cjs/lib/api/estimation/company-config.js +26 -0
- package/dist/cjs/lib/api/estimation/content.js +210 -0
- package/dist/cjs/lib/api/estimation/freight.js +25 -0
- package/dist/cjs/lib/api/estimation/grid-costing-drafts.js +30 -0
- package/dist/cjs/lib/api/estimation/grid-costing.js +176 -0
- package/dist/cjs/lib/api/estimation/index.js +58 -0
- package/dist/cjs/lib/api/estimation/legacy-costing.js +51 -0
- package/dist/cjs/lib/api/estimation/machines.js +74 -0
- package/dist/cjs/lib/api/estimation/planning.js +403 -0
- package/dist/cjs/lib/api/estimation/qualities.js +245 -0
- package/dist/cjs/lib/api/estimation/quotation-load.js +52 -0
- package/dist/cjs/lib/api/estimation/quotation-save.js +109 -0
- package/dist/cjs/lib/api/estimation/quote-check.js +34 -0
- package/dist/cjs/lib/api/estimation/quotepanel.js +496 -0
- package/dist/cjs/lib/api/estimation/shipper-planning.js +220 -0
- package/dist/cjs/lib/api/estimation/wastage.js +47 -0
- package/dist/cjs/lib/api/index.js +33 -0
- package/dist/cjs/lib/api/integration/proxy.js +40 -0
- package/dist/cjs/lib/api/master/category.js +215 -0
- package/dist/cjs/lib/api/master/company.js +389 -0
- package/dist/cjs/lib/api/master/hsn.js +61 -0
- package/dist/cjs/lib/api/master/index.js +47 -0
- package/dist/cjs/lib/api/master/item.js +142 -0
- package/dist/cjs/lib/api/master/ledger.js +398 -0
- package/dist/cjs/lib/api/master/logistics.js +119 -0
- package/dist/cjs/lib/api/master/machine.js +579 -0
- package/dist/cjs/lib/api/master/material-group.js +103 -0
- package/dist/cjs/lib/api/master/other.js +63 -0
- package/dist/cjs/lib/api/master/process-types.js +5 -0
- package/dist/cjs/lib/api/master/process.js +131 -0
- package/dist/cjs/lib/api/master/production-units.js +22 -0
- package/dist/cjs/lib/api/master/rate.js +203 -0
- package/dist/cjs/lib/api/master/tool.js +88 -0
- package/dist/cjs/lib/api/master/user.js +154 -0
- package/dist/cjs/lib/api/settings/erp-parameters.js +69 -0
- package/dist/cjs/lib/api/utility/index.js +11 -0
- package/dist/cjs/lib/api/utility/menu.js +136 -0
- package/dist/cjs/lib/auth.js +10 -0
- package/dist/cjs/lib/pwa.js +59 -0
- package/dist/cjs/lib/react-query-config.js +134 -0
- package/dist/cjs/lib/security/audit-logger.js +177 -0
- package/dist/cjs/lib/security/rate-limiter.js +122 -0
- package/dist/cjs/lib/server-url.js +76 -0
- package/dist/cjs/lib/svg-utils.js +213 -0
- package/dist/cjs/lib/theme/types.js +235 -0
- package/dist/cjs/lib/theme/utils.js +363 -0
- package/dist/cjs/lib/types/index.js +3 -0
- package/dist/cjs/lib/utils/attachment-loader.js +82 -0
- package/dist/cjs/lib/utils/client-lead-utils.js +61 -0
- package/dist/cjs/lib/utils/device-detection.js +110 -0
- package/dist/cjs/lib/utils/logout-cleanup.js +312 -0
- package/dist/cjs/lib/utils/planning-prefs.js +31 -0
- package/dist/cjs/lib/utils.js +70 -0
- package/dist/cjs/lib/vision/dieline-extractor.js +321 -0
- package/dist/cjs/lib/vision/reference-grid.js +245 -0
- package/dist/cjs/locales/de.json +79 -0
- package/dist/cjs/locales/en.json +2217 -0
- package/dist/cjs/locales/es.json +79 -0
- package/dist/cjs/locales/fr.json +78 -0
- package/dist/cjs/locales/hi.json +1599 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/providers.js +43 -0
- package/dist/cjs/services/GlobalLoadingService.js +220 -0
- package/{src → dist/cjs}/styles/grid-themes.css +345 -345
- package/{src → dist/cjs}/styles/sidebar-scrollbar.css +45 -45
- package/{src → dist/cjs}/styles/tokens.css +712 -711
- package/dist/cjs/types/approval.js +22 -0
- package/dist/cjs/types/audit.js +50 -0
- package/dist/cjs/types/draft.js +22 -0
- package/dist/cjs/types/master.js +4 -0
- package/dist/cjs/types/shipper-planning.js +7 -0
- package/dist/components/auth/ProtectedRoute.d.ts +6 -0
- package/dist/components/auth/ProtectedRoute.js +45 -0
- package/dist/components/auth/UnauthorizedPage.d.ts +6 -0
- package/dist/components/auth/UnauthorizedPage.js +15 -0
- package/dist/components/auth/index.d.ts +2 -0
- package/dist/components/auth/index.js +3 -0
- package/dist/components/chat/ai-messages.d.ts +32 -0
- package/dist/components/chat/ai-messages.js +265 -0
- package/dist/components/chat/chat-prompt-navigator.d.ts +9 -0
- package/dist/components/chat/chat-prompt-navigator.js +107 -0
- package/dist/components/chat/chat.d.ts +46 -0
- package/dist/components/chat/chat.js +1029 -0
- package/dist/components/chat/index.d.ts +5 -0
- package/dist/components/chat/index.js +13 -0
- package/dist/components/chat/multimodal-input.d.ts +12 -0
- package/dist/components/chat/multimodal-input.js +116 -0
- package/dist/components/dashboard/DrillDownModal.d.ts +15 -0
- package/dist/components/dashboard/DrillDownModal.js +33 -0
- package/dist/components/dashboard/FilterBar.d.ts +108 -0
- package/dist/components/dashboard/FilterBar.js +428 -0
- package/dist/components/dashboard/Tooltip.d.ts +24 -0
- package/dist/components/dashboard/Tooltip.js +50 -0
- package/dist/components/dashboard/charts/Area.d.ts +28 -0
- package/dist/components/dashboard/charts/Area.js +121 -0
- package/dist/components/dashboard/charts/Bar.d.ts +27 -0
- package/dist/components/dashboard/charts/Bar.js +105 -0
- package/dist/components/dashboard/charts/BoxPlot.d.ts +23 -0
- package/dist/components/dashboard/charts/BoxPlot.js +112 -0
- package/dist/components/dashboard/charts/Bubble.d.ts +36 -0
- package/dist/components/dashboard/charts/Bubble.js +96 -0
- package/dist/components/dashboard/charts/DashboardCard.d.ts +12 -0
- package/dist/components/dashboard/charts/DashboardCard.js +9 -0
- package/dist/components/dashboard/charts/Donut.d.ts +23 -0
- package/dist/components/dashboard/charts/Donut.js +124 -0
- package/dist/components/dashboard/charts/FlowMap.d.ts +38 -0
- package/dist/components/dashboard/charts/FlowMap.js +199 -0
- package/dist/components/dashboard/charts/Funnel.d.ts +30 -0
- package/dist/components/dashboard/charts/Funnel.js +35 -0
- package/dist/components/dashboard/charts/Gantt.d.ts +26 -0
- package/dist/components/dashboard/charts/Gantt.js +265 -0
- package/dist/components/dashboard/charts/Gauge.d.ts +25 -0
- package/dist/components/dashboard/charts/Gauge.js +137 -0
- package/dist/components/dashboard/charts/GeoMap.d.ts +38 -0
- package/dist/components/dashboard/charts/GeoMap.js +125 -0
- package/dist/components/dashboard/charts/Heatmap.d.ts +31 -0
- package/dist/components/dashboard/charts/Heatmap.js +110 -0
- package/dist/components/dashboard/charts/Line.d.ts +33 -0
- package/dist/components/dashboard/charts/Line.js +69 -0
- package/dist/components/dashboard/charts/Pareto.d.ts +21 -0
- package/dist/components/dashboard/charts/Pareto.js +104 -0
- package/dist/components/dashboard/charts/Radar.d.ts +32 -0
- package/dist/components/dashboard/charts/Radar.js +88 -0
- package/dist/components/dashboard/charts/Sankey.d.ts +43 -0
- package/dist/components/dashboard/charts/Sankey.js +86 -0
- package/dist/components/dashboard/charts/Scatter.d.ts +38 -0
- package/dist/components/dashboard/charts/Scatter.js +122 -0
- package/dist/components/dashboard/charts/Sparkline.d.ts +37 -0
- package/dist/components/dashboard/charts/Sparkline.js +128 -0
- package/dist/components/dashboard/charts/Treemap.d.ts +30 -0
- package/dist/components/dashboard/charts/Treemap.js +98 -0
- package/dist/components/dashboard/charts/index.d.ts +38 -0
- package/dist/components/dashboard/charts/index.js +23 -0
- package/dist/components/dashboard/charts/india-map.d.ts +22 -0
- package/dist/components/dashboard/charts/india-map.js +461 -0
- package/dist/components/dashboard/charts/theme.d.ts +107 -0
- package/dist/components/dashboard/charts/theme.js +124 -0
- package/dist/components/dashboard/config.d.ts +96 -0
- package/dist/components/dashboard/config.js +113 -0
- package/dist/components/dashboard/index.d.ts +10 -0
- package/dist/components/dashboard/index.js +13 -0
- package/dist/components/dashboard/kpi/KpiBeforeAfter.d.ts +31 -0
- package/dist/components/dashboard/kpi/KpiBeforeAfter.js +13 -0
- package/dist/components/dashboard/kpi/KpiBreakdown.d.ts +31 -0
- package/dist/components/dashboard/kpi/KpiBreakdown.js +39 -0
- package/dist/components/dashboard/kpi/KpiComparison.d.ts +36 -0
- package/dist/components/dashboard/kpi/KpiComparison.js +38 -0
- package/dist/components/dashboard/kpi/KpiQuickStats.d.ts +30 -0
- package/dist/components/dashboard/kpi/KpiQuickStats.js +38 -0
- package/dist/components/dashboard/kpi/KpiRating.d.ts +46 -0
- package/dist/components/dashboard/kpi/KpiRating.js +35 -0
- package/dist/components/dashboard/kpi/KpiScroll.d.ts +63 -0
- package/dist/components/dashboard/kpi/KpiScroll.js +80 -0
- package/dist/components/dashboard/kpi/KpiTrend.d.ts +28 -0
- package/dist/components/dashboard/kpi/KpiTrend.js +34 -0
- package/dist/components/dashboard/kpi/index.d.ts +16 -0
- package/dist/components/dashboard/kpi/index.js +10 -0
- package/dist/components/dashboard/kpi/kpi-shell.d.ts +44 -0
- package/dist/components/dashboard/kpi/kpi-shell.js +108 -0
- package/dist/components/dashboard/time-range.d.ts +12 -0
- package/dist/components/dashboard/time-range.js +118 -0
- package/dist/components/datagrid/DataGrid.d.ts +126 -0
- package/dist/components/datagrid/DataGrid.js +1577 -0
- package/dist/components/datagrid/cells/BooleanCell.d.ts +15 -0
- package/dist/components/datagrid/cells/BooleanCell.js +39 -0
- package/dist/components/datagrid/cells/CellRenderer.d.ts +25 -0
- package/dist/components/datagrid/cells/CellRenderer.js +139 -0
- package/dist/components/datagrid/cells/EditableCell.d.ts +35 -0
- package/dist/components/datagrid/cells/EditableCell.js +179 -0
- package/dist/components/datagrid/cells/SelectionCell.d.ts +11 -0
- package/dist/components/datagrid/cells/SelectionCell.js +58 -0
- package/dist/components/datagrid/cells/index.d.ts +1 -0
- package/dist/components/datagrid/cells/index.js +2 -0
- package/dist/components/datagrid/columns/ActionsColumn.d.ts +174 -0
- package/dist/components/datagrid/columns/ActionsColumn.js +448 -0
- package/dist/components/datagrid/columns/ColumnContextMenu.d.ts +16 -0
- package/dist/components/datagrid/columns/ColumnContextMenu.js +338 -0
- package/dist/components/datagrid/columns/DraggableColumnHeader.d.ts +19 -0
- package/dist/components/datagrid/columns/DraggableColumnHeader.js +147 -0
- package/dist/components/datagrid/controls/AutoResizeButton.d.ts +8 -0
- package/dist/components/datagrid/controls/AutoResizeButton.js +7 -0
- package/dist/components/datagrid/controls/PaginationControls.d.ts +13 -0
- package/dist/components/datagrid/controls/PaginationControls.js +34 -0
- package/dist/components/datagrid/controls/SummaryControls.d.ts +10 -0
- package/dist/components/datagrid/controls/SummaryControls.js +27 -0
- package/dist/components/datagrid/controls/menu/ActionsMenu.d.ts +31 -0
- package/dist/components/datagrid/controls/menu/ActionsMenu.js +13 -0
- package/dist/components/datagrid/controls/menu/column/ColumnChooserModal.d.ts +13 -0
- package/dist/components/datagrid/controls/menu/column/ColumnChooserModal.js +22 -0
- package/dist/components/datagrid/controls/menu/column/ColumnSection.d.ts +9 -0
- package/dist/components/datagrid/controls/menu/column/ColumnSection.js +7 -0
- package/dist/components/datagrid/controls/menu/export/ExportSection.d.ts +7 -0
- package/dist/components/datagrid/controls/menu/export/ExportSection.js +16 -0
- package/dist/components/datagrid/controls/menu/export/export.d.ts +21 -0
- package/dist/components/datagrid/controls/menu/export/export.js +187 -0
- package/dist/components/datagrid/controls/menu/filter/AdvancedFilterModal.d.ts +29 -0
- package/dist/components/datagrid/controls/menu/filter/AdvancedFilterModal.js +369 -0
- package/dist/components/datagrid/controls/menu/filter/FilterSection.d.ts +12 -0
- package/dist/components/datagrid/controls/menu/filter/FilterSection.js +6 -0
- package/dist/components/datagrid/controls/menu/grouping/GroupingSection.d.ts +10 -0
- package/dist/components/datagrid/controls/menu/grouping/GroupingSection.js +20 -0
- package/dist/components/datagrid/controls/menu/grouping/index.d.ts +1 -0
- package/dist/components/datagrid/controls/menu/grouping/index.js +2 -0
- package/dist/components/datagrid/controls/menu/import/ImportSection.d.ts +6 -0
- package/dist/components/datagrid/controls/menu/import/ImportSection.js +72 -0
- package/dist/components/datagrid/controls/menu/import/import.d.ts +27 -0
- package/dist/components/datagrid/controls/menu/import/import.js +193 -0
- package/dist/components/datagrid/controls/menu/index.d.ts +10 -0
- package/dist/components/datagrid/controls/menu/index.js +11 -0
- package/dist/components/datagrid/controls/menu/view/CardView.d.ts +17 -0
- package/dist/components/datagrid/controls/menu/view/CardView.js +173 -0
- package/dist/components/datagrid/controls/menu/view/ChartView.d.ts +9 -0
- package/dist/components/datagrid/controls/menu/view/ChartView.js +363 -0
- package/dist/components/datagrid/controls/menu/view/ViewSection.d.ts +7 -0
- package/dist/components/datagrid/controls/menu/view/ViewSection.js +9 -0
- package/dist/components/datagrid/hooks/useCellRangeSelection.d.ts +20 -0
- package/dist/components/datagrid/hooks/useCellRangeSelection.js +124 -0
- package/dist/components/datagrid/hooks/useClipboard.d.ts +15 -0
- package/dist/components/datagrid/hooks/useClipboard.js +151 -0
- package/dist/components/datagrid/hooks/useDataGridState.d.ts +46 -0
- package/dist/components/datagrid/hooks/useDataGridState.js +112 -0
- package/dist/components/datagrid/hooks/useKeyboardNavigation.d.ts +18 -0
- package/dist/components/datagrid/hooks/useKeyboardNavigation.js +117 -0
- package/dist/components/datagrid/index.d.ts +34 -0
- package/dist/components/datagrid/index.js +41 -0
- package/dist/components/datagrid/rows/DraggableRow.d.ts +33 -0
- package/dist/components/datagrid/rows/DraggableRow.js +31 -0
- package/dist/components/datagrid/rows/ExpandableRow.d.ts +48 -0
- package/dist/components/datagrid/rows/ExpandableRow.js +178 -0
- package/dist/components/datagrid/rows/FilterRow.d.ts +10 -0
- package/dist/components/datagrid/rows/FilterRow.js +185 -0
- package/dist/components/datagrid/rows/SelectColumn.d.ts +2 -0
- package/dist/components/datagrid/rows/SelectColumn.js +31 -0
- package/dist/components/datagrid/rows/SummaryRow.d.ts +12 -0
- package/dist/components/datagrid/rows/SummaryRow.js +31 -0
- package/dist/components/datagrid/rows/summary.d.ts +9 -0
- package/dist/components/datagrid/rows/summary.js +63 -0
- package/dist/components/datagrid/search/InlineSearchCell.d.ts +13 -0
- package/dist/components/datagrid/search/InlineSearchCell.js +96 -0
- package/dist/components/datagrid/search/SearchHighlighter.d.ts +16 -0
- package/dist/components/datagrid/search/SearchHighlighter.js +124 -0
- package/dist/components/datagrid/search/SearchNavigator.d.ts +24 -0
- package/dist/components/datagrid/search/SearchNavigator.js +148 -0
- package/dist/components/datagrid/search/SearchNewModal.d.ts +12 -0
- package/dist/components/datagrid/search/SearchNewModal.js +202 -0
- package/dist/components/datagrid/search/advancedSearch.d.ts +23 -0
- package/dist/components/datagrid/search/advancedSearch.js +109 -0
- package/dist/components/datagrid/utils/grid-helpers.d.ts +34 -0
- package/dist/components/datagrid/utils/grid-helpers.js +94 -0
- package/dist/components/datagrid/utils/grid-types.d.ts +157 -0
- package/dist/components/datagrid/utils/grid-types.js +2 -0
- package/dist/components/draft/AutoSaveIndicator.d.ts +28 -0
- package/dist/components/draft/AutoSaveIndicator.js +67 -0
- package/dist/components/draft/DraftModal.d.ts +27 -0
- package/dist/components/draft/DraftModal.js +184 -0
- package/dist/components/forms/date-picker/CalendarView.d.ts +17 -0
- package/dist/components/forms/date-picker/CalendarView.js +46 -0
- package/dist/components/forms/date-picker/DatePicker.d.ts +35 -0
- package/dist/components/forms/date-picker/DatePicker.js +712 -0
- package/dist/components/forms/date-picker/DateTimePicker.d.ts +15 -0
- package/dist/components/forms/date-picker/DateTimePicker.js +138 -0
- package/dist/components/forms/date-picker/index.d.ts +7 -0
- package/dist/components/forms/date-picker/index.js +9 -0
- package/dist/components/forms/date-picker/shared-utils.d.ts +6 -0
- package/dist/components/forms/date-picker/shared-utils.js +19 -0
- package/dist/components/forms/dropdown/Dropdown.d.ts +144 -0
- package/dist/components/forms/dropdown/Dropdown.js +384 -0
- package/dist/components/forms/dropdown/MultiSelect.d.ts +29 -0
- package/dist/components/forms/dropdown/MultiSelect.js +100 -0
- package/dist/components/forms/dropdown/SingleSelect.d.ts +39 -0
- package/dist/components/forms/dropdown/SingleSelect.js +218 -0
- package/dist/components/forms/dropdown/hooks/useDropdownCreate.d.ts +8 -0
- package/dist/components/forms/dropdown/hooks/useDropdownCreate.js +52 -0
- package/dist/components/forms/dropdown/hooks/useDropdownFiltering.d.ts +5 -0
- package/dist/components/forms/dropdown/hooks/useDropdownFiltering.js +51 -0
- package/dist/components/forms/dropdown/hooks/useDropdownState.d.ts +7 -0
- package/dist/components/forms/dropdown/hooks/useDropdownState.js +27 -0
- package/dist/components/forms/dropdown/index.d.ts +2 -0
- package/dist/components/forms/dropdown/index.js +2 -0
- package/dist/components/forms/dropdown/types.d.ts +67 -0
- package/dist/components/forms/dropdown/types.js +2 -0
- package/dist/components/forms/file-attachment/EmailPreview.d.ts +5 -0
- package/dist/components/forms/file-attachment/EmailPreview.js +383 -0
- package/dist/components/forms/file-attachment/FileAttachment.d.ts +30 -0
- package/dist/components/forms/file-attachment/FileAttachment.js +930 -0
- package/dist/components/forms/file-attachment/index.d.ts +2 -0
- package/dist/components/forms/file-attachment/index.js +2 -0
- package/dist/components/forms/index.d.ts +9 -0
- package/dist/components/forms/index.js +7 -0
- package/dist/components/forms/quantity-input-popup.d.ts +10 -0
- package/dist/components/forms/quantity-input-popup.js +99 -0
- package/dist/components/forms/remark-input/RemarkInput.d.ts +58 -0
- package/dist/components/forms/remark-input/RemarkInput.js +258 -0
- package/dist/components/forms/remark-input/index.d.ts +1 -0
- package/dist/components/forms/remark-input/index.js +2 -0
- package/dist/components/forms/unified-currency-dropdown.d.ts +26 -0
- package/dist/components/forms/unified-currency-dropdown.js +166 -0
- package/dist/components/index.d.ts +14 -0
- package/dist/components/index.js +15 -0
- package/dist/components/layout/SidebarContextMenu.d.ts +18 -0
- package/dist/components/layout/SidebarContextMenu.js +142 -0
- package/dist/components/layout/app-shell.d.ts +32 -0
- package/dist/components/layout/app-shell.js +43 -0
- package/dist/components/layout/bottom-nav.d.ts +28 -0
- package/dist/components/layout/bottom-nav.js +219 -0
- package/dist/components/layout/floating-action-button.d.ts +10 -0
- package/dist/components/layout/floating-action-button.js +74 -0
- package/dist/components/layout/footer.d.ts +37 -0
- package/dist/components/layout/footer.js +56 -0
- package/dist/components/layout/index.d.ts +10 -0
- package/dist/components/layout/index.js +7 -0
- package/dist/components/layout/mobile-menu-sheet.d.ts +7 -0
- package/dist/components/layout/mobile-menu-sheet.js +159 -0
- package/dist/components/layout/side-panel.d.ts +50 -0
- package/dist/components/layout/side-panel.js +115 -0
- package/dist/components/layout/sidebar.d.ts +12 -0
- package/dist/components/layout/sidebar.js +542 -0
- package/dist/components/layout/top-header.d.ts +8 -0
- package/dist/components/layout/top-header.js +234 -0
- package/dist/components/layout/userprofile-dropdown.d.ts +1 -0
- package/dist/components/layout/userprofile-dropdown.js +97 -0
- package/dist/components/master/editable-cells/EditableCell.d.ts +43 -0
- package/dist/components/master/editable-cells/EditableCell.js +66 -0
- package/dist/components/master/editable-cells/index.d.ts +9 -0
- package/dist/components/master/editable-cells/index.js +10 -0
- package/dist/components/master/index.d.ts +1 -0
- package/dist/components/master/index.js +3 -0
- package/dist/components/messaging/conversation-list.d.ts +13 -0
- package/dist/components/messaging/conversation-list.js +103 -0
- package/dist/components/messaging/create-conversation-modal.d.ts +9 -0
- package/dist/components/messaging/create-conversation-modal.js +109 -0
- package/dist/components/messaging/message-bubble.d.ts +15 -0
- package/dist/components/messaging/message-bubble.js +66 -0
- package/dist/components/messaging/message-input.d.ts +17 -0
- package/dist/components/messaging/message-input.js +151 -0
- package/dist/components/messaging/message-thread.d.ts +10 -0
- package/dist/components/messaging/message-thread.js +121 -0
- package/dist/components/messaging/messaging-panel-content.d.ts +5 -0
- package/dist/components/messaging/messaging-panel-content.js +66 -0
- package/dist/components/messaging/thread-panel.d.ts +10 -0
- package/dist/components/messaging/thread-panel.js +47 -0
- package/dist/components/modals/3DModal.d.ts +39 -0
- package/dist/components/modals/3DModal.js +32 -0
- package/dist/components/modals/ImageModal.d.ts +28 -0
- package/dist/components/modals/ImageModal.js +551 -0
- package/dist/components/modals/Modal.d.ts +92 -0
- package/dist/components/modals/Modal.js +264 -0
- package/dist/components/modals/StandardModal.d.ts +27 -0
- package/dist/components/modals/StandardModal.js +25 -0
- package/dist/components/modals/api-config-modal.d.ts +7 -0
- package/dist/components/modals/api-config-modal.js +117 -0
- package/dist/components/modals/global-api-config-modal.d.ts +7 -0
- package/dist/components/modals/global-api-config-modal.js +124 -0
- package/dist/components/modals/index.d.ts +7 -0
- package/dist/components/modals/index.js +8 -0
- package/dist/components/modals/logout-modal.d.ts +32 -0
- package/dist/components/modals/logout-modal.js +42 -0
- package/dist/components/modals/modal-alert.d.ts +139 -0
- package/dist/components/modals/modal-alert.js +250 -0
- package/dist/components/modals/password-reset-modal.d.ts +11 -0
- package/dist/components/modals/password-reset-modal.js +109 -0
- package/dist/components/modals/session-expiry-warning.d.ts +12 -0
- package/dist/components/modals/session-expiry-warning.js +15 -0
- package/dist/components/providers/api-provider.d.ts +10 -0
- package/dist/components/providers/api-provider.js +15 -0
- package/dist/components/providers/query-provider.d.ts +3 -0
- package/dist/components/providers/query-provider.js +26 -0
- package/dist/components/providers/session-provider.d.ts +7 -0
- package/dist/components/providers/session-provider.js +116 -0
- package/dist/components/theme/ThemeCustomizer.d.ts +37 -0
- package/dist/components/theme/ThemeCustomizer.js +178 -0
- package/dist/components/ui/buttons/button.d.ts +59 -0
- package/dist/components/ui/buttons/button.js +228 -0
- package/dist/components/ui/card.d.ts +8 -0
- package/dist/components/ui/card.js +17 -0
- package/dist/components/ui/chart.d.ts +83 -0
- package/dist/components/ui/chart.js +113 -0
- package/dist/components/ui/display/boolean-badge.d.ts +7 -0
- package/dist/components/ui/display/boolean-badge.js +23 -0
- package/dist/components/ui/display/card.d.ts +10 -0
- package/dist/components/ui/display/card.js +11 -0
- package/dist/components/ui/display/collapsible.d.ts +6 -0
- package/dist/components/ui/display/collapsible.js +6 -0
- package/dist/components/ui/display/separator.d.ts +4 -0
- package/dist/components/ui/display/separator.js +8 -0
- package/dist/components/ui/display/stats-card.d.ts +22 -0
- package/dist/components/ui/display/stats-card.js +25 -0
- package/dist/components/ui/display/text.d.ts +14 -0
- package/dist/components/ui/display/text.js +57 -0
- package/dist/components/ui/feedback/alert.d.ts +8 -0
- package/dist/components/ui/feedback/alert.js +23 -0
- package/dist/components/ui/feedback/badge.d.ts +49 -0
- package/dist/components/ui/feedback/badge.js +87 -0
- package/dist/components/ui/feedback/progress.d.ts +4 -0
- package/dist/components/ui/feedback/progress.js +8 -0
- package/dist/components/ui/feedback/reminder-button.d.ts +22 -0
- package/dist/components/ui/feedback/reminder-button.js +75 -0
- package/dist/components/ui/feedback/skeleton-table.d.ts +18 -0
- package/dist/components/ui/feedback/skeleton-table.js +17 -0
- package/dist/components/ui/feedback/skeleton.d.ts +53 -0
- package/dist/components/ui/feedback/skeleton.js +48 -0
- package/dist/components/ui/feedback/tooltip.d.ts +15 -0
- package/dist/components/ui/feedback/tooltip.js +14 -0
- package/dist/components/ui/form-toggle.d.ts +57 -0
- package/dist/components/ui/form-toggle.js +44 -0
- package/dist/components/ui/forms/checkbox.d.ts +6 -0
- package/dist/components/ui/forms/checkbox.js +17 -0
- package/dist/components/ui/forms/input.d.ts +18 -0
- package/dist/components/ui/forms/input.js +75 -0
- package/dist/components/ui/forms/label.d.ts +5 -0
- package/dist/components/ui/forms/label.js +6 -0
- package/dist/components/ui/forms/switch.d.ts +10 -0
- package/dist/components/ui/forms/switch.js +22 -0
- package/dist/components/ui/forms/textarea.d.ts +8 -0
- package/dist/components/ui/forms/textarea.js +13 -0
- package/dist/components/ui/index.d.ts +49 -0
- package/dist/components/ui/index.js +62 -0
- package/dist/components/ui/navigation/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/navigation/dropdown-menu.js +34 -0
- package/dist/components/ui/navigation/header-steps.d.ts +16 -0
- package/dist/components/ui/navigation/header-steps.js +15 -0
- package/dist/components/ui/navigation/tabs.d.ts +40 -0
- package/dist/components/ui/navigation/tabs.js +59 -0
- package/dist/components/ui/overlays/loading.d.ts +47 -0
- package/dist/components/ui/overlays/loading.js +131 -0
- package/dist/components/ui/select.d.ts +13 -0
- package/dist/components/ui/select.js +27 -0
- package/dist/config/api.d.ts +30 -0
- package/dist/config/api.js +58 -0
- package/dist/contexts/AppConfigContext.d.ts +13 -0
- package/dist/contexts/AppConfigContext.js +33 -0
- package/dist/contexts/CurrencyContext.d.ts +43 -0
- package/dist/contexts/CurrencyContext.js +331 -0
- package/dist/contexts/DeviceContext.d.ts +12 -0
- package/dist/contexts/DeviceContext.js +69 -0
- package/dist/contexts/EmailContext.d.ts +112 -0
- package/dist/contexts/EmailContext.js +720 -0
- package/dist/contexts/GlobalAlertContext.d.ts +67 -0
- package/dist/contexts/GlobalAlertContext.js +192 -0
- package/dist/contexts/ImpactAnalysisContext.d.ts +11 -0
- package/dist/contexts/ImpactAnalysisContext.js +23 -0
- package/dist/contexts/LanguageContext.d.ts +21 -0
- package/dist/contexts/LanguageContext.js +66 -0
- package/dist/contexts/MessagingContext.d.ts +70 -0
- package/dist/contexts/MessagingContext.js +722 -0
- package/dist/contexts/ModuleAuthContext.d.ts +42 -0
- package/dist/contexts/ModuleAuthContext.js +278 -0
- package/dist/contexts/NavigationContext.d.ts +26 -0
- package/dist/contexts/NavigationContext.js +143 -0
- package/dist/contexts/NetworkStatusContext.d.ts +18 -0
- package/dist/contexts/NetworkStatusContext.js +87 -0
- package/dist/contexts/NotificationContext.d.ts +47 -0
- package/dist/contexts/NotificationContext.js +165 -0
- package/dist/contexts/PageTitleContext.d.ts +11 -0
- package/dist/contexts/PageTitleContext.js +23 -0
- package/dist/contexts/SearchPreferencesContext.d.ts +11 -0
- package/dist/contexts/SearchPreferencesContext.js +38 -0
- package/dist/contexts/SessionAdapterContext.d.ts +39 -0
- package/dist/contexts/SessionAdapterContext.js +20 -0
- package/dist/contexts/SidebarPreferencesContext.d.ts +19 -0
- package/dist/contexts/SidebarPreferencesContext.js +112 -0
- package/dist/contexts/ThemeContext.d.ts +63 -0
- package/dist/contexts/ThemeContext.js +153 -0
- package/dist/hooks/index.d.ts +23 -0
- package/dist/hooks/index.js +18 -0
- package/dist/hooks/useApproval.d.ts +47 -0
- package/dist/hooks/useApproval.js +247 -0
- package/dist/hooks/useBacchaSearch.d.ts +57 -0
- package/dist/hooks/useBacchaSearch.js +254 -0
- package/dist/hooks/useBusinessAudit.d.ts +24 -0
- package/dist/hooks/useBusinessAudit.js +51 -0
- package/dist/hooks/useColumnFreezing.d.ts +85 -0
- package/dist/hooks/useColumnFreezing.js +201 -0
- package/dist/hooks/useColumnMetadata.d.ts +20 -0
- package/dist/hooks/useColumnMetadata.js +44 -0
- package/dist/hooks/useConditionalFormatting.d.ts +43 -0
- package/dist/hooks/useConditionalFormatting.js +193 -0
- package/dist/hooks/useDebounce.d.ts +14 -0
- package/dist/hooks/useDebounce.js +45 -0
- package/dist/hooks/useDraft.d.ts +46 -0
- package/dist/hooks/useDraft.js +178 -0
- package/dist/hooks/useFormValidation.d.ts +37 -0
- package/dist/hooks/useFormValidation.js +65 -0
- package/dist/hooks/useGridSettings.d.ts +26 -0
- package/dist/hooks/useGridSettings.js +82 -0
- package/dist/hooks/useGridTheme.d.ts +59 -0
- package/dist/hooks/useGridTheme.js +199 -0
- package/dist/hooks/useId.d.ts +2 -0
- package/dist/hooks/useId.js +17 -0
- package/dist/hooks/useIntelligentColumnSizing.d.ts +71 -0
- package/dist/hooks/useIntelligentColumnSizing.js +310 -0
- package/dist/hooks/useKeyboardNavigation.d.ts +33 -0
- package/dist/hooks/useKeyboardNavigation.js +189 -0
- package/dist/hooks/useNotifications.d.ts +7 -0
- package/dist/hooks/useNotifications.js +56 -0
- package/dist/hooks/usePrevious.d.ts +9 -0
- package/dist/hooks/usePrevious.js +17 -0
- package/dist/hooks/useRowSelection.d.ts +45 -0
- package/dist/hooks/useRowSelection.js +147 -0
- package/dist/hooks/useSignalR.d.ts +13 -0
- package/dist/hooks/useSignalR.js +50 -0
- package/dist/hooks/useTheme.d.ts +59 -0
- package/dist/hooks/useTheme.js +261 -0
- package/dist/hooks/useTranslation.d.ts +5 -0
- package/dist/hooks/useTranslation.js +17 -0
- package/dist/hooks/useUnsavedChanges.d.ts +40 -0
- package/dist/hooks/useUnsavedChanges.js +83 -0
- package/dist/index.d.ts +2 -3173
- package/dist/index.js +4 -25937
- package/dist/lib/api/activity/audit/audit.d.ts +34 -0
- package/dist/lib/api/activity/audit/audit.js +44 -0
- package/dist/lib/api/activity/audit/index.d.ts +6 -0
- package/dist/lib/api/activity/audit/index.js +7 -0
- package/dist/lib/api/activity/audit/send.d.ts +152 -0
- package/dist/lib/api/activity/audit/send.js +403 -0
- package/dist/lib/api/activity/email/client.d.ts +167 -0
- package/dist/lib/api/activity/email/client.js +455 -0
- package/dist/lib/api/activity/email/index.d.ts +7 -0
- package/dist/lib/api/activity/email/index.js +10 -0
- package/dist/lib/api/activity/email/password-reset.d.ts +8 -0
- package/dist/lib/api/activity/email/password-reset.js +55 -0
- package/dist/lib/api/activity/email/templates.d.ts +10 -0
- package/dist/lib/api/activity/email/templates.js +531 -0
- package/dist/lib/api/activity/email/types.d.ts +237 -0
- package/dist/lib/api/activity/email/types.js +21 -0
- package/dist/lib/api/activity/index.d.ts +12 -0
- package/dist/lib/api/activity/index.js +15 -0
- package/dist/lib/api/activity/messaging/messaging.d.ts +149 -0
- package/dist/lib/api/activity/messaging/messaging.js +245 -0
- package/dist/lib/api/activity/notifications/index.d.ts +9 -0
- package/dist/lib/api/activity/notifications/index.js +9 -0
- package/dist/lib/api/activity/notifications/notifications.d.ts +59 -0
- package/dist/lib/api/activity/notifications/notifications.js +218 -0
- package/dist/lib/api/activity/notifications/reminders.d.ts +35 -0
- package/dist/lib/api/activity/notifications/reminders.js +25 -0
- package/dist/lib/api/activity/notifications/send.d.ts +122 -0
- package/dist/lib/api/activity/notifications/send.js +252 -0
- package/dist/lib/api/activity/notifications/types.d.ts +119 -0
- package/dist/lib/api/activity/notifications/types.js +62 -0
- package/dist/lib/api/activity/notify-and-log.d.ts +50 -0
- package/dist/lib/api/activity/notify-and-log.js +60 -0
- package/dist/lib/api/activity/remarks/index.d.ts +2 -0
- package/dist/lib/api/activity/remarks/index.js +2 -0
- package/dist/lib/api/activity/remarks/remarks.d.ts +83 -0
- package/dist/lib/api/activity/remarks/remarks.js +179 -0
- package/dist/lib/api/activity/storage.d.ts +28 -0
- package/dist/lib/api/activity/storage.js +79 -0
- package/dist/lib/api/ai/chat.d.ts +67 -0
- package/dist/lib/api/ai/chat.js +212 -0
- package/dist/lib/api/ai/types.d.ts +69 -0
- package/dist/lib/api/ai/types.js +5 -0
- package/dist/lib/api/approval/approvals.d.ts +66 -0
- package/dist/lib/api/approval/approvals.js +205 -0
- package/dist/lib/api/approval/index.d.ts +5 -0
- package/dist/lib/api/approval/index.js +6 -0
- package/dist/lib/api/auth/auth.d.ts +12 -0
- package/dist/lib/api/auth/auth.js +148 -0
- package/dist/lib/api/auth/index.d.ts +1 -0
- package/dist/lib/api/auth/index.js +4 -0
- package/dist/lib/api/auth/password-reset-otp.d.ts +49 -0
- package/dist/lib/api/auth/password-reset-otp.js +185 -0
- package/dist/lib/api/auth/two-factor-auth.d.ts +55 -0
- package/dist/lib/api/auth/two-factor-auth.js +84 -0
- package/dist/lib/api/auth/two-factor.d.ts +41 -0
- package/dist/lib/api/auth/two-factor.js +180 -0
- package/dist/lib/api/core/auth-helpers.d.ts +13 -0
- package/dist/lib/api/core/auth-helpers.js +137 -0
- package/dist/lib/api/core/client.d.ts +37 -0
- package/dist/lib/api/core/client.js +301 -0
- package/dist/lib/api/core/config.d.ts +46 -0
- package/dist/lib/api/core/config.js +238 -0
- package/dist/lib/api/core/index.d.ts +6 -0
- package/dist/lib/api/core/index.js +11 -0
- package/dist/lib/api/core/session-validator.d.ts +55 -0
- package/dist/lib/api/core/session-validator.js +94 -0
- package/dist/lib/api/core/types.d.ts +192 -0
- package/dist/lib/api/core/types.js +3 -0
- package/dist/lib/api/core/utils.d.ts +15 -0
- package/dist/lib/api/core/utils.js +64 -0
- package/dist/lib/api/dashboard/costing.d.ts +129 -0
- package/dist/lib/api/dashboard/costing.js +8 -0
- package/dist/lib/api/dashboard/management.d.ts +91 -0
- package/dist/lib/api/dashboard/management.js +5 -0
- package/dist/lib/api/dashboard/sales.d.ts +87 -0
- package/dist/lib/api/dashboard/sales.js +5 -0
- package/dist/lib/api/draft/drafts.d.ts +49 -0
- package/dist/lib/api/draft/drafts.js +274 -0
- package/dist/lib/api/draft/index.d.ts +5 -0
- package/dist/lib/api/draft/index.js +6 -0
- package/dist/lib/api/enquiry/enquiry.d.ts +324 -0
- package/dist/lib/api/enquiry/enquiry.js +617 -0
- package/dist/lib/api/enquiry/index.d.ts +2 -0
- package/dist/lib/api/enquiry/index.js +4 -0
- package/dist/lib/api/enquiry/rate-enquiry.d.ts +97 -0
- package/dist/lib/api/enquiry/rate-enquiry.js +69 -0
- package/dist/lib/api/estimation/categories.d.ts +28 -0
- package/dist/lib/api/estimation/categories.js +104 -0
- package/dist/lib/api/estimation/category-defaults.d.ts +56 -0
- package/dist/lib/api/estimation/category-defaults.js +41 -0
- package/dist/lib/api/estimation/company-config.d.ts +59 -0
- package/dist/lib/api/estimation/company-config.js +19 -0
- package/dist/lib/api/estimation/content.d.ts +103 -0
- package/dist/lib/api/estimation/content.js +203 -0
- package/dist/lib/api/estimation/freight.d.ts +34 -0
- package/dist/lib/api/estimation/freight.js +18 -0
- package/dist/lib/api/estimation/grid-costing-drafts.d.ts +38 -0
- package/dist/lib/api/estimation/grid-costing-drafts.js +21 -0
- package/dist/lib/api/estimation/grid-costing.d.ts +353 -0
- package/dist/lib/api/estimation/grid-costing.js +126 -0
- package/dist/lib/api/estimation/index.d.ts +10 -0
- package/dist/lib/api/estimation/index.js +22 -0
- package/dist/lib/api/estimation/legacy-costing.d.ts +42 -0
- package/dist/lib/api/estimation/legacy-costing.js +46 -0
- package/dist/lib/api/estimation/machines.d.ts +32 -0
- package/dist/lib/api/estimation/machines.js +67 -0
- package/dist/lib/api/estimation/planning.d.ts +479 -0
- package/dist/lib/api/estimation/planning.js +385 -0
- package/dist/lib/api/estimation/qualities.d.ts +128 -0
- package/dist/lib/api/estimation/qualities.js +229 -0
- package/dist/lib/api/estimation/quotation-load.d.ts +30 -0
- package/dist/lib/api/estimation/quotation-load.js +46 -0
- package/dist/lib/api/estimation/quotation-save.d.ts +88 -0
- package/dist/lib/api/estimation/quotation-save.js +101 -0
- package/dist/lib/api/estimation/quote-check.d.ts +19 -0
- package/dist/lib/api/estimation/quote-check.js +28 -0
- package/dist/lib/api/estimation/quotepanel.d.ts +304 -0
- package/dist/lib/api/estimation/quotepanel.js +489 -0
- package/dist/lib/api/estimation/shipper-planning.d.ts +71 -0
- package/dist/lib/api/estimation/shipper-planning.js +208 -0
- package/dist/lib/api/estimation/wastage.d.ts +40 -0
- package/dist/lib/api/estimation/wastage.js +40 -0
- package/dist/lib/api/index.d.ts +7 -0
- package/dist/lib/api/index.js +17 -0
- package/dist/lib/api/integration/proxy.d.ts +7 -0
- package/dist/lib/api/integration/proxy.js +34 -0
- package/dist/lib/api/master/category.d.ts +126 -0
- package/dist/lib/api/master/category.js +208 -0
- package/dist/lib/api/master/company.d.ts +167 -0
- package/dist/lib/api/master/company.js +368 -0
- package/dist/lib/api/master/hsn.d.ts +36 -0
- package/dist/lib/api/master/hsn.js +54 -0
- package/dist/lib/api/master/index.d.ts +12 -0
- package/dist/lib/api/master/index.js +27 -0
- package/dist/lib/api/master/item.d.ts +158 -0
- package/dist/lib/api/master/item.js +135 -0
- package/dist/lib/api/master/ledger.d.ts +173 -0
- package/dist/lib/api/master/ledger.js +391 -0
- package/dist/lib/api/master/logistics.d.ts +117 -0
- package/dist/lib/api/master/logistics.js +107 -0
- package/dist/lib/api/master/machine.d.ts +406 -0
- package/dist/lib/api/master/machine.js +570 -0
- package/dist/lib/api/master/material-group.d.ts +97 -0
- package/dist/lib/api/master/material-group.js +96 -0
- package/dist/lib/api/master/other.d.ts +65 -0
- package/dist/lib/api/master/other.js +56 -0
- package/dist/lib/api/master/process-types.d.ts +178 -0
- package/dist/lib/api/master/process-types.js +4 -0
- package/dist/lib/api/master/process.d.ts +94 -0
- package/dist/lib/api/master/process.js +124 -0
- package/dist/lib/api/master/production-units.d.ts +10 -0
- package/dist/lib/api/master/production-units.js +15 -0
- package/dist/lib/api/master/rate.d.ts +174 -0
- package/dist/lib/api/master/rate.js +196 -0
- package/dist/lib/api/master/tool.d.ts +48 -0
- package/dist/lib/api/master/tool.js +80 -0
- package/dist/lib/api/master/user.d.ts +473 -0
- package/dist/lib/api/master/user.js +147 -0
- package/dist/lib/api/settings/erp-parameters.d.ts +33 -0
- package/dist/lib/api/settings/erp-parameters.js +61 -0
- package/dist/lib/api/utility/index.d.ts +1 -0
- package/dist/lib/api/utility/index.js +5 -0
- package/dist/lib/api/utility/menu.d.ts +32 -0
- package/dist/lib/api/utility/menu.js +128 -0
- package/dist/lib/auth.d.ts +3 -0
- package/dist/lib/auth.js +7 -0
- package/dist/lib/pwa.d.ts +8 -0
- package/dist/lib/pwa.js +53 -0
- package/dist/lib/react-query-config.d.ts +140 -0
- package/dist/lib/react-query-config.js +131 -0
- package/dist/lib/security/audit-logger.d.ts +71 -0
- package/dist/lib/security/audit-logger.js +173 -0
- package/dist/lib/security/rate-limiter.d.ts +28 -0
- package/dist/lib/security/rate-limiter.js +118 -0
- package/dist/lib/server-url.d.ts +18 -0
- package/dist/lib/server-url.js +70 -0
- package/dist/lib/svg-utils.d.ts +62 -0
- package/dist/lib/svg-utils.js +206 -0
- package/dist/lib/theme/types.d.ts +109 -0
- package/dist/lib/theme/types.js +231 -0
- package/dist/lib/theme/utils.d.ts +73 -0
- package/dist/lib/theme/utils.js +343 -0
- package/dist/lib/types/index.d.ts +58 -0
- package/dist/lib/types/index.js +2 -0
- package/dist/lib/utils/attachment-loader.d.ts +27 -0
- package/dist/lib/utils/attachment-loader.js +79 -0
- package/dist/lib/utils/client-lead-utils.d.ts +24 -0
- package/dist/lib/utils/client-lead-utils.js +56 -0
- package/dist/lib/utils/device-detection.d.ts +19 -0
- package/dist/lib/utils/device-detection.js +105 -0
- package/dist/lib/utils/logout-cleanup.d.ts +63 -0
- package/dist/lib/utils/logout-cleanup.js +297 -0
- package/dist/lib/utils/planning-prefs.d.ts +10 -0
- package/dist/lib/utils/planning-prefs.js +27 -0
- package/dist/lib/utils.d.ts +20 -0
- package/dist/lib/utils.js +60 -0
- package/dist/lib/vision/dieline-extractor.d.ts +38 -0
- package/dist/lib/vision/dieline-extractor.js +313 -0
- package/dist/lib/vision/reference-grid.d.ts +52 -0
- package/dist/lib/vision/reference-grid.js +241 -0
- package/dist/locales/de.json +79 -0
- package/dist/locales/en.json +2217 -0
- package/dist/locales/es.json +79 -0
- package/dist/locales/fr.json +78 -0
- package/dist/locales/hi.json +1599 -0
- package/dist/providers.d.ts +14 -0
- package/dist/providers.js +15 -0
- package/dist/services/GlobalLoadingService.d.ts +216 -0
- package/dist/services/GlobalLoadingService.js +216 -0
- package/dist/styles/grid-themes.css +346 -0
- package/dist/styles/index.css +5 -0
- package/dist/{sidebar-scrollbar-NBCB2OO2.css → styles/sidebar-scrollbar.css} +45 -45
- package/dist/styles/tokens.css +713 -0
- package/dist/types/approval.d.ts +201 -0
- package/dist/types/approval.js +19 -0
- package/dist/types/audit.d.ts +87 -0
- package/dist/types/audit.js +47 -0
- package/dist/types/draft.d.ts +142 -0
- package/dist/types/draft.js +19 -0
- package/dist/types/master.d.ts +154 -0
- package/dist/types/master.js +3 -0
- package/dist/types/shipper-planning.d.ts +277 -0
- package/dist/types/shipper-planning.js +6 -0
- package/package.json +187 -119
- package/dist/chunk-4PEFU7N7.js +0 -16
- package/dist/chunk-4PEFU7N7.js.map +0 -1
- package/dist/de-EKT7SUK5.js +0 -106
- package/dist/de-EKT7SUK5.js.map +0 -1
- package/dist/en-QRFSIEHD.js +0 -1685
- package/dist/en-QRFSIEHD.js.map +0 -1
- package/dist/es-KHZMWGUI.js +0 -106
- package/dist/es-KHZMWGUI.js.map +0 -1
- package/dist/fr-X2XUXSHK.js +0 -105
- package/dist/fr-X2XUXSHK.js.map +0 -1
- package/dist/hi-YRATOE5Q.js +0 -415
- package/dist/hi-YRATOE5Q.js.map +0 -1
- package/dist/index.cjs +0 -28216
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -3173
- package/dist/index.js.map +0 -1
- /package/{src → dist/cjs}/styles/index.css +0 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.AuthSessionProvider = AuthSessionProvider;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("next-auth/react");
|
|
7
|
+
const react_2 = require("react");
|
|
8
|
+
const session_expiry_warning_1 = require("../modals/session-expiry-warning.js");
|
|
9
|
+
const SessionAdapterContext_1 = require("../../contexts/SessionAdapterContext.js");
|
|
10
|
+
const logout_cleanup_1 = require("../../lib/utils/logout-cleanup.js");
|
|
11
|
+
const client_1 = require("../../lib/api/core/client.js");
|
|
12
|
+
// Session lifetime — MUST match `maxAge` in [...nextauth].ts (session + jwt + hard-expiry).
|
|
13
|
+
const SESSION_MAX_AGE_MS = 8 * 60 * 60 * 1000; // 8 hours
|
|
14
|
+
const WARNING_BEFORE_MS = 5 * 60 * 1000; // 5 minutes
|
|
15
|
+
const CHECK_INTERVAL_MS = 30000; // 30 seconds
|
|
16
|
+
// Session expiry monitor component
|
|
17
|
+
function SessionExpiryMonitor({ children }) {
|
|
18
|
+
const { data: session, status, update } = (0, react_1.useSession)();
|
|
19
|
+
const [showExpiryWarning, setShowExpiryWarning] = (0, react_2.useState)(false);
|
|
20
|
+
const [minutesRemaining, setMinutesRemaining] = (0, react_2.useState)(0);
|
|
21
|
+
// Guards against double-fire: the expiry timer, the status-flip effect, and the
|
|
22
|
+
// APIClient 401 handler can all reach logout near the same moment. Without this,
|
|
23
|
+
// performLogoutCleanup() runs concurrently (double IndexedDB delete, double redirect).
|
|
24
|
+
const hasLoggedOut = (0, react_2.useRef)(false);
|
|
25
|
+
const handleAutoLogout = async () => {
|
|
26
|
+
if (hasLoggedOut.current)
|
|
27
|
+
return;
|
|
28
|
+
hasLoggedOut.current = true;
|
|
29
|
+
try {
|
|
30
|
+
await (0, logout_cleanup_1.performLogoutCleanup)();
|
|
31
|
+
await (0, react_1.signOut)({ callbackUrl: '/login', redirect: true });
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
await (0, react_1.signOut)({ callbackUrl: '/login', redirect: true });
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
// Register global session-expired handler so APIClient 401s trigger sign-out
|
|
38
|
+
const autoLogoutRef = (0, react_2.useRef)(handleAutoLogout);
|
|
39
|
+
autoLogoutRef.current = handleAutoLogout;
|
|
40
|
+
(0, react_2.useEffect)(() => {
|
|
41
|
+
(0, client_1.setSessionExpiredHandler)(() => { autoLogoutRef.current(); });
|
|
42
|
+
}, []);
|
|
43
|
+
// Auto-logout ONLY on a confirmed authenticated→unauthenticated flip within this tab —
|
|
44
|
+
// i.e. the cookie was valid and then went away (hard expiry from the jwt callback, or
|
|
45
|
+
// logout in another tab). A freshly-opened tab reads the same shared cookie and is
|
|
46
|
+
// authenticated immediately; its brief `loading → unauthenticated → authenticated`
|
|
47
|
+
// flicker is NOT expiry and must never trigger logout — that was logging users out the
|
|
48
|
+
// instant they opened a second tab.
|
|
49
|
+
// Note: this intentionally does NOT redirect a tab that starts unauthenticated. Genuine
|
|
50
|
+
// expiry is caught by the loginTime+maxAge timer below and by the APIClient 401 handler;
|
|
51
|
+
// the rare "expired cookie + manual refresh before either notices" case is left to those.
|
|
52
|
+
const wasAuthenticated = (0, react_2.useRef)(false);
|
|
53
|
+
(0, react_2.useEffect)(() => {
|
|
54
|
+
if (status === 'authenticated') {
|
|
55
|
+
wasAuthenticated.current = true;
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (status === 'unauthenticated' && wasAuthenticated.current) {
|
|
59
|
+
wasAuthenticated.current = false;
|
|
60
|
+
handleAutoLogout();
|
|
61
|
+
}
|
|
62
|
+
}, [status]);
|
|
63
|
+
// Check session expiry on a timer.
|
|
64
|
+
// Expiry is derived from loginTime + SESSION_MAX_AGE_MS — NOT session.expires.
|
|
65
|
+
// session.expires does not reliably move forward on a manual update(), so it would
|
|
66
|
+
// fire logout at the original time even after Extend. loginTime IS reset by the jwt
|
|
67
|
+
// callback on Extend, so a successful extend produces a new session object → this
|
|
68
|
+
// effect re-runs with a fresh expiry and the timer re-arms correctly.
|
|
69
|
+
const loginTime = session?.user?.loginTime;
|
|
70
|
+
(0, react_2.useEffect)(() => {
|
|
71
|
+
if (status !== "authenticated" || !loginTime)
|
|
72
|
+
return;
|
|
73
|
+
const expiryMs = new Date(loginTime).getTime() + SESSION_MAX_AGE_MS;
|
|
74
|
+
const tick = () => {
|
|
75
|
+
const timeUntilExpiry = expiryMs - Date.now();
|
|
76
|
+
if (timeUntilExpiry <= 0) {
|
|
77
|
+
handleAutoLogout();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (timeUntilExpiry <= WARNING_BEFORE_MS) {
|
|
81
|
+
setMinutesRemaining(Math.ceil(timeUntilExpiry / (60 * 1000)));
|
|
82
|
+
setShowExpiryWarning(true);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
// Extend pushed expiry back out — clear any stale warning.
|
|
86
|
+
setShowExpiryWarning(false);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
tick(); // run immediately so a re-arm after Extend reflects right away
|
|
90
|
+
const interval = setInterval(tick, CHECK_INTERVAL_MS);
|
|
91
|
+
return () => clearInterval(interval);
|
|
92
|
+
}, [loginTime, status]);
|
|
93
|
+
const handleExtendSession = async () => {
|
|
94
|
+
try {
|
|
95
|
+
// Resets loginTime on the server (jwt trigger==='update'); the returned session
|
|
96
|
+
// re-arms the expiry timer above. Hide the warning optimistically.
|
|
97
|
+
setShowExpiryWarning(false);
|
|
98
|
+
await update();
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
console.error('Session extend error:', error);
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const handleLogoutNow = async () => {
|
|
105
|
+
setShowExpiryWarning(false);
|
|
106
|
+
await handleAutoLogout();
|
|
107
|
+
};
|
|
108
|
+
// Stable identity: a fresh function per render would rebuild the adapter value and
|
|
109
|
+
// re-fire every consumer keyed on the session (ModuleAuth permission refetch).
|
|
110
|
+
const adapterSignOut = (0, react_2.useCallback)(async (options) => {
|
|
111
|
+
await (0, react_1.signOut)({ callbackUrl: options?.callbackUrl ?? "/login", redirect: options?.redirect ?? true });
|
|
112
|
+
}, []);
|
|
113
|
+
return (
|
|
114
|
+
// Feed the auth-agnostic adapter so layout components never import next-auth themselves.
|
|
115
|
+
(0, jsx_runtime_1.jsxs)(SessionAdapterContext_1.SessionAdapterProvider, { user: session?.user ?? null, status: status, signOut: adapterSignOut, children: [children, (0, jsx_runtime_1.jsx)(session_expiry_warning_1.SessionExpiryWarning, { isOpen: showExpiryWarning, onExtend: handleExtendSession, onLogout: handleLogoutNow, minutesRemaining: minutesRemaining })] }));
|
|
116
|
+
}
|
|
117
|
+
function AuthSessionProvider({ children, session }) {
|
|
118
|
+
return ((0, jsx_runtime_1.jsx)(react_1.SessionProvider, { session: session, refetchInterval: 5 * 60, refetchOnWindowFocus: false, children: (0, jsx_runtime_1.jsx)(SessionExpiryMonitor, { children: children }) }));
|
|
119
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ThemeCustomizer = ThemeCustomizer;
|
|
5
|
+
exports.ThemeToggle = ThemeToggle;
|
|
6
|
+
exports.QuickThemeSwitcher = QuickThemeSwitcher;
|
|
7
|
+
exports.ThemeVariantSelector = ThemeVariantSelector;
|
|
8
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const useTheme_1 = require("../../hooks/useTheme.js");
|
|
11
|
+
const ui_1 = require("../ui/index.js");
|
|
12
|
+
const ui_2 = require("../ui/index.js");
|
|
13
|
+
const ui_3 = require("../ui/index.js");
|
|
14
|
+
const ui_4 = require("../ui/index.js");
|
|
15
|
+
const ui_5 = require("../ui/index.js");
|
|
16
|
+
const ui_6 = require("../ui/index.js");
|
|
17
|
+
const useTranslation_1 = require("../../hooks/useTranslation.js");
|
|
18
|
+
const lucide_react_1 = require("lucide-react");
|
|
19
|
+
// Define theme variants outside component to avoid translation issues with t()
|
|
20
|
+
const getThemeVariants = (t) => [
|
|
21
|
+
{
|
|
22
|
+
variant: 'default',
|
|
23
|
+
name: t('Default'),
|
|
24
|
+
description: t('Modern blue tones - Professional and trustworthy'),
|
|
25
|
+
color: '#003366',
|
|
26
|
+
gradient: 'from-blue-900 to-blue-700'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
variant: 'green',
|
|
30
|
+
name: t('Forest'),
|
|
31
|
+
description: t('Nature-inspired greens - Growth and harmony'),
|
|
32
|
+
color: '#047857',
|
|
33
|
+
gradient: 'from-green-700 to-emerald-600'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
variant: 'red',
|
|
37
|
+
name: t('Crimson'),
|
|
38
|
+
description: t('Bold red accents - Energy and passion'),
|
|
39
|
+
color: '#B91C1C',
|
|
40
|
+
gradient: 'from-red-700 to-rose-600'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
variant: 'purple',
|
|
44
|
+
name: t('Royal'),
|
|
45
|
+
description: t('Regal purple hues - Luxury and creativity'),
|
|
46
|
+
color: '#7C3AED',
|
|
47
|
+
gradient: 'from-purple-700 to-violet-600'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
variant: 'orange',
|
|
51
|
+
name: t('Sunset'),
|
|
52
|
+
description: t('Warm sunset palette - Optimism and warmth'),
|
|
53
|
+
color: '#C2410C',
|
|
54
|
+
gradient: 'from-orange-700 to-amber-600'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
variant: 'black',
|
|
58
|
+
name: t('Midnight'),
|
|
59
|
+
description: t('Deep night shades - Sophistication and depth'),
|
|
60
|
+
color: '#000000',
|
|
61
|
+
gradient: 'from-gray-900 to-black'
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
variant: 'custom',
|
|
65
|
+
name: t('Custom Color'),
|
|
66
|
+
description: t('AI Generated'),
|
|
67
|
+
color: '#1a365d',
|
|
68
|
+
gradient: 'from-indigo-900 to-blue-800'
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
function ThemeCustomizerContent({ showModeToggle = true, compact = false }) {
|
|
72
|
+
const { t } = (0, useTranslation_1.useTranslation)();
|
|
73
|
+
const { theme, setVariant, setMode, toggleMode, isDark, customTheme, removeCustomTheme } = (0, useTheme_1.useTheme)();
|
|
74
|
+
const { generateFromColor } = (0, useTheme_1.useCustomThemeGenerator)();
|
|
75
|
+
const [customColor, setCustomColor] = (0, react_1.useState)('#3B82F6');
|
|
76
|
+
const [customName, setCustomName] = (0, react_1.useState)('');
|
|
77
|
+
const [isGenerating, setIsGenerating] = (0, react_1.useState)(false);
|
|
78
|
+
// Get translated theme variants
|
|
79
|
+
const THEME_VARIANTS = getThemeVariants(t);
|
|
80
|
+
const handleVariantChange = (variant) => {
|
|
81
|
+
setVariant(variant);
|
|
82
|
+
};
|
|
83
|
+
const handleCustomColorGenerate = async () => {
|
|
84
|
+
if (!customColor)
|
|
85
|
+
return;
|
|
86
|
+
setIsGenerating(true);
|
|
87
|
+
try {
|
|
88
|
+
const result = generateFromColor(customColor, customName || t('Custom Color'));
|
|
89
|
+
if (!result.success) {
|
|
90
|
+
console.error('Failed to generate theme:', result.error);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
finally {
|
|
94
|
+
setIsGenerating(false);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
if (compact) {
|
|
98
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex gap-1 p-1 bg-[rgb(var(--bg-subtle))] rounded-lg", children: THEME_VARIANTS.slice(0, 5).map(({ variant, color, name }) => ((0, jsx_runtime_1.jsx)("button", { onClick: () => handleVariantChange(variant), className: `w-8 h-8 rounded border-2 transition-all hover:scale-110 ${theme.variant === variant
|
|
99
|
+
? 'border-[rgb(var(--bd-accent))] ring-2 ring-[rgb(var(--color-primary))] ring-offset-2'
|
|
100
|
+
: 'border-[rgb(var(--bd-default))] hover:border-[rgb(var(--bd-strong))]'}`, style: { backgroundColor: color }, title: name }, variant))) }), showModeToggle && ((0, jsx_runtime_1.jsx)(ui_1.Button, { onClick: toggleMode, variant: "outline", size: "sm", className: "gap-2", title: `Switch to ${isDark ? 'light' : 'dark'} mode`, children: isDark ? (0, jsx_runtime_1.jsx)(lucide_react_1.Sun, { className: "h-4 w-4" }) : (0, jsx_runtime_1.jsx)(lucide_react_1.Moon, { className: "h-4 w-4" }) }))] }));
|
|
101
|
+
}
|
|
102
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[rgb(var(--bg-subtle))] rounded-lg border border-[rgb(var(--bd-default))]", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "p-2 bg-gradient-to-br from-[rgb(var(--color-primary))] to-[rgb(var(--color-secondary))] rounded-lg", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Palette, { className: "h-5 w-5 text-white" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("p", { className: "text-sm font-semibold text-[rgb(var(--fg-default))]", children: t('Theme Customizer') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-[rgb(var(--fg-muted))]", children: t('Full control over your app appearance') })] })] }), showModeToggle && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2.5", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-sm font-medium text-[rgb(var(--fg-default))] hidden sm:block", children: isDark ? t('Dark mode') : t('Light mode') }), (0, jsx_runtime_1.jsx)(ui_4.Switch, { checked: isDark, onCheckedChange: toggleMode })] }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("h4", { className: "text-sm font-medium text-[rgb(var(--fg-default))]", children: t('Color Themes') }), (0, jsx_runtime_1.jsxs)(ui_5.Badge, { variant: "secondary", className: "text-xs gap-1", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Zap, { className: "h-3 w-3" }), t('Primary/Secondary/Tertiary')] })] }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-3 gap-2", children: THEME_VARIANTS.filter(v => v.variant !== 'custom').map(({ variant, name, color }) => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => handleVariantChange(variant), className: `group flex flex-col items-center gap-2 p-3 rounded-lg border-2 transition-all hover:bg-[rgb(var(--bg-hover))] ${theme.variant === variant
|
|
103
|
+
? 'border-[rgb(var(--color-primary))] bg-[rgb(var(--bg-subtle))] ring-2 ring-[rgb(var(--color-primary))] ring-offset-1'
|
|
104
|
+
: 'border-[rgb(var(--bd-default))]'}`, title: THEME_VARIANTS.find(t => t.variant === variant)?.description, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex gap-0.5 w-full h-12", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex-1 rounded-l", style: { backgroundColor: color }, title: t('Primary') }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1", style: { backgroundColor: color, opacity: 0.7 }, title: t('Secondary') }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 rounded-r", style: { backgroundColor: color, opacity: 0.4 }, title: t('Tertiary') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 w-full justify-center", children: [(0, jsx_runtime_1.jsx)("span", { className: "font-medium text-xs text-[rgb(var(--fg-default))] truncate", children: name.replace(' Navy', '').replace(' Green', '').replace(' Red', '').replace(' Purple', '').replace(' Orange', '').replace(' Black', '') }), theme.variant === variant && ((0, jsx_runtime_1.jsx)(lucide_react_1.Check, { className: "h-3.5 w-3.5 text-[rgb(var(--color-primary))] flex-shrink-0" }))] })] }, variant))) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsx)("h4", { className: "text-sm font-medium text-[rgb(var(--fg-default))]", children: t('Custom Color') }), (0, jsx_runtime_1.jsxs)(ui_5.Badge, { variant: "secondary", className: "text-xs gap-1", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Sparkles, { className: "h-3 w-3" }), t('AI Generated')] })] }), (0, jsx_runtime_1.jsx)("div", { className: "p-3 bg-gradient-to-br from-[rgb(var(--bg-subtle))] to-transparent rounded-lg border-2 border-[rgb(var(--bd-default))]", children: (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "block text-xs font-medium text-[rgb(var(--fg-muted))] mb-2", children: t('Theme Name') }), (0, jsx_runtime_1.jsx)(ui_3.Input, { value: customName, onChange: (e) => {
|
|
105
|
+
setCustomName(e.target.value);
|
|
106
|
+
// Auto-switch to custom theme when typing
|
|
107
|
+
if (e.target.value && theme.variant !== 'custom') {
|
|
108
|
+
handleVariantChange('custom');
|
|
109
|
+
}
|
|
110
|
+
}, placeholder: t('e.g., Indas Brand Theme'), className: "text-sm" })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "block text-xs font-medium text-[rgb(var(--fg-default))] mb-2", children: t('Primary Brand Color') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)("input", { type: "color", value: customColor, onChange: (e) => {
|
|
111
|
+
setCustomColor(e.target.value);
|
|
112
|
+
// Auto-switch to custom theme and auto-generate
|
|
113
|
+
if (theme.variant !== 'custom') {
|
|
114
|
+
handleVariantChange('custom');
|
|
115
|
+
}
|
|
116
|
+
// Auto-generate after color change
|
|
117
|
+
setTimeout(() => handleCustomColorGenerate(), 300);
|
|
118
|
+
}, className: "w-10 h-10 rounded border-2 border-[rgb(var(--bd-default))] cursor-pointer", title: "Pick color" }), (0, jsx_runtime_1.jsx)(ui_3.Input, { value: customColor, onChange: (e) => {
|
|
119
|
+
setCustomColor(e.target.value);
|
|
120
|
+
// Auto-switch to custom theme when typing
|
|
121
|
+
if (e.target.value && theme.variant !== 'custom') {
|
|
122
|
+
handleVariantChange('custom');
|
|
123
|
+
}
|
|
124
|
+
}, onBlur: handleCustomColorGenerate, placeholder: "#3B82F6", className: "text-sm font-mono flex-1" })] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-2 bg-[rgb(var(--bg-surface))] rounded border border-[rgb(var(--bd-default))]", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-[10px] font-medium text-[rgb(var(--fg-muted))] mb-1.5", children: t('Live Preview') }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-3 gap-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-10 rounded flex items-center justify-center text-white text-[9px] font-semibold", style: { backgroundColor: customColor }, children: t('Primary') }), (0, jsx_runtime_1.jsx)("div", { className: "h-10 rounded flex items-center justify-center text-white text-[9px] font-semibold", style: {
|
|
125
|
+
backgroundColor: (() => {
|
|
126
|
+
const hex = customColor;
|
|
127
|
+
const rgb = parseInt(hex.slice(1), 16);
|
|
128
|
+
const r = Math.min(255, ((rgb >> 16) & 255) + 25);
|
|
129
|
+
const g = Math.min(255, ((rgb >> 8) & 255) + 25);
|
|
130
|
+
const b = Math.min(255, (rgb & 255) + 25);
|
|
131
|
+
return `rgb(${r}, ${g}, ${b})`;
|
|
132
|
+
})()
|
|
133
|
+
}, children: t('Secondary') }), (0, jsx_runtime_1.jsx)("div", { className: "h-10 rounded flex items-center justify-center text-white text-[9px] font-semibold", style: {
|
|
134
|
+
backgroundColor: (() => {
|
|
135
|
+
const hex = customColor;
|
|
136
|
+
const rgb = parseInt(hex.slice(1), 16);
|
|
137
|
+
const r = Math.min(255, ((rgb >> 16) & 255) + 50);
|
|
138
|
+
const g = Math.min(255, ((rgb >> 8) & 255) + 50);
|
|
139
|
+
const b = Math.min(255, (rgb & 255) + 50);
|
|
140
|
+
return `rgb(${r}, ${g}, ${b})`;
|
|
141
|
+
})()
|
|
142
|
+
}, children: t('Tertiary') })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-2", children: [(0, jsx_runtime_1.jsx)(ui_1.Button, { onClick: handleCustomColorGenerate, disabled: isGenerating || !customColor, className: "flex-1", size: "sm", children: isGenerating ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: "h-3.5 w-3.5 mr-2 animate-spin" }), t('Loading...')] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Sparkles, { className: "h-3.5 w-3.5 mr-2" }), t('Apply Theme')] })) }), customTheme && ((0, jsx_runtime_1.jsx)(ui_1.Button, { onClick: removeCustomTheme, variant: "outline", size: "sm", children: t('Reset') }))] })] })] }) })] })] }));
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* ThemeCustomizer - Universal Theme Component
|
|
146
|
+
*
|
|
147
|
+
* Supports multiple modes:
|
|
148
|
+
* - Card mode (for settings pages)
|
|
149
|
+
* - Dialog mode (for header/floating popup)
|
|
150
|
+
* - Compact mode (for toolbar/quick access)
|
|
151
|
+
*/
|
|
152
|
+
function ThemeCustomizer({ className, showModeToggle = true, compact = false, mode = 'card', open, onOpenChange }) {
|
|
153
|
+
const { t } = (0, useTranslation_1.useTranslation)();
|
|
154
|
+
// Dialog Mode
|
|
155
|
+
if (mode === 'dialog') {
|
|
156
|
+
return ((0, jsx_runtime_1.jsx)(ui_6.Dialog, { open: open, onOpenChange: onOpenChange, children: (0, jsx_runtime_1.jsxs)(ui_6.DialogContent, { className: "max-w-2xl max-h-[90vh] overflow-y-auto", children: [(0, jsx_runtime_1.jsx)(ui_6.DialogHeader, { children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "p-2 bg-gradient-to-br from-[rgb(var(--color-primary))] to-[rgb(var(--color-secondary))] rounded-lg", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Palette, { className: "h-5 w-5 text-white" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(ui_6.DialogTitle, { className: "text-lg", children: t('Theme Customizer') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs text-[rgb(var(--fg-muted))] mt-1", children: t('Full control over your app appearance') })] })] }) }), (0, jsx_runtime_1.jsx)(ThemeCustomizerContent, { showModeToggle: showModeToggle, compact: compact })] }) }));
|
|
157
|
+
}
|
|
158
|
+
// Card Mode (default)
|
|
159
|
+
return ((0, jsx_runtime_1.jsx)(ui_2.Card, { className: className, children: (0, jsx_runtime_1.jsx)(ui_2.CardContent, { className: "pt-6", children: (0, jsx_runtime_1.jsx)(ThemeCustomizerContent, { showModeToggle: showModeToggle, compact: compact }) }) }));
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Floating Theme Toggle Button - Quick Access
|
|
163
|
+
*/
|
|
164
|
+
function ThemeToggle({ className }) {
|
|
165
|
+
const { isDark, toggleMode } = (0, useTheme_1.useTheme)();
|
|
166
|
+
return ((0, jsx_runtime_1.jsx)(ui_1.Button, { onClick: toggleMode, variant: "outline", size: "sm", className: `fixed bottom-4 left-4 z-50 rounded-full w-12 h-12 p-0 shadow-lg hover:shadow-xl transition-all ${className}`, title: `Switch to ${isDark ? 'light' : 'dark'} mode`, children: isDark ? (0, jsx_runtime_1.jsx)(lucide_react_1.Sun, { className: "h-5 w-5" }) : (0, jsx_runtime_1.jsx)(lucide_react_1.Moon, { className: "h-5 w-5" }) }));
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Quick Theme Switcher - Compact Inline Version
|
|
170
|
+
*/
|
|
171
|
+
function QuickThemeSwitcher({ className }) {
|
|
172
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: className, children: (0, jsx_runtime_1.jsx)(ThemeCustomizerContent, { compact: true }) }));
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Theme Variant Selector - Ultra Compact
|
|
176
|
+
*/
|
|
177
|
+
function ThemeVariantSelector({ className }) {
|
|
178
|
+
const { t } = (0, useTranslation_1.useTranslation)();
|
|
179
|
+
const { theme, setVariant } = (0, useTheme_1.useTheme)();
|
|
180
|
+
const THEME_VARIANTS = getThemeVariants(t);
|
|
181
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: `flex gap-1 p-1 bg-[rgb(var(--bg-subtle))] rounded-lg ${className}`, children: THEME_VARIANTS.slice(0, 5).map(({ variant, color, name }) => ((0, jsx_runtime_1.jsx)("button", { onClick: () => setVariant(variant), className: `w-6 h-6 rounded border-2 transition-all ${theme.variant === variant
|
|
182
|
+
? 'border-[rgb(var(--bd-accent))] scale-110'
|
|
183
|
+
: 'border-[rgb(var(--bd-default))] hover:border-[rgb(var(--bd-strong))]'}`, style: { backgroundColor: color }, title: name }, variant))) }));
|
|
184
|
+
}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.Button = exports.FilterPillButton = exports.InputButton = exports.CheckboxButton = void 0;
|
|
38
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
+
const React = __importStar(require("react"));
|
|
40
|
+
const utils_1 = require("../../../lib/utils.js");
|
|
41
|
+
const lucide_react_1 = require("lucide-react");
|
|
42
|
+
const STORAGE_KEY = 'fab-btn-pos';
|
|
43
|
+
function DraggableFAB({ onClick, disabled, tooltip, children }) {
|
|
44
|
+
const [pos, setPos] = React.useState(null);
|
|
45
|
+
const dragging = React.useRef(false);
|
|
46
|
+
const hasMoved = React.useRef(false);
|
|
47
|
+
const startPointer = React.useRef({ x: 0, y: 0 });
|
|
48
|
+
const startPos = React.useRef({ x: 0, y: 0 });
|
|
49
|
+
const ref = React.useRef(null);
|
|
50
|
+
React.useEffect(() => {
|
|
51
|
+
try {
|
|
52
|
+
const saved = localStorage.getItem(STORAGE_KEY);
|
|
53
|
+
if (saved) {
|
|
54
|
+
setPos(JSON.parse(saved));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch { }
|
|
59
|
+
setPos({ x: window.innerWidth - 72, y: window.innerHeight - 120 });
|
|
60
|
+
}, []);
|
|
61
|
+
const clamp = (v, min, max) => Math.min(Math.max(v, min), max);
|
|
62
|
+
const onPointerDown = (e) => {
|
|
63
|
+
dragging.current = true;
|
|
64
|
+
hasMoved.current = false;
|
|
65
|
+
startPointer.current = { x: e.clientX, y: e.clientY };
|
|
66
|
+
const rect = ref.current.getBoundingClientRect();
|
|
67
|
+
startPos.current = { x: rect.left, y: rect.top };
|
|
68
|
+
ref.current.setPointerCapture(e.pointerId);
|
|
69
|
+
e.preventDefault();
|
|
70
|
+
};
|
|
71
|
+
const onPointerMove = (e) => {
|
|
72
|
+
if (!dragging.current)
|
|
73
|
+
return;
|
|
74
|
+
const dx = e.clientX - startPointer.current.x;
|
|
75
|
+
const dy = e.clientY - startPointer.current.y;
|
|
76
|
+
if (Math.abs(dx) > 4 || Math.abs(dy) > 4)
|
|
77
|
+
hasMoved.current = true;
|
|
78
|
+
const newPos = {
|
|
79
|
+
x: clamp(startPos.current.x + dx, 0, window.innerWidth - 56),
|
|
80
|
+
y: clamp(startPos.current.y + dy, 0, window.innerHeight - 56),
|
|
81
|
+
};
|
|
82
|
+
setPos(newPos);
|
|
83
|
+
};
|
|
84
|
+
const onPointerUp = (e) => {
|
|
85
|
+
if (!dragging.current)
|
|
86
|
+
return;
|
|
87
|
+
dragging.current = false;
|
|
88
|
+
if (pos)
|
|
89
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify(pos));
|
|
90
|
+
if (!hasMoved.current)
|
|
91
|
+
onClick?.(e);
|
|
92
|
+
e.preventDefault();
|
|
93
|
+
};
|
|
94
|
+
if (!pos)
|
|
95
|
+
return null;
|
|
96
|
+
return ((0, jsx_runtime_1.jsx)("button", { ref: ref, disabled: disabled, style: { left: pos.x, top: pos.y, touchAction: 'none' }, className: (0, utils_1.cn)("fixed z-50 lg:hidden", "h-14 w-14 rounded-xl shadow-lg rotate-45", "bg-[rgb(var(--color-primary))]/50 hover:bg-[rgb(var(--color-primary))]/65", "border-2 border-[rgb(var(--color-primary))]/60 hover:border-[rgb(var(--color-primary))]/75", "transition-colors duration-200 flex items-center justify-center", "disabled:opacity-50 disabled:cursor-not-allowed"), title: tooltip, onPointerDown: onPointerDown, onPointerMove: onPointerMove, onPointerUp: onPointerUp, children: children }));
|
|
97
|
+
}
|
|
98
|
+
// Helper to check if value is a valid React element (already rendered JSX)
|
|
99
|
+
const isReactElement = (value) => {
|
|
100
|
+
return React.isValidElement(value);
|
|
101
|
+
};
|
|
102
|
+
// Helper to check if value is a React component (function or forwardRef)
|
|
103
|
+
const isReactComponent = (value) => {
|
|
104
|
+
return typeof value === 'function' || (value && typeof value === 'object' && '$$typeof' in value);
|
|
105
|
+
};
|
|
106
|
+
const buttonVariants = {
|
|
107
|
+
primary: "bg-primary text-primary-foreground hover:bg-primary-hover focus-ring active:opacity-90",
|
|
108
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-hover focus-ring active:opacity-90",
|
|
109
|
+
tertiary: "bg-tertiary text-tertiary-foreground hover:bg-tertiary-hover focus-ring active:opacity-90",
|
|
110
|
+
outline: "border border-bd-default bg-bg-surface text-fg-default hover:bg-bg-hover focus-ring active:bg-bg-hover",
|
|
111
|
+
ghost: "text-fg-default hover:bg-bg-hover focus-ring active:bg-bg-hover",
|
|
112
|
+
destructive: "bg-error text-fg-inverse hover:bg-error-hover focus-ring-error active:opacity-90",
|
|
113
|
+
// Footer-specific variants with inline primary color styles
|
|
114
|
+
'footer-primary': "border-primary transition-opacity duration-200 hover:opacity-90 disabled:opacity-50",
|
|
115
|
+
'footer-secondary': "transition-opacity duration-200 hover:opacity-80 disabled:opacity-50",
|
|
116
|
+
// Action button variants with CSS variable colors (dark mode compatible)
|
|
117
|
+
'action-create': "bg-[rgb(var(--color-primary))]/10 hover:bg-[rgb(var(--color-primary))]/20 text-[rgb(var(--color-primary))] border border-[rgb(var(--color-primary))]/20",
|
|
118
|
+
'action-save': "bg-[rgb(var(--color-success))]/10 hover:bg-[rgb(var(--color-success))]/20 text-[rgb(var(--color-success))] border border-[rgb(var(--color-success))]/20",
|
|
119
|
+
'action-save-as': "bg-[rgb(var(--color-sky))]/10 hover:bg-[rgb(var(--color-sky))]/20 text-[rgb(var(--color-sky))] border border-[rgb(var(--color-sky))]/20",
|
|
120
|
+
'action-edit': "bg-[rgb(var(--color-warning))]/10 hover:bg-[rgb(var(--color-warning))]/20 text-[rgb(var(--color-warning))] border border-[rgb(var(--color-warning))]/20",
|
|
121
|
+
'action-delete': "bg-[rgb(var(--color-error))]/10 hover:bg-[rgb(var(--color-error))]/20 text-[rgb(var(--color-error))] border border-[rgb(var(--color-error))]/20",
|
|
122
|
+
'action-print': "bg-[rgb(var(--color-purple))]/10 hover:bg-[rgb(var(--color-purple))]/20 text-[rgb(var(--color-purple))] border border-[rgb(var(--color-purple))]/20",
|
|
123
|
+
'action-send': "bg-[rgb(var(--color-info))]/10 hover:bg-[rgb(var(--color-info))]/20 text-[rgb(var(--color-info))] border border-[rgb(var(--color-info))]/20",
|
|
124
|
+
'action-mail': "bg-[rgb(var(--color-error))]/10 hover:bg-[rgb(var(--color-error))]/20 text-[rgb(var(--color-error))] border border-[rgb(var(--color-error))]/20",
|
|
125
|
+
'action-download': "bg-[rgb(var(--color-success))]/10 hover:bg-[rgb(var(--color-success))]/20 text-[rgb(var(--color-success))] border border-[rgb(var(--color-success))]/20",
|
|
126
|
+
'action-refresh': "bg-[rgb(var(--color-neutral))]/10 hover:bg-[rgb(var(--color-neutral))]/20 text-[rgb(var(--color-neutral))] border border-[rgb(var(--color-neutral))]/20",
|
|
127
|
+
'action-cancel': "bg-[rgb(var(--bg-surface))] hover:bg-[rgb(var(--bg-subtle))] text-[rgb(var(--fg-default))] border border-[rgb(var(--bd-default))]",
|
|
128
|
+
'action-secondary': "bg-[rgb(var(--bg-surface))] hover:bg-[rgb(var(--bg-hover))] text-[rgb(var(--fg-default))] border border-[rgb(var(--bd-default))]",
|
|
129
|
+
'action-apply': "bg-[rgb(var(--color-teal))]/10 hover:bg-[rgb(var(--color-teal))]/20 text-[rgb(var(--color-teal))] border border-[rgb(var(--color-teal))]/20",
|
|
130
|
+
'action-back': "bg-[rgb(var(--bg-surface))] hover:bg-[rgb(var(--bg-subtle))] text-[rgb(var(--fg-default))] border border-[rgb(var(--bd-default))]"
|
|
131
|
+
};
|
|
132
|
+
const buttonSizes = {
|
|
133
|
+
xs: "h-6 px-2 py-1 text-xs font-medium", // Extra small - for card headers, compact UI
|
|
134
|
+
sm: "h-8 px-3 text-sm font-medium",
|
|
135
|
+
md: "h-10 px-4 text-sm font-medium",
|
|
136
|
+
lg: "h-12 px-6 text-base font-medium",
|
|
137
|
+
footer: "px-3 py-1.5 text-xs font-medium", // Compact footer size
|
|
138
|
+
action: "h-8 px-2 sm:px-3 text-[11px] sm:text-xs font-medium" // Action button size — compact on mobile
|
|
139
|
+
};
|
|
140
|
+
const iconOnlySizes = {
|
|
141
|
+
xs: "w-6 h-6 text-sm",
|
|
142
|
+
sm: "w-8 h-8 text-base",
|
|
143
|
+
md: "w-9 h-9 text-lg",
|
|
144
|
+
lg: "w-10 h-10 text-xl",
|
|
145
|
+
footer: "w-8 h-8 text-base",
|
|
146
|
+
action: "w-9 h-9 text-lg"
|
|
147
|
+
};
|
|
148
|
+
const Button = React.forwardRef(({ className, variant = 'primary', size = 'md', loading = false, icon: Icon, iconPosition = 'left', iconOnly = false, tooltip, fab = false, children, disabled, style, ...props }, ref) => {
|
|
149
|
+
const isDisabled = disabled || loading;
|
|
150
|
+
// Check if it's an action button variant
|
|
151
|
+
const isActionButton = variant?.startsWith('action-');
|
|
152
|
+
// Automatically use 'action' size for action button variants
|
|
153
|
+
const buttonSize = isActionButton && size === 'md' ? 'action' : size;
|
|
154
|
+
// Auto-assign icons for specific action variants if no icon provided
|
|
155
|
+
let resolvedIcon = Icon;
|
|
156
|
+
if (!Icon) {
|
|
157
|
+
if (variant === 'action-apply')
|
|
158
|
+
resolvedIcon = lucide_react_1.CheckCircle;
|
|
159
|
+
if (variant === 'action-cancel')
|
|
160
|
+
resolvedIcon = lucide_react_1.XCircle;
|
|
161
|
+
}
|
|
162
|
+
// FAB mode: inline button on desktop + floating circular button on mobile
|
|
163
|
+
if (fab && resolvedIcon) {
|
|
164
|
+
// Parkbuddy style: icon is h-8 w-8 stroke-[3] with primary color text
|
|
165
|
+
const fabIcon = isReactElement(resolvedIcon)
|
|
166
|
+
? resolvedIcon
|
|
167
|
+
: isReactComponent(resolvedIcon)
|
|
168
|
+
? React.createElement(resolvedIcon, { className: 'h-8 w-8 -rotate-45 text-[rgb(var(--color-primary))] stroke-[1.5]' })
|
|
169
|
+
: null;
|
|
170
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("button", { className: (0, utils_1.cn)("inline-flex items-center justify-center gap-2 transition-all duration-200", "disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none", isActionButton ? "rounded-lg" : "rounded-md", buttonVariants[variant], buttonSizes[buttonSize], "hidden lg:inline-flex", className), ref: ref, disabled: isDisabled, style: style, title: tooltip, ...props, children: [resolvedIcon && iconPosition === 'left' && !loading && (isReactElement(resolvedIcon) ? resolvedIcon
|
|
171
|
+
: isReactComponent(resolvedIcon) ? React.createElement(resolvedIcon, { className: isActionButton ? 'h-4 w-4' : 'h-4 w-4' })
|
|
172
|
+
: null), children] }), (0, jsx_runtime_1.jsx)(DraggableFAB, { onClick: props.onClick, disabled: isDisabled, tooltip: tooltip, children: fabIcon })] }));
|
|
173
|
+
}
|
|
174
|
+
// Icon-only mode: circular button with just icon
|
|
175
|
+
if (iconOnly) {
|
|
176
|
+
// For icon-only buttons, use ghost variant by default if not specified
|
|
177
|
+
const iconOnlyVariant = variant === 'primary' ? 'ghost' : variant;
|
|
178
|
+
return ((0, jsx_runtime_1.jsx)("button", { ref: ref, type: "button", title: tooltip, disabled: isDisabled, className: (0, utils_1.cn)('inline-flex items-center justify-center', 'rounded-full border-0', 'transition-colors duration-150 ease-in-out', 'focus:outline-none focus-visible:ring-2 focus-visible:ring-[rgb(var(--color-primary))] focus-visible:ring-offset-2', 'disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none', iconOnlyVariant === 'ghost' && [
|
|
179
|
+
'text-[rgb(var(--fg-muted))]',
|
|
180
|
+
'hover:bg-[rgb(var(--bg-hover))]',
|
|
181
|
+
'active:bg-[rgb(var(--bg-subtle))]'
|
|
182
|
+
], iconOnlyVariant !== 'ghost' && buttonVariants[iconOnlyVariant], iconOnlySizes[buttonSize], className), style: style, ...props, children: loading ? ((0, jsx_runtime_1.jsxs)("svg", { className: "animate-spin h-4 w-4", fill: "none", viewBox: "0 0 24 24", children: [(0, jsx_runtime_1.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), (0, jsx_runtime_1.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] })) : Icon && isReactElement(Icon) ? (Icon) : Icon && isReactComponent(Icon) ? (React.createElement(Icon, { className: buttonSize === 'footer' ? 'h-3.5 w-3.5' : 'h-5 w-5' })) : null }));
|
|
183
|
+
}
|
|
184
|
+
// Apply inline styles for footer variants (uses CSS variables)
|
|
185
|
+
const footerStyles = variant === 'footer-primary'
|
|
186
|
+
? { backgroundColor: 'rgb(var(--color-primary))', color: 'rgb(var(--color-primary-foreground))', ...style }
|
|
187
|
+
: variant === 'footer-secondary'
|
|
188
|
+
? { borderColor: 'rgb(var(--color-primary))', color: 'rgb(var(--color-primary))', ...style }
|
|
189
|
+
: style;
|
|
190
|
+
// Action buttons: icon-only on mobile — ONLY when children is simple text
|
|
191
|
+
// Buttons with complex children (badges, chevrons, JSX) keep their full layout
|
|
192
|
+
const actionIconOnly = isActionButton && resolvedIcon && typeof children === 'string';
|
|
193
|
+
return ((0, jsx_runtime_1.jsxs)("button", { className: (0, utils_1.cn)(
|
|
194
|
+
// Base styles
|
|
195
|
+
"inline-flex items-center justify-center transition-all duration-200", "disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none",
|
|
196
|
+
// Gap — tighter on mobile for action buttons
|
|
197
|
+
isActionButton ? "gap-1 sm:gap-1.5" : "gap-2",
|
|
198
|
+
// Border radius - action buttons use rounded-lg, others use rounded-md
|
|
199
|
+
isActionButton ? "rounded-lg" : "rounded-md",
|
|
200
|
+
// Variant styles
|
|
201
|
+
buttonVariants[variant],
|
|
202
|
+
// Size styles
|
|
203
|
+
buttonSizes[buttonSize],
|
|
204
|
+
// Action buttons: square icon-only on mobile (< sm), icon + text on sm+
|
|
205
|
+
actionIconOnly && "max-sm:px-0 max-sm:w-8 max-sm:h-8", className), ref: ref, disabled: isDisabled, style: footerStyles, title: tooltip || (actionIconOnly && typeof children === 'string' ? children : undefined), ...props, children: [loading && ((0, jsx_runtime_1.jsxs)("svg", { className: "animate-spin h-4 w-4", fill: "none", viewBox: "0 0 24 24", children: [(0, jsx_runtime_1.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), (0, jsx_runtime_1.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "m4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })] })), resolvedIcon && iconPosition === 'left' && !loading && (isReactElement(resolvedIcon) ? (resolvedIcon) : isReactComponent(resolvedIcon) ? (React.createElement(resolvedIcon, { className: size === 'xs' ? 'h-3 w-3' : size === 'footer' ? 'h-3.5 w-3.5' : isActionButton ? 'h-3.5 w-3.5 sm:h-4 sm:w-4' : 'h-4 w-4' })) : null), actionIconOnly ? ((0, jsx_runtime_1.jsx)("span", { className: "hidden sm:inline", children: children })) : (children), resolvedIcon && iconPosition === 'right' && !loading && (isReactElement(resolvedIcon) ? (resolvedIcon) : isReactComponent(resolvedIcon) ? (React.createElement(resolvedIcon, { className: size === 'xs' ? 'h-3 w-3' : size === 'footer' ? 'h-3.5 w-3.5' : isActionButton ? 'h-3.5 w-3.5 sm:h-4 sm:w-4' : 'h-4 w-4' })) : null)] }));
|
|
206
|
+
});
|
|
207
|
+
exports.Button = Button;
|
|
208
|
+
Button.displayName = "Button";
|
|
209
|
+
exports.CheckboxButton = React.forwardRef(({ checked = false, onChange, label, size = 'md', className, ...props }, ref) => {
|
|
210
|
+
const sizeClasses = {
|
|
211
|
+
xs: 'h-6 px-2 text-[10px] gap-1.5',
|
|
212
|
+
sm: 'h-8 px-2.5 text-xs gap-2',
|
|
213
|
+
md: 'h-10 px-2.5 text-xs gap-2'
|
|
214
|
+
};
|
|
215
|
+
const checkboxSizeClasses = {
|
|
216
|
+
xs: 'w-3 h-3',
|
|
217
|
+
sm: 'w-4 h-4',
|
|
218
|
+
md: 'w-4 h-4'
|
|
219
|
+
};
|
|
220
|
+
const checkIconClasses = {
|
|
221
|
+
xs: 'h-2 w-2',
|
|
222
|
+
sm: 'h-3 w-3',
|
|
223
|
+
md: 'h-3 w-3'
|
|
224
|
+
};
|
|
225
|
+
return ((0, jsx_runtime_1.jsxs)("button", { ref: ref, type: "button", onClick: () => onChange?.(!checked), className: (0, utils_1.cn)('inline-flex items-center rounded-full border font-medium transition-all duration-200', 'disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-[rgb(var(--bg-surface))]', sizeClasses[size], checked
|
|
226
|
+
? 'bg-[rgb(var(--color-primary))]/10 hover:bg-[rgb(var(--color-primary))]/20 text-[rgb(var(--color-primary))] border-[rgb(var(--color-primary))]/20'
|
|
227
|
+
: 'bg-[rgb(var(--bg-surface))] hover:bg-[rgb(var(--bg-subtle))] text-[rgb(var(--fg-default))] border-[rgb(var(--bd-default))]', className), ...props, children: [(0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.cn)('rounded flex items-center justify-center transition-all duration-200 flex-shrink-0', checkboxSizeClasses[size], checked
|
|
228
|
+
? 'bg-[rgb(var(--color-primary))] border-[rgb(var(--color-primary))]'
|
|
229
|
+
: 'bg-transparent border border-[rgb(var(--bd-default))]'), children: checked && ((0, jsx_runtime_1.jsx)(lucide_react_1.Check, { className: (0, utils_1.cn)(checkIconClasses[size], 'text-white'), strokeWidth: 3 })) }), (0, jsx_runtime_1.jsx)("span", { className: "whitespace-nowrap", children: label })] }));
|
|
230
|
+
});
|
|
231
|
+
exports.CheckboxButton.displayName = "CheckboxButton";
|
|
232
|
+
exports.InputButton = React.forwardRef(({ label, size = 'md', className, inputClassName, suffix, stepper, onStep, canStep, disabled, ...props }, ref) => {
|
|
233
|
+
const decDisabled = !!disabled || (canStep ? !canStep('dec') : false);
|
|
234
|
+
const incDisabled = !!disabled || (canStep ? !canStep('inc') : false);
|
|
235
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.cn)('inline-flex items-center gap-2 px-2.5 rounded-lg border transition-all duration-200', 'bg-[rgb(var(--bg-subtle))] hover:bg-[rgb(var(--bg-hover))] border-[rgb(var(--bd-default))]', 'h-8', className), children: [(0, jsx_runtime_1.jsxs)("span", { className: (0, utils_1.cn)('font-medium whitespace-nowrap text-[rgb(var(--fg-default))]', 'text-xs'), children: [label, ":"] }), stepper && ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => onStep?.('dec'), disabled: decDisabled, "aria-label": "Decrease", className: "h-5 w-5 inline-flex items-center justify-center rounded-md border border-[rgb(var(--bd-default))] bg-[rgb(var(--bg-surface))] text-[rgb(var(--fg-default))] hover:bg-[rgb(var(--bg-muted))] disabled:opacity-40 disabled:cursor-not-allowed", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Minus, { className: "h-3 w-3" }) })), (0, jsx_runtime_1.jsx)("input", { ref: ref, type: "number", disabled: disabled, className: (0, utils_1.cn)('w-12 text-xs font-bold rounded-md px-1.5 text-center', 'border-0 focus:outline-none focus:ring-0', 'bg-[rgb(var(--bg-surface))]', 'text-[rgb(var(--fg-default))]', 'placeholder:text-[rgb(var(--fg-muted))]', '[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none', 'h-5', inputClassName), ...props }), stepper && ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: () => onStep?.('inc'), disabled: incDisabled, "aria-label": "Increase", className: "h-5 w-5 inline-flex items-center justify-center rounded-md border border-[rgb(var(--bd-default))] bg-[rgb(var(--bg-surface))] text-[rgb(var(--fg-default))] hover:bg-[rgb(var(--bg-muted))] disabled:opacity-40 disabled:cursor-not-allowed", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Plus, { className: "h-3 w-3" }) })), suffix && ((0, jsx_runtime_1.jsx)("span", { className: "text-xs font-medium text-[rgb(var(--fg-default))]", children: suffix }))] }));
|
|
236
|
+
});
|
|
237
|
+
exports.InputButton.displayName = "InputButton";
|
|
238
|
+
const filterPillVariants = {
|
|
239
|
+
primary: {
|
|
240
|
+
selected: 'bg-[rgb(var(--color-primary))] text-white shadow-md',
|
|
241
|
+
unselected: 'bg-[rgb(var(--color-primary-subtle))] text-[rgb(var(--color-primary))] hover:opacity-80'
|
|
242
|
+
},
|
|
243
|
+
warning: {
|
|
244
|
+
selected: 'bg-[rgb(var(--color-warning))] text-white shadow-md',
|
|
245
|
+
unselected: 'bg-[rgb(var(--color-warning-subtle))] text-[rgb(var(--color-warning))] hover:opacity-80'
|
|
246
|
+
},
|
|
247
|
+
success: {
|
|
248
|
+
selected: 'bg-[rgb(var(--color-success))] text-white shadow-md',
|
|
249
|
+
unselected: 'bg-[rgb(var(--color-success-subtle))] text-[rgb(var(--color-success))] hover:opacity-80'
|
|
250
|
+
},
|
|
251
|
+
orange: {
|
|
252
|
+
selected: 'bg-[rgb(var(--color-orange))] text-white shadow-md',
|
|
253
|
+
unselected: 'bg-[rgb(var(--color-orange-subtle))] text-[rgb(var(--color-orange))] hover:opacity-80'
|
|
254
|
+
},
|
|
255
|
+
error: {
|
|
256
|
+
selected: 'bg-[rgb(var(--color-error))] text-white shadow-md',
|
|
257
|
+
unselected: 'bg-[rgb(var(--color-error-subtle))] text-[rgb(var(--color-error))] hover:opacity-80'
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
exports.FilterPillButton = React.forwardRef(({ label, shortLabel, count, variant, isSelected, className, ...props }, ref) => {
|
|
261
|
+
const styles = filterPillVariants[variant];
|
|
262
|
+
return ((0, jsx_runtime_1.jsxs)("button", { ref: ref, type: "button", className: (0, utils_1.cn)('px-2 sm:px-3 py-1 sm:py-1.5 rounded-full text-[10px] sm:text-xs font-semibold transition-all', 'hover:scale-105 cursor-pointer', isSelected ? styles.selected : styles.unselected, className), ...props, children: [(0, jsx_runtime_1.jsx)("span", { className: "hidden sm:inline", children: label }), shortLabel && (0, jsx_runtime_1.jsx)("span", { className: "sm:hidden", children: shortLabel }), !shortLabel && (0, jsx_runtime_1.jsx)("span", { className: "sm:hidden", children: label }), (0, jsx_runtime_1.jsxs)("span", { className: "ml-0.5 sm:ml-1 opacity-75", children: ["(", count, ")"] })] }));
|
|
263
|
+
});
|
|
264
|
+
exports.FilterPillButton.displayName = "FilterPillButton";
|