@wix/himalaya-cli 0.1473.0 → 0.1474.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.
@@ -368,6 +368,42 @@ export declare function donutChart(props: {
368
368
  }, opts?: {
369
369
  id?: string;
370
370
  }): Component;
371
+ /** RFC 0065 §5 — the kinds a {@link shape} draws and `modifiers.clipShape` clips to. */
372
+ export type ShapeKind = "rectangle" | "roundedRectangle" | "capsule" | "circle" | "ellipse";
373
+ /** RFC 0065 §5 — per-corner radii in layout direction (mirror in RTL). */
374
+ export interface CornerRadiiSpec {
375
+ topLeading?: number;
376
+ topTrailing?: number;
377
+ bottomLeading?: number;
378
+ bottomTrailing?: number;
379
+ }
380
+ /** RFC 0065 §5 — a basic shape: fill (token or inline gradient) and an optionally dashed
381
+ * stroke drawn INSIDE its bounds. Size it with `modifiers.width/height`; with no frame it
382
+ * fills its proposal. Decorative — name a meaningful one with `accessibilityLabel`. */
383
+ export declare function shape(props: {
384
+ kind?: ShapeKind;
385
+ cornerRadius?: number;
386
+ cornerRadii?: CornerRadiiSpec;
387
+ /** colour token */
388
+ fill?: string;
389
+ fillGradient?: {
390
+ kind?: "linear" | "radial";
391
+ stops: Array<{
392
+ token: string;
393
+ at?: number;
394
+ }>;
395
+ start?: string;
396
+ end?: string;
397
+ };
398
+ stroke?: {
399
+ color?: string;
400
+ width?: number;
401
+ dash?: number[];
402
+ };
403
+ }, opts?: {
404
+ id?: string;
405
+ modifiers?: NonNullable<Component["modifiers"]>;
406
+ }): Component;
371
407
  /** RFC 0057 — labels for a chart or a table. `marker: "dashed"` labels a
372
408
  * {@link chart} series drawn with the dashed stroke, which is what makes
373
409
  * colour-free series identity readable. `value` is already formatted. */
@@ -387,6 +387,13 @@ export interface Modifiers {
387
387
  * The generalization of `FragmentSlotCase.accessibilityAnnouncement`, which only ever
388
388
  * fired on a fragment-slot case swap. */
389
389
  announce?: LiveRegion;
390
+ /** RFC 0065 §5 — clip ANY node (content + surface) to a shape:
391
+ * "rectangle" | "roundedRectangle" | "capsule" | "circle" | "ellipse". Unknown/empty =
392
+ * no shape clip (`cornerRadius` keeps its meaning). When set it replaces the
393
+ * corner-radius-only clip; a "roundedRectangle" uses `clipCornerRadii`, else `cornerRadius`. */
394
+ clipShape?: string;
395
+ /** RFC 0065 §5 — uneven corner radii for `clipShape: "roundedRectangle"`. */
396
+ clipCornerRadii?: CornerRadii;
390
397
  /** RFC 0069 — a recurring, finite, transform-only motion on a decorative node: a
391
398
  * living character's idle `hop`, a `blink`, a working `breathe`. Never changes the
392
399
  * node's layout footprint. Stopped by reduced motion unless `respectReducedMotion`
@@ -1591,6 +1598,37 @@ export interface DonutChartProps {
1591
1598
  /** base token for the derived opacity ramp (default "accentPrimary") */
1592
1599
  color?: TokenName;
1593
1600
  }
