@universal-material/web 3.0.10 → 3.0.12

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/button/button-base.d.ts +43 -0
  2. package/button/button-base.d.ts.map +1 -0
  3. package/button/button-base.js +152 -0
  4. package/button/button-base.js.map +1 -0
  5. package/button/button-base.styles.d.ts +2 -0
  6. package/button/button-base.styles.d.ts.map +1 -0
  7. package/button/button-base.styles.js +75 -0
  8. package/button/button-base.styles.js.map +1 -0
  9. package/button/button-set.d.ts +20 -0
  10. package/button/button-set.d.ts.map +1 -0
  11. package/button/button-set.js +38 -0
  12. package/button/button-set.js.map +1 -0
  13. package/button/button-set.styles.d.ts +2 -0
  14. package/button/button-set.styles.d.ts.map +1 -0
  15. package/button/button-set.styles.js +39 -0
  16. package/button/button-set.styles.js.map +1 -0
  17. package/button/button.d.ts +34 -0
  18. package/button/button.d.ts.map +1 -0
  19. package/button/button.js +64 -0
  20. package/button/button.js.map +1 -0
  21. package/button/button.styles.d.ts +2 -0
  22. package/button/button.styles.d.ts.map +1 -0
  23. package/button/button.styles.js +96 -0
  24. package/button/button.styles.js.map +1 -0
  25. package/button/fab.d.ts +31 -0
  26. package/button/fab.d.ts.map +1 -0
  27. package/button/fab.js +63 -0
  28. package/button/fab.js.map +1 -0
  29. package/button/fab.styles.d.ts +2 -0
  30. package/button/fab.styles.d.ts.map +1 -0
  31. package/button/fab.styles.js +89 -0
  32. package/button/fab.styles.js.map +1 -0
  33. package/button/icon-button.d.ts +35 -0
  34. package/button/icon-button.d.ts.map +1 -0
  35. package/button/icon-button.js +79 -0
  36. package/button/icon-button.js.map +1 -0
  37. package/button/icon-button.styles.d.ts +2 -0
  38. package/button/icon-button.styles.d.ts.map +1 -0
  39. package/button/icon-button.styles.js +70 -0
  40. package/button/icon-button.styles.js.map +1 -0
  41. package/card/card-content.d.ts +13 -0
  42. package/card/card-content.d.ts.map +1 -0
  43. package/card/card-content.js +44 -0
  44. package/card/card-content.js.map +1 -0
  45. package/card/card-content.styles.d.ts +2 -0
  46. package/card/card-content.styles.d.ts.map +1 -0
  47. package/card/card-content.styles.js +15 -0
  48. package/card/card-content.styles.js.map +1 -0
  49. package/card/card-media.d.ts +12 -0
  50. package/card/card-media.d.ts.map +1 -0
  51. package/card/card-media.js +29 -0
  52. package/card/card-media.js.map +1 -0
  53. package/card/card-media.styles.d.ts +2 -0
  54. package/card/card-media.styles.d.ts.map +1 -0
  55. package/card/card-media.styles.js +13 -0
  56. package/card/card-media.styles.js.map +1 -0
  57. package/card/card.d.ts +19 -0
  58. package/card/card.d.ts.map +1 -0
  59. package/card/card.js +40 -0
  60. package/card/card.js.map +1 -0
  61. package/card/card.styles.d.ts +2 -0
  62. package/card/card.styles.d.ts.map +1 -0
  63. package/card/card.styles.js +28 -0
  64. package/card/card.styles.js.map +1 -0
  65. package/checkbox/checkbox.d.ts +16 -0
  66. package/checkbox/checkbox.d.ts.map +1 -0
  67. package/checkbox/checkbox.js +75 -0
  68. package/checkbox/checkbox.js.map +1 -0
  69. package/container/container.d.ts +13 -0
  70. package/container/container.d.ts.map +1 -0
  71. package/container/container.js +23 -0
  72. package/container/container.js.map +1 -0
  73. package/container/container.styles.d.ts +2 -0
  74. package/container/container.styles.d.ts.map +1 -0
  75. package/container/container.styles.js +43 -0
  76. package/container/container.styles.js.map +1 -0
  77. package/custom-elements.json +3706 -0
  78. package/divider/divider.d.ts +14 -0
  79. package/divider/divider.d.ts.map +1 -0
  80. package/divider/divider.js +27 -0
  81. package/divider/divider.js.map +1 -0
  82. package/divider/divider.styles.d.ts +2 -0
  83. package/divider/divider.styles.d.ts.map +1 -0
  84. package/divider/divider.styles.js +15 -0
  85. package/divider/divider.styles.js.map +1 -0
  86. package/elevation/elevation.d.ts +11 -0
  87. package/elevation/elevation.d.ts.map +1 -0
  88. package/elevation/elevation.js +21 -0
  89. package/elevation/elevation.js.map +1 -0
  90. package/elevation/elevation.styles.d.ts +2 -0
  91. package/elevation/elevation.styles.d.ts.map +1 -0
  92. package/elevation/elevation.styles.js +28 -0
  93. package/elevation/elevation.styles.js.map +1 -0
  94. package/index.d.ts +27 -0
  95. package/index.d.ts.map +1 -0
  96. package/{src/index.ts → index.js} +1 -1
  97. package/index.js.map +1 -0
  98. package/package.json +1 -1
  99. package/ripple/ripple.d.ts +25 -0
  100. package/ripple/ripple.d.ts.map +1 -0
  101. package/ripple/ripple.js +119 -0
  102. package/ripple/ripple.js.map +1 -0
  103. package/ripple/ripple.styles.d.ts +2 -0
  104. package/ripple/ripple.styles.d.ts.map +1 -0
  105. package/ripple/ripple.styles.js +74 -0
  106. package/ripple/ripple.styles.js.map +1 -0
  107. package/shared/base.styles.d.ts +2 -0
  108. package/shared/base.styles.d.ts.map +1 -0
  109. package/shared/base.styles.js +9 -0
  110. package/shared/base.styles.js.map +1 -0
  111. package/table/table-body.d.ts +11 -0
  112. package/table/table-body.d.ts.map +1 -0
  113. package/table/table-body.js +21 -0
  114. package/table/table-body.js.map +1 -0
  115. package/table/table-body.styles.d.ts +2 -0
  116. package/table/table-body.styles.d.ts.map +1 -0
  117. package/table/table-body.styles.js +11 -0
  118. package/table/table-body.styles.js.map +1 -0
  119. package/table/table-cell.d.ts +11 -0
  120. package/table/table-cell.d.ts.map +1 -0
  121. package/table/table-cell.js +21 -0
  122. package/table/table-cell.js.map +1 -0
  123. package/table/table-cell.styles.d.ts +2 -0
  124. package/table/table-cell.styles.d.ts.map +1 -0
  125. package/table/table-cell.styles.js +11 -0
  126. package/table/table-cell.styles.js.map +1 -0
  127. package/table/table-head.d.ts +11 -0
  128. package/table/table-head.d.ts.map +1 -0
  129. package/table/table-head.js +21 -0
  130. package/table/table-head.js.map +1 -0
  131. package/table/table-head.styles.d.ts +2 -0
  132. package/table/table-head.styles.d.ts.map +1 -0
  133. package/table/table-head.styles.js +11 -0
  134. package/table/table-head.styles.js.map +1 -0
  135. package/table/table-header-cell.d.ts +11 -0
  136. package/table/table-header-cell.d.ts.map +1 -0
  137. package/table/table-header-cell.js +21 -0
  138. package/table/table-header-cell.js.map +1 -0
  139. package/table/table-header-cell.styles.d.ts +2 -0
  140. package/table/table-header-cell.styles.d.ts.map +1 -0
  141. package/table/table-header-cell.styles.js +12 -0
  142. package/table/table-header-cell.styles.js.map +1 -0
  143. package/table/table-row.d.ts +11 -0
  144. package/table/table-row.d.ts.map +1 -0
  145. package/table/table-row.js +21 -0
  146. package/table/table-row.js.map +1 -0
  147. package/table/table-row.styles.d.ts +2 -0
  148. package/table/table-row.styles.d.ts.map +1 -0
  149. package/table/table-row.styles.js +7 -0
  150. package/table/table-row.styles.js.map +1 -0
  151. package/table/table.d.ts +16 -0
  152. package/table/table.d.ts.map +1 -0
  153. package/{src/table/table.ts → table/table.js} +6 -15
  154. package/table/table.js.map +1 -0
  155. package/table/table.styles.d.ts +2 -0
  156. package/table/table.styles.d.ts.map +1 -0
  157. package/table/table.styles.js +16 -0
  158. package/table/table.styles.js.map +1 -0
  159. package/theme/color.d.ts +7 -0
  160. package/theme/color.d.ts.map +1 -0
  161. package/theme/color.js +2 -0
  162. package/theme/color.js.map +1 -0
  163. package/theme/css-var-builder.d.ts +9 -0
  164. package/theme/css-var-builder.d.ts.map +1 -0
  165. package/theme/css-var-builder.js +25 -0
  166. package/theme/css-var-builder.js.map +1 -0
  167. package/theme/index.d.ts +2 -0
  168. package/theme/index.d.ts.map +1 -0
  169. package/{src/theme/index.ts → theme/index.js} +1 -0
  170. package/theme/index.js.map +1 -0
  171. package/theme/neutral-colors.d.ts +4 -0
  172. package/theme/neutral-colors.d.ts.map +1 -0
  173. package/theme/neutral-colors.js +19 -0
  174. package/theme/neutral-colors.js.map +1 -0
  175. package/theme/rgb-color.d.ts +9 -0
  176. package/theme/rgb-color.d.ts.map +1 -0
  177. package/theme/rgb-color.js +13 -0
  178. package/theme/rgb-color.js.map +1 -0
  179. package/theme/theme-builder.d.ts +27 -0
  180. package/theme/theme-builder.d.ts.map +1 -0
  181. package/theme/theme-builder.js +146 -0
  182. package/theme/theme-builder.js.map +1 -0
  183. package/{src/theme/theme-color.ts → theme/theme-color.d.ts} +2 -3
  184. package/theme/theme-color.d.ts.map +1 -0
  185. package/theme/theme-color.js +2 -0
  186. package/theme/theme-color.js.map +1 -0
  187. package/.editorconfig +0 -8
  188. package/.eleventy.cjs +0 -21
  189. package/.eslintignore +0 -6
  190. package/.eslintrc.json +0 -98
  191. package/.prettierrc.json +0 -7
  192. package/.vscode/extensions.json +0 -9
  193. package/CHANGELOG.md +0 -98
  194. package/LICENSE +0 -28
  195. package/docs/.nojekyll +0 -0
  196. package/docs/api/index.html +0 -149
  197. package/docs/docs.css +0 -185
  198. package/docs/examples/index.html +0 -75
  199. package/docs/examples/name-property/index.html +0 -65
  200. package/docs/index.html +0 -75
  201. package/docs/install/index.html +0 -53
  202. package/docs/prism-okaidia.css +0 -123
  203. package/docs/src/_api-section.pug +0 -27
  204. package/docs/src/_layout.pug +0 -182
  205. package/docs/src/components/button-set/alignment.html +0 -29
  206. package/docs/src/components/button-set/stack.html +0 -5
  207. package/docs/src/components/button-set/usage.html +0 -35
  208. package/docs/src/components/button-set.pug +0 -16
  209. package/docs/src/components/cards/card-media.html +0 -39
  210. package/docs/src/components/cards/card-with-actions.html +0 -38
  211. package/docs/src/components/cards/simple-card.html +0 -3
  212. package/docs/src/components/cards.pug +0 -15
  213. package/docs/src/components/checkbox/usage.html +0 -33
  214. package/docs/src/components/checkbox.pug +0 -7
  215. package/docs/src/components/chips/chip-input.html +0 -73
  216. package/docs/src/components/chips/default-chips.html +0 -25
  217. package/docs/src/components/chips/elevated-chips.html +0 -25
  218. package/docs/src/components/chips/selected-chips.html +0 -50
  219. package/docs/src/components/chips.pug +0 -16
  220. package/docs/src/components/common-buttons/anchor-buttons.html +0 -6
  221. package/docs/src/components/common-buttons/buttons-icons.html +0 -24
  222. package/docs/src/components/common-buttons/buttons-trailing-icons.html +0 -25
  223. package/docs/src/components/common-buttons/buttons-variants.html +0 -6
  224. package/docs/src/components/common-buttons/filled-colors.html +0 -4
  225. package/docs/src/components/common-buttons.pug +0 -22
  226. package/docs/src/components/data-tables/simple-table.html +0 -47
  227. package/docs/src/components/data-tables/table-footer.html +0 -59
  228. package/docs/src/components/data-tables/table-header.html +0 -43
  229. package/docs/src/components/data-tables.pug +0 -15
  230. package/docs/src/components/datepicker.pug +0 -133
  231. package/docs/src/components/dialogs/example.html +0 -44
  232. package/docs/src/components/dialogs.pug +0 -19
  233. package/docs/src/components/dividers/no-margin.html +0 -7
  234. package/docs/src/components/dividers/usage.html +0 -7
  235. package/docs/src/components/dividers.pug +0 -13
  236. package/docs/src/components/dropdown-menus/down-end.html +0 -10
  237. package/docs/src/components/dropdown-menus/down-left.html +0 -10
  238. package/docs/src/components/dropdown-menus/down-right.html +0 -10
  239. package/docs/src/components/dropdown-menus/down-start.html +0 -10
  240. package/docs/src/components/dropdown-menus/down.html +0 -10
  241. package/docs/src/components/dropdown-menus/up-end.html +0 -10
  242. package/docs/src/components/dropdown-menus/up-left.html +0 -10
  243. package/docs/src/components/dropdown-menus/up-right.html +0 -10
  244. package/docs/src/components/dropdown-menus/up-start.html +0 -10
  245. package/docs/src/components/dropdown-menus/up.html +0 -10
  246. package/docs/src/components/expansion-panel.pug +0 -33
  247. package/docs/src/components/fab/button-colors.html +0 -18
  248. package/docs/src/components/fab/button-sizes.html +0 -11
  249. package/docs/src/components/fab/extended-buttons.html +0 -18
  250. package/docs/src/components/fab/floating-action-area.html +0 -5
  251. package/docs/src/components/fab/floating-menu.html +0 -10
  252. package/docs/src/components/fab/lowered-buttons.html +0 -6
  253. package/docs/src/components/fab.pug +0 -25
  254. package/docs/src/components/icon-buttons/anchor-buttons.html +0 -15
  255. package/docs/src/components/icon-buttons/buttons-variants.html +0 -15
  256. package/docs/src/components/icon-buttons/toggle-buttons-manual.html +0 -44
  257. package/docs/src/components/icon-buttons/toggle-buttons.html +0 -48
  258. package/docs/src/components/icon-buttons.pug +0 -18
  259. package/docs/src/components/lists/list-avatars.html +0 -14
  260. package/docs/src/components/lists/list-custom-dividers.html +0 -23
  261. package/docs/src/components/lists/list-dividers.html +0 -17
  262. package/docs/src/components/lists/list-dynamic.html +0 -26
  263. package/docs/src/components/lists/list-hover.html +0 -17
  264. package/docs/src/components/lists/list-icons.html +0 -17
  265. package/docs/src/components/lists/list-indexed.html +0 -123
  266. package/docs/src/components/lists/list-sections.html +0 -16
  267. package/docs/src/components/lists/list-three-lines.html +0 -20
  268. package/docs/src/components/lists/list-two-lines.html +0 -20
  269. package/docs/src/components/lists/list-with-action.html +0 -26
  270. package/docs/src/components/lists/list-with-activated-item.html +0 -17
  271. package/docs/src/components/lists/simple-list.html +0 -17
  272. package/docs/src/components/lists.pug +0 -94
  273. package/docs/src/components/menus.pug +0 -55
  274. package/docs/src/components/progress/circular-progress.html +0 -13
  275. package/docs/src/components/progress/determinate-progress.html +0 -3
  276. package/docs/src/components/progress/indeterminate-progress.html +0 -3
  277. package/docs/src/components/progress/progress-color.html +0 -3
  278. package/docs/src/components/progress.pug +0 -18
  279. package/docs/src/components/ripple/usage.html +0 -9
  280. package/docs/src/components/ripple.pug +0 -10
  281. package/docs/src/components/selection-controls/checkbox.html +0 -22
  282. package/docs/src/components/selection-controls/radio-button.html +0 -36
  283. package/docs/src/components/selection-controls/switch.html +0 -12
  284. package/docs/src/components/selection-controls.pug +0 -13
  285. package/docs/src/components/sliders/example.html +0 -42
  286. package/docs/src/components/sliders.pug +0 -7
  287. package/docs/src/components/snackbar/example.html +0 -35
  288. package/docs/src/components/snackbars.pug +0 -21
  289. package/docs/src/components/steppers.pug +0 -57
  290. package/docs/src/components/tabs/example.html +0 -45
  291. package/docs/src/components/tabs.pug +0 -8
  292. package/docs/src/components/text-fields.pug +0 -88
  293. package/docs/src/components/toolbars/simple-toolbar.html +0 -33
  294. package/docs/src/components/toolbars.pug +0 -7
  295. package/docs/src/content/typography/example.html +0 -15
  296. package/docs/src/content/typography.pug +0 -8
  297. package/docs/src/css/docs.scss +0 -189
  298. package/docs/src/index.pug +0 -10
  299. package/docs/src/js/docs.js +0 -161
  300. package/docs/src/js/universal-material.js +0 -757
  301. package/docs/src/js/universal-material.js.map +0 -1
  302. package/docs/src/js/universal-material.min.js +0 -17
  303. package/docs/src/js/universal-material.min.js.map +0 -1
  304. package/docs/src/layout/grid.pug +0 -15
  305. package/docs/src/utilities/background-colors/common-colors.html +0 -7
  306. package/docs/src/utilities/background-colors/theme-colors.html +0 -16
  307. package/docs/src/utilities/background-colors.pug +0 -10
  308. package/docs/src/utilities/text-and-background-colors/common-colors.html +0 -80
  309. package/docs/src/utilities/text-and-background-colors/theme-colors.html +0 -208
  310. package/docs/src/utilities/text-and-background-colors.pug +0 -10
  311. package/docs/src/utilities/text-colors/common-colors.html +0 -12
  312. package/docs/src/utilities/text-colors/emphasis-colors.html +0 -26
  313. package/docs/src/utilities/text-colors/theme-colors.html +0 -37
  314. package/docs/src/utilities/text-colors.pug +0 -13
  315. package/gulpfile.js +0 -225
  316. package/index.html +0 -11
  317. package/rollup.config.js +0 -42
  318. package/src/_utils.scss +0 -20
  319. package/src/_variables.scss +0 -68
  320. package/src/button/button-base.styles.scss +0 -75
  321. package/src/button/button-base.ts +0 -147
  322. package/src/button/button-set.styles.scss +0 -35
  323. package/src/button/button-set.ts +0 -33
  324. package/src/button/button.styles.scss +0 -97
  325. package/src/button/button.ts +0 -64
  326. package/src/button/fab.styles.scss +0 -90
  327. package/src/button/fab.ts +0 -55
  328. package/src/button/icon-button.styles.scss +0 -74
  329. package/src/button/icon-button.ts +0 -72
  330. package/src/card/card-content.styles.scss +0 -11
  331. package/src/card/card-content.ts +0 -45
  332. package/src/card/card-media.styles.scss +0 -9
  333. package/src/card/card-media.ts +0 -24
  334. package/src/card/card.styles.scss +0 -27
  335. package/src/card/card.ts +0 -37
  336. package/src/checkbox/checkbox.ts +0 -77
  337. package/src/container/container.styles.scss +0 -39
  338. package/src/container/container.ts +0 -24
  339. package/src/divider/divider.styles.scss +0 -13
  340. package/src/divider/divider.ts +0 -21
  341. package/src/elevation/elevation.styles.scss +0 -31
  342. package/src/elevation/elevation.ts +0 -17
  343. package/src/ripple/ripple.styles.scss +0 -80
  344. package/src/ripple/ripple.ts +0 -150
  345. package/src/shared/base.styles.scss +0 -5
  346. package/src/table/table-body.styles.scss +0 -9
  347. package/src/table/table-body.ts +0 -21
  348. package/src/table/table-cell.styles.scss +0 -9
  349. package/src/table/table-cell.ts +0 -21
  350. package/src/table/table-head.styles.scss +0 -9
  351. package/src/table/table-head.ts +0 -21
  352. package/src/table/table-header-cell.styles.scss +0 -10
  353. package/src/table/table-header-cell.ts +0 -21
  354. package/src/table/table-row.styles.scss +0 -3
  355. package/src/table/table-row.ts +0 -21
  356. package/src/table/table.styles.scss +0 -12
  357. package/src/theme/color.ts +0 -6
  358. package/src/theme/css-var-builder.ts +0 -36
  359. package/src/theme/neutral-colors.ts +0 -21
  360. package/src/theme/rgb-color.ts +0 -19
  361. package/src/theme/theme-builder.ts +0 -201
  362. package/tsconfig.json +0 -36
  363. package/web-dev-server.config.js +0 -25
  364. package/web-test-runner.config.js +0 -120
