@firstnoodle-ui/bui 0.0.13 → 0.0.14

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 (272) hide show
  1. package/dist/bui.css +1 -1
  2. package/dist/components/checkbox/Checkbox.vue.d.ts +5 -9
  3. package/dist/components/checkbox/CircleIndicator.vue.d.ts +3 -2
  4. package/dist/components/checkbox/DefaultIndicator.vue.d.ts +3 -2
  5. package/dist/components/collapse/Collapse.vue.d.ts +0 -2
  6. package/dist/components/input/Input.vue.d.ts +3 -1
  7. package/dist/components/pagination/Pagination.vue.d.ts +4 -4
  8. package/dist/components/text-editor/components/InsertLinkDialog.vue.d.ts +5 -2
  9. package/dist/components/text-editor/components/InsertTextDialog.vue.d.ts +5 -2
  10. package/dist/components/types.d.ts +2 -0
  11. package/dist/index.mjs +4391 -4425
  12. package/package.json +8 -3
  13. package/dist/components/scrollbar/scrollbarWidth.d.ts +0 -1
  14. package/src/components/application-wrapper/ApplicationWrapper.vue +0 -8
  15. package/src/components/application-wrapper/index.ts +0 -1
  16. package/src/components/aside-section-label/AsideSectionLabel.vue +0 -16
  17. package/src/components/aside-section-label/index.ts +0 -1
  18. package/src/components/button/Button.vue +0 -245
  19. package/src/components/button/NotificationBadge.vue +0 -15
  20. package/src/components/button/index.ts +0 -1
  21. package/src/components/button-group/ButtonGroup.vue +0 -97
  22. package/src/components/button-group/index.ts +0 -1
  23. package/src/components/checkbox/Checkbox.vue +0 -52
  24. package/src/components/checkbox/CircleIndicator.vue +0 -27
  25. package/src/components/checkbox/DefaultIndicator.vue +0 -22
  26. package/src/components/checkbox/index.ts +0 -1
  27. package/src/components/collapse/Collapse.vue +0 -120
  28. package/src/components/collapse/index.ts +0 -1
  29. package/src/components/confirm-cancel/ConfirmCancel.vue +0 -79
  30. package/src/components/confirm-cancel/index.ts +0 -1
  31. package/src/components/data-point/DataPoint.vue +0 -5
  32. package/src/components/data-point/index.ts +0 -1
  33. package/src/components/dialog/Dialog.vue +0 -70
  34. package/src/components/dialog/index.ts +0 -1
  35. package/src/components/fade-in-up/FadeInUp.vue +0 -17
  36. package/src/components/fade-in-up/index.ts +0 -1
  37. package/src/components/first-paint/FirstPaint.vue +0 -21
  38. package/src/components/first-paint/index.ts +0 -1
  39. package/src/components/first-paint/style.scss +0 -23
  40. package/src/components/flexbox/Flexbox.vue +0 -50
  41. package/src/components/flexbox/index.ts +0 -1
  42. package/src/components/horizontal-layout/Aside.vue +0 -113
  43. package/src/components/horizontal-layout/HorizontalLayout.vue +0 -118
  44. package/src/components/horizontal-layout/index.ts +0 -2
  45. package/src/components/icon/Icon.vue +0 -1159
  46. package/src/components/icon/index.ts +0 -1
  47. package/src/components/icon/utils/combine-svgs.cjs +0 -55
  48. package/src/components/icon/utils/combined-svgs.txt +0 -1150
  49. package/src/components/icon/utils/svgs/admin.svg +0 -16
  50. package/src/components/icon/utils/svgs/arrow-deviate.svg +0 -3
  51. package/src/components/icon/utils/svgs/arrow-down-plus.svg +0 -4
  52. package/src/components/icon/utils/svgs/arrow-down.svg +0 -3
  53. package/src/components/icon/utils/svgs/arrow-from.svg +0 -3
  54. package/src/components/icon/utils/svgs/arrow-left.svg +0 -3
  55. package/src/components/icon/utils/svgs/arrow-move.svg +0 -15
  56. package/src/components/icon/utils/svgs/arrow-right.svg +0 -3
  57. package/src/components/icon/utils/svgs/arrow-sub.svg +0 -3
  58. package/src/components/icon/utils/svgs/arrow-trend.svg +0 -15
  59. package/src/components/icon/utils/svgs/arrow-up-plus.svg +0 -4
  60. package/src/components/icon/utils/svgs/arrow-up.svg +0 -3
  61. package/src/components/icon/utils/svgs/authority.svg +0 -5
  62. package/src/components/icon/utils/svgs/beams.svg +0 -5
  63. package/src/components/icon/utils/svgs/bell.svg +0 -15
  64. package/src/components/icon/utils/svgs/bold.svg +0 -3
  65. package/src/components/icon/utils/svgs/box.svg +0 -5
  66. package/src/components/icon/utils/svgs/building.svg +0 -15
  67. package/src/components/icon/utils/svgs/bullet-list.svg +0 -8
  68. package/src/components/icon/utils/svgs/calendar.svg +0 -21
  69. package/src/components/icon/utils/svgs/camera.svg +0 -5
  70. package/src/components/icon/utils/svgs/categories.svg +0 -3
  71. package/src/components/icon/utils/svgs/check-circled.svg +0 -16
  72. package/src/components/icon/utils/svgs/check-outline.svg +0 -15
  73. package/src/components/icon/utils/svgs/check.svg +0 -3
  74. package/src/components/icon/utils/svgs/chevron-down.svg +0 -3
  75. package/src/components/icon/utils/svgs/chevron-left-double.svg +0 -4
  76. package/src/components/icon/utils/svgs/chevron-left.svg +0 -3
  77. package/src/components/icon/utils/svgs/chevron-right-double.svg +0 -4
  78. package/src/components/icon/utils/svgs/chevron-right.svg +0 -3
  79. package/src/components/icon/utils/svgs/chevron-up.svg +0 -3
  80. package/src/components/icon/utils/svgs/clock.svg +0 -4
  81. package/src/components/icon/utils/svgs/close-outline.svg +0 -3
  82. package/src/components/icon/utils/svgs/close.svg +0 -3
  83. package/src/components/icon/utils/svgs/columns.svg +0 -3
  84. package/src/components/icon/utils/svgs/conclusion.svg +0 -17
  85. package/src/components/icon/utils/svgs/copy.svg +0 -16
  86. package/src/components/icon/utils/svgs/crosshair.svg +0 -15
  87. package/src/components/icon/utils/svgs/dash.svg +0 -3
  88. package/src/components/icon/utils/svgs/dashboard.svg +0 -3
  89. package/src/components/icon/utils/svgs/delete.svg +0 -4
  90. package/src/components/icon/utils/svgs/delta.svg +0 -3
  91. package/src/components/icon/utils/svgs/download.svg +0 -3
  92. package/src/components/icon/utils/svgs/drag.svg +0 -8
  93. package/src/components/icon/utils/svgs/drilldown.svg +0 -8
  94. package/src/components/icon/utils/svgs/edit.svg +0 -16
  95. package/src/components/icon/utils/svgs/envelope.svg +0 -3
  96. package/src/components/icon/utils/svgs/error.svg +0 -3
  97. package/src/components/icon/utils/svgs/export-document.svg +0 -16
  98. package/src/components/icon/utils/svgs/filter.svg +0 -6
  99. package/src/components/icon/utils/svgs/filters.svg +0 -4
  100. package/src/components/icon/utils/svgs/flag.svg +0 -3
  101. package/src/components/icon/utils/svgs/folder.svg +0 -15
  102. package/src/components/icon/utils/svgs/frequency.svg +0 -3
  103. package/src/components/icon/utils/svgs/fullscreen-off.svg +0 -3
  104. package/src/components/icon/utils/svgs/fullscreen-on.svg +0 -3
  105. package/src/components/icon/utils/svgs/graduate.svg +0 -3
  106. package/src/components/icon/utils/svgs/hamburger.svg +0 -5
  107. package/src/components/icon/utils/svgs/handshake.svg +0 -15
  108. package/src/components/icon/utils/svgs/heading-1.svg +0 -4
  109. package/src/components/icon/utils/svgs/heading-2.svg +0 -4
  110. package/src/components/icon/utils/svgs/heading.svg +0 -3
  111. package/src/components/icon/utils/svgs/home.svg +0 -3
  112. package/src/components/icon/utils/svgs/id-card.svg +0 -6
  113. package/src/components/icon/utils/svgs/id.svg +0 -4
  114. package/src/components/icon/utils/svgs/indent-left.svg +0 -7
  115. package/src/components/icon/utils/svgs/indent-right.svg +0 -7
  116. package/src/components/icon/utils/svgs/information.svg +0 -17
  117. package/src/components/icon/utils/svgs/italics.svg +0 -3
  118. package/src/components/icon/utils/svgs/itenary.svg +0 -11
  119. package/src/components/icon/utils/svgs/keyboard.svg +0 -11
  120. package/src/components/icon/utils/svgs/lightning.svg +0 -15
  121. package/src/components/icon/utils/svgs/link.svg +0 -4
  122. package/src/components/icon/utils/svgs/list-collapse.svg +0 -6
  123. package/src/components/icon/utils/svgs/list-expand.svg +0 -6
  124. package/src/components/icon/utils/svgs/location.svg +0 -4
  125. package/src/components/icon/utils/svgs/lock-locked.svg +0 -4
  126. package/src/components/icon/utils/svgs/lock-unlocked.svg +0 -4
  127. package/src/components/icon/utils/svgs/magnifying-glass.svg +0 -15
  128. package/src/components/icon/utils/svgs/map.svg +0 -3
  129. package/src/components/icon/utils/svgs/megaphone.svg +0 -3
  130. package/src/components/icon/utils/svgs/message.svg +0 -15
  131. package/src/components/icon/utils/svgs/microscope.svg +0 -3
  132. package/src/components/icon/utils/svgs/moon.svg +0 -3
  133. package/src/components/icon/utils/svgs/new-document.svg +0 -4
  134. package/src/components/icon/utils/svgs/news.svg +0 -15
  135. package/src/components/icon/utils/svgs/numbered-list.svg +0 -7
  136. package/src/components/icon/utils/svgs/open-link.svg +0 -16
  137. package/src/components/icon/utils/svgs/options.svg +0 -5
  138. package/src/components/icon/utils/svgs/page.svg +0 -7
  139. package/src/components/icon/utils/svgs/paper-plane.svg +0 -15
  140. package/src/components/icon/utils/svgs/paper.svg +0 -3
  141. package/src/components/icon/utils/svgs/pen-and-paper.svg +0 -4
  142. package/src/components/icon/utils/svgs/phase.svg +0 -15
  143. package/src/components/icon/utils/svgs/photo.svg +0 -4
  144. package/src/components/icon/utils/svgs/pie-chart.svg +0 -3
  145. package/src/components/icon/utils/svgs/plus.svg +0 -3
  146. package/src/components/icon/utils/svgs/point-left.svg +0 -3
  147. package/src/components/icon/utils/svgs/point-up.svg +0 -3
  148. package/src/components/icon/utils/svgs/popup.svg +0 -16
  149. package/src/components/icon/utils/svgs/question.svg +0 -17
  150. package/src/components/icon/utils/svgs/radio-tower.svg +0 -3
  151. package/src/components/icon/utils/svgs/recycle.svg +0 -3
  152. package/src/components/icon/utils/svgs/redo.svg +0 -3
  153. package/src/components/icon/utils/svgs/refresh.svg +0 -3
  154. package/src/components/icon/utils/svgs/route.svg +0 -3
  155. package/src/components/icon/utils/svgs/rows.svg +0 -3
  156. package/src/components/icon/utils/svgs/scope.svg +0 -7
  157. package/src/components/icon/utils/svgs/settings.svg +0 -16
  158. package/src/components/icon/utils/svgs/share.svg +0 -11
  159. package/src/components/icon/utils/svgs/sign-in.svg +0 -4
  160. package/src/components/icon/utils/svgs/sign-up.svg +0 -3
  161. package/src/components/icon/utils/svgs/sort-down.svg +0 -20
  162. package/src/components/icon/utils/svgs/sort-up.svg +0 -20
  163. package/src/components/icon/utils/svgs/sort.svg +0 -7
  164. package/src/components/icon/utils/svgs/square-solid.svg +0 -3
  165. package/src/components/icon/utils/svgs/star-solid.svg +0 -15
  166. package/src/components/icon/utils/svgs/star.svg +0 -15
  167. package/src/components/icon/utils/svgs/stop-watch.svg +0 -5
  168. package/src/components/icon/utils/svgs/structure.svg +0 -3
  169. package/src/components/icon/utils/svgs/sun.svg +0 -23
  170. package/src/components/icon/utils/svgs/table.svg +0 -3
  171. package/src/components/icon/utils/svgs/tag.svg +0 -15
  172. package/src/components/icon/utils/svgs/team.svg +0 -15
  173. package/src/components/icon/utils/svgs/telescope.svg +0 -15
  174. package/src/components/icon/utils/svgs/trash.svg +0 -6
  175. package/src/components/icon/utils/svgs/triangle-angle.svg +0 -3
  176. package/src/components/icon/utils/svgs/triangle-side.svg +0 -3
  177. package/src/components/icon/utils/svgs/underline.svg +0 -4
  178. package/src/components/icon/utils/svgs/undo.svg +0 -3
  179. package/src/components/icon/utils/svgs/user.svg +0 -16
  180. package/src/components/icon/utils/svgs/venn.svg +0 -3
  181. package/src/components/icon/utils/svgs/video.svg +0 -3
  182. package/src/components/icon/utils/svgs/visibility-off-alt.svg +0 -19
  183. package/src/components/icon/utils/svgs/visibility-off.svg +0 -3
  184. package/src/components/icon/utils/svgs/visibility-on.svg +0 -16
  185. package/src/components/icon/utils/svgs/warning.svg +0 -5
  186. package/src/components/index.ts +0 -38
  187. package/src/components/input/Input.vue +0 -87
  188. package/src/components/input/index.ts +0 -1
  189. package/src/components/load-spinner/LoadSpinner.vue +0 -13
  190. package/src/components/load-spinner/index.ts +0 -1
  191. package/src/components/modal/Modal.vue +0 -111
  192. package/src/components/modal/index.ts +0 -1
  193. package/src/components/nav-item/NavItem.vue +0 -62
  194. package/src/components/nav-item/index.ts +0 -1
  195. package/src/components/notification/Notification.vue +0 -34
  196. package/src/components/notification/index.ts +0 -1
  197. package/src/components/pagination/Pagination.vue +0 -72
  198. package/src/components/pagination/index.ts +0 -1
  199. package/src/components/pill/Pill.vue +0 -52
  200. package/src/components/pill/index.ts +0 -2
  201. package/src/components/pill/pill-types.ts +0 -2
  202. package/src/components/pop-confirm/PopConfirm.vue +0 -69
  203. package/src/components/pop-confirm/index.ts +0 -1
  204. package/src/components/pop-select/FooterButton.vue +0 -5
  205. package/src/components/pop-select/PopSelect.vue +0 -346
  206. package/src/components/pop-select/ResultFilters.vue +0 -31
  207. package/src/components/pop-select/enums.ts +0 -7
  208. package/src/components/pop-select/index.ts +0 -2
  209. package/src/components/pop-select/option.vue +0 -51
  210. package/src/components/popper/Popper.vue +0 -239
  211. package/src/components/popper/PopperContent.vue +0 -5
  212. package/src/components/popper/index.ts +0 -2
  213. package/src/components/popper/middleware.ts +0 -19
  214. package/src/components/screen-overlay/ScreenOverlay.vue +0 -53
  215. package/src/components/screen-overlay/index.ts +0 -1
  216. package/src/components/scrollbar/Bar.vue +0 -106
  217. package/src/components/scrollbar/ScrollBottomLoader.vue +0 -25
  218. package/src/components/scrollbar/Scrollbar.vue +0 -220
  219. package/src/components/scrollbar/enums.ts +0 -23
  220. package/src/components/scrollbar/index.ts +0 -2
  221. package/src/components/scrollbar/scrollbarWidth.ts +0 -26
  222. package/src/components/scrollbar/style.scss +0 -75
  223. package/src/components/scrollbar/types.ts +0 -32
  224. package/src/components/side-over/SideOver.vue +0 -87
  225. package/src/components/side-over/index.ts +0 -1
  226. package/src/components/status-select/StatusIndicator.vue +0 -78
  227. package/src/components/status-select/StatusSelect.vue +0 -62
  228. package/src/components/status-select/index.ts +0 -1
  229. package/src/components/switch/Switch.vue +0 -52
  230. package/src/components/switch/index.ts +0 -1
  231. package/src/components/tab/Tab.vue +0 -59
  232. package/src/components/tab/index.ts +0 -1
  233. package/src/components/tag/Tag.vue +0 -34
  234. package/src/components/tag/index.ts +0 -1
  235. package/src/components/text-editor/TextEditor.vue +0 -399
  236. package/src/components/text-editor/components/Dialog.vue +0 -11
  237. package/src/components/text-editor/components/FormattingButton.vue +0 -46
  238. package/src/components/text-editor/components/InsertLinkDialog.vue +0 -81
  239. package/src/components/text-editor/components/InsertTextDialog.vue +0 -36
  240. package/src/components/text-editor/components/index.ts +0 -3
  241. package/src/components/text-editor/index.ts +0 -1
  242. package/src/components/text-highlight/TextHighlight.vue +0 -113
  243. package/src/components/text-highlight/index.ts +0 -1
  244. package/src/components/text-viewer/TextViewer.vue +0 -5
  245. package/src/components/text-viewer/index.ts +0 -1
  246. package/src/components/tooltip/Tooltip.vue +0 -54
  247. package/src/components/tooltip/index.ts +0 -1
  248. package/src/components/types.ts +0 -221
  249. package/src/components/vertical-layout/RunningSection.vue +0 -54
  250. package/src/components/vertical-layout/VerticalLayout.vue +0 -37
  251. package/src/components/vertical-layout/index.ts +0 -3
  252. package/src/components/vertical-layout/types.ts +0 -2
  253. package/src/components/window-frame/WindowFrame.vue +0 -20
  254. package/src/components/window-frame/index.ts +0 -1
  255. package/src/composables/index.ts +0 -5
  256. package/src/composables/useClickOutside.ts +0 -48
  257. package/src/composables/useEscapeKey.ts +0 -12
  258. package/src/composables/useMounted.ts +0 -7
  259. package/src/composables/useNextFrame.ts +0 -10
  260. package/src/composables/useTrapFocus.ts +0 -61
  261. package/src/index.ts +0 -5
  262. package/src/main.css +0 -116
  263. package/src/utils/array.ts +0 -11
  264. package/src/utils/clamp.ts +0 -1
  265. package/src/utils/debounce.ts +0 -8
  266. package/src/utils/index.ts +0 -5
  267. package/src/utils/scrollIntoView.ts +0 -25
  268. package/src/utils/scrollbarWidth.ts +0 -27
  269. package/tsconfig.app.json +0 -4
  270. package/tsconfig.json +0 -11
  271. package/tsconfig.node.json +0 -21
  272. package/vite.config.ts +0 -27
