@taiga-ui/core 3.37.0 → 3.38.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 (72) hide show
  1. package/bundles/taiga-ui-core-components-alert.umd.js +4 -10
  2. package/bundles/taiga-ui-core-components-alert.umd.js.map +1 -1
  3. package/bundles/taiga-ui-core-components-button.umd.js +1 -1
  4. package/bundles/taiga-ui-core-components-button.umd.js.map +1 -1
  5. package/bundles/taiga-ui-core-components-notification.umd.js +28 -31
  6. package/bundles/taiga-ui-core-components-notification.umd.js.map +1 -1
  7. package/bundles/taiga-ui-core-components-primitive-textfield.umd.js +10 -6
  8. package/bundles/taiga-ui-core-components-primitive-textfield.umd.js.map +1 -1
  9. package/bundles/taiga-ui-core-components-root.umd.js +1 -1
  10. package/bundles/taiga-ui-core-components-scroll-controls.umd.js +1 -1
  11. package/bundles/taiga-ui-core-components-scroll-controls.umd.js.map +1 -1
  12. package/bundles/taiga-ui-core-directives-dropdown.umd.js +1 -1
  13. package/bundles/taiga-ui-core-directives-hint.umd.js +1 -1
  14. package/bundles/taiga-ui-core-directives-textfield-controller.umd.js.map +1 -1
  15. package/bundles/taiga-ui-core-enums.umd.js +3 -1
  16. package/bundles/taiga-ui-core-enums.umd.js.map +1 -1
  17. package/bundles/taiga-ui-core-tokens.umd.js +20 -7
  18. package/bundles/taiga-ui-core-tokens.umd.js.map +1 -1
  19. package/bundles/taiga-ui-core-utils-miscellaneous.umd.js +7 -5
  20. package/bundles/taiga-ui-core-utils-miscellaneous.umd.js.map +1 -1
  21. package/components/alert/alert.component.d.ts +2 -4
  22. package/components/notification/notification.component.d.ts +11 -10
  23. package/components/notification/notification.module.d.ts +2 -1
  24. package/components/primitive-textfield/primitive-textfield.component.d.ts +1 -0
  25. package/constants/cache-basting-payload.d.ts +1 -1
  26. package/directives/textfield-controller/textfield.options.d.ts +3 -0
  27. package/enums/notification.d.ts +3 -0
  28. package/esm2015/components/alert/alert.component.js +6 -12
  29. package/esm2015/components/button/button.component.js +1 -1
  30. package/esm2015/components/notification/notification.component.js +24 -21
  31. package/esm2015/components/notification/notification.module.js +5 -4
  32. package/esm2015/components/primitive-textfield/primitive-textfield.component.js +9 -6
  33. package/esm2015/components/primitive-textfield/textfield/textfield.component.js +1 -1
  34. package/esm2015/components/root/root.component.js +1 -1
  35. package/esm2015/components/scroll-controls/scroll-controls.component.js +2 -2
  36. package/esm2015/directives/dropdown/dropdown.component.js +1 -1
  37. package/esm2015/directives/hint/hint.component.js +1 -1
  38. package/esm2015/directives/textfield-controller/textfield.options.js +1 -1
  39. package/esm2015/enums/notification.js +4 -2
  40. package/esm2015/interfaces/alert-options.js +1 -1
  41. package/esm2015/tokens/notification-options.js +13 -5
  42. package/esm2015/types/index.js +2 -1
  43. package/esm2015/types/notification.js +2 -0
  44. package/esm2015/utils/miscellaneous/get-border.js +7 -6
  45. package/fesm2015/taiga-ui-core-components-alert.js +5 -11
  46. package/fesm2015/taiga-ui-core-components-alert.js.map +1 -1
  47. package/fesm2015/taiga-ui-core-components-button.js +1 -1
  48. package/fesm2015/taiga-ui-core-components-button.js.map +1 -1
  49. package/fesm2015/taiga-ui-core-components-notification.js +28 -24
  50. package/fesm2015/taiga-ui-core-components-notification.js.map +1 -1
  51. package/fesm2015/taiga-ui-core-components-primitive-textfield.js +10 -7
  52. package/fesm2015/taiga-ui-core-components-primitive-textfield.js.map +1 -1
  53. package/fesm2015/taiga-ui-core-components-root.js +1 -1
  54. package/fesm2015/taiga-ui-core-components-scroll-controls.js +1 -1
  55. package/fesm2015/taiga-ui-core-components-scroll-controls.js.map +1 -1
  56. package/fesm2015/taiga-ui-core-directives-dropdown.js +1 -1
  57. package/fesm2015/taiga-ui-core-directives-hint.js +1 -1
  58. package/fesm2015/taiga-ui-core-directives-textfield-controller.js.map +1 -1
  59. package/fesm2015/taiga-ui-core-enums.js +3 -1
  60. package/fesm2015/taiga-ui-core-enums.js.map +1 -1
  61. package/fesm2015/taiga-ui-core-tokens.js +14 -5
  62. package/fesm2015/taiga-ui-core-tokens.js.map +1 -1
  63. package/fesm2015/taiga-ui-core-utils-miscellaneous.js +6 -5
  64. package/fesm2015/taiga-ui-core-utils-miscellaneous.js.map +1 -1
  65. package/interfaces/alert-options.d.ts +9 -4
  66. package/package.json +4 -4
  67. package/styles/mixins/textfield.less +46 -34
  68. package/styles/mixins/textfield.scss +85 -36
  69. package/tokens/notification-options.d.ts +9 -1
  70. package/types/index.d.ts +1 -0
  71. package/types/notification.d.ts +1 -0
  72. package/utils/miscellaneous/get-border.d.ts +2 -1
