Skip to content

Commit

Permalink
Docs(web-react, web-twig): Switch responsive Grid props to the cols o…
Browse files Browse the repository at this point in the history
…bject
  • Loading branch information
crishpeen committed Nov 28, 2023
1 parent 85abe02 commit 18f3df9
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Grid } from '../../Grid';
import ButtonDemoFactory from './ButtonDemoFactory';

const ButtonDefault = () => (
<Grid cols={1} desktop={3}>
<Grid cols={{ mobile: 1, desktop: 3 }}>
<ButtonDemoFactory />
</Grid>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Grid } from '../../Grid';
import ButtonDemoFactory from './ButtonDemoFactory';

const ButtonDisabled = () => (
<Grid cols={1} desktop={3}>
<Grid cols={{ mobile: 1, desktop: 3 }}>
<ButtonDemoFactory isDisabled />
</Grid>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Grid } from '../../Grid';
import ButtonDemoFactory from './ButtonDemoFactory';

const ButtonLoading = () => (
<Grid cols={1} desktop={3}>
<Grid cols={{ mobile: 1, desktop: 3 }}>
<ButtonDemoFactory isLoading />
</Grid>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Grid } from '../../Grid';
import ButtonLinkDemoFactory from './ButtonLinkDemoFactory';

const ButtonLinkDefault = () => (
<Grid cols={1} desktop={3}>
<Grid cols={{ mobile: 1, desktop: 3 }}>
<ButtonLinkDemoFactory />
</Grid>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Grid } from '../../Grid';
import ButtonLinkDemoFactory from './ButtonLinkDemoFactory';

const ButtonLinkDisabled = () => (
<Grid cols={1} desktop={3}>
<Grid cols={{ mobile: 1, desktop: 3 }}>
<ButtonLinkDemoFactory isDisabled />
</Grid>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/web-react/src/components/Tag/demo/TagDefault.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const TagDefault = () => {
const colors = ['neutral', ...emotionColors];

return (
<Grid cols={1} tablet={3} desktop={5}>
<Grid cols={{ mobile: 1, tablet: 3, desktop: 5 }}>
{sizes.map((size) => (
<DocsSection key={size} title={`Size ${size}`}>
{colors.map((color) => (
Expand Down
6 changes: 5 additions & 1 deletion packages/web-react/src/icons/demo/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ const Icons = () => {
}

return (
<Grid elementType="ul" cols={2} tablet={4} desktop={6} UNSAFE_className="text-center my-1000 list-unstyled">
<Grid
elementType="ul"
cols={{ mobile: 2, tablet: 4, desktop: 6 }}
UNSAFE_className="text-center my-1000 list-unstyled"
>
{icons?.map((icon) => (
<li key={icon} className="mb-600">
<Icon name={icon} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ content can be overridden by any custom block content.
| Name | Type | Default | Required | Description |
| ------------- | -------- | ------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `elementType` | `string` | `nav` || HTML tag to render |
| `goBackTitle` | `string` ||| Title/translation for back link to previous page on mobile. It's essential to be set along with items. If items property is not passed, backlink is to be created within children property. [**Optional DEPRECATED**][Deprecated] Will be **required** in the next major version. |
| `goBackTitle` | `string` ||| Title/translation for back link to previous page on mobile. It's essential to be set along with items. If items property is not passed, backlink is to be created within children property. [**Optional DEPRECATED**][deprecated] Will be **required** in the next major version. |
| `items` | `array` | `[]` || Navigation menu items |

You can add `id`, `data-*` or `aria-*` attributes to further extend the component's
Expand Down Expand Up @@ -150,5 +150,6 @@ Please see the documentation for more details.
Additional option is to use helper class `text-truncate` with defined width.

[breadcrumbs]: https://github.com/lmc-eu/spirit-design-system/tree/main/packages/web/src/scss/components/Breadcrumbs
[deprecated]: https://github.com/lmc-eu/spirit-design-system/tree/main/packages/web-twig/README.md#deprecations
[escape-hatches]: https://github.com/lmc-eu/spirit-design-system/tree/main/packages/web-twig/README.md#escape-hatches
[twig-truncate]: https://twig.symfony.com/doc/3.x/filters/u.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Grid cols="1" desktop="3">
<Grid cols="{{ { mobile: 1, desktop: 3 } }}">
{% for size in sizes %}

{% set title = 'Size ' ~ size %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Grid cols="1" desktop="3">
<Grid cols="{{ { mobile: 1, desktop: 3 } }}">
{% for size in sizes %}

{% set title = 'Size ' ~ size %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Grid cols="1" desktop="3">
<Grid cols="{{ { mobile: 1, desktop: 3 } }}">
{% for size in sizes %}

{% set title = 'Size ' ~ size %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Grid cols="1" desktop="3">
<Grid cols="{{ { mobile: 1, desktop: 3 } }}">
{% for size in sizes %}

{% set title = 'Size ' ~ size %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Grid cols="1" desktop="3">
<Grid cols="{{ { mobile: 1, desktop: 3 } }}">
{% for size in sizes %}

{% set title = 'Size ' ~ size %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% set colors = [ 'neutral', 'success', 'informative', 'warning', 'danger' ] %}
{% set sizes = [ 'xsmall', 'small', 'medium', 'large', 'xlarge' ] %}

<Grid cols="1" tablet="3" desktop="5">
<Grid cols="{{ { mobile: 1, tablet: 3, desktop: 5 } }}">
{% for size in sizes %}
{% set title = 'Size ' ~ size %}
<DocsSection title={{ title }}>
Expand Down
2 changes: 1 addition & 1 deletion packages/web-twig/src/Resources/icons/Icons.stories.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<DocsSection title="Icons">

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

{% for icon in icons %}
<li class="mb-600">
Expand Down

0 comments on commit 18f3df9

Please sign in to comment.