@utilitywarehouse/hearth-react-native 0.16.0 → 0.16.2
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 +67 -4
- package/CHANGELOG.md +30 -0
- package/build/components/Avatar/Avatar.js +0 -2
- package/build/components/Banner/Banner.d.ts +1 -1
- package/build/components/Banner/Banner.js +3 -1
- package/build/components/Carousel/Carousel.js +1 -1
- 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 +22 -1
- package/build/components/DateInput/DateInputSegment.d.ts +2 -16
- package/build/components/DateInput/DateInputSegment.js +2 -5
- package/build/components/DatePicker/DatePicker.js +8 -4
- package/build/components/DatePicker/DatePickerHeader/DatePickerHeader.props.d.ts +0 -1
- package/build/components/DatePicker/DatePickerHeader/index.js +1 -1
- package/build/components/DatePicker/index.d.ts +1 -0
- package/build/components/DatePicker/polyfill.js +3 -3
- package/build/components/DatePicker/time-picker/wheel-web.js +1 -3
- package/build/components/DatePickerInput/DatePickerInput.js +1 -2
- 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 -0
- package/build/components/DescriptionList/DescriptionListItem.d.ts +1 -1
- package/build/components/DescriptionList/DescriptionListItem.js +3 -2
- package/build/components/DescriptionList/DescriptionListItem.props.d.ts +1 -0
- package/build/components/Input/Input.js +1 -1
- package/build/components/Switch/Switch.js +1 -1
- package/build/components/Tabs/Tabs.d.ts +1 -1
- package/build/components/Tabs/Tabs.js +1 -1
- package/build/components/Textarea/Textarea.js +3 -0
- package/build/components/Toast/ToastItem.js +1 -1
- package/build/components/ToggleButton/ToggleButtonIcon.js +1 -1
- package/build/components/ToggleButton/ToggleButtonRoot.js +0 -2
- package/build/components/UnstyledIconButton/UnstyledIconButtonIcon.js +1 -1
- package/build/utils/coloursAsArray.js +1 -1
- package/docs/components/AllComponents.web.tsx +16 -18
- package/docs/components/UsageWrap.tsx +17 -20
- package/eslint.config.js +5 -1
- package/package.json +11 -11
- package/src/components/Accordion/Accordion.figma.tsx +15 -17
- package/src/components/Accordion/AccordionItem.figma.tsx +27 -0
- package/src/components/Avatar/Avatar.figma.tsx +11 -21
- package/src/components/Avatar/Avatar.tsx +0 -2
- package/src/components/Badge/Badge.figma.tsx +45 -54
- package/src/components/Banner/Banner.figma.tsx +21 -13
- package/src/components/Banner/Banner.stories.tsx +4 -4
- package/src/components/Banner/Banner.tsx +2 -1
- package/src/components/Button/Button.figma.tsx +118 -46
- package/src/components/Card/Card.figma.tsx +27 -43
- package/src/components/Card/Card.stories.tsx +1 -1
- package/src/components/Carousel/Carousel.figma.tsx +20 -17
- package/src/components/Carousel/Carousel.tsx +1 -1
- package/src/components/Checkbox/Checkbox.figma.tsx +15 -18
- package/src/components/Checkbox/Checkbox.stories.tsx +2 -2
- package/src/components/Checkbox/CheckboxGroup.figma.tsx +48 -15
- package/src/components/Checkbox/CheckboxTileRoot.figma.tsx +24 -27
- package/src/components/CurrencyInput/CurrencyInput.figma.tsx +65 -49
- package/src/components/DateInput/DateInput.docs.mdx +47 -29
- package/src/components/DateInput/DateInput.figma.tsx +58 -45
- package/src/components/DateInput/DateInput.props.ts +32 -1
- package/src/components/DateInput/DateInput.stories.tsx +10 -0
- package/src/components/DateInput/DateInput.tsx +12 -0
- package/src/components/DateInput/DateInputSegment.tsx +7 -22
- package/src/components/DatePicker/DatePicker.figma.tsx +47 -0
- package/src/components/DatePicker/DatePicker.tsx +8 -4
- package/src/components/DatePicker/DatePickerHeader/DatePickerHeader.props.ts +0 -2
- package/src/components/DatePicker/DatePickerHeader/index.tsx +2 -2
- package/src/components/DatePicker/index.ts +2 -0
- package/src/components/DatePicker/polyfill.ts +3 -3
- package/src/components/DatePicker/time-picker/wheel-web.tsx +0 -1
- package/src/components/DatePickerInput/DatePickerInput.figma.tsx +18 -46
- package/src/components/DatePickerInput/DatePickerInput.tsx +0 -2
- package/src/components/DescriptionList/DescriptionList.docs.mdx +16 -14
- package/src/components/DescriptionList/DescriptionList.figma.tsx +41 -17
- package/src/components/DescriptionList/DescriptionList.props.ts +1 -0
- package/src/components/DescriptionList/DescriptionList.stories.tsx +24 -0
- package/src/components/DescriptionList/DescriptionList.tsx +2 -0
- package/src/components/DescriptionList/DescriptionListItem.figma.tsx +42 -0
- package/src/components/DescriptionList/DescriptionListItem.props.ts +1 -0
- package/src/components/DescriptionList/DescriptionListItem.tsx +7 -0
- package/src/components/Divider/Divider.figma.tsx +10 -23
- package/src/components/Input/Input.tsx +0 -1
- package/src/components/List/List.stories.tsx +1 -4
- package/src/components/Radio/Radio.stories.tsx +1 -1
- package/src/components/Switch/Switch.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +0 -1
- package/src/components/Textarea/Textarea.tsx +3 -0
- package/src/components/ThemedImage/ThemedImage.stories.tsx +14 -14
- package/src/components/Toast/ToastItem.tsx +1 -1
- package/src/components/ToggleButton/ToggleButtonIcon.tsx +1 -1
- package/src/components/ToggleButton/ToggleButtonRoot.tsx +0 -2
- package/src/components/UnstyledIconButton/UnstyledIconButtonIcon.tsx +1 -1
- package/src/utils/coloursAsArray.ts +1 -1
- package/tsconfig.eslint.json +13 -0
- package/src/components/Accordion/AccordionItemRoot.figma.tsx +0 -47
- package/src/components/DatePicker/DatePickerCalendar.figma.tsx +0 -34
|
@@ -13,9 +13,9 @@ import {
|
|
|
13
13
|
ShareSmallIcon,
|
|
14
14
|
TrashSmallIcon,
|
|
15
15
|
} from '@utilitywarehouse/hearth-react-native-icons';
|
|
16
|
-
// @ts-
|
|
16
|
+
// @ts-expect-error - Module missing type declarations
|
|
17
17
|
import SpotBillingDark from '@utilitywarehouse/hearth-svg-assets/lib/spot-billing-dark.svg';
|
|
18
|
-
// @ts-
|
|
18
|
+
// @ts-expect-error - Module missing type declarations
|
|
19
19
|
import SpotBillingLight from '@utilitywarehouse/hearth-svg-assets/lib/spot-billing-light.svg';
|
|
20
20
|
import { Pressable, ScrollView, View, ViewProps } from 'react-native';
|
|
21
21
|
import { StyleSheet } from 'react-native-unistyles';
|
|
@@ -176,6 +176,7 @@ const AllComponents: React.FC = () => {
|
|
|
176
176
|
const handleMenuOpenPress = useCallback(() => {
|
|
177
177
|
menuRef.current?.present();
|
|
178
178
|
}, []);
|
|
179
|
+
const [pillValue, setPillValue] = React.useState<string[]>(['energy', 'mobile']);
|
|
179
180
|
|
|
180
181
|
const [colorMode] = useColorMode();
|
|
181
182
|
const isDark = colorMode === 'dark';
|
|
@@ -648,22 +649,19 @@ const AllComponents: React.FC = () => {
|
|
|
648
649
|
</ComponentWrapper>
|
|
649
650
|
<ComponentWrapper name="Pill Group" link="/?path=/docs/components-pill-group--docs">
|
|
650
651
|
<Center flex={1} p="200">
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
</PillGroup>
|
|
665
|
-
);
|
|
666
|
-
})()}
|
|
652
|
+
(
|
|
653
|
+
<PillGroup
|
|
654
|
+
value={pillValue}
|
|
655
|
+
onChange={v => setPillValue(v as string[])}
|
|
656
|
+
wrap={false}
|
|
657
|
+
multiple
|
|
658
|
+
>
|
|
659
|
+
<Pill value="all" label="All" />
|
|
660
|
+
<Pill value="energy" label="Energy" icon={ElectricityMediumIcon} />
|
|
661
|
+
<Pill value="broadband" label="Broadband" icon={BroadbandMediumIcon} />
|
|
662
|
+
<Pill value="mobile" label="Mobile" icon={MobileMediumIcon} />
|
|
663
|
+
</PillGroup>
|
|
664
|
+
);
|
|
667
665
|
</Center>
|
|
668
666
|
</ComponentWrapper>
|
|
669
667
|
<ComponentWrapper
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
import { BottomSheetModalProvider, Box
|
|
2
|
+
import { BottomSheetModalProvider, Box } from '../../src';
|
|
3
3
|
|
|
4
|
-
const UsageWrap: FC<PropsWithChildren> = ({ children }) =>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
</div>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
4
|
+
const UsageWrap: FC<PropsWithChildren> = ({ children }) => (
|
|
5
|
+
<div className="sb-unstyled">
|
|
6
|
+
<Box
|
|
7
|
+
mt="300"
|
|
8
|
+
p="200"
|
|
9
|
+
bg="backgroundPrimary"
|
|
10
|
+
borderRadius="md"
|
|
11
|
+
borderWidth="1"
|
|
12
|
+
borderColor="borderSubtle"
|
|
13
|
+
width="100%"
|
|
14
|
+
position="relative"
|
|
15
|
+
>
|
|
16
|
+
<BottomSheetModalProvider>{children}</BottomSheetModalProvider>
|
|
17
|
+
</Box>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
23
20
|
|
|
24
21
|
export default UsageWrap;
|
package/eslint.config.js
CHANGED
|
@@ -8,13 +8,17 @@ import globals from 'globals';
|
|
|
8
8
|
import tseslint from 'typescript-eslint';
|
|
9
9
|
|
|
10
10
|
export default tseslint.config(
|
|
11
|
-
{ ignores: ['build', 'dist', 'storybook-static'] },
|
|
11
|
+
{ ignores: ['build', 'dist', 'storybook-static', '**/*.figma.tsx'] },
|
|
12
12
|
{
|
|
13
13
|
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
|
14
14
|
files: ['**/*.{ts,tsx}'],
|
|
15
15
|
languageOptions: {
|
|
16
16
|
ecmaVersion: 2020,
|
|
17
17
|
globals: globals.browser,
|
|
18
|
+
parserOptions: {
|
|
19
|
+
project: './tsconfig.eslint.json',
|
|
20
|
+
tsconfigRootDir: import.meta.dirname,
|
|
21
|
+
},
|
|
18
22
|
},
|
|
19
23
|
plugins: {
|
|
20
24
|
'react-hooks': reactHooks,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilitywarehouse/hearth-react-native",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.2",
|
|
4
4
|
"description": "Utility Warehouse React Native UI library",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -25,18 +25,18 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@babel/plugin-proposal-export-namespace-from": "^7.18.9",
|
|
27
27
|
"@chromatic-com/storybook": "^4.1.3",
|
|
28
|
-
"@figma/code-connect": "^1.3.
|
|
28
|
+
"@figma/code-connect": "^1.3.12",
|
|
29
29
|
"@gorhom/bottom-sheet": "5.2.6",
|
|
30
|
-
"@storybook/addon-a11y": "^10.1
|
|
31
|
-
"@storybook/addon-docs": "^10.1
|
|
32
|
-
"@storybook/addon-vitest": "^10.1
|
|
33
|
-
"@storybook/react-native-web-vite": "^10.1
|
|
30
|
+
"@storybook/addon-a11y": "^10.2.1",
|
|
31
|
+
"@storybook/addon-docs": "^10.2.1",
|
|
32
|
+
"@storybook/addon-vitest": "^10.2.1",
|
|
33
|
+
"@storybook/react-native-web-vite": "^10.2.1",
|
|
34
34
|
"@types/prismjs": "^1.26.5",
|
|
35
35
|
"@types/react": "^19.1.10",
|
|
36
36
|
"@vitest/browser": "^3.2.4",
|
|
37
37
|
"@vitest/coverage-v8": "^3.2.4",
|
|
38
38
|
"chromatic": "^13.3.0",
|
|
39
|
-
"eslint-plugin-storybook": "10.1
|
|
39
|
+
"eslint-plugin-storybook": "10.2.1",
|
|
40
40
|
"playwright": "^1.55.1",
|
|
41
41
|
"prismjs": "^1.30.0",
|
|
42
42
|
"react": "^19.1.0",
|
|
@@ -50,15 +50,15 @@
|
|
|
50
50
|
"react-native-web": "^0.20.0",
|
|
51
51
|
"react-native-worklets": "^0.6.1",
|
|
52
52
|
"remark-gfm": "^4.0.1",
|
|
53
|
-
"storybook": "^10.1
|
|
53
|
+
"storybook": "^10.2.1",
|
|
54
54
|
"typescript": "^5.7.3",
|
|
55
55
|
"vite": "^7.1.3",
|
|
56
56
|
"vite-plugin-svgr": "^4.5.0",
|
|
57
57
|
"vitest": "^3.2.4",
|
|
58
|
-
"@utilitywarehouse/hearth-fonts": "^0.0.4",
|
|
59
58
|
"@utilitywarehouse/hearth-react-icons": "^0.7.4",
|
|
60
59
|
"@utilitywarehouse/hearth-react-native-icons": "^0.7.4",
|
|
61
60
|
"@utilitywarehouse/hearth-svg-assets": "^0.3.0",
|
|
61
|
+
"@utilitywarehouse/hearth-fonts": "^0.0.4",
|
|
62
62
|
"@utilitywarehouse/hearth-tokens": "^0.2.2"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"clean": "rm -rf node_modules rm -rf build .turbo",
|
|
77
77
|
"generateColours": "node ./scripts/generateColours.js",
|
|
78
78
|
"copyTokens": "node ./scripts/copyTokens.js",
|
|
79
|
-
"lint:fix": "TIMING=1 eslint --fix
|
|
80
|
-
"lint": "TIMING=1 eslint
|
|
79
|
+
"lint:fix": "TIMING=1 eslint --fix .",
|
|
80
|
+
"lint": "TIMING=1 eslint .",
|
|
81
81
|
"build": "tsc",
|
|
82
82
|
"watch": "tsc --watch",
|
|
83
83
|
"figma:create": "figma connect create",
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Accordion 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 { Accordion } from './';
|
|
12
3
|
|
|
13
4
|
figma.connect(
|
|
14
5
|
Accordion,
|
|
15
|
-
|
|
6
|
+
'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=3385%3A7751',
|
|
16
7
|
{
|
|
17
8
|
props: {
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
sectionHeader: figma.nestedProps('Section Header', {
|
|
10
|
+
helperText: figma.string('Helper text'),
|
|
11
|
+
heading: figma.string('Heading'),
|
|
12
|
+
}),
|
|
13
|
+
items: figma.children('Accordion Item'),
|
|
20
14
|
},
|
|
21
|
-
example:
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
example: props => (
|
|
16
|
+
<Accordion heading={props.sectionHeader.heading} helperText={props.sectionHeader.helperText}>
|
|
17
|
+
{props.items}
|
|
18
|
+
</Accordion>
|
|
19
|
+
),
|
|
20
|
+
}
|
|
21
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import { BodyText } from '../BodyText';
|
|
3
|
+
import { AccordionItem } from './';
|
|
4
|
+
|
|
5
|
+
figma.connect(
|
|
6
|
+
AccordionItem,
|
|
7
|
+
'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=3390%3A6160',
|
|
8
|
+
{
|
|
9
|
+
props: {
|
|
10
|
+
title: figma.string('Title'),
|
|
11
|
+
expanded: figma.boolean('Expand?'),
|
|
12
|
+
triggerContent: figma.instance('Trigger custom content'),
|
|
13
|
+
description: figma.string('Description'),
|
|
14
|
+
content: figma.instance('Custom content'),
|
|
15
|
+
},
|
|
16
|
+
example: props => (
|
|
17
|
+
<AccordionItem
|
|
18
|
+
title={props.title}
|
|
19
|
+
expanded={props.expanded}
|
|
20
|
+
triggerContent={props.triggerContent}
|
|
21
|
+
>
|
|
22
|
+
<BodyText>{props.description}</BodyText>
|
|
23
|
+
{props.content}
|
|
24
|
+
</AccordionItem>
|
|
25
|
+
),
|
|
26
|
+
}
|
|
27
|
+
);
|
|
@@ -1,33 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Avatar from
|
|
3
|
-
import figma from "@figma/code-connect"
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* -- This file was auto-generated by Code Connect --
|
|
7
|
-
* `props` includes a mapping from your code props to Figma properties.
|
|
8
|
-
* You should check this is correct, and update the `example` function
|
|
9
|
-
* to return the code example you'd like to see in Figma
|
|
10
|
-
*/
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import { Avatar } from '../';
|
|
11
3
|
|
|
12
4
|
figma.connect(
|
|
13
5
|
Avatar,
|
|
14
|
-
|
|
6
|
+
'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=6790-14313',
|
|
15
7
|
{
|
|
16
8
|
props: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"MD-48": "md",
|
|
9
|
+
size: figma.enum('Size', {
|
|
10
|
+
'SM-32': 'sm',
|
|
11
|
+
'MD-48': 'md',
|
|
21
12
|
}),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// "image": figma.instance('Image'),
|
|
13
|
+
initials: figma.string('Initials'),
|
|
14
|
+
image: figma.instance('Image'),
|
|
25
15
|
// "variant": figma.enum('Variant', {
|
|
26
16
|
// "Image": "image",
|
|
27
17
|
// "Initials": "initials",
|
|
28
18
|
// "Icon": "icon"
|
|
29
19
|
// })
|
|
30
20
|
},
|
|
31
|
-
example:
|
|
32
|
-
}
|
|
33
|
-
)
|
|
21
|
+
example: props => <Avatar size={props.size} name={props.initials} image={props.image} />,
|
|
22
|
+
}
|
|
23
|
+
);
|
|
@@ -2,7 +2,6 @@ import { UserMediumIcon, UserSmallIcon } from '@utilitywarehouse/hearth-react-na
|
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { Image, View } from 'react-native';
|
|
4
4
|
import { StyleSheet } from 'react-native-unistyles';
|
|
5
|
-
import { useTheme } from '../../hooks';
|
|
6
5
|
import { getInitials } from '../../utils';
|
|
7
6
|
import BodyText from '../BodyText/BodyText';
|
|
8
7
|
import AvatarProps, { AvatarLoadingStatus } from './Avatar.props';
|
|
@@ -18,7 +17,6 @@ const Avatar = ({
|
|
|
18
17
|
}: AvatarProps) => {
|
|
19
18
|
const [status, setStatus] = useState<AvatarLoadingStatus>('idle');
|
|
20
19
|
const [isDelayed, setIsDelayed] = useState(delayMs > 0);
|
|
21
|
-
const { components } = useTheme();
|
|
22
20
|
|
|
23
21
|
useEffect(() => {
|
|
24
22
|
if (!src) {
|
|
@@ -1,56 +1,47 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Badge from
|
|
3
|
-
import figma from "@figma/code-connect"
|
|
1
|
+
import figma from '@figma/code-connect';
|
|
2
|
+
import { Badge } from '../';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
figma.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}),
|
|
37
|
-
size: figma.enum("Size", {
|
|
38
|
-
"SM-24": "sm",
|
|
39
|
-
"MD-28": "md",
|
|
40
|
-
}),
|
|
41
|
-
flatBase: figma.boolean("Flat Base?"),
|
|
42
|
-
// No matching props could be found for these Figma properties:
|
|
43
|
-
// "icon": figma.boolean('Icon?'),
|
|
44
|
-
// "icon20": figma.instance('Icon-20'),
|
|
45
|
-
// "text": figma.string('Text')
|
|
46
|
-
},
|
|
47
|
-
example: (props) => (
|
|
48
|
-
<Badge
|
|
49
|
-
variant={props.variant}
|
|
50
|
-
colorScheme={props.colorScheme}
|
|
51
|
-
size={props.size}
|
|
52
|
-
flatBase={props.flatBase}
|
|
53
|
-
/>
|
|
54
|
-
),
|
|
4
|
+
figma.connect(Badge, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=61%3A652', {
|
|
5
|
+
props: {
|
|
6
|
+
variant: figma.enum('Variant', {
|
|
7
|
+
'Subtle - Default': 'subtle',
|
|
8
|
+
Emphasis: 'emphasis',
|
|
9
|
+
Outline: 'outline',
|
|
10
|
+
}),
|
|
11
|
+
colorScheme: figma.enum('Color Scheme', {
|
|
12
|
+
Info: 'info',
|
|
13
|
+
Positive: 'positive',
|
|
14
|
+
Danger: 'danger',
|
|
15
|
+
Warning: 'warning',
|
|
16
|
+
Functional: 'functional',
|
|
17
|
+
Energy: 'energy',
|
|
18
|
+
Broadband: 'broadband',
|
|
19
|
+
Mobile: 'mobile',
|
|
20
|
+
Insurance: 'insurance',
|
|
21
|
+
Cashback: 'cashback',
|
|
22
|
+
Pig: 'pig',
|
|
23
|
+
Highlight: 'highlight',
|
|
24
|
+
}),
|
|
25
|
+
size: figma.enum('Size', {
|
|
26
|
+
'SM-24': 'sm',
|
|
27
|
+
'MD-28': 'md',
|
|
28
|
+
}),
|
|
29
|
+
flatBase: figma.boolean('Flat Base?'),
|
|
30
|
+
icon: figma.boolean('Icon?', {
|
|
31
|
+
true: figma.instance('Icon-20'),
|
|
32
|
+
false: '',
|
|
33
|
+
}),
|
|
34
|
+
text: figma.string('Text'),
|
|
55
35
|
},
|
|
56
|
-
|
|
36
|
+
example: props => (
|
|
37
|
+
<Badge
|
|
38
|
+
variant={props.variant}
|
|
39
|
+
colorScheme={props.colorScheme}
|
|
40
|
+
size={props.size}
|
|
41
|
+
flatBase={props.flatBase}
|
|
42
|
+
icon={props.icon}
|
|
43
|
+
>
|
|
44
|
+
{props.text}
|
|
45
|
+
</Badge>
|
|
46
|
+
),
|
|
47
|
+
});
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import figma from '@figma/code-connect';
|
|
2
|
-
import Banner from '
|
|
2
|
+
import { Banner } from '../';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
figma.connect(
|
|
5
|
+
Banner,
|
|
6
|
+
'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=8294-3905&t=wLfy4ZMrZsHup0oB-4',
|
|
7
|
+
{
|
|
8
|
+
props: {
|
|
9
|
+
// irection: figma.enum('Direction', {
|
|
10
|
+
// Horizontal: 'horizontal',
|
|
11
|
+
// Vertical: 'vertical',
|
|
12
|
+
// }),d
|
|
13
|
+
},
|
|
14
|
+
example: props => {
|
|
15
|
+
return (
|
|
16
|
+
// Banner doesn't need to be wrapped in a Card
|
|
17
|
+
// it's a standalone component in code please see the Banner docs
|
|
18
|
+
// https://hearth.prod.uw.systems/react-native/?path=/docs/components-banner--docs
|
|
19
|
+
<Banner heading="The banner heading" description="The text in the banner" />
|
|
20
|
+
);
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
);
|
|
@@ -133,11 +133,11 @@ export const WithIllustration: Story = {
|
|
|
133
133
|
illustration={
|
|
134
134
|
<BannerIllustration
|
|
135
135
|
light={
|
|
136
|
-
// @ts-
|
|
136
|
+
// @ts-expect-error - Illustration SVG import
|
|
137
137
|
<SpotBillingLight width={80} height={80} />
|
|
138
138
|
}
|
|
139
139
|
dark={
|
|
140
|
-
// @ts-
|
|
140
|
+
// @ts-expect-error - Illustration SVG import
|
|
141
141
|
<SpotBillingDark width={80} height={80} />
|
|
142
142
|
}
|
|
143
143
|
/>
|
|
@@ -150,11 +150,11 @@ export const WithIllustration: Story = {
|
|
|
150
150
|
illustration={
|
|
151
151
|
<BannerIllustration
|
|
152
152
|
light={
|
|
153
|
-
// @ts-
|
|
153
|
+
// @ts-expect-error - Illustration SVG import
|
|
154
154
|
<SpotBillingLight width={120} height={120} />
|
|
155
155
|
}
|
|
156
156
|
dark={
|
|
157
|
-
// @ts-
|
|
157
|
+
// @ts-expect-error - Illustration SVG import
|
|
158
158
|
<SpotBillingDark width={120} height={120} />
|
|
159
159
|
}
|
|
160
160
|
/>
|