creactive 0.0.32 → 0.0.34

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.
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Supported text font weights enum.
3
+ * Should be used to control the weight of the text.
4
+ * This enum is not exported, use Text.FontWeight to access available types.
5
+ */
6
+ export declare enum TextFontWeight {
7
+ THIN = 0,
8
+ EXTRA_LIGHT = 1,
9
+ LIGHT = 2,
10
+ REGULAR = 3,
11
+ SEMIBOLD = 4,
12
+ BOLD = 5,
13
+ EXTRA_BOLD = 6,
14
+ BLACK = 7
15
+ }
16
+ /**
17
+ * Supported text font sizes enum.
18
+ * Should be used to control the size of the text.
19
+ * This enum is not exported, use Text.FontSize to access available types.
20
+ */
21
+ export declare enum TextFontSize {
22
+ X2S = 0,
23
+ XS = 1,
24
+ SM = 2,
25
+ MD = 3,
26
+ LG = 4,
27
+ XL = 5,
28
+ X2L = 6,
29
+ X3L = 7,
30
+ X4L = 8,
31
+ X5L = 9
32
+ }
@@ -1,2 +1,3 @@
1
- export * from './role';
2
- export * from './type';
1
+ export { TextFontSize, TextFontWeight } from './font';
2
+ export { TextRole } from './role';
3
+ export { TEXT_TYPE_HEADING, TextType } from './type';
@@ -1,7 +1,26 @@
1
+ import type { ThemeFontWeight } from '../../contexts';
1
2
  import type { FunctionComponent, PropsWithChildren } from 'react';
2
- import type { TextType } from './constants';
3
+ import type { TextFontSize, TextFontWeight, TextType } from './constants';
3
4
  export type BaseStyleSheetParameters = {
4
5
  fontFamilyBase: string;
6
+ fontWeightBaseThin: ThemeFontWeight;
7
+ fontWeightBaseExtraLight: ThemeFontWeight;
8
+ fontWeightBaseLight: ThemeFontWeight;
9
+ fontWeightBaseRegular: ThemeFontWeight;
10
+ fontWeightBaseSemibold: ThemeFontWeight;
11
+ fontWeightBaseBold: ThemeFontWeight;
12
+ fontWeightBaseExtraBold: ThemeFontWeight;
13
+ fontWeightBaseBlack: ThemeFontWeight;
14
+ fontSizeBaseX2S: number;
15
+ fontSizeBaseXS: number;
16
+ fontSizeBaseSM: number;
17
+ fontSizeBaseMD: number;
18
+ fontSizeBaseLG: number;
19
+ fontSizeBaseXL: number;
20
+ fontSizeBaseX2L: number;
21
+ fontSizeBaseX3L: number;
22
+ fontSizeBaseX4L: number;
23
+ fontSizeBaseX5L: number;
5
24
  };
6
25
  export interface TextProps extends PropsWithChildren {
7
26
  /**
@@ -10,7 +29,21 @@ export interface TextProps extends PropsWithChildren {
10
29
  * To access types use Text.Type instead of trying to import TexType.
11
30
  */
12
31
  type?: TextType;
32
+ /**
33
+ * Specific text font weight if required.
34
+ * Will change text weight, depending on configured theme.
35
+ * Component maps font weight into matching theme base font weight value.
36
+ */
37
+ fontWeight?: TextFontWeight;
38
+ /**
39
+ * Specific text size if required.
40
+ * Will change text size, depending on configured theme.
41
+ * Component maps font size into matching theme base font size value.
42
+ */
43
+ fontSize?: TextFontSize;
13
44
  }
14
45
  export type TextComponent = FunctionComponent<TextProps> & {
15
46
  Type: Record<keyof typeof TextType, TextType>;
47
+ FontWeight: Record<keyof typeof TextFontWeight, TextFontWeight>;
48
+ FontSize: Record<keyof typeof TextFontSize, TextFontSize>;
16
49
  };
@@ -1 +1 @@
1
- export { FONT_FAMILY_BASE } from '../constants/theme';
1
+ export { FONT_FAMILY_BASE, FONT_SIZE_BASE_LG, FONT_SIZE_BASE_MD, FONT_SIZE_BASE_SM, FONT_SIZE_BASE_X2L, FONT_SIZE_BASE_X2S, FONT_SIZE_BASE_X3L, FONT_SIZE_BASE_X4L, FONT_SIZE_BASE_X5L, FONT_SIZE_BASE_XL, FONT_SIZE_BASE_XS, FONT_WEIGHT_BASE_BLACK, FONT_WEIGHT_BASE_BOLD, FONT_WEIGHT_BASE_EXTRABOLD, FONT_WEIGHT_BASE_EXTRALIGHT, FONT_WEIGHT_BASE_LIGHT, FONT_WEIGHT_BASE_REGULAR, FONT_WEIGHT_BASE_SEMIBOLD, FONT_WEIGHT_BASE_THIN, } from '../constants/theme';
@@ -4,3 +4,33 @@
4
4
  * Maybe we'll need som extra font family in future..
5
5
  */
6
6
  export declare const FONT_FAMILY_BASE: string;
