@kaizen/components 1.74.1 → 1.74.2

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": "@kaizen/components",
3
- "version": "1.74.1",
3
+ "version": "1.74.2",
4
4
  "description": "Kaizen component library",
5
5
  "author": "Geoffrey Chong <geoff.chong@cultureamp.com>",
6
6
  "homepage": "https://cultureamp.design",
@@ -57,6 +57,9 @@ $dt-color-checkbox-background-color-checked: $color-gray-500;
57
57
  .checkbox:focus + & {
58
58
  background: white;
59
59
  border-color: $dt-color-form-border-color-hover;
60
+ outline: var(--border-focus-ring-border-width) var(--border-focus-ring-border-style)
61
+ var(--color-blue-500);
62
+ outline-offset: 1px;
60
63
  }
61
64
 
62
65
  .checkbox:checked:focus + &,
@@ -70,21 +73,6 @@ $dt-color-checkbox-background-color-checked: $color-gray-500;
70
73
  background: $dt-color-form-border-color-hover;
71
74
  border-color: $dt-color-form-border-color-hover;
72
75
  }
73
-
74
- .checkbox:focus + &::after {
75
- content: '';
76
- box-sizing: border-box;
77
- position: absolute;
78
- background: transparent;
79
- border-radius: $border-focus-ring-border-radius;
80
- border-width: $border-focus-ring-border-width;
81
- border-style: $border-focus-ring-border-style;
82
- border-color: $dt-color-form-border-color-focus;
83
- top: calc(-#{$focus-ring-offset} - calc(#{$checkbox-size} / 8));
84
- left: calc(-#{$focus-ring-offset} - calc(#{$checkbox-size} / 8));
85
- width: calc(#{$checkbox-size} + #{$focus-ring-offset} + #{$border-solid-border-width} * 2);
86
- height: calc(#{$checkbox-size} + #{$focus-ring-offset} + #{$border-solid-border-width} * 2);
87
- }
88
76
  }
89
77
 
90
78
  .box.reversed {
@@ -96,6 +84,10 @@ $dt-color-checkbox-background-color-checked: $color-gray-500;
96
84
  background: rgba($color-white-rgb, 0.65);
97
85
  }
98
86
 
87
+ .checkbox:focus + & {
88
+ outline-color: var(--color-blue-300);
89
+ }
90
+
99
91
  .checkbox:not([checked]):hover + &,
100
92
  .checkbox:not([checked]):focus + & {
101
93
  border-color: $color-white;
@@ -113,8 +105,4 @@ $dt-color-checkbox-background-color-checked: $color-gray-500;
113
105
  background: $color-white;
114
106
  border-color: $color-white;
115
107
  }
116
-
117
- .checkbox:focus + &::after {
118
- border-color: $dt-color-form-border-color-reversed-focus;
119
- }
120
108
  }
@@ -7,27 +7,16 @@
7
7
 
8
8
  position: relative;
9
9
  display: inline-flex;
10
+ border-radius: 100%;
10
11
 
11
12
  &:hover {
12
13
  cursor: pointer;
13
14
  }
14
15
 
15
- &:focus {
16
- outline: none;
17
- }
18
-
19
16
  &:focus-visible {
20
- &::after {
21
- $focus-ring-offset: -1px;
22
-
23
- content: '';
24
- position: absolute;
25
- background: transparent;
26
- border-width: $border-focus-ring-border-width;
27
- border-style: $border-focus-ring-border-style;
28
- border-radius: 50%;
29
- inset: $focus-ring-offset;
30
- }
17
+ outline: var(--border-focus-ring-border-width) var(--border-focus-ring-border-style)
18
+ var(--color-blue-500);
19
+ outline-offset: -1px;
31
20
  }
32
21
  }
33
22
 
@@ -38,12 +27,6 @@
38
27
  &:focus-visible {
39
28
  color: $color-purple-800;
40
29
  }
41
-
42
- &:focus-visible {
43
- &::after {
44
- border-color: $color-blue-500;
45
- }
46
- }
47
30
  }
48
31
 
49
32
  .reversed {
@@ -55,8 +38,6 @@
55
38
  }
56
39
 
57
40
  &:focus-visible {
58
- &::after {
59
- border-color: $color-blue-300;
60
- }
41
+ outline-color: var(--color-blue-300);
61
42
  }
62
43
  }
