@epa-wg/custom-element-dist 0.0.33 → 0.0.35

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 (185) hide show
  1. package/.claude/settings.local.json +18 -0
  2. package/.gitattributes +4 -0
  3. package/.github/workflows/deploy.yml +59 -0
  4. package/.idea/copilot.data.migration.agent.xml +6 -0
  5. package/.idea/copilot.data.migration.ask.xml +6 -0
  6. package/.idea/copilot.data.migration.ask2agent.xml +6 -0
  7. package/.idea/copilot.data.migration.edit.xml +6 -0
  8. package/.idea/custom-element-dist.iml +2 -0
  9. package/.storybook/main.ts +20 -17
  10. package/.storybook/preview.ts +23 -23
  11. package/.yarn/install-state.gz +0 -0
  12. package/.yarnrc.yml +1 -0
  13. package/README.md +6 -4
  14. package/coverage/block-navigation.js +1 -1
  15. package/coverage/coverage-final.json +4 -3
  16. package/coverage/index.html +34 -19
  17. package/coverage/sorter.js +21 -7
  18. package/coverage/src/custom-element/coverage.svg +1 -1
  19. package/coverage/src/custom-element/custom-element.js/coverage.svg +1 -1
  20. package/coverage/src/custom-element/custom-element.js.html +448 -391
  21. package/coverage/src/custom-element/http-request.js/coverage.svg +1 -1
  22. package/coverage/src/custom-element/http-request.js.html +38 -17
  23. package/coverage/src/custom-element/index.html +26 -26
  24. package/coverage/src/custom-element/local-storage.js.html +1 -1
  25. package/coverage/src/custom-element/location-element.js.html +1 -1
  26. package/coverage/src/custom-element/module-url.js.html +1 -1
  27. package/coverage/src/index.html +1 -1
  28. package/coverage/src/material/theme/colors.js/coverage.svg +10 -0
  29. package/coverage/src/material/theme/colors.js.html +217 -0
  30. package/coverage/src/material/theme/coverage.svg +10 -0
  31. package/coverage/src/material/theme/index.html +116 -0
  32. package/coverage/src/mocks/handlers.ts.html +1 -1
  33. package/coverage/src/mocks/index.html +1 -1
  34. package/coverage/src/stories/frame.canvas.ts.html +1 -1
  35. package/coverage/src/stories/http-request.stories.ts.html +1 -1
  36. package/coverage/src/stories/index.html +1 -1
  37. package/coverage/src/stories/testStoryBook.ts.html +12 -12
  38. package/coverage/src/sum.ts.html +1 -1
  39. package/dist/custom-element-Bssk9jRy.cjs +97 -0
  40. package/dist/{custom-element-WnOqmEOe.js → custom-element-BzDjIYMe.js} +193 -183
  41. package/dist/custom-element-bundle.cjs +1 -1
  42. package/dist/custom-element-bundle.js +3 -3
  43. package/dist/demo/a.html +10 -3
  44. package/dist/demo/a.svg +26 -26
  45. package/dist/demo/html-template.html +4 -3
  46. package/dist/demo/s.xml +1 -75
  47. package/dist/demo/s.xslt +351 -72
  48. package/dist/demo/s1.xml +3706 -0
  49. package/dist/http-request-DSaowcG1.cjs +1 -0
  50. package/dist/{http-request-BOvP4KTl.js → http-request-DTCzZ1gc.js} +15 -9
  51. package/dist/mockServiceWorker.js +105 -63
  52. package/package.json +5 -4
  53. package/public/demo/a.html +10 -3
  54. package/public/demo/a.svg +26 -26
  55. package/public/demo/html-template.html +4 -3
  56. package/public/demo/s.xml +1 -75
  57. package/public/demo/s.xslt +351 -72
  58. package/public/demo/s1.xml +3706 -0
  59. package/public/mockServiceWorker.js +105 -63
  60. package/src/custom-element/custom-element.js +28 -9
  61. package/src/custom-element/demo/a.html +10 -3
  62. package/src/custom-element/demo/a.svg +26 -26
  63. package/src/custom-element/demo/html-template.html +4 -3
  64. package/src/custom-element/demo/s.xml +1 -75
  65. package/src/custom-element/demo/s.xslt +351 -72
  66. package/src/custom-element/demo/s1.xml +3706 -0
  67. package/src/custom-element/http-request.js +7 -0
  68. package/src/custom-element/ide/customData-dce.json +123 -0
  69. package/src/custom-element/ide/web-types-dce.json +128 -1
  70. package/src/custom-element/ide/web-types-xsl.json +1 -1
  71. package/src/material/angular.css +987 -987
  72. package/src/material/components/action.html +262 -0
  73. package/src/material/components/autocomplete.html +167 -239
  74. package/src/material/components/badge.html +238 -239
  75. package/src/material/components/dropdown.html +0 -1
  76. package/src/material/components/icon-link.html +160 -161
  77. package/src/material/components/icon.html +251 -252
  78. package/src/material/components/input.html +569 -570
  79. package/src/material/components/menu.html +235 -236
  80. package/src/material/components.html +157 -158
  81. package/src/material/demo.css +36 -36
  82. package/src/material/index.html +109 -110
  83. package/src/material/material.css +356 -356
  84. package/src/material/theme/Base-Principles.md +339 -0
  85. package/src/material/theme/README.md +298 -18
  86. package/src/material/theme/UI Domain Model in web applications.svg +1 -0
  87. package/src/material/theme/User Semantic Theme tokens.svg +1 -0
  88. package/src/material/theme/action-pending-poc.html +62 -0
  89. package/src/material/theme/actions-color.html +141 -0
  90. package/src/material/theme/colors-light.html +631 -0
  91. package/src/material/theme/colors-native.html +51 -0
  92. package/src/material/theme/colors-poc.html +66 -0
  93. package/src/material/theme/colors.html +297 -0
  94. package/src/material/theme/colors.js +44 -0
  95. package/src/material/theme/consumer-theme.css +745 -0
  96. package/src/material/theme/semantic.css +132 -132
  97. package/src/material/theme/style-bug.html +123 -0
  98. package/src/material/theme/theme-data.css +43 -0
  99. package/src/material/theme/theme-data.xhtml +2926 -0
  100. package/src/material/theme/todo.md +274 -0
  101. package/src/material/theme/tokens/action-colors.png +0 -0
  102. package/src/material/theme/tokens/cem-article-illustration-4x1-letterbox-2000x500.png +0 -0
  103. package/src/material/theme/tokens/cem-breakpoints.md +519 -0
  104. package/src/material/theme/tokens/cem-colors.md +715 -0
  105. package/src/material/theme/tokens/cem-consumerflow-typography-matrix.svg +198 -0
  106. package/src/material/theme/tokens/cem-coupling.md +372 -0
  107. package/src/material/theme/tokens/cem-data-vs-reading-numerals.svg +164 -0
  108. package/src/material/theme/tokens/cem-dimension.md +625 -0
  109. package/src/material/theme/tokens/cem-layering.md +562 -0
  110. package/src/material/theme/tokens/cem-m3-parity.md +343 -0
  111. package/src/material/theme/tokens/cem-responsive.md +238 -0
  112. package/src/material/theme/tokens/cem-shape.md +691 -0
  113. package/src/material/theme/tokens/cem-stroke-density-illustration-4to1-v3.svg +102 -0
  114. package/src/material/theme/tokens/cem-stroke.md +480 -0
  115. package/src/material/theme/tokens/cem-timing.md +198 -0
  116. package/src/material/theme/tokens/cem-typography-model-stack.svg +64 -0
  117. package/src/material/theme/tokens/cem-voice-fonts-typography.md +718 -0
  118. package/src/material/theme/tokens/cem-voice-ladder.svg +91 -0
  119. package/src/material/theme/tokens/chips.png +0 -0
  120. package/src/material/theme/tokens/columns-page.png +0 -0
  121. package/src/material/theme/tokens/initials.png +0 -0
  122. package/src/material/theme/tokens/nav-buttons.png +0 -0
  123. package/src/material/theme/tokens/script.png +0 -0
  124. package/src/material/theme/tokens/sufler.png +0 -0
  125. package/src/material/theme/tokens/typography-icons.png +0 -0
  126. package/src/mocks/versions.mock.ts +1 -1
  127. package/src/stories/__screenshots__/dom-merge.test.stories.ts/dom-merge-dom-merge-OrderPreservingOn2ndTransform-1.png +0 -0
  128. package/src/stories/__screenshots__/xslt-conditionals.test.stories.ts/xslt-conditionals-xslt-conditionals-MultipleIfOrderingWorkaround-1.png +0 -0
  129. package/src/stories/dom-merge.test.stories.ts +25 -1
  130. package/src/stories/xslt-conditionals.test.stories.ts +492 -0
  131. package/src/stories/xslt-for-each.test.stories.ts +336 -0
  132. package/src/stories/xslt-if.test.stories.ts +89 -0
  133. package/storybook-static/assets/{Color-F6OSRLHC-Cbp293x2.js → Color-F6OSRLHC-DeDlDLjU.js} +1 -1
  134. package/storybook-static/assets/{Configure-BrFr4SLE.js → Configure-CH_tIP5N.js} +1 -1
  135. package/storybook-static/assets/{DocsRenderer-CFRXHY34-DhHzJiIO.js → DocsRenderer-CFRXHY34-Bc9EPsUI.js} +2 -2
  136. package/storybook-static/assets/{attributes.test.stories-Gg9LQTEK.js → attributes.test.stories-BtamFQkF.js} +1 -1
  137. package/storybook-static/assets/{css.test.stories-B_3ltOrx.js → css.test.stories-BfNxLgwr.js} +1 -1
  138. package/storybook-static/assets/{custom-element-CPnvJnn8.js → custom-element-CnmjNo0g.js} +6 -6
  139. package/storybook-static/assets/{dom-merge.test.stories-nQxcgLoM.js → dom-merge.test.stories-DxnitrLK.js} +47 -6
  140. package/storybook-static/assets/entry-preview-BNCt9WBs.js +26 -0
  141. package/storybook-static/assets/{entry-preview-docs-Dwczwtsc.js → entry-preview-docs-CbF8-81D.js} +2 -2
  142. package/storybook-static/assets/{external-template.test.stories-DZ-rjnfd.js → external-template.test.stories-BTsww7B0.js} +1 -1
  143. package/storybook-static/assets/{form.test.stories-DQhPYtMj.js → form.test.stories-DNJFtPJb.js} +1 -1
  144. package/storybook-static/assets/{frame.canvas-ClTqYyMN.js → frame.canvas-E5n9h6j1.js} +1 -1
  145. package/storybook-static/assets/{handlers-CLkps6Nz.js → handlers-Dvg8CAeR.js} +1 -1
  146. package/storybook-static/assets/http-request-BWeEEBkP.js +1 -0
  147. package/storybook-static/assets/{http-request.stories-jo0f73nw.js → http-request.stories-DgrBNle8.js} +1 -1
  148. package/storybook-static/assets/{iframe-CZwRpnn9.js → iframe-DiVWehoI.js} +11 -11
  149. package/storybook-static/assets/{index-Dr4PwNfd.js → index-CGuyH0k-.js} +87 -87
  150. package/storybook-static/assets/{index-CJQtnF9V.js → index-CdEbhcV9.js} +1 -1
  151. package/storybook-static/assets/index-DO1nmyvI.js +11 -0
  152. package/storybook-static/assets/{index-B68YUdzy.js → index-w6iX3YlR.js} +3 -3
  153. package/storybook-static/assets/{local-storage.test.stories-uA5EKRPf.js → local-storage.test.stories-Hwq80yUr.js} +1 -1
  154. package/storybook-static/assets/{location-element.test.stories-Cu-6Elcg.js → location-element.test.stories-mEhZzm7x.js} +1 -1
  155. package/storybook-static/assets/{module-url.test.stories-CD_wusXQ.js → module-url.test.stories-Bj46iT0V.js} +1 -1
  156. package/storybook-static/assets/{preview-CuCH40jj.js → preview-BjbXcJci.js} +2 -2
  157. package/storybook-static/assets/{preview-BFlNN3Wj.js → preview-Bn8igYMp.js} +1 -1
  158. package/storybook-static/assets/{preview-Cm4PPhHS.js → preview-CfuT8gak.js} +1 -1
  159. package/storybook-static/assets/{set-url.test.stories-CY7B9BVZ.js → set-url.test.stories-hzxLcqmm.js} +1 -1
  160. package/storybook-static/assets/{slice-events.test.stories-BVnPXm6e.js → slice-events.test.stories-DVyXFRU1.js} +1 -1
  161. package/storybook-static/assets/{slots.test.stories-Dxsa9KdA.js → slots.test.stories-CS544nS4.js} +1 -1
  162. package/storybook-static/assets/{version-select.test.stories-Buga1PAa.js → version-select.test.stories-D36nfYBq.js} +1 -1
  163. package/storybook-static/assets/xslt-conditionals.test.stories-BS1PTIHe.js +633 -0
  164. package/storybook-static/assets/xslt-for-each.test.stories-CtPS20RK.js +329 -0
  165. package/storybook-static/assets/xslt-if.test.stories-DcHrAMSY.js +71 -0
  166. package/storybook-static/demo/a.html +10 -3
  167. package/storybook-static/demo/a.svg +26 -26
  168. package/storybook-static/demo/html-template.html +4 -3
  169. package/storybook-static/demo/s.xml +1 -75
  170. package/storybook-static/demo/s.xslt +351 -72
  171. package/storybook-static/demo/s1.xml +3706 -0
  172. package/storybook-static/iframe.html +2 -2
  173. package/storybook-static/index.json +1 -1
  174. package/storybook-static/mockServiceWorker.js +105 -63
  175. package/storybook-static/project.json +1 -1
  176. package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +69 -66
  177. package/storybook-static/sb-addons/essentials-docs-3/manager-bundle.js +62 -59
  178. package/dist/custom-element-6slVaFEs.cjs +0 -97
  179. package/dist/http-request-DPrY7mGh.cjs +0 -1
  180. package/storybook-static/assets/attributes.test.stories-CzWkKw0e.js +0 -1
  181. package/storybook-static/assets/entry-preview-DHVXbf3x.js +0 -26
  182. package/storybook-static/assets/external-template.test.stories-BivZqBTp.js +0 -1
  183. package/storybook-static/assets/http-request-DNq59pnj.js +0 -1
  184. package/storybook-static/assets/index-BwkS7JH_.js +0 -8
  185. package/storybook-static/assets/module-url.test.stories-CTjUAk3J.js +0 -1
