niuma-ui 2.0.0 → 2.0.1
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 +16 -0
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/dist/brand-icons.css +40 -0
- package/dist/components/_shared/src/resolve-radius.js +1 -1
- package/dist/components/button/src/RsButton.impl.js +1 -1
- package/dist/components/cascader/src/RsCascader.css +20 -20
- package/dist/components/cascader/src/RsCascader.js +1 -1
- package/dist/components/code-block/src/RsCodeBlock.d.ts +1 -1
- package/dist/components/code-editor/src/code-editor-utils.js +2 -2
- package/dist/components/code-editor/src/code-mirror-lang.js +1 -1
- package/dist/components/config-provider/src/RsConfigProvider.css +2 -2
- package/dist/components/config-provider/src/RsConfigProvider.d.ts +6 -3
- package/dist/components/config-provider/src/RsConfigProvider.impl.js +47 -7
- package/dist/components/config-provider/src/RsConfigProvider.js +1 -1
- package/dist/components/context-menu/src/RsContextMenu.css +2 -2
- package/dist/components/date-picker/src/RsDatePicker.css +17 -17
- package/dist/components/date-picker/src/RsDatePicker.impl.js +1 -1
- package/dist/components/date-picker/src/RsDatePicker.js +1 -1
- package/dist/components/dialog/src/RsDialog.css +1 -2
- package/dist/components/divider/src/RsDivider.css +13 -13
- package/dist/components/divider/src/RsDivider.js +1 -1
- package/dist/components/drawer/src/RsDrawer.css +2 -4
- package/dist/components/dropdown/src/RsDropdown.css +2 -2
- package/dist/components/dropdown/src/RsDropdownItemView.impl.js +1 -1
- package/dist/components/icon/src/RsIcon.css +4 -4
- package/dist/components/icon/src/RsIcon.impl.js +6 -1
- package/dist/components/icon/src/RsIcon.js +1 -1
- package/dist/components/input/src/RsInput.css +86 -86
- package/dist/components/input/src/RsInput.js +1 -1
- package/dist/components/input-number/src/RsInputNumber.css +32 -32
- package/dist/components/input-number/src/RsInputNumber.js +1 -1
- package/dist/components/label/src/RsLabel.css +7 -7
- package/dist/components/label/src/RsLabel.js +1 -1
- package/dist/components/loading-bar/src/RsLoadingBar.css +4 -5
- package/dist/components/loading-bar/src/RsLoadingBar.js +1 -1
- package/dist/components/log/src/RsLog.css +39 -39
- package/dist/components/log/src/RsLog.d.ts +1 -1
- package/dist/components/log/src/RsLog.impl.js +1 -1
- package/dist/components/log/src/RsLog.js +1 -1
- package/dist/components/markdown/src/RsMarkdown.css +9 -7
- package/dist/components/menu/src/RsMenu.css +5 -5
- package/dist/components/pagination/src/RsPagination.css +18 -18
- package/dist/components/pagination/src/RsPagination.impl.js +1 -1
- package/dist/components/pagination/src/RsPagination.js +1 -1
- package/dist/components/select/src/RsSelect.css +42 -42
- package/dist/components/select/src/RsSelect.impl.js +1 -1
- package/dist/components/select/src/RsSelect.js +1 -1
- package/dist/components/steps/src/RsSteps.css +18 -18
- package/dist/components/steps/src/RsSteps.js +1 -1
- package/dist/components/switch/src/RsSwitch.css +4 -6
- package/dist/components/table/style/rs-table.css +15 -15
- package/dist/components/terminal/src/RsTerminal.css +24 -24
- package/dist/components/terminal/src/RsTerminal.js +1 -1
- package/dist/components/textarea/src/RsTextarea.css +26 -26
- package/dist/components/textarea/src/RsTextarea.js +1 -1
- package/dist/components/time-picker/src/RsTimePicker.css +20 -20
- package/dist/components/time-picker/src/RsTimePicker.impl.js +1 -1
- package/dist/components/time-picker/src/RsTimePicker.js +1 -1
- package/dist/components/toaster/src/RsToaster.css +6 -6
- package/dist/components/toaster/src/RsToaster.impl.js +3 -6
- package/dist/components/tree/src/RsTree.css +72 -73
- package/dist/components/tree/src/RsTree.js +1 -1
- package/dist/components/tree-select/src/RsTreeSelect.css +11 -11
- package/dist/components/tree-select/src/RsTreeSelect.js +1 -1
- package/dist/components/virtual-list/src/RsVirtualList.css +7 -8
- package/dist/components/virtual-list/src/RsVirtualList.js +1 -1
- package/dist/composables/createRsDialog.js +4 -3
- package/dist/composables/useRsConfig.d.ts +11 -3
- package/dist/composables/useRsConfig.js +17 -5
- package/dist/composables/useRsI18n.js +2 -2
- package/dist/icons/brand.d.ts +6 -0
- package/dist/icons/brand.js +26 -0
- package/dist/icons/registry.d.ts +2 -0
- package/dist/icons/registry.js +2 -1
- package/dist/index.d.ts +7 -4
- package/dist/index.js +16 -0
- package/dist/locale/apply.d.ts +8 -0
- package/dist/locale/apply.js +20 -0
- package/dist/locale/interpolate.d.ts +4 -3
- package/dist/locale/interpolate.js +96 -5
- package/dist/locale/messages.d.ts +0 -4
- package/dist/locale/messages.js +5 -9
- package/dist/locale/registry-public.d.ts +2 -0
- package/dist/locale/registry.d.ts +19 -0
- package/dist/locale/registry.js +50 -0
- package/dist/locale/types.d.ts +11 -2
- package/dist/locale/types.js +4 -1
- package/dist/styles.css +245 -250
- package/dist/theme/apply.d.ts +15 -3
- package/dist/theme/apply.js +41 -4
- package/dist/theme/brand.example.css +5 -1
- package/dist/theme/presets.d.ts +6 -5
- package/dist/theme/presets.js +4 -3
- package/dist/theme/types.d.ts +15 -7
- package/dist/theme/types.js +4 -1
- package/dist/vite-plugins/niuma-ui-host.js +7 -0
- package/package.json +2 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* 可覆盖的常见 token:
|
|
11
11
|
* - 品牌色:--rs-primary / --rs-primary-hover / --rs-*-container
|
|
12
12
|
* - 文字语义:--rs-text-primary / --rs-text-secondary / --rs-text-tertiary /
|
|
13
|
-
* --rs-text-disabled / --rs-text-link
|
|
13
|
+
* --rs-text-disabled / --rs-text-link(--rs-text / --rs-muted 只是别名)
|
|
14
14
|
* - 按钮次要态:--rs-btn-outline-border / --rs-btn-secondary-bg /
|
|
15
15
|
* --rs-btn-secondary-bg-hover / --rs-btn-secondary-bg-active
|
|
16
16
|
* - 排版:--rs-font-sans / --rs-font-mono / --rs-font-serif / --rs-font-size-* / --rs-font-weight-*
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
* - 表格专用:--rs-table-*(色值参考 VS Code Dark/Light Modern)
|
|
23
23
|
* - 树专用:--rs-tree-*(导航线 / 选中 / 焦点)
|
|
24
24
|
* - 终端专用:--rs-terminal-*(默认 macOS Terminal.app 风格)
|
|
25
|
+
* - 线标:--rs-icon-color(Lucide,默认 currentColor)
|
|
26
|
+
* - 品牌 mark:--rs-icon-mysql-accent 等(名单 rsBrandIconNames)
|
|
27
|
+
*
|
|
28
|
+
* 不要改 themePresets.ts 当换肤:那只是参考色板,画面只认本文件与 styles.css。
|
|
25
29
|
*/
|
|
26
30
|
|
|
27
31
|
[data-rs-theme='light'] {
|
package/dist/theme/presets.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RsResolvedTheme, RsThemeTokens } from './types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* 色板参考值,**不驱动画面**。`applyTheme` 只写 `data-rs-theme`,
|
|
4
|
+
* 实际颜色只认 `styles.css` / 宿主 brand.css。改皮肤不要只改这里。
|
|
5
|
+
* 暗色:VS Code Dark Modern 灰阶 + macOS 系统色。
|
|
6
|
+
* 亮色:macOS systemBackground / label + VS Code Light Modern 表格语义。
|
|
6
7
|
*/
|
|
7
|
-
export declare const themePresets: Record<
|
|
8
|
+
export declare const themePresets: Record<RsResolvedTheme, RsThemeTokens>;
|
package/dist/theme/presets.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
//#region src/theme/presets.ts
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* 色板参考值,**不驱动画面**。`applyTheme` 只写 `data-rs-theme`,
|
|
4
|
+
* 实际颜色只认 `styles.css` / 宿主 brand.css。改皮肤不要只改这里。
|
|
5
|
+
* 暗色:VS Code Dark Modern 灰阶 + macOS 系统色。
|
|
6
|
+
* 亮色:macOS systemBackground / label + VS Code Light Modern 表格语义。
|
|
6
7
|
*/
|
|
7
8
|
var themePresets = {
|
|
8
9
|
light: {
|
package/dist/theme/types.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/** 已落到 DOM 的明暗(`data-rs-theme` 只写这两个值)。 */
|
|
2
|
+
export type RsResolvedTheme = 'light' | 'dark';
|
|
3
|
+
/**
|
|
4
|
+
* 主题偏好。`system` 跟随 `prefers-color-scheme`,
|
|
5
|
+
* `applyTheme` 仍把解析结果写到 `data-rs-theme="light|dark"`。
|
|
6
|
+
*/
|
|
7
|
+
export type RsThemeMode = RsResolvedTheme | 'system';
|
|
2
8
|
/**
|
|
3
9
|
* 控件尺寸(由小到大):
|
|
4
10
|
* - ssm:极小
|
|
@@ -53,9 +59,9 @@ export declare const RS_FONT_WEIGHTS: readonly RsFontWeight[];
|
|
|
53
59
|
/** 各档字重对应的 CSS 值。 */
|
|
54
60
|
export declare const RS_FONT_WEIGHT_CSS: Record<RsFontWeight, string>;
|
|
55
61
|
/**
|
|
56
|
-
* 设计 token
|
|
57
|
-
*
|
|
58
|
-
*
|
|
62
|
+
* 设计 token(JS 参考面,与 styles.css 同名语义对应)。
|
|
63
|
+
* 色相:primary 与功能色(danger / success / warning / info)及 container / on-container。
|
|
64
|
+
* 文字:primary / secondary / tertiary / disabled / inverse / link。
|
|
59
65
|
*/
|
|
60
66
|
export interface RsThemeTokens {
|
|
61
67
|
primary: string;
|
|
@@ -70,11 +76,11 @@ export interface RsThemeTokens {
|
|
|
70
76
|
inputBg: string;
|
|
71
77
|
border: string;
|
|
72
78
|
borderSubtle: string;
|
|
73
|
-
/**
|
|
79
|
+
/** 主文案(--rs-text-primary) */
|
|
74
80
|
text: string;
|
|
75
|
-
/**
|
|
81
|
+
/** 次要文案(--rs-text-secondary) */
|
|
76
82
|
muted: string;
|
|
77
|
-
/** 占位 /
|
|
83
|
+
/** 占位 / 三级文案(--rs-text-tertiary) */
|
|
78
84
|
placeholder: string;
|
|
79
85
|
/** 禁用文案(与 --rs-text-disabled 同步) */
|
|
80
86
|
textDisabled: string;
|
|
@@ -95,3 +101,5 @@ export interface RsThemeTokens {
|
|
|
95
101
|
focusRing: string;
|
|
96
102
|
}
|
|
97
103
|
export declare const themeAttribute = "data-rs-theme";
|
|
104
|
+
/** 偏好为 system 时写入,便于宿主区分「用户选了暗色」和「跟着系统」。 */
|
|
105
|
+
export declare const themePrefAttribute = "data-rs-theme-pref";
|
package/dist/theme/types.js
CHANGED
|
@@ -61,5 +61,8 @@ var RS_FONT_WEIGHT_CSS = {
|
|
|
61
61
|
semibold: "var(--rs-font-weight-semibold)",
|
|
62
62
|
bold: "var(--rs-font-weight-bold)"
|
|
63
63
|
};
|
|
64
|
+
var themeAttribute = "data-rs-theme";
|
|
65
|
+
/** 偏好为 system 时写入,便于宿主区分「用户选了暗色」和「跟着系统」。 */
|
|
66
|
+
var themePrefAttribute = "data-rs-theme-pref";
|
|
64
67
|
//#endregion
|
|
65
|
-
export { RS_COMPONENT_SIZES, RS_COMPONENT_SIZE_ICON_PX, RS_FONT_SIZES, RS_FONT_SIZE_CSS, RS_FONT_WEIGHTS, RS_FONT_WEIGHT_CSS, RS_RADII, RS_RADIUS_CSS };
|
|
68
|
+
export { RS_COMPONENT_SIZES, RS_COMPONENT_SIZE_ICON_PX, RS_FONT_SIZES, RS_FONT_SIZE_CSS, RS_FONT_WEIGHTS, RS_FONT_WEIGHT_CSS, RS_RADII, RS_RADIUS_CSS, themeAttribute, themePrefAttribute };
|
|
@@ -78,6 +78,7 @@ function niumaUiHostAlias(ctx) {
|
|
|
78
78
|
const styles = existsSync(join(ctx.root, 'src/styles/index.css'))
|
|
79
79
|
? join(ctx.root, 'src/styles/index.css')
|
|
80
80
|
: join(ctx.root, 'src/styles.css');
|
|
81
|
+
const brandIcons = join(ctx.root, 'src/icons/style/brand-icon-tokens.css');
|
|
81
82
|
const alias = [
|
|
82
83
|
...(existsSync(styles)
|
|
83
84
|
? [
|
|
@@ -85,6 +86,12 @@ function niumaUiHostAlias(ctx) {
|
|
|
85
86
|
{ find: 'niuma-ui/styles.css', replacement: styles },
|
|
86
87
|
]
|
|
87
88
|
: []),
|
|
89
|
+
...(existsSync(brandIcons)
|
|
90
|
+
? [
|
|
91
|
+
{ find: '@niuma/ui/brand-icons.css', replacement: brandIcons },
|
|
92
|
+
{ find: 'niuma-ui/brand-icons.css', replacement: brandIcons },
|
|
93
|
+
]
|
|
94
|
+
: []),
|
|
88
95
|
...dayjsAlias,
|
|
89
96
|
];
|
|
90
97
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "niuma-ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Vue 3 workbench design system — Rs* components, --rs-* tokens, optional Monaco / CodeMirror / xterm",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"default": "./dist/index.js"
|
|
39
39
|
},
|
|
40
40
|
"./styles.css": "./dist/styles.css",
|
|
41
|
+
"./brand-icons.css": "./dist/brand-icons.css",
|
|
41
42
|
"./vite-plugins/monaco-zh-nls": {
|
|
42
43
|
"types": "./dist/vite-plugins/monaco-zh-nls.d.ts",
|
|
43
44
|
"import": "./dist/vite-plugins/monaco-zh-nls.js",
|