@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 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;
@@ -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
  }
@@ -0,0 +1,9 @@
1
+ declare module '@via-profit/ui-kit/Typography/Paragraph' {
2
+ export type ParagraphProps = React.HTMLAttributes<HTMLParagraphElement> & {
3
+ readonly noMargin?: boolean;
4
+ };
5
+
6
+ const Paragraph: React.FC<ParagraphProps>;
7
+
8
+ export default Paragraph;
9
+ }
@@ -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 Paragraph = styled_1.default.p `
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
- exports.default = Paragraph;
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);
@@ -0,0 +1,7 @@
1
+ declare module '@via-profit/ui-kit/Typography' {
2
+ import Paragraph, { ParagraphProps } from '@via-profit/ui-kit/Typography/Paragraph';
3
+
4
+ export { ParagraphProps };
5
+
6
+ export default Paragraph;
7
+ }
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  declare module '@via-profit/ui-kit' {
2
- import { ColorInterface } from '@via-profit/ui-kit/color';
2
+ import { ColorInterface } from '@via-profit/ui-kit/Color';
3
3
 
4
4
  export interface UITheme {
5
5
  readonly isDark: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@via-profit/ui-kit",
3
- "version": "0.1.0-rc.11",
3
+ "version": "0.1.0-rc.12",
4
4
  "description": "UI Kit",
5
5
  "repository": {
6
6
  "type": "git",