@utilitywarehouse/hearth-react-native 0.4.0 → 0.4.2

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 (112) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-lint.log +1 -1
  3. package/CHANGELOG.md +16 -0
  4. package/build/components/Checkbox/CheckboxTextContent.d.ts +1 -1
  5. package/build/components/Checkbox/CheckboxTextContent.js +9 -2
  6. package/build/components/CurrencyInput/CurrencyInput.d.ts +1 -1
  7. package/build/components/CurrencyInput/CurrencyInput.js +3 -3
  8. package/build/components/CurrencyInput/CurrencyInput.props.d.ts +2 -2
  9. package/build/components/Radio/RadioTextContent.d.ts +1 -1
  10. package/build/components/Radio/RadioTextContent.js +9 -2
  11. package/build/core/themes.d.ts +482 -0
  12. package/build/core/themes.js +31 -0
  13. package/build/legacyTokens/common/brand.d.ts +16 -0
  14. package/build/legacyTokens/common/brand.js +17 -0
  15. package/build/legacyTokens/common/index.d.ts +8 -0
  16. package/build/legacyTokens/common/index.js +9 -0
  17. package/build/legacyTokens/common/service.d.ts +20 -0
  18. package/build/legacyTokens/common/service.js +21 -0
  19. package/build/legacyTokens/dark/apple.d.ts +28 -0
  20. package/build/legacyTokens/dark/apple.js +29 -0
  21. package/build/legacyTokens/dark/cyan.d.ts +48 -0
  22. package/build/legacyTokens/dark/cyan.js +49 -0
  23. package/build/legacyTokens/dark/gold.d.ts +44 -0
  24. package/build/legacyTokens/dark/gold.js +45 -0
  25. package/build/legacyTokens/dark/grape.d.ts +28 -0
  26. package/build/legacyTokens/dark/grape.js +29 -0
  27. package/build/legacyTokens/dark/green.d.ts +40 -0
  28. package/build/legacyTokens/dark/green.js +41 -0
  29. package/build/legacyTokens/dark/grey.d.ts +60 -0
  30. package/build/legacyTokens/dark/grey.js +61 -0
  31. package/build/legacyTokens/dark/index.d.ts +40 -0
  32. package/build/legacyTokens/dark/index.js +41 -0
  33. package/build/legacyTokens/dark/pink.d.ts +28 -0
  34. package/build/legacyTokens/dark/pink.js +29 -0
  35. package/build/legacyTokens/dark/purple.d.ts +48 -0
  36. package/build/legacyTokens/dark/purple.js +49 -0
  37. package/build/legacyTokens/dark/red.d.ts +40 -0
  38. package/build/legacyTokens/dark/red.js +41 -0
  39. package/build/legacyTokens/dark/rose.d.ts +28 -0
  40. package/build/legacyTokens/dark/rose.js +29 -0
  41. package/build/legacyTokens/index.d.ts +12 -0
  42. package/build/legacyTokens/index.js +13 -0
  43. package/build/legacyTokens/light/apple.d.ts +28 -0
  44. package/build/legacyTokens/light/apple.js +29 -0
  45. package/build/legacyTokens/light/cyan.d.ts +48 -0
  46. package/build/legacyTokens/light/cyan.js +49 -0
  47. package/build/legacyTokens/light/gold.d.ts +44 -0
  48. package/build/legacyTokens/light/gold.js +45 -0
  49. package/build/legacyTokens/light/grape.d.ts +28 -0
  50. package/build/legacyTokens/light/grape.js +29 -0
  51. package/build/legacyTokens/light/green.d.ts +40 -0
  52. package/build/legacyTokens/light/green.js +41 -0
  53. package/build/legacyTokens/light/grey.d.ts +60 -0
  54. package/build/legacyTokens/light/grey.js +61 -0
  55. package/build/legacyTokens/light/index.d.ts +40 -0
  56. package/build/legacyTokens/light/index.js +41 -0
  57. package/build/legacyTokens/light/pink.d.ts +28 -0
  58. package/build/legacyTokens/light/pink.js +29 -0
  59. package/build/legacyTokens/light/purple.d.ts +48 -0
  60. package/build/legacyTokens/light/purple.js +49 -0
  61. package/build/legacyTokens/light/red.d.ts +40 -0
  62. package/build/legacyTokens/light/red.js +41 -0
  63. package/build/legacyTokens/light/rose.d.ts +32 -0
  64. package/build/legacyTokens/light/rose.js +33 -0
  65. package/build/utils/getFlattenedColorValue.js +2 -19
  66. package/build/utils/index.d.ts +1 -0
  67. package/build/utils/index.js +1 -0
  68. package/build/utils/styleUtils.d.ts +0 -4
  69. package/build/utils/styleUtils.js +0 -50
  70. package/build/utils/themeValueHelpers.d.ts +17 -0
  71. package/build/utils/themeValueHelpers.js +54 -0
  72. package/docs/getting-started.mdx +13 -5
  73. package/docs/introduction.mdx +50 -5
  74. package/package.json +4 -4
  75. package/src/components/Checkbox/CheckboxTextContent.tsx +11 -3
  76. package/src/components/CurrencyInput/CurrencyInput.docs.mdx +4 -4
  77. package/src/components/CurrencyInput/CurrencyInput.props.ts +2 -2
  78. package/src/components/CurrencyInput/CurrencyInput.stories.tsx +17 -15
  79. package/src/components/CurrencyInput/CurrencyInput.tsx +3 -3
  80. package/src/components/Radio/RadioTextContent.tsx +11 -3
  81. package/src/core/themes.ts +31 -0
  82. package/src/legacyTokens/common/brand.ts +18 -0
  83. package/src/legacyTokens/common/index.ts +10 -0
  84. package/src/legacyTokens/common/service.ts +22 -0
  85. package/src/legacyTokens/dark/apple.ts +30 -0
  86. package/src/legacyTokens/dark/cyan.ts +50 -0
  87. package/src/legacyTokens/dark/gold.ts +46 -0
  88. package/src/legacyTokens/dark/grape.ts +30 -0
  89. package/src/legacyTokens/dark/green.ts +42 -0
  90. package/src/legacyTokens/dark/grey.ts +62 -0
  91. package/src/legacyTokens/dark/index.ts +42 -0
  92. package/src/legacyTokens/dark/pink.ts +30 -0
  93. package/src/legacyTokens/dark/purple.ts +50 -0
  94. package/src/legacyTokens/dark/red.ts +42 -0
  95. package/src/legacyTokens/dark/rose.ts +30 -0
  96. package/src/legacyTokens/index.ts +14 -0
  97. package/src/legacyTokens/light/apple.ts +30 -0
  98. package/src/legacyTokens/light/cyan.ts +50 -0
  99. package/src/legacyTokens/light/gold.ts +46 -0
  100. package/src/legacyTokens/light/grape.ts +30 -0
  101. package/src/legacyTokens/light/green.ts +42 -0
  102. package/src/legacyTokens/light/grey.ts +62 -0
  103. package/src/legacyTokens/light/index.ts +42 -0
  104. package/src/legacyTokens/light/pink.ts +30 -0
  105. package/src/legacyTokens/light/purple.ts +50 -0
  106. package/src/legacyTokens/light/red.ts +42 -0
  107. package/src/legacyTokens/light/rose.ts +34 -0
  108. package/src/utils/getFlattenedColorValue.ts +2 -21
  109. package/src/utils/getStyleValue.ts +0 -3
  110. package/src/utils/index.ts +1 -0
  111. package/src/utils/styleUtils.ts +0 -57
  112. package/src/utils/themeValueHelpers.ts +60 -0
