@exxatdesignux/ui 0.0.5 → 0.0.7

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 (264) hide show
  1. package/bin/init.mjs +29 -0
  2. package/package.json +7 -2
  3. package/template/.nvmrc +1 -0
  4. package/template/.prettierignore +7 -0
  5. package/template/.prettierrc +11 -0
  6. package/template/AGENTS.md +485 -0
  7. package/template/Logo/Exxat_Prism.svg +39 -0
  8. package/template/Logo/Exxat_one.svg +36 -0
  9. package/template/README.md +58 -0
  10. package/template/app/(app)/compliance/page.tsx +10 -0
  11. package/template/app/(app)/dashboard/loading.tsx +18 -0
  12. package/template/app/(app)/dashboard/page.tsx +36 -0
  13. package/template/app/(app)/data-list/[id]/page.tsx +28 -0
  14. package/template/app/(app)/data-list/new/page.tsx +31 -0
  15. package/template/app/(app)/data-list/page.tsx +10 -0
  16. package/template/app/(app)/error.tsx +43 -0
  17. package/template/app/(app)/help/page.tsx +34 -0
  18. package/template/app/(app)/layout.tsx +54 -0
  19. package/template/app/(app)/loading.tsx +18 -0
  20. package/template/app/(app)/question-bank/page.tsx +10 -0
  21. package/template/app/(app)/rotations/page.tsx +15 -0
  22. package/template/app/(app)/settings/page.tsx +17 -0
  23. package/template/app/(app)/sites/all/page.tsx +13 -0
  24. package/template/app/(app)/team/page.tsx +10 -0
  25. package/template/app/favicon.ico +0 -0
  26. package/template/app/globals.css +1811 -0
  27. package/template/app/layout.tsx +95 -0
  28. package/template/app/page.tsx +9 -0
  29. package/template/components/.gitkeep +0 -0
  30. package/template/components/app-sidebar-dynamic.tsx +15 -0
  31. package/template/components/app-sidebar.tsx +901 -0
  32. package/template/components/ask-leo-composer.tsx +216 -0
  33. package/template/components/ask-leo-sidebar.tsx +509 -0
  34. package/template/components/chart-area-interactive.tsx +293 -0
  35. package/template/components/charts-overview.tsx +2321 -0
  36. package/template/components/command-menu-01.tsx +133 -0
  37. package/template/components/command-menu-02.tsx +386 -0
  38. package/template/components/command-menu.tsx +182 -0
  39. package/template/components/compliance-board-view.tsx +134 -0
  40. package/template/components/compliance-client.tsx +92 -0
  41. package/template/components/compliance-list-view.tsx +59 -0
  42. package/template/components/compliance-page-header.tsx +89 -0
  43. package/template/components/compliance-table.tsx +525 -0
  44. package/template/components/dashboard-onboarding-gallery.tsx +13 -0
  45. package/template/components/dashboard-onboarding.tsx +21 -0
  46. package/template/components/dashboard-promo-banner.tsx +67 -0
  47. package/template/components/dashboard-quota-progress-card.tsx +369 -0
  48. package/template/components/dashboard-report-charts.tsx +69 -0
  49. package/template/components/dashboard-section-heading.tsx +68 -0
  50. package/template/components/dashboard-tabs.tsx +598 -0
  51. package/template/components/data-list-client.tsx +239 -0
  52. package/template/components/data-list-table-cells.test.tsx +22 -0
  53. package/template/components/data-list-table-cells.tsx +173 -0
  54. package/template/components/data-list-table.tsx +879 -0
  55. package/template/components/data-table/filter-date-calendar.tsx +38 -0
  56. package/template/components/data-table/filter-text-value-input.tsx +77 -0
  57. package/template/components/data-table/index.tsx +1612 -0
  58. package/template/components/data-table/pagination.tsx +256 -0
  59. package/template/components/data-table/types.ts +91 -0
  60. package/template/components/data-table/use-table-state.ts +566 -0
  61. package/template/components/data-view-dashboard-charts-compliance.tsx +960 -0
  62. package/template/components/data-view-dashboard-charts-team.tsx +968 -0
  63. package/template/components/data-view-dashboard-charts.tsx +1668 -0
  64. package/template/components/data-views/board-card-primitives.tsx +93 -0
  65. package/template/components/data-views/index.ts +41 -0
  66. package/template/components/data-views/list-page-board-card.tsx +192 -0
  67. package/template/components/data-views/list-page-board-template.tsx +122 -0
  68. package/template/components/data-views/placement-board-card.tsx +262 -0
  69. package/template/components/export-drawer.tsx +375 -0
  70. package/template/components/exxat-product-logo.tsx +453 -0
  71. package/template/components/form-layout-01.tsx +131 -0
  72. package/template/components/getting-started.tsx +625 -0
  73. package/template/components/key-metrics.tsx +920 -0
  74. package/template/components/leo-insight-indicator.tsx +364 -0
  75. package/template/components/leo-typing-dots.tsx +121 -0
  76. package/template/components/list-hub-status-badge.tsx +51 -0
  77. package/template/components/list-page-dashboard-charts.tsx +18 -0
  78. package/template/components/nav-documents.tsx +89 -0
  79. package/template/components/nav-main.tsx +58 -0
  80. package/template/components/nav-secondary.tsx +64 -0
  81. package/template/components/nav-user.tsx +190 -0
  82. package/template/components/new-placement-back-btn.tsx +28 -0
  83. package/template/components/new-placement-form.tsx +1066 -0
  84. package/template/components/onboarding/index.ts +4 -0
  85. package/template/components/onboarding/onboarding-01.tsx +7 -0
  86. package/template/components/onboarding/onboarding-02.tsx +7 -0
  87. package/template/components/onboarding/onboarding-03.tsx +7 -0
  88. package/template/components/onboarding/onboarding-04.tsx +7 -0
  89. package/template/components/page-header.tsx +57 -0
  90. package/template/components/placement-detail.tsx +438 -0
  91. package/template/components/placements-board-view.tsx +404 -0
  92. package/template/components/placements-list-view.tsx +285 -0
  93. package/template/components/placements-page-header.tsx +160 -0
  94. package/template/components/placements-table-columns.tsx +639 -0
  95. package/template/components/product-switcher.tsx +116 -0
  96. package/template/components/question-bank-board-view.tsx +205 -0
  97. package/template/components/question-bank-client.tsx +77 -0
  98. package/template/components/question-bank-list-view.tsx +59 -0
  99. package/template/components/question-bank-page-header.tsx +89 -0
  100. package/template/components/question-bank-table.tsx +586 -0
  101. package/template/components/rotations-empty-state.tsx +47 -0
  102. package/template/components/rotations-panel-activator.tsx +8 -0
  103. package/template/components/secondary-nav.tsx +394 -0
  104. package/template/components/secondary-panel.tsx +239 -0
  105. package/template/components/section-cards.tsx +106 -0
  106. package/template/components/settings-appearance-card.tsx +424 -0
  107. package/template/components/settings-client.tsx +537 -0
  108. package/template/components/settings-form-row.tsx +42 -0
  109. package/template/components/sidebar-auto-collapse.tsx +23 -0
  110. package/template/components/sidebar-auto-open.tsx +18 -0
  111. package/template/components/sidebar-shell.tsx +37 -0
  112. package/template/components/site-header.tsx +93 -0
  113. package/template/components/sites-all-client.tsx +154 -0
  114. package/template/components/sites-board-view.tsx +67 -0
  115. package/template/components/sites-list-view.tsx +47 -0
  116. package/template/components/sites-table.tsx +312 -0
  117. package/template/components/system-banner-slot.tsx +66 -0
  118. package/template/components/table-properties/column-row.tsx +90 -0
  119. package/template/components/table-properties/draggable-list.ts +49 -0
  120. package/template/components/table-properties/drawer-button.tsx +231 -0
  121. package/template/components/table-properties/drawer.tsx +1102 -0
  122. package/template/components/table-properties/filter-card.tsx +251 -0
  123. package/template/components/table-properties/index.ts +22 -0
  124. package/template/components/table-properties/sort-card.tsx +59 -0
  125. package/template/components/table-properties/types.ts +124 -0
  126. package/template/components/task-list-panel.tsx +98 -0
  127. package/template/components/task-priority-badge.tsx +28 -0
  128. package/template/components/team-board-view.tsx +114 -0
  129. package/template/components/team-client.tsx +93 -0
  130. package/template/components/team-list-view.tsx +62 -0
  131. package/template/components/team-page-header.tsx +92 -0
  132. package/template/components/team-table.tsx +525 -0
  133. package/template/components/templates/list-page.tsx +576 -0
  134. package/template/components/templates/primary-page-template.tsx +56 -0
  135. package/template/components/theme-color-sync.tsx +32 -0
  136. package/template/components/theme-provider.tsx +71 -0
  137. package/template/components/tinted-icon-disc.tsx +53 -0
  138. package/template/components/ui/ai-thinking-surface.tsx +121 -0
  139. package/template/components/ui/avatar.tsx +1 -0
  140. package/template/components/ui/badge.tsx +1 -0
  141. package/template/components/ui/banner.tsx +1 -0
  142. package/template/components/ui/breadcrumb.tsx +1 -0
  143. package/template/components/ui/button.tsx +1 -0
  144. package/template/components/ui/calendar.tsx +1 -0
  145. package/template/components/ui/card.tsx +1 -0
  146. package/template/components/ui/chart.tsx +1 -0
  147. package/template/components/ui/checkbox.tsx +1 -0
  148. package/template/components/ui/coach-mark.tsx +1 -0
  149. package/template/components/ui/collapsible.tsx +1 -0
  150. package/template/components/ui/command.tsx +1 -0
  151. package/template/components/ui/date-picker-field.tsx +1 -0
  152. package/template/components/ui/dialog.tsx +1 -0
  153. package/template/components/ui/dot-pattern.tsx +159 -0
  154. package/template/components/ui/drag-handle-grip.tsx +1 -0
  155. package/template/components/ui/drawer.tsx +1 -0
  156. package/template/components/ui/dropdown-menu.tsx +1 -0
  157. package/template/components/ui/field.tsx +1 -0
  158. package/template/components/ui/form.tsx +1 -0
  159. package/template/components/ui/input-group.tsx +1 -0
  160. package/template/components/ui/input-mask.tsx +1 -0
  161. package/template/components/ui/input.tsx +1 -0
  162. package/template/components/ui/kbd.tsx +1 -0
  163. package/template/components/ui/label.tsx +1 -0
  164. package/template/components/ui/leo-icon.tsx +726 -0
  165. package/template/components/ui/payment-card-fields.tsx +1 -0
  166. package/template/components/ui/popover.tsx +1 -0
  167. package/template/components/ui/radio-group.tsx +1 -0
  168. package/template/components/ui/select.tsx +1 -0
  169. package/template/components/ui/selection-tile-grid.tsx +1 -0
  170. package/template/components/ui/separator.tsx +1 -0
  171. package/template/components/ui/sheet.tsx +1 -0
  172. package/template/components/ui/sidebar.tsx +1 -0
  173. package/template/components/ui/skeleton.tsx +1 -0
  174. package/template/components/ui/sonner.tsx +1 -0
  175. package/template/components/ui/status-badge.tsx +1 -0
  176. package/template/components/ui/table.tsx +1 -0
  177. package/template/components/ui/tabs.tsx +1 -0
  178. package/template/components/ui/textarea.tsx +1 -0
  179. package/template/components/ui/tip.tsx +1 -0
  180. package/template/components/ui/toggle-group.tsx +1 -0
  181. package/template/components/ui/toggle-switch.tsx +1 -0
  182. package/template/components/ui/toggle.tsx +1 -0
  183. package/template/components/ui/tooltip.tsx +1 -0
  184. package/template/components/ui/view-segmented-control.tsx +1 -0
  185. package/template/components.json +27 -0
  186. package/template/contexts/chart-variant-context.tsx +35 -0
  187. package/template/contexts/command-menu-context.tsx +28 -0
  188. package/template/contexts/dashboard-view-context.tsx +35 -0
  189. package/template/contexts/product-context.tsx +38 -0
  190. package/template/contexts/system-banner-context.tsx +127 -0
  191. package/template/docs/command-menu-pattern.md +45 -0
  192. package/template/docs/data-views-pattern.md +160 -0
  193. package/template/ecosystem.config.cjs +20 -0
  194. package/template/eslint.config.mjs +18 -0
  195. package/template/fontawesome-subset.manifest.json +190 -0
  196. package/template/hooks/.gitkeep +0 -0
  197. package/template/hooks/use-app-theme.ts +1 -0
  198. package/template/hooks/use-coach-mark.ts +1 -0
  199. package/template/hooks/use-mobile.ts +1 -0
  200. package/template/hooks/use-mod-key-label.ts +1 -0
  201. package/template/lib/.gitkeep +0 -0
  202. package/template/lib/ask-leo-route-context.ts +133 -0
  203. package/template/lib/chart-keyboard-selection.test.ts +20 -0
  204. package/template/lib/chart-keyboard-selection.ts +17 -0
  205. package/template/lib/chart-line-dash.ts +16 -0
  206. package/template/lib/coach-mark-registry.ts +68 -0
  207. package/template/lib/command-menu-config.ts +127 -0
  208. package/template/lib/command-menu-search-data.ts +44 -0
  209. package/template/lib/conditional-rule-match.ts +32 -0
  210. package/template/lib/dashboard-customize-coach-mark.ts +18 -0
  211. package/template/lib/dashboard-layout-merge.ts +63 -0
  212. package/template/lib/data-list-display-options.ts +35 -0
  213. package/template/lib/data-list-persistence.ts +280 -0
  214. package/template/lib/data-list-view-surface.ts +58 -0
  215. package/template/lib/data-list-view.ts +29 -0
  216. package/template/lib/data-view-dashboard-storage.ts +101 -0
  217. package/template/lib/date-filter.ts +8 -0
  218. package/template/lib/dev-log.test.ts +28 -0
  219. package/template/lib/dev-log.ts +8 -0
  220. package/template/lib/editable-target.ts +10 -0
  221. package/template/lib/floating-sheet-panel.ts +72 -0
  222. package/template/lib/initials-from-name.ts +7 -0
  223. package/template/lib/list-page-table-properties.ts +52 -0
  224. package/template/lib/list-status-badges.ts +168 -0
  225. package/template/lib/logo-dev.ts +12 -0
  226. package/template/lib/mock/compliance-kpi.ts +61 -0
  227. package/template/lib/mock/compliance.ts +146 -0
  228. package/template/lib/mock/dashboard.ts +105 -0
  229. package/template/lib/mock/navigation.tsx +231 -0
  230. package/template/lib/mock/placements-kpi.ts +134 -0
  231. package/template/lib/mock/placements.ts +183 -0
  232. package/template/lib/mock/question-bank-kpi.ts +61 -0
  233. package/template/lib/mock/question-bank.ts +142 -0
  234. package/template/lib/mock/sites-directory.ts +16 -0
  235. package/template/lib/mock/sites-kpi.ts +25 -0
  236. package/template/lib/mock/team-kpi.ts +60 -0
  237. package/template/lib/mock/team.ts +118 -0
  238. package/template/lib/motion-ui.ts +17 -0
  239. package/template/lib/placement-board-card-layout.ts +79 -0
  240. package/template/lib/placement-lifecycle.ts +5 -0
  241. package/template/lib/row-height.ts +10 -0
  242. package/template/lib/stock-portrait.ts +11 -0
  243. package/template/lib/utils.test.ts +13 -0
  244. package/template/lib/utils.ts +1 -0
  245. package/template/next.config.mjs +15 -0
  246. package/template/package.json +83 -0
  247. package/template/postcss.config.mjs +8 -0
  248. package/template/public/.gitkeep +0 -0
  249. package/template/public/Illustration/Rotation.svg +74 -0
  250. package/template/public/avatars/user.svg +11 -0
  251. package/template/public/favicon/favicon.ico +0 -0
  252. package/template/public/favicon.ico +0 -0
  253. package/template/public/logos/exxat-one.svg +36 -0
  254. package/template/public/logos/exxat-prism.svg +39 -0
  255. package/template/public/mock-schools/emory.svg +4 -0
  256. package/template/public/mock-schools/rush.svg +4 -0
  257. package/template/scripts/fontawesome-subset-audit.mjs +190 -0
  258. package/template/scripts/pm2-startup-macos.sh +13 -0
  259. package/template/skills-lock.json +10 -0
  260. package/template/stores/app-store.ts +33 -0
  261. package/template/tests/setup.ts +1 -0
  262. package/template/tsconfig.json +35 -0
  263. package/template/types/react-payment-inputs.d.ts +19 -0
  264. package/template/vitest.config.ts +18 -0
