yuyeon 0.3.1-rc.6 → 0.3.2-rc.1

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 (951) hide show
  1. package/dist/yuyeon.js +459 -458
  2. package/dist/yuyeon.umd.cjs +2 -2
  3. package/lib/abstract/items.js +20 -0
  4. package/lib/abstract/items.js.map +1 -0
  5. package/lib/components/alert/YAlert.js +83 -0
  6. package/lib/components/alert/YAlert.js.map +1 -0
  7. package/lib/components/alert/index.js +2 -0
  8. package/lib/components/alert/index.js.map +1 -0
  9. package/lib/components/app/YApp.js +21 -0
  10. package/lib/components/app/YApp.js.map +1 -0
  11. package/lib/components/app/index.js +2 -0
  12. package/lib/components/app/index.js.map +1 -0
  13. package/lib/components/badge/YBadge.js +83 -0
  14. package/lib/components/badge/YBadge.js.map +1 -0
  15. package/lib/components/badge/index.js +2 -0
  16. package/lib/components/badge/index.js.map +1 -0
  17. package/lib/components/bench/YBench.js +43 -0
  18. package/lib/components/bench/YBench.js.map +1 -0
  19. package/lib/components/bench/index.js +2 -0
  20. package/lib/components/bench/index.js.map +1 -0
  21. package/lib/components/button/YButton.js +169 -0
  22. package/lib/components/button/YButton.js.map +1 -0
  23. package/lib/components/button/index.js +2 -0
  24. package/lib/components/button/index.js.map +1 -0
  25. package/lib/components/card/YCard.js +28 -0
  26. package/lib/components/card/YCard.js.map +1 -0
  27. package/lib/components/card/YCardBody.js +11 -0
  28. package/lib/components/card/YCardBody.js.map +1 -0
  29. package/lib/components/card/YCardFooter.js +11 -0
  30. package/lib/components/card/YCardFooter.js.map +1 -0
  31. package/lib/components/card/YCardHeader.js +11 -0
  32. package/lib/components/card/YCardHeader.js.map +1 -0
  33. package/lib/components/card/index.js +5 -0
  34. package/lib/components/card/index.js.map +1 -0
  35. package/lib/components/checkbox/YCheckbox.js +160 -0
  36. package/lib/components/checkbox/YCheckbox.js.map +1 -0
  37. package/lib/components/checkbox/YInputCheckbox.js +114 -0
  38. package/lib/components/checkbox/YInputCheckbox.js.map +1 -0
  39. package/lib/components/checkbox/index.js +4 -0
  40. package/lib/components/checkbox/index.js.map +1 -0
  41. package/lib/components/chip/YChip.js +39 -0
  42. package/lib/components/chip/YChip.js.map +1 -0
  43. package/lib/components/chip/index.js +2 -0
  44. package/lib/components/chip/index.js.map +1 -0
  45. package/lib/components/date-picker/YDateCalendar.js +243 -0
  46. package/lib/components/date-picker/YDateCalendar.js.map +1 -0
  47. package/lib/components/date-picker/YDatePicker.js +132 -0
  48. package/lib/components/date-picker/YDatePicker.js.map +1 -0
  49. package/lib/components/date-picker/YDatePickerControl.js +107 -0
  50. package/lib/components/date-picker/YDatePickerControl.js.map +1 -0
  51. package/lib/components/date-picker/YMonthPicker.js +64 -0
  52. package/lib/components/date-picker/YMonthPicker.js.map +1 -0
  53. package/lib/components/date-picker/YYearPicker.js +87 -0
  54. package/lib/components/date-picker/YYearPicker.js.map +1 -0
  55. package/lib/components/date-picker/index.js +4 -0
  56. package/lib/components/date-picker/index.js.map +1 -0
  57. package/lib/components/default-provider/YDefaultProvider.js +2 -0
  58. package/lib/components/default-provider/YDefaultProvider.js.map +1 -0
  59. package/lib/components/default-provider/index.js +2 -0
  60. package/lib/components/default-provider/index.js.map +1 -0
  61. package/lib/components/dialog/YDialog.js +213 -0
  62. package/lib/components/dialog/YDialog.js.map +1 -0
  63. package/lib/components/dialog/index.js +2 -0
  64. package/lib/components/dialog/index.js.map +1 -0
  65. package/lib/components/divider/YDivider.js +20 -0
  66. package/lib/components/divider/YDivider.js.map +1 -0
  67. package/lib/components/divider/index.js +2 -0
  68. package/lib/components/divider/index.js.map +1 -0
  69. package/lib/components/draggable/YDraggable.js +95 -0
  70. package/lib/components/draggable/YDraggable.js.map +1 -0
  71. package/lib/components/dropdown/YDropdown.js +109 -0
  72. package/lib/components/dropdown/YDropdown.js.map +1 -0
  73. package/lib/components/dropdown/index.js +2 -0
  74. package/lib/components/dropdown/index.js.map +1 -0
  75. package/lib/components/field-input/YFieldInput.js +229 -0
  76. package/lib/components/field-input/YFieldInput.js.map +1 -0
  77. package/lib/components/field-input/index.js +2 -0
  78. package/lib/components/field-input/index.js.map +1 -0
  79. package/lib/components/form/YForm.js +65 -0
  80. package/lib/components/form/YForm.js.map +1 -0
  81. package/lib/components/form/index.js +2 -0
  82. package/lib/components/form/index.js.map +1 -0
  83. package/lib/components/hover/YHover.js +54 -0
  84. package/lib/components/hover/YHover.js.map +1 -0
  85. package/lib/components/hover/index.js +2 -0
  86. package/lib/components/hover/index.js.map +1 -0
  87. package/lib/components/icon/YIcon.js +63 -0
  88. package/lib/components/icon/YIcon.js.map +1 -0
  89. package/lib/components/icon/index.js +2 -0
  90. package/lib/components/icon/index.js.map +1 -0
  91. package/lib/components/icons/YIconCheckbox.js +32 -0
  92. package/lib/components/icons/YIconCheckbox.js.map +1 -0
  93. package/lib/components/icons/YIconClear.js +16 -0
  94. package/lib/components/icons/YIconClear.js.map +1 -0
  95. package/lib/components/icons/YIconDropdown.js +16 -0
  96. package/lib/components/icons/YIconDropdown.js.map +1 -0
  97. package/lib/components/icons/YIconExpand.js +20 -0
  98. package/lib/components/icons/YIconExpand.js.map +1 -0
  99. package/lib/components/icons/YIconPageControl.js +32 -0
  100. package/lib/components/icons/YIconPageControl.js.map +1 -0
  101. package/lib/components/icons/YIconSort.js +45 -0
  102. package/lib/components/icons/YIconSort.js.map +1 -0
  103. package/lib/components/icons/index.js +32 -0
  104. package/lib/components/icons/index.js.map +1 -0
  105. package/lib/components/img/YImg.js +173 -0
  106. package/lib/components/img/YImg.js.map +1 -0
  107. package/lib/components/img/index.js +2 -0
  108. package/lib/components/img/index.js.map +1 -0
  109. package/lib/components/index.js +39 -0
  110. package/lib/components/index.js.map +1 -0
  111. package/lib/components/input/YInput.js +258 -0
  112. package/lib/components/input/YInput.js.map +1 -0
  113. package/lib/components/input/index.js +2 -0
  114. package/lib/components/input/index.js.map +1 -0
  115. package/lib/components/ip-field/YIpv4Field.js +297 -0
  116. package/lib/components/ip-field/YIpv4Field.js.map +1 -0
  117. package/lib/components/ip-field/index.js +2 -0
  118. package/lib/components/ip-field/index.js.map +1 -0
  119. package/lib/components/layer/YLayer.js +326 -0
  120. package/lib/components/layer/YLayer.js.map +1 -0
  121. package/lib/components/layer/active-delay.js +28 -0
  122. package/lib/components/layer/active-delay.js.map +1 -0
  123. package/lib/components/layer/active-stack.js +52 -0
  124. package/lib/components/layer/active-stack.js.map +1 -0
  125. package/lib/components/layer/base.js +87 -0
  126. package/lib/components/layer/base.js.map +1 -0
  127. package/lib/components/layer/content.js +22 -0
  128. package/lib/components/layer/content.js.map +1 -0
  129. package/lib/components/layer/index.js +2 -0
  130. package/lib/components/layer/index.js.map +1 -0
  131. package/lib/components/layer/scroll-strategies.js +132 -0
  132. package/lib/components/layer/scroll-strategies.js.map +1 -0
  133. package/lib/components/list/YList.js +55 -0
  134. package/lib/components/list/YList.js.map +1 -0
  135. package/lib/components/list/YListItem.js +59 -0
  136. package/lib/components/list/YListItem.js.map +1 -0
  137. package/lib/components/list/index.js +3 -0
  138. package/lib/components/list/index.js.map +1 -0
  139. package/lib/components/loading/YSpinnerRing.js +25 -0
  140. package/lib/components/loading/YSpinnerRing.js.map +1 -0
  141. package/lib/components/loading/index.js +2 -0
  142. package/lib/components/loading/index.js.map +1 -0
  143. package/lib/components/menu/YMenu.js +211 -0
  144. package/lib/components/menu/YMenu.js.map +1 -0
  145. package/lib/components/menu/index.js +2 -0
  146. package/lib/components/menu/index.js.map +1 -0
  147. package/lib/components/navigation/YNavigation.js +18 -0
  148. package/lib/components/navigation/YNavigation.js.map +1 -0
  149. package/lib/components/navigation/index.js +2 -0
  150. package/lib/components/navigation/index.js.map +1 -0
  151. package/lib/components/pagination/YPagination.js +288 -0
  152. package/lib/components/pagination/YPagination.js.map +1 -0
  153. package/lib/components/pagination/index.js +2 -0
  154. package/lib/components/pagination/index.js.map +1 -0
  155. package/lib/components/panel/YDividePanel.js +90 -0
  156. package/lib/components/panel/YDividePanel.js.map +1 -0
  157. package/lib/components/panel/index.js +2 -0
  158. package/lib/components/panel/index.js.map +1 -0
  159. package/lib/components/plate/YPlate.js +28 -0
  160. package/lib/components/plate/YPlate.js.map +1 -0
  161. package/lib/components/plate/index.js +2 -0
  162. package/lib/components/plate/index.js.map +1 -0
  163. package/lib/components/progress-bar/YProgressBar.js +117 -0
  164. package/lib/components/progress-bar/YProgressBar.js.map +1 -0
  165. package/lib/components/progress-bar/index.js +2 -0
  166. package/lib/components/progress-bar/index.js.map +1 -0
  167. package/lib/components/progress-ring/YProgressRing.js +128 -0
  168. package/lib/components/progress-ring/YProgressRing.js.map +1 -0
  169. package/lib/components/progress-ring/index.js +2 -0
  170. package/lib/components/progress-ring/index.js.map +1 -0
  171. package/lib/components/select/YSelect.js +344 -0
  172. package/lib/components/select/YSelect.js.map +1 -0
  173. package/lib/components/select/index.js +2 -0
  174. package/lib/components/select/index.js.map +1 -0
  175. package/lib/components/slider/YSlider.js +26 -0
  176. package/lib/components/slider/YSlider.js.map +1 -0
  177. package/lib/components/slider/index.js +2 -0
  178. package/lib/components/slider/index.js.map +1 -0
  179. package/lib/components/snackbar/YSnackbar.js +209 -0
  180. package/lib/components/snackbar/YSnackbar.js.map +1 -0
  181. package/lib/components/snackbar/index.js +2 -0
  182. package/lib/components/snackbar/index.js.map +1 -0
  183. package/lib/components/switch/YSwitch.js +184 -0
  184. package/lib/components/switch/YSwitch.js.map +1 -0
  185. package/lib/components/switch/index.js +2 -0
  186. package/lib/components/switch/index.js.map +1 -0
  187. package/lib/components/tab/YTab.js +64 -0
  188. package/lib/components/tab/YTab.js.map +1 -0
  189. package/lib/components/tab/YTabs.js +86 -0
  190. package/lib/components/tab/YTabs.js.map +1 -0
  191. package/lib/components/tab/index.js +4 -0
  192. package/lib/components/tab/index.js.map +1 -0
  193. package/lib/components/tab/shared.js +2 -0
  194. package/lib/components/tab/shared.js.map +1 -0
  195. package/lib/components/tab/types.js +2 -0
  196. package/lib/components/tab/types.js.map +1 -0
  197. package/lib/components/table/YDataTable.js +182 -0
  198. package/lib/components/table/YDataTable.js.map +1 -0
  199. package/lib/components/table/YDataTableBody.js +131 -0
  200. package/lib/components/table/YDataTableBody.js.map +1 -0
  201. package/lib/components/table/YDataTableCell.js +78 -0
  202. package/lib/components/table/YDataTableCell.js.map +1 -0
  203. package/lib/components/table/YDataTableControl.js +46 -0
  204. package/lib/components/table/YDataTableControl.js.map +1 -0
  205. package/lib/components/table/YDataTableHead.js +172 -0
  206. package/lib/components/table/YDataTableHead.js.map +1 -0
  207. package/lib/components/table/YDataTableLayer.js +29 -0
  208. package/lib/components/table/YDataTableLayer.js.map +1 -0
  209. package/lib/components/table/YDataTableRow.js +150 -0
  210. package/lib/components/table/YDataTableRow.js.map +1 -0
  211. package/lib/components/table/YDataTableServer.js +173 -0
  212. package/lib/components/table/YDataTableServer.js.map +1 -0
  213. package/lib/components/table/YTable.js +77 -0
  214. package/lib/components/table/YTable.js.map +1 -0
  215. package/lib/components/table/composibles/header.js +127 -0
  216. package/lib/components/table/composibles/header.js.map +1 -0
  217. package/lib/components/table/composibles/items.js +52 -0
  218. package/lib/components/table/composibles/items.js.map +1 -0
  219. package/lib/components/table/composibles/measure.js +39 -0
  220. package/lib/components/table/composibles/measure.js.map +1 -0
  221. package/lib/components/table/composibles/options.js +33 -0
  222. package/lib/components/table/composibles/options.js.map +1 -0
  223. package/lib/components/table/composibles/pagination.js +99 -0
  224. package/lib/components/table/composibles/pagination.js.map +1 -0
  225. package/lib/components/table/composibles/selection.js +196 -0
  226. package/lib/components/table/composibles/selection.js.map +1 -0
  227. package/lib/components/table/composibles/sorted-items.js +50 -0
  228. package/lib/components/table/composibles/sorted-items.js.map +1 -0
  229. package/lib/components/table/composibles/sorting.js +73 -0
  230. package/lib/components/table/composibles/sorting.js.map +1 -0
  231. package/lib/components/table/index.js +9 -0
  232. package/lib/components/table/index.js.map +1 -0
  233. package/lib/components/table/types/common.js +2 -0
  234. package/lib/components/table/types/common.js.map +1 -0
  235. package/lib/components/table/types/header.js +2 -0
  236. package/lib/components/table/types/header.js.map +1 -0
  237. package/lib/components/table/types/index.js +2 -0
  238. package/lib/components/table/types/index.js.map +1 -0
  239. package/lib/components/table/types/item.js +2 -0
  240. package/lib/components/table/types/item.js.map +1 -0
  241. package/lib/components/table/types/row.js +2 -0
  242. package/lib/components/table/types/row.js.map +1 -0
  243. package/lib/components/text-ellipsis/YTextEllipsis.js +66 -0
  244. package/lib/components/text-ellipsis/YTextEllipsis.js.map +1 -0
  245. package/lib/components/text-ellipsis/index.js +2 -0
  246. package/lib/components/text-ellipsis/index.js.map +1 -0
  247. package/lib/components/text-highlighter/YTextHighlighter.js +95 -0
  248. package/lib/components/text-highlighter/YTextHighlighter.js.map +1 -0
  249. package/lib/components/text-highlighter/index.js +2 -0
  250. package/lib/components/text-highlighter/index.js.map +1 -0
  251. package/lib/components/text-interpolation/YTi.js +47 -0
  252. package/lib/components/text-interpolation/YTi.js.map +1 -0
  253. package/lib/components/text-interpolation/index.js +2 -0
  254. package/lib/components/text-interpolation/index.js.map +1 -0
  255. package/lib/components/textarea/YTextarea.js +157 -0
  256. package/lib/components/textarea/YTextarea.js.map +1 -0
  257. package/lib/components/textarea/index.js +2 -0
  258. package/lib/components/textarea/index.js.map +1 -0
  259. package/lib/components/toggle-button/YToggleButton.js +2 -0
  260. package/lib/components/toggle-button/YToggleButton.js.map +1 -0
  261. package/lib/components/toggle-button/index.js +2 -0
  262. package/lib/components/toggle-button/index.js.map +1 -0
  263. package/lib/components/tooltip/YTooltip.js +157 -0
  264. package/lib/components/tooltip/YTooltip.js.map +1 -0
  265. package/lib/components/tooltip/index.js +2 -0
  266. package/lib/components/tooltip/index.js.map +1 -0
  267. package/lib/components/transitions/expand-transition.js +109 -0
  268. package/lib/components/transitions/expand-transition.js.map +1 -0
  269. package/lib/components/transitions/index.js +4 -0
  270. package/lib/components/transitions/index.js.map +1 -0
  271. package/lib/components/tree-view/YTreeView.js +290 -0
  272. package/lib/components/tree-view/YTreeView.js.map +1 -0
  273. package/lib/components/tree-view/YTreeViewNode.js +250 -0
  274. package/lib/components/tree-view/YTreeViewNode.js.map +1 -0
  275. package/lib/components/tree-view/index.js +3 -0
  276. package/lib/components/tree-view/index.js.map +1 -0
  277. package/lib/components/tree-view/tree-view.js +179 -0
  278. package/lib/components/tree-view/tree-view.js.map +1 -0
  279. package/lib/components/tree-view/types.js +2 -0
  280. package/lib/components/tree-view/types.js.map +1 -0
  281. package/lib/components/tree-view/util.js +40 -0
  282. package/lib/components/tree-view/util.js.map +1 -0
  283. package/lib/composables/choice-link.js +13 -0
  284. package/lib/composables/choice-link.js.map +1 -0
  285. package/lib/composables/choice.js +187 -0
  286. package/lib/composables/choice.js.map +1 -0
  287. package/lib/composables/communication.js +55 -0
  288. package/lib/composables/communication.js.map +1 -0
  289. package/lib/composables/component.js +8 -0
  290. package/lib/composables/component.js.map +1 -0
  291. package/lib/composables/coordinate/arrangement.js +14 -0
  292. package/lib/composables/coordinate/arrangement.js.map +1 -0
  293. package/lib/composables/coordinate/index.js +67 -0
  294. package/lib/composables/coordinate/index.js.map +1 -0
  295. package/lib/composables/coordinate/levitation.js +315 -0
  296. package/lib/composables/coordinate/levitation.js.map +1 -0
  297. package/lib/composables/coordinate/types.js +2 -0
  298. package/lib/composables/coordinate/types.js.map +1 -0
  299. package/lib/composables/coordinate/utils/point.js +55 -0
  300. package/lib/composables/coordinate/utils/point.js.map +1 -0
  301. package/lib/composables/date/factory.js +12 -0
  302. package/lib/composables/date/factory.js.map +1 -0
  303. package/lib/composables/date/index.js +20 -0
  304. package/lib/composables/date/index.js.map +1 -0
  305. package/lib/composables/date/setting.js +11 -0
  306. package/lib/composables/date/setting.js.map +1 -0
  307. package/lib/composables/date/types.js +2 -0
  308. package/lib/composables/date/types.js.map +1 -0
  309. package/lib/composables/defaults/index.js +99 -0
  310. package/lib/composables/defaults/index.js.map +1 -0
  311. package/lib/composables/defaults/share.js +2 -0
  312. package/lib/composables/defaults/share.js.map +1 -0
  313. package/lib/composables/defaults/types.js +2 -0
  314. package/lib/composables/defaults/types.js.map +1 -0
  315. package/lib/composables/dimension.js +26 -0
  316. package/lib/composables/dimension.js.map +1 -0
  317. package/lib/composables/focus.js +29 -0
  318. package/lib/composables/focus.js.map +1 -0
  319. package/lib/composables/form.js +100 -0
  320. package/lib/composables/form.js.map +1 -0
  321. package/lib/composables/i18n/index.js +30 -0
  322. package/lib/composables/i18n/index.js.map +1 -0
  323. package/lib/composables/i18n/locale.js +5 -0
  324. package/lib/composables/i18n/locale.js.map +1 -0
  325. package/lib/composables/i18n/rtl.js +34 -0
  326. package/lib/composables/i18n/rtl.js.map +1 -0
  327. package/lib/composables/i18n/share.js +2 -0
  328. package/lib/composables/i18n/share.js.map +1 -0
  329. package/lib/composables/icon.js +164 -0
  330. package/lib/composables/icon.js.map +1 -0
  331. package/lib/composables/index.js +11 -0
  332. package/lib/composables/index.js.map +1 -0
  333. package/lib/composables/layer-group.js +66 -0
  334. package/lib/composables/layer-group.js.map +1 -0
  335. package/lib/composables/layout.js +13 -0
  336. package/lib/composables/layout.js.map +1 -0
  337. package/lib/composables/list-items.js +66 -0
  338. package/lib/composables/list-items.js.map +1 -0
  339. package/lib/composables/progress.js +26 -0
  340. package/lib/composables/progress.js.map +1 -0
  341. package/lib/composables/ref.js +13 -0
  342. package/lib/composables/ref.js.map +1 -0
  343. package/lib/composables/resize-observer.js +33 -0
  344. package/lib/composables/resize-observer.js.map +1 -0
  345. package/lib/composables/scope.js +26 -0
  346. package/lib/composables/scope.js.map +1 -0
  347. package/lib/composables/style-color.js +37 -0
  348. package/lib/composables/style-color.js.map +1 -0
  349. package/lib/composables/theme/factory.js +47 -0
  350. package/lib/composables/theme/factory.js.map +1 -0
  351. package/lib/composables/theme/helper.js +14 -0
  352. package/lib/composables/theme/helper.js.map +1 -0
  353. package/lib/composables/theme/index.js +187 -0
  354. package/lib/composables/theme/index.js.map +1 -0
  355. package/lib/composables/theme/setting.js +113 -0
  356. package/lib/composables/theme/setting.js.map +1 -0
  357. package/lib/composables/theme/types.js +2 -0
  358. package/lib/composables/theme/types.js.map +1 -0
  359. package/lib/composables/timing.js +102 -0
  360. package/lib/composables/timing.js.map +1 -0
  361. package/lib/composables/transition.js +51 -0
  362. package/lib/composables/transition.js.map +1 -0
  363. package/lib/composables/validation.js +126 -0
  364. package/lib/composables/validation.js.map +1 -0
  365. package/lib/composables/vue-router.js +32 -0
  366. package/lib/composables/vue-router.js.map +1 -0
  367. package/lib/directives/complement-click/index.js +78 -0
  368. package/lib/directives/complement-click/index.js.map +1 -0
  369. package/lib/directives/plate-wave/index.js +100 -0
  370. package/lib/directives/plate-wave/index.js.map +1 -0
  371. package/lib/directives/theme-class.js +24 -0
  372. package/lib/directives/theme-class.js.map +1 -0
  373. package/lib/etc/index.js +6 -0
  374. package/lib/etc/index.js.map +1 -0
  375. package/lib/i18n/built-in.js +77 -0
  376. package/lib/i18n/built-in.js.map +1 -0
  377. package/lib/i18n/config.js +82 -0
  378. package/lib/i18n/config.js.map +1 -0
  379. package/lib/i18n/types.js +2 -0
  380. package/lib/i18n/types.js.map +1 -0
  381. package/lib/index.js +103 -0
  382. package/lib/index.js.map +1 -0
  383. package/lib/locales/en.js +6 -0
  384. package/lib/locales/en.js.map +1 -0
  385. package/lib/locales/index.js +3 -0
  386. package/lib/locales/index.js.map +1 -0
  387. package/lib/locales/ko.js +6 -0
  388. package/lib/locales/ko.js.map +1 -0
  389. package/lib/mixins/di.js +19 -0
  390. package/lib/mixins/di.js.map +1 -0
  391. package/lib/mixins/rebind-attrs.js +37 -0
  392. package/lib/mixins/rebind-attrs.js.map +1 -0
  393. package/lib/types/index.js +2 -0
  394. package/lib/types/index.js.map +1 -0
  395. package/lib/util/anchor.js +53 -0
  396. package/lib/util/anchor.js.map +1 -0
  397. package/lib/util/array.js +13 -0
  398. package/lib/util/array.js.map +1 -0
  399. package/lib/util/collection.js +10 -0
  400. package/lib/util/collection.js.map +1 -0
  401. package/lib/util/color/apca.js +201 -0
  402. package/lib/util/color/apca.js.map +1 -0
  403. package/lib/util/color/const.js +6 -0
  404. package/lib/util/color/const.js.map +1 -0
  405. package/lib/util/color/contrast/contrast.js +149 -0
  406. package/lib/util/color/contrast/contrast.js.map +1 -0
  407. package/lib/util/color/conversion.js +310 -0
  408. package/lib/util/color/conversion.js.map +1 -0
  409. package/lib/util/color/hct/cam16.js +349 -0
  410. package/lib/util/color/hct/cam16.js.map +1 -0
  411. package/lib/util/color/hct/hct-solver.js +389 -0
  412. package/lib/util/color/hct/hct-solver.js.map +1 -0
  413. package/lib/util/color/hct/hct.js +153 -0
  414. package/lib/util/color/hct/hct.js.map +1 -0
  415. package/lib/util/color/hct/viewing-conditions.js +110 -0
  416. package/lib/util/color/hct/viewing-conditions.js.map +1 -0
  417. package/lib/util/color/index.js +40 -0
  418. package/lib/util/color/index.js.map +1 -0
  419. package/lib/util/color/palettes/core-palette.js +99 -0
  420. package/lib/util/color/palettes/core-palette.js.map +1 -0
  421. package/lib/util/color/palettes/tonal-palette.js +112 -0
  422. package/lib/util/color/palettes/tonal-palette.js.map +1 -0
  423. package/lib/util/color/types.js +2 -0
  424. package/lib/util/color/types.js.map +1 -0
  425. package/lib/util/color/utils/math-utils.js +139 -0
  426. package/lib/util/color/utils/math-utils.js.map +1 -0
  427. package/lib/util/common.js +107 -0
  428. package/lib/util/common.js.map +1 -0
  429. package/lib/util/component/component.js +26 -0
  430. package/lib/util/component/component.js.map +1 -0
  431. package/lib/util/component/index.js +65 -0
  432. package/lib/util/component/index.js.map +1 -0
  433. package/lib/util/component/inject-self.js +10 -0
  434. package/lib/util/component/inject-self.js.map +1 -0
  435. package/lib/util/component/props.js +41 -0
  436. package/lib/util/component/props.js.map +1 -0
  437. package/lib/util/component/types.js +2 -0
  438. package/lib/util/component/types.js.map +1 -0
  439. package/lib/util/date/adapters/yuyeon-date-adapter.js +111 -0
  440. package/lib/util/date/adapters/yuyeon-date-adapter.js.map +1 -0
  441. package/lib/util/date/built-in.js +416 -0
  442. package/lib/util/date/built-in.js.map +1 -0
  443. package/lib/util/date/index.js +4 -0
  444. package/lib/util/date/index.js.map +1 -0
  445. package/lib/util/date/types.js +2 -0
  446. package/lib/util/date/types.js.map +1 -0
  447. package/lib/util/debounce.js +114 -0
  448. package/lib/util/debounce.js.map +1 -0
  449. package/lib/util/dom.js +23 -0
  450. package/lib/util/dom.js.map +1 -0
  451. package/lib/util/environments.js +8 -0
  452. package/lib/util/environments.js.map +1 -0
  453. package/lib/util/frame-scheduler.js +29 -0
  454. package/lib/util/frame-scheduler.js.map +1 -0
  455. package/lib/util/index.js +17 -0
  456. package/lib/util/index.js.map +1 -0
  457. package/lib/util/reactivity.js +19 -0
  458. package/lib/util/reactivity.js.map +1 -0
  459. package/lib/util/rect.js +39 -0
  460. package/lib/util/rect.js.map +1 -0
  461. package/lib/util/scroll.js +28 -0
  462. package/lib/util/scroll.js.map +1 -0
  463. package/lib/util/string.js +69 -0
  464. package/lib/util/string.js.map +1 -0
  465. package/lib/util/ui.js +60 -0
  466. package/lib/util/ui.js.map +1 -0
  467. package/lib/util/validation.js +5 -0
  468. package/lib/util/validation.js.map +1 -0
  469. package/package.json +12 -12
  470. package/types/components/tree-view/YTreeView.d.ts +1 -0
  471. package/types/composables/theme/setting.d.ts +1 -0
  472. package/lib/abstract/items.mjs +0 -20
  473. package/lib/abstract/items.mjs.map +0 -1
  474. package/lib/components/alert/YAlert.mjs +0 -83
  475. package/lib/components/alert/YAlert.mjs.map +0 -1
  476. package/lib/components/alert/index.mjs +0 -2
  477. package/lib/components/alert/index.mjs.map +0 -1
  478. package/lib/components/app/YApp.mjs +0 -21
  479. package/lib/components/app/YApp.mjs.map +0 -1
  480. package/lib/components/app/index.mjs +0 -2
  481. package/lib/components/app/index.mjs.map +0 -1
  482. package/lib/components/badge/YBadge.mjs +0 -83
  483. package/lib/components/badge/YBadge.mjs.map +0 -1
  484. package/lib/components/badge/index.mjs +0 -2
  485. package/lib/components/badge/index.mjs.map +0 -1
  486. package/lib/components/bench/YBench.mjs +0 -43
  487. package/lib/components/bench/YBench.mjs.map +0 -1
  488. package/lib/components/bench/index.mjs +0 -2
  489. package/lib/components/bench/index.mjs.map +0 -1
  490. package/lib/components/button/YButton.mjs +0 -169
  491. package/lib/components/button/YButton.mjs.map +0 -1
  492. package/lib/components/button/index.mjs +0 -2
  493. package/lib/components/button/index.mjs.map +0 -1
  494. package/lib/components/card/YCard.mjs +0 -28
  495. package/lib/components/card/YCard.mjs.map +0 -1
  496. package/lib/components/card/YCardBody.mjs +0 -11
  497. package/lib/components/card/YCardBody.mjs.map +0 -1
  498. package/lib/components/card/YCardFooter.mjs +0 -11
  499. package/lib/components/card/YCardFooter.mjs.map +0 -1
  500. package/lib/components/card/YCardHeader.mjs +0 -11
  501. package/lib/components/card/YCardHeader.mjs.map +0 -1
  502. package/lib/components/card/index.mjs +0 -5
  503. package/lib/components/card/index.mjs.map +0 -1
  504. package/lib/components/checkbox/YCheckbox.mjs +0 -160
  505. package/lib/components/checkbox/YCheckbox.mjs.map +0 -1
  506. package/lib/components/checkbox/YInputCheckbox.mjs +0 -114
  507. package/lib/components/checkbox/YInputCheckbox.mjs.map +0 -1
  508. package/lib/components/checkbox/index.mjs +0 -4
  509. package/lib/components/checkbox/index.mjs.map +0 -1
  510. package/lib/components/chip/YChip.mjs +0 -39
  511. package/lib/components/chip/YChip.mjs.map +0 -1
  512. package/lib/components/chip/index.mjs +0 -2
  513. package/lib/components/chip/index.mjs.map +0 -1
  514. package/lib/components/date-picker/YDateCalendar.mjs +0 -243
  515. package/lib/components/date-picker/YDateCalendar.mjs.map +0 -1
  516. package/lib/components/date-picker/YDatePicker.mjs +0 -132
  517. package/lib/components/date-picker/YDatePicker.mjs.map +0 -1
  518. package/lib/components/date-picker/YDatePickerControl.mjs +0 -107
  519. package/lib/components/date-picker/YDatePickerControl.mjs.map +0 -1
  520. package/lib/components/date-picker/YMonthPicker.mjs +0 -64
  521. package/lib/components/date-picker/YMonthPicker.mjs.map +0 -1
  522. package/lib/components/date-picker/YYearPicker.mjs +0 -87
  523. package/lib/components/date-picker/YYearPicker.mjs.map +0 -1
  524. package/lib/components/date-picker/index.mjs +0 -4
  525. package/lib/components/date-picker/index.mjs.map +0 -1
  526. package/lib/components/default-provider/YDefaultProvider.mjs +0 -2
  527. package/lib/components/default-provider/YDefaultProvider.mjs.map +0 -1
  528. package/lib/components/default-provider/index.mjs +0 -2
  529. package/lib/components/default-provider/index.mjs.map +0 -1
  530. package/lib/components/dialog/YDialog.mjs +0 -213
  531. package/lib/components/dialog/YDialog.mjs.map +0 -1
  532. package/lib/components/dialog/index.mjs +0 -2
  533. package/lib/components/dialog/index.mjs.map +0 -1
  534. package/lib/components/divider/YDivider.mjs +0 -20
  535. package/lib/components/divider/YDivider.mjs.map +0 -1
  536. package/lib/components/divider/index.mjs +0 -2
  537. package/lib/components/divider/index.mjs.map +0 -1
  538. package/lib/components/draggable/YDraggable.mjs +0 -95
  539. package/lib/components/draggable/YDraggable.mjs.map +0 -1
  540. package/lib/components/dropdown/YDropdown.mjs +0 -109
  541. package/lib/components/dropdown/YDropdown.mjs.map +0 -1
  542. package/lib/components/dropdown/index.mjs +0 -2
  543. package/lib/components/dropdown/index.mjs.map +0 -1
  544. package/lib/components/field-input/YFieldInput.mjs +0 -229
  545. package/lib/components/field-input/YFieldInput.mjs.map +0 -1
  546. package/lib/components/field-input/index.mjs +0 -2
  547. package/lib/components/field-input/index.mjs.map +0 -1
  548. package/lib/components/form/YForm.mjs +0 -65
  549. package/lib/components/form/YForm.mjs.map +0 -1
  550. package/lib/components/form/index.mjs +0 -2
  551. package/lib/components/form/index.mjs.map +0 -1
  552. package/lib/components/hover/YHover.mjs +0 -54
  553. package/lib/components/hover/YHover.mjs.map +0 -1
  554. package/lib/components/hover/index.mjs +0 -2
  555. package/lib/components/hover/index.mjs.map +0 -1
  556. package/lib/components/icon/YIcon.mjs +0 -63
  557. package/lib/components/icon/YIcon.mjs.map +0 -1
  558. package/lib/components/icon/index.mjs +0 -2
  559. package/lib/components/icon/index.mjs.map +0 -1
  560. package/lib/components/icon/poly.mjs +0 -57
  561. package/lib/components/icon/poly.mjs.map +0 -1
  562. package/lib/components/icons/YIconCheckbox.mjs +0 -32
  563. package/lib/components/icons/YIconCheckbox.mjs.map +0 -1
  564. package/lib/components/icons/YIconClear.mjs +0 -16
  565. package/lib/components/icons/YIconClear.mjs.map +0 -1
  566. package/lib/components/icons/YIconDropdown.mjs +0 -16
  567. package/lib/components/icons/YIconDropdown.mjs.map +0 -1
  568. package/lib/components/icons/YIconExpand.mjs +0 -20
  569. package/lib/components/icons/YIconExpand.mjs.map +0 -1
  570. package/lib/components/icons/YIconPageControl.mjs +0 -32
  571. package/lib/components/icons/YIconPageControl.mjs.map +0 -1
  572. package/lib/components/icons/YIconSort.mjs +0 -45
  573. package/lib/components/icons/YIconSort.mjs.map +0 -1
  574. package/lib/components/icons/index.mjs +0 -32
  575. package/lib/components/icons/index.mjs.map +0 -1
  576. package/lib/components/img/YImg.mjs +0 -173
  577. package/lib/components/img/YImg.mjs.map +0 -1
  578. package/lib/components/img/index.mjs +0 -2
  579. package/lib/components/img/index.mjs.map +0 -1
  580. package/lib/components/index.mjs +0 -39
  581. package/lib/components/index.mjs.map +0 -1
  582. package/lib/components/input/YInput.mjs +0 -258
  583. package/lib/components/input/YInput.mjs.map +0 -1
  584. package/lib/components/input/index.mjs +0 -2
  585. package/lib/components/input/index.mjs.map +0 -1
  586. package/lib/components/ip-field/YIpv4Field.mjs +0 -297
  587. package/lib/components/ip-field/YIpv4Field.mjs.map +0 -1
  588. package/lib/components/ip-field/index.mjs +0 -2
  589. package/lib/components/ip-field/index.mjs.map +0 -1
  590. package/lib/components/layer/YLayer.mjs +0 -326
  591. package/lib/components/layer/YLayer.mjs.map +0 -1
  592. package/lib/components/layer/active-delay.mjs +0 -28
  593. package/lib/components/layer/active-delay.mjs.map +0 -1
  594. package/lib/components/layer/active-stack.mjs +0 -52
  595. package/lib/components/layer/active-stack.mjs.map +0 -1
  596. package/lib/components/layer/base.mjs +0 -87
  597. package/lib/components/layer/base.mjs.map +0 -1
  598. package/lib/components/layer/content.mjs +0 -22
  599. package/lib/components/layer/content.mjs.map +0 -1
  600. package/lib/components/layer/index.mjs +0 -2
  601. package/lib/components/layer/index.mjs.map +0 -1
  602. package/lib/components/layer/scroll-strategies.mjs +0 -132
  603. package/lib/components/layer/scroll-strategies.mjs.map +0 -1
  604. package/lib/components/list/YList.mjs +0 -55
  605. package/lib/components/list/YList.mjs.map +0 -1
  606. package/lib/components/list/YListItem.mjs +0 -59
  607. package/lib/components/list/YListItem.mjs.map +0 -1
  608. package/lib/components/list/index.mjs +0 -3
  609. package/lib/components/list/index.mjs.map +0 -1
  610. package/lib/components/loading/YSpinnerRing.mjs +0 -25
  611. package/lib/components/loading/YSpinnerRing.mjs.map +0 -1
  612. package/lib/components/loading/index.mjs +0 -2
  613. package/lib/components/loading/index.mjs.map +0 -1
  614. package/lib/components/menu/YMenu.mjs +0 -211
  615. package/lib/components/menu/YMenu.mjs.map +0 -1
  616. package/lib/components/menu/index.mjs +0 -2
  617. package/lib/components/menu/index.mjs.map +0 -1
  618. package/lib/components/navigation/YNavigation.mjs +0 -18
  619. package/lib/components/navigation/YNavigation.mjs.map +0 -1
  620. package/lib/components/navigation/index.mjs +0 -2
  621. package/lib/components/navigation/index.mjs.map +0 -1
  622. package/lib/components/pagination/YPagination.mjs +0 -288
  623. package/lib/components/pagination/YPagination.mjs.map +0 -1
  624. package/lib/components/pagination/index.mjs +0 -2
  625. package/lib/components/pagination/index.mjs.map +0 -1
  626. package/lib/components/panel/YDividePanel.mjs +0 -90
  627. package/lib/components/panel/YDividePanel.mjs.map +0 -1
  628. package/lib/components/panel/index.mjs +0 -2
  629. package/lib/components/panel/index.mjs.map +0 -1
  630. package/lib/components/plate/YPlate.mjs +0 -28
  631. package/lib/components/plate/YPlate.mjs.map +0 -1
  632. package/lib/components/plate/index.mjs +0 -2
  633. package/lib/components/plate/index.mjs.map +0 -1
  634. package/lib/components/progress-bar/YProgressBar.mjs +0 -117
  635. package/lib/components/progress-bar/YProgressBar.mjs.map +0 -1
  636. package/lib/components/progress-bar/index.mjs +0 -2
  637. package/lib/components/progress-bar/index.mjs.map +0 -1
  638. package/lib/components/progress-ring/YProgressRing.mjs +0 -128
  639. package/lib/components/progress-ring/YProgressRing.mjs.map +0 -1
  640. package/lib/components/progress-ring/index.mjs +0 -2
  641. package/lib/components/progress-ring/index.mjs.map +0 -1
  642. package/lib/components/select/YSelect.mjs +0 -344
  643. package/lib/components/select/YSelect.mjs.map +0 -1
  644. package/lib/components/select/index.mjs +0 -2
  645. package/lib/components/select/index.mjs.map +0 -1
  646. package/lib/components/slider/YSlider.mjs +0 -26
  647. package/lib/components/slider/YSlider.mjs.map +0 -1
  648. package/lib/components/slider/index.mjs +0 -2
  649. package/lib/components/slider/index.mjs.map +0 -1
  650. package/lib/components/snackbar/YSnackbar.mjs +0 -209
  651. package/lib/components/snackbar/YSnackbar.mjs.map +0 -1
  652. package/lib/components/snackbar/index.mjs +0 -2
  653. package/lib/components/snackbar/index.mjs.map +0 -1
  654. package/lib/components/switch/YSwitch.mjs +0 -184
  655. package/lib/components/switch/YSwitch.mjs.map +0 -1
  656. package/lib/components/switch/index.mjs +0 -2
  657. package/lib/components/switch/index.mjs.map +0 -1
  658. package/lib/components/tab/YTab.mjs +0 -64
  659. package/lib/components/tab/YTab.mjs.map +0 -1
  660. package/lib/components/tab/YTabs.mjs +0 -86
  661. package/lib/components/tab/YTabs.mjs.map +0 -1
  662. package/lib/components/tab/index.mjs +0 -4
  663. package/lib/components/tab/index.mjs.map +0 -1
  664. package/lib/components/tab/shared.mjs +0 -2
  665. package/lib/components/tab/shared.mjs.map +0 -1
  666. package/lib/components/tab/types.mjs +0 -2
  667. package/lib/components/tab/types.mjs.map +0 -1
  668. package/lib/components/table/YDataTable.mjs +0 -182
  669. package/lib/components/table/YDataTable.mjs.map +0 -1
  670. package/lib/components/table/YDataTableBody.mjs +0 -131
  671. package/lib/components/table/YDataTableBody.mjs.map +0 -1
  672. package/lib/components/table/YDataTableCell.mjs +0 -78
  673. package/lib/components/table/YDataTableCell.mjs.map +0 -1
  674. package/lib/components/table/YDataTableControl.mjs +0 -46
  675. package/lib/components/table/YDataTableControl.mjs.map +0 -1
  676. package/lib/components/table/YDataTableHead.mjs +0 -172
  677. package/lib/components/table/YDataTableHead.mjs.map +0 -1
  678. package/lib/components/table/YDataTableLayer.mjs +0 -29
  679. package/lib/components/table/YDataTableLayer.mjs.map +0 -1
  680. package/lib/components/table/YDataTableRow.mjs +0 -150
  681. package/lib/components/table/YDataTableRow.mjs.map +0 -1
  682. package/lib/components/table/YDataTableServer.mjs +0 -173
  683. package/lib/components/table/YDataTableServer.mjs.map +0 -1
  684. package/lib/components/table/YTable.mjs +0 -77
  685. package/lib/components/table/YTable.mjs.map +0 -1
  686. package/lib/components/table/composibles/header.mjs +0 -127
  687. package/lib/components/table/composibles/header.mjs.map +0 -1
  688. package/lib/components/table/composibles/items.mjs +0 -52
  689. package/lib/components/table/composibles/items.mjs.map +0 -1
  690. package/lib/components/table/composibles/measure.mjs +0 -39
  691. package/lib/components/table/composibles/measure.mjs.map +0 -1
  692. package/lib/components/table/composibles/options.mjs +0 -33
  693. package/lib/components/table/composibles/options.mjs.map +0 -1
  694. package/lib/components/table/composibles/pagination.mjs +0 -99
  695. package/lib/components/table/composibles/pagination.mjs.map +0 -1
  696. package/lib/components/table/composibles/selection.mjs +0 -196
  697. package/lib/components/table/composibles/selection.mjs.map +0 -1
  698. package/lib/components/table/composibles/sorted-items.mjs +0 -50
  699. package/lib/components/table/composibles/sorted-items.mjs.map +0 -1
  700. package/lib/components/table/composibles/sorting.mjs +0 -73
  701. package/lib/components/table/composibles/sorting.mjs.map +0 -1
  702. package/lib/components/table/index.mjs +0 -9
  703. package/lib/components/table/index.mjs.map +0 -1
  704. package/lib/components/table/types/common.mjs +0 -2
  705. package/lib/components/table/types/common.mjs.map +0 -1
  706. package/lib/components/table/types/header.mjs +0 -2
  707. package/lib/components/table/types/header.mjs.map +0 -1
  708. package/lib/components/table/types/index.mjs +0 -2
  709. package/lib/components/table/types/index.mjs.map +0 -1
  710. package/lib/components/table/types/item.mjs +0 -2
  711. package/lib/components/table/types/item.mjs.map +0 -1
  712. package/lib/components/table/types/row.mjs +0 -2
  713. package/lib/components/table/types/row.mjs.map +0 -1
  714. package/lib/components/text-ellipsis/YTextEllipsis.mjs +0 -66
  715. package/lib/components/text-ellipsis/YTextEllipsis.mjs.map +0 -1
  716. package/lib/components/text-ellipsis/index.mjs +0 -2
  717. package/lib/components/text-ellipsis/index.mjs.map +0 -1
  718. package/lib/components/text-highlighter/YTextHighlighter.mjs +0 -95
  719. package/lib/components/text-highlighter/YTextHighlighter.mjs.map +0 -1
  720. package/lib/components/text-highlighter/index.mjs +0 -2
  721. package/lib/components/text-highlighter/index.mjs.map +0 -1
  722. package/lib/components/text-interpolation/YTi.mjs +0 -47
  723. package/lib/components/text-interpolation/YTi.mjs.map +0 -1
  724. package/lib/components/text-interpolation/index.mjs +0 -2
  725. package/lib/components/text-interpolation/index.mjs.map +0 -1
  726. package/lib/components/textarea/YTextarea.mjs +0 -157
  727. package/lib/components/textarea/YTextarea.mjs.map +0 -1
  728. package/lib/components/textarea/index.mjs +0 -2
  729. package/lib/components/textarea/index.mjs.map +0 -1
  730. package/lib/components/toggle-button/YToggleButton.mjs +0 -2
  731. package/lib/components/toggle-button/YToggleButton.mjs.map +0 -1
  732. package/lib/components/toggle-button/index.mjs +0 -2
  733. package/lib/components/toggle-button/index.mjs.map +0 -1
  734. package/lib/components/tooltip/YTooltip.mjs +0 -157
  735. package/lib/components/tooltip/YTooltip.mjs.map +0 -1
  736. package/lib/components/tooltip/index.mjs +0 -2
  737. package/lib/components/tooltip/index.mjs.map +0 -1
  738. package/lib/components/transitions/expand-transition.mjs +0 -109
  739. package/lib/components/transitions/expand-transition.mjs.map +0 -1
  740. package/lib/components/transitions/index.mjs +0 -4
  741. package/lib/components/transitions/index.mjs.map +0 -1
  742. package/lib/components/tree-view/YTreeView.mjs +0 -289
  743. package/lib/components/tree-view/YTreeView.mjs.map +0 -1
  744. package/lib/components/tree-view/YTreeViewNode.mjs +0 -250
  745. package/lib/components/tree-view/YTreeViewNode.mjs.map +0 -1
  746. package/lib/components/tree-view/index.mjs +0 -3
  747. package/lib/components/tree-view/index.mjs.map +0 -1
  748. package/lib/components/tree-view/tree-view.mjs +0 -179
  749. package/lib/components/tree-view/tree-view.mjs.map +0 -1
  750. package/lib/components/tree-view/types.mjs +0 -2
  751. package/lib/components/tree-view/types.mjs.map +0 -1
  752. package/lib/components/tree-view/util.mjs +0 -40
  753. package/lib/components/tree-view/util.mjs.map +0 -1
  754. package/lib/composables/choice-link.mjs +0 -13
  755. package/lib/composables/choice-link.mjs.map +0 -1
  756. package/lib/composables/choice.mjs +0 -187
  757. package/lib/composables/choice.mjs.map +0 -1
  758. package/lib/composables/communication.mjs +0 -55
  759. package/lib/composables/communication.mjs.map +0 -1
  760. package/lib/composables/component.mjs +0 -8
  761. package/lib/composables/component.mjs.map +0 -1
  762. package/lib/composables/coordinate/arrangement.mjs +0 -14
  763. package/lib/composables/coordinate/arrangement.mjs.map +0 -1
  764. package/lib/composables/coordinate/index.mjs +0 -67
  765. package/lib/composables/coordinate/index.mjs.map +0 -1
  766. package/lib/composables/coordinate/levitation.mjs +0 -315
  767. package/lib/composables/coordinate/levitation.mjs.map +0 -1
  768. package/lib/composables/coordinate/types.mjs +0 -2
  769. package/lib/composables/coordinate/types.mjs.map +0 -1
  770. package/lib/composables/coordinate/utils/point.mjs +0 -55
  771. package/lib/composables/coordinate/utils/point.mjs.map +0 -1
  772. package/lib/composables/date/factory.mjs +0 -12
  773. package/lib/composables/date/factory.mjs.map +0 -1
  774. package/lib/composables/date/index.mjs +0 -20
  775. package/lib/composables/date/index.mjs.map +0 -1
  776. package/lib/composables/date/setting.mjs +0 -11
  777. package/lib/composables/date/setting.mjs.map +0 -1
  778. package/lib/composables/date/types.mjs +0 -2
  779. package/lib/composables/date/types.mjs.map +0 -1
  780. package/lib/composables/defaults/index.mjs +0 -99
  781. package/lib/composables/defaults/index.mjs.map +0 -1
  782. package/lib/composables/defaults/share.mjs +0 -2
  783. package/lib/composables/defaults/share.mjs.map +0 -1
  784. package/lib/composables/defaults/types.mjs +0 -2
  785. package/lib/composables/defaults/types.mjs.map +0 -1
  786. package/lib/composables/dimension.mjs +0 -26
  787. package/lib/composables/dimension.mjs.map +0 -1
  788. package/lib/composables/focus.mjs +0 -29
  789. package/lib/composables/focus.mjs.map +0 -1
  790. package/lib/composables/form.mjs +0 -100
  791. package/lib/composables/form.mjs.map +0 -1
  792. package/lib/composables/group.mjs +0 -194
  793. package/lib/composables/group.mjs.map +0 -1
  794. package/lib/composables/i18n/index.mjs +0 -30
  795. package/lib/composables/i18n/index.mjs.map +0 -1
  796. package/lib/composables/i18n/locale.mjs +0 -5
  797. package/lib/composables/i18n/locale.mjs.map +0 -1
  798. package/lib/composables/i18n/rtl.mjs +0 -34
  799. package/lib/composables/i18n/rtl.mjs.map +0 -1
  800. package/lib/composables/i18n/share.mjs +0 -2
  801. package/lib/composables/i18n/share.mjs.map +0 -1
  802. package/lib/composables/icon.mjs +0 -164
  803. package/lib/composables/icon.mjs.map +0 -1
  804. package/lib/composables/index.mjs +0 -11
  805. package/lib/composables/index.mjs.map +0 -1
  806. package/lib/composables/layer-group.mjs +0 -66
  807. package/lib/composables/layer-group.mjs.map +0 -1
  808. package/lib/composables/layout.mjs +0 -13
  809. package/lib/composables/layout.mjs.map +0 -1
  810. package/lib/composables/list-items.mjs +0 -66
  811. package/lib/composables/list-items.mjs.map +0 -1
  812. package/lib/composables/progress.mjs +0 -26
  813. package/lib/composables/progress.mjs.map +0 -1
  814. package/lib/composables/ref.mjs +0 -13
  815. package/lib/composables/ref.mjs.map +0 -1
  816. package/lib/composables/resize-observer.mjs +0 -33
  817. package/lib/composables/resize-observer.mjs.map +0 -1
  818. package/lib/composables/scope.mjs +0 -26
  819. package/lib/composables/scope.mjs.map +0 -1
  820. package/lib/composables/style-color.mjs +0 -37
  821. package/lib/composables/style-color.mjs.map +0 -1
  822. package/lib/composables/theme/factory.mjs +0 -47
  823. package/lib/composables/theme/factory.mjs.map +0 -1
  824. package/lib/composables/theme/helper.mjs +0 -14
  825. package/lib/composables/theme/helper.mjs.map +0 -1
  826. package/lib/composables/theme/index.mjs +0 -187
  827. package/lib/composables/theme/index.mjs.map +0 -1
  828. package/lib/composables/theme/setting.mjs +0 -112
  829. package/lib/composables/theme/setting.mjs.map +0 -1
  830. package/lib/composables/theme/types.mjs +0 -2
  831. package/lib/composables/theme/types.mjs.map +0 -1
  832. package/lib/composables/timing.mjs +0 -102
  833. package/lib/composables/timing.mjs.map +0 -1
  834. package/lib/composables/transition.mjs +0 -51
  835. package/lib/composables/transition.mjs.map +0 -1
  836. package/lib/composables/validation.mjs +0 -126
  837. package/lib/composables/validation.mjs.map +0 -1
  838. package/lib/composables/vue-router.mjs +0 -32
  839. package/lib/composables/vue-router.mjs.map +0 -1
  840. package/lib/directives/complement-click/index.mjs +0 -78
  841. package/lib/directives/complement-click/index.mjs.map +0 -1
  842. package/lib/directives/plate-wave/index.mjs +0 -100
  843. package/lib/directives/plate-wave/index.mjs.map +0 -1
  844. package/lib/directives/theme-class.mjs +0 -24
  845. package/lib/directives/theme-class.mjs.map +0 -1
  846. package/lib/etc/index.mjs +0 -6
  847. package/lib/etc/index.mjs.map +0 -1
  848. package/lib/i18n/built-in.mjs +0 -77
  849. package/lib/i18n/built-in.mjs.map +0 -1
  850. package/lib/i18n/config.mjs +0 -82
  851. package/lib/i18n/config.mjs.map +0 -1
  852. package/lib/i18n/types.mjs +0 -2
  853. package/lib/i18n/types.mjs.map +0 -1
  854. package/lib/index.mjs +0 -103
  855. package/lib/index.mjs.map +0 -1
  856. package/lib/locales/en.mjs +0 -6
  857. package/lib/locales/en.mjs.map +0 -1
  858. package/lib/locales/index.mjs +0 -3
  859. package/lib/locales/index.mjs.map +0 -1
  860. package/lib/locales/ko.mjs +0 -6
  861. package/lib/locales/ko.mjs.map +0 -1
  862. package/lib/mixins/di.mjs +0 -19
  863. package/lib/mixins/di.mjs.map +0 -1
  864. package/lib/mixins/rebind-attrs.mjs +0 -37
  865. package/lib/mixins/rebind-attrs.mjs.map +0 -1
  866. package/lib/types/index.mjs +0 -2
  867. package/lib/types/index.mjs.map +0 -1
  868. package/lib/util/anchor.mjs +0 -53
  869. package/lib/util/anchor.mjs.map +0 -1
  870. package/lib/util/array.mjs +0 -13
  871. package/lib/util/array.mjs.map +0 -1
  872. package/lib/util/collection.mjs +0 -10
  873. package/lib/util/collection.mjs.map +0 -1
  874. package/lib/util/color/apca.mjs +0 -201
  875. package/lib/util/color/apca.mjs.map +0 -1
  876. package/lib/util/color/const.mjs +0 -6
  877. package/lib/util/color/const.mjs.map +0 -1
  878. package/lib/util/color/contrast/contrast.mjs +0 -149
  879. package/lib/util/color/contrast/contrast.mjs.map +0 -1
  880. package/lib/util/color/conversion.mjs +0 -310
  881. package/lib/util/color/conversion.mjs.map +0 -1
  882. package/lib/util/color/hct/cam16.mjs +0 -349
  883. package/lib/util/color/hct/cam16.mjs.map +0 -1
  884. package/lib/util/color/hct/hct-solver.mjs +0 -389
  885. package/lib/util/color/hct/hct-solver.mjs.map +0 -1
  886. package/lib/util/color/hct/hct.mjs +0 -153
  887. package/lib/util/color/hct/hct.mjs.map +0 -1
  888. package/lib/util/color/hct/viewing-conditions.mjs +0 -110
  889. package/lib/util/color/hct/viewing-conditions.mjs.map +0 -1
  890. package/lib/util/color/index.mjs +0 -40
  891. package/lib/util/color/index.mjs.map +0 -1
  892. package/lib/util/color/palettes/core-palette.mjs +0 -99
  893. package/lib/util/color/palettes/core-palette.mjs.map +0 -1
  894. package/lib/util/color/palettes/tonal-palette.mjs +0 -112
  895. package/lib/util/color/palettes/tonal-palette.mjs.map +0 -1
  896. package/lib/util/color/types.mjs +0 -2
  897. package/lib/util/color/types.mjs.map +0 -1
  898. package/lib/util/color/utils/math-utils.mjs +0 -139
  899. package/lib/util/color/utils/math-utils.mjs.map +0 -1
  900. package/lib/util/common.mjs +0 -107
  901. package/lib/util/common.mjs.map +0 -1
  902. package/lib/util/component/component.mjs +0 -26
  903. package/lib/util/component/component.mjs.map +0 -1
  904. package/lib/util/component/index.mjs +0 -65
  905. package/lib/util/component/index.mjs.map +0 -1
  906. package/lib/util/component/inject-self.mjs +0 -10
  907. package/lib/util/component/inject-self.mjs.map +0 -1
  908. package/lib/util/component/props.mjs +0 -41
  909. package/lib/util/component/props.mjs.map +0 -1
  910. package/lib/util/component/types.mjs +0 -2
  911. package/lib/util/component/types.mjs.map +0 -1
  912. package/lib/util/date/adapters/yuyeon-date-adapter.mjs +0 -111
  913. package/lib/util/date/adapters/yuyeon-date-adapter.mjs.map +0 -1
  914. package/lib/util/date/built-in.mjs +0 -416
  915. package/lib/util/date/built-in.mjs.map +0 -1
  916. package/lib/util/date/index.mjs +0 -4
  917. package/lib/util/date/index.mjs.map +0 -1
  918. package/lib/util/date/types.mjs +0 -2
  919. package/lib/util/date/types.mjs.map +0 -1
  920. package/lib/util/debounce.mjs +0 -114
  921. package/lib/util/debounce.mjs.map +0 -1
  922. package/lib/util/dom.mjs +0 -23
  923. package/lib/util/dom.mjs.map +0 -1
  924. package/lib/util/environments.mjs +0 -8
  925. package/lib/util/environments.mjs.map +0 -1
  926. package/lib/util/frame-scheduler.mjs +0 -29
  927. package/lib/util/frame-scheduler.mjs.map +0 -1
  928. package/lib/util/index.mjs +0 -17
  929. package/lib/util/index.mjs.map +0 -1
  930. package/lib/util/parser.mjs +0 -31
  931. package/lib/util/parser.mjs.map +0 -1
  932. package/lib/util/reactivity.mjs +0 -19
  933. package/lib/util/reactivity.mjs.map +0 -1
  934. package/lib/util/rect.mjs +0 -39
  935. package/lib/util/rect.mjs.map +0 -1
  936. package/lib/util/scroll.mjs +0 -28
  937. package/lib/util/scroll.mjs.map +0 -1
  938. package/lib/util/string.mjs +0 -69
  939. package/lib/util/string.mjs.map +0 -1
  940. package/lib/util/ui.mjs +0 -60
  941. package/lib/util/ui.mjs.map +0 -1
  942. package/lib/util/validation.mjs +0 -5
  943. package/lib/util/validation.mjs.map +0 -1
  944. package/lib/util/vue-component/index.mjs +0 -63
  945. package/lib/util/vue-component/index.mjs.map +0 -1
  946. package/lib/util/vue-component/props.mjs +0 -37
  947. package/lib/util/vue-component/props.mjs.map +0 -1
  948. package/lib/util/vue-component/types.mjs +0 -2
  949. package/lib/util/vue-component/types.mjs.map +0 -1
  950. package/lib/util/vue-component.mjs +0 -102
  951. package/lib/util/vue-component.mjs.map +0 -1
