@alicloud/console-base-theme 1.4.7 → 1.6.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 CHANGED
@@ -1,6 +1,5 @@
1
- HISTORY
2
- ===
1
+ # CHANGELOG
3
2
 
4
- # 1.0.0 2020/12/23 @驳是
3
+ ## 1.0.0 2020/12/23 @驳是
5
4
 
6
5
  * 横空出世
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 Alibaba Cloud
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,4 @@
1
- @alicloud/console-base-theme
2
- ===
1
+ # @alicloud/console-base-theme
3
2
 
4
3
  * [关于 CSS Variable 的实践研究](doc/reserch.md)
5
4
  * [设计标注 - Fusion](https://fusion.alibaba-inc.com/pc/component/tokens)
@@ -10,7 +9,7 @@
10
9
 
11
10
  控制台主题
12
11
 
13
- # Usage
12
+ ## Usage
14
13
 
15
14
  ```js
16
15
  import {
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _styledComponents = require("styled-components");
9
+
10
+ var _mixin = require("../mixin");
11
+
12
+ // 为所有的控制台添加日文默认字体,仅日文下会生效,这里对 body 上的 class 有耦合,该 class 由 ConsoleBase 注入
13
+ var _default = (0, _styledComponents.createGlobalStyle)(["body.lang-ja{", "}"], _mixin.mixinTypoFontFamilyBaseJa);
14
+
15
+ exports.default = _default;
@@ -9,18 +9,25 @@ var _exportNames = {
9
9
  mixinTopNavButtonDarkFix: true,
10
10
  ThemeStyleLight: true,
11
11
  ThemeStyleDark: true,
12
+ GlobalStyleFontFamilyForJa: true,
12
13
  toggleBodyClass: true
13
14
  };
15
+ Object.defineProperty(exports, "GlobalStyleFontFamilyForJa", {
16
+ enumerable: true,
17
+ get: function get() {
18
+ return _globalStyleFontFamilyForJa.default;
19
+ }
20
+ });
14
21
  Object.defineProperty(exports, "ThemeStyleDark", {
15
22
  enumerable: true,
16
23
  get: function get() {
17
- return _themeStyleDark.default;
24
+ return _globalStyleThemeDark.default;
18
25
  }
19
26
  });
20
27
  Object.defineProperty(exports, "ThemeStyleLight", {
21
28
  enumerable: true,
22
29
  get: function get() {
23
- return _themeStyleLight.default;
30
+ return _globalStyleThemeLight.default;
24
31
  }
25
32
  });
26
33
  exports.mixinTopNavButtonDarkFix = void 0;
@@ -61,9 +68,11 @@ Object.keys(_mixin).forEach(function (key) {
61
68
  });
62
69
  });
63
70
 
64
- var _themeStyleLight = _interopRequireDefault(require("./theme-style-light"));
71
+ var _globalStyleThemeLight = _interopRequireDefault(require("./global-style-theme-light"));
72
+
73
+ var _globalStyleThemeDark = _interopRequireDefault(require("./global-style-theme-dark"));
65
74
 
66
- var _themeStyleDark = _interopRequireDefault(require("./theme-style-dark"));
75
+ var _globalStyleFontFamilyForJa = _interopRequireDefault(require("./global-style-font-family-for-ja"));
67
76
 
68
77
  var _util = require("./util");
69
78
 
@@ -15,15 +15,15 @@ var _bg = require("./bg");
15
15
 
16
16
  var _border = require("./border");
17
17
 
18
- var mixinTypoFontFamilyBase = (0, _styledComponents.css)(["font-family:", ";font-family:var(--cb-typo-font-family-base,", ");"], _var.TYPO.FONT_FAMILY_BASE, _var.TYPO.FONT_FAMILY_BASE); // 日文专属
18
+ // 日文专属
19
+ var mixinTypoFontFamilyBaseJa = (0, _styledComponents.css)(["font-family:", ";font-family:var(--cb-typo-font-family-base-ja,", ");"], _var.TYPO.FONT_FAMILY_BASE_JA, _var.TYPO.FONT_FAMILY_BASE_JA); // lang-ja 是 console-base 注入到 body 的 className,虽然有些耦合,但比较实用
19
20
 
20
- exports.mixinTypoFontFamilyBase = mixinTypoFontFamilyBase;
21
- var mixinTypoFontFamilyBaseJa = (0, _styledComponents.css)(["font-family:", ";font-family:var(--cb-typo-font-family-base-ja,", ");"], _var.TYPO.FONT_FAMILY_BASE_JA, _var.TYPO.FONT_FAMILY_BASE_JA);
22
21
  exports.mixinTypoFontFamilyBaseJa = mixinTypoFontFamilyBaseJa;
23
- var mixinTypoFontFamilyMono = (0, _styledComponents.css)(["font-family:", ";font-family:var(--cb-typo-font-family-monospace,", ");"], _var.TYPO.FONT_FAMILY_MONOSPACE, _var.TYPO.FONT_FAMILY_MONOSPACE); // lang-ja 是 console-base 注入到 body 的 className,虽然有些耦合,但比较实用
24
-
22
+ var mixinTypoFontFamilyBase = (0, _styledComponents.css)(["font-family:", ";font-family:var(--cb-typo-font-family-base,", ");body.lang-ja &{", "}"], _var.TYPO.FONT_FAMILY_BASE, _var.TYPO.FONT_FAMILY_BASE, mixinTypoFontFamilyBaseJa);
23
+ exports.mixinTypoFontFamilyBase = mixinTypoFontFamilyBase;
24
+ var mixinTypoFontFamilyMono = (0, _styledComponents.css)(["font-family:", ";font-family:var(--cb-typo-font-family-monospace,", ");"], _var.TYPO.FONT_FAMILY_MONOSPACE, _var.TYPO.FONT_FAMILY_MONOSPACE);
25
25
  exports.mixinTypoFontFamilyMono = mixinTypoFontFamilyMono;
26
- var mixinTypoFontBase = (0, _styledComponents.css)(["line-height:1.5;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;", " body.lang-ja &{", "}"], mixinTypoFontFamilyBase, mixinTypoFontFamilyBaseJa);
26
+ var mixinTypoFontBase = (0, _styledComponents.css)(["line-height:1.5;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;", ""], mixinTypoFontFamilyBase);
27
27
  exports.mixinTypoFontBase = mixinTypoFontBase;
28
28
  var mixinTypoStrong = (0, _styledComponents.css)(["font-weight:600;", ""], _text.mixinTextPrimary);
29
29
  exports.mixinTypoStrong = mixinTypoStrong;
@@ -0,0 +1,4 @@
1
+ import { createGlobalStyle } from 'styled-components';
2
+ import { mixinTypoFontFamilyBaseJa } from '../mixin'; // 为所有的控制台添加日文默认字体,仅日文下会生效,这里对 body 上的 class 有耦合,该 class 由 ConsoleBase 注入
3
+
4
+ export default createGlobalStyle(["body.lang-ja{", "}"], mixinTypoFontFamilyBaseJa);
package/build/es/index.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import { css } from 'styled-components';
2
2
  export * from './var';
3
3
  export * from './mixin';
4
- export { default as ThemeStyleLight } from './theme-style-light';
5
- export { default as ThemeStyleDark } from './theme-style-dark';
4
+ export { default as ThemeStyleLight } from './global-style-theme-light';
5
+ export { default as ThemeStyleDark } from './global-style-theme-dark';
6
+ export { default as GlobalStyleFontFamilyForJa } from './global-style-font-family-for-ja';
6
7
  export { toggleBodyClass } from './util'; // 主题黑的时候,在顶栏上的 button 背景色不能是标准的... FIXME 我需要调整颜色的策略 primary-secondary-tertiary 区分 container 和 control
7
8
 
8
9
  export var mixinTopNavButtonDarkFix = css([".theme-dark &{background-color:rgba(255,255,255,0.08);}"]);
@@ -2,13 +2,13 @@ import { css } from 'styled-components';
2
2
  import { TYPO, COLOR } from '../var';
3
3
  import { mixinTextPrimary, mixinTextEmphasis, mixinTextCode, mixinTextSecondary, mixinTextTertiary } from './text';
4
4
  import { mixinBgSecondary, mixinBgSecondaryFade } from './bg';
5
- import { mixinBorderTertiary, mixinBorderTertiaryColor } from './border';
6
- export var mixinTypoFontFamilyBase = css(["font-family:", ";font-family:var(--cb-typo-font-family-base,", ");"], TYPO.FONT_FAMILY_BASE, TYPO.FONT_FAMILY_BASE); // 日文专属
5
+ import { mixinBorderTertiary, mixinBorderTertiaryColor } from './border'; // 日文专属
7
6
 
8
- export var mixinTypoFontFamilyBaseJa = css(["font-family:", ";font-family:var(--cb-typo-font-family-base-ja,", ");"], TYPO.FONT_FAMILY_BASE_JA, TYPO.FONT_FAMILY_BASE_JA);
9
- export var mixinTypoFontFamilyMono = css(["font-family:", ";font-family:var(--cb-typo-font-family-monospace,", ");"], TYPO.FONT_FAMILY_MONOSPACE, TYPO.FONT_FAMILY_MONOSPACE); // lang-ja 是 console-base 注入到 body 的 className,虽然有些耦合,但比较实用
7
+ export var mixinTypoFontFamilyBaseJa = css(["font-family:", ";font-family:var(--cb-typo-font-family-base-ja,", ");"], TYPO.FONT_FAMILY_BASE_JA, TYPO.FONT_FAMILY_BASE_JA); // lang-ja 是 console-base 注入到 body 的 className,虽然有些耦合,但比较实用
10
8
 
11
- export var mixinTypoFontBase = css(["line-height:1.5;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;", " body.lang-ja &{", "}"], mixinTypoFontFamilyBase, mixinTypoFontFamilyBaseJa);
9
+ export var mixinTypoFontFamilyBase = css(["font-family:", ";font-family:var(--cb-typo-font-family-base,", ");body.lang-ja &{", "}"], TYPO.FONT_FAMILY_BASE, TYPO.FONT_FAMILY_BASE, mixinTypoFontFamilyBaseJa);
10
+ export var mixinTypoFontFamilyMono = css(["font-family:", ";font-family:var(--cb-typo-font-family-monospace,", ");"], TYPO.FONT_FAMILY_MONOSPACE, TYPO.FONT_FAMILY_MONOSPACE);
11
+ export var mixinTypoFontBase = css(["line-height:1.5;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;", ""], mixinTypoFontFamilyBase);
12
12
  export var mixinTypoStrong = css(["font-weight:600;", ""], mixinTextPrimary);
13
13
  export var mixinTypoEm = css(["font-style:normal;", ""], mixinTextEmphasis);
14
14
  export var mixinTypoSmall = css(["font-size:inherit;", ""], mixinTextTertiary);
@@ -0,0 +1,2 @@
1
+ declare const _default: import("styled-components").GlobalStyleComponent<{}, import("styled-components").DefaultTheme>;
2
+ export default _default;
@@ -1,7 +1,8 @@
1
1
  export * from './var';
2
2
  export * from './mixin';
3
- export { default as ThemeStyleLight } from './theme-style-light';
4
- export { default as ThemeStyleDark } from './theme-style-dark';
3
+ export { default as ThemeStyleLight } from './global-style-theme-light';
4
+ export { default as ThemeStyleDark } from './global-style-theme-dark';
5
+ export { default as GlobalStyleFontFamilyForJa } from './global-style-font-family-for-ja';
5
6
  export { toggleBodyClass } from './util';
6
7
  export declare const mixinTopNavButtonDarkFix: import("styled-components").FlattenSimpleInterpolation;
7
8
  export type { IPropsEllipsisLines as EllipsisLinesProps } from './types';
@@ -1,6 +1,6 @@
1
1
  import { IPropsEllipsisLines } from '../types';
2
- export declare const mixinTypoFontFamilyBase: import("styled-components").FlattenSimpleInterpolation;
3
2
  export declare const mixinTypoFontFamilyBaseJa: import("styled-components").FlattenSimpleInterpolation;
3
+ export declare const mixinTypoFontFamilyBase: import("styled-components").FlattenSimpleInterpolation;
4
4
  export declare const mixinTypoFontFamilyMono: import("styled-components").FlattenSimpleInterpolation;
5
5
  export declare const mixinTypoFontBase: import("styled-components").FlattenSimpleInterpolation;
6
6
  export declare const mixinTypoStrong: import("styled-components").FlattenSimpleInterpolation;
@@ -5,6 +5,9 @@ import Z_INDEX from './z-index';
5
5
  declare type ThemeTypo = typeof TYPO;
6
6
  declare type ThemeSize = typeof SIZE;
7
7
  declare type ThemeZIndex = typeof Z_INDEX;
8
+ /**
9
+ * 默认主题(亮色)的所有变量
10
+ */
8
11
  declare const _default: {
9
12
  COLOR: ThemeColors;
10
13
  TYPO: {
@@ -76,9 +79,6 @@ declare const _default: {
76
79
  BACKDROP_SYS: number;
77
80
  };
78
81
  };
79
- /**
80
- * 默认主题(亮色)的所有变量
81
- */
82
82
  export default _default;
83
83
  export { COLOR, TYPO, SIZE, Z_INDEX };
84
84
  export type { ThemeColors, ThemeTypo, ThemeSize, ThemeZIndex };
@@ -1,3 +1,6 @@
1
+ /**
2
+ * 文字大小、宽高、间距等,都是数值(基本上都是 px)
3
+ */
1
4
  declare const _default: {
2
5
  FONT_SIZE_H1: number;
3
6
  FONT_SIZE_H2: number;
@@ -48,7 +51,4 @@ declare const _default: {
48
51
  BORDER_RADIUS_L: number;
49
52
  BORDER_RADIUS_XL: number;
50
53
  };
51
- /**
52
- * 文字大小、宽高、间距等,都是数值(基本上都是 px)
53
- */
54
54
  export default _default;
@@ -1,9 +1,9 @@
1
+ /**
2
+ * 文字相关
3
+ */
1
4
  declare const _default: {
2
5
  FONT_FAMILY_BASE: string;
3
6
  FONT_FAMILY_BASE_JA: string;
4
7
  FONT_FAMILY_MONOSPACE: string;
5
8
  };
6
- /**
7
- * 文字相关
8
- */
9
9
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alicloud/console-base-theme",
3
- "version": "1.4.7",
3
+ "version": "1.6.0",
4
4
  "description": "控制台主题 - 基于 css variable 和 styled-components",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,
@@ -25,22 +25,22 @@
25
25
  ],
26
26
  "devDependencies": {
27
27
  "@alicloud/console-toolkit-cli": "^1.2.30",
28
- "@alicloud/console-toolkit-preset-component": "^1.2.56",
29
- "@alicloud/demo-rc-elements": "^1.5.4",
28
+ "@alicloud/console-toolkit-preset-component": "^1.2.61",
29
+ "@alicloud/demo-rc-elements": "^1.6.0",
30
30
  "@types/lodash": "^4.14.182",
31
- "@types/react": "^17.0.43",
31
+ "@types/react": "^17.0.45",
32
32
  "@types/styled-components": "^5.1.25",
33
33
  "lodash": "^4.17.21",
34
34
  "react": "^17.0.2",
35
35
  "styled-components": "^5.3.5",
36
- "typescript": "^4.6.3"
36
+ "typescript": "^4.7.4"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "styled-components": ">=5"
40
40
  },
41
41
  "dependencies": {
42
- "@alicloud/console-base-theme-color": "^1.1.84",
43
- "@alicloud/mere-dom": "^1.3.1"
42
+ "@alicloud/console-base-theme-color": "^1.3.0",
43
+ "@alicloud/mere-dom": "^1.4.0"
44
44
  },
45
45
  "scripts": {
46
46
  "start": "breezr start-storybook",
@@ -53,5 +53,5 @@
53
53
  "clean": "rm -rf build",
54
54
  "prepublishOnly": "yarn clean && yarn build"
55
55
  },
56
- "gitHead": "e575919bb3e5dc36f28501101c18cf0d7cee2488"
56
+ "gitHead": "464397b99676139ae2bee8b893246537048aa09a"
57
57
  }