@itwin/itwinui-css 0.44.0 → 0.46.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/itwinui-css",
3
- "version": "0.44.0",
3
+ "version": "0.46.0",
4
4
  "author": "Bentley Systems",
5
5
  "license": "MIT",
6
6
  "main": "src/index.scss",
@@ -49,7 +49,7 @@
49
49
  "createComponent": "node ./scripts/createComponent.js",
50
50
  "postcss-processing": "postcss lib/css -d lib/css --no-map && yarn print \"Finished post-processing CSS.\"",
51
51
  "clean": "rimraf ./lib ./backstop/results/bitmaps_test",
52
- "lint": "stylelint \"src/**/*.scss\" \"backstop/tests/*.html\"",
52
+ "lint": "stylelint \"src/**/*.scss\"",
53
53
  "lint:copyright": "node scripts/copyrightLinter.js",
54
54
  "approve": "backstop --config=./backstop/backstop.js approve",
55
55
  "test": "yarn build && yarn test:ci",
@@ -69,13 +69,13 @@
69
69
  "husky": "=4",
70
70
  "lint-staged": "^11.2.6",
71
71
  "node-sass": "^5.0.0",
72
- "postcss": "^8.2.15",
72
+ "postcss": "^8.4.5",
73
73
  "postcss-cli": "^8.3.1",
74
- "postcss-discard-comments": "^4.0.2",
74
+ "postcss-discard-comments": "^5.0.1",
75
75
  "prettier": "^2.4.1",
76
76
  "rimraf": "^3.0.2",
77
- "stylelint": "^13.10.0",
78
- "stylelint-config-sass-guidelines": "^8.0.0"
77
+ "stylelint": "^14.2.0",
78
+ "stylelint-config-sass-guidelines": "^9.0.1"
79
79
  },
80
80
  "resolutions": {
81
81
  "braces": "^2.3.1",
@@ -85,6 +85,7 @@
85
85
  "glob-parent": "^5.1.2",
86
86
  "jpeg-js": "^0.4.3",
87
87
  "set-value": "^4.1.0",
88
- "ansi-regex": "^5.0.1"
88
+ "ansi-regex": "^5.0.1",
89
+ "node-fetch": "^2.6.7"
89
90
  }
90
91
  }
@@ -20,7 +20,6 @@ $iui-button-padding-large: $iui-xs * 6;
20
20
  box-sizing: border-box;
21
21
  border-radius: $iui-border-radius;
22
22
  line-height: $iui-line-height;
23
- outline: none;
24
23
  box-shadow: none;
25
24
  font-size: $iui-font-size;
26
25
  font-weight: $iui-font-weight-normal;
@@ -37,15 +37,20 @@
37
37
  }
38
38
  }
39
39
 
