diff --git a/apps/web-twig-demo/public/css/demo.css b/apps/web-twig-demo/public/css/demo.css index 3fb97696b2..f0b2b6235b 100644 --- a/apps/web-twig-demo/public/css/demo.css +++ b/apps/web-twig-demo/public/css/demo.css @@ -35,11 +35,14 @@ .docs-Stack { display: grid; row-gap: 1rem; +} + +.docs-Stack--start { justify-items: start; } -.docs-Stack--fluid { - justify-items: initial; +.docs-Stack--stretch { + justify-items: stretch; } .docs-Box { diff --git a/packages/web-twig/docs/components/DocsSection/DocsSection.twig b/packages/web-twig/docs/components/DocsSection/DocsSection.twig index 4adae807c8..c3418b4219 100644 --- a/packages/web-twig/docs/components/DocsSection/DocsSection.twig +++ b/packages/web-twig/docs/components/DocsSection/DocsSection.twig @@ -1,6 +1,7 @@ {# API #} {%- set props = props | default([]) -%} -{%- set _hasFluidLayout = props.hasFluidLayout | default(false) -%} +{%- set _hasStack = props.hasStack ?? true -%} +{%- set _stackAlignment = props.stackAlignment | default('start') -%} {%- set _tag = props.tag | default(null) -%} {%- set _title = props.title -%} @@ -8,12 +9,16 @@ {%- set _rootClassName = 'docs-Section' -%} {%- set _headingClassName = 'docs-Heading' -%} {%- set _stackClassName = 'docs-Stack' -%} -{%- set _stackFluidClassName = _hasFluidLayout ? 'docs-Stack--fluid' : null -%} +{%- set _stackAlignmentClassName = 'docs-Stack--' ~ _stackAlignment -%} {# Miscellaneous #} {%- set _styleProps = useStyleProps(props) -%} {%- set _rootClassNames = [_rootClassName, _styleProps.className] -%} -{%- set _stackClassNames = [_stackClassName, _stackFluidClassName] -%} +{%- set _stackClassNames = [_stackClassName, _stackAlignmentClassName] -%} + +{%- set _renderedContent %} + {% block content %}{% endblock %} +{% endset -%}
{{ _tag }} {% endif %} -
- {% block content %}{% endblock %} -
+ {% if _hasStack %} +
+ {{ _renderedContent }} +
+ {% else %} + {{ _renderedContent }} + {% endif %}
diff --git a/packages/web-twig/docs/components/DocsSection/__tests__/__fixtures__/docsSectionDefault.twig b/packages/web-twig/docs/components/DocsSection/__tests__/__fixtures__/docsSectionDefault.twig index d17c23881d..d6ce54c4fe 100644 --- a/packages/web-twig/docs/components/DocsSection/__tests__/__fixtures__/docsSectionDefault.twig +++ b/packages/web-twig/docs/components/DocsSection/__tests__/__fixtures__/docsSectionDefault.twig @@ -1,4 +1,19 @@ + + + my content + + -my content + + my content + diff --git a/packages/web-twig/docs/components/DocsSection/__tests__/__snapshots__/docsSectionDefault.twig.snap.html b/packages/web-twig/docs/components/DocsSection/__tests__/__snapshots__/docsSectionDefault.twig.snap.html index 51b72918dd..c6053145f8 100644 --- a/packages/web-twig/docs/components/DocsSection/__tests__/__snapshots__/docsSectionDefault.twig.snap.html +++ b/packages/web-twig/docs/components/DocsSection/__tests__/__snapshots__/docsSectionDefault.twig.snap.html @@ -10,19 +10,27 @@

My Title

-
+
- +

- My Title My tag + My Title

-
+
my content
+ + +
+

+ My Title My tag +

+ my content +
diff --git a/packages/web-twig/src/Resources/components/Alert/Alert.stories.twig b/packages/web-twig/src/Resources/components/Alert/Alert.stories.twig index d79d239d7b..78f1d2f208 100644 --- a/packages/web-twig/src/Resources/components/Alert/Alert.stories.twig +++ b/packages/web-twig/src/Resources/components/Alert/Alert.stories.twig @@ -2,15 +2,15 @@ {% block content %} - + {% include '@components/Alert/stories/AlertColors.twig' %} - + {% include '@components/Alert/stories/AlertCentered.twig' %} - + {% include '@components/Alert/stories/AlertIcons.twig' %} diff --git a/packages/web-twig/src/Resources/components/Button/Button.stories.twig b/packages/web-twig/src/Resources/components/Button/Button.stories.twig index 4343cd5f61..1eaa9de33c 100644 --- a/packages/web-twig/src/Resources/components/Button/Button.stories.twig +++ b/packages/web-twig/src/Resources/components/Button/Button.stories.twig @@ -7,15 +7,15 @@ ] %} {% set sizes = [ 'small', 'medium', 'large' ] %} - + {% include '@components/Button/stories/ButtonColorsSizes.twig' %} - + {% include '@components/Button/stories/ButtonDisabled.twig' %} - + {% include '@components/Button/stories/ButtonLoading.twig' %} diff --git a/packages/web-twig/src/Resources/components/ButtonLink/ButtonLink.stories.twig b/packages/web-twig/src/Resources/components/ButtonLink/ButtonLink.stories.twig index 0bc526e5b5..da8ff050a0 100644 --- a/packages/web-twig/src/Resources/components/ButtonLink/ButtonLink.stories.twig +++ b/packages/web-twig/src/Resources/components/ButtonLink/ButtonLink.stories.twig @@ -7,11 +7,11 @@ ] %} {% set sizes = [ 'small', 'medium', 'large' ] %} - + {% include '@components/ButtonLink/stories/ButtonLinkColorsSizes.twig' %} - + {% include '@components/ButtonLink/stories/ButtonLinkDisabled.twig' %} diff --git a/packages/web-twig/src/Resources/components/Container/Container.stories.twig b/packages/web-twig/src/Resources/components/Container/Container.stories.twig index c7650e495f..96f18ba3e3 100644 --- a/packages/web-twig/src/Resources/components/Container/Container.stories.twig +++ b/packages/web-twig/src/Resources/components/Container/Container.stories.twig @@ -1,5 +1,14 @@ {% extends 'layout/plain.html.twig' %} {% block content %} - {% include '@components/Container/stories/ContainerDefault.twig' %} + + + + {# Use `.breakout-container` to make the example Container overlap with the Container in the page layout. #} +
+ {% include '@components/Container/stories/ContainerDefault.twig' %} +
+ +
+ {% endblock %} diff --git a/packages/web-twig/src/Resources/components/Header/Header.stories.twig b/packages/web-twig/src/Resources/components/Header/Header.stories.twig index 0aca1d5acb..5867c4f595 100644 --- a/packages/web-twig/src/Resources/components/Header/Header.stories.twig +++ b/packages/web-twig/src/Resources/components/Header/Header.stories.twig @@ -2,27 +2,27 @@ {% block content %} - + {% include '@components/Header/stories/HeaderMinimalInverted.twig' %} - + {% include '@components/Header/stories/HeaderInvertedWithActions.twig' %} - + {% include '@components/Header/stories/HeaderInvertedWithActionsAndDialog.twig' %} - + {% include '@components/Header/stories/HeaderSimpleInverted.twig' %} - + {% include '@components/Header/stories/HeaderSimpleTransparent.twig' %} - + {% include '@components/Header/stories/HeaderExperimentalRTL.twig' %} diff --git a/packages/web-twig/src/Resources/components/Pagination/Pagination.stories.twig b/packages/web-twig/src/Resources/components/Pagination/Pagination.stories.twig index 34f1ab33f0..a0fc65f40a 100644 --- a/packages/web-twig/src/Resources/components/Pagination/Pagination.stories.twig +++ b/packages/web-twig/src/Resources/components/Pagination/Pagination.stories.twig @@ -14,7 +14,7 @@ {% include '@components/Pagination/stories/PaginationCurrentLast.twig' %} - + {% include '@components/Pagination/stories/PaginationCurrentFirstCentered.twig' %} diff --git a/packages/web-twig/src/Resources/components/ScrollView/ScrollView.stories.twig b/packages/web-twig/src/Resources/components/ScrollView/ScrollView.stories.twig index 31f99d946c..e1c8aac1b6 100644 --- a/packages/web-twig/src/Resources/components/ScrollView/ScrollView.stories.twig +++ b/packages/web-twig/src/Resources/components/ScrollView/ScrollView.stories.twig @@ -10,13 +10,8 @@ {% include '@components/ScrollView/stories/ScrollViewHorizontal.twig' %} - - {# Use Grid to prepare the ground for container breakout (inside of the included example). #} - - - {% include '@components/ScrollView/stories/ScrollViewHorizontalBreakout.twig' %} - - + + {% include '@components/ScrollView/stories/ScrollViewHorizontalBreakout.twig' %} diff --git a/packages/web-twig/src/Resources/components/Stack/Stack.stories.twig b/packages/web-twig/src/Resources/components/Stack/Stack.stories.twig index 331406fe7f..7723173db4 100644 --- a/packages/web-twig/src/Resources/components/Stack/Stack.stories.twig +++ b/packages/web-twig/src/Resources/components/Stack/Stack.stories.twig @@ -2,27 +2,27 @@ {% block content %} - + {% include '@components/Stack/stories/StackFormFields.twig' %} - + {% include '@components/Stack/stories/StackBlocks.twig' %} - + {% include '@components/Stack/stories/StackBlocksWithVerticalSpacing.twig' %} - + {% include '@components/Stack/stories/StackBlocksWithInnerDividersAndVerticalSpacing.twig' %} - + {% include '@components/Stack/stories/StackBlocksWithInnerAndOuterDividersAndVerticalSpacing.twig' %} - + {% include '@components/Stack/stories/StackBlocksWithInnerDividersWithoutVerticalSpacing.twig' %} diff --git a/packages/web-twig/src/Resources/components/Tabs/Tabs.stories.twig b/packages/web-twig/src/Resources/components/Tabs/Tabs.stories.twig index 848603e418..c375654556 100644 --- a/packages/web-twig/src/Resources/components/Tabs/Tabs.stories.twig +++ b/packages/web-twig/src/Resources/components/Tabs/Tabs.stories.twig @@ -2,7 +2,7 @@ {% block content %} - + {% include '@components/Tabs/stories/TabsDefault.twig' %} diff --git a/packages/web-twig/src/Resources/components/Tag/Tag.stories.twig b/packages/web-twig/src/Resources/components/Tag/Tag.stories.twig index cf4efd3df8..e74ef67188 100644 --- a/packages/web-twig/src/Resources/components/Tag/Tag.stories.twig +++ b/packages/web-twig/src/Resources/components/Tag/Tag.stories.twig @@ -2,6 +2,8 @@ {% block content %} - {% include '@components/Tag/stories/TagDefault.twig' %} + + {% include '@components/Tag/stories/TagDefault.twig' %} + {% endblock %} diff --git a/packages/web-twig/src/Resources/components/TextField/TextField.stories.twig b/packages/web-twig/src/Resources/components/TextField/TextField.stories.twig index 0bf85afcdc..560f0e664d 100644 --- a/packages/web-twig/src/Resources/components/TextField/TextField.stories.twig +++ b/packages/web-twig/src/Resources/components/TextField/TextField.stories.twig @@ -34,7 +34,7 @@ {% include '@components/TextField/stories/TextFieldInputWidth.twig' %} - + {% include '@components/TextField/stories/TextFieldInline.twig' %} diff --git a/packages/web-twig/src/Resources/components/Tooltip/Tooltip.stories.twig b/packages/web-twig/src/Resources/components/Tooltip/Tooltip.stories.twig index 3a61836a9e..b53a8613e9 100644 --- a/packages/web-twig/src/Resources/components/Tooltip/Tooltip.stories.twig +++ b/packages/web-twig/src/Resources/components/Tooltip/Tooltip.stories.twig @@ -2,7 +2,7 @@ {% block content %} - + {% include '@components/Tooltip/stories/TooltipDefault.twig' %}