framework7 7.1.5 → 8.0.0-beta.2

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 (603) hide show
  1. package/components/accordion/accordion.js +2 -16
  2. package/components/accordion/accordion.less +0 -3
  3. package/components/actions/actions-class.js +13 -58
  4. package/components/actions/actions-ios.less +42 -0
  5. package/components/actions/actions-md.less +12 -0
  6. package/components/actions/actions-rtl.css +1 -1
  7. package/components/actions/actions-vars.less +17 -42
  8. package/components/actions/actions.css +1 -1
  9. package/components/actions/actions.d.ts +2 -2
  10. package/components/actions/actions.js +0 -4
  11. package/components/actions/actions.less +5 -35
  12. package/components/app/app-class.d.ts +14 -12
  13. package/components/app/app-class.js +93 -75
  14. package/components/app/app-ios.less +0 -2
  15. package/components/app/app-md.less +0 -2
  16. package/components/app/app-vars.less +13 -96
  17. package/components/app/app.less +1 -4
  18. package/components/app/load-module.js +17 -36
  19. package/components/area-chart/area-chart-class.js +8 -64
  20. package/components/area-chart/area-chart.js +0 -3
  21. package/components/area-chart/area-chart.less +0 -3
  22. package/components/autocomplete/autocomplete-class.js +30 -175
  23. package/components/autocomplete/autocomplete-ios.less +0 -8
  24. package/components/autocomplete/autocomplete-rtl.css +1 -1
  25. package/components/autocomplete/autocomplete-vars.less +8 -22
  26. package/components/autocomplete/autocomplete.css +1 -1
  27. package/components/autocomplete/autocomplete.d.ts +1 -3
  28. package/components/autocomplete/autocomplete.js +1 -6
  29. package/components/autocomplete/autocomplete.less +6 -18
  30. package/components/badge/badge-vars.less +3 -6
  31. package/components/badge/badge.less +1 -3
  32. package/components/block/block-vars.less +25 -52
  33. package/components/block/block.less +37 -12
  34. package/components/breadcrumbs/breadcrumbs-rtl.css +1 -1
  35. package/components/breadcrumbs/breadcrumbs-vars.less +31 -15
  36. package/components/breadcrumbs/breadcrumbs.css +1 -1
  37. package/components/breadcrumbs/breadcrumbs.js +0 -2
  38. package/components/breadcrumbs/breadcrumbs.less +4 -10
  39. package/components/button/button-vars.less +42 -43
  40. package/components/button/button.less +24 -26
  41. package/components/calendar/calendar-class.js +81 -401
  42. package/components/calendar/calendar-rtl.css +1 -1
  43. package/components/calendar/calendar-vars.less +32 -46
  44. package/components/calendar/calendar.css +1 -1
  45. package/components/calendar/calendar.js +6 -4
  46. package/components/calendar/calendar.less +10 -21
  47. package/components/card/card-rtl.css +1 -1
  48. package/components/card/card-vars.less +41 -44
  49. package/components/card/card.css +1 -1
  50. package/components/card/card.js +0 -108
  51. package/components/card/card.less +18 -24
  52. package/components/checkbox/checkbox-rtl.css +1 -1
  53. package/components/checkbox/checkbox-vars.less +0 -8
  54. package/components/checkbox/checkbox.css +1 -1
  55. package/components/checkbox/checkbox.less +32 -3
  56. package/components/chip/chip-ios.less +3 -0
  57. package/components/chip/chip-md.less +4 -3
  58. package/components/chip/chip-rtl.css +1 -1
  59. package/components/chip/chip-vars.less +17 -20
  60. package/components/chip/chip.css +1 -1
  61. package/components/chip/chip.less +16 -21
  62. package/components/color-picker/color-picker-class.js +27 -158
  63. package/components/color-picker/color-picker-rtl.css +1 -1
  64. package/components/color-picker/color-picker.css +1 -1
  65. package/components/color-picker/color-picker.js +0 -4
  66. package/components/color-picker/color-picker.less +18 -8
  67. package/components/color-picker/modules/alpha-slider.js +0 -12
  68. package/components/color-picker/modules/brightness-slider.js +0 -8
  69. package/components/color-picker/modules/current-color.js +0 -2
  70. package/components/color-picker/modules/hex.js +0 -12
  71. package/components/color-picker/modules/hs-spectrum.js +0 -20
  72. package/components/color-picker/modules/hsb-sliders.js +0 -18
  73. package/components/color-picker/modules/hue-slider.js +0 -7
  74. package/components/color-picker/modules/initial-current-colors.js +0 -7
  75. package/components/color-picker/modules/palette.js +2 -10
  76. package/components/color-picker/modules/rgb-bars.js +0 -17
  77. package/components/color-picker/modules/rgb-sliders.js +0 -17
  78. package/components/color-picker/modules/sb-spectrum.js +0 -20
  79. package/components/color-picker/modules/wheel.js +0 -28
  80. package/components/contacts-list/contacts-list-md.less +4 -3
  81. package/components/contacts-list/contacts-list-rtl.css +1 -1
  82. package/components/contacts-list/contacts-list-vars.less +3 -15
  83. package/components/contacts-list/contacts-list.css +1 -1
  84. package/components/contacts-list/contacts-list.less +0 -3
  85. package/components/data-table/data-table-class.js +10 -32
  86. package/components/data-table/data-table-rtl.css +1 -1
  87. package/components/data-table/data-table-vars.less +6 -39
  88. package/components/data-table/data-table.css +1 -1
  89. package/components/data-table/data-table.js +0 -8
  90. package/components/data-table/data-table.less +0 -3
  91. package/components/dialog/dialog-class.js +7 -41
  92. package/components/dialog/dialog-ios.less +0 -3
  93. package/components/dialog/dialog-md.less +9 -9
  94. package/components/dialog/dialog-rtl.css +1 -1
  95. package/components/dialog/dialog-vars.less +25 -70
  96. package/components/dialog/dialog.css +1 -1
  97. package/components/dialog/dialog.d.ts +2 -2
  98. package/components/dialog/dialog.js +12 -48
  99. package/components/dialog/dialog.less +8 -4
  100. package/components/fab/fab-rtl.css +1 -1
  101. package/components/fab/fab-vars.less +20 -14
  102. package/components/fab/fab.css +1 -1
  103. package/components/fab/fab.js +0 -21
  104. package/components/fab/fab.less +50 -53
  105. package/components/form/form.d.ts +4 -4
  106. package/components/form/form.js +58 -94
  107. package/components/form/form.less +0 -3
  108. package/components/gauge/gauge-class.js +4 -20
  109. package/components/gauge/gauge.js +0 -9
  110. package/components/gauge/gauge.less +0 -3
  111. package/components/grid/grid-rtl.css +1 -1
  112. package/components/grid/grid-vars.less +0 -7
  113. package/components/grid/grid.css +1 -1
  114. package/components/grid/grid.d.ts +2 -8
  115. package/components/grid/grid.js +1 -225
  116. package/components/grid/grid.less +54 -184
  117. package/components/icon/icon.less +0 -3
  118. package/components/infinite-scroll/infinite-scroll-rtl.css +1 -1
  119. package/components/infinite-scroll/infinite-scroll.css +1 -1
  120. package/components/infinite-scroll/infinite-scroll.js +0 -16
  121. package/components/infinite-scroll/infinite-scroll.less +0 -3
  122. package/components/input/input-ios.less +49 -41
  123. package/components/input/input-md.less +87 -19
  124. package/components/input/input-rtl.css +1 -1
  125. package/components/input/input-vars.less +26 -60
  126. package/components/input/input.css +1 -1
  127. package/components/input/input.js +8 -67
  128. package/components/input/input.less +67 -153
  129. package/components/link/link-vars.less +0 -5
  130. package/components/link/link.less +3 -3
  131. package/components/list/list-md.less +0 -7
  132. package/components/list/list-vars.less +59 -108
  133. package/components/list/list.less +122 -90
  134. package/components/list-index/list-index-class.js +12 -69
  135. package/components/list-index/list-index-rtl.css +1 -1
  136. package/components/list-index/list-index-vars.less +0 -7
  137. package/components/list-index/list-index.css +1 -1
  138. package/components/list-index/list-index.d.ts +1 -3
  139. package/components/list-index/list-index.js +0 -8
  140. package/components/list-index/list-index.less +4 -7
  141. package/components/login-screen/login-screen-class.js +4 -9
  142. package/components/login-screen/login-screen-rtl.css +1 -1
  143. package/components/login-screen/login-screen-vars.less +13 -12
  144. package/components/login-screen/login-screen.css +1 -1
  145. package/components/login-screen/login-screen.js +0 -4
  146. package/components/login-screen/login-screen.less +2 -8
  147. package/components/messagebar/messagebar-class.js +18 -79
  148. package/components/messagebar/messagebar-ios.less +36 -0
  149. package/components/messagebar/messagebar-md.less +96 -16
  150. package/components/messagebar/messagebar-rtl.css +1 -1
  151. package/components/messagebar/messagebar-vars.less +27 -50
  152. package/components/messagebar/messagebar.css +1 -1
  153. package/components/messagebar/messagebar.js +0 -8
  154. package/components/messagebar/messagebar.less +11 -42
  155. package/components/messages/messages-class.js +17 -110
  156. package/components/messages/messages-ios.less +9 -0
  157. package/components/messages/messages-md.less +63 -28
  158. package/components/messages/messages-rtl.css +1 -1
  159. package/components/messages/messages-vars.less +43 -50
  160. package/components/messages/messages.css +1 -1
  161. package/components/messages/messages.js +0 -8
  162. package/components/messages/messages.less +0 -11
  163. package/components/modal/custom-modal-class.js +4 -14
  164. package/components/modal/modal-class.js +19 -55
  165. package/components/modal/modal.js +0 -3
  166. package/components/navbar/navbar-ios.less +3 -39
  167. package/components/navbar/navbar-md.less +12 -0
  168. package/components/navbar/navbar-vars.less +20 -49
  169. package/components/navbar/navbar.d.ts +0 -2
  170. package/components/navbar/navbar.js +37 -166
  171. package/components/navbar/navbar.less +4 -26
  172. package/components/notification/notification-class.js +4 -39
  173. package/components/notification/notification-md.less +18 -8
  174. package/components/notification/notification-rtl.css +1 -1
  175. package/components/notification/notification-vars.less +15 -54
  176. package/components/notification/notification.css +1 -1
  177. package/components/notification/notification.js +0 -2
  178. package/components/notification/notification.less +0 -3
  179. package/components/page/page-md.less +40 -10
  180. package/components/page/page-transitions/circle.less +15 -9
  181. package/components/page/page-transitions/fade.less +17 -11
  182. package/components/page/page-transitions/flip.less +9 -4
  183. package/components/page/page-vars.less +3 -19
  184. package/components/page/page.less +2 -10
  185. package/components/panel/panel-class.js +27 -132
  186. package/components/panel/panel-md.less +9 -0
  187. package/components/panel/panel-rtl.css +1 -1
  188. package/components/panel/panel-vars.less +7 -21
  189. package/components/panel/panel.css +1 -1
  190. package/components/panel/panel.d.ts +2 -2
  191. package/components/panel/panel.js +0 -34
  192. package/components/panel/panel.less +56 -48
  193. package/components/panel/resizable-panel.js +2 -32
  194. package/components/panel/swipe-panel.js +16 -71
  195. package/components/photo-browser/photo-browser-class.js +41 -171
  196. package/components/photo-browser/photo-browser-rtl.css +1 -1
  197. package/components/photo-browser/photo-browser-vars.less +0 -3
  198. package/components/photo-browser/photo-browser.css +1 -1
  199. package/components/photo-browser/photo-browser.d.ts +2 -4
  200. package/components/photo-browser/photo-browser.js +1 -6
  201. package/components/photo-browser/photo-browser.less +0 -4
  202. package/components/picker/picker-class.js +26 -133
  203. package/components/picker/picker-column.js +11 -31
  204. package/components/picker/picker-ios.less +10 -0
  205. package/components/picker/picker-md.less +6 -0
  206. package/components/picker/picker-rtl.css +1 -1
  207. package/components/picker/picker-vars.less +9 -25
  208. package/components/picker/picker.css +1 -1
  209. package/components/picker/picker.js +0 -4
  210. package/components/picker/picker.less +0 -11
  211. package/components/pie-chart/pie-chart-class.js +8 -31
  212. package/components/pie-chart/pie-chart.js +0 -3
  213. package/components/pie-chart/pie-chart.less +0 -3
  214. package/components/popover/popover-class.js +72 -126
  215. package/components/popover/popover-ios.less +0 -50
  216. package/components/popover/popover-rtl.css +1 -1
  217. package/components/popover/popover-vars.less +6 -23
  218. package/components/popover/popover.css +1 -1
  219. package/components/popover/popover.d.ts +2 -0
  220. package/components/popover/popover.js +1 -12
  221. package/components/popover/popover.less +62 -5
  222. package/components/popup/popup-class.js +12 -78
  223. package/components/popup/popup-rtl.css +1 -1
  224. package/components/popup/popup-vars.less +7 -9
  225. package/components/popup/popup.css +1 -1
  226. package/components/popup/popup.js +0 -4
  227. package/components/popup/popup.less +4 -4
  228. package/components/preloader/preloader-ios.less +3 -1
  229. package/components/preloader/preloader-md.less +5 -1
  230. package/components/preloader/preloader-rtl.css +1 -1
  231. package/components/preloader/preloader-vars.less +0 -6
  232. package/components/preloader/preloader.css +1 -1
  233. package/components/preloader/preloader.js +8 -25
  234. package/components/preloader/preloader.less +6 -3
  235. package/components/progressbar/progressbar-rtl.css +1 -1
  236. package/components/progressbar/progressbar-vars.less +2 -12
  237. package/components/progressbar/progressbar.css +1 -1
  238. package/components/progressbar/progressbar.js +2 -31
  239. package/components/progressbar/progressbar.less +0 -3
  240. package/components/pull-to-refresh/pull-to-refresh-class.js +15 -107
  241. package/components/pull-to-refresh/pull-to-refresh-md.less +2 -1
  242. package/components/pull-to-refresh/pull-to-refresh-rtl.css +1 -1
  243. package/components/pull-to-refresh/pull-to-refresh-vars.less +0 -4
  244. package/components/pull-to-refresh/pull-to-refresh.css +1 -1
  245. package/components/pull-to-refresh/pull-to-refresh.js +0 -8
  246. package/components/pull-to-refresh/pull-to-refresh.less +0 -3
  247. package/components/radio/radio-rtl.css +1 -1
  248. package/components/radio/radio-vars.less +0 -7
  249. package/components/radio/radio.css +1 -1
  250. package/components/radio/radio.less +12 -5
  251. package/components/range/range-class.js +27 -112
  252. package/components/range/range-rtl.css +1 -1
  253. package/components/range/range-vars.less +10 -32
  254. package/components/range/range.css +1 -1
  255. package/components/range/range.js +0 -12
  256. package/components/range/range.less +0 -3
  257. package/components/searchbar/remove-diacritics.js +0 -4
  258. package/components/searchbar/searchbar-class.js +17 -138
  259. package/components/searchbar/searchbar-md.less +41 -16
  260. package/components/searchbar/searchbar-rtl.css +1 -1
  261. package/components/searchbar/searchbar-vars.less +25 -76
  262. package/components/searchbar/searchbar.css +1 -1
  263. package/components/searchbar/searchbar.d.ts +2 -2
  264. package/components/searchbar/searchbar.js +0 -15
  265. package/components/searchbar/searchbar.less +14 -28
  266. package/components/sheet/sheet-class.js +15 -110
  267. package/components/sheet/sheet-rtl.css +1 -1
  268. package/components/sheet/sheet-vars.less +17 -6
  269. package/components/sheet/sheet.css +1 -1
  270. package/components/sheet/sheet.js +0 -9
  271. package/components/sheet/sheet.less +10 -3
  272. package/components/skeleton/skeleton.less +0 -3
  273. package/components/smart-select/smart-select-class.js +39 -176
  274. package/components/smart-select/smart-select.d.ts +3 -3
  275. package/components/smart-select/smart-select.js +2 -14
  276. package/components/smart-select/smart-select.less +0 -3
  277. package/components/sortable/sortable-rtl.css +1 -1
  278. package/components/sortable/sortable-vars.less +8 -8
  279. package/components/sortable/sortable.css +1 -1
  280. package/components/sortable/sortable.js +0 -44
  281. package/components/sortable/sortable.less +0 -3
  282. package/components/statusbar/statusbar.js +0 -36
  283. package/components/statusbar/statusbar.less +0 -3
  284. package/components/stepper/stepper-class.js +10 -83
  285. package/components/stepper/stepper-rtl.css +1 -1
  286. package/components/stepper/stepper-vars.less +12 -24
  287. package/components/stepper/stepper.css +1 -1
  288. package/components/stepper/stepper.js +0 -12
  289. package/components/stepper/stepper.less +12 -23
  290. package/components/subnavbar/subnavbar-vars.less +3 -18
  291. package/components/subnavbar/subnavbar.js +0 -3
  292. package/components/subnavbar/subnavbar.less +1 -11
  293. package/components/swipeout/swipeout-rtl.css +1 -1
  294. package/components/swipeout/swipeout-vars.less +7 -6
  295. package/components/swipeout/swipeout.css +1 -1
  296. package/components/swipeout/swipeout.js +2 -99
  297. package/components/swipeout/swipeout.less +2 -7
  298. package/components/swiper/swiper-rtl.css +1 -1
  299. package/components/swiper/swiper.css +1 -1
  300. package/components/swiper/swiper.js +15 -48
  301. package/components/swiper/swiper.less +0 -15
  302. package/components/tabs/tabs-rtl.css +1 -1
  303. package/components/tabs/tabs.css +1 -1
  304. package/components/tabs/tabs.js +23 -60
  305. package/components/tabs/tabs.less +1 -3
  306. package/components/text-editor/text-editor-class.js +16 -102
  307. package/components/text-editor/text-editor-rtl.css +1 -1
  308. package/components/text-editor/text-editor-vars.less +12 -16
  309. package/components/text-editor/text-editor.css +1 -1
  310. package/components/text-editor/text-editor.js +0 -8
  311. package/components/text-editor/text-editor.less +0 -6
  312. package/components/timeline/timeline-rtl.css +1 -1
  313. package/components/timeline/timeline-vars.less +13 -47
  314. package/components/timeline/timeline.css +1 -1
  315. package/components/timeline/timeline.less +2 -9
  316. package/components/toast/toast-class.js +2 -16
  317. package/components/toast/toast-rtl.css +1 -1
  318. package/components/toast/toast-vars.less +5 -9
  319. package/components/toast/toast.css +1 -1
  320. package/components/toast/toast.js +0 -3
  321. package/components/toast/toast.less +0 -3
  322. package/components/toggle/toggle-class.js +6 -30
  323. package/components/toggle/toggle-ios.less +5 -1
  324. package/components/toggle/toggle-md.less +27 -11
  325. package/components/toggle/toggle-rtl.css +1 -1
  326. package/components/toggle/toggle-vars.less +19 -21
  327. package/components/toggle/toggle.css +1 -1
  328. package/components/toggle/toggle.js +0 -8
  329. package/components/toggle/toggle.less +0 -4
  330. package/components/toolbar/toolbar-ios.less +2 -2
  331. package/components/toolbar/toolbar-md.less +28 -4
  332. package/components/toolbar/toolbar-vars.less +17 -52
  333. package/components/toolbar/toolbar.js +5 -43
  334. package/components/toolbar/toolbar.less +27 -45
  335. package/components/tooltip/tooltip-class.js +10 -64
  336. package/components/tooltip/tooltip-rtl.css +1 -1
  337. package/components/tooltip/tooltip-vars.less +12 -3
  338. package/components/tooltip/tooltip.css +1 -1
  339. package/components/tooltip/tooltip.js +0 -15
  340. package/components/tooltip/tooltip.less +0 -3
  341. package/components/touch-ripple/touch-ripple-class.js +0 -13
  342. package/components/touch-ripple/touch-ripple.js +0 -4
  343. package/components/touch-ripple/touch-ripple.less +1 -5
  344. package/components/treeview/treeview-rtl.css +1 -1
  345. package/components/treeview/treeview-vars.less +0 -3
  346. package/components/treeview/treeview.css +1 -1
  347. package/components/treeview/treeview.js +2 -11
  348. package/components/treeview/treeview.less +0 -3
  349. package/components/typography/typography-rtl.css +1 -1
  350. package/components/typography/typography.css +1 -1
  351. package/components/typography/typography.less +25 -3
  352. package/components/view/resizable-view.js +2 -24
  353. package/components/view/view-class.js +28 -53
  354. package/components/view/view.d.ts +0 -14
  355. package/components/view/view.js +8 -32
  356. package/components/view/view.less +1 -4
  357. package/components/virtual-list/virtual-list-class.js +58 -146
  358. package/components/virtual-list/virtual-list.d.ts +1 -1
  359. package/components/virtual-list/virtual-list.js +0 -2
  360. package/components/virtual-list/virtual-list.less +0 -3
  361. package/framework7-bundle-rtl.css +3064 -6057
  362. package/framework7-bundle-rtl.min.css +3 -3
  363. package/framework7-bundle.css +3063 -6059
  364. package/framework7-bundle.esm.js +4 -10
  365. package/framework7-bundle.js +6442 -12377
  366. package/framework7-bundle.js.map +1 -1
  367. package/framework7-bundle.less +2 -27
  368. package/framework7-bundle.min.css +3 -3
  369. package/framework7-bundle.min.js +3 -3
  370. package/framework7-bundle.min.js.map +1 -1
  371. package/framework7-lite-bundle.esm.js +4 -10
  372. package/framework7-lite.esm.js +4 -6
  373. package/framework7-rtl.css +803 -1591
  374. package/framework7-rtl.min.css +3 -3
  375. package/framework7-types.d.ts +1 -32
  376. package/framework7.css +803 -1594
  377. package/framework7.d.ts +1 -32
  378. package/framework7.esm.js +4 -6
  379. package/framework7.less +2 -23
  380. package/framework7.min.css +3 -3
  381. package/less/mixins.less +7 -88
  382. package/modules/clicks/clicks.js +10 -22
  383. package/modules/component/$h.js +0 -3
  384. package/modules/component/$jsx.js +0 -5
  385. package/modules/component/component-class.js +13 -66
  386. package/modules/component/component.d.ts +1 -2
  387. package/modules/component/component.js +0 -8
  388. package/modules/component/eventslisteners.js +12 -20
  389. package/modules/component/parse-component.js +18 -20
  390. package/modules/component/snabbdom/h.js +3 -12
  391. package/modules/component/snabbdom/helpers/attachto.js +9 -14
  392. package/modules/component/snabbdom/htmldomapi.js +0 -16
  393. package/modules/component/snabbdom/modules/attributes.js +7 -11
  394. package/modules/component/snabbdom/modules/class.js +4 -8
  395. package/modules/component/snabbdom/modules/dataset.js +3 -7
  396. package/modules/component/snabbdom/modules/eventlisteners.js +16 -22
  397. package/modules/component/snabbdom/modules/hero.js +4 -44
  398. package/modules/component/snabbdom/modules/props.js +5 -9
  399. package/modules/component/snabbdom/modules/style.js +13 -30
  400. package/modules/component/snabbdom/snabbdom.bundle.js +0 -6
  401. package/modules/component/snabbdom/snabbdom.js +13 -72
  402. package/modules/component/snabbdom/thunk.js +3 -11
  403. package/modules/component/snabbdom/tovnode.js +1 -6
  404. package/modules/component/vdom.js +4 -62
  405. package/modules/demo-module.js +0 -8
  406. package/modules/device/device.js +6 -11
  407. package/modules/history/history.js +0 -1
  408. package/modules/resize/resize.js +8 -11
  409. package/modules/router/async-component.js +0 -3
  410. package/modules/router/back.js +86 -275
  411. package/modules/router/clear-previous-history.js +5 -18
  412. package/modules/router/component-loader.js +4 -25
  413. package/modules/router/modal.js +16 -43
  414. package/modules/router/navigate.js +80 -250
  415. package/modules/router/process-route-queue.js +0 -12
  416. package/modules/router/redirect.js +0 -8
  417. package/modules/router/router-class.js +92 -315
  418. package/modules/router/router.d.ts +3 -5
  419. package/modules/router/router.js +0 -3
  420. package/modules/router/swipe-back.js +35 -139
  421. package/modules/router/tab.js +14 -43
  422. package/modules/service-worker/service-worker.js +0 -11
  423. package/modules/store/create-store.js +10 -29
  424. package/modules/touch/touch.d.ts +2 -4
  425. package/modules/touch/touch.js +13 -108
  426. package/package.json +3 -14
  427. package/shared/$jsx.js +0 -6
  428. package/shared/class.js +18 -43
  429. package/shared/constructor-methods.js +0 -11
  430. package/shared/events-class.js +0 -17
  431. package/shared/get-device.js +18 -34
  432. package/shared/get-support.js +2 -8
  433. package/shared/history.js +2 -30
  434. package/shared/material-color-utils.js +728 -0
  435. package/shared/material-colors.js +75 -0
  436. package/shared/modal-methods.js +0 -18
  437. package/shared/utils.d.ts +0 -4
  438. package/shared/utils.js +191 -71
  439. package/components/accordion/accordion-aurora.less +0 -2
  440. package/components/accordion/accordion.lazy.js +0 -1
  441. package/components/actions/actions-aurora.less +0 -9
  442. package/components/actions/actions.lazy.js +0 -1
  443. package/components/app/app-aurora.less +0 -10
  444. package/components/appbar/appbar-aurora.less +0 -2
  445. package/components/appbar/appbar-ios.less +0 -2
  446. package/components/appbar/appbar-md.less +0 -2
  447. package/components/appbar/appbar-rtl.css +0 -1
  448. package/components/appbar/appbar-vars.less +0 -28
  449. package/components/appbar/appbar.css +0 -1
  450. package/components/appbar/appbar.d.ts +0 -14
  451. package/components/appbar/appbar.js +0 -3
  452. package/components/appbar/appbar.lazy.js +0 -1
  453. package/components/appbar/appbar.less +0 -106
  454. package/components/area-chart/area-chart-aurora.less +0 -2
  455. package/components/area-chart/area-chart.lazy.js +0 -1
  456. package/components/autocomplete/autocomplete-aurora.less +0 -17
  457. package/components/autocomplete/autocomplete.lazy.js +0 -1
  458. package/components/badge/badge-aurora.less +0 -2
  459. package/components/block/block-aurora.less +0 -2
  460. package/components/breadcrumbs/breadcrumbs-aurora.less +0 -2
  461. package/components/breadcrumbs/breadcrumbs.lazy.js +0 -1
  462. package/components/button/button-aurora.less +0 -25
  463. package/components/calendar/calendar-aurora.less +0 -2
  464. package/components/calendar/calendar.lazy.js +0 -1
  465. package/components/card/card-aurora.less +0 -2
  466. package/components/card/card.lazy.js +0 -1
  467. package/components/checkbox/checkbox-aurora.less +0 -39
  468. package/components/checkbox/checkbox.lazy.js +0 -1
  469. package/components/chip/chip-aurora.less +0 -14
  470. package/components/chip/chip.lazy.js +0 -1
  471. package/components/color-picker/color-picker-aurora.less +0 -2
  472. package/components/color-picker/color-picker.lazy.js +0 -1
  473. package/components/contacts-list/contacts-list-aurora.less +0 -2
  474. package/components/contacts-list/contacts-list.lazy.js +0 -1
  475. package/components/data-table/data-table-aurora.less +0 -64
  476. package/components/data-table/data-table.lazy.js +0 -1
  477. package/components/dialog/dialog-aurora.less +0 -112
  478. package/components/dialog/dialog.lazy.js +0 -1
  479. package/components/elevation/elevation-aurora.less +0 -2
  480. package/components/elevation/elevation-ios.less +0 -2
  481. package/components/elevation/elevation-md.less +0 -2
  482. package/components/elevation/elevation-rtl.css +0 -1
  483. package/components/elevation/elevation-vars.less +0 -51
  484. package/components/elevation/elevation.css +0 -1
  485. package/components/elevation/elevation.d.ts +0 -14
  486. package/components/elevation/elevation.js +0 -3
  487. package/components/elevation/elevation.lazy.js +0 -1
  488. package/components/elevation/elevation.less +0 -54
  489. package/components/fab/fab-aurora.less +0 -2
  490. package/components/fab/fab.lazy.js +0 -1
  491. package/components/form/form-aurora.less +0 -0
  492. package/components/form/form.lazy.js +0 -1
  493. package/components/gauge/gauge-aurora.less +0 -2
  494. package/components/gauge/gauge.lazy.js +0 -1
  495. package/components/grid/grid-aurora.less +0 -2
  496. package/components/grid/grid.lazy.js +0 -1
  497. package/components/icon/icon-aurora.less +0 -49
  498. package/components/infinite-scroll/infinite-scroll-aurora.less +0 -6
  499. package/components/infinite-scroll/infinite-scroll.lazy.js +0 -1
  500. package/components/input/input-aurora.less +0 -120
  501. package/components/input/input.lazy.js +0 -1
  502. package/components/lazy/lazy-aurora.less +0 -2
  503. package/components/lazy/lazy-ios.less +0 -2
  504. package/components/lazy/lazy-md.less +0 -2
  505. package/components/lazy/lazy-rtl.css +0 -1
  506. package/components/lazy/lazy.css +0 -1
  507. package/components/lazy/lazy.d.ts +0 -57
  508. package/components/lazy/lazy.js +0 -283
  509. package/components/lazy/lazy.lazy.js +0 -1
  510. package/components/lazy/lazy.less +0 -23
  511. package/components/link/link-aurora.less +0 -15
  512. package/components/list/list-aurora.less +0 -25
  513. package/components/list-index/list-index-aurora.less +0 -21
  514. package/components/list-index/list-index.lazy.js +0 -1
  515. package/components/login-screen/login-screen-aurora.less +0 -2
  516. package/components/login-screen/login-screen.lazy.js +0 -1
  517. package/components/menu/menu-aurora.less +0 -8
  518. package/components/menu/menu-ios.less +0 -2
  519. package/components/menu/menu-md.less +0 -2
  520. package/components/menu/menu-rtl.css +0 -1
  521. package/components/menu/menu-vars.less +0 -27
  522. package/components/menu/menu.css +0 -1
  523. package/components/menu/menu.d.ts +0 -32
  524. package/components/menu/menu.js +0 -87
  525. package/components/menu/menu.lazy.js +0 -1
  526. package/components/menu/menu.less +0 -232
  527. package/components/messagebar/messagebar-aurora.less +0 -53
  528. package/components/messagebar/messagebar.lazy.js +0 -1
  529. package/components/messages/messages-aurora.less +0 -137
  530. package/components/messages/messages.lazy.js +0 -1
  531. package/components/navbar/navbar-aurora.less +0 -70
  532. package/components/notification/notification-aurora.less +0 -59
  533. package/components/notification/notification.lazy.js +0 -1
  534. package/components/page/page-aurora.less +0 -49
  535. package/components/panel/panel-aurora.less +0 -2
  536. package/components/panel/panel.lazy.js +0 -1
  537. package/components/photo-browser/photo-browser-aurora.less +0 -2
  538. package/components/photo-browser/photo-browser.lazy.js +0 -1
  539. package/components/picker/picker-aurora.less +0 -2
  540. package/components/picker/picker.lazy.js +0 -1
  541. package/components/pie-chart/pie-chart-aurora.less +0 -2
  542. package/components/pie-chart/pie-chart.lazy.js +0 -1
  543. package/components/popover/popover-aurora.less +0 -56
  544. package/components/popover/popover.lazy.js +0 -1
  545. package/components/popup/popup-aurora.less +0 -2
  546. package/components/popup/popup.lazy.js +0 -1
  547. package/components/preloader/preloader-aurora.less +0 -53
  548. package/components/preloader/preloader.lazy.js +0 -1
  549. package/components/progressbar/progressbar-aurora.less +0 -72
  550. package/components/progressbar/progressbar.lazy.js +0 -1
  551. package/components/pull-to-refresh/pull-to-refresh-aurora.less +0 -122
  552. package/components/pull-to-refresh/pull-to-refresh.lazy.js +0 -1
  553. package/components/radio/radio-aurora.less +0 -86
  554. package/components/radio/radio.lazy.js +0 -1
  555. package/components/range/range-aurora.less +0 -9
  556. package/components/range/range.lazy.js +0 -1
  557. package/components/searchbar/searchbar-aurora.less +0 -86
  558. package/components/searchbar/searchbar.lazy.js +0 -1
  559. package/components/sheet/sheet-aurora.less +0 -2
  560. package/components/sheet/sheet.lazy.js +0 -1
  561. package/components/skeleton/skeleton-aurora.less +0 -2
  562. package/components/skeleton/skeleton.lazy.js +0 -1
  563. package/components/smart-select/smart-select-aurora.less +0 -2
  564. package/components/smart-select/smart-select.lazy.js +0 -1
  565. package/components/sortable/sortable-aurora.less +0 -7
  566. package/components/sortable/sortable.lazy.js +0 -1
  567. package/components/statusbar/statusbar-aurora.less +0 -2
  568. package/components/stepper/stepper-aurora.less +0 -32
  569. package/components/stepper/stepper.lazy.js +0 -1
  570. package/components/subnavbar/subnavbar-aurora.less +0 -51
  571. package/components/swipeout/swipeout-aurora.less +0 -2
  572. package/components/swipeout/swipeout.lazy.js +0 -1
  573. package/components/swiper/swiper-aurora.less +0 -2
  574. package/components/swiper/swiper.lazy.js +0 -1
  575. package/components/tabs/tabs-aurora.less +0 -2
  576. package/components/tabs/tabs.lazy.js +0 -1
  577. package/components/text-editor/text-editor-aurora.less +0 -9
  578. package/components/text-editor/text-editor.lazy.js +0 -1
  579. package/components/timeline/timeline-aurora.less +0 -7
  580. package/components/timeline/timeline.lazy.js +0 -1
  581. package/components/toast/toast-aurora.less +0 -64
  582. package/components/toast/toast.lazy.js +0 -1
  583. package/components/toggle/toggle-aurora.less +0 -26
  584. package/components/toggle/toggle.lazy.js +0 -1
  585. package/components/toolbar/toolbar-aurora.less +0 -43
  586. package/components/tooltip/tooltip-aurora.less +0 -2
  587. package/components/tooltip/tooltip.lazy.js +0 -1
  588. package/components/touch-ripple/touch-ripple-aurora.less +0 -2
  589. package/components/treeview/treeview-aurora.less +0 -31
  590. package/components/treeview/treeview.lazy.js +0 -1
  591. package/components/typography/typography-aurora.less +0 -2
  592. package/components/typography/typography.lazy.js +0 -1
  593. package/components/view/view-aurora.less +0 -2
  594. package/components/virtual-list/virtual-list-aurora.less +0 -2
  595. package/components/virtual-list/virtual-list.lazy.js +0 -1
  596. package/framework7.js +0 -14715
  597. package/framework7.js.map +0 -1
  598. package/framework7.min.js +0 -14
  599. package/framework7.min.js.map +0 -1
  600. package/modules/request/request.d.ts +0 -15
  601. package/modules/request/request.js +0 -11
  602. package/shared/request.d.ts +0 -115
  603. package/shared/request.js +0 -512
