amicro-universal-frontend-style 1.1.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 +35 -0
- package/LICENSE +21 -0
- package/README.md +156 -0
- package/SKILL.md +54 -0
- package/THIRD_PARTY_NOTICES.md +39 -0
- package/VERSION +1 -0
- package/agents/interface.yaml +29 -0
- package/assets/README.md +38 -0
- package/assets/amicro-motion-presets.ts +39 -0
- package/assets/amicro-motion.css +301 -0
- package/assets/amicro-primitives.css +530 -0
- package/assets/amicro-tokens.css +140 -0
- package/assets/amicro-tokens.json +383 -0
- package/assets/amicro-tokens.ts +115 -0
- package/examples/preview.html +261 -0
- package/examples/prompts.md +26 -0
- package/examples/react/AmicroFeatureCard.tsx +49 -0
- package/examples/svelte/AmicroFeatureCard.svelte +29 -0
- package/examples/vue/AmicroFeatureCard.vue +32 -0
- package/manifest.json +67 -0
- package/package.json +49 -0
- package/references/accessibility-performance.md +66 -0
- package/references/component-recipes.md +158 -0
- package/references/design-language.md +227 -0
- package/references/framework-adapters.md +202 -0
- package/references/migration-workflow.md +68 -0
- package/references/motion-language.md +79 -0
- package/references/quality-checklist.md +41 -0
- package/references/source-notes.md +60 -0
- package/references/v1.0.1-migration.md +10 -0
- package/scripts/_path_safety.py +45 -0
- package/scripts/generate_token_assets.py +159 -0
- package/scripts/inspect_frontend.py +430 -0
- package/scripts/install_style_layer.py +309 -0
- package/scripts/verify_amicro_style.py +483 -0
- package/security/permission_policy.json +40 -0
- package/security/permission_policy.md +13 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.1.0 — 2026-08-31
|
|
4
|
+
|
|
5
|
+
- Reworked the Skill entrypoint to fit the Yao Library context budget and tightened route exclusions.
|
|
6
|
+
- Moved Skill IR out of the always-loaded `agents/` directory.
|
|
7
|
+
- Added reproducible standard-library tests, trigger-routing evals, and six recorded-fixture Output Lab cases covering file-backed, near-neighbor, and boundary behavior.
|
|
8
|
+
- Added npm runtime packaging with explicit file allowlists, Python cache exclusions, and CLI entrypoints.
|
|
9
|
+
- Fixed uninstall planning so managed-file symlinks are blocked before path resolution and cannot delete their targets under `--force`.
|
|
10
|
+
- Fixed Python 3.11 Markdown rendering compatibility by moving pipe escaping outside the f-string expression.
|
|
11
|
+
- Fixed the browser preview copy feedback after asynchronous clipboard access and added an explicit input `id`/`name`.
|
|
12
|
+
- Removed references to absent companion archives, browser suites, and generated release reports.
|
|
13
|
+
- Preserved missing human review and production telemetry as explicit evidence gaps.
|
|
14
|
+
|
|
15
|
+
## 1.0.1 — 2026-08-30
|
|
16
|
+
|
|
17
|
+
- Moved non-essential CSS animation and transition declarations under `prefers-reduced-motion: no-preference` and added an exact emergency stop for reduced motion.
|
|
18
|
+
- Fixed 320px horizontal overflow, narrow toolbar/nav wrapping, RTL switch positioning, and logical sizing.
|
|
19
|
+
- Reworked text/icon swap examples so each control exposes one accessible name and selection state is reflected with ARIA.
|
|
20
|
+
- Enforced target-scoped `--output` paths for inspection and verification, including absolute path, parent traversal, and symlink escape rejection.
|
|
21
|
+
- Added safe install/update/uninstall lifecycle with `.amicro-install.json`, hashes, drift detection, atomic writes, dry-run, and explicit force semantics.
|
|
22
|
+
- Changed the light muted token to `#6f6f6f` and added semantic contrast checks.
|
|
23
|
+
- Made `amicro-tokens.json` the canonical 66-variable source and generated CSS/TypeScript artifacts deterministically.
|
|
24
|
+
- Added conservative animation-context verification, deliberately unsafe regression fixtures, and self-scoped React/Vue/Svelte examples.
|
|
25
|
+
- Added 19 standard-library unit tests and a 10-check Chromium smoke suite covering 320/360/768/1440px, reduced motion, accessible names, focus, RTL, and console errors.
|
|
26
|
+
- Split runtime, source/evidence, and five host-layout adapter distributions.
|
|
27
|
+
- Removed unsupported world-class/adoption claims; independent human blind review and production telemetry remain missing evidence.
|
|
28
|
+
|
|
29
|
+
## 1.0.0 — 2026-08-28
|
|
30
|
+
|
|
31
|
+
- Rebuilt the repository-local Amicro design notes as a cross-framework Library-mode Skill.
|
|
32
|
+
- Added scoped design tokens, primitive components, motion utilities, and machine-readable tokens.
|
|
33
|
+
- Added migration guidance for vanilla, React/Next, Vue/Nuxt, Svelte/SvelteKit, Astro, Tailwind, CSS Modules, Sass, and CSS-in-JS.
|
|
34
|
+
- Added deterministic frontend inspection, safe asset installation, and static style verification scripts.
|
|
35
|
+
- Added runnable preview, framework examples, trigger cases, output cases, tests, attribution, and initial validation artifacts.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Amicro Universal Frontend Style contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# Amicro Universal Frontend Style Skill v1.1.0
|
|
2
|
+
|
|
3
|
+
一个可复用、跨框架的 Agent Skill,用于把 **Amicro 的视觉语言与微交互语法**迁移到任意前端页面,而不是强制复制上游的 React、Tailwind 或 Motion 技术栈。
|
|
4
|
+
|
|
5
|
+
## 能力
|
|
6
|
+
|
|
7
|
+
- 识别 React、Next.js、Vue、Nuxt、Svelte、Astro、Tailwind、CSS Modules、CSS-in-JS 与现有动效工具。
|
|
8
|
+
- 将页面、表面、舞台、文字、边框、品牌强调色等角色映射为作用域 Token。
|
|
9
|
+
- 提供卡片、按钮、导航、表单、切换、提示、文本/图标交换、光泽和页面转场配方。
|
|
10
|
+
- 默认使用目标项目已有技术栈,不自动安装依赖,不联网,不修改 `package.json`。
|
|
11
|
+
- 检查键盘焦点、主题、对比度、移动端溢出风险、危险动效和 reduced-motion。
|
|
12
|
+
|
|
13
|
+
## 安装 Skill
|
|
14
|
+
|
|
15
|
+
将运行版 ZIP 解压到宿主支持的 Skills 目录。常见项目级位置:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
.agents/skills/amicro-universal-frontend-style/
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
显式调用:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
$amicro-universal-frontend-style 把 src/pages/pricing.tsx 改成 Amicro 风格,保留现有品牌色、文案、组件 API 和业务逻辑。
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
自然语言能否自动触发取决于宿主的语义路由;显式 `$amicro-universal-frontend-style` 最可靠。
|
|
28
|
+
|
|
29
|
+
## 检查目标项目
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
python3 scripts/inspect_frontend.py /path/to/project --format markdown
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
报告只能写到目标项目内部:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
python3 scripts/inspect_frontend.py /path/to/project \
|
|
39
|
+
--format json \
|
|
40
|
+
--output reports/amicro-inventory.json
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
绝对路径、`../` 逃逸和符号链接逃逸都会被拒绝。
|
|
44
|
+
|
|
45
|
+
## 安装样式层
|
|
46
|
+
|
|
47
|
+
默认仅 dry-run:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
python3 scripts/install_style_layer.py /path/to/project \
|
|
51
|
+
--destination src/styles/amicro
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
显式安装:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
python3 scripts/install_style_layer.py /path/to/project \
|
|
58
|
+
--destination src/styles/amicro \
|
|
59
|
+
--apply
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
默认管理:
|
|
63
|
+
|
|
64
|
+
- `amicro-tokens.css`
|
|
65
|
+
- `amicro-primitives.css`
|
|
66
|
+
- `amicro-motion.css`
|
|
67
|
+
- `amicro-tokens.json`
|
|
68
|
+
- `amicro-tokens.ts`
|
|
69
|
+
- `.amicro-install.json` 安装清单与文件哈希
|
|
70
|
+
|
|
71
|
+
需要 TypeScript 动效 helper 时添加 `--include-presets`。
|
|
72
|
+
|
|
73
|
+
安全更新:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
python3 scripts/install_style_layer.py /path/to/project \
|
|
77
|
+
--destination src/styles/amicro \
|
|
78
|
+
--update --apply
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
卸载:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
python3 scripts/install_style_layer.py /path/to/project \
|
|
85
|
+
--destination src/styles/amicro \
|
|
86
|
+
--uninstall --apply
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
被本地修改的受管文件默认不会被更新或删除;只有显式 `--force` 才会覆盖漂移。
|
|
90
|
+
|
|
91
|
+
## 导入和作用域
|
|
92
|
+
|
|
93
|
+
```css
|
|
94
|
+
@import "./amicro/amicro-tokens.css";
|
|
95
|
+
@import "./amicro/amicro-primitives.css";
|
|
96
|
+
@import "./amicro/amicro-motion.css";
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<main class="amicro" data-amicro-root data-amicro-theme="auto">
|
|
101
|
+
<!-- existing product UI -->
|
|
102
|
+
</main>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Token 的权威源是 `assets/amicro-tokens.json`。检查生成物一致性:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
python3 scripts/generate_token_assets.py .
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
维护者需要重新生成 CSS/TypeScript 时使用 `--write`。
|
|
112
|
+
|
|
113
|
+
## 静态验证
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
python3 scripts/verify_amicro_style.py /path/to/project --strict
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
写入目标内部报告:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
python3 scripts/verify_amicro_style.py /path/to/project \
|
|
123
|
+
--strict --format json \
|
|
124
|
+
--output reports/amicro-verification.json
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
静态扫描不能证明视觉正确。真实验收至少应覆盖 320、360、768、1440px,明暗主题、键盘、触摸、唯一可访问名称、RTL(适用时)、reduced-motion、控制台错误和横向溢出。
|
|
128
|
+
|
|
129
|
+
## 源码验证
|
|
130
|
+
|
|
131
|
+
从源码仓库运行标准库测试:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
python3 -m unittest discover -s tests -p 'test_*.py'
|
|
135
|
+
python3 scripts/generate_token_assets.py .
|
|
136
|
+
python3 scripts/verify_amicro_style.py . --strict
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
测试覆盖路径约束、前端探测、Token 生成一致性、静态验证,以及样式层
|
|
140
|
+
dry-run/install/update/drift/uninstall 生命周期。npm runtime 包不包含测试与评测
|
|
141
|
+
夹具;它们保留在源码仓库中供维护和发布验证。
|
|
142
|
+
|
|
143
|
+
真实浏览器验收仍需在具体目标项目上完成,不能由静态测试替代。
|
|
144
|
+
|
|
145
|
+
## 分发边界
|
|
146
|
+
|
|
147
|
+
- **npm runtime 包**:实际安装使用,不包含测试、评测和生成报告。
|
|
148
|
+
- **Git 源码**:包含测试、触发与输出评测,以及维护元数据。
|
|
149
|
+
- 宿主适配声明只描述目录与元数据兼容性,不代表所有宿主都完成在线实机认证。
|
|
150
|
+
|
|
151
|
+
独立人类盲审与生产采用 telemetry 仍是 `missing evidence`,因此不作
|
|
152
|
+
“world-class”或生产采用声明。
|
|
153
|
+
|
|
154
|
+
## 来源与许可
|
|
155
|
+
|
|
156
|
+
本 Skill 基于 Amicro 公开 MIT 仓库进行框架中立化整理。归属与边界见 `THIRD_PARTY_NOTICES.md` 和 `references/source-notes.md`。
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: amicro-universal-frontend-style
|
|
3
|
+
description: Apply or port the Amicro-inspired visual language, scoped design tokens, component surfaces, and restrained micro-transitions to an existing frontend. Use for React, Next.js, Vue, Nuxt, Svelte, Astro, Tailwind, CSS Modules, CSS-in-JS, or vanilla HTML/CSS/JS when the user asks for Amicro styling, tactile motion, a style migration, or an implementation audit. Preserve product behavior, content, component APIs, accessibility, branding, and the target stack. Exclude backend work, generic brand identity design, install-only support, visual critique without implementation, and verbatim cloning of Amicro product content.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Amicro Universal Frontend Style
|
|
7
|
+
|
|
8
|
+
Apply Amicro as an adaptable style grammar, not a product clone.
|
|
9
|
+
|
|
10
|
+
## Contract
|
|
11
|
+
|
|
12
|
+
- Preserve behavior, semantics, content, component APIs, and brand constraints unless explicitly changed.
|
|
13
|
+
- Reuse the target stack and existing design system. New dependencies require approval.
|
|
14
|
+
- Scope all tokens and styles; inspect before writing and patch narrowly.
|
|
15
|
+
- Keep essential behavior available to keyboard, pointer, and touch users without relying on hover.
|
|
16
|
+
- Put non-essential animation inside `prefers-reduced-motion: no-preference`.
|
|
17
|
+
- Never claim visual verification from static scanning.
|
|
18
|
+
|
|
19
|
+
## Exclusions
|
|
20
|
+
|
|
21
|
+
Do not use this Skill for backend work, installation-only support, generic visual critique, general accessibility audits that do not request Amicro adaptation, broad brand identity work, one-off animation snippets, summaries, or verbatim product cloning.
|
|
22
|
+
|
|
23
|
+
## Workflow
|
|
24
|
+
|
|
25
|
+
1. Identify the target slice, framework, style entrypoint, theme model, existing motion library, checks, and contracts to preserve.
|
|
26
|
+
2. Inventory the target before editing:
|
|
27
|
+
```bash
|
|
28
|
+
python3 scripts/inspect_frontend.py <target> --format markdown
|
|
29
|
+
```
|
|
30
|
+
3. Read `references/design-language.md` and `references/migration-workflow.md`. Add motion or framework references only when needed.
|
|
31
|
+
4. Pilot the smallest useful layer: token roles, surfaces, geometry, focus, component states, then optional motion.
|
|
32
|
+
5. Run the target project's format, type, lint, test, and build commands, followed by:
|
|
33
|
+
```bash
|
|
34
|
+
python3 scripts/verify_amicro_style.py <target> --strict
|
|
35
|
+
```
|
|
36
|
+
6. Render relevant states at 320, 360, 768, and 1440px. Check focus, touch, exact accessible names, themes, reduced motion, clipping, overflow, RTL when relevant, and runtime errors.
|
|
37
|
+
7. Report changed files, preserved contracts, checks actually run, rendered states actually inspected, and unresolved caveats.
|
|
38
|
+
|
|
39
|
+
## Optional Style Layer
|
|
40
|
+
|
|
41
|
+
Dry-run is the default. Writes require `--apply` and remain inside the explicit target:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
python3 scripts/install_style_layer.py <target> --destination src/styles/amicro
|
|
45
|
+
python3 scripts/install_style_layer.py <target> --destination src/styles/amicro --apply
|
|
46
|
+
python3 scripts/install_style_layer.py <target> --destination src/styles/amicro --update --apply
|
|
47
|
+
python3 scripts/install_style_layer.py <target> --destination src/styles/amicro --uninstall --apply
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Output Contract
|
|
51
|
+
|
|
52
|
+
Return working target-native files, a concise compatibility summary, commands actually run, rendered evidence actually inspected, and explicit remaining risks. The bundled `assets/` are optional seeds, not mandatory global CSS.
|
|
53
|
+
|
|
54
|
+
Routing evidence and packaging expectations live in `evals/`; they are maintenance inputs, not runtime instructions.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Third-Party Notices
|
|
2
|
+
|
|
3
|
+
## Amicro — Micro-transitions
|
|
4
|
+
|
|
5
|
+
This Skill derives design-system observations, token roles, interaction patterns, and implementation guidance from the public Amicro repository:
|
|
6
|
+
|
|
7
|
+
- Project: `@subhanhq/amicro`
|
|
8
|
+
- Repository: <https://github.com/Subhan-code/Amicro--Micro-transitions->
|
|
9
|
+
- Creator: Syed Subhan
|
|
10
|
+
- Upstream license: MIT
|
|
11
|
+
- Upstream copyright: `Copyright (c) 2026 SYED SUBHAN UDDIN`
|
|
12
|
+
|
|
13
|
+
The upstream MIT notice follows:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
MIT License
|
|
17
|
+
|
|
18
|
+
Copyright (c) 2026 SYED SUBHAN UDDIN
|
|
19
|
+
|
|
20
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
21
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
22
|
+
in the Software without restriction, including without limitation the rights
|
|
23
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
24
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
25
|
+
furnished to do so, subject to the following conditions:
|
|
26
|
+
|
|
27
|
+
The above copyright notice and this permission notice shall be included in all
|
|
28
|
+
copies or substantial portions of the Software.
|
|
29
|
+
|
|
30
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
31
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
32
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
33
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
34
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
35
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
36
|
+
SOFTWARE.
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
This package does not redistribute the Amicro logo, product copy, screenshots, or a wholesale copy of the upstream component library. The bundled CSS and examples are framework-neutral adaptations written for this Skill.
|
package/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.1.0
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Amicro Universal Frontend Style"
|
|
3
|
+
short_description: "Port scoped Amicro-inspired styling and motion into an existing frontend"
|
|
4
|
+
default_prompt: "Use $amicro-universal-frontend-style to inspect the target, preserve its contracts, implement the smallest scoped Amicro-inspired layer in the existing stack, verify project checks and rendered states, and report only evidence actually collected."
|
|
5
|
+
compatibility:
|
|
6
|
+
canonical_format: "agent-skills"
|
|
7
|
+
adapter_targets:
|
|
8
|
+
- "openai"
|
|
9
|
+
- "claude"
|
|
10
|
+
- "generic"
|
|
11
|
+
- "agent-skills-compatible"
|
|
12
|
+
- "vscode"
|
|
13
|
+
activation:
|
|
14
|
+
mode: "manual"
|
|
15
|
+
semantic_routing: "host-dependent"
|
|
16
|
+
explicit_invocation: "$amicro-universal-frontend-style"
|
|
17
|
+
execution:
|
|
18
|
+
context: "inline"
|
|
19
|
+
shell: "bash"
|
|
20
|
+
trust:
|
|
21
|
+
source_tier: "local"
|
|
22
|
+
remote_inline_execution: "forbid"
|
|
23
|
+
remote_metadata_policy: "allow-metadata-only"
|
|
24
|
+
degradation:
|
|
25
|
+
openai: "metadata-adapter"
|
|
26
|
+
claude: "neutral-source-plus-adapter"
|
|
27
|
+
generic: "neutral-source"
|
|
28
|
+
agent-skills-compatible: "neutral-source"
|
|
29
|
+
vscode: "agent-skills-source-with-vscode-notes"
|
package/assets/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Bundled Style Assets
|
|
2
|
+
|
|
3
|
+
These files are opt-in implementation seeds. They are scoped, install no dependency, import no font, perform no global reset, and make no network request.
|
|
4
|
+
|
|
5
|
+
## Canonical source
|
|
6
|
+
|
|
7
|
+
`amicro-tokens.json` is the single machine-readable source for all public `--amicro-*` variables. The CSS and TypeScript files are generated from it.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
python3 scripts/generate_token_assets.py . # read-only parity check
|
|
11
|
+
python3 scripts/generate_token_assets.py . --write # maintainer regeneration
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Files
|
|
15
|
+
|
|
16
|
+
- `amicro-tokens.json` — canonical light/dark/auto token data.
|
|
17
|
+
- `amicro-tokens.css` — generated variables under `.amicro`, `[data-amicro-scope]`, or `[data-amicro-root]`.
|
|
18
|
+
- `amicro-tokens.ts` — generated dependency-free TypeScript token maps.
|
|
19
|
+
- `amicro-primitives.css` — layout, card, stage, button, navigation, form, switch, toast, and metric primitives.
|
|
20
|
+
- `amicro-motion.css` — gated hover/press, entrance, icon/text swap, glare, pulse, shake, success, skeleton, and route utilities.
|
|
21
|
+
- `amicro-motion-presets.ts` — optional dependency-free timing, easing, spring, reduced-motion, and magnetic-offset helpers.
|
|
22
|
+
|
|
23
|
+
## Minimal use
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<link rel="stylesheet" href="amicro-tokens.css">
|
|
27
|
+
<link rel="stylesheet" href="amicro-primitives.css">
|
|
28
|
+
<link rel="stylesheet" href="amicro-motion.css">
|
|
29
|
+
|
|
30
|
+
<main class="amicro" data-amicro-root data-amicro-theme="auto">
|
|
31
|
+
<article class="amicro-card amicro-hover-lift" data-interactive="true">
|
|
32
|
+
<div class="amicro-card__stage">...</div>
|
|
33
|
+
<footer class="amicro-card__footer">...</footer>
|
|
34
|
+
</article>
|
|
35
|
+
</main>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Override variables at the scope root to preserve the target product's brand.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Framework-neutral Amicro motion constants and small helpers. No runtime dependency. */
|
|
2
|
+
export const AMICRO_EASE = [0.16, 1, 0.3, 1] as const;
|
|
3
|
+
export const AMICRO_CURTAIN_EASE = [0.83, 0, 0.17, 1] as const;
|
|
4
|
+
|
|
5
|
+
export const AMICRO_DURATION = {
|
|
6
|
+
instant: 0.12,
|
|
7
|
+
fast: 0.18,
|
|
8
|
+
control: 0.24,
|
|
9
|
+
card: 0.32,
|
|
10
|
+
section: 0.48,
|
|
11
|
+
route: 0.65,
|
|
12
|
+
} as const;
|
|
13
|
+
|
|
14
|
+
export const AMICRO_SPRING = {
|
|
15
|
+
crisp: { stiffness: 600, damping: 25 },
|
|
16
|
+
layout: { stiffness: 500, damping: 25 },
|
|
17
|
+
gentle: { stiffness: 400, damping: 25 },
|
|
18
|
+
ring: { stiffness: 600, damping: 15 },
|
|
19
|
+
} as const;
|
|
20
|
+
|
|
21
|
+
export function prefersReducedMotion(): boolean {
|
|
22
|
+
return typeof window !== "undefined" &&
|
|
23
|
+
window.matchMedia?.("(prefers-reduced-motion: reduce)").matches === true;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type MagneticOffset = { x: number; y: number };
|
|
27
|
+
|
|
28
|
+
export function magneticOffset(
|
|
29
|
+
event: Pick<PointerEvent, "clientX" | "clientY">,
|
|
30
|
+
element: Element,
|
|
31
|
+
strength = 0.25,
|
|
32
|
+
maxDistance = 12,
|
|
33
|
+
): MagneticOffset {
|
|
34
|
+
const rect = element.getBoundingClientRect();
|
|
35
|
+
const x = (event.clientX - (rect.left + rect.width / 2)) * strength;
|
|
36
|
+
const y = (event.clientY - (rect.top + rect.height / 2)) * strength;
|
|
37
|
+
const clamp = (value: number) => Math.max(-maxDistance, Math.min(maxDistance, value));
|
|
38
|
+
return { x: clamp(x), y: clamp(y) };
|
|
39
|
+
}
|