Skip to content

Commit c5034e8

Browse files
authored
Upgrade Shoelace for UI fixes (#1806)
Fixes #1802 <!-- Fixes #issue_number --> ### Changes - Upgrades Shoelace to 2.15.0 for UI fixes including #1802 (See https://github.com/shoelace-style/shoelace/blob/v2.15.0/docs/pages/resources/changelog.md) - Refactors custom components that extend Shoelace components so that shared shoelace `componentStyles` are included properly
1 parent 24b2021 commit c5034e8

File tree

5 files changed

+11
-18
lines changed

5 files changed

+11
-18
lines changed

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"@lit/task": "^1.0.0",
1111
"@novnc/novnc": "^1.4.0-beta",
1212
"@rollup/plugin-commonjs": "^18.0.0",
13-
"@shoelace-style/shoelace": "~2.13.0",
13+
"@shoelace-style/shoelace": "~2.15.0",
1414
"@tailwindcss/container-queries": "^0.1.1",
1515
"@types/color": "^3.0.2",
1616
"@types/diff": "^5.0.9",

frontend/src/components/ui/dialog.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import SlDialog from "@shoelace-style/shoelace/dist/components/dialog/dialog.js";
2-
import dialogStyles from "@shoelace-style/shoelace/dist/components/dialog/dialog.styles.js";
32
import { css } from "lit";
43
import {
54
customElement,
@@ -15,7 +14,7 @@ import {
1514
@customElement("btrix-dialog")
1615
export class Dialog extends SlDialog {
1716
static styles = [
18-
dialogStyles,
17+
SlDialog.styles,
1918
css`
2019
:host {
2120
--header-spacing: var(--sl-spacing-medium);
@@ -54,11 +53,7 @@ export class Dialog extends SlDialog {
5453
border-top: 1px solid var(--sl-color-neutral-100);
5554
}
5655
`,
57-
// TODO remove this type coercion once we migrate to
58-
// lit@3 (or more specifically, to when the version of lit we use uses the
59-
// same version of `@lit/reactive-element` as Shoelace -- at the time of
60-
// writing, that's `@lit/[email protected]`)
61-
] as typeof SlDialog.styles;
56+
];
6257

6358
@queryAssignedElements({ selector: "form", flatten: true })
6459
readonly formElems!: HTMLFormElement[];

frontend/src/components/ui/inline-input.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import SlInput from "@shoelace-style/shoelace/dist/components/input/input.js";
2-
import inputStyles from "@shoelace-style/shoelace/dist/components/input/input.styles.js";
32
import { css } from "lit";
43
import { customElement } from "lit/decorators.js";
54

@@ -9,7 +8,7 @@ import { customElement } from "lit/decorators.js";
98
@customElement("btrix-inline-input")
109
export class InlineInput extends SlInput {
1110
static styles = [
12-
inputStyles,
11+
SlInput.styles,
1312
css`
1413
:host {
1514
--sl-input-height-small: var(--sl-font-size-x-large);
@@ -21,5 +20,5 @@ export class InlineInput extends SlInput {
2120
padding: 0 0.5ch;
2221
}
2322
`,
24-
] as typeof SlInput.styles;
23+
];
2524
}

frontend/src/components/ui/tag.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import SLTag from "@shoelace-style/shoelace/dist/components/tag/tag.js";
2-
import tagStyles from "@shoelace-style/shoelace/dist/components/tag/tag.styles.js";
32
import { css, html } from "lit";
43
import { customElement, property } from "lit/decorators.js";
54
import { ifDefined } from "lit/directives/if-defined.js";
@@ -20,7 +19,7 @@ export class Tag extends SLTag {
2019
};
2120

2221
static styles = [
23-
tagStyles,
22+
SLTag.styles,
2423
css`
2524
:host {
2625
max-width: 100%;
@@ -91,7 +90,7 @@ export class Tag extends SLTag {
9190
padding: 0 0.125rem 0 0.5rem;
9291
}
9392
`,
94-
] as (typeof SLTag)["styles"];
93+
];
9594

9695
@property({ type: String, noAccessor: true })
9796
tabindex?: string;

frontend/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,10 +1135,10 @@
11351135
resolved "https://registry.yarnpkg.com/@shoelace-style/localize/-/localize-3.1.2.tgz#2c63f16d8aa80842dbe5127845c76ed53f6a5e8e"
11361136
integrity sha512-Hf45HeO+vdQblabpyZOTxJ4ZeZsmIUYXXPmoYrrR4OJ5OKxL+bhMz5mK8JXgl7HsoEowfz7+e248UGi861de9Q==
11371137

1138-
"@shoelace-style/shoelace@~2.13.0":
1139-
version "2.13.1"
1140-
resolved "https://registry.yarnpkg.com/@shoelace-style/shoelace/-/shoelace-2.13.1.tgz#bd3eb4d6076cdc6f307cdd10fff3775177174289"
1141-
integrity sha512-QMMvq7xgKzZR5+HEgZvv82V1yDKxucsW3XTbF+Tl5ckkzyXlKtKdY1k0eK9EnWPK482JXjoKeeiBJnrx+h6i4Q==
1138+
"@shoelace-style/shoelace@~2.15.0":
1139+
version "2.15.0"
1140+
resolved "https://registry.yarnpkg.com/@shoelace-style/shoelace/-/shoelace-2.15.0.tgz#3410d6bb50811fad001b2c2fbd455cb60d6341a9"
1141+
integrity sha512-Lcg938Y8U2VsHqIYewzlt+H1rbrXC4GRSUkTJgXyF8/0YAOlI+srd5OSfIw+/LYmwLP2Peyh398Kae/6tg4PDA==
11421142
dependencies:
11431143
"@ctrl/tinycolor" "^4.0.2"
11441144
"@floating-ui/dom" "^1.5.3"

0 commit comments

Comments
 (0)