@via-profit/ui-kit 0.1.0-rc.11 → 0.1.0-rc.12
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/README.md +5 -1
- package/ThemeProvider/index.d.ts +11 -0
- package/Typography/Paragraph.d.ts +9 -0
- package/Typography/Paragraph.js +19 -2
- package/Typography/index.d.ts +7 -0
- package/index.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,11 +20,14 @@ $ npm install @emotion/react @emotion/styled react react-dom react-modal react-p
|
|
|
20
20
|
Для переопределения темы оформления в пакете `@emotion/styled` создайте, например в директории `@types`, файл `emotion.d.ts` со следующим содержимым:
|
|
21
21
|
|
|
22
22
|
```ts
|
|
23
|
+
import '@emotion/react';
|
|
24
|
+
|
|
23
25
|
declare module '@emotion/react' {
|
|
24
26
|
import { UITheme } from '@via-profit/ui-kit';
|
|
25
27
|
|
|
26
28
|
export interface Theme extends UITheme {}
|
|
27
29
|
}
|
|
30
|
+
|
|
28
31
|
```
|
|
29
32
|
|
|
30
33
|
Для переопределения темы оформления в пакете `@via-profit/ui-kit` создайте, например в директории `@types`, файл `ui-kit.d.ts` со следующим содержимым:
|
|
@@ -32,12 +35,13 @@ declare module '@emotion/react' {
|
|
|
32
35
|
_@types/emotion.d.ts_
|
|
33
36
|
|
|
34
37
|
```ts
|
|
35
|
-
declare module '@via-profit/ui-kit' {
|
|
36
38
|
import {
|
|
37
39
|
UIThemeOverrideColor as Colors,
|
|
38
40
|
UIThemeOverrideZIndex as ZIndexes,
|
|
39
41
|
} from '@via-profit/ui-kit';
|
|
40
42
|
|
|
43
|
+
|
|
44
|
+
declare module '@via-profit/ui-kit' {
|
|
41
45
|
export interface UIThemeOverrideColor extends Colors {
|
|
42
46
|
readonly drawer: string;
|
|
43
47
|
readonly drawerContrast: string;
|
package/ThemeProvider/index.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
declare module '@via-profit/ui-kit/ThemeProvider' {
|
|
2
2
|
import { UITheme, UIThemeOverrides } from '@via-profit/ui-kit';
|
|
3
3
|
|
|
4
|
+
export type { UITheme, UIThemeOverrides };
|
|
5
|
+
|
|
4
6
|
export type CreateTheme = (overrides?: UIThemeOverrides) => UITheme;
|
|
7
|
+
|
|
8
|
+
export interface ThemeProviderProps {
|
|
9
|
+
readonly children: React.ReactNode | readonly React.ReactNode[];
|
|
10
|
+
readonly theme: UITheme;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
14
|
+
|
|
15
|
+
export default ThemeProvider;
|
|
5
16
|
}
|
package/Typography/Paragraph.js
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
15
|
};
|
|
5
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
17
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
7
|
-
const
|
|
18
|
+
const react_1 = __importDefault(require("react"));
|
|
19
|
+
const StyledParagraph = styled_1.default.p `
|
|
8
20
|
font-size: 1rem;
|
|
9
21
|
font-weight: 300;
|
|
22
|
+
margin: ${({ $noMargin }) => ($noMargin ? 0 : '0 0 0.8em 0')};
|
|
10
23
|
color: ${({ theme }) => theme.colors.textPrimary.toString()};
|
|
11
24
|
`;
|
|
12
|
-
|
|
25
|
+
const Paragraph = (props, ref) => {
|
|
26
|
+
const { noMargin, children } = props, restProps = __rest(props, ["noMargin", "children"]);
|
|
27
|
+
return (react_1.default.createElement(StyledParagraph, Object.assign({}, restProps, { ref: ref }), children));
|
|
28
|
+
};
|
|
29
|
+
exports.default = react_1.default.forwardRef(Paragraph);
|
package/index.d.ts
CHANGED