@@ -1,253 +1,252 @@
1
- <!DOCTYPE html>
2
- <html lang="en" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
6
- <title>Components - custom-element - Material Design</title>
7
- <link href="../../custom-element/demo/wc-square.svg" rel="icon"/>
8
- <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
9
- <link crossorigin="anonymous" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css"
10
- integrity="sha384-DyZ88mC6Up2uqS4h/KRgHuoeGwBcD4Ng9SiP4dIRy0EXTlnuz47vAwmeGwVChigm" rel="stylesheet"/>
11
-
12
- <script type="importmap">
13
- {
14
- "imports": {
15
- "@epa-wg/": "../../"
16
- }
17
- }
18
- </script>
19
- <script src="../../custom-element/module-url.js" type="module"></script>
20
- <script src="../../custom-element/custom-element.js" type="module"></script>
21
- <style>
22
- @import "../angular.css";
23
- @import "../material.css";
24
- @import "../theme/semantic.css";
25
- @import "../demo.css";
26
- main{
27
- display: flex; flex-wrap: wrap;
28
- gap: 3rem;
29
- padding: 5rem;
30
- &>p{ min-width: 90%; }
31
- html-demo-element
32
- { overflow: visible;
33
- [slot="legend"]{ border-radius: 1rem 1rem 0 0; }
34
- [slot="description"]{ padding: 0 1rem 1rem 1rem; dd{ padding: 0 !important;margin: 0; }}
35
- [slot="description"] dd{ padding: 0; }
36
- }
37
- var{ color: darkgreen; font-weight: bold; }
38
- }
39
- cem-icon{ margin: 1rem; }
40
- </style>
41
- </head>
42
- <!--
43
- ToDO
44
- * docs w/ how to use
45
- -->
46
- <body>
47
- <template id="cem-icon">
48
- <attribute name="image"
49
- aria-description="defines the icon in one of the libraries or URL. The selection algorithm
50
- if value is single symbol, it is treated as unicode or emoji image
51
- if value has a slash symbol (/), it is treated as URL for img< element
52
- otherwise if value has a <code>fa-</code> substring, it is treated as favicon
53
- otherwise if value is not empty, it is treated as material icon"
54
- ></attribute>
55
- <attribute name="size"
56
- aria-description="Icon size. Default value is 'normal'. Values: normal|small|large"
57
- ></attribute>
58
- <attribute name="direction"
59
- aria-description="defines css flex-direction. Default value is 'row'. Values: row|column"
60
- ></attribute>
61
- <style>
62
- &[direction="column"]>*{ flex-direction: column; gap:0; }
63
- &[direction="row" ]>*{ flex-direction: row; }
64
- &[size="normal" ]>*>.icon{ height: var(--cem-icon-size); font-size: var(--cem-icon-size); }
65
- &[size="small" ]>*>.icon{ height: var(--cem-icon-size-small); font-size: var(--cem-icon-size-small); }
66
- &[size="large" ]>*>.icon{ height: var(--cem-icon-size-large); font-size: var(--cem-icon-size-large); }
67
- &{ display: inline-flex; }
68
- &>* {
69
- display: inline-flex; align-items: center; gap: calc( var(--cem-icon-size) / 4 );
70
-
71
- .icon {
72
- font-size: var(--cem-icon-size);
73
- height: var(--cem-icon-size);
74
- }
75
- .unicode{position: relative; top:-25%; }
76
- }
77
- </style>
78
-
79
- <choose>
80
- <when test="string-length($image) &lt; 3"><b class="icon unicode">{$image}</b></when>
81
- <when test="contains($image,'/')"><img alt="icon" class="icon" src="{$image}"/></when>
82
- <when test="contains($image,'fa-')"><i class="icon {$image}"></i></when>
83
- <when test="$image"><span class="icon material-icons">{$image}</span></when>
84
- </choose>
85
- <slot></slot>
86
-
87
- </template>
88
-
89
- <custom-element hidden src="#cem-icon" tag="cem-icon"></custom-element>
90
- <custom-element hidden src="./icon-link.html#cem-icon-link" tag="cem-icon-link"></custom-element>
91
-
92
- <header class="cem-theme-teal">
93
- <custom-element src="../index.html#nav-head"></custom-element>
94
- </header>
95
- <main>
96
- <aside>
97
- <p><code>cem-icon</code> is an icon component from &lt;custom-element&gt; Material suite icons based on the
98
- <a href="https://m3.material.io/styles/icons/designing-icons">Material Design specification for Icons</a>.<br/>
99
- Icons are small symbols to easily identify actions and categories
100
- </p>
101
- <h1>Attributes</h1>
102
- <div> <code>image</code> attribute defines the icon in one of the libraries or URL. The selection algorithm
103
- <ol>
104
- <li>if value is single symbol, it is treated as <var>unicode</var> or <var>emoji</var> image </li>
105
- <li>if value has a slash symbol (<code>/</code>), it is treated as <var>URL</var> for <code>img</code> element </li>
106
- <li>if value has a <code>fa-</code> substring, it is treated as <var>favicon</var> </li>
107
- <li>if value is not empty, it is treated as <var>material icon</var> </li>
108
-
109
- </ol>
110
- </div>
111
- <div> <code>direction</code> attribute defines css <code>row</code> or <code>column</code> flex-direction. </div>
112
- </aside>
113
- <section>
114
- <html-demo-element legend="Direction attribute">
115
- <p slot="description">
116
- Defines the text position next to icon. Uses CSS <code>flex-direction</code> values.
117
- </p>
118
- <template>
119
- <cem-icon image="»"> default is row </cem-icon>
120
- <cem-icon image="home" direction="column"> column </cem-icon>
121
- <cem-icon image="fas fa-bone" direction="row"> row </cem-icon>
122
- </template>
123
- </html-demo-element>
124
-
125
-
126
- <html-demo-element legend="Size attribute">
127
- <p slot="description">
128
- Defines the icon size.
129
- </p>
130
- <template>
131
- <cem-icon image="fas fa-heart" size="small"> small </cem-icon>
132
- <cem-icon image="fas fa-heart" size="normal"> normal </cem-icon>
133
- <cem-icon image="fas fa-heart" size="large"> large </cem-icon>
134
- </template>
135
- </html-demo-element>
136
-
137
- </section>
138
-
139
- <html-demo-element legend="Unicode or Emoji">
140
- <p slot="description">
141
- <cem-icon image="https://unicodeplus.com/favicon.ico"
142
- ><a href="https://unicodeplus.com/search">Search Unicode</a> </cem-icon>
143
- <cem-icon image="https://emojipedia.org/images/favicon-32x32.png"
144
- ><a href="https://emojipedia.org/search?q=heart">Search Emoji</a></cem-icon>
145
- </p>
146
- <template>
147
- <cem-icon image="🚀" > Rocket emoji </cem-icon>
148
- <cem-icon image="👁" > Eye unicode </cem-icon>
149
- <hr/>
150
- <cem-icon image="🎄" ></cem-icon>
151
- <cem-icon image="😭" ></cem-icon>
152
- <cem-icon image="🔥" ></cem-icon>
153
- <cem-icon image="💀" ></cem-icon><br/>
154
- <cem-icon image="🛒" ></cem-icon>
155
- <cem-icon image="✨" ></cem-icon>
156
- <cem-icon image="😊" ></cem-icon>
157
- <cem-icon image="😂" ></cem-icon><br/>
158
- <cem-icon image="⭐" ></cem-icon>
159
- <cem-icon image="🫶" ></cem-icon>
160
- <cem-icon image="🎁" ></cem-icon>
161
- <cem-icon image="✅" ></cem-icon>
162
- </template>
163
- </html-demo-element>
164
-
165
- <html-demo-element legend="Google Material icon font">
166
- <p slot="description">
167
- <cem-icon image="https://www.gstatic.com/images/icons/material/apps/fonts/1x/catalog/v5/favicon.svg"
168
- >Material Icon &bull; <a href="https://fonts.google.com/icons">Search all</a></cem-icon>
169
- </p>
170
- <template>
171
- <cem-icon image="recycling" > recycling</cem-icon>
172
- <cem-icon image="shopping_cart" > shopping_cart</cem-icon>
173
- <hr/>
174
- <cem-icon image="search" ></cem-icon>
175
- <cem-icon image="home" ></cem-icon>
176
- <cem-icon image="menu" ></cem-icon>
177
- <cem-icon image="close" ></cem-icon><br/>
178
- <cem-icon image="check_circle" ></cem-icon>
179
- <cem-icon image="favorite" ></cem-icon>
180
- <cem-icon image="add" ></cem-icon>
181
- <cem-icon image="star" ></cem-icon><br/>
182
- <cem-icon image="chevron_right" ></cem-icon>
183
- <cem-icon image="logout" ></cem-icon>
184
- <cem-icon image="add_circle" ></cem-icon>
185
- <cem-icon image="cancel" ></cem-icon>
186
- </template>
187
- </html-demo-element>
188
-
189
- <html-demo-element legend="Fontawesome">
190
- <p slot="description">
191
- <cem-icon image="https://fontawesome.com/images/favicon/icon.svg"
192
- >Fontawesome Icon &bull; <a href="https://fontawesome.com/icons/">Search all</a></cem-icon>
193
- </a>
194
- </p>
195
- <template>
196
- <cem-icon image="fab fa-github"> GitHub</cem-icon>
197
- <cem-icon image="fas fa-bookmark"> Bookmark</cem-icon>
198
- <cem-icon image="fab fa-discord"></cem-icon><hr/>
199
- <cem-icon image="fab fa-android"></cem-icon>
200
- <cem-icon image="fab fa-apple"></cem-icon>
201
- <cem-icon image="far fa-user"></cem-icon>
202
- <cem-icon image="far fa-envelope"></cem-icon><br/>
203
- <cem-icon image="fas fa-thumbs-up"></cem-icon>
204
- <cem-icon image="far fa-thumbs-down"></cem-icon>
205
- <cem-icon image="far fa-star"></cem-icon>
206
- <cem-icon image="fas fa-star"></cem-icon><br/>
207
- <cem-icon image="fas fa-location-arrow"></cem-icon>
208
- <cem-icon image="fas fa-map-marker"></cem-icon>
209
- <cem-icon image="fas fa-map-marked-alt"></cem-icon>
210
- <cem-icon image="fas fa-globe"></cem-icon>
211
-
212
- </template>
213
- </html-demo-element>
214
-
215
-
216
- <html-demo-element description="logo SVG with link to file in module"
217
- legend="Image from importmap module">
218
- <template>
219
- <custom-element>
220
- <template>
221
- <module-url slice="logo-url" src="@epa-wg/custom-element/demo/wc-square.svg"></module-url>
222
- <cem-icon image="{//logo-url}"> custom-element</cem-icon>
223
- <cem-icon image="https://unpkg.com/pokeapi-sprites@2.0.2/sprites/pokemon/other/dream-world/1.svg">
224
- bulbasaur
225
- </cem-icon>
226
- </template>
227
- </custom-element>
228
- </template>
229
- </html-demo-element>
230
-
231
-
232
- <html-demo-element legend="Color">
233
- <p slot="description">
234
- For font based icons the color is inherited from CSS text <code>color</code>.
235
- </p>
236
- <template>
237
- <cem-icon image="fas fa-heart" style="color:red" > red </cem-icon>
238
- <cem-icon image="fas fa-heart" style="color:green" > green </cem-icon>
239
- <cem-icon image="fas fa-heart" style="color:blue" > blue </cem-icon>
240
- </template>
241
- </html-demo-element>
242
-
243
-
244
- </main>
245
- <footer>
246
- <hr/>
247
- Powered by Syngrafact Corp. ©2024.<br/>
248
- <a href="../../LICENSE"> Code and documentation licensed under an Apache License 2.0 </a>
249
- </footer>
250
- <script src="https://unpkg.com/html-demo-element@1.0.8/html-demo-element.js" type="module"></script>
251
-
252
- </body>
1
+ <!DOCTYPE html>
2
+ <html lang="en" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
6
+ <title>Components - custom-element - Material Design</title>
7
+ <link href="../../custom-element/demo/wc-square.svg" rel="icon"/>
8
+ <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
9
+ <link crossorigin="anonymous" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css"
10
+ integrity="sha384-DyZ88mC6Up2uqS4h/KRgHuoeGwBcD4Ng9SiP4dIRy0EXTlnuz47vAwmeGwVChigm" rel="stylesheet"/>
11
+
12
+ <script type="importmap">
13
+ {
14
+ "imports": {
15
+ "@epa-wg/": "../../"
16
+ }
17
+ }
18
+ </script>
19
+ <script src="../../custom-element/module-url.js" type="module"></script>
20
+ <script src="../../custom-element/custom-element.js" type="module"></script>
21
+ <style>
22
+ @import "../angular.css";
23
+ @import "../material.css";
24
+ @import "../theme/semantic.css";
25
+ @import "../demo.css";
26
+ main{
27
+ display: flex; flex-wrap: wrap;
28
+ gap: 3rem;
29
+ padding: 5rem;
30
+ &>p{ min-width: 90%; }
31
+ html-demo-element
32
+ { overflow: visible;
33
+ [slot="legend"]{ border-radius: 1rem 1rem 0 0; }
34
+ [slot="description"]{ padding: 0 1rem 1rem 1rem; dd{ padding: 0 !important;margin: 0; }}
35
+ [slot="description"] dd{ padding: 0; }
36
+ }
37
+ var{ color: darkgreen; font-weight: bold; }
38
+ }
39
+ cem-icon{ margin: 1rem; }
40
+ </style>
41
+ </head>
42
+ <!--
43
+ ToDO
44
+ * docs w/ how to use
45
+ -->
46
+ <body>
47
+ <template id="cem-icon">
48
+ <attribute name="image"
49
+ aria-description="defines the icon in one of the libraries or URL. The selection algorithm
50
+ if value is single symbol, it is treated as unicode or emoji image
51
+ if value has a slash symbol (/), it is treated as URL for img< element
52
+ otherwise if value has a <code>fa-</code> substring, it is treated as favicon
53
+ otherwise if value is not empty, it is treated as material icon"
54
+ ></attribute>
55
+ <attribute name="size"
56
+ aria-description="Icon size. Default value is 'normal'. Values: normal|small|large"
57
+ ></attribute>
58
+ <attribute name="direction"
59
+ aria-description="defines css flex-direction. Default value is 'row'. Values: row|column"
60
+ ></attribute>
61
+ <style>
62
+ &[direction="column"]>*{ flex-direction: column; gap:0; }
63
+ &[direction="row" ]>*{ flex-direction: row; }
64
+ &[size="normal" ]>*>.icon{ height: var(--cem-icon-size); font-size: var(--cem-icon-size); }
65
+ &[size="small" ]>*>.icon{ height: var(--cem-icon-size-small); font-size: var(--cem-icon-size-small); }
66
+ &[size="large" ]>*>.icon{ height: var(--cem-icon-size-large); font-size: var(--cem-icon-size-large); }
67
+ &{ display: inline-flex; justify-content: center; }
68
+ &>* {
69
+ display: inline-flex; align-items: center; gap: calc( var(--cem-icon-size) / 4 );
70
+
71
+ .icon {
72
+ font-size: var(--cem-icon-size);
73
+ height: var(--cem-icon-size);
74
+ }
75
+ .unicode{position: relative; top:-25%; }
76
+ }
77
+ </style>
78
+
79
+ <choose>
80
+ <when test="string-length($image) &lt; 3"><b class="icon unicode">{$image}</b></when>
81
+ <when test="contains($image,'/')"><img alt="icon" class="icon" src="{$image}"/></when>
82
+ <when test="contains($image,'fa-')"><i class="icon {$image}"></i></when>
83
+ <when test="$image"><span class="icon material-icons">{$image}</span></when>
84
+ </choose>
85
+ <slot></slot>
86
+
87
+ </template>
88
+
89
+ <custom-element hidden src="#cem-icon" tag="cem-icon"></custom-element>
90
+ <custom-element hidden src="./icon-link.html#cem-icon-link" tag="cem-icon-link"></custom-element>
91
+
92
+ <header class="cem-theme-teal">
93
+ <custom-element src="../index.html#nav-head"></custom-element>
94
+ </header>
95
+ <main>
96
+ <aside>
97
+ <p><code>cem-icon</code> is an icon component from &lt;custom-element&gt; Material suite icons based on the
98
+ <a href="https://m3.material.io/styles/icons/designing-icons">Material Design specification for Icons</a>.<br/>
99
+ Icons are small symbols to easily identify actions and categories
100
+ </p>
101
+ <h1>Attributes</h1>
102
+ <div> <code>image</code> attribute defines the icon in one of the libraries or URL. The selection algorithm
103
+ <ol>
104
+ <li>if value is single symbol, it is treated as <var>unicode</var> or <var>emoji</var> image </li>
105
+ <li>if value has a slash symbol (<code>/</code>), it is treated as <var>URL</var> for <code>img</code> element </li>
106
+ <li>if value has a <code>fa-</code> substring, it is treated as <var>favicon</var> </li>
107
+ <li>if value is not empty, it is treated as <var>material icon</var> </li>
108
+
109
+ </ol>
110
+ </div>
111
+ <div> <code>direction</code> attribute defines css <code>row</code> or <code>column</code> flex-direction. </div>
112
+ </aside>
113
+ <section>
114
+ <html-demo-element legend="Direction attribute">
115
+ <p slot="description">
116
+ Defines the text position next to icon. Uses CSS <code>flex-direction</code> values.
117
+ </p>
118
+ <template>
119
+ <cem-icon image="»"> default is row </cem-icon>
120
+ <cem-icon image="home" direction="column"> column </cem-icon>
121
+ <cem-icon image="fas fa-bone" direction="row"> row </cem-icon>
122
+ </template>
123
+ </html-demo-element>
124
+
125
+
126
+ <html-demo-element legend="Size attribute">
127
+ <p slot="description">
128
+ Defines the icon size.
129
+ </p>
130
+ <template>
131
+ <cem-icon image="fas fa-heart" size="small"> small </cem-icon>
132
+ <cem-icon image="fas fa-heart" size="normal"> normal </cem-icon>
133
+ <cem-icon image="fas fa-heart" size="large"> large </cem-icon>
134
+ </template>
135
+ </html-demo-element>
136
+
137
+ </section>
138
+
139
+ <html-demo-element legend="Unicode or Emoji">
140
+ <p slot="description">
141
+ <cem-icon image="https://unicodeplus.com/favicon.ico"
142
+ ><a href="https://unicodeplus.com/search">Search Unicode</a> </cem-icon>
143
+ <cem-icon image="https://emojipedia.org/images/favicon-32x32.png"
144
+ ><a href="https://emojipedia.org/search?q=heart">Search Emoji</a></cem-icon>
145
+ </p>
146
+ <template>
147
+ <cem-icon image="🚀" > Rocket emoji </cem-icon>
148
+ <cem-icon image="👁" > Eye unicode </cem-icon>
149
+ <hr/>
150
+ <cem-icon image="🎄" ></cem-icon>
151
+ <cem-icon image="😭" ></cem-icon>
152
+ <cem-icon image="🔥" ></cem-icon>
153
+ <cem-icon image="💀" ></cem-icon><br/>
154
+ <cem-icon image="🛒" ></cem-icon>
155
+ <cem-icon image="✨" ></cem-icon>
156
+ <cem-icon image="😊" ></cem-icon>
157
+ <cem-icon image="😂" ></cem-icon><br/>
158
+ <cem-icon image="⭐" ></cem-icon>
159
+ <cem-icon image="🫶" ></cem-icon>
160
+ <cem-icon image="🎁" ></cem-icon>
161
+ <cem-icon image="✅" ></cem-icon>
162
+ </template>
163
+ </html-demo-element>
164
+
165
+ <html-demo-element legend="Google Material icon font">
166
+ <p slot="description">
167
+ <cem-icon image="https://www.gstatic.com/images/icons/material/apps/fonts/1x/catalog/v5/favicon.svg"
168
+ >Material Icon &bull; <a href="https://fonts.google.com/icons">Search all</a></cem-icon>
169
+ </p>
170
+ <template>
171
+ <cem-icon image="recycling" > recycling</cem-icon>
172
+ <cem-icon image="shopping_cart" > shopping_cart</cem-icon>
173
+ <hr/>
174
+ <cem-icon image="search" ></cem-icon>
175
+ <cem-icon image="home" ></cem-icon>
176
+ <cem-icon image="menu" ></cem-icon>
177
+ <cem-icon image="close" ></cem-icon><br/>
178
+ <cem-icon image="check_circle" ></cem-icon>
179
+ <cem-icon image="favorite" ></cem-icon>
180
+ <cem-icon image="add" ></cem-icon>
181
+ <cem-icon image="star" ></cem-icon><br/>
182
+ <cem-icon image="chevron_right" ></cem-icon>
183
+ <cem-icon image="logout" ></cem-icon>
184
+ <cem-icon image="add_circle" ></cem-icon>
185
+ <cem-icon image="cancel" ></cem-icon>
186
+ </template>
187
+ </html-demo-element>
188
+
189
+ <html-demo-element legend="Fontawesome">
190
+ <p slot="description">
191
+ <cem-icon image="https://fontawesome.com/images/favicon/icon.svg"
192
+ >Fontawesome Icon &bull; <a href="https://fontawesome.com/icons/">Search all</a></cem-icon>
193
+ </a>
194
+ </p>
195
+ <template>
196
+ <cem-icon image="fab fa-github"> GitHub</cem-icon>
197
+ <cem-icon image="fas fa-bookmark"> Bookmark</cem-icon>
198
+ <cem-icon image="fab fa-discord"></cem-icon><hr/>
199
+ <cem-icon image="fab fa-android"></cem-icon>
200
+ <cem-icon image="fab fa-apple"></cem-icon>
201
+ <cem-icon image="far fa-user"></cem-icon>
202
+ <cem-icon image="far fa-envelope"></cem-icon><br/>
203
+ <cem-icon image="fas fa-thumbs-up"></cem-icon>
204
+ <cem-icon image="far fa-thumbs-down"></cem-icon>
205
+ <cem-icon image="far fa-star"></cem-icon>
206
+ <cem-icon image="fas fa-star"></cem-icon><br/>
207
+ <cem-icon image="fas fa-location-arrow"></cem-icon>
208
+ <cem-icon image="fas fa-map-marker"></cem-icon>
209
+ <cem-icon image="fas fa-map-marked-alt"></cem-icon>
210
+ <cem-icon image="fas fa-globe"></cem-icon>
211
+
212
+ </template>
213
+ </html-demo-element>
214
+
215
+
216
+ <html-demo-element description="logo SVG with link to file in module"
217
+ legend="Image from importmap module">
218
+ <template>
219
+ <custom-element>
220
+ <template>
221
+ <module-url slice="logo-url" src="@epa-wg/custom-element/demo/wc-square.svg"></module-url>
222
+ <cem-icon image="{//logo-url}"> custom-element</cem-icon>
223
+ <cem-icon image="https://unpkg.com/pokeapi-sprites@2.0.2/sprites/pokemon/other/dream-world/1.svg">
224
+ bulbasaur
225
+ </cem-icon>
226
+ </template>
227
+ </custom-element>
228
+ </template>
229
+ </html-demo-element>
230
+
231
+
232
+ <html-demo-element legend="Color">
233
+ <p slot="description">
234
+ For font based icons the color is inherited from CSS text <code>color</code>.
235
+ </p>
236
+ <template>
237
+ <cem-icon image="fas fa-heart" style="color:red" > red </cem-icon>
238
+ <cem-icon image="fas fa-heart" style="color:green" > green </cem-icon>
239
+ <cem-icon image="fas fa-heart" style="color:blue" > blue </cem-icon>
240
+ </template>
241
+ </html-demo-element>
242
+
243
+
244
+ </main>
245
+ <footer>
246
+ <hr/>
247
+ <a href="../../LICENSE"> Code and documentation licensed under an Apache License 2.0 </a>
248
+ </footer>
249
+ <script src="https://unpkg.com/html-demo-element@1.0.8/html-demo-element.js" type="module"></script>
250
+
251
+ </body>
253
252
  </html>