trepur_components 0.4.8 → 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/src/lib/components/Accordion/Accordion.stories.d.ts +6 -0
- package/dist/src/lib/components/Accordion/Accordion.stories.js +80 -0
- package/dist/src/lib/components/Accordion/Accordion.stories.js.map +1 -0
- package/dist/src/lib/components/Accordion/index.d.ts +8 -0
- package/dist/src/lib/components/Accordion/index.js +9 -0
- package/dist/src/lib/components/Accordion/index.js.map +1 -0
- package/dist/src/lib/components/AlertBar/AlertBar.stories.d.ts +6 -0
- package/dist/src/lib/components/AlertBar/AlertBar.stories.js +91 -0
- package/dist/src/lib/components/AlertBar/AlertBar.stories.js.map +1 -0
- package/dist/src/lib/components/AlertBar/index.d.ts +16 -0
- package/dist/src/lib/components/AlertBar/index.js +64 -0
- package/dist/src/lib/components/AlertBar/index.js.map +1 -0
- package/dist/src/lib/components/Breadcrumbs/Breadcrumbs.stories.d.ts +6 -0
- package/dist/src/lib/components/Breadcrumbs/Breadcrumbs.stories.js +56 -0
- package/dist/src/lib/components/Breadcrumbs/Breadcrumbs.stories.js.map +1 -0
- package/dist/src/lib/components/Breadcrumbs/index.d.ts +11 -0
- package/dist/src/lib/components/Breadcrumbs/index.js +20 -0
- package/dist/src/lib/components/Breadcrumbs/index.js.map +1 -0
- package/dist/src/lib/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.d.ts +6 -0
- package/dist/src/lib/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.js +45 -0
- package/dist/src/lib/components/BreadcrumbsBordered/BreadcrumbsBordered.stories.js.map +1 -0
- package/dist/src/lib/components/BreadcrumbsBordered/index.d.ts +9 -0
- package/dist/src/lib/components/BreadcrumbsBordered/index.js +18 -0
- package/dist/src/lib/components/BreadcrumbsBordered/index.js.map +1 -0
- package/dist/src/lib/components/BreadcrumbsItem/BreadcrumbsItem.stories.d.ts +6 -0
- package/dist/src/lib/components/BreadcrumbsItem/BreadcrumbsItem.stories.js +50 -0
- package/dist/src/lib/components/BreadcrumbsItem/BreadcrumbsItem.stories.js.map +1 -0
- package/dist/src/lib/components/BreadcrumbsItem/index.d.ts +12 -0
- package/dist/src/lib/components/BreadcrumbsItem/index.js +57 -0
- package/dist/src/lib/components/BreadcrumbsItem/index.js.map +1 -0
- package/dist/src/lib/components/Button/button.stories.d.ts +6 -0
- package/dist/src/lib/components/Button/button.stories.js +132 -0
- package/dist/src/lib/components/Button/button.stories.js.map +1 -0
- package/dist/src/lib/components/Button/index.d.ts +17 -0
- package/dist/src/lib/components/Button/index.js +32 -0
- package/dist/src/lib/components/Button/index.js.map +1 -0
- package/dist/src/lib/components/Card/Card.stories.d.ts +8 -0
- package/dist/src/lib/components/Card/Card.stories.js +124 -0
- package/dist/src/lib/components/Card/Card.stories.js.map +1 -0
- package/dist/src/lib/components/Card/index.d.ts +31 -0
- package/dist/src/lib/components/Card/index.js +66 -0
- package/dist/src/lib/components/Card/index.js.map +1 -0
- package/dist/src/lib/components/CardWithTopImage/CardWithTopImage.stories.d.ts +6 -0
- package/dist/src/lib/components/CardWithTopImage/CardWithTopImage.stories.js +40 -0
- package/dist/src/lib/components/CardWithTopImage/CardWithTopImage.stories.js.map +1 -0
- package/dist/src/lib/components/CardWithTopImage/index.d.ts +10 -0
- package/dist/src/lib/components/CardWithTopImage/index.js +15 -0
- package/dist/src/lib/components/CardWithTopImage/index.js.map +1 -0
- package/dist/src/lib/components/Carousel/Carousel.stories.d.ts +6 -0
- package/dist/src/lib/components/Carousel/Carousel.stories.js +297 -0
- package/dist/src/lib/components/Carousel/Carousel.stories.js.map +1 -0
- package/dist/src/lib/components/Carousel/index.d.ts +59 -0
- package/dist/src/lib/components/Carousel/index.js +122 -0
- package/dist/src/lib/components/Carousel/index.js.map +1 -0
- package/dist/src/lib/components/ChevronCard/ChevronCard.stories.d.ts +6 -0
- package/dist/src/lib/components/ChevronCard/ChevronCard.stories.js +14 -0
- package/dist/src/lib/components/ChevronCard/ChevronCard.stories.js.map +1 -0
- package/dist/src/lib/components/ChevronCard/index.d.ts +7 -0
- package/dist/src/lib/components/ChevronCard/index.js +20 -0
- package/dist/src/lib/components/ChevronCard/index.js.map +1 -0
- package/dist/src/lib/components/Collapsible/Collapsible.stories.d.ts +6 -0
- package/dist/src/lib/components/Collapsible/Collapsible.stories.js +66 -0
- package/dist/src/lib/components/Collapsible/Collapsible.stories.js.map +1 -0
- package/dist/src/lib/components/Collapsible/index.d.ts +16 -0
- package/dist/src/lib/components/Collapsible/index.js +67 -0
- package/dist/src/lib/components/Collapsible/index.js.map +1 -0
- package/dist/src/lib/components/Column/Column.stories.d.ts +6 -0
- package/dist/src/lib/components/Column/Column.stories.js +64 -0
- package/dist/src/lib/components/Column/Column.stories.js.map +1 -0
- package/dist/src/lib/components/Column/index.d.ts +12 -0
- package/dist/src/lib/components/Column/index.js +83 -0
- package/dist/src/lib/components/Column/index.js.map +1 -0
- package/dist/src/lib/components/Container/Container.stories.d.ts +6 -0
- package/dist/src/lib/components/Container/Container.stories.js +30 -0
- package/dist/src/lib/components/Container/Container.stories.js.map +1 -0
- package/dist/src/lib/components/Container/index.d.ts +9 -0
- package/dist/src/lib/components/Container/index.js +8 -0
- package/dist/src/lib/components/Container/index.js.map +1 -0
- package/dist/src/lib/components/FooterBar/footerBar.stories.d.ts +6 -0
- package/dist/src/lib/components/FooterBar/footerBar.stories.js +48 -0
- package/dist/src/lib/components/FooterBar/footerBar.stories.js.map +1 -0
- package/dist/src/lib/components/FooterBar/index.d.ts +11 -0
- package/dist/src/lib/components/FooterBar/index.js +15 -0
- package/dist/src/lib/components/FooterBar/index.js.map +1 -0
- package/dist/src/lib/components/Form/Form.stories.d.ts +6 -0
- package/dist/src/lib/components/Form/Form.stories.js +82 -0
- package/dist/src/lib/components/Form/Form.stories.js.map +1 -0
- package/dist/src/lib/components/Form/index.d.ts +16 -0
- package/dist/src/lib/components/Form/index.js +19 -0
- package/dist/src/lib/components/Form/index.js.map +1 -0
- package/dist/src/lib/components/FyreCard/FyreCard.stories.d.ts +6 -0
- package/dist/src/lib/components/FyreCard/FyreCard.stories.js +22 -0
- package/dist/src/lib/components/FyreCard/FyreCard.stories.js.map +1 -0
- package/dist/src/lib/components/FyreCard/index.d.ts +13 -0
- package/dist/src/lib/components/FyreCard/index.js +17 -0
- package/dist/src/lib/components/FyreCard/index.js.map +1 -0
- package/dist/src/lib/components/Greeting/Greeting.stories.d.ts +6 -0
- package/dist/src/lib/components/Greeting/Greeting.stories.js +33 -0
- package/dist/src/lib/components/Greeting/Greeting.stories.js.map +1 -0
- package/dist/src/lib/components/Greeting/index.d.ts +10 -0
- package/dist/src/lib/components/Greeting/index.js +23 -0
- package/dist/src/lib/components/Greeting/index.js.map +1 -0
- package/dist/src/lib/components/HamburgerIcon/HamburgerIcon.stories.d.ts +6 -0
- package/dist/src/lib/components/HamburgerIcon/HamburgerIcon.stories.js +46 -0
- package/dist/src/lib/components/HamburgerIcon/HamburgerIcon.stories.js.map +1 -0
- package/dist/src/lib/components/HamburgerIcon/index.d.ts +7 -0
- package/dist/src/lib/components/HamburgerIcon/index.js +26 -0
- package/dist/src/lib/components/HamburgerIcon/index.js.map +1 -0
- package/dist/src/lib/components/Icon/Icon.stories.d.ts +6 -0
- package/dist/src/lib/components/Icon/Icon.stories.js +87 -0
- package/dist/src/lib/components/Icon/Icon.stories.js.map +1 -0
- package/dist/src/lib/components/Icon/index.d.ts +19 -0
- package/dist/src/lib/components/Icon/index.js +56 -0
- package/dist/src/lib/components/Icon/index.js.map +1 -0
- package/dist/src/lib/components/Image/Image.stories.d.ts +6 -0
- package/dist/src/lib/components/Image/Image.stories.js +73 -0
- package/dist/src/lib/components/Image/Image.stories.js.map +1 -0
- package/dist/src/lib/components/Image/index.d.ts +16 -0
- package/dist/src/lib/components/Image/index.js +54 -0
- package/dist/src/lib/components/Image/index.js.map +1 -0
- package/dist/src/lib/components/ImageLink/ImageLink.stories.d.ts +9 -0
- package/dist/src/lib/components/ImageLink/ImageLink.stories.js +50 -0
- package/dist/src/lib/components/ImageLink/ImageLink.stories.js.map +1 -0
- package/dist/src/lib/components/ImageLink/index.d.ts +15 -0
- package/dist/src/lib/components/ImageLink/index.js +18 -0
- package/dist/src/lib/components/ImageLink/index.js.map +1 -0
- package/dist/src/lib/components/ImageLinkList/ImageLinkList.stories.d.ts +6 -0
- package/dist/src/lib/components/ImageLinkList/ImageLinkList.stories.js +27 -0
- package/dist/src/lib/components/ImageLinkList/ImageLinkList.stories.js.map +1 -0
- package/dist/src/lib/components/ImageLinkList/index.d.ts +9 -0
- package/dist/src/lib/components/ImageLinkList/index.js +11 -0
- package/dist/src/lib/components/ImageLinkList/index.js.map +1 -0
- package/dist/src/lib/components/InformationIcon/InformationIcon.stories.d.ts +6 -0
- package/dist/src/lib/components/InformationIcon/InformationIcon.stories.js +73 -0
- package/dist/src/lib/components/InformationIcon/InformationIcon.stories.js.map +1 -0
- package/dist/src/lib/components/InformationIcon/index.d.ts +15 -0
- package/dist/src/lib/components/InformationIcon/index.js +45 -0
- package/dist/src/lib/components/InformationIcon/index.js.map +1 -0
- package/dist/src/lib/components/Input/Input.stories.d.ts +6 -0
- package/dist/src/lib/components/Input/Input.stories.js +95 -0
- package/dist/src/lib/components/Input/Input.stories.js.map +1 -0
- package/dist/src/lib/components/Input/index.d.ts +31 -0
- package/dist/src/lib/components/Input/index.js +25 -0
- package/dist/src/lib/components/Input/index.js.map +1 -0
- package/dist/src/lib/components/Jumbotron/Jumbotron.stories.d.ts +6 -0
- package/dist/src/lib/components/Jumbotron/Jumbotron.stories.js +16 -0
- package/dist/src/lib/components/Jumbotron/Jumbotron.stories.js.map +1 -0
- package/dist/src/lib/components/Jumbotron/index.d.ts +9 -0
- package/dist/src/lib/components/Jumbotron/index.js +9 -0
- package/dist/src/lib/components/Jumbotron/index.js.map +1 -0
- package/dist/src/lib/components/Nav/Nav.stories.d.ts +6 -0
- package/dist/src/lib/components/Nav/Nav.stories.js +134 -0
- package/dist/src/lib/components/Nav/Nav.stories.js.map +1 -0
- package/dist/src/lib/components/Nav/index.d.ts +22 -0
- package/dist/src/lib/components/Nav/index.js +65 -0
- package/dist/src/lib/components/Nav/index.js.map +1 -0
- package/dist/src/lib/components/NavItem/NavItem.stories.d.ts +6 -0
- package/dist/src/lib/components/NavItem/NavItem.stories.js +75 -0
- package/dist/src/lib/components/NavItem/NavItem.stories.js.map +1 -0
- package/dist/src/lib/components/NavItem/index.d.ts +15 -0
- package/dist/src/lib/components/NavItem/index.js +24 -0
- package/dist/src/lib/components/NavItem/index.js.map +1 -0
- package/dist/src/lib/components/NewsCard/NewsCard.stories.d.ts +6 -0
- package/dist/src/lib/components/NewsCard/NewsCard.stories.js +60 -0
- package/dist/src/lib/components/NewsCard/NewsCard.stories.js.map +1 -0
- package/dist/src/lib/components/NewsCard/index.d.ts +14 -0
- package/dist/src/lib/components/NewsCard/index.js +20 -0
- package/dist/src/lib/components/NewsCard/index.js.map +1 -0
- package/dist/src/lib/components/Profile/Profile.stories.d.ts +6 -0
- package/dist/src/lib/components/Profile/Profile.stories.js +41 -0
- package/dist/src/lib/components/Profile/Profile.stories.js.map +1 -0
- package/dist/src/lib/components/Profile/index.d.ts +18 -0
- package/dist/src/lib/components/Profile/index.js +36 -0
- package/dist/src/lib/components/Profile/index.js.map +1 -0
- package/dist/src/lib/components/Row/Row.stories.d.ts +6 -0
- package/dist/src/lib/components/Row/Row.stories.js +37 -0
- package/dist/src/lib/components/Row/Row.stories.js.map +1 -0
- package/dist/src/lib/components/Row/index.d.ts +8 -0
- package/dist/src/lib/components/Row/index.js +8 -0
- package/dist/src/lib/components/Row/index.js.map +1 -0
- package/dist/src/lib/components/Search/Search.stories.d.ts +6 -0
- package/dist/src/lib/components/Search/Search.stories.js +48 -0
- package/dist/src/lib/components/Search/Search.stories.js.map +1 -0
- package/dist/src/lib/components/Search/index.d.ts +13 -0
- package/dist/src/lib/components/Search/index.js +23 -0
- package/dist/src/lib/components/Search/index.js.map +1 -0
- package/dist/src/lib/components/SocialBlock/SocialBlock.stories.d.ts +6 -0
- package/dist/src/lib/components/SocialBlock/SocialBlock.stories.js +58 -0
- package/dist/src/lib/components/SocialBlock/SocialBlock.stories.js.map +1 -0
- package/dist/src/lib/components/SocialBlock/index.d.ts +21 -0
- package/dist/src/lib/components/SocialBlock/index.js +65 -0
- package/dist/src/lib/components/SocialBlock/index.js.map +1 -0
- package/dist/src/lib/components/StarRating/StarRating.stories.d.ts +6 -0
- package/dist/src/lib/components/StarRating/StarRating.stories.js +17 -0
- package/dist/src/lib/components/StarRating/StarRating.stories.js.map +1 -0
- package/dist/src/lib/components/StarRating/index.d.ts +9 -0
- package/dist/src/lib/components/StarRating/index.js +27 -0
- package/dist/src/lib/components/StarRating/index.js.map +1 -0
- package/dist/src/lib/components/Testimonial/Testimonial.stories.d.ts +6 -0
- package/dist/src/lib/components/Testimonial/Testimonial.stories.js +95 -0
- package/dist/src/lib/components/Testimonial/Testimonial.stories.js.map +1 -0
- package/dist/src/lib/components/Testimonial/index.d.ts +17 -0
- package/dist/src/lib/components/Testimonial/index.js +27 -0
- package/dist/src/lib/components/Testimonial/index.js.map +1 -0
- package/dist/src/lib/components/TextAndTitle/TextAndTitle.stories.d.ts +6 -0
- package/dist/src/lib/components/TextAndTitle/TextAndTitle.stories.js +63 -0
- package/dist/src/lib/components/TextAndTitle/TextAndTitle.stories.js.map +1 -0
- package/dist/src/lib/components/TextAndTitle/index.d.ts +26 -0
- package/dist/src/lib/components/TextAndTitle/index.js +104 -0
- package/dist/src/lib/components/TextAndTitle/index.js.map +1 -0
- package/dist/src/lib/components/TextArea/TextArea.stories.d.ts +6 -0
- package/dist/src/lib/components/TextArea/TextArea.stories.js +63 -0
- package/dist/src/lib/components/TextArea/TextArea.stories.js.map +1 -0
- package/dist/src/lib/components/TextArea/index.d.ts +27 -0
- package/dist/src/lib/components/TextArea/index.js +19 -0
- package/dist/src/lib/components/TextArea/index.js.map +1 -0
- package/dist/src/lib/components/Timeline/Timeline.stories.d.ts +6 -0
- package/dist/src/lib/components/Timeline/Timeline.stories.js +87 -0
- package/dist/src/lib/components/Timeline/Timeline.stories.js.map +1 -0
- package/dist/src/lib/components/Timeline/index.d.ts +14 -0
- package/dist/src/lib/components/Timeline/index.js +208 -0
- package/dist/src/lib/components/Timeline/index.js.map +1 -0
- package/dist/src/lib/components/Tubestops/Tubestops.stories.d.ts +6 -0
- package/dist/src/lib/components/Tubestops/Tubestops.stories.js +62 -0
- package/dist/src/lib/components/Tubestops/Tubestops.stories.js.map +1 -0
- package/dist/src/lib/components/Tubestops/index.d.ts +13 -0
- package/dist/src/lib/components/Tubestops/index.js +44 -0
- package/dist/src/lib/components/Tubestops/index.js.map +1 -0
- package/dist/src/lib/components/UserIcon/UserIcon.stories.d.ts +6 -0
- package/dist/src/lib/components/UserIcon/UserIcon.stories.js +63 -0
- package/dist/src/lib/components/UserIcon/UserIcon.stories.js.map +1 -0
- package/dist/src/lib/components/UserIcon/index.d.ts +11 -0
- package/dist/src/lib/components/UserIcon/index.js +16 -0
- package/dist/src/lib/components/UserIcon/index.js.map +1 -0
- package/dist/src/lib/components/Video/Video.stories.d.ts +6 -0
- package/dist/src/lib/components/Video/Video.stories.js +17 -0
- package/dist/src/lib/components/Video/Video.stories.js.map +1 -0
- package/dist/src/lib/components/Video/index.d.ts +17 -0
- package/dist/src/lib/components/Video/index.js +9 -0
- package/dist/src/lib/components/Video/index.js.map +1 -0
- package/dist/src/lib/index.d.ts +39 -0
- package/dist/src/lib/index.js +43 -0
- package/dist/src/lib/index.js.map +1 -0
- package/dist/src/lib/typography/Fonts.stories.d.ts +6 -0
- package/dist/src/lib/typography/Fonts.stories.js +12 -0
- package/dist/src/lib/typography/Fonts.stories.js.map +1 -0
- package/dist/src/lib/typography/index.d.ts +6 -0
- package/dist/src/lib/typography/index.js +23 -0
- package/dist/src/lib/typography/index.js.map +1 -0
- package/dist/src/lib/utils/controls.d.ts +35 -0
- package/dist/src/lib/utils/controls.js +21 -0
- package/dist/src/lib/utils/controls.js.map +1 -0
- package/dist/src/lib/utils/theme.d.ts +3 -0
- package/dist/src/lib/utils/theme.js +28 -0
- package/dist/src/lib/utils/theme.js.map +1 -0
- package/dist/tailwind.config.d.ts +65 -0
- package/dist/tailwind.config.js +81 -0
- package/dist/tailwind.config.js.map +1 -0
- package/package.json +19 -5
- package/dist/components/Accordion/index.js +0 -37
- package/dist/components/AlertBar/index.js +0 -129
- package/dist/components/Breadcrumbs/index.js +0 -66
- package/dist/components/BreadcrumbsBordered/index.js +0 -66
- package/dist/components/BreadcrumbsItem/index.js +0 -160
- package/dist/components/Button/index.js +0 -141
- package/dist/components/Card/index.js +0 -151
- package/dist/components/CardWithTopImage/index.js +0 -64
- package/dist/components/Carousel/index.css +0 -4
- package/dist/components/Carousel/index.css.map +0 -1
- package/dist/components/Carousel/index.js +0 -185
- package/dist/components/ChevronCard/index.js +0 -65
- package/dist/components/Collapsible/index.js +0 -158
- package/dist/components/Column/index.js +0 -137
- package/dist/components/Container/index.js +0 -55
- package/dist/components/FooterBar/index.js +0 -60
- package/dist/components/Form/index.js +0 -78
- package/dist/components/FyreCard/index.js +0 -54
- package/dist/components/Greeting/index.js +0 -69
- package/dist/components/Icon/index.js +0 -91
- package/dist/components/Image/index.js +0 -142
- package/dist/components/ImageLink/index.js +0 -61
- package/dist/components/ImageLinkList/index.js +0 -45
- package/dist/components/InformationIcon/index.js +0 -120
- package/dist/components/Input/index.js +0 -112
- package/dist/components/Jumbotron/index.js +0 -39
- package/dist/components/Nav/index.js +0 -302
- package/dist/components/NavItem/index.js +0 -129
- package/dist/components/NewsCard/index.js +0 -62
- package/dist/components/Profile/index.js +0 -86
- package/dist/components/Row/index.js +0 -55
- package/dist/components/Search/index.js +0 -60
- package/dist/components/SocialBlock/index.js +0 -184
- package/dist/components/StarRating/index.js +0 -110
- package/dist/components/Testimonial/index.js +0 -70
- package/dist/components/TextAndTitle/index.js +0 -283
- package/dist/components/TextArea/index.js +0 -97
- package/dist/components/Timeline/index.css +0 -133
- package/dist/components/Timeline/index.css.map +0 -1
- package/dist/components/Timeline/index.js +0 -254
- package/dist/components/Tubestops/index.css +0 -92
- package/dist/components/Tubestops/index.css.map +0 -1
- package/dist/components/Tubestops/index.js +0 -95
- package/dist/components/UserIcon/index.js +0 -50
- package/dist/components/Users/rupertb/Documents/apps/trepur_components/src/lib/styles/base.css +0 -1831
- package/dist/components/Users/rupertb/Documents/apps/trepur_components/src/lib/styles/base.css.map +0 -1
- package/dist/components/Video/index.js +0 -67
- package/dist/fonts/Sora/OFL.txt +0 -93
- package/dist/fonts/Sora/README.txt +0 -70
- package/dist/fonts/Sora/Sora-VariableFont_wght.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-Bold.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-ExtraBold.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-ExtraLight.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-Light.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-Medium.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-Regular.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-SemiBold.ttf +0 -0
- package/dist/fonts/Sora/static/Sora-Thin.ttf +0 -0
- package/dist/index.js +0 -311
- package/dist/styles/base.css +0 -73
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Button from '../Button';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
const FyreCard = ({ id, className, image, imageClass, altText, bordered, buttonProps }) => {
|
|
5
|
+
const classList = classNames({
|
|
6
|
+
'border border-grey border-opacity-100': bordered
|
|
7
|
+
}, className, 'flex flex-col');
|
|
8
|
+
const imageClassList = classNames(imageClass, 'w-full');
|
|
9
|
+
return (React.createElement("div", { key: id, id: id, className: classList },
|
|
10
|
+
React.createElement("div", { className: 'card-content flex flex-1 flex-col' },
|
|
11
|
+
React.createElement("div", null,
|
|
12
|
+
React.createElement("img", { className: imageClassList, src: image, alt: altText })),
|
|
13
|
+
React.createElement("div", { className: 'flex justify-end' },
|
|
14
|
+
React.createElement(Button, Object.assign({}, buttonProps), buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.children)))));
|
|
15
|
+
};
|
|
16
|
+
export default FyreCard;
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/components/FyreCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,MAAgC,MAAM,oBAAoB,CAAA;AACjE,OAAO,UAAU,MAAM,YAAY,CAAA;AAWnC,MAAM,QAAQ,GAAG,CAAC,EAChB,EAAE,EACF,SAAS,EACT,KAAK,EACL,UAAU,EACV,OAAO,EACP,QAAQ,EACR,WAAW,EACL,EAAe,EAAE;IACvB,MAAM,SAAS,GAAG,UAAU,CAAC;QAC3B,uCAAuC,EAAE,QAAQ;KAClD,EAAE,SAAS,EAAE,eAAe,CAAC,CAAA;IAC9B,MAAM,cAAc,GAAG,UAAU,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;IAEvD,OAAO,CACL,6BACE,GAAG,EAAE,EAAE,EACP,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,SAAS;QAEpB,6BAAK,SAAS,EAAC,mCAAmC;YAChD;gBACE,6BAAK,SAAS,EAAE,cAAc,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,GAAI,CACxD;YACN,6BAAK,SAAS,EAAC,kBAAkB;gBAC/B,oBAAC,MAAM,oBAAK,WAAW,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAAQ,CAAU,CACrD,CACF,CACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import Greeting from './index';
|
|
3
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
4
|
+
declare const componentMeta: ComponentMeta<typeof Greeting>;
|
|
5
|
+
export declare const _Greeting: ComponentStory<({ id, className, morningMessage, afternoonMessage, eveningMessage }: import("./index").Props) => JSX.Element>;
|
|
6
|
+
export default componentMeta;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Greeting from './index';
|
|
3
|
+
import { idAndClassName } from '../../utils/controls';
|
|
4
|
+
const componentMeta = {
|
|
5
|
+
title: 'Trepur Components/Rupert Bennett/Atoms/Greeting',
|
|
6
|
+
component: Greeting,
|
|
7
|
+
argTypes: Object.assign(Object.assign({}, idAndClassName), { morningMessage: {
|
|
8
|
+
type: { name: 'string', required: false },
|
|
9
|
+
description: 'Defines the morning message for the greeting component',
|
|
10
|
+
table: {
|
|
11
|
+
type: { summary: 'string' }
|
|
12
|
+
}
|
|
13
|
+
}, afternoonMessage: {
|
|
14
|
+
type: { name: 'string', required: false },
|
|
15
|
+
description: 'Defines the afternoon message for the greeting component',
|
|
16
|
+
table: {
|
|
17
|
+
type: { summary: 'string' }
|
|
18
|
+
}
|
|
19
|
+
}, eveningMessage: {
|
|
20
|
+
type: { name: 'string', required: false },
|
|
21
|
+
description: 'Defines the evening message for the greeting component',
|
|
22
|
+
table: {
|
|
23
|
+
type: { summary: 'string' }
|
|
24
|
+
}
|
|
25
|
+
} }),
|
|
26
|
+
args: {
|
|
27
|
+
morningMessage: 'What a beautiful morning it is today'
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const Template = (args) => React.createElement(Greeting, Object.assign({}, args));
|
|
31
|
+
export const _Greeting = Template.bind({});
|
|
32
|
+
export default componentMeta;
|
|
33
|
+
//# sourceMappingURL=Greeting.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Greeting.stories.js","sourceRoot":"","sources":["../../../../../src/lib/components/Greeting/Greeting.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,K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: string;
|
|
7
|
+
eveningMessage?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const Greeting: ({ id, className, morningMessage, afternoonMessage, eveningMessage }: Props) => JSX.Element;
|
|
10
|
+
export default Greeting;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
const Greeting = ({ id, className, morningMessage = 'Good morning', afternoonMessage = 'Good afternoon', eveningMessage = 'Good evening' }) => {
|
|
4
|
+
const today = new Date();
|
|
5
|
+
const hours = `0${today.getHours().toString()}`.slice(-2);
|
|
6
|
+
const minutes = `0${today.getMinutes().toString()}`.slice(-2);
|
|
7
|
+
const seconds = `0${today.getSeconds().toString()}`.slice(-2);
|
|
8
|
+
const time = parseInt(`${hours}${minutes}${seconds}`);
|
|
9
|
+
let message;
|
|
10
|
+
if (time < 120000) {
|
|
11
|
+
message = morningMessage;
|
|
12
|
+
}
|
|
13
|
+
else if (time > 115959 && time < 170000) {
|
|
14
|
+
message = afternoonMessage;
|
|
15
|
+
}
|
|
16
|
+
else if (time > 165959) {
|
|
17
|
+
message = eveningMessage;
|
|
18
|
+
}
|
|
19
|
+
const classList = classNames(className);
|
|
20
|
+
return (React.createElement("p", { id: id, className: classList }, message));
|
|
21
|
+
};
|
|
22
|
+
export default Greeting;
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/components/Greeting/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,UAAU,MAAM,YAAY,CAAA;AAUnC,MAAM,QAAQ,GAAG,CAAC,EAChB,EAAE,EACF,SAAS,EACT,cAAc,GAAG,cAAc,EAC/B,gBAAgB,GAAG,gBAAgB,EACnC,cAAc,GAAG,cAAc,EACzB,EAAe,EAAE;IACvB,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAA;IACxB,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;IACzD,MAAM,OAAO,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;IAC7D,MAAM,OAAO,GAAG,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;IAC7D,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,EAAE,CAAC,CAAA;IAErD,IAAI,OAAO,CAAA;IACX,IAAI,IAAI,GAAG,MAAM,EAAE;QACjB,OAAO,GAAG,cAAc,CAAA;KACzB;SAAM,IAAI,IAAI,GAAG,MAAM,IAAI,IAAI,GAAG,MAAM,EAAE;QACzC,OAAO,GAAG,gBAAgB,CAAA;KAC3B;SAAM,IAAI,IAAI,GAAG,MAAM,EAAE;QACxB,OAAO,GAAG,cAAc,CAAA;KACzB;IAED,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,CAAA;IAEvC,OAAO,CACL,2BACE,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,SAAS,IAEnB,OAAO,CACN,CACL,CAAA;AACH,CAAC,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
import HamburgerIcon from './index';
|
|
4
|
+
declare const componentMeta: ComponentMeta<typeof HamburgerIcon>;
|
|
5
|
+
export declare const _HamburgerIcon: ComponentStory<({ id, className, onClick }: import("./index").Props) => JSX.Element>;
|
|
6
|
+
export default componentMeta;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import HamburgerIcon from './index';
|
|
3
|
+
const componentMeta = {
|
|
4
|
+
title: 'Trepur Components/Rupert Bennett/Atoms/Hamburger Icon',
|
|
5
|
+
component: HamburgerIcon,
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: 'An icon component'
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
layout: 'padded'
|
|
13
|
+
},
|
|
14
|
+
argTypes: {
|
|
15
|
+
id: {
|
|
16
|
+
type: { name: 'string', required: false },
|
|
17
|
+
description: 'HTML id attribute',
|
|
18
|
+
table: { type: { summary: 'string' } }
|
|
19
|
+
},
|
|
20
|
+
className: {
|
|
21
|
+
type: { name: 'string', required: false },
|
|
22
|
+
description: 'Used to pass any additional classes to the component',
|
|
23
|
+
table: { type: { summary: 'string' } }
|
|
24
|
+
},
|
|
25
|
+
opened: {
|
|
26
|
+
type: { name: 'boolean', required: false },
|
|
27
|
+
description: 'If this component is disabled and can not be interacted',
|
|
28
|
+
table: {
|
|
29
|
+
type: { summary: 'boolean' },
|
|
30
|
+
defaultValue: { summary: 'boolean' }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
onClick: {
|
|
34
|
+
type: { name: 'function', required: false },
|
|
35
|
+
description: 'Function to be called when the button is clicked',
|
|
36
|
+
table: { type: { summary: 'function' } }
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
args: {
|
|
40
|
+
opened: false
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const Template = (args) => React.createElement(HamburgerIcon, Object.assign({}, args));
|
|
44
|
+
export const _HamburgerIcon = Template.bind({});
|
|
45
|
+
export default componentMeta;
|
|
46
|
+
//# sourceMappingURL=HamburgerIcon.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HamburgerIcon.stories.js","sourceRoot":"","sources":["../../../../../src/lib/components/HamburgerIcon/HamburgerIcon.stories.tsx"],"names":[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AAE,EAAE,CAAC,oBAAC,aAAa,oBAAK,IAAI,EAAI,CAAA;AAE5F,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAE/C,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface Props extends Partial<Pick<HTMLElement, 'className' | 'id'>> {
|
|
3
|
+
opened?: boolean;
|
|
4
|
+
onClick?: React.MouseEventHandler;
|
|
5
|
+
}
|
|
6
|
+
declare const HamburgerIcon: ({ id, className, onClick }: Props) => JSX.Element;
|
|
7
|
+
export default HamburgerIcon;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import Button from '../Button';
|
|
4
|
+
const HamburgerIcon = ({ id, className, onClick }) => {
|
|
5
|
+
const [opened, setOpened] = useState(false);
|
|
6
|
+
const lineOneClassList = classNames({
|
|
7
|
+
'origin-top-left rotate-45 translate-x-1 -translate-y-0.5': opened
|
|
8
|
+
}, 'origin-top-left transition-transform duration-200 ease-linear');
|
|
9
|
+
const lineTwoClassList = classNames({
|
|
10
|
+
'opacity-0': opened
|
|
11
|
+
}, 'opacity-100 transition-opacity duration-200 ease-linear');
|
|
12
|
+
const lineThreeClassList = classNames({
|
|
13
|
+
'origin-bottom-left -rotate-45 translate-x-1 translate-y-px': opened
|
|
14
|
+
}, 'origin-bottom-left transition-transform duration-200 ease-linear');
|
|
15
|
+
const toggleOpened = (e) => {
|
|
16
|
+
setOpened(!opened);
|
|
17
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
18
|
+
};
|
|
19
|
+
return (React.createElement(Button, { id: id, className: className, onClick: (e) => toggleOpened(e), variant: 'primary', type: 'icon' },
|
|
20
|
+
React.createElement("svg", { className: 'mx-auto overflow-visible fill-white group-hover:fill-primary transition-backgroundColor duration-500 transform', width: '24', height: '24', viewBox: '0 0 24 15', xmlns: 'http://www.w3.org/2000/svg' },
|
|
21
|
+
React.createElement("path", { className: lineOneClassList, d: 'M0 1.5C0 0.947715 0.447715 0.5 1 0.5H21C21.5523 0.5 22 0.947715 22 1.5C22 2.05228 21.5523 2.5 21 2.5H1C0.447716 2.5 0 2.05228 0 1.5Z' }),
|
|
22
|
+
React.createElement("path", { className: lineTwoClassList, d: 'M0 7.5C0 6.94772 0.447715 6.5 1 6.5H21C21.5523 6.5 22 6.94772 22 7.5C22 8.05228 21.5523 8.5 21 8.5H1C0.447716 8.5 0 8.05228 0 7.5Z' }),
|
|
23
|
+
React.createElement("path", { className: lineThreeClassList, d: 'M0 13.5C0 12.9477 0.447715 12.5 1 12.5H21C21.5523 12.5 22 12.9477 22 13.5C22 14.0523 21.5523 14.5 21 14.5H1C0.447716 14.5 0 14.0523 0 13.5Z' }))));
|
|
24
|
+
};
|
|
25
|
+
export default HamburgerIcon;
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/components/HamburgerIcon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,MAAM,MAAM,oBAAoB,CAAA;AAOvC,MAAM,aAAa,GAAG,CAAC,EACrB,EAAE,EACF,SAAS,EACT,OAAO,EACD,EAAe,EAAE;IACvB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAC3C,MAAM,gBAAgB,GAAG,UAAU,CAAC;QAClC,0DAA0D,EAAE,MAAM;KACnE,EAAE,+DAA+D,CAAC,CAAA;IAEnE,MAAM,gBAAgB,GAAG,UAAU,CAAC;QAClC,WAAW,EAAE,MAAM;KACpB,EAAE,yDAAyD,CAAC,CAAA;IAE7D,MAAM,kBAAkB,GAAG,UAAU,CAAC;QACpC,4DAA4D,EAAE,MAAM;KACrE,EAAE,kEAAkE,CAAC,CAAA;IAEtE,MAAM,YAAY,GAAG,CAAC,CAAM,EAAQ,EAAE;QACpC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAA;QAClB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,CAAC,CAAC,CAAA;IACd,CAAC,CAAA;IAED,OAAO,CACL,oBAAC,MAAM,IACL,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,EAC/B,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,MAAM;QAEX,6BACE,SAAS,EAAC,gHAAgH,EAC1H,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,KAAK,EAAC,4BAA4B;YAElC,8BACE,SAAS,EAAE,gBAAgB,EAC3B,CAAC,EAAC,sIAAsI,GACxI;YACF,8BACE,SAAS,EAAE,gBAAgB,EAC3B,CAAC,EAAC,oIAAoI,GACtI;YACF,8BACE,SAAS,EAAE,kBAAkB,EAC7B,CAAC,EAAC,6IAA6I,GAC/I,CACE,CACC,CACV,CAAA;AACH,CAAC,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import Icon from './index';
|
|
3
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
4
|
+
declare const componentMeta: ComponentMeta<typeof Icon>;
|
|
5
|
+
export declare const _Icon: ComponentStory<({ id, className, type, size, animation, reverseSpin, hollow, colour, bgColour, hoverColour, hoverBgColour, rounded, brand }: import("./index").Props) => JSX.Element>;
|
|
6
|
+
export default componentMeta;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Icon from './index';
|
|
3
|
+
import { idAndClassName } from '../../utils/controls';
|
|
4
|
+
const componentMeta = {
|
|
5
|
+
title: 'Trepur Components/Rupert Bennett/Atoms/Icon',
|
|
6
|
+
component: Icon,
|
|
7
|
+
argTypes: Object.assign(Object.assign({}, idAndClassName), { type: {
|
|
8
|
+
options: ['heart', 'arrow-up', 'arrow-down', 'multiply', 'burger', 'bars'],
|
|
9
|
+
type: { name: 'string', required: false },
|
|
10
|
+
description: 'The name of the icon to display in the component',
|
|
11
|
+
table: {
|
|
12
|
+
type: { summary: 'string' }
|
|
13
|
+
},
|
|
14
|
+
control: 'select'
|
|
15
|
+
}, size: {
|
|
16
|
+
type: { name: 'number', required: false },
|
|
17
|
+
description: 'The size of the icon to show in the component',
|
|
18
|
+
table: {
|
|
19
|
+
type: { summary: 'number' }
|
|
20
|
+
}
|
|
21
|
+
}, animation: {
|
|
22
|
+
type: { name: 'string', required: false },
|
|
23
|
+
options: ['none', 'pulse', 'spin', 'beat'],
|
|
24
|
+
description: 'Type of annimation to apply to the component',
|
|
25
|
+
table: {
|
|
26
|
+
type: { summary: 'string' }
|
|
27
|
+
},
|
|
28
|
+
control: 'select'
|
|
29
|
+
}, reverseSpin: {
|
|
30
|
+
type: { name: 'boolean', required: false },
|
|
31
|
+
description: 'To reverse the animation on the component',
|
|
32
|
+
table: {
|
|
33
|
+
type: { summary: 'boolean' }
|
|
34
|
+
},
|
|
35
|
+
defaultValue: 'false'
|
|
36
|
+
}, hollow: {
|
|
37
|
+
type: { name: 'boolean', required: false },
|
|
38
|
+
description: 'To render a hollow version of the icon in component',
|
|
39
|
+
table: {
|
|
40
|
+
type: { summary: 'boolean' }
|
|
41
|
+
},
|
|
42
|
+
defaultValue: 'false'
|
|
43
|
+
}, colour: {
|
|
44
|
+
type: { name: 'string', required: false },
|
|
45
|
+
options: ['primary', 'secondary', 'white', 'black', 'gold'],
|
|
46
|
+
description: 'The font colour of the component',
|
|
47
|
+
table: {
|
|
48
|
+
type: { summary: 'string' }
|
|
49
|
+
},
|
|
50
|
+
defaultValue: 'primary',
|
|
51
|
+
control: 'select'
|
|
52
|
+
}, bgColour: {
|
|
53
|
+
type: { name: 'string', required: false },
|
|
54
|
+
options: ['primary', 'secondary', 'white', 'black', 'gold'],
|
|
55
|
+
description: 'The background colour of the component',
|
|
56
|
+
table: {
|
|
57
|
+
type: { summary: 'string' }
|
|
58
|
+
},
|
|
59
|
+
defaultValue: 'secondary',
|
|
60
|
+
control: 'select'
|
|
61
|
+
}, rounded: {
|
|
62
|
+
type: { name: 'boolean', required: false },
|
|
63
|
+
description: 'Sets the component to a circle shape',
|
|
64
|
+
table: {
|
|
65
|
+
type: { summary: 'boolean' }
|
|
66
|
+
},
|
|
67
|
+
defaultValue: 'false'
|
|
68
|
+
}, brand: {
|
|
69
|
+
type: { name: 'boolean', required: false },
|
|
70
|
+
description: 'Set to true if the icon type to render is a brand image',
|
|
71
|
+
table: {
|
|
72
|
+
type: { summary: 'boolean' }
|
|
73
|
+
},
|
|
74
|
+
defaultValue: 'false'
|
|
75
|
+
} }),
|
|
76
|
+
args: {
|
|
77
|
+
type: 'heart',
|
|
78
|
+
size: 3,
|
|
79
|
+
animation: 'none',
|
|
80
|
+
hoverBgColour: 'primary',
|
|
81
|
+
hoverColour: 'secondary'
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const Template = (args) => React.createElement(Icon, Object.assign({}, args));
|
|
85
|
+
export const _Icon = Template.bind({});
|
|
86
|
+
export default componentMeta;
|
|
87
|
+
//# sourceMappingURL=Icon.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.stories.js","sourceRoot":"","sources":["../../../../../src/lib/components/Icon/Icon.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,IAAI,MAAM,SAAS,CAAA;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAGhD,MAAM,aAAa,GAA+B;IAChD,KAAK,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O;QACb,IAAI,EAAE,CAAC;QACP,SAAS,EAAE,MAAM;QACjB,aAAa,EAAE,SAAS;QACxB,WAAW,EAAE,WAAW;KACzB;CACF,CAAA;AAED,MAAM,QAAQ,GAAgC,CAAC,IAAI,EAAE,EAAE,CAAC,oBAAC,IAAI,oBAAK,IAAI,EAAI,CAAA;AAE1E,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAEtC,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Colours } from '../../utils/controls';
|
|
3
|
+
export interface Props {
|
|
4
|
+
id?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
type: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
animation?: 'pulse' | 'none';
|
|
9
|
+
reverseSpin?: boolean;
|
|
10
|
+
hollow?: boolean;
|
|
11
|
+
colour?: Colours;
|
|
12
|
+
bgColour?: Colours;
|
|
13
|
+
hoverColour?: Colours;
|
|
14
|
+
hoverBgColour?: Colours;
|
|
15
|
+
rounded?: boolean;
|
|
16
|
+
brand?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const Icon: ({ id, className, type, size, animation, reverseSpin, hollow, colour, bgColour, hoverColour, hoverBgColour, rounded, brand }: Props) => JSX.Element;
|
|
19
|
+
export default Icon;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
const Icon = ({ id, className, type, size = 1, animation = 'none', reverseSpin = false, hollow = false, colour = 'primary', bgColour = 'secondary', hoverColour = 'primary', hoverBgColour = 'secondary', rounded = false, brand = false }) => {
|
|
4
|
+
const fontColour = {
|
|
5
|
+
primary: 'text-primary',
|
|
6
|
+
secondary: 'text-secondary',
|
|
7
|
+
white: 'text-white',
|
|
8
|
+
black: 'text-black',
|
|
9
|
+
gold: 'text-gold'
|
|
10
|
+
};
|
|
11
|
+
const backgroundColour = {
|
|
12
|
+
primary: 'bg-primary',
|
|
13
|
+
secondary: 'bg-secondary',
|
|
14
|
+
white: 'bg-white',
|
|
15
|
+
black: 'bg-black',
|
|
16
|
+
gold: 'bg-gold'
|
|
17
|
+
};
|
|
18
|
+
const hoverFontColour = {
|
|
19
|
+
primary: 'group-hover:text-primary',
|
|
20
|
+
secondary: 'group-hover:text-secondary',
|
|
21
|
+
white: 'group-hover:text-white',
|
|
22
|
+
black: 'group-hover:text-black',
|
|
23
|
+
gold: 'group-hover:text-gold'
|
|
24
|
+
};
|
|
25
|
+
const hoverBackgroundColour = {
|
|
26
|
+
primary: 'group-hover:bg-primary',
|
|
27
|
+
secondary: 'group-hover:bg-secondary',
|
|
28
|
+
white: 'group-hover:bg-white',
|
|
29
|
+
black: 'group-hover:bg-black',
|
|
30
|
+
gold: 'group-hover:bg-gold'
|
|
31
|
+
};
|
|
32
|
+
const wrapperClassList = classNames({
|
|
33
|
+
'w-6 h-6': size === 1,
|
|
34
|
+
'w-10 h-10': size === 2,
|
|
35
|
+
'w-14 h-14': size === 3,
|
|
36
|
+
'w-20 h-20': size === 4,
|
|
37
|
+
'w-24 h-24': size === 5,
|
|
38
|
+
'w-28 h-28': size === 6,
|
|
39
|
+
'w-32 h-32': size === 7,
|
|
40
|
+
'w-36 h-36': size === 8,
|
|
41
|
+
'w-40 h-40': size === 9,
|
|
42
|
+
'w-44 h-44': size === 10,
|
|
43
|
+
'rounded-full': rounded
|
|
44
|
+
}, className, backgroundColour[bgColour], fontColour[colour], hoverBackgroundColour[hoverBgColour], hoverFontColour[hoverColour], 'flex transition-backgroundColor duration-500 transform');
|
|
45
|
+
const classList = classNames({
|
|
46
|
+
'fa-brands': brand,
|
|
47
|
+
[`fa-${size}x`]: size,
|
|
48
|
+
[`fa-${animation}`]: animation,
|
|
49
|
+
'fa-spin-reverse': reverseSpin,
|
|
50
|
+
'fa-regular': hollow
|
|
51
|
+
}, `fa fa-${type} mx-auto my-auto`);
|
|
52
|
+
return (React.createElement("div", { id: id, className: wrapperClassList },
|
|
53
|
+
React.createElement("span", { className: classList, role: 'img', "aria-hidden": 'true', "aria-label": type })));
|
|
54
|
+
};
|
|
55
|
+
export default Icon;
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/components/Icon/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,UAAU,MAAM,YAAY,CAAA;AAmBnC,MAAM,IAAI,GAAG,CAAC,EACZ,EAAE,EACF,SAAS,EACT,IAAI,EACJ,IAAI,GAAG,CAAC,EACR,SAAS,GAAG,MAAM,EAClB,WAAW,GAAG,KAAK,EACnB,MAAM,GAAG,KAAK,EACd,MAAM,GAAG,SAAS,EAClB,QAAQ,GAAG,WAAW,EACtB,WAAW,GAAG,SAAS,EACvB,aAAa,GAAG,WAAW,EAC3B,OAAO,GAAG,KAAK,EACf,KAAK,GAAG,KAAK,EACP,EAAe,EAAE;IACvB,MAAM,UAAU,GAAiC;QAC/C,OAAO,EAAE,cAAc;QACvB,SAAS,EAAE,gBAAgB;QAC3B,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,YAAY;QACnB,IAAI,EAAE,WAAW;KAClB,CAAA;IAED,MAAM,gBAAgB,GAAiC;QACrD,OAAO,EAAE,YAAY;QACrB,SAAS,EAAE,cAAc;QACzB,KAAK,EAAE,UAAU;QACjB,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,SAAS;KAChB,CAAA;IAED,MAAM,eAAe,GAAiC;QACpD,OAAO,EAAE,0BAA0B;QACnC,SAAS,EAAE,4BAA4B;QACvC,KAAK,EAAE,wBAAwB;QAC/B,KAAK,EAAE,wBAAwB;QAC/B,IAAI,EAAE,uBAAuB;KAC9B,CAAA;IAED,MAAM,qBAAqB,GAAiC;QAC1D,OAAO,EAAE,wBAAwB;QAC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
2
|
+
import Image from '.';
|
|
3
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
4
|
+
declare const componentMeta: ComponentMeta<typeof Image>;
|
|
5
|
+
export declare const _Image: ComponentStory<({ id, className, image, altText, title, rounded, roundedFull, height, width, overlayText, centerAligned }: import(".").Props) => JSX.Element>;
|
|
6
|
+
export default componentMeta;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Image from '.';
|
|
3
|
+
import { idAndClassName } from '../../utils/controls';
|
|
4
|
+
import logo from '@assets/images/primary-logo.png';
|
|
5
|
+
const componentMeta = {
|
|
6
|
+
title: 'Trepur Components/Rupert Bennett/Atoms/Image',
|
|
7
|
+
component: Image,
|
|
8
|
+
argTypes: Object.assign(Object.assign({}, idAndClassName), { image: {
|
|
9
|
+
type: { name: 'string', required: false },
|
|
10
|
+
description: 'The image to display on the component',
|
|
11
|
+
table: {
|
|
12
|
+
type: { summary: 'default' }
|
|
13
|
+
}
|
|
14
|
+
}, altText: {
|
|
15
|
+
type: { name: 'string', required: false },
|
|
16
|
+
description: 'The accessibility alt text for the image on the component',
|
|
17
|
+
table: {
|
|
18
|
+
type: { summary: 'default' }
|
|
19
|
+
}
|
|
20
|
+
}, title: {
|
|
21
|
+
type: { name: 'string', required: false },
|
|
22
|
+
description: 'The accessibility title for the image on the component',
|
|
23
|
+
table: {
|
|
24
|
+
type: { summary: 'default' }
|
|
25
|
+
}
|
|
26
|
+
}, rounded: {
|
|
27
|
+
type: { name: 'boolean', required: false },
|
|
28
|
+
description: 'Sets the corners of the component to rounded',
|
|
29
|
+
table: {
|
|
30
|
+
type: { summary: 'boolean' }
|
|
31
|
+
}
|
|
32
|
+
}, roundedFull: {
|
|
33
|
+
type: { name: 'boolean', required: false },
|
|
34
|
+
description: 'Sets the component to a circle shape',
|
|
35
|
+
table: {
|
|
36
|
+
type: { summary: 'boolean' }
|
|
37
|
+
}
|
|
38
|
+
}, height: {
|
|
39
|
+
type: { name: 'number', required: false },
|
|
40
|
+
description: 'Defines the height of the component',
|
|
41
|
+
table: {
|
|
42
|
+
type: { summary: 'number' }
|
|
43
|
+
}
|
|
44
|
+
}, width: {
|
|
45
|
+
type: { name: 'number', required: false },
|
|
46
|
+
description: 'Defines the width of the component',
|
|
47
|
+
table: {
|
|
48
|
+
type: { summary: 'number' }
|
|
49
|
+
}
|
|
50
|
+
}, overlayText: {
|
|
51
|
+
type: { name: 'string', required: false },
|
|
52
|
+
description: 'The text to show when hovering over the component',
|
|
53
|
+
table: {
|
|
54
|
+
type: { summary: 'default' }
|
|
55
|
+
}
|
|
56
|
+
}, centerAligned: {
|
|
57
|
+
type: { name: 'boolean', required: false },
|
|
58
|
+
description: 'Sets the component to the center',
|
|
59
|
+
table: {
|
|
60
|
+
type: { summary: 'boolean' }
|
|
61
|
+
}
|
|
62
|
+
} }),
|
|
63
|
+
args: {
|
|
64
|
+
image: logo,
|
|
65
|
+
height: 8,
|
|
66
|
+
width: 8,
|
|
67
|
+
overlayText: 'logo'
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const Template = (args) => React.createElement(Image, Object.assign({}, args));
|
|
71
|
+
export const _Image = Template.bind({});
|
|
72
|
+
export default componentMeta;
|
|
73
|
+
//# sourceMappingURL=Image.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.stories.js","sourceRoot":"","sources":["../../../../../src/lib/components/Image/Image.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,MAAM,GAAG,CAAA;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,IAAI,MAAM,iCAAiC,CAAA;AAElD,MAAM,aAAa,GAAgC;IACjD,KAAK,EAAE,8CAA8C;IACrD,SAAS,EAAE,KAAK;IAChB,QAAQ,kCACH,cAAc,KACjB,KAAK,EAAE;YACL,IAAI,EAAE,EAAE,IAAI,E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,oCAAoC;YACjD,KAAK,EAAE;gBACL,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;aAC5B;SACF,EACD,WAAW,EAAE;YACX,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE;YACzC,WAAW,EAAE,mDAAmD;YAChE,KAAK,EAAE;gBACL,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;aAC7B;SACF,EACD,aAAa,EAAE;YACb,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;YAC1C,WAAW,EAAE,kCAAkC;YAC/C,KAAK,EAAE;gBACL,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;aAC7B;SACF,GACF;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,CAAC;QACT,KAAK,EAAE,CAAC;QACR,WAAW,EAAE,MAAM;KACpB;CACF,CAAA;AAED,MAAM,QAAQ,GAAiC,CAAC,IAAI,EAAE,EAAE,CAAC,oBAAC,KAAK,oBAAK,IAAI,EAAI,CAAA;AAE5E,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAEvC,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface Props {
|
|
3
|
+
id?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
image?: string;
|
|
6
|
+
altText?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
rounded?: boolean;
|
|
9
|
+
roundedFull?: boolean;
|
|
10
|
+
height?: number;
|
|
11
|
+
width?: number;
|
|
12
|
+
overlayText?: string;
|
|
13
|
+
centerAligned?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare const Image: ({ id, className, image, altText, title, rounded, roundedFull, height, width, overlayText, centerAligned }: Props) => JSX.Element;
|
|
16
|
+
export default Image;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
const Image = ({ id, className, image, altText, title, rounded = false, roundedFull = false, height = 8, width = 8, overlayText, centerAligned = false }) => {
|
|
4
|
+
const [isHovering, setIsHovering] = useState(false);
|
|
5
|
+
const opacity = classNames({
|
|
6
|
+
'opacity-80': isHovering,
|
|
7
|
+
'opacity-0': !isHovering
|
|
8
|
+
});
|
|
9
|
+
const widthClassList = classNames({
|
|
10
|
+
'w-6': width === 1,
|
|
11
|
+
'w-10': width === 2,
|
|
12
|
+
'w-14': width === 3,
|
|
13
|
+
'w-16': width === 4,
|
|
14
|
+
'w-20': width === 5,
|
|
15
|
+
'w-24': width === 6,
|
|
16
|
+
'w-28': width === 7,
|
|
17
|
+
'w-32': width === 8,
|
|
18
|
+
'w-36': width === 9,
|
|
19
|
+
'w-40': width === 10,
|
|
20
|
+
'w-44': width === 11,
|
|
21
|
+
'w-full': (width === undefined) || (![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].includes(width))
|
|
22
|
+
});
|
|
23
|
+
const heightClassList = classNames({
|
|
24
|
+
'h-6': height === 1,
|
|
25
|
+
'h-10': height === 2,
|
|
26
|
+
'h-14': height === 3,
|
|
27
|
+
'h-16': height === 4,
|
|
28
|
+
'h-20': height === 5,
|
|
29
|
+
'h-24': height === 6,
|
|
30
|
+
'h-28': height === 7,
|
|
31
|
+
'h-32': height === 8,
|
|
32
|
+
'h-36': height === 9,
|
|
33
|
+
'h-40': height === 10,
|
|
34
|
+
'h-44': height === 11,
|
|
35
|
+
'h-full': (height === undefined) || (![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].includes(height))
|
|
36
|
+
});
|
|
37
|
+
const imageClassList = classNames({
|
|
38
|
+
'rounded-2xl': rounded,
|
|
39
|
+
'rounded-full': roundedFull,
|
|
40
|
+
'mx-auto': centerAligned
|
|
41
|
+
}, className, widthClassList, heightClassList);
|
|
42
|
+
const overlayClassList = classNames(widthClassList, heightClassList, opacity, 'absolute z-10 transition-opacity duration-700 bg-white');
|
|
43
|
+
const overlayTextWrapperClassList = classNames(widthClassList, heightClassList, opacity, 'flex absolute z-20 transition-opacity duration-700');
|
|
44
|
+
const overlayTextClassList = 'm-auto text-center text-primary';
|
|
45
|
+
return (React.createElement(React.Fragment, null,
|
|
46
|
+
overlayText !== undefined &&
|
|
47
|
+
React.createElement(React.Fragment, null,
|
|
48
|
+
React.createElement("div", { className: overlayClassList }),
|
|
49
|
+
React.createElement("div", { className: overlayTextWrapperClassList, onMouseEnter: () => setIsHovering(true), onMouseLeave: () => setIsHovering(false) },
|
|
50
|
+
React.createElement("p", { className: overlayTextClassList }, overlayText))),
|
|
51
|
+
React.createElement("img", Object.assign({ id: id, className: imageClassList, src: image }, (altText !== undefined && { alt: altText }), (title !== undefined && { title })))));
|
|
52
|
+
};
|
|
53
|
+
export default Image;
|
|
54
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/components/Image/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,UAAU,MAAM,YAAY,CAAA;AAgBnC,MAAM,KAAK,GAAG,CAAC,EACb,EAAE,EACF,SAAS,EACT,KAAK,EACL,OAAO,EACP,KAAK,EACL,OAAO,GAAG,KAAK,EACf,WAAW,GAAG,KAAK,EACnB,MAAM,GAAG,CAAC,EACV,KAAK,GAAG,CAAC,EACT,WAAW,EACX,aAAa,GAAG,KAAK,EACf,EAAe,EAAE;IACvB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACnD,MAAM,OAAO,GAAG,UAAU,CAAC;QACzB,YAAY,EAAE,UAAU;QACxB,WAAW,EAAE,CAAC,UAAU;KACzB,CAA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ComponentMeta } from '@storybook/react';
|
|
4
|
+
declare const componentMeta: ComponentMeta<typeof ImageLink>;
|
|
5
|
+
export declare const _ImageLink: ComponentStory<({ id, className, image, altText, title, link, rounded, openInNewTab, buttonProps }: import("./index").Props) => JSX.Element>;
|
|
6
|
+
export declare const _ImageLinkWithTitle: ComponentStory<({ id, className, image, altText, title, link, rounded, openInNewTab, buttonProps }: import("./index").Props) => JSX.Element>;
|
|
7
|
+
export declare const _ImageLinkWithButton: ComponentStory<({ id, className, image, altText, title, link, rounded, openInNewTab, buttonProps }: import("./index").Props) => JSX.Element>;
|
|
8
|
+
export declare const _ImageLinkRounded: ComponentStory<({ id, className, image, altText, title, link, rounded, openInNewTab, buttonProps }: import("./index").Props) => JSX.Element>;
|
|
9
|
+
export default componentMeta;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { idAndClassName } from '../../utils/controls';
|
|
3
|
+
import Column from '../Column';
|
|
4
|
+
import ImageLink from './index';
|
|
5
|
+
const componentMeta = {
|
|
6
|
+
title: 'Trepur Components/Other/Organisms/Image Link',
|
|
7
|
+
component: ImageLink,
|
|
8
|
+
parameters: {},
|
|
9
|
+
argTypes: Object.assign(Object.assign({}, idAndClassName), { title: {
|
|
10
|
+
description: '',
|
|
11
|
+
control: 'text',
|
|
12
|
+
table: {
|
|
13
|
+
category: ''
|
|
14
|
+
}
|
|
15
|
+
}, image: {
|
|
16
|
+
description: '',
|
|
17
|
+
control: 'text',
|
|
18
|
+
table: {
|
|
19
|
+
category: ''
|
|
20
|
+
}
|
|
21
|
+
} }),
|
|
22
|
+
args: {
|
|
23
|
+
image: 'https://picsum.photos/400/400',
|
|
24
|
+
link: '/'
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const Template = (args) => React.createElement(Column, { sm: 3, md: 3 },
|
|
28
|
+
React.createElement(ImageLink, Object.assign({}, args)));
|
|
29
|
+
export const _ImageLink = Template.bind({});
|
|
30
|
+
_ImageLink.args = {};
|
|
31
|
+
export const _ImageLinkWithTitle = Template.bind({});
|
|
32
|
+
_ImageLinkWithTitle.args = {
|
|
33
|
+
title: 'Title'
|
|
34
|
+
};
|
|
35
|
+
export const _ImageLinkWithButton = Template.bind({});
|
|
36
|
+
_ImageLinkWithButton.args = {
|
|
37
|
+
buttonProps: {
|
|
38
|
+
children: 'Button 1'
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
export const _ImageLinkRounded = Template.bind({});
|
|
42
|
+
_ImageLinkRounded.args = {
|
|
43
|
+
title: 'Title',
|
|
44
|
+
buttonProps: {
|
|
45
|
+
children: 'Button 1'
|
|
46
|
+
},
|
|
47
|
+
rounded: true
|
|
48
|
+
};
|
|
49
|
+
export default componentMeta;
|
|
50
|
+
//# sourceMappingURL=ImageLink.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageLink.stories.js","sourceRoot":"","sources":["../../../../../src/lib/components/ImageLink/ImageLink.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,MAAM,MAAM,oBAAoB,CAAA;AACvC,OAAO,SAAS,MAAM,SAAS,CAAA;AAG/B,MAAM,aAAa,GAAoC;IACrD,KAAK,EAAE,8CAA8C;IACrD,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,EAAE;IACd,QAAQ,kCACH,cAAc,KACjB,KAAK,EAAE;YACL,WAAW,EAAE,EAAE;YACf,OAAO,EAAE,MAAM;YACf,KAAK,EAAE;gBACL,QAAQ,EAAE,EAAE;aACb;SACF,EACD,KAAK,EAAE;YACL,WAAW,EAAE,EAAE;YACf,OAAO,EAAE,MAAM;YACf,KAAK,EAAE;gBACL,QAAQ,EAAE,EAAE;aACb;SACF,GACF;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,+BAA+B;QACtC,IAAI,EAAE,GAAG;KACV;CACF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