@@ -1,11 +1,9 @@
1
- @line-height-l: 1.25rem;
2
-
3
1
  .textfield-host() {
4
2
  .text-basic();
5
3
  position: relative;
6
4
  display: block;
7
- border-radius: var(--tui-radius-m);
8
5
  text-align: left;
6
+ border-radius: var(--tui-radius-m);
9
7
  height: var(--tui-height);
10
8
  min-height: var(--tui-height);
11
9
  max-height: var(--tui-height);
@@ -21,7 +19,7 @@
21
19
  &[data-size='l'] {
22
20
  --tui-height: var(--tui-height-l);
23
21
  font: var(--tui-font-text-m);
24
- line-height: @line-height-l;
22
+ line-height: 1.25rem;
25
23
  }
26
24
  }
27
25
 
@@ -29,7 +27,6 @@
29
27
  display: flex;
30
28
  height: 100%;
31
29
  width: 100%;
32
- padding: 0 var(--tui-padding-m);
33
30
  box-sizing: border-box;
34
31
  align-items: center;
35
32
  overflow: hidden;
@@ -38,17 +35,12 @@
38
35
  padding: 0 var(--tui-padding-s);
39
36
  }
40
37
 
41
- :host[data-size='l'] & {
42
- padding: 0 var(--tui-padding-l);
43
- }
44
-
45
- &:after {
46
- content: '';
47
- margin-right: -0.25rem;
38
+ :host[data-size='m'] & {
39
+ padding: 0 var(--tui-padding-m);
48
40
  }
49
41
 
50
- :host[data-size='m'] &:after {
51
- display: none;
42
+ :host[data-size='l'] & {
43
+ padding: 0 var(--tui-padding-l);
52
44
  }
53
45
  }
54
46
 
@@ -56,9 +48,7 @@
56
48
  .text-basic();
57
49
  .clearinput();
58
50
  .fullsize();
59
- padding: 0 var(--tui-padding-m);
60
51
  border: solid transparent;
61
- border-width: 0 var(--border-end, 0) 0 var(--border-start, 0);
62
52
  border-inline-start-width: var(--border-start, 0);
63
53
  border-inline-end-width: var(--border-end, 0);
64
54
  text-indent: var(--text-indent);
@@ -114,6 +104,12 @@
114
104
  padding: 0 var(--tui-padding-s);
115
105
  }
