@itwin/itwinui-css 0.29.1 → 0.33.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 (39) hide show
  1. package/css/all.css +852 -262
  2. package/css/button.css +12 -0
  3. package/css/color-picker.css +132 -0
  4. package/css/date-picker.css +2 -3
  5. package/css/expandable-block.css +1 -1
  6. package/css/information-panel.css +126 -0
  7. package/css/inputs.css +194 -138
  8. package/css/menu.css +5 -2
  9. package/css/notification-marker.css +218 -0
  10. package/css/side-navigation.css +53 -0
  11. package/css/table.css +2 -2
  12. package/css/time-picker.css +84 -50
  13. package/css/toast-notification.css +3 -37
  14. package/package.json +4 -3
  15. package/scss/button/default.scss +2 -0
  16. package/scss/classes.scss +4 -1
  17. package/scss/color-picker/classes.scss +35 -0
  18. package/scss/color-picker/color-picker.scss +191 -0
  19. package/scss/color-picker/index.scss +3 -0
  20. package/scss/date-picker/date-picker.scss +2 -3
  21. package/scss/index.scss +4 -1
  22. package/scss/information-panel/classes.scss +19 -0
  23. package/scss/information-panel/index.scss +3 -0
  24. package/scss/information-panel/information-panel.scss +189 -0
  25. package/scss/inputs/classes.scss +30 -1
  26. package/scss/inputs/labeled-inputs.scss +215 -119
  27. package/scss/menu/classes.scss +4 -0
  28. package/scss/menu/menu.scss +8 -2
  29. package/scss/notification-marker/classes.scss +9 -0
  30. package/scss/notification-marker/index.scss +3 -0
  31. package/scss/notification-marker/notification-marker.scss +63 -0
  32. package/scss/side-navigation/classes.scss +8 -0
  33. package/scss/side-navigation/side-navigation.scss +55 -0
  34. package/scss/style/mixins.scss +1 -1
  35. package/scss/style/ripple.scss +18 -0
  36. package/scss/table/column-filter.scss +1 -1
  37. package/scss/time-picker/classes.scss +9 -0
  38. package/scss/time-picker/time-picker.scss +37 -36
  39. package/scss/toast-notification/classes.scss +0 -35
