Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hixme-ui/theme

Package Overview
Dependencies
Maintainers
3
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hixme-ui/theme - npm Package Compare versions

Comparing version 1.19.2 to 1.20.0

lib/GlobalStylesContainer.js

20

lib/ThemeProvider.js

@@ -23,2 +23,6 @@ 'use strict';

var _GlobalStylesContainer = require('./GlobalStylesContainer');
var _GlobalStylesContainer2 = _interopRequireDefault(_GlobalStylesContainer);
var _index = require('./index');

@@ -32,8 +36,14 @@

var children = _ref.children,
props = (0, _objectWithoutProperties3.default)(_ref, ['children']);
withGlobal = _ref.withGlobal,
props = (0, _objectWithoutProperties3.default)(_ref, ['children', 'withGlobal']);
var output = withGlobal ? _react2.default.createElement(
_GlobalStylesContainer2.default,
null,
children
) : children;
return _react2.default.createElement(
_styledComponents.ThemeProvider,
{ theme: props.theme || _index2.default },
children
output
);

@@ -44,7 +54,9 @@ }

children: _propTypes2.default.element.isRequired,
theme: _propTypes2.default.object
theme: _propTypes2.default.object,
withGlobal: _propTypes2.default.bool
};
HUIThemeProvider.defaultProps = {
theme: _index2.default
theme: _index2.default,
withGlobal: false
};

@@ -51,0 +63,0 @@

3

package.json
{
"name": "@hixme-ui/theme",
"version": "1.19.2",
"version": "1.20.0",
"description": "hixme-ui theme",

@@ -79,2 +79,3 @@ "main": "lib/index.js",

"dependencies": {
"normalize.css": "^8.0.0",
"styled-components": "^2.3.3"

@@ -81,0 +82,0 @@ },

@@ -32,1 +32,16 @@ # Theme

```
### withGlobal prop
The HUI was built with some global settings, including the [normalize CSS](https://necolas.github.io/normalize.css/). These global styles are not set by default and are enabled by adding the `withGlobal` property on the ThemeProvider.
```javascript
const App = ({ children }) => (
<ThemeProvider withGlobal>
{children}
</ThemeProvider>
)
```
import React from 'react'
import PropTypes from 'prop-types'
import { ThemeProvider } from 'styled-components'
import GlobalStylesContainer from './GlobalStylesContainer'
import theme from './index'
export default function HUIThemeProvider({ children, ...props }) {
export default function HUIThemeProvider({ children, withGlobal, ...props }) {
const output = withGlobal ?
(<GlobalStylesContainer>
{children}
</GlobalStylesContainer>) : children
return (
<ThemeProvider theme={props.theme || theme}>
{children}
{output}
</ThemeProvider>

@@ -17,2 +22,3 @@ )

theme: PropTypes.object,
withGlobal: PropTypes.bool,
}

@@ -22,2 +28,3 @@

theme,
withGlobal: false,
}

@@ -24,0 +31,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc