@govuk-react/caption
Advanced tools
Comparing version 0.10.5 to 0.10.6
export * from "./declarations/src/index"; | ||
export { default } from "./declarations/src/index"; | ||
//# sourceMappingURL=govuk-react-caption.cjs.d.ts.map |
@@ -14,55 +14,9 @@ 'use strict'; | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
/** | ||
* ### References | ||
* | ||
* - https://github.com/alphagov/govuk-frontend/blob/main/src/govuk/core/_typography.scss | ||
* - https://design-system.service.gov.uk/styles/typography/#headings | ||
*/ | ||
return obj; | ||
} | ||
function ownKeys(object, enumerableOnly) { | ||
var keys = Object.keys(object); | ||
if (Object.getOwnPropertySymbols) { | ||
var symbols = Object.getOwnPropertySymbols(object); | ||
if (enumerableOnly) { | ||
symbols = symbols.filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
}); | ||
} | ||
keys.push.apply(keys, symbols); | ||
} | ||
return keys; | ||
} | ||
function _objectSpread2(target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i] != null ? arguments[i] : {}; | ||
if (i % 2) { | ||
ownKeys(Object(source), true).forEach(function (key) { | ||
_defineProperty(target, key, source[key]); | ||
}); | ||
} else if (Object.getOwnPropertyDescriptors) { | ||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); | ||
} else { | ||
ownKeys(Object(source)).forEach(function (key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
}); | ||
} | ||
} | ||
return target; | ||
} | ||
/** | ||
@@ -74,28 +28,35 @@ * Sometimes you may need to make it clear that a page is part of a larger section or group. To do this, you can use a heading with a caption above it. | ||
*/ | ||
var Caption = styled__default["default"]('span').withConfig({ | ||
const Caption = styled__default["default"]('span').withConfig({ | ||
displayName: "src__Caption", | ||
componentId: "sc-dd9g0r-0" | ||
})(function (_ref) { | ||
var size = _ref.size; | ||
var actualSize = Number.isNaN(Number(size)) ? constants.CAPTION_SIZES[size] : size; | ||
})(_ref => { | ||
let { | ||
size | ||
} = _ref; | ||
const actualSize = Number.isNaN(Number(size)) ? constants.CAPTION_SIZES[size] : size; | ||
if (!actualSize) { | ||
throw Error("Unknown size ".concat(size, " used for header.")); | ||
throw Error(`Unknown size ${size} used for header.`); | ||
} | ||
return lib.typography.font({ | ||
size: actualSize | ||
}); | ||
}, function (_ref2) { | ||
var size = _ref2.size; | ||
var actualSize = Number.isNaN(Number(size)) ? constants.CAPTION_SIZES[size] : size; // bottom margin - hard-coded values because they're a bit odd | ||
}, _ref2 => { | ||
let { | ||
size | ||
} = _ref2; | ||
const actualSize = Number.isNaN(Number(size)) ? constants.CAPTION_SIZES[size] : size; | ||
var marginStyle = actualSize > 19 ? { | ||
// bottom margin - hard-coded values because they're a bit odd | ||
const marginStyle = actualSize > 19 ? { | ||
marginBottom: constants.SPACING_POINTS[1] | ||
} : undefined; | ||
var marginResponsiveStyle = actualSize === 24 ? _defineProperty({}, constants.MEDIA_QUERIES.TABLET, { | ||
marginBottom: 0 | ||
}) : undefined; | ||
return _objectSpread2(_objectSpread2({}, marginStyle), marginResponsiveStyle); | ||
const marginResponsiveStyle = actualSize === 24 ? { | ||
[constants.MEDIA_QUERIES.TABLET]: { | ||
marginBottom: 0 | ||
} | ||
} : undefined; | ||
return { | ||
...marginStyle, | ||
...marginResponsiveStyle | ||
}; | ||
}, { | ||
@@ -102,0 +63,0 @@ display: 'block', |
@@ -14,55 +14,9 @@ 'use strict'; | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
/** | ||
* ### References | ||
* | ||
* - https://github.com/alphagov/govuk-frontend/blob/main/src/govuk/core/_typography.scss | ||
* - https://design-system.service.gov.uk/styles/typography/#headings | ||
*/ | ||
return obj; | ||
} | ||
function ownKeys(object, enumerableOnly) { | ||
var keys = Object.keys(object); | ||
if (Object.getOwnPropertySymbols) { | ||
var symbols = Object.getOwnPropertySymbols(object); | ||
if (enumerableOnly) { | ||
symbols = symbols.filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
}); | ||
} | ||
keys.push.apply(keys, symbols); | ||
} | ||
return keys; | ||
} | ||
function _objectSpread2(target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i] != null ? arguments[i] : {}; | ||
if (i % 2) { | ||
ownKeys(Object(source), true).forEach(function (key) { | ||
_defineProperty(target, key, source[key]); | ||
}); | ||
} else if (Object.getOwnPropertyDescriptors) { | ||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); | ||
} else { | ||
ownKeys(Object(source)).forEach(function (key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
}); | ||
} | ||
} | ||
return target; | ||
} | ||
/** | ||
@@ -74,28 +28,35 @@ * Sometimes you may need to make it clear that a page is part of a larger section or group. To do this, you can use a heading with a caption above it. | ||
*/ | ||
var Caption = styled__default["default"]('span').withConfig({ | ||
const Caption = styled__default["default"]('span').withConfig({ | ||
displayName: "src__Caption", | ||
componentId: "sc-dd9g0r-0" | ||
})(function (_ref) { | ||
var size = _ref.size; | ||
var actualSize = Number.isNaN(Number(size)) ? constants.CAPTION_SIZES[size] : size; | ||
})(_ref => { | ||
let { | ||
size | ||
} = _ref; | ||
const actualSize = Number.isNaN(Number(size)) ? constants.CAPTION_SIZES[size] : size; | ||
if (!actualSize) { | ||
throw Error("Unknown size ".concat(size, " used for header.")); | ||
throw Error(`Unknown size ${size} used for header.`); | ||
} | ||
return lib.typography.font({ | ||
size: actualSize | ||
}); | ||
}, function (_ref2) { | ||
var size = _ref2.size; | ||
var actualSize = Number.isNaN(Number(size)) ? constants.CAPTION_SIZES[size] : size; // bottom margin - hard-coded values because they're a bit odd | ||
}, _ref2 => { | ||
let { | ||
size | ||
} = _ref2; | ||
const actualSize = Number.isNaN(Number(size)) ? constants.CAPTION_SIZES[size] : size; | ||
var marginStyle = actualSize > 19 ? { | ||
// bottom margin - hard-coded values because they're a bit odd | ||
const marginStyle = actualSize > 19 ? { | ||
marginBottom: constants.SPACING_POINTS[1] | ||
} : undefined; | ||
var marginResponsiveStyle = actualSize === 24 ? _defineProperty({}, constants.MEDIA_QUERIES.TABLET, { | ||
marginBottom: 0 | ||
}) : undefined; | ||
return _objectSpread2(_objectSpread2({}, marginStyle), marginResponsiveStyle); | ||
const marginResponsiveStyle = actualSize === 24 ? { | ||
[constants.MEDIA_QUERIES.TABLET]: { | ||
marginBottom: 0 | ||
} | ||
} : undefined; | ||
return { | ||
...marginStyle, | ||
...marginResponsiveStyle | ||
}; | ||
}, { | ||
@@ -102,0 +63,0 @@ display: 'block', |
@@ -6,55 +6,9 @@ import styled from 'styled-components'; | ||
function _defineProperty(obj, key, value) { | ||
if (key in obj) { | ||
Object.defineProperty(obj, key, { | ||
value: value, | ||
enumerable: true, | ||
configurable: true, | ||
writable: true | ||
}); | ||
} else { | ||
obj[key] = value; | ||
} | ||
/** | ||
* ### References | ||
* | ||
* - https://github.com/alphagov/govuk-frontend/blob/main/src/govuk/core/_typography.scss | ||
* - https://design-system.service.gov.uk/styles/typography/#headings | ||
*/ | ||
return obj; | ||
} | ||
function ownKeys(object, enumerableOnly) { | ||
var keys = Object.keys(object); | ||
if (Object.getOwnPropertySymbols) { | ||
var symbols = Object.getOwnPropertySymbols(object); | ||
if (enumerableOnly) { | ||
symbols = symbols.filter(function (sym) { | ||
return Object.getOwnPropertyDescriptor(object, sym).enumerable; | ||
}); | ||
} | ||
keys.push.apply(keys, symbols); | ||
} | ||
return keys; | ||
} | ||
function _objectSpread2(target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i] != null ? arguments[i] : {}; | ||
if (i % 2) { | ||
ownKeys(Object(source), true).forEach(function (key) { | ||
_defineProperty(target, key, source[key]); | ||
}); | ||
} else if (Object.getOwnPropertyDescriptors) { | ||
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); | ||
} else { | ||
ownKeys(Object(source)).forEach(function (key) { | ||
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); | ||
}); | ||
} | ||
} | ||
return target; | ||
} | ||
/** | ||
@@ -66,28 +20,35 @@ * Sometimes you may need to make it clear that a page is part of a larger section or group. To do this, you can use a heading with a caption above it. | ||
*/ | ||
var Caption = styled('span').withConfig({ | ||
const Caption = styled('span').withConfig({ | ||
displayName: "src__Caption", | ||
componentId: "sc-dd9g0r-0" | ||
})(function (_ref) { | ||
var size = _ref.size; | ||
var actualSize = Number.isNaN(Number(size)) ? CAPTION_SIZES[size] : size; | ||
})(_ref => { | ||
let { | ||
size | ||
} = _ref; | ||
const actualSize = Number.isNaN(Number(size)) ? CAPTION_SIZES[size] : size; | ||
if (!actualSize) { | ||
throw Error("Unknown size ".concat(size, " used for header.")); | ||
throw Error(`Unknown size ${size} used for header.`); | ||
} | ||
return typography.font({ | ||
size: actualSize | ||
}); | ||
}, function (_ref2) { | ||
var size = _ref2.size; | ||
var actualSize = Number.isNaN(Number(size)) ? CAPTION_SIZES[size] : size; // bottom margin - hard-coded values because they're a bit odd | ||
}, _ref2 => { | ||
let { | ||
size | ||
} = _ref2; | ||
const actualSize = Number.isNaN(Number(size)) ? CAPTION_SIZES[size] : size; | ||
var marginStyle = actualSize > 19 ? { | ||
// bottom margin - hard-coded values because they're a bit odd | ||
const marginStyle = actualSize > 19 ? { | ||
marginBottom: SPACING_POINTS[1] | ||
} : undefined; | ||
var marginResponsiveStyle = actualSize === 24 ? _defineProperty({}, MEDIA_QUERIES.TABLET, { | ||
marginBottom: 0 | ||
}) : undefined; | ||
return _objectSpread2(_objectSpread2({}, marginStyle), marginResponsiveStyle); | ||
const marginResponsiveStyle = actualSize === 24 ? { | ||
[MEDIA_QUERIES.TABLET]: { | ||
marginBottom: 0 | ||
} | ||
} : undefined; | ||
return { | ||
...marginStyle, | ||
...marginResponsiveStyle | ||
}; | ||
}, { | ||
@@ -94,0 +55,0 @@ display: 'block', |
{ | ||
"name": "@govuk-react/caption", | ||
"version": "0.10.5", | ||
"version": "0.10.6", | ||
"dependencies": { | ||
"@govuk-react/constants": "^0.10.5", | ||
"@govuk-react/lib": "^0.10.5", | ||
"@govuk-react/constants": "^0.10.6", | ||
"@govuk-react/lib": "^0.10.6", | ||
"govuk-colours": "^1.1.0" | ||
@@ -8,0 +8,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
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
12
35223
392
Updated@govuk-react/lib@^0.10.6