@steroidsjs/bootstrap 3.0.0-beta.15 → 3.0.0-beta.17
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/content/Accordion/AccordionItemView.js +2 -2
- package/content/Accordion/AccordionItemView.scss +3 -8
- package/content/Alert/AlertView.scss +1 -1
- package/content/Badge/BadgeView.scss +18 -12
- package/content/DropDown/DropDownView.js +6 -3
- package/content/DropDown/DropDownView.scss +150 -13
- package/form/Button/ButtonView.js +4 -3
- package/form/Button/ButtonView.scss +21 -9
- package/form/CheckboxField/CheckboxFieldView.scss +1 -0
- package/index.d.ts +6 -0
- package/index.js +6 -0
- package/index.scss +2 -0
- package/package.json +3 -3
- package/scss/mixins/index.scss +1 -0
- package/scss/mixins/typography.scss +26 -0
- package/scss/variables/common/media.scss +2 -0
- package/scss/variables/common/typography.scss +84 -0
- package/scss/variables/index.scss +1 -1
- package/typography/Text/TextView.d.ts +3 -0
- package/typography/Text/TextView.js +46 -0
- package/typography/Text/TextView.scss +15 -0
- package/typography/Title/TitleView.d.ts +3 -0
- package/typography/Title/TitleView.js +50 -0
- package/typography/Title/TitleView.scss +15 -0
|
@@ -86,11 +86,11 @@ function AccordionItemView(props) {
|
|
|
86
86
|
React.createElement("div", { className: bem.element('header-container'), onClick: handleHeaderClick },
|
|
87
87
|
React.createElement("div", { className: bem.element('title-container') },
|
|
88
88
|
React.createElement("p", null, props.title)),
|
|
89
|
-
React.createElement("div", { className: bem.element('icon-wrapper') }, props.
|
|
89
|
+
props.showIcon && (React.createElement("div", { className: bem.element('icon-wrapper') }, props.icon
|
|
90
90
|
? renderIcon()
|
|
91
91
|
: (React.createElement(Icon_1["default"], { className: bem.element('icon', {
|
|
92
92
|
active: !props.disabled && props.isShowMore
|
|
93
|
-
}), name: "accordion-chevron" })))),
|
|
93
|
+
}), name: "accordion-chevron" }))))),
|
|
94
94
|
React.createElement("div", { className: bem.element('content', { visible: !props.disabled && props.isShowMore }) }, props.children)));
|
|
95
95
|
}
|
|
96
96
|
exports["default"] = AccordionItemView;
|
|
@@ -140,7 +140,7 @@ $accordion-chevron-color: var(--accordion-chevron-color);
|
|
|
140
140
|
|
|
141
141
|
&__title-container {
|
|
142
142
|
width: 100%;
|
|
143
|
-
padding:
|
|
143
|
+
padding: 16px;
|
|
144
144
|
align-self: center;
|
|
145
145
|
font-size: $font-size-lg;
|
|
146
146
|
line-height: 24px;
|
|
@@ -164,21 +164,16 @@ $accordion-chevron-color: var(--accordion-chevron-color);
|
|
|
164
164
|
transition: all 200ms ease;
|
|
165
165
|
overflow: hidden;
|
|
166
166
|
max-height: 0;
|
|
167
|
-
padding: 0
|
|
167
|
+
padding: 0 16px;
|
|
168
168
|
color: #343a40;
|
|
169
169
|
|
|
170
170
|
&_visible {
|
|
171
171
|
max-height: 1024px;
|
|
172
|
-
padding: 18px 32px 18px
|
|
172
|
+
padding: 18px 32px 18px 16px;
|
|
173
173
|
border: 1px solid rgba(#000, 0.1);
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
&__close-icon,
|
|
178
|
-
&__open-icon {
|
|
179
|
-
transition: opacity 150ms ease-in-out;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
177
|
&__close-icon {
|
|
183
178
|
position: absolute;
|
|
184
179
|
opacity: 0;
|
|
@@ -57,15 +57,15 @@
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
&_large {
|
|
60
|
-
padding:
|
|
60
|
+
padding: 4px 8px;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
&_medium {
|
|
64
|
-
padding:
|
|
64
|
+
padding: 2px 8px;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
&_small {
|
|
68
|
-
padding: 0
|
|
68
|
+
padding: 0 8px;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
&_has-counter {
|
|
@@ -74,13 +74,7 @@
|
|
|
74
74
|
|
|
75
75
|
background: $light-gray;
|
|
76
76
|
color: $text-color;
|
|
77
|
-
padding:
|
|
78
|
-
|
|
79
|
-
#{$root}__counter-content {
|
|
80
|
-
background: $white;
|
|
81
|
-
padding: $spacing-2 5px;
|
|
82
|
-
border-radius: 20px;
|
|
83
|
-
}
|
|
77
|
+
padding: 4px 12px;
|
|
84
78
|
|
|
85
79
|
#{$root}__message {
|
|
86
80
|
margin-right: 8px;
|
|
@@ -88,11 +82,23 @@
|
|
|
88
82
|
|
|
89
83
|
#{$root}__counter {
|
|
90
84
|
margin-right: 8px;
|
|
85
|
+
width: 18px;
|
|
86
|
+
background-color: $white;
|
|
87
|
+
display: flex;
|
|
88
|
+
justify-content: center;
|
|
89
|
+
align-items: center;
|
|
90
|
+
border-radius: $radius-circle;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
#{$root}__counter-content {
|
|
94
|
+
font-weight: $font-weight-sm;
|
|
95
|
+
font-size: $font-size-xs;
|
|
96
|
+
line-height: 16px;
|
|
91
97
|
}
|
|
92
98
|
|
|
93
|
-
#{$root}__close {
|
|
99
|
+
#{$root}__close {
|
|
94
100
|
svg {
|
|
95
|
-
path {
|
|
101
|
+
path {
|
|
96
102
|
stroke: #000;
|
|
97
103
|
}
|
|
98
104
|
}
|
|
@@ -42,9 +42,12 @@ function DropDownView(props) {
|
|
|
42
42
|
var contentProps = (0, react_1.useMemo)(function () { return ({
|
|
43
43
|
onClose: props.onClose
|
|
44
44
|
}); }, [props.onClose]);
|
|
45
|
-
var content
|
|
46
|
-
if (
|
|
47
|
-
content =
|
|
45
|
+
var content;
|
|
46
|
+
if (props.content) {
|
|
47
|
+
content = props.content();
|
|
48
|
+
if ((0, isFunction_1["default"])(content)) {
|
|
49
|
+
content = ui.renderView(content, contentProps);
|
|
50
|
+
}
|
|
48
51
|
}
|
|
49
52
|
return (React.createElement("div", { ref: props.forwardedRef, className: bem(bem.block((_a = {
|
|
50
53
|
show: props.isComponentVisible
|
|
@@ -1,18 +1,117 @@
|
|
|
1
1
|
@import "../../scss/variables/";
|
|
2
2
|
|
|
3
3
|
:root {
|
|
4
|
-
--
|
|
4
|
+
--dropdown-background: #fff;
|
|
5
|
+
--dropdown-triangle-border: #eef1f2;
|
|
6
|
+
--dropdown-triangle-svg: url("data:image/svg+xml,%3Csvg width='21' height='11' viewBox='0 0 21 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19.0416 0.5L10.1719 10.2567L1.30215 0.499998L19.0416 0.5Z' fill='white' stroke='%23EEF1F2'/%3E%3C/svg%3E%0A");
|
|
5
7
|
|
|
6
8
|
html[data-theme="dark"] {
|
|
7
|
-
--
|
|
9
|
+
--dropdown-background: #4e4f57;
|
|
10
|
+
--dropdown-triangle-border: transparent;
|
|
11
|
+
--dropdown-triangle-svg: url("data:image/svg+xml,%3Csvg width='21' height='11' viewBox='0 0 21 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.1719 11L0.171876 -1.74846e-06L20.1719 0L10.1719 11Z' fill='%234E4F57'/%3E%3C/svg%3E%0A");
|
|
8
12
|
}
|
|
9
13
|
}
|
|
10
14
|
|
|
11
|
-
$
|
|
15
|
+
$dropdown-background: var(--dropdown-background);
|
|
16
|
+
$dropdown-triangle-border: var(--triangle-border);
|
|
17
|
+
$dropdown-triangle-svg: var(--dropdown-triangle-svg);
|
|
12
18
|
|
|
13
19
|
$gap: 12px;
|
|
14
20
|
|
|
21
|
+
%triangle {
|
|
22
|
+
content: "";
|
|
23
|
+
position: absolute;
|
|
24
|
+
width: 20px;
|
|
25
|
+
height: 11px;
|
|
26
|
+
z-index: 2;
|
|
27
|
+
background-image: $dropdown-triangle-svg;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
%borderShaper {
|
|
31
|
+
content: "";
|
|
32
|
+
position: absolute;
|
|
33
|
+
z-index: 3;
|
|
34
|
+
|
|
35
|
+
width: 16px;
|
|
36
|
+
height: 1px;
|
|
37
|
+
background-color: $dropdown-background;
|
|
38
|
+
border-left: 2px solid $dropdown-triangle-border;
|
|
39
|
+
border-right: 2px solid $dropdown-triangle-border;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@mixin drop($edge, $padding) {
|
|
43
|
+
@if ($edge == "top") {
|
|
44
|
+
&::before {
|
|
45
|
+
@extend %triangle;
|
|
46
|
+
|
|
47
|
+
top: 100%;
|
|
48
|
+
left: $padding;
|
|
49
|
+
transform: translateX(-50%);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&::after {
|
|
53
|
+
@extend %borderShaper;
|
|
54
|
+
|
|
55
|
+
top: 100%;
|
|
56
|
+
left: $padding;
|
|
57
|
+
transform: translateX(-50%);
|
|
58
|
+
}
|
|
59
|
+
} @else if ($edge == "bottom") {
|
|
60
|
+
&::before {
|
|
61
|
+
@extend %triangle;
|
|
62
|
+
|
|
63
|
+
top: 0;
|
|
64
|
+
left: $padding;
|
|
65
|
+
top: -11px;
|
|
66
|
+
transform: translateX(-50%) rotate(180deg);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&::after {
|
|
70
|
+
@extend %borderShaper;
|
|
71
|
+
|
|
72
|
+
transform: translateX(-50%);
|
|
73
|
+
top: -1px;
|
|
74
|
+
left: $padding;
|
|
75
|
+
}
|
|
76
|
+
} @else if($edge == "left") {
|
|
77
|
+
&::before {
|
|
78
|
+
@extend %triangle;
|
|
79
|
+
|
|
80
|
+
left: 100%;
|
|
81
|
+
top: $padding;
|
|
82
|
+
transform: translateX(-22.5%) rotate(-90deg);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&::after {
|
|
86
|
+
@extend %borderShaper;
|
|
87
|
+
|
|
88
|
+
left: 100%;
|
|
89
|
+
top: $padding;
|
|
90
|
+
transform: rotate(-90deg) translate(-30%, -7.5px) ;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
@else if($edge == "right") {
|
|
94
|
+
&::before {
|
|
95
|
+
@extend %triangle;
|
|
96
|
+
|
|
97
|
+
right: 100%;
|
|
98
|
+
top: $padding;
|
|
99
|
+
transform: translateX(22.5%) rotate(90deg);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&::after {
|
|
103
|
+
@extend %borderShaper;
|
|
104
|
+
|
|
105
|
+
right: 100%;
|
|
106
|
+
top: $padding;
|
|
107
|
+
transform: rotate(-90deg) translate(-30%, 7.5px) ;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
15
112
|
.DropDownView {
|
|
113
|
+
$root: &;
|
|
114
|
+
|
|
16
115
|
z-index: 1000;
|
|
17
116
|
position: absolute;
|
|
18
117
|
|
|
@@ -20,10 +119,11 @@ $gap: 12px;
|
|
|
20
119
|
opacity: 0;
|
|
21
120
|
transition: opacity 0.15s ease-in, transform 0.15s ease-in;
|
|
22
121
|
|
|
122
|
+
z-index: 4;
|
|
23
123
|
width: 200px;
|
|
24
124
|
padding: 12px;
|
|
25
125
|
border-radius: $radius-large;
|
|
26
|
-
background-color: $
|
|
126
|
+
background-color: $dropdown-background;
|
|
27
127
|
border: 1px solid $gray;
|
|
28
128
|
|
|
29
129
|
&_show {
|
|
@@ -50,14 +150,51 @@ $gap: 12px;
|
|
|
50
150
|
transform: translateX($gap);
|
|
51
151
|
}
|
|
52
152
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
153
|
+
&_position-top {
|
|
154
|
+
@include drop("top", 50%);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&_position-topLeft {
|
|
158
|
+
@include drop("top", 15%);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&_position-topRight {
|
|
162
|
+
@include drop("top", 85%);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
&_position-bottom {
|
|
166
|
+
@include drop("bottom", 50%);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&_position-bottomLeft {
|
|
170
|
+
@include drop("bottom", 15%);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
&_position-bottomRight {
|
|
174
|
+
@include drop("bottom", 85%);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&_position-left {
|
|
178
|
+
@include drop("left", 46.5%);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&_position-leftTop {
|
|
182
|
+
@include drop("left", 12.5%)
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&_position-leftBottom {
|
|
186
|
+
@include drop("left", 80%)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&_position-right {
|
|
190
|
+
@include drop("right", 46.5%);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&_position-rightTop {
|
|
194
|
+
@include drop("right", 12.5%);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
&_position-rightBottom {
|
|
198
|
+
@include drop("right", 80%);
|
|
62
199
|
}
|
|
63
200
|
}
|
|
@@ -57,10 +57,11 @@ function ButtonView(props) {
|
|
|
57
57
|
_a.size = props.size,
|
|
58
58
|
_a.disabled = props.disabled,
|
|
59
59
|
_a.submitting = props.submitting,
|
|
60
|
-
_a.loading =
|
|
60
|
+
_a.loading = props.isLoading,
|
|
61
61
|
_a.failed = props.isFailed,
|
|
62
|
-
_a.link = props.
|
|
63
|
-
_a
|
|
62
|
+
_a.link = props.link,
|
|
63
|
+
_a.block = props.block,
|
|
64
|
+
_a)), props.className);
|
|
64
65
|
if (props.tag === 'a') {
|
|
65
66
|
return (React.createElement("a", { className: className, href: props.url, onClick: props.onClick, style: props.style, target: props.target },
|
|
66
67
|
renderLabel(),
|
|
@@ -42,6 +42,23 @@ $btn-letter-spacing: 0.1em;
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
&_block {
|
|
46
|
+
display: block;
|
|
47
|
+
width: 100%;
|
|
48
|
+
|
|
49
|
+
#{$root}__label {
|
|
50
|
+
justify-content: center;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&_link {
|
|
55
|
+
display: inline;
|
|
56
|
+
width: auto;
|
|
57
|
+
#{$root}__label {
|
|
58
|
+
display: inline;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
45
62
|
&_disabled {
|
|
46
63
|
opacity: 0.5;
|
|
47
64
|
color: rgba(0, 0, 0, 0.25);
|
|
@@ -69,9 +86,10 @@ $btn-letter-spacing: 0.1em;
|
|
|
69
86
|
}
|
|
70
87
|
}
|
|
71
88
|
|
|
72
|
-
&
|
|
73
|
-
|
|
74
|
-
|
|
89
|
+
&__label {
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: row;
|
|
92
|
+
column-gap: 10px;
|
|
75
93
|
}
|
|
76
94
|
|
|
77
95
|
&__icon {
|
|
@@ -107,12 +125,6 @@ $btn-letter-spacing: 0.1em;
|
|
|
107
125
|
animation: rotate 1.45s linear infinite;
|
|
108
126
|
}
|
|
109
127
|
}
|
|
110
|
-
|
|
111
|
-
&__label {
|
|
112
|
-
display: flex;
|
|
113
|
-
flex-direction: row;
|
|
114
|
-
column-gap: 10px;
|
|
115
|
-
}
|
|
116
128
|
}
|
|
117
129
|
|
|
118
130
|
@keyframes rotate {
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -220,5 +220,11 @@ exports["default"] = {
|
|
|
220
220
|
},
|
|
221
221
|
'nav.TreeView': {
|
|
222
222
|
lazy: function () { return require('./nav/Tree/TreeView')["default"]; }
|
|
223
|
+
},
|
|
224
|
+
'typography.TextView': {
|
|
225
|
+
lazy: function () { return require('./typography/Text/TextView')["default"]; }
|
|
226
|
+
},
|
|
227
|
+
'typography.TitleView': {
|
|
228
|
+
lazy: function () { return require('./typography/Title/TitleView')["default"]; }
|
|
223
229
|
}
|
|
224
230
|
};
|
package/index.scss
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steroidsjs/bootstrap",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.17",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Vladimir Kozhin <hello@kozhindev.com>",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react-use": "^17.4.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@steroidsjs/core": "^3.0 || >=3.0.0-beta.
|
|
38
|
+
"@steroidsjs/core": "^3.0 || >=3.0.0-beta.9",
|
|
39
39
|
"@steroidsjs/eslint-config": "^2.1.3",
|
|
40
40
|
"@types/enzyme": "^3.10.8",
|
|
41
41
|
"@types/googlemaps": "^3.43.3",
|
|
@@ -53,6 +53,6 @@
|
|
|
53
53
|
"typescript": "^4.9.5"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@steroidsjs/core": "^3.0 || >=3.0.0-beta.
|
|
56
|
+
"@steroidsjs/core": "^3.0 || >=3.0.0-beta.9"
|
|
57
57
|
}
|
|
58
58
|
}
|
package/scss/mixins/index.scss
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@mixin typography-type($typeMap) {
|
|
2
|
+
font-family: map-get($typeMap, font-family);
|
|
3
|
+
font-size: map-get($typeMap, font-size);
|
|
4
|
+
font-weight: map-get($typeMap, font-weight);
|
|
5
|
+
line-height: map-get($typeMap, line-height);
|
|
6
|
+
color: map-get($typeMap, color);
|
|
7
|
+
text-transform: map-get($typeMap, text-transform);
|
|
8
|
+
text-decoration: map-get($typeMap, text-decoration);
|
|
9
|
+
text-align: map-get($typeMap, text-align);
|
|
10
|
+
|
|
11
|
+
@media (max-width: $tablet-width) {
|
|
12
|
+
font-size: map-get($typeMap, tablet-font-size);
|
|
13
|
+
font-weight: map-get($typeMap, tablet-font-weight);
|
|
14
|
+
line-height: map-get($typeMap, tablet-line-height);
|
|
15
|
+
text-transform: map-get($typeMap, tablet-text-transform);
|
|
16
|
+
text-align: map-get($typeMap, tablet-text-align);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@media (max-width: $mobile-width) {
|
|
20
|
+
font-size: map-get($typeMap, mobile-font-size);
|
|
21
|
+
font-weight: map-get($typeMap, mobile-font-weight);
|
|
22
|
+
line-height: map-get($typeMap, mobile-line-height);
|
|
23
|
+
text-transform: map-get($typeMap, mobile-text-transform);
|
|
24
|
+
text-align: map-get($typeMap, mobile-text-align);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -21,3 +21,87 @@ $line-height-2xl: 45px;
|
|
|
21
21
|
$font-weight-sm: 400;
|
|
22
22
|
$font-weight-md: 500;
|
|
23
23
|
$font-weight-lg: 700;
|
|
24
|
+
|
|
25
|
+
$title-types: () !default;
|
|
26
|
+
$title-types: map-merge(
|
|
27
|
+
(
|
|
28
|
+
"h1": (
|
|
29
|
+
"font-size": $font-size-2xl,
|
|
30
|
+
"font-weight": $font-weight-lg,
|
|
31
|
+
"line-height": $line-height-2xl,
|
|
32
|
+
"color": $text-color,
|
|
33
|
+
),
|
|
34
|
+
"h2": (
|
|
35
|
+
"font-size": $font-size-xl,
|
|
36
|
+
"font-weight": $font-weight-lg,
|
|
37
|
+
"line-height": $line-height-xl,
|
|
38
|
+
"color": $text-color,
|
|
39
|
+
),
|
|
40
|
+
"h3": (
|
|
41
|
+
"font-size": $font-size-lg,
|
|
42
|
+
"font-weight": $font-weight-lg,
|
|
43
|
+
"line-height": $line-height-lg,
|
|
44
|
+
"color": $text-color,
|
|
45
|
+
),
|
|
46
|
+
"h4": (
|
|
47
|
+
"font-size": $font-size-base,
|
|
48
|
+
"font-weight": $font-weight-lg,
|
|
49
|
+
"line-height": $line-height-base,
|
|
50
|
+
"color": $text-color,
|
|
51
|
+
),
|
|
52
|
+
"h5": (
|
|
53
|
+
"font-size": $font-size-sm,
|
|
54
|
+
"font-weight": $font-weight-md,
|
|
55
|
+
"line-height": $line-height-sm,
|
|
56
|
+
"color": $text-color,
|
|
57
|
+
),
|
|
58
|
+
"h6": (
|
|
59
|
+
"font-size": $font-size-xs,
|
|
60
|
+
"font-weight": $font-weight-md,
|
|
61
|
+
"line-height": $line-height-xs,
|
|
62
|
+
"color": $text-color,
|
|
63
|
+
),
|
|
64
|
+
"subtitle": (
|
|
65
|
+
"font-size": $font-size-2xl,
|
|
66
|
+
"font-weight": $font-weight-md,
|
|
67
|
+
"line-height": $line-height-2xl,
|
|
68
|
+
"color": $text-color,
|
|
69
|
+
),
|
|
70
|
+
),
|
|
71
|
+
$title-types
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
$text-types: () !default;
|
|
75
|
+
$text-types: map-merge(
|
|
76
|
+
(
|
|
77
|
+
"body": (
|
|
78
|
+
"font-size": $font-size-base,
|
|
79
|
+
"font-weight": $font-weight-sm,
|
|
80
|
+
"line-height": $line-height-base,
|
|
81
|
+
"color": $text-color,
|
|
82
|
+
),
|
|
83
|
+
"span": (
|
|
84
|
+
"font-size": $font-size-base,
|
|
85
|
+
"font-weight": $font-weight-sm,
|
|
86
|
+
"line-height": $line-height-base,
|
|
87
|
+
"color": $text-color,
|
|
88
|
+
),
|
|
89
|
+
"boldSpan": (
|
|
90
|
+
"font-size": $font-size-base,
|
|
91
|
+
"font-weight": $font-weight-lg,
|
|
92
|
+
"line-height": $line-height-base,
|
|
93
|
+
"color": $text-color,
|
|
94
|
+
),
|
|
95
|
+
),
|
|
96
|
+
$text-types
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
$typography-colors: (
|
|
100
|
+
"text-color": $text-color,
|
|
101
|
+
"primary": $primary,
|
|
102
|
+
"secondary": $secondary,
|
|
103
|
+
"success": $success,
|
|
104
|
+
"danger": $danger,
|
|
105
|
+
"warning": $warning,
|
|
106
|
+
"info": $info,
|
|
107
|
+
);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
exports.__esModule = true;
|
|
26
|
+
var React = __importStar(require("react"));
|
|
27
|
+
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
28
|
+
var TYPE_MAPPING = {
|
|
29
|
+
body: 'p',
|
|
30
|
+
span: 'span',
|
|
31
|
+
boldSpan: 'span'
|
|
32
|
+
};
|
|
33
|
+
function TextView(props) {
|
|
34
|
+
var bem = (0, hooks_1.useBem)('TextView');
|
|
35
|
+
var tag = props.tag || TYPE_MAPPING[props.type || ''] || 'p';
|
|
36
|
+
return (React.createElement(tag, {
|
|
37
|
+
className: bem(bem.block({
|
|
38
|
+
type: props.type,
|
|
39
|
+
color: props.color
|
|
40
|
+
}), props.className),
|
|
41
|
+
style: props.style
|
|
42
|
+
}, React.createElement(React.Fragment, null,
|
|
43
|
+
props.content,
|
|
44
|
+
props.children)));
|
|
45
|
+
}
|
|
46
|
+
exports["default"] = TextView;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.TextView {
|
|
2
|
+
font-family: $font-family-nunito;
|
|
3
|
+
|
|
4
|
+
@each $typeName, $typeMap in $text-types {
|
|
5
|
+
&_type_#{$typeName} {
|
|
6
|
+
@include typography-type($typeMap);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@each $colorName, $color in $typography-colors {
|
|
11
|
+
&_color_#{$colorName} {
|
|
12
|
+
color: $color;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
exports.__esModule = true;
|
|
26
|
+
var React = __importStar(require("react"));
|
|
27
|
+
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
28
|
+
var TYPE_MAPPING = {
|
|
29
|
+
h1: 'h1',
|
|
30
|
+
h2: 'h2',
|
|
31
|
+
h3: 'h3',
|
|
32
|
+
h4: 'h4',
|
|
33
|
+
h5: 'h5',
|
|
34
|
+
h6: 'h6',
|
|
35
|
+
subtitle: 'h6'
|
|
36
|
+
};
|
|
37
|
+
function TitleView(props) {
|
|
38
|
+
var bem = (0, hooks_1.useBem)('TitleView');
|
|
39
|
+
var tag = props.tag || TYPE_MAPPING[props.type || ''] || 'h2';
|
|
40
|
+
return (React.createElement(tag, {
|
|
41
|
+
className: bem(bem.block({
|
|
42
|
+
type: props.type,
|
|
43
|
+
color: props.color
|
|
44
|
+
}), props.className),
|
|
45
|
+
style: props.style
|
|
46
|
+
}, React.createElement(React.Fragment, null,
|
|
47
|
+
props.content,
|
|
48
|
+
props.children)));
|
|
49
|
+
}
|
|
50
|
+
exports["default"] = TitleView;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.TitleView {
|
|
2
|
+
font-family: $font-family-nunito;
|
|
3
|
+
|
|
4
|
+
@each $typeName, $typeMap in $title-types {
|
|
5
|
+
&_type_#{$typeName} {
|
|
6
|
+
@include typography-type($typeMap);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@each $colorName, $color in $typography-colors {
|
|
11
|
+
&_color_#{$colorName} {
|
|
12
|
+
color: $color;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|