app-studio 0.7.2 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -35
- package/dist/app-studio.cjs.development.js +144 -165
- package/dist/app-studio.cjs.development.js.map +1 -1
- package/dist/app-studio.cjs.production.min.js +1 -1
- package/dist/app-studio.esm.js +144 -165
- package/dist/app-studio.esm.js.map +1 -1
- package/dist/app-studio.umd.development.js +144 -165
- package/dist/app-studio.umd.development.js.map +1 -1
- package/dist/app-studio.umd.production.min.js +1 -1
- package/dist/stories/ScrollAnimation.stories.d.ts +1 -1
- package/docs/Animation.md +3 -3
- package/docs/Components.md +8 -8
- package/docs/Design.md +2 -2
- package/docs/Events.md +30 -30
- package/docs/Hooks.md +6 -6
- package/docs/README.md +31 -31
- package/docs/Responsive.md +3 -3
- package/docs/Theming.md +183 -150
- package/package.json +1 -1
|
@@ -756,15 +756,15 @@
|
|
|
756
756
|
black: '#FFFFFF'
|
|
757
757
|
};
|
|
758
758
|
// Centralized regex for color token detection
|
|
759
|
-
// Matches color
|
|
760
|
-
const COLOR_TOKEN_REGEX = /(color
|
|
759
|
+
// Matches color-x-y-z or theme-x-y (dash notation)
|
|
760
|
+
const COLOR_TOKEN_REGEX = /(color-[a-zA-Z0-9-]+|theme-[a-zA-Z0-9-]+)/g;
|
|
761
761
|
/**
|
|
762
762
|
* Checks if a value contains color tokens.
|
|
763
763
|
* @param value - The string to check.
|
|
764
764
|
* @returns True if the value contains color tokens.
|
|
765
765
|
*/
|
|
766
766
|
const hasColorToken = value => {
|
|
767
|
-
return value.includes('color
|
|
767
|
+
return value.includes('color-') || value.includes('theme-');
|
|
768
768
|
};
|
|
769
769
|
/**
|
|
770
770
|
* Replaces color tokens in a string with values returned by a resolver function.
|
|
@@ -782,8 +782,11 @@
|
|
|
782
782
|
};
|
|
783
783
|
|
|
784
784
|
// --- Constants ---
|
|
785
|
-
|
|
786
|
-
const
|
|
785
|
+
// Public API prefixes (dash notation: theme-primary, color-blue-500)
|
|
786
|
+
const THEME_PREFIX = 'theme-';
|
|
787
|
+
const COLOR_PREFIX = 'color-';
|
|
788
|
+
const LIGHT_PREFIX = 'light-';
|
|
789
|
+
const DARK_PREFIX = 'dark-';
|
|
787
790
|
const TRANSPARENT = 'transparent';
|
|
788
791
|
// --- CSS Variable Injection Helper ---
|
|
789
792
|
const generateCSSVariables = (theme, lightColors, darkColors) => {
|
|
@@ -827,21 +830,17 @@
|
|
|
827
830
|
collectGenericNames(lightColors.main, 'color');
|
|
828
831
|
collectGenericNames(lightColors.palette, 'color');
|
|
829
832
|
// 3. Process Theme variables (references)
|
|
833
|
+
// Theme config uses dash notation (color-blue-500, theme-primary)
|
|
830
834
|
const processTheme = (obj, prefix) => {
|
|
831
835
|
Object.keys(obj).forEach(key => {
|
|
832
836
|
const value = obj[key];
|
|
833
|
-
const variableName = `${prefix}-${key}
|
|
837
|
+
const variableName = `${prefix}-${key}`;
|
|
834
838
|
if (typeof value === 'object' && value !== null) {
|
|
835
839
|
processTheme(value, variableName);
|
|
836
840
|
} else if (typeof value === 'string') {
|
|
837
|
-
if (value.startsWith(
|
|
838
|
-
// Convert 'color
|
|
839
|
-
|
|
840
|
-
const refVar = value.replace(/\./g, '-');
|
|
841
|
-
themeVariables.push(`--${variableName}: var(--${refVar});`);
|
|
842
|
-
} else if (value.startsWith(THEME_PREFIX)) {
|
|
843
|
-
const refVar = value.replace(/\./g, '-');
|
|
844
|
-
themeVariables.push(`--${variableName}: var(--${refVar});`);
|
|
841
|
+
if (value.startsWith('color-') || value.startsWith('theme-')) {
|
|
842
|
+
// Convert 'color-blue-500' -> 'var(--color-blue-500)'
|
|
843
|
+
themeVariables.push(`--${variableName}: var(--${value});`);
|
|
845
844
|
} else {
|
|
846
845
|
themeVariables.push(`--${variableName}: ${value};`);
|
|
847
846
|
}
|
|
@@ -877,14 +876,16 @@
|
|
|
877
876
|
return css;
|
|
878
877
|
};
|
|
879
878
|
// --- Default Configuration ---
|
|
879
|
+
// Theme values use dash notation (color-X or color-X-shade)
|
|
880
|
+
// which gets resolved to CSS variables (var(--color-X-shade))
|
|
880
881
|
const defaultThemeMain = {
|
|
881
|
-
primary:
|
|
882
|
-
secondary:
|
|
883
|
-
success:
|
|
884
|
-
error:
|
|
885
|
-
warning:
|
|
886
|
-
disabled:
|
|
887
|
-
loading:
|
|
882
|
+
primary: 'color-black',
|
|
883
|
+
secondary: 'color-blue',
|
|
884
|
+
success: 'color-green-500',
|
|
885
|
+
error: 'color-red-500',
|
|
886
|
+
warning: 'color-orange-500',
|
|
887
|
+
disabled: 'color-gray-500',
|
|
888
|
+
loading: 'color-dark-500'
|
|
888
889
|
};
|
|
889
890
|
const defaultLightColorConfig = {
|
|
890
891
|
main: defaultLightColors,
|
|
@@ -942,9 +943,9 @@
|
|
|
942
943
|
// Handle rgb/rgba colors
|
|
943
944
|
if (color.startsWith('rgb')) {
|
|
944
945
|
// Extract the values from rgb() or rgba()
|
|
945
|
-
const
|
|
946
|
-
if (
|
|
947
|
-
const values =
|
|
946
|
+
const rgbMatch = color.match(/rgba?\(([^)]+)\)/);
|
|
947
|
+
if (rgbMatch) {
|
|
948
|
+
const values = rgbMatch[1].split(',').map(v => v.trim());
|
|
948
949
|
const r = values[0];
|
|
949
950
|
const g = values[1];
|
|
950
951
|
const b = values[2];
|
|
@@ -1099,83 +1100,111 @@
|
|
|
1099
1100
|
if (token === TRANSPARENT) return token;
|
|
1100
1101
|
if (depth > 25) return token;
|
|
1101
1102
|
const effectiveTheme = override?.theme ? deepMerge(mergedTheme, override.theme) : mergedTheme;
|
|
1102
|
-
//
|
|
1103
|
+
// Convert dash notation to internal format for resolution
|
|
1104
|
+
// theme-primary-100 -> parts for processing
|
|
1103
1105
|
if (token.startsWith(THEME_PREFIX)) {
|
|
1104
|
-
const
|
|
1106
|
+
const parts = token.substring(THEME_PREFIX.length).split('-');
|
|
1107
|
+
const lastPart = parts[parts.length - 1];
|
|
1108
|
+
const maybeAlpha = parseInt(lastPart, 10);
|
|
1109
|
+
// Check for alpha suffix: theme-primary-100 (2+ parts after prefix, last is 0-1000)
|
|
1110
|
+
if (parts.length >= 2 && !isNaN(maybeAlpha) && maybeAlpha >= 0 && maybeAlpha <= 1000) {
|
|
1111
|
+
const themeKey = parts.slice(0, -1).join('-');
|
|
1112
|
+
const baseToken = `${THEME_PREFIX}${themeKey}`;
|
|
1113
|
+
const resolvedBase = resolveColorTokenForMode(baseToken, mode, override, depth + 1);
|
|
1114
|
+
return convertToRgba(resolvedBase, maybeAlpha);
|
|
1115
|
+
}
|
|
1116
|
+
const themeKey = parts.join('-');
|
|
1105
1117
|
const themeValue = effectiveTheme[themeKey];
|
|
1106
1118
|
if (typeof themeValue === 'string') {
|
|
1119
|
+
// Theme values use dash notation (color-blue-500)
|
|
1107
1120
|
return resolveColorTokenForMode(themeValue, mode, override, depth + 1);
|
|
1108
1121
|
}
|
|
1109
1122
|
return token;
|
|
1110
1123
|
}
|
|
1111
|
-
//
|
|
1112
|
-
if (token.startsWith('light.') || token.startsWith('dark.')) {
|
|
1113
|
-
const explicitMode = token.startsWith('light.') ? 'light' : 'dark';
|
|
1114
|
-
const prefixLength = token.startsWith('light.') ? 6 : 5;
|
|
1115
|
-
const modifiedName = `${COLOR_PREFIX}${token.substring(prefixLength)}`;
|
|
1116
|
-
return resolveColorTokenForMode(modifiedName, explicitMode, override, depth + 1);
|
|
1117
|
-
}
|
|
1118
|
-
// Resolve color.* tokens
|
|
1124
|
+
// Handle dash notation: color-blue-500, light-blue-500, dark-blue-500
|
|
1119
1125
|
if (token.startsWith(COLOR_PREFIX)) {
|
|
1120
|
-
const
|
|
1126
|
+
const parts = token.substring(COLOR_PREFIX.length).split('-');
|
|
1121
1127
|
const colorsToUse = themeColors[mode];
|
|
1122
1128
|
const palette = deepMerge(colorsToUse.palette, override?.colors?.palette || {});
|
|
1123
1129
|
const main = deepMerge(colorsToUse.main, override?.colors?.main || {});
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
const [
|
|
1127
|
-
const
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1130
|
+
// color-blue-500-200 (alpha)
|
|
1131
|
+
if (parts.length >= 3) {
|
|
1132
|
+
const lastPart = parts[parts.length - 1];
|
|
1133
|
+
const maybeAlpha = parseInt(lastPart, 10);
|
|
1134
|
+
if (!isNaN(maybeAlpha) && maybeAlpha >= 0 && maybeAlpha <= 1000) {
|
|
1135
|
+
const colorName = parts[0];
|
|
1136
|
+
const variant = parts[1];
|
|
1137
|
+
const base = palette?.[colorName]?.[variant];
|
|
1138
|
+
if (typeof base === 'string') {
|
|
1139
|
+
return convertToRgba(base, maybeAlpha);
|
|
1140
|
+
}
|
|
1131
1141
|
}
|
|
1132
|
-
return token;
|
|
1133
1142
|
}
|
|
1134
|
-
|
|
1135
|
-
|
|
1143
|
+
// color-blue-500
|
|
1144
|
+
if (parts.length === 2) {
|
|
1145
|
+
const [colorName, variant] = parts;
|
|
1136
1146
|
const value = palette?.[colorName]?.[variant];
|
|
1137
1147
|
return typeof value === 'string' ? value : token;
|
|
1138
1148
|
}
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
const value = main?.[
|
|
1149
|
+
// color-blue
|
|
1150
|
+
if (parts.length === 1) {
|
|
1151
|
+
const value = main?.[parts[0]];
|
|
1142
1152
|
return typeof value === 'string' ? value : token;
|
|
1143
1153
|
}
|
|
1144
1154
|
return token;
|
|
1145
1155
|
}
|
|
1156
|
+
// Handle light-* and dark-* tokens
|
|
1157
|
+
if (token.startsWith(LIGHT_PREFIX) || token.startsWith(DARK_PREFIX)) {
|
|
1158
|
+
const explicitMode = token.startsWith(LIGHT_PREFIX) ? 'light' : 'dark';
|
|
1159
|
+
const prefix = token.startsWith(LIGHT_PREFIX) ? LIGHT_PREFIX : DARK_PREFIX;
|
|
1160
|
+
const colorPart = token.substring(prefix.length);
|
|
1161
|
+
return resolveColorTokenForMode(`${COLOR_PREFIX}${colorPart}`, explicitMode, override, depth + 1);
|
|
1162
|
+
}
|
|
1146
1163
|
return token;
|
|
1147
1164
|
}, [mergedTheme, themeColors]);
|
|
1148
1165
|
// --- Helper function to resolve color tokens to actual values ---
|
|
1166
|
+
// This is used internally and handles dash notation (public API)
|
|
1149
1167
|
const resolveColorToken = React.useCallback(token => {
|
|
1150
1168
|
if (!token || typeof token !== 'string') return String(token);
|
|
1151
1169
|
if (token === TRANSPARENT) return token;
|
|
1152
1170
|
const colors = currentColors;
|
|
1153
|
-
//
|
|
1171
|
+
// Handle dash notation: color-blue-500
|
|
1154
1172
|
if (token.startsWith(COLOR_PREFIX)) {
|
|
1155
|
-
const
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1173
|
+
const parts = token.substring(COLOR_PREFIX.length).split('-');
|
|
1174
|
+
// color-blue-500-200 (alpha)
|
|
1175
|
+
if (parts.length >= 3) {
|
|
1176
|
+
const lastPart = parts[parts.length - 1];
|
|
1177
|
+
const maybeAlpha = parseInt(lastPart, 10);
|
|
1178
|
+
if (!isNaN(maybeAlpha) && maybeAlpha >= 0 && maybeAlpha <= 1000) {
|
|
1179
|
+
const percentage = Math.round(maybeAlpha / 1000 * 100);
|
|
1180
|
+
const baseVar = `color-${parts.slice(0, -1).join('-')}`;
|
|
1181
|
+
return `color-mix(in srgb, var(--${baseVar}) ${percentage}%, transparent)`;
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
// color-blue-500
|
|
1185
|
+
if (parts.length === 2) {
|
|
1186
|
+
const [colorName, shade] = parts;
|
|
1163
1187
|
const shadeValue = colors.palette[colorName]?.[Number(shade)];
|
|
1164
1188
|
return typeof shadeValue === 'string' ? shadeValue : token;
|
|
1165
|
-
}
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
const
|
|
1169
|
-
|
|
1170
|
-
if (!isNaN(alpha)) {
|
|
1171
|
-
const percentage = Math.round(alpha / 1000 * 100);
|
|
1172
|
-
return `color-mix(in srgb, var(--color-${colorName}-${shade}) ${percentage}%, transparent)`;
|
|
1173
|
-
}
|
|
1189
|
+
}
|
|
1190
|
+
// color-blue
|
|
1191
|
+
if (parts.length === 1) {
|
|
1192
|
+
const colorValue = colors.main[parts[0]];
|
|
1193
|
+
return typeof colorValue === 'string' ? colorValue : token;
|
|
1174
1194
|
}
|
|
1175
1195
|
}
|
|
1176
|
-
//
|
|
1196
|
+
// Handle dash notation: theme-primary, theme-primary-100
|
|
1177
1197
|
if (token.startsWith(THEME_PREFIX)) {
|
|
1178
|
-
const
|
|
1198
|
+
const parts = token.substring(THEME_PREFIX.length).split('-');
|
|
1199
|
+
const lastPart = parts[parts.length - 1];
|
|
1200
|
+
const maybeAlpha = parseInt(lastPart, 10);
|
|
1201
|
+
// theme-primary-100 (alpha)
|
|
1202
|
+
if (parts.length >= 2 && !isNaN(maybeAlpha) && maybeAlpha >= 0 && maybeAlpha <= 1000) {
|
|
1203
|
+
const percentage = Math.round(maybeAlpha / 1000 * 100);
|
|
1204
|
+
const baseVar = `theme-${parts.slice(0, -1).join('-')}`;
|
|
1205
|
+
return `color-mix(in srgb, var(--${baseVar}) ${percentage}%, transparent)`;
|
|
1206
|
+
}
|
|
1207
|
+
const themeKey = parts.join('-');
|
|
1179
1208
|
const themeValue = mergedTheme[themeKey];
|
|
1180
1209
|
if (typeof themeValue === 'string') {
|
|
1181
1210
|
return resolveColorToken(themeValue);
|
|
@@ -1184,86 +1213,46 @@
|
|
|
1184
1213
|
return token;
|
|
1185
1214
|
}, [currentColors, mergedTheme]);
|
|
1186
1215
|
// The mode is now handled by the data-attribute on the container
|
|
1187
|
-
// --- Memoized getColor function -
|
|
1188
|
-
const getColor = React.useCallback(
|
|
1189
|
-
if (!name || typeof name !== 'string') return String(name);
|
|
1216
|
+
// --- Memoized getColor function - Dash notation only ---
|
|
1217
|
+
const getColor = React.useCallback(name => {
|
|
1218
|
+
if (!name || typeof name !== 'string') return String(name);
|
|
1190
1219
|
if (name === TRANSPARENT) return name;
|
|
1191
|
-
//
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
if (name.startsWith(THEME_PREFIX)) {
|
|
1195
|
-
return `var(--${name.replace(/\./g, '-')})`;
|
|
1196
|
-
}
|
|
1197
|
-
if (name.startsWith(COLOR_PREFIX)) {
|
|
1198
|
-
const parts = name.split('.');
|
|
1199
|
-
// Simple lookup (e.g. color.blue or color.blue.500)
|
|
1200
|
-
if (parts.length < 4) {
|
|
1201
|
-
return `var(--${name.replace(/\./g, '-')})`;
|
|
1202
|
-
}
|
|
1203
|
-
}
|
|
1220
|
+
// Strict Mode Check - only dash notation is supported
|
|
1221
|
+
if (strict && !name.startsWith(COLOR_PREFIX) && !name.startsWith(THEME_PREFIX) && !name.startsWith(LIGHT_PREFIX) && !name.startsWith(DARK_PREFIX)) {
|
|
1222
|
+
console.warn(`[Theme] Invalid color token: '${name}'. Use dash notation: theme-primary, color-blue-500`);
|
|
1204
1223
|
}
|
|
1205
|
-
|
|
1206
|
-
const
|
|
1207
|
-
const
|
|
1208
|
-
|
|
1209
|
-
if (
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
}
|
|
1216
|
-
// 3. Select the correct color set (light/dark) based on the effective mode
|
|
1217
|
-
const colorsToUse = themeColors[effectiveMode];
|
|
1218
|
-
if (!colorsToUse) {
|
|
1219
|
-
console.warn(`Color set for mode "${effectiveMode}" not found.`);
|
|
1220
|
-
return name;
|
|
1221
|
-
}
|
|
1222
|
-
let resolvedColor = name;
|
|
1223
|
-
try {
|
|
1224
|
-
// Resolve "light.*" or "dark.*" paths directly
|
|
1225
|
-
if (name.startsWith('light.') || name.startsWith('dark.')) {
|
|
1226
|
-
const prefixLength = name.startsWith('light.') ? 6 : 5;
|
|
1227
|
-
const modifiedName = `${COLOR_PREFIX}${name.substring(prefixLength)}`;
|
|
1228
|
-
return `var(--${modifiedName.replace(/\./g, '-')})`;
|
|
1224
|
+
const parts = name.split('-');
|
|
1225
|
+
const lastPart = parts[parts.length - 1];
|
|
1226
|
+
const maybeAlpha = parseInt(lastPart, 10);
|
|
1227
|
+
// Handle theme-* tokens (e.g., theme-primary, theme-primary-100)
|
|
1228
|
+
if (name.startsWith(THEME_PREFIX)) {
|
|
1229
|
+
// Check for alpha suffix: theme-primary-100 (3+ parts, last is 0-1000)
|
|
1230
|
+
if (parts.length >= 3 && !isNaN(maybeAlpha) && maybeAlpha >= 0 && maybeAlpha <= 1000) {
|
|
1231
|
+
const baseVar = parts.slice(0, -1).join('-');
|
|
1232
|
+
const percentage = Math.round(maybeAlpha / 1000 * 100);
|
|
1233
|
+
return `color-mix(in srgb, var(--${baseVar}) ${percentage}%, transparent)`;
|
|
1229
1234
|
}
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
if (typeof shadeValue === 'string' && !isNaN(alpha)) {
|
|
1240
|
-
resolvedColor = convertToRgba(shadeValue, alpha);
|
|
1241
|
-
}
|
|
1242
|
-
} else if (keys.length === 2) {
|
|
1243
|
-
// e.g. "color.blue.500"
|
|
1244
|
-
const [colorName, variant] = keys;
|
|
1245
|
-
const palette = deepMerge(colorsToUse.palette, override?.colors?.palette || {});
|
|
1246
|
-
const shadeValue = palette?.[colorName]?.[variant];
|
|
1247
|
-
if (typeof shadeValue === 'string') {
|
|
1248
|
-
resolvedColor = shadeValue;
|
|
1249
|
-
}
|
|
1250
|
-
} else if (keys.length === 1) {
|
|
1251
|
-
// e.g. "color.blue"
|
|
1252
|
-
const [colorName] = keys;
|
|
1253
|
-
const main = deepMerge(colorsToUse.main, override?.colors?.main || {});
|
|
1254
|
-
const colorValue = main?.[colorName];
|
|
1255
|
-
if (typeof colorValue === 'string') {
|
|
1256
|
-
resolvedColor = colorValue;
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1235
|
+
return `var(--${name})`;
|
|
1236
|
+
}
|
|
1237
|
+
// Handle color-* tokens (e.g., color-blue-500, color-blue-500-200)
|
|
1238
|
+
if (name.startsWith(COLOR_PREFIX)) {
|
|
1239
|
+
// Check for alpha suffix: color-blue-500-200 (4+ parts, last is 0-1000)
|
|
1240
|
+
if (parts.length >= 4 && !isNaN(maybeAlpha) && maybeAlpha >= 0 && maybeAlpha <= 1000) {
|
|
1241
|
+
const baseVar = parts.slice(0, -1).join('-');
|
|
1242
|
+
const percentage = Math.round(maybeAlpha / 1000 * 100);
|
|
1243
|
+
return `color-mix(in srgb, var(--${baseVar}) ${percentage}%, transparent)`;
|
|
1259
1244
|
}
|
|
1260
|
-
|
|
1261
|
-
console.error(`Error resolving color "${name}"`, e);
|
|
1262
|
-
resolvedColor = name;
|
|
1245
|
+
return `var(--${name})`;
|
|
1263
1246
|
}
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1247
|
+
// Handle light-* and dark-* tokens (e.g., light-blue-500, dark-red-200)
|
|
1248
|
+
if (name.startsWith(LIGHT_PREFIX) || name.startsWith(DARK_PREFIX)) {
|
|
1249
|
+
const prefix = name.startsWith(LIGHT_PREFIX) ? LIGHT_PREFIX : DARK_PREFIX;
|
|
1250
|
+
const colorPart = name.substring(prefix.length);
|
|
1251
|
+
return `var(--${prefix}color-${colorPart})`;
|
|
1252
|
+
}
|
|
1253
|
+
// Return as-is for direct values (#hex, rgb(), etc.)
|
|
1254
|
+
return name;
|
|
1255
|
+
}, [strict]);
|
|
1267
1256
|
const getColorHex = React.useCallback((name, override) => {
|
|
1268
1257
|
if (!name || typeof name !== 'string') return String(name);
|
|
1269
1258
|
if (name === TRANSPARENT) return '#00000000';
|
|
@@ -1297,7 +1286,7 @@
|
|
|
1297
1286
|
if (!name || typeof name !== 'string') return undefined;
|
|
1298
1287
|
const effectiveMode = override?.themeMode ?? themeMode;
|
|
1299
1288
|
const effectiveTheme = override?.theme ? deepMerge(mergedTheme, override.theme) : mergedTheme;
|
|
1300
|
-
// Resolve theme
|
|
1289
|
+
// Resolve theme-* tokens to get the underlying color token
|
|
1301
1290
|
let colorToken = name;
|
|
1302
1291
|
if (name.startsWith(THEME_PREFIX)) {
|
|
1303
1292
|
const themeKey = name.substring(THEME_PREFIX.length);
|
|
@@ -1306,16 +1295,16 @@
|
|
|
1306
1295
|
colorToken = themeValue;
|
|
1307
1296
|
}
|
|
1308
1297
|
}
|
|
1309
|
-
// Handle light
|
|
1310
|
-
if (colorToken.startsWith(
|
|
1311
|
-
const
|
|
1312
|
-
colorToken = `${COLOR_PREFIX}${colorToken.substring(
|
|
1298
|
+
// Handle light-* or dark-* prefixes
|
|
1299
|
+
if (colorToken.startsWith(LIGHT_PREFIX) || colorToken.startsWith(DARK_PREFIX)) {
|
|
1300
|
+
const prefix = colorToken.startsWith(LIGHT_PREFIX) ? LIGHT_PREFIX : DARK_PREFIX;
|
|
1301
|
+
colorToken = `${COLOR_PREFIX}${colorToken.substring(prefix.length)}`;
|
|
1313
1302
|
}
|
|
1314
|
-
// Extract color scheme from color
|
|
1303
|
+
// Extract color scheme from color-* tokens (e.g., color-blue-500 -> 'blue')
|
|
1315
1304
|
if (colorToken.startsWith(COLOR_PREFIX)) {
|
|
1316
|
-
const
|
|
1317
|
-
if (
|
|
1318
|
-
return
|
|
1305
|
+
const parts = colorToken.substring(COLOR_PREFIX.length).split('-');
|
|
1306
|
+
if (parts.length >= 1) {
|
|
1307
|
+
return parts[0]; // Return the color scheme name (e.g., 'blue', 'pink')
|
|
1319
1308
|
}
|
|
1320
1309
|
}
|
|
1321
1310
|
// Handle hex or rgba colors by finding the closest match in the palette
|
|
@@ -2701,7 +2690,7 @@
|
|
|
2701
2690
|
*/
|
|
2702
2691
|
function processEventStyles(eventName, eventStyles, getColor, manager) {
|
|
2703
2692
|
const classes = [];
|
|
2704
|
-
// Handle string shorthand (e.g., _hover: "color
|
|
2693
|
+
// Handle string shorthand (e.g., _hover: "color-red-500")
|
|
2705
2694
|
if (typeof eventStyles === 'string') {
|
|
2706
2695
|
eventStyles = {
|
|
2707
2696
|
color: eventStyles
|
|
@@ -3021,20 +3010,10 @@
|
|
|
3021
3010
|
}
|
|
3022
3011
|
const {
|
|
3023
3012
|
onPress,
|
|
3024
|
-
blend
|
|
3013
|
+
blend,
|
|
3025
3014
|
animateOn = 'Both',
|
|
3026
3015
|
...rest
|
|
3027
3016
|
} = props;
|
|
3028
|
-
let blend = initialBlend;
|
|
3029
|
-
if (blend !== false && props.color === undefined && typeof props.children === 'string' && (as === 'span' || as === 'div' || as === 'sub' || as === 'sup')) {
|
|
3030
|
-
const otherMediaProps = {
|
|
3031
|
-
...(props.on || {}),
|
|
3032
|
-
...(props.media || {})
|
|
3033
|
-
};
|
|
3034
|
-
if (otherMediaProps.color === undefined) {
|
|
3035
|
-
blend = true;
|
|
3036
|
-
}
|
|
3037
|
-
}
|
|
3038
3017
|
const elementRef = React.useRef(null);
|
|
3039
3018
|
const setRef = React.useCallback(node => {
|
|
3040
3019
|
elementRef.current = node;
|
|
@@ -4951,7 +4930,7 @@
|
|
|
4951
4930
|
...props
|
|
4952
4931
|
} = _ref;
|
|
4953
4932
|
return /*#__PURE__*/React__default.createElement(View, Object.assign({
|
|
4954
|
-
backgroundColor: "color
|
|
4933
|
+
backgroundColor: "color-black-300"
|
|
4955
4934
|
}, props, {
|
|
4956
4935
|
overflow: "hidden"
|
|
4957
4936
|
}), /*#__PURE__*/React__default.createElement(View, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-studio.umd.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"app-studio.umd.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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