@xemahq/ui-kernel 0.11.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/dist/errors/http-error-status.d.ts +17 -0
  2. package/dist/errors/http-error-status.d.ts.map +1 -0
  3. package/dist/errors/http-error-status.js +59 -0
  4. package/dist/errors/http-error-status.js.map +1 -0
  5. package/dist/errors/index.d.ts +2 -0
  6. package/dist/errors/index.d.ts.map +1 -0
  7. package/dist/errors/index.js +2 -0
  8. package/dist/errors/index.js.map +1 -0
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +1 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/lib/biome-host/errors.d.ts.map +1 -1
  14. package/dist/lib/biome-host/errors.js +1 -19
  15. package/dist/lib/biome-host/errors.js.map +1 -1
  16. package/dist/offline/index.d.ts.map +1 -1
  17. package/dist/offline/index.js.map +1 -1
  18. package/dist/offline/online-controller.d.ts.map +1 -1
  19. package/dist/offline/online-controller.js +6 -1
  20. package/dist/offline/online-controller.js.map +1 -1
  21. package/dist/offline/outbox.d.ts.map +1 -1
  22. package/dist/offline/outbox.js +2 -24
  23. package/dist/offline/outbox.js.map +1 -1
  24. package/package.json +1 -2
  25. package/src/index.ts +0 -17
  26. package/src/lib/biome-host/agent-validation.ts +0 -239
  27. package/src/lib/biome-host/biome-builders.ts +0 -112
  28. package/src/lib/biome-host/biome-mode.ts +0 -6
  29. package/src/lib/biome-host/biome-navigation.ts +0 -37
  30. package/src/lib/biome-host/biome-registry.ts +0 -299
  31. package/src/lib/biome-host/biome-scope-hooks.ts +0 -41
  32. package/src/lib/biome-host/biome-scope.tsx +0 -52
  33. package/src/lib/biome-host/biome-scoped-query.ts +0 -134
  34. package/src/lib/biome-host/create-biome-orval-config.ts +0 -82
  35. package/src/lib/biome-host/define-web-biome.spec.ts +0 -221
  36. package/src/lib/biome-host/define-web-biome.ts +0 -222
  37. package/src/lib/biome-host/errors.ts +0 -220
  38. package/src/lib/biome-host/frontend-biome.ts +0 -256
  39. package/src/lib/biome-host/host-bridge.ts +0 -281
  40. package/src/lib/biome-host/host-sources.ts +0 -54
  41. package/src/lib/biome-host/i18n-hooks.ts +0 -51
  42. package/src/lib/biome-host/i18n-port.test.ts +0 -50
  43. package/src/lib/biome-host/i18n-port.ts +0 -96
  44. package/src/lib/biome-host/index.ts +0 -35
  45. package/src/lib/biome-host/realtime-hooks.ts +0 -75
  46. package/src/lib/biome-host/realtime-port.ts +0 -115
  47. package/src/lib/biome-host/session-contributions.ts +0 -296
  48. package/src/lib/biome-host/use-mutation-with-error-toast.ts +0 -90
  49. package/src/lib/biome-host/use-page-state.ts +0 -248
  50. package/src/lib/capabilities/capability-context.ts +0 -25
  51. package/src/lib/capabilities/capability-provider.tsx +0 -73
  52. package/src/lib/capabilities/index.ts +0 -17
  53. package/src/lib/capabilities/types.ts +0 -69
  54. package/src/lib/capabilities/use-capability.ts +0 -79
  55. package/src/lib/contribution-registry/contribution-registry.spec.ts +0 -141
  56. package/src/lib/contribution-registry/contribution-registry.ts +0 -204
  57. package/src/lib/contribution-registry/index.ts +0 -9
  58. package/src/lib/contribution-registry/renderable-registry.ts +0 -142
  59. package/src/lib/system-bus/capability-invoke.ts +0 -92
  60. package/src/lib/system-bus/deeplink.ts +0 -210
  61. package/src/lib/system-bus/enums.ts +0 -86
  62. package/src/lib/system-bus/host-ports.ts +0 -93
  63. package/src/lib/system-bus/index.ts +0 -16
  64. package/src/lib/system-bus/intent-registry.ts +0 -109
  65. package/src/lib/system-bus/intents.ts +0 -113
  66. package/src/lib/system-bus/palette.ts +0 -78
  67. package/src/lib/system-bus/system-bus-builder.ts +0 -159
  68. package/src/lib/system-bus/system-bus.ts +0 -37
  69. package/src/lib/system-bus/windows.ts +0 -51
  70. package/src/offline/id.ts +0 -16
  71. package/src/offline/index.ts +0 -54
  72. package/src/offline/mutation.ts +0 -75
  73. package/src/offline/offline-status-badge.tsx +0 -51
  74. package/src/offline/online-controller.ts +0 -105
  75. package/src/offline/outbox.test.ts +0 -172
  76. package/src/offline/outbox.ts +0 -348
  77. package/src/offline/react-hooks.ts +0 -40
  78. package/src/offline/react.tsx +0 -32
  79. package/src/offline/storage.ts +0 -112
  80. package/src/offline/types.ts +0 -77
  81. package/src/org-db/components/DbResultTable.tsx +0 -176
  82. package/src/org-db/index.ts +0 -1
  83. package/src/pdf/index.ts +0 -11
  84. package/src/registry/index.ts +0 -9
  85. package/src/registry/lib/agent-validation-host.ts +0 -36
  86. package/src/registry/lib/biome-slot.tsx +0 -50
  87. package/src/registry/lib/biomes-enabled-context.ts +0 -20
  88. package/src/registry/lib/extension-points.ts +0 -134
  89. package/src/registry/lib/primitives/SessionEventCard.tsx +0 -164
  90. package/src/registry/lib/primitives/SessionEventTimeline.tsx +0 -95
  91. package/src/registry/lib/primitives/SessionMutationBar.tsx +0 -76
  92. package/src/registry/lib/primitives/SessionTabbedDrawer.tsx +0 -165
  93. package/src/registry/lib/primitives/index.ts +0 -18
  94. package/src/registry/lib/session-context-builder.ts +0 -84
  95. package/src/registry/lib/session-context-provider.tsx +0 -33
  96. package/src/registry/lib/session-context.ts +0 -21
  97. package/src/registry/lib/session-selectors.ts +0 -272
  98. package/src/session/comments/CommentRail.tsx +0 -164
  99. package/src/session/index.ts +0 -3
  100. package/src/session/lib/cn.ts +0 -11
  101. package/src/session/shell/SessionWorkspaceShell.tsx +0 -147
  102. package/src/session-kit/approvals/ApprovalButton.tsx +0 -89
  103. package/src/session-kit/approvals/ApprovalCard.tsx +0 -341
  104. package/src/session-kit/approvals/ApprovalsCenter.tsx +0 -336
  105. package/src/session-kit/approvals/CapabilityApprovalStickyBar.tsx +0 -118
  106. package/src/session-kit/approvals/Obligation.tsx +0 -111
  107. package/src/session-kit/approvals/ScopedBody.tsx +0 -392
  108. package/src/session-kit/approvals/approval-icons.ts +0 -31
  109. package/src/session-kit/approvals/approval-model.ts +0 -204
  110. package/src/session-kit/approvals/index.ts +0 -22
  111. package/src/session-kit/approvals/obligation-display.ts +0 -100
  112. package/src/session-kit/approvals/risk-accent.ts +0 -47
  113. package/src/session-kit/approvals/scope-icons.ts +0 -19
  114. package/src/session-kit/combobox/Combobox.tsx +0 -358
  115. package/src/session-kit/combobox/use-click-outside.ts +0 -21
  116. package/src/session-kit/display/ContextHeader.tsx +0 -148
  117. package/src/session-kit/display/FileDiffCard.tsx +0 -140
  118. package/src/session-kit/display/MD.tsx +0 -162
  119. package/src/session-kit/display/MessageTurn.tsx +0 -157
  120. package/src/session-kit/display/ThinkingPanel.tsx +0 -81
  121. package/src/session-kit/display/TodoChecklist.tsx +0 -120
  122. package/src/session-kit/display/TokenMeter.tsx +0 -89
  123. package/src/session-kit/display/ToolStrip.tsx +0 -278
  124. package/src/session-kit/display/TypingDots.tsx +0 -24
  125. package/src/session-kit/index.ts +0 -44
  126. package/src/session-kit/lib/enums.ts +0 -66
  127. package/src/session-kit/lib/portal-accent.ts +0 -30
  128. package/src/session-kit/lib/status-dot.ts +0 -68
  129. package/src/session-kit/primitives/Avatar.tsx +0 -44
  130. package/src/session-kit/primitives/PortalGlyph.tsx +0 -51
  131. package/src/session-kit/primitives/RiskPill.tsx +0 -95
  132. package/src/session-kit/primitives/ScopeDot.tsx +0 -47
  133. package/src/session-kit/primitives/Segmented.tsx +0 -71
  134. package/src/ui/branding/app-branding-context.ts +0 -20
  135. package/src/ui/branding/app-branding-provider.tsx +0 -123
  136. package/src/ui/branding/sanitize.ts +0 -89
  137. package/src/ui/breakpoints.ts +0 -14
  138. package/src/ui/capture/document-preview.tsx +0 -166
  139. package/src/ui/capture/field-spec-to-zod.test.ts +0 -81
  140. package/src/ui/capture/field-spec-to-zod.ts +0 -174
  141. package/src/ui/capture/field-spec-validate.ts +0 -236
  142. package/src/ui/capture/field-spec.test.ts +0 -49
  143. package/src/ui/capture/field-spec.ts +0 -274
  144. package/src/ui/capture/index.ts +0 -51
  145. package/src/ui/capture/schema-field-input.tsx +0 -620
  146. package/src/ui/capture/schema-form.tsx +0 -149
  147. package/src/ui/capture/submit-values.test.ts +0 -70
  148. package/src/ui/capture/submit-values.ts +0 -63
  149. package/src/ui/capture/use-prefill.ts +0 -186
  150. package/src/ui/capture/use-schema-validation.ts +0 -145
  151. package/src/ui/capture/use-wizard.ts +0 -180
  152. package/src/ui/capture/value-format.ts +0 -32
  153. package/src/ui/capture/wizard.tsx +0 -105
  154. package/src/ui/charts/bar-chart.tsx +0 -139
  155. package/src/ui/charts/chart-frame.tsx +0 -125
  156. package/src/ui/charts/chart-types.ts +0 -52
  157. package/src/ui/charts/chart-utils.ts +0 -190
  158. package/src/ui/charts/charts.test.tsx +0 -204
  159. package/src/ui/charts/donut-chart.tsx +0 -129
  160. package/src/ui/charts/index.ts +0 -27
  161. package/src/ui/charts/line-chart.tsx +0 -202
  162. package/src/ui/charts/sparkline.tsx +0 -109
  163. package/src/ui/chrome/AsyncBoundary.tsx +0 -74
  164. package/src/ui/chrome/EmptyState.tsx +0 -257
  165. package/src/ui/chrome/ErrorCard.tsx +0 -63
  166. package/src/ui/chrome/LoadingState.tsx +0 -61
  167. package/src/ui/chrome/PageHeader.tsx +0 -137
  168. package/src/ui/chrome/RecordCardList.tsx +0 -98
  169. package/src/ui/chrome/StateCard.tsx +0 -150
  170. package/src/ui/chrome/confirm-delete-dialog.tsx +0 -59
  171. package/src/ui/chrome/page-shell.spec.tsx +0 -117
  172. package/src/ui/chrome/page-shell.tsx +0 -221
  173. package/src/ui/chrome/scope-badge.tsx +0 -40
  174. package/src/ui/chrome/status-badge.tsx +0 -79
  175. package/src/ui/cn.ts +0 -32
  176. package/src/ui/design-tokens.ts +0 -372
  177. package/src/ui/hooks/use-debounced-value.ts +0 -16
  178. package/src/ui/hooks/use-is-mobile.ts +0 -28
  179. package/src/ui/index.ts +0 -110
  180. package/src/ui/pdf/pdf-preview.tsx +0 -122
  181. package/src/ui/primitives/alert-dialog.tsx +0 -104
  182. package/src/ui/primitives/async-combobox.tsx +0 -182
  183. package/src/ui/primitives/badge-variants.ts +0 -21
  184. package/src/ui/primitives/badge.tsx +0 -25
  185. package/src/ui/primitives/button-variants.ts +0 -31
  186. package/src/ui/primitives/button.tsx +0 -29
  187. package/src/ui/primitives/card.tsx +0 -43
  188. package/src/ui/primitives/checkbox.tsx +0 -26
  189. package/src/ui/primitives/collapsible.tsx +0 -9
  190. package/src/ui/primitives/dialog.tsx +0 -103
  191. package/src/ui/primitives/dropdown-menu.tsx +0 -179
  192. package/src/ui/primitives/form-stepper.tsx +0 -94
  193. package/src/ui/primitives/form-stepper.types.ts +0 -15
  194. package/src/ui/primitives/input.tsx +0 -22
  195. package/src/ui/primitives/label.tsx +0 -17
  196. package/src/ui/primitives/overflow-tabs.tsx +0 -331
  197. package/src/ui/primitives/popover.tsx +0 -33
  198. package/src/ui/primitives/preview-device-frame.tsx +0 -213
  199. package/src/ui/primitives/radio-group.tsx +0 -36
  200. package/src/ui/primitives/resizable.tsx +0 -67
  201. package/src/ui/primitives/scroll-area.tsx +0 -38
  202. package/src/ui/primitives/select.tsx +0 -143
  203. package/src/ui/primitives/separator.tsx +0 -20
  204. package/src/ui/primitives/sheet.tsx +0 -107
  205. package/src/ui/primitives/skeleton.tsx +0 -99
  206. package/src/ui/primitives/switch.tsx +0 -27
  207. package/src/ui/primitives/table.tsx +0 -72
  208. package/src/ui/primitives/tabs.tsx +0 -53
  209. package/src/ui/primitives/tag-multi-select.tsx +0 -261
  210. package/src/ui/primitives/textarea.tsx +0 -21
  211. package/src/ui/primitives/tooltip.tsx +0 -30
  212. package/src/ui/primitives/url-preview-chrome.tsx +0 -103
  213. package/src/vista/GenericCatalogueSurface.tsx +0 -179
  214. package/src/vista/SurfaceFallbackCard.tsx +0 -109
  215. package/src/vista/VistaPanel.tsx +0 -163
  216. package/src/vista/form-payload.spec.ts +0 -139
  217. package/src/vista/html/CustomUiFrame.spec.tsx +0 -127
  218. package/src/vista/html/CustomUiFrame.tsx +0 -206
  219. package/src/vista/html/custom-ui-frame-bridge.spec.ts +0 -191
  220. package/src/vista/html/custom-ui-frame-bridge.ts +0 -98
  221. package/src/vista/html/custom-ui-frame-contract.ts +0 -88
  222. package/src/vista/html/custom-ui-intents.spec.ts +0 -135
  223. package/src/vista/html/custom-ui-intents.ts +0 -155
  224. package/src/vista/html/custom-ui-srcdoc.spec.ts +0 -151
  225. package/src/vista/html/custom-ui-srcdoc.ts +0 -193
  226. package/src/vista/html/index.ts +0 -13
  227. package/src/vista/index.ts +0 -52
  228. package/src/vista/surface-catalogue.spec.ts +0 -140
  229. package/src/vista/surface-catalogue.ts +0 -90
  230. package/src/vista/surface-icons.ts +0 -57
  231. package/src/vista/surface-registry.ts +0 -56
  232. package/src/vista/surfaces/ChartSurface.tsx +0 -34
  233. package/src/vista/surfaces/FilesSurface.tsx +0 -202
  234. package/src/vista/surfaces/FormSurface.tsx +0 -380
  235. package/src/vista/surfaces/HtmlSurface.tsx +0 -43
  236. package/src/vista/surfaces/TableSurface.tsx +0 -100
  237. package/src/vista/surfaces/UrlSurface.tsx +0 -40
  238. package/src/vista/surfaces/blob-surfaces.tsx +0 -139
  239. package/src/vista/surfaces/elicitation-transport.spec.ts +0 -369
  240. package/src/vista/surfaces/elicitation-transport.ts +0 -367
  241. package/src/vista/surfaces/file-surface-utils.ts +0 -69
  242. package/src/vista/surfaces/index.ts +0 -24
  243. package/src/vista/surfaces/register-surfaces.tsx +0 -139
  244. package/src/vista/surfaces/text-surfaces.tsx +0 -132
  245. package/src/vista/use-vista-tabs.ts +0 -196
  246. package/src/vista/vista-code-renderer-context.ts +0 -16
  247. package/src/vista/vista-code-renderer.tsx +0 -35
  248. package/src/vista/vista-file-context.ts +0 -14
  249. package/src/vista/vista-file-source.tsx +0 -141
  250. package/src/vista/vista-form-context.ts +0 -20
  251. package/src/vista/vista-form-host.tsx +0 -48
  252. package/src/vista/vista-model.ts +0 -137
  253. package/src/vista/vista-open-context.tsx +0 -27
  254. package/src/vista/vista-open-state.ts +0 -11
  255. package/src/vista/vista-payloads.ts +0 -635
  256. package/src/vista/vista-tabs-manifest.ts +0 -138
  257. package/src/vista/vista-tools.ts +0 -232
