@itwin/itwinui-css 0.45.0 → 0.46.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.
@@ -0,0 +1,36 @@
1
+ // Copyright (c) Bentley Systems, Incorporated. All rights reserved.
2
+ // See LICENSE.md in the project root for license terms and full copyright notice.
3
+ @import '../style/index';
4
+
5
+ // Mixin to have inputs combined with icon (eg. select)
6
+ @mixin iui-input-with-icon {
7
+ display: grid;
8
+ align-items: center;
9
+ cursor: pointer;
10
+
11
+ > :first-child {
12
+ grid-area: 1 / -1;
13
+ padding-right: $iui-icons-default + $iui-l;
14
+ }
15
+
16
+ &:focus-within {
17
+ > :first-child {
18
+ // --_focus-color can be used to control this from outside
19
+ outline: 2px solid var(--_focus-color, var(--iui-color-foreground-primary));
20
+ outline-offset: -2px;
21
+ }
22
+ }
23
+
24
+ &:hover {
25
+ > :first-child {
26
+ // --_hover-color can be used to control this from outside
27
+ border-color: var(--_hover-color, rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-2)));
28
+ }
29
+ }
30
+ }
31
+
32
+ @mixin iui-end-icon {
33
+ @include iui-input-icon-inline;
34
+ display: flex;
35
+ grid-area: 1 / -1;
36
+ }
@@ -63,6 +63,7 @@
63
63
  border-color: t(iui-color-background-disabled);
64
64
  }
65
65
  cursor: not-allowed;
66
+ --_hover-color: var(--iui-color-background-disabled);
66
67
  }
67
68
  }
68
69
 
@@ -44,9 +44,9 @@
44
44
  }
45
45
 
46
46
  .iui-input,
47
+ .iui-input-with-icon,
47
48
  .iui-textarea,
48
- .iui-input-group,
49
- .iui-select {
49
+ .iui-input-group {
50
50
  grid-area: inputs;
51
51
  // stylelint-disable -- fix position in IE
52
52
  -ms-grid-row: 2;
@@ -84,9 +84,9 @@
84
84
  }
85
85
 
86
86
  .iui-input,
87
+ .iui-input-with-icon,
87
88
  .iui-textarea,
88
- .iui-input-group,
89
- .iui-select {
89
+ .iui-input-group {
90
90
  // stylelint-disable -- fix position in IE
91
91
  -ms-grid-row: 1;
92
92
  -ms-grid-column: 2;
@@ -220,7 +220,7 @@
220
220
  }
221
221
  }
222
222
 
223
- /// Icon to be shown near an input.
223
+ /// Icon to be shown near a message.
224
224
  @mixin iui-input-icon {
225
225
  display: flex;
226
226
  grid-area: icon;
@@ -245,9 +245,14 @@
245
245
 
246
246
  grid-area: inputs;
247
247
  justify-self: end;
248
- margin: 0 $iui-sm 0 0;
248
+ margin: 0 ($iui-sm + $iui-xxs) 0 0;
249
249
  position: relative;
250
250
 
251
+ svg {
252
+ width: $iui-icons-default;
253
+ height: $iui-icons-default;
254
+ }
255
+
251
256
  &.iui-button {
252
257
  height: 100%;
253
258
  width: fit-content;
@@ -259,15 +264,13 @@
259
264
  &.iui-actionable {
260
265
  align-items: center;
261
266
  height: 90%;
262
- margin-right: 1px;
267
+ margin-right: $iui-xxs;
263
268
  padding: 0 $iui-sm;
264
269
  cursor: pointer;
265
270
 
266
271
  @include iui-ripple(var(--iui-color-background-1), var(--iui-color-background-2));
267
272
 
268
273
  svg {
269
- width: $iui-icons-default;
270
- height: $iui-icons-default;
271
274
  @include themed {
272
275
  fill: t(iui-icons-color);
273
276
  }
@@ -278,6 +281,16 @@
278
281
  transform: rotate(180deg); // transform for arrow icon (e.g. svg-caret-down), used in combobox
279
282
  }
280
283
  }
284
+
285
+ &.iui-disabled {
286
+ cursor: not-allowed;
287
+
288
+ svg {
289
+ @include themed {
290
+ fill: t(iui-icons-color-actionable-disabled);
291
+ }
292
+ }
293
+ }
281
294
  }
282
295
 
283
296
  /// Mixin for applying status colors to input container.
@@ -319,9 +332,8 @@
319
332
  }
320
333
  }
321
334
 
322
- > .iui-input,
323
- > .iui-textarea,
324
- > .iui-select > .iui-select-button {
335
+ .iui-input,
336
+ .iui-textarea {
325
337
  padding-bottom: $iui-component-padding-vertical - 1px;
326
338
 
327
339
  &.iui-small {
@@ -344,4 +356,25 @@
344
356
  }
345
357
  }
346
358
  }
