@utilitywarehouse/hearth-react-native 0.16.0 → 0.16.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.
Files changed (90) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-lint.log +67 -4
  3. package/CHANGELOG.md +6 -0
  4. package/build/components/Avatar/Avatar.js +0 -2
  5. package/build/components/Banner/Banner.d.ts +1 -1
  6. package/build/components/Banner/Banner.js +3 -1
  7. package/build/components/Carousel/Carousel.js +1 -1
  8. package/build/components/DateInput/DateInput.js +1 -0
  9. package/build/components/DateInput/DateInputSegment.js +2 -2
  10. package/build/components/DatePicker/DatePicker.js +8 -4
  11. package/build/components/DatePicker/DatePickerHeader/DatePickerHeader.props.d.ts +0 -1
  12. package/build/components/DatePicker/DatePickerHeader/index.js +1 -1
  13. package/build/components/DatePicker/index.d.ts +1 -0
  14. package/build/components/DatePicker/polyfill.js +3 -3
  15. package/build/components/DatePicker/time-picker/wheel-web.js +1 -3
  16. package/build/components/DatePickerInput/DatePickerInput.js +1 -2
  17. package/build/components/DescriptionList/DescriptionList.d.ts +1 -1
  18. package/build/components/DescriptionList/DescriptionList.js +2 -2
  19. package/build/components/DescriptionList/DescriptionList.props.d.ts +1 -0
  20. package/build/components/DescriptionList/DescriptionListItem.d.ts +1 -1
  21. package/build/components/DescriptionList/DescriptionListItem.js +3 -2
  22. package/build/components/DescriptionList/DescriptionListItem.props.d.ts +1 -0
  23. package/build/components/Input/Input.js +1 -1
  24. package/build/components/Switch/Switch.js +1 -1
  25. package/build/components/Tabs/Tabs.d.ts +1 -1
  26. package/build/components/Tabs/Tabs.js +1 -1
  27. package/build/components/Textarea/Textarea.js +3 -0
  28. package/build/components/Toast/ToastItem.js +1 -1
  29. package/build/components/ToggleButton/ToggleButtonIcon.js +1 -1
  30. package/build/components/ToggleButton/ToggleButtonRoot.js +0 -2
  31. package/build/components/UnstyledIconButton/UnstyledIconButtonIcon.js +1 -1
  32. package/build/utils/coloursAsArray.js +1 -1
  33. package/docs/components/AllComponents.web.tsx +16 -18
  34. package/docs/components/UsageWrap.tsx +17 -20
  35. package/eslint.config.js +5 -1
  36. package/package.json +10 -10
  37. package/src/components/Accordion/Accordion.figma.tsx +15 -17
  38. package/src/components/Accordion/AccordionItem.figma.tsx +27 -0
  39. package/src/components/Avatar/Avatar.figma.tsx +11 -21
  40. package/src/components/Avatar/Avatar.tsx +0 -2
  41. package/src/components/Badge/Badge.figma.tsx +45 -54
  42. package/src/components/Banner/Banner.figma.tsx +21 -13
  43. package/src/components/Banner/Banner.stories.tsx +4 -4
  44. package/src/components/Banner/Banner.tsx +2 -1
  45. package/src/components/Button/Button.figma.tsx +118 -46
  46. package/src/components/Card/Card.figma.tsx +27 -43
  47. package/src/components/Card/Card.stories.tsx +1 -1
  48. package/src/components/Carousel/Carousel.figma.tsx +20 -17
  49. package/src/components/Carousel/Carousel.tsx +1 -1
  50. package/src/components/Checkbox/Checkbox.figma.tsx +15 -18
  51. package/src/components/Checkbox/Checkbox.stories.tsx +2 -2
  52. package/src/components/Checkbox/CheckboxGroup.figma.tsx +48 -15
  53. package/src/components/Checkbox/CheckboxTileRoot.figma.tsx +24 -27
  54. package/src/components/CurrencyInput/CurrencyInput.figma.tsx +65 -49
  55. package/src/components/DateInput/DateInput.figma.tsx +58 -45
  56. package/src/components/DateInput/DateInput.tsx +1 -0
  57. package/src/components/DateInput/DateInputSegment.tsx +2 -2
  58. package/src/components/DatePicker/DatePicker.figma.tsx +47 -0
  59. package/src/components/DatePicker/DatePicker.tsx +8 -4
  60. package/src/components/DatePicker/DatePickerHeader/DatePickerHeader.props.ts +0 -2
  61. package/src/components/DatePicker/DatePickerHeader/index.tsx +2 -2
  62. package/src/components/DatePicker/index.ts +2 -0
  63. package/src/components/DatePicker/polyfill.ts +3 -3
  64. package/src/components/DatePicker/time-picker/wheel-web.tsx +0 -1
  65. package/src/components/DatePickerInput/DatePickerInput.figma.tsx +18 -46
  66. package/src/components/DatePickerInput/DatePickerInput.tsx +0 -2
  67. package/src/components/DescriptionList/DescriptionList.docs.mdx +16 -14
  68. package/src/components/DescriptionList/DescriptionList.figma.tsx +41 -17
  69. package/src/components/DescriptionList/DescriptionList.props.ts +1 -0
  70. package/src/components/DescriptionList/DescriptionList.stories.tsx +24 -0
  71. package/src/components/DescriptionList/DescriptionList.tsx +2 -0
  72. package/src/components/DescriptionList/DescriptionListItem.figma.tsx +42 -0
  73. package/src/components/DescriptionList/DescriptionListItem.props.ts +1 -0
  74. package/src/components/DescriptionList/DescriptionListItem.tsx +7 -0
  75. package/src/components/Divider/Divider.figma.tsx +10 -23
  76. package/src/components/Input/Input.tsx +0 -1
  77. package/src/components/List/List.stories.tsx +1 -4
  78. package/src/components/Radio/Radio.stories.tsx +1 -1
  79. package/src/components/Switch/Switch.tsx +1 -1
  80. package/src/components/Tabs/Tabs.tsx +0 -1
  81. package/src/components/Textarea/Textarea.tsx +3 -0
  82. package/src/components/ThemedImage/ThemedImage.stories.tsx +14 -14
  83. package/src/components/Toast/ToastItem.tsx +1 -1
  84. package/src/components/ToggleButton/ToggleButtonIcon.tsx +1 -1
  85. package/src/components/ToggleButton/ToggleButtonRoot.tsx +0 -2
  86. package/src/components/UnstyledIconButton/UnstyledIconButtonIcon.tsx +1 -1
  87. package/src/utils/coloursAsArray.ts +1 -1
  88. package/tsconfig.eslint.json +13 -0
  89. package/src/components/Accordion/AccordionItemRoot.figma.tsx +0 -47
  90. package/src/components/DatePicker/DatePickerCalendar.figma.tsx +0 -34
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utilitywarehouse/hearth-react-native",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
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.11",
28
+ "@figma/code-connect": "^1.3.12",
29
29
  "@gorhom/bottom-sheet": "5.2.6",