@@ -50,6 +50,10 @@ $input-with-icon-padding: calc(#{$input-icon-size} + calc(#{$spacing-md} * 0.75)
50
50
 
51
51
  &:focus:not([disabled]),
52
52
  &:hover:focus:not([disabled]) {
53
+ outline: var(--border-focus-ring-border-width) var(--border-focus-ring-border-style)
54
+ var(--color-blue-500);
55
+ outline-offset: 1px;
56
+
53
57
  @include form-input-placeholder {
54
58
  opacity: 0%;
55
59
  }
@@ -66,19 +70,6 @@ $input-with-icon-padding: calc(#{$input-icon-size} + calc(#{$spacing-md} * 0.75)
66
70
  }
67
71
  }
68
72
 
69
- .input:focus + .focusRing {
70
- $focus-ring-offset: 3px;
71
-
72
- position: absolute;
73
- background: transparent;
74
- border-radius: $border-focus-ring-border-radius;
75
- border-width: $border-focus-ring-border-width;
76
- border-style: $border-focus-ring-border-style;
77
- border-color: transparent;
78
- inset: -$focus-ring-offset;
79
- pointer-events: none;
80
- }
81
-
82
73
  /* stylelint-disable no-descending-specificity */
83
74
  ///////////////////////////////////////////////////
84
75
  // ICON ADORNMENT STYLES
@@ -278,8 +269,8 @@ $input-with-icon-padding: calc(#{$input-icon-size} + calc(#{$spacing-md} * 0.75)
278
269
  background: rgba($color-white-rgb, 0.1);
279
270
  }
280
271
 
281
- &:focus + .focusRing {
282
- border-color: $color-blue-300;
272
+ &:focus {
273
+ outline-color: var(--color-blue-300);
283
274
  }
284
275
 
285
276
  &:not(.error, .caution) {
@@ -62,10 +62,6 @@ export const Input = ({
62
62
  {...restProps}
63
63
  />
64
64
 
65
- {/* Inputs aren't able to have pseudo elements like ::after on them,
66
- so we have to create an element ourselves for the focus ring */}
67
- <div className={styles.focusRing} />
68
-
69
65
  {endIconAdornment && <div className={styles.endIconAdornment}>{endIconAdornment}</div>}
70
66
  </div>
71
67
  )
@@ -60,19 +60,11 @@ $classname--input: '.input[type="search"]';
60
60
  opacity: 0%;
61
61
  }
62
62
  }
63
- }
64
63
 
65
- .focusRing {
66
- #{$classname--input}:focus + & {
67
- $focus-ring-offset: 3px;
68
-
69
- position: absolute;
70
- background: transparent;
71
- border-radius: $border-solid-border-radius-curved;
72
- border-width: $border-focus-ring-border-width;
73
- border-style: $border-focus-ring-border-style;
74
- inset: -$focus-ring-offset;
75
- pointer-events: none;
64
+ &:focus {
65
+ outline: var(--border-focus-ring-border-width) var(--border-focus-ring-border-style)
66
+ var(--color-blue-500);
67
+ outline-offset: 1px;
76
68
  }
77
69
  }
78
70
 
@@ -123,10 +115,6 @@ $classname--input: '.input[type="search"]';
123
115
  }
124
116
  }
125
117
 
126
- .focusRing {
127
- border-color: $color-blue-500;
128
- }
129
-
130
118
  .startIconAdornment {
131
119
  color: $color-purple-800;
132
120
  opacity: $start-icon-opacity--default;
@@ -162,10 +150,6 @@ $classname--input: '.input[type="search"]';
162
150
  }
163
151
  }
164
152
 
165
- .focusRing {
166
- border-color: $color-blue-500;
167
- }
168
-
169
153
  .startIconAdornment {
170
154
  color: $color-purple-800;
171
155
  opacity: $start-icon-opacity--default;
@@ -198,10 +182,10 @@ $classname--input: '.input[type="search"]';
198
182
  color: $color-white;
199
183
  opacity: $input-placeholder-opacity--reversed;
200
184
  }
201
- }
202
185
 
203
- .focusRing {
204
- border-color: $color-blue-300;
186
+ &:focus {
187
+ outline-color: var(--color-blue-300);
188
+ }
205
189
  }
206
190
 
