@wix/himalaya-cli 0.1241.0 → 0.1243.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.
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/tokens.d.ts +94 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +40 -6
- package/dist/cli.mjs +363 -227
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/tokens.md +28 -0
- package/package.json +2 -2
- package/templates/beauty-salon-owner/dev/index.ts +2 -2
- package/templates/beauty-salon-owner/tier5-src/_shared/owner-selected-site.ts +9 -3
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-overview/index.ts +14 -9
- package/templates/beauty-salon-owner/tier5-src/himi-owner-lite-sites/index.ts +35 -4
- package/templates/community-club-owner/dev/index.ts +2 -2
- package/templates/community-club-owner/tier5-src/_shared/owner-selected-site.ts +9 -3
- package/templates/community-club-owner/tier5-src/himi-owner-lite-overview/index.ts +14 -9
- package/templates/community-club-owner/tier5-src/himi-owner-lite-sites/index.ts +35 -4
- package/templates/events-meetups-owner/dev/index.ts +2 -2
- package/templates/events-meetups-owner/tier5-src/_shared/owner-selected-site.ts +9 -3
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-overview/index.ts +14 -9
- package/templates/events-meetups-owner/tier5-src/himi-owner-lite-sites/index.ts +35 -4
- package/templates/gym-fitness-owner/dev/index.ts +2 -2
- package/templates/gym-fitness-owner/tier5-src/_shared/owner-selected-site.ts +9 -3
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-overview/index.ts +14 -9
- package/templates/gym-fitness-owner/tier5-src/himi-owner-lite-sites/index.ts +35 -4
- package/templates/nonprofit-cause-owner/dev/index.ts +2 -2
- package/templates/nonprofit-cause-owner/tier5-src/_shared/owner-selected-site.ts +9 -3
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-overview/index.ts +14 -9
- package/templates/nonprofit-cause-owner/tier5-src/himi-owner-lite-sites/index.ts +35 -4
- package/templates/owner-lite/dev/index.ts +2 -2
- package/templates/owner-lite/tier5-src/_shared/owner-selected-site.ts +9 -3
- package/templates/owner-lite/tier5-src/himi-owner-lite-overview/index.ts +14 -9
- package/templates/owner-lite/tier5-src/himi-owner-lite-sites/index.ts +35 -4
- package/templates/podcast-creator-owner/dev/index.ts +2 -2
- package/templates/podcast-creator-owner/tier5-src/_shared/owner-selected-site.ts +9 -3
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-overview/index.ts +14 -9
- package/templates/podcast-creator-owner/tier5-src/himi-owner-lite-sites/index.ts +35 -4
- package/templates/portfolio-creative-owner/dev/index.ts +2 -2
- package/templates/portfolio-creative-owner/tier5-src/_shared/owner-selected-site.ts +9 -3
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-overview/index.ts +14 -9
- package/templates/portfolio-creative-owner/tier5-src/himi-owner-lite-sites/index.ts +35 -4
- package/templates/restaurant-owner/dev/index.ts +2 -2
- package/templates/restaurant-owner/tier5-src/_shared/owner-selected-site.ts +9 -3
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-overview/index.ts +14 -9
- package/templates/restaurant-owner/tier5-src/himi-owner-lite-sites/index.ts +35 -4
- package/templates/retail-store-owner/dev/index.ts +2 -2
- package/templates/retail-store-owner/tier5-src/_shared/owner-selected-site.ts +9 -3
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-overview/index.ts +14 -9
- package/templates/retail-store-owner/tier5-src/himi-owner-lite-sites/index.ts +35 -4
- package/templates/yoga-studio-owner/dev/index.ts +2 -2
- package/templates/yoga-studio-owner/tier5-src/_shared/owner-selected-site.ts +9 -3
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-overview/index.ts +14 -9
- package/templates/yoga-studio-owner/tier5-src/himi-owner-lite-sites/index.ts +35 -4
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/tokens.d.ts
CHANGED
|
@@ -20,6 +20,9 @@ export interface DesignTokens {
|
|
|
20
20
|
materials?: Record<string, MaterialToken>;
|
|
21
21
|
/** RFC 0059 / #2931 — named surface elevations, paint only. A `Card` wears `card`. */
|
|
22
22
|
elevations?: Record<string, ElevationToken>;
|
|
23
|
+
/** #3491 — per-control styling the renderers read instead of hard-coded values. Today: the
|
|
24
|
+
* `button` group (per size and per variant). Absent ⇒ every renderer draws exactly as before. */
|
|
25
|
+
controls?: ControlTokens;
|
|
23
26
|
/** RFC 0021 (bottom-nav extension) — kit-driven tab bar styling. */
|
|
24
27
|
tabBar?: TabBarStyle;
|
|
25
28
|
/** RFC 0010/0021 — kit-driven slide-in drawer styling. */
|
|
@@ -300,6 +303,97 @@ export declare const TONAL_ELEVATION_ALPHA: readonly number[];
|
|
|
300
303
|
/** The tint alpha an `ElevationToken.level` asks for: rounded and clamped to 0–5; anything
|
|
301
304
|
* non-numeric is 0 (no tint). */
|
|
302
305
|
export declare function tonalElevationAlpha(level: number | undefined): number;
|
|
306
|
+
/**
|
|
307
|
+
* #3491 — per-control design tokens. One group per control; `button` is the first.
|
|
308
|
+
*
|
|
309
|
+
* "controls": {
|
|
310
|
+
* "button": {
|
|
311
|
+
* "sm": { "height": 36, "paddingH": 13, "text": "bodyEmphasis", "icon": 14 },
|
|
312
|
+
* "variants": { "secondary": { "radius": 4, "borderWidth": 1 } }
|
|
313
|
+
* }
|
|
314
|
+
* }
|
|
315
|
+
*
|
|
316
|
+
* Every field is optional, at every depth. A field that is absent keeps that renderer's
|
|
317
|
+
* built-in value, so a token set with no `controls` block draws every Button exactly as before.
|
|
318
|
+
*/
|
|
319
|
+
export interface ControlTokens {
|
|
320
|
+
button?: ButtonTokens;
|
|
321
|
+
}
|
|
322
|
+
/** The three Button sizes, in the order `ButtonProps.size` names them. An unknown or absent size
|
|
323
|
+
* is `md` on every renderer. */
|
|
324
|
+
export declare const BUTTON_SIZES: readonly ["sm", "md", "lg"];
|
|
325
|
+
export type ButtonSize = (typeof BUTTON_SIZES)[number];
|
|
326
|
+
/** #3491 — Button tokens: one entry per size, plus `variants` keyed by `ButtonProps.style`
|
|
327
|
+
* (`primary`, `secondary`, `tertiary`, `link`, `plain`, `destructive`, or any app style). */
|
|
328
|
+
export interface ButtonTokens {
|
|
329
|
+
sm?: ButtonSizeToken;
|
|
330
|
+
md?: ButtonSizeToken;
|
|
331
|
+
lg?: ButtonSizeToken;
|
|
332
|
+
variants?: Record<string, ButtonVariantToken>;
|
|
333
|
+
}
|
|
334
|
+
/** The geometry of one Button size. Lengths are points (iOS/macOS), dp (Android) or CSS px (web). */
|
|
335
|
+
export interface ButtonSizeToken {
|
|
336
|
+
/** The VISIBLE minimum height of the button. A value under {@link BUTTON_MIN_HIT_TARGET} keeps
|
|
337
|
+
* the tap target at that floor through a transparent hit area, never through the visible box. */
|
|
338
|
+
height?: number;
|
|
339
|
+
/** Horizontal padding between the edge and the label. */
|
|
340
|
+
paddingH?: number;
|
|
341
|
+
/** Vertical padding between the edge and the label. */
|
|
342
|
+
paddingV?: number;
|
|
343
|
+
/** A `typography` token name for the label. */
|
|
344
|
+
text?: string;
|
|
345
|
+
/** The leading/trailing glyph (and spinner) size. */
|
|
346
|
+
icon?: number;
|
|
347
|
+
/** Corner radius. A variant's `radius` wins over this one; `ButtonProps.cornerRadius` wins over both. */
|
|
348
|
+
radius?: number;
|
|
349
|
+
}
|
|
350
|
+
/** The paint of one Button variant (`ButtonProps.style`). Colours are colour-token names or `#hex`. */
|
|
351
|
+
export interface ButtonVariantToken {
|
|
352
|
+
/** The background fill. Absent ⇒ the variant's built-in fill (`accentPrimary`/`danger` when
|
|
353
|
+
* filled, none otherwise). */
|
|
354
|
+
fill?: string;
|
|
355
|
+
/** The label, glyph and spinner colour. */
|
|
356
|
+
label?: string;
|
|
357
|
+
/** The outline colour. Absent ⇒ the label colour. */
|
|
358
|
+
border?: string;
|
|
359
|
+
/** The outline width; 0 = no outline. Absent ⇒ 1 for `secondary`, 0 otherwise. */
|
|
360
|
+
borderWidth?: number;
|
|
361
|
+
/** Corner radius; wins over the size's `radius`. */
|
|
362
|
+
radius?: number;
|
|
363
|
+
}
|
|
364
|
+
/** The smallest tap target a Button may have, on every renderer (WCAG 2.5.8 / Apple HIG 44pt).
|
|
365
|
+
* A visible height below it is padded out by a transparent hit area. */
|
|
366
|
+
export declare const BUTTON_MIN_HIT_TARGET = 44;
|
|
367
|
+
/** The Button tokens for one size + variant, merged. Each field is present only when a token sets
|
|
368
|
+
* it to a usable value, so a renderer falls back to its own built-in value field by field. */
|
|
369
|
+
export interface ResolvedButtonTokens {
|
|
370
|
+
height?: number;
|
|
371
|
+
paddingH?: number;
|
|
372
|
+
paddingV?: number;
|
|
373
|
+
text?: string;
|
|
374
|
+
icon?: number;
|
|
375
|
+
radius?: number;
|
|
376
|
+
fill?: string;
|
|
377
|
+
label?: string;
|
|
378
|
+
border?: string;
|
|
379
|
+
borderWidth?: number;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* #3491 — resolve `controls.button` for a Button of `size` and `style`. The shared rule every
|
|
383
|
+
* renderer mirrors (iOS `SDUIButtonTokens`, Android `SDUIButtonTokens`, web, React Native):
|
|
384
|
+
*
|
|
385
|
+
* - `size` is `sm` / `lg`, else `md`; `style` absent is `primary`;
|
|
386
|
+
* - a negative or non-finite length, and an empty name, is "not set";
|
|
387
|
+
* - `radius`: the variant's, else the size's.
|
|
388
|
+
*
|
|
389
|
+
* Read defensively: the tokens document is published data, so any level can be malformed.
|
|
390
|
+
*/
|
|
391
|
+
export declare function resolveButtonTokens(tokens: {
|
|
392
|
+
controls?: unknown;
|
|
393
|
+
} | null | undefined, size: string | null | undefined, style: string | null | undefined): ResolvedButtonTokens;
|
|
394
|
+
/** The transparent hit area to add above AND below a Button whose visible minimum height is
|
|
395
|
+
* `visibleHeight`, so its tap target reaches {@link BUTTON_MIN_HIT_TARGET}. 0 when it already does. */
|
|
396
|
+
export declare function buttonHitSlop(visibleHeight: number | undefined): number;
|
|
303
397
|
/** RFC 0020 — a linear gradient. `colors` are color-token NAMES (theme-aware);
|
|
304
398
|
* `angle` is degrees clockwise from top (0 = top→bottom, 90 = left→right).
|
|
305
399
|
* `locations` (0..1) optionally positions each stop. */
|
|
@@ -7857,6 +7857,36 @@ function tonalElevationAlpha(level) {
|
|
|
7857
7857
|
if (typeof level !== "number" || !Number.isFinite(level)) return 0;
|
|
7858
7858
|
return TONAL_ELEVATION_ALPHA[Math.min(5, Math.max(0, Math.round(level)))];
|
|
7859
7859
|
}
|
|
7860
|
+
var BUTTON_SIZES = ["sm", "md", "lg"];
|
|
7861
|
+
var BUTTON_MIN_HIT_TARGET = 44;
|
|
7862
|
+
var nonNegative = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0 ? v : void 0;
|
|
7863
|
+
var nonEmpty = (v) => typeof v === "string" && v !== "" ? v : void 0;
|
|
7864
|
+
var own = (o, k) => o && typeof o === "object" && Object.prototype.hasOwnProperty.call(o, k) ? o[k] : void 0;
|
|
7865
|
+
function resolveButtonTokens(tokens, size, style) {
|
|
7866
|
+
const button = own(own(tokens, "controls"), "button");
|
|
7867
|
+
const sizeKey = size === "sm" || size === "lg" ? size : "md";
|
|
7868
|
+
const s = own(button, sizeKey);
|
|
7869
|
+
const v = own(own(button, "variants"), style || "primary");
|
|
7870
|
+
const out = {};
|
|
7871
|
+
const set = (k, val) => {
|
|
7872
|
+
if (val !== void 0) out[k] = val;
|
|
7873
|
+
};
|
|
7874
|
+
set("height", nonNegative(own(s, "height")));
|
|
7875
|
+
set("paddingH", nonNegative(own(s, "paddingH")));
|
|
7876
|
+
set("paddingV", nonNegative(own(s, "paddingV")));
|
|
7877
|
+
set("text", nonEmpty(own(s, "text")));
|
|
7878
|
+
set("icon", nonNegative(own(s, "icon")));
|
|
7879
|
+
set("radius", nonNegative(own(v, "radius")) ?? nonNegative(own(s, "radius")));
|
|
7880
|
+
set("fill", nonEmpty(own(v, "fill")));
|
|
7881
|
+
set("label", nonEmpty(own(v, "label")));
|
|
7882
|
+
set("border", nonEmpty(own(v, "border")));
|
|
7883
|
+
set("borderWidth", nonNegative(own(v, "borderWidth")));
|
|
7884
|
+
return out;
|
|
7885
|
+
}
|
|
7886
|
+
function buttonHitSlop(visibleHeight) {
|
|
7887
|
+
if (typeof visibleHeight !== "number" || !Number.isFinite(visibleHeight)) return 0;
|
|
7888
|
+
return Math.max(0, (BUTTON_MIN_HIT_TARGET - visibleHeight) / 2);
|
|
7889
|
+
}
|
|
7860
7890
|
function buildTokenRegistry(tokens) {
|
|
7861
7891
|
return {
|
|
7862
7892
|
colors: new Set(Object.keys(tokens.colors ?? {})),
|
|
@@ -9269,16 +9299,16 @@ function shouldRevealError(args) {
|
|
|
9269
9299
|
return args.touched && !args.focused;
|
|
9270
9300
|
}
|
|
9271
9301
|
}
|
|
9272
|
-
var
|
|
9302
|
+
var nonEmpty2 = (type) => (v) => typeof v === "string" && v.length > 0 && isValid({ type }, v);
|
|
9273
9303
|
var validators = {
|
|
9274
9304
|
// validates: these are top-level CALLS, which esbuild otherwise has to assume
|
|
9275
9305
|
// might have side effects — and keeping them retained `validate` and every
|
|
9276
9306
|
// predicate behind it, DOUBLING a Tier-5 bundle that does no validation at all.
|
|
9277
|
-
email: /* @__PURE__ */
|
|
9278
|
-
phone: /* @__PURE__ */
|
|
9279
|
-
url: /* @__PURE__ */
|
|
9280
|
-
number: /* @__PURE__ */
|
|
9281
|
-
integer: /* @__PURE__ */
|
|
9307
|
+
email: /* @__PURE__ */ nonEmpty2("email"),
|
|
9308
|
+
phone: /* @__PURE__ */ nonEmpty2("phone"),
|
|
9309
|
+
url: /* @__PURE__ */ nonEmpty2("url"),
|
|
9310
|
+
number: /* @__PURE__ */ nonEmpty2("number"),
|
|
9311
|
+
integer: /* @__PURE__ */ nonEmpty2("integer")
|
|
9282
9312
|
};
|
|
9283
9313
|
function validateAll(rules, values, catalog) {
|
|
9284
9314
|
const errors = {};
|
|
@@ -13404,6 +13434,8 @@ export {
|
|
|
13404
13434
|
APP_ID_PATTERN,
|
|
13405
13435
|
AppRegistryClient,
|
|
13406
13436
|
BASE44_ORIGINS,
|
|
13437
|
+
BUTTON_MIN_HIT_TARGET,
|
|
13438
|
+
BUTTON_SIZES,
|
|
13407
13439
|
CHASSIS_GEOMETRY,
|
|
13408
13440
|
CORE_COMPONENTS,
|
|
13409
13441
|
DEFAULT_DISTRIBUTION,
|
|
@@ -13463,6 +13495,7 @@ export {
|
|
|
13463
13495
|
buildPackageShareUrl,
|
|
13464
13496
|
buildPlayerPreviewUrl,
|
|
13465
13497
|
buildTokenRegistry,
|
|
13498
|
+
buttonHitSlop,
|
|
13466
13499
|
chassisOuterSize,
|
|
13467
13500
|
checkTierCaps,
|
|
13468
13501
|
chooseCandidate,
|
|
@@ -13506,6 +13539,7 @@ export {
|
|
|
13506
13539
|
primarySubtag,
|
|
13507
13540
|
resolveAppIdentity,
|
|
13508
13541
|
resolveAppLocale,
|
|
13542
|
+
resolveButtonTokens,
|
|
13509
13543
|
resolveColor,
|
|
13510
13544
|
resolveIcon,
|
|
13511
13545
|
resolveIdiom,
|