Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/7573-UpdateAppColorsToComponentLibrary #9199

Merged
merged 33 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c31f14e
Migrate app colors to component library colors
theodur Jul 25, 2024
38bd5e6
Upgrade mobile-tokens package
theodur Jul 25, 2024
4dfad1f
Update primaryTextColor
theodur Jul 25, 2024
cd3d4c9
Remove unused mobile app colors
theodur Jul 25, 2024
1eaf279
Merge branch 'develop' into feature/7573-UpdateAppColorsToComponentLi…
theodur Jul 25, 2024
71d9258
Update import name
theodur Jul 25, 2024
eadb2a7
Remove unused switch and segmented control colors
theodur Jul 25, 2024
679bd48
Remove unused button colors
theodur Jul 25, 2024
d4c3810
Remove unused colors
theodur Jul 26, 2024
c4ca032
Replace remaining colors with component-library colors
theodur Jul 30, 2024
6a98613
Remove app specific color constants
theodur Jul 30, 2024
88b0c19
Update import name
theodur Jul 30, 2024
d36ffa7
Fix linting error
theodur Jul 30, 2024
30c5bf9
Update border color for warning alert
theodur Aug 12, 2024
08cf12a
Update gray colors to gray80
theodur Aug 12, 2024
3917493
Remove unused nav icon color
theodur Aug 12, 2024
29007fe
Rename snackbar text color
theodur Aug 12, 2024
af2c98c
Merge branch 'develop' into feature/7573-UpdateAppColorsToComponentLi…
TKDickson Aug 14, 2024
a180264
Merge branch 'develop' into feature/7573-UpdateAppColorsToComponentLi…
theodur Oct 30, 2024
440254c
Fix linting error
theodur Oct 30, 2024
73ca7e1
Update bullet color
theodur Oct 30, 2024
cf2595f
Resolve CrisiLineButton color
theodur Oct 30, 2024
e309d79
Update text color for header button
theodur Oct 30, 2024
6592319
Add active activity button color
theodur Oct 30, 2024
eadf3a8
Update RefillRequest icon color
theodur Oct 30, 2024
29feecc
Sync yarn.lock
theodur Oct 31, 2024
86a776a
Update colors based
theodur Nov 5, 2024
60870b3
Update primary text color to VADS primary dark
theodur Nov 5, 2024
8ee2c7e
Remove text color in TextLine prop
theodur Nov 11, 2024
cc5870f
Update primary text color for light mode
theodur Nov 12, 2024
c63b83d
Fix bullet color in carousel
theodur Nov 12, 2024
d2a4e51
Merge branch 'develop' into feature/7573-UpdateAppColorsToComponentLi…
rbontrager Nov 14, 2024
e6c7248
Resolve LoginScreen conflict
theodur Nov 14, 2024
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
8 changes: 4 additions & 4 deletions VAMobile/src/components/ActivityButton.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { FC } from 'react'
import { Linking, Platform, Pressable, PressableStateCallbackType, ViewStyle } from 'react-native'

import { colors } from '@department-of-veterans-affairs/mobile-tokens'

import { Box, TextView, VAIcon } from 'components'
import { useTheme } from 'utils/hooks'
import { WaygateToggleType, waygateNativeAlert } from 'utils/waygateConfig'

import colors from '../styles/themes/VAColors'

