@utilitywarehouse/hearth-react-native 0.4.2 → 0.6.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/main.ts +21 -1
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-lint.log +1 -1
- package/CHANGELOG.md +52 -0
- package/build/components/Alert/AlertTitle.js +6 -6
- package/build/components/Badge/Badge.js +3 -3
- package/build/components/Badge/Badge.props.d.ts +1 -0
- package/build/components/Button/ButtonRoot.js +4 -0
- package/build/components/Button/ButtonText.js +2 -2
- package/build/components/Card/CardRoot.js +1 -1
- package/build/components/Carousel/Carousel.context.d.ts +4 -0
- package/build/components/Carousel/Carousel.context.js +4 -0
- package/build/components/Carousel/Carousel.d.ts +6 -0
- package/build/components/Carousel/Carousel.js +278 -0
- package/build/components/Carousel/Carousel.props.d.ts +65 -0
- package/build/components/Carousel/Carousel.props.js +1 -0
- package/build/components/Carousel/CarouselControlItem.d.ts +24 -0
- package/build/components/Carousel/CarouselControlItem.js +64 -0
- package/build/components/Carousel/CarouselControls.d.ts +4 -0
- package/build/components/Carousel/CarouselControls.js +74 -0
- package/build/components/Carousel/CarouselItem.d.ts +6 -0
- package/build/components/Carousel/CarouselItem.js +38 -0
- package/build/components/Carousel/index.d.ts +5 -0
- package/build/components/Carousel/index.js +5 -0
- package/build/components/Container/Container.d.ts +6 -0
- package/build/components/Container/Container.js +40 -0
- package/build/components/Container/Container.props.d.ts +85 -0
- package/build/components/Container/Container.props.js +1 -0
- package/build/components/Container/index.d.ts +2 -0
- package/build/components/Container/index.js +1 -0
- package/build/components/DescriptionList/DescriptionList.d.ts +1 -1
- package/build/components/DescriptionList/DescriptionList.js +2 -2
- package/build/components/DescriptionList/DescriptionList.props.d.ts +1 -8
- package/build/components/DescriptionList/DescriptionListItem.d.ts +1 -1
- package/build/components/DescriptionList/DescriptionListItem.js +4 -3
- package/build/components/DescriptionList/DescriptionListItem.props.d.ts +3 -8
- package/build/components/IndicatorIconButton/IndicatorIconButton.d.ts +6 -0
- package/build/components/IndicatorIconButton/IndicatorIconButton.js +26 -0
- package/build/components/IndicatorIconButton/IndicatorIconButton.props.d.ts +8 -0
- package/build/components/IndicatorIconButton/IndicatorIconButton.props.js +1 -0
- package/build/components/IndicatorIconButton/index.d.ts +2 -0
- package/build/components/IndicatorIconButton/index.js +1 -0
- package/build/components/Link/LinkText.js +3 -3
- package/build/components/List/List.context.d.ts +0 -2
- package/build/components/List/List.d.ts +1 -1
- package/build/components/List/List.js +5 -5
- package/build/components/List/List.props.d.ts +1 -9
- package/build/components/List/ListAction/ListAction.d.ts +18 -0
- package/build/components/List/ListAction/ListAction.js +103 -0
- package/build/components/List/ListAction/ListAction.props.d.ts +8 -0
- package/build/components/List/ListAction/ListAction.props.js +1 -0
- package/build/components/List/ListAction/ListActionContent.d.ts +6 -0
- package/build/components/List/ListAction/ListActionContent.js +14 -0
- package/build/components/List/ListAction/ListActionText.d.ts +6 -0
- package/build/components/List/ListAction/ListActionText.js +7 -0
- package/build/components/List/ListAction/ListActionTrailingContent.d.ts +6 -0
- package/build/components/List/ListAction/ListActionTrailingContent.js +5 -0
- package/build/components/List/ListAction/ListActionTrailingIcon.d.ts +9 -0
- package/build/components/List/ListAction/ListActionTrailingIcon.js +18 -0
- package/build/components/List/ListAction/index.d.ts +6 -0
- package/build/components/List/ListAction/index.js +5 -0
- package/build/components/List/ListItem/ListItem.context.d.ts +1 -1
- package/build/components/List/ListItem/ListItem.props.d.ts +9 -5
- package/build/components/List/ListItem/ListItemRoot.d.ts +1 -1
- package/build/components/List/ListItem/ListItemRoot.js +10 -12
- package/build/components/List/ListItem/index.d.ts +4 -4
- package/build/components/List/ListItem/index.js +3 -3
- package/build/components/List/index.d.ts +1 -0
- package/build/components/List/index.js +1 -0
- package/build/components/ProgressStepper/ProgressStep.d.ts +10 -0
- package/build/components/ProgressStepper/ProgressStep.js +100 -0
- package/build/components/ProgressStepper/ProgressStepper.d.ts +6 -0
- package/build/components/ProgressStepper/ProgressStepper.js +22 -0
- package/build/components/ProgressStepper/ProgressStepper.props.d.ts +22 -0
- package/build/components/ProgressStepper/ProgressStepper.props.js +1 -0
- package/build/components/ProgressStepper/ProgressStepperRoot.d.ts +6 -0
- package/build/components/ProgressStepper/ProgressStepperRoot.js +16 -0
- package/build/components/ProgressStepper/index.d.ts +3 -0
- package/build/components/ProgressStepper/index.js +2 -0
- package/build/components/SectionHeader/SectionHeader.d.ts +1 -1
- package/build/components/SectionHeader/SectionHeader.js +6 -3
- package/build/components/SectionHeader/SectionHeader.props.d.ts +9 -16
- package/build/components/SectionHeader/SectionHeaderTrailingContent.d.ts +6 -0
- package/build/components/SectionHeader/SectionHeaderTrailingContent.js +13 -0
- package/build/components/SectionHeader/index.d.ts +1 -0
- package/build/components/SectionHeader/index.js +1 -0
- package/build/components/Tabs/Tab.js +2 -2
- package/build/components/ThemedImage/ThemedImage.d.ts +12 -0
- package/build/components/ThemedImage/ThemedImage.js +27 -0
- package/build/components/ThemedImage/ThemedImage.props.d.ts +13 -0
- package/build/components/ThemedImage/ThemedImage.props.js +1 -0
- package/build/components/ThemedImage/index.d.ts +2 -0
- package/build/components/ThemedImage/index.js +1 -0
- package/build/components/ToggleButton/ToggleButtonText.js +2 -2
- package/build/components/UnstyledIconButton/UnstyledIconButton.props.d.ts +4 -1
- package/build/components/index.d.ts +5 -0
- package/build/components/index.js +5 -0
- package/build/core/themes.d.ts +12 -24
- package/build/hooks/useStyleProps.js +1 -1
- package/build/tokens/components/dark/button.d.ts +1 -1
- package/build/tokens/components/dark/button.js +1 -1
- package/build/tokens/components/dark/dialog.d.ts +1 -0
- package/build/tokens/components/dark/dialog.js +1 -0
- package/build/tokens/components/dark/illustrations.d.ts +1 -0
- package/build/tokens/components/dark/illustrations.js +1 -0
- package/build/tokens/components/dark/toast.d.ts +4 -1
- package/build/tokens/components/dark/toast.js +4 -1
- package/build/tokens/components/light/button.d.ts +1 -1
- package/build/tokens/components/light/button.js +1 -1
- package/build/tokens/components/light/dialog.d.ts +1 -0
- package/build/tokens/components/light/dialog.js +1 -0
- package/build/tokens/components/light/illustrations.d.ts +1 -0
- package/build/tokens/components/light/illustrations.js +1 -0
- package/build/tokens/components/light/toast.d.ts +4 -1
- package/build/tokens/components/light/toast.js +4 -1
- package/build/tokens/layout.d.ts +6 -12
- package/build/tokens/layout.js +3 -6
- package/docs/components/AllComponents.web.tsx +122 -5
- package/docs/components/BadgeList.tsx +20 -56
- package/docs/components/SwitchList.tsx +4 -8
- package/docs/getting-started.mdx +30 -14
- package/docs/introduction.mdx +1 -1
- package/docs/layout-components.docs.mdx +30 -0
- package/package.json +6 -4
- package/src/components/Alert/AlertTitle.tsx +7 -7
- package/src/components/Badge/Badge.props.ts +1 -0
- package/src/components/Badge/Badge.tsx +3 -2
- package/src/components/Button/ButtonRoot.tsx +4 -0
- package/src/components/Button/ButtonText.tsx +3 -3
- package/src/components/Card/CardRoot.tsx +2 -0
- package/src/components/Carousel/Carousel.context.tsx +8 -0
- package/src/components/Carousel/Carousel.docs.mdx +389 -0
- package/src/components/Carousel/Carousel.props.ts +89 -0
- package/src/components/Carousel/Carousel.stories.tsx +317 -0
- package/src/components/Carousel/Carousel.tsx +444 -0
- package/src/components/Carousel/CarouselControlItem.tsx +87 -0
- package/src/components/Carousel/CarouselControls.tsx +150 -0
- package/src/components/Carousel/CarouselItem.tsx +68 -0
- package/src/components/Carousel/index.ts +6 -0
- package/src/components/Container/Container.docs.mdx +168 -0
- package/src/components/Container/Container.props.ts +89 -0
- package/src/components/Container/Container.stories.tsx +274 -0
- package/src/components/Container/Container.tsx +52 -0
- package/src/components/Container/index.tsx +2 -0
- package/src/components/DescriptionList/DescriptionList.docs.mdx +24 -27
- package/src/components/DescriptionList/DescriptionList.props.ts +1 -8
- package/src/components/DescriptionList/DescriptionList.stories.tsx +13 -19
- package/src/components/DescriptionList/DescriptionList.tsx +2 -14
- package/src/components/DescriptionList/DescriptionListItem.props.ts +3 -8
- package/src/components/DescriptionList/DescriptionListItem.tsx +13 -21
- package/src/components/IndicatorIconButton/IndicatorIconButton.docs.mdx +85 -0
- package/src/components/IndicatorIconButton/IndicatorIconButton.props.ts +12 -0
- package/src/components/IndicatorIconButton/IndicatorIconButton.stories.tsx +142 -0
- package/src/components/IndicatorIconButton/IndicatorIconButton.tsx +36 -0
- package/src/components/IndicatorIconButton/index.tsx +2 -0
- package/src/components/Link/LinkText.tsx +4 -4
- package/src/components/List/List.context.ts +0 -1
- package/src/components/List/List.docs.mdx +376 -179
- package/src/components/List/List.props.ts +1 -9
- package/src/components/List/List.stories.tsx +289 -38
- package/src/components/List/List.tsx +5 -26
- package/src/components/List/ListAction/ListAction.props.ts +10 -0
- package/src/components/List/ListAction/ListAction.tsx +133 -0
- package/src/components/List/ListAction/ListActionContent.tsx +21 -0
- package/src/components/List/ListAction/ListActionText.tsx +14 -0
- package/src/components/List/ListAction/ListActionTrailingContent.tsx +9 -0
- package/src/components/List/ListAction/ListActionTrailingIcon.tsx +32 -0
- package/src/components/List/ListAction/index.ts +6 -0
- package/src/components/List/ListItem/ListItem.context.ts +1 -1
- package/src/components/List/ListItem/ListItem.props.ts +9 -5
- package/src/components/List/ListItem/ListItemRoot.tsx +18 -14
- package/src/components/List/ListItem/index.ts +4 -4
- package/src/components/List/index.ts +1 -0
- package/src/components/ProgressStepper/ProgressStep.tsx +134 -0
- package/src/components/ProgressStepper/ProgressStepper.docs.mdx +87 -0
- package/src/components/ProgressStepper/ProgressStepper.props.ts +27 -0
- package/src/components/ProgressStepper/ProgressStepper.stories.tsx +108 -0
- package/src/components/ProgressStepper/ProgressStepper.tsx +26 -0
- package/src/components/ProgressStepper/ProgressStepperRoot.tsx +32 -0
- package/src/components/ProgressStepper/index.ts +3 -0
- package/src/components/SectionHeader/SectionHeader.props.ts +9 -16
- package/src/components/SectionHeader/SectionHeader.stories.tsx +28 -18
- package/src/components/SectionHeader/SectionHeader.tsx +18 -19
- package/src/components/SectionHeader/SectionHeaderTrailingContent.tsx +20 -0
- package/src/components/SectionHeader/Sectionheader.docs.mdx +9 -24
- package/src/components/SectionHeader/index.ts +1 -0
- package/src/components/Switch/Switch.docs.mdx +0 -4
- package/src/components/Tabs/Tab.tsx +4 -2
- package/src/components/ThemedImage/ThemedImage.docs.mdx +208 -0
- package/src/components/ThemedImage/ThemedImage.props.ts +15 -0
- package/src/components/ThemedImage/ThemedImage.stories.tsx +175 -0
- package/src/components/ThemedImage/ThemedImage.tsx +34 -0
- package/src/components/ThemedImage/index.tsx +2 -0
- package/src/components/ToggleButton/ToggleButtonText.tsx +3 -3
- package/src/components/UnstyledIconButton/UnstyledIconButton.props.ts +2 -1
- package/src/components/index.ts +5 -0
- package/src/hooks/useStyleProps.ts +1 -1
- package/src/tokens/components/dark/button.ts +1 -1
- package/src/tokens/components/dark/dialog.ts +1 -0
- package/src/tokens/components/dark/illustrations.ts +1 -0
- package/src/tokens/components/dark/toast.ts +4 -1
- package/src/tokens/components/light/button.ts +1 -1
- package/src/tokens/components/light/dialog.ts +1 -0
- package/src/tokens/components/light/illustrations.ts +1 -0
- package/src/tokens/components/light/toast.ts +4 -1
- package/src/tokens/layout.ts +3 -6
- package/src/vite-env.d.ts +6 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import MascotEnergyDark from '@utilitywarehouse/hearth-svg-assets/lib/mascot-energy-dark.svg';
|
|
3
|
+
import MascotEnergyLight from '@utilitywarehouse/hearth-svg-assets/lib/mascot-energy-light.svg';
|
|
4
|
+
import SceneBroadbandDark from '@utilitywarehouse/hearth-svg-assets/lib/scene-broadband-dark.svg';
|
|
5
|
+
import SceneBroadbandLight from '@utilitywarehouse/hearth-svg-assets/lib/scene-broadband-light.svg';
|
|
6
|
+
import SpotBillingDark from '@utilitywarehouse/hearth-svg-assets/lib/spot-billing-dark.svg';
|
|
7
|
+
import SpotBillingLight from '@utilitywarehouse/hearth-svg-assets/lib/spot-billing-light.svg';
|
|
8
|
+
import { SvgProps } from 'react-native-svg';
|
|
9
|
+
import pig from '../../../docs/assets/pigs.png';
|
|
10
|
+
import { Box } from '../Box';
|
|
11
|
+
import { ThemedImage } from './';
|
|
12
|
+
|
|
13
|
+
const meta: Meta<typeof ThemedImage> = {
|
|
14
|
+
title: 'Stories / ThemedImage',
|
|
15
|
+
component: ThemedImage,
|
|
16
|
+
argTypes: {},
|
|
17
|
+
parameters: {
|
|
18
|
+
docs: {
|
|
19
|
+
description: {
|
|
20
|
+
component:
|
|
21
|
+
'ThemedImage component that automatically switches between light and dark mode images or SVG components based on the current theme.',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default meta;
|
|
28
|
+
|
|
29
|
+
type Story = StoryObj<typeof ThemedImage>;
|
|
30
|
+
|
|
31
|
+
export const Playground: Story = {
|
|
32
|
+
args: {},
|
|
33
|
+
render: () => (
|
|
34
|
+
<Box gap="200">
|
|
35
|
+
<ThemedImage
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
light={<SpotBillingLight width={200} height={200} />}
|
|
38
|
+
// @ts-ignore
|
|
39
|
+
dark={<SpotBillingDark width={200} height={200} />}
|
|
40
|
+
/>
|
|
41
|
+
</Box>
|
|
42
|
+
),
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const WithSpotIllustrations: Story = {
|
|
46
|
+
parameters: {
|
|
47
|
+
controls: { include: [] },
|
|
48
|
+
},
|
|
49
|
+
render: () => (
|
|
50
|
+
<Box flexDirection="row" flexWrap="wrap" gap="200">
|
|
51
|
+
<ThemedImage
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
light={<SpotBillingLight width={120} height={120} />}
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
dark={<SpotBillingDark width={120} height={120} />}
|
|
56
|
+
/>
|
|
57
|
+
</Box>
|
|
58
|
+
),
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const WithMascots: Story = {
|
|
62
|
+
parameters: {
|
|
63
|
+
controls: { include: [] },
|
|
64
|
+
},
|
|
65
|
+
render: () => (
|
|
66
|
+
<Box flexDirection="row" flexWrap="wrap" gap="200" alignItems="center">
|
|
67
|
+
<ThemedImage
|
|
68
|
+
light={MascotEnergyLight as unknown as React.FC<SvgProps>}
|
|
69
|
+
dark={MascotEnergyDark as unknown as React.FC<SvgProps>}
|
|
70
|
+
width={120}
|
|
71
|
+
height={120}
|
|
72
|
+
/>
|
|
73
|
+
</Box>
|
|
74
|
+
),
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const WithSceneIllustrations: Story = {
|
|
78
|
+
parameters: {
|
|
79
|
+
controls: { include: [] },
|
|
80
|
+
},
|
|
81
|
+
render: () => (
|
|
82
|
+
<Box gap="200">
|
|
83
|
+
<ThemedImage
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
light={<SceneBroadbandLight width={300} height={200} />}
|
|
86
|
+
// @ts-ignore
|
|
87
|
+
dark={<SceneBroadbandDark width={300} height={200} />}
|
|
88
|
+
/>
|
|
89
|
+
</Box>
|
|
90
|
+
),
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const WithRegularImages: Story = {
|
|
94
|
+
parameters: {
|
|
95
|
+
controls: { include: [] },
|
|
96
|
+
docs: {
|
|
97
|
+
description: {
|
|
98
|
+
story:
|
|
99
|
+
'ThemedImage also works with regular image sources (using `require` or `uri`), not just SVG components.',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
render: () => (
|
|
104
|
+
<Box gap="200">
|
|
105
|
+
<ThemedImage
|
|
106
|
+
light={{
|
|
107
|
+
uri: pig,
|
|
108
|
+
}}
|
|
109
|
+
dark={{
|
|
110
|
+
uri: pig,
|
|
111
|
+
}}
|
|
112
|
+
width={200}
|
|
113
|
+
height={200}
|
|
114
|
+
style={{ width: 200, height: 200, borderRadius: 8 }}
|
|
115
|
+
/>
|
|
116
|
+
</Box>
|
|
117
|
+
),
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const WithCustomSize: Story = {
|
|
121
|
+
parameters: {
|
|
122
|
+
controls: { include: [] },
|
|
123
|
+
docs: {
|
|
124
|
+
description: {
|
|
125
|
+
story: 'When using SVG components, control their size with width and height props.',
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
render: () => (
|
|
130
|
+
<Box flexDirection="row" flexWrap="wrap" gap="200" alignItems="center">
|
|
131
|
+
<ThemedImage
|
|
132
|
+
// @ts-ignore
|
|
133
|
+
light={<SpotBillingLight width={80} height={80} />}
|
|
134
|
+
// @ts-ignore
|
|
135
|
+
dark={<SpotBillingDark width={80} height={80} />}
|
|
136
|
+
/>
|
|
137
|
+
<ThemedImage
|
|
138
|
+
// @ts-ignore
|
|
139
|
+
light={<SpotBillingLight width={120} height={120} />}
|
|
140
|
+
// @ts-ignore
|
|
141
|
+
dark={<SpotBillingDark width={120} height={120} />}
|
|
142
|
+
/>
|
|
143
|
+
<ThemedImage
|
|
144
|
+
// @ts-ignore
|
|
145
|
+
light={<SpotBillingLight width={160} height={160} />}
|
|
146
|
+
// @ts-ignore
|
|
147
|
+
dark={<SpotBillingDark width={160} height={160} />}
|
|
148
|
+
/>
|
|
149
|
+
</Box>
|
|
150
|
+
),
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export const WithAccessibility: Story = {
|
|
154
|
+
parameters: {
|
|
155
|
+
controls: { include: [] },
|
|
156
|
+
docs: {
|
|
157
|
+
description: {
|
|
158
|
+
story:
|
|
159
|
+
'ThemedImage supports all standard Image accessibility props like `accessibilityLabel` and `accessible`.',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
render: () => (
|
|
164
|
+
<Box gap="200">
|
|
165
|
+
<ThemedImage
|
|
166
|
+
// @ts-ignore
|
|
167
|
+
light={<MascotEnergyLight width={150} height={150} />}
|
|
168
|
+
// @ts-ignore
|
|
169
|
+
dark={<MascotEnergyDark width={150} height={150} />}
|
|
170
|
+
accessible={true}
|
|
171
|
+
accessibilityLabel="Energy service mascot illustration"
|
|
172
|
+
/>
|
|
173
|
+
</Box>
|
|
174
|
+
),
|
|
175
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { isValidElement } from 'react';
|
|
2
|
+
import { Image } from 'react-native';
|
|
3
|
+
import useColorMode from '../../hooks/useColorMode';
|
|
4
|
+
import type ThemedImageProps from './ThemedImage.props';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* ThemedImage component that displays different images or components based on the current theme
|
|
8
|
+
* @param light - Image source or SVG component to display in light mode
|
|
9
|
+
* @param dark - Image source or SVG component to display in dark mode
|
|
10
|
+
* @param ...rest - All other Image props including width/height for SVG components
|
|
11
|
+
*/
|
|
12
|
+
const ThemedImage = ({ light, dark, ...props }: ThemedImageProps) => {
|
|
13
|
+
const [colorMode] = useColorMode();
|
|
14
|
+
|
|
15
|
+
const source = colorMode === 'light' ? light : dark;
|
|
16
|
+
|
|
17
|
+
// If the source is a React element (like an SVG component), render it directly
|
|
18
|
+
if (isValidElement(source)) {
|
|
19
|
+
return source;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// If the source is a component type (function/class), instantiate it with props
|
|
23
|
+
if (typeof source === 'function') {
|
|
24
|
+
const Source = source as React.ComponentType<any>;
|
|
25
|
+
return <Source {...props} />;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Otherwise, render as a regular Image with the source
|
|
29
|
+
return <Image source={source} {...props} />;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
ThemedImage.displayName = 'ThemedImage';
|
|
33
|
+
|
|
34
|
+
export default ThemedImage;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type TextProps } from 'react-native';
|
|
2
2
|
import { StyleSheet } from 'react-native-unistyles';
|
|
3
|
-
import {
|
|
3
|
+
import { BodyText } from '../BodyText';
|
|
4
4
|
|
|
5
5
|
const ToggleButtonText = ({ children, toggled, ...props }: TextProps & { toggled: boolean }) => {
|
|
6
6
|
styles.useVariants({ toggled });
|
|
7
7
|
return (
|
|
8
|
-
<
|
|
8
|
+
<BodyText size="md" weight="semibold" {...props} style={[styles.text, props.style]}>
|
|
9
9
|
{children}
|
|
10
|
-
</
|
|
10
|
+
</BodyText>
|
|
11
11
|
);
|
|
12
12
|
};
|
|
13
13
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
2
|
import type { PressableProps, ViewProps } from 'react-native';
|
|
3
|
+
import { ColorValue } from '../../types';
|
|
3
4
|
|
|
4
5
|
export type UnstyledIconButtonProps = {
|
|
5
6
|
/*
|
|
@@ -29,5 +30,5 @@ export type UnstyledIconButtonProps = {
|
|
|
29
30
|
*/
|
|
30
31
|
inverted?: boolean;
|
|
31
32
|
children?: React.ReactNode;
|
|
32
|
-
iconStyle?: ViewProps['style'];
|
|
33
|
+
iconStyle?: ViewProps['style'] & { color?: ColorValue };
|
|
33
34
|
} & PressableProps;
|
package/src/components/index.ts
CHANGED
|
@@ -7,8 +7,10 @@ export * from './BottomSheet';
|
|
|
7
7
|
export * from './Box';
|
|
8
8
|
export * from './Button';
|
|
9
9
|
export * from './Card';
|
|
10
|
+
export * from './Carousel';
|
|
10
11
|
export * from './Center';
|
|
11
12
|
export * from './Checkbox';
|
|
13
|
+
export * from './Container';
|
|
12
14
|
export * from './CurrencyInput';
|
|
13
15
|
export * from './DatePicker';
|
|
14
16
|
export * from './DatePickerInput';
|
|
@@ -24,12 +26,14 @@ export * from './HTMLElements';
|
|
|
24
26
|
export * from './Icon';
|
|
25
27
|
export * from './IconButton';
|
|
26
28
|
export * from './IconContainer';
|
|
29
|
+
export * from './IndicatorIconButton';
|
|
27
30
|
export * from './InlineLink';
|
|
28
31
|
export * from './Input';
|
|
29
32
|
export * from './Label';
|
|
30
33
|
export * from './Link';
|
|
31
34
|
export * from './List';
|
|
32
35
|
export * from './Modal';
|
|
36
|
+
export * from './ProgressStepper';
|
|
33
37
|
export * from './Radio';
|
|
34
38
|
export * from './RadioCard';
|
|
35
39
|
export * from './SectionHeader';
|
|
@@ -39,6 +43,7 @@ export * from './Spinner';
|
|
|
39
43
|
export * from './Switch';
|
|
40
44
|
export * from './Tabs';
|
|
41
45
|
export * from './Textarea';
|
|
46
|
+
export * from './ThemedImage';
|
|
42
47
|
export * from './ToggleButtonCard';
|
|
43
48
|
|
|
44
49
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { ViewStyle } from 'react-native';
|
|
3
|
-
import useTheme from './useTheme';
|
|
4
3
|
import { propStyleMapping, resolveThemeValue, themeStyleMapping, viewStyleProps } from '../utils';
|
|
4
|
+
import useTheme from './useTheme';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Type for the return value from useStyleProps
|
package/src/tokens/layout.ts
CHANGED
|
@@ -8,8 +8,8 @@ export const mobile = {
|
|
|
8
8
|
minWidth: 320,
|
|
9
9
|
},
|
|
10
10
|
container: {
|
|
11
|
+
margin: 16,
|
|
11
12
|
paddingBottom: 32,
|
|
12
|
-
paddingHorizontal: 16,
|
|
13
13
|
paddingTop: 24,
|
|
14
14
|
width: 360,
|
|
15
15
|
},
|
|
@@ -18,7 +18,6 @@ export const mobile = {
|
|
|
18
18
|
columnWidth: 64,
|
|
19
19
|
gridSize: 8,
|
|
20
20
|
gutter: 16,
|
|
21
|
-
margin: 16,
|
|
22
21
|
},
|
|
23
22
|
spacing: {
|
|
24
23
|
'2xl': 28,
|
|
@@ -38,8 +37,8 @@ export const tablet = {
|
|
|
38
37
|
minWidth: 740,
|
|
39
38
|
},
|
|
40
39
|
container: {
|
|
40
|
+
margin: 32,
|
|
41
41
|
paddingBottom: 32,
|
|
42
|
-
paddingHorizontal: 32,
|
|
43
42
|
paddingTop: 24,
|
|
44
43
|
width: 744,
|
|
45
44
|
},
|
|
@@ -48,7 +47,6 @@ export const tablet = {
|
|
|
48
47
|
columnWidth: 64,
|
|
49
48
|
gridSize: 8,
|
|
50
49
|
gutter: 24,
|
|
51
|
-
margin: 32,
|
|
52
50
|
},
|
|
53
51
|
spacing: {
|
|
54
52
|
'2xl': 28,
|
|
@@ -68,8 +66,8 @@ export const desktop = {
|
|
|
68
66
|
minWidth: 992,
|
|
69
67
|
},
|
|
70
68
|
container: {
|
|
69
|
+
margin: 32,
|
|
71
70
|
paddingBottom: 48,
|
|
72
|
-
paddingHorizontal: 32,
|
|
73
71
|
paddingTop: 32,
|
|
74
72
|
width: 1096,
|
|
75
73
|
},
|
|
@@ -78,7 +76,6 @@ export const desktop = {
|
|
|
78
76
|
columnWidth: 64,
|
|
79
77
|
gridSize: 8,
|
|
80
78
|
gutter: 24,
|
|
81
|
-
margin: 32,
|
|
82
79
|
},
|
|
83
80
|
spacing: {
|
|
84
81
|
'2xl': 40,
|
package/src/vite-env.d.ts
CHANGED