@lumx/core 3.20.1-alpha.47 → 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.
@@ -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}`;
@@ -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;
@@ -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
  *
@@ -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
 
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.47",
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",