@universal-material/web 3.0.10 → 3.0.11

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
@@ -0,0 +1,146 @@
1
+ import { argbFromHex, CorePalette, TonalPalette } from '@material/material-color-utilities';
2
+ import { CssVarBuilder } from './css-var-builder.js';
3
+ import { neutralColors, neutralVariantColors } from './neutral-colors.js';
4
+ function getCss(selector, content) {
5
+ return `${selector} {
6
+ ${content}}`;
7
+ }
8
+ export class ThemeBuilder {
9
+ constructor() {
10
+ this.colors = [];
11
+ this.commonColors = [];
12
+ this.partial = false;
13
+ this.cssClass = null;
14
+ }
15
+ static create(primaryColorHex) {
16
+ return new ThemeBuilder()
17
+ .addColorFromHex('primary', primaryColorHex);
18
+ }
19
+ static createPartial() {
20
+ const themeBuilder = new ThemeBuilder();
21
+ themeBuilder.partial = true;
22
+ return themeBuilder;
23
+ }
24
+ addColorFromHex(name, hex) {
25
+ const palette = TonalPalette.fromInt(argbFromHex(hex));
26
+ this.addColorFromPalette(name, palette);
27
+ return this;
28
+ }
29
+ addColorFromPalette(name, palette) {
30
+ this.colors.push({ name, lightTone: 40, darkTone: 80, tonalPalette: palette });
31
+ this.colors.push({ name: `on-${name}`, lightTone: 100, darkTone: 20, tonalPalette: palette });
32
+ this.colors.push({ name: `${name}-container`, lightTone: 90, darkTone: 30, tonalPalette: palette });
33
+ this.colors.push({ name: `on-${name}-container`, lightTone: 10, darkTone: 90, tonalPalette: palette });
34
+ this.colors.push({ name: `${name}-fixed`, fixedTone: 90, tonalPalette: palette });
35
+ this.colors.push({ name: `${name}-fixed-dim`, fixedTone: 800, tonalPalette: palette });
36
+ this.colors.push({ name: `on-${name}-fixed`, fixedTone: 10, tonalPalette: palette });
37
+ this.colors.push({ name: `on-${name}-fixed-variant`, fixedTone: 30, tonalPalette: palette });
38
+ return this;
39
+ }
40
+ addCommonColor(name, hex) {
41
+ this.commonColors.push({ name, tonalPalette: TonalPalette.fromInt(argbFromHex(hex)) });
42
+ return this;
43
+ }
44
+ setCssClass(cssClass) {
45
+ this.cssClass = cssClass;
46
+ return this;
47
+ }
48
+ ensureCssClassStartsWithDot() {
49
+ if (!this.cssClass || this.cssClass.startsWith('.')) {
50
+ return;
51
+ }
52
+ this.cssClass = `.${this.cssClass}`;
53
+ }
54
+ ensureThemeColors() {
55
+ const primaryColor = this.colors.find(c => c.name === 'primary');
56
+ const palette = CorePalette.of(primaryColor.tonalPalette.tone(40));
57
+ if (!this.colors.find(c => c.name === 'secondary')) {
58
+ this.addColorFromPalette('secondary', palette.a2);
59
+ }
60
+ if (!this.colors.find(c => c.name === 'tertiary')) {
61
+ this.addColorFromPalette('tertiary', palette.a3);
62
+ }
63
+ if (!this.neutralColorPalette) {
64
+ this.neutralColorPalette = palette.n1;
65
+ }
66
+ if (!this.neutralVariantColorPalette) {
67
+ this.neutralVariantColorPalette = palette.n2;
68
+ }
69
+ }
70
+ getNeutralVariables(dark) {
71
+ const builder = CssVarBuilder.create();
72
+ this.addColors(builder, neutralColors, this.neutralColorPalette, dark);
73
+ builder
74
+ .add('--u-color-background', "var(--u-color-surface-container-highest)")
75
+ .add('--u-color-inverse-background', "var(--u-color-inverse-surface-container-highest)")
76
+ .add('--u-color-on-background', "var(--u-color-on-surface)")
77
+ .add('--u-color-on-inverse-background', "var(--u-color-inverse-on-surface)");
78
+ return builder.build();
79
+ }
80
+ getNeutralVariantVariables(dark) {
81
+ const builder = CssVarBuilder.create();
82
+ this.addColors(builder, neutralVariantColors, this.neutralColorPalette, dark);
83
+ return builder.build();
84
+ }
85
+ getColorVariables(color, dark) {
86
+ const builder = CssVarBuilder.create();
87
+ this.addToneColor(builder, color, color.tonalPalette, dark);
88
+ return builder.build();
89
+ }
90
+ getColorsVariables(dark) {
91
+ let variables = '';
92
+ for (const color of this.colors) {
93
+ variables += this.getColorVariables(color, dark);
94
+ }
95
+ if (this.neutralColorPalette) {
96
+ variables += this.getNeutralVariables(dark);
97
+ }
98
+ if (this.neutralVariantColorPalette) {
99
+ variables += this.getNeutralVariantVariables(dark);
100
+ }
101
+ return variables;
102
+ }
103
+ addColors(builder, colors, palette, dark) {
104
+ for (const color of colors) {
105
+ this.addToneColor(builder, color, palette, dark);
106
+ }
107
+ }
108
+ addToneColor(builder, color, palette, dark) {
109
+ if (color.fixedTone !== undefined) {
110
+ builder.addFromArgb(color.name, palette.tone(color.fixedTone));
111
+ return;
112
+ }
113
+ const tone = dark
114
+ ? color.darkTone
115
+ : color.lightTone;
116
+ const inverseTone = dark
117
+ ? color.lightTone
118
+ : color.darkTone;
119
+ builder
120
+ .addFromArgb(color.name, palette.tone(tone))
121
+ .addFromArgb(`inverse-${color.name}`, palette.tone(inverseTone));
122
+ if (dark) {
123
+ return;
124
+ }
125
+ builder
126
+ .addFromArgb(`light-${color.name}`, palette.tone(color.lightTone))
127
+ .addFromArgb(`dark-${color.name}`, palette.tone(color.darkTone));
128
+ }
129
+ build() {
130
+ this.ensureCssClassStartsWithDot();
131
+ const lightCssClass = this.cssClass ?? ':root';
132
+ const darkCssClass = this.cssClass
133
+ ? `${this.cssClass}.u-dark-mode,
134
+ ${this.cssClass} .u-dark-mode`
135
+ : '.u-dark-mode';
136
+ if (!this.partial) {
137
+ this.ensureThemeColors();
138
+ }
139
+ const variables = `${getCss(lightCssClass, `${this.getColorsVariables(false)}`)}
140
+
141
+ ${getCss(darkCssClass, this.getColorsVariables(true))}
142
+ `;
143
+ return variables;
144
+ }
145
+ }
146
+ //# sourceMappingURL=theme-builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-builder.js","sourceRoot":"","sources":["../../src/theme/theme-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAG5F,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAG1E,SAAS,MAAM,CAAC,QAAgB,EAAE,OAAe;IAC/C,OAAO,GAAG,QAAQ;EAClB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,OAAO,YAAY;IASvB;QAPA,WAAM,GAAiB,EAAE,CAAC;QAC1B,iBAAY,GAAiB,EAAE,CAAC;QAIxB,YAAO,GAAG,KAAK,CAAC;QAGtB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,eAAuB;QACnC,OAAO,IAAI,YAAY,EAAE;aACtB,eAAe,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,CAAC,aAAa;QAClB,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;QACxC,YAAY,CAAC,OAAO,GAAG,IAAI,CAAC;QAE5B,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,eAAe,CAAC,IAAY,EAAE,GAAW;QACvC,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG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port { Color } from './color.js';\nimport { CssVarBuilder } from './css-var-builder.js';\nimport { neutralColors, neutralVariantColors } from './neutral-colors.js';\nimport { ThemeColor } from './theme-color.js';\n\nfunction getCss(selector: string, content: string): string {\n return `${selector} {\n${content}}`;\n}\n\nexport class ThemeBuilder {\n cssClass: string | null;\n colors: ThemeColor[] = [];\n commonColors: ThemeColor[] = [];\n neutralColorPalette!: TonalPalette;\n neutralVariantColorPalette!: TonalPalette;\n\n private partial = false;\n\n private constructor() {\n this.cssClass = null;\n }\n\n static create(primaryColorHex: string): ThemeBuilder {\n return new ThemeBuilder()\n .addColorFromHex('primary', primaryColorHex);\n }\n\n static createPartial(): ThemeBuilder {\n const themeBuilder = new ThemeBuilder();\n themeBuilder.partial = true;\n\n return themeBuilder;\n }\n\n addColorFromHex(name: string, hex: string): ThemeBuilder {\n const palette = TonalPalette.fromInt(argbFromHex(hex));\n\n this.addColorFromPalette(name, palette);\n return this;\n }\n\n addColorFromPalette(name: string, palette: TonalPalette): ThemeBuilder {\n this.colors.push({name, lightTone: 40, darkTone: 80, tonalPalette: palette});\n this.colors.push({name: `on-${name}`, lightTone: 100, darkTone: 20, tonalPalette: palette});\n this.colors.push({name: `${name}-container`, lightTone: 90, darkTone: 30, tonalPalette: palette});\n this.colors.push({name: `on-${name}-container`, lightTone: 10, darkTone: 90, tonalPalette: palette});\n\n this.colors.push({name: `${name}-fixed`, fixedTone: 90, tonalPalette: palette});\n this.colors.push({name: `${name}-fixed-dim`, fixedTone: 800, tonalPalette: palette});\n this.colors.push({name: `on-${name}-fixed`, fixedTone: 10, tonalPalette: palette});\n this.colors.push({name: `on-${name}-fixed-variant`, fixedTone: 30, tonalPalette: palette});\n return this;\n }\n\n addCommonColor(name: string, hex: string): ThemeBuilder {\n this.commonColors.push({name, tonalPalette: TonalPalette.fromInt(argbFromHex(hex))})\n return this;\n }\n\n setCssClass(cssClass: string): ThemeBuilder {\n this.cssClass = cssClass;\n return this;\n }\n\n private ensureCssClassStartsWithDot(): void {\n if (!this.cssClass || this.cssClass.startsWith('.')) {\n return;\n }\n\n this.cssClass = `.${this.cssClass}`;\n }\n\n private ensureThemeColors(): void {\n\n const primaryColor = this.colors.find(c => c.name === 'primary')!;\n\n const palette = CorePalette.of(primaryColor.tonalPalette.tone(40));\n\n if (!this.colors.find(c => c.name === 'secondary')) {\n this.addColorFromPalette('secondary', palette.a2);\n }\n\n if (!this.colors.find(c => c.name === 'tertiary')) {\n this.addColorFromPalette('tertiary', palette.a3);\n }\n\n if (!this.neutralColorPalette) {\n this.neutralColorPalette = palette.n1;\n }\n\n if (!this.neutralVariantColorPalette) {\n this.neutralVariantColorPalette = palette.n2;\n }\n }\n\n private getNeutralVariables(dark: boolean): string {\n const builder = CssVarBuilder.create();\n\n this.addColors(builder, neutralColors, this.neutralColorPalette, dark);\n\n builder\n .add('--u-color-background', \"var(--u-color-surface-container-highest)\")\n .add('--u-color-inverse-background', \"var(--u-color-inverse-surface-container-highest)\")\n .add('--u-color-on-background', \"var(--u-color-on-surface)\")\n .add('--u-color-on-inverse-background', \"var(--u-color-inverse-on-surface)\");\n\n return builder.build();\n }\n\n private getNeutralVariantVariables(dark: boolean): string {\n const builder = CssVarBuilder.create();\n\n this.addColors(builder, neutralVariantColors, this.neutralColorPalette, dark);\n\n return builder.build()\n }\n\n getColorVariables(color: ThemeColor, dark: boolean): string {\n\n const builder = CssVarBuilder.create();\n\n this.addToneColor(builder, color, color.tonalPalette, dark)\n\n return builder.build();\n }\n\n private getColorsVariables(dark: boolean): string {\n let variables = '';\n\n for (const color of this.colors) {\n variables += this.getColorVariables(color, dark);\n }\n\n if (this.neutralColorPalette) {\n variables += this.getNeutralVariables(dark);\n }\n\n if (this.neutralVariantColorPalette) {\n variables += this.getNeutralVariantVariables(dark);\n }\n\n return variables;\n }\n\n private addColors(builder: CssVarBuilder, colors: Color[], palette: TonalPalette, dark: boolean): void {\n for (const color of colors) {\n this.addToneColor(builder, color, palette, dark);\n }\n }\n\n private addToneColor(builder: CssVarBuilder, color: Color, palette: TonalPalette, dark: boolean): void {\n if (color.fixedTone !== undefined) {\n builder.addFromArgb(color.name, palette.tone(color.fixedTone));\n return;\n }\n\n const tone = dark\n ? color.darkTone!\n : color.lightTone!;\n\n const inverseTone = dark\n ? color.lightTone!\n : color.darkTone!;\n\n builder\n .addFromArgb(color.name, palette.tone(tone))\n .addFromArgb(`inverse-${color.name}`, palette.tone(inverseTone));\n\n if (dark) {\n return;\n }\n\n builder\n .addFromArgb(`light-${color.name}`, palette.tone(color.lightTone!))\n .addFromArgb(`dark-${color.name}`, palette.tone(color.darkTone!));\n }\n\n build(): string {\n\n this.ensureCssClassStartsWithDot();\n\n const lightCssClass = this.cssClass ?? ':root';\n const darkCssClass = this.cssClass\n ? `${this.cssClass}.u-dark-mode,\n${this.cssClass} .u-dark-mode`\n : '.u-dark-mode';\n\n if (!this.partial) {\n this.ensureThemeColors();\n }\n\n const variables = `${getCss(lightCssClass, `${this.getColorsVariables(false)}`)}\n\n${getCss(darkCssClass, this.getColorsVariables(true))}\n`;\n return variables;\n }\n}\n"]}
@@ -1,7 +1,6 @@
1
1
  import { TonalPalette } from '@material/material-color-utilities';
