@burdenoff/microfe-govcitizenhub 2026.1201.1 → 2026.1202.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 (118) hide show
  1. package/dist/govcitizenhub/components/DocumentUploadField.js +1 -1
  2. package/dist/govcitizenhub/components/DocumentUploadField.js.map +1 -1
  3. package/dist/govcitizenhub/components/EmptyState.d.ts +19 -1
  4. package/dist/govcitizenhub/components/EmptyState.js +36 -16
  5. package/dist/govcitizenhub/components/EmptyState.js.map +1 -1
  6. package/dist/govcitizenhub/components/FilterTabs.js +1 -1
  7. package/dist/govcitizenhub/components/FilterTabs.js.map +1 -1
  8. package/dist/govcitizenhub/components/GovCharts.js +1 -1
  9. package/dist/govcitizenhub/components/GovCharts.js.map +1 -1
  10. package/dist/govcitizenhub/components/KeyValueList.js +1 -1
  11. package/dist/govcitizenhub/components/KeyValueList.js.map +1 -1
  12. package/dist/govcitizenhub/components/Pagination.js +2 -2
  13. package/dist/govcitizenhub/components/Pagination.js.map +1 -1
  14. package/dist/govcitizenhub/components/StatusStepper.js +2 -2
  15. package/dist/govcitizenhub/components/StatusStepper.js.map +1 -1
  16. package/dist/govcitizenhub/components/SummaryStrip.js +2 -2
  17. package/dist/govcitizenhub/components/SummaryStrip.js.map +1 -1
  18. package/dist/govcitizenhub/components/Timeline.js +2 -2
  19. package/dist/govcitizenhub/components/Timeline.js.map +1 -1
  20. package/dist/govcitizenhub/components/mobile/MobileLayout.d.ts +5 -0
  21. package/dist/govcitizenhub/components/mobile/MobileLayout.js +14 -7
  22. package/dist/govcitizenhub/components/mobile/MobileLayout.js.map +1 -1
  23. package/dist/govcitizenhub/context/GovCitizenHubContext.js +26 -22
  24. package/dist/govcitizenhub/context/GovCitizenHubContext.js.map +1 -1
  25. package/dist/govcitizenhub/hooks/uploadVisibility.d.ts +2 -0
  26. package/dist/govcitizenhub/hooks/uploadVisibility.js +8 -0
  27. package/dist/govcitizenhub/hooks/uploadVisibility.js.map +1 -0
  28. package/dist/govcitizenhub/hooks/useFiles.d.ts +3 -18
  29. package/dist/govcitizenhub/hooks/useFiles.js +49 -48
  30. package/dist/govcitizenhub/hooks/useFiles.js.map +1 -1
  31. package/dist/govcitizenhub/pages/CitizenHomePage.js +3 -3
  32. package/dist/govcitizenhub/pages/CitizenHomePage.js.map +1 -1
  33. package/dist/govcitizenhub/pages/DashboardPage.js +11 -11
  34. package/dist/govcitizenhub/pages/DashboardPage.js.map +1 -1
  35. package/dist/govcitizenhub/pages/access-control/AccessControlPage.js +42 -42
  36. package/dist/govcitizenhub/pages/access-control/AccessControlPage.js.map +1 -1
  37. package/dist/govcitizenhub/pages/agencies/AgenciesPage.js +4 -4
  38. package/dist/govcitizenhub/pages/agencies/AgenciesPage.js.map +1 -1
  39. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js +4 -4
  40. package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js.map +1 -1
  41. package/dist/govcitizenhub/pages/applications/ApplicationsPage.js +8 -8
  42. package/dist/govcitizenhub/pages/applications/ApplicationsPage.js.map +1 -1
  43. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js +7 -7
  44. package/dist/govcitizenhub/pages/applications/NewApplicationPage.js.map +1 -1
  45. package/dist/govcitizenhub/pages/documents/DocumentsPage.js +2 -2
  46. package/dist/govcitizenhub/pages/documents/DocumentsPage.js.map +1 -1
  47. package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js +3 -3
  48. package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js.map +1 -1
  49. package/dist/govcitizenhub/pages/grievances/GrievancesPage.js +9 -9
  50. package/dist/govcitizenhub/pages/grievances/GrievancesPage.js.map +1 -1
  51. package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.js +11 -11
  52. package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.js.map +1 -1
  53. package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.js +1 -1
  54. package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.js.map +1 -1
  55. package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.js +13 -13
  56. package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.js.map +1 -1
  57. package/dist/govcitizenhub/pages/intelligence/BudgetPage.js +28 -28
  58. package/dist/govcitizenhub/pages/intelligence/BudgetPage.js.map +1 -1
  59. package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.js +2 -2
  60. package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.js.map +1 -1
  61. package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.js +3 -3
  62. package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.js.map +1 -1
  63. package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.js +13 -13
  64. package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.js.map +1 -1
  65. package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.js +5 -5
  66. package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.js.map +1 -1
  67. package/dist/govcitizenhub/pages/intelligence/ElectionsPage.js +16 -16
  68. package/dist/govcitizenhub/pages/intelligence/ElectionsPage.js.map +1 -1
  69. package/dist/govcitizenhub/pages/intelligence/GovernancePage.js +6 -6
  70. package/dist/govcitizenhub/pages/intelligence/GovernancePage.js.map +1 -1
  71. package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.js +16 -16
  72. package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.js.map +1 -1
  73. package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.js +10 -10
  74. package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.js.map +1 -1
  75. package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.js +7 -7
  76. package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.js.map +1 -1
  77. package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.js +2 -2
  78. package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.js.map +1 -1
  79. package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.js +2 -2
  80. package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.js.map +1 -1
  81. package/dist/govcitizenhub/pages/intelligence/OpenDataPage.js +18 -18
  82. package/dist/govcitizenhub/pages/intelligence/OpenDataPage.js.map +1 -1
  83. package/dist/govcitizenhub/pages/intelligence/ProjectsPage.js +14 -14
  84. package/dist/govcitizenhub/pages/intelligence/ProjectsPage.js.map +1 -1
  85. package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.js +8 -8
  86. package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.js.map +1 -1
  87. package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.js +27 -27
  88. package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.js.map +1 -1
  89. package/dist/govcitizenhub/pages/intelligence/TimelinePage.js +3 -3
  90. package/dist/govcitizenhub/pages/intelligence/TimelinePage.js.map +1 -1
  91. package/dist/govcitizenhub/pages/mobile/MobileHomePage.js +3 -3
  92. package/dist/govcitizenhub/pages/mobile/MobileHomePage.js.map +1 -1
  93. package/dist/govcitizenhub/pages/mobile/MobileProfilePage.js +1 -1
  94. package/dist/govcitizenhub/pages/mobile/MobileProfilePage.js.map +1 -1
  95. package/dist/govcitizenhub/pages/mobile/MobileRequestsPage.js +1 -1
  96. package/dist/govcitizenhub/pages/mobile/MobileRequestsPage.js.map +1 -1
  97. package/dist/govcitizenhub/pages/payments/PaymentsPage.js +4 -4
  98. package/dist/govcitizenhub/pages/payments/PaymentsPage.js.map +1 -1
  99. package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js +2 -2
  100. package/dist/govcitizenhub/pages/permits/IssuePermitDialog.js.map +1 -1
  101. package/dist/govcitizenhub/pages/permits/PermitsPage.js +8 -8
  102. package/dist/govcitizenhub/pages/permits/PermitsPage.js.map +1 -1
  103. package/dist/govcitizenhub/pages/permits/VerifyPermitPage.js +6 -6
  104. package/dist/govcitizenhub/pages/permits/VerifyPermitPage.js.map +1 -1
  105. package/dist/govcitizenhub/pages/services/FormFieldBuilder.js +3 -3
  106. package/dist/govcitizenhub/pages/services/FormFieldBuilder.js.map +1 -1
  107. package/dist/govcitizenhub/pages/services/ServiceDetailPage.js +3 -3
  108. package/dist/govcitizenhub/pages/services/ServiceDetailPage.js.map +1 -1
  109. package/dist/govcitizenhub/pages/services/ServiceFormDialog.js +3 -3
  110. package/dist/govcitizenhub/pages/services/ServiceFormDialog.js.map +1 -1
  111. package/dist/govcitizenhub/pages/services/ServicesPage.js +6 -6
  112. package/dist/govcitizenhub/pages/services/ServicesPage.js.map +1 -1
  113. package/dist/govcitizenhub/pages/wallet/WalletPage.js +2 -2
  114. package/dist/govcitizenhub/pages/wallet/WalletPage.js.map +1 -1
  115. package/dist/govcitizenhub/types/index.d.ts +6 -0
  116. package/dist/services/createSandboxAssistantTransport.js +3 -3
  117. package/dist/services/createSandboxAssistantTransport.js.map +1 -1
  118. package/package.json +7 -5