@@ -0,0 +1,110 @@
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
+ /**
5
+ * @license
6
+ * Copyright 2021 Google LLC
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */
20
+ import { whitePointD65, yFromLstar } from "../conversion.js";
21
+ import * as math from "../utils/math-utils.js";
22
+ /**
23
+ * In traditional color spaces, a color can be identified solely by the
24
+ * observer's measurement of the color. Color appearance models such as CAM16
25
+ * also use information about the environment where the color was
26
+ * observed, known as the viewing conditions.
27
+ *
28
+ * For example, white under the traditional assumption of a midday sun white
29
+ * point is accurately measured as a slightly chromatic blue by CAM16. (roughly,
30
+ * hue 203, chroma 3, lightness 100)
31
+ *
32
+ * This class caches intermediate values of the CAM16 conversion process that
33
+ * depend only on viewing conditions, enabling speed ups.
34
+ */
35
+ export class ViewingConditions {
36
+ /**
37
+ * Create ViewingConditions from a simple, physically relevant, set of
38
+ * parameters.
39
+ *
40
+ * @param whitePoint White point, measured in the XYZ color space.
41
+ * default = D65, or sunny day afternoon
42
+ * @param adaptingLuminance The luminance of the adapting field. Informally,
43
+ * how bright it is in the room where the color is viewed. Can be
44
+ * calculated from lux by multiplying lux by 0.0586. default = 11.72,
45
+ * or 200 lux.
46
+ * @param backgroundLstar The lightness of the area surrounding the color.
47
+ * measured by L* in L*a*b*. default = 50.0
48
+ * @param surround A general description of the lighting surrounding the
49
+ * color. 0 is pitch dark, like watching a movie in a theater. 1.0 is a
50
+ * dimly light room, like watching TV at home at night. 2.0 means there
51
+ * is no difference between the lighting on the color and around it.
52
+ * default = 2.0
53
+ * @param discountingIlluminant Whether the eye accounts for the tint of the
54
+ * ambient lighting, such as knowing an apple is still red in green light.
55
+ * default = false, the eye does not perform this process on
56
+ * self-luminous objects like displays.
57
+ */
58
+ static make() {
59
+ let whitePoint = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : whitePointD65();
60
+ let adaptingLuminance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200.0 / Math.PI * yFromLstar(50.0) / 100.0;
61
+ let backgroundLstar = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 50.0;
62
+ let surround = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2.0;
63
+ let discountingIlluminant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
64
+ const xyz = whitePoint;
65
+ const rW = xyz[0] * 0.401288 + xyz[1] * 0.650173 + xyz[2] * -0.051461;
66
+ const gW = xyz[0] * -0.250268 + xyz[1] * 1.204414 + xyz[2] * 0.045854;
67
+ const bW = xyz[0] * -0.002079 + xyz[1] * 0.048952 + xyz[2] * 0.953127;
68
+ const f = 0.8 + surround / 10.0;
69
+ const c = f >= 0.9 ? math.lerp(0.59, 0.69, (f - 0.9) * 10.0) : math.lerp(0.525, 0.59, (f - 0.8) * 10.0);
70
+ let d = discountingIlluminant ? 1.0 : f * (1.0 - 1.0 / 3.6 * Math.exp((-adaptingLuminance - 42.0) / 92.0));
71
+ d = d > 1.0 ? 1.0 : d < 0.0 ? 0.0 : d;
72
+ const nc = f;
73
+ const rgbD = [d * (100.0 / rW) + 1.0 - d, d * (100.0 / gW) + 1.0 - d, d * (100.0 / bW) + 1.0 - d];
74
+ const k = 1.0 / (5.0 * adaptingLuminance + 1.0);
75
+ const k4 = k * k * k * k;
76
+ const k4F = 1.0 - k4;
77
+ const fl = k4 * adaptingLuminance + 0.1 * k4F * k4F * Math.cbrt(5.0 * adaptingLuminance);
78
+ const n = yFromLstar(backgroundLstar) / whitePoint[1];
79
+ const z = 1.48 + Math.sqrt(n);
80
+ const nbb = 0.725 / Math.pow(n, 0.2);
81
+ const ncb = nbb;
82
+ const rgbAFactors = [Math.pow(fl * rgbD[0] * rW / 100.0, 0.42), Math.pow(fl * rgbD[1] * gW / 100.0, 0.42), Math.pow(fl * rgbD[2] * bW / 100.0, 0.42)];
83
+ const rgbA = [400.0 * rgbAFactors[0] / (rgbAFactors[0] + 27.13), 400.0 * rgbAFactors[1] / (rgbAFactors[1] + 27.13), 400.0 * rgbAFactors[2] / (rgbAFactors[2] + 27.13)];
84
+ const aw = (2.0 * rgbA[0] + rgbA[1] + 0.05 * rgbA[2]) * nbb;
85
+ return new ViewingConditions(n, aw, nbb, ncb, c, nc, rgbD, fl, Math.pow(fl, 0.25), z);
86
+ }
87
+
88
+ /**
89
+ * Parameters are intermediate values of the CAM16 conversion process. Their
90
+ * names are shorthand for technical color science terminology, this class
91
+ * would not benefit from documenting them individually. A brief overview
92
+ * is available in the CAM16 specification, and a complete overview requires
93
+ * a color science textbook, such as Fairchild's Color Appearance Models.
94
+ */
95
+ constructor(n, aw, nbb, ncb, c, nc, rgbD, fl, fLRoot, z) {
96
+ this.n = n;
97
+ this.aw = aw;
98
+ this.nbb = nbb;
99
+ this.ncb = ncb;
100
+ this.c = c;
101
+ this.nc = nc;
102
+ this.rgbD = rgbD;
103
+ this.fl = fl;
104
+ this.fLRoot = fLRoot;
105
+ this.z = z;
106
+ }
107
+ }
108
+ /** sRGB-like viewing conditions. */
109
+ _defineProperty(ViewingConditions, "DEFAULT", ViewingConditions.make());
110
+ //# sourceMappingURL=viewing-conditions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewing-conditions.js","names":["whitePointD65","yFromLstar","math","ViewingConditions","make","whitePoint","arguments","length","undefined","adaptingLuminance","Math","PI","backgroundLstar","surround","discountingIlluminant","xyz","rW","gW","bW","f","c","lerp","d","exp","nc","rgbD","k","k4","k4F","fl","cbrt","n","z","sqrt","nbb","pow","ncb","rgbAFactors","rgbA","aw","constructor","fLRoot","_defineProperty"],"sources":["../../../../src/util/color/hct/viewing-conditions.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { whitePointD65, yFromLstar } from '../conversion';\nimport * as math from '../utils/math-utils';\n\n/**\n * In traditional color spaces, a color can be identified solely by the\n * observer's measurement of the color. Color appearance models such as CAM16\n * also use information about the environment where the color was\n * observed, known as the viewing conditions.\n *\n * For example, white under the traditional assumption of a midday sun white\n * point is accurately measured as a slightly chromatic blue by CAM16. (roughly,\n * hue 203, chroma 3, lightness 100)\n *\n * This class caches intermediate values of the CAM16 conversion process that\n * depend only on viewing conditions, enabling speed ups.\n */\nexport class ViewingConditions {\n /** sRGB-like viewing conditions. */\n static DEFAULT = ViewingConditions.make();\n\n /**\n * Create ViewingConditions from a simple, physically relevant, set of\n * parameters.\n *\n * @param whitePoint White point, measured in the XYZ color space.\n * default = D65, or sunny day afternoon\n * @param adaptingLuminance The luminance of the adapting field. Informally,\n * how bright it is in the room where the color is viewed. Can be\n * calculated from lux by multiplying lux by 0.0586. default = 11.72,\n * or 200 lux.\n * @param backgroundLstar The lightness of the area surrounding the color.\n * measured by L* in L*a*b*. default = 50.0\n * @param surround A general description of the lighting surrounding the\n * color. 0 is pitch dark, like watching a movie in a theater. 1.0 is a\n * dimly light room, like watching TV at home at night. 2.0 means there\n * is no difference between the lighting on the color and around it.\n * default = 2.0\n * @param discountingIlluminant Whether the eye accounts for the tint of the\n * ambient lighting, such as knowing an apple is still red in green light.\n * default = false, the eye does not perform this process on\n * self-luminous objects like displays.\n */\n static make(\n whitePoint = whitePointD65(),\n adaptingLuminance = ((200.0 / Math.PI) * yFromLstar(50.0)) / 100.0,\n backgroundLstar = 50.0,\n surround = 2.0,\n discountingIlluminant = false,\n ): ViewingConditions {\n const xyz = whitePoint;\n const rW = xyz[0] * 0.401288 + xyz[1] * 0.650173 + xyz[2] * -0.051461;\n const gW = xyz[0] * -0.250268 + xyz[1] * 1.204414 + xyz[2] * 0.045854;\n const bW = xyz[0] * -0.002079 + xyz[1] * 0.048952 + xyz[2] * 0.953127;\n const f = 0.8 + surround / 10.0;\n const c =\n f >= 0.9\n ? math.lerp(0.59, 0.69, (f - 0.9) * 10.0)\n : math.lerp(0.525, 0.59, (f - 0.8) * 10.0);\n let d = discountingIlluminant\n ? 1.0\n : f * (1.0 - (1.0 / 3.6) * Math.exp((-adaptingLuminance - 42.0) / 92.0));\n d = d > 1.0 ? 1.0 : d < 0.0 ? 0.0 : d;\n const nc = f;\n const rgbD = [\n d * (100.0 / rW) + 1.0 - d,\n d * (100.0 / gW) + 1.0 - d,\n d * (100.0 / bW) + 1.0 - d,\n ];\n const k = 1.0 / (5.0 * adaptingLuminance + 1.0);\n const k4 = k * k * k * k;\n const k4F = 1.0 - k4;\n const fl =\n k4 * adaptingLuminance +\n 0.1 * k4F * k4F * Math.cbrt(5.0 * adaptingLuminance);\n const n = yFromLstar(backgroundLstar) / whitePoint[1];\n const z = 1.48 + Math.sqrt(n);\n const nbb = 0.725 / Math.pow(n, 0.2);\n const ncb = nbb;\n const rgbAFactors = [\n Math.pow((fl * rgbD[0] * rW) / 100.0, 0.42),\n Math.pow((fl * rgbD[1] * gW) / 100.0, 0.42),\n Math.pow((fl * rgbD[2] * bW) / 100.0, 0.42),\n ];\n const rgbA = [\n (400.0 * rgbAFactors[0]) / (rgbAFactors[0] + 27.13),\n (400.0 * rgbAFactors[1]) / (rgbAFactors[1] + 27.13),\n (400.0 * rgbAFactors[2]) / (rgbAFactors[2] + 27.13),\n ];\n const aw = (2.0 * rgbA[0] + rgbA[1] + 0.05 * rgbA[2]) * nbb;\n return new ViewingConditions(\n n,\n aw,\n nbb,\n ncb,\n c,\n nc,\n rgbD,\n fl,\n Math.pow(fl, 0.25),\n z,\n );\n }\n\n /**\n * Parameters are intermediate values of the CAM16 conversion process. Their\n * names are shorthand for technical color science terminology, this class\n * would not benefit from documenting them individually. A brief overview\n * is available in the CAM16 specification, and a complete overview requires\n * a color science textbook, such as Fairchild's Color Appearance Models.\n */\n private constructor(\n public n: number,\n public aw: number,\n public nbb: number,\n public ncb: number,\n public c: number,\n public nc: number,\n public rgbD: number[],\n public fl: number,\n public fLRoot: number,\n public z: number,\n ) {}\n}\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA,SAgBSA,aAAa,EAAEC,UAAU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OAAO,IAAI/B,iBAAiB,CAC1B4B,CAAC,EACDQ,EAAE,EACFL,GAAG,EACHE,GAAG,EACHhB,CAAC,EACDI,EAAE,EACFC,IAAI,EACJI,EAAE,EACFnB,IAAI,CAACyB,GAAG,CAACN,EAAE,EAAE,IAAI,CAAC,EAClBG,CACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACUQ,WAAWA,CACVT,CAAS,EACTQ,EAAU,EACVL,GAAW,EACXE,GAAW,EACXhB,CAAS,EACTI,EAAU,EACVC,IAAc,EACdI,EAAU,EACVY,MAAc,EACdT,CAAS,EAChB;IAAA,KAVOD,CAAS,GAATA,CAAS;IAAA,KACTQ,EAAU,GAAVA,EAAU;IAAA,KACVL,GAAW,GAAXA,GAAW;IAAA,KACXE,GAAW,GAAXA,GAAW;IAAA,KACXhB,CAAS,GAATA,CAAS;IAAA,KACTI,EAAU,GAAVA,EAAU;IAAA,KACVC,IAAc,GAAdA,IAAc;IAAA,KACdI,EAAU,GAAVA,EAAU;IAAA,KACVY,MAAc,GAAdA,MAAc;IAAA,KACdT,CAAS,GAATA,CAAS;EACf;AACL;AAzGE;AAAAU,eAAA,CADWvC,iBAAiB,aAEXA,iBAAiB,CAACC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,40 @@
1
+ /*
2
+ * yuyeon
3
+ * Apache-2.0 license (Copyright 2023 yeonyew)
4
+ *
5
+ * Used Libs
6
+ * - material-color-utilities
7
+ * Apache-2.0 license (Copyright 2021 Google LLC)
8
+ * https://github.com/material-foundation/material-color-utilities
9
+ *
10
+ * - Vuetify
11
+ * MIT license (Copyright (c) 2016-2023 John Jeremy Leider)
12
+ * https://github.com/vuetifyjs/vuetify
13
+ * */
14
+ import { HEX_COLOR_REGEX, RGBA_REGEX } from "./const.js";
15
+ import { rgbFromHex } from "./../index.js";
16
+ export function isColorValue(value) {
17
+ return RGBA_REGEX.test(value) || HEX_COLOR_REGEX.test(value);
18
+ }
19
+ export function colorRgb(color) {
20
+ if (color?.startsWith('#')) {
21
+ return rgbFromHex(color)?.join(',') || '';
22
+ }
23
+ const RGBA_REGEX = /rgb(a?)\((?<v>.*)\)/;
24
+ if (RGBA_REGEX.test(color)) {
25
+ const value = RGBA_REGEX.exec(color)?.[2] || '';
26
+ if (value) {
27
+ const valueArray = value.trim().split(',');
28
+ valueArray.splice(3, 1);
29
+ return valueArray.join(',');
30
+ }
31
+ }
32
+ return '';
33
+ }
34
+ export function isTextColorIsLight(r, g, b) {
35
+ const luminance = 1 - (0.299 * r + 0.587 * g + 0.114 * b) / 255;
36
+ return luminance < 0.5;
37
+ }
38
+ export * from "./const.js";
39
+ export * from "./conversion.js";
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["HEX_COLOR_REGEX","RGBA_REGEX","rgbFromHex","isColorValue","value","test","colorRgb","color","startsWith","join","exec","valueArray","trim","split","splice","isTextColorIsLight","r","g","b","luminance"],"sources":["../../../src/util/color/index.ts"],"sourcesContent":["/*\r\n* yuyeon\r\n* Apache-2.0 license (Copyright 2023 yeonyew)\r\n*\r\n* Used Libs\r\n* - material-color-utilities\r\n* Apache-2.0 license (Copyright 2021 Google LLC)\r\n* https://github.com/material-foundation/material-color-utilities\r\n*\r\n* - Vuetify\r\n* MIT license (Copyright (c) 2016-2023 John Jeremy Leider)\r\n* https://github.com/vuetifyjs/vuetify\r\n* */\r\n\r\nimport { HEX_COLOR_REGEX, RGBA_REGEX } from \"./const\";\r\nimport { rgbFromHex } from '@/util';\r\n\r\nexport function isColorValue(value: string): boolean {\r\n return RGBA_REGEX.test(value) || HEX_COLOR_REGEX.test(value);\r\n}\r\n\r\nexport function colorRgb(color: string): string {\r\n if (color?.startsWith('#')) {\r\n return rgbFromHex(color)?.join(',') || '';\r\n }\r\n const RGBA_REGEX = /rgb(a?)\\((?<v>.*)\\)/;\r\n if (RGBA_REGEX.test(color)) {\r\n const value = RGBA_REGEX.exec(color)?.[2] || '';\r\n if (value) {\r\n const valueArray = value.trim().split(',');\r\n valueArray.splice(3, 1);\r\n return valueArray.join(',');\r\n }\r\n }\r\n return '';\r\n}\r\n\r\nexport function isTextColorIsLight(r: number, g: number, b: number): boolean {\r\n const luminance = 1 - (0.299 * r + 0.587 * g + 0.114 * b) / 255;\r\n return luminance < 0.5;\r\n}\r\n\r\nexport * from './const';\r\nexport * from \"./conversion\";\r\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAZA,SAcSA,eAAe,EAAEC,UAAU;AAAA,SAC3BC,UAAU;AAEnB,OAAO,SAASC,YAAYA,CAACC,KAAa,EAAW;EACnD,OAAOH,UAAU,CAACI,IAAI,CAACD,KAAK,CAAC,IAAIJ,eAAe,CAACK,IAAI,CAACD,KAAK,CAAC;AAC9D;AAEA,OAAO,SAASE,QAAQA,CAACC,KAAa,EAAU;EAC9C,IAAIA,KAAK,EAAEC,UAAU,CAAC,GAAG,CAAC,EAAE;IAC1B,OAAON,UAAU,CAACK,KAAK,CAAC,EAAEE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE;EAC3C;EACA,MAAMR,UAAU,GAAG,qBAAqB;EACxC,IAAIA,UAAU,CAACI,IAAI,CAACE,KAAK,CAAC,EAAE;IAC1B,MAAMH,KAAK,GAAGH,UAAU,CAACS,IAAI,CAACH,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE;IAC/C,IAAIH,KAAK,EAAE;MACT,MAAMO,UAAU,GAAGP,KAAK,CAACQ,IAAI,CAAC,CAAC,CAACC,KAAK,CAAC,GAAG,CAAC;MAC1CF,UAAU,CAACG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;MACvB,OAAOH,UAAU,CAACF,IAAI,CAAC,GAAG,CAAC;IAC7B;EACF;EACA,OAAO,EAAE;AACX;AAEA,OAAO,SAASM,kBAAkBA,CAACC,CAAS,EAAEC,CAAS,EAAEC,CAAS,EAAW;EAC3E,MAAMC,SAAS,GAAG,CAAC,GAAG,CAAC,KAAK,GAAGH,CAAC,GAAG,KAAK,GAAGC,CAAC,GAAG,KAAK,GAAGC,CAAC,IAAI,GAAG;EAC/D,OAAOC,SAAS,GAAG,GAAG;AACxB;AAAC;AAAA"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2021 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { Hct } from "../hct/hct.js";
18
+ import { TonalPalette } from "./tonal-palette.js";
19
+ /**
20
+ * Set of colors to generate a [CorePalette] from
21
+ */
22
+ /**
23
+ * An intermediate concept between the key color for a UI theme, and a full
24
+ * color scheme. 5 sets of tones are generated, all except one use the same hue
25
+ * as the key color, and all vary in chroma.
26
+ */
27
+ export class CorePalette {
28
+ /**
29
+ * @param argb ARGB representation of a color
30
+ */
31
+ static of(argb) {
32
+ return new CorePalette(argb, false);
33
+ }
34
+
35
+ /**
36
+ * @param argb ARGB representation of a color
37
+ */
38
+ static contentOf(argb) {
39
+ return new CorePalette(argb, true);
40
+ }
41
+
42
+ /**
43
+ * Create a [CorePalette] from a set of colors
44
+ */
45
+ static fromColors(colors) {
46
+ return CorePalette.createPaletteFromColors(false, colors);
47
+ }
48
+
49
+ /**
50
+ * Create a content [CorePalette] from a set of colors
51
+ */
52
+ static contentFromColors(colors) {
53
+ return CorePalette.createPaletteFromColors(true, colors);
54
+ }
55
+ static createPaletteFromColors(content, colors) {
56
+ const palette = new CorePalette(colors.primary, content);
57
+ if (colors.secondary) {
58
+ const p = new CorePalette(colors.secondary, content);
59
+ palette.a2 = p.a1;
60
+ }
61
+ if (colors.tertiary) {
62
+ const p = new CorePalette(colors.tertiary, content);
63
+ palette.a3 = p.a1;
64
+ }
65
+ if (colors.error) {
66
+ const p = new CorePalette(colors.error, content);
67
+ palette.error = p.a1;
68
+ }
69
+ if (colors.neutral) {
70
+ const p = new CorePalette(colors.neutral, content);
71
+ palette.n1 = p.n1;
72
+ }
73
+ if (colors.neutralVariant) {
74
+ const p = new CorePalette(colors.neutralVariant, content);
75
+ palette.n2 = p.n2;
76
+ }
77
+ return palette;
78
+ }
79
+ constructor(argb, isContent) {
80
+ const hct = Hct.fromInt(argb);
81
+ const hue = hct.hue;
82
+ const chroma = hct.chroma;
83
+ if (isContent) {
84
+ this.a1 = TonalPalette.fromHueAndChroma(hue, chroma);
85
+ this.a2 = TonalPalette.fromHueAndChroma(hue, chroma / 3);
86
+ this.a3 = TonalPalette.fromHueAndChroma(hue + 60, chroma / 2);
87
+ this.n1 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 12, 4));
88
+ this.n2 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 6, 8));
89
+ } else {
90
+ this.a1 = TonalPalette.fromHueAndChroma(hue, Math.max(48, chroma));
91
+ this.a2 = TonalPalette.fromHueAndChroma(hue, 16);
92
+ this.a3 = TonalPalette.fromHueAndChroma(hue + 60, 24);
93
+ this.n1 = TonalPalette.fromHueAndChroma(hue, 4);
94
+ this.n2 = TonalPalette.fromHueAndChroma(hue, 8);
95
+ }
96
+ this.error = TonalPalette.fromHueAndChroma(25, 84);
97
+ }
98
+ }
99
+ //# sourceMappingURL=core-palette.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-palette.js","names":["Hct","TonalPalette","CorePalette","of","argb","contentOf","fromColors","colors","createPaletteFromColors","contentFromColors","content","palette","primary","secondary","p","a2","a1","tertiary","a3","error","neutral","n1","neutralVariant","n2","constructor","isContent","hct","fromInt","hue","chroma","fromHueAndChroma","Math","min","max"],"sources":["../../../../src/util/color/palettes/core-palette.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Hct } from '../hct/hct';\nimport { TonalPalette } from './tonal-palette';\n\n/**\n * Set of colors to generate a [CorePalette] from\n */\nexport interface CorePaletteColors {\n primary: number;\n secondary?: number;\n tertiary?: number;\n neutral?: number;\n neutralVariant?: number;\n error?: number;\n}\n\n/**\n * An intermediate concept between the key color for a UI theme, and a full\n * color scheme. 5 sets of tones are generated, all except one use the same hue\n * as the key color, and all vary in chroma.\n */\nexport class CorePalette {\n a1: TonalPalette;\n a2: TonalPalette;\n a3: TonalPalette;\n n1: TonalPalette;\n n2: TonalPalette;\n error: TonalPalette;\n\n /**\n * @param argb ARGB representation of a color\n */\n static of(argb: number): CorePalette {\n return new CorePalette(argb, false);\n }\n\n /**\n * @param argb ARGB representation of a color\n */\n static contentOf(argb: number): CorePalette {\n return new CorePalette(argb, true);\n }\n\n /**\n * Create a [CorePalette] from a set of colors\n */\n static fromColors(colors: CorePaletteColors): CorePalette {\n return CorePalette.createPaletteFromColors(false, colors);\n }\n\n /**\n * Create a content [CorePalette] from a set of colors\n */\n static contentFromColors(colors: CorePaletteColors): CorePalette {\n return CorePalette.createPaletteFromColors(true, colors);\n }\n\n private static createPaletteFromColors(\n content: boolean,\n colors: CorePaletteColors,\n ) {\n const palette = new CorePalette(colors.primary, content);\n if (colors.secondary) {\n const p = new CorePalette(colors.secondary, content);\n palette.a2 = p.a1;\n }\n if (colors.tertiary) {\n const p = new CorePalette(colors.tertiary, content);\n palette.a3 = p.a1;\n }\n if (colors.error) {\n const p = new CorePalette(colors.error, content);\n palette.error = p.a1;\n }\n if (colors.neutral) {\n const p = new CorePalette(colors.neutral, content);\n palette.n1 = p.n1;\n }\n if (colors.neutralVariant) {\n const p = new CorePalette(colors.neutralVariant, content);\n palette.n2 = p.n2;\n }\n return palette;\n }\n\n private constructor(argb: number, isContent: boolean) {\n const hct = Hct.fromInt(argb);\n const hue = hct.hue;\n const chroma = hct.chroma;\n if (isContent) {\n this.a1 = TonalPalette.fromHueAndChroma(hue, chroma);\n this.a2 = TonalPalette.fromHueAndChroma(hue, chroma / 3);\n this.a3 = TonalPalette.fromHueAndChroma(hue + 60, chroma / 2);\n this.n1 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 12, 4));\n this.n2 = TonalPalette.fromHueAndChroma(hue, Math.min(chroma / 6, 8));\n } else {\n this.a1 = TonalPalette.fromHueAndChroma(hue, Math.max(48, chroma));\n this.a2 = TonalPalette.fromHueAndChroma(hue, 16);\n this.a3 = TonalPalette.fromHueAndChroma(hue + 60, 24);\n this.n1 = TonalPalette.fromHueAndChroma(hue, 4);\n this.n2 = TonalPalette.fromHueAndChroma(hue, 8);\n }\n this.error = TonalPalette.fromHueAndChroma(25, 84);\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA,SAgBSA,GAAG;AAAA,SACHC,YAAY;AAErB;AACA;AACA;AAUA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,CAAC;EAQvB;AACF;AACA;EACE,OAAOC,EAAEA,CAACC,IAAY,EAAe;IACnC,OAAO,IAAIF,WAAW,CAACE,IAAI,EAAE,KAAK,CAAC;EACrC;;EAEA;AACF;AACA;EACE,OAAOC,SAASA,CAACD,IAAY,EAAe;IAC1C,OAAO,IAAIF,WAAW,CAACE,IAAI,EAAE,IAAI,CAAC;EACpC;;EAEA;AACF;AACA;EACE,OAAOE,UAAUA,CA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AAG,EAAE,CAAC,CAAC;MAC/C,IAAI,CAACL,EAAE,GAAGtB,YAAY,CAAC6B,gBAAgB,CAACF,GAAG,EAAE,CAAC,CAAC;IACjD;IACA,IAAI,CAACT,KAAK,GAAGlB,YAAY,CAAC6B,gBAAgB,CAAC,EAAE,EAAE,EAAE,CAAC;EACpD;AACF"}
@@ -0,0 +1,112 @@
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
+ /**
5
+ * @license
6
+ * Copyright 2021 Google LLC
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ */
20
+ import { Hct } from "../hct/hct.js";
21
+ /**
22
+ * A convenience class for retrieving colors that are constant in hue and
23
+ * chroma, but vary in tone.
24
+ */
25
+ export class TonalPalette {
26
+ /**
27
+ * @param argb ARGB representation of a color
28
+ * @return Tones matching that color's hue and chroma.
29
+ */
30
+ static fromInt(argb) {
31
+ const hct = Hct.fromInt(argb);
32
+ return TonalPalette.fromHct(hct);
33
+ }
34
+
35
+ /**
36
+ * @param hct Hct
37
+ * @return Tones matching that color's hue and chroma.
38
+ */
39
+ static fromHct(hct) {
40
+ return new TonalPalette(hct.hue, hct.chroma, hct);
41
+ }
42
+
43
+ /**
44
+ * @param hue HCT hue
45
+ * @param chroma HCT chroma
46
+ * @return Tones matching hue and chroma.
47
+ */
48
+ static fromHueAndChroma(hue, chroma) {
49
+ return new TonalPalette(hue, chroma, TonalPalette.createKeyColor(hue, chroma));
50
+ }
51
+ constructor(hue, chroma, keyColor) {
52
+ _defineProperty(this, "cache", new Map());
53
+ this.hue = hue;
54
+ this.chroma = chroma;
55
+ this.keyColor = keyColor;
56
+ }
57
+ static createKeyColor(hue, chroma) {
58
+ const startTone = 50.0;
59
+ let smallestDeltaHct = Hct.from(hue, chroma, startTone);
60
+ let smallestDelta = Math.abs(smallestDeltaHct.chroma - chroma);
61
+ // Starting from T50, check T+/-delta to see if they match the requested
62
+ // chroma.
63
+ //
64
+ // Starts from T50 because T50 has the most chroma available, on
65
+ // average. Thus it is most likely to have a direct answer and minimize
66
+ // iteration.
67
+ for (let delta = 1.0; delta < 50.0; delta += 1.0) {
68
+ // Termination condition rounding instead of minimizing delta to avoid
69
+ // case where requested chroma is 16.51, and the closest chroma is 16.49.
70
+ // Error is minimized, but when rounded and displayed, requested chroma
71
+ // is 17, key color's chroma is 16.
72
+ if (Math.round(chroma) === Math.round(smallestDeltaHct.chroma)) {
73
+ return smallestDeltaHct;
74
+ }
75
+ const hctAdd = Hct.from(hue, chroma, startTone + delta);
76
+ const hctAddDelta = Math.abs(hctAdd.chroma - chroma);
77
+ if (hctAddDelta < smallestDelta) {
78
+ smallestDelta = hctAddDelta;
79
+ smallestDeltaHct = hctAdd;
80
+ }
81
+ const hctSubtract = Hct.from(hue, chroma, startTone - delta);
82
+ const hctSubtractDelta = Math.abs(hctSubtract.chroma - chroma);
83
+ if (hctSubtractDelta < smallestDelta) {
84
+ smallestDelta = hctSubtractDelta;
85
+ smallestDeltaHct = hctSubtract;
86
+ }
87
+ }
88
+ return smallestDeltaHct;
89
+ }
90
+
91
+ /**
92
+ * @param tone HCT tone, measured from 0 to 100.
93
+ * @return ARGB representation of a color with that tone.
94
+ */
95
+ tone(tone) {
96
+ let argb = this.cache.get(tone);
97
+ if (argb === undefined) {
98
+ argb = Hct.from(this.hue, this.chroma, tone).toInt();
99
+ this.cache.set(tone, argb);
100
+ }
101
+ return argb;
102
+ }
103
+
104
+ /**
105
+ * @param tone HCT tone.
106
+ * @return HCT representation of a color with that tone.
107
+ */
108
+ getHct(tone) {
109
+ return Hct.fromInt(this.tone(tone));
110
+ }
111
+ }
112
+ //# sourceMappingURL=tonal-palette.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tonal-palette.js","names":["Hct","TonalPalette","fromInt","argb","hct","fromHct","hue","chroma","fromHueAndChroma","createKeyColor","constructor","keyColor","_defineProperty","Map","startTone","smallestDeltaHct","from","smallestDelta","Math","abs","delta","round","hctAdd","hctAddDelta","hctSubtract","hctSubtractDelta","tone","cache","get","undefined","toInt","set","getHct"],"sources":["../../../../src/util/color/palettes/tonal-palette.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Hct } from '../hct/hct';\n\n/**\n * A convenience class for retrieving colors that are constant in hue and\n * chroma, but vary in tone.\n */\nexport class TonalPalette {\n private readonly cache = new Map<number, number>();\n\n /**\n * @param argb ARGB representation of a color\n * @return Tones matching that color's hue and chroma.\n */\n static fromInt(argb: number): TonalPalette {\n const hct = Hct.fromInt(argb);\n return TonalPalette.fromHct(hct);\n }\n\n /**\n * @param hct Hct\n * @return Tones matching that color's hue and chroma.\n */\n static fromHct(hct: Hct) {\n return new TonalPalette(hct.hue, hct.chroma, hct);\n }\n\n /**\n * @param hue HCT hue\n * @param chroma HCT chroma\n * @return Tones matching hue and chroma.\n */\n static fromHueAndChroma(hue: number, chroma: number): TonalPalette {\n return new TonalPalette(\n hue,\n chroma,\n TonalPalette.createKeyColor(hue, chroma),\n );\n }\n\n private constructor(\n readonly hue: number,\n readonly chroma: number,\n readonly keyColor: Hct,\n ) {}\n\n private static createKeyColor(hue: number, chroma: number): Hct {\n const startTone = 50.0;\n let smallestDeltaHct = Hct.from(hue, chroma, startTone);\n let smallestDelta = Math.abs(smallestDeltaHct.chroma - chroma);\n // Starting from T50, check T+/-delta to see if they match the requested\n // chroma.\n //\n // Starts from T50 because T50 has the most chroma available, on\n // average. Thus it is most likely to have a direct answer and minimize\n // iteration.\n for (let delta = 1.0; delta < 50.0; delta += 1.0) {\n // Termination condition rounding instead of minimizing delta to avoid\n // case where requested chroma is 16.51, and the closest chroma is 16.49.\n // Error is minimized, but when rounded and displayed, requested chroma\n // is 17, key color's chroma is 16.\n if (Math.round(chroma) === Math.round(smallestDeltaHct.chroma)) {\n return smallestDeltaHct;\n }\n\n const hctAdd = Hct.from(hue, chroma, startTone + delta);\n const hctAddDelta = Math.abs(hctAdd.chroma - chroma);\n if (hctAddDelta < smallestDelta) {\n smallestDelta = hctAddDelta;\n smallestDeltaHct = hctAdd;\n }\n\n const hctSubtract = Hct.from(hue, chroma, startTone - delta);\n const hctSubtractDelta = Math.abs(hctSubtract.chroma - chroma);\n if (hctSubtractDelta < smallestDelta) {\n smallestDelta = hctSubtractDelta;\n smallestDeltaHct = hctSubtract;\n }\n }\n\n return smallestDeltaHct;\n }\n\n /**\n * @param tone HCT tone, measured from 0 to 100.\n * @return ARGB representation of a color with that tone.\n */\n tone(tone: number): number {\n let argb = this.cache.get(tone);\n if (argb === undefined) {\n argb = Hct.from(this.hue, this.chroma, tone).toInt();\n this.cache.set(tone, argb);\n }\n return argb;\n }\n\n /**\n * @param tone HCT tone.\n * @return HCT representation of a color with that tone.\n */\n getHct(tone: number): Hct {\n return Hct.fromInt(this.tone(tone));\n }\n}\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfA,SAgBSA,GAAG;AAEZ;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,CAAC;EAGxB;AACF;AACA;AACA;EACE,OAAOC,OAAOA,CAACC,IAAY,EAAgB;IACzC,MAAMC,GAAG,GAAGJ,GAAG,CAACE,OAAO,CAACC,IAAI,CAAC;IAC7B,OAAOF,YAAY,CAACI,OAAO,CAACD,GAAG,CAAC;EAClC;;EAEA;AACF;AACA;AACA;EACE,OAAOC,OAAOA,CAACD,GAAQ,EAAE;IACvB,OAAO,IAAIH,YAAY,CAACG,GAAG,CAACE,GAAG,EAAEF,GAAG,CAACG,MAAM,EAAEH,GAAG,CAAC;EACnD;;EAEA;AACF;AACA;AACA;AACA;EACE,OAAOI,gBAAgBA,CAACF,GAAW,EAAEC,MAAc,EAAgB;IACjE,OAAO,IAAIN,YAAY,CACrBK,GAAG,EACHC,MAAM,EACNN,YAAY,CAACQ,cAAc,CAACH,GAAG,EAAEC,MAAM,CACzC,CAAC;EACH;EAEQG,WAAWA,CACRJ,GAAW,EACXC,MAAc,EACdI,QAAa,EACtB;IAAAC,eAAA,gBApCuB,IAAIC,GAAG,CAAiB,CAAC;IAAA,KAiCvCP,GAAW,GAAXA,GAAW;IAAA,KACXC,MAAc,GAAdA,MAAc;IAAA,KACdI,QAAa,GAAbA,QAAa;EACrB;EAEH,OAAeF,cAAcA,CAACH,GAAW,EAAEC,MAAc,EAAO;IAC9D,MAAMO,SAAS,GAAG,IAAI;IACtB,IAAIC,gBAAgB,GAAGf,GAAG,CAACgB,IAAI,CAACV,GAAG,EAAEC,MAAM,EAAEO,SAAS,CAAC;IACvD,IAAIG,aAAa,GAAGC,IAAI,CAACC,GAAG,CAACJ,gBAA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AC,CAACI,KAAK,CAAC,CAAC;MACpD,IAAI,CAACH,KAAK,CAACI,GAAG,CAACL,IAAI,EAAEvB,IAAI,CAAC;IAC5B;IACA,OAAOA,IAAI;EACb;;EAEA;AACF;AACA;AACA;EACE6B,MAAMA,CAACN,IAAY,EAAO;IACxB,OAAO1B,GAAG,CAACE,OAAO,CAAC,IAAI,CAACwB,IAAI,CAACA,IAAI,CAAC,CAAC;EACrC;AACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/util/color/types.ts"],"sourcesContent":["/**\r\n * RGBA component\r\n *\r\n * @param r Red value should be between 0-255\r\n * @param g Green value should be between 0-255\r\n * @param b Blue value should be between 0-255\r\n * @param a Alpha value should be between 0-255\r\n */\r\nexport interface Rgba {\r\n r: number;\r\n g: number;\r\n b: number;\r\n a: number;\r\n}\r\n"],"mappings":""}
@@ -0,0 +1,139 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2021 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+
18
+ /**
19
+ * Utility methods for mathematical operations.
20
+ */
21
+
22
+ /**
23
+ * The signum function.
24
+ *
25
+ * @return 1 if num > 0, -1 if num < 0, and 0 if num = 0
26
+ */
27
+ export function signum(num) {
28
+ if (num < 0) {
29
+ return -1;
30
+ } else if (num === 0) {
31
+ return 0;
32
+ } else {
33
+ return 1;
34
+ }
35
+ }
36
+
37
+ /**
38
+ * The linear interpolation function.
39
+ *
40
+ * @return start if amount = 0 and stop if amount = 1
41
+ */
42
+ export function lerp(start, stop, amount) {
43
+ return (1.0 - amount) * start + amount * stop;
44
+ }
45
+
46
+ /**
47
+ * Clamps an integer between two integers.
48
+ *
49
+ * @return input when min <= input <= max, and either min or max
50
+ * otherwise.
51
+ */
52
+ export function clampInt(min, max, input) {
53
+ if (input < min) {
54
+ return min;
55
+ } else if (input > max) {
56
+ return max;
57
+ }
58
+ return input;
59
+ }
60
+
61
+ /**
62
+ * Clamps an integer between two floating-point numbers.
63
+ *
64
+ * @return input when min <= input <= max, and either min or max
65
+ * otherwise.
66
+ */
67
+ export function clampDouble(min, max, input) {
68
+ if (input < min) {
69
+ return min;
70
+ } else if (input > max) {
71
+ return max;
72
+ }
73
+ return input;
74
+ }
75
+
76
+ /**
77
+ * Sanitizes a degree measure as an integer.
78
+ *
79
+ * @return a degree measure between 0 (inclusive) and 360
80
+ * (exclusive).
81
+ */
82
+ export function sanitizeDegreesInt(degrees) {
83
+ degrees = degrees % 360;
84
+ if (degrees < 0) {
85
+ degrees = degrees + 360;
86
+ }
87
+ return degrees;
88
+ }
89
+
90
+ /**
91
+ * Sanitizes a degree measure as a floating-point number.
92
+ *
93
+ * @return a degree measure between 0.0 (inclusive) and 360.0
94
+ * (exclusive).
95
+ */
96
+ export function sanitizeDegreesDouble(degrees) {
97
+ degrees = degrees % 360.0;
98
+ if (degrees < 0) {
99
+ degrees = degrees + 360.0;
100
+ }
101
+ return degrees;
102
+ }
103
+
104
+ /**
105
+ * Sign of direction change needed to travel from one angle to
106
+ * another.
107
+ *
108
+ * For angles that are 180 degrees apart from each other, both
109
+ * directions have the same travel distance, so either direction is
110
+ * shortest. The value 1.0 is returned in this case.
111
+ *
112
+ * @param from The angle travel starts from, in degrees.
113
+ * @param to The angle travel ends at, in degrees.
114
+ * @return -1 if decreasing from leads to the shortest travel
115
+ * distance, 1 if increasing from leads to the shortest travel
116
+ * distance.
117
+ */
118
+ export function rotationDirection(from, to) {
119
+ const increasingDifference = sanitizeDegreesDouble(to - from);
120
+ return increasingDifference <= 180.0 ? 1.0 : -1.0;
121
+ }
122
+
123
+ /**
124
+ * Distance of two points on a circle, represented using degrees.
125
+ */
126
+ export function differenceDegrees(a, b) {
127
+ return 180.0 - Math.abs(Math.abs(a - b) - 180.0);
128
+ }
129
+
130
+ /**
131
+ * Multiplies a 1x3 row vector with a 3x3 matrix.
132
+ */
133
+ export function matrixMultiply(row, matrix) {
134
+ const a = row[0] * matrix[0][0] + row[1] * matrix[0][1] + row[2] * matrix[0][2];
135
+ const b = row[0] * matrix[1][0] + row[1] * matrix[1][1] + row[2] * matrix[1][2];
136
+ const c = row[0] * matrix[2][0] + row[1] * matrix[2][1] + row[2] * matrix[2][2];
137
+ return [a, b, c];
138
+ }
139
+ //# sourceMappingURL=math-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"math-utils.js","names":["signum","num","lerp","start","stop","amount","clampInt","min","max","input","clampDouble","sanitizeDegreesInt","degrees","sanitizeDegreesDouble","rotationDirection","from","to","increasingDifference","differenceDegrees","a","b","Math","abs","matrixMultiply","row","matrix","c"],"sources":["../../../../src/util/color/utils/math-utils.ts"],"sourcesContent":["/**\r\n * @license\r\n * Copyright 2021 Google LLC\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\n/**\r\n * Utility methods for mathematical operations.\r\n */\r\n\r\n/**\r\n * The signum function.\r\n *\r\n * @return 1 if num > 0, -1 if num < 0, and 0 if num = 0\r\n */\r\nexport function signum(num: number): number {\r\n if (num < 0) {\r\n return -1;\r\n } else if (num === 0) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n}\r\n\r\n/**\r\n * The linear interpolation function.\r\n *\r\n * @return start if amount = 0 and stop if amount = 1\r\n */\r\nexport function lerp(start: number, stop: number, amount: number): number {\r\n return (1.0 - amount) * start + amount * stop;\r\n}\r\n\r\n/**\r\n * Clamps an integer between two integers.\r\n *\r\n * @return input when min <= input <= max, and either min or max\r\n * otherwise.\r\n */\r\nexport function clampInt(min: number, max: number, input: number): number {\r\n if (input < min) {\r\n return min;\r\n } else if (input > max) {\r\n return max;\r\n }\r\n\r\n return input;\r\n}\r\n\r\n/**\r\n * Clamps an integer between two floating-point numbers.\r\n *\r\n * @return input when min <= input <= max, and either min or max\r\n * otherwise.\r\n */\r\nexport function clampDouble(min: number, max: number, input: number): number {\r\n if (input < min) {\r\n return min;\r\n } else if (input > max) {\r\n return max;\r\n }\r\n\r\n return input;\r\n}\r\n\r\n/**\r\n * Sanitizes a degree measure as an integer.\r\n *\r\n * @return a degree measure between 0 (inclusive) and 360\r\n * (exclusive).\r\n */\r\nexport function sanitizeDegreesInt(degrees: number): number {\r\n degrees = degrees % 360;\r\n if (degrees < 0) {\r\n degrees = degrees + 360;\r\n }\r\n return degrees;\r\n}\r\n\r\n/**\r\n * Sanitizes a degree measure as a floating-point number.\r\n *\r\n * @return a degree measure between 0.0 (inclusive) and 360.0\r\n * (exclusive).\r\n */\r\nexport function sanitizeDegreesDouble(degrees: number): number {\r\n degrees = degrees % 360.0;\r\n if (degrees < 0) {\r\n degrees = degrees + 360.0;\r\n }\r\n return degrees;\r\n}\r\n\r\n/**\r\n * Sign of direction change needed to travel from one angle to\r\n * another.\r\n *\r\n * For angles that are 180 degrees apart from each other, both\r\n * directions have the same travel distance, so either direction is\r\n * shortest. The value 1.0 is returned in this case.\r\n *\r\n * @param from The angle travel starts from, in degrees.\r\n * @param to The angle travel ends at, in degrees.\r\n * @return -1 if decreasing from leads to the shortest travel\r\n * distance, 1 if increasing from leads to the shortest travel\r\n * distance.\r\n */\r\nexport function rotationDirection(from: number, to: number): number {\r\n const increasingDifference = sanitizeDegreesDouble(to - from);\r\n return increasingDifference <= 180.0 ? 1.0 : -1.0;\r\n}\r\n\r\n/**\r\n * Distance of two points on a circle, represented using degrees.\r\n */\r\nexport function differenceDegrees(a: number, b: number): number {\r\n return 180.0 - Math.abs(Math.abs(a - b) - 180.0);\r\n}\r\n\r\n/**\r\n * Multiplies a 1x3 row vector with a 3x3 matrix.\r\n */\r\nexport function matrixMultiply(row: number[], matrix: number[][]): number[] {\r\n const a =\r\n row[0] * matrix[0][0] + row[1] * matrix[0][1] + row[2] * matrix[0][2];\r\n const b =\r\n row[0] * matrix[1][0] + row[1] * matrix[1][1] + row[2] * matrix[1][2];\r\n const c =\r\n row[0] * matrix[2][0] + row[1] * matrix[2][1] + row[2] * matrix[2][2];\r\n return [a, b, c];\r\n}\r\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,MAAMA,CAACC,GAAW,EAAU;EAC1C,IAAIA,GAAG,GAAG,CAAC,EAAE;IACX,OAAO,CAAC,CAAC;EACX,CAAC,MAAM,IAAIA,GAAG,KAAK,CAAC,EAAE;IACpB,OAAO,CAAC;EACV,CAAC,MAAM;IACL,OAAO,CAAC;EACV;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,IAAIA,CAACC,KAAa,EAAEC,IAAY,EAAEC,MAAc,EAAU;EACxE,OAAO,CAAC,GAAG,GAAGA,MAAM,IAAIF,KAAK,GAAGE,MAAM,GAAGD,IAAI;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,QAAQA,CAACC,GAAW,EAAEC,GAAW,EAAEC,KAAa,EAAU;EACxE,IAAIA,KAAK,GAAGF,GAAG,EAAE;IACf,OAAOA,GAAG;EACZ,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