116
106
 
107
+ :host[data-size='m'] &,
108
+ :host-context(tui-primitive-textfield[data-size='m']):not(tui-primitive-textfield),
109
+ :host-context(tui-text-area[data-size='m']):not(tui-text-area) {
110
+ padding: 0 var(--tui-padding-m);
111
+ }
112
+
117
113
  :host[data-size='l'] &,
118
114
  :host-context(tui-primitive-textfield[data-size='l']):not(tui-primitive-textfield),
119
115
  :host-context(tui-text-area[data-size='l']):not(tui-text-area) {
@@ -129,7 +125,7 @@
129
125
 
130
126
  :host[data-size='l']:not(._label-outside) &,
131
127
  :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield) {
132
- padding-top: @line-height-l;
128
+ padding-top: 1.25rem;
133
129
 
134
130
  // Workaround for raising placeholder in temporary autofill
135
131
  &:-webkit-autofill + .t-content .t-placeholder {
@@ -160,15 +156,10 @@
160
156
  .textfield-wrapper() {
161
157
  flex: 1;
162
158
  min-width: 0;
163
- padding-right: 0.25rem;
164
159
  padding-inline-end: 0.25rem;
165
- padding-inline-start: 0;
166
-
167
- & + * {
168
- margin: 0;
169
- }
170
160
  }
171
161
 
162
+ // TODO: Rename to label in 4.0
172
163
  .textfield-placeholder() {
173
164
  .transition(~'transform, font-size, color, letter-spacing');
174
165
  .text-overflow();
@@ -253,17 +244,33 @@
253
244
  display: flex;
254
245
  width: 1.5rem;
255
246
  height: 1.5rem;
256
- margin: 0 0 0 0.25rem;
257
- margin-inline-start: 0.25rem;
258
- margin-inline-end: 0;
259
247
  align-items: center;
260
248
  justify-content: center;
261
249
  box-sizing: border-box;
262
250
  cursor: pointer;
251
+ pointer-events: none;
252
+ }
253
+
254
+ .input-icons() {
255
+ display: flex;
256
+ align-items: center;
257
+
258
+ :host[data-size='m'] & {
259
+ margin-inline-end: -0.125rem;
260
+ }
261
+
262
+ :host[data-size='s'] & {
263
+ margin-inline-end: -0.375rem;
264
+ }
265
+
266
+ :host:not([data-size='s']) & > :not(:first-child) {
267
+ margin-inline-start: 0.25rem;
268
+ }
263
269
  }
264
270
 
265
271
  .icon-button() {
266
272
  .input-icon();
273
+ pointer-events: auto;
267
274
 
268
275
  :host._readonly &,
269
276
  :host._disabled & {
@@ -296,21 +303,26 @@
296
303
  .icon-button();
297
304
  }
298
305
 
299
- // @bad TODO: Refactor this and interactive icons together
300
306
  .t-icon {
301
307
  .input-icon();
302
- pointer-events: none;
303
308
 
304
309
  &_left {
305
- margin: 0 0.375rem 0 -0.25rem;
306
- margin-inline-start: -0.25rem;
307
- margin-inline-end: 0.375rem;
310
+ :host[data-size='s'] & {
311
+ margin-inline-start: -0.375rem;
312
+ }
313
+
314
+ :host[data-size='m'] & {
315
+ margin-inline-start: -0.125rem;
316
+ margin-inline-end: 0.375rem;
317
+ }
308
318
 
309
319
  :host[data-size='l'] & {
310
- margin: 0 0.5rem 0 -0.25rem;
311
- margin-inline-start: -0.25rem;
312
- margin-inline-end: 0.5rem;
320
+ margin-inline-end: 0.75rem;
313
321
  }
314
322
  }
315
323
  }
324
+
325
+ .t-icons {
326
+ .input-icons();
327
+ }
316
328
  }
@@ -4,8 +4,8 @@ $line-height-l: 1.25rem;
4
4
  @include text-basic();
5
5
  position: relative;
6
6
  display: block;
7
- border-radius: var(--tui-radius-m);
8
7
  text-align: left;
8
+ border-radius: var(--tui-radius-m);
9
9
  height: var(--tui-height);
10
10
  min-height: var(--tui-height);
11
11
  max-height: var(--tui-height);
@@ -20,9 +20,8 @@ $line-height-l: 1.25rem;
20
20
 
21
21
  &[data-size='l'] {
22
22
  --tui-height: var(--tui-height-l);
23
-
24
23
  font: var(--tui-font-text-m);
25
- line-height: $line-height-l;
24
+ line-height: 1.25rem;
26
25
  }
27
26
  }
28
27
 
@@ -30,7 +29,6 @@ $line-height-l: 1.25rem;
30
29
  display: flex;
31
30
  height: 100%;
32
31
  width: 100%;
33
- padding: 0 var(--tui-padding-m);
34
32
  box-sizing: border-box;
35
33
  align-items: center;
36
34
  overflow: hidden;
@@ -39,17 +37,12 @@ $line-height-l: 1.25rem;
39
37
  padding: 0 var(--tui-padding-s);
40
38
  }
