taro-react-uilib 1.0.31 → 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 +27 -6
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/ThemeProvider/index.js +2 -0
- package/dist/components/ThemeProvider/index.js.map +1 -0
- package/dist/components/src/index.js +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/styles/components/button.scss +17 -16
- package/dist/styles/components/dialog.scss +1 -1
- package/dist/styles/components/dialogref.scss +9 -5
- package/dist/styles/components/index.scss +1 -0
- package/dist/styles/components/themeprovider.scss +0 -0
- package/dist/styles/themes/default.scss +2 -1
- package/dist/styles/themes/variable.scss +2 -2
- package/lib/components/Button/index.js +3 -3
- package/lib/components/Button/index.js.map +1 -1
- package/lib/components/ThemeProvider/index.js +28 -0
- package/lib/components/ThemeProvider/index.js.map +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/types/components/Button/index.d.ts +2 -1
- package/types/components/Theme/index.d.ts +27 -0
- package/types/components/ThemeProvider/index.d.ts +27 -0
- package/types/index.d.ts +1 -0
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
@import "../../styles/themes/variable.scss";
|
|
2
|
-
@import "../../styles/themes/default.scss";
|
|
3
2
|
|
|
4
|
-
button[disabled][type="primary"] {
|
|
5
|
-
background-color:
|
|
3
|
+
button.xh-button-disabled[disabled][type="primary"] {
|
|
4
|
+
background-color: var(--color-disabled);
|
|
6
5
|
color: #fff;
|
|
7
6
|
}
|
|
7
|
+
button.xh-button-primary[type=primary] {
|
|
8
|
+
background-color: var(--btn-color)
|
|
9
|
+
}
|
|
8
10
|
#{$xh-prefix}-button {
|
|
9
11
|
position: relative;
|
|
10
12
|
font-size: $btn-font-size;
|
|
@@ -23,9 +25,9 @@ button[disabled][type="primary"] {
|
|
|
23
25
|
left: 50%;
|
|
24
26
|
width: 100%;
|
|
25
27
|
height: 100%;
|
|
26
|
-
background-color:
|
|
28
|
+
background-color: var(--background-color);
|
|
27
29
|
border: inherit;
|
|
28
|
-
border-color:
|
|
30
|
+
border-color: var(--border-color);
|
|
29
31
|
border-radius: inherit;
|
|
30
32
|
transform: translate(-50%, -50%);
|
|
31
33
|
opacity: 0;
|
|
@@ -36,37 +38,36 @@ button[disabled][type="primary"] {
|
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
&-default {
|
|
39
|
-
color:
|
|
40
|
-
font-size: $btn-font-size;
|
|
41
|
+
color: var(--font-color);
|
|
41
42
|
background: #fff;
|
|
42
|
-
border: 2px solid
|
|
43
|
+
border: 2px solid var(--border-color);
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
&-primary {
|
|
46
47
|
color: #fff;
|
|
47
|
-
background:
|
|
48
|
-
box-shadow:
|
|
48
|
+
background: var(--btn-color);
|
|
49
|
+
box-shadow: var(--btn-shadow-primary);
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
&-secondary {
|
|
52
53
|
background-color: transparent;
|
|
53
|
-
color:
|
|
54
|
-
border: 1px solid
|
|
54
|
+
color: var(--font-color-secondary);
|
|
55
|
+
border: 1px solid var(--font-color-secondary);
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
&-warn {
|
|
58
|
-
background-color:
|
|
59
|
+
background-color: var(--color-warning);
|
|
59
60
|
color: #fff;
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
&-disabled {
|
|
63
|
-
background:
|
|
64
|
+
background: var(--color-disabled);
|
|
64
65
|
color: #fff;
|
|
65
66
|
box-shadow: unset;
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
&-square {
|
|
69
|
-
border-radius:
|
|
70
|
+
border-radius: var(--border-radius);
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
&-round {
|
|
@@ -102,7 +103,7 @@ button[disabled][type="primary"] {
|
|
|
102
103
|
}
|
|
103
104
|
&[type="default"] {
|
|
104
105
|
background-color: #fff;
|
|
105
|
-
color:
|
|
106
|
+
color: var(--font-color);
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
109
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@import './mask.scss';
|
|
2
2
|
@import "../../styles/themes/variable.scss";
|
|
3
|
-
@import "../../styles/themes/default.scss";
|
|
3
|
+
// @import "../../styles/themes/default.scss";
|
|
4
4
|
@import "../../styles/themes/animation.scss";
|
|
5
5
|
|
|
6
6
|
#{$xh-prefix}-dialog-ref {
|
|
@@ -49,25 +49,29 @@
|
|
|
49
49
|
// margin-top: 60px;
|
|
50
50
|
.xh-dialog-ref-content-footer-buttons {
|
|
51
51
|
display: flex;
|
|
52
|
-
padding: 0 40px
|
|
52
|
+
padding: 0 40px 50px;
|
|
53
|
+
&:not(.microApp) {
|
|
54
|
+
height: 100px;
|
|
55
|
+
}
|
|
53
56
|
&.microApp {
|
|
54
57
|
border-top: 2px solid #f8f8f8;
|
|
55
58
|
padding: 0;
|
|
56
59
|
}
|
|
57
60
|
&-microapp-cancel {
|
|
58
|
-
color:
|
|
61
|
+
color: var(--font-color-tertiary);
|
|
59
62
|
border-bottom-left-radius: 10px;
|
|
60
63
|
border-right: 2px solid #f8f8f8;
|
|
61
64
|
padding: 10px 0;
|
|
62
65
|
}
|
|
63
66
|
&-microapp-confirm {
|
|
64
|
-
color:
|
|
67
|
+
color: var(--color-primary);
|
|
65
68
|
border-bottom-right-radius: 10px;
|
|
66
69
|
padding: 10px 0;
|
|
67
70
|
}
|
|
68
71
|
&-h5-cancel {
|
|
69
72
|
margin-right: 40px;
|
|
70
|
-
color:
|
|
73
|
+
color: var(--font-color-tertiary);
|
|
74
|
+
padding: 0;
|
|
71
75
|
}
|
|
72
76
|
}
|
|
73
77
|
}
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
$color-primary: #f6ab00;
|
|
2
2
|
$color-primary-dark: #f98f33;
|
|
3
3
|
$color-primary-reverse: #fff;
|
|
4
|
-
$color-disabled: #
|
|
4
|
+
$color-disabled: #d5d5d5;
|
|
5
5
|
$color-warning: #ff512d;
|
|
6
6
|
$color-warning-light: #ff5a66;
|
|
7
7
|
|
|
@@ -17,6 +17,7 @@ $font-color-tertiary: #999;
|
|
|
17
17
|
$border-color: #e6e6e6;
|
|
18
18
|
|
|
19
19
|
$btn-font-size: 34px;
|
|
20
|
+
|
|
20
21
|
$btn-color: linear-gradient(90deg, $color-primary 0%, $color-primary-dark 100%);
|
|
21
22
|
$btn-shadow-primary: 0 10px 20px rgba(247, 174, 5, 0.3);
|
|
22
23
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import "./default.scss";
|
|
2
2
|
|
|
3
3
|
$xh-prefix: ".xh";
|
|
4
|
-
:root {
|
|
4
|
+
:root, page {
|
|
5
5
|
--color-primary: #{$color-primary};
|
|
6
6
|
--color-primary-dark: #{$color-primary-dark};
|
|
7
7
|
--color-primary-reverse: #{$color-primary-reverse};
|
|
@@ -22,7 +22,7 @@ $xh-prefix: ".xh";
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
@media (prefers-color-scheme: dark) {
|
|
25
|
-
:root {
|
|
25
|
+
:root, page {
|
|
26
26
|
--color-primary: #{$color-primary};
|
|
27
27
|
--color-primary-dark: #{$color-primary-dark};
|
|
28
28
|
--color-primary-reverse: #{$color-primary-reverse};
|
|
@@ -4,7 +4,7 @@ import { Button } from "@tarojs/components";
|
|
|
4
4
|
import { useTaroEnv } from "../../hooks";
|
|
5
5
|
import "./index.scss";
|
|
6
6
|
const XhButton = props => {
|
|
7
|
-
const { disabled = false, type = "default", size = "normal", shape = "round", children, className, htmlType, formType, text, openType, lang, sessionFrom, sendMessageTitle, sendMessagePath, sendMessageImg, showMessageCard, appParameter, onGetUserInfo, onGetPhoneNumber, onOpenSetting, onError, onContact, onClick, preventTime = 2500, } = props;
|
|
7
|
+
const { disabled = false, type = "default", size = "normal", shape = "round", children, className, htmlType, formType, text, openType, lang, sessionFrom, sendMessageTitle, sendMessagePath, sendMessageImg, showMessageCard, appParameter, onGetUserInfo, onGetPhoneNumber, onOpenSetting, onError, onContact, onClick, preventTime = 2500, style, } = props;
|
|
8
8
|
const state = useTaroEnv();
|
|
9
9
|
const [preventClick, setPreventClick] = useState(false);
|
|
10
10
|
const timer = useRef();
|
|
@@ -46,13 +46,13 @@ const XhButton = props => {
|
|
|
46
46
|
clearTimeout(timer.current);
|
|
47
47
|
};
|
|
48
48
|
}, []);
|
|
49
|
-
const weButton = (React.createElement(Button, { className: classObj, formType: formType, openType: openType, lang: lang, type: type, sessionFrom: sessionFrom, sendMessageTitle: sendMessageTitle, sendMessagePath: sendMessagePath, sendMessageImg: sendMessageImg, showMessageCard: showMessageCard, appParameter: appParameter, onGetUserInfo: onGetUserInfo, onGetPhoneNumber: onGetPhoneNumber, onOpenSetting: onOpenSetting, onError: onError, onContact: onContact, onClick: handleClick, disabled: disabled }, children));
|
|
49
|
+
const weButton = (React.createElement(Button, { className: classObj, formType: formType, openType: openType, lang: lang, type: type, sessionFrom: sessionFrom, sendMessageTitle: sendMessageTitle, sendMessagePath: sendMessagePath, sendMessageImg: sendMessageImg, showMessageCard: showMessageCard, appParameter: appParameter, onGetUserInfo: onGetUserInfo, onGetPhoneNumber: onGetPhoneNumber, onOpenSetting: onOpenSetting, onError: onError, onContact: onContact, onClick: handleClick, disabled: disabled, style: style }, children));
|
|
50
50
|
if (state === "WEAPP") {
|
|
51
51
|
return weButton;
|
|
52
52
|
}
|
|
53
53
|
return (
|
|
54
54
|
// eslint-disable-next-line react/button-has-type
|
|
55
|
-
React.createElement("button", { className: classObj, disabled: disabled, type: htmlType, onClick: disabled ? undefined : handleClick }, children || text));
|
|
55
|
+
React.createElement("button", { className: classObj, disabled: disabled, type: htmlType, onClick: disabled ? undefined : handleClick, style: style }, children || text));
|
|
56
56
|
};
|
|
57
57
|
export default XhButton;
|
|
58
58
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAGZ,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAO5C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAGZ,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAO5C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,cAAc,CAAC;AA4CtB,MAAM,QAAQ,GAAsB,KAAK,CAAC,EAAE;IAC1C,MAAM,EACJ,QAAQ,GAAG,KAAK,EAChB,IAAI,GAAG,SAAS,EAChB,IAAI,GAAG,QAAQ,EACf,KAAK,GAAG,OAAO,EACf,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,eAAe,EACf,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,SAAS,EACT,OAAO,EACP,WAAW,GAAG,IAAI,EAClB,KAAK,GACN,GAAG,KAAK,CAAC;IACV,MAAM,KAAK,GAAG,UAAU,EAAE,CAAC;IAC3B,MAAM,CAAC,YAAY,EAAE,e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const createTheme = (theme) => {
|
|
3
|
+
return createContext(Object.assign({}, theme));
|
|
4
|
+
};
|
|
5
|
+
export const ThemeContext = createTheme({});
|
|
6
|
+
const ThemeProvider = ({ children, value, scoped = false, }) => {
|
|
7
|
+
let clonedElement = children;
|
|
8
|
+
if (!scoped) {
|
|
9
|
+
Object.keys(value).forEach(key => {
|
|
10
|
+
document.body.style.setProperty(key, value[key]);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
clonedElement = React.Children.map(children, (child, index) => {
|
|
15
|
+
if (index === 0) {
|
|
16
|
+
return React.cloneElement(child, {
|
|
17
|
+
style: value,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return child;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return (React.createElement(ThemeContext.Provider, { value: value }, clonedElement));
|
|
26
|
+
};
|
|
27
|
+
export default ThemeProvider;
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ThemeProvider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAyB7C,MAAM,WAAW,GAAG,CAAC,KAAgC,EAAE,EAAE;IACvD,OAAO,aAAa,mBAAM,KAAK,EAAG,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC;AAE5C,MAAM,aAAa,GAAiC,CAAC,EACnD,QAAQ,EACR,KAAK,EACL,MAAM,GAAG,KAAK,GACf,EAAE,EAAE;IACH,IAAI,aAAa,GAAG,QAAQ,CAAC;IAC7B,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YAC/B,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;KACJ;SAAM;QACL,aAAa,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YAC5D,IAAI,KAAK,KAAK,CAAC,EAAE;gBACf,OAAO,KAAK,CAAC,YAAY,CAAC,KAAY,EAAE;oBACtC,KAAK,EAAE,KAAK;iBACb,CAAC,CAAC;aACJ;iBAAM;gBACL,OAAO,KAAK,CAAC;aACd;QACH,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,CACL,oBAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAAG,aAAa,CAAyB,CAC7E,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -16,4 +16,5 @@ export { default as XHDialogRef } from "./components/DialogRef";
|
|
|
16
16
|
export { default as XHTabbar } from "./components/Tabbar";
|
|
17
17
|
export { default as XHPopup } from "./components/Popup";
|
|
18
18
|
export { default as XHPicker } from "./components/Picker";
|
|
19
|
+
export { default as ThemeProvider } from "./components/ThemeProvider";
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,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sBAAsB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
1
|
+
import React, { FC } from "react";
|
|
2
2
|
import { ButtonProps } from "@tarojs/components/types/Button";
|
|
3
3
|
import { ITouchEvent } from "@tarojs/components/types/common";
|
|
4
4
|
import "./index.scss";
|
|
@@ -37,6 +37,7 @@ export declare type XhButtonProps = {
|
|
|
37
37
|
text?: string;
|
|
38
38
|
preventTime?: number;
|
|
39
39
|
onClick?: (e: ITouchEvent | MouseEvent) => void;
|
|
40
|
+
style?: React.CSSProperties;
|
|
40
41
|
} & Omit<ButtonProps, "type" | "size">;
|
|
41
42
|
declare const XhButton: FC<XhButtonProps>;
|
|
42
43
|
export default XhButton;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare type ThemeValue = {
|
|
3
|
+
"--color-primary"?: string;
|
|
4
|
+
"--color-primary-dark"?: string;
|
|
5
|
+
"--color-primary-reverse"?: string;
|
|
6
|
+
"--color-disabled"?: string;
|
|
7
|
+
"--color-warning"?: string;
|
|
8
|
+
"--color-warning-light"?: string;
|
|
9
|
+
"--background-color"?: string;
|
|
10
|
+
"--body-background-color"?: string;
|
|
11
|
+
"--font-color"?: string;
|
|
12
|
+
"--font-color-secondary"?: string;
|
|
13
|
+
"--font-color-tertiary"?: string;
|
|
14
|
+
"--border-color"?: string;
|
|
15
|
+
"--btn-color"?: string;
|
|
16
|
+
"--btn-shadow-primary"?: string;
|
|
17
|
+
"--mask-color"?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare type ThemeProviderProps = {
|
|
20
|
+
value: ThemeValue;
|
|
21
|
+
scoped?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare const ThemeContext: React.Context<{
|
|
24
|
+
[x: string]: string;
|
|
25
|
+
}>;
|
|
26
|
+
declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
27
|
+
export default ThemeProvider;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare type ThemeValue = {
|
|
3
|
+
"--color-primary"?: string;
|
|
4
|
+
"--color-primary-dark"?: string;
|
|
5
|
+
"--color-primary-reverse"?: string;
|
|
6
|
+
"--color-disabled"?: string;
|
|
7
|
+
"--color-warning"?: string;
|
|
8
|
+
"--color-warning-light"?: string;
|
|
9
|
+
"--background-color"?: string;
|
|
10
|
+
"--body-background-color"?: string;
|
|
11
|
+
"--font-color"?: string;
|
|
12
|
+
"--font-color-secondary"?: string;
|
|
13
|
+
"--font-color-tertiary"?: string;
|
|
14
|
+
"--border-color"?: string;
|
|
15
|
+
"--btn-color"?: string;
|
|
16
|
+
"--btn-shadow-primary"?: string;
|
|
17
|
+
"--mask-color"?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare type ThemeProviderProps = {
|
|
20
|
+
value: ThemeValue;
|
|
21
|
+
scoped?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare const ThemeContext: React.Context<{
|
|
24
|
+
[x: string]: string;
|
|
25
|
+
}>;
|
|
26
|
+
declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
27
|
+
export default ThemeProvider;
|
package/types/index.d.ts
CHANGED
|
@@ -16,3 +16,4 @@ export { default as XHDialogRef } from "./components/DialogRef";
|
|
|
16
16
|
export { default as XHTabbar } from "./components/Tabbar";
|
|
17
17
|
export { default as XHPopup } from "./components/Popup";
|
|
18
18
|
export { default as XHPicker } from "./components/Picker";
|
|
19
|
+
export { default as ThemeProvider } from "./components/ThemeProvider";
|