native-variants 0.1.64 → 0.1.69
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/LICENSE +21 -21
- package/README.md +125 -125
- package/dist/example.js +1 -0
- package/dist/index.d.ts +17 -8
- package/dist/index.js +72 -22
- package/dist/index.js.map +1 -1
- package/dist/lib/cn.d.ts +82 -2
- package/dist/lib/cn.js +138 -8
- package/dist/lib/cn.js.map +1 -1
- package/dist/lib/create-nva.d.ts +209 -6
- package/dist/lib/create-nva.js +460 -47
- package/dist/lib/create-nva.js.map +1 -1
- package/dist/lib/media-query.d.ts +84 -2
- package/dist/lib/media-query.js +103 -9
- package/dist/lib/media-query.js.map +1 -1
- package/dist/provider/create-provider.d.ts +43 -3
- package/dist/provider/create-provider.js +1 -1
- package/dist/provider/create-provider.jsx +76 -8
- package/dist/provider/create-provider.jsx.map +1 -1
- package/dist/provider/theme-provider.d.ts +266 -0
- package/dist/provider/theme-provider.js +1 -0
- package/dist/provider/theme-provider.jsx +328 -0
- package/dist/provider/theme-provider.jsx.map +1 -0
- package/dist/tokens/default-tokens.d.ts +2737 -0
- package/dist/tokens/default-tokens.js +1067 -0
- package/dist/tokens/default-tokens.js.map +1 -0
- package/dist/types.d.ts +318 -3
- package/dist/utils/alpha.d.ts +68 -0
- package/dist/utils/alpha.js +147 -4
- package/dist/utils/alpha.js.map +1 -1
- package/dist/utils/compose-text.d.ts +64 -2
- package/dist/utils/compose-text.js +103 -3
- package/dist/utils/compose-text.js.map +1 -1
- package/package.json +1 -1
- package/dist/utils/compose-refs.d.ts +0 -4
- package/dist/utils/compose-refs.js +0 -39
- package/dist/utils/compose-refs.js.map +0 -1
package/dist/lib/create-nva.js
CHANGED
|
@@ -2,100 +2,513 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.styled = styled;
|
|
4
4
|
exports.createNVA = createNVA;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
exports.clearStyleCache = clearStyleCache;
|
|
6
|
+
const default_tokens_1 = require("../tokens/default-tokens.js");
|
|
7
|
+
/**
|
|
8
|
+
* High-performance memoization cache using WeakMap for object keys
|
|
9
|
+
* and Map for primitive keys. Optimized for React Native runtime.
|
|
10
|
+
*/
|
|
11
|
+
const styleCache = new WeakMap();
|
|
12
|
+
const primitiveCache = new Map();
|
|
13
|
+
/**
|
|
14
|
+
* Creates a stable cache key from variant props.
|
|
15
|
+
* Optimized for performance by avoiding JSON.stringify on simple cases.
|
|
16
|
+
*
|
|
17
|
+
* @param props - The variant props to create a key from
|
|
18
|
+
* @returns A stable string key for caching
|
|
19
|
+
*/
|
|
20
|
+
function createCacheKey(props) {
|
|
21
|
+
if (!props)
|
|
22
|
+
return "{}";
|
|
23
|
+
const keys = Object.keys(props);
|
|
24
|
+
if (keys.length === 0)
|
|
25
|
+
return "{}";
|
|
26
|
+
// Sort keys for consistent ordering
|
|
27
|
+
keys.sort();
|
|
28
|
+
let key = "";
|
|
29
|
+
for (let i = 0; i < keys.length; i++) {
|
|
30
|
+
const k = keys[i];
|
|
31
|
+
const v = props[k];
|
|
32
|
+
if (v !== undefined) {
|
|
33
|
+
key += `${k}:${String(v)};`;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return key || "{}";
|
|
15
37
|
}
|
|
16
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Normalizes a variant value to string for comparison.
|
|
40
|
+
* Handles boolean-to-string conversion for true/false variant keys.
|
|
41
|
+
*
|
|
42
|
+
* @param value - The value to normalize
|
|
43
|
+
* @returns The normalized string value
|
|
44
|
+
*/
|
|
45
|
+
function normalizeVariantValue(value) {
|
|
46
|
+
if (typeof value === "boolean") {
|
|
47
|
+
return value ? "true" : "false";
|
|
48
|
+
}
|
|
49
|
+
return String(value);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Applies variant styles to a specific slot.
|
|
53
|
+
* Iterates through variant definitions and applies matching styles.
|
|
54
|
+
*
|
|
55
|
+
* @template S - Union type of slot names
|
|
56
|
+
* @template V - Variants configuration type
|
|
57
|
+
*
|
|
58
|
+
* @param slot - The slot name to apply styles to
|
|
59
|
+
* @param variants - The variants configuration object
|
|
60
|
+
* @param props - The current variant props
|
|
61
|
+
* @returns The merged styles for the slot
|
|
62
|
+
*/
|
|
63
|
+
function applyVariant(slot, variants, props) {
|
|
17
64
|
let style = {};
|
|
18
|
-
for (const
|
|
19
|
-
if (Object.prototype.hasOwnProperty.call(props,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
65
|
+
for (const variantKey in variants) {
|
|
66
|
+
if (!Object.prototype.hasOwnProperty.call(props, variantKey))
|
|
67
|
+
continue;
|
|
68
|
+
const value = props[variantKey];
|
|
69
|
+
if (value === undefined)
|
|
70
|
+
continue;
|
|
71
|
+
const variantConfig = variants[variantKey];
|
|
72
|
+
if (!variantConfig)
|
|
73
|
+
continue;
|
|
74
|
+
// Normalize boolean values to string keys
|
|
75
|
+
const normalizedValue = normalizeVariantValue(value);
|
|
76
|
+
const styleForValue = variantConfig[normalizedValue]?.[slot];
|
|
77
|
+
if (styleForValue) {
|
|
78
|
+
style = { ...style, ...styleForValue };
|
|
26
79
|
}
|
|
27
80
|
}
|
|
28
81
|
return style;
|
|
29
82
|
}
|
|
30
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Applies compound variant styles to a specific slot.
|
|
85
|
+
* Evaluates compound conditions and applies matching styles.
|
|
86
|
+
*
|
|
87
|
+
* @template S - Union type of slot names
|
|
88
|
+
* @template V - Variants configuration type
|
|
89
|
+
*
|
|
90
|
+
* @param slot - The slot name to apply styles to
|
|
91
|
+
* @param compoundVariants - Array of compound variant configurations
|
|
92
|
+
* @param props - The current variant props
|
|
93
|
+
* @returns The merged compound styles for the slot
|
|
94
|
+
*/
|
|
95
|
+
function applyCompound(slot, compoundVariants, props) {
|
|
31
96
|
let style = {};
|
|
32
|
-
for (
|
|
33
|
-
const
|
|
34
|
-
const
|
|
97
|
+
for (let i = 0; i < compoundVariants.length; i++) {
|
|
98
|
+
const cv = compoundVariants[i];
|
|
99
|
+
const { css, ...conditions } = cv;
|
|
100
|
+
// Check if all conditions match
|
|
101
|
+
let isMatch = true;
|
|
102
|
+
for (const condKey in conditions) {
|
|
103
|
+
if (condKey === "css")
|
|
104
|
+
continue;
|
|
105
|
+
const condValue = conditions[condKey];
|
|
106
|
+
const propValue = props[condKey];
|
|
107
|
+
// Normalize both values for comparison
|
|
108
|
+
const normalizedCond = normalizeVariantValue(condValue);
|
|
109
|
+
const normalizedProp = normalizeVariantValue(propValue);
|
|
110
|
+
if (normalizedCond !== normalizedProp) {
|
|
111
|
+
isMatch = false;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
35
115
|
if (isMatch && css?.[slot]) {
|
|
36
116
|
style = { ...style, ...css[slot] };
|
|
37
117
|
}
|
|
38
118
|
}
|
|
39
119
|
return style;
|
|
40
120
|
}
|
|
41
|
-
|
|
121
|
+
/**
|
|
122
|
+
* Computes the final styles for a slot by merging base, variant, and compound styles.
|
|
123
|
+
*
|
|
124
|
+
* @template S - Union type of slot names
|
|
125
|
+
* @template V - Variants configuration type
|
|
126
|
+
*
|
|
127
|
+
* @param slot - The slot name to compute styles for
|
|
128
|
+
* @param base - The base styles configuration
|
|
129
|
+
* @param variants - The variants configuration
|
|
130
|
+
* @param compoundVariants - The compound variants array
|
|
131
|
+
* @param props - The resolved variant props
|
|
132
|
+
* @returns The fully merged styles for the slot
|
|
133
|
+
*/
|
|
134
|
+
function computeSlotStyles(slot, base, variants, compoundVariants, props) {
|
|
135
|
+
const baseStyle = base?.[slot] ?? {};
|
|
136
|
+
const variantStyle = applyVariant(slot, variants, props);
|
|
137
|
+
const compoundStyle = applyCompound(slot, compoundVariants, props);
|
|
42
138
|
return {
|
|
43
|
-
...
|
|
44
|
-
...
|
|
45
|
-
...
|
|
139
|
+
...baseStyle,
|
|
140
|
+
...variantStyle,
|
|
141
|
+
...compoundStyle,
|
|
46
142
|
};
|
|
47
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* Creates a styled component function with variant support.
|
|
146
|
+
* Provides caching for optimal performance in React Native.
|
|
147
|
+
*
|
|
148
|
+
* @template S - Union type of slot names
|
|
149
|
+
* @template V - Variants configuration type
|
|
150
|
+
*
|
|
151
|
+
* @param config - The styled component configuration
|
|
152
|
+
* @returns A function that computes styles based on variant props
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```ts
|
|
156
|
+
* const buttonStyles = styled({
|
|
157
|
+
* slots: ["root", "text"],
|
|
158
|
+
* base: {
|
|
159
|
+
* root: { padding: 16 },
|
|
160
|
+
* text: { fontSize: 14 }
|
|
161
|
+
* },
|
|
162
|
+
* variants: {
|
|
163
|
+
* size: {
|
|
164
|
+
* small: { root: { padding: 8 } },
|
|
165
|
+
* large: { root: { padding: 24 } }
|
|
166
|
+
* }
|
|
167
|
+
* },
|
|
168
|
+
* defaultVariants: {
|
|
169
|
+
* size: "small"
|
|
170
|
+
* }
|
|
171
|
+
* });
|
|
172
|
+
*
|
|
173
|
+
* // Usage
|
|
174
|
+
* const styles = buttonStyles({ size: "large" });
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
48
177
|
function styled(config) {
|
|
49
178
|
const { slots, base = {}, variants = {}, defaultVariants = {}, compoundVariants = [], } = config;
|
|
50
|
-
|
|
179
|
+
// Pre-freeze arrays for performance
|
|
180
|
+
const frozenSlots = Object.freeze([...slots]);
|
|
181
|
+
const frozenCompoundVariants = Object.freeze([...compoundVariants]);
|
|
182
|
+
// Create a stable config reference for caching
|
|
183
|
+
const configRef = { config };
|
|
184
|
+
return function computeStyles(props) {
|
|
185
|
+
// Create cache key from props
|
|
186
|
+
const cacheKey = createCacheKey(props);
|
|
187
|
+
// Check cache first
|
|
188
|
+
let configCache = styleCache.get(configRef);
|
|
189
|
+
if (configCache?.has(cacheKey)) {
|
|
190
|
+
return configCache.get(cacheKey);
|
|
191
|
+
}
|
|
192
|
+
// Resolve props with defaults
|
|
51
193
|
const resolvedProps = { ...defaultVariants };
|
|
52
|
-
// Override only explicitly defined variant props, keeping defaults untouched
|
|
53
194
|
if (props) {
|
|
54
195
|
for (const key in props) {
|
|
55
196
|
const value = props[key];
|
|
56
197
|
if (value !== undefined) {
|
|
57
|
-
//@ts-ignore
|
|
58
198
|
resolvedProps[key] = value;
|
|
59
199
|
}
|
|
60
200
|
}
|
|
61
201
|
}
|
|
202
|
+
// Compute styles for each slot
|
|
62
203
|
const result = {};
|
|
63
|
-
for (
|
|
64
|
-
|
|
204
|
+
for (let i = 0; i < frozenSlots.length; i++) {
|
|
205
|
+
const slot = frozenSlots[i];
|
|
206
|
+
result[slot] = computeSlotStyles(slot, base, variants, frozenCompoundVariants, resolvedProps);
|
|
65
207
|
}
|
|
208
|
+
// Store in cache
|
|
209
|
+
if (!configCache) {
|
|
210
|
+
configCache = new Map();
|
|
211
|
+
styleCache.set(configRef, configCache);
|
|
212
|
+
}
|
|
213
|
+
configCache.set(cacheKey, result);
|
|
66
214
|
return result;
|
|
67
215
|
};
|
|
68
|
-
const cachedComputeStyles = cache(computeStyles);
|
|
69
|
-
return cachedComputeStyles;
|
|
70
216
|
}
|
|
71
|
-
|
|
217
|
+
/**
|
|
218
|
+
* Default tokens from Tailwind CSS.
|
|
219
|
+
* These are included by default in every theme.
|
|
220
|
+
*/
|
|
221
|
+
const defaultTokens = {
|
|
222
|
+
/** @see https://tailwindcss.com/docs/customizing-colors */
|
|
223
|
+
palette: default_tokens_1.tailwindColors,
|
|
224
|
+
/** @see https://tailwindcss.com/docs/customizing-spacing */
|
|
225
|
+
spacing: default_tokens_1.tailwindSpacing,
|
|
226
|
+
/** @see https://tailwindcss.com/docs/font-size */
|
|
227
|
+
fontSizes: default_tokens_1.tailwindFontSizes,
|
|
228
|
+
/** @see https://tailwindcss.com/docs/border-radius */
|
|
229
|
+
radii: default_tokens_1.tailwindRadii,
|
|
230
|
+
/** @see https://tailwindcss.com/docs/box-shadow */
|
|
231
|
+
shadows: default_tokens_1.tailwindShadows,
|
|
232
|
+
/** @see https://tailwindcss.com/docs/z-index */
|
|
233
|
+
zIndex: default_tokens_1.tailwindZIndex,
|
|
234
|
+
/** @see https://tailwindcss.com/docs/opacity */
|
|
235
|
+
opacity: default_tokens_1.tailwindOpacity,
|
|
236
|
+
/** @see https://tailwindcss.com/docs/line-height */
|
|
237
|
+
lineHeights: default_tokens_1.tailwindLineHeights,
|
|
238
|
+
/** @see https://tailwindcss.com/docs/font-weight */
|
|
239
|
+
fontWeights: default_tokens_1.tailwindFontWeights,
|
|
240
|
+
/** @see https://tailwindcss.com/docs/letter-spacing */
|
|
241
|
+
letterSpacing: default_tokens_1.tailwindLetterSpacing,
|
|
242
|
+
/** @see https://tailwindcss.com/docs/border-width */
|
|
243
|
+
borderWidths: default_tokens_1.tailwindBorderWidths,
|
|
244
|
+
/** @see https://tailwindcss.com/docs/transition-duration */
|
|
245
|
+
durations: default_tokens_1.tailwindDurations,
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Expands utils in a style object.
|
|
249
|
+
* Takes a style with potential util keys and expands them to their actual styles.
|
|
250
|
+
*
|
|
251
|
+
* @param style - The style object potentially containing util keys
|
|
252
|
+
* @param utils - The utils configuration
|
|
253
|
+
* @returns The expanded style object
|
|
254
|
+
*/
|
|
255
|
+
function expandUtils(style, utils) {
|
|
256
|
+
if (!style)
|
|
257
|
+
return {};
|
|
258
|
+
const result = {};
|
|
259
|
+
for (const key in style) {
|
|
260
|
+
const value = style[key];
|
|
261
|
+
if (key in utils) {
|
|
262
|
+
// This is a util - expand it
|
|
263
|
+
const utilFn = utils[key];
|
|
264
|
+
const expandedStyles = utilFn(value);
|
|
265
|
+
Object.assign(result, expandedStyles);
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
// Regular style property
|
|
269
|
+
result[key] = value;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return result;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Expands utils in a base styles object for all slots.
|
|
276
|
+
*
|
|
277
|
+
* @param base - The base styles with potential utils
|
|
278
|
+
* @param utils - The utils configuration
|
|
279
|
+
* @returns The expanded base styles
|
|
280
|
+
*/
|
|
281
|
+
function expandBaseUtils(base, utils) {
|
|
282
|
+
if (!base)
|
|
283
|
+
return {};
|
|
284
|
+
const result = {};
|
|
285
|
+
for (const slot in base) {
|
|
286
|
+
result[slot] = expandUtils(base[slot], utils);
|
|
287
|
+
}
|
|
288
|
+
return result;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Expands utils in variants configuration.
|
|
292
|
+
*
|
|
293
|
+
* @param variants - The variants with potential utils
|
|
294
|
+
* @param utils - The utils configuration
|
|
295
|
+
* @returns The expanded variants
|
|
296
|
+
*/
|
|
297
|
+
function expandVariantsUtils(variants, utils) {
|
|
298
|
+
if (!variants)
|
|
299
|
+
return {};
|
|
300
|
+
const result = {};
|
|
301
|
+
for (const variantKey in variants) {
|
|
302
|
+
const variantValues = variants[variantKey];
|
|
303
|
+
if (!variantValues)
|
|
304
|
+
continue;
|
|
305
|
+
result[variantKey] = {};
|
|
306
|
+
for (const valueKey in variantValues) {
|
|
307
|
+
const slots = variantValues[valueKey];
|
|
308
|
+
if (!slots)
|
|
309
|
+
continue;
|
|
310
|
+
result[variantKey][valueKey] = {};
|
|
311
|
+
for (const slot in slots) {
|
|
312
|
+
result[variantKey][valueKey][slot] = expandUtils(slots[slot], utils);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return result;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Expands utils in compound variants.
|
|
320
|
+
*
|
|
321
|
+
* @param compoundVariants - The compound variants with potential utils
|
|
322
|
+
* @param utils - The utils configuration
|
|
323
|
+
* @returns The expanded compound variants
|
|
324
|
+
*/
|
|
325
|
+
function expandCompoundUtils(compoundVariants, utils) {
|
|
326
|
+
if (!compoundVariants)
|
|
327
|
+
return [];
|
|
328
|
+
return compoundVariants.map((cv) => {
|
|
329
|
+
const { css, ...conditions } = cv;
|
|
330
|
+
const expandedCss = {};
|
|
331
|
+
if (css) {
|
|
332
|
+
for (const slot in css) {
|
|
333
|
+
expandedCss[slot] = expandUtils(css[slot], utils);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return {
|
|
337
|
+
...conditions,
|
|
338
|
+
css: expandedCss,
|
|
339
|
+
};
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Creates a themed NVA (Native Variants API) instance.
|
|
344
|
+
* Provides a styled function with access to theme tokens and custom utils.
|
|
345
|
+
*
|
|
346
|
+
* Colors support light/dark mode via `default` and `dark` keys.
|
|
347
|
+
* Both must have the same color keys for type safety - TypeScript will
|
|
348
|
+
* error if dark is missing any keys from default or vice versa.
|
|
349
|
+
*
|
|
350
|
+
* Utils are style shortcuts that expand to multiple CSS properties.
|
|
351
|
+
* They work like Stitches utils - you define them once and use them
|
|
352
|
+
* throughout your styles.
|
|
353
|
+
*
|
|
354
|
+
* Tailwind CSS tokens (spacing, fontSizes, radii, etc.) are included by default.
|
|
355
|
+
*
|
|
356
|
+
* @template D - Default colors type (inferred from colors.default)
|
|
357
|
+
* @template K - Dark colors type (must have same keys as D)
|
|
358
|
+
* @template U - Utils configuration type
|
|
359
|
+
*
|
|
360
|
+
* @param options - Configuration options
|
|
361
|
+
* @param options.theme - Theme configuration with colors (default/dark)
|
|
362
|
+
* @param options.utils - Custom style utilities (like Stitches)
|
|
363
|
+
* @returns An object containing the flattened theme, styled function, and utils
|
|
364
|
+
*
|
|
365
|
+
* @example
|
|
366
|
+
* ```ts
|
|
367
|
+
* const { styled, theme, colorScheme, utils } = createNVA({
|
|
368
|
+
* theme: {
|
|
369
|
+
* colors: {
|
|
370
|
+
* default: {
|
|
371
|
+
* primary: "#007AFF",
|
|
372
|
+
* background: "#FFFFFF",
|
|
373
|
+
* },
|
|
374
|
+
* dark: {
|
|
375
|
+
* primary: "#0A84FF",
|
|
376
|
+
* background: "#000000",
|
|
377
|
+
* },
|
|
378
|
+
* },
|
|
379
|
+
* },
|
|
380
|
+
* utils: {
|
|
381
|
+
* // Margin shortcuts
|
|
382
|
+
* mx: (value) => ({ marginLeft: value, marginRight: value }),
|
|
383
|
+
* my: (value) => ({ marginTop: value, marginBottom: value }),
|
|
384
|
+
* // Padding shortcuts
|
|
385
|
+
* px: (value) => ({ paddingLeft: value, paddingRight: value }),
|
|
386
|
+
* py: (value) => ({ paddingTop: value, paddingBottom: value }),
|
|
387
|
+
* // Size shortcut
|
|
388
|
+
* size: (value) => ({ width: value, height: value }),
|
|
389
|
+
* },
|
|
390
|
+
* });
|
|
391
|
+
*
|
|
392
|
+
* // Use utils in your styles!
|
|
393
|
+
* const buttonStyles = styled((ctx, t) => ctx({
|
|
394
|
+
* slots: ["root"],
|
|
395
|
+
* base: {
|
|
396
|
+
* root: {
|
|
397
|
+
* backgroundColor: t.colors.primary,
|
|
398
|
+
* px: 16, // → paddingLeft: 16, paddingRight: 16
|
|
399
|
+
* py: 12, // → paddingTop: 12, paddingBottom: 12
|
|
400
|
+
* },
|
|
401
|
+
* },
|
|
402
|
+
* }));
|
|
403
|
+
* ```
|
|
404
|
+
*/
|
|
405
|
+
function createNVA(options) {
|
|
406
|
+
const inputTheme = options?.theme;
|
|
407
|
+
const inputUtils = (options?.utils ?? {});
|
|
408
|
+
// Extract colors from default scheme (light mode)
|
|
409
|
+
const userColors = (inputTheme?.colors?.default ?? {});
|
|
410
|
+
// Merge user colors with Tailwind colors (user colors override defaults)
|
|
411
|
+
const mergedColors = {
|
|
412
|
+
...defaultTokens.palette,
|
|
413
|
+
...userColors,
|
|
414
|
+
};
|
|
415
|
+
const resolvedTheme = {
|
|
416
|
+
colors: mergedColors,
|
|
417
|
+
spacing: defaultTokens.spacing,
|
|
418
|
+
fontSizes: defaultTokens.fontSizes,
|
|
419
|
+
radii: defaultTokens.radii,
|
|
420
|
+
shadows: defaultTokens.shadows,
|
|
421
|
+
zIndex: defaultTokens.zIndex,
|
|
422
|
+
opacity: defaultTokens.opacity,
|
|
423
|
+
lineHeights: defaultTokens.lineHeights,
|
|
424
|
+
fontWeights: defaultTokens.fontWeights,
|
|
425
|
+
letterSpacing: defaultTokens.letterSpacing,
|
|
426
|
+
borderWidths: defaultTokens.borderWidths,
|
|
427
|
+
durations: defaultTokens.durations,
|
|
428
|
+
};
|
|
429
|
+
// Store the color scheme for ThemeProvider access
|
|
430
|
+
const colorScheme = inputTheme?.colors;
|
|
431
|
+
// Create a stable theme cache per createNVA instance
|
|
432
|
+
const instanceCache = new Map();
|
|
72
433
|
function styled(configOrFactory) {
|
|
73
434
|
const defineConfig = (config) => config;
|
|
74
|
-
const
|
|
75
|
-
? configOrFactory(defineConfig,
|
|
435
|
+
const configWithUtils = typeof configOrFactory === "function"
|
|
436
|
+
? configOrFactory(defineConfig, resolvedTheme)
|
|
76
437
|
: configOrFactory;
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
|
|
438
|
+
// Expand utils in all style configurations
|
|
439
|
+
const base = expandBaseUtils(configWithUtils.base, inputUtils);
|
|
440
|
+
const variants = expandVariantsUtils(configWithUtils.variants, inputUtils);
|
|
441
|
+
const compoundVariants = expandCompoundUtils(configWithUtils.compoundVariants, inputUtils);
|
|
442
|
+
const { slots, defaultVariants = {} } = configWithUtils;
|
|
443
|
+
// Pre-freeze for performance
|
|
444
|
+
const frozenSlots = Object.freeze([...slots]);
|
|
445
|
+
const frozenCompoundVariants = Object.freeze([...compoundVariants]);
|
|
446
|
+
// Create stable reference for this specific styled call
|
|
447
|
+
const configRef = { id: Symbol() };
|
|
448
|
+
return function computeStyles(props) {
|
|
449
|
+
const cacheKey = createCacheKey(props);
|
|
450
|
+
// Check instance cache
|
|
451
|
+
let configCache = instanceCache.get(configRef);
|
|
452
|
+
if (configCache?.has(cacheKey)) {
|
|
453
|
+
return configCache.get(cacheKey);
|
|
454
|
+
}
|
|
455
|
+
// Resolve props with defaults
|
|
456
|
+
const resolvedProps = {
|
|
457
|
+
...defaultVariants,
|
|
458
|
+
};
|
|
80
459
|
if (props) {
|
|
81
460
|
for (const key in props) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
resolvedProps[key] =
|
|
461
|
+
const value = props[key];
|
|
462
|
+
if (value !== undefined) {
|
|
463
|
+
resolvedProps[key] = value;
|
|
85
464
|
}
|
|
86
465
|
}
|
|
87
466
|
}
|
|
467
|
+
// Compute styles for each slot
|
|
88
468
|
const result = {};
|
|
89
|
-
for (
|
|
90
|
-
|
|
469
|
+
for (let i = 0; i < frozenSlots.length; i++) {
|
|
470
|
+
const slot = frozenSlots[i];
|
|
471
|
+
result[slot] = computeSlotStyles(slot, base, variants, frozenCompoundVariants, resolvedProps);
|
|
472
|
+
}
|
|
473
|
+
// Store in cache
|
|
474
|
+
if (!configCache) {
|
|
475
|
+
configCache = new Map();
|
|
476
|
+
instanceCache.set(configRef, configCache);
|
|
91
477
|
}
|
|
478
|
+
configCache.set(cacheKey, result);
|
|
92
479
|
return result;
|
|
93
480
|
};
|
|
94
|
-
return cache(computeStyles);
|
|
95
481
|
}
|
|
96
482
|
return {
|
|
97
|
-
|
|
483
|
+
/**
|
|
484
|
+
* The resolved theme object with flattened colors.
|
|
485
|
+
* Colors use the default (light) scheme.
|
|
486
|
+
* Use ThemeProvider to access dark mode colors.
|
|
487
|
+
*/
|
|
488
|
+
theme: resolvedTheme,
|
|
489
|
+
/**
|
|
490
|
+
* The color scheme configuration with both default and dark colors.
|
|
491
|
+
* Pass this to ThemeProvider for dark mode support.
|
|
492
|
+
*/
|
|
493
|
+
colorScheme,
|
|
494
|
+
/**
|
|
495
|
+
* Creates styled components with variant support and theme access.
|
|
496
|
+
* Utils defined in createNVA are automatically expanded in styles.
|
|
497
|
+
*/
|
|
98
498
|
styled,
|
|
499
|
+
/**
|
|
500
|
+
* The utils configuration for use outside of styled.
|
|
501
|
+
* Useful for applying utils to inline styles.
|
|
502
|
+
*/
|
|
503
|
+
utils: inputUtils,
|
|
99
504
|
};
|
|
100
505
|
}
|
|
506
|
+
/**
|
|
507
|
+
* Clears all style caches. Useful for testing or hot reloading scenarios.
|
|
508
|
+
* Note: This only clears the primitive cache. WeakMap entries are
|
|
509
|
+
* automatically garbage collected when their keys are no longer referenced.
|
|
510
|
+
*/
|
|
511
|
+
function clearStyleCache() {
|
|
512
|
+
primitiveCache.clear();
|
|
513
|
+
}
|
|
101
514
|
//# sourceMappingURL=create-nva.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-nva.js","sourceRoot":"","sources":["../../src/lib/create-nva.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"create-nva.js","sourceRoot":"","sources":["../../src/lib/create-nva.ts"],"names":[],"mappings":";;AA2OA,wBA+DC;AAiQD,8BAmOC;AAOD,0CAEC;AArwBD,6DAakC;AAElC;;;GAGG;AACH,MAAM,UAAU,GAAG,IAAI,OAAO,EAAqC,CAAC;AACpE,MAAM,cAAc,GAAG,IAAI,GAAG,EAAwB,CAAC;AAEvD;;;;;;GAMG;AACH,SAAS,cAAc,CAAC,KAA0C;IAChE,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEnC,oCAAoC;IACpC,IAAI,CAAC,IAAI,EAAE,CAAC;IAEZ,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EA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