@udixio/theme 1.3.1 → 2.0.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.
Files changed (139) hide show
  1. package/CHANGELOG.md +8 -3
  2. package/dist/API.d.ts +7 -4
  3. package/dist/API.d.ts.map +1 -1
  4. package/dist/app.container.d.ts +1 -2
  5. package/dist/app.container.d.ts.map +1 -1
  6. package/dist/bin.cjs +1 -1
  7. package/dist/bin.js +1 -1
  8. package/dist/browser.cjs +22 -18
  9. package/dist/browser.js +32 -28
  10. package/dist/color/color.api.d.ts +11 -30
  11. package/dist/color/color.api.d.ts.map +1 -1
  12. package/dist/color/color.d.ts +99 -0
  13. package/dist/color/color.d.ts.map +1 -0
  14. package/dist/color/color.manager.d.ts +9 -17
  15. package/dist/color/color.manager.d.ts.map +1 -1
  16. package/dist/color/color.utils.d.ts +14 -3
  17. package/dist/color/color.utils.d.ts.map +1 -1
  18. package/dist/color/default-color.d.ts.map +1 -1
  19. package/dist/color/index.d.ts +1 -1
  20. package/dist/color/index.d.ts.map +1 -1
  21. package/dist/config/config.interface.d.ts +4 -4
  22. package/dist/config/config.interface.d.ts.map +1 -1
  23. package/dist/context/context.d.ts +41 -0
  24. package/dist/context/context.d.ts.map +1 -0
  25. package/dist/context/context.module.d.ts +3 -0
  26. package/dist/context/context.module.d.ts.map +1 -0
  27. package/dist/context/index.d.ts +3 -0
  28. package/dist/context/index.d.ts.map +1 -0
  29. package/dist/font.plugin-BZ-TTeTo.cjs +227 -0
  30. package/dist/font.plugin-DZtMajJV.js +228 -0
  31. package/dist/index.d.ts +6 -4
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/{load-from-path-DoZnR1-p.cjs → load-from-path-DZ35yiXK.cjs} +2 -2
  34. package/dist/{load-from-path-Bo1kCfh9.js → load-from-path-Dobe0beV.js} +1 -1
  35. package/dist/loader/loader.d.ts +1 -1
  36. package/dist/loader/loader.d.ts.map +1 -1
  37. package/dist/{loader-C8_TyOuS.js → loader-BS_Esfwg.js} +1408 -908
  38. package/dist/{loader-R7hccp8_.cjs → loader-C8LnOoqg.cjs} +1392 -892
  39. package/dist/material-color-utilities/dynamic_color.d.ts +0 -22
  40. package/dist/material-color-utilities/dynamic_color.d.ts.map +1 -1
  41. package/dist/material-color-utilities/toneDeltaPair.d.ts +8 -8
  42. package/dist/material-color-utilities/toneDeltaPair.d.ts.map +1 -1
  43. package/dist/node.cjs +23 -19
  44. package/dist/node.js +34 -30
  45. package/dist/palette/index.d.ts +4 -0
  46. package/dist/palette/index.d.ts.map +1 -0
  47. package/dist/palette/palette.api.d.ts +13 -0
  48. package/dist/palette/palette.api.d.ts.map +1 -0
  49. package/dist/palette/palette.d.ts +33 -0
  50. package/dist/palette/palette.d.ts.map +1 -0
  51. package/dist/palette/palette.manager.d.ts +20 -0
  52. package/dist/palette/palette.manager.d.ts.map +1 -0
  53. package/dist/palette/palette.module.d.ts +3 -0
  54. package/dist/palette/palette.module.d.ts.map +1 -0
  55. package/dist/plugins/font/font.plugin.d.ts +1 -1
  56. package/dist/plugins/font/font.plugin.d.ts.map +1 -1
  57. package/dist/variant/index.d.ts +3 -0
  58. package/dist/variant/index.d.ts.map +1 -0
  59. package/dist/variant/variant.d.ts +29 -0
  60. package/dist/variant/variant.d.ts.map +1 -0
  61. package/dist/variant/variants/expressive.variant.d.ts +2 -0
  62. package/dist/variant/variants/expressive.variant.d.ts.map +1 -0
  63. package/dist/variant/variants/fidelity.variant.d.ts.map +1 -0
  64. package/dist/variant/variants/index.d.ts.map +1 -0
  65. package/dist/variant/variants/neutral.variant.d.ts.map +1 -0
  66. package/dist/variant/variants/tonal-spot.variant.d.ts.map +1 -0
  67. package/dist/variant/variants/vibrant.variant.d.ts.map +1 -0
  68. package/package.json +1 -1
  69. package/src/API.ts +12 -5
  70. package/src/app.container.ts +22 -11
  71. package/src/bootstrap.ts +1 -1
  72. package/src/color/color.api.ts +168 -47
  73. package/src/color/color.manager.ts +38 -181
  74. package/src/color/color.ts +291 -0
  75. package/src/color/color.utils.ts +48 -3
  76. package/src/color/default-color.ts +395 -396
  77. package/src/color/index.ts +1 -1
  78. package/src/config/config.interface.ts +5 -4
  79. package/src/context/context.module.ts +7 -0
  80. package/src/context/context.ts +169 -0
  81. package/src/context/index.ts +2 -0
  82. package/src/index.ts +6 -4
  83. package/src/loader/loader.ts +14 -23
  84. package/src/material-color-utilities/dynamic_color.ts +25 -34
  85. package/src/material-color-utilities/toneDeltaPair.ts +44 -41
  86. package/src/palette/index.ts +3 -0
  87. package/src/palette/palette.api.ts +43 -0
  88. package/src/palette/palette.manager.ts +74 -0
  89. package/src/palette/palette.module.ts +9 -0
  90. package/src/palette/palette.ts +207 -0
  91. package/src/plugins/font/font.plugin.ts +1 -1
  92. package/src/variant/index.ts +2 -0
  93. package/src/variant/variant.ts +81 -0
  94. package/src/{theme → variant}/variants/expressive.variant.ts +31 -29
  95. package/src/variant/variants/fidelity.variant.ts +46 -0
  96. package/src/{theme → variant}/variants/neutral.variant.ts +18 -18
  97. package/src/variant/variants/tonal-spot.variant.ts +35 -0
  98. package/src/{theme → variant}/variants/vibrant.variant.ts +21 -22
  99. package/dist/color/configurable-color.d.ts +0 -31
  100. package/dist/color/configurable-color.d.ts.map +0 -1
  101. package/dist/define-config-BasMdCqD.js +0 -430
  102. package/dist/define-config-CKSsLMnc.cjs +0 -429
  103. package/dist/theme/index.d.ts +0 -8
  104. package/dist/theme/index.d.ts.map +0 -1
  105. package/dist/theme/scheme.d.ts +0 -20
  106. package/dist/theme/scheme.d.ts.map +0 -1
  107. package/dist/theme/scheme.manager.d.ts +0 -31
  108. package/dist/theme/scheme.manager.d.ts.map +0 -1
  109. package/dist/theme/theme.api.d.ts +0 -24
  110. package/dist/theme/theme.api.d.ts.map +0 -1
  111. package/dist/theme/theme.module.d.ts +0 -3
  112. package/dist/theme/theme.module.d.ts.map +0 -1
  113. package/dist/theme/variant.d.ts +0 -36
  114. package/dist/theme/variant.d.ts.map +0 -1
  115. package/dist/theme/variant.manager.d.ts +0 -14
  116. package/dist/theme/variant.manager.d.ts.map +0 -1
  117. package/dist/theme/variants/expressive.variant.d.ts +0 -3
  118. package/dist/theme/variants/expressive.variant.d.ts.map +0 -1
  119. package/dist/theme/variants/fidelity.variant.d.ts.map +0 -1
  120. package/dist/theme/variants/index.d.ts.map +0 -1
  121. package/dist/theme/variants/neutral.variant.d.ts.map +0 -1
  122. package/dist/theme/variants/tonal-spot.variant.d.ts.map +0 -1
  123. package/dist/theme/variants/vibrant.variant.d.ts.map +0 -1
  124. package/src/color/configurable-color.ts +0 -67
  125. package/src/theme/index.ts +0 -7
  126. package/src/theme/scheme.manager.ts +0 -100
  127. package/src/theme/scheme.ts +0 -66
  128. package/src/theme/theme.api.ts +0 -82
  129. package/src/theme/theme.module.ts +0 -11
  130. package/src/theme/variant.manager.ts +0 -58
  131. package/src/theme/variant.ts +0 -53
  132. package/src/theme/variants/fidelity.variant.ts +0 -38
  133. package/src/theme/variants/tonal-spot.variant.ts +0 -35
  134. /package/dist/{theme → variant}/variants/fidelity.variant.d.ts +0 -0
  135. /package/dist/{theme → variant}/variants/index.d.ts +0 -0
  136. /package/dist/{theme → variant}/variants/neutral.variant.d.ts +0 -0
  137. /package/dist/{theme → variant}/variants/tonal-spot.variant.d.ts +0 -0
  138. /package/dist/{theme → variant}/variants/vibrant.variant.d.ts +0 -0
  139. /package/src/{theme → variant}/variants/index.ts +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"configurable-color.d.ts","sourceRoot":"","sources":["../../src/color/configurable-color.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,MAAM,YAAY,GAAG,CACvB,CAAC,kBAAkB,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GACzC,CAAC,OAAO,CAAC,kBAAkB,CAAC,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB,CAAC,CACL,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAUrB,qBAAa,iBAAiB;IAI1B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,YAAY;IALtB,OAAO,CAAC,YAAY,CAA6B;gBAGvC,MAAM,EAAE,YAAY,EACpB,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,YAAY;IAGpC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,YAAY,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAKrD,MAAM,IAAI,MAAM;IAIhB,OAAO;IAIP,MAAM;WA9B+B,MAAM;WAAK,MAAM;WAAK,MAAM;;IAkCjE,OAAO,IAAI,MAAM;IAIjB,gBAAgB,IAAI,YAAY;CAejC"}
