@marwes-ui/core 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 +21 -0
- package/README.md +68 -0
- package/dist/index.d.ts +4435 -0
- package/dist/index.js +5197 -0
- package/dist/index.js.map +1 -0
- package/package.json +35 -0
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,68 @@
|
|
|
1
|
+
# @marwes-ui/core
|
|
2
|
+
|
|
3
|
+
Framework-agnostic Marwes core: theme system, typed component recipes, and a11y mapping.
|
|
4
|
+
|
|
5
|
+
## Responsibilities
|
|
6
|
+
- Define and normalize the `Theme` contract.
|
|
7
|
+
- Build component render kits (`tag`, `className`, `vars`, `a11y`).
|
|
8
|
+
- Centralize a11y behavior so adapters stay consistent.
|
|
9
|
+
- Stay independent from DOM and framework runtime.
|
|
10
|
+
|
|
11
|
+
## Non-Responsibilities
|
|
12
|
+
- No React/Vue rendering.
|
|
13
|
+
- No preset CSS authoring.
|
|
14
|
+
- No runtime styling engine.
|
|
15
|
+
|
|
16
|
+
## Public API
|
|
17
|
+
Theme and system:
|
|
18
|
+
- `defaultTheme`
|
|
19
|
+
- `mergeTheme`
|
|
20
|
+
- `normalizeTheme`
|
|
21
|
+
- `createSystem`
|
|
22
|
+
- Types: `Theme`, `ThemeOverrides`, `Preset`, `System`, `CssVars`
|
|
23
|
+
|
|
24
|
+
Atoms (recipes + types):
|
|
25
|
+
- `createButtonRecipe`
|
|
26
|
+
- `createInputRecipe`
|
|
27
|
+
- `checkboxRecipe`
|
|
28
|
+
- `createIconRecipe`
|
|
29
|
+
- `createHeadingRecipe`
|
|
30
|
+
- `createParagraphRecipe`
|
|
31
|
+
|
|
32
|
+
Molecules:
|
|
33
|
+
- `checkboxFieldRecipe`
|
|
34
|
+
|
|
35
|
+
## RenderKit Contract
|
|
36
|
+
Core recipes return typed render data consumed by adapters:
|
|
37
|
+
- `tag`: target HTML tag
|
|
38
|
+
- `className`: stable `.mw-*` classes
|
|
39
|
+
- `vars`: `Record<--mw-*, string>` CSS variables
|
|
40
|
+
- `a11y`: explicit typed accessibility fields
|
|
41
|
+
- optional control fields per component (for example `blockClick`, `indeterminate`)
|
|
42
|
+
|
|
43
|
+
## File Layout
|
|
44
|
+
- `src/theme/*` - theme types/defaults/merge/normalize/system
|
|
45
|
+
- `src/components/atoms/*` - atomic component contracts + recipes
|
|
46
|
+
- `src/components/molecules/*` - composed component contracts + recipes
|
|
47
|
+
- `src/shared/css-vars.ts` - CSS variable type contract
|
|
48
|
+
|
|
49
|
+
## Engineering Rules
|
|
50
|
+
- Keep core framework-agnostic.
|
|
51
|
+
- Do not use `any`.
|
|
52
|
+
- Put accessibility mapping in `*.a11y.ts`.
|
|
53
|
+
- Put visual decisions in presets, not in adapters.
|
|
54
|
+
- Only emit CSS variables and stable classnames from recipes.
|
|
55
|
+
|
|
56
|
+
## Figma Mapping
|
|
57
|
+
When implementing design changes from Figma, map tokens into theme keys and recipe vars as documented in:
|
|
58
|
+
- `../../docs/FIGMA_TO_MARWES.md`
|
|
59
|
+
|
|
60
|
+
## Scripts
|
|
61
|
+
- `pnpm --filter @marwes-ui/core dev`
|
|
62
|
+
- `pnpm --filter @marwes-ui/core build`
|
|
63
|
+
- `pnpm --filter @marwes-ui/core typecheck`
|
|
64
|
+
|
|
65
|
+
## Related Docs
|
|
66
|
+
- `../../docs/PROJECT.md`
|
|
67
|
+
- `../../docs/ARCHITECTURE.md`
|
|
68
|
+
- `../../docs/ENGINEERING.md`
|