@utilitywarehouse/hearth-react-native 0.30.4 → 0.31.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 (121) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/.turbo/turbo-lint.log +15 -18
  3. package/CHANGELOG.md +165 -0
  4. package/build/components/Badge/Badge.js +2 -2
  5. package/build/components/Badge/Badge.props.d.ts +1 -0
  6. package/build/components/Badge/BadgeText.d.ts +1 -1
  7. package/build/components/Badge/BadgeText.js +2 -2
  8. package/build/components/Container/Container.props.d.ts +2 -2
  9. package/build/components/ExpandableCard/ExpandableCard.d.ts +1 -1
  10. package/build/components/ExpandableCard/ExpandableCard.js +13 -2
  11. package/build/components/ExpandableCard/ExpandableCard.props.d.ts +43 -23
  12. package/build/components/ExpandableCard/ExpandableCardText.js +1 -1
  13. package/build/components/ExpandableCard/ExpandableCardTrigger.d.ts +3 -3
  14. package/build/components/ExpandableCard/ExpandableCardTrigger.props.d.ts +31 -6
  15. package/build/components/ExpandableCard/ExpandableCardTriggerRoot.d.ts +1 -1
  16. package/build/components/ExpandableCard/ExpandableCardTriggerRoot.js +13 -2
  17. package/build/components/Flex/Flex.props.d.ts +2 -2
  18. package/build/components/FormField/FormField.d.ts +5 -5
  19. package/build/components/FormField/FormField.js +3 -2
  20. package/build/components/Modal/Modal.d.ts +1 -1
  21. package/build/components/Modal/Modal.js +33 -39
  22. package/build/components/Modal/Modal.props.d.ts +8 -3
  23. package/build/components/Modal/Modal.shared.types.d.ts +19 -4
  24. package/build/components/Modal/Modal.web.d.ts +1 -1
  25. package/build/components/Modal/Modal.web.js +6 -3
  26. package/build/components/NavModal/NavModal.d.ts +1 -1
  27. package/build/components/NavModal/NavModal.js +10 -7
  28. package/build/components/NavModal/NavModal.props.d.ts +4 -3
  29. package/build/components/Table/TableHeaderCell.js +10 -1
  30. package/build/components/Textarea/Textarea.d.ts +1 -1
  31. package/build/components/Textarea/Textarea.js +64 -5
  32. package/build/components/Textarea/Textarea.props.d.ts +10 -0
  33. package/build/components/Textarea/TextareaRoot.js +4 -1
  34. package/build/core/themes.d.ts +92 -88
  35. package/build/tokens/color.d.ts +82 -80
  36. package/build/tokens/color.js +41 -40
  37. package/build/tokens/components/dark/alert.d.ts +6 -6
  38. package/build/tokens/components/dark/alert.js +6 -6
  39. package/build/tokens/components/dark/bottom-navigation.d.ts +2 -2
  40. package/build/tokens/components/dark/bottom-navigation.js +2 -2
  41. package/build/tokens/components/dark/checkbox.d.ts +1 -1
  42. package/build/tokens/components/dark/checkbox.js +1 -1
  43. package/build/tokens/components/dark/icon-button.d.ts +3 -3
  44. package/build/tokens/components/dark/icon-button.js +3 -3
  45. package/build/tokens/components/dark/inline-link.d.ts +1 -1
  46. package/build/tokens/components/dark/inline-link.js +1 -1
  47. package/build/tokens/components/dark/link.d.ts +3 -3
  48. package/build/tokens/components/dark/link.js +3 -3
  49. package/build/tokens/components/dark/navigation.d.ts +2 -2
  50. package/build/tokens/components/dark/navigation.js +2 -2
  51. package/build/tokens/components/dark/parts.d.ts +2 -2
  52. package/build/tokens/components/dark/parts.js +2 -2
  53. package/build/tokens/components/dark/progress-bar.d.ts +3 -3
  54. package/build/tokens/components/dark/progress-bar.js +3 -3
  55. package/build/tokens/components/dark/progress-stepper.d.ts +1 -1
  56. package/build/tokens/components/dark/progress-stepper.js +1 -1
  57. package/build/tokens/components/dark/spinner.d.ts +1 -1
  58. package/build/tokens/components/dark/spinner.js +1 -1
  59. package/build/tokens/components/dark/table.d.ts +2 -0
  60. package/build/tokens/components/dark/table.js +2 -0
  61. package/build/tokens/components/dark/time-picker.d.ts +1 -0
  62. package/build/tokens/components/dark/time-picker.js +1 -0
  63. package/build/tokens/components/light/parts.d.ts +3 -3
  64. package/build/tokens/components/light/parts.js +3 -3
  65. package/build/tokens/components/light/table.d.ts +2 -0
  66. package/build/tokens/components/light/table.js +2 -0
  67. package/build/tokens/components/light/time-picker.d.ts +1 -0
  68. package/build/tokens/components/light/time-picker.js +1 -0
  69. package/build/tokens/semantic-dark.d.ts +40 -40
  70. package/build/tokens/semantic-dark.js +40 -40
  71. package/docs/changelog.mdx +170 -0
  72. package/package.json +3 -3
  73. package/src/components/Badge/Badge.props.ts +1 -0
  74. package/src/components/Badge/Badge.tsx +6 -1
  75. package/src/components/Badge/BadgeText.tsx +8 -2
  76. package/src/components/Container/Container.props.ts +10 -1
  77. package/src/components/ExpandableCard/ExpandableCard.docs.mdx +89 -37
  78. package/src/components/ExpandableCard/ExpandableCard.props.ts +51 -27
  79. package/src/components/ExpandableCard/ExpandableCard.stories.tsx +67 -17
  80. package/src/components/ExpandableCard/ExpandableCard.tsx +15 -7
  81. package/src/components/ExpandableCard/ExpandableCardText.tsx +1 -1
  82. package/src/components/ExpandableCard/ExpandableCardTrigger.props.ts +37 -7
  83. package/src/components/ExpandableCard/ExpandableCardTriggerRoot.tsx +36 -2
  84. package/src/components/Flex/Flex.props.ts +16 -2
  85. package/src/components/FormField/FormField.tsx +2 -1
  86. package/src/components/List/List.stories.tsx +35 -0
  87. package/src/components/Modal/Modal.docs.mdx +52 -1
  88. package/src/components/Modal/Modal.props.ts +21 -6
  89. package/src/components/Modal/Modal.shared.types.ts +23 -4
  90. package/src/components/Modal/Modal.stories.tsx +165 -1
  91. package/src/components/Modal/Modal.tsx +101 -81
  92. package/src/components/Modal/Modal.web.tsx +29 -23
  93. package/src/components/NavModal/NavModal.docs.mdx +29 -0
  94. package/src/components/NavModal/NavModal.props.ts +11 -3
  95. package/src/components/NavModal/NavModal.stories.tsx +29 -0
  96. package/src/components/NavModal/NavModal.tsx +39 -33
  97. package/src/components/Table/TableHeaderCell.tsx +10 -1
  98. package/src/components/Textarea/Textarea.docs.mdx +33 -1
  99. package/src/components/Textarea/Textarea.props.ts +11 -2
  100. package/src/components/Textarea/Textarea.stories.tsx +21 -1
  101. package/src/components/Textarea/Textarea.tsx +107 -3
  102. package/src/components/Textarea/TextareaRoot.tsx +6 -2
  103. package/src/tokens/color.ts +41 -40
  104. package/src/tokens/components/dark/alert.ts +6 -6
  105. package/src/tokens/components/dark/bottom-navigation.ts +2 -2
  106. package/src/tokens/components/dark/checkbox.ts +1 -1
  107. package/src/tokens/components/dark/icon-button.ts +3 -3
  108. package/src/tokens/components/dark/inline-link.ts +1 -1
  109. package/src/tokens/components/dark/link.ts +3 -3
  110. package/src/tokens/components/dark/navigation.ts +2 -2
  111. package/src/tokens/components/dark/parts.ts +2 -2
  112. package/src/tokens/components/dark/progress-bar.ts +3 -3
  113. package/src/tokens/components/dark/progress-stepper.ts +1 -1
  114. package/src/tokens/components/dark/spinner.ts +1 -1
  115. package/src/tokens/components/dark/table.ts +2 -0
  116. package/src/tokens/components/dark/time-picker.ts +1 -0
  117. package/src/tokens/components/light/parts.ts +3 -3
  118. package/src/tokens/components/light/table.ts +2 -0
  119. package/src/tokens/components/light/time-picker.ts +1 -0
  120. package/src/tokens/semantic-dark.ts +40 -40
  121. package/vercel.json +0 -21
