@xemahq/ui-kernel 0.5.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/lib/biome-host/define-web-biome.d.ts +3 -3
  2. package/dist/lib/biome-host/define-web-biome.d.ts.map +1 -1
  3. package/dist/lib/biome-host/define-web-biome.js +23 -2
  4. package/dist/lib/biome-host/define-web-biome.js.map +1 -1
  5. package/dist/lib/biome-host/frontend-biome.d.ts +4 -3
  6. package/dist/lib/biome-host/frontend-biome.d.ts.map +1 -1
  7. package/dist/lib/biome-host/host-bridge.d.ts +2 -0
  8. package/dist/lib/biome-host/host-bridge.d.ts.map +1 -1
  9. package/dist/lib/biome-host/host-bridge.js.map +1 -1
  10. package/dist/lib/biome-host/i18n-hooks.d.ts +4 -0
  11. package/dist/lib/biome-host/i18n-hooks.d.ts.map +1 -0
  12. package/dist/lib/biome-host/i18n-hooks.js +22 -0
  13. package/dist/lib/biome-host/i18n-hooks.js.map +1 -0
  14. package/dist/lib/biome-host/i18n-port.d.ts +15 -0
  15. package/dist/lib/biome-host/i18n-port.d.ts.map +1 -0
  16. package/dist/lib/biome-host/i18n-port.js +29 -0
  17. package/dist/lib/biome-host/i18n-port.js.map +1 -0
  18. package/dist/lib/biome-host/index.d.ts +2 -1
  19. package/dist/lib/biome-host/index.d.ts.map +1 -1
  20. package/dist/lib/biome-host/index.js +2 -1
  21. package/dist/lib/biome-host/index.js.map +1 -1
  22. package/dist/lib/biome-host/realtime-port.d.ts +1 -1
  23. package/dist/lib/biome-host/realtime-port.d.ts.map +1 -1
  24. package/dist/session-kit/approvals/approval-model.d.ts.map +1 -1
  25. package/dist/session-kit/approvals/approval-model.js.map +1 -1
  26. package/dist/ui/branding/app-branding-provider.d.ts +17 -0
  27. package/dist/ui/branding/app-branding-provider.d.ts.map +1 -0
  28. package/dist/ui/branding/app-branding-provider.js +81 -0
  29. package/dist/ui/branding/app-branding-provider.js.map +1 -0
  30. package/dist/ui/branding/sanitize.d.ts +4 -0
  31. package/dist/ui/branding/sanitize.d.ts.map +1 -0
  32. package/dist/ui/branding/sanitize.js +47 -0
  33. package/dist/ui/branding/sanitize.js.map +1 -0
  34. package/dist/ui/breakpoints.d.ts +2 -0
  35. package/dist/ui/breakpoints.d.ts.map +1 -0
  36. package/dist/ui/breakpoints.js +5 -0
  37. package/dist/ui/breakpoints.js.map +1 -0
  38. package/dist/ui/charts/bar-chart.d.ts +7 -0
  39. package/dist/ui/charts/bar-chart.d.ts.map +1 -0
  40. package/dist/ui/charts/bar-chart.js +47 -0
  41. package/dist/ui/charts/bar-chart.js.map +1 -0
  42. package/dist/ui/charts/chart-frame.d.ts +25 -0
  43. package/dist/ui/charts/chart-frame.d.ts.map +1 -0
  44. package/dist/ui/charts/chart-frame.js +23 -0
  45. package/dist/ui/charts/chart-frame.js.map +1 -0
  46. package/dist/ui/charts/chart-types.d.ts +19 -0
  47. package/dist/ui/charts/chart-types.d.ts.map +1 -0
  48. package/dist/ui/charts/chart-types.js +3 -0
  49. package/dist/ui/charts/chart-types.js.map +1 -0
  50. package/dist/ui/charts/chart-utils.d.ts +22 -0
  51. package/dist/ui/charts/chart-utils.d.ts.map +1 -0
  52. package/dist/ui/charts/chart-utils.js +97 -0
  53. package/dist/ui/charts/chart-utils.js.map +1 -0
  54. package/dist/ui/charts/donut-chart.d.ts +7 -0
  55. package/dist/ui/charts/donut-chart.d.ts.map +1 -0
  56. package/dist/ui/charts/donut-chart.js +55 -0
  57. package/dist/ui/charts/donut-chart.js.map +1 -0
  58. package/dist/ui/charts/index.d.ts +8 -0
  59. package/dist/ui/charts/index.d.ts.map +1 -0
  60. package/dist/ui/charts/index.js +21 -0
  61. package/dist/ui/charts/index.js.map +1 -0
  62. package/dist/ui/charts/line-chart.d.ts +7 -0
  63. package/dist/ui/charts/line-chart.d.ts.map +1 -0
  64. package/dist/ui/charts/line-chart.js +70 -0
  65. package/dist/ui/charts/line-chart.js.map +1 -0
  66. package/dist/ui/charts/sparkline.d.ts +13 -0
  67. package/dist/ui/charts/sparkline.d.ts.map +1 -0
  68. package/dist/ui/charts/sparkline.js +39 -0
  69. package/dist/ui/charts/sparkline.js.map +1 -0
  70. package/dist/ui/hooks/use-is-mobile.d.ts +2 -0
  71. package/dist/ui/hooks/use-is-mobile.d.ts.map +1 -0
  72. package/dist/ui/hooks/use-is-mobile.js +19 -0
  73. package/dist/ui/hooks/use-is-mobile.js.map +1 -0
  74. package/dist/ui/index.d.ts +6 -0
  75. package/dist/ui/index.d.ts.map +1 -1
  76. package/dist/ui/index.js +14 -1
  77. package/dist/ui/index.js.map +1 -1
  78. package/dist/ui/pdf/pdf-preview.d.ts +8 -0
  79. package/dist/ui/pdf/pdf-preview.d.ts.map +1 -0
  80. package/dist/ui/pdf/pdf-preview.js +34 -0
  81. package/dist/ui/pdf/pdf-preview.js.map +1 -0
  82. package/dist/ui/primitives/preview-device-frame.d.ts +9 -0
  83. package/dist/ui/primitives/preview-device-frame.d.ts.map +1 -0
  84. package/dist/ui/primitives/preview-device-frame.js +90 -0
  85. package/dist/ui/primitives/preview-device-frame.js.map +1 -0
  86. package/package.json +8 -7
  87. package/src/lib/biome-host/define-web-biome.test.js +93 -0
  88. package/src/lib/biome-host/define-web-biome.ts +76 -15
  89. package/src/lib/biome-host/frontend-biome.ts +47 -18
  90. package/src/lib/biome-host/host-bridge.ts +13 -0
  91. package/src/lib/biome-host/i18n-hooks.ts +50 -0
  92. package/src/lib/biome-host/i18n-port.test.ts +50 -0
  93. package/src/lib/biome-host/i18n-port.ts +96 -0
  94. package/src/lib/biome-host/index.ts +2 -1
  95. package/src/lib/biome-host/realtime-port.ts +9 -3
  96. package/src/lib/system-bus/enums.ts +1 -1
  97. package/src/lib/system-bus/index.ts +1 -1
  98. package/src/lib/system-bus/intents.ts +1 -1
  99. package/src/session-kit/approvals/ApprovalCard.tsx +1 -1
  100. package/src/session-kit/approvals/ApprovalsCenter.tsx +2 -2
  101. package/src/session-kit/approvals/CapabilityApprovalStickyBar.tsx +1 -1
  102. package/src/session-kit/approvals/Obligation.tsx +1 -1
  103. package/src/session-kit/approvals/ScopedBody.tsx +1 -1
  104. package/src/session-kit/approvals/approval-model.ts +7 -8
  105. package/src/session-kit/approvals/index.ts +1 -1
  106. package/src/session-kit/approvals/obligation-display.ts +1 -1
  107. package/src/session-kit/approvals/risk-accent.ts +1 -1
  108. package/src/session-kit/combobox/Combobox.tsx +1 -1
  109. package/src/session-kit/display/MessageTurn.tsx +1 -1
  110. package/src/session-kit/display/TokenMeter.tsx +1 -1
  111. package/src/session-kit/index.ts +3 -3
  112. package/src/session-kit/lib/enums.ts +1 -1
  113. package/src/session-kit/lib/status-dot.ts +1 -1
  114. package/src/session-kit/primitives/RiskPill.tsx +1 -1
  115. package/src/ui/branding/app-branding-provider.tsx +146 -0
  116. package/src/ui/branding/sanitize.ts +77 -0
  117. package/src/ui/breakpoints.ts +14 -0
  118. package/src/ui/charts/bar-chart.tsx +135 -0
  119. package/src/ui/charts/chart-frame.tsx +112 -0
  120. package/src/ui/charts/chart-types.ts +52 -0
  121. package/src/ui/charts/chart-utils.ts +158 -0
  122. package/src/ui/charts/charts.test.tsx +204 -0
  123. package/src/ui/charts/donut-chart.tsx +111 -0
  124. package/src/ui/charts/index.ts +27 -0
  125. package/src/ui/charts/line-chart.tsx +180 -0
  126. package/src/ui/charts/sparkline.tsx +101 -0
  127. package/src/ui/hooks/use-is-mobile.ts +28 -0
  128. package/src/ui/index.ts +22 -0
  129. package/src/ui/pdf/pdf-preview.tsx +122 -0
  130. package/src/ui/primitives/preview-device-frame.tsx +205 -0
  131. package/dist/lib/biome-host/composition-validation.d.ts +0 -22
  132. package/dist/lib/biome-host/composition-validation.d.ts.map +0 -1
  133. package/dist/lib/biome-host/composition-validation.js +0 -127
  134. package/dist/lib/biome-host/composition-validation.js.map +0 -1
  135. package/dist/lib/biome-host/nav.d.ts +0 -17
  136. package/dist/lib/biome-host/nav.d.ts.map +0 -1
  137. package/dist/lib/biome-host/nav.js +0 -52
  138. package/dist/lib/biome-host/nav.js.map +0 -1
  139. package/dist/registry/lib/composition-validation-host.d.ts +0 -3
  140. package/dist/registry/lib/composition-validation-host.d.ts.map +0 -1
  141. package/dist/registry/lib/composition-validation-host.js +0 -10
  142. package/dist/registry/lib/composition-validation-host.js.map +0 -1
  143. package/src/lib/biome-host/nav.ts +0 -83
