@yahoo/uds-v5-wip 1.73.0 → 1.74.1

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.
@@ -9,6 +9,8 @@ declare class AssetGroup {
9
9
  /** The slug — the `registerAssetGroups` record key. */
10
10
  readonly name: string;
11
11
  readonly label: string;
12
+ /** Source-library version shown in the Assets UI (e.g. `2.1.1`). */
13
+ readonly version?: string;
12
14
  readonly description?: string;
13
15
  readonly assetKind: AssetKind;
14
16
  /** Member names — the `${assetName}` segment of each asset's id. */
@@ -37,6 +39,7 @@ declare class AssetGroup {
37
39
  constructor(args: {
38
40
  name: string;
39
41
  label: string;
42
+ version?: string;
40
43
  description?: string;
41
44
  assetKind: AssetKind;
42
45
  assetNames: readonly string[];
@@ -4,6 +4,8 @@ var AssetGroup = class AssetGroup {
4
4
  /** The slug — the `registerAssetGroups` record key. */
5
5
  name;
6
6
  label;
7
+ /** Source-library version shown in the Assets UI (e.g. `2.1.1`). */
8
+ version;
7
9
  description;
8
10
  assetKind;
9
11
  /** Member names — the `${assetName}` segment of each asset's id. */
@@ -33,6 +35,7 @@ var AssetGroup = class AssetGroup {
33
35
  constructor(args) {
34
36
  this.name = args.name;
35
37
  this.label = args.label;
38
+ this.version = args.version;
36
39
  this.description = args.description;
37
40
  this.assetKind = args.assetKind;
38
41
  this.assetNames = args.assetNames;
@@ -66,14 +69,20 @@ var AssetGroup = class AssetGroup {
66
69
  name: this.name,
67
70
  assetKind: "font",
68
71
  label: this.label,
69
- ...compact({ description: this.description }),
72
+ ...compact({
73
+ version: this.version,
74
+ description: this.description
75
+ }),
70
76
  members: this.members ?? {}
71
77
  };
72
78
  return {
73
79
  name: this.name,
74
80
  assetKind: "icon",
75
81
  label: this.label,
76
- ...compact({ description: this.description }),
82
+ ...compact({
83
+ version: this.version,
84
+ description: this.description
85
+ }),
77
86
  sizes: this.sizes ?? {},
78
87
  variants: this.variants ?? [],
79
88
  members: this.assetNames,
@@ -90,6 +99,7 @@ var AssetGroup = class AssetGroup {
90
99
  if (json.assetKind === "font") return new AssetGroup({
91
100
  name,
92
101
  label: json.label,
102
+ version: json.version,
93
103
  description: json.description,
94
104
  assetKind: "font",
95
105
  assetNames: Object.keys(json.members),
@@ -99,6 +109,7 @@ var AssetGroup = class AssetGroup {
99
109
  return new AssetGroup({
100
110
  name,
101
111
  label: json.label,
112
+ version: json.version,
102
113
  description: json.description,
103
114
  assetKind: "icon",
104
115
  assetNames: json.members,
@@ -1082,6 +1082,7 @@ var Config = class Config {
1082
1082
  this.assetGroups.set(slug, new AssetGroup({
1083
1083
  name: slug,
1084
1084
  label: def.label ?? titleCaseSlug(slug),
1085
+ version: def.version,
1085
1086
  description: def.description,
1086
1087
  assetKind: def.assetKind,
1087
1088
  assetNames: Object.keys(def.members),
@@ -45,6 +45,12 @@ interface IconAssetGroupConfig<P = Record<string, unknown>> {
45
45
  variants?: readonly string[];
46
46
  /** Display label. Defaults to the title-cased registration key. */
47
47
  label?: string;
48
+ /**
49
+ * Source-library version shown in the Assets UI (e.g. `2.1.1`). Authored,
50
+ * not derived — a set's published version rarely matches the npm package
51
+ * that ships its glyphs. Omitted ⇒ no version is shown.
52
+ */
53
+ version?: string;
48
54
  description?: string;
49
55
  /**
50
56
  * Filter harvested members by their export key — return `false` to skip one.
@@ -91,6 +97,8 @@ interface IconAssetGroupConfig<P = Record<string, unknown>> {
91
97
  interface FontAssetGroupConfig {
92
98
  type: 'font';
93
99
  label?: string;
100
+ /** Source-library version shown in the Assets UI (e.g. `2.1.1`). */
101
+ version?: string;
94
102
  description?: string;
95
103
  /** Icon-class prop — excluded on the font branch at the type level. */
96
104
  sizes?: never;
@@ -111,6 +119,7 @@ interface AssetGroupDefinitionBase {
111
119
  */
112
120
  readonly ref: string;
113
121
  readonly label?: string;
122
+ readonly version?: string;
114
123
  readonly description?: string;
115
124
  }
116
125
  interface IconAssetGroupDefinition extends AssetGroupDefinitionBase {
@@ -215,6 +215,7 @@ function defineAssetGroup(members) {
215
215
  value(config) {
216
216
  if (out.assetKind !== void 0) throw new Error("defineAssetGroup: .config({...}) may only be called once per group.");
217
217
  if (config.label !== void 0) out.label = config.label;
218
+ if (config.version !== void 0) out.version = config.version;
218
219
  if (config.description !== void 0) out.description = config.description;
219
220
  if (config.type === "font") {
220
221
  const fontMembers = guardFontMembers(members);
@@ -619,6 +619,8 @@ interface SerializedIconAssetGroup {
619
619
  assetKind: 'icon';
620
620
  label: string;
621
621
  description?: string;
622
+ /** Source-library version shown in the Assets UI (e.g. `2.1.1`). */
623
+ version?: string;
622
624
  /** Named size → px. The picker's size options are these keys. */
623
625
  sizes: Readonly<Record<string, number>>;
624
626
  /** Group-level variant superset (declared or harvested union). */
@@ -644,6 +646,8 @@ interface SerializedFontAssetGroup {
644
646
  assetKind: 'font';
645
647
  label: string;
646
648
  description?: string;
649
+ /** Source-library version shown in the Assets UI (e.g. `2.1.1`). */
650
+ version?: string;
647
651
  members: Readonly<Record<string, FontAssetMember>>;
648
652
  }
649
653
  type SerializedAssetGroup = SerializedIconAssetGroup | SerializedFontAssetGroup;