@stylix/core 6.4.1 → 6.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -5
- package/dist/index.js +55 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -12,10 +12,7 @@ type HTMLProps<TTag extends keyof React.JSX.IntrinsicElements> = React.JSX.Intri
|
|
|
12
12
|
type OpaqueMediaStyles = {
|
|
13
13
|
__opaqueMediaStyles: true;
|
|
14
14
|
};
|
|
15
|
-
type
|
|
16
|
-
[key: string]: OpaqueMediaStyles | StylixMediaValue;
|
|
17
|
-
};
|
|
18
|
-
type StylixMediaFunc = (styles: OpaqueMediaStyles) => StylixMediaValue;
|
|
15
|
+
type StylixMediaFunc = (styles: OpaqueMediaStyles) => StylixStyles;
|
|
19
16
|
type StylixMediaDefinition = Record<string, StylixMediaFunc>;
|
|
20
17
|
|
|
21
18
|
type CSSProperties = CSS.StandardPropertiesHyphen<number | string> & CSS.VendorPropertiesHyphen<number | string> & CSS.StandardProperties<number | string> & CSS.VendorProperties<number | string>;
|
|
@@ -131,6 +128,7 @@ type StylixContext = {
|
|
|
131
128
|
plugins: StylixPlugin[];
|
|
132
129
|
stylesheet?: CSSStyleSheet;
|
|
133
130
|
styleElement?: HTMLStyleElement;
|
|
131
|
+
styleElementIsUserProvided: boolean;
|
|
134
132
|
styleCollector?: string[];
|
|
135
133
|
styleCounter: number;
|
|
136
134
|
rules: {
|
|
@@ -142,7 +140,7 @@ type StylixContext = {
|
|
|
142
140
|
};
|
|
143
141
|
styleProps: Record<string, string>;
|
|
144
142
|
ssr?: boolean;
|
|
145
|
-
cleanupRequest
|
|
143
|
+
cleanupRequest: boolean;
|
|
146
144
|
requestApply: boolean;
|
|
147
145
|
classifyProps(props: Record<string, unknown>): [Record<string, unknown>, Record<string, unknown>];
|
|
148
146
|
styles(styles: StylixStyles, config?: {
|
package/dist/index.js
CHANGED
|
@@ -24,12 +24,13 @@ function applyRules(ctx) {
|
|
|
24
24
|
ctx.styleElement = document.createElement('style');
|
|
25
25
|
ctx.styleElement.className = 'stylix';
|
|
26
26
|
if (ctx.id)
|
|
27
|
-
ctx.styleElement.id =
|
|
27
|
+
ctx.styleElement.id = `${ctx.id}-styles`;
|
|
28
28
|
document.head.appendChild(ctx.styleElement);
|
|
29
29
|
}
|
|
30
30
|
if (ctx.styleElement) {
|
|
31
31
|
// If there's a style element, use it
|
|
32
32
|
const flattenedRules = flattenRules(ctx);
|
|
33
|
+
console.log('applyRules', flattenedRules.length);
|
|
33
34
|
ctx.styleElement.innerHTML = flattenedRules.join('\n');
|
|
34
35
|
}
|
|
35
36
|
else {
|
|
@@ -680,7 +681,7 @@ const defaultUnitsMap = (key, value, target, ctx, mapRecursive) => {
|
|
|
680
681
|
};
|
|
681
682
|
const defaultPixelUnits = defaultUnits();
|
|
682
683
|
|
|
683
|
-
function _hoistKeyframes(styles, root) {
|
|
684
|
+
function _hoistKeyframes(styles, root, ctx) {
|
|
684
685
|
for (const key in styles) {
|
|
685
686
|
const value = styles[key];
|
|
686
687
|
if (key.startsWith('@keyframes')) {
|
|
@@ -689,9 +690,15 @@ function _hoistKeyframes(styles, root) {
|
|
|
689
690
|
if (styles !== root)
|
|
690
691
|
delete styles[key];
|
|
691
692
|
}
|
|
693
|
+
if (key.startsWith('@scope')) {
|
|
694
|
+
// Add scopes rules as-is directly to root object
|
|
695
|
+
root[key] = { [`.${ctx.className}`]: value };
|
|
696
|
+
if (styles !== root)
|
|
697
|
+
delete styles[key];
|
|
698
|
+
}
|
|
692
699
|
else if (isPlainObject(value)) {
|
|
693
700
|
// Recursively flatten nested styles
|
|
694
|
-
_hoistKeyframes(value, root);
|
|
701
|
+
_hoistKeyframes(value, root, ctx);
|
|
695
702
|
}
|
|
696
703
|
}
|
|
697
704
|
return styles;
|
|
@@ -703,7 +710,7 @@ const hoistKeyframes = {
|
|
|
703
710
|
name: 'hoistKeyframes',
|
|
704
711
|
type: 'processStyles',
|
|
705
712
|
plugin(_ctx, styles) {
|
|
706
|
-
return _hoistKeyframes(styles, styles);
|
|
713
|
+
return _hoistKeyframes(styles, styles, _ctx);
|
|
707
714
|
},
|
|
708
715
|
};
|
|
709
716
|
|
|
@@ -750,12 +757,16 @@ function mediaObjectsPlugin(ctx, styles) {
|
|
|
750
757
|
return styles;
|
|
751
758
|
return processMediaStyles(ctx.media, ctx.styleProps, styles);
|
|
752
759
|
}
|
|
753
|
-
function processMediaStyles(mediaDef, styleProps, styles
|
|
760
|
+
function processMediaStyles(mediaDef, styleProps, styles,
|
|
761
|
+
// styleKey is provided when recursively processing a nested media object for a style prop (e.g. { color: { mobile: { dark: 'red' } } }).
|
|
762
|
+
// It should be continuously passed down until the actual style value is reached, at which point it will be used to construct the styles
|
|
763
|
+
// object passed to the media function (e.g. mediaDef['mobile']({ color: 'red' }))
|
|
764
|
+
nestedStyleKey) {
|
|
754
765
|
if (!styles || typeof styles !== 'object')
|
|
755
|
-
return styles;
|
|
766
|
+
return nestedStyleKey ? { [nestedStyleKey]: styles } : styles;
|
|
756
767
|
// If styles is an array, just recursively map it
|
|
757
768
|
if (Array.isArray(styles)) {
|
|
758
|
-
return styles.
|
|
769
|
+
return styles.flatMap((style) => processMediaStyles(mediaDef, styleProps, style));
|
|
759
770
|
}
|
|
760
771
|
mediaDef.default ||= (styles) => styles;
|
|
761
772
|
const result = { default: [] };
|
|
@@ -770,19 +781,16 @@ function processMediaStyles(mediaDef, styleProps, styles) {
|
|
|
770
781
|
// An object for a style prop is definitely a media object
|
|
771
782
|
for (const mediaKey in styleValue) {
|
|
772
783
|
result[mediaKey] ||= [];
|
|
784
|
+
// process recursively
|
|
785
|
+
const processed = processMediaStyles(mediaDef, styleProps, styleValue[mediaKey], styleKey);
|
|
773
786
|
// mediaKey corresponds to a media definition
|
|
774
787
|
if (mediaKey in mediaDef) {
|
|
775
|
-
result[mediaKey].push(mediaDef[mediaKey](
|
|
776
|
-
// process recursively
|
|
777
|
-
[styleKey]: processMediaStyles(mediaDef, styleProps, styleValue[mediaKey]),
|
|
778
|
-
}));
|
|
788
|
+
result[mediaKey].push(mediaDef[mediaKey](processed));
|
|
779
789
|
}
|
|
780
790
|
// mediaKey does not correspond to a media definition, it must be a @media or @container rule
|
|
781
791
|
else {
|
|
782
792
|
result[mediaKey].push({
|
|
783
|
-
[mediaKey]:
|
|
784
|
-
[styleKey]: processMediaStyles(mediaDef, styleProps, styleValue[mediaKey]),
|
|
785
|
-
},
|
|
793
|
+
[mediaKey]: processed,
|
|
786
794
|
});
|
|
787
795
|
}
|
|
788
796
|
}
|
|
@@ -792,11 +800,13 @@ function processMediaStyles(mediaDef, styleProps, styles) {
|
|
|
792
800
|
result[styleKey] ||= [];
|
|
793
801
|
result[styleKey].push(mediaDef[styleKey](
|
|
794
802
|
// process recursively
|
|
795
|
-
processMediaStyles(mediaDef, styleProps, styleValue)));
|
|
803
|
+
processMediaStyles(mediaDef, styleProps, styleValue, nestedStyleKey)));
|
|
796
804
|
continue;
|
|
797
805
|
}
|
|
798
806
|
// Key is a selector, just process recursively and add to plain styles
|
|
799
|
-
result.default.push({
|
|
807
|
+
result.default.push({
|
|
808
|
+
[styleKey]: processMediaStyles(mediaDef, styleProps, styleValue),
|
|
809
|
+
});
|
|
800
810
|
}
|
|
801
811
|
const results = Object.values(result);
|
|
802
812
|
return results.length === 1 ? results[0] : results.length === 0 ? null : results;
|
|
@@ -1070,7 +1080,7 @@ function stylesToRuleArray(styles, className, context) {
|
|
|
1070
1080
|
}
|
|
1071
1081
|
|
|
1072
1082
|
function cleanup(ctx) {
|
|
1073
|
-
if (
|
|
1083
|
+
if (ctx.cleanupRequest)
|
|
1074
1084
|
return;
|
|
1075
1085
|
const doCleanup = () => {
|
|
1076
1086
|
for (const i in ctx.rules) {
|
|
@@ -1079,13 +1089,17 @@ function cleanup(ctx) {
|
|
|
1079
1089
|
delete ctx.rules[i];
|
|
1080
1090
|
}
|
|
1081
1091
|
}
|
|
1082
|
-
ctx
|
|
1092
|
+
applyRules(ctx);
|
|
1093
|
+
ctx.cleanupRequest = false;
|
|
1083
1094
|
};
|
|
1095
|
+
// queueMicrotask in devMode so the cleanupRequest guard batches simultaneous unmounts
|
|
1096
|
+
// before applyRules is called; setTimeout(100) serves the same purpose in production.
|
|
1097
|
+
ctx.cleanupRequest = true;
|
|
1084
1098
|
if (ctx.devMode) {
|
|
1085
|
-
doCleanup
|
|
1099
|
+
queueMicrotask(doCleanup);
|
|
1086
1100
|
}
|
|
1087
1101
|
else {
|
|
1088
|
-
|
|
1102
|
+
setTimeout(doCleanup, 100);
|
|
1089
1103
|
}
|
|
1090
1104
|
}
|
|
1091
1105
|
function createStyles(config) {
|
|
@@ -1102,7 +1116,7 @@ function createStyles(config) {
|
|
|
1102
1116
|
if (stylesKey && !stylixCtx.rules[stylesKey]) {
|
|
1103
1117
|
stylixCtx.styleCounter++;
|
|
1104
1118
|
const debugLabel = config.debugLabel || (stylixCtx.devMode && getParentComponentName()) || '';
|
|
1105
|
-
const className =
|
|
1119
|
+
const className = `${stylixCtx.id}-${(stylixCtx.styleCounter).toString(36)}${debugLabel ? `-${debugLabel}` : ''}`;
|
|
1106
1120
|
// If not global styles, wrap original styles with classname
|
|
1107
1121
|
if (!global)
|
|
1108
1122
|
styles = { [`.${className}`]: styles };
|
|
@@ -1117,10 +1131,7 @@ function createStyles(config) {
|
|
|
1117
1131
|
if (isChanged) {
|
|
1118
1132
|
// Mark styles to be applied
|
|
1119
1133
|
stylixCtx.requestApply = true;
|
|
1120
|
-
//
|
|
1121
|
-
const priorRuleSet = priorKey ? stylixCtx.rules[priorKey] : null;
|
|
1122
|
-
if (priorRuleSet)
|
|
1123
|
-
priorRuleSet.refs--;
|
|
1134
|
+
// Increment ref count for new styles; decrement is handled by the useInsertionEffect cleanup
|
|
1124
1135
|
if (ruleSet)
|
|
1125
1136
|
ruleSet.refs++;
|
|
1126
1137
|
}
|
|
@@ -1153,11 +1164,20 @@ function useStyles(styles, options = { global: false }) {
|
|
|
1153
1164
|
// browser to compute styles.
|
|
1154
1165
|
// biome-ignore lint/correctness/useExhaustiveDependencies: stylixCtx is stable
|
|
1155
1166
|
useInsertionEffect(() => {
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1167
|
+
const capturedKey = s.key;
|
|
1168
|
+
if (stylixCtx.requestApply) {
|
|
1169
|
+
stylixCtx.requestApply = false;
|
|
1170
|
+
applyRules(stylixCtx);
|
|
1171
|
+
}
|
|
1172
|
+
// Always register a cleanup to decrement refs when styles change or component unmounts.
|
|
1173
|
+
// This runs whether or not requestApply was true — guards against missing cleanup when
|
|
1174
|
+
// a sibling component already called applyRules in the same commit.
|
|
1160
1175
|
return () => {
|
|
1176
|
+
if (capturedKey) {
|
|
1177
|
+
const rule = stylixCtx.rules[capturedKey];
|
|
1178
|
+
if (rule)
|
|
1179
|
+
rule.refs--;
|
|
1180
|
+
}
|
|
1161
1181
|
cleanup(stylixCtx);
|
|
1162
1182
|
};
|
|
1163
1183
|
}, [s.key]);
|
|
@@ -1176,6 +1196,7 @@ const detectSSR = () => !(typeof window !== 'undefined' && window.document?.head
|
|
|
1176
1196
|
* Default style props mapping. This will be populated on the first call to createStylixContext.
|
|
1177
1197
|
*/
|
|
1178
1198
|
let defaultStyleProps;
|
|
1199
|
+
window.__stylixNextId = 0;
|
|
1179
1200
|
function createStylixContext(userValues = {}) {
|
|
1180
1201
|
if (!defaultStyleProps) {
|
|
1181
1202
|
defaultStyleProps = {};
|
|
@@ -1184,16 +1205,17 @@ function createStylixContext(userValues = {}) {
|
|
|
1184
1205
|
}
|
|
1185
1206
|
}
|
|
1186
1207
|
const ctx = {
|
|
1187
|
-
id: userValues.id ||
|
|
1208
|
+
id: userValues.id || `stylix${window.__stylixNextId++}`,
|
|
1188
1209
|
devMode: !!userValues.devMode,
|
|
1189
1210
|
styleProps: defaultStyleProps,
|
|
1190
1211
|
media: userValues.media,
|
|
1191
1212
|
styleElement: userValues.styleElement,
|
|
1213
|
+
styleElementIsUserProvided: !!userValues.styleElement,
|
|
1192
1214
|
plugins: defaultPlugins.flat(),
|
|
1193
1215
|
styleCounter: 0,
|
|
1194
1216
|
rules: {},
|
|
1195
1217
|
ssr: userValues.ssr ?? detectSSR(),
|
|
1196
|
-
cleanupRequest:
|
|
1218
|
+
cleanupRequest: false,
|
|
1197
1219
|
requestApply: false,
|
|
1198
1220
|
classifyProps(props) {
|
|
1199
1221
|
const [styles, other] = classifyProps(props, this.styleProps);
|
|
@@ -1273,7 +1295,8 @@ function StylixProvider(props) {
|
|
|
1273
1295
|
// When the component is unmounted, remove the style element, if any
|
|
1274
1296
|
useEffect(() => {
|
|
1275
1297
|
return () => {
|
|
1276
|
-
ctx.current?.styleElement
|
|
1298
|
+
if (ctx.current?.styleElement && !ctx.current.styleElementIsUserProvided)
|
|
1299
|
+
ctx.current.styleElement.remove();
|
|
1277
1300
|
};
|
|
1278
1301
|
}, []);
|
|
1279
1302
|
return jsx(stylixContext.Provider, { value: ctx.current, children: children });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/applyRules.ts","../src/classifyProps.ts","../src/util/isEmpty.ts","../src/util/isPlainObject.ts","../src/plugins/cleanStyles.ts","../src/util/mapObject.ts","../src/plugins/defaultUnits.ts","../src/plugins/hoistKeyframes.ts","../src/plugins/hoistLayers.ts","../src/plugins/mediaObjects.ts","../src/plugins/mergeArrays.ts","../src/plugins/prepareStyles.ts","../src/plugins/propCasing.ts","../src/plugins/replace$$class.ts","../src/plugins/customProps.ts","../src/plugins/index.ts","../src/StyleElement.tsx","../src/styleCollector.tsx","../src/getParentComponentName.ts","../src/stylesToRuleArray.ts","../src/useStyles.ts","../src/util/useIsoLayoutEffect.ts","../src/stylixContext.tsx","../src/Stylix.tsx","../src/elements.tsx","../src/RenderServerStyles.tsx","../src/util/cx.ts"],"sourcesContent":["import type { StylixContext } from './stylixContext';\n\nexport function flattenRules(ctx: StylixContext): string[] {\n return Object.values(ctx.rules)\n .flatMap((val) => (val && val.refs > 0 ? val.rules : []))\n .filter(Boolean);\n}\n\n/**\n * Applies rules from given StylixContext to the <style> element.\n */\nexport default function applyRules(ctx: StylixContext): void {\n if (ctx.styleCollector) {\n const flattenedRules = flattenRules(ctx);\n ctx.styleCollector.length = 0;\n ctx.styleCollector.push(...flattenedRules);\n return;\n }\n\n if (ctx.ssr) return;\n\n const supportsAdoptedStylesheets = 'adoptedStyleSheets' in document;\n\n // If there's no style element, and we're in dev mode, create one\n if (!ctx.styleElement && (ctx.devMode || !supportsAdoptedStylesheets)) {\n ctx.styleElement = document.createElement('style');\n ctx.styleElement.className = 'stylix';\n if (ctx.id) ctx.styleElement.id = `stylix-${ctx.id}`;\n document.head.appendChild(ctx.styleElement);\n }\n\n if (ctx.styleElement) {\n // If there's a style element, use it\n const flattenedRules = flattenRules(ctx);\n ctx.styleElement.innerHTML = flattenedRules.join('\\n');\n } else {\n // Still no stylesheet yet, create one\n if (!ctx.stylesheet) {\n ctx.stylesheet = new CSSStyleSheet();\n if (supportsAdoptedStylesheets) {\n document.adoptedStyleSheets.push(ctx.stylesheet);\n } else if (ctx.stylesheet.ownerNode) {\n document.head.appendChild(ctx.stylesheet.ownerNode);\n }\n }\n\n const stylesheet = ctx.stylesheet;\n\n const flattenedRules = flattenRules(ctx);\n if (stylesheet.replaceSync) {\n try {\n stylesheet.replaceSync(flattenedRules.join('\\n'));\n } catch (e) {\n // Errors are ignored, this just means that a browser doesn't support a certain CSS feature.\n console.warn(e);\n }\n }\n }\n}\n","export function classifyProps(\n props: Record<string, unknown>,\n knownStyleProps: Record<string, string>,\n): [any, any] {\n const styles = {} as any;\n const other = {} as any;\n\n for (const prop in props) {\n // If prop is not a valid JSX prop, it must be a CSS selector.\n // If prop has a style prop name and the value is likely a style value, it's a style prop.\n if (!isValidJSXProp(prop) || isStyleProp(prop, knownStyleProps)) {\n styles[prop] = props[prop];\n } else {\n other[prop] = props[prop];\n }\n }\n\n return [styles, other];\n}\n\n/**\n * Determines if `value` is a recognized CSS property (can be standard CSS or custom Stylix prop).\n * If it is, the simplified prop name is returned. Otherwise, false is returned.\n */\nexport function isStyleProp(\n prop: unknown,\n knownStyleProps: Record<string, string>,\n): string | false {\n if (isValidJSXProp(prop)) {\n const simplified = simplifyStylePropName(prop);\n return simplified in knownStyleProps ? simplified : false;\n }\n return false;\n}\n\nexport function isValidJSXProp(value: unknown): value is string {\n // Not an exact check, but mostly rules out complex css selectors\n return typeof value === 'string' && /^[a-z$][a-z0-9_-]*$/i.test(value);\n}\n\nexport function simplifyStylePropName(value: string) {\n return value.toLowerCase().replace(/[^a-z]/g, '');\n}\n","export function isEmpty(obj: unknown) {\n if (!obj) return true;\n if (Array.isArray(obj)) return obj.length === 0;\n for (const _ in obj) return false;\n if (typeof obj === 'object') return true;\n return false;\n}\n","/**\n * Indicates that an object is most likely just an object literal.\n */\nexport function isPlainObject(value: any): value is Record<string, any> {\n if (!value || typeof value !== 'object') return false;\n return Object.getPrototypeOf(value) === Object.prototype;\n}\n","import { isEmpty } from '../util/isEmpty';\nimport { isPlainObject } from '../util/isPlainObject';\nimport type { StylixPlugin } from './index';\n\nexport function _cleanStyles(object: any): void {\n for (const key in object) {\n const value = object[key];\n if (value === null || value === undefined || value === '' || value === false)\n delete object[key];\n else if (isPlainObject(value) || Array.isArray(value)) {\n _cleanStyles(value);\n if (isEmpty(value)) delete object[key];\n }\n }\n}\n\n/**\n * Removes null, undefined, and empty string values from style objects.\n */\nexport const cleanStyles: StylixPlugin = {\n name: 'cleanStyles',\n type: 'processStyles',\n plugin(_ctx, styles) {\n _cleanStyles(styles);\n return styles;\n },\n};\n","export type ObjectOrArray = unknown[] & Record<string, unknown>;\n\nexport type MapObjectFunction<TContext extends object = object> = (\n key: string | number,\n value: unknown,\n target: ObjectOrArray,\n context: TContext,\n mapRecursive: (value: unknown) => ObjectOrArray,\n) => void;\n\n/**\n * Returns a new object or array, generated by invoking `map` on each key-value pair in `source` and merging the returned value into\n * the result. The return value should be an object or array (to match `source`), or undefined to omit the key-value pair from the result.\n *\n * If `source` is an object, Object.assign() will be used to merge the response into the result object.\n *\n * If `source` is an array, the returned array entries will be pushed onto the result array (i.e. it will be flattened, one level deep).\n *\n * The `map` function will receive the following arguments:\n * - The current key or index\n * - The current value\n * - The current object/array being mapped\n * - A context object. This is a plain object that you can modify as needed. The value will be shallow cloned for each key, and the clone\n * will be passed into the `mapRecursive` method in order to persist it in recursive mapping.\n * - A `mapRecursive` function that can be used to recursively map nested objects or arrays. You can call this by passing the current value,\n * which will run the same mapping function on the value and return the result. If the value is not an object or array, it will just\n * return the value. The mapping function will receive the context object for the current key, and any modifications made to the context\n * object will be persisted into the recursive call. This could be used, for example, to keep track of the current depth of the recursion\n * or the full path of the current value.\n *\n * Example:\n *\n * ```ts\n * const value = {\n * ignoreMe: null,\n * string: 'value',\n * object: {\n * a: 1,\n * b: 2,\n * },\n * array: [1, 2, 3, 4],\n * }\n * const result = mapObjectRecursive(value, (key, value, source, context) => {\n * if (key === 'ignoreMe')\n * return undefined; // will omit key from result\n * if (typeof key === 'string' && typeof value === 'string')\n * return { [key]: value + '-mapped' }; // will append '-mapped' to string values\n * if (typeof key === 'string' && typeof value === 'number')\n * return { [key]: value, [`${key}-mapped`]: value * 2 }; // will add a new key with the value doubled\n * if (typeof value === 'object')\n * return { [key]: value }; // will leave object unchanged\n * if (Array.isArray(source) && typeof value === 'number')\n * return [value, value * 2]; // will add the value and the value doubled to the array\n * });\n * // result:\n * // {\n * // string: 'value-mapped',\n * // object: {\n * // a: 1,\n * // 'a-mapped': 2,\n * // b: 2,\n * // 'b-mapped': 4,\n * // },\n * // array: [1, 2, 2, 4, 3, 6, 4, 8],\n * // }\n * ```\n */\nexport function mapObject<TSource, TContext extends object>(\n source: TSource,\n mapFn: MapObjectFunction<TContext>,\n context?: TContext,\n): TSource {\n if (typeof source !== 'object') return source;\n const target = (Array.isArray(source) ? [] : {}) as ObjectOrArray;\n for (const _key in source) {\n const key: number | string = Array.isArray(source) ? +_key : _key;\n const value = (source as any)[key];\n\n const contextClone = { ...context } as TContext;\n mapFn(key, value, target, contextClone, (value) =>\n mapObject(value as ObjectOrArray, mapFn, contextClone),\n );\n }\n\n return target as TSource;\n}\n","import { type MapObjectFunction, mapObject } from '../util/mapObject';\nimport type { StylixPlugin } from './index';\n\nexport const defaultIgnoreUnits = [\n 'aspect-ratio',\n 'column-count',\n 'columns',\n 'fill-opacity',\n 'flex',\n 'flex-grow',\n 'flex-shrink',\n 'font-weight',\n 'line-height',\n 'opacity',\n 'order',\n 'orphans',\n 'stroke-opacity',\n 'widows',\n 'z-index',\n 'zoom',\n];\n\n/**\n * Adds unit (px, em, etc) to numeric values for any style properties not included in `ignoreProps`.\n */\nexport const defaultUnits = (unit = 'px', ignoreProps = defaultIgnoreUnits): StylixPlugin => {\n return {\n name: 'defaultUnits',\n type: 'processStyles',\n plugin(_ctx, styles) {\n return mapObject(styles, defaultUnitsMap, { unit, ignoreProps });\n },\n };\n};\n\nconst defaultUnitsMap: MapObjectFunction<{ unit: string; ignoreProps: string[] }> = (\n key,\n value,\n target,\n ctx,\n mapRecursive,\n) => {\n if (typeof value === 'number' && !ctx.ignoreProps.includes(key as string)) {\n target[key] = String(value) + ctx.unit;\n return;\n }\n target[key] = mapRecursive(value);\n};\n\nexport const defaultPixelUnits = defaultUnits();\n","import { isPlainObject } from '../util/isPlainObject';\nimport type { StylixPlugin } from './index';\n\nfunction _hoistKeyframes(styles: any, root: any) {\n for (const key in styles) {\n const value = styles[key];\n if (key.startsWith('@keyframes')) {\n // Add keyframe rules as-is directly to root object\n root[key] = value;\n if (styles !== root) delete styles[key];\n } else if (isPlainObject(value)) {\n // Recursively flatten nested styles\n _hoistKeyframes(value, root);\n }\n }\n return styles;\n}\n\n/**\n * Hoists @keyframe declarations to root of styles object.\n */\nexport const hoistKeyframes: StylixPlugin = {\n name: 'hoistKeyframes',\n type: 'processStyles',\n plugin(_ctx, styles) {\n return _hoistKeyframes(styles, styles);\n },\n};\n","import { isPlainObject } from '../util/isPlainObject';\nimport type { StylixPlugin } from './index';\n\nexport function _hoistLayers(styles: any, root: any) {\n for (const key in styles) {\n const value = styles[key];\n if (typeof value === 'string' && key.startsWith('@layer')) {\n // Add layer rules as-is directly to root object\n root['@layer'] ||= [];\n root['@layer'].push(value.replace('@layer', '').trim());\n if (styles !== root) delete styles[key];\n } else if (isPlainObject(value)) {\n // Recursively flatten nested styles\n _hoistLayers(value, root);\n }\n }\n return styles;\n}\n\n/**\n * Hoists @layer declarations to root of styles object.\n */\nexport const hoistLayers: StylixPlugin = {\n name: 'hoistLayers',\n type: 'processStyles',\n plugin(_ctx, styles) {\n if (styles && typeof styles === 'object' && !Array.isArray(styles)) styles['@layer'] = [];\n return _hoistLayers(styles, styles);\n },\n};\n","import { isStyleProp } from '../classifyProps';\nimport type { StylixObject, StylixStyles } from '../index';\nimport type { StylixPlugin, StylixPluginFunctionContext } from './index';\n\ntype OpaqueMediaStyles = { __opaqueMediaStyles: true };\n\nexport type StylixMediaValue = {\n [key: string]: OpaqueMediaStyles | StylixMediaValue;\n};\n\ntype StylixMediaFunc = (styles: OpaqueMediaStyles) => StylixMediaValue;\n\nexport type StylixMediaDefinition = Record<string, StylixMediaFunc>;\n\n/**\n * Expands media objects using the media definitions from the Stylix context.\n */\nexport const mediaObjects: StylixPlugin = {\n name: 'mediaObjects',\n type: 'processStyles',\n plugin: mediaObjectsPlugin,\n};\n\nfunction mediaObjectsPlugin(ctx: StylixPluginFunctionContext, styles: StylixStyles): StylixObject {\n if (!ctx.media) return styles as StylixObject;\n return processMediaStyles(ctx.media, ctx.styleProps, styles);\n}\n\nexport function processMediaStyles(\n mediaDef: StylixMediaDefinition,\n styleProps: Record<string, string>,\n styles: any,\n): any {\n if (!styles || typeof styles !== 'object') return styles;\n\n // If styles is an array, just recursively map it\n if (Array.isArray(styles)) {\n return styles.map((style: any) => processMediaStyles(mediaDef, styleProps, style));\n }\n\n mediaDef.default ||= (styles: any) => styles;\n\n const result = { default: [] } as Record<string, any[]>;\n\n for (const styleKey in styles) {\n const styleValue = styles[styleKey];\n\n if (isStyleProp(styleKey, styleProps)) {\n if (typeof styleValue !== 'object') {\n // Regular style prop\n result.default.push({ [styleKey]: styleValue });\n continue;\n }\n\n // An object for a style prop is definitely a media object\n for (const mediaKey in styleValue) {\n result[mediaKey] ||= [];\n\n // mediaKey corresponds to a media definition\n if (mediaKey in mediaDef) {\n result[mediaKey].push(\n mediaDef[mediaKey]({\n // process recursively\n [styleKey]: processMediaStyles(mediaDef, styleProps, styleValue[mediaKey]),\n } as OpaqueMediaStyles),\n );\n }\n\n // mediaKey does not correspond to a media definition, it must be a @media or @container rule\n else {\n result[mediaKey].push({\n [mediaKey]: {\n [styleKey]: processMediaStyles(mediaDef, styleProps, styleValue[mediaKey]),\n },\n });\n }\n }\n continue;\n }\n\n if (styleKey in mediaDef) {\n result[styleKey] ||= [];\n result[styleKey].push(\n mediaDef[styleKey](\n // process recursively\n processMediaStyles(mediaDef, styleProps, styleValue),\n ),\n );\n continue;\n }\n\n // Key is a selector, just process recursively and add to plain styles\n result.default.push({ [styleKey]: processMediaStyles(mediaDef, styleProps, styleValue) });\n }\n\n const results = Object.values(result);\n return results.length === 1 ? results[0] : results.length === 0 ? null : results;\n}\n","import type { StylixPlugin } from './index';\n\n/**\n * Merges arrays into flat objects, recursively throughout the styles object.\n */\nexport const mergeArrays: StylixPlugin = {\n name: 'mergeArrays',\n type: 'processStyles',\n plugin: (_ctx, styles) => reduceArrays(styles),\n};\n\nexport function reduceArrays(obj: any) {\n return _reduceArrays(obj);\n}\n\nexport function _reduceArrays(obj: any, target: any = {}) {\n if (!obj || typeof obj !== 'object') return obj;\n\n if (Array.isArray(obj)) {\n for (const item of obj) {\n if (!item || typeof item !== 'object') continue;\n _reduceArrays(item, target);\n }\n return target;\n }\n\n for (const key in obj) {\n const value = obj[key];\n\n // If target[key] is an object\n if (target[key] && typeof target[key] === 'object') {\n // If value is an object, merge them\n if (value && typeof value === 'object') {\n _reduceArrays(value, target[key]);\n }\n // If value is not undefined, replace target[key]\n else if (value !== undefined) {\n target[key] = value;\n }\n // otherwise do nothing, keep target[key] as is\n }\n // If target[key] is not an object, process normally\n else {\n target[key] = _reduceArrays(value, {});\n }\n }\n return target;\n}\n","import { isPlainObject } from '../util/isPlainObject';\nimport type { StylixPlugin } from './index';\n\n/**\n * Removes null, undefined, and empty string values from style objects.\n */\nexport const prepareStyles: StylixPlugin = {\n name: 'prepareStyles',\n type: 'preprocessStyles',\n plugin(_ctx, styles) {\n while (Array.isArray(styles) && styles.length === 1) styles = styles[0];\n if (Array.isArray(styles) && !styles.length) return null;\n if (isPlainObject(styles) && Object.values(styles).every((v) => v === undefined)) return null;\n return styles;\n },\n};\n","import { isStyleProp } from '../classifyProps';\nimport { type MapObjectFunction, mapObject } from '../util/mapObject';\nimport type { StylixPlugin, StylixPluginFunctionContext } from './index';\n\n/**\n * Fixes casing and hyphenation on known style props\n */\nexport const propCasing: StylixPlugin = {\n name: 'propCasing',\n type: 'processStyles',\n plugin(ctx, styles) {\n return mapObject(styles, propCasingMap, { ctx });\n },\n};\n\nconst propCasingMap: MapObjectFunction<{ ctx: StylixPluginFunctionContext }> = (\n key,\n value,\n target,\n context,\n mapRecursive,\n) => {\n if (typeof key !== 'string' || key === '&') {\n target[key] = mapRecursive(value);\n return;\n }\n\n const simpleKey = isStyleProp(key, context.ctx.styleProps);\n if (simpleKey) {\n target[context.ctx.styleProps[simpleKey]] = mapRecursive(value);\n return;\n }\n\n target[key] = mapRecursive(value);\n};\n","import { type MapObjectFunction, mapObject } from '../util/mapObject';\nimport type { StylixPlugin, StylixPluginFunctionContext } from './index';\n\n/**\n * Replaces $$class with class name in string values\n */\nexport const replace$$class: StylixPlugin = {\n name: 'replace$$class',\n type: 'processStyles',\n plugin(ctx, styles) {\n return mapObject(styles, replace$$classMap, { ctx });\n },\n};\n\nconst replace$$classMap: MapObjectFunction<{ ctx: StylixPluginFunctionContext }> = (\n key,\n value,\n target,\n context,\n mapRecursive,\n) => {\n value =\n typeof value === 'string'\n ? value.replaceAll('$$class', context.ctx.className || '')\n : mapRecursive(value);\n key = typeof key === 'string' ? key.replaceAll('$$class', context.ctx.className || '') : key;\n target[key] = value;\n};\n","import { isValidJSXProp, simplifyStylePropName } from '../classifyProps';\nimport type { StylixStyles } from '../types';\nimport { isPlainObject } from '../util/isPlainObject';\nimport { mapObject } from '../util/mapObject';\nimport type { StylixPlugin } from './index';\n\nexport function _customPropsProcess(styles: StylixStyles, customProps: Record<string, any>): any {\n if (typeof styles !== 'object' || styles === null) return styles;\n return mapObject(styles, (key, value, target, _ctx, mapRecursive) => {\n if (!isValidJSXProp(key) || isPlainObject(value)) {\n target[key] = mapRecursive(value);\n return;\n }\n\n const simpleKey = simplifyStylePropName(key);\n const propValue = customProps[simpleKey];\n\n if (propValue && typeof propValue === 'object') {\n // For object, merge the mapped value into target if original prop value is truthy\n if (value) {\n const mappedValue = mapRecursive(propValue);\n Object.assign(target, mappedValue);\n }\n } else if (typeof propValue === 'string') {\n // For string, just remap the prop name\n target[propValue] = mapRecursive(value);\n } else if (typeof propValue === 'function') {\n // For function, call it with the original value and merge the result\n const mappedValue = mapRecursive(propValue(value));\n Object.assign(target, mappedValue);\n } else {\n // Unknown type, just keep original\n target[key] = mapRecursive(value);\n }\n });\n}\n\nexport const customProps = (customProps: Record<string, any>): StylixPlugin[] => {\n for (const key in customProps) {\n customProps[simplifyStylePropName(key)] = customProps[key];\n }\n\n return [\n {\n name: 'customPropsInit',\n type: 'initialize',\n plugin(ctx) {\n for (const key in customProps) {\n ctx.styleProps[simplifyStylePropName(key)] = key;\n }\n },\n },\n {\n name: 'customPropsProcess',\n type: 'processStyles',\n before: 'mergeArrays',\n plugin(_ctx, styles) {\n return _customPropsProcess(styles, customProps);\n },\n },\n ];\n};\n","import type { StylixContext } from '../stylixContext';\nimport type { StylixStyles } from '../types';\nimport { cleanStyles } from './cleanStyles';\nimport { defaultPixelUnits } from './defaultUnits';\nimport { hoistKeyframes } from './hoistKeyframes';\nimport { hoistLayers } from './hoistLayers';\nimport { mediaObjects } from './mediaObjects';\nimport { mergeArrays } from './mergeArrays';\nimport { prepareStyles } from './prepareStyles';\nimport { propCasing } from './propCasing';\nimport { replace$$class } from './replace$$class';\n\n/**\n * Stylix plugin function context object\n */\nexport type StylixPluginFunctionContext = Pick<\n StylixContext,\n 'id' | 'devMode' | 'media' | 'stylesheet' | 'styleElement' | 'styleProps'\n> & { className: string | null };\n\n/**\n * Stylix plugin interface\n */\nexport type StylixPlugin = {\n name: string;\n before?: string;\n after?: string;\n atIndex?: number;\n} & (\n | {\n name: string;\n type: 'initialize';\n plugin(ctx: StylixPluginFunctionContext): void;\n }\n | {\n type: 'processStyles' | 'preprocessStyles';\n plugin(ctx: StylixPluginFunctionContext, styles: StylixStyles): StylixStyles;\n }\n);\n\nexport function applyPlugins(\n type: 'initialize',\n styles: null,\n className: null,\n context: StylixContext,\n): void;\n\nexport function applyPlugins(\n type: 'processStyles' | 'preprocessStyles',\n styles: StylixStyles,\n className: string | null,\n context: StylixContext,\n): StylixStyles;\n\nexport function applyPlugins(\n type: StylixPlugin['type'],\n styles: StylixStyles | null,\n className: string | null,\n context: StylixContext,\n): StylixStyles {\n const pluginContext: StylixPluginFunctionContext = {\n id: context.id,\n devMode: context.devMode,\n media: context.media,\n stylesheet: context.stylesheet,\n styleElement: context.styleElement,\n styleProps: context.styleProps,\n className,\n };\n\n let processedStyles: StylixStyles = styles || {};\n for (const i in context.plugins) {\n const plugin = context.plugins[i];\n if (plugin.type === type)\n processedStyles = plugin.plugin(pluginContext, processedStyles) as StylixStyles;\n }\n return processedStyles;\n}\n\nexport { customProps } from './customProps';\n\nexport const defaultPlugins: StylixPlugin[] = [\n prepareStyles,\n mediaObjects,\n mergeArrays,\n propCasing,\n hoistKeyframes,\n hoistLayers,\n replace$$class,\n defaultPixelUnits,\n cleanStyles,\n];\n","import type { HTMLProps } from './elements';\n\nexport function StyleElement(props: { styles: string[] } & Partial<HTMLProps<'style'>>) {\n const { styles, ...other } = props;\n return (\n <style type=\"text/css\" {...other} dangerouslySetInnerHTML={{ __html: styles.join('\\n') }} />\n );\n}\n","import type React from 'react';\nimport { createContext } from 'react';\n\nimport { StyleElement } from './StyleElement';\n\nexport interface StyleCollector {\n collect: (element: React.ReactElement) => React.ReactElement;\n render: React.FC<React.ComponentProps<'style'>>;\n styles: string[];\n}\n\nexport const styleCollectorContext = createContext<string[] | undefined>(undefined);\n\nexport function createStyleCollector() {\n const styles: string[] = [];\n const collector: StyleCollector = {\n collect: (element) => (\n <styleCollectorContext.Provider value={styles}>{element}</styleCollectorContext.Provider>\n ),\n render: (props: React.ComponentProps<'style'>) => (\n <StyleElement key={props.id || 'stylix'} styles={collector.styles} />\n ),\n styles,\n };\n collector.render.displayName = 'StylixStyleCollectorRenderer';\n return collector;\n}\n","import React from 'react';\n\nexport function getParentComponentName(): string | undefined {\n const internals = (React as any).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n const stack = internals?.ReactDebugCurrentFrame?.getStackAddendum?.()?.split('\\n') || [];\n for (const line of stack) {\n // Look for a component name like \"Component$123\", either at the start of the line (Firefox) or after \"at \" (Safari/Chrome)\n const m = line.trim().match(/^(?:at )?([A-Z][A-Za-z0-9$.]*)/);\n const res = m?.[1] && m[1] !== 'Stylix' ? m[1] : undefined;\n if (res) return res;\n }\n}\n","import { applyPlugins } from './plugins';\nimport type { StylixContext } from './stylixContext';\nimport type { StylixObject } from './types';\nimport { isEmpty } from './util/isEmpty';\nimport { isPlainObject } from './util/isPlainObject';\n\n/**\n * Serialize selector and styles to css rule string\n */\nfunction serialize(selector: string, styles: StylixObject) {\n if (selector.startsWith('@') && Array.isArray(styles)) {\n return `${selector} ${styles.join(', ')};`;\n }\n const lines: string[] = [];\n for (const key in styles) {\n const value = styles[key];\n if (isPlainObject(value)) lines.push(serialize(key, value));\n else lines.push(` ${key}: ${value};`);\n }\n return `${selector} {\\n${lines.join('\\n')} }`;\n}\n\n/**\n * Converts a Stylix CSS object to an array of rules, suitable for passing to StyleSheet#insertRule.\n */\nexport default function stylesToRuleArray(\n styles: StylixObject,\n className: string,\n context: StylixContext,\n): string[] {\n if (isEmpty(styles)) return [];\n try {\n const processedStyles = applyPlugins(\n 'processStyles',\n styles,\n className,\n context,\n ) as StylixObject;\n\n const result: string[] = [];\n\n // Handle @layer rules first\n if (processedStyles['@layer']) {\n result.push(serialize('@layer', processedStyles['@layer'] as StylixObject));\n delete processedStyles['@layer'];\n }\n for (const key in processedStyles) {\n const value = processedStyles[key] as StylixObject;\n result.push(serialize(key, value));\n }\n return result;\n } catch (e: any) {\n if (e.name && e.reason) {\n console.error(\n `${e.name}: ${e.reason}\\n`,\n `${e.source.replace('\\n', ' ').substring(Math.max(0, e.column - 20), Math.max(0, e.column - 20) + 100)}\\n`,\n `${' '.repeat(20)}^`,\n );\n } else {\n console.error(e);\n }\n return [];\n }\n}\n","import { useInsertionEffect, useRef } from 'react';\nimport applyRules from './applyRules';\nimport { getParentComponentName } from './getParentComponentName';\nimport { applyPlugins } from './plugins';\nimport stylesToRuleArray from './stylesToRuleArray';\nimport { type StylixContext, useStylixContext } from './stylixContext';\nimport type { StylixObject, StylixStyles } from './types';\nimport { isEmpty } from './util/isEmpty';\n\nfunction cleanup(ctx: StylixContext): void {\n if (typeof ctx.cleanupRequest !== 'undefined') return;\n\n const doCleanup = () => {\n for (const i in ctx.rules) {\n const rule = ctx.rules[i];\n if (!rule || rule.refs <= 0) {\n delete ctx.rules[i];\n }\n }\n ctx.cleanupRequest = undefined;\n };\n\n if (ctx.devMode) {\n doCleanup();\n } else {\n ctx.cleanupRequest = setTimeout(doCleanup, 100) as any;\n }\n}\n\nexport function createStyles(config: {\n stylixCtx: StylixContext;\n key?: string;\n styles: StylixStyles;\n global?: boolean;\n debugLabel?: string;\n}): { className: string; key: string } {\n const { stylixCtx, global } = config;\n let styles = config.styles;\n const priorKey = config.key || '';\n\n let stylesKey = '';\n if (styles && !isEmpty(styles)) {\n // Preprocess styles with plugins\n styles = applyPlugins('preprocessStyles', styles, null, stylixCtx);\n // Generate styles key\n stylesKey = styles ? (global ? 'global:' : '') + JSON.stringify(styles) : '';\n }\n\n if (stylesKey && !stylixCtx.rules[stylesKey]) {\n stylixCtx.styleCounter++;\n const debugLabel = config.debugLabel || (stylixCtx.devMode && getParentComponentName()) || '';\n const className = `stylix-${(stylixCtx.styleCounter).toString(36)}${debugLabel ? `-${debugLabel}` : ''}`;\n // If not global styles, wrap original styles with classname\n if (!global) styles = { [`.${className}`]: styles };\n stylixCtx.rules[stylesKey] = {\n className,\n rules: stylesToRuleArray(styles as StylixObject, className, stylixCtx),\n refs: 0,\n };\n }\n\n const isChanged = stylesKey !== priorKey;\n const ruleSet = stylesKey ? stylixCtx.rules[stylesKey] : null;\n\n if (isChanged) {\n // Mark styles to be applied\n stylixCtx.requestApply = true;\n\n // When json changes, add/remove ref count\n const priorRuleSet = priorKey ? stylixCtx.rules[priorKey] : null;\n if (priorRuleSet) priorRuleSet.refs--;\n if (ruleSet) ruleSet.refs++;\n }\n\n return {\n className: ruleSet?.className || '',\n key: stylesKey,\n };\n}\n\n/**\n * Accepts a Stylix CSS object and returns a unique className.\n * The styles are registered with the Stylix context and will be applied to the document.\n * If `global` is false, provided styles will be nested within the generated classname.\n * Returns the className if enabled, or an empty string.\n */\nexport function useStyles(\n styles: StylixStyles,\n options: { global?: boolean; debugLabel?: string } = { global: false },\n): string {\n const stylixCtx = useStylixContext();\n\n const prevStylesKey = useRef('');\n\n const s = createStyles({\n stylixCtx,\n styles,\n global: options.global,\n debugLabel: options.debugLabel,\n key: prevStylesKey.current,\n });\n\n prevStylesKey.current = s.key;\n\n // Apply styles if requested.\n // This runs on every render. We utilize useInsertionEffect so that it runs *after* all the other\n // renders have completed. stylixCtx.requestApply guards against multiple runs. This reduces the number of calls\n // to applyRules(), but prevents styles potentially being added to the DOM after other components force the\n // browser to compute styles.\n // biome-ignore lint/correctness/useExhaustiveDependencies: stylixCtx is stable\n useInsertionEffect(() => {\n if (!stylixCtx.requestApply) return;\n stylixCtx.requestApply = false;\n applyRules(stylixCtx);\n\n return () => {\n cleanup(stylixCtx);\n };\n }, [s.key]);\n\n return s.className;\n}\n\nexport function useKeyframes(keyframes: any) {\n return useStyles({ '@keyframes $$class': keyframes }, { global: true });\n}\n\nexport function useGlobalStyles(\n styles: StylixStyles,\n options: { disabled?: boolean } = { disabled: false },\n) {\n return useStyles(styles, { ...options, global: true });\n}\n","import { useLayoutEffect } from 'react';\n\nexport const detectSSR = () =>\n !(typeof window !== 'undefined' && window.document?.head?.appendChild);\n\nexport default function useIsoLayoutEffect(\n fn: () => void | (() => void),\n deps?: unknown[],\n runOnSsr?: boolean,\n isSsr = detectSSR(),\n) {\n if (isSsr) {\n if (runOnSsr) return fn();\n } else {\n // biome-ignore lint/correctness/useHookAtTopLevel: isSsr should never change\n // biome-ignore lint/correctness/useExhaustiveDependencies: dependencies are passed as-is\n useLayoutEffect(fn, deps);\n }\n}\n","import type React from 'react';\nimport { createContext, useContext, useEffect, useRef } from 'react';\nimport applyRules from './applyRules';\nimport { classifyProps, simplifyStylePropName } from './classifyProps';\nimport cssProps from './css-props.json';\nimport { applyPlugins, defaultPlugins, type StylixPlugin } from './plugins';\nimport type { StylixMediaDefinition } from './plugins/mediaObjects';\nimport { styleCollectorContext } from './styleCollector';\nimport type { StylixStyles } from './types';\nimport { createStyles } from './useStyles';\nimport { detectSSR } from './util/useIsoLayoutEffect';\n\n/**\n * Stylix context\n *\n * A Stylix context represents an \"instance\" of Stylix - a configuration, set of plugins, and reference to\n * the <style> element where css is output.\n *\n * A <StylixProvider> creates a context instance and provides it via React context to its descendent elements.\n * All nodes contained within a <StylixProvider> element will share this context.\n */\n\n/**\n * The Stylix context object.\n */\nexport type StylixContext = {\n id: string;\n devMode: boolean;\n media: StylixMediaDefinition | undefined;\n plugins: StylixPlugin[];\n stylesheet?: CSSStyleSheet;\n styleElement?: HTMLStyleElement;\n styleCollector?: string[];\n styleCounter: number;\n rules: {\n [key: string]:\n | undefined\n | {\n className: string;\n rules: string[];\n refs: number;\n };\n };\n styleProps: Record<string, string>;\n ssr?: boolean;\n cleanupRequest?: number;\n requestApply: boolean;\n\n classifyProps(props: Record<string, unknown>): [Record<string, unknown>, Record<string, unknown>];\n styles(styles: StylixStyles, config?: { global: boolean }): string;\n};\n\n/**\n * Default style props mapping. This will be populated on the first call to createStylixContext.\n */\nlet defaultStyleProps: Record<string, string> | undefined;\n\n/**\n * Configuration options for creating a Stylix context.\n */\ntype CreateStylixContextConfig = {\n id?: string;\n devMode?: boolean;\n plugins?: StylixPlugin[] | StylixPlugin[][];\n styleElement?: HTMLStyleElement;\n media?: StylixMediaDefinition;\n ssr?: boolean;\n};\n\nexport function createStylixContext(userValues: CreateStylixContextConfig = {}): StylixContext {\n if (!defaultStyleProps) {\n defaultStyleProps = {};\n for (const value of cssProps) {\n defaultStyleProps[simplifyStylePropName(value)] = value;\n }\n }\n\n const ctx: StylixContext = {\n id: userValues.id || '$default',\n devMode: !!userValues.devMode,\n styleProps: defaultStyleProps,\n media: userValues.media,\n styleElement: userValues.styleElement,\n plugins: defaultPlugins.flat(),\n styleCounter: 0,\n rules: {},\n ssr: userValues.ssr ?? detectSSR(),\n cleanupRequest: undefined,\n requestApply: false,\n\n classifyProps(props: Record<string, unknown>) {\n const [styles, other] = classifyProps(props, this.styleProps);\n return [styles, other];\n },\n\n styles(styles: StylixStyles, config?: { global: boolean }): string {\n const s = createStyles({\n stylixCtx: ctx,\n styles,\n global: config?.global || false,\n });\n applyRules(ctx);\n return s.className;\n },\n };\n\n if (userValues.plugins?.length) {\n const flatPlugins = userValues.plugins.flat();\n for (const i in flatPlugins) {\n const plugin = flatPlugins[i];\n let pluginIndex = -1;\n if (plugin.before) pluginIndex = ctx.plugins.findIndex((v) => v.name === plugin.before);\n else if (plugin.after) {\n pluginIndex = ctx.plugins.findIndex((v) => v.name === plugin.before);\n if (pluginIndex !== -1) pluginIndex += 1;\n } else if (plugin.atIndex !== undefined) pluginIndex = plugin.atIndex;\n\n if (pluginIndex === -1) ctx.plugins.push(plugin);\n else ctx.plugins.splice(pluginIndex, 0, plugin);\n }\n }\n applyPlugins('initialize', null, null, ctx);\n\n return ctx;\n}\n\n/**\n * The React context object for Stylix.\n */\nconst stylixContext = createContext<StylixContext | undefined>(undefined);\n\n/**\n * Default Stylix context, used when no provider is present.\n */\nlet defaultStylixContext: StylixContext | undefined;\n\n/**\n * React hook that gets the current Stylix context.\n */\nexport function useStylixContext(): StylixContext {\n const ctx = useContext(stylixContext);\n if (!ctx) {\n if (!defaultStylixContext) defaultStylixContext = createStylixContext();\n return defaultStylixContext;\n }\n return ctx;\n}\n\n/**\n * Props for StylixProvider when passing an existing context.\n */\ntype StylixProviderPropsWithContext = {\n context: StylixContext;\n};\n\n/**\n * Props for StylixProvider when creating a new context.\n */\ntype StylixProviderPropsWithConfig = {\n id?: string;\n devMode?: boolean;\n plugins?: StylixPlugin[] | StylixPlugin[][];\n styleElement?: HTMLStyleElement;\n media?: StylixMediaDefinition;\n ssr?: boolean;\n children: any;\n};\n\n/**\n * Props for the StylixProvider component.\n */\ntype StylixProviderProps = StylixProviderPropsWithContext | StylixProviderPropsWithConfig;\n\n/**\n * StylixProvider component. Provides a Stylix context to its descendent elements.\n * Can either accept an existing context via the `context` prop, or create a new context\n * using the other configuration props.\n */\nexport function StylixProvider(props: StylixProviderProps): React.ReactElement {\n const { context, id, devMode, plugins, media, styleElement, children, ssr } =\n props as StylixProviderPropsWithContext & StylixProviderPropsWithConfig;\n\n const ctx = useRef(context);\n if (!ctx.current)\n ctx.current = createStylixContext({\n id,\n devMode,\n plugins,\n media,\n styleElement,\n ssr,\n });\n\n ctx.current.styleCollector = useContext(styleCollectorContext);\n\n // When the component is unmounted, remove the style element, if any\n useEffect(() => {\n return () => {\n ctx.current?.styleElement?.remove();\n };\n }, []);\n\n return <stylixContext.Provider value={ctx.current}>{children}</stylixContext.Provider>;\n}\n","import React from 'react';\nimport type { IntrinsicElements } from './elements';\nimport { useStylixContext } from './stylixContext';\nimport type { Extends, StylixProps, StylixStyles } from './types';\nimport { useStyles } from './useStyles';\nimport { isEmpty } from './util/isEmpty';\n\n/**\n * Additional properties on the Stylix ($) component and its html component properties (`<$.div>`, etc).\n */\nexport type StylixComponentMeta = {\n displayName?: string;\n __isStylix: true;\n};\n\n/**\n * Defines the static meta properties and the HTML elements on the `$` object ($.div, $.span, etc).\n */\ntype Stylix$ComponentExtras = StylixComponentMeta & {\n [key in IntrinsicElements]: React.FC<\n Extends<React.JSX.IntrinsicElements[key], StylixProps> & {\n htmlContent?: string;\n htmlTranslate?: 'yes' | 'no';\n }\n >;\n};\n\nexport type StylixRenderFn<TProps = any> = (\n className: string | undefined,\n props: TProps,\n) => React.ReactNode;\n\n/**\n * The props for the Stylix ($) component when using the $render prop.\n */\ntype Stylix$renderProp = StylixProps &\n Record<string, unknown> & {\n $el?: never;\n $render: StylixRenderFn;\n children?: never;\n };\n\n/**\n * The props for the Stylix ($) component when using the $el prop as a component, intrinsic element tag, or rendered element.\n */\ntype Stylix$elAsComponentProp = StylixProps &\n Record<string, unknown> & {\n $el: React.ReactElement | React.ComponentType<any> | IntrinsicElements;\n $render?: never;\n children?: React.ReactNode | React.ReactNode[];\n };\n\n/**\n * Internal props type for the Stylix ($) component where actual types are unknown.\n */\ntype InternalStylix$Props = {\n $el?: React.ReactElement | React.ComponentType<any> | IntrinsicElements;\n $render?: StylixRenderFn;\n children?: React.ReactNode | React.ReactNode[];\n $css?: StylixProps['$css'];\n className?: string;\n};\n\ntype Stylix$props = Stylix$elAsComponentProp | Stylix$renderProp;\n\n/**\n * Type of main Stylix component ($).\n */\nexport type Stylix$Component = Stylix$ComponentExtras & ((props: Stylix$props) => React.ReactNode);\n\nexport function _Stylix<TElement extends React.ElementType>(\n props: InternalStylix$Props,\n ref: React.Ref<TElement>,\n) {\n const { $el, $render, $css, className: outerClassName, children, ...rest } = props;\n\n const ctx = useStylixContext();\n const [styleProps, otherProps] = ctx.classifyProps(rest);\n\n let styles: StylixStyles = [];\n if (!isEmpty(styleProps)) styles.push(styleProps);\n if (!isEmpty($css)) styles.push($css);\n if (styles.length === 1 && styles[0]) styles = styles[0];\n const stylixClassName = useStyles(styles);\n\n const className = `${stylixClassName} ${outerClassName || ''}`.trim() || undefined;\n\n if (React.isValidElement($el)) {\n const $elProps = {\n ...($el.props as any),\n ref: ('ref' in $el && $el.ref) || ref,\n /**\n * `allProps` must override `$el.props` because the latter may contain default prop values provided by defaultProps.\n * The expectation is that for <$ $el={<SomeComponent />} someComponentProp=\"my value\" />,\n * the `someComponentProp` prop would override any default value specified by SomeComponent.defaultProps.\n */\n ...otherProps,\n className: `${($el.props as any).className || ''} ${className || ''}`.trim() || undefined,\n };\n return React.cloneElement(\n $el,\n $elProps,\n ...(React.Children.toArray(children as React.ReactNode) || []),\n );\n }\n\n if ($el) {\n const Component = $el as React.FC<any>;\n return (\n <Component className={className} ref={ref} {...otherProps}>\n {children}\n </Component>\n );\n }\n\n if ($render) {\n return $render(className || undefined, { children, ...otherProps, ...(ref ? { ref } : null) });\n }\n\n throw new Error('Stylix: invalid stylix component usage: must provide $el or $render prop.');\n}\n\nexport const Stylix: Stylix$Component = React.forwardRef(\n _Stylix as any,\n) as unknown as Stylix$Component;\nStylix.displayName = 'Stylix';\nStylix.__isStylix = true;\n","import React from 'react';\nimport { Stylix } from './Stylix';\n\nconst htmlTags = [\n 'a',\n 'abbr',\n 'address',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'bdi',\n 'bdo',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'data',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'embed',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'i',\n 'iframe',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'main',\n 'map',\n 'mark',\n 'menu',\n 'menuitem',\n 'meter',\n 'nav',\n 'noscript',\n 'object',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'section',\n 'select',\n 'slot',\n 'small',\n 'source',\n 'span',\n 'strong',\n 'sub',\n 'summary',\n 'sup',\n 'svg',\n 'table',\n 'tbody',\n 'td',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'tr',\n 'track',\n 'u',\n 'ul',\n 'var',\n 'video',\n] as const;\n\nexport type IntrinsicElements = (typeof htmlTags)[number];\n\n/**\n * Gets the props of a given HTML tag.\n */\nexport type HTMLProps<TTag extends keyof React.JSX.IntrinsicElements> =\n React.JSX.IntrinsicElements[TTag];\n\nfor (const i in htmlTags) {\n const Tag: any = htmlTags[i];\n (Stylix as any)[Tag] = React.forwardRef(({ htmlContent, htmlTranslate, ...props }: any, ref) => (\n <Stylix\n $render={(className: string, props: object) => (\n <Tag\n className={className}\n content={htmlContent}\n translate={htmlTranslate}\n ref={ref}\n {...props}\n />\n )}\n {...props}\n />\n ));\n (Stylix as any)[Tag].__isStylix = true;\n (Stylix as any)[Tag].displayName = `$.${Tag}`;\n}\n","import { flattenRules } from './applyRules';\nimport type { HTMLProps } from './elements';\nimport { StyleElement } from './StyleElement';\nimport { useStylixContext } from './stylixContext';\n\nexport function RenderServerStyles(props: Partial<HTMLProps<'style'>>) {\n const ctx = useStylixContext();\n return <StyleElement styles={ctx.ssr ? flattenRules(ctx) : []} {...props} />;\n}\n","type ClassNamePrimitive = string | number | boolean | null | undefined;\ntype ClassName =\n | ClassNamePrimitive\n | ClassName[]\n | { [key: string]: ClassNamePrimitive }\n | (() => ClassName);\n\n// Internal helper to collect class name parts without joining\nfunction cxArray(args: ClassName[]): string[] {\n const classNames: string[] = [];\n for (const arg of args) {\n if (arg && typeof arg === 'string') {\n classNames.push(arg);\n } else if (Array.isArray(arg)) {\n classNames.push(...cxArray(arg));\n } else if (typeof arg === 'function') {\n classNames.push(...cxArray([arg()]));\n } else if (typeof arg === 'object' && arg !== null) {\n for (const [key, value] of Object.entries(arg)) {\n if (value) {\n classNames.push(key);\n }\n }\n }\n }\n return classNames;\n}\n\n/**\n * A utility function to create a string of class names based on the provided parameters.\n * Accepts a variable number of arguments, each of which can be one of the following:\n *\n * - A string, which will be included in the class name string.\n * - An object, where the keys are class names and the values are booleans indicating whether to include the class name.\n * - An array of strings or objects, which will be flattened and processed as above.\n * - A function that returns a string, object, or array, which will be processed as above.\n * - Any other value will be ignored.\n */\nexport function cx(...args: ClassName[]): string {\n return cxArray(args).join(' ');\n}\n"],"names":["_jsx"],"mappings":";;;AAEM,SAAU,YAAY,CAAC,GAAkB,EAAA;AAC7C,IAAA,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK;SAC3B,OAAO,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC;SACvD,MAAM,CAAC,OAAO,CAAC;AACpB;AAEA;;AAEG;AACW,SAAU,UAAU,CAAC,GAAkB,EAAA;AACnD,IAAA,IAAI,GAAG,CAAC,cAAc,EAAE;AACtB,QAAA,MAAM,cAAc,GAAG,YAAY,CAAC,GAAG,CAAC;AACxC,QAAA,GAAG,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC;QAC7B,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC;QAC1C;IACF;IAEA,IAAI,GAAG,CAAC,GAAG;QAAE;AAEb,I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AAE,CAAC,GAAG,IAAiB,EAAA;IACrC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AAChC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/applyRules.ts","../src/classifyProps.ts","../src/util/isEmpty.ts","../src/util/isPlainObject.ts","../src/plugins/cleanStyles.ts","../src/util/mapObject.ts","../src/plugins/defaultUnits.ts","../src/plugins/hoistKeyframes.ts","../src/plugins/hoistLayers.ts","../src/plugins/mediaObjects.ts","../src/plugins/mergeArrays.ts","../src/plugins/prepareStyles.ts","../src/plugins/propCasing.ts","../src/plugins/replace$$class.ts","../src/plugins/customProps.ts","../src/plugins/index.ts","../src/StyleElement.tsx","../src/styleCollector.tsx","../src/getParentComponentName.ts","../src/stylesToRuleArray.ts","../src/useStyles.ts","../src/util/useIsoLayoutEffect.ts","../src/stylixContext.tsx","../src/Stylix.tsx","../src/elements.tsx","../src/RenderServerStyles.tsx","../src/util/cx.ts"],"sourcesContent":["import type { StylixContext } from './stylixContext';\n\nexport function flattenRules(ctx: StylixContext): string[] {\n return Object.values(ctx.rules)\n .flatMap((val) => (val && val.refs > 0 ? val.rules : []))\n .filter(Boolean);\n}\n\n/**\n * Applies rules from given StylixContext to the <style> element.\n */\nexport default function applyRules(ctx: StylixContext): void {\n if (ctx.styleCollector) {\n const flattenedRules = flattenRules(ctx);\n ctx.styleCollector.length = 0;\n ctx.styleCollector.push(...flattenedRules);\n return;\n }\n\n if (ctx.ssr) return;\n\n const supportsAdoptedStylesheets = 'adoptedStyleSheets' in document;\n\n // If there's no style element, and we're in dev mode, create one\n if (!ctx.styleElement && (ctx.devMode || !supportsAdoptedStylesheets)) {\n ctx.styleElement = document.createElement('style');\n ctx.styleElement.className = 'stylix';\n if (ctx.id) ctx.styleElement.id = `${ctx.id}-styles`;\n document.head.appendChild(ctx.styleElement);\n }\n\n if (ctx.styleElement) {\n // If there's a style element, use it\n const flattenedRules = flattenRules(ctx);\n console.log('applyRules', flattenedRules.length);\n ctx.styleElement.innerHTML = flattenedRules.join('\\n');\n } else {\n // Still no stylesheet yet, create one\n if (!ctx.stylesheet) {\n ctx.stylesheet = new CSSStyleSheet();\n if (supportsAdoptedStylesheets) {\n document.adoptedStyleSheets.push(ctx.stylesheet);\n } else if (ctx.stylesheet.ownerNode) {\n document.head.appendChild(ctx.stylesheet.ownerNode);\n }\n }\n\n const stylesheet = ctx.stylesheet;\n\n const flattenedRules = flattenRules(ctx);\n if (stylesheet.replaceSync) {\n try {\n stylesheet.replaceSync(flattenedRules.join('\\n'));\n } catch (e) {\n // Errors are ignored, this just means that a browser doesn't support a certain CSS feature.\n console.warn(e);\n }\n }\n }\n}\n","export function classifyProps(\n props: Record<string, unknown>,\n knownStyleProps: Record<string, string>,\n): [any, any] {\n const styles = {} as any;\n const other = {} as any;\n\n for (const prop in props) {\n // If prop is not a valid JSX prop, it must be a CSS selector.\n // If prop has a style prop name and the value is likely a style value, it's a style prop.\n if (!isValidJSXProp(prop) || isStyleProp(prop, knownStyleProps)) {\n styles[prop] = props[prop];\n } else {\n other[prop] = props[prop];\n }\n }\n\n return [styles, other];\n}\n\n/**\n * Determines if `value` is a recognized CSS property (can be standard CSS or custom Stylix prop).\n * If it is, the simplified prop name is returned. Otherwise, false is returned.\n */\nexport function isStyleProp(\n prop: unknown,\n knownStyleProps: Record<string, string>,\n): string | false {\n if (isValidJSXProp(prop)) {\n const simplified = simplifyStylePropName(prop);\n return simplified in knownStyleProps ? simplified : false;\n }\n return false;\n}\n\nexport function isValidJSXProp(value: unknown): value is string {\n // Not an exact check, but mostly rules out complex css selectors\n return typeof value === 'string' && /^[a-z$][a-z0-9_-]*$/i.test(value);\n}\n\nexport function simplifyStylePropName(value: string) {\n return value.toLowerCase().replace(/[^a-z]/g, '');\n}\n","export function isEmpty(obj: unknown) {\n if (!obj) return true;\n if (Array.isArray(obj)) return obj.length === 0;\n for (const _ in obj) return false;\n if (typeof obj === 'object') return true;\n return false;\n}\n","/**\n * Indicates that an object is most likely just an object literal.\n */\nexport function isPlainObject(value: any): value is Record<string, any> {\n if (!value || typeof value !== 'object') return false;\n return Object.getPrototypeOf(value) === Object.prototype;\n}\n","import { isEmpty } from '../util/isEmpty';\nimport { isPlainObject } from '../util/isPlainObject';\nimport type { StylixPlugin } from './index';\n\nexport function _cleanStyles(object: any): void {\n for (const key in object) {\n const value = object[key];\n if (value === null || value === undefined || value === '' || value === false)\n delete object[key];\n else if (isPlainObject(value) || Array.isArray(value)) {\n _cleanStyles(value);\n if (isEmpty(value)) delete object[key];\n }\n }\n}\n\n/**\n * Removes null, undefined, and empty string values from style objects.\n */\nexport const cleanStyles: StylixPlugin = {\n name: 'cleanStyles',\n type: 'processStyles',\n plugin(_ctx, styles) {\n _cleanStyles(styles);\n return styles;\n },\n};\n","export type ObjectOrArray = unknown[] & Record<string, unknown>;\n\nexport type MapObjectFunction<TContext extends object = object> = (\n key: string | number,\n value: unknown,\n target: ObjectOrArray,\n context: TContext,\n mapRecursive: (value: unknown) => ObjectOrArray,\n) => void;\n\n/**\n * Returns a new object or array, generated by invoking `map` on each key-value pair in `source` and merging the returned value into\n * the result. The return value should be an object or array (to match `source`), or undefined to omit the key-value pair from the result.\n *\n * If `source` is an object, Object.assign() will be used to merge the response into the result object.\n *\n * If `source` is an array, the returned array entries will be pushed onto the result array (i.e. it will be flattened, one level deep).\n *\n * The `map` function will receive the following arguments:\n * - The current key or index\n * - The current value\n * - The current object/array being mapped\n * - A context object. This is a plain object that you can modify as needed. The value will be shallow cloned for each key, and the clone\n * will be passed into the `mapRecursive` method in order to persist it in recursive mapping.\n * - A `mapRecursive` function that can be used to recursively map nested objects or arrays. You can call this by passing the current value,\n * which will run the same mapping function on the value and return the result. If the value is not an object or array, it will just\n * return the value. The mapping function will receive the context object for the current key, and any modifications made to the context\n * object will be persisted into the recursive call. This could be used, for example, to keep track of the current depth of the recursion\n * or the full path of the current value.\n *\n * Example:\n *\n * ```ts\n * const value = {\n * ignoreMe: null,\n * string: 'value',\n * object: {\n * a: 1,\n * b: 2,\n * },\n * array: [1, 2, 3, 4],\n * }\n * const result = mapObjectRecursive(value, (key, value, source, context) => {\n * if (key === 'ignoreMe')\n * return undefined; // will omit key from result\n * if (typeof key === 'string' && typeof value === 'string')\n * return { [key]: value + '-mapped' }; // will append '-mapped' to string values\n * if (typeof key === 'string' && typeof value === 'number')\n * return { [key]: value, [`${key}-mapped`]: value * 2 }; // will add a new key with the value doubled\n * if (typeof value === 'object')\n * return { [key]: value }; // will leave object unchanged\n * if (Array.isArray(source) && typeof value === 'number')\n * return [value, value * 2]; // will add the value and the value doubled to the array\n * });\n * // result:\n * // {\n * // string: 'value-mapped',\n * // object: {\n * // a: 1,\n * // 'a-mapped': 2,\n * // b: 2,\n * // 'b-mapped': 4,\n * // },\n * // array: [1, 2, 2, 4, 3, 6, 4, 8],\n * // }\n * ```\n */\nexport function mapObject<TSource, TContext extends object>(\n source: TSource,\n mapFn: MapObjectFunction<TContext>,\n context?: TContext,\n): TSource {\n if (typeof source !== 'object') return source;\n const target = (Array.isArray(source) ? [] : {}) as ObjectOrArray;\n for (const _key in source) {\n const key: number | string = Array.isArray(source) ? +_key : _key;\n const value = (source as any)[key];\n\n const contextClone = { ...context } as TContext;\n mapFn(key, value, target, contextClone, (value) =>\n mapObject(value as ObjectOrArray, mapFn, contextClone),\n );\n }\n\n return target as TSource;\n}\n","import { type MapObjectFunction, mapObject } from '../util/mapObject';\nimport type { StylixPlugin } from './index';\n\nexport const defaultIgnoreUnits = [\n 'aspect-ratio',\n 'column-count',\n 'columns',\n 'fill-opacity',\n 'flex',\n 'flex-grow',\n 'flex-shrink',\n 'font-weight',\n 'line-height',\n 'opacity',\n 'order',\n 'orphans',\n 'stroke-opacity',\n 'widows',\n 'z-index',\n 'zoom',\n];\n\n/**\n * Adds unit (px, em, etc) to numeric values for any style properties not included in `ignoreProps`.\n */\nexport const defaultUnits = (unit = 'px', ignoreProps = defaultIgnoreUnits): StylixPlugin => {\n return {\n name: 'defaultUnits',\n type: 'processStyles',\n plugin(_ctx, styles) {\n return mapObject(styles, defaultUnitsMap, { unit, ignoreProps });\n },\n };\n};\n\nconst defaultUnitsMap: MapObjectFunction<{ unit: string; ignoreProps: string[] }> = (\n key,\n value,\n target,\n ctx,\n mapRecursive,\n) => {\n if (typeof value === 'number' && !ctx.ignoreProps.includes(key as string)) {\n target[key] = String(value) + ctx.unit;\n return;\n }\n target[key] = mapRecursive(value);\n};\n\nexport const defaultPixelUnits = defaultUnits();\n","import { isPlainObject } from '../util/isPlainObject';\nimport type { StylixPlugin, StylixPluginFunctionContext } from './index';\n\nfunction _hoistKeyframes(styles: any, root: any, ctx: StylixPluginFunctionContext) {\n for (const key in styles) {\n const value = styles[key];\n if (key.startsWith('@keyframes')) {\n // Add keyframe rules as-is directly to root object\n root[key] = value;\n if (styles !== root) delete styles[key];\n }\n if (key.startsWith('@scope')) {\n // Add scopes rules as-is directly to root object\n root[key] = { [`.${ctx.className}`]: value };\n if (styles !== root) delete styles[key];\n } else if (isPlainObject(value)) {\n // Recursively flatten nested styles\n _hoistKeyframes(value, root, ctx);\n }\n }\n return styles;\n}\n\n/**\n * Hoists @keyframe declarations to root of styles object.\n */\nexport const hoistKeyframes: StylixPlugin = {\n name: 'hoistKeyframes',\n type: 'processStyles',\n plugin(_ctx, styles) {\n return _hoistKeyframes(styles, styles, _ctx);\n },\n};\n","import { isPlainObject } from '../util/isPlainObject';\nimport type { StylixPlugin } from './index';\n\nexport function _hoistLayers(styles: any, root: any) {\n for (const key in styles) {\n const value = styles[key];\n if (typeof value === 'string' && key.startsWith('@layer')) {\n // Add layer rules as-is directly to root object\n root['@layer'] ||= [];\n root['@layer'].push(value.replace('@layer', '').trim());\n if (styles !== root) delete styles[key];\n } else if (isPlainObject(value)) {\n // Recursively flatten nested styles\n _hoistLayers(value, root);\n }\n }\n return styles;\n}\n\n/**\n * Hoists @layer declarations to root of styles object.\n */\nexport const hoistLayers: StylixPlugin = {\n name: 'hoistLayers',\n type: 'processStyles',\n plugin(_ctx, styles) {\n if (styles && typeof styles === 'object' && !Array.isArray(styles)) styles['@layer'] = [];\n return _hoistLayers(styles, styles);\n },\n};\n","import { isStyleProp } from '../classifyProps';\nimport type { StylixObject, StylixStyles } from '../index';\nimport type { StylixPlugin, StylixPluginFunctionContext } from './index';\n\ntype OpaqueMediaStyles = { __opaqueMediaStyles: true };\n\ntype StylixMediaFunc = (styles: OpaqueMediaStyles) => StylixStyles;\n\nexport type StylixMediaDefinition = Record<string, StylixMediaFunc>;\n\n/**\n * Expands media objects using the media definitions from the Stylix context.\n */\nexport const mediaObjects: StylixPlugin = {\n name: 'mediaObjects',\n type: 'processStyles',\n plugin: mediaObjectsPlugin,\n};\n\nfunction mediaObjectsPlugin(ctx: StylixPluginFunctionContext, styles: StylixStyles): StylixStyles {\n if (!ctx.media) return styles as StylixObject;\n return processMediaStyles(ctx.media, ctx.styleProps, styles);\n}\n\nexport function processMediaStyles(\n mediaDef: StylixMediaDefinition,\n styleProps: Record<string, string>,\n styles: any,\n // styleKey is provided when recursively processing a nested media object for a style prop (e.g. { color: { mobile: { dark: 'red' } } }).\n // It should be continuously passed down until the actual style value is reached, at which point it will be used to construct the styles\n // object passed to the media function (e.g. mediaDef['mobile']({ color: 'red' }))\n nestedStyleKey?: string,\n): StylixStyles {\n if (!styles || typeof styles !== 'object')\n return nestedStyleKey ? { [nestedStyleKey]: styles } : styles;\n\n // If styles is an array, just recursively map it\n if (Array.isArray(styles)) {\n return styles.flatMap((style: any) =>\n processMediaStyles(mediaDef, styleProps, style),\n ) as StylixStyles[];\n }\n\n mediaDef.default ||= (styles: any) => styles;\n\n const result = { default: [] } as Record<string, any[]>;\n\n for (const styleKey in styles) {\n const styleValue = styles[styleKey];\n\n if (isStyleProp(styleKey, styleProps)) {\n if (typeof styleValue !== 'object') {\n // Regular style prop\n result.default.push({ [styleKey]: styleValue });\n continue;\n }\n\n // An object for a style prop is definitely a media object\n for (const mediaKey in styleValue) {\n result[mediaKey] ||= [];\n\n // process recursively\n const processed = processMediaStyles(mediaDef, styleProps, styleValue[mediaKey], styleKey);\n\n // mediaKey corresponds to a media definition\n if (mediaKey in mediaDef) {\n result[mediaKey].push(mediaDef[mediaKey](processed as OpaqueMediaStyles));\n }\n\n // mediaKey does not correspond to a media definition, it must be a @media or @container rule\n else {\n result[mediaKey].push({\n [mediaKey]: processed,\n });\n }\n }\n continue;\n }\n\n if (styleKey in mediaDef) {\n result[styleKey] ||= [];\n result[styleKey].push(\n mediaDef[styleKey](\n // process recursively\n processMediaStyles(\n mediaDef,\n styleProps,\n styleValue,\n nestedStyleKey,\n ) as unknown as OpaqueMediaStyles,\n ),\n );\n continue;\n }\n\n // Key is a selector, just process recursively and add to plain styles\n result.default.push({\n [styleKey]: processMediaStyles(mediaDef, styleProps, styleValue),\n });\n }\n\n const results = Object.values(result);\n return results.length === 1 ? results[0] : results.length === 0 ? null : results;\n}\n","import type { StylixPlugin } from './index';\n\n/**\n * Merges arrays into flat objects, recursively throughout the styles object.\n */\nexport const mergeArrays: StylixPlugin = {\n name: 'mergeArrays',\n type: 'processStyles',\n plugin: (_ctx, styles) => reduceArrays(styles),\n};\n\nexport function reduceArrays(obj: any) {\n return _reduceArrays(obj);\n}\n\nexport function _reduceArrays(obj: any, target: any = {}) {\n if (!obj || typeof obj !== 'object') return obj;\n\n if (Array.isArray(obj)) {\n for (const item of obj) {\n if (!item || typeof item !== 'object') continue;\n _reduceArrays(item, target);\n }\n return target;\n }\n\n for (const key in obj) {\n const value = obj[key];\n\n // If target[key] is an object\n if (target[key] && typeof target[key] === 'object') {\n // If value is an object, merge them\n if (value && typeof value === 'object') {\n _reduceArrays(value, target[key]);\n }\n // If value is not undefined, replace target[key]\n else if (value !== undefined) {\n target[key] = value;\n }\n // otherwise do nothing, keep target[key] as is\n }\n // If target[key] is not an object, process normally\n else {\n target[key] = _reduceArrays(value, {});\n }\n }\n return target;\n}\n","import { isPlainObject } from '../util/isPlainObject';\nimport type { StylixPlugin } from './index';\n\n/**\n * Removes null, undefined, and empty string values from style objects.\n */\nexport const prepareStyles: StylixPlugin = {\n name: 'prepareStyles',\n type: 'preprocessStyles',\n plugin(_ctx, styles) {\n while (Array.isArray(styles) && styles.length === 1) styles = styles[0];\n if (Array.isArray(styles) && !styles.length) return null;\n if (isPlainObject(styles) && Object.values(styles).every((v) => v === undefined)) return null;\n return styles;\n },\n};\n","import { isStyleProp } from '../classifyProps';\nimport { type MapObjectFunction, mapObject } from '../util/mapObject';\nimport type { StylixPlugin, StylixPluginFunctionContext } from './index';\n\n/**\n * Fixes casing and hyphenation on known style props\n */\nexport const propCasing: StylixPlugin = {\n name: 'propCasing',\n type: 'processStyles',\n plugin(ctx, styles) {\n return mapObject(styles, propCasingMap, { ctx });\n },\n};\n\nconst propCasingMap: MapObjectFunction<{ ctx: StylixPluginFunctionContext }> = (\n key,\n value,\n target,\n context,\n mapRecursive,\n) => {\n if (typeof key !== 'string' || key === '&') {\n target[key] = mapRecursive(value);\n return;\n }\n\n const simpleKey = isStyleProp(key, context.ctx.styleProps);\n if (simpleKey) {\n target[context.ctx.styleProps[simpleKey]] = mapRecursive(value);\n return;\n }\n\n target[key] = mapRecursive(value);\n};\n","import { type MapObjectFunction, mapObject } from '../util/mapObject';\nimport type { StylixPlugin, StylixPluginFunctionContext } from './index';\n\n/**\n * Replaces $$class with class name in string values\n */\nexport const replace$$class: StylixPlugin = {\n name: 'replace$$class',\n type: 'processStyles',\n plugin(ctx, styles) {\n return mapObject(styles, replace$$classMap, { ctx });\n },\n};\n\nconst replace$$classMap: MapObjectFunction<{ ctx: StylixPluginFunctionContext }> = (\n key,\n value,\n target,\n context,\n mapRecursive,\n) => {\n value =\n typeof value === 'string'\n ? value.replaceAll('$$class', context.ctx.className || '')\n : mapRecursive(value);\n key = typeof key === 'string' ? key.replaceAll('$$class', context.ctx.className || '') : key;\n target[key] = value;\n};\n","import { isValidJSXProp, simplifyStylePropName } from '../classifyProps';\nimport type { StylixStyles } from '../types';\nimport { isPlainObject } from '../util/isPlainObject';\nimport { mapObject } from '../util/mapObject';\nimport type { StylixPlugin } from './index';\n\nexport function _customPropsProcess(styles: StylixStyles, customProps: Record<string, any>): any {\n if (typeof styles !== 'object' || styles === null) return styles;\n return mapObject(styles, (key, value, target, _ctx, mapRecursive) => {\n if (!isValidJSXProp(key) || isPlainObject(value)) {\n target[key] = mapRecursive(value);\n return;\n }\n\n const simpleKey = simplifyStylePropName(key);\n const propValue = customProps[simpleKey];\n\n if (propValue && typeof propValue === 'object') {\n // For object, merge the mapped value into target if original prop value is truthy\n if (value) {\n const mappedValue = mapRecursive(propValue);\n Object.assign(target, mappedValue);\n }\n } else if (typeof propValue === 'string') {\n // For string, just remap the prop name\n target[propValue] = mapRecursive(value);\n } else if (typeof propValue === 'function') {\n // For function, call it with the original value and merge the result\n const mappedValue = mapRecursive(propValue(value));\n Object.assign(target, mappedValue);\n } else {\n // Unknown type, just keep original\n target[key] = mapRecursive(value);\n }\n });\n}\n\nexport const customProps = (customProps: Record<string, any>): StylixPlugin[] => {\n for (const key in customProps) {\n customProps[simplifyStylePropName(key)] = customProps[key];\n }\n\n return [\n {\n name: 'customPropsInit',\n type: 'initialize',\n plugin(ctx) {\n for (const key in customProps) {\n ctx.styleProps[simplifyStylePropName(key)] = key;\n }\n },\n },\n {\n name: 'customPropsProcess',\n type: 'processStyles',\n before: 'mergeArrays',\n plugin(_ctx, styles) {\n return _customPropsProcess(styles, customProps);\n },\n },\n ];\n};\n","import type { StylixContext } from '../stylixContext';\nimport type { StylixStyles } from '../types';\nimport { cleanStyles } from './cleanStyles';\nimport { defaultPixelUnits } from './defaultUnits';\nimport { hoistKeyframes } from './hoistKeyframes';\nimport { hoistLayers } from './hoistLayers';\nimport { mediaObjects } from './mediaObjects';\nimport { mergeArrays } from './mergeArrays';\nimport { prepareStyles } from './prepareStyles';\nimport { propCasing } from './propCasing';\nimport { replace$$class } from './replace$$class';\n\n/**\n * Stylix plugin function context object\n */\nexport type StylixPluginFunctionContext = Pick<\n StylixContext,\n 'id' | 'devMode' | 'media' | 'stylesheet' | 'styleElement' | 'styleProps'\n> & { className: string | null };\n\n/**\n * Stylix plugin interface\n */\nexport type StylixPlugin = {\n name: string;\n before?: string;\n after?: string;\n atIndex?: number;\n} & (\n | {\n name: string;\n type: 'initialize';\n plugin(ctx: StylixPluginFunctionContext): void;\n }\n | {\n type: 'processStyles' | 'preprocessStyles';\n plugin(ctx: StylixPluginFunctionContext, styles: StylixStyles): StylixStyles;\n }\n);\n\nexport function applyPlugins(\n type: 'initialize',\n styles: null,\n className: null,\n context: StylixContext,\n): void;\n\nexport function applyPlugins(\n type: 'processStyles' | 'preprocessStyles',\n styles: StylixStyles,\n className: string | null,\n context: StylixContext,\n): StylixStyles;\n\nexport function applyPlugins(\n type: StylixPlugin['type'],\n styles: StylixStyles | null,\n className: string | null,\n context: StylixContext,\n): StylixStyles {\n const pluginContext: StylixPluginFunctionContext = {\n id: context.id,\n devMode: context.devMode,\n media: context.media,\n stylesheet: context.stylesheet,\n styleElement: context.styleElement,\n styleProps: context.styleProps,\n className,\n };\n\n let processedStyles: StylixStyles = styles || {};\n for (const i in context.plugins) {\n const plugin = context.plugins[i];\n if (plugin.type === type)\n processedStyles = plugin.plugin(pluginContext, processedStyles) as StylixStyles;\n }\n return processedStyles;\n}\n\nexport { customProps } from './customProps';\n\nexport const defaultPlugins: StylixPlugin[] = [\n prepareStyles,\n mediaObjects,\n mergeArrays,\n propCasing,\n hoistKeyframes,\n hoistLayers,\n replace$$class,\n defaultPixelUnits,\n cleanStyles,\n];\n","import type { HTMLProps } from './elements';\n\nexport function StyleElement(props: { styles: string[] } & Partial<HTMLProps<'style'>>) {\n const { styles, ...other } = props;\n return (\n <style type=\"text/css\" {...other} dangerouslySetInnerHTML={{ __html: styles.join('\\n') }} />\n );\n}\n","import type React from 'react';\nimport { createContext } from 'react';\n\nimport { StyleElement } from './StyleElement';\n\nexport interface StyleCollector {\n collect: (element: React.ReactElement) => React.ReactElement;\n render: React.FC<React.ComponentProps<'style'>>;\n styles: string[];\n}\n\nexport const styleCollectorContext = createContext<string[] | undefined>(undefined);\n\nexport function createStyleCollector() {\n const styles: string[] = [];\n const collector: StyleCollector = {\n collect: (element) => (\n <styleCollectorContext.Provider value={styles}>{element}</styleCollectorContext.Provider>\n ),\n render: (props: React.ComponentProps<'style'>) => (\n <StyleElement key={props.id || 'stylix'} styles={collector.styles} />\n ),\n styles,\n };\n collector.render.displayName = 'StylixStyleCollectorRenderer';\n return collector;\n}\n","import React from 'react';\n\nexport function getParentComponentName(): string | undefined {\n const internals = (React as any).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n const stack = internals?.ReactDebugCurrentFrame?.getStackAddendum?.()?.split('\\n') || [];\n for (const line of stack) {\n // Look for a component name like \"Component$123\", either at the start of the line (Firefox) or after \"at \" (Safari/Chrome)\n const m = line.trim().match(/^(?:at )?([A-Z][A-Za-z0-9$.]*)/);\n const res = m?.[1] && m[1] !== 'Stylix' ? m[1] : undefined;\n if (res) return res;\n }\n}\n","import { applyPlugins } from './plugins';\nimport type { StylixContext } from './stylixContext';\nimport type { StylixObject } from './types';\nimport { isEmpty } from './util/isEmpty';\nimport { isPlainObject } from './util/isPlainObject';\n\n/**\n * Serialize selector and styles to css rule string\n */\nfunction serialize(selector: string, styles: StylixObject) {\n if (selector.startsWith('@') && Array.isArray(styles)) {\n return `${selector} ${styles.join(', ')};`;\n }\n const lines: string[] = [];\n for (const key in styles) {\n const value = styles[key];\n if (isPlainObject(value)) lines.push(serialize(key, value));\n else lines.push(` ${key}: ${value};`);\n }\n return `${selector} {\\n${lines.join('\\n')} }`;\n}\n\n/**\n * Converts a Stylix CSS object to an array of rules, suitable for passing to StyleSheet#insertRule.\n */\nexport default function stylesToRuleArray(\n styles: StylixObject,\n className: string,\n context: StylixContext,\n): string[] {\n if (isEmpty(styles)) return [];\n try {\n const processedStyles = applyPlugins(\n 'processStyles',\n styles,\n className,\n context,\n ) as StylixObject;\n\n const result: string[] = [];\n\n // Handle @layer rules first\n if (processedStyles['@layer']) {\n result.push(serialize('@layer', processedStyles['@layer'] as StylixObject));\n delete processedStyles['@layer'];\n }\n for (const key in processedStyles) {\n const value = processedStyles[key] as StylixObject;\n result.push(serialize(key, value));\n }\n return result;\n } catch (e: any) {\n if (e.name && e.reason) {\n console.error(\n `${e.name}: ${e.reason}\\n`,\n `${e.source.replace('\\n', ' ').substring(Math.max(0, e.column - 20), Math.max(0, e.column - 20) + 100)}\\n`,\n `${' '.repeat(20)}^`,\n );\n } else {\n console.error(e);\n }\n return [];\n }\n}\n","import { useInsertionEffect, useRef } from 'react';\nimport applyRules from './applyRules';\nimport { getParentComponentName } from './getParentComponentName';\nimport { applyPlugins } from './plugins';\nimport stylesToRuleArray from './stylesToRuleArray';\nimport { type StylixContext, useStylixContext } from './stylixContext';\nimport type { StylixObject, StylixStyles } from './types';\nimport { isEmpty } from './util/isEmpty';\n\nfunction cleanup(ctx: StylixContext): void {\n if (ctx.cleanupRequest) return;\n\n const doCleanup = () => {\n for (const i in ctx.rules) {\n const rule = ctx.rules[i];\n if (!rule || rule.refs <= 0) {\n delete ctx.rules[i];\n }\n }\n applyRules(ctx);\n ctx.cleanupRequest = false;\n };\n\n // queueMicrotask in devMode so the cleanupRequest guard batches simultaneous unmounts\n // before applyRules is called; setTimeout(100) serves the same purpose in production.\n ctx.cleanupRequest = true;\n if (ctx.devMode) {\n queueMicrotask(doCleanup);\n } else {\n setTimeout(doCleanup, 100);\n }\n}\n\nexport function createStyles(config: {\n stylixCtx: StylixContext;\n key?: string;\n styles: StylixStyles;\n global?: boolean;\n debugLabel?: string;\n}): { className: string; key: string } {\n const { stylixCtx, global } = config;\n let styles = config.styles;\n const priorKey = config.key || '';\n\n let stylesKey = '';\n if (styles && !isEmpty(styles)) {\n // Preprocess styles with plugins\n styles = applyPlugins('preprocessStyles', styles, null, stylixCtx);\n // Generate styles key\n stylesKey = styles ? (global ? 'global:' : '') + JSON.stringify(styles) : '';\n }\n\n if (stylesKey && !stylixCtx.rules[stylesKey]) {\n stylixCtx.styleCounter++;\n const debugLabel = config.debugLabel || (stylixCtx.devMode && getParentComponentName()) || '';\n const className = `${stylixCtx.id}-${(stylixCtx.styleCounter).toString(36)}${debugLabel ? `-${debugLabel}` : ''}`;\n // If not global styles, wrap original styles with classname\n if (!global) styles = { [`.${className}`]: styles };\n stylixCtx.rules[stylesKey] = {\n className,\n rules: stylesToRuleArray(styles as StylixObject, className, stylixCtx),\n refs: 0,\n };\n }\n\n const isChanged = stylesKey !== priorKey;\n const ruleSet = stylesKey ? stylixCtx.rules[stylesKey] : null;\n\n if (isChanged) {\n // Mark styles to be applied\n stylixCtx.requestApply = true;\n\n // Increment ref count for new styles; decrement is handled by the useInsertionEffect cleanup\n if (ruleSet) ruleSet.refs++;\n }\n\n return {\n className: ruleSet?.className || '',\n key: stylesKey,\n };\n}\n\n/**\n * Accepts a Stylix CSS object and returns a unique className.\n * The styles are registered with the Stylix context and will be applied to the document.\n * If `global` is false, provided styles will be nested within the generated classname.\n * Returns the className if enabled, or an empty string.\n */\nexport function useStyles(\n styles: StylixStyles,\n options: { global?: boolean; debugLabel?: string } = { global: false },\n): string {\n const stylixCtx = useStylixContext();\n\n const prevStylesKey = useRef('');\n\n const s = createStyles({\n stylixCtx,\n styles,\n global: options.global,\n debugLabel: options.debugLabel,\n key: prevStylesKey.current,\n });\n\n prevStylesKey.current = s.key;\n\n // Apply styles if requested.\n // This runs on every render. We utilize useInsertionEffect so that it runs *after* all the other\n // renders have completed. stylixCtx.requestApply guards against multiple runs. This reduces the number of calls\n // to applyRules(), but prevents styles potentially being added to the DOM after other components force the\n // browser to compute styles.\n // biome-ignore lint/correctness/useExhaustiveDependencies: stylixCtx is stable\n useInsertionEffect(() => {\n const capturedKey = s.key;\n\n if (stylixCtx.requestApply) {\n stylixCtx.requestApply = false;\n applyRules(stylixCtx);\n }\n\n // Always register a cleanup to decrement refs when styles change or component unmounts.\n // This runs whether or not requestApply was true — guards against missing cleanup when\n // a sibling component already called applyRules in the same commit.\n return () => {\n if (capturedKey) {\n const rule = stylixCtx.rules[capturedKey];\n if (rule) rule.refs--;\n }\n cleanup(stylixCtx);\n };\n }, [s.key]);\n\n return s.className;\n}\n\nexport function useKeyframes(keyframes: any) {\n return useStyles({ '@keyframes $$class': keyframes }, { global: true });\n}\n\nexport function useGlobalStyles(\n styles: StylixStyles,\n options: { disabled?: boolean } = { disabled: false },\n) {\n return useStyles(styles, { ...options, global: true });\n}\n","import { useLayoutEffect } from 'react';\n\nexport const detectSSR = () =>\n !(typeof window !== 'undefined' && window.document?.head?.appendChild);\n\nexport default function useIsoLayoutEffect(\n fn: () => void | (() => void),\n deps?: unknown[],\n runOnSsr?: boolean,\n isSsr = detectSSR(),\n) {\n if (isSsr) {\n if (runOnSsr) return fn();\n } else {\n // biome-ignore lint/correctness/useHookAtTopLevel: isSsr should never change\n // biome-ignore lint/correctness/useExhaustiveDependencies: dependencies are passed as-is\n useLayoutEffect(fn, deps);\n }\n}\n","import type React from 'react';\nimport { createContext, useContext, useEffect, useRef } from 'react';\nimport applyRules from './applyRules';\nimport { classifyProps, simplifyStylePropName } from './classifyProps';\nimport cssProps from './css-props.json';\nimport { applyPlugins, defaultPlugins, type StylixPlugin } from './plugins';\nimport type { StylixMediaDefinition } from './plugins/mediaObjects';\nimport { styleCollectorContext } from './styleCollector';\nimport type { StylixStyles } from './types';\nimport { createStyles } from './useStyles';\nimport { detectSSR } from './util/useIsoLayoutEffect';\n\n/**\n * Stylix context\n *\n * A Stylix context represents an \"instance\" of Stylix - a configuration, set of plugins, and reference to\n * the <style> element where css is output.\n *\n * A <StylixProvider> creates a context instance and provides it via React context to its descendent elements.\n * All nodes contained within a <StylixProvider> element will share this context.\n */\n\n/**\n * The Stylix context object.\n */\nexport type StylixContext = {\n id: string;\n devMode: boolean;\n media: StylixMediaDefinition | undefined;\n plugins: StylixPlugin[];\n stylesheet?: CSSStyleSheet;\n styleElement?: HTMLStyleElement;\n styleElementIsUserProvided: boolean;\n styleCollector?: string[];\n styleCounter: number;\n rules: {\n [key: string]:\n | undefined\n | {\n className: string;\n rules: string[];\n refs: number;\n };\n };\n styleProps: Record<string, string>;\n ssr?: boolean;\n cleanupRequest: boolean;\n requestApply: boolean;\n\n classifyProps(props: Record<string, unknown>): [Record<string, unknown>, Record<string, unknown>];\n styles(styles: StylixStyles, config?: { global: boolean }): string;\n};\n\n/**\n * Default style props mapping. This will be populated on the first call to createStylixContext.\n */\nlet defaultStyleProps: Record<string, string> | undefined;\n\n/**\n * Configuration options for creating a Stylix context.\n */\ntype CreateStylixContextConfig = {\n id?: string;\n devMode?: boolean;\n plugins?: StylixPlugin[] | StylixPlugin[][];\n styleElement?: HTMLStyleElement;\n media?: StylixMediaDefinition;\n ssr?: boolean;\n};\n\n(window as any).__stylixNextId = 0;\n\nexport function createStylixContext(userValues: CreateStylixContextConfig = {}): StylixContext {\n if (!defaultStyleProps) {\n defaultStyleProps = {};\n for (const value of cssProps) {\n defaultStyleProps[simplifyStylePropName(value)] = value;\n }\n }\n\n const ctx: StylixContext = {\n id: userValues.id || `stylix${(window as any).__stylixNextId++}`,\n devMode: !!userValues.devMode,\n styleProps: defaultStyleProps,\n media: userValues.media,\n styleElement: userValues.styleElement,\n styleElementIsUserProvided: !!userValues.styleElement,\n plugins: defaultPlugins.flat(),\n styleCounter: 0,\n rules: {},\n ssr: userValues.ssr ?? detectSSR(),\n cleanupRequest: false,\n requestApply: false,\n\n classifyProps(props: Record<string, unknown>) {\n const [styles, other] = classifyProps(props, this.styleProps);\n return [styles, other];\n },\n\n styles(styles: StylixStyles, config?: { global: boolean }): string {\n const s = createStyles({\n stylixCtx: ctx,\n styles,\n global: config?.global || false,\n });\n applyRules(ctx);\n return s.className;\n },\n };\n\n if (userValues.plugins?.length) {\n const flatPlugins = userValues.plugins.flat();\n for (const i in flatPlugins) {\n const plugin = flatPlugins[i];\n let pluginIndex = -1;\n if (plugin.before) pluginIndex = ctx.plugins.findIndex((v) => v.name === plugin.before);\n else if (plugin.after) {\n pluginIndex = ctx.plugins.findIndex((v) => v.name === plugin.before);\n if (pluginIndex !== -1) pluginIndex += 1;\n } else if (plugin.atIndex !== undefined) pluginIndex = plugin.atIndex;\n\n if (pluginIndex === -1) ctx.plugins.push(plugin);\n else ctx.plugins.splice(pluginIndex, 0, plugin);\n }\n }\n applyPlugins('initialize', null, null, ctx);\n\n return ctx;\n}\n\n/**\n * The React context object for Stylix.\n */\nconst stylixContext = createContext<StylixContext | undefined>(undefined);\n\n/**\n * Default Stylix context, used when no provider is present.\n */\nlet defaultStylixContext: StylixContext | undefined;\n\n/**\n * React hook that gets the current Stylix context.\n */\nexport function useStylixContext(): StylixContext {\n const ctx = useContext(stylixContext);\n if (!ctx) {\n if (!defaultStylixContext) defaultStylixContext = createStylixContext();\n return defaultStylixContext;\n }\n return ctx;\n}\n\n/**\n * Props for StylixProvider when passing an existing context.\n */\ntype StylixProviderPropsWithContext = {\n context: StylixContext;\n};\n\n/**\n * Props for StylixProvider when creating a new context.\n */\ntype StylixProviderPropsWithConfig = {\n id?: string;\n devMode?: boolean;\n plugins?: StylixPlugin[] | StylixPlugin[][];\n styleElement?: HTMLStyleElement;\n media?: StylixMediaDefinition;\n ssr?: boolean;\n children: any;\n};\n\n/**\n * Props for the StylixProvider component.\n */\ntype StylixProviderProps = StylixProviderPropsWithContext | StylixProviderPropsWithConfig;\n\n/**\n * StylixProvider component. Provides a Stylix context to its descendent elements.\n * Can either accept an existing context via the `context` prop, or create a new context\n * using the other configuration props.\n */\nexport function StylixProvider(props: StylixProviderProps): React.ReactElement {\n const { context, id, devMode, plugins, media, styleElement, children, ssr } =\n props as StylixProviderPropsWithContext & StylixProviderPropsWithConfig;\n\n const ctx = useRef(context);\n if (!ctx.current)\n ctx.current = createStylixContext({\n id,\n devMode,\n plugins,\n media,\n styleElement,\n ssr,\n });\n\n ctx.current.styleCollector = useContext(styleCollectorContext);\n\n // When the component is unmounted, remove the style element, if any\n useEffect(() => {\n return () => {\n if (ctx.current?.styleElement && !ctx.current.styleElementIsUserProvided)\n ctx.current.styleElement.remove();\n };\n }, []);\n\n return <stylixContext.Provider value={ctx.current}>{children}</stylixContext.Provider>;\n}\n","import React from 'react';\nimport type { IntrinsicElements } from './elements';\nimport { useStylixContext } from './stylixContext';\nimport type { Extends, StylixProps, StylixStyles } from './types';\nimport { useStyles } from './useStyles';\nimport { isEmpty } from './util/isEmpty';\n\n/**\n * Additional properties on the Stylix ($) component and its html component properties (`<$.div>`, etc).\n */\nexport type StylixComponentMeta = {\n displayName?: string;\n __isStylix: true;\n};\n\n/**\n * Defines the static meta properties and the HTML elements on the `$` object ($.div, $.span, etc).\n */\ntype Stylix$ComponentExtras = StylixComponentMeta & {\n [key in IntrinsicElements]: React.FC<\n Extends<React.JSX.IntrinsicElements[key], StylixProps> & {\n htmlContent?: string;\n htmlTranslate?: 'yes' | 'no';\n }\n >;\n};\n\nexport type StylixRenderFn<TProps = any> = (\n className: string | undefined,\n props: TProps,\n) => React.ReactNode;\n\n/**\n * The props for the Stylix ($) component when using the $render prop.\n */\ntype Stylix$renderProp = StylixProps &\n Record<string, unknown> & {\n $el?: never;\n $render: StylixRenderFn;\n children?: never;\n };\n\n/**\n * The props for the Stylix ($) component when using the $el prop as a component, intrinsic element tag, or rendered element.\n */\ntype Stylix$elAsComponentProp = StylixProps &\n Record<string, unknown> & {\n $el: React.ReactElement | React.ComponentType<any> | IntrinsicElements;\n $render?: never;\n children?: React.ReactNode | React.ReactNode[];\n };\n\n/**\n * Internal props type for the Stylix ($) component where actual types are unknown.\n */\ntype InternalStylix$Props = {\n $el?: React.ReactElement | React.ComponentType<any> | IntrinsicElements;\n $render?: StylixRenderFn;\n children?: React.ReactNode | React.ReactNode[];\n $css?: StylixProps['$css'];\n className?: string;\n};\n\ntype Stylix$props = Stylix$elAsComponentProp | Stylix$renderProp;\n\n/**\n * Type of main Stylix component ($).\n */\nexport type Stylix$Component = Stylix$ComponentExtras & ((props: Stylix$props) => React.ReactNode);\n\nexport function _Stylix<TElement extends React.ElementType>(\n props: InternalStylix$Props,\n ref: React.Ref<TElement>,\n) {\n const { $el, $render, $css, className: outerClassName, children, ...rest } = props;\n\n const ctx = useStylixContext();\n const [styleProps, otherProps] = ctx.classifyProps(rest);\n\n let styles: StylixStyles = [];\n if (!isEmpty(styleProps)) styles.push(styleProps);\n if (!isEmpty($css)) styles.push($css);\n if (styles.length === 1 && styles[0]) styles = styles[0];\n const stylixClassName = useStyles(styles);\n\n const className = `${stylixClassName} ${outerClassName || ''}`.trim() || undefined;\n\n if (React.isValidElement($el)) {\n const $elProps = {\n ...($el.props as any),\n ref: ('ref' in $el && $el.ref) || ref,\n /**\n * `allProps` must override `$el.props` because the latter may contain default prop values provided by defaultProps.\n * The expectation is that for <$ $el={<SomeComponent />} someComponentProp=\"my value\" />,\n * the `someComponentProp` prop would override any default value specified by SomeComponent.defaultProps.\n */\n ...otherProps,\n className: `${($el.props as any).className || ''} ${className || ''}`.trim() || undefined,\n };\n return React.cloneElement(\n $el,\n $elProps,\n ...(React.Children.toArray(children as React.ReactNode) || []),\n );\n }\n\n if ($el) {\n const Component = $el as React.FC<any>;\n return (\n <Component className={className} ref={ref} {...otherProps}>\n {children}\n </Component>\n );\n }\n\n if ($render) {\n return $render(className || undefined, { children, ...otherProps, ...(ref ? { ref } : null) });\n }\n\n throw new Error('Stylix: invalid stylix component usage: must provide $el or $render prop.');\n}\n\nexport const Stylix: Stylix$Component = React.forwardRef(\n _Stylix as any,\n) as unknown as Stylix$Component;\nStylix.displayName = 'Stylix';\nStylix.__isStylix = true;\n","import React from 'react';\nimport { Stylix } from './Stylix';\n\nconst htmlTags = [\n 'a',\n 'abbr',\n 'address',\n 'area',\n 'article',\n 'aside',\n 'audio',\n 'b',\n 'bdi',\n 'bdo',\n 'blockquote',\n 'body',\n 'br',\n 'button',\n 'canvas',\n 'caption',\n 'cite',\n 'code',\n 'col',\n 'colgroup',\n 'data',\n 'dd',\n 'del',\n 'details',\n 'dfn',\n 'dialog',\n 'div',\n 'dl',\n 'dt',\n 'em',\n 'embed',\n 'fieldset',\n 'figcaption',\n 'figure',\n 'footer',\n 'form',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'hgroup',\n 'hr',\n 'html',\n 'i',\n 'iframe',\n 'img',\n 'input',\n 'ins',\n 'kbd',\n 'label',\n 'legend',\n 'li',\n 'main',\n 'map',\n 'mark',\n 'menu',\n 'menuitem',\n 'meter',\n 'nav',\n 'noscript',\n 'object',\n 'ol',\n 'optgroup',\n 'option',\n 'output',\n 'p',\n 'picture',\n 'pre',\n 'progress',\n 'q',\n 'rt',\n 'ruby',\n 's',\n 'samp',\n 'section',\n 'select',\n 'slot',\n 'small',\n 'source',\n 'span',\n 'strong',\n 'sub',\n 'summary',\n 'sup',\n 'svg',\n 'table',\n 'tbody',\n 'td',\n 'textarea',\n 'tfoot',\n 'th',\n 'thead',\n 'time',\n 'tr',\n 'track',\n 'u',\n 'ul',\n 'var',\n 'video',\n] as const;\n\nexport type IntrinsicElements = (typeof htmlTags)[number];\n\n/**\n * Gets the props of a given HTML tag.\n */\nexport type HTMLProps<TTag extends keyof React.JSX.IntrinsicElements> =\n React.JSX.IntrinsicElements[TTag];\n\nfor (const i in htmlTags) {\n const Tag: any = htmlTags[i];\n (Stylix as any)[Tag] = React.forwardRef(({ htmlContent, htmlTranslate, ...props }: any, ref) => (\n <Stylix\n $render={(className: string, props: object) => (\n <Tag\n className={className}\n content={htmlContent}\n translate={htmlTranslate}\n ref={ref}\n {...props}\n />\n )}\n {...props}\n />\n ));\n (Stylix as any)[Tag].__isStylix = true;\n (Stylix as any)[Tag].displayName = `$.${Tag}`;\n}\n","import { flattenRules } from './applyRules';\nimport type { HTMLProps } from './elements';\nimport { StyleElement } from './StyleElement';\nimport { useStylixContext } from './stylixContext';\n\nexport function RenderServerStyles(props: Partial<HTMLProps<'style'>>) {\n const ctx = useStylixContext();\n return <StyleElement styles={ctx.ssr ? flattenRules(ctx) : []} {...props} />;\n}\n","type ClassNamePrimitive = string | number | boolean | null | undefined;\ntype ClassName =\n | ClassNamePrimitive\n | ClassName[]\n | { [key: string]: ClassNamePrimitive }\n | (() => ClassName);\n\n// Internal helper to collect class name parts without joining\nfunction cxArray(args: ClassName[]): string[] {\n const classNames: string[] = [];\n for (const arg of args) {\n if (arg && typeof arg === 'string') {\n classNames.push(arg);\n } else if (Array.isArray(arg)) {\n classNames.push(...cxArray(arg));\n } else if (typeof arg === 'function') {\n classNames.push(...cxArray([arg()]));\n } else if (typeof arg === 'object' && arg !== null) {\n for (const [key, value] of Object.entries(arg)) {\n if (value) {\n classNames.push(key);\n }\n }\n }\n }\n return classNames;\n}\n\n/**\n * A utility function to create a string of class names based on the provided parameters.\n * Accepts a variable number of arguments, each of which can be one of the following:\n *\n * - A string, which will be included in the class name string.\n * - An object, where the keys are class names and the values are booleans indicating whether to include the class name.\n * - An array of strings or objects, which will be flattened and processed as above.\n * - A function that returns a string, object, or array, which will be processed as above.\n * - Any other value will be ignored.\n */\nexport function cx(...args: ClassName[]): string {\n return cxArray(args).join(' ');\n}\n"],"names":["_jsx"],"mappings":";;;AAEM,SAAU,YAAY,CAAC,GAAkB,EAAA;AAC7C,IAAA,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK;SAC3B,OAAO,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC;SACvD,MAAM,CAAC,OAAO,CAAC;AACpB;AAEA;;AAEG;AACW,SAAU,UAAU,CAAC,GAAkB,EAAA;AACnD,IAAA,IAAI,GAAG,CAAC,cAAc,EAAE;AACtB,QAAA,MAAM,cAAc,GAAG,YAAY,CAAC,GAAG,CAAC;AACxC,QAAA,GAAG,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC;QAC7B,GAAG,CAAC,cAAc,CAAC,IAA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