@@ -1,97 +0,0 @@
1
- @import "../utils";
2
-
3
- :host {
4
- --u-common-button-line-height: var(--u-label-large-line-height, 1.25rem);
5
- --u-common-button-font-size: var(--u-label-large-font-size, 0.875rem);
6
- --u-common-button-font-weight: #{get-font-weight-var(medium)};
7
- --_common-button-height: var(--u-common-button-height, 2.5rem);
8
- --_common-button-padding: var(--u-common-button-padding, 24px);
9
- --_common-button-icon-padding: var(--u-common-button-icon-padding, 16px);
10
-
11
- border-radius: var(--u-common-button-shape-corner, #{get-shaper-corner-var(full)});
12
- font-family: var(--u-font-family-base, system-ui);
13
- height: var(--u-common-button-height, 40px);
14
- font-size: var(--u-common-button-font-size);
15
- font-weight: var(--u-common-button-font-weight);
16
- padding-inline: var(--_common-button-padding);
17
- box-sizing: border-box;
18
- }
19
-
20
- :host([variant=filled]),
21
- :host([variant=filled][color=primary]) {
22
- background-color: var(--u-filled-button-primary-container-color, var(--_color-primary));
23
- color: var(--u-filled-button-primary-text-color, #{get-color-var(on-primary)});
24
- }
25
-
26
- :host([variant=filled][color=secondary]) {
27
- background-color: var(--u-filled-button-secondary-container-color, #{get-color-var(secondary)});
28
- color: var(--u-filled-button-secondary-text-color, #{get-color-var(on-secondary)});
29
- }
30
-
31
- :host([variant=filled][color=tertiary]) {
32
- background-color: var(--u-filled-button-tertiary-container-color, #{get-color-var(tertiary)});
33
- color: var(--u-filled-button-tertiary-text-color, #{get-color-var(on-tertiary)});
34
- }
35
-
36
- :host([variant=filled][color=error]) {
37
- background-color: var(--u-filled-button-error-container-color, #{get-color-var(error)});
38
- color: var(--u-filled-button-error-text-color, #{get-color-var(on-error)});
39
- }
40
-
41
- :host([variant=tonal]) {
42
- background-color: var(--u-tonal-button-background-color, #{get-color-var(secondary-container)});
43
- color: var(--u-tonal-button-text-color, #{get-color-var(on-secondary-container)});
44
- }
45
-
46
- :host([variant=elevated]) {
47
- background-color: var(--u-elevated-button-background-color, #{get-color-var(surface-container-low)});
48
- color: var(--u-tonal-button-text-color, #{get-color-var(on-secondary-container)});
49
- }
50
-
51
- @media (hover: hover) {
52
- :host([variant=filled]:hover:not(:focus-within):not(:active)),
53
- :host([variant=tonal]:hover:not(:focus-within):not(:active)) {
54
- --u-elevation-level: var(--u-filled-button-hover-elevation-level, 1);
55
- }
56
- }
57
-
58
- :host([variant=outlined]),
59
- :host([variant=text]),
60
- :host([variant=elevated]) {
61
- color: var(--_color-primary);
62
- }
63
-
64
- :host([variant=outlined]) {
65
- border: 1px solid #{get-color-var(outline-color)};
66
- }
67
-
68
- :host([variant=elevated]) {
69
- --u-elevation-level: var(--u-elevated-button-elevation-level, 1);
70
- }
71
-
72
- @media (hover: hover) {
73
- :host([variant=elevated]:hover) {
74
- --u-elevation-level: var(--u-elevated-button-hover-elevation-level, 2);
75
- }
76
- }
77
-
78
- :host([has-icon]) {
79
- padding-inline: var(--_common-button-icon-padding) var(--_common-button-padding);
80
- }
81
-
82
- :host([has-icon][trailing-icon]) {
83
- padding-inline: var(--_common-button-padding) var(--_common-button-icon-padding);
84
- }
85
-
86
- ::slotted([slot=icon]) {
87
- display: inline-block;
88
- width: var(--u-common-button-icon-size, 1.125rem);
89
- height: var(--u-common-button-icon-size, 1.125rem);
90
- margin-inline-end: 8px;
91
- font-size: var(--u-common-button-icon-size, 1.125rem);
92
- line-height: var(--u-common-button-icon-size, 1.125rem);
93
- }
94
-
95
- :host([trailing-icon]) ::slotted([slot=icon]) {
96
- margin-inline: 8px 0;
97
- }
@@ -1,64 +0,0 @@
1
- import { CSSResult, html, HTMLTemplateResult, nothing } from 'lit';
2
- import { customElement, property, queryAssignedElements } from 'lit/decorators.js';
3
-
4
- import { UmButtonBase } from './button-base';
5
- import { styles as buttonBaseStyles } from './button-base.styles';
6
- import { styles } from './button.styles';
7
- import '../ripple/ripple.js';
8
-
9
- export type UmButtonVariant = 'filled' | 'tonal' | 'elevated' | 'outlined' | 'text';
10
- export type UmButtonColor = 'primary' | 'secondary' | 'tertiary' | 'error' | undefined;
11
-
12
- @customElement('u-button')
13
- export class UmButton extends UmButtonBase {
14
-
15
- static override styles: CSSResult | CSSResult[] = [buttonBaseStyles, styles];
16
-
17
- /**
18
- * The Button variant to render
19
- */
20
- @property({reflect: true}) variant: UmButtonVariant = 'filled';
21
-
22
- /**
23
- * The Button color
24
- *
25
- * _Note:_ Filled buttons only
26
- */
27
- @property({reflect: true}) color: UmButtonColor;
28
-
29
- @property({type: Boolean, attribute: 'trailing-icon', reflect: true}) trailingIcon = false;
30
-
31
- /**
32
- * Whether the button has icon or not
33
- *
34
- * _Note:_ Readonly
35
- */
36
- @property({type: Boolean, attribute: 'has-icon', reflect: true}) hasIcon = false;
37
-
38
- @queryAssignedElements({slot: 'icon', flatten: true})
39
- private readonly assignedIcons!: HTMLElement[];
40
-
41
- protected override renderContent(): HTMLTemplateResult {
42
- const icon = html`
43
- <slot
44
- name="icon"
45
- aria-hidden="true"
46
- @slotchange="${this.handleSlotChange}"></slot>`;
47
-
48
- return html`
49
- ${this.trailingIcon ? nothing : icon}
50
- <span><slot></slot></span>
51
- ${this.trailingIcon ? icon : nothing}
52
- `;
53
- }
54
-
55
- private handleSlotChange() {
56
- this.hasIcon = this.assignedIcons.length > 0;
57
- }
58
- }
59
-
60
- declare global {
61
- interface HTMLElementTagNameMap {
62
- 'u-button': UmButton;
63
- }
64
- }
@@ -1,90 +0,0 @@
1
- @import "../utils";
2
-
3
- :host {
4
- aspect-ratio: 1;
5
- --u-elevation-level: var(--u-fab-button-elevation-level, 3);
6
- }
7
-
8
- :host([lowered]) {
9
- --u-elevation-level: var(--u-fab-button-elevation-level, 1);
10
- }
11
-
12
- @media (hover: hover) {
13
- :host(:hover:not(:focus-within):not(:active)) {
14
- --u-elevation-level: var(--u-fab-button-hover-elevation-level, 4);
15
- }
16
-
17
- :host(:hover:not(:focus-within):not(:active)[lowered]) {
18
- --u-elevation-level: var(--u-fab-button-elevation-level, 2);
19
- }
20
- }
21
-
22
- @media (hover: hover) {
23
- :host(:hover:not(:focus-within):not(:active)) {
24
- --u-elevation-level: var(--u-fab-button-hover-elevation-level, 4);
25
- }
26
- }
27
-
28
- :host([size="small"]) {
29
- width: var(--u-fab-button-small-size, 40px);
30
- border-radius: var(--u-fab-button-medium-shape-corner, #{get-shaper-corner-var(medium)});
31
- }
32
-
33
- :host([size="large"]) {
34
- width: var(--u-fab-button-medium-size, 96px);
35
- border-radius: var(--u-fab-button-medium-shape-corner, #{get-shaper-corner-var(extra-large)});
36
- }
37
-
38
- :host([extended]),
39
- :host([size="medium"]) {
40
- width: var(--u-fab-button-medium-size, 56px);
41
- border-radius: var(--u-fab-button-medium-shape-corner, #{get-shaper-corner-var(large)});
42
- }
43
-
44
- :host([size="large"]) .icon {
45
- font-size: var(--u-fab-button-icon-size, 2rem);
46
- }
47
-
48
- :host([extended]) .icon,
49
- :host([size="small"]) .icon,
50
- :host([size="medium"]) .icon {
51
- font-size: var(--u-fab-button-icon-size, 1.5rem);
52
- }
53
-
54
- :host([extended]) {
55
- width: auto;
56
- height: var(--u-extended-fab-button-height, 56px);
57
- aspect-ratio: auto;
58
- min-width: var(--u-extended-fab-button-min-width, 80px);
59
- padding-inline: var(--u-extended-fab-button-padding, 16px 24px);
60
- }
61
-
62
- :host([extended]) .icon {
63
- margin-inline-end: var(--u-extended-fab-button-icon-margin, 12px);
64
- }
65
-
66
- :host([color="primary"]) {
67
- background-color: var(--u-fab-button-primary-background-color, #{get-color-var(primary-container)});
68
- color: var(--u-fab-button-primary-text-color, #{get-color-var(on-primary-container)});
69
- }
70
-
71
- :host([color="secondary"]) {
72
- background-color: var(--u-fab-button-secondary-background-color, #{get-color-var(secondary-container)});
73
- color: var(--u-fab-button-secondary-text-color, #{get-color-var(on-secondary-container)});
74
- }
75
-
76
- :host([color="tertiary"]) {
77
- background-color: var(--u-fab-button-tertiary-background-color, #{get-color-var(tertiary-container)});
78
- color: var(--u-fab-button-tertiary-text-color, #{get-color-var(on-tertiary-container)});
79
- }
80
-
81
- :host([color="branded"]),
82
- :host([color="surface"]) {
83
- background-color: var(--u-fab-button-surface-background-color, #{get-color-var(surface-container-high)});
84
- color: var(--u-fab-button-surface-text-color, var(--_color-primary));
85
- }
86
-
87
- :host([color="branded"][lowered]),
88
- :host([color="surface"][lowered]) {
89
- background-color: var(--u-fab-button-surface-background-color, #{get-color-var(surface-container-low)});
90
- }
package/src/button/fab.ts DELETED
@@ -1,55 +0,0 @@
1
- import { CSSResult, html, HTMLTemplateResult, nothing } from 'lit';
2
- import { customElement, property } from 'lit/decorators.js';
3
-
4
- import { UmButtonBase } from './button-base';
5
- import { styles as buttonBaseStyles } from './button-base.styles';
6
- import { styles } from './fab.styles';
7
-
8
- export type UmFabColor = 'primary' | 'secondary' | 'tertiary' | 'surface' | 'branded';
9
- export type UmFabSize = 'small' | 'medium' | 'large';
10
-
11
- @customElement('u-fab')
12
- export class UmFab extends UmButtonBase {
13
-
14
- static override styles: CSSResult | CSSResult[] = [buttonBaseStyles, styles];
15
-
16
- /**
17
- * The FAB color variant to render.
18
- */
19
- @property({reflect: true}) color: UmFabColor = 'primary';
20
-
21
- /**
22
- * The size of the FAB.
23
- */
24
- @property({reflect: true}) size: UmFabSize = 'medium';
25
-
26
- /**
27
- * The text to display the FAB.
28
- */
29
- @property({reflect: true}) label: string | null = null;
30
-
31
- /**
32
- * Lowers the FAB's elevation.
33
- */
34
- @property({type: Boolean, reflect: true}) lowered = false;
35
-
36
- @property({type: Boolean, reflect: true})
37
- get extended(): boolean {
38
- return !!this.label;
39
- }
40
-
41
- protected override renderContent(): HTMLTemplateResult {
42
- const labelTag = html`<span>${this.label}</span>`;
43
-
44
- return html`
45
- <span class="icon" aria-hidden="true"><slot></slot></span>
46
- ${this.label ? labelTag : nothing}
47
- `;
48
- }
49
- }
50
-
51
- declare global {
52
- interface HTMLElementTagNameMap {
53
- 'u-fab': UmFab;
54
- }
55
- }
@@ -1,74 +0,0 @@
1
- @import "../utils";
2
-
3
- :host {
4
- --_surface-container-highest-color: #{get-color-var(surface-container-highest)};
5
-
6
- width: var(--u-icon-button-size, 2.5rem);
7
- height: var(--u-icon-button-size, 2.5rem);
8
- border-radius: var(--u-icon-button-shape-corner, 9999px);
9
- font-family: var(--u-font-family-base, system-ui);
10
-
11
- }
12
-
13
- .icon {
14
- display: inline-flex;
15
- align-items: center;
16
- justify-content: center;
17
- font-size: var(--u-icon-button-icon-size, 1.5rem);
18
- line-height: var(--u-icon-button-icon-size, 1.5rem);
19
-
20
- &.icon-selected {
21
- display: none;
22
- }
23
- }
24
-
25
- :host([selected]) {
26
- .icon:not(.icon-selected) {
27
- display: none;
28
- }
29
-
30
- .icon.icon-selected {
31
- display: inline-block;
32
- }
33
- }
34
-
35
- :host([variant="filled"]) {
36
- background-color: var(--u-filled-icon-button-unselected-background-color, var(--_surface-container-highest-color));
37
- color: var(--u-filled-icon-button-unselected-text-color, var(--_color-primary));
38
- }
39
-
40
- :host([variant="tonal"]) {
41
- background-color: var(--u-total-icon-button-unselected-background-color, var(--_surface-container-highest-color));
42
- color: var(--u-tonal-icon-button-unselected-text-color, #{get-color-var(on-surface-variant)});
43
- }
44
-
45
- :host([selected][variant="filled"]),
46
- :host([variant="filled"]:not([has-selection-icon])) {
47
- background-color: var(--u-filled-icon-button-background-color, var(--_color-primary));
48
- color: var(--u-filled-icon-button-text-color, #{get-color-var(on-primary)});
49
- }
50
-
51
- :host([selected][variant="tonal"]),
52
- :host([variant="tonal"]:not([has-selection-icon])) {
53
- background-color: var(--u-tonal-icon-button-background-color, #{get-color-var(secondary-container)});
54
- color: var(--u-tonal-icon-button-text-color, #{get-color-var(on-secondary-container)});
55
- }
56
-
57
- :host([variant="standard"]),
58
- :host([variant="outlined"]) {
59
- color: #{get-color-var(on-surface-variant)};
60
- }
61
-
62
- :host([variant="outlined"]) {
63
- border: 1px solid #{get-color-var(outline)};
64
- }
65
-
66
- :host([selected][variant="outlined"]) {
67
- border: none;
68
- background-color: var(--u-outlined-icon-button-selected-background-color, #{get-color-var(inverse-surface)});
69
- color: var(--u-outlined-icon-button-selected-text-color, #{get-color-var(inverse-on-surface)});
70
- }
71
-
72
- :host([selected][variant="standard"]) {
73
- color: var(--u-standard-icon-button-selected-text-color, var(--_color-primary));
74
- }
@@ -1,72 +0,0 @@
1
- import { CSSResult, html, HTMLTemplateResult, nothing } from 'lit';
2
- import { customElement, property, queryAssignedElements } from 'lit/decorators.js';
3
-
4
- import '../ripple/ripple.js';
5
- import { UmButtonBase } from './button-base';
6
- import { styles as buttonBaseStyles } from './button-base.styles';
7
- import { styles } from './icon-button.styles';
8
-
9
- export type UmIconButtonVariant = 'standard' | 'filled' | 'tonal' | 'outlined';
10
-
11
- @customElement('u-icon-button')
12
- export class UmIconButton extends UmButtonBase {
13
-
14
- static override styles: CSSResult | CSSResult[] = [buttonBaseStyles, styles];
15
-
16
- @property({reflect: true}) variant: UmIconButtonVariant = 'standard';
17
-
18
- /**
19
- * When true, the button will toggle between selected and unselected
20
- * states
21
- */
22
- @property({type: Boolean}) toggle = false;
23
-
24
- @property({type: Boolean, attribute: 'has-selection-icon', reflect: true}) hasSelectionIcon = false;
25
-
26
- /**
27
- * Sets the selected state. When false, displays the default icon. When true,
28
- * displays the selected icon, or the default icon If no `slot="selected"`
29
- * icon is provided.
30
- */
31
- @property({type: Boolean, reflect: true}) selected = false;
32
-
33
- /**
34
- * The `aria-label` of the button when the button is toggleable and selected.
35
- */
36
- @property({attribute: 'aria-label-selected'}) ariaLabelSelected = '';
37
-
38
- @queryAssignedElements({slot: 'selected', flatten: true})
39
- private readonly selectedIcons!: HTMLElement[];
40
-
41
- protected override renderContent(): HTMLTemplateResult {
42
-
43
- return html`
44
- <span class="icon" aria-hidden="true"><slot></slot></span>
45
- <span class="icon icon-selected" aria-hidden="true">
46
- <slot name="selected" @slotchange="${this.handleSlotChange}"></slot>
47
- </span>
48
- `;
49
- }
50
-
51
- protected override handleClick(_: UIEvent): void {
52
- if (this.toggle) {
53
- this.selected = !this.selected;
54
- }
55
- }
56
-
57
- override getAriaLabel(): string | null | typeof nothing {
58
- return this.selected
59
- ? this.ariaLabelSelected || super.getAriaLabel()
60
- : super.getAriaLabel();
61
- }
62
-
63
- private handleSlotChange() {
64
- this.hasSelectionIcon = this.selectedIcons.length > 0;
65
- }
66
- }
67
-
68
- declare global {
69
- interface HTMLElementTagNameMap {
70
- 'u-icon-button': UmIconButton;
71
- }
72
- }
@@ -1,11 +0,0 @@
1
- :host {
2
- display: block;
3
- }
4
-
5
- :host(:has(slot > *)) {
6
- display: none;
7
- }
8
-
9
- :host([has-content]) {
10
- padding: var(--u-card-padding, 16px);
11
- }
@@ -1,45 +0,0 @@
1
- import { HTMLTemplateResult, LitElement, html } from 'lit';
2
- import { customElement, property } from 'lit/decorators.js';
3
-
4
- import { styles as baseStyles } from '../shared/base.styles';
5
- import { styles } from './card-content.styles';
6
-
7
- @customElement('u-card-content')
8
- export class UmCardContent extends LitElement {
9
-
10
- static override styles = [baseStyles, styles];
11
-
12
- @property({type: Boolean, attribute: 'has-content', reflect: true}) hasContent = false;
13
-
14
- override render(): HTMLTemplateResult {
15
- return html`
16
- <slot @slotchange="${this.handleSlotChange}"></slot>`;
17
- }
18
-
19
- private handleSlotChange(e: Event) {
20
- const slot = <HTMLSlotElement>e.target;
21
-
22
- this.hasContent = slot.assignedElements({flatten: true}).length > 0;
23
-
24
- if (this.hasContent) {
25
- return;
26
- }
27
-
28
- const nodes = slot.assignedNodes({flatten: true});
29
-
30
- for (const node of nodes) {
31
- if (node.nodeValue?.trim()) {
32
- this.hasContent = true;
33
- return;
34
- }
35
- }
36
-
37
- this.hasContent = false;
38
- }
39
- }
40
-
41
- declare global {
42
- interface HTMLElementTagNameMap {
43
- 'u-card-content': UmCardContent;
44
- }
45
- }
@@ -1,9 +0,0 @@
1
- :host {
2
- display: block;
3
- aspect-ratio: 1;
4
- border-radius: var(--u-card-shape-corner, var(--u-shape-corner-medium, 12px));
5
- }
6
-
7
- :host([wide]) {
8
- aspect-ratio: 16/9;
9
- }
@@ -1,24 +0,0 @@
1
- import { HTMLTemplateResult, LitElement, html } from 'lit';
2
- import { customElement, property } from 'lit/decorators.js';
3
-
4
- import { styles as baseStyles } from '../shared/base.styles';
5
- import { styles } from './card-media.styles';
6
-
7
- @customElement('u-card-media')
8
- export class UmCardMedia extends LitElement {
9
-
10
- static override styles = [baseStyles, styles];
11
-
12
- @property({type: Boolean, reflect: true}) wide = false;
13
-
14
- override render(): HTMLTemplateResult {
15
- return html`
16
- <slot></slot>`;
17
- }
18
- }
19
-
20
- declare global {
21
- interface HTMLElementTagNameMap {
22
- 'u-card-media': UmCardMedia;
23
- }
24
- }
@@ -1,27 +0,0 @@
1
- @import "../utils";
2
-
3
- :host {
4
- display: block;
5
- position: relative;
6
- border-radius: var(--u-card-shape-corner, #{get-shaper-corner-var(medium)});
7
- }
8
-
9
- :host(:not(:first-child)) {
10
- margin-top: 8px;
11
- }
12
-
13
- :host([variant=elevated]) {
14
- background-color: #{get-color-var(surface-container-low)};
15
-
16
- u-elevation {
17
- --u-elevation-level: var(--u-elevated-card-elevation-level, 1);
18
- }
19
- }
20
-
21
- :host([variant=filled]) {
22
- background-color: #{get-color-var(surface-container-highest)};
23
- }
24
-
25
- :host([variant=outlined]) {
26
- border: var(--u-outlined-card-outline-width, 1px) solid var(--u-outlined-card-outline-color, #{get-color-var(outline-variant)});
27
- }
package/src/card/card.ts DELETED
@@ -1,37 +0,0 @@
1
- import { html, HTMLTemplateResult, LitElement } from 'lit';
2
- import { customElement, property } from 'lit/decorators.js';
3
-
4
- import { styles as baseStyles } from '../shared/base.styles';
5
- import { styles } from './card.styles';
6
- import './card-content.js';
7
- import './card-media.js';
8
- import '../elevation/elevation.js';
9
-
10
- export type UmCardVariant = 'filled' | 'elevated' | 'outlined';
11
-
12
- @customElement('u-card')
13
- export class UmCard extends LitElement {
14
-
15
- static override styles = [baseStyles, styles];
16
-
17
- /**
18
- * The Card variant to render.
19
- */
20
- @property({reflect: true}) variant: UmCardVariant = 'elevated';
21
-
22
- override render(): HTMLTemplateResult {
23
- return html`
24
- <u-elevation></u-elevation>
25
- <slot name="before-content"></slot>
26
- <u-card-content>
27
- <slot></slot>
28
- </u-card-content>
29
- <slot name="after-content"></slot>`;
30
- }
31
- }
32
-
33
- declare global {
34
- interface HTMLElementTagNameMap {
35
- 'u-card': UmCard;
36
- }
37
- }
@@ -1,77 +0,0 @@
1
- import { css, html, HTMLTemplateResult, LitElement } from 'lit';
2
- import { customElement, query, queryAssignedElements } from 'lit/decorators.js';
3
-
4
- import { UmRipple } from '../ripple/ripple';
5
- import { styles as baseStyles } from '../shared/base.styles';
6
-
7
- @customElement('u-checkbox')
8
- export class UmCheckbox extends LitElement {
9
- static override styles = [
10
- baseStyles,
11
- css`
12
- :host {
13
- position: relative;
14
- display: inline-flex;
15
- justify-content: center;
16
- align-items: center;
17
- width: 48px;
18
- height: 48px;
19
- }
20
-
21
- ::slotted(input) {
22
- position: relative;
23
- padding: 0;
24
- margin: 0;
25
- aspect-ratio: 1;
26
- height: 100%;
27
- z-index: 1;
28
- appearance: none;
29
- }
30
-
31
- .touch {
32
- position: absolute;
33
- inset: 0;
34
- border-radius: 9999px;
35
- }
36
- `
37
- ];
38
-
39
- @query('u-ripple') private readonly ripple!: UmRipple;
40
- @queryAssignedElements({selector: 'input', flatten: true})
41
- private readonly assignedInputs!: HTMLInputElement[];
42
-
43
- private input: HTMLInputElement | undefined;
44
-
45
- override render(): HTMLTemplateResult {
46
- return html`
47
- <div class="touch">
48
- <u-ripple><slot @slotchange="${this.handleSlotChange}"></slot></u-ripple>
49
- </div>`;
50
- }
51
-
52
- private handleSlotChange(): void {
53
- console.log('slotchange');
54
-
55
- if (this.input) {
56
- this.input.removeEventListener('click', this.handleInputChange);
57
- }
58
-
59
- this.input = this.assignedInputs[0];
60
-
61
- if (this.input) {
62
- this.input.addEventListener('click', this.handleInputChange);
63
- }
64
- }
65
-
66
- private handleInputChange = (e: MouseEvent) => {
67
- if (this.input !== document.elementFromPoint(e.clientX, e.clientY)) {
68
- this.ripple.createRipple();
69
- }
70
- };
71
- }
72
-
73
- declare global {
74
- interface HTMLElementTagNameMap {
75
- 'u-checkbox': UmCheckbox;
76
- }
77
- }