@morya-ui/setup 0.3.1 → 0.3.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 +16 -10
- package/catalog/skills.json +18 -0
- package/package.json +1 -1
- package/src/cli.mjs +17 -2
- package/src/skills.mjs +73 -4
- package/template/.agents/skills/morya-ui-pages/SKILL.md +8 -6
- package/template/.agents/skills/morya-ui-pages/evals/evals.json +24 -6
- package/template/.agents/skills/morya-ui-pages/references/component-index.md +51 -50
- package/template/.agents/skills/morya-ui-pages/references/decision-recipes.md +1559 -0
- package/template/.agents/skills/morya-ui-pages/references/design-system.md +2 -2
- package/template/.agents/skills/morya-ui-pages/references/feedback.md +2 -0
- package/template/.agents/skills/morya-ui-pages/references/optional-companions.md +7 -7
- package/template/.agents/skills/morya-ui-pages/references/page-layouts.md +9 -7
- package/template/.agents/skills/morya-ui-pages/references/review-checklist.md +1 -1
- package/template/.agents/skills/morya-ui-pages/references/visual-craft.md +7 -9
- package/template/.cursor/rules/component-usage.mdc +1 -1
- package/template/.cursor/rules/design-system.mdc +1 -1
- package/template/.cursor/rules/page-layout.mdc +8 -6
- package/template/DESIGN.md +1 -1
- package/template/.agents/skills/fixing-accessibility/SKILL.md +0 -138
- package/template/.agents/skills/frontend-design/LICENSE.txt +0 -177
- package/template/.agents/skills/frontend-design/SKILL.md +0 -57
|
@@ -43,9 +43,9 @@ import 'morya-ui/styles.css'
|
|
|
43
43
|
| Admin chrome | `MLayout fillViewport` + sider / header / content |
|
|
44
44
|
| Sider nav | `MMenu` |
|
|
45
45
|
| Page stack | `MPageContent` inside `MLayoutContent` |
|
|
46
|
-
|
|
|
46
|
+
| List chrome | `MPageHeader` + `MPageFilters` (+ optional batch `MPageToolbar`) |
|
|
47
47
|
| Form surfaces | `MPageHeader` + `MPageSection variant="form|actions"` |
|
|
48
|
-
| Dashboard KPI | `MPageStat` + `
|
|
48
|
+
| Dashboard KPI / chart pending | `MPageStat` + `MCard shadow="always"` + `MEmpty` |
|
|
49
49
|
| Module cards | `MCard` / `MPanel` / `MFieldset` |
|
|
50
50
|
| Grid / spacing | `MGrid` + `MGridItem`, or `MFlex` / `MSpace` |
|
|
51
51
|
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
**Default rule:** operation feedback uses the `message` API. Use `toast` only when you need a title plus detail, or an async / background notification feel.
|
|
4
4
|
|
|
5
|
+
Authoritative selection + key API notes also live in MCP / skill decision **`feedback-choice`** ([decision-recipes.md](./decision-recipes.md)). Keep this file and that decision aligned.
|
|
6
|
+
|
|
5
7
|
## Three different things
|
|
6
8
|
|
|
7
9
|
| Name | Shape | API | Typical use |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Optional companions
|
|
2
2
|
|
|
3
|
-
This skill is **standalone**. Distilled craft lives in [visual-craft.md](visual-craft.md). Companions are optional soft upgrades installed by `@morya-ui/setup`
|
|
3
|
+
This skill is **standalone**. Distilled craft lives in [visual-craft.md](visual-craft.md). Companions are optional soft upgrades installed by `@morya-ui/setup` via the [skills CLI](https://skills.sh/) (always the latest published version).
|
|
4
4
|
|
|
5
5
|
## Conflict rule
|
|
6
6
|
|
|
@@ -13,15 +13,15 @@ This skill is **standalone**. Distilled craft lives in [visual-craft.md](visual-
|
|
|
13
13
|
npx @morya-ui/setup ai
|
|
14
14
|
|
|
15
15
|
# Non-interactive
|
|
16
|
-
npx @morya-ui/setup ai --skills=morya-ui-pages,frontend-design,fixing-accessibility
|
|
16
|
+
npx @morya-ui/setup ai --skills=morya-ui-pages,frontend-design,fixing-accessibility,impeccable
|
|
17
17
|
npx @morya-ui/setup ai --skills=all
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
| Companion | Safe use | Unsafe use |
|
|
21
|
-
| --- | --- | --- |
|
|
22
|
-
| `frontend-design` | Express / brand panel taste after surface + contract are fixed | Replacing Ops golden shell or introducing a second UI kit |
|
|
23
|
-
| `fixing-accessibility` | Names, keyboard, focus, form errors on top of `M*` | Replacing library dialogs/menus with custom ARIA widgets |
|
|
24
|
-
| `impeccable`
|
|
20
|
+
| Companion | Source | Safe use | Unsafe use |
|
|
21
|
+
| --- | --- | --- | --- |
|
|
22
|
+
| `frontend-design` | `anthropics/skills` | Express / brand panel taste after surface + contract are fixed | Replacing Ops golden shell or introducing a second UI kit |
|
|
23
|
+
| `fixing-accessibility` | `ibelick/ui-skills` | Names, keyboard, focus, form errors on top of `M*` | Replacing library dialogs/menus with custom ARIA widgets |
|
|
24
|
+
| `impeccable` | `pbakaus/impeccable` | Named polish / audit passes aligned with [visual-craft.md](visual-craft.md) | New token schema or swapping `M*` for raw HTML controls |
|
|
25
25
|
|
|
26
26
|
## Load budget
|
|
27
27
|
|
|
@@ -30,11 +30,13 @@ Via MCP: `recommend_page` → `get_golden_page`; local edits: `get_page_snippet`
|
|
|
30
30
|
2. Sider `MMenu` (**every item has `icon`**)
|
|
31
31
|
3. `MLayoutHeader` → `MBreadcrumb`
|
|
32
32
|
4. `MLayoutContent` → `MPageContent`
|
|
33
|
-
5. `
|
|
34
|
-
6. `
|
|
35
|
-
7. `
|
|
36
|
-
8.
|
|
37
|
-
9.
|
|
33
|
+
5. `MPageHeader` — page title + `#actions` primary (**one** filled primary in viewport)
|
|
34
|
+
6. `MPageFilters` — `variant="filled"` optional; inner `MSpace wrap` + Input/Select + query/reset (query/reset → secondary); optional `collapsible` + `#advanced` for secondary fields
|
|
35
|
+
7. Optional `MPageFilterChips` + closable `MTag` when filters are applied (after filters, before table)
|
|
36
|
+
8. Optional `MPageToolbar` — batch actions only (no page title)
|
|
37
|
+
9. `MTable` directly in content (usually **no** wrapping `MCard`); status → `MStatus`; `#empty` → `MEmpty`
|
|
38
|
+
10. Pagination via `MTable` paginator or sibling `MPagination`
|
|
39
|
+
11. Short create/edit → `MDialog` + `MForm` on the same page (default)
|
|
38
40
|
|
|
39
41
|
Craft: [visual-craft.md](visual-craft.md) § Ops polish.
|
|
40
42
|
|
|
@@ -51,7 +53,7 @@ Craft: [visual-craft.md](visual-craft.md) § Ops polish.
|
|
|
51
53
|
1. `MLayout fillViewport` → `MLayoutHeader` → `MBreadcrumb`
|
|
52
54
|
2. `MPageContent density="spacious"` → `MPageHeader` (title + short domain description when useful)
|
|
53
55
|
3. KPI row: `MGrid` + `MPageStat` (4 columns or responsive) — real metric names, not “Metric 1”
|
|
54
|
-
4. Main split: `MCard` + `
|
|
56
|
+
4. Main split: `MCard shadow="always"` + `MEmpty` (chart pending) and/or recent `MTable` (row status → `MStatus`)
|
|
55
57
|
|
|
56
58
|
Craft: spacious density + Ops polish; do not turn the first viewport into a marketing hero.
|
|
57
59
|
|
|
@@ -82,7 +84,7 @@ Mirror MCP `get_golden_page` `detail-page`.
|
|
|
82
84
|
|
|
83
85
|
## List create/edit dialog — block order
|
|
84
86
|
|
|
85
|
-
1. Stay on the list page (`
|
|
87
|
+
1. Stay on the list page (`MPageHeader` + filters/table; optional batch `MPageToolbar`)
|
|
86
88
|
2. `MDialog` ~`28–36rem` + `MForm` fields
|
|
87
89
|
3. Actions in Dialog `#footer` (cancel secondary/text + save primary)
|
|
88
90
|
4. Success → `message.success` one-liner, then close
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
- [ ] At most one primary filled button in the main viewport
|
|
20
20
|
- [ ] Copy is domain-real; empty / error states say what to do next
|
|
21
21
|
- [ ] No AI-default look clusters unless the brief asked for them
|
|
22
|
-
- [ ] Motion (if any) is 1–3 intentional moments and
|
|
22
|
+
- [ ] Motion (if any) is 1–3 intentional moments and follows `useMotion` / `data-m-motion` (not OS `prefers-reduced-motion`)
|
|
23
23
|
|
|
24
24
|
## Ops
|
|
25
25
|
|
|
@@ -31,7 +31,7 @@ Apply after the golden block order is correct. These are **required**, not optio
|
|
|
31
31
|
2. **Sider icons** — every top-level `MMenu` item has an `icon`; icons come from one set (built-in Tabler names). No random emoji.
|
|
32
32
|
3. **Status cells** — row business state → `MStatus` (dot + label). `MTag` only for categories, filters, or closable chips.
|
|
33
33
|
4. **Row actions** — secondary `text` / `outlined` / `size="small"`; danger only on destructive. Prefer `MSpace` with a consistent gap; avoid a wall of filled buttons.
|
|
34
|
-
5. **Filter rhythm** — search ~`14rem`, compact selects ~`10–12rem`; wrap with `MSpace wrap`. Do not stretch filters full-bleed.
|
|
34
|
+
5. **Filter rhythm** — search ~`14rem`, compact selects ~`10–12rem`; wrap with `MSpace wrap`. Do not stretch filters full-bleed. Secondary fields → `MPageFilters collapsible` + `#advanced`; active criteria → `MPageFilterChips` + closable `MTag`.
|
|
35
35
|
6. **Empty is designed** — `MEmpty` (or table `#empty` with `MEmpty`) with a next action; never a silent blank table or a lone muted sentence.
|
|
36
36
|
7. **No extra cards** — do not wrap `MPageFilters` / `MTable` in decorative `MCard` “for polish”. Dashboard chart/detail modules may use `MCard`.
|
|
37
37
|
8. **Domain copy** — column labels, placeholders, and empty titles use product vernacular, not “Name / Status / No data”.
|
|
@@ -57,7 +57,7 @@ Also avoid: Inter/Roboto/Arial as the *expressive* display choice on Express sur
|
|
|
57
57
|
- **Hero is a thesis** (Express): one job in the first viewport — not stats + schedule + promos together.
|
|
58
58
|
- **Structure encodes meaning**: numbered steps only when order is real information.
|
|
59
59
|
- **Cards**: default off for Express heroes; use `MCard` when it groups an interaction or plan choice.
|
|
60
|
-
- **Motion**: orchestrate 2–3 intentional moments max;
|
|
60
|
+
- **Motion**: orchestrate 2–3 intentional moments max; gate custom CSS motion with `[data-m-motion="full"]` (library intensity from `useMotion`). Prefer transform/opacity over layout thrash.
|
|
61
61
|
- **Density**: Ops may be compact; Express needs breathing room — match the lane.
|
|
62
62
|
|
|
63
63
|
## Atmosphere recipes (token-only)
|
|
@@ -121,14 +121,12 @@ Full-bleed thesis: brand mark (small) → one headline → one lead → CTA grou
|
|
|
121
121
|
Optional micro-motion (one signature only):
|
|
122
122
|
|
|
123
123
|
```css
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
animation: m-craft-fade-up 480ms ease both;
|
|
127
|
-
}
|
|
128
|
-
.landing-hero__track span:nth-child(2) { animation-delay: 60ms; }
|
|
129
|
-
.landing-hero__track span:nth-child(3) { animation-delay: 120ms; }
|
|
130
|
-
.landing-hero__track span:nth-child(4) { animation-delay: 180ms; }
|
|
124
|
+
[data-m-motion="full"] .landing-hero__track span {
|
|
125
|
+
animation: m-craft-fade-up 480ms ease both;
|
|
131
126
|
}
|
|
127
|
+
[data-m-motion="full"] .landing-hero__track span:nth-child(2) { animation-delay: 60ms; }
|
|
128
|
+
[data-m-motion="full"] .landing-hero__track span:nth-child(3) { animation-delay: 120ms; }
|
|
129
|
+
[data-m-motion="full"] .landing-hero__track span:nth-child(4) { animation-delay: 180ms; }
|
|
132
130
|
@keyframes m-craft-fade-up {
|
|
133
131
|
from { opacity: 0; transform: translateY(0.4rem); }
|
|
134
132
|
to { opacity: 1; transform: translateY(0); }
|
|
@@ -38,4 +38,4 @@ import { MButton, MInput } from 'morya-ui'
|
|
|
38
38
|
- 用 `MDropdown` 代替 Select 做枚举选择。
|
|
39
39
|
- 手写 table/modal 替代 `MTable` / `MDialog`。
|
|
40
40
|
|
|
41
|
-
完整清单:MCP
|
|
41
|
+
完整清单:MCP `recommend_component`(含 recipe),或 skill `references/decision-recipes.md` / `component-index.md`。
|
|
@@ -5,7 +5,7 @@ alwaysApply: true
|
|
|
5
5
|
|
|
6
6
|
# Morya UI 设计系统
|
|
7
7
|
|
|
8
|
-
1. **先读** 项目根目录 `DESIGN.md`。组件选型用 MCP
|
|
8
|
+
1. **先读** 项目根目录 `DESIGN.md`。组件选型用 MCP `recommend_component`(含 recipe),或 skill `references/decision-recipes.md` / `component-index.md`。
|
|
9
9
|
2. **只用** `morya-ui` 的 `M*` 组件;全局样式 `morya-ui/styles.css`。
|
|
10
10
|
3. **颜色/间距/圆角** 使用 `--m-*` CSS 变量,禁止裸 hex/rgb(见 `scripts/check-raw-colors.mjs`)。
|
|
11
11
|
4. **页面结构** 用 MCP `get_golden_page`(`list-page` / `form-page` / `form-in-dialog` / `detail-page` / `dashboard-page` / `login-page` / `landing-page` / `empty-state` / `result-page` / `settings-page` / `wizard-form`),不要发明新布局范式。
|
|
@@ -31,11 +31,13 @@ alwaysApply: false
|
|
|
31
31
|
2. 侧栏 `MMenu`
|
|
32
32
|
3. `MLayoutHeader` → `MBreadcrumb`
|
|
33
33
|
4. `MLayoutContent` → `MPageContent`
|
|
34
|
-
5. `
|
|
35
|
-
6. `
|
|
36
|
-
7. `
|
|
37
|
-
8.
|
|
38
|
-
9.
|
|
34
|
+
5. `MPageHeader`(页面标题 + `#actions` 主操作;视口内 **唯一** filled primary)
|
|
35
|
+
6. `MPageFilters`(可选 `variant="filled"`、`collapsible` + `#advanced`;查询/重置用 secondary)
|
|
36
|
+
7. 可选 `MPageFilterChips` + 可关闭 `MTag`(有已选条件时,放在筛选与表格之间)
|
|
37
|
+
8. 可选 `MPageToolbar`(仅批量操作,**不要**页面标题)
|
|
38
|
+
9. `MTable`(直接放置;`#empty` → `MEmpty`)
|
|
39
|
+
10. 分页由 `MTable paginator` 或同级 `MPagination`
|
|
40
|
+
11. 短新建/编辑:同页 `MDialog` + `MForm`
|
|
39
41
|
|
|
40
42
|
## 表单页区块顺序
|
|
41
43
|
|
|
@@ -50,7 +52,7 @@ alwaysApply: false
|
|
|
50
52
|
1. `MLayout fillViewport` → `MLayoutHeader` → `MBreadcrumb`
|
|
51
53
|
2. `MPageContent density="spacious"` → `MPageHeader`
|
|
52
54
|
3. KPI:`MGrid` + `MPageStat`(4 列或响应式)
|
|
53
|
-
4. 主区两栏:`MCard` + `
|
|
55
|
+
4. 主区两栏:`MCard shadow="always"` + `MEmpty`(图表未接入)/ 最近列表 `MTable`
|
|
54
56
|
|
|
55
57
|
## 页面标准
|
|
56
58
|
|
package/template/DESIGN.md
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
| 动效时长 | `--m-motion-fast/normal/enter/exit` |
|
|
35
35
|
| 进出场位移 / 缓动 | `--m-motion-distance` / `--m-motion-ease` |
|
|
36
36
|
|
|
37
|
-
动效强度用 `useMotion`(`data-m-motion
|
|
37
|
+
动效强度用 `useMotion`(`data-m-motion`:`full` / `reduced` / `none`),不跟随系统 `prefers-reduced-motion`;进出场预设用 `motion.transitions` / 组件 `transition`(见文档站「动效」)。
|
|
38
38
|
|
|
39
39
|
## 4. 禁止项
|
|
40
40
|
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: fixing-accessibility
|
|
3
|
-
description: Audit and fix HTML accessibility issues including ARIA labels, keyboard navigation, focus management, color contrast, and form errors. Use when adding interactive controls, forms, dialogs, or reviewing WCAG compliance.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# fixing-accessibility
|
|
7
|
-
|
|
8
|
-
> **morya-ui consumer note:** Prefer library defaults (`label`, `aria-label`, Esc-dismiss overlays). Do not replace `M*` widgets with custom ARIA hacks. When guidance conflicts with `DESIGN.md` or `morya-ui-pages`, **those win**.
|
|
9
|
-
|
|
10
|
-
Fix accessibility issues.
|
|
11
|
-
|
|
12
|
-
## how to use
|
|
13
|
-
|
|
14
|
-
- `/fixing-accessibility`
|
|
15
|
-
Apply these constraints to any UI work in this conversation.
|
|
16
|
-
|
|
17
|
-
- `/fixing-accessibility <file>`
|
|
18
|
-
Review the file against all rules below and report:
|
|
19
|
-
- violations (quote the exact line or snippet)
|
|
20
|
-
- why it matters (one short sentence)
|
|
21
|
-
- a concrete fix (code-level suggestion)
|
|
22
|
-
|
|
23
|
-
Do not rewrite large parts of the UI. Prefer minimal, targeted fixes.
|
|
24
|
-
|
|
25
|
-
## when to apply
|
|
26
|
-
|
|
27
|
-
Reference these guidelines when:
|
|
28
|
-
- adding or changing buttons, links, inputs, menus, dialogs, tabs, dropdowns
|
|
29
|
-
- building forms, validation, error states, helper text
|
|
30
|
-
- implementing keyboard shortcuts or custom interactions
|
|
31
|
-
- working on focus states, focus trapping, or modal behavior
|
|
32
|
-
- rendering icon-only controls
|
|
33
|
-
- adding hover-only interactions or hidden content
|
|
34
|
-
|
|
35
|
-
## rule categories by priority
|
|
36
|
-
|
|
37
|
-
| priority | category | impact |
|
|
38
|
-
|----------|----------|--------|
|
|
39
|
-
| 1 | accessible names | critical |
|
|
40
|
-
| 2 | keyboard access | critical |
|
|
41
|
-
| 3 | focus and dialogs | critical |
|
|
42
|
-
| 4 | semantics | high |
|
|
43
|
-
| 5 | forms and errors | high |
|
|
44
|
-
| 6 | announcements | medium-high |
|
|
45
|
-
| 7 | contrast and states | medium |
|
|
46
|
-
| 8 | media and motion | low-medium |
|
|
47
|
-
| 9 | tool boundaries | critical |
|
|
48
|
-
|
|
49
|
-
## quick reference
|
|
50
|
-
|
|
51
|
-
### 1. accessible names (critical)
|
|
52
|
-
|
|
53
|
-
- every interactive control must have an accessible name
|
|
54
|
-
- icon-only buttons must have aria-label or aria-labelledby
|
|
55
|
-
- every input, select, and textarea must be labeled
|
|
56
|
-
- links must have meaningful text (no “click here”)
|
|
57
|
-
- decorative icons must be aria-hidden
|
|
58
|
-
|
|
59
|
-
### 2. keyboard access (critical)
|
|
60
|
-
|
|
61
|
-
- do not use div or span as buttons without full keyboard support
|
|
62
|
-
- all interactive elements must be reachable by Tab
|
|
63
|
-
- focus must be visible for keyboard users
|
|
64
|
-
- do not use tabindex greater than 0
|
|
65
|
-
- Escape must close dialogs or overlays when applicable
|
|
66
|
-
|
|
67
|
-
### 3. focus and dialogs (critical)
|
|
68
|
-
|
|
69
|
-
- modals must trap focus while open
|
|
70
|
-
- restore focus to the trigger on close
|
|
71
|
-
- set initial focus inside dialogs
|
|
72
|
-
- opening a dialog should not scroll the page unexpectedly
|
|
73
|
-
|
|
74
|
-
### 4. semantics (high)
|
|
75
|
-
|
|
76
|
-
- prefer native elements (button, a, input) over role-based hacks
|
|
77
|
-
- if a role is used, required aria attributes must be present
|
|
78
|
-
- lists must use ul or ol with li
|
|
79
|
-
- do not skip heading levels
|
|
80
|
-
- tables must use th for headers when applicable
|
|
81
|
-
|
|
82
|
-
### 5. forms and errors (high)
|
|
83
|
-
|
|
84
|
-
- errors must be linked to fields using aria-describedby
|
|
85
|
-
- required fields must be announced
|
|
86
|
-
- invalid fields must set aria-invalid
|
|
87
|
-
- helper text must be associated with inputs
|
|
88
|
-
- disabled submit actions must explain why
|
|
89
|
-
|
|
90
|
-
### 6. announcements (medium-high)
|
|
91
|
-
|
|
92
|
-
- critical form errors should use aria-live
|
|
93
|
-
- loading states should use aria-busy or status text
|
|
94
|
-
- toasts must not be the only way to convey critical information
|
|
95
|
-
- expandable controls must use aria-expanded and aria-controls
|
|
96
|
-
|
|
97
|
-
### 7. contrast and states (medium)
|
|
98
|
-
|
|
99
|
-
- ensure sufficient contrast for text and icons
|
|
100
|
-
- hover-only interactions must have keyboard equivalents
|
|
101
|
-
- disabled states must not rely on color alone
|
|
102
|
-
- do not remove focus outlines without a visible replacement
|
|
103
|
-
|
|
104
|
-
### 8. media and motion (low-medium)
|
|
105
|
-
|
|
106
|
-
- images must have correct alt text (meaningful or empty)
|
|
107
|
-
- videos with speech should provide captions when relevant
|
|
108
|
-
- respect prefers-reduced-motion for non-essential motion
|
|
109
|
-
- avoid autoplaying media with sound
|
|
110
|
-
|
|
111
|
-
### 9. tool boundaries (critical)
|
|
112
|
-
|
|
113
|
-
- prefer minimal changes, do not refactor unrelated code
|
|
114
|
-
- do not add aria when native semantics already solve the problem
|
|
115
|
-
- do not migrate UI libraries unless requested
|
|
116
|
-
|
|
117
|
-
## common fixes
|
|
118
|
-
|
|
119
|
-
```html
|
|
120
|
-
<!-- icon-only button: add aria-label -->
|
|
121
|
-
<!-- before --> <button><svg>...</svg></button>
|
|
122
|
-
<!-- after --> <button aria-label="Close"><svg aria-hidden="true">...</svg></button>
|
|
123
|
-
|
|
124
|
-
<!-- div as button: use native element -->
|
|
125
|
-
<!-- before --> <div onclick="save()">Save</div>
|
|
126
|
-
<!-- after --> <button onclick="save()">Save</button>
|
|
127
|
-
|
|
128
|
-
<!-- form error: link with aria-describedby -->
|
|
129
|
-
<!-- before --> <input id="email" /> <span>Invalid email</span>
|
|
130
|
-
<!-- after --> <input id="email" aria-describedby="email-err" aria-invalid="true" /> <span id="email-err">Invalid email</span>
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
## review guidance
|
|
134
|
-
|
|
135
|
-
- fix critical issues first (names, keyboard, focus, tool boundaries)
|
|
136
|
-
- prefer native HTML before adding aria
|
|
137
|
-
- quote the exact snippet, state the failure, propose a small fix
|
|
138
|
-
- for complex widgets (menu, dialog, combobox), prefer established accessible primitives over custom behavior
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
Apache License
|
|
3
|
-
Version 2.0, January 2004
|
|
4
|
-
http://www.apache.org/licenses/
|
|
5
|
-
|
|
6
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
-
|
|
8
|
-
1. Definitions.
|
|
9
|
-
|
|
10
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
-
|
|
13
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
-
the copyright owner that is granting the License.
|
|
15
|
-
|
|
16
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
-
other entities that control, are controlled by, or are under common
|
|
18
|
-
control with that entity. For the purposes of this definition,
|
|
19
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
-
direction or management of such entity, whether by contract or
|
|
21
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
-
|
|
24
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
-
exercising permissions granted by this License.
|
|
26
|
-
|
|
27
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
-
including but not limited to software source code, documentation
|
|
29
|
-
source, and configuration files.
|
|
30
|
-
|
|
31
|
-
"Object" form shall mean any form resulting from mechanical
|
|
32
|
-
transformation or translation of a Source form, including but
|
|
33
|
-
not limited to compiled object code, generated documentation,
|
|
34
|
-
and conversions to other media types.
|
|
35
|
-
|
|
36
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
-
Object form, made available under the License, as indicated by a
|
|
38
|
-
copyright notice that is included in or attached to the work
|
|
39
|
-
(an example is provided in the Appendix below).
|
|
40
|
-
|
|
41
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
-
form, that is based on (or derived from) the Work and for which the
|
|
43
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
-
of this License, Derivative Works shall not include works that remain
|
|
46
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
-
the Work and Derivative Works thereof.
|
|
48
|
-
|
|
49
|
-
"Contribution" shall mean any work of authorship, including
|
|
50
|
-
the original version of the Work and any modifications or additions
|
|
51
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
-
means any form of electronic, verbal, or written communication sent
|
|
56
|
-
to the Licensor or its representatives, including but not limited to
|
|
57
|
-
communication on electronic mailing lists, source code control systems,
|
|
58
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
-
excluding communication that is conspicuously marked or otherwise
|
|
61
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
-
|
|
63
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
-
subsequently incorporated within the Work.
|
|
66
|
-
|
|
67
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
-
Work and such Derivative Works in Source or Object form.
|
|
73
|
-
|
|
74
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
-
(except as stated in this section) patent license to make, have made,
|
|
78
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
-
where such license applies only to those patent claims licensable
|
|
80
|
-
by such Contributor that are necessarily infringed by their
|
|
81
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
-
institute patent litigation against any entity (including a
|
|
84
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
-
or contributory patent infringement, then any patent licenses
|
|
87
|
-
granted to You under this License for that Work shall terminate
|
|
88
|
-
as of the date such litigation is filed.
|
|
89
|
-
|
|
90
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
-
modifications, and in Source or Object form, provided that You
|
|
93
|
-
meet the following conditions:
|
|
94
|
-
|
|
95
|
-
(a) You must give any other recipients of the Work or
|
|
96
|
-
Derivative Works a copy of this License; and
|
|
97
|
-
|
|
98
|
-
(b) You must cause any modified files to carry prominent notices
|
|
99
|
-
stating that You changed the files; and
|
|
100
|
-
|
|
101
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
-
that You distribute, all copyright, patent, trademark, and
|
|
103
|
-
attribution notices from the Source form of the Work,
|
|
104
|
-
excluding those notices that do not pertain to any part of
|
|
105
|
-
the Derivative Works; and
|
|
106
|
-
|
|
107
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
-
distribution, then any Derivative Works that You distribute must
|
|
109
|
-
include a readable copy of the attribution notices contained
|
|
110
|
-
within such NOTICE file, excluding those notices that do not
|
|
111
|
-
pertain to any part of the Derivative Works, in at least one
|
|
112
|
-
of the following places: within a NOTICE text file distributed
|
|
113
|
-
as part of the Derivative Works; within the Source form or
|
|
114
|
-
documentation, if provided along with the Derivative Works; or,
|
|
115
|
-
within a display generated by the Derivative Works, if and
|
|
116
|
-
wherever such third-party notices normally appear. The contents
|
|
117
|
-
of the NOTICE file are for informational purposes only and
|
|
118
|
-
do not modify the License. You may add Your own attribution
|
|
119
|
-
notices within Derivative Works that You distribute, alongside
|
|
120
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
-
that such additional attribution notices cannot be construed
|
|
122
|
-
as modifying the License.
|
|
123
|
-
|
|
124
|
-
You may add Your own copyright statement to Your modifications and
|
|
125
|
-
may provide additional or different license terms and conditions
|
|
126
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
-
the conditions stated in this License.
|
|
130
|
-
|
|
131
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
-
this License, without any additional terms or conditions.
|
|
135
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
-
the terms of any separate license agreement you may have executed
|
|
137
|
-
with Licensor regarding such Contributions.
|
|
138
|
-
|
|
139
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
-
except as required for reasonable and customary use in describing the
|
|
142
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
-
|
|
144
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
-
implied, including, without limitation, any warranties or conditions
|
|
149
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
-
appropriateness of using or redistributing the Work and assume any
|
|
152
|
-
risks associated with Your exercise of permissions under this License.
|
|
153
|
-
|
|
154
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
-
unless required by applicable law (such as deliberate and grossly
|
|
157
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
-
liable to You for damages, including any direct, indirect, special,
|
|
159
|
-
incidental, or consequential damages of any character arising as a
|
|
160
|
-
result of this License or out of the use or inability to use the
|
|
161
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
-
other commercial damages or losses), even if such Contributor
|
|
164
|
-
has been advised of the possibility of such damages.
|
|
165
|
-
|
|
166
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
-
or other liability obligations and/or rights consistent with this
|
|
170
|
-
License. However, in accepting such obligations, You may act only
|
|
171
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
-
defend, and hold each Contributor harmless for any liability
|
|
174
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
-
of your accepting any such warranty or additional liability.
|
|
176
|
-
|
|
177
|
-
END OF TERMS AND CONDITIONS
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: frontend-design
|
|
3
|
-
description: Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
|
|
4
|
-
license: Complete terms in LICENSE.txt
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Frontend Design
|
|
8
|
-
|
|
9
|
-
> **morya-ui consumer note:** Use this skill for Express / brand taste only. Always implement interactive controls with `M*` and colors/spacing with `--m-*`. When this skill conflicts with project `DESIGN.md`, `morya-ui-pages`, or MCP APIs, **those win**.
|
|
10
|
-
|
|
11
|
-
Approach this as the design lead at a small studio known for giving every client a visual identity that could not be mistaken for anyone else's. This client has already rejected proposals that felt templated, and is paying for a distinctive point of view: make deliberate, opinionated choices about palette, typography, and layout that are specific to this brief, and take one real aesthetic risk you can justify.
|
|
12
|
-
|
|
13
|
-
## Ground it in the subject
|
|
14
|
-
|
|
15
|
-
If the brief does not pin down what the product or subject is, pin it yourself before designing: name one concrete subject, its audience, and the page's single job, and state your choice. If there's any information in your memory about the human's preferences, context about what they're building, or designs you've made before – use that as a hint. The subject's own world, its materials, instruments, artifacts, and vernacular, is where distinctive choices come from. Build with the brief's real content and subject matter throughout.
|
|
16
|
-
|
|
17
|
-
## Design principles
|
|
18
|
-
|
|
19
|
-
For web designs, the hero is a thesis. Open with the most characteristic thing in the subject's world, in whatever form makes sense for it: a headline, an image, an animation, a live demo, an interactive moment. Be deliberate with your choice: a big number with a small label, supporting stats, and a gradient accent is the template answer, only use if that's truly the best option.
|
|
20
|
-
|
|
21
|
-
Typography carries the personality of the page. Pair the display and body faces deliberately, not the same families you would reach for on any other project, and set a clear type scale with intentional weights, widths, and spacing. Make the type treatment itself a memorable part of the design, not a neutral delivery vehicle for the content.
|
|
22
|
-
|
|
23
|
-
Structure is information. Structural devices, numbering, eyebrows, dividers, labels, should encode something true about the content, not decorate it. Many generic designs use numbered markers (01 / 02 / 03), but that's only appropriate if the content actually is a sequence - like a real process or a typed timeline where order carries information the reader needs. Question if choices like numbered markers actually make sense before incorporating them.
|
|
24
|
-
|
|
25
|
-
Leverage motion deliberately. Think about where and if animation can serve the subject: a page-load sequence, a scroll-triggered reveal, hover micro-interactions, ambient atmosphere. An orchestrated moment usually lands harder than scattered effects; choose what the direction calls for. However, sometimes less is more, and extra animation contributes to the feeling that the design is AI-generated.
|
|
26
|
-
|
|
27
|
-
Match complexity to the vision. Maximalist directions need elaborate execution; minimal directions need precision in spacing, type, and detail. Elegance is executing the chosen vision well.
|
|
28
|
-
|
|
29
|
-
Consider written content carefully. Often a design brief may not contain real content, and it's up to you to come up with copy. Copy can make a design feel as templated as the design itself. See the below section on writing for more guidance.
|
|
30
|
-
|
|
31
|
-
## Process: brainstorm, explore, plan, critique, build, critique again
|
|
32
|
-
|
|
33
|
-
For calibration: AI-generated design right now clusters around three looks: (1) a warm cream background (near #F4F1EA) with a high-contrast serif display and a terracotta accent; (2) a near-black background with a single bright acid-green or vermilion accent; (3) a broadsheet-style layout with hairline rules, zero border-radius, and dense newspaper-like columns. All three are legitimate for some briefs, but they are defaults rather than choices, and they appear regardless of subject. Where the brief pins down a visual direction, follow it exactly — the brief's own words always win, including when it asks for one of these looks. Where it leaves an axis free, don't spend that freedom on one of these defaults. Just like a human designer who's hired, there's often a careful balance between doing what you're good at and taking each project as a chance to experiment and learn.
|
|
34
|
-
|
|
35
|
-
Work in two passes. First, brainstorm a short design plan based on the human's design brief: create a compact token system with color, type, layout, and signature. Color: describe the palette as 4–6 named hex values. Type: the typefaces for 2+ roles (a characterful display face that's used with restraint, a complementary body face, and a utility face for captions or data if needed). Layout: a layout concept, using one-sentence prose descriptions and ASCII wireframes to ideate and compare. Signature: the single unique element this page will be remembered by that embodies the brief in an appropriate way.
|
|
36
|
-
|
|
37
|
-
Then review that plan against the brief before building: if any part of it reads like the generic default you would produce for any similar page (work through a similar prompt to see if you arrive somewhere similar) rather than a choice made for this specific brief — revise that part, say what you changed and why. Only after you've confirmed the relative uniqueness of your design plan should you start to write the code, following the revised plan exactly and deriving every color and type decision from it.
|
|
38
|
-
|
|
39
|
-
When writing the code, be careful of structuring your CSS selector specificities. It's easy to generate CSS classes that cancel each other out (especially with a type-based selector like .section and a element-based selector like .cta). This can happen often with paddings/margins between sections.
|
|
40
|
-
|
|
41
|
-
Try to do a lot of this planning and iteration in your thinking, and only show ideas to the user when you have higher confidence it'll delight them.
|
|
42
|
-
|
|
43
|
-
## Restraint and self-critique
|
|
44
|
-
|
|
45
|
-
Spend your boldness in one place. Let the signature element be the one memorable thing, keep everything around it quiet and disciplined, and cut any decoration that does not serve the brief. Not taking a risk can be a risk itself! Build to a quality floor without announcing it: responsive down to mobile, visible keyboard focus, reduced motion respected. Critique your own work as you build, taking screenshots if your environment supports it – a picture is worth 1000 tokens. Consider Chanel's advice: before leaving the house, take a look in the mirror and remove one accessory. Human creators have memory and always try to do something new, so if you have a space to quickly jot down notes about what you've tried, it can help you in future passes.
|
|
46
|
-
|
|
47
|
-
## More on writing in design
|
|
48
|
-
|
|
49
|
-
Words appear in a design for one reason: to make it easier to understand, and therefore easier to use. They are design material, not decoration. Bring the same intentionality to copy that you would bring to spacing and color. Before writing anything, ask what the design needs to say, and how it can best be said to help the person navigate the experience.
|
|
50
|
-
|
|
51
|
-
Write from the end user's side of the screen. Name things by what people control and recognize, never by how the system is built. A person manages notifications, not webhook config. Describe what something does in plain terms rather than selling it. Being specific is always better than being clever.
|
|
52
|
-
|
|
53
|
-
Use active voice as default. A control should say exactly what happens when it's used: "Save changes," not "Submit." An action keeps the same name through the whole flow, so the button that says "Publish" produces a toast that says "Published." The vocabulary of an interface is the signposting for someone navigating the product. Cohesion and consistency are how people learn their way around.
|
|
54
|
-
|
|
55
|
-
Treat failure and emptiness as moments for direction, not mood. Explain what went wrong and how to fix it, in the interface's voice rather than a person's. Errors don't apologize, and they are never vague about what happened. An empty screen is an invitation to act.
|
|
56
|
-
|
|
57
|
-
Keep the register conversational and tuned: plain verbs, sentence case, no filler, with tone matched to the brand and the audience. Let each element do exactly one job. A label labels, an example demonstrates, and nothing quietly does double duty.
|