creactive 0.0.131 → 0.0.133

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,2 @@
1
+ export { Text } from './text';
2
+ export type { TextComponent, TextProperties, TextReference } from './text';
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Supported text color constants.
3
+ * Part of theme colors, suitable for text coloring.
4
+ * Transparent extra color constant is also included.
5
+ * @see Text.Color
6
+ */
7
+ export declare enum TextColor {
8
+ BASE_100 = 0,
9
+ BASE_200 = 1,
10
+ BASE_300 = 2,
11
+ BASE_400 = 3,
12
+ BASE_500 = 4,
13
+ BASE_600 = 5,
14
+ BASE_700 = 6,
15
+ BASE_800 = 7,
16
+ BASE_900 = 8,
17
+ INVERSE_100 = 9,
18
+ INVERSE_200 = 10,
19
+ INVERSE_300 = 11,
20
+ INVERSE_400 = 12,
21
+ INVERSE_500 = 13,
22
+ INVERSE_600 = 14,
23
+ INVERSE_700 = 15,
24
+ INVERSE_800 = 16,
25
+ INVERSE_900 = 17,
26
+ FAILURE_100 = 18,
27
+ FAILURE_200 = 19,
28
+ FAILURE_300 = 20,
29
+ FAILURE_400 = 21,
30
+ FAILURE_500 = 22,
31
+ FAILURE_600 = 23,
32
+ FAILURE_700 = 24,
33
+ FAILURE_800 = 25,
34
+ FAILURE_900 = 26,
35
+ TRANSPARENT = 27
36
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Enumerated text font family style constants.
3
+ * Most theme colors, suitable for text component.
4
+ * @see Text.FontFamily
5
+ */
6
+ export declare enum TextFontFamily {
7
+ BASE = 0,
8
+ TYPOGRAPHIC = 1
9
+ }
10
+ /**
11
+ * Supported text font weight constants.
12
+ * All theme font weights used by text component.
13
+ * @see Text.FontWeight
14
+ */
15
+ export declare enum TextFontWeight {
16
+ THIN = 0,
17
+ EXTRA_LIGHT = 1,
18
+ LIGHT = 2,
19
+ REGULAR = 3,
20
+ MEDIUM = 4,
21
+ SEMIBOLD = 5,
22
+ BOLD = 6,
23
+ EXTRA_BOLD = 7,
24
+ BLACK = 8
25
+ }
26
+ /**
27
+ * Supported text font size constants.
28
+ * All theme font sizes used by text component.
29
+ * @see Text.FontSize
30
+ */
31
+ export declare enum TextFontSize {
32
+ X2S = 0,
33
+ XS = 1,
34
+ SM = 2,
35
+ MD = 3,
36
+ LG = 4,
37
+ XL = 5,
38
+ X2L = 6,
39
+ X3L = 7,
40
+ X4L = 8,
41
+ X5L = 9
42
+ }
@@ -0,0 +1,4 @@
1
+ export { TextColor } from './color';
2
+ export { TextFontFamily, TextFontSize, TextFontWeight } from './font';
3
+ export { TextTag } from './tag';
4
+ export { TextAlign, TextDecoration, TextLineHeight } from './text';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Enumerated text tag constants.
3
+ * Allows to control HTML tag to render.
4
+ * Makes no sense on native platforms.
5
+ * @see Text.Tag
6
+ */
7
+ export declare enum TextTag {
8
+ H1 = 0,
9
+ H2 = 1,
10
+ H3 = 2,
11
+ H4 = 3,
12
+ H5 = 4,
13
+ H6 = 5,
14
+ P = 6,
15
+ SPAN = 7
16
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Supported text alignment constants.
3
+ * Controls horizontal text alignment within container.
4
+ * @see Text.TextAlign
5
+ */
6
+ export declare enum TextAlign {
7
+ LEFT = 0,
8
+ CENTER = 1,
9
+ RIGHT = 2
10
+ }
11
+ /**
12
+ * Supported text decoration constants.
13
+ * Controls text styling effects like underlines.
14
+ * @see Text.TextDecoration
15
+ */
16
+ export declare enum TextDecoration {
17
+ NONE = 0,
18
+ UNDERLINE = 1
19
+ }
20
+ /**
21
+ * Supported text line height constants.
22
+ * Controls themed vertical spacing between text lines.
23
+ * @see Text.LineHeight
24
+ */
25
+ export declare enum TextLineHeight {
26
+ NONE = 0,
27
+ TIGHT = 1,
28
+ SNUG = 2,
29
+ NORMAL = 3,
30
+ RELAXED = 4,
31
+ LOOSE = 5
32
+ }
@@ -0,0 +1,3 @@
1
+ import type { TextComponent, TextProperties, TextReference } from './text.types';
2
+ export declare const Text: TextComponent;
3
+ export type { TextComponent, TextProperties, TextReference };
@@ -0,0 +1,111 @@
1
+ import type { Fraction } from '../../../helpers';
2
+ import type { Color, FontWeight } from '../../../types';
3
+ import type { ForwardRefExoticComponent, PropsWithChildren, PropsWithoutRef, RefAttributes } from 'react';
4
+ import type { TextAlign, TextColor, TextDecoration, TextFontFamily, TextFontSize, TextFontWeight, TextLineHeight, TextTag } from './constants';
5
+ /**
6
+ * Provided by component reference object measure callback.
7
+ * Allows to access component layout element position and size.
8
+ * TODO: Comment arguments...
9
+ */
10
+ export type TextMeasureCallback = (x: number, y: number, width: number, height: number) => void;
11
+ /**
12
+ * Text component reference object.
13
+ * Allows to access text measurement method.
14
+ */
15
+ export interface TextReference {
16
+ measure(callback: TextMeasureCallback): void;
17
+ }
18
+ export interface TextProperties extends PropsWithChildren {
19
+ /**
20
+ * Allows to select text component in tests.
21
+ * @default undefined
22
+ */
23
+ testId?: string;
24
+ /**
25
+ * Allows to control HTML tag to render.
26
+ * Makes no sense on native platforms.
27
+ * @see Text.Tag
28
+ * @default undefined - renders into SPAN element
29
+ */
30
+ tag?: TextTag;
31
+ /**
32
+ * Inner text will be aligned according to this value.
33
+ * @see Text.Align
34
+ * @default Text.Align.LEFT
35
+ */
36
+ textAlign?: TextAlign;
37
+ /**
38
+ * Text decoration.
39
+ * @see Text.Decoration
40
+ * @default Text.Decoration.NONE
41
+ */
42
+ textDecoration?: TextDecoration;
43
+ /**
44
+ * Themed font family.
45
+ * @see Text.FontFamily
46
+ * @default Text.FontFamily.BASE
47
+ */
48
+ fontFamily?: TextFontFamily;
49
+ /**
50
+ * Themed font weight.
51
+ * @see Text.FontWeight
52
+ * @default Text.FontWeight.REGULAR
53
+ */
54
+ fontWeight?: TextFontWeight;
55
+ /**
56
+ * Themed font size.
57
+ * @see Text.FontSize
58
+ * @default Text.FontSize.MD
59
+ */
60
+ fontSize?: TextFontSize;
61
+ /**
62
+ * Themed line heidht.
63
+ * @see Text.LineHeight
64
+ * @default Text.LineHeight.NORMAL
65
+ */
66
+ lineHeight?: TextLineHeight;
67
+ /**
68
+ * Maximum number of lines to display.
69
+ * @default undefined
70
+ */
71
+ maxLines?: number;
72
+ /**
73
+ * Themed or transparent color.
74
+ * @see Text.Color
75
+ * @default Text.Color.BASE_800
76
+ */
77
+ color?: TextColor;
78
+ /**
79
+ * Text opacity.
80
+ * @see Fraction
81
+ * @default undefined
82
+ */
83
+ opacity?: Fraction;
84
+ }
85
+ export type TextComponent = ForwardRefExoticComponent<PropsWithoutRef<TextProperties> & RefAttributes<TextReference>> & {
86
+ Tag: Record<keyof typeof TextTag, TextTag>;
87
+ TextAlign: Record<keyof typeof TextAlign, TextAlign>;
88
+ TextDecoration: Record<keyof typeof TextDecoration, TextDecoration>;
89
+ FontFamily: Record<keyof typeof TextFontFamily, TextFontFamily>;
90
+ FontWeight: Record<keyof typeof TextFontWeight, TextFontWeight>;
91
+ FontSize: Record<keyof typeof TextFontSize, TextFontSize>;
92
+ LineHeight: Record<keyof typeof TextLineHeight, TextLineHeight>;
93
+ Color: Record<keyof typeof TextColor, TextColor>;
94
+ };
95
+ /**
96
+ * Styled text properties type.
97
+ * Used to render text component on web.
98
+ */
99
+ export type TextStyledProperties = {
100
+ css: {
101
+ textAlign: 'left' | 'center' | 'right';
102
+ textDecoration: 'none' | 'underline';
103
+ fontFamily: string;
104
+ fontWeight: FontWeight;
105
+ fontSize: number;
106
+ lineHeight: number;
107
+ maxLines: number;
108
+ color: Color;
109
+ opacity?: number;
110
+ };
111
+ };
@@ -0,0 +1,8 @@
1
+ export { Gradient } from '../components/gradient';
2
+ export type { GradientLinearComponent, GradientLinearProps, GradientObject, GradientStopComponent, GradientStopProps, } from '../components/gradient';
3
+ export { Overlay } from '../components/overlay';
4
+ export type { OverlayComponent, OverlayProps } from '../components/overlay';
5
+ export { View } from '../components/view';
6
+ export type { ViewComponent, ViewLayoutEvent, ViewProps, } from '../components/view';
7
+ export { Text } from './atoms';
8
+ export type { TextComponent, TextProperties, TextReference } from './atoms';
@@ -1,3 +1,3 @@
1
- import type { TextComponent, TextProps } from './text.types';
1
+ import type { TextComponent, TextProps, TextRef } from './text.types';
2
2
  export declare const Text: TextComponent;
3
- export type { TextComponent, TextProps };
3
+ export type { TextComponent, TextProps, TextRef };
@@ -1,7 +1,15 @@
1
1
  import type { Fraction } from '../../helpers';
2
2
  import type { Color, FontWeight } from '../../types';
3
- import type { FunctionComponent, PropsWithChildren } from 'react';
3
+ import type { ForwardRefExoticComponent, PropsWithChildren, PropsWithoutRef, RefAttributes } from 'react';
4
4
  import type { TextAlign, TextColor, TextDecoration, TextFontFamily, TextFontSize, TextFontWeight, TextLineHeight, TextTag } from './constants';
5
+ export type TextMeasureCallback = (x: number, y: number, width: number, height: number) => void;
6
+ /**
7
+ * Text component reference object.
8
+ * Allows to access text measurement method.
9
+ */
10
+ export interface TextRef {
11
+ measure(callback: TextMeasureCallback): void;
12
+ }
5
13
  export interface TextProps extends PropsWithChildren {
6
14
  /**
7
15
  * Allows to control HTML tag to render.
@@ -64,7 +72,7 @@ export interface TextProps extends PropsWithChildren {
64
72
  */
65
73
  opacity?: Fraction;
66
74
  }
67
- export type TextComponent = FunctionComponent<TextProps> & {
75
+ export type TextComponent = ForwardRefExoticComponent<PropsWithoutRef<TextProps> & RefAttributes<TextRef>> & {
68
76
  Tag: Record<keyof typeof TextTag, TextTag>;
69
77
  Align: Record<keyof typeof TextAlign, TextAlign>;
70
78
  Decoration: Record<keyof typeof TextDecoration, TextDecoration>;
@@ -25,30 +25,30 @@ export declare const COLOR_BORDER_BASE_600 = "rgb(218,218,234)";
25
25
  export declare const COLOR_BORDER_BASE_700 = "rgb(216,216,228)";
26
26
  export declare const COLOR_BORDER_BASE_800 = "rgb(212,212,216)";
27
27
  export declare const COLOR_BORDER_BASE_900 = "rgb(198,198,202)";
28
- export declare const COLOR_FOREGROUND_BASE_100 = "rgb(102,102,116)";
29
- export declare const COLOR_FOREGROUND_BASE_200 = "rgb(82,82,92)";
30
- export declare const COLOR_FOREGROUND_BASE_300 = "rgb(74,74,88)";
31
- export declare const COLOR_FOREGROUND_BASE_400 = "rgb(63,63,70)";
32
- export declare const COLOR_FOREGROUND_BASE_500 = "rgb(49,49,56)";
33
- export declare const COLOR_FOREGROUND_BASE_600 = "rgb(39,39,42)";
34
- export declare const COLOR_FOREGROUND_BASE_700 = "rgb(30,30,34)";
35
- export declare const COLOR_FOREGROUND_BASE_800 = "rgb(24,24,27)";
36
- export declare const COLOR_FOREGROUND_BASE_900 = "rgb(6,6,14)";
37
- export declare const COLOR_FOREGROUND_INVERSE_100 = "rgb(198,198,202)";
38
- export declare const COLOR_FOREGROUND_INVERSE_200 = "rgb(212,212,216)";
39
- export declare const COLOR_FOREGROUND_INVERSE_300 = "rgb(216,216,228)";
40
- export declare const COLOR_FOREGROUND_INVERSE_400 = "rgb(218,218,234)";
41
- export declare const COLOR_FOREGROUND_INVERSE_500 = "rgb(224,224,238)";
42
- export declare const COLOR_FOREGROUND_INVERSE_600 = "rgb(244,244,245)";
43
- export declare const COLOR_FOREGROUND_INVERSE_700 = "rgb(247,247,249)";
44
- export declare const COLOR_FOREGROUND_INVERSE_800 = "rgb(249,249,250)";
45
- export declare const COLOR_FOREGROUND_INVERSE_900 = "rgb(254,254,255)";
46
- export declare const COLOR_FOREGROUND_FAILURE_100 = "rgb(244,226,226)";
47
- export declare const COLOR_FOREGROUND_FAILURE_200 = "rgb(234,202,202)";
48
- export declare const COLOR_FOREGROUND_FAILURE_300 = "rgb(222,165,165)";
49
- export declare const COLOR_FOREGROUND_FAILURE_400 = "rgb(214,113,113)";
50
- export declare const COLOR_FOREGROUND_FAILURE_500 = "rgb(202,68,68)";
51
- export declare const COLOR_FOREGROUND_FAILURE_600 = "rgb(184,38,38)";
52
- export declare const COLOR_FOREGROUND_FAILURE_700 = "rgb(168,28,28)";
53
- export declare const COLOR_FOREGROUND_FAILURE_800 = "rgb(153,27,27)";
54
- export declare const COLOR_FOREGROUND_FAILURE_900 = "rgb(127,29,29)";
28
+ export declare const COLOR_FOREGROUND_BASE_100 = "rgb(200,200,205)";
29
+ export declare const COLOR_FOREGROUND_BASE_200 = "rgb(175,175,180)";
30
+ export declare const COLOR_FOREGROUND_BASE_300 = "rgb(150,150,155)";
31
+ export declare const COLOR_FOREGROUND_BASE_400 = "rgb(125,125,130)";
32
+ export declare const COLOR_FOREGROUND_BASE_500 = "rgb(100,100,105)";
33
+ export declare const COLOR_FOREGROUND_BASE_600 = "rgb(75,75,80)";
34
+ export declare const COLOR_FOREGROUND_BASE_700 = "rgb(50,50,55)";
35
+ export declare const COLOR_FOREGROUND_BASE_800 = "rgb(25,25,30)";
36
+ export declare const COLOR_FOREGROUND_BASE_900 = "rgb(0,0,5)";
37
+ export declare const COLOR_FOREGROUND_INVERSE_100 = "rgb(50,50,55)";
38
+ export declare const COLOR_FOREGROUND_INVERSE_200 = "rgb(75,75,80)";
39
+ export declare const COLOR_FOREGROUND_INVERSE_300 = "rgb(100,100,105)";
40
+ export declare const COLOR_FOREGROUND_INVERSE_400 = "rgb(125,125,130)";
41
+ export declare const COLOR_FOREGROUND_INVERSE_500 = "rgb(150,150,155)";
42
+ export declare const COLOR_FOREGROUND_INVERSE_600 = "rgb(175,175,180)";
43
+ export declare const COLOR_FOREGROUND_INVERSE_700 = "rgb(200,200,205)";
44
+ export declare const COLOR_FOREGROUND_INVERSE_800 = "rgb(225,225,230)";
45
+ export declare const COLOR_FOREGROUND_INVERSE_900 = "rgb(250,250,255)";
46
+ export declare const COLOR_FOREGROUND_FAILURE_100 = "rgb(225,200,200)";
47
+ export declare const COLOR_FOREGROUND_FAILURE_200 = "rgb(220,175,175)";
48
+ export declare const COLOR_FOREGROUND_FAILURE_300 = "rgb(215,150,150)";
49
+ export declare const COLOR_FOREGROUND_FAILURE_400 = "rgb(210,125,125)";
50
+ export declare const COLOR_FOREGROUND_FAILURE_500 = "rgb(205,100,100)";
51
+ export declare const COLOR_FOREGROUND_FAILURE_600 = "rgb(200,75,75)";
52
+ export declare const COLOR_FOREGROUND_FAILURE_700 = "rgb(195,50,50)";
53
+ export declare const COLOR_FOREGROUND_FAILURE_800 = "rgb(190,25,25)";
54
+ export declare const COLOR_FOREGROUND_FAILURE_900 = "rgb(185,0,0)";
@@ -144,137 +144,137 @@ export interface ThemeContextValue {
144
144
  colorBorderBase900: Color;
145
145
  /**
146
146
  * Least contrast base foreground color token.
147
- * @default rgb(102,102,116)
147
+ * @default rgb(200,200,205)
148
148
  */
149
149
  colorForegroundBase100: Color;
150
150
  /**
151
151
  * Dim base foreground color.
152
- * @default rgb(82,82,92)
152
+ * @default rgb(175,175,180)
153
153
  */
154
154
  colorForegroundBase200: Color;
155
155
  /**
156
156
  * Mix of dim and muted base foreground color.
157
- * @default rgb(74,74,88)
157
+ * @default rgb(150,150,155)
158
158
  */
159
159
  colorForegroundBase300: Color;
160
160
  /**
161
161
  * Muted base foreground color.
162
- * @default rgb(63,63,70)
162
+ * @default rgb(125,125,130)
163
163
  */
164
164
  colorForegroundBase400: Color;
165
165
  /**
166
166
  * Mix of muted and subtle base foreground color.
167
- * @default rgb(49,49,56)
167
+ * @default rgb(100,100,105)
168
168
  */
169
169
  colorForegroundBase500: Color;
170
170
  /**
171
171
  * Subtle base foreground color.
172
- * @default rgb(39,39,42)
172
+ * @default rgb(75,75,80)
173
173
  */
174
174
  colorForegroundBase600: Color;
175
175
  /**
176
176
  * Mix of subtle and default base foreground color.
177
- * @default rgb(30,30,34)
177
+ * @default rgb(50,50,55)
178
178
  */
179
179
  colorForegroundBase700: Color;
180
180
  /**
181
181
  * Base default foreground color.
182
- * @default rgb(24,24,27)
182
+ * @default rgb(25,25,30)
183
183
  */
184
184
  colorForegroundBase800: Color;
185
185
  /**
186
186
  * Most contrast base foreground color.
187
- * @default rgb(6,6,14)
187
+ * @default rgb(0,0,5)
188
188
  */
189
189
  colorForegroundBase900: Color;
190
190
  /**
191
191
  * Least contrast inverse foreground color.
192
- * @default rgb(198,198,202)
192
+ * @default rgb(50,50,55)
193
193
  */
194
194
  colorForegroundInverse100: Color;
195
195
  /**
196
196
  * Dim inverse foreground color.
197
- * @default rgb(212,212,216)
197
+ * @default rgb(75,75,80)
198
198
  */
199
199
  colorForegroundInverse200: Color;
200
200
  /**
201
201
  * Mix of dim and muted inverse foreground color.
202
- * @default rgb(216,216,228)
202
+ * @default rgb(100,100,105)
203
203
  */
204
204
  colorForegroundInverse300: Color;
205
205
  /**
206
206
  * Muted inverse foreground color.
207
- * @default rgb(218,218,234)
207
+ * @default rgb(125,125,130)
208
208
  */
209
209
  colorForegroundInverse400: Color;
210
210
  /**
211
211
  * Mix of muted and subtle inverse foreground color.
212
- * @default rgb(224,224,238)
212
+ * @default rgb(150,150,155)
213
213
  */
214
214
  colorForegroundInverse500: Color;
215
215
  /**
216
216
  * Subtle inverse foreground color.
217
- * @default rgb(244,244,245)
217
+ * @default rgb(175,175,180)
218
218
  */
219
219
  colorForegroundInverse600: Color;
220
220
  /**
221
221
  * Mix of subtle and default inverse foreground color.
222
- * @default rgb(247,247,249)
222
+ * @default rgb(200,200,205)
223
223
  */
224
224
  colorForegroundInverse700: Color;
225
225
  /**
226
226
  * Inverse default foreground color.
227
- * @default rgb(249,249,250)
227
+ * @default rgb(225,225,230)
228
228
  */
229
229
  colorForegroundInverse800: Color;
230
230
  /**
231
231
  * Most contrast inverse foreground color.
232
- * @default rgb(254,254,255)
232
+ * @default rgb(250,250,255)
233
233
  */
234
234
  colorForegroundInverse900: Color;
235
235
  /**
236
236
  * Least contrast failure foreground color.
237
- * @default rgb(254,226,226)
237
+ * @default rgb(225,200,200)
238
238
  */
239
239
  colorForegroundFailure100: Color;
240
240
  /**
241
241
  * Dim failure foreground color.
242
- * @default rgb(254,202,202)
242
+ * @default rgb(220,175,175)
243
243
  */
244
244
  colorForegroundFailure200: Color;
245
245
  /**
246
246
  * Mix of dim and muted failure foreground color.
247
- * @default rgb(252,165,165)
247
+ * @default rgb(215,150,150)
248
248
  */
249
249
  colorForegroundFailure300: Color;
250
250
  /**
251
251
  * Muted failure foreground color.
252
- * @default rgb(248,113,113)
252
+ * @default rgb(210,125,125)
253
253
  */
254
254
  colorForegroundFailure400: Color;
255
255
  /**
256
256
  * Mix of muted and subtle failure foreground color.
257
- * @default rgb(239,68,68)
257
+ * @default rgb(205,100,100)
258
258
  */
259
259
  colorForegroundFailure500: Color;
260
260
  /**
261
261
  * Subtle failure foreground color.
262
- * @default rgb(220,38,38)
262
+ * @default rgb(200,75,75)
263
263
  */
264
264
  colorForegroundFailure600: Color;
265
265
  /**
266
266
  * Mix of subtle and default failure foreground color.
267
- * @default rgb(185,28,28)
267
+ * @default rgb(195,50,50)
268
268
  */
269
269
  colorForegroundFailure700: Color;
270
270
  /**
271
271
  * Failure default foreground color.
272
- * @default rgb(153,27,27)
272
+ * @default rgb(190,25,25)
273
273
  */
274
274
  colorForegroundFailure800: Color;
275
275
  /**
276
276
  * Most contrast failure foreground color.
277
- * @default rgb(127,29,29)
277
+ * @default rgb(185,0,0)
278
278
  */
279
279
  colorForegroundFailure900: Color;
280
280
  /**