@chenyqthu/tp-mobile-ui-kit 0.0.0-stage → 0.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.
Files changed (93) hide show
  1. package/README.md +214 -2
  2. package/dist/assets.js +5 -0
  3. package/dist/catalog.json +11125 -0
  4. package/dist/chunks/OmadaAppDemo-BP4a4ch_.js +4111 -0
  5. package/dist/chunks/TPPrompt-Csg5YasJ.js +2460 -0
  6. package/dist/chunks/asset-icons-BIenKvAh.js +7613 -0
  7. package/dist/chunks/asset-illustrations-YHXzEd7z.js +3086 -0
  8. package/dist/chunks/asset-logos-DAyGwOLj.js +59 -0
  9. package/dist/chunks/asset-motion-D7fWh_JS.js +376 -0
  10. package/dist/core.js +3 -0
  11. package/dist/index.js +7 -0
  12. package/dist/libpag.wasm +0 -0
  13. package/dist/omada.js +7 -0
  14. package/dist/standalone.js +3438 -0
  15. package/dist/style.css +2 -0
  16. package/dist/types/assets-lib/TPBrandLogo.d.ts +15 -0
  17. package/dist/types/assets-lib/TPIcon.d.ts +19 -0
  18. package/dist/types/assets-lib/TPIllustration.d.ts +17 -0
  19. package/dist/types/assets-lib/TPMotion.d.ts +25 -0
  20. package/dist/types/assets-lib/assetsManifest.d.ts +22 -0
  21. package/dist/types/assets-lib/iconsManifest.d.ts +14 -0
  22. package/dist/types/assets-lib/index.d.ts +8 -0
  23. package/dist/types/assets-lib/motionsManifest.d.ts +12 -0
  24. package/dist/types/assets-lib/runtimeUrl.d.ts +4 -0
  25. package/dist/types/core/components/TPActionSheet.d.ts +4 -0
  26. package/dist/types/core/components/TPAlert.d.ts +4 -0
  27. package/dist/types/core/components/TPBadge.d.ts +7 -0
  28. package/dist/types/core/components/TPBottomSheet.d.ts +4 -0
  29. package/dist/types/core/components/TPButton.d.ts +4 -0
  30. package/dist/types/core/components/TPDatePicker.d.ts +7 -0
  31. package/dist/types/core/components/TPDaySwitcher.d.ts +7 -0
  32. package/dist/types/core/components/TPEmptyState.d.ts +7 -0
  33. package/dist/types/core/components/TPFixedButtonBar.d.ts +4 -0
  34. package/dist/types/core/components/TPHeader.d.ts +4 -0
  35. package/dist/types/core/components/TPInput.d.ts +8 -0
  36. package/dist/types/core/components/TPKeyboard.d.ts +7 -0
  37. package/dist/types/core/components/TPListButton.d.ts +7 -0
  38. package/dist/types/core/components/TPListCard.d.ts +7 -0
  39. package/dist/types/core/components/TPListItem.d.ts +7 -0
  40. package/dist/types/core/components/TPMenu.d.ts +4 -0
  41. package/dist/types/core/components/TPPageControl.d.ts +4 -0
  42. package/dist/types/core/components/TPPhoneFrame.d.ts +4 -0
  43. package/dist/types/core/components/TPPopup.d.ts +4 -0
  44. package/dist/types/core/components/TPPrompt.d.ts +4 -0
  45. package/dist/types/core/components/TPSearchBar.d.ts +7 -0
  46. package/dist/types/core/components/TPSectionHeader.d.ts +7 -0
  47. package/dist/types/core/components/TPSectionNote.d.ts +7 -0
  48. package/dist/types/core/components/TPSegment.d.ts +4 -0
  49. package/dist/types/core/components/TPSlider.d.ts +4 -0
  50. package/dist/types/core/components/TPStatusBar.d.ts +4 -0
  51. package/dist/types/core/components/TPSwitch.d.ts +4 -0
  52. package/dist/types/core/components/TPTabBar.d.ts +4 -0
  53. package/dist/types/core/components/TPTag.d.ts +7 -0
  54. package/dist/types/core/components/TPText.d.ts +7 -0
  55. package/dist/types/core/components/TPTimePicker.d.ts +7 -0
  56. package/dist/types/core/components/TPToast.d.ts +13 -0
  57. package/dist/types/core/components/TPWheelPicker.d.ts +7 -0
  58. package/dist/types/core/index.d.ts +34 -0
  59. package/dist/types/core/types.d.ts +414 -0
  60. package/dist/types/lib/assets.d.ts +1 -0
  61. package/dist/types/lib/core.d.ts +2 -0
  62. package/dist/types/lib/index.d.ts +4 -0
  63. package/dist/types/lib/omada.d.ts +4 -0
  64. package/dist/types/lib/standalone.d.ts +8 -0
  65. package/dist/types/omada/blocks/OmadaDeviceListBlock.d.ts +42 -0
  66. package/dist/types/omada/blocks/OmadaIncidentsBlock.d.ts +26 -0
  67. package/dist/types/omada/blocks/OmadaWirelessNetworkBlock.d.ts +25 -0
  68. package/dist/types/omada/components/OmadaStandardInput.d.ts +23 -0
  69. package/dist/types/omada/index.d.ts +14 -0
  70. package/dist/types/omada/pages/OmadaAppDemo.d.ts +18 -0
  71. package/dist/types/omada/pages/OmadaControllerListPage.d.ts +26 -0
  72. package/dist/types/omada/pages/OmadaDeviceDetailPage.d.ts +15 -0
  73. package/dist/types/omada/pages/OmadaHealthDetailPage.d.ts +17 -0
  74. package/dist/types/omada/pages/OmadaLaunchLoadingPage.d.ts +24 -0
  75. package/dist/types/omada/pages/OmadaSiteClientsPage.d.ts +34 -0
  76. package/dist/types/omada/pages/OmadaSiteDashboardPage.d.ts +28 -0
  77. package/dist/types/omada/pages/OmadaSiteDevicesPage.d.ts +18 -0
  78. package/dist/types/omada/pages/OmadaSiteInsightsPage.d.ts +17 -0
  79. package/dist/types/omada/pages/OmadaSiteSettingsPage.d.ts +20 -0
  80. package/dist/types/theme/TPThemeProvider.d.ts +33 -0
  81. package/dist/types/theme/index.d.ts +2 -0
  82. package/dist/types/theme/tokens.d.ts +80 -0
  83. package/package.json +88 -4
  84. package/skills/tp-mobile-ui-kit/SKILL.md +225 -0
  85. package/skills/tp-mobile-ui-kit/references/catalog.json +11125 -0
  86. package/skills/tp-mobile-ui-kit/scripts/query-catalog.mjs +289 -0
  87. package/skills/tp-mobile-ui-kit/scripts/verify-demo.mjs +193 -0
  88. package/skills/tp-mobile-ui-kit/templates/multi-brand.html +319 -0
  89. package/skills/tp-mobile-ui-kit/templates/multi-brand.tsx +337 -0
  90. package/skills/tp-mobile-ui-kit/templates/omada-dashboard.html +138 -0
  91. package/skills/tp-mobile-ui-kit/templates/omada-dashboard.tsx +119 -0
  92. package/skills/tp-mobile-ui-kit/templates/omada-device-detail.html +158 -0
  93. package/skills/tp-mobile-ui-kit/templates/omada-device-detail.tsx +135 -0
