@marwes-ui/react 0.0.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Niklas Westman
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,100 @@
1
+ # @marwes-ui/react
2
+
3
+ React adapter for Marwes core recipes.
4
+
5
+ ## Responsibilities
6
+ - Provide React components and provider APIs.
7
+ - Resolve theme from context and call core recipes.
8
+ - Apply typed RenderKit output to React elements.
9
+
10
+ ## Non-Responsibilities
11
+ - No component logic duplication from core.
12
+ - No preset CSS ownership.
13
+
14
+ ## Install
15
+ ```bash
16
+ pnpm add @marwes-ui/core @marwes-ui/react @marwes-ui/presets
17
+ ```
18
+
19
+ ## Quick Start
20
+ ```tsx
21
+ import { MarwesProvider, Button, Input, Checkbox } from "@marwes-ui/react";
22
+ import { firstEdition } from "@marwes-ui/presets";
23
+ import "@marwes-ui/presets/firstEdition/styles.css";
24
+
25
+ export function App() {
26
+ return (
27
+ <MarwesProvider preset={firstEdition} theme={{ color: { primary: "#5B8CFF" } }}>
28
+ <Button tone="primary">Save</Button>
29
+ <Input placeholder="Email" onValueChange={(v) => console.log(v)} />
30
+ <Checkbox ariaLabel="Subscribe" />
31
+ </MarwesProvider>
32
+ );
33
+ }
34
+ ```
35
+
36
+ ## Current Exports
37
+ Provider and hooks:
38
+ - `MarwesProvider`
39
+ - `useTheme`
40
+ - `useSystem`
41
+
42
+ Atoms:
43
+ - `Button`
44
+ - `Input`
45
+ - `Icon`
46
+ - `Checkbox`
47
+ - `H1`, `H2`, `H3`
48
+ - `Paragraph`
49
+
50
+ Molecules:
51
+ - `CheckboxField`
52
+
53
+ Utilities:
54
+ - `useRenderKitDebug`
55
+
56
+ ## Adapter Rules
57
+ - Treat `@marwes-ui/core` as source of truth for behavior and a11y.
58
+ - Apply RenderKit fields explicitly.
59
+ - Keep component wrappers thin and predictable.
60
+ - Do not hardcode Figma design values in adapters.
61
+
62
+ ## Package Structure
63
+ - `src/provider/*` - provider + hooks
64
+ - `src/components/*` - React wrappers around core recipes
65
+ - `src/index.ts` - public exports
66
+
67
+ ## Figma Mapping
68
+ If design changes originate in Figma, align token/state mapping with:
69
+ - `../../docs/FIGMA_TO_MARWES.md`
70
+
71
+ Most Figma changes should land in core theme/recipes and presets CSS first, then flow into React automatically.
72
+
73
+ ## Scripts
74
+ - `pnpm --filter @marwes-ui/react dev`
75
+ - `pnpm --filter @marwes-ui/react build`
76
+ - `pnpm --filter @marwes-ui/react typecheck`
77
+
78
+ ## Package Structure
79
+
80
+ ```
81
+ dist/ # Build output (npm published files)
82
+ ├── index.js # ESM bundle
83
+ ├── index.d.ts # TypeScript declarations
84
+ └── index.js.map # Source maps
85
+
86
+ src/ # Source files (not published)
87
+ ├── components/ # React components
88
+ ├── hooks/ # React hooks
89
+ └── provider/ # Context provider
90
+
91
+ tsconfig.json # TypeScript config (noEmit: true)
92
+ tsup.config.ts # Build configuration
93
+ ```
94
+
95
+ **Important**: The `dist/` folder is generated by `pnpm build` and should never be edited directly. Only the `dist/` folder is published to npm (configured in `package.json` `files` field).
96
+
97
+ ## Related Docs
98
+ - `../../docs/PROJECT.md`
99
+ - `../../docs/ARCHITECTURE.md`
100
+ - `../../docs/ENGINEERING.md`