@manarp/mor 0.0.0-stage → 0.2.0

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 Manarp
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 CHANGED
@@ -1,3 +1,46 @@
1
- # Temporary Holding Version
1
+ # @manarp/mor
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Mor is Manarp's design system: semantic HTML, CSS and a little JavaScript.
4
+ No runtime dependencies, no build step to use it, under 10KB gzipped for CSS and JS together.
5
+ Every component, with a live demo and its HTML, is on [design.manarp.com](https://design.manarp.com).
6
+
7
+ ## Use it
8
+
9
+ ```html
10
+ <link rel="stylesheet" href="node_modules/@manarp/mor/dist/mor.min.css">
11
+ <script type="module" src="node_modules/@manarp/mor/dist/mor.js"></script>
12
+ ```
13
+
14
+ ```ts
15
+ import "@manarp/mor/mor.min.css";
16
+ import { toast } from "@manarp/mor";
17
+ ```
18
+
19
+ Plain HTML is already styled: `<button>`, form controls, tables, `<details>`, `<dialog>`, `[popover]` and typography need no classes.
20
+ Classes only pick variants (`button.secondary`, `.badge.brass`) or add layout (`.card`, `.stack`, `.grid`).
21
+
22
+ ## How it works
23
+
24
+ - **Tokens.** Every color, size and radius is a `--mor-*` variable in `src/css/00-tokens.css`.
25
+ Light and dark come from one set via `light-dark()`; `data-theme="light"` or `"dark"` forces a scheme on any subtree.
26
+ - **Native first.** Modals and drawers are `<dialog>`, opened with `commandfor`/`command`.
27
+ Popovers, menus, tooltips and toasts use the Popover API.
28
+ All of them render in the browser's top layer, so no parent's `overflow`, `z-index` or `transform` can clip or cover them.
29
+ - **JavaScript fills the gaps** (`src/mor.ts`), through document-level listeners, so injected HTML needs no setup:
30
+ - positions anchored popovers, menus and tooltips against the window, flipping and shifting to stay on screen;
31
+ - WAI-ARIA keyboard support for menus and tabs;
32
+ - polyfills `commandfor` and `<dialog closedby="any">` in browsers without them;
33
+ - `toast(message, { variant, duration })`.
34
+
35
+ Known limit: while a modal is open, the browser makes everything outside it inert, so a toast stays visible but its close button can't be clicked until the modal closes.
36
+
37
+ ## Develop
38
+
39
+ ```sh
40
+ npm run check # typecheck, unit tests, build
41
+ npm run build # dist/: mor.css, mor.min.css, mor.js, mor.d.ts, plus the size report
42
+ ```
43
+
44
+ The source is TypeScript; the build strips types with Node's built-in stripper, so the only dev dependencies are `typescript` and `@types/node` for type checking and `mor.d.ts`.
45
+ The build fails if CSS and JS together pass 10KB gzipped.
46
+ Add a component by adding its CSS file to `src/css/`, listing it in `scripts/build.ts`, and adding a demo section to `apps/design/src/index.html`.