@lumx/core 3.20.1-alpha.46 → 3.20.1-alpha.48

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 (25) hide show
  1. package/_internal/DPnPEC08.js +9 -0
  2. package/js/constants/_internal/design-tokens.d.ts +5421 -0
  3. package/js/types/KebabCase.d.ts +1 -1
  4. package/js/utils/_internal/color/resolveColorWithVariants.d.ts +1 -1
  5. package/js/utils/{className → classNames}/color/index.d.ts +5 -5
  6. package/js/utils/{className → classNames}/color/index.js +4 -4
  7. package/js/utils/{className → classNames}/index.d.ts +1 -0
  8. package/js/utils/{className → classNames}/index.js +1 -0
  9. package/js/utils/{className → classNames}/typography/index.d.ts +1 -1
  10. package/js/utils/{className → classNames}/typography/index.js +0 -2
  11. package/js/utils/index.d.ts +1 -1
  12. package/js/utils/index.js +2 -2
  13. package/package.json +1 -1
  14. /package/js/utils/{className → classNames}/bem/block.d.ts +0 -0
  15. /package/js/utils/{className → classNames}/bem/block.js +0 -0
  16. /package/js/utils/{className → classNames}/bem/element.d.ts +0 -0
  17. /package/js/utils/{className → classNames}/bem/element.js +0 -0
  18. /package/js/utils/{className → classNames}/bem/generateBEMClass.d.ts +0 -0
  19. /package/js/utils/{className → classNames}/bem/generateBEMClass.js +0 -0
  20. /package/js/utils/{className → classNames}/bem/index.d.ts +0 -0
  21. /package/js/utils/{className → classNames}/bem/index.js +0 -0
  22. /package/js/utils/{className → classNames}/spacing/index.d.ts +0 -0
  23. /package/js/utils/{className → classNames}/spacing/index.js +0 -0
  24. /package/js/utils/{className → classNames}/visually-hidden/index.d.ts +0 -0
  25. /package/js/utils/{className → classNames}/visually-hidden/index.js +0 -0
@@ -1,2 +1,2 @@
1
1
  /** Transform a string literal into kebab case */
2
- export type KebabCase<S> = S extends `${infer C}${infer T}` ? T extends Uncapitalize<T> ? `${Uncapitalize<C>}${KebabCase<T>}` : `${Uncapitalize<C>}-${KebabCase<T>}` : S;
2
+ export type KebabCase<S extends string | number> = S extends `${infer C}${infer T}` ? T extends Uncapitalize<T> ? `${Uncapitalize<C>}${KebabCase<T>}` : `${Uncapitalize<C>}-${KebabCase<T>}` : `${S}`;
@@ -1,3 +1,3 @@
1
- import type { ColorPalette, ColorVariant, ColorWithVariants } from '../../../constants';
1
+ import type { ColorPalette, ColorVariant, ColorWithVariants } from '@lumx/core/js/constants';
2
2
  /** Resolve color & color variant from a `ColorWithVariants` and optionally a `ColorVariant`. */
3
3
  export declare function resolveColorWithVariants(colorWithVariants?: ColorWithVariants, colorVariant?: ColorVariant): [color?: ColorPalette, colorVariant?: ColorVariant];
@@ -14,19 +14,19 @@ import { ColorVariant, ColorWithVariants } from '@lumx/core/js/constants';
14
14
  * color('font', 'primary-L2'); // 'lumx-color-font-primary-L2'
15
15
  * color('font', undefined); // undefined
16
16
  */
17
- export declare function color(type: 'font' | 'background', propColor?: ColorWithVariants, propColorVariant?: ColorVariant): string | undefined;
17
+ export declare function color(type: 'font' | 'background', propColor: ColorWithVariants, propColorVariant?: ColorVariant): string | undefined;
18
18
  /**
19
19
  * Generates a Lumx background color class name for the given color and variant.
20
20
  *
21
- * @param col - The color palette name (e.g., 'primary', 'dark', 'light')
22
- * @param variant - The color variant (e.g., 'L1', 'L2', 'D1', 'N')
21
+ * @param propColor - The color palette name (e.g., 'primary', 'dark', 'light')
22
+ * @param propColorVariant - The color variant (e.g., 'L1', 'L2', 'D1', 'N')
23
23
  * @returns The Lumx background color class name
24
24
  *
25
25
  * @example
26
26
  * background('dark', 'L2'); // 'lumx-color-background-dark-L2'
27
27
  * background('primary', 'N'); // 'lumx-color-background-primary-N'
28
28
  */