@@ -0,0 +1,525 @@
1
+ "use client"
2
+
3
+ /**
4
+ * Compliance obligations — DataTable + TablePropertiesDrawer + list/board/dashboard.
5
+ */
6
+
7
+ import * as React from "react"
8
+ import {
9
+ COMPLIANCE_STATUS_BADGE_CLASS,
10
+ COMPLIANCE_STATUS_ICON,
11
+ COMPLIANCE_STATUS_LABEL,
12
+ } from "@/lib/list-status-badges"
13
+ import type { ComplianceItem } from "@/lib/mock/compliance"
14
+ import { DataTable, DataTableToolbar } from "@/components/data-table"
15
+ import {
16
+ ComplianceDashboardChartsSection,
17
+ ALL_COMPLIANCE_DASHBOARD_CARDS,
18
+ DEFAULT_COMPLIANCE_CHART_TYPES,
19
+ DEFAULT_COMPLIANCE_SPANS,
20
+ loadComplianceDashboardLayout,
21
+ mergeComplianceDashboardLayout,
22
+ saveComplianceDashboardLayout,
23
+ } from "@/components/data-view-dashboard-charts-compliance"
24
+ import { KEY_METRICS_KPI_COUNT_DEFAULT } from "@/lib/dashboard-layout-merge"
25
+ import type { ChartType, DashboardLayout } from "@/components/data-view-dashboard-charts"
26
+ import { ComplianceListView } from "@/components/compliance-list-view"
27
+ import { ComplianceBoardView, COMPLIANCE_BOARD_GROUP_OPTIONS } from "@/components/compliance-board-view"
28
+ import { complianceKpiInsight, complianceKpiMetrics } from "@/lib/mock/compliance-kpi"
29
+ import type { DataListViewType } from "@/lib/data-list-view"
30
+ import type { OpenTablePropertiesHandle } from "@/lib/list-page-table-properties"
31
+ import type { ColumnDef } from "@/components/data-table/types"
32
+ import { useTableState } from "@/components/data-table/use-table-state"
33
+ import { TablePropertiesDrawerButton } from "@/components/table-properties"
34
+ import type { ConditionalRule, FilterFieldDef, FilterOperator } from "@/components/table-properties/types"
35
+ import { ListHubStatusBadge } from "@/components/list-hub-status-badge"
36
+ import { Button } from "@/components/ui/button"
37
+ import {
38
+ DropdownMenu,
39
+ DropdownMenuContent,
40
+ DropdownMenuItem,
41
+ DropdownMenuTrigger,
42
+ } from "@/components/ui/dropdown-menu"
43
+ import { Tip } from "@/components/ui/tip"
44
+ import { CoachMark } from "@/components/ui/coach-mark"
45
+ import { useCoachMark } from "@/hooks/use-coach-mark"
46
+ import { DASHBOARD_CUSTOMIZE_COACH_STEPS } from "@/lib/dashboard-customize-coach-mark"
47
+ import {
48
+ DEFAULT_DATA_LIST_DISPLAY_OPTIONS,
49
+ type DataListDisplayOptions,
50
+ } from "@/lib/data-list-display-options"
51
+
52
+ function uniqueCategories(items: ComplianceItem[]) {
53
+ return [...new Set(items.map(i => i.category))].sort().map(c => ({ value: c, label: c }))
54
+ }
55
+
56
+ const STATUS_FILTER_OPTS = [
57
+ { value: "compliant", label: COMPLIANCE_STATUS_LABEL.compliant },
58
+ { value: "due_soon", label: COMPLIANCE_STATUS_LABEL.due_soon },
59
+ { value: "overdue", label: COMPLIANCE_STATUS_LABEL.overdue },
60
+ { value: "pending", label: COMPLIANCE_STATUS_LABEL.pending },
61
+ ]
62
+
63
+ function columnToFilterFieldDef(c: ColumnDef<ComplianceItem>): FilterFieldDef | null {
64
+ if (!c.filter) return null
65
+ const f = c.filter
66
+ const defaultOps: FilterOperator[] =
67
+ f.type === "select" || f.type === "date"
68
+ ? ["is", "is_not"]
69
+ : ["contains", "not_contains"]
70
+ return {
71
+ key: c.key,
72
+ label: c.label,
73
+ icon: f.icon ?? "fa-filter",
74
+ type: f.type,
75
+ operators: (f.operators ?? defaultOps) as FilterOperator[],
76
+ options: f.options,
77
+ ...(f.textMask ? { textMask: f.textMask } : {}),
78
+ }
79
+ }
80
+
81
+ function columnsToFilterFields(cols: ColumnDef<ComplianceItem>[]) {
82
+ return cols.map(columnToFilterFieldDef).filter((x): x is FilterFieldDef => x !== null)
83
+ }
84
+
85
+ function buildComplianceColumns(items: ComplianceItem[]): ColumnDef<ComplianceItem>[] {
86
+ const catOpts = uniqueCategories(items)
87
+
88
+ const COLUMN_SELECT: ColumnDef<ComplianceItem> = {
89
+ key: "select",
90
+ label: "",
91
+ width: 40,
92
+ minWidth: 40,
93
+ defaultPin: "left",
94
+ lockPin: true,
95
+ }
96
+
97
+ const cols: ColumnDef<ComplianceItem>[] = [
98
+ COLUMN_SELECT,
99
+ {
100
+ key: "title",
101
+ label: "Obligation",
102
+ width: 280,
103
+ minWidth: 140,
104
+ sortable: true,
105
+ sortKey: "title",
106
+ defaultPin: "left",
107
+ filter: {
108
+ type: "text",
109
+ icon: "fa-file-lines",
110
+ operators: ["contains", "not_contains"],
111
+ },
112
+ cell: row => (
113
+ <span className="line-clamp-2 text-sm font-medium text-foreground">{row.title}</span>
114
+ ),
115
+ },
116
+ {
117
+ key: "category",
118
+ label: "Category",
119
+ width: 160,
120
+ minWidth: 120,
121
+ sortable: true,
122
+ sortKey: "category",
123
+ filter: {
124
+ type: "select",
125
+ icon: "fa-layer-group",
126
+ operators: ["is", "is_not"],
127
+ options: catOpts,
128
+ },
129
+ cell: row => <span className="text-sm text-foreground/90">{row.category}</span>,
130
+ },
131
+ {
132
+ key: "status",
133
+ label: "Status",
134
+ width: 120,
135
+ minWidth: 100,
136
+ sortable: true,
137
+ sortKey: "status",
138
+ filter: {
139
+ type: "select",
140
+ icon: "fa-circle-dot",
141
+ operators: ["is", "is_not"],
142
+ options: STATUS_FILTER_OPTS,
143
+ },
144
+ cell: row => (
145
+ <ListHubStatusBadge
146
+ label={COMPLIANCE_STATUS_LABEL[row.status]}
147
+ tintClassName={COMPLIANCE_STATUS_BADGE_CLASS[row.status]}
148
+ icon={COMPLIANCE_STATUS_ICON[row.status]}
149
+ />
150
+ ),
151
+ },
152
+ {
153
+ key: "dueDate",
154
+ label: "Due",
155
+ width: 120,
156
+ minWidth: 100,
157
+ sortable: true,
158
+ sortKey: "dueDate",
159
+ filter: { type: "date", icon: "fa-calendar-days", operators: ["is", "is_not"] },
160
+ cell: row => (
161
+ <span className="text-sm tabular-nums text-foreground/90 whitespace-nowrap">{row.dueDate}</span>
162
+ ),
163
+ },
164
+ {
165
+ key: "owner",
166
+ label: "Owner",
167
+ width: 160,
168
+ minWidth: 120,
169
+ sortable: true,
170
+ sortKey: "owner",
171
+ filter: {
172
+ type: "text",
173
+ icon: "fa-user",
174
+ operators: ["contains", "not_contains"],
175
+ },
176
+ cell: row => <span className="text-sm text-foreground/90">{row.owner}</span>,
177
+ },
178
+ {
179
+ key: "lastReviewed",
180
+ label: "Last reviewed",
181
+ width: 120,
182
+ minWidth: 100,
183
+ sortable: true,
184
+ sortKey: "lastReviewed",
185
+ filter: { type: "date", icon: "fa-calendar-check", operators: ["is", "is_not"] },
186
+ cell: row => (
187
+ <span className="text-sm tabular-nums text-muted-foreground whitespace-nowrap">{row.lastReviewed}</span>
188
+ ),
189
+ },
190
+ {
191
+ key: "actions",
192
+ label: "",
193
+ width: 48,
194
+ minWidth: 48,
195
+ defaultPin: "right",
196
+ lockPin: true,
197
+ cell: row => (
198
+ <div className="flex items-center justify-center">
199
+ <DropdownMenu>
200
+ <DropdownMenuTrigger asChild>
201
+ <Button size="icon-sm" variant="ghost" aria-label={`Actions for ${row.title}`}>
202
+ <i className="fa-light fa-ellipsis text-sm" aria-hidden="true" />
203
+ </Button>
204
+ </DropdownMenuTrigger>
205
+ <DropdownMenuContent align="end" className="w-40">
206
+ <DropdownMenuItem disabled>
207
+ <i className="fa-light fa-eye" aria-hidden="true" />
208
+ View details
209
+ </DropdownMenuItem>
210
+ <DropdownMenuItem disabled>
211
+ <i className="fa-light fa-user-check" aria-hidden="true" />
212
+ Assign owner
213
+ </DropdownMenuItem>
214
+ </DropdownMenuContent>
215
+ </DropdownMenu>
216
+ </div>
217
+ ),
218
+ },
219
+ ]
220
+
221
+ return cols
222
+ }
223
+
224
+
225
+ export type ComplianceTableHandle = OpenTablePropertiesHandle
226
+
227
+ export const ComplianceTable = React.forwardRef<
228
+ ComplianceTableHandle,
229
+ { items: ComplianceItem[]; view?: DataListViewType; onViewChange?: (v: DataListViewType) => void }
230
+ >(function ComplianceTable({ items, view = "table", onViewChange }, ref) {
231
+ const columns = React.useMemo(() => buildComplianceColumns(items), [items])
232
+ const filterFields = React.useMemo(() => columnsToFilterFields(columns), [columns])
233
+ const fieldDefinitionsForDrawer = React.useMemo(
234
+ () =>
235
+ columns
236
+ .filter(c => c.key !== "select" && c.key !== "actions")
237
+ .map(c => ({ key: c.key, label: c.label, sortable: !!(c.sortable && (c.sortKey ?? c.key)) })),
238
+ [columns],
239
+ )
240
+
241
+ const resolveColumnLabel = React.useCallback(
242
+ (key: string) => columns.find(c => c.key === key)?.label ?? key,
243
+ [columns],
244
+ )
245
+
246
+ const [displayOptions, setDisplayOptions] = React.useState<DataListDisplayOptions>(DEFAULT_DATA_LIST_DISPLAY_OPTIONS)
247
+ const patchDisplay = React.useCallback((patch: Partial<DataListDisplayOptions>) => {
248
+ setDisplayOptions(prev => ({ ...prev, ...patch }))
249
+ }, [])
250
+
251
+ const [conditionalRules, setConditionalRules] = React.useState<ConditionalRule[]>([])
252
+ const addConditionalRule = React.useCallback((rule: Omit<ConditionalRule, "id">) => {
253
+ setConditionalRules(prev => [...prev, { ...rule, id: `cr-${Date.now()}` }])
254
+ }, [])
255
+ const removeConditionalRule = React.useCallback((id: string) => {
256
+ setConditionalRules(prev => prev.filter(r => r.id !== id))
257
+ }, [])
258
+ const updateConditionalRule = React.useCallback((id: string, patch: Partial<ConditionalRule>) => {
259
+ setConditionalRules(prev => prev.map(r => r.id === id ? { ...r, ...patch } : r))
260
+ }, [])
261
+
262
+ const tableState = useTableState(items, columns, { key: "dueDate", dir: "asc" })
263
+
264
+ const dashboardKpi = React.useMemo(
265
+ () => ({
266
+ metrics: complianceKpiMetrics(tableState.rows as ComplianceItem[]),
267
+ insight: complianceKpiInsight(tableState.rows as ComplianceItem[]),
268
+ }),
269
+ [tableState.rows],
270
+ )
271
+
272
+ const [visibleComplianceCards, setVisibleComplianceCards] = React.useState<string[]>(() =>
273
+ ALL_COMPLIANCE_DASHBOARD_CARDS.map(c => c.id),
274
+ )
275
+ const [complianceCardOrder, setComplianceCardOrder] = React.useState<string[]>(() =>
276
+ ALL_COMPLIANCE_DASHBOARD_CARDS.map(c => c.id),
277
+ )
278
+ const [complianceCardSpans, setComplianceCardSpans] = React.useState<Record<string, 1 | 2>>(() => ({
279
+ ...DEFAULT_COMPLIANCE_SPANS,
280
+ }))
281
+ const [complianceCardChartTypes, setComplianceCardChartTypes] = React.useState<Record<string, ChartType>>(() => ({
282
+ ...DEFAULT_COMPLIANCE_CHART_TYPES,
283
+ }))
284
+ const [complianceKeyMetricsKpiCount, setComplianceKeyMetricsKpiCount] = React.useState<number>(
285
+ KEY_METRICS_KPI_COUNT_DEFAULT,
286
+ )
287
+ const [complianceDashboardLayoutEdit, setComplianceDashboardLayoutEdit] = React.useState(false)
288
+ const complianceDashboardLayoutHydrated = React.useRef(false)
289
+ const complianceDashboardLayoutEditBaselineRef = React.useRef<DashboardLayout | null>(null)
290
+
291
+ React.useEffect(() => {
292
+ const saved = loadComplianceDashboardLayout()
293
+ const m = mergeComplianceDashboardLayout(saved)
294
+ setVisibleComplianceCards(m.visible)
295
+ setComplianceCardOrder(m.order)
296
+ setComplianceCardSpans(m.spans ?? { ...DEFAULT_COMPLIANCE_SPANS })
297
+ setComplianceCardChartTypes(m.chartTypes ?? { ...DEFAULT_COMPLIANCE_CHART_TYPES })
298
+ setComplianceKeyMetricsKpiCount(m.keyMetricsKpiCount ?? KEY_METRICS_KPI_COUNT_DEFAULT)
299
+ complianceDashboardLayoutHydrated.current = true
300
+ }, [])
301
+
302
+ React.useEffect(() => {
303
+ if (!complianceDashboardLayoutHydrated.current) return
304
+ saveComplianceDashboardLayout({
305
+ visible: visibleComplianceCards,
306
+ order: complianceCardOrder,
307
+ spans: complianceCardSpans,
308
+ chartTypes: complianceCardChartTypes,
309
+ keyMetricsKpiCount: complianceKeyMetricsKpiCount,
310
+ })
311
+ }, [visibleComplianceCards, complianceCardOrder, complianceCardSpans, complianceCardChartTypes, complianceKeyMetricsKpiCount])
312
+
313
+ const handleComplianceVisibleChange = React.useCallback((v: string[]) => {
314
+ setVisibleComplianceCards(v)
315
+ }, [])
316
+
317
+ const handleComplianceOrderChange = React.useCallback((o: string[]) => {
318
+ setComplianceCardOrder(o)
319
+ }, [])
320
+
321
+ const handleComplianceSpanChange = React.useCallback((id: string, span: 1 | 2) => {
322
+ setComplianceCardSpans(prev => ({ ...prev, [id]: span }))
323
+ }, [])
324
+
325
+ const handleComplianceChartTypeChange = React.useCallback((id: string, t: ChartType) => {
326
+ setComplianceCardChartTypes(prev => ({ ...prev, [id]: t }))
327
+ }, [])
328
+
329
+ const handleResetComplianceDashboardLayout = React.useCallback(() => {
330
+ setVisibleComplianceCards(ALL_COMPLIANCE_DASHBOARD_CARDS.map(c => c.id))
331
+ setComplianceCardOrder(ALL_COMPLIANCE_DASHBOARD_CARDS.map(c => c.id))
332
+ setComplianceCardSpans({ ...DEFAULT_COMPLIANCE_SPANS })
333
+ setComplianceCardChartTypes({ ...DEFAULT_COMPLIANCE_CHART_TYPES })
334
+ setComplianceKeyMetricsKpiCount(KEY_METRICS_KPI_COUNT_DEFAULT)
335
+ }, [])
336
+
337
+ const handleComplianceDashboardLayoutEditStart = React.useCallback(() => {
338
+ complianceDashboardLayoutEditBaselineRef.current = {
339
+ visible: [...visibleComplianceCards],
340
+ order: [...complianceCardOrder],
341
+ spans: { ...complianceCardSpans },
342
+ chartTypes: { ...complianceCardChartTypes },
343
+ keyMetricsKpiCount: complianceKeyMetricsKpiCount,
344
+ }
345
+ setComplianceDashboardLayoutEdit(true)
346
+ }, [visibleComplianceCards, complianceCardOrder, complianceCardSpans, complianceCardChartTypes, complianceKeyMetricsKpiCount])
347
+
348
+ const handleComplianceDashboardLayoutEditDone = React.useCallback(() => {
349
+ setComplianceDashboardLayoutEdit(false)
350
+ }, [])
351
+
352
+ const handleComplianceDashboardLayoutEditCancel = React.useCallback(() => {
353
+ const b = complianceDashboardLayoutEditBaselineRef.current
354
+ if (b) {
355
+ setVisibleComplianceCards(b.visible)
356
+ setComplianceCardOrder(b.order)
357
+ setComplianceCardSpans(b.spans ?? { ...DEFAULT_COMPLIANCE_SPANS })
358
+ setComplianceCardChartTypes(b.chartTypes ?? { ...DEFAULT_COMPLIANCE_CHART_TYPES })
359
+ setComplianceKeyMetricsKpiCount(b.keyMetricsKpiCount ?? KEY_METRICS_KPI_COUNT_DEFAULT)
360
+ }
361
+ setComplianceDashboardLayoutEdit(false)
362
+ }, [])
363
+
364
+ const dashboardCustomizeCoach = useCoachMark({
365
+ flowId: "compliance-dashboard-customize",
366
+ steps: DASHBOARD_CUSTOMIZE_COACH_STEPS,
367
+ delay: 700,
368
+ enabled: view === "dashboard",
369
+ })
370
+
371
+ React.useImperativeHandle(ref, () => ({
372
+ openPropertiesDrawer: () => {
373
+ tableState.setSheetOpen(true)
374
+ },
375
+ }), [tableState.setSheetOpen])
376
+
377
+ const complianceBoardGroupKey = COMPLIANCE_BOARD_GROUP_OPTIONS.some(
378
+ o => o.key === displayOptions.boardGroupByColumnKey,
379
+ )
380
+ ? displayOptions.boardGroupByColumnKey
381
+ : "status"
382
+
383
+ const drawerToolbarProps = {
384
+ totalRows: items.length,
385
+ filterFields,
386
+ fieldDefinitions: fieldDefinitionsForDrawer,
387
+ resolveColumnLabel,
388
+ displayOptions,
389
+ onDisplayOptionsChange: patchDisplay,
390
+ conditionalRules,
391
+ onAddConditionalRule: addConditionalRule,
392
+ onRemoveConditionalRule: removeConditionalRule,
393
+ onUpdateConditionalRule: updateConditionalRule,
394
+ currentView: view,
395
+ onViewChange,
396
+ lifecycleTabLabel: "Compliance",
397
+ boardGroupByColumnOptions: [...COMPLIANCE_BOARD_GROUP_OPTIONS],
398
+ }
399
+
400
+ const tableProps = {
401
+ data: items,
402
+ columns,
403
+ getRowId: (row: ComplianceItem) => row.id,
404
+ getRowSelectionLabel: (row: ComplianceItem) => row.title,
405
+ selectable: true,
406
+ searchable: displayOptions.showToolbarSearch,
407
+ showColumnHeaders: displayOptions.showColumnLabels,
408
+ groupable: true,
409
+ defaultSort: { key: "dueDate", dir: "asc" as const },
410
+ emptyState: <p className="text-sm text-muted-foreground">No compliance items.</p>,
411
+ conditionalRules,
412
+ state: tableState,
413
+ toolbarSlot: (s: ReturnType<typeof useTableState<ComplianceItem>>) => (
414
+ <TablePropertiesDrawerButton {...drawerToolbarProps} state={s} />
415
+ ),
416
+ bulkActionsSlot: (selected: Set<string | number>) => {
417
+ const n = selected.size
418
+ if (n === 0) return null
419
+ return (
420
+ <>
421
+ <span className="sr-only">{n} selected</span>
422
+ <Tip label="Export selection (demo)">
423
+ <Button size="sm" variant="outline" type="button">
424
+ <i className="fa-light fa-arrow-down-to-line" aria-hidden="true" />
425
+ Export
426
+ </Button>
427
+ </Tip>
428
+ </>
429
+ )
430
+ },
431
+ }
432
+
433
+ if (view === "table") {
434
+ return (
435
+ <div className="pb-6">
436
+ <DataTable<ComplianceItem> {...tableProps} />
437
+ </div>
438
+ )
439
+ }
440
+
441
+ const sharedToolbar = (
442
+ <DataTableToolbar
443
+ state={tableState}
444
+ columns={columns}
445
+ searchable={displayOptions.showToolbarSearch}
446
+ searchAriaLabel="Search compliance obligations"
447
+ toolbarSlot={s => <TablePropertiesDrawerButton {...drawerToolbarProps} state={s} />}
448
+ />
449
+ )
450
+
451
+ if (view === "list") {
452
+ return (
453
+ <div className="flex min-h-0 flex-1 flex-col">
454
+ {sharedToolbar}
455
+ <ComplianceListView rows={tableState.rows as ComplianceItem[]} />
456
+ </div>
457
+ )
458
+ }
459
+
460
+ if (view === "board") {
461
+ return (
462
+ <div className="flex min-h-0 flex-1 flex-col">
463
+ {sharedToolbar}
464
+ <ComplianceBoardView
465
+ rows={tableState.rows as ComplianceItem[]}
466
+ groupByColumnKey={complianceBoardGroupKey}
467
+ />
468
+ </div>
469
+ )
470
+ }
471
+
472
+ return (
473
+ <div className="flex min-h-0 flex-1 flex-col">
474
+ <CoachMark state={dashboardCustomizeCoach} />
475
+ {!complianceDashboardLayoutEdit ? (
476
+ <DataTableToolbar
477
+ state={tableState}
478
+ columns={columns}
479
+ searchable={displayOptions.showToolbarSearch}
480
+ searchAriaLabel="Search compliance obligations"
481
+ toolbarSlot={s => (
482
+ <TablePropertiesDrawerButton
483
+ {...drawerToolbarProps}
484
+ state={s}
485
+ extraActions={
486
+ <Tip side="bottom" label="Edit dashboard layout on canvas">
487
+ <Button
488
+ type="button"
489
+ variant="ghost"
490
+ size="icon-sm"
491
+ aria-label="Edit dashboard layout"
492
+ onClick={handleComplianceDashboardLayoutEditStart}
493
+ className="text-muted-foreground hover:text-interactive-hover-foreground hover:bg-interactive-hover"
494
+ >
495
+ <i className="fa-light fa-pen-ruler text-[13px]" aria-hidden="true" />
496
+ </Button>
497
+ </Tip>
498
+ }
499
+ />
500
+ )}
501
+ />
502
+ ) : null}
503
+ <ComplianceDashboardChartsSection
504
+ rows={tableState.rows as ComplianceItem[]}
505
+ keyMetrics={dashboardKpi}
506
+ visibleCards={visibleComplianceCards}
507
+ cardOrder={complianceCardOrder}
508
+ cardSpans={complianceCardSpans}
509
+ cardChartTypes={complianceCardChartTypes}
510
+ keyMetricsKpiCount={complianceKeyMetricsKpiCount}
511
+ layoutEditMode={complianceDashboardLayoutEdit}
512
+ onVisibleChange={handleComplianceVisibleChange}
513
+ onOrderChange={handleComplianceOrderChange}
514
+ onSpanChange={handleComplianceSpanChange}
515
+ onChartTypeChange={handleComplianceChartTypeChange}
516
+ onKeyMetricsKpiCountChange={setComplianceKeyMetricsKpiCount}
517
+ onResetLayout={handleResetComplianceDashboardLayout}
518
+ onLayoutEditDone={handleComplianceDashboardLayoutEditDone}
519
+ onLayoutEditCancel={handleComplianceDashboardLayoutEditCancel}
520
+ />
521
+ </div>
522
+ )
523
+ })
524
+
525
+ ComplianceTable.displayName = "ComplianceTable"
@@ -0,0 +1,13 @@
1
+ "use client"
2
+
3
+ /**
4
+ * @deprecated Prefer importing `DashboardOnboarding` from `@/components/dashboard-onboarding`.
5
+ * Kept as a stable import path for existing call sites.
6
+ */
7
+
8
+ export {
9
+ DashboardOnboarding as DashboardOnboardingGallery,
10
+ DASHBOARD_ONBOARDING_STORAGE_KEY,
11
+ renderDashboardOnboardingVariant,
12
+ } from "@/components/dashboard-onboarding"
13
+ export type { DashboardOnboardingVariant, DashboardOnboardingProps } from "@/components/dashboard-onboarding"
@@ -0,0 +1,21 @@
1
+ "use client"
2
+
3
+ /**
4
+ * @deprecated Prefer `GettingStarted` from `@/components/getting-started`.
5
+ * Kept as a compatibility layer for existing imports.
6
+ */
7
+ import { GettingStarted, GETTING_STARTED_STORAGE_KEY, renderGettingStartedVariant } from "@/components/getting-started"
8
+ import type { GettingStartedVariant } from "@/components/getting-started"
9
+
10
+ export const DASHBOARD_ONBOARDING_STORAGE_KEY = GETTING_STARTED_STORAGE_KEY
11
+ export type DashboardOnboardingVariant = GettingStartedVariant
12
+ export const renderDashboardOnboardingVariant = renderGettingStartedVariant
13
+
14
+ export interface DashboardOnboardingProps {
15
+ inset?: boolean
16
+ titleAs?: "h1" | "h2"
17
+ }
18
+
19
+ export function DashboardOnboarding({ inset = true, titleAs = "h2" }: DashboardOnboardingProps) {
20
+ return <GettingStarted inset={inset} titleAs={titleAs} />
21
+ }
@@ -0,0 +1,67 @@
1
+ "use client"
2
+
3
+ /**
4
+ * Dashboard-only promo strip — same default messaging as the app system banner,
5
+ * but independent (own dismiss + storage) so the shell `SystemBannerSlot` is unchanged.
6
+ */
7
+
8
+ import * as React from "react"
9
+ import { SystemBanner } from "@/components/ui/banner"
10
+ import { AiThinkingOverlay } from "@/components/ui/ai-thinking-surface"
11
+ import { DEFAULT_SYSTEM_BANNER_CONFIG } from "@/contexts/system-banner-context"
12
+
13
+ const STORAGE_KEY = "exxat:dashboard-promo-dismissed"
14
+
15
+ export function DashboardPromoBanner() {
16
+ const [mounted, setMounted] = React.useState(false)
17
+ const [dismissed, setDismissed] = React.useState(false)
18
+
19
+ React.useEffect(() => {
20
+ setMounted(true)
21
+ try {
22
+ setDismissed(window.localStorage.getItem(STORAGE_KEY) === "1")
23
+ } catch {
24
+ /* ignore */
25
+ }
26
+ }, [])
27
+
28
+ if (!mounted || dismissed) return null
29
+
30
+ const c = DEFAULT_SYSTEM_BANNER_CONFIG
31
+
32
+ return (
33
+ <SystemBanner
34
+ variant="promo"
35
+ emphasis={c.emphasis}
36
+ title={c.title}
37
+ dismissible
38
+ onDismiss={() => {
39
+ try {
40
+ window.localStorage.setItem(STORAGE_KEY, "1")
41
+ } catch {
42
+ /* ignore */
43
+ }
44
+ setDismissed(true)
45
+ }}
46
+ action={
47
+ c.actionLabel
48
+ ? { label: c.actionLabel, href: c.actionHref || "#" }
49
+ : undefined
50
+ }
51
+ decorativeOverlay={
52
+ c.variant === "promo" ? (
53
+ <AiThinkingOverlay
54
+ active
55
+ cloudCount={2}
56
+ cloudRadius={340}
57
+ gridSize={13}
58
+ dotRadius={1.15}
59
+ fillClassName="fill-brand/30 dark:fill-brand/38"
60
+ />
61
+ ) : undefined
62
+ }
63
+ >
64
+ {c.message}
65
+ </SystemBanner>
66
+ )
67
+ }