@utilitywarehouse/hearth-react-native 0.3.0 → 0.3.1
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +3 -1
- package/CHANGELOG.md +12 -0
- package/build/components/Alert/AlertCloseButton.js +25 -3
- package/build/components/Alert/AlertIcon.js +17 -1
- package/build/components/Alert/AlertIconButton.js +27 -1
- package/build/components/Alert/AlertLink.js +47 -1
- package/build/components/Alert/AlertText.d.ts +1 -1
- package/build/components/Alert/AlertText.js +26 -2
- package/build/components/Alert/AlertTitle.d.ts +1 -1
- package/build/components/Alert/AlertTitle.js +26 -2
- package/build/components/Badge/BadgeIcon.js +72 -0
- package/build/components/Badge/BadgeText.js +72 -0
- package/build/components/Button/ButtonRoot.js +1 -0
- package/build/components/Checkbox/Checkbox.d.ts +2 -2
- package/build/components/Checkbox/Checkbox.js +11 -10
- package/build/components/Checkbox/Checkbox.props.d.ts +3 -1
- package/build/components/Checkbox/CheckboxIcon.js +1 -1
- package/build/components/Checkbox/CheckboxImage.d.ts +6 -0
- package/build/components/Checkbox/CheckboxImage.js +5 -0
- package/build/components/Checkbox/CheckboxTileRoot.js +1 -1
- package/build/components/Checkbox/index.d.ts +3 -2
- package/build/components/Checkbox/index.js +2 -1
- package/build/components/Link/Link.d.ts +1 -1
- package/build/components/Link/Link.js +4 -4
- package/build/components/Link/Link.props.d.ts +3 -0
- package/build/components/Radio/Radio.d.ts +2 -2
- package/build/components/Radio/Radio.js +9 -8
- package/build/components/Radio/Radio.props.d.ts +3 -1
- package/build/components/Radio/RadioImage.d.ts +6 -0
- package/build/components/Radio/RadioImage.js +5 -0
- package/build/components/Radio/RadioTileRoot.js +1 -1
- package/build/components/Radio/index.d.ts +3 -2
- package/build/components/Radio/index.js +2 -1
- package/build/components/Select/SelectOption.js +1 -7
- package/build/components/UnstyledIconButton/UnstyledIconButton.d.ts +1 -1
- package/build/components/UnstyledIconButton/UnstyledIconButton.js +4 -4
- package/build/components/UnstyledIconButton/UnstyledIconButton.props.d.ts +2 -1
- package/build/core/themes.d.ts +12 -12
- package/build/tokens/color.d.ts +12 -12
- package/build/tokens/color.js +6 -6
- package/build/tokens/components/dark/alert.d.ts +13 -0
- package/build/tokens/components/dark/alert.js +13 -0
- package/build/tokens/components/dark/checkbox.d.ts +3 -0
- package/build/tokens/components/dark/checkbox.js +3 -0
- package/build/tokens/components/dark/icon-button.d.ts +7 -0
- package/build/tokens/components/dark/icon-button.js +7 -0
- package/build/tokens/components/dark/index.d.ts +1 -0
- package/build/tokens/components/dark/index.js +1 -0
- package/build/tokens/components/dark/link.d.ts +5 -0
- package/build/tokens/components/dark/link.js +5 -0
- package/build/tokens/components/dark/progress-bar.d.ts +41 -0
- package/build/tokens/components/dark/progress-bar.js +40 -0
- package/build/tokens/components/light/alert.d.ts +13 -0
- package/build/tokens/components/light/alert.js +13 -0
- package/build/tokens/components/light/checkbox.d.ts +3 -0
- package/build/tokens/components/light/checkbox.js +3 -0
- package/build/tokens/components/light/icon-button.d.ts +7 -0
- package/build/tokens/components/light/icon-button.js +7 -0
- package/build/tokens/components/light/index.d.ts +1 -0
- package/build/tokens/components/light/index.js +1 -0
- package/build/tokens/components/light/link.d.ts +5 -0
- package/build/tokens/components/light/link.js +5 -0
- package/build/tokens/components/light/progress-bar.d.ts +41 -0
- package/build/tokens/components/light/progress-bar.js +40 -0
- package/build/tokens/index.d.ts +1 -0
- package/build/tokens/index.js +1 -0
- package/build/tokens/motion.d.ts +23 -0
- package/build/tokens/motion.js +22 -0
- package/build/tokens/primitive.d.ts +19 -0
- package/build/tokens/primitive.js +19 -0
- package/build/tokens/semantic-dark.d.ts +5 -5
- package/build/tokens/semantic-dark.js +5 -5
- package/build/tokens/semantic-light.d.ts +1 -1
- package/build/tokens/semantic-light.js +1 -1
- package/docs/assets/bank-logo.png +0 -0
- package/docs/assets/bank-logo1.png +0 -0
- package/docs/components/index.ts +6 -7
- package/docs/introduction.mdx +3 -3
- package/package.json +12 -11
- package/src/components/Alert/AlertCloseButton.tsx +33 -5
- package/src/components/Alert/AlertIcon.tsx +17 -1
- package/src/components/Alert/AlertIconButton.tsx +37 -4
- package/src/components/Alert/AlertLink.tsx +52 -1
- package/src/components/Alert/AlertText.tsx +28 -3
- package/src/components/Alert/AlertTitle.tsx +28 -3
- package/src/components/Badge/BadgeIcon.tsx +72 -0
- package/src/components/Badge/BadgeText.tsx +72 -0
- package/src/components/Button/ButtonRoot.tsx +1 -0
- package/src/components/Checkbox/Checkbox.docs.mdx +45 -7
- package/src/components/Checkbox/Checkbox.props.ts +3 -1
- package/src/components/Checkbox/Checkbox.stories.tsx +37 -1
- package/src/components/Checkbox/Checkbox.tsx +12 -9
- package/src/components/Checkbox/CheckboxIcon.tsx +1 -1
- package/src/components/Checkbox/CheckboxImage.tsx +9 -0
- package/src/components/Checkbox/CheckboxTileRoot.tsx +1 -1
- package/src/components/Checkbox/index.ts +3 -2
- package/src/components/IconContainer/IconContainer.docs.mdx +4 -4
- package/src/components/Link/Link.props.ts +3 -0
- package/src/components/Link/Link.tsx +12 -6
- package/src/components/List/List.docs.mdx +24 -23
- package/src/components/Radio/Radio.docs.mdx +96 -124
- package/src/components/Radio/Radio.props.ts +3 -1
- package/src/components/Radio/Radio.stories.tsx +47 -0
- package/src/components/Radio/Radio.tsx +10 -7
- package/src/components/Radio/RadioImage.tsx +9 -0
- package/src/components/Radio/RadioTileRoot.tsx +1 -1
- package/src/components/Radio/index.ts +3 -2
- package/src/components/Select/Select.docs.mdx +6 -6
- package/src/components/Select/Select.stories.tsx +7 -7
- package/src/components/Select/SelectOption.tsx +4 -10
- package/src/components/UnstyledIconButton/UnstyledIconButton.props.ts +2 -1
- package/src/components/UnstyledIconButton/UnstyledIconButton.tsx +9 -3
- package/src/tokens/color.ts +6 -6
- package/src/tokens/components/dark/alert.ts +13 -0
- package/src/tokens/components/dark/checkbox.ts +3 -0
- package/src/tokens/components/dark/icon-button.ts +7 -0
- package/src/tokens/components/dark/index.ts +1 -0
- package/src/tokens/components/dark/link.ts +5 -0
- package/src/tokens/components/dark/progress-bar.ts +41 -0
- package/src/tokens/components/light/alert.ts +13 -0
- package/src/tokens/components/light/checkbox.ts +3 -0
- package/src/tokens/components/light/icon-button.ts +7 -0
- package/src/tokens/components/light/index.ts +1 -0
- package/src/tokens/components/light/link.ts +5 -0
- package/src/tokens/components/light/progress-bar.ts +41 -0
- package/src/tokens/index.ts +1 -0
- package/src/tokens/motion.ts +23 -0
- package/src/tokens/primitive.ts +19 -0
- package/src/tokens/semantic-dark.ts +5 -5
- package/src/tokens/semantic-light.ts +1 -1
- package/docs/assets/react-native-pig.png +0 -0
- package/docs/components/AdvancedRadioExample.tsx +0 -126
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as Stories from './Select.stories';
|
|
3
|
-
import { Select, SelectOption, FormField, Center } from '../../';
|
|
1
|
+
import { Canvas, Controls, Meta, Story } from '@storybook/addon-docs/blocks';
|
|
4
2
|
import { UserSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
5
|
-
import {
|
|
3
|
+
import { Center, FormField, Select, SelectOption } from '../../';
|
|
4
|
+
import { BackToTopButton, UsageWrap, ViewFigmaButton } from '../../../docs/components';
|
|
5
|
+
import * as Stories from './Select.stories';
|
|
6
6
|
|
|
7
7
|
<Meta title="Forms / Select" />
|
|
8
8
|
|
|
@@ -195,7 +195,7 @@ import { Select, SelectOption } from '@utilitywarehouse/hearth-react-native';
|
|
|
195
195
|
import {
|
|
196
196
|
UserSmallIcon,
|
|
197
197
|
HeartSmallIcon,
|
|
198
|
-
|
|
198
|
+
EyeSmallIcon,
|
|
199
199
|
} from '@utilitywarehouse/hearth-react-native-icons';
|
|
200
200
|
import { useState } from 'react';
|
|
201
201
|
|
|
@@ -211,7 +211,7 @@ const MyComponent = () => {
|
|
|
211
211
|
>
|
|
212
212
|
<SelectOption label="Home option" value="home" leadingIcon={UserSmallIcon} />
|
|
213
213
|
<SelectOption label="Car option" value="car" leadingIcon={HeartSmallIcon} />
|
|
214
|
-
<SelectOption label="World option" value="world" leadingIcon={
|
|
214
|
+
<SelectOption label="World option" value="world" leadingIcon={EyeSmallIcon} />
|
|
215
215
|
</Select>
|
|
216
216
|
);
|
|
217
217
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { Meta } from '@storybook/react-vite';
|
|
2
|
-
import React, { useState } from 'react';
|
|
3
|
-
import Select from './Select';
|
|
4
|
-
import SelectOption from './SelectOption';
|
|
5
|
-
import { FormField } from '../FormField';
|
|
6
2
|
import {
|
|
7
|
-
|
|
3
|
+
EyeSmallIcon,
|
|
8
4
|
HeartSmallIcon,
|
|
9
|
-
|
|
5
|
+
UserSmallIcon,
|
|
10
6
|
} from '@utilitywarehouse/hearth-react-native-icons';
|
|
7
|
+
import { useState } from 'react';
|
|
11
8
|
import { Box } from '../Box';
|
|
12
9
|
import { Button } from '../Button';
|
|
10
|
+
import { FormField } from '../FormField';
|
|
11
|
+
import Select from './Select';
|
|
12
|
+
import SelectOption from './SelectOption';
|
|
13
13
|
|
|
14
14
|
const meta = {
|
|
15
15
|
title: 'Stories / Select',
|
|
@@ -269,7 +269,7 @@ export const WithInlineOptions = () => {
|
|
|
269
269
|
>
|
|
270
270
|
<SelectOption label="Home option" value="home" leadingIcon={UserSmallIcon} />
|
|
271
271
|
<SelectOption label="Car option" value="car" leadingIcon={HeartSmallIcon} />
|
|
272
|
-
<SelectOption label="World option" value="world" leadingIcon={
|
|
272
|
+
<SelectOption label="World option" value="world" leadingIcon={EyeSmallIcon} />
|
|
273
273
|
</Select>
|
|
274
274
|
);
|
|
275
275
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TickSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
2
|
-
import { Pressable, View
|
|
2
|
+
import { Pressable, View } from 'react-native';
|
|
3
3
|
import { StyleSheet } from 'react-native-unistyles';
|
|
4
4
|
import { BodyText } from '../BodyText';
|
|
5
5
|
import { Icon } from '../Icon';
|
|
@@ -42,10 +42,7 @@ const SelectOption = ({
|
|
|
42
42
|
>
|
|
43
43
|
{!!LeftIcon && (
|
|
44
44
|
<View>
|
|
45
|
-
{
|
|
46
|
-
const IconAny = Icon as any;
|
|
47
|
-
return <IconAny style={styles.icon as ViewStyle} as={LeftIcon} />;
|
|
48
|
-
})()}
|
|
45
|
+
<Icon as={LeftIcon} style={styles.icon} />
|
|
49
46
|
</View>
|
|
50
47
|
)}
|
|
51
48
|
|
|
@@ -55,15 +52,12 @@ const SelectOption = ({
|
|
|
55
52
|
|
|
56
53
|
{isSelected && (
|
|
57
54
|
<View>
|
|
58
|
-
<TickSmallIcon style={styles.icon
|
|
55
|
+
<Icon as={TickSmallIcon} style={styles.icon} />
|
|
59
56
|
</View>
|
|
60
57
|
)}
|
|
61
58
|
{!!RightIcon && !isSelected && (
|
|
62
59
|
<View>
|
|
63
|
-
{
|
|
64
|
-
const IconAny = Icon as any;
|
|
65
|
-
return <IconAny style={styles.icon as ViewStyle} as={RightIcon} />;
|
|
66
|
-
})()}
|
|
60
|
+
<Icon as={RightIcon} style={styles.icon} />
|
|
67
61
|
</View>
|
|
68
62
|
)}
|
|
69
63
|
</Pressable>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
|
-
import type { PressableProps } from 'react-native';
|
|
2
|
+
import type { PressableProps, ViewProps } from 'react-native';
|
|
3
3
|
|
|
4
4
|
export type UnstyledIconButtonProps = {
|
|
5
5
|
/*
|
|
@@ -29,4 +29,5 @@ export type UnstyledIconButtonProps = {
|
|
|
29
29
|
*/
|
|
30
30
|
inverted?: boolean;
|
|
31
31
|
children?: React.ReactNode;
|
|
32
|
+
iconStyle?: ViewProps['style'];
|
|
32
33
|
} & PressableProps;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { createButton } from '@gluestack-ui/button';
|
|
2
|
+
import { ViewStyle } from 'react-native';
|
|
3
|
+
import { useButtonGroupContext } from '../Button/ButtonGroup.context';
|
|
2
4
|
import { UnstyledIconButtonProps } from './UnstyledIconButton.props';
|
|
3
|
-
import UnstyledIconButtonRootComponent from './UnstyledIconButtonRoot';
|
|
4
5
|
import UnstyledIconButtonIconComponent from './UnstyledIconButtonIcon';
|
|
6
|
+
import UnstyledIconButtonRootComponent from './UnstyledIconButtonRoot';
|
|
5
7
|
import UnstyledIconButtonSpinerComponent from './UnstyledIconButtonSpinner';
|
|
6
|
-
import { useButtonGroupContext } from '../Button/ButtonGroup.context';
|
|
7
8
|
|
|
8
9
|
const UnstyledIconButtonComponent = createButton({
|
|
9
10
|
Root: UnstyledIconButtonRootComponent,
|
|
@@ -25,6 +26,7 @@ const UnstyledIconButton = ({
|
|
|
25
26
|
pressed,
|
|
26
27
|
size = 'md',
|
|
27
28
|
inverted = false,
|
|
29
|
+
iconStyle,
|
|
28
30
|
...props
|
|
29
31
|
}: UnstyledIconButtonProps) => {
|
|
30
32
|
const { disabled: groupDisabled, loading: groupLoading } = useButtonGroupContext();
|
|
@@ -41,7 +43,11 @@ const UnstyledIconButton = ({
|
|
|
41
43
|
isPressed={pressed}
|
|
42
44
|
icon={icon}
|
|
43
45
|
>
|
|
44
|
-
{loading ?
|
|
46
|
+
{loading ? (
|
|
47
|
+
<UnstyledIconButtonSpinner />
|
|
48
|
+
) : (
|
|
49
|
+
<UnstyledIconButtonIcon as={icon} style={iconStyle as ViewStyle} />
|
|
50
|
+
)}
|
|
45
51
|
</UnstyledIconButtonComponent>
|
|
46
52
|
);
|
|
47
53
|
};
|
package/src/tokens/color.ts
CHANGED
|
@@ -473,13 +473,13 @@ export const light = {
|
|
|
473
473
|
brand: '#7a42c8',
|
|
474
474
|
inverted: '#fcfbf2',
|
|
475
475
|
primary: '#101010',
|
|
476
|
-
secondary: '#
|
|
476
|
+
secondary: '#5b5b5b',
|
|
477
477
|
},
|
|
478
478
|
} as const;
|
|
479
479
|
|
|
480
480
|
export const dark = {
|
|
481
481
|
background: {
|
|
482
|
-
brand: '#
|
|
482
|
+
brand: '#7a42c8',
|
|
483
483
|
primary: '#191917',
|
|
484
484
|
secondary: '#232323',
|
|
485
485
|
},
|
|
@@ -555,7 +555,7 @@ export const dark = {
|
|
|
555
555
|
interactive: {
|
|
556
556
|
affirmative: {
|
|
557
557
|
border: {
|
|
558
|
-
strong: '#
|
|
558
|
+
strong: '#101010',
|
|
559
559
|
subtle: '#58ca93',
|
|
560
560
|
},
|
|
561
561
|
foreground: {
|
|
@@ -591,7 +591,7 @@ export const dark = {
|
|
|
591
591
|
},
|
|
592
592
|
destructive: {
|
|
593
593
|
border: {
|
|
594
|
-
strong: '#
|
|
594
|
+
strong: '#101010',
|
|
595
595
|
subtle: '#ff7964',
|
|
596
596
|
},
|
|
597
597
|
foreground: {
|
|
@@ -639,7 +639,7 @@ export const dark = {
|
|
|
639
639
|
},
|
|
640
640
|
highlight: {
|
|
641
641
|
border: {
|
|
642
|
-
strong: '#
|
|
642
|
+
strong: '#101010',
|
|
643
643
|
},
|
|
644
644
|
foreground: {
|
|
645
645
|
strong: '#101010',
|
|
@@ -719,7 +719,7 @@ export const dark = {
|
|
|
719
719
|
text: {
|
|
720
720
|
affirmative: '#58ca93',
|
|
721
721
|
brand: '#af90de',
|
|
722
|
-
inverted: '#
|
|
722
|
+
inverted: '#fcfbf2',
|
|
723
723
|
primary: '#ebebeb',
|
|
724
724
|
secondary: '#b2afae',
|
|
725
725
|
},
|
|
@@ -6,6 +6,19 @@ export default {
|
|
|
6
6
|
borderRadius: 8,
|
|
7
7
|
borderWidth: 2,
|
|
8
8
|
contentGap: 4,
|
|
9
|
+
focus: '#101010',
|
|
9
10
|
gap: 8,
|
|
11
|
+
iconButton: {
|
|
12
|
+
unstyled: {
|
|
13
|
+
foregroundColor: '#101010',
|
|
14
|
+
foregroundColorActive: '#3f3f3f',
|
|
15
|
+
foregroundColorHover: '#3a3837',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
link: {
|
|
19
|
+
color: '#101010',
|
|
20
|
+
colorActive: '#3f3f3f',
|
|
21
|
+
colorHover: '#3a3837',
|
|
22
|
+
},
|
|
10
23
|
padding: 14,
|
|
11
24
|
} as const;
|
|
@@ -34,6 +34,7 @@ export { default as overlay } from './overlay';
|
|
|
34
34
|
export { default as pagination } from './pagination';
|
|
35
35
|
export { default as parts } from './parts';
|
|
36
36
|
export { default as pill } from './pill';
|
|
37
|
+
export { default as progressBar } from './progress-bar';
|
|
37
38
|
export { default as progressStepper } from './progress-stepper';
|
|
38
39
|
export { default as radio } from './radio';
|
|
39
40
|
export { default as sectionHeader } from './section-header';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
barColor: '#4c473d',
|
|
7
|
+
circular: {
|
|
8
|
+
md: {
|
|
9
|
+
bar: {
|
|
10
|
+
width: 12,
|
|
11
|
+
},
|
|
12
|
+
gap: 0,
|
|
13
|
+
height: 140,
|
|
14
|
+
label: {
|
|
15
|
+
fontFamily: 'DM Sans',
|
|
16
|
+
fontSize: 24,
|
|
17
|
+
fontWeight: 400,
|
|
18
|
+
lineHeight: 24,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
sm: {
|
|
22
|
+
barWidth: 8,
|
|
23
|
+
height: 80,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
linear: {
|
|
27
|
+
bar: {
|
|
28
|
+
borderRadius: 9999,
|
|
29
|
+
height: 12,
|
|
30
|
+
},
|
|
31
|
+
gap: 8,
|
|
32
|
+
label: {
|
|
33
|
+
gap: 8,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
progress: {
|
|
37
|
+
dangerColor: '#ff634a',
|
|
38
|
+
defaultColor: '#c6b5e2',
|
|
39
|
+
successColor: '#36bf7d',
|
|
40
|
+
},
|
|
41
|
+
} as const;
|
|
@@ -6,6 +6,19 @@ export default {
|
|
|
6
6
|
borderRadius: 8,
|
|
7
7
|
borderWidth: 2,
|
|
8
8
|
contentGap: 4,
|
|
9
|
+
focus: '#101010',
|
|
9
10
|
gap: 8,
|
|
11
|
+
iconButton: {
|
|
12
|
+
unstyled: {
|
|
13
|
+
foregroundColor: '#101010',
|
|
14
|
+
foregroundColorActive: '#3f3f3f',
|
|
15
|
+
foregroundColorHover: '#3a3837',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
link: {
|
|
19
|
+
color: '#101010',
|
|
20
|
+
colorActive: '#3f3f3f',
|
|
21
|
+
colorHover: '#3a3837',
|
|
22
|
+
},
|
|
10
23
|
padding: 14,
|
|
11
24
|
} as const;
|
|
@@ -34,6 +34,7 @@ export { default as overlay } from './overlay';
|
|
|
34
34
|
export { default as pagination } from './pagination';
|
|
35
35
|
export { default as parts } from './parts';
|
|
36
36
|
export { default as pill } from './pill';
|
|
37
|
+
export { default as progressBar } from './progress-bar';
|
|
37
38
|
export { default as progressStepper } from './progress-stepper';
|
|
38
39
|
export { default as radio } from './radio';
|
|
39
40
|
export { default as sectionHeader } from './section-header';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
barColor: '#f1efe4',
|
|
7
|
+
circular: {
|
|
8
|
+
md: {
|
|
9
|
+
bar: {
|
|
10
|
+
width: 12,
|
|
11
|
+
},
|
|
12
|
+
gap: 0,
|
|
13
|
+
height: 140,
|
|
14
|
+
label: {
|
|
15
|
+
fontFamily: 'DM Sans',
|
|
16
|
+
fontSize: 24,
|
|
17
|
+
fontWeight: 400,
|
|
18
|
+
lineHeight: 24,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
sm: {
|
|
22
|
+
barWidth: 8,
|
|
23
|
+
height: 80,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
linear: {
|
|
27
|
+
bar: {
|
|
28
|
+
borderRadius: 9999,
|
|
29
|
+
height: 12,
|
|
30
|
+
},
|
|
31
|
+
gap: 8,
|
|
32
|
+
label: {
|
|
33
|
+
gap: 8,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
progress: {
|
|
37
|
+
dangerColor: '#f4412a',
|
|
38
|
+
defaultColor: '#26164f',
|
|
39
|
+
successColor: '#19a660',
|
|
40
|
+
},
|
|
41
|
+
} as const;
|
package/src/tokens/index.ts
CHANGED
|
@@ -14,6 +14,7 @@ export { default as borderWidth } from './border-width';
|
|
|
14
14
|
export { default as font } from './font';
|
|
15
15
|
export { default as letterSpacing } from './letter-spacing';
|
|
16
16
|
export { default as lineHeight } from './line-height';
|
|
17
|
+
export { default as motion } from './motion';
|
|
17
18
|
export { default as space } from './space';
|
|
18
19
|
export { default as typography } from './typography';
|
|
19
20
|
export * as components from './components';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
duration: {
|
|
7
|
+
'100': 130,
|
|
8
|
+
'200': 160,
|
|
9
|
+
'300': 190,
|
|
10
|
+
'400': 220,
|
|
11
|
+
'500': 250,
|
|
12
|
+
'600': 300,
|
|
13
|
+
'700': 350,
|
|
14
|
+
'800': 400,
|
|
15
|
+
'900': 450,
|
|
16
|
+
'1000': 500,
|
|
17
|
+
},
|
|
18
|
+
ease: {
|
|
19
|
+
in: 'cubic-bezier(0.42, 0, 1, 1)',
|
|
20
|
+
inOut: 'cubic-bezier(0, 0, 1, 1)',
|
|
21
|
+
out: 'cubic-bezier(0.19, 0.91, 0.38, 1)',
|
|
22
|
+
},
|
|
23
|
+
} as const;
|
package/src/tokens/primitive.ts
CHANGED
|
@@ -82,6 +82,25 @@ export default {
|
|
|
82
82
|
'1100': 72,
|
|
83
83
|
'1200': 90,
|
|
84
84
|
},
|
|
85
|
+
motion: {
|
|
86
|
+
duration: {
|
|
87
|
+
'100': 130,
|
|
88
|
+
'200': 160,
|
|
89
|
+
'300': 190,
|
|
90
|
+
'400': 220,
|
|
91
|
+
'500': 250,
|
|
92
|
+
'600': 300,
|
|
93
|
+
'700': 350,
|
|
94
|
+
'800': 400,
|
|
95
|
+
'900': 450,
|
|
96
|
+
'1000': 500,
|
|
97
|
+
},
|
|
98
|
+
ease: {
|
|
99
|
+
in: 'cubic-bezier(0.42, 0, 1, 1)',
|
|
100
|
+
inOut: 'cubic-bezier(0, 0, 1, 1)',
|
|
101
|
+
out: 'cubic-bezier(0.19, 0.91, 0.38, 1)',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
85
104
|
space: {
|
|
86
105
|
'0': 0,
|
|
87
106
|
'25': 2,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
background: {
|
|
7
|
-
brand: '#
|
|
7
|
+
brand: '#7a42c8',
|
|
8
8
|
primary: '#191917',
|
|
9
9
|
secondary: '#232323',
|
|
10
10
|
},
|
|
@@ -80,7 +80,7 @@ export default {
|
|
|
80
80
|
interactive: {
|
|
81
81
|
affirmative: {
|
|
82
82
|
border: {
|
|
83
|
-
strong: '#
|
|
83
|
+
strong: '#101010',
|
|
84
84
|
subtle: '#58ca93',
|
|
85
85
|
},
|
|
86
86
|
foreground: {
|
|
@@ -116,7 +116,7 @@ export default {
|
|
|
116
116
|
},
|
|
117
117
|
destructive: {
|
|
118
118
|
border: {
|
|
119
|
-
strong: '#
|
|
119
|
+
strong: '#101010',
|
|
120
120
|
subtle: '#ff7964',
|
|
121
121
|
},
|
|
122
122
|
foreground: {
|
|
@@ -164,7 +164,7 @@ export default {
|
|
|
164
164
|
},
|
|
165
165
|
highlight: {
|
|
166
166
|
border: {
|
|
167
|
-
strong: '#
|
|
167
|
+
strong: '#101010',
|
|
168
168
|
},
|
|
169
169
|
foreground: {
|
|
170
170
|
strong: '#101010',
|
|
@@ -247,7 +247,7 @@ export default {
|
|
|
247
247
|
text: {
|
|
248
248
|
affirmative: '#58ca93',
|
|
249
249
|
brand: '#af90de',
|
|
250
|
-
inverted: '#
|
|
250
|
+
inverted: '#fcfbf2',
|
|
251
251
|
primary: '#ebebeb',
|
|
252
252
|
secondary: '#b2afae',
|
|
253
253
|
},
|
|
Binary file
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { TickSmallIcon } from '@utilitywarehouse/hearth-react-native-icons';
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
Badge,
|
|
5
|
-
BodyText,
|
|
6
|
-
Box,
|
|
7
|
-
Heading,
|
|
8
|
-
Radio,
|
|
9
|
-
RadioGroup,
|
|
10
|
-
RadioIcon,
|
|
11
|
-
RadioIndicator,
|
|
12
|
-
type RadioProps as NativeUIRadioProps,
|
|
13
|
-
} from '../../src';
|
|
14
|
-
|
|
15
|
-
import { TextProps, ViewProps } from 'react-native';
|
|
16
|
-
import { StyleSheet } from 'react-native-unistyles';
|
|
17
|
-
|
|
18
|
-
interface RadioProps {
|
|
19
|
-
currentValue: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const styles = StyleSheet.create(({ colorMode, color, borderRadius, borderWidth, space }) => ({
|
|
23
|
-
radio: {
|
|
24
|
-
borderWidth: borderWidth[2],
|
|
25
|
-
borderColor: colorMode === 'light' ? color.grey[500] : color.grey[700],
|
|
26
|
-
borderRadius: borderRadius.xl,
|
|
27
|
-
padding: space[200],
|
|
28
|
-
variants: {
|
|
29
|
-
checked: {
|
|
30
|
-
true: {
|
|
31
|
-
borderColor: colorMode === 'light' ? color.green[500] : color.green[700],
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
indicator: {
|
|
37
|
-
variants: {
|
|
38
|
-
checked: {
|
|
39
|
-
true: {
|
|
40
|
-
backgroundColor: colorMode === 'light' ? color.green[500] : color.green[700],
|
|
41
|
-
borderColor: colorMode === 'light' ? color.green[500] : color.green[700],
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
heading: {
|
|
47
|
-
marginBottom: space[100],
|
|
48
|
-
},
|
|
49
|
-
badge: {
|
|
50
|
-
marginRight: space[200],
|
|
51
|
-
alignSelf: 'flex-end',
|
|
52
|
-
},
|
|
53
|
-
}));
|
|
54
|
-
|
|
55
|
-
const CustomRadio = ({
|
|
56
|
-
children,
|
|
57
|
-
currentValue,
|
|
58
|
-
...props
|
|
59
|
-
}: RadioProps &
|
|
60
|
-
Omit<
|
|
61
|
-
NativeUIRadioProps,
|
|
62
|
-
'label' | 'helperText' | 'helperIcon' | 'invalidText' | 'validText' | 'showValidationIcon'
|
|
63
|
-
>) => {
|
|
64
|
-
styles.useVariants({ checked: currentValue === props.value });
|
|
65
|
-
return (
|
|
66
|
-
<Radio style={styles.radio} {...props}>
|
|
67
|
-
<Box flexDirection="row" flex={1}>
|
|
68
|
-
<Box pr="200" flex={1}>
|
|
69
|
-
{children}
|
|
70
|
-
</Box>
|
|
71
|
-
<RadioIndicator style={styles.indicator}>
|
|
72
|
-
<RadioIcon as={TickSmallIcon} color="white" />
|
|
73
|
-
</RadioIndicator>
|
|
74
|
-
</Box>
|
|
75
|
-
</Radio>
|
|
76
|
-
);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const BulletListItem = ({ children }: { children: TextProps['children'] }) => (
|
|
80
|
-
<BodyText>
|
|
81
|
-
{'\u2022'} {children}
|
|
82
|
-
</BodyText>
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
const BulletList = ({ children }: { children: ViewProps['children'] }) => (
|
|
86
|
-
<Box pl="200" gap="100">
|
|
87
|
-
{children}
|
|
88
|
-
</Box>
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
const AdvancedRadioExample = () => {
|
|
92
|
-
const [value, setValue] = useState('Option 1');
|
|
93
|
-
|
|
94
|
-
const handleChange = (val: string) => setValue(val);
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<RadioGroup onChange={handleChange} value={value} gap="200">
|
|
98
|
-
<Box>
|
|
99
|
-
<Badge colorScheme={value === 'Option 1' ? 'green' : 'grey'} flatBase style={styles.badge}>
|
|
100
|
-
Recommended
|
|
101
|
-
</Badge>
|
|
102
|
-
<CustomRadio value="Option 1" currentValue={value}>
|
|
103
|
-
<Heading size="md" style={styles.heading}>
|
|
104
|
-
Instant bank transfer
|
|
105
|
-
</Heading>
|
|
106
|
-
<BulletList>
|
|
107
|
-
<BulletListItem>Receive your money instantly</BulletListItem>
|
|
108
|
-
<BulletListItem>No fees</BulletListItem>
|
|
109
|
-
<BulletListItem>Available 24/7</BulletListItem>
|
|
110
|
-
</BulletList>
|
|
111
|
-
</CustomRadio>
|
|
112
|
-
</Box>
|
|
113
|
-
<CustomRadio value="Option 2" currentValue={value}>
|
|
114
|
-
<Heading size="md" style={styles.heading}>
|
|
115
|
-
Debit card payment
|
|
116
|
-
</Heading>
|
|
117
|
-
<BulletList>
|
|
118
|
-
<BulletListItem>£0.35 fee</BulletListItem>
|
|
119
|
-
<BulletListItem>Available 24/7</BulletListItem>
|
|
120
|
-
</BulletList>
|
|
121
|
-
</CustomRadio>
|
|
122
|
-
</RadioGroup>
|
|
123
|
-
);
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
export default AdvancedRadioExample;
|