@itwin/itwinui-css 0.50.1 → 0.53.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 (89) hide show
  1. package/css/alert.css +234 -176
  2. package/css/all.css +8324 -5880
  3. package/css/badge.css +3 -2
  4. package/css/blockquote.css +12 -9
  5. package/css/breadcrumbs.css +110 -87
  6. package/css/button.css +441 -345
  7. package/css/carousel.css +110 -91
  8. package/css/code.css +70 -57
  9. package/css/color-picker.css +164 -113
  10. package/css/date-picker.css +454 -80
  11. package/css/expandable-block.css +213 -161
  12. package/css/fieldset.css +25 -21
  13. package/css/file-upload.css +93 -79
  14. package/css/footer.css +64 -53
  15. package/css/global.css +550 -197
  16. package/css/header.css +485 -367
  17. package/css/icon.css +108 -78
  18. package/css/information-panel.css +181 -137
  19. package/css/inputs.css +1137 -945
  20. package/css/keyboard.css +14 -10
  21. package/css/location-marker.css +69 -59
  22. package/css/menu.css +124 -86
  23. package/css/modal.css +114 -44
  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 +316 -238
  28. package/css/reset-global-styles.css +10 -5
  29. package/css/side-navigation.css +193 -144
  30. package/css/skip-to-content.css +42 -28
  31. package/css/slider.css +116 -91
  32. package/css/surface.css +19 -0
  33. package/css/table.css +578 -430
  34. package/css/tabs.css +324 -238
  35. package/css/tag.css +112 -85
  36. package/css/text.css +47 -28
  37. package/css/tile.css +389 -313
  38. package/css/time-picker.css +114 -87
  39. package/css/toast-notification.css +234 -175
  40. package/css/toggle-switch.css +176 -111
  41. package/css/tooltip.css +24 -17
  42. package/css/tree.css +123 -93
  43. package/css/user-icon.css +222 -162
  44. package/css/wizard.css +158 -133
  45. package/package.json +5 -6
  46. package/scss/alert/alert.scss +1 -5
  47. package/scss/carousel/carousel.scss +24 -27
  48. package/scss/classes.scss +1 -0
  49. package/scss/code/codeblock.scss +1 -1
  50. package/scss/color-picker/color-picker.scss +2 -2
  51. package/scss/date-picker/classes.scss +20 -0
  52. package/scss/date-picker/date-picker.scss +194 -33
  53. package/scss/fieldset/fieldset.scss +1 -1
  54. package/scss/header/header.scss +15 -10
  55. package/scss/index.scss +1 -0
  56. package/scss/information-panel/information-panel.scss +10 -3
  57. package/scss/inputs/checkbox.scss +1 -0
  58. package/scss/inputs/labeled-inputs.scss +8 -8
  59. package/scss/inputs/radio.scss +0 -4
  60. package/scss/location-marker/data-rich.scss +1 -1
  61. package/scss/location-marker/me.scss +4 -4
  62. package/scss/menu/classes.scss +2 -1
  63. package/scss/menu/menu.scss +8 -11
  64. package/scss/modal/classes.scss +4 -0
  65. package/scss/modal/modal.scss +82 -7
  66. package/scss/popover/popover.scss +1 -2
  67. package/scss/progress-indicator/linear.scss +3 -11
  68. package/scss/progress-indicator/radial.scss +1 -1
  69. package/scss/side-navigation/side-navigation.scss +5 -5
  70. package/scss/slider/slider.scss +2 -2
  71. package/scss/style/elevation.scss +5 -5
  72. package/scss/style/global.scss +33 -26
  73. package/scss/style/mixins.scss +9 -0
  74. package/scss/style/ripple.scss +1 -1
  75. package/scss/style/speed.scss +1 -0
  76. package/scss/style/theme.scss +248 -65
  77. package/scss/surface/classes.scss +7 -0
  78. package/scss/surface/index.scss +3 -0
  79. package/scss/surface/surface.scss +18 -0
  80. package/scss/table/column-filter.scss +2 -2
  81. package/scss/table/table.scss +26 -17
  82. package/scss/tile/tile.scss +5 -5
  83. package/scss/time-picker/time-picker.scss +2 -2
  84. package/scss/toast-notification/categories.scss +1 -5
  85. package/scss/toggle-switch/classes.scss +4 -0
  86. package/scss/toggle-switch/toggle-switch.scss +141 -162
  87. package/scss/tooltip/tooltip.scss +2 -1
  88. package/scss/user-icon/user-icon.scss +38 -19
  89. package/scss/wizard/wizard.scss +1 -1
