@canlooks/can-ui 0.0.8 → 0.0.9

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.
@@ -42,6 +42,7 @@ exports.App = (0, react_1.forwardRef)(({ component: Component = 'div', theme, ch
42
42
  app_style_1.style,
43
43
  (0, react_2.css) `
44
44
  font-size: ${themeValue.fontSize}px;
45
+ font-family: ${themeValue.fontFamily};
45
46
  color: ${themeValue.text.primary};
46
47
  background-color: ${themeValue.background.body};
47
48
  `,
@@ -7,9 +7,6 @@ exports.classes = (0, utils_1.defineClasses)('app');
7
7
  exports.style = (0, react_1.css) `
8
8
  line-height: ${20 / 14};
9
9
  box-sizing: border-box;
10
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI',
11
- Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji',
12
- 'Segoe UI Symbol', 'Noto Color Emoji', 'Microsoft YaHei UI', sans-serif;
13
10
 
14
11
  * {
15
12
  box-sizing: border-box;
@@ -52,6 +52,7 @@ export type ThemeEasings = {
52
52
  export type Theme = {
53
53
  mode: 'light' | 'dark';
54
54
  fontSize: number;
55
+ fontFamily: string;
55
56
  size: Size;
56
57
  borderRadius: number;
57
58
  /** 间隙大小,如内边距、外边距等,是控制界面整体紧凑程度的主要参数 */
@@ -75,5 +76,6 @@ export type PartialTheme = Partial<Omit<Theme, 'colors' | 'text' | 'background'
75
76
  background?: Partial<ThemeBackgroundColor>;
76
77
  easing?: Partial<ThemeEasings>;
77
78
  };
79
+ export declare const defaultFontFamily = "-apple-system, BlinkMacSystemFont, 'Segoe UI',\n Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji',\n 'Segoe UI Symbol', 'Noto Color Emoji', 'Microsoft YaHei UI', sans-serif";
78
80
  export declare const defaultLightTheme: Theme;
79
81
  export declare const defaultDarkTheme: PartialTheme;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultDarkTheme = exports.defaultLightTheme = exports.breakpoints = exports.zIndex = exports.spacing = void 0;
3
+ exports.defaultDarkTheme = exports.defaultLightTheme = exports.defaultFontFamily = exports.breakpoints = exports.zIndex = exports.spacing = void 0;
4
4
  exports.gray = gray;
5
5
  exports.rGray = rGray;
6
6
  const tslib_1 = require("tslib");
@@ -47,9 +47,13 @@ exports.breakpoints = {
47
47
  lg: 1200,
48
48
  xl: 1536
49
49
  };
50
+ exports.defaultFontFamily = `-apple-system, BlinkMacSystemFont, 'Segoe UI',
51
+ Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji',
52
+ 'Segoe UI Symbol', 'Noto Color Emoji', 'Microsoft YaHei UI', sans-serif`;
50
53
  exports.defaultLightTheme = {
51
54
  mode: 'light',
52
55
  fontSize: 14,
56
+ fontFamily: exports.defaultFontFamily,
53
57
  size: 'medium',
54
58
  borderRadius: 6,
55
59
  spacing: exports.spacing,
@@ -23,13 +23,13 @@ exports.classes = (0, utils_1.defineClasses)('date-time-picker', [
23
23
  'calendarDays',
24
24
  'dateItem'
25
25
  ]);
26
- exports.style = (0, utils_1.defineCss)(({ text }) => (0, react_1.css) `
26
+ exports.style = (0, utils_1.defineCss)(({ text, fontFamily }) => (0, react_1.css) `
27
27
  .${exports.classes.container} {
28
28
  display: flex;
29
29
  align-items: center;
30
30
 
31
31
  .${exports.classes.input} {
32
- ${input_style_1.commonNativeInputStyle}
32
+ ${(0, input_style_1.commonNativeInputStyle)(fontFamily)}
33
33
  }
34
34
 
35
35
  .${exports.classes.dateTimeIcon} {
@@ -4,5 +4,5 @@ export declare const classes: {
4
4
  } & {
5
5
  root: string;
6
6
  };
7
- export declare const commonNativeInputStyle: import("@emotion/react").SerializedStyles;
8
- export declare const style: import("@emotion/react").SerializedStyles;
7
+ export declare const commonNativeInputStyle: (fontFamily: string) => import("@emotion/react").SerializedStyles;
8
+ export declare const style: () => import("@emotion/react").SerializedStyles;
@@ -7,7 +7,7 @@ exports.classes = (0, utils_1.defineClasses)('input', [
7
7
  'input',
8
8
  'adaptable'
9
9
  ]);
10
- exports.commonNativeInputStyle = (0, react_1.css) `
10
+ const commonNativeInputStyle = (fontFamily) => (0, react_1.css) `
11
11
  width: 100%;
12
12
  height: 22px;
13
13
  flex: 1;
@@ -16,22 +16,24 @@ exports.commonNativeInputStyle = (0, react_1.css) `
16
16
  padding: 0;
17
17
  background-color: transparent;
18
18
  font-size: 1em;
19
+ font-family: ${fontFamily};
19
20
  `;
20
- exports.style = (0, react_1.css) `
21
+ exports.commonNativeInputStyle = commonNativeInputStyle;
22
+ exports.style = (0, utils_1.defineCss)(({ fontFamily }) => (0, react_1.css) `
21
23
  position: relative;
22
24
 
23
25
  .${exports.classes.input} {
24
- ${exports.commonNativeInputStyle}
25
-
26
+ ${(0, exports.commonNativeInputStyle)(fontFamily)}
27
+
26
28
  &::-webkit-search-cancel-button {
27
29
  display: none;
28
30
  }
29
-
31
+
30
32
  &::-ms-clear,
31
33
  &::-webkit-search-cancel-button {
32
34
  display: none;
33
35
  }
34
-
36
+
35
37
  &::-webkit-inner-spin-button,
36
38
  &::-webkit-outer-spin-button {
37
39
  width: 12px;
@@ -50,4 +52,4 @@ exports.style = (0, react_1.css) `
50
52
  opacity: 0;
51
53
  pointer-events: none;
52
54
  }
53
- `;
55
+ `);
@@ -7,7 +7,7 @@ const inputBase_style_1 = require("../inputBase/inputBase.style");
7
7
  exports.classes = (0, utils_1.defineClasses)('textarea', [
8
8
  'textarea'
9
9
  ]);
10
- exports.style = (0, utils_1.defineCss)(({ spacing }) => (0, react_1.css) `
10
+ exports.style = (0, utils_1.defineCss)(({ spacing, fontFamily }) => (0, react_1.css) `
11
11
  height: auto;
12
12
 
13
13
  &[data-size] {
@@ -22,6 +22,7 @@ exports.style = (0, utils_1.defineCss)(({ spacing }) => (0, react_1.css) `
22
22
  font-size: 1em;
23
23
  padding: ${spacing[3]}px;
24
24
  display: block;
25
+ font-family: ${fontFamily};
25
26
  }
26
27
 
27
28
  &[data-full-width=true] {
@@ -38,6 +38,7 @@ export const App = forwardRef(({ component: Component = 'div', theme, children,
38
38
  style,
39
39
  css `
40
40
  font-size: ${themeValue.fontSize}px;
41
+ font-family: ${themeValue.fontFamily};
41
42
  color: ${themeValue.text.primary};
42
43
  background-color: ${themeValue.background.body};
43
44
  `,
@@ -4,9 +4,6 @@ export const classes = defineClasses('app');
4
4
  export const style = css `
5
5
  line-height: ${20 / 14};
6
6
  box-sizing: border-box;
7
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI',
8
- Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji',
9
- 'Segoe UI Symbol', 'Noto Color Emoji', 'Microsoft YaHei UI', sans-serif;
10
7
 
11
8
  * {
12
9
  box-sizing: border-box;
@@ -52,6 +52,7 @@ export type ThemeEasings = {
52
52
  export type Theme = {
53
53
  mode: 'light' | 'dark';
54
54
  fontSize: number;
55
+ fontFamily: string;
55
56
  size: Size;
56
57
  borderRadius: number;
57
58
  /** 间隙大小,如内边距、外边距等,是控制界面整体紧凑程度的主要参数 */
@@ -75,5 +76,6 @@ export type PartialTheme = Partial<Omit<Theme, 'colors' | 'text' | 'background'
75
76
  background?: Partial<ThemeBackgroundColor>;
76
77
  easing?: Partial<ThemeEasings>;
77
78
  };
79
+ export declare const defaultFontFamily = "-apple-system, BlinkMacSystemFont, 'Segoe UI',\n Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji',\n 'Segoe UI Symbol', 'Noto Color Emoji', 'Microsoft YaHei UI', sans-serif";
78
80
  export declare const defaultLightTheme: Theme;
79
81
  export declare const defaultDarkTheme: PartialTheme;
@@ -40,9 +40,13 @@ export const breakpoints = {
40
40
  lg: 1200,
41
41
  xl: 1536
42
42
  };
43
+ export const defaultFontFamily = `-apple-system, BlinkMacSystemFont, 'Segoe UI',
44
+ Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji',
45
+ 'Segoe UI Symbol', 'Noto Color Emoji', 'Microsoft YaHei UI', sans-serif`;
43
46
  export const defaultLightTheme = {
44
47
  mode: 'light',
45
48
  fontSize: 14,
49
+ fontFamily: defaultFontFamily,
46
50
  size: 'medium',
47
51
  borderRadius: 6,
48
52
  spacing,
@@ -20,13 +20,13 @@ export const classes = defineClasses('date-time-picker', [
20
20
  'calendarDays',
21
21
  'dateItem'
22
22
  ]);
23
- export const style = defineCss(({ text }) => css `
23
+ export const style = defineCss(({ text, fontFamily }) => css `
24
24
  .${classes.container} {
25
25
  display: flex;
26
26
  align-items: center;
27
27
 
28
28
  .${classes.input} {
29
- ${commonNativeInputStyle}
29
+ ${commonNativeInputStyle(fontFamily)}
30
30
  }
31
31
 
32
32
  .${classes.dateTimeIcon} {
@@ -4,5 +4,5 @@ export declare const classes: {
4
4
  } & {
5
5
  root: string;
6
6
  };
7
- export declare const commonNativeInputStyle: import("@emotion/react").SerializedStyles;
8
- export declare const style: import("@emotion/react").SerializedStyles;
7
+ export declare const commonNativeInputStyle: (fontFamily: string) => import("@emotion/react").SerializedStyles;
8
+ export declare const style: () => import("@emotion/react").SerializedStyles;
@@ -1,10 +1,10 @@
1
1
  import { css } from '@emotion/react';
2
- import { defineClasses } from '../../utils';
2
+ import { defineClasses, defineCss } from '../../utils';
3
3
  export const classes = defineClasses('input', [
4
4
  'input',
5
5
  'adaptable'
6
6
  ]);
7
- export const commonNativeInputStyle = css `
7
+ export const commonNativeInputStyle = (fontFamily) => css `
8
8
  width: 100%;
9
9
  height: 22px;
10
10
  flex: 1;
@@ -13,22 +13,23 @@ export const commonNativeInputStyle = css `
13
13
  padding: 0;
14
14
  background-color: transparent;
15
15
  font-size: 1em;
16
+ font-family: ${fontFamily};
16
17
  `;
17
- export const style = css `
18
+ export const style = defineCss(({ fontFamily }) => css `
18
19
  position: relative;
19
20
 
20
21
  .${classes.input} {
21
- ${commonNativeInputStyle}
22
-
22
+ ${commonNativeInputStyle(fontFamily)}
23
+
23
24
  &::-webkit-search-cancel-button {
24
25
  display: none;
25
26
  }
26
-
27
+
27
28
  &::-ms-clear,
28
29
  &::-webkit-search-cancel-button {
29
30
  display: none;
30
31
  }
31
-
32
+
32
33
  &::-webkit-inner-spin-button,
33
34
  &::-webkit-outer-spin-button {
34
35
  width: 12px;
@@ -47,4 +48,4 @@ export const style = css `
47
48
  opacity: 0;
48
49
  pointer-events: none;
49
50
  }
50
- `;
51
+ `);
@@ -4,7 +4,7 @@ import { classes as inputBaseClasses } from '../inputBase/inputBase.style';
4
4
  export const classes = defineClasses('textarea', [
5
5
  'textarea'
6
6
  ]);
7
- export const style = defineCss(({ spacing }) => css `
7
+ export const style = defineCss(({ spacing, fontFamily }) => css `
8
8
  height: auto;
9
9
 
10
10
  &[data-size] {
@@ -19,6 +19,7 @@ export const style = defineCss(({ spacing }) => css `
19
19
  font-size: 1em;
20
20
  padding: ${spacing[3]}px;
21
21
  display: block;
22
+ font-family: ${fontFamily};
22
23
  }
23
24
 
24
25
  &[data-full-width=true] {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canlooks/can-ui",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "author": "C.CanLiang <canlooks@gmail.com>",
5
5
  "description": "My ui framework",
6
6
  "license": "MIT",