@wix/himalaya-cli 0.1019.0 → 0.1021.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.
@@ -208,6 +208,13 @@ export interface PreviewSurface {
208
208
  * phone and tablet are always offered.
209
209
  */
210
210
  readonly platformKey: string | null;
211
+ /**
212
+ * RFC 0059 / #2927 — the native builds that draw this surface, which is what a null
213
+ * `platformKey` leaves implicit. The web host offers each one's idiom as a preview
214
+ * (`IDIOM_CONTEXTS`: `ios` wears `ios`, `android` wears `material`), and side by side.
215
+ * Absent ⇒ none: the surface previews in its own look only.
216
+ */
217
+ readonly idiomPlatforms?: readonly ("ios" | "android")[];
211
218
  readonly gate: SurfaceGate;
212
219
  }
213
220
  /**
@@ -18,6 +18,8 @@ export interface DesignTokens {
18
18
  motions?: Record<string, MotionToken>;
19
19
  /** RFC 0021 — named surface materials (flat / glass / frosted). */
20
20
  materials?: Record<string, MaterialToken>;
21
+ /** RFC 0059 / #2931 — named surface elevations, paint only. A `Card` wears `card`. */
22
+ elevations?: Record<string, ElevationToken>;
21
23
  /** RFC 0021 (bottom-nav extension) — kit-driven tab bar styling. */
22
24
  tabBar?: TabBarStyle;
23
25
  /** RFC 0010/0021 — kit-driven slide-in drawer styling. */
@@ -264,6 +266,40 @@ export interface ShadowToken {
264
266
  x?: number;
265
267
  y?: number;
266
268
  }
269
+ /**
270
+ * RFC 0059 / #2931 — how raised a surface is, as PAINT: nothing here moves a box, so the
271
+ * structural diff stays blind to it. A `Card` wears the `card` elevation; declare none and every
272
+ * Card stays flat, as before. Each field is drawn the same way on every renderer — what makes a
273
+ * Card read as Material on Android and as iOS on an iPhone is the idiom overlay choosing different
274
+ * fields for the one token:
275
+ *
276
+ * "elevations": { "card": {} },
277
+ * "idiom": {
278
+ * "material": { "elevations": { "card": { "level": 1 } } },
279
+ * "ios": { "elevations": { "card": { "border": { "color": "border" }, "shadow": "card" } } }
280
+ * }
281
+ */
282
+ export interface ElevationToken {
283
+ /** Material 3 tonal elevation, 0–5: the surface is tinted with `tint` at M3's alpha for that
284
+ * level (1 → 5%, 2 → 8%, 3 → 11%, 4 → 12%, 5 → 14% — `TONAL_ELEVATION_ALPHA`). 0 = none. */
285
+ level?: number;
286
+ /** The tonal tint — a colour token, M3's surfaceTint. Default `accentPrimary`. */
287
+ tint?: string;
288
+ /** A `shadows` token drawn behind the surface, in the surface's own shape. */
289
+ shadow?: string;
290
+ /** A hairline drawn just inside the surface's edge, so it never grows the box. `width` in
291
+ * points, default 0.5; 0 = none. */
292
+ border?: {
293
+ color: string;
294
+ width?: number;
295
+ };
296
+ }
297
+ /** M3's tonal-elevation tint alpha by level (0–5), as `surfaceColorAtElevation` computes it for
298
+ * levels 1–5 (1, 3, 6, 8, 12 dp). Mirrored by Tokens.swift and Tokens.kt. */
299
+ export declare const TONAL_ELEVATION_ALPHA: readonly number[];
300
+ /** The tint alpha an `ElevationToken.level` asks for: rounded and clamped to 0–5; anything
301
+ * non-numeric is 0 (no tint). */
302
+ export declare function tonalElevationAlpha(level: number | undefined): number;
267
303
  /** RFC 0020 — a linear gradient. `colors` are color-token NAMES (theme-aware);
268
304
  * `angle` is degrees clockwise from top (0 = top→bottom, 90 = left→right).
269
305
  * `locations` (0..1) optionally positions each stop. */
@@ -7796,6 +7796,11 @@ function resolveResponsiveSize(rs, width) {
7796
7796
  return rs.base;
7797
7797
  }
7798
7798
  var SYSTEM_FONT_FAMILY = "$system";
7799
+ var TONAL_ELEVATION_ALPHA = [0, 0.05, 0.08, 0.11, 0.12, 0.14];
7800
+ function tonalElevationAlpha(level) {
7801
+ if (typeof level !== "number" || !Number.isFinite(level)) return 0;
7802
+ return TONAL_ELEVATION_ALPHA[Math.min(5, Math.max(0, Math.round(level)))];
7803
+ }
7799
7804
  function buildTokenRegistry(tokens) {
7800
7805
  return {
7801
7806
  colors: new Set(Object.keys(tokens.colors ?? {})),
@@ -9227,7 +9232,8 @@ var PREVIEW_SURFACES = [
9227
9232
  // iPhone 14/15 logical points
9228
9233
  orientations: ["portrait"],
9229
9234
  platformKey: null,
9230
- // iOS/Android are implicit
9235
+ // iOS/Android are implicit — named explicitly in idiomPlatforms
9236
+ idiomPlatforms: ["ios", "android"],
9231
9237
  gate: { kind: "none" }
9232
9238
  },
9233
9239
  {
@@ -9242,6 +9248,7 @@ var PREVIEW_SURFACES = [
9242
9248
  // iPad Pro 11" logical points
9243
9249
  orientations: ["portrait", "landscape"],
9244
9250
  platformKey: null,
9251
+ idiomPlatforms: ["ios", "android"],
9245
9252
  gate: { kind: "none" }
9246
9253
  },
9247
9254
  {
@@ -12975,6 +12982,7 @@ export {
12975
12982
  SURFACE_GROUPS,
12976
12983
  SURFACE_VIEW_LADDER,
12977
12984
  SYSTEM_FONT_FAMILY,
12985
+ TONAL_ELEVATION_ALPHA,
12978
12986
  UNIVERSAL_LAUNCH_NAMESPACES,
12979
12987
  WIDGET_COMPONENTS,
12980
12988
  WIDGET_FAMILIES,
@@ -13047,6 +13055,7 @@ export {
13047
13055
  surfaceFrozenFamily,
13048
13056
  surfaceRenderMode,
13049
13057
  surfacesForApp,
13058
+ tonalElevationAlpha,
13050
13059
  validate,
13051
13060
  validateAll,
13052
13061
  validateDistribution,
@@ -7661,7 +7661,8 @@ var PREVIEW_SURFACES = [
7661
7661
  // iPhone 14/15 logical points
7662
7662
  orientations: ["portrait"],
7663
7663
  platformKey: null,
7664
- // iOS/Android are implicit
7664
+ // iOS/Android are implicit — named explicitly in idiomPlatforms
7665
+ idiomPlatforms: ["ios", "android"],
7665
7666
  gate: { kind: "none" }
7666
7667
  },
7667
7668
  {
@@ -7676,6 +7677,7 @@ var PREVIEW_SURFACES = [
7676
7677
  // iPad Pro 11" logical points
7677
7678
  orientations: ["portrait", "landscape"],
7678
7679
  platformKey: null,
7680
+ idiomPlatforms: ["ios", "android"],
7679
7681
  gate: { kind: "none" }
7680
7682
  },
7681
7683
  {