Skip to content

Commit 5364806

Browse files
authored
docs(icons): improve icon preview (#356)
1 parent e3cf572 commit 5364806

File tree

10 files changed

+19
-24
lines changed

10 files changed

+19
-24
lines changed

.idea/jsonSchemas.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.vscode/settings.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"json.schemas": [
3-
{
3+
{
44
"fileMatch": [ "packages/web-components/src/**/doc/interactive-demo.config.json" ],
5-
"url": "https://raw.githubusercontent.com/Tap30/web-components/refs/heads/main/internals/doc-helpers/schema.json"
5+
"url": "https://raw.githubusercontent.com/Tap30/web-components/refs/heads/main/internals/interactive-demo.schema.json"
66
}
77
]
88
}
9-

docs/components/[component].paths.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
import fs from "node:fs";
22
import path from "node:path";
3-
import {
4-
type Component,
5-
type Metadata,
6-
} from "../../internals/doc-helpers/types.ts";
73
import { getFileMeta } from "../../scripts/utils.ts";
4+
import { type Component, type Metadata } from "../../types/docs.ts";
85
import {
96
codify,
107
getFormattedImportUsageString,

docs/icons.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
prev: false
33
next: false
4-
outline: false
4+
outline: "deep"
55
---
66

77
<style>
@@ -55,6 +55,11 @@ outline: false
5555
padding: 6px;
5656
}
5757

58+
.icon-item:focus-visible {
59+
outline: 2px solid var(--vp-c-brand-1);
60+
outline-offset: 2px;
61+
}
62+
5863
.icon-item svg {
5964
color: currentcolor;
6065
fill: currentcolor;

docs/internals/components/DocIconGrid.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ export class DocIconGrid extends LitElement {
9393
this._showModal = true;
9494
this._selectedIcon = icon;
9595
scrollLock.disableBodyScroll(this._iconModal);
96-
this._focusTrapper?.activate();
96+
97+
void this.updateComplete.then(() => {
98+
this._focusTrapper?.activate();
99+
});
97100
};
98101

99102
private _getSvg(iconPaths?: SVGPathInfo[]) {
@@ -142,7 +145,7 @@ export class DocIconGrid extends LitElement {
142145
aria-hidden="true"
143146
class=${classMap({
144147
"modal-overlay": true,
145-
open: !!this._showModal,
148+
open: this._showModal,
146149
})}
147150
@click=${this._closeModal}
148151
></div>
@@ -154,9 +157,10 @@ export class DocIconGrid extends LitElement {
154157
aria-modal="true"
155158
class=${classMap({
156159
modal: true,
157-
open: !!this._selectedIcon,
160+
open: this._showModal,
158161
})}
159162
@click=${(e: Event) => e.stopPropagation()}
163+
?inert=${!this._showModal}
160164
>
161165
<header
162166
style="display:flex; justify-content:space-between; align-items: center;"

docs/sidebar.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import fs from "fs";
22
import path from "node:path";
33
import { type DefaultTheme } from "vitepress";
4-
import { type Metadata } from "../internals/doc-helpers/types.ts";
54
import { getFileMeta } from "../scripts/utils.ts";
5+
import { type Metadata } from "../types/docs.ts";
66

77
const { dirname } = getFileMeta(import.meta.url);
88

File renamed without changes.

pnpm-lock.yaml

-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/generate-docs-metadata.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ import {
77
import * as fs from "node:fs";
88
import * as path from "node:path";
99
import { type DefaultTheme } from "vitepress";
10-
import {
11-
type Component,
12-
type ImportPaths,
13-
} from "../internals/doc-helpers/types.ts";
10+
import type { Component, ImportPaths } from "../types/docs.ts";
1411
import { getFileMeta } from "./utils.ts";
1512

1613
const { dirname } = getFileMeta(import.meta.url);
File renamed without changes.

0 commit comments

Comments
 (0)