@almadar/ui 5.1.5 → 5.2.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.
@@ -58382,9 +58382,25 @@ function detectScreenSize(viewportWidth) {
58382
58382
  }
58383
58383
 
58384
58384
  // components/molecules/avl/avl-preview-converter.ts
58385
- var OVERVIEW_SPACING = 900;
58386
- var EXPANDED_SPACING_X = 900;
58387
- var EXPANDED_SPACING_Y = 600;
58385
+ var OVERVIEW_GAP_X = 160;
58386
+ var OVERVIEW_GAP_Y = 240;
58387
+ var EXPANDED_GAP_X = 160;
58388
+ var EXPANDED_GAP_Y = 240;
58389
+ var CARD_CHROME_Y = 120;
58390
+ function computeSpacing(screenSize = "wide") {
58391
+ const preset = SCREEN_SIZE_PRESETS[screenSize];
58392
+ return {
58393
+ x: preset.width + OVERVIEW_GAP_X,
58394
+ y: preset.minHeight + CARD_CHROME_Y + OVERVIEW_GAP_Y
58395
+ };
58396
+ }
58397
+ function computeExpandedSpacing(screenSize = "wide") {
58398
+ const preset = SCREEN_SIZE_PRESETS[screenSize];
58399
+ return {
58400
+ x: preset.width + EXPANDED_GAP_X,
58401
+ y: preset.minHeight + CARD_CHROME_Y + EXPANDED_GAP_Y
58402
+ };
58403
+ }
58388
58404
  function getOrbitals(schema) {
58389
58405
  return schema.orbitals ?? [];
58390
58406
  }
