@hig/button
Advanced tools
Comparing version 0.1.0-alpha.c2e500a7 to 0.1.0-alpha.d7d7ee5f
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.c2e500a7", | ||
"version": "0.1.0-alpha.d7d7ee5f", | ||
"description": "HIG Button", | ||
@@ -16,8 +16,12 @@ "author": "Autodesk Inc.", | ||
], | ||
"dependencies": { | ||
"@hig/themes": "0.1.0-alpha.d7d7ee5f", | ||
"classnames": "^2.2.5" | ||
}, | ||
"devDependencies": { | ||
"@hig/babel-preset": "0.2.0-alpha.c2e500a7", | ||
"@hig/eslint-config": "0.2.0-alpha.c2e500a7", | ||
"@hig/icon": "0.1.0-alpha.c2e500a7", | ||
"@hig/scripts": "0.2.0-alpha.c2e500a7", | ||
"@hig/styles": "0.1.0-alpha.c2e500a7" | ||
"@hig/babel-preset": "0.2.0-alpha.d7d7ee5f", | ||
"@hig/eslint-config": "0.2.0-alpha.d7d7ee5f", | ||
"@hig/icon": "0.1.0-alpha.d7d7ee5f", | ||
"@hig/scripts": "0.2.0-alpha.d7d7ee5f", | ||
"@hig/styles": "0.2.0-alpha.d7d7ee5f" | ||
}, | ||
@@ -32,5 +36,2 @@ "peerDependencies": { | ||
}, | ||
"dependencies": { | ||
"@hig/themes": "0.1.0-alpha.c2e500a7" | ||
}, | ||
"babel": { | ||
@@ -37,0 +38,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.d7d7ee5f(transitive)
+ Addedclassnames@2.5.1(transitive)
- Removed@hig/themes@0.1.0-alpha.c2e500a7(transitive)