@itwin/itwinui-css 0.59.2 → 1.0.0-dev.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 (202) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +1 -4
  3. package/css/alert.css +273 -139
  4. package/css/all.css +4046 -4967
  5. package/css/anchor.css +1 -5
  6. package/css/{user-icon.css → avatar.css} +51 -71
  7. package/css/backdrop.css +24 -0
  8. package/css/badge.css +2 -2
  9. package/css/blockquote.css +1 -4
  10. package/css/breadcrumbs.css +64 -137
  11. package/css/button.css +264 -349
  12. package/css/carousel.css +8 -16
  13. package/css/checkbox.css +149 -0
  14. package/css/code.css +5 -13
  15. package/css/color-picker.css +6 -44
  16. package/css/date-picker.css +6 -65
  17. package/css/dialog.css +63 -101
  18. package/css/expandable-block.css +1 -32
  19. package/css/fieldset.css +2 -7
  20. package/css/file-upload.css +0 -15
  21. package/css/footer.css +1 -9
  22. package/css/global.css +8 -63
  23. package/css/header.css +312 -398
  24. package/css/icon.css +0 -30
  25. package/css/information-panel.css +1 -15
  26. package/css/input.css +162 -0
  27. package/css/keyboard.css +2 -6
  28. package/css/location-marker.css +1 -12
  29. package/css/menu.css +1 -17
  30. package/css/progress-indicator.css +1 -93
  31. package/css/radio-tile.css +38 -65
  32. package/css/radio.css +156 -0
  33. package/css/select.css +230 -0
  34. package/css/side-navigation.css +5 -20
  35. package/css/skip-to-content.css +0 -3
  36. package/css/slider.css +2 -14
  37. package/css/stepper.css +141 -0
  38. package/css/surface.css +0 -1
  39. package/css/table.css +252 -339
  40. package/css/tabs.css +26 -65
  41. package/css/tag.css +7 -32
  42. package/css/text.css +1 -3
  43. package/css/textarea.css +96 -0
  44. package/css/tile.css +169 -155
  45. package/css/time-picker.css +2 -14
  46. package/css/{toast-notification.css → toast.css} +3 -45
  47. package/css/toggle-switch.css +13 -60
  48. package/css/tooltip.css +1 -4
  49. package/css/tree.css +0 -14
  50. package/css/utils.css +609 -0
  51. package/css/workflow-diagram.css +67 -0
  52. package/package.json +11 -7
  53. package/scss/alert/alert.scss +50 -44
  54. package/scss/alert/classes.scss +24 -4
  55. package/scss/anchor/anchor.scss +76 -1
  56. package/scss/{user-icon/sizes.scss → avatar/avatar-sizes.scss} +6 -5
  57. package/scss/{user-icon/user-icon.scss → avatar/avatar.scss} +35 -70
  58. package/scss/avatar/classes.scss +27 -0
  59. package/scss/{user-icon → avatar}/index.scss +1 -2
  60. package/scss/backdrop/backdrop.scss +27 -0
  61. package/scss/backdrop/classes.scss +7 -0
  62. package/scss/backdrop/index.scss +3 -0
  63. package/scss/badge/badge.scss +4 -2
  64. package/scss/blockquote/blockquote.scss +4 -9
  65. package/scss/breadcrumbs/breadcrumbs.scss +13 -18
  66. package/scss/button/borderless.scss +20 -32
  67. package/scss/button/button-group.scss +15 -7
  68. package/scss/button/button.scss +64 -42
  69. package/scss/button/classes.scss +47 -37
  70. package/scss/button/default.scss +33 -41
  71. package/scss/button/idea.scss +4 -2
  72. package/scss/button/index.scss +3 -6
  73. package/scss/button/split-button.scss +45 -0
  74. package/scss/button/variant.scss +44 -0
  75. package/scss/carousel/carousel.scss +12 -23
  76. package/scss/{inputs → checkbox}/checkbox.scss +50 -2
  77. package/scss/checkbox/classes.scss +7 -0
  78. package/scss/checkbox/index.scss +3 -0
  79. package/scss/classes.scss +11 -6
  80. package/scss/code/code.scss +3 -5
  81. package/scss/code/codeblock.scss +7 -21
  82. package/scss/color-picker/color-picker.scss +32 -61
  83. package/scss/date-picker/date-picker.scss +21 -55
  84. package/scss/dialog/classes.scss +7 -6
  85. package/scss/dialog/dialog.scss +95 -130
  86. package/scss/expandable-block/block.scss +22 -50
  87. package/scss/fieldset/fieldset.scss +6 -12
  88. package/scss/file-upload/file-upload.scss +13 -23
  89. package/scss/footer/footer.scss +5 -15
  90. package/scss/header/classes.scss +70 -2
  91. package/scss/header/header-buttons.scss +316 -0
  92. package/scss/header/header.scss +40 -408
  93. package/scss/header/index.scss +1 -0
  94. package/scss/icon/{mixins.scss → icon.scss} +5 -15
  95. package/scss/icon/index.scss +1 -2
  96. package/scss/index.scss +11 -6
  97. package/scss/information-panel/information-panel.scss +8 -26
  98. package/scss/input/classes.scss +15 -0
  99. package/scss/input/index.scss +4 -0
  100. package/scss/{inputs → input}/input-with-icon.scss +1 -0
  101. package/scss/{inputs → input}/input.scss +15 -25
  102. package/scss/keyboard/keyboard.scss +5 -9
  103. package/scss/location-marker/data-rich.scss +5 -14
  104. package/scss/location-marker/default.scss +1 -3
  105. package/scss/location-marker/location-marker.scss +1 -3
  106. package/scss/location-marker/me.scss +7 -14
  107. package/scss/menu/menu.scss +16 -36
  108. package/scss/non-ideal-state/non-ideal-state.scss +2 -1
  109. package/scss/progress-indicator/classes.scss +0 -4
  110. package/scss/progress-indicator/linear.scss +9 -27
  111. package/scss/progress-indicator/overlay.scss +4 -10
  112. package/scss/progress-indicator/radial.scss +10 -98
  113. package/scss/radio/classes.scss +7 -0
  114. package/scss/radio/index.scss +3 -0
  115. package/scss/{inputs → radio}/radio.scss +1 -1
  116. package/scss/radio-tile/radio-tile.scss +41 -83
  117. package/scss/select/classes.scss +27 -0
  118. package/scss/select/index.scss +3 -0
  119. package/scss/select/select.scss +124 -0
  120. package/scss/side-navigation/side-navigation.scss +26 -34
  121. package/scss/skip-to-content/skip-to-content.scss +2 -3
  122. package/scss/slider/slider.scss +12 -23
  123. package/scss/stepper/classes.scss +32 -0
  124. package/scss/stepper/index.scss +3 -0
  125. package/scss/stepper/stepper.scss +151 -0
  126. package/scss/style/{variables.scss → global-variables.scss} +4 -2
  127. package/scss/style/global.scss +9 -10
  128. package/scss/{icon/variables.scss → style/icon-sizes.scss} +1 -1
  129. package/scss/style/index.scss +6 -6
  130. package/scss/style/theme.scss +0 -39
  131. package/scss/style/typography.scss +5 -4
  132. package/scss/surface/surface.scss +0 -1
  133. package/scss/table/classes.scss +24 -23
  134. package/scss/table/column-filter.scss +2 -5
  135. package/scss/table/index.scss +1 -2
  136. package/scss/table/paginator.scss +22 -30
  137. package/scss/table/sizes.scss +31 -0
  138. package/scss/table/{variables.scss → table-densities.scss} +2 -1
  139. package/scss/table/table.scss +156 -228
  140. package/scss/tabs/borderless.scss +9 -22
  141. package/scss/tabs/classes.scss +4 -0
  142. package/scss/tabs/default.scss +11 -25
  143. package/scss/tabs/pill.scss +5 -15
  144. package/scss/tabs/tabs.scss +30 -57
  145. package/scss/tag/classes.scss +1 -0
  146. package/scss/tag/tag.scss +11 -21
  147. package/scss/text/mixins.scss +1 -0
  148. package/scss/text/muted.scss +2 -4
  149. package/scss/text/skeleton.scss +8 -11
  150. package/scss/textarea/classes.scss +7 -0
  151. package/scss/textarea/index.scss +3 -0
  152. package/scss/{inputs → textarea}/textarea.scss +2 -1
  153. package/scss/tile/classes.scss +14 -2
  154. package/scss/tile/tile.scss +99 -80
  155. package/scss/time-picker/time-picker.scss +8 -17
  156. package/scss/{toast-notification → toast}/categories.scss +3 -7
  157. package/scss/{toast-notification → toast}/classes.scss +0 -0
  158. package/scss/{toast-notification → toast}/index.scss +0 -0
  159. package/scss/{toast-notification → toast}/toast.scss +7 -16
  160. package/scss/toggle-switch/toggle-switch.scss +11 -30
  161. package/scss/tooltip/tooltip.scss +4 -5
  162. package/scss/tree/tree.scss +10 -22
  163. package/scss/utils/classes.scss +6 -0
  164. package/scss/utils/index.scss +6 -0
  165. package/scss/{inputs → utils/input-container}/classes.scss +0 -28
  166. package/scss/utils/input-container/index.scss +3 -0
  167. package/scss/{inputs/labeled-inputs.scss → utils/input-container/input-container.scss} +16 -113
  168. package/scss/{style → utils}/mixins.scss +26 -43
  169. package/scss/{notification-marker → utils/notification-marker}/classes.scss +0 -0
  170. package/scss/{notification-marker → utils/notification-marker}/index.scss +0 -0
  171. package/scss/{notification-marker → utils/notification-marker}/notification-marker.scss +11 -19
  172. package/scss/{popover → utils/popover}/classes.scss +0 -0
  173. package/scss/{popover → utils/popover}/index.scss +0 -0
  174. package/scss/{popover → utils/popover}/popover.scss +0 -1
  175. package/scss/workflow-diagram/classes.scss +15 -0
  176. package/scss/workflow-diagram/index.scss +3 -0
  177. package/scss/workflow-diagram/workflow-diagram.scss +64 -0
  178. package/src/index.scss +11 -6
  179. package/css/inputs.css +0 -1143
  180. package/css/notification-marker.css +0 -293
  181. package/css/popover.css +0 -14
  182. package/css/reset-global-styles.css +0 -50
  183. package/css/wizard.css +0 -190
  184. package/scss/button/button-icon.scss +0 -12
  185. package/scss/button/cta.scss +0 -31
  186. package/scss/button/disabled.scss +0 -13
  187. package/scss/button/high-visibility.scss +0 -31
  188. package/scss/button/split-menu.scss +0 -66
  189. package/scss/inputs/checkbox-radio.scss +0 -73
  190. package/scss/inputs/index.scss +0 -10
  191. package/scss/inputs/select.scss +0 -66
  192. package/scss/reset-global-styles.scss +0 -33
  193. package/scss/style/anchor.scss +0 -82
  194. package/scss/style/ripple.scss +0 -18
  195. package/scss/table/condensed.scss +0 -15
  196. package/scss/table/extra-condensed.scss +0 -19
  197. package/scss/user-icon/classes.scss +0 -27
  198. package/scss/wizard/classes.scss +0 -27
  199. package/scss/wizard/index.scss +0 -5
  200. package/scss/wizard/long.scss +0 -19
  201. package/scss/wizard/wizard.scss +0 -160
  202. package/scss/wizard/workflow.scss +0 -43
