@pareto-engineering/design-system 2.0.0-alpha.2 → 2.0.0-alpha.23
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/AnimatedCounter/AnimatedCounter.js +16 -29
- package/dist/cjs/a/AnimatedCounter/styles.scss +3 -11
- package/dist/cjs/a/BackgroundGradient/BackgroundGradient.js +77 -0
- package/dist/cjs/a/BackgroundGradient/index.js +15 -0
- package/dist/cjs/a/BackgroundGradient/styles.scss +16 -0
- package/dist/cjs/a/Conversation/Conversation.js +15 -8
- package/dist/cjs/a/Conversation/common/Message/Message.js +33 -6
- package/dist/cjs/a/Conversation/styles.scss +129 -32
- package/dist/cjs/a/OvalIllustration/OvalIllustration.js +133 -0
- package/dist/cjs/a/OvalIllustration/index.js +15 -0
- package/dist/cjs/a/OvalIllustration/styles.scss +102 -0
- package/dist/cjs/a/People/People.js +15 -7
- package/dist/cjs/a/People/common/Person/Person.js +11 -4
- package/dist/cjs/a/People/styles.scss +13 -15
- package/dist/cjs/a/Shapes/Shapes.js +171 -0
- package/dist/cjs/a/Shapes/index.js +15 -0
- package/dist/cjs/a/Shapes/styles.scss +255 -0
- package/dist/cjs/a/SnapScroller/SnapScroller.js +77 -0
- package/dist/cjs/a/SnapScroller/index.js +15 -0
- package/dist/cjs/a/SnapScroller/styles.scss +38 -0
- package/dist/cjs/a/TeamInfo/styles.scss +2 -2
- package/dist/cjs/a/index.js +33 -1
- package/dist/cjs/b/Button/Button.js +10 -4
- package/dist/cjs/b/Button/styles.scss +83 -19
- package/dist/cjs/b/Metrics/Metrics.js +89 -0
- package/dist/cjs/b/Metrics/index.js +15 -0
- package/dist/cjs/b/Metrics/styles.scss +91 -0
- package/dist/cjs/b/Page/common/Section/Section.js +56 -5
- package/dist/cjs/b/Page/styles.scss +8 -2
- package/dist/cjs/b/QuestionDropdown/styles.scss +1 -1
- package/dist/cjs/b/index.js +9 -1
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +4 -4
- package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +4 -3
- package/dist/cjs/c/ContentSlides/styles.scss +10 -4
- package/dist/cjs/f/common/Debugger/Debugger.js +1 -1
- package/dist/cjs/f/common/Label/Label.js +1 -1
- package/dist/cjs/f/common/Label/styles.scss +1 -1
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +2 -2
- package/dist/cjs/f/fields/ChoicesInput/styles.scss +17 -2
- package/dist/cjs/f/fields/RatingsInput/common/Rating/Rating.js +2 -2
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +37 -10
- package/dist/cjs/f/fields/SelectInput/styles.scss +13 -8
- package/dist/cjs/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
- package/dist/cjs/f/fields/TaskRecommendationInput/styles.scss +4 -0
- package/dist/cjs/f/fields/TextInput/TextInput.js +28 -7
- package/dist/cjs/f/fields/TextInput/styles.scss +16 -7
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +15 -8
- package/dist/cjs/f/fields/TextareaInput/styles.scss +19 -6
- package/dist/cjs/f/fields/index.js +0 -24
- package/dist/cjs/form-reset.scss +1 -1
- package/dist/cjs/form.scss +1 -1
- package/dist/es/a/AnimatedCounter/AnimatedCounter.js +17 -30
- package/dist/es/a/AnimatedCounter/styles.scss +3 -11
- package/dist/es/a/BackgroundGradient/BackgroundGradient.js +55 -0
- package/dist/es/a/BackgroundGradient/index.js +2 -0
- package/dist/es/a/BackgroundGradient/styles.scss +16 -0
- package/dist/es/a/Conversation/Conversation.js +15 -8
- package/dist/es/a/Conversation/common/Message/Message.js +33 -6
- package/dist/es/a/Conversation/styles.scss +129 -32
- package/dist/es/a/OvalIllustration/OvalIllustration.js +111 -0
- package/dist/es/a/OvalIllustration/index.js +2 -0
- package/dist/es/a/OvalIllustration/styles.scss +102 -0
- package/dist/es/a/People/People.js +14 -7
- package/dist/es/a/People/common/Person/Person.js +11 -4
- package/dist/es/a/People/styles.scss +13 -15
- package/dist/es/a/Shapes/Shapes.js +149 -0
- package/dist/es/a/Shapes/index.js +2 -0
- package/dist/es/a/Shapes/styles.scss +255 -0
- package/dist/es/a/SnapScroller/SnapScroller.js +61 -0
- package/dist/es/a/SnapScroller/index.js +2 -0
- package/dist/es/a/SnapScroller/styles.scss +38 -0
- package/dist/es/a/TeamInfo/styles.scss +2 -2
- package/dist/es/a/index.js +5 -1
- package/dist/es/b/Button/Button.js +8 -2
- package/dist/es/b/Button/styles.scss +83 -19
- package/dist/es/b/Metrics/Metrics.js +72 -0
- package/dist/es/b/Metrics/index.js +2 -0
- package/dist/es/b/Metrics/styles.scss +91 -0
- package/dist/es/b/Page/common/Section/Section.js +55 -4
- package/dist/es/b/Page/styles.scss +8 -2
- package/dist/es/b/QuestionDropdown/styles.scss +1 -1
- package/dist/es/b/index.js +2 -1
- package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +4 -4
- package/dist/es/c/ContentSlides/common/Navigator/Navigator.js +4 -3
- package/dist/es/c/ContentSlides/styles.scss +10 -4
- package/dist/es/f/common/Debugger/Debugger.js +1 -1
- package/dist/es/f/common/Label/Label.js +1 -1
- package/dist/es/f/common/Label/styles.scss +1 -1
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +2 -2
- package/dist/es/f/fields/ChoicesInput/styles.scss +17 -2
- package/dist/es/f/fields/RatingsInput/common/Rating/Rating.js +2 -2
- package/dist/es/f/fields/SelectInput/SelectInput.js +37 -10
- package/dist/es/f/fields/SelectInput/styles.scss +13 -8
- package/dist/es/f/fields/TaskRecommendationInput/TaskRecommendationInput.js +1 -1
- package/dist/es/f/fields/TaskRecommendationInput/styles.scss +4 -0
- package/dist/es/f/fields/TextInput/TextInput.js +28 -7
- package/dist/es/f/fields/TextInput/styles.scss +16 -7
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +15 -8
- package/dist/es/f/fields/TextareaInput/styles.scss +19 -6
- package/dist/es/f/fields/index.js +0 -3
- package/dist/es/form-reset.scss +1 -1
- package/dist/es/form.scss +1 -1
- package/package.json +3 -3
- package/src/__snapshots__/Storyshots.test.js.snap +6050 -812
- package/src/local.scss +4 -0
- package/src/stories/a/AnimatedCounter.stories.jsx +9 -5
- package/src/stories/a/BackgroundGradient.stories.jsx +38 -0
- package/src/stories/a/ContentCard.stories.jsx +1 -1
- package/src/stories/a/Conversation.stories.jsx +78 -1
- package/src/stories/a/OvalIllustration.stories.jsx +59 -0
- package/src/stories/a/People.stories.jsx +25 -1
- package/src/stories/a/ProgressBar.stories.jsx +1 -1
- package/src/stories/a/Quote.stories.jsx +1 -1
- package/src/stories/a/Shapes.stories.jsx +143 -0
- package/src/stories/a/SnapScroller.stories.jsx +98 -0
- package/src/stories/a/Spinner.stories.jsx +1 -1
- package/src/stories/b/Button.stories.jsx +83 -54
- package/src/stories/b/Metrics.stories.jsx +62 -0
- package/src/stories/b/Page.stories.jsx +51 -1
- package/src/stories/b/ThemeSelector.stories.jsx +1 -1
- package/src/stories/b/Title.stories.jsx +1 -1
- package/src/stories/c/ContentSlides.stories.jsx +154 -2
- package/src/stories/colors.js +5 -3
- package/src/stories/f/SelectInput.stories.jsx +36 -5
- package/src/stories/f/TextInput.stories.jsx +16 -5
- package/src/stories/f/TextareaInput.stories.jsx +42 -6
- package/src/ui/a/AnimatedCounter/AnimatedCounter.jsx +21 -27
- package/src/ui/a/AnimatedCounter/styles.scss +3 -11
- package/src/ui/a/BackgroundGradient/BackgroundGradient.jsx +76 -0
- package/src/ui/a/BackgroundGradient/index.js +2 -0
- package/src/ui/a/BackgroundGradient/styles.scss +16 -0
- package/src/ui/a/Conversation/Conversation.jsx +15 -7
- package/src/ui/a/Conversation/common/Message/Message.jsx +40 -7
- package/src/ui/a/Conversation/styles.scss +129 -32
- package/src/ui/a/OvalIllustration/OvalIllustration.jsx +134 -0
- package/src/ui/a/OvalIllustration/index.js +2 -0
- package/src/ui/a/OvalIllustration/styles.scss +102 -0
- package/src/ui/a/People/People.jsx +12 -4
- package/src/ui/a/People/common/Person/Person.jsx +7 -1
- package/src/ui/a/People/styles.scss +13 -15
- package/src/ui/a/Shapes/Shapes.jsx +191 -0
- package/src/ui/a/Shapes/index.js +2 -0
- package/src/ui/a/Shapes/styles.scss +255 -0
- package/src/ui/a/SnapScroller/SnapScroller.jsx +83 -0
- package/src/ui/a/SnapScroller/index.js +2 -0
- package/src/ui/a/SnapScroller/styles.scss +38 -0
- package/src/ui/a/TeamInfo/styles.scss +2 -2
- package/src/ui/a/index.js +4 -0
- package/src/ui/b/Button/Button.jsx +9 -1
- package/src/ui/b/Button/styles.scss +83 -19
- package/src/ui/b/Metrics/Metrics.jsx +93 -0
- package/src/ui/b/Metrics/index.js +2 -0
- package/src/ui/b/Metrics/styles.scss +91 -0
- package/src/ui/b/Page/common/Section/Section.jsx +68 -2
- package/src/ui/b/Page/styles.scss +8 -2
- package/src/ui/b/QuestionDropdown/styles.scss +1 -1
- package/src/ui/b/index.js +1 -0
- package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +4 -4
- package/src/ui/c/ContentSlides/common/Navigator/Navigator.jsx +3 -2
- package/src/ui/c/ContentSlides/styles.scss +10 -4
- package/src/ui/f/common/Debugger/Debugger.jsx +1 -1
- package/src/ui/f/common/Label/Label.jsx +1 -1
- package/src/ui/f/common/Label/styles.scss +1 -1
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +2 -2
- package/src/ui/f/fields/ChoicesInput/styles.scss +17 -2
- package/src/ui/f/fields/RatingsInput/common/Rating/Rating.jsx +2 -2
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +44 -5
- package/src/ui/f/fields/SelectInput/styles.scss +13 -8
- package/src/ui/f/fields/TextInput/TextInput.jsx +24 -3
- package/src/ui/f/fields/TextInput/styles.scss +16 -7
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +24 -13
- package/src/ui/f/fields/TextareaInput/styles.scss +19 -6
- package/src/ui/f/fields/index.js +0 -3
- package/src/ui/form-reset.scss +1 -1
- package/src/ui/form.scss +1 -1
- package/src/stories/f/CheckboxInput.stories.jsx +0 -37
- package/src/stories/f/RadioInput.stories.jsx +0 -37
- package/src/stories/f/TaskRecommendationInput.stories.jsx +0 -38
- package/src/ui/f/fields/CheckboxInput/CheckboxInput.jsx +0 -107
- package/src/ui/f/fields/CheckboxInput/index.js +0 -2
- package/src/ui/f/fields/CheckboxInput/styles.scss +0 -28
- package/src/ui/f/fields/RadioInput/RadioInput.jsx +0 -112
- package/src/ui/f/fields/RadioInput/index.js +0 -2
- package/src/ui/f/fields/RadioInput/styles.scss +0 -26
- package/src/ui/f/fields/TaskRecommendationInput/TaskRecommendationInput.jsx +0 -130
- package/src/ui/f/fields/TaskRecommendationInput/index.js +0 -2
- package/src/ui/f/fields/TaskRecommendationInput/styles.scss +0 -37
package/dist/cjs/b/index.js
CHANGED
|
@@ -57,6 +57,12 @@ Object.defineProperty(exports, "SocialMediaButton", {
|
|
|
57
57
|
return _SocialMediaButton.SocialMediaButton;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
+
Object.defineProperty(exports, "Metrics", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function get() {
|
|
63
|
+
return _Metrics.Metrics;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
60
66
|
|
|
61
67
|
var _Button = require("./Button");
|
|
62
68
|
|
|
@@ -74,4 +80,6 @@ var _ThemeSelector = require("./ThemeSelector");
|
|
|
74
80
|
|
|
75
81
|
var _Logo = require("./Logo");
|
|
76
82
|
|
|
77
|
-
var _SocialMediaButton = require("./SocialMediaButton");
|
|
83
|
+
var _SocialMediaButton = require("./SocialMediaButton");
|
|
84
|
+
|
|
85
|
+
var _Metrics = require("./Metrics");
|
|
@@ -69,18 +69,18 @@ var HorizontalMenu = _ref => {
|
|
|
69
69
|
attached: true,
|
|
70
70
|
height: ".4em",
|
|
71
71
|
color: "main2",
|
|
72
|
-
className: "y-
|
|
72
|
+
className: "y-background1 b-dark-y"
|
|
73
73
|
}), /*#__PURE__*/React.createElement("div", {
|
|
74
74
|
className: _bem.default.elementContent
|
|
75
75
|
}, /*#__PURE__*/React.createElement("div", {
|
|
76
76
|
className: "left"
|
|
77
77
|
}, !isFirstStep && !hideBackIcon && /*#__PURE__*/React.createElement("span", {
|
|
78
|
-
className: "
|
|
78
|
+
className: "prev-button pointer",
|
|
79
79
|
onClick: mobilePreviousStep,
|
|
80
80
|
role: "button",
|
|
81
81
|
onKeyDown: mobilePreviousStep,
|
|
82
82
|
tabIndex: 0
|
|
83
|
-
},
|
|
83
|
+
}, '<--')), /*#__PURE__*/React.createElement("div", {
|
|
84
84
|
className: "title"
|
|
85
85
|
}, /*#__PURE__*/React.createElement("span", {
|
|
86
86
|
className: "md-h lg-h"
|
|
@@ -128,7 +128,7 @@ HorizontalMenu.propTypes = {
|
|
|
128
128
|
hideBackIcon: _propTypes.default.bool
|
|
129
129
|
};
|
|
130
130
|
HorizontalMenu.defaultProps = {
|
|
131
|
-
logoColor: '
|
|
131
|
+
logoColor: 'paragraph',
|
|
132
132
|
stepsBackwards: 1
|
|
133
133
|
};
|
|
134
134
|
var _default = HorizontalMenu;
|
|
@@ -74,7 +74,8 @@ var Navigator = _ref => {
|
|
|
74
74
|
} else {
|
|
75
75
|
setNextStepIndex(stepsForward);
|
|
76
76
|
}
|
|
77
|
-
}
|
|
77
|
+
},
|
|
78
|
+
isCompact: true
|
|
78
79
|
}, "Next") : /*#__PURE__*/React.createElement("span", null));
|
|
79
80
|
};
|
|
80
81
|
|
|
@@ -136,8 +137,8 @@ Navigator.propTypes = {
|
|
|
136
137
|
};
|
|
137
138
|
Navigator.defaultProps = {
|
|
138
139
|
canMoveForward: true,
|
|
139
|
-
previousColor: '
|
|
140
|
-
nextColor: '
|
|
140
|
+
previousColor: 'main2',
|
|
141
|
+
nextColor: 'main2',
|
|
141
142
|
stepsForward: 1,
|
|
142
143
|
stepsBackwards: 1
|
|
143
144
|
};
|
|
@@ -14,7 +14,7 @@ $class-navigator:navigator;
|
|
|
14
14
|
$default-sidebar-width:minmax(250px, 330px);
|
|
15
15
|
$default-border:none;//2px solid var(--grid);
|
|
16
16
|
$default-border-radius:var(--theme-border-radius);
|
|
17
|
-
$default-content-background:var(--
|
|
17
|
+
$default-content-background: var(--background1);
|
|
18
18
|
$default-padding:var(--u);
|
|
19
19
|
|
|
20
20
|
$mobile-content-margin:6em;
|
|
@@ -61,7 +61,6 @@ $mobile-content-margin:6em;
|
|
|
61
61
|
|
|
62
62
|
//.#{$class-main-container} {
|
|
63
63
|
main {
|
|
64
|
-
background: var(--dark-y);
|
|
65
64
|
overflow: hidden;
|
|
66
65
|
position: relative;
|
|
67
66
|
|
|
@@ -79,7 +78,7 @@ $mobile-content-margin:6em;
|
|
|
79
78
|
.#{bem.$element-content} {
|
|
80
79
|
background: $default-content-background;
|
|
81
80
|
|
|
82
|
-
border:
|
|
81
|
+
border: var(--theme-border);
|
|
83
82
|
border-radius: $default-border-radius;
|
|
84
83
|
max-width: 600px;
|
|
85
84
|
padding: $default-padding;
|
|
@@ -108,8 +107,9 @@ $mobile-content-margin:6em;
|
|
|
108
107
|
|
|
109
108
|
.#{$class-horizontal-menu} {
|
|
110
109
|
background: $default-content-background;
|
|
111
|
-
border-bottom:
|
|
110
|
+
border-bottom: var(--theme-border);
|
|
112
111
|
color: var(--heading);
|
|
112
|
+
z-index: 1;
|
|
113
113
|
|
|
114
114
|
.#{bem.$element-content} {
|
|
115
115
|
display: grid;
|
|
@@ -124,6 +124,11 @@ $mobile-content-margin:6em;
|
|
|
124
124
|
|
|
125
125
|
.left {
|
|
126
126
|
text-align: left;
|
|
127
|
+
|
|
128
|
+
.prev-button {
|
|
129
|
+
font-family: var(--theme-default-paragraph);
|
|
130
|
+
font-size: calc(var(--s2) * 1em);
|
|
131
|
+
}
|
|
127
132
|
}
|
|
128
133
|
|
|
129
134
|
.right {
|
|
@@ -210,6 +215,7 @@ $mobile-content-margin:6em;
|
|
|
210
215
|
|
|
211
216
|
.next {
|
|
212
217
|
flex-grow: 1;
|
|
218
|
+
justify-content: flex-end;
|
|
213
219
|
}
|
|
214
220
|
}
|
|
215
221
|
}
|
|
@@ -47,7 +47,7 @@ var Debugger = _ref => {
|
|
|
47
47
|
style: style
|
|
48
48
|
}, /*#__PURE__*/React.createElement(_b.Button, {
|
|
49
49
|
onClick: toggleDebugger,
|
|
50
|
-
color: "
|
|
50
|
+
color: "main2"
|
|
51
51
|
}, isOpen ? 'Close FormDebugger' : 'Open FormDebugger'), isOpen && /*#__PURE__*/React.createElement("pre", {
|
|
52
52
|
className: "debuger-content"
|
|
53
53
|
}, JSON.stringify(formikContext, null, 2)));
|
|
@@ -149,8 +149,8 @@ ChoicesInput.propTypes = {
|
|
|
149
149
|
ChoicesInput.defaultProps = {
|
|
150
150
|
gridColumnsMobile: 2,
|
|
151
151
|
gridColumnsDesktop: 3,
|
|
152
|
-
color: '
|
|
153
|
-
colorChecked: '
|
|
152
|
+
color: 'background2',
|
|
153
|
+
colorChecked: 'main2',
|
|
154
154
|
disabled: false
|
|
155
155
|
};
|
|
156
156
|
|
|
@@ -29,10 +29,21 @@ $default-transition:all .3s;
|
|
|
29
29
|
z-index: -1;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
input:disabled + label {
|
|
33
|
+
background-color: var(--dark-x);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
input:not(:disabled) + label {
|
|
37
|
+
&:hover {
|
|
38
|
+
border-color: var(--light-y);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
32
42
|
label {
|
|
33
|
-
|
|
34
|
-
|
|
43
|
+
border: var(--theme-border-style) var(--dark-x);
|
|
44
|
+
background: var(--light-x);
|
|
35
45
|
color: var(--on-x);
|
|
46
|
+
border-radius: var(--theme-border-radius);
|
|
36
47
|
display: block;
|
|
37
48
|
height: 100%;
|
|
38
49
|
padding: $default-padding;
|
|
@@ -44,6 +55,10 @@ $default-transition:all .3s;
|
|
|
44
55
|
input:checked + label {
|
|
45
56
|
background: var(--y);
|
|
46
57
|
color: var(--on-y);
|
|
58
|
+
|
|
59
|
+
&:hover {
|
|
60
|
+
border-color: var(--y);
|
|
61
|
+
}
|
|
47
62
|
}
|
|
48
63
|
}
|
|
49
64
|
}
|
|
@@ -121,8 +121,8 @@ Rating.propTypes = {
|
|
|
121
121
|
showRatingValue: _propTypes.default.bool
|
|
122
122
|
};
|
|
123
123
|
Rating.defaultProps = {
|
|
124
|
-
activeBackgroundColor: '
|
|
125
|
-
inactiveBackgroundColor: '
|
|
124
|
+
activeBackgroundColor: 'main1',
|
|
125
|
+
inactiveBackgroundColor: 'background2',
|
|
126
126
|
showRatingValue: false
|
|
127
127
|
};
|
|
128
128
|
var _default = Rating;
|
|
@@ -37,25 +37,32 @@ var SelectInput = _ref => {
|
|
|
37
37
|
style,
|
|
38
38
|
name,
|
|
39
39
|
label,
|
|
40
|
+
color,
|
|
40
41
|
options,
|
|
42
|
+
validate,
|
|
43
|
+
description,
|
|
41
44
|
disabled // ...otherProps
|
|
42
45
|
|
|
43
46
|
} = _ref;
|
|
44
47
|
(0, React.useLayoutEffect)(() => {
|
|
45
48
|
Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
|
|
46
49
|
}, []);
|
|
47
|
-
var [field, meta] = (0, _formik.useField)(
|
|
50
|
+
var [field, meta] = (0, _formik.useField)({
|
|
51
|
+
name,
|
|
52
|
+
validate
|
|
53
|
+
});
|
|
48
54
|
return /*#__PURE__*/React.createElement("div", {
|
|
49
55
|
id: id,
|
|
50
|
-
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
56
|
+
className: [baseClassName, componentClassName, userClassName, "y-".concat(color)].filter(e => e).join(' '),
|
|
51
57
|
style: style // {...otherProps}
|
|
52
58
|
|
|
53
59
|
}, /*#__PURE__*/React.createElement(_common.FormLabel, {
|
|
54
60
|
className: "input-label",
|
|
55
61
|
name: name
|
|
56
62
|
}, label), /*#__PURE__*/React.createElement("select", _extends({
|
|
57
|
-
className: "input
|
|
63
|
+
className: "input"
|
|
58
64
|
}, field, {
|
|
65
|
+
value: field.value || '',
|
|
59
66
|
id: name,
|
|
60
67
|
disabled: disabled
|
|
61
68
|
}), options.map(option => {
|
|
@@ -66,11 +73,14 @@ var SelectInput = _ref => {
|
|
|
66
73
|
} : option;
|
|
67
74
|
return /*#__PURE__*/React.createElement("option", {
|
|
68
75
|
key: newOption.value,
|
|
69
|
-
value: newOption.value
|
|
76
|
+
value: newOption.value,
|
|
77
|
+
disabled: (newOption === null || newOption === void 0 ? void 0 : newOption.disabled) || false,
|
|
78
|
+
selected: (newOption === null || newOption === void 0 ? void 0 : newOption.disabled) || true
|
|
70
79
|
}, newOption.label);
|
|
71
|
-
})), meta.
|
|
72
|
-
|
|
73
|
-
|
|
80
|
+
})), (description || meta.touched && meta.error) && /*#__PURE__*/React.createElement(_common.FormDescription, {
|
|
81
|
+
isError: !!meta.error,
|
|
82
|
+
className: "v50 mt-v s-1"
|
|
83
|
+
}, meta.error || description));
|
|
74
84
|
};
|
|
75
85
|
|
|
76
86
|
SelectInput.propTypes = {
|
|
@@ -99,21 +109,38 @@ SelectInput.propTypes = {
|
|
|
99
109
|
*/
|
|
100
110
|
label: _propTypes.default.string,
|
|
101
111
|
|
|
112
|
+
/**
|
|
113
|
+
* The input field validator function
|
|
114
|
+
*/
|
|
115
|
+
validate: _propTypes.default.func,
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The select input description
|
|
119
|
+
*/
|
|
120
|
+
description: _propTypes.default.string,
|
|
121
|
+
|
|
102
122
|
/**
|
|
103
123
|
* The options of the select input
|
|
104
124
|
*/
|
|
105
125
|
options: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.shape({
|
|
106
126
|
value: _propTypes.default.string,
|
|
107
|
-
label: _propTypes.default.string
|
|
127
|
+
label: _propTypes.default.string,
|
|
128
|
+
disabled: _propTypes.default.bool
|
|
108
129
|
})])),
|
|
109
130
|
|
|
110
131
|
/**
|
|
111
132
|
* Whether the select input should be disabled
|
|
112
133
|
*/
|
|
113
|
-
disabled: _propTypes.default.bool
|
|
134
|
+
disabled: _propTypes.default.bool,
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* The color of the select input
|
|
138
|
+
*/
|
|
139
|
+
color: _propTypes.default.string
|
|
114
140
|
};
|
|
115
141
|
SelectInput.defaultProps = {
|
|
116
|
-
disabled: false
|
|
142
|
+
disabled: false,
|
|
143
|
+
color: 'background2'
|
|
117
144
|
};
|
|
118
145
|
|
|
119
146
|
var _default = /*#__PURE__*/(0, React.memo)(SelectInput);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
@use "../../../form.scss";
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
$default-padding: 0.75em
|
|
8
|
+
$default-padding: 0.75em;
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
.#{bem.$base}.select-input {
|
|
@@ -13,17 +13,22 @@ $default-padding: 0.75em 0.75em 0.55em;
|
|
|
13
13
|
flex-direction: column;
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
.input-label {
|
|
17
|
-
color: var(--main1);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
16
|
.input {
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
border: var(--theme-border-style) var(--dark-y);
|
|
18
|
+
background: var(--light-y);
|
|
19
|
+
color:var(--on-y);
|
|
23
20
|
padding: $default-padding;
|
|
24
21
|
|
|
22
|
+
&:not(:disabled):hover{
|
|
23
|
+
border: var(--theme-border-style) var(--light-background4);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:disabled {
|
|
27
|
+
background-color: var(--dark-y);
|
|
28
|
+
}
|
|
29
|
+
|
|
25
30
|
&:focus {
|
|
26
|
-
background: var(--
|
|
31
|
+
background: var(--y);
|
|
27
32
|
}
|
|
28
33
|
}
|
|
29
34
|
}
|
|
@@ -60,7 +60,7 @@ var TaskRecommendationInput = _ref => {
|
|
|
60
60
|
}, /*#__PURE__*/React.createElement("div", {
|
|
61
61
|
className: "v1 p-v task"
|
|
62
62
|
}, /*#__PURE__*/React.createElement(_common.FormLabel, {
|
|
63
|
-
className: "uc mb-v ".concat(isOptionSelected ?
|
|
63
|
+
className: "uc mb-v ".concat(isOptionSelected ? _bem.default.modifierActive : ''),
|
|
64
64
|
name: name
|
|
65
65
|
}, label), /*#__PURE__*/React.createElement("input", _extends({}, field, {
|
|
66
66
|
value: value,
|
|
@@ -38,10 +38,13 @@ var TextInput = _ref => {
|
|
|
38
38
|
type,
|
|
39
39
|
name,
|
|
40
40
|
label,
|
|
41
|
+
color,
|
|
42
|
+
labelColor,
|
|
41
43
|
validate,
|
|
42
44
|
oneInputLabel,
|
|
43
45
|
description,
|
|
44
|
-
disabled
|
|
46
|
+
disabled,
|
|
47
|
+
placeholder // ...otherProps
|
|
45
48
|
|
|
46
49
|
} = _ref;
|
|
47
50
|
(0, React.useLayoutEffect)(() => {
|
|
@@ -53,17 +56,19 @@ var TextInput = _ref => {
|
|
|
53
56
|
});
|
|
54
57
|
return /*#__PURE__*/React.createElement("div", {
|
|
55
58
|
id: id,
|
|
56
|
-
className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
|
|
59
|
+
className: [baseClassName, componentClassName, userClassName, "y-".concat(color)].filter(e => e).join(' '),
|
|
57
60
|
style: style // {...otherProps}
|
|
58
61
|
|
|
59
62
|
}, /*#__PURE__*/React.createElement(_common.FormLabel, {
|
|
60
|
-
className: [
|
|
61
|
-
name: name
|
|
63
|
+
className: [oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
|
|
64
|
+
name: name,
|
|
65
|
+
color: labelColor
|
|
62
66
|
}, label), /*#__PURE__*/React.createElement("input", _extends({
|
|
63
67
|
id: name,
|
|
64
|
-
className: "input
|
|
68
|
+
className: "input",
|
|
65
69
|
type: type,
|
|
66
|
-
disabled: disabled
|
|
70
|
+
disabled: disabled,
|
|
71
|
+
placeholder: placeholder
|
|
67
72
|
}, field)), (description || meta.touched && meta.error) && /*#__PURE__*/React.createElement(_common.FormDescription, {
|
|
68
73
|
isError: !!meta.error,
|
|
69
74
|
className: "v50 mt-v s-1"
|
|
@@ -96,6 +101,11 @@ TextInput.propTypes = {
|
|
|
96
101
|
*/
|
|
97
102
|
label: _propTypes.default.string.isRequired,
|
|
98
103
|
|
|
104
|
+
/**
|
|
105
|
+
* The input label color
|
|
106
|
+
*/
|
|
107
|
+
labelColor: _propTypes.default.string,
|
|
108
|
+
|
|
99
109
|
/**
|
|
100
110
|
* The type of the input (html)
|
|
101
111
|
*/
|
|
@@ -119,10 +129,21 @@ TextInput.propTypes = {
|
|
|
119
129
|
/**
|
|
120
130
|
* Whether the text input should be disabled
|
|
121
131
|
*/
|
|
122
|
-
disabled: _propTypes.default.bool
|
|
132
|
+
disabled: _propTypes.default.bool,
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* The placeholder text for the input
|
|
136
|
+
*/
|
|
137
|
+
placeholder: _propTypes.default.string,
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The text input color
|
|
141
|
+
*/
|
|
142
|
+
color: _propTypes.default.string
|
|
123
143
|
};
|
|
124
144
|
TextInput.defaultProps = {
|
|
125
145
|
type: 'text',
|
|
146
|
+
color: 'background2',
|
|
126
147
|
disabled: false
|
|
127
148
|
};
|
|
128
149
|
|
|
@@ -9,17 +9,26 @@ $default-padding: 0.75em 0.75em 0.55em;
|
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
|
|
12
|
-
.input-label {
|
|
13
|
-
color: var(--main1);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
12
|
.input {
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
border: var(--theme-border-style) var(--dark-y);
|
|
14
|
+
background: var(--light-y);
|
|
15
|
+
color: var(--on-y);
|
|
19
16
|
padding: $default-padding;
|
|
20
17
|
|
|
18
|
+
&::placeholder{
|
|
19
|
+
color: var(--metadata);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&:not(:disabled):hover{
|
|
23
|
+
border: var(--theme-border-style) var(--light-background4);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&:disabled {
|
|
27
|
+
background-color: var(--dark-y);
|
|
28
|
+
}
|
|
29
|
+
|
|
21
30
|
&:focus {
|
|
22
|
-
background: var(--
|
|
31
|
+
background: var(--light-background4);
|
|
23
32
|
}
|
|
24
33
|
}
|
|
25
34
|
}
|
|
@@ -43,7 +43,8 @@ var TextareaInput = _ref => {
|
|
|
43
43
|
textAreaColor,
|
|
44
44
|
labelColor,
|
|
45
45
|
description,
|
|
46
|
-
disabled
|
|
46
|
+
disabled,
|
|
47
|
+
placeholder // ...otherProps
|
|
47
48
|
|
|
48
49
|
} = _ref;
|
|
49
50
|
(0, React.useLayoutEffect)(() => {
|
|
@@ -55,16 +56,18 @@ var TextareaInput = _ref => {
|
|
|
55
56
|
});
|
|
56
57
|
return /*#__PURE__*/React.createElement("div", {
|
|
57
58
|
id: id,
|
|
58
|
-
className: [baseClassName, componentClassName, userClassName, "
|
|
59
|
+
className: [baseClassName, componentClassName, userClassName, "y-".concat(textAreaColor)].filter(e => e).join(' '),
|
|
59
60
|
style: style // {...otherProps}
|
|
60
61
|
|
|
61
62
|
}, /*#__PURE__*/React.createElement(_common.FormLabel, {
|
|
62
|
-
className: [
|
|
63
|
-
name: name
|
|
63
|
+
className: [labelAsDescription ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
|
|
64
|
+
name: name,
|
|
65
|
+
color: labelColor
|
|
64
66
|
}, label), /*#__PURE__*/React.createElement("textarea", _extends({
|
|
65
67
|
id: textAreaId,
|
|
66
|
-
className: "textarea
|
|
68
|
+
className: "textarea"
|
|
67
69
|
}, field, {
|
|
70
|
+
placeholder: placeholder,
|
|
68
71
|
rows: rows,
|
|
69
72
|
disabled: disabled
|
|
70
73
|
})), (description || meta.touched && meta.error) && /*#__PURE__*/React.createElement(_common.FormDescription, {
|
|
@@ -137,12 +140,16 @@ TextareaInput.propTypes = {
|
|
|
137
140
|
/**
|
|
138
141
|
* Whether the text area should be disabled
|
|
139
142
|
*/
|
|
140
|
-
disabled: _propTypes.default.bool
|
|
143
|
+
disabled: _propTypes.default.bool,
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* The textarea placeholder text
|
|
147
|
+
*/
|
|
148
|
+
placeholder: _propTypes.default.string
|
|
141
149
|
};
|
|
142
150
|
TextareaInput.defaultProps = {
|
|
143
151
|
rows: 3,
|
|
144
|
-
textAreaColor: '
|
|
145
|
-
labelColor: 'main1',
|
|
152
|
+
textAreaColor: 'background2',
|
|
146
153
|
disabled: false
|
|
147
154
|
};
|
|
148
155
|
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
2
|
@use "@pareto-engineering/bem";
|
|
3
3
|
|
|
4
|
+
$default-padding: .5em;
|
|
5
|
+
|
|
4
6
|
.#{bem.$base}.text-area-input{
|
|
5
7
|
display: flex;
|
|
6
8
|
flex-direction: column;
|
|
7
9
|
|
|
8
10
|
.textarea {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
border: var(--theme-border-style) var(--dark-y);
|
|
12
|
+
background: var(--light-y);
|
|
13
|
+
color: var(--on-y);
|
|
14
|
+
padding: $default-padding;
|
|
11
15
|
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
&::placeholder{
|
|
17
|
+
color: var(--metadata);
|
|
14
18
|
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
19
|
|
|
20
|
+
&:not(:disabled):hover{
|
|
21
|
+
border: var(--theme-border-style) var(--light-background4);
|
|
22
|
+
}
|
|
18
23
|
|
|
24
|
+
&:disabled {
|
|
25
|
+
background-color: var(--dark-y);
|
|
26
|
+
}
|
|
19
27
|
|
|
28
|
+
&:focus {
|
|
29
|
+
background: var(--light-background4);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -15,24 +15,6 @@ Object.defineProperty(exports, "SelectInput", {
|
|
|
15
15
|
return _SelectInput.SelectInput;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "RadioInput", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _RadioInput.RadioInput;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "CheckboxInput", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _CheckboxInput.CheckboxInput;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "TaskRecommendationInput", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function get() {
|
|
33
|
-
return _TaskRecommendationInput.TaskRecommendationInput;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
18
|
Object.defineProperty(exports, "ChoicesInput", {
|
|
37
19
|
enumerable: true,
|
|
38
20
|
get: function get() {
|
|
@@ -56,12 +38,6 @@ var _TextInput = require("./TextInput");
|
|
|
56
38
|
|
|
57
39
|
var _SelectInput = require("./SelectInput");
|
|
58
40
|
|
|
59
|
-
var _RadioInput = require("./RadioInput");
|
|
60
|
-
|
|
61
|
-
var _CheckboxInput = require("./CheckboxInput");
|
|
62
|
-
|
|
63
|
-
var _TaskRecommendationInput = require("./TaskRecommendationInput");
|
|
64
|
-
|
|
65
41
|
var _ChoicesInput = require("./ChoicesInput");
|
|
66
42
|
|
|
67
43
|
var _TextareaInput = require("./TextareaInput");
|
package/dist/cjs/form-reset.scss
CHANGED
package/dist/cjs/form.scss
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@use "form-reset.scss";
|
|
2
2
|
|
|
3
|
-
$form-input-border-bottom: 1px solid var(--dark-
|
|
3
|
+
$form-input-border-bottom: 1px solid var(--dark-background1);
|
|
4
4
|
$form-input-on-focus-border-bottom: 1px solid var(--light-main1);
|
|
5
5
|
$form-input-on-error-border-bottom: 1px solid var(--error);
|
|
6
6
|
$label-input-heigth-width: 100%;
|