40
- &.iui-active {
40
+ &.iui-active:enabled {
41
+ position: relative;
41
42
  @include themed {
42
- background: linear-gradient(
43
- rgba(t(iui-color-foreground-primary-rgb), t(iui-opacity-6)),
44
- rgba(t(iui-color-foreground-primary-rgb), t(iui-opacity-6))
45
- ),
46
- linear-gradient(t(iui-color-background-1), t(iui-color-background-1));
47
43
  color: t(iui-color-foreground-primary);
48
44
  }
45
+
46
+ &::before {
47
+ content: '';
48
+ position: absolute;
49
+ inset: 0;
50
+ @include themed {
51
+ background-color: rgba(t(iui-color-foreground-primary-rgb), t(iui-opacity-6));
52
+ }
53
+ }
49
54
  }
50
55
 
51
56
  &[disabled],
@@ -0,0 +1,119 @@
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
+ @import '../text/index';
5
+ @import '../button/button';
6
+
7
+ @mixin iui-carousel {
8
+ overflow: hidden;
9
+ @include iui-focus($offset: 4px);
10
+ border-radius: $iui-border-radius;
11
+ }
12
+
13
+ @mixin iui-carousel-slider {
14
+ display: flex;
15
+ list-style: none;
16
+ margin: 0;
17
+ padding: 0;
18
+ @media (prefers-reduced-motion: no-preference) {
19
+ transition: transform $iui-speed-slow ease-in-out;
20
+ }
21
+
22
+ &-item {
23
+ width: 100%;
24
+ flex-shrink: 0;
25
+ box-sizing: border-box;
26
+ }
27
+ }
28
+
29
+ @mixin iui-carousel-navigation {
30
+ display: flex;
31
+ align-items: center;
32
+ height: $iui-baseline * 3;
33
+ box-sizing: border-box;
34
+ @include themed {
35
+ border-top: $iui-xxs solid t(iui-color-background-4);
36
+ }
37
+
38
+ &-dots,
39
+ &-left,
40
+ &-right {
41
+ display: flex;
42
+ align-items: center;
43
+ flex: 1;
44
+
45
+ button[data-pressed='true'] {
46
+ outline-offset: -1px;
47
+ @include themed {
48
+ outline: 1px solid t(iui-color-foreground-primary);
49
+ }
50
+ }
51
+ }
52
+
53
+ &-dots {
54
+ @include iui-reset;
55
+ @include iui-focus;
56
+ border-radius: $iui-border-radius;
57
+ white-space: nowrap;
58
+ overflow: hidden;
59
+ justify-content: center;
60
+ list-style: none;
61
+ }
62
+
63
+ &-dot {
64
+ @include iui-button-size($size: small);
65
+ background-color: transparent;
66
+ border: none;
67
+ cursor: pointer;
68
+
69
+ &:hover::after {
70
+ @include themed {
71
+ background-color: rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-3));
72
+ }
73
+ }
74
+
75
+ &.iui-invisible {
76
+ display: none;
77
+ }
78
+
79
+ &::after {
80
+ content: '';
81
+ display: block;
82
+ width: $iui-icons-small;
83
+ height: $iui-icons-small;
84
+ border-radius: 50%;
85
+ transition: background-color $iui-speed-fast ease;
86
+ @media (prefers-reduced-motion: no-preference) {
87
+ transition: background-color $iui-speed-fast $iui-speed-fast ease, transform $iui-speed ease;
88
+ }
89
+ @include themed {
90
+ background-color: rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-4));
91
+ }
92
+ }
93
+
94
+ &.iui-first::after {
95
+ transform: scale(0.5);
96
+ }
97
+
98
+ &.iui-second::after {
99
+ transform: scale(0.75);
100
+ }
101
+
102
+ &.iui-invisible::after {
103
+ transform: scale(0);
104
+ @include themed {
105
+ background-color: rgba(t(iui-color-foreground-body-rgb), 0);
106
+ }
107
+ }
108
+
109
+ &.iui-active::after {
110
+ @include themed {
111
+ background-color: t(iui-color-foreground-primary);
112
+ }
113
+ }
114
+ }
115
+
116
+ &-right {
117
+ justify-content: flex-end;
118
+ }
119
+ }
@@ -0,0 +1,15 @@
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-carousel {
6
+ @include iui-carousel;
7
+ }
8
+
9
+ .iui-carousel-slider {
10
+ @include iui-carousel-slider;
11
+ }
12
+
13
+ .iui-carousel-navigation {
14
+ @include iui-carousel-navigation;
15
+ }
@@ -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 './carousel';
package/scss/classes.scss CHANGED
@@ -7,6 +7,7 @@
7
7
  @import './blockquote/classes';
8
8
  @import './breadcrumbs/classes';
9
9
  @import './button/classes';
10
+ @import './carousel/classes';
10
11
  @import './code/classes';
11
12
  @import './color-picker/classes';
12
13
  @import './date-picker/classes';
@@ -24,6 +25,7 @@
24
25
  @import './modal/classes';
25
26
  @import './non-ideal-state/classes';
26
27
  @import './notification-marker/classes';
28
+ @import './popover/classes';
27
29
  @import './progress-indicator/classes';
28
30
  @import './side-navigation/classes';
29
31
  @import './slider/classes';
package/scss/index.scss CHANGED
@@ -6,6 +6,7 @@
6
6
  @import './blockquote/index';
7
7
  @import './breadcrumbs/index';
8
8
  @import './button/index';
9
+ @import './carousel/index';
9
10
  @import './code/index';
10
11
  @import './color-picker/index';
11
12
  @import './date-picker/index';
@@ -22,6 +23,7 @@
22
23
  @import './modal/index';
23
24
  @import './non-ideal-state/index';
24
25
  @import './notification-marker/index';
26
+ @import './popover/index';
25
27
  @import './progress-indicator/index';
26
28
  @import './side-navigation/index';
27
29
  @import './slider/index';
@@ -9,7 +9,7 @@
9
9
  @include iui-input-container-label;
10
10
  }
11
11
 
