@chakra-ui/theme-tools
Advanced tools
Comparing version 1.0.0-next.6 to 1.0.0-next.7
@@ -6,2 +6,14 @@ # Change Log | ||
# [1.0.0-next.7](https://github.com/chakra-ui/chakra-ui/compare/@chakra-ui/theme-tools@1.0.0-next.6...@chakra-ui/theme-tools@1.0.0-next.7) (2020-07-26) | ||
### Features | ||
- add support for single and multipart config | ||
([a13d0f8](https://github.com/chakra-ui/chakra-ui/commit/a13d0f8a3d97405bde6acba1c4fc126677154a8b)) | ||
# Change Log | ||
All notable changes to this project will be documented in this file. See | ||
[Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
# [1.0.0-next.6](https://github.com/chakra-ui/chakra-ui/compare/@chakra-ui/theme-tools@1.0.0-next.5...@chakra-ui/theme-tools@1.0.0-next.6) (2020-07-15) | ||
@@ -8,0 +20,0 @@ |
@@ -6,3 +6,3 @@ "use strict"; | ||
exports.randomColor = randomColor; | ||
exports.ink = exports.toAlphas = exports.complementary = exports.isAccessible = exports.contrast = exports.lighten = exports.darken = exports.blacken = exports.whiten = exports.transparentize = exports.isLight = exports.isDark = exports.tone = exports.getColor = void 0; | ||
exports.complementary = exports.isAccessible = exports.contrast = exports.lighten = exports.darken = exports.blacken = exports.whiten = exports.transparentize = exports.isLight = exports.isDark = exports.tone = exports.getColor = void 0; | ||
@@ -192,36 +192,3 @@ var _tinycolor = _interopRequireDefault(require("tinycolor2")); | ||
} | ||
/** | ||
* Returns an accessible ink color of any given fill color. | ||
*/ | ||
var toAlphas = function toAlphas(color) { | ||
return { | ||
900: transparentize(color, 0.92), | ||
800: transparentize(color, 0.8), | ||
700: transparentize(color, 0.6), | ||
600: transparentize(color, 0.48), | ||
500: transparentize(color, 0.38), | ||
400: transparentize(color, 0.24), | ||
300: transparentize(color, 0.16), | ||
200: transparentize(color, 0.12), | ||
100: transparentize(color, 0.08), | ||
50: transparentize(color, 0.04) | ||
}; | ||
}; | ||
exports.toAlphas = toAlphas; | ||
var ink = function ink(color, emphasis) { | ||
var values = { | ||
high: toAlphas(color)[900], | ||
medium: toAlphas(color)[700], | ||
low: toAlphas(color)[500], | ||
lowest: toAlphas(color)[300] | ||
}; | ||
return values[emphasis]; | ||
}; | ||
exports.ink = ink; | ||
function randomColor(opts) { | ||
@@ -228,0 +195,0 @@ var fallback = _tinycolor["default"].random().toHexString(); |
@@ -5,3 +5,2 @@ "use strict"; | ||
exports.mode = mode; | ||
exports.orientation = orientation; | ||
exports.orient = orient; | ||
@@ -19,8 +18,2 @@ | ||
function orientation(horizontal, vertical) { | ||
return function (props) { | ||
return props.orientation === "horizontal" ? horizontal : vertical; | ||
}; | ||
} | ||
function orient(options) { | ||
@@ -27,0 +20,0 @@ var orientation = options.orientation, |
@@ -19,8 +19,8 @@ "use strict"; | ||
var _transition = require("@chakra-ui/transition"); | ||
var _styleConfig = require("./style-config"); | ||
Object.keys(_transition).forEach(function (key) { | ||
Object.keys(_styleConfig).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
exports[key] = _transition[key]; | ||
exports[key] = _styleConfig[key]; | ||
}); | ||
//# sourceMappingURL=index.js.map |
@@ -111,27 +111,2 @@ import Color from "tinycolor2"; | ||
} | ||
/** | ||
* Returns an accessible ink color of any given fill color. | ||
*/ | ||
export var toAlphas = color => ({ | ||
900: transparentize(color, 0.92), | ||
800: transparentize(color, 0.8), | ||
700: transparentize(color, 0.6), | ||
600: transparentize(color, 0.48), | ||
500: transparentize(color, 0.38), | ||
400: transparentize(color, 0.24), | ||
300: transparentize(color, 0.16), | ||
200: transparentize(color, 0.12), | ||
100: transparentize(color, 0.08), | ||
50: transparentize(color, 0.04) | ||
}); | ||
export var ink = (color, emphasis) => { | ||
var values = { | ||
high: toAlphas(color)[900], | ||
medium: toAlphas(color)[700], | ||
low: toAlphas(color)[500], | ||
lowest: toAlphas(color)[300] | ||
}; | ||
return values[emphasis]; | ||
}; | ||
export function randomColor(opts) { | ||
@@ -138,0 +113,0 @@ var fallback = Color.random().toHexString(); |
@@ -6,5 +6,2 @@ import { runIfFn } from "@chakra-ui/utils"; | ||
} | ||
export function orientation(horizontal, vertical) { | ||
return props => props.orientation === "horizontal" ? horizontal : vertical; | ||
} | ||
export function orient(options) { | ||
@@ -11,0 +8,0 @@ var { |
export * from "./color"; | ||
export * from "./component"; | ||
export * from "@chakra-ui/transition"; | ||
export * from "./style-config"; | ||
//# sourceMappingURL=index.js.map |
@@ -71,19 +71,2 @@ import Color from "tinycolor2"; | ||
}; | ||
/** | ||
* Returns an accessible ink color of any given fill color. | ||
*/ | ||
export declare const toAlphas: (color: string) => { | ||
900: (theme: Dict) => string; | ||
800: (theme: Dict) => string; | ||
700: (theme: Dict) => string; | ||
600: (theme: Dict) => string; | ||
500: (theme: Dict) => string; | ||
400: (theme: Dict) => string; | ||
300: (theme: Dict) => string; | ||
200: (theme: Dict) => string; | ||
100: (theme: Dict) => string; | ||
50: (theme: Dict) => string; | ||
}; | ||
declare type Emphasis = "high" | "medium" | "low" | "lowest"; | ||
export declare const ink: (color: string, emphasis: Emphasis) => (theme: Dict) => string; | ||
interface RandomColorOptions { | ||
@@ -90,0 +73,0 @@ /** |
@@ -0,6 +1,11 @@ | ||
/// <reference types="react" /> | ||
import { SystemStyleObject } from "@chakra-ui/system"; | ||
import { Dict, UnionStringArray, runIfFn } from "@chakra-ui/utils"; | ||
import { TransitionConfig } from "@chakra-ui/transition"; | ||
import { Dict, runIfFn } from "@chakra-ui/utils"; | ||
interface GlobalStyleProps { | ||
colorScheme: string; | ||
colorMode: "light" | "dark"; | ||
theme: Dict; | ||
} | ||
export declare type GlobalStyles = { | ||
global?: SystemStyleObject | ((props: Props) => SystemStyleObject); | ||
global?: SystemStyleObject | ((props: GlobalStyleProps) => SystemStyleObject); | ||
}; | ||
@@ -12,31 +17,3 @@ export declare type JSXElementStyles = { | ||
export declare type Styles = GlobalStyles & JSXElementStyles; | ||
export declare type ExtendProps<P> = P & Props; | ||
export interface Props { | ||
colorScheme: string; | ||
orientation: "horizontal" | "vertical"; | ||
colorMode: "light" | "dark"; | ||
theme: Dict; | ||
} | ||
export declare type VariantType<E extends Readonly<Dict>> = E["variants"][number]; | ||
export declare type SizeType<E extends Readonly<Dict>> = E["sizes"][number]; | ||
declare type Arr = Readonly<any[]>; | ||
declare type PartsStyle<P extends Arr, V = SystemStyleObject> = { | ||
[K in UnionStringArray<P>]?: V; | ||
}; | ||
declare type PartsInterpolation<E extends Readonly<Dict>, V = SystemStyleObject> = PartsStyle<E["parts"], V> | ((props: any) => PartsStyle<E["parts"], V>); | ||
export declare type TransitionStyle<E extends Readonly<Dict>> = PartsInterpolation<E, TransitionConfig>; | ||
export declare type BaseStyle<E extends Readonly<Dict>> = PartsInterpolation<E>; | ||
export declare type Sizes<E extends Readonly<Dict>> = { | ||
[K in UnionStringArray<E["sizes"]>]?: PartsInterpolation<E>; | ||
}; | ||
export declare type Variants<E extends Readonly<Dict>> = { | ||
[K in UnionStringArray<E["variants"]>]?: PartsInterpolation<E>; | ||
}; | ||
export declare type DefaultProps<E extends Readonly<Dict>> = { | ||
size?: UnionStringArray<E["sizes"]>; | ||
variant?: UnionStringArray<E["variants"]>; | ||
colorScheme?: string; | ||
}; | ||
export declare function mode(light: any, dark: any): (props: any) => any; | ||
export declare function orientation(horizontal: any, vertical: any): (props: any) => any; | ||
export declare function mode(light: any, dark: any): (props: Dict) => any; | ||
export declare function orient(options: { | ||
@@ -43,0 +20,0 @@ orientation?: "vertical" | "horizontal"; |
export * from "./color"; | ||
export * from "./component"; | ||
export * from "@chakra-ui/transition"; | ||
export * from "./style-config"; |
{ | ||
"name": "@chakra-ui/theme-tools", | ||
"version": "1.0.0-next.6", | ||
"version": "1.0.0-next.7", | ||
"description": "Set of helpers that makes theming and styling easier", | ||
@@ -47,4 +47,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@chakra-ui/transition": "^1.0.0-next.6", | ||
"@chakra-ui/utils": "^1.0.0-next.6", | ||
"@chakra-ui/utils": "^1.0.0-next.7", | ||
"@types/tinycolor2": "1.4.2", | ||
@@ -54,8 +53,8 @@ "tinycolor2": "1.4.1" | ||
"peerDependencies": { | ||
"@chakra-ui/system": "^1.0.0-next.5" | ||
"@chakra-ui/system": "^1.0.0-next.7" | ||
}, | ||
"devDependencies": { | ||
"@chakra-ui/system": "^1.0.0-next.6" | ||
"@chakra-ui/system": "^1.0.0-next.7" | ||
}, | ||
"gitHead": "72eeca4ba3fc6e7d8845b0d283a03cb6ec384a50" | ||
"gitHead": "3dcabd8c7e21b32ae1b61485588f70370c4e626f" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
33
54036
580
- Removed@chakra-ui/transition@^1.0.0-next.6
- Removed@chakra-ui/transition@1.4.8(transitive)
- Removed@emotion/is-prop-valid@0.8.8(transitive)
- Removed@emotion/memoize@0.7.4(transitive)
- Removed@motionone/animation@10.18.0(transitive)
- Removed@motionone/dom@10.12.0(transitive)
- Removed@motionone/easing@10.18.0(transitive)
- Removed@motionone/generators@10.18.0(transitive)
- Removed@motionone/types@10.17.1(transitive)
- Removed@motionone/utils@10.18.0(transitive)
- Removedframer-motion@6.5.1(transitive)
- Removedframesync@6.0.1(transitive)
- Removedhey-listen@1.0.8(transitive)
- Removedpopmotion@11.0.3(transitive)
- Removedreact-dom@18.3.1(transitive)
- Removedscheduler@0.23.2(transitive)
- Removedstyle-value-types@5.0.0(transitive)