@@ -1,430 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { p as getRotatedHue, o as getPiecewiseHue, H as Hct, k as tonalSpotVariant } from "./loader-C8_TyOuS.js";
5
- import { TonalPalette } from "@material/material-color-utilities";
6
- const getExpressiveNeutralHue = (sourceColorHct) => {
7
- const hue = getRotatedHue(
8
- sourceColorHct,
9
- [0, 71, 124, 253, 278, 300, 360],
10
- [10, 0, 10, 0, 10, 0]
11
- );
12
- return hue;
13
- };
14
- const getExpressiveNeutralChroma = (sourceColorHct, isDark) => {
15
- const neutralHue = getExpressiveNeutralHue(sourceColorHct);
16
- return isDark ? Hct.isYellow(neutralHue) ? 6 : 14 : 18;
17
- };
18
- const expressiveVariant = {
19
- name: "expressive",
20
- palettes: {
21
- primary: ({ sourceColorHct, isDark }) => TonalPalette.fromHueAndChroma(sourceColorHct.hue, isDark ? 36 : 48),
22
- secondary: ({ sourceColorHct, isDark }) => TonalPalette.fromHueAndChroma(
23
- getRotatedHue(
24
- sourceColorHct,
25
- [0, 105, 140, 204, 253, 278, 300, 333, 360],
26
- [-160, 155, -100, 96, -96, -156, -165, -160]
27
- ),
28
- isDark ? 16 : 24
29
- ),
30
- tertiary: ({ sourceColorHct }) => TonalPalette.fromHueAndChroma(
31
- getRotatedHue(
32
- sourceColorHct,
33
- [0, 105, 140, 204, 253, 278, 300, 333, 360],
34
- [-165, 160, -105, 101, -101, -160, -170, -165]
35
- ),
36
- 48
37
- ),
38
- neutral: ({ sourceColorHct, isDark }) => TonalPalette.fromHueAndChroma(
39
- getExpressiveNeutralHue(sourceColorHct),
40
- getExpressiveNeutralChroma(sourceColorHct, isDark)
41
- ),
42
- neutralVariant: ({ sourceColorHct, isDark }) => {
43
- const expressiveNeutralHue = getExpressiveNeutralHue(sourceColorHct);
44
- const expressiveNeutralChroma = getExpressiveNeutralChroma(
45
- sourceColorHct,
46
- isDark
47
- );
48
- return TonalPalette.fromHueAndChroma(
49
- expressiveNeutralHue,
50
- expressiveNeutralChroma * (expressiveNeutralHue >= 105 && expressiveNeutralHue < 125 ? 1.6 : 2.3)
51
- );
52
- },
53
- error: ({ sourceColorHct }) => {
54
- const errorHue = getPiecewiseHue(
55
- sourceColorHct,
56
- [0, 3, 13, 23, 33, 43, 153, 273, 360],
57
- [12, 22, 32, 12, 22, 32, 22, 12]
58
- );
59
- return TonalPalette.fromHueAndChroma(errorHue, 64);
60
- }
61
- },
62
- customPalettes: ({ colorHct, isDark }) => TonalPalette.fromHueAndChroma(
63
- getRotatedHue(
64
- colorHct,
65
- [0, 105, 140, 204, 253, 278, 300, 333, 360],
66
- [-160, 155, -100, 96, -96, -156, -165, -160]
67
- ),
68
- isDark ? 16 : 24
69
- )
70
- };
71
- const neutralVariant = {
72
- name: "neutral",
73
- palettes: {
74
- primary: ({ sourceColorHct }) => TonalPalette.fromHueAndChroma(
75
- sourceColorHct.hue,
76
- Hct.isBlue(sourceColorHct.hue) ? 12 : 8
77
- ),
78
- secondary: ({ sourceColorHct }) => TonalPalette.fromHueAndChroma(
79
- sourceColorHct.hue,
80
- Hct.isBlue(sourceColorHct.hue) ? 6 : 4
81
- ),
82
- tertiary: ({ sourceColorHct }) => TonalPalette.fromHueAndChroma(
83
- getRotatedHue(
84
- sourceColorHct,
85
- [0, 38, 105, 161, 204, 278, 333, 360],
86
- [-32, 26, 10, -39, 24, -15, -32]
87
- ),
88
- 20
89
- ),
90
- neutral: ({ sourceColorHct }) => TonalPalette.fromHueAndChroma(sourceColorHct.hue, 1.4),
91
- neutralVariant: ({ sourceColorHct }) => TonalPalette.fromHueAndChroma(sourceColorHct.hue, 1.4 * 2.2),
92
- error: ({ sourceColorHct }) => {
93
- const errorHue = getPiecewiseHue(
94
- sourceColorHct,
95
- [0, 3, 13, 23, 33, 43, 153, 273, 360],
96
- [12, 22, 32, 12, 22, 32, 22, 12]
97
- );
98
- return TonalPalette.fromHueAndChroma(errorHue, 50);
99
- }
100
- },
101
- customPalettes: ({ colorHct }) => TonalPalette.fromHueAndChroma(
102
- colorHct.hue,
103
- Hct.isBlue(colorHct.hue) ? 6 : 4
104
- )
105
- };
106
- const getVibrantNeutralHue = (sourceColorHct) => {
107
- return getRotatedHue(
108
- sourceColorHct,
109
- [0, 38, 105, 140, 333, 360],
110
- [-14, 10, -14, 10, -14]
111
- );
112
- };
113
- const getVibrantNeutralChroma = (sourceColorHct) => {
114
- getVibrantNeutralHue(sourceColorHct);
115
- return 28;
116
- };
117
- const vibrantVariant = {
118
- name: "vibrant",
119
- palettes: {
120
- primary: ({ sourceColorHct }) => TonalPalette.fromHueAndChroma(sourceColorHct.hue, 74),
121
- secondary: ({ sourceColorHct }) => TonalPalette.fromHueAndChroma(
122
- getRotatedHue(
123
- sourceColorHct,
124
- [0, 38, 105, 140, 333, 360],
125
- [-14, 10, -14, 10, -14]
126
- ),
127
- 56
128
- ),
129
- tertiary: ({ sourceColorHct }) => TonalPalette.fromHueAndChroma(
130
- getRotatedHue(
131
- sourceColorHct,
132
- [0, 38, 71, 105, 140, 161, 253, 333, 360],
133
- [-72, 35, 24, -24, 62, 50, 62, -72]
134
- ),
135
- 56
136
- ),
137
- neutral: ({ sourceColorHct }) => TonalPalette.fromHueAndChroma(
138
- getVibrantNeutralHue(sourceColorHct),
139
- getVibrantNeutralChroma(sourceColorHct)
140
- ),
141
- neutralVariant: ({ sourceColorHct }) => {
142
- const vibrantNeutralHue = getVibrantNeutralHue(sourceColorHct);
143
- const vibrantNeutralChroma = getVibrantNeutralChroma(sourceColorHct);
144
- return TonalPalette.fromHueAndChroma(
145
- vibrantNeutralHue,
146
- vibrantNeutralChroma * 1.29
147
- );
148
- },
149
- error: ({ sourceColorHct }) => {
150
- const errorHue = getPiecewiseHue(
151
- sourceColorHct,
152
- [0, 3, 13, 23, 33, 43, 153, 273, 360],
153
- [12, 22, 32, 12, 22, 32, 22, 12]
154
- );
155
- return TonalPalette.fromHueAndChroma(errorHue, 80);
156
- }
157
- },
158
- customPalettes: ({ colorHct }) => TonalPalette.fromHueAndChroma(
159
- getRotatedHue(
160
- colorHct,
161
- [0, 38, 105, 140, 333, 360],
162
- [-14, 10, -14, 10, -14]
163
- ),
164
- 56
165
- )
166
- };
167
- const fidelityVariant = {
168
- name: "fidelity",
169
- palettes: {
170
- primary: ({ sourceColorHct, isDark }) => TonalPalette.fromHueAndChroma(sourceColorHct.hue, sourceColorHct.chroma),
171
- secondary: ({ sourceColorHct }) => TonalPalette.fromHueAndChroma(
172
- sourceColorHct.hue,
173
- sourceColorHct.chroma * 0.5
174
- ),
175
- tertiary: ({ sourceColorHct }) => TonalPalette.fromHueAndChroma(
176
- getRotatedHue(
177
- sourceColorHct,
178
- [0, 20, 71, 161, 333, 360],
179
- [-40, 48, -32, 40, -32]
180
- ),
181
- sourceColorHct.chroma
182
- ),
183
- neutral: ({ sourceColorHct }) => TonalPalette.fromHueAndChroma(sourceColorHct.hue, 5),
184
- neutralVariant: ({ sourceColorHct }) => TonalPalette.fromHueAndChroma(sourceColorHct.hue, 5 * 1.7),
185
- error: ({ sourceColorHct }) => {
186
- const errorHue = getPiecewiseHue(
187
- sourceColorHct,
188
- [0, 3, 13, 23, 33, 43, 153, 273, 360],
189
- [12, 22, 32, 12, 22, 32, 22, 12]
190
- );
191
- return TonalPalette.fromHueAndChroma(errorHue, 60);
192
- }
193
- },
194
- customPalettes: ({ colorHct, sourceColorHct }) => TonalPalette.fromHueAndChroma(colorHct.hue, sourceColorHct.chroma)
195
- };
196
- const Variants = {
197
- Expressive: expressiveVariant,
198
- Neutral: neutralVariant,
199
- TonalSpot: tonalSpotVariant,
200
- Vibrant: vibrantVariant,
201
- Fidelity: fidelityVariant
202
- };
203
- class PluginAbstract {
204
- constructor(options) {
205
- __publicField(this, "options");
206
- __publicField(this, "pluginInstance");
207
- this.options = options;
208
- }
209
- init(api) {
210
- var _a, _b;
211
- this.pluginInstance = new this.pluginClass(api, this.options);
212
- (_b = (_a = this.pluginInstance).onInit) == null ? void 0 : _b.call(_a);
213
- return this;
214
- }
215
- getInstance() {
216
- if (!this.pluginInstance) {
217
- throw new Error(`Plugin ${this.name} is not initialized`);
218
- }
219
- return this.pluginInstance;
220
- }
221
- }
222
- class PluginImplAbstract {
223
- constructor(api, options) {
224
- var _a;
225
- this.api = api;
226
- this.options = options;
227
- (_a = this.onInit) == null ? void 0 : _a.call(this);
228
- }
229
- }
230
- var FontFamily = /* @__PURE__ */ ((FontFamily2) => {
231
- FontFamily2["Expressive"] = "expressive";
232
- FontFamily2["Neutral"] = "neutral";
233
- return FontFamily2;
234
- })(FontFamily || {});
235
- class FontPlugin extends PluginAbstract {
236
- constructor() {
237
- super(...arguments);
238
- __publicField(this, "dependencies", []);
239
- __publicField(this, "name", "font");
240
- __publicField(this, "pluginClass", FontPluginImpl);
241
- }
242
- }
243
- class FontPluginImpl extends PluginImplAbstract {
244
- constructor() {
245
- super(...arguments);
246
- __publicField(this, "_fontFamily");
247
- __publicField(this, "_fontStyles");
248
- }
249
- get fontFamily() {
250
- if (!this._fontFamily) throw new Error("Font family not initialized");
251
- return this._fontFamily;
252
- }
253
- set fontFamily(value) {
254
- this._fontFamily = value;
255
- }
256
- get fontStyles() {
257
- if (!this._fontStyles) throw new Error("Font styles not initialized");
258
- return this._fontStyles;
259
- }
260
- set fontStyles(value) {
261
- this._fontStyles = value;
262
- }
263
- getFonts() {
264
- return {
265
- fontStyles: this.fontStyles,
266
- fontFamily: this.fontFamily
267
- };
268
- }
269
- onInit() {
270
- var _a, _b, _c, _d;
271
- this.fontFamily = {
272
- expressive: ((_b = (_a = this.options) == null ? void 0 : _a.fontFamily) == null ? void 0 : _b.expressive) ?? [
273
- "Roboto",
274
- "sans-serif"
275
- ],
276
- neutral: ((_d = (_c = this.options) == null ? void 0 : _c.fontFamily) == null ? void 0 : _d.neutral) ?? ["Roboto", "sans-serif"]
277
- };
278
- this.fontStyles = {
279
- display: {
280
- large: {
281
- fontWeight: 400,
282
- fontSize: 3.5625,
283
- lineHeight: 4,
284
- letterSpacing: -0.015625,
285
- fontFamily: "expressive"
286
- /* Expressive */
287
- },
288
- medium: {
289
- fontWeight: 400,
290
- fontSize: 2.8125,
291
- lineHeight: 3.25,
292
- fontFamily: "expressive"
293
- /* Expressive */
294
- },
295
- small: {
296
- fontWeight: 400,
297
- fontSize: 2.25,
298
- lineHeight: 2.75,
299
- fontFamily: "expressive"
300
- /* Expressive */
301
- }
302
- },
303
- headline: {
304
- large: {
305
- fontWeight: 400,
306
- fontSize: 2,
307
- lineHeight: 2.5,
308
- fontFamily: "expressive"
309
- /* Expressive */
310
- },
311
- medium: {
312
- fontWeight: 400,
313
- fontSize: 1.75,
314
- lineHeight: 2.25,
315
- fontFamily: "expressive"
316
- /* Expressive */
317
- },
318
- small: {
319
- fontWeight: 400,
320
- fontSize: 1.5,
321
- lineHeight: 2,
322
- fontFamily: "expressive"
323
- /* Expressive */
324
- }
325
- },
326
- title: {
327
- large: {
328
- fontWeight: 400,
329
- fontSize: 1.375,
330
- lineHeight: 1.75,
331
- fontFamily: "neutral"
332
- /* Neutral */
333
- },
334
- medium: {
335
- fontWeight: 500,
336
- fontSize: 1,
337
- lineHeight: 1.5,
338
- fontFamily: "neutral",
339
- letterSpacing: 9375e-6
340
- },
341
- small: {
342
- fontWeight: 500,
343
- fontSize: 0.875,
344
- lineHeight: 1.25,
345
- fontFamily: "neutral",
346
- letterSpacing: 625e-5
347
- }
348
- },
349
- label: {
350
- large: {
351
- fontWeight: 500,
352
- fontSize: 0.875,
353
- lineHeight: 1.25,
354
- fontFamily: "neutral",
355
- letterSpacing: 625e-5
356
- },
357
- medium: {
358
- fontWeight: 500,
359
- fontSize: 0.75,
360
- lineHeight: 1,
361
- fontFamily: "neutral",
362
- letterSpacing: 0.03125
363
- },
364
- small: {
365
- fontWeight: 500,
366
- fontSize: 0.6875,
367
- lineHeight: 1,
368
- fontFamily: "neutral",
369
- letterSpacing: 0.03125
370
- }
371
- },
372
- body: {
373
- large: {
374
- fontWeight: 400,
375
- fontSize: 1,
376
- lineHeight: 1.5625,
377
- fontFamily: "neutral",
378
- letterSpacing: 0.03125
379
- },
380
- medium: {
381
- fontWeight: 400,
382
- fontSize: 0.875,
383
- lineHeight: 1.25,
384
- fontFamily: "neutral",
385
- letterSpacing: 0.015625
386
- },
387
- small: {
388
- fontWeight: 400,
389
- fontSize: 0.75,
390
- lineHeight: 1,
391
- fontFamily: "neutral",
392
- letterSpacing: 0.025
393
- }
394
- }
395
- };
396
- if (this.options && this.options.fontStyles)
397
- Object.entries(this.options.fontStyles).forEach(([key, fontParam]) => {
398
- const fontRole = key;
399
- Object.entries(fontParam).forEach(([size, fontStyle]) => {
400
- const fontSize = size;
401
- if (fontStyle) {
402
- this.fontStyles[fontRole][fontSize] = {
403
- ...this.fontStyles[fontRole][fontSize],
404
- ...fontStyle
405
- };
406
- }
407
- });
408
- });
409
- }
410
- }
411
- function defineConfig(configObject) {
412
- if (!configObject || typeof configObject !== "object") {
413
- throw new Error("The configuration is missing or not an object");
414
- }
415
- if (!("sourceColor" in configObject)) {
416
- throw new Error("Invalid configuration");
417
- }
418
- return configObject;
419
- }
420
- export {
421
- FontFamily as F,
422
- PluginAbstract as P,
423
- Variants as V,
424
- PluginImplAbstract as a,
425
- FontPlugin as b,
426
- defineConfig as d,
427
- expressiveVariant as e,
428
- neutralVariant as n,
429
- vibrantVariant as v
430
- };