@typestyles/react 0.0.0-unstable.3a8feb2a3be6 → 0.0.0-unstable.3b624adca193

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 (62) hide show
  1. package/README.md +16 -16
  2. package/dist/babel-plugin.cjs +14223 -152
  3. package/dist/babel-plugin.cjs.map +1 -1
  4. package/dist/babel-plugin.d.cts +10 -10
  5. package/dist/babel-plugin.d.cts.map +1 -0
  6. package/dist/babel-plugin.d.ts +10 -10
  7. package/dist/babel-plugin.d.ts.map +1 -0
  8. package/dist/babel-plugin.js +14223 -130
  9. package/dist/babel-plugin.js.map +1 -1
  10. package/dist/css-prop-DMDmFKhu.js +21 -0
  11. package/dist/css-prop-DMDmFKhu.js.map +1 -0
  12. package/dist/css-prop-DOMoNwJN.cjs +38 -0
  13. package/dist/css-prop-DOMoNwJN.cjs.map +1 -0
  14. package/dist/css-prop-runtime-zKybLO8E.d.cts +14 -0
  15. package/dist/css-prop-runtime-zKybLO8E.d.cts.map +1 -0
  16. package/dist/css-prop-runtime-zKybLO8E.d.ts +14 -0
  17. package/dist/css-prop-runtime-zKybLO8E.d.ts.map +1 -0
  18. package/dist/css-prop-runtime.cjs +7 -7
  19. package/dist/css-prop-runtime.cjs.map +1 -1
  20. package/dist/css-prop-runtime.d.cts +2 -7
  21. package/dist/css-prop-runtime.d.ts +2 -7
  22. package/dist/css-prop-runtime.js +8 -2
  23. package/dist/css-prop-runtime.js.map +1 -1
  24. package/dist/index.cjs +75 -99
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +25 -21
  27. package/dist/index.d.cts.map +1 -0
  28. package/dist/index.d.ts +25 -21
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +69 -75
  31. package/dist/index.js.map +1 -1
  32. package/dist/jsx-dev-runtime.cjs +20 -38
  33. package/dist/jsx-dev-runtime.cjs.map +1 -1
  34. package/dist/jsx-dev-runtime.d.cts +9 -11
  35. package/dist/jsx-dev-runtime.d.cts.map +1 -0
  36. package/dist/jsx-dev-runtime.d.ts +9 -11
  37. package/dist/jsx-dev-runtime.d.ts.map +1 -0
  38. package/dist/jsx-dev-runtime.js +19 -25
  39. package/dist/jsx-dev-runtime.js.map +1 -1
  40. package/dist/jsx-runtime.cjs +23 -41
  41. package/dist/jsx-runtime.cjs.map +1 -1
  42. package/dist/jsx-runtime.d.cts +10 -12
  43. package/dist/jsx-runtime.d.cts.map +1 -0
  44. package/dist/jsx-runtime.d.ts +10 -12
  45. package/dist/jsx-runtime.d.ts.map +1 -0
  46. package/dist/jsx-runtime.js +20 -27
  47. package/dist/jsx-runtime.js.map +1 -1
  48. package/dist/resolve-hash-class-DuqLJq6S.cjs +14 -0
  49. package/dist/resolve-hash-class-DuqLJq6S.cjs.map +1 -0
  50. package/dist/resolve-hash-class-Rs_7aMMQ.js +9 -0
  51. package/dist/resolve-hash-class-Rs_7aMMQ.js.map +1 -0
  52. package/dist/types-DcDsqg2q.d.cts +10 -0
  53. package/dist/types-DcDsqg2q.d.cts.map +1 -0
  54. package/dist/types-DcDsqg2q.d.ts +10 -0
  55. package/dist/types-DcDsqg2q.d.ts.map +1 -0
  56. package/package.json +9 -11
  57. package/dist/chunk-3YCUQVCM.js +0 -8
  58. package/dist/chunk-3YCUQVCM.js.map +0 -1
  59. package/dist/chunk-4BYX2HZ7.js +0 -22
  60. package/dist/chunk-4BYX2HZ7.js.map +0 -1
  61. package/dist/types-_vEO6H8X.d.cts +0 -9
  62. package/dist/types-_vEO6H8X.d.ts +0 -9
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @typestyles/react
2
2
 