@@ -0,0 +1,225 @@
1
+ ---
2
+ name: tp-mobile-ui-kit
3
+ description: >-
4
+ Build TP-Link multi-brand mobile React UI prototypes and Omada APP v5.3–6.3 screens
5
+ using @chenyqthu/tp-mobile-ui-kit (TP-Design 6-brand 12-mode theme engine, mobile TP*
6
+ primitives, 626 Figma icons, 42 Light/Dark illustrations, 16 brand logos, real Tencent
7
+ PAG .pag animations, and single-file zero-build HTML standalone bundle). Activate when
8
+ asked to build a TP-Link mobile UI demo, Omada/Tapo/Tether/Mercusys/Deco mobile mockup,
9
+ or single-file mobile prototype.
10
+ ---
11
+
12
+ # TP-Mobile UI Kit — Mobile Prototype & Omada APP Skill
13
+
14
+ Build authentic TP-Link mobile UI prototypes and **Omada APP v5.3–6.3** screens using verified exports from `@chenyqthu/tp-mobile-ui-kit` (run `node scripts/query-catalog.mjs info` to inspect active version, subpaths, and CDN URLs).
15
+
16
+ ---
17
+
18
+ ## 1. Choose the Output Format
19
+
20
+ | Need | Mode | Why |
21
+ | :--- | :--- | :--- |
22
+ | Shareable PRD demo, quick review, zero setup | **Single-File HTML** (`style.css` + `standalone.js` + `@babel/standalone`) | Opens directly via `file://` double-click or any static server |
23
+ | Multi-screen app, TypeScript checking, Vite | **React / Vite ESM** (`@chenyqthu/tp-mobile-ui-kit/core`, `/assets`, `/omada`) | Full ESM tree-shaking and `.d.ts` IntelliSense |
24
+
25
+ ---
26
+
27
+ ## 2. Mode A — Zero-Build Single-File HTML Starter
28
+
29
+ Use classic `<script>` tags (NOT `<script type="module">`) so local `file://` double-click works without CORS failures. Wrap the root UI with `<TPThemeProvider>` and `<TPToastProvider>`.
30
+
31
+ ```html
32
+ <!doctype html>
33
+ <html lang="en">
34
+ <head>
35
+ <meta charset="utf-8" />
36
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
37
+ <title>TP-Mobile UI Demo</title>
38
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@chenyqthu/tp-mobile-ui-kit@latest/dist/style.css" />
39
+ <script src="https://cdn.jsdelivr.net/npm/@chenyqthu/tp-mobile-ui-kit@latest/dist/standalone.js"></script>
40
+ <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
41
+ </head>
42
+ <body style="margin: 0;">
43
+ <div id="root"></div>
44
+ <script type="text/babel">
45
+ const { useState } = TPMobileUI.React;
46
+ const {
47
+ TPThemeProvider,
48
+ TPToastProvider,
49
+ TPPhoneFrame,
50
+ TPStatusBar,
51
+ TPHeader,
52
+ TPTabBar,
53
+ TPListCard,
54
+ TPListItem,
55
+ TPButton,
56
+ TPIcon,
57
+ useTPTheme,
58
+ useTPToast,
59
+ } = window.TPMobileUI;
60
+
61
+ function DemoApp() {
62
+ const [tab, setTab] = useState('home');
63
+ const { resolvedMode, toggleMode } = useTPTheme();
64
+ const toast = useTPToast();
65
+ return (
66
+ <TPPhoneFrame
67
+ device="iphone16pro"
68
+ statusBar={<TPStatusBar time="10:51" />}
69
+ bottomBar={
70
+ <TPTabBar
71
+ variant="floating-pill"
72
+ activeKey={tab}
73
+ onChange={setTab}
74
+ items={[
75
+ { key: 'home', label: 'Dashboard', icon: 'tabbar-dashboard-off', activeIcon: 'tabbar-dashboard-on' },
76
+ { key: 'devices', label: 'Devices', icon: 'tabbar-device-off', activeIcon: 'tabbar-device-on' },
77
+ { key: 'settings', label: 'Settings', icon: 'tabbar-settings-off', activeIcon: 'tabbar-settings-on' },
78
+ ]}
79
+ />
80
+ }
81
+ >
82
+ <TPHeader
83
+ variant="floating"
84
+ title="Site 92"
85
+ subtitle="Controller 62"
86
+ right={
87
+ <button type="button" className="tp-header-icon-btn" onClick={toggleMode} aria-label="Toggle theme">
88
+ <TPIcon name="nav-refresh" size={18} />
89
+ </button>
90
+ }
91
+ />
92
+ <div style={{ padding: 16, display: 'flex', flexDirection: 'column', gap: 12 }}>
93
+ <TPListCard divided>
94
+ <TPListItem title="Theme Mode" value={resolvedMode} />
95
+ <TPListItem title="Gateway" subtitle="ER7212PC" value="Connected" />
96
+ </TPListCard>
97
+ <TPButton variant="primary" block onClick={() => toast.show({ type: 'success', message: 'Synced!' })}>
98
+ Sync Site
99
+ </TPButton>
100
+ </div>
101
+ </TPPhoneFrame>
102
+ );
103
+ }
104
+
105
+ TPMobileUI.render(
106
+ <TPThemeProvider defaultBrand="omada" defaultMode="light" defaultOS="ios">
107
+ <TPToastProvider>
108
+ <DemoApp />
109
+ </TPToastProvider>
110
+ </TPThemeProvider>,
111
+ '#root',
112
+ );
113
+ </script>
114
+ </body>
115
+ </html>
116
+ ```
117
+
118
+ > `window.TPMobileUI` exports all `TP*` core primitives, `Omada*` pages & blocks, `TPIcon`, `TPIllustration`, `TPBrandLogo`, `TPMotion`, `React`, `ReactDOM`, and `TPMobileUI.render()`. All SVG/PNG/PAG assets are bundled inline inside `standalone.js`.
119
+
120
+ ---
121
+
122
+ ## 3. Mode B — React / Vite Subpath Imports
123
+
124
+ Prefer dedicated subpath imports to keep Vite/Rollup bundles lean via tree-shaking:
125
+
126
+ | Subpath | Contents |
127
+ | :--- | :--- |
128
+ | `@chenyqthu/tp-mobile-ui-kit/core` | `TPThemeProvider`, `useTPTheme`, `TP_BRANDS`, `TP_THEME_PRESETS`, and all 34 `TP*` mobile core primitives + `useTPToast` |
129
+ | `@chenyqthu/tp-mobile-ui-kit/assets` | `TPIcon`, `TPIllustration`, `TPBrandLogo`, `TPMotion`, and asset manifests (`TP_ICONS`, `TP_ILLUSTRATIONS`, `TP_BRAND_LOGOS`, `TP_MOTIONS`) |
130
+ | `@chenyqthu/tp-mobile-ui-kit/omada` | `OmadaStandardInput`, `OmadaDeviceThumb`, 3 V5.3 blocks, 7 restored Omada APP pages, `OmadaHealthDetailPage`, `OmadaDeviceDetailPage`, `OmadaAppDemo` |
131
+ | `@chenyqthu/tp-mobile-ui-kit/style.css` | Complete CSS token variables and `.tp-*` component/Omada styles |
132
+ | `@chenyqthu/tp-mobile-ui-kit/standalone` | IIFE browser bundle attaching `window.TPMobileUI` |
133
+ | `@chenyqthu/tp-mobile-ui-kit/catalog.json` | Machine-readable component, token, and asset catalog |
134
+ | `@chenyqthu/tp-mobile-ui-kit` | Convenience root barrel re-exporting everything |
135
+
136
+ ```tsx
137
+ import '@chenyqthu/tp-mobile-ui-kit/style.css';
138
+ import { TPThemeProvider, TPToastProvider, TPPhoneFrame, TPButton } from '@chenyqthu/tp-mobile-ui-kit/core';
139
+ import { TPIcon, TPIllustration, TPBrandLogo, TPMotion } from '@chenyqthu/tp-mobile-ui-kit/assets';
140
+ import { OmadaAppDemo, OmadaSiteDashboardPage } from '@chenyqthu/tp-mobile-ui-kit/omada';
141
+ ```
142
+
143
+ ---
144
+
145
+ ## 4. 6-Brand Theme Engine (12 Presets + Light/Dark/OS)
146
+
147
+ `<TPThemeProvider>` drives all `--tp-*` CSS variables across **6 brands × 2 modes (12 presets)**:
148
+
149
+ | Brand (`brand`) | Focus Color | Button Radius | Secondary Button | Main Font Size | Slider Stroke / Tick |
150
+ | :--- | :--- | :--- | :--- | :--- | :--- |
151
+ | `omada` | `#00A870` | `10px` | `2px` outlined | `16px` | `3px` / `4px` |
152
+ | `tapo` | `#0088E3` | `24px` pill | `0px` tinted fill | `17px` | `0px` / `6px` |
153
+ | `tether` | `#4ACBD6` | `12px` | `2px` outlined | `17px` | `0px` / `6px` |
154
+ | `mercusys` | `#FA3332` | `24px` pill | `0px` tinted fill | `17px` | `3px` / `4px` |
155
+ | `deco` | `#1CD0E6` | `24px` pill | `0px` tinted fill | `17px` | `0px` / `6px` |
156
+ | `ux` | `#007AFF` | `24px` pill | `0px` tinted fill | `17px` | `0px` / `6px` |
157
+
158
+ Switch dynamically via `useTPTheme()`:
159
+ - `mode`: `'light' | 'dark' | 'system'` (tracks `prefers-color-scheme: dark` automatically when `'system'`)
160
+ - `os`: `'ios' | 'android'` (adapts `TPStatusBar`, `TPAlert`, and `TPActionSheet` geometry)
161
+ - `screenSize`: `'base' | 'new' | 'ios27'`
162
+
163
+ ---
164
+
165
+ ## 5. Real Tencent PAG (`.pag`) Motion Usage
166
+
167
+ `<TPMotion name="..." />` plays authentic `.pag` vector animations via `libpag` WebGL/Canvas2D WASM and automatically follows `useTPTheme().resolvedMode` (`light` / `dark`):
168
+
169
+ 1. **Vite / React apps**: Place `libpag.wasm` in `public/libpag.wasm` (copied from `node_modules/libpag/lib/libpag.wasm`, or already in this repo's `public/libpag.wasm`).
170
+ 2. **Automatic fallback**: In `file://` standalone HTML or when local `./libpag.wasm` is absent, `TPMotion` falls back to `https://cdn.jsdelivr.net/npm/libpag@4.5.85/lib/libpag.wasm`. In headless/non-WebGL environments (like `jsdom`), it degrades gracefully to a themed SVG indicator (`data-tp-motion-fallback="true"`).
171
+ 3. Verified motion slugs (query via `search-assets motions`): `internet-connection`, `link-detection`, `update-network`, `deploy-config`, `discover-device`, `indeterminate-progress`, `connecting`, `tab-dropdown-select`, `tab-dropdown-mask`, `tab-dropdown-unmasked`, `port-card-expand`.
172
+
173
+ ---
174
+
175
+ ## 6. 7 Restored Omada APP Pages + V5.3 Blocks
176
+
177
+ - **7 Restored APP Screens**: `OmadaLaunchLoadingPage`, `OmadaControllerListPage`, `OmadaSiteDashboardPage`, `OmadaSiteInsightsPage`, `OmadaSiteDevicesPage`, `OmadaSiteClientsPage`, `OmadaSiteSettingsPage`
178
+ - **Drill-Downs & Orchestrator**: `OmadaHealthDetailPage`, `OmadaDeviceDetailPage`, `OmadaAppDemo` (all-in-one interactive prototype inside `TPPhoneFrame`)
179
+ - **V5.3 Blocks & Inputs**: `OmadaDeviceListBlock`, `OmadaWirelessNetworkBlock`, `OmadaIncidentsBlock`, `OmadaStandardInput` (segmented IPv4, MAC, Port, Text)
180
+
181
+ ---
182
+
183
+ ## 7. Mandatory Catalog Lookup & Demo Verification
184
+
185
+ **Never guess component props, icon slugs, illustration names, or `.pag` motion names.** Run the bundled CLI scripts:
186
+
187
+ ```bash
188
+ # 1. Inspect package version, subpaths, CDN URLs, and asset counts
189
+ node scripts/query-catalog.mjs info
190
+
191
+ # 2. List components (or filter by category: theme, core-nav-controls, core-lists-inputs, core-overlays, assets, omada-components, omada-blocks, omada-pages)
192
+ node scripts/query-catalog.mjs list-components
193
+ node scripts/query-catalog.mjs list-components omada-pages
194
+
195
+ # 3. Inspect exact Props interface for any component
196
+ node scripts/query-catalog.mjs component TPButton
197
+ node scripts/query-catalog.mjs component OmadaDeviceDetailPage
198
+
199
+ # 4. Inspect brand presets and CSS token summaries
200
+ node scripts/query-catalog.mjs brands
201
+ node scripts/query-catalog.mjs brands tapo
202
+
203
+ # 5. Search verified Figma icons, illustrations, brand logos, and PAG motions
204
+ node scripts/query-catalog.mjs search-icons tabbar 20
205
+ node scripts/query-catalog.mjs search-assets illustrations no- 20
206
+ node scripts/query-catalog.mjs search-assets logos
207
+ node scripts/query-catalog.mjs search-assets motions
208
+
209
+ # 6. List or export starter templates (`omada-dashboard`, `multi-brand`, `omada-device-detail`)
210
+ node scripts/query-catalog.mjs templates
211
+ node scripts/query-catalog.mjs template omada-dashboard --html > demo.html
212
+ node scripts/query-catalog.mjs template multi-brand --tsx
213
+
214
+ # 7. Verify generated HTML / TSX demos before finishing
215
+ node scripts/verify-demo.mjs demo.html
216
+ ```
217
+
218
+ ---
219
+
220
+ ## 8. Guardrails
221
+
222
+ 1. **Always wrap with `<TPThemeProvider>`** (and `<TPToastProvider>` when calling `useTPToast()`). Use `mode=` / `defaultMode=` and `brand=` / `defaultBrand=`.
223
+ 2. **Use `<TPButton variant="..." htmlType="...">` — NEVER `type=`**: `TPButtonProps` omits HTML `type` and uses `variant="primary" | "secondary" | "text" | "alert" | "tonal" | "in-card"` plus `htmlType="button" | "submit" | "reset"`.
224
+ 3. **Never hardcode colors**: Use `--tp-*` CSS variables (`var(--tp-bg-page)`, `var(--tp-bg-card)`, `var(--tp-text-primary)`, `var(--tp-text-secondary)`, `var(--tp-divider)`, `var(--tp-focus)`) or `useTPTheme().tokens`.
225
+ 4. **Always run `verify-demo.mjs`** on generated `.html` or `.tsx` files to validate every `<TPIcon>`, `<TPIllustration>`, `<TPBrandLogo>`, and `<TPMotion>` slug.