@universal-material/web 3.0.8 → 3.0.10

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 (364) hide show
  1. package/.editorconfig +8 -0
  2. package/.eleventy.cjs +21 -0
  3. package/.eslintignore +6 -0
  4. package/.eslintrc.json +98 -0
  5. package/.prettierrc.json +7 -0
  6. package/.vscode/extensions.json +9 -0
  7. package/CHANGELOG.md +98 -0
  8. package/LICENSE +28 -0
  9. package/docs/.nojekyll +0 -0
  10. package/docs/api/index.html +149 -0
  11. package/docs/docs.css +185 -0
  12. package/docs/examples/index.html +75 -0
  13. package/docs/examples/name-property/index.html +65 -0
  14. package/docs/index.html +75 -0
  15. package/docs/install/index.html +53 -0
  16. package/docs/prism-okaidia.css +123 -0
  17. package/docs/src/_api-section.pug +27 -0
  18. package/docs/src/_layout.pug +182 -0
  19. package/docs/src/components/button-set/alignment.html +29 -0
  20. package/docs/src/components/button-set/stack.html +5 -0
  21. package/docs/src/components/button-set/usage.html +35 -0
  22. package/docs/src/components/button-set.pug +16 -0
  23. package/docs/src/components/cards/card-media.html +39 -0
  24. package/docs/src/components/cards/card-with-actions.html +38 -0
  25. package/docs/src/components/cards/simple-card.html +3 -0
  26. package/docs/src/components/cards.pug +15 -0
  27. package/docs/src/components/checkbox/usage.html +33 -0
  28. package/docs/src/components/checkbox.pug +7 -0
  29. package/docs/src/components/chips/chip-input.html +73 -0
  30. package/docs/src/components/chips/default-chips.html +25 -0
  31. package/docs/src/components/chips/elevated-chips.html +25 -0
  32. package/docs/src/components/chips/selected-chips.html +50 -0
  33. package/docs/src/components/chips.pug +16 -0
  34. package/docs/src/components/common-buttons/anchor-buttons.html +6 -0
  35. package/docs/src/components/common-buttons/buttons-icons.html +24 -0
  36. package/docs/src/components/common-buttons/buttons-trailing-icons.html +25 -0
  37. package/docs/src/components/common-buttons/buttons-variants.html +6 -0
  38. package/docs/src/components/common-buttons/filled-colors.html +4 -0
  39. package/docs/src/components/common-buttons.pug +22 -0
  40. package/docs/src/components/data-tables/simple-table.html +47 -0
  41. package/docs/src/components/data-tables/table-footer.html +59 -0
  42. package/docs/src/components/data-tables/table-header.html +43 -0
  43. package/docs/src/components/data-tables.pug +15 -0
  44. package/docs/src/components/datepicker.pug +133 -0
  45. package/docs/src/components/dialogs/example.html +44 -0
  46. package/docs/src/components/dialogs.pug +19 -0
  47. package/docs/src/components/dividers/no-margin.html +7 -0
  48. package/docs/src/components/dividers/usage.html +7 -0
  49. package/docs/src/components/dividers.pug +13 -0
  50. package/docs/src/components/dropdown-menus/down-end.html +10 -0
  51. package/docs/src/components/dropdown-menus/down-left.html +10 -0
  52. package/docs/src/components/dropdown-menus/down-right.html +10 -0
  53. package/docs/src/components/dropdown-menus/down-start.html +10 -0
  54. package/docs/src/components/dropdown-menus/down.html +10 -0
  55. package/docs/src/components/dropdown-menus/up-end.html +10 -0
  56. package/docs/src/components/dropdown-menus/up-left.html +10 -0
  57. package/docs/src/components/dropdown-menus/up-right.html +10 -0
  58. package/docs/src/components/dropdown-menus/up-start.html +10 -0
  59. package/docs/src/components/dropdown-menus/up.html +10 -0
  60. package/docs/src/components/expansion-panel.pug +33 -0
  61. package/docs/src/components/fab/button-colors.html +18 -0
  62. package/docs/src/components/fab/button-sizes.html +11 -0
  63. package/docs/src/components/fab/extended-buttons.html +18 -0
  64. package/docs/src/components/fab/floating-action-area.html +5 -0
  65. package/docs/src/components/fab/floating-menu.html +10 -0
  66. package/docs/src/components/fab/lowered-buttons.html +6 -0
  67. package/docs/src/components/fab.pug +25 -0
  68. package/docs/src/components/icon-buttons/anchor-buttons.html +15 -0
  69. package/docs/src/components/icon-buttons/buttons-variants.html +15 -0
  70. package/docs/src/components/icon-buttons/toggle-buttons-manual.html +44 -0
  71. package/docs/src/components/icon-buttons/toggle-buttons.html +48 -0
  72. package/docs/src/components/icon-buttons.pug +18 -0
  73. package/docs/src/components/lists/list-avatars.html +14 -0
  74. package/docs/src/components/lists/list-custom-dividers.html +23 -0
  75. package/docs/src/components/lists/list-dividers.html +17 -0
  76. package/docs/src/components/lists/list-dynamic.html +26 -0
  77. package/docs/src/components/lists/list-hover.html +17 -0
  78. package/docs/src/components/lists/list-icons.html +17 -0
  79. package/docs/src/components/lists/list-indexed.html +123 -0
  80. package/docs/src/components/lists/list-sections.html +16 -0
  81. package/docs/src/components/lists/list-three-lines.html +20 -0
  82. package/docs/src/components/lists/list-two-lines.html +20 -0
  83. package/docs/src/components/lists/list-with-action.html +26 -0
  84. package/docs/src/components/lists/list-with-activated-item.html +17 -0
  85. package/docs/src/components/lists/simple-list.html +17 -0
  86. package/docs/src/components/lists.pug +94 -0
  87. package/docs/src/components/menus.pug +55 -0
  88. package/docs/src/components/progress/circular-progress.html +13 -0
  89. package/docs/src/components/progress/determinate-progress.html +3 -0
  90. package/docs/src/components/progress/indeterminate-progress.html +3 -0
  91. package/docs/src/components/progress/progress-color.html +3 -0
  92. package/docs/src/components/progress.pug +18 -0
  93. package/docs/src/components/ripple/usage.html +9 -0
  94. package/docs/src/components/ripple.pug +10 -0
  95. package/docs/src/components/selection-controls/checkbox.html +22 -0
  96. package/docs/src/components/selection-controls/radio-button.html +36 -0
  97. package/docs/src/components/selection-controls/switch.html +12 -0
  98. package/docs/src/components/selection-controls.pug +13 -0
  99. package/docs/src/components/sliders/example.html +42 -0
  100. package/docs/src/components/sliders.pug +7 -0
  101. package/docs/src/components/snackbar/example.html +35 -0
  102. package/docs/src/components/snackbars.pug +21 -0
  103. package/docs/src/components/steppers.pug +57 -0
  104. package/docs/src/components/tabs/example.html +45 -0
  105. package/docs/src/components/tabs.pug +8 -0
  106. package/docs/src/components/text-fields.pug +88 -0
  107. package/docs/src/components/toolbars/simple-toolbar.html +33 -0
  108. package/docs/src/components/toolbars.pug +7 -0
  109. package/docs/src/content/typography/example.html +15 -0
  110. package/docs/src/content/typography.pug +8 -0
  111. package/docs/src/css/docs.scss +189 -0
  112. package/docs/src/index.pug +10 -0
  113. package/docs/src/js/docs.js +161 -0
  114. package/docs/src/js/universal-material.js +757 -0
  115. package/docs/src/js/universal-material.js.map +1 -0
  116. package/docs/src/js/universal-material.min.js +17 -0
  117. package/docs/src/js/universal-material.min.js.map +1 -0
  118. package/docs/src/layout/grid.pug +15 -0
  119. package/docs/src/utilities/background-colors/common-colors.html +7 -0
  120. package/docs/src/utilities/background-colors/theme-colors.html +16 -0
  121. package/docs/src/utilities/background-colors.pug +10 -0
  122. package/docs/src/utilities/text-and-background-colors/common-colors.html +80 -0
  123. package/docs/src/utilities/text-and-background-colors/theme-colors.html +208 -0
  124. package/docs/src/utilities/text-and-background-colors.pug +10 -0
  125. package/docs/src/utilities/text-colors/common-colors.html +12 -0
  126. package/docs/src/utilities/text-colors/emphasis-colors.html +26 -0
  127. package/docs/src/utilities/text-colors/theme-colors.html +37 -0
  128. package/docs/src/utilities/text-colors.pug +13 -0
  129. package/gulpfile.js +225 -0
  130. package/index.html +11 -0
  131. package/package.json +1 -1
  132. package/rollup.config.js +42 -0
  133. package/src/_utils.scss +20 -0
  134. package/src/_variables.scss +68 -0
  135. package/src/button/button-base.styles.scss +75 -0
  136. package/src/button/button-base.ts +147 -0
  137. package/src/button/button-set.styles.scss +35 -0
  138. package/src/button/button-set.ts +33 -0
  139. package/src/button/button.styles.scss +97 -0
  140. package/src/button/button.ts +64 -0
  141. package/src/button/fab.styles.scss +90 -0
  142. package/src/button/fab.ts +55 -0
  143. package/src/button/icon-button.styles.scss +74 -0
  144. package/src/button/icon-button.ts +72 -0
  145. package/src/card/card-content.styles.scss +11 -0
  146. package/src/card/card-content.ts +45 -0
  147. package/src/card/card-media.styles.scss +9 -0
  148. package/src/card/card-media.ts +24 -0
  149. package/src/card/card.styles.scss +27 -0
  150. package/src/card/card.ts +37 -0
  151. package/src/checkbox/checkbox.ts +77 -0
  152. package/src/container/container.styles.scss +39 -0
  153. package/src/container/container.ts +24 -0
  154. package/src/divider/divider.styles.scss +13 -0
  155. package/src/divider/divider.ts +21 -0
  156. package/src/elevation/elevation.styles.scss +31 -0
  157. package/src/elevation/elevation.ts +17 -0
  158. package/{index.js → src/index.ts} +1 -1
  159. package/src/ripple/ripple.styles.scss +80 -0
  160. package/src/ripple/ripple.ts +150 -0
  161. package/src/shared/base.styles.scss +5 -0
  162. package/src/table/table-body.styles.scss +9 -0
  163. package/src/table/table-body.ts +21 -0
  164. package/src/table/table-cell.styles.scss +9 -0
  165. package/src/table/table-cell.ts +21 -0
  166. package/src/table/table-head.styles.scss +9 -0
  167. package/src/table/table-head.ts +21 -0
  168. package/src/table/table-header-cell.styles.scss +10 -0
  169. package/src/table/table-header-cell.ts +21 -0
  170. package/src/table/table-row.styles.scss +3 -0
  171. package/src/table/table-row.ts +21 -0
  172. package/src/table/table.styles.scss +12 -0
  173. package/{table/table.js → src/table/table.ts} +15 -6
  174. package/src/theme/color.ts +6 -0
  175. package/src/theme/css-var-builder.ts +36 -0
  176. package/{theme/index.js → src/theme/index.ts} +0 -1
  177. package/src/theme/neutral-colors.ts +21 -0
  178. package/src/theme/rgb-color.ts +19 -0
  179. package/src/theme/theme-builder.ts +201 -0
  180. package/{theme/theme-color.d.ts → src/theme/theme-color.ts} +3 -2
  181. package/tsconfig.json +36 -0
  182. package/web-dev-server.config.js +25 -0
  183. package/web-test-runner.config.js +120 -0
  184. package/button/button-base.d.ts +0 -43
  185. package/button/button-base.d.ts.map +0 -1
  186. package/button/button-base.js +0 -152
  187. package/button/button-base.js.map +0 -1
  188. package/button/button-base.styles.d.ts +0 -2
  189. package/button/button-base.styles.d.ts.map +0 -1
  190. package/button/button-base.styles.js +0 -75
  191. package/button/button-base.styles.js.map +0 -1
  192. package/button/button-set.d.ts +0 -20
  193. package/button/button-set.d.ts.map +0 -1
  194. package/button/button-set.js +0 -38
  195. package/button/button-set.js.map +0 -1
  196. package/button/button-set.styles.d.ts +0 -2
  197. package/button/button-set.styles.d.ts.map +0 -1
  198. package/button/button-set.styles.js +0 -39
  199. package/button/button-set.styles.js.map +0 -1
  200. package/button/button.d.ts +0 -34
  201. package/button/button.d.ts.map +0 -1
  202. package/button/button.js +0 -64
  203. package/button/button.js.map +0 -1
  204. package/button/button.styles.d.ts +0 -2
  205. package/button/button.styles.d.ts.map +0 -1
  206. package/button/button.styles.js +0 -96
  207. package/button/button.styles.js.map +0 -1
  208. package/button/fab.d.ts +0 -31
  209. package/button/fab.d.ts.map +0 -1
  210. package/button/fab.js +0 -63
  211. package/button/fab.js.map +0 -1
  212. package/button/fab.styles.d.ts +0 -2
  213. package/button/fab.styles.d.ts.map +0 -1
  214. package/button/fab.styles.js +0 -89
  215. package/button/fab.styles.js.map +0 -1
  216. package/button/icon-button.d.ts +0 -35
  217. package/button/icon-button.d.ts.map +0 -1
  218. package/button/icon-button.js +0 -79
  219. package/button/icon-button.js.map +0 -1
  220. package/button/icon-button.styles.d.ts +0 -2
  221. package/button/icon-button.styles.d.ts.map +0 -1
  222. package/button/icon-button.styles.js +0 -70
  223. package/button/icon-button.styles.js.map +0 -1
  224. package/card/card-content.d.ts +0 -13
  225. package/card/card-content.d.ts.map +0 -1
  226. package/card/card-content.js +0 -44
  227. package/card/card-content.js.map +0 -1
  228. package/card/card-content.styles.d.ts +0 -2
  229. package/card/card-content.styles.d.ts.map +0 -1
  230. package/card/card-content.styles.js +0 -15
  231. package/card/card-content.styles.js.map +0 -1
  232. package/card/card-media.d.ts +0 -12
  233. package/card/card-media.d.ts.map +0 -1
  234. package/card/card-media.js +0 -29
  235. package/card/card-media.js.map +0 -1
  236. package/card/card-media.styles.d.ts +0 -2
  237. package/card/card-media.styles.d.ts.map +0 -1
  238. package/card/card-media.styles.js +0 -13
  239. package/card/card-media.styles.js.map +0 -1
  240. package/card/card.d.ts +0 -19
  241. package/card/card.d.ts.map +0 -1
  242. package/card/card.js +0 -40
  243. package/card/card.js.map +0 -1
  244. package/card/card.styles.d.ts +0 -2
  245. package/card/card.styles.d.ts.map +0 -1
  246. package/card/card.styles.js +0 -28
  247. package/card/card.styles.js.map +0 -1
  248. package/checkbox/checkbox.d.ts +0 -16
  249. package/checkbox/checkbox.d.ts.map +0 -1
  250. package/checkbox/checkbox.js +0 -75
  251. package/checkbox/checkbox.js.map +0 -1
  252. package/container/container.d.ts +0 -13
  253. package/container/container.d.ts.map +0 -1
  254. package/container/container.js +0 -23
  255. package/container/container.js.map +0 -1
  256. package/container/container.styles.d.ts +0 -2
  257. package/container/container.styles.d.ts.map +0 -1
  258. package/container/container.styles.js +0 -43
  259. package/container/container.styles.js.map +0 -1
  260. package/custom-elements.json +0 -3706
  261. package/divider/divider.d.ts +0 -14
  262. package/divider/divider.d.ts.map +0 -1
  263. package/divider/divider.js +0 -27
  264. package/divider/divider.js.map +0 -1
  265. package/divider/divider.styles.d.ts +0 -2
  266. package/divider/divider.styles.d.ts.map +0 -1
  267. package/divider/divider.styles.js +0 -15
  268. package/divider/divider.styles.js.map +0 -1
  269. package/elevation/elevation.d.ts +0 -11
  270. package/elevation/elevation.d.ts.map +0 -1
  271. package/elevation/elevation.js +0 -21
  272. package/elevation/elevation.js.map +0 -1
  273. package/elevation/elevation.styles.d.ts +0 -2
  274. package/elevation/elevation.styles.d.ts.map +0 -1
  275. package/elevation/elevation.styles.js +0 -28
  276. package/elevation/elevation.styles.js.map +0 -1
  277. package/index.d.ts +0 -27
  278. package/index.d.ts.map +0 -1
  279. package/index.js.map +0 -1
  280. package/ripple/ripple.d.ts +0 -25
  281. package/ripple/ripple.d.ts.map +0 -1
  282. package/ripple/ripple.js +0 -119
  283. package/ripple/ripple.js.map +0 -1
  284. package/ripple/ripple.styles.d.ts +0 -2
  285. package/ripple/ripple.styles.d.ts.map +0 -1
  286. package/ripple/ripple.styles.js +0 -74
  287. package/ripple/ripple.styles.js.map +0 -1
  288. package/shared/base.styles.d.ts +0 -2
  289. package/shared/base.styles.d.ts.map +0 -1
  290. package/shared/base.styles.js +0 -9
  291. package/shared/base.styles.js.map +0 -1
  292. package/table/table-body.d.ts +0 -11
  293. package/table/table-body.d.ts.map +0 -1
  294. package/table/table-body.js +0 -21
  295. package/table/table-body.js.map +0 -1
  296. package/table/table-body.styles.d.ts +0 -2
  297. package/table/table-body.styles.d.ts.map +0 -1
  298. package/table/table-body.styles.js +0 -11
  299. package/table/table-body.styles.js.map +0 -1
  300. package/table/table-cell.d.ts +0 -11
  301. package/table/table-cell.d.ts.map +0 -1
  302. package/table/table-cell.js +0 -21
  303. package/table/table-cell.js.map +0 -1
  304. package/table/table-cell.styles.d.ts +0 -2
  305. package/table/table-cell.styles.d.ts.map +0 -1
  306. package/table/table-cell.styles.js +0 -11
  307. package/table/table-cell.styles.js.map +0 -1
  308. package/table/table-head.d.ts +0 -11
  309. package/table/table-head.d.ts.map +0 -1
  310. package/table/table-head.js +0 -21
  311. package/table/table-head.js.map +0 -1
  312. package/table/table-head.styles.d.ts +0 -2
  313. package/table/table-head.styles.d.ts.map +0 -1
  314. package/table/table-head.styles.js +0 -11
  315. package/table/table-head.styles.js.map +0 -1
  316. package/table/table-header-cell.d.ts +0 -11
  317. package/table/table-header-cell.d.ts.map +0 -1
  318. package/table/table-header-cell.js +0 -21
  319. package/table/table-header-cell.js.map +0 -1
  320. package/table/table-header-cell.styles.d.ts +0 -2
  321. package/table/table-header-cell.styles.d.ts.map +0 -1
  322. package/table/table-header-cell.styles.js +0 -12
  323. package/table/table-header-cell.styles.js.map +0 -1
  324. package/table/table-row.d.ts +0 -11
  325. package/table/table-row.d.ts.map +0 -1
  326. package/table/table-row.js +0 -21
  327. package/table/table-row.js.map +0 -1
  328. package/table/table-row.styles.d.ts +0 -2
  329. package/table/table-row.styles.d.ts.map +0 -1
  330. package/table/table-row.styles.js +0 -7
  331. package/table/table-row.styles.js.map +0 -1
  332. package/table/table.d.ts +0 -16
  333. package/table/table.d.ts.map +0 -1
  334. package/table/table.js.map +0 -1
  335. package/table/table.styles.d.ts +0 -2
  336. package/table/table.styles.d.ts.map +0 -1
  337. package/table/table.styles.js +0 -16
  338. package/table/table.styles.js.map +0 -1
  339. package/theme/color.d.ts +0 -7
  340. package/theme/color.d.ts.map +0 -1
  341. package/theme/color.js +0 -2
  342. package/theme/color.js.map +0 -1
  343. package/theme/css-var-builder.d.ts +0 -9
  344. package/theme/css-var-builder.d.ts.map +0 -1
  345. package/theme/css-var-builder.js +0 -25
  346. package/theme/css-var-builder.js.map +0 -1
  347. package/theme/index.d.ts +0 -2
  348. package/theme/index.d.ts.map +0 -1
  349. package/theme/index.js.map +0 -1
  350. package/theme/neutral-colors.d.ts +0 -4
  351. package/theme/neutral-colors.d.ts.map +0 -1
  352. package/theme/neutral-colors.js +0 -19
  353. package/theme/neutral-colors.js.map +0 -1
  354. package/theme/rgb-color.d.ts +0 -9
  355. package/theme/rgb-color.d.ts.map +0 -1
  356. package/theme/rgb-color.js +0 -13
  357. package/theme/rgb-color.js.map +0 -1
  358. package/theme/theme-builder.d.ts +0 -27
  359. package/theme/theme-builder.d.ts.map +0 -1
  360. package/theme/theme-builder.js +0 -146
  361. package/theme/theme-builder.js.map +0 -1
  362. package/theme/theme-color.d.ts.map +0 -1
  363. package/theme/theme-color.js +0 -2
  364. package/theme/theme-color.js.map +0 -1
