Skip to content

Commit

Permalink
fix: lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioCastigliano committed Nov 19, 2024
1 parent 247ce33 commit 9008446
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
7 changes: 3 additions & 4 deletions src/elements/button/common/common-stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { html, unsafeStatic } from 'lit/static-html.js';
import { sbbSpread } from '../../../storybook/helpers/spread.js';

import '../../icon.js';
import '../../loading-indicator.js';
import '../../loading-indicator-circle.js';

/* eslint-disable lit/binding-positions, @typescript-eslint/naming-convention */
const Template = ({ tag, text, ...args }: Args): TemplateResult => html`
Expand All @@ -38,10 +38,9 @@ const IconSlotTemplate = ({

const LoadingIndicatorTemplate = ({ tag, text, ...args }: Args): TemplateResult => html`
<${unsafeStatic(tag)} ${sbbSpread(args)}>
<sbb-loading-indicator
<sbb-loading-indicator-circle
slot="icon"
variant="circle"
></sbb-loading-indicator>
></sbb-loading-indicator-circle>
${text}
</${unsafeStatic(tag)}>
`;
Expand Down
1 change: 1 addition & 0 deletions src/elements/loading-indicator-circle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './loading-indicator-circle/loading-indicator-circle.js';
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ import '../button/button.js';
import '../title.js';
import '../card.js';

const createLoadingIndicator = (event: Event, args: Args): void => {
const createLoadingIndicator = (event: Event): void => {
const loader: SbbLoadingIndicatorCircleElement = document.createElement(
'sbb-loading-indicator-circle',
);
const container = (event.currentTarget as HTMLElement).parentElement!.querySelector(
'.loader-container',
)!;
loader.setAttribute('aria-label', 'Loading, please wait');
loader.size = args['size'];
container.append(loader);
setTimeout(() => {
const p = document.createElement('p');
Expand All @@ -31,14 +30,12 @@ const createLoadingIndicator = (event: Event, args: Args): void => {
}, 5000);
};

const TemplateAccessibility = (args: Args): TemplateResult => html`
const TemplateAccessibility = (): TemplateResult => html`
<sbb-card color="milk">
Turn on your screen-reader and click the button to make the loading indicator appear.
</sbb-card>
<br />
<sbb-button @click=${(event: Event) => createLoadingIndicator(event, args)}>
Show loader
</sbb-button>
<sbb-button @click=${(event: Event) => createLoadingIndicator(event)}> Show loader </sbb-button>
<div class="loader-container" aria-live="polite"></div>
`;

Expand Down

0 comments on commit 9008446

Please sign in to comment.