@prom-ui/core 0.0.10 → 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/Body/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Body",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
package/Box/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Box",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Button",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ButtonPageUp: React.NamedExoticComponent<object>;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Checkbox",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
package/Flex/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Flex",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
package/Grid/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Grid",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
package/Icon/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Icon",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Image",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/ImageEmoji",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Input",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ declare type PropsKeyPressApp = {
3
+ code: string;
4
+ onKeyDown?: (e: KeyboardEvent) => void;
5
+ onKeyUp?: (e: KeyboardEvent) => void;
6
+ };
7
+ declare type PropsKeyPress = {
8
+ isActive?: boolean;
9
+ };
10
+ export declare const KeyPress: React.FC<PropsKeyPress & PropsKeyPressApp>;
11
+ export {};
@@ -0,0 +1,55 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var PropTypes = require('prop-types');
7
+ var useKeyPress = require('@prom-ui/hooks/useKeyPress');
8
+
9
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
+
11
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
12
+ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
13
+
14
+ var KeyPressApp = function (_a) {
15
+ var code = _a.code,
16
+ onKeyDown = _a.onKeyDown,
17
+ onKeyUp = _a.onKeyUp;
18
+ useKeyPress.useKeyPress(code, onKeyDown, onKeyUp);
19
+ return null;
20
+ };
21
+
22
+ var KeyPress = function (_a) {
23
+ var _b = _a.isActive,
24
+ isActive = _b === void 0 ? true : _b,
25
+ code = _a.code,
26
+ _c = _a.onKeyDown,
27
+ onKeyDown = _c === void 0 ? function () {} : _c,
28
+ _d = _a.onKeyUp,
29
+ onKeyUp = _d === void 0 ? function () {} : _d;
30
+
31
+ if (isActive) {
32
+ return React__default["default"].createElement(KeyPressApp, {
33
+ code: code,
34
+ onKeyDown: onKeyDown,
35
+ onKeyUp: onKeyUp
36
+ });
37
+ }
38
+
39
+ return null;
40
+ };
41
+ KeyPress.propTypes = {
42
+ /** Принимает значение `event.key` клавишы, можно посмотреть здесь https://keycode.info/ */
43
+ code: PropTypes__default["default"].string.isRequired,
44
+
45
+ /** Если передать `false` компонент перестанет работать */
46
+ isActive: PropTypes__default["default"].bool,
47
+
48
+ /** Срабатывает при нажатии клавиши */
49
+ onKeyDown: PropTypes__default["default"].func,
50
+
51
+ /** Срабатывает при отпускании клавиши */
52
+ onKeyUp: PropTypes__default["default"].func
53
+ };
54
+
55
+ exports.KeyPress = KeyPress;
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "@prom-ui/core/KeyPress",
3
+ "version": "0.0.11",
4
+ "main": "index.js",
5
+ "types": "index.d.ts"
6
+ }
package/Line/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Line",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
package/Link/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Link",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
package/List/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/List",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ declare type PropsOutsideClick = {
3
+ children?: any;
4
+ isActive?: boolean;
5
+ onClick: () => void;
6
+ };
7
+ export declare const OutsideClick: React.FC<PropsOutsideClick>;
8
+ export {};
@@ -0,0 +1,81 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var PropTypes = require('prop-types');
7
+ var useOutsideClick = require('@prom-ui/hooks/useOutsideClick');
8
+
9
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
+
11
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
12
+ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
13
+
14
+ /******************************************************************************
15
+ Copyright (c) Microsoft Corporation.
16
+
17
+ Permission to use, copy, modify, and/or distribute this software for any
18
+ purpose with or without fee is hereby granted.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
21
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
22
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
23
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
24
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
26
+ PERFORMANCE OF THIS SOFTWARE.
27
+ ***************************************************************************** */
28
+
29
+ var __assign = function() {
30
+ __assign = Object.assign || function __assign(t) {
31
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
32
+ s = arguments[i];
33
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
34
+ }
35
+ return t;
36
+ };
37
+ return __assign.apply(this, arguments);
38
+ };
39
+
40
+ function __rest(s, e) {
41
+ var t = {};
42
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
43
+ t[p] = s[p];
44
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
45
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
46
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
47
+ t[p[i]] = s[p[i]];
48
+ }
49
+ return t;
50
+ }
51
+
52
+ var OutsideClick = function (_a) {
53
+ var _b = _a.children,
54
+ children = _b === void 0 ? null : _b,
55
+ _c = _a.isActive,
56
+ isActive = _c === void 0 ? true : _c,
57
+ onClick = _a.onClick,
58
+ props = __rest(_a, ["children", "isActive", "onClick"]);
59
+
60
+ var ref = useOutsideClick.useOutsideClick(onClick)[0];
61
+
62
+ if (!isActive) {
63
+ return React__default["default"].createElement("div", null, children);
64
+ }
65
+
66
+ return React__default["default"].createElement("div", __assign({}, props, {
67
+ ref: ref
68
+ }), children);
69
+ };
70
+ OutsideClick.propTypes = {
71
+ /** React children */
72
+ children: PropTypes__default["default"].node,
73
+
74
+ /** Если передать `false` компонент перестанет работать */
75
+ isActive: PropTypes__default["default"].bool,
76
+
77
+ /** Срабатывает если клик произошел вне компонента */
78
+ onClick: PropTypes__default["default"].func.isRequired
79
+ };
80
+
81
+ exports.OutsideClick = OutsideClick;
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "@prom-ui/core/OutsideClick",
3
+ "version": "0.0.11",
4
+ "main": "index.js",
5
+ "types": "index.d.ts"
6
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Picture",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ declare type PropsPortal = {
3
+ id?: string;
4
+ isActive?: boolean;
5
+ children?: any;
6
+ };
7
+ export declare const Portal: React.FC<PropsPortal>;
8
+ export {};
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var PropTypes = require('prop-types');
7
+ var reactDom = require('react-dom');
8
+ var usePortal = require('@prom-ui/hooks/usePortal');
9
+
10
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
+
12
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
+ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
14
+
15
+ var PortalApp = function (_a) {
16
+ var id = _a.id,
17
+ children = _a.children;
18
+ var target = usePortal.usePortal(id);
19
+
20
+ if (target) {
21
+ return reactDom.createPortal(children, target);
22
+ }
23
+
24
+ return children;
25
+ };
26
+
27
+ var Portal = function (_a) {
28
+ var _b = _a.id,
29
+ id = _b === void 0 ? 'react-portal' : _b,
30
+ _c = _a.isActive,
31
+ isActive = _c === void 0 ? true : _c,
32
+ _d = _a.children,
33
+ children = _d === void 0 ? null : _d;
34
+
35
+ if (!isActive) {
36
+ return children;
37
+ }
38
+
39
+ return React__default["default"].createElement(PortalApp, {
40
+ id: id
41
+ }, children);
42
+ };
43
+ Portal.propTypes = {
44
+ /** React children */
45
+ children: PropTypes__default["default"].node,
46
+
47
+ /** ID html ноды, Если такая нода отсутствует на странице, будет создан новый `<div>` в конце `<body>` */
48
+ id: PropTypes__default["default"].string,
49
+
50
+ /** Если передать `false` компонент перестанет работать */
51
+ isActive: PropTypes__default["default"].bool
52
+ };
53
+
54
+ exports.Portal = Portal;
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "@prom-ui/core/Portal",
3
+ "version": "0.0.11",
4
+ "main": "index.js",
5
+ "types": "index.d.ts"
6
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Rating",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Scroll",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Skeleton",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Spinner",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
package/Text/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Text",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/TextEmoji",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Tumbler",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prom-ui/core",
3
3
  "author": "e.marchenko",
