yuyeon 0.0.0 → 0.0.3

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 (386) hide show
  1. package/dist/style.css +1 -0
  2. package/dist/yuyeon.mjs +3607 -0
  3. package/dist/yuyeon.umd.js +1 -0
  4. package/lib/components/app/YApp.mjs +30 -0
  5. package/lib/components/app/YApp.mjs.map +1 -0
  6. package/lib/components/app/YApp.scss +14 -0
  7. package/lib/components/app/index.mjs +2 -0
  8. package/lib/components/app/index.mjs.map +1 -0
  9. package/lib/components/bench/YBench.mjs +44 -0
  10. package/lib/components/bench/YBench.mjs.map +1 -0
  11. package/lib/components/bench/index.mjs +2 -0
  12. package/lib/components/bench/index.mjs.map +1 -0
  13. package/lib/components/button/YButton.mjs +138 -0
  14. package/lib/components/button/YButton.mjs.map +1 -0
  15. package/{src/components/button/y-btn.scss → lib/components/button/YButton.scss} +67 -29
  16. package/lib/components/button/index.mjs +2 -0
  17. package/lib/components/button/index.mjs.map +1 -0
  18. package/lib/components/card/YCard.mjs +18 -0
  19. package/lib/components/card/YCard.mjs.map +1 -0
  20. package/lib/components/card/YCardBody.mjs +10 -0
  21. package/lib/components/card/YCardBody.mjs.map +1 -0
  22. package/lib/components/card/YCardFooter.mjs +10 -0
  23. package/lib/components/card/YCardFooter.mjs.map +1 -0
  24. package/lib/components/card/YCardHeader.mjs +10 -0
  25. package/lib/components/card/YCardHeader.mjs.map +1 -0
  26. package/lib/components/card/index.mjs +6 -0
  27. package/lib/components/card/index.mjs.map +1 -0
  28. package/lib/components/checkbox/YCheckbox.mjs +154 -0
  29. package/lib/components/checkbox/YCheckbox.mjs.map +1 -0
  30. package/lib/components/checkbox/YInputCheckbox.mjs +113 -0
  31. package/lib/components/checkbox/YInputCheckbox.mjs.map +1 -0
  32. package/{src/components/checkbox/y-input-checkbox.scss → lib/components/checkbox/YInputCheckbox.scss} +19 -19
  33. package/lib/components/checkbox/index.mjs +5 -0
  34. package/lib/components/checkbox/index.mjs.map +1 -0
  35. package/{src/components/chip/y-chip.vue → lib/components/chip/YChip.mjs} +26 -27
  36. package/lib/components/chip/YChip.mjs.map +1 -0
  37. package/{src/components/chip/y-chip.scss → lib/components/chip/YChip.scss} +0 -4
  38. package/lib/components/chip/index.mjs +3 -0
  39. package/lib/components/chip/index.mjs.map +1 -0
  40. package/lib/components/dialog/YDialog.mjs +97 -0
  41. package/lib/components/dialog/YDialog.mjs.map +1 -0
  42. package/lib/components/dialog/index.mjs +2 -0
  43. package/lib/components/dialog/index.mjs.map +1 -0
  44. package/lib/components/field-input/YFieldInput.mjs +218 -0
  45. package/lib/components/field-input/YFieldInput.mjs.map +1 -0
  46. package/{src/components/field-input/y-field-input.scss → lib/components/field-input/YFieldInput.scss} +2 -4
  47. package/lib/components/field-input/index.mjs +2 -0
  48. package/lib/components/field-input/index.mjs.map +1 -0
  49. package/lib/components/form/YForm.mjs +79 -0
  50. package/lib/components/form/YForm.mjs.map +1 -0
  51. package/lib/components/form/index.mjs +4 -0
  52. package/lib/components/form/index.mjs.map +1 -0
  53. package/lib/components/icons/YIconCheckbox.mjs +21 -0
  54. package/lib/components/icons/YIconCheckbox.mjs.map +1 -0
  55. package/lib/components/icons/YIconClear.mjs +16 -0
  56. package/lib/components/icons/YIconClear.mjs.map +1 -0
  57. package/lib/components/icons/YIconExpand.mjs +20 -0
  58. package/lib/components/icons/YIconExpand.mjs.map +1 -0
  59. package/lib/components/icons/index.mjs +4 -0
  60. package/lib/components/icons/index.mjs.map +1 -0
  61. package/lib/components/index.mjs +24 -0
  62. package/lib/components/index.mjs.map +1 -0
  63. package/lib/components/input/YInput.mjs +346 -0
  64. package/lib/components/input/YInput.mjs.map +1 -0
  65. package/{src/components/input/y-input.scss → lib/components/input/YInput.scss} +12 -4
  66. package/lib/components/input/index.mjs +2 -0
  67. package/lib/components/input/index.mjs.map +1 -0
  68. package/lib/components/input/index.scss +2 -0
  69. package/lib/components/layer/YLayer.mjs +193 -0
  70. package/lib/components/layer/YLayer.mjs.map +1 -0
  71. package/lib/components/layer/index.mjs +2 -0
  72. package/lib/components/layer/index.mjs.map +1 -0
  73. package/lib/components/layer/scroll-strategies.mjs +132 -0
  74. package/lib/components/layer/scroll-strategies.mjs.map +1 -0
  75. package/lib/components/list/YList.mjs +16 -0
  76. package/lib/components/list/YList.mjs.map +1 -0
  77. package/lib/components/list/YList.scss +3 -0
  78. package/lib/components/list/YListItem.mjs +37 -0
  79. package/lib/components/list/YListItem.mjs.map +1 -0
  80. package/lib/components/list/YListItem.scss +59 -0
  81. package/lib/components/list/index.mjs +3 -0
  82. package/lib/components/list/index.mjs.map +1 -0
  83. package/lib/components/loading/YSpinnerRing.mjs +25 -0
  84. package/lib/components/loading/YSpinnerRing.mjs.map +1 -0
  85. package/{src/components/ring-spinner/y-ring-spinner.scss → lib/components/loading/YSpinnerRing.scss} +3 -3
  86. package/lib/components/loading/index.mjs +2 -0
  87. package/lib/components/loading/index.mjs.map +1 -0
  88. package/lib/components/menu/YMenu.mjs +239 -0
  89. package/lib/components/menu/YMenu.mjs.map +1 -0
  90. package/lib/components/menu/YMenu.scss +7 -0
  91. package/lib/components/menu/index.mjs +2 -0
  92. package/lib/components/menu/index.mjs.map +1 -0
  93. package/lib/components/navigation/YNavigation.mjs +17 -0
  94. package/lib/components/navigation/YNavigation.mjs.map +1 -0
  95. package/lib/components/navigation/index.mjs +2 -0
  96. package/lib/components/navigation/index.mjs.map +1 -0
  97. package/lib/components/pagination/YPagination.mjs +61 -0
  98. package/lib/components/pagination/YPagination.mjs.map +1 -0
  99. package/lib/components/pagination/YPagination.scss +5 -0
  100. package/lib/components/pagination/index.mjs +2 -0
  101. package/lib/components/pagination/index.mjs.map +1 -0
  102. package/lib/components/panel/YDividePanel.mjs +89 -0
  103. package/lib/components/panel/YDividePanel.mjs.map +1 -0
  104. package/lib/components/panel/YDividePanel.scss +43 -0
  105. package/lib/components/panel/index.mjs +2 -0
  106. package/lib/components/panel/index.mjs.map +1 -0
  107. package/lib/components/plate/YPlate.mjs +27 -0
  108. package/lib/components/plate/YPlate.mjs.map +1 -0
  109. package/lib/components/plate/YPlate.scss +9 -0
  110. package/lib/components/plate/index.mjs +2 -0
  111. package/lib/components/plate/index.mjs.map +1 -0
  112. package/lib/components/progress-bar/YProgressBar.mjs +110 -0
  113. package/lib/components/progress-bar/YProgressBar.mjs.map +1 -0
  114. package/lib/components/progress-bar/YProgressBar.scss +40 -0
  115. package/lib/components/progress-bar/index.mjs +2 -0
  116. package/lib/components/progress-bar/index.mjs.map +1 -0
  117. package/lib/components/snackbar/YSnackbar.mjs +187 -0
  118. package/lib/components/snackbar/YSnackbar.mjs.map +1 -0
  119. package/lib/components/snackbar/YSnackbar.scss +38 -0
  120. package/lib/components/snackbar/index.mjs +2 -0
  121. package/lib/components/snackbar/index.mjs.map +1 -0
  122. package/lib/components/switch/YSwitch.mjs +228 -0
  123. package/lib/components/switch/YSwitch.mjs.map +1 -0
  124. package/{src/components/switch/y-switch.scss → lib/components/switch/YSwitch.scss} +18 -26
  125. package/lib/components/switch/index.mjs +2 -0
  126. package/lib/components/switch/index.mjs.map +1 -0
  127. package/lib/components/table/YDataTable.mjs +46 -0
  128. package/lib/components/table/YDataTable.mjs.map +1 -0
  129. package/lib/components/table/YDataTableBody.mjs +12 -0
  130. package/lib/components/table/YDataTableBody.mjs.map +1 -0
  131. package/lib/components/table/YDataTableCell.mjs +55 -0
  132. package/lib/components/table/YDataTableCell.mjs.map +1 -0
  133. package/lib/components/table/YDataTableControl.mjs +37 -0
  134. package/lib/components/table/YDataTableControl.mjs.map +1 -0
  135. package/lib/components/table/YDataTableControl.scss +6 -0
  136. package/lib/components/table/YDataTableHead.mjs +12 -0
  137. package/lib/components/table/YDataTableHead.mjs.map +1 -0
  138. package/lib/components/table/YDataTableLayer.mjs +14 -0
  139. package/lib/components/table/YDataTableLayer.mjs.map +1 -0
  140. package/lib/components/table/YDataTableRow.mjs +12 -0
  141. package/lib/components/table/YDataTableRow.mjs.map +1 -0
  142. package/lib/components/table/YDataTableServer.mjs +54 -0
  143. package/lib/components/table/YDataTableServer.mjs.map +1 -0
  144. package/lib/components/table/YTable.mjs +53 -0
  145. package/lib/components/table/YTable.mjs.map +1 -0
  146. package/lib/components/table/YTable.scss +61 -0
  147. package/lib/components/table/index.mjs +4 -0
  148. package/lib/components/table/index.mjs.map +1 -0
  149. package/lib/components/table/pagination.mjs +21 -0
  150. package/lib/components/table/pagination.mjs.map +1 -0
  151. package/lib/components/text-highlighter/YTextHighlighter.mjs +94 -0
  152. package/lib/components/text-highlighter/YTextHighlighter.mjs.map +1 -0
  153. package/lib/components/text-highlighter/index.mjs +3 -0
  154. package/lib/components/text-highlighter/index.mjs.map +1 -0
  155. package/lib/components/tooltip/YTooltip.mjs +209 -0
  156. package/lib/components/tooltip/YTooltip.mjs.map +1 -0
  157. package/lib/components/tooltip/YTooltip.scss +19 -0
  158. package/lib/components/tooltip/index.mjs +2 -0
  159. package/lib/components/tooltip/index.mjs.map +1 -0
  160. package/lib/components/transitions/expand-transition.mjs +88 -0
  161. package/lib/components/transitions/expand-transition.mjs.map +1 -0
  162. package/lib/components/transitions/index.mjs +4 -0
  163. package/lib/components/transitions/index.mjs.map +1 -0
  164. package/lib/components/tree-view/YTreeView.mjs +92 -0
  165. package/lib/components/tree-view/YTreeView.mjs.map +1 -0
  166. package/lib/components/tree-view/YTreeView.scss +46 -0
  167. package/lib/components/tree-view/YTreeViewNode.mjs +122 -0
  168. package/lib/components/tree-view/YTreeViewNode.mjs.map +1 -0
  169. package/lib/components/tree-view/index.mjs +3 -0
  170. package/lib/components/tree-view/index.mjs.map +1 -0
  171. package/lib/composables/collections.mjs +2 -0
  172. package/lib/composables/collections.mjs.map +1 -0
  173. package/lib/composables/communication.mjs +46 -0
  174. package/lib/composables/communication.mjs.map +1 -0
  175. package/lib/composables/component.mjs +8 -0
  176. package/lib/composables/component.mjs.map +1 -0
  177. package/{src/composables/layer-group.ts → lib/composables/layer-group.mjs} +8 -10
  178. package/lib/composables/layer-group.mjs.map +1 -0
  179. package/lib/composables/layout.mjs +13 -0
  180. package/lib/composables/layout.mjs.map +1 -0
  181. package/lib/composables/levitation.mjs +135 -0
  182. package/lib/composables/levitation.mjs.map +1 -0
  183. package/{src/composables/progress.ts → lib/composables/progress.mjs} +6 -5
  184. package/lib/composables/progress.mjs.map +1 -0
  185. package/lib/composables/resize-observer.mjs +34 -0
  186. package/lib/composables/resize-observer.mjs.map +1 -0
  187. package/lib/composables/scope.mjs +27 -0
  188. package/lib/composables/scope.mjs.map +1 -0
  189. package/lib/composables/theme/index.mjs +49 -0
  190. package/lib/composables/theme/index.mjs.map +1 -0
  191. package/lib/composables/theme/setting.mjs +46 -0
  192. package/lib/composables/theme/setting.mjs.map +1 -0
  193. package/lib/composables/timing.mjs +77 -0
  194. package/lib/composables/timing.mjs.map +1 -0
  195. package/lib/composables/transition.mjs +50 -0
  196. package/lib/composables/transition.mjs.map +1 -0
  197. package/lib/directives/complement-click/index.mjs +78 -0
  198. package/lib/directives/complement-click/index.mjs.map +1 -0
  199. package/{src/directives/plate-wave/index.ts → lib/directives/plate-wave/index.mjs} +25 -42
  200. package/lib/directives/plate-wave/index.mjs.map +1 -0
  201. package/{src → lib}/directives/plate-wave/plate-wave.scss +1 -1
  202. package/lib/directives/theme-class.mjs +24 -0
  203. package/lib/directives/theme-class.mjs.map +1 -0
  204. package/lib/etc/index.mjs +6 -0
  205. package/lib/etc/index.mjs.map +1 -0
  206. package/lib/index.mjs +55 -0
  207. package/lib/index.mjs.map +1 -0
  208. package/{src/mixins/di.ts → lib/mixins/di.mjs} +7 -8
  209. package/lib/mixins/di.mjs.map +1 -0
  210. package/{src/mixins/rebind-attrs.ts → lib/mixins/rebind-attrs.mjs} +9 -8
  211. package/lib/mixins/rebind-attrs.mjs.map +1 -0
  212. package/{src/styles/palette.scss → lib/styles/_palette.scss} +0 -4
  213. package/lib/styles/base.scss +95 -0
  214. package/lib/styles/settings/_variables.scss +14 -0
  215. package/lib/styles/settings/provided.scss +35 -0
  216. package/lib/styles/theme/dark.scss +21 -0
  217. package/{src → lib}/styles/theme/index.scss +0 -3
  218. package/lib/styles/theme/light.scss +21 -0
  219. package/lib/util/FrameScheduler.mjs +29 -0
  220. package/lib/util/FrameScheduler.mjs.map +1 -0
  221. package/lib/util/Rect.mjs +27 -0
  222. package/lib/util/Rect.mjs.map +1 -0
  223. package/lib/util/common.mjs +66 -0
  224. package/lib/util/common.mjs.map +1 -0
  225. package/lib/util/dom.mjs +8 -0
  226. package/lib/util/dom.mjs.map +1 -0
  227. package/lib/util/scroll.mjs +28 -0
  228. package/lib/util/scroll.mjs.map +1 -0
  229. package/lib/util/string.mjs +33 -0
  230. package/lib/util/string.mjs.map +1 -0
  231. package/lib/util/ui.mjs +83 -0
  232. package/lib/util/ui.mjs.map +1 -0
  233. package/lib/util/validation.mjs +5 -0
  234. package/lib/util/validation.mjs.map +1 -0
  235. package/lib/util/vue-component.mjs +64 -0
  236. package/lib/util/vue-component.mjs.map +1 -0
  237. package/package.json +62 -22
  238. package/types/components/app/YApp.d.ts +7 -0
  239. package/types/components/app/index.d.ts +1 -0
  240. package/types/components/button/YButton.d.ts +122 -0
  241. package/types/components/button/index.d.ts +1 -0
  242. package/types/components/card/YCard.d.ts +11 -0
  243. package/types/components/card/YCardBody.d.ts +2 -0
  244. package/types/components/card/YCardFooter.d.ts +2 -0
  245. package/types/components/card/YCardHeader.d.ts +2 -0
  246. package/types/components/card/index.d.ts +5 -0
  247. package/types/components/checkbox/YCheckbox.d.ts +46 -0
  248. package/types/components/checkbox/YInputCheckbox.d.ts +42 -0
  249. package/types/components/checkbox/index.d.ts +4 -0
  250. package/types/components/chip/YChip.d.ts +34 -0
  251. package/types/components/chip/index.d.ts +2 -0
  252. package/types/components/dialog/YDialog.d.ts +120 -0
  253. package/types/components/dialog/index.d.ts +1 -0
  254. package/types/components/field-input/YFieldInput.d.ts +118 -0
  255. package/types/components/field-input/index.d.ts +1 -0
  256. package/types/components/form/YForm.d.ts +32 -0
  257. package/types/components/form/index.d.ts +3 -0
  258. package/types/components/icons/YIconCheckbox.d.ts +1 -0
  259. package/types/components/icons/YIconClear.d.ts +1 -0
  260. package/types/components/icons/YIconExpand.d.ts +1 -0
  261. package/types/components/icons/index.d.ts +3 -0
  262. package/types/components/index.d.ts +23 -0
  263. package/types/components/input/YInput.d.ts +166 -0
  264. package/types/components/input/index.d.ts +1 -0
  265. package/types/components/layer/YLayer.d.ts +99 -0
  266. package/types/components/layer/index.d.ts +1 -0
  267. package/types/components/list/YList.d.ts +2 -0
  268. package/types/components/list/YListItem.d.ts +28 -0
  269. package/types/components/list/index.d.ts +2 -0
  270. package/types/components/loading/YSpinnerRing.d.ts +1 -0
  271. package/types/components/loading/index.d.ts +1 -0
  272. package/types/components/menu/YMenu.d.ts +236 -0
  273. package/types/components/menu/index.d.ts +1 -0
  274. package/types/components/pagination/YPagination.d.ts +106 -0
  275. package/types/components/pagination/index.d.ts +1 -0
  276. package/types/components/panel/YDividePanel.d.ts +3 -0
  277. package/types/components/panel/index.d.ts +1 -0
  278. package/types/components/plate/YPlate.d.ts +10 -0
  279. package/types/components/plate/index.d.ts +1 -0
  280. package/types/components/progress-bar/YProgressBar.d.ts +59 -0
  281. package/types/components/progress-bar/index.d.ts +1 -0
  282. package/types/components/snackbar/YSnackbar.d.ts +77 -0
  283. package/types/components/snackbar/index.d.ts +1 -0
  284. package/types/components/switch/YSwitch.d.ts +106 -0
  285. package/types/components/switch/index.d.ts +1 -0
  286. package/types/components/table/YDataTable.d.ts +63 -0
  287. package/types/components/table/YDataTableBody.d.ts +2 -0
  288. package/types/components/table/YDataTableControl.d.ts +2 -0
  289. package/types/components/table/YDataTableHead.d.ts +2 -0
  290. package/types/components/table/YDataTableLayer.d.ts +2 -0
  291. package/types/components/table/YDataTableServer.d.ts +82 -0
  292. package/types/components/table/YTable.d.ts +32 -0
  293. package/types/components/table/index.d.ts +3 -0
  294. package/types/components/table/pagination.d.ts +38 -0
  295. package/types/components/tooltip/YTooltip.d.ts +188 -0
  296. package/types/components/tooltip/index.d.ts +1 -0
  297. package/types/components/transitions/expand-transition.d.ts +16 -0
  298. package/types/components/transitions/index.d.ts +32 -0
  299. package/types/components/tree-view/YTreeView.d.ts +37 -0
  300. package/types/components/tree-view/YTreeViewNode.d.ts +51 -0
  301. package/types/components/tree-view/index.d.ts +2 -0
  302. package/types/composables/communication.d.ts +1 -0
  303. package/types/composables/component.d.ts +2 -0
  304. package/types/composables/layer-group.d.ts +5 -0
  305. package/types/composables/progress.d.ts +3 -0
  306. package/types/composables/resize-observer.d.ts +14 -0
  307. package/types/composables/scope.d.ts +2 -0
  308. package/types/composables/theme/index.d.ts +15 -0
  309. package/types/composables/theme/setting.d.ts +12 -0
  310. package/types/composables/timing.d.ts +15 -0
  311. package/types/composables/transition.d.ts +21 -0
  312. package/types/directives/complement-click/index.d.ts +25 -0
  313. package/types/directives/plate-wave/index.d.ts +13 -0
  314. package/types/directives/theme-class.d.ts +3 -0
  315. package/types/etc/index.d.ts +1 -0
  316. package/types/globals.d.ts +11 -0
  317. package/types/index.d.ts +9 -0
  318. package/types/mixins/di.d.ts +2 -0
  319. package/types/mixins/rebind-attrs.d.ts +5 -0
  320. package/types/shims.d.ts +71 -0
  321. package/types/util/common.d.ts +8 -0
  322. package/types/util/dom.d.ts +1 -0
  323. package/types/util/string.d.ts +3 -0
  324. package/types/util/ui.d.ts +9 -0
  325. package/types/util/vue-component.d.ts +33 -0
  326. package/types/vite-env.d.ts +1 -0
  327. package/src/components/button/index.ts +0 -3
  328. package/src/components/button/y-btn.ts +0 -104
  329. package/src/components/card/index.ts +0 -6
  330. package/src/components/card/y-card-body.ts +0 -8
  331. package/src/components/card/y-card-footer.ts +0 -8
  332. package/src/components/card/y-card-header.ts +0 -8
  333. package/src/components/card/y-card.ts +0 -16
  334. package/src/components/checkbox/IconCheckbox.vue +0 -24
  335. package/src/components/checkbox/YCheckbox.vue +0 -113
  336. package/src/components/checkbox/YInputCheckbox.vue +0 -108
  337. package/src/components/checkbox/index.ts +0 -8
  338. package/src/components/chip/index.ts +0 -3
  339. package/src/components/dialog/index.ts +0 -3
  340. package/src/components/dialog/y-dialog.vue +0 -46
  341. package/src/components/field-input/index.scss +0 -5
  342. package/src/components/field-input/index.ts +0 -11
  343. package/src/components/field-input/y-field-input.ts +0 -214
  344. package/src/components/form/index.ts +0 -9
  345. package/src/components/form/y-form.ts +0 -93
  346. package/src/components/icons/icon-clearable.ts +0 -6
  347. package/src/components/index.ts +0 -17
  348. package/src/components/input/index.scss +0 -5
  349. package/src/components/input/index.ts +0 -9
  350. package/src/components/input/y-input.ts +0 -368
  351. package/src/components/layer/index.ts +0 -3
  352. package/src/components/layer/y-layer.vue +0 -146
  353. package/src/components/lottie-player.ts +0 -41
  354. package/src/components/progress-bar/index.ts +0 -3
  355. package/src/components/progress-bar/y-progress-bar.vue +0 -144
  356. package/src/components/ring-spinner/y-ring-spinner.vue +0 -31
  357. package/src/components/switch/YSwitch.vue +0 -217
  358. package/src/components/switch/index.scss +0 -5
  359. package/src/components/switch/index.ts +0 -11
  360. package/src/components/text-highlighter/index.scss +0 -5
  361. package/src/components/text-highlighter/index.ts +0 -3
  362. package/src/components/text-highlighter/y-text-highlighter.ts +0 -89
  363. package/src/composables/lazy.ts +0 -30
  364. package/src/composables/theme.ts +0 -25
  365. package/src/directives/complement-click/index.ts +0 -123
  366. package/src/directives/theme-class.ts +0 -14
  367. package/src/file-extension.d.ts +0 -14
  368. package/src/index.ts +0 -21
  369. package/src/styles/base.scss +0 -28
  370. package/src/styles/theme/dark.scss +0 -35
  371. package/src/styles/theme/light.scss +0 -32
  372. package/src/util/common.ts +0 -59
  373. package/src/util/date-time.ts +0 -41
  374. package/src/util/dom.ts +0 -6
  375. package/src/util/string.ts +0 -9
  376. package/src/util/ui.ts +0 -39
  377. package/src/util/validation.ts +0 -9
  378. package/src/util/vue-component.ts +0 -18
  379. /package/{src/components/card/y-card.scss → lib/components/card/YCard.scss} +0 -0
  380. /package/{src/components/checkbox/y-checkbox.scss → lib/components/checkbox/YCheckbox.scss} +0 -0
  381. /package/{src/components/dialog/y-dialog.scss → lib/components/dialog/YDialog.scss} +0 -0
  382. /package/{src/components/layer/y-layer.scss → lib/components/layer/YLayer.scss} +0 -0
  383. /package/{src/components/text-highlighter/y-text-highlighter.scss → lib/components/text-highlighter/YTextHighlighter.scss} +0 -0
  384. /package/{src/styles/variables.scss → lib/styles/_variables.scss} +0 -0
  385. /package/{src → lib}/styles/util/helper.scss +0 -0
  386. /package/{src → lib}/styles/util/theme.scss +0 -0
