@terreno/ui 0.23.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AiSuggestionBox.d.ts +11 -0
- package/dist/AiSuggestionBox.js +50 -23
- package/dist/AiSuggestionBox.js.map +1 -1
- package/dist/Button.js +4 -3
- package/dist/Button.js.map +1 -1
- package/dist/Common.d.ts +15 -2
- package/dist/Common.js.map +1 -1
- package/dist/IconButton.js +8 -4
- package/dist/IconButton.js.map +1 -1
- package/dist/icons/SparklesIcon.d.ts +7 -0
- package/dist/icons/SparklesIcon.js +32 -0
- package/dist/icons/SparklesIcon.js.map +1 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +1 -0
- package/dist/icons/index.js.map +1 -1
- package/package.json +2 -2
- package/src/ActionSheet.test.tsx +96 -0
- package/src/AiSuggestionBox.test.tsx +184 -15
- package/src/AiSuggestionBox.tsx +72 -55
- package/src/Button.test.tsx +31 -1
- package/src/Button.tsx +5 -4
- package/src/Common.ts +16 -2
- package/src/ErrorBoundary.test.tsx +3 -4
- package/src/IconButton.test.tsx +14 -0
- package/src/IconButton.tsx +9 -4
- package/src/__snapshots__/AiSuggestionBox.test.tsx.snap +489 -102
- package/src/__snapshots__/Button.test.tsx.snap +18 -1
- package/src/__snapshots__/DecimalRangeActionSheet.test.tsx.snap +2 -0
- package/src/__snapshots__/ErrorPage.test.tsx.snap +1 -0
- package/src/__snapshots__/HeightActionSheet.test.tsx.snap +2 -0
- package/src/__snapshots__/HeightField.test.tsx.snap +5 -0
- package/src/__snapshots__/IconButton.test.tsx.snap +4 -0
- package/src/__snapshots__/InfoModalIcon.test.tsx.snap +4 -0
- package/src/__snapshots__/Modal.test.tsx.snap +3 -0
- package/src/__snapshots__/NumberPickerActionSheet.test.tsx.snap +2 -0
- package/src/__snapshots__/Page.test.tsx.snap +1 -0
- package/src/icons/SparklesIcon.test.tsx +16 -0
- package/src/icons/SparklesIcon.tsx +38 -0
- package/src/icons/__snapshots__/SparklesIcon.test.tsx.snap +47 -0
- package/src/icons/index.ts +1 -0
- package/src/login/__snapshots__/LoginScreen.test.tsx.snap +3 -0
- package/src/signUp/__snapshots__/SignUpScreen.test.tsx.snap +2 -0
- package/src/testing/resolveTestId.test.ts +101 -0
package/src/IconButton.tsx
CHANGED
|
@@ -56,6 +56,7 @@ const IconButtonComponent: FC<IconButtonProps> = ({
|
|
|
56
56
|
indicator,
|
|
57
57
|
indicatorText,
|
|
58
58
|
loading: propsLoading = false,
|
|
59
|
+
size = "default",
|
|
59
60
|
testID,
|
|
60
61
|
variant = "primary",
|
|
61
62
|
withConfirmation = false,
|
|
@@ -93,6 +94,9 @@ const IconButtonComponent: FC<IconButtonProps> = ({
|
|
|
93
94
|
} else if (variant === "destructive") {
|
|
94
95
|
backgroundColor = theme.text.inverted;
|
|
95
96
|
color = theme.text.error;
|
|
97
|
+
} else if (variant === "ghost") {
|
|
98
|
+
backgroundColor = "transparent";
|
|
99
|
+
color = theme.surface.secondaryDark;
|
|
96
100
|
}
|
|
97
101
|
|
|
98
102
|
const indicatorColor = indicator ? theme.surface[indicator] : undefined;
|
|
@@ -134,23 +138,24 @@ const IconButtonComponent: FC<IconButtonProps> = ({
|
|
|
134
138
|
alignItems: "center",
|
|
135
139
|
backgroundColor,
|
|
136
140
|
borderRadius: theme.radius.rounded,
|
|
137
|
-
height: 32,
|
|
141
|
+
height: size === "sm" ? 28 : 32,
|
|
138
142
|
justifyContent: "center",
|
|
139
|
-
width: 32,
|
|
143
|
+
width: size === "sm" ? 28 : 32,
|
|
140
144
|
}}
|
|
141
145
|
testID={testID}
|
|
142
146
|
>
|
|
143
147
|
{loading ? (
|
|
144
148
|
<ActivityIndicator color={color} size="small" />
|
|
145
149
|
) : CustomIcon ? (
|
|
146
|
-
<CustomIcon color={color} size={variant === "navigation" ? 20 : 16} />
|
|
150
|
+
<CustomIcon color={color} size={size === "sm" ? 12 : variant === "navigation" ? 20 : 16} />
|
|
147
151
|
) : (
|
|
148
152
|
<FontAwesome6
|
|
149
153
|
color={color}
|
|
150
154
|
name={iconName}
|
|
151
155
|
selectable={undefined}
|
|
152
|
-
size={variant === "navigation" ? 20 : 16}
|
|
156
|
+
size={size === "sm" ? 12 : variant === "navigation" ? 20 : 16}
|
|
153
157
|
solid
|
|
158
|
+
style={{textAlign: "center"}}
|
|
154
159
|
/>
|
|
155
160
|
)}
|
|
156
161
|
{Boolean(indicator) && (
|