2
-
3
2
  import { Color } from './color.js';
4
-
5
3
  export interface ThemeColor extends Color {
6
- tonalPalette: TonalPalette;
4
+ tonalPalette: TonalPalette;
7
5
  }
6
+ //# sourceMappingURL=theme-color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-color.d.ts","sourceRoot":"","sources":["../../src/theme/theme-color.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,WAAW,UAAW,SAAQ,KAAK;IACvC,YAAY,EAAE,YAAY,CAAC;CAC5B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=theme-color.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-color.js","sourceRoot":"","sources":["../../src/theme/theme-color.ts"],"names":[],"mappings":"","sourcesContent":["import { TonalPalette } from '@material/material-color-utilities';\n\nimport { Color } from './color.js';\n\nexport interface ThemeColor extends Color {\n tonalPalette: TonalPalette;\n}\n"]}
package/.editorconfig DELETED
@@ -1,8 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- charset = utf-8
5
- end_of_line = lf
6
- insert_final_newline = true
7
- indent_size = 2
8
- indent_style = space
package/.eleventy.cjs DELETED
@@ -1,21 +0,0 @@
1
- const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight');
2
-
3
- module.exports = function (eleventyConfig) {
4
- eleventyConfig.addPlugin(syntaxHighlight);
5
- eleventyConfig.addPassthroughCopy('docs-src/docs.css');
6
- eleventyConfig.addPassthroughCopy('docs-src/.nojekyll');
7
- eleventyConfig.addPassthroughCopy(
8
- 'node_modules/@webcomponents/webcomponentsjs'
9
- );
10
- eleventyConfig.addPassthroughCopy('node_modules/lit/polyfill-support.js');
11
- return {
12
- dir: {
13
- input: 'docs-src',
14
- output: 'docs',
15
- },
16
- templateExtensionAliases: {
17
- '11ty.cjs': '11ty.js',
18
- '11tydata.cjs': '11tydata.js',
19
- },
20
- };
21
- };
package/.eslintignore DELETED
@@ -1,6 +0,0 @@
1
- node_modules/*
2
- docs/*
3
- docs-src/*
4
- rollup-config.js
5
- custom-elements.json
6
- web-dev-server.config.js
package/.eslintrc.json DELETED
@@ -1,98 +0,0 @@
1
- {
2
- "root": true,
3
- "extends": [
4
- "eslint:recommended",
5
- "plugin:@typescript-eslint/eslint-recommended",
6
- "plugin:@typescript-eslint/recommended"
7
- ],
8
- "parser": "@typescript-eslint/parser",
9
- "parserOptions": {
10
- "ecmaVersion": 2020,
11
- "sourceType": "module"
12
- },
13
- "plugins": [
14
- "@typescript-eslint",
15
- "eslint-plugin-import",
16
- "eslint-plugin-import-helpers",
17
- "unused-imports"
18
- ],
19
- "env": {
20
- "browser": true
21
- },
22
- "rules": {
23
- "no-prototype-builtins": "off",
24
- "@typescript-eslint/ban-types": "off",
25
- "@typescript-eslint/explicit-function-return-type": "off",
26
- "@typescript-eslint/explicit-module-boundary-types": "off",
27
- "@typescript-eslint/no-explicit-any": "error",
28
- "@typescript-eslint/no-empty-function": "off",
29
- "@typescript-eslint/no-non-null-assertion": "off",
30
- "@typescript-eslint/no-unused-vars": [
31
- "error",
32
- {
33
- "argsIgnorePattern": "^_"
34
- }
35
- ],
36
- "eol-last": "error",
37
- "import-helpers/order-imports": [
38
- "error",
39
- {
40
- "alphabetize": {
41
- "order": "asc",
42
- "ignoreCase": true
43
- },
44
- "newlinesBetween": "always",
45
- "groups": [
46
- "/^@angular|^rxjs/",
47
- "module",
48
- "/^locale/messages/",
49
- [
50
- "parent",
51
- "sibling",
52
- "index",
53
- "/^(\\.|@app|@core|@admin|@document-management|@bot-management|core|shared|chatbot)/"
54
- ]
55
- ]
56
- }
57
- ],
58
- "no-else-return": ["error", { "allowElseIf": false }],
59
- "no-lonely-if": "error",
60
- "no-multi-spaces": ["error"],
61
- "no-multiple-empty-lines": ["error", {"max": 1, "maxEOF": 1}],
62
- "padding-line-between-statements": [
63
- "error",
64
- { "blankLine": "always", "prev": "block-like", "next": "*"},
65
- { "blankLine": "always", "prev": "*", "next": "block-like"}
66
- ],
67
- "space-before-blocks": ["error", "always"],
68
- "space-in-parens": ["error", "never"],
69
- "space-before-function-paren": [
70
- "error",
71
- {
72
- "anonymous": "never",
73
- "asyncArrow": "always",
74
- "named": "never"
75
- }
76
- ],
77
- "unused-imports/no-unused-imports": "error"
78
- },
79
- "overrides": [
80
- {
81
- "files": ["rollup.config.js", "web-test-runner.config.js"],
82
- "env": {
83
- "node": true
84
- }
85
- },
86
- {
87
- "files": [
88
- "*_test.ts",
89
- "**/custom_typings/*.ts",
90
- "packages/labs/ssr/src/test/integration/tests/**",
91
- "packages/labs/ssr/src/lib/util/parse5-utils.ts"
92
- ],
93
- "rules": {
94
- "@typescript-eslint/no-explicit-any": "off"
95
- }
96
- }
97
- ]
98
- }
package/.prettierrc.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "trailingComma": "es5",
3
- "tabWidth": 2,
4
- "singleQuote": true,
5
- "bracketSpacing": false,
6
- "arrowParens": "always"
7
- }
@@ -1,9 +0,0 @@
1
- {
2
- // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3
- // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4
-
5
- // List of extensions which should be recommended for users of this workspace.
6
- "recommendations": ["runem.lit-plugin"],
7
- // List of extensions recommended by VS Code that should not be recommended for users of this workspace.
8
- "unwantedRecommendations": []
9
- }
package/CHANGELOG.md DELETED
@@ -1,98 +0,0 @@
1
- # @lit/lit-starter-ts
2
-
3
- ## 2.0.1
4
-
5
- ### Patch Changes
6
-
7
- - [#4451](https://github.com/lit/lit/pull/4451) [`7852e130`](https://github.com/lit/lit/commit/7852e13022c9dcfcff5ed54a215c93420349e318) - Minor security fixes.
8
-
9
- ## 2.0.0
10
-
11
- ### Major Changes
12
-
13
- - [#4141](https://github.com/lit/lit/pull/4141) [`6b515e43`](https://github.com/lit/lit/commit/6b515e43c3a24cc8a593247d3aa72d81bcc724d5) - Update TypeScript to ~5.2.0
14
-
15
- - [#3756](https://github.com/lit/lit/pull/3756) [`f06f7972`](https://github.com/lit/lit/commit/f06f7972a027d2937fe2c68ab5af0274dec57cf4) - Drop IE11 support
16
-
17
- ### Patch Changes
18
-
19
- - [#3814](https://github.com/lit/lit/pull/3814) [`23326c6b`](https://github.com/lit/lit/commit/23326c6b9a6abdf01998dadf5d0f20a643e457aa) - Update to TypeScript v5.0
20
-
21
- - Updated dependencies [[`dfd747cf`](https://github.com/lit/lit/commit/dfd747cf4f7239e0c3bb7134f8acb967d0157654), [`6b515e43`](https://github.com/lit/lit/commit/6b515e43c3a24cc8a593247d3aa72d81bcc724d5), [`23c404fd`](https://github.com/lit/lit/commit/23c404fdec0cd7be834221b6ddf9b659c24ca8a2), [`1040f758`](https://github.com/lit/lit/commit/1040f75861b029527538b4ec36b2cfedcc32988a), [`0f6878dc`](https://github.com/lit/lit/commit/0f6878dc45fd95bbeb8750f277349c1392e2b3ad), [`1db01376`](https://github.com/lit/lit/commit/1db0137699b35d7e7bfac9b2ab274af4100fd7cf), [`2a01471a`](https://github.com/lit/lit/commit/2a01471a5f65fe34bad11e1099281811b8d0f79b), [`6f2833fd`](https://github.com/lit/lit/commit/6f2833fd05f2ecde5386f72d291dafc9dbae0cf7), [`c3e473b4`](https://github.com/lit/lit/commit/c3e473b499ff029b5e1aff01ca8799daf1ca1bbe), [`2eba6997`](https://github.com/lit/lit/commit/2eba69974c9e130e7483f44f9daca308345497d5), [`92cedaa2`](https://github.com/lit/lit/commit/92cedaa2c8cd8a306be3fe25d52e0e47bb044020), [`d27a77ec`](https://github.com/lit/lit/commit/d27a77ec3d3999e872df9218a2b07f90f22eb417), [`7e8491d4`](https://github.com/lit/lit/commit/7e8491d4ed9f0c39d974616c4678552ef50b81df), [`6470807f`](https://github.com/lit/lit/commit/6470807f3a0981f9d418cb26f05969912455d148), [`23326c6b`](https://github.com/lit/lit/commit/23326c6b9a6abdf01998dadf5d0f20a643e457aa), [`09949234`](https://github.com/lit/lit/commit/09949234445388d51bfb4ee24ff28a4c9f82fe17), [`f06f7972`](https://github.com/lit/lit/commit/f06f7972a027d2937fe2c68ab5af0274dec57cf4)]:
22
- - lit@3.0.0
23
-
24
- ## 2.0.0-pre.1
25
-
26
- ### Major Changes
27
-
28
- - [#4141](https://github.com/lit/lit/pull/4141) [`6b515e43`](https://github.com/lit/lit/commit/6b515e43c3a24cc8a593247d3aa72d81bcc724d5) - Update TypeScript to ~5.2.0
29
-
30
- ### Patch Changes
31
-
32
- - Updated dependencies [[`6b515e43`](https://github.com/lit/lit/commit/6b515e43c3a24cc8a593247d3aa72d81bcc724d5), [`0f6878dc`](https://github.com/lit/lit/commit/0f6878dc45fd95bbeb8750f277349c1392e2b3ad), [`2a01471a`](https://github.com/lit/lit/commit/2a01471a5f65fe34bad11e1099281811b8d0f79b), [`2eba6997`](https://github.com/lit/lit/commit/2eba69974c9e130e7483f44f9daca308345497d5), [`d27a77ec`](https://github.com/lit/lit/commit/d27a77ec3d3999e872df9218a2b07f90f22eb417), [`6470807f`](https://github.com/lit/lit/commit/6470807f3a0981f9d418cb26f05969912455d148), [`09949234`](https://github.com/lit/lit/commit/09949234445388d51bfb4ee24ff28a4c9f82fe17)]:
33
- - lit@3.0.0-pre.1
34
-
35
- ## 2.0.0-pre.0
36
-
37
- ### Major Changes
38
-
39
- - [#3756](https://github.com/lit/lit/pull/3756) [`f06f7972`](https://github.com/lit/lit/commit/f06f7972a027d2937fe2c68ab5af0274dec57cf4) - Drop IE11 support
40
-
41
- ### Patch Changes
42
-
43
- - [#3814](https://github.com/lit/lit/pull/3814) [`23326c6b`](https://github.com/lit/lit/commit/23326c6b9a6abdf01998dadf5d0f20a643e457aa) - Update to TypeScript v5.0
44
-
45
- - Updated dependencies [[`dfd747cf`](https://github.com/lit/lit/commit/dfd747cf4f7239e0c3bb7134f8acb967d0157654), [`23c404fd`](https://github.com/lit/lit/commit/23c404fdec0cd7be834221b6ddf9b659c24ca8a2), [`1db01376`](https://github.com/lit/lit/commit/1db0137699b35d7e7bfac9b2ab274af4100fd7cf), [`c3e473b4`](https://github.com/lit/lit/commit/c3e473b499ff029b5e1aff01ca8799daf1ca1bbe), [`92cedaa2`](https://github.com/lit/lit/commit/92cedaa2c8cd8a306be3fe25d52e0e47bb044020), [`23326c6b`](https://github.com/lit/lit/commit/23326c6b9a6abdf01998dadf5d0f20a643e457aa), [`f06f7972`](https://github.com/lit/lit/commit/f06f7972a027d2937fe2c68ab5af0274dec57cf4)]:
46
- - lit@3.0.0-pre.0
47
-
48
- ## 1.0.6
49
-
50
- ### Patch Changes
51
-
52
- - [#4157](https://github.com/lit/lit/pull/4157) [`da32db2e`](https://github.com/lit/lit/commit/da32db2e67547e0f17b7132065559eba2b1d3513) Thanks [@welingtonms](https://github.com/welingtonms)! - Improve bundling and minification recommendations.
53
-
54
- ## 1.0.5
55
-
56
- ### Patch Changes
57
-
58
- - [#3561](https://github.com/lit/lit/pull/3561) [`e5c254e9`](https://github.com/lit/lit/commit/e5c254e96cb5d0f770ec616332e231559325c5c5) - Update dependency `@rollup/plugin-replace`
59
-
60
- ## 1.0.4
61
-
62
- ### Patch Changes
63
-
64
- - [#2922](https://github.com/lit/lit/pull/2922) [`da9db86a`](https://github.com/lit/lit/commit/da9db86a33cba710d439e254df2492f9f6dcbbee) - Update dependencies and remove unused dependencies
65
-
66
- ## 1.0.3
67
-
68
- ### Patch Changes
69
-
70
- - [#2757](https://github.com/lit/lit/pull/2757) [`55841c14`](https://github.com/lit/lit/commit/55841c14f52891357dd93680d3bc5b1da6c89c8a) - Update Rollup and Rollup plugins
71
-
72
- ## 1.0.2
73
-
74
- ### Patch Changes
75
-
76
- - [#2535](https://github.com/lit/lit/pull/2535) [`d1359856`](https://github.com/lit/lit/commit/d1359856698d1af381b335fb757f9282574690b0) - Update the README to indicate that issues and PRs should be filed on the main Lit repo.
77
-
78
- ## 1.0.1
79
-
80
- ### Patch Changes
81
-
82
- - [#2300](https://github.com/lit/lit/pull/2300) [`8b9dcb4d`](https://github.com/lit/lit/commit/8b9dcb4d10e4161083146ae40d0b12174a63d31d) - Fix starter kits so `npm run serve` serves the root directory, and add a link to the `/dev/index.html` component example from `/`.
83
-
84
- - Updated dependencies [[`fcc2b3d0`](https://github.com/lit/lit/commit/fcc2b3d0054e69e6f76588ea9f440117b6d0deed), [`49ecf623`](https://github.com/lit/lit/commit/49ecf6239033e9578184d46116e6b89676d091db), [`1d563e83`](https://github.com/lit/lit/commit/1d563e830c02a2d1a22e1e939f1ace971b1d1ae7)]:
85
- - lit@2.1.0
86
-
87
- ## 1.0.0
88
-
89
- ### Patch Changes
90
-
91
- - [#2113](https://github.com/lit/lit/pull/2113) [`5b2f3642`](https://github.com/lit/lit/commit/5b2f3642ff91931b5b01f8bdd2ed98aba24f1047) - Dependency upgrades including TypeScript 4.4.2
92
-
93
- - [#2103](https://github.com/lit/lit/pull/2103) [`15a8356d`](https://github.com/lit/lit/commit/15a8356ddd59a1e80880a93acd21fadc9c24e14b) - Added Lit dev mode to test and serve commands, controlled via the MODE=dev or MODE=prod environment variables.
94
-
95
- - [#2117](https://github.com/lit/lit/pull/2117) [`eff2fbc7`](https://github.com/lit/lit/commit/eff2fbc7e45cfc2a7b8df21e18c84619dfbcb277) - Updated starter templates to use open-wc analyzer for generating custom-elements.json, and updated basic API docs generater included in the template to the new manifest format.
96
-
97
- - Updated dependencies [[`15a8356d`](https://github.com/lit/lit/commit/15a8356ddd59a1e80880a93acd21fadc9c24e14b), [`5fabe2b5`](https://github.com/lit/lit/commit/5fabe2b5ae4ab8fba9dc2d23a69105d32e4c0705), [`5b2f3642`](https://github.com/lit/lit/commit/5b2f3642ff91931b5b01f8bdd2ed98aba24f1047), [`5fabe2b5`](https://github.com/lit/lit/commit/5fabe2b5ae4ab8fba9dc2d23a69105d32e4c0705), [`5fabe2b5`](https://github.com/lit/lit/commit/5fabe2b5ae4ab8fba9dc2d23a69105d32e4c0705), [`0312f3e5`](https://github.com/lit/lit/commit/0312f3e533611eb3f4f9381594485a33ad003b74)]:
98
- - lit@2.0.0
package/LICENSE DELETED
@@ -1,28 +0,0 @@
1
- BSD 3-Clause License
2
-
3
- Copyright (c) 2019 Google LLC. All rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without
6
- modification, are permitted provided that the following conditions are met:
7
-
8
- 1. Redistributions of source code must retain the above copyright notice, this
9
- list of conditions and the following disclaimer.
10
-
11
- 2. Redistributions in binary form must reproduce the above copyright notice,
12
- this list of conditions and the following disclaimer in the documentation
13
- and/or other materials provided with the distribution.
14
-
15
- 3. Neither the name of the copyright holder nor the names of its
16
- contributors may be used to endorse or promote products derived from
17
- this software without specific prior written permission.
18
-
19
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/docs/.nojekyll DELETED
File without changes
@@ -1,149 +0,0 @@
1
-
2
- <!doctype html>
3
-
4
- <html lang="en">
5
- <head>
6
- <meta charset="utf-8">
7
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
- <title><my-element> ⌲ Docs</title>
9
- <link rel="stylesheet" href="../docs.css">
10
- <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,600|Roboto+Mono">
11
- <link href="../prism-okaidia.css" rel="stylesheet" />
12
- <script src="/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
13
- <script src="/node_modules/lit/polyfill-support.js"></script>
14
- <script type="module" src="../my-element.bundled.js"></script>
15
- </head>
16
- <body>
17
-
18
- <header>
19
- <h1>&lt;my-element></h1>
20
- <h2>A web component just for me.</h2>
21
- </header>
22
-
23
- <nav>
24
- <a href="../">Home</a>
25
- <a href="../examples/">Examples</a>
26
- <a href="">API</a>
27
- <a href="../install/">Install</a>
28
- </nav>
29
- <div id="main-wrapper">
30
- <main>
31
-
32
- <h1>API</h1>
33
-
34
- <h2>&lt;my-element></h2>
35
- <div>
36
- An example element.
37
- </div>
38
-
39
- <h3>Attributes</h3>
40
- <table>
41
- <tr>
42
- <th>Name</th><th>Description</th><th>Type</th><th>Default</th>
43
- </tr>
44
-
45
- <tr>
46
- <td>name</td><td>The name to say "Hello" to.</td><td>string</td><td>'World'</td>
47
- </tr>
48
-
49
- <tr>
50
- <td>count</td><td>The number of times the button has been clicked.</td><td>number</td><td>0</td>
51
- </tr>
52
-
53
- </table>
54
-
55
-
56
- <h3>Properties</h3>
57
- <table>
58
- <tr>
59
- <th>Name</th><th>Attribute</th><th>Description</th><th>Type</th><th>Default</th>
60
- </tr>
61
-
62
- <tr>
63
- <td>name</td><td>name</td><td>The name to say "Hello" to.</td><td>string</td><td>'World'</td>
64
- </tr>
65
-
66
- <tr>
67
- <td>count</td><td>count</td><td>The number of times the button has been clicked.</td><td>number</td><td>0</td>
68
- </tr>
69
-
70
- </table>
71
-
72
-
73
- <h3>Methods</h3>
74
- <table>
75
- <tr>
76
- <th>Name</th><th>Parameters</th><th>Description</th><th>Return</th>
77
- </tr>
78
-
79
- <tr>
80
- <td>sayHello</td><td>
81
-
82
- <table>
83
- <tr>
84
- <th>Name</th><th>Description</th><th>Type</th>
85
- </tr>
86
-
87
- <tr>
88
- <td>name</td><td>The name to say "Hello" to</td><td>string</td>
89
- </tr>
90
-
91
- </table>
92
- </td><td>Formats a greeting</td><td>string</td>
93
- </tr>
94
-
95
- </table>
96
-
97
-
98
- <h3>Events</h3>
99
- <table>
100
- <tr>
101
- <th>Name</th><th>Description</th>
102
- </tr>
103
-
104
- <tr>
105
- <td>count-changed</td><td>Indicates when the count changes</td>
106
- </tr>
107
-
108
- </table>
109
-
110
-
111
- <h3>Slots</h3>
112
- <table>
113
- <tr>
114
- <th>Name</th><th>Description</th>
115
- </tr>
116
-
117
- <tr>
118
- <td>(default)</td><td>This element has a slot</td>
119
- </tr>
120
-
121
- </table>
122
-
123
-
124
- <h3>CSS Shadow Parts</h3>
125
- <table>
126
- <tr>
127
- <th>Name</th><th>Description</th>
128
- </tr>
129
-
130
- <tr>
131
- <td>button</td><td>The button</td>
132
- </tr>
133
-
134
- </table>
135
-
136
-
137
-
138
-
139
- </main>
140
- </div>
141
-
142
- <footer>
143
- <p>
144
- Made with
145
- <a href="https://github.com/lit/lit-element-starter-ts">lit-starter-ts</a>
146
- </p>
147
- </footer>
148
- </body>
149
- </html>