@plumeria/react 22.3.0 → 22.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +5 -3
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,4 +1,6 @@
1
- **@plumeria/react** adds `styled` to [Plumeria](https://www.npmjs.com/package/@plumeria/core). At build time, the compiler first rewrites a styled definition using `css.create` and the configured style prop (`sx` by default). Plumeria then compiles those styles as usual.
1
+ **@plumeria/react** adds `styled` to [Plumeria](https://www.npmjs.com/package/@plumeria/core). Use it for components whose job is to carry styles: a button, a text field, a layout primitive that the rest of the app reuses and extends for each use. When a component has its own logic and you only need to style part of what it renders, pass a `css.create` style to `sx` instead.
2
+
3
+ At build time, the compiler first rewrites a styled definition using `css.create` and the configured style prop (`sx` by default). Plumeria then compiles those styles as usual.
2
4
 
3
5
  ## Installation
4
6
 
@@ -8,12 +10,13 @@ pnpm add -D @plumeria/react
8
10
 
9
11
  `@plumeria/react` contains type definitions only. It needs `@plumeria/core` and a bundler integration — see the [installation guide](https://plumeria.dev/docs/installation).
10
12
 
13
+ A styled component compiles to JSX, so define it in a `.tsx` or `.jsx` file. Export it from there and import it anywhere.
14
+
11
15
  ## Example
12
16
 
13
17
  Define a styled element at module scope and use it with the native element's props.
14
18
 
15
19
  ```tsx
16
- import '@plumeria/core';
17
20
  import { styled } from '@plumeria/react';
18
21
 
19
22
  export const Button = styled.button({
@@ -31,7 +34,6 @@ export function SaveButton() {
31
34
  Read a prop directly in a style value. Its parameter type tells TypeScript which props the component requires.
32
35
 
33
36
  ```tsx
34
- import '@plumeria/core';
35
37
  import { styled } from '@plumeria/react';
36
38
 
37
39
  const Swatch = styled.div({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/react",
3
- "version": "22.3.0",
3
+ "version": "22.3.2",
4
4
  "description": "Styled components for Plumeria, compiled to the sx prop",
5
5
  "author": "zss-labs",
6
6
  "license": "MIT",
@@ -16,7 +16,7 @@
16
16
  "keywords": [
17
17
  "plumeria",
18
18
  "react",
19
- "styled",
19
+ "styled-components",
20
20
  "css-in-js",
21
21
  "atomic-css",
22
22
  "zero-runtime",
@@ -34,7 +34,7 @@
34
34
  ],
35
35
  "devDependencies": {
36
36
  "@types/react": "^19.3.0",
37
- "@plumeria/core": "22.3.0"
37
+ "@plumeria/core": "22.3.2"
38
38
  },
39
39
  "publishConfig": {
40
40
  "access": "public",