@plumeria/core 10.0.3 → 10.0.5

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 (3) hide show
  1. package/README.md +23 -37
  2. package/lib/css.d.ts +11 -13
  3. package/package.json +7 -5
package/README.md CHANGED
@@ -1,6 +1,19 @@
1
1
  # @plumeria/core
2
+ ![license](https://img.shields.io/badge/license-MIT-blue)
3
+ ![npm](https://img.shields.io/npm/v/@plumeria/core)
2
4
 
3
- **A styling system that disappears.**
5
+ ![web (prod/dev)](https://img.shields.io/badge/web%20(prod/dev)-0B-brightgreen)
6
+ ![runtime](https://img.shields.io/badge/runtime-0B-brightgreen)
7
+ ![type safe](https://img.shields.io/badge/types-100%25-brightgreen)
8
+
9
+ **Plumeria** is a library for developing styled React components for the web. It is a compiler with typed syntax and linting support. The goal of Plumeria is to reduce the load on developers.
10
+
11
+ ## Documentation
12
+
13
+ Read the [documentation](https://plumeria.dev/) for more details.
14
+
15
+ ## Example
16
+ Styles can be passed to the `styleName` prop. That prop accepts static and dynamic styles as an array.
4
17
 
5
18
  ```tsx
6
19
  import * as css from '@plumeria/core';
@@ -8,57 +21,30 @@ import * as css from '@plumeria/core';
8
21
  const styles = css.create({
9
22
  text: {
10
23
  fontSize: 12,
11
- color: 'navy',
12
24
  },
13
- size: {
14
- width: 120,
25
+ cond: {
26
+ background: 'navy'
15
27
  },
28
+ scale: (value) => ({
29
+ scale: value
30
+ })
16
31
  });
17
32
 
18
33
  export default function App(props) {
34
+ const scale = useScale();
19
35
  return (
20
36
  <div
21
37
  {...props}
22
38
  styleName={[
23
39
  styles.text,
24
- styles.size
40
+ cond && styles.cond,
41
+ styles.scale(scale)
25
42
  ]}
26
43
  />
27
44
  );
28
45
  }
29
46
  ```
30
47
 
31
- **Compiled:**
32
-
33
- ```tsx
34
- <div className="xhrr6ses xvbwmxqp xhk51flp" />
35
- ```
36
-
37
- ## Documentation
38
-
39
- Read the [documentation](https://plumeria.dev/) for more details.
40
-
41
- ## Installation
42
-
43
- - [Vite](https://plumeria.dev/docs/integration/vite)
44
- - [Next](https://plumeria.dev/docs/integration/next)
45
- - [Turbopack](https://plumeria.dev/docs/integration/turbopack)
46
- - [Webpack](https://plumeria.dev/docs/integration/webpack)
47
- - [PostCSS](https://plumeria.dev/docs/integration/postcss)
48
- - [ESLint](https://plumeria.dev/docs/integration/eslint)
49
-
50
- ## Acknowledgements
51
-
52
- Plumeria is made possible thanks to the inspirations from the following projects:
53
-
54
- - [Linaria](https://linaria.dev/)
55
- - [React Native](https://reactnative.dev/docs/stylesheet)
56
- - [React Native for Web](https://necolas.github.io/react-native-web/)
57
- - [React Strict DOM](https://facebook.github.io/react-strict-dom/)
58
- - [StyleX](https://stylexjs.com/)
59
- - [Tailwind CSS](https://tailwindcss.com/)
60
-
61
-
62
48
  ## License
63
49
 
64
- [MIT](https://github.com/zss-in-js/plumeria/blob/main/LICENSE) License &copy; 2023-PRESENT [Refirst 11](https://github.com/refirst11)
50
+ Plumeria is MIT licensed.
package/lib/css.d.ts CHANGED
@@ -14,7 +14,9 @@
14
14
  * ```
15
15
  */
16
16
  declare module '@plumeria/core' {
17
- import type {
17
+ import type {
18
+ StyleName,
19
+ CSSProperties,
18
20
  CreateStyleValue,
19
21
  CreateStyleType,
20
22
  CreateReturnType,
@@ -26,10 +28,15 @@ declare module '@plumeria/core' {
26
28
  Variants,
27
29
  Marker,
28
30
  Extended,
29
- } from './types';
31
+ } from '#types';
30
32
 
31
- export type CSSProperties = import('./types').CSSProperties;
32
- export type CreateStyle = import('./types').CreateStyle;
33
+ global {
34
+ namespace React {
35
+ interface HTMLAttributes<T> {
36
+ styleName?: StyleName;
37
+ }
38
+ }
39
+ }
33
40
 
34
41
  export type create = <const T extends Record<string, CreateStyleValue>>(rule: CreateStyleType<T>)=> CreateReturnType<T>;
35
42
  export type createTheme = <const T extends CreateTheme>(rule: T)=> ReturnVariableType<T>;
@@ -50,13 +57,4 @@ declare module '@plumeria/core' {
50
57
  export const marker: marker;
51
58
  export const extended: extended;
52
59
  export const use: use;
53
-
54
- declare global {
55
- namespace React {
56
- import type { StyleName } from './types';
57
- interface HTMLAttributes<T> {
58
- styleName?: StyleName;
59
- }
60
- }
61
- }
62
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/core",
3
- "version": "10.0.3",
3
+ "version": "10.0.5",
4
4
  "description": "A styling system that disappears.",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",
@@ -15,12 +15,11 @@
15
15
  "url": "https://github.com/zss-in-js/plumeria/issues"
16
16
  },
17
17
  "keywords": [
18
- "react",
19
18
  "css",
20
19
  "css-in-js",
21
- "zero-runtime",
22
- "atomic-css",
23
- "stylex"
20
+ "plumeria",
21
+ "react",
22
+ "atomic-css"
24
23
  ],
25
24
  "sideEffects": false,
26
25
  "type": "module",
@@ -30,6 +29,9 @@
30
29
  "import": "./lib/css.js"
31
30
  }
32
31
  },
32
+ "imports": {
33
+ "#types": "./lib/types.d.ts"
34
+ },
33
35
  "files": [
34
36
  "lib/"
35
37
  ],