diff --git a/components.js b/components.js index 9757e6d9..520daad9 100644 --- a/components.js +++ b/components.js @@ -1,6 +1,7 @@ export { default as BIMDataBigSpinner } from "./dist/js/BIMDataComponents/BIMDataBigSpinner.js"; export { default as BIMDataButton } from "./dist/js/BIMDataComponents/BIMDataButton.js"; export { default as BIMDataCard } from "./dist/js/BIMDataComponents/BIMDataCard.js"; +export { default as BIMDataCarousel } from "./dist/js/BIMDataComponents/BIMDataCarousel.js"; export { default as BIMDataCheckbox } from "./dist/js/BIMDataComponents/BIMDataCheckbox.js"; export { default as BIMDataColorSelector } from "./dist/js/BIMDataComponents/BIMDataColorSelector.js"; export { default as BIMDataDropdownList } from "./dist/js/BIMDataComponents/BIMDataDropdownList.js"; diff --git a/rollup.config.js b/rollup.config.js index 3ecbeae1..38d3a5d7 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -154,6 +154,7 @@ function getSingleComponentConfigurations() { "BIMDataBigSpinner", "BIMDataButton", "BIMDataCard", + "BIMDataCarousel", "BIMDataCheckbox", "BIMDataColorSelector", "BIMDataDropdownList", diff --git a/src/BIMDataComponents/BIMDataCarousel/BIMDataCarousel.scss b/src/BIMDataComponents/BIMDataCarousel/BIMDataCarousel.scss new file mode 100644 index 00000000..25b8ee75 --- /dev/null +++ b/src/BIMDataComponents/BIMDataCarousel/BIMDataCarousel.scss @@ -0,0 +1,37 @@ +.bimdata-carousel { + --button-size: 44px; + + position: relative; + + &__container { + overflow-x: hidden; + + // Here is a hack to make overflow-y visible + // See: https://stackoverflow.com/q/6421966/8298197 + margin: -28px 0; + padding: 28px 0; + + &__slider { + position: relative; + transition: transform 0.5s ease-out; + } + } + + &__btn-prev, + &__btn-next { + position: absolute; + z-index: 2; + top: calc(50% - var(--button-size) / 2); + width: var(--button-size); + height: var(--button-size); + box-shadow: var(--box-shadow); + } + + &__btn-prev { + left: calc(0px - var(--button-size) / 2); + } + + &__btn-next { + right: calc(0px - var(--button-size) / 2); + } +} diff --git a/src/BIMDataComponents/BIMDataCarousel/BIMDataCarousel.vue b/src/BIMDataComponents/BIMDataCarousel/BIMDataCarousel.vue new file mode 100644 index 00000000..ca0eb0fd --- /dev/null +++ b/src/BIMDataComponents/BIMDataCarousel/BIMDataCarousel.vue @@ -0,0 +1,131 @@ + + + + + diff --git a/src/BIMDataComponents/index.js b/src/BIMDataComponents/index.js index fcc99f5c..f0d918a5 100644 --- a/src/BIMDataComponents/index.js +++ b/src/BIMDataComponents/index.js @@ -10,6 +10,7 @@ import "../assets/css/utilities/_text.css"; export { default as BIMDataBigSpinner } from "./BIMDataBigSpinner/BIMDataBigSpinner.vue"; export { default as BIMDataButton } from "./BIMDataButton/BIMDataButton.vue"; export { default as BIMDataCard } from "./BIMDataCard/BIMDataCard.vue"; +export { default as BIMDataCarousel } from "./BIMDataCarousel/BIMDataCarousel.vue"; export { default as BIMDataCheckbox } from "./BIMDataCheckbox/BIMDataCheckbox.vue"; export { default as BIMDataColorSelector } from "./BIMDataColorSelector/BIMDataColorSelector.vue"; export { default as BIMDataDropdownList } from "./BIMDataDropdownList/BIMDataDropdownList.vue"; diff --git a/src/store.js b/src/store.js index 7e924321..ee011b20 100644 --- a/src/store.js +++ b/src/store.js @@ -108,6 +108,13 @@ export default new Vuex.Store({ text: "Cards are used to groups a related content.", btn: "View cards", }, + { + title: "Carousel", + img: require("./web/assets/img/icon-pagination.svg"), + path: "carousel", + text: "A generic carousel component.", + btn: "View carousel", + }, { title: "Checkbox", img: require("./web/assets/img/icon-checkbox.svg"), diff --git a/src/web/router/router.js b/src/web/router/router.js index 9707e03b..ebaf8e52 100644 --- a/src/web/router/router.js +++ b/src/web/router/router.js @@ -22,6 +22,7 @@ import Variables from "../views/Guidelines/Variables/Variables.vue"; // import COMPONENTS import Buttons from "../views/Components/Buttons/Buttons.vue"; import Card from "../views/Components/Card/Card.vue"; +import Carousel from "../views/Components/Carousel/Carousel.vue"; import Checkbox from "../views/Components/Checkbox/Checkbox.vue"; import ColorSelector from "../views/Components/ColorSelector/ColorSelector.vue"; import DropdownMenu from "../views/Components/DropdownMenu/DropdownMenu.vue"; @@ -148,6 +149,11 @@ const routes = [ name: "cards", component: Card, }, + { + path: "carousel", + name: "carousel", + component: Carousel, + }, { path: "checkbox", name: "checkbox", diff --git a/src/web/views/Components/Carousel/Carousel.vue b/src/web/views/Components/Carousel/Carousel.vue new file mode 100644 index 00000000..f74ea0a2 --- /dev/null +++ b/src/web/views/Components/Carousel/Carousel.vue @@ -0,0 +1,109 @@ + + + diff --git a/src/web/views/Components/Carousel/props-data.js b/src/web/views/Components/Carousel/props-data.js new file mode 100644 index 00000000..7f47659d --- /dev/null +++ b/src/web/views/Components/Carousel/props-data.js @@ -0,0 +1,16 @@ +/* eslint-disable */ +export default [ + [ "Name", "Type", "Default value", "Description" ], + [ + "sliderPadding", + "Number", + "12", + "Slider padding (in px)." + ], + [ + "minGap", + "Number", + "24", + "Minimum amount of space between items (in px)." + ], +];