@lumx/core 3.20.1-alpha.45 → 3.20.1-alpha.47

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 (56) hide show
  1. package/js/constants/className/index.d.ts +4 -0
  2. package/js/constants/className/index.js +6 -0
  3. package/js/constants/components/index.d.ts +24 -0
  4. package/js/constants/components/index.js +26 -0
  5. package/js/constants/enums/index.d.ts +200 -0
  6. package/js/constants/enums/index.js +155 -0
  7. package/js/constants/index.d.ts +3 -231
  8. package/js/constants/index.js +4 -188
  9. package/js/utils/{color → _internal/color}/resolveColorWithVariants.d.ts +1 -1
  10. package/js/utils/{className → classNames}/color/index.js +2 -2
  11. package/js/utils/{className → classNames}/index.d.ts +1 -0
  12. package/js/utils/{className → classNames}/index.js +1 -0
  13. package/js/utils/{className → classNames}/visually-hidden/index.js +2 -1
  14. package/js/utils/index.d.ts +1 -2
  15. package/js/utils/index.js +2 -3
  16. package/package.json +1 -1
  17. package/js/constants/design-tokens.js +0 -2325
  18. package/js/custom-colors.d.ts +0 -25
  19. package/js/custom-colors.js +0 -43
  20. package/js/types/Callback.js +0 -1
  21. package/js/types/Direction.js +0 -1
  22. package/js/types/Falsy.js +0 -1
  23. package/js/types/GenericProps.js +0 -1
  24. package/js/types/HasAriaLabelOrLabelledBy.js +0 -1
  25. package/js/types/HasClassName.js +0 -1
  26. package/js/types/HasCloseMode.js +0 -1
  27. package/js/types/HasTheme.js +0 -1
  28. package/js/types/HeadingElement.js +0 -1
  29. package/js/types/KebabCase.js +0 -1
  30. package/js/types/LumxClassName.js +0 -1
  31. package/js/types/Point.js +0 -1
  32. package/js/types/Predicate.js +0 -1
  33. package/js/types/RectSize.js +0 -1
  34. package/js/types/Spacing.js +0 -1
  35. package/js/types/TextElement.js +0 -1
  36. package/js/types/ValueOf.js +0 -1
  37. package/js/utils/color/index.js +0 -1
  38. /package/{js/utils/color/resolveColorWithVariants.js → _internal/DPnPEC08.js} +0 -0
  39. /package/js/constants/{design-tokens.d.ts → _internal/design-tokens.d.ts} +0 -0
  40. /package/js/constants/{keycodes.d.ts → keycodes/index.d.ts} +0 -0
  41. /package/js/constants/{keycodes.js → keycodes/index.js} +0 -0
  42. /package/js/utils/{color → _internal/color}/index.d.ts +0 -0
  43. /package/js/utils/{className → classNames}/bem/block.d.ts +0 -0
  44. /package/js/utils/{className → classNames}/bem/block.js +0 -0
  45. /package/js/utils/{className → classNames}/bem/element.d.ts +0 -0
  46. /package/js/utils/{className → classNames}/bem/element.js +0 -0
  47. /package/js/utils/{className → classNames}/bem/generateBEMClass.d.ts +0 -0
  48. /package/js/utils/{className → classNames}/bem/generateBEMClass.js +0 -0
  49. /package/js/utils/{className → classNames}/bem/index.d.ts +0 -0
  50. /package/js/utils/{className → classNames}/bem/index.js +0 -0
  51. /package/js/utils/{className → classNames}/color/index.d.ts +0 -0
  52. /package/js/utils/{className → classNames}/spacing/index.d.ts +0 -0
  53. /package/js/utils/{className → classNames}/spacing/index.js +0 -0
  54. /package/js/utils/{className → classNames}/typography/index.d.ts +0 -0
  55. /package/js/utils/{className → classNames}/typography/index.js +0 -0
  56. /package/js/utils/{className → classNames}/visually-hidden/index.d.ts +0 -0
@@ -1,25 +0,0 @@
1
- interface Variants {
2
- D2?: string;
3
- D1?: string;
4
- N?: string;
5
- L1?: string;
6
- L2?: string;
7
- L3?: string;
8
- L4?: string;
9
- L5?: string;
10
- L6?: string;
11
- }
12
- type ColorPalette = Partial<Record<'primary' | 'secondary', Variants>>;
13
- /**
14
- * Generate CSS variables for the given color palette.
15
- */
16
- export declare function generateCSSColorVariables(palette: ColorPalette): string;
17
- /**
18
- * Set primary and secondary custom colors.
19
- *
20
- * @param sheet The sheet to insert the custom rules in.
21
- * @param colorPalette The custom color palette.
22
- * @param selector The selector used to scope the custom colors (defaults to ':root').
23
- */
24
- export declare function setCustomColors(sheet: CSSStyleSheet, colorPalette: ColorPalette, selector?: string): void;
25
- export {};
@@ -1,43 +0,0 @@
1
- /**
2
- * Generate CSS variables for the given color palette.
3
- */
4
- function generateCSSColorVariables(palette) {
5
- let output = '';
6
- for (const [color, variants] of Object.entries(palette)) {
7
- if (!variants)
8
- continue;
9
- for (const [variantName, colorValue] of Object.entries(variants)) {
10
- output += `--lumx-color-${color}-${variantName}: ${colorValue};\n`;
11
- }
12
- }
13
- return output;
14
- }
15
- /**
16
- * Add a css rule in a given sheet.
17
- *
18
- * @param sheet The sheet to insert the new rules in.
19
- * @param selector The css rules selector.
20
- * @param rules The css rules.
21
- * @param index The css rule index.
22
- */
23
- function _addCSSRule(sheet, selector, rules, index) {
24
- if ('insertRule' in sheet) {
25
- sheet.insertRule(`${selector}{${rules}}`, index);
26
- }
27
- else if ('addRule' in sheet) {
28
- sheet.addRule(selector, rules, index);
29
- }
30
- }
31
- /**
32
- * Set primary and secondary custom colors.
33
- *
34
- * @param sheet The sheet to insert the custom rules in.
35
- * @param colorPalette The custom color palette.
36
- * @param selector The selector used to scope the custom colors (defaults to ':root').
37
- */
38
- function setCustomColors(sheet, colorPalette, selector = ':root') {
39
- const rules = generateCSSColorVariables(colorPalette);
40
- _addCSSRule(sheet, selector, rules, 0);
41
- }
42
-
43
- export { generateCSSColorVariables, setCustomColors };
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
package/js/types/Falsy.js DELETED
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
package/js/types/Point.js DELETED
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
-
@@ -1 +0,0 @@
1
- export { resolveColorWithVariants } from './resolveColorWithVariants.js';
File without changes
File without changes
File without changes
File without changes