Skip to content

Commit

Permalink
feat(nav): mark as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
hirsch88 committed Jan 31, 2025
1 parent 95601b4 commit dd44292
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 63 deletions.
5 changes: 5 additions & 0 deletions .changeset/eight-socks-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baloise/ds-core': minor
---

**nav**: mark as deprecated
17 changes: 16 additions & 1 deletion docs/stories/components/bal-button/bal-button.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Canvas, Meta, Markdown } from '@storybook/blocks'
import { Banner, Lead, PlaygroundBar, StoryHeading, Footer } from '../../../.storybook/blocks'
import { Banner, Lead, PlaygroundBar, StoryHeading, Footer, InfoQuote } from '../../../.storybook/blocks'
import * as ButtonStories from './bal-button.stories'

<Meta of={ButtonStories} />
Expand All @@ -14,13 +14,28 @@ import * as ButtonStories from './bal-button.stories'
way.
</Lead>

<InfoQuote>
We recommend using standard <b>HTML elements</b> such as `<button>` and `<a>` whenever possible instead of web
components. However in combination with a spinner or icon use the component.
This helps improve the rendering speed of your application or website.
</InfoQuote>

<Canvas of={ButtonStories.Basic} sourceState="shown" />

<PlaygroundBar of={ButtonStories.Basic}></PlaygroundBar>

{/* STORIES */}
{/* ------------------------------------------------------ */}

<StoryHeading of={ButtonStories.Component}></StoryHeading>

We recommend using the <b>web component</b> in combination with a `<bal-spinner>` or `<bal-icon>`,
as it provides all necessary styles, library integrations and performance updates.

<Canvas of={ButtonStories.Component} />

{/* ------------------------------------------------------ */}

<StoryHeading of={ButtonStories.Variants}></StoryHeading>

Buttons are available in four main levels: **primary**, **secondary**, **tertiary**, and **link**. The primary level is specifically designed for prominent call-to-action elements.
Expand Down
4 changes: 4 additions & 0 deletions docs/stories/components/bal-button/bal-button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export default meta
const Story = StoryFactory<Args>(meta)

export const Basic = Story({
...withRender(() => `<button class="button is-primary">Button</button>`),
})

