@pareto-engineering/design-system 4.0.0-alpha.23 → 4.0.0-alpha.25
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/cjs/a/BlurOverlay/BlurOverlay.js +59 -0
- package/dist/cjs/a/BlurOverlay/index.js +13 -0
- package/dist/cjs/a/BlurOverlay/styles.scss +31 -0
- package/dist/cjs/a/index.js +7 -0
- package/dist/cjs/b/Button/Button.js +1 -1
- package/dist/cjs/b/Button/styles.scss +4 -4
- package/dist/cjs/b/ThemeSelector/ThemeSelector.js +3 -1
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +5 -4
- package/dist/cjs/f/fields/ChoicesInput/styles.scss +4 -0
- package/dist/cjs/f/fields/TextInput/styles.scss +3 -2
- package/dist/es/a/BlurOverlay/BlurOverlay.js +51 -0
- package/dist/es/a/BlurOverlay/index.js +2 -0
- package/dist/es/a/BlurOverlay/styles.scss +31 -0
- package/dist/es/a/index.js +1 -0
- package/dist/es/b/Button/Button.js +1 -1
- package/dist/es/b/Button/styles.scss +4 -4
- package/dist/es/b/ThemeSelector/ThemeSelector.js +3 -1
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +5 -4
- package/dist/es/f/fields/ChoicesInput/styles.scss +4 -0
- package/dist/es/f/fields/TextInput/styles.scss +3 -2
- package/package.json +4 -3
- package/src/stories/a/BlurOverlay.stories.jsx +39 -0
- package/src/ui/a/BlurOverlay/BlurOverlay.jsx +75 -0
- package/src/ui/a/BlurOverlay/index.js +2 -0
- package/src/ui/a/BlurOverlay/styles.scss +31 -0
- package/src/ui/a/index.js +1 -0
- package/src/ui/b/Button/Button.jsx +1 -1
- package/src/ui/b/Button/styles.scss +4 -4
- package/src/ui/b/ThemeSelector/ThemeSelector.jsx +3 -1
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +4 -2
- package/src/ui/f/fields/ChoicesInput/styles.scss +4 -0
- package/src/ui/f/fields/TextInput/styles.scss +3 -2
- package/tests/__snapshots__/Storyshots.test.js.snap +25 -2
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _exports = _interopRequireDefault(require("@pareto-engineering/bem/exports"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } /* @pareto-engineering/generator-front 1.1.1-alpha.1 */
|
|
13
|
+
const baseClassName = _exports.default.base;
|
|
14
|
+
const componentClassName = 'blur-overlay';
|
|
15
|
+
const BlurOverlay = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
id,
|
|
18
|
+
className: userClassName,
|
|
19
|
+
style,
|
|
20
|
+
children,
|
|
21
|
+
blur
|
|
22
|
+
} = _ref;
|
|
23
|
+
(0, React.useInsertionEffect)(() => {
|
|
24
|
+
Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
|
|
25
|
+
}, []);
|
|
26
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
id: id,
|
|
28
|
+
className: [baseClassName, componentClassName, userClassName, blur && _exports.default.modifierActive].filter(e => e).join(' '),
|
|
29
|
+
style: style
|
|
30
|
+
}, children);
|
|
31
|
+
};
|
|
32
|
+
BlurOverlay.propTypes = {
|
|
33
|
+
/**
|
|
34
|
+
* The HTML id for this element
|
|
35
|
+
*/
|
|
36
|
+
id: _propTypes.default.string,
|
|
37
|
+
/**
|
|
38
|
+
* The HTML class names for this element
|
|
39
|
+
*/
|
|
40
|
+
className: _propTypes.default.string,
|
|
41
|
+
/**
|
|
42
|
+
* The React-written, css properties for this element.
|
|
43
|
+
*/
|
|
44
|
+
style: _propTypes.default.objectOf(_propTypes.default.string),
|
|
45
|
+
/**
|
|
46
|
+
* The children JSX
|
|
47
|
+
*/
|
|
48
|
+
children: _propTypes.default.node,
|
|
49
|
+
/**
|
|
50
|
+
* Boolean to toggle blur effect
|
|
51
|
+
*/
|
|
52
|
+
blur: _propTypes.default.bool
|
|
53
|
+
};
|
|
54
|
+
BlurOverlay.defaultProps = {
|
|
55
|
+
blur: true
|
|
56
|
+
// someProp:false
|
|
57
|
+
};
|
|
58
|
+
var _default = BlurOverlay;
|
|
59
|
+
exports.default = _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "BlurOverlay", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _BlurOverlay.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _BlurOverlay = _interopRequireDefault(require("./BlurOverlay"));
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.1.1-alpha.1 */
|
|
2
|
+
|
|
3
|
+
@use "@pareto-engineering/bem";
|
|
4
|
+
|
|
5
|
+
.#{bem.$base}.blur-overlay {
|
|
6
|
+
background: inherit;
|
|
7
|
+
left: 0;
|
|
8
|
+
position: fixed;
|
|
9
|
+
top: 0;
|
|
10
|
+
width: 100%;
|
|
11
|
+
z-index: 3;
|
|
12
|
+
&.#{bem.$modifier-active} {
|
|
13
|
+
animation: blurAnimation .3s ease-in-out;
|
|
14
|
+
backdrop-filter: blur(5px);
|
|
15
|
+
height: 100%;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@keyframes blurAnimation {
|
|
20
|
+
0% {
|
|
21
|
+
transform: translateX(-100%);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
1% {
|
|
25
|
+
transform: translateX(0);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
100% {
|
|
29
|
+
transform: translateX(0);
|
|
30
|
+
}
|
|
31
|
+
}
|
package/dist/cjs/a/index.js
CHANGED
|
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "AppContextProvider", {
|
|
|
27
27
|
return _AppContext.AppContextProvider;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
+
Object.defineProperty(exports, "BlurOverlay", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _BlurOverlay.BlurOverlay;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
30
36
|
Object.defineProperty(exports, "ContentTree", {
|
|
31
37
|
enumerable: true,
|
|
32
38
|
get: function () {
|
|
@@ -154,6 +160,7 @@ Object.defineProperty(exports, "useTheme", {
|
|
|
154
160
|
}
|
|
155
161
|
});
|
|
156
162
|
var _AppContext = require("./AppContext");
|
|
163
|
+
var _BlurOverlay = require("./BlurOverlay");
|
|
157
164
|
var _ContentTree = require("./ContentTree");
|
|
158
165
|
var _Conversation = require("./Conversation");
|
|
159
166
|
var _DotInfo = require("./DotInfo");
|
|
@@ -41,7 +41,7 @@ const Button = _ref => {
|
|
|
41
41
|
}, children) : children;
|
|
42
42
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
43
43
|
id: id,
|
|
44
|
-
className: [baseClassName, componentClassName, userClassName, `x-${color}`, isGhost && _exports.default.modifierGhost, isCompact && _exports.default.modifierCompact, isSimple && _exports.default.modifierSimple, isGradient && _exports.default.modifierGradient, isSpaced && _exports.default.modifierSpaced, arrowDirection && `arrow-${arrowDirection}`].filter(e => e).join(' '),
|
|
44
|
+
className: [baseClassName, componentClassName, userClassName, `x-${color}`, isGhost && _exports.default.modifierGhost, isCompact && _exports.default.modifierCompact, isSimple && _exports.default.modifierSimple, isGradient && _exports.default.modifierGradient, isSpaced && _exports.default.modifierSpaced, !isLoading && arrowDirection && `arrow-${arrowDirection}`].filter(e => e).join(' '),
|
|
45
45
|
style: style,
|
|
46
46
|
type: "button"
|
|
47
47
|
}, otherProps), isLoading ? /*#__PURE__*/React.createElement(_.LoadingCircle, {
|
|
@@ -113,8 +113,8 @@ $default-animation-time: .31s;
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
&:disabled {
|
|
116
|
-
border: 1px solid var(--
|
|
117
|
-
color: var(--
|
|
116
|
+
border: 1px solid var(--hard-disabled, var(--#{$default-color}));
|
|
117
|
+
color: var(--hard-disabled, var(--#{$default-color}));
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
@@ -150,12 +150,12 @@ $default-animation-time: .31s;
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
&:disabled {
|
|
153
|
-
color: var(--
|
|
153
|
+
color: var(--hard-disabled, var(--#{$default-color}));
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
&:disabled {
|
|
158
|
-
background: var(--
|
|
158
|
+
background: var(--hard-disabled);
|
|
159
159
|
filter: brightness(125%);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
@@ -37,7 +37,9 @@ const ThemeSelector = _ref => {
|
|
|
37
37
|
const current = themes.indexOf(userTheme);
|
|
38
38
|
setPreferredTheme(themes[(current + 1) % themes.length]);
|
|
39
39
|
}, [userTheme]);
|
|
40
|
-
const
|
|
40
|
+
const current = userTheme ? themes.indexOf(userTheme) : 0;
|
|
41
|
+
const nextTheme = themes[(current + 1) % themes.length];
|
|
42
|
+
const themeText = nextTheme && nextTheme.charAt(0).toUpperCase() + nextTheme.slice(1);
|
|
41
43
|
return (
|
|
42
44
|
/*#__PURE__*/
|
|
43
45
|
// eslint-disable-next-line jsx-a11y/anchor-is-valid, jsx-a11y/no-static-element-interactions
|
|
@@ -34,8 +34,9 @@ const ChoicesInput = _ref => {
|
|
|
34
34
|
label,
|
|
35
35
|
optional,
|
|
36
36
|
disabled,
|
|
37
|
-
description
|
|
38
|
-
|
|
37
|
+
description,
|
|
38
|
+
spaceBetween,
|
|
39
|
+
...otherProps
|
|
39
40
|
} = _ref;
|
|
40
41
|
(0, React.useInsertionEffect)(() => {
|
|
41
42
|
Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
|
|
@@ -53,7 +54,7 @@ const ChoicesInput = _ref => {
|
|
|
53
54
|
as: "p",
|
|
54
55
|
optional: optional
|
|
55
56
|
}, label), /*#__PURE__*/React.createElement("div", {
|
|
56
|
-
className:
|
|
57
|
+
className: ['choices', spaceBetween && 'space-between'].filter(Boolean).join(' ')
|
|
57
58
|
}, options.map(choice => /*#__PURE__*/React.createElement(_common.Choice, _extends({
|
|
58
59
|
labelClassName: "with-faded-border",
|
|
59
60
|
key: choice.value,
|
|
@@ -62,7 +63,7 @@ const ChoicesInput = _ref => {
|
|
|
62
63
|
multiple: multiple,
|
|
63
64
|
validate: validate,
|
|
64
65
|
disabled: disabled
|
|
65
|
-
}, choice)))), /*#__PURE__*/React.createElement(_common2.FormDescription, {
|
|
66
|
+
}, otherProps, choice)))), /*#__PURE__*/React.createElement(_common2.FormDescription, {
|
|
66
67
|
className: "v50 mt-v s-1",
|
|
67
68
|
description: description,
|
|
68
69
|
name: name
|
|
@@ -8,7 +8,7 @@ $default-symbol-left: 1em;
|
|
|
8
8
|
$default-padding-with-symbol:
|
|
9
9
|
.75em
|
|
10
10
|
calc($default-symbol-left - 1em)
|
|
11
|
-
.
|
|
11
|
+
.75em
|
|
12
12
|
calc($default-symbol-left + 1em);
|
|
13
13
|
$default-input-border-radius: var(--theme-default-input-border-radius);
|
|
14
14
|
|
|
@@ -30,7 +30,8 @@ $default-input-border-radius: var(--theme-default-input-border-radius);
|
|
|
30
30
|
content: var(--symbol);
|
|
31
31
|
left: $default-symbol-left;
|
|
32
32
|
position: absolute;
|
|
33
|
-
top:
|
|
33
|
+
top: 50%;
|
|
34
|
+
transform: translate(-50%, -50%);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
input {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.1.1-alpha.1 */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useInsertionEffect } from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import styleNames from '@pareto-engineering/bem/exports';
|
|
6
|
+
const baseClassName = styleNames.base;
|
|
7
|
+
const componentClassName = 'blur-overlay';
|
|
8
|
+
const BlurOverlay = ({
|
|
9
|
+
id,
|
|
10
|
+
className: userClassName,
|
|
11
|
+
style,
|
|
12
|
+
children,
|
|
13
|
+
blur
|
|
14
|
+
}) => {
|
|
15
|
+
useInsertionEffect(() => {
|
|
16
|
+
import("./styles.scss");
|
|
17
|
+
}, []);
|
|
18
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
id: id,
|
|
20
|
+
className: [baseClassName, componentClassName, userClassName, blur && styleNames.modifierActive].filter(e => e).join(' '),
|
|
21
|
+
style: style
|
|
22
|
+
}, children);
|
|
23
|
+
};
|
|
24
|
+
BlurOverlay.propTypes = {
|
|
25
|
+
/**
|
|
26
|
+
* The HTML id for this element
|
|
27
|
+
*/
|
|
28
|
+
id: PropTypes.string,
|
|
29
|
+
/**
|
|
30
|
+
* The HTML class names for this element
|
|
31
|
+
*/
|
|
32
|
+
className: PropTypes.string,
|
|
33
|
+
/**
|
|
34
|
+
* The React-written, css properties for this element.
|
|
35
|
+
*/
|
|
36
|
+
style: PropTypes.objectOf(PropTypes.string),
|
|
37
|
+
/**
|
|
38
|
+
* The children JSX
|
|
39
|
+
*/
|
|
40
|
+
children: PropTypes.node,
|
|
41
|
+
/**
|
|
42
|
+
* Boolean to toggle blur effect
|
|
43
|
+
*/
|
|
44
|
+
blur: PropTypes.bool
|
|
45
|
+
};
|
|
46
|
+
BlurOverlay.defaultProps = {
|
|
47
|
+
blur: true
|
|
48
|
+
// someProp:false
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default BlurOverlay;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.1.1-alpha.1 */
|
|
2
|
+
|
|
3
|
+
@use "@pareto-engineering/bem";
|
|
4
|
+
|
|
5
|
+
.#{bem.$base}.blur-overlay {
|
|
6
|
+
background: inherit;
|
|
7
|
+
left: 0;
|
|
8
|
+
position: fixed;
|
|
9
|
+
top: 0;
|
|
10
|
+
width: 100%;
|
|
11
|
+
z-index: 3;
|
|
12
|
+
&.#{bem.$modifier-active} {
|
|
13
|
+
animation: blurAnimation .3s ease-in-out;
|
|
14
|
+
backdrop-filter: blur(5px);
|
|
15
|
+
height: 100%;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@keyframes blurAnimation {
|
|
20
|
+
0% {
|
|
21
|
+
transform: translateX(-100%);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
1% {
|
|
25
|
+
transform: translateX(0);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
100% {
|
|
29
|
+
transform: translateX(0);
|
|
30
|
+
}
|
|
31
|
+
}
|
package/dist/es/a/index.js
CHANGED
|
@@ -36,7 +36,7 @@ const Button = ({
|
|
|
36
36
|
}, children) : children;
|
|
37
37
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
38
38
|
id: id,
|
|
39
|
-
className: [baseClassName, componentClassName, userClassName, `x-${color}`, isGhost && styleNames.modifierGhost, isCompact && styleNames.modifierCompact, isSimple && styleNames.modifierSimple, isGradient && styleNames.modifierGradient, isSpaced && styleNames.modifierSpaced, arrowDirection && `arrow-${arrowDirection}`].filter(e => e).join(' '),
|
|
39
|
+
className: [baseClassName, componentClassName, userClassName, `x-${color}`, isGhost && styleNames.modifierGhost, isCompact && styleNames.modifierCompact, isSimple && styleNames.modifierSimple, isGradient && styleNames.modifierGradient, isSpaced && styleNames.modifierSpaced, !isLoading && arrowDirection && `arrow-${arrowDirection}`].filter(e => e).join(' '),
|
|
40
40
|
style: style,
|
|
41
41
|
type: "button"
|
|
42
42
|
}, otherProps), isLoading ? /*#__PURE__*/React.createElement(LoadingCircle, {
|
|
@@ -113,8 +113,8 @@ $default-animation-time: .31s;
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
&:disabled {
|
|
116
|
-
border: 1px solid var(--
|
|
117
|
-
color: var(--
|
|
116
|
+
border: 1px solid var(--hard-disabled, var(--#{$default-color}));
|
|
117
|
+
color: var(--hard-disabled, var(--#{$default-color}));
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
@@ -150,12 +150,12 @@ $default-animation-time: .31s;
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
&:disabled {
|
|
153
|
-
color: var(--
|
|
153
|
+
color: var(--hard-disabled, var(--#{$default-color}));
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
&:disabled {
|
|
158
|
-
background: var(--
|
|
158
|
+
background: var(--hard-disabled);
|
|
159
159
|
filter: brightness(125%);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
@@ -30,7 +30,9 @@ const ThemeSelector = ({
|
|
|
30
30
|
const current = themes.indexOf(userTheme);
|
|
31
31
|
setPreferredTheme(themes[(current + 1) % themes.length]);
|
|
32
32
|
}, [userTheme]);
|
|
33
|
-
const
|
|
33
|
+
const current = userTheme ? themes.indexOf(userTheme) : 0;
|
|
34
|
+
const nextTheme = themes[(current + 1) % themes.length];
|
|
35
|
+
const themeText = nextTheme && nextTheme.charAt(0).toUpperCase() + nextTheme.slice(1);
|
|
34
36
|
return (
|
|
35
37
|
/*#__PURE__*/
|
|
36
38
|
// eslint-disable-next-line jsx-a11y/anchor-is-valid, jsx-a11y/no-static-element-interactions
|
|
@@ -29,8 +29,9 @@ const ChoicesInput = ({
|
|
|
29
29
|
label,
|
|
30
30
|
optional,
|
|
31
31
|
disabled,
|
|
32
|
-
description
|
|
33
|
-
|
|
32
|
+
description,
|
|
33
|
+
spaceBetween,
|
|
34
|
+
...otherProps
|
|
34
35
|
}) => {
|
|
35
36
|
useInsertionEffect(() => {
|
|
36
37
|
import("./styles.scss");
|
|
@@ -48,7 +49,7 @@ const ChoicesInput = ({
|
|
|
48
49
|
as: "p",
|
|
49
50
|
optional: optional
|
|
50
51
|
}, label), /*#__PURE__*/React.createElement("div", {
|
|
51
|
-
className:
|
|
52
|
+
className: ['choices', spaceBetween && 'space-between'].filter(Boolean).join(' ')
|
|
52
53
|
}, options.map(choice => /*#__PURE__*/React.createElement(Choice, _extends({
|
|
53
54
|
labelClassName: "with-faded-border",
|
|
54
55
|
key: choice.value,
|
|
@@ -57,7 +58,7 @@ const ChoicesInput = ({
|
|
|
57
58
|
multiple: multiple,
|
|
58
59
|
validate: validate,
|
|
59
60
|
disabled: disabled
|
|
60
|
-
}, choice)))), /*#__PURE__*/React.createElement(FormDescription, {
|
|
61
|
+
}, otherProps, choice)))), /*#__PURE__*/React.createElement(FormDescription, {
|
|
61
62
|
className: "v50 mt-v s-1",
|
|
62
63
|
description: description,
|
|
63
64
|
name: name
|
|
@@ -8,7 +8,7 @@ $default-symbol-left: 1em;
|
|
|
8
8
|
$default-padding-with-symbol:
|
|
9
9
|
.75em
|
|
10
10
|
calc($default-symbol-left - 1em)
|
|
11
|
-
.
|
|
11
|
+
.75em
|
|
12
12
|
calc($default-symbol-left + 1em);
|
|
13
13
|
$default-input-border-radius: var(--theme-default-input-border-radius);
|
|
14
14
|
|
|
@@ -30,7 +30,8 @@ $default-input-border-radius: var(--theme-default-input-border-radius);
|
|
|
30
30
|
content: var(--symbol);
|
|
31
31
|
left: $default-symbol-left;
|
|
32
32
|
position: absolute;
|
|
33
|
-
top:
|
|
33
|
+
top: 50%;
|
|
34
|
+
transform: translate(-50%, -50%);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
input {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pareto-engineering/design-system",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.25",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/es/index.js",
|
|
@@ -52,7 +52,8 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@pareto-engineering/assets": "^4.0.0-alpha.23",
|
|
54
54
|
"@pareto-engineering/bem": "^4.0.0-alpha.20",
|
|
55
|
-
"@pareto-engineering/styles": "^4.0.0-alpha.
|
|
55
|
+
"@pareto-engineering/styles": "^4.0.0-alpha.24",
|
|
56
|
+
"@pareto-engineering/utils": "^4.0.0-alpha.23",
|
|
56
57
|
"date-fns": "^2.29.3",
|
|
57
58
|
"downshift": "^6.1.12",
|
|
58
59
|
"formik": "^2.2.9",
|
|
@@ -67,5 +68,5 @@
|
|
|
67
68
|
"relay-test-utils": "^15.0.0"
|
|
68
69
|
},
|
|
69
70
|
"browserslist": "> 2%",
|
|
70
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "5d40a485bd42cbbcd36042c43c806f07e234f7ea"
|
|
71
72
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.1.1-alpha.1 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { BlurOverlay } from 'ui'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title :'a/BlurOverlay',
|
|
8
|
+
component :BlurOverlay,
|
|
9
|
+
subcomponents:{
|
|
10
|
+
// Item:BlurOverlay.Item
|
|
11
|
+
},
|
|
12
|
+
decorators:[
|
|
13
|
+
// storyfn => <div className="">{ storyfn() }</div>,
|
|
14
|
+
],
|
|
15
|
+
argTypes:{},
|
|
16
|
+
controls:{
|
|
17
|
+
blur:{ type: 'boolean' },
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const Base = (args) => (
|
|
22
|
+
<BlurOverlay {...args}>
|
|
23
|
+
<div style={{
|
|
24
|
+
height :'100px',
|
|
25
|
+
bottom :'0',
|
|
26
|
+
minWidth :'100%',
|
|
27
|
+
position :'fixed',
|
|
28
|
+
backgroundColor:'blue',
|
|
29
|
+
color :'white',
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
Sample Foreground Component
|
|
33
|
+
</div>
|
|
34
|
+
</BlurOverlay>
|
|
35
|
+
|
|
36
|
+
)
|
|
37
|
+
Base.args = {
|
|
38
|
+
blur:true,
|
|
39
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.1.1-alpha.1 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { useInsertionEffect } from 'react'
|
|
5
|
+
|
|
6
|
+
import PropTypes from 'prop-types'
|
|
7
|
+
|
|
8
|
+
import styleNames from '@pareto-engineering/bem/exports'
|
|
9
|
+
|
|
10
|
+
const baseClassName = styleNames.base
|
|
11
|
+
|
|
12
|
+
const componentClassName = 'blur-overlay'
|
|
13
|
+
|
|
14
|
+
const BlurOverlay = ({
|
|
15
|
+
id,
|
|
16
|
+
className:userClassName,
|
|
17
|
+
style,
|
|
18
|
+
children,
|
|
19
|
+
blur,
|
|
20
|
+
}) => {
|
|
21
|
+
useInsertionEffect(() => {
|
|
22
|
+
import('./styles.scss')
|
|
23
|
+
}, [])
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<div
|
|
27
|
+
id={id}
|
|
28
|
+
className={[
|
|
29
|
+
baseClassName,
|
|
30
|
+
componentClassName,
|
|
31
|
+
userClassName,
|
|
32
|
+
blur && styleNames.modifierActive,
|
|
33
|
+
]
|
|
34
|
+
.filter((e) => e)
|
|
35
|
+
.join(' ')}
|
|
36
|
+
style={style}
|
|
37
|
+
>
|
|
38
|
+
{ children }
|
|
39
|
+
</div>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
BlurOverlay.propTypes = {
|
|
44
|
+
/**
|
|
45
|
+
* The HTML id for this element
|
|
46
|
+
*/
|
|
47
|
+
id:PropTypes.string,
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The HTML class names for this element
|
|
51
|
+
*/
|
|
52
|
+
className:PropTypes.string,
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The React-written, css properties for this element.
|
|
56
|
+
*/
|
|
57
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* The children JSX
|
|
61
|
+
*/
|
|
62
|
+
children:PropTypes.node,
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Boolean to toggle blur effect
|
|
66
|
+
*/
|
|
67
|
+
blur:PropTypes.bool,
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
BlurOverlay.defaultProps = {
|
|
71
|
+
blur:true,
|
|
72
|
+
// someProp:false
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default BlurOverlay
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.1.1-alpha.1 */
|
|
2
|
+
|
|
3
|
+
@use "@pareto-engineering/bem";
|
|
4
|
+
|
|
5
|
+
.#{bem.$base}.blur-overlay {
|
|
6
|
+
background: inherit;
|
|
7
|
+
left: 0;
|
|
8
|
+
position: fixed;
|
|
9
|
+
top: 0;
|
|
10
|
+
width: 100%;
|
|
11
|
+
z-index: 3;
|
|
12
|
+
&.#{bem.$modifier-active} {
|
|
13
|
+
animation: blurAnimation .3s ease-in-out;
|
|
14
|
+
backdrop-filter: blur(5px);
|
|
15
|
+
height: 100%;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@keyframes blurAnimation {
|
|
20
|
+
0% {
|
|
21
|
+
transform: translateX(-100%);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
1% {
|
|
25
|
+
transform: translateX(0);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
100% {
|
|
29
|
+
transform: translateX(0);
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/ui/a/index.js
CHANGED
|
@@ -48,7 +48,7 @@ const Button = ({
|
|
|
48
48
|
isSimple && styleNames.modifierSimple,
|
|
49
49
|
isGradient && styleNames.modifierGradient,
|
|
50
50
|
isSpaced && styleNames.modifierSpaced,
|
|
51
|
-
arrowDirection && `arrow-${arrowDirection}`,
|
|
51
|
+
!isLoading && arrowDirection && `arrow-${arrowDirection}`,
|
|
52
52
|
]
|
|
53
53
|
.filter((e) => e)
|
|
54
54
|
.join(' ')}
|
|
@@ -113,8 +113,8 @@ $default-animation-time: .31s;
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
&:disabled {
|
|
116
|
-
border: 1px solid var(--
|
|
117
|
-
color: var(--
|
|
116
|
+
border: 1px solid var(--hard-disabled, var(--#{$default-color}));
|
|
117
|
+
color: var(--hard-disabled, var(--#{$default-color}));
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
@@ -150,12 +150,12 @@ $default-animation-time: .31s;
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
&:disabled {
|
|
153
|
-
color: var(--
|
|
153
|
+
color: var(--hard-disabled, var(--#{$default-color}));
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
&:disabled {
|
|
158
|
-
background: var(--
|
|
158
|
+
background: var(--hard-disabled);
|
|
159
159
|
filter: brightness(125%);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
@@ -36,7 +36,9 @@ const ThemeSelector = ({
|
|
|
36
36
|
},
|
|
37
37
|
[userTheme])
|
|
38
38
|
|
|
39
|
-
const
|
|
39
|
+
const current = userTheme ? themes.indexOf(userTheme) : 0
|
|
40
|
+
const nextTheme = themes[(current + 1) % themes.length]
|
|
41
|
+
const themeText = nextTheme && nextTheme.charAt(0).toUpperCase() + nextTheme.slice(1)
|
|
40
42
|
|
|
41
43
|
return (
|
|
42
44
|
// eslint-disable-next-line jsx-a11y/anchor-is-valid, jsx-a11y/no-static-element-interactions
|
|
@@ -35,7 +35,8 @@ const ChoicesInput = ({
|
|
|
35
35
|
optional,
|
|
36
36
|
disabled,
|
|
37
37
|
description,
|
|
38
|
-
|
|
38
|
+
spaceBetween,
|
|
39
|
+
...otherProps
|
|
39
40
|
}) => {
|
|
40
41
|
useInsertionEffect(() => {
|
|
41
42
|
import('./styles.scss')
|
|
@@ -67,7 +68,7 @@ const ChoicesInput = ({
|
|
|
67
68
|
{label}
|
|
68
69
|
</FormLabel>
|
|
69
70
|
)}
|
|
70
|
-
<div className=
|
|
71
|
+
<div className={['choices', spaceBetween && 'space-between'].filter(Boolean).join(' ')}>
|
|
71
72
|
{ options.map((choice) => (
|
|
72
73
|
<Choice
|
|
73
74
|
labelClassName="with-faded-border"
|
|
@@ -77,6 +78,7 @@ const ChoicesInput = ({
|
|
|
77
78
|
multiple={multiple}
|
|
78
79
|
validate={validate}
|
|
79
80
|
disabled={disabled}
|
|
81
|
+
{...otherProps}
|
|
80
82
|
{...choice}
|
|
81
83
|
/>
|
|
82
84
|
))}
|
|
@@ -8,7 +8,7 @@ $default-symbol-left: 1em;
|
|
|
8
8
|
$default-padding-with-symbol:
|
|
9
9
|
.75em
|
|
10
10
|
calc($default-symbol-left - 1em)
|
|
11
|
-
.
|
|
11
|
+
.75em
|
|
12
12
|
calc($default-symbol-left + 1em);
|
|
13
13
|
$default-input-border-radius: var(--theme-default-input-border-radius);
|
|
14
14
|
|
|
@@ -30,7 +30,8 @@ $default-input-border-radius: var(--theme-default-input-border-radius);
|
|
|
30
30
|
content: var(--symbol);
|
|
31
31
|
left: $default-symbol-left;
|
|
32
32
|
position: absolute;
|
|
33
|
-
top:
|
|
33
|
+
top: 50%;
|
|
34
|
+
transform: translate(-50%, -50%);
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
input {
|
|
@@ -451,6 +451,27 @@ exports[`Storyshots Example/Page Logged Out 1`] = `
|
|
|
451
451
|
|
|
452
452
|
exports[`Storyshots a/AppContext Base 1`] = `"Sample AppContext"`;
|
|
453
453
|
|
|
454
|
+
exports[`Storyshots a/BlurOverlay Base 1`] = `
|
|
455
|
+
<div
|
|
456
|
+
className="base blur-overlay modifierActive"
|
|
457
|
+
>
|
|
458
|
+
<div
|
|
459
|
+
style={
|
|
460
|
+
{
|
|
461
|
+
"backgroundColor": "blue",
|
|
462
|
+
"bottom": "0",
|
|
463
|
+
"color": "white",
|
|
464
|
+
"height": "100px",
|
|
465
|
+
"minWidth": "100%",
|
|
466
|
+
"position": "fixed",
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
>
|
|
470
|
+
Sample Foreground Component
|
|
471
|
+
</div>
|
|
472
|
+
</div>
|
|
473
|
+
`;
|
|
474
|
+
|
|
454
475
|
exports[`Storyshots a/ContentTree Base 1`] = `
|
|
455
476
|
<div
|
|
456
477
|
style={
|
|
@@ -3151,7 +3172,7 @@ exports[`Storyshots a/Timestamp Distance Format 1`] = `
|
|
|
3151
3172
|
className="base timestamp"
|
|
3152
3173
|
onClick={[Function]}
|
|
3153
3174
|
>
|
|
3154
|
-
|
|
3175
|
+
8 months ago
|
|
3155
3176
|
</p>
|
|
3156
3177
|
`;
|
|
3157
3178
|
|
|
@@ -14117,7 +14138,9 @@ exports[`Storyshots b/ThemeSelector Base 1`] = `
|
|
|
14117
14138
|
className="base theme-selector"
|
|
14118
14139
|
onClick={[Function]}
|
|
14119
14140
|
onKeyDown={[Function]}
|
|
14120
|
-
|
|
14141
|
+
>
|
|
14142
|
+
Dark
|
|
14143
|
+
</a>
|
|
14121
14144
|
</div>
|
|
14122
14145
|
`;
|
|
14123
14146
|
|