1601
+ /** RFC 0065 §5 — per-corner radii in LAYOUT direction (leading/trailing mirror in RTL). */
1602
+ export interface CornerRadii {
1603
+ topLeading?: number;
1604
+ topTrailing?: number;
1605
+ bottomLeading?: number;
1606
+ bottomTrailing?: number;
1607
+ }
1608
+ /** RFC 0065 §5 — a stroke along a {@link ShapeProps} outline. Drawn INSIDE the shape's
1609
+ * bounds (SwiftUI `strokeBorder` semantics) so a stroke never overhangs its frame. */
1610
+ export interface ShapeStroke {
1611
+ color?: TokenRef;
1612
+ /** pt/dp; absent/0 ⇒ 1 */
1613
+ width?: number;
1614
+ /** on/off dash lengths in pt/dp; empty ⇒ solid. RN draws any dash as its fixed `dashed` style. */
1615
+ dash?: number[];
1616
+ }
1617
+ /**
1618
+ * RFC 0065 §5 — a basic shape. Size comes from `modifiers.width/height` like any node;
1619
+ * with no frame it fills its proposal. `kind` is a string discriminator: unknown ⇒
1620
+ * "rectangle". `fillGradient` wins over `fill`; `cornerRadii` wins over `cornerRadius`
1621
+ * when any corner is set. Decorative: it has no accessible name of its own.
1622
+ */
1623
+ export interface ShapeProps {
1624
+ /** "rectangle" (default) | "roundedRectangle" | "capsule" | "circle" | "ellipse" */
1625
+ kind?: string;
1626
+ cornerRadius?: number;
1627
+ cornerRadii?: CornerRadii;
1628
+ fill?: TokenRef;
1629
+ fillGradient?: Gradient;
1630
+ stroke?: ShapeStroke;
1631
+ }
1594
1632
  /** One row of a {@link LegendProps}. */
1595
1633
  export interface LegendItem {
1596
1634
  label?: string;
@@ -2560,6 +2598,10 @@ export type CoreComponentBody = {
2560
2598
  package: "himalaya";
2561
2599
  type: "DataTable";
2562
2600
  props: DataTableProps;
2601
+ } | {
2602
+ package: "himalaya";
2603
+ type: "Shape";
2604
+ props: ShapeProps;
2563
2605
  } | {
2564
2606
  package: "himalaya";
2565
2607
  type: "RichContent";
@@ -938,6 +938,31 @@ export declare const screenDescriptorSchema: {
938
938
  };
939
939
  };
940
940
  };
941
+ readonly clipShape: {
942
+ readonly type: "string";
943
+ };
944
+ readonly clipCornerRadii: {
945
+ readonly type: "object";
946
+ readonly additionalProperties: false;
947
+ readonly properties: {
948
+ readonly topLeading: {
949
+ readonly type: "integer";
950
+ readonly minimum: 0;
951
+ };
952
+ readonly topTrailing: {
953
+ readonly type: "integer";
954
+ readonly minimum: 0;
955
+ };
956
+ readonly bottomLeading: {
957
+ readonly type: "integer";
958
+ readonly minimum: 0;
959
+ };
960
+ readonly bottomTrailing: {
961
+ readonly type: "integer";
962
+ readonly minimum: 0;
963
+ };
964
+ };
965
+ };
941
966
  readonly ambientMotion: {
942
967
  readonly type: "object";
943
968
  readonly additionalProperties: false;
@@ -2209,6 +2234,31 @@ export declare const widgetSnapshotSchema: {
2209
2234
  };
2210
2235
  };
2211
2236
  };
2237
+ readonly clipShape: {
2238
+ readonly type: "string";
2239
+ };
2240
+ readonly clipCornerRadii: {
2241
+ readonly type: "object";
2242
+ readonly additionalProperties: false;
2243
+ readonly properties: {
2244
+ readonly topLeading: {
2245
+ readonly type: "integer";
2246
+ readonly minimum: 0;
2247
+ };
2248
+ readonly topTrailing: {
2249
+ readonly type: "integer";
2250
+ readonly minimum: 0;
2251
+ };
2252
+ readonly bottomLeading: {
2253
+ readonly type: "integer";
2254
+ readonly minimum: 0;
2255
+ };
2256
+ readonly bottomTrailing: {
2257
+ readonly type: "integer";
2258
+ readonly minimum: 0;
2259
+ };
2260
+ };
2261
+ };
2212
2262
  readonly ambientMotion: {
2213
2263
  readonly type: "object";
2214
2264
  readonly additionalProperties: false;
@@ -8870,6 +8870,20 @@ var screenDescriptorSchema = {
8870
8870
  trigger: { type: "string", enum: ["on_change", "on_appear", "both", "none"] }
8871
8871
  }
8872
8872
  },