12
- > .iui-input-icon {
12
+ .iui-input-icon {
13
13
  @include iui-input-icon;
14
14
  }
15
15
 
@@ -17,18 +17,16 @@
17
17
  @include iui-input-message;
18
18
  }
19
19
 
20
+ &.iui-inline-icon > .iui-input-icon {
21
+ @include iui-input-icon-inline;
22
+ }
23
+
20
24
  &.iui-inline-label {
21
25
  > .iui-label {
22
26
  @include iui-input-label-inline;
23
27
  }
24
28
  }
25
29
 
26
- &.iui-inline-icon {
27
- > .iui-input-icon {
28
- @include iui-input-icon-inline;
29
- }
30
- }
31
-
32
30
  @each $status in positive, negative, warning {
33
31
  &.iui-#{$status} {
34
32
  @include iui-input-status($status: $status);
@@ -44,12 +42,20 @@
44
42
  @include iui-input;
45
43
  }
46
44
 
45
+ .iui-select-button {
46
+ @include iui-select-button;
47
+ }
48
+
47
49
  .iui-textarea {
48
50
  @include iui-textarea;
49
51
  }
50
52
 
51
- .iui-select {
52
- @include iui-select;
53
+ .iui-input-with-icon {
54
+ @include iui-input-with-icon;
55
+ }
56
+
57
+ .iui-end-icon {
58
+ @include iui-end-icon;
53
59
  }
54
60
 
55
61
  .iui-checkbox {
@@ -2,6 +2,7 @@
2
2
  // See LICENSE.md in the project root for license terms and full copyright notice.
3
3
  @import './labeled-inputs';
4
4
  @import './input';
5
+ @import './input-with-icon';
5
6
  @import './textarea';
6
7
  @import './select';
7
8
  @import './checkbox-radio';
@@ -0,0 +1,36 @@
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 to have inputs combined with icon (eg. select)
6
+ @mixin iui-input-with-icon {
7
+ display: grid;
8
+ align-items: center;
9
+ cursor: pointer;
10
+
11
+ > :first-child {
12
+ grid-area: 1 / -1;
13
+ padding-right: $iui-icons-default + $iui-l;
14
+ }
15
+
16
+ &:focus-within {
17
+ > :first-child {
18
+ // --_focus-color can be used to control this from outside
19
+ outline: 2px solid var(--_focus-color, var(--iui-color-foreground-primary));
20
+ outline-offset: -2px;
21
+ }
22
+ }
23
+
24
+ &:hover {
25
+ > :first-child {
26
+ // --_hover-color can be used to control this from outside
27
+ border-color: var(--_hover-color, rgba(var(--iui-color-foreground-body-rgb), var(--iui-opacity-2)));
28
+ }
29
+ }
30
+ }
31
+
32
+ @mixin iui-end-icon {
33
+ @include iui-input-icon-inline;
34
+ display: flex;
35
+ grid-area: 1 / -1;
36
+ }
@@ -63,6 +63,7 @@
63
63
  border-color: t(iui-color-background-disabled);
64
64
  }
65
65
  cursor: not-allowed;
66
+ --_hover-color: var(--iui-color-background-disabled);
66
67
  }
67
68
  }
68
69
 
@@ -44,9 +44,9 @@
44
44
  }
45
45
 
46
46
  .iui-input,
47
+ .iui-input-with-icon,
47
48
  .iui-textarea,
