@dhis2/ui-constants
Advanced tools
Comparing version 9.11.0 to 9.11.1-beta.1
@@ -7,3 +7,3 @@ "use strict"; | ||
exports.colors = void 0; | ||
const colors = { | ||
const colors = exports.colors = { | ||
/*blue*/ | ||
@@ -20,3 +20,2 @@ blue900: '#093371', | ||
blue050: '#f5fbff', | ||
/*teal*/ | ||
@@ -33,3 +32,2 @@ teal900: '#00332b', | ||
teal050: '#f1f9f9', | ||
/*red*/ | ||
@@ -46,3 +44,2 @@ red900: '#330202', | ||
red050: '#fff5f6', | ||
/*yellow*/ | ||
@@ -59,3 +56,2 @@ yellow900: '#6f3205', | ||
yellow050: '#fff8e1', | ||
/*green*/ | ||
@@ -72,3 +68,2 @@ green900: '#103713', | ||
green050: '#f4fbf4', | ||
/*grey*/ | ||
@@ -86,3 +81,2 @@ grey900: '#212934', | ||
white: '#ffffff' | ||
}; | ||
exports.colors = colors; | ||
}; |
@@ -7,3 +7,3 @@ "use strict"; | ||
exports.elevations = void 0; | ||
const elevations = { | ||
const elevations = exports.elevations = { | ||
e100: '0px 1px 2px rgba(33,41,52,0.06), 0px 1px 3px rgba(33,41,52,0.1)', | ||
@@ -13,3 +13,2 @@ e200: '0px 0px 1px rgba(33,41,52,0.1), 0px 4px 6px -1px rgba(33,41,52,0.1), 0px 2px 4px -1px rgba(33,41,52,0.06)', | ||
e400: '0px 25px 50px -12px rgba(33, 41, 52, 0.25)' | ||
}; | ||
exports.elevations = elevations; | ||
}; |
@@ -10,5 +10,3 @@ "use strict"; | ||
exports.sharedPropTypes = void 0; | ||
var _colors = require("./colors.js"); | ||
Object.keys(_colors).forEach(function (key) { | ||
@@ -25,5 +23,3 @@ if (key === "default" || key === "__esModule") return; | ||
}); | ||
var _theme = require("./theme.js"); | ||
Object.keys(_theme).forEach(function (key) { | ||
@@ -40,5 +36,3 @@ if (key === "default" || key === "__esModule") return; | ||
}); | ||
var _layers = require("./layers.js"); | ||
Object.keys(_layers).forEach(function (key) { | ||
@@ -55,5 +49,3 @@ if (key === "default" || key === "__esModule") return; | ||
}); | ||
var _spacers = require("./spacers.js"); | ||
Object.keys(_spacers).forEach(function (key) { | ||
@@ -70,5 +62,3 @@ if (key === "default" || key === "__esModule") return; | ||
}); | ||
var _elevations = require("./elevations.js"); | ||
Object.keys(_elevations).forEach(function (key) { | ||
@@ -85,9 +75,5 @@ if (key === "default" || key === "__esModule") return; | ||
}); | ||
var _sharedPropTypes = _interopRequireWildcard(require("./shared-prop-types.js")); | ||
exports.sharedPropTypes = _sharedPropTypes; | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } |
@@ -7,7 +7,6 @@ "use strict"; | ||
exports.layers = void 0; | ||
const layers = { | ||
const layers = exports.layers = { | ||
applicationTop: 2000, | ||
blocking: 3000, | ||
alert: 9999 | ||
}; | ||
exports.layers = layers; | ||
}; |
@@ -7,9 +7,5 @@ "use strict"; | ||
exports.statusPropType = exports.statusArgType = exports.sizePropType = exports.sizeArgType = exports.popperReferencePropType = exports.popperReferenceArgType = exports.popperPlacementPropType = exports.popperPlacementArgType = exports.insideAlignmentPropType = exports.insideAlignmentArgType = exports.buttonVariantArgType = void 0; | ||
var _propTypes = require("@dhis2/prop-types"); | ||
var _propTypes2 = _interopRequireDefault(require("prop-types")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } | ||
/** | ||
@@ -19,6 +15,5 @@ * Status propType | ||
*/ | ||
const statusPropType = (0, _propTypes.mutuallyExclusive)(['valid', 'warning', 'error'], _propTypes2.default.bool); // Exported for storybook | ||
exports.statusPropType = statusPropType; | ||
const statusArgType = { | ||
const statusPropType = exports.statusPropType = (0, _propTypes.mutuallyExclusive)(['valid', 'warning', 'error'], _propTypes2.default.bool); | ||
// Exported for storybook | ||
const statusArgType = exports.statusArgType = { | ||
table: { | ||
@@ -34,4 +29,4 @@ type: { | ||
}; | ||
exports.statusArgType = statusArgType; | ||
const buttonVariantArgType = // No description because it should be set for the component description | ||
const buttonVariantArgType = exports.buttonVariantArgType = | ||
// No description because it should be set for the component description | ||
{ | ||
@@ -47,2 +42,3 @@ table: { | ||
}; | ||
/** | ||
@@ -53,7 +49,4 @@ * Size variant propType | ||
*/ | ||
exports.buttonVariantArgType = buttonVariantArgType; | ||
const sizePropType = (0, _propTypes.mutuallyExclusive)(['small', 'large', 'extrasmall', 'fluid'], _propTypes2.default.bool); | ||
exports.sizePropType = sizePropType; | ||
const sizeArgType = { | ||
const sizePropType = exports.sizePropType = (0, _propTypes.mutuallyExclusive)(['small', 'large', 'extrasmall', 'fluid'], _propTypes2.default.bool); | ||
const sizeArgType = exports.sizeArgType = { | ||
// No description because it should be set in the component description | ||
@@ -70,2 +63,3 @@ table: { | ||
}; | ||
/** | ||
@@ -75,9 +69,4 @@ * Inside alignment props | ||
*/ | ||
exports.sizeArgType = sizeArgType; | ||
const insideAlignmentPropType = _propTypes2.default.oneOf(['top', 'middle', 'bottom']); | ||
exports.insideAlignmentPropType = insideAlignmentPropType; | ||
const insideAlignmentArgType = { | ||
const insideAlignmentPropType = exports.insideAlignmentPropType = _propTypes2.default.oneOf(['top', 'middle', 'bottom']); | ||
const insideAlignmentArgType = exports.insideAlignmentArgType = { | ||
description: 'Inside alignment of the component', | ||
@@ -94,2 +83,3 @@ table: { | ||
}; | ||
/** | ||
@@ -99,9 +89,4 @@ * Placement properties against reference element | ||
*/ | ||
exports.insideAlignmentArgType = insideAlignmentArgType; | ||
const popperPlacementPropType = _propTypes2.default.oneOf(['auto', 'auto-start', 'auto-end', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'right', 'right-start', 'right-end', 'left', 'left-start', 'left-end']); | ||
exports.popperPlacementPropType = popperPlacementPropType; | ||
const popperPlacementArgType = { | ||
const popperPlacementPropType = exports.popperPlacementPropType = _propTypes2.default.oneOf(['auto', 'auto-start', 'auto-end', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'right', 'right-start', 'right-end', 'left', 'left-start', 'left-end']); | ||
const popperPlacementArgType = exports.popperPlacementArgType = { | ||
description: 'Placement properties relative to reference element', | ||
@@ -119,2 +104,3 @@ table: { | ||
}; | ||
/** | ||
@@ -125,16 +111,14 @@ * Either a DOM node, React ref or a virtual element | ||
*/ | ||
exports.popperPlacementArgType = popperPlacementArgType; | ||
const popperReferencePropType = _propTypes2.default.oneOfType([// DOM node | ||
_propTypes2.default.instanceOf(Element), // React ref - React.useRef() or React.createRef() | ||
const popperReferencePropType = exports.popperReferencePropType = _propTypes2.default.oneOfType([ | ||
// DOM node | ||
_propTypes2.default.instanceOf(Element), | ||
// React ref - React.useRef() or React.createRef() | ||
_propTypes2.default.shape({ | ||
current: _propTypes2.default.instanceOf(Element) | ||
}), // Virtual element | ||
}), | ||
// Virtual element | ||
_propTypes2.default.shape({ | ||
getBoundingClientRect: _propTypes2.default.func | ||
})]); | ||
exports.popperReferencePropType = popperReferencePropType; | ||
const popperReferenceArgType = { | ||
const popperReferenceArgType = exports.popperReferenceArgType = { | ||
description: 'A reference to the element to position against: either a DOM node, React ref, \ | ||
@@ -150,3 +134,2 @@ or an instance of an element', | ||
} | ||
}; | ||
exports.popperReferenceArgType = popperReferenceArgType; | ||
}; |
@@ -7,5 +7,4 @@ "use strict"; | ||
exports.spacersNum = exports.spacers = void 0; | ||
/** Number values of the spacer definitions */ | ||
const spacersNum = { | ||
const spacersNum = exports.spacersNum = { | ||
dp4: 4, | ||
@@ -27,22 +26,20 @@ dp8: 8, | ||
}; | ||
/** Pixel values of the spacer definitions */ | ||
exports.spacersNum = spacersNum; | ||
const spacers = { | ||
dp4: "".concat(spacersNum.dp4, "px"), | ||
dp8: "".concat(spacersNum.dp8, "px"), | ||
dp12: "".concat(spacersNum.dp12, "px"), | ||
dp16: "".concat(spacersNum.dp16, "px"), | ||
dp24: "".concat(spacersNum.dp24, "px"), | ||
dp32: "".concat(spacersNum.dp32, "px"), | ||
dp48: "".concat(spacersNum.dp48, "px"), | ||
dp64: "".concat(spacersNum.dp64, "px"), | ||
dp96: "".concat(spacersNum.dp96, "px"), | ||
dp128: "".concat(spacersNum.dp128, "px"), | ||
dp192: "".concat(spacersNum.dp192, "px"), | ||
dp256: "".concat(spacersNum.dp256, "px"), | ||
dp384: "".concat(spacersNum.dp384, "px"), | ||
dp512: "".concat(spacersNum.dp512, "px"), | ||
dp640: "".concat(spacersNum.dp640, "px") | ||
}; | ||
exports.spacers = spacers; | ||
const spacers = exports.spacers = { | ||
dp4: `${spacersNum.dp4}px`, | ||
dp8: `${spacersNum.dp8}px`, | ||
dp12: `${spacersNum.dp12}px`, | ||
dp16: `${spacersNum.dp16}px`, | ||
dp24: `${spacersNum.dp24}px`, | ||
dp32: `${spacersNum.dp32}px`, | ||
dp48: `${spacersNum.dp48}px`, | ||
dp64: `${spacersNum.dp64}px`, | ||
dp96: `${spacersNum.dp96}px`, | ||
dp128: `${spacersNum.dp128}px`, | ||
dp192: `${spacersNum.dp192}px`, | ||
dp256: `${spacersNum.dp256}px`, | ||
dp384: `${spacersNum.dp384}px`, | ||
dp512: `${spacersNum.dp512}px`, | ||
dp640: `${spacersNum.dp640}px` | ||
}; |
@@ -7,9 +7,6 @@ "use strict"; | ||
exports.theme = void 0; | ||
var _colors = require("./colors.js"); | ||
const theme = { | ||
const theme = exports.theme = { | ||
/* theme */ | ||
fonts: 'Roboto, sans-serif', | ||
/*primary*/ | ||
@@ -26,3 +23,2 @@ primary900: _colors.colors.blue900, | ||
primary050: _colors.colors.blue050, | ||
/*secondary*/ | ||
@@ -39,3 +35,2 @@ secondary900: _colors.colors.teal900, | ||
secondary050: _colors.colors.teal050, | ||
/*status*/ | ||
@@ -48,3 +43,2 @@ default: _colors.colors.grey700, | ||
focus: _colors.colors.blue600 | ||
}; | ||
exports.theme = theme; | ||
}; |
@@ -13,3 +13,2 @@ export const colors = { | ||
blue050: '#f5fbff', | ||
/*teal*/ | ||
@@ -26,3 +25,2 @@ teal900: '#00332b', | ||
teal050: '#f1f9f9', | ||
/*red*/ | ||
@@ -39,3 +37,2 @@ red900: '#330202', | ||
red050: '#fff5f6', | ||
/*yellow*/ | ||
@@ -52,3 +49,2 @@ yellow900: '#6f3205', | ||
yellow050: '#fff8e1', | ||
/*green*/ | ||
@@ -65,3 +61,2 @@ green900: '#103713', | ||
green050: '#f4fbf4', | ||
/*grey*/ | ||
@@ -68,0 +63,0 @@ grey900: '#212934', |
@@ -6,3 +6,2 @@ export * from './colors.js'; | ||
export * from './elevations.js'; | ||
import * as _sharedPropTypes from './shared-prop-types.js'; | ||
export { _sharedPropTypes as sharedPropTypes }; | ||
export * as sharedPropTypes from './shared-prop-types.js'; |
import { mutuallyExclusive } from '@dhis2/prop-types'; | ||
import PropTypes from 'prop-types'; | ||
/** | ||
@@ -7,5 +8,4 @@ * Status propType | ||
*/ | ||
export const statusPropType = mutuallyExclusive(['valid', 'warning', 'error'], PropTypes.bool); // Exported for storybook | ||
export const statusPropType = mutuallyExclusive(['valid', 'warning', 'error'], PropTypes.bool); | ||
// Exported for storybook | ||
export const statusArgType = { | ||
@@ -22,3 +22,4 @@ table: { | ||
}; | ||
export const buttonVariantArgType = // No description because it should be set for the component description | ||
export const buttonVariantArgType = | ||
// No description because it should be set for the component description | ||
{ | ||
@@ -34,2 +35,3 @@ table: { | ||
}; | ||
/** | ||
@@ -40,3 +42,2 @@ * Size variant propType | ||
*/ | ||
export const sizePropType = mutuallyExclusive(['small', 'large', 'extrasmall', 'fluid'], PropTypes.bool); | ||
@@ -55,2 +56,3 @@ export const sizeArgType = { | ||
}; | ||
/** | ||
@@ -60,3 +62,2 @@ * Inside alignment props | ||
*/ | ||
export const insideAlignmentPropType = PropTypes.oneOf(['top', 'middle', 'bottom']); | ||
@@ -75,2 +76,3 @@ export const insideAlignmentArgType = { | ||
}; | ||
/** | ||
@@ -80,3 +82,2 @@ * Placement properties against reference element | ||
*/ | ||
export const popperPlacementPropType = PropTypes.oneOf(['auto', 'auto-start', 'auto-end', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'right', 'right-start', 'right-end', 'left', 'left-start', 'left-end']); | ||
@@ -96,2 +97,3 @@ export const popperPlacementArgType = { | ||
}; | ||
/** | ||
@@ -102,8 +104,10 @@ * Either a DOM node, React ref or a virtual element | ||
*/ | ||
export const popperReferencePropType = PropTypes.oneOfType([// DOM node | ||
PropTypes.instanceOf(Element), // React ref - React.useRef() or React.createRef() | ||
export const popperReferencePropType = PropTypes.oneOfType([ | ||
// DOM node | ||
PropTypes.instanceOf(Element), | ||
// React ref - React.useRef() or React.createRef() | ||
PropTypes.shape({ | ||
current: PropTypes.instanceOf(Element) | ||
}), // Virtual element | ||
}), | ||
// Virtual element | ||
PropTypes.shape({ | ||
@@ -110,0 +114,0 @@ getBoundingClientRect: PropTypes.func |
@@ -19,20 +19,20 @@ /** Number values of the spacer definitions */ | ||
}; | ||
/** Pixel values of the spacer definitions */ | ||
export const spacers = { | ||
dp4: "".concat(spacersNum.dp4, "px"), | ||
dp8: "".concat(spacersNum.dp8, "px"), | ||
dp12: "".concat(spacersNum.dp12, "px"), | ||
dp16: "".concat(spacersNum.dp16, "px"), | ||
dp24: "".concat(spacersNum.dp24, "px"), | ||
dp32: "".concat(spacersNum.dp32, "px"), | ||
dp48: "".concat(spacersNum.dp48, "px"), | ||
dp64: "".concat(spacersNum.dp64, "px"), | ||
dp96: "".concat(spacersNum.dp96, "px"), | ||
dp128: "".concat(spacersNum.dp128, "px"), | ||
dp192: "".concat(spacersNum.dp192, "px"), | ||
dp256: "".concat(spacersNum.dp256, "px"), | ||
dp384: "".concat(spacersNum.dp384, "px"), | ||
dp512: "".concat(spacersNum.dp512, "px"), | ||
dp640: "".concat(spacersNum.dp640, "px") | ||
dp4: `${spacersNum.dp4}px`, | ||
dp8: `${spacersNum.dp8}px`, | ||
dp12: `${spacersNum.dp12}px`, | ||
dp16: `${spacersNum.dp16}px`, | ||
dp24: `${spacersNum.dp24}px`, | ||
dp32: `${spacersNum.dp32}px`, | ||
dp48: `${spacersNum.dp48}px`, | ||
dp64: `${spacersNum.dp64}px`, | ||
dp96: `${spacersNum.dp96}px`, | ||
dp128: `${spacersNum.dp128}px`, | ||
dp192: `${spacersNum.dp192}px`, | ||
dp256: `${spacersNum.dp256}px`, | ||
dp384: `${spacersNum.dp384}px`, | ||
dp512: `${spacersNum.dp512}px`, | ||
dp640: `${spacersNum.dp640}px` | ||
}; |
@@ -5,3 +5,2 @@ import { colors } from './colors.js'; | ||
fonts: 'Roboto, sans-serif', | ||
/*primary*/ | ||
@@ -18,3 +17,2 @@ primary900: colors.blue900, | ||
primary050: colors.blue050, | ||
/*secondary*/ | ||
@@ -31,3 +29,2 @@ secondary900: colors.teal900, | ||
secondary050: colors.teal050, | ||
/*status*/ | ||
@@ -34,0 +31,0 @@ default: colors.grey700, |
{ | ||
"name": "@dhis2/ui-constants", | ||
"version": "9.11.0", | ||
"version": "9.11.1-beta.1", | ||
"description": "Constants used in the UI libs", | ||
@@ -26,3 +26,3 @@ "main": "./build/cjs/index.js", | ||
"scripts": { | ||
"start": "start-storybook -c ../storybook/config --port 5000", | ||
"start": "storybook dev -c ../storybook/config --port 5000", | ||
"build": "d2-app-scripts build" | ||
@@ -29,0 +29,0 @@ }, |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
21667
691
1