@hig/surface
Advanced tools
Comparing version 1.0.1 to 1.1.0
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { ThemeContext } from '@hig/theme-context'; | ||
import { css } from 'emotion'; | ||
import { css, cx } from 'emotion'; | ||
@@ -49,2 +49,4 @@ var SIZES = Object.freeze({ | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -75,4 +77,6 @@ | ||
shadow = _props.shadow, | ||
tagName = _props.tagName; | ||
tagName = _props.tagName, | ||
otherProps = _objectWithoutProperties(_props, ["borderRadius", "children", "horizontalPadding", "verticalPadding", "level", "shadow", "tagName"]); | ||
var className = otherProps.className; | ||
@@ -97,3 +101,3 @@ return React.createElement( | ||
Element, | ||
{ className: css(styles.surface) }, | ||
{ className: cx(css(styles.surface), className) }, | ||
children | ||
@@ -100,0 +104,0 @@ ); |
@@ -56,2 +56,4 @@ 'use strict'; | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -82,4 +84,6 @@ | ||
shadow = _props.shadow, | ||
tagName = _props.tagName; | ||
tagName = _props.tagName, | ||
otherProps = _objectWithoutProperties(_props, ["borderRadius", "children", "horizontalPadding", "verticalPadding", "level", "shadow", "tagName"]); | ||
var className = otherProps.className; | ||
@@ -104,3 +108,3 @@ return React__default.createElement( | ||
Element, | ||
{ className: emotion.css(styles.surface) }, | ||
{ className: emotion.cx(emotion.css(styles.surface), className) }, | ||
children | ||
@@ -107,0 +111,0 @@ ); |
@@ -0,1 +1,8 @@ | ||
# [@hig/surface-v1.1.0](https://github.com/Autodesk/hig/compare/@hig/surface@1.0.1...@hig/surface@1.1.0) (2020-02-21) | ||
### Features | ||
* allow className to be passed down ([b671c71](https://github.com/Autodesk/hig/commit/b671c71)) | ||
# [@hig/surface-v1.0.1](https://github.com/Autodesk/hig/compare/@hig/surface@1.0.0...@hig/surface@1.0.1) (2019-03-13) | ||
@@ -2,0 +9,0 @@ |
{ | ||
"name": "@hig/surface", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "HIG Surface component", | ||
@@ -29,7 +29,7 @@ "author": "Autodesk Inc.", | ||
"@hig/semantic-release-config": "^0.1.0", | ||
"@hig/typography": "^1.0.3" | ||
"@hig/typography": "^1.0.4" | ||
}, | ||
"peerDependencies": { | ||
"@hig/theme-context": "^2.1.3", | ||
"@hig/theme-data": "^2.3.3", | ||
"@hig/theme-context": "^3.0.0", | ||
"@hig/theme-data": "^2.14.0", | ||
"react": "^15.4.1 || ^16.3.2" | ||
@@ -36,0 +36,0 @@ }, |
@@ -28,1 +28,4 @@ # Surface | ||
``` | ||
## Custom CSS | ||
Use the `className` prop to pass in a css class name to the outermost container of the component. The class name will also pass down to most of the other styled elements within the component. |
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
19226
399
31