@atlassian/aui 9.12.3 → 9.12.5

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@atlassian/aui",
3
3
  "description": "Atlassian User Interface library",
4
- "version": "9.12.3",
4
+ "version": "9.12.5",
5
5
  "author": "Atlassian Pty Ltd.",
6
6
  "homepage": "https://aui.atlassian.com",
7
7
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@ function flag (flagOptions) {
31
31
  if (options.close === 'auto') {
32
32
  makeCloseable($flag);
33
33
 
34
- if ($flag.attr('aui-focus-trap') === 'false') {
34
+ if ($flag.attr('role') === 'alert') {
35
35
  makeAutoClosable($flag, options.duration);
36
36
  }
37
37
  } else if (options.close === 'manual') {
@@ -42,7 +42,7 @@ function flag (flagOptions) {
42
42
  insertFlag($flag);
43
43
 
44
44
  setTimeout(function () {
45
- if ($flag.attr('aui-focus-trap') === 'true') {
45
+ if (($flag.attr('role') === 'alertdialog')) {
46
46
  getFocusManager.global.enter($flag);
47
47
  }
48
48
  }, 0)
@@ -90,11 +90,14 @@ function renderFlagElement ({ body, title, close, type, ariaLive, ariaLabel, ari
90
90
 
91
91
  return $('<div class="aui-flag"></div>')
92
92
  .attr({
93
- 'aui-focus-trap': `${isFocusable}`,
94
93
  'aria-label': escapeHtml(ariaLabel),
95
94
  'aria-hidden': 'false',
96
95
  'aria-live': escapeHtml(ariaLive),
97
96
  'role': ariaRole,
97
+ ...(isFocusable ? {
98
+ 'data-aui-focus-selector': FOCUSABLE_QUERY.split(', ').map((item) => `.aui-message ${item}`).join(', '),
99
+ 'data-aui-focus': 'true',
100
+ } : {}),
98
101
  ...(!!ariaDescription ? {'aria-description': escapeHtml(ariaDescription)} : {}),
99
102
  })
100
103
  .append($message);
@@ -127,7 +130,7 @@ function makeAutoClosable ($flag, duration) {
127
130
  function closeFlag ($flagToClose) {
128
131
  const flag = $flagToClose.get(0);
129
132
 
130
- if ($flagToClose.attr('aui-focus-trap')) {
133
+ if ($flagToClose.attr('role') === 'alertdialog') {
131
134
  getFocusManager.global.exit($flagToClose);
132
135
  }
133
136
 
@@ -137,7 +140,6 @@ function closeFlag ($flagToClose) {
137
140
  flag.style.display = 'none';
138
141
  flag.dispatchEvent(new CustomEvent('aui-flag-close', { bubbles: true }));
139
142
 
140
-
141
143
  return flag;
142
144
  }
143
145
 
@@ -44,6 +44,7 @@
44
44
  input {
45
45
  background: @bg-color;
46
46
  border: @aui-form-field-border-width solid @border-color;
47
+ #aui-forms.with-design-tokens-dependent-border-width();
47
48
  border-radius: @border-radius;
48
49
  box-shadow: none;
49
50
  box-sizing: border-box;
@@ -97,7 +98,7 @@
97
98
 
98
99
  input {
99
100
  &:focus {
100
- #aui.with-focus-border();
101
+ #aui.with-focus-ring(@width: 1px, @inset: true, @set-border-color: true);
101
102
 
102
103
  background: @focus-bg-color;
103
104
  color: @focus-text-color;
@@ -87,6 +87,7 @@
87
87
 
88
88
  .aui-select2-drop {
89
89
  border: @aui-form-field-border-width solid @aui-button-border-color;
90
+ #aui-forms.with-design-tokens-dependent-border-width();
90
91
  }
91
92
 
92
93
  .select2-drop.select2-drop-above .select2-search input {
@@ -104,7 +105,7 @@
104
105
  input {
105
106
  //padding for the icon
106
107
  padding-right: (@icon-offset/2) + @aui-icon-size-small;
107
- #aui.with-focus-border();
108
+ #aui.with-focus-ring(@inset: true);
108
109
  border-radius: @aui-select2-form-field-border-radius;
109
110
  //we need to use important because jquery plugin uses important as well :(
110
111
  background: none !important;
@@ -270,7 +271,7 @@
270
271
  font-family: inherit;
271
272
  font-size: 14px;
272
273
  height: 1.4285714285714em; /* 20px - using ems so the fields increase in line with user specified font-sizes */
273
- line-height: 1.4285714285714;
274
+ line-height: @aui-form-field-line-height;
274
275
  margin: 0;
275
276
  padding: 0;
276
277
  }
@@ -392,7 +393,7 @@
392
393
  display: inline-block;
393
394
  filter: none;
394
395
  height: 2.1428571428571em; /* 30px - using ems so the fields increase in line with user specified font-sizes */
395
- line-height: 1.4285714285714;
396
+ line-height: @aui-form-field-line-height;
396
397
  margin: 0;
397
398
  padding: 4px 10px;
398
399
  text-decoration: none;
@@ -1,5 +1,6 @@
1
1
  @import (reference) './imports/global';
2
2
  @import (reference) './imports/aui-theme/components/forms';
3
+ @import (reference) './imports/mixins/shadows';
3
4
  /*
4
5
  Icons.
5
6
  */
@@ -42,9 +43,11 @@ form.aui {
42
43
  .select {
43
44
  &[data-aui-notification-error] {
44
45
  border-color: @aui-notification-error-color;
46
+ #aui.with-box-shadow(@aui-notification-error-color, @inset: true, @width: 1px);
45
47
  }
46
48
  &[data-aui-notification-success] {
47
49
  border-color: @aui-notification-success-color;
50
+ #aui.with-box-shadow(@aui-notification-success-color, @inset: true, @width: 1px);
48
51
  }
49
52
  }
50
53
  }
@@ -73,7 +73,9 @@ form.aui:not(.aui-legacy-forms) {
73
73
  .select {
74
74
  #aui.transition(background-color @aui-form-transition-time ease-in-out);
75
75
  #aui.transition(border-color @aui-form-transition-time ease-in-out);
76
+ #aui.transition(box-shadow @aui-form-transition-time ease-in-out);
76
77
  border: @aui-form-field-border-width solid @aui-form-field-border-color;
78
+ #aui-forms.with-design-tokens-dependent-border-width();
77
79
  border-radius: @aui-form-field-border-radius;
78
80
  box-sizing: border-box;
79
81
  font-size: inherit;
@@ -85,7 +87,9 @@ form.aui:not(.aui-legacy-forms) {
85
87
  .aui-select2-container .select2-choices {
86
88
  #aui.transition(background-color @aui-form-transition-time ease-in-out);
87
89
  #aui.transition(border-color @aui-form-transition-time ease-in-out);
90
+ #aui.transition(box-shadow @aui-form-transition-time ease-in-out);
88
91
  border: @aui-form-field-border-width solid var(--aui-select2-field-border-color);
92
+ #aui-forms.with-design-tokens-dependent-border-width();
89
93
  border-radius: @aui-form-field-border-radius;
90
94
  box-sizing: border-box;
91
95
  font-size: inherit;
@@ -104,7 +108,7 @@ form.aui:not(.aui-legacy-forms) {
104
108
  .select,
105
109
  .aui-select2-container .select2-choices {
106
110
  height: @aui-form-field-height;
107
- line-height: 1.4285714285714;
111
+ line-height: @aui-form-field-line-height;
108
112
  padding: 3px 4px;
109
113
  }
110
114
 
@@ -112,7 +116,7 @@ form.aui:not(.aui-legacy-forms) {
112
116
  .select[size],
113
117
  .multi-select {
114
118
  height: auto;
115
- line-height: 1.4285714285714;
119
+ line-height: @aui-form-field-line-height;
116
120
  margin: 0;
117
121
  padding: 3px 4px;
118
122
  }
@@ -144,23 +148,24 @@ form.aui:not(.aui-legacy-forms) {
144
148
  #aui-forms.aui-input-field-style(focus);
145
149
  }
146
150
  }
151
+ .select,
152
+ .multi-select
153
+ {
154
+ &:focus {
155
+ #aui.with-focus-ring(@width: 1px, @inset: false, @set-border-color: true);
156
+ }
157
+ }
147
158
  .text,
148
159
  .password,
149
160
  .textarea,
150
- .select,
151
- .multi-select,
152
161
  .aui-select2-container .select2-choices {
153
- // Forms get a custom "border-as-focus" style, because:
154
- // a) the form field doesn't "grow" in size,
155
- // b) the "focus ring" is impossible to clip when it's a border, and
156
- // c) it's more in line with how Atlaskit does it.
157
162
  &:focus {
158
- #aui.with-focus-border(@aui-focus-ring-color, @aui-form-field-border-width);
163
+ #aui.with-focus-ring(@width: 1px, @inset: true, @set-border-color: true);
159
164
  }
160
165
  }
161
166
 
162
167
  .aui-select2-container.select2-container-active .select2-choices {
163
- #aui.with-focus-border();
168
+ #aui.with-focus-ring(@width: 1px, @inset: false, @set-border-color: true);
164
169
  }
165
170
 
166
171
  .button,
@@ -37,7 +37,7 @@ form.aui.aui-legacy-forms {
37
37
  .select,
38
38
  .aui-select2-container .select2-choices {
39
39
  height: @aui-form-field-height;
40
- line-height: 1.4285714285714;
40
+ line-height: @aui-form-field-line-height;
41
41
  padding: 4px 5px;
42
42
  }
43
43
 
@@ -45,7 +45,7 @@ form.aui.aui-legacy-forms {
45
45
  .select[size],
46
46
  .multi-select {
47
47
  height: auto;
48
- line-height: 1.4285714285714;
48
+ line-height: @aui-form-field-line-height;
49
49
  margin: 0;
50
50
  padding: 4px 5px;
51
51
  }
@@ -89,7 +89,7 @@ form.aui.aui-legacy-forms {
89
89
  }
90
90
 
91
91
  .aui-select2-container.select2-container-active .select2-choices {
92
- #aui.with-focus-border();
92
+ #aui.with-focus-ring(@width: 1px, @inset: true, @set-border-color: true);
93
93
  }
94
94
 
95
95
  .aui-select2-container.select2-container-multi .select2-choices {
@@ -243,7 +243,7 @@ form.aui .button {
243
243
  #aui-buttons.aui-button-base();
244
244
  #aui-buttons.aui-button-style(normal);
245
245
  height: @aui-form-field-height;
246
- line-height: 1.4285714285714;
246
+ line-height: @aui-form-field-line-height;
247
247
  margin: 0;
248
248
  padding: @aui-button-padding-y @aui-button-padding-x;
249
249
  text-decoration: none;
@@ -26,6 +26,7 @@
26
26
 
27
27
  @aui-form-field-border-radius: @aui-border-radius-smallish;
28
28
  @aui-form-field-border-width: 2px;
29
+ @aui-form-field-border-width-dt: 1px;
29
30
 
30
31
  @aui-form-field-width-default: 250px;
31
32
  @aui-form-field-width-short: 75px;
@@ -34,6 +35,7 @@
34
35
  @aui-form-field-width-long: 500px;
35
36
  @aui-form-field-width-full: none;
36
37
  @aui-form-field-height: unit((30px / @aui-font-size-medium), em); // 30px - using ems so the fields increase in line with user specified font-sizes
38
+ @aui-form-field-line-height: 1.4285714285714; // 20px
37
39
 
38
40
  @aui-form-transition-time: 0.2s;
39
41
 
@@ -81,6 +83,14 @@
81
83
  width: @aui-form-button-size + @aui-form-button-border-width * 2 + (@aui-form-radio-checkbox-outline-padding-space * 2);
82
84
  height: @aui-form-button-size + @aui-form-button-border-width * 2 + (@aui-form-radio-checkbox-outline-padding-space * 2);
83
85
  }
86
+
87
+ .with-design-tokens-dependent-border-width() {
88
+ border-width: @aui-form-field-border-width;
89
+
90
+ #aui-themes.when-design-tokens({
91
+ border-width: @aui-form-field-border-width-dt;
92
+ });
93
+ }
84
94
  }
85
95
 
86
96
  #aui-legacy-forms {
@@ -1,26 +1,16 @@
1
1
  @import (reference) '../aui-theme/core/colors';
2
+ @import (reference) './shadows';
2
3
 
3
4
  @aui-focus-ring-color: var(--aui-focus);
4
5
 
5
6
  #aui {
6
- .with-focus-ring(@color: @aui-focus-ring-color; @outline-width: 2px; @inset: false) {
7
+ .with-focus-ring(@width: 2px; @inset: false; @set-border-color: false) {
7
8
  outline-style: none;
8
- & when (@inset = true) {
9
- box-shadow+: inset 0 0 0 @outline-width @color;
10
- }
11
- & when (@inset = false) {
12
- box-shadow+: 0 0 0 @outline-width @color;
13
- }
14
- }
15
9
 
16
- .with-focus-border(@color: @aui-focus-ring-color, @outline-width: 2px) {
17
- outline: none;
18
- border-width: @outline-width;
19
- border-color: @color;
10
+ #aui.with-box-shadow(@aui-focus-ring-color, @width, @inset);
20
11
 
21
- &:focus-visible {
22
- // Undoing the implementation in .with-focus-ring() mixin
23
- box-shadow: unset;
12
+ & when (@set-border-color = true) {
13
+ border-color: @aui-focus-ring-color;
24
14
  }
25
15
  }
26
16
 
@@ -46,4 +46,13 @@
46
46
  });
47
47
  }
48
48
  }
49
+
50
+ .with-box-shadow(@color; @width: 2px; @inset: false) {
51
+ & when (@inset = true) {
52
+ box-shadow+: inset 0 0 0 @width @color;
53
+ }
54
+ & when (@inset = false) {
55
+ box-shadow+: 0 0 0 @width @color;
56
+ }
57
+ }
49
58
  }