@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.
Files changed (164) hide show
  1. package/.dddignore +36 -0
  2. package/.editorconfig +29 -0
  3. package/.github/workflows/main.yml +33 -0
  4. package/.nojekyll +0 -0
  5. package/.surgeignore +1 -0
  6. package/.travis.yml +15 -0
  7. package/LICENSE +201 -0
  8. package/NOTICE +44 -0
  9. package/README.md +47 -2
  10. package/custom-elements.json +310 -0
  11. package/demo/files/thumb-button.svg +1 -0
  12. package/demo/files/thumb-checks.svg +1 -0
  13. package/demo/files/thumb-code.svg +1 -0
  14. package/demo/files/thumb-color.svg +1 -0
  15. package/demo/files/thumb-shapes.svg +1 -0
  16. package/demo/files/thumb-type.svg +1 -0
  17. package/demo/index.html +49 -0
  18. package/demo/pages/item-f1e0b2c3-about/index.html +4 -0
  19. package/demo/pages/item-f1e0b2c3-components/index.html +4 -0
  20. package/demo/pages/item-f1e0b2c3-components-button/index.html +19 -0
  21. package/demo/pages/item-f1e0b2c3-components-learning-checks/index.html +7 -0
  22. package/demo/pages/item-f1e0b2c3-design-language/index.html +4 -0
  23. package/demo/pages/item-f1e0b2c3-design-language-color/index.html +9 -0
  24. package/demo/pages/item-f1e0b2c3-design-language-typography/index.html +7 -0
  25. package/demo/pages/item-f1e0b2c3-get-started/index.html +7 -0
  26. package/demo/pages/item-f1e0b2c3-get-started-develop/index.html +15 -0
  27. package/demo/site.json +231 -0
  28. package/design-system/bridge.json +405 -0
  29. package/fluent-theme.js +507 -0
  30. package/gulpfile.cjs +14 -0
  31. package/icons/add.svg +1 -0
  32. package/icons/add_circle.svg +1 -0
  33. package/icons/archive.svg +1 -0
  34. package/icons/arrow_clockwise.svg +1 -0
  35. package/icons/arrow_down.svg +1 -0
  36. package/icons/arrow_download.svg +1 -0
  37. package/icons/arrow_left.svg +1 -0
  38. package/icons/arrow_next.svg +1 -0
  39. package/icons/arrow_previous.svg +1 -0
  40. package/icons/arrow_redo.svg +1 -0
  41. package/icons/arrow_right.svg +1 -0
  42. package/icons/arrow_rotate_clockwise.svg +1 -0
  43. package/icons/arrow_rotate_counterclockwise.svg +1 -0
  44. package/icons/arrow_shuffle.svg +1 -0
  45. package/icons/arrow_sort.svg +1 -0
  46. package/icons/arrow_undo.svg +1 -0
  47. package/icons/arrow_up.svg +1 -0
  48. package/icons/arrow_upload.svg +1 -0
  49. package/icons/attach.svg +1 -0
  50. package/icons/book.svg +1 -0
  51. package/icons/bookmark.svg +1 -0
  52. package/icons/briefcase.svg +1 -0
  53. package/icons/calendar.svg +1 -0
  54. package/icons/call.svg +1 -0
  55. package/icons/camera.svg +1 -0
  56. package/icons/chat.svg +1 -0
  57. package/icons/checkmark.svg +1 -0
  58. package/icons/checkmark_circle.svg +1 -0
  59. package/icons/chevron_down.svg +1 -0
  60. package/icons/chevron_left.svg +1 -0
  61. package/icons/chevron_right.svg +1 -0
  62. package/icons/chevron_up.svg +1 -0
  63. package/icons/clipboard_task.svg +1 -0
  64. package/icons/clock.svg +1 -0
  65. package/icons/closed_caption.svg +1 -0
  66. package/icons/cloud.svg +1 -0
  67. package/icons/cloud_arrow_down.svg +1 -0
  68. package/icons/code.svg +1 -0
  69. package/icons/column_triple.svg +1 -0
  70. package/icons/copy.svg +1 -0
  71. package/icons/crop.svg +1 -0
  72. package/icons/data_bar_vertical.svg +1 -0
  73. package/icons/data_line.svg +1 -0
  74. package/icons/delete.svg +1 -0
  75. package/icons/desktop.svg +1 -0
  76. package/icons/dismiss.svg +1 -0
  77. package/icons/dismiss_circle.svg +1 -0
  78. package/icons/document.svg +1 -0
  79. package/icons/document_pdf.svg +1 -0
  80. package/icons/document_text.svg +1 -0
  81. package/icons/edit.svg +1 -0
  82. package/icons/emoji.svg +1 -0
  83. package/icons/error_circle.svg +1 -0
  84. package/icons/eye.svg +1 -0
  85. package/icons/eye_off.svg +1 -0
  86. package/icons/flag.svg +1 -0
  87. package/icons/folder.svg +1 -0
  88. package/icons/folder_open.svg +1 -0
  89. package/icons/full_screen_maximize.svg +1 -0
  90. package/icons/globe.svg +1 -0
  91. package/icons/grid.svg +1 -0
  92. package/icons/hat_graduation.svg +1 -0
  93. package/icons/highlight.svg +1 -0
  94. package/icons/history.svg +1 -0
  95. package/icons/home.svg +1 -0
  96. package/icons/image.svg +1 -0
  97. package/icons/image_multiple.svg +1 -0
  98. package/icons/info.svg +1 -0
  99. package/icons/keyboard.svg +1 -0
  100. package/icons/lightbulb.svg +1 -0
  101. package/icons/link.svg +1 -0
  102. package/icons/list.svg +1 -0
  103. package/icons/location.svg +1 -0
  104. package/icons/lock_closed.svg +1 -0
  105. package/icons/mail.svg +1 -0
  106. package/icons/mic.svg +1 -0
  107. package/icons/music_note_2.svg +1 -0
  108. package/icons/navigation.svg +1 -0
  109. package/icons/open.svg +1 -0
  110. package/icons/options.svg +1 -0
  111. package/icons/paint_bucket.svg +1 -0
  112. package/icons/pause.svg +1 -0
  113. package/icons/pause_circle.svg +1 -0
  114. package/icons/people.svg +1 -0
  115. package/icons/person.svg +1 -0
  116. package/icons/person_feedback.svg +1 -0
  117. package/icons/phone.svg +1 -0
  118. package/icons/play.svg +1 -0
  119. package/icons/play_circle.svg +1 -0
  120. package/icons/print.svg +1 -0
  121. package/icons/puzzle_piece.svg +1 -0
  122. package/icons/question_circle.svg +1 -0
  123. package/icons/rss.svg +1 -0
  124. package/icons/save.svg +1 -0
  125. package/icons/search.svg +1 -0
  126. package/icons/settings.svg +1 -0
  127. package/icons/share.svg +1 -0
  128. package/icons/shield_checkmark.svg +1 -0
  129. package/icons/sign_out.svg +1 -0
  130. package/icons/slide_layout.svg +1 -0
  131. package/icons/speaker_2.svg +1 -0
  132. package/icons/star.svg +1 -0
  133. package/icons/stop.svg +1 -0
  134. package/icons/subtract.svg +1 -0
  135. package/icons/table.svg +1 -0
  136. package/icons/tablet.svg +1 -0
  137. package/icons/tag.svg +1 -0
  138. package/icons/text_align_center.svg +1 -0
  139. package/icons/text_align_justify.svg +1 -0
  140. package/icons/text_align_left.svg +1 -0
  141. package/icons/text_align_right.svg +1 -0
  142. package/icons/text_bold.svg +1 -0
  143. package/icons/text_bullet_list_ltr.svg +1 -0
  144. package/icons/text_bullet_list_tree.svg +1 -0
  145. package/icons/text_font.svg +1 -0
  146. package/icons/text_italic.svg +1 -0
  147. package/icons/text_number_list_ltr.svg +1 -0
  148. package/icons/text_quote.svg +1 -0
  149. package/icons/text_strikethrough.svg +1 -0
  150. package/icons/text_underline.svg +1 -0
  151. package/icons/thumb_like.svg +1 -0
  152. package/icons/video.svg +1 -0
  153. package/icons/warning.svg +1 -0
  154. package/icons/zoom_in.svg +1 -0
  155. package/icons/zoom_out.svg +1 -0
  156. package/lib/FluentDDDMap.js +147 -0
  157. package/lib/FluentDesignSystem.js +43 -0
  158. package/lib/FluentIcons.js +173 -0
  159. package/lib/FluentTokens.js +103 -0
  160. package/lib/fluent-theme.docs.json +43 -0
  161. package/lib/fluent.ddd-map.json +1240 -0
  162. package/locales/fluent-theme.en.json +9 -0
  163. package/package.json +56 -4
  164. package/test/fluent-theme.test.js +73 -0
@@ -0,0 +1,9 @@
1
+ {
2
+ "skipToContent": "Skip to content",
3
+ "toggleSiteMenu": "Toggle site menu",
4
+ "siteNavigation": "Site navigation",
5
+ "searchSite": "Search site",
6
+ "search": "Search",
7
+ "toggleDarkMode": "Toggle dark mode",
8
+ "pageNavigation": "Page navigation"
9
+ }
package/package.json CHANGED
@@ -1,6 +1,58 @@
1
1
  {
2
2
  "name": "@haxtheweb/fluent-theme",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
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
+ });