48
- .iui-input-group,
49
- .iui-select {
49
+ .iui-input-group {
50
50
  grid-area: inputs;
51
51
  // stylelint-disable -- fix position in IE
52
52
  -ms-grid-row: 2;
@@ -84,9 +84,9 @@
84
84
  }
85
85
 
86
86
  .iui-input,
87
+ .iui-input-with-icon,
87
88
  .iui-textarea,
88
- .iui-input-group,
89
- .iui-select {
89
+ .iui-input-group {
90
90
  // stylelint-disable -- fix position in IE
91
91
  -ms-grid-row: 1;
92
92
  -ms-grid-column: 2;
@@ -220,7 +220,7 @@
220
220
  }
221
221
  }
222
222
 
223
- /// Icon to be shown near an input.
223
+ /// Icon to be shown near a message.
224
224
  @mixin iui-input-icon {
225
225
  display: flex;
226
226
  grid-area: icon;
@@ -245,9 +245,14 @@
245
245
 
246
246
  grid-area: inputs;
247
247
  justify-self: end;
248
- margin: 0 $iui-sm 0 0;
248
+ margin: 0 ($iui-sm + $iui-xxs) 0 0;
249
249
  position: relative;
250
250
 
251
+ svg {
252
+ width: $iui-icons-default;
253
+ height: $iui-icons-default;
254
+ }
255
+
251
256
  &.iui-button {
252
257
  height: 100%;
253
258
  width: fit-content;
@@ -259,15 +264,13 @@
259
264
  &.iui-actionable {
260
265
  align-items: center;
261
266
  height: 90%;
262
- margin-right: 1px;
267
+ margin-right: $iui-xxs;
263
268
  padding: 0 $iui-sm;
264
269
  cursor: pointer;
265
270
 
266
271
  @include iui-ripple(var(--iui-color-background-1), var(--iui-color-background-2));
267
272
 
268
273
  svg {
269
- width: $iui-icons-default;
270
- height: $iui-icons-default;
271
274
  @include themed {
272
275
  fill: t(iui-icons-color);
273
276
  }
@@ -278,6 +281,16 @@
278
281
  transform: rotate(180deg); // transform for arrow icon (e.g. svg-caret-down), used in combobox
279
282
  }
280
283
  }
284
+
285
+ &.iui-disabled {
286
+ cursor: not-allowed;
287
+
288
+ svg {
289
+ @include themed {
290
+ fill: t(iui-icons-color-actionable-disabled);
291
+ }
292
+ }
293
+ }
281
294
  }
282
295
 
283
296
  /// Mixin for applying status colors to input container.
@@ -319,9 +332,8 @@
319
332
  }
320
333
  }
321
334
 
322
- > .iui-input,
323
- > .iui-textarea,
324
- > .iui-select > .iui-select-button {
335
+ .iui-input,
336
+ .iui-textarea {
325
337
  padding-bottom: $iui-component-padding-vertical - 1px;
326
338
 
327
339
  &.iui-small {
@@ -344,4 +356,25 @@
344
356
  }
345
357
  }
346
358
  }