41
39
 
42
- :host[data-size='l'] & {
43
- padding: 0 var(--tui-padding-l);
44
- }
45
-
46
- &:after {
47
- content: '';
48
- margin-right: -0.25rem;
40
+ :host[data-size='m'] & {
41
+ padding: 0 var(--tui-padding-m);
49
42
  }
50
43
 
51
- :host[data-size='m'] &:after {
52
- display: none;
44
+ :host[data-size='l'] & {
45
+ padding: 0 var(--tui-padding-l);
53
46
  }
54
47
  }
55
48
 
@@ -57,9 +50,7 @@ $line-height-l: 1.25rem;
57
50
  @include text-basic();
58
51
  @include clearinput();
59
52
  @include fullsize();
60
- padding: 0 var(--tui-padding-m);
61
53
  border: solid transparent;
62
- border-width: 0 var(--border-end, 0) 0 var(--border-start, 0);
63
54
  border-inline-start-width: var(--border-start, 0);
64
55
  border-inline-end-width: var(--border-end, 0);
65
56
  text-indent: var(--text-indent);
@@ -69,11 +60,44 @@ $line-height-l: 1.25rem;
69
60
  overflow: hidden;
70
61
  text-transform: inherit;
71
62
  resize: none;
72
- text-overflow: ellipsis;
63
+
64
+ /* stylelint-disable */
65
+ /* Safari autofill icons */
66
+ //noinspection CssInvalidPseudoSelector
67
+ &:-webkit-autofill,
68
+ &:-webkit-autofill::first-line {
69
+ font-size: inherit;
70
+ line-height: inherit;
71
+ }
72
+ /* stylelint-enable */
73
+
74
+ //noinspection ALL
75
+ &::-webkit-caps-lock-indicator,
76
+ &::-webkit-contacts-auto-fill-button,
77
+ &::-webkit-credit-card-auto-fill-button,
78
+ &::-webkit-credentials-auto-fill-button,
79
+ &::-webkit-strong-password-auto-fill-button {
80
+ @include webkit-auto-fill-button-hidden();
81
+ }
82
+
83
+ &::placeholder {
84
+ color: var(--tui-text-03);
85
+ opacity: 0;
86
+ }
87
+
88
+ :host._focused:not(._readonly) &::placeholder,
89
+ :host-context(tui-primitive-textfield._focused:not(._readonly)) &::placeholder,
90
+ :host-context(tui-text-area._focused:not(._readonly)) &::placeholder {
91
+ opacity: 1;
92
+ }
73
93
 
74
94
  [tuiWrapper][data-mode='onDark'] &,
75
95
  :host-context([tuiWrapper][data-mode='onDark']) {
76
96
  @include autofill(dark);
97
+
98
+ &::placeholder {
99
+ color: var(--tui-text-03-night);
100
+ }
77
101
  }
78
102
 
79
103
  :host[data-size='s'] &,
@@ -82,6 +106,12 @@ $line-height-l: 1.25rem;
82
106
  padding: 0 var(--tui-padding-s);
83
107
  }
