Skip to content

Commit 1940655

Browse files
committed
feat(): Bump ui components
Update svelte material to the latest version
1 parent a16fb13 commit 1940655

File tree

9 files changed

+835
-2610
lines changed

9 files changed

+835
-2610
lines changed

package-lock.json

Lines changed: 783 additions & 2565 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@
1212
"@rollup/plugin-json": "4.1.0",
1313
"@rollup/plugin-node-resolve": "10.0.0",
1414
"@rollup/plugin-typescript": "6.1.0",
15+
"@smui/button": "4.2.0",
16+
"@smui/card": "4.2.0",
17+
"@smui/chips": "4.2.0",
18+
"@smui/dialog": "4.2.0",
19+
"@smui/form-field": "4.2.0",
20+
"@smui/icon-button": "4.2.0",
21+
"@smui/paper": "4.2.0",
22+
"@smui/switch": "4.2.0",
23+
"@smui/tab": "4.2.0",
24+
"@smui/tab-bar": "4.2.0",
1525
"@tsconfig/svelte": "2.0.1",
1626
"@typescript-eslint/eslint-plugin": "4.29.2",
1727
"@typescript-eslint/parser": "4.29.2",
@@ -28,18 +38,19 @@
2838
"metascraper-publisher": "5.24.2",
2939
"metascraper-title": "5.24.2",
3040
"metascraper-url": "5.24.2",
41+
"postcss": "8.3.6",
3142
"prettier": "2.3.2",
3243
"prettier-plugin-svelte": "2.3.1",
3344
"rollup": "2.33.1",
3445
"rollup-plugin-livereload": "2.0.0",
35-
"rollup-plugin-postcss": "3.1.8",
46+
"rollup-plugin-postcss": "4.0.1",
3647
"rollup-plugin-svelte": "6.1.0",
3748
"rollup-plugin-terser": "7.0.2",
3849
"sass": "1.38.0",
3950
"simple-git-hooks": "2.6.1",
51+
"smui-theme": "4.2.0",
4052
"svelte": "3.42.2",
4153
"svelte-check": "2.2.4",
42-
"svelte-material-ui": "1.0.0",
4354
"svelte-preprocess": "4.7.4",
4455
"svelte-spa-router": "3.2.0",
4556
"tslib": "2.3.1",

src/components/App.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
2-
import Tab, { Icon, Label } from '@smui/tab';
3-
import TabBar from '@smui/tab-bar';
2+
import Tab, { Icon, Label } from '@smui/tab/styled';
3+
import TabBar from '@smui/tab-bar/styled';
44
import type { MetaInfo } from '../../common';
55
import { push } from 'svelte-spa-router';
66
import { wrap } from 'svelte-spa-router/wrap';

