@pedidopago/ui 1.3.19 → 1.3.20
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/components/Typography/styles.d.ts +1 -1
- package/dist/components/Typography/types.d.ts +2 -2
- package/dist/components/Typography/types.d.ts.map +1 -1
- package/dist/shared/theme/contexts/ThemeContext.d.ts.map +1 -1
- package/dist/shared/theme/contexts/ThemeContext.js +10 -2
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { GenericStyledProps } from './../../@types/index';
|
|
|
3
3
|
export declare const StyledText: import("@emotion/styled").StyledComponent<{
|
|
4
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
5
|
as?: import("react").ElementType<any> | undefined;
|
|
6
|
-
} & GenericStyledProps & import("react").
|
|
6
|
+
} & GenericStyledProps & import("react").HTMLAttributes<HTMLLabelElement | HTMLParagraphElement> & {
|
|
7
7
|
variant?: "small" | "caption" | "em" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "label" | "p" | "span" | "strong" | undefined;
|
|
8
8
|
color?: import("../..").GlobalColorsProps | (string & {}) | undefined;
|
|
9
9
|
fontSize?: number | "display" | "tiny" | "xxxs" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl" | "giant" | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { GlobalColorsProps, defaultTheme } from './../../shared/theme';
|
|
3
|
-
export declare type TypographyProps =
|
|
3
|
+
export declare type TypographyProps = HTMLAttributes<HTMLParagraphElement | HTMLLabelElement> & {
|
|
4
4
|
variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'label' | 'caption' | 'small' | 'strong' | 'em';
|
|
5
5
|
color?: GlobalColorsProps | (string & {});
|
|
6
6
|
fontSize?: keyof typeof defaultTheme.fontSizes | number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Typography/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Typography/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEvE,oBAAY,eAAe,GAAG,cAAc,CAAC,oBAAoB,GAAG,gBAAgB,CAAC,GAAG;IACtF,OAAO,CAAC,EACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,GAAG,GACH,MAAM,GACN,OAAO,GACP,SAAS,GACT,OAAO,GACP,QAAQ,GACR,IAAI,CAAC;IACT,KAAK,CAAC,EAAE,iBAAiB,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC1C,QAAQ,CAAC,EAAE,MAAM,OAAO,YAAY,CAAC,SAAS,GAAG,MAAM,CAAC;IACxD,UAAU,CAAC,EAAE,MAAM,OAAO,YAAY,CAAC,UAAU,CAAC;IAClD,SAAS,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IACpE,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACvC,aAAa,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,MAAM,CAAC;IAClE,cAAc,CAAC,EAAE,WAAW,GAAG,cAAc,GAAG,MAAM,CAAC;IACvD,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../../src/shared/theme/contexts/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAuB,MAAM,OAAO,CAAC;AAQtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,aAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,gBAAgB,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEF,aAAK,kBAAkB,GAAG;IACxB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACpC,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,YAAY,4CAAyC,CAAC;AAEnE,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../../../../src/shared/theme/contexts/ThemeContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAuB,MAAM,OAAO,CAAC;AAQtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,aAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,gBAAgB,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEF,aAAK,kBAAkB,GAAG;IACxB,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACpC,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,YAAY,4CAAyC,CAAC;AAEnE,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eAmC1F"}
|
|
@@ -51,6 +51,11 @@ function PPUIThemeProvider(_ref) {
|
|
|
51
51
|
colorMode = _useState2[0],
|
|
52
52
|
setColorMode = _useState2[1];
|
|
53
53
|
|
|
54
|
+
var _useState3 = (0, _react.useState)(theme || _.defaultTheme),
|
|
55
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
56
|
+
currentTheme = _useState4[0],
|
|
57
|
+
setCurrentTheme = _useState4[1];
|
|
58
|
+
|
|
54
59
|
(0, _react.useEffect)(function () {
|
|
55
60
|
var localStorageColorMode = _localStorageController.localStorageController.get('UIColorMode');
|
|
56
61
|
|
|
@@ -58,6 +63,9 @@ function PPUIThemeProvider(_ref) {
|
|
|
58
63
|
setColorMode(localStorageColorMode === 'dark');
|
|
59
64
|
}
|
|
60
65
|
}, [setColorMode]);
|
|
66
|
+
(0, _react.useEffect)(function () {
|
|
67
|
+
setCurrentTheme(theme || _.defaultTheme);
|
|
68
|
+
}, [theme]);
|
|
61
69
|
|
|
62
70
|
function switchColorMode() {
|
|
63
71
|
var newColorMode = !colorMode;
|
|
@@ -69,12 +77,12 @@ function PPUIThemeProvider(_ref) {
|
|
|
69
77
|
|
|
70
78
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ThemeContext.Provider, {
|
|
71
79
|
value: {
|
|
72
|
-
theme:
|
|
80
|
+
theme: currentTheme,
|
|
73
81
|
colorMode: colorMode,
|
|
74
82
|
switchColorMode: switchColorMode
|
|
75
83
|
},
|
|
76
84
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react2.ThemeProvider, {
|
|
77
|
-
theme: _objectSpread(_objectSpread({},
|
|
85
|
+
theme: _objectSpread(_objectSpread({}, currentTheme), {}, {
|
|
78
86
|
colorMode: colorMode ? 'dark' : 'light'
|
|
79
87
|
}),
|
|
80
88
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ToastProvider.default, {
|