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

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 (175) hide show
  1. package/.claude/settings.local.json +18 -0
  2. package/.github/workflows/deploy.yml +59 -0
  3. package/.idea/copilot.data.migration.agent.xml +6 -0
  4. package/.idea/copilot.data.migration.ask.xml +6 -0
  5. package/.idea/copilot.data.migration.edit.xml +6 -0
  6. package/.idea/custom-element-dist.iml +2 -0
  7. package/.storybook/main.ts +20 -17
  8. package/.storybook/preview.ts +23 -23
  9. package/README.md +6 -4
  10. package/coverage/block-navigation.js +1 -1
  11. package/coverage/coverage-final.json +4 -3
  12. package/coverage/index.html +34 -19
  13. package/coverage/sorter.js +21 -7
  14. package/coverage/src/custom-element/coverage.svg +1 -1
  15. package/coverage/src/custom-element/custom-element.js/coverage.svg +1 -1
  16. package/coverage/src/custom-element/custom-element.js.html +435 -378
  17. package/coverage/src/custom-element/http-request.js/coverage.svg +1 -1
  18. package/coverage/src/custom-element/http-request.js.html +38 -17
  19. package/coverage/src/custom-element/index.html +26 -26
  20. package/coverage/src/custom-element/local-storage.js.html +1 -1
  21. package/coverage/src/custom-element/location-element.js.html +1 -1
  22. package/coverage/src/custom-element/module-url.js.html +1 -1
  23. package/coverage/src/index.html +1 -1
  24. package/coverage/src/material/theme/colors.js/coverage.svg +10 -0
  25. package/coverage/src/material/theme/colors.js.html +217 -0
  26. package/coverage/src/material/theme/coverage.svg +10 -0
  27. package/coverage/src/material/theme/index.html +116 -0
  28. package/coverage/src/mocks/handlers.ts.html +1 -1
  29. package/coverage/src/mocks/index.html +1 -1
  30. package/coverage/src/stories/frame.canvas.ts.html +1 -1
  31. package/coverage/src/stories/http-request.stories.ts.html +1 -1
  32. package/coverage/src/stories/index.html +1 -1
  33. package/coverage/src/stories/testStoryBook.ts.html +12 -12
  34. package/coverage/src/sum.ts.html +1 -1
  35. package/dist/{custom-element-WnOqmEOe.js → custom-element-BoYMoUtP.js} +193 -183
  36. package/dist/custom-element-BqtjrCRF.cjs +97 -0
  37. package/dist/custom-element-bundle.cjs +1 -1
  38. package/dist/custom-element-bundle.js +3 -3
  39. package/dist/demo/a.html +10 -3
  40. package/dist/demo/a.svg +26 -26
  41. package/dist/demo/html-template.html +4 -3
  42. package/dist/demo/s.xml +3856 -67
  43. package/dist/demo/s.xslt +13 -72
  44. package/dist/demo/s1.xml +3706 -0
  45. package/dist/http-request-DSaowcG1.cjs +1 -0
  46. package/dist/{http-request-BOvP4KTl.js → http-request-DTCzZ1gc.js} +15 -9
  47. package/package.json +2 -2
  48. package/public/demo/a.html +10 -3
  49. package/public/demo/a.svg +26 -26
  50. package/public/demo/html-template.html +4 -3
  51. package/public/demo/s.xml +3856 -67
  52. package/public/demo/s.xslt +13 -72
  53. package/public/demo/s1.xml +3706 -0
  54. package/src/custom-element/custom-element.js +28 -9
  55. package/src/custom-element/demo/a.html +10 -3
  56. package/src/custom-element/demo/a.svg +26 -26
  57. package/src/custom-element/demo/html-template.html +4 -3
  58. package/src/custom-element/demo/s.xml +3856 -67
  59. package/src/custom-element/demo/s.xslt +13 -72
  60. package/src/custom-element/demo/s1.xml +3706 -0
  61. package/src/custom-element/http-request.js +7 -0
  62. package/src/custom-element/ide/web-types-dce.json +1 -1
  63. package/src/custom-element/ide/web-types-xsl.json +1 -1
  64. package/src/material/angular.css +987 -987
  65. package/src/material/components/action.html +262 -0
  66. package/src/material/components/autocomplete.html +167 -239
  67. package/src/material/components/badge.html +238 -239
  68. package/src/material/components/dropdown.html +0 -1
  69. package/src/material/components/icon-link.html +160 -161
  70. package/src/material/components/icon.html +251 -252
  71. package/src/material/components/input.html +569 -570
  72. package/src/material/components/menu.html +235 -236
  73. package/src/material/components.html +157 -158
  74. package/src/material/demo.css +36 -36
  75. package/src/material/index.html +109 -110
  76. package/src/material/material.css +356 -356
  77. package/src/material/theme/Base-Principles.md +339 -0
  78. package/src/material/theme/README.md +298 -18
  79. package/src/material/theme/UI Domain Model in web applications.svg +1 -0
  80. package/src/material/theme/User Semantic Theme tokens.svg +1 -0
  81. package/src/material/theme/action-pending-poc.html +62 -0
  82. package/src/material/theme/actions-color.html +141 -0
  83. package/src/material/theme/colors-light.html +631 -0
  84. package/src/material/theme/colors-native.html +51 -0
  85. package/src/material/theme/colors-poc.html +66 -0
  86. package/src/material/theme/colors.html +297 -0
  87. package/src/material/theme/colors.js +44 -0
  88. package/src/material/theme/consumer-theme.css +745 -0
  89. package/src/material/theme/semantic.css +132 -132
  90. package/src/material/theme/style-bug.html +123 -0
  91. package/src/material/theme/theme-data.css +43 -0
  92. package/src/material/theme/theme-data.xhtml +2926 -0
  93. package/src/material/theme/todo.md +274 -0
  94. package/src/material/theme/tokens/action-colors.png +0 -0
  95. package/src/material/theme/tokens/cem-article-illustration-4x1-letterbox-2000x500.png +0 -0
  96. package/src/material/theme/tokens/cem-breakpoints.md +519 -0
  97. package/src/material/theme/tokens/cem-colors.md +715 -0
  98. package/src/material/theme/tokens/cem-consumerflow-typography-matrix.svg +198 -0
  99. package/src/material/theme/tokens/cem-coupling.md +372 -0
  100. package/src/material/theme/tokens/cem-data-vs-reading-numerals.svg +164 -0
  101. package/src/material/theme/tokens/cem-dimension.md +625 -0
  102. package/src/material/theme/tokens/cem-layering.md +562 -0
  103. package/src/material/theme/tokens/cem-m3-parity.md +343 -0
  104. package/src/material/theme/tokens/cem-responsive.md +238 -0
  105. package/src/material/theme/tokens/cem-shape.md +691 -0
  106. package/src/material/theme/tokens/cem-stroke-density-illustration-4to1-v3.svg +102 -0
  107. package/src/material/theme/tokens/cem-stroke.md +480 -0
  108. package/src/material/theme/tokens/cem-timing.md +198 -0
  109. package/src/material/theme/tokens/cem-typography-model-stack.svg +64 -0
  110. package/src/material/theme/tokens/cem-voice-fonts-typography.md +718 -0
  111. package/src/material/theme/tokens/cem-voice-ladder.svg +91 -0
  112. package/src/material/theme/tokens/chips.png +0 -0
  113. package/src/material/theme/tokens/columns-page.png +0 -0
  114. package/src/material/theme/tokens/initials.png +0 -0
  115. package/src/material/theme/tokens/nav-buttons.png +0 -0
  116. package/src/material/theme/tokens/script.png +0 -0
  117. package/src/material/theme/tokens/sufler.png +0 -0
  118. package/src/material/theme/tokens/typography-icons.png +0 -0
  119. package/src/mocks/versions.mock.ts +1 -1
  120. package/src/stories/__screenshots__/dom-merge.test.stories.ts/dom-merge-dom-merge-OrderPreservingOn2ndTransform-1.png +0 -0
  121. package/src/stories/__screenshots__/xslt-conditionals.test.stories.ts/xslt-conditionals-xslt-conditionals-MultipleIfOrderingWorkaround-1.png +0 -0
  122. package/src/stories/dom-merge.test.stories.ts +25 -1
  123. package/src/stories/xslt-conditionals.test.stories.ts +492 -0
  124. package/src/stories/xslt-if.test.stories.ts +89 -0
  125. package/storybook-static/assets/{Color-F6OSRLHC-Cbp293x2.js → Color-F6OSRLHC-CzTOSlqB.js} +1 -1
  126. package/storybook-static/assets/{Configure-BrFr4SLE.js → Configure-7GqRsAoJ.js} +1 -1
  127. package/storybook-static/assets/{DocsRenderer-CFRXHY34-DhHzJiIO.js → DocsRenderer-CFRXHY34-Duc5rSIm.js} +2 -2
  128. package/storybook-static/assets/{attributes.test.stories-Gg9LQTEK.js → attributes.test.stories-DYuxF8h1.js} +1 -1
  129. package/storybook-static/assets/{css.test.stories-B_3ltOrx.js → css.test.stories-LOmvINyb.js} +1 -1
  130. package/storybook-static/assets/{custom-element-CPnvJnn8.js → custom-element-Bwx7otrT.js} +6 -6
  131. package/storybook-static/assets/{dom-merge.test.stories-nQxcgLoM.js → dom-merge.test.stories-CEKhWjaS.js} +47 -6
  132. package/storybook-static/assets/entry-preview-BNCt9WBs.js +26 -0
  133. package/storybook-static/assets/{entry-preview-docs-Dwczwtsc.js → entry-preview-docs-CbF8-81D.js} +2 -2
  134. package/storybook-static/assets/{external-template.test.stories-DZ-rjnfd.js → external-template.test.stories-jHu0wsJ-.js} +1 -1
  135. package/storybook-static/assets/{form.test.stories-DQhPYtMj.js → form.test.stories-CUyUnmwP.js} +1 -1
  136. package/storybook-static/assets/{frame.canvas-ClTqYyMN.js → frame.canvas-E5n9h6j1.js} +1 -1
  137. package/storybook-static/assets/{handlers-CLkps6Nz.js → handlers-F7GUfMqr.js} +1 -1
  138. package/storybook-static/assets/http-request-BWeEEBkP.js +1 -0
  139. package/storybook-static/assets/{http-request.stories-jo0f73nw.js → http-request.stories-wyX5-QOv.js} +1 -1
  140. package/storybook-static/assets/{iframe-CZwRpnn9.js → iframe-BS_DPWl0.js} +11 -11
  141. package/storybook-static/assets/{index-Dr4PwNfd.js → index-CGuyH0k-.js} +87 -87
  142. package/storybook-static/assets/{index-CJQtnF9V.js → index-DB7LLObI.js} +1 -1
  143. package/storybook-static/assets/index-DO1nmyvI.js +11 -0
  144. package/storybook-static/assets/{index-B68YUdzy.js → index-V1EGs-wm.js} +3 -3
  145. package/storybook-static/assets/{local-storage.test.stories-uA5EKRPf.js → local-storage.test.stories-BxOhsf1k.js} +1 -1
  146. package/storybook-static/assets/{location-element.test.stories-Cu-6Elcg.js → location-element.test.stories-DqhvvUoa.js} +1 -1
  147. package/storybook-static/assets/{module-url.test.stories-CD_wusXQ.js → module-url.test.stories-C1gG9G7Y.js} +1 -1
  148. package/storybook-static/assets/{preview-BFlNN3Wj.js → preview-Bn8igYMp.js} +1 -1
  149. package/storybook-static/assets/{preview-CuCH40jj.js → preview-Cwy1XFu2.js} +2 -2
  150. package/storybook-static/assets/{preview-Cm4PPhHS.js → preview-D6sehqkw.js} +1 -1
  151. package/storybook-static/assets/{set-url.test.stories-CY7B9BVZ.js → set-url.test.stories-BKQNdknJ.js} +1 -1
  152. package/storybook-static/assets/{slice-events.test.stories-BVnPXm6e.js → slice-events.test.stories-ChqULCeA.js} +1 -1
  153. package/storybook-static/assets/{slots.test.stories-Dxsa9KdA.js → slots.test.stories-BlyLoCRe.js} +1 -1
  154. package/storybook-static/assets/{version-select.test.stories-Buga1PAa.js → version-select.test.stories-CPGSh1tR.js} +1 -1
  155. package/storybook-static/assets/xslt-conditionals.test.stories-YC6QPqWZ.js +633 -0
  156. package/storybook-static/assets/xslt-if.test.stories-BRSWy2-x.js +71 -0
  157. package/storybook-static/demo/a.html +10 -3
  158. package/storybook-static/demo/a.svg +26 -26
  159. package/storybook-static/demo/html-template.html +4 -3
  160. package/storybook-static/demo/s.xml +3856 -67
  161. package/storybook-static/demo/s.xslt +13 -72
  162. package/storybook-static/demo/s1.xml +3706 -0
  163. package/storybook-static/iframe.html +2 -2
  164. package/storybook-static/index.json +1 -1
  165. package/storybook-static/project.json +1 -1
  166. package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +69 -66
  167. package/storybook-static/sb-addons/essentials-docs-3/manager-bundle.js +62 -59
  168. package/dist/custom-element-6slVaFEs.cjs +0 -97
  169. package/dist/http-request-DPrY7mGh.cjs +0 -1
  170. package/storybook-static/assets/attributes.test.stories-CzWkKw0e.js +0 -1
  171. package/storybook-static/assets/entry-preview-DHVXbf3x.js +0 -26
  172. package/storybook-static/assets/external-template.test.stories-BivZqBTp.js +0 -1
  173. package/storybook-static/assets/http-request-DNq59pnj.js +0 -1
  174. package/storybook-static/assets/index-BwkS7JH_.js +0 -8
  175. package/storybook-static/assets/module-url.test.stories-CTjUAk3J.js +0 -1