src/components/ContactItem.svelte

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
ActionIcons,
55
Actions as CardActions,
66
Content as CardContent
7-
} from '@smui/card';
8-
import IconButton from '@smui/icon-button';
9-
import Dialog, { Actions as DialogActions, Content as DialogContent, Title } from '@smui/dialog';
10-
import Button, { Label } from '@smui/button';
7+
} from '@smui/card/styled';
8+
import IconButton from '@smui/icon-button/styled';
9+
import Dialog, { Actions, Content, Title } from '@smui/dialog/styled';
10+
import Button, { Label } from '@smui/button/styled';
1111
import { ContactType } from '../data/contact';
1212
import { copyToClipboard } from '../helpers/clipboard';
1313
import { getEmailLink, getGMapsLink } from '../helpers/links';
@@ -22,7 +22,7 @@
2222
export let link = '';
2323
export let type: ContactType = ContactType.Url;
2424
25-
let dialog;
25+
let open = false;
2626
let copyError: Error | null = null;
2727
2828
const openLink = (contactType: ContactType, title: string, url: string): void => {
@@ -37,25 +37,25 @@
3737
};
3838
3939
const copyLink = (url: string): void => {
40-
if (!url || !dialog) {
40+
if (!url) {
4141
return;
4242
}
4343
4444
copyToClipboard(url)
4545
.then(() => {
4646
copyError = null;
47-
dialog.open();
47+
open = true;
4848
})
4949
.catch(err => {
5050
log.error('Unable to copy to clipboard', err);
5151
copyError = err;
52-
dialog.open();
52+
open = true;
5353
});
5454
};
5555
5656
const closeDialog = () => {
5757
copyError = null;
58-
dialog.close();
58+
open = false;
5959
};
6060
</script>
6161

@@ -92,9 +92,9 @@
9292
</CardActions>
9393
</Card>
9494

95-
<Dialog bind:this="{dialog}" aria-labelledby="dialog-title" aria-describedby="dialog-content">
95+
<Dialog bind:open aria-labelledby="dialog-title" aria-describedby="dialog-content">
9696
<Title id="dialog-title">Copied to the clipboard</Title>
97-
<DialogContent id="dialog-content">
97+
<Content id="dialog-content">
9898
{#if copyError}
9999
Ugh! Unable to copy the link...
100100
{:else if type === ContactType.Email}
@@ -106,12 +106,12 @@
106106
<b>{link || title}</b>
107107
has been copied to the clipboard
108108
{:else}The link <b>{link || title}</b> has been copied to the clipboard{/if}
109-
</DialogContent>
110-
<DialogActions>
109+
</Content>
110+
<Actions>
111111
<Button on:click="{() => closeDialog()}">
112112
<Label>OK</Label>
113113
</Button>
114-
</DialogActions>
114+
</Actions>
115115
</Dialog>
116116
</div>
117117
</div>

src/components/LinkItem.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import Paper, { Title, Content } from '@smui/paper';
2+
import Paper, { Title, Content } from '@smui/paper/styled';
33
import Link from './Link.svelte';
44
import type { LinkInfo } from '../../common';
55
import { onMount, onDestroy } from 'svelte';

src/components/Tags.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
22
import type { TagModel } from '../data/tags';
3-
import Chip, { Set, Text } from '@smui/chips';
3+
import Chip, { Set, Text } from '@smui/chips/styled';
44
55
export let items: TagModel[] = [];
66
@@ -12,7 +12,7 @@
1212
</script>
1313

1414
<Set chips="{items}" let:chip>
15-
<Chip shouldRemoveOnTrailingIconClick="{false}" on:click="{() => onClick(chip)}">
15+
<Chip chip="{chip}" shouldRemoveOnTrailingIconClick="{false}" on:click="{() => onClick(chip)}">
1616
{#if chip.icon}<i class="{chip.icon}"></i>{/if}
1717
<Text>{chip.title}</Text>
1818
</Chip>

src/index.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
@import '~@material/typography/mdc-typography';
2-
@import '~@material/theme/color-palette';
1+
@use '@material/typography/mdc-typography';
2+
@use '@material/theme/color-palette';
33
@import './global.scss';
44

55
html {
66
body {
77
margin: 0;
88
}
99

10-
color: $material-color-grey-900;
10+
color: color-palette.$grey-900;
1111

1212
a {
13-
color: $material-color-grey-900;
13+
color: color-palette.$grey-900;
1414
cursor: pointer;
1515
text-decoration: none;
1616
}
@@ -20,7 +20,7 @@ html {
2020
}
2121

2222
.greyed {
23-
color: $material-color-blue-grey-300;
23+
color: color-palette.$blue-grey-300;
2424
}
2525

2626
// Responsive things ----

src/routes/Articles.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import type { LinkInfo } from '../../common';
3-
import Switch from '@smui/switch';
4-
import FormField from '@smui/form-field';
3+
import Switch from '@smui/switch/styled';
4+
import FormField from '@smui/form-field/styled';
55
import LinkItem from '../components/LinkItem.svelte';
66
import { RoutePath } from '.';
77
import { getSortedList } from '../helpers/sort';

src/theme/_smui-theme.scss

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
// Nothing here. Just use the default theme.
2+
@use '@material/theme/color-palette';
23

3-
.app-page {
4-
@import '~@material/theme/color-palette';
4+
$background: #fff;
55

6-
//min-height: 100%;
7-
//min-width: 100%;
8-
//background-color: #000;
9-
//color: #fff;
6+
@use '@material/theme/index' as theme with (
7+
$primary: color-palette.$deep-purple-400,
8+
$secondary: color-palette.$deep-orange-500,
9+
$surface: color-palette.$blue-grey-50,
10+
$background: $background,
11+
$error: color-palette.$red-a400,
12+
);
1013

11-
$mdc-theme-primary: $material-color-deep-purple-400;
12-
$mdc-theme-secondary: $material-color-deep-orange-500;
13-
//$mdc-theme-background: #000;
14-
$mdc-theme-surface: $material-color-blue-grey-50;
15-
$mdc-theme-error: $material-color-orange-100;
16-
17-
@import '~@material/theme/variables';
18-
19-
@each $style in map-keys($mdc-theme-property-values) {
20-
--mdc-theme-#{$style}: #{map-get($mdc-theme-property-values, $style)};
21-
}
14+
html,
15+
body {
16+
background-color: $background;
17+
color: if(theme.contrast-tone($background) == 'dark', #000, #fff);
2218
}

0 commit comments

Comments
 (0)