@canlooks/can-ui 0.0.9 → 0.0.11
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/dist/cjs/components/app/app.js +4 -1
- package/dist/cjs/components/dateTimePicker/dateTimePicker.style.js +2 -2
- package/dist/cjs/components/divider/divider.js +3 -7
- package/dist/cjs/components/input/input.style.d.ts +2 -2
- package/dist/cjs/components/input/input.style.js +7 -9
- package/dist/cjs/components/textarea/textarea.style.js +1 -2
- package/dist/esm/components/app/app.js +4 -1
- package/dist/esm/components/dateTimePicker/dateTimePicker.style.js +2 -2
- package/dist/esm/components/divider/divider.js +3 -7
- package/dist/esm/components/input/input.style.d.ts +2 -2
- package/dist/esm/components/input/input.style.js +8 -9
- package/dist/esm/components/textarea/textarea.style.js +1 -2
- package/package.json +1 -1
|
@@ -42,9 +42,12 @@ 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};
|
|
46
45
|
color: ${themeValue.text.primary};
|
|
47
46
|
background-color: ${themeValue.background.body};
|
|
47
|
+
|
|
48
|
+
* {
|
|
49
|
+
font-family: ${themeValue.fontFamily};
|
|
50
|
+
}
|
|
48
51
|
`,
|
|
49
52
|
fullSize && (0, react_2.css) `
|
|
50
53
|
width: 100%;
|
|
@@ -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
|
|
26
|
+
exports.style = (0, utils_1.defineCss)(({ text }) => (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
|
-
${
|
|
32
|
+
${input_style_1.commonNativeInputStyle}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.${exports.classes.dateTimeIcon} {
|
|
@@ -5,16 +5,12 @@ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const divider_style_1 = require("./divider.style");
|
|
7
7
|
const utils_1 = require("../../utils");
|
|
8
|
-
const app_1 = require("../app");
|
|
9
8
|
exports.Divider = (0, react_1.memo)((0, react_1.forwardRef)(({ textAlign = 'center', alignMargin = 36, orientation = 'horizontal', margin, ...props }, ref) => {
|
|
10
|
-
const { spacing } = (0, app_1.useTheme)();
|
|
11
|
-
margin ??= orientation === 'horizontal' ? spacing[5] : spacing[4];
|
|
12
|
-
if (typeof margin === 'number') {
|
|
13
|
-
margin += 'px';
|
|
14
|
-
}
|
|
15
9
|
const styleProp = orientation === 'horizontal' ? 'width' : 'height';
|
|
16
10
|
return ((0, jsx_runtime_1.jsxs)("div", { ...props, ref: ref, css: divider_style_1.style, className: (0, utils_1.classnames)(divider_style_1.classes.root, props.className), style: {
|
|
17
|
-
margin:
|
|
11
|
+
margin: typeof margin === 'number'
|
|
12
|
+
? orientation === 'horizontal' ? `${margin}px 0` : `0 ${margin}px`
|
|
13
|
+
: margin,
|
|
18
14
|
...props.style
|
|
19
15
|
}, "data-orientation": orientation, children: [(0, jsx_runtime_1.jsx)("div", { className: `${divider_style_1.classes.line} ${divider_style_1.classes.beforeLine}`, style: {
|
|
20
16
|
flex: !props.children || textAlign !== 'start' ? 1 : void 0,
|
|
@@ -4,5 +4,5 @@ export declare const classes: {
|
|
|
4
4
|
} & {
|
|
5
5
|
root: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const commonNativeInputStyle:
|
|
8
|
-
export declare const style:
|
|
7
|
+
export declare const commonNativeInputStyle: 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
|
-
|
|
10
|
+
exports.commonNativeInputStyle = (0, react_1.css) `
|
|
11
11
|
width: 100%;
|
|
12
12
|
height: 22px;
|
|
13
13
|
flex: 1;
|
|
@@ -16,24 +16,22 @@ const commonNativeInputStyle = (fontFamily) => (0, react_1.css) `
|
|
|
16
16
|
padding: 0;
|
|
17
17
|
background-color: transparent;
|
|
18
18
|
font-size: 1em;
|
|
19
|
-
font-family: ${fontFamily};
|
|
20
19
|
`;
|
|
21
|
-
exports.
|
|
22
|
-
exports.style = (0, utils_1.defineCss)(({ fontFamily }) => (0, react_1.css) `
|
|
20
|
+
exports.style = (0, react_1.css) `
|
|
23
21
|
position: relative;
|
|
24
22
|
|
|
25
23
|
.${exports.classes.input} {
|
|
26
|
-
${
|
|
27
|
-
|
|
24
|
+
${exports.commonNativeInputStyle}
|
|
25
|
+
|
|
28
26
|
&::-webkit-search-cancel-button {
|
|
29
27
|
display: none;
|
|
30
28
|
}
|
|
31
|
-
|
|
29
|
+
|
|
32
30
|
&::-ms-clear,
|
|
33
31
|
&::-webkit-search-cancel-button {
|
|
34
32
|
display: none;
|
|
35
33
|
}
|
|
36
|
-
|
|
34
|
+
|
|
37
35
|
&::-webkit-inner-spin-button,
|
|
38
36
|
&::-webkit-outer-spin-button {
|
|
39
37
|
width: 12px;
|
|
@@ -52,4 +50,4 @@ exports.style = (0, utils_1.defineCss)(({ fontFamily }) => (0, react_1.css) `
|
|
|
52
50
|
opacity: 0;
|
|
53
51
|
pointer-events: none;
|
|
54
52
|
}
|
|
55
|
-
|
|
53
|
+
`;
|
|
@@ -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
|
|
10
|
+
exports.style = (0, utils_1.defineCss)(({ spacing }) => (0, react_1.css) `
|
|
11
11
|
height: auto;
|
|
12
12
|
|
|
13
13
|
&[data-size] {
|
|
@@ -22,7 +22,6 @@ exports.style = (0, utils_1.defineCss)(({ spacing, fontFamily }) => (0, react_1.
|
|
|
22
22
|
font-size: 1em;
|
|
23
23
|
padding: ${spacing[3]}px;
|
|
24
24
|
display: block;
|
|
25
|
-
font-family: ${fontFamily};
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
&[data-full-width=true] {
|
|
@@ -38,9 +38,12 @@ 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};
|
|
42
41
|
color: ${themeValue.text.primary};
|
|
43
42
|
background-color: ${themeValue.background.body};
|
|
43
|
+
|
|
44
|
+
* {
|
|
45
|
+
font-family: ${themeValue.fontFamily};
|
|
46
|
+
}
|
|
44
47
|
`,
|
|
45
48
|
fullSize && css `
|
|
46
49
|
width: 100%;
|
|
@@ -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
|
|
23
|
+
export const style = defineCss(({ text }) => css `
|
|
24
24
|
.${classes.container} {
|
|
25
25
|
display: flex;
|
|
26
26
|
align-items: center;
|
|
27
27
|
|
|
28
28
|
.${classes.input} {
|
|
29
|
-
${commonNativeInputStyle
|
|
29
|
+
${commonNativeInputStyle}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.${classes.dateTimeIcon} {
|
|
@@ -2,16 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, memo } from 'react';
|
|
3
3
|
import { classes, style } from './divider.style';
|
|
4
4
|
import { classnames } from '../../utils';
|
|
5
|
-
import { useTheme } from '../app';
|
|
6
5
|
export const Divider = memo(forwardRef(({ textAlign = 'center', alignMargin = 36, orientation = 'horizontal', margin, ...props }, ref) => {
|
|
7
|
-
const { spacing } = useTheme();
|
|
8
|
-
margin ??= orientation === 'horizontal' ? spacing[5] : spacing[4];
|
|
9
|
-
if (typeof margin === 'number') {
|
|
10
|
-
margin += 'px';
|
|
11
|
-
}
|
|
12
6
|
const styleProp = orientation === 'horizontal' ? 'width' : 'height';
|
|
13
7
|
return (_jsxs("div", { ...props, ref: ref, css: style, className: classnames(classes.root, props.className), style: {
|
|
14
|
-
margin:
|
|
8
|
+
margin: typeof margin === 'number'
|
|
9
|
+
? orientation === 'horizontal' ? `${margin}px 0` : `0 ${margin}px`
|
|
10
|
+
: margin,
|
|
15
11
|
...props.style
|
|
16
12
|
}, "data-orientation": orientation, children: [_jsx("div", { className: `${classes.line} ${classes.beforeLine}`, style: {
|
|
17
13
|
flex: !props.children || textAlign !== 'start' ? 1 : void 0,
|
|
@@ -4,5 +4,5 @@ export declare const classes: {
|
|
|
4
4
|
} & {
|
|
5
5
|
root: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const commonNativeInputStyle:
|
|
8
|
-
export declare const style:
|
|
7
|
+
export declare const commonNativeInputStyle: 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
|
|
2
|
+
import { defineClasses } from '../../utils';
|
|
3
3
|
export const classes = defineClasses('input', [
|
|
4
4
|
'input',
|
|
5
5
|
'adaptable'
|
|
6
6
|
]);
|
|
7
|
-
export const commonNativeInputStyle =
|
|
7
|
+
export const commonNativeInputStyle = css `
|
|
8
8
|
width: 100%;
|
|
9
9
|
height: 22px;
|
|
10
10
|
flex: 1;
|
|
@@ -13,23 +13,22 @@ export const commonNativeInputStyle = (fontFamily) => css `
|
|
|
13
13
|
padding: 0;
|
|
14
14
|
background-color: transparent;
|
|
15
15
|
font-size: 1em;
|
|
16
|
-
font-family: ${fontFamily};
|
|
17
16
|
`;
|
|
18
|
-
export const style =
|
|
17
|
+
export const style = css `
|
|
19
18
|
position: relative;
|
|
20
19
|
|
|
21
20
|
.${classes.input} {
|
|
22
|
-
${commonNativeInputStyle
|
|
23
|
-
|
|
21
|
+
${commonNativeInputStyle}
|
|
22
|
+
|
|
24
23
|
&::-webkit-search-cancel-button {
|
|
25
24
|
display: none;
|
|
26
25
|
}
|
|
27
|
-
|
|
26
|
+
|
|
28
27
|
&::-ms-clear,
|
|
29
28
|
&::-webkit-search-cancel-button {
|
|
30
29
|
display: none;
|
|
31
30
|
}
|
|
32
|
-
|
|
31
|
+
|
|
33
32
|
&::-webkit-inner-spin-button,
|
|
34
33
|
&::-webkit-outer-spin-button {
|
|
35
34
|
width: 12px;
|
|
@@ -48,4 +47,4 @@ export const style = defineCss(({ fontFamily }) => css `
|
|
|
48
47
|
opacity: 0;
|
|
49
48
|
pointer-events: none;
|
|
50
49
|
}
|
|
51
|
-
|
|
50
|
+
`;
|
|
@@ -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
|
|
7
|
+
export const style = defineCss(({ spacing }) => css `
|
|
8
8
|
height: auto;
|
|
9
9
|
|
|
10
10
|
&[data-size] {
|
|
@@ -19,7 +19,6 @@ export const style = defineCss(({ spacing, fontFamily }) => css `
|
|
|
19
19
|
font-size: 1em;
|
|
20
20
|
padding: ${spacing[3]}px;
|
|
21
21
|
display: block;
|
|
22
|
-
font-family: ${fontFamily};
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
&[data-full-width=true] {
|