8873
+ // RFC 0065 §5 — shape clipping (core.proto Modifiers 76–77). A STRING, not an enum:
8874
+ // RFC 0065 constraint 1 — an unknown kind coalesces to "no shape clip" on every arm,
8875
+ // so a newer kind must not fail validation on an older toolchain.
8876
+ clipShape: { type: "string" },
8877
+ clipCornerRadii: {
8878
+ type: "object",
8879
+ additionalProperties: false,
8880
+ properties: {
8881
+ topLeading: { type: "integer", minimum: 0 },
8882
+ topTrailing: { type: "integer", minimum: 0 },
8883
+ bottomLeading: { type: "integer", minimum: 0 },
8884
+ bottomTrailing: { type: "integer", minimum: 0 }
8885
+ }
8886
+ },
8873
8887
  // RFC 0069 — recurring, finite, transform-only motion on a decorative node. `kind`
8874
8888
  // is an open string: an unknown kind renders no motion, so an older validator must
8875
8889
  // not reject a newer one.
@@ -9228,6 +9242,8 @@ var CORE_COMPONENTS = /* @__PURE__ */ new Set([
9228
9242
  "himalaya.DonutChart",
9229
9243
  "himalaya.Legend",
9230
9244
  "himalaya.DataTable",
9245
+ // Shape — RFC 0065 §5
9246
+ "himalaya.Shape",
9231
9247
  // Rich content — RFC 0063
9232
9248
  "himalaya.RichContent",
9233
9249
  // Rich content editor — RFC 0063 §6
@@ -7548,6 +7548,20 @@ var screenDescriptorSchema = {
7548
7548
  trigger: { type: "string", enum: ["on_change", "on_appear", "both", "none"] }
7549
7549
  }
7550
7550
  },
7551
+ // RFC 0065 §5 — shape clipping (core.proto Modifiers 76–77). A STRING, not an enum:
7552
+ // RFC 0065 constraint 1 — an unknown kind coalesces to "no shape clip" on every arm,
7553
+ // so a newer kind must not fail validation on an older toolchain.
7554
+ clipShape: { type: "string" },
7555
+ clipCornerRadii: {
7556
+ type: "object",
7557
+ additionalProperties: false,
7558
+ properties: {
7559
+ topLeading: { type: "integer", minimum: 0 },
7560
+ topTrailing: { type: "integer", minimum: 0 },
7561
+ bottomLeading: { type: "integer", minimum: 0 },
7562
+ bottomTrailing: { type: "integer", minimum: 0 }
7563
+ }
7564
+ },
7551
7565
  // RFC 0069 — recurring, finite, transform-only motion on a decorative node. `kind`
7552
7566
  // is an open string: an unknown kind renders no motion, so an older validator must
7553
7567
  // not reject a newer one.
@@ -8780,6 +8794,17 @@ function chart(props, opts) {
8780
8794
  function donutChart(props, opts) {
8781
8795
  return { id: opts?.id ?? auto("donut_chart"), body: { package: "himalaya", type: "DonutChart", props } };
8782
8796
  }
8797
+ function shape(props, opts) {
8798
+ const { fill, stroke, ...rest } = props;
8799
+ const wire = { ...rest };
8800
+ if (fill != null) wire.fill = { token: fill };
8801
+ if (stroke != null) {
8802
+ const { color, ...s } = stroke;
8803
+ wire.stroke = color != null ? { ...s, color: { token: color } } : s;
8804
+ }
8805
+ const node = { id: opts?.id ?? auto("shape"), body: { package: "himalaya", type: "Shape", props: wire } };
8806
+ return opts?.modifiers ? withModifiers(node, opts.modifiers) : node;
8807
+ }
8783
8808
  function legend(props, opts) {
8784
8809
  return { id: opts?.id ?? auto("legend"), body: { package: "himalaya", type: "Legend", props } };
8785
8810
  }
@@ -9396,6 +9421,7 @@ export {
9396
9421
  section,
9397
9422
  segmentedControl,
9398
9423
  selectionControl,
9424
+ shape,
9399
9425
  skRect,
9400
9426
  skeleton,
9401
9427
  slider,