@atlassian/aui 9.8.0 → 9.9.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/dist/aui/aui-prototyping-browserfocus.css +29 -1
- package/dist/aui/aui-prototyping-darkmode.css +14 -0
- package/dist/aui/aui-prototyping-design-tokens-api-full.js +9 -0
- package/dist/aui/aui-prototyping-design-tokens-api-full.js.map +1 -0
- package/dist/aui/aui-prototyping-design-tokens-api.js +2 -11
- package/dist/aui/aui-prototyping-design-tokens-api.js.map +1 -1
- package/dist/aui/aui-prototyping-design-tokens-base-themes.js +9 -0
- package/dist/aui/aui-prototyping-design-tokens-base-themes.js.map +1 -0
- package/dist/aui/aui-prototyping-design-tokens-compatibility.css +115 -0
- package/dist/aui/aui-prototyping.css +10 -10
- package/dist/aui/aui-prototyping.css.map +1 -1
- package/dist/aui/aui-prototyping.js +4 -4
- package/dist/aui/aui-prototyping.js.map +1 -1
- package/dist/aui/aui-prototyping.nodeps.css +10 -10
- package/dist/aui/aui-prototyping.nodeps.css.map +1 -1
- package/dist/aui/aui-prototyping.nodeps.js +7 -7
- package/dist/aui/aui-prototyping.nodeps.js.map +1 -1
- package/dist/aui/themes/dark-new-input-border.js +2 -0
- package/dist/aui/themes/dark-new-input-border.js.map +1 -0
- package/dist/aui/themes/dark.js +2 -0
- package/dist/aui/themes/dark.js.map +1 -0
- package/dist/aui/themes/legacy-dark.js +2 -0
- package/dist/aui/themes/legacy-dark.js.map +1 -0
- package/dist/aui/themes/legacy-light.js +2 -0
- package/dist/aui/themes/legacy-light.js.map +1 -0
- package/dist/aui/themes/light-new-input-border.js +2 -0
- package/dist/aui/themes/light-new-input-border.js.map +1 -0
- package/dist/aui/themes/light.js +2 -0
- package/dist/aui/themes/light.js.map +1 -0
- package/dist/aui/{@atlaskit-internal_atlassian-shape.js → themes/shape.js} +2 -2
- package/dist/aui/themes/shape.js.map +1 -0
- package/dist/aui/{@atlaskit-internal_atlassian-spacing.js → themes/spacing.js} +2 -2
- package/dist/aui/themes/spacing.js.map +1 -0
- package/dist/aui/themes/typography-adg3.js +2 -0
- package/dist/aui/themes/typography-adg3.js.map +1 -0
- package/dist/aui/themes/typography-minor3.js +2 -0
- package/dist/aui/themes/typography-minor3.js.map +1 -0
- package/dist/aui/themes/typography.js +2 -0
- package/dist/aui/themes/typography.js.map +1 -0
- package/entry/aui.design-tokens-api-full.js +2 -0
- package/entry/aui.design-tokens-api.js +2 -1
- package/entry/styles/aui-design-tokens-compatibility.less +128 -0
- package/entry/token-themes-generated/npm/aui-prototyping-design-tokens-base-themes.js +26 -0
- package/entry/token-themes-generated/npm/aui-prototyping-design-tokens-theme-import-map.js +47 -0
- package/entry/token-themes-generated/npm/themes/dark-new-input-border.js +7 -0
- package/entry/token-themes-generated/npm/themes/dark.js +393 -0
- package/entry/token-themes-generated/npm/themes/legacy-dark.js +393 -0
- package/entry/token-themes-generated/npm/themes/legacy-light.js +393 -0
- package/entry/token-themes-generated/npm/themes/light-new-input-border.js +7 -0
- package/entry/token-themes-generated/npm/themes/light.js +393 -0
- package/entry/token-themes-generated/npm/themes/shape.js +15 -0
- package/entry/token-themes-generated/npm/themes/spacing.js +18 -0
- package/entry/token-themes-generated/npm/themes/typography-adg3.js +46 -0
- package/entry/token-themes-generated/npm/themes/typography-minor3.js +27 -0
- package/entry/token-themes-generated/npm/themes/typography.js +27 -0
- package/entry/token-themes-generated/p2/aui-prototyping-design-tokens-base-themes.js +26 -0
- package/entry/token-themes-generated/p2/aui-prototyping-design-tokens-theme-import-map.js +47 -0
- package/entry/token-themes-generated/p2/themes/dark-new-input-border.js +7 -0
- package/entry/token-themes-generated/p2/themes/dark.js +393 -0
- package/entry/token-themes-generated/p2/themes/legacy-dark.js +393 -0
- package/entry/token-themes-generated/p2/themes/legacy-light.js +393 -0
- package/entry/token-themes-generated/p2/themes/light-new-input-border.js +7 -0
- package/entry/token-themes-generated/p2/themes/light.js +393 -0
- package/entry/token-themes-generated/p2/themes/shape.js +15 -0
- package/entry/token-themes-generated/p2/themes/spacing.js +18 -0
- package/entry/token-themes-generated/p2/themes/typography-adg3.js +46 -0
- package/entry/token-themes-generated/p2/themes/typography-minor3.js +27 -0
- package/entry/token-themes-generated/p2/themes/typography.js +27 -0
- package/package.json +6 -6
- package/src/js/aui/design-tokens/design-tokens-full.js +33 -0
- package/src/js/aui/design-tokens/design-tokens-init.js +7 -0
- package/src/js/aui/design-tokens/design-tokens-testing-theme.js +85 -0
- package/src/js/aui/design-tokens/design-tokens.js +3 -93
- package/src/js/aui/expander.js +147 -76
- package/src/less/aui-buttons.less +36 -0
- package/src/less/aui-experimental-expander.less +28 -22
- package/src/less/imports/aui-theme/components/buttons.less +40 -0
- package/src/less/imports/aui-theme/core/colors.less +42 -0
- package/src/less/imports/aui-theme/theme.less +21 -9
- package/dist/aui/@atlaskit-internal_atlassian-dark-iteration.js +0 -2
- package/dist/aui/@atlaskit-internal_atlassian-dark-iteration.js.map +0 -1
- package/dist/aui/@atlaskit-internal_atlassian-dark-new-input-border.js +0 -2
- package/dist/aui/@atlaskit-internal_atlassian-dark-new-input-border.js.map +0 -1
- package/dist/aui/@atlaskit-internal_atlassian-dark.js +0 -2
- package/dist/aui/@atlaskit-internal_atlassian-dark.js.map +0 -1
- package/dist/aui/@atlaskit-internal_atlassian-legacy-dark.js +0 -2
- package/dist/aui/@atlaskit-internal_atlassian-legacy-dark.js.map +0 -1
- package/dist/aui/@atlaskit-internal_atlassian-legacy-light.js +0 -2
- package/dist/aui/@atlaskit-internal_atlassian-legacy-light.js.map +0 -1
- package/dist/aui/@atlaskit-internal_atlassian-light-new-input-border.js +0 -2
- package/dist/aui/@atlaskit-internal_atlassian-light-new-input-border.js.map +0 -1
- package/dist/aui/@atlaskit-internal_atlassian-light.js +0 -2
- package/dist/aui/@atlaskit-internal_atlassian-light.js.map +0 -1
- package/dist/aui/@atlaskit-internal_atlassian-shape.js.map +0 -1
- package/dist/aui/@atlaskit-internal_atlassian-spacing.js.map +0 -1
- package/dist/aui/@atlaskit-internal_atlassian-typography.js +0 -2
- package/dist/aui/@atlaskit-internal_atlassian-typography.js.map +0 -1
- package/src/less/themes/design-tokens.aui-theme.less +0 -5
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import TokenNames from "@atlaskit/tokens/token-names";
|
|
2
|
+
|
|
3
|
+
const testingColorVariableName = '--aui-theme-testing-color';
|
|
4
|
+
const defaultTestingColor = 'color(srgb 1 0.75 0.8 / 0.6)';
|
|
5
|
+
const testingThemeName = "aui-theme-testing";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Theme that replaces all the design tokens with single color, helping to visually identify custom colors on the page
|
|
9
|
+
*
|
|
10
|
+
* @param solidColor any valid CSS color, will be used to replace tokens
|
|
11
|
+
*/
|
|
12
|
+
(function generateTestingTheme() {
|
|
13
|
+
|
|
14
|
+
const initialComment = "This theme is autogenerated using AJS.DesignTokens.generateTestingTheme()."
|
|
15
|
+
|
|
16
|
+
// If function called many times theme should be only added once
|
|
17
|
+
const isThemeAlreadyInitialised = !document.getElementById(testingThemeName)
|
|
18
|
+
if (!isThemeAlreadyInitialised) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// We use overridable test color declaration to make theme configurable
|
|
23
|
+
const colorDeclaration = `${testingColorVariableName}: ${defaultTestingColor};`
|
|
24
|
+
const themeCSSDeclarations = Object.values(TokenNames)
|
|
25
|
+
.map(token => `\t${token}: var(${testingColorVariableName});`);
|
|
26
|
+
const allDeclarations = [ colorDeclaration, ...themeCSSDeclarations ];
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
const themeCSS = `/* ${initialComment} */\nbody.${testingThemeName} {\n${allDeclarations.join('\n')}\n}`;
|
|
30
|
+
|
|
31
|
+
const themeElement = document.createElement('style');
|
|
32
|
+
themeElement.id = testingThemeName;
|
|
33
|
+
themeElement.innerText = themeCSS;
|
|
34
|
+
|
|
35
|
+
const head = document.querySelector('head');
|
|
36
|
+
if (head) {
|
|
37
|
+
head.appendChild(themeElement);
|
|
38
|
+
}
|
|
39
|
+
})();
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Overrides default testing color by setting css variable. If no color passed, will revert to default.
|
|
43
|
+
* @param color color to use for testing
|
|
44
|
+
*/
|
|
45
|
+
function setTestingThemeColor(color = defaultTestingColor) {
|
|
46
|
+
document.body.style.setProperty(testingColorVariableName, color);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function enableTestingTheme() {
|
|
50
|
+
const isEnabled = document.body.classList.contains(testingThemeName);
|
|
51
|
+
if (!isEnabled) {
|
|
52
|
+
document.body.classList.add(testingThemeName);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function disableTestingTheme() {
|
|
57
|
+
const isEnabled = document.body.classList.contains(testingThemeName);
|
|
58
|
+
if (isEnabled) {
|
|
59
|
+
document.body.classList.remove(testingThemeName);
|
|
60
|
+
document.body.style.removeProperty(testingColorVariableName);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Enables or disables testing theme for Design Tokens based on current state
|
|
66
|
+
* @param state Optional parameter. Allows to force specific state.
|
|
67
|
+
*/
|
|
68
|
+
function toggleTestingTheme(state) {
|
|
69
|
+
|
|
70
|
+
// If not passed, invert existing state
|
|
71
|
+
if (state == null) {
|
|
72
|
+
const currentState = document.body.classList.contains(testingThemeName);
|
|
73
|
+
state = !currentState;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
state ? enableTestingTheme() : disableTestingTheme();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
export {
|
|
81
|
+
setTestingThemeColor,
|
|
82
|
+
enableTestingTheme,
|
|
83
|
+
disableTestingTheme,
|
|
84
|
+
toggleTestingTheme
|
|
85
|
+
}
|
|
@@ -1,104 +1,14 @@
|
|
|
1
1
|
import * as Tokens from '@atlaskit/tokens';
|
|
2
|
-
import TokenNames from '@atlaskit/tokens/token-names';
|
|
3
2
|
import globalize from '../internal/globalize';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const testingColorVariableName = '--aui-theme-testing-color';
|
|
8
|
-
const defaultTestingColor = 'color(srgb 1 0.75 0.8 / 0.6)';
|
|
9
|
-
const testingThemeName = "aui-theme-testing";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Theme that replaces all the design tokens with single color, helping to visually identify custom colors on the page
|
|
13
|
-
*
|
|
14
|
-
* @param solidColor any valid CSS color, will be used to replace tokens
|
|
15
|
-
*/
|
|
16
|
-
(function generateTestingTheme() {
|
|
17
|
-
|
|
18
|
-
const initialComment = "This theme is autogenerated using AJS.DesignTokens.generateTestingTheme()."
|
|
19
|
-
|
|
20
|
-
// If function called many times theme should be only added once
|
|
21
|
-
const isThemeAlreadyInitialised = !document.getElementById(testingThemeName)
|
|
22
|
-
if (!isThemeAlreadyInitialised) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// We use overridable test color declaration to make theme configurable
|
|
27
|
-
const colorDeclaration = `${testingColorVariableName}: ${defaultTestingColor};`
|
|
28
|
-
const themeCSSDeclarations = Object.values(TokenNames)
|
|
29
|
-
.map(token => `\t${token}: var(${testingColorVariableName});`);
|
|
30
|
-
const allDeclarations = [ colorDeclaration, ...themeCSSDeclarations ];
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const themeCSS = `/* ${initialComment} */\nbody.${testingThemeName} {\n${allDeclarations.join('\n')}\n}`;
|
|
34
|
-
|
|
35
|
-
const themeElement = document.createElement('style');
|
|
36
|
-
themeElement.id = testingThemeName;
|
|
37
|
-
themeElement.innerText = themeCSS;
|
|
38
|
-
|
|
39
|
-
const head = document.querySelector('head');
|
|
40
|
-
if (head) {
|
|
41
|
-
head.appendChild(themeElement);
|
|
42
|
-
}
|
|
43
|
-
})();
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Enables or disables testing theme for Design Tokens based on current state
|
|
48
|
-
* @param state Optional parameter. Allows to force specific state.
|
|
49
|
-
*/
|
|
50
|
-
export function toggleTestingTheme(state) {
|
|
51
|
-
|
|
52
|
-
// If not passed, invert existing state
|
|
53
|
-
if (state == null) {
|
|
54
|
-
const currentState = document.body.classList.contains(testingThemeName);
|
|
55
|
-
state = !currentState;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
state ? enableTestingTheme() : disableTestingTheme();
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Overrides default testing color by setting css variable. If no color passed, will revert to default.
|
|
63
|
-
* @param color color to use for testing
|
|
64
|
-
*/
|
|
65
|
-
export function setTestingThemeColor(color = defaultTestingColor) {
|
|
66
|
-
document.body.style.setProperty(testingColorVariableName, color);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function enableTestingTheme() {
|
|
70
|
-
const isEnabled = document.body.classList.contains(testingThemeName);
|
|
71
|
-
if (!isEnabled) {
|
|
72
|
-
document.body.classList.add(testingThemeName);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export function disableTestingTheme() {
|
|
77
|
-
const isEnabled = document.body.classList.contains(testingThemeName);
|
|
78
|
-
if (isEnabled) {
|
|
79
|
-
document.body.classList.remove(testingThemeName);
|
|
80
|
-
document.body.style.removeProperty(testingColorVariableName);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
4
|
+
import './design-tokens-init';
|
|
83
5
|
|
|
84
6
|
// Export for NPM bundle, for which Webpack automatically puts those functions under AJS.DesignTokens
|
|
85
7
|
export const {
|
|
86
|
-
setGlobalTheme
|
|
87
|
-
token,
|
|
88
|
-
themeObjectToString,
|
|
89
|
-
themeStringToObject,
|
|
90
|
-
getTokenValue
|
|
8
|
+
setGlobalTheme
|
|
91
9
|
} = Tokens;
|
|
92
10
|
|
|
93
11
|
// Export for p2-plugin bundle, where we need to do put those functions under AJS.DesignTokens manually
|
|
94
12
|
globalize('DesignTokens', {
|
|
95
|
-
setGlobalTheme
|
|
96
|
-
token,
|
|
97
|
-
themeObjectToString,
|
|
98
|
-
themeStringToObject,
|
|
99
|
-
getTokenValue,
|
|
100
|
-
toggleTestingTheme,
|
|
101
|
-
enableTestingTheme,
|
|
102
|
-
disableTestingTheme,
|
|
103
|
-
setTestingThemeColor
|
|
13
|
+
setGlobalTheme
|
|
104
14
|
});
|
package/src/js/aui/expander.js
CHANGED
|
@@ -1,106 +1,177 @@
|
|
|
1
1
|
import $ from './jquery';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
import { getMessageLogger } from './internal/deprecation';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const deprecate = {
|
|
7
|
+
'aria-expanded': getMessageLogger('Expander [aria-expanded] attribute', {
|
|
8
|
+
removeInVersion: '10.0.0',
|
|
9
|
+
sinceVersion: '9.9.0',
|
|
10
|
+
deprecationType: 'ARIA ATTRIBUTE',
|
|
11
|
+
extraInfo:
|
|
12
|
+
'The "aria-expanded" attribute will no longer act as an indicator for the expander if it needs to be expanded. Please update the expander in accordance with AUI guidelines.',
|
|
13
|
+
}),
|
|
14
|
+
'replace-selector': getMessageLogger('Expander [data-replace-selector] attribute', {
|
|
15
|
+
removeInVersion: '10.0.0',
|
|
16
|
+
sinceVersion: '9.9.0',
|
|
17
|
+
deprecationType: 'DATA ATTRIBUTE',
|
|
18
|
+
extraInfo:
|
|
19
|
+
'The attribute "data-replace-selector" will no longer have any functionality. It is recommended to update the expander following AUI guidelines.',
|
|
20
|
+
}),
|
|
21
|
+
'short-content': getMessageLogger('Expander [.aui-expander-short-content]', {
|
|
22
|
+
removeInVersion: '10.0.0',
|
|
23
|
+
sinceVersion: '9.9.0',
|
|
24
|
+
deprecationType: 'EXPANDER CLASS (PATTERN)',
|
|
25
|
+
}),
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const getExpanderProperties = ($trigger) => {
|
|
29
|
+
const $content = $(`#${$trigger.attr('aria-controls')}`);
|
|
30
|
+
const isTriggerParent = $content.parent().is($trigger);
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* ! Deprecated since 9.9.0
|
|
34
|
+
* delete at version 10.0.0
|
|
35
|
+
*/
|
|
36
|
+
const $shortContent = isTriggerParent ? $trigger.find('.aui-expander-short-content') : null;
|
|
37
|
+
if ($content.attr('aria-expanded')) {
|
|
38
|
+
deprecate['aria-expanded']();
|
|
39
|
+
if ($content.attr('aria-expanded') === 'true') {
|
|
40
|
+
$content.addClass('expanded');
|
|
41
|
+
}
|
|
42
|
+
$content.removeAttr('aria-expanded');
|
|
43
|
+
}
|
|
44
|
+
/* end of depraction */
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
$content,
|
|
48
|
+
isTriggerParent,
|
|
49
|
+
$shortContent,
|
|
50
|
+
isExpanded: $content.hasClass('expanded'),
|
|
51
|
+
height: $content.css('min-height'),
|
|
52
|
+
isCollapsible: $trigger.data('collapsible') !== false,
|
|
53
|
+
textReplacement: $trigger.attr('data-replace-text'),
|
|
54
|
+
};
|
|
19
55
|
};
|
|
20
56
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
57
|
+
function expand($trigger) {
|
|
58
|
+
const { $content, isTriggerParent, $shortContent, textReplacement } = getExpanderProperties($trigger);
|
|
59
|
+
|
|
60
|
+
$trigger.attr('aria-expanded', 'true');
|
|
61
|
+
$content.addClass('expanded');
|
|
62
|
+
$content.removeAttr('hidden');
|
|
63
|
+
replaceText($trigger, textReplacement);
|
|
26
64
|
|
|
27
|
-
|
|
28
|
-
$
|
|
65
|
+
if (isTriggerParent) {
|
|
66
|
+
$shortContent.hide();
|
|
29
67
|
}
|
|
30
|
-
};
|
|
31
68
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
'aui-expander-invoke': function (event) {
|
|
35
|
-
var $trigger = $(event.currentTarget);
|
|
36
|
-
var $content = $document.find('#' + $trigger.attr('aria-controls'));
|
|
37
|
-
var isCollapsible = $trigger.data('collapsible') !== false;
|
|
69
|
+
$trigger.trigger('aui-expander-expanded');
|
|
70
|
+
}
|
|
38
71
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
$trigger.trigger('aui-expander-collapse');
|
|
42
|
-
} else {
|
|
43
|
-
$trigger.trigger('aui-expander-expand');
|
|
44
|
-
}
|
|
45
|
-
},
|
|
72
|
+
function collapse($trigger) {
|
|
73
|
+
const { $content, isTriggerParent, $shortContent, textReplacement } = getExpanderProperties($trigger);
|
|
46
74
|
|
|
47
|
-
|
|
48
|
-
|
|
75
|
+
replaceText($trigger, textReplacement);
|
|
76
|
+
$trigger.attr('aria-expanded', 'false');
|
|
77
|
+
$content.removeClass('expanded');
|
|
49
78
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
79
|
+
if (isTriggerParent) {
|
|
80
|
+
$shortContent.show();
|
|
81
|
+
}
|
|
54
82
|
|
|
55
|
-
|
|
56
|
-
|
|
83
|
+
if ($content.outerHeight() === 0) {
|
|
84
|
+
$content.attr('hidden', '');
|
|
85
|
+
}
|
|
57
86
|
|
|
58
|
-
|
|
87
|
+
$trigger.trigger('aui-expander-collapsed');
|
|
88
|
+
}
|
|
59
89
|
|
|
60
|
-
//handle replace text
|
|
61
|
-
replaceText(properties);
|
|
62
90
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
properties.$shortContent.hide();
|
|
66
|
-
}
|
|
67
|
-
properties.$trigger.trigger('aui-expander-expanded');
|
|
91
|
+
function init($trigger) {
|
|
92
|
+
const { $content, isTriggerParent, isExpanded } = getExpanderProperties($trigger);
|
|
68
93
|
|
|
69
|
-
|
|
94
|
+
/**
|
|
95
|
+
* ! Deprecated since 9.9.0
|
|
96
|
+
* delete at version 10.0.0
|
|
97
|
+
*/
|
|
98
|
+
const selector = $trigger.data('replace-selector');
|
|
99
|
+
if (selector) {
|
|
100
|
+
deprecate['replace-selector']();
|
|
101
|
+
}
|
|
102
|
+
if ($content.attr('aria-expanded')) {
|
|
103
|
+
deprecate['aria-expanded']();
|
|
104
|
+
if ($content.attr('aria-expanded') === 'true') {
|
|
105
|
+
$content.addClass('expanded');
|
|
106
|
+
}
|
|
107
|
+
$content.removeAttr('aria-expanded');
|
|
108
|
+
}
|
|
70
109
|
|
|
71
|
-
'aui-expander-
|
|
72
|
-
|
|
110
|
+
const $shortContent = isTriggerParent ? $trigger.find('.aui-expander-short-content') : null;
|
|
111
|
+
if ($shortContent) {
|
|
112
|
+
deprecate['short-content']();
|
|
113
|
+
}
|
|
114
|
+
/* end of depraction */
|
|
73
115
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
116
|
+
if ($content.outerHeight() === 0) {
|
|
117
|
+
!isExpanded && $content.attr('hidden', '');
|
|
118
|
+
}
|
|
119
|
+
$trigger.attr('aria-expanded', isExpanded ? 'true' : 'false');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const replaceText = ($trigger, textReplacement) => {
|
|
123
|
+
if (!textReplacement) { return };
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* ! Deprecated since 9.9.0
|
|
127
|
+
* delete at version 10.0.0
|
|
128
|
+
*/
|
|
129
|
+
const selector = $trigger.data('replace-selector');
|
|
130
|
+
if (selector) {
|
|
131
|
+
deprecate['replace-selector']();
|
|
132
|
+
const $deprecatedReplaceElement = $trigger.find(selector);
|
|
133
|
+
$trigger.attr('data-replace-text', $deprecatedReplaceElement.text());
|
|
134
|
+
$deprecatedReplaceElement.text(textReplacement);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
/* end of depraction */
|
|
78
138
|
|
|
79
|
-
|
|
80
|
-
|
|
139
|
+
const $deepestChild = $trigger.find(':not(:has(*)):first');
|
|
140
|
+
const $replaceElement = $deepestChild.length ? $deepestChild : $trigger;
|
|
141
|
+
$trigger.attr('data-replace-text', $replaceElement.text());
|
|
142
|
+
$replaceElement.text(textReplacement);
|
|
143
|
+
};
|
|
81
144
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
145
|
+
const EXPANDER_EVENTS = {
|
|
146
|
+
'aui-expander-invoke': function (event) {
|
|
147
|
+
const $trigger = $(event.currentTarget)
|
|
148
|
+
const { isCollapsible, isExpanded } = getExpanderProperties($trigger);
|
|
85
149
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
150
|
+
if (isExpanded && isCollapsible) {
|
|
151
|
+
$trigger.trigger('aui-expander-collapse');
|
|
152
|
+
} else {
|
|
153
|
+
$trigger.trigger('aui-expander-expand');
|
|
89
154
|
}
|
|
155
|
+
},
|
|
90
156
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
157
|
+
'aui-expander-expand': function (event) {
|
|
158
|
+
expand($(event.currentTarget))
|
|
159
|
+
},
|
|
95
160
|
|
|
96
|
-
|
|
161
|
+
'aui-expander-collapse': function (event) {
|
|
162
|
+
collapse($(event.currentTarget));
|
|
97
163
|
},
|
|
98
164
|
|
|
99
165
|
'click.aui-expander': function (event) {
|
|
100
|
-
|
|
166
|
+
const $target = $(event.currentTarget);
|
|
101
167
|
$target.trigger('aui-expander-invoke', event.currentTarget);
|
|
102
168
|
}
|
|
103
169
|
};
|
|
104
170
|
|
|
105
|
-
|
|
106
|
-
$document.
|
|
171
|
+
$(document).on(EXPANDER_EVENTS, '.aui-expander-trigger');
|
|
172
|
+
$(document).ready(function() {
|
|
173
|
+
$('.aui-expander-trigger').each(function() {
|
|
174
|
+
const $trigger = $(this);
|
|
175
|
+
init($trigger);
|
|
176
|
+
})
|
|
177
|
+
})
|
|
@@ -80,6 +80,42 @@ a.aui-button,
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
// Warning button type
|
|
84
|
+
.aui-button-warning {
|
|
85
|
+
#aui-buttons.aui-warning-button-style(normal);
|
|
86
|
+
|
|
87
|
+
&:hover,
|
|
88
|
+
&:focus {
|
|
89
|
+
#aui-buttons.aui-warning-button-style(hover);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&:active {
|
|
93
|
+
#aui-buttons.aui-warning-button-style(active);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&.active {
|
|
97
|
+
#aui-buttons.aui-button-style(selected);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Danger button type
|
|
102
|
+
.aui-button-danger {
|
|
103
|
+
#aui-buttons.aui-danger-button-style(normal);
|
|
104
|
+
|
|
105
|
+
&:hover,
|
|
106
|
+
&:focus {
|
|
107
|
+
#aui-buttons.aui-danger-button-style(hover);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&:active {
|
|
111
|
+
#aui-buttons.aui-danger-button-style(active);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&.active {
|
|
115
|
+
#aui-buttons.aui-button-style(selected);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
83
119
|
// Link + Text button types
|
|
84
120
|
.aui-button-link,
|
|
85
121
|
.aui-button-text {
|
|
@@ -1,49 +1,55 @@
|
|
|
1
1
|
@import (reference) './imports/global';
|
|
2
2
|
|
|
3
3
|
.aui-expander-short-content[hidden],
|
|
4
|
-
.aui-expander-content[hidden]
|
|
5
|
-
.aui-expander-content[aria-expanded="true"] .aui-expander-ellipsis /* reveal-text pattern */ {
|
|
4
|
+
.aui-expander-content[hidden] {
|
|
6
5
|
display: none;
|
|
7
6
|
}
|
|
8
7
|
|
|
9
|
-
.aui-expander-content
|
|
10
|
-
|
|
11
|
-
height: 0; /* Collapsed by default */
|
|
8
|
+
.aui-expander-content {
|
|
9
|
+
height: 0;
|
|
12
10
|
overflow: hidden;
|
|
13
11
|
position: relative;
|
|
14
12
|
}
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
/**
|
|
15
|
+
* ! Deprecated since 9.9.0
|
|
16
|
+
* delete at version 10.0.0
|
|
17
|
+
* aria-expanded will no longer be used as an
|
|
18
|
+
* determinant if the expander is expanded
|
|
19
|
+
*/
|
|
20
|
+
.aui-expander-content[aria-expanded="true"],
|
|
21
|
+
.aui-expander-content.expanded {
|
|
22
|
+
height: auto;
|
|
18
23
|
}
|
|
19
24
|
|
|
20
25
|
.aui-expander-trigger {
|
|
21
26
|
cursor: pointer;
|
|
27
|
+
color: var(--aui-link-color);
|
|
28
|
+
padding: 0;
|
|
29
|
+
background-color: inherit;
|
|
30
|
+
border: none;
|
|
31
|
+
text-decoration: underline;
|
|
22
32
|
}
|
|
23
33
|
|
|
24
34
|
/* ADG REVEAL TEXT PATTERN */
|
|
25
|
-
|
|
35
|
+
.aui-expander-trigger.aui-expander-reveal-text {
|
|
26
36
|
background: @aui-panel-bg-color;
|
|
27
37
|
bottom: 0;
|
|
28
38
|
position: absolute;
|
|
29
39
|
right: 0;
|
|
30
|
-
text-decoration: none;
|
|
31
40
|
padding-left: 10px;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
.aui-expander-trigger.aui-expander-reveal-text:hover > span {
|
|
35
|
-
text-decoration: underline;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.aui-expander-trigger.aui-expander-reveal-text:before {
|
|
39
|
-
color: @aui-text-color;
|
|
40
|
-
content: "\2026\00a0"; /* ellipsis */
|
|
41
|
-
}
|
|
41
|
+
padding-block: 2px;
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
&:before {
|
|
44
|
+
color: @aui-text-color;
|
|
45
|
+
content: "\2026\00a0"; /* ellipsis */
|
|
46
|
+
}
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
.aui-expander-
|
|
49
|
+
.aui-expander-trigger.aui-expander-reveal-text[aria-expanded="true"] {
|
|
48
50
|
position: relative;
|
|
51
|
+
|
|
52
|
+
&::before {
|
|
53
|
+
display: none;
|
|
54
|
+
}
|
|
49
55
|
}
|
|
@@ -113,6 +113,46 @@
|
|
|
113
113
|
#aui-buttons.aui-button-style(disabled);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
.aui-warning-button-style(normal) {
|
|
117
|
+
--aui-btn-bg: var(--aui-button-warning-bg-color);
|
|
118
|
+
--aui-btn-text: var(--aui-button-warning-text-color);
|
|
119
|
+
font-weight: @aui-font-weight-medium;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.aui-warning-button-style(hover) {
|
|
123
|
+
--aui-btn-bg: var(--aui-button-warning-hover-bg-color);
|
|
124
|
+
--aui-btn-text: var(--aui-button-warning-active-text-color);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.aui-warning-button-style(active) {
|
|
128
|
+
--aui-btn-bg: var(--aui-button-warning-active-bg-color);
|
|
129
|
+
--aui-btn-text: var(--aui-button-warning-active-text-color);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.aui-warning-button-style(disabled) {
|
|
133
|
+
#aui-buttons.aui-button-style(disabled);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.aui-danger-button-style(normal) {
|
|
137
|
+
--aui-btn-bg: var(--aui-button-danger-bg-color);
|
|
138
|
+
--aui-btn-text: var(--aui-button-danger-text-color);
|
|
139
|
+
font-weight: @aui-font-weight-medium;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.aui-danger-button-style(hover) {
|
|
143
|
+
--aui-btn-bg: var(--aui-button-danger-hover-bg-color);
|
|
144
|
+
--aui-btn-text: var(--aui-button-danger-active-text-color);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.aui-danger-button-style(active) {
|
|
148
|
+
--aui-btn-bg: var(--aui-button-danger-active-bg-color);
|
|
149
|
+
--aui-btn-text: var(--aui-button-danger-active-text-color);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.aui-danger-button-style(disabled) {
|
|
153
|
+
#aui-buttons.aui-button-style(disabled);
|
|
154
|
+
}
|
|
155
|
+
|
|
116
156
|
.aui-subtle-button-style(normal) {
|
|
117
157
|
--aui-btn-bg: var(--aui-button-subtle-bg-color, transparent);
|
|
118
158
|
--aui-btn-border: var(--aui-button-subtle-border-color, transparent);
|
|
@@ -145,6 +145,20 @@
|
|
|
145
145
|
--aui-button-primary-active-text-color: @ak-color-N0;
|
|
146
146
|
--aui-button-primary-disabled-bg-color: var(--aui-button-default-disabled-bg-color);
|
|
147
147
|
--aui-button-primary-disabled-text-color: var(--aui-button-default-disabled-text-color);
|
|
148
|
+
--aui-button-warning-bg-color: @ak-color-Y300;
|
|
149
|
+
--aui-button-warning-text-color: @ak-color-N800;
|
|
150
|
+
--aui-button-warning-hover-bg-color: @ak-color-Y500;
|
|
151
|
+
--aui-button-warning-active-bg-color: darken(@ak-color-Y500, 10%);
|
|
152
|
+
--aui-button-warning-active-text-color: @ak-color-N800;
|
|
153
|
+
--aui-button-warning-selected-bg-color: @ak-color-Y500;
|
|
154
|
+
--aui-button-warning-selected-text-color: @ak-color-N800;
|
|
155
|
+
--aui-button-danger-bg-color: @ak-color-R500;
|
|
156
|
+
--aui-button-danger-text-color: @ak-color-N0;
|
|
157
|
+
--aui-button-danger-hover-bg-color: darken(@ak-color-R500, 10%);
|
|
158
|
+
--aui-button-danger-active-bg-color: darken(@ak-color-R500, 20%);
|
|
159
|
+
--aui-button-danger-active-text-color: @ak-color-N0;
|
|
160
|
+
--aui-button-danger-selected-bg-color: darken(@ak-color-R500, 10%);
|
|
161
|
+
--aui-button-danger-selected-text-color: @ak-color-N0;
|
|
148
162
|
--aui-button-light-bg-color: @ak-color-N0;
|
|
149
163
|
--aui-button-subtle-text-color: @ak-color-N600;
|
|
150
164
|
|
|
@@ -482,6 +496,20 @@
|
|
|
482
496
|
--aui-button-primary-active-text-color: @ak-color-N0;
|
|
483
497
|
--aui-button-primary-disabled-bg-color: var(--aui-button-default-disabled-bg-color);
|
|
484
498
|
--aui-button-primary-disabled-text-color: var(--aui-button-default-disabled-text-color);
|
|
499
|
+
--aui-button-warning-bg-color: @ak-color-Y300;
|
|
500
|
+
--aui-button-warning-text-color: @ak-color-N20;
|
|
501
|
+
--aui-button-warning-hover-bg-color: @ak-color-Y200;
|
|
502
|
+
--aui-button-warning-active-bg-color: @ak-color-Y100;
|
|
503
|
+
--aui-button-warning-active-text-color: @ak-color-N20;
|
|
504
|
+
--aui-button-warning-selected-bg-color: @ak-color-Y200;
|
|
505
|
+
--aui-button-warning-selected-text-color: @ak-color-N20;
|
|
506
|
+
--aui-button-danger-bg-color: @ak-color-R200;
|
|
507
|
+
--aui-button-danger-text-color: @ak-color-N0;
|
|
508
|
+
--aui-button-danger-hover-bg-color: @ak-color-R100;
|
|
509
|
+
--aui-button-danger-active-bg-color: @ak-color-R75;
|
|
510
|
+
--aui-button-danger-active-text-color: @ak-color-N0;
|
|
511
|
+
--aui-button-danger-selected-bg-color: @ak-color-R100;
|
|
512
|
+
--aui-button-danger-selected-text-color: @ak-color-N0;
|
|
485
513
|
--aui-button-light-bg-color: transparent;
|
|
486
514
|
--aui-button-subtle-text-color: @ak-color-N600;
|
|
487
515
|
|
|
@@ -818,6 +846,20 @@
|
|
|
818
846
|
--aui-button-primary-active-text-color: var(--ds-text-inverse, @ak-color-N0);
|
|
819
847
|
--aui-button-primary-disabled-bg-color: var(--aui-button-default-disabled-bg-color);
|
|
820
848
|
--aui-button-primary-disabled-text-color: var(--aui-button-default-disabled-text-color);
|
|
849
|
+
--aui-button-warning-bg-color: var(--ds-background-warning-bold, @ak-color-Y300);
|
|
850
|
+
--aui-button-warning-text-color: var(--ds-text-warning-inverse, @ak-color-N800);
|
|
851
|
+
--aui-button-warning-hover-bg-color: var(--ds-background-warning-bold-hovered, @ak-color-Y500);
|
|
852
|
+
--aui-button-warning-active-bg-color: var(--ds-background-warning-bold-pressed, darken(@ak-color-Y500, 10%));
|
|
853
|
+
--aui-button-warning-active-text-color: var(--ds-text-warning-inverse, @ak-color-N800);
|
|
854
|
+
--aui-button-warning-selected-bg-color: var(--ds-background-warning-bold-hovered, @ak-color-N800);
|
|
855
|
+
--aui-button-warning-selected-text-color: var(--ds-text-warning-inverse, @ak-color-N800);
|
|
856
|
+
--aui-button-danger-bg-color: var(--ds-background-danger-bold, @ak-color-R500);
|
|
857
|
+
--aui-button-danger-text-color: var(--ds-text-inverse, @ak-color-N0);
|
|
858
|
+
--aui-button-danger-hover-bg-color: var(--ds-background-danger-bold-hovered, darken(@ak-color-R500, 10%));
|
|
859
|
+
--aui-button-danger-active-bg-color: var(--ds-background-danger-bold-pressed, darken(@ak-color-R500, 20%));
|
|
860
|
+
--aui-button-danger-active-text-color: var(--ds-text-inverse, @ak-color-N0);
|
|
861
|
+
--aui-button-danger-selected-bg-color: var(--ds-background-danger-bold-hovered, darken(@ak-color-R500, 10%));
|
|
862
|
+
--aui-button-danger-selected-text-color: var(--ds-text-inverse, @ak-color-N0);
|
|
821
863
|
--aui-button-light-bg-color: var(--ds-background-input, @ak-color-N0);
|
|
822
864
|
--aui-button-subtle-text-color: var(--ds-text, @ak-color-N600);
|
|
823
865
|
|