@prom-ui/core 0.0.5 → 0.0.8
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/index.d.ts +3 -0
- package/Body/index.js +14 -0
- package/Body/package.json +9 -0
- package/Body/style.css +741 -0
- package/Box/index.d.ts +2 -0
- package/Box/index.js +20 -0
- package/Box/package.json +9 -0
- package/Box/style.css +9676 -0
- package/Button/index.d.ts +8 -0
- package/Button/index.js +87 -0
- package/Button/package.json +9 -0
- package/Button/style.css +3393 -0
- package/Checkbox/index.d.ts +8 -0
- package/Checkbox/index.js +99 -0
- package/Checkbox/package.json +10 -0
- package/Checkbox/style.css +133 -0
- package/Flex/index.d.ts +2 -0
- package/Flex/index.js +25 -0
- package/Flex/package.json +9 -0
- package/Flex/style.css +786 -0
- package/Grid/index.d.ts +2 -0
- package/Grid/index.js +25 -0
- package/Grid/package.json +9 -0
- package/Grid/style.css +7350 -0
- package/Icon/index.d.ts +12 -0
- package/Icon/index.js +79 -0
- package/{Test2 → Icon}/package.json +2 -2
- package/Icon/style.css +46 -0
- package/Image/index.d.ts +2 -0
- package/Image/index.js +20 -0
- package/Image/package.json +9 -0
- package/Image/style.css +664 -0
- package/Input/index.d.ts +23 -0
- package/Input/index.js +84 -0
- package/Input/package.json +9 -0
- package/Input/style.css +345 -0
- package/Line/index.d.ts +2 -0
- package/Line/index.js +20 -0
- package/Line/package.json +9 -0
- package/Line/style.css +138 -0
- package/Link/index.d.ts +2 -0
- package/Link/index.js +22 -0
- package/Link/package.json +9 -0
- package/Link/style.css +259 -0
- package/List/index.d.ts +2 -0
- package/List/index.js +25 -0
- package/List/package.json +9 -0
- package/List/style.css +312 -0
- package/Picture/index.d.ts +2 -0
- package/Picture/index.js +25 -0
- package/Picture/package.json +9 -0
- package/Picture/style.css +1426 -0
- package/Rating/index.d.ts +9 -0
- package/Rating/index.js +101 -0
- package/Rating/package.json +9 -0
- package/Rating/style.css +26 -0
- package/Skeleton/index.d.ts +12 -0
- package/Skeleton/index.js +113 -0
- package/Skeleton/package.json +9 -0
- package/Skeleton/style.css +145 -0
- package/Spinner/index.d.ts +9 -0
- package/Spinner/index.js +78 -0
- package/Spinner/package.json +9 -0
- package/Spinner/style.css +80 -0
- package/Text/index.d.ts +2 -0
- package/Text/index.js +20 -0
- package/Text/package.json +9 -0
- package/Text/style.css +840 -0
- package/Tumbler/index.d.ts +8 -0
- package/Tumbler/index.js +98 -0
- package/Tumbler/package.json +10 -0
- package/Tumbler/style.css +118 -0
- package/package.json +20 -3
- package/Test/index.d.ts +0 -1
- package/Test/index.js +0 -11
- package/Test/package.json +0 -6
- package/Test2/Components.d.ts +0 -2
- package/Test2/index.d.ts +0 -3
- package/Test2/index.js +0 -30
- package/Test2/style.css +0 -11
package/Tumbler/index.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require("./style.css");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
6
|
+
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var reactTransitionGroup = require('react-transition-group');
|
|
9
|
+
var PropTypes = require('prop-types');
|
|
10
|
+
var classNames = require('classnames');
|
|
11
|
+
var Spinner = require('@prom-ui/core/Spinner');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
17
|
+
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
18
|
+
|
|
19
|
+
/******************************************************************************
|
|
20
|
+
Copyright (c) Microsoft Corporation.
|
|
21
|
+
|
|
22
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
23
|
+
purpose with or without fee is hereby granted.
|
|
24
|
+
|
|
25
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
26
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
27
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
28
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
29
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
30
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
31
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
32
|
+
***************************************************************************** */
|
|
33
|
+
|
|
34
|
+
var __assign = function() {
|
|
35
|
+
__assign = Object.assign || function __assign(t) {
|
|
36
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
37
|
+
s = arguments[i];
|
|
38
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
39
|
+
}
|
|
40
|
+
return t;
|
|
41
|
+
};
|
|
42
|
+
return __assign.apply(this, arguments);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
function __rest(s, e) {
|
|
46
|
+
var t = {};
|
|
47
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
48
|
+
t[p] = s[p];
|
|
49
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
50
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
51
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
52
|
+
t[p[i]] = s[p[i]];
|
|
53
|
+
}
|
|
54
|
+
return t;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
var css = {"root":"Tumbler__root___17yYC","view":"Tumbler__view___w66K2","viewCircle":"Tumbler__viewCircle___xvJqd","input":"Tumbler__input___Kg91O","inputLoading":"Tumbler__inputLoading___y1iJD","spinner":"Tumbler__spinner___CNMl7","spinnerEnterActive":"Tumbler__spinnerEnterActive___C2P5b","spinnerEnterDone":"Tumbler__spinnerEnterDone___cgEXP","spinnerExitActive":"Tumbler__spinnerExitActive___k-mzv","spinnerExitDone":"Tumbler__spinnerExitDone___XD0-8"};
|
|
58
|
+
|
|
59
|
+
var Tumbler = React.forwardRef(function (_a, ref) {
|
|
60
|
+
var _b;
|
|
61
|
+
|
|
62
|
+
var className = _a.className,
|
|
63
|
+
loading = _a.loading,
|
|
64
|
+
props = __rest(_a, ["className", "loading"]);
|
|
65
|
+
|
|
66
|
+
return React__default["default"].createElement("div", {
|
|
67
|
+
className: classNames__default["default"](css.root, className)
|
|
68
|
+
}, React__default["default"].createElement("input", __assign({
|
|
69
|
+
ref: ref,
|
|
70
|
+
className: classNames__default["default"](css.input, (_b = {}, _b[css.inputLoading] = loading, _b))
|
|
71
|
+
}, props)), React__default["default"].createElement("div", {
|
|
72
|
+
className: css.view
|
|
73
|
+
}, React__default["default"].createElement("div", {
|
|
74
|
+
className: css.viewCircle
|
|
75
|
+
}, React__default["default"].createElement(reactTransitionGroup.CSSTransition, {
|
|
76
|
+
in: loading,
|
|
77
|
+
timeout: 100,
|
|
78
|
+
classNames: {
|
|
79
|
+
enterActive: css.spinnerEnterActive,
|
|
80
|
+
enterDone: css.spinnerEnterDone,
|
|
81
|
+
exitActive: css.spinnerExitActive,
|
|
82
|
+
exitDone: css.spinnerExitDone
|
|
83
|
+
},
|
|
84
|
+
unmountOnExit: true
|
|
85
|
+
}, React__default["default"].createElement(Spinner.Spinner, {
|
|
86
|
+
className: css.spinner
|
|
87
|
+
})))));
|
|
88
|
+
});
|
|
89
|
+
Tumbler.defaultProps = {
|
|
90
|
+
type: 'checkbox',
|
|
91
|
+
loading: false
|
|
92
|
+
};
|
|
93
|
+
Tumbler.propTypes = {
|
|
94
|
+
type: PropTypes__default["default"].oneOf(['checkbox', 'radio']),
|
|
95
|
+
loading: PropTypes__default["default"].bool
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
exports.Tumbler = Tumbler;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
.Tumbler__root___17yYC {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: block;
|
|
4
|
+
width: 34px;
|
|
5
|
+
height: 20px;
|
|
6
|
+
padding: 3px 0;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
margin: calc((var(--pds-line-height) - 20px) / 2) 0;
|
|
9
|
+
flex-shrink: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.Tumbler__view___w66K2 {
|
|
13
|
+
height: 100%;
|
|
14
|
+
border-radius: 1em;
|
|
15
|
+
background: var(--black-400);
|
|
16
|
+
transition: background-color 120ms ease-in-out;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.Tumbler__viewCircle___xvJqd {
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 0;
|
|
23
|
+
left: 0;
|
|
24
|
+
width: 20px;
|
|
25
|
+
height: 20px;
|
|
26
|
+
border-radius: 100%;
|
|
27
|
+
transform: translateX(0);
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
color: var(--violet-500);
|
|
32
|
+
background: var(--white);
|
|
33
|
+
border: 1px var(--black-400) solid;
|
|
34
|
+
box-shadow: 1px 1px 4px 0 var(--black-400);
|
|
35
|
+
transition: 120ms ease-in-out;
|
|
36
|
+
transition-property: background-color, border-color, transform;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.Tumbler__input___Kg91O {
|
|
40
|
+
position: absolute;
|
|
41
|
+
top: 0;
|
|
42
|
+
left: 0;
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 100%;
|
|
45
|
+
opacity: 0;
|
|
46
|
+
padding: 0;
|
|
47
|
+
margin: 0;
|
|
48
|
+
-webkit-appearance: none;
|
|
49
|
+
-moz-appearance: none;
|
|
50
|
+
appearance: none;
|
|
51
|
+
z-index: 1;
|
|
52
|
+
cursor: pointer
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.Tumbler__input___Kg91O:disabled {
|
|
56
|
+
cursor: default;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.Tumbler__input___Kg91O:focus-visible + .Tumbler__view___w66K2 .Tumbler__viewCircle___xvJqd {
|
|
60
|
+
outline: var(--pds-round-xxs) auto Highlight;
|
|
61
|
+
outline: var(--pds-round-xxs) auto -webkit-focus-ring-color;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.Tumbler__input___Kg91O:checked + .Tumbler__view___w66K2 {
|
|
65
|
+
background-color: var(--violet-50)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.Tumbler__input___Kg91O:checked + .Tumbler__view___w66K2 .Tumbler__viewCircle___xvJqd {
|
|
69
|
+
transform: translateX(14px);
|
|
70
|
+
color: var(--white);
|
|
71
|
+
background-color: var(--violet-500);
|
|
72
|
+
border-color: var(--violet-500);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.Tumbler__input___Kg91O:disabled + .Tumbler__view___w66K2 {
|
|
76
|
+
background-color: var(--black-200)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.Tumbler__input___Kg91O:disabled + .Tumbler__view___w66K2 .Tumbler__viewCircle___xvJqd {
|
|
80
|
+
box-shadow: none;
|
|
81
|
+
color: var(--violet-500);
|
|
82
|
+
background-color: var(--black-400);
|
|
83
|
+
border-color: var(--black-400);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.Tumbler__inputLoading___y1iJD {
|
|
87
|
+
pointer-events: none;
|
|
88
|
+
cursor: default;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.Tumbler__spinner___CNMl7 {
|
|
92
|
+
opacity: 0;
|
|
93
|
+
transition: opacity 100ms ease-in-out;
|
|
94
|
+
width: 1em;
|
|
95
|
+
height: 1em;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.Tumbler__spinnerEnterActive___C2P5b,
|
|
99
|
+
.Tumbler__spinnerEnterDone___cgEXP {
|
|
100
|
+
opacity: 1;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.Tumbler__spinnerExitActive___k-mzv,
|
|
104
|
+
.Tumbler__spinnerExitDone___XD0-8 {
|
|
105
|
+
opacity: 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@media (hover) {
|
|
109
|
+
.Tumbler__input___Kg91O:hover + .Tumbler__view___w66K2 .Tumbler__viewCircle___xvJqd {
|
|
110
|
+
border-color: var(--black-500);
|
|
111
|
+
}
|
|
112
|
+
.Tumbler__input___Kg91O:checked:hover + .Tumbler__view___w66K2 .Tumbler__viewCircle___xvJqd {
|
|
113
|
+
border-color: var(--violet-500);
|
|
114
|
+
}
|
|
115
|
+
.Tumbler__input___Kg91O:disabled:hover + .Tumbler__view___w66K2 .Tumbler__viewCircle___xvJqd {
|
|
116
|
+
border-color: var(--black-400);
|
|
117
|
+
}
|
|
118
|
+
}
|
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.
|
|
4
|
+
"version": "0.0.8",
|
|
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",
|
|
@@ -19,11 +19,28 @@
|
|
|
19
19
|
"access": "public",
|
|
20
20
|
"directory": "dist"
|
|
21
21
|
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@prom-ui/core": "file:./src"
|
|
24
|
+
},
|
|
22
25
|
"dependencies": {
|
|
23
|
-
"
|
|
26
|
+
"classnames": "2.3.1",
|
|
27
|
+
"evokit": "3.2.3",
|
|
28
|
+
"evokit-body": "3.2.0",
|
|
29
|
+
"evokit-box": "3.4.0",
|
|
30
|
+
"evokit-button": "3.0.1",
|
|
31
|
+
"evokit-flex": "3.2.1",
|
|
32
|
+
"evokit-grid": "3.3.0",
|
|
33
|
+
"evokit-image": "3.2.0",
|
|
34
|
+
"evokit-line": "3.1.0",
|
|
35
|
+
"evokit-link": "3.2.0",
|
|
36
|
+
"evokit-list": "3.3.0",
|
|
37
|
+
"evokit-picture": "3.2.0",
|
|
38
|
+
"evokit-text": "3.2.0",
|
|
39
|
+
"react-transition-group": "4.4.2"
|
|
24
40
|
},
|
|
25
41
|
"peerDependencies": {
|
|
42
|
+
"prop-types": "*",
|
|
26
43
|
"react": "*"
|
|
27
44
|
},
|
|
28
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "0051d0baef253f1b7f3fa0846416484a63881cb7"
|
|
29
46
|
}
|
package/Test/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const Test: () => void;
|
package/Test/index.js
DELETED
package/Test/package.json
DELETED
package/Test2/Components.d.ts
DELETED
package/Test2/index.d.ts
DELETED
package/Test2/index.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
require("./style.css");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
6
|
-
|
|
7
|
-
var evokit = require('evokit');
|
|
8
|
-
var React = require('react');
|
|
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
|
-
|
|
14
|
-
var css$1 = {"root":"Components_root__RHtJ4"};
|
|
15
|
-
|
|
16
|
-
var Components = function () {
|
|
17
|
-
return React__default["default"].createElement("div", {
|
|
18
|
-
className: css$1.root
|
|
19
|
-
}, "\u043F\u0440\u0438\u0432\u0435\u0442");
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
var css = {"ek-myblock":"Test2_ek-myblock__c2Y4J","ek-myblock_color_red":"Test2_ek-myblock_color_red__H5exA"};
|
|
23
|
-
|
|
24
|
-
var Test2 = evokit.createBlock('div', 'myblock', ['color'], {
|
|
25
|
-
css: css
|
|
26
|
-
});
|
|
27
|
-
var ComponentsText = Components;
|
|
28
|
-
|
|
29
|
-
exports.ComponentsText = ComponentsText;
|
|
30
|
-
exports.Test2 = Test2;
|