@haxtheweb/fluent-theme 0.0.0-stage → 26.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dddignore +36 -0
- package/.editorconfig +29 -0
- package/.github/workflows/main.yml +33 -0
- package/.nojekyll +0 -0
- package/.surgeignore +1 -0
- package/.travis.yml +15 -0
- package/LICENSE +201 -0
- package/NOTICE +44 -0
- package/README.md +47 -2
- package/custom-elements.json +310 -0
- package/demo/files/thumb-button.svg +1 -0
- package/demo/files/thumb-checks.svg +1 -0
- package/demo/files/thumb-code.svg +1 -0
- package/demo/files/thumb-color.svg +1 -0
- package/demo/files/thumb-shapes.svg +1 -0
- package/demo/files/thumb-type.svg +1 -0
- package/demo/index.html +49 -0
- package/demo/pages/item-f1e0b2c3-about/index.html +4 -0
- package/demo/pages/item-f1e0b2c3-components/index.html +4 -0
- package/demo/pages/item-f1e0b2c3-components-button/index.html +19 -0
- package/demo/pages/item-f1e0b2c3-components-learning-checks/index.html +7 -0
- package/demo/pages/item-f1e0b2c3-design-language/index.html +4 -0
- package/demo/pages/item-f1e0b2c3-design-language-color/index.html +9 -0
- package/demo/pages/item-f1e0b2c3-design-language-typography/index.html +7 -0
- package/demo/pages/item-f1e0b2c3-get-started/index.html +7 -0
- package/demo/pages/item-f1e0b2c3-get-started-develop/index.html +15 -0
- package/demo/site.json +231 -0
- package/design-system/bridge.json +405 -0
- package/fluent-theme.js +507 -0
- package/gulpfile.cjs +14 -0
- package/icons/add.svg +1 -0
- package/icons/add_circle.svg +1 -0
- package/icons/archive.svg +1 -0
- package/icons/arrow_clockwise.svg +1 -0
- package/icons/arrow_down.svg +1 -0
- package/icons/arrow_download.svg +1 -0
- package/icons/arrow_left.svg +1 -0
- package/icons/arrow_next.svg +1 -0
- package/icons/arrow_previous.svg +1 -0
- package/icons/arrow_redo.svg +1 -0
- package/icons/arrow_right.svg +1 -0
- package/icons/arrow_rotate_clockwise.svg +1 -0
- package/icons/arrow_rotate_counterclockwise.svg +1 -0
- package/icons/arrow_shuffle.svg +1 -0
- package/icons/arrow_sort.svg +1 -0
- package/icons/arrow_undo.svg +1 -0
- package/icons/arrow_up.svg +1 -0
- package/icons/arrow_upload.svg +1 -0
- package/icons/attach.svg +1 -0
- package/icons/book.svg +1 -0
- package/icons/bookmark.svg +1 -0
- package/icons/briefcase.svg +1 -0
- package/icons/calendar.svg +1 -0
- package/icons/call.svg +1 -0
- package/icons/camera.svg +1 -0
- package/icons/chat.svg +1 -0
- package/icons/checkmark.svg +1 -0
- package/icons/checkmark_circle.svg +1 -0
- package/icons/chevron_down.svg +1 -0
- package/icons/chevron_left.svg +1 -0
- package/icons/chevron_right.svg +1 -0
- package/icons/chevron_up.svg +1 -0
- package/icons/clipboard_task.svg +1 -0
- package/icons/clock.svg +1 -0
- package/icons/closed_caption.svg +1 -0
- package/icons/cloud.svg +1 -0
- package/icons/cloud_arrow_down.svg +1 -0
- package/icons/code.svg +1 -0
- package/icons/column_triple.svg +1 -0
- package/icons/copy.svg +1 -0
- package/icons/crop.svg +1 -0
- package/icons/data_bar_vertical.svg +1 -0
- package/icons/data_line.svg +1 -0
- package/icons/delete.svg +1 -0
- package/icons/desktop.svg +1 -0
- package/icons/dismiss.svg +1 -0
- package/icons/dismiss_circle.svg +1 -0
- package/icons/document.svg +1 -0
- package/icons/document_pdf.svg +1 -0
- package/icons/document_text.svg +1 -0
- package/icons/edit.svg +1 -0
- package/icons/emoji.svg +1 -0
- package/icons/error_circle.svg +1 -0
- package/icons/eye.svg +1 -0
- package/icons/eye_off.svg +1 -0
- package/icons/flag.svg +1 -0
- package/icons/folder.svg +1 -0
- package/icons/folder_open.svg +1 -0
- package/icons/full_screen_maximize.svg +1 -0
- package/icons/globe.svg +1 -0
- package/icons/grid.svg +1 -0
- package/icons/hat_graduation.svg +1 -0
- package/icons/highlight.svg +1 -0
- package/icons/history.svg +1 -0
- package/icons/home.svg +1 -0
- package/icons/image.svg +1 -0
- package/icons/image_multiple.svg +1 -0
- package/icons/info.svg +1 -0
- package/icons/keyboard.svg +1 -0
- package/icons/lightbulb.svg +1 -0
- package/icons/link.svg +1 -0
- package/icons/list.svg +1 -0
- package/icons/location.svg +1 -0
- package/icons/lock_closed.svg +1 -0
- package/icons/mail.svg +1 -0
- package/icons/mic.svg +1 -0
- package/icons/music_note_2.svg +1 -0
- package/icons/navigation.svg +1 -0
- package/icons/open.svg +1 -0
- package/icons/options.svg +1 -0
- package/icons/paint_bucket.svg +1 -0
- package/icons/pause.svg +1 -0
- package/icons/pause_circle.svg +1 -0
- package/icons/people.svg +1 -0
- package/icons/person.svg +1 -0
- package/icons/person_feedback.svg +1 -0
- package/icons/phone.svg +1 -0
- package/icons/play.svg +1 -0
- package/icons/play_circle.svg +1 -0
- package/icons/print.svg +1 -0
- package/icons/puzzle_piece.svg +1 -0
- package/icons/question_circle.svg +1 -0
- package/icons/rss.svg +1 -0
- package/icons/save.svg +1 -0
- package/icons/search.svg +1 -0
- package/icons/settings.svg +1 -0
- package/icons/share.svg +1 -0
- package/icons/shield_checkmark.svg +1 -0
- package/icons/sign_out.svg +1 -0
- package/icons/slide_layout.svg +1 -0
- package/icons/speaker_2.svg +1 -0
- package/icons/star.svg +1 -0
- package/icons/stop.svg +1 -0
- package/icons/subtract.svg +1 -0
- package/icons/table.svg +1 -0
- package/icons/tablet.svg +1 -0
- package/icons/tag.svg +1 -0
- package/icons/text_align_center.svg +1 -0
- package/icons/text_align_justify.svg +1 -0
- package/icons/text_align_left.svg +1 -0
- package/icons/text_align_right.svg +1 -0
- package/icons/text_bold.svg +1 -0
- package/icons/text_bullet_list_ltr.svg +1 -0
- package/icons/text_bullet_list_tree.svg +1 -0
- package/icons/text_font.svg +1 -0
- package/icons/text_italic.svg +1 -0
- package/icons/text_number_list_ltr.svg +1 -0
- package/icons/text_quote.svg +1 -0
- package/icons/text_strikethrough.svg +1 -0
- package/icons/text_underline.svg +1 -0
- package/icons/thumb_like.svg +1 -0
- package/icons/video.svg +1 -0
- package/icons/warning.svg +1 -0
- package/icons/zoom_in.svg +1 -0
- package/icons/zoom_out.svg +1 -0
- package/lib/FluentDDDMap.js +147 -0
- package/lib/FluentDesignSystem.js +43 -0
- package/lib/FluentIcons.js +173 -0
- package/lib/FluentTokens.js +103 -0
- package/lib/fluent-theme.docs.json +43 -0
- package/lib/fluent.ddd-map.json +1240 -0
- package/locales/fluent-theme.en.json +9 -0
- package/package.json +56 -4
- package/test/fluent-theme.test.js +73 -0
package/package.json
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haxtheweb/fluent-theme",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "26.8.0",
|
|
4
|
+
"description": "Microsoft Fluent 2 theme for HAXcms, built on the DDD-capable Fluent 2 design system bridge",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/haxtheweb/webcomponents.git"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "fluent-theme.js",
|
|
11
|
+
"module": "fluent-theme.js",
|
|
12
|
+
"scripts": {
|
|
13
|
+
"start": "yarn run dev",
|
|
14
|
+
"build": "prettier --ignore-path ../../.prettierignore --write \"**/*.{js,json}\" && cem analyze --litelement --exclude \"(public|*.stories.js)\" --globs \"{*,lib/**}.js\" && node ../../scripts/extract-element-docs.mjs --write .",
|
|
15
|
+
"dev": "concurrently --kill-others \"yarn run watch\" \"yarn run serve\"",
|
|
16
|
+
"watch": "gulp dev --gulpfile=gulpfile.cjs",
|
|
17
|
+
"serve": "web-dev-server -c ../../web-dev-server.config.mjs",
|
|
18
|
+
"lighthouse": "gulp lighthouse --gulpfile=gulpfile.cjs",
|
|
19
|
+
"test:watch": "web-test-runner \"test/**/*.test.js\" --node-resolve --config=../../web-test-runner.config.mjs --playwright --browsers chromium --watch",
|
|
20
|
+
"test": "web-test-runner \"test/**/*.test.js\" --coverage --node-resolve --config=../../web-test-runner.config.mjs --playwright --browsers chromium",
|
|
21
|
+
"bridge": "node ../d-d-d/design-system/bridge/build-bridge.js ."
|
|
22
|
+
},
|
|
23
|
+
"author": {
|
|
24
|
+
"name": "haxtheweb",
|
|
25
|
+
"url": "https://hax.psu.edu/"
|
|
26
|
+
},
|
|
27
|
+
"license": "Apache-2.0",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@haxtheweb/d-d-d": "^26.8.0",
|
|
30
|
+
"@haxtheweb/haxcms-elements": "^26.8.0",
|
|
31
|
+
"@haxtheweb/i18n-manager": "^26.8.0",
|
|
32
|
+
"@haxtheweb/simple-icon": "^26.8.0",
|
|
33
|
+
"lit": "3.3.3",
|
|
34
|
+
"mobx": "6.16.1"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@custom-elements-manifest/analyzer": "0.11.0",
|
|
38
|
+
"@haxtheweb/deduping-fix": "^26.8.0",
|
|
39
|
+
"@open-wc/testing": "4.0.0",
|
|
40
|
+
"@web/dev-server": "0.4.6",
|
|
41
|
+
"concurrently": "9.2.5"
|
|
42
|
+
},
|
|
43
|
+
"private": false,
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
},
|
|
47
|
+
"customElements": "custom-elements.json",
|
|
48
|
+
"keywords": [
|
|
49
|
+
"webcomponents",
|
|
50
|
+
"html",
|
|
51
|
+
"haxtheweb",
|
|
52
|
+
"lit",
|
|
53
|
+
"haxcms",
|
|
54
|
+
"theme",
|
|
55
|
+
"design-system",
|
|
56
|
+
"fluent"
|
|
57
|
+
]
|
|
58
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
globalThis.process = globalThis.process || {
|
|
2
|
+
env: {
|
|
3
|
+
NODE_ENV: "development",
|
|
4
|
+
},
|
|
5
|
+
};
|
|
6
|
+
import { fixture, expect, html } from "@open-wc/testing";
|
|
7
|
+
import { FluentTheme } from "../fluent-theme.js";
|
|
8
|
+
import { DesignSystemManager } from "@haxtheweb/d-d-d/lib/DesignSystemManager.js";
|
|
9
|
+
import { FLUENT_SYSTEM } from "../lib/FluentDesignSystem.js";
|
|
10
|
+
|
|
11
|
+
describe("fluent-theme", () => {
|
|
12
|
+
let element;
|
|
13
|
+
beforeEach(async () => {
|
|
14
|
+
element = await fixture(html`<fluent-theme></fluent-theme>`);
|
|
15
|
+
await element.updateComplete;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("is defined with its tag", () => {
|
|
19
|
+
expect(FluentTheme.tag).to.equal("fluent-theme");
|
|
20
|
+
expect(globalThis.customElements.get("fluent-theme")).to.equal(FluentTheme);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("keeps the HAX content contract and a skip link", () => {
|
|
24
|
+
const root = element.shadowRoot;
|
|
25
|
+
expect(root.querySelector("a.skip-link[href='#contentcontainer']")).to
|
|
26
|
+
.exist;
|
|
27
|
+
expect(root.querySelector("#contentcontainer > #slot > slot")).to.exist;
|
|
28
|
+
expect(root.querySelector("nav site-menu")).to.exist;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("makes Fluent the active design system as a DDD dialect", () => {
|
|
32
|
+
expect(DesignSystemManager.active).to.equal(FLUENT_SYSTEM);
|
|
33
|
+
expect(DesignSystemManager.systems[FLUENT_SYSTEM].extends).to.equal("ddd");
|
|
34
|
+
expect(DesignSystemManager.isActiveCompatible("ddd")).to.be.true;
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("points DDD tokens at Fluent tokens", () => {
|
|
38
|
+
const styles = globalThis.getComputedStyle(element);
|
|
39
|
+
expect(
|
|
40
|
+
styles.getPropertyValue("--ddd-theme-default-beaverBlue").trim(),
|
|
41
|
+
).to.equal("#0f6cbd");
|
|
42
|
+
expect(styles.getPropertyValue("--ddd-font-primary")).to.contain(
|
|
43
|
+
"Segoe UI",
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("keeps DDD structure and rounds the corners", () => {
|
|
48
|
+
const styles = globalThis.getComputedStyle(element);
|
|
49
|
+
expect(styles.getPropertyValue("--ddd-spacing-4").trim()).to.equal("16px");
|
|
50
|
+
expect(styles.getPropertyValue("--ddd-radius-sm").trim()).to.equal("4px");
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it("toggles the sidebar with the masthead button", async () => {
|
|
54
|
+
const before = element.sidebarOpen;
|
|
55
|
+
element.shadowRoot.querySelector(".header simple-icon-button-lite").click();
|
|
56
|
+
await element.updateComplete;
|
|
57
|
+
expect(element.sidebarOpen).to.equal(!before);
|
|
58
|
+
const toggle = element.shadowRoot.querySelector(
|
|
59
|
+
".header simple-icon-button-lite",
|
|
60
|
+
);
|
|
61
|
+
expect(toggle.getAttribute("aria-expanded")).to.equal(
|
|
62
|
+
element.sidebarOpen ? "true" : "false",
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it("passes the a11y audit", async () => {
|
|
67
|
+
// with no site loaded the site title is empty, and axe can't follow a
|
|
68
|
+
// skip link into the shadow root; both are covered in a loaded site
|
|
69
|
+
await expect(element).shadowDom.to.be.accessible({
|
|
70
|
+
ignoredRules: ["skip-link", "empty-heading"],
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
});
|