@@ -1,4 +1,4 @@
1
1
 
2
- > @utilitywarehouse/hearth-react-native@0.30.4 build /home/runner/work/hearth/hearth/packages/react-native
2
+ > @utilitywarehouse/hearth-react-native@0.31.1 build /home/runner/work/hearth/hearth/packages/react-native
3
3
  > tsc
4
4
 
@@ -1,5 +1,5 @@
1
1
 
2
- > @utilitywarehouse/hearth-react-native@0.30.4 lint /home/runner/work/hearth/hearth/packages/react-native
2
+ > @utilitywarehouse/hearth-react-native@0.31.1 lint /home/runner/work/hearth/hearth/packages/react-native
3
3
  > TIMING=1 eslint .
4
4
 
5
5
 
@@ -42,24 +42,21 @@
42
42
  104:5 warning React Hook useMemo has an unnecessary dependency: 'tabValues'. Either exclude it or remove the dependency array react-hooks/exhaustive-deps
43
43
  127:62 warning React Hook useEffect has a complex expression in the dependency array. Extract it to a separate variable so it can be statically checked react-hooks/exhaustive-deps
44
44
 
45
- /home/runner/work/hearth/hearth/packages/react-native/src/components/Textarea/Textarea.tsx
46
- 45:6 warning React Hook useEffect has a missing dependency: 'formFieldContext'. Either include it or remove the dependency array react-hooks/exhaustive-deps
47
-
48
45
  /home/runner/work/hearth/hearth/packages/react-native/src/components/Toast/Toast.context.tsx
49
46
  14:14 warning Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components react-refresh/only-export-components
50
47
  106:14 warning Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components react-refresh/only-export-components
51
48
 
52
- 22 problems (0 errors, 22 warnings)
53
-
54
- Rule | Time (ms) | Relative
55
- :---------------------------------|----------:|--------:
56
- @typescript-eslint/no-unused-vars | 1518.313 | 61.5%
57
- react-hooks/exhaustive-deps | 121.568 | 4.9%
58
- no-global-assign | 91.541 | 3.7%
59
- react-hooks/rules-of-hooks | 72.207 | 2.9%
60
- no-unexpected-multiline | 43.401 | 1.8%
61
- no-misleading-character-class | 41.346 | 1.7%
62
- no-unsafe-optional-chaining | 40.349 | 1.6%
63
- no-useless-escape | 38.755 | 1.6%
64
- no-fallthrough | 35.741 | 1.4%
65
- @typescript-eslint/ban-ts-comment | 34.017 | 1.4%
49
+ 21 problems (0 errors, 21 warnings)
50
+
51
+ Rule | Time (ms) | Relative
52
+ :-------------------------------------------------|----------:|--------:
53
+ @typescript-eslint/no-unused-vars | 1546.291 | 60.2%
54
+ react-hooks/exhaustive-deps | 108.680 | 4.2%
55
+ no-global-assign | 99.957 | 3.9%
56
+ react-hooks/rules-of-hooks | 90.616 | 3.5%
57
+ no-misleading-character-class | 53.413 | 2.1%
58
+ no-unexpected-multiline | 51.887 | 2.0%
59
+ @typescript-eslint/ban-ts-comment | 49.938 | 1.9%
60
+ @typescript-eslint/no-unnecessary-type-constraint | 38.622 | 1.5%
61
+ no-loss-of-precision | 33.899 | 1.3%
62
+ no-useless-escape | 30.813 | 1.2%
package/CHANGELOG.md CHANGED
@@ -1,5 +1,170 @@
1
1
  # @utilitywarehouse/hearth-react-native