@@ -1,221 +0,0 @@
1
- import { FileQuestion, type LucideIcon } from 'lucide-react';
2
- import { type ReactNode } from 'react';
3
-
4
- import EmptyState from './EmptyState';
5
- import { useHostBridge, type PageBackTarget } from '../../lib/biome-host';
6
- import { Tabs, TabsList, TabsTrigger } from '../primitives/tabs';
7
-
8
- interface TabDef {
9
- value: string;
10
- label: string | ReactNode;
11
- count?: number;
12
- indicator?: boolean;
13
- }
14
-
15
- interface PageShellProps {
16
- icon: LucideIcon;
17
- title: string;
18
- description?: string;
19
- children?: ReactNode;
20
- actions?: ReactNode;
21
- tabs?: TabDef[];
22
- activeTab?: string;
23
- onTabChange?: (value: string) => void;
24
- maxWidth?: string;
25
- embedded?: boolean;
26
- /** Mono caption rendered before the title in the topbar (parent context). */
27
- eyebrow?: string;
28
- /**
29
- * Leftmost icon-only back affordance on the topbar. Pages with a parent
30
- * context MUST set this and MUST NOT render their own in-body back button.
31
- */
32
- backTo?: PageBackTarget;
33
- /**
34
- * Optional right-aligned topbar action cluster. Use for primary CTAs
35
- * (1-3 small buttons). Heavier in-page chrome (filter rows, search
36
- * inputs) should keep using the `actions` slot which renders inside the
37
- * page body.
38
- */
39
- topbarActions?: ReactNode;
40
- }
41
-
42
- /**
43
- * Full-page shell — registers the topbar page-meta (via the HostBridge
44
- * page-meta store) and renders an optional tab strip + action row above the
45
- * scrollable content canvas. Host-framework-agnostic: reaches the page-meta
46
- * store through the kernel `HostBridge` singleton, never a host import.
47
- *
48
- * ── WHY THIS DISPATCHES INSTEAD OF BRANCHING ──────────────────────────────
49
- *
50
- * `embedded` means "the host page already owns the topbar — render only my
51
- * body". But `usePageMeta` used to be called UNCONDITIONALLY, above the
52
- * `embedded` check, and the page-meta store is a STACK ("nested pages can push
53
- * their own meta; on unmount the outer meta is restored"). So an embedded shell
54
- * pushed its own title, description, eyebrow, backTo and topbarActions OVER its
55
- * host's — the precise opposite of what embedding means. The host's back button
56
- * and title silently became the child's for as long as the child was mounted.
57
- *
58
- * A hook cannot be called conditionally, so the fix is structural: this
59
- * component calls NO hooks and only chooses. The embedded variant never reaches
60
- * the page-meta hook because it is a different component, not a later branch.
61
- */
62
- export default function PageShell(props: Readonly<PageShellProps>) {
63
- return props.embedded ? (
64
- <EmbeddedPageShell {...props} />
65
- ) : (
66
- <FullPageShell {...props} />
67
- );
68
- }
69
-
70
- /**
71
- * Embedded body. Registers NO page meta — the host page owns the topbar.
72
- * Renders only the child content plus an optional sub-tab strip + actions.
73
- */
74
- function EmbeddedPageShell({
75
- children,
76
- actions,
77
- tabs,
78
- activeTab,
79
- onTabChange,
80
- }: Readonly<PageShellProps>) {
81
- {
82
- return (
83
- <div className="flex h-full min-h-0 flex-col bg-paper">
84
- {(tabs && tabs.length > 0) || actions ? (
85
- <div className="shrink-0 border-b border-rule bg-paper-elev/40">
86
- <div className="flex items-center gap-3 px-4 py-2 lg:px-6">
87
- {tabs && tabs.length > 0 && (
88
- <Tabs
89
- value={activeTab}
90
- onValueChange={onTabChange}
91
- className="flex-1 min-w-0"
92
- >
93
- <div className="overflow-x-auto">
94
- <TabsList className="h-7 bg-transparent p-0 gap-0">
95
- {tabs.map((tab) => (
96
- <TabsTrigger
97
- key={tab.value}
98
- value={tab.value}
99
- className="rounded-none border-b-2 border-transparent px-2 py-1 text-body-2 font-medium text-ink-3 transition-colors data-[state=active]:border-primary data-[state=active]:text-ink data-[state=active]:bg-transparent data-[state=active]:shadow-none"
100
- >
101
- {tab.label}
102
- {tab.count !== undefined && (
103
- <span className="ml-1.5 text-caption tabular-nums opacity-70">
104
- {tab.count}
105
- </span>
106
- )}
107
- {tab.indicator && (
108
- <span className="ml-1.5 inline-block h-1.5 w-1.5 rounded-full bg-warning" />
109
- )}
110
- </TabsTrigger>
111
- ))}
112
- </TabsList>
113
- </div>
114
- </Tabs>
115
- )}
116
- {!tabs && <div className="flex-1" />}
117
- {actions && (
118
- <div className="flex items-center gap-2 shrink-0">
119
- {actions}
120
- </div>
121
- )}
122
- </div>
123
- </div>
124
- ) : null}
125
- <div className="flex-1 overflow-auto min-h-0">
126
- <div className="flex h-full min-h-0 flex-col px-4 pb-4 pt-3 lg:px-6">
127
- {children}
128
- </div>
129
- </div>
130
- </div>
131
- );
132
- }
133
- }
134
-
135
- /**
136
- * Full page. Owns the topbar meta for the route it renders.
137
- */
138
- function FullPageShell({
139
- title,
140
- description,
141
- children,
142
- actions,
143
- tabs,
144
- activeTab,
145
- onTabChange,
146
- maxWidth,
147
- eyebrow,
148
- backTo,
149
- topbarActions,
150
- }: Readonly<PageShellProps>) {
151
- // Single source of truth for the topbar title. Pages that bypass
152
- // PageShell call the page-meta hook directly; PageShell wraps the same
153
- // hook so consumers don't need to register meta twice.
154
- useHostBridge().pageMeta.usePageMeta({
155
- title,
156
- description,
157
- eyebrow,
158
- backTo,
159
- topbarActions,
160
- });
161
-
162
- return (
163
- <div className={`flex h-full min-h-0 flex-col ${maxWidth ?? ''}`}>
164
- {/* Compact toolbar: tabs + actions on the same row */}
165
- {(tabs || actions) && (
166
- <div className="shrink-0 border-b border-border/50 px-4 sm:px-5 lg:px-8">
167
- <div className="flex min-h-[34px] flex-col gap-2 py-1.5 sm:flex-row sm:items-center sm:gap-3 sm:py-0">
168
- {tabs && tabs.length > 0 && (
169
- <Tabs
170
- value={activeTab}
171
- onValueChange={onTabChange}
172
- className="flex-1 min-w-0"
173
- >
174
- <div className="overflow-x-auto">
175
- <TabsList className="h-7 bg-transparent p-0 gap-0">
176
- {tabs.map((tab) => (
177
- <TabsTrigger
178
- key={tab.value}
179
- value={tab.value}
180
- className="whitespace-nowrap rounded-none border-b-2 border-transparent px-2.5 py-1.5 text-caption font-medium text-ink-3/90 transition-colors data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:text-ink data-[state=active]:shadow-none hover:text-ink"
181
- >
182
- {tab.label}
183
- {tab.count !== undefined && (
184
- <span className="ml-1.5 text-caption tabular-nums opacity-60">
185
- {tab.count}
186
- </span>
187
- )}
188
- {tab.indicator && (
189
- <span className="ml-1.5 inline-block h-1.5 w-1.5 rounded-full bg-warning" />
190
- )}
191
- </TabsTrigger>
192
- ))}
193
- </TabsList>
194
- </div>
195
- </Tabs>
196
- )}
197
- {!tabs && <div className="flex-1" />}
198
- {actions && (
199
- <div className="flex w-full flex-wrap items-center gap-2 sm:w-auto sm:shrink-0 sm:justify-end">
200
- {actions}
201
- </div>
202
- )}
203
- </div>
204
- </div>
205
- )}
206
-
207
- {/* Content area — full height. Padding sized to match other editorial
208
- surfaces (PageHeader-rooted pages use the same `px-4 sm:px-6 py-5`
209
- rhythm). */}
210
- <div className="flex min-h-0 flex-1 flex-col overflow-auto px-4 pb-5 pt-4 sm:px-6 sm:pb-6 sm:pt-5">
211
- {children || (
212
- <EmptyState
213
- icon={FileQuestion}
214
- title="Nothing to show yet"
215
- description="This page has no content to display. Check back once the workspace has data."
216
- />
217
- )}
218
- </div>
219
- </div>
220
- );
221
- }
@@ -1,40 +0,0 @@
1
- import { cn } from '../cn';
2
- import { TONE_STYLES, type Tone } from '../design-tokens';
3
-
4
- export interface ScopeBadgeProps {
5
- /** Short label shown inside the chip. e.g. "system", "org", "override". */
6
- label: string;
7
- /** Visual tone — drives bg/text/border via design tokens. */
8
- tone?: Tone;
9
- /** Optional tooltip text. */
10
- hint?: string;
11
- className?: string;
12
- }
13
-
14
- /**
15
- * Compact uppercase chip for closed-enum scope/source pills (workflow
16
- * source, trigger scope, etc.). Distinct from `<StatusBadge>` which
17
- * carries process-state semantics (running/succeeded/failed/…).
18
- *
19
- * Always renders at the smallest size (`text-[10px]`) because it sits
20
- * inline next to other content on dense list rows.
21
- */
22
- export default function ScopeBadge({
23
- label,
24
- tone = 'neutral',
25
- hint,
26
- className,
27
- }: ScopeBadgeProps) {
28
- return (
29
- <span
30
- className={cn(
31
- 'inline-flex shrink-0 items-center rounded-sm border px-1.5 py-0 text-[10px] font-medium uppercase tracking-wide',
32
- TONE_STYLES[tone],
33
- className,
34
- )}
35
- title={hint}
36
- >
37
- {label}
38
- </span>
39
- );
40
- }
@@ -1,79 +0,0 @@
1
- import { cn } from '../cn';
2
- import { getStatusStyle } from '../design-tokens';
3
- import { Badge } from '../primitives/badge';
4
-
5
- import type { ReactNode } from 'react';
6
-
7
- export type StatusBadgeSize = 'xs' | 'sm' | 'md';
8
-
9
- export interface StatusBadgeProps {
10
- status: string;
11
- className?: string;
12
- dot?: boolean;
13
- size?: StatusBadgeSize;
14
- /** Override the rendered label. Falls back to a capitalized version of `status`. */
15
- children?: ReactNode;
16
- }
17
-
18
- interface SizeTokens {
19
- badge: string;
20
- dot: string;
21
- gap: string;
22
- }
23
-
24
- const SIZE_TOKENS: Record<StatusBadgeSize, SizeTokens> = {
25
- xs: {
26
- badge: 'h-[18px] px-1.5 py-0 text-[10px] font-medium',
27
- dot: 'h-1 w-1',
28
- gap: 'gap-1',
29
- },
30
- sm: {
31
- badge: 'h-5 px-2 py-0 text-caption font-medium',
32
- dot: 'h-1.5 w-1.5',
33
- gap: 'gap-1.5',
34
- },
35
- md: {
36
- badge: 'px-2.5 py-0.5 text-body-1',
37
- dot: 'h-1.5 w-1.5',
38
- gap: 'gap-1.5',
39
- },
40
- };
41
-
42
- /**
43
- * Semantic status badge that reads from the design token system.
44
- * Use across all pages for consistent status display.
45
- *
46
- * Size guidance:
47
- * - `xs` — dense list rows (Sessions, Brainstorming)
48
- * - `sm` — default list rows (Workflow Runs, Schedules, Triggers, dashboards)
49
- * - `md` — detail-page headers + hero surfaces
50
- */
51
- export default function StatusBadge({
52
- status,
53
- className,
54
- dot,
55
- size = 'sm',
56
- children,
57
- }: StatusBadgeProps) {
58
- const style = getStatusStyle(status);
59
- const sz = SIZE_TOKENS[size];
60
- return (
61
- <Badge
62
- variant="outline"
63
- className={cn(
64
- 'inline-flex items-center rounded-full',
65
- sz.badge,
66
- sz.gap,
67
- style.badge,
68
- className,
69
- )}
70
- >
71
- {dot && (
72
- <span className={cn('shrink-0 rounded-full', sz.dot, style.dot)} />
73
- )}
74
- {children ?? (
75
- <span className="capitalize">{status.replace(/_/g, ' ')}</span>
76
- )}
77
- </Badge>
78
- );
79
- }
package/src/ui/cn.ts DELETED
@@ -1,32 +0,0 @@
1
- import { clsx, type ClassValue } from 'clsx';
2
- import { extendTailwindMerge } from 'tailwind-merge';
3
-
4
- // The Xema design system defines a custom typography scale in the host
5
- // Tailwind config (`fontSize` keys: caption / body-1 / body-2 / subtitle /
6
- // title / display). tailwind-merge doesn't know these keys, so it
7
- // misclassifies `text-body-1`, `text-caption`, … as text-*color* utilities
8
- // and silently strips a real `text-*` colour when both land on one element
9
- // via cn(). Registering them in the `font-size` group keeps conflict
10
- // resolution correct.
11
- //
12
- // This is the SAME config the host shell ships in `@/lib/utils`. The shared
13
- // primitives moved into this package MUST merge classes identically, so the
14
- // config is duplicated here (one trivial block) rather than imported from the
15
- // host — this package stays host-framework-agnostic.
16
- const twMerge = extendTailwindMerge({
17
- extend: {
18
- classGroups: {
19
- 'font-size': [
20
- { text: ['caption', 'body-1', 'body-2', 'subtitle', 'title', 'display'] },
21
- ],
22
- },
23
- },
24
- });
25
-
26
- /**
27
- * Tailwind-aware class merge used by every shared UI primitive. Identical in
28
- * behaviour to the host shell's `cn` (including the custom typography scale).
29
- */
30
- export function cn(...inputs: ClassValue[]): string {
31
- return twMerge(clsx(inputs));
32
- }