@@ -0,0 +1,39 @@
1
+ :host {
2
+ --_grid-spacing-small: var(--u-spacing-sm, 8px);
3
+ --_grid-spacing-medium: var(--u-spacing-md, 16px);
4
+ --_grid-spacing-large: var(--u-spacing-lg, 24px);
5
+ --_grid-spacing-extra-large: var(--u-spacing-xl, 40px);
6
+ }
7
+
8
+ :host([margin="none"]) {
9
+ --_container-margin: 0;
10
+ }
11
+
12
+ :host([margin="small"]) {
13
+ --_container-margin: var(--u-container-margin, var(--_grid-spacing-small));
14
+ }
15
+
16
+ :host([margin="medium"]) {
17
+ --_container-margin: var(--u-container-margin, var(--_grid-spacing-medium));
18
+ }
19
+
20
+ :host([margin="large"]) {
21
+ --_container-margin: var(--u-container-margin, var(--_grid-spacing-large));
22
+ }
23
+
24
+ :host([margin="extra-large"]) {
25
+ --_container-margin: var(--u-container-margin, var(--_grid-spacing-extra-large));
26
+ }
27
+
28
+ :host {
29
+ display: block;
30
+ width: 100%;
31
+ max-width: var(--u-container-max-width, 992px);
32
+ margin-inline: auto;
33
+ padding: var(--_container-margin, var(--_grid-spacing-medium));
34
+ }
35
+
36
+ :host::after {
37
+ content: '';
38
+ display: block;
39
+ }
@@ -0,0 +1,24 @@
1
+ import { html, HTMLTemplateResult, LitElement } from 'lit';
2
+ import { customElement, property } from 'lit/decorators.js';
3
+
4
+ import { styles } from './container.styles.js';
5
+
6
+ export type UmSpacingSizes = 'none' | 'small' | 'medium ' | 'large' | 'extra-large';
7
+
8
+ @customElement('u-container')
9
+ export class UmContainer extends LitElement {
10
+
11
+ static override styles = styles;
12
+
13
+ @property({reflect: true}) margin: UmSpacingSizes | undefined;
14
+
15
+ override render(): HTMLTemplateResult {
16
+ return html`<slot></slot>`;
17
+ }
18
+ }
19
+
20
+ declare global {
21
+ interface HTMLElementTagNameMap {
22
+ 'u-container': UmContainer;
23
+ }
24
+ }
@@ -0,0 +1,13 @@
1
+ @import "../utils";
2
+
3
+ :host {
4
+ --_divider-thickness: var(--u-divider-thickness, 1px);
5
+ display: block;
6
+ margin-block: 8px;
7
+ height: var(--_divider-thickness);
8
+ background-color: var(--u-divider-color, #{get-color-var(outline-variant)});
9
+ }
10
+
11
+ :host([no-margin]) {
12
+ margin: 0;
13
+ }
@@ -0,0 +1,21 @@
1
+ import { LitElement } from 'lit';
2
+ import { customElement, property } from 'lit/decorators.js';
3
+
4
+ import { styles } from './divider.styles';
5
+
6
+ @customElement('u-divider')
7
+ export class UmDivider extends LitElement {
8
+
9
+ static override styles = styles;
10
+
11
+ /**
12
+ * When true, remove the margin of the divider
13
+ */
14
+ @property({type: Boolean, attribute: 'no-margin', reflect: true}) noMargin = false;
15
+ }
16
+
17
+ declare global {
18
+ interface HTMLElementTagNameMap {
19
+ 'u-divider': UmDivider;
20
+ }
21
+ }
@@ -0,0 +1,31 @@
1
+ @import "../utils";
2
+
3
+ :host {
4
+ --_level: var(--u-elevation-level, 0);
5
+ --_shadow-color: #{get-color-var(shadow)};
6
+
7
+ -webkit-tap-highlight-color: transparent;
8
+ position: absolute;
9
+ inset: 0;
10
+ border-radius: inherit;
11
+ pointer-events: none;
12
+
13
+ &::before,
14
+ &::after {
15
+ content: '';
16
+ position: absolute;
17
+ inset: 0;
18
+ border-radius: inherit;
19
+ transition: box-shadow 150ms ease-in-out;
20
+ }
21
+
22
+ &::before {
23
+ box-shadow: 0 calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 3,1) + 2*clamp(0,var(--_level) - 4,1))) calc(1px*(2*clamp(0,var(--_level),1) + clamp(0,var(--_level) - 2,1) + clamp(0,var(--_level) - 4,1))) 0 var(--_shadow-color);
24
+ opacity: .3;
25
+ }
26
+
27
+ &::after {
28
+ box-shadow: 0 calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 1,1) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(3*clamp(0,var(--_level),2) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(clamp(0,var(--_level),4) + 2*clamp(0,var(--_level) - 4,1))) var(--_shadow-color);
29
+ opacity: .15;
30
+ }
31
+ }
@@ -0,0 +1,17 @@
1
+ import { LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
3
+
4
+ import { styles } from './elevation.styles';
5
+
6
+ @customElement('u-elevation')
7
+ export class UmElevation extends LitElement {
8
+ static override styles = styles;
9
+
10
+ override ariaHidden = "true";
11
+ }
12
+
13
+ declare global {
14
+ interface HTMLElementTagNameMap {
15
+ 'u-elevation': UmElevation;
16
+ }
17
+ }
@@ -9,6 +9,7 @@ import './divider/divider.js';
9
9
  import './elevation/elevation.js';
10
10
  import './ripple/ripple.js';
11
11
  import './table/table.js';
12
+
12
13
  export * from './button/button-base.js';
13
14
  export * from './button/button.js';
14
15
  export * from './button/fab.js';
@@ -24,4 +25,3 @@ export * from './elevation/elevation.js';
24
25
  export * from './ripple/ripple.js';
25
26
  export * from './table/table.js';
26
27
  export * from './theme/theme-builder.js';
27
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,80 @@
1
+ @import '../variables';
2
+
3
+ :host,
4
+ .ripple-container::before {
5
+ --_ripple-hover-color: var(--u-ripple-hover-color, var(--u-ripple-color, var(--u-state-layer-color, currentColor)));
6
+ --_ripple-pressed-color: var(--u-ripple-pressed-color, var(--u-ripple-color, var(--u-state-layer-color, currentColor)));
7
+ --_ripple-hover-opacity: var(--u-ripple-pressed-opacity, .08);
8
+ --_ripple-pressed-opacity: var(--u-ripple-pressed-opacity, .2);
9
+
10
+ display: block;
11
+ inset: 0;
12
+ isolation: isolate;
13
+ }
14
+
15
+ .ripple-container {
16
+ position: relative;
17
+ width: 100%;
18
+ height: 100%;
19
+ overflow: hidden;
20
+ border-radius: inherit;
21
+ }
22
+
23
+ .ripple-container::before {
24
+ content: '';
25
+ background: var(--_ripple-hover-color);
26
+ opacity: 0;
27
+ transition: opacity 200ms;
28
+ }
29
+
30
+ @media (hover: hover) {
31
+ :host(:not([disabled]):hover) .ripple-container::before {
32
+ content: '';
33
+ background: var(--_ripple-hover-color);
34
+ opacity: var(--_ripple-hover-opacity);
35
+ }
36
+ }
37
+
38
+ :host,
39
+ .ripple-container::before,
40
+ .ripple {
41
+ position: absolute;
42
+ border-radius: inherit;
43
+ }
44
+
45
+ .ripple {
46
+ top: 50%;
47
+ left: 50%;
48
+ background: var(--_ripple-pressed-color);
49
+ border-radius: 50%;
50
+ box-shadow: 0 0 64px 64px var(--_ripple-pressed-color);
51
+ opacity: var(--_ripple-pressed-opacity);
52
+ transform: scale3d(0, 0, 1);
53
+ pointer-events: none;
54
+ will-change: transform;
55
+
56
+ &.show {
57
+ transition:
58
+ transform calc(var(--_ripple-transition-duration) / var(--u-ripple-speed, 1)) $awesome-cubic-bezier,
59
+ opacity calc(750ms / var(--u-ripple-speed, 1));
60
+ transform: scale3d(1, 1, 1);
61
+ }
62
+ &.show-forced {
63
+ transition:
64
+ transform calc(var(--_ripple-transition-duration) / var(--u-ripple-speed, 1)) $awesome-cubic-bezier,
65
+ opacity calc(200ms / var(--u-ripple-speed, 1)) 300ms;
66
+ transform: scale3d(2, 2, 1);
67
+ opacity: 0;
68
+ }
69
+
70
+ &.dismiss {
71
+ opacity: 0;
72
+ transform: scale3d(2, 2, 1);
73
+ }
74
+ }
75
+
76
+ ::slotted(*) {
77
+ position: absolute !important;
78
+ inset: 0;
79
+ border-radius: inherit;
80
+ }
@@ -0,0 +1,150 @@
1
+ import { html, HTMLTemplateResult, LitElement } from 'lit';
2
+ import { customElement, property, query } from 'lit/decorators.js';
3
+
4
+ import { styles } from './ripple.styles';
5
+
6
+ @customElement('u-ripple')
7
+ export class UmRipple extends LitElement {
8
+
9
+ static override styles = styles;
10
+
11
+ private isTouching = false;
12
+
13
+ /**
14
+ * Disables the ripple.
15
+ */
16
+ @property({type: Boolean, reflect: true}) disabled = false;
17
+
18
+ @query('.ripple-container') private readonly rippleContainer!: HTMLElement;
19
+
20
+ constructor() {
21
+ super();
22
+
23
+ this.ariaHidden = "true";
24
+ this.attachEvents();
25
+ }
26
+
27
+ override render(): HTMLTemplateResult {
28
+ return html`<div class="ripple-container"></div><slot></slot>`
29
+ }
30
+
31
+ private attachEvents(): void {
32
+
33
+ this.addEventListener('mousedown', this.handleMouseDown);
34
+ this.addEventListener('touchstart', this.handleTouchStart);
35
+ }
36
+
37
+ private handleMouseDown(e: MouseEvent): void {
38
+
39
+ if (this.isTouching || !this.canCreateRipple()) {
40
+ return;
41
+ }
42
+
43
+ this.createRipple(e.clientX, e.clientY, 'mouseup');
44
+ }
45
+
46
+ private handleTouchStart(e: TouchEvent): void {
47
+
48
+ if (!this.canCreateRipple()) {
49
+ return;
50
+ }
51
+
52
+ this.isTouching = true;
53
+
54
+ const dismiss = this.createRipple(e.touches[0].clientX, e.touches[0].clientY, 'touchend')!;
55
+
56
+ this.addEventListener("touchmove", dismiss);
57
+ }
58
+
59
+ private canCreateRipple(): boolean {
60
+ if (this.disabled) return false;
61
+
62
+ const parent = this.parentElement;
63
+
64
+ if (!parent || window.getComputedStyle(parent).position !== "relative" && window.getComputedStyle(parent).position !== "absolute" && window.getComputedStyle(parent).position !== "fixed") {
65
+ return false;
66
+ }
67
+
68
+ return true;
69
+ }
70
+
71
+ createRipple(targetX: number | null = null, targetY: number | null = null, releaseEventName: string | null = null): (() => void) | null {
72
+ const preClientRect = this.rippleContainer.getBoundingClientRect();
73
+ targetX ??= preClientRect.x + this.rippleContainer.clientWidth / 2;
74
+ targetY ??= preClientRect.y + this.rippleContainer.clientHeight / 2;
75
+
76
+ const ripple = document.createElement('DIV');
77
+ ripple.classList.add('ripple');
78
+ this.rippleContainer!.appendChild(ripple);
79
+
80
+ requestAnimationFrame(() => {
81
+ const clientRect = this.getBoundingClientRect();
82
+ const largestDimensionSize = Math.max(this.clientWidth, this.clientHeight);
83
+ const rippleSize = largestDimensionSize * 2;
84
+
85
+ UmRipple._setElementSquareSizeAndCenter(ripple, rippleSize);
86
+ ripple.style.setProperty('--_ripple-transition-duration', `${1080 * Math.pow(rippleSize, 0.3)}ms`);
87
+
88
+ const x = (targetX! - clientRect.left) + ((rippleSize - this.rippleContainer.clientWidth) / 2);
89
+ const y = (targetY! - clientRect.top) + ((rippleSize - this.rippleContainer.clientHeight) / 2);
90
+
91
+ ripple.style.transformOrigin = `${x}px ${y}px`;
92
+ ripple.classList.add(releaseEventName ? 'show' : 'show-forced');
93
+ });
94
+
95
+ const interval = setInterval(() => {
96
+
97
+ if (!ripple.classList.contains('dismiss') && !ripple.classList.contains('show-forced')) {
98
+ return;
99
+ }
100
+
101
+ const animations = ripple.getAnimations();
102
+
103
+ if (animations.length) {
104
+ return;
105
+ }
106
+
107
+ clearInterval(interval);
108
+ ripple.remove();
109
+ }, 1000);
110
+
111
+ if (!releaseEventName) {
112
+ return null;
113
+ }
114
+
115
+ return this.createDismissEvent(ripple, releaseEventName);
116
+ }
117
+
118
+ private createDismissEvent(ripple: HTMLElement, releaseEventName: string): () => void {
119
+ const dismiss = () => {
120
+ ripple.classList.add('dismiss');
121
+
122
+ this.isTouching = false;
123
+
124
+ this.removeEventListener('dragover', dismiss);
125
+ this.removeEventListener('mouseleave', dismiss);
126
+ window.removeEventListener(releaseEventName, dismiss);
127
+ }
128
+
129
+ this.addEventListener("dragover", dismiss);
130
+ this.addEventListener("mouseleave", dismiss);
131
+ window.addEventListener(releaseEventName, dismiss);
132
+
133
+ return dismiss;
134
+ }
135
+
136
+ private static _setElementSquareSizeAndCenter(element: HTMLElement, size: number) {
137
+ element.style.top = "50%";
138
+ element.style.left = "50%";
139
+ element.style.width = `${size}px`;
140
+ element.style.height = `${size}px`;
141
+ element.style.marginLeft = `${-size / 2}px`;
142
+ element.style.marginTop = `${-size / 2}px`;
143
+ }
144
+ }
145
+
146
+ declare global {
147
+ interface HTMLElementTagNameMap {
148
+ 'u-ripple': UmRipple;
149
+ }
150
+ }
@@ -0,0 +1,5 @@
1
+ :host,
2
+ * {
3
+ font-family: var(--u-font-family-base, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol");
4
+ box-sizing: border-box;
5
+ }
@@ -0,0 +1,9 @@
1
+ @import "../utils";
2
+
3
+ :host {
4
+ display: table-row-group;
5
+ }
6
+
7
+ ::slotted(u-tr:not(:first-child)) {
8
+ border-top: 1px solid #{get-color-var(outline-variant)};
9
+ }
@@ -0,0 +1,21 @@
1
+ import { html, HTMLTemplateResult, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
3
+
4
+ import { styles as baseStyles } from '../shared/base.styles';
5
+ import { styles } from './table-body.styles';
6
+
7
+ @customElement('u-tbody')
8
+ export class UmTableBody extends LitElement {
9
+
10
+ static override styles = [baseStyles, styles];
11
+
12
+ protected override render(): HTMLTemplateResult {
13
+ return html`<slot></slot>`;
14
+ }
15
+ }
16
+
17
+ declare global {
18
+ interface HTMLElementTagNameMap {
19
+ 'u-tbody': UmTableBody;
20
+ }
21
+ }
@@ -0,0 +1,9 @@
1
+ @import "../utils";
2
+
3
+ :host {
4
+ display: table-cell;
5
+ padding: var(--u-td-padding, 13px 16px);
6
+ font-size: var(--u-td-font-size, .875rem);
7
+ font-weight: var(--u-td-font-weight, #{get-font-weight-var(medium)});
8
+ text-align: start;
9
+ }
@@ -0,0 +1,21 @@
1
+ import { html, HTMLTemplateResult, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
3
+
4
+ import { styles as baseStyles } from '../shared/base.styles';
5
+ import { styles } from './table-cell.styles';
6
+
7
+ @customElement('u-td')
8
+ export class UmTableCell extends LitElement {
9
+
10
+ static override styles = [baseStyles, styles];
11
+
12
+ protected override render(): HTMLTemplateResult {
13
+ return html`<slot></slot>`;
14
+ }
15
+ }
16
+
17
+ declare global {
18
+ interface HTMLElementTagNameMap {
19
+ 'u-td': UmTableCell;
20
+ }
21
+ }
@@ -0,0 +1,9 @@
1
+ @import "../utils";
2
+
3
+ :host {
4
+ display: table-header-group;
5
+ }
6
+
7
+ ::slotted(u-tr:not(:first-child)) {
8
+ border-top: 1px solid #{get-color-var(outline-variant)};
9
+ }
@@ -0,0 +1,21 @@
1
+ import { html, HTMLTemplateResult, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
3
+
4
+ import { styles as baseStyles } from '../shared/base.styles';
5
+ import { styles } from './table-head.styles';
6
+
7
+ @customElement('u-thead')
8
+ export class UmTableHead extends LitElement {
9
+
10
+ static override styles = [baseStyles, styles];
11
+
12
+ protected override render(): HTMLTemplateResult {
13
+ return html`<slot></slot>`;
14
+ }
15
+ }
16
+
17
+ declare global {
18
+ interface HTMLElementTagNameMap {
19
+ 'u-thead': UmTableHead;
20
+ }
21
+ }
@@ -0,0 +1,10 @@
1
+ @import "../utils";
2
+
3
+ :host {
4
+ display: table-cell;
5
+ padding: var(--u-th-padding, 13px 16px);
6
+ font-size: var(--u-th-font-size, .8125rem);
7
+ font-weight: var(--u-th-font-weigh, #{get-font-weight-var(medium)});
8
+ text-align: start;
9
+ color: var(--u-low-emphasis-color, #{get-color-var(on-surface-variant)});
10
+ }
@@ -0,0 +1,21 @@
1
+ import { html, HTMLTemplateResult, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
3
+
4
+ import { styles as baseStyles } from '../shared/base.styles';
5
+ import { styles } from './table-header-cell.styles';
6
+
7
+ @customElement('u-th')
8
+ export class UmTableHeaderCell extends LitElement {
9
+
10
+ static override styles = [baseStyles, styles];
11
+
12
+ protected override render(): HTMLTemplateResult {
13
+ return html`<slot></slot>`;
14
+ }
15
+ }
16
+
17
+ declare global {
18
+ interface HTMLElementTagNameMap {
19
+ 'u-th': UmTableHeaderCell;
20
+ }
21
+ }
@@ -0,0 +1,3 @@
1
+ :host {
2
+ display: table-row;
3
+ }
@@ -0,0 +1,21 @@
1
+ import { html, HTMLTemplateResult, LitElement } from 'lit';
2
+ import { customElement } from 'lit/decorators.js';
3
+
4
+ import { styles as baseStyles } from '../shared/base.styles';
5
+ import { styles } from './table-row.styles';
6
+
7
+ @customElement('u-tr')
8
+ export class UmTableRow extends LitElement {
9
+
10
+ static override styles = [baseStyles, styles];
11
+
12
+ protected override render(): HTMLTemplateResult {
13
+ return html`<slot></slot>`;
14
+ }
15
+ }
16
+
17
+ declare global {
18
+ interface HTMLElementTagNameMap {
19
+ 'u-tr': UmTableRow;
20
+ }
21
+ }
@@ -0,0 +1,12 @@
1
+ :host {
2
+ display: table;
3
+ min-width: 100%;
4
+ border-collapse: collapse;
5
+ }
6
+
7
+ ::slotted(u-thead:not(:first-child)),
8
+ ::slotted(u-tbody:not(:first-child)),
9
+ ::slotted(u-tfooter:not(:first-child)),
10
+ ::slotted(u-tr:not(:first-child)) {
11
+ border-top: 1px solid #{get-color-var(outline-variant)};
12
+ }
@@ -1,4 +1,5 @@
1
- import { html, LitElement } from 'lit';
1
+ import { html, HTMLTemplateResult, LitElement } from 'lit';
2
+
2
3
  import './table-head.js';
3
4
  import './table-body.js';
4
5
  import './table-row.js';
@@ -6,14 +7,22 @@ import './table-cell.js';
6
7
  import './table-header-cell.js';
7
8
  import { styles as baseStyles } from '../shared/base.styles';
8
9
  import { styles } from './table.styles';
10
+
9
11
  export class UmTable extends LitElement {
10
- render() {
11
- return html `
12
+ static override styles = [baseStyles, styles];
13
+
14
+ protected override render(): HTMLTemplateResult {
15
+ return html`
12
16
  <slot name="header"></slot>
13
17
  <slot></slot>
14
18
  `;
15
- }
19
+ }
16
20
  }
17
- UmTable.styles = [baseStyles, styles];
21
+
18
22
  customElements.define('u-table', UmTable);
19
- //# sourceMappingURL=table.js.map
23
+
24
+ declare global {
25
+ interface HTMLElementTagNameMap {
26
+ 'u-table': UmTable;
27
+ }
28
+ }
@@ -0,0 +1,6 @@
1
+ export interface Color {
2
+ name: string;
3
+ fixedTone?: number;
4
+ lightTone?: number;
5
+ darkTone?: number;
6
+ }
@@ -0,0 +1,36 @@
1
+ import { hexFromArgb } from '@material/material-color-utilities';
2
+
3
+ import { RgbColor } from './rgb-color.js';
4
+
5
+ export class CssVarBuilder {
6
+
7
+ private content = '';
8
+
9
+ private constructor() {
10
+ }
11
+
12
+ static create(): CssVarBuilder {
13
+ return new CssVarBuilder();
14
+ }
15
+
16
+ add(name: string, value: string): CssVarBuilder {
17
+
18
+ const cssVar = ` ${name}: ${value};
19
+ `;
20
+
21
+ this.content += cssVar
22
+
23
+ return this;
24
+ }
25
+
26
+ addFromArgb(name: string, argb: number): CssVarBuilder {
27
+ this.add(`--u-color-${name}`, hexFromArgb(argb));
28
+ this.add(`--u-color-${name}-rgb`, RgbColor.fromArgb(argb).toString());
29
+
30
+ return this;
31
+ }
32
+
33
+ build(): string {
34
+ return this.content;
35
+ }
36
+ }
@@ -1,2 +1 @@
1
1
  export * from './theme-builder.js';
2
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,21 @@
1
+ import {Color} from './color.js';
2
+
3
+ export const neutralColors: Color[] = [
4
+ { name: 'surface', lightTone: 98, darkTone: 6 },
5
+ { name: 'surface-bright', lightTone: 98, darkTone: 24 },
6
+ { name: 'surface-dim', lightTone: 87, darkTone: 6 },
7
+ { name: 'surface-container-lowest', lightTone: 100, darkTone: 4 },
8
+ { name: 'surface-container-low', lightTone: 96, darkTone: 10 },
9
+ { name: 'surface-container', lightTone: 94, darkTone: 12 },
10
+ { name: 'surface-container-high', lightTone: 92, darkTone: 17 },
11
+ { name: 'surface-container-highest', lightTone: 90, darkTone: 22 },
12
+ { name: 'on-surface', lightTone: 10, darkTone: 90 },
13
+ { name: 'scrim', fixedTone: 0 },
14
+ { name: 'shadow', fixedTone: 0 },
15
+ ]
16
+
17
+ export const neutralVariantColors: Color[] = [
18
+ { name: 'on-surface-variant', lightTone: 30, darkTone: 80 },
19
+ { name: 'outline', lightTone: 50, darkTone: 60 },
20
+ { name: 'outline-variant', lightTone: 80, darkTone: 30 }
21
+ ]