Skip to content

Commit

Permalink
Delete yarn.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
ioanabrooks committed Nov 20, 2022
1 parent 707e704 commit 46c3e3c
Show file tree
Hide file tree
Showing 4 changed files with 389 additions and 394 deletions.
6 changes: 5 additions & 1 deletion packages/react-native/src/primitives/Divider/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,26 @@ import { StrictTheme } from '../../theme';
import { DividerStyles } from './types';

export const getThemedStyles = (theme: StrictTheme): DividerStyles => {
const { colors, fontSizes, space } = theme.tokens;
const { tokens, components } = theme;
const { colors, fontSizes, space } = tokens;

return StyleSheet.create({
container: {
alignItems: 'center',
flexDirection: 'row',
...components?.divider?.container,
},
label: {
fontSize: fontSizes.medium,
margin: space.medium,
textAlign: 'center',
...components?.divider?.label,
},
line: {
backgroundColor: colors.black,
flex: 1,
height: StyleSheet.hairlineWidth,
...components?.divider?.line,
},
});
};
7 changes: 6 additions & 1 deletion packages/react-native/src/primitives/Tabs/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const getThemedStyles = (
indicatorPosition?: TabsProps['indicatorPosition']
): TabsStyles => {
const {
components,
tokens: { colors, fontSizes, fontWeights, opacities, space, borderWidths },
} = theme;

Expand All @@ -23,14 +24,15 @@ export const getThemedStyles = (
tabBorderStyles.borderBottomWidth = borderWidths.medium;
tabBorderStyles.borderBottomColor = colors.border.secondary;
}

return StyleSheet.create({
readonly: {
opacity: opacities[100],
...components?.tabs?.readonly,
},
tabList: {
flexDirection: 'row',
width: '100%',
...components?.tabs?.tabList,
},
tab: {
backgroundColor: colors.transparent,
Expand All @@ -41,16 +43,19 @@ export const getThemedStyles = (
paddingHorizontal: space.medium,
borderWidth: 0,
...tabBorderStyles,
...components?.tabs?.tab,
},
tabText: {
color: colors.font.secondary,
fontSize: fontSizes.medium,
fontWeight: fontWeights.bold,
...components?.tabs?.tabText,
},
selected: {
backgroundColor: colors.background.primary,
color: colors.brand.primary[80],
...selectedTabBorderStyles,
...components?.tabs?.selected,
},
});
};
6 changes: 5 additions & 1 deletion packages/react-native/src/theme/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ReactNativeTokens } from '@aws-amplify/ui';
import {
ButtonStyles,
CheckboxStyles,
DividerStyles,
ErrorMessageStyles,
HeadingStyles,
IconStyles,
Expand All @@ -12,6 +13,7 @@ import {
PhoneNumberFieldStyles,
RadioStyles,
RadioGroupStyles,
TabsStyles,
TextFieldStyles,
} from '../primitives';

Expand All @@ -27,6 +29,7 @@ type ComponentTheme<ComponentType, Output> = Output extends 'output'
export type Components<Output> = Record<string, object> & {
button?: ComponentTheme<ButtonStyles, Output>;
checkbox?: ComponentTheme<CheckboxStyles, Output>;
divider?: ComponentTheme<DividerStyles, Output>;
errorMessage?: ComponentTheme<ErrorMessageStyles, Output>;
heading?: ComponentTheme<HeadingStyles, Output>;
icon?: ComponentTheme<IconStyles, Output>;
Expand All @@ -36,6 +39,7 @@ export type Components<Output> = Record<string, object> & {
phoneNumberField?: ComponentTheme<PhoneNumberFieldStyles, Output>;
radio?: ComponentTheme<RadioStyles, Output>;
radioGroup?: ComponentTheme<RadioGroupStyles, Output>;
tabs?: ComponentTheme<TabsStyles, Output>;
textField?: ComponentTheme<TextFieldStyles, Output>;
};

Expand All @@ -57,7 +61,7 @@ export interface Theme {
/**
* Custom component styles
*/
components?: Components<'input'>;
components?: Omit<Components<'input'>, 'divider' | 'tabs'>;
/**
* Component and component agnostic tokens.
*/
Expand Down
Loading

0 comments on commit 46c3e3c

Please sign in to comment.