@@ -1,6 +1,7 @@
1
1
  // Copyright (c) Bentley Systems, Incorporated. All rights reserved.
2
2
  // See LICENSE.md in the project root for license terms and full copyright notice.
3
3
  @import '../style/index';
4
+ @import '../utils/index';
4
5
 
5
6
  @mixin iui-blockquote {
6
7
  @include iui-reset;
@@ -11,18 +12,12 @@
11
12
  text-align: justify;
12
13
  box-shadow: $iui-elevation-2;
13
14
  border-radius: $iui-border-radius;
14
-
15
- @include themed {
16
- background-color: t(iui-color-background-1);
17
- border-left: $iui-s solid t(iui-color-foreground-primary);
18
- }
15
+ background-color: var(--iui-color-background-1);
16
+ border-left: $iui-s solid var(--iui-color-foreground-primary);
19
17
 
20
18
  > footer {
21
19
  text-align: right;
22
-
23
- @include themed {
24
- color: t(iui-text-color-muted);
25
- }
20
+ color: var(--iui-text-color-muted);
26
21
 
27
22
  > cite {
28
23
  font-style: normal;
@@ -3,12 +3,13 @@
3
3
  @import '../style/index';
4
4
  @import '../anchor/index';
5
5
  @import '../button/borderless';
6
- @import '../icon/index';
6
+ @import '../utils/index';
7
7
 
8
- @mixin iui-breadcrumbs {
8
+ @mixin iui-breadcrumbs($breadcrumbs-height: $iui-component-height) {
9
9
  @include iui-reset;
10
10
  display: flex;
11
11
  align-items: center;
12
+ height: $breadcrumbs-height;
12
13
  }
13
14
 
14
15
  @mixin iui-breadcrumbs-list {
@@ -17,13 +18,13 @@
17
18
  align-items: center;
18
19
  list-style-type: none;
19
20
  user-select: none;
21
+ height: 100%;
20
22
  }
21
23
 
22
24
  @mixin iui-breadcrumbs-item {
23
25
  display: flex;
24
26
  align-items: center;
25
- line-height: $iui-component-height;
26
- height: $iui-component-height;
27
+ height: 100%;
27
28
 
28
29
  > * {
29
30
  max-width: 26ch;
@@ -38,14 +39,14 @@
38
39
  text-overflow: ellipsis;
39
40
 
40
41
  &:not(.iui-button) {
41
- @include themed {
42
- color: t(iui-text-color);
43
- }
42
+ color: var(--iui-text-color);
44
43
  }
45
44
  }
46
45
 
47
46
  > :any-link {
48
47
  @include iui-anchor;
48
+ box-sizing: border-box;
49
+ line-height: $iui-component-height;
49
50
 
50
51
  &:focus {
51
52
  outline-offset: -1px;
@@ -55,11 +56,10 @@
55
56
  .iui-button {
56
57
  &.iui-button {
57
58
  @include iui-button-borderless;
58
- @include iui-focus;
59
59
  border: none;
60
60
  }
61
61
 
62
- &-label {
62
+ > span {
63
63
  overflow: hidden;
64
64
  white-space: nowrap;
65
65
  text-overflow: ellipsis;
@@ -80,6 +80,7 @@
80
80
  overflow: hidden;
81
81
  white-space: nowrap;
82
82
  text-overflow: ellipsis;
83
+ line-height: $iui-component-height;
83
84
 
84
85
  @at-root a#{&} {
85
86
  @include iui-anchor;
@@ -95,14 +96,10 @@
95
96
  @include iui-button-borderless;
96
97
  padding: 0;
97
98
  border: none;
98
- @include themed {
99
- color: t(iui-color-foreground-primary);
100
- }
99
+ color: var(--iui-color-foreground-primary);
101
100
 
102
101
  &[aria-current] {
103
- @include themed {
104
- color: t(iui-text-color);
105
- }
102
+ color: var(--iui-text-color);
106
103
  }
107
104
  }
108
105
 
@@ -114,9 +111,7 @@
114
111
  width: $iui-icons-small;
115
112
  height: $iui-icons-small;
116
113
  display: flex; // needed for vertical alignment of webcomponents
117
- @include themed {
118
- fill: t(iui-icons-color);
119
- }
114
+ fill: var(--iui-icons-color);
120
115
  @media (forced-colors: active) {
121
116
  fill: CanvasText;
122
117
  }
@@ -2,47 +2,35 @@
2
2
  // See LICENSE.md in the project root for license terms and full copyright notice.
3
3
  @import '../style/index';
4
4
  @import './button';
5
- @import './disabled';
6
- @import './button-icon';
7
5
 
8
6
  @mixin iui-button-borderless {
9
- border-color: transparent;
10
- background-color: transparent;
11
-
12
- > .iui-button-icon:only-child {
13
- margin-left: $iui-component-offset;
14
- margin-right: $iui-component-offset;
15
- }
7
+ --_iui-button-text-color: var(--iui-text-color);
8
+ --_iui-button-background-color: transparent;
9
+ --_iui-button-border-color: transparent;
10
+ --_iui-button-icon-margin-x: #{$iui-component-offset};
16
11
  @include iui-button-size(medium, borderless);
17
12
 
18
- &:hover {
19
- @include themed {
20
- background-color: rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-6));
21
- border-color: transparent;
22
- }
13
+ &:where(:hover, :active) {
14
+ --_iui-button-text-color: var(--iui-color-foreground-body);
15
+ --_iui-button-background-color: rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-6));
23
16
  }
24
17
 
25
- &.iui-active {
26
- @include themed {
27
- background-color: rgba(t(iui-color-foreground-primary-rgb), t(iui-opacity-6));
28
- color: t(iui-color-foreground-primary);
29
- }
30
- border-color: transparent;
18
+ &:where(:focus) {
19
+ outline-offset: -1px;
20
+ outline-width: 1px;
31
21
  }
32
22
 
33
- &[disabled],
34
- &:disabled {
35
- @include iui-button-disabled;
23
+ &:where([disabled], :disabled, [aria-disabled='true']) {
24
+ --_iui-button-text-color: var(--iui-text-color-placeholder);
25
+ --_iui-button-background-color: transparent;
26
+ --_iui-button-border-color: transparent;
27
+ }
28
+ }
36
29
 
37
- @include themed {
38
- background-color: transparent;
39
- border-color: transparent;
40
- }
30
+ @mixin iui-button-borderless-active {
31
+ --_iui-button-background-color: rgba(var(--iui-color-foreground-primary-rgb), var(--iui-opacity-6));
41
32
 
42
- &.iui-active {
43
- @include themed {
44
- background-color: rgba(t(iui-color-foreground-body-rgb), 0.05);
45
- }
46
- }
33
+ &:where([disabled], :disabled, [aria-disabled='true']) {
34
+ --_iui-button-background-color: rgba(var(--iui-color-foreground-body-rgb), 0.05);
47
35
  }
48
36
  }
@@ -9,6 +9,7 @@
9
9
  display: inline-flex;
10
10
  align-items: center;
11
11
  isolation: isolate;
12
+ pointer-events: none;
12
13
 
13
14
  @if $orientation != 'horizontal' {
14
15
  flex-direction: column;
@@ -16,12 +17,16 @@
16
17
  }
17
18
 
18
19
  $childZindexSelector: '.iui-input-container, .iui-button, .iui-input:where(:not(.iui-input-container .iui-input))';
19
- $childBorderSelector: '.iui-input, .iui-button:where(:not(.iui-borderless))';
20
+ $childBorderSelector: '.iui-input, .iui-button:where(:not([data-iui-variant="borderless"]))';
20
21
  $disabledSelector: '&:disabled, &.iui-disabled, &[aria-disabled="true"]';
21
22
 
22
23
  > * {
23
24
  display: flex;
24
25
 
26
+ > * {
27
+ pointer-events: all;
28
+ }
29
+
25
30
  #{$childZindexSelector} {
26
31
  position: relative;
27
32
 
@@ -36,14 +41,17 @@
36
41
  z-index: 1;
37
42
  }
38
43
 
39
- &:focus,
40
- &:focus-within {
41
- z-index: 2;
42
- }
43
-
44
44
  #{$disabledSelector} {
45
45
  z-index: -1;
46
46
  }
47
+
48
+ &:focus,
49
+ &:focus-within {
50
+ &,
51
+ &:where([aria-disabled='true']) {
52
+ z-index: 2;
53
+ }
54
+ }
47
55
  }
48
56
 
49
57
  #{$childBorderSelector} {
@@ -93,7 +101,7 @@
93
101
  }
94
102
 
95
103
  // Add slight border between disabled items
96
- &:not(:first-child) :where(.iui-button.iui-default) {
104
+ &:not(:first-child) :not([data-iui-variant='borderless']) {
97
105
  #{$disabledSelector} {
98
106
  @if $orientation == 'horizontal' {
99
107
  border-left-color: var(--iui-color-background-4);
@@ -1,18 +1,12 @@
1
1
  // Copyright (c) Bentley Systems, Incorporated. All rights reserved.
2
2
  // See LICENSE.md in the project root for license terms and full copyright notice.
3
3
  @import '../style/index';
4
- @import '../icon/index';
5
- @import './disabled';
6
- @import './button-icon';
7
4
 
8
5
  $iui-button-padding: $iui-xs * 4;
9
6
  $iui-button-padding-small: $iui-xs * 2;
10
7
  $iui-button-padding-large: $iui-xs * 6;
11
8
 
12
9
  @mixin iui-button {
13
- --_iui-button-active-stripe-inset: initial;
14
- --_iui-button-text-color: rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-2));
15
-
16
10
  @include iui-reset;
17
11
  font-family: inherit;
18
12
  display: inline-flex;
@@ -20,55 +14,70 @@ $iui-button-padding-large: $iui-xs * 6;
20
14
  vertical-align: middle;
21
15
  justify-content: center;
22
16
  position: relative;
23
- box-sizing: border-box;
24
17
  border-radius: $iui-border-radius;
25
18
  line-height: $iui-line-height;
26
- box-shadow: none;
27
19
  font-size: $iui-font-size;
28
20
  font-weight: $iui-font-weight-normal;
29
- text-decoration: none;
30
21
  user-select: none;
31
22
  cursor: pointer;
32
23
  white-space: nowrap;
33
- border: 1px solid transparent;
34
- @media (prefers-reduced-motion: no-preference) {
35
- transition: color $iui-speed-fast ease-out, background-color $iui-speed-fast ease-out,
36
- border-color $iui-speed-fast ease-out;
37
- }
38
-
39
- @include themed {
40
- color: rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-2));
41
- }
24
+ border: 1px solid var(--_iui-button-border-color);
25
+ background: var(--_iui-button-background-color);
42
26
  color: var(--_iui-button-text-color);
43
-
44
- &:hover {
45
- --_iui-button-text-color: rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-1));
46
-
47
- text-decoration: none;
48
- }
49
-
27
+ gap: var(--_iui-button-gap);
28
+ height: var(--_iui-button-height);
29
+ padding-inline: var(--_iui-button-padding-inline);
30
+ transition: background-color $iui-speed-fast ease-out, border-color $iui-speed-fast ease-out;
31
+ -webkit-tap-highlight-color: transparent;
32
+ text-decoration: none;
33
+ @include iui-button-size;
50
34
  @include iui-focus;
35
+ }
51
36
 
52
- &[disabled],
53
- &:disabled {
54
- @include iui-button-disabled;
37
+ @mixin iui-button-icon {
38
+ width: $iui-icons-default;
39
+ height: $iui-icons-default;
40
+ transition: fill $iui-speed-fast ease-out;
41
+ fill: currentColor;
42
+
43
+ &:only-child {
44
+ margin-left: var(--_iui-button-icon-margin-x);
45
+ margin-right: var(--_iui-button-icon-margin-x);
55
46
  }
56
47
  }
57
48
 
58
49
  @mixin iui-button-active {
50
+ --_iui-button-active-stripe-inset: initial;
51
+ --_iui-button-active-stripe-color: var(--iui-color-foreground-primary);
52
+ --_iui-button-text-color: var(--iui-color-foreground-primary);
53
+
59
54
  // Shows active stripe only if --_iui-button-active-stripe-inset is set (from outside)
60
55
  &::after {
61
56
  content: '';
62
57
  position: absolute;
63
58
  inset: var(--_iui-button-active-stripe-inset);
64
- background-color: var(--iui-color-foreground-primary);
59
+ background-color: var(--_iui-button-active-stripe-color);
65
60
  }
66
61
 
67
62
  &[disabled],
68
- &:disabled {
69
- &::after {
70
- background-color: rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-5));
71
- }
63
+ &:disabled,
64
+ &[aria-disabled='true'] {
65
+ --_iui-button-active-stripe-color: var(--iui-text-color-placeholder);
66
+ --_iui-button-text-color: var(--iui-text-color-placeholder);
67
+ }
68
+ }
69
+
70
+ @mixin iui-button-dropdown($size: default) {
71
+ @if $size == default {
72
+ --_iui-button-padding-inline: #{$iui-button-padding} #{$iui-s};
73
+ }
74
+
75
+ @if $size == small {
76
+ --_iui-button-padding-inline: #{$iui-button-padding-small} #{$iui-xs};
77
+ }
78
+
79
+ @if $size == large {
80
+ --_iui-button-padding-inline: #{$iui-button-padding-large} #{$iui-sm};
72
81
  }
73
82
  }
74
83
 
@@ -77,21 +86,34 @@ $iui-button-padding-large: $iui-xs * 6;
77
86
  /// @arg styleType - must be one of: default, borderless
78
87
  @mixin iui-button-size($size: medium, $styleType: default) {
79
88
  @if $size == medium {
80
- padding: if($styleType == 'borderless', 0 $iui-s, 0 $iui-button-padding);
81
- height: $iui-component-height;
82
- gap: $iui-s;
89
+ --_iui-button-gap: #{$iui-s};
90
+ --_iui-button-height: #{$iui-component-height};
91
+ --_iui-button-padding-inline: #{$iui-button-padding};
92
+
93
+ @if $styleType == borderless {
94
+ --_iui-button-padding-inline: #{$iui-s};
95
+ }
83
96
  }
84
97
 
85
98
  @if $size == small {
86
- padding: if($styleType == 'borderless', 0 $iui-xxs, 0 $iui-button-padding-small);
87
- height: $iui-component-height-small;
88
- gap: $iui-xs;
99
+ --_iui-button-gap: #{$iui-xs};
100
+ --_iui-button-height: #{$iui-component-height-small};
101
+ --_iui-button-padding-inline: #{$iui-button-padding-small};
102
+
103
+ @if $styleType == borderless {
104
+ --_iui-button-padding-inline: #{$iui-xxs};
105
+ }
89
106
  }
90
107
 
91
108
  @if $size == large {
92
- padding: if($styleType == 'borderless', 0 $iui-sm, 0 $iui-button-padding-large);
93
- height: $iui-component-height-large;
94
109
  font-size: $iui-font-size-leading;
95
- gap: $iui-sm;
110
+
111
+ --_iui-button-gap: #{$iui-sm};
112
+ --_iui-button-height: #{$iui-component-height-large};
113
+ --_iui-button-padding-inline: #{$iui-button-padding-large};
114
+
115
+ @if $styleType == borderless {
116
+ --_iui-button-padding-inline: #{$iui-sm};
117
+ }
96
118
  }
97
119
  }
@@ -4,67 +4,77 @@
4
4
 
5
5
  .iui-button {
6
6
  @include iui-button;
7
- @include iui-button-size;
7
+ @include iui-button-default;
8
8
 
9
- &.iui-active {
10
- @include iui-button-active;
9
+ &[data-iui-size='small'] {
10
+ @include iui-button-size(small);
11
11
  }
12
12
 
13
- &.iui-default {
14
- @include iui-button-default;
13
+ &[data-iui-size='large'] {
14
+ @include iui-button-size(large);
15
15
  }
16
16
 
17
- &.iui-high-visibility {
18
- @include iui-button-high-visibility;
17
+ &[data-iui-variant='borderless'] {
18
+ @include iui-button-borderless;
19
+
20
+ &[data-iui-size='small'] {
21
+ @include iui-button-size(small, borderless);
22
+ }
23
+
24
+ &[data-iui-size='large'] {
25
+ @include iui-button-size(large, borderless);
26
+ }
19
27
  }
20
28
 
21
- &.iui-cta {
22
- @include iui-button-cta;
29
+ &[data-iui-active='true'] {
30
+ @include iui-button-default-active;
31
+
32
+ &[data-iui-variant='borderless'] {
33
+ @include iui-button-borderless-active;
34
+ }
23
35
  }
24
36
 
25
- &.iui-idea {
26
- @include iui-button-idea;
37
+ &[data-iui-variant='high-visibility'] {
38
+ @include iui-button-variant(high-visibility);
27
39
  }
28
40
 
29
- &.iui-borderless {
30
- @include iui-button-borderless;
41
+ &[data-iui-variant='cta'] {
42
+ @include iui-button-variant(cta);
31
43
  }
32
44
 
33
- @include iui-button-size(medium);
45
+ &[data-iui-variant='idea'] {
46
+ @include iui-button-idea;
47
+ }
48
+ }
34
49
 
35
- &.iui-small {
36
- @include iui-button-size(small);
50
+ .iui-button-icon {
51
+ @include iui-button-icon;
52
+ }
37
53
 
38
- &.iui-borderless {
39
- @include iui-button-size(small, borderless);
40
- }
41
- }
54
+ .iui-button-dropdown {
55
+ @include iui-button-dropdown;
42
56
 
43
- &.iui-large {
44
- @include iui-button-size(large);
57
+ &[data-iui-size='small'] {
58
+ @include iui-button-dropdown(small);
59
+ }
45
60
 
46
- &.iui-borderless {
47
- @include iui-button-size(large, borderless);
48
- }
61
+ &[data-iui-size='large'] {
62
+ @include iui-button-dropdown(large);
49
63
  }
50
64
  }
51
65
 
66
+ .iui-button-split {
67
+ @include iui-button-split;
68
+ }
69
+
52
70
  .iui-button-group {
53
71
  @include iui-button-group;
54
-
55
- &-vertical {
56
- @include iui-button-group(vertical);
57
- }
58
-
59
- &-overflow-x {
60
- @include iui-button-group-overflow-x;
61
- }
62
72
  }
63
73
 
64
- .iui-button-split-menu {
65
- @include iui-button-split-menu;
74
+ .iui-button-group-vertical {
75
+ @include iui-button-group(vertical);
66
76
  }
67
77
 
68
- .iui-button-icon {
69
- @include iui-button-icon;
78
+ .iui-button-group-overflow-x {
79
+ @include iui-button-group-overflow-x;
70
80
  }
@@ -1,59 +1,51 @@
1
1
  // Copyright (c) Bentley Systems, Incorporated. All rights reserved.
2
2
  // See LICENSE.md in the project root for license terms and full copyright notice.
3
3
  @import '../style/index';
4
- @import './button';
5
- @import './button-icon';
6
- @import '../notification-marker/index';
7
- @import './disabled';
4
+ @import '../utils/index';
8
5
 
9
6
  @mixin iui-button-default {
10
- @include themed {
11
- background-color: t(iui-color-background-1);
12
- border-color: rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-4));
13
- }
14
- @include iui-focus($offset: -2px, $thickness: 2px);
7
+ --_iui-button-text-color: var(--iui-text-color);
8
+ --_iui-button-background-color: var(--iui-color-background-1);
9
+ --_iui-button-border-color: rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-4));
15
10
 
16
11
  &:hover,
17
12
  &:active {
18
- @include themed {
19
- background-color: t(iui-color-background-1-overlay);
20
- border-color: rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-1));
21
- }
13
+ --_iui-button-text-color: var(--iui-color-foreground-body);
14
+ --_iui-button-background-color: var(--iui-color-background-1-overlay);
15
+ --_iui-button-border-color: rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-1));
22
16
  @include iui-notification-marker-hover;
23
17
  }
24
18
 
25
- &.iui-dropdown {
26
- padding-right: $iui-s;
27
-
28
- // Sizes
29
- &.iui-small {
30
- padding-right: $iui-xs;
31
- }
32
-
33
- &.iui-large {
34
- padding-right: $iui-sm;
35
- }
19
+ &:focus {
20
+ outline-offset: -2px;
21
+ outline-width: 2px;
36
22
  }
37
23
 
38
- &.iui-active:enabled {
39
- position: relative;
40
- @include themed {
41
- color: t(iui-color-foreground-primary);
42
- }
43
-
44
- // Used for combining overlay background color with base background
45
- &::before {
46
- content: '';
47
- position: absolute;
48
- inset: 0;
49
- @include themed {
50
- background-color: rgba(t(iui-color-foreground-primary-rgb), t(iui-opacity-6));
51
- }
52
- }
24
+ &[disabled],
25
+ &:disabled,
26
+ &[aria-disabled='true'] {
27
+ --_iui-button-text-color: var(--iui-text-color-placeholder);
28
+ --_iui-button-background-color: var(--iui-color-background-disabled);
29
+ --_iui-button-border-color: var(--iui-color-background-disabled);
30
+
31
+ cursor: not-allowed;
32
+ outline-offset: -1px;
33
+ outline-width: 1px;
34
+ outline-color: var(--iui-color-foreground-primary);
53
35
  }
36
+ }
37
+
38
+ @mixin iui-button-default-active {
39
+ @include iui-button-active;
40
+ --_iui-button-background-color: linear-gradient(
41
+ rgba(var(--iui-color-foreground-primary-rgb), var(--iui-opacity-6)),
42
+ rgba(var(--iui-color-foreground-primary-rgb), var(--iui-opacity-6))
43
+ ),
44
+ linear-gradient(var(--iui-color-background-1), var(--iui-color-background-1));
54
45
 
55
46
  &[disabled],
56
- &:disabled {
57
- @include iui-button-disabled;
47
+ &:disabled,
48
+ &[aria-disabled='true'] {
49
+ --_iui-button-background-color: var(--iui-color-background-disabled);
58
50
  }
59
51
  }
@@ -1,8 +1,10 @@
1
1
  // Copyright (c) Bentley Systems, Incorporated. All rights reserved.
2
2
  // See LICENSE.md in the project root for license terms and full copyright notice.
3
+ @import '../style/index';
4
+
3
5
  @mixin iui-button-idea {
4
- @include iui-button-high-visibility;
5
- border-radius: $iui-line-height;
6
+ @include iui-button-variant(high-visibility);
7
+ border-radius: $iui-border-radius-round;
6
8
  box-shadow: $iui-elevation-24;
7
9
  position: fixed;
8
10
  bottom: $iui-baseline;
@@ -2,11 +2,8 @@
2
2
  // See LICENSE.md in the project root for license terms and full copyright notice.
3
3
  @import './button';
4
4
  @import './default';
5
- @import './cta';
6
- @import './high-visibility';
5
+ @import './borderless';
6
+ @import './variant';
7
7
  @import './idea';
8
8
  @import './button-group';
9
- @import './split-menu';
10
- @import './borderless';
11
- @import './disabled';
12
- @import './button-icon';
9
+ @import './split-button';