Skip to content

Commit

Permalink
WIP: Prepare for carbon-components-svelte v1
Browse files Browse the repository at this point in the history
  • Loading branch information
n-peugnet committed Aug 12, 2024
1 parent e795a3c commit 4e4c96e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion public/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ div.file-table-cell {
white-space: nowrap;
}

div.file-table-cell *:not(span) {
div.file-table-cell * {
text-overflow: ellipsis;
overflow: clip;
}
Expand Down
3 changes: 2 additions & 1 deletion src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
WebDAV-Drive. If not, see <https://www.gnu.org/licenses/>.
-->
<script lang="ts">
import "carbon-components-svelte/css/all.css";
import { getLocaleFromNavigator, locale, locales, _ } from "svelte-i18n";
import { labels } from "./locales";
import type { FileSystem, Quota } from "./model/FileSystem";
Expand Down Expand Up @@ -65,7 +66,7 @@
let quota: Quota | null;
$: dark = isDark(theme);
$: document.documentElement.setAttribute("theme", dark ? "g100" : "g10");
$: document.documentElement.setAttribute("data-carbon-theme", dark ? "g100" : "g10");
$: document.title = path;
$: window.location.href = `#${encodeURI(path)}`;
$: isSmallScreen.set(width <= 610);
Expand Down
1 change: 0 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
WebDAV-Drive. If not, see <https://www.gnu.org/licenses/>.
*/

import "carbon-components-svelte/css/all.css";
import type { Config } from "./main/Config";
import { Core, type Module } from "./main/Core";

Expand Down
2 changes: 2 additions & 0 deletions src/model/FileUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type Header<T> = {
type EmptyHeader = {
key: string,
empty: boolean,
columnMenu: boolean,
}

type Row = {
Expand Down Expand Up @@ -77,6 +78,7 @@ export function files2table(files: Inode[]): FileTable {
{
key: "menu",
empty: true,
columnMenu: true,
},
],
rows: files
Expand Down
6 changes: 3 additions & 3 deletions src/view/FileList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@
} from "carbon-components-svelte";
import { Add, TrashCan, Copy, Cut, Paste } from "carbon-icons-svelte";
type Size = "short" | "medium";
type Size = "sm" | "md";
export let fs: FileSystem;
export let onFileClick: (f: Inode) => unknown;
export let path = "/";
const isTactile = window.matchMedia("(pointer: coarse)").matches;
const size: Size = isTactile ? "medium" : "short";
const size: Size = isTactile ? "md" : "sm";
let files: Inode[] = [];
let error: Error | null = null;
let checked: Inode[] = [];
Expand Down Expand Up @@ -207,7 +207,7 @@
<Button
on:click={() => (deleteSelectedModal = true)}
icon={TrashCan}
kind="danger-ghost"
kind="danger--ghost"

Check failure on line 210 in src/view/FileList.svelte

View workflow job for this annotation

GitHub Actions / check

Type '\"danger--ghost\"' is not assignable to type '\"danger\" | \"primary\" | \"secondary\" | \"tertiary\" | \"ghost\" | \"danger-tertiary\" | \"danger-ghost\" | undefined'. Did you mean '\"danger-ghost\"'?
>
{$_("Delete")}
</Button>
Expand Down
1 change: 1 addition & 0 deletions src/view/FileListCell.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

{#if cell.key === "menu"}
<OverflowMenu
size="sm"
flipped
iconDescription={$_("Menu")}
on:click={onClickMenu}
Expand Down

0 comments on commit 4e4c96e

Please sign in to comment.