@utilitywarehouse/hearth-react-native 0.19.1 → 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 +299 -4
- 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/components/Select/Select.d.ts +1 -1
- package/build/components/Select/Select.js +9 -10
- package/build/components/Select/Select.props.d.ts +16 -0
- 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/Checkbox/CheckboxGroup.figma.tsx +21 -1
- 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/PillGroup/Pill.figma.tsx +4 -17
- package/src/components/PillGroup/PillGroup.figma.tsx +8 -9
- package/src/components/ProgressStepper/ProgressStep.figma.tsx +4 -15
- package/src/components/ProgressStepper/ProgressStepper.figma.tsx +9 -16
- package/src/components/Radio/Radio.figma.tsx +35 -22
- package/src/components/Radio/RadioGroup.figma.tsx +69 -41
- package/src/components/Radio/RadioTile.figma.tsx +34 -0
- package/src/components/RadioCard/RadioCard.figma.tsx +24 -0
- package/src/components/SectionHeader/SectionHeader.figma.tsx +31 -25
- package/src/components/Select/Select.docs.mdx +76 -28
- package/src/components/Select/Select.figma.tsx +44 -43
- package/src/components/Select/Select.props.ts +16 -0
- package/src/components/Select/Select.tsx +42 -35
- package/src/components/Select/SelectOption.figma.tsx +3 -21
- package/src/components/Spinner/Spinner.figma.tsx +12 -25
- package/src/components/Switch/Switch.figma.tsx +2 -23
- package/src/components/Tabs/Tab.figma.tsx +21 -0
- package/src/components/Tabs/Tabs.figma.tsx +18 -27
- package/src/components/Textarea/Textarea.figma.tsx +64 -0
- package/src/components/Toast/ToastItem.figma.tsx +1 -8
- package/src/components/ToggleButtonCard/ToggleButtonCard.figma.tsx +24 -0
- package/src/components/VerificationInput/VerificationInput.figma.tsx +53 -0
- 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/src/components/Radio/RadioTileRoot.figma.tsx +0 -31
|
@@ -2,6 +2,7 @@ import { Canvas, Controls, Meta, Primary, Story } from '@storybook/addon-docs/bl
|
|
|
2
2
|
import { BodyText, Box, Center, Grid } from '../..';
|
|
3
3
|
import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
|
|
4
4
|
import * as Stories from './Grid.stories';
|
|
5
|
+
import { color } from '@utilitywarehouse/hearth-tokens';
|
|
5
6
|
|
|
6
7
|
<Meta title="Primitives / Grid" />
|
|
7
8
|
|
|
@@ -26,17 +27,17 @@ The Grid component helps you create responsive grid layouts with configurable co
|
|
|
26
27
|
<UsageWrap>
|
|
27
28
|
<Center>
|
|
28
29
|
<Grid columns={2} spacing="md" width={300}>
|
|
29
|
-
<Box backgroundColor=
|
|
30
|
-
<BodyText color="
|
|
30
|
+
<Box backgroundColor={color.green[400]} height={100} padding="200">
|
|
31
|
+
<BodyText color="inverted">Item 1</BodyText>
|
|
31
32
|
</Box>
|
|
32
|
-
<Box backgroundColor=
|
|
33
|
-
<BodyText color="
|
|
33
|
+
<Box backgroundColor={color.blue[400]} height={100} padding="200">
|
|
34
|
+
<BodyText color="inverted">Item 2</BodyText>
|
|
34
35
|
</Box>
|
|
35
|
-
<Box backgroundColor=
|
|
36
|
-
<BodyText color="
|
|
36
|
+
<Box backgroundColor={color.red[400]} height={100} padding="200">
|
|
37
|
+
<BodyText color="inverted">Item 3</BodyText>
|
|
37
38
|
</Box>
|
|
38
|
-
<Box backgroundColor=
|
|
39
|
-
<BodyText color="
|
|
39
|
+
<Box backgroundColor={color.yellow[400]} height={100} padding="200">
|
|
40
|
+
<BodyText color="inverted">Item 4</BodyText>
|
|
40
41
|
</Box>
|
|
41
42
|
</Grid>
|
|
42
43
|
</Center>
|
|
@@ -44,20 +45,21 @@ The Grid component helps you create responsive grid layouts with configurable co
|
|
|
44
45
|
|
|
45
46
|
```jsx
|
|
46
47
|
import { Grid, Box, BodyText } from '@utilitywarehouse/hearth-react-native';
|
|
48
|
+
import { color } from '@utilitywarehouse/hearth-tokens';
|
|
47
49
|
|
|
48
50
|
const MyComponent = () => (
|
|
49
51
|
<Grid columns={2} spacing="md" width={300}>
|
|
50
|
-
<Box backgroundColor=
|
|
51
|
-
<BodyText color="
|
|
52
|
+
<Box backgroundColor={color.green[400]} height={100} padding="200">
|
|
53
|
+
<BodyText color="inverted">Item 1</BodyText>
|
|
52
54
|
</Box>
|
|
53
|
-
<Box backgroundColor=
|
|
54
|
-
<BodyText color="
|
|
55
|
+
<Box backgroundColor={color.blue[400]} height={100} padding="200">
|
|
56
|
+
<BodyText color="inverted">Item 2</BodyText>
|
|
55
57
|
</Box>
|
|
56
|
-
<Box backgroundColor=
|
|
57
|
-
<BodyText color="
|
|
58
|
+
<Box backgroundColor={color.red[400]} height={100} padding="200">
|
|
59
|
+
<BodyText color="inverted">Item 3</BodyText>
|
|
58
60
|
</Box>
|
|
59
|
-
<Box backgroundColor=
|
|
60
|
-
<BodyText color="
|
|
61
|
+
<Box backgroundColor={color.yellow[400]} height={100} padding="200">
|
|
62
|
+
<BodyText color="inverted">Item 4</BodyText>
|
|
61
63
|
</Box>
|
|
62
64
|
</Grid>
|
|
63
65
|
);
|
|
@@ -79,17 +81,17 @@ The Grid component supports responsive column layouts based on screen size break
|
|
|
79
81
|
spacing="md"
|
|
80
82
|
width="100%"
|
|
81
83
|
>
|
|
82
|
-
<Box backgroundColor=
|
|
83
|
-
<BodyText color="
|
|
84
|
+
<Box backgroundColor={color.green[400]} height={100} padding="200">
|
|
85
|
+
<BodyText color="inverted">Item 1</BodyText>
|
|
84
86
|
</Box>
|
|
85
|
-
<Box backgroundColor=
|
|
86
|
-
<BodyText color="
|
|
87
|
+
<Box backgroundColor={color.blue[400]} height={100} padding="200">
|
|
88
|
+
<BodyText color="inverted">Item 2</BodyText>
|
|
87
89
|
</Box>
|
|
88
|
-
<Box backgroundColor=
|
|
89
|
-
<BodyText color="
|
|
90
|
+
<Box backgroundColor={color.red[400]} height={100} padding="200">
|
|
91
|
+
<BodyText color="inverted">Item 3</BodyText>
|
|
90
92
|
</Box>
|
|
91
|
-
<Box backgroundColor=
|
|
92
|
-
<BodyText color="
|
|
93
|
+
<Box backgroundColor={color.yellow[400]} height={100} padding="200">
|
|
94
|
+
<BodyText color="inverted">Item 4</BodyText>
|
|
93
95
|
</Box>
|
|
94
96
|
</Grid>
|
|
95
97
|
</Center>
|
|
@@ -97,6 +99,7 @@ The Grid component supports responsive column layouts based on screen size break
|
|
|
97
99
|
|
|
98
100
|
```jsx
|
|
99
101
|
import { Grid, Box, BodyText } from '@utilitywarehouse/hearth-react-native';
|
|
102
|
+
import { color } from '@utilitywarehouse/hearth-tokens';
|
|
100
103
|
|
|
101
104
|
const MyComponent = () => (
|
|
102
105
|
<Grid
|
|
@@ -109,17 +112,17 @@ const MyComponent = () => (
|
|
|
109
112
|
spacing="md"
|
|
110
113
|
width="100%"
|
|
111
114
|
>
|
|
112
|
-
<Box backgroundColor=
|
|
113
|
-
<BodyText color="
|
|
115
|
+
<Box backgroundColor={color.green[400]} height={100} padding="200">
|
|
116
|
+
<BodyText color="inverted">Item 1</BodyText>
|
|
114
117
|
</Box>
|
|
115
|
-
<Box backgroundColor=
|
|
116
|
-
<BodyText color="
|
|
118
|
+
<Box backgroundColor={color.blue[400]} height={100} padding="200">
|
|
119
|
+
<BodyText color="inverted">Item 2</BodyText>
|
|
117
120
|
</Box>
|
|
118
|
-
<Box backgroundColor=
|
|
119
|
-
<BodyText color="
|
|
121
|
+
<Box backgroundColor={color.red[400]} height={100} padding="200">
|
|
122
|
+
<BodyText color="inverted">Item 3</BodyText>
|
|
120
123
|
</Box>
|
|
121
|
-
<Box backgroundColor=
|
|
122
|
-
<BodyText color="
|
|
124
|
+
<Box backgroundColor={color.yellow[400]} height={100} padding="200">
|
|
125
|
+
<BodyText color="inverted">Item 4</BodyText>
|
|
123
126
|
</Box>
|
|
124
127
|
</Grid>
|
|
125
128
|
);
|
|
@@ -132,38 +135,39 @@ You can specify different horizontal and vertical spacing:
|
|
|
132
135
|
<UsageWrap>
|
|
133
136
|
<Center>
|
|
134
137
|
<Grid columns={2} columnGap={24} rowGap={16}>
|
|
135
|
-
<Box backgroundColor=
|
|
136
|
-
<BodyText color="
|
|
138
|
+
<Box backgroundColor={color.green[400]} height={100} padding="200">
|
|
139
|
+
<BodyText color="inverted">Item 1</BodyText>
|
|
137
140
|
</Box>
|
|
138
|
-
<Box backgroundColor=
|
|
139
|
-
<BodyText color="
|
|
141
|
+
<Box backgroundColor={color.blue[400]} height={100} padding="200">
|
|
142
|
+
<BodyText color="inverted">Item 2</BodyText>
|
|
140
143
|
</Box>
|
|
141
|
-
<Box backgroundColor=
|
|
142
|
-
<BodyText color="
|
|
144
|
+
<Box backgroundColor={color.red[400]} height={100} padding="200">
|
|
145
|
+
<BodyText color="inverted">Item 3</BodyText>
|
|
143
146
|
</Box>
|
|
144
|
-
<Box backgroundColor=
|
|
145
|
-
<BodyText color="
|
|
147
|
+
<Box backgroundColor={color.yellow[400]} height={100} padding="200">
|
|
148
|
+
<BodyText color="inverted">Item 4</BodyText>
|
|
146
149
|
</Box>
|
|
147
150
|
</Grid>
|
|
148
151
|
</Center>
|
|
149
152
|
</UsageWrap>
|
|
150
153
|
|
|
151
154
|
```jsx
|
|
152
|
-
import { Grid, Box } from '@utilitywarehouse/hearth-react-native';
|
|
155
|
+
import { Grid, Box, BodyText } from '@utilitywarehouse/hearth-react-native';
|
|
156
|
+
import { color } from '@utilitywarehouse/hearth-tokens';
|
|
153
157
|
|
|
154
158
|
const MyComponent = () => (
|
|
155
159
|
<Grid columns={2} columnGap={24} rowGap={8}>
|
|
156
|
-
<Box backgroundColor=
|
|
157
|
-
<BodyText color="
|
|
160
|
+
<Box backgroundColor={color.green[400]} height={100} padding="200">
|
|
161
|
+
<BodyText color="inverted">Item 1</BodyText>
|
|
158
162
|
</Box>
|
|
159
|
-
<Box backgroundColor=
|
|
160
|
-
<BodyText color="
|
|
163
|
+
<Box backgroundColor={color.blue[400]} height={100} padding="200">
|
|
164
|
+
<BodyText color="inverted">Item 2</BodyText>
|
|
161
165
|
</Box>
|
|
162
|
-
<Box backgroundColor=
|
|
163
|
-
<BodyText color="
|
|
166
|
+
<Box backgroundColor={color.red[400]} height={100} padding="200">
|
|
167
|
+
<BodyText color="inverted">Item 3</BodyText>
|
|
164
168
|
</Box>
|
|
165
|
-
<Box backgroundColor=
|
|
166
|
-
<BodyText color="
|
|
169
|
+
<Box backgroundColor={color.yellow[400]} height={100} padding="200">
|
|
170
|
+
<BodyText color="inverted">Item 4</BodyText>
|
|
167
171
|
</Box>
|
|
168
172
|
</Grid>
|
|
169
173
|
);
|
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Text, TextProps, TextStyle } from 'react-native';
|
|
3
|
-
import type { ColorValue } from '../../types';
|
|
1
|
+
import type { CommonTextProps } from '../../types';
|
|
4
2
|
|
|
5
|
-
interface HeadingProps extends
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
underline?: boolean;
|
|
9
|
-
truncated?: boolean;
|
|
10
|
-
color?: ColorValue;
|
|
11
|
-
textTransform?: TextStyle['textTransform'];
|
|
12
|
-
textAlign?: TextStyle['textAlign'];
|
|
13
|
-
textAlignVertical?: TextStyle['textAlignVertical'];
|
|
14
|
-
textDecorationLine?: TextStyle['textDecorationLine'];
|
|
15
|
-
textDecorationStyle?: TextStyle['textDecorationStyle'];
|
|
16
|
-
textDecorationColor?: ColorValue;
|
|
17
|
-
userSelect?: TextStyle['userSelect'];
|
|
18
|
-
inverted?: boolean;
|
|
19
|
-
ref?: Ref<Text>;
|
|
3
|
+
interface HeadingProps extends CommonTextProps {
|
|
4
|
+
/** Heading size variant. */
|
|
5
|
+
size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
20
6
|
}
|
|
21
7
|
|
|
22
8
|
export default HeadingProps;
|
|
@@ -2,6 +2,7 @@ import { Meta, StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import { Heading } from '.';
|
|
3
3
|
import { VariantTitle } from '../../../docs/components';
|
|
4
4
|
import { coloursAsArray } from '../../utils';
|
|
5
|
+
import { textColorKeys } from '../../utils/coloursAsArray';
|
|
5
6
|
import { Box } from '../Box';
|
|
6
7
|
|
|
7
8
|
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
|
|
@@ -35,7 +36,7 @@ const meta = {
|
|
|
35
36
|
description: 'Strike through the text.',
|
|
36
37
|
},
|
|
37
38
|
color: {
|
|
38
|
-
options:
|
|
39
|
+
options: textColorKeys,
|
|
39
40
|
control: 'select',
|
|
40
41
|
description: 'Color of the text. Use the color name from the theme.',
|
|
41
42
|
},
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
1
|
import { Text, TextStyle } from 'react-native';
|
|
3
2
|
import { StyleSheet } from 'react-native-unistyles';
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { getFlattenedColorValue } from '../../utils';
|
|
3
|
+
import { useStyleProps } from '../../hooks';
|
|
4
|
+
import { getFlattenedColorValue, resolveThemeValueWithFallback } from '../../utils';
|
|
7
5
|
import type HeadingProps from './Heading.props';
|
|
8
6
|
|
|
9
7
|
const Heading = ({
|
|
@@ -23,26 +21,19 @@ const Heading = ({
|
|
|
23
21
|
inverted,
|
|
24
22
|
...props
|
|
25
23
|
}: HeadingProps) => {
|
|
24
|
+
// Extract margin utility props from remaining props
|
|
25
|
+
const { computedStyles: utilityStyles, remainingProps } = useStyleProps(props);
|
|
26
|
+
|
|
26
27
|
styles.useVariants({
|
|
27
28
|
size,
|
|
28
29
|
underline,
|
|
29
30
|
strikeThrough,
|
|
30
31
|
inverted,
|
|
31
32
|
});
|
|
32
|
-
|
|
33
|
-
const colorValue: ColorValue = useMemo(
|
|
34
|
-
() => getFlattenedColorValue(color, themeColor),
|
|
35
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
|
-
[color, colorMode]
|
|
37
|
-
);
|
|
38
|
-
const decorationColor = useMemo(
|
|
39
|
-
() => getFlattenedColorValue(textDecorationColor, themeColor),
|
|
40
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
41
|
-
[textDecorationColor, colorMode]
|
|
42
|
-
);
|
|
33
|
+
|
|
43
34
|
return (
|
|
44
35
|
<Text
|
|
45
|
-
{...
|
|
36
|
+
{...remainingProps}
|
|
46
37
|
{...(truncated
|
|
47
38
|
? {
|
|
48
39
|
numberOfLines: 1,
|
|
@@ -51,16 +42,16 @@ const Heading = ({
|
|
|
51
42
|
: {})}
|
|
52
43
|
style={[
|
|
53
44
|
styles.text,
|
|
45
|
+
utilityStyles,
|
|
54
46
|
{
|
|
55
|
-
...(colorValue ? { color: colorValue } : {}),
|
|
56
47
|
...(textTransform ? { textTransform } : {}),
|
|
57
48
|
...(textAlign ? { textAlign } : {}),
|
|
58
49
|
...(textAlignVertical ? { textAlignVertical } : {}),
|
|
59
|
-
...(decorationColor && { textDecorationColor: decorationColor }),
|
|
60
50
|
...(textDecorationLine && { textDecorationLine }),
|
|
61
51
|
...(textDecorationStyle && { textDecorationStyle }),
|
|
62
52
|
...(userSelect && { userSelect }),
|
|
63
53
|
},
|
|
54
|
+
styles.getColours(color, textDecorationColor),
|
|
64
55
|
props.style,
|
|
65
56
|
]}
|
|
66
57
|
>
|
|
@@ -147,6 +138,23 @@ const styles = StyleSheet.create(theme => ({
|
|
|
147
138
|
lg: theme.typography.desktop.heading.xl.lineHeight,
|
|
148
139
|
},
|
|
149
140
|
},
|
|
141
|
+
'2xl': {
|
|
142
|
+
fontSize: {
|
|
143
|
+
base: theme.typography.mobile.heading['2xl'].fontSize,
|
|
144
|
+
md: theme.typography.tablet.heading['2xl'].fontSize,
|
|
145
|
+
lg: theme.typography.desktop.heading['2xl'].fontSize,
|
|
146
|
+
},
|
|
147
|
+
fontWeight: {
|
|
148
|
+
base: theme.typography.mobile.heading['2xl'].fontWeight,
|
|
149
|
+
md: theme.typography.tablet.heading['2xl'].fontWeight,
|
|
150
|
+
lg: theme.typography.desktop.heading['2xl'].fontWeight,
|
|
151
|
+
},
|
|
152
|
+
lineHeight: {
|
|
153
|
+
base: theme.typography.mobile.heading['2xl'].lineHeight,
|
|
154
|
+
md: theme.typography.tablet.heading['2xl'].lineHeight,
|
|
155
|
+
lg: theme.typography.desktop.heading['2xl'].lineHeight,
|
|
156
|
+
},
|
|
157
|
+
},
|
|
150
158
|
},
|
|
151
159
|
underline: {
|
|
152
160
|
true: {
|
|
@@ -165,6 +173,20 @@ const styles = StyleSheet.create(theme => ({
|
|
|
165
173
|
},
|
|
166
174
|
},
|
|
167
175
|
},
|
|
176
|
+
getColours: (color?: string, textDecorationColor?: string) => ({
|
|
177
|
+
...(color
|
|
178
|
+
? {
|
|
179
|
+
color: resolveThemeValueWithFallback(
|
|
180
|
+
color,
|
|
181
|
+
theme.helpers.semanticColor.text,
|
|
182
|
+
theme.color
|
|
183
|
+
),
|
|
184
|
+
}
|
|
185
|
+
: {}),
|
|
186
|
+
...(textDecorationColor
|
|
187
|
+
? { textDecorationColor: getFlattenedColorValue(textDecorationColor, theme.color) }
|
|
188
|
+
: {}),
|
|
189
|
+
}),
|
|
168
190
|
}));
|
|
169
191
|
|
|
170
192
|
export default Heading;
|
|
@@ -1,25 +1,12 @@
|
|
|
1
1
|
import figma from '@figma/code-connect';
|
|
2
|
-
import { Pill } from '
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* -- This file was auto-generated by Code Connect --
|
|
6
|
-
* `props` includes a mapping from your code props to Figma properties.
|
|
7
|
-
* You should check this is correct, and update the `example` function
|
|
8
|
-
* to return the code example you'd like to see in Figma
|
|
9
|
-
*/
|
|
2
|
+
import { Pill } from '../';
|
|
10
3
|
|
|
11
4
|
figma.connect(Pill, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=4348%3A15595', {
|
|
12
5
|
props: {
|
|
13
|
-
// These props were automatically mapped based on your linked code:
|
|
14
6
|
label: figma.string('Label'),
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
icon: figma.boolean('Icon?', {
|
|
8
|
+
true: figma.instance('Icon-20'),
|
|
17
9
|
}),
|
|
18
|
-
// No matching props could be found for these Figma properties:
|
|
19
|
-
// "label": figma.string('Label'),
|
|
20
|
-
// "icon": figma.boolean('Icon?'),
|
|
21
|
-
// "icon20": figma.instance('Icon-20'),
|
|
22
|
-
// "selected": figma.boolean('Selected?')
|
|
23
10
|
},
|
|
24
|
-
example: props => <Pill value={
|
|
11
|
+
example: props => <Pill value={props.label} label={props.label} />,
|
|
25
12
|
});
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import figma from '@figma/code-connect';
|
|
2
|
-
import { PillGroup } from '
|
|
2
|
+
import { PillGroup } from '../';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
* -- This file was auto-generated by Code Connect --
|
|
6
|
-
* `props` includes a mapping from your code props to Figma properties.
|
|
7
|
-
* You should check this is correct, and update the `example` function
|
|
8
|
-
* to return the code example you'd like to see in Figma
|
|
9
|
-
*/
|
|
4
|
+
const value = '';
|
|
10
5
|
|
|
11
6
|
figma.connect(
|
|
12
7
|
PillGroup,
|
|
13
8
|
'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=4348%3A15988',
|
|
14
9
|
{
|
|
15
10
|
props: {
|
|
16
|
-
// These props were automatically mapped based on your linked code:
|
|
17
11
|
wrap: figma.boolean('Wrap?'),
|
|
12
|
+
pills: figma.children('Pill'),
|
|
18
13
|
},
|
|
19
|
-
example: props =>
|
|
14
|
+
example: props => (
|
|
15
|
+
<PillGroup value={value} wrap={props.wrap}>
|
|
16
|
+
{props.pills}
|
|
17
|
+
</PillGroup>
|
|
18
|
+
),
|
|
20
19
|
}
|
|
21
20
|
);
|
|
@@ -1,30 +1,19 @@
|
|
|
1
1
|
import figma from '@figma/code-connect';
|
|
2
|
-
import ProgressStep from '
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* -- This file was auto-generated by Code Connect --
|
|
6
|
-
* `props` includes a mapping from your code props to Figma properties.
|
|
7
|
-
* You should check this is correct, and update the `example` function
|
|
8
|
-
* to return the code example you'd like to see in Figma
|
|
9
|
-
*/
|
|
2
|
+
import { ProgressStep } from '../';
|
|
10
3
|
|
|
11
4
|
figma.connect(
|
|
12
5
|
ProgressStep,
|
|
13
6
|
'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=6056%3A1987',
|
|
14
7
|
{
|
|
15
8
|
props: {
|
|
16
|
-
// These props were automatically mapped based on your linked code:
|
|
17
9
|
status: figma.enum('State', {
|
|
18
10
|
Complete: 'complete',
|
|
19
11
|
Active: 'active',
|
|
20
12
|
Incomplete: 'incomplete',
|
|
21
13
|
}),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// "label": figma.boolean('Label?'),
|
|
25
|
-
// "stepNumber": figma.string('Step number'),
|
|
26
|
-
// "interactive": figma.boolean('Interactive?')
|
|
14
|
+
label: figma.string('Label'),
|
|
15
|
+
id: figma.string('Step number'),
|
|
27
16
|
},
|
|
28
|
-
example: props => <ProgressStep id={
|
|
17
|
+
example: props => <ProgressStep id={props.id} status={props.status} />,
|
|
29
18
|
}
|
|
30
19
|
);
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import ProgressStepper from
|
|
3
|
-
import figma from "@figma/code-connect"
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* -- This file was auto-generated by Code Connect --
|
|
7
|
-
* None of your props could be automatically mapped to Figma properties.
|
|
8
|
-
* You should update the `props` object to include a mapping from your
|
|
9
|
-
* code props to Figma properties, and update the `example` function to
|
|
10
|
-
* return the code example you'd like to see in Figma
|
|
11
|
-
*/
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import { ProgressStepper } from '../';
|
|
12
3
|
|
|
13
4
|
figma.connect(
|
|
14
5
|
ProgressStepper,
|
|
15
|
-
|
|
6
|
+
'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=6056%3A2000',
|
|
16
7
|
{
|
|
17
|
-
props: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
props: {
|
|
9
|
+
steps: figma.children('Step'),
|
|
10
|
+
},
|
|
11
|
+
example: props => <ProgressStepper>{props.steps}</ProgressStepper>,
|
|
12
|
+
}
|
|
13
|
+
);
|
|
@@ -1,25 +1,38 @@
|
|
|
1
1
|
import figma from '@figma/code-connect';
|
|
2
2
|
import Radio from './Radio';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
figma.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
4
|
+
figma.connect(
|
|
5
|
+
Radio,
|
|
6
|
+
'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=7428-12685&m=dev',
|
|
7
|
+
{
|
|
8
|
+
props: {
|
|
9
|
+
helperText: figma.boolean('Helper text?', {
|
|
10
|
+
true: figma.string('Helper text'),
|
|
11
|
+
}),
|
|
12
|
+
label: figma.string('Label'),
|
|
13
|
+
image: figma.boolean('Image?', {
|
|
14
|
+
true: figma.instance('Radio Image'),
|
|
15
|
+
}),
|
|
16
|
+
state: figma.enum('State', {
|
|
17
|
+
Default: 'default',
|
|
18
|
+
}),
|
|
19
|
+
checked: figma.boolean('Checked?'),
|
|
20
|
+
indicator: figma.nestedProps('Radio Item', {
|
|
21
|
+
disabled: figma.enum('State', {
|
|
22
|
+
Disabled: true,
|
|
23
|
+
}),
|
|
24
|
+
}),
|
|
25
|
+
},
|
|
26
|
+
example: props => (
|
|
27
|
+
<Radio
|
|
28
|
+
label={props.label}
|
|
29
|
+
helperText={props.helperText}
|
|
30
|
+
image={props.image}
|
|
31
|
+
state={props.state}
|
|
32
|
+
checked={props.checked}
|
|
33
|
+
disabled={props.indicator.disabled}
|
|
34
|
+
value="someValue"
|
|
35
|
+
/>
|
|
36
|
+
),
|
|
37
|
+
}
|
|
38
|
+
);
|
|
@@ -1,54 +1,82 @@
|
|
|
1
|
-
import
|
|
2
|
-
import RadioGroup from
|
|
3
|
-
import figma from "@figma/code-connect"
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import { RadioGroup } from '../';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
const props = {
|
|
5
|
+
validationStatus: figma.enum('State', {
|
|
6
|
+
Invalid: 'invalid',
|
|
7
|
+
}),
|
|
8
|
+
labelVariant: figma.enum('Label variant', {
|
|
9
|
+
Body: 'body',
|
|
10
|
+
Heading: 'heading',
|
|
11
|
+
}),
|
|
12
|
+
direction: figma.enum('Direction', {
|
|
13
|
+
Row: 'row',
|
|
14
|
+
}),
|
|
15
|
+
label: figma.string('Group label'),
|
|
16
|
+
helperText: figma.boolean('Helper text?', {
|
|
17
|
+
true: figma.string('Helper text'),
|
|
18
|
+
}),
|
|
19
|
+
invalidText: figma.enum('State', {
|
|
20
|
+
Invalid: figma.string('Validation text'),
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const value = '';
|
|
25
|
+
const setValue = (value: string) => {};
|
|
11
26
|
|
|
12
27
|
figma.connect(
|
|
13
28
|
RadioGroup,
|
|
14
|
-
|
|
29
|
+
'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=3138-13254&t=Uq6QfQcygdNGv5lM-4',
|
|
15
30
|
{
|
|
31
|
+
variant: {
|
|
32
|
+
Content: 'Radio',
|
|
33
|
+
},
|
|
16
34
|
props: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
helperText: figma.string("Helper text"),
|
|
20
|
-
invalidText: figma.string("Helper text"),
|
|
21
|
-
validText: figma.string("Validation text"),
|
|
22
|
-
direction: figma.enum("Direction", {
|
|
23
|
-
Row: "row",
|
|
24
|
-
Column: "column",
|
|
25
|
-
}),
|
|
26
|
-
// No matching props could be found for these Figma properties:
|
|
27
|
-
// "groupLabel": figma.string('Group label'),
|
|
28
|
-
// "helperText": figma.boolean('Helper text?'),
|
|
29
|
-
// "helperText": figma.string('Helper text'),
|
|
30
|
-
// "validationText": figma.string('Validation text'),
|
|
31
|
-
// "state": figma.enum('State', {
|
|
32
|
-
// "Default": "default",
|
|
33
|
-
// "Invalid": "invalid"
|
|
34
|
-
// }),
|
|
35
|
-
// "labelVariant": figma.enum('Label variant', {
|
|
36
|
-
// "Body": "body",
|
|
37
|
-
// "Heading": "heading"
|
|
38
|
-
// }),
|
|
39
|
-
// "content": figma.enum('Content', {
|
|
40
|
-
// "Radio": "radio",
|
|
41
|
-
// "Radio Tile": "radio-tile"
|
|
42
|
-
// })
|
|
35
|
+
...props,
|
|
36
|
+
items: figma.children('Radio'),
|
|
43
37
|
},
|
|
44
|
-
example:
|
|
38
|
+
example: props => (
|
|
45
39
|
<RadioGroup
|
|
46
40
|
label={props.label}
|
|
47
41
|
helperText={props.helperText}
|
|
42
|
+
validationStatus={props.validationStatus}
|
|
43
|
+
labelVariant={props.labelVariant}
|
|
44
|
+
direction={props.direction}
|
|
48
45
|
invalidText={props.invalidText}
|
|
49
|
-
|
|
46
|
+
value={value}
|
|
47
|
+
onChange={value => setValue(value)}
|
|
48
|
+
>
|
|
49
|
+
{props.items}
|
|
50
|
+
</RadioGroup>
|
|
51
|
+
),
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
figma.connect(
|
|
56
|
+
RadioGroup,
|
|
57
|
+
'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=3138-13254&t=Uq6QfQcygdNGv5lM-4',
|
|
58
|
+
{
|
|
59
|
+
variant: {
|
|
60
|
+
Content: 'Radio Tile',
|
|
61
|
+
},
|
|
62
|
+
props: {
|
|
63
|
+
...props,
|
|
64
|
+
items: figma.children('Radio Tile'),
|
|
65
|
+
},
|
|
66
|
+
example: props => (
|
|
67
|
+
<RadioGroup
|
|
68
|
+
label={props.label}
|
|
69
|
+
helperText={props.helperText}
|
|
70
|
+
validationStatus={props.validationStatus}
|
|
71
|
+
labelVariant={props.labelVariant}
|
|
50
72
|
direction={props.direction}
|
|
51
|
-
|
|
73
|
+
invalidText={props.invalidText}
|
|
74
|
+
type="tile"
|
|
75
|
+
value={value}
|
|
76
|
+
onChange={value => setValue(value)}
|
|
77
|
+
>
|
|
78
|
+
{props.items}
|
|
79
|
+
</RadioGroup>
|
|
52
80
|
),
|
|
53
|
-
}
|
|
54
|
-
)
|
|
81
|
+
}
|
|
82
|
+
);
|