@@ -1,23 +0,0 @@
1
- import type { BarProperties } from "./types";
2
-
3
- export const horizontalProperties: BarProperties = {
4
- offset: "offsetWidth",
5
- scroll: "scrollLeft",
6
- scrollSize: "scrollWidth",
7
- size: "width",
8
- key: "horizontal",
9
- axis: "X",
10
- client: "clientX",
11
- direction: "left",
12
- };
13
-
14
- export const verticalProperties: BarProperties = {
15
- offset: "offsetHeight",
16
- scroll: "scrollTop",
17
- scrollSize: "scrollHeight",
18
- size: "height",
19
- key: "vertical",
20
- axis: "Y",
21
- client: "clientY",
22
- direction: "top",
23
- };
@@ -1,2 +0,0 @@
1
- export { default as BScrollbar } from "./Scrollbar.vue";
2
- export { default as BScrollBottomLoader } from "./ScrollBottomLoader.vue";
@@ -1,26 +0,0 @@
1
- let scrollBarWidth: number | undefined;
2
-
3
- export const scrollbarWidth = (): number => {
4
- if (scrollBarWidth !== undefined) return scrollBarWidth;
5
-
6
- const outer = document.createElement("div");
7
- outer.className = "el-scrollbar__wrap";
8
- outer.style.visibility = "hidden";
9
- outer.style.width = "100px";
10
- outer.style.position = "absolute";
11
- outer.style.top = "-9999px";
12
- document.body.appendChild(outer);
13
-
14
- const widthNoScroll = outer.offsetWidth;
15
- outer.style.overflow = "scroll";
16
-
17
- const inner = document.createElement("div");
18
- inner.style.width = "100%";
19
- outer.appendChild(inner);
20
-
21
- const widthWithScroll = inner.offsetWidth;
22
- outer.parentNode?.removeChild(outer);
23
- scrollBarWidth = widthNoScroll - widthWithScroll;
24
-
25
- return scrollBarWidth;
26
- };
@@ -1,75 +0,0 @@
1
- // reference https://github.com/ElemeFE/element/blob/dev/packages/theme-chalk/src/scrollbar.scss
2
-
3
- .scrollbar {
4
- overflow: hidden;
5
- position: relative;
6
-
7
- &:hover,
8
- &:active,
9
- &:focus {
10
- > .scrollbar__bar {
11
- opacity: 1;
12
- transition: opacity 340ms ease-out;
13
- }
14
- }
15
-
16
- &__wrap {
17
- overflow: auto;
18
- height: 100%;
19
-
20
- &.hidden-default {
21
- scrollbar-width: none;
22
- &::-webkit-scrollbar {
23
- width: 0;
24
- height: 0;
25
- }
26
- }
27
- }
28
-
29
- &__view {
30
- height: 100%;
31
- }
32
-
33
- &__thumb {
34
- position: relative;
35
- display: block;
36
- width: 0;
37
- height: 0;
38
- cursor: pointer;
39
- border-radius: inherit;
40
- background-color: #909399; // opacity 0.3
41
- transition: .3s background-color;
42
-
43
- &:hover {
44
- background-color: #909399; // opacity 0.5
45
- }
46
- }
47
-
48
- &__bar {
49
- position: absolute;
50
- right: 2px;
51
- bottom: 2px;
52
- z-index: 1;
53
- border-radius: 4px;
54
- opacity: 0;
55
- transition: opacity 120ms ease-out;
56
-
57
- &.is-vertical {
58
- width: 6px;
59
- top: 2px;
60
-
61
- > div {
62
- width: 100%;
63
- }
64
- }
65
-
66
- &.is-horizontal {
67
- height: 6px;
68
- left: 2px;
69
-
70
- > div {
71
- height: 100%;
72
- }
73
- }
74
- }
75
- }
@@ -1,32 +0,0 @@
1
- export type BarProperties = {
2
- offset: string;
3
- scroll: string;
4
- scrollSize: string;
5
- size: string;
6
- key: string;
7
- axis: string;
8
- client: string;
9
- direction: string;
10
- };
11
-
12
- export type ThumbDragEvent = {
13
- scrollReference: string;
14
- positionPercentage: number;
15
- scrollSize: number;
16
- };
17
-
18
- export const egdes = ["top", "bottom", "left", "right"] as const;
19
- export type ScrollEdge = (typeof egdes)[number];
20
-
21
- export type ScrollIntersectionEvent = {
22
- edge: ScrollEdge;
23
- hit: boolean;
24
- };
25
-
26
- export const directions = ["up", "down", "left", "right"] as const;
27
- export type ScrollDirection = (typeof directions)[number];
28
-
29
- export type ScrollTrigger = {
30
- px: number;
31
- callback: (trigger: ScrollTrigger, direction: ScrollDirection) => void;
32
- };
@@ -1,87 +0,0 @@
1
- <script setup lang="ts">
2
- import type { Slots } from "vue";
3
- import type { TOverlayType } from "../types";
4
- import { onMounted, ref, useSlots } from "vue";
5
- import { BButton, BScreenOverlay, BVerticalLayout } from "../";
6
- import { useEscapeKey, useTrapFocus } from "../../";
7
-
8
- const props = withDefaults(
9
- defineProps<{
10
- closeable?: boolean;
11
- overlayType?: TOverlayType;
12
- noScrollbar?: boolean;
13
- target?: string;
14
- title?: string;
15
- }>(),
16
- {
17
- closeable: true,
18
- overlayType: "default",
19
- noScrollbar: false,
20
- target: "#modals",
21
- },
22
- );
23
- const emit = defineEmits(["close"]);
24
- const slots: Slots = useSlots();
25
- const show = ref(false);
26
- const panelRef = ref<HTMLDivElement>();
27
- const { trapFocus } = useTrapFocus(panelRef);
28
-
29
- // when component is mounted start the transition
30
- onMounted(() => (show.value = true));
31
-
32
- const close = () => (show.value = false);
33
- const onClose = () => props.closeable && close();
34
- props.closeable && useEscapeKey(onClose);
35
-
36
- // afterTransition -> start trapFocus
37
- const onTransitionAfterEnter = () => {
38
- // focus the dialog after transition
39
- panelRef.value?.focus();
40
- // trap focus inside the dialog (without focusing the first focusable element)
41
- trapFocus();
42
- };
43
-
44
- defineExpose({ close });
45
- </script>
46
-
47
- <template>
48
- <Teleport to="#modals">
49
- <BScreenOverlay :show="show" :type="overlayType" class="p-4" @click="onClose" @close="emit('close')">
50
- <transition
51
- enter-active-class="transform transition ease-in-out duration-500"
52
- enter-from-class="translate-x-full"
53
- enter-to-class=""
54
- leave-active-class="transform transition ease-in-out duration-300"
55
- leave-class="translate-x-0"
56
- leave-to-class="translate-x-full"
57
- @after-enter="onTransitionAfterEnter"
58
- >
59
- <div
60
- v-show="show"
61
- ref="panelRef"
62
- tabindex="0"
63
- class="ml-auto flex flex-col bg-primary shadow-sm-xl rounded-xl overflow-hidden max-w-lg w-full h-full focus:outline-hidden"
64
- :class="{ 'px-6 py-4': !slots.default }"
65
- style="pointer-events: auto"
66
- >
67
- <slot v-if="$slots.default" />
68
- <BVerticalLayout v-else>
69
- <template v-if="props.title || $slots.header" #header>
70
- <header v-if="props.title" class="flex items-center justify-between w-full h-12">
71
- <h4>{{ props.title }}</h4>
72
- <BButton v-if="props.closeable" small icon="close" variant="textSubtle" @click="onClose" />
73
- </header>
74
- <slot v-else name="header" />
75
- </template>
76
- <template #main>
77
- <slot name="main" />
78
- </template>
79
- <template #footer>
80
- <slot name="footer" />
81
- </template>
82
- </BVerticalLayout>
83
- </div>
84
- </transition>
85
- </BScreenOverlay>
86
- </Teleport>
87
- </template>
@@ -1 +0,0 @@
1
- export { default as BSideOver } from "./SideOver.vue";
@@ -1,78 +0,0 @@
1
- <!-- eslint-disable vue/no-deprecated-slot-attribute -->
2
- <script setup lang="ts">
3
- import type { TStatusSelectStatus } from "../types";
4
- import { computed } from "vue";
5
- import { BIcon, BLoadSpinner } from "../";
6
-
7
- const props = withDefaults(
8
- defineProps<{
9
- button?: boolean;
10
- loading?: boolean;
11
- softFocus?: boolean;
12
- status?: TStatusSelectStatus | null;
13
- }>(),
14
- {
15
- button: true,
16
- loading: false,
17
- softFocus: false,
18
- status: null,
19
- },
20
- );
21
-
22
- // should be a 'disabled' prop instead of 'button'
23
- const tag = computed(() => (props.button ? "button" : "div"));
24
-
25
- const classes = computed(() => {
26
- const result = [];
27
-
28
- const loadingClasses = "border-default bg-granite-grey-15";
29
-
30
- switch (props.status) {
31
- case null:
32
- if (props.loading) {
33
- result.push(loadingClasses);
34
- }
35
- else if (props.button) {
36
- result.push("border-default");
37
- props.softFocus ? result.push("bg-sand-grey-15") : result.push("bg-white");
38
- }
39
-
40
- break;
41
- case "Ok":
42
- props.loading ? result.push(loadingClasses) : result.push("border-forest-green-darker bg-forest-green");
43
- break;
44
- case "Not Ok":
45
- props.loading ? result.push(loadingClasses) : result.push("border-lava-red-darker bg-lava-red");
46
- break;
47
- case "Not Applicable":
48
- props.loading ? result.push(loadingClasses) : result.push("border-granite-grey-darker bg-granite-grey");
49
- break;
50
- default:
51
- }
52
-
53
- if (props.button) result.push("focus:outline-hidden focus-visible:ring-3 active:scale-[0.98]");
54
-
55
- return result;
56
- });
57
-
58
- const icon = computed(() => {
59
- switch (props.status) {
60
- case null:
61
- return null;
62
- case "Ok":
63
- return "check";
64
- case "Not Ok":
65
- return "close";
66
- case "Not Applicable":
67
- return "dash";
68
- }
69
- return null;
70
- });
71
- </script>
72
-
73
- <template>
74
- <component :is="tag" class="inline-flex items-center justify-center w-6 h-6 rounded-full border" :class="classes">
75
- <BLoadSpinner v-if="loading" class="w-4 h-4 text-white" />
76
- <BIcon v-else-if="icon" :name="icon" class="text-white" />
77
- </component>
78
- </template>
@@ -1,62 +0,0 @@
1
- <script setup lang="ts">
2
- // import { ref } from "vue";
3
- // import StatusIndicator from "./StatusIndicator.vue";
4
- // import { BPopper, BPopperContent, BPopperOption } from "@firstnoodle-ui/bui";
5
- // import { useNextFrame } from "@/bui/composables";
6
- // import { TStatusSelectStatus } from "../types.ts";
7
-
8
- // const emit = defineEmits<{ change: [TStatusSelectStatus | null] }>();
9
-
10
- // withDefaults(
11
- // defineProps<{
12
- // clearable?: boolean;
13
- // disabled?: boolean;
14
- // loading?: boolean;
15
- // status: TStatusSelectStatus | null;
16
- // }>(),
17
- // {
18
- // clearable: false,
19
- // disabled: false,
20
- // loading: false,
21
- // status: null
22
- // }
23
- // );
24
-
25
- // const { nextFrame } = useNextFrame();
26
-
27
- // const popoverRef = ref<typeof BPopper>();
28
- // const contentRef = ref<typeof BPopperContent>();
29
-
30
- // const onShow = () => {
31
- // nextFrame(() => contentRef.value!.focus());
32
- // };
33
-
34
- // const onStatusChange = (status: TStatusSelectStatus | null) => {
35
- // emit("change", status);
36
- // popoverRef.value && popoverRef.value.close();
37
- // };
38
- </script>
39
-
40
- <template>
41
- TODO
42
- <!-- <status-indicator v-if="disabled" :status="status" />
43
- <b-popper v-else ref="popoverRef" trigger="click" trigger-class="flex" placement="bottom" :disabled="loading" :offset-main="4" @show="onShow">
44
- <template #default="slotProps">
45
- <status-indicator button :soft-focus="slotProps && slotProps.visible" :status="status" :loading="loading" />
46
- </template>
47
- <template #content>
48
- <b-popper-content ref="contentRef">
49
- <b-popper-option @click="onStatusChange('Ok')">
50
- <status-indicator :button="false" status="Ok" />
51
- </b-popper-option>
52
- <b-popper-option @click="onStatusChange('Not Ok')">
53
- <status-indicator :button="false" status="Not Ok" />
54
- </b-popper-option>
55
- <b-popper-option @click="onStatusChange('Not Applicable')">
56
- <status-indicator :button="false" status="Not Applicable" />
57
- </b-popper-option>
58
- <b-popper-option v-if="clearable" icon="trash" @click="onStatusChange(null)" class="justify-center py-3" />
59
- </b-popper-content>
60
- </template>
61
- </b-popper> -->
62
- </template>
@@ -1 +0,0 @@
1
- export { default as BStatusSelect } from "./StatusSelect.vue";
@@ -1,52 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed } from "vue";
3
-
4
- const props = withDefaults(
5
- defineProps<{
6
- value?: boolean;
7
- offColorClass?: string;
8
- onColorClass?: string;
9
- small?: boolean;
10
- }>(),
11
- {
12
- value: false,
13
- offColorClass: "bg-secondary",
14
- onColorClass: "bg-tertiary",
15
- small: false,
16
- },
17
- );
18
-
19
- const emit = defineEmits<{
20
- (e: "toggle", event: Event): void;
21
- }>();
22
-
23
- const knobClass = computed(() => {
24
- return [props.small ? "h-3 w-3" : "h-5 w-5", props.value ? (props.small ? "translate-x-3" : "translate-x-5") : "translate-x-0"];
25
- });
26
-
27
- const backgroundClass = computed(() => {
28
- return [props.small ? "h-4" : "h-6", props.value ? props.onColorClass : props.offColorClass];
29
- });
30
-
31
- const backgroundStyle = computed(() => {
32
- return {
33
- width: props.small ? "1.75rem" : "2.75rem",
34
- };
35
- });
36
- </script>
37
-
38
- <template>
39
- <button
40
- role="checkbox"
41
- tabindex="0"
42
- aria-checked="false"
43
- :class="backgroundClass"
44
- class="group relative inline-flex flex-shrink-0 border-2 border-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:outline-hidden focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-black dark:focus-visible:outline-white"
45
- :style="backgroundStyle"
46
- @click.stop.prevent="emit('toggle', $event)"
47
- @keydown.space.prevent="emit('toggle', $event)"
48
- @keydown.enter.prevent="emit('toggle', $event)"
49
- >
50
- <span aria-hidden="true" :class="knobClass" class="inline-block rounded-full bg-primary shadow-sm transform transition ease-in-out duration-200" />
51
- </button>
52
- </template>
@@ -1 +0,0 @@
1
- export { default as BSwitch } from "./Switch.vue";
@@ -1,59 +0,0 @@
1
- <script setup lang="ts">
2
- import type { TIcon } from "../types";
3
- import { ref } from "vue";
4
- import { BIcon } from "../../";
5
-
6
- const props = withDefaults(
7
- defineProps<{
8
- icon?: TIcon;
9
- grow?: boolean;
10
- name: string;
11
- notification?: boolean;
12
- selected: boolean;
13
- type?: "default" | "pill";
14
- disabled?: boolean;
15
- }>(),
16
- {
17
- grow: false,
18
- notification: false,
19
- type: "default",
20
- },
21
- );
22
-
23
- const emit = defineEmits(["select"]);
24
-
25
- const tabRef = ref<HTMLButtonElement>();
26
-
27
- const onSelect = () => {
28
- tabRef.value!.blur();
29
- emit("select", props.name);
30
- };
31
- </script>
32
-
33
- <template>
34
- <button
35
- ref="tabRef"
36
- :disabled="disabled"
37
- class=""
38
- :class="{
39
- 'relative flex items-center justify-center space-x-1 px-3 h-8 border-b focus:outline-hidden focus:border-action': type === 'default',
40
- 'border-action text-action': selected && type === 'default',
41
- 'border-subtle text-tertiary hover:text-secondary': !selected && type === 'default',
42
- 'relative flex items-center justify-center px-3 h-8 border border-transparent rounded-lg focus:outline-hidden': type === 'pill',
43
- 'bg-actionLightActive text-action': selected && type === 'pill',
44
- 'text-primary bg-sand-grey-40 hover:text-secondary hover:bg-actionLightHover focus:bg-actionLightActive focus:text-action':
45
- !disabled && !selected && type === 'pill',
46
- 'text-disabled': disabled,
47
- 'flex-grow': grow,
48
- }"
49
- @click.stop.prevent="onSelect"
50
- >
51
- <BIcon v-if="icon" :name="icon" />
52
- <span class="relative text-sm">
53
- {{ name }}
54
- <div v-if="notification" class="absolute" style="top: 0.124em; right: -0.65em">
55
- <div class="w-3 h-3 bg-orange-500 rounded-full border border-white" />
56
- </div>
57
- </span>
58
- </button>
59
- </template>
@@ -1 +0,0 @@
1
- export { default as BTab } from "./Tab.vue";
@@ -1,34 +0,0 @@
1
- <script setup lang="ts">
2
- import type { TIcon } from "../types";
3
- import { BButton, BFlexbox, BIcon } from "../";
4
-
5
- withDefaults(
6
- defineProps<{
7
- label: string;
8
- icon?: TIcon;
9
- deletable?: boolean;
10
- }>(),
11
- {
12
- deletable: false,
13
- },
14
- );
15
-
16
- const emit = defineEmits(["delete"]);
17
- </script>
18
-
19
- <template>
20
- <BFlexbox
21
- inline
22
- align="center"
23
- class="h-8 leading-tight truncate text-sm border rounded-lg border-sand-grey-15 text-secondary bg-sand-grey-40"
24
- :class="{
25
- 'px-2': !deletable,
26
- 'pl-2 pr-1': deletable,
27
- }"
28
- >
29
- <BIcon v-if="icon" :name="icon" class="mr-1" />
30
- <slot v-if="$slots.default" />
31
- <span v-else class="truncate">{{ label }}</span>
32
- <BButton v-if="deletable" small icon="close" class="ml-1" stop-propagation @click="emit('delete')" />
33
- </BFlexbox>
34
- </template>
@@ -1 +0,0 @@
1
- export { default as BTag } from "./Tag.vue";