@brandup/ui-kit 1.0.2 → 1.0.4

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/README.md CHANGED
@@ -81,7 +81,7 @@ Default root styles for `<svg>` tag.
81
81
  --svg-width: var(--svg-size);
82
82
  --svg-height: var(--svg-size);
83
83
  --svg-fill: var(--text-color);
84
- --svg-stroke: var(--text-color);
84
+ --svg-stroke: none;
85
85
  ```
86
86
 
87
87
  See [common.less](source/common.less) file.
@@ -101,9 +101,12 @@ See [common.less](source/common.less) file.
101
101
  ### Input styles
102
102
 
103
103
  Styles for:
104
- - reset for input, textarea, button
105
- - input[type=text]
106
- - textarea
104
+
105
+ - reset for input, textarea, button
106
+ - input[type=text]
107
+ - input[type=checkbox]
108
+ - textarea
109
+ - select
107
110
 
108
111
  See [inputs.less](source/inputs.less) file.
109
112
 
@@ -134,4 +137,4 @@ Open popup by only popup element:
134
137
  PopupManager.open(DOM.getById("popup3"));
135
138
  ```
136
139
 
137
- If the initiator is specified, then when the popup is opened again, it will be closed.
140
+ If the initiator is specified, then when the popup is opened again, it will be closed.
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "type": "module",
24
24
  "license": "Apache-2.0",
25
- "version": "1.0.2",
25
+ "version": "1.0.4",
26
26
  "main": "source/index.ts",
27
27
  "types": "source/index.ts",
28
28
  "dependencies": {
@@ -30,7 +30,7 @@
30
30
  --svg-width: var(--svg-size);
31
31
  --svg-height: var(--svg-size);
32
32
  --svg-fill: var(--text-color);
33
- --svg-stroke: var(--text-color);
33
+ --svg-stroke: none;
34
34
 
35
35
  // popup
36
36
 
@@ -22,6 +22,7 @@
22
22
  --input-width: auto;
23
23
  --input-height: 42px;
24
24
  --input-padding-lr: 13px;
25
+ --textarea-size: 100px;
25
26
 
26
27
  // font
27
28
  --input-color: var(--text-color);
@@ -29,10 +30,14 @@
29
30
  --input-font-weidth: inherit;
30
31
  --input-font-style: inherit;
31
32
 
32
- --hover--input-border-color: #555;
33
+ --hover--input-border-color: #666;
33
34
  --hover--input-fill: var(--input-fill);
34
35
  --hover--input-color: var(--input-color);
35
36
 
37
+ --focus--input-border-color: #222;
38
+ --focus--input-fill: var(--hover--input-fill);
39
+ --focus--input-color: var(--hover--input-color);
40
+
36
41
  --disabled--input-border-color: #aaa;
37
42
  --disabled--input-fill: #eee;
38
43
  --disabled--input-color: var(--input-color);
@@ -40,22 +45,32 @@
40
45
  --invalid--input-border-color: red;
41
46
  --invalid--input-fill: var(--input-fill);
42
47
  --invalid--input-color: var(--input-color);
48
+
49
+ // toggler
50
+ --toggler-height: 30px;
51
+ --toggler-padding: 3px;
52
+ --toggler-round-fill: var(--hover--input-border-color); // цвет круглешка
43
53
  }
44
54
 
45
55
  input,
46
56
  textarea,
