@stylix/core 3.1.3 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dist/index.js +853 -28
  2. package/dist/index.js.map +1 -1
  3. package/dist/module.mjs +828 -0
  4. package/dist/module.mjs.map +1 -0
  5. package/dist/types.d.ts +159 -26
  6. package/dist/types.d.ts.map +1 -0
  7. package/package.json +19 -31
  8. package/dist/Stylix.d.ts +0 -3
  9. package/dist/Stylix.js +0 -66
  10. package/dist/Stylix.js.map +0 -1
  11. package/dist/StylixProvider.d.ts +0 -52
  12. package/dist/StylixProvider.js +0 -143
  13. package/dist/StylixProvider.js.map +0 -1
  14. package/dist/applyRules.d.ts +0 -5
  15. package/dist/applyRules.js +0 -31
  16. package/dist/applyRules.js.map +0 -1
  17. package/dist/classifyProps.d.ts +0 -7
  18. package/dist/classifyProps.js +0 -35
  19. package/dist/classifyProps.js.map +0 -1
  20. package/dist/css-props.json +0 -413
  21. package/dist/html-tags.json +0 -119
  22. package/dist/index.d.ts +0 -8
  23. package/dist/plugins/cleanStyles.d.ts +0 -5
  24. package/dist/plugins/cleanStyles.js +0 -28
  25. package/dist/plugins/cleanStyles.js.map +0 -1
  26. package/dist/plugins/customProps.d.ts +0 -2
  27. package/dist/plugins/customProps.js +0 -61
  28. package/dist/plugins/customProps.js.map +0 -1
  29. package/dist/plugins/defaultUnits.d.ts +0 -7
  30. package/dist/plugins/defaultUnits.js +0 -41
  31. package/dist/plugins/defaultUnits.js.map +0 -1
  32. package/dist/plugins/flattenNestedStyles.d.ts +0 -5
  33. package/dist/plugins/flattenNestedStyles.js +0 -47
  34. package/dist/plugins/flattenNestedStyles.js.map +0 -1
  35. package/dist/plugins/index.d.ts +0 -30
  36. package/dist/plugins/index.js +0 -44
  37. package/dist/plugins/index.js.map +0 -1
  38. package/dist/plugins/mediaArrays.d.ts +0 -5
  39. package/dist/plugins/mediaArrays.js +0 -56
  40. package/dist/plugins/mediaArrays.js.map +0 -1
  41. package/dist/plugins/merge$css.d.ts +0 -6
  42. package/dist/plugins/merge$css.js +0 -45
  43. package/dist/plugins/merge$css.js.map +0 -1
  44. package/dist/plugins/propCasing.d.ts +0 -5
  45. package/dist/plugins/propCasing.js +0 -21
  46. package/dist/plugins/propCasing.js.map +0 -1
  47. package/dist/plugins/replace$$class.d.ts +0 -5
  48. package/dist/plugins/replace$$class.js +0 -20
  49. package/dist/plugins/replace$$class.js.map +0 -1
  50. package/dist/plugins/themeFunctions.d.ts +0 -5
  51. package/dist/plugins/themeFunctions.js +0 -20
  52. package/dist/plugins/themeFunctions.js.map +0 -1
  53. package/dist/styleCollector.d.ts +0 -8
  54. package/dist/styleCollector.js +0 -40
  55. package/dist/styleCollector.js.map +0 -1
  56. package/dist/stylesToRuleArray.d.ts +0 -5
  57. package/dist/stylesToRuleArray.js +0 -41
  58. package/dist/stylesToRuleArray.js.map +0 -1
  59. package/dist/types.js +0 -3
  60. package/dist/types.js.map +0 -1
  61. package/dist/useStyles.d.ts +0 -16
  62. package/dist/useStyles.js +0 -115
  63. package/dist/useStyles.js.map +0 -1
  64. package/dist/util/cloneDeep.d.ts +0 -4
  65. package/dist/util/cloneDeep.js +0 -28
  66. package/dist/util/cloneDeep.js.map +0 -1
  67. package/dist/util/flatten.d.ts +0 -4
  68. package/dist/util/flatten.js +0 -19
  69. package/dist/util/flatten.js.map +0 -1
  70. package/dist/util/hashString.d.ts +0 -4
  71. package/dist/util/hashString.js +0 -15
  72. package/dist/util/hashString.js.map +0 -1
  73. package/dist/util/isPlainObject.d.ts +0 -4
  74. package/dist/util/isPlainObject.js +0 -11
  75. package/dist/util/isPlainObject.js.map +0 -1
  76. package/dist/util/mapObjectRecursive.d.ts +0 -8
  77. package/dist/util/mapObjectRecursive.js +0 -37
  78. package/dist/util/mapObjectRecursive.js.map +0 -1
  79. package/dist/util/merge.d.ts +0 -5
  80. package/dist/util/merge.js +0 -31
  81. package/dist/util/merge.js.map +0 -1
  82. package/dist/util/useIsoLayoutEffect.d.ts +0 -2
  83. package/dist/util/useIsoLayoutEffect.js +0 -8
  84. package/dist/util/useIsoLayoutEffect.js.map +0 -1
  85. package/dist/util/walkRecursive.d.ts +0 -8
  86. package/dist/util/walkRecursive.js +0 -26
  87. package/dist/util/walkRecursive.js.map +0 -1
  88. package/exports.mjs +0 -8