2
2
 
3
+ ## 0.31.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1119](https://github.com/utilitywarehouse/hearth/pull/1119) [`19415d4`](https://github.com/utilitywarehouse/hearth/commit/19415d4d54458b3fb019df6647b9a5e4c375b672) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: Refresh dark mode tokens across components and semantic colors.
8
+
9
+ Dark mode color tokens have been updated across semantic and component tokens to improve contrast and visual consistency. This also fixes `TableHeaderCell` text colors so purple and white header variants resolve the correct foreground token.
10
+
11
+ **Components affected**:
12
+ - dark mode tokens
13
+ - `TableHeaderCell`
14
+
15
+ **Developer changes**:
16
+
17
+ No code changes are required unless you rely on the previous dark mode token values or visual snapshots.
18
+
19
+ ## 0.31.0
20
+
21
+ ### Minor Changes
22
+
23
+ - [#1108](https://github.com/utilitywarehouse/hearth/pull/1108) [`8c2f3b5`](https://github.com/utilitywarehouse/hearth/commit/8c2f3b5334de83a7dd799b857394a34209b748e7) Thanks [@jordmccord](https://github.com/jordmccord)! - 🌟 [FEATURE]: Add margin, padding, and layout utility props to `Flex`.
24
+
25
+ `Flex` now exposes the shared margin and padding utility props, along with the existing layout utility prop surface, so it can be used more like other layout primitives such as `Card`.
26
+
27
+ **Component affected**:
28
+ - `Flex`
29
+
30
+ **Developer changes**:
31
+
32
+ You can now apply spacing and layout utility props directly on `Flex`:
33
+
34
+ ```tsx
35
+ <Flex direction="row" spacing="md" padding="300" marginTop="200" flex={1}>
36
+ <Button>Back</Button>
37
+ <Button>Continue</Button>
38
+ </Flex>
39
+ ```
40
+
41
+ - [#1104](https://github.com/utilitywarehouse/hearth/pull/1104) [`91feeab`](https://github.com/utilitywarehouse/hearth/commit/91feeab091ae6bf80e543f9196214066ce8b29b0) Thanks [@jordmccord](https://github.com/jordmccord)! - 🌟 [FEATURE]: Add custom trigger content options to `ExpandableCard`.
42
+
43
+ `ExpandableCard` now supports a `triggerContent` prop for replacing the default trigger layout while keeping the chevron. `ExpandableCardTrigger` also now supports `children` with an optional `showChevron` prop, so you can fully compose the trigger content yourself and still opt in to the built-in expand/collapse chevron.
44
+
45
+ **Components affected**:
46
+ - `ExpandableCard`
47
+ - `ExpandableCardTrigger`
48
+
49
+ **Developer changes**:
50
+
51
+ Use `triggerContent` when you want a single prop on `ExpandableCard` to replace the standard trigger content:
52
+
53
+ ```tsx
54
+ <ExpandableCard
55
+ triggerContent={<BodyText weight="semibold">March bill ready</BodyText>}
56
+ expandedContent={<BodyText>Balance: £89.50</BodyText>}
57
+ />
58
+ ```
59
+
60
+ Use `ExpandableCardTrigger` children when you want full control over the trigger structure. Add `showChevron` if you still want the built-in chevron:
61
+
62
+ ```tsx
63
+ <ExpandableCardTrigger isExpanded={expanded} onPress={toggleExpanded} showChevron>
64
+ <ExpandableCardContent>
65
+ <ExpandableCardText>Custom trigger</ExpandableCardText>
66
+ </ExpandableCardContent>
67
+ </ExpandableCardTrigger>
68
+ ```
69
+
70
+ - [#1109](https://github.com/utilitywarehouse/hearth/pull/1109) [`8215550`](https://github.com/utilitywarehouse/hearth/commit/8215550745d08a8b4c18a6902e39d3199018092a) Thanks [@jordmccord](https://github.com/jordmccord)! - 🌟 [FEATURE]: Add `numberOfLines` support to `Badge` text.
71
+
72
+ `Badge` now renders its text content on a single line by default and supports a new `numberOfLines` prop when you want to allow more lines.
73
+
74
+ **Components affected**:
75
+ - `Badge`
76
+
77
+ **Developer changes**:
78
+
79
+ No changes are required unless you want a `Badge` to wrap onto more than one line. To opt in, pass `numberOfLines`:
80
+
81
+ ```tsx
82
+ <Badge numberOfLines={2} text="Long badge text that can wrap onto a second line" />
83
+ ```
84
+
85
+ - [#1108](https://github.com/utilitywarehouse/hearth/pull/1108) [`8c2f3b5`](https://github.com/utilitywarehouse/hearth/commit/8c2f3b5334de83a7dd799b857394a34209b748e7) Thanks [@jordmccord](https://github.com/jordmccord)! - 🌟 [FEATURE]: Add custom footer support to `Modal` and `NavModal`.
86
+
87
+ `Modal` and `NavModal` now support a `footer` prop for replacing the built-in primary and secondary action buttons with custom content, plus a `footerStyle` prop for styling the footer container. When `footer` is provided, the button props are now disallowed at the type level.
88
+
89
+ **Components affected**:
90
+ - `Modal`
91
+ - `NavModal`
92
+
93
+ **Developer changes**:
94
+
95
+ Use `footer` when you need a custom footer layout, such as horizontal actions or extra decoration:
96
+
97
+ ```tsx
98
+ <Modal
99
+ heading="Update billing details"
100
+ footer={
101
+ <Flex direction="row" spacing="md" pt="250">
102
+ <Button variant="outline" colorScheme="functional" style={{ flex: 1 }}>
103
+ Cancel
104
+ </Button>
105
+ <Button style={{ flex: 1 }}>Save changes</Button>
106
+ </Flex>
107
+ }
108
+ footerStyle={{
109
+ boxShadow: '0px -6px 12px rgba(16, 24, 40, 0.12)',
110
+ }}
111
+ />
112
+ ```
113
+
114
+ - [#1103](https://github.com/utilitywarehouse/hearth/pull/1103) [`e375a44`](https://github.com/utilitywarehouse/hearth/commit/e375a442c507da1807e49f4d78e44edfff51d245) Thanks [@jordmccord](https://github.com/jordmccord)! - 🌟 [FEATURE]: Add optional vertical resizing to `Textarea`.
115
+
116
+ `Textarea` now supports a new `resizable` prop that adds a bottom-right drag handle so people can increase the field height when they need more space for longer content.
117
+
118
+ **Components affected**:
119
+ - `Textarea`
120
+
121
+ **Developer changes**:
122
+
123
+ No changes are required unless you want to enable resizing for a textarea. To opt in, pass the new `resizable` prop:
124
+
125
+ ```tsx
126
+ <Textarea
127
+ label="Additional notes"
128
+ helperText="Drag the corner handle to resize"
129
+ placeholder="Enter your text here..."
130
+ resizable
131
+ />
132
+ ```
133
+
134
+ - [#1108](https://github.com/utilitywarehouse/hearth/pull/1108) [`8c2f3b5`](https://github.com/utilitywarehouse/hearth/commit/8c2f3b5334de83a7dd799b857394a34209b748e7) Thanks [@jordmccord](https://github.com/jordmccord)! - 🌟 [FEATURE]: Add flex utility props to `Container`.
135
+
136
+ `Container` now exposes shared flex layout utility props, allowing layout properties such as `flex`, `alignItems`, `justifyContent`, and `flexDirection` to be applied directly through its public prop API.
137
+
138
+ **Component affected**:
139
+ - `Container`
140
+
141
+ **Developer changes**:
142
+
143
+ You can now combine `Container`'s existing spacing props with flex layout props:
144
+
145
+ ```tsx
146
+ <Container flex={1} justifyContent="center" alignItems="stretch" gap="200">
147
+ <BodyText>Content</BodyText>
148
+ </Container>
149
+ ```
150
+
151
+ ### Patch Changes
152
+
153
+ - [#1103](https://github.com/utilitywarehouse/hearth/pull/1103) [`e375a44`](https://github.com/utilitywarehouse/hearth/commit/e375a442c507da1807e49f4d78e44edfff51d245) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: Render FormField optional text with regular weight instead of inheriting the label weight.
154
+
155
+ This fixes FormField labels that append `(Optional)` so the optional text no longer inherits the main label weight.
156
+
157
+ **Components affected**:
158
+ - `FormField`
159
+ - `Textarea`
160
+ - `Input`
161
+
162
+ **Developer changes**:
163
+
164
+ No changes are required.
165
+
166
+ - [#1104](https://github.com/utilitywarehouse/hearth/pull/1104) [`91feeab`](https://github.com/utilitywarehouse/hearth/commit/91feeab091ae6bf80e543f9196214066ce8b29b0) Thanks [@jordmccord](https://github.com/jordmccord)! - 🐛 [FIX]: `ExpandableCard` heading font size and weight
167
+
3
168
  ## 0.30.4
4
169
 
5
170
  ### Patch Changes
@@ -6,11 +6,11 @@ import { BadgeContext } from './Badge.context';
6
6
  import BadgeIcon from './BadgeIcon';
7
7
  import BadgeText from './BadgeText';
8
8
  const Badge = ({ children, ...props }) => {
9
- const { variant = 'subtle', icon, colorScheme = 'info', flatBase = false, size = 'sm', style, text, ...rest } = props;
9
+ const { variant = 'subtle', icon, colorScheme = 'info', flatBase = false, size = 'sm', style, text, numberOfLines, ...rest } = props;
10
10
  const value = useMemo(() => ({ colorScheme, flatBase, variant, size }), [colorScheme, flatBase, variant, size]);
11
11
  const childIsText = typeof children === 'string' || typeof children === 'number' || !!text;
12
12
  styles.useVariants({ colorScheme, flatBase, variant, size });
13
- return (_jsx(BadgeContext.Provider, { value: value, children: _jsxs(View, { ...rest, style: [styles.container, style], children: [!!icon && _jsx(BadgeIcon, { as: icon }), childIsText ? _jsx(BadgeText, { children: text ?? children }) : children] }) }));
13
+ return (_jsx(BadgeContext.Provider, { value: value, children: _jsxs(View, { ...rest, style: [styles.container, style], children: [!!icon && _jsx(BadgeIcon, { as: icon }), childIsText ? (_jsx(BadgeText, { numberOfLines: numberOfLines, children: text ?? children })) : (children)] }) }));
14
14
  };
15
15
  Badge.displayName = 'Badge';
16
16
  const styles = StyleSheet.create(theme => ({
@@ -7,5 +7,6 @@ interface BadgeProps extends ViewProps {
7
7
  icon?: ComponentType;
8
8
  flatBase?: boolean;
9
9
  text?: string | number;
10
+ numberOfLines?: number;
10
11
  }
11
12
  export default BadgeProps;
@@ -1,6 +1,6 @@
1
1
  import { TextProps } from 'react-native';
2
2
  declare const BadgeText: {
3
- ({ children, style, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
3
+ ({ children, style, numberOfLines, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
6
6
  export default BadgeText;
@@ -2,10 +2,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { StyleSheet } from 'react-native-unistyles';
3
3
  import { BodyText } from '../BodyText';
4
4
  import { useBadgeContext } from './Badge.context';
5
- const BadgeText = ({ children, style, ...props }) => {
5
+ const BadgeText = ({ children, style, numberOfLines = 1, ...props }) => {
6
6
  const { variant, colorScheme, size } = useBadgeContext();
7
7
  styles.useVariants({ variant, colorScheme });
8
- return (_jsx(BodyText, { ...props, size: size, weight: "semibold", style: [styles.text, style], children: children }));
8
+ return (_jsx(BodyText, { ...props, numberOfLines: numberOfLines, size: size, weight: "semibold", style: [styles.text, style], children: children }));
9
9
  };
10
10
  BadgeText.displayName = 'BadgeText';
11
11
  const styles = StyleSheet.create(theme => ({
@@ -1,6 +1,6 @@
1
1
  import type { ViewProps } from 'react-native';
2
- import type { BackgroundColorProps, GapProps, MarginProps, PaddingProps, SpacingValues } from '../../types';
3
- interface ContainerProps extends ViewProps, MarginProps, PaddingProps, GapProps, BackgroundColorProps {
2
+ import type { BackgroundColorProps, DisplayProps, FlexLayoutProps, GapProps, MarginProps, PaddingProps, SpacingValues } from '../../types';
3
+ interface ContainerProps extends ViewProps, MarginProps, PaddingProps, GapProps, BackgroundColorProps, FlexLayoutProps, DisplayProps {
4
4
  /**
5
5
  * The spacing between child elements (gap).
6
6
  */
@@ -1,6 +1,6 @@
1
1
  import type ExpandableCardProps from './ExpandableCard.props';
2
2
  declare const ExpandableCard: {
3
- ({ expanded: controlledExpanded, onExpandedChange, heading, helperText, leadingIcon, leadingContent, badge, badgePosition, numericValue, expandedContent, duration, animateOpacity, disabled, testID, children, ...cardProps }: ExpandableCardProps): import("react/jsx-runtime").JSX.Element;
3
+ ({ expanded: controlledExpanded, onExpandedChange, heading, helperText, leadingIcon, leadingContent, badge, badgePosition, numericValue, triggerContent, expandedContent, duration, animateOpacity, disabled, testID, children, ...cardProps }: ExpandableCardProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
6
6
  export default ExpandableCard;
@@ -3,7 +3,7 @@ import { useState } from 'react';
3
3
  import { Card } from '../Card';
4
4
  import ExpandableCardExpandedContent from './ExpandableCardExpandedContent';
5
5
  import ExpandableCardTrigger from './ExpandableCardTrigger';
6
- const ExpandableCard = ({ expanded: controlledExpanded, onExpandedChange, heading, helperText, leadingIcon, leadingContent, badge, badgePosition = 'bottom', numericValue, expandedContent, duration = 200, animateOpacity = true, disabled = false, testID = 'expandable-card', children, ...cardProps }) => {
6
+ const ExpandableCard = ({ expanded: controlledExpanded, onExpandedChange, heading, helperText, leadingIcon, leadingContent, badge, badgePosition = 'bottom', numericValue, triggerContent, expandedContent, duration = 200, animateOpacity = true, disabled = false, testID = 'expandable-card', children, ...cardProps }) => {
7
7
  const [internalExpanded, setInternalExpanded] = useState(false);
8
8
  // Use controlled or uncontrolled state
9
9
  const isExpanded = controlledExpanded !== undefined ? controlledExpanded : internalExpanded;
@@ -16,7 +16,18 @@ const ExpandableCard = ({ expanded: controlledExpanded, onExpandedChange, headin
16
16
  }
17
17
  onExpandedChange?.(newExpanded);
18
18
  };
19
- const renderDefaultContent = () => (_jsxs(_Fragment, { children: [_jsx(ExpandableCardTrigger, { onPress: handlePress, disabled: disabled, heading: heading, helperText: helperText, leadingIcon: leadingIcon, leadingContent: leadingContent, badge: badge, badgePosition: badgePosition, numericValue: numericValue, isExpanded: isExpanded, testID: `${testID}-trigger` }), _jsx(ExpandableCardExpandedContent, { isExpanded: isExpanded, duration: duration, animateOpacity: animateOpacity, children: expandedContent })] }));
19
+ const triggerProps = triggerContent !== undefined
20
+ ? { triggerContent }
21
+ : {
22
+ heading,
23
+ helperText,
24
+ leadingIcon,
25
+ leadingContent,
26
+ badge,
27
+ badgePosition,
28
+ numericValue,
29
+ };
30
+ const renderDefaultContent = () => (_jsxs(_Fragment, { children: [_jsx(ExpandableCardTrigger, { onPress: handlePress, disabled: disabled, ...triggerProps, isExpanded: isExpanded, testID: `${testID}-trigger` }), _jsx(ExpandableCardExpandedContent, { isExpanded: isExpanded, duration: duration, animateOpacity: animateOpacity, children: expandedContent })] }));
20
31
  return (_jsx(Card, { noPadding: true, ...cardProps, testID: testID, children: children || renderDefaultContent() }));
21
32
  };
22
33
  ExpandableCard.displayName = 'ExpandableCard';
@@ -1,6 +1,6 @@
1
1
  import type { ComponentType, ReactNode } from 'react';
2
2
  import type CardProps from '../Card/Card.props';
3
- export interface ExpandableCardProps extends Omit<CardProps, 'children'> {
3
+ interface ExpandableCardSharedProps extends Omit<CardProps, 'children'> {
4
4
  /**
5
5
  * Whether the card is expanded
6
6
  */
@@ -9,6 +9,34 @@ export interface ExpandableCardProps extends Omit<CardProps, 'children'> {
9
9
  * Callback when expanded state changes
10
10
  */
11
11
  onExpandedChange?: (expanded: boolean) => void;
12
+ /**
13
+ * The heading text displayed in the trigger
14
+ */
15
+ expandedContent?: ReactNode;
16
+ /**
17
+ * Duration of the expansion animation in milliseconds
18
+ * @default 200
19
+ */
20
+ duration?: number;
21
+ /**
22
+ * Whether to animate opacity during expansion
23
+ * @default true
24
+ */
25
+ animateOpacity?: boolean;
26
+ /**
27
+ * Whether the card is disabled
28
+ */
29
+ disabled?: boolean;
30
+ /**
31
+ * Test ID for testing
32
+ */
33
+ testID?: string;
34
+ /**
35
+ * Custom children for advanced composition
36
+ */
37
+ children?: ReactNode;
38
+ }
39
+ interface ExpandableCardDefaultTriggerProps {
12
40
  /**
13
41
  * The heading text displayed in the trigger
14
42
  */
@@ -39,30 +67,22 @@ export interface ExpandableCardProps extends Omit<CardProps, 'children'> {
39
67
  */
40
68
  numericValue?: string | number;
41
69
  /**
42
- * The content to show when expanded
43
- */
44
- expandedContent?: ReactNode;
45
- /**
46
- * Duration of the expansion animation in milliseconds
47
- * @default 200
48
- */
49
- duration?: number;
50
- /**
51
- * Whether to animate opacity during expansion
52
- * @default true
53
- */
54
- animateOpacity?: boolean;
55
- /**
56
- * Whether the card is disabled
57
- */
58
- disabled?: boolean;
59
- /**
60
- * Test ID for testing
70
+ * Custom trigger content that replaces the default trigger layout.
61
71
  */
62
- testID?: string;
72
+ triggerContent?: never;
73
+ }
74
+ interface ExpandableCardCustomTriggerProps {
63
75
  /**
64
- * Custom children for advanced composition
76
+ * Custom trigger content that replaces the default trigger layout.
65
77
  */
66
- children?: ReactNode;
78
+ triggerContent: ReactNode;
79
+ heading?: never;
80
+ helperText?: never;
81
+ leadingIcon?: never;
82
+ leadingContent?: never;
83
+ badge?: never;
84
+ badgePosition?: never;
85
+ numericValue?: never;
67
86
  }
87
+ type ExpandableCardProps = ExpandableCardSharedProps & (ExpandableCardDefaultTriggerProps | ExpandableCardCustomTriggerProps);
68
88
  export default ExpandableCardProps;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { BodyText } from '../BodyText';
3
3
  const ExpandableCardText = ({ children, ...props }) => {
4
- return (_jsx(BodyText, { size: "lg", ...props, children: children }));
4
+ return (_jsx(BodyText, { size: "md", weight: "semibold", ...props, children: children }));
5
5
  };
6
6
  ExpandableCardText.displayName = 'ExpandableCardText';
7
7
  export default ExpandableCardText;
@@ -1,9 +1,9 @@
1
- declare const ExpandableCardTrigger: import("react").ForwardRefExoticComponent<import("./ExpandableCardTrigger.props").ExpandableCardTriggerProps & {
1
+ declare const ExpandableCardTrigger: import("react").ForwardRefExoticComponent<(((import("./ExpandableCardTrigger.props").default & {
2
2
  states?: {
3
3
  active?: boolean;
4
4
  disabled?: boolean;
5
5
  };
6
- } & Omit<import("react-native").PressableProps, "children"> & {
6
+ }) & Omit<import("react-native").PressableProps, "children">) & {
7
7
  tabIndex?: 0 | -1 | undefined;
8
8
  } & {
9
9
  children?: import("react").ReactNode | (({ hovered, pressed, focused, focusVisible, disabled, }: {
@@ -13,5 +13,5 @@ declare const ExpandableCardTrigger: import("react").ForwardRefExoticComponent<i
13
13
  focusVisible?: boolean | undefined;
14
14
  disabled?: boolean | undefined;
15
15
  }) => import("react").ReactNode);
16
- } & import("react").RefAttributes<unknown>>;
16
+ }) & import("react").RefAttributes<unknown>>;
17
17
  export default ExpandableCardTrigger;
@@ -1,6 +1,22 @@
1
1
  import type { ComponentType, ReactNode } from 'react';
2
2
  import type { PressableProps } from 'react-native';
3
- export interface ExpandableCardTriggerProps extends Omit<PressableProps, 'children'> {
3
+ interface ExpandableCardTriggerSharedProps extends Omit<PressableProps, 'children'> {
4
+ /**
5
+ * Whether the expandable card is expanded
6
+ */
7
+ isExpanded: boolean;
8
+ /**
9
+ * Whether to show the chevron when providing custom children.
10
+ * @default true
11
+ */
12
+ showChevron?: boolean;
13
+ /**
14
+ * Whether the trigger is disabled
15
+ */
16
+ disabled?: boolean;
17
+ children?: ReactNode;
18
+ }
19
+ interface ExpandableCardTriggerDefaultContentProps {
4
20
  /**
5
21
  * The main heading text
6
22
  */
@@ -31,13 +47,22 @@ export interface ExpandableCardTriggerProps extends Omit<PressableProps, 'childr
31
47
  */
32
48
  numericValue?: string | number;
33
49
  /**
34
- * Whether the expandable card is expanded
50
+ * Custom trigger content that replaces the default trigger layout.
35
51
  */
36
- isExpanded: boolean;
52
+ triggerContent?: never;
53
+ }
54
+ interface ExpandableCardTriggerCustomContentProps {
37
55
  /**
38
- * Whether the trigger is disabled
56
+ * Custom trigger content that replaces the default trigger layout.
39
57
  */
40
- disabled?: boolean;
41
- children?: ReactNode;
58
+ triggerContent: ReactNode;
59
+ heading?: never;
60
+ helperText?: never;
61
+ leadingIcon?: never;
62
+ leadingContent?: never;
63
+ badge?: never;
64
+ badgePosition?: never;
65
+ numericValue?: never;
42
66
  }
67
+ type ExpandableCardTriggerProps = ExpandableCardTriggerSharedProps & (ExpandableCardTriggerDefaultContentProps | ExpandableCardTriggerCustomContentProps);
43
68
  export default ExpandableCardTriggerProps;
@@ -1,6 +1,6 @@
1
1
  import type ExpandableCardTriggerProps from './ExpandableCardTrigger.props';
2
2
  declare const ExpandableCardTriggerRoot: {
3
- ({ heading, helperText, leadingIcon, leadingContent, badge, badgePosition, numericValue, isExpanded, disabled, states, children, ...props }: ExpandableCardTriggerProps & {
3
+ ({ heading, helperText, leadingIcon, leadingContent, badge, badgePosition, numericValue, triggerContent, isExpanded, showChevron, disabled, states, children, ...props }: ExpandableCardTriggerProps & {
4
4
  states?: {
5
5
  active?: boolean;
6
6
  disabled?: boolean;
@@ -10,7 +10,7 @@ import ExpandableCardLeadingContent from './ExpandableCardLeadingContent';
10
10
  import ExpandableCardText from './ExpandableCardText';
11
11
  import ExpandableCardTrailingContent from './ExpandableCardTrailingContent';
12
12
  import ExpandableCardTrailingIcon from './ExpandableCardTrailingIcon';
13
- const ExpandableCardTriggerRoot = ({ heading, helperText, leadingIcon, leadingContent, badge, badgePosition = 'bottom', numericValue, isExpanded, disabled, states, children, ...props }) => {
13
+ const ExpandableCardTriggerRoot = ({ heading, helperText, leadingIcon, leadingContent, badge, badgePosition = 'bottom', numericValue, triggerContent, isExpanded, showChevron = true, disabled, states, children, ...props }) => {
14
14
  const { active } = states || { active: false };
15
15
  const testID = props.testID || 'expandable-card-trigger';
16
16
  styles.useVariants({
@@ -26,8 +26,19 @@ const ExpandableCardTriggerRoot = ({ heading, helperText, leadingIcon, leadingCo
26
26
  }
27
27
  return null;
28
28
  };
29
+ const defaultAccessibilityLabel = [heading, helperText].filter(Boolean).join(', ');
29
30
  const renderDefaultContent = () => (_jsxs(_Fragment, { children: [renderLeadingContent(), _jsxs(ExpandableCardContent, { children: [badgePosition === 'top' ? badge : null, _jsx(ExpandableCardText, { children: heading }), helperText && _jsx(ExpandableCardHelperText, { children: helperText }), badgePosition === 'bottom' ? badge : null] }), !!numericValue && (_jsx(BodyText, { weight: "semibold", style: styles.numericValue, children: numericValue })), _jsx(ExpandableCardTrailingContent, { style: styles.chevron, children: _jsx(ExpandableCardTrailingIcon, { as: isExpanded ? ChevronUpSmallIcon : ChevronDownSmallIcon }) })] }));
30
- return (_jsx(Pressable, { ...props, testID: testID, style: [styles.container, props.style], disabled: disabled, accessibilityRole: "button", accessibilityState: { expanded: isExpanded, disabled }, accessibilityLabel: `${heading}${helperText ? `, ${helperText}` : ''}`, children: children || renderDefaultContent() }));
31
+ const renderChevron = () => (_jsx(ExpandableCardTrailingContent, { style: styles.chevron, children: _jsx(ExpandableCardTrailingIcon, { as: isExpanded ? ChevronUpSmallIcon : ChevronDownSmallIcon }) }));
32
+ const renderCustomTriggerContent = () => (_jsxs(_Fragment, { children: [triggerContent, showChevron ? renderChevron() : null] }));
33
+ const renderChildrenContent = () => (_jsxs(_Fragment, { children: [children, showChevron ? renderChevron() : null] }));
34
+ let triggerBody = renderDefaultContent();
35
+ if (triggerContent !== undefined) {
36
+ triggerBody = renderCustomTriggerContent();
37
+ }
38
+ if (children) {
39
+ triggerBody = renderChildrenContent();
40
+ }
41
+ return (_jsx(Pressable, { ...props, testID: testID, style: [styles.container, props.style], disabled: disabled, accessibilityRole: "button", accessibilityState: { expanded: isExpanded, disabled }, accessibilityLabel: props.accessibilityLabel || defaultAccessibilityLabel || undefined, children: triggerBody }));
31
42
  };
32
43
  ExpandableCardTriggerRoot.displayName = 'ExpandableCardTriggerRoot';
33
44
  const styles = StyleSheet.create(theme => ({
@@ -1,6 +1,6 @@
1
1
  import type { FlexAlignType, ViewProps, ViewStyle } from 'react-native';
2
- import { FlexLayoutProps, GapProps, SpacingValues } from '../../types';
3
- interface FlexProps extends ViewProps, FlexLayoutProps, GapProps {
2
+ import { DisplayProps, FlexLayoutProps, GapProps, MarginProps, PaddingProps, SpacingValues } from '../../types';
3
+ interface FlexProps extends ViewProps, MarginProps, PaddingProps, FlexLayoutProps, GapProps, Omit<DisplayProps, 'direction'> {
4
4
  direction?: ViewStyle['flexDirection'];
5
5
  align?: FlexAlignType;
6
6
  justify?: ViewStyle['justifyContent'];
@@ -1,24 +1,24 @@
1
1
  import { View } from 'react-native';
2
2
  import FormFieldProps from './FormField.props';
3
- export declare const FormFieldComponent: import("@gluestack-ui/form-control/lib/types").IFormControlComponentType<import("react-native").ViewProps, Omit<import("../Helper/Helper.props").default, "validationStatus">, Omit<import("../Helper/Helper.props").default, "validationStatus">, Omit<import("..").IconProps, "as">, unknown, Omit<import("../Label/Label.props").default, "disabled">, unknown, Omit<import("../Helper/Helper.props").default, "validationStatus">, import("..").BodyTextProps>;
3
+ export declare const FormFieldComponent: import("@gluestack-ui/form-control/lib/types").IFormControlComponentType<import("react-native").ViewProps, Omit<import("../Helper/Helper.props").default, "validationStatus">, Omit<import("../Helper/Helper.props").default, "validationStatus">, Omit<import("..").IconProps, "as">, unknown, Omit<import("../Label/Label.props").default, "disabled">, unknown, Omit<import("../Helper/Helper.props").default, "validationStatus">, import("../BodyText").BodyTextProps>;
4
4
  export declare const FormFieldLabel: import("react").ForwardRefExoticComponent<import("react").RefAttributes<unknown>> & {
5
5
  Text: import("react").ForwardRefExoticComponent<Omit<Omit<import("../Label/Label.props").default, "disabled">, "ref"> & import("react").RefAttributes<Omit<import("../Label/Label.props").default, "disabled">>>;
6
6
  };
7
7
  export declare const FormFieldLabelText: import("react").ForwardRefExoticComponent<Omit<Omit<import("../Label/Label.props").default, "disabled">, "ref"> & import("react").RefAttributes<Omit<import("../Label/Label.props").default, "disabled">>>;
8
8
  export declare const FormFieldHelper: import("react").ForwardRefExoticComponent<Omit<import("../Helper/Helper.props").default, "validationStatus"> & import("react").RefAttributes<Omit<import("../Helper/Helper.props").default, "validationStatus">>> & {
9
- Text: import("react").ForwardRefExoticComponent<Omit<import("..").BodyTextProps, "ref"> & import("react").RefAttributes<import("..").BodyTextProps>>;
9
+ Text: import("react").ForwardRefExoticComponent<Omit<import("../BodyText").BodyTextProps, "ref"> & import("react").RefAttributes<import("../BodyText").BodyTextProps>>;
10
10
  };
11
- export declare const FormFieldHelperText: import("react").ForwardRefExoticComponent<Omit<import("..").BodyTextProps, "ref"> & import("react").RefAttributes<import("..").BodyTextProps>>;
11
+ export declare const FormFieldHelperText: import("react").ForwardRefExoticComponent<Omit<import("../BodyText").BodyTextProps, "ref"> & import("react").RefAttributes<import("../BodyText").BodyTextProps>>;
12
12
  export declare const FormFieldHelperIcon: {
13
13
  (props: import("..").IconProps): import("react/jsx-runtime").JSX.Element;
14
14
  displayName: string;
15
15
  };
16
16
  export declare const FormFieldValidText: {
17
- (props: import("..").BodyTextProps): import("react/jsx-runtime").JSX.Element;
17
+ (props: import("../BodyText").BodyTextProps): import("react/jsx-runtime").JSX.Element;
18
18
  displayName: string;
19
19
  };
20
20
  export declare const FormFieldInvalidText: {
21
- (props: import("..").BodyTextProps): import("react/jsx-runtime").JSX.Element;
21
+ (props: import("../BodyText").BodyTextProps): import("react/jsx-runtime").JSX.Element;
22
22
  displayName: string;
23
23
  };
24
24
  export declare const FormFieldTextContent: typeof View;
@@ -1,7 +1,8 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { createFormControl } from '@gluestack-ui/form-control';
3
3
  import { useMemo, useState } from 'react';
4
4
  import { View } from 'react-native';
5
+ import { BodyText } from '../BodyText';
5
6
  import { HelperIcon, HelperText } from '../Helper';
6
7
  import { FormFieldContext } from './FormField.context';
7
8
  import FormFieldHelperComponent from './FormFieldHelper';
@@ -56,7 +57,7 @@ const FormField = ({ children, disabled, validationStatus = 'initial', readonly,
56
57
  setShouldHandleAccessibility,
57
58
  shouldHandleAccessibility,
58
59
  ]);
59
- return (_jsx(FormFieldContext.Provider, { value: value, children: _jsxs(FormFieldComponent, { ...props, isDisabled: disabled, isReadOnly: readonly, children: [(!!label || !!helperText) && (_jsxs(FormFieldTextContent, { children: [!!label && (_jsxs(FormFieldLabelText, { variant: labelVariant, importantForAccessibility: shouldHandleAccessibility ? 'no' : undefined, accessibilityElementsHidden: shouldHandleAccessibility, children: [label, !required ? ` (Optional)` : ''] })), !!helperText && (_jsx(FormFieldHelper, { text: helperText, icon: helperIcon, showIcon: !!helperIcon, importantForAccessibility: shouldHandleAccessibility ? 'no' : undefined, accessibilityElementsHidden: shouldHandleAccessibility }))] })), children, !!validText && _jsx(FormFieldValid, { text: validText }), !!invalidText && _jsx(FormFieldInvalidComponent, { text: invalidText })] }) }));
60
+ return (_jsx(FormFieldContext.Provider, { value: value, children: _jsxs(FormFieldComponent, { ...props, isDisabled: disabled, isReadOnly: readonly, children: [(!!label || !!helperText) && (_jsxs(FormFieldTextContent, { children: [!!label && (_jsxs(FormFieldLabelText, { variant: labelVariant, importantForAccessibility: shouldHandleAccessibility ? 'no' : undefined, accessibilityElementsHidden: shouldHandleAccessibility, children: [label, !required ? _jsx(BodyText, { weight: "regular", children: " (Optional)" }) : ''] })), !!helperText && (_jsx(FormFieldHelper, { text: helperText, icon: helperIcon, showIcon: !!helperIcon, importantForAccessibility: shouldHandleAccessibility ? 'no' : undefined, accessibilityElementsHidden: shouldHandleAccessibility }))] })), children, !!validText && _jsx(FormFieldValid, { text: validText }), !!invalidText && _jsx(FormFieldInvalidComponent, { text: invalidText })] }) }));
60
61
  };
61
62
  FormField.displayName = 'FormField';
62
63
  export default FormField;
@@ -3,5 +3,5 @@ import ModalProps from './Modal.props';
3
3
  type Modal<T = any> = BottomSheetModalMethods<T> & {
4
4
  triggerCloseAnimation?: () => void;
5
5
  };
6
- declare const Modal: ({ ref, children, heading, description, showCloseButton, primaryButtonText, secondaryButtonText, onPressPrimaryButton, onPressCloseButton, onPressSecondaryButton, closeOnPrimaryButtonPress, closeOnSecondaryButtonPress, loading, loadingHeading, loadingDescription, fullscreen, image, primaryButtonProps, secondaryButtonProps, closeButtonProps, stickyFooter, ...props }: ModalProps) => import("react/jsx-runtime").JSX.Element;
6
+ declare const Modal: ({ ref, children, heading, description, showCloseButton, primaryButtonText, secondaryButtonText, onPressPrimaryButton, onPressCloseButton, onPressSecondaryButton, closeOnPrimaryButtonPress, closeOnSecondaryButtonPress, loading, loadingHeading, loadingDescription, fullscreen, image, footer, footerStyle, primaryButtonProps, secondaryButtonProps, closeButtonProps, stickyFooter, ...props }: ModalProps) => import("react/jsx-runtime").JSX.Element;
7
7
  export default Modal;