diff --git a/src/components/loading-indicator/loading-indicator.scss b/src/components/loading-indicator/loading-indicator.scss index 81e380356e..79f319f6f0 100644 --- a/src/components/loading-indicator/loading-indicator.scss +++ b/src/components/loading-indicator/loading-indicator.scss @@ -108,14 +108,13 @@ ); } -:host([variant='window'][size='small']) { +:host([variant='window'][size='s']) { --sbb-loading-indicator-window-height: #{sbb.px-to-rem-build(26.66666)}; --sbb-loading-indicator-window-padding-block-start: #{sbb.px-to-rem-build(10.66666)}; --sbb-loading-indicator-window-element-width: #{sbb.px-to-rem-build(55.46666)}; --sbb-loading-indicator-window-element-height: #{sbb.px-to-rem-build(5.33333)}; --sbb-loading-indicator-window-element-perspective: #{sbb.px-to-rem-build(96)}; - --sbb-loading-indicator-window-element-animation: loading-container-small - var(--sbb-loading-indicator-duration) linear infinite; + --sbb-loading-indicator-window-element-animation-name: loading-container-small; --sbb-loading-indicator-window-last-span-width: #{sbb.px-to-rem-build(8.53333)}; --sbb-loading-indicator-window-last-span-height: #{sbb.px-to-rem-build(5.33333)}; --sbb-loading-indicator-window-last-span-margin: #{sbb.px-to-rem-build(3.2)}; @@ -126,14 +125,13 @@ ); } -:host([variant='window'][size='large']) { +:host([variant='window'][size='l']) { --sbb-loading-indicator-window-height: #{sbb.px-to-rem-build(48)}; --sbb-loading-indicator-window-padding-block-start: #{sbb.px-to-rem-build(19.2)}; --sbb-loading-indicator-window-element-width: #{sbb.px-to-rem-build(92.7969)}; --sbb-loading-indicator-window-element-height: #{sbb.px-to-rem-build(9.59375)}; --sbb-loading-indicator-window-element-perspective: #{sbb.px-to-rem-build(128)}; - --sbb-loading-indicator-window-element-animation: loading-container-large - var(--sbb-loading-indicator-duration) linear infinite; + --sbb-loading-indicator-window-element-animation-name: loading-container-large; --sbb-loading-indicator-window-last-span-width: #{sbb.px-to-rem-build(16)}; --sbb-loading-indicator-window-last-span-height: #{sbb.px-to-rem-build(9.59375)}; --sbb-loading-indicator-window-last-span-margin: #{sbb.px-to-rem-build(3.2)}; @@ -170,7 +168,10 @@ :host([variant='window']) .sbb-loading-indicator__animated-element > span > span { position: relative; display: flex; - animation: var(--sbb-loading-indicator-window-element-animation); + animation-name: var(--sbb-loading-indicator-window-element-animation-name); + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-duration: var(--sbb-loading-indicator-duration); } :host([variant='window']) .sbb-loading-indicator__animated-element > span > span > span { diff --git a/src/components/loading-indicator/loading-indicator.stories.ts b/src/components/loading-indicator/loading-indicator.stories.ts index 7da95c660c..19516f57bf 100644 --- a/src/components/loading-indicator/loading-indicator.stories.ts +++ b/src/components/loading-indicator/loading-indicator.stories.ts @@ -1,31 +1,17 @@ -import type { InputType } from '@storybook/types'; +import type { InputType, StoryContext } from '@storybook/types'; import type { Meta, StoryObj, ArgTypes, Args } from '@storybook/web-components'; import type { TemplateResult } from 'lit'; import { html } from 'lit'; -import { styleMap } from 'lit/directives/style-map.js'; import { sbbSpread } from '../../storybook/helpers/spread.js'; import type { SbbLoadingIndicatorElement } from './loading-indicator.js'; import readme from './readme.md?raw'; -import '../button/button.js'; + import './loading-indicator.js'; +import '../button/button.js'; import '../title.js'; - -const textBlockStyle: Args = { - marginBlock: '1rem', - padding: '1rem', - backgroundColor: 'var(--sbb-color-milk)', - border: 'var(--sbb-border-width-1x) solid var(--sbb-color-cloud)', - borderRadius: 'var(--sbb-border-radius-4x)', -}; - -const negativeBlockStyle: Args = { - backgroundColor: 'var(--sbb-color-iron)', - color: 'var(--sbb-color-white)', - padding: '2rem', - '--sbb-title-text-color-normal-override': 'var(--sbb-color-white)', -}; +import '../card.js'; const createLoadingIndicator = (event: Event, args: Args): void => { const loader: SbbLoadingIndicatorElement = document.createElement('sbb-loading-indicator'); @@ -38,16 +24,17 @@ const createLoadingIndicator = (event: Event, args: Args): void => { container.append(loader); setTimeout(() => { const p = document.createElement('p'); - p.textContent = "Loading complete. Here's your data: . . . "; + p.textContent = "Loading complete. Here's your data: ..."; container.append(p); loader.remove(); }, 5000); }; const TemplateAccessibility = (args: Args): TemplateResult => html` -
-
-