@burdenoff/microfe-govcitizenhub 2026.704.1 → 2026.704.2

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.
Files changed (33) hide show
  1. package/dist/govcitizenhub/GovCitizenHubRoot.js.map +1 -1
  2. package/dist/govcitizenhub/GovCitizenHubRoutes.js.map +1 -1
  3. package/dist/govcitizenhub/components/DocumentUploadField.js.map +1 -1
  4. package/dist/govcitizenhub/components/EmptyState.js.map +1 -1
  5. package/dist/govcitizenhub/components/FilterTabs.js.map +1 -1
  6. package/dist/govcitizenhub/components/GovCharts.js.map +1 -1
  7. package/dist/govcitizenhub/components/Pagination.js.map +1 -1
  8. package/dist/govcitizenhub/components/StateViews.js.map +1 -1
  9. package/dist/govcitizenhub/components/StatusBadge.js.map +1 -1
  10. package/dist/govcitizenhub/components/TagInput.js.map +1 -1
  11. package/dist/govcitizenhub/context/GovCitizenHubContext.js.map +1 -1
  12. package/dist/govcitizenhub/hooks/useFiles.js +55 -38
  13. package/dist/govcitizenhub/hooks/useFiles.js.map +1 -1
  14. package/dist/govcitizenhub/hooks/useGovApi.js.map +1 -1
  15. package/dist/govcitizenhub/pages/DashboardPage.js.map +1 -1
  16. package/dist/govcitizenhub/pages/agencies/AgenciesPage.js.map +1 -1
  17. package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js.map +1 -1
  18. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js.map +1 -1
  19. package/dist/govcitizenhub/pages/applications/ApplicationsPage.js.map +1 -1
  20. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js +1 -1
  21. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js.map +1 -1
  22. package/dist/govcitizenhub/pages/documents/DocumentsPage.js.map +1 -1
  23. package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js.map +1 -1
  24. package/dist/govcitizenhub/pages/grievances/GrievancesPage.js.map +1 -1
  25. package/dist/govcitizenhub/pages/payments/PaymentsPage.js.map +1 -1
  26. package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js.map +1 -1
  27. package/dist/govcitizenhub/pages/permits/PermitsPage.js.map +1 -1
  28. package/dist/govcitizenhub/pages/permits/VerifyPermitPage.js.map +1 -1
  29. package/dist/govcitizenhub/pages/services/ServiceDetailPage.js.map +1 -1
  30. package/dist/govcitizenhub/pages/services/ServiceFormDialog.js.map +1 -1
  31. package/dist/govcitizenhub/pages/services/ServicesPage.js.map +1 -1
  32. package/dist/govcitizenhub/utils/navigation.js.map +1 -1
  33. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"GovCitizenHubRoot.js","names":[],"sources":["../../src/govcitizenhub/GovCitizenHubRoot.tsx"],"sourcesContent":["/**\n * GovCitizenHub Root Component\n * @module govcitizenhub\n *\n * Host-contract entry point. Registers the product's sidebar nav (matching the\n * app-shell static NavRegistration block so the two are one source of truth) and\n * mounts the routed pages inside the shared QueryClient + FeatureFlag providers.\n */\n\nimport { Component, type ErrorInfo, type FC, type ReactNode } from 'react';\nimport { useEffect } from 'react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport {\n LayoutDashboard,\n Briefcase,\n FileText,\n Building2,\n FolderOpen,\n CreditCard,\n BadgeCheck,\n ShieldQuestion,\n MessageSquareWarning,\n} from 'lucide-react';\nimport { GovCitizenHubProvider } from './context/GovCitizenHubContext';\nimport { GovCitizenHubRoutes } from './GovCitizenHubRoutes';\nimport { joinPath } from './utils/navigation';\nimport type { GovCitizenHubRootProps, NavItem } from './types';\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 60 * 1000,\n retry: 1,\n refetchOnWindowFocus: false,\n },\n },\n});\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n message: string | null;\n}\n\nclass GovErrorBoundary extends Component<{ children: ReactNode }, ErrorBoundaryState> {\n constructor(props: { children: ReactNode }) {\n super(props);\n this.state = { hasError: false, message: null };\n }\n\n static getDerivedStateFromError(error: Error): ErrorBoundaryState {\n return { hasError: true, message: error.message };\n }\n\n componentDidCatch(_error: Error, _info: ErrorInfo) {\n // Surfaced in the fallback; no external logger wired here.\n }\n\n render() {\n if (this.state.hasError) {\n return (\n <div className=\"m-4 rounded-xl border border-border-seam bg-bg-surface p-6\">\n <h2 className=\"text-lg font-semibold text-status-error-text\">Something went wrong</h2>\n <p className=\"mt-2 text-sm text-text-secondary\">{this.state.message ?? 'Unknown error'}</p>\n <button\n type=\"button\"\n onClick={() => window.location.reload()}\n className=\"mt-4 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n Reload\n </button>\n </div>\n );\n }\n return this.props.children;\n }\n}\n\nexport const GovCitizenHubRoot: FC<GovCitizenHubRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'govcitizenhub-dashboard',\n label: 'Dashboard',\n path: joinPath(basePath, ''),\n icon: <LayoutDashboard size={20} />,\n order: 0,\n group: 'products',\n },\n {\n id: 'govcitizenhub-services',\n label: 'Services',\n path: joinPath(basePath, 'services'),\n icon: <Briefcase size={20} />,\n order: 1,\n group: 'products',\n },\n {\n id: 'govcitizenhub-applications',\n label: 'Applications',\n path: joinPath(basePath, 'applications'),\n icon: <FileText size={20} />,\n order: 2,\n group: 'products',\n },\n {\n id: 'govcitizenhub-agencies',\n label: 'Agencies',\n path: joinPath(basePath, 'agencies'),\n icon: <Building2 size={20} />,\n order: 3,\n group: 'products',\n },\n {\n id: 'govcitizenhub-documents',\n label: 'Documents',\n path: joinPath(basePath, 'documents'),\n icon: <FolderOpen size={20} />,\n order: 4,\n group: 'products',\n },\n {\n id: 'govcitizenhub-payments',\n label: 'Payments',\n path: joinPath(basePath, 'payments'),\n icon: <CreditCard size={20} />,\n order: 5,\n group: 'products',\n },\n {\n id: 'govcitizenhub-permits',\n label: 'Permits',\n path: joinPath(basePath, 'permits'),\n icon: <BadgeCheck size={20} />,\n order: 6,\n group: 'products',\n },\n {\n id: 'govcitizenhub-verify',\n label: 'Verify Permit',\n path: joinPath(basePath, 'permits/verify'),\n icon: <ShieldQuestion size={20} />,\n order: 7,\n group: 'products',\n },\n {\n id: 'govcitizenhub-grievances',\n label: 'Grievances',\n path: joinPath(basePath, 'grievances'),\n icon: <MessageSquareWarning size={20} />,\n order: 8,\n group: 'products',\n },\n ];\n\n return registerNavItems(navItems);\n }, [registerNavItems, basePath]);\n\n useEffect(() => {\n if (!registerFooterItems) return;\n return registerFooterItems([\n {\n id: 'govcitizenhub-status',\n label: 'GovCitizenHub Ready',\n type: 'status',\n section: 'left',\n order: 10,\n },\n ]);\n }, [registerFooterItems]);\n\n return (\n <QueryClientProvider client={queryClient}>\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <GovErrorBoundary>\n <GovCitizenHubProvider {...props}>\n <GovCitizenHubRoutes />\n </GovCitizenHubProvider>\n </GovErrorBoundary>\n </FeatureFlagProvider>\n </QueryClientProvider>\n );\n};\n"],"mappings":";;;;;;;;;AA6BA,IAAM,IAAc,IAAI,EAAY,EAClC,gBAAgB,EACd,SAAS;CACP,WAAW,KAAK;CAChB,OAAO;CACP,sBAAsB;CACvB,EACF,EACF,CAAC,EAOI,IAAN,cAA+B,EAAuD;CACpF,YAAY,GAAgC;AAE1C,EADA,MAAM,EAAM,EACZ,KAAK,QAAQ;GAAE,UAAU;GAAO,SAAS;GAAM;;CAGjD,OAAO,yBAAyB,GAAkC;AAChE,SAAO;GAAE,UAAU;GAAM,SAAS,EAAM;GAAS;;CAGnD,kBAAkB,GAAe,GAAkB;CAInD,SAAS;AAgBP,SAfI,KAAK,MAAM,WAEX,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,MAAD;KAAI,WAAU;eAA+C;KAAyB,CAAA;IACtF,kBAAC,KAAD;KA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IACE,IAAI;IACJ,OAAO;IACP,MAAM,EAAS,GAAU,iBAAiB;IAC1C,MAAM,kBAAC,GAAD,EAAgB,MAAM,IAAM,CAAA;IAClC,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO;IACP,MAAM,EAAS,GAAU,aAAa;IACtC,MAAM,kBAAC,GAAD,EAAsB,MAAM,IAAM,CAAA;IACxC,OAAO;IACP,OAAO;IACR;GACF,CAEgC;IAChC,CAAC,GAAkB,EAAS,CAAC,EAEhC,QAAgB;AACT,QACL,QAAO,EAAoB,CACzB;GACE,IAAI;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,OAAO;GACR,CACF,CAAC;IACD,CAAC,EAAoB,CAAC,EAGvB,kBAAC,GAAD;EAAqB,QAAQ;YAC3B,kBAAC,GAAD;GAAqB,aAAa;GAAM,SAAQ;GAAS,gBAAgB;aACvE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;IAAuB,GAAI;cACzB,kBAAC,GAAD,EAAuB,CAAA;IACD,CAAA,EACP,CAAA;GACC,CAAA;EACF,CAAA"}
