@almadar/ui 6.28.0 → 6.30.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 (54) hide show
  1. package/dist/{EntityBindingContext-C6FgxdfG.d.cts → EntityBindingContext-ChCONv2W.d.cts} +3 -39
  2. package/dist/{EntityBindingContext-C6FgxdfG.d.ts → EntityBindingContext-ChCONv2W.d.ts} +3 -39
  3. package/dist/avl/index.cjs +74 -48
  4. package/dist/avl/index.js +74 -48
  5. package/dist/components/index.cjs +54 -45
  6. package/dist/components/index.d.cts +1 -1
  7. package/dist/components/index.d.ts +1 -1
  8. package/dist/components/index.js +54 -45
  9. package/dist/context/index.cjs +135 -105
  10. package/dist/context/index.d.cts +2 -60
  11. package/dist/context/index.d.ts +2 -60
  12. package/dist/context/index.js +135 -105
  13. package/dist/lib/index.cjs +455 -0
  14. package/dist/lib/index.d.cts +42 -1
  15. package/dist/lib/index.d.ts +42 -1
  16. package/dist/lib/index.js +438 -1
  17. package/dist/marketing/index.cjs +4 -5
  18. package/dist/marketing/index.js +4 -5
  19. package/dist/providers/index.cjs +194 -156
  20. package/dist/providers/index.d.cts +1 -1
  21. package/dist/providers/index.d.ts +1 -1
  22. package/dist/providers/index.js +194 -156
  23. package/dist/runtime/index.cjs +74 -48
  24. package/dist/runtime/index.d.cts +16 -2
  25. package/dist/runtime/index.d.ts +16 -2
  26. package/dist/runtime/index.js +74 -48
  27. package/dist/themeTokens-DVRwufw8.d.cts +112 -0
  28. package/dist/themeTokens-DVRwufw8.d.ts +112 -0
  29. package/package.json +7 -6
  30. package/scripts/audit-tailwind-safelist.ts +4 -0
  31. package/tailwind-preset.cjs +155 -28
  32. package/themes/almadar-website.css +37 -107
  33. package/themes/almadar.css +37 -108
  34. package/themes/atelier.css +145 -240
  35. package/themes/bloomberg-dense.css +145 -252
  36. package/themes/clay.css +39 -137
  37. package/themes/comic.css +39 -145
  38. package/themes/corporate.css +39 -131
  39. package/themes/game-adventure.css +22 -87
  40. package/themes/game-rpg.css +22 -84
  41. package/themes/game-sci-fi.css +22 -88
  42. package/themes/game-ui-pack.css +22 -85
  43. package/themes/gazette.css +43 -135
  44. package/themes/glass.css +39 -148
  45. package/themes/kiosk.css +51 -146
  46. package/themes/linear-clean.css +145 -215
  47. package/themes/minimalist.css +39 -125
  48. package/themes/neon.css +39 -132
  49. package/themes/notion-editorial.css +145 -215
  50. package/themes/prism.css +37 -100
  51. package/themes/retro.css +39 -130
  52. package/themes/terminal.css +61 -152
  53. package/themes/trait-wars.css +121 -285
  54. package/themes/wireframe.css +41 -128
@@ -2263,6 +2263,13 @@ var init_slot_types = __esm({
2263
2263
  nextRefId = 1;
2264
2264
  }
2265
2265
  });