@@ -0,0 +1,10 @@
1
+ import { defineComponent, h } from 'vue';
2
+ export default defineComponent({
3
+ name: 'y-card-header',
4
+ render() {
5
+ return h('div', {
6
+ class: 'y-card__header'
7
+ }, this.$slots.default?.());
8
+ }
9
+ });
10
+ //# sourceMappingURL=YCardHeader.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YCardHeader.mjs","names":["defineComponent","h","name","render","class","$slots","default"],"sources":["../../../src/components/card/YCardHeader.ts"],"sourcesContent":["import { defineComponent, h } from 'vue';\n\nexport default defineComponent({\n name: 'y-card-header',\n render() {\n return h('div', { class: 'y-card__header' }, this.$slots.default?.());\n },\n});\n"],"mappings":"AAAA,SAASA,eAAe,EAAEC,CAAC,QAAQ,KAAK;AAExC,eAAeD,eAAe,CAAC;EAC7BE,IAAI,EAAE,eAAe;EACrBC,MAAMA,CAAA,EAAG;IACP,OAAOF,CAAC,CAAC,KAAK,EAAE;MAAEG,KAAK,EAAE;IAAiB,CAAC,EAAE,IAAI,CAACC,MAAM,CAACC,OAAO,GAAG,CAAC,CAAC;EACvE;AACF,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import YCard from "./YCard.mjs";
2
+ import YCardBody from "./YCardBody.mjs";
3
+ import YCardFooter from "./YCardFooter.mjs";
4
+ import YCardHeader from "./YCardHeader.mjs";
5
+ export { YCard, YCardHeader, YCardBody, YCardFooter };
6
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["YCard","YCardBody","YCardFooter","YCardHeader"],"sources":["../../../src/components/card/index.ts"],"sourcesContent":["import YCard from './YCard';\nimport YCardBody from './YCardBody';\nimport YCardFooter from './YCardFooter';\nimport YCardHeader from './YCardHeader';\n\nexport { YCard, YCardHeader, YCardBody, YCardFooter };\n"],"mappings":"OAAOA,KAAK;AAAA,OACLC,SAAS;AAAA,OACTC,WAAW;AAAA,OACXC,WAAW;AAElB,SAASH,KAAK,EAAEG,WAAW,EAAEF,SAAS,EAAEC,WAAW"}
@@ -0,0 +1,154 @@
1
+ import { createVNode as _createVNode } from "vue";
2
+ import { computed, defineComponent, ref, withModifiers } from 'vue';
3
+ import { useRender } from "../../composables/component.mjs";
4
+ import { getUid } from "../../util/vue-component.mjs";
5
+ import "./YCheckbox.scss";
6
+ import YInputCheckbox from "./YInputCheckbox.mjs";
7
+ export default defineComponent({
8
+ name: 'YCheckbox',
9
+ components: {
10
+ YInputCheckbox
11
+ },
12
+ model: {
13
+ prop: 'inputValue',
14
+ event: 'change'
15
+ },
16
+ emits: ['focus', 'blur', 'change'],
17
+ props: {
18
+ inputValue: [Boolean, Array],
19
+ value: [String, Number, Object],
20
+ label: String,
21
+ reverse: Boolean,
22
+ icon: {
23
+ type: [Object, String]
24
+ },
25
+ color: {
26
+ type: String,
27
+ default: () => 'primary'
28
+ },
29
+ disabled: Boolean,
30
+ readonly: Boolean
31
+ },
32
+ setup(props, _ref) {
33
+ let {
34
+ emit,
35
+ slots
36
+ } = _ref;
37
+ const focused = ref(false);
38
+ const innerValue = ref(false);
39
+ const counterId = (getUid() ?? '').toString();
40
+ const inputId = `input-${counterId}`;
41
+ function onFocus(e) {
42
+ focused.value = true;
43
+ emit('focus', e);
44
+ }
45
+ function onBlur(e) {
46
+ focused.value = false;
47
+ emit('blur', e);
48
+ }
49
+ function onClick(e) {
50
+ if (props.disabled || props.readonly) return;
51
+ innerValue.value = !innerValue.value;
52
+ emit('change', innerValue.value, e);
53
+ }
54
+ function inputByValue() {
55
+ if (Array.isArray(props.inputValue)) {
56
+ const found = props.inputValue?.find(inp => inp === props.value);
57
+ if (found !== undefined) {
58
+ innerValue.value = true;
59
+ } else {
60
+ innerValue.value = false;
61
+ }
62
+ } else if (typeof props.inputValue === 'boolean') {
63
+ innerValue.value = props.inputValue;
64
+ }
65
+ }
66
+ const classes = computed(() => {
67
+ const {
68
+ reverse,
69
+ disabled,
70
+ readonly
71
+ } = props;
72
+ return {
73
+ 'y-checkbox': true,
74
+ 'y-checkbox--reverse': !!reverse,
75
+ 'y-checkbox--focused': focused.value,
76
+ 'y-checkbox--disabled': !!disabled,
77
+ 'y-checkbox--readonly': !!readonly
78
+ };
79
+ });
80
+ const computedIcon = computed(() => {
81
+ if (typeof props.icon === 'string') {
82
+ return props.icon;
83
+ }
84
+ return undefined;
85
+ });
86
+ const isMultipleInput = computed(() => {
87
+ return Array.isArray(props.inputValue);
88
+ });
89
+ const multipleInputIndex = computed(() => {
90
+ if (!isMultipleInput.value) {
91
+ return -1;
92
+ }
93
+ return props.inputValue.findIndex(v => v === props.value);
94
+ });
95
+ useRender(() => {
96
+ return _createVNode("div", {
97
+ "class": classes
98
+ }, [_createVNode("slot", {
99
+ "name": "prepend"
100
+ }, null), _createVNode("div", {
101
+ "class": "y-checkbox__slot"
102
+ }, [_createVNode(YInputCheckbox, {
103
+ "onClick": function (e) {
104
+ e.stopPropagation();
105
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
106
+ args[_key - 1] = arguments[_key];
107
+ }
108
+ onClick(e, ...args);
109
+ },
110
+ "onFocus": onFocus,
111
+ "onBlur": onBlur,
112
+ "id": 'counterId',
113
+ "value": innerValue.value,
114
+ "icon": computedIcon.value,
115
+ "color": props.color,
116
+ "disabled": props.disabled,
117
+ "readonly": props.readonly
118
+ }, {
119
+ default: () => [slots.icon && {
120
+ icon: function () {
121
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
122
+ args[_key2] = arguments[_key2];
123
+ }
124
+ return slots.icon?.(...args);
125
+ }
126
+ }]
127
+ }), _createVNode("label", {
128
+ "onClick": withModifiers(() => {}, ['stop']),
129
+ "class": "y-checkbox__label",
130
+ "for": inputId
131
+ }, [slots.label ? slots.label?.() : props.label])]), slots.append?.()]);
132
+ });
133
+ return {
134
+ innerValue,
135
+ inputByValue
136
+ };
137
+ },
138
+ created() {
139
+ if (Array.isArray(this.inputValue)) {
140
+ this.inputByValue();
141
+ } else {
142
+ this.innerValue = !!this.inputValue;
143
+ }
144
+ },
145
+ watch: {
146
+ inputValue: {
147
+ handler() {
148
+ this.inputByValue();
149
+ },
150
+ immediate: true
151
+ }
152
+ }
153
+ });
154
+ //# sourceMappingURL=YCheckbox.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YCheckbox.mjs","names":["computed","defineComponent","ref","withModifiers","useRender","getUid","YInputCheckbox","name","components","model","prop","event","emits","props","inputValue","Boolean","Array","value","String","Number","Object","label","reverse","icon","type","color","default","disabled","readonly","setup","_ref","emit","slots","focused","innerValue","counterId","toString","inputId","onFocus","e","onBlur","onClick","inputByValue","isArray","found","find","inp","undefined","classes","computedIcon","isMultipleInput","multipleInputIndex","findIndex","v","_createVNode","stopPropagation","_len","arguments","length","args","_key","_len2","_key2","append","created","watch","handler","immediate"],"sources":["../../../src/components/checkbox/YCheckbox.tsx"],"sourcesContent":["import { PropType, computed, defineComponent, ref, withModifiers } from 'vue';\n\nimport { useRender } from '../../composables/component';\nimport { getUid } from '../../util/vue-component';\n\nimport './YCheckbox.scss';\nimport YInputCheckbox from './YInputCheckbox';\n\nexport default defineComponent({\n name: 'YCheckbox',\n components: { YInputCheckbox },\n model: {\n prop: 'inputValue',\n event: 'change',\n },\n emits: ['focus', 'blur', 'change'],\n props: {\n inputValue: [Boolean, Array] as PropType<boolean | any[]>,\n value: [String, Number, Object] as PropType<any>,\n label: String as PropType<string>,\n reverse: Boolean as PropType<boolean>,\n icon: {\n type: [Object, String] as PropType<\n { checked?: string; unchecked?: string } | string\n >,\n },\n color: {\n type: String as PropType<string>,\n default: () => 'primary',\n },\n disabled: Boolean as PropType<boolean>,\n readonly: Boolean as PropType<boolean>,\n },\n setup(props, { emit, slots }) {\n const focused = ref(false);\n const innerValue = ref(false);\n const counterId = (getUid() ?? '').toString();\n const inputId = `input-${counterId}`;\n\n function onFocus(e: FocusEvent) {\n focused.value = true;\n emit('focus', e);\n }\n\n function onBlur(e: FocusEvent) {\n focused.value = false;\n emit('blur', e);\n }\n\n function onClick(e: Event, ...args: any[]) {\n if (props.disabled || props.readonly) return;\n innerValue.value = !innerValue.value;\n emit('change', innerValue.value, e);\n }\n\n function inputByValue() {\n if (Array.isArray(props.inputValue)) {\n const found = props.inputValue?.find((inp: any) => inp === props.value);\n\n if (found !== undefined) {\n innerValue.value = true;\n } else {\n innerValue.value = false;\n }\n } else if (typeof props.inputValue === 'boolean') {\n innerValue.value = props.inputValue;\n }\n }\n\n const classes = computed<Record<string, boolean>>(() => {\n const { reverse, disabled, readonly } = props;\n return {\n 'y-checkbox': true,\n 'y-checkbox--reverse': !!reverse,\n 'y-checkbox--focused': focused.value,\n 'y-checkbox--disabled': !!disabled,\n 'y-checkbox--readonly': !!readonly,\n };\n });\n\n const computedIcon = computed<string | undefined>(() => {\n if (typeof props.icon === 'string') {\n return props.icon;\n }\n return undefined;\n });\n\n const isMultipleInput = computed<boolean>(() => {\n return Array.isArray(props.inputValue);\n });\n\n const multipleInputIndex = computed<number>(() => {\n if (!isMultipleInput.value) {\n return -1;\n }\n return (props.inputValue as any[]).findIndex(\n (v: any) => v === props.value,\n );\n });\n\n useRender(() => {\n return (\n <div class={classes}>\n <slot name=\"prepend\"></slot>\n <div class=\"y-checkbox__slot\">\n <YInputCheckbox\n onClick={(e: Event, ...args: any[]) => {\n e.stopPropagation();\n onClick(e, ...args);\n }}\n onFocus={onFocus}\n onBlur={onBlur}\n id={'counterId'}\n value={innerValue.value}\n icon={computedIcon.value}\n color={props.color}\n disabled={props.disabled}\n readonly={props.readonly}\n >\n {slots.icon && {\n icon: (...args: any[]) => slots.icon?.(...args),\n }}\n </YInputCheckbox>\n <label\n onClick={withModifiers(() => {}, ['stop'])}\n class=\"y-checkbox__label\"\n for={inputId}\n >\n {slots.label ? slots.label?.() : props.label}\n </label>\n </div>\n {slots.append?.()}\n </div>\n );\n });\n\n return {\n innerValue,\n inputByValue,\n };\n },\n created() {\n if (Array.isArray(this.inputValue)) {\n this.inputByValue();\n } else {\n this.innerValue = !!this.inputValue;\n }\n },\n watch: {\n inputValue: {\n handler() {\n this.inputByValue();\n },\n immediate: true,\n },\n },\n});\n"],"mappings":";AAAA,SAAmBA,QAAQ,EAAEC,eAAe,EAAEC,GAAG,EAAEC,aAAa,QAAQ,KAAK;AAAC,SAErEC,SAAS;AAAA,SACTC,MAAM;AAEf;AAA0B,OACnBC,cAAc;AAErB,eAAeL,eAAe,CAAC;EAC7BM,IAAI,EAAE,WAAW;EACjBC,UAAU,EAAE;IAAEF;EAAe,CAAC;EAC9BG,KAAK,EAAE;IACLC,IAAI,EAAE,YAAY;IAClBC,KAAK,EAAE;EACT,CAAC;EACDC,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC;EAClCC,KAAK,EAAE;IACLC,UAAU,EAAE,CAACC,OAAO,EAAEC,KAAK,CAA8B;IACzDC,KAAK,EAAE,CAACC,MAAM,EAAEC,MAAM,EAAEC,MAAM,CAAkB;IAChDC,KAAK,EAAEH,MAA0B;IACjCI,OAAO,EAAEP,OAA4B;IACrCQ,IAAI,EAAE;MACJC,IAAI,EAAE,CAACJ,MAAM,EAAEF,MAAM;IAGvB,CAAC;IACDO,KAAK,EAAE;MACLD,IAAI,EAAEN,MAA0B;MAChCQ,OAAO,EAAEA,CAAA,KAAM;IACjB,CAAC;IACDC,QAAQ,EAAEZ,OAA4B;IACtCa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Q;IACF,CAAC;EACH,CAAC;EACDsB,OAAOA,CAAA,EAAG;IACR,IAAIhD,KAAK,CAAC2B,OAAO,CAAC,IAAI,CAAC7B,UAAU,CAAC,EAAE;MAClC,IAAI,CAAC4B,YAAY,CAAC,CAAC;IACrB,CAAC,MAAM;MACL,IAAI,CAACR,UAAU,GAAG,CAAC,CAAC,IAAI,CAACpB,UAAU;IACrC;EACF,CAAC;EACDmD,KAAK,EAAE;IACLnD,UAAU,EAAE;MACVoD,OAAOA,CAAA,EAAG;QACR,IAAI,CAACxB,YAAY,CAAC,CAAC;MACrB,CAAC;MACDyB,SAAS,EAAE;IACb;EACF;AACF,CAAC,CAAC"}
@@ -0,0 +1,113 @@
1
+ import { createVNode as _createVNode, Fragment as _Fragment } from "vue";
2
+ import { defineComponent, h } from 'vue';
3
+ import { YIconCheckbox } from "../icons/YIconCheckbox.mjs";
4
+ import "./YInputCheckbox.scss";
5
+ export default defineComponent({
6
+ name: 'YInputCheckbox',
7
+ components: {
8
+ YIconCheckbox
9
+ },
10
+ props: {
11
+ id: String,
12
+ value: Boolean,
13
+ icon: String,
14
+ color: {
15
+ type: String,
16
+ default: () => 'primary'
17
+ },
18
+ disabled: Boolean,
19
+ readonly: Boolean
20
+ },
21
+ emits: ['focus', 'blur', 'click'],
22
+ data() {
23
+ return {
24
+ counterId: this.$.uid.toString(),
25
+ checked: false,
26
+ focused: false
27
+ };
28
+ },
29
+ computed: {
30
+ coloredClass() {
31
+ if (this.color.startsWith('#')) {
32
+ return undefined;
33
+ }
34
+ return `color--${this.color}`;
35
+ },
36
+ classes() {
37
+ const ret = {
38
+ 'y-input': true,
39
+ 'y-input--checkbox': true,
40
+ 'y-input--active': this.checked,
41
+ 'y-input--focused': this.focused
42
+ };
43
+ if (this.coloredClass) {
44
+ ret[this.coloredClass] = true;
45
+ }
46
+ return ret;
47
+ },
48
+ inputId() {
49
+ let id = this.counterId;
50
+ if (this.id) {
51
+ id = this.id;
52
+ }
53
+ return `input-${id}`;
54
+ },
55
+ iconComponent() {
56
+ if (!this.icon) {
57
+ return YIconCheckbox;
58
+ }
59
+ return null;
60
+ }
61
+ },
62
+ methods: {
63
+ onFocus(e) {
64
+ this.focused = true;
65
+ this.$emit('focus', e);
66
+ },
67
+ onBlur(e) {
68
+ this.focused = false;
69
+ this.$emit('blur', e);
70
+ },
71
+ onClick(event) {
72
+ this.$emit('click', event);
73
+ }
74
+ },
75
+ watch: {
76
+ value(neo) {
77
+ this.checked = neo;
78
+ }
79
+ },
80
+ created() {
81
+ this.checked = !!this.value;
82
+ },
83
+ render() {
84
+ const {
85
+ onClick,
86
+ classes,
87
+ inputId,
88
+ checked,
89
+ onFocus,
90
+ onBlur,
91
+ disabled,
92
+ readonly,
93
+ iconComponent
94
+ } = this;
95
+ return _createVNode(_Fragment, null, [_createVNode("div", {
96
+ "onClick": onClick,
97
+ "class": classes
98
+ }, [_createVNode("input", {
99
+ "id": inputId,
100
+ "aria-checked": checked,
101
+ "role": "checkbox",
102
+ "type": "checkbox",
103
+ "checked": checked,
104
+ "onFocus": onFocus,
105
+ "onBlur": onBlur,
106
+ "disabled": disabled,
107
+ "readonly": readonly
108
+ }, null), this.$slots.icon ? this.$slots.icon({
109
+ checked
110
+ }) : iconComponent ? h(iconComponent) : _createVNode(YIconCheckbox, null, null)])]);
111
+ }
112
+ });
113
+ //# sourceMappingURL=YInputCheckbox.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YInputCheckbox.mjs","names":["defineComponent","h","YIconCheckbox","name","components","props","id","String","value","Boolean","icon","color","type","default","disabled","readonly","emits","data","counterId","$","uid","toString","checked","focused","computed","coloredClass","startsWith","undefined","classes","ret","inputId","iconComponent","methods","onFocus","e","$emit","onBlur","onClick","event","watch","neo","created","render","_createVNode","_Fragment","$slots"],"sources":["../../../src/components/checkbox/YInputCheckbox.tsx"],"sourcesContent":["import { PropType, defineComponent, h } from 'vue';\n\nimport { YIconCheckbox } from '../icons/YIconCheckbox';\n\nimport './YInputCheckbox.scss';\n\nexport default defineComponent({\n name: 'YInputCheckbox',\n components: { YIconCheckbox },\n props: {\n id: String as PropType<string>,\n value: Boolean as PropType<boolean>,\n icon: String as PropType<string>,\n color: {\n type: String as PropType<string>,\n default: () => 'primary',\n },\n disabled: Boolean as PropType<boolean>,\n readonly: Boolean as PropType<boolean>,\n },\n emits: ['focus', 'blur', 'click'],\n data() {\n return {\n counterId: this.$.uid.toString(),\n checked: false,\n focused: false,\n };\n },\n computed: {\n coloredClass() {\n if (this.color.startsWith('#')) {\n return undefined;\n }\n return `color--${this.color}`;\n },\n classes() {\n const ret: Record<string, boolean> = {\n 'y-input': true,\n 'y-input--checkbox': true,\n 'y-input--active': this.checked,\n 'y-input--focused': this.focused,\n };\n if (this.coloredClass) {\n ret[this.coloredClass] = true;\n }\n return ret;\n },\n inputId() {\n let id = this.counterId;\n if (this.id) {\n id = this.id;\n }\n return `input-${id}`;\n },\n iconComponent() {\n if (!this.icon) {\n return YIconCheckbox;\n }\n return null;\n },\n },\n methods: {\n onFocus(e: FocusEvent) {\n this.focused = true;\n this.$emit('focus', e);\n },\n onBlur(e: FocusEvent) {\n this.focused = false;\n this.$emit('blur', e);\n },\n onClick(event: MouseEvent) {\n this.$emit('click', event);\n },\n },\n watch: {\n value(neo: boolean) {\n this.checked = neo;\n },\n },\n created() {\n this.checked = !!this.value;\n },\n render() {\n const {\n onClick,\n classes,\n inputId,\n checked,\n onFocus,\n onBlur,\n disabled,\n readonly,\n iconComponent,\n } = this;\n return (\n <>\n <div onClick={onClick} class={classes}>\n <input\n id={inputId}\n aria-checked={checked}\n role=\"checkbox\"\n type=\"checkbox\"\n checked={checked}\n onFocus={onFocus}\n onBlur={onBlur}\n disabled={disabled}\n readonly={readonly}\n />\n {this.$slots.icon ? (\n this.$slots.icon({ checked })\n ) : iconComponent ? h(iconComponent) :\n <YIconCheckbox></YIconCheckbox>}\n </div>\n </>\n );\n },\n});\n"],"mappings":";AAAA,SAAmBA,eAAe,EAAEC,CAAC,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A,YACRC;IAAQ,UAEnB,IAAI,CAAC8B,MAAM,CAACnC,IAAI,GACf,IAAI,CAACmC,MAAM,CAACnC,IAAI,CAAC;MAAEY;IAAQ,CAAC,CAAC,GAC3BS,aAAa,GAAG9B,CAAC,CAAC8B,aAAa,CAAC,GAAAY,YAAA,CAAAzC,aAAA,aACH;EAIzC;AACF,CAAC,CAAC"}
@@ -4,7 +4,7 @@ $checkbox__color: palette.$primary;
4
4
  $checkbox__border-color: #a4a4a4;