29
- export declare const background: (col?: ColorWithVariants, variant?: ColorVariant) => string | undefined;
29
+ export declare const background: (propColor: ColorWithVariants, propColorVariant?: ColorVariant) => string | undefined;
30
30
  /**
31
31
  * Generates a Lumx font color class name for the given color and variant.
32
32
  *
@@ -40,4 +40,4 @@ export declare const background: (col?: ColorWithVariants, variant?: ColorVarian
40
40
  * font('primary'); // 'lumx-color-font-primary-N'
41
41
  * font(undefined); // undefined
42
42
  */
43
- export declare const font: (propColor?: ColorWithVariants, propColorVariant?: ColorVariant) => string | undefined;
43
+ export declare const font: (propColor: ColorWithVariants, propColorVariant?: ColorVariant) => string | undefined;
@@ -1,5 +1,5 @@
1
1
  import { ColorVariant } from '../../../constants/enums/index.js';
2
- import { resolveColorWithVariants } from '@lumx/core/js/utils/_internal/color';
2
+ import { resolveColorWithVariants } from '../../../../_internal/DPnPEC08.js';
3
3
 
4
4
  /**
5
5
  * Generates a Lumx color class name for the given type, color and variant.
@@ -25,15 +25,15 @@ function color(type, propColor, propColorVariant) {
25
25
  /**
26
26
  * Generates a Lumx background color class name for the given color and variant.
27
27
  *
28
- * @param col - The color palette name (e.g., 'primary', 'dark', 'light')
29
- * @param variant - The color variant (e.g., 'L1', 'L2', 'D1', 'N')
28
+ * @param propColor - The color palette name (e.g., 'primary', 'dark', 'light')
29
+ * @param propColorVariant - The color variant (e.g., 'L1', 'L2', 'D1', 'N')
30
30
  * @returns The Lumx background color class name
31
31
  *
32
32
  * @example
33
33
  * background('dark', 'L2'); // 'lumx-color-background-dark-L2'
34
34
  * background('primary', 'N'); // 'lumx-color-background-primary-N'
35
35
  */
36
- const background = (col, variant) => color('background', col, variant);
36
+ const background = (propColor, propColorVariant) => color('background', propColor, propColorVariant);
37
37
  /**
38
38
  * Generates a Lumx font color class name for the given color and variant.
39
39
  *
@@ -1,3 +1,4 @@
1
+ export { default as join } from 'classnames';
1
2
  export * from './color';
2
3
  export * from './typography';
3
4
  export * from './spacing';
@@ -1,3 +1,4 @@
1
+ export { default as join } from 'classnames';
1
2
  export { background, color, font } from './color/index.js';
2
3
  export { typography } from './typography/index.js';
3
4
  export { margin, margins, padding, paddings, spacing, spacings } from './spacing/index.js';
@@ -3,4 +3,4 @@ import type { Typography } from '@lumx/core/js/constants';
3
3
  * Returns the classname associated to the given typography. For example, for Typography.title it returns
4
4
  * lumx-typography-title
5
5
  */
6
- export declare function typography(typo?: Typography): string | undefined;
6
+ export declare function typography(typo: Typography): string;
@@ -3,8 +3,6 @@
3
3
  * lumx-typography-title
4
4
  */
5
5
  function typography(typo) {
6
- if (!typo)
7
- return undefined;
8
6
  return `lumx-typography-${typo}`;
9
7
  }
10
8
 
@@ -1,2 +1,2 @@
1
- export * as cls from './className';
1
+ export * as classNames from './classNames';
2
2
  export * from './events';
package/js/utils/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import * as index from './className/index.js';
2
- export { index as cls };
1
+ import * as index from './classNames/index.js';
2
+ export { index as classNames };
3
3
  export { onButtonPressed, onEnterPressed, onEscapePressed } from './events/keyboard.js';
4
4
  export { detectHorizontalSwipe } from './events/swipe.js';
package/package.json CHANGED
@@ -35,7 +35,7 @@
35
35
  "update-version-changelog": "yarn version-changelog ../../CHANGELOG.md"
36
36
  },
37
37
  "sideEffects": false,
38
- "version": "3.20.1-alpha.46",
38
+ "version": "3.20.1-alpha.48",
39
39
  "devDependencies": {
40
40
  "@rollup/plugin-typescript": "^12.3.0",
41
41
  "@types/react": "^17.0.2",
File without changes
File without changes