interface ActivityButtonProps {
/** Text for header */
title: string
Expand All @@ -28,7 +28,7 @@ const ActivityButton: FC<ActivityButtonProps> = ({ title, subText, deepLink }: A
backgroundColor: pressed
? theme.colors.buttonBackground.activityButtonActive
: theme.colors.buttonBackground.activityButton,
shadowColor: colors.black,
shadowColor: colors.vadsColorBlack,
...Platform.select({
ios: {
shadowOffset: { width: 0, height: 6 },
Expand Down Expand Up @@ -80,7 +80,7 @@ const ActivityButton: FC<ActivityButtonProps> = ({ title, subText, deepLink }: A
height={24}
name="RightArrowInCircle"
fill={theme.colors.icon.activityButton}
fill2={theme.colors.icon.transparent}
fill2={'transparent'}
ml={theme.dimensions.listItemDecoratorMarginLeft}
preventScaling={true}
/>
Expand Down
5 changes: 2 additions & 3 deletions VAMobile/src/components/AnnouncementBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import React, { FC } from 'react'
import { Platform, Pressable, PressableStateCallbackType, ViewStyle } from 'react-native'

import { Icon } from '@department-of-veterans-affairs/mobile-component-library/src/components/Icon/Icon'
import { colors } from '@department-of-veterans-affairs/mobile-tokens'

import { Box, TextView } from 'components'
import { useExternalLink, useTheme } from 'utils/hooks'

import colors from '../styles/themes/VAColors'

interface AnnouncementBannerProps {
/** Text for announcement title */
title: string
Expand All @@ -26,7 +25,7 @@ const AnnouncementBanner: FC<AnnouncementBannerProps> = ({ title, link, a11yLabe
paddingVertical: theme.dimensions.formMarginBetween,
paddingHorizontal: theme.dimensions.cardPadding,
backgroundColor: pressed ? theme.colors.background.listActive : theme.colors.buttonBackground.announcementBanner,
shadowColor: colors.black,
shadowColor: colors.vadsColorBlack,
...Platform.select({
ios: {
shadowOffset: { width: 0, height: 6 },
Expand Down
2 changes: 1 addition & 1 deletion VAMobile/src/components/BackButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const BackButton: FC<BackButtonProps> = ({
{chevron}
<TextView
variant="ActionBar"
color={webview ? 'footerButton' : undefined}
color={webview ? 'link' : undefined}
ml={theme.dimensions.textIconMargin}
allowFontScaling={false}
accessible={false}>
Expand Down
20 changes: 4 additions & 16 deletions VAMobile/src/components/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,14 @@ import { FlexAlignType, View, ViewProps } from 'react-native'
import styled from 'styled-components'
import _ from 'underscore'

import {
VABackgroundColors,
VABorderColors,
VAButtonBackgroundColors,
VAButtonBorderColors,
VAListTagColors,
VATheme,
} from 'styles/theme'
import { VABackgroundColors, VABorderColors, VAButtonBackgroundColors, VATheme } from 'styles/theme'
import { themeFn } from 'utils/theme'

type VABackgroundColorsVariant = keyof VABackgroundColors
type VAButtonBackgroundColorsVariant = keyof VAButtonBackgroundColors
type VAListTagColorsVariant = keyof VAListTagColors
export type BackgroundVariant = VABackgroundColorsVariant | VAButtonBackgroundColorsVariant | VAListTagColorsVariant
export type BackgroundVariant = VABackgroundColorsVariant | VAButtonBackgroundColorsVariant

type VABorderColorsVariant = keyof VABorderColors
type VAButtonBorderColorsVariant = keyof VAButtonBorderColors
export type BorderColorVariant = VABorderColorsVariant | VAButtonBackgroundColorsVariant
export type BorderStyles = 'none' | 'dotted' | 'solid' | 'dashed'
export type BorderWidths = 'default' | number
Expand Down Expand Up @@ -194,8 +185,7 @@ const getBackgroundColor = (theme: VATheme, bgVariant: BackgroundVariant | undef
}
return (
theme.colors.background[bgVariant as VABackgroundColorsVariant] ||
theme.colors.buttonBackground[bgVariant as VAButtonBackgroundColorsVariant] ||
theme.colors.listTag[bgVariant as VAListTagColorsVariant]
theme.colors.buttonBackground[bgVariant as VAButtonBackgroundColorsVariant]
)
}

Expand All @@ -218,9 +208,7 @@ const generateBorderStyles = (
}

if (color) {
styles[`border${dir}-color`] =
theme.colors.border[color as VABorderColorsVariant] ||
theme.colors.buttonBorder[color as VAButtonBorderColorsVariant]
styles[`border${dir}-color`] = theme.colors.border[color as VABorderColorsVariant]
}
return styles
}
Expand Down
2 changes: 1 addition & 1 deletion VAMobile/src/components/DescriptiveBackButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const DescriptiveBackButton: FC<DescBackButtonProps> = ({
<VAIcon mt={1} name={'ChevronLeft'} fill={theme.colors.icon.link} width={15} height={13} maxWidth={25} />
<TextView
variant="DescriptiveBackButton"
color="descriptiveBackButton"
color="link"
ml={theme.dimensions.textIconMargin}
allowFontScaling={false}
accessible={false}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ const PickerList: FC<PickerListProps> = ({ items, title, titleA11yLabel }) => {
// Move all of the properties except text lines to the standard list item object
const { text, icon, testId, isSelected, detoxTestID, ...listItemObj } = item

const textLine = icon
? [{ text, iconProps: icon, color: icon.fill } as TextLineWithIconProps]
: [{ text } as TextLine]
const textLine = icon ? [{ text, iconProps: icon } as TextLineWithIconProps] : [{ text } as TextLine]
const content = <TextLines listOfText={textLine} />

const backgroundColor = isSelected ? 'pickerSelectedItem' : 'list'
Expand Down
2 changes: 1 addition & 1 deletion VAMobile/src/components/IconWithText/IconWithText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const IconWithText: FC<IconWithTextProps> = ({ label, labelColor, labelA11y, mt,
const textProps: TextViewProps = {
variant: 'textWithIconButton',
mt: mt || 3, // 6px total combined with line height
color: labelColor || 'textWithIconButton',
color: labelColor || 'link',
accessibilityLabel: labelA11y,
allowFontScaling: false,
}
Expand Down
8 changes: 4 additions & 4 deletions VAMobile/src/components/LargeNavButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import ContentLoader, { Rect } from 'react-content-loader/native'
import { useTranslation } from 'react-i18next'
import { Platform, Pressable, PressableStateCallbackType, ViewStyle } from 'react-native'

import { colors } from '@department-of-veterans-affairs/mobile-tokens'

import { Box, TextView, VAIcon } from 'components'
import { NAMESPACE } from 'constants/namespaces'
import { a11yHintProp } from 'utils/accessibility'
import { useTheme } from 'utils/hooks'

import colors from '../styles/themes/VAColors'

const SkeletonLoader = () => {
const theme = useTheme()
return (
Expand Down Expand Up @@ -62,7 +62,7 @@ const LargeNavButton: FC<HomeNavButtonProps> = ({
paddingVertical: theme.dimensions.cardPadding,
paddingHorizontal: theme.dimensions.buttonPadding,
marginBottom: theme.dimensions.condensedMarginBetween,
shadowColor: colors.black,
shadowColor: colors.vadsColorBlack,
...Platform.select({
ios: {
shadowOffset: { width: 0, height: 2 },
Expand Down Expand Up @@ -107,7 +107,7 @@ const LargeNavButton: FC<HomeNavButtonProps> = ({
height={24}
name="RightArrowInCircle"
fill={theme.colors.icon.largeNavButton}
fill2={theme.colors.icon.transparent}
fill2={'transparent'}
ml={theme.dimensions.listItemDecoratorMarginLeft}
preventScaling={true}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { FC } from 'react'
import { ViewStyle } from 'react-native'

import { colors } from '@department-of-veterans-affairs/mobile-tokens'
import LottieView from 'lottie-react-native'

import { Box, TextView, VAScrollView } from 'components'
import colors from 'styles/themes/VAColors'
import { useTheme } from 'utils/hooks'

export type LoadingComponentProps = {
Expand Down Expand Up @@ -51,6 +51,8 @@ const LoadingComponent: FC<LoadingComponentProps> = ({
alignContent: 'center',
}

const spinnerIconColor = spinnerColor || colors.vadsColorPrimary

const getSpinner = () => {
return (
<LottieView
Expand All @@ -62,11 +64,11 @@ const LoadingComponent: FC<LoadingComponentProps> = ({
colorFilters={[
{
keypath: 'Shape Layer 9',
color: spinnerColor || colors.primary,
color: spinnerIconColor,
},
{
keypath: 'Shape Layer 11',
color: spinnerColor || colors.primary,
color: spinnerIconColor,
},
]}
/>
Expand Down
6 changes: 2 additions & 4 deletions VAMobile/src/components/Menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import {

import theme from 'styles/themes/standardTheme'

import colors from '../../styles/themes/VAColors'

export enum Position {
TOP_LEFT,
TOP_RIGHT,
Expand Down Expand Up @@ -414,14 +412,14 @@ const styles = StyleSheet.create({
/* Shadow */
...Platform.select({
ios: {
shadowColor: colors.black,
shadowColor: 'black',
shadowOffset: { width: 0, height: 4 },
shadowOpacity: 0.6,
shadowRadius: 4,
},
android: {
elevation: 20,
shadowColor: colors.black,
shadowColor: 'black',
},
}),
},
Expand Down
5 changes: 3 additions & 2 deletions VAMobile/src/components/Nametag/Nametag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ import React, { useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { Platform, Pressable, PressableProps } from 'react-native'

import { colors } from '@department-of-veterans-affairs/mobile-tokens'

import { useAuthorizedServices } from 'api/authorizedServices/getAuthorizedServices'
import { useServiceHistory } from 'api/militaryService'
import { usePersonalInformation } from 'api/personalInformation/getPersonalInformation'
import { BackgroundVariant, Box, MilitaryBranchEmblem, TextView, VAIcon } from 'components'
import { UserAnalytics } from 'constants/analytics'
import { NAMESPACE } from 'constants/namespaces'
import colors from 'styles/themes/VAColors'
import { setAnalyticsUserProperty } from 'utils/analytics'
import { useRouteNavigation, useTheme } from 'utils/hooks'

Expand Down Expand Up @@ -58,7 +59,7 @@ export const Nametag = () => {
marginBottom: theme.dimensions.standardMarginBetween,
paddingRight: theme.dimensions.buttonPadding,
marginHorizontal: theme.dimensions.condensedMarginBetween,
shadowColor: colors.black,
shadowColor: colors.vadsColorBlack,
...Platform.select({
ios: {
shadowOffset: { width: 0, height: 6 },
Expand Down
2 changes: 1 addition & 1 deletion VAMobile/src/components/NavigationTabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const NavigationTabBar: FC<NavigationTabBarProps> = ({ state, navigation, transl
name: 'Home',
fill: isFocused ? theme.colors.icon.active : theme.colors.icon.inactive,
label: routeName,
labelColor: isFocused ? 'textWithIconButton' : 'textWithIconButtonInactive',
labelColor: isFocused ? 'link' : 'textWithIconButtonInactive',
height: 24,
width: 24,
}
Expand Down
4 changes: 2 additions & 2 deletions VAMobile/src/components/PhotoAdd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const PhotoAdd: FC<PhotoAddProps> = ({ width, height, onPress }) => {

const textProps: TextViewProps = {
variant: 'HelperTextBold',
color: 'footerButton',
color: 'link',
textAlign: 'center',
width: width,
maxFontSizeMultiplier: 2.5,
Expand All @@ -54,7 +54,7 @@ const PhotoAdd: FC<PhotoAddProps> = ({ width, height, onPress }) => {
width={32}
height={32}
fill={themeColor.icon.photoAdd}
fill2={themeColor.icon.transparent}
fill2={'transparent'}
maxWidth={70}
/>
</Box>
Expand Down
7 changes: 3 additions & 4 deletions VAMobile/src/components/SnackBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { NAMESPACE } from 'constants/namespaces'
import { triggerHaptic } from 'utils/haptics'
import { useAccessibilityFocus, useTheme } from 'utils/hooks'

import colors from '../styles/themes/VAColors'
import { BoxProps } from './Box'
import TextView from './TextView'
import VAIcon, { VAIconProps } from './VAIcon'
Expand Down Expand Up @@ -71,7 +70,7 @@ const SnackBar: FC<ToastProps> = (toast) => {
flexWrap: 'wrap',
display: 'flex',
style: {
shadowColor: colors.black,
shadowColor: 'black',
shadowOffset: { width: 0, height: 4 },
shadowOpacity: 0.6,
},
Expand All @@ -86,7 +85,7 @@ const SnackBar: FC<ToastProps> = (toast) => {

const messageProp: TextViewProps = {
variant: 'HelperText',
color: 'snackBarTxt',
color: 'snackBar',
}

// adjust style depending on if there are 1 or 2 buttons
Expand Down Expand Up @@ -122,7 +121,7 @@ const SnackBar: FC<ToastProps> = (toast) => {
const snackBarIconProps: VAIconProps = {
name: isError ? 'ExclamationTriangle' : 'CircleCheckMark',
fill: themeColor.icon.snackBarIcon,
fill2: themeColor.icon.transparent,
fill2: 'transparent',
height: 18,
width: 18,
}
Expand Down
7 changes: 3 additions & 4 deletions VAMobile/src/components/Templates/HeaderBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { IconProps } from '@department-of-veterans-affairs/mobile-component-libr

import { Box, BoxProps, DescriptiveBackButton, IconWithText, TextView, TextViewProps } from 'components'
import MenuView, { MenuViewActionsType } from 'components/Menu'
import colors from 'styles/themes/VAColors'
import { useAccessibilityFocus, useIsScreenReaderEnabled, useTheme } from 'utils/hooks'

export type HeaderLeftButtonProps = {
Expand Down Expand Up @@ -170,7 +169,7 @@ const HeaderBanner: FC<HeaderBannerProps> = ({
mb: !dividerMarginBypass && bannerDivider ? theme.dimensions.standardMarginBetween : 0,
style: bannerShadow
? {
shadowColor: colors.black,
shadowColor: 'black',
...Platform.select({
ios: {
shadowOffset: { width: 0, height: 6 },
Expand Down Expand Up @@ -201,7 +200,7 @@ const HeaderBanner: FC<HeaderBannerProps> = ({
const constrainTitle = totalTextLength > TEXT_CONSTRAINT_THRESHOLD
if (leftButton) {
leftTextViewProps = {
color: 'footerButton',
color: 'link',
variant: 'MobileBody',
accessibilityLabel: leftButton.a11yLabel,
allowFontScaling: false,
Expand All @@ -228,7 +227,7 @@ const HeaderBanner: FC<HeaderBannerProps> = ({

if (rightButton) {
rightTextViewProps = {
color: 'footerButton',
color: 'link',
variant: 'MobileBody',
accessibilityLabel: rightButton.a11yLabel,
allowFontScaling: false,
Expand Down
Loading
Loading