@chenyqthu/tp-mobile-ui-kit 0.2.0 → 0.3.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 +11 -9
- package/dist/assets.js +5 -5
- package/dist/catalog.json +1956 -131
- package/dist/chunks/OmadaAppDemo-BxWPBACn.js +7359 -0
- package/dist/chunks/{TPPrompt-DLd32rsN.js → TPInfoSheet-DozlNuGj.js} +1658 -1043
- package/dist/chunks/asset-icons-BLfOEHzP.js +10434 -0
- package/dist/chunks/{asset-illustrations-YHXzEd7z.js → asset-illustrations-CslT-sgf.js} +28 -2051
- package/dist/chunks/{asset-logos-DAyGwOLj.js → asset-logos-B18ywOgH.js} +2 -2
- package/dist/chunks/{asset-motion-D7fWh_JS.js → asset-motion-CxM2f5Ft.js} +307 -70
- package/dist/core.js +3 -3
- package/dist/index.js +7 -7
- package/dist/omada.js +7 -7
- package/dist/standalone.js +2090 -622
- package/dist/style.css +1 -1
- package/dist/types/assets-lib/TPIcon.d.ts +3 -0
- package/dist/types/assets-lib/iconsManifest.d.ts +2 -0
- package/dist/types/assets-lib/motionsManifest.d.ts +1 -1
- package/dist/types/core/components/TPDatePicker.d.ts +1 -1
- package/dist/types/core/components/TPInfoSheet.d.ts +11 -0
- package/dist/types/core/components/TPLiquidGlass.d.ts +3 -2
- package/dist/types/core/components/TPLiquidGlassBackdrop.d.ts +32 -0
- package/dist/types/core/components/TPLoadMore.d.ts +7 -0
- package/dist/types/core/index.d.ts +3 -0
- package/dist/types/core/types.d.ts +97 -8
- package/dist/types/core/utils/liquidGlassEngine.d.ts +37 -0
- package/dist/types/omada/blocks/OmadaChartCard.d.ts +53 -0
- package/dist/types/omada/blocks/OmadaClientListBlock.d.ts +34 -0
- package/dist/types/omada/blocks/OmadaDeviceListBlock.d.ts +15 -2
- package/dist/types/omada/blocks/OmadaFormRepeaterBlock.d.ts +48 -0
- package/dist/types/omada/blocks/OmadaPortPanelBlock.d.ts +21 -3
- package/dist/types/omada/blocks/OmadaPortSelectorBlock.d.ts +23 -0
- package/dist/types/omada/blocks/OmadaSidebarDrawer.d.ts +27 -0
- package/dist/types/omada/blocks/OmadaSiteListBlock.d.ts +26 -0
- package/dist/types/omada/blocks/OmadaVoucherPreviewCard.d.ts +21 -0
- package/dist/types/omada/components/OmadaStandardInput.d.ts +3 -2
- package/dist/types/omada/index.d.ts +14 -2
- package/dist/types/omada/pages/OmadaAccessibilitySettingsPage.d.ts +12 -0
- package/dist/types/omada/pages/OmadaAppDemo.d.ts +6 -3
- package/dist/types/omada/pages/OmadaConfigFormPage.d.ts +24 -0
- package/dist/types/omada/pages/OmadaLanSettingsPage.d.ts +25 -0
- package/dist/types/omada/pages/OmadaPortDetailPage.d.ts +16 -0
- package/dist/types/omada/pages/OmadaPrivacyPolicyPage.d.ts +18 -0
- package/dist/types/theme/TPThemeProvider.d.ts +9 -0
- package/dist/types/theme/index.d.ts +1 -1
- package/dist/types/theme/tokens.d.ts +24 -0
- package/package.json +2 -2
- package/skills/tp-mobile-ui-kit/SKILL.md +17 -14
- package/skills/tp-mobile-ui-kit/references/catalog.json +1956 -131
- package/dist/chunks/OmadaAppDemo-BO8a6A-m.js +0 -4910
- package/dist/chunks/asset-icons-BIenKvAh.js +0 -7613
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { TPResolvedMode } from '../theme/tokens';
|
|
2
3
|
import { type TPIconMeta, type TPIconName, type TPIconPack } from './iconsManifest';
|
|
3
4
|
export declare function hasTPIcon(name: string, pack?: 'auto' | TPIconPack): boolean;
|
|
4
5
|
export declare function listTPIcons(pack?: TPIconPack): readonly TPIconMeta[];
|
|
5
6
|
export interface TPIconProps {
|
|
6
7
|
name: TPIconName;
|
|
7
8
|
pack?: 'auto' | TPIconPack;
|
|
9
|
+
/** Override dark/light icon asset variant (defaults to active TPThemeProvider resolvedMode) */
|
|
10
|
+
theme?: TPResolvedMode;
|
|
8
11
|
size?: number | string;
|
|
9
12
|
color?: string;
|
|
10
13
|
className?: string;
|
|
@@ -9,6 +9,8 @@ export interface TPIconMeta {
|
|
|
9
9
|
monochrome: boolean;
|
|
10
10
|
width: number;
|
|
11
11
|
height: number;
|
|
12
|
+
darkRelPath?: string;
|
|
13
|
+
darkFormat?: 'svg' | 'png';
|
|
12
14
|
}
|
|
13
15
|
export declare const TP_ICONS: readonly TPIconMeta[];
|
|
14
16
|
export type TPIconName = (typeof TP_ICONS)[number]['name'];
|
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import type { TPDatePickerProps } from '../types';
|
|
3
3
|
import '../../styles/tp-core-lists-inputs.css';
|
|
4
4
|
/**
|
|
5
|
-
* Mobile date wheel picker with Year / Month / Day columns, leap-year clamping, and header actions.
|
|
5
|
+
* Mobile date wheel picker with Year / Month / Day columns, leap-year clamping, single & range modes, and header actions.
|
|
6
6
|
*/
|
|
7
7
|
export declare const TPDatePicker: React.FC<TPDatePickerProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TPInfoSheetProps, TPLegendSheetProps } from '../types';
|
|
3
|
+
import '../../styles/tp-core-overlays.css';
|
|
4
|
+
/**
|
|
5
|
+
* Informational bottom-sheet dialog presenting explanatory copy or bullet points above a confirmation CTA.
|
|
6
|
+
*/
|
|
7
|
+
export declare const TPInfoSheet: React.FC<TPInfoSheetProps>;
|
|
8
|
+
/**
|
|
9
|
+
* Bottom-sheet key/legend sheet displaying color swatches, icons, and badge explanations.
|
|
10
|
+
*/
|
|
11
|
+
export declare const TPLegendSheet: React.FC<TPLegendSheetProps>;
|
|
@@ -2,7 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import type { TPLiquidGlassProps } from '../types';
|
|
3
3
|
import '../../styles/tp-core-nav-controls.css';
|
|
4
4
|
/**
|
|
5
|
-
* Apple iOS 26/27 Liquid Glass surface primitive combining
|
|
6
|
-
*
|
|
5
|
+
* Apple iOS 26/27 Liquid Glass surface primitive combining SDF Snell-law optical backdrop
|
|
6
|
+
* refraction (with subtle RGB dispersion in Chromium), directional 135-degree specular rim
|
|
7
|
+
* highlights, and inner meniscus depth lighting.
|
|
7
8
|
*/
|
|
8
9
|
export declare const TPLiquidGlass: React.FC<TPLiquidGlassProps>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TPLiquidGlassProps } from '../types';
|
|
3
|
+
import { type LiquidGlassDisplacementAsset } from '../utils/liquidGlassEngine';
|
|
4
|
+
export interface TPLiquidGlassBackdropProps {
|
|
5
|
+
hostRef?: React.RefObject<HTMLElement | null>;
|
|
6
|
+
shape?: NonNullable<TPLiquidGlassProps['shape']>;
|
|
7
|
+
tint?: NonNullable<TPLiquidGlassProps['tint']>;
|
|
8
|
+
bezelWidth?: number;
|
|
9
|
+
refraction?: number;
|
|
10
|
+
dispersion?: number;
|
|
11
|
+
blur?: number;
|
|
12
|
+
saturation?: number;
|
|
13
|
+
optical?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Measures a glass backdrop's rendered geometry and prepares its cached SVG displacement asset.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useLiquidGlassSurface(targetRef: React.RefObject<HTMLElement | null>, options: Omit<TPLiquidGlassBackdropProps, 'hostRef'>): {
|
|
19
|
+
filterId: string;
|
|
20
|
+
asset: LiquidGlassDisplacementAsset | null;
|
|
21
|
+
size: {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
};
|
|
25
|
+
opticalEnabled: boolean;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Optical backdrop layer rendered inside a Liquid Glass container (`z-index: 0`).
|
|
29
|
+
* Never place `isolation: isolate` or `backdrop-filter` on the parent container so Chromium can
|
|
30
|
+
* sample the live scrolling DOM behind this element.
|
|
31
|
+
*/
|
|
32
|
+
export declare const TPLiquidGlassBackdrop: React.FC<TPLiquidGlassBackdropProps>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TPLoadMoreProps } from '../types';
|
|
3
|
+
import '../../styles/tp-core-extended.css';
|
|
4
|
+
/**
|
|
5
|
+
* List bottom footer displaying Load More trigger, Loading spinner, End-of-list state, or Retry action.
|
|
6
|
+
*/
|
|
7
|
+
export declare const TPLoadMore: React.FC<TPLoadMoreProps>;
|
|
@@ -32,6 +32,7 @@ export { TPPopup } from './components/TPPopup';
|
|
|
32
32
|
export { TPMenu } from './components/TPMenu';
|
|
33
33
|
export { TPToast, TPToastProvider, useTPToast, type TPToastOptions, type TPToastContextValue, } from './components/TPToast';
|
|
34
34
|
export { TPLiquidGlass } from './components/TPLiquidGlass';
|
|
35
|
+
export { computeLiquidGlassDisplacementField, supportsSvgBackdropFilter, type LiquidGlassFieldOptions, type LiquidGlassFieldResult, } from './utils/liquidGlassEngine';
|
|
35
36
|
export { TPIconButton, TPIconButtonGroup } from './components/TPIconButton';
|
|
36
37
|
export { TPCheckbox, TPCheckboxGroup } from './components/TPCheckbox';
|
|
37
38
|
export { TPRadio, TPRadioGroup } from './components/TPRadio';
|
|
@@ -48,3 +49,5 @@ export { TPDivider } from './components/TPDivider';
|
|
|
48
49
|
export { TPAvatar } from './components/TPAvatar';
|
|
49
50
|
export { TPPinInput } from './components/TPPinInput';
|
|
50
51
|
export { TPPrompt } from './components/TPPrompt';
|
|
52
|
+
export { TPLoadMore } from './components/TPLoadMore';
|
|
53
|
+
export { TPInfoSheet, TPLegendSheet } from './components/TPInfoSheet';
|
|
@@ -22,6 +22,10 @@ export interface TPLiquidGlassProps {
|
|
|
22
22
|
shape?: 'pill' | 'circle' | 'rounded';
|
|
23
23
|
tint?: 'clear' | 'brand' | 'dark';
|
|
24
24
|
interactive?: boolean;
|
|
25
|
+
refraction?: number;
|
|
26
|
+
dispersion?: number;
|
|
27
|
+
blur?: number;
|
|
28
|
+
optical?: boolean;
|
|
25
29
|
as?: 'div' | 'button' | 'nav' | 'section';
|
|
26
30
|
ariaLabel?: string;
|
|
27
31
|
disabled?: boolean;
|
|
@@ -43,10 +47,18 @@ export interface TPStatusBarProps {
|
|
|
43
47
|
className?: string;
|
|
44
48
|
style?: React.CSSProperties;
|
|
45
49
|
}
|
|
50
|
+
export interface TPHeaderTabItem {
|
|
51
|
+
key: string;
|
|
52
|
+
label: React.ReactNode;
|
|
53
|
+
badge?: number | string;
|
|
54
|
+
}
|
|
46
55
|
export interface TPHeaderProps {
|
|
47
56
|
title?: React.ReactNode;
|
|
48
57
|
subtitle?: React.ReactNode;
|
|
49
|
-
variant?: 'standard' | 'floating';
|
|
58
|
+
variant?: 'standard' | 'floating' | 'large' | 'tabs';
|
|
59
|
+
os?: 'ios' | 'android';
|
|
60
|
+
/** Automatically adapt floating Liquid Glass to traditional chrome on Android (default true) */
|
|
61
|
+
adaptiveOS?: boolean;
|
|
50
62
|
left?: React.ReactNode;
|
|
51
63
|
right?: React.ReactNode;
|
|
52
64
|
showBack?: boolean;
|
|
@@ -55,6 +67,10 @@ export interface TPHeaderProps {
|
|
|
55
67
|
onTitleClick?: () => void;
|
|
56
68
|
rightBadge?: number | string;
|
|
57
69
|
translucent?: boolean;
|
|
70
|
+
loading?: boolean;
|
|
71
|
+
tabs?: readonly TPHeaderTabItem[];
|
|
72
|
+
activeTab?: string;
|
|
73
|
+
onTabChange?: (key: string) => void;
|
|
58
74
|
className?: string;
|
|
59
75
|
style?: React.CSSProperties;
|
|
60
76
|
}
|
|
@@ -70,7 +86,12 @@ export interface TPTabBarProps {
|
|
|
70
86
|
activeKey: string;
|
|
71
87
|
onChange: (key: string) => void;
|
|
72
88
|
variant?: 'floating-pill' | 'docked';
|
|
89
|
+
os?: 'ios' | 'android';
|
|
90
|
+
/** Automatically adapt floating pill to docked bar on Android (default true) */
|
|
91
|
+
adaptiveOS?: boolean;
|
|
92
|
+
iconSize?: number;
|
|
73
93
|
extraAction?: React.ReactNode;
|
|
94
|
+
fab?: React.ReactNode;
|
|
74
95
|
className?: string;
|
|
75
96
|
style?: React.CSSProperties;
|
|
76
97
|
}
|
|
@@ -84,7 +105,7 @@ export interface TPSegmentProps {
|
|
|
84
105
|
options: readonly TPSegmentOption[];
|
|
85
106
|
value: string;
|
|
86
107
|
onChange: (key: string) => void;
|
|
87
|
-
variant?: 'underline' | 'pill';
|
|
108
|
+
variant?: 'underline' | 'pill' | 'segmented';
|
|
88
109
|
fullWidth?: boolean;
|
|
89
110
|
className?: string;
|
|
90
111
|
style?: React.CSSProperties;
|
|
@@ -92,27 +113,36 @@ export interface TPSegmentProps {
|
|
|
92
113
|
export interface TPPageControlProps {
|
|
93
114
|
total: number;
|
|
94
115
|
current: number;
|
|
116
|
+
variant?: 'dots' | 'process';
|
|
95
117
|
onChange?: (index: number) => void;
|
|
96
118
|
className?: string;
|
|
97
119
|
style?: React.CSSProperties;
|
|
98
120
|
}
|
|
121
|
+
export type TPButtonVariant = 'primary' | 'secondary' | 'text' | 'alert' | 'alert-strong' | 'tonal' | 'in-card' | 'in-card-alert';
|
|
99
122
|
export interface TPButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
100
|
-
variant?:
|
|
123
|
+
variant?: TPButtonVariant;
|
|
101
124
|
size?: 'lg' | 'md' | 'sm';
|
|
102
125
|
block?: boolean;
|
|
103
126
|
loading?: boolean;
|
|
127
|
+
/** Optional deterministic progress fill percentage (0-100) rendered behind the label */
|
|
128
|
+
progress?: number;
|
|
104
129
|
htmlType?: 'button' | 'submit' | 'reset';
|
|
105
130
|
icon?: React.ReactNode;
|
|
106
131
|
}
|
|
107
132
|
export interface TPFixedButtonBarProps {
|
|
108
|
-
layout?: 'single' | 'dual-horizontal' | 'dual-vertical';
|
|
133
|
+
layout?: 'single' | 'dual-horizontal' | 'dual-vertical' | 'triple';
|
|
109
134
|
primaryText: string;
|
|
135
|
+
primaryVariant?: TPButtonVariant;
|
|
110
136
|
onPrimaryClick?: () => void;
|
|
111
137
|
primaryLoading?: boolean;
|
|
112
138
|
primaryDisabled?: boolean;
|
|
113
139
|
secondaryText?: string;
|
|
114
140
|
onSecondaryClick?: () => void;
|
|
115
|
-
secondaryVariant?:
|
|
141
|
+
secondaryVariant?: TPButtonVariant;
|
|
142
|
+
tertiaryText?: string;
|
|
143
|
+
onTertiaryClick?: () => void;
|
|
144
|
+
tertiaryVariant?: TPButtonVariant;
|
|
145
|
+
tertiaryDisabled?: boolean;
|
|
116
146
|
note?: React.ReactNode;
|
|
117
147
|
className?: string;
|
|
118
148
|
style?: React.CSSProperties;
|
|
@@ -174,6 +204,8 @@ export interface TPListItemProps {
|
|
|
174
204
|
switchProps?: TPSwitchProps;
|
|
175
205
|
danger?: boolean;
|
|
176
206
|
disabled?: boolean;
|
|
207
|
+
layout?: 'default' | 'form-field';
|
|
208
|
+
error?: React.ReactNode;
|
|
177
209
|
onClick?: () => void;
|
|
178
210
|
className?: string;
|
|
179
211
|
style?: React.CSSProperties;
|
|
@@ -209,11 +241,14 @@ export interface TPTextProps {
|
|
|
209
241
|
style?: React.CSSProperties;
|
|
210
242
|
children: React.ReactNode;
|
|
211
243
|
}
|
|
244
|
+
export type TPTagTone = 'focus' | 'neutral' | 'success' | 'warning' | 'alert' | 'info' | 'purple' | 'indigo';
|
|
212
245
|
export interface TPTagProps {
|
|
213
246
|
children: React.ReactNode;
|
|
214
|
-
tone?:
|
|
247
|
+
tone?: TPTagTone;
|
|
215
248
|
selected?: boolean;
|
|
216
|
-
size?: 'sm' | 'md';
|
|
249
|
+
size?: 'xs' | 'sm' | 'md';
|
|
250
|
+
shape?: 'pill' | 'rect';
|
|
251
|
+
appearance?: 'soft' | 'solid' | 'outline';
|
|
217
252
|
closable?: boolean;
|
|
218
253
|
onClose?: () => void;
|
|
219
254
|
onClick?: () => void;
|
|
@@ -239,11 +274,12 @@ export interface TPEmptyStateProps {
|
|
|
239
274
|
actionText?: string;
|
|
240
275
|
onAction?: () => void;
|
|
241
276
|
compact?: boolean;
|
|
277
|
+
size?: 'full' | 'compact';
|
|
242
278
|
className?: string;
|
|
243
279
|
style?: React.CSSProperties;
|
|
244
280
|
}
|
|
245
281
|
export interface TPInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'prefix'> {
|
|
246
|
-
variant?: 'standard' | 'list' | 'borderless' | 'icon';
|
|
282
|
+
variant?: 'standard' | 'list' | 'borderless' | 'icon' | 'underline';
|
|
247
283
|
label?: React.ReactNode;
|
|
248
284
|
value?: string;
|
|
249
285
|
defaultValue?: string;
|
|
@@ -252,6 +288,7 @@ export interface TPInputProps extends Omit<React.InputHTMLAttributes<HTMLInputEl
|
|
|
252
288
|
password?: boolean;
|
|
253
289
|
multiline?: boolean;
|
|
254
290
|
rows?: number;
|
|
291
|
+
showCount?: boolean;
|
|
255
292
|
error?: string;
|
|
256
293
|
helperText?: string;
|
|
257
294
|
prefix?: React.ReactNode;
|
|
@@ -267,6 +304,7 @@ export interface TPSearchBarProps {
|
|
|
267
304
|
onCancel?: () => void;
|
|
268
305
|
showCancel?: boolean;
|
|
269
306
|
autoFocus?: boolean;
|
|
307
|
+
shape?: 'auto' | 'pill' | 'rounded';
|
|
270
308
|
className?: string;
|
|
271
309
|
style?: React.CSSProperties;
|
|
272
310
|
}
|
|
@@ -287,12 +325,17 @@ export interface TPWheelPickerProps {
|
|
|
287
325
|
style?: React.CSSProperties;
|
|
288
326
|
}
|
|
289
327
|
export interface TPDatePickerProps {
|
|
328
|
+
mode?: 'single' | 'range';
|
|
290
329
|
value?: Date;
|
|
291
330
|
defaultValue?: Date;
|
|
331
|
+
rangeValue?: readonly [string, string];
|
|
332
|
+
defaultRangeValue?: readonly [string, string];
|
|
292
333
|
minYear?: number;
|
|
293
334
|
maxYear?: number;
|
|
294
335
|
onChange?: (date: Date) => void;
|
|
295
336
|
onConfirm?: (date: Date) => void;
|
|
337
|
+
onRangeChange?: (range: [string, string]) => void;
|
|
338
|
+
onRangeConfirm?: (range: [string, string]) => void;
|
|
296
339
|
onCancel?: () => void;
|
|
297
340
|
title?: string;
|
|
298
341
|
className?: string;
|
|
@@ -305,6 +348,7 @@ export interface TPTimePickerProps {
|
|
|
305
348
|
period?: 'AM' | 'PM';
|
|
306
349
|
};
|
|
307
350
|
use12Hour?: boolean;
|
|
351
|
+
format?: '24h' | '12h';
|
|
308
352
|
minuteStep?: number;
|
|
309
353
|
onChange?: (val: {
|
|
310
354
|
hour: number;
|
|
@@ -537,6 +581,8 @@ export interface TPTooltipProps {
|
|
|
537
581
|
}
|
|
538
582
|
export interface TPFixedToastProps {
|
|
539
583
|
status?: 'default' | 'info' | 'success' | 'warning' | 'danger';
|
|
584
|
+
/** Convenience alias matching status tones */
|
|
585
|
+
tone?: 'default' | 'info' | 'success' | 'warning' | 'danger';
|
|
540
586
|
action?: 'none' | 'close' | 'go-to' | 'button';
|
|
541
587
|
actionLabel?: string;
|
|
542
588
|
onAction?: () => void;
|
|
@@ -644,3 +690,46 @@ export interface TPPinInputProps {
|
|
|
644
690
|
className?: string;
|
|
645
691
|
style?: React.CSSProperties;
|
|
646
692
|
}
|
|
693
|
+
export interface TPLoadMoreProps {
|
|
694
|
+
status?: 'idle' | 'loading' | 'no-more' | 'error';
|
|
695
|
+
idleText?: React.ReactNode;
|
|
696
|
+
loadingText?: React.ReactNode;
|
|
697
|
+
noMoreText?: React.ReactNode;
|
|
698
|
+
errorText?: React.ReactNode;
|
|
699
|
+
onLoadMore?: () => void;
|
|
700
|
+
onRetry?: () => void;
|
|
701
|
+
className?: string;
|
|
702
|
+
style?: React.CSSProperties;
|
|
703
|
+
}
|
|
704
|
+
export interface TPInfoSheetProps {
|
|
705
|
+
open: boolean;
|
|
706
|
+
title?: React.ReactNode;
|
|
707
|
+
subtitle?: React.ReactNode;
|
|
708
|
+
description?: React.ReactNode;
|
|
709
|
+
bullets?: readonly React.ReactNode[];
|
|
710
|
+
confirmText?: string;
|
|
711
|
+
onConfirm?: () => void;
|
|
712
|
+
onClose: () => void;
|
|
713
|
+
children?: React.ReactNode;
|
|
714
|
+
className?: string;
|
|
715
|
+
style?: React.CSSProperties;
|
|
716
|
+
}
|
|
717
|
+
export interface TPLegendItem {
|
|
718
|
+
key: string;
|
|
719
|
+
label: React.ReactNode;
|
|
720
|
+
description?: React.ReactNode;
|
|
721
|
+
color?: string;
|
|
722
|
+
icon?: React.ReactNode;
|
|
723
|
+
badge?: React.ReactNode;
|
|
724
|
+
}
|
|
725
|
+
export interface TPLegendSheetProps {
|
|
726
|
+
open: boolean;
|
|
727
|
+
title?: React.ReactNode;
|
|
728
|
+
subtitle?: React.ReactNode;
|
|
729
|
+
items: readonly TPLegendItem[];
|
|
730
|
+
columns?: 1 | 2;
|
|
731
|
+
onClose: () => void;
|
|
732
|
+
footer?: React.ReactNode;
|
|
733
|
+
className?: string;
|
|
734
|
+
style?: React.CSSProperties;
|
|
735
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface LiquidGlassFieldOptions {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
radius: number;
|
|
5
|
+
bezelWidth: number;
|
|
6
|
+
glassThickness?: number;
|
|
7
|
+
refractiveIndex?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface LiquidGlassFieldResult {
|
|
10
|
+
data: Uint8ClampedArray;
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
maxScale: number;
|
|
14
|
+
}
|
|
15
|
+
export interface LiquidGlassDisplacementAsset {
|
|
16
|
+
url: string;
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
maxScale: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Returns true only in Chromium desktop/Android browsers where SVG `backdrop-filter: url(#...)`
|
|
23
|
+
* samples live DOM pixels behind the element. Safari/WebKit and Firefox drop the entire
|
|
24
|
+
* `backdrop-filter` rule when `url(...)` appears, so they receive CSS fallback styling instead.
|
|
25
|
+
*/
|
|
26
|
+
export declare function supportsSvgBackdropFilter(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Computes a rounded-rectangle SDF displacement field using a convex squircle profile and
|
|
29
|
+
* Snell's law refraction (`n1 = 1.0 -> n2 = 1.5`), keeping interior center pixels neutral
|
|
30
|
+
* (`R = 128, G = 128`) and refracting along the curved bezel rim.
|
|
31
|
+
*/
|
|
32
|
+
export declare function computeLiquidGlassDisplacementField(options: LiquidGlassFieldOptions): LiquidGlassFieldResult;
|
|
33
|
+
/**
|
|
34
|
+
* Generates and memoizes a PNG data URL displacement map for a Liquid Glass bezel contour.
|
|
35
|
+
* Returns null safely in environments without 2D Canvas support (such as jsdom or SSR).
|
|
36
|
+
*/
|
|
37
|
+
export declare function getLiquidGlassDisplacementAsset(options: LiquidGlassFieldOptions): LiquidGlassDisplacementAsset | null;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '../../styles/tp-omada.css';
|
|
3
|
+
export type OmadaChartType = 'line' | 'area' | 'bar' | 'stacked-bar' | 'donut' | 'speed-bar';
|
|
4
|
+
export interface OmadaChartSeries {
|
|
5
|
+
key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
values: readonly number[];
|
|
9
|
+
stack?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface OmadaChartTimeRangeOption {
|
|
12
|
+
key: string;
|
|
13
|
+
label: string;
|
|
14
|
+
}
|
|
15
|
+
export interface OmadaChartScaleResult {
|
|
16
|
+
min: number;
|
|
17
|
+
max: number;
|
|
18
|
+
step: number;
|
|
19
|
+
ticks: number[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Computes nice human-readable axis ticks supporting all-zero datasets and negative dBm ranges.
|
|
23
|
+
*/
|
|
24
|
+
export declare function computeOmadaAxisScale(values: readonly number[], options?: {
|
|
25
|
+
tickCount?: number;
|
|
26
|
+
allowNegative?: boolean;
|
|
27
|
+
zeroBaseline?: boolean;
|
|
28
|
+
}): OmadaChartScaleResult;
|
|
29
|
+
export interface OmadaChartCardProps {
|
|
30
|
+
title: React.ReactNode;
|
|
31
|
+
subtitle?: React.ReactNode;
|
|
32
|
+
type?: OmadaChartType;
|
|
33
|
+
labels?: readonly string[];
|
|
34
|
+
series: readonly OmadaChartSeries[];
|
|
35
|
+
secondarySeries?: readonly OmadaChartSeries[];
|
|
36
|
+
unit?: string;
|
|
37
|
+
secondaryUnit?: string;
|
|
38
|
+
timeRanges?: readonly OmadaChartTimeRangeOption[];
|
|
39
|
+
activeTimeRange?: string;
|
|
40
|
+
onTimeRangeChange?: (key: string) => void;
|
|
41
|
+
loading?: boolean;
|
|
42
|
+
empty?: boolean;
|
|
43
|
+
emptyTitle?: string;
|
|
44
|
+
emptyDescription?: string;
|
|
45
|
+
extra?: React.ReactNode;
|
|
46
|
+
className?: string;
|
|
47
|
+
style?: React.CSSProperties;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Reusable Omada data-visualization card supporting line, area, bar, stacked-bar, donut,
|
|
51
|
+
* and speed-bar charts with dual Y-axes, negative dBm scaling, tooltips, loading, and empty states.
|
|
52
|
+
*/
|
|
53
|
+
export declare const OmadaChartCard: React.FC<OmadaChartCardProps>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type TPIconName } from '../../assets-lib';
|
|
3
|
+
import type { OmadaClientLinkType, OmadaClientStatus } from '../pages/OmadaSiteClientsPage';
|
|
4
|
+
import '../../styles/tp-omada.css';
|
|
5
|
+
export interface OmadaClientListItem {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
ip: string;
|
|
9
|
+
mac: string;
|
|
10
|
+
networkName: string;
|
|
11
|
+
status: OmadaClientStatus;
|
|
12
|
+
linkType: OmadaClientLinkType;
|
|
13
|
+
band?: '2.4G' | '5G' | '6G' | 'LAN';
|
|
14
|
+
rssiDbm?: number;
|
|
15
|
+
downRate?: string;
|
|
16
|
+
upRate?: string;
|
|
17
|
+
iconName?: TPIconName;
|
|
18
|
+
}
|
|
19
|
+
export declare const DEFAULT_OMADA_CLIENT_LIST: readonly OmadaClientListItem[];
|
|
20
|
+
export type OmadaClientFilterKey = 'all' | 'wireless' | 'wired' | 'blocked';
|
|
21
|
+
export interface OmadaClientListBlockProps {
|
|
22
|
+
clients?: readonly OmadaClientListItem[];
|
|
23
|
+
searchable?: boolean;
|
|
24
|
+
filterable?: boolean;
|
|
25
|
+
onSelectClient?: (client: OmadaClientListItem) => void;
|
|
26
|
+
onToggleBlock?: (client: OmadaClientListItem) => void;
|
|
27
|
+
className?: string;
|
|
28
|
+
style?: React.CSSProperties;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Reusable Omada Client List block featuring dark-adaptive client icons, Wi-Fi band tags,
|
|
32
|
+
* RSSI signal strength, live Rx/Tx rates, filter chips, and quick block/unblock action.
|
|
33
|
+
*/
|
|
34
|
+
export declare const OmadaClientListBlock: React.FC<OmadaClientListBlockProps>;
|
|
@@ -4,7 +4,9 @@ import '../../styles/tp-omada.css';
|
|
|
4
4
|
export type OmadaSiteTabKey = 'dashboard' | 'insights' | 'devices' | 'clients' | 'settings';
|
|
5
5
|
export declare const OMADA_SITE_TABS: readonly TPTabBarItem[];
|
|
6
6
|
export type OmadaDeviceType = 'gateway' | 'switch' | 'ap';
|
|
7
|
-
export type OmadaDeviceStatus = 'connected' | 'disconnected' | 'pending';
|
|
7
|
+
export type OmadaDeviceStatus = 'connected' | 'disconnected' | 'pending' | 'adopting' | 'isolated' | 'heartbeat-missed' | 'online' | 'offline' | 'updating' | 'warning';
|
|
8
|
+
export type OmadaDeviceSecondaryMetric = 'ip' | 'mac' | 'uptime' | 'clients' | 'cpu-mem' | 'traffic' | 'firmware';
|
|
9
|
+
export type OmadaDeviceThumbSize = 'sm' | 'md' | 'lg';
|
|
8
10
|
export interface OmadaDeviceRecord {
|
|
9
11
|
id: string;
|
|
10
12
|
mac: string;
|
|
@@ -21,6 +23,8 @@ export interface OmadaDeviceRecord {
|
|
|
21
23
|
uptime?: string;
|
|
22
24
|
cpuPct?: number;
|
|
23
25
|
memoryPct?: number;
|
|
26
|
+
clientsCount?: number;
|
|
27
|
+
trafficRate?: string;
|
|
24
28
|
}
|
|
25
29
|
export declare const DEFAULT_OMADA_DEVICES: readonly OmadaDeviceRecord[];
|
|
26
30
|
export declare const OmadaDeviceThumb: React.FC<{
|
|
@@ -30,6 +34,14 @@ export declare const OmadaDeviceThumb: React.FC<{
|
|
|
30
34
|
export interface OmadaDeviceListBlockProps {
|
|
31
35
|
devices?: readonly OmadaDeviceRecord[];
|
|
32
36
|
grouped?: boolean;
|
|
37
|
+
secondaryMetric?: OmadaDeviceSecondaryMetric;
|
|
38
|
+
onSecondaryMetricChange?: (metric: OmadaDeviceSecondaryMetric) => void;
|
|
39
|
+
thumbSize?: OmadaDeviceThumbSize;
|
|
40
|
+
onThumbSizeChange?: (size: OmadaDeviceThumbSize) => void;
|
|
41
|
+
showDisplayOptions?: boolean;
|
|
42
|
+
selectable?: 'none' | 'single' | 'multi';
|
|
43
|
+
selectedIds?: readonly string[];
|
|
44
|
+
onSelectionChange?: (selectedIds: string[]) => void;
|
|
33
45
|
onSelectDevice?: (device: OmadaDeviceRecord) => void;
|
|
34
46
|
emptyTitle?: string;
|
|
35
47
|
emptyDescription?: string;
|
|
@@ -37,6 +49,7 @@ export interface OmadaDeviceListBlockProps {
|
|
|
37
49
|
style?: React.CSSProperties;
|
|
38
50
|
}
|
|
39
51
|
/**
|
|
40
|
-
* Reusable Omada v5.3+ Device List block matching real-device `SiteDevices.png` row geometry
|
|
52
|
+
* Reusable Omada v5.3+ Device List block matching real-device `SiteDevices.png` row geometry,
|
|
53
|
+
* extended with 6+ device statuses, 7 selectable secondary metrics, Display Options sheet, and row selection.
|
|
41
54
|
*/
|
|
42
55
|
export declare const OmadaDeviceListBlock: React.FC<OmadaDeviceListBlockProps>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '../../styles/tp-omada.css';
|
|
3
|
+
export interface OmadaFormRepeaterItem {
|
|
4
|
+
id: string;
|
|
5
|
+
keyLabel?: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
export interface OmadaFormRepeaterBlockProps {
|
|
9
|
+
title?: React.ReactNode;
|
|
10
|
+
items?: readonly OmadaFormRepeaterItem[];
|
|
11
|
+
defaultItems?: readonly OmadaFormRepeaterItem[];
|
|
12
|
+
keyLabel?: string;
|
|
13
|
+
keyPlaceholder?: string;
|
|
14
|
+
valueLabel?: string;
|
|
15
|
+
valuePlaceholder?: string;
|
|
16
|
+
addText?: string;
|
|
17
|
+
minItems?: number;
|
|
18
|
+
maxItems?: number;
|
|
19
|
+
onChange?: (next: OmadaFormRepeaterItem[]) => void;
|
|
20
|
+
renderRow?: (item: OmadaFormRepeaterItem, index: number, update: (patch: Partial<OmadaFormRepeaterItem>) => void) => React.ReactNode;
|
|
21
|
+
className?: string;
|
|
22
|
+
style?: React.CSSProperties;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Repeatable dynamic form row block (`Add Item` / delete row / bounded count) for DNS servers,
|
|
26
|
+
* DHCP options, VLAN subnets, or ACL match rules.
|
|
27
|
+
*/
|
|
28
|
+
export declare const OmadaFormRepeaterBlock: React.FC<OmadaFormRepeaterBlockProps>;
|
|
29
|
+
export interface OmadaCustomOption {
|
|
30
|
+
value: string;
|
|
31
|
+
label: React.ReactNode;
|
|
32
|
+
description?: React.ReactNode;
|
|
33
|
+
}
|
|
34
|
+
export interface OmadaCustomOptionListProps {
|
|
35
|
+
title?: React.ReactNode;
|
|
36
|
+
options: readonly OmadaCustomOption[];
|
|
37
|
+
value?: string;
|
|
38
|
+
defaultValue?: string;
|
|
39
|
+
customLabel?: string;
|
|
40
|
+
customPlaceholder?: string;
|
|
41
|
+
onChange?: (value: string) => void;
|
|
42
|
+
className?: string;
|
|
43
|
+
style?: React.CSSProperties;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Single-select option list with preset choices plus an inline Custom value entry row.
|
|
47
|
+
*/
|
|
48
|
+
export declare const OmadaCustomOptionList: React.FC<OmadaCustomOptionListProps>;
|
|
@@ -1,31 +1,49 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type TPIconName } from '../../assets-lib';
|
|
2
3
|
import '../../styles/tp-omada.css';
|
|
3
4
|
export type OmadaPortMedia = 'rj45' | 'sfp';
|
|
4
|
-
export type OmadaPortSpeed = '2.5G' | '
|
|
5
|
+
export type OmadaPortSpeed = '10/100M' | '1G' | '2.5G' | '5G' | '10G' | '25G' | '40G' | '100G' | 'Disabled' | 'Disconnected' | '100M' | '1000M' | 'Down';
|
|
6
|
+
export type OmadaPortBadgeType = 'wan' | 'poe' | 'poe-bt' | 'sfp' | 'sfp-plus' | 'uplink' | 'lag' | 'mirror' | 'mirroring' | 'stp-blocking' | 'stp-discard' | 'loop' | 'blocked' | 'disabled' | 'disconnected' | 'stack' | 'console';
|
|
5
7
|
export interface OmadaHardwarePort {
|
|
6
8
|
id: string;
|
|
7
9
|
label: string;
|
|
10
|
+
portNumber?: number;
|
|
8
11
|
media: OmadaPortMedia;
|
|
9
12
|
speed: OmadaPortSpeed;
|
|
10
13
|
poeCapable?: boolean;
|
|
11
14
|
poeEnabled?: boolean;
|
|
12
15
|
poeWatts?: number;
|
|
16
|
+
badges?: readonly OmadaPortBadgeType[];
|
|
17
|
+
lagGroup?: string;
|
|
13
18
|
vlanProfile: string;
|
|
14
19
|
rxBytes: string;
|
|
15
20
|
txBytes: string;
|
|
16
21
|
}
|
|
22
|
+
export declare function getOmadaPortSpeedColor(speed: OmadaPortSpeed): string;
|
|
23
|
+
export declare function getOmadaPortBadgeIcon(badge: OmadaPortBadgeType): TPIconName;
|
|
17
24
|
export declare const DEFAULT_OMADA_PORTS: readonly OmadaHardwarePort[];
|
|
25
|
+
export interface OmadaPortLegendSheetProps {
|
|
26
|
+
open: boolean;
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
title?: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Standardized Omada Port Panel speed color & badge icon legend sheet (`TPLegendSheet`).
|
|
32
|
+
*/
|
|
33
|
+
export declare const OmadaPortLegendSheet: React.FC<OmadaPortLegendSheetProps>;
|
|
18
34
|
export interface OmadaPortPanelBlockProps {
|
|
19
35
|
deviceModel?: string;
|
|
20
36
|
ports?: readonly OmadaHardwarePort[];
|
|
37
|
+
layout?: 'single-row' | 'dual-row';
|
|
21
38
|
showHeader?: boolean;
|
|
39
|
+
showLegendButton?: boolean;
|
|
22
40
|
onBack?: () => void;
|
|
23
41
|
onPortUpdate?: (updated: OmadaHardwarePort) => void;
|
|
24
42
|
className?: string;
|
|
25
43
|
style?: React.CSSProperties;
|
|
26
44
|
}
|
|
27
45
|
/**
|
|
28
|
-
* Reusable Omada v5.3+ hardware port panel (`SMBNET-4185` / `SMBNET-4057`)
|
|
29
|
-
*
|
|
46
|
+
* Reusable Omada v5.3+ hardware port panel (`SMBNET-4185` / `SMBNET-4057`) supporting 10 Omada speed
|
|
47
|
+
* colors, 17 port badge types, single-row & dual-row switch faceplates, legend sheet, PoE & VLAN controls.
|
|
30
48
|
*/
|
|
31
49
|
export declare const OmadaPortPanelBlock: React.FC<OmadaPortPanelBlockProps>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type OmadaHardwarePort } from './OmadaPortPanelBlock';
|
|
3
|
+
import '../../styles/tp-omada.css';
|
|
4
|
+
export type OmadaPortSelectorMode = 'select' | 'icon-select' | 'lag';
|
|
5
|
+
export interface OmadaPortSelectorBlockProps {
|
|
6
|
+
ports?: readonly OmadaHardwarePort[];
|
|
7
|
+
mode?: OmadaPortSelectorMode;
|
|
8
|
+
multiple?: boolean;
|
|
9
|
+
value?: readonly string[];
|
|
10
|
+
defaultValue?: readonly string[];
|
|
11
|
+
lagGroupName?: string;
|
|
12
|
+
minLagPorts?: number;
|
|
13
|
+
maxLagPorts?: number;
|
|
14
|
+
title?: React.ReactNode;
|
|
15
|
+
onChange?: (selectedIds: string[]) => void;
|
|
16
|
+
className?: string;
|
|
17
|
+
style?: React.CSSProperties;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Interactive Omada port selector supporting generic port selection, compact icon-grid selection,
|
|
21
|
+
* and Link Aggregation (LAG) member selection with speed mismatch & count validation.
|
|
22
|
+
*/
|
|
23
|
+
export declare const OmadaPortSelectorBlock: React.FC<OmadaPortSelectorBlockProps>;
|