@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
@@ -1,6 +1,6 @@
1
- // @ts-ignore
1
+ // @ts-expect-error - Polyfill for Date.toLocaleString to support timeZone option in React Native environment.
2
2
  Date.prototype._toLocaleString = Date.prototype.toLocaleString;
3
- // @ts-ignore
3
+ // @ts-expect-error - Polyfill for Date.toLocaleString to support timeZone option in React Native environment.
4
4
  Date.prototype.toLocaleString = function (a, b) {
5
5
  if (b && Object.keys(b).length === 1 && 'timeZone' in b && a === 'en-US') {
6
6
  return Intl.DateTimeFormat('en-us', {
@@ -16,6 +16,6 @@ Date.prototype.toLocaleString = function (a, b) {
16
16
  .format(this)
17
17
  .replace(/(\d{2})\/(\d{2})\/(\d{4}),/g, '$3-$1-$2');
18
18
  }
19
- // @ts-ignore
19
+ // @ts-expect-error - Polyfill for Date.toLocaleString to support timeZone option in React Native environment.
20
20
  return this._toLocaleString(a, b);
21
21
  };
@@ -121,7 +121,6 @@ const WheelWeb = ({ value, setValue = () => {}, items }: WheelProps) => {
121
121
  return (
122
122
  <Animated.View
123
123
  key={`${displayValue?.text}-${index}`}
124
- // eslint-disable-next-line react-native/no-inline-styles
125
124
  style={{
126
125
  position: 'absolute',
127
126
  height: ITEM_HEIGHT - 10,
@@ -1,62 +1,34 @@
1
1
  import figma from '@figma/code-connect';
2
- import DatePickerInput from './DatePickerInput';
3
-
4
- /**
5
- * -- This file was auto-generated by Code Connect --
6
- * `props` includes a mapping from your code props to Figma properties.
7
- * You should check this is correct, and update the `example` function
8
- * to return the code example you'd like to see in Figma
9
- */
2
+ import { DatePickerInput } from '../';
10
3
 
11
4
  figma.connect(
12
5
  DatePickerInput,
13
6
  'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=3917%3A7057',
14
7
  {
15
8
  props: {
16
- // These props were automatically mapped based on your linked code:
17
9
  disabled: figma.enum('Variant', {
18
10
  Disabled: true,
19
11
  }),
20
- readonly: figma.enum('Variant', {
21
- 'Read-only': true,
12
+ validationStatus: figma.enum('Variant', {
13
+ Default: undefined,
14
+ Valid: 'valid',
15
+ Invalid: 'invalid',
22
16
  }),
23
- focused: figma.boolean('Focus?'),
24
- placeholder: figma.string('Label'),
25
- autoFocus: figma.boolean('Focus?'),
26
- defaultValue: figma.string('Value'),
27
- readOnly: figma.enum('Variant', {
28
- 'Read-only': true,
17
+ readonly: figma.enum('Variant', { Readonly: true }),
18
+ label: figma.string('Label'),
19
+ validText: figma.enum('Variant', {
20
+ Valid: figma.string('Validation'),
29
21
  }),
30
- focusable: figma.boolean('Focus?'),
31
- hasTVPreferredFocus: figma.boolean('Focus?'),
32
- 'aria-disabled': figma.enum('Variant', {
33
- Disabled: true,
22
+ invalidText: figma.enum('Variant', {
23
+ Invalid: figma.string('Validation'),
24
+ }),
25
+ placeholder: figma.enum('Value type', {
26
+ Placeholder: figma.string('Value'),
27
+ }),
28
+ value: figma.enum('Value type', {
29
+ Filled: figma.string('Value'),
34
30
  }),
35
- // No matching props could be found for these Figma properties:
36
- // "helperText": figma.boolean('Helper text?'),
37
- // "label": figma.string('Label'),
38
- // "validation": figma.string('Validation'),
39
- // "helperText": figma.string('Helper text'),
40
- // "value": figma.string('Value'),
41
- // "icon": figma.boolean('Icon?'),
42
- // "calendar": figma.boolean('Calendar?'),
43
- // "valueType": figma.enum('Value type', {
44
- // "Empty": "empty",
45
- // "Placeholder": "placeholder",
46
- // "Filled": "filled"
47
- // })
48
31
  },
49
- example: props => (
50
- <DatePickerInput
51
- disabled={props.disabled}
52
- readonly={props.readonly}
53
- focused={props.focused}
54
- placeholder={props.placeholder}
55
- autoFocus={props.autoFocus}
56
- defaultValue={props.defaultValue}
57
- readOnly={props.readOnly}
58
- focusable={props.focusable}
59
- />
60
- ),
32
+ example: props => <DatePickerInput {...props} />,
61
33
  }
62
34
  );
@@ -53,7 +53,6 @@ const DatePickerInput = ({
53
53
  ...rest
54
54
  }: DatePickerInputProps) => {
55
55
  const formFieldContext = useFormFieldContext();
56
- const validationStatusFromContext = formFieldContext?.validationStatus ?? validationStatus;
57
56
  const isDisabled = formFieldContext?.disabled ?? disabled;
58
57
  const isReadonly = formFieldContext?.readonly ?? readonly;
59
58
 
@@ -168,7 +167,6 @@ const DatePickerInput = ({
168
167
  accessibilityHint: accessibilityHintProp,
169
168
  accessibilityLabel: accessibilityLabelProp,
170
169
  accessible: accessibleProp,
171
- accessibilityRole: accessibilityRoleProp,
172
170
  importantForAccessibility: importantForAccessibilityProp,
173
171
  ...textInputProps
174
172
  } = rest;
@@ -58,23 +58,25 @@ import { DescriptionList, DescriptionListItem } from '@utilitywarehouse/hearth-r
58
58
 
59
59
  ### DescriptionList
60
60
 
61
- | Prop | Type | Description | Default |
62
- | ----------------------- | ------------------- | ------------------------------------------------ | ----------- |
63
- | `direction` | `'row' \| 'column'` | Layout orientation | `column` |
64
- | `itemHeadingWidth` | `number` | Override heading column width in row layout | token value |
65
- | `heading` | `string` | Optional overall heading (renders SectionHeader) | - |
66
- | `helperText` | `string` | Supporting text under heading | - |
67
- | `headerTrailingContent` | `ReactNode` | Custom trailing content for heading (e.g. Link) | - |
61
+ | Prop | Type | Default | Description |
62
+ | ----------------------- | ------------------- | ----------- | ------------------------------------------------ |
63
+ | `direction` | `'row' \| 'column'` | `column` | Layout orientation |
64
+ | `itemHeadingWidth` | `number` | token value | Override heading column width in row layout |
65
+ | `heading` | `string` | - | Optional overall heading (renders SectionHeader) |
66
+ | `helperText` | `string` | - | Supporting text under heading |
67
+ | `headerTrailingContent` | `ReactNode` | - | Custom trailing content for heading (e.g. Link) |
68
+ | `invalidText` | `string` | - | Text to show under section header |
68
69
 
69
70
  ### DescriptionListItem
70
71
 
71
- | Prop | Type | Description | Default |
72
- | ----------------- | ----------- | ------------------------------------------------ | ---------- |
73
- | `heading` | `ReactNode` | Heading (label) content | (required) |
74
- | `description` | `ReactNode` | Description (value) content | (required) |
75
- | `headingWidth` | `number` | Per-item heading width override (row layout) | inherits |
76
- | `trailingContent` | `ReactNode` | Optional trailing content (e.g. Link, Button) | - |
77
- | `invalidText` | `string` | Text to show under description for invalid value | - |
72
+ | Prop | Type | Default | Description |
73
+ | ----------------- | ----------- | ---------- | ------------------------------------------------ |
74
+ | `heading` | `ReactNode` | (required) | Heading (label) content |
75
+ | `description` | `ReactNode` | (required) | Description (value) content |
76
+ | `numericValue` | `string` | - | Optional numeric value |
77
+ | `headingWidth` | `number` | inherits | Per-item heading width override (row layout) |
78
+ | `trailingContent` | `ReactNode` | - | Optional trailing content (e.g. Link, Button) |
79
+ | `invalidText` | `string` | - | Text to show under description for invalid value |
78
80
 
79
81
  > Uses `theme.components.descriptionList` tokens for spacing & column width.
80
82
 
@@ -1,23 +1,47 @@
1
- import React from "react"
2
- import DescriptionList from "./DescriptionList"
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 { DescriptionList } from '../';
12
3
 
13
4
  figma.connect(
14
5
  DescriptionList,
15
- "https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=7247%3A4636",
6
+ 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=7247%3A4636',
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.boolean('Section header?', {
10
+ true: figma.nestedProps('Section Header', {
11
+ heading: figma.string('Heading'),
12
+ helperText: figma.boolean('Helper text?', {
13
+ true: figma.string('Helper text'),
14
+ }),
15
+ trailingContent: figma.boolean('Trailing content?', {
16
+ true: figma.nestedProps('Trailing content', {
17
+ headerTrailingContent: figma.instance('Variant'),
18
+ }),
19
+ }),
20
+ invalidText: figma.enum('State', {
21
+ Invalid: figma.nestedProps('Validation Text', {
22
+ invalidText: figma.string('Text'),
23
+ }),
24
+ }),
25
+ }),
26
+ }),
27
+ items: figma.children('Item'),
28
+ direction: figma.nestedProps('Item', {
29
+ direction: figma.enum('Direction', {
30
+ Row: 'row',
31
+ Column: 'column',
32
+ }),
33
+ }),
20
34
  },
21
- example: (props) => <DescriptionList />,
22
- },
23
- )
35
+ example: props => (
36
+ <DescriptionList
37
+ heading={props.sectionHeader?.heading}
38
+ helperText={props.sectionHeader?.helperText}
39
+ direction={props.direction?.direction}
40
+ headerTrailingContent={props.sectionHeader?.trailingContent?.headerTrailingContent}
41
+ invalidText={props.sectionHeader?.invalidText?.invalidText}
42
+ >
43
+ {props.items}
44
+ </DescriptionList>
45
+ ),
46
+ }
47
+ );
@@ -8,6 +8,7 @@ export interface DescriptionListProps extends ViewProps {
8
8
  heading?: string;
9
9
  helperText?: string;
10
10
  headerTrailingContent?: React.ReactNode;
11
+ invalidText?: string;
11
12
  }
12
13
 
13
14
  export default DescriptionListProps;
@@ -146,3 +146,27 @@ export const WithLinks: Story = {
146
146
  </DescriptionList>
147
147
  ),
148
148
  };
149
+
150
+ export const WithNumericValues: Story = {
151
+ parameters: { controls: { include: ['direction', 'itemHeadingWidth'] } },
152
+ args: { direction: 'row' },
153
+ render: args => (
154
+ <DescriptionList {...args}>
155
+ <DescriptionListItem
156
+ heading="Account Balance"
157
+ description="Current balance"
158
+ numericValue="£5,432.10"
159
+ />
160
+ <DescriptionListItem
161
+ heading="Available Credit"
162
+ description="Credit limit minus current balance"
163
+ numericValue="£1,234.56"
164
+ />
165
+ <DescriptionListItem
166
+ heading="Minimum Payment"
167
+ description="Amount due by next statement date"
168
+ numericValue="£123.45"
169
+ />
170
+ </DescriptionList>
171
+ ),
172
+ };
@@ -13,6 +13,7 @@ const DescriptionList = ({
13
13
  headerTrailingContent,
14
14
  children,
15
15
  style,
16
+ invalidText,
16
17
  ...props
17
18
  }: DescriptionListProps) => {
18
19
  styles.useVariants({ direction });
@@ -26,6 +27,7 @@ const DescriptionList = ({
26
27
  heading={heading}
27
28
  helperText={helperText}
28
29
  trailingContent={headerTrailingContent}
30
+ invalidText={invalidText}
29
31
  />
30
32
  ) : null}
31
33
  {children}
@@ -0,0 +1,42 @@
1
+ import figma from '@figma/code-connect';
2
+ import { DescriptionListItem } from '../';
3
+
4
+ figma.connect(
5
+ DescriptionListItem,
6
+ 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR/Hearth-Components---Tokens?node-id=7247-5209&t=3uUSBVdxldgG5uz3-4',
7
+ {
8
+ props: {
9
+ heading: figma.string('Heading'),
10
+ direction: figma.enum('Direction', {
11
+ Row: 'row',
12
+ Column: 'column',
13
+ }),
14
+ description: figma.boolean('Description?', {
15
+ true: figma.string('Description'),
16
+ }),
17
+ trailingContent: figma.boolean('Trailing content?', {
18
+ true: figma.nestedProps('Trailing content', {
19
+ trailingContent: figma.instance('Variant'),
20
+ }),
21
+ }),
22
+ invalidText: figma.enum('State', {
23
+ Invalid: figma.nestedProps('Validation Text', {
24
+ invalidText: figma.string('Text'),
25
+ }),
26
+ }),
27
+ numericValue: figma.boolean('Numerical value?', {
28
+ true: figma.string('Numerical value'),
29
+ }),
30
+ },
31
+ example: props => (
32
+ <DescriptionListItem
33
+ heading={props.heading}
34
+ description={props.description}
35
+ direction={props.direction}
36
+ trailingContent={props.trailingContent?.trailingContent}
37
+ invalidText={props.invalidText?.invalidText}
38
+ numericValue={props.numericValue}
39
+ />
40
+ ),
41
+ }
42
+ );
@@ -9,6 +9,7 @@ export interface DescriptionListItemProps extends ViewProps {
9
9
  headingWidth?: number;
10
10
  trailingContent?: ReactNode;
11
11
  invalidText?: string;
12
+ numericValue?: string;
12
13
  }
13
14
 
14
15
  export default DescriptionListItemProps;
@@ -3,6 +3,7 @@ import { View } from 'react-native';
3
3
  import { StyleSheet } from 'react-native-unistyles';
4
4
  import { useTheme } from '../../hooks';
5
5
  import { BodyText } from '../BodyText';
6
+ import { DetailText } from '../DetailText';
6
7
  import Helper from '../Helper/Helper';
7
8
  import { useDescriptionListContext } from './DescriptionList.context';
8
9
  import type DescriptionListItemProps from './DescriptionListItem.props';
@@ -13,6 +14,7 @@ const DescriptionListItem = ({
13
14
  headingWidth,
14
15
  trailingContent,
15
16
  invalidText,
17
+ numericValue,
16
18
  style,
17
19
  ...props
18
20
  }: DescriptionListItemProps) => {
@@ -51,6 +53,11 @@ const DescriptionListItem = ({
51
53
  />
52
54
  )}
53
55
  </View>
56
+ {numericValue ? (
57
+ <View style={styles.descriptionWrapper}>
58
+ <DetailText size="lg">{numericValue}</DetailText>
59
+ </View>
60
+ ) : null}
54
61
  </View>
55
62
  {trailingContent ? trailingContent : null}
56
63
  </View>
@@ -1,25 +1,12 @@
1
- import React from "react"
2
- import Divider from "./Divider"
3
- import figma from "@figma/code-connect"
1
+ import figma from '@figma/code-connect';
2
+ import Divider from './Divider';
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
- Divider,
14
- "https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=2421%3A1687",
15
- {
16
- props: {
17
- // These props were automatically mapped based on your linked code:
18
- orientation: figma.enum("Orientation", {
19
- Horizontal: "horizontal",
20
- Vertical: "vertical",
21
- }),
22
- },
23
- example: (props) => <Divider orientation={props.orientation} />,
4
+ figma.connect(Divider, 'https://www.figma.com/design/6NKZXZhFSExXrcbBgc6zTR?node-id=2421%3A1687', {
5
+ props: {
6
+ orientation: figma.enum('Orientation', {
7
+ Horizontal: 'horizontal',
8
+ Vertical: 'vertical',
9
+ }),
24
10
  },
25
- )
11
+ example: props => <Divider orientation={props.orientation} />,
12
+ });
@@ -43,7 +43,6 @@ const Input = forwardRef<TextInput, InputProps>(
43
43
  type,
44
44
  showPasswordToggle = true,
45
45
  onClear,
46
- format,
47
46
  loading,
48
47
  clearable = false,
49
48
  required = true,
@@ -9,7 +9,7 @@ import {
9
9
  SettingsMediumIcon,
10
10
  UserMediumIcon,
11
11
  } from '@utilitywarehouse/hearth-react-native-icons';
12
- import { FC, PropsWithChildren, useState } from 'react';
12
+ import { useState } from 'react';
13
13
  import { List, ListAction, ListItem, ListItemIcon, ListItemTrailingIcon } from '.';
14
14
  import { VariantTitle } from '../../../docs/components';
15
15
  import { Badge } from '../Badge';
@@ -18,9 +18,6 @@ import { Flex } from '../Flex';
18
18
  import { IconContainer } from '../IconContainer';
19
19
  import { Link } from '../Link';
20
20
  import { Switch } from '../Switch';
21
- // import { Card } from '../Card';
22
-
23
- const Card: FC<PropsWithChildren> = ({ children }) => <div>{children}</div>;
24
21
 
25
22
  const meta = {
26
23
  title: 'Stories / List',
@@ -96,7 +96,7 @@ export const WithImage: Story = {
96
96
  value: 'Option 1',
97
97
  label: 'Label',
98
98
  },
99
- render: ({ children, ...args }) => (
99
+ render: ({ ...args }) => (
100
100
  <RadioGroup>
101
101
  <Radio
102
102
  aria-label="Label 1"
@@ -23,7 +23,7 @@ const CustomSwitch = ({
23
23
  size = 'medium',
24
24
  ...accessibilityProps
25
25
  }: SwitchProps) => {
26
- const { components, color } = useTheme();
26
+ const { components } = useTheme();
27
27
  const theme = useAnimatedTheme();
28
28
  const SWITCH_WIDTH = size === 'medium' ? components.switch.md.width : components.switch.sm.width;
29
29
  const THUMB_SIZE =
@@ -11,7 +11,6 @@ const Tabs = ({
11
11
  size = 'md',
12
12
  disabled,
13
13
  children,
14
- withPanels,
15
14
  ...props
16
15
  }: TabsProps) => {
17
16
  // Collect child tab values
@@ -58,6 +58,9 @@ const Textarea = ({
58
58
 
59
59
  const getAccessibilityHint = () => {
60
60
  let accessibilityHint = '';
61
+ if (textareaHelperText) {
62
+ accessibilityHint = accessibilityHint + textareaHelperText;
63
+ }
61
64
  if (textareaValidationStatus !== 'initial') {
62
65
  if (accessibilityHint.length > 0) {
63
66
  accessibilityHint = accessibilityHint + ', ';
@@ -33,9 +33,9 @@ export const Playground: Story = {
33
33
  render: () => (
34
34
  <Box gap="200">
35
35
  <ThemedImage
36
- // @ts-ignore
36
+ // @ts-expect-error - This is a playground
37
37
  light={<SpotBillingLight width={200} height={200} />}
38
- // @ts-ignore
38
+ // @ts-expect-error - This is a playground
39
39
  dark={<SpotBillingDark width={200} height={200} />}
40
40
  />
41
41
  </Box>
@@ -49,9 +49,9 @@ export const WithSpotIllustrations: Story = {
49
49
  render: () => (
50
50
  <Box flexDirection="row" flexWrap="wrap" gap="200">
51
51
  <ThemedImage
52
- // @ts-ignore
52
+ // @ts-expect-error - Ignore TS2322 for Storybook stories
53
53
  light={<SpotBillingLight width={120} height={120} />}
54
- // @ts-ignore
54
+ // @ts-expect-error - Ignore TS2322 for Storybook stories
55
55
  dark={<SpotBillingDark width={120} height={120} />}
56
56
  />
57
57
  </Box>
@@ -81,9 +81,9 @@ export const WithSceneIllustrations: Story = {
81
81
  render: () => (
82
82
  <Box gap="200">
83
83
  <ThemedImage
84
- // @ts-ignore
84
+ // @ts-expect-error - Ignore TS2322 for Storybook stories
85
85
  light={<SceneBroadbandLight width={300} height={200} />}
86
- // @ts-ignore
86
+ // @ts-expect-error - Ignore TS2322 for Storybook stories
87
87
  dark={<SceneBroadbandDark width={300} height={200} />}
88
88
  />
89
89
  </Box>
@@ -129,21 +129,21 @@ export const WithCustomSize: Story = {
129
129
  render: () => (
130
130
  <Box flexDirection="row" flexWrap="wrap" gap="200" alignItems="center">
131
131
  <ThemedImage
132
- // @ts-ignore
132
+ // @ts-expect-error - Ignore TS2322 for Storybook stories
133
133
  light={<SpotBillingLight width={80} height={80} />}
134
- // @ts-ignore
134
+ // @ts-expect-error - Ignore TS2322 for Storybook stories
135
135
  dark={<SpotBillingDark width={80} height={80} />}
136
136
  />
137
137
  <ThemedImage
138
- // @ts-ignore
138
+ // @ts-expect-error - Ignore TS2322 for Storybook stories
139
139
  light={<SpotBillingLight width={120} height={120} />}
140
- // @ts-ignore
140
+ // @ts-expect-error - Ignore TS2322 for Storybook stories
141
141
  dark={<SpotBillingDark width={120} height={120} />}
142
142
  />
143
143
  <ThemedImage
144
- // @ts-ignore
144
+ // @ts-expect-error - Ignore TS2322 for Storybook stories
145
145
  light={<SpotBillingLight width={160} height={160} />}
146
- // @ts-ignore
146
+ // @ts-expect-error - Ignore TS2322 for Storybook stories
147
147
  dark={<SpotBillingDark width={160} height={160} />}
148
148
  />
149
149
  </Box>
@@ -163,9 +163,9 @@ export const WithAccessibility: Story = {
163
163
  render: () => (
164
164
  <Box gap="200">
165
165
  <ThemedImage
166
- // @ts-ignore
166
+ // @ts-expect-error - This is a playground
167
167
  light={<MascotEnergyLight width={150} height={150} />}
168
- // @ts-ignore
168
+ // @ts-expect-error - This is a playground
169
169
  dark={<MascotEnergyDark width={150} height={150} />}
170
170
  accessible={true}
171
171
  accessibilityLabel="Energy service mascot illustration"
@@ -45,7 +45,7 @@ const ToastItem = forwardRef<ToastItemHandle, Props>(({ toast, onClose }, ref) =
45
45
  }, 100);
46
46
 
47
47
  return () => clearTimeout(timer);
48
- }, [toast.text, toast.actionText]);
48
+ }, [toast.text, toast.actionText, translateY, opacity]);
49
49
 
50
50
  const animatedStyle = useAnimatedStyle(() => ({
51
51
  transform: [{ translateY: translateY.value + gestureTranslateY.value }],
@@ -19,7 +19,7 @@ const ButtonIcon = ({
19
19
  {...props}
20
20
  style={
21
21
  Platform.OS === 'web'
22
- ? // @ts-ignore
22
+ ? // @ts-expect-error - Spread types may only be created from object types.
23
23
  { ...(styles.icon as StyleProp<ViewStyle>), ...props.style }
24
24
  : [styles.icon as StyleProp<ViewStyle>, props.style]
25
25
  }
@@ -1,6 +1,5 @@
1
1
  import { GestureResponderEvent, Pressable, ViewStyle } from 'react-native';
2
2
  import { StyleSheet } from 'react-native-unistyles';
3
- import { useCardPressHandlerContext } from '../Card';
4
3
  import type { ToggleButtonProps } from './ToggleButton.props';
5
4
 
6
5
  const ButtonRoot = ({
@@ -12,7 +11,6 @@ const ButtonRoot = ({
12
11
  ...props
13
12
  }: ToggleButtonProps & { states?: { active?: boolean; disabled?: boolean } }) => {
14
13
  const { active } = states || {};
15
- const { pressed } = useCardPressHandlerContext();
16
14
 
17
15
  styles.useVariants({
18
16
  toggled,
@@ -12,7 +12,7 @@ const UnstyledIconButtonIcon = ({ children, ...props }: IconProps) => {
12
12
  {...props}
13
13
  style={
14
14
  Platform.OS === 'web'
15
- ? // @ts-ignore
15
+ ? // @ts-expect-error - Spread types may only be created from object types.
16
16
  { ...(styles.icon as StyleProp<ViewStyle>), ...props.style }
17
17
  : [styles.icon as ViewStyle, props.style]
18
18
  }
@@ -1,6 +1,6 @@
1
1
  import { color } from '../tokens';
2
2
 
3
- const { light, dark, ...restOfColors } = color;
3
+ const { light, ...restOfColors } = color;
4
4
 
5
5
  /**
6
6
  * Recursively flatten nested color objects into camelCase keys
@@ -0,0 +1,13 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "include": [
4
+ "./src",
5
+ "./src/**/*.stories.tsx",
6
+ "./src/**/*.figma.tsx",
7
+ "./.storybook/**/*",
8
+ "./docs/**/*"
9
+ ],
10
+ "exclude": [
11
+ "node_modules"
12
+ ]
13
+ }