@titelmedia/bricks-headline
Advanced tools
Comparing version 0.0.12 to 0.1.0
import React from 'react'; | ||
import { StyledHeadline } from './styles'; | ||
import GlobalFonts from '@titelmedia/bricks-theme/lib/fonts/index.js'; | ||
import { Container, PinnedImageContent, StyledText } from './styles'; | ||
const Headline = ({ bold, children }) => { | ||
return ( | ||
<React.Fragment> | ||
<GlobalFonts /> | ||
<StyledHeadline bold={bold}> i'm a headline{children}</StyledHeadline> | ||
</React.Fragment> | ||
); | ||
const Headline = ({ text, style, parentLayout }) => { | ||
const textSizes = | ||
style === 'bold' | ||
? { mobile: 'xs', tablet_vertical: 'md', desktop: 'lg' } | ||
: { mobile: 'xs', tablet_vertical: 'sm', desktop: 'md' }; | ||
const textProps = | ||
style === 'bold' ? { bold: true, headline: true } : { headline: true }; | ||
const content = () => { | ||
return ( | ||
<StyledText | ||
parentLayout={parentLayout} | ||
fontWeight={style} | ||
dangerouslySetInnerHTML={{ __html: text }} | ||
sizes={textSizes} | ||
{...textProps} | ||
/> | ||
); | ||
}; | ||
const renderComponent = () => { | ||
if (parentLayout === 'pinnedImage' && style !== 'bold') { | ||
return <PinnedImageContent>{content()}</PinnedImageContent>; | ||
} else { | ||
return ( | ||
<Container> | ||
<h2>i am a headline</h2> | ||
<div>{content()}</div> | ||
</Container> | ||
); | ||
} | ||
}; | ||
return renderComponent(); | ||
}; | ||
export { Headline }; |
import styled from 'styled-components'; | ||
import { | ||
setFontSizes, | ||
setFont, | ||
} from '@titelmedia/bricks-theme/lib/utilities/typography'; | ||
import { setContainer } from '@titelmedia/bricks-theme/lib/utilities/layout'; | ||
const PINNED_IMAGE = 'pinnedImage'; | ||
export const StyledHeadline = styled.h4` | ||
line-height: 1.4em; | ||
${props => setFont({ bold: props.bold })} | ||
${setContainer({ size: 'sm' })} | ||
export const Container = styled.div` | ||
// Every value is +16 because of the padding | ||
@media (min-width: 768px) { | ||
max-width: ${524 + 16}px; | ||
} | ||
@media (min-width: 1024px) { | ||
max-width: ${690 + 16}px; | ||
} | ||
@media (min-width: 1440px) { | ||
max-width: ${664 + 16}px; | ||
} | ||
@media (min-width: 1600px) { | ||
max-width: ${792 + 16}px; | ||
} | ||
`; | ||
export const PinnedImageContent = styled.div` | ||
align-self: center; | ||
justify-self: center; | ||
width: 92%; | ||
@media (min-width: 992px) { | ||
width: 75%; | ||
} | ||
@media (min-width: 1600px) { | ||
width: 50%; | ||
} | ||
`; | ||
export const StyledText = styled.p` | ||
${props => | ||
setFontSizes({ | ||
mobile: props.bold ? '20px' : '16px', | ||
tablet_vertical: props.bold ? '30px' : '16px', | ||
})} | ||
props.parentLayout !== PINNED_IMAGE && | ||
` | ||
margin-left: auto; | ||
margin-right: auto; | ||
@media (min-width: 992px) { | ||
max-width: 720px; | ||
} | ||
@media (min-width: 1200px) { | ||
max-width: 840px; | ||
} | ||
`} | ||
font-weight: 900; | ||
line-height: 22px; | ||
@media (min-width: 768px) { | ||
line-height: ${({ bold }) => (bold ? '35px' : '26px')}; | ||
} | ||
@media (min-width: 1200px) { | ||
line-height: ${({ bold }) => (bold ? '53px' : '35px')}; | ||
} | ||
`; |
{ | ||
"name": "@titelmedia/bricks-headline", | ||
"version": "0.0.12", | ||
"version": "0.1.0", | ||
"description": "> TODO: description", | ||
@@ -30,5 +30,5 @@ "author": "Katerina Vaseva <katerina.vsv@gmail.com>", | ||
"dependencies": { | ||
"@titelmedia/bricks-theme": "^0.0.12" | ||
"@titelmedia/bricks-theme": "^0.1.0" | ||
}, | ||
"gitHead": "f4561b8906936d0c7d28f8a39f1f567575190dde" | ||
"gitHead": "df5d90a720550192dd9b307362ea8d7fe9996b30" | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3174
85
1
+ Added@ampproject/remapping@2.3.0(transitive)
+ Added@babel/code-frame@7.26.2(transitive)
+ Added@babel/compat-data@7.26.8(transitive)
+ Added@babel/core@7.26.9(transitive)
+ Added@babel/generator@7.26.9(transitive)
+ Added@babel/helper-annotate-as-pure@7.25.9(transitive)
+ Added@babel/helper-compilation-targets@7.26.5(transitive)
+ Added@babel/helper-module-imports@7.25.9(transitive)
+ Added@babel/helper-module-transforms@7.26.0(transitive)
+ Added@babel/helper-plugin-utils@7.26.5(transitive)
+ Added@babel/helper-string-parser@7.25.9(transitive)
+ Added@babel/helper-validator-identifier@7.25.9(transitive)
+ Added@babel/helper-validator-option@7.25.9(transitive)
+ Added@babel/helpers@7.26.9(transitive)
+ Added@babel/parser@7.26.9(transitive)
+ Added@babel/plugin-syntax-jsx@7.25.9(transitive)
+ Added@babel/template@7.26.9(transitive)
+ Added@babel/traverse@7.26.9(transitive)
+ Added@babel/types@7.26.9(transitive)
+ Added@emotion/is-prop-valid@1.3.1(transitive)
+ Added@emotion/memoize@0.9.0(transitive)
+ Added@emotion/stylis@0.8.5(transitive)
+ Added@emotion/unitless@0.7.5(transitive)
+ Added@jridgewell/gen-mapping@0.3.8(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/set-array@1.2.1(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.25(transitive)
+ Added@titelmedia/bricks-theme@0.1.21(transitive)
+ Addedbabel-plugin-styled-components@2.1.4(transitive)
+ Addedbrowserslist@4.24.4(transitive)
+ Addedcamelize@1.0.1(transitive)
+ Addedcaniuse-lite@1.0.30001701(transitive)
+ Addedconvert-source-map@2.0.0(transitive)
+ Addedcss-color-keywords@1.0.0(transitive)
+ Addedcss-to-react-native@3.2.0(transitive)
+ Addeddebug@4.4.0(transitive)
+ Addedelectron-to-chromium@1.5.106(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedgensync@1.0.0-beta.2(transitive)
+ Addedglobals@11.12.0(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedhoist-non-react-statics@3.3.2(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedjsesc@3.1.0(transitive)
+ Addedjson5@2.2.3(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedlru-cache@5.1.1(transitive)
+ Addedms@2.1.3(transitive)
+ Addednode-releases@2.0.19(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedpicocolors@1.1.1(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedpostcss-value-parser@4.2.0(transitive)
+ Addedreact@17.0.2(transitive)
+ Addedreact-dom@17.0.2(transitive)
+ Addedreact-is@16.13.119.0.0(transitive)
+ Addedscheduler@0.20.2(transitive)
+ Addedsemver@6.3.1(transitive)
+ Addedshallowequal@1.1.0(transitive)
+ Addedstyled-components@5.3.11(transitive)
+ Addedsupports-color@5.5.0(transitive)
+ Addedupdate-browserslist-db@1.1.3(transitive)
+ Addedyallist@3.1.1(transitive)
- Removed@titelmedia/bricks-theme@0.0.12(transitive)