359
+
360
+ .iui-input-with-icon {
361
+ --_hover-color: var(--iui-color-foreground-#{$status});
362
+ --_focus-color: var(--iui-color-foreground-#{$status});
363
+ }
364
+
365
+ .iui-select-button {
366
+ border-bottom: transparent;
367
+
368
+ &::after {
369
+ content: '';
370
+ width: 100%;
371
+ position: absolute;
372
+ bottom: 0;
373
+ left: 0;
374
+ height: $iui-xxs;
375
+ @include themed {
376
+ background-color: t(iui-color-foreground-#{$status});
377
+ }
378
+ }
379
+ }
347
380
  }
@@ -3,112 +3,64 @@
3
3
  @import '../style/index';
4
4
  @import '../menu/index';
5
5
 
6
- $iui-after-border: 5px solid;
6
+ @mixin iui-select-button {
7
+ @include iui-focus($offset: -2px, $thickness: 2px);
8
+ width: 100%;
9
+ margin: 0;
10
+ border-radius: $iui-border-radius;
11
+ box-sizing: border-box;
12
+ padding: $iui-component-padding-vertical $iui-component-padding-horizontal;
13
+ min-height: $iui-component-height;
14
+ transition: border-color $iui-speed-fast ease-out;
7
15
 
8
- @mixin iui-select {
9
- @include iui-reset;
10
16
  display: flex;
11
- flex-direction: column;
17
+ align-items: center;
18
+ user-select: none;
12
19
  position: relative;
13
- width: 100%;
14
-
15
- > .iui-select-button {
16
- @include iui-input;
17
- @include iui-focus($offset: -2px, $thickness: 2px);
18
- display: flex;
19
- align-items: center;
20
- min-height: $iui-component-height;
21
- padding-right: $iui-xl;
22
- user-select: none;
23
- position: relative;
24
- @media (prefers-reduced-motion: no-preference) {
25
- transition: border-color $iui-speed-fast ease-out;
26
- }
27
-
28
- > .iui-icon {
29
- @include iui-menu-icon;
30
- }
31
-
32
- > .iui-content {
33
- overflow: hidden;
34
- white-space: nowrap;
35
- text-overflow: ellipsis;
36
- }
37
-
38
- &.iui-placeholder {
39
- @include themed {
40
- color: t(iui-text-color-placeholder);
41
- }
42
- }
43
-
44
- &::after {
45
- content: '';
46
- position: absolute;
47
- top: 50%;
48
- right: $iui-m;
49
- transform: translateY(-50%);
50
- width: 0;
51
- height: 0;
52
- border-left: $iui-after-border transparent;
53
- border-right: $iui-after-border transparent;
54
- @include themed {
55
- border-top: $iui-after-border t(iui-icons-color-actionable);
56
- }
57
- }
58
-
59
- &:hover {
60
- @include themed {
61
- border-color: rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-2));
62
- }
63
-
64
- &::after {
65
- border-bottom: none;
66
- @include themed {
67
- border-top: $iui-after-border t(iui-icons-color-actionable-hover);
68
- }
69
- }
70
- }
20
+ overflow: hidden;
71
21
 
72
- &.iui-active {
73
- &::after {
74
- border-top: none;
75
- @include themed {
76
- border-bottom: $iui-after-border t(iui-icons-color-actionable);
77
- }
78
- }
79
-
80
- &:hover::after {
81
- @include themed {
82
- border-bottom: $iui-after-border t(iui-icons-color-actionable-hover);
83
- }
84
- }
85
- }
86
-
87
- &.iui-disabled {
88
- cursor: not-allowed;
89
- @include themed {
90
- background-color: t(iui-color-background-disabled);
91
- border-color: t(iui-color-background-disabled);
92
- }
93
-
94
- &::after {
95
- @include themed {
96
- border-top: $iui-after-border t(iui-icons-color-actionable-disabled);
97
- }
98
- }
99
- }
22
+ @include themed {
23
+ color: t(iui-text-color);
24
+ background-color: t(iui-color-background-1);
25
+ border: 1px solid rgba(t(iui-color-foreground-body-rgb), t(iui-opacity-4));
100
26
  }
101
27
 
102
- &.iui-small .iui-select-button {
28
+ &.iui-small {
103
29
  padding-top: $iui-component-padding-vertical-small;
104
30
  padding-bottom: $iui-component-padding-vertical-small;
105
31
  min-height: $iui-component-height-small;
106
32
  }
107
33
 
108
- &.iui-large .iui-select-button {
34
+ &.iui-large {
109
35
  padding-top: $iui-component-padding-vertical-large;
110
36
  padding-bottom: $iui-component-padding-vertical-large;
111
37
  min-height: $iui-component-height-large;
112
38
  font-size: $iui-font-size-leading;
113
39
  }
40
+
41
+ &.iui-disabled {
42
+ @include themed {
43
+ background-color: t(iui-color-background-disabled);
44
+ border-color: t(iui-color-background-disabled);
45
+ }
46
+ --_hover-color: var(--iui-color-background-disabled);
47
+ cursor: not-allowed;
48
+ }
49
+
50
+ .iui-icon {
51
+ @include iui-menu-icon;
52
+ fill: currentColor;
53
+ }
54
+
55
+ .iui-content {
56
+ overflow: hidden;
57
+ white-space: nowrap;
58
+ text-overflow: ellipsis;
59
+ }
60
+
61
+ &.iui-placeholder {
62
+ @include themed {
63
+ color: t(iui-text-color-placeholder);
64
+ }
65
+ }
114
66
  }
@@ -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-popover {
6
+ @include iui-popover;
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 './popover';
@@ -0,0 +1,22 @@
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
+ // tippy.js helper class to hide Popover when it is scrolled out of view
6
+ @mixin iui-popover {
7
+ &[data-reference-hidden] {
8
+ visibility: hidden;
9
+ pointer-events: none;
10
+ }
11
+
12
+ // Resets tippy.js default stylings that interfere with our own
13
+ /* stylelint-disable-next-line selector-class-pattern */
14
+ &.tippy-box {
15
+ all: revert;
16
+ }
17
+
18
+ /* stylelint-disable-next-line selector-class-pattern */
19
+ .tippy-content {
20
+ all: revert;
21
+ }
22
+ }
@@ -135,7 +135,7 @@
135
135
  background-color: t(iui-color-background-1);
136
136
  }
137
137
 
138
- &.iui-zebra-striping > .iui-row:nth-child(even):not(.iui-selected) {
138
+ &.iui-zebra-striping .iui-row:nth-child(even):not(.iui-selected) {
139
139
  @include themed {
140
140
  background-color: rgba(t(iui-color-foreground-body-rgb), 0.02);
141
141
  }