@@ -58573,12 +58589,13 @@ function extractTraitWires(orbitals, scope) {
58573
58589
  function findCrossLinks(orbitals) {
58574
58590
  return extractTraitWires(orbitals, "cross-orbital");
58575
58591
  }
58576
- function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint, orbitalStatus) {
58592
+ function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint, orbitalStatus, screenSize) {
58577
58593
  const orbitals = getOrbitals(schema);
58578
58594
  const nodes = [];
58579
58595
  const edges = [];
58580
58596
  const count = orbitals.length;
58581
58597
  const cols = layoutHint === "pipeline" ? count : Math.ceil(Math.sqrt(count));
58598
+ const spacing = computeSpacing(screenSize);
58582
58599
  for (let i = 0; i < orbitals.length; i++) {
58583
58600
  const orb = orbitals[i];
58584
58601
  const entityInfo = getEntityInfo(orb);
@@ -58638,7 +58655,7 @@ function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint, orbit
58638
58655
  nodes.push({
58639
58656
  id: orb.name,
58640
58657
  type: "preview",
58641
- position: { x: col * OVERVIEW_SPACING, y: row * OVERVIEW_SPACING },
58658
+ position: { x: col * spacing.x, y: row * spacing.y },
58642
58659
  data: {
58643
58660
  orbitalName: orb.name,
58644
58661
  patterns: initPatterns,
@@ -58702,9 +58719,10 @@ function collectUITransitions(orbital, filter) {
58702
58719
  }
58703
58720
  return out;
58704
58721
  }
58705
- function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedBehaviors, mockData) {
58722
+ function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedBehaviors, mockData, screenSize) {
58706
58723
  const nodes = [];
58707
58724
  const edges = [];
58725
+ const spacing = computeExpandedSpacing(screenSize);
58708
58726
  const stateRepresentativeMap = /* @__PURE__ */ new Map();
58709
58727
  for (const entry of transitions) {
58710
58728
  const key = `${entry.traitName}:${entry.transition.to}`;
@@ -58730,7 +58748,7 @@ function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedB
58730
58748
  nodes.push({
58731
58749
  id: nodeId,
58732
58750
  type: "preview",
58733
- position: { x: col * EXPANDED_SPACING_X, y: row * EXPANDED_SPACING_Y },
58751
+ position: { x: col * spacing.x, y: row * spacing.y },
58734
58752
  data: {
58735
58753
  orbitalName,
58736
58754
  traitName: entry.traitName,
@@ -58758,7 +58776,7 @@ function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedB
58758
58776
  nodes.push({
58759
58777
  id: nodeId,
58760
58778
  type: "preview",
58761
- position: { x: col * EXPANDED_SPACING_X, y: row * EXPANDED_SPACING_Y },
58779
+ position: { x: col * spacing.x, y: row * spacing.y },
58762
58780
  data: {
58763
58781
  orbitalName,
58764
58782
  traitName: group.representative.traitName,
@@ -58813,7 +58831,7 @@ function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedB
58813
58831
  }
58814
58832
  return { nodes, edges };
58815
58833
  }
58816
- function orbitalToExpandedGraph(schema, orbitalName, mockData) {
58834
+ function orbitalToExpandedGraph(schema, orbitalName, mockData, screenSize) {
58817
58835
  const orbital = getOrbitals(schema).find((o) => o.name === orbitalName);
58818
58836
  if (!orbital) return { nodes: [], edges: [] };
58819
58837
  const entityInfo = getEntityInfo(orbital);
@@ -58853,10 +58871,11 @@ function orbitalToExpandedGraph(schema, orbitalName, mockData) {
58853
58871
  entityInfo.name,
58854
58872
  organismTransitions,
58855
58873
  groupedBehaviors,
58856
- mockData
58874
+ mockData,
58875
+ screenSize
58857
58876
  );
58858
58877
  }
58859
- function orbitalAliasToExpandedGraph(schema, orbitalName, alias, mockData) {
58878
+ function orbitalAliasToExpandedGraph(schema, orbitalName, alias, mockData, screenSize) {
58860
58879
  const orbital = getOrbitals(schema).find((o) => o.name === orbitalName);
58861
58880
  if (!orbital) return { nodes: [], edges: [] };
58862
58881
  const entityInfo = getEntityInfo(orbital);
@@ -58870,7 +58889,8 @@ function orbitalAliasToExpandedGraph(schema, orbitalName, alias, mockData) {
58870
58889
  entityInfo.name,
58871
58890
  transitions,
58872
58891
  [],
58873
- mockData
58892
+ mockData,
58893
+ screenSize
58874
58894
  );
58875
58895
  }
58876
58896
  var TRAIT_CARD_SPACING_X = 480;
@@ -63489,9 +63509,9 @@ function FlowCanvasInner({
63489
63509
  const { composeNodes, composeEdges, overviewNodes, overviewEdges, expandedNodes, expandedEdges, behaviorExpandedNodes, behaviorExpandedEdges, traitExpandedNodes, traitExpandedEdges } = React98.useMemo(() => {
63490
63510
  const t = perfStart("compose-graph");
63491
63511
  const compose = composeLevel === "behavior" && behaviorEntries?.length ? behaviorsToComposeGraph(behaviorEntries, behaviorWires ?? [], layoutHint) : { nodes: [], edges: [] };
63492
- const overview = schemaToOverviewGraph(parsedSchema, mockData, behaviorMeta, layoutHint, orbitalStatus);
63493
- const expanded = expandedOrbital ? orbitalToExpandedGraph(parsedSchema, expandedOrbital, mockData) : { nodes: [], edges: [] };
63494
- const behaviorExpanded = expandedOrbital && expandedBehaviorAlias ? orbitalAliasToExpandedGraph(parsedSchema, expandedOrbital, expandedBehaviorAlias, mockData) : { nodes: [], edges: [] };
63512
+ const overview = schemaToOverviewGraph(parsedSchema, mockData, behaviorMeta, layoutHint, orbitalStatus, screenSize);
63513
+ const expanded = expandedOrbital ? orbitalToExpandedGraph(parsedSchema, expandedOrbital, mockData, screenSize) : { nodes: [], edges: [] };
63514
+ const behaviorExpanded = expandedOrbital && expandedBehaviorAlias ? orbitalAliasToExpandedGraph(parsedSchema, expandedOrbital, expandedBehaviorAlias, mockData, screenSize) : { nodes: [], edges: [] };
63495
63515
  const traitExpanded = expandedOrbital ? orbitalToTraitGraph(parsedSchema, expandedOrbital) : { nodes: [], edges: [] };
63496
63516
  perfEnd("compose-graph", t, {
63497
63517
  composeNodes: compose.nodes.length,
@@ -63513,7 +63533,7 @@ function FlowCanvasInner({
63513
63533
  traitExpandedNodes: traitExpanded.nodes,
63514
63534
  traitExpandedEdges: traitExpanded.edges
63515
63535
  };
63516
- }, [parsedSchema, expandedOrbital, expandedBehaviorAlias, behaviorMeta, layoutHint, composeLevel, behaviorEntries, behaviorWires, mockData, orbitalStatus]);
63536
+ }, [parsedSchema, expandedOrbital, expandedBehaviorAlias, behaviorMeta, layoutHint, composeLevel, behaviorEntries, behaviorWires, mockData, orbitalStatus, screenSize]);
63517
63537
  const activeNodes = atBehaviorLevel && composeNodes.length > 0 ? composeNodes : level === "overview" ? overviewNodes : level === "behavior-expanded" ? behaviorExpandedNodes : level === "trait-expanded" ? traitExpandedNodes : expandedNodes;
63518
63538
  const activeEdges = atBehaviorLevel && composeEdges.length > 0 ? composeEdges : level === "overview" ? overviewEdges : level === "behavior-expanded" ? behaviorExpandedEdges : level === "trait-expanded" ? traitExpandedEdges : expandedEdges;
63519
63539
  const [nodes, setNodes, onNodesChange] = react.useNodesState(activeNodes);
@@ -63524,7 +63544,7 @@ function FlowCanvasInner({
63524
63544
  setNodes(activeNodes);
63525
63545
  setEdges(activeEdges);
63526
63546
  requestAnimationFrame(() => {
63527
- reactFlow.fitView({ duration: 300, padding: 0.15 });
63547
+ reactFlow.fitView({ duration: 300, padding: 0.25 });
63528
63548
  });
63529
63549
  }, [activeNodes, activeEdges, setNodes, setEdges, reactFlow]);
63530
63550
  const visibleEdges = React98.useMemo(() => {
@@ -63705,7 +63725,7 @@ function FlowCanvasInner({
63705
63725
  minZoom: 0.1,
63706
63726
  maxZoom: 2,
63707
63727
  fitView: true,
63708
- fitViewOptions: { padding: 0.15 },
63728
+ fitViewOptions: { padding: 0.25 },
63709
63729
  nodesDraggable: true,
63710
63730
  elementsSelectable: true,
63711
63731
  proOptions: { hideAttribution: true },
@@ -63762,7 +63782,7 @@ function FlowCanvasInner({
63762
63782
  onClick: () => {
63763
63783
  pickScreenSize(size);
63764
63784
  requestAnimationFrame(() => {
63765
- reactFlow.fitView({ duration: 300, padding: 0.15 });
63785
+ reactFlow.fitView({ duration: 300, padding: 0.25 });
63766
63786
  });
63767
63787
  },
63768
63788
  className: `px-2 py-1 text-[11px] font-medium rounded cursor-pointer border-none transition-colors ${active ? "bg-primary text-primary-foreground" : "bg-transparent text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,
@@ -846,6 +846,22 @@ declare const AvlBindingEdge: React__default.FC<EdgeProps>;
846
846
  * from the L1 grid. Not used by the canvas tab today.
847
847
  */
848
848
  type ViewLevel = 'overview' | 'expanded' | 'behavior-expanded' | 'trait-expanded';
849
+ /**
850
+ * Screen size preset for OrbPreview rendering inside nodes.
851
+ *
852
+ * Aligned with the four-breakpoint responsiveness audit:
853
+ * mobile — phone portrait (≤640px)
854
+ * tablet — iPad / small landscape (641–1024px)
855
+ * laptop — 13–15" notebook (1025–1440px)
856
+ * wide — desktop / monitor (≥1441px)
857
+ *
858
+ * Preset widths are representative viewport widths within each range; the
859
+ * preview renders at exactly this width so the embedded UI experiences
860
+ * the same media-query / container-query behavior it would at the real
861
+ * viewport. `minHeight` only floors the preview frame; vertical sizing is
862
+ * content-driven (BrowserPlayground height="auto").
863
+ */
864
+ type ScreenSize = 'mobile' | 'tablet' | 'laptop' | 'wide';
849
865
  /**
850
866
  * An interactive element inside a render-ui pattern that fires an event.
851
867
  * For example, a button with `event: "CHECKOUT"` is an event source.
@@ -1041,7 +1057,7 @@ interface EventEdgeData extends Record<string, unknown> {
1041
1057
  */
1042
1058
  declare function schemaToOverviewGraph(schema: OrbitalSchema, mockData?: Record<string, unknown[]>, behaviorMeta?: Record<string, {
1043
1059
  layer: string;
1044
- }>, layoutHint?: 'pipeline' | 'grid', orbitalStatus?: Record<string, PreviewNodeData['status']>): {
1060
+ }>, layoutHint?: 'pipeline' | 'grid', orbitalStatus?: Record<string, PreviewNodeData['status']>, screenSize?: ScreenSize): {
1045
1061
  nodes: Node<PreviewNodeData>[];
1046
1062
  edges: Edge<EventEdgeData>[];
1047
1063
  };
@@ -1056,7 +1072,7 @@ declare function schemaToOverviewGraph(schema: OrbitalSchema, mockData?: Record<
1056
1072
  * anonymous `INIT` peers (STUDIO-1). Drill into a grouped card to reach
1057
1073
  * L3 (`orbitalAliasToExpandedGraph`).
1058
1074
  */
1059
- declare function orbitalToExpandedGraph(schema: OrbitalSchema, orbitalName: string, mockData?: Record<string, unknown[]>): {
1075
+ declare function orbitalToExpandedGraph(schema: OrbitalSchema, orbitalName: string, mockData?: Record<string, unknown[]>, screenSize?: ScreenSize): {
1060
1076
  nodes: Node<PreviewNodeData>[];
1061
1077
  edges: Edge<EventEdgeData>[];
1062
1078
  };
package/dist/avl/index.js CHANGED
@@ -58333,9 +58333,25 @@ function detectScreenSize(viewportWidth) {
58333
58333
  }
58334
58334
 
58335
58335
  // components/molecules/avl/avl-preview-converter.ts
58336
- var OVERVIEW_SPACING = 900;
58337
- var EXPANDED_SPACING_X = 900;
58338
- var EXPANDED_SPACING_Y = 600;
58336
+ var OVERVIEW_GAP_X = 160;
58337
+ var OVERVIEW_GAP_Y = 240;
58338
+ var EXPANDED_GAP_X = 160;
58339
+ var EXPANDED_GAP_Y = 240;
58340
+ var CARD_CHROME_Y = 120;
58341
+ function computeSpacing(screenSize = "wide") {
58342
+ const preset = SCREEN_SIZE_PRESETS[screenSize];
58343
+ return {
58344
+ x: preset.width + OVERVIEW_GAP_X,
58345
+ y: preset.minHeight + CARD_CHROME_Y + OVERVIEW_GAP_Y
58346
+ };
58347
+ }
58348
+ function computeExpandedSpacing(screenSize = "wide") {
58349
+ const preset = SCREEN_SIZE_PRESETS[screenSize];
58350
+ return {
58351
+ x: preset.width + EXPANDED_GAP_X,
58352
+ y: preset.minHeight + CARD_CHROME_Y + EXPANDED_GAP_Y
58353
+ };
58354
+ }
58339
58355
  function getOrbitals(schema) {
58340
58356
  return schema.orbitals ?? [];
58341
58357
  }
@@ -58524,12 +58540,13 @@ function extractTraitWires(orbitals, scope) {
58524
58540
  function findCrossLinks(orbitals) {
58525
58541
  return extractTraitWires(orbitals, "cross-orbital");
58526
58542
  }
58527
- function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint, orbitalStatus) {
58543
+ function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint, orbitalStatus, screenSize) {
58528
58544
  const orbitals = getOrbitals(schema);
58529
58545
  const nodes = [];
58530
58546
  const edges = [];
58531
58547
  const count = orbitals.length;
58532
58548
  const cols = layoutHint === "pipeline" ? count : Math.ceil(Math.sqrt(count));
58549
+ const spacing = computeSpacing(screenSize);
58533
58550
  for (let i = 0; i < orbitals.length; i++) {
58534
58551
  const orb = orbitals[i];
58535
58552
  const entityInfo = getEntityInfo(orb);
@@ -58589,7 +58606,7 @@ function schemaToOverviewGraph(schema, mockData, behaviorMeta, layoutHint, orbit
58589
58606
  nodes.push({
58590
58607
  id: orb.name,
58591
58608
  type: "preview",
58592
- position: { x: col * OVERVIEW_SPACING, y: row * OVERVIEW_SPACING },
58609
+ position: { x: col * spacing.x, y: row * spacing.y },
58593
58610
  data: {
58594
58611
  orbitalName: orb.name,
58595
58612
  patterns: initPatterns,
@@ -58653,9 +58670,10 @@ function collectUITransitions(orbital, filter) {
58653
58670
  }
58654
58671
  return out;
58655
58672
  }
58656
- function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedBehaviors, mockData) {
58673
+ function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedBehaviors, mockData, screenSize) {
58657
58674
  const nodes = [];
58658
58675
  const edges = [];
58676
+ const spacing = computeExpandedSpacing(screenSize);
58659
58677
  const stateRepresentativeMap = /* @__PURE__ */ new Map();
58660
58678
  for (const entry of transitions) {
58661
58679
  const key = `${entry.traitName}:${entry.transition.to}`;
@@ -58681,7 +58699,7 @@ function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedB
58681
58699
  nodes.push({
58682
58700
  id: nodeId,
58683
58701
  type: "preview",
58684
- position: { x: col * EXPANDED_SPACING_X, y: row * EXPANDED_SPACING_Y },
58702
+ position: { x: col * spacing.x, y: row * spacing.y },
58685
58703
  data: {
58686
58704
  orbitalName,
58687
58705
  traitName: entry.traitName,
@@ -58709,7 +58727,7 @@ function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedB
58709
58727
  nodes.push({
58710
58728
  id: nodeId,
58711
58729
  type: "preview",
58712
- position: { x: col * EXPANDED_SPACING_X, y: row * EXPANDED_SPACING_Y },
58730
+ position: { x: col * spacing.x, y: row * spacing.y },
58713
58731
  data: {
58714
58732
  orbitalName,
58715
58733
  traitName: group.representative.traitName,
@@ -58764,7 +58782,7 @@ function buildScreenGraph(schema, orbitalName, entityName, transitions, groupedB
58764
58782
  }
58765
58783
  return { nodes, edges };
58766
58784
  }
58767
- function orbitalToExpandedGraph(schema, orbitalName, mockData) {
58785
+ function orbitalToExpandedGraph(schema, orbitalName, mockData, screenSize) {
58768
58786
  const orbital = getOrbitals(schema).find((o) => o.name === orbitalName);
58769
58787
  if (!orbital) return { nodes: [], edges: [] };
58770
58788
  const entityInfo = getEntityInfo(orbital);
@@ -58804,10 +58822,11 @@ function orbitalToExpandedGraph(schema, orbitalName, mockData) {
58804
58822
  entityInfo.name,
58805
58823
  organismTransitions,
58806
58824
  groupedBehaviors,
58807
- mockData
58825
+ mockData,
58826
+ screenSize
58808
58827
  );
58809
58828
  }
58810
- function orbitalAliasToExpandedGraph(schema, orbitalName, alias, mockData) {
58829
+ function orbitalAliasToExpandedGraph(schema, orbitalName, alias, mockData, screenSize) {
58811
58830
  const orbital = getOrbitals(schema).find((o) => o.name === orbitalName);
58812
58831
  if (!orbital) return { nodes: [], edges: [] };
58813
58832
  const entityInfo = getEntityInfo(orbital);
@@ -58821,7 +58840,8 @@ function orbitalAliasToExpandedGraph(schema, orbitalName, alias, mockData) {
58821
58840
  entityInfo.name,
58822
58841
  transitions,
58823
58842
  [],
58824
- mockData
58843
+ mockData,
58844
+ screenSize
58825
58845
  );
58826
58846
  }
58827
58847
  var TRAIT_CARD_SPACING_X = 480;
@@ -63440,9 +63460,9 @@ function FlowCanvasInner({
63440
63460
  const { composeNodes, composeEdges, overviewNodes, overviewEdges, expandedNodes, expandedEdges, behaviorExpandedNodes, behaviorExpandedEdges, traitExpandedNodes, traitExpandedEdges } = useMemo(() => {
63441
63461
  const t = perfStart("compose-graph");
63442
63462
  const compose = composeLevel === "behavior" && behaviorEntries?.length ? behaviorsToComposeGraph(behaviorEntries, behaviorWires ?? [], layoutHint) : { nodes: [], edges: [] };
63443
- const overview = schemaToOverviewGraph(parsedSchema, mockData, behaviorMeta, layoutHint, orbitalStatus);
63444
- const expanded = expandedOrbital ? orbitalToExpandedGraph(parsedSchema, expandedOrbital, mockData) : { nodes: [], edges: [] };
63445
- const behaviorExpanded = expandedOrbital && expandedBehaviorAlias ? orbitalAliasToExpandedGraph(parsedSchema, expandedOrbital, expandedBehaviorAlias, mockData) : { nodes: [], edges: [] };
63463
+ const overview = schemaToOverviewGraph(parsedSchema, mockData, behaviorMeta, layoutHint, orbitalStatus, screenSize);
63464
+ const expanded = expandedOrbital ? orbitalToExpandedGraph(parsedSchema, expandedOrbital, mockData, screenSize) : { nodes: [], edges: [] };
63465
+ const behaviorExpanded = expandedOrbital && expandedBehaviorAlias ? orbitalAliasToExpandedGraph(parsedSchema, expandedOrbital, expandedBehaviorAlias, mockData, screenSize) : { nodes: [], edges: [] };
63446
63466
  const traitExpanded = expandedOrbital ? orbitalToTraitGraph(parsedSchema, expandedOrbital) : { nodes: [], edges: [] };
63447
63467
  perfEnd("compose-graph", t, {
63448
63468
  composeNodes: compose.nodes.length,
@@ -63464,7 +63484,7 @@ function FlowCanvasInner({
63464
63484
  traitExpandedNodes: traitExpanded.nodes,
63465
63485
  traitExpandedEdges: traitExpanded.edges
63466
63486
  };
63467
- }, [parsedSchema, expandedOrbital, expandedBehaviorAlias, behaviorMeta, layoutHint, composeLevel, behaviorEntries, behaviorWires, mockData, orbitalStatus]);
63487
+ }, [parsedSchema, expandedOrbital, expandedBehaviorAlias, behaviorMeta, layoutHint, composeLevel, behaviorEntries, behaviorWires, mockData, orbitalStatus, screenSize]);
63468
63488
  const activeNodes = atBehaviorLevel && composeNodes.length > 0 ? composeNodes : level === "overview" ? overviewNodes : level === "behavior-expanded" ? behaviorExpandedNodes : level === "trait-expanded" ? traitExpandedNodes : expandedNodes;
63469
63489
  const activeEdges = atBehaviorLevel && composeEdges.length > 0 ? composeEdges : level === "overview" ? overviewEdges : level === "behavior-expanded" ? behaviorExpandedEdges : level === "trait-expanded" ? traitExpandedEdges : expandedEdges;
63470
63490
  const [nodes, setNodes, onNodesChange] = useNodesState(activeNodes);
@@ -63475,7 +63495,7 @@ function FlowCanvasInner({
63475
63495
  setNodes(activeNodes);
63476
63496
  setEdges(activeEdges);
63477
63497
  requestAnimationFrame(() => {
63478
- reactFlow.fitView({ duration: 300, padding: 0.15 });
63498
+ reactFlow.fitView({ duration: 300, padding: 0.25 });
63479
63499
  });
63480
63500
  }, [activeNodes, activeEdges, setNodes, setEdges, reactFlow]);
63481
63501
  const visibleEdges = useMemo(() => {
@@ -63656,7 +63676,7 @@ function FlowCanvasInner({
63656
63676
  minZoom: 0.1,
63657
63677
  maxZoom: 2,
63658
63678
  fitView: true,
63659
- fitViewOptions: { padding: 0.15 },
63679
+ fitViewOptions: { padding: 0.25 },
63660
63680
  nodesDraggable: true,
63661
63681
  elementsSelectable: true,
63662
63682
  proOptions: { hideAttribution: true },
@@ -63713,7 +63733,7 @@ function FlowCanvasInner({
63713
63733
  onClick: () => {
63714
63734
  pickScreenSize(size);
63715
63735
  requestAnimationFrame(() => {
63716
- reactFlow.fitView({ duration: 300, padding: 0.15 });
63736
+ reactFlow.fitView({ duration: 300, padding: 0.25 });
63717
63737
  });
63718
63738
  },
63719
63739
  className: `px-2 py-1 text-[11px] font-medium rounded cursor-pointer border-none transition-colors ${active ? "bg-primary text-primary-foreground" : "bg-transparent text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,
@@ -14,14 +14,14 @@
14
14
  */
15
15
  import type { Node, Edge } from '@xyflow/react';
16
16
  import type { OrbitalSchema } from '@almadar/core';
17
- import type { PreviewNodeData, EventEdgeData } from './avl-preview-types';
17
+ import type { PreviewNodeData, EventEdgeData, ScreenSize } from './avl-preview-types';
18
18
  /**
19
19
  * Build a React Flow graph for the overview level.
20
20
  * Each orbital gets one node showing its INIT transition's UI.
21
21
  */
22
22
  export declare function schemaToOverviewGraph(schema: OrbitalSchema, mockData?: Record<string, unknown[]>, behaviorMeta?: Record<string, {
23
23
  layer: string;
24
- }>, layoutHint?: 'pipeline' | 'grid', orbitalStatus?: Record<string, PreviewNodeData['status']>): {
24
+ }>, layoutHint?: 'pipeline' | 'grid', orbitalStatus?: Record<string, PreviewNodeData['status']>, screenSize?: ScreenSize): {
25
25
  nodes: Node<PreviewNodeData>[];
26
26
  edges: Edge<EventEdgeData>[];
27
27
  };
@@ -36,7 +36,7 @@ export declare function schemaToOverviewGraph(schema: OrbitalSchema, mockData?:
36
36
  * anonymous `INIT` peers (STUDIO-1). Drill into a grouped card to reach
37
37
  * L3 (`orbitalAliasToExpandedGraph`).
38
38
  */
39
- export declare function orbitalToExpandedGraph(schema: OrbitalSchema, orbitalName: string, mockData?: Record<string, unknown[]>): {
39
+ export declare function orbitalToExpandedGraph(schema: OrbitalSchema, orbitalName: string, mockData?: Record<string, unknown[]>, screenSize?: ScreenSize): {
40
40
  nodes: Node<PreviewNodeData>[];
41
41
  edges: Edge<EventEdgeData>[];
42
42
  };
@@ -47,7 +47,7 @@ export declare function orbitalToExpandedGraph(schema: OrbitalSchema, orbitalNam
47
47
  * `orbitalToExpandedGraph` but scoped to traits where
48
48
  * `sourceBehavior.alias === alias`. STUDIO-1.
49
49
  */
50
- export declare function orbitalAliasToExpandedGraph(schema: OrbitalSchema, orbitalName: string, alias: string, mockData?: Record<string, unknown[]>): {
50
+ export declare function orbitalAliasToExpandedGraph(schema: OrbitalSchema, orbitalName: string, alias: string, mockData?: Record<string, unknown[]>, screenSize?: ScreenSize): {
51
51
  nodes: Node<PreviewNodeData>[];
52
52
  edges: Edge<EventEdgeData>[];
53
53
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "5.1.5",
3
+ "version": "5.2.0",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -0,0 +1,124 @@
1
+ /**
2
+ * _base.css — Shared Typography + Density base
3
+ *
4
+ * Lifted from `atelier.css` so the editorial type rhythm and generous
5
+ * 10pt spacing scale are the default across every theme that doesn't
6
+ * deliberately opt out. Themes can still override any token by declaring
7
+ * it in their own [data-theme="..."] block — that selector is more
8
+ * specific than :root and wins via the CSS cascade.
9
+ *
10
+ * Personality themes that DO opt out today (keep their own typography
11
+ * and/or density): terminal (monospace), wireframe (chunky), neon (tight
12
+ * glow), kiosk (oversized), gazette (serif), minimalist (compact),
13
+ * trait-wars (gamer). All others inherit from this file.
14
+ *
15
+ * Loaded FIRST in themes/index.css so individual theme blocks override
16
+ * cleanly. The contract reference is `themes/_contract.md`.
17
+ */
18
+ :root {
19
+ /* ----------------------------------------------------------------
20
+ * Typography
21
+ * ----------------------------------------------------------------
22
+ * Inter for body + UI, JetBrains Mono for code, optional display
23
+ * family for hero numerics. Mid-weight 500 reads as confident but
24
+ * not heavy; tight letter-spacing + 1.625 line-height give the
25
+ * editorial feel.
26
+ */
27
+ --font-family:
28
+ "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
29
+ --font-family-display:
30
+ "Söhne", "Inter Display", -apple-system, BlinkMacSystemFont, sans-serif;
31
+ --font-family-body:
32
+ "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
33
+ --font-family-mono:
34
+ "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
35
+
36
+ --font-weight-normal: 400;
37
+ --font-weight-medium: 500;
38
+ --font-weight-bold: 700;
39
+ --letter-spacing: -0.02em;
40
+ --line-height: 1.625;
41
+
42
+ /* Type scale */
43
+ --text-xs: 12px;
44
+ --leading-xs: 18px;
45
+ --text-sm: 14px;
46
+ --leading-sm: 22px;
47
+ --text-base: 16px;
48
+ --leading-base: 26px;
49
+ --text-lg: 20px;
50
+ --leading-lg: 30px;
51
+ --text-xl: 24px;
52
+ --leading-xl: 32px;
53
+ --text-2xl: 32px;
54
+ --leading-2xl: 38px;
55
+ --text-3xl: 40px;
56
+ --leading-3xl: 44px;
57
+ --text-4xl: 52px;
58
+ --leading-4xl: 56px;
59
+ --text-display-1: 64px;
60
+ --leading-display-1: 68px;
61
+ --text-display-2: 80px;
62
+ --leading-display-2: 84px;
63
+
64
+ /* Intent mapping — what component variants resolve to. */
65
+ --intent-heading-major-size: var(--text-3xl);
66
+ --intent-heading-major-weight: var(--font-weight-bold);
67
+ --intent-heading-major-leading: var(--leading-3xl);
68
+ --intent-heading-minor-size: var(--text-xl);
69
+ --intent-heading-minor-weight: var(--font-weight-bold);
70
+ --intent-heading-minor-leading: var(--leading-xl);
71
+ --intent-body-emphasis-size: var(--text-base);
72
+ --intent-body-emphasis-weight: var(--font-weight-medium);
73
+ --intent-body-emphasis-leading: var(--leading-base);
74
+ --intent-body-default-size: var(--text-base);
75
+ --intent-body-default-weight: var(--font-weight-normal);
76
+ --intent-body-default-leading: var(--leading-base);
77
+ --intent-body-quiet-size: var(--text-sm);
78
+ --intent-body-quiet-weight: var(--font-weight-normal);
79
+ --intent-body-quiet-leading: var(--leading-sm);
80
+ --intent-caption-size: var(--text-xs);
81
+ --intent-caption-weight: var(--font-weight-medium);
82
+ --intent-caption-leading: var(--leading-xs);
83
+ --intent-numeric-size: var(--text-4xl);
84
+ --intent-numeric-weight: var(--font-weight-bold);
85
+ --intent-numeric-leading: var(--leading-4xl);
86
+ --intent-numeric-family: var(--font-family-display);
87
+
88
+ /* ----------------------------------------------------------------
89
+ * Density — generous 10pt rhythm
90
+ * ----------------------------------------------------------------
91
+ * Slightly larger than Tailwind defaults so cards / dialogs / rows
92
+ * read as airy without feeling sparse. Per-element heights tuned to
93
+ * comfortable click targets (44px md is also the iOS HIG minimum).
94
+ */
95
+ --space-0: 0px;
96
+ --space-1: 4px;
97
+ --space-2: 6px;
98
+ --space-3: 10px;
99
+ --space-4: 14px;
100
+ --space-5: 20px;
101
+ --space-6: 28px;
102
+ --space-7: 36px;
103
+ --space-8: 44px;
104
+ --space-9: 52px;
105
+ --space-10: 60px;
106
+ --space-11: 68px;
107
+ --space-12: 80px;
108
+
109
+ --button-height-sm: 36px;
110
+ --button-height-md: 44px;
111
+ --button-height-lg: 56px;
112
+ --input-height-sm: 36px;
113
+ --input-height-md: 44px;
114
+ --input-height-lg: 56px;
115
+ --row-height-compact: 48px;
116
+ --row-height-normal: 64px;
117
+ --row-height-spacious: 80px;
118
+
119
+ --card-padding-sm: 20px;
120
+ --card-padding-md: 28px;
121
+ --card-padding-lg: 40px;
122
+ --dialog-padding: 40px;
123
+ --section-gap: 64px;
124
+ }