@firstnoodle-ui/bui 0.0.27 → 0.0.28

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 (334) hide show
  1. package/LICENSE +21 -21
  2. package/dist/bui.css +1 -1
  3. package/dist/components/calendar-view/CalendarView.vue.d.ts +21 -0
  4. package/dist/components/calendar-view/components/DateButton.vue.d.ts +10 -0
  5. package/dist/components/calendar-view/components/DecadeView.vue.d.ts +12 -0
  6. package/dist/components/calendar-view/components/MonthView.vue.d.ts +17 -0
  7. package/dist/components/calendar-view/components/YearView.vue.d.ts +13 -0
  8. package/dist/components/calendar-view/composables/useCalendar.d.ts +44 -0
  9. package/dist/components/calendar-view/index.d.ts +1 -0
  10. package/dist/components/calendar-view/utils/enums.d.ts +29 -0
  11. package/dist/components/calendar-view/utils/index.d.ts +23 -0
  12. package/dist/components/calendar-view/utils/types.d.ts +12 -0
  13. package/dist/components/calendar-view/utils/utils/calendar.d.ts +22 -0
  14. package/dist/components/calendar-view/utils/utils/date.d.ts +15 -0
  15. package/dist/components/calendar-view/utils/utils/format.d.ts +18 -0
  16. package/dist/components/calendar-view/utils/utils/time.d.ts +35 -0
  17. package/dist/components/index.d.ts +2 -0
  18. package/dist/components/notification-badge/NotificationBadge.vue.d.ts +5 -0
  19. package/dist/components/notification-badge/index.d.ts +1 -0
  20. package/dist/components/select-list/components/option-group/OptionGroup.vue.d.ts +1 -0
  21. package/dist/components/select-list/components/select-list-option/SelectListOption.vue.d.ts +1 -0
  22. package/dist/components/select-list/types.d.ts +1 -0
  23. package/dist/components/types.d.ts +1 -1
  24. package/dist/index.mjs +7056 -6465
  25. package/dist/utils/capitalizeFirstLetter.d.ts +1 -0
  26. package/package.json +4 -3
  27. package/src/components/application-wrapper/ApplicationWrapper.vue +8 -0
  28. package/src/components/application-wrapper/index.ts +1 -0
  29. package/src/components/aside-section-label/AsideSectionLabel.vue +16 -0
  30. package/src/components/aside-section-label/index.ts +1 -0
  31. package/src/components/button/Button.vue +246 -0
  32. package/src/components/button/NotificationBadge.vue +15 -0
  33. package/src/components/button/components/button-label/ButtonLabel.vue +9 -0
  34. package/src/components/button/components/button-label/index.ts +1 -0
  35. package/src/components/button/components/index.ts +3 -0
  36. package/src/components/button/components/left-group/LeftGroup.vue +5 -0
  37. package/src/components/button/components/left-group/index.ts +1 -0
  38. package/src/components/button/components/notification-badge/NotificationBadge.vue +17 -0
  39. package/src/components/button/components/notification-badge/index.ts +1 -0
  40. package/src/components/button/index.ts +1 -0
  41. package/src/components/button-group/ButtonGroup.vue +97 -0
  42. package/src/components/button-group/index.ts +1 -0
  43. package/src/components/calendar-view/CalendarView.vue +106 -0
  44. package/src/components/calendar-view/components/DateButton.vue +23 -0
  45. package/src/components/calendar-view/components/DecadeView.vue +50 -0
  46. package/src/components/calendar-view/components/MonthView.vue +72 -0
  47. package/src/components/calendar-view/components/NavButton.vue +16 -0
  48. package/src/components/calendar-view/components/YearView.vue +52 -0
  49. package/src/components/calendar-view/composables/useCalendar.ts +138 -0
  50. package/src/components/calendar-view/index.ts +1 -0
  51. package/src/components/calendar-view/utils/enums.ts +31 -0
  52. package/src/components/calendar-view/utils/index.ts +240 -0
  53. package/src/components/calendar-view/utils/types.ts +13 -0
  54. package/src/components/calendar-view/utils/utils/calendar.ts +70 -0
  55. package/src/components/calendar-view/utils/utils/date.ts +130 -0
  56. package/src/components/calendar-view/utils/utils/format.ts +61 -0
  57. package/src/components/calendar-view/utils/utils/time.ts +70 -0
  58. package/src/components/checkbox/Checkbox.vue +51 -0
  59. package/src/components/checkbox/CircleIndicator.vue +26 -0
  60. package/src/components/checkbox/DefaultIndicator.vue +19 -0
  61. package/src/components/checkbox/index.ts +1 -0
  62. package/src/components/collapse/Collapse.vue +114 -0
  63. package/src/components/collapse/index.ts +1 -0
  64. package/src/components/confirm-cancel/ConfirmCancel.vue +66 -0
  65. package/src/components/confirm-cancel/index.ts +1 -0
  66. package/src/components/confirm-cancel/types.ts +18 -0
  67. package/src/components/content-slider/ContentSlider.vue +79 -0
  68. package/src/components/content-slider/index.ts +1 -0
  69. package/src/components/data-point/DataPoint.vue +5 -0
  70. package/src/components/data-point/index.ts +1 -0
  71. package/src/components/delete-button/DeleteButton.vue +19 -0
  72. package/src/components/delete-button/index.ts +1 -0
  73. package/src/components/dialog/Dialog.vue +70 -0
  74. package/src/components/dialog/index.ts +1 -0
  75. package/src/components/fade-in-up/FadeInUp.vue +17 -0
  76. package/src/components/fade-in-up/index.ts +1 -0
  77. package/src/components/filter-chip/FilterChip.vue +28 -0
  78. package/src/components/filter-chip/index.ts +1 -0
  79. package/src/components/first-paint/FirstPaint.vue +21 -0
  80. package/src/components/first-paint/index.ts +1 -0
  81. package/src/components/first-paint/style.scss +23 -0
  82. package/src/components/flexbox/Flexbox.vue +51 -0
  83. package/src/components/flexbox/index.ts +1 -0
  84. package/src/components/horizontal-layout/Aside.vue +114 -0
  85. package/src/components/horizontal-layout/HorizontalLayout.vue +118 -0
  86. package/src/components/horizontal-layout/index.ts +2 -0
  87. package/src/components/icon/Icon.vue +1263 -0
  88. package/src/components/icon/index.ts +1 -0
  89. package/src/components/icon/utils/combine-svgs.cjs +55 -0
  90. package/src/components/icon/utils/combined-svgs.txt +1150 -0
  91. package/src/components/icon/utils/svgs/admin.svg +16 -0
  92. package/src/components/icon/utils/svgs/arrow-deviate.svg +3 -0
  93. package/src/components/icon/utils/svgs/arrow-down-plus.svg +4 -0
  94. package/src/components/icon/utils/svgs/arrow-down.svg +3 -0
  95. package/src/components/icon/utils/svgs/arrow-from.svg +3 -0
  96. package/src/components/icon/utils/svgs/arrow-left.svg +3 -0
  97. package/src/components/icon/utils/svgs/arrow-move.svg +15 -0
  98. package/src/components/icon/utils/svgs/arrow-right.svg +3 -0
  99. package/src/components/icon/utils/svgs/arrow-sub.svg +3 -0
  100. package/src/components/icon/utils/svgs/arrow-trend.svg +15 -0
  101. package/src/components/icon/utils/svgs/arrow-up-plus.svg +4 -0
  102. package/src/components/icon/utils/svgs/arrow-up.svg +3 -0
  103. package/src/components/icon/utils/svgs/authority.svg +5 -0
  104. package/src/components/icon/utils/svgs/beams.svg +5 -0
  105. package/src/components/icon/utils/svgs/bell.svg +15 -0
  106. package/src/components/icon/utils/svgs/bold.svg +3 -0
  107. package/src/components/icon/utils/svgs/box.svg +5 -0
  108. package/src/components/icon/utils/svgs/building.svg +15 -0
  109. package/src/components/icon/utils/svgs/bullet-list.svg +8 -0
  110. package/src/components/icon/utils/svgs/calendar.svg +21 -0
  111. package/src/components/icon/utils/svgs/camera.svg +5 -0
  112. package/src/components/icon/utils/svgs/categories.svg +3 -0
  113. package/src/components/icon/utils/svgs/check-circled.svg +16 -0
  114. package/src/components/icon/utils/svgs/check-outline.svg +15 -0
  115. package/src/components/icon/utils/svgs/check.svg +3 -0
  116. package/src/components/icon/utils/svgs/chevron-down.svg +3 -0
  117. package/src/components/icon/utils/svgs/chevron-left-double.svg +4 -0
  118. package/src/components/icon/utils/svgs/chevron-left.svg +3 -0
  119. package/src/components/icon/utils/svgs/chevron-right-double.svg +4 -0
  120. package/src/components/icon/utils/svgs/chevron-right.svg +3 -0
  121. package/src/components/icon/utils/svgs/chevron-up.svg +3 -0
  122. package/src/components/icon/utils/svgs/clock.svg +4 -0
  123. package/src/components/icon/utils/svgs/close-outline.svg +3 -0
  124. package/src/components/icon/utils/svgs/close.svg +3 -0
  125. package/src/components/icon/utils/svgs/columns.svg +3 -0
  126. package/src/components/icon/utils/svgs/conclusion.svg +17 -0
  127. package/src/components/icon/utils/svgs/copy.svg +16 -0
  128. package/src/components/icon/utils/svgs/crosshair.svg +15 -0
  129. package/src/components/icon/utils/svgs/dash.svg +3 -0
  130. package/src/components/icon/utils/svgs/dashboard.svg +3 -0
  131. package/src/components/icon/utils/svgs/delete.svg +4 -0
  132. package/src/components/icon/utils/svgs/delta.svg +3 -0
  133. package/src/components/icon/utils/svgs/download.svg +3 -0
  134. package/src/components/icon/utils/svgs/drag.svg +8 -0
  135. package/src/components/icon/utils/svgs/drilldown.svg +8 -0
  136. package/src/components/icon/utils/svgs/edit.svg +16 -0
  137. package/src/components/icon/utils/svgs/envelope.svg +3 -0
  138. package/src/components/icon/utils/svgs/error.svg +3 -0
  139. package/src/components/icon/utils/svgs/export-document.svg +16 -0
  140. package/src/components/icon/utils/svgs/filter.svg +6 -0
  141. package/src/components/icon/utils/svgs/filters.svg +4 -0
  142. package/src/components/icon/utils/svgs/flag.svg +3 -0
  143. package/src/components/icon/utils/svgs/folder.svg +15 -0
  144. package/src/components/icon/utils/svgs/frequency.svg +3 -0
  145. package/src/components/icon/utils/svgs/fullscreen-off.svg +3 -0
  146. package/src/components/icon/utils/svgs/fullscreen-on.svg +3 -0
  147. package/src/components/icon/utils/svgs/graduate.svg +3 -0
  148. package/src/components/icon/utils/svgs/hamburger.svg +5 -0
  149. package/src/components/icon/utils/svgs/handshake.svg +15 -0
  150. package/src/components/icon/utils/svgs/heading-1.svg +4 -0
  151. package/src/components/icon/utils/svgs/heading-2.svg +4 -0
  152. package/src/components/icon/utils/svgs/heading.svg +3 -0
  153. package/src/components/icon/utils/svgs/home.svg +3 -0
  154. package/src/components/icon/utils/svgs/id-card.svg +6 -0
  155. package/src/components/icon/utils/svgs/id.svg +4 -0
  156. package/src/components/icon/utils/svgs/indent-left.svg +7 -0
  157. package/src/components/icon/utils/svgs/indent-right.svg +7 -0
  158. package/src/components/icon/utils/svgs/information.svg +17 -0
  159. package/src/components/icon/utils/svgs/italics.svg +3 -0
  160. package/src/components/icon/utils/svgs/itenary.svg +11 -0
  161. package/src/components/icon/utils/svgs/keyboard.svg +11 -0
  162. package/src/components/icon/utils/svgs/lightning.svg +15 -0
  163. package/src/components/icon/utils/svgs/link.svg +4 -0
  164. package/src/components/icon/utils/svgs/list-collapse.svg +6 -0
  165. package/src/components/icon/utils/svgs/list-expand.svg +6 -0
  166. package/src/components/icon/utils/svgs/location.svg +4 -0
  167. package/src/components/icon/utils/svgs/lock-locked.svg +4 -0
  168. package/src/components/icon/utils/svgs/lock-unlocked.svg +4 -0
  169. package/src/components/icon/utils/svgs/magnifying-glass.svg +15 -0
  170. package/src/components/icon/utils/svgs/map.svg +3 -0
  171. package/src/components/icon/utils/svgs/megaphone.svg +3 -0
  172. package/src/components/icon/utils/svgs/message.svg +15 -0
  173. package/src/components/icon/utils/svgs/microscope.svg +3 -0
  174. package/src/components/icon/utils/svgs/moon.svg +3 -0
  175. package/src/components/icon/utils/svgs/new-document.svg +4 -0
  176. package/src/components/icon/utils/svgs/news.svg +15 -0
  177. package/src/components/icon/utils/svgs/numbered-list.svg +7 -0
  178. package/src/components/icon/utils/svgs/open-link.svg +16 -0
  179. package/src/components/icon/utils/svgs/options.svg +5 -0
  180. package/src/components/icon/utils/svgs/page.svg +7 -0
  181. package/src/components/icon/utils/svgs/paper-plane.svg +15 -0
  182. package/src/components/icon/utils/svgs/paper.svg +3 -0
  183. package/src/components/icon/utils/svgs/pen-and-paper.svg +4 -0
  184. package/src/components/icon/utils/svgs/phase.svg +15 -0
  185. package/src/components/icon/utils/svgs/photo.svg +4 -0
  186. package/src/components/icon/utils/svgs/pie-chart.svg +3 -0
  187. package/src/components/icon/utils/svgs/plus.svg +3 -0
  188. package/src/components/icon/utils/svgs/point-left.svg +3 -0
  189. package/src/components/icon/utils/svgs/point-up.svg +3 -0
  190. package/src/components/icon/utils/svgs/popup.svg +16 -0
  191. package/src/components/icon/utils/svgs/question.svg +17 -0
  192. package/src/components/icon/utils/svgs/radio-tower.svg +3 -0
  193. package/src/components/icon/utils/svgs/recycle.svg +3 -0
  194. package/src/components/icon/utils/svgs/redo.svg +3 -0
  195. package/src/components/icon/utils/svgs/refresh.svg +3 -0
  196. package/src/components/icon/utils/svgs/route.svg +3 -0
  197. package/src/components/icon/utils/svgs/rows.svg +3 -0
  198. package/src/components/icon/utils/svgs/scope.svg +7 -0
  199. package/src/components/icon/utils/svgs/settings.svg +16 -0
  200. package/src/components/icon/utils/svgs/share.svg +11 -0
  201. package/src/components/icon/utils/svgs/sign-in.svg +4 -0
  202. package/src/components/icon/utils/svgs/sign-up.svg +3 -0
  203. package/src/components/icon/utils/svgs/sort-down.svg +20 -0
  204. package/src/components/icon/utils/svgs/sort-up.svg +20 -0
  205. package/src/components/icon/utils/svgs/sort.svg +7 -0
  206. package/src/components/icon/utils/svgs/square-solid.svg +3 -0
  207. package/src/components/icon/utils/svgs/star-solid.svg +15 -0
  208. package/src/components/icon/utils/svgs/star.svg +15 -0
  209. package/src/components/icon/utils/svgs/stop-watch.svg +5 -0
  210. package/src/components/icon/utils/svgs/structure.svg +3 -0
  211. package/src/components/icon/utils/svgs/sun.svg +23 -0
  212. package/src/components/icon/utils/svgs/table.svg +3 -0
  213. package/src/components/icon/utils/svgs/tag.svg +15 -0
  214. package/src/components/icon/utils/svgs/team.svg +15 -0
  215. package/src/components/icon/utils/svgs/telescope.svg +15 -0
  216. package/src/components/icon/utils/svgs/trash.svg +6 -0
  217. package/src/components/icon/utils/svgs/triangle-angle.svg +3 -0
  218. package/src/components/icon/utils/svgs/triangle-side.svg +3 -0
  219. package/src/components/icon/utils/svgs/underline.svg +4 -0
  220. package/src/components/icon/utils/svgs/undo.svg +3 -0
  221. package/src/components/icon/utils/svgs/user.svg +16 -0
  222. package/src/components/icon/utils/svgs/venn.svg +3 -0
  223. package/src/components/icon/utils/svgs/video.svg +3 -0
  224. package/src/components/icon/utils/svgs/visibility-off-alt.svg +19 -0
  225. package/src/components/icon/utils/svgs/visibility-off.svg +3 -0
  226. package/src/components/icon/utils/svgs/visibility-on.svg +16 -0
  227. package/src/components/icon/utils/svgs/warning.svg +5 -0
  228. package/src/components/index.ts +45 -0
  229. package/src/components/input/Input.vue +118 -0
  230. package/src/components/input/index.ts +1 -0
  231. package/src/components/input-number/InputNumber.vue +112 -0
  232. package/src/components/input-number/StepButton.vue +23 -0
  233. package/src/components/input-number/index.ts +1 -0
  234. package/src/components/load-spinner/LoadSpinner.vue +13 -0
  235. package/src/components/load-spinner/index.ts +1 -0
  236. package/src/components/modal/Modal.vue +111 -0
  237. package/src/components/modal/index.ts +1 -0
  238. package/src/components/nav-item/NavItem.vue +62 -0
  239. package/src/components/nav-item/index.ts +1 -0
  240. package/src/components/notification/Notification.vue +53 -0
  241. package/src/components/notification/index.ts +1 -0
  242. package/src/components/notification-badge/NotificationBadge.vue +7 -0
  243. package/src/components/notification-badge/index.ts +1 -0
  244. package/src/components/pagination/Pagination.vue +65 -0
  245. package/src/components/pagination/index.ts +1 -0
  246. package/src/components/pop-confirm/PopConfirm.vue +90 -0
  247. package/src/components/pop-confirm/index.ts +1 -0
  248. package/src/components/pop-select/FooterButton.vue +5 -0
  249. package/src/components/pop-select/PopSelect.vue +346 -0
  250. package/src/components/pop-select/ResultFilters.vue +28 -0
  251. package/src/components/pop-select/enums.ts +7 -0
  252. package/src/components/pop-select/index.ts +2 -0
  253. package/src/components/pop-select/option.vue +51 -0
  254. package/src/components/popper/Popper.vue +239 -0
  255. package/src/components/popper/PopperContent.vue +5 -0
  256. package/src/components/popper/index.ts +2 -0
  257. package/src/components/popper/middleware.ts +19 -0
  258. package/src/components/screen-overlay/ScreenOverlay.vue +53 -0
  259. package/src/components/screen-overlay/index.ts +1 -0
  260. package/src/components/scrollbar/Bar.vue +106 -0
  261. package/src/components/scrollbar/ScrollBottomLoader.vue +25 -0
  262. package/src/components/scrollbar/Scrollbar.vue +219 -0
  263. package/src/components/scrollbar/enums.ts +23 -0
  264. package/src/components/scrollbar/index.ts +3 -0
  265. package/src/components/scrollbar/style.scss +77 -0
  266. package/src/components/scrollbar/types.ts +32 -0
  267. package/src/components/select-list/SelectList.vue +476 -0
  268. package/src/components/select-list/components/SelectListFilterChip.vue +34 -0
  269. package/src/components/select-list/components/index.ts +3 -0
  270. package/src/components/select-list/components/option-group/OptionGroup.vue +20 -0
  271. package/src/components/select-list/components/option-group/index.ts +1 -0
  272. package/src/components/select-list/components/select-list-option/SelectListOption.vue +83 -0
  273. package/src/components/select-list/components/select-list-option/index.ts +1 -0
  274. package/src/components/select-list/components/status-cards/error-card/ErrorCard.vue +17 -0
  275. package/src/components/select-list/components/status-cards/error-card/index.ts +1 -0
  276. package/src/components/select-list/components/status-cards/idle-card/IdleCard.vue +11 -0
  277. package/src/components/select-list/components/status-cards/idle-card/index.ts +1 -0
  278. package/src/components/select-list/components/status-cards/index.ts +4 -0
  279. package/src/components/select-list/components/status-cards/loading-card/LoadingCard.vue +10 -0
  280. package/src/components/select-list/components/status-cards/loading-card/index.ts +1 -0
  281. package/src/components/select-list/components/status-cards/no-match-card/NoMatchCard.vue +15 -0
  282. package/src/components/select-list/components/status-cards/no-match-card/index.ts +1 -0
  283. package/src/components/select-list/components/status-cards/status-card/StatusCard.vue +25 -0
  284. package/src/components/select-list/components/status-cards/status-card/index.ts +1 -0
  285. package/src/components/select-list/index.ts +5 -0
  286. package/src/components/select-list/types.ts +49 -0
  287. package/src/components/side-over/SideOver.vue +87 -0
  288. package/src/components/side-over/index.ts +1 -0
  289. package/src/components/status-select/StatusIndicator.vue +78 -0
  290. package/src/components/status-select/StatusSelect.vue +62 -0
  291. package/src/components/status-select/index.ts +1 -0
  292. package/src/components/switch/Switch.vue +52 -0
  293. package/src/components/switch/index.ts +1 -0
  294. package/src/components/tab/Tab.vue +65 -0
  295. package/src/components/tab/index.ts +1 -0
  296. package/src/components/tag/Tag.vue +34 -0
  297. package/src/components/tag/index.ts +1 -0
  298. package/src/components/text-editor/TextEditor.vue +399 -0
  299. package/src/components/text-editor/components/Dialog.vue +11 -0
  300. package/src/components/text-editor/components/FormattingButton.vue +46 -0
  301. package/src/components/text-editor/components/InsertLinkDialog.vue +81 -0
  302. package/src/components/text-editor/components/InsertTextDialog.vue +36 -0
  303. package/src/components/text-editor/components/index.ts +3 -0
  304. package/src/components/text-editor/index.ts +1 -0
  305. package/src/components/text-highlight/TextHighlight.vue +113 -0
  306. package/src/components/text-highlight/index.ts +1 -0
  307. package/src/components/text-viewer/TextViewer.vue +5 -0
  308. package/src/components/text-viewer/index.ts +1 -0
  309. package/src/components/toggle-button/ToggleButton.vue +105 -0
  310. package/src/components/toggle-button/index.ts +1 -0
  311. package/src/components/tooltip/Tooltip.vue +54 -0
  312. package/src/components/tooltip/index.ts +1 -0
  313. package/src/components/types.ts +232 -0
  314. package/src/components/vertical-layout/RunningSection.vue +54 -0
  315. package/src/components/vertical-layout/VerticalLayout.vue +37 -0
  316. package/src/components/vertical-layout/index.ts +3 -0
  317. package/src/components/vertical-layout/types.ts +2 -0
  318. package/src/components/window-frame/WindowFrame.vue +20 -0
  319. package/src/components/window-frame/index.ts +1 -0
  320. package/src/composables/index.ts +5 -0
  321. package/src/composables/useClickOutside.ts +48 -0
  322. package/src/composables/useEscapeKey.ts +12 -0
  323. package/src/composables/useMounted.ts +7 -0
  324. package/src/composables/useNextFrame.ts +10 -0
  325. package/src/composables/useTrapFocus.ts +61 -0
  326. package/src/index.ts +5 -0
  327. package/src/main.css +140 -0
  328. package/src/utils/array.ts +11 -0
  329. package/src/utils/capitalizeFirstLetter.ts +4 -0
  330. package/src/utils/clamp.ts +9 -0
  331. package/src/utils/debounce.ts +8 -0
  332. package/src/utils/index.ts +5 -0
  333. package/src/utils/scrollIntoView.ts +25 -0
  334. package/src/utils/scrollbarWidth.ts +27 -0