359
+
360
+ .iui-input-with-icon {
361
+ --_hover-color: var(--iui-color-foreground-#{$status});
362
+ --_focus-color: var(--iui-color-foreground-#{$status});
363
+ }
364
+
365
+ .iui-select-button {
366
+ border-bottom: transparent;
367
+
368
+ &::after {
369
+ content: '';
370
+ width: 100%;
371
+ position: absolute;
372
+ bottom: 0;
373
+ left: 0;
374
+ height: $iui-xxs;
375
+ @include themed {
376
+ background-color: t(iui-color-foreground-#{$status});
377
+ }
378
+ }
379
+ }
347
380
  }
@@ -3,113 +3,64 @@
3
3
  @import '../style/index';
4
4
  @import '../menu/index';
5
5
 
6
- $iui-after-border: 5px solid;
6
+ @mixin iui-select-button {
7
+ @include iui-focus($offset: -2px, $thickness: 2px);
8
+ width: 100%;
9
+ margin: 0;
10
+ border-radius: $iui-border-radius;
11
+ box-sizing: border-box;
12
+ padding: $iui-component-padding-vertical $iui-component-padding-horizontal;
13
+ min-height: $iui-component-height;
14
+ transition: border-color $iui-speed-fast ease-out;
7
15
 
8
- @mixin iui-select {
9
- @include iui-reset;
10
16
  display: flex;
11
- flex-direction: column;
17
+ align-items: center;
18
+ user-select: none;
12
19
  position: relative;
13
- width: 100%;
14
- min-width: 0;
15
-
16
- > .iui-select-button {
17
- @include iui-input;
18
- @include iui-focus($offset: -2px, $thickness: 2px);
19
- display: flex;
20
- align-items: center;
21
- min-height: $iui-component-height;
22
- padding-right: $iui-xl;
23
- user-select: none;
24
- position: relative;
25
- @media (prefers-reduced-motion: no-preference) {
26
- transition: border-color $iui-speed-fast ease-out;
27
- }
28
-
29
- > .iui-icon {
30
- @include iui-menu-icon;
31
- }
32
-
33
- > .iui-content {
34
- overflow: hidden;
35
- white-space: nowrap;
36
- text-overflow: ellipsis;
37
- }
38
-
39
- &.iui-placeholder {
40
- @include themed {
41
- color: t(iui-text-color-placeholder);
42
- }
43
- }
44
-
45
- &::after {
46
- content: '';
47
- position: absolute;
48
- top: 50%;
49
- right: $iui-m;
50
- transform: translateY(-50%);
51
- width: 0;
52
- height: 0;
53
- border-left: $iui-after-border transparent;
54
- border-right: $iui-after-border transparent;
55
- @include themed {
56
- border-top: $iui-after-border t(iui-icons-color-actionable);
57
- }
58
- }
59
-
60
- &:hover {
61
- @include themed {
62
- border-color: rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-2));
63
- }
64
-
65
- &::after {
66
- border-bottom: none;
67
- @include themed {
68
- border-top: $iui-after-border t(iui-icons-color-actionable-hover);
69
- }
70
- }
71
- }
20
+ overflow: hidden;
72
21
 
73
- &.iui-active {
74
- &::after {
75
- border-top: none;
76
- @include themed {
77
- border-bottom: $iui-after-border t(iui-icons-color-actionable);
78
- }
79
- }
80
-
81
- &:hover::after {
82
- @include themed {
83
- border-bottom: $iui-after-border t(iui-icons-color-actionable-hover);
84
- }
85
- }
86
- }
87
-
88
- &.iui-disabled {
89
- cursor: not-allowed;
90
- @include themed {
91
- background-color: t(iui-color-background-disabled);
92
- border-color: t(iui-color-background-disabled);
93
- }
94
-
95
- &::after {
96
- @include themed {
97
- border-top: $iui-after-border t(iui-icons-color-actionable-disabled);
98
- }
99
- }
100
- }
22
+ @include themed {
23
+ color: t(iui-text-color);
24
+ background-color: t(iui-color-background-1);
25
+ border: 1px solid rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-4));
101
26
  }
102
27
 
103
- &.iui-small .iui-select-button {
28
+ &.iui-small {
104
29
  padding-top: $iui-component-padding-vertical-small;
105
30
  padding-bottom: $iui-component-padding-vertical-small;
106
31
  min-height: $iui-component-height-small;
107
32
  }
108
33
 
109
- &.iui-large .iui-select-button {
34
+ &.iui-large {
110
35
  padding-top: $iui-component-padding-vertical-large;
111
36
  padding-bottom: $iui-component-padding-vertical-large;
112
37
  min-height: $iui-component-height-large;
113
38
  font-size: $iui-font-size-leading;
114
39
  }
40
+
41
+ &.iui-disabled {
42
+ @include themed {
43
+ background-color: t(iui-color-background-disabled);
44
+ border-color: t(iui-color-background-disabled);
45
+ }
46
+ --_hover-color: var(--iui-color-background-disabled);
47
+ cursor: not-allowed;
48
+ }
49
+
50
+ .iui-icon {
51
+ @include iui-menu-icon;
52
+ fill: currentColor;
53
+ }
54
+
55
+ .iui-content {
56
+ overflow: hidden;
57
+ white-space: nowrap;
58
+ text-overflow: ellipsis;
59
+ }
60
+
61
+ &.iui-placeholder {
62
+ @include themed {
63
+ color: t(iui-text-color-placeholder);
64
+ }
65
+ }
115
66
  }