export const Component = Story({
args: {
content: 'Primary',
icon: 'plus',
Expand Down
34 changes: 21 additions & 13 deletions docs/stories/components/bal-heading/bal-heading.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Canvas, Meta, Markdown } from '@storybook/blocks'
import { Banner, Lead, PlaygroundBar, StoryHeading, Footer } from '../../../.storybook/blocks'
import { Banner, Lead, PlaygroundBar, StoryHeading, Footer, InfoQuote } from '../../../.storybook/blocks'
import * as HeadingStories from './bal-heading.stories'

<Meta of={HeadingStories} />
Expand All @@ -12,28 +12,42 @@ import * as HeadingStories from './bal-heading.stories'
**Heading** is a key component for displaying important titles and headers to organize and emphasize content.
</Lead>

<InfoQuote>
We recommend using standard <b>HTML elements</b> such as `<h1>`, `<h2>`, `<h3>`, and `<h4>` whenever possible instead of web
components. This helps improve the rendering speed of your application or website.

Additionally, explore CSS utilities for more styling options.

</InfoQuote>

<Canvas of={HeadingStories.Basic} sourceState="shown" />

<PlaygroundBar of={HeadingStories.Basic}></PlaygroundBar>

{/* STORIES */}
{/* ------------------------------------------------------ */}

<StoryHeading of={HeadingStories.Subtitle}></StoryHeading>
<StoryHeading of={HeadingStories.Levels}></StoryHeading>

<Canvas of={HeadingStories.Subtitle} />
<Canvas of={HeadingStories.Levels} sourceState={'shown'} />

{/* ------------------------------------------------------ */}

<StoryHeading of={HeadingStories.Levels}></StoryHeading>
<StoryHeading of={HeadingStories.Colors}></StoryHeading>

<Canvas of={HeadingStories.Levels} />
<Canvas of={HeadingStories.Colors} sourceState={'shown'} />

{/* ------------------------------------------------------ */}

<StoryHeading of={HeadingStories.Colors}></StoryHeading>
<StoryHeading of={HeadingStories.Title}></StoryHeading>

<Canvas of={HeadingStories.Colors} />
<Canvas of={HeadingStories.Title} />

{/* ------------------------------------------------------ */}

<StoryHeading of={HeadingStories.Subtitle}></StoryHeading>

<Canvas of={HeadingStories.Subtitle} />

{/* ------------------------------------------------------ */}

Expand All @@ -52,12 +66,6 @@ Using `auto-level`, one can specify the minimum visual level at which the headin

{/* ------------------------------------------------------ */}

<StoryHeading of={HeadingStories.CSSUtilities}></StoryHeading>

<Canvas of={HeadingStories.CSSUtilities} />

{/* ------------------------------------------------------ */}

## Component API

import api from './api.md?raw'
Expand Down
73 changes: 29 additions & 44 deletions docs/stories/components/bal-heading/bal-heading.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,35 @@ export default meta
const Story = StoryFactory<Args>(meta)

export const Basic = Story({
...withRender(
() => `
<h1 class="title text-xxx-large mb-none">Heading</h1>
<h2 class="subtitle text-xx-large">Subtitle</h2>`,
),
})

export const Levels = Story({
...withRender(
() => `
<h1 class="title text-xxx-large">Heading 1</h1>
<h2 class="title text-xx-large">Heading 2</h2>
<h3 class="title text-x-large">Heading 3</h3>
<h4 class="title text-large">Heading 4</h4>
<h5 class="title text-normal">Heading 5</h5>`,
),
})

export const Colors = Story({
...withRender(
() => `
<h4 class="title text-large">Default / Primary</h4>
<h4 class="title text-large text-success">Success</h4>
<h4 class="title text-large text-warning">Warning</h4>
<h4 class="title text-large text-danger">Danger</h4>`,
),
})

export const Title = Story({
args: {
level: 'h1',
subtitle: false,
Expand All @@ -44,38 +73,6 @@ export const Subtitle = Story({
},
})

export const Levels = Story({
...withRender(
() => `<div class="columns">
<div class="column is-half bg-yellow-1">
<bal-heading level="h1">Heading 1</bal-heading>
<bal-heading level="h2">Heading 2</bal-heading>
<bal-heading level="h3">Heading 3</bal-heading>
<bal-heading level="h4">Heading 4</bal-heading>
<bal-heading level="h5">Heading 5</bal-heading>
</div>
<div class="column is-half bg-yellow-2">
<h1 class="title text-xxx-large">Heading 1</h1>
<h2 class="title text-xx-large">Heading 2</h2>
<h3 class="title text-x-large">Heading 3</h3>
<h4 class="title text-large">Heading 4</h4>
<h5 class="title text-normal">Heading 5</h5>
</div>
</div>`,
),
})

export const Colors = Story({
...withRender(
() => `<div>
<bal-heading level="h4" space="none">Default / Primary</bal-heading>
<bal-heading color="success" level="h4" space="none">Success</bal-heading>
<bal-heading color="warning" level="h4" space="none">Warning</bal-heading>
<bal-heading color="danger" level="h4" space="none">Danger</bal-heading>
</div>`,
),
})

export const Spacing = Story({
...withRender(
() => `<div>
Expand Down Expand Up @@ -106,15 +103,3 @@ export const AutoLevel = Story({
inverted: false,
},
})

export const CSSUtilities = Story({
...withRender(
() => `<div>
<h1 class="title text-xxx-large">Heading 1</h1>
<h2 class="title text-xx-large">Heading 2</h2>
<h3 class="title text-x-large">Heading 3</h3>
<h4 class="title text-large">Heading 4</h4>
<h5 class="title text-normal">Heading 5</h5>
</div>`,
),
})
10 changes: 8 additions & 2 deletions docs/stories/components/bal-nav/bal-nav.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Canvas, Meta, Markdown } from '@storybook/blocks'
import { Banner, Lead, PlaygroundBar, StoryHeading, Footer } from '../../../.storybook/blocks'
import { Banner, Lead, PlaygroundBar, StoryHeading, Footer, WarningQuote } from '../../../.storybook/blocks'
import * as NavStories from './bal-nav.stories'

<Meta of={NavStories} />
Expand All @@ -8,7 +8,13 @@ import * as NavStories from './bal-nav.stories'

<Banner of={NavStories} />

<Lead>Navigation component serves as a central hub for seamless user navigation within the applications.</Lead>
<Lead>Navigation component serves as a central hub for seamless user navigation within the websites.</Lead>

<WarningQuote>
**Deprecation Warning!** <br />
Please use the components [Navbar](?path=/docs/components-navigation-navbar--documentation), because this component is
marked as deprecated and will be removed with the next major releases.
</WarningQuote>

## Anatomy

Expand Down
4 changes: 2 additions & 2 deletions docs/stories/components/bal-nav/bal-nav.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { buttonLinkItems, logoLinkItem, optionLinkItems } from './bal-nav.data'
type Args = JSX.BalNav & { content: string }

const meta: Meta<Args> = {
title: 'Components/Navigation/Nav',
title: 'Components/Deprecated/Nav',
parameters: {
layout: 'fullscreen',
},
Expand All @@ -28,7 +28,7 @@ const meta: Meta<Args> = {
}
})

section.innerHTML = ` <bal-nav content-width="440">
section.innerHTML = `<bal-nav content-width="440">
<bal-popup id="popup-call" label="24h Kundenservice">
<bal-stack layout="vertical">
<bal-button expanded>00800 24 800 800</bal-button>
Expand Down
16 changes: 15 additions & 1 deletion docs/stories/components/bal-text/bal-text.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Canvas, Meta, Markdown } from '@storybook/blocks'
import { Banner, Lead, PlaygroundBar, StoryHeading, Footer } from '../../../.storybook/blocks'
import { Banner, Lead, PlaygroundBar, StoryHeading, Footer, InfoQuote } from '../../../.storybook/blocks'
import * as TextStories from './bal-text.stories'

<Meta of={TextStories} />
Expand All @@ -10,13 +10,27 @@ import * as TextStories from './bal-text.stories'

<Lead>**Text** is a fundamental component used to display and present textual content.</Lead>

<InfoQuote>
We recommend using standard <b>HTML elements</b> such as `<p>`, `<span>`, `<b>`, and `<strong>` whenever possible instead of web
components. This helps improve the rendering speed of your application or website.

Additionally, explore CSS utilities for more styling options.

</InfoQuote>

<Canvas of={TextStories.Basic} sourceState="shown" />

<PlaygroundBar of={TextStories.Basic}></PlaygroundBar>

{/* STORIES */}
{/* ------------------------------------------------------ */}

<StoryHeading of={TextStories.Text}></StoryHeading>

<Canvas of={TextStories.Text} sourceState="shown" />

{/* ------------------------------------------------------ */}

<StoryHeading of={TextStories.NoWrap}></StoryHeading>

If the text is longer than the container with the property `no-wrap` the text will be cut.
Expand Down
9 changes: 9 additions & 0 deletions docs/stories/components/bal-text/bal-text.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ export default meta
const Story = StoryFactory<Args>(meta)

export const Basic = Story({
...withRender(
() => `
<p><b>Primary paragraph</b> use b or strong to make bold sections</p>
<p class="text-primary-light text-small"><b>Secondary paragraph</b> used for hints</p>
`,
),
})

export const Text = Story({
args: {
content:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
Expand Down

0 comments on commit dd44292

Please sign in to comment.