@@ -0,0 +1,189 @@
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 iui-information-panel-wrapper {
6
+ position: relative;
7
+ overflow: hidden;
8
+ }
9
+
10
+ @mixin iui-information-panel {
11
+ position: absolute;
12
+ opacity: 0;
13
+ display: flex;
14
+ flex-direction: column;
15
+ box-sizing: border-box;
16
+ z-index: 2; // Needs to be higher than table's column resizers.
17
+ @include themed {
18
+ background-color: t(iui-color-background-1);
19
+ }
20
+
21
+ > .iui-resizer {
22
+ display: none;
23
+ position: absolute;
24
+ touch-action: none;
25
+ z-index: 1000;
26
+
27
+ > .iui-resizer-bar {
28
+ @include themed {
29
+ background-color: t(iui-color-background-5);
30
+ }
31
+ }
32
+
33
+ &:hover > .iui-resizer-bar {
34
+ @include themed {
35
+ background-color: t(iui-color-foreground-primary);
36
+ }
37
+ }
38
+ }
39
+
40
+ &.iui-information-panel-visible {
41
+ opacity: 1;
42
+
43
+ > .iui-resizer {
44
+ display: flex;
45
+ }
46
+ }
47
+
48
+ .iui-information-header,
49
+ .iui-information-body {
50
+ padding-left: $iui-sm;
51
+ padding-right: $iui-sm;
52
+ box-sizing: border-box;
53
+ }
54
+
55
+ .iui-information-header {
56
+ height: $iui-baseline * 6;
57
+ display: flex;
58
+ align-items: center;
59
+ justify-content: space-between;
60
+ @include themed {
61
+ background-color: t(iui-color-background-3);
62
+ }
63
+
64
+ .iui-information-header-label {
65
+ display: flex;
66
+ align-items: center;
67
+ overflow: hidden;
68
+
69
+ > * {
70
+ white-space: nowrap;
71
+ overflow: hidden;
72
+ text-overflow: ellipsis;
73
+ user-select: all;
74
+ }
75
+
76
+ svg {
77
+ display: flex;
78
+ width: $iui-icons-large;
79
+ height: $iui-icons-large;
80
+ margin-right: $iui-s;
81
+ @include themed {
82
+ fill: t(iui-icons-color);
83
+ }
84
+ }
85
+ }
86
+
87
+ .iui-information-header-actions {
88
+ flex-shrink: 0;
89
+ margin-left: $iui-s;
90
+ }
91
+ }
92
+
93
+ .iui-information-body {
94
+ padding-top: $iui-baseline;
95
+ padding-bottom: $iui-baseline;
96
+ height: 100%;
97
+ overflow-x: hidden;
98
+ overflow-y: overlay;
99
+
100
+ > hr {
101
+ @include themed {
102
+ border-color: t(iui-color-background-4);
103
+ }
104
+ }
105
+ }
106
+ }
107
+
108
+ @mixin iui-information-panel-vertical {
109
+ top: 0;
110
+ width: $iui-3xl * 4;
111
+ min-width: $iui-3xl * 2;
112
+ height: 100%;
113
+
114
+ > .iui-resizer {
115
+ height: 100%;
116
+ width: $iui-m;
117
+ top: 0;
118
+ cursor: ew-resize;
119
+ justify-content: center;
120
+
121
+ > .iui-resizer-bar {
122
+ height: 100%;
123
+ width: 1px;
124
+ @media (prefers-reduced-motion: no-preference) {
125
+ transition: background-color $iui-speed-fast ease-out, width $iui-speed-fast ease-out;
126
+ }
127
+ }
128
+
129
+ &:hover > .iui-resizer-bar {
130
+ width: $iui-xs;
131
+ }
132
+ }
133
+ }
134
+ @mixin iui-information-panel-horizontal {
135
+ left: 0;
136
+ height: $iui-3xl * 4;
137
+ min-height: $iui-3xl * 2;
138
+ width: 100%;
139
+
140
+ > .iui-resizer {
141
+ width: 100%;
142
+ height: $iui-m;
143
+ left: 0;
144
+ cursor: ns-resize;
145
+ align-items: center;
146
+
147
+ > .iui-resizer-bar {
148
+ width: 100%;
149
+ height: 1px;
150
+ @media (prefers-reduced-motion: no-preference) {
151
+ transition: background-color $iui-speed-fast ease-out, height $iui-speed-fast ease-out;
152
+ }
153
+ }
154
+
155
+ &:hover > .iui-resizer-bar {
156
+ height: $iui-xs;
157
+ }
158
+ }
159
+ }
160
+
161
+ @mixin iui-information-panel-right {
162
+ @include iui-information-panel-vertical;
163
+ right: ($iui-3xl * 4) * -1; // Default width set negative so the panel hides off screen.
164
+ box-shadow: -1px 0 14px rgba(0, 0, 0, 0.25);
165
+ transition: right $iui-speed-fast ease-out, opacity $iui-speed-fast ease;
166
+
167
+ > .iui-resizer {
168
+ left: ($iui-m * 0.5) * -1;
169
+ }
170
+
171
+ &.iui-information-panel-visible {
172
+ right: 0;
173
+ }
174
+ }
175
+
176
+ @mixin iui-information-panel-bottom {
177
+ @include iui-information-panel-horizontal;
178
+ bottom: ($iui-3xl * 4) * -1; // Default height set negative so the panel hides off screen.
179
+ box-shadow: 0 -1px 14px rgba(0, 0, 0, 0.25);
180
+ transition: bottom $iui-speed-fast ease-out, opacity $iui-speed-fast ease;
181
+
182
+ > .iui-resizer {
183
+ top: ($iui-m * 0.5) * -1;
184
+ }
185
+
186
+ &.iui-information-panel-visible {
187
+ bottom: 0;
188
+ }
189
+ }
@@ -4,6 +4,36 @@
4
4
 
