@tds2/button
Advanced tools
Comparing version 0.1.32 to 0.1.33
@@ -1,1 +0,1 @@ | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=_interopRequireDefault(require("react"));var _propTypes=_interopRequireDefault(require("prop-types"));var _reactNative=require("react-native");var _hooks=require("../../hooks");var _sharedStyle=require("./sharedStyle");var _ThemeProvider=require("../../providers/ThemeProvider");var _this=this,_jsxFileName="/Users/hamedmamdoohi/Desktop/react-native-storybook/packages/Button/src/Button.jsx";var Button=function Button(_ref){var variant=_ref.variant,children=_ref.children,overrides=_ref.tokens;var tokens=(0,_ThemeProvider.useTokens)('button',variant,overrides);var color=(0,_sharedStyle.setColorByVariant)(variant,tokens);var fontsLoaded=(0,_hooks.useCustomFonts)();return fontsLoaded?_react.default.createElement(_reactNative.TouchableOpacity,{style:{minWidth:180,width:'max-content'},onPress:function onPress(){},style:[styles.button,{borderRadius:tokens.border_radius,height:tokens.height,backgroundColor:color.default.background,borderColor:color.default.border,borderWidth:1.5}],__self:_this,__source:{fileName:_jsxFileName,lineNumber:14,columnNumber:5}},_react.default.createElement(_reactNative.Text,{style:[styles.text,{color:color.default.text,fontFamily:tokens.font.native}],__self:_this,__source:{fileName:_jsxFileName,lineNumber:28,columnNumber:7}},children)):_react.default.createElement(_reactNative.View,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:38,columnNumber:5}},_react.default.createElement(_reactNative.Text,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:39,columnNumber:7}},"Loading"));};var styles=_reactNative.StyleSheet.create({button:_sharedStyle.button,text:_sharedStyle.text});Button.propTypes={type:_propTypes.default.oneOf(['button','submit','reset']),variant:_propTypes.default.oneOf(['primary','secondary','inverted','standard','brand','danger']),children:_propTypes.default.string};Button.defaultProps={type:'button',variant:'primary'};var _default=Button;exports.default=_default; | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _react=_interopRequireDefault(require("react"));var _propTypes=_interopRequireDefault(require("prop-types"));var _reactNative=require("react-native");var _hooks=require("../../hooks");var _sharedStyle=require("./sharedStyle");var _ThemeProvider=require("../../providers/ThemeProvider");var _this=this,_jsxFileName="/Users/hamedmamdoohi/Desktop/react-native-storybook/packages/Button/src/Button.jsx";var Button=function Button(_ref){var variant=_ref.variant,children=_ref.children,overrides=_ref.tokens;var tokens=(0,_ThemeProvider.useTokens)('button',variant,overrides);var color=(0,_sharedStyle.setColorByVariant)(variant,tokens);var fontsLoaded=(0,_hooks.useCustomFonts)();return fontsLoaded?_react.default.createElement(_reactNative.TouchableOpacity,{style:{minWidth:180,width:'max-content'},onPress:function onPress(){},style:[styles.button,{borderRadius:tokens.border_radius,height:tokens.height,backgroundColor:color.default.background,borderColor:color.default.border,borderWidth:1.5}],__self:_this,__source:{fileName:_jsxFileName,lineNumber:14,columnNumber:5}},_react.default.createElement(_reactNative.Text,{style:[styles.text,{color:color.default.text,fontFamily:tokens.font.native,fontWeight:500}],__self:_this,__source:{fileName:_jsxFileName,lineNumber:28,columnNumber:7}},children)):_react.default.createElement(_reactNative.View,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:42,columnNumber:5}},_react.default.createElement(_reactNative.Text,{__self:_this,__source:{fileName:_jsxFileName,lineNumber:43,columnNumber:7}},"Loading"));};var styles=_reactNative.StyleSheet.create({button:_sharedStyle.button,text:_sharedStyle.text});Button.propTypes={type:_propTypes.default.oneOf(['button','submit','reset']),variant:_propTypes.default.oneOf(['primary','secondary','inverted','standard','brand','danger']),children:_propTypes.default.string};Button.defaultProps={type:'button',variant:'primary'};var _default=Button;exports.default=_default; |
@@ -1,1 +0,1 @@ | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _react=_interopRequireDefault(require("react"));var _propTypes=_interopRequireDefault(require("prop-types"));var _styledComponents=_interopRequireDefault(require("styled-components"));var _sharedStyle=require("./sharedStyle");var _ThemeProvider=require("../../providers/ThemeProvider");var _this=this,_jsxFileName="/Users/hamedmamdoohi/Desktop/react-native-storybook/packages/Button/src/Button.web.jsx";function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach(function(key){(0,_defineProperty2.default)(target,key,source[key]);});}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}}return target;}var StyledButton=(0,_styledComponents.default)('button')(function(_ref){var variant=_ref.variant,tokens=_ref.tokens;var color=(0,_sharedStyle.setColorByVariant)(variant,tokens);return"\n border-radius: "+tokens.border_radius+"px;\n font-family: "+tokens.font.web+";\n height: "+tokens.height+"px;\n border: 2px solid "+color.default.border+" !important;\n background-color: "+color.default.background+" !important;\n color: "+color.default.text+" !important;\n &[style] {\n :hover {\n border: 2px solid "+color.hover.border+" !important;\n background-color: "+color.hover.background+" !important;\n color: "+color.hover.text+" !important;\n cursor: pointer;\n }\n :active {\n background-color: "+color.active.background+" !important;\n color: "+color.active.text+" !important;\n box-shadow: 0 0 0 3px "+color.active.boxShadow+" !important;\n }\n :focus {\n outline: 0 !important;\n background-color: "+color.focus.background+" !important;\n box-shadow: 0 0 0 3px "+color.focus.boxShadow+" !important;\n \n color: "+color.focus.text+" !important;\n border: 2px solid "+color.focus.border+" !important;\n \n }\n :active:focus {\n background-color: "+color.activeFocus.background+" !important;\n box-shadow: 0 0 0 3px "+color.activeFocus.boxShadow+" !important;\n color: "+color.activeFocus.text+" !important;\n border: 2px solid "+color.activeFocus.border+" !important;\n }\n }\n ";});var Button=function Button(_ref2){var variant=_ref2.variant,overrides=_ref2.tokens,children=_ref2.children;var tokens=(0,_ThemeProvider.useTokens)('button',variant,overrides);return _react.default.createElement(StyledButton,{variant:variant,tokens:tokens,style:_objectSpread(_objectSpread({fontWeight:400,letterSpacing:'normal'},_sharedStyle.text),_sharedStyle.button),__self:_this,__source:{fileName:_jsxFileName,lineNumber:50,columnNumber:5}},children);};Button.propTypes={type:_propTypes.default.oneOf(['button','submit','reset']),variant:_propTypes.default.oneOf(['primary','secondary','inverted','standard','brand','danger']),children:_propTypes.default.string};Button.defaultProps={type:'button',variant:'primary'};var _default=Button;exports.default=_default; | ||
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _react=_interopRequireDefault(require("react"));var _propTypes=_interopRequireDefault(require("prop-types"));var _styledComponents=_interopRequireDefault(require("styled-components"));var _sharedStyle=require("./sharedStyle");var _ThemeProvider=require("../../providers/ThemeProvider");var _this=this,_jsxFileName="/Users/hamedmamdoohi/Desktop/react-native-storybook/packages/Button/src/Button.web.jsx";function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly)symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable;});keys.push.apply(keys,symbols);}return keys;}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};if(i%2){ownKeys(Object(source),true).forEach(function(key){(0,_defineProperty2.default)(target,key,source[key]);});}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source));}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key));});}}return target;}var StyledButton=(0,_styledComponents.default)('button')(function(_ref){var variant=_ref.variant,tokens=_ref.tokens;var color=(0,_sharedStyle.setColorByVariant)(variant,tokens);return"\n border-radius: "+tokens.border_radius+"px;\n font-family: "+tokens.font.web+";\n font-weight: "+tokens.font_weight+";\n height: "+tokens.height+"px;\n border: 2px solid "+color.default.border+" !important;\n background-color: "+color.default.background+" !important;\n color: "+color.default.text+" !important;\n &[style] {\n :hover {\n border: 2px solid "+color.hover.border+" !important;\n background-color: "+color.hover.background+" !important;\n color: "+color.hover.text+" !important;\n cursor: pointer;\n }\n :active {\n background-color: "+color.active.background+" !important;\n color: "+color.active.text+" !important;\n box-shadow: 0 0 0 3px "+color.active.boxShadow+" !important;\n }\n :focus {\n outline: 0 !important;\n background-color: "+color.focus.background+" !important;\n box-shadow: 0 0 0 3px "+color.focus.boxShadow+" !important;\n \n color: "+color.focus.text+" !important;\n border: 2px solid "+color.focus.border+" !important;\n \n }\n :active:focus {\n background-color: "+color.activeFocus.background+" !important;\n box-shadow: 0 0 0 3px "+color.activeFocus.boxShadow+" !important;\n color: "+color.activeFocus.text+" !important;\n border: 2px solid "+color.activeFocus.border+" !important;\n }\n }\n ";});var Button=function Button(_ref2){var variant=_ref2.variant,overrides=_ref2.tokens,children=_ref2.children;var tokens=(0,_ThemeProvider.useTokens)('button',variant,overrides);return _react.default.createElement(StyledButton,{variant:variant,tokens:tokens,style:_objectSpread(_objectSpread({letterSpacing:'normal'},_sharedStyle.text),_sharedStyle.button),__self:_this,__source:{fileName:_jsxFileName,lineNumber:51,columnNumber:5}},children);};Button.propTypes={type:_propTypes.default.oneOf(['button','submit','reset']),variant:_propTypes.default.oneOf(['primary','secondary','inverted','standard','brand','danger']),children:_propTypes.default.string};Button.defaultProps={type:'button',variant:'primary'};var _default=Button;exports.default=_default; |
{ | ||
"name": "@tds2/button", | ||
"version": "0.1.32", | ||
"version": "0.1.33", | ||
"description": "Button component", | ||
@@ -43,3 +43,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "396bb4e456dc6252fb42dd77106b2d04ec034e17" | ||
"gitHead": "1825a64c6f17976074748c76e4ff7c1bf2237227" | ||
} |
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
7948