@koobiq/components 18.5.3 → 18.7.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.
Files changed (113) hide show
  1. package/accordion/_accordion-theme.scss +3 -3
  2. package/alert/_alert-theme.scss +3 -3
  3. package/badge/_badge-theme.scss +8 -4
  4. package/badge/badge-tokens.scss +8 -0
  5. package/badge/badge.component.d.ts +1 -0
  6. package/button/_button-theme.scss +2 -2
  7. package/button-toggle/_button-toggle-theme.scss +1 -1
  8. package/checkbox/_checkbox-theme.scss +4 -4
  9. package/checkbox/checkbox-tokens.scss +4 -4
  10. package/code-block/_code-block-theme.scss +4 -4
  11. package/core/forms/_forms-theme.scss +1 -1
  12. package/core/option/_optgroup-theme.scss +2 -2
  13. package/core/option/_option-action-theme.scss +1 -1
  14. package/core/option/_option-theme.scss +2 -2
  15. package/core/selection/pseudo-checkbox/pseudo-checkbox-tokens.scss +4 -4
  16. package/core/styles/theming/_theming.scss +2 -42
  17. package/core/styles/typography/_typography.scss +120 -159
  18. package/core/styles/visual/_layout.scss +1 -1
  19. package/datepicker/_datepicker-theme.scss +2 -2
  20. package/dl/_dl-theme.scss +2 -2
  21. package/dl/dl-tokens.scss +2 -2
  22. package/dropdown/_dropdown-theme.scss +8 -4
  23. package/empty-state/_empty-state-theme.scss +4 -4
  24. package/esm2022/badge/badge.component.mjs +4 -3
  25. package/esm2022/button/button.component.mjs +2 -2
  26. package/esm2022/checkbox/checkbox.mjs +2 -2
  27. package/esm2022/code-block/code-block.component.mjs +2 -2
  28. package/esm2022/core/option/action.mjs +2 -2
  29. package/esm2022/core/option/optgroup.mjs +2 -2
  30. package/esm2022/core/selection/pseudo-checkbox/pseudo-checkbox.mjs +2 -2
  31. package/esm2022/core/version.mjs +2 -2
  32. package/esm2022/dl/dl.component.mjs +2 -2
  33. package/esm2022/dropdown/dropdown.component.mjs +3 -3
  34. package/esm2022/icon/icon-button.component.mjs +2 -2
  35. package/esm2022/markdown/markdown.component.mjs +2 -2
  36. package/esm2022/select/select.component.mjs +3 -3
  37. package/esm2022/splitter/splitter.component.mjs +3 -3
  38. package/esm2022/timezone/timezone-select.component.mjs +2 -2
  39. package/esm2022/toggle/toggle.component.mjs +3 -3
  40. package/esm2022/tree-select/tree-select.component.mjs +3 -3
  41. package/fesm2022/koobiq-components-badge.mjs +3 -2
  42. package/fesm2022/koobiq-components-badge.mjs.map +1 -1
  43. package/fesm2022/koobiq-components-button.mjs +2 -2
  44. package/fesm2022/koobiq-components-button.mjs.map +1 -1
  45. package/fesm2022/koobiq-components-checkbox.mjs +2 -2
  46. package/fesm2022/koobiq-components-checkbox.mjs.map +1 -1
  47. package/fesm2022/koobiq-components-code-block.mjs +2 -2
  48. package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
  49. package/fesm2022/koobiq-components-core.mjs +7 -7
  50. package/fesm2022/koobiq-components-core.mjs.map +1 -1
  51. package/fesm2022/koobiq-components-dl.mjs +2 -2
  52. package/fesm2022/koobiq-components-dropdown.mjs +2 -2
  53. package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
  54. package/fesm2022/koobiq-components-icon.mjs +2 -2
  55. package/fesm2022/koobiq-components-icon.mjs.map +1 -1
  56. package/fesm2022/koobiq-components-markdown.mjs +2 -2
  57. package/fesm2022/koobiq-components-markdown.mjs.map +1 -1
  58. package/fesm2022/koobiq-components-select.mjs +2 -2
  59. package/fesm2022/koobiq-components-select.mjs.map +1 -1
  60. package/fesm2022/koobiq-components-splitter.mjs +2 -2
  61. package/fesm2022/koobiq-components-splitter.mjs.map +1 -1
  62. package/fesm2022/koobiq-components-timezone.mjs +2 -2
  63. package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
  64. package/fesm2022/koobiq-components-toggle.mjs +2 -2
  65. package/fesm2022/koobiq-components-toggle.mjs.map +1 -1
  66. package/fesm2022/koobiq-components-tree-select.mjs +2 -2
  67. package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
  68. package/file-upload/_file-upload-theme.scss +7 -7
  69. package/form-field/_form-field-theme.scss +2 -2
  70. package/form-field/_hint-theme.scss +2 -2
  71. package/icon/_icon-button-theme.scss +2 -2
  72. package/input/_input-theme.scss +2 -2
  73. package/link/_link-theme.scss +3 -3
  74. package/list/_list-theme.scss +2 -2
  75. package/loader-overlay/_loader-overlay-theme.scss +4 -4
  76. package/markdown/_markdown-theme.scss +9 -9
  77. package/markdown/markdown-tokens.scss +23 -23
  78. package/modal/_modal-theme.scss +2 -2
  79. package/navbar/_navbar-theme.scss +2 -2
  80. package/package.json +6 -6
  81. package/popover/_popover-theme.scss +2 -2
  82. package/prebuilt-themes/dark-theme.css +1 -1
  83. package/prebuilt-themes/light-theme.css +1 -1
  84. package/prebuilt-themes/theme.css +1 -1
  85. package/progress-bar/_progress-bar-theme.scss +2 -2
  86. package/progress-spinner/_progress-spinner-theme.scss +2 -2
  87. package/radio/_radio-theme.scss +4 -4
  88. package/risk-level/_risk-level-theme.scss +1 -1
  89. package/schematics/collection.json +12 -2
  90. package/schematics/migrations/css-selectors/data.js +65 -0
  91. package/schematics/migrations/css-selectors/index.js +103 -0
  92. package/schematics/migrations/css-selectors/schema.json +25 -0
  93. package/schematics/migrations/deprecated-icons/data.js +1580 -0
  94. package/schematics/migrations/deprecated-icons/index.js +96 -0
  95. package/schematics/{new-icons-pack → migrations/new-icons-pack}/index.js +13 -29
  96. package/schematics/migrations/new-icons-pack/schema.json +25 -0
  97. package/schematics/ng-add/index.js +5 -5
  98. package/schematics/utils/package-config.js +6 -60
  99. package/select/_select-theme.scss +5 -5
  100. package/sidepanel/_sidepanel-theme.scss +2 -2
  101. package/splitter/_splitter-theme.scss +1 -1
  102. package/table/_table-theme.scss +2 -2
  103. package/tabs/_tabs-theme.scss +1 -1
  104. package/tags/_tag-theme.scss +2 -2
  105. package/textarea/_textarea-theme.scss +1 -1
  106. package/timezone/_timezone-option-theme.scss +4 -4
  107. package/toast/_toast-theme.scss +2 -2
  108. package/toggle/_toggle-theme.scss +5 -5
  109. package/tooltip/_tooltip-theme.scss +2 -2
  110. package/tree/_tree-theme.scss +2 -2
  111. package/tree-select/_tree-select-theme.scss +3 -3
  112. /package/schematics/{new-icons-pack → migrations/deprecated-icons}/schema.json +0 -0
  113. /package/schematics/{new-icons-pack → migrations/new-icons-pack}/data.js +0 -0
