@itwin/itwinui-css 0.49.0 → 0.51.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 (63) hide show
  1. package/css/alert.css +232 -174
  2. package/css/all.css +7251 -5567
  3. package/css/badge.css +2 -1
  4. package/css/blockquote.css +10 -7
  5. package/css/breadcrumbs.css +110 -87
  6. package/css/button.css +443 -315
  7. package/css/carousel.css +125 -78
  8. package/css/code.css +69 -56
  9. package/css/color-picker.css +150 -103
  10. package/css/date-picker.css +73 -55
  11. package/css/expandable-block.css +212 -160
  12. package/css/fieldset.css +22 -18
  13. package/css/file-upload.css +93 -79
  14. package/css/footer.css +64 -53
  15. package/css/global.css +100 -78
  16. package/css/header.css +471 -364
  17. package/css/icon.css +108 -78
  18. package/css/information-panel.css +174 -137
  19. package/css/inputs.css +1134 -942
  20. package/css/keyboard.css +11 -7
  21. package/css/location-marker.css +68 -58
  22. package/css/menu.css +105 -80
  23. package/css/modal.css +54 -42
  24. package/css/non-ideal-state.css +47 -40
  25. package/css/notification-marker.css +275 -200
  26. package/css/popover.css +10 -8
  27. package/css/progress-indicator.css +315 -237
  28. package/css/reset-global-styles.css +10 -5
  29. package/css/side-navigation.css +189 -140
  30. package/css/skip-to-content.css +41 -27
  31. package/css/slider.css +112 -87
  32. package/css/table.css +563 -419
  33. package/css/tabs.css +324 -238
  34. package/css/tag.css +111 -84
  35. package/css/text.css +46 -27
  36. package/css/tile.css +387 -311
  37. package/css/time-picker.css +113 -86
  38. package/css/toast-notification.css +232 -173
  39. package/css/toggle-switch.css +176 -111
  40. package/css/tooltip.css +21 -16
  41. package/css/tree.css +123 -93
  42. package/css/user-icon.css +204 -162
  43. package/css/wizard.css +156 -131
  44. package/package.json +5 -6
  45. package/scss/alert/alert.scss +1 -5
  46. package/scss/button/button-group.scss +38 -8
  47. package/scss/button/classes.scss +4 -0
  48. package/scss/carousel/carousel.scss +17 -6
  49. package/scss/code/codeblock.scss +1 -1
  50. package/scss/inputs/checkbox.scss +1 -0
  51. package/scss/inputs/labeled-inputs.scss +8 -8
  52. package/scss/inputs/radio.scss +0 -4
  53. package/scss/location-marker/data-rich.scss +1 -1
  54. package/scss/location-marker/me.scss +4 -4
  55. package/scss/modal/modal.scss +1 -0
  56. package/scss/popover/popover.scss +1 -2
  57. package/scss/progress-indicator/linear.scss +2 -10
  58. package/scss/style/global.scss +1 -5
  59. package/scss/style/mixins.scss +9 -0
  60. package/scss/table/table.scss +23 -14
  61. package/scss/toast-notification/categories.scss +1 -5
  62. package/scss/toggle-switch/classes.scss +4 -0
  63. package/scss/toggle-switch/toggle-switch.scss +141 -162
@@ -71,11 +71,7 @@
71
71
  }
72
72
 
73
73
  > span {
74
- &::selection {
75
- @include themed {
76
- background-color: rgba(t(iui-color-foreground-positive-rgb), t(iui-opacity-4));
77
- }
78
- }
74
+ @include iui-text-selection(positive);
79
75
  }
80
76
  }
81
77
  }
@@ -101,11 +97,7 @@
101
97
  }
102
98
 
103
99
  > span {
104
- &::selection {
105
- @include themed {
106
- background-color: rgba(t(iui-color-foreground-negative-rgb), t(iui-opacity-4));
107
- }
108
- }
100
+ @include iui-text-selection(negative);
109
101
  }