@@ -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
  }
@@ -20,6 +20,7 @@
20
20
  @include themed {
21
21
  background-color: rgba(0, 0, 0, t(iui-opacity-3));
22
22
  color: t(iui-color-foreground-accessory);
23
+ border: 1px solid rgba(t(iui-color-foreground-accessory-rgb), t(iui-opacity-4));
23
24
  }
24
25
  }
25
26
 
@@ -30,7 +31,7 @@
30
31
  opacity: 0;
31
32
  /// Following this guide for animation on exit hover: https://greywyvern.com/?post=337
32
33
  @media (prefers-reduced-motion: no-preference) {
33
- transition: visibility 0s linear $iui-speed-fast, opacity $iui-speed-fast ease-out;
34
+ transition: visibility $iui-speed-instant linear $iui-speed-fast, opacity $iui-speed-fast ease-out;
34
35
  }
35
36
  }
36
37
 
@@ -87,47 +87,66 @@
87
87
  border-radius: 50%;
88
88
  @include themed {
89
89
  border: $iui-xxs solid t(iui-color-background-1);
90
- background-color: t(iui-color-background-1);
91
- box-shadow: inset 0 0 0 1px rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-3));
90
+ background-color: t(iui-color-background-5);
92
91
  }
93
92
 
94
- > .iui-status-symbol {
95
- display: inline-flex;
96
- @include themed {
97
- fill: t(iui-icons-color);
98
- }
93
+ &::after {
94
+ content: '';
99
95
  width: calc(100% / 1.5);
100
96
  height: calc(100% / 1.5);
101
97
  }
102
98
 
103
- &.iui-online,
104
- &.iui-away,
105
- &.iui-busy {
106
- box-shadow: none;
107
-
108
- > .iui-status-symbol {
109
- @include themed {
110
- fill: t(iui-color-foreground-accessory);
111
- }
112
- }
113
- }
114
-
115
99
  &.iui-online {
116
100
  @include themed {
117
101
  background-color: t(iui-color-background-positive);
118
102
  }
103
+
104
+ &::after {
105
+ mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M6,14L0,8l2-2l4,4l8-8l2,2L6,14z' /></svg>");
106
+ @include themed {
107
+ background-color: t(iui-color-foreground-accessory);
108
+ }
109
+ }
119
110
  }
120
111
 
121
112
  &.iui-away {
122
113
  @include themed {
123
114
  background-color: t(iui-color-background-warning);
124
115
  }
116
+
117
+ &::after {
118
+ mask: url("data:image/svg+xml,<svg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'><path d='m13.445 12.832-6.445-4.297v-7.535h2v6.465l5.555 3.703z' /></svg>");
119
+ @include themed {
120
+ background-color: t(iui-color-foreground-accessory);
121
+ }
122
+ }
125
123
  }
126
124
 
127
125
  &.iui-busy {
128
126
  @include themed {
129
127
  background-color: t(iui-color-background-negative);
130
128
  }
129
+
130
+ &::after {
131
+ mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><rect x='2' y='7' width='12' height='2'></rect></svg>");
132
+ @include themed {
133
+ background-color: t(iui-color-foreground-accessory);
134
+ }
135
+ }
136
+ }
137
+
138
+ &.iui-offline {
139
+ @include themed {
140
+ background-color: t(iui-color-background-1);
141
+ box-shadow: inset 0 0 0 1px rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-3));
142
+ }
143
+
144
+ &::after {
145
+ mask: url("data:image/svg+xml,<svg viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'><path d='m12.5 2-4.5 4.5-4.5-4.5-1.5 1.5 4.5 4.5-4.5 4.5 1.5 1.5 4.5-4.5 4.5 4.5 1.5-1.5-4.5-4.5 4.5-4.5z' /></svg>");
146
+ @include themed {
147
+ background-color: t(iui-icons-color);
148
+ }
149
+ }
131
150
  }
132
151
  }
133
152
 
@@ -74,7 +74,7 @@
74
74
  &.iui-current ~ & {
75
75
  .iui-wizard-circle {
76
76
  @include themed {
77
- border: 1px solid t(iui-color-background-5);
77
+ border: 1px solid t(iui-color-background-border);
78
78
  background-color: t(iui-color-background-1);
79
79
  color: t(iui-text-color-muted);
80
80
  }