@govuk-react/label-text
Advanced tools
+13
-20
@@ -1,22 +0,15 @@ | ||
| var _styled; | ||
| import styled from 'styled-components'; | ||
| import React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import { BLACK } from 'govuk-colours'; | ||
| import { withWhiteSpace } from '@govuk-react/hoc'; | ||
| import { FONT_SIZE, LINE_HEIGHT, MEDIA_QUERIES, NTA_LIGHT } from '@govuk-react/constants'; | ||
| var StyledLabelText = styled('span')((_styled = { | ||
| fontFamily: NTA_LIGHT, | ||
| WebkitFontSmoothing: 'antialiased', | ||
| MozOsxFontSmoothing: 'grayscale', | ||
| import { spacing, typography } from '@govuk-react/lib'; // TODO should `LabelText` and `Label` be consolidated? | ||
| // TODO add support for differing font sizes, as per govuk-frontend - see: | ||
| // https://github.com/alphagov/govuk-frontend/blob/master/src/components/label/_label.scss | ||
| var StyledLabelText = styled('span')(typography.font({ | ||
| size: 19 | ||
| }), typography.textColour, { | ||
| display: 'block', | ||
| clear: 'none', | ||
| fontWeight: 400, | ||
| fontSize: FONT_SIZE.SIZE_16, | ||
| lineHeight: LINE_HEIGHT.SIZE_16 | ||
| }, _styled[MEDIA_QUERIES.LARGESCREEN] = { | ||
| fontSize: FONT_SIZE.SIZE_19, | ||
| lineHeight: LINE_HEIGHT.SIZE_19 | ||
| }, _styled.color = "" + BLACK, _styled.paddingBottom = '2px', _styled), function (_ref) { | ||
| paddingBottom: '2px' | ||
| }, function (_ref) { | ||
| var error = _ref.error; | ||
@@ -26,3 +19,5 @@ return { | ||
| }; | ||
| }); | ||
| }, spacing.withWhiteSpace({ | ||
| marginBottom: 0 | ||
| })); | ||
| /** | ||
@@ -46,5 +41,3 @@ * | ||
| export default withWhiteSpace({ | ||
| marginBottom: 0 | ||
| })(LabelText); | ||
| export default LabelText; | ||
| //# sourceMappingURL=index.js.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../src/index.js"],"names":["styled","React","PropTypes","BLACK","withWhiteSpace","FONT_SIZE","LINE_HEIGHT","MEDIA_QUERIES","NTA_LIGHT","StyledLabelText","fontFamily","WebkitFontSmoothing","MozOsxFontSmoothing","display","clear","fontWeight","fontSize","SIZE_16","lineHeight","LARGESCREEN","SIZE_19","color","paddingBottom","error","undefined","LabelText","props","marginBottom"],"mappings":";;AAAA,OAAOA,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAASC,KAAT,QAAsB,eAAtB;AACA,SAASC,cAAT,QAA+B,kBAA/B;AACA,SACEC,SADF,EAEEC,WAFF,EAGEC,aAHF,EAIEC,SAJF,QAKO,wBALP;AAOA,IAAMC,eAAe,GAAGT,MAAM,CAAC,MAAD,CAAN;AAEpBU,EAAAA,UAAU,EAAEF,SAFQ;AAGpBG,EAAAA,mBAAmB,EAAE,aAHD;AAIpBC,EAAAA,mBAAmB,EAAE,WAJD;AAKpBC,EAAAA,OAAO,EAAE,OALW;AAMpBC,EAAAA,KAAK,EAAE,MANa;AAOpBC,EAAAA,UAAU,EAAE,GAPQ;AAQpBC,EAAAA,QAAQ,EAAEX,SAAS,CAACY,OARA;AASpBC,EAAAA,UAAU,EAAEZ,WAAW,CAACW;AATJ,WAUnBV,aAAa,CAACY,WAVK,IAUS;AAC3BH,EAAAA,QAAQ,EAAEX,SAAS,CAACe,OADO;AAE3BF,EAAAA,UAAU,EAAEZ,WAAW,CAACc;AAFG,CAVT,UAcpBC,KAdoB,QAcVlB,KAdU,UAepBmB,aAfoB,GAeL,KAfK,YAiBtB;AAAA,MAAGC,KAAH,QAAGA,KAAH;AAAA,SAAgB;AACdR,IAAAA,UAAU,EAAEQ,KAAK,GAAG,GAAH,GAASC;AADZ,GAAhB;AAAA,CAjBsB,CAAxB;AAsBA;;;;;;;;;;;;;;AAaA,IAAMC,SAAS,GAAG,SAAZA,SAAY,CAAAC,KAAK;AAAA,SAAI,oBAAC,eAAD,EAAqBA,KAArB,CAAJ;AAAA,CAAvB;;AAOA,eAAetB,cAAc,CAAC;AAAEuB,EAAAA,YAAY,EAAE;AAAhB,CAAD,CAAd,CAAoCF,SAApC,CAAf","sourcesContent":["import styled from 'styled-components';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { BLACK } from 'govuk-colours';\nimport { withWhiteSpace } from '@govuk-react/hoc';\nimport {\n FONT_SIZE,\n LINE_HEIGHT,\n MEDIA_QUERIES,\n NTA_LIGHT,\n} from '@govuk-react/constants';\n\nconst StyledLabelText = styled('span')(\n {\n fontFamily: NTA_LIGHT,\n WebkitFontSmoothing: 'antialiased',\n MozOsxFontSmoothing: 'grayscale',\n display: 'block',\n clear: 'none',\n fontWeight: 400,\n fontSize: FONT_SIZE.SIZE_16,\n lineHeight: LINE_HEIGHT.SIZE_16,\n [MEDIA_QUERIES.LARGESCREEN]: {\n fontSize: FONT_SIZE.SIZE_19,\n lineHeight: LINE_HEIGHT.SIZE_19,\n },\n color: `${BLACK}`,\n paddingBottom: '2px',\n },\n ({ error }) => ({\n fontWeight: error ? 700 : undefined,\n }),\n);\n\n/**\n *\n * ### Usage\n *\n * Simple\n * ```jsx\n * <LabelText>Example</LabelText>\n * ```\n *\n * ### References:\n * - https://github.com/alphagov/govuk-frontend/tree/master/src/components/\n *\n */\nconst LabelText = props => <StyledLabelText {...props} />;\n\nLabelText.propTypes = {\n /** Text for the label */\n children: PropTypes.node.isRequired,\n};\n\nexport default withWhiteSpace({ marginBottom: 0 })(LabelText);\n"],"file":"index.js"} | ||
| {"version":3,"sources":["../src/index.js"],"names":["styled","React","PropTypes","spacing","typography","StyledLabelText","font","size","textColour","display","clear","paddingBottom","error","fontWeight","undefined","withWhiteSpace","marginBottom","LabelText","props"],"mappings":"AAAA,OAAOA,MAAP,MAAmB,mBAAnB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,SAASC,OAAT,EAAkBC,UAAlB,QAAoC,kBAApC,C,CAEA;AACA;AACA;;AAEA,IAAMC,eAAe,GAAGL,MAAM,CAAC,MAAD,CAAN,CACtBI,UAAU,CAACE,IAAX,CAAgB;AAAEC,EAAAA,IAAI,EAAE;AAAR,CAAhB,CADsB,EAEtBH,UAAU,CAACI,UAFW,EAGtB;AACEC,EAAAA,OAAO,EAAE,OADX;AAEEC,EAAAA,KAAK,EAAE,MAFT;AAGEC,EAAAA,aAAa,EAAE;AAHjB,CAHsB,EAQtB;AAAA,MAAGC,KAAH,QAAGA,KAAH;AAAA,SAAgB;AACdC,IAAAA,UAAU,EAAED,KAAK,GAAG,GAAH,GAASE;AADZ,GAAhB;AAAA,CARsB,EAWtBX,OAAO,CAACY,cAAR,CAAuB;AAAEC,EAAAA,YAAY,EAAE;AAAhB,CAAvB,CAXsB,CAAxB;AAcA;;;;;;;;;;;;;;AAaA,IAAMC,SAAS,GAAG,SAAZA,SAAY,CAAAC,KAAK;AAAA,SAAI,oBAAC,eAAD,EAAqBA,KAArB,CAAJ;AAAA,CAAvB;;AAOA,eAAeD,SAAf","sourcesContent":["import styled from 'styled-components';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { spacing, typography } from '@govuk-react/lib';\n\n// TODO should `LabelText` and `Label` be consolidated?\n// TODO add support for differing font sizes, as per govuk-frontend - see:\n// https://github.com/alphagov/govuk-frontend/blob/master/src/components/label/_label.scss\n\nconst StyledLabelText = styled('span')(\n typography.font({ size: 19 }),\n typography.textColour,\n {\n display: 'block',\n clear: 'none',\n paddingBottom: '2px',\n },\n ({ error }) => ({\n fontWeight: error ? 700 : undefined,\n }),\n spacing.withWhiteSpace({ marginBottom: 0 }),\n);\n\n/**\n *\n * ### Usage\n *\n * Simple\n * ```jsx\n * <LabelText>Example</LabelText>\n * ```\n *\n * ### References:\n * - https://github.com/alphagov/govuk-frontend/tree/master/src/components/\n *\n */\nconst LabelText = props => <StyledLabelText {...props} />;\n\nLabelText.propTypes = {\n /** Text for the label */\n children: PropTypes.node.isRequired,\n};\n\nexport default LabelText;\n"],"file":"index.js"} |
+13
-23
@@ -12,25 +12,16 @@ "use strict"; | ||
| var _govukColours = require("govuk-colours"); | ||
| var _lib = require("@govuk-react/lib"); | ||
| var _hoc = require("@govuk-react/hoc"); | ||
| var _constants = require("@govuk-react/constants"); | ||
| var _styled; | ||
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
| var StyledLabelText = (0, _styledComponents.default)('span')((_styled = { | ||
| fontFamily: _constants.NTA_LIGHT, | ||
| WebkitFontSmoothing: 'antialiased', | ||
| MozOsxFontSmoothing: 'grayscale', | ||
| // TODO should `LabelText` and `Label` be consolidated? | ||
| // TODO add support for differing font sizes, as per govuk-frontend - see: | ||
| // https://github.com/alphagov/govuk-frontend/blob/master/src/components/label/_label.scss | ||
| var StyledLabelText = (0, _styledComponents.default)('span')(_lib.typography.font({ | ||
| size: 19 | ||
| }), _lib.typography.textColour, { | ||
| display: 'block', | ||
| clear: 'none', | ||
| fontWeight: 400, | ||
| fontSize: _constants.FONT_SIZE.SIZE_16, | ||
| lineHeight: _constants.LINE_HEIGHT.SIZE_16 | ||
| }, _styled[_constants.MEDIA_QUERIES.LARGESCREEN] = { | ||
| fontSize: _constants.FONT_SIZE.SIZE_19, | ||
| lineHeight: _constants.LINE_HEIGHT.SIZE_19 | ||
| }, _styled.color = "" + _govukColours.BLACK, _styled.paddingBottom = '2px', _styled), function (_ref) { | ||
| paddingBottom: '2px' | ||
| }, function (_ref) { | ||
| var error = _ref.error; | ||
@@ -40,3 +31,5 @@ return { | ||
| }; | ||
| }); | ||
| }, _lib.spacing.withWhiteSpace({ | ||
| marginBottom: 0 | ||
| })); | ||
| /** | ||
@@ -60,8 +53,5 @@ * | ||
| var _default = (0, _hoc.withWhiteSpace)({ | ||
| marginBottom: 0 | ||
| })(LabelText); | ||
| var _default = LabelText; | ||
| exports.default = _default; | ||
| module.exports = exports.default; | ||
| //# sourceMappingURL=index.js.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../src/index.js"],"names":["StyledLabelText","fontFamily","NTA_LIGHT","WebkitFontSmoothing","MozOsxFontSmoothing","display","clear","fontWeight","fontSize","FONT_SIZE","SIZE_16","lineHeight","LINE_HEIGHT","MEDIA_QUERIES","LARGESCREEN","SIZE_19","color","BLACK","paddingBottom","error","undefined","LabelText","props","marginBottom"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAOA,IAAMA,eAAe,GAAG,+BAAO,MAAP;AAEpBC,EAAAA,UAAU,EAAEC,oBAFQ;AAGpBC,EAAAA,mBAAmB,EAAE,aAHD;AAIpBC,EAAAA,mBAAmB,EAAE,WAJD;AAKpBC,EAAAA,OAAO,EAAE,OALW;AAMpBC,EAAAA,KAAK,EAAE,MANa;AAOpBC,EAAAA,UAAU,EAAE,GAPQ;AAQpBC,EAAAA,QAAQ,EAAEC,qBAAUC,OARA;AASpBC,EAAAA,UAAU,EAAEC,uBAAYF;AATJ,WAUnBG,yBAAcC,WAVK,IAUS;AAC3BN,EAAAA,QAAQ,EAAEC,qBAAUM,OADO;AAE3BJ,EAAAA,UAAU,EAAEC,uBAAYG;AAFG,CAVT,UAcpBC,KAdoB,QAcVC,mBAdU,UAepBC,aAfoB,GAeL,KAfK,YAiBtB;AAAA,MAAGC,KAAH,QAAGA,KAAH;AAAA,SAAgB;AACdZ,IAAAA,UAAU,EAAEY,KAAK,GAAG,GAAH,GAASC;AADZ,GAAhB;AAAA,CAjBsB,CAAxB;AAsBA;;;;;;;;;;;;;;AAaA,IAAMC,SAAS,GAAG,SAAZA,SAAY,CAAAC,KAAK;AAAA,SAAI,6BAAC,eAAD,EAAqBA,KAArB,CAAJ;AAAA,CAAvB;;eAOe,yBAAe;AAAEC,EAAAA,YAAY,EAAE;AAAhB,CAAf,EAAoCF,SAApC,C","sourcesContent":["import styled from 'styled-components';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { BLACK } from 'govuk-colours';\nimport { withWhiteSpace } from '@govuk-react/hoc';\nimport {\n FONT_SIZE,\n LINE_HEIGHT,\n MEDIA_QUERIES,\n NTA_LIGHT,\n} from '@govuk-react/constants';\n\nconst StyledLabelText = styled('span')(\n {\n fontFamily: NTA_LIGHT,\n WebkitFontSmoothing: 'antialiased',\n MozOsxFontSmoothing: 'grayscale',\n display: 'block',\n clear: 'none',\n fontWeight: 400,\n fontSize: FONT_SIZE.SIZE_16,\n lineHeight: LINE_HEIGHT.SIZE_16,\n [MEDIA_QUERIES.LARGESCREEN]: {\n fontSize: FONT_SIZE.SIZE_19,\n lineHeight: LINE_HEIGHT.SIZE_19,\n },\n color: `${BLACK}`,\n paddingBottom: '2px',\n },\n ({ error }) => ({\n fontWeight: error ? 700 : undefined,\n }),\n);\n\n/**\n *\n * ### Usage\n *\n * Simple\n * ```jsx\n * <LabelText>Example</LabelText>\n * ```\n *\n * ### References:\n * - https://github.com/alphagov/govuk-frontend/tree/master/src/components/\n *\n */\nconst LabelText = props => <StyledLabelText {...props} />;\n\nLabelText.propTypes = {\n /** Text for the label */\n children: PropTypes.node.isRequired,\n};\n\nexport default withWhiteSpace({ marginBottom: 0 })(LabelText);\n"],"file":"index.js"} | ||
| {"version":3,"sources":["../src/index.js"],"names":["StyledLabelText","typography","font","size","textColour","display","clear","paddingBottom","error","fontWeight","undefined","spacing","withWhiteSpace","marginBottom","LabelText","props"],"mappings":";;;;;AAAA;;AACA;;AACA;;AACA;;;;AAEA;AACA;AACA;AAEA,IAAMA,eAAe,GAAG,+BAAO,MAAP,EACtBC,gBAAWC,IAAX,CAAgB;AAAEC,EAAAA,IAAI,EAAE;AAAR,CAAhB,CADsB,EAEtBF,gBAAWG,UAFW,EAGtB;AACEC,EAAAA,OAAO,EAAE,OADX;AAEEC,EAAAA,KAAK,EAAE,MAFT;AAGEC,EAAAA,aAAa,EAAE;AAHjB,CAHsB,EAQtB;AAAA,MAAGC,KAAH,QAAGA,KAAH;AAAA,SAAgB;AACdC,IAAAA,UAAU,EAAED,KAAK,GAAG,GAAH,GAASE;AADZ,GAAhB;AAAA,CARsB,EAWtBC,aAAQC,cAAR,CAAuB;AAAEC,EAAAA,YAAY,EAAE;AAAhB,CAAvB,CAXsB,CAAxB;AAcA;;;;;;;;;;;;;;AAaA,IAAMC,SAAS,GAAG,SAAZA,SAAY,CAAAC,KAAK;AAAA,SAAI,6BAAC,eAAD,EAAqBA,KAArB,CAAJ;AAAA,CAAvB;;eAOeD,S","sourcesContent":["import styled from 'styled-components';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { spacing, typography } from '@govuk-react/lib';\n\n// TODO should `LabelText` and `Label` be consolidated?\n// TODO add support for differing font sizes, as per govuk-frontend - see:\n// https://github.com/alphagov/govuk-frontend/blob/master/src/components/label/_label.scss\n\nconst StyledLabelText = styled('span')(\n typography.font({ size: 19 }),\n typography.textColour,\n {\n display: 'block',\n clear: 'none',\n paddingBottom: '2px',\n },\n ({ error }) => ({\n fontWeight: error ? 700 : undefined,\n }),\n spacing.withWhiteSpace({ marginBottom: 0 }),\n);\n\n/**\n *\n * ### Usage\n *\n * Simple\n * ```jsx\n * <LabelText>Example</LabelText>\n * ```\n *\n * ### References:\n * - https://github.com/alphagov/govuk-frontend/tree/master/src/components/\n *\n */\nconst LabelText = props => <StyledLabelText {...props} />;\n\nLabelText.propTypes = {\n /** Text for the label */\n children: PropTypes.node.isRequired,\n};\n\nexport default LabelText;\n"],"file":"index.js"} |
+2
-4
| { | ||
| "name": "@govuk-react/label-text", | ||
| "version": "0.6.0-alpha.4", | ||
| "version": "0.6.0-rc.1", | ||
| "dependencies": { | ||
| "@govuk-react/constants": "^0.6.0-alpha.4", | ||
| "@govuk-react/hoc": "^0.6.0-alpha.4", | ||
| "govuk-colours": "^1.0.3" | ||
| "@govuk-react/lib": "^0.6.0-rc.1" | ||
| }, | ||
@@ -9,0 +7,0 @@ "peerDependencies": { |
+9
-20
| import styled from 'styled-components'; | ||
| import React from 'react'; | ||
| import PropTypes from 'prop-types'; | ||
| import { BLACK } from 'govuk-colours'; | ||
| import { withWhiteSpace } from '@govuk-react/hoc'; | ||
| import { | ||
| FONT_SIZE, | ||
| LINE_HEIGHT, | ||
| MEDIA_QUERIES, | ||
| NTA_LIGHT, | ||
| } from '@govuk-react/constants'; | ||
| import { spacing, typography } from '@govuk-react/lib'; | ||
| // TODO should `LabelText` and `Label` be consolidated? | ||
| // TODO add support for differing font sizes, as per govuk-frontend - see: | ||
| // https://github.com/alphagov/govuk-frontend/blob/master/src/components/label/_label.scss | ||
| const StyledLabelText = styled('span')( | ||
| typography.font({ size: 19 }), | ||
| typography.textColour, | ||
| { | ||
| fontFamily: NTA_LIGHT, | ||
| WebkitFontSmoothing: 'antialiased', | ||
| MozOsxFontSmoothing: 'grayscale', | ||
| display: 'block', | ||
| clear: 'none', | ||
| fontWeight: 400, | ||
| fontSize: FONT_SIZE.SIZE_16, | ||
| lineHeight: LINE_HEIGHT.SIZE_16, | ||
| [MEDIA_QUERIES.LARGESCREEN]: { | ||
| fontSize: FONT_SIZE.SIZE_19, | ||
| lineHeight: LINE_HEIGHT.SIZE_19, | ||
| }, | ||
| color: `${BLACK}`, | ||
| paddingBottom: '2px', | ||
@@ -33,2 +21,3 @@ }, | ||
| }), | ||
| spacing.withWhiteSpace({ marginBottom: 0 }), | ||
| ); | ||
@@ -56,2 +45,2 @@ | ||
| export default withWhiteSpace({ marginBottom: 0 })(LabelText); | ||
| export default LabelText; |
Sorry, the diff of this file is not supported yet
3
-40%23671
-13.28%242
-9.36%+ Added
- Removed
- Removed
- Removed
- Removed
- Removed