@bigbot-community/bigbot-ui 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/braip-ui.cjs +2 -0
- package/dist/braip-ui.cjs.map +1 -0
- package/dist/braip-ui.js +2502 -0
- package/dist/braip-ui.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/types/components/atoms/BrAvatar/BrAvatar.vue.d.ts +9 -0
- package/dist/types/components/atoms/BrAvatar/BrAvatar.vue.d.ts.map +1 -0
- package/dist/types/components/atoms/BrAvatar/index.d.ts +3 -0
- package/dist/types/components/atoms/BrAvatar/index.d.ts.map +1 -0
- package/dist/types/components/atoms/BrAvatar/types.d.ts +37 -0
- package/dist/types/components/atoms/BrAvatar/types.d.ts.map +1 -0
- package/dist/types/components/atoms/BrBadge/BrBadge.test.d.ts +2 -0
- package/dist/types/components/atoms/BrBadge/BrBadge.test.d.ts.map +1 -0
- package/dist/types/components/atoms/BrBadge/BrBadge.vue.d.ts +18 -0
- package/dist/types/components/atoms/BrBadge/BrBadge.vue.d.ts.map +1 -0
- package/dist/types/components/atoms/BrBadge/index.d.ts +3 -0
- package/dist/types/components/atoms/BrBadge/index.d.ts.map +1 -0
- package/dist/types/components/atoms/BrBadge/types.d.ts +20 -0
- package/dist/types/components/atoms/BrBadge/types.d.ts.map +1 -0
- package/dist/types/components/atoms/BrButton/BrButton.test.d.ts +2 -0
- package/dist/types/components/atoms/BrButton/BrButton.test.d.ts.map +1 -0
- package/dist/types/components/atoms/BrButton/BrButton.vue.d.ts +25 -0
- package/dist/types/components/atoms/BrButton/BrButton.vue.d.ts.map +1 -0
- package/dist/types/components/atoms/BrButton/index.d.ts +3 -0
- package/dist/types/components/atoms/BrButton/index.d.ts.map +1 -0
- package/dist/types/components/atoms/BrButton/types.d.ts +35 -0
- package/dist/types/components/atoms/BrButton/types.d.ts.map +1 -0
- package/dist/types/components/atoms/BrCheckbox/BrCheckbox.test.d.ts +2 -0
- package/dist/types/components/atoms/BrCheckbox/BrCheckbox.test.d.ts.map +1 -0
- package/dist/types/components/atoms/BrCheckbox/BrCheckbox.vue.d.ts +29 -0
- package/dist/types/components/atoms/BrCheckbox/BrCheckbox.vue.d.ts.map +1 -0
- package/dist/types/components/atoms/BrCheckbox/BrCheckboxGroup.vue.d.ts +17 -0
- package/dist/types/components/atoms/BrCheckbox/BrCheckboxGroup.vue.d.ts.map +1 -0
- package/dist/types/components/atoms/BrCheckbox/index.d.ts +4 -0
- package/dist/types/components/atoms/BrCheckbox/index.d.ts.map +1 -0
- package/dist/types/components/atoms/BrCheckbox/types.d.ts +86 -0
- package/dist/types/components/atoms/BrCheckbox/types.d.ts.map +1 -0
- package/dist/types/components/atoms/BrImage/BrImage.vue.d.ts +9 -0
- package/dist/types/components/atoms/BrImage/BrImage.vue.d.ts.map +1 -0
- package/dist/types/components/atoms/BrImage/index.d.ts +3 -0
- package/dist/types/components/atoms/BrImage/index.d.ts.map +1 -0
- package/dist/types/components/atoms/BrImage/types.d.ts +43 -0
- package/dist/types/components/atoms/BrImage/types.d.ts.map +1 -0
- package/dist/types/components/atoms/BrInput/BrInput.test.d.ts +2 -0
- package/dist/types/components/atoms/BrInput/BrInput.test.d.ts.map +1 -0
- package/dist/types/components/atoms/BrInput/BrInput.vue.d.ts +35 -0
- package/dist/types/components/atoms/BrInput/BrInput.vue.d.ts.map +1 -0
- package/dist/types/components/atoms/BrInput/index.d.ts +3 -0
- package/dist/types/components/atoms/BrInput/index.d.ts.map +1 -0
- package/dist/types/components/atoms/BrInput/types.d.ts +55 -0
- package/dist/types/components/atoms/BrInput/types.d.ts.map +1 -0
- package/dist/types/components/atoms/BrProgressbar/BrProgressbar.vue.d.ts +15 -0
- package/dist/types/components/atoms/BrProgressbar/BrProgressbar.vue.d.ts.map +1 -0
- package/dist/types/components/atoms/BrProgressbar/index.d.ts +3 -0
- package/dist/types/components/atoms/BrProgressbar/index.d.ts.map +1 -0
- package/dist/types/components/atoms/BrProgressbar/types.d.ts +55 -0
- package/dist/types/components/atoms/BrProgressbar/types.d.ts.map +1 -0
- package/dist/types/components/atoms/BrRadio/BrRadio.vue.d.ts +26 -0
- package/dist/types/components/atoms/BrRadio/BrRadio.vue.d.ts.map +1 -0
- package/dist/types/components/atoms/BrRadio/BrRadioGroup.vue.d.ts +17 -0
- package/dist/types/components/atoms/BrRadio/BrRadioGroup.vue.d.ts.map +1 -0
- package/dist/types/components/atoms/BrRadio/index.d.ts +4 -0
- package/dist/types/components/atoms/BrRadio/index.d.ts.map +1 -0
- package/dist/types/components/atoms/BrRadio/types.d.ts +77 -0
- package/dist/types/components/atoms/BrRadio/types.d.ts.map +1 -0
- package/dist/types/components/atoms/BrRating/BrRating.vue.d.ts +21 -0
- package/dist/types/components/atoms/BrRating/BrRating.vue.d.ts.map +1 -0
- package/dist/types/components/atoms/BrRating/index.d.ts +3 -0
- package/dist/types/components/atoms/BrRating/index.d.ts.map +1 -0
- package/dist/types/components/atoms/BrRating/types.d.ts +51 -0
- package/dist/types/components/atoms/BrRating/types.d.ts.map +1 -0
- package/dist/types/components/atoms/BrSelect/BrSelect.vue.d.ts +27 -0
- package/dist/types/components/atoms/BrSelect/BrSelect.vue.d.ts.map +1 -0
- package/dist/types/components/atoms/BrSelect/index.d.ts +3 -0
- package/dist/types/components/atoms/BrSelect/index.d.ts.map +1 -0
- package/dist/types/components/atoms/BrSelect/types.d.ts +52 -0
- package/dist/types/components/atoms/BrSelect/types.d.ts.map +1 -0
- package/dist/types/components/atoms/BrSpinner/BrSpinner.vue.d.ts +8 -0
- package/dist/types/components/atoms/BrSpinner/BrSpinner.vue.d.ts.map +1 -0
- package/dist/types/components/atoms/BrSpinner/index.d.ts +3 -0
- package/dist/types/components/atoms/BrSpinner/index.d.ts.map +1 -0
- package/dist/types/components/atoms/BrSpinner/types.d.ts +20 -0
- package/dist/types/components/atoms/BrSpinner/types.d.ts.map +1 -0
- package/dist/types/components/atoms/BrSwitch/BrSwitch.test.d.ts +2 -0
- package/dist/types/components/atoms/BrSwitch/BrSwitch.test.d.ts.map +1 -0
- package/dist/types/components/atoms/BrSwitch/BrSwitch.vue.d.ts +15 -0
- package/dist/types/components/atoms/BrSwitch/BrSwitch.vue.d.ts.map +1 -0
- package/dist/types/components/atoms/BrSwitch/index.d.ts +3 -0
- package/dist/types/components/atoms/BrSwitch/index.d.ts.map +1 -0
- package/dist/types/components/atoms/BrSwitch/types.d.ts +14 -0
- package/dist/types/components/atoms/BrSwitch/types.d.ts.map +1 -0
- package/dist/types/components/atoms/BrTextarea/BrTextarea.vue.d.ts +31 -0
- package/dist/types/components/atoms/BrTextarea/BrTextarea.vue.d.ts.map +1 -0
- package/dist/types/components/atoms/BrTextarea/index.d.ts +3 -0
- package/dist/types/components/atoms/BrTextarea/index.d.ts.map +1 -0
- package/dist/types/components/atoms/BrTextarea/types.d.ts +37 -0
- package/dist/types/components/atoms/BrTextarea/types.d.ts.map +1 -0
- package/dist/types/components/atoms/BrTitle/BrTitle.vue.d.ts +22 -0
- package/dist/types/components/atoms/BrTitle/BrTitle.vue.d.ts.map +1 -0
- package/dist/types/components/atoms/BrTitle/index.d.ts +3 -0
- package/dist/types/components/atoms/BrTitle/index.d.ts.map +1 -0
- package/dist/types/components/atoms/BrTitle/types.d.ts +41 -0
- package/dist/types/components/atoms/BrTitle/types.d.ts.map +1 -0
- package/dist/types/components/atoms/BrVideo/BrVideo.vue.d.ts +39 -0
- package/dist/types/components/atoms/BrVideo/BrVideo.vue.d.ts.map +1 -0
- package/dist/types/components/atoms/BrVideo/index.d.ts +3 -0
- package/dist/types/components/atoms/BrVideo/index.d.ts.map +1 -0
- package/dist/types/components/atoms/BrVideo/types.d.ts +48 -0
- package/dist/types/components/atoms/BrVideo/types.d.ts.map +1 -0
- package/dist/types/components/atoms/index.d.ts +16 -0
- package/dist/types/components/atoms/index.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +4 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/components/molecules/BrAccordion/BrAccordion.vue.d.ts +23 -0
- package/dist/types/components/molecules/BrAccordion/BrAccordion.vue.d.ts.map +1 -0
- package/dist/types/components/molecules/BrAccordion/BrAccordionItem.vue.d.ts +20 -0
- package/dist/types/components/molecules/BrAccordion/BrAccordionItem.vue.d.ts.map +1 -0
- package/dist/types/components/molecules/BrAccordion/index.d.ts +4 -0
- package/dist/types/components/molecules/BrAccordion/index.d.ts.map +1 -0
- package/dist/types/components/molecules/BrAccordion/types.d.ts +72 -0
- package/dist/types/components/molecules/BrAccordion/types.d.ts.map +1 -0
- package/dist/types/components/molecules/BrCalendar/BrCalendar.vue.d.ts +21 -0
- package/dist/types/components/molecules/BrCalendar/BrCalendar.vue.d.ts.map +1 -0
- package/dist/types/components/molecules/BrCalendar/index.d.ts +3 -0
- package/dist/types/components/molecules/BrCalendar/index.d.ts.map +1 -0
- package/dist/types/components/molecules/BrCalendar/types.d.ts +68 -0
- package/dist/types/components/molecules/BrCalendar/types.d.ts.map +1 -0
- package/dist/types/components/molecules/BrCard/BrCard.vue.d.ts +35 -0
- package/dist/types/components/molecules/BrCard/BrCard.vue.d.ts.map +1 -0
- package/dist/types/components/molecules/BrCard/index.d.ts +3 -0
- package/dist/types/components/molecules/BrCard/index.d.ts.map +1 -0
- package/dist/types/components/molecules/BrCard/types.d.ts +61 -0
- package/dist/types/components/molecules/BrCard/types.d.ts.map +1 -0
- package/dist/types/components/molecules/BrFormField/BrFormField.vue.d.ts +24 -0
- package/dist/types/components/molecules/BrFormField/BrFormField.vue.d.ts.map +1 -0
- package/dist/types/components/molecules/BrFormField/index.d.ts +3 -0
- package/dist/types/components/molecules/BrFormField/index.d.ts.map +1 -0
- package/dist/types/components/molecules/BrFormField/types.d.ts +55 -0
- package/dist/types/components/molecules/BrFormField/types.d.ts.map +1 -0
- package/dist/types/components/molecules/BrModal/BrModal.test.d.ts +2 -0
- package/dist/types/components/molecules/BrModal/BrModal.test.d.ts.map +1 -0
- package/dist/types/components/molecules/BrModal/BrModal.vue.d.ts +43 -0
- package/dist/types/components/molecules/BrModal/BrModal.vue.d.ts.map +1 -0
- package/dist/types/components/molecules/BrModal/index.d.ts +3 -0
- package/dist/types/components/molecules/BrModal/index.d.ts.map +1 -0
- package/dist/types/components/molecules/BrModal/types.d.ts +49 -0
- package/dist/types/components/molecules/BrModal/types.d.ts.map +1 -0
- package/dist/types/components/molecules/BrStepper/BrStepper.vue.d.ts +22 -0
- package/dist/types/components/molecules/BrStepper/BrStepper.vue.d.ts.map +1 -0
- package/dist/types/components/molecules/BrStepper/index.d.ts +3 -0
- package/dist/types/components/molecules/BrStepper/index.d.ts.map +1 -0
- package/dist/types/components/molecules/BrStepper/types.d.ts +65 -0
- package/dist/types/components/molecules/BrStepper/types.d.ts.map +1 -0
- package/dist/types/components/molecules/BrTabs/BrTab.vue.d.ts +23 -0
- package/dist/types/components/molecules/BrTabs/BrTab.vue.d.ts.map +1 -0
- package/dist/types/components/molecules/BrTabs/BrTabPanel.vue.d.ts +16 -0
- package/dist/types/components/molecules/BrTabs/BrTabPanel.vue.d.ts.map +1 -0
- package/dist/types/components/molecules/BrTabs/BrTabs.test.d.ts +2 -0
- package/dist/types/components/molecules/BrTabs/BrTabs.test.d.ts.map +1 -0
- package/dist/types/components/molecules/BrTabs/BrTabs.vue.d.ts +40 -0
- package/dist/types/components/molecules/BrTabs/BrTabs.vue.d.ts.map +1 -0
- package/dist/types/components/molecules/BrTabs/index.d.ts +5 -0
- package/dist/types/components/molecules/BrTabs/index.d.ts.map +1 -0
- package/dist/types/components/molecules/BrTabs/types.d.ts +116 -0
- package/dist/types/components/molecules/BrTabs/types.d.ts.map +1 -0
- package/dist/types/components/molecules/index.d.ts +8 -0
- package/dist/types/components/molecules/index.d.ts.map +1 -0
- package/dist/types/components/organisms/BrNavbar/BrNavbar.vue.d.ts +28 -0
- package/dist/types/components/organisms/BrNavbar/BrNavbar.vue.d.ts.map +1 -0
- package/dist/types/components/organisms/BrNavbar/index.d.ts +3 -0
- package/dist/types/components/organisms/BrNavbar/index.d.ts.map +1 -0
- package/dist/types/components/organisms/BrNavbar/types.d.ts +84 -0
- package/dist/types/components/organisms/BrNavbar/types.d.ts.map +1 -0
- package/dist/types/components/organisms/BrSidebar/BrSidebar.vue.d.ts +35 -0
- package/dist/types/components/organisms/BrSidebar/BrSidebar.vue.d.ts.map +1 -0
- package/dist/types/components/organisms/BrSidebar/index.d.ts +3 -0
- package/dist/types/components/organisms/BrSidebar/index.d.ts.map +1 -0
- package/dist/types/components/organisms/BrSidebar/types.d.ts +100 -0
- package/dist/types/components/organisms/BrSidebar/types.d.ts.map +1 -0
- package/dist/types/components/organisms/index.d.ts +3 -0
- package/dist/types/components/organisms/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/plugin.d.ts +9 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +48 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/package.json +77 -0
- package/src/assets/icons/airplane.svg +7 -0
- package/src/assets/icons/anchor.svg +6 -0
- package/src/assets/icons/arrow-bottom-right-o.svg +9 -0
- package/src/assets/icons/arrow-bottom-right-r.svg +9 -0
- package/src/assets/icons/arrow-bottom-right.svg +7 -0
- package/src/assets/icons/arrow-down-o.svg +9 -0
- package/src/assets/icons/arrow-down-r.svg +9 -0
- package/src/assets/icons/arrow-down.svg +7 -0
- package/src/assets/icons/arrow-left-o.svg +9 -0
- package/src/assets/icons/arrow-left-r.svg +9 -0
- package/src/assets/icons/arrow-left.svg +7 -0
- package/src/assets/icons/arrow-long-up.svg +7 -0
- package/src/assets/icons/arrow-right-o.svg +9 -0
- package/src/assets/icons/arrow-right-r.svg +9 -0
- package/src/assets/icons/arrow-right.svg +7 -0
- package/src/assets/icons/arrow-top-left-o.svg +9 -0
- package/src/assets/icons/arrow-top-left-r.svg +9 -0
- package/src/assets/icons/arrow-top-left.svg +7 -0
- package/src/assets/icons/arrow-top-right-o.svg +9 -0
- package/src/assets/icons/arrow-top-right-r.svg +9 -0
- package/src/assets/icons/arrow-top-right.svg +7 -0
- package/src/assets/icons/arrow-up-o.svg +9 -0
- package/src/assets/icons/arrow-up-r.svg +9 -0
- package/src/assets/icons/arrow-up.svg +7 -0
- package/src/assets/icons/awards.svg +6 -0
- package/src/assets/icons/band-aid.svg +21 -0
- package/src/assets/icons/bee.svg +7 -0
- package/src/assets/icons/bitbucket.svg +7 -0
- package/src/assets/icons/block.svg +11 -0
- package/src/assets/icons/bowl.svg +6 -0
- package/src/assets/icons/boy.svg +14 -0
- package/src/assets/icons/briefcase.svg +9 -0
- package/src/assets/icons/browse.svg +13 -0
- package/src/assets/icons/brush.svg +6 -0
- package/src/assets/icons/calibrate.svg +11 -0
- package/src/assets/icons/cap.svg +9 -0
- package/src/assets/icons/card-clubs.svg +17 -0
- package/src/assets/icons/card-diamonds.svg +9 -0
- package/src/assets/icons/card-hearts.svg +11 -0
- package/src/assets/icons/card-spades.svg +11 -0
- package/src/assets/icons/check-o.svg +9 -0
- package/src/assets/icons/check-r.svg +9 -0
- package/src/assets/icons/check.svg +3 -0
- package/src/assets/icons/chevron-double-down-o.svg +14 -0
- package/src/assets/icons/chevron-double-down-r.svg +14 -0
- package/src/assets/icons/chevron-double-down.svg +12 -0
- package/src/assets/icons/chevron-double-left-o.svg +14 -0
- package/src/assets/icons/chevron-double-left-r.svg +14 -0
- package/src/assets/icons/chevron-double-left.svg +12 -0
- package/src/assets/icons/chevron-double-right-o.svg +14 -0
- package/src/assets/icons/chevron-double-right-r.svg +14 -0
- package/src/assets/icons/chevron-double-right.svg +12 -0
- package/src/assets/icons/pix.svg +7 -0
- package/src/assets/icons/push-chevron-left-o.svg +12 -0
- package/src/assets/icons/push-chevron-left-r.svg +12 -0
- package/src/assets/icons/push-chevron-left.svg +10 -0
- package/src/assets/icons/push-chevron-right-o.svg +12 -0
- package/src/assets/icons/push-chevron-right-r.svg +12 -0
- package/src/assets/icons/push-chevron-right.svg +10 -0
- package/src/assets/icons/push-chevron-up-o.svg +6 -0
- package/src/assets/icons/push-chevron-up-r.svg +6 -0
- package/src/assets/icons/push-chevron-up.svg +10 -0
- package/src/assets/icons/sync.svg +12 -0
- package/src/assets/icons/trending-down.svg +7 -0
- package/src/assets/icons/trending.svg +7 -0
- package/src/components/atoms/BrAvatar/BrAvatar.vue +154 -0
- package/src/components/atoms/BrAvatar/index.ts +2 -0
- package/src/components/atoms/BrAvatar/types.ts +43 -0
- package/src/components/atoms/BrBadge/BrBadge.test.ts +61 -0
- package/src/components/atoms/BrBadge/BrBadge.vue +125 -0
- package/src/components/atoms/BrBadge/index.ts +2 -0
- package/src/components/atoms/BrBadge/types.ts +22 -0
- package/src/components/atoms/BrButton/BrButton.test.ts +79 -0
- package/src/components/atoms/BrButton/BrButton.vue +291 -0
- package/src/components/atoms/BrButton/index.ts +2 -0
- package/src/components/atoms/BrButton/types.ts +44 -0
- package/src/components/atoms/BrCheckbox/BrCheckbox.test.ts +132 -0
- package/src/components/atoms/BrCheckbox/BrCheckbox.vue +198 -0
- package/src/components/atoms/BrCheckbox/BrCheckboxGroup.vue +92 -0
- package/src/components/atoms/BrCheckbox/index.ts +3 -0
- package/src/components/atoms/BrCheckbox/types.ts +102 -0
- package/src/components/atoms/BrImage/BrImage.vue +134 -0
- package/src/components/atoms/BrImage/index.ts +2 -0
- package/src/components/atoms/BrImage/types.ts +51 -0
- package/src/components/atoms/BrInput/BrInput.test.ts +98 -0
- package/src/components/atoms/BrInput/BrInput.vue +215 -0
- package/src/components/atoms/BrInput/index.ts +2 -0
- package/src/components/atoms/BrInput/types.ts +65 -0
- package/src/components/atoms/BrProgressbar/BrProgressbar.vue +204 -0
- package/src/components/atoms/BrProgressbar/index.ts +2 -0
- package/src/components/atoms/BrProgressbar/types.ts +64 -0
- package/src/components/atoms/BrRadio/BrRadio.vue +175 -0
- package/src/components/atoms/BrRadio/BrRadioGroup.vue +77 -0
- package/src/components/atoms/BrRadio/index.ts +3 -0
- package/src/components/atoms/BrRadio/types.ts +91 -0
- package/src/components/atoms/BrRating/BrRating.vue +234 -0
- package/src/components/atoms/BrRating/index.ts +2 -0
- package/src/components/atoms/BrRating/types.ts +60 -0
- package/src/components/atoms/BrSelect/BrSelect.vue +408 -0
- package/src/components/atoms/BrSelect/index.ts +2 -0
- package/src/components/atoms/BrSelect/types.ts +61 -0
- package/src/components/atoms/BrSpinner/BrSpinner.vue +125 -0
- package/src/components/atoms/BrSpinner/index.ts +2 -0
- package/src/components/atoms/BrSpinner/types.ts +22 -0
- package/src/components/atoms/BrSwitch/BrSwitch.test.ts +81 -0
- package/src/components/atoms/BrSwitch/BrSwitch.vue +181 -0
- package/src/components/atoms/BrSwitch/index.ts +2 -0
- package/src/components/atoms/BrSwitch/types.ts +15 -0
- package/src/components/atoms/BrTextarea/BrTextarea.vue +179 -0
- package/src/components/atoms/BrTextarea/index.ts +2 -0
- package/src/components/atoms/BrTextarea/types.ts +43 -0
- package/src/components/atoms/BrTitle/BrTitle.vue +154 -0
- package/src/components/atoms/BrTitle/index.ts +2 -0
- package/src/components/atoms/BrTitle/types.ts +47 -0
- package/src/components/atoms/BrVideo/BrVideo.vue +135 -0
- package/src/components/atoms/BrVideo/index.ts +2 -0
- package/src/components/atoms/BrVideo/types.ts +56 -0
- package/src/components/atoms/index.ts +20 -0
- package/src/components/index.ts +7 -0
- package/src/components/molecules/BrAccordion/BrAccordion.vue +112 -0
- package/src/components/molecules/BrAccordion/BrAccordionItem.vue +168 -0
- package/src/components/molecules/BrAccordion/index.ts +3 -0
- package/src/components/molecules/BrAccordion/types.ts +85 -0
- package/src/components/molecules/BrCalendar/BrCalendar.vue +553 -0
- package/src/components/molecules/BrCalendar/index.ts +2 -0
- package/src/components/molecules/BrCalendar/types.ts +80 -0
- package/src/components/molecules/BrCard/BrCard.vue +262 -0
- package/src/components/molecules/BrCard/index.ts +2 -0
- package/src/components/molecules/BrCard/types.ts +72 -0
- package/src/components/molecules/BrFormField/BrFormField.vue +241 -0
- package/src/components/molecules/BrFormField/index.ts +2 -0
- package/src/components/molecules/BrFormField/types.ts +64 -0
- package/src/components/molecules/BrModal/BrModal.test.ts +212 -0
- package/src/components/molecules/BrModal/BrModal.vue +404 -0
- package/src/components/molecules/BrModal/index.ts +2 -0
- package/src/components/molecules/BrModal/types.ts +57 -0
- package/src/components/molecules/BrStepper/BrStepper.vue +302 -0
- package/src/components/molecules/BrStepper/index.ts +2 -0
- package/src/components/molecules/BrStepper/types.ts +77 -0
- package/src/components/molecules/BrTabs/BrTab.vue +69 -0
- package/src/components/molecules/BrTabs/BrTabPanel.vue +36 -0
- package/src/components/molecules/BrTabs/BrTabs.test.ts +168 -0
- package/src/components/molecules/BrTabs/BrTabs.vue +319 -0
- package/src/components/molecules/BrTabs/index.ts +4 -0
- package/src/components/molecules/BrTabs/types.ts +139 -0
- package/src/components/molecules/index.ts +11 -0
- package/src/components/organisms/BrNavbar/BrNavbar.vue +424 -0
- package/src/components/organisms/BrNavbar/index.ts +2 -0
- package/src/components/organisms/BrNavbar/types.ts +101 -0
- package/src/components/organisms/BrSidebar/BrSidebar.vue +382 -0
- package/src/components/organisms/BrSidebar/index.ts +2 -0
- package/src/components/organisms/BrSidebar/types.ts +121 -0
- package/src/components/organisms/index.ts +6 -0
- package/src/index.ts +32 -0
- package/src/plugin.ts +61 -0
- package/src/styles/base/_animations.scss +187 -0
- package/src/styles/base/_reset.scss +109 -0
- package/src/styles/base/index.scss +6 -0
- package/src/styles/main.scss +9 -0
- package/src/styles/tokens/_colors.scss +185 -0
- package/src/styles/tokens/_spacing.scss +88 -0
- package/src/styles/tokens/_typography.scss +77 -0
- package/src/styles/tokens/index.scss +7 -0
- package/src/types/index.ts +125 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { mount } from '@vue/test-utils'
|
|
3
|
+
import BrCheckbox from './BrCheckbox.vue'
|
|
4
|
+
|
|
5
|
+
describe('BrCheckbox', () => {
|
|
6
|
+
it('renders as label element', () => {
|
|
7
|
+
const wrapper = mount(BrCheckbox)
|
|
8
|
+
expect(wrapper.element.tagName).toBe('LABEL')
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
it('contains hidden input element', () => {
|
|
12
|
+
const wrapper = mount(BrCheckbox)
|
|
13
|
+
const input = wrapper.find('input[type="checkbox"]')
|
|
14
|
+
expect(input.exists()).toBe(true)
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
it('toggles value on change', async () => {
|
|
18
|
+
let modelValue: boolean = false
|
|
19
|
+
const wrapper = mount(BrCheckbox, {
|
|
20
|
+
props: {
|
|
21
|
+
modelValue,
|
|
22
|
+
'onUpdate:modelValue': (e: unknown) => {
|
|
23
|
+
modelValue = e as boolean
|
|
24
|
+
wrapper.setProps({ modelValue })
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
})
|
|
28
|
+
expect(wrapper.props('modelValue')).toBe(false)
|
|
29
|
+
await wrapper.find('input').trigger('change')
|
|
30
|
+
expect(wrapper.props('modelValue')).toBe(true)
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
it('renders label text', () => {
|
|
34
|
+
const wrapper = mount(BrCheckbox, {
|
|
35
|
+
props: { label: 'Accept terms' },
|
|
36
|
+
})
|
|
37
|
+
expect(wrapper.text()).toContain('Accept terms')
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
it('renders slot content as label', () => {
|
|
41
|
+
const wrapper = mount(BrCheckbox, {
|
|
42
|
+
slots: {
|
|
43
|
+
default: 'Custom label',
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
expect(wrapper.text()).toContain('Custom label')
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
it('applies checked class when checked', () => {
|
|
50
|
+
const wrapper = mount(BrCheckbox, {
|
|
51
|
+
props: { modelValue: true },
|
|
52
|
+
})
|
|
53
|
+
expect(wrapper.classes()).toContain('br-checkbox--checked')
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
it('applies error class when error prop is true', () => {
|
|
57
|
+
const wrapper = mount(BrCheckbox, {
|
|
58
|
+
props: { error: true },
|
|
59
|
+
})
|
|
60
|
+
expect(wrapper.classes()).toContain('br-checkbox--error')
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
it('applies disabled class when disabled', () => {
|
|
64
|
+
const wrapper = mount(BrCheckbox, {
|
|
65
|
+
props: { disabled: true },
|
|
66
|
+
})
|
|
67
|
+
expect(wrapper.classes()).toContain('br-checkbox--disabled')
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
it('does not toggle when disabled', async () => {
|
|
71
|
+
let modelValue: boolean = false
|
|
72
|
+
const wrapper = mount(BrCheckbox, {
|
|
73
|
+
props: {
|
|
74
|
+
modelValue,
|
|
75
|
+
disabled: true,
|
|
76
|
+
'onUpdate:modelValue': (e: unknown) => {
|
|
77
|
+
modelValue = e as boolean
|
|
78
|
+
wrapper.setProps({ modelValue })
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
})
|
|
82
|
+
await wrapper.find('input').trigger('change')
|
|
83
|
+
expect(wrapper.props('modelValue')).toBe(false)
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
it('applies correct size class', () => {
|
|
87
|
+
const sizes = ['sm', 'md', 'lg'] as const
|
|
88
|
+
sizes.forEach((size) => {
|
|
89
|
+
const wrapper = mount(BrCheckbox, {
|
|
90
|
+
props: { size },
|
|
91
|
+
})
|
|
92
|
+
expect(wrapper.classes()).toContain(`br-checkbox--${size}`)
|
|
93
|
+
})
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
it('applies indeterminate class when indeterminate', () => {
|
|
97
|
+
const wrapper = mount(BrCheckbox, {
|
|
98
|
+
props: { indeterminate: true },
|
|
99
|
+
})
|
|
100
|
+
expect(wrapper.classes()).toContain('br-checkbox--indeterminate')
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
it('renders helper text', () => {
|
|
104
|
+
const wrapper = mount(BrCheckbox, {
|
|
105
|
+
props: { helperText: 'This is required' },
|
|
106
|
+
})
|
|
107
|
+
expect(wrapper.text()).toContain('This is required')
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
it('shows check icon when checked', () => {
|
|
111
|
+
const wrapper = mount(BrCheckbox, {
|
|
112
|
+
props: { modelValue: true },
|
|
113
|
+
})
|
|
114
|
+
expect(wrapper.find('.br-checkbox__icon').exists()).toBe(true)
|
|
115
|
+
})
|
|
116
|
+
|
|
117
|
+
it('works with array model for multiple selection', async () => {
|
|
118
|
+
let modelValue: string[] = ['a', 'b']
|
|
119
|
+
const wrapper = mount(BrCheckbox, {
|
|
120
|
+
props: {
|
|
121
|
+
modelValue,
|
|
122
|
+
trueValue: 'c',
|
|
123
|
+
'onUpdate:modelValue': (e: unknown) => {
|
|
124
|
+
modelValue = e as string[]
|
|
125
|
+
wrapper.setProps({ modelValue })
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
})
|
|
129
|
+
await wrapper.find('input').trigger('change')
|
|
130
|
+
expect(wrapper.props('modelValue')).toContain('c')
|
|
131
|
+
})
|
|
132
|
+
})
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref, watch } from 'vue'
|
|
3
|
+
import type { CheckboxProps } from './types'
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(defineProps<CheckboxProps>(), {
|
|
6
|
+
size: 'md',
|
|
7
|
+
disabled: false,
|
|
8
|
+
indeterminate: false,
|
|
9
|
+
error: false,
|
|
10
|
+
trueValue: true,
|
|
11
|
+
falseValue: false,
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
const model = defineModel<string | number | boolean | Array<string | number>>()
|
|
15
|
+
const inputRef = ref<HTMLInputElement | null>(null)
|
|
16
|
+
|
|
17
|
+
const isChecked = computed(() => {
|
|
18
|
+
if (Array.isArray(model.value)) {
|
|
19
|
+
return model.value.includes(props.trueValue as never)
|
|
20
|
+
}
|
|
21
|
+
return model.value === props.trueValue
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const classes = computed(() => [
|
|
25
|
+
'br-checkbox',
|
|
26
|
+
`br-checkbox--${props.size}`,
|
|
27
|
+
{
|
|
28
|
+
'br-checkbox--disabled': props.disabled,
|
|
29
|
+
'br-checkbox--error': props.error,
|
|
30
|
+
'br-checkbox--checked': isChecked.value,
|
|
31
|
+
'br-checkbox--indeterminate': props.indeterminate,
|
|
32
|
+
},
|
|
33
|
+
])
|
|
34
|
+
|
|
35
|
+
watch(
|
|
36
|
+
() => props.indeterminate,
|
|
37
|
+
(val) => {
|
|
38
|
+
if (inputRef.value) {
|
|
39
|
+
inputRef.value.indeterminate = val
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{ immediate: true }
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
function handleChange() {
|
|
46
|
+
if (props.disabled) return
|
|
47
|
+
|
|
48
|
+
if (Array.isArray(model.value)) {
|
|
49
|
+
const newValue = [...model.value]
|
|
50
|
+
const index = newValue.indexOf(props.trueValue as never)
|
|
51
|
+
if (index > -1) {
|
|
52
|
+
newValue.splice(index, 1)
|
|
53
|
+
} else {
|
|
54
|
+
newValue.push(props.trueValue as never)
|
|
55
|
+
}
|
|
56
|
+
model.value = newValue
|
|
57
|
+
} else {
|
|
58
|
+
model.value = isChecked.value ? props.falseValue : props.trueValue
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<template>
|
|
64
|
+
<label :class="classes">
|
|
65
|
+
<input
|
|
66
|
+
ref="inputRef"
|
|
67
|
+
type="checkbox"
|
|
68
|
+
:checked="isChecked"
|
|
69
|
+
:disabled="disabled"
|
|
70
|
+
class="br-checkbox__input"
|
|
71
|
+
@change="handleChange"
|
|
72
|
+
/>
|
|
73
|
+
<span class="br-checkbox__control">
|
|
74
|
+
<svg v-if="isChecked && !indeterminate" viewBox="0 0 24 24" class="br-checkbox__icon">
|
|
75
|
+
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" fill="currentColor" />
|
|
76
|
+
</svg>
|
|
77
|
+
<svg v-else-if="indeterminate" viewBox="0 0 24 24" class="br-checkbox__icon">
|
|
78
|
+
<path d="M19 13H5v-2h14v2z" fill="currentColor" />
|
|
79
|
+
</svg>
|
|
80
|
+
</span>
|
|
81
|
+
<span v-if="label || $slots.default" class="br-checkbox__label">
|
|
82
|
+
<slot>{{ label }}</slot>
|
|
83
|
+
</span>
|
|
84
|
+
<span v-if="helperText" class="br-checkbox__helper">{{ helperText }}</span>
|
|
85
|
+
</label>
|
|
86
|
+
</template>
|
|
87
|
+
|
|
88
|
+
<style lang="scss" scoped>
|
|
89
|
+
.br-checkbox {
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
align-items: flex-start;
|
|
92
|
+
gap: var(--br-space-2);
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
user-select: none;
|
|
95
|
+
|
|
96
|
+
&__input {
|
|
97
|
+
position: absolute;
|
|
98
|
+
opacity: 0;
|
|
99
|
+
width: 0;
|
|
100
|
+
height: 0;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&__control {
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
flex-shrink: 0;
|
|
108
|
+
border: 2px solid var(--br-dark-300);
|
|
109
|
+
border-radius: var(--br-radius-sm);
|
|
110
|
+
background: var(--br-white);
|
|
111
|
+
transition: all var(--br-transition-fast);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&__icon {
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: 100%;
|
|
117
|
+
color: var(--br-white);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&__label {
|
|
121
|
+
color: var(--br-dark-700);
|
|
122
|
+
line-height: 1.4;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&__helper {
|
|
126
|
+
display: block;
|
|
127
|
+
width: 100%;
|
|
128
|
+
margin-top: var(--br-space-1);
|
|
129
|
+
font-size: var(--br-text-sm);
|
|
130
|
+
color: var(--br-dark-500);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Sizes
|
|
134
|
+
&--sm {
|
|
135
|
+
.br-checkbox__control {
|
|
136
|
+
width: 16px;
|
|
137
|
+
height: 16px;
|
|
138
|
+
}
|
|
139
|
+
.br-checkbox__label {
|
|
140
|
+
font-size: var(--br-text-sm);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&--md {
|
|
145
|
+
.br-checkbox__control {
|
|
146
|
+
width: 20px;
|
|
147
|
+
height: 20px;
|
|
148
|
+
}
|
|
149
|
+
.br-checkbox__label {
|
|
150
|
+
font-size: var(--br-text-md);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&--lg {
|
|
155
|
+
.br-checkbox__control {
|
|
156
|
+
width: 24px;
|
|
157
|
+
height: 24px;
|
|
158
|
+
}
|
|
159
|
+
.br-checkbox__label {
|
|
160
|
+
font-size: var(--br-text-lg);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// States
|
|
165
|
+
&:hover:not(&--disabled) {
|
|
166
|
+
.br-checkbox__control {
|
|
167
|
+
border-color: var(--br-primary-500);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
&--checked,
|
|
172
|
+
&--indeterminate {
|
|
173
|
+
.br-checkbox__control {
|
|
174
|
+
background: var(--br-primary-500);
|
|
175
|
+
border-color: var(--br-primary-500);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
&--error {
|
|
180
|
+
.br-checkbox__control {
|
|
181
|
+
border-color: var(--br-danger-500);
|
|
182
|
+
}
|
|
183
|
+
&.br-checkbox--checked .br-checkbox__control,
|
|
184
|
+
&.br-checkbox--indeterminate .br-checkbox__control {
|
|
185
|
+
background: var(--br-danger-500);
|
|
186
|
+
border-color: var(--br-danger-500);
|
|
187
|
+
}
|
|
188
|
+
.br-checkbox__helper {
|
|
189
|
+
color: var(--br-danger-500);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&--disabled {
|
|
194
|
+
cursor: not-allowed;
|
|
195
|
+
opacity: 0.5;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
</style>
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import type { CheckboxGroupProps } from './types'
|
|
4
|
+
import BrCheckbox from './BrCheckbox.vue'
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(defineProps<CheckboxGroupProps>(), {
|
|
7
|
+
direction: 'vertical',
|
|
8
|
+
size: 'md',
|
|
9
|
+
disabled: false,
|
|
10
|
+
error: false,
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
const model = defineModel<Array<string | number>>({ default: () => [] })
|
|
14
|
+
|
|
15
|
+
const classes = computed(() => [
|
|
16
|
+
'br-checkbox-group',
|
|
17
|
+
`br-checkbox-group--${props.direction}`,
|
|
18
|
+
{
|
|
19
|
+
'br-checkbox-group--error': props.error,
|
|
20
|
+
},
|
|
21
|
+
])
|
|
22
|
+
|
|
23
|
+
function isDisabled(option: (typeof props.options)[0]) {
|
|
24
|
+
if (props.disabled || option.disabled) return true
|
|
25
|
+
|
|
26
|
+
// Check max limit
|
|
27
|
+
if (props.max && model.value.length >= props.max && !model.value.includes(option.value)) {
|
|
28
|
+
return true
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Check min limit (prevent unchecking if at minimum)
|
|
32
|
+
if (props.min && model.value.length <= props.min && model.value.includes(option.value)) {
|
|
33
|
+
return true
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return false
|
|
37
|
+
}
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<div :class="classes" role="group" :aria-label="label">
|
|
42
|
+
<span v-if="label" class="br-checkbox-group__label">{{ label }}</span>
|
|
43
|
+
<div class="br-checkbox-group__options">
|
|
44
|
+
<BrCheckbox
|
|
45
|
+
v-for="option in options"
|
|
46
|
+
:key="String(option.value)"
|
|
47
|
+
v-model="model"
|
|
48
|
+
:label="option.label"
|
|
49
|
+
:true-value="option.value"
|
|
50
|
+
:size="size"
|
|
51
|
+
:disabled="isDisabled(option)"
|
|
52
|
+
:error="error"
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
<span v-if="error && errorMessage" class="br-checkbox-group__error">
|
|
56
|
+
{{ errorMessage }}
|
|
57
|
+
</span>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<style lang="scss" scoped>
|
|
62
|
+
.br-checkbox-group {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
gap: var(--br-space-2);
|
|
66
|
+
|
|
67
|
+
&__label {
|
|
68
|
+
font-size: var(--br-text-sm);
|
|
69
|
+
font-weight: var(--br-font-medium);
|
|
70
|
+
color: var(--br-dark-700);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&__options {
|
|
74
|
+
display: flex;
|
|
75
|
+
gap: var(--br-space-3);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&--vertical &__options {
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&--horizontal &__options {
|
|
83
|
+
flex-direction: row;
|
|
84
|
+
flex-wrap: wrap;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&__error {
|
|
88
|
+
font-size: var(--br-text-sm);
|
|
89
|
+
color: var(--br-danger-500);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
</style>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export type CheckboxSize = 'sm' | 'md' | 'lg'
|
|
2
|
+
|
|
3
|
+
export interface CheckboxProps {
|
|
4
|
+
/**
|
|
5
|
+
* Checkbox label
|
|
6
|
+
*/
|
|
7
|
+
label?: string
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Checkbox size
|
|
11
|
+
* @default 'md'
|
|
12
|
+
*/
|
|
13
|
+
size?: CheckboxSize
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Disabled state
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
disabled?: boolean
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Indeterminate state
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
indeterminate?: boolean
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Error state
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
error?: boolean
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Helper text
|
|
35
|
+
*/
|
|
36
|
+
helperText?: string
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Value when checked
|
|
40
|
+
*/
|
|
41
|
+
trueValue?: string | number | boolean
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Value when unchecked
|
|
45
|
+
*/
|
|
46
|
+
falseValue?: string | number | boolean
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface CheckboxGroupProps {
|
|
50
|
+
/**
|
|
51
|
+
* Group label
|
|
52
|
+
*/
|
|
53
|
+
label?: string
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Checkbox options
|
|
57
|
+
*/
|
|
58
|
+
options: Array<{
|
|
59
|
+
value: string | number
|
|
60
|
+
label: string
|
|
61
|
+
disabled?: boolean
|
|
62
|
+
}>
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Layout direction
|
|
66
|
+
* @default 'vertical'
|
|
67
|
+
*/
|
|
68
|
+
direction?: 'horizontal' | 'vertical'
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Checkbox size
|
|
72
|
+
* @default 'md'
|
|
73
|
+
*/
|
|
74
|
+
size?: CheckboxSize
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Disabled state
|
|
78
|
+
* @default false
|
|
79
|
+
*/
|
|
80
|
+
disabled?: boolean
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Error state
|
|
84
|
+
* @default false
|
|
85
|
+
*/
|
|
86
|
+
error?: boolean
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Error message
|
|
90
|
+
*/
|
|
91
|
+
errorMessage?: string
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Minimum selections required
|
|
95
|
+
*/
|
|
96
|
+
min?: number
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Maximum selections allowed
|
|
100
|
+
*/
|
|
101
|
+
max?: number
|
|
102
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, ref, onMounted } from 'vue'
|
|
3
|
+
import type { ImageProps } from './types'
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(defineProps<ImageProps>(), {
|
|
6
|
+
fit: 'cover',
|
|
7
|
+
lazy: true,
|
|
8
|
+
showPlaceholder: true,
|
|
9
|
+
rounded: false,
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
const isLoaded = ref(false)
|
|
13
|
+
const hasError = ref(false)
|
|
14
|
+
const imageRef = ref<HTMLImageElement | null>(null)
|
|
15
|
+
|
|
16
|
+
const classes = computed(() => [
|
|
17
|
+
'br-image',
|
|
18
|
+
{
|
|
19
|
+
'br-image--loading': !isLoaded.value && props.showPlaceholder,
|
|
20
|
+
'br-image--error': hasError.value,
|
|
21
|
+
'br-image--rounded': props.rounded === true,
|
|
22
|
+
[`br-image--rounded-${props.rounded}`]: typeof props.rounded === 'string',
|
|
23
|
+
},
|
|
24
|
+
])
|
|
25
|
+
|
|
26
|
+
const imageStyles = computed(() => ({
|
|
27
|
+
width: typeof props.width === 'number' ? `${props.width}px` : props.width,
|
|
28
|
+
height: typeof props.height === 'number' ? `${props.height}px` : props.height,
|
|
29
|
+
objectFit: props.fit,
|
|
30
|
+
}))
|
|
31
|
+
|
|
32
|
+
const currentSrc = computed(() => {
|
|
33
|
+
if (hasError.value && props.fallback) return props.fallback
|
|
34
|
+
return props.src
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
function handleLoad() {
|
|
38
|
+
isLoaded.value = true
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function handleError() {
|
|
42
|
+
hasError.value = true
|
|
43
|
+
if (!props.fallback) {
|
|
44
|
+
isLoaded.value = true
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
onMounted(() => {
|
|
49
|
+
if (!props.lazy && imageRef.value) {
|
|
50
|
+
imageRef.value.loading = 'eager'
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<template>
|
|
56
|
+
<div :class="classes" :style="{ width: imageStyles.width, height: imageStyles.height }">
|
|
57
|
+
<div v-if="!isLoaded && showPlaceholder" class="br-image__placeholder">
|
|
58
|
+
<svg viewBox="0 0 24 24" fill="currentColor">
|
|
59
|
+
<path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/>
|
|
60
|
+
</svg>
|
|
61
|
+
</div>
|
|
62
|
+
<img
|
|
63
|
+
ref="imageRef"
|
|
64
|
+
:src="currentSrc"
|
|
65
|
+
:alt="alt"
|
|
66
|
+
:loading="lazy ? 'lazy' : 'eager'"
|
|
67
|
+
class="br-image__img"
|
|
68
|
+
:style="imageStyles"
|
|
69
|
+
@load="handleLoad"
|
|
70
|
+
@error="handleError"
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<style lang="scss" scoped>
|
|
76
|
+
.br-image {
|
|
77
|
+
position: relative;
|
|
78
|
+
display: inline-block;
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
background: var(--br-light-200);
|
|
81
|
+
|
|
82
|
+
&--rounded {
|
|
83
|
+
border-radius: var(--br-radius-md);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&--rounded-sm {
|
|
87
|
+
border-radius: var(--br-radius-sm);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&--rounded-md {
|
|
91
|
+
border-radius: var(--br-radius-md);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&--rounded-lg {
|
|
95
|
+
border-radius: var(--br-radius-lg);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&--rounded-xl {
|
|
99
|
+
border-radius: var(--br-radius-xl);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&--rounded-full {
|
|
103
|
+
border-radius: var(--br-radius-full);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&__placeholder {
|
|
107
|
+
position: absolute;
|
|
108
|
+
inset: 0;
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
background: var(--br-light-200);
|
|
113
|
+
color: var(--br-dark-500);
|
|
114
|
+
|
|
115
|
+
svg {
|
|
116
|
+
width: 40%;
|
|
117
|
+
height: 40%;
|
|
118
|
+
max-width: 48px;
|
|
119
|
+
max-height: 48px;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&__img {
|
|
124
|
+
display: block;
|
|
125
|
+
width: 100%;
|
|
126
|
+
height: 100%;
|
|
127
|
+
transition: opacity var(--br-transition-normal);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&--loading &__img {
|
|
131
|
+
opacity: 0;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
</style>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type ImageFit = 'cover' | 'contain' | 'fill' | 'none' | 'scale-down'
|
|
2
|
+
|
|
3
|
+
export interface ImageProps {
|
|
4
|
+
/**
|
|
5
|
+
* Image source URL
|
|
6
|
+
*/
|
|
7
|
+
src: string
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Alt text for accessibility
|
|
11
|
+
*/
|
|
12
|
+
alt: string
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Image width
|
|
16
|
+
*/
|
|
17
|
+
width?: string | number
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Image height
|
|
21
|
+
*/
|
|
22
|
+
height?: string | number
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Object fit property
|
|
26
|
+
* @default 'cover'
|
|
27
|
+
*/
|
|
28
|
+
fit?: ImageFit
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Lazy loading
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
lazy?: boolean
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Show loading placeholder
|
|
38
|
+
* @default true
|
|
39
|
+
*/
|
|
40
|
+
showPlaceholder?: boolean
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Border radius
|
|
44
|
+
*/
|
|
45
|
+
rounded?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'full'
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Fallback image URL
|
|
49
|
+
*/
|
|
50
|
+
fallback?: string
|
|
51
|
+
}
|