@@ -0,0 +1,728 @@
1
+ /* eslint-disable */
2
+ function signum(num) {
3
+ return num < 0 ? -1 : 0 === num ? 0 : 1;
4
+ }
5
+ function lerp(start, stop, amount) {
6
+ return (1 - amount) * start + amount * stop;
7
+ }
8
+ function clampInt(min, max, input) {
9
+ return input < min ? min : input > max ? max : input;
10
+ }
11
+ function sanitizeDegreesDouble(degrees) {
12
+ return (degrees %= 360) < 0 && (degrees += 360), degrees;
13
+ }
14
+ function rotationDirection(from, to) {
15
+ return sanitizeDegreesDouble(to - from) <= 180 ? 1 : -1;
16
+ }
17
+ function differenceDegrees(a, b) {
18
+ return 180 - Math.abs(Math.abs(a - b) - 180);
19
+ }
20
+ function matrixMultiply(row, matrix) {
21
+ return [row[0] * matrix[0][0] + row[1] * matrix[0][1] + row[2] * matrix[0][2], row[0] * matrix[1][0] + row[1] * matrix[1][1] + row[2] * matrix[1][2], row[0] * matrix[2][0] + row[1] * matrix[2][1] + row[2] * matrix[2][2]];
22
+ }
23
+ const SRGB_TO_XYZ = [[.41233895, .35762064, .18051042], [.2126, .7152, .0722], [.01932141, .11916382, .95034478]],
24
+ XYZ_TO_SRGB = [[3.2413774792388685, -1.5376652402851851, -.49885366846268053], [-.9691452513005321, 1.8758853451067872, .04156585616912061], [.05562093689691305, -.20395524564742123, 1.0571799111220335]],
25
+ WHITE_POINT_D65 = [95.047, 100, 108.883];
26
+ function argbFromRgb(red, green, blue) {
27
+ return (255 << 24 | (255 & red) << 16 | (255 & green) << 8 | 255 & blue) >>> 0;
28
+ }
29
+ function argbFromLinrgb(linrgb) {
30
+ return argbFromRgb(delinearized(linrgb[0]), delinearized(linrgb[1]), delinearized(linrgb[2]));
31
+ }
32
+ function redFromArgb(argb) {
33
+ return argb >> 16 & 255;
34
+ }
35
+ function greenFromArgb(argb) {
36
+ return argb >> 8 & 255;
37
+ }
38
+ function blueFromArgb(argb) {
39
+ return 255 & argb;
40
+ }
41
+ function argbFromXyz(x, y, z) {
42
+ const matrix = XYZ_TO_SRGB,
43
+ linearR = matrix[0][0] * x + matrix[0][1] * y + matrix[0][2] * z,
44
+ linearG = matrix[1][0] * x + matrix[1][1] * y + matrix[1][2] * z,
45
+ linearB = matrix[2][0] * x + matrix[2][1] * y + matrix[2][2] * z;
46
+ return argbFromRgb(delinearized(linearR), delinearized(linearG), delinearized(linearB));
47
+ }
48
+ function xyzFromArgb(argb) {
49
+ return matrixMultiply([linearized(redFromArgb(argb)), linearized(greenFromArgb(argb)), linearized(blueFromArgb(argb))], SRGB_TO_XYZ);
50
+ }
51
+ function argbFromLstar(lstar) {
52
+ const component = delinearized(yFromLstar(lstar));
53
+ return argbFromRgb(component, component, component);
54
+ }
55
+ function lstarFromArgb(argb) {
56
+ return 116 * labF(xyzFromArgb(argb)[1] / 100) - 16;
57
+ }
58
+ function yFromLstar(lstar) {
59
+ return 100 * labInvf((lstar + 16) / 116);
60
+ }
61
+ function linearized(rgbComponent) {
62
+ const normalized = rgbComponent / 255;
63
+ return normalized <= .040449936 ? normalized / 12.92 * 100 : 100 * Math.pow((normalized + .055) / 1.055, 2.4);
64
+ }
65
+ function delinearized(rgbComponent) {
66
+ const normalized = rgbComponent / 100;
67
+ let delinearized = 0;
68
+ return delinearized = normalized <= .0031308 ? 12.92 * normalized : 1.055 * Math.pow(normalized, 1 / 2.4) - .055, clampInt(0, 255, Math.round(255 * delinearized));
69
+ }
70
+ function whitePointD65() {
71
+ return WHITE_POINT_D65;
72
+ }
73
+ function labF(t) {
74
+ return t > 216 / 24389 ? Math.pow(t, 1 / 3) : (903.2962962962963 * t + 16) / 116;
75
+ }
76
+ function labInvf(ft) {
77
+ const ft3 = ft * ft * ft;
78
+ return ft3 > 216 / 24389 ? ft3 : (116 * ft - 16) / 903.2962962962963;
79
+ }
80
+ class ViewingConditions {
81
+ constructor(n, aw, nbb, ncb, c, nc, rgbD, fl, fLRoot, z) {
82
+ this.n = n, this.aw = aw, this.nbb = nbb, this.ncb = ncb, this.c = c, this.nc = nc, this.rgbD = rgbD, this.fl = fl, this.fLRoot = fLRoot, this.z = z;
83
+ }
84
+ static make(whitePoint, adaptingLuminance, backgroundLstar, surround, discountingIlluminant) {
85
+ if (whitePoint === void 0) {
86
+ whitePoint = whitePointD65();
87
+ }
88
+ if (adaptingLuminance === void 0) {
89
+ adaptingLuminance = 200 / Math.PI * yFromLstar(50) / 100;
90
+ }
91
+ if (backgroundLstar === void 0) {
92
+ backgroundLstar = 50;
93
+ }
94
+ if (surround === void 0) {
95
+ surround = 2;
96
+ }
97
+ if (discountingIlluminant === void 0) {
98
+ discountingIlluminant = !1;
99
+ }
100
+ const xyz = whitePoint,
101
+ rW = .401288 * xyz[0] + .650173 * xyz[1] + -.051461 * xyz[2],
102
+ gW = -.250268 * xyz[0] + 1.204414 * xyz[1] + .045854 * xyz[2],
103
+ bW = -.002079 * xyz[0] + .048952 * xyz[1] + .953127 * xyz[2],
104
+ f = .8 + surround / 10,
105
+ c = f >= .9 ? lerp(.59, .69, 10 * (f - .9)) : lerp(.525, .59, 10 * (f - .8));
106
+ let d = discountingIlluminant ? 1 : f * (1 - 1 / 3.6 * Math.exp((-adaptingLuminance - 42) / 92));
107
+ d = d > 1 ? 1 : d < 0 ? 0 : d;
108
+ const nc = f,
109
+ rgbD = [d * (100 / rW) + 1 - d, d * (100 / gW) + 1 - d, d * (100 / bW) + 1 - d],
110
+ k = 1 / (5 * adaptingLuminance + 1),
111
+ k4 = k * k * k * k,
112
+ k4F = 1 - k4,
113
+ fl = k4 * adaptingLuminance + .1 * k4F * k4F * Math.cbrt(5 * adaptingLuminance),
114
+ n = yFromLstar(backgroundLstar) / whitePoint[1],
115
+ z = 1.48 + Math.sqrt(n),
116
+ nbb = .725 / Math.pow(n, .2),
117
+ ncb = nbb,
118
+ rgbAFactors = [Math.pow(fl * rgbD[0] * rW / 100, .42), Math.pow(fl * rgbD[1] * gW / 100, .42), Math.pow(fl * rgbD[2] * bW / 100, .42)],
119
+ rgbA = [400 * rgbAFactors[0] / (rgbAFactors[0] + 27.13), 400 * rgbAFactors[1] / (rgbAFactors[1] + 27.13), 400 * rgbAFactors[2] / (rgbAFactors[2] + 27.13)];
120
+ return new ViewingConditions(n, (2 * rgbA[0] + rgbA[1] + .05 * rgbA[2]) * nbb, nbb, ncb, c, nc, rgbD, fl, Math.pow(fl, .25), z);
121
+ }
122
+ }
123
+ ViewingConditions.DEFAULT = ViewingConditions.make();
124
+ class Cam16 {
125
+ constructor(hue, chroma, j, q, m, s, jstar, astar, bstar) {
126
+ this.hue = hue, this.chroma = chroma, this.j = j, this.q = q, this.m = m, this.s = s, this.jstar = jstar, this.astar = astar, this.bstar = bstar;
127
+ }
128
+ distance(other) {
129
+ const dJ = this.jstar - other.jstar,
130
+ dA = this.astar - other.astar,
131
+ dB = this.bstar - other.bstar,
132
+ dEPrime = Math.sqrt(dJ * dJ + dA * dA + dB * dB);
133
+ return 1.41 * Math.pow(dEPrime, .63);
134
+ }
135
+ static fromInt(argb) {
136
+ return Cam16.fromIntInViewingConditions(argb, ViewingConditions.DEFAULT);
137
+ }
138
+ static fromIntInViewingConditions(argb, viewingConditions) {
139
+ const green = (65280 & argb) >> 8,
140
+ blue = 255 & argb,
141
+ redL = linearized((16711680 & argb) >> 16),
142
+ greenL = linearized(green),
143
+ blueL = linearized(blue),
144
+ x = .41233895 * redL + .35762064 * greenL + .18051042 * blueL,
145
+ y = .2126 * redL + .7152 * greenL + .0722 * blueL,
146
+ z = .01932141 * redL + .11916382 * greenL + .95034478 * blueL,
147
+ rC = .401288 * x + .650173 * y - .051461 * z,
148
+ gC = -.250268 * x + 1.204414 * y + .045854 * z,
149
+ bC = -.002079 * x + .048952 * y + .953127 * z,
150
+ rD = viewingConditions.rgbD[0] * rC,
151
+ gD = viewingConditions.rgbD[1] * gC,
152
+ bD = viewingConditions.rgbD[2] * bC,
153
+ rAF = Math.pow(viewingConditions.fl * Math.abs(rD) / 100, .42),
154
+ gAF = Math.pow(viewingConditions.fl * Math.abs(gD) / 100, .42),
155
+ bAF = Math.pow(viewingConditions.fl * Math.abs(bD) / 100, .42),
156
+ rA = 400 * signum(rD) * rAF / (rAF + 27.13),
157
+ gA = 400 * signum(gD) * gAF / (gAF + 27.13),
158
+ bA = 400 * signum(bD) * bAF / (bAF + 27.13),
159
+ a = (11 * rA + -12 * gA + bA) / 11,
160
+ b = (rA + gA - 2 * bA) / 9,
161
+ u = (20 * rA + 20 * gA + 21 * bA) / 20,
162
+ p2 = (40 * rA + 20 * gA + bA) / 20,
163
+ atanDegrees = 180 * Math.atan2(b, a) / Math.PI,
164
+ hue = atanDegrees < 0 ? atanDegrees + 360 : atanDegrees >= 360 ? atanDegrees - 360 : atanDegrees,
165
+ hueRadians = hue * Math.PI / 180,
166
+ ac = p2 * viewingConditions.nbb,
167
+ j = 100 * Math.pow(ac / viewingConditions.aw, viewingConditions.c * viewingConditions.z),
168
+ q = 4 / viewingConditions.c * Math.sqrt(j / 100) * (viewingConditions.aw + 4) * viewingConditions.fLRoot,
169
+ huePrime = hue < 20.14 ? hue + 360 : hue,
170
+ t = 5e4 / 13 * (.25 * (Math.cos(huePrime * Math.PI / 180 + 2) + 3.8)) * viewingConditions.nc * viewingConditions.ncb * Math.sqrt(a * a + b * b) / (u + .305),
171
+ alpha = Math.pow(t, .9) * Math.pow(1.64 - Math.pow(.29, viewingConditions.n), .73),
172
+ c = alpha * Math.sqrt(j / 100),
173
+ m = c * viewingConditions.fLRoot,
174
+ s = 50 * Math.sqrt(alpha * viewingConditions.c / (viewingConditions.aw + 4)),
175
+ jstar = (1 + 100 * .007) * j / (1 + .007 * j),
176
+ mstar = 1 / .0228 * Math.log(1 + .0228 * m),
177
+ astar = mstar * Math.cos(hueRadians),
178
+ bstar = mstar * Math.sin(hueRadians);
179
+ return new Cam16(hue, c, j, q, m, s, jstar, astar, bstar);
180
+ }
181
+ static fromJch(j, c, h) {
182
+ return Cam16.fromJchInViewingConditions(j, c, h, ViewingConditions.DEFAULT);
183
+ }
184
+ static fromJchInViewingConditions(j, c, h, viewingConditions) {
185
+ const q = 4 / viewingConditions.c * Math.sqrt(j / 100) * (viewingConditions.aw + 4) * viewingConditions.fLRoot,
186
+ m = c * viewingConditions.fLRoot,
187
+ alpha = c / Math.sqrt(j / 100),
188
+ s = 50 * Math.sqrt(alpha * viewingConditions.c / (viewingConditions.aw + 4)),
189
+ hueRadians = h * Math.PI / 180,
190
+ jstar = (1 + 100 * .007) * j / (1 + .007 * j),
191
+ mstar = 1 / .0228 * Math.log(1 + .0228 * m),
192
+ astar = mstar * Math.cos(hueRadians),
193
+ bstar = mstar * Math.sin(hueRadians);
194
+ return new Cam16(h, c, j, q, m, s, jstar, astar, bstar);
195
+ }
196
+ static fromUcs(jstar, astar, bstar) {
197
+ return Cam16.fromUcsInViewingConditions(jstar, astar, bstar, ViewingConditions.DEFAULT);
198
+ }
199
+ static fromUcsInViewingConditions(jstar, astar, bstar, viewingConditions) {
200
+ const a = astar,
201
+ b = bstar,
202
+ m = Math.sqrt(a * a + b * b),
203
+ c = (Math.exp(.0228 * m) - 1) / .0228 / viewingConditions.fLRoot;
204
+ let h = Math.atan2(b, a) * (180 / Math.PI);
205
+ h < 0 && (h += 360);
206
+ const j = jstar / (1 - .007 * (jstar - 100));
207
+ return Cam16.fromJchInViewingConditions(j, c, h, viewingConditions);
208
+ }
209
+ toInt() {
210
+ return this.viewed(ViewingConditions.DEFAULT);
211
+ }
212
+ viewed(viewingConditions) {
213
+ const alpha = 0 === this.chroma || 0 === this.j ? 0 : this.chroma / Math.sqrt(this.j / 100),
214
+ t = Math.pow(alpha / Math.pow(1.64 - Math.pow(.29, viewingConditions.n), .73), 1 / .9),
215
+ hRad = this.hue * Math.PI / 180,
216
+ eHue = .25 * (Math.cos(hRad + 2) + 3.8),
217
+ ac = viewingConditions.aw * Math.pow(this.j / 100, 1 / viewingConditions.c / viewingConditions.z),
218
+ p1 = eHue * (5e4 / 13) * viewingConditions.nc * viewingConditions.ncb,
219
+ p2 = ac / viewingConditions.nbb,
220
+ hSin = Math.sin(hRad),
221
+ hCos = Math.cos(hRad),
222
+ gamma = 23 * (p2 + .305) * t / (23 * p1 + 11 * t * hCos + 108 * t * hSin),
223
+ a = gamma * hCos,
224
+ b = gamma * hSin,
225
+ rA = (460 * p2 + 451 * a + 288 * b) / 1403,
226
+ gA = (460 * p2 - 891 * a - 261 * b) / 1403,
227
+ bA = (460 * p2 - 220 * a - 6300 * b) / 1403,
228
+ rCBase = Math.max(0, 27.13 * Math.abs(rA) / (400 - Math.abs(rA))),
229
+ rC = signum(rA) * (100 / viewingConditions.fl) * Math.pow(rCBase, 1 / .42),
230
+ gCBase = Math.max(0, 27.13 * Math.abs(gA) / (400 - Math.abs(gA))),
231
+ gC = signum(gA) * (100 / viewingConditions.fl) * Math.pow(gCBase, 1 / .42),
232
+ bCBase = Math.max(0, 27.13 * Math.abs(bA) / (400 - Math.abs(bA))),
233
+ bC = signum(bA) * (100 / viewingConditions.fl) * Math.pow(bCBase, 1 / .42),
234
+ rF = rC / viewingConditions.rgbD[0],
235
+ gF = gC / viewingConditions.rgbD[1],
236
+ bF = bC / viewingConditions.rgbD[2];
237
+ return argbFromXyz(1.86206786 * rF - 1.01125463 * gF + .14918677 * bF, .38752654 * rF + .62144744 * gF - .00897398 * bF, -.0158415 * rF - .03412294 * gF + 1.04996444 * bF);
238
+ }
239
+ }
240
+ class HctSolver {
241
+ static sanitizeRadians(angle) {
242
+ return (angle + 8 * Math.PI) % (2 * Math.PI);
243
+ }
244
+ static trueDelinearized(rgbComponent) {
245
+ const normalized = rgbComponent / 100;
246
+ let delinearized = 0;
247
+ return delinearized = normalized <= .0031308 ? 12.92 * normalized : 1.055 * Math.pow(normalized, 1 / 2.4) - .055, 255 * delinearized;
248
+ }
249
+ static chromaticAdaptation(component) {
250
+ const af = Math.pow(Math.abs(component), .42);
251
+ return 400 * signum(component) * af / (af + 27.13);
252
+ }
253
+ static hueOf(linrgb) {
254
+ const scaledDiscount = matrixMultiply(linrgb, HctSolver.SCALED_DISCOUNT_FROM_LINRGB),
255
+ rA = HctSolver.chromaticAdaptation(scaledDiscount[0]),
256
+ gA = HctSolver.chromaticAdaptation(scaledDiscount[1]),
257
+ bA = HctSolver.chromaticAdaptation(scaledDiscount[2]),
258
+ a = (11 * rA + -12 * gA + bA) / 11,
259
+ b = (rA + gA - 2 * bA) / 9;
260
+ return Math.atan2(b, a);
261
+ }
262
+ static areInCyclicOrder(a, b, c) {
263
+ return HctSolver.sanitizeRadians(b - a) < HctSolver.sanitizeRadians(c - a);
264
+ }
265
+ static intercept(source, mid, target) {
266
+ return (mid - source) / (target - source);
267
+ }
268
+ static lerpPoint(source, t, target) {
269
+ return [source[0] + (target[0] - source[0]) * t, source[1] + (target[1] - source[1]) * t, source[2] + (target[2] - source[2]) * t];
270
+ }
271
+ static setCoordinate(source, coordinate, target, axis) {
272
+ const t = HctSolver.intercept(source[axis], coordinate, target[axis]);
273
+ return HctSolver.lerpPoint(source, t, target);
274
+ }
275
+ static isBounded(x) {
276
+ return 0 <= x && x <= 100;
277
+ }
278
+ static nthVertex(y, n) {
279
+ const kR = HctSolver.Y_FROM_LINRGB[0],
280
+ kG = HctSolver.Y_FROM_LINRGB[1],
281
+ kB = HctSolver.Y_FROM_LINRGB[2],
282
+ coordA = n % 4 <= 1 ? 0 : 100,
283
+ coordB = n % 2 == 0 ? 0 : 100;
284
+ if (n < 4) {
285
+ const g = coordA,
286
+ b = coordB,
287
+ r = (y - g * kG - b * kB) / kR;
288
+ return HctSolver.isBounded(r) ? [r, g, b] : [-1, -1, -1];
289
+ }
290
+ if (n < 8) {
291
+ const b = coordA,
292
+ r = coordB,
293
+ g = (y - r * kR - b * kB) / kG;
294
+ return HctSolver.isBounded(g) ? [r, g, b] : [-1, -1, -1];
295
+ }
296
+ {
297
+ const r = coordA,
298
+ g = coordB,
299
+ b = (y - r * kR - g * kG) / kB;
300
+ return HctSolver.isBounded(b) ? [r, g, b] : [-1, -1, -1];
301
+ }
302
+ }
303
+ static bisectToSegment(y, targetHue) {
304
+ let left = [-1, -1, -1],
305
+ right = left,
306
+ leftHue = 0,
307
+ rightHue = 0,
308
+ initialized = !1,
309
+ uncut = !0;
310
+ for (let n = 0; n < 12; n++) {
311
+ const mid = HctSolver.nthVertex(y, n);
312
+ if (mid[0] < 0) continue;
313
+ const midHue = HctSolver.hueOf(mid);
314
+ initialized ? (uncut || HctSolver.areInCyclicOrder(leftHue, midHue, rightHue)) && (uncut = !1, HctSolver.areInCyclicOrder(leftHue, targetHue, midHue) ? (right = mid, rightHue = midHue) : (left = mid, leftHue = midHue)) : (left = mid, right = mid, leftHue = midHue, rightHue = midHue, initialized = !0);
315
+ }
316
+ return [left, right];
317
+ }
318
+ static midpoint(a, b) {
319
+ return [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2, (a[2] + b[2]) / 2];
320
+ }
321
+ static criticalPlaneBelow(x) {
322
+ return Math.floor(x - .5);
323
+ }
324
+ static criticalPlaneAbove(x) {
325
+ return Math.ceil(x - .5);
326
+ }
327
+ static bisectToLimit(y, targetHue) {
328
+ const segment = HctSolver.bisectToSegment(y, targetHue);
329
+ let left = segment[0],
330
+ leftHue = HctSolver.hueOf(left),
331
+ right = segment[1];
332
+ for (let axis = 0; axis < 3; axis++) if (left[axis] !== right[axis]) {
333
+ let lPlane = -1,
334
+ rPlane = 255;
335
+ left[axis] < right[axis] ? (lPlane = HctSolver.criticalPlaneBelow(HctSolver.trueDelinearized(left[axis])), rPlane = HctSolver.criticalPlaneAbove(HctSolver.trueDelinearized(right[axis]))) : (lPlane = HctSolver.criticalPlaneAbove(HctSolver.trueDelinearized(left[axis])), rPlane = HctSolver.criticalPlaneBelow(HctSolver.trueDelinearized(right[axis])));
336
+ for (let i = 0; i < 8 && !(Math.abs(rPlane - lPlane) <= 1); i++) {
337
+ const mPlane = Math.floor((lPlane + rPlane) / 2),
338
+ midPlaneCoordinate = HctSolver.CRITICAL_PLANES[mPlane],
339
+ mid = HctSolver.setCoordinate(left, midPlaneCoordinate, right, axis),
340
+ midHue = HctSolver.hueOf(mid);
341
+ HctSolver.areInCyclicOrder(leftHue, targetHue, midHue) ? (right = mid, rPlane = mPlane) : (left = mid, leftHue = midHue, lPlane = mPlane);
342
+ }
343
+ }
344
+ return HctSolver.midpoint(left, right);
345
+ }
346
+ static inverseChromaticAdaptation(adapted) {
347
+ const adaptedAbs = Math.abs(adapted),
348
+ base = Math.max(0, 27.13 * adaptedAbs / (400 - adaptedAbs));
349
+ return signum(adapted) * Math.pow(base, 1 / .42);
350
+ }
351
+ static findResultByJ(hueRadians, chroma, y) {
352
+ let j = 11 * Math.sqrt(y);
353
+ const viewingConditions = ViewingConditions.DEFAULT,
354
+ tInnerCoeff = 1 / Math.pow(1.64 - Math.pow(.29, viewingConditions.n), .73),
355
+ p1 = .25 * (Math.cos(hueRadians + 2) + 3.8) * (5e4 / 13) * viewingConditions.nc * viewingConditions.ncb,
356
+ hSin = Math.sin(hueRadians),
357
+ hCos = Math.cos(hueRadians);
358
+ for (let iterationRound = 0; iterationRound < 5; iterationRound++) {
359
+ const jNormalized = j / 100,
360
+ alpha = 0 === chroma || 0 === j ? 0 : chroma / Math.sqrt(jNormalized),
361
+ t = Math.pow(alpha * tInnerCoeff, 1 / .9),
362
+ p2 = viewingConditions.aw * Math.pow(jNormalized, 1 / viewingConditions.c / viewingConditions.z) / viewingConditions.nbb,
363
+ gamma = 23 * (p2 + .305) * t / (23 * p1 + 11 * t * hCos + 108 * t * hSin),
364
+ a = gamma * hCos,
365
+ b = gamma * hSin,
366
+ rA = (460 * p2 + 451 * a + 288 * b) / 1403,
367
+ gA = (460 * p2 - 891 * a - 261 * b) / 1403,
368
+ bA = (460 * p2 - 220 * a - 6300 * b) / 1403,
369
+ linrgb = matrixMultiply([HctSolver.inverseChromaticAdaptation(rA), HctSolver.inverseChromaticAdaptation(gA), HctSolver.inverseChromaticAdaptation(bA)], HctSolver.LINRGB_FROM_SCALED_DISCOUNT);
370
+ if (linrgb[0] < 0 || linrgb[1] < 0 || linrgb[2] < 0) return 0;
371
+ const kR = HctSolver.Y_FROM_LINRGB[0],
372
+ kG = HctSolver.Y_FROM_LINRGB[1],
373
+ kB = HctSolver.Y_FROM_LINRGB[2],
374
+ fnj = kR * linrgb[0] + kG * linrgb[1] + kB * linrgb[2];
375
+ if (fnj <= 0) return 0;
376
+ if (4 === iterationRound || Math.abs(fnj - y) < .002) return linrgb[0] > 100.01 || linrgb[1] > 100.01 || linrgb[2] > 100.01 ? 0 : argbFromLinrgb(linrgb);
377
+ j -= (fnj - y) * j / (2 * fnj);
378
+ }
379
+ return 0;
380
+ }
381
+ static solveToInt(hueDegrees, chroma, lstar) {
382
+ if (chroma < 1e-4 || lstar < 1e-4 || lstar > 99.9999) return argbFromLstar(lstar);
383
+ const hueRadians = (hueDegrees = sanitizeDegreesDouble(hueDegrees)) / 180 * Math.PI,
384
+ y = yFromLstar(lstar),
385
+ exactAnswer = HctSolver.findResultByJ(hueRadians, chroma, y);
386
+ if (0 !== exactAnswer) return exactAnswer;
387
+ return argbFromLinrgb(HctSolver.bisectToLimit(y, hueRadians));
388
+ }
389
+ static solveToCam(hueDegrees, chroma, lstar) {
390
+ return Cam16.fromInt(HctSolver.solveToInt(hueDegrees, chroma, lstar));
391
+ }
392
+ }
393
+ HctSolver.SCALED_DISCOUNT_FROM_LINRGB = [[.001200833568784504, .002389694492170889, .0002795742885861124], [.0005891086651375999, .0029785502573438758, .0003270666104008398], [.00010146692491640572, .0005364214359186694, .0032979401770712076]], HctSolver.LINRGB_FROM_SCALED_DISCOUNT = [[1373.2198709594231, -1100.4251190754821, -7.278681089101213], [-271.815969077903, 559.6580465940733, -32.46047482791194], [1.9622899599665666, -57.173814538844006, 308.7233197812385]], HctSolver.Y_FROM_LINRGB = [.2126, .7152, .0722], HctSolver.CRITICAL_PLANES = [.015176349177441876, .045529047532325624, .07588174588720938, .10623444424209313, .13658714259697685, .16693984095186062, .19729253930674434, .2276452376616281, .2579979360165119, .28835063437139563, .3188300904430532, .350925934958123, .3848314933096426, .42057480301049466, .458183274052838, .4976837250274023, .5391024159806381, .5824650784040898, .6277969426914107, .6751227633498623, .7244668422128921, .775853049866786, .829304845476233, .8848452951698498, .942497089126609, 1.0022825574869039, 1.0642236851973577, 1.1283421258858297, 1.1946592148522128, 1.2631959812511864, 1.3339731595349034, 1.407011200216447, 1.4823302800086415, 1.5599503113873272, 1.6398909516233677, 1.7221716113234105, 1.8068114625156377, 1.8938294463134073, 1.9832442801866852, 2.075074464868551, 2.1693382909216234, 2.2660538449872063, 2.36523901573795, 2.4669114995532007, 2.5710888059345764, 2.6777882626779785, 2.7870270208169257, 2.898822059350997, 3.0131901897720907, 3.1301480604002863, 3.2497121605402226, 3.3718988244681087, 3.4967242352587946, 3.624204428461639, 3.754355295633311, 3.887192587735158, 4.022731918402185, 4.160988767090289, 4.301978482107941, 4.445716283538092, 4.592217266055746, 4.741496401646282, 4.893568542229298, 5.048448422192488, 5.20615066083972, 5.3666897647573375, 5.5300801301023865, 5.696336044816294, 5.865471690767354, 6.037501145825082, 6.212438385869475, 6.390297286737924, 6.571091626112461, 6.7548350853498045, 6.941541251256611, 7.131223617812143, 7.323895587840543, 7.5195704746346665, 7.7182615035334345, 7.919981813454504, 8.124744458384042, 8.332562408825165, 8.543448553206703, 8.757415699253682, 8.974476575321063, 9.194643831691977, 9.417930041841839, 9.644347703669503, 9.873909240696694, 10.106627003236781, 10.342513269534024, 10.58158024687427, 10.8238400726681, 11.069304815507364, 11.317986476196008, 11.569896988756009, 11.825048221409341, 12.083451977536606, 12.345119996613247, 12.610063955123938, 12.878295467455942, 13.149826086772048, 13.42466730586372, 13.702830557985108, 13.984327217668513, 14.269168601521828, 14.55736596900856, 14.848930523210871, 15.143873411576273, 15.44220572664832, 15.743938506781891, 16.04908273684337, 16.35764934889634, 16.66964922287304, 16.985093187232053, 17.30399201960269, 17.62635644741625, 17.95219714852476, 18.281524751807332, 18.614349837764564, 18.95068293910138, 19.290534541298456, 19.633915083172692, 19.98083495742689, 20.331304511189067, 20.685334046541502, 21.042933821039977, 21.404114048223256, 21.76888489811322, 22.137256497705877, 22.50923893145328, 22.884842241736916, 23.264076429332462, 23.6469514538663, 24.033477234264016, 24.42366364919083, 24.817520537484558, 25.21505769858089, 25.61628489293138, 26.021211842414342, 26.429848230738664, 26.842203703840827, 27.258287870275353, 27.678110301598522, 28.10168053274597, 28.529008062403893, 28.96010235337422, 29.39497283293396, 29.83362889318845, 30.276079891419332, 30.722335150426627, 31.172403958865512, 31.62629557157785, 32.08401920991837, 32.54558406207592, 33.010999283389665, 33.4802739966603, 33.953417292456834, 34.430438229418264, 34.911345834551085, 35.39614910352207, 35.88485700094671, 36.37747846067349, 36.87402238606382, 37.37449765026789, 37.87891309649659, 38.38727753828926, 38.89959975977785, 39.41588851594697, 39.93615253289054, 40.460400508064545, 40.98864111053629, 41.520882981230194, 42.05713473317016, 42.597404951718396, 43.141702194811224, 43.6900349931913, 44.24241185063697, 44.798841244188324, 45.35933162437017, 45.92389141541209, 46.49252901546552, 47.065252796817916, 47.64207110610409, 48.22299226451468, 48.808024568002054, 49.3971762874833, 49.9904556690408, 50.587870934119984, 51.189430279724725, 51.79514187861014, 52.40501387947288, 53.0190544071392, 53.637271562750364, 54.259673423945976, 54.88626804504493, 55.517063457223934, 56.15206766869424, 56.79128866487574, 57.43473440856916, 58.08241284012621, 58.734331877617365, 59.39049941699807, 60.05092333227251, 60.715611475655585, 61.38457167773311, 62.057811747619894, 62.7353394731159, 63.417162620860914, 64.10328893648692, 64.79372614476921, 65.48848194977529, 66.18756403501224, 66.89098006357258, 67.59873767827808, 68.31084450182222, 69.02730813691093, 69.74813616640164, 70.47333615344107, 71.20291564160104, 71.93688215501312, 72.67524319850172, 73.41800625771542, 74.16517879925733, 74.9167682708136, 75.67278210128072, 76.43322770089146, 77.1981124613393, 77.96744375590167, 78.74122893956174, 79.51947534912904, 80.30219030335869, 81.08938110306934, 81.88105503125999, 82.67721935322541, 83.4778813166706, 84.28304815182372, 85.09272707154808, 85.90692527145302, 86.72564993000343, 87.54890820862819, 88.3767072518277, 89.2090541872801, 90.04595612594655, 90.88742016217518, 91.73345337380438, 92.58406282226491, 93.43925555268066, 94.29903859396902, 95.16341895893969, 96.03240364439274, 96.9059996312159, 97.78421388448044, 98.6670533535366, 99.55452497210776];
394
+ class Hct {
395
+ constructor(argb) {
396
+ this.argb = argb;
397
+ const cam = Cam16.fromInt(argb);
398
+ this.internalHue = cam.hue, this.internalChroma = cam.chroma, this.internalTone = lstarFromArgb(argb), this.argb = argb;
399
+ }
400
+ static from(hue, chroma, tone) {
401
+ return new Hct(HctSolver.solveToInt(hue, chroma, tone));
402
+ }
403
+ static fromInt(argb) {
404
+ return new Hct(argb);
405
+ }
406
+ toInt() {
407
+ return this.argb;
408
+ }
409
+ get hue() {
410
+ return this.internalHue;
411
+ }
412
+ set hue(newHue) {
413
+ this.setInternalState(HctSolver.solveToInt(newHue, this.internalChroma, this.internalTone));
414
+ }
415
+ get chroma() {
416
+ return this.internalChroma;
417
+ }
418
+ set chroma(newChroma) {
419
+ this.setInternalState(HctSolver.solveToInt(this.internalHue, newChroma, this.internalTone));
420
+ }
421
+ get tone() {
422
+ return this.internalTone;
423
+ }
424
+ set tone(newTone) {
425
+ this.setInternalState(HctSolver.solveToInt(this.internalHue, this.internalChroma, newTone));
426
+ }
427
+ setInternalState(argb) {
428
+ const cam = Cam16.fromInt(argb);
429
+ this.internalHue = cam.hue, this.internalChroma = cam.chroma, this.internalTone = lstarFromArgb(argb), this.argb = argb;
430
+ }
431
+ }
432
+ class Blend {
433
+ static harmonize(designColor, sourceColor) {
434
+ const fromHct = Hct.fromInt(designColor),
435
+ toHct = Hct.fromInt(sourceColor),
436
+ differenceDegrees$1 = differenceDegrees(fromHct.hue, toHct.hue),
437
+ rotationDegrees = Math.min(.5 * differenceDegrees$1, 15),
438
+ outputHue = sanitizeDegreesDouble(fromHct.hue + rotationDegrees * rotationDirection(fromHct.hue, toHct.hue));
439
+ return Hct.from(outputHue, fromHct.chroma, fromHct.tone).toInt();
440
+ }
441
+ static hctHue(from, to, amount) {
442
+ const ucs = Blend.cam16Ucs(from, to, amount),
443
+ ucsCam = Cam16.fromInt(ucs),
444
+ fromCam = Cam16.fromInt(from);
445
+ return Hct.from(ucsCam.hue, fromCam.chroma, lstarFromArgb(from)).toInt();
446
+ }
447
+ static cam16Ucs(from, to, amount) {
448
+ const fromCam = Cam16.fromInt(from),
449
+ toCam = Cam16.fromInt(to),
450
+ fromJ = fromCam.jstar,
451
+ fromA = fromCam.astar,
452
+ fromB = fromCam.bstar,
453
+ jstar = fromJ + (toCam.jstar - fromJ) * amount,
454
+ astar = fromA + (toCam.astar - fromA) * amount,
455
+ bstar = fromB + (toCam.bstar - fromB) * amount;
456
+ return Cam16.fromUcs(jstar, astar, bstar).toInt();
457
+ }
458
+ }
459
+ class TonalPalette {
460
+ constructor(hue, chroma) {
461
+ this.hue = hue, this.chroma = chroma, this.cache = new Map();
462
+ }
463
+ static fromInt(argb) {
464
+ const hct = Hct.fromInt(argb);
465
+ return TonalPalette.fromHueAndChroma(hct.hue, hct.chroma);
466
+ }
467
+ static fromHueAndChroma(hue, chroma) {
468
+ return new TonalPalette(hue, chroma);
469
+ }
470
+ tone(tone) {
471
+ let argb = this.cache.get(tone);
472
+ return void 0 === argb && (argb = Hct.from(this.hue, this.chroma, tone).toInt(), this.cache.set(tone, argb)), argb;
473
+ }
474
+ }
475
+ class CorePalette {
476
+ constructor(argb, isContent) {
477
+ const hct = Hct.fromInt(argb),
478
+ hue = hct.hue,
479
+ chroma = hct.chroma;
480
+ isContent ? (this.a1 = TonalPalette.fromHueAndChroma(hue, chroma), this.a2 = TonalPalette.fromHueAndChroma(hue, chroma / 3), this.a3 = TonalPalette.fromHueAndChroma(hue + 60, chroma / 2), this.n1 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 12, 4)), this.n2 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 6, 8))) : (this.a1 = TonalPalette.fromHueAndChroma(hue, Math.max(48, chroma)), this.a2 = TonalPalette.fromHueAndChroma(hue, 16), this.a3 = TonalPalette.fromHueAndChroma(hue + 60, 24), this.n1 = TonalPalette.fromHueAndChroma(hue, 4), this.n2 = TonalPalette.fromHueAndChroma(hue, 8)), this.error = TonalPalette.fromHueAndChroma(25, 84);
481
+ }
482
+ static of(argb) {
483
+ return new CorePalette(argb, !1);
484
+ }
485
+ static contentOf(argb) {
486
+ return new CorePalette(argb, !0);
487
+ }
488
+ }
489
+ class Scheme {
490
+ constructor(props) {
491
+ this.props = props;
492
+ }
493
+ get primary() {
494
+ return this.props.primary;
495
+ }
496
+ get onPrimary() {
497
+ return this.props.onPrimary;
498
+ }
499
+ get primaryContainer() {
500
+ return this.props.primaryContainer;
501
+ }
502
+ get onPrimaryContainer() {
503
+ return this.props.onPrimaryContainer;
504
+ }
505
+ get secondary() {
506
+ return this.props.secondary;
507
+ }
508
+ get onSecondary() {
509
+ return this.props.onSecondary;
510
+ }
511
+ get secondaryContainer() {
512
+ return this.props.secondaryContainer;
513
+ }
514
+ get onSecondaryContainer() {
515
+ return this.props.onSecondaryContainer;
516
+ }
517
+ get tertiary() {
518
+ return this.props.tertiary;
519
+ }
520
+ get onTertiary() {
521
+ return this.props.onTertiary;
522
+ }
523
+ get tertiaryContainer() {
524
+ return this.props.tertiaryContainer;
525
+ }
526
+ get onTertiaryContainer() {
527
+ return this.props.onTertiaryContainer;
528
+ }
529
+ get error() {
530
+ return this.props.error;
531
+ }
532
+ get onError() {
533
+ return this.props.onError;
534
+ }
535
+ get errorContainer() {
536
+ return this.props.errorContainer;
537
+ }
538
+ get onErrorContainer() {
539
+ return this.props.onErrorContainer;
540
+ }
541
+ get background() {
542
+ return this.props.background;
543
+ }
544
+ get onBackground() {
545
+ return this.props.onBackground;
546
+ }
547
+ get surface() {
548
+ return this.props.surface;
549
+ }
550
+ get onSurface() {
551
+ return this.props.onSurface;
552
+ }
553
+ get surfaceVariant() {
554
+ return this.props.surfaceVariant;
555
+ }
556
+ get onSurfaceVariant() {
557
+ return this.props.onSurfaceVariant;
558
+ }
559
+ get outline() {
560
+ return this.props.outline;
561
+ }
562
+ get outlineVariant() {
563
+ return this.props.outlineVariant;
564
+ }
565
+ get shadow() {
566
+ return this.props.shadow;
567
+ }
568
+ get scrim() {
569
+ return this.props.scrim;
570
+ }
571
+ get inverseSurface() {
572
+ return this.props.inverseSurface;
573
+ }
574
+ get inverseOnSurface() {
575
+ return this.props.inverseOnSurface;
576
+ }
577
+ get inversePrimary() {
578
+ return this.props.inversePrimary;
579
+ }
580
+ static light(argb) {
581
+ return Scheme.lightFromCorePalette(CorePalette.of(argb));
582
+ }
583
+ static dark(argb) {
584
+ return Scheme.darkFromCorePalette(CorePalette.of(argb));
585
+ }
586
+ static lightContent(argb) {
587
+ return Scheme.lightFromCorePalette(CorePalette.contentOf(argb));
588
+ }
589
+ static darkContent(argb) {
590
+ return Scheme.darkFromCorePalette(CorePalette.contentOf(argb));
591
+ }
592
+ static lightFromCorePalette(core) {
593
+ return new Scheme({
594
+ primary: core.a1.tone(40),
595
+ onPrimary: core.a1.tone(100),
596
+ primaryContainer: core.a1.tone(90),
597
+ onPrimaryContainer: core.a1.tone(10),
598
+ secondary: core.a2.tone(40),
599
+ onSecondary: core.a2.tone(100),
600
+ secondaryContainer: core.a2.tone(90),
601
+ onSecondaryContainer: core.a2.tone(10),
602
+ tertiary: core.a3.tone(40),
603
+ onTertiary: core.a3.tone(100),
604
+ tertiaryContainer: core.a3.tone(90),
605
+ onTertiaryContainer: core.a3.tone(10),
606
+ error: core.error.tone(40),
607
+ onError: core.error.tone(100),
608
+ errorContainer: core.error.tone(90),
609
+ onErrorContainer: core.error.tone(10),
610
+ background: core.n1.tone(99),
611
+ onBackground: core.n1.tone(10),
612
+ surface: core.n1.tone(99),
613
+ onSurface: core.n1.tone(10),
614
+ surfaceVariant: core.n2.tone(90),
615
+ onSurfaceVariant: core.n2.tone(30),
616
+ outline: core.n2.tone(50),
617
+ outlineVariant: core.n2.tone(80),
618
+ shadow: core.n1.tone(0),
619
+ scrim: core.n1.tone(0),
620
+ inverseSurface: core.n1.tone(20),
621
+ inverseOnSurface: core.n1.tone(95),
622
+ inversePrimary: core.a1.tone(80)
623
+ });
624
+ }
625
+ static darkFromCorePalette(core) {
626
+ return new Scheme({
627
+ primary: core.a1.tone(80),
628
+ onPrimary: core.a1.tone(20),
629
+ primaryContainer: core.a1.tone(30),
630
+ onPrimaryContainer: core.a1.tone(90),
631
+ secondary: core.a2.tone(80),
632
+ onSecondary: core.a2.tone(20),
633
+ secondaryContainer: core.a2.tone(30),
634
+ onSecondaryContainer: core.a2.tone(90),
635
+ tertiary: core.a3.tone(80),
636
+ onTertiary: core.a3.tone(20),
637
+ tertiaryContainer: core.a3.tone(30),
638
+ onTertiaryContainer: core.a3.tone(90),
639
+ error: core.error.tone(80),
640
+ onError: core.error.tone(20),
641
+ errorContainer: core.error.tone(30),
642
+ onErrorContainer: core.error.tone(80),
643
+ background: core.n1.tone(10),
644
+ onBackground: core.n1.tone(90),
645
+ surface: core.n1.tone(10),
646
+ onSurface: core.n1.tone(90),
647
+ surfaceVariant: core.n2.tone(30),
648
+ onSurfaceVariant: core.n2.tone(80),
649
+ outline: core.n2.tone(60),
650
+ outlineVariant: core.n2.tone(30),
651
+ shadow: core.n1.tone(0),
652
+ scrim: core.n1.tone(0),
653
+ inverseSurface: core.n1.tone(90),
654
+ inverseOnSurface: core.n1.tone(20),
655
+ inversePrimary: core.a1.tone(40)
656
+ });
657
+ }
658
+ toJSON() {
659
+ return Object.assign({}, this.props);
660
+ }
661
+ }
662
+ const hexFromArgb = argb => {
663
+ const r = redFromArgb(argb),
664
+ g = greenFromArgb(argb),
665
+ b = blueFromArgb(argb),
666
+ outParts = [r.toString(16), g.toString(16), b.toString(16)];
667
+ for (const [i, part] of outParts.entries()) 1 === part.length && (outParts[i] = "0" + part);
668
+ return "#" + outParts.join("");
669
+ },
670
+ argbFromHex = hex => {
671
+ const isThree = 3 === (hex = hex.replace("#", "")).length,
672
+ isSix = 6 === hex.length,
673
+ isEight = 8 === hex.length;
674
+ if (!isThree && !isSix && !isEight) throw new Error("unexpected hex " + hex);
675
+ let r = 0,
676
+ g = 0,
677
+ b = 0;
678
+ return isThree ? (r = parseIntHex(hex.slice(0, 1).repeat(2)), g = parseIntHex(hex.slice(1, 2).repeat(2)), b = parseIntHex(hex.slice(2, 3).repeat(2))) : isSix ? (r = parseIntHex(hex.slice(0, 2)), g = parseIntHex(hex.slice(2, 4)), b = parseIntHex(hex.slice(4, 6))) : isEight && (r = parseIntHex(hex.slice(2, 4)), g = parseIntHex(hex.slice(4, 6)), b = parseIntHex(hex.slice(6, 8))), (255 << 24 | (255 & r) << 16 | (255 & g) << 8 | 255 & b) >>> 0;
679
+ };
680
+ function parseIntHex(value) {
681
+ return parseInt(value, 16);
682
+ }
683
+ function themeFromSourceColor(source, customColors) {
684
+ if (customColors === void 0) {
685
+ customColors = [];
686
+ }
687
+ const palette = CorePalette.of(source);
688
+ return {
689
+ source: source,
690
+ schemes: {
691
+ light: Scheme.light(source),
692
+ dark: Scheme.dark(source)
693
+ },
694
+ palettes: {
695
+ primary: palette.a1,
696
+ secondary: palette.a2,
697
+ tertiary: palette.a3,
698
+ neutral: palette.n1,
699
+ neutralVariant: palette.n2,
700
+ error: palette.error
701
+ },
702
+ customColors: customColors.map(c => customColor(source, c))
703
+ };
704
+ }
705
+ function customColor(source, color) {
706
+ let value = color.value;
707
+ const from = value,
708
+ to = source;
709
+ color.blend && (value = Blend.harmonize(from, to));
710
+ const tones = CorePalette.of(value).a1;
711
+ return {
712
+ color: color,
713
+ value: value,
714
+ light: {
715
+ color: tones.tone(40),
716
+ onColor: tones.tone(100),
717
+ colorContainer: tones.tone(90),
718
+ onColorContainer: tones.tone(10)
719
+ },
720
+ dark: {
721
+ color: tones.tone(80),
722
+ onColor: tones.tone(20),
723
+ colorContainer: tones.tone(30),
724
+ onColorContainer: tones.tone(90)
725
+ }
726
+ };
727
+ }
728
+ export { argbFromHex, hexFromArgb, themeFromSourceColor };