@arch-ui/controls
Advanced tools
Comparing version
# @arch-ui/controls | ||
## 0.0.4 | ||
- [patch][e75c105c](https://github.com/keystonejs/keystone-5/commit/e75c105c): | ||
- admin revamp | ||
## 0.0.3 | ||
@@ -4,0 +10,0 @@ |
@@ -31,8 +31,4 @@ 'use strict'; | ||
var _assertThisInitialized = _interopDefault(require("@babel/runtime/helpers/assertThisInitialized")); | ||
var _inherits = _interopDefault(require("@babel/runtime/helpers/inherits")); | ||
var _defineProperty = _interopDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var memoize = _interopDefault(require('memoize-one')); | ||
@@ -65,12 +61,10 @@ | ||
var bg = theme.colors.N05; | ||
var bg = theme.colors.N10; | ||
if (isDisabled && checked) { | ||
bg = theme.colors.B.D20; | ||
} else if (isDisabled) { | ||
bg = theme.colors.N10; | ||
} else if (isActive) { | ||
bg = checked ? theme.colors.B.D10 : theme.colors.N10; | ||
bg = checked ? theme.colors.B.D10 : theme.colors.N20; | ||
} else if ((isFocus || isHover) && !checked) { | ||
bg = 'white'; | ||
bg = theme.colors.N15; | ||
} else if (checked) { | ||
@@ -90,3 +84,3 @@ bg = theme.colors.B.base; | ||
var innerStroke = isFocus ? theme.colors.B.L20 : theme.colors.N30; | ||
var innerStroke = isFocus ? theme.colors.B.L20 : bg; | ||
var innerStrokeWidth = 1; | ||
@@ -145,12 +139,10 @@ | ||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Control)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
_defineProperty(_assertThisInitialized(_this), "control", void 0); | ||
_defineProperty(_assertThisInitialized(_this), "cacheComponents", memoize(function (components) { | ||
_this.control = void 0; | ||
_this.cacheComponents = memoize(function (components) { | ||
return _objectSpread({}, defaultComponents, components); | ||
})); | ||
}); | ||
_defineProperty(_assertThisInitialized(_this), "getRef", function (ref) { | ||
_this.getRef = function (ref) { | ||
_this.control = ref; | ||
}); | ||
}; | ||
@@ -240,11 +232,10 @@ return _this; | ||
Control.defaultProps = { | ||
checked: false, | ||
components: {}, | ||
isDisabled: false | ||
}; | ||
return Control; | ||
}(React.Component); | ||
_defineProperty(Control, "defaultProps", { | ||
checked: false, | ||
components: {}, | ||
isDisabled: false | ||
}); | ||
var Svg = function Svg(_ref3) { | ||
@@ -251,0 +242,0 @@ var html = _ref3.html, |
@@ -26,9 +26,3 @@ "use strict"; | ||
), | ||
_assertThisInitialized = _interopDefault( | ||
require("@babel/runtime/helpers/assertThisInitialized") | ||
), | ||
_inherits = _interopDefault(require("@babel/runtime/helpers/inherits")), | ||
_defineProperty = _interopDefault( | ||
require("@babel/runtime/helpers/defineProperty") | ||
), | ||
memoize = _interopDefault(require("memoize-one")), | ||
@@ -52,12 +46,10 @@ reactPseudoState = require("react-pseudo-state"), | ||
isHover = _ref.isHover, | ||
bg = theme.colors.N05; | ||
bg = theme.colors.N10; | ||
isDisabled && checked | ||
? (bg = theme.colors.B.D20) | ||
: isDisabled | ||
? (bg = theme.colors.N10) | ||
: isActive | ||
? (bg = checked ? theme.colors.B.D10 : theme.colors.N10) | ||
? (bg = checked ? theme.colors.B.D10 : theme.colors.N20) | ||
: (!isFocus && !isHover) || checked | ||
? checked && (bg = theme.colors.B.base) | ||
: (bg = "white"); | ||
: (bg = theme.colors.N15); | ||
var fill = "white"; | ||
@@ -67,3 +59,3 @@ isDisabled && checked | ||
: checked || (fill = "transparent"); | ||
var innerStroke = isFocus ? theme.colors.B.L20 : theme.colors.N30; | ||
var innerStroke = isFocus ? theme.colors.B.L20 : bg; | ||
checked && | ||
@@ -102,3 +94,3 @@ (innerStroke = isActive ? theme.colors.B.D20 : theme.colors.B.base); | ||
return ( | ||
(_this = _possibleConstructorReturn( | ||
((_this = _possibleConstructorReturn( | ||
this, | ||
@@ -109,12 +101,7 @@ (_getPrototypeOf2 = _getPrototypeOf(Control)).call.apply( | ||
) | ||
)), | ||
_defineProperty(_assertThisInitialized(_this), "control", void 0), | ||
_defineProperty( | ||
_assertThisInitialized(_this), | ||
"cacheComponents", | ||
memoize(function(components) { | ||
return _objectSpread({}, defaultComponents, components); | ||
}) | ||
), | ||
_defineProperty(_assertThisInitialized(_this), "getRef", function(ref) { | ||
)).control = void 0), | ||
(_this.cacheComponents = memoize(function(components) { | ||
return _objectSpread({}, defaultComponents, components); | ||
})), | ||
(_this.getRef = function(ref) { | ||
_this.control = ref; | ||
@@ -239,11 +226,7 @@ }), | ||
]), | ||
(Control.defaultProps = { checked: !1, components: {}, isDisabled: !1 }), | ||
Control | ||
); | ||
})(React.Component); | ||
_defineProperty(Control, "defaultProps", { | ||
checked: !1, | ||
components: {}, | ||
isDisabled: !1 | ||
}); | ||
var Svg = function(_ref3) { | ||
})(React.Component), | ||
Svg = function(_ref3) { | ||
var html = _ref3.html, | ||
@@ -250,0 +233,0 @@ props = _objectWithoutProperties(_ref3, ["html"]); |
@@ -10,5 +10,3 @@ import _extends from '@babel/runtime/helpers/esm/extends'; | ||
import _getPrototypeOf from '@babel/runtime/helpers/esm/getPrototypeOf'; | ||
import _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized'; | ||
import _inherits from '@babel/runtime/helpers/esm/inherits'; | ||
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty'; | ||
import memoize from 'memoize-one'; | ||
@@ -37,12 +35,10 @@ import { PseudoState } from 'react-pseudo-state'; | ||
// background | ||
var bg = colors.N05; | ||
var bg = colors.N10; | ||
if (isDisabled && checked) { | ||
bg = colors.B.D20; | ||
} else if (isDisabled) { | ||
bg = colors.N10; | ||
} else if (isActive) { | ||
bg = checked ? colors.B.D10 : colors.N10; | ||
bg = checked ? colors.B.D10 : colors.N20; | ||
} else if ((isFocus || isHover) && !checked) { | ||
bg = 'white'; | ||
bg = colors.N15; | ||
} else if (checked) { | ||
@@ -62,3 +58,3 @@ bg = colors.B.base; | ||
var innerStroke = isFocus ? colors.B.L20 : colors.N30; | ||
var innerStroke = isFocus ? colors.B.L20 : bg; | ||
var innerStrokeWidth = 1; | ||
@@ -116,12 +112,10 @@ | ||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Control)).call.apply(_getPrototypeOf2, [this].concat(args))); | ||
_defineProperty(_assertThisInitialized(_this), "control", void 0); | ||
_defineProperty(_assertThisInitialized(_this), "cacheComponents", memoize(function (components) { | ||
_this.control = void 0; | ||
_this.cacheComponents = memoize(function (components) { | ||
return _objectSpread({}, defaultComponents, components); | ||
})); | ||
}); | ||
_defineProperty(_assertThisInitialized(_this), "getRef", function (ref) { | ||
_this.getRef = function (ref) { | ||
_this.control = ref; | ||
}); | ||
}; | ||
@@ -211,11 +205,10 @@ return _this; | ||
Control.defaultProps = { | ||
checked: false, | ||
components: {}, | ||
isDisabled: false | ||
}; | ||
return Control; | ||
}(Component); | ||
_defineProperty(Control, "defaultProps", { | ||
checked: false, | ||
components: {}, | ||
isDisabled: false | ||
}); | ||
var Svg = function Svg(_ref3) { | ||
@@ -222,0 +215,0 @@ var html = _ref3.html, |
{ | ||
"name": "@arch-ui/controls", | ||
"description": "Form Controls as used in @keystone-alpha Admin UI.", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"author": "Jed Watson", | ||
@@ -15,4 +15,4 @@ "license": "MIT", | ||
"dependencies": { | ||
"@arch-ui/input": "^0.0.3", | ||
"@arch-ui/theme": "^0.0.2", | ||
"@arch-ui/input": "^0.0.4", | ||
"@arch-ui/theme": "^0.0.3", | ||
"@babel/runtime": "^7.3.4", | ||
@@ -19,0 +19,0 @@ "@emotion/core": "^10.0.9", |
@@ -61,11 +61,9 @@ // @flow | ||
// background | ||
let bg = colors.N05; | ||
let bg = colors.N10; | ||
if (isDisabled && checked) { | ||
bg = colors.B.D20; | ||
} else if (isDisabled) { | ||
bg = colors.N10; | ||
} else if (isActive) { | ||
bg = checked ? colors.B.D10 : colors.N10; | ||
bg = checked ? colors.B.D10 : colors.N20; | ||
} else if ((isFocus || isHover) && !checked) { | ||
bg = 'white'; | ||
bg = colors.N15; | ||
} else if (checked) { | ||
@@ -84,3 +82,3 @@ bg = colors.B.base; | ||
// stroke | ||
let innerStroke = isFocus ? colors.B.L20 : colors.N30; | ||
let innerStroke = isFocus ? colors.B.L20 : bg; | ||
let innerStrokeWidth = 1; | ||
@@ -90,2 +88,3 @@ if (checked) { | ||
} | ||
let outerStroke = 'transparent'; | ||
@@ -92,0 +91,0 @@ let outerStrokeWidth = 1; |
36098
-3.1%1027
-2.56%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
Updated
Updated