@@ -0,0 +1,62 @@
1
+ // HEY, DON'T EDIT THIS FILE DIRECTLY, IT'S BEEN MAGICALLY GENERATED.
2
+
3
+ /**
4
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
5
+ */
6
+ export const grey25 = '#fafafa';
7
+ /**
8
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
9
+ */
10
+ export const grey50 = '#f5f5f5';
11
+ /**
12
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
13
+ */
14
+ export const grey75 = '#f0f0f0';
15
+ /**
16
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
17
+ */
18
+ export const grey100 = '#e3e3e3';
19
+ /**
20
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
21
+ */
22
+ export const grey150 = '#d8d8d8';
23
+ /**
24
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
25
+ */
26
+ export const grey175 = '#cccccc';
27
+ /**
28
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
29
+ */
30
+ export const grey200 = '#c1c1c1';
31
+ /**
32
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
33
+ */
34
+ export const grey300 = '#b8b8b8';
35
+ /**
36
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
37
+ */
38
+ export const grey400 = '#a0a0a0';
39
+ /**
40
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
41
+ */
42
+ export const grey500 = '#888888';
43
+ /**
44
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
45
+ */
46
+ export const grey600 = '#707070';
47
+ /**
48
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
49
+ */
50
+ export const grey700 = '#585858';
51
+ /**
52
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
53
+ */
54
+ export const grey800 = '#414141';
55
+ /**
56
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
57
+ */
58
+ export const grey900 = '#242424';
59
+ /**
60
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
61
+ */
62
+ export const grey1000 = '#121212';
@@ -0,0 +1,42 @@
1
+ // HEY, DON'T EDIT THIS FILE DIRECTLY, IT'S BEEN MAGICALLY GENERATED.
2
+
3
+ /**
4
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
5
+ */
6
+ export * from './red';
7
+ /**
8
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
9
+ */
10
+ export * from './pink';
11
+ /**
12
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
13
+ */
14
+ export * from './grey';
15
+ /**
16
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
17
+ */
18
+ export * from './apple';
19
+ /**
20
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
21
+ */
22
+ export * from './cyan';
23
+ /**
24
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
25
+ */
26
+ export * from './gold';
27
+ /**
28
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
29
+ */
30
+ export * from './green';
31
+ /**
32
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
33
+ */
34
+ export * from './grape';
35
+ /**
36
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
37
+ */
38
+ export * from './rose';
39
+ /**
40
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
41
+ */
42
+ export * from './purple';
@@ -0,0 +1,30 @@
1
+ // HEY, DON'T EDIT THIS FILE DIRECTLY, IT'S BEEN MAGICALLY GENERATED.
2
+
3
+ /**
4
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
5
+ */
6
+ export const pink50 = '#fde6fb';
7
+ /**
8
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
9
+ */
10
+ export const pink100 = '#fccff9';
11
+ /**
12
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
13
+ */
14
+ export const pink200 = '#f9bdfa';
15
+ /**
16
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
17
+ */
18
+ export const pink300 = '#f495f9';
19
+ /**
20
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
21
+ */
22
+ export const pink500 = '#c933d1';
23
+ /**
24
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
25
+ */
26
+ export const pink700 = '#8f248f';
27
+ /**
28
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
29
+ */
30
+ export const pink900 = '#48104b';
@@ -0,0 +1,50 @@
1
+ // HEY, DON'T EDIT THIS FILE DIRECTLY, IT'S BEEN MAGICALLY GENERATED.
2
+
3
+ /**
4
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
5
+ */
6
+ export const purple50 = '#f8f5fe';
7
+ /**
8
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
9
+ */
10
+ export const purple75 = '#f1ebfe';
11
+ /**
12
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
13
+ */
14
+ export const purple100 = '#e5d7fe';
15
+ /**
16
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
17
+ */
18
+ export const purple200 = '#cfadff';
19
+ /**
20
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
21
+ */
22
+ export const purple300 = '#c08dfc';
23
+ /**
24
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
25
+ */
26
+ export const purple400 = '#b46ef7';
27
+ /**
28
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
29
+ */
30
+ export const purple500 = '#9d38f0';
31
+ /**
32
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
33
+ */
34
+ export const purple600 = '#8f23e7';
35
+ /**
36
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
37
+ */
38
+ export const purple700 = '#7415c1';
39
+ /**
40
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
41
+ */
42
+ export const purple800 = '#550091';
43
+ /**
44
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
45
+ */
46
+ export const purple900 = '#48007a';
47
+ /**
48
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
49
+ */
50
+ export const purple1000 = '#35005c';
@@ -0,0 +1,42 @@
1
+ // HEY, DON'T EDIT THIS FILE DIRECTLY, IT'S BEEN MAGICALLY GENERATED.
2
+
3
+ /**
4
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
5
+ */
6
+ export const red50 = '#ffebeb';
7
+ /**
8
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
9
+ */
10
+ export const red100 = '#ffd8d9';
11
+ /**
12
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
13
+ */
14
+ export const red200 = '#ffb3b4';
15
+ /**
16
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
17
+ */
18
+ export const red300 = '#f58e92';
19
+ /**
20
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
21
+ */
22
+ export const red400 = '#ec515d';
23
+ /**
24
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
25
+ */
26
+ export const red500 = '#df2a38';
27
+ /**
28
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
29
+ */
30
+ export const red600 = '#c31d2a';
31
+ /**
32
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
33
+ */
34
+ export const red700 = '#891e27';
35
+ /**
36
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
37
+ */
38
+ export const red800 = '#611a20';
39
+ /**
40
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
41
+ */
42
+ export const red900 = '#3b1216';
@@ -0,0 +1,34 @@
1
+ // HEY, DON'T EDIT THIS FILE DIRECTLY, IT'S BEEN MAGICALLY GENERATED.
2
+
3
+ /**
4
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
5
+ */
6
+ export const rose50 = '#fde2ec';
7
+ /**
8
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
9
+ */
10
+ export const rose200 = '#f9b6d0';
11
+ /**
12
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
13
+ */
14
+ export const rose300 = '#f586b1';
15
+ /**
16
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
17
+ */
18
+ export const rose400 = '#f25192';
19
+ /**
20
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
21
+ */
22
+ export const rose500 = '#ed176c';
23
+ /**
24
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
25
+ */
26
+ export const rose700 = '#c8185c';
27
+ /**
28
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
29
+ */
30
+ export const rose800 = '#9f1446';
31
+ /**
32
+ * @deprecated This will be removed in the next major version. This is kept for backward compatibility.
33
+ */
34
+ export const rose900 = '#4a1125';
@@ -1,4 +1,5 @@
1
1
  import { ColorValue } from '../types';