7
+ /**
8
+ * Base font weight constants.
9
+ * Supposed to be used for styling text.
10
+ * It seems like we wont need an extra set of font weights.
11
+ * But we named them as base just in case, you know..
12
+ */
13
+ export declare const FONT_WEIGHT_BASE_THIN = 100;
14
+ export declare const FONT_WEIGHT_BASE_EXTRALIGHT = 200;
15
+ export declare const FONT_WEIGHT_BASE_LIGHT = 300;
16
+ export declare const FONT_WEIGHT_BASE_REGULAR = 400;
17
+ export declare const FONT_WEIGHT_BASE_SEMIBOLD = 600;
18
+ export declare const FONT_WEIGHT_BASE_BOLD = 700;
19
+ export declare const FONT_WEIGHT_BASE_EXTRABOLD = 800;
20
+ export declare const FONT_WEIGHT_BASE_BLACK = 900;
21
+ /**
22
+ * Base font size constants.
23
+ * Supposed to be used for styling text.
24
+ * It seems like we wont need an extra set of font sizes.
25
+ * But we named them as base just in case also..
26
+ */
27
+ export declare const FONT_SIZE_BASE_X2S = 12;
28
+ export declare const FONT_SIZE_BASE_XS = 14;
29
+ export declare const FONT_SIZE_BASE_SM = 16;
30
+ export declare const FONT_SIZE_BASE_MD = 18;
31
+ export declare const FONT_SIZE_BASE_LG = 20;
32
+ export declare const FONT_SIZE_BASE_XL = 24;
33
+ export declare const FONT_SIZE_BASE_X2L = 30;
34
+ export declare const FONT_SIZE_BASE_X3L = 36;
35
+ export declare const FONT_SIZE_BASE_X4L = 48;
36
+ export declare const FONT_SIZE_BASE_X5L = 60;
@@ -1 +1 @@
1
- export { FONT_FAMILY_BASE } from './font';
1
+ export { FONT_FAMILY_BASE, FONT_SIZE_BASE_LG, FONT_SIZE_BASE_MD, FONT_SIZE_BASE_SM, FONT_SIZE_BASE_X2L, FONT_SIZE_BASE_X2S, FONT_SIZE_BASE_X3L, FONT_SIZE_BASE_X4L, FONT_SIZE_BASE_X5L, FONT_SIZE_BASE_XL, FONT_SIZE_BASE_XS, FONT_WEIGHT_BASE_BLACK, FONT_WEIGHT_BASE_BOLD, FONT_WEIGHT_BASE_EXTRABOLD, FONT_WEIGHT_BASE_EXTRALIGHT, FONT_WEIGHT_BASE_LIGHT, FONT_WEIGHT_BASE_REGULAR, FONT_WEIGHT_BASE_SEMIBOLD, FONT_WEIGHT_BASE_THIN, } from './font';
@@ -1,2 +1,2 @@
1
1
  export { ThemeContextProvider, useThemeContext } from '../contexts/theme';
2
- export type { ThemeContextProviderComponent, ThemeContextProviderProps, ThemeContextValue, } from '../contexts/theme';
2
+ export type { ThemeContextProviderComponent, ThemeContextProviderProps, ThemeContextValue, ThemeFontWeight, } from '../contexts/theme';
@@ -1,2 +1,2 @@
1
1
  export { ThemeContextProvider, useThemeContext } from './theme';
2
- export type { ThemeContextProviderComponent, ThemeContextProviderProps, ThemeContextValue, } from './theme.types';
2
+ export type { ThemeContextProviderComponent, ThemeContextProviderProps, ThemeContextValue, ThemeFontWeight, } from './theme.types';
@@ -1,4 +1,9 @@
1
1
  import type { FunctionComponent, PropsWithChildren } from 'react';
2
+ /**
3
+ * Theme font weight type.
4
+ * Should be used to specify theme font weight.
5
+ */
6
+ export type ThemeFontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
2
7
  /**
3
8
  * Theme context value interface.
4
9
  * Contains all theme tokens you may need.
@@ -7,6 +12,24 @@ import type { FunctionComponent, PropsWithChildren } from 'react';
7
12
  */
8
13
  export interface ThemeContextValue {
9
14
  fontFamilyBase: string;
15
+ fontWeightBaseThin: ThemeFontWeight;
16
+ fontWeightBaseExtraLight: ThemeFontWeight;
17
+ fontWeightBaseLight: ThemeFontWeight;
18
+ fontWeightBaseRegular: ThemeFontWeight;
19
+ fontWeightBaseSemibold: ThemeFontWeight;
20
+ fontWeightBaseBold: ThemeFontWeight;
21
+ fontWeightBaseExtraBold: ThemeFontWeight;
22
+ fontWeightBaseBlack: ThemeFontWeight;
23
+ fontSizeBaseX2S: number;
24
+ fontSizeBaseXS: number;
25
+ fontSizeBaseSM: number;
26
+ fontSizeBaseMD: number;
27
+ fontSizeBaseLG: number;
28
+ fontSizeBaseXL: number;
29
+ fontSizeBaseX2L: number;
30
+ fontSizeBaseX3L: number;
31
+ fontSizeBaseX4L: number;
32
+ fontSizeBaseX5L: number;
10
33
  }
11
34
  export type ThemeContextProviderProps = PropsWithChildren<Partial<ThemeContextValue>>;
12
35
  export type ThemeContextProviderComponent = FunctionComponent<ThemeContextProviderProps>;
@@ -6,6 +6,6 @@ export { Text } from './components/text';
6
6
  export type { TextComponent, TextProps } from './components/text';
7
7
  export { FONT_FAMILY_BASE } from './constants/theme';
8
8
  export { ThemeContextProvider, useThemeContext } from './contexts/theme';
9
- export type { ThemeContextProviderComponent, ThemeContextProviderProps, ThemeContextValue, } from './contexts/theme';
9
+ export type { ThemeContextProviderComponent, ThemeContextProviderProps, ThemeContextValue, ThemeFontWeight, } from './contexts/theme';
10
10
  export { renderStyle } from './helpers/style';
11
11
  export type { RenderStyleHelper } from './helpers/style';