diff --git a/.changeset/sweet-beds-search.md b/.changeset/sweet-beds-search.md new file mode 100644 index 000000000..264c8096d --- /dev/null +++ b/.changeset/sweet-beds-search.md @@ -0,0 +1,5 @@ +--- +'@cloudfour/patterns': minor +--- + +Add the Bio layout object diff --git a/src/objects/bio/bio.scss b/src/objects/bio/bio.scss new file mode 100644 index 000000000..8fa58e3fd --- /dev/null +++ b/src/objects/bio/bio.scss @@ -0,0 +1,37 @@ +@use "../../compiled/tokens/scss/breakpoint"; +@use "../../compiled/tokens/scss/size"; +@use '../../mixins/fluid'; + +.o-bio { + display: grid; + grid-template-areas: + 'avatar' + 'content' + 'meta'; + grid-template-rows: repeat(3, minmax(0, auto)); + @include fluid.grid-gap( + breakpoint.$s, + breakpoint.$xl, + size.$spacing-gap-fluid-min, + size.$spacing-gap-fluid-max + ); + + @media (min-width: breakpoint.$l) { + grid-template-areas: + 'avatar content content' + 'meta content content'; + grid-template-columns: repeat(3, 1fr); + } +} + +.o-bio__avatar { + grid-area: avatar; +} + +.o-bio__content { + grid-area: content; +} + +.o-bio__meta { + grid-area: meta; +} diff --git a/src/objects/bio/bio.stories.mdx b/src/objects/bio/bio.stories.mdx new file mode 100644 index 000000000..b583bb3e0 --- /dev/null +++ b/src/objects/bio/bio.stories.mdx @@ -0,0 +1,38 @@ +import { Story, Canvas, Meta } from '@storybook/addon-docs/blocks'; +// The '!!raw-loader!' syntax is a non-standard, Webpack-specific, syntax. +// See: https://github.com/webpack-contrib/raw-loader#examples +// For now, it seems likely Storybook is pretty tied to Webpack, therefore, we are +// okay with the following Webpack-specific raw loader syntax. It's better to leave +// the ESLint rule enabled globally, and only thoughtfully disable as needed (e.g. +// within a Storybook docs page and not within an actual component). +// This can be revisited in the future if Storybook no longer relies on Webpack. +// eslint-disable-next-line @cloudfour/import/no-webpack-loader-syntax +import defaultDemoSource from '!!raw-loader!./demo/demo.twig'; +import defaultDemo from './demo/demo.twig'; + + + +# Bio + +The Bio layout object can be used for extended biographical details that include an avatar, an extended text description and optional meta information. + + + + {defaultDemo} + + + +## Template Properties + +- `avatar` (block): Block to add a bio avatar. +- `content` (block): Block to add the main bio content. +- `meta` (block): Optional block to add meta information (e.g. bio links). diff --git a/src/objects/bio/bio.twig b/src/objects/bio/bio.twig new file mode 100644 index 000000000..3319f27dd --- /dev/null +++ b/src/objects/bio/bio.twig @@ -0,0 +1,15 @@ +{% set _meta %}{% block meta %}{% endblock %}{% endset %} + +
+
+ {% block content %}{% endblock %} +
+
+ {% block avatar %}{% endblock %} +
+ {% if _meta is not empty %} +
+ {{ _meta }} +
+ {% endif %} +
diff --git a/src/objects/bio/demo/demo.twig b/src/objects/bio/demo/demo.twig new file mode 100644 index 000000000..8c6e37482 --- /dev/null +++ b/src/objects/bio/demo/demo.twig @@ -0,0 +1,31 @@ +{% embed '@cloudfour/objects/bio/bio.twig' only %} + {% block avatar %} + {% include '@cloudfour/components/avatar/avatar.twig' with { + size: 'full', + src: 'media/team-avatars/danielle.png' + } only %} + {% endblock %} + {% block content %} + {% embed '@cloudfour/objects/rhythm/rhythm.twig' only %} + {% block content %} +
+ {% include '@cloudfour/components/heading/heading.twig' with { + content: 'Danielle Romo', + level: 1 + } only %} +

Front-end Designer

+
+

Danielle is a front-end designer passionate about all things creative including design, art, and music. She began her career as a graphic designer and draws on her visual design skills to create engaging experiences for the web. She hasn't stopped learning since taking her first web design class and continues to develop her coding skills one web page at a time.

+

Outside of work, you can find her drawing, listening to true crime podcasts, or hiking the beautiful Pacific Northwest.

+ {% endblock %} + {% endembed %} + {% endblock %} + {% block meta %} + + {% endblock %} +{% endembed %}