@@ -0,0 +1 @@
1
+ export { default as BDeleteButton } from "./DeleteButton.vue";
@@ -0,0 +1,70 @@
1
+ <script setup lang="ts">
2
+ import type { TOverlayType } from "../types";
3
+ import { onMounted, ref } from "vue";
4
+ import { BButton, BFadeInUp, BScreenOverlay, BVerticalLayout, BWindowFrame } from "../";
5
+ import { useEscapeKey } from "../../composables";
6
+
7
+ const props = withDefaults(
8
+ defineProps<{
9
+ closeable?: boolean;
10
+ overlayType?: TOverlayType;
11
+ target?: string;
12
+ title?: string;
13
+ }>(),
14
+ {
15
+ closeable: true,
16
+ overlayType: "default",
17
+ target: "#modals",
18
+ },
19
+ );
20
+
21
+ const emit = defineEmits(["close"]);
22
+
23
+ const show = ref(false);
24
+ const windowRef = ref<typeof BWindowFrame>();
25
+
26
+ // when component is mounted start the transition
27
+ onMounted(() => (show.value = true));
28
+
29
+ const close = () => (show.value = false);
30
+ const onClose = () => props.closeable && close();
31
+ props.closeable && useEscapeKey(onClose);
32
+
33
+ const onTransitionAfterEnter = () => {
34
+
35
+ };
36
+
37
+ defineExpose({ close });
38
+ </script>
39
+
40
+ <template>
41
+ <Teleport :to="props.target">
42
+ <BScreenOverlay :show="show" :type="overlayType" class="p-2 md:pt-32" @click="onClose" @close="emit('close')">
43
+ <BFadeInUp @transition-after-enter="onTransitionAfterEnter">
44
+ <BWindowFrame v-show="show" ref="windowRef" class="h-64 max-w-2xl md:w-1/2 md:max-w-lg p-4 md:px-8">
45
+ <BVerticalLayout>
46
+ <template #header>
47
+ <header class="flex items-center justify-between w-full h-12">
48
+ <h4 v-if="props.title">
49
+ {{ props.title }}
50
+ </h4>
51
+ <h4 v-else>
52
+ <slot name="title" />
53
+ </h4>
54
+ <BButton v-if="props.closeable" small icon="close" variant="textSubtle" @click="onClose" />
55
+ </header>
56
+ </template>
57
+ <template #main>
58
+ <slot name="main" />
59
+ </template>
60
+ <template #footer>
61
+ <footer class="flex items-center h-12">
62
+ <slot name="footer" />
63
+ </footer>
64
+ </template>
65
+ </BVerticalLayout>
66
+ </BWindowFrame>
67
+ </BFadeInUp>
68
+ </BScreenOverlay>
69
+ </Teleport>
70
+ </template>
@@ -0,0 +1 @@
1
+ export { default as BDialog } from "./Dialog.vue";
@@ -0,0 +1,17 @@
1
+ <script setup lang="ts">
2
+ const emit = defineEmits(["transition-after-enter"]);
3
+ </script>
4
+
5
+ <template>
6
+ <transition
7
+ enter-active-class="transform transition ease-in-out duration-300 delay-100"
8
+ enter-from-class="translate-y-2 opacity-0"
9
+ enter-to-class=""
10
+ leave-active-class="transform transition ease-in-out duration-100"
11
+ leave-class="translate-y-0 opacity-100"
12
+ leave-to-class="translate-y-2 opacity-0"
13
+ @after-enter="emit('transition-after-enter')"
14
+ >
15
+ <slot />
16
+ </transition>
17
+ </template>
@@ -0,0 +1 @@
1
+ export { default as BFadeInUp } from "./FadeInUp.vue";
@@ -0,0 +1,28 @@
1
+ <script setup lang="ts">
2
+ import { BDeleteButton } from "../delete-button";
3
+
4
+ const { count = 0, deletable = false } = defineProps<{
5
+ label: string;
6
+ active: boolean;
7
+ deletable?: boolean;
8
+ count?: number;
9
+ }>();
10
+ defineEmits(["click", "delete"]);
11
+ </script>
12
+
13
+ <template>
14
+ <button
15
+ class="h-6 py-2 rounded-md flex items-center gap-1 cursor-pointer"
16
+ :class="{
17
+ 'px-2 border border-default text-tertiary hover:bg-secondary hover:text-secondary hover:border-strong active:bg-tertiary active:text-primary active:border-strong': !active,
18
+ 'border border-transparent text-white bg-cyan-600 hover:bg-cyan-700 active:bg-cyan-800': active,
19
+ 'pl-2 pr-1': active && deletable,
20
+ 'px-2': active && !deletable,
21
+ }"
22
+ @click="$emit('click')"
23
+ >
24
+ <span class="text-sm">{{ label }}</span>
25
+ <span v-if="active && count" class="h-4 px-1 min-w-4 flex items-center justify-center rounded-full text-xs font-medium bg-black/15 ">{{ count }}</span>
26
+ <BDeleteButton v-if="deletable && active" data-theme="dark" @click="$emit('delete')" />
27
+ </button>
28
+ </template>
@@ -0,0 +1 @@
1
+ export { default as BFilterChip } from "./FilterChip.vue";
@@ -0,0 +1,21 @@
1
+ <script setup lang="ts">
2
+ import { onMounted } from "vue";
3
+ import "./style.scss";
4
+
5
+ const props = defineProps<{ delayIndex: number }>();
6
+
7
+ onMounted(() => {
8
+ if (props.delayIndex < 1 || props.delayIndex > 20) {
9
+ throw new Error("delayIndex has to be between 1 and 20");
10
+ }
11
+ });
12
+ </script>
13
+
14
+ <template>
15
+ <div class="first-paint rounded" :class="`delay-${delayIndex}`">
16
+ <div class="opacity-0">
17
+ <slot v-if="$slots.default" />
18
+ <span v-else>Some random text</span>
19
+ </div>
20
+ </div>
21
+ </template>
@@ -0,0 +1 @@
1
+ export { default as BFirstPaint } from "./FirstPaint.vue";
@@ -0,0 +1,23 @@
1
+ $color1: #eee;
2
+ $color2: #bbb;
3
+
4
+ .first-paint {
5
+ background-color: var(--color-bg-tertiary);
6
+ animation-name: fade;
7
+ animation-duration: 3s;
8
+ animation-iteration-count: infinite;
9
+
10
+ @for $i from 1 through 20 {
11
+ &.delay-#{$i} {
12
+ animation-delay: $i * 0.1s;
13
+ }
14
+ }
15
+ }
16
+
17
+ @keyframes fade {
18
+ 0% { background-color: var(--color-bg-tertiary); }
19
+ 5% { background-color: var(--color-bg-tertiary); }
20
+ 25% { background-color: var(--color-bg-secondary); }
21
+ 45% { background-color: var(--color-bg-tertiary); }
22
+ 100% { background-color: var(--color-bg-tertiary); }
23
+ }
@@ -0,0 +1,51 @@
1
+ <script setup lang="ts">
2
+ import type { TAlignment, TJustification } from "../types";
3
+ import { computed } from "vue";
4
+
5
+ const props = withDefaults(
6
+ defineProps<{
7
+ align?: TAlignment;
8
+ col?: boolean;
9
+ inline?: boolean;
10
+ justify?: TJustification;
11
+ tag?: string;
12
+ }>(),
13
+ {
14
+ align: "center",
15
+ col: false,
16
+ inline: false,
17
+ justify: "start",
18
+ tag: "div",
19
+ },
20
+ );
21
+
22
+ const alignmentClasses: Record<TAlignment, string> = {
23
+ start: "items-start",
24
+ end: "items-end",
25
+ center: "items-center",
26
+ stretch: "items-stretch",
27
+ } as const;
28
+
29
+ const justificationClasses: Record<TJustification, string> = {
30
+ around: "justify-around",
31
+ between: "justify-between",
32
+ center: "justify-center",
33
+ end: "justify-end",
34
+ evenly: "justify-evenly",
35
+ start: "justify-start",
36
+ stretch: "justify-stretch",
37
+ } as const;
38
+
39
+ const classes = computed(() => ([
40
+ props.inline ? "inline-flex" : "flex",
41
+ props.col ? "flex-col items-stretch" : "",
42
+ props.align ? alignmentClasses[props.align] : "",
43
+ props.justify ? justificationClasses[props.justify] : "",
44
+ ]));
45
+ </script>
46
+
47
+ <template>
48
+ <component :is="tag" :class="classes">
49
+ <slot />
50
+ </component>
51
+ </template>
@@ -0,0 +1 @@
1
+ export { default as BFlexbox } from "./Flexbox.vue";
@@ -0,0 +1,114 @@
1
+ <script setup lang="ts">
2
+ import { computed, ref } from "vue";
3
+ import { clamp } from "../../utils";
4
+
5
+ const props = withDefaults(
6
+ defineProps<{
7
+ width?: number;
8
+ border?: boolean;
9
+ draggable?: boolean;
10
+ visible?: boolean;
11
+ side?: "left" | "right";
12
+ maxWidth?: number;
13
+ minWidth?: number;
14
+ }>(),
15
+ {
16
+ border: false,
17
+ draggable: false,
18
+ visible: true,
19
+ side: "left",
20
+ maxWidth: 1000,
21
+ minWidth: 160,
22
+ width: 256,
23
+ },
24
+ );
25
+
26
+ const emit = defineEmits(["resize-start", "resize", "resize-end", "transitioning"]);
27
+
28
+ const aside = ref<HTMLElement>();
29
+ const classes = computed(() => [
30
+ props.side === "left" ? "left-0" : "right-0",
31
+ props.border ? (props.side === "left" ? "border-r border-default" : "border-l border-default") : "",
32
+ ]);
33
+ const enterClass = props.side === "left" ? "-translate-x-full" : "translate-x-full";
34
+ const leaveToClass = props.side === "left" ? "-translate-x-full" : "translate-x-full";
35
+
36
+ let startX: number;
37
+ let startWidth: number;
38
+ const dragging = ref(false);
39
+ const transitioning = ref(false);
40
+
41
+ function startDrag(event: MouseEvent) {
42
+ startX = event.pageX;
43
+ startWidth = props.width;
44
+ dragging.value = true;
45
+ window.addEventListener("mouseup", endDrag);
46
+ window.addEventListener("mousemove", onDrag);
47
+ emit("resize-start");
48
+ }
49
+
50
+ function onDrag(event: MouseEvent) {
51
+ const deltaX = props.side === "left" ? event.pageX - startX : startX - event.pageX;
52
+
53
+ const dragTo = startWidth + deltaX;
54
+ const result = clamp(dragTo, props.minWidth, props.maxWidth);
55
+
56
+ if (result !== props.width) {
57
+ emit("resize", result);
58
+ }
59
+ }
60
+
61
+ function endDrag() {
62
+ dragging.value = false;
63
+ window.removeEventListener("mouseup", endDrag);
64
+ window.removeEventListener("mousemove", onDrag);
65
+ emit("resize-end");
66
+ }
67
+
68
+ function onTransition(transitionActive: boolean, focusAside: boolean) {
69
+ if (focusAside && aside.value) {
70
+ aside.value.focus();
71
+ }
72
+ transitioning.value = transitionActive;
73
+ emit("transitioning", transitioning.value);
74
+ }
75
+ </script>
76
+
77
+ <template>
78
+ <transition
79
+ key="aside"
80
+ enter-active-class="transform"
81
+ :enter-from-class="enterClass"
82
+ enter-to-class=""
83
+ leave-active-class="transform"
84
+ leave-class="translate-x-0"
85
+ :leave-to-class="leaveToClass"
86
+ @before-leave="onTransition(true, false)"
87
+ @after-leave="onTransition(false, false)"
88
+ @before-enter="onTransition(true, false)"
89
+ @after-enter="onTransition(false, true)"
90
+ >
91
+ <aside
92
+ v-show="visible"
93
+ ref="aside"
94
+ tabindex="0"
95
+ :style="{
96
+ width: `${width}px`,
97
+ transitionProperty: dragging ? 'none' : 'transform, width',
98
+ }"
99
+ class="absolute top-0 z-10 h-full overflow-x-hidden duration-500 ease-in-out bg-primary"
100
+ :class="classes"
101
+ >
102
+ <slot />
103
+ <button
104
+ v-if="props.draggable"
105
+ class="absolute top-0 h-full w-1 hover:border-action hover:bg-tertiary cursor-ew-resize"
106
+ :class="[
107
+ props.side === 'left' ? 'right-0 border-r' : 'left-0 border-l',
108
+ dragging ? 'border-action bg-tertiary' : 'border-transparent bg-transparent',
109
+ ]"
110
+ @mousedown="startDrag"
111
+ />
112
+ </aside>
113
+ </transition>
114
+ </template>
@@ -0,0 +1,118 @@
1
+ <script setup lang="ts">
2
+ import { computed, onMounted, ref, useSlots, watch } from "vue";
3
+ import AsideComponent from "./Aside.vue";
4
+
5
+ const props = withDefaults(
6
+ defineProps<{
7
+ asideLeftBgColorClass?: string;
8
+ asideLeftDraggable?: boolean;
9
+ asideLeftVisible?: boolean;
10
+ asideLeftWidth?: number;
11
+ asideRightBgColorClass?: string;
12
+ asideRightDraggable?: boolean;
13
+ asideRightVisible?: boolean;
14
+ asideRightWidth?: number;
15
+ borders?: boolean;
16
+ mainBgColorClass?: string;
17
+ }>(),
18
+ {
19
+ asideLeftBgColorClass: "",
20
+ asideLeftDraggable: false,
21
+ asideLeftVisible: false,
22
+ asideLeftWidth: 256,
23
+ asideRightBgColorClass: "",
24
+ asideRightDraggable: false,
25
+ asideRightVisible: false,
26
+ asideRightWidth: 256,
27
+ borders: false,
28
+ mainBgColorClass: "",
29
+ },
30
+ );
31
+
32
+ const emit = defineEmits(["aside-left-transition-end", "aside-right-transition-end"]);
33
+
34
+ // Resizing is when one of the asides is resized by dragging - then we remove transition classes
35
+ const resizing = ref(false);
36
+
37
+ // we cannot mutate props, so we create a local copy - TODO... should we not just emit the new value
38
+ const localAsideLeftWidth = ref(props.asideLeftWidth);
39
+ const localAsideRightWidth = ref(props.asideRightWidth);
40
+ const paddingLeft = ref(props.asideLeftWidth);
41
+ const paddingRight = ref(props.asideRightWidth);
42
+ const mainStyle = computed(() => ({
43
+ paddingLeft: `${paddingLeft.value}px`,
44
+ paddingRight: `${paddingRight.value}px`,
45
+ }));
46
+ const onAsideLeftResize = (size: number) => (localAsideLeftWidth.value = paddingLeft.value = size);
47
+ const onAsideLeftTransition = (transitioning: boolean) => !transitioning && emit("aside-left-transition-end");
48
+ const onAsideRightResize = (size: number) => (localAsideRightWidth.value = paddingRight.value = size);
49
+ const onAsideRightTransition = (transitioning: boolean) => !transitioning && emit("aside-right-transition-end");
50
+
51
+ // For transitioning the padding on <main>
52
+ watch(
53
+ () => props.asideLeftVisible,
54
+ newValue => (paddingLeft.value = newValue ? localAsideLeftWidth.value : 0),
55
+ );
56
+ watch(
57
+ () => props.asideRightVisible,
58
+ newValue => (paddingRight.value = newValue ? localAsideRightWidth.value : 0),
59
+ );
60
+
61
+ // For triggering transition to a specific width
62
+ watch(
63
+ () => props.asideLeftWidth,
64
+ newValue => (localAsideLeftWidth.value = paddingLeft.value = newValue),
65
+ );
66
+ watch(
67
+ () => props.asideRightWidth,
68
+ newValue => (localAsideRightWidth.value = paddingRight.value = newValue),
69
+ );
70
+
71
+ const slots = useSlots();
72
+
73
+ onMounted(() => {
74
+ paddingLeft.value = props.asideLeftVisible && slots["aside-left"] ? localAsideLeftWidth.value : 0;
75
+ paddingRight.value = props.asideRightVisible && slots["aside-right"] ? localAsideRightWidth.value : 0;
76
+ });
77
+ </script>
78
+
79
+ <template>
80
+ <div class="relative w-full h-full overflow-hidden bg-primary">
81
+ <AsideComponent
82
+ v-if="slots['aside-left']"
83
+ side="left"
84
+ :border="props.borders"
85
+ :draggable="asideLeftDraggable"
86
+ :visible="asideLeftVisible"
87
+ :width="localAsideLeftWidth"
88
+ @resize-start="resizing = true"
89
+ @resize="onAsideLeftResize"
90
+ @resize-end="resizing = false"
91
+ @transitioning="onAsideLeftTransition"
92
+ >
93
+ <slot name="aside-left" />
94
+ </AsideComponent>
95
+ <!-- responsiveness: md and above -->
96
+ <main
97
+ class="relative z-0 h-full overflow-x-hidden overflow-y-auto"
98
+ :class="[props.mainBgColorClass, resizing ? null : 'transition-padding duration-500 ease-in-out']"
99
+ :style="mainStyle"
100
+ >
101
+ <slot name="main" />
102
+ </main>
103
+ <AsideComponent
104
+ v-if="slots['aside-right']"
105
+ side="right"
106
+ :border="props.borders"
107
+ :draggable="asideRightDraggable"
108
+ :visible="asideRightVisible"
109
+ :width="localAsideRightWidth"
110
+ @resize-start="resizing = true"
111
+ @resize="onAsideRightResize"
112
+ @resize-end="resizing = false"
113
+ @transitioning="onAsideRightTransition"
114
+ >
115
+ <slot name="aside-right" />
116
+ </AsideComponent>
117
+ </div>
118
+ </template>
@@ -0,0 +1,2 @@
1
+ export { default as BAside } from "./Aside.vue";
2
+ export { default as BHorizontalLayout } from "./HorizontalLayout.vue";