@taiga-ui/core 3.2.0 → 3.4.0

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.
Files changed (35) hide show
  1. package/bundles/taiga-ui-core-components-primitive-textfield.umd.js +2 -2
  2. package/bundles/taiga-ui-core-components-primitive-textfield.umd.js.map +1 -1
  3. package/bundles/taiga-ui-core-components-root.umd.js +1 -1
  4. package/bundles/taiga-ui-core-directives-hint.umd.js +5 -4
  5. package/bundles/taiga-ui-core-directives-hint.umd.js.map +1 -1
  6. package/esm2015/components/primitive-textfield/primitive-textfield.component.js +1 -1
  7. package/esm2015/components/primitive-textfield/textfield/textfield.component.js +1 -1
  8. package/esm2015/components/root/root.component.js +1 -1
  9. package/esm2015/directives/hint/hint.component.js +6 -5
  10. package/fesm2015/taiga-ui-core-components-primitive-textfield.js +2 -2
  11. package/fesm2015/taiga-ui-core-components-primitive-textfield.js.map +1 -1
  12. package/fesm2015/taiga-ui-core-components-root.js +1 -1
  13. package/fesm2015/taiga-ui-core-directives-hint.js +5 -4
  14. package/fesm2015/taiga-ui-core-directives-hint.js.map +1 -1
  15. package/package.json +4 -4
  16. package/styles/mixins/mixins.scss +35 -20
  17. package/styles/mixins/picker.scss +13 -13
  18. package/styles/mixins/slider.scss +17 -0
  19. package/styles/mixins/text.scss +2 -0
  20. package/styles/mixins/textfield.less +0 -1
  21. package/styles/mixins/textfield.scss +89 -94
  22. package/styles/mixins/wrapper.scss +5 -3
  23. package/styles/theme/dialog.less +1 -1
  24. package/styles/theme/wrapper/accent.less +1 -1
  25. package/styles/theme/wrapper/base.less +1 -1
  26. package/styles/theme/wrapper/icon.less +1 -1
  27. package/styles/theme/wrapper/mono.less +1 -1
  28. package/styles/theme/wrapper/outline.less +1 -1
  29. package/styles/theme/wrapper/primary.less +1 -1
  30. package/styles/theme/wrapper/secondary-destructive.less +1 -1
  31. package/styles/theme/wrapper/secondary.less +1 -1
  32. package/styles/theme/wrapper/table.less +1 -1
  33. package/styles/theme/wrapper/textfield.less +1 -1
  34. package/styles/theme/wrapper/whiteblock.less +1 -1
  35. package/styles/variables/media.scss +21 -0
@@ -1,8 +1,11 @@
1
+ $line-height-l: 1.25rem;
2
+
1
3
  @mixin textfield-host() {
2
4
  @include text-basic();
3
5
  position: relative;
4
6
  display: block;
5
7
  border-radius: var(--tui-radius-m);
8
+ text-align: left;
6
9
 
7
10
  &[data-size='s'] {
8
11
  height: var(--tui-height-s);
@@ -20,7 +23,8 @@
20
23
  height: var(--tui-height-l);
21
24
  min-height: var(--tui-height-l);
22
25
  max-height: var(--tui-height-l);
23
- font-size: 15px;
26
+ font: var(--tui-font-text-m);
27
+ line-height: $line-height-l;
24
28
  }
25
29
  }
26
30
 
@@ -28,17 +32,26 @@
28
32
  display: flex;
29
33
  height: 100%;
30
34
  width: 100%;
31
- padding: 0 12px;
35
+ padding: 0 var(--tui-padding-m);
32
36
  box-sizing: border-box;
33
37
  align-items: center;
34
38
  overflow: hidden;
35
39
 
36
40
  :host[data-size='s'] & {
37
- padding-right: 8px;
41
+ padding: 0 var(--tui-padding-s);
38
42
  }
39
43
 
40
44
  :host[data-size='l'] & {
41
- padding-left: 16px;
45
+ padding: 0 var(--tui-padding-l);
46
+ }
47
+
48
+ &:after {
49
+ content: '';
50
+ margin-right: -0.25rem;
51
+ }
52
+
53
+ :host[data-size='m'] &:after {
54
+ display: none;
42
55
  }
43
56
  }
44
57
 
@@ -46,75 +59,101 @@
46
59
  @include text-basic();
47
60
  @include clearinput();
48
61
  @include fullsize();
49
- padding: 0 12px;
62
+ padding: 0 var(--tui-padding-m);
63
+ border: solid transparent;
64
+ border-width: 0 var(--border-end, 0) 0 var(--border-start, 0);
65
+ border-inline-start-width: var(--border-start, 0);
66
+ border-inline-end-width: var(--border-end, 0);
67
+ text-indent: var(--text-indent);
68
+ text-align: inherit;
50
69
  box-sizing: border-box;