110
102
  }
111
103
  }
@@ -26,11 +26,7 @@
26
26
  [class*='iui-'],
27
27
  [class*='iui-'] * {
28
28
  // Text highlight
29
- ::selection {
30
- @include themed {
31
- background-color: rgba(t(iui-color-foreground-primary-rgb), t(iui-opacity-4));
32
- }
33
- }
29
+ @include iui-text-selection;
34
30
 
35
31
  // Scrollbar
36
32
  @include iui-scrollbar;
@@ -63,6 +63,15 @@
63
63
  }
64
64
  }
65
65
 
66
+ @mixin iui-text-selection($status: primary) {
67
+ &::selection,
68
+ *::selection {
69
+ @include themed {
70
+ background-color: rgba(t(iui-color-foreground-#{$status}-rgb), t(iui-opacity-4));
71
+ }
72
+ }
73
+ }
74
+
66
75
  @mixin iui-scrollbar {
67
76
  @include themed {
68
77
  scrollbar-color: rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-4)) transparent;
@@ -31,6 +31,8 @@
31
31
  .iui-row {
32
32
  display: flex;
33
33
  flex-grow: 1;
34
+ border-left: solid 1px transparent;
35
+ border-right: solid 1px transparent;
34
36
  }
35
37
 
36
38
  .iui-cell:not(.iui-slot) {
@@ -103,15 +105,30 @@
103
105
  }
104
106
  }
105
107
 
108
+ .iui-reorder-bar {
109
+ position: absolute;
110
+ height: 100%;
111
+ width: $iui-xxs;
112
+ }
113
+
106
114
  .iui-reorder-column-right {
107
- @include themed {
108
- border-right: $iui-xxs solid t(iui-color-foreground-primary);
115
+ > .iui-reorder-bar {
116
+ right: 0;
109
117
  }
110
118
  }
111
119
 
112
120
  .iui-reorder-column-left {
113
- @include themed {
114
- border-left: $iui-xxs solid t(iui-color-foreground-primary);
121
+ > .iui-reorder-bar {
122
+ left: 0;
123
+ }
124
+ }
125
+
126
+ .iui-reorder-column-left,
127
+ .iui-reorder-column-right {
128
+ > .iui-reorder-bar {
129
+ @include themed {
130
+ background-color: t(iui-color-foreground-primary);
131
+ }
115
132
  }
116
133
  }
117
134
 
@@ -391,11 +408,7 @@
391
408
  box-shadow: inset $iui-xxs 0 0 0 t(iui-icons-color-#{$status});
392
409
  }
393
410
 
394
- *::selection {
395
- @include themed {
396
- background-color: rgba(t(iui-color-foreground-#{$status}-rgb), t(iui-opacity-4));
397
- }
398
- }
411
+ @include iui-text-selection($status);
399
412
  }
400
413
 
401
414
  .iui-cell-end-icon svg {
@@ -410,11 +423,7 @@
410
423
  background-color: rgba(t(iui-color-foreground-#{$status}-rgb), t(iui-opacity-6));
411
424
  }
412
425
 
413
- &::selection {
414
- @include themed {
415
- background-color: rgba(t(iui-color-foreground-#{$status}-rgb), t(iui-opacity-4));
416
- }
417
- }
426
+ @include iui-text-selection($status);
418
427
  }
419
428
 
420
429
  @mixin iui-table-cell-icon {
@@ -10,11 +10,7 @@
10
10
  }
11
11
 
12
12
  > .iui-message {
13
- &::selection {
14
- @include themed {
15
- background-color: rgba(t(iui-color-foreground-#{$category}-rgb), t(iui-opacity-4));
16
- }
17
- }
13
+ @include iui-text-selection($category);
18
14
  }
19
15
 
20
16
  > .iui-status-area {
@@ -2,6 +2,10 @@
2
2
  // See LICENSE.md in the project root for license terms and full copyright notice.
3
3
  @import './index';
4
4
 
5
+ .iui-toggle-switch-wrapper {
6
+ @include iui-toggle-switch-wrapper;
7
+ }
8
+
5
9
  .iui-toggle-switch {
6
10
  @include iui-toggle-switch;
7
11
  }
@@ -2,194 +2,173 @@
2
2
  // See LICENSE.md in the project root for license terms and full copyright notice.
3
3
  @import '../style/index';
4
4
 
5
- @mixin iui-toggle-switch {
5
+ @mixin iui-toggle-switch-wrapper {
6
6
  @include iui-reset;
7
- display: flex;
7
+ display: grid;
8
+ grid-template-areas: 'toggle';
8
9
  align-items: center;
10
+ gap: $iui-s;
9
11
  font-size: $iui-font-size;
10
12
  width: fit-content;
11
- padding: ($iui-baseline/2) 0;
12
13
  user-select: none;
13
14
  cursor: pointer;
14
- position: relative;
15
+ isolation: isolate;
15
16
  @include themed {
16
17
  color: rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-2));
17
18
  }
18
19
 
19
- > input {
20
- width: 0;
21
- height: 0;
22
- appearance: none;
23
- opacity: 0;
24
- position: absolute;
25
-
26
- // Unchecked toggle switch
27
- ~ .iui-toggle {
28
- display: block;
29
- position: relative;
30
- height: $iui-baseline * 2 - $iui-xxs;
31
- width: ($iui-m * 2) + ($iui-xxs * 3);
32
- border-radius: $iui-baseline;
33
- @media (prefers-reduced-motion: no-preference) {
34
- transition: background-color $iui-speed-fast ease, border-color $iui-speed-fast ease;
35
- }
36
- @include themed {
37
- background-color: t(iui-color-background-1);
38
- border: 1px solid rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-4));
39
- }
40
-
41
- > .iui-icon {
42
- opacity: 0;
43
- width: $iui-sm;
44
- height: $iui-sm;
45
- display: inline-block;
46
- position: relative;
47
- left: $iui-xs;
48
- @media (prefers-reduced-motion: no-preference) {
49
- transition: opacity $iui-speed-fast ease;
50
- }
51
- @include themed {
52
- fill: t(iui-color-foreground-accessory);
53
- }
54
- }
55
-
56
- > .iui-handle {
57
- position: absolute;
58
- height: $iui-m;
59
- width: $iui-m;
60
- top: 50%;
61
- transform: translateY(-50%);
62
- right: $iui-m + $iui-xs;
63
- border-radius: 50%;
64
- @media (prefers-reduced-motion: no-preference) {
65
- transition: right $iui-speed-fast ease, background-color $iui-speed-fast ease, opacity $iui-speed-fast ease;
66
- }
67
- @include themed {
68
- background-color: t(iui-color-foreground-body);
69
- opacity: t(iui-opacity-2);
70
- }
71
- }
20
+ > * + * {
21
+ margin-left: $iui-s;
22
+ @supports (gap: $iui-s) {
23
+ margin-left: 0;
72
24
  }
25
+ }
73
26
 
74
- &:hover:not(:disabled),
75
- &:focus {
76
- ~ .iui-toggle {
77
- @include themed {
78
- border: 1px solid rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-2));
79
- }
80
-
81
- > .iui-handle {
82
- @include themed {
83
- opacity: t(iui-opacity-1);
84
- }
85
- }
86
- }
27
+ // Disabled
28
+ &.iui-disabled {
29
+ cursor: not-allowed;
30
+ @include themed {
31
+ color: t(iui-text-color-muted);
87
32
  }
33
+ }
34
+
35
+ // For labels on the left
36
+ &.iui-label-on-left {
37
+ grid-template-areas: 'label toggle';
38
+ }
39
+
40
+ // For labels on the right
41
+ &.iui-label-on-right {
42
+ grid-template-areas: 'toggle label';
43
+ }
44
+ }
45
+
46
+ @mixin iui-toggle-switch {
47
+ $iui-toggle-switch-handle-size: $iui-icons-default;
48
+ $iui-toggle-switch-handle-offset: $iui-component-offset;
49
+ $iui-toggle-switch-border-thickness: 1px;
50
+
51
+ @include iui-reset;
52
+ @include iui-focus($thickness: $iui-toggle-switch-border-thickness, $offset: $iui-toggle-switch-border-thickness);
53
+ grid-area: toggle;
54
+ display: flex;
55
+ position: relative;
56
+ cursor: pointer;
57
+
58
+ // #region IE solution
59
+ width: $iui-toggle-switch-handle-size;
60
+ height: $iui-toggle-switch-handle-size;
61
+ @supports (appearance: none) {
62
+ appearance: none;
63
+ width: ($iui-toggle-switch-handle-size + ($iui-toggle-switch-handle-offset * 2)) * 2;
64
+ height: auto;
65
+ border-radius: $iui-border-radius-round;
66
+ box-sizing: border-box;
67
+ transition: background-color $iui-speed-fast ease-out, border-color $iui-speed-fast ease-out;
68
+ background-color: var(--iui-color-background-1);
69
+ border: $iui-toggle-switch-border-thickness solid rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-4));
70
+ }
71
+ // #endregion IE solution
72
+
73
+ &-label {
74
+ grid-area: label;
75
+ }
88
76
 
89
- // Checked toggle switch
90
- &:checked {
91
- ~ .iui-toggle {
92
- @include themed {
93
- background-color: t(iui-color-background-primary);
94
- border-color: t(iui-color-background-primary);
95
- }
96
-
97
- > .iui-icon {
98
- @include themed {
99
- opacity: t(iui-opacity-1);
100
- }
101
- }
102
-
103
- > .iui-handle {
104
- @include themed {
105
- background-color: t(iui-color-foreground-accessory);
106
- opacity: t(iui-opacity-2);
107
- }
108
- right: $iui-xxs;
109
- }
110
- }
111
-
112
- &:hover:not(:disabled) {
113
- ~ .iui-toggle {
114
- @include themed {
115
- border-color: t(iui-color-background-primary);
116
- }
117
-
118
- > .iui-handle {
119
- @include themed {
120
- opacity: t(iui-opacity-1);
121
- }
122
- }
123
- }
124
- }
77
+ &::after {
78
+ content: '';
79
+ height: $iui-toggle-switch-handle-size;
80
+ width: $iui-toggle-switch-handle-size;
81
+ margin: $iui-toggle-switch-handle-offset;
82
+ aspect-ratio: 1 / 1;
83
+ border-radius: 50%;
84
+ transition: background-color $iui-speed-fast ease-out, opacity $iui-speed-fast ease-out;
85
+ z-index: 2;
86
+ @media (prefers-reduced-motion: no-preference) {
87
+ transition: transform $iui-speed-fast ease-out, background-color $iui-speed-fast ease-out,
88
+ opacity $iui-speed-fast ease-out;
125
89
  }
90
+ }
91
+
92
+ // #region Unchecked toggle switch
93
+ background-color: var(--iui-color-background-1);
94
+ border-color: rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-4));
95
+
96
+ &::after {
97
+ background-color: var(--iui-color-foreground-body);
98
+ opacity: var(--iui-opacity-2);
99
+ }
126
100
 
127
- // Disabled toggle switch
128
- &:disabled {
129
- ~ .iui-toggle {
130
- cursor: not-allowed;
131
-
132
- @include themed {
133
- background-color: t(iui-color-background-disabled);
134
- border-color: t(iui-color-background-disabled);
135
- }
136
-
137
- > .iui-handle {
138
- @include themed {
139
- background-color: t(iui-color-foreground-body);
140
- opacity: t(iui-opacity-5);
141
- }
142
- }
143
-
144
- > .iui-icon {
145
- @include themed {
146
- fill: t(iui-icons-color-actionable);
147
- }
148
- opacity: 0;
149
- }
150
- }
151
-
152
- ~ .iui-label {
153
- cursor: not-allowed;
154
-
155
- @include themed {
156
- color: t(iui-text-color-muted);
157
- }
158
- }
159
-
160
- &:checked ~ .iui-toggle > .iui-icon {
161
- @include themed {
162
- opacity: t(iui-opacity-5);
163
- }
164
- }
101
+ &:hover {
102
+ border-color: rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-2));
103
+ }
104
+
105
+ @include focus-visible {
106
+ border-color: rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-2));
107
+ }
108
+ // #endregion Unchecked toggle switch
109
+
110
+ // #region Checked toggle switch
111
+ &:checked {
112
+ background-color: var(--iui-color-background-primary);
113
+ border-color: var(--iui-color-background-primary);
114
+
115
+ &::after {
116
+ transform: translateX($iui-toggle-switch-handle-size + $iui-toggle-switch-handle-offset);
117
+ background-color: var(--iui-color-foreground-accessory);
118
+ opacity: var(--iui-opacity-2);
165
119
  }
166
120
 
167
- // Focus on non-disabled toggle switch
168
- &:enabled:focus ~ .iui-toggle {
169
- @include themed {
170
- outline: 1px solid t(iui-color-foreground-primary);
171
- }
172
- outline-offset: 1px;
121
+ ~ .iui-toggle-switch-icon {
122
+ opacity: var(--iui-opacity-1);
173
123
  }
124
+ }
125
+ // #endregion Checked toggle switch
174
126
 
175
- &:enabled:focus:not(:focus-visible) ~ .iui-toggle {
176
- outline: none;
127
+ // #region Focused or hovered toggle switch
128
+ &:hover::after {
129
+ opacity: var(--iui-opacity-1);
130
+ }
131
+
132
+ @include focus-visible {
133
+ &::after {
134
+ opacity: var(--iui-opacity-1);
177
135
  }
178
136
  }
137
+ // #endregion Focused or hovered toggle switch
179
138
 
180
- // Disabled cursor
181
- &.iui-disabled {
139
+ // #region Disabled toggle switch
140
+ &:disabled {
182
141
  cursor: not-allowed;
183
- }
142
+ background-color: var(--iui-color-background-disabled);
143
+ border-color: var(--iui-color-background-disabled);
184
144
 
185
- // For labels on the right
186
- > .iui-label {
187
- margin-right: $iui-s;
145
+ &::after {
146
+ background-color: var(--iui-color-foreground-body);
147
+ opacity: var(--iui-opacity-5);
148
+ }
149
+
150
+ ~ .iui-toggle-switch-icon {
151
+ opacity: 0;
152
+ fill: var(--iui-icons-color-actionable);
153
+ }
154
+
155
+ &:checked ~ .iui-toggle-switch-icon {
156
+ opacity: var(--iui-opacity-5);
157
+ }
188
158
  }
159
+ // #endregion Disabled toggle switch
189
160
 
190
- // For labels on the left
191
- .iui-toggle ~ .iui-label {
192
- margin-left: $iui-s;
193
- margin-right: 0;
161
+ &-icon {
162
+ opacity: 0;
163
+ grid-area: toggle;
164
+ width: $iui-toggle-switch-handle-size * 0.75;
165
+ height: $iui-toggle-switch-handle-size * 0.75;
166
+ padding: $iui-toggle-switch-handle-size * 0.125;
167
+ margin: $iui-toggle-switch-handle-offset + $iui-toggle-switch-border-thickness;
168
+ display: flex;
169
+ z-index: 1;
170
+ transition: opacity $iui-speed-fast ease-out;
171
+ pointer-events: none;
172
+ fill: var(--iui-color-foreground-accessory);
194
173
  }
195
174
  }