Skip to content

Commit 8e996dc

Browse files
committed
chore: format files with Prettier 3
1 parent 1dcd09b commit 8e996dc

File tree

391 files changed

+3725
-3785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

391 files changed

+3725
-3785
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ import "carbon-components-svelte/css/all.css";
105105
Update the theme by setting the `theme` attribute on the `html` element. The default `theme` is `"white"`.
106106

107107
```html
108-
<!DOCTYPE html>
108+
<!doctype html>
109109
<html lang="en" theme="g10">
110110
<body>
111111
...

Diff for: docs/src/App.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
import { routes } from "../.routify/routes";
44
</script>
55

6-
<Router routes="{routes}" />
6+
<Router {routes} />

Diff for: docs/src/components/ComponentApi.svelte

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@
3232
3333
$: source = `https://github.com/carbon-design-system/carbon-components-svelte/tree/master/${component.filePath}`;
3434
$: forwarded_events = component.events.filter(
35-
(event) => event.type === "forwarded"
35+
(event) => event.type === "forwarded",
3636
);
3737
$: dispatched_events = component.events.filter(
38-
(event) => event.type === "dispatched"
38+
(event) => event.type === "dispatched",
3939
);
4040
</script>
4141

4242
<p style="margin-bottom: var(--cds-layout-02)">
4343
Source code:
44-
<OutboundLink size="lg" inline href="{source}">
44+
<OutboundLink size="lg" inline href={source}>
4545
{component.filePath}
4646
</OutboundLink>
4747
</p>
@@ -65,7 +65,7 @@
6565
}) as prop (prop.name)}
6666
<StructuredListRow>
6767
<StructuredListCell noWrap>
68-
<InlineSnippet code="{prop.name}" />
68+
<InlineSnippet code={prop.name} />
6969
{#if prop.reactive}
7070
<div
7171
style="white-space: nowrap; margin-top: var(--cds-spacing-03); margin-bottom: var(--cds-spacing-{prop.isRequired
@@ -99,7 +99,7 @@
9999
{:else if type.startsWith("(")}
100100
<code class="code-01">{type}</code>
101101
{:else}
102-
<InlineSnippet code="{type}" />
102+
<InlineSnippet code={type} />
103103
{/if}
104104
</div>
105105
{/each}

Diff for: docs/src/components/InlineSnippet.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</script>
77

88
<div>
9-
<CodeSnippet code="{code}" type="inline" copy="{(text) => copy(text)}" />
9+
<CodeSnippet {code} type="inline" copy={(text) => copy(text)} />
1010
</div>
1111

1212
<style>

Diff for: docs/src/components/Preview.svelte

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,22 @@
2626
kind="ghost"
2727
target="_blank"
2828
size="field"
29-
href="{themedSrcUrl}"
30-
icon="{Launch}"
29+
href={themedSrcUrl}
30+
icon={Launch}
3131
>
3232
Open in new tab
3333
</Button>
3434
</div>
3535
{/if}
3636
<div class="preview-viewer" class:framed>
3737
{#if framed}
38-
<iframe title="{src.split('/').pop()}" src="{themedSrcUrl}"></iframe>
38+
<iframe title={src.split("/").pop()} src={themedSrcUrl}></iframe>
3939
{:else}
4040
<slot />
4141
{/if}
4242
</div>
4343
<div class="code-override">
44-
<CodeSnippet type="multi" code="{codeRaw}" copy="{(text) => copy(text)}">
44+
<CodeSnippet type="multi" code={codeRaw} copy={(text) => copy(text)}>
4545
{@html code}
4646
</CodeSnippet>
4747
</div>

Diff for: docs/src/components/TileCard.svelte

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<div class="card-wrapper" class:borderRight class:borderBottom>
1616
<AspectRatio>
1717
<svelte:component
18-
this="{tileComponent}"
19-
href="{href}"
18+
this={tileComponent}
19+
{href}
2020
{...$$restProps}
2121
style="height: 100%;"
2222
>
@@ -29,11 +29,11 @@
2929
</div>
3030
<div class="card-footer">
3131
<svelte:component
32-
this="{LogoGithub}"
33-
size="{32}"
32+
this={LogoGithub}
33+
size={32}
3434
style="fill: var(--cds-icon-01)"
3535
/>
36-
<Launch size="{20}" style="fill: var(--cds-icon-01)" />
36+
<Launch size={20} style="fill: var(--cds-icon-01)" />
3737
</div>
3838
</div>
3939
</svelte:component>

Diff for: docs/src/layouts/ComponentLayout.svelte

+10-10
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
3030
// TODO: `find` is not supported in IE
3131
$: api_components = components.map((i) =>
32-
COMPONENT_API.components.find((_) => _.moduleName === i)
32+
COMPONENT_API.components.find((_) => _.moduleName === i),
3333
);
3434
$: multiple = api_components.length > 1;
3535
@@ -62,7 +62,7 @@
6262
6363
// TODO: [refactor] read from package.json value
6464
$: sourceCode = `https://github.com/carbon-design-system/carbon-components-svelte/tree/master/${formatSourceURL(
65-
multiple
65+
multiple,
6666
)}`;
6767
</script>
6868
@@ -83,7 +83,7 @@
8383
id="select-theme"
8484
inline
8585
labelText="Theme"
86-
bind:selected="{$theme}"
86+
bind:selected={$theme}
8787
>
8888
<SelectItem value="white" text="White" />
8989
<SelectItem value="g10" text="Gray 10" />
@@ -95,8 +95,8 @@
9595
kind="ghost"
9696
target="_blank"
9797
size="field"
98-
href="{sourceCode}"
99-
icon="{Code}"
98+
href={sourceCode}
99+
icon={Code}
100100
>
101101
Source code
102102
</Button>
@@ -144,28 +144,28 @@
144144
</Row>
145145
146146
<Row>
147-
<Column class="prose" noGutter="{multiple}">
147+
<Column class="prose" noGutter={multiple}>
148148
{#if multiple}
149149
<Tabs class="override-tabs">
150150
{#each api_components as component (component.moduleName)}
151-
<Tab label="{component.moduleName}" />
151+
<Tab label={component.moduleName} />
152152
{/each}
153153
<div slot="content" style="padding-top: var(--cds-spacing-06)">
154154
{#each api_components as component (component.moduleName)}
155155
<TabContent>
156-
<ComponentApi component="{component}" />
156+
<ComponentApi {component} />
157157
</TabContent>
158158
{/each}
159159
</div>
160160
</Tabs>
161161
{:else}
162-
<ComponentApi component="{api_components[0]}" />
162+
<ComponentApi component={api_components[0]} />
163163
{/if}
164164
</Column>
165165
</Row>
166166
</Grid>
167167
168-
<Column class="table" xlg="{4}" lg="{5}">
168+
<Column class="table" xlg={4} lg={5}>
169169
<div class="toc">
170170
<h5>Examples</h5>
171171
<slot name="aside" />

Diff for: docs/src/pages/_fallback.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<h1>404</h1>
1313
<div>
1414
Page not found.
15-
<Link href="{$url('/')}">Return home</Link>
15+
<Link href={$url("/")}>Return home</Link>
1616
</div>
1717
</Column>
1818
</Row>

Diff for: docs/src/pages/_layout.svelte

+23-22
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
5353
$: isMobile = innerWidth < 1056;
5454
$: components = $layout.children.filter(
55-
(child) => child.title === "components"
55+
(child) => child.title === "components",
5656
)[0];
5757
5858
$beforeUrlChange(() => {
@@ -65,7 +65,7 @@
6565
<svelte:window bind:innerWidth />
6666

6767
<svelte:body
68-
on:keydown="{(e) => {
68+
on:keydown={(e) => {
6969
if (active) return;
7070
if (
7171
document.activeElement instanceof HTMLInputElement ||
@@ -76,14 +76,15 @@
7676
}
7777

7878
const isCommandOrControl = e.metaKey || e.ctrlKey;
79-
const isCmdK = isCommandOrControl && e.key.toLowerCase() === 'k';
80-
const isSlash = e.key === '/';
79+
const isCmdK = isCommandOrControl && e.key.toLowerCase() === "k";
80+
const isSlash = e.key === "/";
8181

8282
if (isCmdK || isSlash) {
8383
e.preventDefault();
8484
active = true;
8585
}
86-
}}" />
86+
}}
87+
/>
8788

8889
<svelte:head>
8990
<!-- Tealium/GA Set up -->
@@ -123,26 +124,26 @@
123124

124125
<Theme
125126
persist
126-
bind:theme="{$theme}"
127-
on:update="{(e) => {
127+
bind:theme={$theme}
128+
on:update={(e) => {
128129
const theme = e.detail.theme;
129130
document.documentElement.style.setProperty(
130-
'color-scheme',
131-
['white', 'g10'].includes(theme) ? 'light' : 'dark'
131+
"color-scheme",
132+
["white", "g10"].includes(theme) ? "light" : "dark",
132133
);
133-
}}"
134+
}}
134135
>
135136
<Header
136137
aria-label="Navigation"
137-
href="{$url('/')}"
138-
expandedByDefault="{true}"
138+
href={$url("/")}
139+
expandedByDefault={true}
139140
bind:isSideNavOpen
140141
>
141142
<svelte:fragment slot="skip-to-content">
142143
<SkipToContent />
143144
</svelte:fragment>
144145

145-
<span slot="platform" class="platform-name" class:hidden="{active}">
146+
<span slot="platform" class="platform-name" class:hidden={active}>
146147
Carbon Components Svelte &nbsp;<code class="code-01"
147148
>v{process.env.VERSION || ""}</code
148149
>
@@ -152,17 +153,17 @@
152153
bind:value
153154
bind:active
154155
placeholder="Search"
155-
results="{results}"
156-
on:select="{(e) => {
156+
{results}
157+
on:select={(e) => {
157158
$goto(e.detail.selectedResult.href);
158-
}}"
159+
}}
159160
/>
160161
<HeaderActionLink
161-
icon="{LogoGithub}"
162+
icon={LogoGithub}
162163
href="https://github.com/carbon-design-system/carbon-components-svelte"
163164
target="_blank"
164165
/>
165-
<HeaderAction transition="{false}" bind:isOpen>
166+
<HeaderAction transition={false} bind:isOpen>
166167
<HeaderPanelLinks>
167168
<HeaderPanelDivider>Carbon Svelte portfolio</HeaderPanelDivider>
168169
<HeaderPanelLink
@@ -197,13 +198,13 @@
197198
</HeaderUtilities>
198199
</Header>
199200

200-
<SideNav bind:isOpen="{isSideNavOpen}">
201+
<SideNav bind:isOpen={isSideNavOpen}>
201202
<SideNavItems>
202203
{#each components.children.filter((child) => !deprecated.includes(child.title)) as child (child.path)}
203204
<SideNavMenuItem
204-
text="{child.title}"
205-
href="{$url(child.path)}"
206-
isSelected="{$isActive($url(child.path))}"
205+
text={child.title}
206+
href={$url(child.path)}
207+
isSelected={$isActive($url(child.path))}
207208
>
208209
{child.title}
209210
{#if deprecated.includes(child.title)}

Diff for: docs/src/pages/framed/Accordion/ExpandableAccordion.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
let open = false;
2323
</script>
2424

25-
<Button kind="ghost" size="field" on:click="{() => (open = !open)}">
25+
<Button kind="ghost" size="field" on:click={() => (open = !open)}>
2626
{open ? "Collapse" : "Expand"}
2727
all
2828
</Button>
2929

3030
<Accordion>
3131
{#each items as item}
32-
<AccordionItem title="{item.title}" open="{open}">
32+
<AccordionItem title={item.title} {open}>
3333
<p>{item.description}</p>
3434
</AccordionItem>
3535
{/each}

Diff for: docs/src/pages/framed/Breadcrumbs/Breadcrumbs.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<Breadcrumb>
1212
{#each items as item, i}
13-
<BreadcrumbItem href="{item.href}" isCurrentPage="{i === items.length - 1}">
13+
<BreadcrumbItem href={item.href} isCurrentPage={i === items.length - 1}>
1414
{item.text}
1515
</BreadcrumbItem>
1616
{/each}

Diff for: docs/src/pages/framed/Breakpoint/Breakpoint.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
let events = [];
66
</script>
77

8-
<Breakpoint bind:size on:change="{(e) => (events = [...events, e.detail])}" />
8+
<Breakpoint bind:size on:change={(e) => (events = [...events, e.detail])} />
99

1010
<p>Resize the width of your browser.</p>
1111
<h6>Breakpoint size</h6>

Diff for: docs/src/pages/framed/Button/ProgrammaticFocus.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<Button bind:ref>Primary button</Button>
88
<Button
99
kind="ghost"
10-
on:click="{() => {
10+
on:click={() => {
1111
ref?.focus();
12-
}}"
12+
}}
1313
>
1414
Click to focus the Primary button
1515
</Button>

Diff for: docs/src/pages/framed/Button/SelectedIconOnlyButton.svelte

+9-9
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@
88
</script>
99

1010
<Button
11-
isSelected="{index === 0}"
11+
isSelected={index === 0}
1212
kind="ghost"
1313
iconDescription="Bold"
14-
icon="{TextBold}"
15-
on:click="{() => (index = 0)}"
14+
icon={TextBold}
15+
on:click={() => (index = 0)}
1616
/>
1717
<Button
18-
isSelected="{index === 1}"
18+
isSelected={index === 1}
1919
kind="ghost"
2020
iconDescription="Italicize"
21-
icon="{TextItalic}"
22-
on:click="{() => (index = 1)}"
21+
icon={TextItalic}
22+
on:click={() => (index = 1)}
2323
/>
2424
<Button
25-
isSelected="{index === 2}"
25+
isSelected={index === 2}
2626
kind="ghost"
2727
iconDescription="Underline"
28-
icon="{TextUnderline}"
29-
on:click="{() => (index = 2)}"
28+
icon={TextUnderline}
29+
on:click={() => (index = 2)}
3030
/>

Diff for: docs/src/pages/framed/Checkbox/CheckboxReactive.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Checkbox labelText="Label text" bind:checked />
88

99
<div style="margin: var(--cds-layout-01) 0">
10-
<Button on:click="{() => (checked = !checked)}">Toggle</Button>
10+
<Button on:click={() => (checked = !checked)}>Toggle</Button>
1111
</div>
1212

1313
<strong>checked:</strong>

0 commit comments

Comments
 (0)