@xaviele/ag-kit 1.0.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/README.md +20 -0
- package/bin/cli.js +63 -0
- package/package.json +27 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/charts.csv +26 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/colors.csv +97 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/icons.csv +101 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/landing.csv +31 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/products.csv +97 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/prompts.csv +24 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/styles.csv +59 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/typography.csv +58 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/template/.agent/.shared/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/template/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/core.cpython-313.pyc +0 -0
- package/template/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-313.pyc +0 -0
- package/template/.agent/.shared/ui-ux-pro-max/scripts/core.py +258 -0
- package/template/.agent/.shared/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/template/.agent/.shared/ui-ux-pro-max/scripts/search.py +106 -0
- package/template/.agent/ARCHITECTURE.md +281 -0
- package/template/.agent/agents/backend-specialist.md +263 -0
- package/template/.agent/agents/code-archaeologist.md +106 -0
- package/template/.agent/agents/database-architect.md +226 -0
- package/template/.agent/agents/debugger.md +225 -0
- package/template/.agent/agents/devops-engineer.md +242 -0
- package/template/.agent/agents/documentation-writer.md +104 -0
- package/template/.agent/agents/explorer-agent.md +73 -0
- package/template/.agent/agents/frontend-specialist.md +593 -0
- package/template/.agent/agents/game-developer.md +162 -0
- package/template/.agent/agents/mobile-developer.md +377 -0
- package/template/.agent/agents/orchestrator.md +416 -0
- package/template/.agent/agents/penetration-tester.md +188 -0
- package/template/.agent/agents/performance-optimizer.md +187 -0
- package/template/.agent/agents/product-manager.md +112 -0
- package/template/.agent/agents/product-owner.md +95 -0
- package/template/.agent/agents/project-planner.md +406 -0
- package/template/.agent/agents/qa-automation-engineer.md +103 -0
- package/template/.agent/agents/security-auditor.md +170 -0
- package/template/.agent/agents/seo-specialist.md +111 -0
- package/template/.agent/agents/test-engineer.md +158 -0
- package/template/.agent/mcp_config.json +24 -0
- package/template/.agent/rules/GEMINI.md +273 -0
- package/template/.agent/scripts/auto_preview.py +148 -0
- package/template/.agent/scripts/checklist.py +217 -0
- package/template/.agent/scripts/session_manager.py +120 -0
- package/template/.agent/scripts/verify_all.py +327 -0
- package/template/.agent/skills/adr/SKILL.md +282 -0
- package/template/.agent/skills/alirezarezvani-code-to-prd/SKILL.md +499 -0
- package/template/.agent/skills/api-patterns/SKILL.md +81 -0
- package/template/.agent/skills/api-patterns/api-style.md +42 -0
- package/template/.agent/skills/api-patterns/auth.md +24 -0
- package/template/.agent/skills/api-patterns/documentation.md +26 -0
- package/template/.agent/skills/api-patterns/graphql.md +41 -0
- package/template/.agent/skills/api-patterns/rate-limiting.md +31 -0
- package/template/.agent/skills/api-patterns/response.md +37 -0
- package/template/.agent/skills/api-patterns/rest.md +40 -0
- package/template/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
- package/template/.agent/skills/api-patterns/security-testing.md +122 -0
- package/template/.agent/skills/api-patterns/trpc.md +41 -0
- package/template/.agent/skills/api-patterns/versioning.md +22 -0
- package/template/.agent/skills/app-builder/SKILL.md +75 -0
- package/template/.agent/skills/app-builder/agent-coordination.md +71 -0
- package/template/.agent/skills/app-builder/feature-building.md +53 -0
- package/template/.agent/skills/app-builder/project-detection.md +34 -0
- package/template/.agent/skills/app-builder/scaffolding.md +118 -0
- package/template/.agent/skills/app-builder/tech-stack.md +41 -0
- package/template/.agent/skills/app-builder/templates/SKILL.md +39 -0
- package/template/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/template/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/template/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/template/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/template/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/template/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/template/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/template/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
- package/template/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
- package/template/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
- package/template/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
- package/template/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/template/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
- package/template/.agent/skills/architecture/SKILL.md +55 -0
- package/template/.agent/skills/architecture/context-discovery.md +43 -0
- package/template/.agent/skills/architecture/examples.md +94 -0
- package/template/.agent/skills/architecture/pattern-selection.md +68 -0
- package/template/.agent/skills/architecture/patterns-reference.md +50 -0
- package/template/.agent/skills/architecture/trade-off-analysis.md +77 -0
- package/template/.agent/skills/bash-linux/SKILL.md +199 -0
- package/template/.agent/skills/behavioral-modes/SKILL.md +242 -0
- package/template/.agent/skills/brainstorming/SKILL.md +163 -0
- package/template/.agent/skills/brainstorming/dynamic-questioning.md +350 -0
- package/template/.agent/skills/claudekit-ai-multimodal/SKILL.md +353 -0
- package/template/.agent/skills/clean-code/SKILL.md +201 -0
- package/template/.agent/skills/code-review-checklist/SKILL.md +109 -0
- package/template/.agent/skills/database-design/SKILL.md +52 -0
- package/template/.agent/skills/database-design/database-selection.md +43 -0
- package/template/.agent/skills/database-design/indexing.md +39 -0
- package/template/.agent/skills/database-design/migrations.md +48 -0
- package/template/.agent/skills/database-design/optimization.md +36 -0
- package/template/.agent/skills/database-design/orm-selection.md +30 -0
- package/template/.agent/skills/database-design/schema-design.md +56 -0
- package/template/.agent/skills/database-design/scripts/schema_validator.py +172 -0
- package/template/.agent/skills/deployment-procedures/SKILL.md +241 -0
- package/template/.agent/skills/doc.md +177 -0
- package/template/.agent/skills/document/SKILL.md +250 -0
- package/template/.agent/skills/documentation-templates/SKILL.md +194 -0
- package/template/.agent/skills/frontend-design/SKILL.md +452 -0
- package/template/.agent/skills/frontend-design/animation-guide.md +331 -0
- package/template/.agent/skills/frontend-design/color-system.md +311 -0
- package/template/.agent/skills/frontend-design/decision-trees.md +418 -0
- package/template/.agent/skills/frontend-design/motion-graphics.md +306 -0
- package/template/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/template/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/template/.agent/skills/frontend-design/typography-system.md +345 -0
- package/template/.agent/skills/frontend-design/ux-psychology.md +1116 -0
- package/template/.agent/skills/frontend-design/visual-effects.md +383 -0
- package/template/.agent/skills/game-development/2d-games/SKILL.md +119 -0
- package/template/.agent/skills/game-development/3d-games/SKILL.md +135 -0
- package/template/.agent/skills/game-development/SKILL.md +167 -0
- package/template/.agent/skills/game-development/game-art/SKILL.md +185 -0
- package/template/.agent/skills/game-development/game-audio/SKILL.md +190 -0
- package/template/.agent/skills/game-development/game-design/SKILL.md +129 -0
- package/template/.agent/skills/game-development/mobile-games/SKILL.md +108 -0
- package/template/.agent/skills/game-development/multiplayer/SKILL.md +132 -0
- package/template/.agent/skills/game-development/pc-games/SKILL.md +144 -0
- package/template/.agent/skills/game-development/vr-ar/SKILL.md +123 -0
- package/template/.agent/skills/game-development/web-games/SKILL.md +150 -0
- package/template/.agent/skills/geo-fundamentals/SKILL.md +156 -0
- package/template/.agent/skills/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/template/.agent/skills/i18n-localization/SKILL.md +154 -0
- package/template/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/template/.agent/skills/intelligent-routing/SKILL.md +335 -0
- package/template/.agent/skills/lint-and-validate/SKILL.md +45 -0
- package/template/.agent/skills/lint-and-validate/scripts/lint_runner.py +184 -0
- package/template/.agent/skills/lint-and-validate/scripts/type_coverage.py +173 -0
- package/template/.agent/skills/mcp-builder/SKILL.md +176 -0
- package/template/.agent/skills/mindrally-meta-prompt/SKILL.md +129 -0
- package/template/.agent/skills/mobile-design/SKILL.md +394 -0
- package/template/.agent/skills/mobile-design/decision-trees.md +516 -0
- package/template/.agent/skills/mobile-design/mobile-backend.md +491 -0
- package/template/.agent/skills/mobile-design/mobile-color-system.md +420 -0
- package/template/.agent/skills/mobile-design/mobile-debugging.md +122 -0
- package/template/.agent/skills/mobile-design/mobile-design-thinking.md +357 -0
- package/template/.agent/skills/mobile-design/mobile-navigation.md +458 -0
- package/template/.agent/skills/mobile-design/mobile-performance.md +767 -0
- package/template/.agent/skills/mobile-design/mobile-testing.md +356 -0
- package/template/.agent/skills/mobile-design/mobile-typography.md +433 -0
- package/template/.agent/skills/mobile-design/platform-android.md +666 -0
- package/template/.agent/skills/mobile-design/platform-ios.md +561 -0
- package/template/.agent/skills/mobile-design/scripts/mobile_audit.py +670 -0
- package/template/.agent/skills/mobile-design/touch-psychology.md +537 -0
- package/template/.agent/skills/nextjs-react-expert/1-async-eliminating-waterfalls.md +351 -0
- package/template/.agent/skills/nextjs-react-expert/2-bundle-bundle-size-optimization.md +240 -0
- package/template/.agent/skills/nextjs-react-expert/3-server-server-side-performance.md +490 -0
- package/template/.agent/skills/nextjs-react-expert/4-client-client-side-data-fetching.md +264 -0
- package/template/.agent/skills/nextjs-react-expert/5-rerender-re-render-optimization.md +581 -0
- package/template/.agent/skills/nextjs-react-expert/6-rendering-rendering-performance.md +432 -0
- package/template/.agent/skills/nextjs-react-expert/7-js-javascript-performance.md +684 -0
- package/template/.agent/skills/nextjs-react-expert/8-advanced-advanced-patterns.md +150 -0
- package/template/.agent/skills/nextjs-react-expert/9-cache-components.md +103 -0
- package/template/.agent/skills/nextjs-react-expert/SKILL.md +293 -0
- package/template/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +222 -0
- package/template/.agent/skills/nextjs-react-expert/scripts/react_performance_checker.py +252 -0
- package/template/.agent/skills/nodejs-best-practices/SKILL.md +333 -0
- package/template/.agent/skills/parallel-agents/SKILL.md +175 -0
- package/template/.agent/skills/performance-profiling/SKILL.md +143 -0
- package/template/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/template/.agent/skills/plan-writing/SKILL.md +152 -0
- package/template/.agent/skills/pm-skills-create-prd/SKILL.md +88 -0
- package/template/.agent/skills/powershell-windows/SKILL.md +167 -0
- package/template/.agent/skills/prompt-engineering/SKILL.md +566 -0
- package/template/.agent/skills/python-patterns/SKILL.md +441 -0
- package/template/.agent/skills/red-team-tactics/SKILL.md +199 -0
- package/template/.agent/skills/rust-pro/SKILL.md +176 -0
- package/template/.agent/skills/seo-fundamentals/SKILL.md +129 -0
- package/template/.agent/skills/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/template/.agent/skills/server-management/SKILL.md +161 -0
- package/template/.agent/skills/skills/adr/SKILL.md +282 -0
- package/template/.agent/skills/skills/alirezarezvani-code-to-prd/SKILL.md +499 -0
- package/template/.agent/skills/skills/claudekit-ai-multimodal/SKILL.md +353 -0
- package/template/.agent/skills/skills/document/SKILL.md +250 -0
- package/template/.agent/skills/skills/mindrally-meta-prompt/SKILL.md +129 -0
- package/template/.agent/skills/skills/pm-skills-create-prd/SKILL.md +88 -0
- package/template/.agent/skills/skills/prompt-engineering/SKILL.md +566 -0
- package/template/.agent/skills/systematic-debugging/SKILL.md +109 -0
- package/template/.agent/skills/tailwind-patterns/SKILL.md +269 -0
- package/template/.agent/skills/tdd-workflow/SKILL.md +149 -0
- package/template/.agent/skills/testing-patterns/SKILL.md +178 -0
- package/template/.agent/skills/testing-patterns/scripts/test_runner.py +219 -0
- package/template/.agent/skills/vulnerability-scanner/SKILL.md +276 -0
- package/template/.agent/skills/vulnerability-scanner/checklists.md +121 -0
- package/template/.agent/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/template/.agent/skills/web-design-guidelines/SKILL.md +57 -0
- package/template/.agent/skills/webapp-testing/SKILL.md +187 -0
- package/template/.agent/skills/webapp-testing/scripts/playwright_runner.py +173 -0
- package/template/.agent/skills/zalo-mini-app/SKILL.md +81 -0
- package/template/.agent/skills/zalo-mini-app/references/api-device.md +121 -0
- package/template/.agent/skills/zalo-mini-app/references/api-overview.md +88 -0
- package/template/.agent/skills/zalo-mini-app/references/api-storage.md +74 -0
- package/template/.agent/skills/zalo-mini-app/references/api-ui.md +124 -0
- package/template/.agent/skills/zalo-mini-app/references/api-user.md +113 -0
- package/template/.agent/skills/zalo-mini-app/references/api-zalo.md +127 -0
- package/template/.agent/skills/zalo-mini-app/references/design-guidelines.md +70 -0
- package/template/.agent/skills/zalo-mini-app/references/getting-started.md +95 -0
- package/template/.agent/skills/zalo-mini-app/references/react-best-practices.md +790 -0
- package/template/.agent/skills/zalo-mini-app/references/web-design-guidelines.md +591 -0
- package/template/.agent/skills/zalo-mini-app/references/zaui-display.md +103 -0
- package/template/.agent/skills/zalo-mini-app/references/zaui-form.md +108 -0
- package/template/.agent/skills/zalo-mini-app/references/zaui-layout.md +94 -0
- package/template/.agent/skills/zalo-mini-app/references/zaui-overlay.md +98 -0
- package/template/.agent/skills/zalo-mini-app/references/zaui-overview.md +82 -0
- package/template/.agent/workflows/brainstorm.md +113 -0
- package/template/.agent/workflows/create.md +59 -0
- package/template/.agent/workflows/debug.md +103 -0
- package/template/.agent/workflows/deploy.md +176 -0
- package/template/.agent/workflows/enhance.md +63 -0
- package/template/.agent/workflows/orchestrate.md +237 -0
- package/template/.agent/workflows/plan.md +89 -0
- package/template/.agent/workflows/preview.md +81 -0
- package/template/.agent/workflows/status.md +86 -0
- package/template/.agent/workflows/test.md +144 -0
- package/template/.agent/workflows/ui-ux-pro-max.md +296 -0
- package/template/.agent/workflows/veo-marketing.md +46 -0
|
@@ -0,0 +1,591 @@
|
|
|
1
|
+
# Web Design Guidelines for Zalo Mini Apps
|
|
2
|
+
|
|
3
|
+
Comprehensive UI/UX guidelines combining Web Interface best practices with Zalo Mini App platform requirements.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Core Principles
|
|
8
|
+
|
|
9
|
+
1. **Accessibility First** - Semantic HTML, keyboard navigation, screen reader support
|
|
10
|
+
2. **Performance-Conscious** - Fast load times (<3s), bundle size <10MB
|
|
11
|
+
3. **Mobile-Ready** - Touch interactions, safe areas, responsive layouts
|
|
12
|
+
4. **URL Reflects State** - Deep linking, shareable states
|
|
13
|
+
5. **Zalo Platform Aligned** - Follow Zalo design tokens, navigation patterns
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Accessibility Rules
|
|
18
|
+
|
|
19
|
+
### Interactive Elements
|
|
20
|
+
|
|
21
|
+
- Icon-only buttons require `aria-label`
|
|
22
|
+
- Form controls need `<label>` or `aria-label`
|
|
23
|
+
- Interactive elements need keyboard handlers (`onKeyDown`/`onKeyUp`)
|
|
24
|
+
- Use `<button>` for actions, `<a>`/`<Link>` for navigation (never `<div onClick>`)
|
|
25
|
+
- Decorative icons need `aria-hidden="true"`
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
// Incorrect
|
|
29
|
+
<div onClick={handleClick}>Click me</div>
|
|
30
|
+
<Icon icon="zi-home" />
|
|
31
|
+
|
|
32
|
+
// Correct
|
|
33
|
+
<button onClick={handleClick}>Click me</button>
|
|
34
|
+
<Icon icon="zi-home" aria-hidden="true" />
|
|
35
|
+
<button aria-label="Go home"><Icon icon="zi-home" /></button>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Images & Media
|
|
39
|
+
|
|
40
|
+
- Images need `alt` attribute (or `alt=""` if decorative)
|
|
41
|
+
- `<img>` needs explicit `width` and `height` (prevents CLS)
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
// Correct
|
|
45
|
+
<img src={avatar} alt="User avatar" width={48} height={48} />
|
|
46
|
+
<img src={decorative} alt="" width={100} height={100} />
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Live Regions
|
|
50
|
+
|
|
51
|
+
- Async updates (toasts, validation errors) need `aria-live="polite"`
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
<div aria-live="polite" role="status">
|
|
55
|
+
{errorMessage}
|
|
56
|
+
</div>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Structure
|
|
60
|
+
|
|
61
|
+
- Use semantic HTML (`<button>`, `<a>`, `<label>`, `<table>`) before ARIA
|
|
62
|
+
- Headings must be hierarchical `<h1>`-`<h6>`
|
|
63
|
+
- Add `scroll-margin-top` on heading anchors
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Focus States
|
|
68
|
+
|
|
69
|
+
- Interactive elements need visible focus: `focus-visible:ring-*` or equivalent
|
|
70
|
+
- Never `outline-none` / `outline: none` without focus replacement
|
|
71
|
+
- Use `:focus-visible` over `:focus` (avoids focus ring on click)
|
|
72
|
+
- Use `:focus-within` for compound controls
|
|
73
|
+
|
|
74
|
+
```css
|
|
75
|
+
/* Correct */
|
|
76
|
+
button:focus-visible {
|
|
77
|
+
outline: 2px solid var(--zmp-primary-color);
|
|
78
|
+
outline-offset: 2px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Never */
|
|
82
|
+
button:focus {
|
|
83
|
+
outline: none;
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Forms
|
|
90
|
+
|
|
91
|
+
### Input Configuration
|
|
92
|
+
|
|
93
|
+
- Inputs need `autocomplete` and meaningful `name`
|
|
94
|
+
- Use correct `type` (`email`, `tel`, `url`, `number`) and `inputmode`
|
|
95
|
+
- Disable spellcheck on emails, codes, usernames (`spellCheck={false}`)
|
|
96
|
+
- Use `autocomplete="off"` on non-auth fields to avoid password manager triggers
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
<Input
|
|
100
|
+
type="tel"
|
|
101
|
+
name="phone"
|
|
102
|
+
inputMode="numeric"
|
|
103
|
+
autoComplete="tel"
|
|
104
|
+
label="Phone Number"
|
|
105
|
+
/>
|
|
106
|
+
|
|
107
|
+
<Input
|
|
108
|
+
type="text"
|
|
109
|
+
name="otp"
|
|
110
|
+
inputMode="numeric"
|
|
111
|
+
autoComplete="one-time-code"
|
|
112
|
+
spellCheck={false}
|
|
113
|
+
/>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Labels & Interaction
|
|
117
|
+
|
|
118
|
+
- Labels must be clickable (`htmlFor` or wrapping control)
|
|
119
|
+
- Checkboxes/radios: label + control share single hit target (no dead zones)
|
|
120
|
+
- Never block paste (`onPaste` + `preventDefault`)
|
|
121
|
+
|
|
122
|
+
### Submit & Validation
|
|
123
|
+
|
|
124
|
+
- Submit button stays enabled until request starts; show spinner during request
|
|
125
|
+
- Display errors inline next to fields
|
|
126
|
+
- Focus first error on submit
|
|
127
|
+
- Warn before navigation with unsaved changes
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
// Zalo Mini App pattern with ZaUI
|
|
131
|
+
<Button loading={isSubmitting} onClick={handleSubmit}>
|
|
132
|
+
{isSubmitting ? "Saving..." : "Save"}
|
|
133
|
+
</Button>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Placeholders
|
|
137
|
+
|
|
138
|
+
- End with `...` and show example pattern: `"Enter phone number..."`
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Animation
|
|
143
|
+
|
|
144
|
+
### Performance
|
|
145
|
+
|
|
146
|
+
- Honor `prefers-reduced-motion` (provide reduced variant or disable)
|
|
147
|
+
- Animate `transform`/`opacity` only (compositor-friendly)
|
|
148
|
+
- Never `transition: all`-list properties explicitly
|
|
149
|
+
- Set correct `transform-origin`
|
|
150
|
+
|
|
151
|
+
```css
|
|
152
|
+
/* Incorrect */
|
|
153
|
+
.card {
|
|
154
|
+
transition: all 0.3s ease;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* Correct */
|
|
158
|
+
.card {
|
|
159
|
+
transition: transform 0.3s ease, opacity 0.3s ease;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@media (prefers-reduced-motion: reduce) {
|
|
163
|
+
.card {
|
|
164
|
+
transition: none;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### SVG Animation
|
|
170
|
+
|
|
171
|
+
- Transforms on `<g>` wrapper with `transform-box: fill-box; transform-origin: center`
|
|
172
|
+
- Wrap SVG in div for hardware acceleration
|
|
173
|
+
|
|
174
|
+
```tsx
|
|
175
|
+
// Incorrect: no hardware acceleration
|
|
176
|
+
<svg className="animate-spin">
|
|
177
|
+
<circle cx="12" cy="12" r="10" />
|
|
178
|
+
</svg>
|
|
179
|
+
|
|
180
|
+
// Correct: hardware accelerated
|
|
181
|
+
<div className="animate-spin">
|
|
182
|
+
<svg>
|
|
183
|
+
<circle cx="12" cy="12" r="10" />
|
|
184
|
+
</svg>
|
|
185
|
+
</div>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Interruptibility
|
|
189
|
+
|
|
190
|
+
- Animations must be interruptible-respond to user input mid-animation
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Typography
|
|
195
|
+
|
|
196
|
+
### Character Usage
|
|
197
|
+
|
|
198
|
+
- Use `...` not `...` (ellipsis character)
|
|
199
|
+
- Use curly quotes `"` `"` not straight `"`
|
|
200
|
+
- Non-breaking spaces: `10 MB`, brand names
|
|
201
|
+
|
|
202
|
+
### Loading States
|
|
203
|
+
|
|
204
|
+
- End with `...`: `"Loading..."`, `"Saving..."`
|
|
205
|
+
|
|
206
|
+
### Number Formatting
|
|
207
|
+
|
|
208
|
+
- Use `font-variant-numeric: tabular-nums` for number columns/comparisons
|
|
209
|
+
- Use `Intl.NumberFormat` not hardcoded formats
|
|
210
|
+
|
|
211
|
+
```tsx
|
|
212
|
+
// Correct
|
|
213
|
+
const formatter = new Intl.NumberFormat('vi-VN', {
|
|
214
|
+
style: 'currency',
|
|
215
|
+
currency: 'VND'
|
|
216
|
+
});
|
|
217
|
+
formatter.format(1000000); // "1.000.000 ₫"
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Zalo Typography Scale
|
|
221
|
+
|
|
222
|
+
| Type | Size | Weight |
|
|
223
|
+
|------|------|--------|
|
|
224
|
+
| Title | 20px | Bold |
|
|
225
|
+
| Subtitle | 16px | Medium |
|
|
226
|
+
| Body | 14px | Regular |
|
|
227
|
+
| Caption | 12px | Regular |
|
|
228
|
+
|
|
229
|
+
### Text Wrapping
|
|
230
|
+
|
|
231
|
+
- Use `text-wrap: balance` or `text-pretty` on headings (prevents widows)
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Content Handling
|
|
236
|
+
|
|
237
|
+
- Text containers must handle long content: `truncate`, `line-clamp-*`, or `break-words`
|
|
238
|
+
- Flex children need `min-w-0` to allow text truncation
|
|
239
|
+
- Handle empty states-never render broken UI for empty strings/arrays
|
|
240
|
+
- User-generated content: anticipate short, average, and very long inputs
|
|
241
|
+
|
|
242
|
+
```css
|
|
243
|
+
.truncate {
|
|
244
|
+
overflow: hidden;
|
|
245
|
+
text-overflow: ellipsis;
|
|
246
|
+
white-space: nowrap;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.line-clamp-2 {
|
|
250
|
+
display: -webkit-box;
|
|
251
|
+
-webkit-line-clamp: 2;
|
|
252
|
+
-webkit-box-orient: vertical;
|
|
253
|
+
overflow: hidden;
|
|
254
|
+
}
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Images
|
|
260
|
+
|
|
261
|
+
- `<img>` needs explicit `width` and `height` (prevents CLS)
|
|
262
|
+
- Below-fold images: `loading="lazy"`
|
|
263
|
+
- Above-fold critical images: `fetchpriority="high"`
|
|
264
|
+
|
|
265
|
+
```tsx
|
|
266
|
+
// Hero image
|
|
267
|
+
<img src={hero} alt="Banner" width={375} height={200} fetchpriority="high" />
|
|
268
|
+
|
|
269
|
+
// Below fold
|
|
270
|
+
<img src={product} alt="Product" width={120} height={120} loading="lazy" />
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Performance
|
|
276
|
+
|
|
277
|
+
### Large Lists
|
|
278
|
+
|
|
279
|
+
- Lists >50 items: virtualize (`virtua`, `content-visibility: auto`)
|
|
280
|
+
|
|
281
|
+
```css
|
|
282
|
+
.message-item {
|
|
283
|
+
content-visibility: auto;
|
|
284
|
+
contain-intrinsic-size: 0 80px;
|
|
285
|
+
}
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### DOM Operations
|
|
289
|
+
|
|
290
|
+
- No layout reads in render (`getBoundingClientRect`, `offsetHeight`, `offsetWidth`, `scrollTop`)
|
|
291
|
+
- Batch DOM reads/writes; avoid interleaving
|
|
292
|
+
|
|
293
|
+
### Inputs
|
|
294
|
+
|
|
295
|
+
- Prefer uncontrolled inputs
|
|
296
|
+
- Controlled inputs must be cheap per keystroke
|
|
297
|
+
|
|
298
|
+
### Resource Loading
|
|
299
|
+
|
|
300
|
+
- Add `<link rel="preconnect">` for CDN/asset domains
|
|
301
|
+
- Critical fonts: `<link rel="preload" as="font">` with `font-display: swap`
|
|
302
|
+
|
|
303
|
+
### Zalo Mini App Limits
|
|
304
|
+
|
|
305
|
+
- Bundle size: <10MB
|
|
306
|
+
- First load: <3 seconds
|
|
307
|
+
- Optimize images, lazy load non-critical assets
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## Navigation & State
|
|
312
|
+
|
|
313
|
+
- URL reflects state-filters, tabs, pagination, expanded panels in query params
|
|
314
|
+
- Links use `<a>`/`<Link>` (enables Cmd/Ctrl+click, middle-click)
|
|
315
|
+
- Deep-link all stateful UI
|
|
316
|
+
- Destructive actions need confirmation modal or undo window-never immediate
|
|
317
|
+
|
|
318
|
+
### Zalo Navigation Patterns
|
|
319
|
+
|
|
320
|
+
- Fixed header with back/home button on left
|
|
321
|
+
- Menu button (fixed by Zalo) on top right-don't place elements under it
|
|
322
|
+
- Bottom navigation: max 4 tabs, main sections only
|
|
323
|
+
|
|
324
|
+
```tsx
|
|
325
|
+
<App>
|
|
326
|
+
<Page>
|
|
327
|
+
<Header title="Products" showBackIcon />
|
|
328
|
+
<Box className="content">{/* content */}</Box>
|
|
329
|
+
</Page>
|
|
330
|
+
<BottomNavigation fixed>
|
|
331
|
+
<BottomNavigation.Item key="home" label="Home" icon={<Icon icon="zi-home" />} />
|
|
332
|
+
<BottomNavigation.Item key="cart" label="Cart" icon={<Icon icon="zi-cart" />} />
|
|
333
|
+
</BottomNavigation>
|
|
334
|
+
</App>
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## Touch & Interaction
|
|
340
|
+
|
|
341
|
+
- Use `touch-action: manipulation` (prevents double-tap zoom delay)
|
|
342
|
+
- Set `-webkit-tap-highlight-color` intentionally
|
|
343
|
+
- Use `overscroll-behavior: contain` in modals/drawers/sheets
|
|
344
|
+
- During drag: disable text selection, add `inert` on dragged elements
|
|
345
|
+
- Use `autoFocus` sparingly-desktop only, single primary input; avoid on mobile
|
|
346
|
+
|
|
347
|
+
```css
|
|
348
|
+
/* Zalo Mini App touch optimization */
|
|
349
|
+
button, a, [role="button"] {
|
|
350
|
+
touch-action: manipulation;
|
|
351
|
+
-webkit-tap-highlight-color: rgba(0, 106, 245, 0.1);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.modal-content {
|
|
355
|
+
overscroll-behavior: contain;
|
|
356
|
+
}
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
## Safe Areas & Layout
|
|
362
|
+
|
|
363
|
+
- Full-bleed layouts need `env(safe-area-inset-*)` for notches
|
|
364
|
+
- Avoid unwanted scrollbars: `overflow-x-hidden` on containers
|
|
365
|
+
- Prefer flex/grid over JS measurement for layout
|
|
366
|
+
|
|
367
|
+
```css
|
|
368
|
+
.bottom-bar {
|
|
369
|
+
padding-bottom: calc(16px + env(safe-area-inset-bottom));
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.page-container {
|
|
373
|
+
padding-left: env(safe-area-inset-left);
|
|
374
|
+
padding-right: env(safe-area-inset-right);
|
|
375
|
+
}
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
## Dark Mode & Theming
|
|
381
|
+
|
|
382
|
+
- Add `color-scheme: dark` on `<html>` for dark themes
|
|
383
|
+
- `<meta name="theme-color">` should match page background
|
|
384
|
+
- Native `<select>`: set explicit `background-color` and `color`
|
|
385
|
+
|
|
386
|
+
### Zalo Color Tokens
|
|
387
|
+
|
|
388
|
+
| Type | Light | Usage |
|
|
389
|
+
|------|-------|-------|
|
|
390
|
+
| Primary | #006AF5 | Actions, links |
|
|
391
|
+
| Success | #00C853 | Confirmations |
|
|
392
|
+
| Warning | #FFA000 | Cautions |
|
|
393
|
+
| Error | #FF3B30 | Errors |
|
|
394
|
+
| Text Primary | #141415 | Main text |
|
|
395
|
+
| Text Secondary | #767A7F | Secondary text |
|
|
396
|
+
| Background | #F4F5F6 | Page background |
|
|
397
|
+
|
|
398
|
+
---
|
|
399
|
+
|
|
400
|
+
## Locale & i18n
|
|
401
|
+
|
|
402
|
+
- Dates/times: use `Intl.DateTimeFormat` not hardcoded formats
|
|
403
|
+
- Numbers/currency: use `Intl.NumberFormat` not hardcoded formats
|
|
404
|
+
- Detect language via `navigator.languages`, not IP
|
|
405
|
+
|
|
406
|
+
```tsx
|
|
407
|
+
// Vietnamese date formatting
|
|
408
|
+
const dateFormatter = new Intl.DateTimeFormat('vi-VN', {
|
|
409
|
+
year: 'numeric',
|
|
410
|
+
month: 'long',
|
|
411
|
+
day: 'numeric'
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
// Currency
|
|
415
|
+
const currencyFormatter = new Intl.NumberFormat('vi-VN', {
|
|
416
|
+
style: 'currency',
|
|
417
|
+
currency: 'VND'
|
|
418
|
+
});
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
## Hydration Safety
|
|
424
|
+
|
|
425
|
+
- Inputs with `value` need `onChange` (or use `defaultValue` for uncontrolled)
|
|
426
|
+
- Date/time rendering: guard against hydration mismatch (server vs client)
|
|
427
|
+
- Use `suppressHydrationWarning` only where truly needed
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
## Hover & Interactive States
|
|
432
|
+
|
|
433
|
+
- Buttons/links need `hover:` state (visual feedback)
|
|
434
|
+
- Interactive states increase contrast: hover/active/focus more prominent than rest
|
|
435
|
+
|
|
436
|
+
```css
|
|
437
|
+
.btn-primary {
|
|
438
|
+
background: var(--zmp-primary-color);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.btn-primary:hover {
|
|
442
|
+
background: #0055cc;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.btn-primary:active {
|
|
446
|
+
background: #004099;
|
|
447
|
+
}
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
## Content & Copy
|
|
453
|
+
|
|
454
|
+
### Voice & Style
|
|
455
|
+
|
|
456
|
+
- Active voice: "Install the app" not "The app will be installed"
|
|
457
|
+
- Title Case for headings/buttons
|
|
458
|
+
- Numerals for counts: "8 items" not "eight items"
|
|
459
|
+
- Second person; avoid first person
|
|
460
|
+
|
|
461
|
+
### Specificity
|
|
462
|
+
|
|
463
|
+
- Specific button labels: "Save Order" not "Continue"
|
|
464
|
+
- Error messages include fix/next step, not just problem
|
|
465
|
+
|
|
466
|
+
---
|
|
467
|
+
|
|
468
|
+
## Loading & Feedback States
|
|
469
|
+
|
|
470
|
+
### Zalo Loading Patterns
|
|
471
|
+
|
|
472
|
+
1. **Splash Loading** - Initial app load (auto by Zalo)
|
|
473
|
+
2. **Progress Bar** - Below action bar for page loads
|
|
474
|
+
3. **Modal Loading** - Full overlay for operations
|
|
475
|
+
|
|
476
|
+
### Feedback
|
|
477
|
+
|
|
478
|
+
- Show toast for success/error states
|
|
479
|
+
- Provide empty states for no content
|
|
480
|
+
- Show error states with retry options
|
|
481
|
+
|
|
482
|
+
```tsx
|
|
483
|
+
import { showToast } from 'zmp-sdk/apis';
|
|
484
|
+
|
|
485
|
+
// Success feedback
|
|
486
|
+
showToast({ message: 'Order placed successfully' });
|
|
487
|
+
|
|
488
|
+
// Error with retry
|
|
489
|
+
<Box className="empty-state">
|
|
490
|
+
<Text>Failed to load</Text>
|
|
491
|
+
<Button onClick={retry}>Try Again</Button>
|
|
492
|
+
</Box>
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
---
|
|
496
|
+
|
|
497
|
+
## Zalo Design Tokens
|
|
498
|
+
|
|
499
|
+
### Spacing
|
|
500
|
+
|
|
501
|
+
Base unit: 4px (U1)
|
|
502
|
+
- Component padding: 12-16px
|
|
503
|
+
- Section spacing: 24px
|
|
504
|
+
- Screen margin: 16px
|
|
505
|
+
|
|
506
|
+
### Corner Radius
|
|
507
|
+
|
|
508
|
+
- Buttons: 8px
|
|
509
|
+
- Cards: 12px
|
|
510
|
+
- Modals: 16px
|
|
511
|
+
- Avatar: 20% of width
|
|
512
|
+
|
|
513
|
+
---
|
|
514
|
+
|
|
515
|
+
## Anti-patterns (Flag These)
|
|
516
|
+
|
|
517
|
+
### Critical
|
|
518
|
+
|
|
519
|
+
- `user-scalable=no` or `maximum-scale=1` disabling zoom
|
|
520
|
+
- `onPaste` with `preventDefault`
|
|
521
|
+
- `transition: all`
|
|
522
|
+
- `outline-none` without focus-visible replacement
|
|
523
|
+
- Inline `onClick` navigation without `<a>`
|
|
524
|
+
- `<div>` or `<span>` with click handlers (should be `<button>`)
|
|
525
|
+
|
|
526
|
+
### Images & Performance
|
|
527
|
+
|
|
528
|
+
- Images without dimensions
|
|
529
|
+
- Large arrays `.map()` without virtualization
|
|
530
|
+
- Layout reads in render (`getBoundingClientRect`)
|
|
531
|
+
|
|
532
|
+
### Accessibility
|
|
533
|
+
|
|
534
|
+
- Form inputs without labels
|
|
535
|
+
- Icon buttons without `aria-label`
|
|
536
|
+
- Missing `prefers-reduced-motion` handling
|
|
537
|
+
|
|
538
|
+
### Formatting
|
|
539
|
+
|
|
540
|
+
- Hardcoded date/number formats (use `Intl.*`)
|
|
541
|
+
- `autoFocus` without clear justification
|
|
542
|
+
|
|
543
|
+
---
|
|
544
|
+
|
|
545
|
+
## Review Checklist
|
|
546
|
+
|
|
547
|
+
### Accessibility
|
|
548
|
+
- [ ] All interactive elements keyboard accessible
|
|
549
|
+
- [ ] Icon buttons have `aria-label`
|
|
550
|
+
- [ ] Form inputs have labels
|
|
551
|
+
- [ ] Images have alt text
|
|
552
|
+
- [ ] Focus states visible
|
|
553
|
+
|
|
554
|
+
### Performance
|
|
555
|
+
- [ ] Bundle size <10MB
|
|
556
|
+
- [ ] Images have width/height
|
|
557
|
+
- [ ] Large lists virtualized
|
|
558
|
+
- [ ] No `transition: all`
|
|
559
|
+
|
|
560
|
+
### Touch & Mobile
|
|
561
|
+
- [ ] Touch targets minimum 44x44px
|
|
562
|
+
- [ ] Safe areas handled
|
|
563
|
+
- [ ] `touch-action: manipulation` on buttons
|
|
564
|
+
|
|
565
|
+
### Zalo Platform
|
|
566
|
+
- [ ] Header follows Zalo patterns
|
|
567
|
+
- [ ] Bottom nav max 4 items
|
|
568
|
+
- [ ] Colors match Zalo tokens
|
|
569
|
+
- [ ] Loading states implemented
|
|
570
|
+
|
|
571
|
+
---
|
|
572
|
+
|
|
573
|
+
## Output Format (For Code Reviews)
|
|
574
|
+
|
|
575
|
+
Group findings by file using `file:line` format. Be terse.
|
|
576
|
+
|
|
577
|
+
```text
|
|
578
|
+
## src/components/Button.tsx
|
|
579
|
+
|
|
580
|
+
src/components/Button.tsx:42 - icon button missing aria-label
|
|
581
|
+
src/components/Button.tsx:55 - animation missing prefers-reduced-motion
|
|
582
|
+
|
|
583
|
+
## src/pages/Home.tsx
|
|
584
|
+
|
|
585
|
+
src/pages/Home.tsx:12 - image missing width/height
|
|
586
|
+
src/pages/Home.tsx:34 - "..." -> "..."
|
|
587
|
+
|
|
588
|
+
## src/components/Card.tsx
|
|
589
|
+
|
|
590
|
+
Pass
|
|
591
|
+
```
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# ZaUI Display Components
|
|
2
|
+
|
|
3
|
+
## Avatar
|
|
4
|
+
User avatar display.
|
|
5
|
+
```jsx
|
|
6
|
+
import { Avatar } from "zmp-ui";
|
|
7
|
+
|
|
8
|
+
<Avatar src="https://example.com/avatar.jpg" size={48} />
|
|
9
|
+
<Avatar online story>U</Avatar>
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Props: `src`, `size`, `online`, `story`
|
|
13
|
+
|
|
14
|
+
## Calendar
|
|
15
|
+
Date calendar display (for date selection use DatePicker).
|
|
16
|
+
```jsx
|
|
17
|
+
import { Calendar } from "zmp-ui";
|
|
18
|
+
|
|
19
|
+
<Calendar
|
|
20
|
+
defaultValue={new Date()}
|
|
21
|
+
onSelect={(date) => console.log(date)}
|
|
22
|
+
disabledDate={(date) => date < new Date()}
|
|
23
|
+
/>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Icon
|
|
27
|
+
Zalo icon library.
|
|
28
|
+
```jsx
|
|
29
|
+
import { Icon } from "zmp-ui";
|
|
30
|
+
|
|
31
|
+
<Icon icon="zi-home" size={24} />
|
|
32
|
+
<Icon icon="zi-user-solid" />
|
|
33
|
+
<Icon icon="zi-chevron-right" />
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Icon categories:
|
|
37
|
+
- Arrow: `zi-arrow-left`, `zi-chevron-down`
|
|
38
|
+
- Basic: `zi-home`, `zi-search`, `zi-plus`, `zi-close`
|
|
39
|
+
- User: `zi-user`, `zi-group`, `zi-add-user`
|
|
40
|
+
- Communication: `zi-chat`, `zi-call`, `zi-location`
|
|
41
|
+
- Media: `zi-camera`, `zi-photo`, `zi-video`
|
|
42
|
+
|
|
43
|
+
## ImageViewer
|
|
44
|
+
Fullscreen image gallery.
|
|
45
|
+
```jsx
|
|
46
|
+
import { ImageViewer } from "zmp-ui";
|
|
47
|
+
|
|
48
|
+
<ImageViewer images={["url1", "url2"]} visible onClose={() => {}} />
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## List
|
|
52
|
+
Structured list display.
|
|
53
|
+
```jsx
|
|
54
|
+
import { List } from "zmp-ui";
|
|
55
|
+
|
|
56
|
+
<List>
|
|
57
|
+
<List.Item title="Item 1" subtitle="Description" />
|
|
58
|
+
<List.Item
|
|
59
|
+
title="With Icon"
|
|
60
|
+
prefix={<Icon icon="zi-setting" />}
|
|
61
|
+
suffix={<Icon icon="zi-chevron-right" />}
|
|
62
|
+
/>
|
|
63
|
+
</List>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Progress
|
|
67
|
+
Progress indicator.
|
|
68
|
+
```jsx
|
|
69
|
+
import { Progress } from "zmp-ui";
|
|
70
|
+
|
|
71
|
+
<Progress percent={75} />
|
|
72
|
+
<Progress percent={50} strokeColor="#52c41a" />
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Spinner
|
|
76
|
+
Loading spinner.
|
|
77
|
+
```jsx
|
|
78
|
+
import { Spinner } from "zmp-ui";
|
|
79
|
+
|
|
80
|
+
<Spinner />
|
|
81
|
+
<Spinner visible logo />
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Swiper
|
|
85
|
+
Carousel/slider.
|
|
86
|
+
```jsx
|
|
87
|
+
import { Swiper } from "zmp-ui";
|
|
88
|
+
|
|
89
|
+
<Swiper autoplay duration={3000}>
|
|
90
|
+
<Swiper.Slide><img src="slide1.jpg" /></Swiper.Slide>
|
|
91
|
+
<Swiper.Slide><img src="slide2.jpg" /></Swiper.Slide>
|
|
92
|
+
</Swiper>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Text
|
|
96
|
+
Typography component.
|
|
97
|
+
```jsx
|
|
98
|
+
import { Text } from "zmp-ui";
|
|
99
|
+
|
|
100
|
+
<Text.Title>Heading</Text.Title>
|
|
101
|
+
<Text>Regular text</Text>
|
|
102
|
+
<Text size="small" bold>Small bold</Text>
|
|
103
|
+
```
|