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
28 changes: 12 additions & 16 deletions src/design-system/components/Button/Button.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ describe('Button', () => {
const { getByTestId } = render(<Button.Primary title="Button" />)
expect(getByTestId('baseButton').props.style).toStrictEqual({
...baseStyles,
alignItems: 'center',
backgroundColor: theme.light.colors.button.primary.bg,
borderColor: theme.light.colors.button.primary.border,
borderWidth: 1,
Expand All @@ -34,7 +33,6 @@ describe('Button', () => {
const { getByTestId } = render(<Button.PrimaryDestructive title="Button" />)
expect(getByTestId('baseButton').props.style).toStrictEqual({
...baseStyles,
alignItems: 'center',
backgroundColor: theme.light.colors.button.primary.error.bg,
borderColor: theme.light.colors.button.primary.error.border,
borderWidth: 1,
Expand All @@ -45,7 +43,6 @@ describe('Button', () => {
const { getByTestId } = render(<Button.SecondaryColor title="Button" />)
expect(getByTestId('baseButton').props.style).toStrictEqual({
...baseStyles,
alignItems: 'center',
backgroundColor: theme.light.colors.button.secondary.bg,
borderColor: theme.light.colors.button.secondary.border,
borderWidth: 1,
Expand All @@ -67,7 +64,6 @@ describe('Button', () => {
const { getByTestId } = render(<Button.SecondaryDestructive title="Button" />)
expect(getByTestId('baseButton').props.style).toStrictEqual({
...baseStyles,
alignItems: 'center',
backgroundColor: theme.light.colors.button.secondary.error.bg,
borderColor: theme.light.colors.button.secondary.error.border,
borderWidth: 1,
Expand All @@ -78,8 +74,8 @@ describe('Button', () => {
const { getByTestId } = render(<Button.TertiaryColor title="Button" />)
expect(getByTestId('baseButton').props.style).toStrictEqual({
...baseStyles,
backgroundColor: 'transparent',
borderColor: 'transparent',
backgroundColor: theme.light.colors.Base.transparent,
borderColor: theme.light.colors.Base.transparent,
borderWidth: undefined,
})
})
Expand All @@ -88,8 +84,8 @@ describe('Button', () => {
const { getByTestId } = render(<Button.TertiaryGray title="Button" />)
expect(getByTestId('baseButton').props.style).toStrictEqual({
...baseStyles,
backgroundColor: 'transparent',
borderColor: 'transparent',
backgroundColor: theme.light.colors.Base.transparent,
borderColor: theme.light.colors.Base.transparent,
borderWidth: undefined,
})
})
Expand All @@ -98,8 +94,8 @@ describe('Button', () => {
const { getByTestId } = render(<Button.TertiaryDestructive title="Button" />)
expect(getByTestId('baseButton').props.style).toStrictEqual({
...baseStyles,
backgroundColor: 'transparent',
borderColor: 'transparent',
backgroundColor: theme.light.colors.Base.transparent,
borderColor: theme.light.colors.Base.transparent,
borderWidth: undefined,
})
})
Expand All @@ -108,8 +104,8 @@ describe('Button', () => {
const { getByTestId } = render(<Button.LinkColor title="Button" />)
expect(getByTestId('baseButton').props.style).toStrictEqual({
...baseStyles,
backgroundColor: 'transparent',
borderColor: 'transparent',
backgroundColor: theme.light.colors.Base.transparent,
borderColor: theme.light.colors.Base.transparent,
borderWidth: undefined,
})
})
Expand All @@ -118,8 +114,8 @@ describe('Button', () => {
const { getByTestId } = render(<Button.LinkGray title="Button" />)
expect(getByTestId('baseButton').props.style).toStrictEqual({
...baseStyles,
backgroundColor: 'transparent',
borderColor: 'transparent',
backgroundColor: theme.light.colors.Base.transparent,
borderColor: theme.light.colors.Base.transparent,
borderWidth: undefined,
})
})
Expand All @@ -128,8 +124,8 @@ describe('Button', () => {
const { getByTestId } = render(<Button.LinkDestructive title="Button" />)
expect(getByTestId('baseButton').props.style).toStrictEqual({
...baseStyles,
backgroundColor: 'transparent',
borderColor: 'transparent',
backgroundColor: theme.light.colors.Base.transparent,
borderColor: theme.light.colors.Base.transparent,
borderWidth: undefined,
})
})
Expand Down
4 changes: 2 additions & 2 deletions src/design-system/config/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,11 @@ export const _appTheme = {
export const theme = {
light: {
..._appTheme,
colors: themeColors.lightMode,
colors: { ...themeColors.primitives, ...themeColors.lightMode },
},
dark: {
..._appTheme,
colors: themeColors.darkMode,
colors: { ...themeColors.primitives, ...themeColors.darkMode },
},
}

Expand Down
3 changes: 2 additions & 1 deletion src/types/theme.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ declare global {
type Fonts = keyof AppTheme['fonts']

// COLORS
type Colors = typeof themeColors.lightMode | typeof themeColors.darkMode
type Colors = typeof themeColors.primitives &
(typeof themeColors.lightMode | typeof themeColors.darkMode)

export type ColorNames = NestedKeys<Colors>

Expand Down
2 changes: 1 addition & 1 deletion src/utils/getColorValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const getColorValue = ({ color, colors }: GetColorValueProps): string =>
return color
}

if (!color || typeof color === 'object') return 'transparent'
if (!color || typeof color === 'object') return colors.Base.transparent

const keys = color.split('.')

Expand Down