Skip to content

Commit

Permalink
fixup! Docs(web-twig): Redesign the demo app #DS-1479
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkudrna committed Oct 3, 2024
1 parent 6abf5f6 commit 95cbb8a
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 27 deletions.
4 changes: 2 additions & 2 deletions apps/demo/partials/web/helpers.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

{{#> cardList}}
{{#each @helpers as |helper|}}
<li>
<a href="{{helper.name}}/" class="docs-Card">{{helper.title}}</a>
<li class="d-grid">
<a href="{{helper.name}}/" class="docs-Card text-truncate">{{helper.title}}</a>
</li>
{{/each}}
{{/cardList}}
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/partials/web/tabs.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="breakout-container">
<div class="breakout-container d-grid">

<div class="ScrollView ScrollView--horizontal mb-800 mb-tablet-1100" data-spirit-toggle="scrollView" data-spirit-direction="vertical">
<div class="ScrollView__viewport" data-spirit-element="viewport">
Expand Down
8 changes: 5 additions & 3 deletions apps/web-twig-demo/templates/default.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@

{% include 'partials/tabs.html.twig' %}

<ul class="Grid Grid--cols-2 Grid--tablet--cols-3">
<Grid cols="{{ { mobile: 2, tablet: 3 } }}" elementType="ul">

{% for component in components %}
<li class="d-grid">
<a href="components/{{ component | lower }}/" class="docs-Card text-truncate">{{ component }}</a>
<a href="components/{{ component | lower }}/" class="docs-Card text-truncate">
{{ component }}
</a>
</li>
{% endfor %}

</ul>
</Grid>

{% endblock %}
10 changes: 6 additions & 4 deletions apps/web-twig-demo/templates/helpers.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@

{% include 'partials/tabs.html.twig' %}

<ul class="Grid Grid--cols-2 Grid--tablet--cols-3">
<Grid cols="{{ { mobile: 2, tablet: 3 } }}" elementType="ul">

{% for helper in helpers %}
<li>
<a href="helpers/{{ helper }}/" class="docs-Card">{{ helper | replace({'-': ' '}) | title }}</a>
<li class="d-grid">
<a href="helpers/{{ helper }}/" class="docs-Card text-truncate">
{{ helper | replace({'-': ' '}) | title }}
</a>
</li>
{% endfor %}

</ul>
</Grid>

{% endblock %}
4 changes: 3 additions & 1 deletion apps/web-twig-demo/templates/layout/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">

<title>{% block title %}{% endblock%} — Web Twig — Spirit Design System</title>
<title>
{%- if block('title') is defined %}{% block title %}{% endblock %} —{% endif %} Web Twig — Spirit Design System
</title>

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
Expand Down
11 changes: 8 additions & 3 deletions apps/web-twig-demo/templates/layout/default.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@
{% include 'partials/cover.html.twig' with { isUnstable, parentPageName, parentPageUrl, title } only %}
{% endblock %}

{# Pre-render page content due to TwigX limitations. #}
{%- set renderedContent -%}
{% block content %}{% endblock %}
{%- endset -%}

<main class="py-1000">
<div class="Container">
<Container>

{% block content %}{% endblock %}
{{ renderedContent }}

</div>
</Container>
</main>

{% include 'partials/footer.html.twig' only %}
Expand Down
6 changes: 3 additions & 3 deletions apps/web-twig-demo/templates/partials/cover.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="spirit-theme-light-on-brand bg-primary mb-tablet-1200 py-1200 py-tablet-1700">
<div class="Container">
<Container>

<h1
class="Flex Flex--noWrap Flex--alignmentXStretch Flex--alignmentYCenter Flex--row typography-heading-xlarge-bold"
Expand All @@ -8,7 +8,7 @@
{{ title }}

{% if isUnstable %}
<span class="Tag Tag--large Tag--warning">Unstable</span>
<Tag color="warning" size="large">Unstable</Tag>
{% endif %}
</h1>

Expand All @@ -35,5 +35,5 @@
</ol>
</Breadcrumbs>

</div>
</Container>
</div>
4 changes: 2 additions & 2 deletions apps/web-twig-demo/templates/partials/footer.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<footer class="bg-secondary mt-1200 mt-tablet-1700 pt-1400 pb-1200 text-center">
<div class="Container">
<Container>

© Alma Career Oy and its subsidiaries

</div>
</Container>
</footer>
4 changes: 2 additions & 2 deletions apps/web-twig-demo/templates/partials/header.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Header UNSAFE_className="spirit-theme-light-on-brand">

<a href="http://localhost:3456" aria-label="Spirit Development Preview">
<Link href="http://localhost:3456" aria-label="Spirit Development Preview">
{% include 'assets/spiritLogoInverted.html.twig' %}
</a>
</Link>

<HeaderMobileActions dialogId="off-canvas-navigation" />

Expand Down
11 changes: 8 additions & 3 deletions apps/web-twig-demo/templates/partials/tabs.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
{% set isHelpersSelected = routeName == 'helpers_index' %}
{% set isValidationsSelected = routeName == 'validations_index' %}

<div class="breakout-container">
<ScrollView direction="horizontal" overflowDecorators="shadows" data-spirit-toggle="scrollView" UNSAFE_className="mb-800 mb-tablet-1100">
<TabList UNSAFE_className="mb-800 mx-auto">
<div class="breakout-container d-grid">
<ScrollView
direction="horizontal"
overflowDecorators="shadows"
data-spirit-toggle="scrollView"
marginBottom="{{ { mobile: 'space-800', tablet: 'space-1100' } }}"
>
<TabList marginX="auto" marginBottom="space-800">
<TabItem>
<TabLink href="/" isSelected={{ isComponentsSelected }}>Components</TabLink>
</TabItem>
Expand Down
2 changes: 1 addition & 1 deletion apps/web-twig-demo/templates/validations.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{% include 'partials/tabs.html.twig' %}

<Grid UNSAFE_className="mb-1600">
<Grid marginBottom="space-1600">
<GridItem columnStart="{{ { mobile: 2, tablet: 4, desktop: 5 } }}" columnEnd="{{ { mobile: 12, tablet: 10, desktop: 9 } }}">
<h2 class="docs-Heading">Real-World examples</h2>

Expand Down
8 changes: 6 additions & 2 deletions packages/web-twig/src/Resources/icons/Icons.stories.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@

{% include 'partials/tabs.html.twig' %}

<Grid elementType="ul" cols="{{ { mobile: 2, tablet: 4, desktop: 6 } }}" UNSAFE_className="text-center my-1000">
<Grid
elementType="ul"
cols="{{ { mobile: 2, tablet: 4, desktop: 6 } }}"
marginY="space-1000"
UNSAFE_className="text-center"
>

{% for icon in icons %}
<li class="mb-600">
<Icon name={{ icon }} />

<Text marginTop="space-500" emphasis="bold">{{ icon }}</Text>
</li>
{% endfor %}
Expand Down

0 comments on commit 95cbb8a

Please sign in to comment.