3
- React integration for [typestyles](https://github.com/type-styles/typestyles) — migration-friendly **`styled`** API and **`css` prop** for teams coming from Emotion or styled-components.
3
+ React integration for [typestyles](https://github.com/phthalo-dev/typestyles) — migration-friendly **`styled`** API and **`css` prop** for teams coming from Emotion or styled-components.
4
4
 
5
5
  ## Installation
6
6
 
@@ -10,14 +10,14 @@ npm install @typestyles/react typestyles react react-dom
10
10
 
11
11
  ## `createStyled` / `styled`
12
12
 
13
- Thin React wrapper over `styles.component` with typed variant props via `ComponentVariants`:
13
+ Thin React wrapper over `recipe` from `createTypeStyles` with typed variant props via `ComponentVariants`:
14
14
 
15
15
  ```tsx
16
- import { createStyles } from 'typestyles';
16
+ import { createTypeStyles } from 'typestyles';
17
17
  import { createStyled, TypeStylesProvider } from '@typestyles/react';
18
18
 
19
- const styles = createStyles();
20
- const styled = createStyled(styles);
19
+ const api = createTypeStyles({ scopeId: 'app' });
20
+ const styled = createStyled(api);
21
21
 
22
22
  const Button = styled('button', {
23
23
  base: { padding: '8px 16px', border: 'none', borderRadius: '4px' },
@@ -32,7 +32,7 @@ const Button = styled('button', {
32
32
 
33
33
  function App() {
34
34
  return (
35
- <TypeStylesProvider styles={styles}>
35
+ <TypeStylesProvider styles={api}>
36
36
  <Button intent="ghost">Click me</Button>
37
37
  </TypeStylesProvider>
38
38
  );
@@ -51,12 +51,12 @@ Point JSX at `@typestyles/react` and wrap your app in `TypeStylesProvider`:
51
51
 
52
52
  ```tsx
53
53
  /** @jsxImportSource @typestyles/react */
54
- import { styles } from './styles';
54
+ import { api } from './styles';
55
55
  import { TypeStylesProvider } from '@typestyles/react';
56
56
 
57
57
  export function App() {
58
58
  return (
59
- <TypeStylesProvider styles={styles}>
59
+ <TypeStylesProvider styles={api}>
60
60
  <div css={{ color: 'red', padding: '1rem' }}>Hello</div>
61
61
  </TypeStylesProvider>
62
62
  );
@@ -73,7 +73,7 @@ Or in `tsconfig.json`:
73
73
  }
74
74
  ```
75
75
 
76
- Inline style objects are converted to deterministic classes via `styles.hashClass` at runtime.
76
+ Inline style objects are converted to deterministic classes via `hash` (or `hashClass` on a `createStyles()` instance) at runtime.
77
77
 
78
78
  ## Zero-runtime `css` prop (Babel)
79
79
 
@@ -102,13 +102,13 @@ Dynamic expressions (e.g. `css={condition && { color: 'red' }}`) are left unchan
102
102
 
103
103
  ## API
104
104
 
105
- | Export | Description |
106
- | ------------------------------- | -------------------------------------------------------------------- |
107
- | `createStyled(styles)` | Returns a `styled(tag, config)` factory backed by `styles.component` |
108
- | `TypeStylesProvider` | Supplies `styles` to the jsx runtime for `css` prop resolution |
109
- | `resolveCssPropClass` | Low-level helper: `css` object → merged `className` |
110
- | `@typestyles/react/jsx-runtime` | Drop-in jsx runtime with `css` prop support |
111
- | `@typestyles/react/babel` | Babel plugin for zero-runtime static `css` props |
105
+ | Export | Description |
106
+ | ------------------------------- | --------------------------------------------------------------------- |
107
+ | `createStyled(api)` | Returns a `styled(tag, config)` factory backed by `recipe` on the API |
108
+ | `TypeStylesProvider` | Supplies the styles API to the jsx runtime for `css` prop resolution |
109
+ | `resolveCssPropClass` | Low-level helper: `css` object → merged `className` |
110
+ | `@typestyles/react/jsx-runtime` | Drop-in jsx runtime with `css` prop support |
111
+ | `@typestyles/react/babel` | Babel plugin for zero-runtime static `css` props |
112
112
 
113
113
  ## Future work
114
114