@o3r/design 10.0.0-alpha.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.
Files changed (131) hide show
  1. package/LICENSE +26 -0
  2. package/README.md +51 -0
  3. package/builders/generate-css/index.d.ts +8 -0
  4. package/builders/generate-css/index.d.ts.map +1 -0
  5. package/builders/generate-css/index.js +116 -0
  6. package/builders/generate-css/schema.d.ts +32 -0
  7. package/builders/generate-css/schema.d.ts.map +1 -0
  8. package/builders/generate-css/schema.js +3 -0
  9. package/builders/generate-css/schema.json +68 -0
  10. package/builders/package.json +3 -0
  11. package/builders.json +10 -0
  12. package/cli/generate-css-from-design-token.cli.cjs +33 -0
  13. package/cli/generate-css-from-design-token.cli.cjs.map +1 -0
  14. package/cli/generate-css-from-design-token.cli.d.cts +3 -0
  15. package/cli/generate-css-from-design-token.cli.d.cts.map +1 -0
  16. package/collection.json +24 -0
  17. package/migration.json +5 -0
  18. package/package.json +206 -0
  19. package/schematics/ extract-token/index.d.ts +8 -0
  20. package/schematics/ extract-token/index.d.ts.map +1 -0
  21. package/schematics/ extract-token/index.js +90 -0
  22. package/schematics/ extract-token/schema.d.ts +14 -0
  23. package/schematics/ extract-token/schema.d.ts.map +1 -0
  24. package/schematics/ extract-token/schema.js +3 -0
  25. package/schematics/ extract-token/schema.json +43 -0
  26. package/schematics/generate-css/index.d.ts +8 -0
  27. package/schematics/generate-css/index.d.ts.map +1 -0
  28. package/schematics/generate-css/index.js +48 -0
  29. package/schematics/generate-css/schema.d.ts +17 -0
  30. package/schematics/generate-css/schema.d.ts.map +1 -0
  31. package/schematics/generate-css/schema.js +3 -0
  32. package/schematics/generate-css/schema.json +43 -0
  33. package/schematics/ng-add/index.d.ts +7 -0
  34. package/schematics/ng-add/index.d.ts.map +1 -0
  35. package/schematics/ng-add/index.js +19 -0
  36. package/schematics/ng-add/register-generate-css/index.d.ts +2 -0
  37. package/schematics/ng-add/register-generate-css/index.d.ts.map +1 -0
  38. package/schematics/ng-add/register-generate-css/index.js +5 -0
  39. package/schematics/ng-add/register-generate-css/register-task.d.ts +8 -0
  40. package/schematics/ng-add/register-generate-css/register-task.d.ts.map +1 -0
  41. package/schematics/ng-add/register-generate-css/register-task.js +60 -0
  42. package/schematics/ng-add/register-generate-css/templates/design-token.custom.json.template +3 -0
  43. package/schematics/ng-add/register-generate-css/templates/theme.scss.template +6 -0
  44. package/schematics/ng-add/schema.d.ts +6 -0
  45. package/schematics/ng-add/schema.d.ts.map +1 -0
  46. package/schematics/ng-add/schema.js +3 -0
  47. package/schematics/ng-add/schema.json +18 -0
  48. package/src/core/design-token/design-token-specification.interface.d.ts +195 -0
  49. package/src/core/design-token/design-token-specification.interface.d.ts.map +1 -0
  50. package/src/core/design-token/design-token-specification.interface.js +39 -0
  51. package/src/core/design-token/design-token-specification.interface.js.map +1 -0
  52. package/src/core/design-token/index.d.ts +4 -0
  53. package/src/core/design-token/index.d.ts.map +1 -0
  54. package/src/core/design-token/index.js +7 -0
  55. package/src/core/design-token/index.js.map +1 -0
  56. package/src/core/design-token/parsers/design-token-parser.interface.d.ts +70 -0
  57. package/src/core/design-token/parsers/design-token-parser.interface.d.ts.map +1 -0
  58. package/src/core/design-token/parsers/design-token-parser.interface.js +3 -0
  59. package/src/core/design-token/parsers/design-token-parser.interface.js.map +1 -0
  60. package/src/core/design-token/parsers/design-token.parser.d.ts +25 -0
  61. package/src/core/design-token/parsers/design-token.parser.d.ts.map +1 -0
  62. package/src/core/design-token/parsers/design-token.parser.js +142 -0
  63. package/src/core/design-token/parsers/design-token.parser.js.map +1 -0
  64. package/src/core/design-token/parsers/index.d.ts +3 -0
  65. package/src/core/design-token/parsers/index.d.ts.map +1 -0
  66. package/src/core/design-token/parsers/index.js +6 -0
  67. package/src/core/design-token/parsers/index.js.map +1 -0
  68. package/src/core/design-token/renderers/css/design-token-definition.renderers.d.ts +47 -0
  69. package/src/core/design-token/renderers/css/design-token-definition.renderers.d.ts.map +1 -0
  70. package/src/core/design-token/renderers/css/design-token-definition.renderers.js +53 -0
  71. package/src/core/design-token/renderers/css/design-token-definition.renderers.js.map +1 -0
  72. package/src/core/design-token/renderers/css/design-token-updater.renderers.d.ts +24 -0
  73. package/src/core/design-token/renderers/css/design-token-updater.renderers.d.ts.map +1 -0
  74. package/src/core/design-token/renderers/css/design-token-updater.renderers.js +29 -0
  75. package/src/core/design-token/renderers/css/design-token-updater.renderers.js.map +1 -0
  76. package/src/core/design-token/renderers/css/design-token-value.renderers.d.ts +19 -0
  77. package/src/core/design-token/renderers/css/design-token-value.renderers.d.ts.map +1 -0
  78. package/src/core/design-token/renderers/css/design-token-value.renderers.js +29 -0
  79. package/src/core/design-token/renderers/css/design-token-value.renderers.js.map +1 -0
  80. package/src/core/design-token/renderers/css/index.d.ts +4 -0
  81. package/src/core/design-token/renderers/css/index.d.ts.map +1 -0
  82. package/src/core/design-token/renderers/css/index.js +7 -0
  83. package/src/core/design-token/renderers/css/index.js.map +1 -0
  84. package/src/core/design-token/renderers/design-token-style.renderer.d.ts +25 -0
  85. package/src/core/design-token/renderers/design-token-style.renderer.d.ts.map +1 -0
  86. package/src/core/design-token/renderers/design-token-style.renderer.js +58 -0
  87. package/src/core/design-token/renderers/design-token-style.renderer.js.map +1 -0
  88. package/src/core/design-token/renderers/design-token.renderer.helpers.d.ts +8 -0
  89. package/src/core/design-token/renderers/design-token.renderer.helpers.d.ts.map +1 -0
  90. package/src/core/design-token/renderers/design-token.renderer.helpers.js +11 -0
  91. package/src/core/design-token/renderers/design-token.renderer.helpers.js.map +1 -0
  92. package/src/core/design-token/renderers/design-token.renderer.interface.d.ts +56 -0
  93. package/src/core/design-token/renderers/design-token.renderer.interface.d.ts.map +1 -0
  94. package/src/core/design-token/renderers/design-token.renderer.interface.js +3 -0
  95. package/src/core/design-token/renderers/design-token.renderer.interface.js.map +1 -0
  96. package/src/core/design-token/renderers/index.d.ts +7 -0
  97. package/src/core/design-token/renderers/index.d.ts.map +1 -0
  98. package/src/core/design-token/renderers/index.js +10 -0
  99. package/src/core/design-token/renderers/index.js.map +1 -0
  100. package/src/core/design-token/renderers/metadata/design-token-definition.renderers.d.ts +39 -0
  101. package/src/core/design-token/renderers/metadata/design-token-definition.renderers.d.ts.map +1 -0
  102. package/src/core/design-token/renderers/metadata/design-token-definition.renderers.js +41 -0
  103. package/src/core/design-token/renderers/metadata/design-token-definition.renderers.js.map +1 -0
  104. package/src/core/design-token/renderers/metadata/design-token-updater.renderers.d.ts +6 -0
  105. package/src/core/design-token/renderers/metadata/design-token-updater.renderers.d.ts.map +1 -0
  106. package/src/core/design-token/renderers/metadata/design-token-updater.renderers.js +13 -0
  107. package/src/core/design-token/renderers/metadata/design-token-updater.renderers.js.map +1 -0
  108. package/src/core/design-token/renderers/metadata/design-token-value.renderers.d.ts +18 -0
  109. package/src/core/design-token/renderers/metadata/design-token-value.renderers.d.ts.map +1 -0
  110. package/src/core/design-token/renderers/metadata/design-token-value.renderers.js +27 -0
  111. package/src/core/design-token/renderers/metadata/design-token-value.renderers.js.map +1 -0
  112. package/src/core/design-token/renderers/metadata/index.d.ts +4 -0
  113. package/src/core/design-token/renderers/metadata/index.d.ts.map +1 -0
  114. package/src/core/design-token/renderers/metadata/index.js +7 -0
  115. package/src/core/design-token/renderers/metadata/index.js.map +1 -0
  116. package/src/core/design-token/renderers/sass/design-token-definition.renderers.d.ts +22 -0
  117. package/src/core/design-token/renderers/sass/design-token-definition.renderers.d.ts.map +1 -0
  118. package/src/core/design-token/renderers/sass/design-token-definition.renderers.js +27 -0
  119. package/src/core/design-token/renderers/sass/design-token-definition.renderers.js.map +1 -0
  120. package/src/core/design-token/renderers/sass/index.d.ts +2 -0
  121. package/src/core/design-token/renderers/sass/index.d.ts.map +1 -0
  122. package/src/core/design-token/renderers/sass/index.js +5 -0
  123. package/src/core/design-token/renderers/sass/index.js.map +1 -0
  124. package/src/core/index.d.ts +2 -0
  125. package/src/core/index.d.ts.map +1 -0
  126. package/src/core/index.js +5 -0
  127. package/src/core/index.js.map +1 -0
  128. package/src/public_api.d.ts +2 -0
  129. package/src/public_api.d.ts.map +1 -0
  130. package/src/public_api.js +5 -0
  131. package/src/public_api.js.map +1 -0