4
- "version": "0.0.10",
4
+ "version": "0.0.11",
5
5
  "description": "core ui blocks",
6
6
  "scripts": {
7
7
  "prebuild": "rm -rf dist && mkdir dist && cp -v package.json README.md CHANGELOG.md dist",
@@ -20,7 +20,8 @@
20
20
  "directory": "dist"
21
21
  },
22
22
  "devDependencies": {
23
- "@prom-ui/core": "file:./src"
23
+ "@prom-ui/core": "file:../core/src",
24
+ "@prom-ui/hooks": "file:../hooks/src"
24
25
  },
25
26
  "dependencies": {
26
27
  "@evo/emoji": "0.2.0",
@@ -38,11 +39,14 @@
38
39
  "evokit-list": "3.3.0",
39
40
  "evokit-picture": "3.2.0",
40
41
  "evokit-text": "3.2.0",
41
- "react-transition-group": "4.4.2"
42
+ "react-transition-group": "4.4.2",
43
+ "ttag": "1.7.24"
42
44
  },
43
45
  "peerDependencies": {
46
+ "@prom-ui/hooks": "*",
44
47
  "prop-types": "*",
45
- "react": "*"
48
+ "react": "*",
49
+ "react-dom": "*"
46
50
  },
47
- "gitHead": "a1d2135617de1480a3a6011cf365b024e54b4b5b"
51
+ "gitHead": "625b6fc4b6f9c2ce4aea157c2bed153827d722c7"
48
52
  }