@chenyqthu/omada-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.
- package/README.md +88 -2
- package/dist/catalog.json +13396 -0
- package/dist/index.js +22452 -0
- package/dist/standalone.js +2490 -0
- package/dist/style.css +2 -0
- package/dist/types/lib/index.d.ts +1 -0
- package/dist/types/lib/standalone.d.ts +10 -0
- package/dist/types/omada/assets/SBrandAsset.d.ts +17 -0
- package/dist/types/omada/assets/SClientIcon.d.ts +16 -0
- package/dist/types/omada/assets/SIcon.d.ts +21 -0
- package/dist/types/omada/assets/SIllustration.d.ts +22 -0
- package/dist/types/omada/assets/SProductImage.d.ts +20 -0
- package/dist/types/omada/assets/ThemedAssetImage.d.ts +26 -0
- package/dist/types/omada/assets/assetsManifest.d.ts +19 -0
- package/dist/types/omada/assets/iconsManifest.d.ts +15 -0
- package/dist/types/omada/components/SAlert.d.ts +34 -0
- package/dist/types/omada/components/SAnchor.d.ts +32 -0
- package/dist/types/omada/components/SApDistributionRuler.d.ts +32 -0
- package/dist/types/omada/components/SAvatar.d.ts +28 -0
- package/dist/types/omada/components/SBadge.d.ts +17 -0
- package/dist/types/omada/components/SBreadcrumb.d.ts +36 -0
- package/dist/types/omada/components/SButton.d.ts +11 -0
- package/dist/types/omada/components/SCard.d.ts +28 -0
- package/dist/types/omada/components/SCascader.d.ts +20 -0
- package/dist/types/omada/components/SCategoryKpiCarousel.d.ts +26 -0
- package/dist/types/omada/components/SChannelUtilization.d.ts +25 -0
- package/dist/types/omada/components/SChart.d.ts +135 -0
- package/dist/types/omada/components/SCheckbox.d.ts +41 -0
- package/dist/types/omada/components/SClientOverviewStrip.d.ts +29 -0
- package/dist/types/omada/components/SCollapse.d.ts +28 -0
- package/dist/types/omada/components/SColorPicker.d.ts +17 -0
- package/dist/types/omada/components/SDatePicker.d.ts +57 -0
- package/dist/types/omada/components/SDescriptions.d.ts +21 -0
- package/dist/types/omada/components/SDeviceHealthSummary.d.ts +34 -0
- package/dist/types/omada/components/SDevicePortGraphic.d.ts +90 -0
- package/dist/types/omada/components/SDeviceStatus.d.ts +11 -0
- package/dist/types/omada/components/SDivider.d.ts +26 -0
- package/dist/types/omada/components/SDonutSummaryCard.d.ts +60 -0
- package/dist/types/omada/components/SDrawer.d.ts +36 -0
- package/dist/types/omada/components/SDropdown.d.ts +36 -0
- package/dist/types/omada/components/SEmpty.d.ts +17 -0
- package/dist/types/omada/components/SForm.d.ts +56 -0
- package/dist/types/omada/components/SHealthGauge.d.ts +43 -0
- package/dist/types/omada/components/SHealthTrendBar.d.ts +21 -0
- package/dist/types/omada/components/SInput.d.ts +47 -0
- package/dist/types/omada/components/SIpInput.d.ts +36 -0
- package/dist/types/omada/components/SLoading.d.ts +66 -0
- package/dist/types/omada/components/SMacInput.d.ts +26 -0
- package/dist/types/omada/components/SModal.d.ts +121 -0
- package/dist/types/omada/components/SNotification.d.ts +60 -0
- package/dist/types/omada/components/SPagination.d.ts +23 -0
- package/dist/types/omada/components/SPopover.d.ts +27 -0
- package/dist/types/omada/components/SPortPanel.d.ts +28 -0
- package/dist/types/omada/components/SProgress.d.ts +32 -0
- package/dist/types/omada/components/SRadio.d.ts +40 -0
- package/dist/types/omada/components/SRate.d.ts +20 -0
- package/dist/types/omada/components/SSchedule.d.ts +55 -0
- package/dist/types/omada/components/SSelect.d.ts +25 -0
- package/dist/types/omada/components/SSettingsPageShell.d.ts +104 -0
- package/dist/types/omada/components/SSlider.d.ts +31 -0
- package/dist/types/omada/components/SSteps.d.ts +41 -0
- package/dist/types/omada/components/SSwitch.d.ts +23 -0
- package/dist/types/omada/components/STable.d.ts +81 -0
- package/dist/types/omada/components/STabs.d.ts +27 -0
- package/dist/types/omada/components/STag.d.ts +23 -0
- package/dist/types/omada/components/STerminalConsole.d.ts +57 -0
- package/dist/types/omada/components/STile.d.ts +66 -0
- package/dist/types/omada/components/STimePicker.d.ts +16 -0
- package/dist/types/omada/components/STooltip.d.ts +34 -0
- package/dist/types/omada/components/STopologyCanvas.d.ts +66 -0
- package/dist/types/omada/components/STransfer.d.ts +34 -0
- package/dist/types/omada/components/STreeSelect.d.ts +24 -0
- package/dist/types/omada/components/SUpload.d.ts +58 -0
- package/dist/types/omada/icons/OmadaLogo.d.ts +20 -0
- package/dist/types/omada/index.d.ts +38 -0
- package/dist/types/omada/layout/SAppShell.d.ts +84 -0
- package/dist/types/omada/layout/SEmulatorShell.d.ts +80 -0
- package/dist/types/omada/layout/SPageHeader.d.ts +13 -0
- package/dist/types/omada/modules/data-charts.d.ts +8 -0
- package/dist/types/omada/modules/emulator-v6.d.ts +13 -0
- package/dist/types/omada/modules/feedback-overlays.d.ts +7 -0
- package/dist/types/omada/modules/nav-shell.d.ts +6 -0
- package/dist/types/omada/modules/select-inputs.d.ts +8 -0
- package/dist/types/omada/modules/time-schedule.d.ts +5 -0
- package/dist/types/omada/theme/OmadaProvider.d.ts +22 -0
- package/dist/types/omada/theme/antdTheme.d.ts +6 -0
- package/dist/types/omada/theme/tokens.d.ts +138 -0
- package/package.json +76 -4
- package/skills/omada-ui-kit/SKILL.md +170 -0
- package/skills/omada-ui-kit/references/catalog.json +13396 -0
- package/skills/omada-ui-kit/scripts/query-catalog.mjs +202 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: omada-ui-kit
|
|
3
|
+
description: >-
|
|
4
|
+
Build high-fidelity TP-Link Omada Controller v6.3 PRD demos and React UI prototypes
|
|
5
|
+
using the omada-ui-kit component library (`S*` components, Ant Design 6 overrides,
|
|
6
|
+
Figma icons/products/illustrations, and single-file zero-build HTML standalone bundle).
|
|
7
|
+
Activate whenever a user asks to build an Omada demo, network management prototype,
|
|
8
|
+
Controller UI page, or single-file HTML mockup.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Omada UI Kit — PRD Demo & Component Skill
|
|
12
|
+
|
|
13
|
+
Build authentic **Omada Controller v6.3** demos using verified exports from `@chenyqthu/omada-ui-kit` (check `references/catalog.json` via `query-catalog.mjs info` for the active version and CDN URLs).
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 1. Choose the Right Output Format
|
|
18
|
+
|
|
19
|
+
| User Need | Mode | Why |
|
|
20
|
+
| :--- | :--- | :--- |
|
|
21
|
+
| Quick PRD mockup, shareable link/file, zero-install preview | **Single-File HTML Demo** (`standalone.js` + `style.css`) | One `.html` file (~45–80 lines), opens cleanly via `file://` double-click or any static server |
|
|
22
|
+
| Multi-page app, TypeScript checking, Vite project | **React / Vite Project** (`@pkg` ESM + CSS) | Full tree-shaking, IDE IntelliSense (`.d.ts`), and standard `import` ergonomics |
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 2. Mode A — Single-File HTML Starter (Zero Build)
|
|
27
|
+
|
|
28
|
+
Use classic `<script>` tags (NOT `<script type="module">`) so local `file://` double-click works without CORS failures.
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<!doctype html>
|
|
32
|
+
<html lang="en">
|
|
33
|
+
<head>
|
|
34
|
+
<meta charset="utf-8" />
|
|
35
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
36
|
+
<title>Omada PRD Demo</title>
|
|
37
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@chenyqthu/omada-ui-kit@latest/dist/style.css" />
|
|
38
|
+
<script src="https://cdn.jsdelivr.net/npm/@chenyqthu/omada-ui-kit@latest/dist/standalone.js"></script>
|
|
39
|
+
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
|
|
40
|
+
</head>
|
|
41
|
+
<body style="margin: 0;">
|
|
42
|
+
<div id="root"></div>
|
|
43
|
+
<script type="text/babel">
|
|
44
|
+
const { useState } = OmadaUI.React;
|
|
45
|
+
const {
|
|
46
|
+
OmadaProvider,
|
|
47
|
+
SEmulatorShell,
|
|
48
|
+
SPageHeader,
|
|
49
|
+
SKpiCard,
|
|
50
|
+
STable,
|
|
51
|
+
SButton,
|
|
52
|
+
SDeviceStatus,
|
|
53
|
+
useOmadaTheme,
|
|
54
|
+
} = window.OmadaUI;
|
|
55
|
+
|
|
56
|
+
function DemoApp() {
|
|
57
|
+
const [activeKey, setActiveKey] = useState('devices');
|
|
58
|
+
return (
|
|
59
|
+
<SEmulatorShell
|
|
60
|
+
activeKey={activeKey}
|
|
61
|
+
onSelect={setActiveKey}
|
|
62
|
+
controllerName="Headquarters Building"
|
|
63
|
+
>
|
|
64
|
+
<div className="pr-9" style={{ padding: 20 }}>
|
|
65
|
+
<SPageHeader
|
|
66
|
+
title="AP Health Overview"
|
|
67
|
+
extra={<SButton variant="primary">Run Diagnostic</SButton>}
|
|
68
|
+
/>
|
|
69
|
+
<STable
|
|
70
|
+
rowKey="id"
|
|
71
|
+
dataSource={[{ id: '1', name: 'AP-Lobby-01', status: 'connected', clients: 42 }]}
|
|
72
|
+
columns={[
|
|
73
|
+
{ title: 'Device', dataIndex: 'name', key: 'name' },
|
|
74
|
+
{
|
|
75
|
+
title: 'Status',
|
|
76
|
+
dataIndex: 'status',
|
|
77
|
+
key: 'status',
|
|
78
|
+
render: (v) => <SDeviceStatus status={v} />,
|
|
79
|
+
},
|
|
80
|
+
{ title: 'Clients', dataIndex: 'clients', key: 'clients' },
|
|
81
|
+
]}
|
|
82
|
+
/>
|
|
83
|
+
</div>
|
|
84
|
+
</SEmulatorShell>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
OmadaUI.render(
|
|
89
|
+
<OmadaProvider defaultThemeMode="light">
|
|
90
|
+
<DemoApp />
|
|
91
|
+
</OmadaProvider>,
|
|
92
|
+
'#root',
|
|
93
|
+
);
|
|
94
|
+
</script>
|
|
95
|
+
</body>
|
|
96
|
+
</html>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
> All 58+ Omada `S*` components, `antd`, `AntdIcons`, `React`, `ReactDOM`, `OmadaUI.render`, and all Figma SVG/PNG assets are bundled on `window.OmadaUI`.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 3. Mode B — React / Vite Project Starter
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
import '@chenyqthu/omada-ui-kit/style.css';
|
|
107
|
+
import {
|
|
108
|
+
OmadaProvider,
|
|
109
|
+
SEmulatorShell,
|
|
110
|
+
SPageHeader,
|
|
111
|
+
STable,
|
|
112
|
+
SButton,
|
|
113
|
+
SIcon,
|
|
114
|
+
SProductImage,
|
|
115
|
+
} from '@chenyqthu/omada-ui-kit';
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Wrap the application root with `<OmadaProvider defaultThemeMode="light">` (never nest multiple providers).
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## 4. Mandatory Catalog Lookup Workflow (No Guessing!)
|
|
123
|
+
|
|
124
|
+
**NEVER invent component prop names, `SIcon` names, or `SProductImage` slugs from memory.** Always query the local catalog script bundled with this skill:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# 1. Check active package name, CDN URLs, and counts
|
|
128
|
+
node scripts/query-catalog.mjs info
|
|
129
|
+
|
|
130
|
+
# 2. List all exported Omada components (or filter by category)
|
|
131
|
+
node scripts/query-catalog.mjs list-components
|
|
132
|
+
node scripts/query-catalog.mjs list-components emulator-v6
|
|
133
|
+
|
|
134
|
+
# 3. Inspect exact Props interface and description for a component
|
|
135
|
+
node scripts/query-catalog.mjs component SEmulatorShell
|
|
136
|
+
node scripts/query-catalog.mjs component SSettingsPageShell
|
|
137
|
+
|
|
138
|
+
# 4. Search verified Figma asset slugs before writing <SIcon> or <SProductImage>
|
|
139
|
+
node scripts/query-catalog.mjs search-icons status 20
|
|
140
|
+
node scripts/query-catalog.mjs search-icons sidebar 20
|
|
141
|
+
node scripts/query-catalog.mjs search-assets products eap 20
|
|
142
|
+
node scripts/query-catalog.mjs search-assets illustrations empty 20
|
|
143
|
+
node scripts/query-catalog.mjs search-assets clients apple 20
|
|
144
|
+
|
|
145
|
+
# 5. Inspect Light/Dark tokens or Omada v6.3 page recipes
|
|
146
|
+
node scripts/query-catalog.mjs tokens light
|
|
147
|
+
node scripts/query-catalog.mjs recipes
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 5. Quick Component Map
|
|
153
|
+
|
|
154
|
+
- **Theme & Layout**: `OmadaProvider`, `useOmadaTheme`, `SEmulatorShell`, `EMULATOR_NAV_GROUPS`, `SAppShell`, `SPageHeader`
|
|
155
|
+
- **Data Display & Tables**: `SCard`, `SKpiCard`, `STable`, `STabs`, `STag`, `SCustomTag`, `SDeviceStatus`, `SDescriptions`, `SCollapse`, `SPortPanel`, `SDevicePortGraphic`, `STopologyCanvas`
|
|
156
|
+
- **Charts & Health**: `SLineChart`, `SBarChart`, `SDonutChart`, `SSparkChart`, `SDonutSummaryCard`, `SHealthGauge`, `SHealthRadar`, `SHealthTrendBar`, `SApDistributionRuler`, `SChannelUtilization`, `SDeviceHealthSummary`, `SClientOverviewStrip`, `SCategoryKpiCarousel`
|
|
157
|
+
- **Inputs & Settings**: `SButton`, `SInput`, `SSearchInput`, `SPasswordInput`, `SNumberInput`, `STextArea`, `SIpInput`, `SMacInput`, `SSelect`, `SSwitch`, `SSlider`, `SRadio`, `SCheckbox`, `SDatePicker`, `STimePicker`, `SSchedule`, `SForm`, `SFormSection`, `SFormItem`, `SSettingsPageShell`, `SSettingsSection`, `SSettingsRow`, `SSettingsInfoBanner`
|
|
158
|
+
- **Feedback & Diagnostics**: `SAlert`, `SModal`, `useOmadaConfirm`, `SDrawer`, `SEmpty`, `useOmadaFeedback`, `STerminalConsole`
|
|
159
|
+
- **Bundled Figma Assets**: `SIcon`, `SProductImage`, `SIllustration`, `SClientIcon`, `SBrandAsset`, `SDeviceIcon`, `OmadaLogo`
|
|
160
|
+
- **Ant Design 6 Re-exports**: `Row`, `Col`, `Space`, `Badge`, `Popover`, `Tooltip`, `Dropdown`, `Progress`, `Pagination`, `Divider`, `Switch`, `Select`, etc.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 6. Omada v6.3 Visual & AntD 6 Guardrails
|
|
165
|
+
|
|
166
|
+
1. **Always wrap with `<OmadaProvider>`** so Ant Design 6 tokens, `@ant-design/cssinjs` Cascade Layers (`<StyleProvider layer>`), and `--omada-*` CSS variables initialize properly.
|
|
167
|
+
2. **Respect Light/Dark Mode**: Use CSS variables (`var(--omada-bg-surface)`, `var(--omada-text-primary)`, `var(--omada-border-divider)`, `var(--omada-brand)`) instead of hardcoding `#fff` or `#000`. Toggle theme programmatically via `const { setThemeMode } = useOmadaTheme()`.
|
|
168
|
+
3. **Clear the `SEmulatorShell` quick-drawer handle**: When rendering content inside `<SEmulatorShell>` with `showQuickDrawerHandle` enabled (default), add right padding (`pr-9` / `paddingRight: 36`) on top-right toolbars or KPI strips so rightmost buttons/arrows never sit behind the floating `<||` handle.
|
|
169
|
+
4. **Ant Design 6 & Omada Props hygiene**: Use `classNames` / `styles` props on AntD `Drawer`, `Modal`, `Dropdown`, `Popover` (not removed v4/v5 props like `overlayClassName`, `bodyStyle`, `destroyOnClose`). Use `variant="primary" | "secondary" | "outline" | "danger"` on `<SButton>` instead of AntD's `type` prop.
|
|
170
|
+
5. **Layout without consumer Tailwind**: Inside `dist/standalone.js` / `style.css` single-file HTML demos, prefer `S*` layout components, AntD `Row` / `Col` / `Space` / `Flex`, standard inline `style={{ display: 'flex', gap: 16 }}`, or classes from `style.css` rather than assuming arbitrary Tailwind JIT classes exist outside this repo.
|