@mgcrea/react-native-tailwind 0.11.1 → 0.12.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.
- package/dist/babel/index.cjs +189 -20
- package/dist/babel/plugin.test.ts +498 -0
- package/dist/babel/plugin.ts +55 -16
- package/dist/babel/utils/twProcessing.d.ts +8 -1
- package/dist/babel/utils/twProcessing.ts +212 -4
- package/dist/parser/spacing.d.ts +1 -1
- package/dist/parser/spacing.js +1 -1
- package/dist/parser/spacing.test.js +1 -1
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.cjs.map +2 -2
- package/dist/runtime.js +1 -1
- package/dist/runtime.js.map +2 -2
- package/dist/runtime.test.js +1 -1
- package/dist/types/runtime.d.ts +8 -1
- package/package.json +1 -1
- package/src/babel/plugin.test.ts +498 -0
- package/src/babel/plugin.ts +55 -16
- package/src/babel/utils/twProcessing.ts +212 -4
- package/src/parser/spacing.test.ts +62 -0
- package/src/parser/spacing.ts +7 -7
- package/src/runtime.test.ts +4 -1
- package/src/types/runtime.ts +8 -1
|
@@ -14,15 +14,22 @@ export interface TwProcessingState {
|
|
|
14
14
|
customTheme: CustomTheme;
|
|
15
15
|
schemeModifierConfig: SchemeModifierConfig;
|
|
16
16
|
stylesIdentifier: string;
|
|
17
|
+
needsColorSchemeImport: boolean;
|
|
18
|
+
colorSchemeVariableName: string;
|
|
19
|
+
functionComponentsNeedingColorScheme: Set<NodePath<BabelTypes.Function>>;
|
|
20
|
+
colorSchemeLocalIdentifier?: string;
|
|
21
|
+
needsPlatformImport: boolean;
|
|
17
22
|
}
|
|
18
23
|
/**
|
|
19
24
|
* Process tw`...` or twStyle('...') call and replace with TwStyle object
|
|
20
25
|
* Generates: { style: styles._base, activeStyle: styles._active, ... }
|
|
26
|
+
* When color-scheme modifiers are present, generates: { style: [base, _twColorScheme === 'dark' && dark, ...] }
|
|
27
|
+
* When platform modifiers are present, generates: { style: [base, Platform.select({ ios: ..., android: ... })] }
|
|
21
28
|
*/
|
|
22
29
|
export declare function processTwCall(className: string, path: NodePath, state: TwProcessingState, parseClassName: (className: string, customTheme?: CustomTheme) => StyleObject, generateStyleKey: (className: string) => string, splitModifierClasses: (className: string) => {
|
|
23
30
|
baseClasses: string[];
|
|
24
31
|
modifierClasses: ParsedModifier[];
|
|
25
|
-
}, t: typeof BabelTypes): void;
|
|
32
|
+
}, findComponentScope: (path: NodePath, t: typeof BabelTypes) => NodePath<BabelTypes.Function> | null, t: typeof BabelTypes): void;
|
|
26
33
|
/**
|
|
27
34
|
* Remove tw/twStyle imports from @mgcrea/react-native-tailwind
|
|
28
35
|
* This is called after all tw calls have been transformed
|
|
@@ -5,9 +5,16 @@
|
|
|
5
5
|
import type { NodePath } from "@babel/core";
|
|
6
6
|
import type * as BabelTypes from "@babel/types";
|
|
7
7
|
import type { CustomTheme, ModifierType, ParsedModifier } from "../../parser/index.js";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
expandSchemeModifier,
|
|
10
|
+
isColorSchemeModifier,
|
|
11
|
+
isPlatformModifier,
|
|
12
|
+
isSchemeModifier,
|
|
13
|
+
} from "../../parser/index.js";
|
|
9
14
|
import type { SchemeModifierConfig } from "../../types/config.js";
|
|
10
15
|
import type { StyleObject } from "../../types/core.js";
|
|
16
|
+
import { processColorSchemeModifiers } from "./colorSchemeModifierProcessing.js";
|
|
17
|
+
import { processPlatformModifiers } from "./platformModifierProcessing.js";
|
|
11
18
|
|
|
12
19
|
/**
|
|
13
20
|
* Plugin state interface (subset needed for tw processing)
|
|
@@ -18,11 +25,20 @@ export interface TwProcessingState {
|
|
|
18
25
|
customTheme: CustomTheme;
|
|
19
26
|
schemeModifierConfig: SchemeModifierConfig;
|
|
20
27
|
stylesIdentifier: string;
|
|
28
|
+
// Color scheme support (for dark:/light: modifiers)
|
|
29
|
+
needsColorSchemeImport: boolean;
|
|
30
|
+
colorSchemeVariableName: string;
|
|
31
|
+
functionComponentsNeedingColorScheme: Set<NodePath<BabelTypes.Function>>;
|
|
32
|
+
colorSchemeLocalIdentifier?: string;
|
|
33
|
+
// Platform support (for ios:/android:/web: modifiers)
|
|
34
|
+
needsPlatformImport: boolean;
|
|
21
35
|
}
|
|
22
36
|
|
|
23
37
|
/**
|
|
24
38
|
* Process tw`...` or twStyle('...') call and replace with TwStyle object
|
|
25
39
|
* Generates: { style: styles._base, activeStyle: styles._active, ... }
|
|
40
|
+
* When color-scheme modifiers are present, generates: { style: [base, _twColorScheme === 'dark' && dark, ...] }
|
|
41
|
+
* When platform modifiers are present, generates: { style: [base, Platform.select({ ios: ..., android: ... })] }
|
|
26
42
|
*/
|
|
27
43
|
export function processTwCall(
|
|
28
44
|
className: string,
|
|
@@ -31,6 +47,7 @@ export function processTwCall(
|
|
|
31
47
|
parseClassName: (className: string, customTheme?: CustomTheme) => StyleObject,
|
|
32
48
|
generateStyleKey: (className: string) => string,
|
|
33
49
|
splitModifierClasses: (className: string) => { baseClasses: string[]; modifierClasses: ParsedModifier[] },
|
|
50
|
+
findComponentScope: (path: NodePath, t: typeof BabelTypes) => NodePath<BabelTypes.Function> | null,
|
|
34
51
|
t: typeof BabelTypes,
|
|
35
52
|
): void {
|
|
36
53
|
const { baseClasses, modifierClasses: rawModifierClasses } = splitModifierClasses(className);
|
|
@@ -74,9 +91,200 @@ export function processTwCall(
|
|
|
74
91
|
objectProperties.push(t.objectProperty(t.identifier("style"), t.objectExpression([])));
|
|
75
92
|
}
|
|
76
93
|
|
|
77
|
-
//
|
|
94
|
+
// Separate color-scheme and platform modifiers from other modifiers
|
|
95
|
+
const colorSchemeModifiers = modifierClasses.filter((m) => isColorSchemeModifier(m.modifier));
|
|
96
|
+
const platformModifiers = modifierClasses.filter((m) => isPlatformModifier(m.modifier));
|
|
97
|
+
const otherModifiers = modifierClasses.filter(
|
|
98
|
+
(m) => !isColorSchemeModifier(m.modifier) && !isPlatformModifier(m.modifier),
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
// Check if we need color scheme support
|
|
102
|
+
const hasColorSchemeModifiers = colorSchemeModifiers.length > 0;
|
|
103
|
+
let componentScope: NodePath<BabelTypes.Function> | null = null;
|
|
104
|
+
|
|
105
|
+
if (hasColorSchemeModifiers) {
|
|
106
|
+
// Find component scope for hook injection
|
|
107
|
+
componentScope = findComponentScope(path, t);
|
|
108
|
+
|
|
109
|
+
if (!componentScope) {
|
|
110
|
+
// Warning: color scheme modifiers used outside component scope
|
|
111
|
+
if (process.env.NODE_ENV !== "production") {
|
|
112
|
+
console.warn(
|
|
113
|
+
`[react-native-tailwind] Color scheme modifiers (dark:, light:) in tw/twStyle calls ` +
|
|
114
|
+
`must be used inside a React component. Modifiers will be ignored.`,
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
} else {
|
|
118
|
+
// Track this component as needing the color scheme hook
|
|
119
|
+
state.functionComponentsNeedingColorScheme.add(componentScope);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Process color scheme modifiers if we have a valid component scope
|
|
124
|
+
if (hasColorSchemeModifiers && componentScope) {
|
|
125
|
+
// Generate conditional expressions for color scheme
|
|
126
|
+
const colorSchemeConditionals = processColorSchemeModifiers(
|
|
127
|
+
colorSchemeModifiers,
|
|
128
|
+
state,
|
|
129
|
+
parseClassName,
|
|
130
|
+
generateStyleKey,
|
|
131
|
+
t,
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
// Build style array: [baseStyle, _twColorScheme === 'dark' && darkStyle, ...]
|
|
135
|
+
const styleArrayElements: BabelTypes.Expression[] = [];
|
|
136
|
+
|
|
137
|
+
// Add base style if present
|
|
138
|
+
if (baseClasses.length > 0) {
|
|
139
|
+
const baseClassName = baseClasses.join(" ");
|
|
140
|
+
const baseStyleObject = parseClassName(baseClassName, state.customTheme);
|
|
141
|
+
const baseStyleKey = generateStyleKey(baseClassName);
|
|
142
|
+
state.styleRegistry.set(baseStyleKey, baseStyleObject);
|
|
143
|
+
styleArrayElements.push(
|
|
144
|
+
t.memberExpression(t.identifier(state.stylesIdentifier), t.identifier(baseStyleKey)),
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Add color scheme conditionals
|
|
149
|
+
styleArrayElements.push(...colorSchemeConditionals);
|
|
150
|
+
|
|
151
|
+
// Replace style property with array
|
|
152
|
+
objectProperties[0] = t.objectProperty(t.identifier("style"), t.arrayExpression(styleArrayElements));
|
|
153
|
+
|
|
154
|
+
// Also add darkStyle/lightStyle properties for manual processing
|
|
155
|
+
// (e.g., extracting raw hex values for Reanimated animations)
|
|
156
|
+
const darkModifiers = colorSchemeModifiers.filter((m) => m.modifier === "dark");
|
|
157
|
+
const lightModifiers = colorSchemeModifiers.filter((m) => m.modifier === "light");
|
|
158
|
+
|
|
159
|
+
if (darkModifiers.length > 0) {
|
|
160
|
+
const darkClassNames = darkModifiers.map((m) => m.baseClass).join(" ");
|
|
161
|
+
const darkStyleObject = parseClassName(darkClassNames, state.customTheme);
|
|
162
|
+
const darkStyleKey = generateStyleKey(`dark_${darkClassNames}`);
|
|
163
|
+
state.styleRegistry.set(darkStyleKey, darkStyleObject);
|
|
164
|
+
|
|
165
|
+
objectProperties.push(
|
|
166
|
+
t.objectProperty(
|
|
167
|
+
t.identifier("darkStyle"),
|
|
168
|
+
t.memberExpression(t.identifier(state.stylesIdentifier), t.identifier(darkStyleKey)),
|
|
169
|
+
),
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (lightModifiers.length > 0) {
|
|
174
|
+
const lightClassNames = lightModifiers.map((m) => m.baseClass).join(" ");
|
|
175
|
+
const lightStyleObject = parseClassName(lightClassNames, state.customTheme);
|
|
176
|
+
const lightStyleKey = generateStyleKey(`light_${lightClassNames}`);
|
|
177
|
+
state.styleRegistry.set(lightStyleKey, lightStyleObject);
|
|
178
|
+
|
|
179
|
+
objectProperties.push(
|
|
180
|
+
t.objectProperty(
|
|
181
|
+
t.identifier("lightStyle"),
|
|
182
|
+
t.memberExpression(t.identifier(state.stylesIdentifier), t.identifier(lightStyleKey)),
|
|
183
|
+
),
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Process platform modifiers if present
|
|
189
|
+
const hasPlatformModifiers = platformModifiers.length > 0;
|
|
190
|
+
|
|
191
|
+
if (hasPlatformModifiers) {
|
|
192
|
+
// Mark that we need Platform import
|
|
193
|
+
state.needsPlatformImport = true;
|
|
194
|
+
|
|
195
|
+
// Generate Platform.select() expression
|
|
196
|
+
const platformSelectExpression = processPlatformModifiers(
|
|
197
|
+
platformModifiers,
|
|
198
|
+
state,
|
|
199
|
+
parseClassName,
|
|
200
|
+
generateStyleKey,
|
|
201
|
+
t,
|
|
202
|
+
);
|
|
203
|
+
|
|
204
|
+
// If we already have a style array (from color scheme modifiers), add to it
|
|
205
|
+
// Otherwise, convert style property to an array
|
|
206
|
+
if (hasColorSchemeModifiers && componentScope) {
|
|
207
|
+
// Already have style array from color scheme processing
|
|
208
|
+
// Get the current array expression and add Platform.select to it
|
|
209
|
+
const styleProperty = objectProperties.find(
|
|
210
|
+
(prop) => t.isIdentifier(prop.key) && prop.key.name === "style",
|
|
211
|
+
);
|
|
212
|
+
if (styleProperty && t.isArrayExpression(styleProperty.value)) {
|
|
213
|
+
styleProperty.value.elements.push(platformSelectExpression);
|
|
214
|
+
}
|
|
215
|
+
} else {
|
|
216
|
+
// No color scheme modifiers, create style array with base + Platform.select
|
|
217
|
+
const styleArrayElements: BabelTypes.Expression[] = [];
|
|
218
|
+
|
|
219
|
+
// Add base style if present
|
|
220
|
+
if (baseClasses.length > 0) {
|
|
221
|
+
const baseClassName = baseClasses.join(" ");
|
|
222
|
+
const baseStyleObject = parseClassName(baseClassName, state.customTheme);
|
|
223
|
+
const baseStyleKey = generateStyleKey(baseClassName);
|
|
224
|
+
state.styleRegistry.set(baseStyleKey, baseStyleObject);
|
|
225
|
+
styleArrayElements.push(
|
|
226
|
+
t.memberExpression(t.identifier(state.stylesIdentifier), t.identifier(baseStyleKey)),
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Add Platform.select() expression
|
|
231
|
+
styleArrayElements.push(platformSelectExpression);
|
|
232
|
+
|
|
233
|
+
// Replace style property with array
|
|
234
|
+
objectProperties[0] = t.objectProperty(t.identifier("style"), t.arrayExpression(styleArrayElements));
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Also add iosStyle/androidStyle/webStyle properties for manual processing
|
|
238
|
+
const iosModifiers = platformModifiers.filter((m) => m.modifier === "ios");
|
|
239
|
+
const androidModifiers = platformModifiers.filter((m) => m.modifier === "android");
|
|
240
|
+
const webModifiers = platformModifiers.filter((m) => m.modifier === "web");
|
|
241
|
+
|
|
242
|
+
if (iosModifiers.length > 0) {
|
|
243
|
+
const iosClassNames = iosModifiers.map((m) => m.baseClass).join(" ");
|
|
244
|
+
const iosStyleObject = parseClassName(iosClassNames, state.customTheme);
|
|
245
|
+
const iosStyleKey = generateStyleKey(`ios_${iosClassNames}`);
|
|
246
|
+
state.styleRegistry.set(iosStyleKey, iosStyleObject);
|
|
247
|
+
|
|
248
|
+
objectProperties.push(
|
|
249
|
+
t.objectProperty(
|
|
250
|
+
t.identifier("iosStyle"),
|
|
251
|
+
t.memberExpression(t.identifier(state.stylesIdentifier), t.identifier(iosStyleKey)),
|
|
252
|
+
),
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if (androidModifiers.length > 0) {
|
|
257
|
+
const androidClassNames = androidModifiers.map((m) => m.baseClass).join(" ");
|
|
258
|
+
const androidStyleObject = parseClassName(androidClassNames, state.customTheme);
|
|
259
|
+
const androidStyleKey = generateStyleKey(`android_${androidClassNames}`);
|
|
260
|
+
state.styleRegistry.set(androidStyleKey, androidStyleObject);
|
|
261
|
+
|
|
262
|
+
objectProperties.push(
|
|
263
|
+
t.objectProperty(
|
|
264
|
+
t.identifier("androidStyle"),
|
|
265
|
+
t.memberExpression(t.identifier(state.stylesIdentifier), t.identifier(androidStyleKey)),
|
|
266
|
+
),
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (webModifiers.length > 0) {
|
|
271
|
+
const webClassNames = webModifiers.map((m) => m.baseClass).join(" ");
|
|
272
|
+
const webStyleObject = parseClassName(webClassNames, state.customTheme);
|
|
273
|
+
const webStyleKey = generateStyleKey(`web_${webClassNames}`);
|
|
274
|
+
state.styleRegistry.set(webStyleKey, webStyleObject);
|
|
275
|
+
|
|
276
|
+
objectProperties.push(
|
|
277
|
+
t.objectProperty(
|
|
278
|
+
t.identifier("webStyle"),
|
|
279
|
+
t.memberExpression(t.identifier(state.stylesIdentifier), t.identifier(webStyleKey)),
|
|
280
|
+
),
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// Group other modifiers by type (non-color-scheme and non-platform modifiers)
|
|
78
286
|
const modifiersByType = new Map<ModifierType, ParsedModifier[]>();
|
|
79
|
-
for (const mod of
|
|
287
|
+
for (const mod of otherModifiers) {
|
|
80
288
|
if (!modifiersByType.has(mod.modifier)) {
|
|
81
289
|
modifiersByType.set(mod.modifier, []);
|
|
82
290
|
}
|
|
@@ -86,7 +294,7 @@ export function processTwCall(
|
|
|
86
294
|
}
|
|
87
295
|
}
|
|
88
296
|
|
|
89
|
-
// Add modifier styles
|
|
297
|
+
// Add modifier styles (activeStyle, focusStyle, etc.) for non-color-scheme modifiers
|
|
90
298
|
for (const [modifierType, modifiers] of modifiersByType) {
|
|
91
299
|
const modifierClassNames = modifiers.map((m) => m.baseClass).join(" ");
|
|
92
300
|
const modifierStyleObject = parseClassName(modifierClassNames, state.customTheme);
|
package/dist/parser/spacing.d.ts
CHANGED
|
@@ -5,6 +5,6 @@ import type { StyleObject } from "../types";
|
|
|
5
5
|
export declare const SPACING_SCALE: Record<string, number>;
|
|
6
6
|
/**
|
|
7
7
|
* Parse spacing classes (margin, padding, gap)
|
|
8
|
-
* Examples: m-4, mx-2, mt-8, p-4, px-2, pt-8, gap-4, m-[16px], -m-4, -mt-[10px]
|
|
8
|
+
* Examples: m-4, mx-2, mt-8, p-4, px-2, pt-8, gap-4, m-[16px], pl-[4.5px], -m-4, -mt-[10px]
|
|
9
9
|
*/
|
|
10
10
|
export declare function parseSpacing(cls: string): StyleObject | null;
|
package/dist/parser/spacing.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.SPACING_SCALE=void 0;exports.parseSpacing=parseSpacing;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var SPACING_SCALE=exports.SPACING_SCALE={0:0,0.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384};function parseArbitrarySpacing(value){var pxMatch=value.match(/^\[(
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.SPACING_SCALE=void 0;exports.parseSpacing=parseSpacing;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var SPACING_SCALE=exports.SPACING_SCALE={0:0,0.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384};function parseArbitrarySpacing(value){var pxMatch=value.match(/^\[(-?\d+(?:\.\d+)?)(?:px)?\]$/);if(pxMatch){return parseFloat(pxMatch[1]);}if(value.startsWith("[")&&value.endsWith("]")){if(process.env.NODE_ENV!=="production"){console.warn(`[react-native-tailwind] Unsupported arbitrary spacing value: ${value}. Only px values are supported (e.g., [16px], [16], [4.5px], [4.5]).`);}return null;}return null;}function parseSpacing(cls){var marginMatch=cls.match(/^(-?)m([xytrbls]?)-(.+)$/);if(marginMatch){var _marginMatch=(0,_slicedToArray2.default)(marginMatch,4),negativePrefix=_marginMatch[1],dir=_marginMatch[2],valueStr=_marginMatch[3];var isNegative=negativePrefix==="-";var arbitraryValue=parseArbitrarySpacing(valueStr);if(arbitraryValue!==null){var finalValue=isNegative?-arbitraryValue:arbitraryValue;return getMarginStyle(dir,finalValue);}var scaleValue=SPACING_SCALE[valueStr];if(scaleValue!==undefined){var _finalValue=isNegative?-scaleValue:scaleValue;return getMarginStyle(dir,_finalValue);}}var paddingMatch=cls.match(/^p([xytrbls]?)-(.+)$/);if(paddingMatch){var _paddingMatch=(0,_slicedToArray2.default)(paddingMatch,3),_dir=_paddingMatch[1],_valueStr=_paddingMatch[2];var _arbitraryValue=parseArbitrarySpacing(_valueStr);if(_arbitraryValue!==null){return getPaddingStyle(_dir,_arbitraryValue);}var _scaleValue=SPACING_SCALE[_valueStr];if(_scaleValue!==undefined){return getPaddingStyle(_dir,_scaleValue);}}var gapMatch=cls.match(/^gap-(.+)$/);if(gapMatch){var _valueStr2=gapMatch[1];var _arbitraryValue2=parseArbitrarySpacing(_valueStr2);if(_arbitraryValue2!==null){return{gap:_arbitraryValue2};}var _scaleValue2=SPACING_SCALE[_valueStr2];if(_scaleValue2!==undefined){return{gap:_scaleValue2};}}return null;}function getMarginStyle(dir,value){switch(dir){case"":return{margin:value};case"x":return{marginHorizontal:value};case"y":return{marginVertical:value};case"t":return{marginTop:value};case"r":return{marginRight:value};case"b":return{marginBottom:value};case"l":return{marginLeft:value};default:return{};}}function getPaddingStyle(dir,value){switch(dir){case"":return{padding:value};case"x":return{paddingHorizontal:value};case"y":return{paddingVertical:value};case"t":return{paddingTop:value};case"r":return{paddingRight:value};case"b":return{paddingBottom:value};case"l":return{paddingLeft:value};default:return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _vitest=require("vitest");var _spacing=require("./spacing");(0,_vitest.describe)("SPACING_SCALE",function(){(0,_vitest.it)("should export complete spacing scale",function(){(0,_vitest.expect)(_spacing.SPACING_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("parseSpacing - margin",function(){(0,_vitest.it)("should parse margin all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0")).toEqual({margin:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-8")).toEqual({margin:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-96")).toEqual({margin:384});});(0,_vitest.it)("should parse margin with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0.5")).toEqual({margin:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-1.5")).toEqual({margin:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-2.5")).toEqual({margin:10});});(0,_vitest.it)("should parse margin horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-0")).toEqual({marginHorizontal:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-4")).toEqual({marginHorizontal:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-8")).toEqual({marginHorizontal:32});});(0,_vitest.it)("should parse margin vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("my-0")).toEqual({marginVertical:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-4")).toEqual({marginVertical:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-8")).toEqual({marginVertical:32});});(0,_vitest.it)("should parse margin directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-4")).toEqual({marginTop:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-4")).toEqual({marginRight:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-4")).toEqual({marginBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-4")).toEqual({marginLeft:16});});(0,_vitest.it)("should parse margin with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16px]")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16]")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[100px]")).toEqual({margin:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[100]")).toEqual({margin:100});});(0,_vitest.it)("should parse margin directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-[24px]")).toEqual({marginTop:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-[32]")).toEqual({marginRight:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-[16px]")).toEqual({marginBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-[48]")).toEqual({marginLeft:48});});(0,_vitest.it)("should parse margin horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-[20px]")).toEqual({marginHorizontal:20});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-[30]")).toEqual({marginVertical:30});});});(0,_vitest.describe)("parseSpacing - negative margin",function(){(0,_vitest.it)("should parse negative margin all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-0")).toEqual({margin:-0});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-4")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-8")).toEqual({margin:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-96")).toEqual({margin:-384});});(0,_vitest.it)("should parse negative margin with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-0.5")).toEqual({margin:-2});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-1.5")).toEqual({margin:-6});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-2.5")).toEqual({margin:-10});});(0,_vitest.it)("should parse negative margin horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-4")).toEqual({marginHorizontal:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-8")).toEqual({marginHorizontal:-32});});(0,_vitest.it)("should parse negative margin vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-4")).toEqual({marginVertical:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-8")).toEqual({marginVertical:-32});});(0,_vitest.it)("should parse negative margin directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-4")).toEqual({marginTop:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mr-4")).toEqual({marginRight:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mb-4")).toEqual({marginBottom:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ml-4")).toEqual({marginLeft:-16});});(0,_vitest.it)("should parse negative margin with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[16px]")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[16]")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[100px]")).toEqual({margin:-100});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[100]")).toEqual({margin:-100});});(0,_vitest.it)("should parse negative margin directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-[24px]")).toEqual({marginTop:-24});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mr-[32]")).toEqual({marginRight:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mb-[16px]")).toEqual({marginBottom:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ml-[48]")).toEqual({marginLeft:-48});});(0,_vitest.it)("should parse negative margin horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-[20px]")).toEqual({marginHorizontal:-20});(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-[30]")).toEqual({marginVertical:-30});});(0,_vitest.it)("should not parse negative padding (invalid)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-p-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-px-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-pt-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-p-[16px]")).toBeNull();});(0,_vitest.it)("should not parse negative gap (invalid)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-gap-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-gap-[16px]")).toBeNull();});});(0,_vitest.describe)("parseSpacing - padding",function(){(0,_vitest.it)("should parse padding all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0")).toEqual({padding:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-4")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-8")).toEqual({padding:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-96")).toEqual({padding:384});});(0,_vitest.it)("should parse padding with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0.5")).toEqual({padding:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-1.5")).toEqual({padding:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-2.5")).toEqual({padding:10});});(0,_vitest.it)("should parse padding horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("px-0")).toEqual({paddingHorizontal:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-4")).toEqual({paddingHorizontal:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-8")).toEqual({paddingHorizontal:32});});(0,_vitest.it)("should parse padding vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("py-0")).toEqual({paddingVertical:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-4")).toEqual({paddingVertical:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-8")).toEqual({paddingVertical:32});});(0,_vitest.it)("should parse padding directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-4")).toEqual({paddingTop:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-4")).toEqual({paddingRight:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-4")).toEqual({paddingBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-4")).toEqual({paddingLeft:16});});(0,_vitest.it)("should parse padding with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[16px]")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[16]")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[100px]")).toEqual({padding:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[100]")).toEqual({padding:100});});(0,_vitest.it)("should parse padding directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-[24px]")).toEqual({paddingTop:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-[32]")).toEqual({paddingRight:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-[16px]")).toEqual({paddingBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[48]")).toEqual({paddingLeft:48});});(0,_vitest.it)("should parse padding horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("px-[20px]")).toEqual({paddingHorizontal:20});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-[30]")).toEqual({paddingVertical:30});});});(0,_vitest.describe)("parseSpacing - gap",function(){(0,_vitest.it)("should parse gap",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0")).toEqual({gap:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-4")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-8")).toEqual({gap:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-96")).toEqual({gap:384});});(0,_vitest.it)("should parse gap with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0.5")).toEqual({gap:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-1.5")).toEqual({gap:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-2.5")).toEqual({gap:10});});(0,_vitest.it)("should parse gap with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[16px]")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[16]")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[100px]")).toEqual({gap:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[100]")).toEqual({gap:100});});});(0,_vitest.describe)("parseSpacing - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("invalid")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("m")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("margin-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("padding-4")).toBeNull();});(0,_vitest.it)("should return null for invalid spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-invalid")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-999")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-abc")).toBeNull();});(0,_vitest.it)("should return null for arbitrary values with unsupported units",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16rem]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[2em]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[50%]")).toBeNull();});(0,_vitest.it)("should return null for malformed arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-16]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[]")).toBeNull();});(0,_vitest.it)("should handle edge case spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0")).toEqual({margin:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0")).toEqual({padding:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0")).toEqual({gap:0});});(0,_vitest.it)("should not match partial class names",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("sm-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("margin-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("padding-4")).toBeNull();});});(0,_vitest.describe)("parseSpacing - comprehensive coverage",function(){(0,_vitest.it)("should parse all margin directions with same value",function(){var value=16;(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4")).toEqual({margin:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-4")).toEqual({marginHorizontal:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-4")).toEqual({marginVertical:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-4")).toEqual({marginTop:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-4")).toEqual({marginRight:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-4")).toEqual({marginBottom:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-4")).toEqual({marginLeft:value});});(0,_vitest.it)("should parse all padding directions with same value",function(){var value=16;(0,_vitest.expect)((0,_spacing.parseSpacing)("p-4")).toEqual({padding:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-4")).toEqual({paddingHorizontal:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-4")).toEqual({paddingVertical:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-4")).toEqual({paddingTop:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-4")).toEqual({paddingRight:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-4")).toEqual({paddingBottom:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-4")).toEqual({paddingLeft:value});});(0,_vitest.it)("should handle large spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-96")).toEqual({margin:384});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-96")).toEqual({padding:384});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-96")).toEqual({gap:384});});(0,_vitest.it)("should handle arbitrary values across all margin directions",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[50px]")).toEqual({margin:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-[50px]")).toEqual({marginHorizontal:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-[50px]")).toEqual({marginVertical:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-[50px]")).toEqual({marginTop:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-[50px]")).toEqual({marginRight:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-[50px]")).toEqual({marginBottom:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-[50px]")).toEqual({marginLeft:50});});(0,_vitest.it)("should handle arbitrary values across all padding directions",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[50px]")).toEqual({padding:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-[50px]")).toEqual({paddingHorizontal:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-[50px]")).toEqual({paddingVertical:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-[50px]")).toEqual({paddingTop:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-[50px]")).toEqual({paddingRight:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-[50px]")).toEqual({paddingBottom:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[50px]")).toEqual({paddingLeft:50});});});
|
|
1
|
+
var _vitest=require("vitest");var _spacing=require("./spacing");(0,_vitest.describe)("SPACING_SCALE",function(){(0,_vitest.it)("should export complete spacing scale",function(){(0,_vitest.expect)(_spacing.SPACING_SCALE).toMatchSnapshot();});});(0,_vitest.describe)("parseSpacing - margin",function(){(0,_vitest.it)("should parse margin all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0")).toEqual({margin:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-8")).toEqual({margin:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-96")).toEqual({margin:384});});(0,_vitest.it)("should parse margin with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0.5")).toEqual({margin:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-1.5")).toEqual({margin:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-2.5")).toEqual({margin:10});});(0,_vitest.it)("should parse margin horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-0")).toEqual({marginHorizontal:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-4")).toEqual({marginHorizontal:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-8")).toEqual({marginHorizontal:32});});(0,_vitest.it)("should parse margin vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("my-0")).toEqual({marginVertical:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-4")).toEqual({marginVertical:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-8")).toEqual({marginVertical:32});});(0,_vitest.it)("should parse margin directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-4")).toEqual({marginTop:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-4")).toEqual({marginRight:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-4")).toEqual({marginBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-4")).toEqual({marginLeft:16});});(0,_vitest.it)("should parse margin with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16px]")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16]")).toEqual({margin:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[100px]")).toEqual({margin:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[100]")).toEqual({margin:100});});(0,_vitest.it)("should parse margin directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-[24px]")).toEqual({marginTop:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-[32]")).toEqual({marginRight:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-[16px]")).toEqual({marginBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-[48]")).toEqual({marginLeft:48});});(0,_vitest.it)("should parse margin horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-[20px]")).toEqual({marginHorizontal:20});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-[30]")).toEqual({marginVertical:30});});});(0,_vitest.describe)("parseSpacing - negative margin",function(){(0,_vitest.it)("should parse negative margin all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-0")).toEqual({margin:-0});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-4")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-8")).toEqual({margin:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-96")).toEqual({margin:-384});});(0,_vitest.it)("should parse negative margin with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-0.5")).toEqual({margin:-2});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-1.5")).toEqual({margin:-6});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-2.5")).toEqual({margin:-10});});(0,_vitest.it)("should parse negative margin horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-4")).toEqual({marginHorizontal:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-8")).toEqual({marginHorizontal:-32});});(0,_vitest.it)("should parse negative margin vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-4")).toEqual({marginVertical:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-8")).toEqual({marginVertical:-32});});(0,_vitest.it)("should parse negative margin directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-4")).toEqual({marginTop:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mr-4")).toEqual({marginRight:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mb-4")).toEqual({marginBottom:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ml-4")).toEqual({marginLeft:-16});});(0,_vitest.it)("should parse negative margin with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[16px]")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[16]")).toEqual({margin:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[100px]")).toEqual({margin:-100});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[100]")).toEqual({margin:-100});});(0,_vitest.it)("should parse negative margin directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-[24px]")).toEqual({marginTop:-24});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mr-[32]")).toEqual({marginRight:-32});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mb-[16px]")).toEqual({marginBottom:-16});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ml-[48]")).toEqual({marginLeft:-48});});(0,_vitest.it)("should parse negative margin horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-[20px]")).toEqual({marginHorizontal:-20});(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-[30]")).toEqual({marginVertical:-30});});(0,_vitest.it)("should not parse negative padding (invalid)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-p-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-px-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-pt-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-p-[16px]")).toBeNull();});(0,_vitest.it)("should not parse negative gap (invalid)",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-gap-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("-gap-[16px]")).toBeNull();});});(0,_vitest.describe)("parseSpacing - padding",function(){(0,_vitest.it)("should parse padding all sides",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0")).toEqual({padding:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-4")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-8")).toEqual({padding:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-96")).toEqual({padding:384});});(0,_vitest.it)("should parse padding with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0.5")).toEqual({padding:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-1.5")).toEqual({padding:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-2.5")).toEqual({padding:10});});(0,_vitest.it)("should parse padding horizontal",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("px-0")).toEqual({paddingHorizontal:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-4")).toEqual({paddingHorizontal:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-8")).toEqual({paddingHorizontal:32});});(0,_vitest.it)("should parse padding vertical",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("py-0")).toEqual({paddingVertical:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-4")).toEqual({paddingVertical:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-8")).toEqual({paddingVertical:32});});(0,_vitest.it)("should parse padding directional",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-4")).toEqual({paddingTop:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-4")).toEqual({paddingRight:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-4")).toEqual({paddingBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-4")).toEqual({paddingLeft:16});});(0,_vitest.it)("should parse padding with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[16px]")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[16]")).toEqual({padding:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[100px]")).toEqual({padding:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[100]")).toEqual({padding:100});});(0,_vitest.it)("should parse padding directional with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-[24px]")).toEqual({paddingTop:24});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-[32]")).toEqual({paddingRight:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-[16px]")).toEqual({paddingBottom:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[48]")).toEqual({paddingLeft:48});});(0,_vitest.it)("should parse padding horizontal/vertical with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("px-[20px]")).toEqual({paddingHorizontal:20});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-[30]")).toEqual({paddingVertical:30});});});(0,_vitest.describe)("parseSpacing - gap",function(){(0,_vitest.it)("should parse gap",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0")).toEqual({gap:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-4")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-8")).toEqual({gap:32});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-96")).toEqual({gap:384});});(0,_vitest.it)("should parse gap with fractional values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0.5")).toEqual({gap:2});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-1.5")).toEqual({gap:6});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-2.5")).toEqual({gap:10});});(0,_vitest.it)("should parse gap with arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[16px]")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[16]")).toEqual({gap:16});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[100px]")).toEqual({gap:100});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[100]")).toEqual({gap:100});});});(0,_vitest.describe)("parseSpacing - edge cases",function(){(0,_vitest.it)("should return null for invalid classes",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("invalid")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("m")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("margin-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("padding-4")).toBeNull();});(0,_vitest.it)("should return null for invalid spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-invalid")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-999")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-abc")).toBeNull();});(0,_vitest.it)("should return null for arbitrary values with unsupported units",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16rem]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[2em]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[50%]")).toBeNull();});(0,_vitest.it)("should return null for malformed arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("p-16]")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[]")).toBeNull();});(0,_vitest.it)("should handle edge case spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-0")).toEqual({margin:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-0")).toEqual({padding:0});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-0")).toEqual({gap:0});});(0,_vitest.it)("should not match partial class names",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("sm-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("margin-4")).toBeNull();(0,_vitest.expect)((0,_spacing.parseSpacing)("padding-4")).toBeNull();});});(0,_vitest.describe)("parseSpacing - decimal arbitrary values",function(){(0,_vitest.it)("should parse margin with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[4.5px]")).toEqual({margin:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[4.5]")).toEqual({margin:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16.75px]")).toEqual({margin:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[16.75]")).toEqual({margin:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[100.25px]")).toEqual({margin:100.25});(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[0.5]")).toEqual({margin:0.5});});(0,_vitest.it)("should parse padding with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[4.5px]")).toEqual({padding:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[4.5]")).toEqual({padding:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[4.5px]")).toEqual({paddingLeft:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[4.5]")).toEqual({paddingLeft:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-[16.75px]")).toEqual({paddingRight:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-[10.5]")).toEqual({paddingTop:10.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-[20.25px]")).toEqual({paddingBottom:20.25});});(0,_vitest.it)("should parse padding horizontal/vertical with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("px-[4.5px]")).toEqual({paddingHorizontal:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-[10.75]")).toEqual({paddingVertical:10.75});});(0,_vitest.it)("should parse gap with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[4.5px]")).toEqual({gap:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[4.5]")).toEqual({gap:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[16.75px]")).toEqual({gap:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[0.5]")).toEqual({gap:0.5});});(0,_vitest.it)("should parse negative margin with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[4.5px]")).toEqual({margin:-4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[4.5]")).toEqual({margin:-4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[10.5px]")).toEqual({margin:-10.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mt-[16.75px]")).toEqual({marginTop:-16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("-ml-[8.25]")).toEqual({marginLeft:-8.25});(0,_vitest.expect)((0,_spacing.parseSpacing)("-mx-[12.5px]")).toEqual({marginHorizontal:-12.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("-my-[20.75]")).toEqual({marginVertical:-20.75});});(0,_vitest.it)("should parse margin directional with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-[4.5px]")).toEqual({marginTop:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-[8.25]")).toEqual({marginRight:8.25});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-[16.75px]")).toEqual({marginBottom:16.75});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-[12.5]")).toEqual({marginLeft:12.5});});(0,_vitest.it)("should parse margin horizontal/vertical with decimal arbitrary values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-[4.5px]")).toEqual({marginHorizontal:4.5});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-[10.75]")).toEqual({marginVertical:10.75});});(0,_vitest.it)("should handle edge case decimal values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[0.1px]")).toEqual({margin:0.1});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[0.001]")).toEqual({padding:0.001});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-[999.999px]")).toEqual({gap:999.999});(0,_vitest.expect)((0,_spacing.parseSpacing)("-m-[0.5]")).toEqual({margin:-0.5});});});(0,_vitest.describe)("parseSpacing - comprehensive coverage",function(){(0,_vitest.it)("should parse all margin directions with same value",function(){var value=16;(0,_vitest.expect)((0,_spacing.parseSpacing)("m-4")).toEqual({margin:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-4")).toEqual({marginHorizontal:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-4")).toEqual({marginVertical:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-4")).toEqual({marginTop:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-4")).toEqual({marginRight:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-4")).toEqual({marginBottom:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-4")).toEqual({marginLeft:value});});(0,_vitest.it)("should parse all padding directions with same value",function(){var value=16;(0,_vitest.expect)((0,_spacing.parseSpacing)("p-4")).toEqual({padding:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-4")).toEqual({paddingHorizontal:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-4")).toEqual({paddingVertical:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-4")).toEqual({paddingTop:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-4")).toEqual({paddingRight:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-4")).toEqual({paddingBottom:value});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-4")).toEqual({paddingLeft:value});});(0,_vitest.it)("should handle large spacing values",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-96")).toEqual({margin:384});(0,_vitest.expect)((0,_spacing.parseSpacing)("p-96")).toEqual({padding:384});(0,_vitest.expect)((0,_spacing.parseSpacing)("gap-96")).toEqual({gap:384});});(0,_vitest.it)("should handle arbitrary values across all margin directions",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("m-[50px]")).toEqual({margin:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mx-[50px]")).toEqual({marginHorizontal:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("my-[50px]")).toEqual({marginVertical:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mt-[50px]")).toEqual({marginTop:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mr-[50px]")).toEqual({marginRight:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("mb-[50px]")).toEqual({marginBottom:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("ml-[50px]")).toEqual({marginLeft:50});});(0,_vitest.it)("should handle arbitrary values across all padding directions",function(){(0,_vitest.expect)((0,_spacing.parseSpacing)("p-[50px]")).toEqual({padding:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("px-[50px]")).toEqual({paddingHorizontal:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("py-[50px]")).toEqual({paddingVertical:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pt-[50px]")).toEqual({paddingTop:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pr-[50px]")).toEqual({paddingRight:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pb-[50px]")).toEqual({paddingBottom:50});(0,_vitest.expect)((0,_spacing.parseSpacing)("pl-[50px]")).toEqual({paddingLeft:50});});});
|
package/dist/runtime.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var E=Object.defineProperty,ut=Object.defineProperties,pt=Object.getOwnPropertyDescriptor,gt=Object.getOwnPropertyDescriptors,yt=Object.getOwnPropertyNames,H=Object.getOwnPropertySymbols;var U=Object.prototype.hasOwnProperty,ht=Object.prototype.propertyIsEnumerable;var B=(t,e,n)=>e in t?E(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,W=(t,e)=>{for(var n in e||(e={}))U.call(e,n)&&B(t,n,e[n]);if(H)for(var n of H(e))ht.call(e,n)&&B(t,n,e[n]);return t},G=(t,e)=>ut(t,gt(e));var bt=(t,e)=>{for(var n in e)E(t,n,{get:e[n],enumerable:!0})},mt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of yt(e))!U.call(t,i)&&i!==n&&E(t,i,{get:()=>e[i],enumerable:!(r=pt(e,i))||r.enumerable});return t};var xt=t=>mt(E({},"__esModule",{value:!0}),t);var le={};bt(le,{clearCache:()=>se,getCacheStats:()=>ae,getCustomColors:()=>oe,getCustomTheme:()=>ie,setConfig:()=>ne,tw:()=>fe,twStyle:()=>ce});module.exports=xt(le);var X={"aspect-auto":void 0,"aspect-square":1,"aspect-video":1.7777777777777777};function St(t){let e=t.match(/^\[(\d+)\/(\d+)\]$/);if(e){let n=Number.parseInt(e[1],10),r=Number.parseInt(e[2],10);return r===0?(process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid aspect ratio: ${t}. Denominator cannot be zero.`),null):n/r}return null}function v(t){if(!t.startsWith("aspect-"))return null;if(t in X){let r=X[t];return r===void 0?{aspectRatio:void 0}:{aspectRatio:r}}let e=t.substring(7),n=St(e);return n!==null?{aspectRatio:n}:null}var Y={"":1,0:0,2:2,4:4,8:8},N={none:0,sm:2,"":4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999},Z={t:"borderTopWidth",r:"borderRightWidth",b:"borderBottomWidth",l:"borderLeftWidth"},q={tl:"borderTopLeftRadius",tr:"borderTopRightRadius",bl:"borderBottomLeftRadius",br:"borderBottomRightRadius"},wt={t:["borderTopLeftRadius","borderTopRightRadius"],r:["borderTopRightRadius","borderBottomRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"]};function J(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary border width value: ${t}. Only px values are supported (e.g., [8px] or [8]).`),null)}function I(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary border radius value: ${t}. Only px values are supported (e.g., [12px] or [12]).`),null)}function $(t){return t==="border-solid"?{borderStyle:"solid"}:t==="border-dotted"?{borderStyle:"dotted"}:t==="border-dashed"?{borderStyle:"dashed"}:t.startsWith("border-")?Ot(t):t==="border"?{borderWidth:1}:t.startsWith("rounded")?Rt(t):null}function Ot(t){let e=t.match(/^border-([trbl])(?:-(.+))?$/);if(e){let i=e[1],o=e[2]||"";if(o.startsWith("[")){let a=J(o);return a!==null?{[Z[i]]:a}:null}let s=Y[o];return s!==void 0?{[Z[i]]:s}:null}let n=t.match(/^border-(\d+)$/);if(n){let i=Y[n[1]];if(i!==void 0)return{borderWidth:i}}let r=t.match(/^border-(\[.+\])$/);if(r){let i=J(r[1]);if(i!==null)return{borderWidth:i}}return null}function Rt(t){let e=t.substring(7);if(e==="")return{borderRadius:N[""]};if(!e.startsWith("-"))return null;let n=e.substring(1);if(n==="")return null;let r=n.match(/^(tl|tr|bl|br)(?:-(.+))?$/);if(r){let s=r[1],a=r[2]||"";if(a.startsWith("[")){let u=I(a);return u!==null?{[q[s]]:u}:null}let f=N[a];return f!==void 0?{[q[s]]:f}:null}let i=n.match(/^([trbl])(?:-(.+))?$/);if(i){let s=i[1],a=i[2]||"",f;if(a.startsWith("[")){let u=I(a);if(u!==null)f=u;else return null}else f=N[a];if(f!==void 0){let u={};return wt[s].forEach(p=>u[p]=f),u}return null}if(n.startsWith("[")){let s=I(n);return s!==null?{borderRadius:s}:null}let o=N[n];return o!==void 0?{borderRadius:o}:null}var Q={red:{50:"#fef2f2",100:"#ffe2e2",200:"#ffc9c9",300:"#ffa2a2",400:"#ff6467",500:"#fb2c36",600:"#e7000b",700:"#c10007",800:"#9f0712",900:"#82181a",950:"#460809"},orange:{50:"#fff7ed",100:"#ffedd4",200:"#ffd6a7",300:"#ffb86a",400:"#ff8904",500:"#ff6900",600:"#f54900",700:"#ca3500",800:"#9f2d00",900:"#7e2a0c",950:"#441306"},amber:{50:"#fffbeb",100:"#fef3c6",200:"#fee685",300:"#ffd230",400:"#ffb900",500:"#fe9a00",600:"#e17100",700:"#bb4d00",800:"#973c00",900:"#7b3306",950:"#461901"},yellow:{50:"#fefce8",100:"#fef9c2",200:"#fff085",300:"#ffdf20",400:"#fdc700",500:"#f0b100",600:"#d08700",700:"#a65f00",800:"#894b00",900:"#733e0a",950:"#432004"},lime:{50:"#f7fee7",100:"#ecfcca",200:"#d8f999",300:"#bbf451",400:"#9ae600",500:"#7ccf00",600:"#5ea500",700:"#497d00",800:"#3c6300",900:"#35530e",950:"#192e03"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#b9f8cf",300:"#7bf1a8",400:"#05df72",500:"#00c950",600:"#00a63e",700:"#008236",800:"#016630",900:"#0d542b",950:"#032e15"},emerald:{50:"#ecfdf5",100:"#d0fae5",200:"#a4f4cf",300:"#5ee9b5",400:"#00d492",500:"#00bc7d",600:"#009966",700:"#007a55",800:"#006045",900:"#004f3b",950:"#002c22"},teal:{50:"#f0fdfa",100:"#cbfbf1",200:"#96f7e4",300:"#46ecd5",400:"#00d5be",500:"#00bba7",600:"#009689",700:"#00786f",800:"#005f5a",900:"#0b4f4a",950:"#022f2e"},cyan:{50:"#ecfeff",100:"#cefafe",200:"#a2f4fd",300:"#53eafd",400:"#00d3f2",500:"#00b8db",600:"#0092b8",700:"#007595",800:"#005f78",900:"#104e64",950:"#053345"},sky:{50:"#f0f9ff",100:"#dff2fe",200:"#b8e6fe",300:"#74d4ff",400:"#00bcff",500:"#00a6f4",600:"#0084d1",700:"#0069a8",800:"#00598a",900:"#024a70",950:"#052f4a"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bedbff",300:"#8ec5ff",400:"#51a2ff",500:"#2b7fff",600:"#155dfc",700:"#1447e6",800:"#193cb8",900:"#1c398e",950:"#162456"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c6d2ff",300:"#a3b3ff",400:"#7c86ff",500:"#615fff",600:"#4f39f6",700:"#432dd7",800:"#372aac",900:"#312c85",950:"#1e1a4d"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6ff",300:"#c4b4ff",400:"#a684ff",500:"#8e51ff",600:"#7f22fe",700:"#7008e7",800:"#5d0ec0",900:"#4d179a",950:"#2f0d68"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d4ff",300:"#dab2ff",400:"#c27aff",500:"#ad46ff",600:"#9810fa",700:"#8200db",800:"#6e11b0",900:"#59168b",950:"#3c0366"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f6cfff",300:"#f4a8ff",400:"#ed6aff",500:"#e12afb",600:"#c800de",700:"#a800b7",800:"#8a0194",900:"#721378",950:"#4b004f"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fccee8",300:"#fda5d5",400:"#fb64b6",500:"#f6339a",600:"#e60076",700:"#c6005c",800:"#a3004c",900:"#861043",950:"#510424"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#ffccd3",300:"#ffa1ad",400:"#ff637e",500:"#ff2056",600:"#ec003f",700:"#c70036",800:"#a50036",900:"#8b0836",950:"#4d0218"},slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cad5e2",400:"#90a1b9",500:"#62748e",600:"#45556c",700:"#314158",800:"#1d293d",900:"#0f172b",950:"#020618"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5dc",400:"#99a1af",500:"#6a7282",600:"#4a5565",700:"#364153",800:"#1e2939",900:"#101828",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#9f9fa9",500:"#71717b",600:"#52525c",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a1a1a1",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a6a09b",500:"#79716b",600:"#57534d",700:"#44403b",800:"#292524",900:"#1c1917",950:"#0c0a09"}};function T(t,e=""){let n={};for(let[r,i]of Object.entries(t)){let o=r==="DEFAULT"&&e?e:e?`${e}-${r}`:r;typeof i=="string"?n[o]=i:typeof i=="object"&&i!==null&&Object.assign(n,T(i,o))}return n}var Ct=G(W({},T(Q)),{white:"#FFFFFF",black:"#000000",transparent:"transparent"});function tt(t,e){if(t==="transparent")return"transparent";let n=t.replace(/^#/,""),r=n.length===3?n.split("").map(s=>s+s).join(""):n,o=Math.round(e/100*255).toString(16).padStart(2,"0").toUpperCase();return`#${r.toUpperCase()}${o}`}function et(t){let e=t.match(/^\[#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})\]$/);if(e){let n=e[1];return n.length===3?`#${n.split("").map(i=>i+i).join("")}`:`#${n}`}return t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary color value: ${t}. Only hex colors are supported (e.g., [#ff0000], [#f00], or [#ff0000aa]).`),null}function A(t,e){let n=i=>{var o;return(o=e==null?void 0:e[i])!=null?o:Ct[i]},r=i=>{var a;let o=i.match(/^(.+)\/(\d+)$/);if(o){let f=o[1],u=Number.parseInt(o[2],10);if(u<0||u>100)return process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid opacity value: ${u}. Opacity must be between 0 and 100.`),null;let p=et(f);if(p!==null)return tt(p,u);let g=n(f);return g?tt(g,u):null}let s=et(i);return s!==null?s:(a=n(i))!=null?a:null};if(t.startsWith("bg-")){let i=t.substring(3);if(i.startsWith("[")&&!i.startsWith("[#"))return null;let o=r(i);if(o)return{backgroundColor:o}}if(t.startsWith("text-")){let i=t.substring(5);if(i.startsWith("[")&&!i.startsWith("[#"))return null;let o=r(i);if(o)return{color:o}}if(t.startsWith("border-")&&!t.match(/^border-[0-9]/)){let i=t.substring(7);if(i.startsWith("[")&&!i.startsWith("[#"))return null;let o=r(i);if(o)return{borderColor:o}}return null}function b(t){let e=t.match(/^\[(-?\d+)(?:px)?\]$/);if(e)return parseInt(e[1],10);let n=t.match(/^\[(-?\d+(?:\.\d+)?)%\]$/);return n?`${n[1]}%`:(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary inset unit: ${t}. Only px and % are supported.`),null)}function Mt(t){let e=t.match(/^\[(-?\d+)\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary z-index: ${t}. Only integers are supported.`),null)}var Wt={flex:{display:"flex"},hidden:{display:"none"}},Tt={"flex-row":{flexDirection:"row"},"flex-row-reverse":{flexDirection:"row-reverse"},"flex-col":{flexDirection:"column"},"flex-col-reverse":{flexDirection:"column-reverse"}},Et={"flex-wrap":{flexWrap:"wrap"},"flex-wrap-reverse":{flexWrap:"wrap-reverse"},"flex-nowrap":{flexWrap:"nowrap"}},Nt={"flex-1":{flex:1},"flex-auto":{flex:1},"flex-none":{flex:0}},At={grow:{flexGrow:1},"grow-0":{flexGrow:0},shrink:{flexShrink:1},"shrink-0":{flexShrink:0}},_t={"justify-start":{justifyContent:"flex-start"},"justify-end":{justifyContent:"flex-end"},"justify-center":{justifyContent:"center"},"justify-between":{justifyContent:"space-between"},"justify-around":{justifyContent:"space-around"},"justify-evenly":{justifyContent:"space-evenly"}},vt={"items-start":{alignItems:"flex-start"},"items-end":{alignItems:"flex-end"},"items-center":{alignItems:"center"},"items-baseline":{alignItems:"baseline"},"items-stretch":{alignItems:"stretch"}},It={"self-auto":{alignSelf:"auto"},"self-start":{alignSelf:"flex-start"},"self-end":{alignSelf:"flex-end"},"self-center":{alignSelf:"center"},"self-stretch":{alignSelf:"stretch"},"self-baseline":{alignSelf:"baseline"}},$t={"content-start":{alignContent:"flex-start"},"content-end":{alignContent:"flex-end"},"content-center":{alignContent:"center"},"content-between":{alignContent:"space-between"},"content-around":{alignContent:"space-around"},"content-stretch":{alignContent:"stretch"}},jt={absolute:{position:"absolute"},relative:{position:"relative"}},Pt={"overflow-hidden":{overflow:"hidden"},"overflow-visible":{overflow:"visible"},"overflow-scroll":{overflow:"scroll"}},Vt={"opacity-0":{opacity:0},"opacity-5":{opacity:.05},"opacity-10":{opacity:.1},"opacity-15":{opacity:.15},"opacity-20":{opacity:.2},"opacity-25":{opacity:.25},"opacity-30":{opacity:.3},"opacity-35":{opacity:.35},"opacity-40":{opacity:.4},"opacity-45":{opacity:.45},"opacity-50":{opacity:.5},"opacity-55":{opacity:.55},"opacity-60":{opacity:.6},"opacity-65":{opacity:.65},"opacity-70":{opacity:.7},"opacity-75":{opacity:.75},"opacity-80":{opacity:.8},"opacity-85":{opacity:.85},"opacity-90":{opacity:.9},"opacity-95":{opacity:.95},"opacity-100":{opacity:1}},Dt={0:0,10:10,20:20,30:30,40:40,50:50,auto:0},m={0:0,.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,8:32,10:40,12:48,16:64,20:80,24:96};function j(t){var e,n,r,i,o,s,a,f,u,p,g,h;if(t.startsWith("z-")){let c=t.substring(2),l=Mt(c);if(l!==null)return{zIndex:l};let d=Dt[c];if(d!==void 0)return{zIndex:d}}if(t.startsWith("top-")){let c=t.substring(4);if(c==="auto")return{};let l=b(c);if(l!==null)return{top:l};let d=m[c];if(d!==void 0)return{top:d}}if(t.startsWith("right-")){let c=t.substring(6);if(c==="auto")return{};let l=b(c);if(l!==null)return{right:l};let d=m[c];if(d!==void 0)return{right:d}}if(t.startsWith("bottom-")){let c=t.substring(7);if(c==="auto")return{};let l=b(c);if(l!==null)return{bottom:l};let d=m[c];if(d!==void 0)return{bottom:d}}if(t.startsWith("left-")){let c=t.substring(5);if(c==="auto")return{};let l=b(c);if(l!==null)return{left:l};let d=m[c];if(d!==void 0)return{left:d}}if(t.startsWith("inset-x-")){let c=t.substring(8),l=b(c);if(l!==null)return{left:l,right:l};let d=m[c];if(d!==void 0)return{left:d,right:d}}if(t.startsWith("inset-y-")){let c=t.substring(8),l=b(c);if(l!==null)return{top:l,bottom:l};let d=m[c];if(d!==void 0)return{top:d,bottom:d}}if(t.startsWith("inset-")){let c=t.substring(6),l=b(c);if(l!==null)return{top:l,right:l,bottom:l,left:l};let d=m[c];if(d!==void 0)return{top:d,right:d,bottom:d,left:d}}return(h=(g=(p=(u=(f=(a=(s=(o=(i=(r=(n=(e=Wt[t])!=null?e:Tt[t])!=null?n:Et[t])!=null?r:Nt[t])!=null?i:At[t])!=null?o:_t[t])!=null?s:vt[t])!=null?a:It[t])!=null?f:$t[t])!=null?u:jt[t])!=null?p:Pt[t])!=null?g:Vt[t])!=null?h:null}var rt={"shadow-sm":{shadowColor:"#000000",shadowOffset:{width:0,height:1},shadowOpacity:.05,shadowRadius:1,elevation:1},shadow:{shadowColor:"#000000",shadowOffset:{width:0,height:1},shadowOpacity:.1,shadowRadius:2,elevation:2},"shadow-md":{shadowColor:"#000000",shadowOffset:{width:0,height:3},shadowOpacity:.15,shadowRadius:4,elevation:4},"shadow-lg":{shadowColor:"#000000",shadowOffset:{width:0,height:6},shadowOpacity:.2,shadowRadius:8,elevation:8},"shadow-xl":{shadowColor:"#000000",shadowOffset:{width:0,height:10},shadowOpacity:.25,shadowRadius:12,elevation:12},"shadow-2xl":{shadowColor:"#000000",shadowOffset:{width:0,height:20},shadowOpacity:.3,shadowRadius:24,elevation:16},"shadow-none":{shadowColor:"transparent",shadowOffset:{width:0,height:0},shadowOpacity:0,shadowRadius:0,elevation:0}};function P(t){return t in rt?rt[t]:null}var S={0:0,.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384},w={full:"100%","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%"};function O(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);if(e)return parseInt(e[1],10);let n=t.match(/^\[(\d+(?:\.\d+)?)%\]$/);return n?`${n[1]}%`:(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary size unit: ${t}. Only px and % are supported.`),null)}function V(t){if(t.startsWith("w-")){let e=t.substring(2),n=O(e);if(n!==null)return{width:n};let r=w[e];if(r)return{width:r};let i=S[e];if(i!==void 0)return{width:i};if(e==="auto")return{width:"auto"}}if(t.startsWith("h-")){let e=t.substring(2),n=O(e);if(n!==null)return{height:n};let r=w[e];if(r)return{height:r};let i=S[e];if(i!==void 0)return{height:i};if(e==="auto")return{height:"auto"}}if(t.startsWith("min-w-")){let e=t.substring(6),n=O(e);if(n!==null)return{minWidth:n};let r=w[e];if(r)return{minWidth:r};let i=S[e];if(i!==void 0)return{minWidth:i}}if(t.startsWith("min-h-")){let e=t.substring(6),n=O(e);if(n!==null)return{minHeight:n};let r=w[e];if(r)return{minHeight:r};let i=S[e];if(i!==void 0)return{minHeight:i}}if(t.startsWith("max-w-")){let e=t.substring(6),n=O(e);if(n!==null)return{maxWidth:n};let r=w[e];if(r)return{maxWidth:r};let i=S[e];if(i!==void 0)return{maxWidth:i}}if(t.startsWith("max-h-")){let e=t.substring(6),n=O(e);if(n!==null)return{maxHeight:n};let r=w[e];if(r)return{maxHeight:r};let i=S[e];if(i!==void 0)return{maxHeight:i}}return null}var R={0:0,.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384};function D(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary spacing value: ${t}. Only px values are supported (e.g., [16px] or [16]).`),null)}function L(t){let e=t.match(/^(-?)m([xytrbls]?)-(.+)$/);if(e){let[,i,o,s]=e,a=i==="-",f=D(s);if(f!==null){let p=a?-f:f;return nt(o,p)}let u=R[s];if(u!==void 0){let p=a?-u:u;return nt(o,p)}}let n=t.match(/^p([xytrbls]?)-(.+)$/);if(n){let[,i,o]=n,s=D(o);if(s!==null)return it(i,s);let a=R[o];if(a!==void 0)return it(i,a)}let r=t.match(/^gap-(.+)$/);if(r){let i=r[1],o=D(i);if(o!==null)return{gap:o};let s=R[i];if(s!==void 0)return{gap:s}}return null}function nt(t,e){switch(t){case"":return{margin:e};case"x":return{marginHorizontal:e};case"y":return{marginVertical:e};case"t":return{marginTop:e};case"r":return{marginRight:e};case"b":return{marginBottom:e};case"l":return{marginLeft:e};default:return{}}}function it(t,e){switch(t){case"":return{padding:e};case"x":return{paddingHorizontal:e};case"y":return{paddingVertical:e};case"t":return{paddingTop:e};case"r":return{paddingRight:e};case"b":return{paddingBottom:e};case"l":return{paddingLeft:e};default:return{}}}var z={0:0,50:.5,75:.75,90:.9,95:.95,100:1,105:1.05,110:1.1,125:1.25,150:1.5,200:2},_={0:0,1:1,2:2,3:3,6:6,12:12,45:45,90:90,180:180},ot={0:0,1:1,2:2,3:3,6:6,12:12},Lt={0:0,100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900,1e3:1e3};function F(t){let e=t.match(/^\[(-?\d+(?:\.\d+)?)\]$/);return e?parseFloat(e[1]):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary scale value: ${t}. Only numbers are supported (e.g., [1.5], [0.75]).`),null)}function C(t){let e=t.match(/^\[(-?\d+(?:\.\d+)?)deg\]$/);return e?`${e[1]}deg`:(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary rotation value: ${t}. Only deg unit is supported (e.g., [45deg], [-15deg]).`),null)}function st(t){let e=t.match(/^\[(-?\d+)(?:px)?\]$/);if(e)return parseInt(e[1],10);let n=t.match(/^\[(-?\d+(?:\.\d+)?)%\]$/);return n?`${n[1]}%`:(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary translation unit: ${t}. Only px and % are supported.`),null)}function zt(t){let e=t.match(/^\[(-?\d+)\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary perspective value: ${t}. Only integers are supported (e.g., [1500]).`),null)}function k(t){if(t.startsWith("origin-"))return process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] transform-origin is not supported in React Native. Class "${t}" will be ignored.`),null;if(t.startsWith("scale-")){let e=t.substring(6),n=F(e);if(n!==null)return{transform:[{scale:n}]};let r=z[e];if(r!==void 0)return{transform:[{scale:r}]}}if(t.startsWith("scale-x-")){let e=t.substring(8),n=F(e);if(n!==null)return{transform:[{scaleX:n}]};let r=z[e];if(r!==void 0)return{transform:[{scaleX:r}]}}if(t.startsWith("scale-y-")){let e=t.substring(8),n=F(e);if(n!==null)return{transform:[{scaleY:n}]};let r=z[e];if(r!==void 0)return{transform:[{scaleY:r}]}}if(t.startsWith("rotate-")||t.startsWith("-rotate-")){let e=t.startsWith("-"),n=e?t.substring(8):t.substring(7),r=C(n);if(r!==null)return{transform:[{rotate:e?`-${r}`:r}]};let i=_[n];if(i!==void 0)return{transform:[{rotate:`${e?-i:i}deg`}]}}if(t.startsWith("rotate-x-")||t.startsWith("-rotate-x-")){let e=t.startsWith("-"),n=e?t.substring(10):t.substring(9),r=C(n);if(r!==null)return{transform:[{rotateX:e?`-${r}`:r}]};let i=_[n];if(i!==void 0)return{transform:[{rotateX:`${e?-i:i}deg`}]}}if(t.startsWith("rotate-y-")||t.startsWith("-rotate-y-")){let e=t.startsWith("-"),n=e?t.substring(10):t.substring(9),r=C(n);if(r!==null)return{transform:[{rotateY:e?`-${r}`:r}]};let i=_[n];if(i!==void 0)return{transform:[{rotateY:`${e?-i:i}deg`}]}}if(t.startsWith("rotate-z-")||t.startsWith("-rotate-z-")){let e=t.startsWith("-"),n=e?t.substring(10):t.substring(9),r=C(n);if(r!==null)return{transform:[{rotateZ:e?`-${r}`:r}]};let i=_[n];if(i!==void 0)return{transform:[{rotateZ:`${e?-i:i}deg`}]}}if(t.startsWith("translate-x-")||t.startsWith("-translate-x-")){let e=t.startsWith("-"),n=e?t.substring(13):t.substring(12),r=st(n);if(r!==null)return{transform:[{translateX:typeof r=="number"?e?-r:r:e?`-${r}`:r}]};let i=R[n];if(i!==void 0)return{transform:[{translateX:e?-i:i}]}}if(t.startsWith("translate-y-")||t.startsWith("-translate-y-")){let e=t.startsWith("-"),n=e?t.substring(13):t.substring(12),r=st(n);if(r!==null)return{transform:[{translateY:typeof r=="number"?e?-r:r:e?`-${r}`:r}]};let i=R[n];if(i!==void 0)return{transform:[{translateY:e?-i:i}]}}if(t.startsWith("skew-x-")||t.startsWith("-skew-x-")){let e=t.startsWith("-"),n=e?t.substring(8):t.substring(7),r=C(n);if(r!==null)return{transform:[{skewX:e?`-${r}`:r}]};let i=ot[n];if(i!==void 0)return{transform:[{skewX:`${e?-i:i}deg`}]}}if(t.startsWith("skew-y-")||t.startsWith("-skew-y-")){let e=t.startsWith("-"),n=e?t.substring(8):t.substring(7),r=C(n);if(r!==null)return{transform:[{skewY:e?`-${r}`:r}]};let i=ot[n];if(i!==void 0)return{transform:[{skewY:`${e?-i:i}deg`}]}}if(t.startsWith("perspective-")){let e=t.substring(12),n=zt(e);if(n!==null)return{transform:[{perspective:n}]};let r=Lt[e];if(r!==void 0)return{transform:[{perspective:r}]}}return null}var Ft={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48,"6xl":60,"7xl":72,"8xl":96,"9xl":128};var at={"font-sans":{fontFamily:"System"},"font-serif":{fontFamily:"serif"},"font-mono":{fontFamily:"Courier"}},kt={"font-thin":{fontWeight:"100"},"font-extralight":{fontWeight:"200"},"font-light":{fontWeight:"300"},"font-normal":{fontWeight:"400"},"font-medium":{fontWeight:"500"},"font-semibold":{fontWeight:"600"},"font-bold":{fontWeight:"700"},"font-extrabold":{fontWeight:"800"},"font-black":{fontWeight:"900"}},Kt={italic:{fontStyle:"italic"},"not-italic":{fontStyle:"normal"}},Ht={"text-left":{textAlign:"left"},"text-center":{textAlign:"center"},"text-right":{textAlign:"right"},"text-justify":{textAlign:"justify"}},Bt={underline:{textDecorationLine:"underline"},"line-through":{textDecorationLine:"line-through"},"no-underline":{textDecorationLine:"none"}},Ut={uppercase:{textTransform:"uppercase"},lowercase:{textTransform:"lowercase"},capitalize:{textTransform:"capitalize"},"normal-case":{textTransform:"none"}},Gt={3:12,4:16,5:20,6:24,7:28,8:32,9:36,10:40},Xt={"leading-none":{lineHeight:16},"leading-tight":{lineHeight:20},"leading-snug":{lineHeight:22},"leading-normal":{lineHeight:24},"leading-relaxed":{lineHeight:28},"leading-loose":{lineHeight:32}},Yt={"tracking-tighter":{letterSpacing:-.8},"tracking-tight":{letterSpacing:-.4},"tracking-normal":{letterSpacing:0},"tracking-wide":{letterSpacing:.4},"tracking-wider":{letterSpacing:.8},"tracking-widest":{letterSpacing:1.6}};function Zt(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary font size value: ${t}. Only px values are supported (e.g., [18px] or [18]).`),null)}function qt(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary line height value: ${t}. Only px values are supported (e.g., [24px] or [24]).`),null)}function K(t,e){var r,i,o,s,a,f,u,p;let n=e?W(W({},at),Object.fromEntries(Object.entries(e).map(([g,h])=>[`font-${g}`,{fontFamily:h}]))):at;if(t.startsWith("text-")){let g=t.substring(5),h=Zt(g);if(h!==null)return{fontSize:h};let c=Ft[g];if(c!==void 0)return{fontSize:c}}if(t.startsWith("leading-")){let g=t.substring(8),h=qt(g);if(h!==null)return{lineHeight:h};let c=Gt[g];if(c!==void 0)return{lineHeight:c}}return(p=(u=(f=(a=(s=(o=(i=(r=n[t])!=null?r:kt[t])!=null?i:Kt[t])!=null?o:Ht[t])!=null?s:Bt[t])!=null?a:Ut[t])!=null?f:Xt[t])!=null?u:Yt[t])!=null?p:null}var Jt=["active","hover","focus","disabled","placeholder"],Qt=["ios","android","web"],te=["dark","light"],ee=["scheme"],Ae=[...Jt,...Qt,...te,...ee];function M(t,e){let n=t.split(/\s+/).filter(Boolean),r={};for(let i of n){let o=re(i,e);Object.assign(r,o)}return r}function re(t,e){let n=[L,$,r=>A(r,e==null?void 0:e.colors),j,r=>K(r,e==null?void 0:e.fontFamily),V,P,v,k];for(let r of n){let i=r(t);if(i!==null)return i}return process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unknown class: "${t}"`),{}}var ft=["active","focus","disabled"];function ct(t){return ft.some(e=>t.includes(`${e}:`))}function lt(t){let e=t.split(/\s+/).filter(Boolean),n=[],r=new Map;for(let i of e){let o=!1;for(let s of ft){let a=`${s}:`;if(i.startsWith(a)){let f=i.slice(a.length);r.has(s)||r.set(s,[]);let u=r.get(s);u&&u.push(f),o=!0;break}}o||n.push(i)}return{base:n,modifiers:r}}var y={colors:{},fontFamily:{}},x=new Map;function ne(t){var e,n,r,i,o;if((n=(e=t.theme)==null?void 0:e.extend)!=null&&n.colors?y.colors=T((r=t.theme)==null?void 0:r.extend.colors):y.colors={},(o=(i=t.theme)==null?void 0:i.extend)!=null&&o.fontFamily){let s={};for(let[a,f]of Object.entries(t.theme.extend.fontFamily))Array.isArray(f)?s[a]=f[0]:s[a]=f;y.fontFamily=s}else y.fontFamily={};x.clear()}function ie(){return y}function oe(){var t;return Object.keys((t=y.colors)!=null?t:{}).length>0?y.colors:void 0}function se(){x.clear()}function ae(){return{size:x.size,keys:Array.from(x.keys())}}function dt(t){let e=x.get(t);if(e)return e;if(!ct(t)){let f={style:M(t,y)};return x.set(t,f),f}let{base:n,modifiers:r}=lt(t),i=n.join(" "),s={style:i?M(i,y):{}};if(r.has("active")){let a=r.get("active");if(a&&a.length>0){let f=a.join(" ");s.activeStyle=M(f,y)}}if(r.has("focus")){let a=r.get("focus");if(a&&a.length>0){let f=a.join(" ");s.focusStyle=M(f,y)}}if(r.has("disabled")){let a=r.get("disabled");if(a&&a.length>0){let f=a.join(" ");s.disabledStyle=M(f,y)}}return x.set(t,s),s}function fe(t,...e){let r=t.reduce((i,o,s)=>{let a=e[s],f=a!=null&&a!==!1?String(a):"";return i+o+f},"").trim().replace(/\s+/g," ");return r?dt(r):{style:{}}}function ce(t){let e=t.trim().replace(/\s+/g," ");if(e)return dt(e)}
|
|
1
|
+
"use strict";var E=Object.defineProperty,ut=Object.defineProperties,pt=Object.getOwnPropertyDescriptor,gt=Object.getOwnPropertyDescriptors,yt=Object.getOwnPropertyNames,H=Object.getOwnPropertySymbols;var U=Object.prototype.hasOwnProperty,ht=Object.prototype.propertyIsEnumerable;var B=(t,e,n)=>e in t?E(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,W=(t,e)=>{for(var n in e||(e={}))U.call(e,n)&&B(t,n,e[n]);if(H)for(var n of H(e))ht.call(e,n)&&B(t,n,e[n]);return t},G=(t,e)=>ut(t,gt(e));var bt=(t,e)=>{for(var n in e)E(t,n,{get:e[n],enumerable:!0})},mt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of yt(e))!U.call(t,i)&&i!==n&&E(t,i,{get:()=>e[i],enumerable:!(r=pt(e,i))||r.enumerable});return t};var xt=t=>mt(E({},"__esModule",{value:!0}),t);var le={};bt(le,{clearCache:()=>se,getCacheStats:()=>ae,getCustomColors:()=>oe,getCustomTheme:()=>ie,setConfig:()=>ne,tw:()=>fe,twStyle:()=>ce});module.exports=xt(le);var X={"aspect-auto":void 0,"aspect-square":1,"aspect-video":1.7777777777777777};function St(t){let e=t.match(/^\[(\d+)\/(\d+)\]$/);if(e){let n=Number.parseInt(e[1],10),r=Number.parseInt(e[2],10);return r===0?(process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid aspect ratio: ${t}. Denominator cannot be zero.`),null):n/r}return null}function v(t){if(!t.startsWith("aspect-"))return null;if(t in X){let r=X[t];return r===void 0?{aspectRatio:void 0}:{aspectRatio:r}}let e=t.substring(7),n=St(e);return n!==null?{aspectRatio:n}:null}var Y={"":1,0:0,2:2,4:4,8:8},N={none:0,sm:2,"":4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,full:9999},Z={t:"borderTopWidth",r:"borderRightWidth",b:"borderBottomWidth",l:"borderLeftWidth"},q={tl:"borderTopLeftRadius",tr:"borderTopRightRadius",bl:"borderBottomLeftRadius",br:"borderBottomRightRadius"},wt={t:["borderTopLeftRadius","borderTopRightRadius"],r:["borderTopRightRadius","borderBottomRightRadius"],b:["borderBottomLeftRadius","borderBottomRightRadius"],l:["borderTopLeftRadius","borderBottomLeftRadius"]};function J(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary border width value: ${t}. Only px values are supported (e.g., [8px] or [8]).`),null)}function I(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary border radius value: ${t}. Only px values are supported (e.g., [12px] or [12]).`),null)}function $(t){return t==="border-solid"?{borderStyle:"solid"}:t==="border-dotted"?{borderStyle:"dotted"}:t==="border-dashed"?{borderStyle:"dashed"}:t.startsWith("border-")?Ot(t):t==="border"?{borderWidth:1}:t.startsWith("rounded")?Rt(t):null}function Ot(t){let e=t.match(/^border-([trbl])(?:-(.+))?$/);if(e){let i=e[1],o=e[2]||"";if(o.startsWith("[")){let a=J(o);return a!==null?{[Z[i]]:a}:null}let s=Y[o];return s!==void 0?{[Z[i]]:s}:null}let n=t.match(/^border-(\d+)$/);if(n){let i=Y[n[1]];if(i!==void 0)return{borderWidth:i}}let r=t.match(/^border-(\[.+\])$/);if(r){let i=J(r[1]);if(i!==null)return{borderWidth:i}}return null}function Rt(t){let e=t.substring(7);if(e==="")return{borderRadius:N[""]};if(!e.startsWith("-"))return null;let n=e.substring(1);if(n==="")return null;let r=n.match(/^(tl|tr|bl|br)(?:-(.+))?$/);if(r){let s=r[1],a=r[2]||"";if(a.startsWith("[")){let u=I(a);return u!==null?{[q[s]]:u}:null}let f=N[a];return f!==void 0?{[q[s]]:f}:null}let i=n.match(/^([trbl])(?:-(.+))?$/);if(i){let s=i[1],a=i[2]||"",f;if(a.startsWith("[")){let u=I(a);if(u!==null)f=u;else return null}else f=N[a];if(f!==void 0){let u={};return wt[s].forEach(p=>u[p]=f),u}return null}if(n.startsWith("[")){let s=I(n);return s!==null?{borderRadius:s}:null}let o=N[n];return o!==void 0?{borderRadius:o}:null}var Q={red:{50:"#fef2f2",100:"#ffe2e2",200:"#ffc9c9",300:"#ffa2a2",400:"#ff6467",500:"#fb2c36",600:"#e7000b",700:"#c10007",800:"#9f0712",900:"#82181a",950:"#460809"},orange:{50:"#fff7ed",100:"#ffedd4",200:"#ffd6a7",300:"#ffb86a",400:"#ff8904",500:"#ff6900",600:"#f54900",700:"#ca3500",800:"#9f2d00",900:"#7e2a0c",950:"#441306"},amber:{50:"#fffbeb",100:"#fef3c6",200:"#fee685",300:"#ffd230",400:"#ffb900",500:"#fe9a00",600:"#e17100",700:"#bb4d00",800:"#973c00",900:"#7b3306",950:"#461901"},yellow:{50:"#fefce8",100:"#fef9c2",200:"#fff085",300:"#ffdf20",400:"#fdc700",500:"#f0b100",600:"#d08700",700:"#a65f00",800:"#894b00",900:"#733e0a",950:"#432004"},lime:{50:"#f7fee7",100:"#ecfcca",200:"#d8f999",300:"#bbf451",400:"#9ae600",500:"#7ccf00",600:"#5ea500",700:"#497d00",800:"#3c6300",900:"#35530e",950:"#192e03"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#b9f8cf",300:"#7bf1a8",400:"#05df72",500:"#00c950",600:"#00a63e",700:"#008236",800:"#016630",900:"#0d542b",950:"#032e15"},emerald:{50:"#ecfdf5",100:"#d0fae5",200:"#a4f4cf",300:"#5ee9b5",400:"#00d492",500:"#00bc7d",600:"#009966",700:"#007a55",800:"#006045",900:"#004f3b",950:"#002c22"},teal:{50:"#f0fdfa",100:"#cbfbf1",200:"#96f7e4",300:"#46ecd5",400:"#00d5be",500:"#00bba7",600:"#009689",700:"#00786f",800:"#005f5a",900:"#0b4f4a",950:"#022f2e"},cyan:{50:"#ecfeff",100:"#cefafe",200:"#a2f4fd",300:"#53eafd",400:"#00d3f2",500:"#00b8db",600:"#0092b8",700:"#007595",800:"#005f78",900:"#104e64",950:"#053345"},sky:{50:"#f0f9ff",100:"#dff2fe",200:"#b8e6fe",300:"#74d4ff",400:"#00bcff",500:"#00a6f4",600:"#0084d1",700:"#0069a8",800:"#00598a",900:"#024a70",950:"#052f4a"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bedbff",300:"#8ec5ff",400:"#51a2ff",500:"#2b7fff",600:"#155dfc",700:"#1447e6",800:"#193cb8",900:"#1c398e",950:"#162456"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c6d2ff",300:"#a3b3ff",400:"#7c86ff",500:"#615fff",600:"#4f39f6",700:"#432dd7",800:"#372aac",900:"#312c85",950:"#1e1a4d"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6ff",300:"#c4b4ff",400:"#a684ff",500:"#8e51ff",600:"#7f22fe",700:"#7008e7",800:"#5d0ec0",900:"#4d179a",950:"#2f0d68"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d4ff",300:"#dab2ff",400:"#c27aff",500:"#ad46ff",600:"#9810fa",700:"#8200db",800:"#6e11b0",900:"#59168b",950:"#3c0366"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f6cfff",300:"#f4a8ff",400:"#ed6aff",500:"#e12afb",600:"#c800de",700:"#a800b7",800:"#8a0194",900:"#721378",950:"#4b004f"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fccee8",300:"#fda5d5",400:"#fb64b6",500:"#f6339a",600:"#e60076",700:"#c6005c",800:"#a3004c",900:"#861043",950:"#510424"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#ffccd3",300:"#ffa1ad",400:"#ff637e",500:"#ff2056",600:"#ec003f",700:"#c70036",800:"#a50036",900:"#8b0836",950:"#4d0218"},slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cad5e2",400:"#90a1b9",500:"#62748e",600:"#45556c",700:"#314158",800:"#1d293d",900:"#0f172b",950:"#020618"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5dc",400:"#99a1af",500:"#6a7282",600:"#4a5565",700:"#364153",800:"#1e2939",900:"#101828",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#9f9fa9",500:"#71717b",600:"#52525c",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a1a1a1",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a6a09b",500:"#79716b",600:"#57534d",700:"#44403b",800:"#292524",900:"#1c1917",950:"#0c0a09"}};function T(t,e=""){let n={};for(let[r,i]of Object.entries(t)){let o=r==="DEFAULT"&&e?e:e?`${e}-${r}`:r;typeof i=="string"?n[o]=i:typeof i=="object"&&i!==null&&Object.assign(n,T(i,o))}return n}var Ct=G(W({},T(Q)),{white:"#FFFFFF",black:"#000000",transparent:"transparent"});function tt(t,e){if(t==="transparent")return"transparent";let n=t.replace(/^#/,""),r=n.length===3?n.split("").map(s=>s+s).join(""):n,o=Math.round(e/100*255).toString(16).padStart(2,"0").toUpperCase();return`#${r.toUpperCase()}${o}`}function et(t){let e=t.match(/^\[#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})\]$/);if(e){let n=e[1];return n.length===3?`#${n.split("").map(i=>i+i).join("")}`:`#${n}`}return t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary color value: ${t}. Only hex colors are supported (e.g., [#ff0000], [#f00], or [#ff0000aa]).`),null}function A(t,e){let n=i=>{var o;return(o=e==null?void 0:e[i])!=null?o:Ct[i]},r=i=>{var a;let o=i.match(/^(.+)\/(\d+)$/);if(o){let f=o[1],u=Number.parseInt(o[2],10);if(u<0||u>100)return process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid opacity value: ${u}. Opacity must be between 0 and 100.`),null;let p=et(f);if(p!==null)return tt(p,u);let g=n(f);return g?tt(g,u):null}let s=et(i);return s!==null?s:(a=n(i))!=null?a:null};if(t.startsWith("bg-")){let i=t.substring(3);if(i.startsWith("[")&&!i.startsWith("[#"))return null;let o=r(i);if(o)return{backgroundColor:o}}if(t.startsWith("text-")){let i=t.substring(5);if(i.startsWith("[")&&!i.startsWith("[#"))return null;let o=r(i);if(o)return{color:o}}if(t.startsWith("border-")&&!t.match(/^border-[0-9]/)){let i=t.substring(7);if(i.startsWith("[")&&!i.startsWith("[#"))return null;let o=r(i);if(o)return{borderColor:o}}return null}function b(t){let e=t.match(/^\[(-?\d+)(?:px)?\]$/);if(e)return parseInt(e[1],10);let n=t.match(/^\[(-?\d+(?:\.\d+)?)%\]$/);return n?`${n[1]}%`:(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary inset unit: ${t}. Only px and % are supported.`),null)}function Mt(t){let e=t.match(/^\[(-?\d+)\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary z-index: ${t}. Only integers are supported.`),null)}var Wt={flex:{display:"flex"},hidden:{display:"none"}},Tt={"flex-row":{flexDirection:"row"},"flex-row-reverse":{flexDirection:"row-reverse"},"flex-col":{flexDirection:"column"},"flex-col-reverse":{flexDirection:"column-reverse"}},Et={"flex-wrap":{flexWrap:"wrap"},"flex-wrap-reverse":{flexWrap:"wrap-reverse"},"flex-nowrap":{flexWrap:"nowrap"}},Nt={"flex-1":{flex:1},"flex-auto":{flex:1},"flex-none":{flex:0}},At={grow:{flexGrow:1},"grow-0":{flexGrow:0},shrink:{flexShrink:1},"shrink-0":{flexShrink:0}},_t={"justify-start":{justifyContent:"flex-start"},"justify-end":{justifyContent:"flex-end"},"justify-center":{justifyContent:"center"},"justify-between":{justifyContent:"space-between"},"justify-around":{justifyContent:"space-around"},"justify-evenly":{justifyContent:"space-evenly"}},vt={"items-start":{alignItems:"flex-start"},"items-end":{alignItems:"flex-end"},"items-center":{alignItems:"center"},"items-baseline":{alignItems:"baseline"},"items-stretch":{alignItems:"stretch"}},It={"self-auto":{alignSelf:"auto"},"self-start":{alignSelf:"flex-start"},"self-end":{alignSelf:"flex-end"},"self-center":{alignSelf:"center"},"self-stretch":{alignSelf:"stretch"},"self-baseline":{alignSelf:"baseline"}},$t={"content-start":{alignContent:"flex-start"},"content-end":{alignContent:"flex-end"},"content-center":{alignContent:"center"},"content-between":{alignContent:"space-between"},"content-around":{alignContent:"space-around"},"content-stretch":{alignContent:"stretch"}},jt={absolute:{position:"absolute"},relative:{position:"relative"}},Pt={"overflow-hidden":{overflow:"hidden"},"overflow-visible":{overflow:"visible"},"overflow-scroll":{overflow:"scroll"}},Vt={"opacity-0":{opacity:0},"opacity-5":{opacity:.05},"opacity-10":{opacity:.1},"opacity-15":{opacity:.15},"opacity-20":{opacity:.2},"opacity-25":{opacity:.25},"opacity-30":{opacity:.3},"opacity-35":{opacity:.35},"opacity-40":{opacity:.4},"opacity-45":{opacity:.45},"opacity-50":{opacity:.5},"opacity-55":{opacity:.55},"opacity-60":{opacity:.6},"opacity-65":{opacity:.65},"opacity-70":{opacity:.7},"opacity-75":{opacity:.75},"opacity-80":{opacity:.8},"opacity-85":{opacity:.85},"opacity-90":{opacity:.9},"opacity-95":{opacity:.95},"opacity-100":{opacity:1}},Dt={0:0,10:10,20:20,30:30,40:40,50:50,auto:0},m={0:0,.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,8:32,10:40,12:48,16:64,20:80,24:96};function j(t){var e,n,r,i,o,s,a,f,u,p,g,h;if(t.startsWith("z-")){let c=t.substring(2),l=Mt(c);if(l!==null)return{zIndex:l};let d=Dt[c];if(d!==void 0)return{zIndex:d}}if(t.startsWith("top-")){let c=t.substring(4);if(c==="auto")return{};let l=b(c);if(l!==null)return{top:l};let d=m[c];if(d!==void 0)return{top:d}}if(t.startsWith("right-")){let c=t.substring(6);if(c==="auto")return{};let l=b(c);if(l!==null)return{right:l};let d=m[c];if(d!==void 0)return{right:d}}if(t.startsWith("bottom-")){let c=t.substring(7);if(c==="auto")return{};let l=b(c);if(l!==null)return{bottom:l};let d=m[c];if(d!==void 0)return{bottom:d}}if(t.startsWith("left-")){let c=t.substring(5);if(c==="auto")return{};let l=b(c);if(l!==null)return{left:l};let d=m[c];if(d!==void 0)return{left:d}}if(t.startsWith("inset-x-")){let c=t.substring(8),l=b(c);if(l!==null)return{left:l,right:l};let d=m[c];if(d!==void 0)return{left:d,right:d}}if(t.startsWith("inset-y-")){let c=t.substring(8),l=b(c);if(l!==null)return{top:l,bottom:l};let d=m[c];if(d!==void 0)return{top:d,bottom:d}}if(t.startsWith("inset-")){let c=t.substring(6),l=b(c);if(l!==null)return{top:l,right:l,bottom:l,left:l};let d=m[c];if(d!==void 0)return{top:d,right:d,bottom:d,left:d}}return(h=(g=(p=(u=(f=(a=(s=(o=(i=(r=(n=(e=Wt[t])!=null?e:Tt[t])!=null?n:Et[t])!=null?r:Nt[t])!=null?i:At[t])!=null?o:_t[t])!=null?s:vt[t])!=null?a:It[t])!=null?f:$t[t])!=null?u:jt[t])!=null?p:Pt[t])!=null?g:Vt[t])!=null?h:null}var rt={"shadow-sm":{shadowColor:"#000000",shadowOffset:{width:0,height:1},shadowOpacity:.05,shadowRadius:1,elevation:1},shadow:{shadowColor:"#000000",shadowOffset:{width:0,height:1},shadowOpacity:.1,shadowRadius:2,elevation:2},"shadow-md":{shadowColor:"#000000",shadowOffset:{width:0,height:3},shadowOpacity:.15,shadowRadius:4,elevation:4},"shadow-lg":{shadowColor:"#000000",shadowOffset:{width:0,height:6},shadowOpacity:.2,shadowRadius:8,elevation:8},"shadow-xl":{shadowColor:"#000000",shadowOffset:{width:0,height:10},shadowOpacity:.25,shadowRadius:12,elevation:12},"shadow-2xl":{shadowColor:"#000000",shadowOffset:{width:0,height:20},shadowOpacity:.3,shadowRadius:24,elevation:16},"shadow-none":{shadowColor:"transparent",shadowOffset:{width:0,height:0},shadowOpacity:0,shadowRadius:0,elevation:0}};function P(t){return t in rt?rt[t]:null}var S={0:0,.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384},w={full:"100%","1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%"};function O(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);if(e)return parseInt(e[1],10);let n=t.match(/^\[(\d+(?:\.\d+)?)%\]$/);return n?`${n[1]}%`:(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary size unit: ${t}. Only px and % are supported.`),null)}function V(t){if(t.startsWith("w-")){let e=t.substring(2),n=O(e);if(n!==null)return{width:n};let r=w[e];if(r)return{width:r};let i=S[e];if(i!==void 0)return{width:i};if(e==="auto")return{width:"auto"}}if(t.startsWith("h-")){let e=t.substring(2),n=O(e);if(n!==null)return{height:n};let r=w[e];if(r)return{height:r};let i=S[e];if(i!==void 0)return{height:i};if(e==="auto")return{height:"auto"}}if(t.startsWith("min-w-")){let e=t.substring(6),n=O(e);if(n!==null)return{minWidth:n};let r=w[e];if(r)return{minWidth:r};let i=S[e];if(i!==void 0)return{minWidth:i}}if(t.startsWith("min-h-")){let e=t.substring(6),n=O(e);if(n!==null)return{minHeight:n};let r=w[e];if(r)return{minHeight:r};let i=S[e];if(i!==void 0)return{minHeight:i}}if(t.startsWith("max-w-")){let e=t.substring(6),n=O(e);if(n!==null)return{maxWidth:n};let r=w[e];if(r)return{maxWidth:r};let i=S[e];if(i!==void 0)return{maxWidth:i}}if(t.startsWith("max-h-")){let e=t.substring(6),n=O(e);if(n!==null)return{maxHeight:n};let r=w[e];if(r)return{maxHeight:r};let i=S[e];if(i!==void 0)return{maxHeight:i}}return null}var R={0:0,.5:2,1:4,1.5:6,2:8,2.5:10,3:12,3.5:14,4:16,5:20,6:24,7:28,8:32,9:36,10:40,11:44,12:48,14:56,16:64,20:80,24:96,28:112,32:128,36:144,40:160,44:176,48:192,52:208,56:224,60:240,64:256,72:288,80:320,96:384};function D(t){let e=t.match(/^\[(-?\d+(?:\.\d+)?)(?:px)?\]$/);return e?parseFloat(e[1]):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary spacing value: ${t}. Only px values are supported (e.g., [16px], [16], [4.5px], [4.5]).`),null)}function L(t){let e=t.match(/^(-?)m([xytrbls]?)-(.+)$/);if(e){let[,i,o,s]=e,a=i==="-",f=D(s);if(f!==null){let p=a?-f:f;return nt(o,p)}let u=R[s];if(u!==void 0){let p=a?-u:u;return nt(o,p)}}let n=t.match(/^p([xytrbls]?)-(.+)$/);if(n){let[,i,o]=n,s=D(o);if(s!==null)return it(i,s);let a=R[o];if(a!==void 0)return it(i,a)}let r=t.match(/^gap-(.+)$/);if(r){let i=r[1],o=D(i);if(o!==null)return{gap:o};let s=R[i];if(s!==void 0)return{gap:s}}return null}function nt(t,e){switch(t){case"":return{margin:e};case"x":return{marginHorizontal:e};case"y":return{marginVertical:e};case"t":return{marginTop:e};case"r":return{marginRight:e};case"b":return{marginBottom:e};case"l":return{marginLeft:e};default:return{}}}function it(t,e){switch(t){case"":return{padding:e};case"x":return{paddingHorizontal:e};case"y":return{paddingVertical:e};case"t":return{paddingTop:e};case"r":return{paddingRight:e};case"b":return{paddingBottom:e};case"l":return{paddingLeft:e};default:return{}}}var z={0:0,50:.5,75:.75,90:.9,95:.95,100:1,105:1.05,110:1.1,125:1.25,150:1.5,200:2},_={0:0,1:1,2:2,3:3,6:6,12:12,45:45,90:90,180:180},ot={0:0,1:1,2:2,3:3,6:6,12:12},Lt={0:0,100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900,1e3:1e3};function F(t){let e=t.match(/^\[(-?\d+(?:\.\d+)?)\]$/);return e?parseFloat(e[1]):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary scale value: ${t}. Only numbers are supported (e.g., [1.5], [0.75]).`),null)}function C(t){let e=t.match(/^\[(-?\d+(?:\.\d+)?)deg\]$/);return e?`${e[1]}deg`:(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary rotation value: ${t}. Only deg unit is supported (e.g., [45deg], [-15deg]).`),null)}function st(t){let e=t.match(/^\[(-?\d+)(?:px)?\]$/);if(e)return parseInt(e[1],10);let n=t.match(/^\[(-?\d+(?:\.\d+)?)%\]$/);return n?`${n[1]}%`:(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary translation unit: ${t}. Only px and % are supported.`),null)}function zt(t){let e=t.match(/^\[(-?\d+)\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Invalid arbitrary perspective value: ${t}. Only integers are supported (e.g., [1500]).`),null)}function k(t){if(t.startsWith("origin-"))return process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] transform-origin is not supported in React Native. Class "${t}" will be ignored.`),null;if(t.startsWith("scale-")){let e=t.substring(6),n=F(e);if(n!==null)return{transform:[{scale:n}]};let r=z[e];if(r!==void 0)return{transform:[{scale:r}]}}if(t.startsWith("scale-x-")){let e=t.substring(8),n=F(e);if(n!==null)return{transform:[{scaleX:n}]};let r=z[e];if(r!==void 0)return{transform:[{scaleX:r}]}}if(t.startsWith("scale-y-")){let e=t.substring(8),n=F(e);if(n!==null)return{transform:[{scaleY:n}]};let r=z[e];if(r!==void 0)return{transform:[{scaleY:r}]}}if(t.startsWith("rotate-")||t.startsWith("-rotate-")){let e=t.startsWith("-"),n=e?t.substring(8):t.substring(7),r=C(n);if(r!==null)return{transform:[{rotate:e?`-${r}`:r}]};let i=_[n];if(i!==void 0)return{transform:[{rotate:`${e?-i:i}deg`}]}}if(t.startsWith("rotate-x-")||t.startsWith("-rotate-x-")){let e=t.startsWith("-"),n=e?t.substring(10):t.substring(9),r=C(n);if(r!==null)return{transform:[{rotateX:e?`-${r}`:r}]};let i=_[n];if(i!==void 0)return{transform:[{rotateX:`${e?-i:i}deg`}]}}if(t.startsWith("rotate-y-")||t.startsWith("-rotate-y-")){let e=t.startsWith("-"),n=e?t.substring(10):t.substring(9),r=C(n);if(r!==null)return{transform:[{rotateY:e?`-${r}`:r}]};let i=_[n];if(i!==void 0)return{transform:[{rotateY:`${e?-i:i}deg`}]}}if(t.startsWith("rotate-z-")||t.startsWith("-rotate-z-")){let e=t.startsWith("-"),n=e?t.substring(10):t.substring(9),r=C(n);if(r!==null)return{transform:[{rotateZ:e?`-${r}`:r}]};let i=_[n];if(i!==void 0)return{transform:[{rotateZ:`${e?-i:i}deg`}]}}if(t.startsWith("translate-x-")||t.startsWith("-translate-x-")){let e=t.startsWith("-"),n=e?t.substring(13):t.substring(12),r=st(n);if(r!==null)return{transform:[{translateX:typeof r=="number"?e?-r:r:e?`-${r}`:r}]};let i=R[n];if(i!==void 0)return{transform:[{translateX:e?-i:i}]}}if(t.startsWith("translate-y-")||t.startsWith("-translate-y-")){let e=t.startsWith("-"),n=e?t.substring(13):t.substring(12),r=st(n);if(r!==null)return{transform:[{translateY:typeof r=="number"?e?-r:r:e?`-${r}`:r}]};let i=R[n];if(i!==void 0)return{transform:[{translateY:e?-i:i}]}}if(t.startsWith("skew-x-")||t.startsWith("-skew-x-")){let e=t.startsWith("-"),n=e?t.substring(8):t.substring(7),r=C(n);if(r!==null)return{transform:[{skewX:e?`-${r}`:r}]};let i=ot[n];if(i!==void 0)return{transform:[{skewX:`${e?-i:i}deg`}]}}if(t.startsWith("skew-y-")||t.startsWith("-skew-y-")){let e=t.startsWith("-"),n=e?t.substring(8):t.substring(7),r=C(n);if(r!==null)return{transform:[{skewY:e?`-${r}`:r}]};let i=ot[n];if(i!==void 0)return{transform:[{skewY:`${e?-i:i}deg`}]}}if(t.startsWith("perspective-")){let e=t.substring(12),n=zt(e);if(n!==null)return{transform:[{perspective:n}]};let r=Lt[e];if(r!==void 0)return{transform:[{perspective:r}]}}return null}var Ft={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36,"5xl":48,"6xl":60,"7xl":72,"8xl":96,"9xl":128};var at={"font-sans":{fontFamily:"System"},"font-serif":{fontFamily:"serif"},"font-mono":{fontFamily:"Courier"}},kt={"font-thin":{fontWeight:"100"},"font-extralight":{fontWeight:"200"},"font-light":{fontWeight:"300"},"font-normal":{fontWeight:"400"},"font-medium":{fontWeight:"500"},"font-semibold":{fontWeight:"600"},"font-bold":{fontWeight:"700"},"font-extrabold":{fontWeight:"800"},"font-black":{fontWeight:"900"}},Kt={italic:{fontStyle:"italic"},"not-italic":{fontStyle:"normal"}},Ht={"text-left":{textAlign:"left"},"text-center":{textAlign:"center"},"text-right":{textAlign:"right"},"text-justify":{textAlign:"justify"}},Bt={underline:{textDecorationLine:"underline"},"line-through":{textDecorationLine:"line-through"},"no-underline":{textDecorationLine:"none"}},Ut={uppercase:{textTransform:"uppercase"},lowercase:{textTransform:"lowercase"},capitalize:{textTransform:"capitalize"},"normal-case":{textTransform:"none"}},Gt={3:12,4:16,5:20,6:24,7:28,8:32,9:36,10:40},Xt={"leading-none":{lineHeight:16},"leading-tight":{lineHeight:20},"leading-snug":{lineHeight:22},"leading-normal":{lineHeight:24},"leading-relaxed":{lineHeight:28},"leading-loose":{lineHeight:32}},Yt={"tracking-tighter":{letterSpacing:-.8},"tracking-tight":{letterSpacing:-.4},"tracking-normal":{letterSpacing:0},"tracking-wide":{letterSpacing:.4},"tracking-wider":{letterSpacing:.8},"tracking-widest":{letterSpacing:1.6}};function Zt(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary font size value: ${t}. Only px values are supported (e.g., [18px] or [18]).`),null)}function qt(t){let e=t.match(/^\[(\d+)(?:px)?\]$/);return e?parseInt(e[1],10):(t.startsWith("[")&&t.endsWith("]")&&process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unsupported arbitrary line height value: ${t}. Only px values are supported (e.g., [24px] or [24]).`),null)}function K(t,e){var r,i,o,s,a,f,u,p;let n=e?W(W({},at),Object.fromEntries(Object.entries(e).map(([g,h])=>[`font-${g}`,{fontFamily:h}]))):at;if(t.startsWith("text-")){let g=t.substring(5),h=Zt(g);if(h!==null)return{fontSize:h};let c=Ft[g];if(c!==void 0)return{fontSize:c}}if(t.startsWith("leading-")){let g=t.substring(8),h=qt(g);if(h!==null)return{lineHeight:h};let c=Gt[g];if(c!==void 0)return{lineHeight:c}}return(p=(u=(f=(a=(s=(o=(i=(r=n[t])!=null?r:kt[t])!=null?i:Kt[t])!=null?o:Ht[t])!=null?s:Bt[t])!=null?a:Ut[t])!=null?f:Xt[t])!=null?u:Yt[t])!=null?p:null}var Jt=["active","hover","focus","disabled","placeholder"],Qt=["ios","android","web"],te=["dark","light"],ee=["scheme"],Ae=[...Jt,...Qt,...te,...ee];function M(t,e){let n=t.split(/\s+/).filter(Boolean),r={};for(let i of n){let o=re(i,e);Object.assign(r,o)}return r}function re(t,e){let n=[L,$,r=>A(r,e==null?void 0:e.colors),j,r=>K(r,e==null?void 0:e.fontFamily),V,P,v,k];for(let r of n){let i=r(t);if(i!==null)return i}return process.env.NODE_ENV!=="production"&&console.warn(`[react-native-tailwind] Unknown class: "${t}"`),{}}var ft=["active","focus","disabled"];function ct(t){return ft.some(e=>t.includes(`${e}:`))}function lt(t){let e=t.split(/\s+/).filter(Boolean),n=[],r=new Map;for(let i of e){let o=!1;for(let s of ft){let a=`${s}:`;if(i.startsWith(a)){let f=i.slice(a.length);r.has(s)||r.set(s,[]);let u=r.get(s);u&&u.push(f),o=!0;break}}o||n.push(i)}return{base:n,modifiers:r}}var y={colors:{},fontFamily:{}},x=new Map;function ne(t){var e,n,r,i,o;if((n=(e=t.theme)==null?void 0:e.extend)!=null&&n.colors?y.colors=T((r=t.theme)==null?void 0:r.extend.colors):y.colors={},(o=(i=t.theme)==null?void 0:i.extend)!=null&&o.fontFamily){let s={};for(let[a,f]of Object.entries(t.theme.extend.fontFamily))Array.isArray(f)?s[a]=f[0]:s[a]=f;y.fontFamily=s}else y.fontFamily={};x.clear()}function ie(){return y}function oe(){var t;return Object.keys((t=y.colors)!=null?t:{}).length>0?y.colors:void 0}function se(){x.clear()}function ae(){return{size:x.size,keys:Array.from(x.keys())}}function dt(t){let e=x.get(t);if(e)return e;if(!ct(t)){let f={style:M(t,y)};return x.set(t,f),f}let{base:n,modifiers:r}=lt(t),i=n.join(" "),s={style:i?M(i,y):{}};if(r.has("active")){let a=r.get("active");if(a&&a.length>0){let f=a.join(" ");s.activeStyle=M(f,y)}}if(r.has("focus")){let a=r.get("focus");if(a&&a.length>0){let f=a.join(" ");s.focusStyle=M(f,y)}}if(r.has("disabled")){let a=r.get("disabled");if(a&&a.length>0){let f=a.join(" ");s.disabledStyle=M(f,y)}}return x.set(t,s),s}function fe(t,...e){let r=t.reduce((i,o,s)=>{let a=e[s],f=a!=null&&a!==!1?String(a):"";return i+o+f},"").trim().replace(/\s+/g," ");return r?dt(r):{style:{}}}function ce(t){let e=t.trim().replace(/\s+/g," ");if(e)return dt(e)}
|
|
2
2
|
//# sourceMappingURL=runtime.cjs.map
|