@zhin.js/console-ui 1.0.0 → 1.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/CHANGELOG.md +45 -0
- package/README.md +118 -11
- package/audit/index.mjs +21 -0
- package/audit/layout-audit.mjs +492 -0
- package/audit/mount-page.jsx +90 -0
- package/audit/plugin-pages.mjs +186 -0
- package/dist/components/BrandMark.d.ts +16 -0
- package/dist/components/BrandMark.js +21 -0
- package/dist/components/InfoHint.js +2 -1
- package/dist/components/PageHeader.d.ts +9 -2
- package/dist/components/PageHeader.js +6 -3
- package/dist/components/PageShell.d.ts +18 -3
- package/dist/components/PageShell.js +5 -3
- package/dist/components/RefreshControl.d.ts +6 -1
- package/dist/components/RefreshControl.js +9 -6
- package/dist/components/StatCard.d.ts +19 -5
- package/dist/components/StatCard.js +36 -10
- package/dist/components/StatusBadge.d.ts +14 -0
- package/dist/components/StatusBadge.js +19 -0
- package/dist/components/actions.d.ts +53 -0
- package/dist/components/actions.js +50 -0
- package/dist/components/code.d.ts +11 -0
- package/dist/components/code.js +10 -0
- package/dist/components/confirm-dialog.js +3 -2
- package/dist/components/content-blocks.d.ts +141 -0
- package/dist/components/content-blocks.js +77 -0
- package/dist/components/empty-illustrations.d.ts +15 -0
- package/dist/components/empty-illustrations.js +36 -0
- package/dist/components/empty-state.d.ts +23 -3
- package/dist/components/empty-state.js +36 -8
- package/dist/components/error-alert.js +2 -1
- package/dist/components/icon.d.ts +11 -0
- package/dist/components/icon.js +8 -0
- package/dist/components/layout.d.ts +38 -0
- package/dist/components/layout.js +28 -0
- package/dist/components/page-chrome.d.ts +12 -0
- package/dist/components/page-chrome.js +6 -5
- package/dist/components/ui/accordion.js +3 -2
- package/dist/components/ui/alert.js +5 -5
- package/dist/components/ui/badge.js +10 -9
- package/dist/components/ui/button.d.ts +10 -1
- package/dist/components/ui/button.js +26 -11
- package/dist/components/ui/card.d.ts +6 -0
- package/dist/components/ui/card.js +5 -4
- package/dist/components/ui/checkbox.js +2 -1
- package/dist/components/ui/control-variant.d.ts +10 -0
- package/dist/components/ui/control-variant.js +6 -0
- package/dist/components/ui/date-field-model.d.ts +39 -0
- package/dist/components/ui/date-field-model.js +105 -0
- package/dist/components/ui/date-field.d.ts +33 -0
- package/dist/components/ui/date-field.js +161 -0
- package/dist/components/ui/dialog.js +7 -6
- package/dist/components/ui/dropdown-menu.js +6 -5
- package/dist/components/ui/input.d.ts +6 -1
- package/dist/components/ui/input.js +3 -2
- package/dist/components/ui/list-item-button.js +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/radio-group.js +1 -1
- package/dist/components/ui/scroll-area.js +1 -1
- package/dist/components/ui/searchable-select.d.ts +3 -0
- package/dist/components/ui/searchable-select.js +4 -3
- package/dist/components/ui/select.d.ts +7 -1
- package/dist/components/ui/select.js +7 -5
- package/dist/components/ui/sheet.js +4 -3
- package/dist/components/ui/skeleton.js +1 -1
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.js +37 -6
- package/dist/components/ui/tabs.js +3 -3
- package/dist/components/ui/textarea.d.ts +6 -1
- package/dist/components/ui/textarea.js +3 -2
- package/dist/components/ui/tooltip.js +1 -1
- package/dist/components/use-container-width.d.ts +13 -0
- package/dist/components/use-container-width.js +30 -0
- package/dist/custom-media.css +13 -0
- package/dist/exports.json +41 -1
- package/dist/i18n/messages.d.ts +20 -1
- package/dist/i18n/messages.js +40 -2
- package/dist/index.d.ts +12 -0
- package/dist/index.js +11 -0
- package/dist/scale.json +643 -0
- package/dist/styles.css +1919 -836
- package/dist/theme.css +469 -0
- package/dist/tokens.css +434 -123
- package/dist/version.js +1 -1
- package/lint/eslint-plugin.mjs +128 -0
- package/lint/stylelint-config.mjs +43 -0
- package/lint/stylelint-plugin.mjs +195 -0
- package/lint/tailwind-classes.mjs +121 -0
- package/package.json +33 -3
- package/tokens/color.mjs +104 -0
- package/tokens/colors.css +220 -0
- package/tokens/generate.mjs +288 -0
- package/tokens/scale.mjs +137 -0
- package/tokens/tokens.mjs +362 -0
package/dist/exports.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/console-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"exports": [
|
|
5
5
|
"Accordion",
|
|
6
6
|
"AccordionContent",
|
|
@@ -10,7 +10,12 @@
|
|
|
10
10
|
"AlertDescription",
|
|
11
11
|
"AlertTitle",
|
|
12
12
|
"Badge",
|
|
13
|
+
"BrandMark",
|
|
13
14
|
"Button",
|
|
15
|
+
"CONSOLE_BREAKPOINTS_REM",
|
|
16
|
+
"CONSOLE_ICON_SIZE",
|
|
17
|
+
"CONSOLE_ICON_STROKE_WIDTH",
|
|
18
|
+
"CONSOLE_PRODUCT_NAME",
|
|
14
19
|
"CONSOLE_SHARED_MODULE_ISSUES_KEY",
|
|
15
20
|
"CONSOLE_SHARED_MODULE_ISSUE_EVENT",
|
|
16
21
|
"CONSOLE_SHARED_MODULE_VERSIONS_KEY",
|
|
@@ -25,11 +30,15 @@
|
|
|
25
30
|
"CardHeader",
|
|
26
31
|
"CardTitle",
|
|
27
32
|
"Checkbox",
|
|
33
|
+
"CodeText",
|
|
28
34
|
"ConfirmDialog",
|
|
29
35
|
"ConsoleUiI18nProvider",
|
|
30
36
|
"ConsoleUiText",
|
|
37
|
+
"ContentStack",
|
|
31
38
|
"DEFAULT_CONSOLE_UI_LOCALE",
|
|
32
39
|
"DEFAULT_REFRESH_INTERVALS",
|
|
40
|
+
"DateField",
|
|
41
|
+
"DateTimeField",
|
|
33
42
|
"Dialog",
|
|
34
43
|
"DialogClose",
|
|
35
44
|
"DialogContent",
|
|
@@ -40,6 +49,7 @@
|
|
|
40
49
|
"DialogPortal",
|
|
41
50
|
"DialogTitle",
|
|
42
51
|
"DialogTrigger",
|
|
52
|
+
"Disclosure",
|
|
43
53
|
"DropdownMenu",
|
|
44
54
|
"DropdownMenuCheckboxItem",
|
|
45
55
|
"DropdownMenuContent",
|
|
@@ -52,12 +62,24 @@
|
|
|
52
62
|
"DropdownMenuSeparator",
|
|
53
63
|
"DropdownMenuSub",
|
|
54
64
|
"DropdownMenuTrigger",
|
|
65
|
+
"EMPTY_ILLUSTRATIONS",
|
|
66
|
+
"EmptyIllustration",
|
|
55
67
|
"EmptyState",
|
|
56
68
|
"ErrorAlert",
|
|
69
|
+
"FormField",
|
|
70
|
+
"Grid",
|
|
57
71
|
"InfoHint",
|
|
72
|
+
"InlineCode",
|
|
58
73
|
"Input",
|
|
74
|
+
"JsonBlock",
|
|
75
|
+
"KeyValueList",
|
|
76
|
+
"ListDetail",
|
|
59
77
|
"ListItemButton",
|
|
78
|
+
"LoadingBlock",
|
|
79
|
+
"MediaPreview",
|
|
60
80
|
"MiniRingGauge",
|
|
81
|
+
"MoreMenu",
|
|
82
|
+
"PageActions",
|
|
61
83
|
"PageChromeActions",
|
|
62
84
|
"PageChromeProvider",
|
|
63
85
|
"PageHeader",
|
|
@@ -66,12 +88,16 @@
|
|
|
66
88
|
"PopoverAnchor",
|
|
67
89
|
"PopoverContent",
|
|
68
90
|
"PopoverTrigger",
|
|
91
|
+
"ProgressMeter",
|
|
69
92
|
"RadioGroup",
|
|
70
93
|
"RadioGroupItem",
|
|
94
|
+
"RecordCard",
|
|
71
95
|
"RefreshControl",
|
|
96
|
+
"RowActions",
|
|
72
97
|
"ScrollArea",
|
|
73
98
|
"ScrollBar",
|
|
74
99
|
"SearchableSelectField",
|
|
100
|
+
"Section",
|
|
75
101
|
"Select",
|
|
76
102
|
"SelectContent",
|
|
77
103
|
"SelectField",
|
|
@@ -95,8 +121,10 @@
|
|
|
95
121
|
"SheetTitle",
|
|
96
122
|
"SheetTrigger",
|
|
97
123
|
"Skeleton",
|
|
124
|
+
"Sparkline",
|
|
98
125
|
"StatCard",
|
|
99
126
|
"StatGrid",
|
|
127
|
+
"StatusBadge",
|
|
100
128
|
"Switch",
|
|
101
129
|
"Table",
|
|
102
130
|
"TableBody",
|
|
@@ -109,12 +137,16 @@
|
|
|
109
137
|
"TabsList",
|
|
110
138
|
"TabsTrigger",
|
|
111
139
|
"Textarea",
|
|
140
|
+
"Timeline",
|
|
112
141
|
"Tooltip",
|
|
113
142
|
"TooltipContent",
|
|
114
143
|
"TooltipProvider",
|
|
115
144
|
"TooltipTrigger",
|
|
145
|
+
"addDays",
|
|
146
|
+
"addMonths",
|
|
116
147
|
"badgeVariants",
|
|
117
148
|
"buttonVariants",
|
|
149
|
+
"calendarMonth",
|
|
118
150
|
"canSubmitConfirm",
|
|
119
151
|
"cn",
|
|
120
152
|
"confirmErrorMessage",
|
|
@@ -122,16 +154,24 @@
|
|
|
122
154
|
"createConsoleUiI18n",
|
|
123
155
|
"createPageChromeStore",
|
|
124
156
|
"formatConsoleUiMessage",
|
|
157
|
+
"formatDateTimeValue",
|
|
158
|
+
"formatDateValue",
|
|
125
159
|
"formatRefreshTime",
|
|
126
160
|
"groupSelectOptions",
|
|
161
|
+
"isAttentionStatus",
|
|
162
|
+
"isZeroValue",
|
|
127
163
|
"navigableValues",
|
|
128
164
|
"optionMatches",
|
|
129
165
|
"optionSearchText",
|
|
166
|
+
"parseDateTimeValue",
|
|
167
|
+
"parseDateValue",
|
|
130
168
|
"refreshIntervalOptions",
|
|
131
169
|
"registerConsoleUiSharedModule",
|
|
132
170
|
"resolveConsoleUiLocale",
|
|
171
|
+
"syncTableCellLabels",
|
|
133
172
|
"useConfirm",
|
|
134
173
|
"useConsoleUiI18n",
|
|
174
|
+
"useContainerAtLeast",
|
|
135
175
|
"usePageChrome",
|
|
136
176
|
"usePageChromeState"
|
|
137
177
|
]
|
package/dist/i18n/messages.d.ts
CHANGED
|
@@ -14,7 +14,24 @@ declare const zhCN: {
|
|
|
14
14
|
readonly 'confirm.failed': "操作失败,请重试或取消。";
|
|
15
15
|
readonly 'confirm.notCompleted': "操作未完成:{0}";
|
|
16
16
|
readonly 'confirm.typeToConfirm': "请输入 {0} 以确认:";
|
|
17
|
-
readonly 'empty.noData': "
|
|
17
|
+
readonly 'empty.noData': "这里还没有内容";
|
|
18
|
+
readonly 'empty.messages': "还没有消息";
|
|
19
|
+
readonly 'empty.tasks': "还没有任务";
|
|
20
|
+
readonly 'empty.logs': "还没有日志";
|
|
21
|
+
readonly 'empty.table': "在左侧选择一个数据表";
|
|
22
|
+
readonly 'empty.record': "选择一条记录查看详情";
|
|
23
|
+
readonly 'empty.notFound': "找不到这个页面";
|
|
24
|
+
readonly 'date.placeholder': "选择日期";
|
|
25
|
+
readonly 'date.placeholderDateTime': "选择日期和时间";
|
|
26
|
+
readonly 'date.clear': "清除";
|
|
27
|
+
readonly 'date.prevMonth': "上个月";
|
|
28
|
+
readonly 'date.nextMonth': "下个月";
|
|
29
|
+
readonly 'date.today': "今天";
|
|
30
|
+
readonly 'date.now': "现在";
|
|
31
|
+
readonly 'date.time': "时间";
|
|
32
|
+
readonly 'date.hour': "时";
|
|
33
|
+
readonly 'date.minute': "分";
|
|
34
|
+
readonly 'date.done': "完成";
|
|
18
35
|
readonly 'error.retry': "重试";
|
|
19
36
|
readonly 'error.technicalDetail': "技术详情";
|
|
20
37
|
readonly 'select.searchPlaceholder': "搜索…";
|
|
@@ -26,6 +43,8 @@ declare const zhCN: {
|
|
|
26
43
|
readonly 'refresh.interval': "自动刷新间隔";
|
|
27
44
|
readonly 'refresh.manual': "手动刷新";
|
|
28
45
|
readonly 'refresh.auto': "{0}s 自动";
|
|
46
|
+
readonly 'actions.more': "更多";
|
|
47
|
+
readonly 'listDetail.detail': "详情";
|
|
29
48
|
};
|
|
30
49
|
export type ConsoleUiMessageKey = keyof typeof zhCN;
|
|
31
50
|
export type ConsoleUiMessages = Readonly<Record<ConsoleUiMessageKey, string>>;
|
package/dist/i18n/messages.js
CHANGED
|
@@ -13,7 +13,24 @@ const zhCN = {
|
|
|
13
13
|
'confirm.failed': '操作失败,请重试或取消。',
|
|
14
14
|
'confirm.notCompleted': '操作未完成:{0}',
|
|
15
15
|
'confirm.typeToConfirm': '请输入 {0} 以确认:',
|
|
16
|
-
'empty.noData': '
|
|
16
|
+
'empty.noData': '这里还没有内容',
|
|
17
|
+
'empty.messages': '还没有消息',
|
|
18
|
+
'empty.tasks': '还没有任务',
|
|
19
|
+
'empty.logs': '还没有日志',
|
|
20
|
+
'empty.table': '在左侧选择一个数据表',
|
|
21
|
+
'empty.record': '选择一条记录查看详情',
|
|
22
|
+
'empty.notFound': '找不到这个页面',
|
|
23
|
+
'date.placeholder': '选择日期',
|
|
24
|
+
'date.placeholderDateTime': '选择日期和时间',
|
|
25
|
+
'date.clear': '清除',
|
|
26
|
+
'date.prevMonth': '上个月',
|
|
27
|
+
'date.nextMonth': '下个月',
|
|
28
|
+
'date.today': '今天',
|
|
29
|
+
'date.now': '现在',
|
|
30
|
+
'date.time': '时间',
|
|
31
|
+
'date.hour': '时',
|
|
32
|
+
'date.minute': '分',
|
|
33
|
+
'date.done': '完成',
|
|
17
34
|
'error.retry': '重试',
|
|
18
35
|
'error.technicalDetail': '技术详情',
|
|
19
36
|
'select.searchPlaceholder': '搜索…',
|
|
@@ -25,6 +42,8 @@ const zhCN = {
|
|
|
25
42
|
'refresh.interval': '自动刷新间隔',
|
|
26
43
|
'refresh.manual': '手动刷新',
|
|
27
44
|
'refresh.auto': '{0}s 自动',
|
|
45
|
+
'actions.more': '更多',
|
|
46
|
+
'listDetail.detail': '详情',
|
|
28
47
|
};
|
|
29
48
|
const en = {
|
|
30
49
|
'dialog.close': 'Close',
|
|
@@ -34,7 +53,24 @@ const en = {
|
|
|
34
53
|
'confirm.failed': 'The action failed. Try again or cancel.',
|
|
35
54
|
'confirm.notCompleted': 'Not completed: {0}',
|
|
36
55
|
'confirm.typeToConfirm': 'Type {0} to confirm:',
|
|
37
|
-
'empty.noData': '
|
|
56
|
+
'empty.noData': 'Nothing here yet',
|
|
57
|
+
'empty.messages': 'No messages yet',
|
|
58
|
+
'empty.tasks': 'No tasks yet',
|
|
59
|
+
'empty.logs': 'No logs yet',
|
|
60
|
+
'empty.table': 'Select a table on the left',
|
|
61
|
+
'empty.record': 'Select a record to see its details',
|
|
62
|
+
'empty.notFound': 'Page not found',
|
|
63
|
+
'date.placeholder': 'Pick a date',
|
|
64
|
+
'date.placeholderDateTime': 'Pick a date and time',
|
|
65
|
+
'date.clear': 'Clear',
|
|
66
|
+
'date.prevMonth': 'Previous month',
|
|
67
|
+
'date.nextMonth': 'Next month',
|
|
68
|
+
'date.today': 'Today',
|
|
69
|
+
'date.now': 'Now',
|
|
70
|
+
'date.time': 'Time',
|
|
71
|
+
'date.hour': 'Hour',
|
|
72
|
+
'date.minute': 'Minute',
|
|
73
|
+
'date.done': 'Done',
|
|
38
74
|
'error.retry': 'Retry',
|
|
39
75
|
'error.technicalDetail': 'Technical details',
|
|
40
76
|
'select.searchPlaceholder': 'Search…',
|
|
@@ -46,6 +82,8 @@ const en = {
|
|
|
46
82
|
'refresh.interval': 'Auto refresh interval',
|
|
47
83
|
'refresh.manual': 'Manual refresh',
|
|
48
84
|
'refresh.auto': '{0}s auto',
|
|
85
|
+
'actions.more': 'More',
|
|
86
|
+
'listDetail.detail': 'Details',
|
|
49
87
|
};
|
|
50
88
|
export const CONSOLE_UI_MESSAGES = Object.freeze({
|
|
51
89
|
'zh-CN': Object.freeze({ ...zhCN }),
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,9 @@ export * from './components/ui/badge.js';
|
|
|
13
13
|
export * from './components/ui/button.js';
|
|
14
14
|
export * from './components/ui/card.js';
|
|
15
15
|
export * from './components/ui/checkbox.js';
|
|
16
|
+
export type { ControlVariant } from './components/ui/control-variant.js';
|
|
17
|
+
export * from './components/ui/date-field.js';
|
|
18
|
+
export { addDays, addMonths, calendarMonth, formatDateTimeValue, formatDateValue, parseDateTimeValue, parseDateValue, type CalendarDate, type CalendarDateTime, } from './components/ui/date-field-model.js';
|
|
16
19
|
export * from './components/ui/dialog.js';
|
|
17
20
|
export * from './components/ui/dropdown-menu.js';
|
|
18
21
|
export * from './components/ui/input.js';
|
|
@@ -36,9 +39,18 @@ export * from './components/PageHeader.js';
|
|
|
36
39
|
export * from './components/confirm-dialog.js';
|
|
37
40
|
export { canSubmitConfirm, confirmErrorMessage, confirmTextMatches } from './components/confirm-dialog-model.js';
|
|
38
41
|
export * from './components/StatCard.js';
|
|
42
|
+
export * from './components/BrandMark.js';
|
|
39
43
|
export * from './components/empty-state.js';
|
|
44
|
+
export * from './components/empty-illustrations.js';
|
|
45
|
+
export * from './components/code.js';
|
|
46
|
+
export { CONSOLE_ICON_SIZE, CONSOLE_ICON_STROKE_WIDTH } from './components/icon.js';
|
|
40
47
|
export * from './components/error-alert.js';
|
|
41
48
|
export * from './components/InfoHint.js';
|
|
42
49
|
export * from './components/RefreshControl.js';
|
|
43
50
|
export { DEFAULT_REFRESH_INTERVALS, formatRefreshTime, refreshIntervalOptions, } from './components/refresh-control-model.js';
|
|
44
51
|
export * from './components/page-chrome.js';
|
|
52
|
+
export * from './components/actions.js';
|
|
53
|
+
export * from './components/layout.js';
|
|
54
|
+
export * from './components/StatusBadge.js';
|
|
55
|
+
export { useContainerAtLeast, CONSOLE_BREAKPOINTS_REM } from './components/use-container-width.js';
|
|
56
|
+
export * from './components/content-blocks.js';
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,8 @@ export * from './components/ui/badge.js';
|
|
|
13
13
|
export * from './components/ui/button.js';
|
|
14
14
|
export * from './components/ui/card.js';
|
|
15
15
|
export * from './components/ui/checkbox.js';
|
|
16
|
+
export * from './components/ui/date-field.js';
|
|
17
|
+
export { addDays, addMonths, calendarMonth, formatDateTimeValue, formatDateValue, parseDateTimeValue, parseDateValue, } from './components/ui/date-field-model.js';
|
|
16
18
|
export * from './components/ui/dialog.js';
|
|
17
19
|
export * from './components/ui/dropdown-menu.js';
|
|
18
20
|
export * from './components/ui/input.js';
|
|
@@ -36,9 +38,18 @@ export * from './components/PageHeader.js';
|
|
|
36
38
|
export * from './components/confirm-dialog.js';
|
|
37
39
|
export { canSubmitConfirm, confirmErrorMessage, confirmTextMatches } from './components/confirm-dialog-model.js';
|
|
38
40
|
export * from './components/StatCard.js';
|
|
41
|
+
export * from './components/BrandMark.js';
|
|
39
42
|
export * from './components/empty-state.js';
|
|
43
|
+
export * from './components/empty-illustrations.js';
|
|
44
|
+
export * from './components/code.js';
|
|
45
|
+
export { CONSOLE_ICON_SIZE, CONSOLE_ICON_STROKE_WIDTH } from './components/icon.js';
|
|
40
46
|
export * from './components/error-alert.js';
|
|
41
47
|
export * from './components/InfoHint.js';
|
|
42
48
|
export * from './components/RefreshControl.js';
|
|
43
49
|
export { DEFAULT_REFRESH_INTERVALS, formatRefreshTime, refreshIntervalOptions, } from './components/refresh-control-model.js';
|
|
44
50
|
export * from './components/page-chrome.js';
|
|
51
|
+
export * from './components/actions.js';
|
|
52
|
+
export * from './components/layout.js';
|
|
53
|
+
export * from './components/StatusBadge.js';
|
|
54
|
+
export { useContainerAtLeast, CONSOLE_BREAKPOINTS_REM } from './components/use-container-width.js';
|
|
55
|
+
export * from './components/content-blocks.js';
|