@chenyqthu/omada-ui-kit 0.0.0-stage → 0.2.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 +13560 -0
- package/dist/index.js +22706 -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/SAclRuleBuilder.d.ts +53 -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/SExpandableSection.d.ts +20 -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 +15 -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 +13560 -0
- package/skills/omada-ui-kit/scripts/query-catalog.mjs +202 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { EChartsOption } from 'echarts';
|
|
3
|
+
export interface SChartProps {
|
|
4
|
+
option: EChartsOption;
|
|
5
|
+
height?: number | string;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
empty?: boolean;
|
|
8
|
+
emptyTitle?: React.ReactNode;
|
|
9
|
+
emptyDescription?: React.ReactNode;
|
|
10
|
+
renderer?: 'canvas' | 'svg';
|
|
11
|
+
className?: string;
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ECharts 5 chart wrapper pre-configured with Omada's 20-color categorical palette,
|
|
16
|
+
* `Manrope` typography, dashed gridlines, Light/Dark live theme sync, `ResizeObserver`,
|
|
17
|
+
* loading skeleton, and `<SEmpty>` empty state.
|
|
18
|
+
*/
|
|
19
|
+
export declare const SChart: React.FC<SChartProps>;
|
|
20
|
+
export interface SLineChartSeries {
|
|
21
|
+
name: string;
|
|
22
|
+
data: (number | null)[];
|
|
23
|
+
color?: string;
|
|
24
|
+
area?: boolean;
|
|
25
|
+
smooth?: boolean;
|
|
26
|
+
dashed?: boolean;
|
|
27
|
+
showSymbol?: boolean;
|
|
28
|
+
stack?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface SLineChartProps {
|
|
31
|
+
xData: string[];
|
|
32
|
+
series: SLineChartSeries[];
|
|
33
|
+
area?: boolean;
|
|
34
|
+
smooth?: boolean;
|
|
35
|
+
/** Fixes Y-axis to 0%–100% with 6 ticks (`0, 20, 40, 60, 80, 100`). */
|
|
36
|
+
percentage?: boolean;
|
|
37
|
+
yUnit?: string;
|
|
38
|
+
yMin?: number;
|
|
39
|
+
yMax?: number;
|
|
40
|
+
showLegend?: boolean;
|
|
41
|
+
legendPosition?: 'top' | 'bottom';
|
|
42
|
+
height?: number | string;
|
|
43
|
+
loading?: boolean;
|
|
44
|
+
empty?: boolean;
|
|
45
|
+
emptyTitle?: React.ReactNode;
|
|
46
|
+
emptyDescription?: React.ReactNode;
|
|
47
|
+
className?: string;
|
|
48
|
+
style?: React.CSSProperties;
|
|
49
|
+
optionOverride?: EChartsOption;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Omada multi-series Line / Area chart preset with 5-tick default or 6-tick percentage Y-axis,
|
|
53
|
+
* gradient area fill, interactive legend toggling, loading skeleton, and empty state.
|
|
54
|
+
*/
|
|
55
|
+
export declare const SLineChart: React.FC<SLineChartProps>;
|
|
56
|
+
export interface SBarChartSeries {
|
|
57
|
+
name: string;
|
|
58
|
+
data: number[];
|
|
59
|
+
color?: string;
|
|
60
|
+
stack?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface SBarChartProps {
|
|
63
|
+
categories: string[];
|
|
64
|
+
series: SBarChartSeries[];
|
|
65
|
+
layout?: 'vertical' | 'horizontal';
|
|
66
|
+
stacked?: boolean;
|
|
67
|
+
barWidth?: number;
|
|
68
|
+
percentage?: boolean;
|
|
69
|
+
unit?: string;
|
|
70
|
+
showLegend?: boolean;
|
|
71
|
+
legendPosition?: 'top' | 'bottom';
|
|
72
|
+
height?: number | string;
|
|
73
|
+
loading?: boolean;
|
|
74
|
+
empty?: boolean;
|
|
75
|
+
emptyTitle?: React.ReactNode;
|
|
76
|
+
emptyDescription?: React.ReactNode;
|
|
77
|
+
className?: string;
|
|
78
|
+
style?: React.CSSProperties;
|
|
79
|
+
optionOverride?: EChartsOption;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Omada Bar chart preset supporting vertical, stacked, and horizontal layouts
|
|
83
|
+
* with 5-tick (or 6-tick percentage) axis scaling, loading skeleton, and empty state.
|
|
84
|
+
*/
|
|
85
|
+
export declare const SBarChart: React.FC<SBarChartProps>;
|
|
86
|
+
export interface SDonutChartDatum {
|
|
87
|
+
name: string;
|
|
88
|
+
value: number;
|
|
89
|
+
color?: string;
|
|
90
|
+
}
|
|
91
|
+
export interface SDonutChartProps {
|
|
92
|
+
data: SDonutChartDatum[];
|
|
93
|
+
centerValue?: React.ReactNode;
|
|
94
|
+
centerLabel?: React.ReactNode;
|
|
95
|
+
radius?: [string, string];
|
|
96
|
+
showLegend?: boolean;
|
|
97
|
+
legendPosition?: 'bottom' | 'right';
|
|
98
|
+
unit?: string;
|
|
99
|
+
height?: number | string;
|
|
100
|
+
loading?: boolean;
|
|
101
|
+
empty?: boolean;
|
|
102
|
+
emptyTitle?: React.ReactNode;
|
|
103
|
+
emptyDescription?: React.ReactNode;
|
|
104
|
+
className?: string;
|
|
105
|
+
style?: React.CSSProperties;
|
|
106
|
+
optionOverride?: EChartsOption;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Omada Donut ring chart preset with optional center KPI metric overlay,
|
|
110
|
+
* interactive legend, loading skeleton, and empty state.
|
|
111
|
+
*/
|
|
112
|
+
export declare const SDonutChart: React.FC<SDonutChartProps>;
|
|
113
|
+
export interface SSparkChartProps {
|
|
114
|
+
data: number[];
|
|
115
|
+
labels?: string[];
|
|
116
|
+
seriesName?: string;
|
|
117
|
+
variant?: 'line' | 'area' | 'bar';
|
|
118
|
+
color?: string;
|
|
119
|
+
unit?: string;
|
|
120
|
+
/** Shows strictly 2 Y-axis ticks (`min` and `max`) per Omada widget spec. */
|
|
121
|
+
showAxisTicks?: boolean;
|
|
122
|
+
height?: number | string;
|
|
123
|
+
loading?: boolean;
|
|
124
|
+
empty?: boolean;
|
|
125
|
+
emptyTitle?: React.ReactNode;
|
|
126
|
+
emptyDescription?: React.ReactNode;
|
|
127
|
+
className?: string;
|
|
128
|
+
style?: React.CSSProperties;
|
|
129
|
+
optionOverride?: EChartsOption;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Compact dashboard widget spark chart featuring strictly 2 Y-axis ticks (`min` and `max`),
|
|
133
|
+
* supporting `area`, `line`, and `bar` modes.
|
|
134
|
+
*/
|
|
135
|
+
export declare const SSparkChart: React.FC<SSparkChartProps>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type CheckboxOptionType, type CheckboxProps, type CheckboxRef } from 'antd';
|
|
3
|
+
import type { CheckboxGroupProps } from 'antd/es/checkbox';
|
|
4
|
+
export type SCheckboxGroupVariant = 'default' | 'button';
|
|
5
|
+
export interface SCheckboxProps extends CheckboxProps {
|
|
6
|
+
/** Optional explanatory copy rendered 4px beneath the checkbox label. */
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
/** Ref forwarded to the underlying AntD 6 Checkbox instance. */
|
|
9
|
+
ref?: React.Ref<CheckboxRef>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Omada Checkbox with optional secondary `description` line aligned cleanly under the label.
|
|
13
|
+
*/
|
|
14
|
+
export declare const SCheckbox: React.FC<SCheckboxProps> & {
|
|
15
|
+
Group: typeof SCheckboxGroup;
|
|
16
|
+
};
|
|
17
|
+
export interface SCheckboxOption<T = string | number> extends CheckboxOptionType<T> {
|
|
18
|
+
/** Optional secondary description line shown below the option label (default variant). */
|
|
19
|
+
description?: React.ReactNode;
|
|
20
|
+
/** Optional leading icon inside the option label or button pill. */
|
|
21
|
+
icon?: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export interface SCheckboxGroupProps<T = string | number> extends Omit<CheckboxGroupProps<T>, 'options'> {
|
|
24
|
+
/** Visual variant: standard checkboxes (`default`) or linear selectable button pills (`button`). */
|
|
25
|
+
variant?: SCheckboxGroupVariant;
|
|
26
|
+
/** Array of checkbox options or primitive values. */
|
|
27
|
+
options?: Array<SCheckboxOption<T> | string | number>;
|
|
28
|
+
/** Renders a Select All header checkbox with automatic indeterminate state. */
|
|
29
|
+
showSelectAll?: boolean;
|
|
30
|
+
/** Label for the Select All header checkbox (defaults to `'Select All'`). */
|
|
31
|
+
selectAllLabel?: React.ReactNode;
|
|
32
|
+
/** Arrangement axis of group items (`horizontal` wraps cleanly; `vertical` stacks). */
|
|
33
|
+
direction?: 'horizontal' | 'vertical';
|
|
34
|
+
/** Optional fixed width per item (e.g. `160` for Figma's 160px grid alignment). */
|
|
35
|
+
itemWidth?: number | string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Omada Checkbox Group supporting `default` and linear `button` variants,
|
|
39
|
+
* option descriptions, fixed-width grid alignment, and an integrated `showSelectAll` toggle.
|
|
40
|
+
*/
|
|
41
|
+
export declare function SCheckboxGroup<T extends string | number = string | number>({ variant, options, showSelectAll, selectAllLabel, direction, itemWidth, value, defaultValue, onChange, disabled, name, className, style, children, ...rest }: SCheckboxGroupProps<T>): React.JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { OmadaClientIconName } from '../assets/assetsManifest';
|
|
3
|
+
export interface ClientOverviewItem {
|
|
4
|
+
/** Logical category identifier (`online-clients`, `mobile`, `others`, `office`). */
|
|
5
|
+
key: string;
|
|
6
|
+
/** Numeric KPI value rendered above the category label. */
|
|
7
|
+
count: number;
|
|
8
|
+
/** Category label displayed beneath the numeric KPI. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Official Figma client icon slug from `OMADA_CLIENTS`. */
|
|
11
|
+
icon: OmadaClientIconName;
|
|
12
|
+
/** Forces the light asset variant when the dark asset contains upstream artifacts. */
|
|
13
|
+
forceLightIcon?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface SClientOverviewStripProps {
|
|
16
|
+
/** 4 horizontal client overview KPI blocks (`Online Clients`, `Mobile`, `Others`, `Office`). */
|
|
17
|
+
items?: ClientOverviewItem[];
|
|
18
|
+
/** Optional currently active category filter key. */
|
|
19
|
+
activeKey?: string | null;
|
|
20
|
+
/** Optional click handler invoked when a KPI block is clicked. */
|
|
21
|
+
onItemClick?: (key: string) => void;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const DEFAULT_CLIENT_OVERVIEW_ITEMS: ClientOverviewItem[];
|
|
25
|
+
/**
|
|
26
|
+
* 4-column client overview KPI strip displayed above the Emulator Clients toolbar.
|
|
27
|
+
* Shows client category artwork (`SClientIcon`) paired with count and category label.
|
|
28
|
+
*/
|
|
29
|
+
export declare const SClientOverviewStrip: React.FC<SClientOverviewStripProps>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type CollapseProps } from 'antd';
|
|
3
|
+
export type SCollapseVariant = 'default' | 'card' | 'ghost';
|
|
4
|
+
export interface SCollapseItem {
|
|
5
|
+
key: string;
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
/** Optional subtitle displayed below the panel header title. */
|
|
8
|
+
subtitle?: React.ReactNode;
|
|
9
|
+
/** Optional status tag/badge/summary rendered on the right side of the header. */
|
|
10
|
+
status?: React.ReactNode;
|
|
11
|
+
/** Additional right-side header action/content. */
|
|
12
|
+
extra?: React.ReactNode;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
collapsible?: 'header' | 'icon' | 'disabled';
|
|
15
|
+
showArrow?: boolean;
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export interface SCollapseProps extends Omit<CollapseProps, 'items' | 'bordered' | 'ghost' | 'size'> {
|
|
19
|
+
items: SCollapseItem[];
|
|
20
|
+
variant?: SCollapseVariant;
|
|
21
|
+
/** AntD 6 size (`'small' | 'medium' | 'large'`). */
|
|
22
|
+
size?: 'small' | 'medium' | 'large';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Omada Collapse / Accordion panel supporting `default`, `card`, and `ghost` variants,
|
|
26
|
+
* header status/extra slots, smooth chevron rotation, and Light/Dark parity.
|
|
27
|
+
*/
|
|
28
|
+
export declare const SCollapse: React.FC<SCollapseProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ColorPickerProps } from 'antd';
|
|
3
|
+
import type { PresetsItem } from 'antd/es/color-picker/interface';
|
|
4
|
+
export type SColorPickerPreset = PresetsItem;
|
|
5
|
+
export interface SColorPickerProps extends ColorPickerProps {
|
|
6
|
+
/** Validation border state (`'error'` or `'warning'`). */
|
|
7
|
+
status?: 'error' | 'warning';
|
|
8
|
+
/** Toggle default Omada curated preset swatches (defaults to `true`). */
|
|
9
|
+
showPresets?: boolean;
|
|
10
|
+
/** Optional custom list of hex/css colors prepended as a quick palette group. */
|
|
11
|
+
presetColors?: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Omada ColorPicker with a `32px` filled trigger (`min-width: 171px` with HEX readout),
|
|
15
|
+
* curated Omada palette presets, and full Light/Dark theme legibility.
|
|
16
|
+
*/
|
|
17
|
+
export declare const SColorPicker: React.FC<SColorPickerProps>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DatePickerProps } from 'antd';
|
|
3
|
+
import type { RangePickerProps } from 'antd/es/date-picker';
|
|
4
|
+
export type OmadaPickerDate = NonNullable<NonNullable<RangePickerProps['value']>[0]>;
|
|
5
|
+
/**
|
|
6
|
+
* Extracts a native `Date` from an AntD/Dayjs date value or Date.
|
|
7
|
+
*/
|
|
8
|
+
export declare function toNativeDate(value: unknown): Date | null;
|
|
9
|
+
/**
|
|
10
|
+
* Creates a Dayjs-compatible wrapper backed by a native `Date` so AntD's
|
|
11
|
+
* `@rc-component/picker` dayjs adapter seamlessly promotes it to a real `Dayjs` instance.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createPickerDate(input: Date): OmadaPickerDate;
|
|
14
|
+
/**
|
|
15
|
+
* Formats a date range according to Omada Figma DatePicker (`43:34733`) rules:
|
|
16
|
+
* - Same day: `May 5, 2024`
|
|
17
|
+
* - Same month: `May 5 - 10, 2024`
|
|
18
|
+
* - Cross month (same year): `May 5 - Jun 10, 2024`
|
|
19
|
+
* - Cross year: `May 5, 2024 - May 4, 2025`
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatOmadaDateRange(start: Date, end: Date): string;
|
|
22
|
+
export interface SCapsulePreset {
|
|
23
|
+
key: string;
|
|
24
|
+
label: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
getRange: () => [Date, Date];
|
|
27
|
+
}
|
|
28
|
+
export type SRangeQuickPreset = NonNullable<RangePickerProps['presets']>[number];
|
|
29
|
+
export interface SDatePickerProps extends DatePickerProps {
|
|
30
|
+
/** Renders the picker input with an Omada capsule pill silhouette (`rounded-full`). */
|
|
31
|
+
capsule?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Omada single DatePicker defaulting to filled styling (`#F4F4F4` light / `#272727` dark),
|
|
35
|
+
* official Figma calendar icon, and optional capsule pill appearance.
|
|
36
|
+
*/
|
|
37
|
+
export declare const SDatePicker: React.FC<SDatePickerProps>;
|
|
38
|
+
export interface SRangePickerProps extends Omit<RangePickerProps, 'presets'> {
|
|
39
|
+
/** Renders Omada's Figma capsule preset switcher (`1D · 1W · 1M` + Custom calendar trigger). */
|
|
40
|
+
capsule?: boolean;
|
|
41
|
+
/** Quick preset list for standard RangePicker (pass `false` to hide default presets). */
|
|
42
|
+
presets?: RangePickerProps['presets'] | false;
|
|
43
|
+
/** Custom preset pills for `capsule` mode (defaults to `1D`, `1W`, `1M`). */
|
|
44
|
+
capsulePresets?: SCapsulePreset[];
|
|
45
|
+
/** Controlled active preset key in `capsule` mode (`'1d' | '1w' | '1m' | 'custom'`). */
|
|
46
|
+
activePreset?: string;
|
|
47
|
+
/** Initial active preset key in uncontrolled `capsule` mode. */
|
|
48
|
+
defaultPreset?: string;
|
|
49
|
+
/** Callback invoked when a capsule preset pill or custom range is selected. */
|
|
50
|
+
onPresetChange?: (presetKey: string, range: [Date, Date]) => void;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Omada Date RangePicker supporting:
|
|
54
|
+
* - Standard filled RangePicker with quick range presets (`Last 24 Hours`, `Last 7 Days`, `Last 30 Days`)
|
|
55
|
+
* - Capsule filter bar (`capsule`) with `1D · 1W · 1M` segmented pills + Custom calendar range trigger.
|
|
56
|
+
*/
|
|
57
|
+
export declare const SRangePicker: React.FC<SRangePickerProps>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DescriptionsProps } from 'antd';
|
|
3
|
+
import type { DescriptionsItemType } from 'antd/es/descriptions';
|
|
4
|
+
export type SDescriptionsVariant = 'bordered' | 'filled' | 'borderless';
|
|
5
|
+
export interface SDescriptionItem extends DescriptionsItemType {
|
|
6
|
+
/** Render the value in monospace font (ideal for IPs, MACs, serial numbers). */
|
|
7
|
+
mono?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface SDescriptionsProps extends Omit<DescriptionsProps, 'bordered' | 'size' | 'items'> {
|
|
10
|
+
items: SDescriptionItem[];
|
|
11
|
+
variant?: SDescriptionsVariant;
|
|
12
|
+
/** AntD 6 size (`'small' | 'medium' | 'large'`; never deprecated `'default'`). */
|
|
13
|
+
size?: 'small' | 'medium' | 'large';
|
|
14
|
+
/** Fixed label column width in horizontal mode (defaults to `200` per Omada Figma spec). */
|
|
15
|
+
labelWidth?: number | string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Omada Descriptions component supporting `bordered`, `filled`, and `borderless` variants,
|
|
19
|
+
* `horizontal` (`200px` fixed label column) and `vertical` layouts, and Light/Dark tokens.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SDescriptions: React.FC<SDescriptionsProps>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { OmadaIconName } from '../assets/iconsManifest';
|
|
3
|
+
export interface DeviceHealthCounts {
|
|
4
|
+
good: number;
|
|
5
|
+
fair: number;
|
|
6
|
+
poor: number;
|
|
7
|
+
noData: number;
|
|
8
|
+
}
|
|
9
|
+
export interface DeviceHealthSummaryItem {
|
|
10
|
+
key: 'gateway' | 'switch' | 'ap' | 'olt' | string;
|
|
11
|
+
label: string;
|
|
12
|
+
icon: OmadaIconName;
|
|
13
|
+
/** Single score label (e.g. `"Good - 10"`) or single count (e.g. `"1"`). */
|
|
14
|
+
summaryText?: string;
|
|
15
|
+
/** Semantic tone when rendering `summaryText` without `counts` breakdown. */
|
|
16
|
+
summaryTone?: 'good' | 'fair' | 'poor' | 'muted';
|
|
17
|
+
/** 4-bucket health distribution rendered as `G / F / P / N` + 200x4px segmented bar. */
|
|
18
|
+
counts?: DeviceHealthCounts;
|
|
19
|
+
/** Whether to show the 200x4px segmented distribution bar beneath `counts`. */
|
|
20
|
+
showBar?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface SDeviceHealthSummaryProps {
|
|
23
|
+
/** Health summary items across device categories (defaults to Gateway / Switches / APs / OLTs). */
|
|
24
|
+
items?: DeviceHealthSummaryItem[];
|
|
25
|
+
/** Optional click handler when a category block is clicked. */
|
|
26
|
+
onCategoryClick?: (key: string) => void;
|
|
27
|
+
className?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const DEFAULT_DEVICE_HEALTH_SUMMARY_ITEMS: DeviceHealthSummaryItem[];
|
|
30
|
+
/**
|
|
31
|
+
* 4-column device health summary strip displayed above the Emulator Devices toolbar.
|
|
32
|
+
* Shows category icon, health score or `Good / Fair / Poor / No Data` counts, and a 200x4px segmented bar.
|
|
33
|
+
*/
|
|
34
|
+
export declare const SDeviceHealthSummary: React.FC<SDeviceHealthSummaryProps>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { OmadaProductName } from '../assets/assetsManifest';
|
|
3
|
+
/**
|
|
4
|
+
* Physical switch / gateway port item used by `SDevicePortGraphic` and `DevicePropertiesDrawer`.
|
|
5
|
+
*/
|
|
6
|
+
export interface DrawerPortItem {
|
|
7
|
+
port: number;
|
|
8
|
+
name: string;
|
|
9
|
+
linkStatus: '10g' | '2.5g' | '1000m' | '100m' | 'disabled' | 'disconnected';
|
|
10
|
+
isSfp?: boolean;
|
|
11
|
+
isUplink?: boolean;
|
|
12
|
+
isPoe?: boolean;
|
|
13
|
+
isMirroring?: boolean;
|
|
14
|
+
isBlocking?: boolean;
|
|
15
|
+
isLag?: boolean;
|
|
16
|
+
lacp?: string;
|
|
17
|
+
connectionName?: string;
|
|
18
|
+
connectionProductSlug?: string;
|
|
19
|
+
connectionType?: 'gateway' | 'switch' | 'ap' | 'olt' | 'client';
|
|
20
|
+
label?: string;
|
|
21
|
+
type?: string;
|
|
22
|
+
poeCapability?: string;
|
|
23
|
+
profile?: string;
|
|
24
|
+
nativeNetwork?: string;
|
|
25
|
+
txSum?: string;
|
|
26
|
+
rxSum?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface SDevicePortGraphicProps {
|
|
29
|
+
/** Ordered list of physical ports on the device. */
|
|
30
|
+
ports: DrawerPortItem[];
|
|
31
|
+
/** `compact` renders 32px tiles + Used Port header; `full` renders 40px tiles + optional connected devices + legend. */
|
|
32
|
+
mode?: 'compact' | 'full';
|
|
33
|
+
/** Displays floating connected device thumbnails with vertical stem lines above connected ports in `full` mode. */
|
|
34
|
+
showConnectedDevices?: boolean;
|
|
35
|
+
/** Controls the `Used Port: X/Y` + info icon header row (defaults to `true` in `compact` mode). */
|
|
36
|
+
showHeader?: boolean;
|
|
37
|
+
/** Controls the 10-item horizontal port legend below the graphic (defaults to `true` in `full` mode). */
|
|
38
|
+
showLegend?: boolean;
|
|
39
|
+
/** Override count of used ports shown in compact header. */
|
|
40
|
+
usedPorts?: number;
|
|
41
|
+
/** Override count of total ports shown in compact header. */
|
|
42
|
+
totalPorts?: number;
|
|
43
|
+
/** Currently selected port number for table/graphic synchronization. */
|
|
44
|
+
selectedPort?: number | null;
|
|
45
|
+
/** Callback fired when a port tile is clicked. */
|
|
46
|
+
onSelectPort?: (port: DrawerPortItem) => void;
|
|
47
|
+
className?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface PortBadgeTileProps {
|
|
50
|
+
port: Pick<DrawerPortItem, 'port' | 'name' | 'linkStatus' | 'isSfp' | 'isUplink' | 'isPoe' | 'isMirroring' | 'isBlocking' | 'isLag'>;
|
|
51
|
+
size?: number;
|
|
52
|
+
interactive?: boolean;
|
|
53
|
+
selected?: boolean;
|
|
54
|
+
onClick?: () => void;
|
|
55
|
+
className?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Resolves a valid `SProductImage` slug for a connected neighbor device.
|
|
59
|
+
*/
|
|
60
|
+
export declare function resolveConnectedProductSlug(slug?: string, connectionType?: DrawerPortItem['connectionType'], connectionName?: string): OmadaProductName;
|
|
61
|
+
/**
|
|
62
|
+
* Crisp white/monochrome SFP fiber transceiver module icon matching Omada Controller v6.3.
|
|
63
|
+
*/
|
|
64
|
+
export declare const SfpGlyph: React.FC<{
|
|
65
|
+
size?: number;
|
|
66
|
+
className?: string;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* Link Aggregation (LAG) stacked-port badge glyph.
|
|
70
|
+
*/
|
|
71
|
+
export declare const LagGlyph: React.FC<{
|
|
72
|
+
size?: number;
|
|
73
|
+
className?: string;
|
|
74
|
+
}>;
|
|
75
|
+
/**
|
|
76
|
+
* Single physical port square tile used in port graphics, connection rows, and port tables.
|
|
77
|
+
*/
|
|
78
|
+
export declare const PortBadgeTile: React.FC<PortBadgeTileProps>;
|
|
79
|
+
/**
|
|
80
|
+
* 10-item horizontal port speed & attribute legend matching Omada Controller v6.3.
|
|
81
|
+
*/
|
|
82
|
+
export declare const PortStatusLegend: React.FC<{
|
|
83
|
+
ports?: DrawerPortItem[];
|
|
84
|
+
className?: string;
|
|
85
|
+
}>;
|
|
86
|
+
/**
|
|
87
|
+
* Interactive physical port strip for Omada Quick Properties (`mode="compact"`)
|
|
88
|
+
* and Expanded Manage Device Ports view (`mode="full"` with floating connected device thumbnails).
|
|
89
|
+
*/
|
|
90
|
+
export declare const SDevicePortGraphic: React.FC<SDevicePortGraphicProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type DeviceStatusType = 'connected' | 'disconnected' | 'heartbeat-missed' | 'adopt-failed' | 'pending' | 'provisioning' | 'isolated';
|
|
3
|
+
export interface SDeviceStatusProps {
|
|
4
|
+
status: DeviceStatusType;
|
|
5
|
+
label?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Semantic network device connectivity/provisioning indicator with colored status dot.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SDeviceStatus: React.FC<SDeviceStatusProps>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DividerProps } from 'antd';
|
|
3
|
+
export type SDividerOrientation = 'horizontal' | 'vertical';
|
|
4
|
+
export type SDividerVariant = 'solid' | 'dashed' | 'dotted';
|
|
5
|
+
export type SDividerTitlePlacement = 'left' | 'right' | 'center' | 'start' | 'end';
|
|
6
|
+
export type SDividerSize = 'small' | 'medium';
|
|
7
|
+
export interface SDividerProps extends Omit<DividerProps, 'type' | 'orientation' | 'orientationMargin' | 'size' | 'dashed'> {
|
|
8
|
+
/** Divider orientation (AntD 6 `orientation`; replaces deprecated `type`). */
|
|
9
|
+
orientation?: SDividerOrientation;
|
|
10
|
+
/** Stroke style (`solid`, `dashed`, or `dotted`). */
|
|
11
|
+
variant?: SDividerVariant;
|
|
12
|
+
/** Title position when children are provided. */
|
|
13
|
+
titlePlacement?: SDividerTitlePlacement;
|
|
14
|
+
/** Vertical spacing density (`small` or `medium`). */
|
|
15
|
+
size?: SDividerSize;
|
|
16
|
+
/** Adds Figma's 24px (`px-6`) horizontal inset margin for settings form panels. */
|
|
17
|
+
inset?: boolean;
|
|
18
|
+
/** Convenience dashed toggle mapped cleanly to `variant="dashed"`. */
|
|
19
|
+
dashed?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Omada Divider (`3:64432`):
|
|
23
|
+
* - `1px` `--omada-border-divider` hairline horizontal & vertical dividers
|
|
24
|
+
* - Titled dividers (`Manrope 12px` `--omada-text-tertiary`) and `inset` form margins (`24px`).
|
|
25
|
+
*/
|
|
26
|
+
export declare const SDivider: React.FC<SDividerProps>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface SDonutSummaryItem {
|
|
3
|
+
/** Unique item identifier. */
|
|
4
|
+
key: string;
|
|
5
|
+
/** Display label for the slice and breakdown row. */
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
/** Numeric metric value used to compute slice proportions. */
|
|
8
|
+
value: number;
|
|
9
|
+
/** Formatted readout rendered on the right (e.g. `"58.30 MB"` or `"2 (50%)"`). */
|
|
10
|
+
displayValue?: React.ReactNode;
|
|
11
|
+
/** Optional override color for this slice and legend swatch. */
|
|
12
|
+
color?: string;
|
|
13
|
+
/** Optional leading icon/badge rendered before `label` in vertical item rows. */
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
/** When true, styles the right value as a clickable action link with chevron. */
|
|
16
|
+
clickable?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface SDonutSummaryCardProps {
|
|
19
|
+
/** Card header title. */
|
|
20
|
+
title: React.ReactNode;
|
|
21
|
+
/** Optional icon rendered before `title`. */
|
|
22
|
+
titleIcon?: React.ReactNode;
|
|
23
|
+
/** Primary metric centered inside the donut ring (e.g. `"58.33 MB"` or `"4"`). */
|
|
24
|
+
centerValue: React.ReactNode;
|
|
25
|
+
/** Secondary subtitle centered below `centerValue` (e.g. `"Traffic"` or `"Total"`). */
|
|
26
|
+
centerLabel?: React.ReactNode;
|
|
27
|
+
/** Breakdown items powering both the donut slices and the item/legend list. */
|
|
28
|
+
data: SDonutSummaryItem[];
|
|
29
|
+
/**
|
|
30
|
+
* `'vertical'` stacks the donut above clickable breakdown rows (Application Analytics).
|
|
31
|
+
* `'horizontal'` aligns the donut on the left and a compact legend on the right (Reports).
|
|
32
|
+
*/
|
|
33
|
+
layout?: 'vertical' | 'horizontal';
|
|
34
|
+
/** Number of columns for horizontal legend layout (`1` or `2`). */
|
|
35
|
+
legendColumns?: 1 | 2;
|
|
36
|
+
/** Donut canvas diameter in pixels. */
|
|
37
|
+
donutSize?: number;
|
|
38
|
+
/** ECharts pie inner/outer radius percentages. */
|
|
39
|
+
radius?: [string, string];
|
|
40
|
+
/** Show a close (`×`) button in the card header. */
|
|
41
|
+
closable?: boolean;
|
|
42
|
+
/** Callback invoked when the close (`×`) button is clicked. */
|
|
43
|
+
onClose?: () => void;
|
|
44
|
+
/** Accessibility label for the close button. */
|
|
45
|
+
closeAriaLabel?: string;
|
|
46
|
+
/** Callback invoked when a clickable breakdown row is activated. */
|
|
47
|
+
onItemClick?: (item: SDonutSummaryItem) => void;
|
|
48
|
+
/** Optional extra header element rendered when `closable` is false. */
|
|
49
|
+
extra?: React.ReactNode;
|
|
50
|
+
/** Optional accessible label or test id on the card root. */
|
|
51
|
+
'data-testid'?: string;
|
|
52
|
+
className?: string;
|
|
53
|
+
style?: React.CSSProperties;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Omada Donut Summary Card pairing a ring chart with centered metric overlay and
|
|
57
|
+
* either vertical interactive breakdown rows (`Application Analytics`) or a compact
|
|
58
|
+
* side-by-side legend (`Reports`).
|
|
59
|
+
*/
|
|
60
|
+
export declare const SDonutSummaryCard: React.FC<SDonutSummaryCardProps>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DrawerProps } from 'antd';
|
|
3
|
+
export type SDrawerSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export interface SDrawerProps extends Omit<DrawerProps, 'size' | 'width'> {
|
|
5
|
+
size?: SDrawerSize;
|
|
6
|
+
width?: number | string;
|
|
7
|
+
subtitle?: React.ReactNode;
|
|
8
|
+
statusSlot?: React.ReactNode;
|
|
9
|
+
headerTabs?: React.ReactNode;
|
|
10
|
+
/** Displays a skeleton placeholder inside the drawer body while data loads */
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Omada slide-over Drawer (`sm`: 480px, `md`: 640px, `lg`: 880px)
|
|
15
|
+
* supporting a rich header slot with subtitle, status badge, tabs, and loading skeleton.
|
|
16
|
+
*/
|
|
17
|
+
export declare const SDrawer: React.FC<SDrawerProps>;
|
|
18
|
+
export interface SDrawerFooterProps {
|
|
19
|
+
onCancel?: () => void;
|
|
20
|
+
onOk?: () => void;
|
|
21
|
+
cancelText?: React.ReactNode | null;
|
|
22
|
+
okText?: React.ReactNode | null;
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
okDisabled?: boolean;
|
|
25
|
+
danger?: boolean;
|
|
26
|
+
align?: 'left' | 'right' | 'between';
|
|
27
|
+
/** Make footer sticky inside scrollable drawer body (adds top border & surface fill) */
|
|
28
|
+
sticky?: boolean;
|
|
29
|
+
extra?: React.ReactNode;
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Standardized Omada drawer footer bar for `SDrawer`'s `footer` prop or sticky bottom body placement.
|
|
35
|
+
*/
|
|
36
|
+
export declare const SDrawerFooter: React.FC<SDrawerFooterProps>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DropdownProps, type MenuProps } from 'antd';
|
|
3
|
+
export type SDropdownWidthPreset = 'compact' | 'default' | 'wide';
|
|
4
|
+
export type SDropdownPlacement = 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight';
|
|
5
|
+
export type SDropdownItem = NonNullable<MenuProps['items']>[number];
|
|
6
|
+
export interface SDropdownProps extends Omit<DropdownProps, 'dropdownRender' | 'destroyPopupOnHide' | 'overlayClassName' | 'overlayStyle' | 'placement'> {
|
|
7
|
+
/** Convenience menu items array when not passing a full `menu` object. */
|
|
8
|
+
items?: SDropdownItem[];
|
|
9
|
+
/** Selected item keys highlighted with brand tint and check indicator. */
|
|
10
|
+
selectedKeys?: string[];
|
|
11
|
+
/** Convenience click handler invoked with the clicked menu item key. */
|
|
12
|
+
onSelect?: (key: string) => void;
|
|
13
|
+
/** Enables check indicator rendering on selected items. */
|
|
14
|
+
selectable?: boolean;
|
|
15
|
+
/** Width preset matching Figma `3:64442` (`compact`: 178px, `default`: 216px, `wide`: 275px). */
|
|
16
|
+
widthPreset?: SDropdownWidthPreset;
|
|
17
|
+
/** Explicit popup menu width override. */
|
|
18
|
+
menuWidth?: number | string;
|
|
19
|
+
/** Displays a search input at the top of the dropdown panel. */
|
|
20
|
+
searchable?: boolean;
|
|
21
|
+
/** Placeholder for the dropdown search input. */
|
|
22
|
+
searchPlaceholder?: string;
|
|
23
|
+
/** Optional header element rendered above the menu list. */
|
|
24
|
+
header?: React.ReactNode;
|
|
25
|
+
/** Optional footer element rendered below the menu list. */
|
|
26
|
+
footer?: React.ReactNode;
|
|
27
|
+
/** Popup placement (uses AntD 6 non-deprecated placement tokens). */
|
|
28
|
+
placement?: SDropdownPlacement;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Omada Dropdown Menu (`3:64442`):
|
|
32
|
+
* - AntD 6 `popupRender` + `destroyOnHidden` + semantic `classNames`/`styles`
|
|
33
|
+
* - Width presets (`178px`, `216px`, `275px`), grouped sections, checkable items,
|
|
34
|
+
* nested submenus, and optional built-in search & footer slots.
|
|
35
|
+
*/
|
|
36
|
+
export declare const SDropdown: React.FC<SDropdownProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { OmadaIllustrationName } from '../assets/assetsManifest';
|
|
3
|
+
export interface SEmptyProps {
|
|
4
|
+
title?: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
illustration?: OmadaIllustrationName | false;
|
|
8
|
+
illustrationWidth?: number;
|
|
9
|
+
action?: React.ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Clean Omada empty state placeholder for tables, drawers, and sub-panels.
|
|
14
|
+
* Defaults to the official theme-aware Figma `no-data` illustration unless overridden
|
|
15
|
+
* via `icon` or `illustration={false}`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const SEmpty: React.FC<SEmptyProps>;
|