Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #246 from gluestack/release/@gluestack-style/react…
Browse files Browse the repository at this point in the history
…@0.1.14

Release/@gluestack style/[email protected]
  • Loading branch information
Viraj-10 authored Jun 5, 2023
2 parents 2f01ea2 + 550380d commit b8da3a9
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 11 deletions.
6 changes: 3 additions & 3 deletions example/babel-plugin-styled-resolver-expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build:web": "expo export:web"
},
"dependencies": {
"@gluestack-style/react": "^0.1.12",
"@gluestack-style/react": "^0.1.14",
"expo": "~47.0.8",
"expo-status-bar": "~1.4.2",
"find-yarn-workspace-root": "^2.0.0"
Expand All @@ -26,10 +26,10 @@
"babel-plugin-relative-path-import": "^2.0.1",
"ts-loader": "~8.2.0",
"typescript": "^4.6.3",
"@gluestack-style/react": "^0.1.12"
"@gluestack-style/react": "^0.1.14"
},
"peerDependencies": {
"@gluestack-style/react": "^0.1.12",
"@gluestack-style/react": "^0.1.14",
"react": "*",
"react-dom": "*",
"react-native": "*",
Expand Down
2 changes: 1 addition & 1 deletion example/expo-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@gluestack-style/babel-plugin-styled-resolver": "^0.1.0",
"@gluestack-style/react": "^0.1.12",
"@gluestack-style/react": "^0.1.14",
"expo": "~47.0.12",
"expo-status-bar": "~1.4.2",
"react": "18.1.0",
Expand Down
2 changes: 1 addition & 1 deletion example/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"react-native-vector-icons": "^9.1.0",
"react-native-vector-icons-for-web": "^0.1.7",
"react-native-web-linear-gradient": "^1.1.2",
"@gluestack-style/react": "^0.1.12",
"@gluestack-style/react": "^0.1.14",
"@gluestack-style/babel-plugin-styled-resolver": "^0.1.6"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions example/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"dependencies": {
"@gluestack-style/animation-plugin": "^0.1.6",
"@gluestack-style/react": "^0.1.12",
"@gluestack-style/react": "^0.1.14",
"@gluestack/design-system": "latest",
"@legendapp/motion": "^2.2.0",
"@react-native-async-storage/async-storage": "~1.17.3",
Expand All @@ -43,7 +43,7 @@
"devDependencies": {
"@babel/core": "^7.19.3",
"@gluestack-style/animation-plugin": "^0.1.6",
"@gluestack-style/react": "^0.1.12",
"@gluestack-style/react": "^0.1.14",
"@storybook/addon-actions": "^6.5.14",
"@storybook/addon-controls": "^6.5.14",
"@storybook/addon-docs": "^6.5.15",
Expand All @@ -69,7 +69,7 @@
"typescript": "4.9.4"
},
"peerDependencies": {
"@gluestack-style/react": "^0.1.12",
"@gluestack-style/react": "^0.1.14",
"react": "*",
"react-dom": "*",
"react-native": "*",
Expand Down
2 changes: 1 addition & 1 deletion packages/benchmark-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"devDependencies": {
"@gluestack-style/babel-plugin-styled-resolver": "^0.1.6",
"@gluestack-style/react": "^0.1.12",
"@gluestack-style/react": "^0.1.14",
"@emotion/styled": "^11.3.0",
"@expo/next-adapter": "^4.0.13",
"@types/react": "17.0.1",
Expand Down
8 changes: 8 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @gluestack-style/react

## 0.1.14

### Patch Changes

- Feature

- Negative token resolution

## 0.1.12

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@gluestack-style/react",
"description": "A universal & performant styling library for React Native, Next.js & React",
"version": "0.1.12",
"version": "0.1.14",
"keywords": [
"react",
"native",
Expand Down
13 changes: 12 additions & 1 deletion packages/react/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ export function resolveStringToken(
export const getTokenFromConfig = (config: any, prop: any, value: any) => {
const aliasTokenType = config.propertyTokenMap[prop];

let IsNegativeToken = false;
if (typeof value === 'string' && value.startsWith('-')) {
IsNegativeToken = true;
value = value.slice(1);
}
// const tokenScale = config?.tokens?.[aliasTokenType];
let token;

Expand Down Expand Up @@ -155,9 +160,15 @@ export const getTokenFromConfig = (config: any, prop: any, value: any) => {
} else {
token = value;
}
// console.log(token, typeof token, prop, '******');
}

if (IsNegativeToken) {
if (typeof token === 'number') {
token = -token;
} else if (typeof token === 'string') {
token = `-${token}`;
}
}
return token;
};

Expand Down

0 comments on commit b8da3a9

Please sign in to comment.