Skip to content

Commit

Permalink
Fix theme types
Browse files Browse the repository at this point in the history
  • Loading branch information
sroy3 committed Sep 4, 2024
1 parent 8d360e6 commit 7c913f5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion packages/k2-alpine/src/components/button/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { type FC, type PropsWithChildren } from 'react'
import { useTheme, type K2AlpineTheme } from '../../theme/theme'
import { type K2AlpineTheme } from '../../theme/theme'
import { Pressable, Text } from '../Primitives'
import { useTheme } from '../..'

export type Props = {
onPress: () => void
Expand Down
1 change: 1 addition & 0 deletions packages/k2-alpine/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './components'
export * from './theme/ThemeProvider'
export { useDripsyTheme as useTheme } from 'dripsy'
12 changes: 7 additions & 5 deletions packages/k2-alpine/src/theme/theme.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { makeTheme, useDripsyTheme } from 'dripsy'
import { makeTheme } from 'dripsy'
import { darkModeColors, lightModeColors } from './tokens/colors'
import { text } from './tokens/text'
import { styles } from './tokens/styles'

export const darkTheme = makeTheme({
types: {
onlyAllowThemeValues: 'never',
onlyAllowThemeValues: 'always',
reactNativeTypesOnly: true
},
colors: darkModeColors,
Expand All @@ -18,11 +18,13 @@ export const lightTheme = {
colors: lightModeColors
}

export type K2AlpineTheme = typeof darkTheme
export interface K2AlpineTheme {
colors: typeof darkModeColors
styles: typeof styles
text: typeof text
}

declare module 'dripsy' {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
interface DripsyCustomTheme extends K2AlpineTheme {}
}

export { useDripsyTheme as useTheme }
3 changes: 0 additions & 3 deletions packages/k2-alpine/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"extends": "@avalabs/tsconfig-mobile/base.json",
"compilerOptions": {
"esModuleInterop": true
},
"include": [
"**/*.ts",
"**/*.tsx",
Expand Down

0 comments on commit 7c913f5

Please sign in to comment.