diff --git a/CHANGELOG.md b/CHANGELOG.md index 86028ddb..77122ac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.3.0](https://github.com/nandorojo/dripsy/compare/v4.2.0...v4.3.0) (2023-05-16) + +**Note:** Version bump only for package dripsy + + + + + # [4.2.0](https://github.com/nandorojo/dripsy/compare/v4.1.0...v4.2.0) (2023-05-16) **Note:** Version bump only for package dripsy diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 00000000..37788a20 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,11 @@ +module.exports = function (api) { + api.cache(true) + + // only used for jest, right? + return { + presets: [ + ['@babel/preset-env', { targets: { node: 'current' } }], + '@babel/preset-typescript', + ], + } +} diff --git a/examples/next-example/CHANGELOG.md b/examples/next-example/CHANGELOG.md index 203fbb63..6e62f4bb 100644 --- a/examples/next-example/CHANGELOG.md +++ b/examples/next-example/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.3.0](https://github.com/nandorojo/dripsy/compare/v4.2.0...v4.3.0) (2023-05-16) + +**Note:** Version bump only for package next-dripsy-example + + + + + # [4.2.0](https://github.com/nandorojo/dripsy/compare/v4.1.0...v4.2.0) (2023-05-16) **Note:** Version bump only for package next-dripsy-example diff --git a/examples/next-example/package.json b/examples/next-example/package.json index 2941cc3d..20aa612d 100644 --- a/examples/next-example/package.json +++ b/examples/next-example/package.json @@ -1,6 +1,6 @@ { "name": "next-dripsy-example", - "version": "4.2.0", + "version": "4.3.0", "main": "__generated__/AppEntry.js", "dependencies": { "expo": "^40.0.0", diff --git a/lerna.json b/lerna.json index 50c4ad3c..05664539 100644 --- a/lerna.json +++ b/lerna.json @@ -4,7 +4,7 @@ ], "npmClient": "yarn", "useWorkspaces": true, - "version": "4.2.0", + "version": "4.3.0", "command": { "publish": { "allowBranch": "master", diff --git a/packages/dripsy/CHANGELOG.md b/packages/dripsy/CHANGELOG.md index 29485b09..b5e098fb 100644 --- a/packages/dripsy/CHANGELOG.md +++ b/packages/dripsy/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.3.0](https://github.com/nandorojo/dripsy/compare/v4.2.0...v4.3.0) (2023-05-16) + +**Note:** Version bump only for package dripsy + + + + + # [4.2.0](https://github.com/nandorojo/dripsy/compare/v4.1.0...v4.2.0) (2023-05-16) **Note:** Version bump only for package dripsy diff --git a/packages/dripsy/package.json b/packages/dripsy/package.json index b4843925..8d0f941a 100644 --- a/packages/dripsy/package.json +++ b/packages/dripsy/package.json @@ -39,13 +39,6 @@ "url": "https://github.com/nandorojo/dripsy/issues" }, "homepage": "https://github.com/nandorojo/dripsy#readme", - "jest": { - "preset": "react-native", - "modulePathIgnorePatterns": [ - "/example/node_modules", - "/lib/" - ] - }, "eslintIgnore": [ "node_modules/", "lib/" diff --git a/packages/dripsy/src/core/__tests__/index.test.tsx b/packages/dripsy/src/core/__tests__/index.test.tsx deleted file mode 100644 index d41123fc..00000000 --- a/packages/dripsy/src/core/__tests__/index.test.tsx +++ /dev/null @@ -1 +0,0 @@ -it.todo('write a test') diff --git a/packages/dripsy/src/core/components/TextInput.tsx b/packages/dripsy/src/core/components/TextInput.tsx index 80126f28..37d72af8 100644 --- a/packages/dripsy/src/core/components/TextInput.tsx +++ b/packages/dripsy/src/core/components/TextInput.tsx @@ -5,6 +5,7 @@ import { createThemedComponent } from '../css/create-themed-component' import { defaultFontStyle } from './defaultStyle' import { useDripsyTheme } from '../use-dripsy-theme' import { ColorPath, StyledProps } from '../types-v2/sx' +import { get } from '../css/get' const DripsyInput = createThemedComponent(rTextInput, { themeKey: 'forms', @@ -34,8 +35,8 @@ export const TextInput = forwardRef( function TextInput({ ...props }, ref) { const { theme } = useDripsyTheme() Object.keys(colorKeys).forEach((key) => { - if (props[key] && theme?.colors && key in theme.colors) { - props[key] = theme.colors[props[key]] + if (props[key] && theme?.colors) { + props[key] = get(theme.colors, props[key] as string) ?? props[key] } }) return diff --git a/packages/dripsy/src/core/components/activity-indicator.tsx b/packages/dripsy/src/core/components/activity-indicator.tsx index 5387e267..8d46b896 100644 --- a/packages/dripsy/src/core/components/activity-indicator.tsx +++ b/packages/dripsy/src/core/components/activity-indicator.tsx @@ -4,6 +4,7 @@ import { useDripsyTheme } from '../use-dripsy-theme' import { useSx } from '../use-sx' import { ColorPath, SxProp } from '../types-v2/sx' import { DripsyBaseTheme, DripsyFinalTheme } from '../types-v2/declarations' +import { get } from '../css/get' type Props = Omit< ComponentProps, @@ -17,8 +18,8 @@ function Indicator(props: Props & { sx?: SxProp }) { const sx = useSx() let { color } = props - if (typeof color === 'string' && colors?.[color]) { - color = colors[color] as string + if (typeof color === 'string' && colors) { + color = get(colors, color) ?? color } return ( { + expect(get({ hi: { hey: true } }, 'hi.hey')).toEqual(true) +}) diff --git a/packages/dripsy/src/gradient/index.tsx b/packages/dripsy/src/gradient/index.tsx index 09e32d88..0926fe9a 100644 --- a/packages/dripsy/src/gradient/index.tsx +++ b/packages/dripsy/src/gradient/index.tsx @@ -10,6 +10,7 @@ import { DripsyBaseTheme, ColorPath, } from '../core' +import { get } from '../core/css/get' type Props = Omit< React.ComponentProps, @@ -31,8 +32,8 @@ const Grad = styled( const colorArrayToTheme = (colorArray: typeof colors) => { // Return an empty array if the colors come back as undefined return ( - colorArray?.map( - (color) => (themeColors?.[color] as string) ?? color + colorArray?.map((color) => + themeColors ? get(themeColors, color) : color ) ?? [] ) }