@firstnoodle-ui/bui 0.0.13
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.
- package/LICENSE +21 -0
- package/dist/bui.css +1 -0
- package/dist/components/application-wrapper/ApplicationWrapper.vue.d.ts +17 -0
- package/dist/components/application-wrapper/index.d.ts +1 -0
- package/dist/components/aside-section-label/AsideSectionLabel.vue.d.ts +5 -0
- package/dist/components/aside-section-label/index.d.ts +1 -0
- package/dist/components/button/Button.vue.d.ts +52 -0
- package/dist/components/button/NotificationBadge.vue.d.ts +5 -0
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/button-group/ButtonGroup.vue.d.ts +29 -0
- package/dist/components/button-group/index.d.ts +1 -0
- package/dist/components/checkbox/Checkbox.vue.d.ts +18 -0
- package/dist/components/checkbox/CircleIndicator.vue.d.ts +6 -0
- package/dist/components/checkbox/DefaultIndicator.vue.d.ts +6 -0
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/collapse/Collapse.vue.d.ts +50 -0
- package/dist/components/collapse/index.d.ts +1 -0
- package/dist/components/confirm-cancel/ConfirmCancel.vue.d.ts +36 -0
- package/dist/components/confirm-cancel/index.d.ts +1 -0
- package/dist/components/data-point/DataPoint.vue.d.ts +2 -0
- package/dist/components/data-point/index.d.ts +1 -0
- package/dist/components/dialog/Dialog.vue.d.ts +128 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/fade-in-up/FadeInUp.vue.d.ts +21 -0
- package/dist/components/fade-in-up/index.d.ts +1 -0
- package/dist/components/first-paint/FirstPaint.vue.d.ts +20 -0
- package/dist/components/first-paint/index.d.ts +1 -0
- package/dist/components/flexbox/Flexbox.vue.d.ts +31 -0
- package/dist/components/flexbox/index.d.ts +1 -0
- package/dist/components/horizontal-layout/Aside.vue.d.ts +48 -0
- package/dist/components/horizontal-layout/HorizontalLayout.vue.d.ts +48 -0
- package/dist/components/horizontal-layout/index.d.ts +2 -0
- package/dist/components/icon/Icon.vue.d.ts +6 -0
- package/dist/components/icon/index.d.ts +1 -0
- package/dist/components/index.d.ts +38 -0
- package/dist/components/input/Input.vue.d.ts +26 -0
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/load-spinner/LoadSpinner.vue.d.ts +2 -0
- package/dist/components/load-spinner/index.d.ts +1 -0
- package/dist/components/modal/Modal.vue.d.ts +135 -0
- package/dist/components/modal/index.d.ts +1 -0
- package/dist/components/nav-item/NavItem.vue.d.ts +43 -0
- package/dist/components/nav-item/index.d.ts +1 -0
- package/dist/components/notification/Notification.vue.d.ts +14 -0
- package/dist/components/notification/index.d.ts +1 -0
- package/dist/components/pagination/Pagination.vue.d.ts +13 -0
- package/dist/components/pagination/index.d.ts +1 -0
- package/dist/components/pill/Pill.vue.d.ts +32 -0
- package/dist/components/pill/index.d.ts +2 -0
- package/dist/components/pill/pill-types.d.ts +2 -0
- package/dist/components/pop-confirm/PopConfirm.vue.d.ts +357 -0
- package/dist/components/pop-confirm/index.d.ts +1 -0
- package/dist/components/pop-select/FooterButton.vue.d.ts +2 -0
- package/dist/components/pop-select/PopSelect.vue.d.ts +51 -0
- package/dist/components/pop-select/ResultFilters.vue.d.ts +20 -0
- package/dist/components/pop-select/enums.d.ts +7 -0
- package/dist/components/pop-select/index.d.ts +2 -0
- package/dist/components/pop-select/option.vue.d.ts +39 -0
- package/dist/components/popper/Popper.vue.d.ts +79 -0
- package/dist/components/popper/PopperContent.vue.d.ts +17 -0
- package/dist/components/popper/index.d.ts +2 -0
- package/dist/components/popper/middleware.d.ts +10 -0
- package/dist/components/screen-overlay/ScreenOverlay.vue.d.ts +31 -0
- package/dist/components/screen-overlay/index.d.ts +1 -0
- package/dist/components/scrollbar/Bar.vue.d.ts +19 -0
- package/dist/components/scrollbar/ScrollBottomLoader.vue.d.ts +25 -0
- package/dist/components/scrollbar/Scrollbar.vue.d.ts +62 -0
- package/dist/components/scrollbar/enums.d.ts +3 -0
- package/dist/components/scrollbar/index.d.ts +2 -0
- package/dist/components/scrollbar/scrollbarWidth.d.ts +1 -0
- package/dist/components/scrollbar/types.d.ts +27 -0
- package/dist/components/side-over/SideOver.vue.d.ts +43 -0
- package/dist/components/side-over/index.d.ts +1 -0
- package/dist/components/status-select/StatusSelect.vue.d.ts +2 -0
- package/dist/components/status-select/index.d.ts +1 -0
- package/dist/components/switch/Switch.vue.d.ts +17 -0
- package/dist/components/switch/index.d.ts +1 -0
- package/dist/components/tab/Tab.vue.d.ts +22 -0
- package/dist/components/tab/index.d.ts +1 -0
- package/dist/components/tag/Tag.vue.d.ts +29 -0
- package/dist/components/tag/index.d.ts +1 -0
- package/dist/components/text-editor/TextEditor.vue.d.ts +79 -0
- package/dist/components/text-editor/components/Dialog.vue.d.ts +17 -0
- package/dist/components/text-editor/components/FormattingButton.vue.d.ts +19 -0
- package/dist/components/text-editor/components/InsertLinkDialog.vue.d.ts +57 -0
- package/dist/components/text-editor/components/InsertTextDialog.vue.d.ts +54 -0
- package/dist/components/text-editor/components/index.d.ts +3 -0
- package/dist/components/text-editor/index.d.ts +1 -0
- package/dist/components/text-highlight/TextHighlight.vue.d.ts +16 -0
- package/dist/components/text-highlight/index.d.ts +1 -0
- package/dist/components/text-viewer/TextViewer.vue.d.ts +17 -0
- package/dist/components/text-viewer/index.d.ts +1 -0
- package/dist/components/tooltip/Tooltip.vue.d.ts +42 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/types.d.ts +64 -0
- package/dist/components/vertical-layout/RunningSection.vue.d.ts +31 -0
- package/dist/components/vertical-layout/VerticalLayout.vue.d.ts +32 -0
- package/dist/components/vertical-layout/index.d.ts +3 -0
- package/dist/components/vertical-layout/types.d.ts +2 -0
- package/dist/components/window-frame/WindowFrame.vue.d.ts +21 -0
- package/dist/components/window-frame/index.d.ts +1 -0
- package/dist/composables/index.d.ts +5 -0
- package/dist/composables/useClickOutside.d.ts +5 -0
- package/dist/composables/useEscapeKey.d.ts +1 -0
- package/dist/composables/useMounted.d.ts +3 -0
- package/dist/composables/useNextFrame.d.ts +3 -0
- package/dist/composables/useTrapFocus.d.ts +8 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +20754 -0
- package/dist/utils/array.d.ts +5 -0
- package/dist/utils/clamp.d.ts +1 -0
- package/dist/utils/debounce.d.ts +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/scrollIntoView.d.ts +1 -0
- package/dist/utils/scrollbarWidth.d.ts +1 -0
- package/package.json +65 -0
- package/src/components/application-wrapper/ApplicationWrapper.vue +8 -0
- package/src/components/application-wrapper/index.ts +1 -0
- package/src/components/aside-section-label/AsideSectionLabel.vue +16 -0
- package/src/components/aside-section-label/index.ts +1 -0
- package/src/components/button/Button.vue +245 -0
- package/src/components/button/NotificationBadge.vue +15 -0
- package/src/components/button/index.ts +1 -0
- package/src/components/button-group/ButtonGroup.vue +97 -0
- package/src/components/button-group/index.ts +1 -0
- package/src/components/checkbox/Checkbox.vue +52 -0
- package/src/components/checkbox/CircleIndicator.vue +27 -0
- package/src/components/checkbox/DefaultIndicator.vue +22 -0
- package/src/components/checkbox/index.ts +1 -0
- package/src/components/collapse/Collapse.vue +120 -0
- package/src/components/collapse/index.ts +1 -0
- package/src/components/confirm-cancel/ConfirmCancel.vue +79 -0
- package/src/components/confirm-cancel/index.ts +1 -0
- package/src/components/data-point/DataPoint.vue +5 -0
- package/src/components/data-point/index.ts +1 -0
- package/src/components/dialog/Dialog.vue +70 -0
- package/src/components/dialog/index.ts +1 -0
- package/src/components/fade-in-up/FadeInUp.vue +17 -0
- package/src/components/fade-in-up/index.ts +1 -0
- package/src/components/first-paint/FirstPaint.vue +21 -0
- package/src/components/first-paint/index.ts +1 -0
- package/src/components/first-paint/style.scss +23 -0
- package/src/components/flexbox/Flexbox.vue +50 -0
- package/src/components/flexbox/index.ts +1 -0
- package/src/components/horizontal-layout/Aside.vue +113 -0
- package/src/components/horizontal-layout/HorizontalLayout.vue +118 -0
- package/src/components/horizontal-layout/index.ts +2 -0
- package/src/components/icon/Icon.vue +1159 -0
- package/src/components/icon/index.ts +1 -0
- package/src/components/icon/utils/combine-svgs.cjs +55 -0
- package/src/components/icon/utils/combined-svgs.txt +1150 -0
- package/src/components/icon/utils/svgs/admin.svg +16 -0
- package/src/components/icon/utils/svgs/arrow-deviate.svg +3 -0
- package/src/components/icon/utils/svgs/arrow-down-plus.svg +4 -0
- package/src/components/icon/utils/svgs/arrow-down.svg +3 -0
- package/src/components/icon/utils/svgs/arrow-from.svg +3 -0
- package/src/components/icon/utils/svgs/arrow-left.svg +3 -0
- package/src/components/icon/utils/svgs/arrow-move.svg +15 -0
- package/src/components/icon/utils/svgs/arrow-right.svg +3 -0
- package/src/components/icon/utils/svgs/arrow-sub.svg +3 -0
- package/src/components/icon/utils/svgs/arrow-trend.svg +15 -0
- package/src/components/icon/utils/svgs/arrow-up-plus.svg +4 -0
- package/src/components/icon/utils/svgs/arrow-up.svg +3 -0
- package/src/components/icon/utils/svgs/authority.svg +5 -0
- package/src/components/icon/utils/svgs/beams.svg +5 -0
- package/src/components/icon/utils/svgs/bell.svg +15 -0
- package/src/components/icon/utils/svgs/bold.svg +3 -0
- package/src/components/icon/utils/svgs/box.svg +5 -0
- package/src/components/icon/utils/svgs/building.svg +15 -0
- package/src/components/icon/utils/svgs/bullet-list.svg +8 -0
- package/src/components/icon/utils/svgs/calendar.svg +21 -0
- package/src/components/icon/utils/svgs/camera.svg +5 -0
- package/src/components/icon/utils/svgs/categories.svg +3 -0
- package/src/components/icon/utils/svgs/check-circled.svg +16 -0
- package/src/components/icon/utils/svgs/check-outline.svg +15 -0
- package/src/components/icon/utils/svgs/check.svg +3 -0
- package/src/components/icon/utils/svgs/chevron-down.svg +3 -0
- package/src/components/icon/utils/svgs/chevron-left-double.svg +4 -0
- package/src/components/icon/utils/svgs/chevron-left.svg +3 -0
- package/src/components/icon/utils/svgs/chevron-right-double.svg +4 -0
- package/src/components/icon/utils/svgs/chevron-right.svg +3 -0
- package/src/components/icon/utils/svgs/chevron-up.svg +3 -0
- package/src/components/icon/utils/svgs/clock.svg +4 -0
- package/src/components/icon/utils/svgs/close-outline.svg +3 -0
- package/src/components/icon/utils/svgs/close.svg +3 -0
- package/src/components/icon/utils/svgs/columns.svg +3 -0
- package/src/components/icon/utils/svgs/conclusion.svg +17 -0
- package/src/components/icon/utils/svgs/copy.svg +16 -0
- package/src/components/icon/utils/svgs/crosshair.svg +15 -0
- package/src/components/icon/utils/svgs/dash.svg +3 -0
- package/src/components/icon/utils/svgs/dashboard.svg +3 -0
- package/src/components/icon/utils/svgs/delete.svg +4 -0
- package/src/components/icon/utils/svgs/delta.svg +3 -0
- package/src/components/icon/utils/svgs/download.svg +3 -0
- package/src/components/icon/utils/svgs/drag.svg +8 -0
- package/src/components/icon/utils/svgs/drilldown.svg +8 -0
- package/src/components/icon/utils/svgs/edit.svg +16 -0
- package/src/components/icon/utils/svgs/envelope.svg +3 -0
- package/src/components/icon/utils/svgs/error.svg +3 -0
- package/src/components/icon/utils/svgs/export-document.svg +16 -0
- package/src/components/icon/utils/svgs/filter.svg +6 -0
- package/src/components/icon/utils/svgs/filters.svg +4 -0
- package/src/components/icon/utils/svgs/flag.svg +3 -0
- package/src/components/icon/utils/svgs/folder.svg +15 -0
- package/src/components/icon/utils/svgs/frequency.svg +3 -0
- package/src/components/icon/utils/svgs/fullscreen-off.svg +3 -0
- package/src/components/icon/utils/svgs/fullscreen-on.svg +3 -0
- package/src/components/icon/utils/svgs/graduate.svg +3 -0
- package/src/components/icon/utils/svgs/hamburger.svg +5 -0
- package/src/components/icon/utils/svgs/handshake.svg +15 -0
- package/src/components/icon/utils/svgs/heading-1.svg +4 -0
- package/src/components/icon/utils/svgs/heading-2.svg +4 -0
- package/src/components/icon/utils/svgs/heading.svg +3 -0
- package/src/components/icon/utils/svgs/home.svg +3 -0
- package/src/components/icon/utils/svgs/id-card.svg +6 -0
- package/src/components/icon/utils/svgs/id.svg +4 -0
- package/src/components/icon/utils/svgs/indent-left.svg +7 -0
- package/src/components/icon/utils/svgs/indent-right.svg +7 -0
- package/src/components/icon/utils/svgs/information.svg +17 -0
- package/src/components/icon/utils/svgs/italics.svg +3 -0
- package/src/components/icon/utils/svgs/itenary.svg +11 -0
- package/src/components/icon/utils/svgs/keyboard.svg +11 -0
- package/src/components/icon/utils/svgs/lightning.svg +15 -0
- package/src/components/icon/utils/svgs/link.svg +4 -0
- package/src/components/icon/utils/svgs/list-collapse.svg +6 -0
- package/src/components/icon/utils/svgs/list-expand.svg +6 -0
- package/src/components/icon/utils/svgs/location.svg +4 -0
- package/src/components/icon/utils/svgs/lock-locked.svg +4 -0
- package/src/components/icon/utils/svgs/lock-unlocked.svg +4 -0
- package/src/components/icon/utils/svgs/magnifying-glass.svg +15 -0
- package/src/components/icon/utils/svgs/map.svg +3 -0
- package/src/components/icon/utils/svgs/megaphone.svg +3 -0
- package/src/components/icon/utils/svgs/message.svg +15 -0
- package/src/components/icon/utils/svgs/microscope.svg +3 -0
- package/src/components/icon/utils/svgs/moon.svg +3 -0
- package/src/components/icon/utils/svgs/new-document.svg +4 -0
- package/src/components/icon/utils/svgs/news.svg +15 -0
- package/src/components/icon/utils/svgs/numbered-list.svg +7 -0
- package/src/components/icon/utils/svgs/open-link.svg +16 -0
- package/src/components/icon/utils/svgs/options.svg +5 -0
- package/src/components/icon/utils/svgs/page.svg +7 -0
- package/src/components/icon/utils/svgs/paper-plane.svg +15 -0
- package/src/components/icon/utils/svgs/paper.svg +3 -0
- package/src/components/icon/utils/svgs/pen-and-paper.svg +4 -0
- package/src/components/icon/utils/svgs/phase.svg +15 -0
- package/src/components/icon/utils/svgs/photo.svg +4 -0
- package/src/components/icon/utils/svgs/pie-chart.svg +3 -0
- package/src/components/icon/utils/svgs/plus.svg +3 -0
- package/src/components/icon/utils/svgs/point-left.svg +3 -0
- package/src/components/icon/utils/svgs/point-up.svg +3 -0
- package/src/components/icon/utils/svgs/popup.svg +16 -0
- package/src/components/icon/utils/svgs/question.svg +17 -0
- package/src/components/icon/utils/svgs/radio-tower.svg +3 -0
- package/src/components/icon/utils/svgs/recycle.svg +3 -0
- package/src/components/icon/utils/svgs/redo.svg +3 -0
- package/src/components/icon/utils/svgs/refresh.svg +3 -0
- package/src/components/icon/utils/svgs/route.svg +3 -0
- package/src/components/icon/utils/svgs/rows.svg +3 -0
- package/src/components/icon/utils/svgs/scope.svg +7 -0
- package/src/components/icon/utils/svgs/settings.svg +16 -0
- package/src/components/icon/utils/svgs/share.svg +11 -0
- package/src/components/icon/utils/svgs/sign-in.svg +4 -0
- package/src/components/icon/utils/svgs/sign-up.svg +3 -0
- package/src/components/icon/utils/svgs/sort-down.svg +20 -0
- package/src/components/icon/utils/svgs/sort-up.svg +20 -0
- package/src/components/icon/utils/svgs/sort.svg +7 -0
- package/src/components/icon/utils/svgs/square-solid.svg +3 -0
- package/src/components/icon/utils/svgs/star-solid.svg +15 -0
- package/src/components/icon/utils/svgs/star.svg +15 -0
- package/src/components/icon/utils/svgs/stop-watch.svg +5 -0
- package/src/components/icon/utils/svgs/structure.svg +3 -0
- package/src/components/icon/utils/svgs/sun.svg +23 -0
- package/src/components/icon/utils/svgs/table.svg +3 -0
- package/src/components/icon/utils/svgs/tag.svg +15 -0
- package/src/components/icon/utils/svgs/team.svg +15 -0
- package/src/components/icon/utils/svgs/telescope.svg +15 -0
- package/src/components/icon/utils/svgs/trash.svg +6 -0
- package/src/components/icon/utils/svgs/triangle-angle.svg +3 -0
- package/src/components/icon/utils/svgs/triangle-side.svg +3 -0
- package/src/components/icon/utils/svgs/underline.svg +4 -0
- package/src/components/icon/utils/svgs/undo.svg +3 -0
- package/src/components/icon/utils/svgs/user.svg +16 -0
- package/src/components/icon/utils/svgs/venn.svg +3 -0
- package/src/components/icon/utils/svgs/video.svg +3 -0
- package/src/components/icon/utils/svgs/visibility-off-alt.svg +19 -0
- package/src/components/icon/utils/svgs/visibility-off.svg +3 -0
- package/src/components/icon/utils/svgs/visibility-on.svg +16 -0
- package/src/components/icon/utils/svgs/warning.svg +5 -0
- package/src/components/index.ts +38 -0
- package/src/components/input/Input.vue +87 -0
- package/src/components/input/index.ts +1 -0
- package/src/components/load-spinner/LoadSpinner.vue +13 -0
- package/src/components/load-spinner/index.ts +1 -0
- package/src/components/modal/Modal.vue +111 -0
- package/src/components/modal/index.ts +1 -0
- package/src/components/nav-item/NavItem.vue +62 -0
- package/src/components/nav-item/index.ts +1 -0
- package/src/components/notification/Notification.vue +34 -0
- package/src/components/notification/index.ts +1 -0
- package/src/components/pagination/Pagination.vue +72 -0
- package/src/components/pagination/index.ts +1 -0
- package/src/components/pill/Pill.vue +52 -0
- package/src/components/pill/index.ts +2 -0
- package/src/components/pill/pill-types.ts +2 -0
- package/src/components/pop-confirm/PopConfirm.vue +69 -0
- package/src/components/pop-confirm/index.ts +1 -0
- package/src/components/pop-select/FooterButton.vue +5 -0
- package/src/components/pop-select/PopSelect.vue +346 -0
- package/src/components/pop-select/ResultFilters.vue +31 -0
- package/src/components/pop-select/enums.ts +7 -0
- package/src/components/pop-select/index.ts +2 -0
- package/src/components/pop-select/option.vue +51 -0
- package/src/components/popper/Popper.vue +239 -0
- package/src/components/popper/PopperContent.vue +5 -0
- package/src/components/popper/index.ts +2 -0
- package/src/components/popper/middleware.ts +19 -0
- package/src/components/screen-overlay/ScreenOverlay.vue +53 -0
- package/src/components/screen-overlay/index.ts +1 -0
- package/src/components/scrollbar/Bar.vue +106 -0
- package/src/components/scrollbar/ScrollBottomLoader.vue +25 -0
- package/src/components/scrollbar/Scrollbar.vue +220 -0
- package/src/components/scrollbar/enums.ts +23 -0
- package/src/components/scrollbar/index.ts +2 -0
- package/src/components/scrollbar/scrollbarWidth.ts +26 -0
- package/src/components/scrollbar/style.scss +75 -0
- package/src/components/scrollbar/types.ts +32 -0
- package/src/components/side-over/SideOver.vue +87 -0
- package/src/components/side-over/index.ts +1 -0
- package/src/components/status-select/StatusIndicator.vue +78 -0
- package/src/components/status-select/StatusSelect.vue +62 -0
- package/src/components/status-select/index.ts +1 -0
- package/src/components/switch/Switch.vue +52 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/tab/Tab.vue +59 -0
- package/src/components/tab/index.ts +1 -0
- package/src/components/tag/Tag.vue +34 -0
- package/src/components/tag/index.ts +1 -0
- package/src/components/text-editor/TextEditor.vue +399 -0
- package/src/components/text-editor/components/Dialog.vue +11 -0
- package/src/components/text-editor/components/FormattingButton.vue +46 -0
- package/src/components/text-editor/components/InsertLinkDialog.vue +81 -0
- package/src/components/text-editor/components/InsertTextDialog.vue +36 -0
- package/src/components/text-editor/components/index.ts +3 -0
- package/src/components/text-editor/index.ts +1 -0
- package/src/components/text-highlight/TextHighlight.vue +113 -0
- package/src/components/text-highlight/index.ts +1 -0
- package/src/components/text-viewer/TextViewer.vue +5 -0
- package/src/components/text-viewer/index.ts +1 -0
- package/src/components/tooltip/Tooltip.vue +54 -0
- package/src/components/tooltip/index.ts +1 -0
- package/src/components/types.ts +221 -0
- package/src/components/vertical-layout/RunningSection.vue +54 -0
- package/src/components/vertical-layout/VerticalLayout.vue +37 -0
- package/src/components/vertical-layout/index.ts +3 -0
- package/src/components/vertical-layout/types.ts +2 -0
- package/src/components/window-frame/WindowFrame.vue +20 -0
- package/src/components/window-frame/index.ts +1 -0
- package/src/composables/index.ts +5 -0
- package/src/composables/useClickOutside.ts +48 -0
- package/src/composables/useEscapeKey.ts +12 -0
- package/src/composables/useMounted.ts +7 -0
- package/src/composables/useNextFrame.ts +10 -0
- package/src/composables/useTrapFocus.ts +61 -0
- package/src/index.ts +5 -0
- package/src/main.css +116 -0
- package/src/utils/array.ts +11 -0
- package/src/utils/clamp.ts +1 -0
- package/src/utils/debounce.ts +8 -0
- package/src/utils/index.ts +5 -0
- package/src/utils/scrollIntoView.ts +25 -0
- package/src/utils/scrollbarWidth.ts +27 -0
- package/tsconfig.app.json +4 -0
- package/tsconfig.json +11 -0
- package/tsconfig.node.json +21 -0
- package/vite.config.ts +27 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const clamp: (value: number, min: number, max: number) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const debounce: (fn: Function, timeout?: number) => (...args: any[]) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const scrollIntoView: (container: HTMLElement, selected: HTMLElement) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const scrollbarWidth: () => number;
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@firstnoodle-ui/bui",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.13",
|
|
5
|
+
"private": false,
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/firstnoodle-ui/bui.git"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"import": "./dist/index.mjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"main": "./dist/index.mjs",
|
|
17
|
+
"types": "dist/index.d.ts",
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"tailwindcss": "^4.1.1",
|
|
20
|
+
"vue": "^3.5.13"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"registry": "https://registry.npmjs.org/",
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@floating-ui/dom": "^1.6.13",
|
|
28
|
+
"@tiptap/extension-bold": "^2.11.7",
|
|
29
|
+
"@tiptap/extension-bullet-list": "^2.11.7",
|
|
30
|
+
"@tiptap/extension-document": "^2.11.7",
|
|
31
|
+
"@tiptap/extension-heading": "^2.11.7",
|
|
32
|
+
"@tiptap/extension-highlight": "^2.11.7",
|
|
33
|
+
"@tiptap/extension-history": "^2.11.7",
|
|
34
|
+
"@tiptap/extension-italic": "^2.11.7",
|
|
35
|
+
"@tiptap/extension-link": "^2.11.7",
|
|
36
|
+
"@tiptap/extension-list-item": "^2.11.7",
|
|
37
|
+
"@tiptap/extension-ordered-list": "^2.11.7",
|
|
38
|
+
"@tiptap/extension-paragraph": "^2.11.7",
|
|
39
|
+
"@tiptap/extension-placeholder": "^2.11.7",
|
|
40
|
+
"@tiptap/extension-text": "^2.11.7",
|
|
41
|
+
"@tiptap/extension-underline": "^2.11.7",
|
|
42
|
+
"@tiptap/vue-3": "^2.11.7",
|
|
43
|
+
"debounce": "^2.2.0",
|
|
44
|
+
"vue-router": "4"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@tailwindcss/vite": "^4.1.1",
|
|
48
|
+
"@types/node": "^22.14.0",
|
|
49
|
+
"@vitejs/plugin-vue": "^5.2.3",
|
|
50
|
+
"@vue/tsconfig": "^0.7.0",
|
|
51
|
+
"sass-embedded": "^1.86.3",
|
|
52
|
+
"tailwindcss": "^4.1.1",
|
|
53
|
+
"typescript": "^5.8.2",
|
|
54
|
+
"vite": "^6.2.4",
|
|
55
|
+
"vite-plugin-dts": "^4.5.3",
|
|
56
|
+
"vue": "^3.5.13",
|
|
57
|
+
"vue-tsc": "^2.2.8"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "vite build",
|
|
61
|
+
"typecheck": "vue-tsc -p tsconfig.app.json --noEmit",
|
|
62
|
+
"watch": "vite build --watch",
|
|
63
|
+
"release:publish": "pnpm publish --access public --otp=533339 --no-git-checks"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<main class="fixed top-0 left-0 w-screen h-screen overflow-hidden text-primary">
|
|
3
|
+
<slot />
|
|
4
|
+
<div id="modals" class="z-10 fixed w-screen h-screen top-0 left-0 pointer-events-none" />
|
|
5
|
+
<div id="notifications" class="z-10 fixed w-screen h-screen top-0 left-0 pointer-events-none flex items-end justify-center p-12" />
|
|
6
|
+
<div id="poppers" class="z-10 fixed w-screen h-screen top-0 left-0 pointer-events-none" />
|
|
7
|
+
</main>
|
|
8
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BApplicationWrapper } from "./ApplicationWrapper.vue";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{ label: string }>();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<section class="w-full space-y-4">
|
|
7
|
+
<div class="w-full h-12 flex items-center">
|
|
8
|
+
<p class="flex-none pr-2 text-xs leading-none font-medium text-secondary">
|
|
9
|
+
{{ label }}
|
|
10
|
+
</p>
|
|
11
|
+
<div class="flex-1 h-full">
|
|
12
|
+
<div class="w-full border-b border-default" style="height: 54%" />
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</section>
|
|
16
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BAsideSectionLabel } from "./AsideSectionLabel.vue";
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Placement } from "@floating-ui/dom";
|
|
3
|
+
import type { ButtonVariant, TIcon } from "../types";
|
|
4
|
+
import { computed, ref } from "vue";
|
|
5
|
+
import { BIcon, BLoadSpinner, BTooltip } from "../";
|
|
6
|
+
import NotificationBadge from "./NotificationBadge.vue";
|
|
7
|
+
|
|
8
|
+
const props = withDefaults(
|
|
9
|
+
defineProps<{
|
|
10
|
+
variant?: ButtonVariant;
|
|
11
|
+
classes?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
fullwidth?: boolean;
|
|
14
|
+
href?: string;
|
|
15
|
+
icon?: TIcon;
|
|
16
|
+
iconAfter?: TIcon;
|
|
17
|
+
label?: string;
|
|
18
|
+
linkTarget?: string;
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
mailto?: string;
|
|
21
|
+
notification?: boolean;
|
|
22
|
+
rounded?: boolean;
|
|
23
|
+
routerLinkTo?: string | { path: string } | { name: string };
|
|
24
|
+
small?: boolean;
|
|
25
|
+
focus?: boolean;
|
|
26
|
+
stopPropagation?: boolean;
|
|
27
|
+
tooltip?: string;
|
|
28
|
+
tooltipDelay?: number;
|
|
29
|
+
tooltipPlacement?: Placement;
|
|
30
|
+
}>(),
|
|
31
|
+
{
|
|
32
|
+
variant: "fill",
|
|
33
|
+
disabled: false,
|
|
34
|
+
focus: false,
|
|
35
|
+
fullwidth: false,
|
|
36
|
+
loading: false,
|
|
37
|
+
notification: false,
|
|
38
|
+
rounded: false,
|
|
39
|
+
small: false,
|
|
40
|
+
stopPropagation: false,
|
|
41
|
+
tooltipDelay: 500,
|
|
42
|
+
tooltipPlacement: "top",
|
|
43
|
+
},
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const emit = defineEmits(["click", "blur"]);
|
|
47
|
+
|
|
48
|
+
const component = ref<string>(props.routerLinkTo ? "router-link" : "button");
|
|
49
|
+
const buttonRef = ref<HTMLButtonElement>();
|
|
50
|
+
|
|
51
|
+
const loadSpinnerClass = computed(() => {
|
|
52
|
+
const classes = ["w-4 h-4"];
|
|
53
|
+
if (props.variant === "fill" || props.variant === "destructive") {
|
|
54
|
+
classes.push("text-light");
|
|
55
|
+
}
|
|
56
|
+
else if (props.variant === "outline" || props.variant === "text") {
|
|
57
|
+
classes.push("text-blue-500");
|
|
58
|
+
}
|
|
59
|
+
else if (props.variant === "outlineSubtle" || props.variant === "textSubtle") {
|
|
60
|
+
classes.push("text-slate-700 dark:text-slate-200");
|
|
61
|
+
}
|
|
62
|
+
return classes.join(" ");
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const buttonClasses = computed(() => {
|
|
66
|
+
const result = [];
|
|
67
|
+
|
|
68
|
+
// Set padding x.
|
|
69
|
+
// Add extra if rounded and there is a label
|
|
70
|
+
props.rounded && props.label
|
|
71
|
+
? result.push(props.small ? "px-2" : "px-3")
|
|
72
|
+
: result.push(props.loading && props.icon && !props.label ? "px-0" : "px-2");
|
|
73
|
+
|
|
74
|
+
props.small ? result.push("h-6") : result.push("h-8");
|
|
75
|
+
|
|
76
|
+
if (props.icon && !props.label) {
|
|
77
|
+
props.small ? result.push("w-6") : result.push("w-8");
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
props.disabled ? result.push("opacity-75 cursor-not-allowed") : result.push("cursor-pointer");
|
|
81
|
+
props.fullwidth && result.push("w-full");
|
|
82
|
+
|
|
83
|
+
if (props.rounded) result.push("rounded-full");
|
|
84
|
+
else result.push("rounded-lg");
|
|
85
|
+
|
|
86
|
+
switch (props.variant) {
|
|
87
|
+
case "fill":
|
|
88
|
+
result.push(
|
|
89
|
+
...(props.focus
|
|
90
|
+
? [""]
|
|
91
|
+
: [
|
|
92
|
+
"bg-blue-500 hover:bg-blue-600 focus-visible:bg-blue-600 active:bg-blue-700",
|
|
93
|
+
"border border-blue-500 hover:border-blue-600 focus-visible:border-blue-600 active:border-blue-700",
|
|
94
|
+
"text-white focus-visible:outline",
|
|
95
|
+
"dark:bg-blue-700 dark:hover:bg-blue-600 focus-visible:bg-blue-600 dark:active:bg-blue-500",
|
|
96
|
+
"border dark:border-blue-700 dark:hover:border-blue-600 focus-visible:border-blue-600 dark:active:border-blue-500",
|
|
97
|
+
]
|
|
98
|
+
),
|
|
99
|
+
);
|
|
100
|
+
break;
|
|
101
|
+
case "outline":
|
|
102
|
+
result.push(
|
|
103
|
+
...(props.focus
|
|
104
|
+
? [""]
|
|
105
|
+
: [
|
|
106
|
+
"hover:bg-blue-100 focus-visible:bg-blue-100 active:bg-blue-200",
|
|
107
|
+
"border border-blue-500 hover:border-blue-600 focus-visible:border-blue-600 active:border-blue-700",
|
|
108
|
+
"text-blue-500 hover:text-blue-600 focus-visible:text-blue-600 active:text-blue-700",
|
|
109
|
+
"dark:hover:bg-blue-900 dark:focus-visible:bg-blue-900 dark:active:bg-blue-700",
|
|
110
|
+
"dark:border-blue-500 dark:hover:border-blue-500 dark:focus-visible:border-blue-500 dark:active:border-blue-600",
|
|
111
|
+
"dark:text-blue-500 dark:hover:text-blue-100 focus-visible:text-blue-100 dark:active:text-white",
|
|
112
|
+
]
|
|
113
|
+
),
|
|
114
|
+
);
|
|
115
|
+
break;
|
|
116
|
+
case "outlineSubtle":
|
|
117
|
+
result.push(
|
|
118
|
+
...(props.focus
|
|
119
|
+
? [""]
|
|
120
|
+
: [
|
|
121
|
+
"hover:bg-slate-100 focus-visible:bg-slate-100 active:bg-slate-200",
|
|
122
|
+
"border border-stone-300 hover:border-stone-400 focus-visible:border-stone-400 active:border-stone-500",
|
|
123
|
+
"text-slate-700 hover:text-slate-800 focus-visible:text-slate-800 active:text-slate-900",
|
|
124
|
+
"dark:hover:bg-neutral-700 focus-visible:bg-neutral-700 dark:active:bg-neutral-600",
|
|
125
|
+
"dark:border-stone-700 dark:hover:border-stone-600 focus-visible:border-stone-600 dark:active:border-stone-500",
|
|
126
|
+
"dark:text-slate-200 dark:hover:text-slate-100 focus-visible:text-slate-100 dark:active:text-white",
|
|
127
|
+
]
|
|
128
|
+
),
|
|
129
|
+
);
|
|
130
|
+
break;
|
|
131
|
+
case "text":
|
|
132
|
+
result.push(
|
|
133
|
+
...(props.focus
|
|
134
|
+
? [""]
|
|
135
|
+
: [
|
|
136
|
+
"hover:bg-blue-100 focus-visible:bg-blue-100 active:bg-blue-200",
|
|
137
|
+
"border-none",
|
|
138
|
+
"text-blue-500 hover:text-blue-600 focus-visible:text-blue-600 active:text-blue-700",
|
|
139
|
+
"dark:hover:bg-blue-900 dark:focus-visible:bg-blue-900 dark:active:bg-blue-700",
|
|
140
|
+
"dark:text-blue-500 dark:hover:text-blue-100 focus-visible:text-blue-100 dark:active:text-white",
|
|
141
|
+
]
|
|
142
|
+
),
|
|
143
|
+
);
|
|
144
|
+
break;
|
|
145
|
+
case "textSubtle":
|
|
146
|
+
result.push(
|
|
147
|
+
...(props.focus
|
|
148
|
+
? ["bg-slate-200 text-slate-900 dark:bg-neutral-600 dark:text-white"]
|
|
149
|
+
: [
|
|
150
|
+
"hover:bg-slate-100 focus-visible:bg-slate-100 active:bg-slate-200",
|
|
151
|
+
"border-none",
|
|
152
|
+
"text-slate-700 hover:text-slate-800 focus-visible:text-slate-800 active:text-slate-900",
|
|
153
|
+
"dark:hover:bg-neutral-700 focus-visible:bg-neutral-700 dark:active:bg-neutral-600",
|
|
154
|
+
"dark:text-slate-200 dark:hover:text-slate-100 focus-visible:text-slate-100 dark:active:text-white",
|
|
155
|
+
]
|
|
156
|
+
),
|
|
157
|
+
);
|
|
158
|
+
break;
|
|
159
|
+
case "destructive":
|
|
160
|
+
result.push(
|
|
161
|
+
...(props.focus
|
|
162
|
+
? ["bg-red-800 border-red-800 text-white"]
|
|
163
|
+
: [
|
|
164
|
+
"bg-red-600 hover:bg-red-700 focus-visible:bg-red-700 active:bg-red-800",
|
|
165
|
+
"border border-red-600 hover:border-red-700 focus-visible:border-red-700 active:border-red-800",
|
|
166
|
+
"text-white",
|
|
167
|
+
]
|
|
168
|
+
),
|
|
169
|
+
);
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (props.classes) result.push(props.classes);
|
|
174
|
+
|
|
175
|
+
return result.filter(i => i).join(" ");
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
const disabledStyle = computed(() => {
|
|
179
|
+
if (props.disabled) {
|
|
180
|
+
return props.variant === "fill" || props.variant === "destructive" ? { filter: "grayscale(50%)" } : { background: "hsl(0 0% 90%)" };
|
|
181
|
+
}
|
|
182
|
+
return {};
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
const onClick = (event: MouseEvent) => {
|
|
186
|
+
props.stopPropagation && event.stopPropagation();
|
|
187
|
+
|
|
188
|
+
if (!props.disabled && !props.loading) {
|
|
189
|
+
if (props.href) {
|
|
190
|
+
window.open(props.href, "_blank");
|
|
191
|
+
}
|
|
192
|
+
if (props.mailto) window.open(`mailto:${props.mailto}`);
|
|
193
|
+
emit("click");
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
const focus = () => buttonRef.value!.focus();
|
|
198
|
+
|
|
199
|
+
defineExpose({ focus });
|
|
200
|
+
</script>
|
|
201
|
+
|
|
202
|
+
<template>
|
|
203
|
+
<BTooltip v-if="tooltip" hover :text="tooltip" :delay="tooltipDelay" :placement="tooltipPlacement" :trigger-full-width="fullwidth">
|
|
204
|
+
<component
|
|
205
|
+
:is="component"
|
|
206
|
+
ref="buttonRef"
|
|
207
|
+
:to="routerLinkTo"
|
|
208
|
+
class="z-0 relative inline-flex items-center justify-center space-x-1 leading-none text-sm border focus:z-10 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-black dark:focus-visible:outline-white"
|
|
209
|
+
:class="buttonClasses"
|
|
210
|
+
:disabled="disabled || loading"
|
|
211
|
+
:style="disabledStyle"
|
|
212
|
+
@click="onClick"
|
|
213
|
+
@blur="emit('blur')"
|
|
214
|
+
>
|
|
215
|
+
<BLoadSpinner v-if="loading" :class="loadSpinnerClass" />
|
|
216
|
+
<BIcon v-else-if="icon" :name="icon" />
|
|
217
|
+
<div v-if="label">
|
|
218
|
+
{{ label }}
|
|
219
|
+
</div>
|
|
220
|
+
<BIcon v-if="iconAfter" :name="iconAfter" class="opacity-75" />
|
|
221
|
+
<NotificationBadge v-if="notification" :inside="variant === 'text' || variant === 'textSubtle'" />
|
|
222
|
+
</component>
|
|
223
|
+
</BTooltip>
|
|
224
|
+
<component
|
|
225
|
+
:is="component"
|
|
226
|
+
v-else
|
|
227
|
+
ref="buttonRef"
|
|
228
|
+
:to="routerLinkTo"
|
|
229
|
+
:target="props.linkTarget"
|
|
230
|
+
class="z-0 relative inline-flex items-center justify-center space-x-1 leading-none text-sm border focus:z-10 focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-black dark:focus-visible:outline-white"
|
|
231
|
+
:class="buttonClasses"
|
|
232
|
+
:disabled="disabled || loading"
|
|
233
|
+
:style="disabledStyle"
|
|
234
|
+
@click="onClick"
|
|
235
|
+
@blur="emit('blur')"
|
|
236
|
+
>
|
|
237
|
+
<BLoadSpinner v-if="loading" :class="loadSpinnerClass" />
|
|
238
|
+
<BIcon v-else-if="icon" :name="icon" />
|
|
239
|
+
<div v-if="label">
|
|
240
|
+
{{ label }}
|
|
241
|
+
</div>
|
|
242
|
+
<BIcon v-if="iconAfter" :name="iconAfter" />
|
|
243
|
+
<NotificationBadge v-if="notification" :inside="variant === 'text' || variant === 'textSubtle'" />
|
|
244
|
+
</component>
|
|
245
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{ inside?: boolean }>();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<div
|
|
7
|
+
class="absolute"
|
|
8
|
+
:style="{
|
|
9
|
+
top: inside ? '0.15em' : '-0.3em',
|
|
10
|
+
right: inside ? '0.15em' : '-0.3em',
|
|
11
|
+
}"
|
|
12
|
+
>
|
|
13
|
+
<div class="w-3 h-3 bg-orange-500 rounded-full border border-white" />
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BButton } from "./Button.vue";
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { TButtonGroupOrientation } from "../types";
|
|
3
|
+
import { onMounted, provide, ref } from "vue";
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(
|
|
6
|
+
defineProps<{
|
|
7
|
+
direction?: TButtonGroupOrientation;
|
|
8
|
+
fullwidth?: boolean;
|
|
9
|
+
}>(),
|
|
10
|
+
{
|
|
11
|
+
direction: "horizontal",
|
|
12
|
+
fullwidth: false,
|
|
13
|
+
},
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
const classes = ref<string>("");
|
|
17
|
+
const buttonGroupRef = ref<HTMLDivElement>();
|
|
18
|
+
|
|
19
|
+
provide("childOfButtonGroup", true);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* We need to update (reapply) the classes whenever a button in the group is clicked,
|
|
23
|
+
* as its classes from within the button component might be updated and thus the classes applied here will be overwritten
|
|
24
|
+
*/
|
|
25
|
+
const update = () => {
|
|
26
|
+
const result = [];
|
|
27
|
+
|
|
28
|
+
props.fullwidth ? result.push("flex w-full") : result.push("inline-flex");
|
|
29
|
+
|
|
30
|
+
if (props.direction === "vertical") {
|
|
31
|
+
result.push("flex-col items-stretch");
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
result.push("items-center");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
classes.value = result.join(" ");
|
|
38
|
+
|
|
39
|
+
// add classes to immediate children of button group
|
|
40
|
+
// the buttons inside the group might be wrapped in other elements if tooltip or popper is used
|
|
41
|
+
if (buttonGroupRef.value) {
|
|
42
|
+
Array.from(buttonGroupRef.value.children).forEach((child: Element, index: number) => {
|
|
43
|
+
if (props.direction === "vertical") {
|
|
44
|
+
child.classList.add("-mt-px");
|
|
45
|
+
child.classList.add("first:mt-0");
|
|
46
|
+
|
|
47
|
+
if (index === 0) {
|
|
48
|
+
if (child.nodeName === "BUTTON") {
|
|
49
|
+
child.classList.add("rounded-t-md");
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
child.querySelector("button")?.classList.add("rounded-t-md");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
else if (index === buttonGroupRef.value!.children.length - 1) {
|
|
56
|
+
if (child.nodeName === "BUTTON") {
|
|
57
|
+
child.classList.add("rounded-b-md");
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
child.querySelector("button")?.classList.add("rounded-b-md");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
child.classList.add("-ml-px");
|
|
66
|
+
child.classList.add("first:ml-0");
|
|
67
|
+
|
|
68
|
+
// TODO: if child is button, do not query for it
|
|
69
|
+
if (index === 0) {
|
|
70
|
+
if (child.nodeName === "BUTTON") {
|
|
71
|
+
child.classList.add("rounded-l-md");
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
child.querySelector("button")?.classList.add("rounded-l-md");
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
else if (index === buttonGroupRef.value!.children.length - 1) {
|
|
78
|
+
if (child.nodeName === "BUTTON") {
|
|
79
|
+
child.classList.add("rounded-r-md");
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
child.querySelector("button")?.classList.add("rounded-r-md");
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
onMounted(update);
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<template>
|
|
94
|
+
<div ref="buttonGroupRef" :class="classes" @click.stop.prevent="update">
|
|
95
|
+
<slot />
|
|
96
|
+
</div>
|
|
97
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BButtonGroup } from "./ButtonGroup.vue";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import CircleIndicator from "./CircleIndicator.vue";
|
|
3
|
+
import DefaultIndicator from "./DefaultIndicator.vue";
|
|
4
|
+
|
|
5
|
+
withDefaults(
|
|
6
|
+
defineProps<{
|
|
7
|
+
button?: boolean;
|
|
8
|
+
label?: string;
|
|
9
|
+
type?: "default" | "circle";
|
|
10
|
+
value?: number;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}>(),
|
|
13
|
+
{
|
|
14
|
+
button: false,
|
|
15
|
+
type: "default",
|
|
16
|
+
value: 0,
|
|
17
|
+
disabled: false,
|
|
18
|
+
},
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const emit = defineEmits(["click"]);
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<div
|
|
26
|
+
class="items-center space-x-2"
|
|
27
|
+
:class="{
|
|
28
|
+
'flex': !button,
|
|
29
|
+
'inline-flex border rounded-md h-8 px-3': button,
|
|
30
|
+
'border-action': value && !disabled,
|
|
31
|
+
'border-default': !value && !disabled,
|
|
32
|
+
'border-subtle cursor-default': disabled,
|
|
33
|
+
'cursor-pointer': !disabled,
|
|
34
|
+
}"
|
|
35
|
+
@click.stop.prevent="!disabled && emit('click')"
|
|
36
|
+
>
|
|
37
|
+
<DefaultIndicator v-if="type === 'default'" :value="value" :disabled="disabled" />
|
|
38
|
+
<CircleIndicator v-else :value="value" :disabled="disabled" />
|
|
39
|
+
<span
|
|
40
|
+
v-if="label"
|
|
41
|
+
class="block text-sm leading-tight select-none"
|
|
42
|
+
:class="{
|
|
43
|
+
'text-action': button && value,
|
|
44
|
+
'text-secondary': button && !value && !disabled,
|
|
45
|
+
'hover:underline': !button && !disabled,
|
|
46
|
+
'text-tertiary': disabled,
|
|
47
|
+
}"
|
|
48
|
+
>
|
|
49
|
+
{{ label }}
|
|
50
|
+
</span>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { BIcon } from "../";
|
|
4
|
+
|
|
5
|
+
const { value, disabled } = defineProps<{ value: number; disabled: boolean }>();
|
|
6
|
+
|
|
7
|
+
const icon = computed(() => {
|
|
8
|
+
if (value) {
|
|
9
|
+
return value === 1 ? "check" : "dash";
|
|
10
|
+
}
|
|
11
|
+
return null;
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<button
|
|
17
|
+
class="group inline-flex items-center justify-center w-6 h-6 rounded-full border focus:outline-hidden focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-black dark:focus-visible:outline-white"
|
|
18
|
+
:class="{
|
|
19
|
+
'border-action bg-action text-white': !disabled && value,
|
|
20
|
+
'border-strong bg-tertiary text-white cursor-default': disabled && value,
|
|
21
|
+
'border-default bg-secondary hover:bg-secondary cursor-pointer': disabled && !value,
|
|
22
|
+
'border-default bg-primary hover:bg-amber-300 cursor-pointer': !disabled && !value,
|
|
23
|
+
}"
|
|
24
|
+
>
|
|
25
|
+
<BIcon v-if="icon" :name="icon" class="text-white group-hover:text-muted" />
|
|
26
|
+
</button>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
defineProps<{ value: number; disabled: boolean }>();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<button
|
|
7
|
+
class="flex items-center justify-center w-4 h-4 border rounded focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-black dark:focus-visible:outline-white"
|
|
8
|
+
:class="{
|
|
9
|
+
'border-action bg-action': value && !disabled,
|
|
10
|
+
'bg-primary border-default': !value && !disabled,
|
|
11
|
+
'border-default bg-secondary': disabled && value,
|
|
12
|
+
'border-subtle bg-tertiary': disabled && !value,
|
|
13
|
+
'cursor-default': disabled,
|
|
14
|
+
'hover:border-action focus:border-actionLightActive focus:outline-hidden': !disabled,
|
|
15
|
+
}"
|
|
16
|
+
>
|
|
17
|
+
<svg v-if="value === 1" width="10" height="8" viewBox="0 0 10 8" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
18
|
+
<path d="M8.41166 0.5L10 2.0417L4.01353 7.5L0 3.57411L1.60557 2.04932L4.02897 4.39988L8.41166 0.5Z" fill="white" />
|
|
19
|
+
</svg>
|
|
20
|
+
<div v-if="value === 2" class="w-2 bg-primary" style="height: 2px" />
|
|
21
|
+
</button>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BCheckbox } from "./Checkbox.vue";
|