@utilitywarehouse/hearth-react-native 0.20.0 → 0.21.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.
- package/.storybook/manager.ts +1 -0
- package/.storybook/preview.tsx +1 -0
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +13 -13
- package/CHANGELOG.md +249 -0
- package/build/components/BodyText/BodyText.js +12 -5
- package/build/components/BodyText/BodyText.props.d.ts +5 -19
- package/build/components/Box/Box.js +23 -3
- package/build/components/Box/Box.props.d.ts +3 -95
- package/build/components/Card/Card.props.d.ts +2 -5
- package/build/components/Container/Container.props.d.ts +2 -78
- package/build/components/DateInput/DateInput.d.ts +1 -1
- package/build/components/DateInput/DateInput.js +2 -2
- package/build/components/DateInput/DateInput.props.d.ts +15 -1
- package/build/components/DateInput/DateInputSegment.d.ts +1 -1
- package/build/components/DateInput/DateInputSegment.js +2 -2
- package/build/components/DetailText/DetailText.js +14 -13
- package/build/components/DetailText/DetailText.props.d.ts +4 -17
- package/build/components/Flex/Flex.js +3 -1
- package/build/components/Flex/Flex.props.d.ts +2 -2
- package/build/components/Heading/Heading.js +34 -13
- package/build/components/Heading/Heading.props.d.ts +4 -18
- package/build/core/themes.d.ts +188 -8
- package/build/core/themes.js +18 -2
- package/build/hooks/useStyleProps.js +22 -5
- package/build/tokens/color.d.ts +4 -0
- package/build/tokens/color.js +2 -0
- package/build/tokens/components/dark/modal.d.ts +6 -0
- package/build/tokens/components/dark/modal.js +6 -0
- package/build/tokens/components/dark/navigation.d.ts +1 -0
- package/build/tokens/components/dark/navigation.js +1 -0
- package/build/tokens/components/light/modal.d.ts +6 -0
- package/build/tokens/components/light/modal.js +6 -0
- package/build/tokens/components/light/navigation.d.ts +1 -0
- package/build/tokens/components/light/navigation.js +1 -0
- package/build/tokens/components/light/skeleton.d.ts +1 -1
- package/build/tokens/components/light/skeleton.js +1 -1
- package/build/tokens/font.d.ts +2 -0
- package/build/tokens/font.js +2 -0
- package/build/tokens/line-height.d.ts +2 -0
- package/build/tokens/line-height.js +2 -0
- package/build/tokens/primitive.d.ts +4 -0
- package/build/tokens/primitive.js +4 -0
- package/build/tokens/semantic-dark.d.ts +1 -0
- package/build/tokens/semantic-dark.js +1 -0
- package/build/tokens/semantic-light.d.ts +1 -0
- package/build/tokens/semantic-light.js +1 -0
- package/build/tokens/typography.d.ts +30 -0
- package/build/tokens/typography.js +15 -0
- package/build/types/index.d.ts +4 -2
- package/build/types/index.js +4 -2
- package/build/types/semanticColorValues.d.ts +22 -0
- package/build/types/semanticColorValues.js +1 -0
- package/build/types/utilityProps.d.ts +326 -0
- package/build/types/utilityProps.js +1 -0
- package/build/types/values.d.ts +4 -3
- package/build/utils/coloursAsArray.d.ts +4 -0
- package/build/utils/coloursAsArray.js +5 -0
- package/build/utils/index.d.ts +1 -1
- package/build/utils/index.js +1 -1
- package/build/utils/styleUtils.d.ts +26 -2
- package/build/utils/styleUtils.js +42 -13
- package/build/utils/themeValueHelpers.d.ts +13 -0
- package/build/utils/themeValueHelpers.js +29 -0
- package/docs/changelog.mdx +74 -2
- package/docs/components/AllComponents.web.tsx +23 -24
- package/docs/components/UsageWrap.tsx +2 -2
- package/docs/introduction.mdx +0 -7
- package/package.json +5 -3
- package/src/components/BodyText/BodyText.props.ts +5 -19
- package/src/components/BodyText/BodyText.stories.tsx +2 -1
- package/src/components/BodyText/BodyText.tsx +17 -6
- package/src/components/Box/Box.docs.mdx +5 -4
- package/src/components/Box/Box.props.ts +3 -231
- package/src/components/Box/Box.stories.tsx +2 -2
- package/src/components/Box/Box.tsx +38 -9
- package/src/components/Button/Button.docs.mdx +46 -1
- package/src/components/Card/Card.docs.mdx +1 -1
- package/src/components/Card/Card.props.ts +2 -5
- package/src/components/Card/Card.stories.tsx +54 -23
- package/src/components/Carousel/Carousel.docs.mdx +49 -44
- package/src/components/Center/Center.docs.mdx +6 -4
- package/src/components/Container/Container.docs.mdx +13 -8
- package/src/components/Container/Container.props.ts +9 -80
- package/src/components/Container/Container.stories.tsx +81 -65
- package/src/components/DateInput/DateInput.docs.mdx +43 -0
- package/src/components/DateInput/DateInput.props.ts +15 -1
- package/src/components/DateInput/DateInput.stories.tsx +37 -2
- package/src/components/DateInput/DateInput.tsx +6 -0
- package/src/components/DateInput/DateInputSegment.tsx +2 -0
- package/src/components/DetailText/DetailText.props.ts +4 -17
- package/src/components/DetailText/DetailText.stories.tsx +2 -3
- package/src/components/DetailText/DetailText.tsx +16 -17
- package/src/components/Flex/Flex.props.ts +2 -2
- package/src/components/Flex/Flex.stories.tsx +1 -1
- package/src/components/Flex/Flex.tsx +4 -1
- package/src/components/Grid/Grid.docs.mdx +53 -49
- package/src/components/Heading/Heading.props.ts +4 -18
- package/src/components/Heading/Heading.stories.tsx +2 -1
- package/src/components/Heading/Heading.tsx +40 -18
- package/src/components/Toast/ToastItem.figma.tsx +1 -8
- package/src/core/themes.ts +19 -2
- package/src/hooks/useStyleProps.ts +40 -5
- package/src/tokens/color.ts +2 -0
- package/src/tokens/components/dark/modal.ts +6 -0
- package/src/tokens/components/dark/navigation.ts +1 -0
- package/src/tokens/components/light/modal.ts +6 -0
- package/src/tokens/components/light/navigation.ts +1 -0
- package/src/tokens/components/light/skeleton.ts +1 -1
- package/src/tokens/font.ts +2 -0
- package/src/tokens/line-height.ts +2 -0
- package/src/tokens/primitive.ts +4 -0
- package/src/tokens/semantic-dark.ts +1 -0
- package/src/tokens/semantic-light.ts +1 -0
- package/src/tokens/typography.ts +15 -0
- package/src/types/index.ts +4 -2
- package/src/types/semanticColorValues.ts +26 -0
- package/src/types/utilityProps.ts +410 -0
- package/src/types/values.ts +4 -7
- package/src/utils/coloursAsArray.ts +6 -0
- package/src/utils/index.ts +8 -1
- package/src/utils/styleUtils.ts +45 -14
- package/src/utils/themeValueHelpers.ts +38 -0
package/build/tokens/font.d.ts
CHANGED
package/build/tokens/font.js
CHANGED
|
@@ -32,7 +32,9 @@ declare const _default: {
|
|
|
32
32
|
readonly '400': 30;
|
|
33
33
|
readonly '500': 36;
|
|
34
34
|
readonly '550': 40;
|
|
35
|
+
readonly '575': 44;
|
|
35
36
|
readonly '600': 48;
|
|
37
|
+
readonly '650': 54;
|
|
36
38
|
readonly '700': 60;
|
|
37
39
|
readonly '800': 72;
|
|
38
40
|
readonly '900': 96;
|
|
@@ -77,7 +79,9 @@ declare const _default: {
|
|
|
77
79
|
readonly '800': 36;
|
|
78
80
|
readonly '900': 40;
|
|
79
81
|
readonly '950': 48;
|
|
82
|
+
readonly '975': 52;
|
|
80
83
|
readonly '1000': 56;
|
|
84
|
+
readonly '1050': 62;
|
|
81
85
|
readonly '1100': 72;
|
|
82
86
|
readonly '1200': 90;
|
|
83
87
|
};
|
|
@@ -32,7 +32,9 @@ export default {
|
|
|
32
32
|
'400': 30,
|
|
33
33
|
'500': 36,
|
|
34
34
|
'550': 40,
|
|
35
|
+
'575': 44,
|
|
35
36
|
'600': 48,
|
|
37
|
+
'650': 54,
|
|
36
38
|
'700': 60,
|
|
37
39
|
'800': 72,
|
|
38
40
|
'900': 96,
|
|
@@ -77,7 +79,9 @@ export default {
|
|
|
77
79
|
'800': 36,
|
|
78
80
|
'900': 40,
|
|
79
81
|
'950': 48,
|
|
82
|
+
'975': 52,
|
|
80
83
|
'1000': 56,
|
|
84
|
+
'1050': 62,
|
|
81
85
|
'1100': 72,
|
|
82
86
|
'1200': 90,
|
|
83
87
|
},
|
|
@@ -63,6 +63,11 @@ export declare const mobile: {
|
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
65
|
readonly heading: {
|
|
66
|
+
readonly '2xl': {
|
|
67
|
+
readonly fontSize: 44;
|
|
68
|
+
readonly fontWeight: 700;
|
|
69
|
+
readonly lineHeight: 52;
|
|
70
|
+
};
|
|
66
71
|
readonly fontFamily: "Comic Hams";
|
|
67
72
|
readonly lg: {
|
|
68
73
|
readonly fontSize: 24;
|
|
@@ -149,6 +154,11 @@ export declare const tablet: {
|
|
|
149
154
|
};
|
|
150
155
|
};
|
|
151
156
|
readonly heading: {
|
|
157
|
+
readonly '2xl': {
|
|
158
|
+
readonly fontSize: 44;
|
|
159
|
+
readonly fontWeight: 700;
|
|
160
|
+
readonly lineHeight: 52;
|
|
161
|
+
};
|
|
152
162
|
readonly fontFamily: "Comic Hams";
|
|
153
163
|
readonly lg: {
|
|
154
164
|
readonly fontSize: 24;
|
|
@@ -235,6 +245,11 @@ export declare const desktop: {
|
|
|
235
245
|
};
|
|
236
246
|
};
|
|
237
247
|
readonly heading: {
|
|
248
|
+
readonly '2xl': {
|
|
249
|
+
readonly fontSize: 54;
|
|
250
|
+
readonly fontWeight: 700;
|
|
251
|
+
readonly lineHeight: 62;
|
|
252
|
+
};
|
|
238
253
|
readonly fontFamily: "Comic Hams";
|
|
239
254
|
readonly lg: {
|
|
240
255
|
readonly fontSize: 30;
|
|
@@ -322,6 +337,11 @@ declare const typography: {
|
|
|
322
337
|
};
|
|
323
338
|
};
|
|
324
339
|
readonly heading: {
|
|
340
|
+
readonly '2xl': {
|
|
341
|
+
readonly fontSize: 44;
|
|
342
|
+
readonly fontWeight: 700;
|
|
343
|
+
readonly lineHeight: 52;
|
|
344
|
+
};
|
|
325
345
|
readonly fontFamily: "Comic Hams";
|
|
326
346
|
readonly lg: {
|
|
327
347
|
readonly fontSize: 24;
|
|
@@ -408,6 +428,11 @@ declare const typography: {
|
|
|
408
428
|
};
|
|
409
429
|
};
|
|
410
430
|
readonly heading: {
|
|
431
|
+
readonly '2xl': {
|
|
432
|
+
readonly fontSize: 44;
|
|
433
|
+
readonly fontWeight: 700;
|
|
434
|
+
readonly lineHeight: 52;
|
|
435
|
+
};
|
|
411
436
|
readonly fontFamily: "Comic Hams";
|
|
412
437
|
readonly lg: {
|
|
413
438
|
readonly fontSize: 24;
|
|
@@ -494,6 +519,11 @@ declare const typography: {
|
|
|
494
519
|
};
|
|
495
520
|
};
|
|
496
521
|
readonly heading: {
|
|
522
|
+
readonly '2xl': {
|
|
523
|
+
readonly fontSize: 54;
|
|
524
|
+
readonly fontWeight: 700;
|
|
525
|
+
readonly lineHeight: 62;
|
|
526
|
+
};
|
|
497
527
|
readonly fontFamily: "Comic Hams";
|
|
498
528
|
readonly lg: {
|
|
499
529
|
readonly fontSize: 30;
|
|
@@ -63,6 +63,11 @@ export const mobile = {
|
|
|
63
63
|
},
|
|
64
64
|
},
|
|
65
65
|
heading: {
|
|
66
|
+
'2xl': {
|
|
67
|
+
fontSize: 44,
|
|
68
|
+
fontWeight: 700,
|
|
69
|
+
lineHeight: 52,
|
|
70
|
+
},
|
|
66
71
|
fontFamily: 'Comic Hams',
|
|
67
72
|
lg: {
|
|
68
73
|
fontSize: 24,
|
|
@@ -149,6 +154,11 @@ export const tablet = {
|
|
|
149
154
|
},
|
|
150
155
|
},
|
|
151
156
|
heading: {
|
|
157
|
+
'2xl': {
|
|
158
|
+
fontSize: 44,
|
|
159
|
+
fontWeight: 700,
|
|
160
|
+
lineHeight: 52,
|
|
161
|
+
},
|
|
152
162
|
fontFamily: 'Comic Hams',
|
|
153
163
|
lg: {
|
|
154
164
|
fontSize: 24,
|
|
@@ -235,6 +245,11 @@ export const desktop = {
|
|
|
235
245
|
},
|
|
236
246
|
},
|
|
237
247
|
heading: {
|
|
248
|
+
'2xl': {
|
|
249
|
+
fontSize: 54,
|
|
250
|
+
fontWeight: 700,
|
|
251
|
+
lineHeight: 62,
|
|
252
|
+
},
|
|
238
253
|
fontFamily: 'Comic Hams',
|
|
239
254
|
lg: {
|
|
240
255
|
fontSize: 30,
|
package/build/types/index.d.ts
CHANGED
package/build/types/index.js
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type semanticLight from '../tokens/semantic-light';
|
|
2
|
+
/**
|
|
3
|
+
* Simplified background color values derived from the semantic token `background` keys.
|
|
4
|
+
* e.g., 'brand' | 'primary' | 'secondary'
|
|
5
|
+
*/
|
|
6
|
+
export type BackgroundColorValue = keyof typeof semanticLight.background;
|
|
7
|
+
/**
|
|
8
|
+
* Simplified border color values derived from the semantic token `border` keys.
|
|
9
|
+
* e.g., 'strong' | 'subtle'
|
|
10
|
+
*/
|
|
11
|
+
export type BorderColorValue = keyof typeof semanticLight.border;
|
|
12
|
+
/**
|
|
13
|
+
* Simplified text color values derived from the semantic token `text` keys.
|
|
14
|
+
* e.g., 'affirmative' | 'brand' | 'inverted' | 'primary' | 'secondary'
|
|
15
|
+
* Also accepts any raw color value or undefined.
|
|
16
|
+
*/
|
|
17
|
+
export type TextColorValue = keyof typeof semanticLight.text;
|
|
18
|
+
/**
|
|
19
|
+
* Simplified icon color values derived from the semantic token `icon` keys.
|
|
20
|
+
* e.g., 'inverted' | 'primary'
|
|
21
|
+
*/
|
|
22
|
+
export type IconColorValue = keyof typeof semanticLight.icon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import type { Ref } from 'react';
|
|
2
|
+
import type { TextProps as RNTextProps, Text, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
import type { BackgroundColorValue, BorderColorValue, IconColorValue, TextColorValue } from './semanticColorValues';
|
|
4
|
+
import type { BorderRadiusValue, BorderWidthValue, ColorValue, OpacityValue, RawColorValue, SpaceValue } from './values';
|
|
5
|
+
export interface MarginProps {
|
|
6
|
+
/** Margin on all sides. Accepts theme space tokens or raw values. */
|
|
7
|
+
margin?: SpaceValue;
|
|
8
|
+
/** Horizontal margin (left and right). */
|
|
9
|
+
marginHorizontal?: SpaceValue;
|
|
10
|
+
/** Vertical margin (top and bottom). */
|
|
11
|
+
marginVertical?: SpaceValue;
|
|
12
|
+
/** Top margin. */
|
|
13
|
+
marginTop?: SpaceValue;
|
|
14
|
+
/** Bottom margin. */
|
|
15
|
+
marginBottom?: SpaceValue;
|
|
16
|
+
/** Left margin. */
|
|
17
|
+
marginLeft?: SpaceValue;
|
|
18
|
+
/** Right margin. */
|
|
19
|
+
marginRight?: SpaceValue;
|
|
20
|
+
/** End margin (logical). */
|
|
21
|
+
marginEnd?: SpaceValue;
|
|
22
|
+
/** Start margin (logical). */
|
|
23
|
+
marginStart?: SpaceValue;
|
|
24
|
+
/** Shorthand: margin on all sides. */
|
|
25
|
+
m?: SpaceValue;
|
|
26
|
+
/** Shorthand: horizontal margin. */
|
|
27
|
+
mx?: SpaceValue;
|
|
28
|
+
/** Shorthand: vertical margin. */
|
|
29
|
+
my?: SpaceValue;
|
|
30
|
+
/** Shorthand: top margin. */
|
|
31
|
+
mt?: SpaceValue;
|
|
32
|
+
/** Shorthand: bottom margin. */
|
|
33
|
+
mb?: SpaceValue;
|
|
34
|
+
/** Shorthand: left margin. */
|
|
35
|
+
ml?: SpaceValue;
|
|
36
|
+
/** Shorthand: right margin. */
|
|
37
|
+
mr?: SpaceValue;
|
|
38
|
+
}
|
|
39
|
+
export interface PaddingProps {
|
|
40
|
+
/** Padding on all sides. Accepts theme space tokens or raw values. */
|
|
41
|
+
padding?: SpaceValue;
|
|
42
|
+
/** Horizontal padding (left and right). */
|
|
43
|
+
paddingHorizontal?: SpaceValue;
|
|
44
|
+
/** Vertical padding (top and bottom). */
|
|
45
|
+
paddingVertical?: SpaceValue;
|
|
46
|
+
/** Top padding. */
|
|
47
|
+
paddingTop?: SpaceValue;
|
|
48
|
+
/** Bottom padding. */
|
|
49
|
+
paddingBottom?: SpaceValue;
|
|
50
|
+
/** Left padding. */
|
|
51
|
+
paddingLeft?: SpaceValue;
|
|
52
|
+
/** Right padding. */
|
|
53
|
+
paddingRight?: SpaceValue;
|
|
54
|
+
/** End padding (logical). */
|
|
55
|
+
paddingEnd?: SpaceValue;
|
|
56
|
+
/** Start padding (logical). */
|
|
57
|
+
paddingStart?: SpaceValue;
|
|
58
|
+
/** Shorthand: padding on all sides. */
|
|
59
|
+
p?: SpaceValue;
|
|
60
|
+
/** Shorthand: horizontal padding. */
|
|
61
|
+
px?: SpaceValue;
|
|
62
|
+
/** Shorthand: vertical padding. */
|
|
63
|
+
py?: SpaceValue;
|
|
64
|
+
/** Shorthand: top padding. */
|
|
65
|
+
pt?: SpaceValue;
|
|
66
|
+
/** Shorthand: bottom padding. */
|
|
67
|
+
pb?: SpaceValue;
|
|
68
|
+
/** Shorthand: left padding. */
|
|
69
|
+
pl?: SpaceValue;
|
|
70
|
+
/** Shorthand: right padding. */
|
|
71
|
+
pr?: SpaceValue;
|
|
72
|
+
}
|
|
73
|
+
export interface GapProps {
|
|
74
|
+
/** Gap between child elements. */
|
|
75
|
+
gap?: SpaceValue;
|
|
76
|
+
/** Row gap between child elements. */
|
|
77
|
+
rowGap?: SpaceValue;
|
|
78
|
+
/** Column gap between child elements. */
|
|
79
|
+
columnGap?: SpaceValue;
|
|
80
|
+
}
|
|
81
|
+
export interface SizeProps {
|
|
82
|
+
/** Element height. Accepts theme space tokens or raw values. */
|
|
83
|
+
height?: SpaceValue;
|
|
84
|
+
/** Element width. */
|
|
85
|
+
width?: SpaceValue;
|
|
86
|
+
/** Minimum height. */
|
|
87
|
+
minHeight?: SpaceValue;
|
|
88
|
+
/** Minimum width. */
|
|
89
|
+
minWidth?: SpaceValue;
|
|
90
|
+
/** Maximum height. */
|
|
91
|
+
maxHeight?: SpaceValue;
|
|
92
|
+
/** Maximum width. */
|
|
93
|
+
maxWidth?: SpaceValue;
|
|
94
|
+
/** Shorthand: height. */
|
|
95
|
+
h?: SpaceValue;
|
|
96
|
+
/** Shorthand: width. */
|
|
97
|
+
w?: SpaceValue;
|
|
98
|
+
}
|
|
99
|
+
export interface PositionProps {
|
|
100
|
+
/** Position type. */
|
|
101
|
+
position?: ViewStyle['position'];
|
|
102
|
+
/** Top offset. */
|
|
103
|
+
top?: SpaceValue;
|
|
104
|
+
/** Bottom offset. */
|
|
105
|
+
bottom?: SpaceValue;
|
|
106
|
+
/** Left offset. */
|
|
107
|
+
left?: SpaceValue;
|
|
108
|
+
/** Right offset. */
|
|
109
|
+
right?: SpaceValue;
|
|
110
|
+
/** Logical start offset. */
|
|
111
|
+
start?: SpaceValue;
|
|
112
|
+
/** Logical end offset. */
|
|
113
|
+
end?: SpaceValue;
|
|
114
|
+
/** Z-index for stacking order. */
|
|
115
|
+
zIndex?: number;
|
|
116
|
+
}
|
|
117
|
+
export interface BackgroundColorProps {
|
|
118
|
+
/** Background color. Accepts simplified semantic background tokens. */
|
|
119
|
+
backgroundColor?: BackgroundColorValue | RawColorValue;
|
|
120
|
+
/** Shorthand: background color. */
|
|
121
|
+
bg?: BackgroundColorValue | RawColorValue;
|
|
122
|
+
/** Shorthand: background color. */
|
|
123
|
+
bgColor?: BackgroundColorValue | RawColorValue;
|
|
124
|
+
}
|
|
125
|
+
export interface BorderColorStyleProps {
|
|
126
|
+
/** Border color. Accepts simplified semantic border tokens. */
|
|
127
|
+
borderColor?: BorderColorValue | RawColorValue;
|
|
128
|
+
/** Bottom border color. */
|
|
129
|
+
borderBottomColor?: BorderColorValue | RawColorValue;
|
|
130
|
+
/** Left border color. */
|
|
131
|
+
borderLeftColor?: BorderColorValue | RawColorValue;
|
|
132
|
+
/** Right border color. */
|
|
133
|
+
borderRightColor?: BorderColorValue | RawColorValue;
|
|
134
|
+
/** Top border color. */
|
|
135
|
+
borderTopColor?: BorderColorValue | RawColorValue;
|
|
136
|
+
/** Block border color. */
|
|
137
|
+
borderBlockColor?: BorderColorValue | RawColorValue;
|
|
138
|
+
/** Block end border color. */
|
|
139
|
+
borderBlockEndColor?: BorderColorValue | RawColorValue;
|
|
140
|
+
/** Block start border color. */
|
|
141
|
+
borderBlockStartColor?: BorderColorValue | RawColorValue;
|
|
142
|
+
/** End border color. */
|
|
143
|
+
borderEndColor?: BorderColorValue | RawColorValue;
|
|
144
|
+
/** Start border color. */
|
|
145
|
+
borderStartColor?: BorderColorValue | RawColorValue;
|
|
146
|
+
}
|
|
147
|
+
export interface BorderWidthProps {
|
|
148
|
+
/** Border width on all sides. */
|
|
149
|
+
borderWidth?: BorderWidthValue;
|
|
150
|
+
/** Bottom border width. */
|
|
151
|
+
borderBottomWidth?: BorderWidthValue;
|
|
152
|
+
/** End border width. */
|
|
153
|
+
borderEndWidth?: BorderWidthValue;
|
|
154
|
+
/** Left border width. */
|
|
155
|
+
borderLeftWidth?: BorderWidthValue;
|
|
156
|
+
/** Right border width. */
|
|
157
|
+
borderRightWidth?: BorderWidthValue;
|
|
158
|
+
/** Start border width. */
|
|
159
|
+
borderStartWidth?: BorderWidthValue;
|
|
160
|
+
/** Top border width. */
|
|
161
|
+
borderTopWidth?: BorderWidthValue;
|
|
162
|
+
}
|
|
163
|
+
export interface BorderRadiusProps {
|
|
164
|
+
/** Border radius on all corners. */
|
|
165
|
+
borderRadius?: BorderRadiusValue;
|
|
166
|
+
/** Bottom-end border radius. */
|
|
167
|
+
borderBottomEndRadius?: BorderRadiusValue;
|
|
168
|
+
/** Bottom-left border radius. */
|
|
169
|
+
borderBottomLeftRadius?: BorderRadiusValue;
|
|
170
|
+
/** Bottom-right border radius. */
|
|
171
|
+
borderBottomRightRadius?: BorderRadiusValue;
|
|
172
|
+
/** Bottom-start border radius. */
|
|
173
|
+
borderBottomStartRadius?: BorderRadiusValue;
|
|
174
|
+
/** Top-end border radius. */
|
|
175
|
+
borderTopEndRadius?: BorderRadiusValue;
|
|
176
|
+
/** Top-left border radius. */
|
|
177
|
+
borderTopLeftRadius?: BorderRadiusValue;
|
|
178
|
+
/** Top-right border radius. */
|
|
179
|
+
borderTopRightRadius?: BorderRadiusValue;
|
|
180
|
+
/** Top-start border radius. */
|
|
181
|
+
borderTopStartRadius?: BorderRadiusValue;
|
|
182
|
+
/** End-end border radius. */
|
|
183
|
+
borderEndEndRadius?: BorderRadiusValue;
|
|
184
|
+
/** End-start border radius. */
|
|
185
|
+
borderEndStartRadius?: BorderRadiusValue;
|
|
186
|
+
/** Start-end border radius. */
|
|
187
|
+
borderStartEndRadius?: BorderRadiusValue;
|
|
188
|
+
/** Start-start border radius. */
|
|
189
|
+
borderStartStartRadius?: BorderRadiusValue;
|
|
190
|
+
/** Shorthand: border radius on all corners. */
|
|
191
|
+
rounded?: BorderRadiusValue;
|
|
192
|
+
}
|
|
193
|
+
export interface BorderStyleProps {
|
|
194
|
+
/** Border style. */
|
|
195
|
+
borderStyle?: ViewStyle['borderStyle'];
|
|
196
|
+
/** Border curve. */
|
|
197
|
+
borderCurve?: ViewStyle['borderCurve'];
|
|
198
|
+
}
|
|
199
|
+
export interface BorderProps extends BorderWidthProps, BorderRadiusProps, BorderColorStyleProps, BorderStyleProps {
|
|
200
|
+
}
|
|
201
|
+
export interface FlexLayoutProps {
|
|
202
|
+
/** Align content. */
|
|
203
|
+
alignContent?: ViewStyle['alignContent'];
|
|
204
|
+
/** Align items. */
|
|
205
|
+
alignItems?: ViewStyle['alignItems'];
|
|
206
|
+
/** Align self. */
|
|
207
|
+
alignSelf?: ViewStyle['alignSelf'];
|
|
208
|
+
/** Flex value. */
|
|
209
|
+
flex?: number;
|
|
210
|
+
/** Flex basis. */
|
|
211
|
+
flexBasis?: ViewStyle['flexBasis'];
|
|
212
|
+
/** Flex direction. */
|
|
213
|
+
flexDirection?: ViewStyle['flexDirection'];
|
|
214
|
+
/** Flex grow. */
|
|
215
|
+
flexGrow?: number;
|
|
216
|
+
/** Flex shrink. */
|
|
217
|
+
flexShrink?: number;
|
|
218
|
+
/** Flex wrap. */
|
|
219
|
+
flexWrap?: ViewStyle['flexWrap'];
|
|
220
|
+
/** Justify content. */
|
|
221
|
+
justifyContent?: ViewStyle['justifyContent'];
|
|
222
|
+
}
|
|
223
|
+
export interface OpacityProps {
|
|
224
|
+
/** Opacity value. */
|
|
225
|
+
opacity?: OpacityValue;
|
|
226
|
+
}
|
|
227
|
+
export interface ShadowProps {
|
|
228
|
+
/** Shadow color. */
|
|
229
|
+
shadowColor?: ColorValue;
|
|
230
|
+
/** Shadow offset. */
|
|
231
|
+
shadowOffset?: ViewStyle['shadowOffset'];
|
|
232
|
+
/** Shadow opacity. */
|
|
233
|
+
shadowOpacity?: number;
|
|
234
|
+
/** Shadow radius. */
|
|
235
|
+
shadowRadius?: number;
|
|
236
|
+
/** Box shadow. */
|
|
237
|
+
boxShadow?: ViewStyle['boxShadow'];
|
|
238
|
+
/** Elevation (Android). */
|
|
239
|
+
elevation?: number;
|
|
240
|
+
}
|
|
241
|
+
export interface OutlineProps {
|
|
242
|
+
/** Outline color. */
|
|
243
|
+
outlineColor?: ColorValue;
|
|
244
|
+
/** Outline offset. */
|
|
245
|
+
outlineOffset?: number;
|
|
246
|
+
/** Outline style. */
|
|
247
|
+
outlineStyle?: ViewStyle['outlineStyle'];
|
|
248
|
+
/** Outline width. */
|
|
249
|
+
outlineWidth?: number;
|
|
250
|
+
}
|
|
251
|
+
export interface DisplayProps {
|
|
252
|
+
/** Display type. */
|
|
253
|
+
display?: ViewStyle['display'];
|
|
254
|
+
/** Overflow behavior. */
|
|
255
|
+
overflow?: ViewStyle['overflow'];
|
|
256
|
+
/** Pointer events behavior. */
|
|
257
|
+
pointerEvents?: ViewStyle['pointerEvents'];
|
|
258
|
+
/** Backface visibility. */
|
|
259
|
+
backfaceVisibility?: ViewStyle['backfaceVisibility'];
|
|
260
|
+
/** Cursor type. */
|
|
261
|
+
cursor?: ViewStyle['cursor'];
|
|
262
|
+
/** Direction for bidirectional text. */
|
|
263
|
+
direction?: ViewStyle['direction'];
|
|
264
|
+
/** Aspect ratio. */
|
|
265
|
+
aspectRatio?: ViewStyle['aspectRatio'];
|
|
266
|
+
}
|
|
267
|
+
export interface TransformProps {
|
|
268
|
+
/** Transform array. */
|
|
269
|
+
transform?: ViewStyle['transform'];
|
|
270
|
+
/** Transform origin. */
|
|
271
|
+
transformOrigin?: ViewStyle['transformOrigin'];
|
|
272
|
+
}
|
|
273
|
+
export interface TextColorProps {
|
|
274
|
+
/** Text color. Accepts simplified semantic text tokens. */
|
|
275
|
+
color?: TextColorValue;
|
|
276
|
+
}
|
|
277
|
+
export interface IconColorProps {
|
|
278
|
+
/** Icon color. Accepts simplified semantic icon tokens. */
|
|
279
|
+
iconColor?: IconColorValue;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Common text styling props shared across text components (BodyText, Heading, DetailText).
|
|
283
|
+
* Includes margin utility props, simplified semantic text color, and standard text style props.
|
|
284
|
+
*/
|
|
285
|
+
export interface CommonTextProps extends RNTextProps, MarginProps {
|
|
286
|
+
/** Whether to truncate text with an ellipsis. */
|
|
287
|
+
truncated?: boolean;
|
|
288
|
+
/** Whether to show strikethrough text. */
|
|
289
|
+
strikeThrough?: boolean;
|
|
290
|
+
/** Whether to underline text. */
|
|
291
|
+
underline?: boolean;
|
|
292
|
+
/** Whether to italicise text. */
|
|
293
|
+
italic?: boolean;
|
|
294
|
+
/** Text color. Accepts simplified semantic text tokens. */
|
|
295
|
+
color?: TextColorValue | RawColorValue;
|
|
296
|
+
/** Text transform (uppercase, lowercase, capitalize). */
|
|
297
|
+
textTransform?: TextStyle['textTransform'];
|
|
298
|
+
/** Text alignment. */
|
|
299
|
+
textAlign?: TextStyle['textAlign'];
|
|
300
|
+
/** Vertical text alignment. */
|
|
301
|
+
textAlignVertical?: TextStyle['textAlignVertical'];
|
|
302
|
+
/** Text decoration line. */
|
|
303
|
+
textDecorationLine?: TextStyle['textDecorationLine'];
|
|
304
|
+
/** Text decoration style. */
|
|
305
|
+
textDecorationStyle?: TextStyle['textDecorationStyle'];
|
|
306
|
+
/** Text decoration color. Accepts any color value. */
|
|
307
|
+
textDecorationColor?: ColorValue;
|
|
308
|
+
/** User select behavior. */
|
|
309
|
+
userSelect?: TextStyle['userSelect'];
|
|
310
|
+
/** Whether to use inverted (light-on-dark) text color. */
|
|
311
|
+
inverted?: boolean;
|
|
312
|
+
/** Ref to the underlying Text element. */
|
|
313
|
+
ref?: Ref<Text>;
|
|
314
|
+
}
|
|
315
|
+
/** All spacing-related utility props (margin, padding, gap). */
|
|
316
|
+
export interface SpacingProps extends MarginProps, PaddingProps, GapProps {
|
|
317
|
+
}
|
|
318
|
+
/** All layout-related utility props (flex, size, position). */
|
|
319
|
+
export interface LayoutProps extends FlexLayoutProps, SizeProps, PositionProps {
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* All Box-level utility style props.
|
|
323
|
+
* This is the full set of style utilities available on Box.
|
|
324
|
+
*/
|
|
325
|
+
export interface AllUtilityProps extends SpacingProps, LayoutProps, BackgroundColorProps, BorderProps, OpacityProps, ShadowProps, OutlineProps, DisplayProps, TransformProps {
|
|
326
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/types/values.d.ts
CHANGED
|
@@ -19,12 +19,13 @@ type Capitalise<S extends string> = S extends `${infer First}${infer Rest}` ? `$
|
|
|
19
19
|
export type FlattenColorKeys<T> = T extends Record<string, unknown> ? {
|
|
20
20
|
[K in keyof T]: T[K] extends string ? ToCamelCase<K & string> : T[K] extends Record<string, unknown> ? FlattenColorKeys<T[K]> extends infer Nested ? Nested extends string ? ToCamelCase<`${K & string}${Capitalise<Nested>}`> : never : never : never;
|
|
21
21
|
}[keyof T] : never;
|
|
22
|
-
export type
|
|
22
|
+
export type RawColorValue = 'transparent' | HSLA | HSL | RGB | RGBA | HEX;
|
|
23
|
+
export type ColorValue = 'currentColor' | RawColorValue | FlattenColorKeys<Omit<typeof color, 'light' | 'dark'> & {
|
|
23
24
|
white: '#ffffff';
|
|
24
25
|
black: '#000000';
|
|
25
|
-
}> | FlattenColorKeys<(typeof color)['light']> |
|
|
26
|
+
}> | FlattenColorKeys<(typeof color)['light']> | undefined;
|
|
26
27
|
export type BorderRadiusValue = `${keyof (typeof lightTheme)['borderRadius'] & (string | number)}` | AnimatableNumericValue | undefined;
|
|
27
|
-
export type
|
|
28
|
+
export type BorderWidthValue = `${keyof (typeof lightTheme)['borderWidth'] & (string | number)}` | number | undefined;
|
|
28
29
|
export type OpacityValue = AnimatableNumericValue | undefined;
|
|
29
30
|
export type SpacingValues = keyof (typeof themes)['light']['globalStyle']['variants']['spacing'];
|
|
30
31
|
export {};
|
|
@@ -8,3 +8,7 @@ export declare function extractSemanticColorValues(): Record<string, string>;
|
|
|
8
8
|
*/
|
|
9
9
|
export declare function extractAllColorValues(): Record<string, string>;
|
|
10
10
|
export default function coloursAsArray(): Array<string>;
|
|
11
|
+
export declare const backgroundColorKeys: string[];
|
|
12
|
+
export declare const borderColorKeys: string[];
|
|
13
|
+
export declare const textColorKeys: string[];
|
|
14
|
+
export declare const iconColorKeys: string[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { color } from '../tokens';
|
|
2
|
+
import semanticColors from '../tokens/semantic-light';
|
|
2
3
|
const { light, ...restOfColors } = color;
|
|
3
4
|
/**
|
|
4
5
|
* Recursively flatten nested color objects into camelCase keys
|
|
@@ -45,3 +46,7 @@ export default function coloursAsArray() {
|
|
|
45
46
|
const semanticColorValues = Object.keys(extractSemanticColorValues());
|
|
46
47
|
return [...primitiveColors, ...primitiveColorValues, ...semanticColorValues];
|
|
47
48
|
}
|
|
49
|
+
export const backgroundColorKeys = Object.keys(semanticColors.background);
|
|
50
|
+
export const borderColorKeys = Object.keys(semanticColors.border);
|
|
51
|
+
export const textColorKeys = Object.keys(semanticColors.text);
|
|
52
|
+
export const iconColorKeys = Object.keys(semanticColors.icon);
|
package/build/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as coloursAsArray, extractLightColorValues } from './coloursAsArray';
|
|
1
|
+
export { backgroundColorKeys, borderColorKeys, default as coloursAsArray, extractLightColorValues, iconColorKeys, textColorKeys, } from './coloursAsArray';
|
|
2
2
|
export { default as formatThousands } from './formatThousands';
|
|
3
3
|
export { default as getFlattenedColorValue } from './getFlattenedColorValue';
|
|
4
4
|
export { getInitials } from './getInitials';
|
package/build/utils/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as coloursAsArray, extractLightColorValues } from './coloursAsArray';
|
|
1
|
+
export { backgroundColorKeys, borderColorKeys, default as coloursAsArray, extractLightColorValues, iconColorKeys, textColorKeys, } from './coloursAsArray';
|
|
2
2
|
export { default as formatThousands } from './formatThousands';
|
|
3
3
|
export { default as getFlattenedColorValue } from './getFlattenedColorValue';
|
|
4
4
|
export { getInitials } from './getInitials';
|