package/dist/index.js CHANGED
@@ -1,28 +1,853 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.default = exports.styleCollectorContext = exports.createStyleCollector = exports.walkRecursive = exports.mapObjectRecursive = exports.customProps = exports.defaultPlugins = exports.useGlobalStyles = exports.useKeyframes = exports.useStyles = exports.StylixTheme = exports.StylixProvider = exports.useStylixTheme = exports.useStylixContext = void 0;
7
- var StylixProvider_1 = require("./StylixProvider");
8
- Object.defineProperty(exports, "useStylixContext", { enumerable: true, get: function () { return StylixProvider_1.useStylixContext; } });
9
- Object.defineProperty(exports, "useStylixTheme", { enumerable: true, get: function () { return StylixProvider_1.useStylixTheme; } });
10
- Object.defineProperty(exports, "StylixProvider", { enumerable: true, get: function () { return StylixProvider_1.StylixProvider; } });
11
- Object.defineProperty(exports, "StylixTheme", { enumerable: true, get: function () { return StylixProvider_1.StylixTheme; } });
12
- var useStyles_1 = require("./useStyles");
13
- Object.defineProperty(exports, "useStyles", { enumerable: true, get: function () { return useStyles_1.useStyles; } });
14
- Object.defineProperty(exports, "useKeyframes", { enumerable: true, get: function () { return useStyles_1.useKeyframes; } });
15
- Object.defineProperty(exports, "useGlobalStyles", { enumerable: true, get: function () { return useStyles_1.useGlobalStyles; } });
16
- var plugins_1 = require("./plugins");
17
- Object.defineProperty(exports, "defaultPlugins", { enumerable: true, get: function () { return plugins_1.defaultPlugins; } });
18
- Object.defineProperty(exports, "customProps", { enumerable: true, get: function () { return plugins_1.customProps; } });
19
- var mapObjectRecursive_1 = require("./util/mapObjectRecursive");
20
- Object.defineProperty(exports, "mapObjectRecursive", { enumerable: true, get: function () { return mapObjectRecursive_1.mapObjectRecursive; } });
21
- var walkRecursive_1 = require("./util/walkRecursive");
22
- Object.defineProperty(exports, "walkRecursive", { enumerable: true, get: function () { return walkRecursive_1.walkRecursive; } });
23
- var styleCollector_1 = require("./styleCollector");
24
- Object.defineProperty(exports, "createStyleCollector", { enumerable: true, get: function () { return styleCollector_1.createStyleCollector; } });
25
- Object.defineProperty(exports, "styleCollectorContext", { enumerable: true, get: function () { return styleCollector_1.styleCollectorContext; } });
26
- var Stylix_1 = require("./Stylix");
27
- Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Stylix_1).default; } });
28
- //# sourceMappingURL=index.js.map
1
+ var $cPdmE$react = require("react");
2
+
3
+ function $parcel$defineInteropFlag(a) {
4
+ Object.defineProperty(a, '__esModule', {value: true, configurable: true});
5
+ }
6
+ function $parcel$export(e, n, v, s) {
7
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
8
+ }
9
+ function $parcel$interopDefault(a) {
10
+ return a && a.__esModule ? a.default : a;
11
+ }
12
+
13
+ $parcel$defineInteropFlag(module.exports);
14
+
15
+ $parcel$export(module.exports, "useStylixContext", () => $918367b4cbc7189f$export$e3c6fdf4e371f028);
16
+ $parcel$export(module.exports, "useStylixTheme", () => $918367b4cbc7189f$export$c01a354187f160ee);
17
+ $parcel$export(module.exports, "StylixProvider", () => $918367b4cbc7189f$export$ae2c3ad5c234c4cc);
18
+ $parcel$export(module.exports, "StylixTheme", () => $918367b4cbc7189f$export$91c80431af53fbc7);
19
+ $parcel$export(module.exports, "useStyles", () => $b7bb7699b24ef4bd$export$28e6b9b82ee883c);
20
+ $parcel$export(module.exports, "useKeyframes", () => $b7bb7699b24ef4bd$export$f3922bb611b91373);
21
+ $parcel$export(module.exports, "useGlobalStyles", () => $b7bb7699b24ef4bd$export$abac79b9db5ae47b);
22
+ $parcel$export(module.exports, "defaultPlugins", () => $cb46c37cd304d3d0$export$b5ecb47695d6786e);
23
+ $parcel$export(module.exports, "customProps", () => $3173bf4e08028305$export$95cef81be5ddcfd4);
24
+ $parcel$export(module.exports, "mapObjectRecursive", () => $1ae3b31df309d474$export$72ae87c5302f282e);
25
+ $parcel$export(module.exports, "walkRecursive", () => $0893146e2e8f7a0d$export$a8d8e56b740dab80);
26
+ $parcel$export(module.exports, "createStyleCollector", () => $0c5ff6b44ea9986a$export$d3207b3764661c07);
27
+ $parcel$export(module.exports, "styleCollectorContext", () => $0c5ff6b44ea9986a$export$9b609b8e22cde6fe);
28
+ $parcel$export(module.exports, "classifyProps", () => $d4abddb46f405b94$export$54b296e95917282f);
29
+ $parcel$export(module.exports, "useClassifyProps", () => $d4abddb46f405b94$export$34c29a98f3a9910);
30
+ $parcel$export(module.exports, "styled", () => $f7963c5fb85d4dcf$export$3817b7a54a07cec7);
31
+ $parcel$export(module.exports, "default", () => $a4e8092b68236a62$export$2e2bcd8739ae039);
32
+
33
+
34
+ function $d4abddb46f405b94$export$54b296e95917282f(props, knownProps) {
35
+ const styles = {};
36
+ const other = {};
37
+ for(const prop in props)// If prop is not a valid JSX prop, it must be a CSS selector
38
+ if (!$d4abddb46f405b94$export$4ee529ad08c1c79c(prop) || $d4abddb46f405b94$export$95b76554d0cd12d6(prop, knownProps) && $d4abddb46f405b94$export$bd35f4abe4dfe31c(props[prop])) styles[prop] = props[prop];
39
+ else other[prop] = props[prop];
40
+ return [
41
+ styles,
42
+ other
43
+ ];
44
+ }
45
+ function $d4abddb46f405b94$export$34c29a98f3a9910(props) {
46
+ const ctx = (0, $918367b4cbc7189f$export$e3c6fdf4e371f028)();
47
+ const [styles, other] = $d4abddb46f405b94$export$54b296e95917282f(props, ctx.styleProps);
48
+ return [
49
+ styles,
50
+ other
51
+ ];
52
+ }
53
+ function $d4abddb46f405b94$export$95b76554d0cd12d6(prop, knownProps) {
54
+ return $d4abddb46f405b94$export$4ee529ad08c1c79c(prop) && $d4abddb46f405b94$export$2eda63d9f5a68c09(prop) in knownProps;
55
+ }
56
+ function $d4abddb46f405b94$export$4ee529ad08c1c79c(value) {
57
+ // Not an exact check, but mostly rules out complex css selectors
58
+ return /^[a-z$][a-z0-9_-]*$/i.test(value);
59
+ }
60
+ function $d4abddb46f405b94$export$2eda63d9f5a68c09(value) {
61
+ return value.toLowerCase().replace(/[^a-z]/gi, "");
62
+ }
63
+ function $d4abddb46f405b94$export$bd35f4abe4dfe31c(value) {
64
+ return typeof value === "function" || typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "undefined" || Array.isArray(value) || // Check for plain objects, and make sure it doesn't have the $$typeof property (react elements are never valid as style values)
65
+ typeof value === "object" && value.constructor === Object && !("$$typeof" in value);
66
+ }
67
+
68
+
69
+ var $64eb320fc02ff694$exports = {};
70
+ $64eb320fc02ff694$exports = JSON.parse('["align-content","align-items","align-self","align-tracks","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","aspect-ratio","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","block-overflow","block-size","border","border-block","border-block-color","border-block-style","border-block-width","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-end","border-inline-color","border-inline-style","border-inline-width","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","color","color-adjust","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","counter-set","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-variation-settings","font-size","font-size-adjust","font-smooth","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","forced-color-adjust","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","justify-tracks","left","letter-spacing","line-break","line-clamp","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-style","max-block-size","max-height","max-inline-size","max-lines","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-box","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","paint-order","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","quotes","resize","right","rotate","row-gap","ruby-align","ruby-merge","ruby-position","scale","scrollbar-color","scrollbar-gutter","scrollbar-width","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-start","scroll-margin-block-end","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-start","scroll-margin-inline-end","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-start","scroll-padding-block-end","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-start","scroll-padding-inline-end","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-coordinate","scroll-snap-destination","scroll-snap-points-x","scroll-snap-points-y","scroll-snap-stop","scroll-snap-type","scroll-snap-type-x","scroll-snap-type-y","shape-image-threshold","shape-margin","shape-outside","tab-size","table-layout","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","zoom"]');
71
+
72
+
73
+ /**
74
+ * Indicates that an object is most likely just an object literal.
75
+ */ function $36e7f66f12914cd9$export$53b83ca8eaab0383(obj) {
76
+ return typeof obj === "object" && obj?.constructor === Object;
77
+ }
78
+
79
+
80
+ function $7d749eb8074ec1f0$var$cleanObject(object) {
81
+ for(const key in object){
82
+ const value = object[key];
83
+ if (value === null || value === undefined || value === "") delete object[key];
84
+ else if ((0, $36e7f66f12914cd9$export$53b83ca8eaab0383)(value) || Array.isArray(value)) {
85
+ $7d749eb8074ec1f0$var$cleanObject(value);
86
+ if (!Object.keys(value).length) delete object[key];
87
+ }
88
+ }
89
+ return object;
90
+ }
91
+ const $7d749eb8074ec1f0$export$d01916932d7c8665 = {
92
+ name: "cleanStyles",
93
+ type: "processStyles",
94
+ plugin (ctx, styles) {
95
+ return $7d749eb8074ec1f0$var$cleanObject(styles);
96
+ }
97
+ };
98
+
99
+
100
+
101
+ function $1ae3b31df309d474$export$72ae87c5302f282e(object, map, context = {}) {
102
+ const clone = Array.isArray(object) ? [] : {};
103
+ for (const k of Object.keys(object)){
104
+ let key = k;
105
+ const value = object[key];
106
+ if (Array.isArray(object)) key = +key;
107
+ const contextClone = {
108
+ ...context
109
+ };
110
+ let result = map(key, value, object, contextClone);
111
+ if (typeof result !== "undefined" && typeof result !== "object" && !Array.isArray(result)) throw new Error("mapObjectRecursive: return value of map function must be undefined, object, or array!");
112
+ if (typeof result === "undefined") result = {
113
+ [key]: value
114
+ };
115
+ for(const kk in result){
116
+ let value = result[kk];
117
+ if ((0, $36e7f66f12914cd9$export$53b83ca8eaab0383)(value) || Array.isArray(value)) value = $1ae3b31df309d474$export$72ae87c5302f282e(value, map, contextClone);
118
+ if (typeof value !== "undefined") clone[kk] = value;
119
+ }
120
+ }
121
+ return clone;
122
+ }
123
+
124
+
125
+ const $c48fd0dbd5f815aa$export$dada68e03f41f865 = [
126
+ "columns",
127
+ "column-count",
128
+ "fill-opacity",
129
+ "flex",
130
+ "flex-grow",
131
+ "flex-shrink",
132
+ "font-weight",
133
+ "line-height",
134
+ "opacity",
135
+ "orphans",
136
+ "stroke-opacity",
137
+ "widows",
138
+ "z-index",
139
+ "zoom",
140
+ "order"
141
+ ];
142
+ const $c48fd0dbd5f815aa$export$18583267fbb07c11 = (unit = "px", ignoreProps = $c48fd0dbd5f815aa$export$dada68e03f41f865)=>{
143
+ return {
144
+ name: "defaultUnits",
145
+ type: "processStyles",
146
+ plugin (ctx, styles) {
147
+ return (0, $1ae3b31df309d474$export$72ae87c5302f282e)(styles, $c48fd0dbd5f815aa$var$defaultUnitsMap, {
148
+ unit: unit,
149
+ ignoreProps: ignoreProps
150
+ });
151
+ }
152
+ };
153
+ };
154
+ const $c48fd0dbd5f815aa$var$defaultUnitsMap = (key, value, object, ctx)=>{
155
+ if (typeof value === "number" && !ctx.ignoreProps.includes(key)) return {
156
+ [key]: String(value) + ctx.unit
157
+ };
158
+ };
159
+ const $c48fd0dbd5f815aa$export$30fd8e83e8b8d3e8 = $c48fd0dbd5f815aa$export$18583267fbb07c11();
160
+
161
+
162
+
163
+ function $c8dda8e320ddf617$var$flatten(styles, parent, selector, root, mediaRoot) {
164
+ for(let key in styles){
165
+ const value = styles[key];
166
+ if (key.startsWith("@media")) {
167
+ // Flatten media queries, but nest them under the root object
168
+ root[key] = root[key] || {};
169
+ $c8dda8e320ddf617$var$flatten(value, root[key], selector, root, root[key]);
170
+ } else if (key.startsWith("@keyframes")) // Add keyframe rules as-is directly to mediaRoot object
171
+ mediaRoot[key] = value;
172
+ else if ((0, $36e7f66f12914cd9$export$53b83ca8eaab0383)(styles[key])) {
173
+ // Concatenate or replace & in selectors and then continue flattening styles
174
+ if (key.includes("&")) key = key.replace(/&/g, selector);
175
+ else key = (selector + " " + key).trim();
176
+ parent[key] = parent[key] || {};
177
+ $c8dda8e320ddf617$var$flatten(value, parent, key, root, mediaRoot);
178
+ } else {
179
+ // Selector is just a css property
180
+ parent[selector] = parent[selector] || {};
181
+ parent[selector][key] = styles[key];
182
+ }
183
+ }
184
+ }
185
+ const $c8dda8e320ddf617$export$83990f03bc941cb5 = {
186
+ name: "flattenNestedStyles",
187
+ type: "processStyles",
188
+ plugin (ctx, styles) {
189
+ const flattened = {};
190
+ $c8dda8e320ddf617$var$flatten(styles, flattened, "", flattened, flattened);
191
+ return flattened;
192
+ }
193
+ };
194
+
195
+
196
+
197
+
198
+ const $146fcd00a9d12160$export$7cc8703894decffe = {
199
+ name: "mediaArrays",
200
+ type: "processStyles",
201
+ plugin (ctx, styles) {
202
+ // Fill out ditto values
203
+ styles = (0, $1ae3b31df309d474$export$72ae87c5302f282e)(styles, $146fcd00a9d12160$var$mapDittoValues);
204
+ const mediaStyles = {};
205
+ let nonMediaStyles = styles;
206
+ for(const i in ctx.media){
207
+ const mediaQuery = ctx.media[i];
208
+ if (!mediaQuery) nonMediaStyles = (0, $1ae3b31df309d474$export$72ae87c5302f282e)(styles, $146fcd00a9d12160$var$mapNonMedia, {
209
+ i: i
210
+ });
211
+ else mediaStyles[`@media ${mediaQuery}`] = (0, $1ae3b31df309d474$export$72ae87c5302f282e)(styles, $146fcd00a9d12160$var$mapMediaStyles, {
212
+ i: i
213
+ });
214
+ }
215
+ return {
216
+ ...nonMediaStyles,
217
+ ...mediaStyles
218
+ };
219
+ }
220
+ };
221
+ function $146fcd00a9d12160$var$mapDittoValues(key, value) {
222
+ if (Array.isArray(value)) {
223
+ for(const i in value){
224
+ const v = value[i];
225
+ if (v === "@") value[i] = value[+i - 1];
226
+ }
227
+ return {
228
+ [key]: value
229
+ };
230
+ }
231
+ }
232
+ function $146fcd00a9d12160$var$mapNonMedia(key, value, object, context) {
233
+ if (Array.isArray(value)) return {
234
+ [key]: value[context.i]
235
+ };
236
+ }
237
+ function $146fcd00a9d12160$var$mapMediaStyles(key, value, object, context) {
238
+ if (typeof key === "number") return; // Not possible, but here for TS
239
+ if (key.startsWith("@keyframes")) context.keyframes = true;
240
+ if (Array.isArray(value)) return {
241
+ [key]: value[context.i]
242
+ };
243
+ if ((0, $36e7f66f12914cd9$export$53b83ca8eaab0383)(value) || context.keyframes) return;
244
+ // delete key/value pair if primitive
245
+ return {
246
+ [key]: undefined
247
+ };
248
+ }
249
+
250
+
251
+ /**
252
+ * Flatten an array recursively.
253
+ */ function $6f995047b8c46148$export$bffa455ba8c619a6(array) {
254
+ const result = [];
255
+ $6f995047b8c46148$var$_flatten(array, result);
256
+ return result;
257
+ }
258
+ function $6f995047b8c46148$var$_flatten(array, result) {
259
+ for(let i = 0; i < array.length; i++){
260
+ const value = array[i];
261
+ Array.isArray(value) ? $6f995047b8c46148$var$_flatten(value, result) : result.push(value);
262
+ }
263
+ }
264
+
265
+
266
+
267
+ const $bf0e5f2ae2622b0c$export$3fc9bcb7effc6280 = {
268
+ name: "merge$css",
269
+ type: "processStyles",
270
+ plugin (ctx, styles) {
271
+ const result = {};
272
+ $bf0e5f2ae2622b0c$export$f9e25e3471fd9b77(styles, result);
273
+ return result;
274
+ }
275
+ };
276
+ function $bf0e5f2ae2622b0c$export$f9e25e3471fd9b77(obj, ctx) {
277
+ if (!(0, $36e7f66f12914cd9$export$53b83ca8eaab0383)(obj)) return;
278
+ for(const key in obj)if (key === "$css") {
279
+ const $css = obj[key];
280
+ if (Array.isArray($css)) {
281
+ const flat$css = (0, $6f995047b8c46148$export$bffa455ba8c619a6)($css);
282
+ for (const val of flat$css)$bf0e5f2ae2622b0c$export$f9e25e3471fd9b77(val, ctx);
283
+ } else $bf0e5f2ae2622b0c$export$f9e25e3471fd9b77($css, ctx);
284
+ } else {
285
+ let value = obj[key];
286
+ if ((0, $36e7f66f12914cd9$export$53b83ca8eaab0383)(value)) {
287
+ value = ctx[key] || {};
288
+ $bf0e5f2ae2622b0c$export$f9e25e3471fd9b77(obj[key], value);
289
+ }
290
+ ctx[key] = value;
291
+ }
292
+ }
293
+
294
+
295
+
296
+
297
+ const $2244b5cf9ed91939$export$d85214c343312efe = {
298
+ name: "normalizeStyleProps",
299
+ type: "processStyles",
300
+ plugin (ctx, styles) {
301
+ return (0, $1ae3b31df309d474$export$72ae87c5302f282e)(styles, $2244b5cf9ed91939$var$propCasingMap, {
302
+ ctx: ctx
303
+ });
304
+ }
305
+ };
306
+ function $2244b5cf9ed91939$var$propCasingMap(key, value, object, context) {
307
+ if (typeof key === "string" && context.ctx.styleProps[(0, $d4abddb46f405b94$export$2eda63d9f5a68c09)(key)]) return {
308
+ [context.ctx.styleProps[(0, $d4abddb46f405b94$export$2eda63d9f5a68c09)(key)]]: value
309
+ };
310
+ }
311
+
312
+
313
+
314
+ const $d52a2b9927acef1b$export$a5988781fa300750 = {
315
+ name: "replace$$class",
316
+ type: "processStyles",
317
+ plugin (ctx, styles) {
318
+ return (0, $1ae3b31df309d474$export$72ae87c5302f282e)(styles, $d52a2b9927acef1b$var$replace$$classMap, {
319
+ ctx: ctx
320
+ });
321
+ }
322
+ };
323
+ function $d52a2b9927acef1b$var$replace$$classMap(key, value, object, context) {
324
+ value = typeof value === "string" ? value.replace("$$class", context.ctx.hash) : value;
325
+ key = typeof key === "string" ? key.replace("$$class", context.ctx.hash) : key;
326
+ return {
327
+ [key]: value
328
+ };
329
+ }
330
+
331
+
332
+
333
+ const $f9ae6631426ed700$export$d9c204138d106585 = {
334
+ name: "themeFunctions",
335
+ type: "preprocessStyles",
336
+ plugin (ctx, styles) {
337
+ return (0, $1ae3b31df309d474$export$72ae87c5302f282e)(styles, $f9ae6631426ed700$var$themeFunctionsMap, {
338
+ ctx: ctx
339
+ });
340
+ }
341
+ };
342
+ function $f9ae6631426ed700$var$themeFunctionsMap(key, value, object, context) {
343
+ if (typeof value === "function") return {
344
+ [key]: value(context.ctx.theme, context.ctx)
345
+ };
346
+ }
347
+
348
+
349
+
350
+
351
+
352
+ function $fa892880309a8c54$export$629a2bd3f5a49ecc(value) {
353
+ if (!value || typeof value !== "object") return value;
354
+ if (Array.isArray(value)) {
355
+ const clone = [];
356
+ for(let index = 0; index < value.length; ++index)clone.push($fa892880309a8c54$export$629a2bd3f5a49ecc(value[index]));
357
+ return clone;
358
+ }
359
+ if ((0, $36e7f66f12914cd9$export$53b83ca8eaab0383)(value)) {
360
+ const clone = {};
361
+ for(const key in value)clone[key] = $fa892880309a8c54$export$629a2bd3f5a49ecc(value[key]);
362
+ return clone;
363
+ }
364
+ return value;
365
+ }
366
+
367
+
368
+
369
+ function $0893146e2e8f7a0d$export$a8d8e56b740dab80(object, cb, context) {
370
+ const keys = Object.keys(object);
371
+ for (const key of keys){
372
+ const value = object[key];
373
+ cb(key, value, object, context);
374
+ if (Array.isArray(value) || (0, $36e7f66f12914cd9$export$53b83ca8eaab0383)(value)) {
375
+ const contextClone = (0, $fa892880309a8c54$export$629a2bd3f5a49ecc)(context);
376
+ $0893146e2e8f7a0d$export$a8d8e56b740dab80(value, cb, contextClone);
377
+ }
378
+ }
379
+ return object;
380
+ }
381
+
382
+
383
+
384
+ const $3173bf4e08028305$export$95cef81be5ddcfd4 = (customProps)=>{
385
+ for(const key in customProps)customProps[(0, $d4abddb46f405b94$export$2eda63d9f5a68c09)(key)] = customProps[key];
386
+ return [
387
+ {
388
+ name: "customPropsInit",
389
+ type: "initialize",
390
+ plugin (ctx) {
391
+ for(const key in customProps)ctx.styleProps[(0, $d4abddb46f405b94$export$2eda63d9f5a68c09)(key)] = key;
392
+ }
393
+ },
394
+ {
395
+ name: "customPropsProcess",
396
+ type: "processStyles",
397
+ before: (0, $146fcd00a9d12160$export$7cc8703894decffe),
398
+ plugin (ctx, styles) {
399
+ return (0, $0893146e2e8f7a0d$export$a8d8e56b740dab80)(styles, (key, value, object)=>{
400
+ if (!(0, $d4abddb46f405b94$export$4ee529ad08c1c79c)(key) || (0, $36e7f66f12914cd9$export$53b83ca8eaab0383)(value)) return;
401
+ const simpleKey = (0, $d4abddb46f405b94$export$2eda63d9f5a68c09)(key);
402
+ const propValue = customProps[simpleKey];
403
+ if (!propValue) return;
404
+ const objectClone = {
405
+ ...object
406
+ };
407
+ const keys = Object.keys(object);
408
+ const afterKeys = keys.slice(keys.indexOf(key) + 1);
409
+ const newStyles = {};
410
+ if (typeof propValue === "object") {
411
+ if (value) Object.assign(newStyles, propValue);
412
+ } else if (typeof propValue === "string") newStyles[propValue] = value;
413
+ else if (typeof propValue === "function") Object.assign(newStyles, propValue(value));
414
+ delete object[key];
415
+ Object.assign(object, newStyles);
416
+ for (const k of afterKeys){
417
+ const val = objectClone[k];
418
+ delete object[k];
419
+ object[k] = val;
420
+ }
421
+ });
422
+ }
423
+ }
424
+ ];
425
+ };
426
+
427
+
428
+ function $cb46c37cd304d3d0$export$dd20d84ec8823bbf(type, styles, hash, context) {
429
+ const pluginContext = {
430
+ id: context.id,
431
+ devMode: context.devMode,
432
+ theme: context.theme,
433
+ media: context.media,
434
+ stylesheet: context.stylesheet,
435
+ styleElement: context.styleElement,
436
+ styleProps: context.styleProps,
437
+ hash: hash
438
+ };
439
+ let processedStyles = styles;
440
+ for(const i in context.plugins){
441
+ const plugin = context.plugins[i];
442
+ if (plugin.type === type) processedStyles = plugin.plugin(pluginContext, processedStyles);
443
+ }
444
+ return processedStyles;
445
+ }
446
+ const $cb46c37cd304d3d0$export$b5ecb47695d6786e = {
447
+ themeFunctions: $f9ae6631426ed700$export$d9c204138d106585,
448
+ merge$css: $bf0e5f2ae2622b0c$export$3fc9bcb7effc6280,
449
+ mediaArrays: $146fcd00a9d12160$export$7cc8703894decffe,
450
+ propCasing: $2244b5cf9ed91939$export$d85214c343312efe,
451
+ flattenNestedStyles: $c8dda8e320ddf617$export$83990f03bc941cb5,
452
+ replace$$class: $d52a2b9927acef1b$export$a5988781fa300750,
453
+ defaultPixelUnits: $c48fd0dbd5f815aa$export$30fd8e83e8b8d3e8,
454
+ cleanStyles: $7d749eb8074ec1f0$export$d01916932d7c8665
455
+ };
456
+
457
+
458
+
459
+ const $0c5ff6b44ea9986a$export$9b609b8e22cde6fe = /*#__PURE__*/ (0, $cPdmE$react.createContext)(null);
460
+ function $0c5ff6b44ea9986a$export$d3207b3764661c07() {
461
+ const styles = [];
462
+ const collector = {
463
+ collect: (element)=>/*#__PURE__*/ (0, ($parcel$interopDefault($cPdmE$react))).createElement($0c5ff6b44ea9986a$export$9b609b8e22cde6fe.Provider, {
464
+ value: styles
465
+ }, element),
466
+ render: (props)=>/*#__PURE__*/ (0, ($parcel$interopDefault($cPdmE$react))).createElement("style", {
467
+ type: "text/css",
468
+ key: props.id || "stylix",
469
+ ...props,
470
+ dangerouslySetInnerHTML: {
471
+ __html: collector.styles.join(" ")
472
+ }
473
+ }),
474
+ styles: styles
475
+ };
476
+ collector.render.displayName = "StylixStyleCollectorRenderer";
477
+ return collector;
478
+ }
479
+
480
+
481
+
482
+
483
+ function $69d6532a08c5f203$export$4950aa0f605343fb(...items) {
484
+ items = items.filter((item)=>typeof item !== "undefined" && item !== null);
485
+ if (!items?.length) return undefined;
486
+ if (items.length === 1) return items[0];
487
+ // If items are not all objects/arrays, return the last object/array if possible, otherwise last non-undefined value
488
+ if (!items.every((item)=>Array.isArray(item) || (0, $36e7f66f12914cd9$export$53b83ca8eaab0383)(item))) {
489
+ items.reverse();
490
+ return items.find((item)=>Array.isArray(item) || (0, $36e7f66f12914cd9$export$53b83ca8eaab0383)(item)) || items.find((item)=>typeof item !== "undefined");
491
+ }
492
+ const merged = Array.isArray(items[0]) ? [] : {};
493
+ for (const item of items){
494
+ if (!Array.isArray(item) && !(0, $36e7f66f12914cd9$export$53b83ca8eaab0383)(item)) return merged;
495
+ const keys = [
496
+ ...Object.keys(item),
497
+ ...Object.getOwnPropertySymbols(item)
498
+ ];
499
+ for (const key of keys){
500
+ const result = $69d6532a08c5f203$export$4950aa0f605343fb(merged[key], item[key]);
501
+ if (typeof result !== "undefined") merged[key] = result;
502
+ }
503
+ }
504
+ return merged;
505
+ }
506
+
507
+
508
+
509
+ const $4eafd441781a8103$var$useIsoLayoutEffect = typeof window !== "undefined" && "document" in window ? (fn, deps, _runOnSsr)=>(0, $cPdmE$react.useLayoutEffect)(fn, deps) : (fn, _deps, runOnSsr)=>runOnSsr ? fn() : null;
510
+ var $4eafd441781a8103$export$2e2bcd8739ae039 = $4eafd441781a8103$var$useIsoLayoutEffect;
511
+
512
+
513
+ const $918367b4cbc7189f$var$defaultStyleProps = {};
514
+ for (const value of (0, (/*@__PURE__*/$parcel$interopDefault($64eb320fc02ff694$exports))))$918367b4cbc7189f$var$defaultStyleProps[(0, $d4abddb46f405b94$export$2eda63d9f5a68c09)(value)] = value;
515
+ function $918367b4cbc7189f$var$createStylixContext(userValues = {}) {
516
+ const ctx = {
517
+ id: userValues.id || Math.round(Math.random() * 10000).toString(10),
518
+ devMode: userValues.devMode,
519
+ styleProps: $918367b4cbc7189f$var$defaultStyleProps,
520
+ theme: userValues.theme || null,
521
+ media: userValues.media || null,
522
+ styleElement: userValues.styleElement,
523
+ plugins: (0, $6f995047b8c46148$export$bffa455ba8c619a6)(Object.values((0, $cb46c37cd304d3d0$export$b5ecb47695d6786e))),
524
+ rules: {},
525
+ cleanupRequest: undefined
526
+ };
527
+ if (!ctx.styleElement && typeof document !== "undefined") {
528
+ ctx.styleElement = document.createElement("style");
529
+ if (ctx.id) ctx.styleElement.id = "stylix-" + ctx.id;
530
+ ctx.styleElement.className = "stylix";
531
+ document.head.appendChild(ctx.styleElement);
532
+ }
533
+ if (ctx.styleElement) ctx.stylesheet = ctx.styleElement.sheet;
534
+ if (userValues.plugins?.length) {
535
+ const flatPlugins = (0, $6f995047b8c46148$export$bffa455ba8c619a6)(userValues.plugins);
536
+ for(const i in flatPlugins){
537
+ const plugin = flatPlugins[i];
538
+ let pluginIndex = -1;
539
+ if (plugin.before && ctx.plugins.includes(plugin.before)) pluginIndex = ctx.plugins.indexOf(plugin.before);
540
+ if (plugin.after && ctx.plugins.includes(plugin.after)) pluginIndex = ctx.plugins.indexOf(plugin.after) + 1;
541
+ if (plugin.atIndex !== undefined) pluginIndex = plugin.atIndex;
542
+ if (pluginIndex === -1) ctx.plugins.push(plugin);
543
+ else ctx.plugins.splice(pluginIndex, 0, plugin);
544
+ }
545
+ }
546
+ (0, $cb46c37cd304d3d0$export$dd20d84ec8823bbf)("initialize", null, null, ctx);
547
+ return ctx;
548
+ }
549
+ // The React context object
550
+ const $918367b4cbc7189f$var$stylixContext = /*#__PURE__*/ (0, $cPdmE$react.createContext)($918367b4cbc7189f$var$createStylixContext());
551
+ function $918367b4cbc7189f$export$e3c6fdf4e371f028() {
552
+ return (0, $cPdmE$react.useContext)($918367b4cbc7189f$var$stylixContext);
553
+ }
554
+ function $918367b4cbc7189f$export$c01a354187f160ee() {
555
+ return (0, $cPdmE$react.useContext)($918367b4cbc7189f$var$stylixContext).theme;
556
+ }
557
+ function $918367b4cbc7189f$export$ae2c3ad5c234c4cc({ id: id , devMode: devMode , plugins: plugins , styleElement: styleElement , children: children , ...themeProps }) {
558
+ const ctx = (0, $cPdmE$react.useRef)();
559
+ if (!ctx.current) ctx.current = $918367b4cbc7189f$var$createStylixContext({
560
+ id: id,
561
+ devMode: devMode,
562
+ plugins: plugins,
563
+ styleElement: styleElement
564
+ });
565
+ ctx.current.styleCollector = (0, $cPdmE$react.useContext)((0, $0c5ff6b44ea9986a$export$9b609b8e22cde6fe));
566
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($cPdmE$react))).createElement($918367b4cbc7189f$var$stylixContext.Provider, {
567
+ value: ctx.current
568
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($cPdmE$react))).createElement($918367b4cbc7189f$export$91c80431af53fbc7, themeProps, children));
569
+ }
570
+ function $918367b4cbc7189f$var$mergeContexts(contextA, contextB) {
571
+ const obj = {
572
+ ...contextA
573
+ };
574
+ const themeB = contextB.theme;
575
+ if (contextB) for(const key in contextB){
576
+ const value = contextB[key];
577
+ if (typeof value !== "undefined") obj[key] = value;
578
+ }
579
+ obj.theme = (0, $69d6532a08c5f203$export$4950aa0f605343fb)(contextA.theme || {}, themeB);
580
+ return obj;
581
+ }
582
+ function $918367b4cbc7189f$export$91c80431af53fbc7({ children: children , media: media , theme: theme }) {
583
+ const parentCtx = (0, $cPdmE$react.useContext)($918367b4cbc7189f$var$stylixContext);
584
+ const [contextValue, setContextValue] = (0, $cPdmE$react.useState)(()=>$918367b4cbc7189f$var$mergeContexts(parentCtx, {
585
+ media: media,
586
+ theme: theme
587
+ }));
588
+ // contextValue should only update (and cause re-renders) when relevant properties change.
589
+ // `media` is treated as special because providing an array of strings is easier to do inline,
590
+ // but we don't want to cause descendent re-renders if the values don't change.
591
+ (0, $4eafd441781a8103$export$2e2bcd8739ae039)(()=>{
592
+ setContextValue($918367b4cbc7189f$var$mergeContexts(parentCtx, {
593
+ media: media,
594
+ theme: theme
595
+ }));
596
+ }, [
597
+ parentCtx,
598
+ media?.join("|") || "",
599
+ theme
600
+ ], false);
601
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($cPdmE$react))).createElement($918367b4cbc7189f$var$stylixContext.Provider, {
602
+ value: contextValue
603
+ }, children);
604
+ }
605
+
606
+
607
+
608
+ function $3cb141540b096e82$export$2e2bcd8739ae039(ctx) {
609
+ const flattenedRules = [];
610
+ for(const key in ctx.rules){
611
+ const val = ctx.rules[key];
612
+ flattenedRules.push(...val.rules);
613
+ }
614
+ if (ctx.styleCollector) {
615
+ ctx.styleCollector.length = 0;
616
+ ctx.styleCollector.push(...flattenedRules);
617
+ return;
618
+ }
619
+ if (ctx.devMode) ctx.styleElement.innerHTML = flattenedRules.join("\n");
620
+ else {
621
+ const container = ctx.stylesheet;
622
+ if (container.cssRules) while(container.cssRules.length)container.deleteRule(0);
623
+ for(const i in flattenedRules)container.insertRule(flattenedRules[i], +i);
624
+ }
625
+ }
626
+
627
+
628
+
629
+
630
+
631
+ function $d7b71dffbc028505$export$2e2bcd8739ae039(styles, hash, context) {
632
+ try {
633
+ const processedStyles = (0, $cb46c37cd304d3d0$export$dd20d84ec8823bbf)("processStyles", styles, hash, context);
634
+ // serialize to css rules array
635
+ const serialize = function serialize(selector, styles) {
636
+ const lines = [];
637
+ for(const key in styles){
638
+ const value = styles[key];
639
+ if ((0, $36e7f66f12914cd9$export$53b83ca8eaab0383)(value)) lines.push(serialize(key, value));
640
+ else lines.push(` ${key}: ${value};`);
641
+ }
642
+ return `${selector} {\n${lines.join("\n")} }`;
643
+ };
644
+ const result = [];
645
+ for(const key in processedStyles){
646
+ const value = processedStyles[key];
647
+ result.push(serialize(key, value));
648
+ }
649
+ return result;
650
+ } catch (e) {
651
+ if (e.name && e.reason) console.error(`${e.name}: ${e.reason}\n`, e.source.replace("\n", " ").substr(Math.max(0, e.column - 20), 100) + "\n", " ".repeat(20) + "^");
652
+ else console.error(e);
653
+ return [];
654
+ }
655
+ }
656
+
657
+
658
+
659
+ /**
660
+ * Cheap string hashing, suitable for generating css class names
661
+ */ function $472b80d0b3855b37$export$9169be2e06c9c165(str) {
662
+ let hash = 5381;
663
+ let i = str.length;
664
+ while(i)hash = hash * 33 ^ str.charCodeAt(--i);
665
+ return "stylix-" + (hash >>> 0).toString(36);
666
+ }
667
+
668
+
669
+
670
+ function $b7bb7699b24ef4bd$var$cleanup(ctx) {
671
+ if (typeof ctx.cleanupRequest !== "undefined") return;
672
+ ctx.cleanupRequest = setTimeout(()=>{
673
+ let deleted = false;
674
+ for(const i in ctx.rules){
675
+ const rule = ctx.rules[i];
676
+ if (!rule.refs) {
677
+ delete ctx.rules[rule.hash];
678
+ deleted = true;
679
+ }
680
+ }
681
+ deleted && (0, $3cb141540b096e82$export$2e2bcd8739ae039)(ctx);
682
+ delete ctx.cleanupRequest;
683
+ }, 100);
684
+ }
685
+ function $b7bb7699b24ef4bd$var$compare(a, b) {
686
+ if (a === b) return true;
687
+ if (typeof a !== typeof b) return false;
688
+ if (typeof a === "object") {
689
+ if (Array.isArray(a) && Array.isArray(b) && a.length !== b.length) return false;
690
+ else if (Object.keys(a).length !== Object.keys(b).length) return false;
691
+ for(const key in b){
692
+ if (!$b7bb7699b24ef4bd$var$compare(a[key], b[key])) return false;
693
+ }
694
+ }
695
+ return a === b;
696
+ }
697
+ function $b7bb7699b24ef4bd$export$28e6b9b82ee883c(styles, options = {
698
+ global: false,
699
+ disabled: false
700
+ }) {
701
+ const stylixCtx = (0, $918367b4cbc7189f$export$e3c6fdf4e371f028)();
702
+ const prevRef = (0, $cPdmE$react.useRef)({
703
+ styles: {},
704
+ hash: ""
705
+ });
706
+ const changed = !$b7bb7699b24ef4bd$var$compare(styles, prevRef.current.styles);
707
+ prevRef.current.styles = styles;
708
+ if (changed) {
709
+ // Preprocess styles with plugins
710
+ if (!options.disabled && styles) styles = (0, $cb46c37cd304d3d0$export$dd20d84ec8823bbf)("preprocessStyles", styles, null, stylixCtx);
711
+ // Serialize value and generate hash
712
+ const json = !options.disabled && styles && JSON.stringify(styles);
713
+ prevRef.current.hash = json && json !== "{}" && json !== "[]" ? (0, $472b80d0b3855b37$export$9169be2e06c9c165)(JSON.stringify(stylixCtx.media || []) + json) : "";
714
+ }
715
+ const { hash: hash } = prevRef.current;
716
+ if (hash && changed && !stylixCtx.rules[hash]) {
717
+ // If not global styles, wrap original styles with classname
718
+ if (!options.global) styles = {
719
+ ["." + hash]: styles
720
+ };
721
+ stylixCtx.rules[hash] = {
722
+ hash: hash,
723
+ rules: (0, $d7b71dffbc028505$export$2e2bcd8739ae039)(styles, hash, stylixCtx),
724
+ refs: 1
725
+ };
726
+ stylixCtx.requestApply = true;
727
+ }
728
+ // Apply styles if requested.
729
+ // This runs on every render. We utilize useLayoutEffect so that it runs *after* all the other
730
+ // renders have completed. stylixCtx.requestApply guards against multiple runs. This reduces the number of calls
731
+ // to applyRules(), but prevents styles potentially being added to the DOM after other components force the
732
+ // browser to compute styles.
733
+ (0, $4eafd441781a8103$export$2e2bcd8739ae039)(()=>{
734
+ if (!stylixCtx.requestApply) return;
735
+ stylixCtx.requestApply = false;
736
+ (0, $3cb141540b096e82$export$2e2bcd8739ae039)(stylixCtx);
737
+ }, undefined, true);
738
+ // When hash changes, add/remove ref count
739
+ (0, $4eafd441781a8103$export$2e2bcd8739ae039)(()=>{
740
+ if (!hash || !changed) return;
741
+ if (stylixCtx.rules[hash]) stylixCtx.rules[hash].refs++;
742
+ return ()=>{
743
+ stylixCtx.rules[hash].refs--;
744
+ $b7bb7699b24ef4bd$var$cleanup(stylixCtx);
745
+ };
746
+ }, [
747
+ hash
748
+ ], false);
749
+ return hash;
750
+ }
751
+ function $b7bb7699b24ef4bd$export$f3922bb611b91373(keyframes, options = {
752
+ disabled: false
753
+ }) {
754
+ return $b7bb7699b24ef4bd$export$28e6b9b82ee883c({
755
+ "@keyframes $$class": keyframes
756
+ }, {
757
+ global: true,
758
+ ...options
759
+ });
760
+ }
761
+ function $b7bb7699b24ef4bd$export$abac79b9db5ae47b(styles, options = {
762
+ disabled: false
763
+ }) {
764
+ return $b7bb7699b24ef4bd$export$28e6b9b82ee883c(styles, {
765
+ ...options,
766
+ global: true
767
+ });
768
+ }
769
+
770
+
771
+
772
+
773
+
774
+
775
+
776
+
777
+
778
+
779
+
780
+
781
+ function $a4e8092b68236a62$export$7204462c24cfcb17(props, ref) {
782
+ const { $el: $el , $css: $css , $disabled: $disabled , className: className , children: children , ...rest } = props;
783
+ const ctx = (0, $918367b4cbc7189f$export$e3c6fdf4e371f028)();
784
+ const [styleProps, otherProps] = (0, $d4abddb46f405b94$export$54b296e95917282f)(rest, ctx.styleProps);
785
+ if ($css) styleProps.$css = $css;
786
+ const hash = (0, $b7bb7699b24ef4bd$export$28e6b9b82ee883c)(styleProps, {
787
+ disabled: $disabled
788
+ });
789
+ const allProps = {
790
+ className: `${hash} ${className || ""}`.trim(),
791
+ ref: ref,
792
+ ...otherProps
793
+ };
794
+ if (/*#__PURE__*/ (0, ($parcel$interopDefault($cPdmE$react))).isValidElement($el)) {
795
+ const $elProps = {
796
+ ...$el.props
797
+ };
798
+ allProps.className += " " + ($elProps.className || "");
799
+ delete $elProps.className;
800
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($cPdmE$react))).cloneElement($el, {
801
+ ...allProps,
802
+ ...$elProps
803
+ }, ...(0, ($parcel$interopDefault($cPdmE$react))).Children.toArray(children) || []);
804
+ }
805
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($cPdmE$react))).createElement($el, allProps, children);
806
+ }
807
+ const $a4e8092b68236a62$var$Stylix = /*#__PURE__*/ (0, ($parcel$interopDefault($cPdmE$react))).forwardRef($a4e8092b68236a62$export$7204462c24cfcb17);
808
+ $a4e8092b68236a62$var$Stylix.displayName = "Stylix";
809
+ $a4e8092b68236a62$var$Stylix.__isStylix = true;
810
+ var $a4e8092b68236a62$export$2e2bcd8739ae039 = $a4e8092b68236a62$var$Stylix;
811
+
812
+
813
+ function $f7963c5fb85d4dcf$export$3817b7a54a07cec7($el, addProps, conflictingPropMapping) {
814
+ const Element = typeof $el === "string" ? $el : /*#__PURE__*/ (0, ($parcel$interopDefault($cPdmE$react))).forwardRef($el);
815
+ const r = /*#__PURE__*/ (0, ($parcel$interopDefault($cPdmE$react))).forwardRef((props, ref)=>{
816
+ if (conflictingPropMapping) for(const k in conflictingPropMapping){
817
+ props[conflictingPropMapping[k]] = props[k];
818
+ delete props[k];
819
+ }
820
+ return (0, $a4e8092b68236a62$export$7204462c24cfcb17)({
821
+ $el: Element,
822
+ ...addProps,
823
+ ...props,
824
+ $css: [
825
+ addProps?.$css,
826
+ props?.$css
827
+ ]
828
+ }, ref);
829
+ });
830
+ r.displayName = `$.${$el.displayName || $el.name || $el.toString?.() || "Unnamed"}`;
831
+ r.__isStylix = true;
832
+ return r;
833
+ }
834
+
835
+
836
+ var $d8489f3ea07e10a9$exports = {};
837
+ $d8489f3ea07e10a9$exports = JSON.parse('["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]');
838
+
839
+
840
+
841
+
842
+ for(const i in 0, (/*@__PURE__*/$parcel$interopDefault($d8489f3ea07e10a9$exports))){
843
+ // Types are specified in ./types.ts, so we don't care what they type of htmlTags[i] is.
844
+ // JSX.IntrinsicElements is a union of all HTML tags, so it is too complex for TypeScript to infer.
845
+ const tag = (0, (/*@__PURE__*/$parcel$interopDefault($d8489f3ea07e10a9$exports)))[i];
846
+ (0, $a4e8092b68236a62$export$2e2bcd8739ae039)[tag] = (0, $f7963c5fb85d4dcf$export$3817b7a54a07cec7)(tag);
847
+ }
848
+
849
+
850
+
851
+
852
+
853
+ //# sourceMappingURL=index.js.map