51
70
  white-space: nowrap;
52
71
  overflow: hidden;
53
72
  text-transform: inherit;
73
+ resize: none;
74
+ text-overflow: ellipsis;
54
75
 
55
- :host[data-size='s'] & {
56
- padding: 0 8px 0 12px;
76
+ :host[data-mode='onDark'] &,
77
+ :host-context(tui-primitive-textfield[data-mode='onDark']),
78
+ :host-context(tui-text-area[data-mode='onDark']) {
79
+ @include autofill(dark);
57
80
  }
58
81
 
59
- :host[data-size='l'] & {
60
- padding: 0 16px;
82
+ :host[data-size='s'] &,
83
+ :host-context(tui-primitive-textfield[data-size='s']):not(tui-primitive-textfield),
84
+ :host-context(tui-text-area[data-size='s']):not(tui-text-area) {
85
+ padding: 0 var(--tui-padding-s);
61
86
  }
62
87
 
63
- :host._disabled & {
88
+ :host[data-size='l'] &,
89
+ :host-context(tui-primitive-textfield[data-size='l']):not(tui-primitive-textfield),
90
+ :host-context(tui-text-area[data-size='l']):not(tui-text-area) {
91
+ padding: 0 var(--tui-padding-l);
92
+ }
93
+
94
+ :host._disabled &,
95
+ :host-context(tui-primitive-textfield._disabled),
96
+ :host-context(tui-text-area._disabled) {
64
97
  // $bad TODO: research why you can reach disabled textfield with mask inside a label without that
65
98
  pointer-events: none;
66
99
  }
67
100
 
68
- :host[data-size='l']:not(._label-outside) & {
69
- padding-top: 20px;
101
+ :host[data-size='l']:not(._label-outside) &,
102
+ :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield) {
103
+ padding-top: $line-height-l;
70
104
 
71
105
  // Workaround for raising placeholder in temporary autofill
72
- &:-webkit-autofill + .content .placeholder {
73
- width: 114%; // compensation of scale(0.87)
74
- transform: translateY(-10px) scale(0.87);
106
+ &:-webkit-autofill + .t-content .t-placeholder {
107
+ font-size: 0.8156rem;
108
+ transform: translateY(-0.625rem);
75
109
  }
76
110
  }
77
111
 
78
- :host[data-size='m']:not(._label-outside) & {
79
- padding-top: 18px;
112
+ :host[data-size='m']:not(._label-outside) &,
113
+ :host-context(tui-primitive-textfield[data-size='m']:not(._label-outside)):not(tui-primitive-textfield) {
114
+ padding-top: 1.125rem;
80
115
 
81
116
  // Workaround for raising placeholder in temporary autofill
82
- &:-webkit-autofill + .content .placeholder {
83
- width: 118%; // compensation of scale(0.85)
84
- transform: translateY(-8px) scale(0.85);
117
+ &:-webkit-autofill + .t-content .t-placeholder {
118
+ font-size: 0.69rem;
119
+ transform: translateY(-0.5rem);
85
120
  }
86
121
  }
122
+
123
+ :host._hidden input&,
124
+ :host-context(tui-primitive-textfield._hidden) {
125
+ opacity: 0;
126
+ text-indent: -10em; // Hide blinking caret even in IE
127
+ -webkit-user-select: none; // Hide blinking caret in mobile safari
128
+ }
87
129
  }
88
130
 
89
131
  @mixin textfield-wrapper() {
90
132
  flex: 1;
91
133
  min-width: 0;
92
- padding-right: $space;
134
+ padding-right: 0.25rem;
135
+ padding-inline-end: 0.25rem;
136
+ padding-inline-start: 0;
93
137
  }
94
138
 
95
139
  @mixin textfield-placeholder() {
96
- @include transition('transform, min-width, color, letter-spacing');
140
+ @include transition('transform, font-size, color, letter-spacing');
97
141
  @include text-basic();
98
142
  @include text-overflow();
99
143
  display: block;
100
144
  width: 100%;
101
- height: 20px;
102
- font-size: 13px;
103
- box-sizing: border-box;
104
145
  user-select: none;
105
- pointer-events: none;
106
146
  color: var(--tui-text-02);
107
- transform-origin: left;
108
- letter-spacing: normal;
109
- text-transform: none;
147
+ pointer-events: none;
148
+ will-change: transform;
149
+ transform: translateY(0);
110
150
 
111
151
  &_raised {
112
- width: 114%; // compensation of scale(0.87)
113
- transform: translateY(-10px) scale(0.87);
152
+ transform: translateY(-0.625rem);
114
153
 
115
154
  :host[data-size='m'] & {
116
- width: 118%;
117
- transform: translateY(-8px) scale(0.85);
155
+ font: var(--tui-font-text-xs);
156
+ transform: translateY(-0.5rem);
118
157
  letter-spacing: 0.025rem;
119
158
  }
120
159
 
@@ -136,7 +175,11 @@
136
175
  }
137
176
 
138
177
  :host[data-size='l'] & {
139
- font-size: 15px;
178
+ font-size: 0.9375rem;
179
+
180
+ &_raised {
181
+ font-size: 0.8156rem;
182
+ }
140
183
  }
141
184
 
142
185
  :host[data-size='m']._focused:not(._label-outside) &,
@@ -164,6 +207,7 @@
164
207
 
165
208
  @supports (-webkit-hyphens: none) {
166
209
  & {
210
+ will-change: unset;
167
211
  transition-property: transform, color, letter-spacing;
168
212
  }
169
213
  }
@@ -171,8 +215,8 @@
171
215
 
172
216
  @mixin input-icon() {
173
217
  display: flex;
174
- width: 24px;
175
- height: 24px;
218
+ width: 1.5rem;
219
+ height: 1.5rem;
176
220
  align-items: center;
177
221
  justify-content: center;
178
222
  color: var(--tui-text-03);
@@ -208,92 +252,43 @@
208
252
  }
209
253
  }
210
254
 
211
- @mixin example-text() {
212
- display: flex;
213
- align-items: center;
214
- height: 20px;
215
- margin: -20px 0;
216
- padding: 10px 0;
217
- box-sizing: content-box;
218
- color: var(--tui-text-03);
219
- letter-spacing: normal;
220
- text-transform: none;
221
-
222
- :host[data-size='m']._label-outside & {
223
- margin-top: -19px;
224
- }
225
-
226
- :host[data-mode='onDark'] & {
227
- color: var(--tui-text-03-night);
228
- }
229
- }
230
-
231
255
  @mixin textfield() {
232
256
  :host {
233
257
  @include textfield-host();
234
258
  }
235
259
 
236
- .input {
260
+ .t-input {
237
261
  @include textfield-input();
238
262
  }
239
263
 
240
- .ghost {
241
- visibility: hidden;
242
- white-space: pre;
243
- text-overflow: clip;
244
- }
245
-
246
- .filler {
247
- vertical-align: middle;
248
- }
249
-
250
- .content {
264
+ .t-content {
251
265
  @include textfield-content();
252
266
  }
253
267
 
254
- .wrapper {
268
+ .t-wrapper {
255
269
  @include textfield-wrapper();
256
270
  }
257
271
 
258
- .value-decoration {
259
- @include example-text();
260
- }
261
-
262
- .value-decoration-inner {
263
- @include text-overflow();
264
- min-width: 0;
265
- }
266
-
267
- .postfix {
268
- @include transition('color');
269
- color: var(--tui-text-01);
270
-
271
- &_shifted {
272
- margin-left: 0.5ch;
273
- }
274
-
275
- :host[data-mode='onDark'] & {
276
- color: var(--tui-text-01-night);
277
- }
278
- }
279
-
280
- .placeholder {
272
+ .t-placeholder {
281
273
  @include textfield-placeholder();
282
274
  }
283
275
 
284
- .cleaner {
276
+ .t-cleaner {
285
277
  @include icon-button();
286
278
  }
287
279
 
288
280
  // $bad TODO: Refactor this and interactive icons together
289
- .icon {
281
+ .t-icon {
290
282
  @include input-icon();
291
283
 
292
284
  &_left {
293
285
  margin: 0 2 * $space 0 -$space;
286
+ margin-inline-start: -$space;
287
+ margin-inline-end: 2 * $space;
294
288
 
295
289
  :host[data-size='s'] & {
296
290
  margin-right: $space;
291
+ margin-inline-end: $space;
297
292
  }
298
293
  }
299
294
  }
@@ -1,7 +1,9 @@
1
1
  @mixin wrapper-hover {
2
- &:hover:not(._no-hover),
3
- &[data-state='hover'] {
4
- @content;
2
+ @media (hover: hover) {
3
+ &:hover:not(._no-hover),
4
+ &[data-state='hover'] {
5
+ @content;
6
+ }
5
7
  }
6
8
  }
7
9
 
@@ -1,4 +1,4 @@
1
- @import '../mixins/mixins';
1
+ @import '../mixins/mixins.less';
2
2
 
3
3
  tui-root:not(._mobile) tui-dialog-host > section {
4
4
  .customize-scroll();
@@ -1,4 +1,4 @@
1
- @import '../../taiga-ui-local';
1
+ @import '../../taiga-ui-local.less';
2
2
 
3
3
  /* stylelint-disable order/order */
4
4
  [tuiWrapper][data-appearance='accent'] {
@@ -1,4 +1,4 @@
1
- @import '../../taiga-ui-local';
1
+ @import '../../taiga-ui-local.less';
2
2
 
3
3
  /* stylelint-disable order/order */
4
4
  [tuiWrapper] {
@@ -1,4 +1,4 @@
1
- @import '../../taiga-ui-local';
1
+ @import '../../taiga-ui-local.less';
2
2
 
3
3
  /* stylelint-disable order/order */
4
4
  [tuiWrapper][data-appearance='icon'] {
@@ -1,4 +1,4 @@
1
- @import '../../taiga-ui-local';
1
+ @import '../../taiga-ui-local.less';
2
2
 
3
3
  /* stylelint-disable order/order */
4
4
  tui-wrapper[data-appearance='mono'],
@@ -1,4 +1,4 @@
1
- @import '../../taiga-ui-local';
1
+ @import '../../taiga-ui-local.less';
2
2
 
3
3
  /* stylelint-disable order/order */
4
4
  [tuiWrapper][data-appearance='outline'] {
@@ -1,4 +1,4 @@
1
- @import '../../taiga-ui-local';
1
+ @import '../../taiga-ui-local.less';
2
2
 
3
3
  /* stylelint-disable order/order */
4
4
  [tuiWrapper][data-appearance='primary'] {
@@ -1,4 +1,4 @@
1
- @import '../../taiga-ui-local';
1
+ @import '../../taiga-ui-local.less';
2
2
 
3
3
  /* stylelint-disable order/order */
4
4
  tui-wrapper[data-appearance='secondary-destructive'],
@@ -1,4 +1,4 @@
1
- @import '../../taiga-ui-local';
1
+ @import '../../taiga-ui-local.less';
2
2
 
3
3
  /* stylelint-disable order/order */
4
4
  [tuiWrapper][data-appearance='secondary'],
@@ -1,4 +1,4 @@
1
- @import '../../taiga-ui-local';
1
+ @import '../../taiga-ui-local.less';
2
2
 
3
3
  /* stylelint-disable order/order */
4
4
  [tuiWrapper][data-appearance='table'] {
@@ -1,4 +1,4 @@
1
- @import '../../taiga-ui-local';
1
+ @import '../../taiga-ui-local.less';
2
2
 
3
3
  /* stylelint-disable order/order */
4
4
  [tuiWrapper][data-appearance='textfield'] {
@@ -1,4 +1,4 @@
1
- @import '../../taiga-ui-local';
1
+ @import '../../taiga-ui-local.less';
2
2
 
3
3
  /* stylelint-disable order/order */
4
4
  [tuiWrapper][data-appearance='whiteblock'],
@@ -1,3 +1,24 @@
1
+ $tui-media-retina: '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)';
2
+ $tui-media-retina-mobile: '(-webkit-min-device-pixel-ratio: 2) and (max-width: 37.4625em), (min-resolution: 192dpi) and (max-width: 37.4625em)';
3
+ $tui-media-retina-tablet: '(-webkit-min-device-pixel-ratio: 2) and (max-width: 63.9625em), (min-resolution: 192dpi) and (max-width: 63.9625em)';
4
+ $tui-media-retina-desktop: '(-webkit-min-device-pixel-ratio: 2) and (max-width: 84.9625em), (min-resolution: 192dpi) and (max-width: 84.9625em)';
5
+
6
+ $tui-mobile: 'screen and (max-width: 47.9625em)';
7
+ $tui-mobile-min: 'screen and (min-width: 22.5em)';
8
+ $tui-mobile-interval: '(min-width: 22.5em) and (max-width: 47.9625em)';
9
+
10
+ $tui-tablet: 'screen and (max-width: 63.9625em)';
11
+ $tui-tablet-min: 'screen and (min-width: 48em)';
12
+ $tui-tablet-interval: '(min-width: 48em) and (max-width: 63.9625em)';
13
+
14
+ $tui-desktop: 'screen and (max-width: 79.9625em)';
15
+ $tui-desktop-min: 'screen and (min-width: 64em)';
16
+ $tui-desktop-interval: '(min-width: 64em) and (max-width: 79.9625em)';
17
+
18
+ $tui-desktop-lg-min: 'screen and (min-width: 80em)';
19
+
20
+ // TODO: 4.0 delete all deprecations below
21
+ // deprecated
1
22
  $media-retina: '(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)';
2
23
  $media-retina-mobile: '(-webkit-min-device-pixel-ratio: 2) and (max-width: 599px), (min-resolution: 192dpi) and (max-width: 599px)';
3
24
  $media-retina-tablet: '(-webkit-min-device-pixel-ratio: 2) and (max-width: 1023px), (min-resolution: 192dpi) and (max-width: 1023px)';