207
191
  .startIconAdornment {
@@ -75,9 +75,6 @@ export const InputSearch = (props: InputSearchProps): JSX.Element => {
75
75
  readOnly={onChange === undefined}
76
76
  {...restProps}
77
77
  />
78
- {/* Inputs aren't able to have pseudo elements like ::after on them,
79
- so we have to create an element ourselves for the focus ring */}
80
- <div className={styles.focusRing} />
81
78
 
82
79
  {value && (
83
80
  <ClearButton
@@ -10,15 +10,10 @@
10
10
  outline: 0;
11
11
  }
12
12
 
13
- .link[data-focus-visible]::after {
14
- content: '';
15
- position: absolute;
16
- background: transparent;
17
- border-color: var(--color-blue-500);
18
- border-radius: 0;
19
- border-width: var(--border-focus-ring-border-width);
20
- border-style: var(--border-focus-ring-border-style);
21
- inset: calc(-1 * (var(--border-focus-ring-border-width) * 2) - 1px);
13
+ .link[data-focus-visible] {
14
+ outline: var(--border-focus-ring-border-width) var(--border-focus-ring-border-style)
15
+ var(--color-blue-500);
16
+ outline-offset: 3px;
22
17
  }
23
18
 
24
19
  .isUnderlined {
@@ -94,8 +89,8 @@
94
89
  --link-text-color: var(--color-white);
95
90
  }
96
91
 
97
- .white[data-focus-visible]::after {
98
- border-color: var(--color-blue-300);
92
+ .white[data-focus-visible] {
93
+ outline-color: var(--color-blue-300);
99
94
  }
100
95
 
101
96
  .white.isDisabled {
@@ -106,8 +101,8 @@
106
101
  --link-text-color: var(--color-white);
107
102
  }
108
103
 
109
- .reversed[data-focus-visible]::after {
110
- border-color: var(--color-blue-300);
104
+ .reversed[data-focus-visible] {
105
+ outline-color: var(--color-blue-300);
111
106
  }
112
107
 
113
108
  .link.isDisabled {
@@ -56,17 +56,11 @@
56
56
  }
57
57
 
58
58
  // wrap the modal container with a focus ring when the title has focus
59
- // don't copy this over on the rebuild
60
- // rather than putting the focus on the title, put it on the role=dialog element itself
61
- &:has(:global([class*='modalLabel']):focus-visible)::after {
62
- content: '';
63
- position: absolute;
64
- background: transparent;
65
- border-radius: $border-focus-ring-border-radius;
66
- border-width: $border-focus-ring-border-width;
67
- border-style: $border-focus-ring-border-style;
68
- border-color: $color-blue-300;
69
- inset: -4px;
59
+ // for the rebuild: rather than putting the focus on the title, put it on the role=dialog element itself
60
+ &:has(:global([class*='modalLabel']):focus-visible) {
61
+ outline: var(--border-focus-ring-border-width) var(--border-focus-ring-border-style)
62
+ var(--color-blue-300);
63
+ outline-offset: 2px;
70
64
  }
71
65
  }
72
66
 
@@ -34,24 +34,12 @@
34
34
  display: flex;
35
35
  align-items: center;
36
36
  justify-content: center;
37
+ border-radius: var(--border-solid-border-radius);
37
38
 
38
- &:focus,
39
39
  &:focus-visible {
40
- outline: none;
41
- }
42
-
43
- &:focus-visible::after {
44
- $focus-ring-offset: var(--spacing-2);
45
-
46
- content: '';
47
- pointer-events: none;
48
- position: absolute;
49
- background: transparent;
50
- border-radius: $border-focus-ring-border-radius;
51
- border-width: $border-focus-ring-border-width;
52
- border-style: $border-focus-ring-border-style;
53
- border-color: $color-blue-500;
54
- inset: $focus-ring-offset;
40
+ outline: var(--border-focus-ring-border-width) var(--border-focus-ring-border-style)
41
+ var(--color-blue-500);
42
+ outline-offset: -4px;
55
43
  }
56
44
  }
57
45
 
@@ -52,22 +52,9 @@ $dt-color-radio-border-color-focus-reversed: $color-blue-300;
52
52
 
53
53
  .radioInput:focus:not([disabled]) + & {
54
54
  border-color: $dt-color-radio-disc-color-base;
55
- }
56
-
57
- .radioInput:focus:not([disabled]) + &::after {
58
- pointer-events: none;
59
- content: '';
60
- box-sizing: border-box;
61
- position: absolute;
62
- background: transparent;
63
- border-radius: $radio-size + $focus-ring-offset;
64
- border-width: $border-focus-ring-border-width;
65
- border-style: $border-focus-ring-border-style;
66
- border-color: $dt-color-radio-border-color-focus;
67
- top: calc(-#{$focus-ring-offset} - calc(#{$radio-size} / 8));
68
- left: calc(-#{$focus-ring-offset} - calc(#{$radio-size} / 8));
69
- width: calc(#{$radio-size} + #{$focus-ring-offset} + #{$border-solid-border-width} * 2);
70
- height: calc(#{$radio-size} + #{$focus-ring-offset} + #{$border-solid-border-width} * 2);
55
+ outline: var(--border-focus-ring-border-width) var(--border-focus-ring-border-style)
56
+ var(--color-blue-500);
57
+ outline-offset: 1px;
71
58
  }
72
59
 
73
60
  .radioInput:not([disabled]) + &:hover {
@@ -81,10 +68,7 @@ $dt-color-radio-border-color-focus-reversed: $color-blue-300;
81
68
 
82
69
  .radioInput:focus:not([disabled]) + & {
83
70
  border-color: $color-white;
84
- }
85
-
86
- .radioInput:focus:not([disabled]) + &::after {
87
- border-color: $dt-color-radio-border-color-focus-reversed;
71
+ outline-color: $dt-color-radio-border-color-focus-reversed;
88
72
  }
89
73
 
90
74
  .radioInput:not([disabled]) + &:hover {
@@ -53,15 +53,10 @@
53
53
  --button-text-color: var(--color-white);
54
54
  }
55
55
 
56
- &[data-focus-visible]::after {
57
- content: '';
58
- position: absolute;
59
- background: transparent;
60
- border-color: var(--color-blue-500);
61
- border-radius: var(--border-focus-ring-border-radius);
62
- border-width: var(--border-focus-ring-border-width);
63
- border-style: var(--border-focus-ring-border-style);
64
- inset: calc(-1 * (var(--border-focus-ring-border-width) * 2) - 1px);
56
+ &[data-focus-visible] {
57
+ outline: var(--border-focus-ring-border-width) var(--border-focus-ring-border-style)
58
+ var(--color-blue-500);
59
+ outline-offset: 1px;
65
60
  }
66
61
  }
67
62
 
@@ -164,8 +159,8 @@
164
159
  .primaryReversed,
165
160
  .secondaryReversed,
166
161
  .tertiaryReversed {
167
- &[data-focus-visible]::after {
168
- border-color: var(--color-blue-300);
162
+ &[data-focus-visible] {
163
+ outline-color: var(--color-blue-300);
169
164
  }
170
165
  }
171
166
 
@@ -9,9 +9,7 @@
9
9
  }
10
10
  }
11
11
 
12
- .interactiveIcon:focus::after {
13
- position: absolute;
14
- content: '';
15
- border: var(--border-focus-ring-border-width) solid var(--color-blue-500);
16
- inset: -2px;
12
+ .interactiveIcon:focus {
13
+ outline: var(--border-focus-ring-border-width) var(--border-focus-ring-border-style)
14
+ var(--color-blue-500);
17
15
  }
@@ -40,18 +40,8 @@ $iconAndBadgeHeight: $spacing-md;
40
40
  &.isFocusVisible {
41
41
  background-color: $color-blue-100;
42
42
  color: $color-blue-500;
43
-
44
- &::after {
45
- $focus-ring-offset: calc((#{$border-focus-ring-border-width} * 2) + 1px);
46
-
47
- content: '';
48
- position: absolute;
49
- background: transparent;
50
- border: $border-focus-ring-border-width $border-focus-ring-border-style $color-blue-500;
51
- border-radius: 4px;
52
- inset: calc(-1 * #{$focus-ring-offset});
53
- z-index: 1; // show border when sibling option is hovered
54
- }
43
+ outline: var(--border-focus-ring-border-width) var(--border-focus-ring-border-style)
44
+ var(--color-blue-500);
55
45
 
56
46
  .icon {
57
47
  color: $color-blue-500;
@@ -54,20 +54,11 @@
54
54
  }
55
55
 
56
56
  &:focus {
57
- outline: none;
57
+ outline: var(--border-focus-ring-border-width) var(--border-focus-ring-border-style)
58
+ var(--color-blue-500);
59
+ outline-offset: 1px;
58
60
  background-color: $color-gray-200;
59
61
  border-color: $color-gray-600;
60
-
61
- &::after {
62
- $focus-ring-offset: calc((#{$border-focus-ring-border-width} * 2) + 1px);
63
-
64
- content: '';
65
- position: absolute;
66
- background: transparent;
67
- border: $border-focus-ring-border-width $border-focus-ring-border-style $color-blue-500;
68
- border-radius: $border-focus-ring-border-radius;
69
- inset: calc(-1 * #{$focus-ring-offset});
70
- }
71
62
  }
72
63
  }
73
64
 
@@ -115,9 +106,7 @@
115
106
  }
116
107
 
117
108
  &:focus {
118
- &::after {
119
- border-color: $color-blue-300;
120
- }
109
+ outline-color: var(--color-blue-300);
121
110
  }
122
111
 
123
112
  .error {
@@ -12,20 +12,9 @@
12
12
 
13
13
  &:focus,
14
14
  &:focus-visible {
15
- outline: none;
16
-
17
- &::after {
18
- $focus-ring-offset: -3px;
19
-
20
- border-color: $color-blue-500;
21
- content: '';
22
- position: absolute;
23
- background: transparent;
24
- border-width: $border-focus-ring-border-width;
25
- border-style: $border-focus-ring-border-style;
26
- border-radius: 50%;
27
- inset: $focus-ring-offset;
28
- }
15
+ outline: var(--border-focus-ring-border-width) var(--border-focus-ring-border-style)
16
+ var(--color-blue-500);
17
+ outline-offset: 1px;
29
18
  }
30
19
 
31
20
  &::before {