@@ -1,83 +0,0 @@
1
- import type { ComponentType } from 'react';
2
-
3
- import { biomeRegistry } from './biome-registry';
4
-
5
- export interface NavItem {
6
- readonly key: string;
7
- readonly label: string;
8
- readonly icon?: ComponentType<{ className?: string | undefined }> | undefined;
9
- readonly weight?: number | undefined;
10
- /** True when this item came from a biome contribution. */
11
- readonly fromBiome?: boolean | undefined;
12
- }
13
-
14
- export interface NavSection {
15
- readonly heading?: string | undefined;
16
- readonly items: readonly NavItem[];
17
- }
18
-
19
- /**
20
- * Merge the host's core nav sections with biome nav contributions. Biome
21
- * items are bucketed into the section whose `heading` matches their
22
- * `section` field; if no match exists, a synthetic section is appended.
23
- *
24
- * Sort is deterministic: by `(weight, key)` — every host renders the same
25
- * order from the same registry state, so tests stay reproducible.
26
- */
27
- export function mergeNavSections(coreSections: readonly NavSection[]): readonly NavSection[] {
28
- const sectionMap = new Map<string, NavItem[]>();
29
- const sectionOrder: string[] = [];
30
-
31
- for (const section of coreSections) {
32
- const heading = section.heading ?? '';
33
- sectionOrder.push(heading);
34
- sectionMap.set(heading, [...section.items]);
35
- }
36
-
37
- for (const biome of biomeRegistry.list()) {
38
- for (const navItem of biome.navItems ?? []) {
39
- const heading = navItem.section ?? '';
40
- let bucket = sectionMap.get(heading);
41
- if (!bucket) {
42
- bucket = [];
43
- sectionOrder.push(heading);
44
- sectionMap.set(heading, bucket);
45
- }
46
- bucket.push({
47
- key: navItem.id,
48
- label: navItem.label,
49
- icon: navItem.icon,
50
- weight: navItem.weight,
51
- fromBiome: true,
52
- });
53
- }
54
- }
55
-
56
- return sectionOrder.map((heading) => ({
57
- heading: heading === '' ? undefined : heading,
58
- items: (sectionMap.get(heading) ?? []).slice().sort((a, b) => {
59
- const wa = a.weight ?? 100;
60
- const wb = b.weight ?? 100;
61
- if (wa !== wb) return wa - wb;
62
- return a.key.localeCompare(b.key);
63
- }),
64
- }));
65
- }
66
-
67
- /**
68
- * Build a `{ navKey: routePath }` map merging core feature-key→route entries
69
- * with biome nav-item route paths. Biome-contributed entries win over
70
- * core entries with the same key (intentional — biome authors who pick a
71
- * conflicting id are signalling override intent).
72
- */
73
- export function mergeFeatureRouteMap(
74
- coreFeatureRoutes: Readonly<Record<string, string>>,
75
- ): Record<string, string> {
76
- const out: Record<string, string> = { ...coreFeatureRoutes };
77
- for (const biome of biomeRegistry.list()) {
78
- for (const navItem of biome.navItems ?? []) {
79
- out[navItem.id] = navItem.route;
80
- }
81
- }
82
- return out;
83
- }