@@ -0,0 +1,65 @@
1
+ 'use strict';
2
+
3
+ const typographyCssSelectorsReplacement = [
4
+ { replace: 'kbq-display-1-strong', replaceWith: 'kbq-display-big-strong' },
5
+ { replace: 'kbq-display-2-strong', replaceWith: 'kbq-display-normal-strong' },
6
+ { replace: 'kbq-display-3-strong', replaceWith: 'kbq-display-compact-strong' },
7
+ { replace: 'kbq-body-tabular', replaceWith: 'kbq-tabular-big' },
8
+ { replace: 'kbq-body-strong', replaceWith: 'kbq-text-big-strong' },
9
+ { replace: 'kbq-body-mono-strong', replaceWith: 'kbq-mono-big-strong' },
10
+ { replace: 'kbq-body-mono', replaceWith: 'kbq-mono-big' },
11
+ { replace: 'kbq-body-caps', replaceWith: 'kbq-caps-big' },
12
+ { replace: 'kbq-caption-tabular', replaceWith: 'kbq-tabular-normal' },
13
+ { replace: 'kbq-caption-strong', replaceWith: 'kbq-text-normal-strong' },
14
+ { replace: 'kbq-caption-mono-strong', replaceWith: 'kbq-mono-normal-strong' },
15
+ { replace: 'kbq-caption-mono', replaceWith: 'kbq-mono-normal' },
16
+ { replace: 'kbq-caption-caps', replaceWith: 'kbq-caps-normal' },
17
+ { replace: 'kbq-extra-small-text-strong', replaceWith: 'kbq-text-compact-strong' },
18
+ { replace: 'kbq-extra-small-text-mono', replaceWith: 'kbq-mono-compact' },
19
+ { replace: 'kbq-extra-small-text-caps', replaceWith: 'kbq-caps-compact' },
20
+ { replace: 'kbq-display-1', replaceWith: 'kbq-display-big' },
21
+ { replace: 'kbq-display-2', replaceWith: 'kbq-display-normal' },
22
+ { replace: 'kbq-display-3', replaceWith: 'kbq-display-compact' },
23
+ { replace: 'kbq-body', replaceWith: 'kbq-text-big' },
24
+ { replace: 'kbq-caption', replaceWith: 'kbq-text-normal' },
25
+ { replace: 'kbq-extra-small-text', replaceWith: 'kbq-text-compact' }
26
+ ];
27
+ const colorsVarsReplacement = [
28
+ /* NEUTRAL */
29
+ { replace: 'neutral-white', replaceWith: '<remove from project>' },
30
+ /* BRAND */
31
+ { replace: 'brand-default', replaceWith: '<remove from project>' },
32
+ { replace: 'brand-palette', replaceWith: '<remove from project>' },
33
+ /* INFO */
34
+ { replace: 'info-default', replaceWith: '<remove from project>' },
35
+ /* BACKGROUND */
36
+ { replace: 'background-background-disabled', replaceWith: 'states-background-disabled' },
37
+ { replace: 'background-background-less-contrast', replaceWith: 'states-background-secondary' },
38
+ { replace: 'background-background-under', replaceWith: 'states-background-secondary' },
39
+ { replace: 'background-background', replaceWith: 'background-bg' },
40
+ { replace: 'background-overlay-hover', replaceWith: 'states-background-transparent-hover' },
41
+ { replace: 'background-overlay-active', replaceWith: 'states-background-transparent-active' },
42
+ { replace: 'background-overlay-disabled', replaceWith: 'states-background-transparent-disabled' },
43
+ /* FOREGROUND */
44
+ { replace: 'foreground-text-less-contrast', replaceWith: 'foreground-contrast-fade' },
45
+ { replace: 'foreground-text-disabled', replaceWith: 'states-foreground-disabled' },
46
+ { replace: 'foreground-text-error', replaceWith: 'foreground-contrast-fade' },
47
+ { replace: 'foreground-text-success', replaceWith: 'foreground-success' },
48
+ { replace: 'foreground-divider', replaceWith: 'line-contrast-less' },
49
+ { replace: 'foreground-text', replaceWith: 'foreground-contrast' },
50
+ { replace: 'foreground-icon', replaceWith: 'icon-contrast' },
51
+ { replace: 'foreground-border', replaceWith: 'line-contrast-fade' },
52
+ /* STATES */
53
+ { replace: 'states-background-ghost-hover', replaceWith: 'states-background-transparent-hover' },
54
+ { replace: 'states-background-ghost-active', replaceWith: 'states-background-transparent-active' },
55
+ /* ICON */
56
+ { replace: 'states-focused-color-error', replaceWith: 'states-line-focus-error' },
57
+ { replace: 'states-focused-color', replaceWith: 'states-line-focus-theme' },
58
+ { replace: 'states-selected-color', replaceWith: '<remove from project>' },
59
+ { replace: 'states-pressed-shadow', replaceWith: '<remove from project>' },
60
+ { replace: 'states-pressed-shadow', replaceWith: '<remove from project>' },
61
+ { replace: 'others-brand', replaceWith: '<remove from project>' }
62
+ ];
63
+
64
+ exports.colorsVarsReplacement = colorsVarsReplacement;
65
+ exports.typographyCssSelectorsReplacement = typographyCssSelectorsReplacement;
@@ -0,0 +1,103 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var path = require('path');
6
+ var utils_packageConfig = require('../../package-config-D0ROjo4J.js');
7
+ var migrations_cssSelectors_data = require('./data.js');
8
+ require('@angular-devkit/schematics');
9
+ require('@schematics/angular/utility');
10
+
11
+ function _interopNamespaceDefault(e) {
12
+ var n = Object.create(null);
13
+ if (e) {
14
+ Object.keys(e).forEach(function (k) {
15
+ if (k !== 'default') {
16
+ var d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: function () { return e[k]; }
20
+ });
21
+ }
22
+ });
23
+ }
24
+ n.default = e;
25
+ return Object.freeze(n);
26
+ }
27
+
28
+ var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
29
+
30
+ function cssSelectors(options) {
31
+ let targetDir;
32
+ return async (tree, context) => {
33
+ const { project, fix, stylesExt } = options;
34
+ try {
35
+ const projectDefinition = await utils_packageConfig.setupOptions(project, tree);
36
+ targetDir = projectDefinition ? tree.getDir(projectDefinition.root) : tree;
37
+ }
38
+ catch (e) {
39
+ targetDir = tree;
40
+ }
41
+ const { logger } = context;
42
+ const getDeprecatedFrom = (content, replacementInfo) => {
43
+ return replacementInfo.filter(({ replace }) => new RegExp(`\\b${replace}\\b`, 'g').exec(content));
44
+ };
45
+ const handleReplacements = (newContent, path) => {
46
+ if (fix) {
47
+ migrations_cssSelectors_data.typographyCssSelectorsReplacement.forEach(({ replace, replaceWith }) => {
48
+ newContent = newContent.replace(new RegExp(`\\b${replace}\\b`, 'g'), replaceWith);
49
+ });
50
+ }
51
+ else {
52
+ const foundSelectors = getDeprecatedFrom(newContent, migrations_cssSelectors_data.typographyCssSelectorsReplacement);
53
+ if (foundSelectors.length) {
54
+ logger.warn(getTypographyReplacements(path, foundSelectors));
55
+ }
56
+ }
57
+ // Just suggest about colors replacements without changing file,
58
+ // since it's potentially a complex task to handle
59
+ const foundColors = getDeprecatedFrom(newContent, migrations_cssSelectors_data.colorsVarsReplacement);
60
+ if (foundColors.length) {
61
+ logger.warn(getBaseReplacements(path, foundColors));
62
+ }
63
+ return newContent;
64
+ };
65
+ // Update templates & components & styles
66
+ targetDir.visit((path, entry) => {
67
+ // if project property not provided, provide node_modules to be changed
68
+ if (path.includes('node_modules'))
69
+ return;
70
+ if (path.endsWith('.html') || path.endsWith('.ts') || path.endsWith(stylesExt)) {
71
+ const initialContent = entry?.content.toString();
72
+ let newContent = initialContent;
73
+ if (newContent) {
74
+ newContent = handleReplacements(newContent, path);
75
+ if (initialContent !== newContent) {
76
+ tree.overwrite(path, newContent || '');
77
+ }
78
+ }
79
+ }
80
+ });
81
+ };
82
+ }
83
+ function getBaseReplacements(filePath, foundSelectors) {
84
+ const parsedFilePath = path__namespace.relative(__dirname, `.${filePath}`).replace(/\\/g, '/');
85
+ return `
86
+ -------------------------
87
+ Please pay attention! Found deprecated сss-selectors in file:
88
+ ${parsedFilePath}
89
+ Replace with specified rules:
90
+ ${foundSelectors.map(({ replace, replaceWith }) => `\t${replace} -> \t${replaceWith}`).join('\n')}
91
+ -------------------------
92
+ `;
93
+ }
94
+ function getTypographyReplacements(filePath, foundSelectors) {
95
+ const baseMessage = getBaseReplacements(filePath, foundSelectors);
96
+ return `${baseMessage}\n
97
+ Or use --fix=true to replace automatically
98
+ Pay attention: overwriting is possible. Check the code after automatic replacement was done.
99
+ -------------------------
100
+ `;
101
+ }
102
+
103
+ exports.default = cssSelectors;
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "koobiq-components-css-selectors",
4
+ "title": "koobiq-components css-selectors schematic",
5
+ "type": "object",
6
+ "properties": {
7
+ "project": {
8
+ "type": "string",
9
+ "description": "Name of the project",
10
+ "$default": {
11
+ "$source": "projectName"
12
+ }
13
+ },
14
+ "fix": {
15
+ "type": "boolean",
16
+ "description": "Whether overwrite icons prefixes or simply inform in console",
17
+ "default": false
18
+ },
19
+ "stylesExt": {
20
+ "type": "string",
21
+ "description": "Use this option to specify styles extension preferred in your project",
22
+ "default": "scss"
23
+ }
24
+ }
25
+ }