@atlassian/aui 9.1.9 → 9.2.3-4dc984d9f

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.1.9",
4
+ "version": "9.2.3-4dc984d9f",
5
5
  "author": "Atlassian Pty Ltd.",
6
6
  "homepage": "https://aui.atlassian.com",
7
7
  "license": "Apache-2.0",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@atlassian/adg-server-iconfont": "3.1.0",
49
- "@atlassian/aui-webpack-config": "1.0.0",
49
+ "@atlassian/aui-webpack-config": "2.0.0",
50
50
  "@babel/core": "7.13.14",
51
51
  "@babel/preset-env": "7.13.12",
52
52
  "bundlesize": "^1.0.0-beta.2",
@@ -56,7 +56,8 @@
56
56
  "ignore-emit-webpack-plugin": "^2.0.2",
57
57
  "jquery": "3.5.1",
58
58
  "jquery-migrate": "3.3.2",
59
- "less": "^3.10.3"
59
+ "less": "3.11.1",
60
+ "webpack-cli": "3.3.12"
60
61
  },
61
62
  "scripts": {
62
63
  "prepublishOnly": "yarn clean && cross-env NODE_ENV=production yarn build",
@@ -337,11 +337,6 @@ const initPolyfill = function (datePicker) {
337
337
  // shows that changing the `type` of input does not erase its value.
338
338
  // see https://codepen.io/chrisdarroch/pen/YzwgjyJ
339
339
  $field.prop('type', 'text');
340
- // Set default value on initialization to handle all date formats.
341
- // It is possible, because of changing type to text on the line above.
342
- $field.val($field.attr('value'));
343
- // Trigger change to update calendar popup value.
344
- $field.trigger('propertychange');
345
340
 
346
341
  // demonstrate the polyfill is initialised
347
342
  $field.attr('data-aui-dp-uuid', datePickerUUID);
@@ -454,7 +454,7 @@ function setLayerAlignment(dropdown, trigger) {
454
454
  preventOverflow: false,
455
455
  // space between a dropdown trigger and the dropdown itself, based on @aui-dropdown-trigger-offset
456
456
  // only added for dropdowns which are not submenus
457
- offset: (trigger.hasSubmenu && trigger.hasSubmenu()) ? false : [0, 3]
457
+ offset: (trigger.hasSubmenu && trigger.hasSubmenu()) ? [-3, 0] : [0, 3]
458
458
  });
459
459
 
460
460
  dropdown._auiAlignment.enable();
@@ -1,10 +1,15 @@
1
1
  import createHeader from './internal/header/create-header';
2
2
  import skate from './internal/skate';
3
3
 
4
- const Header = skate('aui-header', {
5
- type: skate.type.CLASSNAME,
4
+ const Header = skate('aui-header-end', {
5
+ type: skate.type.ELEMENT,
6
6
  created: function (element) {
7
- createHeader(element);
7
+ const auiHeader = element.parentElement;
8
+ if (auiHeader && auiHeader.classList.contains('aui-header')) {
9
+ createHeader(auiHeader);
10
+ } else {
11
+ console.log('Could not async. initialise aui-header');
12
+ }
8
13
  }
9
14
  });
10
15
 
@@ -187,7 +187,7 @@ function Alignment(element, target, options = {}) {
187
187
  },
188
188
  {
189
189
  name: 'offset',
190
- enabled: options.hasOwnProperty('offset') ? true : false,
190
+ enabled: options.hasOwnProperty('offset') && !!options.offset,
191
191
  options: {
192
192
  offset: options.offset,
193
193
  },
@@ -35,9 +35,6 @@ function Navigation (selector) {
35
35
  .children('.aui-nav-subtree-toggle')
36
36
  .children('span.aui-icon');
37
37
 
38
- // Hide extra items under a 'More...' link
39
- this.hideMoreItems();
40
-
41
38
  // Add child-selected class to relevant attributes
42
39
  this.$el.children('li:has(.aui-nav-selected)').addClass('aui-nav-child-selected');
43
40
 
@@ -88,7 +85,6 @@ Navigation.prototype.expand = function () {
88
85
  .removeClass('aui-iconfont-collapsed')
89
86
  .addClass('aui-iconfont-expanded')
90
87
  .text(I18n.getText('aui.words.collapse'));
91
- this.hideMoreItems();
92
88
  return this;
93
89
  };
94
90
 
@@ -110,37 +106,6 @@ Navigation.prototype.toggle = function () {
110
106
  return this;
111
107
  };
112
108
 
113
- Navigation.prototype.hideMoreItems = function () {
114
- if (this.$el.is('[data-more]') && !this.$el.is('[aria-expanded=false]')) {
115
- var moreText = this.$el.attr('data-more') || I18n.getText('aui.words.moreitem');
116
- var limit = Math.abs(parseInt(this.$el.attr('data-more-limit'))) || 5;
117
- var $listElements = this.$el.children('li');
118
-
119
- // Only add 'More...' if there is more than one element to hide and there are no selected elements
120
- var lessThanTwoToHide = $listElements.length <= limit + 1;
121
- var selectedElementPresent = $listElements.filter('.aui-nav-selected').length;
122
- var alreadyInitialised = $listElements.filter('.aui-nav-more').length;
123
- if (lessThanTwoToHide || selectedElementPresent || alreadyInitialised) {
124
- return this;
125
- }
126
-
127
- $('<li>', {
128
- 'class': 'aui-nav-more',
129
- }).append($('<a>', {
130
- 'href': '#',
131
- 'class': 'aui-nav-item',
132
- 'text': moreText,
133
- 'click': function (e) {
134
- e.preventDefault();
135
- $(this).parent().remove();
136
- }
137
- })).insertAfter($listElements.eq(limit - 1));
138
- }
139
-
140
- return this;
141
- };
142
-
143
-
144
109
  const navigationWidget = widget('navigation', Navigation);
145
110
 
146
111
  // Initialise nav elements
@@ -2,18 +2,21 @@ import $ from './jquery';
2
2
  import '../../js-vendor/jquery/jquery.tablesorter';
3
3
  import globalize from './internal/globalize';
4
4
 
5
- var DEFAULT_SORT_OPTIONS = {
5
+ const DEFAULT_SORT_OPTIONS = {
6
6
  sortMultiSortKey: '',
7
7
  headers: {},
8
8
  debug: false,
9
9
  tabIndex: false
10
10
  };
11
11
 
12
- function sortTable($table) {
13
- var options = DEFAULT_SORT_OPTIONS;
12
+ /**
13
+ * @param {jQuery} $table - element to be sortable
14
+ * @param {Object} [extraOptions] - tablesorter.js options
15
+ */
16
+ function sortTable($table, extraOptions) {
17
+ let options = Object.assign({}, DEFAULT_SORT_OPTIONS, extraOptions);
14
18
  $table.find('th').each(function (index, header) {
15
-
16
- var $header = $(header);
19
+ const $header = $(header);
17
20
  options.headers[index] = {};
18
21
  if ($header.hasClass('aui-table-column-unsortable')) {
19
22
  options.headers[index].sorter = false;
@@ -25,10 +28,10 @@ function sortTable($table) {
25
28
  }
26
29
  }
27
30
  });
28
- $table.tablesorter(options);
31
+ return $table.tablesorter(options);
29
32
  }
30
33
 
31
- var tablessortable = {
34
+ let tablessortable = {
32
35
  setup: function () {
33
36
 
34
37
  /*
@@ -46,13 +49,13 @@ var tablessortable = {
46
49
  },
47
50
 
48
51
  format: function (s) {
49
- var keyComponents = s.split('-');
50
- var projectKey = keyComponents[0];
51
- var issueNumber = keyComponents[1];
52
+ const keyComponents = s.split('-');
53
+ const projectKey = keyComponents[0];
54
+ const issueNumber = keyComponents[1];
52
55
 
53
- var PROJECT_KEY_TEMPLATE = '..........';
54
- var ISSUE_NUMBER_TEMPLATE = '000000';
55
- var stringRepresentation = (projectKey + PROJECT_KEY_TEMPLATE).slice(0, PROJECT_KEY_TEMPLATE.length);
56
+ const PROJECT_KEY_TEMPLATE = '..........';
57
+ const ISSUE_NUMBER_TEMPLATE = '000000';
58
+ let stringRepresentation = (projectKey + PROJECT_KEY_TEMPLATE).slice(0, PROJECT_KEY_TEMPLATE.length);
56
59
  stringRepresentation += (ISSUE_NUMBER_TEMPLATE + issueNumber).slice(-ISSUE_NUMBER_TEMPLATE.length);
57
60
 
58
61
  return stringRepresentation;
@@ -95,9 +98,12 @@ var tablessortable = {
95
98
  sortTable($(this));
96
99
  });
97
100
  },
98
-
99
- setTableSortable: function ($table) {
100
- sortTable($table);
101
+ /**
102
+ * @param {jQuery} $table - element to be sortable
103
+ * @param {Object} [options] - tablesorter.js options
104
+ */
105
+ setTableSortable: function ($table, options) {
106
+ return sortTable($table, options);
101
107
  }
102
108
  };
103
109
 
@@ -28,7 +28,18 @@ aui-badge,
28
28
  &.aui-badge-primary {
29
29
  background-color: var(--aui-badge-primary-bg-color);
30
30
  color: var(--aui-badge-primary-text-color);
31
- font-weight: @aui-font-weight-semibold;
31
+ }
32
+ &.aui-badge-added {
33
+ background-color: var(--aui-badge-added-bg-color);
34
+ color: var(--aui-badge-added-text-color);
35
+ }
36
+ &.aui-badge-removed {
37
+ background-color: var(--aui-badge-removed-bg-color);
38
+ color: var(--aui-badge-removed-text-color);
39
+ }
40
+ &.aui-badge-important {
41
+ background-color: var(--aui-badge-important-bg-color);
42
+ color: var(--aui-badge-important-text-color);
32
43
  }
33
44
 
34
45
  // Integrations:
@@ -1,5 +1,7 @@
1
1
  @import (reference) './imports/global';
2
2
  @import (reference) './imports/mixins/shadows';
3
+ @import (reference) './imports/aui-theme/theme';
4
+
3
5
 
4
6
  /*! AUI Date Picker, using jQuery UI Date Picker */
5
7
  /*
@@ -24,6 +26,12 @@
24
26
  #aui.shadow.z200();
25
27
  }
26
28
 
29
+ .aui-datepicker-dialog[x-placement*="bottom"]{
30
+ #aui-themes.when-light({
31
+ --aui-inline-dialog-bg-color: var(--aui-datepicker-heading-bg-color);
32
+ });
33
+ }
34
+
27
35
  .aui-datepicker-dialog .aui-inline-dialog-contents,
28
36
  .aui-datepicker-dialog .contents {
29
37
  padding: 0;
@@ -109,40 +109,41 @@
109
109
 
110
110
  /* Vertical Navigation
111
111
  -------------------- */
112
- .aui-navgroup-vertical .aui-nav > li > a,
113
- .aui-navgroup-vertical .aui-nav > li > span:not(.assistive) ,
114
- .aui-nav-vertical > li > a,
115
- .aui-nav-vertical > li > span:not(.assistive) {
112
+
113
+ /** by AUI-5164:
114
+ * The following CSS has been adjusted to allow generic content as a direct ancestor of the nav list
115
+ * basic styling (default and active state) is applied to the list element itself
116
+ * interactive styling (hover, active, focus) is applied to the assumed interactive element (<a>)
117
+ * thanks to this - we can fill in the nav list with non-interactive elements without generating visual glitches.
118
+ */
119
+ .aui-navgroup-vertical .aui-nav > li,
120
+ .aui-nav-vertical > li {
116
121
  #aui-nav.item-base();
117
- word-wrap: break-word;
122
+ overflow-wrap: break-word;
123
+ #aui-nav.item-style(normal, true);
118
124
 
119
- &:hover {
120
- #aui-nav.item-style(hover);
121
- }
125
+ & > a {
126
+ #aui-nav.item-base();
127
+ #aui-nav.item-base-inner-link();
128
+ #aui-nav.item-style(normal);
122
129
 
123
- &:active {
124
- #aui-nav.item-style(active);
125
- }
130
+ &:hover {
131
+ #aui-nav.item-style(hover);
132
+ }
126
133
 
127
- &:focus {
128
- #aui.with-focus-ring();
129
- text-decoration: none;
134
+ &:active {
135
+ #aui-nav.item-style(active);
136
+ }
137
+
138
+ &:focus {
139
+ #aui.with-focus-ring();
140
+ text-decoration: none;
141
+ }
130
142
  }
131
143
  }
132
- .aui-navgroup-vertical .aui-nav > li > a,
133
- .aui-nav-vertical > li > a {
134
- #aui-nav.item-style(normal);
135
- }
136
- .aui-navgroup-vertical .aui-nav > li > span:not(.assistive) ,
137
- .aui-nav-vertical > li > span:not(.assistive) {
138
- #aui-nav.item-style(normal, true);
139
- }
140
-
141
144
 
142
- .aui-navgroup-vertical .aui-nav .aui-nav-selected > a,
143
- .aui-navgroup-vertical .aui-nav .aui-nav-selected > span:not(.assistive),
144
- .aui-nav-vertical .aui-nav .aui-nav-selected > a,
145
- .aui-nav-vertical .aui-nav .aui-nav-selected > span:not(.assistive) {
145
+ .aui-navgroup-vertical .aui-nav .aui-nav-selected,
146
+ .aui-nav-vertical .aui-nav .aui-nav-selected {
146
147
  #aui-nav.item-style(selected);
147
148
  }
148
149
 
@@ -196,8 +196,7 @@ body {
196
196
  top: @aui-font-size-medium;
197
197
  width: (@aui-grid / 2);
198
198
  }
199
- &:last-child::before,
200
- &.aui-nav-more::before {
199
+ &:last-child::before {
201
200
  bottom: 50%;
202
201
  }
203
202
  }
@@ -123,6 +123,7 @@
123
123
 
124
124
  .aui-select2-drop.aui-dropdown2 {
125
125
  margin-left: 0;
126
+ background-color: var(--aui-select2-drop-bg-color);
126
127
  }
127
128
  .aui-select2-drop.aui-dropdown2.select2-with-searchbox {
128
129
  padding-top: 0;
@@ -233,16 +234,14 @@
233
234
  .aui-select2-container.select2-container .select2-choice:after {
234
235
  #aui.icon-pseudoelement();
235
236
  content: @aui-glyph-chevron-down;
237
+ left: 100%; /* "left" + "margin-left" required because of webkit not working properly with "right" */
236
238
  height: 0;
237
239
  margin-left: -18px;
238
240
  margin-top: -2px;
239
241
  opacity: 1;
240
242
  position: absolute;
241
- top: calc(50% - 10px);
243
+ top: 7px;
242
244
  width: 0;
243
- font-size: 16px;
244
- line-height: 24px;
245
- right: 22px;
246
245
  }
247
246
 
248
247
  /* Set the default text color to inherit.
@@ -273,12 +272,9 @@
273
272
  .aui-select2-container.select2-container-multi .select2-choices {
274
273
  #aui-forms.aui-select2-input-field-style(normal);
275
274
  #aui.icon(@aui-glyph-chevron-down, {
276
- font-size: 16.5px;
275
+ font-size: inherit;
277
276
  left: inherit;
278
- color: var(--aui-button-default-text-color);
279
- right: 3px;
280
- top: 50%;
281
- line-height: 16px;
277
+ right: 0;
282
278
  });
283
279
 
284
280
  min-height: 0;
@@ -49,13 +49,6 @@
49
49
 
50
50
  // Nested navigation
51
51
  .aui-nav {
52
- &[data-more] {
53
- .aui-nav-more ~ li {
54
- height: 0;
55
- overflow: hidden;
56
- }
57
- }
58
-
59
52
  .aui-nav-item-actions {
60
53
  margin-right: 0;
61
54
  }
@@ -243,29 +243,28 @@ form.aui:not(.aui-legacy-forms) {
243
243
  }
244
244
 
245
245
  // both are @ak-color-N600
246
- @chevron-dark: url('data:image/svg+xml,%3Csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath fill="%23A5ADBA" d="M8.292 10.293a1.009 1.009 0 000 1.419l2.939 2.965c.218.215.5.322.779.322s.556-.107.769-.322l2.93-2.955a1.01 1.01 0 000-1.419.987.987 0 00-1.406 0l-2.298 2.317-2.307-2.327a.99.99 0 00-1.406 0z"/%3E%3C/svg%3E%0A');
247
- @chevron-light: url('data:image/svg+xml,%3Csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath fill="%23344563" d="M8.292 10.293a1.009 1.009 0 000 1.419l2.939 2.965c.218.215.5.322.779.322s.556-.107.769-.322l2.93-2.955a1.01 1.01 0 000-1.419.987.987 0 00-1.406 0l-2.298 2.317-2.307-2.327a.99.99 0 00-1.406 0z"/%3E%3C/svg%3E%0A');
246
+ @chevron-dark: url('data:image/svg+xml,%3Csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath fill="%23A5ADBA" d="m6.744 8.744a1.053 1.053 0 0 0 0 1.49l4.547 4.557a1 1 0 0 0 1.416 0l4.55-4.558a1.051 1.051 0 1 0-1.488-1.488l-3.77 3.776-3.768-3.776a1.051 1.051 0 0 0-1.487 0z"/%3E%3C/svg%3E%0A');
247
+ @chevron-light: url('data:image/svg+xml,%3Csvg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath fill="%23344563" d="m6.744 8.744a1.053 1.053 0 0 0 0 1.49l4.547 4.557a1 1 0 0 0 1.416 0l4.55-4.558a1.051 1.051 0 1 0-1.488-1.488l-3.77 3.776-3.768-3.776a1.051 1.051 0 0 0-1.487 0z"/%3E%3C/svg%3E%0A');
248
248
 
249
249
  select[disabled]:not([size]),
250
250
  .select:not([size]) {
251
251
  background-repeat: no-repeat;
252
- background-position: calc(100% + 1.5px) 50%;
253
- background-size: 25px;
252
+ background-position: 100% 50%;
254
253
  }
255
254
 
256
- select[disabled]:not([size]) {
255
+ select.select[disabled]:not([size]) {
257
256
  // used to be a light ak-color-N70, but there were only 2-3 shades of difference
258
257
  // between that and dark ak-color-N600, so I'm re-using it here.
259
258
  background-image: @chevron-dark;
260
259
  }
261
260
 
262
- select:not([size]) {
263
- padding-right: 20px;
261
+ select.select:not([size]) {
262
+ padding-right: 22px;
264
263
  background-image: @chevron-light;
265
264
  }
266
265
 
267
266
  #aui-themes.when-dark({
268
- select:not([size]) {
267
+ select.select:not([size]) {
269
268
  background-image: @chevron-dark;
270
269
  }
271
270
  });
@@ -52,6 +52,12 @@
52
52
  padding: @aui-nav-link-spacing-vertical @aui-nav-link-spacing-horizontal;
53
53
  }
54
54
 
55
+ .item-base-inner-link() {
56
+ color: inherit;
57
+ text-decoration: inherit;
58
+ margin: -@aui-nav-link-spacing-vertical -@aui-nav-link-spacing-horizontal;
59
+ }
60
+
55
61
  .item-style(normal; @not-actionable:none) {
56
62
  background-color: var(--aui-item-bg, transparent);
57
63
  color: var(--aui-item-text, var(--aui-body-text));
@@ -48,10 +48,16 @@
48
48
  --aui-help-color: @ak-color-P400;
49
49
 
50
50
  // Badges
51
- --aui-badge-bg-color: @ak-color-N30A;
52
- --aui-badge-text-color: @ak-color-N800A;
53
- --aui-badge-primary-bg-color: @ak-color-B75;
54
- --aui-badge-primary-text-color: @ak-color-B500;
51
+ --aui-badge-bg-color: @ak-color-N40A;
52
+ --aui-badge-text-color: @ak-color-N800;
53
+ --aui-badge-primary-bg-color: @ak-color-B400;
54
+ --aui-badge-primary-text-color: @ak-color-N0;
55
+ --aui-badge-added-bg-color: @ak-color-G50;
56
+ --aui-badge-addded-text-color: @ak-color-G500;
57
+ --aui-badge-removed-bg-color: @ak-color-R50;
58
+ --aui-badge-removed-text-color: @ak-color-R500;
59
+ --aui-badge-important-bg-color: @ak-color-R400;
60
+ --aui-badge-important-text-color: @ak-color-N0;
55
61
  --aui-badge-on-blue-text-color: @ak-color-N0;
56
62
  --aui-badge-on-blue-bg-color: rgba(@ak-color-N0, 0.25);
57
63
 
@@ -287,6 +293,7 @@
287
293
  --aui-select2-field-default-bg-color: var(--aui-form-select-bg-color);
288
294
  --aui-select2-field-border-color: var(--aui-form-select-border-color);
289
295
  --aui-select2-field-hover-bg-color: var(--aui-form-select-hover-bg-color);
296
+ --aui-select2-drop-bg-color: var(--aui-dropdown-bg-color);
290
297
 
291
298
  // Dialogs
292
299
  --aui-dialog-bg-color: @ak-color-N0;
@@ -364,9 +371,15 @@
364
371
 
365
372
  // Badges
366
373
  --aui-badge-bg-color: @ak-color-N70;
367
- --aui-badge-text-color: @ak-color-N600;
368
- --aui-badge-primary-bg-color: @ak-color-B75;
369
- --aui-badge-primary-text-color: @ak-color-B500;
374
+ --aui-badge-text-color: @ak-color-N900;
375
+ --aui-badge-primary-bg-color: @ak-color-B100;
376
+ --aui-badge-primary-text-color: @ak-color-N0;
377
+ --aui-badge-added-bg-color: rgba(0, 102, 68, 0.33);
378
+ --aui-badge-added-text-color: @ak-color-G75;
379
+ --aui-badge-removed-bg-color: rgba(191, 38, 0, 0.33);
380
+ --aui-badge-removed-text-color: @ak-color-R75;
381
+ --aui-badge-important-bg-color: @ak-color-R300;
382
+ --aui-badge-important-text-color: @ak-color-N0;
370
383
 
371
384
  // Lozenges
372
385
  --aui-lozenge-subtle-bg-color: @ak-color-N50;
@@ -597,6 +610,7 @@
597
610
  --aui-select2-field-default-bg-color: var(--aui-form-select-bg-color);
598
611
  --aui-select2-field-border-color: var(--aui-form-select-border-color);
599
612
  --aui-select2-field-hover-bg-color: var(--aui-form-select-hover-bg-color);
613
+ --aui-select2-drop-bg-color: var(--aui-dropdown-bg-color);
600
614
 
601
615
  // Dialogs
602
616
  --aui-dialog-bg-color: @ak-color-N40;
@@ -2,7 +2,7 @@
2
2
 
3
3
  #aui {
4
4
  .aui-dropdown2-trigger-chevron-icon(@glyphsize: @aui-icon-size-small; @canvassize: @aui-icon-size-small-canvas) {
5
-
5
+ @canvas-padding: ((@canvassize - @glyphsize) / 2);
6
6
  #aui.icon-pseudoelement(@aui-icon-font-family);
7
7
  content: @aui-glyph-chevron-down;
8
8
  font-size: @glyphsize;
@@ -10,7 +10,7 @@
10
10
  line-height: 1;
11
11
  margin-top: -(@glyphsize / 2);
12
12
  position: absolute;
13
- right: 3.5px;
13
+ right: @canvas-padding;
14
14
  top: 50%;
15
15
  text-indent: 0; // Reset indentation set by split button
16
16
  width: @glyphsize;
@@ -136,6 +136,8 @@ aui-select {
136
136
 
137
137
  &:not([aria-busy])::before {
138
138
  #aui.aui-dropdown2-trigger-chevron-icon();
139
+
140
+ right: ((@select-trigger-width - @aui-icon-size-small - (@aui-button-border-width *2)) / 2);
139
141
  }
140
142
  }
141
143
  }