Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@observation.org/react-native-components",
"version": "1.70.0",
"version": "1.71.0",
"main": "src/index.ts",
"repository": "git@github.com:observation/react-native-components.git",
"author": "Observation.org",
Expand Down
2 changes: 1 addition & 1 deletion src/components/BackButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const BackButton = ({ navigation }: Props) => (
<IconButton
containerStyle={{ padding: theme.margin.common }}
onPress={() => navigation.goBack()}
icon={{ name: 'chevron-left', size: theme.icon.size.extraExtraLarge, color: theme.color.primary }}
icon={{ name: 'chevron-left', size: theme.icon.size.extraExtraLarge, color: theme.color.primary500 }}
/>
)

Expand Down
2 changes: 1 addition & 1 deletion src/components/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const styles = StyleSheet.create({
container: {
...theme.shadow.ios,
borderTopWidth: 1 / 3,
borderTopColor: theme.color.greySemi,
borderTopColor: theme.color.grey300,
},
bottomSheetContainer: {
...theme.shadow.android,
Expand Down
2 changes: 1 addition & 1 deletion src/components/BrandIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type Props = {

export const BrandIcon = ({ name, color, size }: Props) => {
const icon = BrandIcons[name]
const iconColor = color ?? theme.color.primary
const iconColor = color ?? theme.color.primary500
const iconSize = size ?? theme.icon.size.large
const FontAwesomeIconTypeErased = FontAwesomeIcon as unknown as any

Expand Down
2 changes: 1 addition & 1 deletion src/components/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const styles = StyleSheet.create({
fontSize: theme.font.size.medium,
},
chipContainer: {
backgroundColor: theme.color.successLight,
backgroundColor: theme.color.accentLime400,
paddingHorizontal: theme.margin.common,
paddingVertical: theme.margin.half,
borderRadius: theme.margin.common,
Expand Down
4 changes: 2 additions & 2 deletions src/components/ContentImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const styles = StyleSheet.create({
...theme.shadow.android,
...theme.roundedLarge,
borderWidth: 1,
borderColor: theme.color.greyLight,
borderColor: theme.color.grey50,
},
imageContainer: {
margin: theme.margin.common,
Expand All @@ -91,6 +91,6 @@ const styles = StyleSheet.create({
},
description: {
...font.small,
color: theme.color.greyBase,
color: theme.color.grey500,
},
})
2 changes: 1 addition & 1 deletion src/components/Date.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type Props = {

const Date = ({ date, containerStyle }: Props) => (
<IconText
icon={<Icon name="calendar-day" style={'solid'} color={theme.color.greySemi} size={theme.icon.size.medium} />}
icon={<Icon name="calendar-day" style={'solid'} color={theme.color.grey300} size={theme.icon.size.medium} />}
text={date}
style={{
containerStyle,
Expand Down
4 changes: 2 additions & 2 deletions src/components/FilterButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Props = {

const FilterButton = ({ content, onPress, active = false, style }: Props) => {
const buttonStyle = active ? styles.activeButton : styles.button
const contentColor = active ? theme.color.white : theme.color.greyDark
const contentColor = active ? theme.color.white : theme.color.grey800
return (
<TouchableOpacity
testID="touchable-opacity"
Expand All @@ -36,6 +36,6 @@ const styles = StyleSheet.create({
backgroundColor: theme.color.white,
},
activeButton: {
backgroundColor: theme.color.primary,
backgroundColor: theme.color.primary500,
},
})
2 changes: 1 addition & 1 deletion src/components/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type IconProps = IconAppearanceProps & {
export const Icon = ({ name, color, size, testID, style, rotation }: IconProps): React.ReactElement => {
const iconStyle = style ?? 'light'
const icon = iconStyle === 'light' ? Icons[name].light : Icons[name].solid
const iconColor = color ?? theme.color.primary
const iconColor = color ?? theme.color.primary500
const iconSize = size ?? theme.icon.size.large
const transform = rotation ? { rotate: rotation } : undefined

Expand Down
10 changes: 5 additions & 5 deletions src/components/InputField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const InputField = ({
const hasErrors = !!errorMessage
const borderColor = theme.getBorderColor({ isFocused, hasErrors })

const inputContainerStyle = disabled ? { backgroundColor: theme.color.greyLight } : {}
const placeholderTextColor = disabled ? theme.color.greySemi : theme.color.placeholder
const inputContainerStyle = disabled ? { backgroundColor: theme.color.grey50 } : {}
const placeholderTextColor = disabled ? theme.color.grey300 : theme.color.grey500

const layoutHandler = inputProps?.autoFocus
? () => {
Expand Down Expand Up @@ -82,7 +82,7 @@ const InputField = ({
</View>
{errorMessage && (
<IconText
icon={<Icon name="exclamation-triangle" size={theme.icon.size.small} color={theme.color.error} />}
icon={<Icon name="exclamation-triangle" size={theme.icon.size.small} color={theme.color.error500} />}
text={errorMessage}
style={{
textStyle: [styles.errorStyle, errorStyle],
Expand Down Expand Up @@ -117,10 +117,10 @@ const styles = StyleSheet.create({
},
errorStyle: {
...font.small,
color: theme.color.error,
color: theme.color.error500,
},
descriptionStyle: {
...font.small,
color: theme.color.greyDark,
color: theme.color.grey800,
},
})
2 changes: 1 addition & 1 deletion src/components/Location.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type Props = {

const Location = ({ location, containerStyle }: Props) => (
<IconText
icon={<Icon name="map-marker-alt" style="solid" color={theme.color.greySemi} size={theme.icon.size.medium} />}
icon={<Icon name="map-marker-alt" style="solid" color={theme.color.grey300} size={theme.icon.size.medium} />}
text={location}
style={{
containerStyle,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Notification = ({ count, style }: Props) => (
style={[
style,
{
backgroundColor: theme.color.error,
backgroundColor: theme.color.error500,
borderRadius: 9,
width: 18,
height: 18,
Expand Down
2 changes: 1 addition & 1 deletion src/components/NotificationPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const NotificationPopup = ({ visible, title, message, leftButton, rightButton, o

{onClose && (
<TouchableOpacity testID="close" onPress={onClose} activeOpacity={0.5} style={styles.closeButton}>
<Icon name="times" color={theme.color.greyBase} size={theme.icon.size.extraLarge} />
<Icon name="times" color={theme.color.grey500} size={theme.icon.size.extraLarge} />
</TouchableOpacity>
)}
</View>
Expand Down
2 changes: 1 addition & 1 deletion src/components/PageIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const styles = StyleSheet.create({
width: 8,
margin: 4,
...theme.rounded,
backgroundColor: theme.color.greyBase,
backgroundColor: theme.color.grey500,
},
smallDot: {
margin: 6,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ const styles = StyleSheet.create({
backgroundColor: theme.color.white,
...theme.shadowSmall.android,
borderTopWidth: 1,
borderColor: theme.color.greyLight,
borderColor: theme.color.grey50,
},
})
2 changes: 1 addition & 1 deletion src/components/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const styles = StyleSheet.create({
alignItems: 'stretch',
justifyContent: 'center',
flexDirection: 'column',
backgroundColor: theme.color.modalBackground,
backgroundColor: theme.overlay.grey60,
},
viewPort: {
flexDirection: 'column',
Expand Down
8 changes: 4 additions & 4 deletions src/components/ProgressBarList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const ProgressBarList = ({ progressBars, separator }: Props) => {
size={theme.icon.size.small}
/>
) : (
<Icon name="circle-check" color={theme.color.greySemi} size={theme.icon.size.small} />
<Icon name="circle-check" color={theme.color.grey300} size={theme.icon.size.small} />
)}
</View>
))}
Expand Down Expand Up @@ -130,7 +130,7 @@ const styles = StyleSheet.create({
},
label: {
...font.small,
color: theme.color.white70,
color: theme.overlay.white70,
justifyContent: 'center',
lineHeight: barHeight,
},
Expand All @@ -141,7 +141,7 @@ const styles = StyleSheet.create({
flexDirection: 'row',
borderTopRightRadius: borderRadius,
borderBottomRightRadius: borderRadius,
backgroundColor: theme.color.greySemi,
backgroundColor: theme.color.grey300,
width: '100%',
},
numbersContainer: {
Expand All @@ -153,7 +153,7 @@ const styles = StyleSheet.create({
},
denominator: {
...font.small,
color: theme.color.white70,
color: theme.overlay.white70,
lineHeight: barHeight,
},
numerator: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Tooltip = ({
{closable && (
<View style={{ ...styles.iconContainer, marginLeft: theme.margin.common }}>
<TouchableOpacity testID="close" onPress={onClose} activeOpacity={0.5} accessibilityLabel="close">
<Icon name="times" color={theme.color.greyBase} size={theme.icon.size.extraLarge} />
<Icon name="times" color={theme.color.grey500} size={theme.icon.size.extraLarge} />
</TouchableOpacity>
</View>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/__tests__/BrandIcon.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('BrandIcon', () => {
})

test('With color', () => {
const { toJSON } = render(<BrandIcon name="wikipedia-w" color={theme.color.error} />)
const { toJSON } = render(<BrandIcon name="wikipedia-w" color={theme.color.error500} />)
expect(toJSON()).toMatchSnapshot()
})

Expand Down
2 changes: 1 addition & 1 deletion src/components/__tests__/FilterButton.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('FilterButton', () => {
test('Disabled', () => {
const { toJSON } = render(<FilterButton content={content} active={false} style={{ flex: 1 }} />)
expect(toJSON()).toMatchSnapshot()
expect(content).toHaveBeenCalledWith({ color: theme.color.greyDark })
expect(content).toHaveBeenCalledWith({ color: theme.color.grey800 })
})
})

Expand Down
4 changes: 2 additions & 2 deletions src/components/__tests__/__snapshots__/Chip.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ exports[`Chip Rendering All props 1`] = `
style={
[
{
"backgroundColor": "#9DC556",
"backgroundColor": "#9BC454",
"borderRadius": 16,
"justifyContent": "center",
"minWidth": 44,
Expand Down Expand Up @@ -128,7 +128,7 @@ exports[`Chip Rendering Required props 1`] = `
style={
[
{
"backgroundColor": "#9DC556",
"backgroundColor": "#9BC454",
"borderRadius": 16,
"justifyContent": "center",
"minWidth": 44,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ exports[`ContentImage Interaction Click the image to show the lightbox 1`] = `
style={
{
"backgroundColor": "#FFFFFF",
"borderColor": "#F8F9FA",
"borderColor": "#F9FAFB",
"borderRadius": 8,
"borderWidth": 1,
"elevation": 6,
Expand Down Expand Up @@ -518,7 +518,7 @@ exports[`ContentImage Interaction Close the lightbox 1`] = `
style={
{
"backgroundColor": "#FFFFFF",
"borderColor": "#F8F9FA",
"borderColor": "#F9FAFB",
"borderRadius": 8,
"borderWidth": 1,
"elevation": 6,
Expand Down Expand Up @@ -642,7 +642,7 @@ exports[`ContentImage Rendering With alt title 1`] = `
style={
{
"backgroundColor": "#FFFFFF",
"borderColor": "#F8F9FA",
"borderColor": "#F9FAFB",
"borderRadius": 8,
"borderWidth": 1,
"elevation": 6,
Expand Down Expand Up @@ -766,7 +766,7 @@ exports[`ContentImage Rendering With alt title and text 1`] = `
style={
{
"backgroundColor": "#FFFFFF",
"borderColor": "#F8F9FA",
"borderColor": "#F9FAFB",
"borderRadius": 8,
"borderWidth": 1,
"elevation": 6,
Expand Down Expand Up @@ -905,7 +905,7 @@ exports[`ContentImage Rendering With alt title ending in delimiter 1`] = `
style={
{
"backgroundColor": "#FFFFFF",
"borderColor": "#F8F9FA",
"borderColor": "#F9FAFB",
"borderRadius": 8,
"borderWidth": 1,
"elevation": 6,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ exports[`InputField Rendering Disabled 1`] = `
<View
style={
{
"backgroundColor": "#F8F9FA",
"backgroundColor": "#F9FAFB",
"flexDirection": "row",
}
}
Expand Down Expand Up @@ -482,7 +482,7 @@ exports[`InputField Rendering With focus 1`] = `
style={
[
{
"borderColor": "#66A3D0",
"borderColor": "#67A4D0",
},
{
"borderRadius": 4,
Expand Down Expand Up @@ -538,7 +538,7 @@ exports[`InputField Rendering With focus and an error message 1`] = `
style={
[
{
"borderColor": "#66A3D0",
"borderColor": "#67A4D0",
},
{
"borderRadius": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ exports[`NotificationPopup Rendering Left and right buttons 1`] = `
style={
{
"alignItems": "stretch",
"backgroundColor": "hsla(0, 0%, 18.1%, 0.6)",
"backgroundColor": "#66666699",
"flex": 1,
"flexDirection": "column",
"justifyContent": "center",
Expand Down Expand Up @@ -317,7 +317,7 @@ exports[`NotificationPopup Rendering Only left button 1`] = `
style={
{
"alignItems": "stretch",
"backgroundColor": "hsla(0, 0%, 18.1%, 0.6)",
"backgroundColor": "#66666699",
"flex": 1,
"flexDirection": "column",
"justifyContent": "center",
Expand Down Expand Up @@ -526,7 +526,7 @@ exports[`NotificationPopup Rendering With close button 1`] = `
style={
{
"alignItems": "stretch",
"backgroundColor": "hsla(0, 0%, 18.1%, 0.6)",
"backgroundColor": "#66666699",
"flex": 1,
"flexDirection": "column",
"justifyContent": "center",
Expand Down
4 changes: 2 additions & 2 deletions src/components/__tests__/__snapshots__/Panel.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ exports[`Panel Rendering 1`] = `
[
{
"backgroundColor": "#FFFFFF",
"borderColor": "#F8F9FA",
"borderColor": "#F9FAFB",
"borderTopWidth": 1,
"elevation": 4,
"paddingVertical": 16,
Expand Down Expand Up @@ -68,7 +68,7 @@ exports[`Panel Rendering without top shadow 1`] = `
[
{
"backgroundColor": "#FFFFFF",
"borderColor": "#F8F9FA",
"borderColor": "#F9FAFB",
"borderTopWidth": 1,
"elevation": 4,
"paddingVertical": 16,
Expand Down
2 changes: 1 addition & 1 deletion src/components/__tests__/__snapshots__/Popup.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ exports[`Popup Rendering 1`] = `
style={
{
"alignItems": "stretch",
"backgroundColor": "hsla(0, 0%, 18.1%, 0.6)",
"backgroundColor": "#66666699",
"flex": 1,
"flexDirection": "column",
"justifyContent": "center",
Expand Down
Loading