1
+ {"version":3,"file":"GovCitizenHubRoot.js","names":[],"sources":["../../src/govcitizenhub/GovCitizenHubRoot.tsx"],"sourcesContent":["/**\n * GovCitizenHub Root Component\n * @module govcitizenhub\n *\n * Host-contract entry point. Registers the product's sidebar nav (matching the\n * app-shell static NavRegistration block so the two are one source of truth) and\n * mounts the routed pages inside the shared QueryClient + FeatureFlag providers.\n */\n\nimport { Component, type ErrorInfo, type FC, type ReactNode } from 'react';\nimport { useEffect } from 'react';\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport {\n LayoutDashboard,\n Briefcase,\n FileText,\n Building2,\n FolderOpen,\n CreditCard,\n BadgeCheck,\n ShieldQuestion,\n MessageSquareWarning,\n} from 'lucide-react';\nimport { GovCitizenHubProvider } from './context/GovCitizenHubContext';\nimport { GovCitizenHubRoutes } from './GovCitizenHubRoutes';\nimport { joinPath } from './utils/navigation';\nimport type { GovCitizenHubRootProps, NavItem } from './types';\n\nconst queryClient = new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 60 * 1000,\n retry: 1,\n refetchOnWindowFocus: false,\n },\n },\n});\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n message: string | null;\n}\n\nclass GovErrorBoundary extends Component<{ children: ReactNode }, ErrorBoundaryState> {\n constructor(props: { children: ReactNode }) {\n super(props);\n this.state = { hasError: false, message: null };\n }\n\n static getDerivedStateFromError(error: Error): ErrorBoundaryState {\n return { hasError: true, message: error.message };\n }\n\n componentDidCatch(_error: Error, _info: ErrorInfo) {\n // Surfaced in the fallback; no external logger wired here.\n }\n\n render() {\n if (this.state.hasError) {\n return (\n <div className=\"m-4 rounded-xl border border-border-seam bg-bg-surface p-6\">\n <h2 className=\"text-lg font-semibold text-status-error-text\">Something went wrong</h2>\n <p className=\"mt-2 text-sm text-text-secondary\">\n {this.state.message ?? 'Unknown error'}\n </p>\n <button\n type=\"button\"\n onClick={() => window.location.reload()}\n className=\"mt-4 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n Reload\n </button>\n </div>\n );\n }\n return this.props.children;\n }\n}\n\nexport const GovCitizenHubRoot: FC<GovCitizenHubRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n\n useEffect(() => {\n if (!registerNavItems) return;\n\n const navItems: NavItem[] = [\n {\n id: 'govcitizenhub-dashboard',\n label: 'Dashboard',\n path: joinPath(basePath, ''),\n icon: <LayoutDashboard size={20} />,\n order: 0,\n group: 'products',\n },\n {\n id: 'govcitizenhub-services',\n label: 'Services',\n path: joinPath(basePath, 'services'),\n icon: <Briefcase size={20} />,\n order: 1,\n group: 'products',\n },\n {\n id: 'govcitizenhub-applications',\n label: 'Applications',\n path: joinPath(basePath, 'applications'),\n icon: <FileText size={20} />,\n order: 2,\n group: 'products',\n },\n {\n id: 'govcitizenhub-agencies',\n label: 'Agencies',\n path: joinPath(basePath, 'agencies'),\n icon: <Building2 size={20} />,\n order: 3,\n group: 'products',\n },\n {\n id: 'govcitizenhub-documents',\n label: 'Documents',\n path: joinPath(basePath, 'documents'),\n icon: <FolderOpen size={20} />,\n order: 4,\n group: 'products',\n },\n {\n id: 'govcitizenhub-payments',\n label: 'Payments',\n path: joinPath(basePath, 'payments'),\n icon: <CreditCard size={20} />,\n order: 5,\n group: 'products',\n },\n {\n id: 'govcitizenhub-permits',\n label: 'Permits',\n path: joinPath(basePath, 'permits'),\n icon: <BadgeCheck size={20} />,\n order: 6,\n group: 'products',\n },\n {\n id: 'govcitizenhub-verify',\n label: 'Verify Permit',\n path: joinPath(basePath, 'permits/verify'),\n icon: <ShieldQuestion size={20} />,\n order: 7,\n group: 'products',\n },\n {\n id: 'govcitizenhub-grievances',\n label: 'Grievances',\n path: joinPath(basePath, 'grievances'),\n icon: <MessageSquareWarning size={20} />,\n order: 8,\n group: 'products',\n },\n ];\n\n return registerNavItems(navItems);\n }, [registerNavItems, basePath]);\n\n useEffect(() => {\n if (!registerFooterItems) return;\n return registerFooterItems([\n {\n id: 'govcitizenhub-status',\n label: 'GovCitizenHub Ready',\n type: 'status',\n section: 'left',\n order: 10,\n },\n ]);\n }, [registerFooterItems]);\n\n return (\n <QueryClientProvider client={queryClient}>\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <GovErrorBoundary>\n <GovCitizenHubProvider {...props}>\n <GovCitizenHubRoutes />\n </GovCitizenHubProvider>\n </GovErrorBoundary>\n </FeatureFlagProvider>\n </QueryClientProvider>\n );\n};\n"],"mappings":";;;;;;;;;AA6BA,IAAM,IAAc,IAAI,EAAY,EAClC,gBAAgB,EACd,SAAS;CACP,WAAW,KAAK;CAChB,OAAO;CACP,sBAAsB;CACvB,EACF,EACF,CAAC,EAOI,IAAN,cAA+B,EAAuD;CACpF,YAAY,GAAgC;AAE1C,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M,IAAM,CAAA;IAC9B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO;IACP,MAAM,EAAS,GAAU,WAAW;IACpC,MAAM,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;IAC9B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO;IACP,MAAM,EAAS,GAAU,UAAU;IACnC,MAAM,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;IAC9B,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO;IACP,MAAM,EAAS,GAAU,iBAAiB;IAC1C,MAAM,kBAAC,GAAD,EAAgB,MAAM,IAAM,CAAA;IAClC,OAAO;IACP,OAAO;IACR;GACD;IACE,IAAI;IACJ,OAAO;IACP,MAAM,EAAS,GAAU,aAAa;IACtC,MAAM,kBAAC,GAAD,EAAsB,MAAM,IAAM,CAAA;IACxC,OAAO;IACP,OAAO;IACR;GACF,CAEgC;IAChC,CAAC,GAAkB,EAAS,CAAC,EAEhC,QAAgB;AACT,QACL,QAAO,EAAoB,CACzB;GACE,IAAI;GACJ,OAAO;GACP,MAAM;GACN,SAAS;GACT,OAAO;GACR,CACF,CAAC;IACD,CAAC,EAAoB,CAAC,EAGvB,kBAAC,GAAD;EAAqB,QAAQ;YAC3B,kBAAC,GAAD;GAAqB,aAAa;GAAM,SAAQ;GAAS,gBAAgB;aACvE,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;IAAuB,GAAI;cACzB,kBAAC,GAAD,EAAuB,CAAA;IACD,CAAA,EACP,CAAA;GACC,CAAA;EACF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"GovCitizenHubRoutes.js","names":[],"sources":["../../src/govcitizenhub/GovCitizenHubRoutes.tsx"],"sourcesContent":["/**\n * GovCitizenHub Routes\n * @module govcitizenhub\n *\n * Domain routes. The dashboard is eager-loaded (primary landing); all other\n * pages are lazy-loaded. Every route maps to a real `gov*` backend capability.\n */\n\nimport { type FC, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router-dom';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { useGovCitizenHub } from './context/GovCitizenHubContext';\n\nimport { DashboardPage } from './pages/DashboardPage';\n\nconst ServicesPage = lazy(() => import('./pages/services/ServicesPage').then((m) => ({ default: m.ServicesPage })));\nconst ServiceDetailPage = lazy(() =>\n import('./pages/services/ServiceDetailPage').then((m) => ({ default: m.ServiceDetailPage }))\n);\nconst ApplicationsPage = lazy(() =>\n import('./pages/applications/ApplicationsPage').then((m) => ({ default: m.ApplicationsPage }))\n);\nconst ApplicationDetailPage = lazy(() =>\n import('./pages/applications/ApplicationDetailPage').then((m) => ({ default: m.ApplicationDetailPage }))\n);\nconst NewApplicationPage = lazy(() =>\n import('./pages/applications/NewApplicationPage').then((m) => ({ default: m.NewApplicationPage }))\n);\nconst AgenciesPage = lazy(() => import('./pages/agencies/AgenciesPage').then((m) => ({ default: m.AgenciesPage })));\nconst DocumentsPage = lazy(() =>\n import('./pages/documents/DocumentsPage').then((m) => ({ default: m.DocumentsPage }))\n);\nconst PaymentsPage = lazy(() => import('./pages/payments/PaymentsPage').then((m) => ({ default: m.PaymentsPage })));\nconst PermitsPage = lazy(() => import('./pages/permits/PermitsPage').then((m) => ({ default: m.PermitsPage })));\nconst VerifyPermitPage = lazy(() =>\n import('./pages/permits/VerifyPermitPage').then((m) => ({ default: m.VerifyPermitPage }))\n);\nconst GrievancesPage = lazy(() =>\n import('./pages/grievances/GrievancesPage').then((m) => ({ default: m.GrievancesPage }))\n);\nconst GrievanceDetailPage = lazy(() =>\n import('./pages/grievances/GrievanceDetailPage').then((m) => ({ default: m.GrievanceDetailPage }))\n);\n\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <Spinner size=\"lg\" />\n </div>\n);\n\nexport const GovCitizenHubRoutes: FC = () => {\n const { basePath, isStandalone } = useGovCitizenHub();\n const location = useLocation();\n\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: only render if the current path matches basePath (integrated mode).\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath || location.pathname.startsWith(normalizedBasePath + '/');\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col\">\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={<DashboardPage />} />\n\n <Route path=\"services\" element={<ServicesPage />} />\n <Route path=\"services/:id\" element={<ServiceDetailPage />} />\n\n <Route path=\"applications\" element={<ApplicationsPage />} />\n <Route path=\"applications/new\" element={<NewApplicationPage />} />\n <Route path=\"applications/:id\" element={<ApplicationDetailPage />} />\n\n <Route path=\"agencies\" element={<AgenciesPage />} />\n\n <Route path=\"documents\" element={<DocumentsPage />} />\n\n <Route path=\"payments\" element={<PaymentsPage />} />\n\n <Route path=\"permits\" element={<PermitsPage />} />\n <Route path=\"permits/verify\" element={<VerifyPermitPage />} />\n\n <Route path=\"grievances\" element={<GrievancesPage />} />\n <Route path=\"grievances/:id\" element={<GrievanceDetailPage />} />\n\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;;AAeA,IAAM,IAAe,QAAW,OAAO,oCAAiC,MAAM,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC,EAC7G,IAAoB,QACxB,OAAO,yCAAsC,MAAM,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAC7F,EACK,IAAmB,QACvB,OAAO,4CAAyC,MAAM,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAC/F,EACK,IAAwB,QAC5B,OAAO,iDAA8C,MAAM,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,CACzG,EACK,IAAqB,QACzB,OAAO,8CAA2C,MAAM,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,CACnG,EACK,IAAe,QAAW,OAAO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I,CAAA;IAE7D,kBAAC,GAAD;KAAO,MAAK;KAAe,SAAS,kBAAC,GAAD,EAAoB,CAAA;KAAI,CAAA;IAC5D,kBAAC,GAAD;KAAO,MAAK;KAAmB,SAAS,kBAAC,GAAD,EAAsB,CAAA;KAAI,CAAA;IAClE,kBAAC,GAAD;KAAO,MAAK;KAAmB,SAAS,kBAAC,GAAD,EAAyB,CAAA;KAAI,CAAA;IAErE,kBAAC,GAAD;KAAO,MAAK;KAAW,SAAS,kBAAC,GAAD,EAAgB,CAAA;KAAI,CAAA;IAEpD,kBAAC,GAAD;KAAO,MAAK;KAAY,SAAS,kBAAC,GAAD,EAAiB,CAAA;KAAI,CAAA;IAEtD,kBAAC,GAAD;KAAO,MAAK;KAAW,SAAS,kBAAC,GAAD,EAAgB,CAAA;KAAI,CAAA;IAEpD,kBAAC,GAAD;KAAO,MAAK;KAAU,SAAS,kBAAC,GAAD,EAAe,CAAA;KAAI,CAAA;IAClD,kBAAC,GAAD;KAAO,MAAK;KAAiB,SAAS,kBAAC,GAAD,EAAoB,CAAA;KAAI,CAAA;IAE9D,kBAAC,GAAD;KAAO,MAAK;KAAa,SAAS,kBAAC,GAAD,EAAkB,CAAA;KAAI,CAAA;IACxD,kBAAC,GAAD;KAAO,MAAK;KAAiB,SAAS,kBAAC,GAAD,EAAuB,CAAA;KAAI,CAAA;IAEjE,kBAAC,GAAD;KAAO,MAAK;KAAI,SAAS,kBAAC,GAAD;MAAU,IAAG;MAAG,SAAA;MAAU,CAAA;KAAI,CAAA;IAChD,EAAA,CAAA;GACA,CAAA;EACP,CAAA"}
1
+ {"version":3,"file":"GovCitizenHubRoutes.js","names":[],"sources":["../../src/govcitizenhub/GovCitizenHubRoutes.tsx"],"sourcesContent":["/**\n * GovCitizenHub Routes\n * @module govcitizenhub\n *\n * Domain routes. The dashboard is eager-loaded (primary landing); all other\n * pages are lazy-loaded. Every route maps to a real `gov*` backend capability.\n */\n\nimport { type FC, lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate, useLocation } from 'react-router-dom';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { useGovCitizenHub } from './context/GovCitizenHubContext';\n\nimport { DashboardPage } from './pages/DashboardPage';\n\nconst ServicesPage = lazy(() =>\n import('./pages/services/ServicesPage').then((m) => ({ default: m.ServicesPage }))\n);\nconst ServiceDetailPage = lazy(() =>\n import('./pages/services/ServiceDetailPage').then((m) => ({ default: m.ServiceDetailPage }))\n);\nconst ApplicationsPage = lazy(() =>\n import('./pages/applications/ApplicationsPage').then((m) => ({ default: m.ApplicationsPage }))\n);\nconst ApplicationDetailPage = lazy(() =>\n import('./pages/applications/ApplicationDetailPage').then((m) => ({\n default: m.ApplicationDetailPage,\n }))\n);\nconst NewApplicationPage = lazy(() =>\n import('./pages/applications/NewApplicationPage').then((m) => ({ default: m.NewApplicationPage }))\n);\nconst AgenciesPage = lazy(() =>\n import('./pages/agencies/AgenciesPage').then((m) => ({ default: m.AgenciesPage }))\n);\nconst DocumentsPage = lazy(() =>\n import('./pages/documents/DocumentsPage').then((m) => ({ default: m.DocumentsPage }))\n);\nconst PaymentsPage = lazy(() =>\n import('./pages/payments/PaymentsPage').then((m) => ({ default: m.PaymentsPage }))\n);\nconst PermitsPage = lazy(() =>\n import('./pages/permits/PermitsPage').then((m) => ({ default: m.PermitsPage }))\n);\nconst VerifyPermitPage = lazy(() =>\n import('./pages/permits/VerifyPermitPage').then((m) => ({ default: m.VerifyPermitPage }))\n);\nconst GrievancesPage = lazy(() =>\n import('./pages/grievances/GrievancesPage').then((m) => ({ default: m.GrievancesPage }))\n);\nconst GrievanceDetailPage = lazy(() =>\n import('./pages/grievances/GrievanceDetailPage').then((m) => ({ default: m.GrievanceDetailPage }))\n);\n\nconst PageLoader: FC = () => (\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <Spinner size=\"lg\" />\n </div>\n);\n\nexport const GovCitizenHubRoutes: FC = () => {\n const { basePath, isStandalone } = useGovCitizenHub();\n const location = useLocation();\n\n const normalizedBasePath = basePath === '/' ? '' : (basePath ?? '').replace(/\\/$/, '');\n\n // Guard: only render if the current path matches basePath (integrated mode).\n if (normalizedBasePath && !isStandalone) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <div className=\"flex min-h-full flex-col\">\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={<DashboardPage />} />\n\n <Route path=\"services\" element={<ServicesPage />} />\n <Route path=\"services/:id\" element={<ServiceDetailPage />} />\n\n <Route path=\"applications\" element={<ApplicationsPage />} />\n <Route path=\"applications/new\" element={<NewApplicationPage />} />\n <Route path=\"applications/:id\" element={<ApplicationDetailPage />} />\n\n <Route path=\"agencies\" element={<AgenciesPage />} />\n\n <Route path=\"documents\" element={<DocumentsPage />} />\n\n <Route path=\"payments\" element={<PaymentsPage />} />\n\n <Route path=\"permits\" element={<PermitsPage />} />\n <Route path=\"permits/verify\" element={<VerifyPermitPage />} />\n\n <Route path=\"grievances\" element={<GrievancesPage />} />\n <Route path=\"grievances/:id\" element={<GrievanceDetailPage />} />\n\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </div>\n );\n};\n"],"mappings":";;;;;;;AAeA,IAAM,IAAe,QACnB,OAAO,oCAAiC,MAAM,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CACnF,EACK,IAAoB,QACxB,OAAO,yCAAsC,MAAM,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAC7F,EACK,IAAmB,QACvB,OAAO,4CAAyC,MAAM,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAC/F,EACK,IAAwB,QAC5B,OAAO,iDAA8C,MAAM,OAAO,EAChE,SAAS,EAAE,uBACZ,EAAE,CACJ,EACK,IAAqB,QACzB,OAAO,8CAA2C,MAAM,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,CACnG,EACK,IAAe,QACn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AI,CAAA;IAE7D,kBAAC,GAAD;KAAO,MAAK;KAAe,SAAS,kBAAC,GAAD,EAAoB,CAAA;KAAI,CAAA;IAC5D,kBAAC,GAAD;KAAO,MAAK;KAAmB,SAAS,kBAAC,GAAD,EAAsB,CAAA;KAAI,CAAA;IAClE,kBAAC,GAAD;KAAO,MAAK;KAAmB,SAAS,kBAAC,GAAD,EAAyB,CAAA;KAAI,CAAA;IAErE,kBAAC,GAAD;KAAO,MAAK;KAAW,SAAS,kBAAC,GAAD,EAAgB,CAAA;KAAI,CAAA;IAEpD,kBAAC,GAAD;KAAO,MAAK;KAAY,SAAS,kBAAC,GAAD,EAAiB,CAAA;KAAI,CAAA;IAEtD,kBAAC,GAAD;KAAO,MAAK;KAAW,SAAS,kBAAC,GAAD,EAAgB,CAAA;KAAI,CAAA;IAEpD,kBAAC,GAAD;KAAO,MAAK;KAAU,SAAS,kBAAC,GAAD,EAAe,CAAA;KAAI,CAAA;IAClD,kBAAC,GAAD;KAAO,MAAK;KAAiB,SAAS,kBAAC,GAAD,EAAoB,CAAA;KAAI,CAAA;IAE9D,kBAAC,GAAD;KAAO,MAAK;KAAa,SAAS,kBAAC,GAAD,EAAkB,CAAA;KAAI,CAAA;IACxD,kBAAC,GAAD;KAAO,MAAK;KAAiB,SAAS,kBAAC,GAAD,EAAuB,CAAA;KAAI,CAAA;IAEjE,kBAAC,GAAD;KAAO,MAAK;KAAI,SAAS,kBAAC,GAAD;MAAU,IAAG;MAAG,SAAA;MAAU,CAAA;KAAI,CAAA;IAChD,EAAA,CAAA;GACA,CAAA;EACP,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentUploadField.js","names":[],"sources":["../../../src/govcitizenhub/components/DocumentUploadField.tsx"],"sourcesContent":["/**\n * DocumentUploadField — REAL document upload for a Gov application.\n * @module govcitizenhub/components\n *\n * On select: ensures the destination folder, uploads the blob to wspace-files-svc\n * via the shared presigned helper, then records it against the application with\n * `govAddDocument({ applicationId, fileId, name, requirement })`. It never keeps a\n * local blob store and never fabricates a document — the file is real.\n */\n\nimport { useId, useRef, useState } from 'react';\nimport { Loader2, Upload } from 'lucide-react';\nimport { Button, Input } from '@burdenoff/fe-libs/ui';\n\nimport { useGovAddDocument } from '../hooks/useGovApi';\nimport { FILE_FOLDERS, uploadFileToFiles } from '../hooks/useFiles';\nimport { notify, describeError } from '../lib/toast';\n\ninterface DocumentUploadFieldProps {\n applicationId: string;\n /** Prefilled requirement label (e.g. a required-document name from the service). */\n requirement?: string | null;\n onAdded?: () => void;\n disabled?: boolean;\n}\n\nexport function DocumentUploadField({ applicationId, requirement, onAdded, disabled = false }: DocumentUploadFieldProps) {\n const inputRef = useRef<HTMLInputElement | null>(null);\n const inputId = useId();\n const addDocument = useGovAddDocument();\n const [uploading, setUploading] = useState(false);\n const [name, setName] = useState('');\n\n const handleSelect = async (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n event.target.value = '';\n if (!file) return;\n\n setUploading(true);\n try {\n const uploaded = await uploadFileToFiles(file, FILE_FOLDERS.documents);\n await addDocument.mutateAsync({\n applicationId,\n fileId: uploaded.id,\n name: name.trim() || file.name,\n requirement: requirement ?? null,\n });\n notify.success('Document uploaded', uploaded.name);\n setName('');\n onAdded?.();\n } catch (error) {\n notify.error('Upload failed', describeError(error));\n } finally {\n setUploading(false);\n }\n };\n\n const busy = uploading || addDocument.isPending;\n\n return (\n <div className=\"flex flex-col gap-2 sm:flex-row sm:items-center\">\n <Input\n value={name}\n onChange={(e) => setName(e.target.value)}\n placeholder={requirement ? `Name (default: ${requirement})` : 'Document name (optional)'}\n aria-label=\"Document name\"\n className=\"sm:max-w-xs\"\n disabled={busy || disabled}\n />\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"sm\"\n disabled={busy || disabled}\n onClick={() => inputRef.current?.click()}\n >\n {busy ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <Upload className=\"h-4 w-4\" />}\n {busy ? 'Uploading…' : 'Upload document'}\n </Button>\n <input\n ref={inputRef}\n id={inputId}\n type=\"file\"\n className=\"sr-only\"\n aria-label=\"Choose a file to upload\"\n onChange={(event) => void handleSelect(event)}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;AA0BA,SAAgB,EAAoB,EAAE,kBAAe,gBAAa,YAAS,cAAW,MAAmC;CACvH,IAAM,IAAW,EAAgC,KAAK,EAChD,IAAU,GAAO,EACjB,IAAc,GAAmB,EACjC,CAAC,GAAW,KAAgB,EAAS,GAAM,EAC3C,CAAC,GAAM,KAAW,EAAS,GAAG,EAE9B,IAAe,OAAO,MAA+C;EACzE,IAAM,IAAO,EAAM,OAAO,QAAQ;AAClC,QAAM,OAAO,QAAQ,IAChB,GAEL;KAAa,GAAK;AAClB,OAAI;IACF,IAAM,IAAW,MAAM,EAAkB,GAAM,EAAa,UAAU;AAStE,IARA,MAAM,EAAY,YAAY;KAC5B;KACA,QAAQ,EAAS;KACjB,MAAM,EAAK,MAAM,IAAI,EAAK;KAC1B,aAAa,KAAe;KAC7B,CAAC,EACF,EAAO,QAAQ,qBAAqB,EAAS,KAAK,EAClD,EAAQ,GAAG,EACX,KAAW;YACJ,GAAO;AACd,MAAO,MAAM,iBAAiB,EAAc,EAAM,CAAC;aAC3C;AACR,MAAa,GAAM;;;IAIjB,IAAO,KAAa,EAAY;AAEtC,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,GAAD;IACE,OAAO;IACP,WAAW,MAAM,EAAQ,EAAE,OAAO,MAAM;IACxC,aAAa,IAAc,kBAAkB,EAAY,KAAK;IAC9D,cAAW;IACX,WAAU;IACV,UAAU,KAAQ;IAClB,CAAA;GACF,kBAAC,GAAD;IACE,MAAK;IACL,SAAQ;IACR,MAAK;IACL,UAAU,KAAQ;IAClB,eAAe,EAAS,SAAS,OAAO;cAL1C,CAOG,IAAO,kBAAC,GAAD,EAAS,WAAU,wBAAyB,CAAA,GAAG,kBAAC,GAAD,EAAQ,WAAU,WAAY,CAAA,EACpF,IAAO,eAAe,kBAChB;;GACT,kBAAC,SAAD;IACE,KAAK;IACL,IAAI;IACJ,MAAK;IACL,WAAU;IACV,cAAW;IACX,WAAW,MAAU,KAAK,EAAa,EAAM;IAC7C,CAAA;GACE"}
1
+ {"version":3,"file":"DocumentUploadField.js","names":[],"sources":["../../../src/govcitizenhub/components/DocumentUploadField.tsx"],"sourcesContent":["/**\n * DocumentUploadField — REAL document upload for a Gov application.\n * @module govcitizenhub/components\n *\n * On select: ensures the destination folder, uploads the blob to wspace-files-svc\n * via the shared presigned helper, then records it against the application with\n * `govAddDocument({ applicationId, fileId, name, requirement })`. It never keeps a\n * local blob store and never fabricates a document — the file is real.\n */\n\nimport { useId, useRef, useState } from 'react';\nimport { Loader2, Upload } from 'lucide-react';\nimport { Button, Input } from '@burdenoff/fe-libs/ui';\n\nimport { useGovAddDocument } from '../hooks/useGovApi';\nimport { FILE_FOLDERS, uploadFileToFiles } from '../hooks/useFiles';\nimport { notify, describeError } from '../lib/toast';\n\ninterface DocumentUploadFieldProps {\n applicationId: string;\n /** Prefilled requirement label (e.g. a required-document name from the service). */\n requirement?: string | null;\n onAdded?: () => void;\n disabled?: boolean;\n}\n\nexport function DocumentUploadField({\n applicationId,\n requirement,\n onAdded,\n disabled = false,\n}: DocumentUploadFieldProps) {\n const inputRef = useRef<HTMLInputElement | null>(null);\n const inputId = useId();\n const addDocument = useGovAddDocument();\n const [uploading, setUploading] = useState(false);\n const [name, setName] = useState('');\n\n const handleSelect = async (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n event.target.value = '';\n if (!file) return;\n\n setUploading(true);\n try {\n const uploaded = await uploadFileToFiles(file, FILE_FOLDERS.documents);\n await addDocument.mutateAsync({\n applicationId,\n fileId: uploaded.id,\n name: name.trim() || file.name,\n requirement: requirement ?? null,\n });\n notify.success('Document uploaded', uploaded.name);\n setName('');\n onAdded?.();\n } catch (error) {\n notify.error('Upload failed', describeError(error));\n } finally {\n setUploading(false);\n }\n };\n\n const busy = uploading || addDocument.isPending;\n\n return (\n <div className=\"flex flex-col gap-2 sm:flex-row sm:items-center\">\n <Input\n value={name}\n onChange={(e) => setName(e.target.value)}\n placeholder={requirement ? `Name (default: ${requirement})` : 'Document name (optional)'}\n aria-label=\"Document name\"\n className=\"sm:max-w-xs\"\n disabled={busy || disabled}\n />\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"sm\"\n disabled={busy || disabled}\n onClick={() => inputRef.current?.click()}\n >\n {busy ? <Loader2 className=\"h-4 w-4 animate-spin\" /> : <Upload className=\"h-4 w-4\" />}\n {busy ? 'Uploading…' : 'Upload document'}\n </Button>\n <input\n ref={inputRef}\n id={inputId}\n type=\"file\"\n className=\"sr-only\"\n aria-label=\"Choose a file to upload\"\n onChange={(event) => void handleSelect(event)}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;AA0BA,SAAgB,EAAoB,EAClC,kBACA,gBACA,YACA,cAAW,MACgB;CAC3B,IAAM,IAAW,EAAgC,KAAK,EAChD,IAAU,GAAO,EACjB,IAAc,GAAmB,EACjC,CAAC,GAAW,KAAgB,EAAS,GAAM,EAC3C,CAAC,GAAM,KAAW,EAAS,GAAG,EAE9B,IAAe,OAAO,MAA+C;EACzE,IAAM,IAAO,EAAM,OAAO,QAAQ;AAClC,QAAM,OAAO,QAAQ,IAChB,GAEL;KAAa,GAAK;AAClB,OAAI;IACF,IAAM,IAAW,MAAM,EAAkB,GAAM,EAAa,UAAU;AAStE,IARA,MAAM,EAAY,YAAY;KAC5B;KACA,QAAQ,EAAS;KACjB,MAAM,EAAK,MAAM,IAAI,EAAK;KAC1B,aAAa,KAAe;KAC7B,CAAC,EACF,EAAO,QAAQ,qBAAqB,EAAS,KAAK,EAClD,EAAQ,GAAG,EACX,KAAW;YACJ,GAAO;AACd,MAAO,MAAM,iBAAiB,EAAc,EAAM,CAAC;aAC3C;AACR,MAAa,GAAM;;;IAIjB,IAAO,KAAa,EAAY;AAEtC,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,GAAD;IACE,OAAO;IACP,WAAW,MAAM,EAAQ,EAAE,OAAO,MAAM;IACxC,aAAa,IAAc,kBAAkB,EAAY,KAAK;IAC9D,cAAW;IACX,WAAU;IACV,UAAU,KAAQ;IAClB,CAAA;GACF,kBAAC,GAAD;IACE,MAAK;IACL,SAAQ;IACR,MAAK;IACL,UAAU,KAAQ;IAClB,eAAe,EAAS,SAAS,OAAO;cAL1C,CAOG,IAAO,kBAAC,GAAD,EAAS,WAAU,wBAAyB,CAAA,GAAG,kBAAC,GAAD,EAAQ,WAAU,WAAY,CAAA,EACpF,IAAO,eAAe,kBAChB;;GACT,kBAAC,SAAD;IACE,KAAK;IACL,IAAI;IACJ,MAAK;IACL,WAAU;IACV,cAAW;IACX,WAAW,MAAU,KAAK,EAAa,EAAM;IAC7C,CAAA;GACE"}
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState.js","names":[],"sources":["../../../src/govcitizenhub/components/EmptyState.tsx"],"sourcesContent":["/**\n * Empty State Component\n * @module govcitizenhub/components\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface EmptyStateProps {\n icon?: ReactNode;\n /** On-brand illustration name → empty-data, empty-search, empty-files, empty-people, etc. */\n illustration?: string;\n title: string;\n description?: string;\n action?: ReactNode;\n className?: string;\n}\n\nexport const EmptyState: FC<EmptyStateProps> = ({ icon, illustration, title, description, action, className }) => {\n if (illustration) {\n return (\n <IllustratedEmptyState\n illustration={illustration}\n title={title}\n description={description}\n action={action}\n className={className}\n />\n );\n }\n\n return (\n <div className={cn('flex flex-col items-center justify-center py-12 px-4 text-center', className)}>\n {icon && <div className=\"mb-4 text-text-secondary opacity-50\">{icon}</div>}\n <h3 className=\"text-lg font-medium text-text-primary\">{title}</h3>\n {description && <p className=\"mt-2 text-sm text-text-secondary max-w-sm\">{description}</p>}\n {action && <div className=\"mt-6\">{action}</div>}\n </div>\n );\n};\n"],"mappings":";;;;AAmBA,IAAa,KAAmC,EAAE,SAAM,iBAAc,UAAO,gBAAa,WAAQ,mBAC5F,IAEA,kBAAC,GAAD;CACgB;CACP;CACM;CACL;CACG;CACX,CAAA,GAKJ,kBAAC,OAAD;CAAK,WAAW,EAAG,oEAAoE,EAAU;WAAjG;EACG,KAAQ,kBAAC,OAAD;GAAK,WAAU;aAAuC;GAAW,CAAA;EAC1E,kBAAC,MAAD;GAAI,WAAU;aAAyC;GAAW,CAAA;EACjE,KAAe,kBAAC,KAAD;GAAG,WAAU;aAA6C;GAAgB,CAAA;EACzF,KAAU,kBAAC,OAAD;GAAK,WAAU;aAAQ;GAAa,CAAA;EAC3C"}
1
+ {"version":3,"file":"EmptyState.js","names":[],"sources":["../../../src/govcitizenhub/components/EmptyState.tsx"],"sourcesContent":["/**\n * Empty State Component\n * @module govcitizenhub/components\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface EmptyStateProps {\n icon?: ReactNode;\n /** On-brand illustration name → empty-data, empty-search, empty-files, empty-people, etc. */\n illustration?: string;\n title: string;\n description?: string;\n action?: ReactNode;\n className?: string;\n}\n\nexport const EmptyState: FC<EmptyStateProps> = ({\n icon,\n illustration,\n title,\n description,\n action,\n className,\n}) => {\n if (illustration) {\n return (\n <IllustratedEmptyState\n illustration={illustration}\n title={title}\n description={description}\n action={action}\n className={className}\n />\n );\n }\n\n return (\n <div\n className={cn('flex flex-col items-center justify-center py-12 px-4 text-center', className)}\n >\n {icon && <div className=\"mb-4 text-text-secondary opacity-50\">{icon}</div>}\n <h3 className=\"text-lg font-medium text-text-primary\">{title}</h3>\n {description && <p className=\"mt-2 text-sm text-text-secondary max-w-sm\">{description}</p>}\n {action && <div className=\"mt-6\">{action}</div>}\n </div>\n );\n};\n"],"mappings":";;;;AAmBA,IAAa,KAAmC,EAC9C,SACA,iBACA,UACA,gBACA,WACA,mBAEI,IAEA,kBAAC,GAAD;CACgB;CACP;CACM;CACL;CACG;CACX,CAAA,GAKJ,kBAAC,OAAD;CACE,WAAW,EAAG,oEAAoE,EAAU;WAD9F;EAGG,KAAQ,kBAAC,OAAD;GAAK,WAAU;aAAuC;GAAW,CAAA;EAC1E,kBAAC,MAAD;GAAI,WAAU;aAAyC;GAAW,CAAA;EACjE,KAAe,kBAAC,KAAD;GAAG,WAAU;aAA6C;GAAgB,CAAA;EACzF,KAAU,kBAAC,OAAD;GAAK,WAAU;aAAQ;GAAa,CAAA;EAC3C"}
@@ -1 +1 @@
1
- {"version":3,"file":"FilterTabs.js","names":[],"sources":["../../../src/govcitizenhub/components/FilterTabs.tsx"],"sourcesContent":["/**\n * FilterTabs — a segmented status/enum filter control.\n * @module govcitizenhub/components\n */\n\nimport { cn } from '../utils/cn';\n\nexport interface FilterOption<V extends string> {\n value: V;\n label: string;\n count?: number;\n}\n\ninterface FilterTabsProps<V extends string> {\n options: FilterOption<V>[];\n value: V;\n onChange: (value: V) => void;\n className?: string;\n}\n\nexport function FilterTabs<V extends string>({ options, value, onChange, className }: FilterTabsProps<V>) {\n return (\n <div\n role=\"tablist\"\n className={cn(\n 'inline-flex flex-wrap items-center gap-1 rounded-xl border border-border-seam bg-bg-surface p-1',\n className\n )}\n >\n {options.map((opt) => {\n const active = opt.value === value;\n return (\n <button\n key={opt.value}\n type=\"button\"\n role=\"tab\"\n aria-selected={active}\n onClick={() => onChange(opt.value)}\n className={cn(\n 'rounded-lg px-3 py-1.5 text-sm font-medium transition-colors',\n active\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'text-text-secondary hover:bg-bg-sunken hover:text-text-primary'\n )}\n >\n {opt.label}\n {typeof opt.count === 'number' && (\n <span\n className={cn(\n 'ml-1.5 rounded-full px-1.5 py-0.5 text-xs tabular-nums',\n active ? 'bg-black/10 dark:bg-white/15' : 'bg-bg-sunken'\n )}\n >\n {opt.count}\n </span>\n )}\n </button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;AAoBA,SAAgB,EAA6B,EAAE,YAAS,UAAO,aAAU,gBAAiC;AACxG,QACE,kBAAC,OAAD;EACE,MAAK;EACL,WAAW,EACT,mGACA,EACD;YAEA,EAAQ,KAAK,MAAQ;GACpB,IAAM,IAAS,EAAI,UAAU;AAC7B,UACE,kBAAC,UAAD;IAEE,MAAK;IACL,MAAK;IACL,iBAAe;IACf,eAAe,EAAS,EAAI,MAAM;IAClC,WAAW,EACT,gEACA,IACI,kDACA,iEACL;cAXH,CAaG,EAAI,OACJ,OAAO,EAAI,SAAU,YACpB,kBAAC,QAAD;KACE,WAAW,EACT,0DACA,IAAS,iCAAiC,eAC3C;eAEA,EAAI;KACA,CAAA,CAEF;MAvBF,EAAI,MAuBF;IAEX;EACE,CAAA"}
1
+ {"version":3,"file":"FilterTabs.js","names":[],"sources":["../../../src/govcitizenhub/components/FilterTabs.tsx"],"sourcesContent":["/**\n * FilterTabs — a segmented status/enum filter control.\n * @module govcitizenhub/components\n */\n\nimport { cn } from '../utils/cn';\n\nexport interface FilterOption<V extends string> {\n value: V;\n label: string;\n count?: number;\n}\n\ninterface FilterTabsProps<V extends string> {\n options: FilterOption<V>[];\n value: V;\n onChange: (value: V) => void;\n className?: string;\n}\n\nexport function FilterTabs<V extends string>({\n options,\n value,\n onChange,\n className,\n}: FilterTabsProps<V>) {\n return (\n <div\n role=\"tablist\"\n className={cn(\n 'inline-flex flex-wrap items-center gap-1 rounded-xl border border-border-seam bg-bg-surface p-1',\n className\n )}\n >\n {options.map((opt) => {\n const active = opt.value === value;\n return (\n <button\n key={opt.value}\n type=\"button\"\n role=\"tab\"\n aria-selected={active}\n onClick={() => onChange(opt.value)}\n className={cn(\n 'rounded-lg px-3 py-1.5 text-sm font-medium transition-colors',\n active\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'text-text-secondary hover:bg-bg-sunken hover:text-text-primary'\n )}\n >\n {opt.label}\n {typeof opt.count === 'number' && (\n <span\n className={cn(\n 'ml-1.5 rounded-full px-1.5 py-0.5 text-xs tabular-nums',\n active ? 'bg-black/10 dark:bg-white/15' : 'bg-bg-sunken'\n )}\n >\n {opt.count}\n </span>\n )}\n </button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;AAoBA,SAAgB,EAA6B,EAC3C,YACA,UACA,aACA,gBACqB;AACrB,QACE,kBAAC,OAAD;EACE,MAAK;EACL,WAAW,EACT,mGACA,EACD;YAEA,EAAQ,KAAK,MAAQ;GACpB,IAAM,IAAS,EAAI,UAAU;AAC7B,UACE,kBAAC,UAAD;IAEE,MAAK;IACL,MAAK;IACL,iBAAe;IACf,eAAe,EAAS,EAAI,MAAM;IAClC,WAAW,EACT,gEACA,IACI,kDACA,iEACL;cAXH,CAaG,EAAI,OACJ,OAAO,EAAI,SAAU,YACpB,kBAAC,QAAD;KACE,WAAW,EACT,0DACA,IAAS,iCAAiC,eAC3C;eAEA,EAAI;KACA,CAAA,CAEF;MAvBF,EAAI,MAuBF;IAEX;EACE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"GovCharts.js","names":[],"sources":["../../../src/govcitizenhub/components/GovCharts.tsx"],"sourcesContent":["/**\n * Token-driven chart primitives for GovCitizenHub analytics surfaces.\n * @module govcitizenhub/components\n *\n * All fills/strokes resolve to `--color-chart-*` CSS variables so the charts\n * theme with the rest of the platform (light + dark) and never hard-code a hex.\n * Every chart renders its own empty state so callers can hand it real (possibly\n * empty) query data without branching.\n */\n\nimport { useId } from 'react';\nimport {\n Area,\n AreaChart,\n Bar,\n BarChart,\n Cell,\n Pie,\n PieChart,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts';\n\nconst CHART_TOOLTIP_STYLE = {\n background: 'var(--color-bg-surface)',\n border: '1px solid var(--color-border-default)',\n borderRadius: '10px',\n fontSize: '12px',\n color: 'var(--color-text-primary)',\n boxShadow: 'var(--shadow-elevation-2)',\n} as const;\n\n/** The categorical palette, in draw order. Backed by semantic chart tokens. */\nexport const CHART_SERIES_COLORS = [\n 'var(--color-chart-1)',\n 'var(--color-chart-2)',\n 'var(--color-chart-3)',\n 'var(--color-chart-4)',\n 'var(--color-chart-5)',\n] as const;\n\nfunction ChartEmpty({ label, height }: { label: string; height: number }) {\n return (\n <div\n className=\"flex items-center justify-center rounded-card border border-dashed border-border-subtle text-sm text-text-muted\"\n style={{ height }}\n >\n {label}\n </div>\n );\n}\n\nexport interface AreaPoint {\n label: string;\n value: number;\n}\n\nexport function GovAreaChart({\n data,\n height = 260,\n emptyLabel = 'Not enough data yet',\n}: {\n data: AreaPoint[];\n height?: number;\n emptyLabel?: string;\n}) {\n const gradientId = useId().replace(/:/g, '');\n if (data.length === 0) {\n return <ChartEmpty label={emptyLabel} height={height} />;\n }\n\n return (\n <ResponsiveContainer width=\"100%\" height={height}>\n <AreaChart data={data} margin={{ top: 8, right: 12, left: 4, bottom: 4 }}>\n <defs>\n <linearGradient id={`gov-area-${gradientId}`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor=\"var(--color-chart-2)\" stopOpacity={0.45} />\n <stop offset=\"100%\" stopColor=\"var(--color-chart-1)\" stopOpacity={0.04} />\n </linearGradient>\n <linearGradient id={`gov-stroke-${gradientId}`} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"0\">\n <stop offset=\"0%\" stopColor=\"var(--color-chart-1)\" />\n <stop offset=\"100%\" stopColor=\"var(--color-chart-2)\" />\n </linearGradient>\n </defs>\n <XAxis\n dataKey=\"label\"\n tick={{ fill: 'var(--color-text-muted)', fontSize: 11 }}\n tickLine={false}\n axisLine={{ stroke: 'var(--color-border-subtle)' }}\n minTickGap={24}\n />\n <YAxis\n tick={{ fill: 'var(--color-text-muted)', fontSize: 11 }}\n tickLine={false}\n axisLine={false}\n width={40}\n allowDecimals={false}\n />\n <Tooltip contentStyle={CHART_TOOLTIP_STYLE} cursor={{ stroke: 'var(--color-border-strong)' }} />\n <Area\n type=\"monotone\"\n dataKey=\"value\"\n name=\"Applications\"\n stroke={`url(#gov-stroke-${gradientId})`}\n strokeWidth={2.5}\n fill={`url(#gov-area-${gradientId})`}\n dot={false}\n activeDot={{ r: 4, fill: 'var(--color-chart-2)', stroke: 'var(--color-bg-surface)', strokeWidth: 2 }}\n />\n </AreaChart>\n </ResponsiveContainer>\n );\n}\n\nexport interface DonutSlice {\n name: string;\n value: number;\n color?: string;\n}\n\nexport function GovDonutChart({\n data,\n height = 240,\n centerLabel,\n centerValue,\n emptyLabel = 'No data yet',\n}: {\n data: DonutSlice[];\n height?: number;\n centerLabel?: string;\n centerValue?: string;\n emptyLabel?: string;\n}) {\n const total = data.reduce((sum, slice) => sum + slice.value, 0);\n if (total === 0) {\n return <ChartEmpty label={emptyLabel} height={height} />;\n }\n\n return (\n <div className=\"relative\" style={{ height }}>\n <ResponsiveContainer width=\"100%\" height={height}>\n <PieChart>\n <Pie\n data={data}\n cx=\"50%\"\n cy=\"50%\"\n innerRadius=\"62%\"\n outerRadius=\"88%\"\n paddingAngle={2}\n dataKey=\"value\"\n nameKey=\"name\"\n stroke=\"var(--color-bg-surface)\"\n strokeWidth={2}\n >\n {data.map((slice, index) => (\n <Cell key={slice.name} fill={slice.color ?? CHART_SERIES_COLORS[index % CHART_SERIES_COLORS.length]} />\n ))}\n </Pie>\n <Tooltip contentStyle={CHART_TOOLTIP_STYLE} />\n </PieChart>\n </ResponsiveContainer>\n {centerValue ? (\n <div className=\"pointer-events-none absolute inset-0 flex flex-col items-center justify-center text-center\">\n <span className=\"text-2xl font-bold tabular-nums text-text-primary\">{centerValue}</span>\n {centerLabel ? <span className=\"text-xs text-text-muted\">{centerLabel}</span> : null}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport interface BarDatum {\n name: string;\n value: number;\n}\n\nexport function GovBarChart({\n data,\n height = 260,\n emptyLabel = 'No data yet',\n}: {\n data: BarDatum[];\n height?: number;\n emptyLabel?: string;\n}) {\n const gradientId = useId().replace(/:/g, '');\n if (data.length === 0 || data.every((datum) => datum.value === 0)) {\n return <ChartEmpty label={emptyLabel} height={height} />;\n }\n\n return (\n <ResponsiveContainer width=\"100%\" height={height}>\n <BarChart data={data} margin={{ top: 8, right: 12, left: 4, bottom: 4 }}>\n <defs>\n <linearGradient id={`gov-bar-${gradientId}`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor=\"var(--color-chart-2)\" />\n <stop offset=\"100%\" stopColor=\"var(--color-chart-1)\" />\n </linearGradient>\n </defs>\n <XAxis\n dataKey=\"name\"\n tick={{ fill: 'var(--color-text-muted)', fontSize: 11 }}\n tickLine={false}\n axisLine={{ stroke: 'var(--color-border-subtle)' }}\n interval={0}\n />\n <YAxis\n tick={{ fill: 'var(--color-text-muted)', fontSize: 11 }}\n tickLine={false}\n axisLine={false}\n width={40}\n allowDecimals={false}\n />\n <Tooltip contentStyle={CHART_TOOLTIP_STYLE} cursor={{ fill: 'var(--color-bg-sunken)', opacity: 0.6 }} />\n <Bar dataKey=\"value\" name=\"Count\" fill={`url(#gov-bar-${gradientId})`} radius={[6, 6, 0, 0]} maxBarSize={48} />\n </BarChart>\n </ResponsiveContainer>\n );\n}\n\nexport interface ChartLegendItem {\n label: string;\n color: string;\n value?: string | number;\n}\n\nexport function ChartLegend({ items, className = '' }: { items: ChartLegendItem[]; className?: string }) {\n return (\n <ul className={`flex flex-col gap-2 ${className}`}>\n {items.map((item) => (\n <li key={item.label} className=\"flex items-center gap-2 text-sm\">\n <span aria-hidden className=\"h-3 w-3 shrink-0 rounded-full\" style={{ backgroundColor: item.color }} />\n <span className=\"text-text-secondary\">{item.label}</span>\n {item.value !== undefined ? (\n <span className=\"ml-auto font-semibold tabular-nums text-text-primary\">{item.value}</span>\n ) : null}\n </li>\n ))}\n </ul>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAyBA,IAAM,IAAsB;CAC1B,YAAY;CACZ,QAAQ;CACR,cAAc;CACd,UAAU;CACV,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D;EAAI,WAAW,uBAAuB;YACnC,EAAM,KAAK,MACV,kBAAC,MAAD;GAAqB,WAAU;aAA/B;IACE,kBAAC,QAAD;KAAM,eAAA;KAAY,WAAU;KAAgC,OAAO,EAAE,iBAAiB,EAAK,OAAO;KAAI,CAAA;IACtG,kBAAC,QAAD;KAAM,WAAU;eAAuB,EAAK;KAAa,CAAA;IACxD,EAAK,UAAU,KAAA,IAEZ,OADF,kBAAC,QAAD;KAAM,WAAU;eAAwD,EAAK;KAAa,CAAA;IAEzF;KANI,EAAK,MAMT,CACL;EACC,CAAA"}
1
+ {"version":3,"file":"GovCharts.js","names":[],"sources":["../../../src/govcitizenhub/components/GovCharts.tsx"],"sourcesContent":["/**\n * Token-driven chart primitives for GovCitizenHub analytics surfaces.\n * @module govcitizenhub/components\n *\n * All fills/strokes resolve to `--color-chart-*` CSS variables so the charts\n * theme with the rest of the platform (light + dark) and never hard-code a hex.\n * Every chart renders its own empty state so callers can hand it real (possibly\n * empty) query data without branching.\n */\n\nimport { useId } from 'react';\nimport {\n Area,\n AreaChart,\n Bar,\n BarChart,\n Cell,\n Pie,\n PieChart,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from 'recharts';\n\nconst CHART_TOOLTIP_STYLE = {\n background: 'var(--color-bg-surface)',\n border: '1px solid var(--color-border-default)',\n borderRadius: '10px',\n fontSize: '12px',\n color: 'var(--color-text-primary)',\n boxShadow: 'var(--shadow-elevation-2)',\n} as const;\n\n/** The categorical palette, in draw order. Backed by semantic chart tokens. */\nexport const CHART_SERIES_COLORS = [\n 'var(--color-chart-1)',\n 'var(--color-chart-2)',\n 'var(--color-chart-3)',\n 'var(--color-chart-4)',\n 'var(--color-chart-5)',\n] as const;\n\nfunction ChartEmpty({ label, height }: { label: string; height: number }) {\n return (\n <div\n className=\"flex items-center justify-center rounded-card border border-dashed border-border-subtle text-sm text-text-muted\"\n style={{ height }}\n >\n {label}\n </div>\n );\n}\n\nexport interface AreaPoint {\n label: string;\n value: number;\n}\n\nexport function GovAreaChart({\n data,\n height = 260,\n emptyLabel = 'Not enough data yet',\n}: {\n data: AreaPoint[];\n height?: number;\n emptyLabel?: string;\n}) {\n const gradientId = useId().replace(/:/g, '');\n if (data.length === 0) {\n return <ChartEmpty label={emptyLabel} height={height} />;\n }\n\n return (\n <ResponsiveContainer width=\"100%\" height={height}>\n <AreaChart data={data} margin={{ top: 8, right: 12, left: 4, bottom: 4 }}>\n <defs>\n <linearGradient id={`gov-area-${gradientId}`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor=\"var(--color-chart-2)\" stopOpacity={0.45} />\n <stop offset=\"100%\" stopColor=\"var(--color-chart-1)\" stopOpacity={0.04} />\n </linearGradient>\n <linearGradient id={`gov-stroke-${gradientId}`} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"0\">\n <stop offset=\"0%\" stopColor=\"var(--color-chart-1)\" />\n <stop offset=\"100%\" stopColor=\"var(--color-chart-2)\" />\n </linearGradient>\n </defs>\n <XAxis\n dataKey=\"label\"\n tick={{ fill: 'var(--color-text-muted)', fontSize: 11 }}\n tickLine={false}\n axisLine={{ stroke: 'var(--color-border-subtle)' }}\n minTickGap={24}\n />\n <YAxis\n tick={{ fill: 'var(--color-text-muted)', fontSize: 11 }}\n tickLine={false}\n axisLine={false}\n width={40}\n allowDecimals={false}\n />\n <Tooltip\n contentStyle={CHART_TOOLTIP_STYLE}\n cursor={{ stroke: 'var(--color-border-strong)' }}\n />\n <Area\n type=\"monotone\"\n dataKey=\"value\"\n name=\"Applications\"\n stroke={`url(#gov-stroke-${gradientId})`}\n strokeWidth={2.5}\n fill={`url(#gov-area-${gradientId})`}\n dot={false}\n activeDot={{\n r: 4,\n fill: 'var(--color-chart-2)',\n stroke: 'var(--color-bg-surface)',\n strokeWidth: 2,\n }}\n />\n </AreaChart>\n </ResponsiveContainer>\n );\n}\n\nexport interface DonutSlice {\n name: string;\n value: number;\n color?: string;\n}\n\nexport function GovDonutChart({\n data,\n height = 240,\n centerLabel,\n centerValue,\n emptyLabel = 'No data yet',\n}: {\n data: DonutSlice[];\n height?: number;\n centerLabel?: string;\n centerValue?: string;\n emptyLabel?: string;\n}) {\n const total = data.reduce((sum, slice) => sum + slice.value, 0);\n if (total === 0) {\n return <ChartEmpty label={emptyLabel} height={height} />;\n }\n\n return (\n <div className=\"relative\" style={{ height }}>\n <ResponsiveContainer width=\"100%\" height={height}>\n <PieChart>\n <Pie\n data={data}\n cx=\"50%\"\n cy=\"50%\"\n innerRadius=\"62%\"\n outerRadius=\"88%\"\n paddingAngle={2}\n dataKey=\"value\"\n nameKey=\"name\"\n stroke=\"var(--color-bg-surface)\"\n strokeWidth={2}\n >\n {data.map((slice, index) => (\n <Cell\n key={slice.name}\n fill={slice.color ?? CHART_SERIES_COLORS[index % CHART_SERIES_COLORS.length]}\n />\n ))}\n </Pie>\n <Tooltip contentStyle={CHART_TOOLTIP_STYLE} />\n </PieChart>\n </ResponsiveContainer>\n {centerValue ? (\n <div className=\"pointer-events-none absolute inset-0 flex flex-col items-center justify-center text-center\">\n <span className=\"text-2xl font-bold tabular-nums text-text-primary\">{centerValue}</span>\n {centerLabel ? <span className=\"text-xs text-text-muted\">{centerLabel}</span> : null}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport interface BarDatum {\n name: string;\n value: number;\n}\n\nexport function GovBarChart({\n data,\n height = 260,\n emptyLabel = 'No data yet',\n}: {\n data: BarDatum[];\n height?: number;\n emptyLabel?: string;\n}) {\n const gradientId = useId().replace(/:/g, '');\n if (data.length === 0 || data.every((datum) => datum.value === 0)) {\n return <ChartEmpty label={emptyLabel} height={height} />;\n }\n\n return (\n <ResponsiveContainer width=\"100%\" height={height}>\n <BarChart data={data} margin={{ top: 8, right: 12, left: 4, bottom: 4 }}>\n <defs>\n <linearGradient id={`gov-bar-${gradientId}`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor=\"var(--color-chart-2)\" />\n <stop offset=\"100%\" stopColor=\"var(--color-chart-1)\" />\n </linearGradient>\n </defs>\n <XAxis\n dataKey=\"name\"\n tick={{ fill: 'var(--color-text-muted)', fontSize: 11 }}\n tickLine={false}\n axisLine={{ stroke: 'var(--color-border-subtle)' }}\n interval={0}\n />\n <YAxis\n tick={{ fill: 'var(--color-text-muted)', fontSize: 11 }}\n tickLine={false}\n axisLine={false}\n width={40}\n allowDecimals={false}\n />\n <Tooltip\n contentStyle={CHART_TOOLTIP_STYLE}\n cursor={{ fill: 'var(--color-bg-sunken)', opacity: 0.6 }}\n />\n <Bar\n dataKey=\"value\"\n name=\"Count\"\n fill={`url(#gov-bar-${gradientId})`}\n radius={[6, 6, 0, 0]}\n maxBarSize={48}\n />\n </BarChart>\n </ResponsiveContainer>\n );\n}\n\nexport interface ChartLegendItem {\n label: string;\n color: string;\n value?: string | number;\n}\n\nexport function ChartLegend({\n items,\n className = '',\n}: {\n items: ChartLegendItem[];\n className?: string;\n}) {\n return (\n <ul className={`flex flex-col gap-2 ${className}`}>\n {items.map((item) => (\n <li key={item.label} className=\"flex items-center gap-2 text-sm\">\n <span\n aria-hidden\n className=\"h-3 w-3 shrink-0 rounded-full\"\n style={{ backgroundColor: item.color }}\n />\n <span className=\"text-text-secondary\">{item.label}</span>\n {item.value !== undefined ? (\n <span className=\"ml-auto font-semibold tabular-nums text-text-primary\">\n {item.value}\n </span>\n ) : null}\n </li>\n ))}\n </ul>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAyBA,IAAM,IAAsB;CAC1B,YAAY;CACZ,QAAQ;CACR,cAAc;CACd,UAAU;CACV,OAAO;CACP,WAAW;CACZ,EAGY,IAAsB;CACjC;CACA;CACA;CACA;CACA;CACD;AAED,SAAS,EAAW,EAAE,UAAO,aAA6C;AACxE,QACE,kBAAC,OAAD;EACE,WAAU;EACV,OAAO,EAAE,WAAQ;YAEhB;EACG,CAAA;;AASV,SAAgB,EAAa,EAC3B,SACA,YAAS,KACT,gBAAa,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IZ,OAHF,kBAAC,QAAD;KAAM,WAAU;eACb,EAAK;KACD,CAAA;IAEN;KAZI,EAAK,MAYT,CACL;EACC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.js","names":[],"sources":["../../../src/govcitizenhub/components/Pagination.tsx"],"sourcesContent":["/**\n * Pagination — cursor-aware Prev/Next control for Gov* connection lists.\n * @module govcitizenhub/components\n */\n\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface PaginationProps {\n page: number;\n pageSize: number;\n itemCount: number;\n hasMore: boolean;\n onPageChange: (page: number) => void;\n className?: string;\n}\n\nexport function Pagination({ page, pageSize, itemCount, hasMore, onPageChange, className }: PaginationProps) {\n if (page === 0 && !hasMore) return null;\n\n const from = itemCount === 0 ? 0 : page * pageSize + 1;\n const to = page * pageSize + itemCount;\n\n return (\n <div className={cn('mt-4 flex flex-col items-center justify-between gap-3 sm:flex-row', className)}>\n <p className=\"text-sm text-text-secondary tabular-nums\" aria-live=\"polite\">\n Showing {from}–{to}\n </p>\n <div className=\"flex items-center gap-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => onPageChange(page - 1)}\n disabled={page === 0}\n aria-label=\"Previous page\"\n >\n <ChevronLeft className=\"mr-1 h-4 w-4\" /> Previous\n </Button>\n <span className=\"min-w-[4.5rem] text-center text-sm text-text-secondary tabular-nums\">Page {page + 1}</span>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => onPageChange(page + 1)}\n disabled={!hasMore}\n aria-label=\"Next page\"\n >\n Next <ChevronRight className=\"ml-1 h-4 w-4\" />\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;AAkBA,SAAgB,EAAW,EAAE,SAAM,aAAU,cAAW,YAAS,iBAAc,gBAA8B;AAC3G,KAAI,MAAS,KAAK,CAAC,EAAS,QAAO;CAEnC,IAAM,IAAO,MAAc,IAAI,IAAI,IAAO,IAAW,GAC/C,IAAK,IAAO,IAAW;AAE7B,QACE,kBAAC,OAAD;EAAK,WAAW,EAAG,qEAAqE,EAAU;YAAlG,CACE,kBAAC,KAAD;GAAG,WAAU;GAA2C,aAAU;aAAlE;IAA2E;IAChE;IAAK;IAAE;IACd;MACJ,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,GAAD;KACE,SAAQ;KACR,MAAK;KACL,eAAe,EAAa,IAAO,EAAE;KACrC,UAAU,MAAS;KACnB,cAAW;eALb,CAOE,kBAAC,GAAD,EAAa,WAAU,gBAAiB,CAAA,EAAA,YACjC;;IACT,kBAAC,QAAD;KAAM,WAAU;eAAhB,CAAsF,SAAM,IAAO,EAAS;;IAC5G,kBAAC,GAAD;KACE,SAAQ;KACR,MAAK;KACL,eAAe,EAAa,IAAO,EAAE;KACrC,UAAU,CAAC;KACX,cAAW;eALb,CAMC,SACM,kBAAC,GAAD,EAAc,WAAU,gBAAiB,CAAA,CACvC;;IACL;KACF"}
1
+ {"version":3,"file":"Pagination.js","names":[],"sources":["../../../src/govcitizenhub/components/Pagination.tsx"],"sourcesContent":["/**\n * Pagination — cursor-aware Prev/Next control for Gov* connection lists.\n * @module govcitizenhub/components\n */\n\nimport { ChevronLeft, ChevronRight } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface PaginationProps {\n page: number;\n pageSize: number;\n itemCount: number;\n hasMore: boolean;\n onPageChange: (page: number) => void;\n className?: string;\n}\n\nexport function Pagination({\n page,\n pageSize,\n itemCount,\n hasMore,\n onPageChange,\n className,\n}: PaginationProps) {\n if (page === 0 && !hasMore) return null;\n\n const from = itemCount === 0 ? 0 : page * pageSize + 1;\n const to = page * pageSize + itemCount;\n\n return (\n <div\n className={cn('mt-4 flex flex-col items-center justify-between gap-3 sm:flex-row', className)}\n >\n <p className=\"text-sm text-text-secondary tabular-nums\" aria-live=\"polite\">\n Showing {from}–{to}\n </p>\n <div className=\"flex items-center gap-2\">\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => onPageChange(page - 1)}\n disabled={page === 0}\n aria-label=\"Previous page\"\n >\n <ChevronLeft className=\"mr-1 h-4 w-4\" /> Previous\n </Button>\n <span className=\"min-w-[4.5rem] text-center text-sm text-text-secondary tabular-nums\">\n Page {page + 1}\n </span>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => onPageChange(page + 1)}\n disabled={!hasMore}\n aria-label=\"Next page\"\n >\n Next <ChevronRight className=\"ml-1 h-4 w-4\" />\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;AAkBA,SAAgB,EAAW,EACzB,SACA,aACA,cACA,YACA,iBACA,gBACkB;AAClB,KAAI,MAAS,KAAK,CAAC,EAAS,QAAO;CAEnC,IAAM,IAAO,MAAc,IAAI,IAAI,IAAO,IAAW,GAC/C,IAAK,IAAO,IAAW;AAE7B,QACE,kBAAC,OAAD;EACE,WAAW,EAAG,qEAAqE,EAAU;YAD/F,CAGE,kBAAC,KAAD;GAAG,WAAU;GAA2C,aAAU;aAAlE;IAA2E;IAChE;IAAK;IAAE;IACd;MACJ,kBAAC,OAAD;GAAK,WAAU;aAAf;IACE,kBAAC,GAAD;KACE,SAAQ;KACR,MAAK;KACL,eAAe,EAAa,IAAO,EAAE;KACrC,UAAU,MAAS;KACnB,cAAW;eALb,CAOE,kBAAC,GAAD,EAAa,WAAU,gBAAiB,CAAA,EAAA,YACjC;;IACT,kBAAC,QAAD;KAAM,WAAU;eAAhB,CAAsF,SAC9E,IAAO,EACR;;IACP,kBAAC,GAAD;KACE,SAAQ;KACR,MAAK;KACL,eAAe,EAAa,IAAO,EAAE;KACrC,UAAU,CAAC;KACX,cAAW;eALb,CAMC,SACM,kBAAC,GAAD,EAAc,WAAU,gBAAiB,CAAA,CACvC;;IACL;KACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"StateViews.js","names":[],"sources":["../../../src/govcitizenhub/components/StateViews.tsx"],"sourcesContent":["/**\n * Shared loading / error / section state views\n * @module govcitizenhub/components\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { AlertCircle } from 'lucide-react';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface LoadingViewProps {\n label?: string;\n className?: string;\n}\n\nexport const LoadingView: FC<LoadingViewProps> = ({ label = 'Loading…', className }) => (\n <div className={cn('flex min-h-[40vh] flex-col items-center justify-center gap-3', className)}>\n <Spinner size=\"lg\" />\n <p className=\"text-sm text-text-secondary\">{label}</p>\n </div>\n);\n\ninterface ErrorViewProps {\n title?: string;\n message?: string;\n onRetry?: () => void;\n className?: string;\n}\n\nexport const ErrorView: FC<ErrorViewProps> = ({ title = 'Something went wrong', message, onRetry, className }) => (\n <div className={cn('flex min-h-[40vh] flex-col items-center justify-center gap-4 text-center', className)}>\n <AlertCircle className=\"h-10 w-10 text-status-error-text\" />\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">{title}</h2>\n {message && <p className=\"mt-1 max-w-md text-sm text-text-secondary\">{message}</p>}\n </div>\n {onRetry && (\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n Retry\n </button>\n )}\n </div>\n);\n\ninterface SectionProps {\n title: string;\n description?: string;\n action?: ReactNode;\n children: ReactNode;\n className?: string;\n}\n\nexport const Section: FC<SectionProps> = ({ title, description, action, children, className }) => (\n <section className={cn('mt-8 first:mt-0', className)}>\n <div className=\"mb-3 flex items-end justify-between gap-3\">\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">{title}</h2>\n {description && <p className=\"mt-0.5 text-sm text-text-secondary\">{description}</p>}\n </div>\n {action && <div className=\"shrink-0\">{action}</div>}\n </div>\n {children}\n </section>\n);\n"],"mappings":";;;;;AAeA,IAAa,KAAqC,EAAE,WAAQ,YAAY,mBACtE,kBAAC,OAAD;CAAK,WAAW,EAAG,gEAAgE,EAAU;WAA7F,CACE,kBAAC,GAAD,EAAS,MAAK,MAAO,CAAA,EACrB,kBAAC,KAAD;EAAG,WAAU;YAA+B;EAAU,CAAA,CAClD;IAUK,KAAiC,EAAE,WAAQ,wBAAwB,YAAS,YAAS,mBAChG,kBAAC,OAAD;CAAK,WAAW,EAAG,4EAA4E,EAAU;WAAzG;EACE,kBAAC,GAAD,EAAa,WAAU,oCAAqC,CAAA;EAC5D,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;GAAI,WAAU;aAA2C;GAAW,CAAA,EACnE,KAAW,kBAAC,KAAD;GAAG,WAAU;aAA6C;GAAY,CAAA,CAC9E,EAAA,CAAA;EACL,KACC,kBAAC,UAAD;GACE,MAAK;GACL,SAAS;GACT,WAAU;aACX;GAEQ,CAAA;EAEP;IAWK,KAA6B,EAAE,UAAO,gBAAa,WAAQ,aAAU,mBAChF,kBAAC,WAAD;CAAS,WAAW,EAAG,mBAAmB,EAAU;WAApD,CACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;GAAI,WAAU;aAA6C;GAAW,CAAA,EACrE,KAAe,kBAAC,KAAD;GAAG,WAAU;aAAsC;GAAgB,CAAA,CAC/E,EAAA,CAAA,EACL,KAAU,kBAAC,OAAD;GAAK,WAAU;aAAY;GAAa,CAAA,CAC/C;KACL,EACO"}
1
+ {"version":3,"file":"StateViews.js","names":[],"sources":["../../../src/govcitizenhub/components/StateViews.tsx"],"sourcesContent":["/**\n * Shared loading / error / section state views\n * @module govcitizenhub/components\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { AlertCircle } from 'lucide-react';\nimport { Spinner } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface LoadingViewProps {\n label?: string;\n className?: string;\n}\n\nexport const LoadingView: FC<LoadingViewProps> = ({ label = 'Loading…', className }) => (\n <div className={cn('flex min-h-[40vh] flex-col items-center justify-center gap-3', className)}>\n <Spinner size=\"lg\" />\n <p className=\"text-sm text-text-secondary\">{label}</p>\n </div>\n);\n\ninterface ErrorViewProps {\n title?: string;\n message?: string;\n onRetry?: () => void;\n className?: string;\n}\n\nexport const ErrorView: FC<ErrorViewProps> = ({\n title = 'Something went wrong',\n message,\n onRetry,\n className,\n}) => (\n <div\n className={cn(\n 'flex min-h-[40vh] flex-col items-center justify-center gap-4 text-center',\n className\n )}\n >\n <AlertCircle className=\"h-10 w-10 text-status-error-text\" />\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">{title}</h2>\n {message && <p className=\"mt-1 max-w-md text-sm text-text-secondary\">{message}</p>}\n </div>\n {onRetry && (\n <button\n type=\"button\"\n onClick={onRetry}\n className=\"rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90\"\n >\n Retry\n </button>\n )}\n </div>\n);\n\ninterface SectionProps {\n title: string;\n description?: string;\n action?: ReactNode;\n children: ReactNode;\n className?: string;\n}\n\nexport const Section: FC<SectionProps> = ({ title, description, action, children, className }) => (\n <section className={cn('mt-8 first:mt-0', className)}>\n <div className=\"mb-3 flex items-end justify-between gap-3\">\n <div>\n <h2 className=\"text-base font-semibold text-text-primary\">{title}</h2>\n {description && <p className=\"mt-0.5 text-sm text-text-secondary\">{description}</p>}\n </div>\n {action && <div className=\"shrink-0\">{action}</div>}\n </div>\n {children}\n </section>\n);\n"],"mappings":";;;;;AAeA,IAAa,KAAqC,EAAE,WAAQ,YAAY,mBACtE,kBAAC,OAAD;CAAK,WAAW,EAAG,gEAAgE,EAAU;WAA7F,CACE,kBAAC,GAAD,EAAS,MAAK,MAAO,CAAA,EACrB,kBAAC,KAAD;EAAG,WAAU;YAA+B;EAAU,CAAA,CAClD;IAUK,KAAiC,EAC5C,WAAQ,wBACR,YACA,YACA,mBAEA,kBAAC,OAAD;CACE,WAAW,EACT,4EACA,EACD;WAJH;EAME,kBAAC,GAAD,EAAa,WAAU,oCAAqC,CAAA;EAC5D,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;GAAI,WAAU;aAA2C;GAAW,CAAA,EACnE,KAAW,kBAAC,KAAD;GAAG,WAAU;aAA6C;GAAY,CAAA,CAC9E,EAAA,CAAA;EACL,KACC,kBAAC,UAAD;GACE,MAAK;GACL,SAAS;GACT,WAAU;aACX;GAEQ,CAAA;EAEP;IAWK,KAA6B,EAAE,UAAO,gBAAa,WAAQ,aAAU,mBAChF,kBAAC,WAAD;CAAS,WAAW,EAAG,mBAAmB,EAAU;WAApD,CACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;GAAI,WAAU;aAA6C;GAAW,CAAA,EACrE,KAAe,kBAAC,KAAD;GAAG,WAAU;aAAsC;GAAgB,CAAA,CAC/E,EAAA,CAAA,EACL,KAAU,kBAAC,OAAD;GAAK,WAAU;aAAY;GAAa,CAAA,CAC/C;KACL,EACO"}
@@ -1 +1 @@
1
- {"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/govcitizenhub/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module govcitizenhub/components\n *\n * A colored badge for GovCitizenHub domain statuses (application / service /\n * document / payment / permit / grievance status, plus case priority and case\n * note type) with semantic color mapping. Accepts the raw server enum value.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\nimport { formatEnumLabel } from '../utils/formatters';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n destructive: 'bg-status-error-bg-subtle text-status-error-text',\n secondary: 'bg-bg-sunken text-text-secondary',\n info: 'bg-[var(--color-accent-soft)] text-text-primary',\n outline: 'border border-border-seam text-text-primary',\n};\n\n// Statuses representing a live / active condition get a subtle glow pulse.\nconst liveStatuses = new Set(['ACTIVE', 'IN_REVIEW', 'IN_PROGRESS', 'PUBLISHED']);\n\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Application status\n DRAFT: 'secondary',\n SUBMITTED: 'info',\n IN_REVIEW: 'info',\n INFO_REQUESTED: 'warning',\n APPROVED: 'success',\n REJECTED: 'destructive',\n WITHDRAWN: 'outline',\n\n // Service status\n PUBLISHED: 'success',\n SUSPENDED: 'warning',\n RETIRED: 'outline',\n\n // Document status\n PENDING: 'warning',\n ACCEPTED: 'success',\n\n // Payment status\n PAID: 'success',\n FAILED: 'destructive',\n REFUNDED: 'outline',\n\n // Permit status\n ISSUED: 'info',\n ACTIVE: 'success',\n EXPIRED: 'outline',\n REVOKED: 'destructive',\n\n // Grievance status\n OPEN: 'info',\n ACKNOWLEDGED: 'info',\n IN_PROGRESS: 'warning',\n RESOLVED: 'success',\n CLOSED: 'outline',\n\n // Case priority\n LOW: 'secondary',\n NORMAL: 'info',\n HIGH: 'warning',\n URGENT: 'destructive',\n\n // Case note type\n INTERNAL: 'secondary',\n CITIZEN_MESSAGE: 'info',\n INFO_REQUEST: 'warning',\n DECISION: 'success',\n\n // Fee type\n FREE: 'success',\n FIXED: 'info',\n VARIABLE: 'warning',\n};\n\nexport const StatusBadge: FC<StatusBadgeProps> = ({ status, className }) => {\n const key = status.toUpperCase();\n const variant = statusVariantMap[key] ?? 'secondary';\n const isLive = liveStatuses.has(key);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n variantStyles[variant],\n className\n )}\n >\n {isLive && (\n <span aria-hidden=\"true\" className=\"size-1.5 rounded-full bg-current motion-safe:animate-vc-glow-pulse\" />\n )}\n {formatEnumLabel(status)}\n </span>\n );\n};\n"],"mappings":";;;;AAoBA,IAAM,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;CACV,EAGK,IAAe,IAAI,IAAI;CAAC;CAAU;CAAa;CAAe;CAAY,CAAC,EAE3E,IAAiD;CAErD,OAAO;CACP,WAAW;CACX,WAAW;CACX,gBAAgB;CAChB,UAAU;CACV,UAAU;CACV,WAAW;CAGX,WAAW;CACX,WAAW;CACX,SAAS;CAGT,SAAS;CACT,UAAU;CAGV,MAAM;CACN,QAAQ;CACR,UAAU;CAGV,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,SAAS;CAGT,MAAM;CACN,cAAc;CACd,aAAa;CACb,UAAU;CACV,QAAQ;CAGR,KAAK;CACL,QAAQ;CACR,MAAM;CACN,QAAQ;CAGR,UAAU;CACV,iBAAiB;CACjB,cAAc;CACd,UAAU;CAGV,MAAM;CACN,OAAO;CACP,UAAU;CACX,EAEY,KAAqC,EAAE,WAAQ,mBAAgB;CAC1E,IAAM,IAAM,EAAO,aAAa,EAC1B,IAAU,EAAiB,MAAQ,aACnC,IAAS,EAAa,IAAI,EAAI;AAEpC,QACE,kBAAC,QAAD;EACE,WAAW,EACT,mFACA,EAAc,IACd,EACD;YALH,CAOG,KACC,kBAAC,QAAD;GAAM,eAAY;GAAO,WAAU;GAAuE,CAAA,EAE3G,EAAgB,EAAO,CACnB"}
1
+ {"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/govcitizenhub/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module govcitizenhub/components\n *\n * A colored badge for GovCitizenHub domain statuses (application / service /\n * document / payment / permit / grievance status, plus case priority and case\n * note type) with semantic color mapping. Accepts the raw server enum value.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\nimport { formatEnumLabel } from '../utils/formatters';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n destructive: 'bg-status-error-bg-subtle text-status-error-text',\n secondary: 'bg-bg-sunken text-text-secondary',\n info: 'bg-[var(--color-accent-soft)] text-text-primary',\n outline: 'border border-border-seam text-text-primary',\n};\n\n// Statuses representing a live / active condition get a subtle glow pulse.\nconst liveStatuses = new Set(['ACTIVE', 'IN_REVIEW', 'IN_PROGRESS', 'PUBLISHED']);\n\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Application status\n DRAFT: 'secondary',\n SUBMITTED: 'info',\n IN_REVIEW: 'info',\n INFO_REQUESTED: 'warning',\n APPROVED: 'success',\n REJECTED: 'destructive',\n WITHDRAWN: 'outline',\n\n // Service status\n PUBLISHED: 'success',\n SUSPENDED: 'warning',\n RETIRED: 'outline',\n\n // Document status\n PENDING: 'warning',\n ACCEPTED: 'success',\n\n // Payment status\n PAID: 'success',\n FAILED: 'destructive',\n REFUNDED: 'outline',\n\n // Permit status\n ISSUED: 'info',\n ACTIVE: 'success',\n EXPIRED: 'outline',\n REVOKED: 'destructive',\n\n // Grievance status\n OPEN: 'info',\n ACKNOWLEDGED: 'info',\n IN_PROGRESS: 'warning',\n RESOLVED: 'success',\n CLOSED: 'outline',\n\n // Case priority\n LOW: 'secondary',\n NORMAL: 'info',\n HIGH: 'warning',\n URGENT: 'destructive',\n\n // Case note type\n INTERNAL: 'secondary',\n CITIZEN_MESSAGE: 'info',\n INFO_REQUEST: 'warning',\n DECISION: 'success',\n\n // Fee type\n FREE: 'success',\n FIXED: 'info',\n VARIABLE: 'warning',\n};\n\nexport const StatusBadge: FC<StatusBadgeProps> = ({ status, className }) => {\n const key = status.toUpperCase();\n const variant = statusVariantMap[key] ?? 'secondary';\n const isLive = liveStatuses.has(key);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n variantStyles[variant],\n className\n )}\n >\n {isLive && (\n <span\n aria-hidden=\"true\"\n className=\"size-1.5 rounded-full bg-current motion-safe:animate-vc-glow-pulse\"\n />\n )}\n {formatEnumLabel(status)}\n </span>\n );\n};\n"],"mappings":";;;;AAoBA,IAAM,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;CACV,EAGK,IAAe,IAAI,IAAI;CAAC;CAAU;CAAa;CAAe;CAAY,CAAC,EAE3E,IAAiD;CAErD,OAAO;CACP,WAAW;CACX,WAAW;CACX,gBAAgB;CAChB,UAAU;CACV,UAAU;CACV,WAAW;CAGX,WAAW;CACX,WAAW;CACX,SAAS;CAGT,SAAS;CACT,UAAU;CAGV,MAAM;CACN,QAAQ;CACR,UAAU;CAGV,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,SAAS;CAGT,MAAM;CACN,cAAc;CACd,aAAa;CACb,UAAU;CACV,QAAQ;CAGR,KAAK;CACL,QAAQ;CACR,MAAM;CACN,QAAQ;CAGR,UAAU;CACV,iBAAiB;CACjB,cAAc;CACd,UAAU;CAGV,MAAM;CACN,OAAO;CACP,UAAU;CACX,EAEY,KAAqC,EAAE,WAAQ,mBAAgB;CAC1E,IAAM,IAAM,EAAO,aAAa,EAC1B,IAAU,EAAiB,MAAQ,aACnC,IAAS,EAAa,IAAI,EAAI;AAEpC,QACE,kBAAC,QAAD;EACE,WAAW,EACT,mFACA,EAAc,IACd,EACD;YALH,CAOG,KACC,kBAAC,QAAD;GACE,eAAY;GACZ,WAAU;GACV,CAAA,EAEH,EAAgB,EAAO,CACnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"TagInput.js","names":[],"sources":["../../../src/govcitizenhub/components/TagInput.tsx"],"sourcesContent":["/**\n * TagInput — a lightweight chip-based tag editor.\n * @module govcitizenhub/components\n *\n * Enter or comma commits a tag; Backspace on an empty field removes the last.\n * Purely controlled — the parent owns the string[] value.\n */\n\nimport { useState, type KeyboardEvent } from 'react';\nimport { X } from 'lucide-react';\nimport { Input } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface TagInputProps {\n value: string[];\n onChange: (tags: string[]) => void;\n placeholder?: string;\n max?: number;\n className?: string;\n id?: string;\n}\n\nexport function TagInput({ value, onChange, placeholder = 'Add a tag…', max = 12, className, id }: TagInputProps) {\n const [draft, setDraft] = useState('');\n\n const commit = (raw: string) => {\n const tag = raw.trim().replace(/^#/, '');\n if (!tag) return;\n if (value.includes(tag)) {\n setDraft('');\n return;\n }\n if (value.length >= max) return;\n onChange([...value, tag]);\n setDraft('');\n };\n\n const remove = (tag: string) => onChange(value.filter((t) => t !== tag));\n\n const onKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' || e.key === ',') {\n e.preventDefault();\n commit(draft);\n } else if (e.key === 'Backspace' && !draft && value.length > 0) {\n remove(value[value.length - 1]!);\n }\n };\n\n return (\n <div\n className={cn(\n 'flex flex-wrap items-center gap-1.5 rounded-xl border border-border-seam bg-bg-surface px-2 py-1.5',\n className\n )}\n >\n {value.map((tag) => (\n <span\n key={tag}\n className=\"inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary\"\n >\n {tag}\n <button\n type=\"button\"\n onClick={() => remove(tag)}\n aria-label={`Remove ${tag}`}\n className=\"text-text-tertiary hover:text-text-primary\"\n >\n <X className=\"h-3 w-3\" />\n </button>\n </span>\n ))}\n <Input\n id={id}\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n onKeyDown={onKeyDown}\n onBlur={() => commit(draft)}\n placeholder={value.length === 0 ? placeholder : ''}\n className=\"h-7 min-w-[8rem] flex-1 border-0 bg-transparent px-1 shadow-none focus-visible:ring-0\"\n />\n </div>\n );\n}\n"],"mappings":";;;;;;AAsBA,SAAgB,EAAS,EAAE,UAAO,aAAU,iBAAc,cAAc,SAAM,IAAI,cAAW,SAAqB;CAChH,IAAM,CAAC,GAAO,KAAY,EAAS,GAAG,EAEhC,KAAU,MAAgB;EAC9B,IAAM,IAAM,EAAI,MAAM,CAAC,QAAQ,MAAM,GAAG;AACnC,SACL;OAAI,EAAM,SAAS,EAAI,EAAE;AACvB,MAAS,GAAG;AACZ;;AAEE,KAAM,UAAU,MACpB,EAAS,CAAC,GAAG,GAAO,EAAI,CAAC,EACzB,EAAS,GAAG;;IAGR,KAAU,MAAgB,EAAS,EAAM,QAAQ,MAAM,MAAM,EAAI,CAAC;AAWxE,QACE,kBAAC,OAAD;EACE,WAAW,EACT,sGACA,EACD;YAJH,CAMG,EAAM,KAAK,MACV,kBAAC,QAAD;GAEE,WAAU;aAFZ,CAIG,GACD,kBAAC,UAAD;IACE,MAAK;IACL,eAAe,EAAO,EAAI;IAC1B,cAAY,UAAU;IACtB,WAAU;cAEV,kBAAC,GAAD,EAAG,WAAU,WAAY,CAAA;IAClB,CAAA,CACJ;KAZA,EAYA,CACP,EACF,kBAAC,GAAD;GACM;GACJ,OAAO;GACP,WAAW,MAAM,EAAS,EAAE,OAAO,MAAM;GAC9B,YApCE,MAAuC;AACxD,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,OACjC,EAAE,gBAAgB,EAClB,EAAO,EAAM,IACJ,EAAE,QAAQ,eAAe,CAAC,KAAS,EAAM,SAAS,KAC3D,EAAO,EAAM,EAAM,SAAS,GAAI;;GAgC9B,cAAc,EAAO,EAAM;GAC3B,aAAa,EAAM,WAAW,IAAI,IAAc;GAChD,WAAU;GACV,CAAA,CACE"}
1
+ {"version":3,"file":"TagInput.js","names":[],"sources":["../../../src/govcitizenhub/components/TagInput.tsx"],"sourcesContent":["/**\n * TagInput — a lightweight chip-based tag editor.\n * @module govcitizenhub/components\n *\n * Enter or comma commits a tag; Backspace on an empty field removes the last.\n * Purely controlled — the parent owns the string[] value.\n */\n\nimport { useState, type KeyboardEvent } from 'react';\nimport { X } from 'lucide-react';\nimport { Input } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface TagInputProps {\n value: string[];\n onChange: (tags: string[]) => void;\n placeholder?: string;\n max?: number;\n className?: string;\n id?: string;\n}\n\nexport function TagInput({\n value,\n onChange,\n placeholder = 'Add a tag…',\n max = 12,\n className,\n id,\n}: TagInputProps) {\n const [draft, setDraft] = useState('');\n\n const commit = (raw: string) => {\n const tag = raw.trim().replace(/^#/, '');\n if (!tag) return;\n if (value.includes(tag)) {\n setDraft('');\n return;\n }\n if (value.length >= max) return;\n onChange([...value, tag]);\n setDraft('');\n };\n\n const remove = (tag: string) => onChange(value.filter((t) => t !== tag));\n\n const onKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' || e.key === ',') {\n e.preventDefault();\n commit(draft);\n } else if (e.key === 'Backspace' && !draft && value.length > 0) {\n remove(value[value.length - 1]!);\n }\n };\n\n return (\n <div\n className={cn(\n 'flex flex-wrap items-center gap-1.5 rounded-xl border border-border-seam bg-bg-surface px-2 py-1.5',\n className\n )}\n >\n {value.map((tag) => (\n <span\n key={tag}\n className=\"inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary\"\n >\n {tag}\n <button\n type=\"button\"\n onClick={() => remove(tag)}\n aria-label={`Remove ${tag}`}\n className=\"text-text-tertiary hover:text-text-primary\"\n >\n <X className=\"h-3 w-3\" />\n </button>\n </span>\n ))}\n <Input\n id={id}\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n onKeyDown={onKeyDown}\n onBlur={() => commit(draft)}\n placeholder={value.length === 0 ? placeholder : ''}\n className=\"h-7 min-w-[8rem] flex-1 border-0 bg-transparent px-1 shadow-none focus-visible:ring-0\"\n />\n </div>\n );\n}\n"],"mappings":";;;;;;AAsBA,SAAgB,EAAS,EACvB,UACA,aACA,iBAAc,cACd,SAAM,IACN,cACA,SACgB;CAChB,IAAM,CAAC,GAAO,KAAY,EAAS,GAAG,EAEhC,KAAU,MAAgB;EAC9B,IAAM,IAAM,EAAI,MAAM,CAAC,QAAQ,MAAM,GAAG;AACnC,SACL;OAAI,EAAM,SAAS,EAAI,EAAE;AACvB,MAAS,GAAG;AACZ;;AAEE,KAAM,UAAU,MACpB,EAAS,CAAC,GAAG,GAAO,EAAI,CAAC,EACzB,EAAS,GAAG;;IAGR,KAAU,MAAgB,EAAS,EAAM,QAAQ,MAAM,MAAM,EAAI,CAAC;AAWxE,QACE,kBAAC,OAAD;EACE,WAAW,EACT,sGACA,EACD;YAJH,CAMG,EAAM,KAAK,MACV,kBAAC,QAAD;GAEE,WAAU;aAFZ,CAIG,GACD,kBAAC,UAAD;IACE,MAAK;IACL,eAAe,EAAO,EAAI;IAC1B,cAAY,UAAU;IACtB,WAAU;cAEV,kBAAC,GAAD,EAAG,WAAU,WAAY,CAAA;IAClB,CAAA,CACJ;KAZA,EAYA,CACP,EACF,kBAAC,GAAD;GACM;GACJ,OAAO;GACP,WAAW,MAAM,EAAS,EAAE,OAAO,MAAM;GAC9B,YApCE,MAAuC;AACxD,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,OACjC,EAAE,gBAAgB,EAClB,EAAO,EAAM,IACJ,EAAE,QAAQ,eAAe,CAAC,KAAS,EAAM,SAAS,KAC3D,EAAO,EAAM,EAAM,SAAS,GAAI;;GAgC9B,cAAc,EAAO,EAAM;GAC3B,aAAa,EAAM,WAAW,IAAI,IAAc;GAChD,WAAU;GACV,CAAA,CACE"}
@@ -1 +1 @@
1
- {"version":3,"file":"GovCitizenHubContext.js","names":[],"sources":["../../../src/govcitizenhub/context/GovCitizenHubContext.tsx"],"sourcesContent":["/**\n * GovCitizenHub Context Provider\n * @module govcitizenhub/context\n *\n * Splits standalone mode (wraps its own MemoryRouter + useNavigate) from\n * integrated mode (the host shell supplies `navigate`). Exposes gateway/auth\n * context + relative navigation helpers to every page.\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router-dom';\nimport type { GovCitizenHubRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\ninterface GovCitizenHubContextValue\n extends Omit<GovCitizenHubRootProps, 'registerNavItems' | 'registerFooterItems' | 'navigate'> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode). */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath. */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path. */\n getPath: (relativePath: string) => string;\n}\n\nconst GovCitizenHubContext = createContext<GovCitizenHubContextValue | null>(null);\n\nexport function useGovCitizenHub(): GovCitizenHubContextValue {\n const context = useContext(GovCitizenHubContext);\n if (!context) {\n throw new Error('useGovCitizenHub must be used within a GovCitizenHubProvider');\n }\n return context;\n}\n\ntype ProviderProps = Omit<GovCitizenHubRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n}) => {\n const routerNavigate = useRouterNavigate();\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n routerNavigate(joinPath(effectiveBasePath, relativePath));\n },\n [effectiveBasePath, routerNavigate]\n );\n\n const contextValue = useMemo<GovCitizenHubContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate: undefined,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n isStandalone: true,\n navigateTo,\n getPath,\n }),\n [effectiveBasePath, currentUser, tenantId, workspaceId, apiGatewayUrl, authToken, navigateTo, getPath]\n );\n\n return <GovCitizenHubContext.Provider value={contextValue}>{children}</GovCitizenHubContext.Provider>;\n};\n\nconst IntegratedProviderInner: FC<\n PropsWithChildren<ProviderProps & { navigate: (path: string) => void }>\n> = ({ children, basePath, navigate, currentUser, tenantId, workspaceId, apiGatewayUrl, authToken }) => {\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n navigate(joinPath(effectiveBasePath, relativePath));\n },\n [effectiveBasePath, navigate]\n );\n\n const contextValue = useMemo<GovCitizenHubContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n isStandalone: false,\n navigateTo,\n getPath,\n }),\n [effectiveBasePath, navigate, currentUser, tenantId, workspaceId, apiGatewayUrl, authToken, navigateTo, getPath]\n );\n\n return <GovCitizenHubContext.Provider value={contextValue}>{children}</GovCitizenHubContext.Provider>;\n};\n\nexport const GovCitizenHubProvider: FC<PropsWithChildren<GovCitizenHubRootProps>> = (props) => {\n const { children, navigate } = props;\n const isStandalone = !navigate;\n\n if (isStandalone) {\n return (\n <MemoryRouter>\n <StandaloneProviderInner {...props} isStandalone={true}>\n {children}\n </StandaloneProviderInner>\n </MemoryRouter>\n );\n }\n\n return (\n <IntegratedProviderInner {...props} navigate={navigate} isStandalone={false}>\n {children}\n </IntegratedProviderInner>\n );\n};\n"],"mappings":";;;;;AA0BA,IAAM,IAAuB,EAAgD,KAAK;AAElF,SAAgB,IAA8C;CAC5D,IAAM,IAAU,EAAW,EAAqB;AAChD,KAAI,CAAC,EACH,OAAU,MAAM,+DAA+D;AAEjF,QAAO;;AAOT,IAAM,KAAiE,EACrE,aACA,aACA,gBACA,aACA,gBACA,kBACA,mBACI;CACJ,IAAM,IAAiB,GAAmB,EACpC,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EAEK,IAAa,GAChB,MAAyB;AACxB,IAAe,EAAS,GAAmB,EAAa,CAAC;IAE3D,CAAC,GAAmB,EAAe,CACpC,EAEK,IAAe,SACZ;EACL,UAAU;EACV,UAAU,KAAA;EACV;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,GACD;EAAC;EAAmB;EAAa;EAAU;EAAa;EAAe;EAAW;EAAY;EAAQ,CACvG;AAED,QAAO,kBAAC,EAAqB,UAAtB;EAA+B,OAAO;EAAe;EAAyC,CAAA;GAGjG,KAED,EAAE,aAAU,aAAU,aAAU,gBAAa,aAAU,gBAAa,kBAAe,mBAAgB;CACtG,IAAM,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EAEK,IAAa,GAChB,MAAyB;AACxB,IAAS,EAAS,GAAmB,EAAa,CAAC;IAErD,CAAC,GAAmB,EAAS,CAC9B,EAEK,IAAe,SACZ;EACL,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,GACD;EAAC;EAAmB;EAAU;EAAa;EAAU;EAAa;EAAe;EAAW;EAAY;EAAQ,CACjH;AAED,QAAO,kBAAC,EAAqB,UAAtB;EAA+B,OAAO;EAAe;EAAyC,CAAA;GAG1F,KAAwE,MAAU;CAC7F,IAAM,EAAE,aAAU,gBAAa;AAa/B,QAZsB,IAapB,kBAAC,GAAD;EAAyB,GAAI;EAAiB;EAAU,cAAc;EACnE;EACuB,CAAA,GAXxB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAyB,GAAI;EAAO,cAAc;EAC/C;EACuB,CAAA,EACb,CAAA"}
1
+ {"version":3,"file":"GovCitizenHubContext.js","names":[],"sources":["../../../src/govcitizenhub/context/GovCitizenHubContext.tsx"],"sourcesContent":["/**\n * GovCitizenHub Context Provider\n * @module govcitizenhub/context\n *\n * Splits standalone mode (wraps its own MemoryRouter + useNavigate) from\n * integrated mode (the host shell supplies `navigate`). Exposes gateway/auth\n * context + relative navigation helpers to every page.\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router-dom';\nimport type { GovCitizenHubRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\ninterface GovCitizenHubContextValue extends Omit<\n GovCitizenHubRootProps,\n 'registerNavItems' | 'registerFooterItems' | 'navigate'\n> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode). */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath. */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path. */\n getPath: (relativePath: string) => string;\n}\n\nconst GovCitizenHubContext = createContext<GovCitizenHubContextValue | null>(null);\n\nexport function useGovCitizenHub(): GovCitizenHubContextValue {\n const context = useContext(GovCitizenHubContext);\n if (!context) {\n throw new Error('useGovCitizenHub must be used within a GovCitizenHubProvider');\n }\n return context;\n}\n\ntype ProviderProps = Omit<GovCitizenHubRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n}) => {\n const routerNavigate = useRouterNavigate();\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n routerNavigate(joinPath(effectiveBasePath, relativePath));\n },\n [effectiveBasePath, routerNavigate]\n );\n\n const contextValue = useMemo<GovCitizenHubContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate: undefined,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n isStandalone: true,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n navigateTo,\n getPath,\n ]\n );\n\n return (\n <GovCitizenHubContext.Provider value={contextValue}>{children}</GovCitizenHubContext.Provider>\n );\n};\n\nconst IntegratedProviderInner: FC<\n PropsWithChildren<ProviderProps & { navigate: (path: string) => void }>\n> = ({\n children,\n basePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n}) => {\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n navigate(joinPath(effectiveBasePath, relativePath));\n },\n [effectiveBasePath, navigate]\n );\n\n const contextValue = useMemo<GovCitizenHubContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n isStandalone: false,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n navigateTo,\n getPath,\n ]\n );\n\n return (\n <GovCitizenHubContext.Provider value={contextValue}>{children}</GovCitizenHubContext.Provider>\n );\n};\n\nexport const GovCitizenHubProvider: FC<PropsWithChildren<GovCitizenHubRootProps>> = (props) => {\n const { children, navigate } = props;\n const isStandalone = !navigate;\n\n if (isStandalone) {\n return (\n <MemoryRouter>\n <StandaloneProviderInner {...props} isStandalone={true}>\n {children}\n </StandaloneProviderInner>\n </MemoryRouter>\n );\n }\n\n return (\n <IntegratedProviderInner {...props} navigate={navigate} isStandalone={false}>\n {children}\n </IntegratedProviderInner>\n );\n};\n"],"mappings":";;;;;AA4BA,IAAM,IAAuB,EAAgD,KAAK;AAElF,SAAgB,IAA8C;CAC5D,IAAM,IAAU,EAAW,EAAqB;AAChD,KAAI,CAAC,EACH,OAAU,MAAM,+DAA+D;AAEjF,QAAO;;AAOT,IAAM,KAAiE,EACrE,aACA,aACA,gBACA,aACA,gBACA,kBACA,mBACI;CACJ,IAAM,IAAiB,GAAmB,EACpC,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EAEK,IAAa,GAChB,MAAyB;AACxB,IAAe,EAAS,GAAmB,EAAa,CAAC;IAE3D,CAAC,GAAmB,EAAe,CACpC,EAEK,IAAe,SACZ;EACL,UAAU;EACV,UAAU,KAAA;EACV;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QACE,kBAAC,EAAqB,UAAtB;EAA+B,OAAO;EAAe;EAAyC,CAAA;GAI5F,KAED,EACH,aACA,aACA,aACA,gBACA,aACA,gBACA,kBACA,mBACI;CACJ,IAAM,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EAEK,IAAa,GAChB,MAAyB;AACxB,IAAS,EAAS,GAAmB,EAAa,CAAC;IAErD,CAAC,GAAmB,EAAS,CAC9B,EAEK,IAAe,SACZ;EACL,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QACE,kBAAC,EAAqB,UAAtB;EAA+B,OAAO;EAAe;EAAyC,CAAA;GAIrF,KAAwE,MAAU;CAC7F,IAAM,EAAE,aAAU,gBAAa;AAa/B,QAZsB,IAapB,kBAAC,GAAD;EAAyB,GAAI;EAAiB;EAAU,cAAc;EACnE;EACuB,CAAA,GAXxB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAyB,GAAI;EAAO,cAAc;EAC/C;EACuB,CAAA,EACb,CAAA"}
@@ -1,50 +1,67 @@
1
1
  import "../context/index.js";
2
2
  import "@tanstack/react-query";
3
- import { getWorkspaceClient as e, gql as t } from "@burdenoff/fe-libs/shared/graphql";
4
- import { uploadBlobToFiles as n } from "@burdenoff/fe-libs/storage";
3
+ import { graphqlFetch as e } from "@burdenoff/fe-libs/shared/graphql";
5
4
  //#region src/govcitizenhub/hooks/useFiles.ts
6
- var r = 31536e3, i = {
5
+ var t = 31536e3, n = {
7
6
  documents: "/GovCitizenHub/Documents",
8
7
  permits: "/GovCitizenHub/Permits",
9
8
  grievances: "/GovCitizenHub/Grievances"
10
- }, a = t`
11
- mutation GovEnsureFolder($path: String!) {
12
- ensureFolderByPath(path: $path) {
13
- id
14
- }
15
- }
16
- `, o = t`
17
- query GovGetFileDownloadUrl($id: ID!, $expiresIn: Int) {
18
- getFileDownloadUrl(id: $id, expiresIn: $expiresIn)
19
- }
20
- `;
21
- async function s(t, i) {
22
- let s = e(), c = (await s.mutate({
23
- mutation: a,
24
- variables: { path: i }
25
- })).data?.ensureFolderByPath?.id;
26
- if (!c) throw Error("Could not resolve the upload folder.");
27
- let l = await n({
28
- client: s,
29
- blob: t,
30
- filename: t.name,
31
- mimeType: t.type || "application/octet-stream",
32
- folderId: c
33
- }), u = (await s.query({
34
- query: o,
35
- variables: {
36
- id: l.id,
37
- expiresIn: r
38
- },
39
- fetchPolicy: "no-cache"
40
- })).data?.getFileDownloadUrl ?? "";
9
+ };
10
+ async function r(t, n) {
11
+ let r = await e({
12
+ gateway: "workspace",
13
+ query: t,
14
+ variables: n,
15
+ workspaceToken: !0
16
+ });
17
+ if (r.errors?.length) throw Error(r.errors[0]?.message ?? "Files request failed");
18
+ if (!r.data) throw Error("Files response did not include data");
19
+ return r.data;
20
+ }
21
+ var i = "\n mutation GovEnsureFolder($path: String!) {\n ensureFolderByPath(path: $path) { id }\n }\n", a = "\n mutation GovInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) {\n uploadUrl\n session { id }\n }\n }\n", o = "\n mutation GovCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) {\n fileId\n file { id name }\n }\n }\n", s = "\n query GovGetFileDownloadUrl($id: ID!, $expiresIn: Int) {\n getFileDownloadUrl(id: $id, expiresIn: $expiresIn)\n }\n";
22
+ function c(e, t) {
23
+ let n = e.lastIndexOf(".");
24
+ return n > -1 && n < e.length - 1 ? e.slice(n + 1).toLowerCase() : (t.split("/")[1] ?? "bin").toLowerCase();
25
+ }
26
+ async function l(e, n) {
27
+ let l = (await r(i, { path: n })).ensureFolderByPath?.id;
28
+ if (!l) throw Error("Could not resolve the upload folder.");
29
+ let u = e.type || "application/octet-stream", d = e.size, f = await r(a, { input: {
30
+ fileName: e.name,
31
+ extension: c(e.name, u),
32
+ fileSize: d,
33
+ mimeType: u,
34
+ folderId: l
35
+ } }), p = f.initiateUpload?.uploadUrl, m = f.initiateUpload?.session.id;
36
+ if (!p || !m) throw Error("The files service did not return an upload URL.");
37
+ let h = await fetch(p, {
38
+ method: "PUT",
39
+ body: e,
40
+ headers: { "Content-Type": u }
41
+ });
42
+ if (!h.ok) throw Error(`Upload to storage failed (${h.status}).`);
43
+ let g = (await r(o, { input: {
44
+ sessionId: m,
45
+ fileSize: d,
46
+ folderId: l
47
+ } })).completeUpload?.file;
48
+ if (!g?.id) throw Error("The upload could not be finalized.");
49
+ let _ = "";
50
+ try {
51
+ _ = (await r(s, {
52
+ id: g.id,
53
+ expiresIn: t
54
+ })).getFileDownloadUrl ?? "";
55
+ } catch {
56
+ _ = "";
57
+ }
41
58
  return {
42
- id: l.id,
43
- url: u,
44
- name: l.name
59
+ id: g.id,
60
+ url: _,
61
+ name: g.name
45
62
  };
46
63
  }
47
64
  //#endregion
48
- export { i as FILE_FOLDERS, s as uploadFileToFiles };
65
+ export { n as FILE_FOLDERS, l as uploadFileToFiles };
49
66
 
50
67
  //# sourceMappingURL=useFiles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFiles.js","names":[],"sources":["../../../src/govcitizenhub/hooks/useFiles.ts"],"sourcesContent":["/**\n * File hooks — documents & permit PDFs via wspace-files-svc (NO duplication).\n * @module govcitizenhub/hooks\n *\n * GovCitizenHub never stores blobs. Documents/permits reference files owned by\n * wspace-files-svc by id. Upload goes through the shared `uploadBlobToFiles`\n * storage helper (presigned 3-step upload) against the workspace Apollo client\n * the shell initialises; display resolves a file id to a presigned URL via\n * `getFileDownloadUrl`.\n */\n\nimport { useQuery } from '@tanstack/react-query';\nimport { graphqlFetch, getWorkspaceClient, gql } from '@burdenoff/fe-libs/shared/graphql';\nimport { uploadBlobToFiles } from '@burdenoff/fe-libs/storage';\n\nimport { useGovCitizenHub } from '../context';\n\n/** One year — permit PDFs / document scans are long-lived references. */\nconst DOWNLOAD_URL_TTL_SECONDS = 31_536_000;\n\nexport const FILE_FOLDERS = {\n documents: '/GovCitizenHub/Documents',\n permits: '/GovCitizenHub/Permits',\n grievances: '/GovCitizenHub/Grievances',\n} as const;\n\nconst ENSURE_FOLDER = gql`\n mutation GovEnsureFolder($path: String!) {\n ensureFolderByPath(path: $path) {\n id\n }\n }\n`;\n\nconst GET_FILE_DOWNLOAD_URL = gql`\n query GovGetFileDownloadUrl($id: ID!, $expiresIn: Int) {\n getFileDownloadUrl(id: $id, expiresIn: $expiresIn)\n }\n`;\n\nexport interface UploadedFile {\n id: string;\n url: string;\n name: string;\n}\n\ninterface EnsureFolderData {\n ensureFolderByPath?: { id: string } | null;\n}\ninterface DownloadUrlData {\n getFileDownloadUrl?: string | null;\n}\n\n/**\n * Upload a file to wspace-files-svc and return its id + a presigned URL. The\n * caller persists the id (e.g. via `govAddDocument({ fileId })`); the URL is used\n * for an immediate preview / download link.\n */\nexport async function uploadFileToFiles(file: File, folderPath: string): Promise<UploadedFile> {\n const client = getWorkspaceClient();\n\n const folderResult = await client.mutate<EnsureFolderData>({\n mutation: ENSURE_FOLDER,\n variables: { path: folderPath },\n });\n const folderId = folderResult.data?.ensureFolderByPath?.id;\n if (!folderId) {\n throw new Error('Could not resolve the upload folder.');\n }\n\n const uploaded = await uploadBlobToFiles({\n client,\n blob: file,\n filename: file.name,\n mimeType: file.type || 'application/octet-stream',\n folderId,\n });\n\n const urlResult = await client.query<DownloadUrlData>({\n query: GET_FILE_DOWNLOAD_URL,\n variables: { id: uploaded.id, expiresIn: DOWNLOAD_URL_TTL_SECONDS },\n fetchPolicy: 'no-cache',\n });\n const url = urlResult.data?.getFileDownloadUrl ?? '';\n\n return { id: uploaded.id, url, name: uploaded.name };\n}\n\n/** Resolve a wspace-files-svc file id to a presigned download URL for display. */\nexport function useFileUrl(fileId?: string | null) {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: ['govcitizenhub', 'file-url', fileId ?? ''],\n enabled: Boolean(fileId),\n staleTime: 30 * 60 * 1000,\n retry: 1,\n queryFn: async () => {\n const response = await graphqlFetch<{ getFileDownloadUrl: string | null }>({\n gateway: 'workspace',\n baseUrl: apiGatewayUrl,\n workspaceToken: true,\n query: `query GovFileUrl($id: ID!, $expiresIn: Int) { getFileDownloadUrl(id: $id, expiresIn: $expiresIn) }`,\n variables: { id: fileId, expiresIn: DOWNLOAD_URL_TTL_SECONDS },\n });\n if (response.errors?.length) {\n throw new Error(response.errors[0]?.message ?? 'Could not resolve file URL');\n }\n return response.data?.getFileDownloadUrl ?? null;\n },\n });\n}\n"],"mappings":";;;;;AAkBA,IAAM,IAA2B,SAEpB,IAAe;CAC1B,WAAW;CACX,SAAS;CACT,YAAY;CACb,EAEK,IAAgB,CAAG;;;;;;GAQnB,IAAwB,CAAG;;;;;AAwBjC,eAAsB,EAAkB,GAAY,GAA2C;CAC7F,IAAM,IAAS,GAAoB,EAM7B,KAJe,MAAM,EAAO,OAAyB;EACzD,UAAU;EACV,WAAW,EAAE,MAAM,GAAY;EAChC,CAAC,EAC4B,MAAM,oBAAoB;AACxD,KAAI,CAAC,EACH,OAAU,MAAM,uCAAuC;CAGzD,IAAM,IAAW,MAAM,EAAkB;EACvC;EACA,MAAM;EACN,UAAU,EAAK;EACf,UAAU,EAAK,QAAQ;EACvB;EACD,CAAC,EAOI,KALY,MAAM,EAAO,MAAuB;EACpD,OAAO;EACP,WAAW;GAAE,IAAI,EAAS;GAAI,WAAW;GAA0B;EACnE,aAAa;EACd,CAAC,EACoB,MAAM,sBAAsB;AAElD,QAAO;EAAE,IAAI,EAAS;EAAI;EAAK,MAAM,EAAS;EAAM"}
1
+ {"version":3,"file":"useFiles.js","names":[],"sources":["../../../src/govcitizenhub/hooks/useFiles.ts"],"sourcesContent":["/**\n * File hooks — documents & permit PDFs via wspace-files-svc (NO duplication).\n * @module govcitizenhub/hooks\n *\n * GovCitizenHub never stores blobs. Documents/permits reference files owned by\n * wspace-files-svc by id. Upload uses the SAME proven `graphqlFetch` transport\n * as every other read/write in this MFE (the shell's workspace gateway + token),\n * driving the wspace-files 3-step presigned flow directly:\n * ensureFolderByPath -> initiateUpload -> HTTP PUT -> completeUpload\n * Display resolves a file id to a presigned URL via `getFileDownloadUrl`.\n *\n * NOTE: we deliberately do NOT use the Apollo-based `uploadBlobToFiles` /\n * `getWorkspaceClient()` helper here — this shell wires its data plane through\n * `graphqlFetch`, not a global Apollo client, so `getWorkspaceClient()` returns\n * an un-networked client and the upload silently no-ops. `graphqlFetch` is the\n * transport the whole MFE already uses successfully.\n */\n\nimport { useQuery } from '@tanstack/react-query';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\n\nimport { useGovCitizenHub } from '../context';\n\n/** One year — permit PDFs / document scans are long-lived references. */\nconst DOWNLOAD_URL_TTL_SECONDS = 31_536_000;\n\nexport const FILE_FOLDERS = {\n documents: '/GovCitizenHub/Documents',\n permits: '/GovCitizenHub/Permits',\n grievances: '/GovCitizenHub/Grievances',\n} as const;\n\nexport interface UploadedFile {\n id: string;\n url: string;\n name: string;\n}\n\n/** Thin wrapper over the workspace gateway using the MFE's proven transport. */\nasync function filesFetch<TData>(query: string, variables: Record<string, unknown>): Promise<TData> {\n const response = await graphqlFetch<TData>({\n gateway: 'workspace',\n query,\n variables,\n workspaceToken: true,\n });\n if (response.errors?.length) {\n throw new Error(response.errors[0]?.message ?? 'Files request failed');\n }\n if (!response.data) {\n throw new Error('Files response did not include data');\n }\n return response.data;\n}\n\nconst ENSURE_FOLDER = `\n mutation GovEnsureFolder($path: String!) {\n ensureFolderByPath(path: $path) { id }\n }\n`;\n\nconst INITIATE_UPLOAD = `\n mutation GovInitiateUpload($input: InitiateUploadInput!) {\n initiateUpload(input: $input) {\n uploadUrl\n session { id }\n }\n }\n`;\n\nconst COMPLETE_UPLOAD = `\n mutation GovCompleteUpload($input: CompleteUploadInput!) {\n completeUpload(input: $input) {\n fileId\n file { id name }\n }\n }\n`;\n\nconst GET_FILE_DOWNLOAD_URL = `\n query GovGetFileDownloadUrl($id: ID!, $expiresIn: Int) {\n getFileDownloadUrl(id: $id, expiresIn: $expiresIn)\n }\n`;\n\nfunction fileExtension(name: string, mimeType: string): string {\n const dot = name.lastIndexOf('.');\n if (dot > -1 && dot < name.length - 1) return name.slice(dot + 1).toLowerCase();\n const fromMime = mimeType.split('/')[1];\n return (fromMime ?? 'bin').toLowerCase();\n}\n\n/**\n * Upload a file to wspace-files-svc and return its id + a presigned URL. The\n * caller persists the id (e.g. via `govAddDocument({ fileId })`); the URL is used\n * for an immediate preview / download link.\n */\nexport async function uploadFileToFiles(file: File, folderPath: string): Promise<UploadedFile> {\n // 1. Resolve (or create) the destination folder — File.folderId is a real FK.\n const folder = await filesFetch<{ ensureFolderByPath?: { id: string } | null }>(ENSURE_FOLDER, {\n path: folderPath,\n });\n const folderId = folder.ensureFolderByPath?.id;\n if (!folderId) {\n throw new Error('Could not resolve the upload folder.');\n }\n\n const mimeType = file.type || 'application/octet-stream';\n const fileSize = file.size;\n\n // 2. Open a presigned upload session.\n const initiated = await filesFetch<{\n initiateUpload?: { uploadUrl?: string | null; session: { id: string } } | null;\n }>(INITIATE_UPLOAD, {\n input: {\n fileName: file.name,\n extension: fileExtension(file.name, mimeType),\n fileSize,\n mimeType,\n folderId,\n },\n });\n const uploadUrl = initiated.initiateUpload?.uploadUrl;\n const sessionId = initiated.initiateUpload?.session.id;\n if (!uploadUrl || !sessionId) {\n throw new Error('The files service did not return an upload URL.');\n }\n\n // 3. PUT the bytes straight to storage using the presigned URL. Content-Type\n // must match what was signed at initiateUpload.\n const putResponse = await fetch(uploadUrl, {\n method: 'PUT',\n body: file,\n headers: { 'Content-Type': mimeType },\n });\n if (!putResponse.ok) {\n throw new Error(`Upload to storage failed (${putResponse.status}).`);\n }\n\n // 4. Finalize — creates the File record. fileSize must match initiateUpload.\n const completed = await filesFetch<{\n completeUpload?: { fileId: string; file: { id: string; name: string } } | null;\n }>(COMPLETE_UPLOAD, {\n input: { sessionId, fileSize, folderId },\n });\n const fileRecord = completed.completeUpload?.file;\n if (!fileRecord?.id) {\n throw new Error('The upload could not be finalized.');\n }\n\n // 5. Resolve a presigned URL for immediate preview/download (best-effort).\n let url = '';\n try {\n const urlData = await filesFetch<{ getFileDownloadUrl?: string | null }>(GET_FILE_DOWNLOAD_URL, {\n id: fileRecord.id,\n expiresIn: DOWNLOAD_URL_TTL_SECONDS,\n });\n url = urlData.getFileDownloadUrl ?? '';\n } catch {\n url = '';\n }\n\n return { id: fileRecord.id, url, name: fileRecord.name };\n}\n\n/** Resolve a wspace-files-svc file id to a presigned download URL for display. */\nexport function useFileUrl(fileId?: string | null) {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: ['govcitizenhub', 'file-url', fileId ?? ''],\n enabled: Boolean(fileId),\n staleTime: 30 * 60 * 1000,\n retry: 1,\n queryFn: async () => {\n const response = await graphqlFetch<{ getFileDownloadUrl: string | null }>({\n gateway: 'workspace',\n baseUrl: apiGatewayUrl,\n workspaceToken: true,\n query: GET_FILE_DOWNLOAD_URL,\n variables: { id: fileId, expiresIn: DOWNLOAD_URL_TTL_SECONDS },\n });\n if (response.errors?.length) {\n throw new Error(response.errors[0]?.message ?? 'Could not resolve file URL');\n }\n return response.data?.getFileDownloadUrl ?? null;\n },\n });\n}\n"],"mappings":";;;;AAwBA,IAAM,IAA2B,SAEpB,IAAe;CAC1B,WAAW;CACX,SAAS;CACT,YAAY;CACb;AASD,eAAe,EAAkB,GAAe,GAAoD;CAClG,IAAM,IAAW,MAAM,EAAoB;EACzC,SAAS;EACT;EACA;EACA,gBAAgB;EACjB,CAAC;AACF,KAAI,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