30
- "@storybook/addon-a11y": "^10.1.4",
31
- "@storybook/addon-docs": "^10.1.4",
32
- "@storybook/addon-vitest": "^10.1.4",
33
- "@storybook/react-native-web-vite": "^10.1.4",
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.4",
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,7 +50,7 @@
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.4",
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",
@@ -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 --max-warnings 0",
80
- "lint": "TIMING=1 eslint --max-warnings 0",
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 React from "react"
2
- import Accordion from "./Accordion"
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
- "https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=3385%3A7751",
6
+ 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=3385%3A7751',
16
7
  {
17
8
  props: {
18
- // No matching props could be found for these Figma properties:
19
- // "sectionHeader": figma.boolean('Section header?')
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: (props) => <Accordion />,
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 React from "react"
2
- import Avatar from "./Avatar"
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
- "https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=6790%3A14313",
6
+ 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=6790-14313',
15
7
  {
16
8
  props: {
17
- // These props were automatically mapped based on your linked code:
18
- size: figma.enum("Size", {
19
- "SM-32": "sm",
20
- "MD-48": "md",
9
+ size: figma.enum('Size', {
10
+ 'SM-32': 'sm',
11
+ 'MD-48': 'md',
21
12
  }),
22
- // No matching props could be found for these Figma properties:
23
- // "initials": figma.string('Initials'),
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: (props) => <Avatar size={props.size} />,
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 React from "react"
2
- import Badge from "./Badge"
3
- import figma from "@figma/code-connect"
1
+ import figma from '@figma/code-connect';
2
+ import { Badge } from '../';
4
3
 
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
- */
11
-
12
- figma.connect(
13
- Badge,
14
- "https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=61%3A652",
15
- {
16
- props: {
17
- // These props were automatically mapped based on your linked code:
18
- variant: figma.enum("Variant", {
19
- "Subtle - Default": "subtle",
20
- Emphasis: "emphasis",
21
- Outline: "outline",
22
- }),
23
- colorScheme: figma.enum("Color Scheme", {
24
- Info: "info",
25
- Positive: "positive",
26
- Danger: "danger",
27
- Warning: "warning",
28
- Functional: "functional",
29
- Energy: "energy",
30
- Broadband: "broadband",
31
- Mobile: "mobile",
32
- Insurance: "insurance",
33
- Cashback: "cashback",
34
- Pig: "pig",
35
- Highlight: "highlight",
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 './Banner';
2
+ import { Banner } from '../';
3
3
 
4
- /**
5
- * -- This file was auto-generated by Code Connect --
6
- * None of your props could be automatically mapped to Figma properties.
7
- * You should update the `props` object to include a mapping from your
8
- * code props to Figma properties, and update the `example` function to
9
- * return the code example you'd like to see in Figma
10
- */
11
-
12
- figma.connect(Banner, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=8294%3A3905', {
13
- props: {},
14
- example: props => <Banner heading={null} description={null} />,
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-ignore
136
+ // @ts-expect-error - Illustration SVG import
137
137
  <SpotBillingLight width={80} height={80} />
138
138
  }
139
139
  dark={
140
- // @ts-ignore
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-ignore
153
+ // @ts-expect-error - Illustration SVG import
154
154
  <SpotBillingLight width={120} height={120} />
155
155
  }
156
156
  dark={
157
- // @ts-ignore
157
+ // @ts-expect-error - Illustration SVG import
158
158
  <SpotBillingDark width={120} height={120} />
159
159
  }
160
160
  />
@@ -25,7 +25,8 @@ const Banner = ({
25
25
  onPress,
26
26
  onClose,
27
27
  variant = 'subtle',
28
- colorScheme = 'pig',
28
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
29
+ colorScheme: _,
29
30
  style,
30
31
  ...props
31
32
  }: BannerProps) => {
@@ -1,60 +1,132 @@
1
1
  import figma from '@figma/code-connect';
2
- import Button from './Button';
2
+ import { Button } 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
- */
10
-
11
- figma.connect(Button, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=90%3A432', {
12
- props: {
13
- // These props were automatically mapped based on your linked code:
14
- focusable: figma.enum('State', {
15
- Focus: true,
16
- }),
17
- 'aria-disabled': figma.enum('State', {
18
- Disabled: true,
19
- }),
20
- disabled: figma.enum('State', {
21
- Disabled: true,
22
- }),
23
- size: figma.enum('Size', {
24
- 'SM-32': 'sm',
25
- 'MD-48': 'md',
26
- }),
27
- paddingNone: figma.boolean('Padding None?'),
28
- colorScheme: figma.enum('Color Scheme', {
29
- Affirmative: 'affirmative',
30
- Destructive: 'destructive',
4
+ const props = {
5
+ disabled: figma.enum('State', {
6
+ Disabled: true,
7
+ }),
8
+ size: figma.enum('Size', {
9
+ 'SM-32': 'sm',
10
+ 'MD-48': 'md',
11
+ }),
12
+ paddingNone: figma.boolean('Padding None?'),
13
+ colorScheme: figma.enum('Color Scheme', {
14
+ Affirmative: 'affirmative',
15
+ Destructive: 'destructive',
16
+ Functional: 'functional',
17
+ Highlight: 'highlight',
18
+ }),
19
+ loading: figma.enum('State', {
20
+ Loading: true,
21
+ }),
22
+ text: figma.string('Text'),
23
+ ghostText: figma.string('Ghost Text'),
24
+ iconPosition: figma.boolean('Show icon left?', {
25
+ true: undefined,
26
+ false: figma.boolean('Show icon right?', {
27
+ true: 'right',
28
+ false: undefined,
31
29
  }),
32
- loading: figma.enum('State', {
33
- Loading: true,
30
+ }),
31
+ icon: figma.boolean('Show icon left?', {
32
+ true: figma.instance('Icon left-20'),
33
+ false: figma.boolean('Show icon right?', {
34
+ true: figma.instance('Icon right-20'),
35
+ false: undefined,
34
36
  }),
35
- // No matching props could be found for these Figma properties:
36
- // "text": figma.string('Text'),
37
- // "showIconLeft": figma.boolean('Show icon left?'),
38
- // "showIconRight": figma.boolean('Show icon right?'),
39
- // "iconLeft20": figma.instance('Icon left-20'),
40
- // "iconRight20": figma.instance('Icon right-20'),
41
- // "ghostText": figma.string('Ghost Text'),
42
- // "variant": figma.enum('Variant', {
43
- // "Emphasis": "emphasis",
44
- // "Solid": "solid",
45
- // "Outline": "outline",
46
- // "Ghost": "ghost"
47
- // }),
48
- // "inverted": figma.boolean('Inverted?')
37
+ }),
38
+ variant: figma.enum('Variant', {
39
+ Emphasis: 'emphasis',
40
+ Solid: 'solid',
41
+ Outline: 'outline',
42
+ Ghost: 'ghost',
43
+ }),
44
+ inverted: figma.boolean('Inverted?'),
45
+ };
46
+
47
+ figma.connect(Button, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=90%3A432', {
48
+ props,
49
+ variant: {
50
+ Variant: 'Solid',
51
+ },
52
+ example: props => (
53
+ <Button
54
+ disabled={props.disabled}
55
+ size={props.size}
56
+ variant={props.variant}
57
+ inverted={props.inverted}
58
+ paddingNone={props.paddingNone}
59
+ colorScheme={props.colorScheme}
60
+ loading={props.loading}
61
+ icon={props.icon}
62
+ iconPosition={props.iconPosition}
63
+ >
64
+ {props.text}
65
+ </Button>
66
+ ),
67
+ });
68
+ figma.connect(Button, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=90%3A432', {
69
+ props,
70
+ variant: {
71
+ Variant: 'Emphasis',
72
+ },
73
+ example: props => (
74
+ <Button
75
+ disabled={props.disabled}
76
+ size={props.size}
77
+ variant={props.variant}
78
+ inverted={props.inverted}
79
+ paddingNone={props.paddingNone}
80
+ colorScheme={props.colorScheme}
81
+ loading={props.loading}
82
+ iconPosition={props.iconPosition}
83
+ icon={props.icon}
84
+ >
85
+ {props.text}
86
+ </Button>
87
+ ),
88
+ });
89
+
90
+ figma.connect(Button, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=90%3A432', {
91
+ variant: {
92
+ Variant: 'Outline',
93
+ },
94
+ props,
95
+ example: props => (
96
+ <Button
97
+ disabled={props.disabled}
98
+ size={props.size}
99
+ variant={props.variant}
100
+ inverted={props.inverted}
101
+ paddingNone={props.paddingNone}
102
+ colorScheme={props.colorScheme}
103
+ loading={props.loading}
104
+ icon={props.icon}
105
+ iconPosition={props.iconPosition}
106
+ >
107
+ {props.text}
108
+ </Button>
109
+ ),
110
+ });
111
+
112
+ figma.connect(Button, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=90%3A432', {
113
+ variant: {
114
+ Variant: 'Ghost',
49
115
  },
116
+ props,
50
117
  example: props => (
51
118
  <Button
52
- focusable={props.focusable}
53
119
  disabled={props.disabled}
54
120
  size={props.size}
121
+ variant={props.variant}
122
+ inverted={props.inverted}
55
123
  paddingNone={props.paddingNone}
56
124
  colorScheme={props.colorScheme}
57
125
  loading={props.loading}
58
- />
126
+ icon={props.icon}
127
+ iconPosition={props.iconPosition}
128
+ >
129
+ {props.ghostText}
130
+ </Button>
59
131
  ),
60
132
  });
@@ -1,45 +1,29 @@
1
- import React from "react"
2
- import Card from "./Card"
3
- import figma from "@figma/code-connect"
1
+ import figma from '@figma/code-connect';
2
+ import Card from './Card';
4
3
 
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
- */
11
-
12
- figma.connect(
13
- Card,
14
- "https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=2160%3A11",
15
- {
16
- props: {
17
- // These props were automatically mapped based on your linked code:
18
- variant: figma.enum("Variant", {
19
- Emphasis: "emphasis",
20
- Subtle: "subtle",
21
- }),
22
- colorScheme: figma.enum("Color Scheme", {
23
- "Neutral Strong": "neutralStrong",
24
- "Neutral Subtle": "neutralSubtle",
25
- Brand: "brand",
26
- Energy: "energy",
27
- Broadband: "broadband",
28
- Mobile: "mobile",
29
- Insurance: "insurance",
30
- Cashback: "cashback",
31
- Pig: "pig",
32
- }),
33
- noPadding: figma.boolean("Padding None?"),
34
- // No matching props could be found for these Figma properties:
35
- // "content": figma.instance('Content')
36
- },
37
- example: (props) => (
38
- <Card
39
- variant={props.variant}
40
- colorScheme={props.colorScheme}
41
- noPadding={props.noPadding}
42
- />
43
- ),
4
+ figma.connect(Card, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=2160%3A11', {
5
+ props: {
6
+ variant: figma.enum('Variant', {
7
+ Emphasis: 'emphasis',
8
+ Subtle: 'subtle',
9
+ }),
10
+ colorScheme: figma.enum('Color Scheme', {
11
+ 'Neutral Strong': 'neutralStrong',
12
+ 'Neutral Subtle': 'neutralSubtle',
13
+ Brand: 'brand',
14
+ Energy: 'energy',
15
+ Broadband: 'broadband',
16
+ Mobile: 'mobile',
17
+ Insurance: 'insurance',
18
+ Cashback: 'cashback',
19
+ Pig: 'pig',
20
+ }),
21
+ noPadding: figma.boolean('Padding None?'),
22
+ content: figma.instance('Content'),
44
23
  },
45
- )
24
+ example: props => (
25
+ <Card variant={props.variant} colorScheme={props.colorScheme} noPadding={props.noPadding}>
26
+ {props.content}
27
+ </Card>
28
+ ),
29
+ });
@@ -106,7 +106,7 @@ export const WithOnlyAction: Story = {
106
106
  args: {
107
107
  variant: 'emphasis',
108
108
  },
109
- render: ({ children, ...props }) => {
109
+ render: ({ ...props }) => {
110
110
  return (
111
111
  <Card {...props} flexDirection="column" alignItems="stretch" space="md">
112
112
  <CardAction