@rubenlangeweg/mero-ui 0.0.0-stage → 0.7.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/CHANGELOG.md +71 -0
- package/LICENSE +21 -0
- package/README.md +141 -2
- package/agent-docs/components/accordion.md +31 -0
- package/agent-docs/components/action-bar.md +45 -0
- package/agent-docs/components/action-button.md +42 -0
- package/agent-docs/components/agenda.md +38 -0
- package/agent-docs/components/alert-dialog.md +36 -0
- package/agent-docs/components/alert.md +25 -0
- package/agent-docs/components/app-layout.md +36 -0
- package/agent-docs/components/area-chart.md +36 -0
- package/agent-docs/components/aura.md +24 -0
- package/agent-docs/components/autocomplete.md +81 -0
- package/agent-docs/components/avatar-group.md +26 -0
- package/agent-docs/components/avatar.md +25 -0
- package/agent-docs/components/badge.md +26 -0
- package/agent-docs/components/bar-chart.md +36 -0
- package/agent-docs/components/breadcrumbs.md +28 -0
- package/agent-docs/components/browser-mockup.md +26 -0
- package/agent-docs/components/button-group.md +26 -0
- package/agent-docs/components/button.md +75 -0
- package/agent-docs/components/calendar.md +105 -0
- package/agent-docs/components/card.md +26 -0
- package/agent-docs/components/carousel.md +78 -0
- package/agent-docs/components/cell-color-picker.md +32 -0
- package/agent-docs/components/cell-select.md +32 -0
- package/agent-docs/components/cell-slider.md +32 -0
- package/agent-docs/components/cell-switch.md +32 -0
- package/agent-docs/components/chain-of-thought.md +26 -0
- package/agent-docs/components/chart-tooltip.md +36 -0
- package/agent-docs/components/chat-attachment.md +26 -0
- package/agent-docs/components/chat-conversation.md +61 -0
- package/agent-docs/components/chat-list-view.md +25 -0
- package/agent-docs/components/chat-loader.md +24 -0
- package/agent-docs/components/chat-message-actions.md +25 -0
- package/agent-docs/components/chat-message.md +24 -0
- package/agent-docs/components/chat-source.md +24 -0
- package/agent-docs/components/chat-tool.md +41 -0
- package/agent-docs/components/checkbox-button-group.md +29 -0
- package/agent-docs/components/checkbox-group.md +29 -0
- package/agent-docs/components/checkbox.md +25 -0
- package/agent-docs/components/chip.md +22 -0
- package/agent-docs/components/close-button.md +33 -0
- package/agent-docs/components/code-block.md +24 -0
- package/agent-docs/components/code-mockup.md +25 -0
- package/agent-docs/components/color-area.md +30 -0
- package/agent-docs/components/color-field.md +30 -0
- package/agent-docs/components/color-picker.md +28 -0
- package/agent-docs/components/color-slider.md +31 -0
- package/agent-docs/components/color-swatch.md +26 -0
- package/agent-docs/components/combo-box.md +41 -0
- package/agent-docs/components/command-menu.md +46 -0
- package/agent-docs/components/command.md +38 -0
- package/agent-docs/components/composed-chart.md +36 -0
- package/agent-docs/components/context-menu.md +31 -0
- package/agent-docs/components/countdown.md +26 -0
- package/agent-docs/components/data-grid.md +159 -0
- package/agent-docs/components/date-field.md +28 -0
- package/agent-docs/components/date-picker.md +30 -0
- package/agent-docs/components/date-range-picker.md +40 -0
- package/agent-docs/components/description.md +28 -0
- package/agent-docs/components/diff.md +43 -0
- package/agent-docs/components/disclosure-group.md +31 -0
- package/agent-docs/components/disclosure.md +25 -0
- package/agent-docs/components/dock.md +26 -0
- package/agent-docs/components/drawer.md +34 -0
- package/agent-docs/components/drop-zone.md +34 -0
- package/agent-docs/components/dropdown.md +31 -0
- package/agent-docs/components/emoji-picker.md +31 -0
- package/agent-docs/components/emoji-reaction-button.md +26 -0
- package/agent-docs/components/empty-state.md +24 -0
- package/agent-docs/components/error-message.md +25 -0
- package/agent-docs/components/fab.md +26 -0
- package/agent-docs/components/field-error.md +30 -0
- package/agent-docs/components/fieldset.md +38 -0
- package/agent-docs/components/file-input.md +32 -0
- package/agent-docs/components/file-tree.md +24 -0
- package/agent-docs/components/filter-chips.md +149 -0
- package/agent-docs/components/floating-toc.md +24 -0
- package/agent-docs/components/footer.md +24 -0
- package/agent-docs/components/form.md +35 -0
- package/agent-docs/components/hero.md +26 -0
- package/agent-docs/components/holo-card.md +33 -0
- package/agent-docs/components/hover-card.md +26 -0
- package/agent-docs/components/hover-gallery.md +78 -0
- package/agent-docs/components/indicator.md +24 -0
- package/agent-docs/components/inline-select.md +26 -0
- package/agent-docs/components/input-group.md +30 -0
- package/agent-docs/components/input-otp.md +30 -0
- package/agent-docs/components/input.md +28 -0
- package/agent-docs/components/item-card-group.md +24 -0
- package/agent-docs/components/item-card.md +24 -0
- package/agent-docs/components/join.md +24 -0
- package/agent-docs/components/joined-filter.md +28 -0
- package/agent-docs/components/kanban.md +26 -0
- package/agent-docs/components/kbd.md +22 -0
- package/agent-docs/components/kpi-group.md +24 -0
- package/agent-docs/components/kpi.md +24 -0
- package/agent-docs/components/label.md +28 -0
- package/agent-docs/components/line-chart.md +64 -0
- package/agent-docs/components/link.md +22 -0
- package/agent-docs/components/list-box.md +30 -0
- package/agent-docs/components/list-view.md +24 -0
- package/agent-docs/components/live-progress.md +38 -0
- package/agent-docs/components/map.md +26 -0
- package/agent-docs/components/markdown.md +36 -0
- package/agent-docs/components/mask.md +26 -0
- package/agent-docs/components/megamenu.md +26 -0
- package/agent-docs/components/menu-button.md +78 -0
- package/agent-docs/components/menu.md +24 -0
- package/agent-docs/components/meter.md +28 -0
- package/agent-docs/components/modal.md +34 -0
- package/agent-docs/components/native-select.md +26 -0
- package/agent-docs/components/navbar.md +24 -0
- package/agent-docs/components/number-field.md +28 -0
- package/agent-docs/components/number-stepper.md +31 -0
- package/agent-docs/components/number-value.md +26 -0
- package/agent-docs/components/pagination.md +40 -0
- package/agent-docs/components/phone-mockup.md +26 -0
- package/agent-docs/components/pie-chart.md +36 -0
- package/agent-docs/components/popover.md +30 -0
- package/agent-docs/components/pressable-feedback.md +24 -0
- package/agent-docs/components/progress-bar.md +27 -0
- package/agent-docs/components/progress-circle.md +23 -0
- package/agent-docs/components/prompt-input.md +32 -0
- package/agent-docs/components/prompt-suggestion.md +32 -0
- package/agent-docs/components/radar-chart.md +36 -0
- package/agent-docs/components/radial-chart.md +36 -0
- package/agent-docs/components/radio-button-group.md +28 -0
- package/agent-docs/components/radio-group.md +29 -0
- package/agent-docs/components/range-calendar.md +40 -0
- package/agent-docs/components/rating.md +26 -0
- package/agent-docs/components/resizable.md +55 -0
- package/agent-docs/components/rich-text-editor.md +35 -0
- package/agent-docs/components/scroll-shadow.md +31 -0
- package/agent-docs/components/search-field.md +28 -0
- package/agent-docs/components/segment.md +28 -0
- package/agent-docs/components/select.md +31 -0
- package/agent-docs/components/separator.md +26 -0
- package/agent-docs/components/sheet.md +34 -0
- package/agent-docs/components/sidebar.md +36 -0
- package/agent-docs/components/skeleton.md +26 -0
- package/agent-docs/components/slider.md +27 -0
- package/agent-docs/components/sortable-table.md +303 -0
- package/agent-docs/components/spinner.md +25 -0
- package/agent-docs/components/stack.md +26 -0
- package/agent-docs/components/status.md +24 -0
- package/agent-docs/components/stepper.md +32 -0
- package/agent-docs/components/surface.md +25 -0
- package/agent-docs/components/swap.md +24 -0
- package/agent-docs/components/switch.md +75 -0
- package/agent-docs/components/table.md +31 -0
- package/agent-docs/components/tabs.md +65 -0
- package/agent-docs/components/tag-group.md +26 -0
- package/agent-docs/components/text-area.md +27 -0
- package/agent-docs/components/text-field.md +28 -0
- package/agent-docs/components/text-rotate.md +24 -0
- package/agent-docs/components/text-shimmer.md +24 -0
- package/agent-docs/components/theme-controller.md +24 -0
- package/agent-docs/components/time-field.md +30 -0
- package/agent-docs/components/timeline.md +24 -0
- package/agent-docs/components/toast.md +22 -0
- package/agent-docs/components/toggle-button-group.md +31 -0
- package/agent-docs/components/toggle-button.md +24 -0
- package/agent-docs/components/toolbar.md +28 -0
- package/agent-docs/components/tooltip.md +27 -0
- package/agent-docs/components/trend-chip.md +24 -0
- package/agent-docs/components/typed-confirmation.md +160 -0
- package/agent-docs/components/typography.md +26 -0
- package/agent-docs/components/validator.md +26 -0
- package/agent-docs/components/widget.md +24 -0
- package/agent-docs/components/window-mockup.md +24 -0
- package/agent-docs/llms-components.txt +5881 -0
- package/agent-docs/llms-full.txt +6110 -0
- package/agent-docs/llms-patterns.txt +230 -0
- package/agent-docs/llms.txt +261 -0
- package/package.json +48 -4
- package/ui/insight-charts.mjs +124 -0
- package/ui/insight-markdown.mjs +46 -0
- package/ui/mero-collections.css +146 -0
- package/ui/mero-collections.js +272 -0
- package/ui/mero-composition.css +342 -0
- package/ui/mero-composition.js +79 -0
- package/ui/mero-forms.js +223 -0
- package/ui/mero-gallery.css +122 -0
- package/ui/mero-gallery.js +193 -0
- package/ui/mero-insights.css +168 -0
- package/ui/mero-insights.js +188 -0
- package/ui/mero-inventory.css +182 -0
- package/ui/mero-inventory.js +56 -0
- package/ui/mero-layouts.css +73 -0
- package/ui/mero-live.js +120 -0
- package/ui/mero-workspace.css +152 -0
- package/ui/mero-workspace.js +590 -0
- package/ui/mero.css +922 -0
- package/ui/mero.js +868 -0
- package/ui/studio-lamp.webp +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.7.0 · 23 November 2026
|
|
4
|
+
|
|
5
|
+
- Try six HTMX 4 workflows in the playground. Review price changes with keyboard approval and undo, correct a spreadsheet before import, assign records from the command menu, publish across pages, share saved views and move cards together on a live board. [Open the workflows](https://mero-ui.rubenlangeweg.com/premium) · [Watch the seven captioned walkthroughs](https://mero-ui.rubenlangeweg.com/premium/watch)
|
|
6
|
+
- Run the workflows locally with `npm run demo:premium` from the source checkout. The Go and Rust quick starts each serve an inventory component and return an HTML fragment from a working handler. [Go example](https://mero-ui.rubenlangeweg.com/start#go) · [Rust example](https://mero-ui.rubenlangeweg.com/start#rust)
|
|
7
|
+
- The UI package now includes an offline component reference in `agent-docs/`. The repository also includes skills for building with Mero and contributing to the library. [Browse the component reference](https://mero-ui.rubenlangeweg.com/llms.txt)
|
|
8
|
+
- The catalog has a new wordmark and favicon. The header fits zoomed layouts, and the playground respects reduced motion when switching between workflows.
|
|
9
|
+
|
|
10
|
+
## 0.6.2 · 23 November 2026
|
|
11
|
+
|
|
12
|
+
- **Menu Button:** `menuitemradio` and `menuitemcheckbox` items get the same arrow-key, Home, End, typeahead, Escape and Tab handling as `menuitem`. The menu opens on its checked radio item, and checked items show a check mark. Mero does not change `aria-checked`; render it on the server.
|
|
13
|
+
- **Row peek:** add `data-mero-peek` around a table and a `<template data-mero-peek-body>` to each row. Space on a row link shows that row in a Preview panel beside the table, or in a bottom sheet below 768 px. The panel follows focus between rows, and Space or Escape closes it back to the row. It keeps its row through htmx swaps and morphs. The Sortable Table has a Row peek variant.
|
|
14
|
+
- Every script and stylesheet in `ui/` starts with `/*! @rubenlangeweg/mero-ui <version> | MIT */`, so a copied file shows which release it came from. `npm version` updates the line.
|
|
15
|
+
|
|
16
|
+
## 0.6.1 · 20 November 2026
|
|
17
|
+
|
|
18
|
+
- The test runner executes two files at a time. This keeps the full Firefox suite responsive on hosts where Node would otherwise start nine browser-test files at once. All three engines run the same tests.
|
|
19
|
+
|
|
20
|
+
## 0.6.0 · 20 November 2026
|
|
21
|
+
|
|
22
|
+
- Sortable Table and Filter Chips show labelled cards below 768 px. Sorting, row actions and focus on Back work in both layouts.
|
|
23
|
+
- Remote comboboxes activate only options returned for the current query, including when Firefox restores a saved draft. Escape and empty results clear the active option.
|
|
24
|
+
- Pull requests and releases run the complete test suite in Chromium, Firefox and WebKit. Publishing waits for all three.
|
|
25
|
+
- The command menu accepts named result groups. Arrow keys cross groups, Home and End reach the first and last result, and the live status counts selectable options.
|
|
26
|
+
- Live Progress polls a status fragment while the tab is visible, keeps the last good status when a read fails and stops at the server’s terminal response.
|
|
27
|
+
- Typed Confirmation gates destructive forms on an exact phrase and an optional required reason. It keeps the dialog open on validation errors, rejection and unknown outcomes.
|
|
28
|
+
- Copied form dialogs now return focus to their own controls. The quality review includes screen-reader checks for seven admin interactions.
|
|
29
|
+
|
|
30
|
+
## 0.5.1 · 20 November 2026
|
|
31
|
+
|
|
32
|
+
- A failed Studio view switch no longer replaces the workspace with the error response. htmx 4 swaps error responses by default.
|
|
33
|
+
|
|
34
|
+
## 0.5.0 · 20 November 2026
|
|
35
|
+
|
|
36
|
+
- **Breaking:** Mero targets htmx 4 only. htmx 2 is no longer supported, and `mero.js` no longer relays htmx 4 events under htmx 2 names.
|
|
37
|
+
- The Data Grid sorts from its column headers, filters by status with chips and a "+ Filter" menu, and moves Edit and Delete into a row Actions menu.
|
|
38
|
+
|
|
39
|
+
To upgrade:
|
|
40
|
+
|
|
41
|
+
1. Load htmx 4 (`htmx.org@4`) instead of htmx 2.
|
|
42
|
+
2. Send `HX-Trigger` instead of `HX-Trigger-After-Settle` for `mero:form-saved`. htmx 4 fires it after the swap settles. Add a `target` selector when the swap replaces the submitting form. A server that still sends `HX-Trigger-After-Settle` no longer closes the dialog.
|
|
43
|
+
3. Recopy templates that set `hx-*` attributes on a wrapper. They now use `hx-target:inherited` and similar names, which need htmx 4's default inheritance: remove `implicitInheritance` from your htmx config, because with it set htmx 4 ignores `:inherited` on ancestors. Only if you keep your 0.4 templates, set `implicitInheritance` instead. Do not mix the two.
|
|
44
|
+
4. Rename `hx-disabled-elt` to `hx-disable`.
|
|
45
|
+
5. Move your own listeners for htmx 2 events, such as `htmx:afterRequest` with `detail.xhr`, to htmx 4 events and `event.detail.ctx`.
|
|
46
|
+
6. Read the `HX-Target` request header as `tag#id`.
|
|
47
|
+
|
|
48
|
+
`hx-params` keeps working: `mero.js` applies it to the request fields.
|
|
49
|
+
|
|
50
|
+
## 0.4.0 · 20 November 2026
|
|
51
|
+
|
|
52
|
+
- **Menu Button:** a `role="menu"` popover now supports arrow keys, Home, End, typeahead, Escape and Tab, and focus returns to its button.
|
|
53
|
+
- **Action Button:** `data-mero-action` buttons outside a form show pending, succeeded, rejected or outcome-unknown states and fire `mero:action`. Requires `mero-forms.js`.
|
|
54
|
+
- **Sortable Table:** headers sort through plain `?sort=` links, rows open as links, and there is a compact layout.
|
|
55
|
+
- **Filter Chips:** applied filters show as removable chips with a "+ Filter" menu, all stored in the URL.
|
|
56
|
+
- **Command Menu:** `dialog[data-mero-command]` opens on Cmd or Ctrl K and searches results from your server.
|
|
57
|
+
- `data-mero-restore-focus` returns focus to the opened row after Back.
|
|
58
|
+
- Import the server helpers as `@rubenlangeweg/mero-ui/charts` and `@rubenlangeweg/mero-ui/markdown`. Paths under `ui/` still work.
|
|
59
|
+
- The docs list the `mero:*` events and the `window.MeroUI` functions and every `data-mero-*` attribute under [Reference](https://mero-ui.rubenlangeweg.com/docs/reference).
|
|
60
|
+
|
|
61
|
+
## 0.3.0 · 20 November 2026
|
|
62
|
+
|
|
63
|
+
- **Breaking:** the `rl-` prefix is now `mero-` in classes, `--mero-*` tokens and `data-mero-*` attributes. Workspace controls change from `rlw-` to `mero-ws-`, and `relay:*` events become `mero:*`.
|
|
64
|
+
- **Breaking:** the package files moved from `public/` to `ui/`.
|
|
65
|
+
- Mero runs on htmx 4 as well as htmx 2.
|
|
66
|
+
|
|
67
|
+
To upgrade, replace the prefixes in your templates and stylesheets and update the copy path.
|
|
68
|
+
|
|
69
|
+
## 0.2.0 · 20 November 2026
|
|
70
|
+
|
|
71
|
+
- First release: HTML components and HTMX examples for server-rendered apps.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ruben Langeweg
|
|
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,142 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Mero UI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Mero UI works with Go, Rust and any backend that renders HTML. Copy a component into your server template, serve its CSS and JavaScript, and return HTML fragments for HTMX 4 requests. Your application can run without Node.js or npm.
|
|
4
|
+
|
|
5
|
+
[Website](https://mero-ui.rubenlangeweg.com) · [Component catalog](https://mero-ui.rubenlangeweg.com/components) · [Playground](https://mero-ui.rubenlangeweg.com/playground)
|
|
6
|
+
|
|
7
|
+
## Agent skills
|
|
8
|
+
|
|
9
|
+
Start at the [agent documentation index](https://mero-ui.rubenlangeweg.com/llms.txt) for the hosted catalog. Each component has a Markdown page with its variants, page assets and templates. The index also links to the integration patterns, public API reference and complete catalog. For offline use, open `node_modules/@rubenlangeweg/mero-ui/agent-docs/llms.txt` in releases that include it.
|
|
10
|
+
|
|
11
|
+
From your app's root, install the skill for building pages with Mero UI:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npx skills add rubenlangeweg/mero-ui --skill mero-ui
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Try “Use Mero UI to add a sortable table with row previews to my inventory page.” The skill helps the agent find the matching template and assets, connect your routes and check the result after a swap.
|
|
18
|
+
|
|
19
|
+
When changing the library itself, run `npx skills add . --skill mero-ui-contribute` from the Mero source checkout. Try “Add a variant to the sortable table and verify the copied template on a plain page.”
|
|
20
|
+
|
|
21
|
+
## Use a component
|
|
22
|
+
|
|
23
|
+
[Download the browser assets](https://mero-ui.rubenlangeweg.com/start) into your static directory. Load the stylesheet and scripts in your page head.
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<link rel="stylesheet" href="/mero.css">
|
|
27
|
+
<script defer src="/vendor/htmx.min.js"></script>
|
|
28
|
+
<script defer src="/mero.js"></script>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Try Go or Rust
|
|
32
|
+
|
|
33
|
+
Both [runnable examples](https://github.com/rubenlangeweg/mero-ui/tree/main/examples/backends) serve the same inventory button. From the repository root, choose one backend.
|
|
34
|
+
|
|
35
|
+
| Backend | Run | Guide |
|
|
36
|
+
| --- | --- | --- |
|
|
37
|
+
| Go 1.22+ with `net/http` and `html/template` | `cd examples/backends && go run ./go/main.go` | [Go quick start](https://mero-ui.rubenlangeweg.com/start#go) |
|
|
38
|
+
| Rust stable with Cargo and Axum | `cd examples/backends && cargo run --locked --manifest-path rust/Cargo.toml` | [Rust quick start](https://mero-ui.rubenlangeweg.com/start#rust) |
|
|
39
|
+
|
|
40
|
+
Open <http://127.0.0.1:4180> and choose **Check inventory**. Your handler returns an HTML fragment showing **6 products · 4 active**.
|
|
41
|
+
|
|
42
|
+
### Install with npm
|
|
43
|
+
|
|
44
|
+
Install the UI assets from the [GitHub release](https://github.com/rubenlangeweg/mero-ui/releases) and HTMX from npm:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
npm install https://github.com/rubenlangeweg/mero-ui/releases/download/v0.7.0/rubenlangeweg-mero-ui-0.7.0.tgz htmx.org@4
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
To skip the install, load a file straight from the tag, for example `https://cdn.jsdelivr.net/gh/rubenlangeweg/mero-ui@v0.7.0/ui/mero.css`.
|
|
51
|
+
|
|
52
|
+
Mero targets htmx 4 only. Copy the Mero files you use from `node_modules/@rubenlangeweg/mero-ui/ui/` into your app’s static directory. The first line of each file names its release, for example `/*! @rubenlangeweg/mero-ui 0.7.0 | MIT */`, so a copied file shows which version it is. Serve `htmx.org/dist/htmx.min.js` at the path used in your HTML.
|
|
53
|
+
|
|
54
|
+
The Mero scripts listen to htmx 4 events and read `event.detail.ctx`. Load `mero.js` on every page that uses a Mero script.
|
|
55
|
+
|
|
56
|
+
- **Inheritance.** Wrapper attributes in the copyable markup are written as `hx-target:inherited`, `hx-swap:inherited`, `hx-sync:inherited` and so on, so they work on a plain htmx 4 page. Do not set `implicitInheritance`: with it set, htmx 4 ignores `:inherited` on ancestors. `hx-params` is a Mero attribute: `mero.js` filters the request fields, and the nearest `hx-params` wins.
|
|
57
|
+
- **Server responses.** Send `HX-Trigger: {"mero:form-saved":{"message":"Saved"}}` after a successful save. htmx 4 fires it after the swap settles. Add a `target` selector to the event detail when the swap replaces the submitting form. Read the `HX-Target` request header as `tag#id`. An error response other than the documented 422, 409 or 413 is never swapped into a Mero component, although htmx 4 swaps error responses by default.
|
|
58
|
+
- **The compatibility extension.** Do not load `htmx-2-compat` on a page with Mero scripts. It dispatches the old event names, which the Mero scripts do not read.
|
|
59
|
+
|
|
60
|
+
Serve `ui/mero.css` and `ui/mero.js` from your app. Include htmx 4 for examples with `hx-*` attributes. Each component page lists the optional CSS and JavaScript its family uses. The copyable markup works in any server template. A sortable table sorts on the server through plain `?sort=` header links, so it works without JavaScript. Filter chips work the same way: each chip, the "+ Filter" menu items and "Clear all filters" are links to the URL with that query parameter changed. A `role="menu"` popover gets arrow-key, Home, End, typeahead, Escape and Tab handling from `mero.js` for its `menuitem`, `menuitemradio` and `menuitemcheckbox` items. A menu opens on its checked `menuitemradio`; render `aria-checked` on the server. A `dialog[data-mero-command]` holding a remote combobox opens on Cmd or Ctrl K and runs the chosen server option; use one per page, and not alongside the workspace Command. The local catalog includes htmx 4.0.2 and Geist with their license notices.
|
|
61
|
+
|
|
62
|
+
### Preview a row
|
|
63
|
+
|
|
64
|
+
Add `data-mero-peek` around a table wrapper whose rows have a `.mero-row-link`, and put each row's preview in a `<template data-mero-peek-body>` inside that row. With a row link focused, Space opens an `aside` named "Preview" with the row's heading, the template's content, a Close button and an Open link to the row's `href`. While it is open, Up and Down Arrow, or Tab to another row, show that row instead. Space or Escape closes it and returns focus to the row. Focus is never trapped, and the panel announces updates politely. Give each row a stable `id` so the preview stays on it when a sort, filter or morph swap changes the row links. Below 768 px the preview is a bottom sheet over the cards. Without `mero.js` the templates stay inert and Space keeps its native behaviour.
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<div data-mero-peek>
|
|
68
|
+
<div class="mero-table-wrap mero-table-cards">
|
|
69
|
+
<table class="mero-table">
|
|
70
|
+
<tbody>
|
|
71
|
+
<tr id="product-2">
|
|
72
|
+
<th scope="row"><a class="mero-row-link" href="/products/2">Halo Pendant</a><template data-mero-peek-body><dl><dt>SKU</dt><dd>RL-1002</dd></dl></template></th>
|
|
73
|
+
<td>Lighting</td>
|
|
74
|
+
</tr>
|
|
75
|
+
</tbody>
|
|
76
|
+
</table>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Return focus after Back
|
|
82
|
+
|
|
83
|
+
Add `data-mero-restore-focus` to a list container. When someone opens a link in it and then presses Back, `mero.js` focuses that link again. This works after a full page load and after an HTMX history restore. Links are matched by their `href`, so keep row hrefs unique on the page. Mark one control in the container with `data-mero-focus-fallback`. It gets focus when an HTMX swap removes the focused element.
|
|
84
|
+
|
|
85
|
+
Use the [theme studio](http://127.0.0.1:4173/themes) to try colors, fonts and radii on real components or an app layout. Export the CSS, load it after `mero.css` and set `data-theme="light"` or `data-theme="dark"` on a document or section.
|
|
86
|
+
|
|
87
|
+
Media uses `mero-gallery` assets. Collections use `mero-collections`. Workspace controls use `mero-workspace`. Charts and conversation examples use `mero-insights`. Presentation utilities use `mero-composition`. Each pair comprises a stylesheet and a deferred script. Two optional server helpers render charts and a small Markdown subset. Import them as `@rubenlangeweg/mero-ui/charts` and `@rubenlangeweg/mero-ui/markdown`.
|
|
88
|
+
|
|
89
|
+
## Upgrade from 0.4
|
|
90
|
+
|
|
91
|
+
Release 0.5 drops htmx 2. Load htmx 4, send `HX-Trigger` instead of `HX-Trigger-After-Settle`, and recopy templates that set `hx-*` attributes on a wrapper. The [changelog](CHANGELOG.md) lists every step.
|
|
92
|
+
|
|
93
|
+
## Upgrade from 0.2
|
|
94
|
+
|
|
95
|
+
The [changelog](CHANGELOG.md) lists every release.
|
|
96
|
+
|
|
97
|
+
Release 0.3 renames the `rl-` prefix to `mero-` in classes, `--mero-*` tokens and `data-mero-*` attributes. Workspace controls change from `rlw-` to `mero-ws-`, and `relay:*` events become `mero:*`. The package files moved from `public/` to `ui/`. Replace the prefixes in your templates and stylesheets and update the copy path.
|
|
98
|
+
|
|
99
|
+
## Take an example into another app
|
|
100
|
+
|
|
101
|
+
Download the [complete preview and source](http://127.0.0.1:4173/downloads/mero-ui.tar.gz), extract into an empty directory, then run `npm start`. For the smaller [standalone inventory example](http://127.0.0.1:4173/downloads/studio-inventory.tar.gz), see the [example instructions](examples/studio-inventory/README.md). The local server creates downloads with `tar`. The hosted site serves archives prepared during the build.
|
|
102
|
+
|
|
103
|
+
The [coverage map](docs/component-coverage.md) links the catalog to the original reference families. The [edit comparison](examples/edit-comparison/README.md) uses the same edit flow across three implementations.
|
|
104
|
+
|
|
105
|
+
The inventory form uses `mero-forms.js` for pending state, a replacement form on HTTP 422, and a successful `mero:form-saved` event. `mero-forms.js` also reports the outcome of standalone action buttons marked `data-mero-action`. The `Mero-Action-Outcome` (`succeeded`, `rejected` or `unknown`) and `Mero-Action-Message` response headers override the status-based state and its text. The host supplies validation, persistence and authorization in its own application. A chart table, campus map and chat assistant in the catalog use local sample data. The chat demo gives deterministic replies.
|
|
106
|
+
|
|
107
|
+
## Run the catalog locally
|
|
108
|
+
|
|
109
|
+
Use Node 22 or newer.
|
|
110
|
+
|
|
111
|
+
```sh
|
|
112
|
+
npm start
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Open the [product page](http://127.0.0.1:4173/), [component catalog](http://127.0.0.1:4173/components) or [application layouts](http://127.0.0.1:4173/layouts). The docs cover [design principles](http://127.0.0.1:4173/docs/design-principles) and include a [resizable company directory](http://127.0.0.1:4173/docs/responsive-layouts). In the [playground](http://127.0.0.1:4173/playground), try an inventory edit, a failed form submission or a chart filter and inspect the returned HTML. The sample server listens on loopback and stores demo records in memory.
|
|
116
|
+
|
|
117
|
+
When serving the site on a public domain, set `MERO_SITE_ORIGIN` to its full origin, including `https://`. Mero uses it for canonical links, structured data and [the sitemap](http://127.0.0.1:4173/sitemap.xml). The local preview uses its loopback address.
|
|
118
|
+
|
|
119
|
+
## Verify
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
npm ci
|
|
123
|
+
npx playwright install --with-deps chromium firefox webkit
|
|
124
|
+
MERO_BROWSER=chromium npm test
|
|
125
|
+
MERO_BROWSER=firefox npm test
|
|
126
|
+
MERO_BROWSER=webkit npm test
|
|
127
|
+
npm run pack:ui
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
`npm version` stamps the new version into the first line of every script and stylesheet in `ui/`. After editing the version by hand, run `npm run banner`; a test fails while any file carries another version.
|
|
131
|
+
|
|
132
|
+
Each run uses two test files in parallel to keep browser sessions responsive on local machines. The npm package contains the UI assets. The downloadable preview includes the reference server and example routes. Browser checks and their environment options are documented next to the tests.
|
|
133
|
+
|
|
134
|
+
For a catalog-wide check, run `npm run audit:catalog -- --all`. The command starts an isolated server and emits a JSON result. To use existing installations, set `MERO_PLAYWRIGHT_MODULE`, `MERO_CHROME` and `MERO_AXE_PATH` to their local paths. The [quality review](docs/quality-review.md) records the issues fixed and the checks that still need a person.
|
|
135
|
+
|
|
136
|
+
To inspect spacing and alignment, run `MERO_REVIEW_DIR=visual-review npm run audit:catalog -- --all` and open `visual-review/index.html`. It includes actual-size screenshots of every default and named variant at both review sizes. The audit also checks each example at 320 px with enlarged text in both writing directions. Select a component name to open its live example. Generated captures stay local. [Component spacing and alignment standards](docs/component-standards.md)
|
|
137
|
+
|
|
138
|
+
## Deploy the website
|
|
139
|
+
|
|
140
|
+
Run `npm ci` and `npm run deploy` with Cloudflare credentials for the account that owns `rubenlangeweg.com` and `invrse.studio`. The build includes the downloadable examples and the Worker serves the interactive routes.
|
|
141
|
+
|
|
142
|
+
A Cloudflare Single Redirect on the `invrse.studio` zone sends requests for `mero-ui.invrse.studio` to `mero-ui.rubenlangeweg.com` with HTTP 308, preserving the path and query string.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Accordion
|
|
2
|
+
|
|
3
|
+
Mero UI 0.7.0 · Navigation
|
|
4
|
+
|
|
5
|
+
Disclose one section at a time using grouped native details.
|
|
6
|
+
|
|
7
|
+
[Integration patterns and API reference](../llms-patterns.txt)
|
|
8
|
+
|
|
9
|
+
## Default
|
|
10
|
+
|
|
11
|
+
Page assets
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<link rel="stylesheet" href="/mero.css">
|
|
15
|
+
<script defer src="/mero.js"></script>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Template
|
|
19
|
+
|
|
20
|
+
````html
|
|
21
|
+
<div class="mero-stack" data-mero-accordion>
|
|
22
|
+
<details class="mero-disclosure" open>
|
|
23
|
+
<summary>Can I use Mero with Django?</summary>
|
|
24
|
+
<div class="mero-disclosure-body">Yes. Serve the stylesheet and runtime and render the examples in your templates.</div>
|
|
25
|
+
</details>
|
|
26
|
+
<details class="mero-disclosure">
|
|
27
|
+
<summary>Can it run without a build step?</summary>
|
|
28
|
+
<div class="mero-disclosure-body">Yes. Load the static files directly or bundle them as part of your application.</div>
|
|
29
|
+
</details>
|
|
30
|
+
</div>
|
|
31
|
+
````
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Action Bar
|
|
2
|
+
|
|
3
|
+
Mero UI 0.7.0 · Studio collections
|
|
4
|
+
|
|
5
|
+
Select records and apply one status change to the selection.
|
|
6
|
+
|
|
7
|
+
[Integration patterns and API reference](../llms-patterns.txt)
|
|
8
|
+
|
|
9
|
+
## Default
|
|
10
|
+
|
|
11
|
+
The action bar appears for a nonempty selection. Bulk actions include the selected row IDs and the current query.
|
|
12
|
+
|
|
13
|
+
Page assets
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<link rel="stylesheet" href="/mero.css">
|
|
17
|
+
<link rel="stylesheet" href="/mero-collections.css">
|
|
18
|
+
<script defer src="/vendor/htmx.min.js"></script>
|
|
19
|
+
<script defer src="/mero.js"></script>
|
|
20
|
+
<script defer src="/mero-collections.js"></script>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Template
|
|
24
|
+
|
|
25
|
+
````html
|
|
26
|
+
<div class="mero-grid-mount" hx-get="/demo/collections/grid?row=1&row=2" hx-trigger="load" hx-swap="innerHTML"><section class="mero-collection" data-mero-grid data-mero-scope data-inventory-revision="0" hx-target:inherited="closest [data-mero-grid]" hx-swap:inherited="outerHTML" hx-sync:inherited="closest [data-mero-grid]:drop" hx-include:inherited="closest [data-mero-grid]" hx-params="q,filter,sort,row,returnFocus">
|
|
27
|
+
<input type="hidden" name="revision" value="0">
|
|
28
|
+
<div class="mero-collection-head"><div><h2>Studio inventory</h2><p>Product catalog</p></div><button type="button" class="mero-button mero-button-primary mero-button-sm" data-grid-add hx-get="/demo/collections/grid/new">Add product</button></div>
|
|
29
|
+
<form class="mero-collection-filters" role="search" hx-get="/demo/collections/grid" hx-vals='{"returnFocus":"search"}'>
|
|
30
|
+
<input class="mero-input" type="search" name="q" value="" maxlength="120" placeholder="Search products…" aria-label="Search products">
|
|
31
|
+
<input type="hidden" name="filter" value=""><input type="hidden" name="sort" value="name">
|
|
32
|
+
<button type="submit" class="mero-button mero-button-outline mero-button-sm">Apply</button>
|
|
33
|
+
</form>
|
|
34
|
+
<div class="mero-filter-bar"><button class="mero-button mero-button-outline mero-button-sm" type="button" popovertarget="grid-filter-menu" aria-haspopup="menu" aria-expanded="false" aria-label="Add filter" data-grid-filter><span aria-hidden="true">+</span> Filter</button><div class="mero-popover mero-menu" id="grid-filter-menu" popover role="menu" aria-label="Add filter"><a href="?filter=Active&sort=name" hx-get="/demo/collections/grid?filter=Active&sort=name&returnFocus=filter" hx-params="none" class="mero-menu-item" role="menuitem">Status is Active</a><a href="?filter=Draft&sort=name" hx-get="/demo/collections/grid?filter=Draft&sort=name&returnFocus=filter" hx-params="none" class="mero-menu-item" role="menuitem">Status is Draft</a><a href="?filter=Archived&sort=name" hx-get="/demo/collections/grid?filter=Archived&sort=name&returnFocus=filter" hx-params="none" class="mero-menu-item" role="menuitem">Status is Archived</a></div></div>
|
|
35
|
+
<p class="mero-collection-message" role="status" data-grid-message></p>
|
|
36
|
+
<p class="mero-collection-error" role="alert" data-grid-error hidden></p>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<form class="mero-collection-body" hx-post="/demo/collections/grid/bulk" hx-params="revision,q,filter,sort,row,next">
|
|
40
|
+
<div class="mero-collection-scroll"><table class="mero-table mero-collection-table"><caption class="mero-collection-sr">Studio products</caption><thead><tr><th scope="col"><label class="mero-collection-pick"><input type="checkbox" class="mero-checkbox" data-grid-all aria-label="Select all visible products"></label></th><th scope="col" aria-sort="ascending"><a href="?sort=name-desc" hx-get="/demo/collections/grid?sort=name-desc&returnFocus=sort-name" hx-params="none" data-grid-sort="name">Product <span aria-hidden="true">↑</span></a></th><th scope="col"><a href="?sort=status" hx-get="/demo/collections/grid?sort=status&returnFocus=sort-status" hx-params="none" data-grid-sort="status">Status</a></th><th scope="col"><span class="mero-collection-sr">Actions</span></th></tr></thead>
|
|
41
|
+
<tbody><tr><td><label class="mero-collection-pick"><input class="mero-checkbox" type="checkbox" name="row" value="1" aria-label="Select Arc Lounge Chair" checked></label></td><th scope="row"><strong>Arc Lounge Chair</strong><small>RL-1042 · Furniture</small><span class="mero-small-status"><span class="mero-collection-status" data-status="Active">Active</span></span></th><td><span class="mero-collection-status" data-status="Active">Active</span></td><td><button type="button" class="mero-button mero-button-ghost mero-button-sm" popovertarget="grid-row-1-menu" aria-haspopup="menu" aria-expanded="false" aria-label="Actions for Arc Lounge Chair" data-grid-actions="1">Actions</button><div class="mero-popover mero-menu" id="grid-row-1-menu" popover role="menu" aria-label="Arc Lounge Chair actions"><button type="button" class="mero-menu-item" role="menuitem" hx-params="q,filter,sort,row,returnFocus" hx-get="/demo/collections/grid/1/edit">Edit</button><button type="button" class="mero-menu-item" role="menuitem" hx-params="q,filter,sort,row,returnFocus" hx-get="/demo/collections/grid/1/confirm">Delete</button></div></td></tr><tr><td><label class="mero-collection-pick"><input class="mero-checkbox" type="checkbox" name="row" value="6" aria-label="Select Arc Task Lamp"></label></td><th scope="row"><strong>Arc Task Lamp</strong><small>SL-204 · Lighting</small><span class="mero-small-status"><span class="mero-collection-status" data-status="Active">Active</span></span></th><td><span class="mero-collection-status" data-status="Active">Active</span></td><td><button type="button" class="mero-button mero-button-ghost mero-button-sm" popovertarget="grid-row-6-menu" aria-haspopup="menu" aria-expanded="false" aria-label="Actions for Arc Task Lamp" data-grid-actions="6">Actions</button><div class="mero-popover mero-menu" id="grid-row-6-menu" popover role="menu" aria-label="Arc Task Lamp actions"><button type="button" class="mero-menu-item" role="menuitem" hx-params="q,filter,sort,row,returnFocus" hx-get="/demo/collections/grid/6/edit">Edit</button><button type="button" class="mero-menu-item" role="menuitem" hx-params="q,filter,sort,row,returnFocus" hx-get="/demo/collections/grid/6/confirm">Delete</button></div></td></tr><tr><td><label class="mero-collection-pick"><input class="mero-checkbox" type="checkbox" name="row" value="5" aria-label="Select Dune Throw"></label></td><th scope="row"><strong>Dune Throw</strong><small>RL-1151 · Textiles</small><span class="mero-small-status"><span class="mero-collection-status" data-status="Archived">Archived</span></span></th><td><span class="mero-collection-status" data-status="Archived">Archived</span></td><td><button type="button" class="mero-button mero-button-ghost mero-button-sm" popovertarget="grid-row-5-menu" aria-haspopup="menu" aria-expanded="false" aria-label="Actions for Dune Throw" data-grid-actions="5">Actions</button><div class="mero-popover mero-menu" id="grid-row-5-menu" popover role="menu" aria-label="Dune Throw actions"><button type="button" class="mero-menu-item" role="menuitem" hx-params="q,filter,sort,row,returnFocus" hx-get="/demo/collections/grid/5/edit">Edit</button><button type="button" class="mero-menu-item" role="menuitem" hx-params="q,filter,sort,row,returnFocus" hx-get="/demo/collections/grid/5/confirm">Delete</button></div></td></tr><tr><td><label class="mero-collection-pick"><input class="mero-checkbox" type="checkbox" name="row" value="3" aria-label="Select Fold Side Table"></label></td><th scope="row"><strong>Fold Side Table</strong><small>RL-1116 · Furniture</small><span class="mero-small-status"><span class="mero-collection-status" data-status="Active">Active</span></span></th><td><span class="mero-collection-status" data-status="Active">Active</span></td><td><button type="button" class="mero-button mero-button-ghost mero-button-sm" popovertarget="grid-row-3-menu" aria-haspopup="menu" aria-expanded="false" aria-label="Actions for Fold Side Table" data-grid-actions="3">Actions</button><div class="mero-popover mero-menu" id="grid-row-3-menu" popover role="menu" aria-label="Fold Side Table actions"><button type="button" class="mero-menu-item" role="menuitem" hx-params="q,filter,sort,row,returnFocus" hx-get="/demo/collections/grid/3/edit">Edit</button><button type="button" class="mero-menu-item" role="menuitem" hx-params="q,filter,sort,row,returnFocus" hx-get="/demo/collections/grid/3/confirm">Delete</button></div></td></tr><tr><td><label class="mero-collection-pick"><input class="mero-checkbox" type="checkbox" name="row" value="4" aria-label="Select Forma Vase"></label></td><th scope="row"><strong>Forma Vase</strong><small>RL-1140 · Objects</small><span class="mero-small-status"><span class="mero-collection-status" data-status="Active">Active</span></span></th><td><span class="mero-collection-status" data-status="Active">Active</span></td><td><button type="button" class="mero-button mero-button-ghost mero-button-sm" popovertarget="grid-row-4-menu" aria-haspopup="menu" aria-expanded="false" aria-label="Actions for Forma Vase" data-grid-actions="4">Actions</button><div class="mero-popover mero-menu" id="grid-row-4-menu" popover role="menu" aria-label="Forma Vase actions"><button type="button" class="mero-menu-item" role="menuitem" hx-params="q,filter,sort,row,returnFocus" hx-get="/demo/collections/grid/4/edit">Edit</button><button type="button" class="mero-menu-item" role="menuitem" hx-params="q,filter,sort,row,returnFocus" hx-get="/demo/collections/grid/4/confirm">Delete</button></div></td></tr><tr><td><label class="mero-collection-pick"><input class="mero-checkbox" type="checkbox" name="row" value="2" aria-label="Select Halo Pendant" checked></label></td><th scope="row"><strong>Halo Pendant</strong><small>RL-1078 · Lighting</small><span class="mero-small-status"><span class="mero-collection-status" data-status="Draft">Draft</span></span></th><td><span class="mero-collection-status" data-status="Draft">Draft</span></td><td><button type="button" class="mero-button mero-button-ghost mero-button-sm" popovertarget="grid-row-2-menu" aria-haspopup="menu" aria-expanded="false" aria-label="Actions for Halo Pendant" data-grid-actions="2">Actions</button><div class="mero-popover mero-menu" id="grid-row-2-menu" popover role="menu" aria-label="Halo Pendant actions"><button type="button" class="mero-menu-item" role="menuitem" hx-params="q,filter,sort,row,returnFocus" hx-get="/demo/collections/grid/2/edit">Edit</button><button type="button" class="mero-menu-item" role="menuitem" hx-params="q,filter,sort,row,returnFocus" hx-get="/demo/collections/grid/2/confirm">Delete</button></div></td></tr></tbody></table></div>
|
|
42
|
+
<div class="mero-action-bar" data-grid-bar hidden><output data-grid-count></output><select class="mero-select" name="next" aria-label="Set selected products to"><option value="Active">Active</option><option value="Draft">Draft</option><option value="Archived" selected>Archived</option></select><button class="mero-button mero-button-primary mero-button-sm" type="submit">Update selected</button><button class="mero-button mero-button-ghost mero-button-sm" data-grid-clear type="button">Clear</button></div>
|
|
43
|
+
</form><footer class="mero-collection-foot">6 of 6 products</footer>
|
|
44
|
+
</section></div>
|
|
45
|
+
````
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Action Button
|
|
2
|
+
|
|
3
|
+
Mero UI 0.7.0 · Buttons
|
|
4
|
+
|
|
5
|
+
Run a server action and report whether it succeeded, was refused or has an unknown result.
|
|
6
|
+
|
|
7
|
+
[Integration patterns and API reference](../llms-patterns.txt)
|
|
8
|
+
|
|
9
|
+
## Default
|
|
10
|
+
|
|
11
|
+
The button shows pending while the request runs and ignores further clicks. A 2xx response means succeeded. A 4xx response other than 408 means rejected: the server refused and nothing changed. A 5xx, 408, timeout or network error means unknown: the action may have happened, so check the current state before you retry. The Mero-Action-Outcome header overrides the state and Mero-Action-Message overrides the text. Each step dispatches a bubbling mero:action event, and data-mero-action-state exposes the state for styling.
|
|
12
|
+
|
|
13
|
+
Page assets
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<link rel="stylesheet" href="/mero.css">
|
|
17
|
+
<script defer src="/vendor/htmx.min.js"></script>
|
|
18
|
+
<script defer src="/mero.js"></script>
|
|
19
|
+
<script defer src="/mero-forms.js"></script>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Template
|
|
23
|
+
|
|
24
|
+
````html
|
|
25
|
+
<div class="mero-stack">
|
|
26
|
+
<span class="mero-row">
|
|
27
|
+
<button class="mero-button mero-button-secondary" type="button" hx-post="/demo/catalog/action-button?outcome=succeeded" hx-swap="none" data-mero-action>
|
|
28
|
+
<span class="mero-button-label">Retry export</span><span class="mero-indicator mero-spinner" aria-hidden="true"></span></button>
|
|
29
|
+
<span class="mero-action-status" data-mero-action-status role="status"></span>
|
|
30
|
+
</span>
|
|
31
|
+
<span class="mero-row">
|
|
32
|
+
<button class="mero-button mero-button-danger" type="button" hx-post="/demo/catalog/action-button?outcome=rejected" hx-swap="none" data-mero-action>
|
|
33
|
+
<span class="mero-button-label">Revoke key</span><span class="mero-indicator mero-spinner" aria-hidden="true"></span></button>
|
|
34
|
+
<span class="mero-action-status" data-mero-action-status role="status"></span>
|
|
35
|
+
</span>
|
|
36
|
+
<span class="mero-row">
|
|
37
|
+
<button class="mero-button mero-button-outline" type="button" hx-post="/demo/catalog/action-button?outcome=unknown" hx-swap="none" data-mero-action>
|
|
38
|
+
<span class="mero-button-label">Halt run</span><span class="mero-indicator mero-spinner" aria-hidden="true"></span></button>
|
|
39
|
+
<span class="mero-action-status" data-mero-action-status role="status"></span>
|
|
40
|
+
</span>
|
|
41
|
+
</div>
|
|
42
|
+
````
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Agenda
|
|
2
|
+
|
|
3
|
+
Mero UI 0.7.0 · Studio collections
|
|
4
|
+
|
|
5
|
+
Browse daily bookings and add a timed event.
|
|
6
|
+
|
|
7
|
+
[Integration patterns and API reference](../llms-patterns.txt)
|
|
8
|
+
|
|
9
|
+
## Default
|
|
10
|
+
|
|
11
|
+
Return a dated agenda fragment on navigation and after saving a booking. Demo bookings live in memory.
|
|
12
|
+
|
|
13
|
+
Page assets
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<link rel="stylesheet" href="/mero.css">
|
|
17
|
+
<link rel="stylesheet" href="/mero-collections.css">
|
|
18
|
+
<script defer src="/vendor/htmx.min.js"></script>
|
|
19
|
+
<script defer src="/mero.js"></script>
|
|
20
|
+
<script defer src="/mero-collections.js"></script>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Template
|
|
24
|
+
|
|
25
|
+
````html
|
|
26
|
+
<div class="mero-agenda-mount" hx-get="/demo/collections/agenda" hx-trigger="load" hx-swap="innerHTML"><section class="mero-agenda" data-mero-agenda hx-target:inherited="closest [data-mero-agenda]" hx-swap:inherited="outerHTML" hx-sync:inherited="closest [data-mero-agenda]:drop">
|
|
27
|
+
<header class="mero-collection-head"><div><h2>Studio agenda</h2><p><time datetime="2026-11-20">Friday, Nov 20</time></p></div><div class="mero-collection-actions"><button type="button" class="mero-button mero-button-outline mero-button-sm" data-agenda-action="previous" aria-label="Previous day" hx-get="/demo/collections/agenda?date=2026-11-19&returnFocus=previous"><span aria-hidden="true"></span></button><button type="button" class="mero-button mero-button-outline mero-button-sm" data-agenda-action="next" aria-label="Next day" hx-get="/demo/collections/agenda?date=2026-11-21&returnFocus=next"><span aria-hidden="true"></span></button></div></header>
|
|
28
|
+
<ol class="mero-agenda-list"><li><time datetime="2026-11-20T09:30">09:30</time><div><strong>Material review</strong><small>Atelier 01</small></div></li><li><time datetime="2026-11-20T13:00">13:00</time><div><strong>Lighting test</strong><small>Photo studio</small></div></li></ol>
|
|
29
|
+
<p role="status" class="mero-collection-message"></p>
|
|
30
|
+
<details class="mero-collection-details"><summary data-agenda-action="booking">Add booking</summary>
|
|
31
|
+
<form class="mero-collection-fields" hx-post="/demo/collections/agenda"><input type="hidden" name="date" value="2026-11-20">
|
|
32
|
+
<label class="mero-collection-field"><span>Booking title</span><input class="mero-input" name="title" value="" required maxlength="80"></label>
|
|
33
|
+
<label class="mero-collection-field"><span>Location</span><input class="mero-input" name="location" value="" required maxlength="80"></label>
|
|
34
|
+
<label class="mero-collection-field"><span>Start time</span><input class="mero-input" name="time" value="10:00" required type="time"></label>
|
|
35
|
+
<button class="mero-button mero-button-primary mero-button-sm" type="submit">Add booking</button>
|
|
36
|
+
</form></details><p class="mero-collection-error" role="alert" data-agenda-error hidden></p>
|
|
37
|
+
</section></div>
|
|
38
|
+
````
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Alert Dialog
|
|
2
|
+
|
|
3
|
+
Mero UI 0.7.0 · Overlays
|
|
4
|
+
|
|
5
|
+
Ask for confirmation on a decision that calls for attention.
|
|
6
|
+
|
|
7
|
+
[Integration patterns and API reference](../llms-patterns.txt)
|
|
8
|
+
|
|
9
|
+
## Default
|
|
10
|
+
|
|
11
|
+
Focus starts on Cancel. Connect the confirmation to a form action in your application.
|
|
12
|
+
|
|
13
|
+
Page assets
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<link rel="stylesheet" href="/mero.css">
|
|
17
|
+
<script defer src="/mero.js"></script>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Template
|
|
21
|
+
|
|
22
|
+
````html
|
|
23
|
+
<div class="mero-scope" data-mero-scope>
|
|
24
|
+
<button class="mero-button mero-button-danger" type="button" data-mero-open="demo-alert-dialog">Archive project</button>
|
|
25
|
+
<dialog class="mero-dialog" id="demo-alert-dialog" role="alertdialog" aria-labelledby="demo-alert-dialog-title" aria-describedby="demo-alert-dialog-description">
|
|
26
|
+
<div class="mero-dialog-body">
|
|
27
|
+
<h2 class="mero-dialog-title" id="demo-alert-dialog-title">Archive project?</h2>
|
|
28
|
+
<p class="mero-description" id="demo-alert-dialog-description">This removes the project from active views.</p>
|
|
29
|
+
<div class="mero-dialog-footer">
|
|
30
|
+
<button class="mero-button mero-button-secondary" type="button" data-mero-close autofocus>Cancel</button>
|
|
31
|
+
<button class="mero-button mero-button-danger" type="button" data-mero-close>Archive</button>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</dialog>
|
|
35
|
+
</div>
|
|
36
|
+
````
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Alert
|
|
2
|
+
|
|
3
|
+
Mero UI 0.7.0 · Feedback
|
|
4
|
+
|
|
5
|
+
Place status or guidance alongside the content it describes.
|
|
6
|
+
|
|
7
|
+
[Integration patterns and API reference](../llms-patterns.txt)
|
|
8
|
+
|
|
9
|
+
## Default
|
|
10
|
+
|
|
11
|
+
Page assets
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<link rel="stylesheet" href="/mero.css">
|
|
15
|
+
<script defer src="/mero.js"></script>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Template
|
|
19
|
+
|
|
20
|
+
````html
|
|
21
|
+
<div class="mero-alert mero-alert-warning">
|
|
22
|
+
<strong>Preview expires soon</strong>
|
|
23
|
+
<p>Publish the draft before Friday to retain this URL.</p>
|
|
24
|
+
</div>
|
|
25
|
+
````
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# App Layout
|
|
2
|
+
|
|
3
|
+
Mero UI 0.7.0 · Workspace navigation
|
|
4
|
+
|
|
5
|
+
A responsive workspace with a sidebar, content area and mobile navigation drawer.
|
|
6
|
+
|
|
7
|
+
[Integration patterns and API reference](../llms-patterns.txt)
|
|
8
|
+
|
|
9
|
+
## Default
|
|
10
|
+
|
|
11
|
+
Page assets
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<link rel="stylesheet" href="/mero.css">
|
|
15
|
+
<link rel="stylesheet" href="/mero-workspace.css">
|
|
16
|
+
<script defer src="/mero.js"></script>
|
|
17
|
+
<script defer src="/mero-workspace.js"></script>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Template
|
|
21
|
+
|
|
22
|
+
````html
|
|
23
|
+
<section class="mero-ws-shell" data-mero-ws-shell aria-label="Studio workspace">
|
|
24
|
+
<aside class="mero-ws-side"><strong>Studio North</strong><nav aria-label="Workspace sidebar"><a href="/layouts/dashboard">Overview</a><a href="/layouts/dashboard?view=inventory">Inventory</a><a href="/layouts/dashboard?view=settings">Settings</a></nav></aside>
|
|
25
|
+
<div class="mero-ws-shell-main">
|
|
26
|
+
<button class="mero-button mero-button-sm mero-button-secondary mero-ws-mobile-nav" type="button" data-mero-ws-open>Open navigation</button>
|
|
27
|
+
<header><small>Studio North</small><h2>Release room</h2></header>
|
|
28
|
+
<div class="mero-ws-summary"><span class="mero-ws-dot"></span><div><strong>Spring collection</strong><small>Photography approved</small></div></div>
|
|
29
|
+
<a class="mero-link" href="/layouts/dashboard?view=inventory">Open inventory →</a>
|
|
30
|
+
</div>
|
|
31
|
+
<dialog class="mero-dialog mero-ws-drawer" aria-label="Workspace navigation"><div class="mero-dialog-body">
|
|
32
|
+
<button class="mero-button mero-button-sm mero-button-secondary" type="button" data-mero-close autofocus>Close navigation</button>
|
|
33
|
+
<nav aria-label="Mobile workspace"><a href="/layouts/dashboard">Overview</a><a href="/layouts/dashboard?view=inventory">Inventory</a><a href="/layouts/dashboard?view=settings">Settings</a></nav>
|
|
34
|
+
</div></dialog>
|
|
35
|
+
</section>
|
|
36
|
+
````
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Area Chart
|
|
2
|
+
|
|
3
|
+
Mero UI 0.7.0 · Charts
|
|
4
|
+
|
|
5
|
+
Show the volume and shape of a series over time.
|
|
6
|
+
|
|
7
|
+
[Integration patterns and API reference](../llms-patterns.txt)
|
|
8
|
+
|
|
9
|
+
Optional server helper: `ui/insight-charts.mjs`.
|
|
10
|
+
|
|
11
|
+
## Default
|
|
12
|
+
|
|
13
|
+
The SVG and data table share one dataset. Tab into the chart once. Arrow left and right inspect categories. Arrow up and down change series. The next Tab reaches the data table. The optional insight-charts.mjs helper renders this HTML on your server.
|
|
14
|
+
|
|
15
|
+
Page assets
|
|
16
|
+
|
|
17
|
+
```html
|
|
18
|
+
<link rel="stylesheet" href="/mero.css">
|
|
19
|
+
<link rel="stylesheet" href="/mero-insights.css">
|
|
20
|
+
<script defer src="/mero.js"></script>
|
|
21
|
+
<script defer src="/mero-insights.js"></script>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Template
|
|
25
|
+
|
|
26
|
+
````html
|
|
27
|
+
<figure class="mero-plot" data-mero-chart="area">
|
|
28
|
+
<figcaption><strong>Daily dispatches</strong><span>Studio dispatch · sample week</span></figcaption>
|
|
29
|
+
<ul class="mero-plot-legend" aria-label="Series"><li><i class="mero-plot-tone-0" aria-hidden="true"></i>Shipped</li></ul>
|
|
30
|
+
<svg viewBox="0 0 495 188" role="group" aria-label="Daily dispatches"><desc>Use the arrow keys to explore values. Open the data table for all values.</desc><line class="mero-plot-grid" x1="42" x2="480" y1="155" y2="155"/><text class="mero-plot-axis" x="35" y="159" text-anchor="end">0</text><line class="mero-plot-grid" x1="42" x2="480" y1="85.5" y2="85.5"/><text class="mero-plot-axis" x="35" y="89.5" text-anchor="end">28</text><line class="mero-plot-grid" x1="42" x2="480" y1="16" y2="16"/><text class="mero-plot-axis" x="35" y="20" text-anchor="end">56</text><text class="mero-plot-axis" x="73.29" y="179" text-anchor="middle">Mon</text><text class="mero-plot-axis" x="135.86" y="179" text-anchor="middle">Tue</text><text class="mero-plot-axis" x="198.43" y="179" text-anchor="middle">Wed</text><text class="mero-plot-axis" x="261" y="179" text-anchor="middle">Thu</text><text class="mero-plot-axis" x="323.57" y="179" text-anchor="middle">Fri</text><text class="mero-plot-axis" x="386.14" y="179" text-anchor="middle">Sat</text><text class="mero-plot-axis" x="448.71" y="179" text-anchor="middle">Sun</text><path class="mero-plot-area mero-plot-tone-0" d="M73.29,75.57 L135.86,58.2 L198.43,73.09 L261,40.82 L323.57,16 L386.14,60.68 L448.71,55.71 L448.71,155 L73.29,155 Z"/><polyline class="mero-plot-line mero-plot-tone-0" points="73.29,75.57 135.86,58.2 198.43,73.09 261,40.82 323.57,16 386.14,60.68 448.71,55.71"/><g class="mero-plot-point mero-plot-tone-0" tabindex="0" role="img" aria-label="Mon · Shipped: 32" data-mero-series="0" data-mero-plot-value="Mon · Shipped: 32"><circle cx="73.29" cy="75.57" r="9" fill="transparent"/><circle class="mero-plot-dot" cx="73.29" cy="75.57" r="3.8"/></g><g class="mero-plot-point mero-plot-tone-0" tabindex="-1" role="img" aria-label="Tue · Shipped: 39" data-mero-series="0" data-mero-plot-value="Tue · Shipped: 39"><circle cx="135.86" cy="58.2" r="9" fill="transparent"/><circle class="mero-plot-dot" cx="135.86" cy="58.2" r="3.8"/></g><g class="mero-plot-point mero-plot-tone-0" tabindex="-1" role="img" aria-label="Wed · Shipped: 33" data-mero-series="0" data-mero-plot-value="Wed · Shipped: 33"><circle cx="198.43" cy="73.09" r="9" fill="transparent"/><circle class="mero-plot-dot" cx="198.43" cy="73.09" r="3.8"/></g><g class="mero-plot-point mero-plot-tone-0" tabindex="-1" role="img" aria-label="Thu · Shipped: 46" data-mero-series="0" data-mero-plot-value="Thu · Shipped: 46"><circle cx="261" cy="40.82" r="9" fill="transparent"/><circle class="mero-plot-dot" cx="261" cy="40.82" r="3.8"/></g><g class="mero-plot-point mero-plot-tone-0" tabindex="-1" role="img" aria-label="Fri · Shipped: 56" data-mero-series="0" data-mero-plot-value="Fri · Shipped: 56"><circle cx="323.57" cy="16" r="9" fill="transparent"/><circle class="mero-plot-dot" cx="323.57" cy="16" r="3.8"/></g><g class="mero-plot-point mero-plot-tone-0" tabindex="-1" role="img" aria-label="Sat · Shipped: 38" data-mero-series="0" data-mero-plot-value="Sat · Shipped: 38"><circle cx="386.14" cy="60.68" r="9" fill="transparent"/><circle class="mero-plot-dot" cx="386.14" cy="60.68" r="3.8"/></g><g class="mero-plot-point mero-plot-tone-0" tabindex="-1" role="img" aria-label="Sun · Shipped: 40" data-mero-series="0" data-mero-plot-value="Sun · Shipped: 40"><circle cx="448.71" cy="55.71" r="9" fill="transparent"/><circle class="mero-plot-dot" cx="448.71" cy="55.71" r="3.8"/></g></svg>
|
|
31
|
+
<span class="mero-plot-tooltip" data-mero-plot-tooltip aria-hidden="true" hidden></span>
|
|
32
|
+
<div class="mero-plot-readout" data-mero-plot-readout>Inspect a point or use the arrow keys</div>
|
|
33
|
+
<details class="mero-plot-data"><summary>View chart data</summary><div><table class="mero-table"><caption>Daily dispatches</caption><thead><tr><th scope="col">Category</th><th scope="col">Shipped</th></tr></thead>
|
|
34
|
+
<tbody><tr><th scope="row">Mon</th><td>32</td></tr><tr><th scope="row">Tue</th><td>39</td></tr><tr><th scope="row">Wed</th><td>33</td></tr><tr><th scope="row">Thu</th><td>46</td></tr><tr><th scope="row">Fri</th><td>56</td></tr><tr><th scope="row">Sat</th><td>38</td></tr><tr><th scope="row">Sun</th><td>40</td></tr></tbody></table></div></details>
|
|
35
|
+
</figure>
|
|
36
|
+
````
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Aura
|
|
2
|
+
|
|
3
|
+
Mero UI 0.7.0 · Display utilities
|
|
4
|
+
|
|
5
|
+
Frame an interactive surface with a subtle moving highlight.
|
|
6
|
+
|
|
7
|
+
[Integration patterns and API reference](../llms-patterns.txt)
|
|
8
|
+
|
|
9
|
+
## Default
|
|
10
|
+
|
|
11
|
+
Page assets
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<link rel="stylesheet" href="/mero.css">
|
|
15
|
+
<link rel="stylesheet" href="/mero-composition.css">
|
|
16
|
+
<script defer src="/mero.js"></script>
|
|
17
|
+
<script defer src="/mero-composition.js"></script>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Template
|
|
21
|
+
|
|
22
|
+
````html
|
|
23
|
+
<a class="mero-aura" href="/components/carousel"><span>Studio lighting</span><strong>Explore the collection ↗</strong></a>
|
|
24
|
+
````
|