Skip to content

Commit

Permalink
Merge branch 'main' into chore/6865-app-build-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
timwright12 authored Oct 3, 2023
2 parents c846606 + 1f66efc commit 8885fa4
Show file tree
Hide file tree
Showing 9 changed files with 226 additions and 210 deletions.
4 changes: 2 additions & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@department-of-veterans-affairs/mobile-component-library",
"version": "0.0.18",
"version": "0.0.22",
"description": "VA Design System Mobile Component Library",
"main": "src/index.tsx",
"scripts": {
Expand Down Expand Up @@ -38,7 +38,7 @@
},
"homepage": "https://department-of-veterans-affairs.github.io/va-mobile-library",
"dependencies": {
"@department-of-veterans-affairs/mobile-tokens": "0.0.7",
"@department-of-veterans-affairs/mobile-tokens": "0.0.10",
"@os-team/i18next-react-native-language-detector": "^1.0.28",
"i18next": "^23.4.3",
"react-i18next": "^13.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const twoSegments: Story = {
'You have 3 unread messages. Review messages in your inbox',
'Review your folders',
],
testIDs: ['test-id-1', 'test-id-2'],
},
parameters: {
design: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Colors } from '@department-of-veterans-affairs/mobile-tokens'
import * as DesignTokens from '@department-of-veterans-affairs/mobile-tokens'
import {
Text,
TextStyle,
Expand Down Expand Up @@ -27,6 +27,8 @@ export type SegmentedControlProps = {
a11yLabels?: string[]
/** Optional array of segment accessibility hints */
a11yHints?: string[]
/** Optional array of test IDs for test suites */
testIDs?: string[]
}

type SegmentProps = {
Expand All @@ -52,6 +54,7 @@ export const SegmentedControl: FC<SegmentedControlProps> = ({
selected,
a11yLabels,
a11yHints,
testIDs,
}) => {
const { t } = useTranslation()
const colorScheme = useColorScheme()
Expand All @@ -63,13 +66,13 @@ export const SegmentedControl: FC<SegmentedControlProps> = ({
let textColor: string, activeBgColor: string, inactiveBgColor: string

if (colorScheme === 'light') {
textColor = Colors.grayDark
activeBgColor = Colors.white
inactiveBgColor = Colors.grayLighter
textColor = DesignTokens.colorGrayDark
activeBgColor = DesignTokens.colorWhite
inactiveBgColor = DesignTokens.colorGrayLighter
} else {
textColor = Colors.grayLightest
activeBgColor = Colors.grayMedium
inactiveBgColor = Colors.grayDark
textColor = DesignTokens.colorGrayLightest
activeBgColor = DesignTokens.colorGrayMedium
inactiveBgColor = DesignTokens.colorGrayDark
}

const viewStyle: ViewStyle = {
Expand Down Expand Up @@ -125,6 +128,7 @@ export const SegmentedControl: FC<SegmentedControlProps> = ({
accessibilityValue={accessibilityValue}
accessibilityRole={'tab'}
accessibilityState={{ selected: isSelected }}
testID={testIDs?.[index]}
>
<Text allowFontScaling={false} style={textStyle}>
{label}
Expand Down
10 changes: 5 additions & 5 deletions packages/components/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2829,7 +2829,7 @@ __metadata:
dependencies:
"@babel/core": ^7.20.0
"@babel/plugin-proposal-export-namespace-from": ^7.18.9
"@department-of-veterans-affairs/mobile-tokens": 0.0.7
"@department-of-veterans-affairs/mobile-tokens": 0.0.10
"@expo/webpack-config": ^18.1.2
"@os-team/i18next-react-native-language-detector": ^1.0.28
"@react-native-async-storage/async-storage": ^1.19.0
Expand Down Expand Up @@ -2882,10 +2882,10 @@ __metadata:
languageName: unknown
linkType: soft

"@department-of-veterans-affairs/mobile-tokens@npm:0.0.7":
version: 0.0.7
resolution: "@department-of-veterans-affairs/mobile-tokens@npm:0.0.7"
checksum: eb1f4c756a3408a6219aaa8465aec5a2d1d926e1a49271574847c8668afe2082f8dafd21ee451becd12409262d7697c41a7ba61490a077662a14710218205b1e
"@department-of-veterans-affairs/mobile-tokens@npm:0.0.10":
version: 0.0.10
resolution: "@department-of-veterans-affairs/mobile-tokens@npm:0.0.10"
checksum: 7590c87fb87e72891fe270f9dc53be8af3d0471d43cd448ead234b40d3f1fd5612740f049c121062c2beffd2597e81fa4e705e808bf3dc3110c33fbc1213f928
languageName: node
linkType: hard

Expand Down
13 changes: 6 additions & 7 deletions packages/tokens/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
"prefix": "",
"files": [
{
"destination": "js/colors.js",
"format": "javascript/es6",
"filter": {
"attributes": {
"category": "color"
}
}
"destination": "js/tokens.js",
"format": "javascript/es6"
},
{
"format": "typescript/es6-declarations",
"destination": "index.d.ts"
}
]
}
Expand Down
5 changes: 3 additions & 2 deletions packages/tokens/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "@department-of-veterans-affairs/mobile-tokens",
"version": "0.0.7",
"version": "0.0.10",
"description": "VA Design System Mobile Token Library",
"main": "src/index.ts",
"main": "dist/js/tokens.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "style-dictionary build",
"prepack": "style-dictionary build",
Expand Down
1 change: 0 additions & 1 deletion packages/tokens/src/index.ts

This file was deleted.

Loading

0 comments on commit 8885fa4

Please sign in to comment.