@stylix/core 5.1.0 → 6.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.
package/README.md CHANGED
@@ -1,100 +1,367 @@
1
- # Stylix ⚛ React, with style.
1
+ # Stylix
2
2
 
3
- Add styles to your React apps with props: the easy, natural, and low learning curve approach.
3
+ > React, with style. Add styles to your React apps with props: the easy, natural, and low-learning-curve approach.
4
4
 
5
- Stylix is a new library and methodology for styling your React apps. With Stylix, you add styles to
6
- your components the same way you add any other information: with **props**.
5
+ Stylix is a CSS-in-JS library built for React developers who want a seamless, intuitive styling experience. With Stylix, you write styles as props on components you already know, staying within the React paradigm you love.
7
6
 
8
- No separate CSS files, quirky alternative JavaScript syntax, or build tool
9
- configuration—**everything is React**, minimizing your learning curve and encouraging the same
10
- patterns and organizational best practices that have made React so popular.
7
+ Stylix offers:
8
+ - Props-based styling on HTML elements
9
+ - Hooks for dynamic and global styles
10
+ - Keyframe animations
11
+ - Server-side rendering
12
+ - An extensible plugin system
11
13
 
12
- If you still aren't convinced, read the [Why Stylix?](https://stylix.dev) documentation page to see
13
- why we created Stylix, and why we think you'll love it.
14
+ ## Why Stylix?
14
15
 