84
108
 
109
+ :host[data-size='m'] &,
110
+ :host-context(tui-primitive-textfield[data-size='m']):not(tui-primitive-textfield),
111
+ :host-context(tui-text-area[data-size='m']):not(tui-text-area) {
112
+ padding: 0 var(--tui-padding-m);
113
+ }
114
+
85
115
  :host[data-size='l'] &,
86
116
  :host-context(tui-primitive-textfield[data-size='l']):not(tui-primitive-textfield),
87
117
  :host-context(tui-text-area[data-size='l']):not(tui-text-area) {
@@ -91,13 +121,13 @@ $line-height-l: 1.25rem;
91
121
  :host._disabled &,
92
122
  :host-context(tui-primitive-textfield._disabled),
93
123
  :host-context(tui-text-area._disabled) {
94
- // $bad TODO: research why you can reach disabled textfield with mask inside a label without that
124
+ // @bad TODO: research why you can reach disabled textfield with mask inside a label without that
95
125
  pointer-events: none;
96
126
  }
97
127
 
98
128
  :host[data-size='l']:not(._label-outside) &,
99
129
  :host-context(tui-primitive-textfield[data-size='l']:not(._label-outside)):not(tui-primitive-textfield) {
100
- padding-top: $line-height-l;
130
+ padding-top: 1.25rem;
101
131
 
102
132
  // Workaround for raising placeholder in temporary autofill
103
133
  &:-webkit-autofill + .t-content .t-placeholder {
@@ -128,22 +158,17 @@ $line-height-l: 1.25rem;
128
158
  @mixin textfield-wrapper() {
129
159
  flex: 1;
130
160
  min-width: 0;
131
- padding-right: 0.25rem;
132
161
  padding-inline-end: 0.25rem;
133
- padding-inline-start: 0;
134
-
135
- & + * {
136
- margin: 0;
137
- }
138
162
  }
139
163
 
164
+ // TODO: Rename to label in 4.0
140
165
  @mixin textfield-placeholder() {
141
166
  @include transition('transform, font-size, color, letter-spacing');
142
- @include text-basic();
143
167
  @include text-overflow();
144
168
  display: block;
145
169
  width: 100%;
146
170
  user-select: none;
171
+ font: var(--tui-font-text-s);
147
172
  color: var(--tui-text-02);
148
173
  pointer-events: none;
149
174
  will-change: transform;
@@ -177,7 +202,8 @@ $line-height-l: 1.25rem;
177
202
  }
178
203
 
179
204
  :host[data-size='l'] & {
180
- font-size: 0.9375rem;
205
+ font: var(--tui-font-text-m);
206
+ line-height: 1.25rem;
181
207
 
182
208
  &_raised {
183
209
  font-size: 0.8156rem;
@@ -220,17 +246,33 @@ $line-height-l: 1.25rem;
220
246
  display: flex;
221
247
  width: 1.5rem;
222
248
  height: 1.5rem;
223
- margin: 0 0 0 0.25rem;
224
- margin-inline-start: 0.25rem;
225
- margin-inline-end: 0;
226
249
  align-items: center;
227
250
  justify-content: center;
228
251
  box-sizing: border-box;
229
252
  cursor: pointer;
253
+ pointer-events: none;
254
+ }
255
+
256
+ @mixin input-icons() {
257
+ display: flex;
258
+ align-items: center;
259
+
260
+ :host[data-size='m'] & {
261
+ margin-inline-end: -0.125rem;
262
+ }
263
+
264
+ :host[data-size='s'] & {
265
+ margin-inline-end: -0.375rem;
266
+ }
267
+
268
+ :host:not([data-size='s']) & > :not(:first-child) {
269
+ margin-inline-start: 0.25rem;
270
+ }
230
271
  }
231
272
 
232
273
  @mixin icon-button() {
233
274
  @include input-icon();
275
+ pointer-events: auto;
234
276
 
235
277
  :host._readonly &,
236
278
  :host._disabled & {
@@ -263,19 +305,26 @@ $line-height-l: 1.25rem;
263
305
  @include icon-button();
264
306
  }
265
307
 
266
- // $bad TODO: Refactor this and interactive icons together
267
308
  .t-icon {
268
309
  @include input-icon();
269
310
 
270
311
  &_left {
271
- margin: 0 2 * $space 0 -$space;
272
- margin-inline-start: -$space;
273
- margin-inline-end: 2 * $space;
274
-
275
312
  :host[data-size='s'] & {
276
- margin-right: $space;
277
- margin-inline-end: $space;
313
+ margin-inline-start: -0.375rem;
314
+ }
315
+
316
+ :host[data-size='m'] & {
317
+ margin-inline-start: -0.125rem;
318
+ margin-inline-end: 0.375rem;
319
+ }
320
+
321
+ :host[data-size='l'] & {
322
+ margin-inline-end: 0.75rem;
278
323
  }
279
324
  }
280
325
  }
326
+
327
+ .t-icons {
328
+ @include input-icons();
329
+ }
281
330
  }
@@ -1,8 +1,16 @@
1
1
  import { Provider } from '@angular/core';
2
2
  import { TuiAlertOptions } from '@taiga-ui/core/interfaces';
3
+ import { TuiSizeL, TuiSizeS } from '@taiga-ui/core/types';
3
4
  export interface TuiNotificationDefaultOptions extends Omit<TuiAlertOptions<unknown>, 'data'> {
4
- readonly defaultAutoCloseTime: number;
5
+ size: TuiSizeL | TuiSizeS;
5
6
  }
7
+ /** @deprecated remove export */
8
+ export declare const STATUS_ICON: {
9
+ readonly info: "tuiIconInfo";
10
+ readonly success: "tuiIconCheckCircle";
11
+ readonly error: "tuiIconXCircle";
12
+ readonly warning: "tuiIconAlertCircle";
13
+ };
6
14
  /** Default values for the notification options. */
7
15
  export declare const TUI_NOTIFICATION_DEFAULT_OPTIONS: TuiNotificationDefaultOptions;
8
16
  /**
package/types/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export * from './dropdown-align';
8
8
  export * from './dropdown-width';
9
9
  export * from './hint-direction';
10
10
  export * from './marker-handler';
11
+ export * from './notification';
11
12
  export * from './option-role';
12
13
  export * from './orientation';
13
14
  export * from './point';
@@ -0,0 +1 @@
1
+ export declare type TuiNotificationT = 'error' | 'info' | 'success' | 'warning';
@@ -1 +1,2 @@
1
- export declare function tuiGetBorder(hasIcon: boolean, hasCleaner?: boolean, hasTooltip?: boolean, hasContent?: boolean): number;
1
+ import { TuiSizeL, TuiSizeS } from '@taiga-ui/core/types';
2
+ export declare function tuiGetBorder(hasIcon: boolean, hasCleaner?: boolean, hasTooltip?: boolean, hasContent?: boolean, size?: TuiSizeL | TuiSizeS): number;