@kwantis-id3/frontend-library 0.14.1 → 0.15.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.
@@ -24,8 +24,8 @@ type ThemeProperties = {
24
24
  colors: ThemeColorsObject;
25
25
  /**
26
26
  *
27
- * @param color one of the theme keys OR a string representing a color (hex, rgb, hsl, etc)
28
- * @returns a valid color object. If color is not valid, will return the primary color
27
+ * @param color one of the theme keys, a path to a specific color in the theme, OR a string representing a color (hex, rgb, hsl, etc)
28
+ * @returns a valid color object. If color is not valid, will return the primary color.
29
29
  */
30
30
  getColor: (color: ThemeColorsExtended) => Color;
31
31
  };
@@ -62,5 +62,17 @@ export declare const defaultThemeColors: {
62
62
  export declare const ThemeContextProvider: (props: React.PropsWithChildren<{
63
63
  theme?: ThemeContextProps;
64
64
  }>) => JSX.Element;
65
+ type NestedObject<T> = {
66
+ [key: string]: T | NestedObject<T>;
67
+ };
68
+ /**
69
+ * Returns the value of a nested object given a string path
70
+ * This function is supposed to be used ONLY to retrieve values from the theme object
71
+ *
72
+ * @param object the object to search
73
+ * @param path a string representing the path to the value
74
+ * @returns the value of the nested object
75
+ */
76
+ export declare function getObjectValueByPath<T>(obj: NestedObject<T>, path: string): T | undefined;
65
77
  export declare const useThemeContext: () => ThemeProperties;
66
78
  export {};
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { PropsOf } from '@emotion/react';
3
- import { CreateStyledComponent, StyledOptions, FilteringStyledOptions } from '@emotion/styled';
4
- import { ThemeContextProps } from '../components';
2
+ import { PropsOf } from "@emotion/react";
3
+ import { CreateStyledComponent, StyledOptions, FilteringStyledOptions } from "@emotion/styled";
4
+ import { ThemeContextProps } from "../components";
5
5
  export type StyledTags = {
6
6
  [Tag in keyof JSX.IntrinsicElements]: CreateStyledComponent<{
7
7
  theme?: ThemeContextProps;
package/dist/index.d.ts CHANGED
@@ -30,8 +30,8 @@ type ThemeProperties = {
30
30
  colors: ThemeColorsObject;
31
31
  /**
32
32
  *
33
- * @param color one of the theme keys OR a string representing a color (hex, rgb, hsl, etc)
34
- * @returns a valid color object. If color is not valid, will return the primary color
33
+ * @param color one of the theme keys, a path to a specific color in the theme, OR a string representing a color (hex, rgb, hsl, etc)
34
+ * @returns a valid color object. If color is not valid, will return the primary color.
35
35
  */
36
36
  getColor: (color: ThemeColorsExtended) => Color;
37
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwantis-id3/frontend-library",
3
- "version": "0.14.1",
3
+ "version": "0.15.0",
4
4
  "description": "Kwantis frontend components collection",
5
5
  "author": {
6
6
  "name": "kwantis"