15
- **[Read the full documentation](https://stylix.dev)** for more guides and the API reference.
16
+ We created Stylix to solve common styling pain points in React applications:
17
+ - **Co-located styles**: Keep your styles next to your components—no separate CSS files.
18
+ - **Familiar API**: Style props feel like any other React prop.
19
+ - **Type safety**: Enjoy autocompletion and validation with TypeScript.
20
+ - **Zero config**: No extra build steps or CSS preprocessors required.
21
+ - **Extensible**: Customize behavior with a flexible plugin system.
16
22
 
17
23
  ## Installation
18
24
 
19
- Stylix can be installed with **npm** or **yarn**:
20
-
21
- ```sh
22
- $ npm install --save @stylix/core
25
+ ```bash
26
+ npm install @stylix/core
23
27
  # or
24
- $ yard add @stylix/core
28
+ yarn add @stylix/core
25
29
  ```
26
30
 
27
- Stylix is compatible with React 16.8+.
28
-
29
- ## How to use Stylix
31
+ Peer dependencies: `react`, `react-dom` >= 18.0.0.
30
32
 
31
- ### Wrap your app with a `<StylixProvider>` element
33
+ ## Quick Start
32
34
 
33
- Start by importing `StylixProvider` from `@stylix/core` and placing a `<StylixProvider>` element at
34
- the root of your app:
35
+ Let's build a simple styled card component to see Stylix in action:
35
36
 
36
37
  ```tsx
38
+ import React from 'react';
37
39
  import { StylixProvider } from '@stylix/core';
40
+ import $ from '@stylix/core';
38
41
 
39
42
  function App() {
40
43
  return (
41
44
  <StylixProvider>
42
- {/* your app */}
45
+ <$.div
46
+ padding={20}
47
+ background-color="white"
48
+ border-radius={8}
49
+ box-shadow="0 2px 4px rgba(0,0,0,0.1)"
50
+ max-width={300}
51
+ margin="auto"
52
+ >
53
+ <$.h2 margin-bottom={12} font-size={18} font-weight="600">
54
+ Welcome to Stylix
55
+ </$.h2>
56
+ <$.p color="gray" line-height={1.5}>
57
+ Styling your React app has never been easier.
58
+ </$.p>
59
+ </$.div>
43
60
  </StylixProvider>
44
61
  );
45
62
  }
46
63
  ```
47
64
 
48
- The `<StylixProvider>` element can provide media queries and plugins to descendent elements. Each
49
- `<StylixProvider>` element outputs the CSS for its descendant elements to a `<style>` element that
50
- it places in your page's `<head>`. This behavior, and a few other configuration options, can be
51
- customized.
65
+ In this example:
66
+ - We wrap our app in `<StylixProvider>` to enable styling context and automatic style injection.
67
+ - We use the `$` export to render styled HTML tags like `<$.div>`, `<$.h2>`, and `<$.p>`.
68
+ - We pass CSS properties as props, supporting camelCase and kebab-case syntax.
52
69
 
53
- ### Style your markup with Stylix HTML tags
70
+ ### Styling Custom Components
54
71
 
55
- Import the default `$` object from `@stylix/core` and use it to render stylable HTML elements in
56
- place of the regular old tags:
72
+ When styling custom React components or third-party elements, use the `useStyles` hook to generate a `className`:
57
73
 
58
74
  ```tsx
75
+ import React from 'react';
76
+ import { useStyles } from '@stylix/core';
77
+
78
+ function Button({ children }) {
79
+ const cn = useStyles({
80
+ padding: 12,
81
+ backgroundColor: 'blue',
82
+ color: 'white',
83
+ border: 'none',
84
+ borderRadius: 4,
85
+ cursor: 'pointer',
86
+ ':hover': {
87
+ backgroundColor: 'darkblue',
88
+ },
89
+ });
90
+ return <button className={cn}>{children}</button>;
91
+ }
92
+ ```
93
+
94
+ ### Global Styles and Keyframes
95
+
96
+ Often you need to set up global CSS rules or define animations. Stylix exposes two hooks:
97
+
98
+ - **`useGlobalStyles`**: Injects global CSS rules into the document.
99
+ - **`useKeyframes`**: Generates unique keyframe animation names.
100
+
101
+ ```tsx
102
+ import React from 'react';
103
+ import { StylixProvider, useGlobalStyles, useKeyframes } from '@stylix/core';
59
104
  import $ from '@stylix/core';
60
105
 
106
+ function GlobalStyle() {
107
+ // Define a spin animation
108
+ const spin = useKeyframes({
109
+ from: { transform: 'rotate(0deg)' },
110
+ to: { transform: 'rotate(360deg)' },
111
+ });
112
+
113
+ // Apply global CSS rules
114
+ useGlobalStyles([
115
+ { html: { boxSizing: 'border-box' } },
116
+ { '*, *:before, *:after': { boxSizing: 'inherit' } },
117
+ { body: { margin: 0, fontFamily: 'sans-serif' } },
118
+ { '.spin': { animation: `${spin} 1s linear infinite` } },
119
+ ]);
120
+
121
+ return null;
122
+ }
123
+
124
+ function App() {
125
+ return (
126
+ <StylixProvider>
127
+ <GlobalStyle />
128
+ <$.div className="spin">🌀 Spinning</$.div>
129
+ </StylixProvider>
130
+ );
131
+ }
132
+ ```
133
+
134
+
135
+ ## Features
136
+
137
+ - **Props-based Styling**: Style any element or component by passing style props.
138
+ - **Hooks**: `useStyles`, `useGlobalStyles`, and `useKeyframes` for dynamic, global, and animated styles.
139
+ - **Server-side Rendering**: Extract CSS on the server with `RenderServerStyles`.
140
+ - **HTML Tags**: `$` export offers all standard HTML tags with built-in style prop support.
141
+ - **Plugin System**: Extend and customize styling behavior with a flexible plugin API.
142
+ - **Utilities**: `cx` for className composition.
143
+
144
+ ## API Reference
145
+
146
+ ### StylixProvider
147
+
148
+ Provides styling context, media query definitions, and plugin support to your React tree.
149
+
150
+ ```tsx
151
+ import React from 'react';
152
+ import { StylixProvider } from '@stylix/core';
153
+
154
+ <StylixProvider
155
+ media={{
156
+ mobile: (styles) => ({ '@media (max-width: 640px)': styles }),
157
+ desktop: (styles) => ({ '@media (min-width: 1024px)': styles }),
158
+ }}
159
+ plugins={[/* array of StylixPlugin */]}
160
+ >
161
+ <App />
162
+ </StylixProvider>
163
+ ```
164
+
165
+ - `media?: Record<string, (styles: StylixStyles) => StylixStyles>` — Named breakpoints mapping to functions that wrap styles in media queries.
166
+ - `plugins?: StylixPlugin[]` — Additional style transformation plugins.
167
+
168
+ ### `$` (Styled HTML Tags)
169
+
170
+ Stylix exports a default `$` object with all standard HTML tags, pre-wired for style props:
171
+
172
+ ```tsx
173
+ import $ from '@stylix/core';
174
+
175
+ <$.button
176
+ padding="8px 16px"
177
+ background-color="teal"
178
+ color="white"
179
+ border="none"
180
+ border-radius={4}
181
+ >
182
+ Click me
183
+ </$.button>
184
+ ```
185
+
186
+ Supports:
187
+ - Any CSS property (camelCase or kebab-case).
188
+ - Pseudo-selectors (`:hover`, `:focus`, etc.).
189
+ - Responsive props using breakpoint names (e.g., `mobile-padding`).
190
+
191
+ ### useStyles
192
+
193
+ Generate a unique class name from a style object:
194
+
195
+ ```tsx
196
+ import { useStyles } from '@stylix/core';
197
+
198
+ const className = useStyles({
199
+ margin: 8,
200
+ color: 'rebeccapurple',
201
+ ':hover': { opacity: 0.8 },
202
+ mobile: { display: 'none' }, // uses media queries defined in StylixProvider
203
+ });
204
+
205
+ return <div className={className}>Hover me (hidden on mobile)</div>;
206
+ ```
207
+
208
+ Returns a deterministic class name string based on your style object.
209
+
210
+ ### useGlobalStyles
211
+
212
+ Inject global CSS rules into your document:
213
+
214
+ ```tsx
215
+ import { useGlobalStyles } from '@stylix/core';
216
+
217
+ useGlobalStyles({
218
+ html: { boxSizing: 'border-box' },
219
+ '*, *:before, *:after': { boxSizing: 'inherit' },
220
+ body: { margin: 0, fontFamily: 'sans-serif' },
221
+ });
222
+ ```
223
+
224
+ Accepts a single style object or an array of objects for grouping rules.
225
+
226
+ ### useKeyframes
227
+
228
+ Create reusable CSS keyframe animations:
229
+
230
+ ```tsx
231
+ import { useKeyframes } from '@stylix/core';
232
+
233
+ const fadeIn = useKeyframes({
234
+ '0%': { opacity: 0 },
235
+ '100%': { opacity: 1 },
236
+ });
237
+
238
+ return <$.div animation={`${fadeIn} 2s ease-in`}>Fade In</$.div>;
239
+ ```
240
+
241
+ Returns a unique animation name for use in `animation` props.
242
+
243
+ ### Responsive Styles (Media Queries)
244
+
245
+ Stylix lets you define custom breakpoints in `StylixProvider` and write responsive style props directly in your components.
246
+
247
+ #### Define breakpoints
248
+
249
+ ```tsx
250
+ <StylixProvider
251
+ media={{
252
+ mobile: (styles) => ({ '@media (max-width: 640px)': styles }),
253
+ desktop: (styles) => ({ '@media (min-width: 1024px)': styles }),
254
+ }}
255
+ >
256
+ {/* your app */}
257
+ </StylixProvider>
258
+ ```
259
+
260
+ #### Use media objects in style props
261
+
262
+ Specify style props as objects keyed by breakpoint names:
263
+
264
+ ```tsx
61
265
  <$.div
62
- color="SkyBlue"
63
- text-align="center"
64
- font-size={40}
65
- font-weight="bold"
66
- font-style="italic"
266
+ padding={{ default: 16, mobile: 8 }}
267
+ color={{ default: 'black', mobile: 'gray' }}
67
268
  >
68
- Hello, Stylix!
269
+ Responsive padding and color!
69
270
  </$.div>
70
271
  ```
71
272
 
72
- ## Want to contribute? Have bugs, issues, or questions?
273
+ The `default` key provides fallback styles; other keys correspond to your breakpoints.
73
274
 
74
- Open an issue or submit a PR on our GitHub page:
275
+ #### Top-level media prop syntax
75
276
 
76
- https://github.com/brombal/stylix
277
+ You can also use breakpoint names as props to apply multiple styles at once:
77
278
 
78
- We ascribe to the
79
- [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct).
279
+ ```tsx
280
+ <$.div
281
+ mobile={{ padding: 8, backgroundColor: 'lightgray' }}
282
+ desktop={{ padding: 24 }}
283
+ >
284
+ Alternate syntax
285
+ </$.div>
286
+ ```
287
+
288
+ Under the hood, Stylix's `mediaObjects` plugin merges these into proper CSS media queries in the generated stylesheet.
80
289
 
81
- ## License
82
290
 
83
- [MIT](https://opensource.org/licenses/MIT)
291
+ ### $css (Advanced Selectors & Pseudo-classes)
84
292
 
85
- Copyright 2020 Brombal, LLC
293
+ Use the `$css` prop to pass additional style objects or arrays, enabling nested selectors, pseudo-classes, and complex rules. Always use `&` in selector keys to refer to the current component’s generated class name. Without the `&`, the selector will apply to child elements instead.
86
294
 
87
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
88
- associated documentation files (the "Software"), to deal in the Software without restriction,
89
- including without limitation the rights to use, copy, modify, merge, publish, distribute,
90
- sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
91
- furnished to do so, subject to the following conditions:
295
+ ```tsx
296
+ // $css accepts a StylixStyles object or array of objects
297
+ <$.button
298
+ background-color="blue"
299
+ color="white"
300
+ $css={{
301
+ '&:hover': { background-color: 'darkblue' },
302
+ '&:active': { transform: 'scale(0.98)' },
303
+ '.icon': { margin-right: 8 },
304
+ }}
305
+ >
306
+ Click me
307
+ </$.button>
308
+ ```
309
+
310
+ Note: using a selector like `':hover'` without `&` will only apply to child elements. Prefix with `&` to ensure it targets the component itself.
311
+
312
+ ### Plugins
313
+
314
+ Customize and extend Stylix with your own styling transforms:
315
+
316
+ ```tsx
317
+ import React from 'react';
318
+ import { StylixProvider, customProps } from '@stylix/core';
319
+ import $ from '@stylix/core';
320
+
321
+ // Define a plugin for horizontal padding shorthand
322
+ const spacingPlugin = customProps({
323
+ px: (value) => ({ paddingLeft: value, paddingRight: value }),
324
+ });
325
+
326
+ // Use the plugin in your provider
327
+ function App() {
328
+ return (
329
+ <StylixProvider plugins={[spacingPlugin]}>
330
+ <$.div px={20}>Padded horizontally</$.div>
331
+ </StylixProvider>
332
+ );
333
+ }
334
+ ```
335
+
336
+ Available:
337
+ - `defaultPlugins`: Built-in plugins for media queries, custom props, and more.
338
+ - `customProps`: Factory to create custom style prop mappings.
339
+ - Types: `StylixPlugin`, `StylixPluginFunctionContext`.
340
+
341
+ ### Utilities
342
+
343
+ #### cx
344
+ Compose class names safely:
345
+
346
+ ```ts
347
+ import { cx } from '@stylix/core';
92
348
 
93
- The above copyright notice and this permission notice shall be included in all copies or substantial
94
- portions of the Software.
349
+ const isActive = true;
350
+ const cls = cx('btn', isActive && 'active', undefined, null);
351
+ // -> 'btn active'
352
+ ```
353
+
354
+ ### Types
355
+
356
+ - `StylixProps` — Style prop interface.
357
+ - `StylixHTMLProps` — Props for stylable HTML elements.
358
+ - `StylixStyles` — Style object for hooks.
359
+ - `StylixPlugin` — Plugin function type.
360
+
361
+ ## Contributing
362
+
363
+ We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for our contribution guidelines, code of conduct, and development setup instructions. Feel free to open issues or submit pull requests on our GitHub repository.
364
+
365
+ ## License
95
366
 
96
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
97
- NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
98
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
99
- OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
100
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
367
+ MIT © [Alex Brombal](https://github.com/brombal)
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- import * as CSS from 'csstype';
2
1
  import React from 'react';
2
+ import * as CSS from 'csstype';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
 
5
+ declare const htmlTags: readonly ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "menu", "menuitem", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rt", "ruby", "s", "samp", "section", "select", "slot", "small", "source", "span", "strong", "sub", "summary", "sup", "svg", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "u", "ul", "var", "video"];
6
+ type IntrinsicElements = typeof htmlTags[number];
5
7
  /**
6
8
  * Gets the props of a given HTML tag.
7
9
  */
@@ -18,11 +20,11 @@ type Extends<T1, T2, T3 = unknown, T4 = unknown> = Override<Override<Override<T1
18
20
  */
19
21
  type StylixObject = Record<string, unknown>;
20
22
  /**
21
- * Used to represent any value that can appear within a StylixObject.
23
+ * Represents any value that can appear within a StylixObject.
22
24
  */
23
25
  type StylixStyles = StylixObject | null | undefined | false | StylixStyles[];
24
26
  /**
25
- * Used to represent a value for a CSS prop in a Stylix object.
27
+ * Represents a value for a CSS prop in a Stylix object.
26
28
  * The value can be a single value or an object with keys for different media queries.
27
29
  */
28
30
  type StylixValue<T> = T | Record<string, T>;
@@ -35,7 +37,7 @@ type StylixValue<T> = T | Record<string, T>;
35
37
  *
36
38
  * To allow for HTML element props, use `StylixHTMLProps` instead.
37
39
  */
38
- type StylixProps<TOverrideProps = unknown, TExtendsFromProps = unknown> = Extends<TExtendsFromProps, {
40
+ type StylixProps = {
39
41
  /**
40
42
  * Additional styles.
41
43
  */
@@ -44,27 +46,35 @@ type StylixProps<TOverrideProps = unknown, TExtendsFromProps = unknown> = Extend
44
46
  [key in keyof CSSProperties]?: StylixValue<CSSProperties[key]>;
45
47
  } & {
46
48
  [key in keyof StylixPropsExtensions]?: StylixValue<key extends keyof StylixPropsExtensions ? StylixPropsExtensions[key] : never>;
47
- }, TOverrideProps>;
49
+ };
48
50
  /**
49
- * Used to indicate that a component can accept all Stylix properties, including
51
+ * Props for a component that can accept all Stylix properties, including
50
52
  * all standard CSS properties, additional user-defined custom style props, and the $css prop,
51
53
  * as well as all standard HTML element props for the given tag.
52
54
  *
53
55
  * For Stylix properties without allowing HTML props, use `StylixProps` instead.
54
56
  *
55
57
  * Note that some HTML elements have properties that conflict with CSS properties (e.g. `content`, or `width` and `height`
56
- * on inputs). By default, Stylix always consumes CSS properties as if they were styles, so HTML props are suppressed
57
- * and style props take precedence. If you need to use a conflicting prop as its original type from the HTML element,
58
- * consider passing it in the `TOverrideProps` type parameter. E.g.:
58
+ * on image inputs). By default, Stylix always consumes CSS properties as if they were styles, so HTML props are suppressed
59
+ * and style props take precedence. If you need to use a style prop with a conflicting name, consider renaming the prop
60
+ * in your component.
61
+ *
62
+ * ```ts
63
+ * function StyledInput(props: StylixHTMLProps<'input'> & { inputWidth: HTMLProps<'input'>['width'] }) {
64
+ * const { inputWidth, ...styles } = props;
65
+ * return <$ $el={<input width={inputWidth} />} {...styles} />;
66
+ * }
67
+ * ```
59
68
  *
69
+ * Alternatively, use `Extends` to create a type that overrides the conflicting properties:
60
70
  * ```ts
61
- * function MyComponent(props: StylixHTMLProps<'input', Pick<HTMLProps<'input'>, 'width'>>) {
62
- * // props.width is a string, not a CSS value
63
- * return <input {...props} />;
71
+ * function StyledInput(props: Extends<StylixHTMLProps<'input'>, { width: HTMLProps<'input'>['width'] }>) {
72
+ * const { inputWidth, ...styles } = props;
73
+ * return <$ $el={<input width={inputWidth} />} {...styles} />;
64
74
  * }
65
75
  * ```
66
76
  */
67
- type StylixHTMLProps<TTag extends keyof React.JSX.IntrinsicElements, TOverrideProps = unknown, TExtendsFromProps = unknown> = StylixProps<TOverrideProps, HTMLProps<TTag> & TExtendsFromProps>;
77
+ type StylixHTMLProps<TTag extends IntrinsicElements> = Extends<HTMLProps<TTag>, StylixProps>;
68
78
  /**
69
79
  * Used to allow users to add custom props to Stylix components.
70
80
  *
@@ -166,6 +176,56 @@ declare function StyleElement(props: {
166
176
  styles: string[];
167
177
  } & Partial<HTMLProps<'style'>>): react_jsx_runtime.JSX.Element;
168
178
 
179
+ declare function RenderServerStyles(props: Partial<HTMLProps<'style'>>): react_jsx_runtime.JSX.Element;
180
+
181
+ /**
182
+ * Additional properties on the Stylix ($) component and its html component properties (`<$.div>`, etc).
183
+ */
184
+ type StylixComponentMeta = {
185
+ displayName?: string;
186
+ __isStylix: true;
187
+ };
188
+ /**
189
+ * Defines the static meta properties and the HTML elements on the `$` object ($.div, $.span, etc).
190
+ */
191
+ type Stylix$ComponentExtras = StylixComponentMeta & {
192
+ [key in IntrinsicElements]: React.FC<Extends<React.JSX.IntrinsicElements[key], StylixProps> & {
193
+ htmlContent?: string;
194
+ htmlTranslate?: 'yes' | 'no';
195
+ }>;
196
+ };
197
+ type StylixRenderFn<TProps = any> = (className: string | undefined, props: TProps) => React.ReactNode;
198
+ /**
199
+ * The props for the Stylix ($) component when using the $render prop.
200
+ */
201
+ type Stylix$renderProp = StylixProps & Record<string, unknown> & {
202
+ $el?: never;
203
+ $render: StylixRenderFn;
204
+ children?: never;
205
+ };
206
+ /**
207
+ * The props for the Stylix ($) component when using the $el prop as a component, intrinsic element tag, or rendered element.
208
+ */
209
+ type Stylix$elAsComponentProp = StylixProps & Record<string, unknown> & {
210
+ $el: React.ReactElement | React.ComponentType<any> | IntrinsicElements;
211
+ $render?: never;
212
+ children?: React.ReactNode | React.ReactNode[];
213
+ };
214
+ type Stylix$props = Stylix$elAsComponentProp | Stylix$renderProp;
215
+ /**
216
+ * Type of main Stylix component ($).
217
+ */
218
+ type Stylix$Component = Stylix$ComponentExtras & ((props: Stylix$props) => React.ReactNode);
219
+ declare const Stylix: Stylix$Component;
220
+
221
+ interface StyleCollector {
222
+ collect: (element: React.ReactElement) => React.ReactElement;
223
+ render: React.FC<React.ComponentProps<'style'>>;
224
+ styles: string[];
225
+ }
226
+ declare const styleCollectorContext: React.Context<string[] | undefined>;
227
+ declare function createStyleCollector(): StyleCollector;
228
+
169
229
  /**
170
230
  * Accepts a Stylix CSS object and returns a unique className.
171
231
  * The styles are registered with the Stylix context and will be applied to the document.
@@ -181,6 +241,22 @@ declare function useGlobalStyles(styles: StylixStyles, options?: {
181
241
  disabled?: boolean;
182
242
  }): string;
183
243
 
244
+ type ClassNamePrimitive = string | number | boolean | null | undefined;
245
+ type ClassName = ClassNamePrimitive | ClassName[] | {
246
+ [key: string]: ClassNamePrimitive;
247
+ } | (() => ClassName);
248
+ /**
249
+ * A utility function to create a string of class names based on the provided parameters.
250
+ * Accepts a variable number of arguments, each of which can be one of the following:
251
+ *
252
+ * - A string, which will be included in the class name string.
253
+ * - An object, where the keys are class names and the values are booleans indicating whether to include the class name.
254
+ * - An array of strings or objects, which will be flattened and processed as above.
255
+ * - A function that returns a string, object, or array, which will be processed as above.
256
+ * - Any other value will be ignored.
257
+ */
258
+ declare function cx(...args: ClassName[]): string;
259
+
184
260
  type MapObjectFunction = (key: string | number, value: any, source: unknown, context: any, mapRecursive: (value: unknown) => unknown) => unknown;
185
261
  /**
186
262
  * Returns a new object or array, generated by invoking `map` on each key-value pair in `source` and merging the returned value into
@@ -241,77 +317,7 @@ type MapObjectFunction = (key: string | number, value: any, source: unknown, con
241
317
  */
242
318
  declare function mapObject<TSource>(source: TSource, map: MapObjectFunction, context?: any): TSource;
243
319
 
244
- interface StyleCollector {
245
- collect: (element: React.ReactElement) => React.ReactElement;
246
- render: React.FC<React.ComponentProps<'style'>>;
247
- styles: string[];
248
- }
249
- declare const styleCollectorContext: React.Context<string[] | undefined>;
250
- declare function createStyleCollector(): StyleCollector;
251
-
252
- /**
253
- * Additional properties on the Stylix ($) component and its html component properties (`<$.div>`, etc).
254
- */
255
- type StylixComponentMeta = {
256
- displayName?: string;
257
- __isStylix: true;
258
- };
259
- /**
260
- * Defines the static meta properties and the HTML elements on the `$` object ($.div, $.span, etc).
261
- */
262
- type Stylix$ComponentExtras = StylixComponentMeta & {
263
- [key in keyof React.JSX.IntrinsicElements]: React.FC<StylixProps<unknown, React.JSX.IntrinsicElements[key]> & {
264
- htmlContent?: string;
265
- htmlTranslate?: 'yes' | 'no';
266
- }>;
267
- };
268
- type StylixRenderFn<TProps = any> = (className: string | undefined, props: TProps) => React.ReactNode;
269
- /**
270
- * The props for the Stylix ($) component when using the $render prop.
271
- */
272
- type Stylix$renderProp = StylixProps & Record<string, unknown> & {
273
- $el?: never;
274
- $render: StylixRenderFn;
275
- children?: React.ReactNode | React.ReactNode[];
276
- };
277
- /**
278
- * The props for the Stylix ($) component when using the children render function.
279
- */
280
- type Stylix$childrenProp = StylixProps & Record<string, unknown> & {
281
- $el?: never;
282
- $render?: never;
283
- children: StylixRenderFn;
284
- };
285
- /**
286
- * The props for the Stylix ($) component when using the $el prop as a component.
287
- */
288
- type Stylix$elAsComponentProp<TComponent extends React.ElementType> = (TComponent extends React.ElementType<infer P> ? StylixProps<object, P> : never) & {
289
- $el: TComponent;
290
- $render?: never;
291
- children?: React.ReactNode | React.ReactNode[];
292
- };
293
- /**
294
- * The props for the Stylix ($) component when using the $el prop.
295
- */
296
- type Stylix$elAsElementProp = StylixProps & Record<string, unknown> & {
297
- $render?: never;
298
- $el: React.ReactElement;
299
- children?: React.ReactNode | React.ReactNode[];
300
- };
301
- /**
302
- * Props for the Stylix ($) component
303
- */
304
- type Stylix$Props<TComponent extends React.ElementType> = Stylix$elAsComponentProp<TComponent> | Stylix$elAsElementProp | Stylix$renderProp | Stylix$childrenProp;
305
- /**
306
- * Type of main Stylix component ($).
307
- */
308
- interface Stylix$Component extends Stylix$ComponentExtras {
309
- <TComponent extends React.ElementType>(props: Stylix$Props<TComponent>): React.ReactNode;
310
- }
311
- declare const Stylix: Stylix$Component;
312
-
313
- declare function RenderServerStyles(props: Partial<HTMLProps<'style'>>): react_jsx_runtime.JSX.Element;
314
-
315
320
  type StylixContext = StylixPublicContext;
316
321
 
317
- export { type Extends, type HTMLProps, RenderServerStyles, type StyleCollector, StyleElement, type Stylix$Component, type StylixContext, type StylixHTMLProps, type StylixObject, type StylixPlugin, type StylixPluginFunctionContext, type StylixProps, type StylixPropsExtensions, StylixProvider, type StylixStyles, type StylixValue, createStyleCollector, customProps, Stylix as default, defaultPlugins, mapObject, styleCollectorContext, useGlobalStyles, useKeyframes, useStyles, useStylixContext };
322
+ export { RenderServerStyles, StyleElement, StylixProvider, createStyleCollector, customProps, cx, Stylix as default, defaultPlugins, mapObject, styleCollectorContext, useGlobalStyles, useKeyframes, useStyles, useStylixContext };
323
+ export type { Extends, HTMLProps, IntrinsicElements, StyleCollector, Stylix$Component, StylixContext, StylixHTMLProps, StylixObject, StylixPlugin, StylixPluginFunctionContext, StylixProps, StylixPropsExtensions, StylixStyles, StylixValue };
package/dist/index.js CHANGED
@@ -18,9 +18,14 @@ function classifyProps(props, knownProps) {
18
18
  }
19
19
  /**
20
20
  * Determines if `value` is a recognized CSS property (can be standard CSS or custom Stylix prop).
21
+ * If it is, the simplified prop name is returned. Otherwise, false is returned.
21
22
  */
22
23
  function isStyleProp(prop, knownProps) {
23
- return isValidJSXProp(prop) && simplifyStylePropName(prop) in knownProps;
24
+ if (isValidJSXProp(prop)) {
25
+ const simplified = simplifyStylePropName(prop);
26
+ return simplified in knownProps ? simplified : false;
27
+ }
28
+ return false;
24
29
  }
25
30
  function isValidJSXProp(value) {
26
31
  // Not an exact check, but mostly rules out complex css selectors
@@ -619,12 +624,12 @@ const defaultUnits = (unit = 'px', ignoreProps = defaultIgnoreUnits) => {
619
624
  return {
620
625
  name: 'defaultUnits',
621
626
  type: 'processStyles',
622
- plugin(ctx, styles) {
627
+ plugin(_ctx, styles) {
623
628
  return mapObject(styles, defaultUnitsMap, { unit, ignoreProps });
624
629
  },
625
630
  };
626
631
  };
627
- const defaultUnitsMap = (key, value, object, ctx, mapRecursive) => {
632
+ const defaultUnitsMap = (key, value, _object, ctx, mapRecursive) => {
628
633
  if (typeof value === 'number' && !ctx.ignoreProps.includes(key)) {
629
634
  return { [key]: String(value) + ctx.unit };
630
635
  }
@@ -654,7 +659,7 @@ function _hoistKeyframes(styles, root) {
654
659
  const hoistKeyframes = {
655
660
  name: 'hoistKeyframes',
656
661
  type: 'processStyles',
657
- plugin(ctx, styles) {
662
+ plugin(_ctx, styles) {
658
663
  return _hoistKeyframes(styles, styles);
659
664
  },
660
665
  };
@@ -683,7 +688,7 @@ function processMediaStyles(mediaDef, styleProps, styles) {
683
688
  const result = { default: [] };
684
689
  for (const styleKey in styles) {
685
690
  const styleValue = styles[styleKey];
686
- if (styleProps[simplifyStylePropName(styleKey)]) {
691
+ if (isStyleProp(styleKey, styleProps)) {
687
692
  if (typeof styleValue !== 'object') {
688
693
  // Regular style prop
689
694
  result.default.push({ [styleKey]: styleValue });
@@ -729,6 +734,9 @@ function _mergeArrays(obj) {
729
734
  function reduceArray(arr) {
730
735
  arr = arr.flat();
731
736
  let target = arr[0];
737
+ if (Array.isArray(target)) {
738
+ target = reduceArray(target);
739
+ }
732
740
  for (let i = 1; i < arr.length; i++) {
733
741
  let source = arr[i];
734
742
  if (Array.isArray(source)) {
@@ -794,7 +802,7 @@ function reduceObjectProperties(obj) {
794
802
  const prepareStyles = {
795
803
  name: 'prepareStyles',
796
804
  type: 'preprocessStyles',
797
- plugin(ctx, styles) {
805
+ plugin(_ctx, styles) {
798
806
  while (Array.isArray(styles) && styles.length === 1)
799
807
  styles = styles[0];
800
808
  if (Array.isArray(styles) && !styles.length)
@@ -815,11 +823,11 @@ const propCasing = {
815
823
  return mapObject(styles, propCasingMap, { ctx });
816
824
  },
817
825
  };
818
- const propCasingMap = (key, value, object, context, mapRecursive) => {
826
+ const propCasingMap = (key, value, _object, context, mapRecursive) => {
819
827
  if (typeof key !== 'string' || key === '&')
820
828
  return { [key]: mapRecursive(value) };
821
- const simpleKey = simplifyStylePropName(key);
822
- if (simpleKey && simpleKey in context.ctx.styleProps) {
829
+ const simpleKey = isStyleProp(key, context.ctx.styleProps);
830
+ if (simpleKey) {
823
831
  return { [context.ctx.styleProps[simpleKey]]: mapRecursive(value) };
824
832
  }
825
833
  return { [key]: mapRecursive(value) };
@@ -835,7 +843,7 @@ const replace$$class = {
835
843
  return mapObject(styles, replace$$classMap, { ctx });
836
844
  },
837
845
  };
838
- const replace$$classMap = (key, value, object, context, mapRecursive) => {
846
+ const replace$$classMap = (key, value, _object, context, mapRecursive) => {
839
847
  value =
840
848
  typeof value === 'string'
841
849
  ? value.replace('$$class', context.ctx.className || '')
@@ -1244,7 +1252,7 @@ function _Stylix(props, ref) {
1244
1252
  styles.push(styleProps);
1245
1253
  if (!isEmpty($css))
1246
1254
  styles.push($css);
1247
- if (styles.length === 1)
1255
+ if (styles.length === 1 && styles[0])
1248
1256
  styles = styles[0];
1249
1257
  const stylixClassName = useStyles(styles);
1250
1258
  const className = `${stylixClassName} ${outerClassName || ''}`.trim() || undefined;
@@ -1269,16 +1277,7 @@ function _Stylix(props, ref) {
1269
1277
  if ($render) {
1270
1278
  return $render(className || undefined, { children, ...otherProps, ...(ref ? { ref } : null) });
1271
1279
  }
1272
- if (children) {
1273
- if (typeof children !== 'function') {
1274
- throw new Error('Stylix: invalid component usage: children must be a function');
1275
- }
1276
- return children(className || undefined, {
1277
- ...otherProps,
1278
- ...(ref ? { ref } : null),
1279
- });
1280
- }
1281
- throw new Error('Stylix: invalid stylix component usage: must provide $el, $render, or children');
1280
+ throw new Error('Stylix: invalid stylix component usage: must provide $el or $render prop.');
1282
1281
  }
1283
1282
  const Stylix = React.forwardRef(_Stylix);
1284
1283
  Stylix.displayName = 'Stylix';
@@ -1400,5 +1399,42 @@ function RenderServerStyles(props) {
1400
1399
  return jsx(StyleElement, { styles: ctx.ssr ? flattenRules(ctx) : [], ...props });
1401
1400
  }
1402
1401
 
1403
- export { RenderServerStyles, StyleElement, StylixProvider, createStyleCollector, customProps, Stylix as default, defaultPlugins, mapObject, styleCollectorContext, useGlobalStyles, useKeyframes, useStyles, useStylixContext };
1402
+ // Internal helper to collect class name parts without joining
1403
+ function cxArray(args) {
1404
+ const classNames = [];
1405
+ for (const arg of args) {
1406
+ if (arg && typeof arg === 'string') {
1407
+ classNames.push(arg);
1408
+ }
1409
+ else if (Array.isArray(arg)) {
1410
+ classNames.push(...cxArray(arg));
1411
+ }
1412
+ else if (typeof arg === 'function') {
1413
+ classNames.push(...cxArray([arg()]));
1414
+ }
1415
+ else if (typeof arg === 'object' && arg !== null) {
1416
+ for (const [key, value] of Object.entries(arg)) {
1417
+ if (value) {
1418
+ classNames.push(key);
1419
+ }
1420
+ }
1421
+ }
1422
+ }
1423
+ return classNames;
1424
+ }
1425
+ /**
1426
+ * A utility function to create a string of class names based on the provided parameters.
1427
+ * Accepts a variable number of arguments, each of which can be one of the following:
1428
+ *
1429
+ * - A string, which will be included in the class name string.
1430
+ * - An object, where the keys are class names and the values are booleans indicating whether to include the class name.
1431
+ * - An array of strings or objects, which will be flattened and processed as above.
1432
+ * - A function that returns a string, object, or array, which will be processed as above.
1433
+ * - Any other value will be ignored.
1434
+ */
1435
+ function cx(...args) {
1436
+ return cxArray(args).join(' ');
1437
+ }
1438
+
1439
+ export { RenderServerStyles, StyleElement, StylixProvider, createStyleCollector, customProps, cx, Stylix as default, defaultPlugins, mapObject, styleCollectorContext, useGlobalStyles, useKeyframes, useStyles, useStylixContext };
1404
1440
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../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/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/util/useIsoLayoutEffect.ts","../src/StylixProvider.tsx","../src/applyRules.ts","../src/getParentComponentName.ts","../src/stylesToRuleArray.ts","../src/useStyles.ts","../src/Stylix.tsx","../src/elements.tsx","../src/RenderServerStyles.tsx"],"sourcesContent":["export function classifyProps(props: any, knownProps: Record<string, string>): [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, knownProps)) {\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 */\nexport function isStyleProp(prop: unknown, knownProps: Record<string, string>): prop is string {\n return isValidJSXProp(prop) && simplifyStylePropName(prop) in knownProps;\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 MapObjectFunction = (\n key: string | number,\n value: any,\n source: unknown,\n context: any,\n mapRecursive: (value: unknown) => unknown,\n) => unknown;\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>(\n source: TSource,\n map: MapObjectFunction,\n context: any = {},\n): TSource {\n if (typeof source !== 'object') return source;\n const result = Array.isArray(source) ? ([] as unknown[]) : ({} as Record<string, unknown>);\n for (const _key in source) {\n const key = Array.isArray(source) ? +_key : _key;\n const value = (source as any)[key];\n\n const contextClone = { ...context };\n const mapResult = map(key, value, source, contextClone, (value) =>\n mapObject(value, map, contextClone),\n );\n\n if (typeof mapResult === 'undefined') continue;\n\n if (Array.isArray(mapResult) && Array.isArray(source)) {\n (result as unknown[]).push(...mapResult);\n continue;\n }\n\n if (\n typeof mapResult === 'object' &&\n !Array.isArray(mapResult) &&\n typeof source === 'object' &&\n !Array.isArray(source)\n ) {\n Object.assign(result as object, mapResult);\n continue;\n }\n\n throw new Error(\n `mapObjectRecursive: return value of map function must be an object, array, or undefined, and must match the type of the source value. Type of source value was ${typeof source}, and type of returned value was ${typeof mapResult}.`,\n );\n }\n\n return result as TSource;\n}\n","import { type MapObjectFunction, mapObject } from '../util/mapObject';\nimport type { StylixPlugin } from './index';\n\nexport const defaultIgnoreUnits = [\n 'aspect-ratio',\n 'columns',\n 'column-count',\n 'fill-opacity',\n 'flex',\n 'flex-grow',\n 'flex-shrink',\n 'font-weight',\n 'line-height',\n 'opacity',\n 'orphans',\n 'stroke-opacity',\n 'widows',\n 'z-index',\n 'zoom',\n 'order',\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 = (key, value, object, ctx, mapRecursive) => {\n if (typeof value === 'number' && !ctx.ignoreProps.includes(key as string)) {\n return { [key]: String(value) + ctx.unit };\n }\n return { [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 { simplifyStylePropName } 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 (styleProps[simplifyStylePropName(styleKey)]) {\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 result[mediaKey].push(\n mediaDef[mediaKey]({\n // process recursively\n [styleKey]: processMediaStyles(mediaDef, styleProps, styleValue[mediaKey]),\n } as OpaqueMediaStyles),\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 { StylixObject, StylixStyles } from '../types';\nimport { isEmpty } from '../util/isEmpty';\nimport 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) => _mergeArrays(styles),\n};\n\nexport function _mergeArrays(obj: StylixStyles) {\n if (Array.isArray(obj)) return reduceArray(obj);\n return reduceObjectProperties(obj);\n}\n\nfunction reduceArray(arr: StylixStyles[]): StylixObject | undefined {\n arr = arr.flat();\n let target = arr[0] as StylixObject;\n\n for (let i = 1; i < arr.length; i++) {\n let source = arr[i] as StylixObject | undefined;\n\n if (Array.isArray(source)) {\n source = reduceArray(source);\n }\n\n // ignore falsy values\n if (typeof source === 'undefined') continue;\n\n // if both values are primitives, the source value takes precedence\n if (typeof target !== 'object' && typeof source !== 'object') {\n target = source;\n continue;\n }\n\n // if target is primitive but source is object, replace target with source\n if (typeof target !== 'object') {\n target = source;\n continue;\n }\n\n for (const key in source) {\n const value = source[key] as StylixStyles;\n // if the key does not exist in target, just add it\n if (!(key in target)) target[key] = value;\n // else, if the target value is an object or array:\n else if (typeof target[key] === 'object') {\n // if the source value is an object or array, convert target to array if necessary and push source value\n if (typeof value === 'object') {\n if (!Array.isArray(target[key])) target[key] = [target[key]];\n (target[key] as StylixStyles[]).push(value);\n }\n // else, ignore the source value (it's primitive; object values take precedence)\n }\n // else, target value is primitive, overwrite target value\n else {\n target[key] = value;\n }\n }\n }\n\n return reduceObjectProperties(target);\n}\n\nconst _reduced = Symbol('reduced');\n\nfunction reduceObjectProperties(\n obj: Exclude<StylixStyles, StylixStyles[]>,\n): StylixObject | undefined {\n if (!obj || isEmpty(obj)) return undefined;\n if (typeof obj !== 'object') return obj;\n if (obj?.[_reduced as any]) {\n return obj;\n }\n\n for (const k in obj) {\n if (!obj[k] || typeof obj[k] !== 'object') continue;\n obj[k] = _mergeArrays(obj[k] as StylixStyles);\n }\n\n Object.defineProperty(obj, _reduced as any, { value: true, enumerable: false });\n return obj;\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 type { StylixContext } from '../StylixProvider';\nimport { simplifyStylePropName } from '../classifyProps';\nimport { type MapObjectFunction, mapObject } from '../util/mapObject';\nimport type { StylixPlugin } 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 = (\n key,\n value,\n object,\n context: { ctx: StylixContext },\n mapRecursive,\n) => {\n if (typeof key !== 'string' || key === '&') return { [key]: mapRecursive(value) };\n const simpleKey = simplifyStylePropName(key);\n if (simpleKey && simpleKey in context.ctx.styleProps) {\n return { [context.ctx.styleProps[simpleKey]]: mapRecursive(value) };\n }\n return { [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 = (\n key,\n value,\n object,\n context: { ctx: StylixPluginFunctionContext },\n mapRecursive,\n) => {\n value =\n typeof value === 'string'\n ? value.replace('$$class', context.ctx.className || '')\n : mapRecursive(value);\n key = typeof key === 'string' ? key.replace('$$class', context.ctx.className || '') : key;\n return { [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';\nimport { mergeArrays } from './mergeArrays';\n\nexport function _customPropsProcess(styles: StylixStyles, customProps: Record<string, any>): any {\n return mapObject(styles, (key, value, source, _ctx, mapRecursive) => {\n if (!isValidJSXProp(key) || isPlainObject(value))\n return Array.isArray(source) ? [mapRecursive(value)] : { [key]: mapRecursive(value) };\n\n const simpleKey = simplifyStylePropName(key);\n const propValue = customProps[simpleKey];\n if (!propValue) return { [key]: mapRecursive(value) };\n\n if (typeof propValue === 'object') {\n if (value) return mapRecursive(propValue);\n return undefined;\n }\n if (typeof propValue === 'string') {\n return { [propValue]: mapRecursive(value) };\n }\n if (typeof propValue === 'function') {\n return mapRecursive(propValue(value));\n }\n\n return { [key]: mapRecursive(value) };\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, StylixPublicContext } from '../StylixProvider';\nimport type { StylixStyles } from '../types';\nimport { cleanStyles } from './cleanStyles';\nimport { defaultPixelUnits } from './defaultUnits';\nimport { hoistKeyframes } from './hoistKeyframes';\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 = StylixPublicContext & { className: string | null };\n\n/**\n * Stylix plugin interface\n */\nexport type StylixPlugin = {\n name: string;\n before?: StylixPlugin;\n after?: StylixPlugin;\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 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\n// Collect your styles:\n// const styles = [];\n// ReactDOM.renderToString(\n// <StylixSSR.StyleCollector styles={styles}>\n// <App />\n// </StylixSSR.StyleCollector>\n// );\n//\n// // Then render your styles:\n// <RenderServerStyles styles={styles} />\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 useLayoutEffect(fn, deps);\n }\n}\n","import type React from 'react';\nimport { createContext, useContext, useEffect, useRef } from 'react';\n\nimport { classifyProps, simplifyStylePropName } from './classifyProps';\nimport cssProps from './css-props.json';\nimport { type StylixPlugin, applyPlugins, defaultPlugins } from './plugins';\nimport type { StylixMediaDefinition } from './plugins/mediaObjects';\nimport { styleCollectorContext } from './styleCollector';\nimport { detectSSR } from './util/useIsoLayoutEffect';\n\n/**\n * Stylix context\n *\n * The <StylixProvider> wrapper represents an \"instance\" of Stylix - a configuration, set of plugins, and reference to\n * the <style> element where css is output. All nodes contained within a <StylixProvider> element will share this\n * Stylix instance's configuration.\n *\n * See the README for more details.\n */\n\n// StylixProvider component props\ntype StylixProviderProps = {\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// StylixContext object interface\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};\n\nexport type StylixPublicContext = Pick<\n StylixContext,\n 'id' | 'devMode' | 'media' | 'stylesheet' | 'styleElement' | 'styleProps'\n>;\n\nlet defaultStyleProps: Record<string, string> | undefined = undefined;\n\nexport function createStylixContext(userValues = {} as Partial<StylixProviderProps>) {\n if (!defaultStyleProps) {\n defaultStyleProps = {};\n for (const value of cssProps) {\n defaultStyleProps[simplifyStylePropName(value)] = value;\n }\n }\n\n const ctx = {\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 } as StylixContext;\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 && ctx.plugins.includes(plugin.before))\n pluginIndex = ctx.plugins.indexOf(plugin.before);\n else if (plugin.after && ctx.plugins.includes(plugin.after))\n pluginIndex = ctx.plugins.indexOf(plugin.after) + 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// The React context object\nconst stylixContext = createContext<StylixContext | undefined>(undefined);\n\nlet defaultStylixContext: StylixContext | undefined = undefined;\n\n/**\n * 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\nexport function StylixProvider({\n id,\n devMode,\n plugins,\n media,\n styleElement,\n children,\n ssr,\n}: StylixProviderProps): React.ReactElement {\n const ctx = useRef<StylixContext | null>(null);\n if (!ctx.current)\n ctx.current = createStylixContext({ id, devMode, plugins, media, styleElement, ssr });\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 type { StylixContext } from './StylixProvider';\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 or legacy browser, 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.devMode && ctx.styleElement) {\n const flattenedRules = flattenRules(ctx);\n ctx.styleElement.innerHTML = flattenedRules.join('\\n');\n } else {\n // If there's a style element, use its stylesheet\n if (ctx.styleElement) ctx.stylesheet = ctx.styleElement.sheet as CSSStyleSheet;\n\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 } else {\n // Legacy method\n while (stylesheet.rules?.length || stylesheet.cssRules?.length) {\n stylesheet.deleteRule(0);\n }\n for (const i in flattenedRules)\n try {\n stylesheet.insertRule(flattenedRules[i], +i);\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","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 type { StylixContext } from './StylixProvider';\nimport { applyPlugins } from './plugins';\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 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 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 { useRef } from 'react';\n\nimport { type StylixContext, useStylixContext } from './StylixProvider';\nimport applyRules from './applyRules';\nimport { getParentComponentName } from './getParentComponentName';\nimport { applyPlugins } from './plugins';\nimport stylesToRuleArray from './stylesToRuleArray';\nimport type { StylixObject, StylixStyles } from './types';\nimport { isEmpty } from './util/isEmpty';\nimport useIsoLayoutEffect from './util/useIsoLayoutEffect';\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\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 prevStylesJson = useRef('');\n\n // Preprocess styles with plugins\n if (styles && !isEmpty(styles))\n styles = applyPlugins('preprocessStyles', styles, null, stylixCtx);\n\n let stylesJson = styles && !isEmpty(styles) ? JSON.stringify(styles) : '';\n if (stylesJson && options.global) stylesJson = `global:${stylesJson}`;\n\n const changed = stylesJson !== prevStylesJson.current;\n prevStylesJson.current = stylesJson;\n\n options.debugLabel ||= stylixCtx.devMode ? getParentComponentName() : '';\n\n if (stylesJson && !stylixCtx.rules[stylesJson]) {\n stylixCtx.styleCounter++;\n const className = `stylix-${(stylixCtx.styleCounter).toString(36)}${options.debugLabel ? `-${options.debugLabel}` : ''}`;\n // If not global styles, wrap original styles with classname\n if (!options.global) styles = { [`.${className}`]: styles };\n stylixCtx.rules[stylesJson] = {\n className,\n rules: stylesToRuleArray(styles as StylixObject, className, stylixCtx),\n refs: 0,\n };\n }\n\n if (changed) stylixCtx.requestApply = true;\n\n // When json changes, add/remove ref count\n const ruleSet = stylixCtx.rules[stylesJson];\n if (stylesJson && changed && ruleSet) {\n ruleSet.refs++;\n }\n\n // Apply styles if requested.\n // This runs on every render. We utilize useLayoutEffect 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 useIsoLayoutEffect(\n () => {\n if (!stylixCtx.requestApply) return;\n stylixCtx.requestApply = false;\n applyRules(stylixCtx);\n },\n undefined,\n true,\n stylixCtx.ssr,\n );\n\n useIsoLayoutEffect(\n () => {\n if (!stylesJson || !changed) return;\n\n return () => {\n const ruleSet = stylixCtx.rules[stylesJson];\n if (!ruleSet) return;\n ruleSet.refs--;\n if (ruleSet.refs <= 0) stylixCtx.rules[stylesJson] = undefined;\n cleanup(stylixCtx);\n };\n },\n [stylesJson],\n false,\n stylixCtx.ssr,\n );\n\n return stylixCtx.rules[stylesJson]?.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 React from 'react';\nimport { useStylixContext } from './StylixProvider';\nimport type { StylixProps } 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 keyof React.JSX.IntrinsicElements]: React.FC<\n StylixProps<unknown, React.JSX.IntrinsicElements[key]> & {\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?: React.ReactNode | React.ReactNode[];\n };\n\n/**\n * The props for the Stylix ($) component when using the children render function.\n */\ntype Stylix$childrenProp = StylixProps &\n Record<string, unknown> & {\n $el?: never;\n $render?: never;\n children: StylixRenderFn;\n };\n\n/**\n * The props for the Stylix ($) component when using the $el prop as a component.\n */\ntype Stylix$elAsComponentProp<TComponent extends React.ElementType> =\n (TComponent extends React.ElementType<infer P> ? StylixProps<object, P> : never) & {\n $el: TComponent;\n $render?: never;\n children?: React.ReactNode | React.ReactNode[];\n };\n\n/**\n * The props for the Stylix ($) component when using the $el prop.\n */\ntype Stylix$elAsElementProp = StylixProps &\n Record<string, unknown> & {\n $render?: never;\n $el: React.ReactElement;\n children?: React.ReactNode | React.ReactNode[];\n };\n\n/**\n * Props for the Stylix ($) component\n */\nexport type Stylix$Props<TComponent extends React.ElementType> =\n | Stylix$elAsComponentProp<TComponent>\n | Stylix$elAsElementProp\n | Stylix$renderProp\n | Stylix$childrenProp;\n\n/**\n * Type of main Stylix component ($).\n */\nexport interface Stylix$Component extends Stylix$ComponentExtras {\n <TComponent extends React.ElementType>(props: Stylix$Props<TComponent>): React.ReactNode;\n}\n\nexport function _Stylix<TElement extends React.ElementType>(\n props: Stylix$Props<TElement>,\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 = [];\n if (!isEmpty(styleProps)) styles.push(styleProps);\n if (!isEmpty($css)) styles.push($css);\n if (styles.length === 1) 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,\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 if (children) {\n if (typeof children !== 'function') {\n throw new Error('Stylix: invalid component usage: children must be a function');\n }\n return (children as StylixRenderFn)(className || undefined, {\n ...otherProps,\n ...(ref ? { ref } : null),\n });\n }\n\n throw new Error('Stylix: invalid stylix component usage: must provide $el, $render, or children');\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];\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 = htmlTags[i];\n (Stylix as any)[Tag] = React.forwardRef(({ htmlContent, htmlTranslate, ...props }: any, ref) => (\n <Stylix\n $render={(className, props) => (\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 { StyleElement } from './StyleElement';\nimport { useStylixContext } from './StylixProvider';\nimport { flattenRules } from './applyRules';\nimport type { HTMLProps } from './elements';\n\nexport function RenderServerStyles(props: Partial<HTMLProps<'style'>>) {\n const ctx = useStylixContext();\n return <StyleElement styles={ctx.ssr ? flattenRules(ctx) : []} {...props} />;\n}\n"],"names":["_jsx"],"mappings":";;;AAAgB,SAAA,aAAa,CAAC,KAAU,EAAE,UAAkC,EAAA;IAC1E,MAAM,MAAM,GAAG,EAAS;IACxB,MAAM,KAAK,GAAG,EAAS;AAEvB,IAAA,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;;;AAGxB,QAAA,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE;YAC1D,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAA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AAa,EAAE,GAAG,KAAK,EAAO,EAAE,GAAG,MACzFA,GAAA,CAAC,MAAM,EAAA,EAAA,SAAA,EACI,CAAC,SAAS,EAAE,KAAK,MACxBA,GAAC,CAAA,GAAG,EACF,EAAA,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,aAAa,EACxB,GAAG,EAAE,GAAG,EACJ,GAAA,KAAK,EACT,CAAA,CACH,EACG,GAAA,KAAK,EACT,CAAA,CACH,CAAC;AACD,IAAA,MAAc,CAAC,GAAG,CAAC,CAAC,UAAU,GAAG,IAAI;IACrC,MAAc,CAAC,GAAG,CAAC,CAAC,WAAW,GAAG,CAAA,EAAA,EAAK,GAAG,CAAA,CAAE;AAC/C;;AC/HM,SAAU,kBAAkB,CAAC,KAAkC,EAAA;AACnE,IAAA,MAAM,GAAG,GAAG,gBAAgB,EAAE;IAC9B,OAAOA,GAAA,CAAC,YAAY,EAAC,EAAA,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,EAAA,GAAM,KAAK,EAAA,CAAI;AAC9E;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../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/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/util/useIsoLayoutEffect.ts","../src/StylixProvider.tsx","../src/applyRules.ts","../src/getParentComponentName.ts","../src/stylesToRuleArray.ts","../src/useStyles.ts","../src/Stylix.tsx","../src/elements.tsx","../src/RenderServerStyles.tsx","../src/util/cx.ts"],"sourcesContent":["export function classifyProps(props: any, knownProps: Record<string, string>): [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, knownProps)) {\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(prop: unknown, knownProps: Record<string, string>): string | false {\n if (isValidJSXProp(prop)) {\n const simplified = simplifyStylePropName(prop);\n return simplified in knownProps ? 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 MapObjectFunction = (\n key: string | number,\n value: any,\n source: unknown,\n context: any,\n mapRecursive: (value: unknown) => unknown,\n) => unknown;\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>(\n source: TSource,\n map: MapObjectFunction,\n context: any = {},\n): TSource {\n if (typeof source !== 'object') return source;\n const result = Array.isArray(source) ? ([] as unknown[]) : ({} as Record<string, unknown>);\n for (const _key in source) {\n const key = Array.isArray(source) ? +_key : _key;\n const value = (source as any)[key];\n\n const contextClone = { ...context };\n const mapResult = map(key, value, source, contextClone, (value) =>\n mapObject(value, map, contextClone),\n );\n\n if (typeof mapResult === 'undefined') continue;\n\n if (Array.isArray(mapResult) && Array.isArray(source)) {\n (result as unknown[]).push(...mapResult);\n continue;\n }\n\n if (\n typeof mapResult === 'object' &&\n !Array.isArray(mapResult) &&\n typeof source === 'object' &&\n !Array.isArray(source)\n ) {\n Object.assign(result as object, mapResult);\n continue;\n }\n\n throw new Error(\n `mapObjectRecursive: return value of map function must be an object, array, or undefined, and must match the type of the source value. Type of source value was ${typeof source}, and type of returned value was ${typeof mapResult}.`,\n );\n }\n\n return result as TSource;\n}\n","import { type MapObjectFunction, mapObject } from '../util/mapObject';\nimport type { StylixPlugin } from './index';\n\nexport const defaultIgnoreUnits = [\n 'aspect-ratio',\n 'columns',\n 'column-count',\n 'fill-opacity',\n 'flex',\n 'flex-grow',\n 'flex-shrink',\n 'font-weight',\n 'line-height',\n 'opacity',\n 'orphans',\n 'stroke-opacity',\n 'widows',\n 'z-index',\n 'zoom',\n 'order',\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 = (key, value, _object, ctx, mapRecursive) => {\n if (typeof value === 'number' && !ctx.ignoreProps.includes(key as string)) {\n return { [key]: String(value) + ctx.unit };\n }\n return { [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 { 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 result[mediaKey].push(\n mediaDef[mediaKey]({\n // process recursively\n [styleKey]: processMediaStyles(mediaDef, styleProps, styleValue[mediaKey]),\n } as OpaqueMediaStyles),\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 { StylixObject, StylixStyles } from '../types';\nimport { isEmpty } from '../util/isEmpty';\nimport 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) => _mergeArrays(styles),\n};\n\nexport function _mergeArrays(obj: StylixStyles) {\n if (Array.isArray(obj)) return reduceArray(obj);\n return reduceObjectProperties(obj);\n}\n\nfunction reduceArray(arr: StylixStyles[]): StylixObject | undefined {\n arr = arr.flat();\n let target = arr[0] as StylixObject;\n\n if (Array.isArray(target)) {\n target = reduceArray(target) as StylixObject;\n }\n\n for (let i = 1; i < arr.length; i++) {\n let source = arr[i] as StylixObject | undefined;\n\n if (Array.isArray(source)) {\n source = reduceArray(source);\n }\n\n // ignore falsy values\n if (typeof source === 'undefined') continue;\n\n // if both values are primitives, the source value takes precedence\n if (typeof target !== 'object' && typeof source !== 'object') {\n target = source;\n continue;\n }\n\n // if target is primitive but source is object, replace target with source\n if (typeof target !== 'object') {\n target = source;\n continue;\n }\n\n for (const key in source) {\n const value = source[key] as StylixStyles;\n // if the key does not exist in target, just add it\n if (!(key in target)) target[key] = value;\n // else, if the target value is an object or array:\n else if (typeof target[key] === 'object') {\n // if the source value is an object or array, convert target to array if necessary and push source value\n if (typeof value === 'object') {\n if (!Array.isArray(target[key])) target[key] = [target[key]];\n (target[key] as StylixStyles[]).push(value);\n }\n // else, ignore the source value (it's primitive; object values take precedence)\n }\n // else, target value is primitive, overwrite target value\n else {\n target[key] = value;\n }\n }\n }\n\n return reduceObjectProperties(target);\n}\n\nconst _reduced = Symbol('reduced');\n\nfunction reduceObjectProperties(\n obj: Exclude<StylixStyles, StylixStyles[]>,\n): StylixObject | undefined {\n if (!obj || isEmpty(obj)) return undefined;\n if (typeof obj !== 'object') return obj;\n if (obj?.[_reduced as any]) {\n return obj;\n }\n\n for (const k in obj) {\n if (!obj[k] || typeof obj[k] !== 'object') continue;\n obj[k] = _mergeArrays(obj[k] as StylixStyles);\n }\n\n Object.defineProperty(obj, _reduced as any, { value: true, enumerable: false });\n return obj;\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 type { StylixContext } from '../StylixProvider';\nimport { isStyleProp } from '../classifyProps';\nimport { type MapObjectFunction, mapObject } from '../util/mapObject';\nimport type { StylixPlugin } 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 = (\n key,\n value,\n _object,\n context: { ctx: StylixContext },\n mapRecursive,\n) => {\n if (typeof key !== 'string' || key === '&') return { [key]: mapRecursive(value) };\n const simpleKey = isStyleProp(key, context.ctx.styleProps);\n if (simpleKey) {\n return { [context.ctx.styleProps[simpleKey]]: mapRecursive(value) };\n }\n return { [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 = (\n key,\n value,\n _object,\n context: { ctx: StylixPluginFunctionContext },\n mapRecursive,\n) => {\n value =\n typeof value === 'string'\n ? value.replace('$$class', context.ctx.className || '')\n : mapRecursive(value);\n key = typeof key === 'string' ? key.replace('$$class', context.ctx.className || '') : key;\n return { [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';\nimport { mergeArrays } from './mergeArrays';\n\nexport function _customPropsProcess(styles: StylixStyles, customProps: Record<string, any>): any {\n return mapObject(styles, (key, value, source, _ctx, mapRecursive) => {\n if (!isValidJSXProp(key) || isPlainObject(value))\n return Array.isArray(source) ? [mapRecursive(value)] : { [key]: mapRecursive(value) };\n\n const simpleKey = simplifyStylePropName(key);\n const propValue = customProps[simpleKey];\n if (!propValue) return { [key]: mapRecursive(value) };\n\n if (typeof propValue === 'object') {\n if (value) return mapRecursive(propValue);\n return undefined;\n }\n if (typeof propValue === 'string') {\n return { [propValue]: mapRecursive(value) };\n }\n if (typeof propValue === 'function') {\n return mapRecursive(propValue(value));\n }\n\n return { [key]: mapRecursive(value) };\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, StylixPublicContext } from '../StylixProvider';\nimport type { StylixStyles } from '../types';\nimport { cleanStyles } from './cleanStyles';\nimport { defaultPixelUnits } from './defaultUnits';\nimport { hoistKeyframes } from './hoistKeyframes';\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 = StylixPublicContext & { className: string | null };\n\n/**\n * Stylix plugin interface\n */\nexport type StylixPlugin = {\n name: string;\n before?: StylixPlugin;\n after?: StylixPlugin;\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 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 { 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 useLayoutEffect(fn, deps);\n }\n}\n","import type React from 'react';\nimport { createContext, useContext, useEffect, useRef } from 'react';\n\nimport { classifyProps, simplifyStylePropName } from './classifyProps';\nimport cssProps from './css-props.json';\nimport { type StylixPlugin, applyPlugins, defaultPlugins } from './plugins';\nimport type { StylixMediaDefinition } from './plugins/mediaObjects';\nimport { styleCollectorContext } from './styleCollector';\nimport { detectSSR } from './util/useIsoLayoutEffect';\n\n/**\n * Stylix context\n *\n * The <StylixProvider> wrapper represents an \"instance\" of Stylix - a configuration, set of plugins, and reference to\n * the <style> element where css is output. All nodes contained within a <StylixProvider> element will share this\n * Stylix instance's configuration.\n *\n * See the README for more details.\n */\n\n// StylixProvider component props\ntype StylixProviderProps = {\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// StylixContext object interface\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};\n\nexport type StylixPublicContext = Pick<\n StylixContext,\n 'id' | 'devMode' | 'media' | 'stylesheet' | 'styleElement' | 'styleProps'\n>;\n\nlet defaultStyleProps: Record<string, string> | undefined = undefined;\n\nexport function createStylixContext(userValues = {} as Partial<StylixProviderProps>) {\n if (!defaultStyleProps) {\n defaultStyleProps = {};\n for (const value of cssProps) {\n defaultStyleProps[simplifyStylePropName(value)] = value;\n }\n }\n\n const ctx = {\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 } as StylixContext;\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 && ctx.plugins.includes(plugin.before))\n pluginIndex = ctx.plugins.indexOf(plugin.before);\n else if (plugin.after && ctx.plugins.includes(plugin.after))\n pluginIndex = ctx.plugins.indexOf(plugin.after) + 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// The React context object\nconst stylixContext = createContext<StylixContext | undefined>(undefined);\n\nlet defaultStylixContext: StylixContext | undefined = undefined;\n\n/**\n * 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\nexport function StylixProvider({\n id,\n devMode,\n plugins,\n media,\n styleElement,\n children,\n ssr,\n}: StylixProviderProps): React.ReactElement {\n const ctx = useRef<StylixContext | null>(null);\n if (!ctx.current)\n ctx.current = createStylixContext({ id, devMode, plugins, media, styleElement, ssr });\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 type { StylixContext } from './StylixProvider';\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 or legacy browser, 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.devMode && ctx.styleElement) {\n const flattenedRules = flattenRules(ctx);\n ctx.styleElement.innerHTML = flattenedRules.join('\\n');\n } else {\n // If there's a style element, use its stylesheet\n if (ctx.styleElement) ctx.stylesheet = ctx.styleElement.sheet as CSSStyleSheet;\n\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 } else {\n // Legacy method\n while (stylesheet.rules?.length || stylesheet.cssRules?.length) {\n stylesheet.deleteRule(0);\n }\n for (const i in flattenedRules)\n try {\n stylesheet.insertRule(flattenedRules[i], +i);\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","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 type { StylixContext } from './StylixProvider';\nimport { applyPlugins } from './plugins';\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 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 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 { useRef } from 'react';\n\nimport { type StylixContext, useStylixContext } from './StylixProvider';\nimport applyRules from './applyRules';\nimport { getParentComponentName } from './getParentComponentName';\nimport { applyPlugins } from './plugins';\nimport stylesToRuleArray from './stylesToRuleArray';\nimport type { StylixObject, StylixStyles } from './types';\nimport { isEmpty } from './util/isEmpty';\nimport useIsoLayoutEffect from './util/useIsoLayoutEffect';\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\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 prevStylesJson = useRef('');\n\n // Preprocess styles with plugins\n if (styles && !isEmpty(styles))\n styles = applyPlugins('preprocessStyles', styles, null, stylixCtx);\n\n let stylesJson = styles && !isEmpty(styles) ? JSON.stringify(styles) : '';\n if (stylesJson && options.global) stylesJson = `global:${stylesJson}`;\n\n const changed = stylesJson !== prevStylesJson.current;\n prevStylesJson.current = stylesJson;\n\n options.debugLabel ||= stylixCtx.devMode ? getParentComponentName() : '';\n\n if (stylesJson && !stylixCtx.rules[stylesJson]) {\n stylixCtx.styleCounter++;\n const className = `stylix-${(stylixCtx.styleCounter).toString(36)}${options.debugLabel ? `-${options.debugLabel}` : ''}`;\n // If not global styles, wrap original styles with classname\n if (!options.global) styles = { [`.${className}`]: styles };\n stylixCtx.rules[stylesJson] = {\n className,\n rules: stylesToRuleArray(styles as StylixObject, className, stylixCtx),\n refs: 0,\n };\n }\n\n if (changed) stylixCtx.requestApply = true;\n\n // When json changes, add/remove ref count\n const ruleSet = stylixCtx.rules[stylesJson];\n if (stylesJson && changed && ruleSet) {\n ruleSet.refs++;\n }\n\n // Apply styles if requested.\n // This runs on every render. We utilize useLayoutEffect 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 useIsoLayoutEffect(\n () => {\n if (!stylixCtx.requestApply) return;\n stylixCtx.requestApply = false;\n applyRules(stylixCtx);\n },\n undefined,\n true,\n stylixCtx.ssr,\n );\n\n useIsoLayoutEffect(\n () => {\n if (!stylesJson || !changed) return;\n\n return () => {\n const ruleSet = stylixCtx.rules[stylesJson];\n if (!ruleSet) return;\n ruleSet.refs--;\n if (ruleSet.refs <= 0) stylixCtx.rules[stylesJson] = undefined;\n cleanup(stylixCtx);\n };\n },\n [stylesJson],\n false,\n stylixCtx.ssr,\n );\n\n return stylixCtx.rules[stylesJson]?.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 React from 'react';\nimport type { IntrinsicElements } from './elements';\nimport { useStylixContext } from './StylixProvider';\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 & 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 & 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 &\n ((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,\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> = 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 { StyleElement } from './StyleElement';\nimport { useStylixContext } from './StylixProvider';\nimport { flattenRules } from './applyRules';\nimport type { HTMLProps } from './elements';\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":";;;AAAM,SAAU,aAAa,CAAC,KAAU,EAAE,UAAkC,EAAA;IAC1E,MAAM,MAAM,GAAG,EAAS;IACxB,MAAM,KAAK,GAAG,EAAS;AAEvB,IAAA,KAAK,MAAM,IAAI,IAAI,KAAK,EA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O,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;;aAC/B,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,EAAE;AAClD,YAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;gBAC9C,IAAI,KAAK,EAAE;AACT,oBAAA,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC;;;;;AAK5B,IAAA,OAAO,UAAU;AACnB;AAEA;;;;;;;;;AASG;AACG,SAAU,EAAE,CAAC,GAAG,IAAiB,EAAA;IACrC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;AAChC;;;;"}
package/package.json CHANGED
@@ -1,8 +1,15 @@
1
1
  {
2
2
  "name": "@stylix/core",
3
- "version": "5.1.0",
3
+ "version": "6.0.0",
4
4
  "description": "React, with style. Add styles to your React apps with props: the easy, natural, and low learning curve approach.",
5
- "keywords": ["react", "styles", "css", "css-in-js", "emotion", "styled-components"],
5
+ "keywords": [
6
+ "react",
7
+ "styles",
8
+ "css",
9
+ "css-in-js",
10
+ "emotion",
11
+ "styled-components"
12
+ ],
6
13
  "type": "module",
7
14
  "module": "./dist/index.js",
8
15
  "types": "./dist/index.d.ts",
@@ -30,25 +37,26 @@
30
37
  "react-dom": ">=18.0.0"
31
38
  },
32
39
  "devDependencies": {
33
- "@biomejs/biome": "^1.9.4",
40
+ "@biomejs/biome": "^2.0.5",
34
41
  "@rollup/plugin-json": "^6.1.0",
35
- "@rollup/plugin-typescript": "^12.1.2",
42
+ "@rollup/plugin-typescript": "^12.1.3",
36
43
  "@testing-library/dom": "^10.4.0",
37
44
  "@testing-library/jest-dom": "^6.6.3",
38
- "@testing-library/react": "^16.1.0",
39
- "@types/jest": "^29.5.14",
40
- "@types/node": "^22.10.2",
41
- "@types/react": "^19.0.2",
42
- "@types/react-dom": "^19.0.2",
45
+ "@testing-library/react": "^16.3.0",
46
+ "@types/jest": "^30.0.0",
47
+ "@types/node": "^24.0.4",
48
+ "@types/react": "^19.1.8",
49
+ "@types/react-dom": "^19.1.6",
43
50
  "csstype": "^3.1.3",
44
51
  "husky": "^9.1.7",
45
- "jest": "^29.7.0",
46
- "jest-environment-jsdom": "^29.7.0",
47
- "mdn-data": "^2.14.0",
48
- "rollup": "^4.29.1",
49
- "rollup-plugin-dts": "^6.1.1",
50
- "ts-jest": "^29.2.5",
51
- "tsx": "^4.19.2",
52
- "typescript": "^5.7.2"
52
+ "jest": "^30.0.2",
53
+ "jest-environment-jsdom": "^30.0.2",
54
+ "mdn-data": "^2.21.0",
55
+ "rollup": "^4.44.0",
56
+ "rollup-plugin-dts": "^6.2.1",
57
+ "ts-jest": "^29.4.0",
58
+ "tslib": "^2.8.1",
59
+ "tsx": "^4.20.3",
60
+ "typescript": "^5.8.3"
53
61
  }
54
62
  }
package/tsconfig.json CHANGED
@@ -10,6 +10,7 @@
10
10
  "isolatedModules": true,
11
11
  "baseUrl": "./src",
12
12
  "moduleResolution": "node",
13
+ "noEmit": true,
13
14
  "lib": ["dom", "esnext"]
14
15
  }
15
16
  }