@design-factory/design-factory 20.0.0-next.2 → 20.0.0-next.3
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/README.md +17 -16
- package/design-factory-initial-branding.css +1 -1
- package/design-factory.css +2 -2
- package/design-factory.scss +0 -2
- package/fesm2022/design-factory.mjs +197 -63
- package/fesm2022/design-factory.mjs.map +1 -1
- package/index.d.ts +12 -22
- package/package.json +2 -2
- package/schematics/migrations/20_0_0/colors-new-branding/index.d.ts +4 -0
- package/schematics/migrations/20_0_0/colors-new-branding/index.js +70 -27
- package/schematics/migrations/20_0_0/modal-removal/index.d.ts +7 -0
- package/schematics/migrations/20_0_0/modal-removal/index.js +53 -0
- package/schematics/migrations/20_0_0/style-import/index.d.ts +7 -0
- package/schematics/migrations/20_0_0/style-import/index.js +39 -0
- package/schematics/migrations/20_0_0/waves-of-progress/index.d.ts +7 -0
- package/schematics/migrations/20_0_0/waves-of-progress/index.js +69 -0
- package/schematics/migrations/migration.json +15 -0
- package/styles/scss/components/badge/_badge.scss +1 -4
- package/styles/scss/components/button/_button.scss +55 -54
- package/styles/scss/components/card/_card.scss +1 -1
- package/styles/scss/components/collapse/_collapse.scss +6 -1
- package/styles/scss/components/datepicker/_datepicker.scss +9 -11
- package/styles/scss/components/dropdown/_dropdown.scss +6 -0
- package/styles/scss/components/fonts/_icon-font.scss +2 -1
- package/styles/scss/components/footer/_footer.scss +1 -1
- package/styles/scss/components/link/_link.scss +5 -1
- package/styles/scss/components/link/_link.variables.scss +5 -2
- package/styles/scss/components/modal/_modal.scss +44 -39
- package/styles/scss/components/pagination/_pagination.scss +1 -0
- package/styles/scss/components/radio/_radio.scss +1 -1
- package/styles/scss/components/scrollspy/_scrollspy.scss +5 -2
- package/styles/scss/components/toast/_toast.scss +17 -3
- package/styles/scss/themes/brand2023/_variables.scss +18 -3
- package/styles/scss/themes/brand2023/tokens/_root.gen.scss +1 -0
- package/styles/scss/themes/brand2023/tokens/_sass-vars.gen.scss +1 -0
- package/assets/waves_of_progress/arrowRight.svg +0 -34
- package/assets/waves_of_progress/arrowUp.svg +0 -35
- package/assets/waves_of_progress/circleDiagonal.svg +0 -29
- package/assets/waves_of_progress/circleUp.svg +0 -24
- package/styles/scss/components/waves/_waves.scss +0 -15
- package/styles/scss/components/waves/_waves.variables.scss +0 -86
package/index.d.ts
CHANGED
|
@@ -1711,37 +1711,27 @@ declare class DfTitleTruncateDirective implements OnInit, DoCheck {
|
|
|
1711
1711
|
|
|
1712
1712
|
declare class DfWavesOfProgressDirective {
|
|
1713
1713
|
/**
|
|
1714
|
-
* The type of waves to display
|
|
1715
|
-
* It is possible to do so by adding the following snippet to the `angular.json` file in the `assets` configuration:
|
|
1716
|
-
* @example
|
|
1717
|
-
* "assets": [
|
|
1718
|
-
* {
|
|
1719
|
-
* "glob": "** / *", //remove the spaces between the asterisks and the slash
|
|
1720
|
-
* "input": "node-modules/@design-factory/design-factory/assets/",
|
|
1721
|
-
* "output": "assets/"
|
|
1722
|
-
* },
|
|
1723
|
-
* ...]
|
|
1714
|
+
* The type of waves to display
|
|
1724
1715
|
*/
|
|
1725
1716
|
readonly dfWavesOfProgress: i0.InputSignal<"circleDiagonal" | "circleUp" | "arrowRight" | "arrowUp">;
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1717
|
+
/**
|
|
1718
|
+
* The color of the waves. It can be one of the predefined brand colors or a custom color.
|
|
1719
|
+
* @example
|
|
1720
|
+
* 'dark-sky', 'vivid-crimson', 'light-forest', ['#000835', '#3A8BFF']
|
|
1721
|
+
*/
|
|
1722
|
+
readonly color: i0.InputSignal<"dark-sky" | "dark-crimson" | "dark-pumpkin" | "dark-forest" | "dark-canary" | "dark-fuchsia" | "dark-violet" | "vivid-sky" | "vivid-crimson" | "vivid-pumpkin" | "vivid-forest" | "vivid-canary" | "vivid-fuchsia" | "vivid-violet" | "light-sky" | "light-crimson" | "light-pumpkin" | "light-forest" | "light-canary" | "light-fuchsia" | "light-violet" | [string, string]>;
|
|
1723
|
+
readonly backgroundImage: i0.Signal<string>;
|
|
1730
1724
|
/**
|
|
1731
1725
|
* Prepares the SVG string by replacing color variables and encoding it.
|
|
1726
|
+
* @param svgAsString - The SVG string to prepare.
|
|
1732
1727
|
* @param bgColor - The background color.
|
|
1733
1728
|
* @param lineColor - The line color.
|
|
1734
1729
|
* @returns The prepared SVG string.
|
|
1735
1730
|
*/
|
|
1736
|
-
prepareSvg
|
|
1737
|
-
|
|
1738
|
-
* Updates the SVG background image based on the current element's styles.
|
|
1739
|
-
*/
|
|
1740
|
-
updateSvg(): void;
|
|
1741
|
-
constructor();
|
|
1742
|
-
private getSvg;
|
|
1731
|
+
private prepareSvg;
|
|
1732
|
+
private getWavesAsString;
|
|
1743
1733
|
static ɵfac: i0.ɵɵFactoryDeclaration<DfWavesOfProgressDirective, never>;
|
|
1744
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<DfWavesOfProgressDirective, "[dfWavesOfProgress]", ["dfWavesOfProgress"], { "dfWavesOfProgress": { "alias": "dfWavesOfProgress"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1734
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<DfWavesOfProgressDirective, "[dfWavesOfProgress]", ["dfWavesOfProgress"], { "dfWavesOfProgress": { "alias": "dfWavesOfProgress"; "required": true; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1745
1735
|
}
|
|
1746
1736
|
|
|
1747
1737
|
declare class DfWavesOfProgressModule {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@design-factory/design-factory",
|
|
3
3
|
"description": "Amadeus design system",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
|
-
"version": "20.0.0-next.
|
|
5
|
+
"version": "20.0.0-next.3",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"tslib": "^2.0.0"
|
|
8
8
|
},
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@angular/localize": "^20.0.0",
|
|
15
15
|
"@angular/router": "^20.0.0",
|
|
16
16
|
"@ng-bootstrap/ng-bootstrap": "~19.0.0",
|
|
17
|
-
"@ng-select/ng-select": "^15.0.0",
|
|
17
|
+
"@ng-select/ng-select": "^15.0.0 || ^20.0.0",
|
|
18
18
|
"ag-grid-angular": "^32.0.0",
|
|
19
19
|
"ag-grid-community": "^32.0.0",
|
|
20
20
|
"bootstrap": "5.3.7",
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { type Rule } from '@angular-devkit/schematics';
|
|
2
|
+
export declare function replaceContentFactory(isTemplate: boolean, loggingContext: {
|
|
3
|
+
warnings: boolean;
|
|
4
|
+
deprecatedColors: boolean;
|
|
5
|
+
}): (content: string) => string;
|
|
2
6
|
/**
|
|
3
7
|
* This migration updates the classes regarding the colors.
|
|
4
8
|
*
|
|
@@ -1,61 +1,101 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.replaceContentFactory = replaceContentFactory;
|
|
3
4
|
exports.default = colorNamesProcess;
|
|
4
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
6
|
const project_tsconfig_paths_1 = require("../../utils/project_tsconfig_paths");
|
|
6
7
|
const compiler_host_1 = require("../../utils/typescript/compiler_host");
|
|
7
8
|
const template_updater_1 = require("../../utils/template-updater");
|
|
8
9
|
const style_updater_1 = require("../../utils/style-updater");
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const classBreak = '[^a-zA-Z-]'; // to avoid matching "bg-primary-light" for example
|
|
11
|
+
const indent = `[ \t]*`;
|
|
12
|
+
const colorsWithDeprecation = {
|
|
13
|
+
light: 'neutral-soft',
|
|
14
|
+
secondary: 'neutral'
|
|
15
|
+
};
|
|
16
|
+
const regExpColorsWithDeprecation = new RegExp(`(${indent}).*${classBreak}(bg|text|text-bg])-(${Object.keys(colorsWithDeprecation).join('|')})${classBreak}`, 'g');
|
|
17
|
+
const safeColorMap = {
|
|
12
18
|
dark: 'neutral',
|
|
13
19
|
mystery: 'tip',
|
|
14
20
|
yellow: 'chromatic1',
|
|
15
21
|
love: 'chromatic2'
|
|
16
22
|
};
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
23
|
+
const allColorNamesMap = {
|
|
24
|
+
...colorsWithDeprecation,
|
|
25
|
+
...safeColorMap
|
|
26
|
+
};
|
|
27
|
+
const removedColorsList = ['pacific', 'dark-primary', 'dark-green'];
|
|
28
|
+
const regExpRemovedColors = new RegExp(`(${indent}).*${classBreak}(bg|text|text-bg|btn|btn-outline|df-badge-outline|toast)-(${removedColorsList.join('|')})${classBreak}.*`, 'g');
|
|
29
|
+
const colorNames = Object.keys(allColorNamesMap).join('|');
|
|
30
|
+
/*
|
|
31
|
+
Matches "light" color variants, specifically for badges, as "light" colors are only defined for badges.
|
|
32
|
+
for exemple bg-*-light
|
|
33
|
+
*/
|
|
34
|
+
const regExpLight = new RegExp(`${classBreak}(bg|df-badge-outline)-[a-z]+-light${classBreak}`, 'g');
|
|
35
|
+
const regExpBadgeLight = new RegExp(`.*?(badge|toast)${classBreak}bg-light${classBreak}`, 'g');
|
|
36
|
+
const regExpSoftColor = new RegExp(`${classBreak}(bg|text|text-bg|df-badge-outline)-(${colorNames})-soft${classBreak}`, 'g');
|
|
37
|
+
const regExpColors = new RegExp(`([ \t]*).*${classBreak}(bg|text|text-bg|btn|btn-outline|df-badge-outline|toast)-(${colorNames})${classBreak}`, 'g');
|
|
38
|
+
const regExpBadgeOrToast = /(badge|toast)/;
|
|
39
|
+
const regExpBadgeOrButton = /(badge|btn)/;
|
|
25
40
|
function replaceContentFactory(isTemplate, loggingContext) {
|
|
26
41
|
return function replaceContent(content) {
|
|
42
|
+
// Replace the specific bg-light in the badge
|
|
43
|
+
content = content.replace(regExpBadgeLight, function (str) {
|
|
44
|
+
return str.replace('bg-light', 'bg-neutral-soft');
|
|
45
|
+
});
|
|
27
46
|
// Replace the "light" variants by the "soft" ones
|
|
28
|
-
content = content.replace(
|
|
47
|
+
content = content.replace(regExpLight, function (str) {
|
|
29
48
|
const result = str.replace('-light', '-soft');
|
|
30
49
|
return result;
|
|
31
50
|
});
|
|
32
51
|
// Replace the old name by the new ones for the soft first
|
|
33
|
-
content = content.replace(
|
|
52
|
+
content = content.replace(regExpSoftColor, function (str, _prefix, color) {
|
|
34
53
|
let result = str;
|
|
35
|
-
const mappedColor =
|
|
54
|
+
const mappedColor = allColorNamesMap[color];
|
|
36
55
|
if (mappedColor) {
|
|
37
56
|
result = result.replace(color, mappedColor);
|
|
38
57
|
}
|
|
39
58
|
return result;
|
|
40
59
|
});
|
|
41
60
|
// Replace the old name by the new ones
|
|
42
|
-
content = content.replace(
|
|
61
|
+
content = content.replace(regExpColors, function (str, indent, _prefix, color) {
|
|
43
62
|
let result = str;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
63
|
+
if (regExpBadgeOrToast.test(str)) {
|
|
64
|
+
const mappedColor = allColorNamesMap[color];
|
|
65
|
+
if (mappedColor) {
|
|
66
|
+
result = result.replace(color, mappedColor);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
else if (str.includes('btn') && (color === 'secondary' || color === 'light')) {
|
|
70
|
+
loggingContext.warnings = true;
|
|
71
|
+
const msg = `DF 20 migration: ${color} is no longer supported in buttons.`;
|
|
72
|
+
result = isTemplate ? `${indent}<!-- ${msg} -->\n${str}` : `${indent}\\* ${msg} *\\\n${str}`;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
// Safe color replacement
|
|
76
|
+
const mappedColor = safeColorMap[color];
|
|
77
|
+
if (mappedColor) {
|
|
78
|
+
result = result.replace(color, mappedColor);
|
|
79
|
+
}
|
|
47
80
|
}
|
|
48
81
|
return result;
|
|
49
82
|
});
|
|
50
|
-
//
|
|
51
|
-
content = content.replace(
|
|
52
|
-
|
|
83
|
+
// Warning for secondary and light colors
|
|
84
|
+
content = content.replace(regExpColorsWithDeprecation, function (str, _indent, _prefix) {
|
|
85
|
+
if (!regExpBadgeOrButton.test(str)) {
|
|
86
|
+
loggingContext.deprecatedColors = true;
|
|
87
|
+
}
|
|
88
|
+
return str;
|
|
53
89
|
});
|
|
54
90
|
// Removed colors
|
|
55
|
-
content = content.replace(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
91
|
+
content = content.replace(regExpRemovedColors, function (str, indent, _, color) {
|
|
92
|
+
let result = str;
|
|
93
|
+
if (!str.includes('navbar')) {
|
|
94
|
+
loggingContext.warnings = true;
|
|
95
|
+
const msg = `DF 20 migration: ${color} has been removed`;
|
|
96
|
+
result = isTemplate ? `${indent}<!-- ${msg} -->\n${str}` : `${indent}\\* ${msg} *\\\n${str}`;
|
|
97
|
+
}
|
|
98
|
+
return result;
|
|
59
99
|
});
|
|
60
100
|
return content;
|
|
61
101
|
};
|
|
@@ -74,7 +114,7 @@ function replaceContentFactory(isTemplate, loggingContext) {
|
|
|
74
114
|
*/
|
|
75
115
|
function colorNamesProcess() {
|
|
76
116
|
return async (tree, context) => {
|
|
77
|
-
const loggingContext = {
|
|
117
|
+
const loggingContext = { warnings: false, deprecatedColors: false };
|
|
78
118
|
const { buildPaths, testPaths } = await (0, project_tsconfig_paths_1.getProjectTsConfigPaths)(tree);
|
|
79
119
|
const basePath = process.cwd();
|
|
80
120
|
const allPaths = [...buildPaths, ...testPaths];
|
|
@@ -101,8 +141,11 @@ function colorNamesProcess() {
|
|
|
101
141
|
styleUpdater.update(sourceFile, program.getTypeChecker());
|
|
102
142
|
}
|
|
103
143
|
}
|
|
104
|
-
if (loggingContext.
|
|
144
|
+
if (loggingContext.warnings) {
|
|
105
145
|
context.logger.warn('Some removed color classes were found. Check your files for comments in your code.');
|
|
106
146
|
}
|
|
147
|
+
if (loggingContext.deprecatedColors) {
|
|
148
|
+
context.logger.warn('Deprecated color classes (light, secondary) detected. Please review your usage of bg-light, text-light, text-bg-light, bg-secondary, text-secondary, and text-bg-secondary.');
|
|
149
|
+
}
|
|
107
150
|
};
|
|
108
151
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Rule } from '@angular-devkit/schematics';
|
|
2
|
+
/**
|
|
3
|
+
* This migration updates Angular code to remove the usage of the `DfModalService` from the Design Factory library.
|
|
4
|
+
*
|
|
5
|
+
* @returns the Rule to migrate the modal removal
|
|
6
|
+
*/
|
|
7
|
+
export default function modalRemoval(): Rule;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = modalRemoval;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const project_tsconfig_paths_1 = require("../../utils/project_tsconfig_paths");
|
|
6
|
+
const compiler_host_1 = require("../../utils/typescript/compiler_host");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
const core_1 = require("@angular-devkit/core");
|
|
9
|
+
const regexImportDfModal = /import\s\{([^}]*)DfModalService(,\s*)?([^}]*)\}\sfrom\s['"]@design-factory\/design-factory['"];/gm;
|
|
10
|
+
const regexDfModalService = /DfModalService/g;
|
|
11
|
+
const replaceComponent = (text) => {
|
|
12
|
+
text = text.replace(regexImportDfModal, (_match, p1, _p2, p3) => {
|
|
13
|
+
return (`import { NgbModal } from '@ng-bootstrap/ng-bootstrap';` +
|
|
14
|
+
((p1 + p3).trim()
|
|
15
|
+
? `\nimport {${p3.trim() ? p1 : p1.replace(/(.*),\s*/, '$1')}${p3}} from '@design-factory/design-factory';`
|
|
16
|
+
: ''));
|
|
17
|
+
});
|
|
18
|
+
text = text.replace(regexDfModalService, 'NgbModal');
|
|
19
|
+
return text;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* This migration updates Angular code to remove the usage of the `DfModalService` from the Design Factory library.
|
|
23
|
+
*
|
|
24
|
+
* @returns the Rule to migrate the modal removal
|
|
25
|
+
*/
|
|
26
|
+
function modalRemoval() {
|
|
27
|
+
return async (tree, _context) => {
|
|
28
|
+
const { buildPaths, testPaths } = await (0, project_tsconfig_paths_1.getProjectTsConfigPaths)(tree);
|
|
29
|
+
const basePath = process.cwd();
|
|
30
|
+
const allPaths = [...buildPaths, ...testPaths];
|
|
31
|
+
if (!allPaths.length) {
|
|
32
|
+
throw new schematics_1.SchematicsException('Could not find any tsconfig file. Cannot run the `waves of progress` migration.');
|
|
33
|
+
}
|
|
34
|
+
for (const tsconfigPath of allPaths) {
|
|
35
|
+
const program = (0, compiler_host_1.createMigrationProgram)(tree, tsconfigPath, basePath);
|
|
36
|
+
const sourceFiles = program
|
|
37
|
+
.getSourceFiles()
|
|
38
|
+
.filter((sourceFile) => (0, compiler_host_1.canMigrateFile)(basePath, sourceFile, program));
|
|
39
|
+
for (const sourceFile of sourceFiles) {
|
|
40
|
+
const sourceText = sourceFile.getFullText();
|
|
41
|
+
const updatedText = replaceComponent(sourceText);
|
|
42
|
+
if (updatedText !== sourceText) {
|
|
43
|
+
const absFilePath = (0, core_1.normalize)(path_1.posix.resolve('/', (0, core_1.normalize)(sourceFile.fileName)));
|
|
44
|
+
const filePath = path_1.posix.relative((0, core_1.normalize)(process.cwd()), absFilePath);
|
|
45
|
+
const recorder = tree.beginUpdate(filePath);
|
|
46
|
+
recorder.remove(0, sourceText.length);
|
|
47
|
+
recorder.insertRight(0, updatedText);
|
|
48
|
+
tree.commitUpdate(recorder);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = styleImport;
|
|
4
|
+
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
5
|
+
const regexDefault = /@import\s+['"]@design-factory\/design-factory['"];/g;
|
|
6
|
+
/**
|
|
7
|
+
* This migration updates the global styles to import the correct path of design factory styles.
|
|
8
|
+
*
|
|
9
|
+
* @returns the Rule to migrate the style import
|
|
10
|
+
*/
|
|
11
|
+
function styleImport() {
|
|
12
|
+
return async (tree, _context) => {
|
|
13
|
+
const workspace = await (0, workspace_1.getWorkspace)(tree);
|
|
14
|
+
for (const project of workspace.projects.values()) {
|
|
15
|
+
if (project.extensions['projectType'] === 'application') {
|
|
16
|
+
const sassStylePath = `${project.sourceRoot ?? ''}/styles.scss`;
|
|
17
|
+
if (tree.exists(sassStylePath)) {
|
|
18
|
+
const styleText = tree.readText(sassStylePath);
|
|
19
|
+
if (regexDefault.test(styleText)) {
|
|
20
|
+
const recorder = tree.beginUpdate(sassStylePath);
|
|
21
|
+
recorder.remove(0, styleText.length);
|
|
22
|
+
recorder.insertRight(0, styleText.replace(regexDefault, '@import "@design-factory/design-factory/design-factory.scss";'));
|
|
23
|
+
tree.commitUpdate(recorder);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const cssStylePath = `${project.sourceRoot ?? ''}/styles.css`;
|
|
27
|
+
if (tree.exists(cssStylePath)) {
|
|
28
|
+
const styleText = tree.readText(cssStylePath);
|
|
29
|
+
if (regexDefault.test(styleText)) {
|
|
30
|
+
const recorder = tree.beginUpdate(cssStylePath);
|
|
31
|
+
recorder.remove(0, styleText.length);
|
|
32
|
+
recorder.insertRight(0, styleText.replace(regexDefault, '@import "@design-factory/design-factory/design-factory.css";'));
|
|
33
|
+
tree.commitUpdate(recorder);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Rule } from '@angular-devkit/schematics';
|
|
2
|
+
/**
|
|
3
|
+
* This migration updates templates to use inline svg instead of navbar span for the toggler icon.
|
|
4
|
+
*
|
|
5
|
+
* @returns the Rule to migrate the navbar logo
|
|
6
|
+
*/
|
|
7
|
+
export default function wavesOfProgressRefactor(): Rule;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = wavesOfProgressRefactor;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const project_tsconfig_paths_1 = require("../../utils/project_tsconfig_paths");
|
|
6
|
+
const compiler_host_1 = require("../../utils/typescript/compiler_host");
|
|
7
|
+
const template_updater_1 = require("../../utils/template-updater");
|
|
8
|
+
const waveOfProgressDirective = /(<[^>]*?)\s(\[dfWavesOfProgress]="[^"]*")([^>]*?>)/g;
|
|
9
|
+
const wavesClass = /class="([^"]*?)df-waves-(dark|vivid|light)-(sky|crimson|pumpkin|forest|canary|fuchsia|violet)([^"]*?)"/g;
|
|
10
|
+
function replaceHtmlContent(content, loggingContext) {
|
|
11
|
+
return content.replace(waveOfProgressDirective, (match, _g1, wavesDirective, _g2) => {
|
|
12
|
+
if (wavesDirective) {
|
|
13
|
+
loggingContext.foundWaves = true;
|
|
14
|
+
return match.replace(wavesClass, (_match, classesBefore, tonality, color, classesAfter) => {
|
|
15
|
+
if (tonality && color) {
|
|
16
|
+
if (classesBefore === '' && classesAfter === '') {
|
|
17
|
+
return `color="${tonality}-${color}"`;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
return `color="${tonality}-${color}" class="${classesBefore}${classesAfter}"`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
loggingContext.complexCase = true;
|
|
24
|
+
return _match;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return match;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* This migration updates templates to use inline svg instead of navbar span for the toggler icon.
|
|
32
|
+
*
|
|
33
|
+
* @returns the Rule to migrate the navbar logo
|
|
34
|
+
*/
|
|
35
|
+
function wavesOfProgressRefactor() {
|
|
36
|
+
return async (tree, _context) => {
|
|
37
|
+
const { buildPaths, testPaths } = await (0, project_tsconfig_paths_1.getProjectTsConfigPaths)(tree);
|
|
38
|
+
const basePath = process.cwd();
|
|
39
|
+
const allPaths = [...buildPaths, ...testPaths];
|
|
40
|
+
if (!allPaths.length) {
|
|
41
|
+
throw new schematics_1.SchematicsException('Could not find any tsconfig file. Cannot run the `waves of progress` migration.');
|
|
42
|
+
}
|
|
43
|
+
const loggingContext = { foundWaves: false, complexCase: false };
|
|
44
|
+
const templateUpdater = new template_updater_1.TemplateUpdater(tree, (content) => replaceHtmlContent(content, loggingContext));
|
|
45
|
+
for (const tsconfigPath of allPaths) {
|
|
46
|
+
const program = (0, compiler_host_1.createMigrationProgram)(tree, tsconfigPath, basePath);
|
|
47
|
+
const sourceFiles = program
|
|
48
|
+
.getSourceFiles()
|
|
49
|
+
.filter((sourceFile) => (0, compiler_host_1.canMigrateFile)(basePath, sourceFile, program));
|
|
50
|
+
for (const sourceFile of sourceFiles) {
|
|
51
|
+
templateUpdater.update(sourceFile, program.getTypeChecker());
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (loggingContext.foundWaves) {
|
|
55
|
+
_context.logger.warn('Waves of progress no longer relies on @design-factory/asset: please remove it from the angular.json assets configuration if not needed.' +
|
|
56
|
+
`Look for:
|
|
57
|
+
{
|
|
58
|
+
"glob": "**/*",
|
|
59
|
+
"input": "node-modules/@design-factory/design-factory/assets/",
|
|
60
|
+
"output": "assets/"
|
|
61
|
+
},
|
|
62
|
+
` +
|
|
63
|
+
`\n\nPlease keep in mind that the waves no longer need updateSvg() call, please remove it if you are using it.`);
|
|
64
|
+
if (loggingContext.complexCase) {
|
|
65
|
+
_context.logger.warn('The migration could not handle all cases. Please check the updated files for manual adjustments.');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
@@ -60,6 +60,21 @@
|
|
|
60
60
|
"version": "20.0.0",
|
|
61
61
|
"factory": "./20_0_0/spinner-new-branding",
|
|
62
62
|
"optional": true
|
|
63
|
+
},
|
|
64
|
+
"waves-of-progress": {
|
|
65
|
+
"description": "Refactor waves of progress",
|
|
66
|
+
"version": "20.0.0",
|
|
67
|
+
"factory": "./20_0_0/waves-of-progress"
|
|
68
|
+
},
|
|
69
|
+
"style-import": {
|
|
70
|
+
"description": "Sass default import for Design Factory styles has changed.",
|
|
71
|
+
"version": "20.0.0",
|
|
72
|
+
"factory": "./20_0_0/style-import"
|
|
73
|
+
},
|
|
74
|
+
"modal-removal": {
|
|
75
|
+
"description": "DfModalService has been removed and replaced with NgbModal.",
|
|
76
|
+
"version": "20.0.0",
|
|
77
|
+
"factory": "./20_0_0/modal-removal"
|
|
63
78
|
}
|
|
64
79
|
}
|
|
65
80
|
}
|
|
@@ -65,10 +65,7 @@ $df-lightMappedColors: () !default;
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
$disabled-border-color: variable-switch-brand2023(
|
|
69
|
-
var(--#{$prefix}disabled-border-color),
|
|
70
|
-
var(--#{$prefix}disabled-color)
|
|
71
|
-
);
|
|
68
|
+
$disabled-border-color: #{variable-switch-brand2023('disabled-border-color', var(--#{$prefix}disabled-color))};
|
|
72
69
|
&[disabled],
|
|
73
70
|
&.disabled,
|
|
74
71
|
&:has([disabled]),
|
|
@@ -829,63 +829,64 @@ $mapped-theme-colors: ();
|
|
|
829
829
|
}
|
|
830
830
|
|
|
831
831
|
.btn-outline-#{$colorClass}.df-btn-tertiary {
|
|
832
|
-
--#{$prefix}btn-color: var(
|
|
833
|
-
--#{$prefix}button-text-basic-color-#{$color}-default-foreground,
|
|
834
|
-
var(--#{$prefix}color-#{$color}-alt-default-foreground)
|
|
835
|
-
);
|
|
836
|
-
@if $isBrand2023 {
|
|
837
|
-
--#{$prefix}btn-bg: transparent;
|
|
838
|
-
}
|
|
839
|
-
|
|
840
832
|
--#{$prefix}btn-border-color: transparent;
|
|
841
833
|
|
|
842
|
-
|
|
843
|
-
--#{$prefix}
|
|
844
|
-
var(--#{$prefix}color-#{$color}-alt-hovered-foreground)
|
|
845
|
-
);
|
|
846
|
-
--#{$prefix}btn-hover-bg: var(
|
|
847
|
-
--#{$prefix}button-text-basic-color-#{$color}-hovered-background,
|
|
848
|
-
var(--#{$prefix}color-#{$color}-alt-hovered-background)
|
|
849
|
-
);
|
|
850
|
-
--#{$prefix}btn-hover-border-color: var(
|
|
851
|
-
--#{$prefix}button-text-basic-color-#{$color}-hovered-background,
|
|
852
|
-
var(--#{$prefix}color-#{$color}-alt-hovered-background)
|
|
853
|
-
);
|
|
854
|
-
|
|
855
|
-
--#{$prefix}btn-active-color: var(
|
|
856
|
-
--#{$prefix}button-text-basic-color-#{$color}-pressed-foreground,
|
|
857
|
-
var(--#{$prefix}color-#{$color}-alt-pressed-foreground)
|
|
858
|
-
);
|
|
859
|
-
--#{$prefix}btn-active-bg: var(
|
|
860
|
-
--#{$prefix}button-text-basic-color-#{$color}-pressed-background,
|
|
861
|
-
var(--#{$prefix}color-#{$color}-alt-pressed-background)
|
|
862
|
-
);
|
|
863
|
-
--#{$prefix}btn-active-border-color: var(
|
|
864
|
-
--#{$prefix}button-text-basic-color-#{$color}-pressed-background,
|
|
865
|
-
var(--#{$prefix}color-#{$color}-alt-pressed-background)
|
|
866
|
-
);
|
|
867
|
-
|
|
868
|
-
--#{$prefix}btn-disabled-color: var(--#{$prefix}button-text-basic-color-disabled-foreground);
|
|
869
|
-
--#{$prefix}btn-disabled-bg: var(--#{$prefix}button-text-basic-color-disabled-background);
|
|
870
|
-
--#{$prefix}btn-disabled-border-color: var(--#{$prefix}button-text-basic-color-disabled-background);
|
|
834
|
+
@if $isBrand2023 {
|
|
835
|
+
--#{$prefix}btn-bg: transparent;
|
|
871
836
|
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
837
|
+
--#{$prefix}btn-color: var(
|
|
838
|
+
--#{$prefix}button-text-basic-color-#{$color}-default-foreground,
|
|
839
|
+
var(--#{$prefix}color-#{$color}-alt-default-foreground)
|
|
840
|
+
);
|
|
841
|
+
|
|
842
|
+
--#{$prefix}btn-hover-color: var(
|
|
843
|
+
--#{$prefix}button-text-basic-color-#{$color}-hovered-foreground,
|
|
844
|
+
var(--#{$prefix}color-#{$color}-alt-hovered-foreground)
|
|
845
|
+
);
|
|
846
|
+
--#{$prefix}btn-hover-bg: var(
|
|
847
|
+
--#{$prefix}button-text-basic-color-#{$color}-hovered-background,
|
|
848
|
+
var(--#{$prefix}color-#{$color}-alt-hovered-background)
|
|
849
|
+
);
|
|
850
|
+
--#{$prefix}btn-hover-border-color: var(
|
|
851
|
+
--#{$prefix}button-text-basic-color-#{$color}-hovered-background,
|
|
852
|
+
var(--#{$prefix}color-#{$color}-alt-hovered-background)
|
|
853
|
+
);
|
|
854
|
+
|
|
855
|
+
--#{$prefix}btn-active-color: var(
|
|
856
|
+
--#{$prefix}button-text-basic-color-#{$color}-pressed-foreground,
|
|
857
|
+
var(--#{$prefix}color-#{$color}-alt-pressed-foreground)
|
|
858
|
+
);
|
|
859
|
+
--#{$prefix}btn-active-bg: var(
|
|
860
|
+
--#{$prefix}button-text-basic-color-#{$color}-pressed-background,
|
|
861
|
+
var(--#{$prefix}color-#{$color}-alt-pressed-background)
|
|
862
|
+
);
|
|
863
|
+
--#{$prefix}btn-active-border-color: var(
|
|
864
|
+
--#{$prefix}button-text-basic-color-#{$color}-pressed-background,
|
|
865
|
+
var(--#{$prefix}color-#{$color}-alt-pressed-background)
|
|
866
|
+
);
|
|
867
|
+
|
|
868
|
+
--#{$prefix}btn-disabled-color: var(--#{$prefix}button-text-basic-color-disabled-foreground);
|
|
869
|
+
--#{$prefix}btn-disabled-bg: var(--#{$prefix}button-text-basic-color-disabled-background);
|
|
870
|
+
--#{$prefix}btn-disabled-border-color: var(--#{$prefix}button-text-basic-color-disabled-background);
|
|
871
|
+
|
|
872
|
+
--#{$prefix}btn-focus-only-color: var(
|
|
873
|
+
--#{$prefix}button-text-basic-color-#{$color}-default-foreground,
|
|
874
|
+
var(--#{$prefix}color-#{$color}-alt-default-foreground)
|
|
875
|
+
);
|
|
876
|
+
--#{$prefix}btn-focus-only-border-color: transparent;
|
|
877
|
+
--#{$prefix}btn-check-active-hover-color: var(
|
|
878
|
+
--#{$prefix}button-text-basic-color-#{$color}-activeHovered-foreground,
|
|
879
|
+
var(--#{$prefix}color-#{$color}-alt-activeHovered-foreground)
|
|
880
|
+
);
|
|
881
|
+
--#{$prefix}btn-check-active-hover-bg: var(
|
|
882
|
+
--#{$prefix}button-text-basic-color-#{$color}-activeHovered-background,
|
|
883
|
+
var(--#{$prefix}color-#{$color}-alt-activeHovered-background)
|
|
884
|
+
);
|
|
885
|
+
--#{$prefix}btn-check-active-hover-border-color: var(
|
|
886
|
+
--#{$prefix}button-text-basic-color-#{$color}-activeHovered-background,
|
|
887
|
+
var(--#{$prefix}color-#{$color}-alt-activeHovered-background)
|
|
888
|
+
);
|
|
889
|
+
}
|
|
889
890
|
|
|
890
891
|
--#{$prefix}box-shadow-color: #{variable-switch-brand2023(
|
|
891
892
|
varWithDefault(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use 'sass:meta';
|
|
1
2
|
@import '../link/link.mixins';
|
|
2
3
|
|
|
3
4
|
// @deprecated - will be removed in version 21
|
|
@@ -59,7 +60,11 @@ button.df-collapse {
|
|
|
59
60
|
|
|
60
61
|
display: inline-flex;
|
|
61
62
|
align-items: center;
|
|
62
|
-
|
|
63
|
+
@if meta.variable-exists(df-btn-group-hover-box-shadow-color) {
|
|
64
|
+
gap: var(--#{$prefix}spacing-2);
|
|
65
|
+
} @else {
|
|
66
|
+
gap: var(--#{$prefix}btn-icon-margin-end);
|
|
67
|
+
}
|
|
63
68
|
|
|
64
69
|
color: var(--#{$prefix}collapse-link-color);
|
|
65
70
|
text-decoration: var(--#{$prefix}collapse-link-decoration);
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
width: 100%;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.ngb-dp-navigation-select
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
padding-left: 0;
|
|
15
|
-
padding-right: 0.5rem;
|
|
7
|
+
.ngb-dp-navigation-select {
|
|
8
|
+
column-gap: var(--#{$prefix}spacing-2);
|
|
9
|
+
margin-inline: var(--#{$prefix}spacing-2);
|
|
10
|
+
|
|
11
|
+
.form-select {
|
|
12
|
+
padding-inline: var(--#{$prefix}spacing-3);
|
|
13
|
+
padding-block: var(--#{$prefix}spacing-2);
|
|
16
14
|
}
|
|
17
15
|
}
|
|
18
16
|
|
|
@@ -44,8 +42,8 @@
|
|
|
44
42
|
justify-content: var(--#{$prefix}datepicker-navigation-arrow-justify-contents);
|
|
45
43
|
|
|
46
44
|
.ngb-dp-arrow-btn {
|
|
47
|
-
|
|
48
|
-
padding-
|
|
45
|
+
margin-inline: 0;
|
|
46
|
+
padding-inline: 0;
|
|
49
47
|
min-width: var(--#{$prefix}datepicker-arrow-width);
|
|
50
48
|
height: var(--#{$prefix}datepicker-arrow-height);
|
|
51
49
|
border-radius: var(--#{$prefix}datepicker-arrow-border-radius);
|
|
@@ -74,6 +74,12 @@ body,
|
|
|
74
74
|
font-weight: var(--#{$prefix}dropdown-toggle-font-weight); // Fix IE11 bug
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
@if meta.variable-exists($name: 'df-enableBranding2023') and $df-enableBranding2023 {
|
|
78
|
+
&.btn-sm {
|
|
79
|
+
--#{$prefix}dropdown-toggle-margin: var(--#{$prefix}spacing-2);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
77
83
|
& > [class*='icon-']:before {
|
|
78
84
|
margin-inline-end: var(--#{$prefix}dropdown-toggle-margin);
|
|
79
85
|
}
|