2266
+ var SlotContainedContext;
2267
+ var init_slotContained = __esm({
2268
+ "lib/slotContained.ts"() {
2269
+ "use client";
2270
+ SlotContainedContext = createContext(false);
2271
+ }
2272
+ });
2266
2273
  function buildForkPaths(x, y, branches, scale) {
2267
2274
  const inLength = 30 * scale;
2268
2275
  const outLength = 30 * scale;
@@ -13782,11 +13789,10 @@ var init_HeroSection = __esm({
13782
13789
  };
13783
13790
  backgroundStyles = {
13784
13791
  dark: "bg-foreground text-background",
13785
- gradient: [
13786
- "bg-[radial-gradient(ellipse_at_top,var(--color-primary)/0.08,transparent_60%),",
13787
- "radial-gradient(ellipse_at_bottom_right,var(--color-accent)/0.06,transparent_50%)]",
13788
- "bg-background"
13789
- ].join(" "),
13792
+ // A single bracket value: joining this as two array entries put a space
13793
+ // inside the class (Tailwind splits utilities on whitespace), so neither
13794
+ // half was a valid utility and the gradient rendered as nothing.
13795
+ gradient: "bg-[radial-gradient(ellipse_at_top,var(--color-primary)/0.08,transparent_60%),radial-gradient(ellipse_at_bottom_right,var(--color-accent)/0.06,transparent_50%)] bg-background",
13790
13796
  subtle: "bg-muted/30"
13791
13797
  };
13792
13798
  MarketingImage = ({ src, alt, className }) => /* @__PURE__ */ jsx(
@@ -35845,7 +35851,6 @@ function TableView({
35845
35851
  columns,
35846
35852
  fields,
35847
35853
  itemActions,
35848
- maxInlineActions,
35849
35854
  itemClickEvent = "",
35850
35855
  selectable = false,
35851
35856
  selectEvent,
@@ -35879,8 +35884,7 @@ function TableView({
35879
35884
  const [localSelected, setLocalSelected] = React89__default.useState(/* @__PURE__ */ new Set());
35880
35885
  const colDefs = (Array.isArray(columns) ? columns : void 0) ?? (Array.isArray(fields) ? fields : void 0) ?? [];
35881
35886
  const actionDefs = Array.isArray(itemActions) ? itemActions : [];
35882
- const inlineActions = maxInlineActions != null ? actionDefs.slice(0, maxInlineActions) : [];
35883
- const overflowActions = maxInlineActions != null ? actionDefs.slice(maxInlineActions) : actionDefs;
35887
+ const overflowActions = actionDefs;
35884
35888
  const fireAction = (action, row) => eventBus.emit(`UI:${action.event}`, {
35885
35889
  id: row.id,
35886
35890
  row
@@ -36062,7 +36066,7 @@ function TableView({
36062
36066
  }
36063
36067
  return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx("span", { className: "truncate text-foreground", children: formatCell(raw, col.format, relationsData?.[col.field ?? col.key]) }) }, col.key);
36064
36068
  }),
36065
- hasActions && /* @__PURE__ */ jsxs(
36069
+ hasActions && /* @__PURE__ */ jsx(
36066
36070
  HStack,
36067
36071
  {
36068
36072
  gap: "xs",
@@ -36076,38 +36080,20 @@ function TableView({
36076
36080
  "border-l border-[var(--color-border)]",
36077
36081
  lk.striped && index % 2 === 1 ? "bg-[var(--color-surface-subtle)]" : "bg-[var(--color-card)] group-hover:bg-[var(--color-surface-subtle)]"
36078
36082
  ),
36079
- children: [
36080
- inlineActions.map((action) => /* @__PURE__ */ jsxs(
36081
- Button,
36082
- {
36083
- variant: action.variant ?? "ghost",
36084
- size: "sm",
36085
- onClick: () => fireAction(action, row),
36086
- "data-testid": `action-${action.event}`,
36087
- "data-row-id": String(row.id),
36088
- className: cn(action.variant === "danger" && "text-error hover:bg-error/10"),
36089
- children: [
36090
- action.icon && renderIconInput3(action.icon, { size: "xs", className: "mr-1" }),
36091
- action.label
36092
- ]
36093
- },
36094
- action.event
36095
- )),
36096
- overflowActions.length > 0 && /* @__PURE__ */ jsx(
36097
- Menu,
36098
- {
36099
- position: "bottom-end",
36100
- trigger: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", "data-row-id": String(row.id), children: /* @__PURE__ */ jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
36101
- items: overflowActions.map((action) => ({
36102
- label: action.label,
36103
- icon: action.icon,
36104
- event: action.event,
36105
- variant: action.variant === "danger" ? "danger" : "default",
36106
- onClick: () => fireAction(action, row)
36107
- }))
36108
- }
36109
- )
36110
- ]
36083
+ children: overflowActions.length > 0 && /* @__PURE__ */ jsx(
36084
+ Menu,
36085
+ {
36086
+ position: "bottom-end",
36087
+ trigger: /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", "aria-label": t("common.actions"), "data-testid": "action-overflow", "data-row-id": String(row.id), children: /* @__PURE__ */ jsx(Icon, { name: "more-horizontal", size: "xs" }) }),
36088
+ items: overflowActions.map((action) => ({
36089
+ label: action.label,
36090
+ icon: action.icon,
36091
+ event: action.event,
36092
+ variant: action.variant === "danger" ? "danger" : "default",
36093
+ onClick: () => fireAction(action, row)
36094
+ }))
36095
+ }
36096
+ )
36111
36097
  }
36112
36098
  )
36113
36099
  ]
@@ -45533,6 +45519,7 @@ var init_DetailPanel = __esm({
45533
45519
  init_EmptyState();
45534
45520
  init_cn();
45535
45521
  init_portalRoot();
45522
+ init_slotContained();
45536
45523
  init_format();
45537
45524
  init_getNestedValue();
45538
45525
  init_relationLabel();
@@ -45564,6 +45551,7 @@ var init_DetailPanel = __esm({
45564
45551
  }) => {
45565
45552
  const eventBus = useEventBus();
45566
45553
  const { t } = useTranslate();
45554
+ const contained = useContext(SlotContainedContext);
45567
45555
  const [titleDraft, setTitleDraft] = React89__default.useState(null);
45568
45556
  const isFieldDefArray = (arr) => {
45569
45557
  if (!arr || arr.length === 0) return false;
@@ -45951,8 +45939,9 @@ var init_DetailPanel = __esm({
45951
45939
  if (!slideOver) {
45952
45940
  return /* @__PURE__ */ jsx(Box, { className, children: content });
45953
45941
  }
45954
- const panel = /* @__PURE__ */ jsx(Box, { className: cn("fixed inset-y-0 right-0 w-full max-w-2xl bg-card shadow-lg z-50 overflow-y-auto p-6", className), children: content });
45955
- return typeof document === "undefined" ? panel : createPortal(panel, getOrCreatePortalRoot());
45942
+ const panel = /* @__PURE__ */ jsx(Box, { className: cn(contained ? "absolute" : "fixed", "inset-y-0 right-0 w-full max-w-2xl bg-card shadow-lg z-50 overflow-y-auto p-6", className), children: content });
45943
+ if (contained || typeof document === "undefined") return panel;
45944
+ return createPortal(panel, getOrCreatePortalRoot());
45956
45945
  };
45957
45946
  DetailPanel.displayName = "DetailPanel";
45958
45947
  }
@@ -52430,6 +52419,7 @@ var init_component_registry_generated = __esm({
52430
52419
  // components/core/organisms/UISlotRenderer.tsx
52431
52420
  var UISlotRenderer_exports = {};
52432
52421
  __export(UISlotRenderer_exports, {
52422
+ SlotContainedContext: () => SlotContainedContext,
52433
52423
  SlotContentRenderer: () => SlotContentRenderer,
52434
52424
  SuspenseConfigProvider: () => SuspenseConfigProvider,
52435
52425
  UISlotComponent: () => UISlotComponent,
@@ -52602,6 +52592,25 @@ function renderContainedPortal(t, slot, content, onDismiss) {
52602
52592
  }
52603
52593
  );
52604
52594
  case "drawer":
52595
+ if (content.pattern === "detail-panel" && content.props.slideOver === true) {
52596
+ return /* @__PURE__ */ jsx(
52597
+ Box,
52598
+ {
52599
+ id: slotId,
52600
+ className: "absolute inset-0 z-50 overflow-hidden",
52601
+ style: { backgroundColor: "rgba(0, 0, 0, 0.5)" },
52602
+ onClick: onDismiss,
52603
+ children: /* @__PURE__ */ jsx(
52604
+ Box,
52605
+ {
52606
+ className: "absolute inset-y-0 right-0 pointer-events-auto",
52607
+ onClick: (e) => e.stopPropagation(),
52608
+ children: slotContent
52609
+ }
52610
+ )
52611
+ }
52612
+ );
52613
+ }
52605
52614
  return /* @__PURE__ */ jsx(
52606
52615
  Box,
52607
52616
  {
@@ -53453,7 +53462,7 @@ function UISlotRenderer({
53453
53462
  }
53454
53463
  return wrapped;
53455
53464
  }
53456
- var scopeWrapLog, TRAIT_BINDING_RE, SuspenseConfigContext, SlotContainedContext, SLOT_SKELETON_MAP, CONTENT_NODE_SLOTS, PATTERNS_WITH_CHILDREN, traitRefPresenceCache;
53465
+ var scopeWrapLog, TRAIT_BINDING_RE, SuspenseConfigContext, SLOT_SKELETON_MAP, CONTENT_NODE_SLOTS, PATTERNS_WITH_CHILDREN, traitRefPresenceCache;
53457
53466
  var init_UISlotRenderer = __esm({
53458
53467
  "components/core/organisms/UISlotRenderer.tsx"() {
53459
53468
  "use client";
@@ -53468,6 +53477,7 @@ var init_UISlotRenderer = __esm({
53468
53477
  init_cn();
53469
53478
  init_format();
53470
53479
  init_portalRoot();
53480
+ init_slotContained();
53471
53481
  init_ErrorBoundary();
53472
53482
  init_Skeleton();
53473
53483
  init_renderer();
@@ -53477,7 +53487,6 @@ var init_UISlotRenderer = __esm({
53477
53487
  scopeWrapLog = createLogger("almadar:ui:scope-wrap");
53478
53488
  TRAIT_BINDING_RE = /^@trait\.([A-Z][A-Za-z0-9]*)$/;
53479
53489
  SuspenseConfigContext = createContext({ enabled: false });
53480
- SlotContainedContext = createContext(false);
53481
53490
  SuspenseConfigProvider.displayName = "SuspenseConfigProvider";
53482
53491
  SLOT_SKELETON_MAP = {
53483
53492
  main: "table",
@@ -54113,17 +54122,127 @@ function OrbitalProvider({
54113
54122
  OrbitalProvider.displayName = "OrbitalProvider";
54114
54123
 
54115
54124
  // lib/themeTokens.ts
54125
+ function applyFlat(obj, table, vars) {
54126
+ if (!obj) return;
54127
+ for (const { cssVar, key } of table) {
54128
+ const value = obj[key];
54129
+ if (value !== void 0) vars[cssVar] = value;
54130
+ }
54131
+ }
54132
+ var DENSITY_SPACING_VARS = [
54133
+ { cssVar: "--space-0", key: "space0" },
54134
+ { cssVar: "--space-1", key: "space1" },
54135
+ { cssVar: "--space-2", key: "space2" },
54136
+ { cssVar: "--space-3", key: "space3" },
54137
+ { cssVar: "--space-4", key: "space4" },
54138
+ { cssVar: "--space-5", key: "space5" },
54139
+ { cssVar: "--space-6", key: "space6" },
54140
+ { cssVar: "--space-7", key: "space7" },
54141
+ { cssVar: "--space-8", key: "space8" },
54142
+ { cssVar: "--space-9", key: "space9" },
54143
+ { cssVar: "--space-10", key: "space10" },
54144
+ { cssVar: "--space-11", key: "space11" },
54145
+ { cssVar: "--space-12", key: "space12" }
54146
+ ];
54147
+ var DENSITY_ELEMENT_VARS = [
54148
+ { cssVar: "--button-height-sm", key: "buttonHeightSm" },
54149
+ { cssVar: "--button-height-md", key: "buttonHeightMd" },
54150
+ { cssVar: "--button-height-lg", key: "buttonHeightLg" },
54151
+ { cssVar: "--input-height-sm", key: "inputHeightSm" },
54152
+ { cssVar: "--input-height-md", key: "inputHeightMd" },
54153
+ { cssVar: "--input-height-lg", key: "inputHeightLg" },
54154
+ { cssVar: "--row-height-compact", key: "rowHeightCompact" },
54155
+ { cssVar: "--row-height-normal", key: "rowHeightNormal" },
54156
+ { cssVar: "--row-height-spacious", key: "rowHeightSpacious" },
54157
+ { cssVar: "--card-padding-sm", key: "cardPaddingSm" },
54158
+ { cssVar: "--card-padding-md", key: "cardPaddingMd" },
54159
+ { cssVar: "--card-padding-lg", key: "cardPaddingLg" },
54160
+ { cssVar: "--dialog-padding", key: "dialogPadding" },
54161
+ { cssVar: "--section-gap", key: "sectionGap" }
54162
+ ];
54163
+ var TYPE_FAMILY_VARS = [
54164
+ { cssVar: "--font-family-display", key: "displayFamily" },
54165
+ { cssVar: "--font-family-body", key: "bodyFamily" },
54166
+ { cssVar: "--font-family-mono", key: "monoFamily" }
54167
+ ];
54168
+ var TYPE_SIZE_KEYS = [
54169
+ "xs",
54170
+ "sm",
54171
+ "base",
54172
+ "lg",
54173
+ "xl",
54174
+ "2xl",
54175
+ "3xl",
54176
+ "4xl",
54177
+ "display-1",
54178
+ "display-2"
54179
+ ];
54180
+ var TYPE_INTENT_VARS = [
54181
+ { key: "headingMajor", cssName: "heading-major" },
54182
+ { key: "headingMinor", cssName: "heading-minor" },
54183
+ { key: "bodyEmphasis", cssName: "body-emphasis" },
54184
+ { key: "bodyDefault", cssName: "body-default" },
54185
+ { key: "bodyQuiet", cssName: "body-quiet" },
54186
+ { key: "caption", cssName: "caption" },
54187
+ { key: "numeric", cssName: "numeric" }
54188
+ ];
54189
+ var MOTION_DURATION_KEYS = [
54190
+ "instant",
54191
+ "fast",
54192
+ "normal",
54193
+ "slow",
54194
+ "dramatic"
54195
+ ];
54196
+ var MOTION_EASING_KEYS = [
54197
+ "linear",
54198
+ "standard",
54199
+ "emphasized",
54200
+ "spring"
54201
+ ];
54202
+ var MOTION_INTENT_VARS = [
54203
+ { key: "enter", cssName: "enter" },
54204
+ { key: "exit", cssName: "exit" },
54205
+ { key: "hover", cssName: "hover" },
54206
+ { key: "press", cssName: "press" },
54207
+ { key: "expand", cssName: "expand" },
54208
+ { key: "transition", cssName: "transition" }
54209
+ ];
54210
+ var ICONOGRAPHY_VARS = [
54211
+ { cssVar: "--icon-family", key: "family" },
54212
+ { cssVar: "--icon-stroke-width", key: "strokeWidth" },
54213
+ { cssVar: "--icon-default-size", key: "defaultSize" }
54214
+ ];
54215
+ var ELEVATION_VARS = [
54216
+ { cssVar: "--elevation-card", key: "cardElevation" },
54217
+ { cssVar: "--elevation-popover", key: "popoverElevation" },
54218
+ { cssVar: "--elevation-dialog", key: "dialogElevation" },
54219
+ { cssVar: "--elevation-toast", key: "toastElevation" }
54220
+ ];
54221
+ var GEOMETRY_VARS = [
54222
+ { cssVar: "--radius-container", key: "radiusContainer" },
54223
+ { cssVar: "--radius-interactive", key: "radiusInteractive" },
54224
+ { cssVar: "--radius-pill", key: "radiusPill" },
54225
+ { cssVar: "--border-hairline", key: "borderHairline" },
54226
+ { cssVar: "--border-standard", key: "borderStandard" },
54227
+ { cssVar: "--border-heavy", key: "borderHeavy" }
54228
+ ];
54229
+ var LEGACY_PREFIXES = {
54230
+ colors: "--color-",
54231
+ radii: "--radius-",
54232
+ spacing: "--space-",
54233
+ shadows: "--shadow-"
54234
+ };
54116
54235
  function themeTokensToCssVars(tokens, mode = "light", darkVariant) {
54117
54236
  const vars = {};
54118
54237
  const isDark = mode === "dark";
54119
54238
  const pickColors = isDark && darkVariant?.colors ? darkVariant.colors : tokens.colors;
54120
54239
  if (pickColors) {
54121
54240
  for (const [key, value] of Object.entries(pickColors)) {
54122
- vars[`--color-${key}`] = value;
54241
+ vars[`${LEGACY_PREFIXES.colors}${key}`] = value;
54123
54242
  }
54124
54243
  if (isDark && darkVariant?.colors && tokens.colors) {
54125
54244
  for (const [key, value] of Object.entries(tokens.colors)) {
54126
- const varName = `--color-${key}`;
54245
+ const varName = `${LEGACY_PREFIXES.colors}${key}`;
54127
54246
  if (!(varName in vars)) vars[varName] = value;
54128
54247
  }
54129
54248
  }
@@ -54131,13 +54250,13 @@ function themeTokensToCssVars(tokens, mode = "light", darkVariant) {
54131
54250
  const pickRadii = isDark && darkVariant?.radii ? darkVariant.radii : tokens.radii;
54132
54251
  if (pickRadii) {
54133
54252
  for (const [key, value] of Object.entries(pickRadii)) {
54134
- vars[`--radius-${key}`] = value;
54253
+ vars[`${LEGACY_PREFIXES.radii}${key}`] = value;
54135
54254
  }
54136
54255
  }
54137
54256
  const pickSpacing = isDark && darkVariant?.spacing ? darkVariant.spacing : tokens.spacing;
54138
54257
  if (pickSpacing) {
54139
54258
  for (const [key, value] of Object.entries(pickSpacing)) {
54140
- vars[`--space-${key}`] = value;
54259
+ vars[`${LEGACY_PREFIXES.spacing}${key}`] = value;
54141
54260
  }
54142
54261
  }
54143
54262
  const pickTypography = isDark && darkVariant?.typography ? darkVariant.typography : tokens.typography;
@@ -54149,7 +54268,7 @@ function themeTokensToCssVars(tokens, mode = "light", darkVariant) {
54149
54268
  const pickShadows = isDark && darkVariant?.shadows ? darkVariant.shadows : tokens.shadows;
54150
54269
  if (pickShadows) {
54151
54270
  for (const [key, value] of Object.entries(pickShadows)) {
54152
- vars[`--shadow-${key}`] = value;
54271
+ vars[`${LEGACY_PREFIXES.shadows}${key}`] = value;
54153
54272
  }
54154
54273
  }
54155
54274
  const pickDensity = isDark && darkVariant?.density ? darkVariant.density : tokens.density;
@@ -54168,46 +54287,8 @@ function themeTokensToCssVars(tokens, mode = "light", darkVariant) {
54168
54287
  }
54169
54288
  function emitDensity(density, vars) {
54170
54289
  if (!density) return;
54171
- if (density.spacing) {
54172
- const s = density.spacing;
54173
- const pairs2 = [
54174
- ["0", s.space0],
54175
- ["1", s.space1],
54176
- ["2", s.space2],
54177
- ["3", s.space3],
54178
- ["4", s.space4],
54179
- ["5", s.space5],
54180
- ["6", s.space6],
54181
- ["7", s.space7],
54182
- ["8", s.space8],
54183
- ["9", s.space9],
54184
- ["10", s.space10],
54185
- ["11", s.space11],
54186
- ["12", s.space12]
54187
- ];
54188
- for (const [k, v] of pairs2) {
54189
- if (v !== void 0) vars[`--space-${k}`] = v;
54190
- }
54191
- }
54192
- const pairs = [
54193
- ["button-height-sm", density.buttonHeightSm],
54194
- ["button-height-md", density.buttonHeightMd],
54195
- ["button-height-lg", density.buttonHeightLg],
54196
- ["input-height-sm", density.inputHeightSm],
54197
- ["input-height-md", density.inputHeightMd],
54198
- ["input-height-lg", density.inputHeightLg],
54199
- ["row-height-compact", density.rowHeightCompact],
54200
- ["row-height-normal", density.rowHeightNormal],
54201
- ["row-height-spacious", density.rowHeightSpacious],
54202
- ["card-padding-sm", density.cardPaddingSm],
54203
- ["card-padding-md", density.cardPaddingMd],
54204
- ["card-padding-lg", density.cardPaddingLg],
54205
- ["dialog-padding", density.dialogPadding],
54206
- ["section-gap", density.sectionGap]
54207
- ];
54208
- for (const [k, v] of pairs) {
54209
- if (v !== void 0) vars[`--${k}`] = v;
54210
- }
54290
+ applyFlat(density.spacing, DENSITY_SPACING_VARS, vars);
54291
+ applyFlat(density, DENSITY_ELEMENT_VARS, vars);
54211
54292
  }
54212
54293
  function typeSizeKeyStr(k) {
54213
54294
  return k;
@@ -54224,24 +54305,11 @@ function emitTypeIntent(name, intent, vars) {
54224
54305
  }
54225
54306
  function emitTypeScale(ts, vars) {
54226
54307
  if (!ts) return;
54227
- if (ts.displayFamily !== void 0) vars["--font-family-display"] = ts.displayFamily;
54228
- if (ts.bodyFamily !== void 0) vars["--font-family-body"] = ts.bodyFamily;
54229
- if (ts.monoFamily !== void 0) vars["--font-family-mono"] = ts.monoFamily;
54308
+ applyFlat(ts, TYPE_FAMILY_VARS, vars);
54230
54309
  if (ts.scale) {
54231
54310
  const s = ts.scale;
54232
- const pairs = [
54233
- ["xs", s.xs],
54234
- ["sm", s.sm],
54235
- ["base", s.base],
54236
- ["lg", s.lg],
54237
- ["xl", s.xl],
54238
- ["2xl", s["2xl"]],
54239
- ["3xl", s["3xl"]],
54240
- ["4xl", s["4xl"]],
54241
- ["display-1", s["display-1"]],
54242
- ["display-2", s["display-2"]]
54243
- ];
54244
- for (const [k, entry] of pairs) {
54311
+ for (const k of TYPE_SIZE_KEYS) {
54312
+ const entry = s[k];
54245
54313
  if (entry !== void 0) {
54246
54314
  vars[`--text-${k}`] = entry.size;
54247
54315
  vars[`--leading-${k}`] = entry.lineHeight;
@@ -54250,13 +54318,10 @@ function emitTypeScale(ts, vars) {
54250
54318
  }
54251
54319
  if (ts.intents) {
54252
54320
  const i = ts.intents;
54253
- if (i.headingMajor) emitTypeIntent("heading-major", i.headingMajor, vars);
54254
- if (i.headingMinor) emitTypeIntent("heading-minor", i.headingMinor, vars);
54255
- if (i.bodyEmphasis) emitTypeIntent("body-emphasis", i.bodyEmphasis, vars);
54256
- if (i.bodyDefault) emitTypeIntent("body-default", i.bodyDefault, vars);
54257
- if (i.bodyQuiet) emitTypeIntent("body-quiet", i.bodyQuiet, vars);
54258
- if (i.caption) emitTypeIntent("caption", i.caption, vars);
54259
- if (i.numeric) emitTypeIntent("numeric", i.numeric, vars);
54321
+ for (const { key, cssName } of TYPE_INTENT_VARS) {
54322
+ const intent = i[key];
54323
+ if (intent) emitTypeIntent(cssName, intent, vars);
54324
+ }
54260
54325
  }
54261
54326
  }
54262
54327
  function emitMotionIntent(name, intent, vars) {
@@ -54267,60 +54332,34 @@ function emitMotion(m, vars) {
54267
54332
  if (!m) return;
54268
54333
  if (m.durations) {
54269
54334
  const d = m.durations;
54270
- const pairs = [
54271
- ["instant", d.instant],
54272
- ["fast", d.fast],
54273
- ["normal", d.normal],
54274
- ["slow", d.slow],
54275
- ["dramatic", d.dramatic]
54276
- ];
54277
- for (const [k, v] of pairs) {
54335
+ for (const k of MOTION_DURATION_KEYS) {
54336
+ const v = d[k];
54278
54337
  if (v !== void 0) vars[`--duration-${k}`] = v;
54279
54338
  }
54280
54339
  }
54281
54340
  if (m.easings) {
54282
54341
  const e = m.easings;
54283
- const pairs = [
54284
- ["linear", e.linear],
54285
- ["standard", e.standard],
54286
- ["emphasized", e.emphasized],
54287
- ["spring", e.spring]
54288
- ];
54289
- for (const [k, v] of pairs) {
54342
+ for (const k of MOTION_EASING_KEYS) {
54343
+ const v = e[k];
54290
54344
  if (v !== void 0) vars[`--easing-${k}`] = v;
54291
54345
  }
54292
54346
  }
54293
54347
  if (m.intents) {
54294
54348
  const i = m.intents;
54295
- if (i.enter) emitMotionIntent("enter", i.enter, vars);
54296
- if (i.exit) emitMotionIntent("exit", i.exit, vars);
54297
- if (i.hover) emitMotionIntent("hover", i.hover, vars);
54298
- if (i.press) emitMotionIntent("press", i.press, vars);
54299
- if (i.expand) emitMotionIntent("expand", i.expand, vars);
54300
- if (i.transition) emitMotionIntent("transition", i.transition, vars);
54349
+ for (const { key, cssName } of MOTION_INTENT_VARS) {
54350
+ const intent = i[key];
54351
+ if (intent) emitMotionIntent(cssName, intent, vars);
54352
+ }
54301
54353
  }
54302
54354
  }
54303
54355
  function emitIconography(i, vars) {
54304
- if (!i) return;
54305
- if (i.family !== void 0) vars["--icon-family"] = i.family;
54306
- if (i.strokeWidth !== void 0) vars["--icon-stroke-width"] = i.strokeWidth;
54307
- if (i.defaultSize !== void 0) vars["--icon-default-size"] = i.defaultSize;
54356
+ applyFlat(i, ICONOGRAPHY_VARS, vars);
54308
54357
  }
54309
54358
  function emitElevation(e, vars) {
54310
- if (!e) return;
54311
- if (e.cardElevation !== void 0) vars["--elevation-card"] = e.cardElevation;
54312
- if (e.popoverElevation !== void 0) vars["--elevation-popover"] = e.popoverElevation;
54313
- if (e.dialogElevation !== void 0) vars["--elevation-dialog"] = e.dialogElevation;
54314
- if (e.toastElevation !== void 0) vars["--elevation-toast"] = e.toastElevation;
54359
+ applyFlat(e, ELEVATION_VARS, vars);
54315
54360
  }
54316
54361
  function emitGeometry(g, vars) {
54317
- if (!g) return;
54318
- if (g.radiusContainer !== void 0) vars["--radius-container"] = g.radiusContainer;
54319
- if (g.radiusInteractive !== void 0) vars["--radius-interactive"] = g.radiusInteractive;
54320
- if (g.radiusPill !== void 0) vars["--radius-pill"] = g.radiusPill;
54321
- if (g.borderHairline !== void 0) vars["--border-hairline"] = g.borderHairline;
54322
- if (g.borderStandard !== void 0) vars["--border-standard"] = g.borderStandard;
54323
- if (g.borderHeavy !== void 0) vars["--border-heavy"] = g.borderHeavy;
54362
+ applyFlat(g, GEOMETRY_VARS, vars);
54324
54363
  }
54325
54364
  function resolveThemeForRuntime(theme) {
54326
54365
  if (theme === void 0) return void 0;
@@ -54923,8 +54962,9 @@ function ServerBridgeProvider({
54923
54962
  clientEffects: result.clientEffects?.length ?? 0,
54924
54963
  dataEntities,
54925
54964
  data: responseData,
54926
- emittedEvents: result.emittedEvents?.map((e) => e.event) ?? [],
54927
- emitted: result.emittedEvents?.map((e) => ({ event: e.event, ...e.payload !== void 0 && { payload: e.payload } })) ?? [],
54965
+ entityByTrait: result.entityByTrait,
54966
+ emittedEvents: result.emittedEvents.map((e) => e.event),
54967
+ emitted: result.emittedEvents.map((e) => ({ event: e.event, ...e.payload !== void 0 && { payload: e.payload } })),
54928
54968
  effectResults: result.effectResults,
54929
54969
  error: result.error
54930
54970
  };
@@ -54959,10 +54999,8 @@ function ServerBridgeProvider({
54959
54999
  effects.push({ type: "navigate-back", traitName });
54960
55000
  }
54961
55001
  }
54962
- if (result.emittedEvents) {
54963
- for (const emitted of stampLocallyDeliveredEchoes(event, result.emittedEvents, locallyEmitted ?? [])) {
54964
- reEmitServerEvent(eventBus, emitted, orbitalName);
54965
- }
55002
+ for (const emitted of stampLocallyDeliveredEchoes(event, result.emittedEvents, locallyEmitted ?? [])) {
55003
+ reEmitServerEvent(eventBus, emitted, orbitalName);
54966
55004
  }
54967
55005
  } else if (result.error) {
54968
55006
  xOrbitalLog.warn("response:fail", {