@@ -11,7 +11,7 @@ function g({ applicationId: g, requirement: _, onAdded: v, disabled: y = !1, dro
11
11
  let w = s(null), T = o(), E = e(), [D, O] = c(!1), [k, A] = c(""), [j, M] = c(!1), N = typeof x == "function", P = async (e) => {
12
12
  O(!0);
13
13
  try {
14
- let r = await n(e, S ?? t.documents);
14
+ let r = await n(e, S ?? t.documents, "PRIVATE");
15
15
  if (x) await x(r), i.success("File uploaded", r.name);
16
16
  else if (g) await E.mutateAsync({
17
17
  applicationId: g,
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentUploadField.js","names":["DocumentUploadField","inputRef","useRef","inputId","useId","addDocument","useGovAddDocument","uploading","setUploading","useState","name","setName","dragging","setDragging","standalone","onUploaded","upload","uploaded","uploadFileToFiles","file","folder","FILE_FOLDERS","notify","applicationId","requirement","onAdded","error","describeError","handleSelect","event","busy","locked","disabled","handleDrop","hiddenInput","dropzone","Input","cn","Loader2","UploadCloud","hint","Button","Upload"],"sources":["../../../src/govcitizenhub/components/DocumentUploadField.tsx"],"sourcesContent":["/**\n * DocumentUploadField — REAL file upload backed by wspace-files-svc.\n * @module govcitizenhub/components\n *\n * Two modes, one upload path (`uploadFileToFiles` — ensure folder → presigned\n * PUT → completeUpload). It never keeps a local blob store and never fabricates\n * a document: the file is real and the id it yields is a real `File` id.\n *\n * - Casework mode (default): pass `applicationId`. After the upload the file is\n * recorded against the application with\n * `govAddDocument({ applicationId, fileId, name, requirement })`.\n * - Standalone mode: pass `onUploaded` (and optionally `folder`). The uploaded\n * file is handed back to the caller and NO document record is created — used\n * by surfaces that persist an opaque `*FileId` on their own entity\n * (open-data dataset files, correction evidence, …).\n */\n\nimport { useId, useRef, useState, type DragEvent } from 'react';\nimport { Loader2, Upload, UploadCloud } from 'lucide-react';\nimport { Button, Input } from '@burdenoff/fe-libs/ui';\n\nimport { useGovAddDocument } from '../hooks/useGovApi';\nimport { FILE_FOLDERS, uploadFileToFiles, type UploadedFile } from '../hooks/useFiles';\nimport { notify, describeError } from '../lib/toast';\nimport { cn } from '../utils/cn';\n\ninterface DocumentUploadFieldProps {\n /**\n * Application to record the upload against (casework mode). Omit it and pass\n * `onUploaded` for a standalone upload that only needs the resulting file id.\n */\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 * Render a full drag-and-drop zone (default) instead of the compact inline\n * row. Set false to keep the legacy input + button layout.\n */\n dropzone?: boolean;\n /**\n * Standalone mode: receive the uploaded file instead of recording it against\n * an application. When set, `govAddDocument` is never called.\n */\n onUploaded?: (file: UploadedFile) => void | Promise<void>;\n /** Destination folder in wspace-files-svc. Defaults to the Documents folder. */\n folder?: string;\n /** Helper line under the dropzone. Defaults to the accepted-formats hint. */\n hint?: string;\n}\n\nexport function DocumentUploadField({\n applicationId,\n requirement,\n onAdded,\n disabled = false,\n dropzone = true,\n onUploaded,\n folder,\n hint,\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 const [dragging, setDragging] = useState(false);\n\n // The document name only exists to label a casework document record, so the\n // standalone caller never sees the field.\n const standalone = typeof onUploaded === 'function';\n\n const upload = async (file: File) => {\n setUploading(true);\n try {\n const uploaded = await uploadFileToFiles(file, folder ?? FILE_FOLDERS.documents);\n if (onUploaded) {\n await onUploaded(uploaded);\n notify.success('File uploaded', uploaded.name);\n } else if (applicationId) {\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 } else {\n throw new Error('Nowhere to attach this file — supply applicationId or onUploaded.');\n }\n setName('');\n onAdded?.();\n } catch (error) {\n notify.error('Upload failed', describeError(error));\n } finally {\n setUploading(false);\n }\n };\n\n const handleSelect = async (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n event.target.value = '';\n if (file) await upload(file);\n };\n\n const busy = uploading || addDocument.isPending;\n const locked = busy || disabled;\n\n const handleDrop = (event: DragEvent<HTMLDivElement>) => {\n event.preventDefault();\n setDragging(false);\n if (locked) return;\n const file = event.dataTransfer.files?.[0];\n if (file) void upload(file);\n };\n\n const hiddenInput = (\n <input\n ref={inputRef}\n id={inputId}\n type=\"file\"\n className=\"sr-only\"\n aria-label=\"Choose a file to upload\"\n disabled={locked}\n onChange={(event) => void handleSelect(event)}\n />\n );\n\n if (!dropzone) {\n return (\n <div className=\"flex flex-col gap-2 sm:flex-row sm:items-center\">\n {!standalone && (\n <Input\n value={name}\n onChange={(e) => setName(e.target.value)}\n placeholder={\n requirement ? `Name (default: ${requirement})` : 'Document name (optional)'\n }\n aria-label=\"Document name\"\n className=\"sm:max-w-xs\"\n disabled={locked}\n />\n )}\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"sm\"\n disabled={locked}\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…' : standalone ? 'Upload file' : 'Upload document'}\n </Button>\n {hiddenInput}\n </div>\n );\n }\n\n return (\n <div className=\"flex flex-col gap-2\">\n {!standalone && (\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 disabled={locked}\n />\n )}\n <div\n role=\"button\"\n tabIndex={locked ? -1 : 0}\n aria-label=\"Upload a document — click or drag a file here\"\n aria-disabled={locked}\n onClick={() => !locked && inputRef.current?.click()}\n onKeyDown={(event) => {\n if (!locked && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault();\n inputRef.current?.click();\n }\n }}\n onDragOver={(event) => {\n event.preventDefault();\n if (!locked) setDragging(true);\n }}\n onDragLeave={() => setDragging(false)}\n onDrop={handleDrop}\n className={cn(\n 'flex flex-col items-center justify-center gap-2 rounded-xl border-2 border-dashed px-4 py-8 text-center transition-colors outline-none',\n locked && 'cursor-not-allowed opacity-60',\n !locked &&\n 'cursor-pointer focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]',\n dragging\n ? 'border-action-primary-bg bg-[var(--color-accent-soft)]'\n : 'border-border-seam bg-bg-sunken/40 hover:border-border-strong'\n )}\n >\n {busy ? (\n <Loader2 className=\"size-6 animate-spin text-text-secondary\" aria-hidden=\"true\" />\n ) : (\n <span className=\"inline-flex size-10 items-center justify-center rounded-full bg-[var(--color-accent-soft)] text-action-primary-text\">\n <UploadCloud className=\"size-5\" aria-hidden=\"true\" />\n </span>\n )}\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n {busy ? 'Uploading…' : 'Click to upload or drag & drop'}\n </p>\n <p className=\"mt-0.5 text-xs text-text-muted\">\n {hint ?? (requirement ? `Requirement: ${requirement}` : 'PDF, JPG or PNG')}\n </p>\n </div>\n {hiddenInput}\n </div>\n </div>\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AA,CAAA;C,KApFH,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACG,CAACpB,KACA,kBAACsB,GAAD;IACE,OAAO1B;IACP,WAAW,MAAMC,EAAQ,EAAE,OAAO,KAAK;IACvC,aACEa,IAAc,kBAAkBA,EAAY,KAAK;IAEnD,cAAW;IACX,WAAU;IACV,UAAUO;GACX,CAAA;GAEH,kBAACU,GAAD;IACE,MAAK;IACL,SAAQ;IACR,MAAK;IACL,UAAUV;IACV,eAAe9B,EAAS,SAAS,MAAM;IALzC,UAAA,CAOG6B,IAAO,kBAACQ,GAAD,EAAS,WAAU,uBAAwB,CAAA,IAAI,kBAACI,GAAD,EAAQ,WAAU,UAAW,CAAA,GACnFZ,IAAO,eAAehB,IAAa,gBAAgB,iBAC9C;;GACPoB;EACE;;AA8DX"}
1
+ {"version":3,"file":"DocumentUploadField.js","names":["DocumentUploadField","inputRef","useRef","inputId","useId","addDocument","useGovAddDocument","uploading","setUploading","useState","name","setName","dragging","setDragging","standalone","onUploaded","upload","uploaded","uploadFileToFiles","file","folder","FILE_FOLDERS","notify","applicationId","requirement","onAdded","error","describeError","handleSelect","event","busy","locked","disabled","handleDrop","hiddenInput","dropzone","Input","cn","Loader2","UploadCloud","hint","Button","Upload"],"sources":["../../../src/govcitizenhub/components/DocumentUploadField.tsx"],"sourcesContent":["/**\n * DocumentUploadField — REAL file upload backed by wspace-files-svc.\n * @module govcitizenhub/components\n *\n * Two modes, one upload path (`uploadFileToFiles` — ensure folder → presigned\n * PUT → completeUpload). It never keeps a local blob store and never fabricates\n * a document: the file is real and the id it yields is a real `File` id.\n *\n * - Casework mode (default): pass `applicationId`. After the upload the file is\n * recorded against the application with\n * `govAddDocument({ applicationId, fileId, name, requirement })`.\n * - Standalone mode: pass `onUploaded` (and optionally `folder`). The uploaded\n * file is handed back to the caller and NO document record is created — used\n * by surfaces that persist an opaque `*FileId` on their own entity\n * (open-data dataset files, correction evidence, …).\n */\n\nimport { useId, useRef, useState, type DragEvent } from 'react';\nimport { Loader2, Upload, UploadCloud } from 'lucide-react';\nimport { Button, Input } from '@burdenoff/fe-libs/ui';\n\nimport { useGovAddDocument } from '../hooks/useGovApi';\nimport { FILE_FOLDERS, uploadFileToFiles, type UploadedFile } from '../hooks/useFiles';\nimport { notify, describeError } from '../lib/toast';\nimport { cn } from '../utils/cn';\n\ninterface DocumentUploadFieldProps {\n /**\n * Application to record the upload against (casework mode). Omit it and pass\n * `onUploaded` for a standalone upload that only needs the resulting file id.\n */\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 * Render a full drag-and-drop zone (default) instead of the compact inline\n * row. Set false to keep the legacy input + button layout.\n */\n dropzone?: boolean;\n /**\n * Standalone mode: receive the uploaded file instead of recording it against\n * an application. When set, `govAddDocument` is never called.\n */\n onUploaded?: (file: UploadedFile) => void | Promise<void>;\n /** Destination folder in wspace-files-svc. Defaults to the Documents folder. */\n folder?: string;\n /** Helper line under the dropzone. Defaults to the accepted-formats hint. */\n hint?: string;\n}\n\nexport function DocumentUploadField({\n applicationId,\n requirement,\n onAdded,\n disabled = false,\n dropzone = true,\n onUploaded,\n folder,\n hint,\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 const [dragging, setDragging] = useState(false);\n\n // The document name only exists to label a casework document record, so the\n // standalone caller never sees the field.\n const standalone = typeof onUploaded === 'function';\n\n const upload = async (file: File) => {\n setUploading(true);\n try {\n const uploaded = await uploadFileToFiles(file, folder ?? FILE_FOLDERS.documents, 'PRIVATE');\n if (onUploaded) {\n await onUploaded(uploaded);\n notify.success('File uploaded', uploaded.name);\n } else if (applicationId) {\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 } else {\n throw new Error('Nowhere to attach this file — supply applicationId or onUploaded.');\n }\n setName('');\n onAdded?.();\n } catch (error) {\n notify.error('Upload failed', describeError(error));\n } finally {\n setUploading(false);\n }\n };\n\n const handleSelect = async (event: React.ChangeEvent<HTMLInputElement>) => {\n const file = event.target.files?.[0];\n event.target.value = '';\n if (file) await upload(file);\n };\n\n const busy = uploading || addDocument.isPending;\n const locked = busy || disabled;\n\n const handleDrop = (event: DragEvent<HTMLDivElement>) => {\n event.preventDefault();\n setDragging(false);\n if (locked) return;\n const file = event.dataTransfer.files?.[0];\n if (file) void upload(file);\n };\n\n const hiddenInput = (\n <input\n ref={inputRef}\n id={inputId}\n type=\"file\"\n className=\"sr-only\"\n aria-label=\"Choose a file to upload\"\n disabled={locked}\n onChange={(event) => void handleSelect(event)}\n />\n );\n\n if (!dropzone) {\n return (\n <div className=\"flex flex-col gap-2 sm:flex-row sm:items-center\">\n {!standalone && (\n <Input\n value={name}\n onChange={(e) => setName(e.target.value)}\n placeholder={\n requirement ? `Name (default: ${requirement})` : 'Document name (optional)'\n }\n aria-label=\"Document name\"\n className=\"sm:max-w-xs\"\n disabled={locked}\n />\n )}\n <Button\n type=\"button\"\n variant=\"secondary\"\n size=\"sm\"\n disabled={locked}\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…' : standalone ? 'Upload file' : 'Upload document'}\n </Button>\n {hiddenInput}\n </div>\n );\n }\n\n return (\n <div className=\"flex flex-col gap-2\">\n {!standalone && (\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 disabled={locked}\n />\n )}\n <div\n role=\"button\"\n tabIndex={locked ? -1 : 0}\n aria-label=\"Upload a document — click or drag a file here\"\n aria-disabled={locked}\n onClick={() => !locked && inputRef.current?.click()}\n onKeyDown={(event) => {\n if (!locked && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault();\n inputRef.current?.click();\n }\n }}\n onDragOver={(event) => {\n event.preventDefault();\n if (!locked) setDragging(true);\n }}\n onDragLeave={() => setDragging(false)}\n onDrop={handleDrop}\n className={cn(\n 'flex flex-col items-center justify-center gap-2 rounded-xl border-2 border-dashed px-4 py-8 text-center transition-colors outline-none',\n locked && 'cursor-not-allowed opacity-60',\n !locked &&\n 'cursor-pointer focus-visible:ring-1 focus-visible:ring-[var(--color-focus-ring)]',\n dragging\n ? 'border-action-primary-bg bg-[var(--color-accent-soft)]'\n : 'border-border-seam bg-bg-sunken/40 hover:border-border-strong'\n )}\n >\n {busy ? (\n <Loader2 className=\"size-6 animate-spin text-text-secondary\" aria-hidden=\"true\" />\n ) : (\n <span className=\"inline-flex size-10 items-center justify-center rounded-full bg-[var(--color-accent-soft)] text-action-primary-text\">\n <UploadCloud className=\"size-5\" aria-hidden=\"true\" />\n </span>\n )}\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n {busy ? 'Uploading…' : 'Click to upload or drag & drop'}\n </p>\n <p className=\"mt-0.5 text-xs text-text-muted\">\n {hint ?? (requirement ? `Requirement: ${requirement}` : 'PDF, JPG or PNG')}\n </p>\n </div>\n {hiddenInput}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAoDA,SAAgBA,EAAoB,EAClC,kBACA,gBACA,YACA,cAAW,IACX,cAAW,IACX,eACA,WACA,WAC2B;CAC3B,IAAMC,IAAWC,EAAgC,IAAI,GAC/CC,IAAUC,EAAM,GAChBC,IAAcC,EAAkB,GAChC,CAACC,GAAWC,KAAgBC,EAAS,EAAK,GAC1C,CAACC,GAAMC,KAAWF,EAAS,EAAE,GAC7B,CAACG,GAAUC,KAAeJ,EAAS,EAAK,GAIxCK,IAAa,OAAOC,KAAe,YAEnCC,IAAS,OAAO,MAAe;EACnC,EAAa,EAAI;EACjB,IAAI;GACF,IAAMC,IAAW,MAAMC,EAA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,WAAU,UAAW,CAAA,GACnFZ,IAAO,eAAehB,IAAa,gBAAgB,iBAC9C;;GACPoB;EACE;;AA8DX"}
@@ -1,12 +1,30 @@
1
1
  import { FC, ReactNode } from 'react';
2
+ import { EmptyStateKind, EmptyStateSize, EmptyStateSubject } from '@burdenoff/fe-libs/ui';
2
3
  interface EmptyStateProps {
3
4
  icon?: ReactNode;
4
- /** On-brand illustration name → empty-data, empty-search, empty-files, empty-people, etc. */
5
+ /**
6
+ * On-brand illustration name → `/illustrations/<name>.webp`. Standard names:
7
+ * empty-data, empty-search, empty-files, empty-people, empty-notifications,
8
+ * onboarding, empty-generic.
9
+ */
5
10
  illustration?: string;
6
11
  title: string;
7
12
  description?: string;
8
13
  action?: ReactNode;
9
14
  className?: string;
15
+ /** Glass opt-in only: the situation. Default `first-use` (`no-results` for empty-search). */
16
+ kind?: EmptyStateKind;
17
+ /** Glass opt-in only: what the state is about. Default from `illustration`, else `auto`. */
18
+ subject?: EmptyStateSubject | 'auto' | 'none';
19
+ /** Glass opt-in only: where it sits. Default the shared one (`page`). */
20
+ size?: EmptyStateSize;
10
21
  }
22
+ /**
23
+ * The glass subject for a legacy illustration name. `empty-data` (and no illustration)
24
+ * says nothing about the subject: the icon's lucide name decides (`auto`).
25
+ */
26
+ export declare function glassSubjectFor(illustration?: string): EmptyStateSubject | 'auto';
27
+ /** The glass situation for a legacy illustration name. */
28
+ export declare function glassKindFor(illustration?: string): EmptyStateKind;
11
29
  export declare const EmptyState: FC<EmptyStateProps>;
12
30
  export {};
@@ -1,34 +1,54 @@
1
1
  import { cn as e } from "../utils/cn.js";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- import { IllustratedEmptyState as r } from "@burdenoff/fe-libs/ui";
3
+ import { EmptyState as r, IllustratedEmptyState as i, useGlassEmptyStates as a } from "@burdenoff/fe-libs/ui";
4
4
  // src/govcitizenhub/components/EmptyState.tsx
5
- var i = ({ icon: i, illustration: a, title: o, description: s, action: c, className: l }) => a ? /* @__PURE__ */ t(r, {
6
- illustration: a,
7
- title: o,
8
- description: s,
9
- action: c,
10
- className: l
5
+ var o = {
6
+ "empty-files": "media",
7
+ "empty-people": "people",
8
+ "empty-notifications": "notifications"
9
+ };
10
+ function s(e) {
11
+ return e && o[e] || "auto";
12
+ }
13
+ function c(e) {
14
+ return e === "empty-search" ? "no-results" : "first-use";
15
+ }
16
+ var l = ({ icon: o, illustration: l, title: u, description: d, action: f, className: p, kind: m, subject: h, size: g }) => a() ? /* @__PURE__ */ t(r, {
17
+ icon: o,
18
+ title: u,
19
+ description: d,
20
+ action: f,
21
+ className: p,
22
+ kind: m ?? c(l),
23
+ illustration: h ?? s(l),
24
+ ...g ? { size: g } : {}
25
+ }) : l ? /* @__PURE__ */ t(i, {
26
+ illustration: l,
27
+ title: u,
28
+ description: d,
29
+ action: f,
30
+ className: p
11
31
  }) : /* @__PURE__ */ n("div", {
12
- className: e("flex flex-col items-center justify-center py-12 px-4 text-center", l),
32
+ className: e("flex flex-col items-center justify-center py-12 px-4 text-center", p),
13
33
  children: [
14
- i && /* @__PURE__ */ t("div", {
34
+ o && /* @__PURE__ */ t("div", {
15
35
  className: "mb-4 text-text-secondary opacity-50",
16
- children: i
36
+ children: o
17
37
  }),
18
38
  /* @__PURE__ */ t("h3", {
19
39
  className: "text-lg font-medium text-text-primary",
20
- children: o
40
+ children: u
21
41
  }),
22
- s && /* @__PURE__ */ t("p", {
42
+ d && /* @__PURE__ */ t("p", {
23
43
  className: "mt-2 text-sm text-text-secondary max-w-sm",
24
- children: s
44
+ children: d
25
45
  }),
26
- c && /* @__PURE__ */ t("div", {
46
+ f && /* @__PURE__ */ t("div", {
27
47
  className: "mt-6",
28
- children: c
48
+ children: f
29
49
  })
30
50
  ]
31
51
  });
32
- export { i as EmptyState };
52
+ export { l as EmptyState, c as glassKindFor, s as glassSubjectFor };
33
53
 
34
54
  //# sourceMappingURL=EmptyState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyState.js","names":["EmptyState","illustration","IllustratedEmptyState","cn","className","icon","title","description","action"],"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,IAAaA,KAAmC,EAC9C,SACA,iBACA,UACA,gBACA,WACA,mBAEIC,IAEA,kBAACC,GAAD;CACgB;CACP;CACM;CACL;CACG;AACZ,CAAA,IAKH,kBAAC,OAAD;CACE,WAAWC,EAAG,oEAAoEC,CAAS;CAD7F,UAAA;EAGGC,KAAQ,kBAAC,OAAD;GAAK,WAAU;GAAuC,UAAAA;EAAU,CAAA;EACzE,kBAAC,MAAD;GAAI,WAAU;GAAyC,UAAAC;EAAU,CAAA;EAChEC,KAAe,kBAAC,KAAD;GAAG,WAAU;GAA6C,UAAAA;EAAe,CAAA;EACxFC,KAAU,kBAAC,OAAD;GAAK,WAAU;GAAQ,UAAAA;EAAY,CAAA;CAC3C"}
1
+ {"version":3,"file":"EmptyState.js","names":["EmptyState","SharedEmptyState","SUBJECT_OF_ILLUSTRATION","glassSubjectFor","illustration","glassKindFor","EmptyState$1","useGlassEmptyStates","EmptyState","kind","subject","size","IllustratedEmptyState","cn","className","icon","title","description","action"],"sources":["../../../src/govcitizenhub/components/EmptyState.tsx"],"sourcesContent":["/**\n * Empty State Component\n * @module govcitizenhub/components\n *\n * Boff UI 2.0 zero-state. When an `illustration` name is provided it renders the\n * fe-libs {@link IllustratedEmptyState} (on-brand glass illustration); otherwise\n * it falls back to the icon-based layout.\n *\n * With the host's glass empty states (`AppShellConfig.glassEmptyStates`, BOFF-18039)\n * it is fe-libs' `EmptyState`, drawn for its situation (`kind`, default `first-use`)\n * and its subject (`subject`; by default read from the legacy illustration name, else\n * from the icon's lucide name). Without the opt-in the earlier layout is unchanged.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport {\n EmptyState as SharedEmptyState,\n IllustratedEmptyState,\n useGlassEmptyStates,\n type EmptyStateKind,\n type EmptyStateSize,\n type EmptyStateSubject,\n} from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface EmptyStateProps {\n icon?: ReactNode;\n /**\n * On-brand illustration name → `/illustrations/<name>.webp`. Standard names:\n * empty-data, empty-search, empty-files, empty-people, empty-notifications,\n * onboarding, empty-generic.\n */\n illustration?: string;\n title: string;\n description?: string;\n action?: ReactNode;\n className?: string;\n /** Glass opt-in only: the situation. Default `first-use` (`no-results` for empty-search). */\n kind?: EmptyStateKind;\n /** Glass opt-in only: what the state is about. Default from `illustration`, else `auto`. */\n subject?: EmptyStateSubject | 'auto' | 'none';\n /** Glass opt-in only: where it sits. Default the shared one (`page`). */\n size?: EmptyStateSize;\n}\n\n/** The legacy illustration names, as the glass empty state's subjects. */\nconst SUBJECT_OF_ILLUSTRATION: Readonly<Record<string, EmptyStateSubject>> = {\n 'empty-files': 'media',\n 'empty-people': 'people',\n 'empty-notifications': 'notifications',\n};\n\n/**\n * The glass subject for a legacy illustration name. `empty-data` (and no illustration)\n * says nothing about the subject: the icon's lucide name decides (`auto`).\n */\nexport function glassSubjectFor(illustration?: string): EmptyStateSubject | 'auto' {\n return (illustration && SUBJECT_OF_ILLUSTRATION[illustration]) || 'auto';\n}\n\n/** The glass situation for a legacy illustration name. */\nexport function glassKindFor(illustration?: string): EmptyStateKind {\n return illustration === 'empty-search' ? 'no-results' : 'first-use';\n}\n\nexport const EmptyState: FC<EmptyStateProps> = ({\n icon,\n illustration,\n title,\n description,\n action,\n className,\n kind,\n subject,\n size,\n}) => {\n const glass = useGlassEmptyStates();\n\n if (glass) {\n return (\n <SharedEmptyState\n icon={icon}\n title={title}\n description={description}\n action={action}\n className={className}\n kind={kind ?? glassKindFor(illustration)}\n illustration={subject ?? glassSubjectFor(illustration)}\n {...(size ? { size } : {})}\n />\n );\n }\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":";;;;AA8CA,IAAME,IAAuE;CAC3E,eAAe;CACf,gBAAgB;CAChB,uBAAuB;AACzB;AAMA,SAAgBC,EAAgB,GAAmD;CACjF,OAAQC,KAAgBF,EAAwBE,MAAkB;AACpE;AAGA,SAAgBC,EAAa,GAAuC;CAClE,OAAOD,MAAiB,iBAAiB,eAAe;AAC1D;AAEA,IAAaJ,KAAmC,EAC9C,SACA,iBACA,UACA,gBACA,WACA,cACA,SACA,YACA,cAEcO,EAEV,IAEA,kBAACN,GAAD;CACQ;CACC;CACM;CACL;CACG;CACX,MAAMQ,KAAQJ,EAAaD,CAAY;CACvC,cAAcM,KAAWP,EAAgBC,CAAY;CACrD,GAAKO,IAAO,EAAE,QAAK,IAAI,CAAC;AACzB,CAAA,IAIDP,IAEA,kBAACQ,GAAD;CACgB;CACP;CACM;CACL;CACG;AACZ,CAAA,IAKH,kBAAC,OAAD;CACE,WAAWC,EAAG,oEAAoEC,CAAS;CAD7F,UAAA;EAGGC,KAAQ,kBAAC,OAAD;GAAK,WAAU;GAAuC,UAAAA;EAAU,CAAA;EACzE,kBAAC,MAAD;GAAI,WAAU;GAAyC,UAAAC;EAAU,CAAA;EAChEC,KAAe,kBAAC,KAAD;GAAG,WAAU;GAA6C,UAAAA;EAAe,CAAA;EACxFC,KAAU,kBAAC,OAAD;GAAK,WAAU;GAAQ,UAAAA;EAAY,CAAA;CAC3C"}
@@ -15,7 +15,7 @@ function r({ options: r, value: i, onChange: a, className: o, variant: s = "pill
15
15
  onClick: () => a(r.value),
16
16
  className: e("text-sm font-medium transition-colors", c ? e("-mb-px border-b-2 px-3 py-2", o ? "border-action-primary-bg text-text-primary" : "border-transparent text-text-secondary hover:text-text-primary") : e("rounded-lg px-3 py-1.5", o ? "bg-action-primary-bg text-action-primary-text" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary")),
17
17
  children: [r.label, typeof r.count == "number" && /* @__PURE__ */ t("span", {
18
- className: e("ml-1.5 rounded-full px-1.5 py-0.5 text-xs tabular-nums", o && !c ? "bg-[color-mix(in_srgb,var(--color-action-primary-text)_15%,transparent)]" : o && c ? "bg-[var(--color-accent-soft)] text-action-primary-text" : "bg-bg-sunken text-text-secondary"),
18
+ className: e("ms-1.5 rounded-full px-1.5 py-0.5 text-xs tabular-nums", o && !c ? "bg-[color-mix(in_srgb,var(--color-action-primary-text)_15%,transparent)]" : o && c ? "bg-[var(--color-accent-soft)] text-action-primary-text" : "bg-bg-sunken text-text-secondary"),
19
19
  children: r.count
20
20
  })]
21
21
  }, r.value);
@@ -1 +1 @@
1
- {"version":3,"file":"FilterTabs.js","names":["FilterTabs","underline","variant","cn","className","options","active","opt","value","onChange"],"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 * Visual treatment:\n * - `pill` (default): segmented control with a filled active pill.\n * - `underline`: text tabs with an active underline (for page-header tab rows).\n */\n variant?: 'pill' | 'underline';\n}\n\nexport function FilterTabs<V extends string>({\n options,\n value,\n onChange,\n className,\n variant = 'pill',\n}: FilterTabsProps<V>) {\n const underline = variant === 'underline';\n return (\n <div\n role=\"tablist\"\n className={cn(\n 'inline-flex flex-wrap items-center',\n underline\n ? 'gap-1 border-b border-border-seam'\n : '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 'text-sm font-medium transition-colors',\n underline\n ? cn(\n '-mb-px border-b-2 px-3 py-2',\n active\n ? 'border-action-primary-bg text-text-primary'\n : 'border-transparent text-text-secondary hover:text-text-primary'\n )\n : cn(\n 'rounded-lg px-3 py-1.5',\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 >\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 && !underline\n ? 'bg-[color-mix(in_srgb,var(--color-action-primary-text)_15%,transparent)]'\n : active && underline\n ? 'bg-[var(--color-accent-soft)] text-action-primary-text'\n : 'bg-bg-sunken text-text-secondary'\n )}\n >\n {opt.count}\n </span>\n )}\n </button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;AA0BA,SAAgBA,EAA6B,EAC3C,YACA,UACA,aACA,cACA,aAAU,UACW;CACrB,IAAMC,IAAYC,MAAY;CAC9B,OACE,kBAAC,OAAD;EACE,MAAK;EACL,WAAWC,EACT,sCACAF,IACI,sCACA,gEACJG,CACF;EAEC,UAAAC,EAAQ,KAAK,MAAQ;GACpB,IAAMC,IAASC,EAAI,UAAUC;GAC7B,OACE,kBAAC,UAAD;IAEE,MAAK;IACL,MAAK;IACL,iBAAeF;IACf,eAAeG,EAASF,EAAI,KAAK;IACjC,WAAWJ,EACT,yCACAF,IACIE,EACE,+BACAG,IACI,+CACA,gEACN,IACAH,EACE,0BACAG,IACI,kDACA,gEACN,CACN;IArBF,UAAA,CAuBGC,EAAI,OACJ,OAAOA,EAAI,SAAU,YACpB,kBAAC,QAAD;KACE,WAAWJ,EACT,0DACAG,KAAU,CAACL,IACP,6EACAK,KAAUL,IACR,2DACA,kCACR;KAEC,UAAAM,EAAI;IACD,CAAA,CAEF;GArCD,GAAAA,EAAI,KAqCH;EAEZ,CAAC;CACE,CAAA;AAET"}
1
+ {"version":3,"file":"FilterTabs.js","names":["FilterTabs","underline","variant","cn","className","options","active","opt","value","onChange"],"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 * Visual treatment:\n * - `pill` (default): segmented control with a filled active pill.\n * - `underline`: text tabs with an active underline (for page-header tab rows).\n */\n variant?: 'pill' | 'underline';\n}\n\nexport function FilterTabs<V extends string>({\n options,\n value,\n onChange,\n className,\n variant = 'pill',\n}: FilterTabsProps<V>) {\n const underline = variant === 'underline';\n return (\n <div\n role=\"tablist\"\n className={cn(\n 'inline-flex flex-wrap items-center',\n underline\n ? 'gap-1 border-b border-border-seam'\n : '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 'text-sm font-medium transition-colors',\n underline\n ? cn(\n '-mb-px border-b-2 px-3 py-2',\n active\n ? 'border-action-primary-bg text-text-primary'\n : 'border-transparent text-text-secondary hover:text-text-primary'\n )\n : cn(\n 'rounded-lg px-3 py-1.5',\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 >\n {opt.label}\n {typeof opt.count === 'number' && (\n <span\n className={cn(\n 'ms-1.5 rounded-full px-1.5 py-0.5 text-xs tabular-nums',\n active && !underline\n ? 'bg-[color-mix(in_srgb,var(--color-action-primary-text)_15%,transparent)]'\n : active && underline\n ? 'bg-[var(--color-accent-soft)] text-action-primary-text'\n : 'bg-bg-sunken text-text-secondary'\n )}\n >\n {opt.count}\n </span>\n )}\n </button>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;AA0BA,SAAgBA,EAA6B,EAC3C,YACA,UACA,aACA,cACA,aAAU,UACW;CACrB,IAAMC,IAAYC,MAAY;CAC9B,OACE,kBAAC,OAAD;EACE,MAAK;EACL,WAAWC,EACT,sCACAF,IACI,sCACA,gEACJG,CACF;EAEC,UAAAC,EAAQ,KAAK,MAAQ;GACpB,IAAMC,IAASC,EAAI,UAAUC;GAC7B,OACE,kBAAC,UAAD;IAEE,MAAK;IACL,MAAK;IACL,iBAAeF;IACf,eAAeG,EAASF,EAAI,KAAK;IACjC,WAAWJ,EACT,yCACAF,IACIE,EACE,+BACAG,IACI,+CACA,gEACN,IACAH,EACE,0BACAG,IACI,kDACA,gEACN,CACN;IArBF,UAAA,CAuBGC,EAAI,OACJ,OAAOA,EAAI,SAAU,YACpB,kBAAC,QAAD;KACE,WAAWJ,EACT,0DACAG,KAAU,CAACL,IACP,6EACAK,KAAUL,IACR,2DACA,kCACR;KAEC,UAAAM,EAAI;IACD,CAAA,CAEF;GArCD,GAAAA,EAAI,KAqCH;EAEZ,CAAC;CACE,CAAA;AAET"}
@@ -247,7 +247,7 @@ function b({ items: e, className: t = "" }) {
247
247
  children: e.label
248
248
  }),
249
249
  e.value === void 0 ? null : /* @__PURE__ */ f("span", {
250
- className: "ml-auto font-semibold tabular-nums text-text-primary",
250
+ className: "ms-auto font-semibold tabular-nums text-text-primary",
251
251
  children: e.value
252
252
  })
253
253
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"GovCharts.js","names":["CHART_TOOLTIP_STYLE","CHART_SERIES_COLORS","ChartEmpty","label","GovAreaChart","gradientId","useId","data","emptyLabel","ResponsiveContainer","AreaChart","XAxis","YAxis","Tooltip","Area","GovDonutChart","sum","slice","PieChart","Pie","Cell","index","centerValue","centerLabel","GovBarChart","datum","BarChart","Bar","ChartLegend","className","items","item"],"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,IAAMA,IAAsB;CAC1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AAC;KACnB,YAAY;IACb,CAAA;GACO;;CACS,CAAA;AAEzB;AAQA,SAAgBuB,EAAY,EAC1B,UACA,eAAY,MAIX;CACD,OACE,kBAAC,MAAD;EAAI,WAAW,uBAAuBC;EACnC,UAAAC,EAAM,KAAK,MACV,kBAAC,MAAD;GAAqB,WAAU;GAA/B,UAAA;IACE,kBAAC,QAAD;KACE,eAAA;KACA,WAAU;KACV,OAAO,EAAE,iBAAiBC,EAAK,MAAM;IACtC,CAAA;IACD,kBAAC,QAAD;KAAM,WAAU;KAAuB,UAAAA,EAAK;IAAY,CAAA;IACvDA,EAAK,UAAU,KAAA,IAIZ,OAHF,kBAAC,QAAD;KAAM,WAAU;KACb,UAAAA,EAAK;IACF,CAAA;GAEN;EAZK,GAAAA,EAAK,KAYV,CACL;CACC,CAAA;AAER"}
1
+ {"version":3,"file":"GovCharts.js","names":["CHART_TOOLTIP_STYLE","CHART_SERIES_COLORS","ChartEmpty","label","GovAreaChart","gradientId","useId","data","emptyLabel","ResponsiveContainer","AreaChart","XAxis","YAxis","Tooltip","Area","GovDonutChart","sum","slice","PieChart","Pie","Cell","index","centerValue","centerLabel","GovBarChart","datum","BarChart","Bar","ChartLegend","className","items","item"],"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=\"ms-auto font-semibold tabular-nums text-text-primary\">\n {item.value}\n </span>\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ACE,SAAQ;KACR,MAAK;KACL,MAAM,gBAAgBtB,EAAW;KACjC,QAAQ;MAAC;MAAG;MAAG;MAAG;KAAC;KACnB,YAAY;IACb,CAAA;GACO;;CACS,CAAA;AAEzB;AAQA,SAAgBuB,EAAY,EAC1B,UACA,eAAY,MAIX;CACD,OACE,kBAAC,MAAD;EAAI,WAAW,uBAAuBC;EACnC,UAAAC,EAAM,KAAK,MACV,kBAAC,MAAD;GAAqB,WAAU;GAA/B,UAAA;IACE,kBAAC,QAAD;KACE,eAAA;KACA,WAAU;KACV,OAAO,EAAE,iBAAiBC,EAAK,MAAM;IACtC,CAAA;IACD,kBAAC,QAAD;KAAM,WAAU;KAAuB,UAAAA,EAAK;IAAY,CAAA;IACvDA,EAAK,UAAU,KAAA,IAIZ,OAHF,kBAAC,QAAD;KAAM,WAAU;KACb,UAAAA,EAAK;IACF,CAAA;GAEN;EAZK,GAAAA,EAAK,KAYV,CACL;CACC,CAAA;AAER"}
@@ -9,7 +9,7 @@ var r = (e) => e == null || e === "", i = ({ items: i, variant: a = "row", colum
9
9
  className: "shrink-0 text-sm text-text-muted",
10
10
  children: i.label
11
11
  }), /* @__PURE__ */ t("dd", {
12
- className: e("min-w-0 text-sm font-medium text-text-primary", a === "row" ? "text-right" : "text-left"),
12
+ className: e("min-w-0 text-sm font-medium text-text-primary", a === "row" ? "text-end" : "text-start"),
13
13
  children: r(i.value) ? /* @__PURE__ */ t("span", {
14
14
  className: "text-text-muted",
15
15
  children: "—"
@@ -1 +1 @@
1
- {"version":3,"file":"KeyValueList.js","names":["isEmpty","value","KeyValueList","cn","columns","className","items","variant","item","index"],"sources":["../../../src/govcitizenhub/components/KeyValueList.tsx"],"sourcesContent":["/**\n * KeyValueList\n * @module govcitizenhub/components\n *\n * A clean label/value grid for \"submitted information\" and meta side panels.\n * Values wrap; empty values render an em-dash so the grid never looks broken.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { cn } from '../utils/cn';\n\nexport interface KeyValueItem {\n label: ReactNode;\n value: ReactNode;\n}\n\nexport interface KeyValueListProps {\n items: KeyValueItem[];\n /** Layout: 'row' = label left / value right (default), 'stacked' = value under label. */\n variant?: 'row' | 'stacked';\n /** Column count on wide screens. */\n columns?: 1 | 2;\n className?: string;\n}\n\nconst isEmpty = (value: ReactNode): boolean =>\n value === null || value === undefined || value === '';\n\n/** Label/value grid for submitted-information + meta panels. */\nexport const KeyValueList: FC<KeyValueListProps> = ({\n items,\n variant = 'row',\n columns = 1,\n className,\n}) => (\n <dl\n className={cn(\n 'grid gap-x-6 gap-y-3',\n columns === 2 ? 'sm:grid-cols-2' : 'grid-cols-1',\n className\n )}\n >\n {items.map((item, index) => (\n <div\n key={index}\n className={cn(\n variant === 'row' ? 'flex items-baseline justify-between gap-4' : 'flex flex-col gap-0.5'\n )}\n >\n <dt className=\"shrink-0 text-sm text-text-muted\">{item.label}</dt>\n <dd\n className={cn(\n 'min-w-0 text-sm font-medium text-text-primary',\n variant === 'row' ? 'text-right' : 'text-left'\n )}\n >\n {isEmpty(item.value) ? <span className=\"text-text-muted\">—</span> : item.value}\n </dd>\n </div>\n ))}\n </dl>\n);\n"],"mappings":";;;AAyBA,IAAMA,KAAW,MACfC,KAAU,QAA+BA,MAAU,IAGxCC,KAAuC,EAClD,UACA,aAAU,OACV,aAAU,GACV,mBAEA,kBAAC,MAAD;CACE,WAAWC,EACT,wBACAC,MAAY,IAAI,mBAAmB,eACnCC,CACF;CAEC,UAAAC,EAAM,KAAK,GAAM,MAChB,kBAAC,OAAD;EAEE,WAAWH,EACTI,MAAY,QAAQ,8CAA8C,uBACpE;EAJF,UAAA,CAME,kBAAC,MAAD;GAAI,WAAU;GAAoC,UAAAC,EAAK;EAAU,CAAA,GACjE,kBAAC,MAAD;GACE,WAAWL,EACT,iDACAI,MAAY,QAAQ,eAAe,WACrC;GAEC,UAAAP,EAAQQ,EAAK,KAAK,IAAI,kBAAC,QAAD;IAAM,WAAU;IAAkB,UAAA;GAAO,CAAA,IAAIA,EAAK;EACvE,CAAA,CACD;CAdE,GAAAC,CAcF,CACN;AACC,CAAA"}
1
+ {"version":3,"file":"KeyValueList.js","names":["isEmpty","value","KeyValueList","cn","columns","className","items","variant","item","index"],"sources":["../../../src/govcitizenhub/components/KeyValueList.tsx"],"sourcesContent":["/**\n * KeyValueList\n * @module govcitizenhub/components\n *\n * A clean label/value grid for \"submitted information\" and meta side panels.\n * Values wrap; empty values render an em-dash so the grid never looks broken.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { cn } from '../utils/cn';\n\nexport interface KeyValueItem {\n label: ReactNode;\n value: ReactNode;\n}\n\nexport interface KeyValueListProps {\n items: KeyValueItem[];\n /** Layout: 'row' = label left / value right (default), 'stacked' = value under label. */\n variant?: 'row' | 'stacked';\n /** Column count on wide screens. */\n columns?: 1 | 2;\n className?: string;\n}\n\nconst isEmpty = (value: ReactNode): boolean =>\n value === null || value === undefined || value === '';\n\n/** Label/value grid for submitted-information + meta panels. */\nexport const KeyValueList: FC<KeyValueListProps> = ({\n items,\n variant = 'row',\n columns = 1,\n className,\n}) => (\n <dl\n className={cn(\n 'grid gap-x-6 gap-y-3',\n columns === 2 ? 'sm:grid-cols-2' : 'grid-cols-1',\n className\n )}\n >\n {items.map((item, index) => (\n <div\n key={index}\n className={cn(\n variant === 'row' ? 'flex items-baseline justify-between gap-4' : 'flex flex-col gap-0.5'\n )}\n >\n <dt className=\"shrink-0 text-sm text-text-muted\">{item.label}</dt>\n <dd\n className={cn(\n 'min-w-0 text-sm font-medium text-text-primary',\n variant === 'row' ? 'text-end' : 'text-start'\n )}\n >\n {isEmpty(item.value) ? <span className=\"text-text-muted\">—</span> : item.value}\n </dd>\n </div>\n ))}\n </dl>\n);\n"],"mappings":";;;AAyBA,IAAMA,KAAW,MACfC,KAAU,QAA+BA,MAAU,IAGxCC,KAAuC,EAClD,UACA,aAAU,OACV,aAAU,GACV,mBAEA,kBAAC,MAAD;CACE,WAAWC,EACT,wBACAC,MAAY,IAAI,mBAAmB,eACnCC,CACF;CAEC,UAAAC,EAAM,KAAK,GAAM,MAChB,kBAAC,OAAD;EAEE,WAAWH,EACTI,MAAY,QAAQ,8CAA8C,uBACpE;EAJF,UAAA,CAME,kBAAC,MAAD;GAAI,WAAU;GAAoC,UAAAC,EAAK;EAAU,CAAA,GACjE,kBAAC,MAAD;GACE,WAAWL,EACT,iDACAI,MAAY,QAAQ,aAAa,YACnC;GAEC,UAAAP,EAAQQ,EAAK,KAAK,IAAI,kBAAC,QAAD;IAAM,WAAU;IAAkB,UAAA;GAAO,CAAA,IAAIA,EAAK;EACvE,CAAA,CACD;CAdE,GAAAC,CAcF,CACN;AACC,CAAA"}
@@ -34,7 +34,7 @@ function s({ page: s, pageSize: c, itemCount: l, hasMore: u, onPageChange: d, cl
34
34
  onClick: () => d(s - 1),
35
35
  disabled: s === 0,
36
36
  "aria-label": "Previous page",
37
- children: [/* @__PURE__ */ r(t, { className: "mr-1 h-4 w-4" }), " Previous"]
37
+ children: [/* @__PURE__ */ r(t, { className: "me-1 h-4 w-4" }), " Previous"]
38
38
  }),
39
39
  m === void 0 ? /* @__PURE__ */ i("span", {
40
40
  className: "min-w-[4.5rem] text-center text-sm text-text-secondary tabular-nums",
@@ -60,7 +60,7 @@ function s({ page: s, pageSize: c, itemCount: l, hasMore: u, onPageChange: d, cl
60
60
  onClick: () => d(s + 1),
61
61
  disabled: m === void 0 ? !u : s >= m - 1,
62
62
  "aria-label": "Next page",
63
- children: ["Next ", /* @__PURE__ */ r(n, { className: "ml-1 h-4 w-4" })]
63
+ children: ["Next ", /* @__PURE__ */ r(n, { className: "ms-1 h-4 w-4" })]
64
64
  })
65
65
  ]
66
66
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.js","names":["pageWindow","total","i","sorted","current","p","a","b","out","prev","Pagination","totalPages","totalCount","pageSize","page","hasMore","from","itemCount","to","showing","cn","className","Button","onPageChange","ChevronLeft","entry","index","ChevronRight"],"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 * Total item count. When provided, the control renders numbered page buttons\n * (with ellipsis) like the mockups instead of the compact Prev/Next window.\n */\n totalCount?: number;\n}\n\n/** Build a compact page-number window with ellipsis markers. */\nfunction pageWindow(current: number, total: number): (number | 'ellipsis')[] {\n if (total <= 7) return Array.from({ length: total }, (_, i) => i);\n const pages = new Set<number>([0, total - 1, current, current - 1, current + 1]);\n const sorted = [...pages].filter((p) => p >= 0 && p < total).sort((a, b) => a - b);\n const out: (number | 'ellipsis')[] = [];\n let prev = -1;\n for (const p of sorted) {\n if (prev !== -1 && p - prev > 1) out.push('ellipsis');\n out.push(p);\n prev = p;\n }\n return out;\n}\n\nexport function Pagination({\n page,\n pageSize,\n itemCount,\n hasMore,\n onPageChange,\n className,\n totalCount,\n}: PaginationProps) {\n const totalPages =\n typeof totalCount === 'number' ? Math.max(1, Math.ceil(totalCount / pageSize)) : undefined;\n\n if (page === 0 && !hasMore && (totalPages === undefined || totalPages <= 1)) return null;\n\n const from = itemCount === 0 ? 0 : page * pageSize + 1;\n const to = page * pageSize + itemCount;\n const showing =\n typeof totalCount === 'number'\n ? `Showing ${from}–${to} of ${totalCount}`\n : `Showing ${from}–${to}`;\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}\n </p>\n <div className=\"flex items-center gap-1.5\">\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\n {totalPages !== undefined ? (\n <div className=\"flex items-center gap-1\">\n {pageWindow(page, totalPages).map((entry, index) =>\n entry === 'ellipsis' ? (\n <span\n key={`gap-${index}`}\n className=\"px-1.5 text-sm text-text-muted\"\n aria-hidden=\"true\"\n >\n …\n </span>\n ) : (\n <button\n key={entry}\n type=\"button\"\n onClick={() => onPageChange(entry)}\n aria-label={`Page ${entry + 1}`}\n aria-current={entry === page ? 'page' : undefined}\n className={cn(\n 'inline-flex size-8 items-center justify-center rounded-lg text-sm font-medium tabular-nums transition-colors',\n entry === page\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'text-text-secondary hover:bg-bg-sunken hover:text-text-primary'\n )}\n >\n {entry + 1}\n </button>\n )\n )}\n </div>\n ) : (\n <span className=\"min-w-[4.5rem] text-center text-sm text-text-secondary tabular-nums\">\n Page {page + 1}\n </span>\n )}\n\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => onPageChange(page + 1)}\n disabled={totalPages !== undefined ? page >= totalPages - 1 : !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":";;;;;AAwBA,SAASA,EAAW,GAAiB,GAAwC;CAC3E,IAAIC,KAAS,GAAG,OAAO,MAAM,KAAK,EAAE,QAAQA,EAAM,IAAI,GAAG,MAAMC,CAAC;CAEhE,IAAMC,IAAS,CAAC,mBAAG,IADD,IAAY;EAAC;EAAGF,IAAQ;EAAGG;EAASA,IAAU;EAAGA,IAAU;CAAC,CAC3D,CAAK,CAAC,CAAC,QAAQ,MAAMC,KAAK,KAAKA,IAAIJ,CAAK,CAAC,CAAC,MAAM,GAAG,MAAMK,IAAIC,CAAC,GAC3EC,IAA+B,CAAC,GAClCC,IAAO;CACX,KAAK,IAAMJ,KAAKF,GAGd,AAFIM,MAAS,MAAMJ,IAAII,IAAO,KAAGD,EAAI,KAAK,UAAU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A;MACxC,WAAWM,EACT,gHACAK,MAAUX,IACN,kDACA,gEACN;MAEC,UAAAW,IAAQ;KACH,GAbDA,CAaC,CAEZ;IACG,CAAA;IAOP,kBAACH,GAAD;KACE,SAAQ;KACR,MAAK;KACL,eAAeC,EAAaT,IAAO,CAAC;KACpC,UAAUH,MAAe,KAAA,IAAqC,CAACI,IAA1BD,KAAQH,IAAa;KAC1D,cAAW;KALb,UAAA,CAMC,SACM,kBAACgB,GAAD,EAAc,WAAU,eAAgB,CAAA,CACvC;;GACL;EACF,CAAA,CAAA;;AAET"}
1
+ {"version":3,"file":"Pagination.js","names":["pageWindow","total","i","sorted","current","p","a","b","out","prev","Pagination","totalPages","totalCount","pageSize","page","hasMore","from","itemCount","to","showing","cn","className","Button","onPageChange","ChevronLeft","entry","index","ChevronRight"],"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 * Total item count. When provided, the control renders numbered page buttons\n * (with ellipsis) like the mockups instead of the compact Prev/Next window.\n */\n totalCount?: number;\n}\n\n/** Build a compact page-number window with ellipsis markers. */\nfunction pageWindow(current: number, total: number): (number | 'ellipsis')[] {\n if (total <= 7) return Array.from({ length: total }, (_, i) => i);\n const pages = new Set<number>([0, total - 1, current, current - 1, current + 1]);\n const sorted = [...pages].filter((p) => p >= 0 && p < total).sort((a, b) => a - b);\n const out: (number | 'ellipsis')[] = [];\n let prev = -1;\n for (const p of sorted) {\n if (prev !== -1 && p - prev > 1) out.push('ellipsis');\n out.push(p);\n prev = p;\n }\n return out;\n}\n\nexport function Pagination({\n page,\n pageSize,\n itemCount,\n hasMore,\n onPageChange,\n className,\n totalCount,\n}: PaginationProps) {\n const totalPages =\n typeof totalCount === 'number' ? Math.max(1, Math.ceil(totalCount / pageSize)) : undefined;\n\n if (page === 0 && !hasMore && (totalPages === undefined || totalPages <= 1)) return null;\n\n const from = itemCount === 0 ? 0 : page * pageSize + 1;\n const to = page * pageSize + itemCount;\n const showing =\n typeof totalCount === 'number'\n ? `Showing ${from}–${to} of ${totalCount}`\n : `Showing ${from}–${to}`;\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}\n </p>\n <div className=\"flex items-center gap-1.5\">\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=\"me-1 h-4 w-4\" /> Previous\n </Button>\n\n {totalPages !== undefined ? (\n <div className=\"flex items-center gap-1\">\n {pageWindow(page, totalPages).map((entry, index) =>\n entry === 'ellipsis' ? (\n <span\n key={`gap-${index}`}\n className=\"px-1.5 text-sm text-text-muted\"\n aria-hidden=\"true\"\n >\n …\n </span>\n ) : (\n <button\n key={entry}\n type=\"button\"\n onClick={() => onPageChange(entry)}\n aria-label={`Page ${entry + 1}`}\n aria-current={entry === page ? 'page' : undefined}\n className={cn(\n 'inline-flex size-8 items-center justify-center rounded-lg text-sm font-medium tabular-nums transition-colors',\n entry === page\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'text-text-secondary hover:bg-bg-sunken hover:text-text-primary'\n )}\n >\n {entry + 1}\n </button>\n )\n )}\n </div>\n ) : (\n <span className=\"min-w-[4.5rem] text-center text-sm text-text-secondary tabular-nums\">\n Page {page + 1}\n </span>\n )}\n\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => onPageChange(page + 1)}\n disabled={totalPages !== undefined ? page >= totalPages - 1 : !hasMore}\n aria-label=\"Next page\"\n >\n Next <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ACR,MAAK;KACL,eAAeC,EAAaT,IAAO,CAAC;KACpC,UAAUA,MAAS;KACnB,cAAW;KALb,UAAA,CAOE,kBAACU,GAAD,EAAa,WAAU,eAAgB,CAAA,GAAC,WAClC;;IAEPb,MAAe,KAAA,IA+Bd,kBAAC,QAAD;KAAM,WAAU;KAAhB,UAAA,CAAsF,SAC9EG,IAAO,CACT;I,KAhCN,kBAAC,OAAD;KAAK,WAAU;KACZ,UAAAd,EAAWc,GAAMH,CAAU,CAAC,CAAC,KAAK,GAAO,MACxCc,MAAU,aACR,kBAAC,QAAD;MAEE,WAAU;MACV,eAAY;MACb,UAAA;KAEK,GALC,OAAOC,GAKR,IAEN,kBAAC,UAAD;MAEE,MAAK;MACL,eAAeH,EAAaE,CAAK;MACjC,cAAY,QAAQA,IAAQ;MAC5B,gBAAcA,MAAUX,IAAO,SAAS,KAAA;MACxC,WAAWM,EACT,gHACAK,MAAUX,IACN,kDACA,gEACN;MAEC,UAAAW,IAAQ;KACH,GAbDA,CAaC,CAEZ;IACG,CAAA;IAOP,kBAACH,GAAD;KACE,SAAQ;KACR,MAAK;KACL,eAAeC,EAAaT,IAAO,CAAC;KACpC,UAAUH,MAAe,KAAA,IAAqC,CAACI,IAA1BD,KAAQH,IAAa;KAC1D,cAAW;KALb,UAAA,CAMC,SACM,kBAACgB,GAAD,EAAc,WAAU,eAAgB,CAAA,CACvC;;GACL;EACF,CAAA,CAAA;;AAET"}
@@ -35,10 +35,10 @@ var a = {
35
35
  compact: c
36
36
  }), !p && /* @__PURE__ */ n("span", {
37
37
  "aria-hidden": "true",
38
- className: e(f ? "bg-action-primary-bg" : "bg-border-seam", c ? "h-0.5 w-full flex-1" : "absolute left-4 top-8 h-[calc(100%-2rem)] w-0.5 -translate-x-1/2 sm:static sm:left-auto sm:top-auto sm:h-0.5 sm:w-full sm:flex-1 sm:translate-x-0")
38
+ className: e(f ? "bg-action-primary-bg" : "bg-border-seam", c ? "h-0.5 w-full flex-1" : "absolute start-4 top-8 h-[calc(100%-2rem)] w-0.5 -translate-x-1/2 rtl:translate-x-1/2 sm:static sm:start-auto sm:top-auto sm:h-0.5 sm:w-full sm:flex-1 sm:translate-x-0 sm:rtl:translate-x-0")
39
39
  })]
40
40
  }), /* @__PURE__ */ r("div", {
41
- className: e("min-w-0", c ? "pr-2" : "pt-0.5 sm:pt-2 sm:pr-4"),
41
+ className: e("min-w-0", c ? "pe-2" : "pt-0.5 sm:pt-2 sm:pe-4"),
42
42
  children: [/* @__PURE__ */ n("p", {
43
43
  className: e(c ? "text-[0.7rem] leading-tight" : "truncate text-sm", o[d]),
44
44
  children: l.label
@@ -1 +1 @@
1
- {"version":3,"file":"StatusStepper.js","names":["stateOf","step","index","current","nodeClass","labelClass","StepNode","cn","compact","state","Check","StatusStepper","steps","className","connectorDone","isLast"],"sources":["../../../src/govcitizenhub/components/StatusStepper.tsx"],"sourcesContent":["/**\n * StatusStepper\n * @module govcitizenhub/components\n *\n * A horizontal (desktop) / vertical-collapse (mobile) status timeline for\n * citizen application tracking and service lifecycles. Steps before `current`\n * render completed (blue check), the `current` step is highlighted with a ring,\n * and later steps are muted. A step may also be forced into an `alert` state\n * (e.g. \"Action needed\") via its own `state` field.\n */\n\nimport type { FC } from 'react';\nimport { Check } from 'lucide-react';\nimport { cn } from '../utils/cn';\n\nexport interface StepperStep {\n /** Stable key. */\n key: string;\n /** Step title (e.g. \"Documents verified\"). */\n label: string;\n /** Optional caption under the label (e.g. a date or \"Pending\"). */\n caption?: string;\n /** Force a state instead of deriving from position (e.g. 'alert' for action needed). */\n state?: 'completed' | 'current' | 'upcoming' | 'alert';\n}\n\ntype StepState = NonNullable<StepperStep['state']>;\n\nexport interface StatusStepperProps {\n steps: StepperStep[];\n /** Zero-based index of the active step. Earlier = completed, later = upcoming. */\n current: number;\n /**\n * Card-sized rail: stays horizontal at every width with smaller nodes and\n * wrapping labels. Used by the citizen request tracker, where one stepper sits\n * inside each request card and the vertical mobile layout would be four rows\n * tall per request.\n */\n compact?: boolean;\n className?: string;\n}\n\nfunction stateOf(step: StepperStep, index: number, current: number): StepState {\n if (step.state) return step.state;\n if (index < current) return 'completed';\n if (index === current) return 'current';\n return 'upcoming';\n}\n\nconst nodeClass: Record<StepState, string> = {\n completed: 'bg-action-primary-bg text-action-primary-text border-transparent',\n current:\n 'bg-bg-surface text-action-primary-text border-action-primary-bg ring-4 ring-[color-mix(in_oklab,var(--color-action-primary-bg)_22%,transparent)]',\n alert: 'bg-status-warning-bg-subtle text-status-warning-text border-status-warning-text',\n upcoming: 'bg-bg-surface text-text-muted border-border-seam',\n};\n\nconst labelClass: Record<StepState, string> = {\n completed: 'text-text-primary',\n current: 'text-text-primary font-semibold',\n alert: 'text-status-warning-text font-semibold',\n upcoming: 'text-text-muted',\n};\n\nconst StepNode: FC<{ state: StepState; index: number; compact: boolean }> = ({\n state,\n index,\n compact,\n}) => (\n <span\n aria-hidden=\"true\"\n className={cn(\n 'relative z-10 inline-flex shrink-0 items-center justify-center rounded-full border-2 font-semibold tabular-nums transition-colors',\n compact ? 'size-6 text-[0.6rem]' : 'size-8 text-xs',\n nodeClass[state]\n )}\n >\n {state === 'completed' ? <Check className={compact ? 'size-3' : 'size-4'} /> : index + 1}\n </span>\n);\n\n/** Horizontal-on-desktop, vertical-on-mobile status timeline. */\nexport const StatusStepper: FC<StatusStepperProps> = ({\n steps,\n current,\n compact = false,\n className,\n}) => {\n if (steps.length === 0) return null;\n\n return (\n <ol\n className={cn(compact ? 'flex flex-row' : 'flex flex-col sm:flex-row', className)}\n aria-label=\"Progress\"\n >\n {steps.map((step, index) => {\n const state = stateOf(step, index, current);\n const connectorDone = index < current;\n const isLast = index === steps.length - 1;\n return (\n <li\n key={step.key}\n className={cn(\n 'relative flex flex-1',\n compact ? 'flex-col gap-1.5' : 'gap-3 pb-6 last:pb-0 sm:flex-col sm:gap-2 sm:pb-0'\n )}\n aria-current={state === 'current' ? 'step' : undefined}\n >\n {/* Node + connector rail */}\n <div\n className={cn(\n 'flex items-center',\n compact ? 'w-full flex-row' : 'flex-col sm:w-full sm:flex-row'\n )}\n >\n <StepNode state={state} index={index} compact={compact} />\n {!isLast && (\n <span\n aria-hidden=\"true\"\n className={cn(\n connectorDone ? 'bg-action-primary-bg' : 'bg-border-seam',\n // Compact is always a horizontal rail; the default stepper\n // switches from a vertical rail (mobile) to a horizontal one.\n compact\n ? 'h-0.5 w-full flex-1'\n : 'absolute left-4 top-8 h-[calc(100%-2rem)] w-0.5 -translate-x-1/2 sm:static sm:left-auto sm:top-auto sm:h-0.5 sm:w-full sm:flex-1 sm:translate-x-0'\n )}\n />\n )}\n </div>\n {/* Text */}\n <div className={cn('min-w-0', compact ? 'pr-2' : 'pt-0.5 sm:pt-2 sm:pr-4')}>\n <p\n className={cn(\n compact ? 'text-[0.7rem] leading-tight' : 'truncate text-sm',\n labelClass[state]\n )}\n >\n {step.label}\n </p>\n {step.caption && (\n <p\n className={cn(\n 'mt-0.5 text-text-muted',\n compact ? 'text-[0.65rem] leading-tight' : 'truncate text-xs'\n )}\n >\n {step.caption}\n </p>\n )}\n </div>\n </li>\n );\n })}\n </ol>\n );\n};\n"],"mappings":";;;;AA0CA,SAASA,EAAQ,GAAmB,GAAe,GAA4B;CAI7E,OAHIC,EAAK,QAAcA,EAAK,QACxBC,IAAQC,IAAgB,cACxBD,MAAUC,IAAgB,YACvB;AACT;AAEA,IAAMC,IAAuC;CAC3C,WAAW;CACX,SACE;CACF,OAAO;CACP,UAAU;AACZ,GAEMC,IAAwC;CAC5C,WAAW;CACX,SAAS;CACT,OAAO;CACP,UAAU;AACZ,GAEMC,KAAuE,EAC3E,UACA,UACA,iBAEA,kBAAC,QAAD;CACE,eAAY;CACZ,WAAWC,EACT,qIACAC,IAAU,yBAAyB,kBACnCJ,EAAUK,EACZ;CAEC,UAAAA,MAAU,cAAc,kBAACC,GAAD,EAAO,WAAWF,IAAU,WAAW,SAAW,CAAA,IAAIN,IAAQ;AACnF,CAAA,GAIKS,KAAyC,EACpD,UACA,YACA,aAAU,IACV,mBAEIC,EAAM,WAAW,IAAU,OAG7B,kBAAC,MAAD;CACE,WAAWL,EAAGC,IAAU,kBAAkB,6BAA6BK,CAAS;CAChF,cAAW;CAEV,UAAAD,EAAM,KAAK,GAAM,MAAU;EAC1B,IAAMH,IAAQT,EAAQC,GAAMC,GAAOC,CAAO,GACpCW,IAAgBZ,IAAQC,GACxBY,IAASb,MAAUU,EAAM,SAAS;EACxC,OACE,kBAAC,MAAD;GAEE,WAAWL,EACT,wBACAC,IAAU,qBAAqB,mDACjC;GACA,gBAAcC,MAAU,YAAY,SAAS,KAAA;GAN/C,UAAA,CASE,kBAAC,OAAD;IACE,WAAWF,EACT,qBACAC,IAAU,oBAAoB,gCAChC;IAJF,UAAA,CAME,kBAACF,GAAD;KAAiB;KAAc;KAAgB;IAAU,CAAA,GACxD,CAACS,KACA,kBAAC,QAAD;KACE,eAAY;KACZ,WAAWR,EACTO,IAAgB,yBAAyB,kBAGzCN,IACI,wBACA,mJACN;IACD,CAAA,CAEA;GAEL,CAAA,GAAA,kBAAC,OAAD;IAAK,WAAWD,EAAG,WAAWC,IAAU,SAAS,wBAAwB;IAAzE,UAAA,CACE,kBAAC,KAAD;KACE,WAAWD,EACTC,IAAU,gCAAgC,oBAC1CH,EAAWI,EACb;KAEC,UAAAR,EAAK;IACL,CAAA,GACFA,EAAK,WACJ,kBAAC,KAAD;KACE,WAAWM,EACT,0BACAC,IAAU,iCAAiC,kBAC7C;KAEC,UAAAP,EAAK;IACL,CAAA,CAEF;GACH,CAAA,CAAA;EAlDG,GAAAA,EAAK,GAkDR;CAER,CAAC;AACC,CAAA"}
1
+ {"version":3,"file":"StatusStepper.js","names":["stateOf","step","index","current","nodeClass","labelClass","StepNode","cn","compact","state","Check","StatusStepper","steps","className","connectorDone","isLast"],"sources":["../../../src/govcitizenhub/components/StatusStepper.tsx"],"sourcesContent":["/**\n * StatusStepper\n * @module govcitizenhub/components\n *\n * A horizontal (desktop) / vertical-collapse (mobile) status timeline for\n * citizen application tracking and service lifecycles. Steps before `current`\n * render completed (blue check), the `current` step is highlighted with a ring,\n * and later steps are muted. A step may also be forced into an `alert` state\n * (e.g. \"Action needed\") via its own `state` field.\n */\n\nimport type { FC } from 'react';\nimport { Check } from 'lucide-react';\nimport { cn } from '../utils/cn';\n\nexport interface StepperStep {\n /** Stable key. */\n key: string;\n /** Step title (e.g. \"Documents verified\"). */\n label: string;\n /** Optional caption under the label (e.g. a date or \"Pending\"). */\n caption?: string;\n /** Force a state instead of deriving from position (e.g. 'alert' for action needed). */\n state?: 'completed' | 'current' | 'upcoming' | 'alert';\n}\n\ntype StepState = NonNullable<StepperStep['state']>;\n\nexport interface StatusStepperProps {\n steps: StepperStep[];\n /** Zero-based index of the active step. Earlier = completed, later = upcoming. */\n current: number;\n /**\n * Card-sized rail: stays horizontal at every width with smaller nodes and\n * wrapping labels. Used by the citizen request tracker, where one stepper sits\n * inside each request card and the vertical mobile layout would be four rows\n * tall per request.\n */\n compact?: boolean;\n className?: string;\n}\n\nfunction stateOf(step: StepperStep, index: number, current: number): StepState {\n if (step.state) return step.state;\n if (index < current) return 'completed';\n if (index === current) return 'current';\n return 'upcoming';\n}\n\nconst nodeClass: Record<StepState, string> = {\n completed: 'bg-action-primary-bg text-action-primary-text border-transparent',\n current:\n 'bg-bg-surface text-action-primary-text border-action-primary-bg ring-4 ring-[color-mix(in_oklab,var(--color-action-primary-bg)_22%,transparent)]',\n alert: 'bg-status-warning-bg-subtle text-status-warning-text border-status-warning-text',\n upcoming: 'bg-bg-surface text-text-muted border-border-seam',\n};\n\nconst labelClass: Record<StepState, string> = {\n completed: 'text-text-primary',\n current: 'text-text-primary font-semibold',\n alert: 'text-status-warning-text font-semibold',\n upcoming: 'text-text-muted',\n};\n\nconst StepNode: FC<{ state: StepState; index: number; compact: boolean }> = ({\n state,\n index,\n compact,\n}) => (\n <span\n aria-hidden=\"true\"\n className={cn(\n 'relative z-10 inline-flex shrink-0 items-center justify-center rounded-full border-2 font-semibold tabular-nums transition-colors',\n compact ? 'size-6 text-[0.6rem]' : 'size-8 text-xs',\n nodeClass[state]\n )}\n >\n {state === 'completed' ? <Check className={compact ? 'size-3' : 'size-4'} /> : index + 1}\n </span>\n);\n\n/** Horizontal-on-desktop, vertical-on-mobile status timeline. */\nexport const StatusStepper: FC<StatusStepperProps> = ({\n steps,\n current,\n compact = false,\n className,\n}) => {\n if (steps.length === 0) return null;\n\n return (\n <ol\n className={cn(compact ? 'flex flex-row' : 'flex flex-col sm:flex-row', className)}\n aria-label=\"Progress\"\n >\n {steps.map((step, index) => {\n const state = stateOf(step, index, current);\n const connectorDone = index < current;\n const isLast = index === steps.length - 1;\n return (\n <li\n key={step.key}\n className={cn(\n 'relative flex flex-1',\n compact ? 'flex-col gap-1.5' : 'gap-3 pb-6 last:pb-0 sm:flex-col sm:gap-2 sm:pb-0'\n )}\n aria-current={state === 'current' ? 'step' : undefined}\n >\n {/* Node + connector rail */}\n <div\n className={cn(\n 'flex items-center',\n compact ? 'w-full flex-row' : 'flex-col sm:w-full sm:flex-row'\n )}\n >\n <StepNode state={state} index={index} compact={compact} />\n {!isLast && (\n <span\n aria-hidden=\"true\"\n className={cn(\n connectorDone ? 'bg-action-primary-bg' : 'bg-border-seam',\n // Compact is always a horizontal rail; the default stepper\n // switches from a vertical rail (mobile) to a horizontal one.\n compact\n ? 'h-0.5 w-full flex-1'\n : 'absolute start-4 top-8 h-[calc(100%-2rem)] w-0.5 -translate-x-1/2 rtl:translate-x-1/2 sm:static sm:start-auto sm:top-auto sm:h-0.5 sm:w-full sm:flex-1 sm:translate-x-0 sm:rtl:translate-x-0'\n )}\n />\n )}\n </div>\n {/* Text */}\n <div className={cn('min-w-0', compact ? 'pe-2' : 'pt-0.5 sm:pt-2 sm:pe-4')}>\n <p\n className={cn(\n compact ? 'text-[0.7rem] leading-tight' : 'truncate text-sm',\n labelClass[state]\n )}\n >\n {step.label}\n </p>\n {step.caption && (\n <p\n className={cn(\n 'mt-0.5 text-text-muted',\n compact ? 'text-[0.65rem] leading-tight' : 'truncate text-xs'\n )}\n >\n {step.caption}\n </p>\n )}\n </div>\n </li>\n );\n })}\n </ol>\n );\n};\n"],"mappings":";;;;AA0CA,SAASA,EAAQ,GAAmB,GAAe,GAA4B;CAI7E,OAHIC,EAAK,QAAcA,EAAK,QACxBC,IAAQC,IAAgB,cACxBD,MAAUC,IAAgB,YACvB;AACT;AAEA,IAAMC,IAAuC;CAC3C,WAAW;CACX,SACE;CACF,OAAO;CACP,UAAU;AACZ,GAEMC,IAAwC;CAC5C,WAAW;CACX,SAAS;CACT,OAAO;CACP,UAAU;AACZ,GAEMC,KAAuE,EAC3E,UACA,UACA,iBAEA,kBAAC,QAAD;CACE,eAAY;CACZ,WAAWC,EACT,qIACAC,IAAU,yBAAyB,kBACnCJ,EAAUK,EACZ;CAEC,UAAAA,MAAU,cAAc,kBAACC,GAAD,EAAO,WAAWF,IAAU,WAAW,SAAW,CAAA,IAAIN,IAAQ;AACnF,CAAA,GAIKS,KAAyC,EACpD,UACA,YACA,aAAU,IACV,mBAEIC,EAAM,WAAW,IAAU,OAG7B,kBAAC,MAAD;CACE,WAAWL,EAAGC,IAAU,kBAAkB,6BAA6BK,CAAS;CAChF,cAAW;CAEV,UAAAD,EAAM,KAAK,GAAM,MAAU;EAC1B,IAAMH,IAAQT,EAAQC,GAAMC,GAAOC,CAAO,GACpCW,IAAgBZ,IAAQC,GACxBY,IAASb,MAAUU,EAAM,SAAS;EACxC,OACE,kBAAC,MAAD;GAEE,WAAWL,EACT,wBACAC,IAAU,qBAAqB,mDACjC;GACA,gBAAcC,MAAU,YAAY,SAAS,KAAA;GAN/C,UAAA,CASE,kBAAC,OAAD;IACE,WAAWF,EACT,qBACAC,IAAU,oBAAoB,gCAChC;IAJF,UAAA,CAME,kBAACF,GAAD;KAAiB;KAAc;KAAgB;IAAU,CAAA,GACxD,CAACS,KACA,kBAAC,QAAD;KACE,eAAY;KACZ,WAAWR,EACTO,IAAgB,yBAAyB,kBAGzCN,IACI,wBACA,8LACN;IACD,CAAA,CAEA;GAEL,CAAA,GAAA,kBAAC,OAAD;IAAK,WAAWD,EAAG,WAAWC,IAAU,SAAS,wBAAwB;IAAzE,UAAA,CACE,kBAAC,KAAD;KACE,WAAWD,EACTC,IAAU,gCAAgC,oBAC1CH,EAAWI,EACb;KAEC,UAAAR,EAAK;IACL,CAAA,GACFA,EAAK,WACJ,kBAAC,KAAD;KACE,WAAWM,EACT,0BACAC,IAAU,iCAAiC,kBAC7C;KAEC,UAAAP,EAAK;IACL,CAAA,CAEF;GACH,CAAA,CAAA;EAlDG,GAAAA,EAAK,GAkDR;CAER,CAAC;AACC,CAAA"}
@@ -29,7 +29,7 @@ var i = {
29
29
  }), /* @__PURE__ */ n("p", {
30
30
  className: e("text-xl font-bold tabular-nums", i[o]),
31
31
  children: [r.value, r.hint && /* @__PURE__ */ t("span", {
32
- className: "ml-1.5 text-sm font-medium text-text-muted",
32
+ className: "ms-1.5 text-sm font-medium text-text-muted",
33
33
  children: r.hint
34
34
  })]
35
35
  })]
@@ -39,7 +39,7 @@ var i = {
39
39
  let s = /* @__PURE__ */ t("div", {
40
40
  className: e("flex flex-col divide-y divide-border-seam sm:flex-row sm:items-center sm:divide-x sm:divide-y-0", i ? "" : "gap-4 divide-none sm:gap-8", a),
41
41
  children: n.map((n, r) => /* @__PURE__ */ t("div", {
42
- className: e("flex-1", i && "px-5 py-4 first:pl-5 sm:px-6"),
42
+ className: e("flex-1", i && "px-5 py-4 first:ps-5 sm:px-6"),
43
43
  children: /* @__PURE__ */ t(o, { stat: n })
44
44
  }, r))
45
45
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SummaryStrip.js","names":["valueToneClass","iconToneClass","StatItem","tone","stat","cn","SummaryStrip","body","card","className","stats","index","GlassCard"],"sources":["../../../src/govcitizenhub/components/SummaryStrip.tsx"],"sourcesContent":["/**\n * SummaryStrip\n * @module govcitizenhub/components\n *\n * A compact inline stat strip for summary rows above tables and ledgers —\n * e.g. \"Collected ₹1,24,850 · Pending ₹3,150\" or \"On track 82% · Overdue 7%\".\n * Each stat can carry an icon and a tone; stats are separated by hairline rules.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\nexport type SummaryTone = 'default' | 'success' | 'warning' | 'error' | 'accent';\n\nconst valueToneClass: Record<SummaryTone, string> = {\n default: 'text-text-primary',\n success: 'text-status-success-text',\n warning: 'text-status-warning-text',\n error: 'text-status-error-text',\n accent: 'text-action-primary-text',\n};\n\nconst iconToneClass: Record<SummaryTone, string> = {\n default: 'bg-bg-sunken text-text-secondary',\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n error: 'bg-status-error-bg-subtle text-status-error-text',\n accent: 'bg-[var(--color-accent-soft)] text-action-primary-text',\n};\n\nexport interface SummaryStat {\n label: ReactNode;\n value: ReactNode;\n /** Optional secondary line under the value (e.g. a count \"(105)\"). */\n hint?: ReactNode;\n icon?: ReactNode;\n tone?: SummaryTone;\n}\n\nexport interface SummaryStripProps {\n stats: SummaryStat[];\n /** Render inside a GlassCard shell (default). Set false for a bare inline strip. */\n card?: boolean;\n className?: string;\n}\n\nconst StatItem: FC<{ stat: SummaryStat }> = ({ stat }) => {\n const tone = stat.tone ?? 'default';\n return (\n <div className=\"flex min-w-0 items-center gap-3\">\n {stat.icon && (\n <span\n className={cn(\n 'inline-flex size-10 shrink-0 items-center justify-center rounded-full [&>svg]:size-5',\n iconToneClass[tone]\n )}\n >\n {stat.icon}\n </span>\n )}\n <div className=\"min-w-0\">\n <p className=\"truncate text-sm text-text-muted\">{stat.label}</p>\n <p className={cn('text-xl font-bold tabular-nums', valueToneClass[tone])}>\n {stat.value}\n {stat.hint && (\n <span className=\"ml-1.5 text-sm font-medium text-text-muted\">{stat.hint}</span>\n )}\n </p>\n </div>\n </div>\n );\n};\n\n/** Compact inline stat strip for summary rows above tables/ledgers. */\nexport const SummaryStrip: FC<SummaryStripProps> = ({ stats, card = true, className }) => {\n const body = (\n <div\n className={cn(\n 'flex flex-col divide-y divide-border-seam sm:flex-row sm:items-center sm:divide-x sm:divide-y-0',\n card ? '' : 'gap-4 divide-none sm:gap-8',\n className\n )}\n >\n {stats.map((stat, index) => (\n <div key={index} className={cn('flex-1', card && 'px-5 py-4 first:pl-5 sm:px-6')}>\n <StatItem stat={stat} />\n </div>\n ))}\n </div>\n );\n\n if (!card) return body;\n return <GlassCard treatment=\"plain\">{body}</GlassCard>;\n};\n"],"mappings":";;;;AAeA,IAAMA,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;AACV,GAEMC,IAA6C;CACjD,SAAS;CACT,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;AACV,GAkBMC,KAAuC,EAAE,cAAW;CACxD,IAAMC,IAAOC,EAAK,QAAQ;CAC1B,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACGA,EAAK,QACJ,kBAAC,QAAD;GACE,WAAWC,EACT,wFACAJ,EAAcE,EAChB;GAEC,UAAAC,EAAK;EACF,CAAA,GAER,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,KAAD;IAAG,WAAU;IAAoC,UAAAA,EAAK;GAAS,CAAA,GAC/D,kBAAC,KAAD;IAAG,WAAWC,EAAG,kCAAkCL,EAAeG,EAAK;IAAvE,UAAA,CACGC,EAAK,OACLA,EAAK,QACJ,kBAAC,QAAD;KAAM,WAAU;KAA8C,UAAAA,EAAK;IAAW,CAAA,CAE/E;GACA,CAAA,CAAA;EACF,CAAA,CAAA;;AAET,GAGaE,KAAuC,EAAE,UAAO,UAAO,IAAM,mBAAgB;CACxF,IAAMC,IACJ,kBAAC,OAAD;EACE,WAAWF,EACT,mGACAG,IAAO,KAAK,8BACZC,CACF;EAEC,UAAAC,EAAM,KAAK,GAAM,MAChB,kBAAC,OAAD;GAAiB,WAAWL,EAAG,UAAUG,KAAQ,8BAA8B;GAC7E,UAAA,kBAACN,GAAD,EAAgB,QAAO,CAAA;EACpB,GAFKS,CAEL,CACN;CACE,CAAA;CAIP,OADKH,IACE,kBAACI,GAAD;EAAW,WAAU;EAAS,UAAAL;CAAgB,CAAA,IADnCA;AAEpB"}
1
+ {"version":3,"file":"SummaryStrip.js","names":["valueToneClass","iconToneClass","StatItem","tone","stat","cn","SummaryStrip","body","card","className","stats","index","GlassCard"],"sources":["../../../src/govcitizenhub/components/SummaryStrip.tsx"],"sourcesContent":["/**\n * SummaryStrip\n * @module govcitizenhub/components\n *\n * A compact inline stat strip for summary rows above tables and ledgers —\n * e.g. \"Collected ₹1,24,850 · Pending ₹3,150\" or \"On track 82% · Overdue 7%\".\n * Each stat can carry an icon and a tone; stats are separated by hairline rules.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\nexport type SummaryTone = 'default' | 'success' | 'warning' | 'error' | 'accent';\n\nconst valueToneClass: Record<SummaryTone, string> = {\n default: 'text-text-primary',\n success: 'text-status-success-text',\n warning: 'text-status-warning-text',\n error: 'text-status-error-text',\n accent: 'text-action-primary-text',\n};\n\nconst iconToneClass: Record<SummaryTone, string> = {\n default: 'bg-bg-sunken text-text-secondary',\n success: 'bg-status-success-bg-subtle text-status-success-text',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text',\n error: 'bg-status-error-bg-subtle text-status-error-text',\n accent: 'bg-[var(--color-accent-soft)] text-action-primary-text',\n};\n\nexport interface SummaryStat {\n label: ReactNode;\n value: ReactNode;\n /** Optional secondary line under the value (e.g. a count \"(105)\"). */\n hint?: ReactNode;\n icon?: ReactNode;\n tone?: SummaryTone;\n}\n\nexport interface SummaryStripProps {\n stats: SummaryStat[];\n /** Render inside a GlassCard shell (default). Set false for a bare inline strip. */\n card?: boolean;\n className?: string;\n}\n\nconst StatItem: FC<{ stat: SummaryStat }> = ({ stat }) => {\n const tone = stat.tone ?? 'default';\n return (\n <div className=\"flex min-w-0 items-center gap-3\">\n {stat.icon && (\n <span\n className={cn(\n 'inline-flex size-10 shrink-0 items-center justify-center rounded-full [&>svg]:size-5',\n iconToneClass[tone]\n )}\n >\n {stat.icon}\n </span>\n )}\n <div className=\"min-w-0\">\n <p className=\"truncate text-sm text-text-muted\">{stat.label}</p>\n <p className={cn('text-xl font-bold tabular-nums', valueToneClass[tone])}>\n {stat.value}\n {stat.hint && (\n <span className=\"ms-1.5 text-sm font-medium text-text-muted\">{stat.hint}</span>\n )}\n </p>\n </div>\n </div>\n );\n};\n\n/** Compact inline stat strip for summary rows above tables/ledgers. */\nexport const SummaryStrip: FC<SummaryStripProps> = ({ stats, card = true, className }) => {\n const body = (\n <div\n className={cn(\n 'flex flex-col divide-y divide-border-seam sm:flex-row sm:items-center sm:divide-x sm:divide-y-0',\n card ? '' : 'gap-4 divide-none sm:gap-8',\n className\n )}\n >\n {stats.map((stat, index) => (\n <div key={index} className={cn('flex-1', card && 'px-5 py-4 first:ps-5 sm:px-6')}>\n <StatItem stat={stat} />\n </div>\n ))}\n </div>\n );\n\n if (!card) return body;\n return <GlassCard treatment=\"plain\">{body}</GlassCard>;\n};\n"],"mappings":";;;;AAeA,IAAMA,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;AACV,GAEMC,IAA6C;CACjD,SAAS;CACT,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;AACV,GAkBMC,KAAuC,EAAE,cAAW;CACxD,IAAMC,IAAOC,EAAK,QAAQ;CAC1B,OACE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACGA,EAAK,QACJ,kBAAC,QAAD;GACE,WAAWC,EACT,wFACAJ,EAAcE,EAChB;GAEC,UAAAC,EAAK;EACF,CAAA,GAER,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,KAAD;IAAG,WAAU;IAAoC,UAAAA,EAAK;GAAS,CAAA,GAC/D,kBAAC,KAAD;IAAG,WAAWC,EAAG,kCAAkCL,EAAeG,EAAK;IAAvE,UAAA,CACGC,EAAK,OACLA,EAAK,QACJ,kBAAC,QAAD;KAAM,WAAU;KAA8C,UAAAA,EAAK;IAAW,CAAA,CAE/E;GACA,CAAA,CAAA;EACF,CAAA,CAAA;;AAET,GAGaE,KAAuC,EAAE,UAAO,UAAO,IAAM,mBAAgB;CACxF,IAAMC,IACJ,kBAAC,OAAD;EACE,WAAWF,EACT,mGACAG,IAAO,KAAK,8BACZC,CACF;EAEC,UAAAC,EAAM,KAAK,GAAM,MAChB,kBAAC,OAAD;GAAiB,WAAWL,EAAG,UAAUG,KAAQ,8BAA8B;GAC7E,UAAA,kBAACN,GAAD,EAAgB,QAAO,CAAA;EACpB,GAFKS,CAEL,CACN;CACE,CAAA;CAIP,OADKH,IACE,kBAACI,GAAD;EAAW,WAAU;EAAS,UAAAL;CAAgB,CAAA,IADnCA;AAEpB"}
@@ -20,7 +20,7 @@ var r = {
20
20
  children: [
21
21
  !d && /* @__PURE__ */ t("span", {
22
22
  "aria-hidden": "true",
23
- className: "absolute left-[15px] top-8 h-[calc(100%-1.5rem)] w-px bg-border-seam"
23
+ className: "absolute start-[15px] top-8 h-[calc(100%-1.5rem)] w-px bg-border-seam"
24
24
  }),
25
25
  /* @__PURE__ */ t("span", {
26
26
  "aria-hidden": "true",
@@ -41,7 +41,7 @@ var r = {
41
41
  children: c
42
42
  }),
43
43
  l && /* @__PURE__ */ t("span", {
44
- className: "ml-auto shrink-0 text-xs text-text-muted tabular-nums",
44
+ className: "ms-auto shrink-0 text-xs text-text-muted tabular-nums",
45
45
  children: l
46
46
  })
47
47
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.js","names":["dotClass","titleClass","TimelineItem","cn","className","last","tone","icon","title","author","timestamp","children","Timeline"],"sources":["../../../src/govcitizenhub/components/Timeline.tsx"],"sourcesContent":["/**\n * Timeline + TimelineItem\n * @module govcitizenhub/components\n *\n * A vertical event timeline for case notes, grievance history and audit trails.\n * Each item shows a colour-coded dot (optionally wrapping an icon), an author,\n * a timestamp and a free-form body. Compose items as children of {@link Timeline}\n * so the connecting rail is drawn automatically.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { cn } from '../utils/cn';\n\nexport type TimelineTone = 'default' | 'info' | 'success' | 'warning' | 'error' | 'accent';\n\nconst dotClass: Record<TimelineTone, string> = {\n default: 'bg-bg-sunken text-text-secondary ring-border-seam',\n info: 'bg-[var(--color-accent-soft)] text-action-primary-text ring-transparent',\n success: 'bg-status-success-bg-subtle text-status-success-text ring-transparent',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text ring-transparent',\n error: 'bg-status-error-bg-subtle text-status-error-text ring-transparent',\n accent:\n 'bg-[color-mix(in_oklab,var(--color-accent-purple)_16%,transparent)] text-[var(--color-accent-purple)] ring-transparent',\n};\n\nconst titleClass: Record<TimelineTone, string> = {\n default: 'text-text-primary',\n info: 'text-action-primary-text',\n success: 'text-status-success-text',\n warning: 'text-status-warning-text',\n error: 'text-status-error-text',\n accent: 'text-[var(--color-accent-purple)]',\n};\n\nexport interface TimelineItemProps {\n /** Colour-coded dot tone. */\n tone?: TimelineTone;\n /** Optional icon rendered inside the dot. */\n icon?: ReactNode;\n /** Event title / type label (e.g. \"Info request\", \"Decision\"). */\n title: ReactNode;\n /** Who created the event. */\n author?: ReactNode;\n /** When it happened (already-formatted string or node). */\n timestamp?: ReactNode;\n /** Event body. */\n children?: ReactNode;\n /** Set on the final item to stop the connecting rail. */\n last?: boolean;\n className?: string;\n}\n\n/** A single event row within a {@link Timeline}. */\nexport const TimelineItem: FC<TimelineItemProps> = ({\n tone = 'default',\n icon,\n title,\n author,\n timestamp,\n children,\n last = false,\n className,\n}) => (\n <li className={cn('relative flex gap-3 pb-6 last:pb-0', className)}>\n {/* Rail */}\n {!last && (\n <span\n aria-hidden=\"true\"\n className=\"absolute left-[15px] top-8 h-[calc(100%-1.5rem)] w-px bg-border-seam\"\n />\n )}\n {/* Dot */}\n <span\n aria-hidden=\"true\"\n className={cn(\n 'relative z-10 mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-full ring-1 [&>svg]:size-4',\n dotClass[tone]\n )}\n >\n {icon}\n </span>\n {/* Body */}\n <div className=\"min-w-0 flex-1 pt-0.5\">\n <div className=\"flex flex-wrap items-baseline gap-x-2 gap-y-0.5\">\n <span className={cn('text-sm font-semibold', titleClass[tone])}>{title}</span>\n {author && <span className=\"text-sm text-text-secondary\">{author}</span>}\n {timestamp && (\n <span className=\"ml-auto shrink-0 text-xs text-text-muted tabular-nums\">{timestamp}</span>\n )}\n </div>\n {children && <div className=\"mt-1 text-sm text-text-secondary\">{children}</div>}\n </div>\n </li>\n);\n\nexport interface TimelineProps {\n children: ReactNode;\n className?: string;\n}\n\n/** Vertical timeline wrapper. Render {@link TimelineItem} children inside. */\nexport const Timeline: FC<TimelineProps> = ({ children, className }) => (\n <ol className={cn('flex flex-col', className)}>{children}</ol>\n);\n"],"mappings":";;;AAeA,IAAMA,IAAyC;CAC7C,SAAS;CACT,MAAM;CACN,SAAS;CACT,SAAS;CACT,OAAO;CACP,QACE;AACJ,GAEMC,IAA2C;CAC/C,SAAS;CACT,MAAM;CACN,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;AACV,GAqBaC,KAAuC,EAClD,UAAO,WACP,SACA,UACA,WACA,cACA,aACA,UAAO,IACP,mBAEA,kBAAC,MAAD;CAAI,WAAWC,EAAG,sCAAsCC,CAAS;CAAjE,UAAA;EAEG,CAACC,KACA,kBAAC,QAAD;GACE,eAAY;GACZ,WAAU;EACX,CAAA;EAGH,kBAAC,QAAD;GACE,eAAY;GACZ,WAAWF,EACT,mHACAH,EAASM,EACX;GAEC,UAAAC;EACG,CAAA;EAEN,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,kBAAC,QAAD;MAAM,WAAWJ,EAAG,yBAAyBF,EAAWK,EAAK;MAAI,UAAAE;KAAY,CAAA;KAC5EC,KAAU,kBAAC,QAAD;MAAM,WAAU;MAA+B,UAAAA;KAAa,CAAA;KACtEC,KACC,kBAAC,QAAD;MAAM,WAAU;MAAyD,UAAAA;KAAgB,CAAA;IAExF;GACJ,CAAA,GAAAC,KAAY,kBAAC,OAAD;IAAK,WAAU;IAAoC;GAAc,CAAA,CAC3E;;CACH;A,IASOC,KAA+B,EAAE,aAAU,mBACtD,kBAAC,MAAD;CAAI,WAAWT,EAAG,iBAAiBC,CAAS;CAAI;AAAa,CAAA"}
1
+ {"version":3,"file":"Timeline.js","names":["dotClass","titleClass","TimelineItem","cn","className","last","tone","icon","title","author","timestamp","children","Timeline"],"sources":["../../../src/govcitizenhub/components/Timeline.tsx"],"sourcesContent":["/**\n * Timeline + TimelineItem\n * @module govcitizenhub/components\n *\n * A vertical event timeline for case notes, grievance history and audit trails.\n * Each item shows a colour-coded dot (optionally wrapping an icon), an author,\n * a timestamp and a free-form body. Compose items as children of {@link Timeline}\n * so the connecting rail is drawn automatically.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { cn } from '../utils/cn';\n\nexport type TimelineTone = 'default' | 'info' | 'success' | 'warning' | 'error' | 'accent';\n\nconst dotClass: Record<TimelineTone, string> = {\n default: 'bg-bg-sunken text-text-secondary ring-border-seam',\n info: 'bg-[var(--color-accent-soft)] text-action-primary-text ring-transparent',\n success: 'bg-status-success-bg-subtle text-status-success-text ring-transparent',\n warning: 'bg-status-warning-bg-subtle text-status-warning-text ring-transparent',\n error: 'bg-status-error-bg-subtle text-status-error-text ring-transparent',\n accent:\n 'bg-[color-mix(in_oklab,var(--color-accent-purple)_16%,transparent)] text-[var(--color-accent-purple)] ring-transparent',\n};\n\nconst titleClass: Record<TimelineTone, string> = {\n default: 'text-text-primary',\n info: 'text-action-primary-text',\n success: 'text-status-success-text',\n warning: 'text-status-warning-text',\n error: 'text-status-error-text',\n accent: 'text-[var(--color-accent-purple)]',\n};\n\nexport interface TimelineItemProps {\n /** Colour-coded dot tone. */\n tone?: TimelineTone;\n /** Optional icon rendered inside the dot. */\n icon?: ReactNode;\n /** Event title / type label (e.g. \"Info request\", \"Decision\"). */\n title: ReactNode;\n /** Who created the event. */\n author?: ReactNode;\n /** When it happened (already-formatted string or node). */\n timestamp?: ReactNode;\n /** Event body. */\n children?: ReactNode;\n /** Set on the final item to stop the connecting rail. */\n last?: boolean;\n className?: string;\n}\n\n/** A single event row within a {@link Timeline}. */\nexport const TimelineItem: FC<TimelineItemProps> = ({\n tone = 'default',\n icon,\n title,\n author,\n timestamp,\n children,\n last = false,\n className,\n}) => (\n <li className={cn('relative flex gap-3 pb-6 last:pb-0', className)}>\n {/* Rail */}\n {!last && (\n <span\n aria-hidden=\"true\"\n className=\"absolute start-[15px] top-8 h-[calc(100%-1.5rem)] w-px bg-border-seam\"\n />\n )}\n {/* Dot */}\n <span\n aria-hidden=\"true\"\n className={cn(\n 'relative z-10 mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-full ring-1 [&>svg]:size-4',\n dotClass[tone]\n )}\n >\n {icon}\n </span>\n {/* Body */}\n <div className=\"min-w-0 flex-1 pt-0.5\">\n <div className=\"flex flex-wrap items-baseline gap-x-2 gap-y-0.5\">\n <span className={cn('text-sm font-semibold', titleClass[tone])}>{title}</span>\n {author && <span className=\"text-sm text-text-secondary\">{author}</span>}\n {timestamp && (\n <span className=\"ms-auto shrink-0 text-xs text-text-muted tabular-nums\">{timestamp}</span>\n )}\n </div>\n {children && <div className=\"mt-1 text-sm text-text-secondary\">{children}</div>}\n </div>\n </li>\n);\n\nexport interface TimelineProps {\n children: ReactNode;\n className?: string;\n}\n\n/** Vertical timeline wrapper. Render {@link TimelineItem} children inside. */\nexport const Timeline: FC<TimelineProps> = ({ children, className }) => (\n <ol className={cn('flex flex-col', className)}>{children}</ol>\n);\n"],"mappings":";;;AAeA,IAAMA,IAAyC;CAC7C,SAAS;CACT,MAAM;CACN,SAAS;CACT,SAAS;CACT,OAAO;CACP,QACE;AACJ,GAEMC,IAA2C;CAC/C,SAAS;CACT,MAAM;CACN,SAAS;CACT,SAAS;CACT,OAAO;CACP,QAAQ;AACV,GAqBaC,KAAuC,EAClD,UAAO,WACP,SACA,UACA,WACA,cACA,aACA,UAAO,IACP,mBAEA,kBAAC,MAAD;CAAI,WAAWC,EAAG,sCAAsCC,CAAS;CAAjE,UAAA;EAEG,CAACC,KACA,kBAAC,QAAD;GACE,eAAY;GACZ,WAAU;EACX,CAAA;EAGH,kBAAC,QAAD;GACE,eAAY;GACZ,WAAWF,EACT,mHACAH,EAASM,EACX;GAEC,UAAAC;EACG,CAAA;EAEN,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACE,kBAAC,QAAD;MAAM,WAAWJ,EAAG,yBAAyBF,EAAWK,EAAK;MAAI,UAAAE;KAAY,CAAA;KAC5EC,KAAU,kBAAC,QAAD;MAAM,WAAU;MAA+B,UAAAA;KAAa,CAAA;KACtEC,KACC,kBAAC,QAAD;MAAM,WAAU;MAAyD,UAAAA;KAAgB,CAAA;IAExF;GACJ,CAAA,GAAAC,KAAY,kBAAC,OAAD;IAAK,WAAU;IAAoC;GAAc,CAAA,CAC3E;;CACH;A,IASOC,KAA+B,EAAE,aAAU,mBACtD,kBAAC,MAAD;CAAI,WAAWT,EAAG,iBAAiBC,CAAS;CAAI;AAAa,CAAA"}
@@ -1,4 +1,9 @@
1
1
  import { FC, ReactNode } from 'react';
2
+ /**
3
+ * Under the host's Navigation v2 shell (`navigationV2`, BOFF-18039) the host's phone tab bar is
4
+ * the one tab bar and the host pads the page by its height, so the module draws neither its own
5
+ * bar nor the padding that clears it.
6
+ */
2
7
  export declare const MobileLayout: FC<{
3
8
  children: ReactNode;
4
9
  }>;
@@ -1,10 +1,17 @@
1
- import { BottomTabNav as e } from "./BottomTabNav.js";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
1
+ import { useGovCitizenHub as e } from "../../context/GovCitizenHubContext.js";
2
+ import { BottomTabNav as t } from "./BottomTabNav.js";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
3
4
  // src/govcitizenhub/components/mobile/MobileLayout.tsx
4
- var r = ({ children: r }) => /* @__PURE__ */ n("div", {
5
- className: "flex min-h-full flex-col pb-20 md:pb-0",
6
- children: [r, /* @__PURE__ */ t(e, {})]
7
- });
8
- export { r as MobileLayout };
5
+ var i = ({ children: i }) => {
6
+ let { navigationV2: a = !1 } = e();
7
+ return a ? /* @__PURE__ */ n("div", {
8
+ className: "flex min-h-full flex-col",
9
+ children: i
10
+ }) : /* @__PURE__ */ r("div", {
11
+ className: "flex min-h-full flex-col pb-20 md:pb-0",
12
+ children: [i, /* @__PURE__ */ n(t, {})]
13
+ });
14
+ };
15
+ export { i as MobileLayout };
9
16
 
10
17
  //# sourceMappingURL=MobileLayout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MobileLayout.js","names":["MobileLayout","children","BottomTabNav"],"sources":["../../../../src/govcitizenhub/components/mobile/MobileLayout.tsx"],"sourcesContent":["/**\n * MobileLayout — citizen mobile surface shell (BOFF-4088)\n * @module govcitizenhub/components/mobile\n *\n * Wraps every page under the `m/*` route subtree: reserves bottom padding\n * for the fixed {@link BottomTabNav} and renders it. Kept as a thin wrapper\n * (not a route-level `<Outlet/>`) so each mobile page stays a simple,\n * independently testable component.\n */\n\nimport type { FC, ReactNode } from 'react';\n\nimport { BottomTabNav } from './BottomTabNav';\n\nexport const MobileLayout: FC<{ children: ReactNode }> = ({ children }) => (\n <div className=\"flex min-h-full flex-col pb-20 md:pb-0\">\n {children}\n <BottomTabNav />\n </div>\n);\n"],"mappings":";;;AAcA,IAAaA,KAA6C,EAAE,kBAC1D,kBAAC,OAAD;CAAK,WAAU;CAAf,UAAA,CACGC,GACD,kBAACC,GAAD,CAAe,CAAA,CACZ"}
1
+ {"version":3,"file":"MobileLayout.js","names":["MobileLayout","useGovCitizenHub","navigationV2","children","BottomTabNav"],"sources":["../../../../src/govcitizenhub/components/mobile/MobileLayout.tsx"],"sourcesContent":["/**\n * MobileLayout — citizen mobile surface shell (BOFF-4088)\n * @module govcitizenhub/components/mobile\n *\n * Wraps every page under the `m/*` route subtree: reserves bottom padding\n * for the fixed {@link BottomTabNav} and renders it. Kept as a thin wrapper\n * (not a route-level `<Outlet/>`) so each mobile page stays a simple,\n * independently testable component.\n */\n\nimport type { FC, ReactNode } from 'react';\n\nimport { useGovCitizenHub } from '../../context/GovCitizenHubContext';\nimport { BottomTabNav } from './BottomTabNav';\n\n/**\n * Under the host's Navigation v2 shell (`navigationV2`, BOFF-18039) the host's phone tab bar is\n * the one tab bar and the host pads the page by its height, so the module draws neither its own\n * bar nor the padding that clears it.\n */\nexport const MobileLayout: FC<{ children: ReactNode }> = ({ children }) => {\n const { navigationV2 = false } = useGovCitizenHub();\n if (navigationV2) {\n return <div className=\"flex min-h-full flex-col\">{children}</div>;\n }\n return (\n <div className=\"flex min-h-full flex-col pb-20 md:pb-0\">\n {children}\n <BottomTabNav />\n </div>\n );\n};\n"],"mappings":";;;;AAoBA,IAAaA,KAA6C,EAAE,kBAAe;CACzE,IAAM,EAAE,kBAAe,OAAUC,EAAiB;CAIlD,OAHIC,IACK,kBAAC,OAAD;EAAK,WAAU;EAA4B;CAAc,CAAA,IAGhE,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACGC,GACD,kBAACC,GAAD,CAAe,CAAA,CACZ;;AAET"}