@@ -0,0 +1,195 @@
1
+ /** Metadata information added in the design token extension for Metadata extraction */
2
+ export interface DesignTokenMetadata {
3
+ tags?: string[];
4
+ /** Description of the variable */
5
+ label?: string;
6
+ /** Name of a group of variables */
7
+ category?: string;
8
+ }
9
+ /** Design Token Group Extension fields supported by the default renderer */
10
+ export interface DesignTokenGroupExtensions {
11
+ /** Indicate the file where to generate the token */
12
+ o3rTargetFile?: string;
13
+ /**
14
+ * Indicate that the variable does not need to be generated.
15
+ * It is up to the generator to describe how to render private variables.
16
+ * It can choose to ignore the private extension, it can provide a dedicated renderer (for example to prefix it with '_') or it can decide to skip the generation straight to its referenced value.
17
+ */
18
+ o3rPrivate?: boolean;
19
+ /** Indicate that the value of this token is flagged as important */
20
+ o3rImportant?: boolean;
21
+ /** Metadata specific information */
22
+ o3rMetadata?: DesignTokenMetadata;
23
+ /** Scope of the Design Token value */
24
+ o3rScope?: string;
25
+ }
26
+ /** Design Token Extension fields supported by the default renderer */
27
+ export interface DesignTokenExtensions extends DesignTokenGroupExtensions {
28
+ }
29
+ interface DesignTokenBase<T> {
30
+ /** Value of the Token */
31
+ $value: T;
32
+ /** Type of the Design Token */
33
+ $type: string;
34
+ }
35
+ /** Design Token without explicit type (mainly alias) */
36
+ export interface DesignTokenTypeImplicit {
37
+ /** Value of the Token */
38
+ $value: string;
39
+ /** @inheritdoc */
40
+ $type?: undefined;
41
+ }
42
+ /** Design Token Color */
43
+ export interface DesignTokenTypeColor extends DesignTokenBase<string> {
44
+ /** @inheritdoc */
45
+ $type: 'color';
46
+ }
47
+ /** Design Token Dimension */
48
+ export interface DesignTokenTypeDimension extends DesignTokenBase<string> {
49
+ /** @inheritdoc */
50
+ $type: 'dimension';
51
+ }
52
+ /** Design Token Font Family */
53
+ export interface DesignTokenTypeFontFamily extends DesignTokenBase<string> {
54
+ /** @inheritdoc */
55
+ $type: 'fontFamily';
56
+ }
57
+ /** Design Token Duration */
58
+ export interface DesignTokenTypeDuration extends DesignTokenBase<number | string> {
59
+ /** @inheritdoc */
60
+ $type: 'duration';
61
+ }
62
+ type DesignTokenTypeCubicBezierValue = (number | string)[];
63
+ /** Design Token Cubic Bezier */
64
+ export interface DesignTokenTypeCubicBezier extends DesignTokenBase<DesignTokenTypeCubicBezierValue> {
65
+ /** @inheritdoc */
66
+ $type: 'cubicBezier';
67
+ }
68
+ type DesignTokenTypeFontWeightValue = number | string;
69
+ /** Design Token Font Weight */
70
+ export interface DesignTokenTypeFontWeight extends DesignTokenBase<DesignTokenTypeFontWeightValue> {
71
+ /** @inheritdoc */
72
+ $type: 'fontWeight';
73
+ }
74
+ /** Design Token Number */
75
+ export interface DesignTokenTypeNumber extends DesignTokenBase<number | string> {
76
+ /** @inheritdoc */
77
+ $type: 'number';
78
+ }
79
+ type DesignTokenTypeStrokeStyleDetailsValue = {
80
+ dashArray: string[];
81
+ lineCap: 'round' | 'butt' | 'square';
82
+ };
83
+ /** Value of the Design Token Stroke Style */
84
+ export type DesignTokenTypeStrokeStyleValue = DesignTokenTypeStrokeStyleDetailsValue | 'solid' | 'dashed' | 'dotted' | 'double' | 'groove' | 'ridge' | 'outset' | 'inset';
85
+ /** Design Token Stroke Style */
86
+ export interface DesignTokenTypeStrokeStyle<T extends DesignTokenTypeStrokeStyleValue = DesignTokenTypeStrokeStyleValue> extends DesignTokenBase<T> {
87
+ /** @inheritdoc */
88
+ $type: 'strokeStyle';
89
+ }
90
+ type DesignTokenTypeBorderValue = {
91
+ color: string;
92
+ width: string;
93
+ style: string | DesignTokenTypeStrokeStyleValue;
94
+ };
95
+ /** Design Token Border */
96
+ export interface DesignTokenTypeBorder extends DesignTokenBase<DesignTokenTypeBorderValue> {
97
+ /** @inheritdoc */
98
+ $type: 'border';
99
+ }
100
+ type DesignTokenTypeTransitionValue = {
101
+ duration: string;
102
+ delay: string;
103
+ timingFunction: string | DesignTokenTypeCubicBezierValue;
104
+ };
105
+ /** Design Token Transition */
106
+ export interface DesignTokenTypeTransition extends DesignTokenBase<DesignTokenTypeTransitionValue> {
107
+ /** @inheritdoc */
108
+ $type: 'transition';
109
+ }
110
+ type DesignTokenTypeShadowValue = {
111
+ color: string;
112
+ offsetX: string;
113
+ offsetY: string;
114
+ blur: string;
115
+ spread: string;
116
+ };
117
+ /** Design Token Shadow */
118
+ export interface DesignTokenTypeShadow extends DesignTokenBase<DesignTokenTypeShadowValue> {
119
+ /** @inheritdoc */
120
+ $type: 'shadow';
121
+ }
122
+ type DesignTokenTypeGradientValue = {
123
+ color: string;
124
+ position: string | number;
125
+ }[];
126
+ /** Design Token Gradient */
127
+ export interface DesignTokenTypeGradient extends DesignTokenBase<DesignTokenTypeGradientValue> {
128
+ /** @inheritdoc */
129
+ $type: 'gradient';
130
+ }
131
+ type DesignTokenTypeTypographyValue = {
132
+ fontFamily: string;
133
+ fontSize: string;
134
+ letterSpacing: string;
135
+ fontWeight: DesignTokenTypeFontWeightValue;
136
+ lineHeight: string | number;
137
+ };
138
+ /** Design Token Typography */
139
+ export interface DesignTokenTypeTypography extends DesignTokenBase<DesignTokenTypeTypographyValue> {
140
+ /** @inheritdoc */
141
+ $type: 'typography';
142
+ }
143
+ /** Common field for the Design Token Groups */
144
+ export interface DesignTokenGroupCommonFields<G extends DesignTokenExtensions> {
145
+ /** Description of the Group */
146
+ $description?: string;
147
+ /** Design Token Extension */
148
+ $extensions?: G;
149
+ }
150
+ /** Common field for the Design Token */
151
+ export type DesignTokenCommonFields<E extends DesignTokenExtensions = DesignTokenExtensions> = DesignTokenGroupCommonFields<E>;
152
+ /** Available Design Token types */
153
+ export type DesignToken<E extends DesignTokenExtensions = DesignTokenExtensions> = DesignTokenCommonFields<E> & (DesignTokenTypeColor | DesignTokenTypeDimension | DesignTokenTypeFontFamily | DesignTokenTypeDuration | DesignTokenTypeCubicBezier | DesignTokenTypeFontWeight | DesignTokenTypeNumber | DesignTokenTypeStrokeStyle | DesignTokenTypeBorder | DesignTokenTypeTransition | DesignTokenTypeShadow | DesignTokenTypeGradient | DesignTokenTypeTypography | DesignTokenTypeImplicit);
154
+ /** Design Token Node (Design Token Group or Item) */
155
+ export type DesignTokenNode<E extends DesignTokenExtensions = DesignTokenExtensions, G extends DesignTokenGroupExtensions = E> = DesignTokenGroup<E, G> | DesignToken<E>;
156
+ /** Design Token Group */
157
+ export type DesignTokenGroup<E extends DesignTokenExtensions = DesignTokenExtensions, G extends DesignTokenGroupExtensions = E> = DesignTokenGroupCommonFields<G> & {
158
+ [x: string]: DesignTokenNode<E, G> | E | string | boolean | undefined;
159
+ };
160
+ /** Context of the Design Token specification document */
161
+ export type DesignTokenContext = {
162
+ /** Base path used to compute the path of the file to render the Tokens into */
163
+ basePath?: string;
164
+ };
165
+ /** Design Token specification */
166
+ export type DesignTokenSpecification<C extends DesignTokenContext = DesignTokenContext, E extends DesignTokenExtensions = DesignTokenExtensions, G extends DesignTokenGroupExtensions = E> = {
167
+ /** Specification as described on {@link https://design-tokens.github.io/community-group/format/} */
168
+ document: DesignTokenGroup<E, G>;
169
+ /** Specification document context information */
170
+ context?: C;
171
+ };
172
+ /**
173
+ * Determine if the Design Token Node is a Token (not a Group)
174
+ * @param node Design Token Node
175
+ */
176
+ export declare const isDesignToken: (node?: any) => node is DesignToken<DesignTokenExtensions>;
177
+ /**
178
+ * Determine if the Design Token Node is a Group (not a Token)
179
+ * @param node Design Token Node
180
+ */
181
+ export declare const isDesignTokenGroup: (node?: any) => node is DesignTokenGroup<DesignTokenExtensions, DesignTokenExtensions>;
182
+ /**
183
+ * Determine if the Stroke Style value is defined or is a reference
184
+ * @param value Stroke Style value
185
+ * @returns true if it is a defined value
186
+ */
187
+ export declare const isTokenTypeStrokeStyleValueComplex: (value?: DesignTokenTypeStrokeStyleValue | string) => value is DesignTokenTypeStrokeStyleDetailsValue;
188
+ /**
189
+ * Determine if the Stroke Style Token has a value defined or is a reference
190
+ * @param node Stroke Style Token
191
+ * @returns true if it is a token with defined value
192
+ */
193
+ export declare const isTokenTypeStrokeStyleComplex: (node?: DesignTokenTypeStrokeStyle) => node is DesignTokenTypeStrokeStyle<DesignTokenTypeStrokeStyleDetailsValue>;
194
+ export {};
195
+ //# sourceMappingURL=design-token-specification.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"design-token-specification.interface.d.ts","sourceRoot":"","sources":["../../../../src/core/design-token/design-token-specification.interface.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,4EAA4E;AAC5E,MAAM,WAAW,0BAA0B;IACzC,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oEAAoE;IACpE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oCAAoC;IACpC,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,sCAAsC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,sEAAsE;AACtE,MAAM,WAAW,qBAAsB,SAAQ,0BAA0B;CACxE;AAGD,UAAU,eAAe,CAAC,CAAC;IACzB,yBAAyB;IACzB,MAAM,EAAE,CAAC,CAAC;IAEV,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wDAAwD;AACxD,MAAM,WAAW,uBAAuB;IACtC,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IAEf,kBAAkB;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED,yBAAyB;AACzB,MAAM,WAAW,oBAAqB,SAAQ,eAAe,CAAC,MAAM,CAAC;IACnE,kBAAkB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B,CAAC,CAAC,SAAS,qBAAqB,GAAG,qBAAqB,EAAE,CAAC,SAAS,0BAA0B,GAAG,CAAC,IAC5H,4BAA4B,CAAC,CAAC,CAAC,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;CAAE,CAAC;AAE9G,yDAAyD;AACzD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,iCAAiC;AACjC,MAAM,MAAM,wBAAwB,CAAC,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,EAAE,CAAC,SAAS,qBAAqB,GAAG,qBAAqB,EAAE,CAAC,SAAS,0BAA0B,GAAG,CAAC,IAAI;IAC3L,oGAAoG;IACpG,QAAQ,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACjC,iDAAiD;IACjD,OAAO,CAAC,EAAE,CAAC,CAAC;CACb,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,UAAW,GAAG,+CAEvC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,UAAW,GAAG,2EAE5C,CAAC;AAEF;;;;GAIG;AAEH,eAAO,MAAM,kCAAkC,WAAY,+BAA+B,GAAG,MAAM,oDAElG,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,UAAW,0BAA0B,+EAE9E,CAAC"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isTokenTypeStrokeStyleComplex = exports.isTokenTypeStrokeStyleValueComplex = exports.isDesignTokenGroup = exports.isDesignToken = void 0;
4
+ /**
5
+ * Determine if the Design Token Node is a Token (not a Group)
6
+ * @param node Design Token Node
7
+ */
8
+ const isDesignToken = (node) => {
9
+ return !!node && (typeof node.$type !== 'undefined' || typeof node.$value === 'string');
10
+ };
11
+ exports.isDesignToken = isDesignToken;
12
+ /**
13
+ * Determine if the Design Token Node is a Group (not a Token)
14
+ * @param node Design Token Node
15
+ */
16
+ const isDesignTokenGroup = (node) => {
17
+ return typeof node === 'object' && Object.keys(node).some((k) => !k.startsWith('$'));
18
+ };
19
+ exports.isDesignTokenGroup = isDesignTokenGroup;
20
+ /**
21
+ * Determine if the Stroke Style value is defined or is a reference
22
+ * @param value Stroke Style value
23
+ * @returns true if it is a defined value
24
+ */
25
+ // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
26
+ const isTokenTypeStrokeStyleValueComplex = (value) => {
27
+ return !!value && typeof value !== 'string';
28
+ };
29
+ exports.isTokenTypeStrokeStyleValueComplex = isTokenTypeStrokeStyleValueComplex;
30
+ /**
31
+ * Determine if the Stroke Style Token has a value defined or is a reference
32
+ * @param node Stroke Style Token
33
+ * @returns true if it is a token with defined value
34
+ */
35
+ const isTokenTypeStrokeStyleComplex = (node) => {
36
+ return !!node && (0, exports.isTokenTypeStrokeStyleValueComplex)(node.$value);
37
+ };
38
+ exports.isTokenTypeStrokeStyleComplex = isTokenTypeStrokeStyleComplex;
39
+ //# sourceMappingURL=design-token-specification.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"design-token-specification.interface.js","sourceRoot":"","sources":["../../../../src/core/design-token/design-token-specification.interface.ts"],"names":[],"mappings":";;;AAsOA;;;GAGG;AACI,MAAM,aAAa,GAAG,CAAC,IAAU,EAAuB,EAAE;IAC/D,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,KAAK,WAAW,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC;AAC1F,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB;AAEF;;;GAGG;AACI,MAAM,kBAAkB,GAAG,CAAC,IAAU,EAA4B,EAAE;IACzE,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;AACvF,CAAC,CAAC;AAFW,QAAA,kBAAkB,sBAE7B;AAEF;;;;GAIG;AACH,6EAA6E;AACtE,MAAM,kCAAkC,GAAG,CAAC,KAAgD,EAAmD,EAAE;IACtJ,OAAO,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AAC9C,CAAC,CAAC;AAFW,QAAA,kCAAkC,sCAE7C;AAEF;;;;GAIG;AACI,MAAM,6BAA6B,GAAG,CAAC,IAAiC,EAA8E,EAAE;IAC7J,OAAO,CAAC,CAAC,IAAI,IAAI,IAAA,0CAAkC,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACnE,CAAC,CAAC;AAFW,QAAA,6BAA6B,iCAExC"}
@@ -0,0 +1,4 @@
1
+ export * from './renderers/index';
2
+ export * from './parsers/index';
3
+ export * from './design-token-specification.interface';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/design-token/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wCAAwC,CAAC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./renderers/index"), exports);
5
+ tslib_1.__exportStar(require("./parsers/index"), exports);
6
+ tslib_1.__exportStar(require("./design-token-specification.interface"), exports);
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/design-token/index.ts"],"names":[],"mappings":";;;AAAA,4DAAkC;AAClC,0DAAgC;AAChC,iFAAuD"}
@@ -0,0 +1,70 @@
1
+ import type { DesignToken, DesignTokenContext, DesignTokenExtensions, DesignTokenGroup, DesignTokenGroupExtensions } from '../design-token-specification.interface';
2
+ /** Reference to a parent node*/
3
+ export interface ParentReference {
4
+ /** Design Token name */
5
+ name: string;
6
+ /** Design Token Group node */
7
+ tokenNode: DesignTokenGroup;
8
+ }
9
+ /**
10
+ * Function rendering the Design Token Value
11
+ * @param tokenStructure Parsed Design Token
12
+ * @param variableSet Complete list of the parsed Design Token
13
+ */
14
+ export type TokenValueRenderer = (tokenStructure: DesignTokenVariableStructure, variableSet: Map<string, DesignTokenVariableStructure>) => string;
15
+ /**
16
+ * Function rendering the Design Token Key
17
+ * @param tokenStructure Parsed Design Token
18
+ */
19
+ export type TokenKeyRenderer = (tokenStructure: DesignTokenVariableStructure) => string;
20
+ /** Complete list of the parsed Design Token */
21
+ export type DesignTokenVariableSet = Map<string, DesignTokenVariableStructure>;
22
+ /** Parsed Design Token variable */
23
+ export interface DesignTokenVariableStructure {
24
+ /** Context of the Token determined or provided during the parsing process */
25
+ context?: DesignTokenContext;
26
+ /** Design Token Extension */
27
+ extensions: DesignTokenGroupExtensions & DesignTokenExtensions;
28
+ /** Reference to the Design Token node */
29
+ node: DesignToken;
30
+ /** Name of the token in references */
31
+ tokenReferenceName: string;
32
+ /** Description of the Token */
33
+ description?: string;
34
+ /** List of the Ancestors references */
35
+ ancestors: ParentReference[];
36
+ /** Reference to the direct parent node */
37
+ parent?: ParentReference;
38
+ /**
39
+ * Retrieve the list of the references of the Design Token
40
+ * @param variableSet Complete list of the parsed Design Token
41
+ */
42
+ getReferences: (variableSet?: DesignTokenVariableSet) => string[];
43
+ /**
44
+ * Raw CSS value of the Token
45
+ * @param variableSet Complete list of the parsed Design Token
46
+ */
47
+ getCssRawValue: (variableSet?: DesignTokenVariableSet) => string;
48
+ /**
49
+ * Determine if the Token is an alias
50
+ * @param variableSet Complete list of the parsed Design Token
51
+ */
52
+ getIsAlias: (variableSet?: DesignTokenVariableSet) => boolean;
53
+ /**
54
+ * Retrieve the type calculated for the Token
55
+ * @param followReference Determine if the references should be follow to calculate the type
56
+ * @param variableSet Complete list of the parsed Design Token
57
+ */
58
+ getType: (variableSet?: DesignTokenVariableSet, followReference?: boolean) => DesignToken['$type'];
59
+ /**
60
+ * Retrieve the list of the references of the Design Token node
61
+ * @param followReference Determine if the references should be follow to calculate the type
62
+ */
63
+ getReferencesNode: (variableSet?: DesignTokenVariableSet) => DesignTokenVariableStructure[];
64
+ /**
65
+ * Retrieve the Design Token Key as rendered by the provided renderer
66
+ * @param keyRenderer Renderer for the Design Token key
67
+ */
68
+ getKey: (keyRenderer?: TokenKeyRenderer) => string;
69
+ }
70
+ //# sourceMappingURL=design-token-parser.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"design-token-parser.interface.d.ts","sourceRoot":"","sources":["../../../../../src/core/design-token/parsers/design-token-parser.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAEpK,gCAAgC;AAChC,MAAM,WAAW,eAAe;IAC9B,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,SAAS,EAAE,gBAAgB,CAAC;CAC7B;AAED;;;;GAIG;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,cAAc,EAAE,4BAA4B,EAAE,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,4BAA4B,CAAC,KAAK,MAAM,CAAC;AAElJ;;;GAGG;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,cAAc,EAAE,4BAA4B,KAAK,MAAM,CAAC;AAExF,+CAA+C;AAE/C,MAAM,MAAM,sBAAsB,GAAG,GAAG,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC;AAE/E,mCAAmC;AACnC,MAAM,WAAW,4BAA4B;IAC3C,6EAA6E;IAC7E,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,6BAA6B;IAC7B,UAAU,EAAE,0BAA0B,GAAG,qBAAqB,CAAC;IAC/D,yCAAyC;IACzC,IAAI,EAAE,WAAW,CAAC;IAClB,sCAAsC;IACtC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,+BAA+B;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,0CAA0C;IAC1C,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB;;;OAGG;IACH,aAAa,EAAE,CAAC,WAAW,CAAC,EAAE,sBAAsB,KAAK,MAAM,EAAE,CAAC;IAClE;;;OAGG;IACH,cAAc,EAAE,CAAC,WAAW,CAAC,EAAE,sBAAsB,KAAK,MAAM,CAAC;IACjE;;;OAGG;IACH,UAAU,EAAE,CAAC,WAAW,CAAC,EAAE,sBAAsB,KAAK,OAAO,CAAC;IAC9D;;;;OAIG;IACH,OAAO,EAAE,CAAC,WAAW,CAAC,EAAE,sBAAsB,EAAE,eAAe,CAAC,EAAE,OAAO,KAAK,WAAW,CAAC,OAAO,CAAC,CAAC;IACnG;;;OAGG;IACH,iBAAiB,EAAE,CAAC,WAAW,CAAC,EAAE,sBAAsB,KAAK,4BAA4B,EAAE,CAAC;IAC5F;;;OAGG;IACH,MAAM,EAAE,CAAC,WAAW,CAAC,EAAE,gBAAgB,KAAK,MAAM,CAAC;CACpD"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=design-token-parser.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"design-token-parser.interface.js","sourceRoot":"","sources":["../../../../../src/core/design-token/parsers/design-token-parser.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ import type { DesignTokenVariableSet } from './design-token-parser.interface';
2
+ import type { DesignTokenContext, DesignTokenSpecification } from '../design-token-specification.interface';
3
+ /**
4
+ * Parse a Design Token Object to provide the map of Token with helpers to generate the different output
5
+ * @param specification Design Token content as specified on https://design-tokens.github.io/community-group/format/
6
+ */
7
+ export declare const parseDesignToken: (specification: DesignTokenSpecification) => DesignTokenVariableSet;
8
+ interface ParseDesignTokenFileOptions {
9
+ /**
10
+ * Custom function to read a file required by the token renderer
11
+ * @default {@see fs.promises.readFile}
12
+ * @param filePath Path to the file to read
13
+ */
14
+ readFile?: (filePath: string) => string | Promise<string>;
15
+ /** Custom context to provide to the parser and override the information determined by the specification parse process */
16
+ specificationContext?: DesignTokenContext;
17
+ }
18
+ /**
19
+ * Parse a Design Token File to provide the map of Token with helpers to generate the different output
20
+ * @param specificationFilePath Path to the a Design Token file following the specification on https://design-tokens.github.io/community-group/format/
21
+ * @param options
22
+ */
23
+ export declare const parseDesignTokenFile: (specificationFilePath: string, options?: ParseDesignTokenFileOptions) => Promise<DesignTokenVariableSet>;
24
+ export {};
25
+ //# sourceMappingURL=design-token.parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"design-token.parser.d.ts","sourceRoot":"","sources":["../../../../../src/core/design-token/parsers/design-token.parser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAiD,MAAM,iCAAiC,CAAC;AAC7H,OAAO,KAAK,EAEV,kBAAkB,EAKlB,wBAAwB,EACzB,MAAM,yCAAyC,CAAC;AA4IjD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,kBAAmB,wBAAwB,2BAEvE,CAAC;AAEF,UAAU,2BAA2B;IACnC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE1D,yHAAyH;IACzH,oBAAoB,CAAC,EAAE,kBAAkB,CAAC;CAC3C;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,0BAAiC,MAAM,YAAY,2BAA2B,oCAM9G,CAAC"}
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseDesignTokenFile = exports.parseDesignToken = void 0;
4
+ const node_fs_1 = require("node:fs");
5
+ const design_token_specification_interface_1 = require("../design-token-specification.interface");
6
+ const node_path_1 = require("node:path");
7
+ const tokenReferenceRegExp = /\{([^}]+)\}/g;
8
+ const getTokenReferenceName = (tokenName, parents) => (`${parents.join('.')}.${tokenName}`);
9
+ const getExtensions = (parentNode) => parentNode.reduce((acc, node) => ({ ...acc, ...node.$extensions }), {});
10
+ const getReferences = (cssRawValue) => Array.from(cssRawValue.matchAll(tokenReferenceRegExp)).map(([, tokenRef]) => tokenRef);
11
+ // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
12
+ const renderCssTypeStrokeStyleValue = (value) => (0, design_token_specification_interface_1.isTokenTypeStrokeStyleValueComplex)(value) ? `${value.lineCap} ${value.dashArray.join(' ')}` : value;
13
+ const getCssRawValue = (variableSet, { node, getType }) => {
14
+ const nodeType = getType(variableSet, false);
15
+ if (!nodeType && node.$value) {
16
+ return typeof node.$value.toString !== undefined ? node.$value.toString() : JSON.stringify(node.$value);
17
+ }
18
+ const checkNode = {
19
+ ...node,
20
+ $type: node.$type || nodeType
21
+ };
22
+ // TODO in the following code, `typeof checkNode.$value === 'string' ? checkNode.$value :` is defined to please Jest TS compilation. It should be removed when supported
23
+ switch (checkNode.$type) {
24
+ case 'color':
25
+ case 'number':
26
+ case 'duration':
27
+ case 'fontWeight':
28
+ case 'fontFamily':
29
+ case 'dimension': {
30
+ return checkNode.$value.toString();
31
+ }
32
+ case 'strokeStyle': {
33
+ return renderCssTypeStrokeStyleValue(checkNode.$value);
34
+ }
35
+ case 'cubicBezier': {
36
+ return typeof checkNode.$value === 'string' ? checkNode.$value :
37
+ checkNode.$value.join(', ');
38
+ }
39
+ case 'border': {
40
+ return typeof checkNode.$value === 'string' ? checkNode.$value :
41
+ `${checkNode.$value.width} ${renderCssTypeStrokeStyleValue(checkNode.$value.style)} ${checkNode.$value.color}`;
42
+ }
43
+ case 'gradient': {
44
+ return typeof checkNode.$value === 'string' ? checkNode.$value :
45
+ // TODO: add support of different gradient type when design-tokens/community-group#101 is fixed.
46
+ `linear-gradient(0deg, ${checkNode.$value.map(({ color, position }) => `${color} ${position}`).join(', ')})`;
47
+ }
48
+ case 'shadow': {
49
+ return typeof checkNode.$value === 'string' ? checkNode.$value :
50
+ `${checkNode.$value.offsetX} ${checkNode.$value.offsetY} ${checkNode.$value.blur} ${checkNode.$value.spread} ${checkNode.$value.color}`;
51
+ }
52
+ case 'transition': {
53
+ return typeof checkNode.$value === 'string' ? checkNode.$value :
54
+ typeof checkNode.$value.timingFunction === 'string' ? checkNode.$value.timingFunction : checkNode.$value.timingFunction.join(' ') +
55
+ ` ${checkNode.$value.duration} ${checkNode.$value.delay}`;
56
+ }
57
+ case 'typography': {
58
+ return typeof checkNode.$value === 'string' ? checkNode.$value :
59
+ `${checkNode.$value.fontWeight} ${checkNode.$value.fontFamily} ${checkNode.$value.fontSize} ${checkNode.$value.letterSpacing} ${checkNode.$value.lineHeight}`;
60
+ }
61
+ default: {
62
+ throw new Error(`Not supported type ${checkNode.$type || 'unknown'} (value: ${checkNode.$value || 'unknown'})`);
63
+ }
64
+ }
65
+ };
66
+ const walkThroughDesignTokenNodes = (node, context, ancestors, mem, nodeName) => {
67
+ if ((0, design_token_specification_interface_1.isDesignTokenGroup)(node)) {
68
+ Object.entries(node)
69
+ .filter(([tokenName, tokenNode]) => !tokenName.startsWith('$') && ((0, design_token_specification_interface_1.isDesignToken)(tokenNode) || (0, design_token_specification_interface_1.isDesignTokenGroup)(tokenNode)))
70
+ .forEach(([tokenName, tokenNode]) => walkThroughDesignTokenNodes(tokenNode, context, nodeName ? [...ancestors, { name: nodeName, tokenNode: node }] : ancestors, mem, tokenName));
71
+ }
72
+ if ((0, design_token_specification_interface_1.isDesignToken)(node)) {
73
+ if (!nodeName) {
74
+ throw new Error('The first node of the Design Specification can not be a token');
75
+ }
76
+ const parentNames = ancestors.map(({ name }) => name);
77
+ const tokenReferenceName = getTokenReferenceName(nodeName, parentNames);
78
+ const tokenVariable = {
79
+ context,
80
+ extensions: getExtensions([...ancestors.map(({ tokenNode }) => tokenNode), node]),
81
+ node,
82
+ tokenReferenceName,
83
+ ancestors,
84
+ parent: ancestors.slice(-1)[0],
85
+ description: node.$description,
86
+ getCssRawValue: function (variableSet = mem) {
87
+ return getCssRawValue(variableSet, this);
88
+ },
89
+ getReferences: function (variableSet = mem) {
90
+ return getReferences(this.getCssRawValue(variableSet));
91
+ },
92
+ getIsAlias: function (variableSet = mem) {
93
+ return this.getReferences(variableSet).length === 1 && typeof node.$value === 'string' && !!node.$value?.toString().match(/^\{[^}]*\}$/);
94
+ },
95
+ getReferencesNode: function (variableSet = mem) {
96
+ return this.getReferences(variableSet)
97
+ .map((ref) => {
98
+ if (!variableSet.has(ref)) {
99
+ throw new Error(`Reference to ${ref} not found`);
100
+ }
101
+ return variableSet.get(ref);
102
+ });
103
+ },
104
+ getType: function (variableSet = mem, followReference = true) {
105
+ return node.$type ||
106
+ followReference && this.getIsAlias(variableSet) && this.getReferencesNode(variableSet)[0]?.getType(variableSet, followReference) ||
107
+ followReference && this.parent?.name && variableSet.get(this.parent.name)?.getType(variableSet, followReference) ||
108
+ undefined;
109
+ },
110
+ getKey: function (keyRenderer) {
111
+ return keyRenderer ? keyRenderer(this) : this.tokenReferenceName.replace(/[ .]+/g, '-');
112
+ }
113
+ };
114
+ mem.set(tokenReferenceName, tokenVariable);
115
+ }
116
+ else if (!(0, design_token_specification_interface_1.isDesignTokenGroup)(node)) {
117
+ throw new Error('Fail to determine the Design Token Node type');
118
+ }
119
+ return mem;
120
+ };
121
+ /**
122
+ * Parse a Design Token Object to provide the map of Token with helpers to generate the different output
123
+ * @param specification Design Token content as specified on https://design-tokens.github.io/community-group/format/
124
+ */
125
+ const parseDesignToken = (specification) => {
126
+ return walkThroughDesignTokenNodes(specification.document, specification.context, [], new Map());
127
+ };
128
+ exports.parseDesignToken = parseDesignToken;
129
+ /**
130
+ * Parse a Design Token File to provide the map of Token with helpers to generate the different output
131
+ * @param specificationFilePath Path to the a Design Token file following the specification on https://design-tokens.github.io/community-group/format/
132
+ * @param options
133
+ */
134
+ const parseDesignTokenFile = async (specificationFilePath, options) => {
135
+ const readFile = options?.readFile || ((filePath) => node_fs_1.promises.readFile(filePath, { encoding: 'utf-8' }));
136
+ const context = {
137
+ basePath: (0, node_path_1.dirname)(specificationFilePath)
138
+ };
139
+ return (0, exports.parseDesignToken)({ document: JSON.parse(await readFile(specificationFilePath)), context });
140
+ };
141
+ exports.parseDesignTokenFile = parseDesignTokenFile;
142
+ //# sourceMappingURL=design-token.parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"design-token.parser.js","sourceRoot":"","sources":["../../../../../src/core/design-token/parsers/design-token.parser.ts"],"names":[],"mappings":";;;AAAA,qCAAyC;AAWzC,kGAKiD;AACjD,yCAAoC;AAEpC,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAE5C,MAAM,qBAAqB,GAAG,CAAC,SAAiB,EAAE,OAAiB,EAAE,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,EAAE,CAAC,CAAC;AAC9G,MAAM,aAAa,GAAG,CAAC,UAA6B,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAC,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC,WAAW,EAAC,CAAC,EAAE,EAAwD,CAAC,CAAC;AACrL,MAAM,aAAa,GAAG,CAAC,WAAmB,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,QAAQ,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AAC,EAAE;QAClC,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;KACjE;IAED,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF;;;GAGG;AACI,MAAM,gBAAgB,GAAG,CAAC,aAAuC,EAA0B,EAAE;IAClG,OAAO,2BAA2B,CAAC,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC,OAAO,EAAE,EAAE,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AACnG,CAAC,CAAC;AAFW,QAAA,gBAAgB,oBAE3B;AAcF;;;;GAIG;AACI,MAAM,oBAAoB,GAAG,KAAK,EAAE,qBAA6B,EAAE,OAAqC,EAAE,EAAE;IACjH,MAAM,QAAQ,GAAG,OAAO,EAAE,QAAQ,IAAI,CAAC,CAAC,QAAgB,EAAE,EAAE,CAAC,kBAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IAC3G,MAAM,OAAO,GAAuB;QAClC,QAAQ,EAAE,IAAA,mBAAO,EAAC,qBAAqB,CAAC;KACzC,CAAC;IACF,OAAO,IAAA,wBAAgB,EAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,qBAAqB,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;AACpG,CAAC,CAAC;AANW,QAAA,oBAAoB,wBAM/B"}
@@ -0,0 +1,3 @@
1
+ export * from './design-token-parser.interface';
2
+ export * from './design-token.parser';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/design-token/parsers/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./design-token-parser.interface"), exports);
5
+ tslib_1.__exportStar(require("./design-token.parser"), exports);
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/design-token/parsers/index.ts"],"names":[],"mappings":";;;AAAA,0EAAgD;AAChD,gEAAsC"}
@@ -0,0 +1,47 @@
1
+ import type { DesignTokenVariableStructure, TokenKeyRenderer, TokenValueRenderer } from '../../parsers/design-token-parser.interface';
2
+ import { TokenDefinitionRenderer } from '../design-token.renderer.interface';
3
+ /** Options for {@link CssTokenDefinitionRendererOptions} */
4
+ export interface CssTokenDefinitionRendererOptions {
5
+ /**
6
+ * Determine if the variable is private and should not be rendered
7
+ * @default {@see isO3rPrivateVariable}
8
+ */
9
+ isPrivateVariable?: (variable: DesignTokenVariableStructure) => boolean;
10
+ /** Custom Design Token value renderer */
11
+ tokenValueRenderer?: TokenValueRenderer;
12
+ /**
13
+ * Renderer the name of the CSS Variable (with the initial --)
14
+ */
15
+ tokenVariableNameRenderer?: TokenKeyRenderer;
16
+ /**
17
+ * Private Design Token definition renderer
18
+ * The private variable will not be rendered if not provided
19
+ */
20
+ privateDefinitionRenderer?: TokenDefinitionRenderer;
21
+ }
22
+ /**
23
+ * Retrieve the Design Token variable renderer for CSS
24
+ * @param options
25
+ * @returns
26
+ * @example CSS renderer with Sass fallback
27
+ * ```typescript
28
+ * import { getSassTokenDefinitionRenderer } from '@o3r/design';
29
+ *
30
+ * // List of parsed Design Token items
31
+ * const parsedTokenDesign = await parseDesignTokenFile('./path/to/spec.json');
32
+ *
33
+ * // Sass variable renderer
34
+ * const sassTokenDefinitionRenderer = getSassTokenDefinitionRenderer();
35
+ *
36
+ * // CSS variable renderer
37
+ * const cssTokenDefinitionRenderer = getCssTokenDefinitionRenderer({
38
+ * // Specify that the private variable should be rendered in Sass variable
39
+ * privateDefinitionRenderer: sassTokenDefinitionRenderer
40
+ * });
41
+ *
42
+ * // Render the CSS variables
43
+ * await renderDesignTokens(parsedTokenDesign, { tokenDefinitionRenderer: cssTokenDefinitionRenderer });
44
+ * ```
45
+ */
46
+ export declare const getCssTokenDefinitionRenderer: (options?: CssTokenDefinitionRendererOptions) => TokenDefinitionRenderer;
47
+ //# sourceMappingURL=design-token-definition.renderers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"design-token-definition.renderers.d.ts","sourceRoot":"","sources":["../../../../../../src/core/design-token/renderers/css/design-token-definition.renderers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEtI,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAG7E,4DAA4D;AAC5D,MAAM,WAAW,iCAAiC;IAChD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,4BAA4B,KAAK,OAAO,CAAC;IAExE,yCAAyC;IACzC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAExC;;OAEG;IACH,yBAAyB,CAAC,EAAE,gBAAgB,CAAC;IAE7C;;;OAGG;IACH,yBAAyB,CAAC,EAAE,uBAAuB,CAAC;CACrD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,6BAA6B,aAAc,iCAAiC,KAAG,uBAqB3F,CAAC"}