2
+ import { resolveThemeValue } from './themeValueHelpers';
2
3
 
3
4
  type ThemeColor = string | { [key: string]: string | ThemeColor };
4
5
 
@@ -8,25 +9,5 @@ export default function getFlattenedColorValue(
8
9
  ): ColorValue {
9
10
  if (!value) return undefined;
10
11
 
11
- if (colors?.[value] && typeof colors?.[value] === 'string') {
12
- return colors?.[value] as ColorValue;
13
- }
14
-
15
- // Extract trailing digits as shade
16
- const shadeMatch = value.match(/\d+$/);
17
-
18
- if (!shadeMatch) return value as ColorValue;
19
- const shade = shadeMatch[0];
20
- const base = value.slice(0, -shade.length);
21
-
22
- if (shade && typeof base !== 'string') return value as ColorValue;
23
-
24
- const colorEntry = colors?.[base];
25
-
26
- if (typeof colorEntry === 'object') {
27
- return (colorEntry[shade] ?? value) as ColorValue;
28
- } else if (typeof colorEntry === 'string') {
29
- return colorEntry as ColorValue;
30
- }
31
- return value as ColorValue;
12
+ return resolveThemeValue(value, colors) as ColorValue;
32
13
  }
@@ -1,6 +1,3 @@
1
-
2
-
3
-
4
1
  const getStyleValue = (value: any, type: Record<string, any>) => {
5
2
  if (typeof value === 'string') {
6
3
  const key = value;
@@ -5,3 +5,4 @@ export { default as getStyleValue } from './getStyleValue';
5
5
  export { default as hexWithOpacity } from './hexWithOpacity';
6
6
  export { default as isEqual } from './isEqual';
7
7
  export * from './styleUtils';
8
+ export * from './themeValueHelpers';
@@ -231,60 +231,3 @@ export const viewStyleProps = new Set<string>([
231
231
  // Z-index
232
232
  'zIndex',
233
233
  ]);
234
-
235
- /**
236
- * Helper function to convert camelCase back to nested object path
237
- * e.g., feedbackDangerSurfaceDefault -> ['feedback', 'danger', 'surface', 'default']
238
- */
239
- const camelCaseToPath = (camelCased: string): string[] => {
240
- // Split on uppercase letters but keep them
241
- const parts = camelCased.split(/(?=[A-Z])/).map(part => part.toLowerCase());
242
- return parts;
243
- };
244
-
245
- /**
246
- * Helper function to get nested value from object using path array
247
- */
248
- const getNestedValue = (obj: any, path: string[]): any => {
249
- return path.reduce((current, key) => {
250
- return current && typeof current === 'object' ? current[key] : undefined;
251
- }, obj);
252
- };
253
-
254
- /**
255
- * Helper function to resolve a theme value
256
- */
257
- export const resolveThemeValue = (value: any, themeMapping: any): any => {
258
- if (typeof value !== 'string' || !themeMapping || typeof themeMapping !== 'object') {
259
- return value;
260
- }
261
-
262
- // First, try direct lookup for simple values
263
- if (themeMapping[value] !== undefined) {
264
- return themeMapping[value];
265
- }
266
-
267
- // Try camelCase to nested path conversion (e.g., feedbackDangerSurfaceDefault)
268
- if (/^[a-z][a-zA-Z]*$/.test(value)) {
269
- // Only camelCase strings without numbers
270
- const path = camelCaseToPath(value);
271
- const nestedValue = getNestedValue(themeMapping, path);
272
- if (nestedValue !== undefined) {
273
- return nestedValue;
274
- }
275
- }
276
-
277
- // Then, try the existing numeric suffix pattern (e.g., broadbandBlue100)
278
- const shadeMatch = value.match(/\d+$/);
279
- if (shadeMatch) {
280
- const shade = shadeMatch[0];
281
- const base = value.slice(0, -shade.length);
282
- const nested = themeMapping[base];
283
- if (nested && typeof nested === 'object') {
284
- return nested[shade] ?? value;
285
- }
286
- }
287
-
288
- // If none of the approaches work, return the original value
289
- return value;
290
- };
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Helper function to convert camelCase back to nested object path
3
+ * e.g., feedbackDangerSurfaceDefault -> ['feedback', 'danger', 'surface', 'default']
4
+ */
5
+ export const camelCaseToPath = (camelCased: string): string[] => {
6
+ // Split on uppercase letters but keep them
7
+ const parts = camelCased.split(/(?=[A-Z])/).map(part => part.toLowerCase());
8
+ return parts;
9
+ };
10
+
11
+ /**
12
+ * Helper function to get nested value from object using path array
13
+ */
14
+ export const getNestedValue = (obj: any, path: string[]): any => {
15
+ return path.reduce((current, key) => {
16
+ return current && typeof current === 'object' ? current[key] : undefined;
17
+ }, obj);
18
+ };
19
+
20
+ /**
21
+ * Helper function to resolve a theme value
22
+ * Supports:
23
+ * - Direct lookup (value -> themeMapping[value])
24
+ * - Camel case to nested path (feedbackDangerSurfaceDefault -> themeMapping.feedback.danger.surface.default)
25
+ * - Numeric suffix pattern (broadbandBlue100 -> themeMapping.broadbandBlue[100])
26
+ */
27
+ export const resolveThemeValue = (value: any, themeMapping: any): any => {
28
+ if (typeof value !== 'string' || !themeMapping || typeof themeMapping !== 'object') {
29
+ return value;
30
+ }
31
+
32
+ // First, try direct lookup for simple values
33
+ if (themeMapping[value] !== undefined) {
34
+ return themeMapping[value];
35
+ }
36
+
37
+ // Try camelCase to nested path conversion (e.g., feedbackDangerSurfaceDefault)
38
+ if (/^[a-z][a-zA-Z]*$/.test(value)) {
39
+ // Only camelCase strings without numbers
40
+ const path = camelCaseToPath(value);
41
+ const nestedValue = getNestedValue(themeMapping, path);
42
+ if (nestedValue !== undefined) {
43
+ return nestedValue;
44
+ }
45
+ }
46
+
47
+ // Then, try the existing numeric suffix pattern (e.g., broadbandBlue100)
48
+ const shadeMatch = value.match(/\d+$/);
49
+ if (shadeMatch) {
50
+ const shade = shadeMatch[0];
51
+ const base = value.slice(0, -shade.length);
52
+ const nested = themeMapping[base];
53
+ if (nested && typeof nested === 'object') {
54
+ return nested[shade] ?? value;
55
+ }
56
+ }
57
+
58
+ // If none of the approaches work, return the original value
59
+ return value;
60
+ };