@jobber/design 0.110.0 → 0.111.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/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { mobileIconStyles } from "./iconStyles/iconStyles.mobile";
3
3
  import { iconSizes } from "./iconStyles/iconSizes";
4
4
  import { iconColors } from "./iconStyles/iconColors";
5
5
  import iconMap from "./assets/icon.map";
6
+ import type { IconNames } from "./iconStyles/icons.types";
6
7
  import webTokens from "./assets/tokens.web";
7
8
  import androidTokens from "./assets/tokens.android";
8
9
  import iosTokens from "./assets/tokens.ios";
@@ -15,7 +16,7 @@ type MobileTokens = typeof androidTokens;
15
16
  export { webTokens as tokens, webTokens, allColors, androidTokens, darkTokens, iosTokens, iconMap, webIconStyles, mobileIconStyles, iconSizes, iconColors, type WebTokens, type MobileTokens, colors, semantic, };
16
17
  interface IconProps {
17
18
  /** The icon to show. */
18
- readonly name: keyof typeof iconMap.icons | ExtraIconNames;
19
+ readonly name: IconNames;
19
20
  /**
20
21
  * Changes the size to small or large.
21
22
  * @default base
@@ -32,14 +33,14 @@ interface GetIconProps extends IconProps {
32
33
  platform: "web" | "mobile";
33
34
  format?: "css" | "js";
34
35
  /**
35
- * Live theme tokens used to resolve token references at render time.
36
- * When supplied (mobile/`format: "js"` consumers), color references resolve
37
- * against these instead of the light-only `allColors` map. Ignored for
38
- * `format: "css"` — web uses CSS variables that resolve at runtime.
36
+ * Live theme tokens for resolving color references with `format: "js"`;
37
+ * falls back to the light-only `allColors` map. Ignored for `format: "css"`.
39
38
  */
40
39
  tokens?: Record<string, unknown>;
40
+ /** Suppresses `defaultColor`; applying it to paths is the Icon components' job. */
41
+ customColor?: string;
41
42
  }
42
- export declare function getIcon({ name, color, platform, size, format, tokens, }: GetIconProps): {
43
+ export declare function getIcon({ name, color, customColor, platform, size, format, tokens, }: GetIconProps): {
43
44
  readonly svgStyle: {
44
45
  fill?: string;
45
46
  width: number;
@@ -48,10 +49,9 @@ export declare function getIcon({ name, color, platform, size, format, tokens, }
48
49
  readonly pathStyle: {
49
50
  fill: string;
50
51
  };
51
- readonly paths: string[];
52
+ readonly paths: readonly import("./scripts/iconMap.types").IconPath[] | undefined;
52
53
  readonly viewBox: string;
53
54
  };
54
- export type ExtraIconNames = "longArrowUp" | "longArrowDown" | "longArrowRight" | "longArrowLeft" | "longArrowUpRight" | "remove" | "thumbsDown" | "truck" | "checklist";
55
- export type IconNames = keyof typeof iconMap.icons | ExtraIconNames;
56
- export type IconSizes = keyof typeof iconSizes.tokens;
57
- export type IconColorNames = keyof typeof iconColors.tokens;
55
+ export type { IconColorNames, IconNames, IconPath, IconSizes, } from "./iconStyles/icons.types";
56
+ export declare const iconNames: ReadonlyArray<IconNames>;
57
+ export declare function isIconName(value: unknown): value is IconNames;