@@ -1,240 +1,239 @@
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
- html-demo-element { [slot="demo"] { display: flex; gap: 8rem; } } }
39
- flex-3x{ display: inline-flex; flex-wrap: wrap;gap:3rem; max-width:12rem;}
40
- </style>
41
- </head>
42
- <!--
43
- ToDO
44
- * docs w/ how to use
45
- -->
46
- <body>
47
- <template id="cem-badge">
48
- <attribute name="text"
49
- aria-description="Badge text content. Up to 4 characters including + sign."
50
- ></attribute>
51
- <attribute name="dot"
52
- aria-description="attribute defines the small dot presentation without visible text. Default 'true' "
53
- ></attribute>
54
- <attribute name="color"
55
- aria-description="semantic colors. Default is 'primary'. Values: primary|secondary|success|alert"
56
- ></attribute>
57
- <attribute name="align"
58
- aria-description="Vertical & horizontal align. Default is 'top right'. Values: top|middle|bottom|left|center|right"
59
- ></attribute>
60
- <attribute name="invisible"
61
- aria-description="Boolean. Default is 'false'. Values: true|false"
62
- ></attribute>
63
- <style>
64
- &[dot]>*>dd{ height: 0; width: 0; min-width: 0.5rem; color: transparent; padding: 0; min-height: 0.5rem; }
65
- &[invisible]>*>dd{ height: 0; width: 0; min-width: 0; color: transparent; padding: 0; min-height:0; }
66
- &[align~=left]>*>dd{ --cem-badge-align-h: -100%; }
67
- &[align~=center]>*>dd{ --cem-badge-align-h: -25%; }
68
- &[align~=right]>*>dd{ --cem-badge-align-h: 50%; }
69
- &[align~=top]>*>dd{ --cem-badge-align-v: -50%; }
70
- &[align~=middle]>*>dd{ --cem-badge-align-v: 25%; }
71
- &[align~=bottom]>*>dd{ --cem-badge-align-v: 75%; }
72
- &{ position: relative; display: inline-block; --cem-badge-align-v: -50%; --cem-badge-align-h: 50%; }
73
- &>*>dd{
74
- /*position: absolute; top:-0.5rem; border-radius: 0.5rem; */
75
- /*padding: 0.25rem; background-color: red;*/
76
- display: flex ;
77
- flex-direction: row;
78
- flex-wrap: wrap;
79
- -webkit-box-pack: center;
80
- justify-content: center;
81
- align-content: center;
82
- -webkit-box-align: center;
83
- align-items: center;
84
- position: absolute;
85
- box-sizing: border-box;
86
- font-family: Roboto, Helvetica, Arial, sans-serif;
87
- font-weight: 500;
88
- font-size: 0.75rem;
89
- min-width: 20px;
90
- line-height: 1;
91
- height: 20px;
92
- z-index: 1;
93
- background-color: var(--cem-badge-color, --cem-badge-color-primary);
94
- color: var(--cem-badge-text-color,rgb(255, 255, 255));
95
- top: 0;
96
- right: 0;
97
- transform: scale(1) translate(var(--cem-badge-align-h), var(--cem-badge-align-v));
98
- transform-origin: 100% 0%;
99
- padding: 0 6px;
100
- border-radius: 10px;
101
- border: var(--cem-badge-border, none);
102
- transition: all 225ms cubic-bezier(0.4, 0, 0.2, 1);
103
- }
104
- &[color="secondary"]>*>dd{ background-color: var(--cem-badge-color-secondary); }
105
- &[color="success"]>*>dd{ background-color: var(--cem-badge-color-success); }
106
- &[color="alert"]>*>dd{ background-color: var(--cem-badge-color-alert); }
107
-
108
- </style>
109
- <dd>{text}</dd>
110
- <slot></slot>
111
- </template>
112
-
113
- <custom-element hidden src="#cem-badge" tag="cem-badge"></custom-element>
114
- <custom-element hidden src="./icon-link.html#cem-badge-link" tag="cem-badge-link"></custom-element>
115
- <custom-element hidden src="./icon-link.html#cem-icon-link" tag="cem-icon-link"></custom-element>
116
- <custom-element hidden src="./icon.html#cem-icon" tag="cem-icon"></custom-element>
117
-
118
- <header class="cem-theme-teal">
119
- <custom-element src="../index.html#nav-head"></custom-element>
120
- </header>
121
- <main>
122
- <aside>
123
- <p><code>cem-badge</code> is badge component from &lt;custom-element&gt; Material suite based on the
124
- <a href="https://m3.material.io/components/badges/overview">Material Design specification for Badges</a>.<br/>
125
- Badges show notifications, counts, or status information on navigation items and icons.
126
- Inspired by <a href="https://mui.com/material-ui/react-badge/">MUI</a>
127
- </p>
128
- <h1>Attributes</h1>
129
- <div> <code>text</code> attribute defines the Up to 4 characters including + sign.</div>
130
- <div> <code>dot</code> attribute defines the small dot presentation without visible text. Default 'true'. </div>
131
- <div> <code>invisible</code> attribute hides badge. </div>
132
- <div> <code>align</code> attribute defines the vertical & horizontal align. Default is 'top right'. Values: top|middle|bottom|left|center|right. </div>
133
- </aside>
134
-
135
- <html-demo-element legend="Variations">
136
- <p slot="description">
137
-
138
- </p>
139
- <template>
140
- <cem-badge text="0" color="secondary"> <cem-icon image="far fa-envelope"></cem-icon> </cem-badge>
141
- <cem-badge text="999+" > <cem-icon image="🛒" vertical="middle"></cem-icon> </cem-badge>
142
- <cem-badge text="999+" dot > <cem-icon image="notifications" vertical="middle"></cem-icon> </cem-badge>
143
- </template>
144
- </html-demo-element>
145
-
146
- <html-demo-element legend="color attribute">
147
- <p slot="description">
148
- Semantic colors
149
- </p>
150
- <template>
151
- <cem-badge text="0" > <cem-icon image="✉"></cem-icon> </cem-badge>
152
- <cem-badge text="1" color="primary" > <cem-icon image="✉"></cem-icon> </cem-badge>
153
- <cem-badge text="2" color="secondary"> <cem-icon image="✉"></cem-icon> </cem-badge>
154
- <cem-badge text="3" color="success" > <cem-icon image="✉"></cem-icon> </cem-badge>
155
- <cem-badge text="4" color="alert" > <cem-icon image="✉"></cem-icon> </cem-badge>
156
- </template>
157
- </html-demo-element>
158
-
159
- <html-demo-element legend="custom color">
160
- <p slot="description">
161
- Override by CE
162
- </p>
163
- <template>
164
- <custom-element>
165
- <template>
166
- <style>
167
- &
168
- { --cem-badge-text-color:red;
169
- --cem-badge-color:#FF08;
170
- --cem-badge-border: 1px blue solid;
171
- cem-badge dd{box-shadow: -2px 3px 8px blue;}
172
- }
173
- </style>
174
- <cem-badge text="123"> CUSTOM COLOR </cem-badge>
175
- </template>
176
- </custom-element>
177
- </template>
178
- </html-demo-element>
179
-
180
-
181
- <html-demo-element legend="invisible attribute">
182
- <p slot="description">
183
- hides badge, animated
184
- </p>
185
- <template>
186
- <custom-element>
187
- <template>
188
- <label>
189
- <input type="checkbox" slice="is-checked" value="on" />
190
- invisible</label>
191
- <cem-badge text="1" >
192
- <if test="/datadom/slice/is-checked = 'on'">
193
- <attribute name="invisible">on</attribute>
194
- </if>
195
- <cem-icon image="mail" ></cem-icon>
196
- </cem-badge>
197
- &nbsp;
198
- <cem-badge dot>
199
- <if test="/datadom/slice/is-checked = 'on'">
200
- <attribute name="invisible">on</attribute>
201
- </if>
202
- <cem-icon image="mail" ></cem-icon>
203
- </cem-badge>
204
- </template>
205
- </custom-element>
206
- </template>
207
- </html-demo-element>
208
-
209
- <html-demo-element legend="align attribute">
210
- <p slot="description">
211
- sets vertical( top, middle, bottom ) and horizontal( left, center, right) badge align.<br/>
212
- Default is right top.
213
- </p>
214
- <template>
215
- <flex-3x>
216
- <cem-badge text="1" align="left top" ><cem-icon image="mail" ></cem-icon></cem-badge>
217
- <cem-badge text="2" align="center top" ><cem-icon image="mail" ></cem-icon></cem-badge>
218
- <cem-badge text="3" align="right top" ><cem-icon image="mail" ></cem-icon></cem-badge>
219
-
220
- <cem-badge text="4" align="left middle" ><cem-icon image="mail" ></cem-icon></cem-badge>
221
- <cem-badge text="5" align="center middle" ><cem-icon image="mail" ></cem-icon></cem-badge>
222
- <cem-badge text="6" align="right middle" ><cem-icon image="mail" ></cem-icon></cem-badge>
223
-
224
- <cem-badge text="7" align="left bottom" ><cem-icon image="mail" ></cem-icon></cem-badge>
225
- <cem-badge text="8" align="center bottom" ><cem-icon image="mail" ></cem-icon></cem-badge>
226
- <cem-badge text="9" align="right bottom" ><cem-icon image="mail" ></cem-icon></cem-badge>
227
- </flex-3x>
228
- </template>
229
- </html-demo-element>
230
-
231
- </main>
232
- <footer>
233
- <hr/>
234
- Powered by Syngrafact Corp. ©2024.<br/>
235
- <a href="../../LICENSE"> Code and documentation licensed under an Apache License 2.0 </a>
236
- </footer>
237
- <script src="https://unpkg.com/html-demo-element@1.0.8/html-demo-element.js" type="module"></script>
238
-
239
- </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
+ html-demo-element { [slot="demo"] { display: flex; gap: 8rem; } } }
39
+ flex-3x{ display: inline-flex; flex-wrap: wrap;gap:3rem; max-width:12rem;}
40
+ </style>
41
+ </head>
42
+ <!--
43
+ ToDO
44
+ * docs w/ how to use
45
+ -->
46
+ <body>
47
+ <template id="cem-badge">
48
+ <attribute name="text"
49
+ aria-description="Badge text content. Up to 4 characters including + sign."
50
+ ></attribute>
51
+ <attribute name="dot"
52
+ aria-description="attribute defines the small dot presentation without visible text. Default 'true' "
53
+ ></attribute>
54
+ <attribute name="color"
55
+ aria-description="semantic colors. Default is 'primary'. Values: primary|secondary|success|alert"
56
+ ></attribute>
57
+ <attribute name="align"
58
+ aria-description="Vertical & horizontal align. Default is 'top right'. Values: top|middle|bottom|left|center|right"
59
+ ></attribute>
60
+ <attribute name="invisible"
61
+ aria-description="Boolean. Default is 'false'. Values: true|false"
62
+ ></attribute>
63
+ <style>
64
+ &[dot]>*>dd{ height: 0; width: 0; min-width: 0.5rem; color: transparent; padding: 0; min-height: 0.5rem; }
65
+ &[invisible]>*>dd{ height: 0; width: 0; min-width: 0; color: transparent; padding: 0; min-height:0; }
66
+ &[align~=left]>*>dd{ --cem-badge-align-h: -100%; }
67
+ &[align~=center]>*>dd{ --cem-badge-align-h: -25%; }
68
+ &[align~=right]>*>dd{ --cem-badge-align-h: 50%; }
69
+ &[align~=top]>*>dd{ --cem-badge-align-v: -50%; }
70
+ &[align~=middle]>*>dd{ --cem-badge-align-v: 25%; }
71
+ &[align~=bottom]>*>dd{ --cem-badge-align-v: 75%; }
72
+ &{ position: relative; display: inline-block; --cem-badge-align-v: -50%; --cem-badge-align-h: 50%; }
73
+ &>*>dd{
74
+ /*position: absolute; top:-0.5rem; border-radius: 0.5rem; */
75
+ /*padding: 0.25rem; background-color: red;*/
76
+ display: flex ;
77
+ flex-direction: row;
78
+ flex-wrap: wrap;
79
+ -webkit-box-pack: center;
80
+ justify-content: center;
81
+ align-content: center;
82
+ -webkit-box-align: center;
83
+ align-items: center;
84
+ position: absolute;
85
+ box-sizing: border-box;
86
+ font-family: Roboto, Helvetica, Arial, sans-serif;
87
+ font-weight: 500;
88
+ font-size: 0.75rem;
89
+ min-width: 20px;
90
+ line-height: 1;
91
+ height: 20px;
92
+ z-index: 1;
93
+ background-color: var(--cem-badge-color, --cem-badge-color-primary);
94
+ color: var(--cem-badge-text-color,rgb(255, 255, 255));
95
+ top: 0;
96
+ right: 0;
97
+ transform: scale(1) translate(var(--cem-badge-align-h), var(--cem-badge-align-v));
98
+ transform-origin: 100% 0%;
99
+ padding: 0 6px;
100
+ border-radius: 10px;
101
+ border: var(--cem-badge-border, none);
102
+ transition: all 225ms cubic-bezier(0.4, 0, 0.2, 1);
103
+ }
104
+ &[color="secondary"]>*>dd{ background-color: var(--cem-badge-color-secondary); }
105
+ &[color="success"]>*>dd{ background-color: var(--cem-badge-color-success); }
106
+ &[color="alert"]>*>dd{ background-color: var(--cem-badge-color-alert); }
107
+
108
+ </style>
109
+ <dd>{text}</dd>
110
+ <slot></slot>
111
+ </template>
112
+
113
+ <custom-element hidden src="#cem-badge" tag="cem-badge"></custom-element>
114
+ <custom-element hidden src="./icon-link.html#cem-badge-link" tag="cem-badge-link"></custom-element>
115
+ <custom-element hidden src="./icon-link.html#cem-icon-link" tag="cem-icon-link"></custom-element>
116
+ <custom-element hidden src="./icon.html#cem-icon" tag="cem-icon"></custom-element>
117
+
118
+ <header class="cem-theme-teal">
119
+ <custom-element src="../index.html#nav-head"></custom-element>
120
+ </header>
121
+ <main>
122
+ <aside>
123
+ <p><code>cem-badge</code> is badge component from &lt;custom-element&gt; Material suite based on the
124
+ <a href="https://m3.material.io/components/badges/overview">Material Design specification for Badges</a>.<br/>
125
+ Badges show notifications, counts, or status information on navigation items and icons.
126
+ Inspired by <a href="https://mui.com/material-ui/react-badge/">MUI</a>
127
+ </p>
128
+ <h1>Attributes</h1>
129
+ <div> <code>text</code> attribute defines the Up to 4 characters including + sign.</div>
130
+ <div> <code>dot</code> attribute defines the small dot presentation without visible text. Default 'true'. </div>
131
+ <div> <code>invisible</code> attribute hides badge. </div>
132
+ <div> <code>align</code> attribute defines the vertical & horizontal align. Default is 'top right'. Values: top|middle|bottom|left|center|right. </div>
133
+ </aside>
134
+
135
+ <html-demo-element legend="Variations">
136
+ <p slot="description">
137
+
138
+ </p>
139
+ <template>
140
+ <cem-badge text="0" color="secondary"> <cem-icon image="far fa-envelope"></cem-icon> </cem-badge>
141
+ <cem-badge text="999+" > <cem-icon image="🛒" vertical="middle"></cem-icon> </cem-badge>
142
+ <cem-badge text="999+" dot > <cem-icon image="notifications" vertical="middle"></cem-icon> </cem-badge>
143
+ </template>
144
+ </html-demo-element>
145
+
146
+ <html-demo-element legend="color attribute">
147
+ <p slot="description">
148
+ Semantic colors
149
+ </p>
150
+ <template>
151
+ <cem-badge text="0" > <cem-icon image="✉"></cem-icon> </cem-badge>
152
+ <cem-badge text="1" color="primary" > <cem-icon image="✉"></cem-icon> </cem-badge>
153
+ <cem-badge text="2" color="secondary"> <cem-icon image="✉"></cem-icon> </cem-badge>
154
+ <cem-badge text="3" color="success" > <cem-icon image="✉"></cem-icon> </cem-badge>
155
+ <cem-badge text="4" color="alert" > <cem-icon image="✉"></cem-icon> </cem-badge>
156
+ </template>
157
+ </html-demo-element>
158
+
159
+ <html-demo-element legend="custom color">
160
+ <p slot="description">
161
+ Override by CE
162
+ </p>
163
+ <template>
164
+ <custom-element>
165
+ <template>
166
+ <style>
167
+ &
168
+ { --cem-badge-text-color:red;
169
+ --cem-badge-color:#FF08;
170
+ --cem-badge-border: 1px blue solid;
171
+ cem-badge dd{box-shadow: -2px 3px 8px blue;}
172
+ }
173
+ </style>
174
+ <cem-badge text="123"> CUSTOM COLOR </cem-badge>
175
+ </template>
176
+ </custom-element>
177
+ </template>
178
+ </html-demo-element>
179
+
180
+
181
+ <html-demo-element legend="invisible attribute">
182
+ <p slot="description">
183
+ hides badge, animated
184
+ </p>
185
+ <template>
186
+ <custom-element>
187
+ <template>
188
+ <label>
189
+ <input type="checkbox" slice="is-checked" value="on" />
190
+ invisible</label>
191
+ <cem-badge text="1" >
192
+ <if test="/datadom/slice/is-checked = 'on'">
193
+ <attribute name="invisible">on</attribute>
194
+ </if>
195
+ <cem-icon image="mail" ></cem-icon>
196
+ </cem-badge>
197
+ &nbsp;
198
+ <cem-badge dot>
199
+ <if test="/datadom/slice/is-checked = 'on'">
200
+ <attribute name="invisible">on</attribute>
201
+ </if>
202
+ <cem-icon image="mail" ></cem-icon>
203
+ </cem-badge>
204
+ </template>
205
+ </custom-element>
206
+ </template>
207
+ </html-demo-element>
208
+
209
+ <html-demo-element legend="align attribute">
210
+ <p slot="description">
211
+ sets vertical( top, middle, bottom ) and horizontal( left, center, right) badge align.<br/>
212
+ Default is right top.
213
+ </p>
214
+ <template>
215
+ <flex-3x>
216
+ <cem-badge text="1" align="left top" ><cem-icon image="mail" ></cem-icon></cem-badge>
217
+ <cem-badge text="2" align="center top" ><cem-icon image="mail" ></cem-icon></cem-badge>
218
+ <cem-badge text="3" align="right top" ><cem-icon image="mail" ></cem-icon></cem-badge>
219
+
220
+ <cem-badge text="4" align="left middle" ><cem-icon image="mail" ></cem-icon></cem-badge>
221
+ <cem-badge text="5" align="center middle" ><cem-icon image="mail" ></cem-icon></cem-badge>
222
+ <cem-badge text="6" align="right middle" ><cem-icon image="mail" ></cem-icon></cem-badge>
223
+
224
+ <cem-badge text="7" align="left bottom" ><cem-icon image="mail" ></cem-icon></cem-badge>
225
+ <cem-badge text="8" align="center bottom" ><cem-icon image="mail" ></cem-icon></cem-badge>
226
+ <cem-badge text="9" align="right bottom" ><cem-icon image="mail" ></cem-icon></cem-badge>
227
+ </flex-3x>
228
+ </template>
229
+ </html-demo-element>
230
+
231
+ </main>
232
+ <footer>
233
+ <hr/>
234
+ <a href="../../LICENSE"> Code and documentation licensed under an Apache License 2.0 </a>
235
+ </footer>
236
+ <script src="https://unpkg.com/html-demo-element@1.0.8/html-demo-element.js" type="module"></script>
237
+
238
+ </body>
240
239
  </html>
@@ -165,7 +165,6 @@
165
165
  </main>
166
166
  <footer>
167
167
  <hr/>
168
- Powered by Syngrafact Corp. ©2024.<br/>
169
168
  <a href="../../LICENSE"> Code and documentation licensed under an Apache License 2.0 </a>
170
169
  </footer>
171
170
  <script src="https://unpkg.com/html-demo-element@1/html-demo-element.js" type="module"></script>