trepur_components 2.3.8 → 2.3.9
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/package.json +3 -2
- package/src/components/Accordion/Accordion.stories.tsx +23 -100
- package/src/components/Accordion/const.tsx +34 -0
- package/src/components/Accordion/index.tsx +18 -17
- package/src/components/AlertBar/AlertBar.stories.tsx +79 -85
- package/src/components/AlertBar/index.tsx +69 -100
- package/src/components/Avatar/Avatar.stories.tsx +3 -8
- package/src/components/Avatar/index.tsx +31 -31
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +17 -34
- package/src/components/Breadcrumbs/index.tsx +78 -29
- package/src/components/Button/Button.stories.tsx +11 -137
- package/src/components/Button/index.tsx +47 -92
- package/src/components/Calendar/Calendar.stories.tsx +12 -73
- package/src/components/Calendar/index.tsx +54 -34
- package/src/components/Card/Card.stories.tsx +3 -64
- package/src/components/Card/index.tsx +23 -80
- package/src/components/Carousel/Carousel.stories.tsx +32 -439
- package/src/components/Carousel/index.tsx +205 -286
- package/src/components/Carousel/utils.ts +53 -0
- package/src/components/CarouselThumbnail/CarouselThumbnail.stories.tsx +16 -337
- package/src/components/CarouselThumbnail/const.ts +17 -0
- package/src/components/CarouselThumbnail/index.tsx +92 -216
- package/src/components/CarouselThumbnail/utils.ts +87 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +12 -19
- package/src/components/Checkbox/index.tsx +37 -34
- package/src/components/Collapsible/Collapsible.stories.tsx +50 -50
- package/src/components/Collapsible/index.tsx +151 -110
- package/src/components/Counter/Counter.stories.tsx +10 -9
- package/src/components/Counter/index.tsx +81 -25
- package/src/components/DetailUpdater/DetailUpdater.stories.tsx +11 -69
- package/src/components/DetailUpdater/index.tsx +7 -8
- package/src/components/Dialog/Dialog.stories.tsx +13 -78
- package/src/components/Dialog/index.tsx +5 -69
- package/src/components/Dropdown/Dropdown.stories.tsx +22 -0
- package/src/components/Dropdown/index.tsx +117 -0
- package/src/components/Dropdown/utils.ts +15 -0
- package/src/components/FileUploader/FilePreview.tsx +2 -2
- package/src/components/FileUploader/FileUploader.stories.tsx +10 -8
- package/src/components/FileUploader/index.tsx +113 -68
- package/src/components/Footer/Footer.stories.tsx +38 -50
- package/src/components/Footer/index.tsx +84 -36
- package/src/components/FooterNav/FooterNav.stories.tsx +14 -104
- package/src/components/FooterNav/index.tsx +71 -45
- package/src/components/Form/Form.stories.tsx +9 -9
- package/src/components/Form/index.tsx +10 -15
- package/src/components/Gallery/Gallery.stories.tsx +39 -0
- package/src/components/Gallery/index.tsx +31 -0
- package/src/components/Greeting/Greeting.stories.tsx +6 -31
- package/src/components/Greeting/index.tsx +44 -25
- package/src/components/HamburgerIcon/HamburgerIcon.stories.tsx +3 -21
- package/src/components/HamburgerIcon/index.tsx +40 -62
- package/src/components/Icon/Icon.stories.tsx +30 -11
- package/src/components/Icon/index.tsx +28 -20
- package/src/components/Image/Image.stories.tsx +5 -75
- package/src/components/Image/index.tsx +17 -119
- package/src/components/ImageCard/ImageCard.stories.tsx +29 -0
- package/src/components/ImageCard/index.tsx +75 -0
- package/src/components/Input/Input.stories.tsx +12 -71
- package/src/components/Input/index.tsx +107 -98
- package/src/components/MenuButton/MenuButton.stories.tsx +5 -5
- package/src/components/MenuButton/index.tsx +4 -4
- package/src/components/Modal/Modal.stories.tsx +7 -7
- package/src/components/Modal/index.tsx +4 -4
- package/src/components/Nav/Nav.stories.tsx +80 -0
- package/src/components/Nav/index.tsx +171 -0
- package/src/components/NavItem/NavItem.stories.tsx +7 -80
- package/src/components/NavItem/index.tsx +34 -38
- package/src/components/Pill/Pill.stories.tsx +42 -35
- package/src/components/Pill/index.tsx +64 -49
- package/src/components/Search/Search.stories.tsx +8 -8
- package/src/components/Search/index.tsx +3 -3
- package/src/components/Select/Select.stories.tsx +5 -5
- package/src/components/Select/index.tsx +8 -9
- package/src/components/Showcase/Showcase.stories.tsx +3 -3
- package/src/components/Showcase/index.tsx +12 -19
- package/src/components/SideNav/SideNav.stories.tsx +7 -7
- package/src/components/SideNav/index.tsx +2 -2
- package/src/components/SocialButton/SocialButton.stories.tsx +11 -11
- package/src/components/SocialButton/index.tsx +6 -7
- package/src/components/SplitCard/SplitCard.stories.tsx +34 -0
- package/src/components/SplitCard/index.tsx +132 -0
- package/src/components/Stars/Star.stories.tsx +18 -0
- package/src/components/Stars/index.tsx +38 -0
- package/src/components/Testimonial/Testimonial.stories.tsx +25 -97
- package/src/components/Testimonial/index.tsx +121 -53
- package/src/components/TextArea/TextArea.stories.tsx +11 -42
- package/src/components/TextArea/index.tsx +104 -95
- package/src/components/Timeline/Timeline.stories.tsx +32 -79
- package/src/components/Timeline/index.tsx +55 -246
- package/src/components/Tubestops/Tubestops.stories.tsx +10 -30
- package/src/components/Tubestops/index.tsx +125 -47
- package/src/components/Video/Video.stories.tsx +47 -12
- package/src/components/Video/assets/example.mp4 +0 -0
- package/src/components/Video/assets/example.ogv +0 -0
- package/src/components/Video/assets/example.webm +0 -0
- package/src/components/Video/index.tsx +83 -36
- package/src/components/index.ts +7 -53
- package/src/custom.d.ts +14 -0
- package/src/documentation/Colours.mdx +33 -33
- package/src/documentation/Introduction.mdx +9 -5
- package/src/documentation/assets/index.ts +3 -0
- package/src/documentation/assets/trepurComponentsLogo.svg +32 -0
- package/src/{components → documentation}/typography/Fonts/Fonts.stories.tsx +1 -1
- package/src/{components → documentation}/typography/Fonts/Fonts.tsx +20 -21
- package/src/styles/global.css +1 -1
- package/src/styles/themes/local.css +61 -9
- package/src/styles/themes/test.css +28 -0
- package/src/utils/screens.ts +1 -1
- package/tailwind/colors.ts +53 -385
- package/tailwind/preset.ts +4 -0
- package/tailwind.config.ts +12 -80
- package/archive/theme.ts +0 -39
- package/lib/_virtual/react.js +0 -4
- package/lib/components/Accordion/Accordion.stories.d.ts +0 -95
- package/lib/components/Accordion/index.d.ts +0 -6
- package/lib/components/Accordion/index.js +0 -6
- package/lib/components/AlertBar/AlertBar.stories.d.ts +0 -163
- package/lib/components/AlertBar/index.d.ts +0 -12
- package/lib/components/AlertBar/index.js +0 -49
- package/lib/components/Avatar/Avatar.stories.d.ts +0 -44
- package/lib/components/Avatar/index.d.ts +0 -3
- package/lib/components/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -62
- package/lib/components/Breadcrumbs/index.d.ts +0 -9
- package/lib/components/Breadcrumbs/index.js +0 -12
- package/lib/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.d.ts +0 -67
- package/lib/components/BreadcrumbsBordered/index.d.ts +0 -6
- package/lib/components/BreadcrumbsBordered/index.js +0 -28
- package/lib/components/BreadcrumbsItem/BreadcrumbsItem.stories.d.ts +0 -74
- package/lib/components/BreadcrumbsItem/index.d.ts +0 -10
- package/lib/components/BreadcrumbsItem/index.js +0 -117
- package/lib/components/Button/Button.stories.d.ts +0 -192
- package/lib/components/Button/index.d.ts +0 -19
- package/lib/components/Button/index.js +0 -66
- package/lib/components/Calendar/Calendar.stories.d.ts +0 -136
- package/lib/components/Calendar/index.d.ts +0 -15
- package/lib/components/Calendar/index.js +0 -46
- package/lib/components/Calendar/style.css.js +0 -1
- package/lib/components/Card/Card.stories.d.ts +0 -108
- package/lib/components/Card/index.d.ts +0 -17
- package/lib/components/Card/index.js +0 -51
- package/lib/components/CardWithTopImage/CardWithTopImage.stories.d.ts +0 -83
- package/lib/components/CardWithTopImage/index.d.ts +0 -9
- package/lib/components/CardWithTopImage/index.js +0 -28
- package/lib/components/Carousel/Carousel.stories.d.ts +0 -562
- package/lib/components/Carousel/index.d.ts +0 -77
- package/lib/components/Carousel/index.js +0 -248
- package/lib/components/CarouselThumbnail/CarouselThumbnail.stories.d.ts +0 -546
- package/lib/components/CarouselThumbnail/index.d.ts +0 -50
- package/lib/components/CarouselThumbnail/index.js +0 -205
- package/lib/components/Checkbox/Checkbox.stories.d.ts +0 -52
- package/lib/components/Checkbox/index.d.ts +0 -7
- package/lib/components/Checkbox/index.js +0 -31
- package/lib/components/Collapsible/Collapsible.stories.d.ts +0 -82
- package/lib/components/Collapsible/index.d.ts +0 -12
- package/lib/components/Collapsible/index.js +0 -88
- package/lib/components/Column/Column.stories.d.ts +0 -116
- package/lib/components/Column/index.d.ts +0 -10
- package/lib/components/Column/index.js +0 -8
- package/lib/components/ComponentWrapper/ComponentWrapper.stories.d.ts +0 -77
- package/lib/components/ComponentWrapper/index.d.ts +0 -14
- package/lib/components/ComponentWrapper/index.js +0 -27
- package/lib/components/Container/Container.stories.d.ts +0 -75
- package/lib/components/Container/index.d.ts +0 -7
- package/lib/components/Container/index.js +0 -12
- package/lib/components/Counter/Counter.stories.d.ts +0 -45
- package/lib/components/Counter/index.d.ts +0 -6
- package/lib/components/Counter/index.js +0 -31
- package/lib/components/DetailUpdater/DetailUpdater.stories.d.ts +0 -104
- package/lib/components/DetailUpdater/index.d.ts +0 -18
- package/lib/components/DetailUpdater/index.js +0 -63
- package/lib/components/Dialog/Dialog.stories.d.ts +0 -145
- package/lib/components/Dialog/index.d.ts +0 -12
- package/lib/components/Dialog/index.js +0 -78
- package/lib/components/DropdownMenu/DropdownMenu.stories.d.ts +0 -76
- package/lib/components/DropdownMenu/index.d.ts +0 -14
- package/lib/components/DropdownMenu/index.js +0 -27
- package/lib/components/DynamicTextSection/DynamicTextSection.stories.d.ts +0 -100
- package/lib/components/DynamicTextSection/index.d.ts +0 -11
- package/lib/components/DynamicTextSection/index.js +0 -18
- package/lib/components/FileUploader/FilePreview.d.ts +0 -8
- package/lib/components/FileUploader/FileUploader.stories.d.ts +0 -50
- package/lib/components/FileUploader/index.d.ts +0 -9
- package/lib/components/FilterItem/FilterItem.stories.d.ts +0 -57
- package/lib/components/FilterItem/index.d.ts +0 -8
- package/lib/components/FilterItem/index.js +0 -60
- package/lib/components/Footer/Footer.stories.d.ts +0 -105
- package/lib/components/Footer/index.d.ts +0 -10
- package/lib/components/Footer/index.js +0 -36
- package/lib/components/FooterNav/FooterNav.stories.d.ts +0 -135
- package/lib/components/FooterNav/index.d.ts +0 -13
- package/lib/components/FooterNav/index.js +0 -28
- package/lib/components/FooterNavItem/FooterNavItem.stories.d.ts +0 -93
- package/lib/components/FooterNavItem/index.d.ts +0 -16
- package/lib/components/FooterNavItem/index.js +0 -27
- package/lib/components/Form/Form.stories.d.ts +0 -117
- package/lib/components/Form/index.d.ts +0 -13
- package/lib/components/Form/index.js +0 -28
- package/lib/components/FyreCard/FyreCard.stories.d.ts +0 -58
- package/lib/components/FyreCard/index.d.ts +0 -12
- package/lib/components/FyreCard/index.js +0 -27
- package/lib/components/Greeting/Greeting.stories.d.ts +0 -83
- package/lib/components/Greeting/index.d.ts +0 -8
- package/lib/components/Greeting/index.js +0 -13
- package/lib/components/HamburgerIcon/HamburgerIcon.stories.d.ts +0 -64
- package/lib/components/HamburgerIcon/index.d.ts +0 -7
- package/lib/components/HamburgerIcon/index.js +0 -93
- package/lib/components/HorizontalLine/HorizontalLine.stories.d.ts +0 -96
- package/lib/components/HorizontalLine/index.d.ts +0 -11
- package/lib/components/HorizontalLine/index.js +0 -24
- package/lib/components/Icon/Icon.stories.d.ts +0 -47
- package/lib/components/Icon/index.d.ts +0 -10
- package/lib/components/Icon/index.js +0 -15
- package/lib/components/IconCard/IconCard.stories.d.ts +0 -51
- package/lib/components/IconCard/index.d.ts +0 -13
- package/lib/components/IconCard/index.js +0 -27
- package/lib/components/Image/Image.stories.d.ts +0 -158
- package/lib/components/Image/index.d.ts +0 -15
- package/lib/components/Image/index.js +0 -99
- package/lib/components/ImageInfo/ImageInfo.stories.d.ts +0 -69
- package/lib/components/ImageInfo/index.d.ts +0 -14
- package/lib/components/ImageLink/ImageLink.stories.d.ts +0 -63
- package/lib/components/ImageLink/index.d.ts +0 -14
- package/lib/components/ImageLink/index.js +0 -39
- package/lib/components/ImageLinkList/ImageLinkList.stories.d.ts +0 -48
- package/lib/components/ImageLinkList/index.d.ts +0 -8
- package/lib/components/ImageLinkList/index.js +0 -18
- package/lib/components/InformationIcon/InformationIcon.stories.d.ts +0 -54
- package/lib/components/InformationIcon/index.d.ts +0 -12
- package/lib/components/InformationIcon/index.js +0 -65
- package/lib/components/InformationIconBlock/InformationIconBlock.stories.d.ts +0 -55
- package/lib/components/InformationIconBlock/index.d.ts +0 -12
- package/lib/components/Input/Input.stories.d.ts +0 -114
- package/lib/components/Input/index.d.ts +0 -29
- package/lib/components/Input/index.js +0 -89
- package/lib/components/Jumbotron/Jumbotron.stories.d.ts +0 -48
- package/lib/components/Jumbotron/index.d.ts +0 -8
- package/lib/components/Jumbotron/index.js +0 -9
- package/lib/components/MenuButton/MenuButton.stories.d.ts +0 -76
- package/lib/components/MenuButton/index.d.ts +0 -14
- package/lib/components/MenuButton/index.js +0 -56
- package/lib/components/Modal/Modal.stories.d.ts +0 -67
- package/lib/components/Modal/index.d.ts +0 -10
- package/lib/components/Modal/index.js +0 -45
- package/lib/components/NavItem/NavItem.stories.d.ts +0 -154
- package/lib/components/NavItem/index.d.ts +0 -16
- package/lib/components/NavItem/index.js +0 -25
- package/lib/components/NavOld/NavOld.stories.d.ts +0 -290
- package/lib/components/NavOld/StickyNav.d.ts +0 -22
- package/lib/components/NavOld/StickyNav.js +0 -135
- package/lib/components/NavOld/index.d.ts +0 -26
- package/lib/components/NavOld/index.js +0 -187
- package/lib/components/NavTwo/Dropdown.d.ts +0 -7
- package/lib/components/NavTwo/Dropdown.js +0 -21
- package/lib/components/NavTwo/Nav.stories.d.ts +0 -62
- package/lib/components/NavTwo/Sidebar.d.ts +0 -7
- package/lib/components/NavTwo/Sidebar.js +0 -21
- package/lib/components/NavTwo/StickyNav.d.ts +0 -7
- package/lib/components/NavTwo/StickyNav.js +0 -20
- package/lib/components/NavTwo/index.d.ts +0 -13
- package/lib/components/NavTwo/index.js +0 -28
- package/lib/components/NewsCard/NewsCard.stories.d.ts +0 -102
- package/lib/components/NewsCard/index.d.ts +0 -13
- package/lib/components/NewsCard/index.js +0 -26
- package/lib/components/Pill/Pill.stories.d.ts +0 -84
- package/lib/components/Pill/index.d.ts +0 -8
- package/lib/components/Pill/index.js +0 -31
- package/lib/components/ProductCard/ProductCard.stories.d.ts +0 -86
- package/lib/components/ProductCard/index.d.ts +0 -18
- package/lib/components/ProductCard/index.js +0 -69
- package/lib/components/ProductCardV2/ProductCardV2.stories.d.ts +0 -75
- package/lib/components/ProductCardV2/index.d.ts +0 -21
- package/lib/components/ProductCardV2/index.js +0 -67
- package/lib/components/Proficiencies/Proficiencies.stories.d.ts +0 -51
- package/lib/components/Proficiencies/index.d.ts +0 -12
- package/lib/components/Profile/Profile.stories.d.ts +0 -80
- package/lib/components/Profile/index.d.ts +0 -17
- package/lib/components/Profile/index.js +0 -78
- package/lib/components/Row/Row.stories.d.ts +0 -62
- package/lib/components/Row/index.d.ts +0 -6
- package/lib/components/Row/index.js +0 -9
- package/lib/components/Search/Search.stories.d.ts +0 -86
- package/lib/components/Search/index.d.ts +0 -12
- package/lib/components/Search/index.js +0 -42
- package/lib/components/Select/Select.stories.d.ts +0 -56
- package/lib/components/Select/index.d.ts +0 -11
- package/lib/components/Select/index.js +0 -68
- package/lib/components/Showcase/Showcase.stories.d.ts +0 -55
- package/lib/components/Showcase/index.d.ts +0 -15
- package/lib/components/SideNav/SideNav.stories.d.ts +0 -80
- package/lib/components/SideNav/index.d.ts +0 -12
- package/lib/components/SocialBlock/SocialBlock.stories.d.ts +0 -101
- package/lib/components/SocialBlock/index.d.ts +0 -14
- package/lib/components/SocialBlock/index.js +0 -37
- package/lib/components/SocialButton/SocialButton.stories.d.ts +0 -130
- package/lib/components/SocialButton/index.d.ts +0 -12
- package/lib/components/SocialButton/index.js +0 -37
- package/lib/components/StarRating/StarRating.stories.d.ts +0 -49
- package/lib/components/StarRating/index.d.ts +0 -9
- package/lib/components/StarRating/index.js +0 -47
- package/lib/components/Testimonial/Testimonial.stories.d.ts +0 -172
- package/lib/components/Testimonial/index.d.ts +0 -16
- package/lib/components/Testimonial/index.js +0 -42
- package/lib/components/TextAndTitle/TextAndTitle.stories.d.ts +0 -97
- package/lib/components/TextAndTitle/index.d.ts +0 -25
- package/lib/components/TextAndTitle/index.js +0 -70
- package/lib/components/TextArea/TextArea.stories.d.ts +0 -85
- package/lib/components/TextArea/index.d.ts +0 -26
- package/lib/components/TextArea/index.js +0 -86
- package/lib/components/Timeline/Timeline.stories.d.ts +0 -81
- package/lib/components/Timeline/index.d.ts +0 -17
- package/lib/components/Timeline/index.js +0 -172
- package/lib/components/TimelineV2/TimelineV2.stories.d.ts +0 -87
- package/lib/components/TimelineV2/index.d.ts +0 -20
- package/lib/components/Tubestops/Tubestops.stories.d.ts +0 -54
- package/lib/components/Tubestops/index.d.ts +0 -8
- package/lib/components/Tubestops/index.js +0 -44
- package/lib/components/UserIcon/UserIcon.stories.d.ts +0 -81
- package/lib/components/UserIcon/index.d.ts +0 -10
- package/lib/components/UserIcon/index.js +0 -34
- package/lib/components/Video/Video.stories.d.ts +0 -49
- package/lib/components/Video/index.d.ts +0 -15
- package/lib/components/Video/index.js +0 -34
- package/lib/components/index.d.ts +0 -60
- package/lib/components/typography/Fonts/Fonts.d.ts +0 -2
- package/lib/components/typography/Fonts/Fonts.stories.d.ts +0 -10
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -118
- package/lib/node_modules/keen-slider/keen-slider.min.css.js +0 -1
- package/lib/node_modules/keen-slider/react.js +0 -591
- package/lib/style.css +0 -1
- package/lib/styles/global.css +0 -75
- package/lib/styles/themes/local.css +0 -40
- package/lib/styles/themes/palette.css +0 -131
- package/lib/tailwind/boxShadow.ts +0 -9
- package/lib/tailwind/colors.ts +0 -410
- package/lib/tailwind/container.ts +0 -11
- package/lib/tailwind/preset.ts +0 -88
- package/lib/tailwind/spacing.ts +0 -14
- package/lib/utils/controls.d.ts +0 -36
- package/lib/utils/matchMedia.d.ts +0 -2
- package/lib/utils/matchMedia.js +0 -9
- package/lib/utils/screens.d.ts +0 -7
- package/src/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.tsx +0 -52
- package/src/components/BreadcrumbsBordered/index.tsx +0 -41
- package/src/components/BreadcrumbsItem/BreadcrumbsItem.stories.tsx +0 -40
- package/src/components/BreadcrumbsItem/index.tsx +0 -147
- package/src/components/CardWithTopImage/CardWithTopImage.stories.tsx +0 -50
- package/src/components/CardWithTopImage/index.tsx +0 -35
- package/src/components/Column/Column.stories.tsx +0 -89
- package/src/components/Column/index.tsx +0 -18
- package/src/components/ComponentWrapper/ComponentWrapper.stories.tsx +0 -40
- package/src/components/ComponentWrapper/index.tsx +0 -48
- package/src/components/Container/Container.stories.tsx +0 -40
- package/src/components/Container/index.tsx +0 -21
- package/src/components/DropdownMenu/DropdownMenu.stories.tsx +0 -59
- package/src/components/DropdownMenu/index.tsx +0 -45
- package/src/components/DynamicTextSection/DynamicTextSection.stories.tsx +0 -76
- package/src/components/DynamicTextSection/index.tsx +0 -32
- package/src/components/FilterItem/FilterItem.stories.tsx +0 -33
- package/src/components/FilterItem/index.tsx +0 -97
- package/src/components/FooterNavItem/FooterNavItem.stories.tsx +0 -53
- package/src/components/FooterNavItem/index.tsx +0 -58
- package/src/components/Form/style.module.css +0 -0
- package/src/components/FyreCard/FyreCard.stories.tsx +0 -31
- package/src/components/FyreCard/index.tsx +0 -44
- package/src/components/HorizontalLine/HorizontalLine.stories.tsx +0 -54
- package/src/components/HorizontalLine/index.tsx +0 -32
- package/src/components/IconCard/IconCard.stories.tsx +0 -26
- package/src/components/IconCard/index.tsx +0 -54
- package/src/components/ImageInfo/ImageInfo.stories.tsx +0 -38
- package/src/components/ImageInfo/index.tsx +0 -84
- package/src/components/ImageLink/ImageLink.stories.tsx +0 -36
- package/src/components/ImageLink/index.tsx +0 -58
- package/src/components/ImageLinkList/ImageLinkList.stories.tsx +0 -34
- package/src/components/ImageLinkList/index.tsx +0 -28
- package/src/components/InformationIcon/InformationIcon.stories.tsx +0 -29
- package/src/components/InformationIcon/index.tsx +0 -105
- package/src/components/InformationIconBlock/InformationIconBlock.stories.tsx +0 -38
- package/src/components/InformationIconBlock/index.tsx +0 -56
- package/src/components/Jumbotron/Jumbotron.stories.tsx +0 -21
- package/src/components/Jumbotron/index.tsx +0 -19
- package/src/components/NavOld/NavOld.stories.tsx +0 -193
- package/src/components/NavOld/StickyNav.tsx +0 -187
- package/src/components/NavOld/index.tsx +0 -265
- package/src/components/NavTwo/Dropdown.tsx +0 -30
- package/src/components/NavTwo/Nav.stories.tsx +0 -32
- package/src/components/NavTwo/Sidebar.tsx +0 -30
- package/src/components/NavTwo/StickyNav.tsx +0 -29
- package/src/components/NavTwo/index.tsx +0 -37
- package/src/components/NewsCard/NewsCard.stories.tsx +0 -72
- package/src/components/NewsCard/index.tsx +0 -44
- package/src/components/ProductCard/ProductCard.stories.tsx +0 -61
- package/src/components/ProductCard/index.tsx +0 -110
- package/src/components/ProductCardV2/ProductCardV2.stories.tsx +0 -50
- package/src/components/ProductCardV2/index.tsx +0 -98
- package/src/components/Proficiencies/Proficiencies.stories.tsx +0 -50
- package/src/components/Proficiencies/index.tsx +0 -51
- package/src/components/Profile/Profile.stories.tsx +0 -49
- package/src/components/Profile/index.tsx +0 -103
- package/src/components/Row/Row.stories.tsx +0 -53
- package/src/components/Row/index.tsx +0 -17
- package/src/components/SocialBlock/SocialBlock.stories.tsx +0 -58
- package/src/components/SocialBlock/index.tsx +0 -59
- package/src/components/StarRating/StarRating.stories.tsx +0 -23
- package/src/components/StarRating/index.tsx +0 -65
- package/src/components/TextAndTitle/TextAndTitle.stories.tsx +0 -71
- package/src/components/TextAndTitle/index.tsx +0 -119
- package/src/components/TimelineV2/TimelineV2.stories.tsx +0 -95
- package/src/components/TimelineV2/index.tsx +0 -70
- package/src/components/UserIcon/UserIcon.stories.tsx +0 -52
- package/src/components/UserIcon/index.tsx +0 -43
- package/src/styles/themes/palette.css +0 -131
- package/svg.d.ts +0 -4
- /package/src/{components/fonts → fonts}/Sora/OFL.txt +0 -0
- /package/src/{components/fonts → fonts}/Sora/README.txt +0 -0
- /package/src/{components/fonts → fonts}/Sora/Sora-VariableFont_wght.ttf +0 -0
- /package/src/{components/fonts → fonts}/Sora/static/Sora-Bold.ttf +0 -0
- /package/src/{components/fonts → fonts}/Sora/static/Sora-ExtraBold.ttf +0 -0
- /package/src/{components/fonts → fonts}/Sora/static/Sora-ExtraLight.ttf +0 -0
- /package/src/{components/fonts → fonts}/Sora/static/Sora-Light.ttf +0 -0
- /package/src/{components/fonts → fonts}/Sora/static/Sora-Medium.ttf +0 -0
- /package/src/{components/fonts → fonts}/Sora/static/Sora-Regular.ttf +0 -0
- /package/src/{components/fonts → fonts}/Sora/static/Sora-SemiBold.ttf +0 -0
- /package/src/{components/fonts → fonts}/Sora/static/Sora-Thin.ttf +0 -0
|
@@ -1,55 +1,48 @@
|
|
|
1
|
-
import
|
|
1
|
+
import {
|
|
2
|
+
createContext,
|
|
3
|
+
forwardRef,
|
|
4
|
+
HTMLAttributes,
|
|
5
|
+
useContext,
|
|
6
|
+
useMemo,
|
|
7
|
+
useState,
|
|
8
|
+
} from 'react';
|
|
2
9
|
|
|
3
|
-
import { ComponentWrapper } from '@components/ComponentWrapper';
|
|
4
10
|
import { Icon } from '@components/Icon';
|
|
5
11
|
import {
|
|
6
12
|
faChevronLeft,
|
|
7
13
|
faChevronRight,
|
|
8
14
|
faCircle,
|
|
9
15
|
} from '@fortawesome/fontawesome-free-solid';
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import classNames from 'classnames';
|
|
16
|
+
import { Colours } from '@utils/controls';
|
|
17
|
+
import clsx from 'clsx';
|
|
13
18
|
import 'keen-slider/keen-slider.min.css';
|
|
14
19
|
import {
|
|
15
20
|
useKeenSlider,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
KeenSliderInstance,
|
|
22
|
+
KeenSliderHooks,
|
|
23
|
+
KeenSliderOptions,
|
|
19
24
|
} from 'keen-slider/react';
|
|
20
25
|
|
|
21
|
-
|
|
26
|
+
import { WheelControls } from './utils';
|
|
27
|
+
|
|
28
|
+
export interface ArrowProps {
|
|
29
|
+
rightArrow?: boolean;
|
|
22
30
|
visible?: boolean;
|
|
23
|
-
left?: boolean;
|
|
24
|
-
right?: boolean;
|
|
25
31
|
disabled?: boolean;
|
|
26
32
|
onClick?: any;
|
|
27
|
-
colour?: Colours;
|
|
28
|
-
bgColour?: Colours;
|
|
29
|
-
hoverColour?: Colours;
|
|
30
|
-
hoverBgColour?: Colours;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
interface DotProps {
|
|
34
|
-
id?: string;
|
|
35
|
+
export interface DotProps {
|
|
35
36
|
isActive?: boolean;
|
|
36
37
|
visible?: boolean;
|
|
37
38
|
onClick?: any;
|
|
38
|
-
colour?: Colours;
|
|
39
|
-
bgColour?: Colours;
|
|
40
|
-
hoverColour?: Colours;
|
|
41
|
-
hoverBgColour?: Colours;
|
|
42
|
-
|
|
43
|
-
wrapperBgColour: Colours;
|
|
44
39
|
}
|
|
45
40
|
|
|
46
|
-
export interface
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
export interface CarouselContextProps {
|
|
42
|
+
sliderRef?: any;
|
|
43
|
+
instanceRef?: any;
|
|
44
|
+
currentSlide?: number;
|
|
49
45
|
slideWrapperClassName?: string;
|
|
50
|
-
title?: string;
|
|
51
|
-
description?: string;
|
|
52
|
-
bgColour?: Colours;
|
|
53
46
|
breakpoints?: Record<
|
|
54
47
|
string,
|
|
55
48
|
Omit<KeenSliderOptions<{}, {}, KeenSliderHooks>, 'breakpoints'>
|
|
@@ -101,282 +94,208 @@ export interface Props {
|
|
|
101
94
|
dots?: DotProps;
|
|
102
95
|
}
|
|
103
96
|
|
|
104
|
-
|
|
105
|
-
id,
|
|
106
|
-
className,
|
|
107
|
-
slideWrapperClassName,
|
|
108
|
-
title,
|
|
109
|
-
description,
|
|
110
|
-
bgColour,
|
|
111
|
-
breakpoints,
|
|
112
|
-
defaultAnimation,
|
|
113
|
-
disabled,
|
|
114
|
-
drag,
|
|
115
|
-
dragSpeed,
|
|
116
|
-
initial,
|
|
117
|
-
loop = true,
|
|
118
|
-
mode = 'snap',
|
|
119
|
-
range,
|
|
120
|
-
renderMode,
|
|
121
|
-
rtl,
|
|
122
|
-
rubberband,
|
|
123
|
-
slides,
|
|
124
|
-
vertical,
|
|
125
|
-
animationStarted,
|
|
126
|
-
animationStopped,
|
|
127
|
-
animationEnded,
|
|
128
|
-
created,
|
|
129
|
-
destroyed,
|
|
130
|
-
detailsChanged,
|
|
131
|
-
dragged,
|
|
132
|
-
dragStarted,
|
|
133
|
-
dragChecked,
|
|
134
|
-
dragEnded,
|
|
135
|
-
beforeOptionsChanged,
|
|
136
|
-
optionsChanged,
|
|
137
|
-
slideChanged,
|
|
138
|
-
updated,
|
|
139
|
-
perView = 1,
|
|
140
|
-
spacing,
|
|
141
|
-
number,
|
|
142
|
-
origin,
|
|
143
|
-
arrows,
|
|
144
|
-
dots,
|
|
145
|
-
}) => {
|
|
146
|
-
const classList = className;
|
|
147
|
-
const [currentSlide, setCurrentSlide] = useState(0);
|
|
148
|
-
const [loaded, setLoaded] = useState(false);
|
|
149
|
-
|
|
150
|
-
function WheelControls(slider: any): void {
|
|
151
|
-
let touchTimeout: any;
|
|
152
|
-
let position: any;
|
|
153
|
-
let wheelActive: boolean;
|
|
154
|
-
|
|
155
|
-
function dispatch(e: any, name: string): void {
|
|
156
|
-
position.x -= e.deltaX;
|
|
157
|
-
position.y -= e.deltaY;
|
|
158
|
-
slider.container.dispatchEvent(
|
|
159
|
-
new CustomEvent(name, {
|
|
160
|
-
detail: {
|
|
161
|
-
x: position.x,
|
|
162
|
-
y: position.y,
|
|
163
|
-
}
|
|
164
|
-
}),
|
|
165
|
-
)
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function wheelStart(e: any): void {
|
|
169
|
-
position = {
|
|
170
|
-
x: e.pageX,
|
|
171
|
-
y: e.pageY,
|
|
172
|
-
}
|
|
173
|
-
dispatch(e, 'ksDragStart');
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
function wheel(e: any): void {
|
|
177
|
-
dispatch(e, 'ksDrag');
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
function wheelEnd(e: any): void {
|
|
181
|
-
dispatch(e, 'ksDragEnd');
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
function eventWheel(e: any): void {
|
|
185
|
-
if (!wheelActive) {
|
|
186
|
-
wheelStart(e);
|
|
187
|
-
wheelActive = true;
|
|
188
|
-
}
|
|
189
|
-
wheel(e);
|
|
190
|
-
clearTimeout(touchTimeout);
|
|
191
|
-
touchTimeout = setTimeout(() => {
|
|
192
|
-
wheelActive = false;
|
|
193
|
-
wheelEnd(e);
|
|
194
|
-
}, 50);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
slider.on('created', () => {
|
|
198
|
-
slider.container.addEventListener('wheel', eventWheel, {
|
|
199
|
-
passive: true,
|
|
200
|
-
})
|
|
201
|
-
});
|
|
202
|
-
}
|
|
97
|
+
const CarouselContext = createContext<CarouselContextProps | null>(null);
|
|
203
98
|
|
|
204
|
-
|
|
99
|
+
const CarouselComponent = forwardRef<
|
|
100
|
+
HTMLDivElement,
|
|
101
|
+
HTMLAttributes<HTMLDivElement> & CarouselContextProps
|
|
102
|
+
>(
|
|
103
|
+
(
|
|
205
104
|
{
|
|
206
|
-
initial,
|
|
207
105
|
breakpoints,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
drag,
|
|
211
|
-
dragSpeed,
|
|
106
|
+
children,
|
|
107
|
+
className,
|
|
212
108
|
loop,
|
|
213
|
-
|
|
214
|
-
range,
|
|
215
|
-
renderMode,
|
|
216
|
-
rtl,
|
|
109
|
+
perView,
|
|
217
110
|
rubberband,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
111
|
+
spacing,
|
|
112
|
+
...props
|
|
113
|
+
},
|
|
114
|
+
ref,
|
|
115
|
+
) => {
|
|
116
|
+
const [currentSlide, setCurrentSlide] = useState(1);
|
|
117
|
+
const [loaded, setLoaded] = useState(false);
|
|
118
|
+
const [sliderRef, instanceRef] = useKeenSlider<HTMLDivElement>(
|
|
119
|
+
{
|
|
120
|
+
breakpoints,
|
|
121
|
+
loop,
|
|
122
|
+
rubberband,
|
|
123
|
+
slideChanged(slider) {
|
|
124
|
+
setCurrentSlide(slider.track.details.rel);
|
|
125
|
+
},
|
|
126
|
+
created() {
|
|
127
|
+
setLoaded(true);
|
|
128
|
+
},
|
|
129
|
+
slides: {
|
|
130
|
+
spacing,
|
|
131
|
+
perView,
|
|
132
|
+
},
|
|
225
133
|
},
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
dragEnded,
|
|
236
|
-
beforeOptionsChanged,
|
|
237
|
-
optionsChanged,
|
|
238
|
-
updated,
|
|
239
|
-
slides: {
|
|
134
|
+
[WheelControls],
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
const state = useMemo(
|
|
138
|
+
() => ({
|
|
139
|
+
sliderRef,
|
|
140
|
+
instanceRef,
|
|
141
|
+
currentSlide,
|
|
142
|
+
setCurrentSlide,
|
|
240
143
|
perView,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
144
|
+
...props,
|
|
145
|
+
}),
|
|
146
|
+
[
|
|
147
|
+
props,
|
|
148
|
+
sliderRef,
|
|
149
|
+
instanceRef.current,
|
|
150
|
+
currentSlide,
|
|
151
|
+
setCurrentSlide,
|
|
152
|
+
perView,
|
|
153
|
+
loaded,
|
|
154
|
+
],
|
|
155
|
+
);
|
|
248
156
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
157
|
+
const onKeyDown = (e: any): void => {
|
|
158
|
+
if (e.key === 'Tab') {
|
|
159
|
+
instanceRef.current?.next();
|
|
160
|
+
}
|
|
161
|
+
};
|
|
254
162
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
id={id}
|
|
258
|
-
className={classList}
|
|
259
|
-
title={title}
|
|
260
|
-
description={description}
|
|
261
|
-
bgColour={bgColour}
|
|
262
|
-
>
|
|
263
|
-
<div
|
|
264
|
-
onKeyDown={onKeyDown}
|
|
265
|
-
className={classNames(
|
|
266
|
-
classList,
|
|
267
|
-
arrows?.visible === true && 'flex justify-between',
|
|
268
|
-
'navigation-wrapper w-full',
|
|
269
|
-
)}
|
|
270
|
-
>
|
|
271
|
-
{arrows?.visible === true &&
|
|
272
|
-
loaded &&
|
|
273
|
-
instanceRef.current !== undefined && (
|
|
274
|
-
<div className="my-auto">
|
|
275
|
-
<Arrow
|
|
276
|
-
left
|
|
277
|
-
onClick={(e: any) => {
|
|
278
|
-
e.stopPropagation() !== undefined ||
|
|
279
|
-
instanceRef.current?.prev();
|
|
280
|
-
}}
|
|
281
|
-
disabled={currentSlide === 0}
|
|
282
|
-
{...arrows}
|
|
283
|
-
/>
|
|
284
|
-
</div>
|
|
285
|
-
)}
|
|
163
|
+
return (
|
|
164
|
+
<CarouselContext.Provider value={state}>
|
|
286
165
|
<div
|
|
287
|
-
|
|
288
|
-
className={
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
)}
|
|
166
|
+
onKeyDown={onKeyDown}
|
|
167
|
+
className={clsx('navigation-wrapper w-full', className)}
|
|
168
|
+
ref={ref}
|
|
169
|
+
{...props}
|
|
292
170
|
>
|
|
293
|
-
{
|
|
294
|
-
</div>
|
|
295
|
-
{arrows?.visible === true &&
|
|
296
|
-
loaded &&
|
|
297
|
-
instanceRef.current !== undefined && (
|
|
298
|
-
<div className="my-auto">
|
|
299
|
-
<Arrow
|
|
300
|
-
right
|
|
301
|
-
onClick={(e: any) => {
|
|
302
|
-
e.stopPropagation() !== undefined ||
|
|
303
|
-
instanceRef.current?.next();
|
|
304
|
-
}}
|
|
305
|
-
disabled={
|
|
306
|
-
currentSlide ===
|
|
307
|
-
instanceRef?.current?.track?.details?.slides?.length
|
|
308
|
-
}
|
|
309
|
-
{...arrows}
|
|
310
|
-
/>
|
|
311
|
-
</div>
|
|
312
|
-
)}
|
|
313
|
-
</div>
|
|
314
|
-
{dots?.visible === true && loaded && instanceRef.current != null && (
|
|
315
|
-
<div className="my-2 flex justify-center">
|
|
316
|
-
{[
|
|
317
|
-
...Array(
|
|
318
|
-
instanceRef?.current?.track?.details?.slides?.length,
|
|
319
|
-
).keys(),
|
|
320
|
-
].map((idx, i) => {
|
|
321
|
-
const numberOfSlides =
|
|
322
|
-
instanceRef?.current?.track?.details?.slides?.length ?? 1;
|
|
323
|
-
return (
|
|
324
|
-
<Dot
|
|
325
|
-
key={`dot_${i}`}
|
|
326
|
-
isActive={
|
|
327
|
-
!loop
|
|
328
|
-
? currentSlide === idx
|
|
329
|
-
: currentSlide + perView <= numberOfSlides
|
|
330
|
-
? idx >= currentSlide && idx < currentSlide + perView
|
|
331
|
-
: idx >= currentSlide ||
|
|
332
|
-
currentSlide + perView - numberOfSlides - 1 >= idx
|
|
333
|
-
}
|
|
334
|
-
onClick={() => {
|
|
335
|
-
instanceRef.current?.moveToIdx(idx);
|
|
336
|
-
}}
|
|
337
|
-
{...dots}
|
|
338
|
-
wrapperBgColour={bgColour ?? 'white'}
|
|
339
|
-
/>
|
|
340
|
-
);
|
|
341
|
-
})}
|
|
171
|
+
{children}
|
|
342
172
|
</div>
|
|
173
|
+
</CarouselContext.Provider>
|
|
174
|
+
);
|
|
175
|
+
},
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
const CarouselContent = forwardRef<
|
|
179
|
+
HTMLDivElement,
|
|
180
|
+
HTMLAttributes<HTMLDivElement>
|
|
181
|
+
>(({ children, className, ...props }, ref) => {
|
|
182
|
+
return (
|
|
183
|
+
<div
|
|
184
|
+
ref={ref}
|
|
185
|
+
className={clsx(
|
|
186
|
+
'navigation-wrapper flex w-full justify-between gap-4',
|
|
187
|
+
className,
|
|
343
188
|
)}
|
|
344
|
-
|
|
189
|
+
{...props}
|
|
190
|
+
>
|
|
191
|
+
{children}
|
|
192
|
+
</div>
|
|
345
193
|
);
|
|
346
|
-
}
|
|
194
|
+
});
|
|
347
195
|
|
|
348
|
-
|
|
196
|
+
const CarouselSlides = forwardRef<
|
|
197
|
+
HTMLDivElement,
|
|
198
|
+
HTMLAttributes<HTMLDivElement> & { rightArrow?: boolean }
|
|
199
|
+
>(({ className, children, rightArrow = false, ...props }) => {
|
|
200
|
+
const { sliderRef } = useContext(CarouselContext) || {};
|
|
349
201
|
return (
|
|
350
|
-
<div
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
: (faChevronRight as IconProp)
|
|
357
|
-
}
|
|
358
|
-
size="3x"
|
|
359
|
-
colour={props?.colour}
|
|
360
|
-
/>
|
|
361
|
-
</a>
|
|
202
|
+
<div
|
|
203
|
+
ref={sliderRef}
|
|
204
|
+
className={clsx('keen-slider w-full pb-4', className)}
|
|
205
|
+
{...props}
|
|
206
|
+
>
|
|
207
|
+
{children}
|
|
362
208
|
</div>
|
|
363
209
|
);
|
|
364
|
-
}
|
|
210
|
+
});
|
|
365
211
|
|
|
366
|
-
|
|
367
|
-
|
|
212
|
+
const CarouselArrow = forwardRef<
|
|
213
|
+
HTMLDivElement,
|
|
214
|
+
HTMLAttributes<HTMLDivElement> & ArrowProps
|
|
215
|
+
>(({ className, children, rightArrow = false, ...props }, ref) => {
|
|
216
|
+
const { instanceRef } = useContext(CarouselContext) || {};
|
|
368
217
|
return (
|
|
369
|
-
<
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
218
|
+
<div
|
|
219
|
+
ref={ref}
|
|
220
|
+
className={clsx(
|
|
221
|
+
'my-auto text-carousel-arrow-default hover:cursor-pointer hover:text-carousel-arrow-hover',
|
|
222
|
+
className,
|
|
223
|
+
)}
|
|
224
|
+
onClick={(e: any) => {
|
|
225
|
+
rightArrow
|
|
226
|
+
? e.stopPropagation() !== undefined || instanceRef.current?.next()
|
|
227
|
+
: e.stopPropagation() !== undefined || instanceRef.current?.prev();
|
|
228
|
+
}}
|
|
229
|
+
{...props}
|
|
374
230
|
>
|
|
375
|
-
<
|
|
376
|
-
icon={
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
/>
|
|
380
|
-
</button>
|
|
231
|
+
<a>
|
|
232
|
+
<Icon icon={rightArrow ? faChevronRight : faChevronLeft} size="3x" />
|
|
233
|
+
</a>
|
|
234
|
+
</div>
|
|
381
235
|
);
|
|
382
|
-
}
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
const CarouselDots = forwardRef<
|
|
239
|
+
HTMLButtonElement,
|
|
240
|
+
HTMLAttributes<HTMLButtonElement> & DotProps
|
|
241
|
+
>(({ className, children, onClick, ...props }, ref) => {
|
|
242
|
+
const {
|
|
243
|
+
instanceRef,
|
|
244
|
+
loop,
|
|
245
|
+
currentSlide = 1,
|
|
246
|
+
perView = 1,
|
|
247
|
+
} = useContext(CarouselContext) || {};
|
|
248
|
+
const length = instanceRef?.current?.track?.details?.slides?.length;
|
|
249
|
+
return (
|
|
250
|
+
<div className="flex justify-center">
|
|
251
|
+
{[...Array(length).keys()].map((idx) => {
|
|
252
|
+
const numberOfSlides =
|
|
253
|
+
instanceRef?.current?.track?.details?.slides?.length ?? 1;
|
|
254
|
+
|
|
255
|
+
const isActive = !loop
|
|
256
|
+
? currentSlide === idx
|
|
257
|
+
: currentSlide + perView <= numberOfSlides
|
|
258
|
+
? idx >= currentSlide && idx < currentSlide + perView
|
|
259
|
+
: idx >= currentSlide ||
|
|
260
|
+
currentSlide + perView - numberOfSlides - 1 >= idx;
|
|
261
|
+
|
|
262
|
+
return (
|
|
263
|
+
<button
|
|
264
|
+
ref={ref}
|
|
265
|
+
type="button"
|
|
266
|
+
onClick={() => {
|
|
267
|
+
instanceRef.current?.moveToIdx(idx);
|
|
268
|
+
}}
|
|
269
|
+
aria-label={`carousel-button${props.id ? `-${props.id}` : ''}`}
|
|
270
|
+
>
|
|
271
|
+
<Icon
|
|
272
|
+
className={clsx(
|
|
273
|
+
'hover:text-carousel-dots-hover',
|
|
274
|
+
isActive
|
|
275
|
+
? 'text-carousel-dots-active'
|
|
276
|
+
: 'text-carousel-dots-default',
|
|
277
|
+
)}
|
|
278
|
+
icon={faCircle}
|
|
279
|
+
size="2x"
|
|
280
|
+
/>
|
|
281
|
+
</button>
|
|
282
|
+
);
|
|
283
|
+
})}
|
|
284
|
+
</div>
|
|
285
|
+
);
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
CarouselComponent.displayName = 'Carousel';
|
|
289
|
+
CarouselContent.displayName = 'Carousel.Content';
|
|
290
|
+
CarouselArrow.displayName = 'Carousel.Arrow';
|
|
291
|
+
CarouselDots.displayName = 'Carousel.Dots';
|
|
292
|
+
CarouselSlides.displayName = 'Carousel.Slides';
|
|
293
|
+
|
|
294
|
+
const Carousel = Object.assign(CarouselComponent, {
|
|
295
|
+
Content: CarouselContent,
|
|
296
|
+
Arrow: CarouselArrow,
|
|
297
|
+
Dots: CarouselDots,
|
|
298
|
+
Slides: CarouselSlides,
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
export { Carousel };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export function WheelControls(slider: any): void {
|
|
2
|
+
let touchTimeout: any;
|
|
3
|
+
let position: any;
|
|
4
|
+
let wheelActive: boolean;
|
|
5
|
+
|
|
6
|
+
function dispatch(e: any, name: string): void {
|
|
7
|
+
position.x -= e.deltaX;
|
|
8
|
+
position.y -= e.deltaY;
|
|
9
|
+
slider.container.dispatchEvent(
|
|
10
|
+
new CustomEvent(name, {
|
|
11
|
+
detail: {
|
|
12
|
+
x: position.x,
|
|
13
|
+
y: position.y,
|
|
14
|
+
},
|
|
15
|
+
}),
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function wheelStart(e: any): void {
|
|
20
|
+
position = {
|
|
21
|
+
x: e.pageX,
|
|
22
|
+
y: e.pageY,
|
|
23
|
+
};
|
|
24
|
+
dispatch(e, 'ksDragStart');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function wheel(e: any): void {
|
|
28
|
+
dispatch(e, 'ksDrag');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function wheelEnd(e: any): void {
|
|
32
|
+
dispatch(e, 'ksDragEnd');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function eventWheel(e: any): void {
|
|
36
|
+
if (!wheelActive) {
|
|
37
|
+
wheelStart(e);
|
|
38
|
+
wheelActive = true;
|
|
39
|
+
}
|
|
40
|
+
wheel(e);
|
|
41
|
+
clearTimeout(touchTimeout);
|
|
42
|
+
touchTimeout = setTimeout(() => {
|
|
43
|
+
wheelActive = false;
|
|
44
|
+
wheelEnd(e);
|
|
45
|
+
}, 50);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
slider.on('created', () => {
|
|
49
|
+
slider.container.addEventListener('wheel', eventWheel, {
|
|
50
|
+
passive: true,
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|