trepur_components 2.3.7 → 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/.eslintrc.cjs +33 -4
- package/.prettierignore +10 -0
- package/README.md +1 -1
- package/package.json +9 -5
- package/src/components/Accordion/Accordion.stories.tsx +21 -98
- package/src/components/Accordion/const.tsx +34 -0
- package/src/components/Accordion/index.tsx +19 -25
- package/src/components/AlertBar/AlertBar.stories.tsx +78 -84
- package/src/components/AlertBar/index.tsx +69 -100
- package/src/components/Avatar/Avatar.stories.tsx +2 -7
- package/src/components/Avatar/index.tsx +4 -7
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +29 -0
- package/src/components/Breadcrumbs/index.tsx +89 -0
- package/src/components/Button/Button.stories.tsx +24 -0
- package/src/components/Button/index.tsx +59 -0
- package/src/components/Calendar/Calendar.stories.tsx +21 -0
- package/src/components/Calendar/index.tsx +92 -0
- package/src/components/Card/Card.stories.tsx +14 -0
- package/src/components/Card/index.tsx +39 -0
- package/src/components/Carousel/Carousel.stories.tsx +44 -0
- package/src/components/Carousel/index.tsx +301 -0
- package/src/components/Carousel/utils.ts +53 -0
- package/src/components/CarouselThumbnail/CarouselThumbnail.stories.tsx +29 -0
- package/src/components/CarouselThumbnail/const.ts +17 -0
- package/src/components/CarouselThumbnail/index.tsx +169 -0
- package/src/components/CarouselThumbnail/utils.ts +87 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +27 -0
- package/src/components/Checkbox/index.tsx +44 -0
- package/src/components/Collapsible/Collapsible.stories.tsx +67 -0
- package/src/components/Collapsible/index.tsx +169 -0
- package/src/components/Counter/Counter.stories.tsx +20 -0
- package/src/components/Counter/index.tsx +98 -0
- package/src/components/DetailUpdater/DetailUpdater.stories.tsx +37 -0
- package/{archive → src/components}/DetailUpdater/index.tsx +20 -25
- package/src/components/Dialog/Dialog.stories.tsx +65 -0
- package/src/components/Dialog/index.tsx +29 -0
- 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/{archive → src/components}/FileUploader/FilePreview.tsx +11 -14
- package/src/components/FileUploader/FileUploader.stories.tsx +28 -0
- package/src/components/FileUploader/index.tsx +177 -0
- package/src/components/Footer/Footer.stories.tsx +47 -0
- package/src/components/Footer/index.tsx +96 -0
- package/src/components/FooterNav/FooterNav.stories.tsx +32 -0
- package/src/components/FooterNav/index.tsx +75 -0
- package/{archive → src/components}/Form/Form.stories.tsx +2 -2
- package/src/components/Form/index.tsx +41 -0
- package/src/components/Gallery/Gallery.stories.tsx +39 -0
- package/src/components/Gallery/index.tsx +31 -0
- package/src/components/Greeting/Greeting.stories.tsx +16 -0
- package/src/components/Greeting/index.tsx +49 -0
- package/src/components/HamburgerIcon/HamburgerIcon.stories.tsx +14 -0
- package/src/components/HamburgerIcon/index.tsx +75 -0
- package/src/components/Icon/Icon.stories.tsx +41 -0
- package/src/components/Icon/index.tsx +33 -0
- package/src/components/Image/Image.stories.tsx +17 -0
- package/src/components/Image/index.tsx +25 -0
- package/src/components/ImageCard/ImageCard.stories.tsx +29 -0
- package/src/components/ImageCard/index.tsx +75 -0
- package/src/components/Input/Input.stories.tsx +25 -0
- package/src/components/Input/index.tsx +139 -0
- package/{archive → src/components}/MenuButton/MenuButton.stories.tsx +2 -2
- package/src/components/MenuButton/index.tsx +66 -0
- package/{archive → src/components}/Modal/Modal.stories.tsx +4 -8
- package/{archive → src/components}/Modal/index.tsx +9 -12
- package/src/components/Nav/Nav.stories.tsx +80 -0
- package/src/components/Nav/index.tsx +171 -0
- package/src/components/NavItem/NavItem.stories.tsx +17 -0
- package/src/components/NavItem/index.tsx +39 -0
- package/src/components/Pill/Pill.stories.tsx +51 -0
- package/src/components/Pill/index.tsx +69 -0
- package/{archive → src/components}/Search/Search.stories.tsx +2 -2
- package/{archive → src/components}/Search/index.tsx +12 -16
- package/{archive → src/components}/Select/Select.stories.tsx +2 -3
- package/{archive → src/components}/Select/index.tsx +21 -30
- package/{archive → src/components}/Showcase/Showcase.stories.tsx +4 -3
- package/src/components/Showcase/index.tsx +62 -0
- package/{archive → src/components}/SideNav/SideNav.stories.tsx +2 -2
- package/{archive → src/components}/SideNav/index.tsx +8 -15
- package/{archive → src/components}/SocialButton/SocialButton.stories.tsx +2 -2
- package/{archive → src/components}/SocialButton/index.tsx +14 -22
- 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 +37 -0
- package/src/components/Testimonial/index.tsx +123 -0
- package/src/components/TextArea/TextArea.stories.tsx +24 -0
- package/src/components/TextArea/index.tsx +133 -0
- package/src/components/Timeline/Timeline.stories.tsx +45 -0
- package/src/components/Timeline/index.tsx +65 -0
- package/src/components/Tubestops/Tubestops.stories.tsx +22 -0
- package/src/components/Tubestops/index.tsx +132 -0
- package/src/components/Video/Video.stories.tsx +58 -0
- 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 +92 -0
- package/src/components/index.ts +66 -112
- package/src/custom.d.ts +14 -0
- package/src/documentation/Colours.mdx +34 -34
- 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/documentation/typography/Fonts/Fonts.stories.tsx +14 -0
- package/src/documentation/typography/Fonts/Fonts.tsx +73 -0
- package/src/styles/global.css +1 -1
- package/src/styles/themes/local.css +91 -39
- 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/tsconfig.json +8 -2
- package/archive/Breadcrumbs/Breadcrumbs.stories.tsx +0 -46
- package/archive/Breadcrumbs/index.tsx +0 -42
- package/archive/BreadcrumbsBordered/BreadcrumbsBordered.stories.tsx +0 -52
- package/archive/BreadcrumbsBordered/index.tsx +0 -44
- package/archive/BreadcrumbsItem/BreadcrumbsItem.stories.tsx +0 -40
- package/archive/BreadcrumbsItem/index.tsx +0 -149
- package/archive/Button/Button.stories.tsx +0 -150
- package/archive/Button/index.tsx +0 -111
- package/archive/Button/style.module.css +0 -76
- package/archive/Calendar/Calendar.stories.tsx +0 -82
- package/archive/Calendar/index.tsx +0 -76
- package/archive/Card/Card.stories.tsx +0 -75
- package/archive/Card/index.tsx +0 -102
- package/archive/Card/style.module.css +0 -75
- package/archive/CardWithTopImage/CardWithTopImage.stories.tsx +0 -50
- package/archive/CardWithTopImage/index.tsx +0 -39
- package/archive/CardWithTopImage/style.module.css +0 -11
- package/archive/Carousel/Carousel.stories.tsx +0 -451
- package/archive/Carousel/index.tsx +0 -388
- package/archive/Carousel/style.module.css +0 -99
- package/archive/CarouselThumbnail/CarouselThumbnail.stories.tsx +0 -350
- package/archive/CarouselThumbnail/index.tsx +0 -302
- package/archive/CarouselThumbnail/style.module.css +0 -67
- package/archive/Checkbox/Checkbox.stories.tsx +0 -34
- package/archive/Checkbox/index.tsx +0 -51
- package/archive/Checkbox/style.module.css +0 -15
- package/archive/Collapsible/Collapsible.stories.tsx +0 -67
- package/archive/Collapsible/index.tsx +0 -116
- package/archive/Collapsible/style.module.css +0 -47
- package/archive/Column/Column.stories.tsx +0 -89
- package/archive/Column/index.tsx +0 -119
- package/archive/Column/style.module.css +0 -151
- package/archive/ComponentWrapper/ComponentWrapper.stories.tsx +0 -40
- package/archive/ComponentWrapper/index.tsx +0 -55
- package/archive/ComponentWrapper/style.module.css +0 -40
- package/archive/Container/Container.stories.tsx +0 -40
- package/archive/Container/index.tsx +0 -24
- package/archive/Container/style.module.css +0 -4
- package/archive/Counter/Counter.stories.tsx +0 -19
- package/archive/Counter/index.tsx +0 -66
- package/archive/Counter/style.module.css +0 -19
- package/archive/DetailUpdater/DetailUpdater.stories.tsx +0 -96
- package/archive/DetailUpdater/style.module.css +0 -31
- package/archive/Dialog/Dialog.stories.tsx +0 -131
- package/archive/Dialog/index.tsx +0 -91
- package/archive/Dialog/style.module.css +0 -44
- package/archive/DropdownMenu/DropdownMenu.stories.tsx +0 -59
- package/archive/DropdownMenu/index.tsx +0 -51
- package/archive/DropdownMenu/style.module.css +0 -38
- package/archive/DynamicTextSection/DynamicTextSection.stories.tsx +0 -74
- package/archive/DynamicTextSection/index.tsx +0 -36
- package/archive/DynamicTextSection/style.module.css +0 -0
- package/archive/FileUploader/FileUploader.stories.tsx +0 -28
- package/archive/FileUploader/index.tsx +0 -135
- package/archive/FileUploader/style.module.css +0 -54
- package/archive/FilterItem/FilterItem.stories.tsx +0 -33
- package/archive/FilterItem/index.tsx +0 -101
- package/archive/FilterItem/style.module.css +0 -27
- package/archive/Footer/Footer.stories.tsx +0 -59
- package/archive/Footer/index.tsx +0 -50
- package/archive/Footer/style.module.css +0 -19
- package/archive/FooterNav/FooterNav.stories.tsx +0 -125
- package/archive/FooterNav/index.tsx +0 -57
- package/archive/FooterNav/style.module.css +0 -32
- package/archive/FooterNavItem/FooterNavItem.stories.tsx +0 -53
- package/archive/FooterNavItem/index.tsx +0 -80
- package/archive/FooterNavItem/style.module.css +0 -139
- package/archive/Form/index.tsx +0 -61
- package/archive/Form/style.module.css +0 -0
- package/archive/FyreCard/FyreCard.stories.tsx +0 -31
- package/archive/FyreCard/index.tsx +0 -52
- package/archive/FyreCard/style.module.css +0 -19
- package/archive/Greeting/Greeting.stories.tsx +0 -41
- package/archive/Greeting/index.tsx +0 -32
- package/archive/HamburgerIcon/HamburgerIcon.stories.tsx +0 -32
- package/archive/HamburgerIcon/index.tsx +0 -103
- package/archive/HamburgerIcon/style.module.css +0 -85
- package/archive/HorizontalLine/HorizontalLine.stories.tsx +0 -54
- package/archive/HorizontalLine/index.tsx +0 -40
- package/archive/HorizontalLine/style.module.css +0 -55
- package/archive/Icon/Icon.stories.tsx +0 -164
- package/archive/Icon/index.tsx +0 -115
- package/archive/Icon/style.module.css +0 -253
- package/archive/IconCard/IconCard.stories.tsx +0 -46
- package/archive/IconCard/index.tsx +0 -57
- package/archive/IconCard/style.module.css +0 -18
- package/archive/Image/Image.stories.tsx +0 -87
- package/archive/Image/index.tsx +0 -132
- package/archive/Image/style.module.css +0 -109
- package/archive/ImageInfo/ImageInfo.stories.tsx +0 -39
- package/archive/ImageInfo/index.tsx +0 -95
- package/archive/ImageInfo/style.module.css +0 -47
- package/archive/ImageLink/ImageLink.stories.tsx +0 -37
- package/archive/ImageLink/index.tsx +0 -49
- package/archive/ImageLink/style.module.css +0 -23
- package/archive/ImageLinkList/ImageLinkList.stories.tsx +0 -34
- package/archive/ImageLinkList/index.tsx +0 -33
- package/archive/ImageLinkList/style.module.css +0 -3
- package/archive/InformationIcon/InformationIcon.stories.tsx +0 -83
- package/archive/InformationIcon/index.tsx +0 -128
- package/archive/InformationIcon/style.module.css +0 -71
- package/archive/InformationIconBlock/InformationIconBlock.stories.tsx +0 -32
- package/archive/InformationIconBlock/index.tsx +0 -63
- package/archive/InformationIconBlock/style.module.css +0 -7
- package/archive/Input/Input.stories.tsx +0 -84
- package/archive/Input/index.tsx +0 -131
- package/archive/Input/style.module.css +0 -60
- package/archive/Jumbotron/Jumbotron.stories.tsx +0 -21
- package/archive/Jumbotron/index.tsx +0 -31
- package/archive/Jumbotron/style.module.css +0 -8
- package/archive/MenuButton/index.tsx +0 -82
- package/archive/MenuButton/style.module.css +0 -45
- package/archive/Modal/style.module.css +0 -35
- package/archive/NavItem/NavItem.stories.tsx +0 -90
- package/archive/NavItem/index.tsx +0 -65
- package/archive/NavItem/style.module.css +0 -71
- package/archive/NavOld/NavOld.stories.tsx +0 -193
- package/archive/NavOld/StickyNav.tsx +0 -191
- package/archive/NavOld/index.tsx +0 -273
- package/archive/NavOld/style.module.css +0 -156
- package/archive/NavTwo/Dropdown.tsx +0 -35
- package/archive/NavTwo/Nav.stories.tsx +0 -38
- package/archive/NavTwo/Sidebar.tsx +0 -34
- package/archive/NavTwo/StickyNav.tsx +0 -34
- package/archive/NavTwo/index.tsx +0 -45
- package/archive/NavTwo/style.module.css +0 -35
- package/archive/NewsCard/NewsCard.stories.tsx +0 -72
- package/archive/NewsCard/index.tsx +0 -57
- package/archive/NewsCard/style.module.css +0 -15
- package/archive/Pill/Pill.stories.tsx +0 -44
- package/archive/Pill/index.tsx +0 -64
- package/archive/Pill/style.module.css +0 -32
- package/archive/ProductCard/ProductCard.stories.tsx +0 -61
- package/archive/ProductCard/index.tsx +0 -111
- package/archive/ProductCard/style.module.css +0 -53
- package/archive/ProductCardV2/ProductCardV2.stories.tsx +0 -50
- package/archive/ProductCardV2/index.tsx +0 -119
- package/archive/ProductCardV2/style.module.css +0 -59
- package/archive/Proficiencies/Proficiencies.stories.tsx +0 -50
- package/archive/Proficiencies/index.tsx +0 -63
- package/archive/Proficiencies/style.module.css +0 -31
- package/archive/Profile/Profile.stories.tsx +0 -49
- package/archive/Profile/index.tsx +0 -103
- package/archive/Profile/style.module.css +0 -47
- package/archive/Row/Row.stories.tsx +0 -53
- package/archive/Row/index.tsx +0 -23
- package/archive/Row/style.module.css +0 -3
- package/archive/Search/style.module.css +0 -23
- package/archive/Select/style.module.css +0 -52
- package/archive/Showcase/index.tsx +0 -75
- package/archive/Showcase/style.module.css +0 -47
- package/archive/SideNav/style.module.css +0 -43
- package/archive/SocialBlock/SocialBlock.stories.tsx +0 -58
- package/archive/SocialBlock/index.tsx +0 -63
- package/archive/SocialButton/style.module.css +0 -77
- package/archive/StarRating/StarRating.stories.tsx +0 -23
- package/archive/StarRating/index.tsx +0 -71
- package/archive/Testimonial/Testimonial.stories.tsx +0 -110
- package/archive/Testimonial/index.tsx +0 -61
- package/archive/Testimonial/style.module.css +0 -27
- package/archive/TextAndTitle/TextAndTitle.stories.tsx +0 -70
- package/archive/TextAndTitle/index.tsx +0 -123
- package/archive/TextAndTitle/style.module.css +0 -75
- package/archive/TextArea/TextArea.stories.tsx +0 -55
- package/archive/TextArea/index.tsx +0 -125
- package/archive/TextArea/style.module.css +0 -60
- package/archive/Timeline/Timeline.stories.tsx +0 -92
- package/archive/Timeline/index.tsx +0 -254
- package/archive/Timeline/style.module.css +0 -134
- package/archive/TimelineV2/TimelineV2.stories.tsx +0 -95
- package/archive/TimelineV2/index.tsx +0 -70
- package/archive/TimelineV2/style.module.css +0 -28
- package/archive/Tubestops/Tubestops.stories.tsx +0 -42
- package/archive/Tubestops/index.tsx +0 -58
- package/archive/Tubestops/style.module.css +0 -54
- package/archive/UserIcon/UserIcon.stories.tsx +0 -52
- package/archive/UserIcon/index.tsx +0 -46
- package/archive/UserIcon/style.module.css +0 -19
- package/archive/Video/Video.stories.tsx +0 -23
- package/archive/Video/index.tsx +0 -47
- package/archive/theme.ts +0 -39
- package/archive/typography/Fonts/Fonts.stories.tsx +0 -14
- package/archive/typography/Fonts/Fonts.tsx +0 -181
- package/lib/components/Accordion/Accordion.stories.d.ts +0 -94
- package/lib/components/Accordion/index.d.ts +0 -8
- package/lib/components/Accordion/index.js +0 -15
- package/lib/components/AlertBar/AlertBar.stories.d.ts +0 -162
- 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 -4
- package/lib/components/index.d.ts +0 -4
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -6
- 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/screens.d.ts +0 -7
- package/src/styles/themes/palette.css +0 -131
- package/svg.d.ts +0 -4
- /package/{archive → src/components}/Calendar/style.css +0 -0
- /package/{archive → src/components}/Checkbox/Checkbox.mdx +0 -0
- /package/{archive → src}/fonts/Sora/OFL.txt +0 -0
- /package/{archive → src}/fonts/Sora/README.txt +0 -0
- /package/{archive → src}/fonts/Sora/Sora-VariableFont_wght.ttf +0 -0
- /package/{archive → src}/fonts/Sora/static/Sora-Bold.ttf +0 -0
- /package/{archive → src}/fonts/Sora/static/Sora-ExtraBold.ttf +0 -0
- /package/{archive → src}/fonts/Sora/static/Sora-ExtraLight.ttf +0 -0
- /package/{archive → src}/fonts/Sora/static/Sora-Light.ttf +0 -0
- /package/{archive → src}/fonts/Sora/static/Sora-Medium.ttf +0 -0
- /package/{archive → src}/fonts/Sora/static/Sora-Regular.ttf +0 -0
- /package/{archive → src}/fonts/Sora/static/Sora-SemiBold.ttf +0 -0
- /package/{archive → src}/fonts/Sora/static/Sora-Thin.ttf +0 -0
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { action } from '@storybook/addon-actions';
|
|
2
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { idAndClassName } from '@utils/controls';
|
|
4
|
-
|
|
5
|
-
import NavItem from '.';
|
|
6
|
-
|
|
7
|
-
const meta = {
|
|
8
|
-
title: 'Components/Nav Item',
|
|
9
|
-
component: NavItem,
|
|
10
|
-
parameters: {},
|
|
11
|
-
argTypes: {
|
|
12
|
-
...idAndClassName,
|
|
13
|
-
title: {
|
|
14
|
-
type: { name: 'string', required: false },
|
|
15
|
-
description: 'A title for the component',
|
|
16
|
-
table: {
|
|
17
|
-
type: { summary: 'string' },
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
href: {
|
|
21
|
-
type: { name: 'string', required: false },
|
|
22
|
-
description: 'A href for the component',
|
|
23
|
-
table: {
|
|
24
|
-
type: { summary: 'string' },
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
onClick: {
|
|
28
|
-
type: { name: 'function', required: false },
|
|
29
|
-
description:
|
|
30
|
-
'An on click handle to execute when clicking on the component',
|
|
31
|
-
table: {
|
|
32
|
-
type: { summary: 'function' },
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
bordered: {
|
|
36
|
-
type: { name: 'boolean', required: false },
|
|
37
|
-
description: 'Enables borders around the component',
|
|
38
|
-
table: {
|
|
39
|
-
type: { summary: 'boolean' },
|
|
40
|
-
},
|
|
41
|
-
defaultValue: false,
|
|
42
|
-
},
|
|
43
|
-
rounded: {
|
|
44
|
-
type: { name: 'boolean', required: false },
|
|
45
|
-
description: 'Roundes the corners of the component',
|
|
46
|
-
table: {
|
|
47
|
-
type: { summary: 'boolean' },
|
|
48
|
-
},
|
|
49
|
-
defaultValue: true,
|
|
50
|
-
},
|
|
51
|
-
underlineOnHover: {
|
|
52
|
-
type: { name: 'boolean', required: false },
|
|
53
|
-
description: 'Underlines the title when hovering over the component',
|
|
54
|
-
table: {
|
|
55
|
-
type: { summary: 'boolean' },
|
|
56
|
-
},
|
|
57
|
-
defaultValue: true,
|
|
58
|
-
},
|
|
59
|
-
isActive: {
|
|
60
|
-
type: { name: 'boolean', required: false },
|
|
61
|
-
description: 'Set the active state to the component',
|
|
62
|
-
table: {
|
|
63
|
-
type: { summary: 'array' },
|
|
64
|
-
},
|
|
65
|
-
defaultValue: false,
|
|
66
|
-
},
|
|
67
|
-
variant: {
|
|
68
|
-
type: { name: 'string', required: false },
|
|
69
|
-
options: ['primary', 'secondary', 'tertiary'],
|
|
70
|
-
description: 'The varient of the component to render',
|
|
71
|
-
table: {
|
|
72
|
-
type: { summary: 'string' },
|
|
73
|
-
},
|
|
74
|
-
defaultValue: 'primary',
|
|
75
|
-
control: 'radio',
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
args: {
|
|
79
|
-
title: 'Home',
|
|
80
|
-
href: '/',
|
|
81
|
-
underlineOnHover: true,
|
|
82
|
-
onClick: action('button-click'),
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
export default meta;
|
|
87
|
-
|
|
88
|
-
type Story = StoryObj<typeof meta>;
|
|
89
|
-
|
|
90
|
-
export const Default: Story = {};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export interface Props {
|
|
8
|
-
id?: string;
|
|
9
|
-
className?: string;
|
|
10
|
-
title: string;
|
|
11
|
-
href?: string;
|
|
12
|
-
onClick?: React.MouseEventHandler;
|
|
13
|
-
bordered?: boolean;
|
|
14
|
-
rounded?: boolean;
|
|
15
|
-
underlineOnHover?: boolean;
|
|
16
|
-
isActive?: boolean;
|
|
17
|
-
variant?: 'primary' | 'secondary' | 'tertiary';
|
|
18
|
-
tabindex?: number;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const NavItem = ({
|
|
22
|
-
id,
|
|
23
|
-
className,
|
|
24
|
-
title,
|
|
25
|
-
href = '/',
|
|
26
|
-
onClick,
|
|
27
|
-
bordered = false,
|
|
28
|
-
rounded = true,
|
|
29
|
-
underlineOnHover = true,
|
|
30
|
-
isActive = false,
|
|
31
|
-
variant = 'primary',
|
|
32
|
-
|
|
33
|
-
tabindex,
|
|
34
|
-
}: Props): JSX.Element => {
|
|
35
|
-
const classList = classNames(className, style.navItem, 'theme-local');
|
|
36
|
-
|
|
37
|
-
const anchorClassList = classNames(
|
|
38
|
-
{
|
|
39
|
-
[style.underline]: underlineOnHover,
|
|
40
|
-
[style.active]: isActive,
|
|
41
|
-
[style.inactive]: !isActive,
|
|
42
|
-
[style.bordered]: bordered,
|
|
43
|
-
[style.rounded]: rounded,
|
|
44
|
-
[style.primary]: variant === 'primary',
|
|
45
|
-
[style.secondary]: variant === 'secondary',
|
|
46
|
-
[style.tertiary]: variant === 'tertiary',
|
|
47
|
-
},
|
|
48
|
-
[style.anchorClassList],
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<div id={id} className={classList}>
|
|
53
|
-
<a
|
|
54
|
-
href={href}
|
|
55
|
-
onClick={onClick}
|
|
56
|
-
className={anchorClassList}
|
|
57
|
-
{...(tabindex !== undefined && { tabIndex: tabindex })}
|
|
58
|
-
>
|
|
59
|
-
<span className={style.spanClassList}>{title}</span>
|
|
60
|
-
</a>
|
|
61
|
-
</div>
|
|
62
|
-
);
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export default NavItem;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
.bordered {
|
|
2
|
-
@apply border-2 px-2 py-2;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.rounded {
|
|
6
|
-
@apply rounded-md;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.navItem {
|
|
10
|
-
@apply w-auto list-none;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.underline > span {
|
|
14
|
-
@apply relative ease-linear;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.underline > span:before {
|
|
18
|
-
@apply absolute -bottom-1 left-0 h-1 transition-all;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.underline:hover > span:before {
|
|
22
|
-
@apply w-full;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.active > span {
|
|
26
|
-
@apply before:w-full;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.inactive > span {
|
|
30
|
-
@apply before:w-0;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.anchorClassList {
|
|
34
|
-
@apply rounded-xl border-2 border-transparent p-2;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.anchorClassList:focus > span:before {
|
|
38
|
-
@apply w-full;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.anchorClassList:focus {
|
|
42
|
-
@apply rounded-xl border-2 border-secondary p-2;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.spanClassList {
|
|
46
|
-
@apply whitespace-nowrap text-center;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.secondary {
|
|
50
|
-
@apply bg-secondary text-primary;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.secondary > span:before {
|
|
54
|
-
@apply bg-primary text-primary;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.primary {
|
|
58
|
-
@apply bg-primary text-secondary;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.primary > span:before {
|
|
62
|
-
@apply bg-secondary text-secondary;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.tertiary {
|
|
66
|
-
@apply bg-tertiary text-secondary;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.tertiary > span:before {
|
|
70
|
-
@apply bg-secondary text-secondary;
|
|
71
|
-
}
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
import { action } from '@storybook/addon-actions';
|
|
2
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
3
|
-
import { idAndClassName } from '@utils/controls';
|
|
4
|
-
|
|
5
|
-
import NavOld from '.';
|
|
6
|
-
|
|
7
|
-
const navLinks = [
|
|
8
|
-
{ title: 'Home', href: '/', isActive: true },
|
|
9
|
-
{ title: 'Resume', href: '/', isActive: false },
|
|
10
|
-
{ title: 'Contact Me', href: '/', isActive: false },
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
const meta = {
|
|
14
|
-
title: 'Components/Nav',
|
|
15
|
-
component: NavOld,
|
|
16
|
-
parameters: {
|
|
17
|
-
backgrounds: {
|
|
18
|
-
default: 'grey',
|
|
19
|
-
values: [
|
|
20
|
-
{
|
|
21
|
-
name: 'grey',
|
|
22
|
-
value: '#f3f3f3',
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
argTypes: {
|
|
28
|
-
...idAndClassName,
|
|
29
|
-
navLinks: {
|
|
30
|
-
description: 'An array of nav links to display in the component',
|
|
31
|
-
table: {
|
|
32
|
-
type: { summary: 'array' },
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
withMobileSideBar: {
|
|
36
|
-
type: { name: 'boolean', required: false },
|
|
37
|
-
description:
|
|
38
|
-
'Sets the expanding mechanism to work as a side bar on mobile',
|
|
39
|
-
table: {
|
|
40
|
-
type: { summary: 'boolean' },
|
|
41
|
-
},
|
|
42
|
-
defaultValue: false,
|
|
43
|
-
},
|
|
44
|
-
withMobileDropdown: {
|
|
45
|
-
type: { name: 'boolean', required: false },
|
|
46
|
-
description:
|
|
47
|
-
'Sets the expanding mechanism to work as a drop down on mobile',
|
|
48
|
-
table: {
|
|
49
|
-
type: { summary: 'boolean' },
|
|
50
|
-
},
|
|
51
|
-
defaultValue: false,
|
|
52
|
-
},
|
|
53
|
-
dropdownNavHeight: {
|
|
54
|
-
type: { name: 'string', required: false },
|
|
55
|
-
description: 'The distance in which the dropdown should come on mobile',
|
|
56
|
-
table: {
|
|
57
|
-
type: { summary: 'string' },
|
|
58
|
-
},
|
|
59
|
-
defaultValue: undefined,
|
|
60
|
-
},
|
|
61
|
-
logo: {
|
|
62
|
-
type: { name: 'string', required: false },
|
|
63
|
-
description: 'The logo to display on the component',
|
|
64
|
-
table: {
|
|
65
|
-
type: { summary: 'string' },
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
logoDarkTheme: {
|
|
69
|
-
type: { name: 'string', required: false },
|
|
70
|
-
description: 'An optional dark them logo for dark mode',
|
|
71
|
-
table: {
|
|
72
|
-
type: { summary: 'string' },
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
mobileLogo: {
|
|
76
|
-
type: { name: 'string', required: false },
|
|
77
|
-
description: 'An optional mobile logo for mobile devices',
|
|
78
|
-
table: {
|
|
79
|
-
type: { summary: 'string' },
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
mobileLogoDarkTheme: {
|
|
83
|
-
type: { name: 'string', required: false },
|
|
84
|
-
description: 'An optional dark them mobile logo for mobile dark mode',
|
|
85
|
-
table: {
|
|
86
|
-
type: { summary: 'string' },
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
logoLink: {
|
|
90
|
-
type: { name: 'string', required: false },
|
|
91
|
-
description: 'The link to navigate to when clicking on the logo',
|
|
92
|
-
table: {
|
|
93
|
-
type: { summary: 'string' },
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
mobileClasses: {
|
|
97
|
-
type: { name: 'string', required: false },
|
|
98
|
-
description: '',
|
|
99
|
-
table: {
|
|
100
|
-
type: { summary: 'string' },
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
fixedTop: {
|
|
104
|
-
type: { name: 'boolean', required: false },
|
|
105
|
-
description: 'Sets the header to fix at the top when true',
|
|
106
|
-
table: {
|
|
107
|
-
type: { summary: 'boolean' },
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
profileMenuItems: {
|
|
111
|
-
type: { name: 'array', required: false },
|
|
112
|
-
description: 'toggles the profile option',
|
|
113
|
-
table: {
|
|
114
|
-
type: { summary: 'array' },
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
getNavStatus: {
|
|
118
|
-
type: { name: 'boolean', required: false },
|
|
119
|
-
description:
|
|
120
|
-
'Returns the status of the header, opened or closed in mobile',
|
|
121
|
-
table: {
|
|
122
|
-
type: { summary: 'function' },
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
variant: {
|
|
126
|
-
type: { name: 'string', required: false },
|
|
127
|
-
options: ['primary', 'secondary', 'tertiary'],
|
|
128
|
-
description: 'The them to render the component in',
|
|
129
|
-
table: {
|
|
130
|
-
type: { summary: 'primary' },
|
|
131
|
-
defaultValue: { summary: 'primary' },
|
|
132
|
-
},
|
|
133
|
-
defaultValue: 'primary',
|
|
134
|
-
control: { type: 'radio' },
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
text: {
|
|
138
|
-
type: { name: 'string', required: false },
|
|
139
|
-
description: 'Text to display on the component',
|
|
140
|
-
table: {
|
|
141
|
-
type: { summary: 'string' },
|
|
142
|
-
},
|
|
143
|
-
defaultValue: 'undefined',
|
|
144
|
-
},
|
|
145
|
-
textLink: {
|
|
146
|
-
type: { name: 'string', required: false },
|
|
147
|
-
description:
|
|
148
|
-
'A link to navigate to when clicking on the text in the component',
|
|
149
|
-
table: {
|
|
150
|
-
type: { summary: 'string' },
|
|
151
|
-
},
|
|
152
|
-
defaultValue: undefined,
|
|
153
|
-
},
|
|
154
|
-
bgColour: {
|
|
155
|
-
type: { name: 'select', required: false },
|
|
156
|
-
options: ['primary', 'secondary', 'white', 'black', 'gold'],
|
|
157
|
-
description: 'The background colour of the component',
|
|
158
|
-
table: {
|
|
159
|
-
type: { summary: 'select' },
|
|
160
|
-
},
|
|
161
|
-
defaultValue: 'primary',
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
args: {
|
|
165
|
-
logoLink: '/',
|
|
166
|
-
navLinks,
|
|
167
|
-
logo: 'https://picsum.photos/200/200',
|
|
168
|
-
logoDarkTheme: 'https://picsum.photos/201/201',
|
|
169
|
-
mobileLogo: 'https://picsum.photos/201/200',
|
|
170
|
-
mobileLogoDarkTheme: 'https://picsum.photos/200/201',
|
|
171
|
-
getNavStatus: (asSideBar, status) => {
|
|
172
|
-
action('nav status: [side bar, open]')(asSideBar, status);
|
|
173
|
-
},
|
|
174
|
-
withStickyNavShadow: true,
|
|
175
|
-
withDesktopShadow: true,
|
|
176
|
-
withMobileSideBar: true,
|
|
177
|
-
profileMenu: {
|
|
178
|
-
menuItems: [
|
|
179
|
-
{ name: 'Profile', href: '/profile' },
|
|
180
|
-
{ name: 'Events', href: '/events' },
|
|
181
|
-
{ name: 'Whats on', href: '/whatson' },
|
|
182
|
-
{ name: 'Help', href: '/help' },
|
|
183
|
-
{ name: 'Log Out', href: '/logout' },
|
|
184
|
-
],
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
export default meta;
|
|
190
|
-
|
|
191
|
-
type Story = StoryObj<typeof meta>;
|
|
192
|
-
|
|
193
|
-
export const Default: Story = {};
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import Container from '@components/Container';
|
|
4
|
-
import HamburgerIcon from '@components/HamburgerIcon';
|
|
5
|
-
import Image from '@components/Image';
|
|
6
|
-
import NavItem, { type Props as navItemProps } from '@components/NavItem';
|
|
7
|
-
import classNames from 'classnames';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export interface Props {
|
|
12
|
-
id?: string;
|
|
13
|
-
className?: string;
|
|
14
|
-
navLinks: navItemProps[];
|
|
15
|
-
withMobileSideBar?: boolean;
|
|
16
|
-
withMobileDropdown?: boolean;
|
|
17
|
-
dropdownNavHeight: string;
|
|
18
|
-
logo: string;
|
|
19
|
-
logoDarkTheme: string;
|
|
20
|
-
mobileLogo: string;
|
|
21
|
-
mobileLogoDarkTheme: string;
|
|
22
|
-
logoLink: string;
|
|
23
|
-
mobileClasses?: string;
|
|
24
|
-
getNavStatus?: (asSideBar: boolean, open: boolean) => void;
|
|
25
|
-
variant: 'primary' | 'secondary' | 'tertiary';
|
|
26
|
-
visible?: boolean;
|
|
27
|
-
tabindex?: number;
|
|
28
|
-
withShadow?: boolean;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const StickyNav = ({
|
|
32
|
-
id,
|
|
33
|
-
className,
|
|
34
|
-
navLinks,
|
|
35
|
-
withMobileSideBar = false,
|
|
36
|
-
withMobileDropdown = false,
|
|
37
|
-
dropdownNavHeight,
|
|
38
|
-
logo,
|
|
39
|
-
logoDarkTheme,
|
|
40
|
-
mobileLogo,
|
|
41
|
-
mobileLogoDarkTheme,
|
|
42
|
-
logoLink,
|
|
43
|
-
mobileClasses,
|
|
44
|
-
getNavStatus,
|
|
45
|
-
variant = 'primary',
|
|
46
|
-
|
|
47
|
-
visible = false,
|
|
48
|
-
tabindex = 0,
|
|
49
|
-
withShadow = false,
|
|
50
|
-
}: Props): JSX.Element => {
|
|
51
|
-
const [showSideNav, setShowSideNav] = useState(false);
|
|
52
|
-
const [showDropdownNav, setShowDropdownNav] = useState(false);
|
|
53
|
-
|
|
54
|
-
const colours = [style[variant]];
|
|
55
|
-
|
|
56
|
-
const classList = classNames(
|
|
57
|
-
{
|
|
58
|
-
[style.showStickyNav]: visible,
|
|
59
|
-
[style.stickyNavDropShadow]: withShadow,
|
|
60
|
-
},
|
|
61
|
-
className,
|
|
62
|
-
colours,
|
|
63
|
-
style.stickyNav,
|
|
64
|
-
'theme-local',
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
const sideNavClasses = classNames(
|
|
68
|
-
{
|
|
69
|
-
[style.sideBarCollapsed]: !showSideNav,
|
|
70
|
-
[style.sideBarExpanded]: showSideNav,
|
|
71
|
-
},
|
|
72
|
-
style.sideNavClassList,
|
|
73
|
-
colours,
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
const dropdownNavClasses = classNames(
|
|
77
|
-
{
|
|
78
|
-
[style.dropDownCollapsed]: !showDropdownNav,
|
|
79
|
-
[`h-${dropdownNavHeight}`]: showDropdownNav,
|
|
80
|
-
},
|
|
81
|
-
style.dropDownNavClassList,
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
const mobileContainer = classNames(style.mobileContainer, mobileClasses);
|
|
85
|
-
|
|
86
|
-
const toggleMenu = (): void => {
|
|
87
|
-
getNavStatus?.(withMobileSideBar, !showSideNav);
|
|
88
|
-
if (withMobileSideBar) {
|
|
89
|
-
setShowSideNav(!showSideNav);
|
|
90
|
-
} else {
|
|
91
|
-
setShowDropdownNav(!showDropdownNav);
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const themeString: string = 'theme-local';
|
|
96
|
-
return (
|
|
97
|
-
<div id={`sticky_${id ?? 'nav'}`} className={classList}>
|
|
98
|
-
{/* Mobile Nav */}
|
|
99
|
-
<Container withPadding className={mobileContainer}>
|
|
100
|
-
<div className={style.collapseBtnWrapper}>
|
|
101
|
-
<HamburgerIcon onClick={toggleMenu} variant={variant} />
|
|
102
|
-
</div>
|
|
103
|
-
<a className={style.mobileLogo} href={logoLink} tabIndex={tabindex}>
|
|
104
|
-
<Image
|
|
105
|
-
src={mobileLogo}
|
|
106
|
-
// title={`${theme.split('-')[1]}-sticky-mobile-logo`}
|
|
107
|
-
// altText={`${theme.split('-')[1]}-sticky-mobile-logo`}
|
|
108
|
-
height={5}
|
|
109
|
-
width={5}
|
|
110
|
-
/>
|
|
111
|
-
</a>
|
|
112
|
-
</Container>
|
|
113
|
-
|
|
114
|
-
{/* Desktop Nav */}
|
|
115
|
-
<Container withPadding className={style.desktopNav}>
|
|
116
|
-
<div className={style.logoClassList}>
|
|
117
|
-
<a className={style.desktopLogo} href={logoLink} tabIndex={tabindex}>
|
|
118
|
-
<Image
|
|
119
|
-
src={logo}
|
|
120
|
-
title={`${themeString?.split('-')[1] ?? 'a'}-sticky-desktop-logo`}
|
|
121
|
-
altText={`${
|
|
122
|
-
themeString?.split('-')[1] ?? 'a'
|
|
123
|
-
}-sticky-desktop-logo`}
|
|
124
|
-
height={5}
|
|
125
|
-
width={5}
|
|
126
|
-
/>
|
|
127
|
-
</a>
|
|
128
|
-
</div>
|
|
129
|
-
<nav className={style.navItems}>
|
|
130
|
-
{navLinks?.map((navLink, i) => {
|
|
131
|
-
return (
|
|
132
|
-
<NavItem
|
|
133
|
-
key={`desktop_nav_item_${i}`}
|
|
134
|
-
{...navLink}
|
|
135
|
-
className={style.navItemPadding}
|
|
136
|
-
bordered={false}
|
|
137
|
-
rounded={false}
|
|
138
|
-
underlineOnHover
|
|
139
|
-
variant={variant}
|
|
140
|
-
tabindex={tabindex}
|
|
141
|
-
/>
|
|
142
|
-
);
|
|
143
|
-
})}
|
|
144
|
-
</nav>
|
|
145
|
-
</Container>
|
|
146
|
-
|
|
147
|
-
{/* Mobile Links */}
|
|
148
|
-
{/* Side Bar */}
|
|
149
|
-
{withMobileSideBar && (
|
|
150
|
-
<div className={sideNavClasses}>
|
|
151
|
-
{navLinks?.map((navLink, i) => {
|
|
152
|
-
return (
|
|
153
|
-
<NavItem
|
|
154
|
-
key={`sidebar_nav_item_${i}`}
|
|
155
|
-
{...navLink}
|
|
156
|
-
className={classNames(colours, style.mobileSideBarMenuNavItems)}
|
|
157
|
-
bordered={false}
|
|
158
|
-
rounded={false}
|
|
159
|
-
underlineOnHover
|
|
160
|
-
variant={variant}
|
|
161
|
-
tabindex={tabindex}
|
|
162
|
-
/>
|
|
163
|
-
);
|
|
164
|
-
})}
|
|
165
|
-
</div>
|
|
166
|
-
)}
|
|
167
|
-
{withMobileDropdown && (
|
|
168
|
-
<div className={dropdownNavClasses}>
|
|
169
|
-
<div className={style.mobileDropDownMenu}>
|
|
170
|
-
{navLinks?.map((navLink, i) => {
|
|
171
|
-
return (
|
|
172
|
-
<NavItem
|
|
173
|
-
key={`dropdown_nav_item_${i}`}
|
|
174
|
-
{...navLink}
|
|
175
|
-
className={style.mobileDropDownMenuNavItems}
|
|
176
|
-
bordered={false}
|
|
177
|
-
rounded={false}
|
|
178
|
-
underlineOnHover
|
|
179
|
-
variant={variant}
|
|
180
|
-
tabindex={tabindex}
|
|
181
|
-
/>
|
|
182
|
-
);
|
|
183
|
-
})}
|
|
184
|
-
</div>
|
|
185
|
-
</div>
|
|
186
|
-
)}
|
|
187
|
-
</div>
|
|
188
|
-
);
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
export default StickyNav;
|