diff --git a/packages/web-twig/src/Resources/components/Heading/Heading.stories.twig b/packages/web-twig/src/Resources/components/Heading/Heading.stories.twig index a0b32b032e..d2b6b29257 100644 --- a/packages/web-twig/src/Resources/components/Heading/Heading.stories.twig +++ b/packages/web-twig/src/Resources/components/Heading/Heading.stories.twig @@ -10,4 +10,8 @@ {% include '@components/Heading/stories/HeadingSizes.twig' %} + + {% include '@components/Heading/stories/HeadingEmphasis.twig' %} + + {% endblock %} diff --git a/packages/web-twig/src/Resources/components/Heading/Heading.twig b/packages/web-twig/src/Resources/components/Heading/Heading.twig index ea82df3b71..08b96f1fd5 100644 --- a/packages/web-twig/src/Resources/components/Heading/Heading.twig +++ b/packages/web-twig/src/Resources/components/Heading/Heading.twig @@ -1,10 +1,11 @@ {# API #} {%- set props = props | default([]) -%} +{%- set _emphasis = props.emphasis | default('bold') -%} {%- set _size = props.size | default('medium') -%} {%- set _elementType = props.elementType | default('div') -%} {# Class names #} -{%- set _rootClassName = _spiritClassPrefix ~ 'typography-heading-' ~ _size ~ '-text' -%} +{%- set _rootClassName = _spiritClassPrefix ~ 'typography-headline-' ~ _size ~ '-' ~ _emphasis -%} {# Miscellaneous #} {%- set _styleProps = useStyleProps(props) -%} diff --git a/packages/web-twig/src/Resources/components/Heading/README.md b/packages/web-twig/src/Resources/components/Heading/README.md index ff8e44f289..95bc71ef83 100644 --- a/packages/web-twig/src/Resources/components/Heading/README.md +++ b/packages/web-twig/src/Resources/components/Heading/README.md @@ -11,7 +11,7 @@ Basic example usage: Advanced example usage: ```twig -Text content +Text content ``` Without lexer: @@ -32,12 +32,14 @@ Without lexer: | ------------- | ------------------------------------------- | -------- | -------- | -------------------------------------------------------------- | | `size` | [Size Extended dictionary][dictionary-size] | `medium` | ✕ | Size of the text | | `elementType` | `string` | `div` | ✕ | HTML tag to render | -| `translate` | [`yes` \| `no` \| `''`] | `null` | ✕ | Set to `no` to disable machine translation of the text content | +| `emphasis` | [Emphasis dictionary][dictionary-emphasis] | `bold` | ✕ | Emphasis of the text | +| `translate` | \[`yes` \| `no` \| `''`] | `null` | ✕ | Set to `no` to disable machine translation of the text content | On top of the API options, the components accept [additional attributes][readme-additional-attributes]. If you need more control over the styling of a component, you can use [style props][readme-style-props] and [escape hatches][readme-escape-hatches]. +[dictionary-emphasis]: https://github.com/lmc-eu/spirit-design-system/tree/main/docs/DICTIONARIES.md#emphasis [dictionary-size]: https://github.com/lmc-eu/spirit-design-system/tree/main/docs/DICTIONARIES.md#size [heading]: https://github.com/lmc-eu/spirit-design-system/tree/main/packages/web-react/src/components/Heading [readme-additional-attributes]: https://github.com/lmc-eu/spirit-design-system/blob/main/packages/web-twig/README.md#additional-attributes diff --git a/packages/web-twig/src/Resources/components/Heading/__tests__/__fixtures__/headingDefault.twig b/packages/web-twig/src/Resources/components/Heading/__tests__/__fixtures__/headingDefault.twig index 748d3cf9cb..ad949c40bc 100644 --- a/packages/web-twig/src/Resources/components/Heading/__tests__/__fixtures__/headingDefault.twig +++ b/packages/web-twig/src/Resources/components/Heading/__tests__/__fixtures__/headingDefault.twig @@ -1,9 +1,23 @@ Example heading + + Example heading - + + + + Example heading + + + + Example heading diff --git a/packages/web-twig/src/Resources/components/Heading/__tests__/__snapshots__/headingDefault.twig.snap.html b/packages/web-twig/src/Resources/components/Heading/__tests__/__snapshots__/headingDefault.twig.snap.html index ef9892fb10..7676b9d030 100644 --- a/packages/web-twig/src/Resources/components/Heading/__tests__/__snapshots__/headingDefault.twig.snap.html +++ b/packages/web-twig/src/Resources/components/Heading/__tests__/__snapshots__/headingDefault.twig.snap.html @@ -5,16 +5,23 @@ -
+
Example heading
+ -

+

Example heading

+ -
+
Example heading
+ + +

+ Example heading +

diff --git a/packages/web-twig/src/Resources/components/Heading/stories/HeadingEmphasis.twig b/packages/web-twig/src/Resources/components/Heading/stories/HeadingEmphasis.twig new file mode 100644 index 0000000000..ae22017053 --- /dev/null +++ b/packages/web-twig/src/Resources/components/Heading/stories/HeadingEmphasis.twig @@ -0,0 +1,7 @@ +Heading regular + +Heading semibold + +Heading bold + +Heading italic diff --git a/packages/web-twig/src/Resources/components/Link/__tests__/__fixtures__/linkDefault.twig b/packages/web-twig/src/Resources/components/Link/__tests__/__fixtures__/linkDefault.twig index c0aa1b77c2..e1dbd13a66 100644 --- a/packages/web-twig/src/Resources/components/Link/__tests__/__fixtures__/linkDefault.twig +++ b/packages/web-twig/src/Resources/components/Link/__tests__/__fixtures__/linkDefault.twig @@ -12,7 +12,7 @@ Example link Example link Example link - Example link + Example link diff --git a/packages/web-twig/src/Resources/components/Link/stories/LinkColors.twig b/packages/web-twig/src/Resources/components/Link/stories/LinkColors.twig index a621a8178f..fff7e609d3 100644 --- a/packages/web-twig/src/Resources/components/Link/stories/LinkColors.twig +++ b/packages/web-twig/src/Resources/components/Link/stories/LinkColors.twig @@ -2,6 +2,4 @@ Secondary Link - - Inverted Link - +Tertiary Link diff --git a/packages/web-twig/src/Resources/components/Link/stories/LinkDisabled.twig b/packages/web-twig/src/Resources/components/Link/stories/LinkDisabled.twig index 7ce10f23b8..8c162b9b2f 100644 --- a/packages/web-twig/src/Resources/components/Link/stories/LinkDisabled.twig +++ b/packages/web-twig/src/Resources/components/Link/stories/LinkDisabled.twig @@ -2,6 +2,4 @@ Secondary Disabled Link - - Inverted Disabled Link - +Tertiary Disabled Link diff --git a/packages/web-twig/src/Resources/components/Text/README.md b/packages/web-twig/src/Resources/components/Text/README.md index a0ac049414..877a26f912 100644 --- a/packages/web-twig/src/Resources/components/Text/README.md +++ b/packages/web-twig/src/Resources/components/Text/README.md @@ -29,17 +29,19 @@ Without lexer: ## API -| Name | Type | Default | Required | Description | -| ------------- | ------------------------------------------- | --------- | -------- | -------------------------------------------------------------- | -| `elementType` | `string` | `p` | ✕ | HTML tag to render | -| `emphasis` | [`regular` \| `bold` \| `italic`] | `regular` | ✕ | Emphasis of the text | -| `size` | [Size Extended dictionary][dictionary-size] | `medium` | ✕ | Size of the text | -| `translate` | [`yes` \| `no` \| `''`] | `null` | ✕ | Set to `no` to disable machine translation of the text content | +| Name | Type | Default | Required | Description | +| ------------- | ----------------------------------------------- | --------- | -------- | -------------------------------------------------------------- | +| `elementType` | `string` | `p` | ✕ | HTML tag to render | +| `emphasis` | [`regular` \| `semibold` \| `bold` \| `italic`] | `regular` | ✕ | Emphasis of the text | +| `emphasis` | [Emphasis dictionary][dictionary-emphasis] | `regular` | ✕ | Emphasis of the text | +| `size` | [Size Extended dictionary][dictionary-size] | `medium` | ✕ | Size of the text | +| `translate` | \[`yes` \| `no` \| `''`] | `null` | ✕ | Set to `no` to disable machine translation of the text content | On top of the API options, the components accept [additional attributes][readme-additional-attributes]. If you need more control over the styling of a component, you can use [style props][readme-style-props] and [escape hatches][readme-escape-hatches]. +[dictionary-emphasis]: https://github.com/lmc-eu/spirit-design-system/tree/main/docs/DICTIONARIES.md#emphasis [dictionary-size]: https://github.com/lmc-eu/spirit-design-system/tree/main/docs/DICTIONARIES.md#size [readme-additional-attributes]: https://github.com/lmc-eu/spirit-design-system/blob/main/packages/web-twig/README.md#additional-attributes [readme-escape-hatches]: https://github.com/lmc-eu/spirit-design-system/blob/main/packages/web-twig/README.md#escape-hatches diff --git a/packages/web-twig/src/Resources/components/Text/Text.twig b/packages/web-twig/src/Resources/components/Text/Text.twig index 980cf83b60..04477b4989 100644 --- a/packages/web-twig/src/Resources/components/Text/Text.twig +++ b/packages/web-twig/src/Resources/components/Text/Text.twig @@ -5,7 +5,7 @@ {%- set _elementType = props.elementType | default('p') -%} {# Class names #} -{%- set _rootClassName = _spiritClassPrefix ~ 'typography-body-' ~ _size ~ '-text-' ~ _emphasis -%} +{%- set _rootClassName = _spiritClassPrefix ~ 'typography-body-' ~ _size ~ '-' ~ _emphasis -%} {# Miscellaneous #} {%- set _styleProps = useStyleProps(props) -%} diff --git a/packages/web-twig/src/Resources/components/Text/__tests__/__fixtures__/textDefault.twig b/packages/web-twig/src/Resources/components/Text/__tests__/__fixtures__/textDefault.twig index 85e57c8866..97b2443fef 100644 --- a/packages/web-twig/src/Resources/components/Text/__tests__/__fixtures__/textDefault.twig +++ b/packages/web-twig/src/Resources/components/Text/__tests__/__fixtures__/textDefault.twig @@ -5,6 +5,11 @@ Example text + + + Example text + + -

+

Example text

-
+
Example text
+ + +

+ Example text +

-
+
Example text
diff --git a/packages/web-twig/src/Resources/components/Text/stories/TextEmphasis.twig b/packages/web-twig/src/Resources/components/Text/stories/TextEmphasis.twig index 959bf884a7..afe0ccf2da 100644 --- a/packages/web-twig/src/Resources/components/Text/stories/TextEmphasis.twig +++ b/packages/web-twig/src/Resources/components/Text/stories/TextEmphasis.twig @@ -1,5 +1,7 @@ Text regular +Text semibold + Text bold Text italic diff --git a/packages/web-twig/src/Resources/components/UNSTABLE_EmptyState/__tests__/__snapshots__/UNSTABLE_EmptyState.twig.snap.html b/packages/web-twig/src/Resources/components/UNSTABLE_EmptyState/__tests__/__snapshots__/UNSTABLE_EmptyState.twig.snap.html index c8e9d2caca..ba96306feb 100644 --- a/packages/web-twig/src/Resources/components/UNSTABLE_EmptyState/__tests__/__snapshots__/UNSTABLE_EmptyState.twig.snap.html +++ b/packages/web-twig/src/Resources/components/UNSTABLE_EmptyState/__tests__/__snapshots__/UNSTABLE_EmptyState.twig.snap.html @@ -15,11 +15,11 @@
-

+

Headline

-

+

In publishing and graphic design, lorem ipsum is common placeholder text used to demonstrate the graphic elements