@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/itwinui-css",
3
- "version": "0.59.2",
3
+ "version": "1.0.0-dev.0",
4
4
  "author": "Bentley Systems",
5
5
  "license": "MIT",
6
6
  "main": "src/index.scss",
@@ -29,30 +29,34 @@
29
29
  ],
30
30
  "dependencies": {},
31
31
  "devDependencies": {
32
+ "@itwin/itwinui-icons-elements": "0.2.0",
32
33
  "autoprefixer": "^10.4.1",
33
34
  "backstopjs": "~6.0.4",
34
35
  "html-minifier": "^4.0.0",
36
+ "npm-run-all": "^4.1.5",
35
37
  "postcss": "^8.4.5",
36
38
  "postcss-discard-comments": "^5.0.1",
37
39
  "postcss-scss": "^4.0.3",
38
40
  "sass-embedded": "^1.49.9",
41
+ "serve": "^14.0.1",
39
42
  "stylelint": "^14.2.0",
40
- "stylelint-config-sass-guidelines": "^9.0.1"
43
+ "stylelint-config-sass-guidelines": "^9.0.1",
44
+ "vite": "^3.0.0"
41
45
  },
42
46
  "scripts": {
43
47
  "build": "yarn clean && yarn build:scss && yarn build:css && node ../shared/copyrightLinter.js --fix css/* && yarn build:html",
44
48
  "build:scss": "cpx \"./src/**/*.scss\" ./scss",
45
49
  "build:css": "node ./scripts/generateCss.js src css",
46
- "build:html": "node ./scripts/generateHtml.js backstop/tests backstop/minified",
47
- "build:watch": "yarn build && concurrently -n scss,html -k \"yarn build:watch:scss\" \"yarn build:watch:html\"",
50
+ "build:html": "vite build backstop/tests --config vite.config.ts",
48
51
  "build:watch:scss": "chokidar \"src/**/*\" -c \"yarn build:scss && yarn build:css\"",
49
- "build:watch:html": "chokidar \"backstop/tests/**/*\" -c \"yarn build:html\"",
50
52
  "createComponent": "node ./scripts/createComponent.js",
51
53
  "clean": "rimraf ./css ./scss ./backstop/results/bitmaps_test",
52
- "dev": "yarn build:watch",
54
+ "dev": "concurrently -n scss,html -k \"yarn build:watch:scss\" \"yarn vite backstop/tests --config vite.config.ts\"",
55
+ "preview": "serve backstop/minified -p 3050",
53
56
  "lint": "stylelint \"src/**/*.scss\"",
54
57
  "approve": "backstop --config=./backstop/backstop.js approve",
55
- "test": "backstop --config=./backstop/backstop.js test --docker",
58
+ "test:only": "backstop --config=./backstop/backstop.js test --docker",
59
+ "test": "npm-run-all -p -r \"preview\" \"test:only {1}\" --",
56
60
  "clean:images": "node scripts/removeOldTestImages.js",
57
61
  "print": "node scripts/print.js",
58
62
  "audit:ci": "audit-ci --moderate --report-type=full",
@@ -3,70 +3,76 @@
3
3
  @import '../style/index';
4
4
  @import '../anchor/index';
5
5
  @import '../icon/index';
6
- @import '../text/index';
6
+ @import '../utils/index';
7
+ @import '../button/index';
7
8
 
8
9
  @mixin iui-alert {
9
10
  @include iui-reset;
10
11
  border-radius: $iui-border-radius;
11
- box-sizing: border-box;
12
12
  display: flex;
13
13
  align-items: center;
14
- @include themed {
15
- border: 1px solid t(iui-color-background-5);
16
- color: t(iui-text-color);
17
- background-color: t(iui-color-background-1);
18
- }
19
-
20
- &-icon {
21
- @include iui-icons-default;
22
- flex-shrink: 0;
23
- margin-left: $iui-m;
24
- }
25
-
26
- &-message {
27
- margin: $iui-baseline $iui-m;
28
- }
29
-
30
- &-link {
31
- @include iui-anchor-underline('on-initial');
32
- border-radius: $iui-border-radius;
33
- cursor: pointer;
34
- margin-left: $iui-s;
35
- user-select: none;
36
- white-space: nowrap;
37
- }
38
-
39
- > .iui-button {
40
- margin-left: auto;
41
- margin-right: $iui-s;
14
+ border: 1px solid var(--iui-color-background-5);
15
+ color: var(--iui-text-color);
16
+ background-color: var(--iui-color-background-1);
17
+ @media (forced-colors: active) {
18
+ background-color: Canvas;
42
19
  }
43
20
 
44
21
  &.iui-sticky {
45
22
  border-radius: 0;
46
- position: absolute;
23
+ position: sticky;
47
24
  top: 0;
48
25
  left: 0;
49
- width: 100vw;
50
26
  }
51
27
  }
52
28
 
29
+ @mixin iui-alert-icon {
30
+ @include iui-icons-default;
31
+ flex-shrink: 0;
32
+ margin-left: $iui-m;
33
+ }
34
+
35
+ @mixin iui-alert-message {
36
+ margin: $iui-baseline $iui-m;
37
+ }
38
+
39
+ @mixin iui-alert-link {
40
+ @include iui-anchor-underline('on-initial');
41
+ border-radius: $iui-border-radius;
42
+ cursor: pointer;
43
+ margin-left: $iui-s;
44
+ user-select: none;
45
+ white-space: nowrap;
46
+ }
47
+
48
+ @mixin iui-alert-button {
49
+ @include iui-button;
50
+ @include iui-button-borderless;
51
+ @include iui-button-size(small, borderless);
52
+ margin-left: auto;
53
+ margin-right: $iui-s;
54
+ }
55
+
56
+ @mixin iui-alert-button-icon {
57
+ @include iui-button-icon;
58
+ margin-left: $iui-component-offset;
59
+ margin-right: $iui-component-offset;
60
+ }
61
+
53
62
  /// Modifier mixin to categorize the alert
54
63
  /// @arg $statusColor Can be one of: positive, negative, warning, primary
55
64
  /// @arg $rootSelector Selector of the root alert element. Defaults to .iui-alert
56
65
  @mixin iui-alert-category($statusColor, $rootSelector: '.iui-alert') {
57
- @include themed {
58
- background: linear-gradient(
59
- rgba(t(iui-color-foreground-#{$statusColor}-rgb), t(iui-opacity-6)),
60
- rgba(t(iui-color-foreground-#{$statusColor}-rgb), t(iui-opacity-6))
61
- ),
62
- linear-gradient(t(iui-color-background-1), t(iui-color-background-1));
63
- border-color: t(iui-color-foreground-#{$statusColor});
64
- }
66
+ @include iui-alert;
67
+ background: linear-gradient(
68
+ rgba(var(--iui-color-foreground-#{$statusColor}-rgb), var(--iui-opacity-6)),
69
+ rgba(var(--iui-color-foreground-#{$statusColor}-rgb), var(--iui-opacity-6))
70
+ ),
71
+ linear-gradient(var(--iui-color-background-1), var(--iui-color-background-1));
72
+ border-color: var(--iui-color-foreground-#{$statusColor});
65
73
 
66
74
  #{$rootSelector}-icon {
67
- @include themed {
68
- fill: t(iui-icons-color-#{$statusColor});
69
- }
75
+ fill: var(--iui-icons-color-#{$statusColor});
70
76
  }
71
77
 
72
78
  #{$rootSelector}-message {
@@ -77,7 +83,7 @@
77
83
  @include iui-anchor-status($statusColor);
78
84
  }
79
85
 
80
- > .iui-button {
86
+ #{$rootSelector}-button {
81
87
  outline-color: var(--iui-color-foreground-#{$statusColor});
82
88
  }
83
89
  }
@@ -4,10 +4,30 @@
4
4
 
5
5
  .iui-alert {
6
6
  @include iui-alert;
7
+ }
7
8
 
8
- @each $status in positive, negative, warning, informational {
9
- &.iui-#{$status} {
10
- @include iui-alert-category($statusColor: if($status == informational, 'primary', $status));
11
- }
9
+ @each $status in positive, negative, warning, informational {
10
+ .iui-alert-#{$status} {
11
+ @include iui-alert-category($statusColor: if($status == informational, 'primary', $status));
12
12
  }
13
13
  }
14
+
15
+ .iui-alert-icon {
16
+ @include iui-alert-icon;
17
+ }
18
+
19
+ .iui-alert-message {
20
+ @include iui-alert-message;
21
+ }
22
+
23
+ .iui-alert-link {
24
+ @include iui-alert-link;
25
+ }
26
+
27
+ .iui-alert-button {
28
+ @include iui-alert-button;
29
+ }
30
+
31
+ .iui-alert-button-icon {
32
+ @include iui-alert-button-icon;
33
+ }
@@ -1,3 +1,78 @@
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/anchor'; // Reimports anchor from global styles
3
+ @import '../style/index';
4
+ @import '../utils/index';
5
+
6
+ @mixin iui-anchor {
7
+ @include iui-anchor-status('primary');
8
+ border-radius: $iui-border-radius;
9
+ cursor: pointer;
10
+
11
+ @include iui-anchor-underline('on-hover');
12
+
13
+ @media (prefers-contrast: more) {
14
+ @include iui-anchor-underline('on-initial');
15
+ }
16
+
17
+ @at-root {
18
+ .iui-theme-light &,
19
+ .iui-theme-dark & {
20
+ @include iui-anchor-underline('on-hover');
21
+ }
22
+ }
23
+
24
+ @at-root {
25
+ .iui-theme-light-hc &,
26
+ .iui-theme-dark-hc & {
27
+ @include iui-anchor-underline('on-initial');
28
+ }
29
+ }
30
+ }
31
+
32
+ @mixin iui-anchor-external {
33
+ --_iui-anchor-external-svg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='m16 0v5.4l-1.9-2-8.4 8.4-1.5-1.5 8.3-8.4-1.9-1.9m5.4 16v-9h-1v8h-14v-14h8v-1h-9v16z' /></svg>");
34
+
35
+ &::after {
36
+ content: '';
37
+ display: inline-block;
38
+ width: 1.5ch;
39
+ height: 1.5ch;
40
+ margin-left: 0.5ch;
41
+ vertical-align: -0.1ch;
42
+ background-color: currentColor;
43
+ mask: var(--_iui-anchor-external-svg);
44
+ @media (forced-colors: active) {
45
+ background-color: LinkText;
46
+ }
47
+ }
48
+ }
49
+
50
+ @mixin iui-anchor-status($status: primary) {
51
+ @include iui-focus($color: var(--iui-color-foreground-#{$status}), $offset: 1px);
52
+ color: var(--iui-color-foreground-#{$status});
53
+ -webkit-tap-highlight-color: rgba(var(--iui-color-foreground-#{$status}-rgb), var(--iui-opacity-5));
54
+ @if $status != primary {
55
+ @include iui-text-selection($status);
56
+ }
57
+
58
+ &:hover {
59
+ color: var(--iui-color-foreground-#{$status}-overlay);
60
+ }
61
+ }
62
+
63
+ /// $behavior should be one of: 'on-hover' or 'on-initial'
64
+ @mixin iui-anchor-underline($behavior: 'on-hover') {
65
+ @if $behavior == 'on-hover' {
66
+ text-decoration: none;
67
+
68
+ &:hover {
69
+ text-decoration: underline;
70
+ }
71
+ } @else {
72
+ text-decoration: underline;
73
+
74
+ &:hover {
75
+ text-decoration: none;
76
+ }
77
+ }
78
+ }
@@ -1,18 +1,19 @@
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 '../text/mixins';
5
4
 
6
- @mixin iui-user-icon-size($size: $iui-icons-xl, $font-size: $iui-font-size-leading) {
5
+ @mixin iui-avatar-size($size: $iui-icons-xl, $font-size: $iui-font-size-leading) {
7
6
  width: $size;
8
7
  height: $size;
9
8
 
10
9
  @if ($size == $iui-icons-xl) {
11
- --_iui-user-icon-status-size: #{$iui-xs * 1.5};
10
+ --_iui-avatar-status-size: #{$iui-xs * 1.5};
11
+ } @else if ($size == $iui-icons-large) {
12
+ --_iui-avatar-status-size: #{$iui-xs};
12
13
  } @else if ($size == $iui-icons-xxl) {
13
- --_iui-user-icon-status-size: #{$iui-s};
14
+ --_iui-avatar-status-size: #{$iui-s};
14
15
  } @else {
15
- --_iui-user-icon-status-size: #{$iui-sm};
16
+ --_iui-avatar-status-size: #{$iui-sm};
16
17
  }
17
18
 
18
19
  > .iui-initials {
@@ -1,9 +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
3
  @import '../style/index';
4
- @import '../text/mixins';
4
+ @import '../utils/index';
5
+ @import './avatar-sizes';
5
6
 
6
- @mixin iui-user-icon {
7
+ @mixin iui-avatar {
7
8
  @include iui-reset;
8
9
  display: inline-flex;
9
10
  align-items: center;
@@ -21,10 +22,7 @@
21
22
  height: 100%;
22
23
  margin: 0;
23
24
  border-radius: 50%;
24
- box-sizing: border-box;
25
- @include themed {
26
- box-shadow: inset 0 0 0 $iui-xxs rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-6));
27
- }
25
+ box-shadow: inset 0 0 0 $iui-xxs rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-6));
28
26
  }
29
27
 
30
28
  > .iui-initials {
@@ -45,9 +43,7 @@
45
43
  text-transform: uppercase;
46
44
  background-color: $iui-color-dataviz-celery;
47
45
  overflow: hidden;
48
- @include themed {
49
- color: t(iui-color-foreground-accessory);
50
- }
46
+ color: var(--iui-color-foreground-accessory);
51
47
  }
52
48
 
53
49
  > .iui-icon {
@@ -55,9 +51,7 @@
55
51
  width: 50%;
56
52
  height: 50%;
57
53
  position: absolute;
58
- @include themed {
59
- fill: t(iui-color-foreground-accessory);
60
- }
54
+ fill: var(--iui-color-foreground-accessory);
61
55
  }
62
56
 
63
57
  > img {
@@ -70,12 +64,11 @@
70
64
  height: 100%;
71
65
  border-width: 0;
72
66
  border-radius: 50%;
73
- @include themed {
74
- background-color: t(iui-color-background-1);
75
- }
67
+ background-color: var(--iui-color-background-1);
76
68
  }
77
69
 
78
70
  > .iui-status {
71
+ box-sizing: content-box;
79
72
  display: flex;
80
73
  align-items: center;
81
74
  justify-content: center;
@@ -85,86 +78,64 @@
85
78
  width: 25%;
86
79
  height: 25%;
87
80
  border-radius: 50%;
88
- @include themed {
89
- border: $iui-xxs solid t(iui-color-background-1);
90
- background-color: t(iui-color-background-5);
91
- }
81
+ border: $iui-xxs solid var(--iui-color-background-1);
82
+ background-color: var(--iui-color-background-5);
92
83
 
93
84
  &::after {
94
85
  content: '';
95
- width: var(--_iui-user-icon-status-size, $iui-s);
96
- height: var(--_iui-user-icon-status-size, $iui-s);
86
+ width: var(--_iui-avatar-status-size, $iui-s);
87
+ height: var(--_iui-avatar-status-size, $iui-s);
97
88
  }
98
89
 
99
90
  &.iui-online {
100
- @include themed {
101
- background-color: t(iui-color-background-positive);
102
- }
91
+ background-color: var(--iui-color-background-positive);
103
92
 
104
93
  &::after {
105
94
  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
- }
95
+ background-color: var(--iui-color-foreground-accessory);
109
96
  }
110
97
  }
111
98
 
112
99
  &.iui-away {
113
- @include themed {
114
- background-color: t(iui-color-background-warning);
115
- }
100
+ background-color: var(--iui-color-background-warning);
116
101
 
117
102
  &::after {
118
103
  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
- }
104
+ background-color: var(--iui-color-foreground-accessory);
122
105
  }
123
106
  }
124
107
 
125
108
  &.iui-busy {
126
- @include themed {
127
- background-color: t(iui-color-background-negative);
128
- }
109
+ background-color: var(--iui-color-background-negative);
129
110
 
130
111
  &::after {
131
112
  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
- }
113
+ background-color: var(--iui-color-foreground-accessory);
135
114
  }
136
115
  }
137
116
 
138
117
  &.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
- }
118
+ background-color: var(--iui-color-background-1);
119
+ box-shadow: inset 0 0 0 1px rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-3));
143
120
 
144
121
  &::after {
145
122
  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
- }
123
+ background-color: var(--iui-icons-color);
149
124
  }
150
125
  }
151
126
  }
152
127
 
153
- &.iui-user-icon-count {
128
+ &.iui-avatar-count {
154
129
  > .iui-initials {
155
- @include themed {
156
- background-color: t(iui-color-background-3);
157
- color: t(iui-text-color-muted);
158
- }
130
+ background-color: var(--iui-color-background-3);
131
+ color: var(--iui-text-color-muted);
159
132
  }
160
133
 
161
134
  &:focus {
162
135
  outline: none;
163
136
 
164
137
  > .iui-stroke {
165
- @include themed {
166
- box-shadow: t(iui-focus-box-shadow);
167
- }
138
+ box-shadow: var(--iui-focus-box-shadow);
168
139
  }
169
140
  }
170
141
 
@@ -174,37 +145,31 @@
174
145
 
175
146
  &:focus:not(:focus-visible) {
176
147
  > .iui-stroke {
177
- @include themed {
178
- box-shadow: inset 0 0 0 $iui-xxs rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-6));
179
- }
148
+ box-shadow: inset 0 0 0 $iui-xxs rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-6));
180
149
  }
181
150
  }
182
151
  }
183
152
  }
184
153
 
185
- @mixin iui-user-icon-list {
154
+ @mixin iui-avatar-list {
186
155
  display: inline-flex;
187
156
  flex-wrap: wrap;
188
157
 
189
- @include iui-user-icon-margins;
158
+ @include iui-avatar-margins;
190
159
 
191
160
  &.iui-stacked {
192
- .iui-user-icon:not(:first-child) {
161
+ .iui-avatar:not(:first-child) {
193
162
  margin-left: -$iui-xs;
194
163
 
195
164
  .iui-initials {
196
- @include themed {
197
- box-shadow: 0 0 0 $iui-xs t(iui-color-background-1);
198
- }
165
+ box-shadow: 0 0 0 $iui-xs var(--iui-color-background-1);
199
166
  }
200
167
 
201
168
  &.iui-small {
202
169
  margin-left: -$iui-xxs;
203
170
 
204
171
  .iui-initials {
205
- @include themed {
206
- box-shadow: 0 0 0 $iui-xxs t(iui-color-background-1);
207
- }
172
+ box-shadow: 0 0 0 $iui-xxs var(--iui-color-background-1);
208
173
  }
209
174
  }
210
175
 
@@ -219,20 +184,20 @@
219
184
 
220
185
  &.iui-animated {
221
186
  @media (prefers-reduced-motion: no-preference) {
222
- .iui-user-icon {
187
+ .iui-avatar {
223
188
  transition: margin-left $iui-speed ease-out;
224
189
  }
225
190
  }
226
191
 
227
192
  &:hover {
228
- @include iui-user-icon-margins;
193
+ @include iui-avatar-margins;
229
194
  }
230
195
  }
231
196
  }
232
197
  }
233
198
 
234
- @mixin iui-user-icon-margins {
235
- .iui-user-icon:not(:first-child) {
199
+ @mixin iui-avatar-margins {
200
+ .iui-avatar:not(:first-child) {
236
201
  margin-left: $iui-xs;
237
202
 
238
203
  &.iui-small {
@@ -0,0 +1,27 @@
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 './index';
4
+
5
+ .iui-avatar {
6
+ @include iui-avatar;
7
+
8
+ &#{&} {
9
+ @include iui-avatar-size;
10
+ }
11
+
12
+ &.iui-small {
13
+ @include iui-avatar-size($size: $iui-icons-large, $font-size: $iui-font-size-small);
14
+ }
15
+
16
+ &.iui-large {
17
+ @include iui-avatar-size($size: $iui-icons-xxl, $font-size: $iui-font-size-subheading);
18
+ }
19
+
20
+ &.iui-x-large {
21
+ @include iui-avatar-size($size: $iui-icons-3xl, $font-size: $iui-font-size-title);
22
+ }
23
+ }
24
+
25
+ .iui-avatar-list {
26
+ @include iui-avatar-list;
27
+ }
@@ -1,4 +1,3 @@
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 './user-icon';
4
- @import './sizes';
3
+ @import './avatar';
@@ -0,0 +1,27 @@
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-backdrop {
6
+ z-index: 998;
7
+ isolation: isolate;
8
+ position: absolute;
9
+ top: 0;
10
+ left: 0;
11
+ width: 100%;
12
+ height: 100%;
13
+ background-color: rgba(0, 0, 0, 0.4); // IE fallback
14
+ background-color: rgba(0, 0, 0, var(--iui-opacity-4));
15
+
16
+ &:not(.iui-backdrop-visible) {
17
+ visibility: hidden;
18
+ opacity: 0;
19
+ }
20
+
21
+ transition: visibility $iui-speed-instant linear, opacity $iui-speed-fast ease-out;
22
+ transition-delay: $iui-speed-fast, $iui-speed-instant;
23
+
24
+ &.iui-backdrop-visible {
25
+ transition-delay: $iui-speed-instant; // remove delay for entry animation
26
+ }
27
+ }
@@ -0,0 +1,7 @@
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 './index';
4
+
5
+ .iui-backdrop {
6
+ @include iui-backdrop;
7
+ }
@@ -0,0 +1,3 @@
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 './backdrop';
@@ -1,12 +1,14 @@
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
  $iui-badge-background-default: $iui-color-background-5--light;
6
7
  $iui-badge-background-positive: $iui-color-foreground-positive--dark;
7
8
  $iui-badge-background-negative: $iui-color-foreground-negative--dark;
8
9
  $iui-badge-background-warning: $iui-color-foreground-warning--dark;
9
10
  $iui-badge-background-primary: $iui-color-foreground-primary--dark;
11
+ $iui-badge-horizontal-padding: $iui-xs * 1.5;
10
12
 
11
13
  $iui-badge-text-color: rgba($iui-color-foreground-body--light, $iui-opacity-3--light);
12
14
 
@@ -17,14 +19,14 @@ $iui-badge-text-color: rgba($iui-color-foreground-body--light, $iui-opacity-3--l
17
19
  @include iui-reset;
18
20
  display: inline-block;
19
21
  font-size: $iui-font-size-small;
20
- padding: 0 $iui-xs * 1.5;
22
+ padding: 0 $iui-badge-horizontal-padding;
21
23
  margin: round($iui-baseline * 0.5) 0;
22
24
  border-radius: $iui-border-radius;
23
25
  background-color: var(--iui-badge-background-color);
24
26
  color: var(--_iui-badge-text-color);
25
27
  text-transform: uppercase;
26
28
  user-select: none;
27
- max-width: 20ch;
29
+ max-width: calc(20ch + $iui-badge-horizontal-padding * 2);
28
30
  white-space: nowrap;
29
31
  overflow: hidden;
30
32
  text-overflow: ellipsis;