@hig/button
Advanced tools
Comparing version 0.1.0-alpha.a36b4d24 to 0.1.0-alpha.a529f134
import PropTypes from 'prop-types'; | ||
import React, { Component } from 'react'; | ||
import cx from 'classnames'; | ||
function createCommonjsModule(fn, module) { | ||
return module = { exports: {} }, fn(module, module.exports), module.exports; | ||
} | ||
var classnames = createCommonjsModule(function (module) { | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/*! | ||
Copyright (c) 2016 Jed Watson. | ||
Licensed under the MIT License (MIT), see | ||
http://jedwatson.github.io/classnames | ||
*/ | ||
/* global define */ | ||
(function () { | ||
var hasOwn = {}.hasOwnProperty; | ||
function classNames() { | ||
var classes = []; | ||
for (var i = 0; i < arguments.length; i++) { | ||
var arg = arguments[i]; | ||
if (!arg) continue; | ||
var argType = typeof arg === 'undefined' ? 'undefined' : _typeof(arg); | ||
if (argType === 'string' || argType === 'number') { | ||
classes.push(arg); | ||
} else if (Array.isArray(arg)) { | ||
classes.push(classNames.apply(null, arg)); | ||
} else if (argType === 'object') { | ||
for (var key in arg) { | ||
if (hasOwn.call(arg, key) && arg[key]) { | ||
classes.push(key); | ||
} | ||
} | ||
} | ||
} | ||
return classes.join(' '); | ||
} | ||
if ('object' !== 'undefined' && module.exports) { | ||
module.exports = classNames; | ||
} else if (typeof undefined === 'function' && _typeof(undefined.amd) === 'object' && undefined.amd) { | ||
// register as 'classnames', consistent with npm package name | ||
undefined('classnames', [], function () { | ||
return classNames; | ||
}); | ||
} else { | ||
window.classNames = classNames; | ||
} | ||
})(); | ||
}); | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var HIGLightTheme = { | ||
@@ -216,7 +161,31 @@ themeId: "hig-light", | ||
var availableSizes = Object.freeze(["small", "standard", "large"]); | ||
var availableTargets = Object.freeze(["_self", "_blank", "_parent", "_top"]); | ||
var availableTypes = Object.freeze(["primary", "secondary", "flat"]); | ||
var availableWidths = Object.freeze(["shrink", "grow"]); | ||
var sizes = Object.freeze({ | ||
SMALL: "small", | ||
STANDARD: "standard", | ||
LARGE: "large" | ||
}); | ||
var targets = Object.freeze({ | ||
SELF: "_self", | ||
BLANK: "_blank", | ||
PARENT: "_parent", | ||
TOP: "_top" | ||
}); | ||
var types = Object.freeze({ | ||
PRIMARY: "primary", | ||
SECONDARY: "secondary", | ||
FLAT: "flat" | ||
}); | ||
var widths = Object.freeze({ | ||
SHRINK: "shrink", | ||
GROW: "grow" | ||
}); | ||
var availableSizes = Object.freeze(Object.values(sizes)); | ||
var availableTargets = Object.freeze(Object.values(targets)); | ||
var availableTypes = Object.freeze(Object.values(types)); | ||
var availableWidths = Object.freeze(Object.values(widths)); | ||
var _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
@@ -272,3 +241,3 @@ | ||
return classnames(themeClass, "hig__button-v1", (_cx = { | ||
return cx(themeClass, "hig__button-v1", (_cx = { | ||
"hig__button-v1--disabled": disabled | ||
@@ -295,3 +264,3 @@ }, _defineProperty(_cx, "hig__button-v1--size-" + size, size), _defineProperty(_cx, "hig__button-v1--type-" + type, type), _defineProperty(_cx, "hig__button-v1--width-" + width, width), _cx)); | ||
"div", | ||
{ className: classnames(themeClass, "hig__button-v1__icon") }, | ||
{ className: cx(themeClass, "hig__button-v1__icon") }, | ||
icon | ||
@@ -301,3 +270,3 @@ ), | ||
"span", | ||
{ className: classnames("hig__button__title") }, | ||
{ className: cx("hig__button__title") }, | ||
title | ||
@@ -486,2 +455,2 @@ ) | ||
export default Button; | ||
export { availableSizes, availableTargets, availableTypes, availableWidths }; | ||
export { sizes, targets, types, widths, availableSizes, availableTargets, availableTypes, availableWidths }; |
@@ -10,61 +10,6 @@ 'use strict'; | ||
var React__default = _interopDefault(React); | ||
var cx = _interopDefault(require('classnames')); | ||
function createCommonjsModule(fn, module) { | ||
return module = { exports: {} }, fn(module, module.exports), module.exports; | ||
} | ||
var classnames = createCommonjsModule(function (module) { | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/*! | ||
Copyright (c) 2016 Jed Watson. | ||
Licensed under the MIT License (MIT), see | ||
http://jedwatson.github.io/classnames | ||
*/ | ||
/* global define */ | ||
(function () { | ||
var hasOwn = {}.hasOwnProperty; | ||
function classNames() { | ||
var classes = []; | ||
for (var i = 0; i < arguments.length; i++) { | ||
var arg = arguments[i]; | ||
if (!arg) continue; | ||
var argType = typeof arg === 'undefined' ? 'undefined' : _typeof(arg); | ||
if (argType === 'string' || argType === 'number') { | ||
classes.push(arg); | ||
} else if (Array.isArray(arg)) { | ||
classes.push(classNames.apply(null, arg)); | ||
} else if (argType === 'object') { | ||
for (var key in arg) { | ||
if (hasOwn.call(arg, key) && arg[key]) { | ||
classes.push(key); | ||
} | ||
} | ||
} | ||
} | ||
return classes.join(' '); | ||
} | ||
if ('object' !== 'undefined' && module.exports) { | ||
module.exports = classNames; | ||
} else if (typeof undefined === 'function' && _typeof(undefined.amd) === 'object' && undefined.amd) { | ||
// register as 'classnames', consistent with npm package name | ||
undefined('classnames', [], function () { | ||
return classNames; | ||
}); | ||
} else { | ||
window.classNames = classNames; | ||
} | ||
})(); | ||
}); | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var HIGLightTheme = { | ||
@@ -224,7 +169,31 @@ themeId: "hig-light", | ||
var availableSizes = Object.freeze(["small", "standard", "large"]); | ||
var availableTargets = Object.freeze(["_self", "_blank", "_parent", "_top"]); | ||
var availableTypes = Object.freeze(["primary", "secondary", "flat"]); | ||
var availableWidths = Object.freeze(["shrink", "grow"]); | ||
var sizes = Object.freeze({ | ||
SMALL: "small", | ||
STANDARD: "standard", | ||
LARGE: "large" | ||
}); | ||
var targets = Object.freeze({ | ||
SELF: "_self", | ||
BLANK: "_blank", | ||
PARENT: "_parent", | ||
TOP: "_top" | ||
}); | ||
var types = Object.freeze({ | ||
PRIMARY: "primary", | ||
SECONDARY: "secondary", | ||
FLAT: "flat" | ||
}); | ||
var widths = Object.freeze({ | ||
SHRINK: "shrink", | ||
GROW: "grow" | ||
}); | ||
var availableSizes = Object.freeze(Object.values(sizes)); | ||
var availableTargets = Object.freeze(Object.values(targets)); | ||
var availableTypes = Object.freeze(Object.values(types)); | ||
var availableWidths = Object.freeze(Object.values(widths)); | ||
var _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
@@ -280,3 +249,3 @@ | ||
return classnames(themeClass, "hig__button-v1", (_cx = { | ||
return cx(themeClass, "hig__button-v1", (_cx = { | ||
"hig__button-v1--disabled": disabled | ||
@@ -303,3 +272,3 @@ }, _defineProperty(_cx, "hig__button-v1--size-" + size, size), _defineProperty(_cx, "hig__button-v1--type-" + type, type), _defineProperty(_cx, "hig__button-v1--width-" + width, width), _cx)); | ||
"div", | ||
{ className: classnames(themeClass, "hig__button-v1__icon") }, | ||
{ className: cx(themeClass, "hig__button-v1__icon") }, | ||
icon | ||
@@ -309,3 +278,3 @@ ), | ||
"span", | ||
{ className: classnames("hig__button__title") }, | ||
{ className: cx("hig__button__title") }, | ||
title | ||
@@ -494,2 +463,6 @@ ) | ||
exports.default = Button; | ||
exports.sizes = sizes; | ||
exports.targets = targets; | ||
exports.types = types; | ||
exports.widths = widths; | ||
exports.availableSizes = availableSizes; | ||
@@ -496,0 +469,0 @@ exports.availableTargets = availableTargets; |
{ | ||
"name": "@hig/button", | ||
"version": "0.1.0-alpha.a36b4d24", | ||
"version": "0.1.0-alpha.a529f134", | ||
"description": "HIG Button", | ||
@@ -16,20 +16,21 @@ "author": "Autodesk Inc.", | ||
], | ||
"dependencies": { | ||
"@hig/themes": "0.1.0-alpha.a529f134", | ||
"classnames": "^2.2.5" | ||
}, | ||
"devDependencies": { | ||
"@hig/babel-preset": "0.2.0-alpha.a36b4d24", | ||
"@hig/eslint-config": "0.2.0-alpha.a36b4d24", | ||
"@hig/icon": "0.1.0-alpha.a36b4d24", | ||
"@hig/scripts": "0.2.0-alpha.a36b4d24", | ||
"@hig/styles": "0.1.0-alpha.a36b4d24" | ||
"@hig/babel-preset": "0.2.0-alpha.a529f134", | ||
"@hig/eslint-config": "0.2.0-alpha.a529f134", | ||
"@hig/icon": "0.1.0-alpha.a529f134", | ||
"@hig/scripts": "0.2.0-alpha.a529f134", | ||
"@hig/styles": "0.2.0-alpha.a529f134" | ||
}, | ||
"peerDependencies": { | ||
"prop-types": "^15.5.10", | ||
"react": "^15.4.1" | ||
"react": "^15.4.1 || ^16.3.2" | ||
}, | ||
"scripts": { | ||
"build": "hig-scripts-build", | ||
"lint": "eslint src --ext .js,.jsx" | ||
"lint": "eslint src --color --ext .js,.jsx" | ||
}, | ||
"dependencies": { | ||
"@hig/themes": "0.1.0-alpha.a36b4d24" | ||
}, | ||
"babel": { | ||
@@ -36,0 +37,0 @@ "env": { |
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
50411
4
1223
+ Addedclassnames@^2.2.5
+ Added@hig/themes@0.1.0-alpha.a529f134(transitive)
+ Addedclassnames@2.5.1(transitive)
+ Addedreact@16.14.0(transitive)
- Removed@hig/themes@0.1.0-alpha.a36b4d24(transitive)
- Removedasap@2.0.6(transitive)
- Removedcore-js@1.2.7(transitive)
- Removedcreate-react-class@15.7.0(transitive)
- Removedencoding@0.1.13(transitive)
- Removedfbjs@0.8.18(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedisomorphic-fetch@2.2.1(transitive)
- Removednode-fetch@1.7.3(transitive)
- Removedpromise@7.3.1(transitive)
- Removedreact@15.7.0(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsetimmediate@1.0.5(transitive)
- Removedua-parser-js@0.7.39(transitive)
- Removedwhatwg-fetch@3.6.20(transitive)