5
5
 
6
6
  .y-input--checkbox {
7
- --y-checkbox__color: var(--y-palette--primary);
7
+ --y-checkbox__color: var(--y-theme--primary);
8
8
 
9
9
  position: relative;
10
10
  width: 24px;
@@ -22,7 +22,7 @@ $checkbox__border-color: #a4a4a4;
22
22
  user-select: none;
23
23
  }
24
24
 
25
- .icon-checkbox__checkmark-path {
25
+ .y-icon-checkbox__checkmark-path {
26
26
  fill: none;
27
27
  stroke: #ffffff;
28
28
  stroke-width: 2px;
@@ -31,54 +31,54 @@ $checkbox__border-color: #a4a4a4;
31
31
  transition: stroke-dashoffset 120ms cubic-bezier(0.4, 0, 0.6, 1);
32
32
  }
33
33
 
34
- .icon-checkbox__border-path {
35
- fill: rgba($checkbox__color, 0);
34
+ .y-icon-checkbox__border-path {
35
+ fill: rgba(var(--y-checkbox__color), 0);
36
36
  stroke: rgba($checkbox__border-color, 0.8);
37
37
  stroke-width: 2;
38
38
  transition: fill 200ms 180ms ease-in;
39
39
  }
40
40
 
41
- input:checked ~ .icon-checkbox,
42
- &.y-input--active .icon-checkbox {
43
- .icon-checkbox__checkmark-path {
41
+ input:checked ~ .y-icon-checkbox,
42
+ &.y-input--active .y-icon-checkbox {
43
+ .y-icon-checkbox__checkmark-path {
44
44
  stroke-dashoffset: 0;
45
45
  transition: stroke-dashoffset 120ms 140ms cubic-bezier(0.4, 0, 0.6, 1);
46
46
  }
47
47
 
48
- .icon-checkbox__border-path {
49
- fill: $checkbox__color;
50
- stroke: rgba($checkbox__color, 0.8);
48
+ .y-icon-checkbox__border-path {
49
+ fill: rgb(var(--y-checkbox__color));
50
+ stroke: rgba(var(--y-checkbox__color), 0.8);
51
51
  transition: fill 200ms ease-in;
52
52
  }
53
53
  }
54
54
 
55
- input:focus ~ .icon-checkbox {
56
- .icon-checkbox__border-path {
57
- outline: rgba($checkbox__color, 0.5) solid 4px;
55
+ input:focus ~ .y-icon-checkbox {
56
+ .y-icon-checkbox__border-path {
57
+ outline: rgba(var(--y-checkbox__color), 0.5) solid 4px;
58
58
  outline-offset: -6px;
59
59
  }
60
60
  }
61
61
 
62
62
  &:hover {
63
- .icon-checkbox__border-path {
64
- stroke: rgba($checkbox__color, 0.5);
63
+ .y-icon-checkbox__border-path {
64
+ stroke: rgba(var(--y-checkbox__color), 0.5);
65
65
  }
66
66
  }
67
67
 
68
68
  &.y-input--active:hover {
69
- .icon-checkbox__border-path {
69
+ .y-icon-checkbox__border-path {
70
70
  fill: lighten($checkbox__color, 10);
71
71
  }
72
72
  }
73
73
 
74
- &.y-input--indeterminate .icon-checkbox {
75
- .icon-checkbox__checkmark-path {
74
+ &.y-input--indeterminate .y-icon-checkbox {
75
+ .y-icon-checkbox__checkmark-path {
76
76
  stroke-dashoffset: 0;
77
77
  d: path('M5.73,11.91 11.1,11.91 17.79,11.91');
78
78
  transition: stroke-dashoffset 400ms ease;
79
79
  }
80
80
 
81
- .icon-checkbox__border-path {
81
+ .y-icon-checkbox__border-path {
82
82
  fill: rgba($checkbox__border-color, 0.8);
83
83
  stroke: rgba($checkbox__border-color, 0.8);
84
84
  }
@@ -0,0 +1,5 @@
1
+ import YCheckbox from "./YCheckbox.mjs";
2
+ import YInputCheckbox from "./YInputCheckbox.mjs";
3
+ export { YCheckbox };
4
+ export { YInputCheckbox };
5
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["YCheckbox","YInputCheckbox"],"sources":["../../../src/components/checkbox/index.ts"],"sourcesContent":["import YCheckbox from './YCheckbox';\nimport YInputCheckbox from './YInputCheckbox';\n\nexport { YCheckbox };\nexport { YInputCheckbox };\n"],"mappings":"OAAOA,SAAS;AAAA,OACTC,cAAc;AAErB,SAASD,SAAS;AAClB,SAASC,cAAc"}
@@ -1,22 +1,8 @@
1
- <!--
2
- - Created by yeonyu 2022.
3
- -->
4
-
5
- <template>
6
- <span class="y-chip" :class="classes" :style="styles">
7
- <span class="y-chip__content">
8
- <slot></slot>
9
- </span>
10
- </span>
11
- </template>
12
-
13
- <script lang="ts">
1
+ import { createVNode as _createVNode } from "vue";
14
2
  import { defineComponent } from 'vue';
15
- import { hasOwnProperty } from '../../util/common';
16
- import { colorHexToRgb } from '../../util/ui';
17
-
18
- import './y-chip.scss';
19
-
3
+ import { hasOwnProperty } from "../../util/common.mjs";
4
+ import { colorHexToRgb } from "../../util/ui.mjs";
5
+ import "./YChip.scss";
20
6
  export default defineComponent({
21
7
  name: 'y-chip',
22
8
  props: {
@@ -25,8 +11,8 @@ export default defineComponent({
25
11
  small: Boolean,
26
12
  bgOpacity: {
27
13
  type: Number,
28
- default: 0.14,
29
- },
14
+ default: 0.14
15
+ }
30
16
  },
31
17
  computed: {
32
18
  clickable() {
@@ -34,22 +20,23 @@ export default defineComponent({
34
20
  },
35
21
  classes() {
36
22
  return {
37
- 'y-chip--clickable': this.clickable,
23
+ 'y-chip': true,
24
+ 'y-chip--clickable': this.clickable
38
25
  };
39
26
  },
40
27
  backgroundColor() {
41
- const color = (this.background as string) ?? this.color;
28
+ const color = this.background ?? this.color;
42
29
  return this.colorRgb(color);
43
30
  },
44
31
  styles() {
45
32
  return {
46
33
  color: this.color,
47
- background: `rgba(${this.backgroundColor}, ${this.bgOpacity})`,
34
+ background: `rgba(${this.backgroundColor}, ${this.bgOpacity})`
48
35
  };
49
- },
36
+ }
50
37
  },
51
38
  methods: {
52
- colorRgb(color: string): string {
39
+ colorRgb(color) {
53
40
  if (color?.startsWith('#')) {
54
41
  return colorHexToRgb(color)?.join(',') || '';
55
42
  }
@@ -63,7 +50,19 @@ export default defineComponent({
63
50
  }
64
51
  }
65
52
  return '';
66
- },
53
+ }
67
54
  },
55
+ render() {
56
+ const {
57
+ classes,
58
+ styles
59
+ } = this;
60
+ return _createVNode("span", {
61
+ "class": classes,
62
+ "style": styles
63
+ }, [_createVNode("span", {
64
+ "class": "y-chip__content"
65
+ }, [this.$slots.default?.()])]);
66
+ }
68
67
  });
69
- </script>
68
+ //# sourceMappingURL=YChip.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YChip.mjs","names":["defineComponent","hasOwnProperty","colorHexToRgb","name","props","color","String","background","small","Boolean","bgOpacity","type","Number","default","computed","clickable","$attrs","classes","backgroundColor","colorRgb","styles","methods","startsWith","join","RGBA_REGEX","test","value","exec","valueArray","trim","split","splice","render","_createVNode","$slots"],"sources":["../../../src/components/chip/YChip.tsx"],"sourcesContent":["import { defineComponent } from 'vue';\n\nimport { hasOwnProperty } from '../../util/common';\nimport { colorHexToRgb } from '../../util/ui';\n\nimport './YChip.scss';\n\nexport default defineComponent({\n name: 'y-chip',\n props: {\n color: String,\n background: String,\n small: Boolean,\n bgOpacity: {\n type: Number,\n default: 0.14,\n },\n },\n computed: {\n clickable() {\n return hasOwnProperty(this.$attrs, 'onClick');\n },\n classes() {\n return {\n 'y-chip': true,\n 'y-chip--clickable': this.clickable,\n };\n },\n backgroundColor() {\n const color = (this.background as string) ?? this.color;\n return this.colorRgb(color);\n },\n styles() {\n return {\n color: this.color,\n background: `rgba(${this.backgroundColor}, ${this.bgOpacity})`,\n };\n },\n },\n methods: {\n colorRgb(color: string): string {\n if (color?.startsWith('#')) {\n return colorHexToRgb(color)?.join(',') || '';\n }\n const RGBA_REGEX = /rgb(a?)\\((?<v>.*)\\)/;\n if (RGBA_REGEX.test(color)) {\n const value = RGBA_REGEX.exec(color)?.[2] || '';\n if (value) {\n const valueArray = value.trim().split(',');\n valueArray.splice(3, 1);\n return valueArray.join(',');\n }\n }\n return '';\n },\n },\n render() {\n const { classes, styles } = this;\n return (\n <span class={classes} style={styles}>\n <span class=\"y-chip__content\">\n {this.$slots.default?.()}\n </span>\n </span>\n );\n },\n});\n"],"mappings":";AAAA,SAASA,eAAe,QAAQ,KAAK;AAAC,SAE7BC,cAAc;AAAA,SACdC,aAAa;AAEtB;AAEA,eAAeF,eAAe,CAAC;EAC7BG,IAAI,EAAE,QAAQ;EACdC,KAAK,EAAE;IACLC,KAAK,EAAEC,MAAM;IACbC,UAAU,EAAED,MAAM;IAClBE,KAAK,EAAEC,OAAO;IACdC,SAAS,EAAE;MACTC,IAAI,EAAEC,MAAM;MACZC,OAAO,EAAE;IACX;EACF,CAAC;EACDC,QAAQ,EAAE;IACRC,SAASA,CAAA,EAAG;MACV,OAAOd,cAAc,CAAC,IAAI,CAACe,MAAM,EAAE,SAAS,CAAC;IAC/C,CAAC;IACDC,OAAOA,CAAA,EAAG;MACR,OAAO;QACL,QAAQ,EAAE,IAAI;QACd,mBAAmB,EAAE,IAAI,CAACF;MAC5B,CAAC;IACH,CAAC;IACDG,eAAeA,CAAA,EAAG;MAChB,MAAMb,KAAK,GAAI,IAAI,CAACE,UAAU,IAAe,IAAI,CAACF,KAAK;MACvD,OAAO,IAAI,CAACc,QAAQ,CAACd,KAAK,CAAC;IAC7B,CAAC;IACDe,MAAMA,CAAA,EAAG;MACP,OAAO;QACLf,KAAK,EAAE,IAAI,CAACA,KAAK;QACjBE,UAAU,EAAG,QAAO,IAAI,CAACW,eAAgB,KAAI,IAAI,CAACR,SAAU;MAC9D,CAAC;IACH;EACF,CAAC;EACDW,OAAO,EAAE;IACPF,QAAQA,CAACd,KAAa,EAAU;MAC9B,IAAIA,KAAK,EAAEiB,UAAU,CAAC,GAAG,CAAC,EAAE;QAC1B,OAAOpB,aAAa,CAACG,KAAK,CAAC,EAAEkB,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE;MAC9C;MACA,MAAMC,UAAU,GAAG,qBAAqB;MACxC,IAAIA,UAAU,CAACC,IAAI,CAACpB,KAAK,CAAC,EAAE;QAC1B,MAAMqB,KAAK,GAAGF,UAAU,CAACG,IAAI,CAACtB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE;QAC/C,IAAIqB,KAAK,EAAE;UACT,MAAME,UAAU,GAAGF,KAAK,CAACG,IAAI,CAAC,CAAC,CAACC,KAAK,CAAC,GAAG,CAAC;UAC1CF,UAAU,CAACG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;UACvB,OAAOH,UAAU,CAACL,IAAI,CAAC,GAAG,CAAC;QAC7B;MACF;MACA,OAAO,EAAE;IACX;EACF,CAAC;EACDS,MAAMA,CAAA,EAAG;IACP,MAAM;MAAEf,OAAO;MAAEG;IAAO,CAAC,GAAG,IAAI;IAChC,OAAAa,YAAA;MAAA,SACehB,OAAO;MAAA,SAASG;IAAM,IAAAa,YAAA;MAAA,SACrB;IAAiB,IAC1B,IAAI,CAACC,MAAM,CAACrB,OAAO,GAAG,CAAC;EAIhC;AACF,CAAC,CAAC"}
@@ -1,7 +1,3 @@
1
- /*!
2
- * Created by yeonyu 2022.
3
- */
4
-
5
1
  @use '../../styles/variables';
6
2
 
7
3
  $chip-border-radius: variables.$border-radius-root;
@@ -0,0 +1,3 @@
1
+ import YChip from "./YChip.mjs";
2
+ export { YChip };
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["YChip"],"sources":["../../../src/components/chip/index.ts"],"sourcesContent":["import YChip from './YChip';\n\nexport { YChip };\n"],"mappings":"OAAOA,KAAK;AAEZ,SAASA,KAAK"}
@@ -0,0 +1,97 @@
1
+ import { createVNode as _createVNode, Fragment as _Fragment } from "vue";
2
+ import { computed, defineComponent, ref, watch } from 'vue';
3
+ import { useRender } from "../../composables/component.mjs";
4
+ import { bindClasses } from "../../util/vue-component.mjs";
5
+ import { YCard } from "../card/index.mjs";
6
+ import { YLayer } from "../layer/index.mjs";
7
+ import "./YDialog.scss";
8
+ export const YDialog = defineComponent({
9
+ name: 'YDialog',
10
+ components: {
11
+ YLayer,
12
+ YCard
13
+ },
14
+ props: {
15
+ modelValue: {
16
+ type: Boolean
17
+ },
18
+ dialogClasses: {
19
+ type: [Array, String, Object]
20
+ }
21
+ },
22
+ emits: ['update:modelValue'],
23
+ setup(props, _ref) {
24
+ let {
25
+ emit,
26
+ slots
27
+ } = _ref;
28
+ const active = computed({
29
+ get: () => {
30
+ return !!props.modelValue;
31
+ },
32
+ set: v => {
33
+ emit('update:modelValue', v);
34
+ }
35
+ });
36
+ const classes = computed(() => {
37
+ const boundClasses = bindClasses(props.dialogClasses);
38
+ return {
39
+ ...boundClasses,
40
+ 'y-dialog': true
41
+ };
42
+ });
43
+ const layer = ref();
44
+ function onFocusin(e) {
45
+ const prevTarget = e.relatedTarget;
46
+ const target = e.target;
47
+ if (prevTarget !== target && layer.value?.content$ && ![document, layer.value?.content$].includes(target) && !layer.value?.content$.contains(target)) {
48
+ const focusableSelector = 'button, [href], input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])';
49
+ const focusables = [...layer.value.content$.querySelectorAll(focusableSelector)].filter(el => !el.hasAttribute('disabled') && !el.matches('[tabindex="-1"]'));
50
+ if (!focusables.length) return;
51
+ const firstChild = focusables[0];
52
+ const lastChild = focusables[focusables.length - 1];
53
+ if (firstChild === lastChild) {
54
+ lastChild.focus();
55
+ } else {
56
+ firstChild.focus();
57
+ }
58
+ }
59
+ }
60
+ function installFocusTrap() {
61
+ document.addEventListener('focusin', onFocusin);
62
+ }
63
+ function dismantleFocusTrap() {
64
+ document.removeEventListener('focusin', onFocusin);
65
+ }
66
+ function onUpdate(v) {
67
+ active.value = v;
68
+ }
69
+ watch(() => active.value, neo => {
70
+ neo ? installFocusTrap() : dismantleFocusTrap();
71
+ }, {
72
+ immediate: true
73
+ });
74
+ useRender(() => {
75
+ return _createVNode(_Fragment, null, [slots.base?.(), _createVNode(YLayer, {
76
+ "model-value": active.value,
77
+ "onUpdate:modelValue": onUpdate,
78
+ "scrim": true,
79
+ "classes": classes.value,
80
+ "ref": layer
81
+ }, {
82
+ default: function () {
83
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
84
+ args[_key] = arguments[_key];
85
+ }
86
+ return slots.default?.(...args);
87
+ }
88
+ })]);
89
+ });
90
+ return {
91
+ active,
92
+ layer,
93
+ classes
94
+ };
95
+ }
96
+ });
97
+ //# sourceMappingURL=YDialog.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YDialog.mjs","names":["computed","defineComponent","ref","watch","useRender","bindClasses","YCard","YLayer","YDialog","name","components","props","modelValue","type","Boolean","dialogClasses","Array","String","Object","emits","setup","_ref","emit","slots","active","get","set","v","classes","boundClasses","layer","onFocusin","e","prevTarget","relatedTarget","target","value","content$","document","includes","contains","focusableSelector","focusables","querySelectorAll","filter","el","hasAttribute","matches","length","firstChild","lastChild","focus","installFocusTrap","addEventListener","dismantleFocusTrap","removeEventListener","onUpdate","neo","immediate","_createVNode","_Fragment","base","default","_len","arguments","args","_key"],"sources":["../../../src/components/dialog/YDialog.tsx"],"sourcesContent":["import { PropType, computed, defineComponent, provide, ref, watch } from 'vue';\n\nimport { useRender } from '../../composables/component';\nimport { bindClasses } from '../../util/vue-component';\nimport { YCard } from '../card';\nimport { YLayer } from '../layer';\n\nimport './YDialog.scss';\n\nexport const YDialog = defineComponent({\n name: 'YDialog',\n components: {\n YLayer,\n YCard,\n },\n props: {\n modelValue: {\n type: Boolean as PropType<boolean>,\n },\n dialogClasses: {\n type: [Array, String, Object] as PropType<\n string[] | string | Record<string, any>\n >,\n },\n },\n emits: ['update:modelValue'],\n setup(props, { emit, slots }) {\n const active = computed({\n get: (): boolean => {\n return !!props.modelValue;\n },\n set: (v: boolean) => {\n emit('update:modelValue', v);\n },\n });\n\n const classes = computed(() => {\n const boundClasses = bindClasses(props.dialogClasses);\n return {\n ...boundClasses,\n 'y-dialog': true,\n };\n });\n\n const layer = ref<typeof YLayer>();\n\n function onFocusin(e: FocusEvent) {\n const prevTarget = e.relatedTarget as HTMLElement | null;\n const target = e.target as HTMLElement | null;\n if (\n prevTarget !== target &&\n layer.value?.content$ &&\n ![document, layer.value?.content$].includes(target) &&\n !layer.value?.content$.contains(target)\n ) {\n const focusableSelector =\n 'button, [href], input:not([type=\"hidden\"]), select, textarea, [tabindex]:not([tabindex=\"-1\"])';\n const focusables = [\n ...layer.value.content$.querySelectorAll(focusableSelector),\n ].filter(\n (el) =>\n !el.hasAttribute('disabled') && !el.matches('[tabindex=\"-1\"]'),\n ) as HTMLElement[];\n if (!focusables.length) return;\n const firstChild = focusables[0];\n const lastChild = focusables[focusables.length - 1];\n if (firstChild === lastChild) {\n lastChild.focus();\n } else {\n firstChild.focus();\n }\n }\n }\n\n function installFocusTrap() {\n document.addEventListener('focusin', onFocusin);\n }\n\n function dismantleFocusTrap() {\n document.removeEventListener('focusin', onFocusin);\n }\n\n function onUpdate(v: boolean) {\n active.value = v;\n }\n\n watch(\n () => active.value,\n (neo) => {\n neo ? installFocusTrap() : dismantleFocusTrap();\n },\n { immediate: true },\n );\n\n useRender(() => {\n return (\n <>\n {slots.base?.()}\n <YLayer\n model-value={active.value}\n onUpdate:modelValue={onUpdate}\n scrim\n classes={classes.value}\n ref={layer}\n >\n {{\n default: (...args: any[]) => slots.default?.(...args),\n }}\n </YLayer>\n </>\n );\n });\n\n return {\n active,\n layer,\n classes,\n };\n },\n});\n"],"mappings":";AAAA,SAAmBA,QAAQ,EAAEC,eAAe,EAAWC,GAAG,EAAEC,KAAK,QAAQ,KAAK;AAAC,SAEtEC,SAAS;AAAA,SACTC,WAAW;AAAA,SACXC,KAAK;AAAA,SACLC,MAAM;AAEf;AAEA,OAAO,MAAMC,OAAO,GAAGP,eAAe,CAAC;EACrCQ,IAAI,EAAE,SAAS;EACfC,UAAU,EAAE;IACVH,MAAM;IACND;EACF,CAAC;EACDK,KAAK,EAAE;IACLC,UAAU,EAAE;MACVC,IAAI,EAAEC;IACR,CAAC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