5
5
  .iui-input-container {
6
6
  @include iui-input-container;
7
+
8
+ > .iui-label {
9
+ @include iui-input-label;
10
+ }
11
+
12
+ .iui-input-icon {
13
+ @include iui-input-icon;
14
+ }
15
+
16
+ .iui-message {
17
+ @include iui-input-message;
18
+ }
19
+
20
+ &.iui-inline-label {
21
+ > .iui-label {
22
+ @include iui-input-label-inline;
23
+ }
24
+ }
25
+
26
+ &.iui-inline-icon {
27
+ .iui-input-icon {
28
+ @include iui-input-icon-inline;
29
+ }
30
+ }
31
+
32
+ @each $status in positive, negative, warning {
33
+ &.iui-#{$status} {
34
+ @include iui-input-status($status: $status);
35
+ }
36
+ }
7
37
  }
8
38
 
9
39
  .iui-input {
@@ -29,4 +59,3 @@
29
59
  .iui-radio-tile-container {
30
60
  @include iui-radio-tile;
31
61
  }
32
-
@@ -2,17 +2,62 @@
2
2
  // See LICENSE.md in the project root for license terms and full copyright notice.
3
3
  @import '../style/index';
4
4
  @import '../icon/index';
5
+ @import '../style/ripple';
5
6
 
7
+ /// Container for grouping inputs with a label, an icon and a status message.
8
+ /// Supported modifiers: .iui-inline-label, .iui-inline-icon and .iui-with-message
6
9
  @mixin iui-input-container {
7
10
  @include iui-reset;
8
- display: flex;
9
- flex-direction: column;
10
- position: relative;
11
- text-align: left;
12
- font-weight: $iui-font-weight-normal;
11
+ display: grid;
12
+ grid-template:
13
+ 'label label'
14
+ 'inputs inputs' / auto 1fr;
15
+
16
+ &.iui-inline-icon:not(.iui-inline-label) .iui-input-icon {
17
+ // stylelint-disable -- fix position in IE
18
+ -ms-grid-row: 2;
19
+ -ms-grid-column: 2;
20
+ // stylelint-enable
21
+ }
22
+
23
+ &.iui-inline-icon {
24
+ > .iui-input,
25
+ > .iui-textarea {
26
+ padding-right: $iui-icons-default + $iui-l;
27
+
28
+ &:last-child {
29
+ padding-right: $iui-sm;
30
+ }
31
+ }
32
+ }
33
+
34
+ &.iui-with-message {
35
+ grid-template:
36
+ 'label label'
37
+ 'inputs inputs'
38
+ 'icon message' / auto 1fr;
39
+
40
+ // add margin to the icon if it is below input
41
+ &:not(.iui-inline-icon) .iui-input-icon {
42
+ margin-top: $iui-component-offset;
43
+ }
44
+ }
45
+
46
+ .iui-input,
47
+ .iui-textarea,
48
+ .iui-input-group,
49
+ .iui-select {
50
+ grid-area: inputs;
51
+ // stylelint-disable -- fix position in IE
52
+ -ms-grid-row: 2;
53
+ -ms-grid-column: 1;
54
+ -ms-grid-column-span: 2;
55
+ // stylelint-enable
56
+ }
57
+
58
+ // #region Cursors
13
59
  cursor: default;
14
60
 
15
- // Pointer cursor used if this class is applied to a label element
16
61
  @at-root {
17
62
  label#{&} {
18
63
  cursor: pointer;
@@ -28,177 +73,228 @@
28
73
  cursor: not-allowed;
29
74
  }
30
75
  }
76
+ // #endregion
77
+
78
+ // Appropriate spacing even if no text label is given
79
+ .iui-checkbox,
80
+ .iui-radio {
81
+ min-height: $iui-line-height;
82
+ }
31
83
 
32
- > .iui-label {
33
- margin-bottom: $iui-component-offset;
34
- font-weight: $iui-font-weight-semibold;
84
+ &.iui-inline-label {
85
+ grid-template: 'label inputs icon' / auto 1fr auto;
35
86
 
36
- &.iui-required {
37
- &::after {
38
- content: ' *';
39
- @include themed {
40
- color: t(iui-color-foreground-negative);
41
- }
87
+ // IE fix icon position for inline checkboxes/radios group
88
+ @at-root {
89
+ div#{&} {
90
+ // stylelint-disable -- fix position in IE
91
+ -ms-grid-columns: auto min-content auto;
92
+ // stylelint-enable
42
93
  }
43
94
  }
44
- }
45
95
 
46
- > .iui-message {
47
- display: flex;
48
- width: fit-content;
49
- align-items: center;
50
- font-size: $iui-font-size-small;
51
- line-height: $iui-line-height;
52
- margin-top: $iui-component-offset;
53
- @include themed {
54
- color: t(iui-text-color-muted);
96
+ .iui-input,
97
+ .iui-textarea,
98
+ .iui-input-group,
99
+ .iui-select {
100
+ // stylelint-disable -- fix position in IE
101
+ -ms-grid-row: 1;
102
+ -ms-grid-column: 2;
103
+ // stylelint-enable
55
104
  }
56
105
 
57
- svg {
58
- width: $iui-icons-default;
59
- height: $iui-icons-default;
60
- display: flex; // needed for vertical alignment of webcomponents
61
- margin-right: $iui-xs;
62
- @include themed {
63
- fill: t(iui-icons-color);
64
- }
106
+ .iui-input-icon {
107
+ // stylelint-disable -- fix position in IE
108
+ -ms-grid-row: 1;
109
+ -ms-grid-column: 3;
110
+ // stylelint-enable
65
111
  }
66
112
 
67
- > .iui-borderless {
68
- border-top-left-radius: 0;
69
- border-bottom-left-radius: 0;
113
+ &.iui-with-message {
114
+ grid-template:
115
+ 'label inputs inputs'
116
+ '. icon message' / auto auto 1fr;
70
117
 
71
- svg {
72
- @include themed {
73
- fill: t(iui-icons-color-actionable);
74
- }
118
+ &:not(.iui-inline-icon) .iui-input-icon {
119
+ // stylelint-disable -- fix position in IE
120
+ -ms-grid-row: 2;
121
+ -ms-grid-column: 2;
122
+ // stylelint-enable
75
123
  }
76
- }
77
124
 
78
- a {
79
- user-select: none;
125
+ .iui-message {
126
+ // stylelint-disable -- fix position in IE
127
+ -ms-grid-row: 2;
128
+ -ms-grid-column: 3;
129
+ // stylelint-enable
130
+ }
80
131
  }
81
- }
82
-
83
- // Appropriate spacing even if no text label is given
84
- > .iui-checkbox,
85
- > .iui-radio {
86
- min-height: $iui-line-height;
87
- }
88
132
 
89
- &.iui-inline {
90
- flex-direction: row;
91
- align-items: center;
133
+ > .iui-input-group {
134
+ display: flex;
135
+ gap: $iui-m;
92
136
 
93
- > .iui-label {
94
- flex-shrink: 0;
95
- margin: 0 $iui-m 0 0;
137
+ > .iui-checkbox,
138
+ > .iui-radio,
139
+ > .iui-toggle-switch {
140
+ margin-right: $iui-m;
96
141
 
97
- &.iui-required {
98
- margin-right: $iui-xs * 1.5;
142
+ @supports (gap: $iui-m) {
143
+ margin-right: 0;
144
+ }
99
145
  }
100
- }
101
146
 
102
- > .iui-checkbox:not(:last-child),
103
- > .iui-radio:not(:last-child),
104
- > .iui-toggle-switch:not(:last-child) {
105
- margin-right: $iui-m;
147
+ &:not(:last-child) {
148
+ margin-right: $iui-m;
149
+ }
106
150
  }
151
+ }
152
+ }
107
153
 
108
- > .iui-message {
109
- margin: 0;
110
-
111
- svg:not(.iui-icon) {
112
- margin-right: 0;
154
+ /// Text label for an input.
155
+ /// Supports .iui-required modifier to show red asterisk.
156
+ @mixin iui-input-label {
157
+ font-weight: $iui-font-weight-semibold;
158
+ grid-area: label;
159
+ align-self: center;
160
+ margin-bottom: $iui-component-offset;
161
+
162
+ &.iui-required {
163
+ &::after {
164
+ content: ' *';
165
+ @include themed {
166
+ color: t(iui-color-foreground-negative);
113
167
  }
114
168
  }
169
+ }
170
+ }
115
171
 
116
- > .iui-input,
117
- > .iui-textarea {
118
- padding-right: $iui-icons-default + $iui-l;
172
+ /// Modifier on iui-input-label to place it inline.
173
+ @mixin iui-input-label-inline {
174
+ margin: 0 $iui-m 0 0;
175
+ // stylelint-disable -- fix position in IE
176
+ -ms-grid-column-span: 1;
177
+ // stylelint-enable
119
178
 
120
- + .iui-message {
121
- position: absolute;
122
- top: 50%;
123
- right: 0;
124
- transform: translateY(-50%);
179
+ &.iui-required {
180
+ margin-right: $iui-xs * 1.5;
181
+ }
182
+ }
125
183
 
126
- svg:not(.iui-icon) {
127
- margin-right: $iui-sm;
128
- }
129
- }
184
+ /// Message shown below input
185
+ @mixin iui-input-message {
186
+ font-size: $iui-font-size-small;
187
+ grid-area: message;
188
+ margin-top: $iui-component-offset;
189
+ @include themed {
190
+ color: t(iui-text-color-muted);
191
+ }
130
192
 
131
- &:last-child {
132
- padding-right: $iui-sm;
133
- }
134
- }
193
+ a {
194
+ user-select: none;
195
+ }
196
+ }
197
+
198
+ /// Icon to be shown near an input.
199
+ @mixin iui-input-icon {
200
+ display: flex;
201
+ grid-area: icon;
202
+ width: $iui-icons-default;
203
+ height: $iui-icons-default;
204
+ align-self: center;
205
+ @include themed {
206
+ fill: t(iui-icons-color);
135
207
  }
136
208
 
137
- // #region Statuses
138
- &.iui-positive {
139
- @include iui-inputs-status(
140
- iui-color-foreground-positive,
141
- iui-color-foreground-positive-overlay,
142
- iui-color-foreground-positive-rgb
143
- );
209
+ &:not(:last-child) {
210
+ margin-right: $iui-xs;
144
211
  }
212
+ }
213
+
214
+ /// Modifier on iui-input-icon to place it at the end of input.
215
+ @mixin iui-input-icon-inline {
216
+ // stylelint-disable -- fix position in IE
217
+ -ms-grid-row: 1;
218
+ -ms-grid-column: 3;
219
+ // stylelint-enable
145
220
 
146
- &.iui-warning {
147
- @include iui-inputs-status(
148
- iui-color-foreground-warning,
149
- iui-color-foreground-warning-overlay,
150
- iui-color-foreground-warning-rgb
151
- );
221
+ grid-area: inputs;
222
+ justify-self: end;
223
+ margin: 0 $iui-sm 0 0;
224
+ position: relative;
225
+
226
+ &.iui-button {
227
+ height: 100%;
228
+ width: fit-content;
229
+ margin-right: 0;
230
+ border-top-left-radius: 0;
231
+ border-bottom-left-radius: 0;
152
232
  }
153
233
 
154
- &.iui-negative {
155
- @include iui-inputs-status(
156
- iui-color-foreground-negative,
157
- iui-color-foreground-negative-overlay,
158
- iui-color-foreground-negative-rgb
159
- );
234
+ &.iui-actionable {
235
+ align-items: center;
236
+ height: 90%;
237
+ margin-right: 1px;
238
+ padding: 0 $iui-sm;
239
+ cursor: pointer;
240
+
241
+ @include iui-ripple(var(--iui-color-background-1), var(--iui-color-background-2));
242
+
243
+ svg {
244
+ width: $iui-icons-default;
245
+ height: $iui-icons-default;
246
+ @include themed {
247
+ fill: t(iui-icons-color);
248
+ }
249
+ transition: transform $iui-speed-fast ease-out;
250
+ }
251
+
252
+ &.iui-open svg {
253
+ transform: rotate(180deg); // transform for arrow icon (e.g. svg-caret-down), used in combobox
254
+ }
160
255
  }
161
- // #endregion
162
256
  }
163
257
 
164
- @mixin iui-inputs-status($foregroundColor, $foregroundOverlay, $foregroundRgb) {
258
+ /// Mixin for applying status colors to input container.
259
+ /// @arg status - must be one of: positive, negative, warning
260
+ /// @arg iconSelector - selector to apply status fill on. Defaults to .iui-input-icon
261
+ /// @arg textSelector - selector to apply text color on. Defaults to .iui-message
262
+ @mixin iui-input-status($status, $iconSelector: '.iui-input-icon', $textSelector: '.iui-message') {
165
263
  *::selection {
166
264
  @include themed {
167
- background-color: rgba(t($foregroundRgb), t(iui-opacity-4));
265
+ background-color: rgba(t(iui-color-foreground-#{$status}-rgb), t(iui-opacity-4));
168
266
  }
169
267
  }
170
268
 
171
- > .iui-message {
269
+ #{$iconSelector} {
172
270
  @include themed {
173
- color: t($foregroundColor);
271
+ fill: t(iui-color-foreground-#{$status});
174
272
  }
273
+ }
175
274
 
176
- svg {
177
- @include themed {
178
- fill: t($foregroundColor);
179
- }
275
+ #{$textSelector} {
276
+ @include themed {
277
+ color: t(iui-color-foreground-#{$status});
180
278
  }
181
279
 
182
280
  a {
183
281
  text-decoration: underline;
184
282
 
185
283
  @include themed {
186
- color: t($foregroundColor);
284
+ color: t(iui-color-foreground-#{$status});
187
285
  }
188
286
 
189
287
  &:hover {
190
288
  text-decoration: none;
191
289
 
192
290
  @include themed {
193
- color: t($foregroundOverlay);
291
+ color: t(iui-color-foreground-#{$status}-overlay);
194
292
  }
195
293
  }
196
294
  }
197
295
  }
198
296
 
199
- > input,
200
297
  > .iui-input,
201
- > textarea,
202
298
  > .iui-textarea,
203
299
  > .iui-select > .iui-select-button {
204
300
  padding-bottom: $iui-component-padding-vertical - 1px;
@@ -212,13 +308,13 @@
212
308
  }
213
309
 
214
310
  @include themed {
215
- border-bottom: 2px solid t($foregroundColor);
311
+ border-bottom: $iui-xxs solid t(iui-color-foreground-#{$status});
216
312
  }
217
313
 
218
314
  &:focus {
219
315
  @include themed {
220
- border-bottom: 2px solid t($foregroundColor);
221
- box-shadow: rgba(t($foregroundRgb), t(iui-opacity-5)) 0 0 0 2px;
316
+ border-bottom: $iui-xxs solid t(iui-color-foreground-#{$status});
317
+ box-shadow: rgba(t(iui-color-foreground-#{$status}-rgb), t(iui-opacity-5)) 0 0 0 $iui-xxs;
222
318
  }
223
319
  }
224
320
  }
@@ -11,6 +11,10 @@
11
11
  @include iui-menu-item;
12
12
  }
13
13
 
14
+ .iui-menu-content {
15
+ @include iui-menu-content;
16
+ }
17
+
14
18
  .iui-menu-divider {
15
19
  @include iui-menu-divider;
16
20
  }
@@ -92,7 +92,8 @@ $iui-active-outline: thin solid t(iui-color-foreground-primary);
92
92
  }
93
93
  }
94
94
 
95
- &:focus {
95
+ &:focus,
96
+ &.iui-focused {
96
97
  @include themed {
97
98
  outline: $iui-active-outline;
98
99
  outline-offset: -1px;
@@ -130,7 +131,8 @@ $iui-active-outline: thin solid t(iui-color-foreground-primary);
130
131
  }
131
132
  }
132
133
 
133
- &:focus {
134
+ &:focus,
135
+ &.iui-focused {
134
136
  outline-width: $iui-xxs;
135
137
  outline-offset: -2px;
136
138
  }
@@ -160,6 +162,10 @@ $iui-active-outline: thin solid t(iui-color-foreground-primary);
160
162
  }
161
163
  }
162
164
 
165
+ @mixin iui-menu-content {
166
+ padding: $iui-baseline ($iui-component-padding-horizontal + 1px);
167
+ }
168
+
163
169
  @mixin iui-menu-divider {
164
170
  height: 1px;
165
171
  width: calc(100% - #{$iui-l});