47
- button {
48
- appearance: none;
57
+ button,
58
+ select {
59
+ display: block;
49
60
  font-family: inherit;
50
- font-size: unset;
61
+ font-size: var(--input-font-size);
62
+ font-weight: var(--input-font-weidth);
63
+ font-style: var(--input-font-style);
64
+ color: var(--input-color);
51
65
  line-height: unset;
52
- color: unset;
53
66
  box-sizing: border-box;
54
67
  padding: 0;
55
68
  margin: 0;
69
+ outline: none;
56
70
  }
57
71
 
58
- input[type=text], textarea {
72
+ input[type=text], textarea, select {
73
+ appearance: none;
59
74
  outline: none;
60
75
  border-style: var(--input-border-type);
61
76
  border-width: var(--input-border-width);
@@ -67,23 +82,24 @@ input[type=text], textarea {
67
82
  padding-left: var(--input-padding-lr);
68
83
  padding-right: var(--input-padding-lr);
69
84
 
70
- font-size: var(--input-font-size);
71
- font-weight: var(--input-font-weidth);
72
- font-style: var(--input-font-style);
73
- color: var(--input-color);
74
-
75
85
  &::placeholder {
76
86
  font-weight: var(--placeholder-font-weidth);
77
87
  font-style: var(--placeholder-font-style);
78
88
  color: var(--placeholder-color);
79
89
  }
80
90
 
81
- &:hover, &:focus {
91
+ &:hover {
82
92
  border-color: var(--hover--input-border-color);
83
93
  background: var(--hover--input-fill);
84
94
  color: var(--hover--input-color);
85
95
  }
86
96
 
97
+ &:focus {
98
+ border-color: var(--focus--input-border-color);
99
+ background: var(--focus--input-fill);
100
+ color: var(--focus--input-color);
101
+ }
102
+
87
103
  &:read-only {
88
104
  cursor: default;
89
105
  }
@@ -101,7 +117,87 @@ input[type=text], textarea {
101
117
  }
102
118
  }
103
119
 
120
+ select {
121
+ appearance: auto;
122
+ }
123
+
104
124
  textarea {
105
125
  padding-top: calc(1em / 2);
106
126
  padding-bottom: calc(1em / 2);
127
+ min-height: var(--textarea-size);
128
+ }
129
+
130
+ input[type=checkbox] {
131
+ appearance: none;
132
+ position: relative;
133
+ cursor: pointer;
134
+
135
+ background-color: var(--input-fill);
136
+ border-style: var(--input-border-type);
137
+ border-width: var(--input-border-width);
138
+ border-color: var(--input-border-color);
139
+ border-radius: calc(var(--toggler-height) / 2);
140
+
141
+ height: var(--toggler-height);
142
+ width: calc(var(--toggler-height) * 2);
143
+
144
+ --round-size: calc(var(--toggler-height) - var(--toggler-padding) * 2 - var(--input-border-width) * 2);
145
+
146
+ &:after {
147
+ content: '';
148
+ position: absolute;
149
+ background-color: var(--toggler-round-fill);
150
+ width: var(--round-size);
151
+ height: var(--round-size);
152
+ border-radius: 50%;
153
+ left: var(--toggler-padding);
154
+ margin-top: auto;
155
+ margin-bottom: auto;
156
+ top: 0;
157
+ bottom: 0;
158
+ }
159
+
160
+ &:hover {
161
+ border-color: var(--hover--input-border-color);
162
+ background: var(--hover--input-fill);
163
+ color: var(--hover--input-color);
164
+ }
165
+
166
+ &:focus {
167
+ border-color: var(--focus--input-border-color);
168
+ background: var(--focus--input-fill);
169
+ color: var(--focus--input-color);
170
+ }
171
+
172
+ &[readonly] {
173
+ pointer-events: none;
174
+ }
175
+
176
+ &:checked {
177
+ background-color: var(--toggler-round-fill);
178
+
179
+ &:after {
180
+ background-color: var(--input-fill);
181
+ right: var(--toggler-padding);
182
+ left: auto;
183
+ }
184
+ }
185
+
186
+ &:disabled {
187
+ border-color: var(--disabled--input-border-color);
188
+ background: var(--disabled--input-fill);
189
+ color: var(--disabled--input-color);
190
+ cursor: default;
191
+
192
+ &:after {
193
+ background-color: var(--toggler-round-fill);
194
+ opacity: 0.4;
195
+ }
196
+ }
197
+
198
+ &:user-invalid {
199
+ border-color: var(--invalid--input-border-color);
200
+ background: var(--invalid--input-fill);
201
+ color: var(--invalid--input-color);
202
+ }
107
203
  }