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,256 +1,65 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ComponentWrapper } from '@components/ComponentWrapper';
|
|
3
|
-
import { Image } from '@components/Image';
|
|
4
|
-
import { Row } from '@components/Row';
|
|
5
|
-
import { type Colours } from '@utils/controls';
|
|
6
|
-
import classNames from 'classnames';
|
|
1
|
+
import { forwardRef, HTMLAttributes } from 'react';
|
|
7
2
|
|
|
8
|
-
|
|
9
|
-
id?: string;
|
|
10
|
-
className?: string;
|
|
11
|
-
title?: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
bgColour?: Colours;
|
|
14
|
-
isHorizontal?: boolean;
|
|
15
|
-
items?: object[];
|
|
16
|
-
reverse?: boolean;
|
|
17
|
-
textCenter?: boolean;
|
|
18
|
-
useImages?: boolean;
|
|
19
|
-
horizontalComponentClasses?: string;
|
|
20
|
-
isSm?: boolean;
|
|
21
|
-
}
|
|
3
|
+
import clsx from 'clsx';
|
|
22
4
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
useImages = true,
|
|
34
|
-
horizontalComponentClasses,
|
|
35
|
-
isSm = false,
|
|
36
|
-
}: Props) => {
|
|
37
|
-
const classList = classNames(className, 'w-full list-none pb-4');
|
|
38
|
-
const ulClasses = classNames(
|
|
39
|
-
{
|
|
40
|
-
'flex-row justify-between none-reverse': !reverse && isHorizontal,
|
|
41
|
-
'flex-col none-reverse': !reverse && !isHorizontal,
|
|
42
|
-
'flex-row justify-between reverse': reverse && isHorizontal,
|
|
43
|
-
'flex-col reverse': reverse && !isHorizontal,
|
|
44
|
-
},
|
|
45
|
-
className,
|
|
46
|
-
'relative flex list-none pl-0 status-flow timeline',
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
const liClasses = classNames(
|
|
50
|
-
{
|
|
51
|
-
'text-center': textCenter,
|
|
52
|
-
'flex-col items-center justify-between': !reverse && isHorizontal,
|
|
53
|
-
'flex-row none-reverse': !reverse && !isHorizontal,
|
|
54
|
-
'flex-col-reverse items-center': reverse && isHorizontal,
|
|
55
|
-
'flex-row-reverse': reverse && !isHorizontal,
|
|
56
|
-
},
|
|
57
|
-
'relative flex flex-auto flex-row leading-tight status-flow-item',
|
|
58
|
-
)
|
|
5
|
+
const TimelineComponent = forwardRef<
|
|
6
|
+
HTMLDivElement,
|
|
7
|
+
HTMLAttributes<HTMLDivElement>
|
|
8
|
+
>(({ id, className, children }, ref) => {
|
|
9
|
+
return (
|
|
10
|
+
<div ref={ref} id={id} className={className}>
|
|
11
|
+
{children}
|
|
12
|
+
</div>
|
|
13
|
+
);
|
|
14
|
+
});
|
|
59
15
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
16
|
+
const TimelineItem = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(
|
|
17
|
+
({ id, children }, ref) => {
|
|
18
|
+
return (
|
|
19
|
+
<div ref={ref} id={id} className="flex">
|
|
20
|
+
{children}
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
},
|
|
24
|
+
);
|
|
68
25
|
|
|
26
|
+
const TimelineDot = forwardRef<
|
|
27
|
+
HTMLDivElement,
|
|
28
|
+
HTMLAttributes<HTMLDivElement> & { index: number; length: number }
|
|
29
|
+
>(({ className, index, length }) => {
|
|
69
30
|
return (
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
let circlePos;
|
|
87
|
-
if (items.length - 1 > 0) {
|
|
88
|
-
if (i === 0) circlePos = 'first-circle';
|
|
89
|
-
else if (i === items.length - 1) circlePos = 'last-circle';
|
|
90
|
-
else circlePos = 'circle';
|
|
91
|
-
}
|
|
31
|
+
<div className="hidden sm:block">
|
|
32
|
+
<p
|
|
33
|
+
className={clsx('z-10 m-auto mt-12 h-4 w-4 rounded-full', className)}
|
|
34
|
+
/>
|
|
35
|
+
<div
|
|
36
|
+
className={
|
|
37
|
+
index !== length - 1
|
|
38
|
+
? clsx('m-auto h-full w-1', className)
|
|
39
|
+
: 'border-r-2 border-transparent'
|
|
40
|
+
}
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
});
|
|
92
45
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
'absolute top-0 block h-1/2 border-2 border-solid border-primary';
|
|
100
|
-
} else if (circlePos === 'last-circle' && isSm) {
|
|
101
|
-
verticalCircleStylesBefore =
|
|
102
|
-
'absolute top-0 block h-1/2 border-2 border-solid border-primary';
|
|
103
|
-
} else if (circlePos === 'last-circle' && !isSm) {
|
|
104
|
-
verticalCircleStylesBefore =
|
|
105
|
-
'absolute top-0 block h-1/2 border-2 border-solid border-primary';
|
|
106
|
-
}
|
|
46
|
+
const TimelineContent = forwardRef<
|
|
47
|
+
HTMLDivElement,
|
|
48
|
+
HTMLAttributes<HTMLDivElement>
|
|
49
|
+
>(({ children }) => {
|
|
50
|
+
return <div className="my-2 w-full sm:ml-8">{children}</div>;
|
|
51
|
+
});
|
|
107
52
|
|
|
108
|
-
|
|
109
|
-
if (circlePos === 'circle' && isSm) {
|
|
110
|
-
verticalCircleStylesAfter =
|
|
111
|
-
'absolute bottom-0 block h-1/2 border-2 border-solid border-primary';
|
|
112
|
-
} else if (circlePos === 'circle' && !isSm) {
|
|
113
|
-
verticalCircleStylesAfter =
|
|
114
|
-
'absolute bottom-0 block h-1/2 border-2 border-solid border-primary';
|
|
115
|
-
} else if (circlePos === 'first-circle' && isSm) {
|
|
116
|
-
verticalCircleStylesAfter =
|
|
117
|
-
'absolute bottom-0 block h-1/2 border-2 border-solid border-primary';
|
|
118
|
-
} else if (circlePos === 'first-circle' && !isSm) {
|
|
119
|
-
verticalCircleStylesAfter =
|
|
120
|
-
'absolute bottom-0 block h-1/2 border-2 border-solid border-primary';
|
|
121
|
-
}
|
|
53
|
+
TimelineComponent.displayName = 'Timeline';
|
|
122
54
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
} else if (circlePos === 'circle' && !isSm) {
|
|
127
|
-
horizontalCircleStylesBefore =
|
|
128
|
-
'absolute top-1/2 block border-2 border-solid border-primary';
|
|
129
|
-
} else if (circlePos === 'last-circle' && isSm) {
|
|
130
|
-
horizontalCircleStylesBefore = '';
|
|
131
|
-
} else if (circlePos === 'last-circle' && !isSm) {
|
|
132
|
-
horizontalCircleStylesBefore =
|
|
133
|
-
'absolute top-1/2 block border-2 border-solid border-primary';
|
|
134
|
-
}
|
|
55
|
+
TimelineItem.displayName = 'Timeline.Item';
|
|
56
|
+
TimelineDot.displayName = 'Timeline.Dot';
|
|
57
|
+
TimelineContent.displayName = 'Timeline.Content';
|
|
135
58
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
'absolute top-1/2 block border-2 border-solid border-primary';
|
|
142
|
-
} else if (circlePos === 'first-circle' && isSm) {
|
|
143
|
-
horizontalCircleStylesAfter = '';
|
|
144
|
-
} else if (circlePos === 'first-circle' && !isSm) {
|
|
145
|
-
horizontalCircleStylesAfter =
|
|
146
|
-
'absolute top-1/2 block border-2 border-solid border-primary';
|
|
147
|
-
}
|
|
59
|
+
const Timeline = Object.assign(TimelineComponent, {
|
|
60
|
+
Item: TimelineItem,
|
|
61
|
+
Dot: TimelineDot,
|
|
62
|
+
Content: TimelineContent,
|
|
63
|
+
});
|
|
148
64
|
|
|
149
|
-
|
|
150
|
-
horizontalComponentClasses,
|
|
151
|
-
'pt-12',
|
|
152
|
-
)
|
|
153
|
-
if (isHorizontal) {
|
|
154
|
-
return (
|
|
155
|
-
<Column
|
|
156
|
-
key={`horizontal_col_${i + 0}`}
|
|
157
|
-
id="timeline-item"
|
|
158
|
-
className={`${liClasses} mb-8 py-4`}
|
|
159
|
-
>
|
|
160
|
-
<Row className={horizontalComponentClasses}>
|
|
161
|
-
{before && item.component}
|
|
162
|
-
</Row>
|
|
163
|
-
<Row>
|
|
164
|
-
{useImages ? (
|
|
165
|
-
<div
|
|
166
|
-
id={circlePos}
|
|
167
|
-
className={
|
|
168
|
-
isHorizontal ? 'horizontal my-0 py-0' : 'vertical'
|
|
169
|
-
}
|
|
170
|
-
>
|
|
171
|
-
<span className={horizontalCircleStylesBefore} />
|
|
172
|
-
<Image
|
|
173
|
-
{...item.centerImageProps}
|
|
174
|
-
className="relative z-10"
|
|
175
|
-
/>
|
|
176
|
-
<span className={horizontalCircleStylesAfter} />
|
|
177
|
-
</div>
|
|
178
|
-
) : (
|
|
179
|
-
<p id={circlePos} className={circle} />
|
|
180
|
-
)}
|
|
181
|
-
</Row>
|
|
182
|
-
<Row className={horizonalComponentClassList}>
|
|
183
|
-
{!before && item.component}
|
|
184
|
-
</Row>
|
|
185
|
-
</Column>
|
|
186
|
-
);
|
|
187
|
-
} else {
|
|
188
|
-
return (
|
|
189
|
-
<Row
|
|
190
|
-
key={`vertical_row_${i + 0}`}
|
|
191
|
-
id="timeline-item"
|
|
192
|
-
className={`${liClasses} py-4`}
|
|
193
|
-
>
|
|
194
|
-
{!isSm && (
|
|
195
|
-
<Column
|
|
196
|
-
sm={5}
|
|
197
|
-
md={5}
|
|
198
|
-
lg={5}
|
|
199
|
-
xl={5}
|
|
200
|
-
className="my-auto text-center"
|
|
201
|
-
>
|
|
202
|
-
{before && item.component}
|
|
203
|
-
</Column>
|
|
204
|
-
)}
|
|
205
|
-
<Column
|
|
206
|
-
sm={2}
|
|
207
|
-
md={2}
|
|
208
|
-
lg={2}
|
|
209
|
-
xl={2}
|
|
210
|
-
id="circle-wrapper"
|
|
211
|
-
className="my-auto"
|
|
212
|
-
>
|
|
213
|
-
{useImages ? (
|
|
214
|
-
<div id={circlePos} className="vertical">
|
|
215
|
-
<span className={verticalCircleStylesBefore} />
|
|
216
|
-
<Image
|
|
217
|
-
{...item.centerImageProps}
|
|
218
|
-
className="relative z-10"
|
|
219
|
-
/>
|
|
220
|
-
<span className={verticalCircleStylesAfter} />
|
|
221
|
-
</div>
|
|
222
|
-
) : (
|
|
223
|
-
<p id={circlePos} className={circle} />
|
|
224
|
-
)}
|
|
225
|
-
</Column>
|
|
226
|
-
{/* TODO: combine below - issue with sm div */}
|
|
227
|
-
{isSm && (
|
|
228
|
-
<Column
|
|
229
|
-
sm={10}
|
|
230
|
-
md={10}
|
|
231
|
-
lg={10}
|
|
232
|
-
xl={10}
|
|
233
|
-
className="my-auto text-center"
|
|
234
|
-
>
|
|
235
|
-
{item.component}
|
|
236
|
-
</Column>
|
|
237
|
-
)}
|
|
238
|
-
{!isSm && (
|
|
239
|
-
<Column
|
|
240
|
-
sm={5}
|
|
241
|
-
md={5}
|
|
242
|
-
lg={5}
|
|
243
|
-
xl={5}
|
|
244
|
-
className="my-auto text-center"
|
|
245
|
-
>
|
|
246
|
-
{!before && item.component}
|
|
247
|
-
</Column>
|
|
248
|
-
)}
|
|
249
|
-
</Row>
|
|
250
|
-
);
|
|
251
|
-
}
|
|
252
|
-
})}
|
|
253
|
-
</div>
|
|
254
|
-
</ComponentWrapper>
|
|
255
|
-
);
|
|
256
|
-
}
|
|
65
|
+
export { Timeline };
|
|
@@ -1,39 +1,19 @@
|
|
|
1
|
-
import { Meta,
|
|
2
|
-
import { idAndClassName } from '@utils/controls';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
3
2
|
|
|
4
3
|
import { Tubestops } from '.';
|
|
5
4
|
|
|
6
5
|
const meta = {
|
|
7
|
-
title: '
|
|
6
|
+
title: 'V2Components/Tubestops',
|
|
8
7
|
component: Tubestops,
|
|
9
|
-
argTypes: {
|
|
10
|
-
...idAndClassName,
|
|
11
|
-
items: {
|
|
12
|
-
description:
|
|
13
|
-
'An array of strings, one per stop. To add a stop without text, use and empty string',
|
|
14
|
-
},
|
|
15
|
-
activeStop: {
|
|
16
|
-
description: 'The stop number which is currently active',
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
8
|
args: {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
'Step 8',
|
|
29
|
-
'Step 9',
|
|
30
|
-
'Step 10',
|
|
31
|
-
'Step 11',
|
|
32
|
-
'Step 12',
|
|
33
|
-
],
|
|
34
|
-
activeStop: 1,
|
|
35
|
-
}
|
|
36
|
-
}
|
|
9
|
+
activeStop: 3,
|
|
10
|
+
children: [...Array(5)].map((_, i) => (
|
|
11
|
+
<Tubestops.Stop stopId={i + 1}>
|
|
12
|
+
<Tubestops.Text>{`Stop ${i + 1}`}</Tubestops.Text>
|
|
13
|
+
</Tubestops.Stop>
|
|
14
|
+
)),
|
|
15
|
+
},
|
|
16
|
+
} satisfies Meta<typeof Tubestops>;
|
|
37
17
|
|
|
38
18
|
export default meta;
|
|
39
19
|
|
|
@@ -1,54 +1,132 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
Children,
|
|
3
|
+
createContext,
|
|
4
|
+
forwardRef,
|
|
5
|
+
HTMLAttributes,
|
|
6
|
+
useContext,
|
|
7
|
+
useMemo,
|
|
8
|
+
useState,
|
|
9
|
+
} from 'react';
|
|
3
10
|
|
|
4
|
-
|
|
5
|
-
extends Partial<Pick<HTMLElement, 'className' | 'id'>> {
|
|
6
|
-
items?: string[];
|
|
11
|
+
import clsx from 'clsx';
|
|
7
12
|
|
|
8
|
-
|
|
13
|
+
export interface TubestopsContextProps {
|
|
14
|
+
stops?: number;
|
|
9
15
|
activeStop?: number;
|
|
16
|
+
currentStop?: number;
|
|
17
|
+
setCurrentStop?: (stop: number) => void;
|
|
10
18
|
}
|
|
11
19
|
|
|
12
|
-
|
|
20
|
+
interface TubestopsStopContextProps {
|
|
21
|
+
stopNumber: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const TubestopsContext = createContext<TubestopsContextProps | null>(null);
|
|
25
|
+
const TubestopsStopContext = createContext<TubestopsStopContextProps | null>(
|
|
26
|
+
null,
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const TubestopsComponent = forwardRef<
|
|
30
|
+
HTMLDivElement,
|
|
31
|
+
HTMLAttributes<HTMLDivElement> & TubestopsContextProps
|
|
32
|
+
>(({ className, children, activeStop = 0 }, ref) => {
|
|
33
|
+
const [currentStop, setCurrentStop] = useState(activeStop);
|
|
34
|
+
const totalStops = Children.count(children);
|
|
35
|
+
|
|
36
|
+
const state = useMemo(
|
|
37
|
+
() => ({
|
|
38
|
+
stops: totalStops ?? 0,
|
|
39
|
+
currentStop,
|
|
40
|
+
setCurrentStop,
|
|
41
|
+
}),
|
|
42
|
+
[currentStop, setCurrentStop],
|
|
43
|
+
);
|
|
44
|
+
|
|
13
45
|
return (
|
|
14
|
-
<
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
className={classNames({
|
|
20
|
-
'ml-1/2 mt-4 h-1 w-full bg-border-light':
|
|
21
|
-
i >= activeStop - 1 && i < items.length - 1,
|
|
22
|
-
'ml-1/2 mt-4 h-1 w-full bg-success':
|
|
23
|
-
i < activeStop - 1 && i < items.length - 1,
|
|
24
|
-
})}
|
|
25
|
-
/>
|
|
26
|
-
<p
|
|
27
|
-
className={classNames(
|
|
28
|
-
{
|
|
29
|
-
'-mt-4 bg-success': i + 1 < activeStop,
|
|
30
|
-
'-mt-4 bg-gold': activeStop === i + 1,
|
|
31
|
-
'-mt-4 bg-border-light': i + 1 > activeStop,
|
|
32
|
-
'mt-1': i === items.length - 1,
|
|
33
|
-
},
|
|
34
|
-
'z-10 mx-auto h-6 w-6 rounded-full',
|
|
35
|
-
)}
|
|
36
|
-
/>
|
|
37
|
-
<p
|
|
38
|
-
className={classNames(
|
|
39
|
-
{
|
|
40
|
-
'font-medium text-success': i + 1 < activeStop,
|
|
41
|
-
'font-bold text-gold': activeStop === i + 1,
|
|
42
|
-
'font-medium text-border-light': i + 1 > activeStop,
|
|
43
|
-
},
|
|
44
|
-
'mt-2 text-center',
|
|
45
|
-
)}
|
|
46
|
-
>
|
|
47
|
-
{item}
|
|
48
|
-
</p>
|
|
49
|
-
</div>
|
|
50
|
-
);
|
|
51
|
-
})}
|
|
52
|
-
</div>
|
|
46
|
+
<TubestopsContext.Provider value={state}>
|
|
47
|
+
<div ref={ref} className={clsx('flex py-4', className)}>
|
|
48
|
+
{children}
|
|
49
|
+
</div>
|
|
50
|
+
</TubestopsContext.Provider>
|
|
53
51
|
);
|
|
54
|
-
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const TubestopsStop = forwardRef<
|
|
55
|
+
HTMLDivElement,
|
|
56
|
+
HTMLAttributes<HTMLDivElement> & { stopId: number }
|
|
57
|
+
>(({ className, stopId = 0, children }, ref) => {
|
|
58
|
+
const { currentStop = 0, stops = 0 } = useContext(TubestopsContext) || {};
|
|
59
|
+
const [stopNumber] = useState(stopId);
|
|
60
|
+
|
|
61
|
+
const state = useMemo(
|
|
62
|
+
() => ({
|
|
63
|
+
stopNumber,
|
|
64
|
+
}),
|
|
65
|
+
[stopNumber],
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<TubestopsStopContext.Provider value={state}>
|
|
70
|
+
<div ref={ref} className={clsx(className, 'w-full min-w-[120px]')}>
|
|
71
|
+
<div
|
|
72
|
+
className={clsx({
|
|
73
|
+
'mt-4 h-1 w-full translate-x-1/2 bg-tubestop-line-future':
|
|
74
|
+
stopId >= currentStop && stopId < stops,
|
|
75
|
+
'mt-4 h-1 w-full translate-x-1/2 bg-tubestop-line-complete':
|
|
76
|
+
stopId < currentStop && stopId < stops,
|
|
77
|
+
})}
|
|
78
|
+
/>
|
|
79
|
+
<p
|
|
80
|
+
className={clsx(
|
|
81
|
+
{
|
|
82
|
+
'relative z-20 -mt-4 bg-tubestop-station-complete':
|
|
83
|
+
stopId < currentStop,
|
|
84
|
+
'relative z-20 -mt-4 bg-tubestop-station-active':
|
|
85
|
+
currentStop === stopId,
|
|
86
|
+
'relative z-20 -mt-4 bg-tubestop-station-future':
|
|
87
|
+
stopId > currentStop,
|
|
88
|
+
'mt-1': stopId === stops,
|
|
89
|
+
},
|
|
90
|
+
'z-10 mx-auto h-6 w-6 rounded-full',
|
|
91
|
+
)}
|
|
92
|
+
/>
|
|
93
|
+
{children}
|
|
94
|
+
</div>
|
|
95
|
+
</TubestopsStopContext.Provider>
|
|
96
|
+
);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const TubestopsText = forwardRef<
|
|
100
|
+
HTMLParagraphElement,
|
|
101
|
+
HTMLAttributes<HTMLParagraphElement>
|
|
102
|
+
>(({ className, children }, ref) => {
|
|
103
|
+
const { currentStop = 0 } = useContext(TubestopsContext) || {};
|
|
104
|
+
const { stopNumber = 0 } = useContext(TubestopsStopContext) || {};
|
|
105
|
+
return (
|
|
106
|
+
<p
|
|
107
|
+
ref={ref}
|
|
108
|
+
className={clsx(
|
|
109
|
+
'mt-2 text-center',
|
|
110
|
+
{
|
|
111
|
+
'font-medium text-tubestop-text-complete': stopNumber < currentStop,
|
|
112
|
+
'font-bold text-tubestop-text-active': currentStop === stopNumber,
|
|
113
|
+
'font-medium text-tubestop-text-future': stopNumber > currentStop,
|
|
114
|
+
},
|
|
115
|
+
className,
|
|
116
|
+
)}
|
|
117
|
+
>
|
|
118
|
+
{children}
|
|
119
|
+
</p>
|
|
120
|
+
);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
TubestopsComponent.displayName = 'Tubestop';
|
|
124
|
+
TubestopsStop.displayName = 'Tubestops.Stop';
|
|
125
|
+
TubestopsText.displayName = 'Tubestops.Text';
|
|
126
|
+
|
|
127
|
+
const Tubestops = Object.assign(TubestopsComponent, {
|
|
128
|
+
Stop: TubestopsStop,
|
|
129
|
+
Text: TubestopsText,
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
export { Tubestops };
|
|
@@ -1,23 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Video } from './';
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import Mp4File from './assets/example.mp4';
|
|
5
|
+
import WebmFile from './assets/example.webm';
|
|
5
6
|
|
|
6
7
|
const meta = {
|
|
7
|
-
title: '
|
|
8
|
+
title: 'V2Components/Video',
|
|
8
9
|
component: Video,
|
|
9
|
-
argTypes: {
|
|
10
|
-
...idAndClassName,
|
|
11
|
-
},
|
|
12
10
|
args: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
}
|
|
11
|
+
children: [<Video.File src={WebmFile} type="video/webm" />],
|
|
12
|
+
},
|
|
13
|
+
} satisfies Meta<typeof Video>;
|
|
18
14
|
|
|
19
15
|
export default meta;
|
|
20
16
|
|
|
21
17
|
type Story = StoryObj<typeof Video>;
|
|
22
18
|
|
|
23
19
|
export const Default: Story = {};
|
|
20
|
+
|
|
21
|
+
export const Mp4: Story = {
|
|
22
|
+
...Default,
|
|
23
|
+
args: {
|
|
24
|
+
children: [<Video.File src={Mp4File} type="video/mp4" />],
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const withControls: Story = {
|
|
29
|
+
...Default,
|
|
30
|
+
args: {
|
|
31
|
+
withControls: true,
|
|
32
|
+
children: [<Video.File src={Mp4File} type="video/mp4" />],
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Muted: Story = {
|
|
37
|
+
...Default,
|
|
38
|
+
args: {
|
|
39
|
+
muted: true,
|
|
40
|
+
children: [<Video.File src={Mp4File} type="video/mp4" />],
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const autoPlay: Story = {
|
|
45
|
+
...Default,
|
|
46
|
+
args: {
|
|
47
|
+
autoPlay: true,
|
|
48
|
+
children: [<Video.File src={Mp4File} type="video/mp4" />],
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const withPoster: Story = {
|
|
53
|
+
...Default,
|
|
54
|
+
args: {
|
|
55
|
+
withPoster: true,
|
|
56
|
+
children: [<Video.File src={Mp4File} type="video/mp4" />],
|
|
57
|
+
},
|
|
58
|
+
};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|