trepur_components 2.3.9 → 2.3.11
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/lib/_virtual/react.js +4 -0
- package/lib/components/Accordion/Accordion.stories.d.ts +47 -0
- package/lib/components/Accordion/const.d.ts +31 -0
- package/lib/components/Accordion/index.d.ts +5 -0
- package/lib/components/Accordion/index.js +9 -0
- package/lib/components/AlertBar/AlertBar.stories.d.ts +25 -0
- package/lib/components/AlertBar/index.d.ts +15 -0
- package/lib/components/AlertBar/index.js +66 -0
- package/lib/components/Avatar/Avatar.stories.d.ts +10 -0
- package/lib/components/Avatar/index.d.ts +3 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.stories.d.ts +18 -0
- package/lib/components/Breadcrumbs/index.d.ts +15 -0
- package/lib/components/Breadcrumbs/index.js +49 -0
- package/lib/components/Button/Button.stories.d.ts +24 -0
- package/lib/components/Button/index.d.ts +14 -0
- package/lib/components/Button/index.js +43 -0
- package/lib/components/Calendar/Calendar.stories.d.ts +11 -0
- package/lib/components/Calendar/index.d.ts +14 -0
- package/lib/components/Calendar/index.js +49 -0
- package/lib/components/Calendar/style.css.js +1 -0
- package/lib/components/Card/Card.stories.d.ts +11 -0
- package/lib/components/Card/index.d.ts +2 -0
- package/lib/components/Card/index.js +25 -0
- package/lib/components/Carousel/Carousel.stories.d.ts +23 -0
- package/lib/components/Carousel/index.d.ts +70 -0
- package/lib/components/Carousel/index.js +159 -0
- package/lib/components/Carousel/utils.d.ts +1 -0
- package/lib/components/Carousel/utils.js +38 -0
- package/lib/components/CarouselThumbnail/CarouselThumbnail.stories.d.ts +22 -0
- package/lib/components/CarouselThumbnail/const.d.ts +1 -0
- package/lib/components/CarouselThumbnail/const.js +20 -0
- package/lib/components/CarouselThumbnail/index.d.ts +51 -0
- package/lib/components/CarouselThumbnail/index.js +74 -0
- package/lib/components/CarouselThumbnail/utils.d.ts +2 -0
- package/lib/components/CarouselThumbnail/utils.js +65 -0
- package/lib/components/Checkbox/Checkbox.stories.d.ts +17 -0
- package/lib/components/Checkbox/index.d.ts +11 -0
- package/lib/components/Checkbox/index.js +28 -0
- package/lib/components/Collapsible/Collapsible.stories.d.ts +57 -0
- package/lib/components/Collapsible/index.d.ts +19 -0
- package/lib/components/Collapsible/index.js +87 -0
- package/lib/components/Counter/Counter.stories.d.ts +17 -0
- package/lib/components/Counter/index.d.ts +14 -0
- package/lib/components/Counter/index.js +49 -0
- package/lib/components/DetailUpdater/DetailUpdater.stories.d.ts +20 -0
- package/lib/components/DetailUpdater/index.d.ts +18 -0
- package/lib/components/DetailUpdater/index.js +63 -0
- package/lib/components/Dialog/Dialog.stories.d.ts +15 -0
- package/lib/components/Dialog/index.d.ts +12 -0
- package/lib/components/Dialog/index.js +16 -0
- package/lib/components/Dropdown/Dropdown.stories.d.ts +17 -0
- package/lib/components/Dropdown/index.d.ts +13 -0
- package/lib/components/Dropdown/index.js +66 -0
- package/lib/components/Dropdown/utils.d.ts +1 -0
- package/lib/components/Dropdown/utils.js +14 -0
- package/lib/components/FileUploader/FilePreview.d.ts +8 -0
- package/lib/components/FileUploader/FileUploader.stories.d.ts +52 -0
- package/lib/components/FileUploader/index.d.ts +15 -0
- package/lib/components/Footer/Footer.stories.d.ts +19 -0
- package/lib/components/Footer/index.d.ts +16 -0
- package/lib/components/Footer/index.js +36 -0
- package/lib/components/FooterNav/FooterNav.stories.d.ts +22 -0
- package/lib/components/FooterNav/index.d.ts +15 -0
- package/lib/components/FooterNav/index.js +38 -0
- package/lib/components/Form/Form.stories.d.ts +117 -0
- package/lib/components/Form/index.d.ts +13 -0
- package/lib/components/Form/index.js +17 -0
- package/lib/components/Gallery/Gallery.stories.d.ts +16 -0
- package/lib/components/Gallery/index.d.ts +7 -0
- package/lib/components/Greeting/Greeting.stories.d.ts +13 -0
- package/lib/components/Greeting/index.d.ts +7 -0
- package/lib/components/Greeting/index.js +20 -0
- package/lib/components/HamburgerIcon/HamburgerIcon.stories.d.ts +10 -0
- package/lib/components/HamburgerIcon/index.d.ts +2 -0
- package/lib/components/HamburgerIcon/index.js +78 -0
- package/lib/components/Icon/Icon.stories.d.ts +16 -0
- package/lib/components/Icon/index.d.ts +10 -0
- package/lib/components/Icon/index.js +23 -0
- package/lib/components/Image/Image.stories.d.ts +13 -0
- package/lib/components/Image/index.d.ts +5 -0
- package/lib/components/Image/index.js +17 -0
- package/lib/components/ImageCard/ImageCard.stories.d.ts +19 -0
- package/lib/components/ImageCard/index.d.ts +11 -0
- package/lib/components/ImageCard/index.js +32 -0
- package/lib/components/Input/Input.stories.d.ts +22 -0
- package/lib/components/Input/index.d.ts +33 -0
- package/lib/components/Input/index.js +83 -0
- package/lib/components/MenuButton/MenuButton.stories.d.ts +76 -0
- package/lib/components/MenuButton/index.d.ts +14 -0
- package/lib/components/MenuButton/index.js +56 -0
- package/lib/components/Modal/Modal.stories.d.ts +67 -0
- package/lib/components/Modal/index.d.ts +10 -0
- package/lib/components/Modal/index.js +45 -0
- package/lib/components/Nav/Nav.stories.d.ts +31 -0
- package/lib/components/Nav/index.d.ts +20 -0
- package/lib/components/Nav/index.js +81 -0
- package/lib/components/NavItem/NavItem.stories.d.ts +17 -0
- package/lib/components/NavItem/index.d.ts +8 -0
- package/lib/components/NavItem/index.js +31 -0
- package/lib/components/Pill/Pill.stories.d.ts +22 -0
- package/lib/components/Pill/index.d.ts +17 -0
- package/lib/components/Pill/index.js +30 -0
- package/lib/components/Search/Search.stories.d.ts +86 -0
- package/lib/components/Search/index.d.ts +12 -0
- package/lib/components/Search/index.js +42 -0
- package/lib/components/Select/Select.stories.d.ts +56 -0
- package/lib/components/Select/index.d.ts +11 -0
- package/lib/components/Select/index.js +68 -0
- package/lib/components/Showcase/Showcase.stories.d.ts +55 -0
- package/lib/components/Showcase/index.d.ts +15 -0
- package/lib/components/SideNav/SideNav.stories.d.ts +80 -0
- package/lib/components/SideNav/index.d.ts +12 -0
- package/lib/components/SocialButton/SocialButton.stories.d.ts +130 -0
- package/lib/components/SocialButton/index.d.ts +12 -0
- package/lib/components/SplitCard/SplitCard.stories.d.ts +21 -0
- package/lib/components/SplitCard/index.d.ts +14 -0
- package/lib/components/Stars/Star.stories.d.ts +14 -0
- package/lib/components/Stars/index.d.ts +8 -0
- package/lib/components/Stars/index.js +22 -0
- package/lib/components/Testimonial/Testimonial.stories.d.ts +21 -0
- package/lib/components/Testimonial/index.d.ts +13 -0
- package/lib/components/Testimonial/index.js +42 -0
- package/lib/components/TextArea/TextArea.stories.d.ts +21 -0
- package/lib/components/TextArea/index.d.ts +33 -0
- package/lib/components/TextArea/index.js +76 -0
- package/lib/components/Timeline/Timeline.stories.d.ts +21 -0
- package/lib/components/Timeline/index.d.ts +11 -0
- package/lib/components/Timeline/index.js +31 -0
- package/lib/components/Tubestops/Tubestops.stories.d.ts +19 -0
- package/lib/components/Tubestops/index.d.ts +15 -0
- package/lib/components/Tubestops/index.js +77 -0
- package/lib/components/Video/Video.stories.d.ts +23 -0
- package/lib/components/Video/index.d.ts +18 -0
- package/lib/components/Video/index.js +32 -0
- package/{src/components/index.ts → lib/components/index.d.ts} +35 -71
- package/lib/documentation/assets/index.d.ts +3 -0
- package/lib/documentation/typography/Fonts/Fonts.d.ts +2 -0
- package/lib/documentation/typography/Fonts/Fonts.stories.d.ts +10 -0
- package/lib/index.js +72 -0
- package/lib/node_modules/keen-slider/keen-slider.min.css.js +1 -0
- package/lib/node_modules/keen-slider/react.js +591 -0
- package/lib/style.css +1 -0
- package/lib/styles/global.css +19 -0
- package/{src → lib}/styles/themes/local.css +9 -1
- package/lib/styles/themes/penrithmrt.css +101 -0
- package/{tailwind → lib/tailwind}/colors.ts +12 -1
- package/lib/utils/controls.d.ts +36 -0
- package/lib/utils/matchMedia.d.ts +2 -0
- package/lib/utils/screens.d.ts +7 -0
- package/package.json +4 -1
- package/.eslintrc.cjs +0 -72
- package/.husky/pre-commit +0 -4
- package/.prettierignore +0 -10
- package/.prettierrc.json +0 -22
- package/postcss.config.js +0 -8
- package/src/components/Accordion/Accordion.stories.tsx +0 -39
- package/src/components/Accordion/const.tsx +0 -34
- package/src/components/Accordion/index.tsx +0 -22
- package/src/components/AlertBar/AlertBar.stories.tsx +0 -89
- package/src/components/AlertBar/index.tsx +0 -82
- package/src/components/Avatar/Avatar.stories.tsx +0 -14
- package/src/components/Avatar/index.tsx +0 -492
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +0 -29
- package/src/components/Breadcrumbs/index.tsx +0 -89
- package/src/components/Button/Button.stories.tsx +0 -24
- package/src/components/Button/index.tsx +0 -59
- package/src/components/Calendar/Calendar.stories.tsx +0 -21
- package/src/components/Calendar/index.tsx +0 -92
- package/src/components/Calendar/style.css +0 -233
- package/src/components/Card/Card.stories.tsx +0 -14
- package/src/components/Card/index.tsx +0 -39
- package/src/components/Carousel/Carousel.stories.tsx +0 -44
- package/src/components/Carousel/index.tsx +0 -301
- package/src/components/Carousel/utils.ts +0 -53
- package/src/components/CarouselThumbnail/CarouselThumbnail.stories.tsx +0 -29
- package/src/components/CarouselThumbnail/const.ts +0 -17
- package/src/components/CarouselThumbnail/index.tsx +0 -169
- package/src/components/CarouselThumbnail/utils.ts +0 -87
- package/src/components/Checkbox/Checkbox.mdx +0 -33
- package/src/components/Checkbox/Checkbox.stories.tsx +0 -27
- package/src/components/Checkbox/index.tsx +0 -44
- package/src/components/Collapsible/Collapsible.stories.tsx +0 -67
- package/src/components/Collapsible/index.tsx +0 -169
- package/src/components/Counter/Counter.stories.tsx +0 -20
- package/src/components/Counter/index.tsx +0 -98
- package/src/components/DetailUpdater/DetailUpdater.stories.tsx +0 -37
- package/src/components/DetailUpdater/index.tsx +0 -107
- package/src/components/Dialog/Dialog.stories.tsx +0 -65
- package/src/components/Dialog/index.tsx +0 -29
- package/src/components/Dropdown/Dropdown.stories.tsx +0 -22
- package/src/components/Dropdown/index.tsx +0 -117
- package/src/components/Dropdown/utils.ts +0 -15
- package/src/components/FileUploader/FilePreview.tsx +0 -45
- package/src/components/FileUploader/FileUploader.stories.tsx +0 -28
- package/src/components/FileUploader/index.tsx +0 -177
- package/src/components/Footer/Footer.stories.tsx +0 -47
- package/src/components/Footer/index.tsx +0 -96
- package/src/components/FooterNav/FooterNav.stories.tsx +0 -32
- package/src/components/FooterNav/index.tsx +0 -75
- package/src/components/Form/Form.stories.tsx +0 -86
- package/src/components/Form/index.tsx +0 -41
- package/src/components/Gallery/Gallery.stories.tsx +0 -39
- package/src/components/Gallery/index.tsx +0 -31
- package/src/components/Greeting/Greeting.stories.tsx +0 -16
- package/src/components/Greeting/index.tsx +0 -49
- package/src/components/HamburgerIcon/HamburgerIcon.stories.tsx +0 -14
- package/src/components/HamburgerIcon/index.tsx +0 -75
- package/src/components/Icon/Icon.stories.tsx +0 -41
- package/src/components/Icon/index.tsx +0 -33
- package/src/components/Image/Image.stories.tsx +0 -17
- package/src/components/Image/index.tsx +0 -25
- package/src/components/ImageCard/ImageCard.stories.tsx +0 -29
- package/src/components/ImageCard/index.tsx +0 -75
- package/src/components/Input/Input.stories.tsx +0 -25
- package/src/components/Input/index.tsx +0 -139
- package/src/components/MenuButton/MenuButton.stories.tsx +0 -46
- package/src/components/MenuButton/index.tsx +0 -66
- package/src/components/Modal/Modal.stories.tsx +0 -82
- package/src/components/Modal/index.tsx +0 -71
- package/src/components/Nav/Nav.stories.tsx +0 -80
- package/src/components/Nav/index.tsx +0 -171
- package/src/components/NavItem/NavItem.stories.tsx +0 -17
- package/src/components/NavItem/index.tsx +0 -39
- package/src/components/Pill/Pill.stories.tsx +0 -51
- package/src/components/Pill/index.tsx +0 -69
- package/src/components/Search/Search.stories.tsx +0 -63
- package/src/components/Search/index.tsx +0 -64
- package/src/components/Select/Select.stories.tsx +0 -55
- package/src/components/Select/index.tsx +0 -97
- package/src/components/Showcase/Showcase.stories.tsx +0 -31
- package/src/components/Showcase/index.tsx +0 -62
- package/src/components/SideNav/SideNav.stories.tsx +0 -50
- package/src/components/SideNav/index.tsx +0 -39
- package/src/components/SocialButton/SocialButton.stories.tsx +0 -88
- package/src/components/SocialButton/index.tsx +0 -63
- package/src/components/SplitCard/SplitCard.stories.tsx +0 -34
- package/src/components/SplitCard/index.tsx +0 -132
- package/src/components/Stars/Star.stories.tsx +0 -18
- package/src/components/Stars/index.tsx +0 -38
- package/src/components/Testimonial/Testimonial.stories.tsx +0 -37
- package/src/components/Testimonial/index.tsx +0 -123
- package/src/components/TextArea/TextArea.stories.tsx +0 -24
- package/src/components/TextArea/index.tsx +0 -133
- package/src/components/Timeline/Timeline.stories.tsx +0 -45
- package/src/components/Timeline/index.tsx +0 -65
- package/src/components/Tubestops/Tubestops.stories.tsx +0 -22
- package/src/components/Tubestops/index.tsx +0 -132
- package/src/components/Video/Video.stories.tsx +0 -58
- 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 +0 -92
- package/src/custom.d.ts +0 -14
- package/src/documentation/Colours.mdx +0 -192
- package/src/documentation/Introduction.mdx +0 -13
- package/src/documentation/assets/index.ts +0 -3
- package/src/documentation/assets/trepurComponentsLogo.svg +0 -32
- package/src/documentation/typography/Fonts/Fonts.stories.tsx +0 -14
- package/src/documentation/typography/Fonts/Fonts.tsx +0 -73
- package/src/fonts/Sora/OFL.txt +0 -93
- package/src/fonts/Sora/README.txt +0 -70
- package/src/fonts/Sora/Sora-VariableFont_wght.ttf +0 -0
- package/src/fonts/Sora/static/Sora-Bold.ttf +0 -0
- package/src/fonts/Sora/static/Sora-ExtraBold.ttf +0 -0
- package/src/fonts/Sora/static/Sora-ExtraLight.ttf +0 -0
- package/src/fonts/Sora/static/Sora-Light.ttf +0 -0
- package/src/fonts/Sora/static/Sora-Medium.ttf +0 -0
- package/src/fonts/Sora/static/Sora-Regular.ttf +0 -0
- package/src/fonts/Sora/static/Sora-SemiBold.ttf +0 -0
- package/src/fonts/Sora/static/Sora-Thin.ttf +0 -0
- package/src/styles/global.css +0 -75
- package/src/styles/themes/test.css +0 -28
- package/src/utils/controls.ts +0 -44
- package/src/utils/matchMedia.ts +0 -9
- package/src/utils/screens.ts +0 -7
- package/tailwind.config.ts +0 -13
- package/tsconfig.json +0 -49
- package/tsconfig.node.json +0 -12
- package/vite.config.mjs +0 -64
- /package/{src/index.ts → lib/index.d.ts} +0 -0
- /package/{tailwind → lib/tailwind}/boxShadow.ts +0 -0
- /package/{tailwind → lib/tailwind}/container.ts +0 -0
- /package/{tailwind → lib/tailwind}/preset.ts +0 -0
- /package/{tailwind → lib/tailwind}/spacing.ts +0 -0
|
@@ -1,492 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
|
-
// @ts-expect-error
|
|
4
|
-
import Snap from 'snapsvg-cjs';
|
|
5
|
-
|
|
6
|
-
export const Avatar: React.FC = (): any => {
|
|
7
|
-
const [s, setS] = useState(null);
|
|
8
|
-
|
|
9
|
-
let rightEyeWhite: any,
|
|
10
|
-
rightEyePupil: any,
|
|
11
|
-
leftEyeWhite: any,
|
|
12
|
-
leftEyePupil: any,
|
|
13
|
-
avatar: any,
|
|
14
|
-
armless: any,
|
|
15
|
-
torso: any,
|
|
16
|
-
face: any,
|
|
17
|
-
legs: any,
|
|
18
|
-
rightArm: any,
|
|
19
|
-
leftArm: any,
|
|
20
|
-
rightHand: any,
|
|
21
|
-
leftHand: any,
|
|
22
|
-
arms: any,
|
|
23
|
-
straps: any,
|
|
24
|
-
hands: any,
|
|
25
|
-
leftThigh: any,
|
|
26
|
-
rightThigh: any,
|
|
27
|
-
leftShoe: any,
|
|
28
|
-
rightShoe: any;
|
|
29
|
-
|
|
30
|
-
const leftShoulderRotationPoints = '175, 202';
|
|
31
|
-
const rightShoulderRotationPoints = '94, 202';
|
|
32
|
-
const svgContainerHeight = 400;
|
|
33
|
-
const svgContainerWidth = 265;
|
|
34
|
-
const skinColour = '#FFCC9A';
|
|
35
|
-
const zipColour = '#315107';
|
|
36
|
-
const eyeColour = '#1389BF';
|
|
37
|
-
const hairColour = '#F1B452';
|
|
38
|
-
const beardColour = '#F1B452';
|
|
39
|
-
const rucksackColour = '#072765';
|
|
40
|
-
const trouserColour = '#D3D3D3';
|
|
41
|
-
const jacketColour = '#416E0A';
|
|
42
|
-
const mouthColour = '#DC7144';
|
|
43
|
-
const shoeColour = '#000000';
|
|
44
|
-
const eyebrowColour = '#F1B452';
|
|
45
|
-
const noseColour = '#F1B452';
|
|
46
|
-
|
|
47
|
-
const createAvatar = (s: any, callBack: any): void => {
|
|
48
|
-
if (typeof window === 'undefined') return;
|
|
49
|
-
const head = s?.rect(103, 90, 68, 87, 50).attr({ fill: skinColour });
|
|
50
|
-
|
|
51
|
-
const leftEyebrow = s?.rect(146, 122, 12, 3, 2);
|
|
52
|
-
const rightEyebrow = s?.rect(115, 122, 12, 3, 2);
|
|
53
|
-
|
|
54
|
-
leftEyeWhite = s?.ellipse(152, 132, 6, 4);
|
|
55
|
-
rightEyeWhite = s?.ellipse(121, 132, 6, 4);
|
|
56
|
-
leftEyePupil = s?.ellipse(152, 132, 3, 3).attr({ fill: eyeColour });
|
|
57
|
-
rightEyePupil = s?.ellipse(121, 132, 3, 3).attr({ fill: eyeColour });
|
|
58
|
-
|
|
59
|
-
const leftEye = s?.group(leftEyeWhite, leftEyePupil);
|
|
60
|
-
const rightEye = s?.group(rightEyeWhite, rightEyePupil);
|
|
61
|
-
|
|
62
|
-
const outerBeard = s?.rect(103, 90, 68, 87, 50).attr({ fill: 'white' });
|
|
63
|
-
const innerBeard = s?.rect(106, 105, 62, 62, 50);
|
|
64
|
-
const beardGroup = s?.group(outerBeard, innerBeard);
|
|
65
|
-
const beard = s?.rect(103, 140, 68, 60).attr({
|
|
66
|
-
mask: beardGroup,
|
|
67
|
-
fill: beardColour,
|
|
68
|
-
opacity: 0.6,
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
const outerHair = s?.rect(103, 90, 68, 60, 25).attr({ fill: 'white' });
|
|
72
|
-
const innerHair = s?.rect(109, 105, 56, 40, 10);
|
|
73
|
-
const hairGroup = s?.group(outerHair, innerHair);
|
|
74
|
-
const baseHair = s?.rect(103, 90, 68, 40).attr({
|
|
75
|
-
mask: hairGroup,
|
|
76
|
-
fill: hairColour,
|
|
77
|
-
});
|
|
78
|
-
const hairLevel1 = s
|
|
79
|
-
?.rect(113, 88, 50, 16, 10)
|
|
80
|
-
.attr({ fill: hairColour })
|
|
81
|
-
.transform('r0');
|
|
82
|
-
const hair = s?.group(baseHair, hairLevel1);
|
|
83
|
-
|
|
84
|
-
const outerNose = s?.rect(129, 140, 12, 10, 30)?.attr({ fill: 'white' });
|
|
85
|
-
const innerNose = s?.rect(130, 142, 10, 12, 30);
|
|
86
|
-
const noseGroup = s?.group(outerNose, innerNose);
|
|
87
|
-
const nose = s?.rect(129, 140, 12, 10)?.attr({
|
|
88
|
-
mask: noseGroup,
|
|
89
|
-
fill: noseColour,
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
const leftEar = s?.circle(103, 135, 5)?.attr({ fill: 'white' });
|
|
93
|
-
const leftEarMask = s
|
|
94
|
-
?.rect(89, 120, 15, 30)
|
|
95
|
-
.attr({
|
|
96
|
-
mask: leftEar,
|
|
97
|
-
fill: skinColour,
|
|
98
|
-
})
|
|
99
|
-
.transform('r-2');
|
|
100
|
-
|
|
101
|
-
const rightEar = s?.circle(171, 135, 5)?.attr({ fill: 'white' });
|
|
102
|
-
const rightEarMask = s
|
|
103
|
-
?.rect(170, 120, 15, 30)
|
|
104
|
-
.attr({
|
|
105
|
-
mask: rightEar,
|
|
106
|
-
fill: skinColour,
|
|
107
|
-
})
|
|
108
|
-
.transform('r2');
|
|
109
|
-
|
|
110
|
-
const body = s
|
|
111
|
-
?.rect(100, 188, 73, 105, 16, 16)
|
|
112
|
-
.attr({ fill: jacketColour });
|
|
113
|
-
const hood = s?.ellipse(136, 182, 24, 10).attr({ fill: jacketColour });
|
|
114
|
-
|
|
115
|
-
const rightShoulder = s?.rect(87, 190, 27, 14, 10);
|
|
116
|
-
rightArm = s?.rect(84, 195, 16, 90, 10, 10);
|
|
117
|
-
|
|
118
|
-
const leftShoulder = s?.rect(155, 190, 27, 14, 10);
|
|
119
|
-
leftArm = s?.rect(170, 195, 16, 90, 10, 10);
|
|
120
|
-
|
|
121
|
-
leftHand = s?.circle(178, 278, 8);
|
|
122
|
-
rightHand = s?.circle(92, 278, 8);
|
|
123
|
-
|
|
124
|
-
const wasteBand = s?.rect(98, 277, 74, 33, 0, 0);
|
|
125
|
-
leftThigh = s?.rect(142, 300, 30, 90, 0, 0);
|
|
126
|
-
rightThigh = s?.rect(98, 300, 30, 90, 0, 0);
|
|
127
|
-
|
|
128
|
-
const bag = s?.rect(99, 180, 74, 78, 10);
|
|
129
|
-
const rightStrap = s?.rect(101, 185, 5, 100, 10).transform('r4.5');
|
|
130
|
-
const leftStrap = s?.rect(163, 185, 5, 100, 10).transform('r-4.5');
|
|
131
|
-
|
|
132
|
-
const mouth = s?.circle(136, 155, 10).attr({ fill: 'white' });
|
|
133
|
-
const mouthCutOff = s?.rect(120, 155, 30, 15).attr({ fill: mouthColour });
|
|
134
|
-
|
|
135
|
-
const leftShoeTop = s?.rect(142, 370, 30, 20, 10);
|
|
136
|
-
const leftShoeSole = s?.rect(142, 378, 30, 12);
|
|
137
|
-
|
|
138
|
-
const rightShoeTop = s?.rect(98, 370, 30, 20, 10);
|
|
139
|
-
const rightShoeSole = s?.rect(98, 378, 30, 12);
|
|
140
|
-
|
|
141
|
-
const mainZip = s?.rect(135, 199, 3, 94);
|
|
142
|
-
const leftZip = s?.rect(141, 188, 2, 15).transform('r44.5');
|
|
143
|
-
const rightZip = s?.rect(130, 188, 2, 15).transform('r-44.5');
|
|
144
|
-
|
|
145
|
-
const centerNeck = s?.rect(128, 170, 17, 21);
|
|
146
|
-
const leftNeck = s?.rect(139, 181, 10, 10).transform('r-33');
|
|
147
|
-
const rightNeck = s?.rect(124, 181, 10, 10).transform('r33');
|
|
148
|
-
const frontNeck = s?.rect(129, 182, 15, 15).transform('r45');
|
|
149
|
-
|
|
150
|
-
const neck = s
|
|
151
|
-
?.group(centerNeck, leftNeck, rightNeck, frontNeck)
|
|
152
|
-
.attr({ fill: skinColour });
|
|
153
|
-
const zip = s?.group(mainZip, leftZip, rightZip).attr({ fill: zipColour });
|
|
154
|
-
leftShoe = s?.group(leftShoeTop, leftShoeSole);
|
|
155
|
-
rightShoe = s?.group(rightShoeTop, rightShoeSole);
|
|
156
|
-
const rucksack = s
|
|
157
|
-
?.group(leftStrap, rightStrap, bag)
|
|
158
|
-
.attr({ fill: rucksackColour });
|
|
159
|
-
const eyes = s?.group(leftEye, rightEye).attr({ fill: 'white' });
|
|
160
|
-
const eyebrows = s
|
|
161
|
-
?.group(leftEyebrow, rightEyebrow)
|
|
162
|
-
.attr({ fill: eyebrowColour });
|
|
163
|
-
const shoes = s?.group(leftShoe, rightShoe).attr({ fill: shoeColour });
|
|
164
|
-
const ears = s?.group(leftEarMask, rightEarMask);
|
|
165
|
-
|
|
166
|
-
arms = s
|
|
167
|
-
?.group(rightShoulder, leftShoulder, leftArm, rightArm)
|
|
168
|
-
.attr({ fill: jacketColour });
|
|
169
|
-
hands = s?.group(leftHand, rightHand).attr({ fill: skinColour });
|
|
170
|
-
straps = s?.group(leftStrap, rightStrap).attr({ fill: rucksackColour });
|
|
171
|
-
|
|
172
|
-
face = s?.group(
|
|
173
|
-
head,
|
|
174
|
-
eyes,
|
|
175
|
-
eyebrows,
|
|
176
|
-
nose,
|
|
177
|
-
mouth,
|
|
178
|
-
mouthCutOff,
|
|
179
|
-
ears,
|
|
180
|
-
hair,
|
|
181
|
-
beard,
|
|
182
|
-
);
|
|
183
|
-
torso = s?.group(rucksack, hood, body, neck, zip);
|
|
184
|
-
legs = s
|
|
185
|
-
?.group(leftThigh, rightThigh, wasteBand, shoes)
|
|
186
|
-
.attr({ fill: trouserColour });
|
|
187
|
-
|
|
188
|
-
armless = s?.group(legs, torso, face);
|
|
189
|
-
avatar = s?.group(armless, arms, straps, hands);
|
|
190
|
-
|
|
191
|
-
mouthCutOff?.attr({
|
|
192
|
-
mask: mouth,
|
|
193
|
-
});
|
|
194
|
-
|
|
195
|
-
callBack(avatar);
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
const nextFrame = (s: any, frameArray: any, frame: number): void => {
|
|
199
|
-
if (frame >= frameArray.length) {
|
|
200
|
-
return;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
Snap.animate(
|
|
204
|
-
frameArray[frame].from,
|
|
205
|
-
frameArray[frame].to,
|
|
206
|
-
frameArray[frame].funct,
|
|
207
|
-
frameArray[frame].dur,
|
|
208
|
-
null,
|
|
209
|
-
nextFrame.bind(null, Snap, frameArray, frame + 1),
|
|
210
|
-
);
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
const rightWave = [
|
|
214
|
-
{
|
|
215
|
-
funct: function (val: number) {
|
|
216
|
-
rightArm.transform(`r${val},${rightShoulderRotationPoints}`);
|
|
217
|
-
rightHand.transform(`r${val},${rightShoulderRotationPoints}`);
|
|
218
|
-
},
|
|
219
|
-
from: 0,
|
|
220
|
-
to: 170,
|
|
221
|
-
dur: 100,
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
funct: function (val: number) {
|
|
225
|
-
rightArm.transform(`r${val},${rightShoulderRotationPoints}`);
|
|
226
|
-
rightHand.transform(`r${val},${rightShoulderRotationPoints}`);
|
|
227
|
-
},
|
|
228
|
-
from: 170,
|
|
229
|
-
to: 120,
|
|
230
|
-
dur: 100,
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
funct: function (val: number) {
|
|
234
|
-
rightArm.transform(`r${val},${rightShoulderRotationPoints}`);
|
|
235
|
-
rightHand.transform(`r${val},${rightShoulderRotationPoints}`);
|
|
236
|
-
},
|
|
237
|
-
from: 120,
|
|
238
|
-
to: 170,
|
|
239
|
-
dur: 100,
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
funct: function (val: number) {
|
|
243
|
-
rightArm.transform(`r${val},${rightShoulderRotationPoints}`);
|
|
244
|
-
rightHand.transform(`r${val},${rightShoulderRotationPoints}`);
|
|
245
|
-
},
|
|
246
|
-
from: 170,
|
|
247
|
-
to: 120,
|
|
248
|
-
dur: 100,
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
funct: function (val: number) {
|
|
252
|
-
rightArm.transform(`r${val},${rightShoulderRotationPoints}`);
|
|
253
|
-
rightHand.transform(`r${val},${rightShoulderRotationPoints}`);
|
|
254
|
-
},
|
|
255
|
-
from: 120,
|
|
256
|
-
to: 170,
|
|
257
|
-
dur: 100,
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
funct: function (val: number) {
|
|
261
|
-
rightArm.transform(`r${val},${rightShoulderRotationPoints}`);
|
|
262
|
-
rightHand.transform(`r${val},${rightShoulderRotationPoints}`);
|
|
263
|
-
},
|
|
264
|
-
from: 170,
|
|
265
|
-
to: 120,
|
|
266
|
-
dur: 100,
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
funct: function (val: number) {
|
|
270
|
-
rightArm.transform(`r${val},${rightShoulderRotationPoints}`);
|
|
271
|
-
rightHand.transform(`r${val},${rightShoulderRotationPoints}`);
|
|
272
|
-
},
|
|
273
|
-
from: 120,
|
|
274
|
-
to: 0,
|
|
275
|
-
dur: 100,
|
|
276
|
-
},
|
|
277
|
-
];
|
|
278
|
-
|
|
279
|
-
const leftWave = [
|
|
280
|
-
{
|
|
281
|
-
funct: function (val: number) {
|
|
282
|
-
leftArm.transform(`r${val},${leftShoulderRotationPoints}`);
|
|
283
|
-
leftHand.transform(`r${val},${leftShoulderRotationPoints}`);
|
|
284
|
-
},
|
|
285
|
-
from: 0,
|
|
286
|
-
to: -150,
|
|
287
|
-
dur: 100,
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
funct: function (val: number) {
|
|
291
|
-
leftArm.transform(`r${val},${leftShoulderRotationPoints}`);
|
|
292
|
-
leftHand.transform(`r${val},${leftShoulderRotationPoints}`);
|
|
293
|
-
},
|
|
294
|
-
from: -150,
|
|
295
|
-
to: -120,
|
|
296
|
-
dur: 100,
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
funct: function (val: number) {
|
|
300
|
-
leftArm.transform(`r${val},${leftShoulderRotationPoints}`);
|
|
301
|
-
leftHand.transform(`r${val},${leftShoulderRotationPoints}`);
|
|
302
|
-
},
|
|
303
|
-
from: -120,
|
|
304
|
-
to: -150,
|
|
305
|
-
dur: 100,
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
funct: function (val: number) {
|
|
309
|
-
leftArm.transform(`r${val},${leftShoulderRotationPoints}`);
|
|
310
|
-
leftHand.transform(`r${val},${leftShoulderRotationPoints}`);
|
|
311
|
-
},
|
|
312
|
-
from: -150,
|
|
313
|
-
to: -120,
|
|
314
|
-
dur: 100,
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
funct: function (val: number) {
|
|
318
|
-
leftArm.transform(`r${val},${leftShoulderRotationPoints}`);
|
|
319
|
-
leftHand.transform(`r${val},${leftShoulderRotationPoints}`);
|
|
320
|
-
},
|
|
321
|
-
from: -120,
|
|
322
|
-
to: -150,
|
|
323
|
-
dur: 100,
|
|
324
|
-
},
|
|
325
|
-
{
|
|
326
|
-
funct: function (val: number) {
|
|
327
|
-
leftArm.transform(`r${val},${leftShoulderRotationPoints}`);
|
|
328
|
-
leftHand.transform(`r${val},${leftShoulderRotationPoints}`);
|
|
329
|
-
},
|
|
330
|
-
from: -150,
|
|
331
|
-
to: -120,
|
|
332
|
-
dur: 100,
|
|
333
|
-
},
|
|
334
|
-
{
|
|
335
|
-
funct: function (val: number) {
|
|
336
|
-
leftArm.transform(`r${val},${leftShoulderRotationPoints}`);
|
|
337
|
-
leftHand.transform(`r${val},${leftShoulderRotationPoints}`);
|
|
338
|
-
},
|
|
339
|
-
from: -120,
|
|
340
|
-
to: 0,
|
|
341
|
-
dur: 100,
|
|
342
|
-
},
|
|
343
|
-
];
|
|
344
|
-
|
|
345
|
-
const jump = (): void => {
|
|
346
|
-
torso.animate({ transform: 't0,20' }, 500);
|
|
347
|
-
arms.animate({ transform: 't0,20' }, 500);
|
|
348
|
-
straps.animate({ transform: 't0,20' }, 500);
|
|
349
|
-
hands.animate({ transform: 't0,20' }, 500);
|
|
350
|
-
face.animate({ transform: 't0,20' }, 500, function () {
|
|
351
|
-
face.animate({ transform: 't0,-70' }, 200);
|
|
352
|
-
torso.animate({ transform: 't0,-70' }, 200);
|
|
353
|
-
arms.animate({ transform: 't0,-70' }, 200);
|
|
354
|
-
straps.animate({ transform: 't0,-70' }, 200);
|
|
355
|
-
hands.animate({ transform: 't0,-70' }, 200);
|
|
356
|
-
legs.animate({ transform: 't0,-70' }, 200, function () {
|
|
357
|
-
face.animate({ transform: 't0,0' }, 200);
|
|
358
|
-
torso.animate({ transform: 't0,0' }, 200);
|
|
359
|
-
arms.animate({ transform: 't0,0' }, 200);
|
|
360
|
-
straps.animate({ transform: 't0,0' }, 200);
|
|
361
|
-
hands.animate({ transform: 't0,0' }, 200);
|
|
362
|
-
legs.animate({ transform: 't0,0' }, 200);
|
|
363
|
-
});
|
|
364
|
-
});
|
|
365
|
-
};
|
|
366
|
-
|
|
367
|
-
const eyesLeft = (duration: any): void => {
|
|
368
|
-
leftEyePupil.animate({ transform: 't2,0' }, duration);
|
|
369
|
-
rightEyePupil.animate({ transform: 't2,0' }, duration);
|
|
370
|
-
};
|
|
371
|
-
|
|
372
|
-
const eyesRight = (duration: any): void => {
|
|
373
|
-
leftEyePupil.animate({ transform: 't-2,0' }, duration);
|
|
374
|
-
rightEyePupil.animate({ transform: 't-2,0' }, duration);
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
const eyesCenter = (duration: any): void => {
|
|
378
|
-
leftEyePupil.animate({ transform: 't0,0' }, duration);
|
|
379
|
-
rightEyePupil.animate({ transform: 't0,0' }, duration);
|
|
380
|
-
};
|
|
381
|
-
|
|
382
|
-
const blink = (times: number): void => {
|
|
383
|
-
if (times < 1) return;
|
|
384
|
-
[...Array(times)].forEach((_) => {
|
|
385
|
-
leftEyeWhite?.animate({ ry: 0 }, 120);
|
|
386
|
-
leftEyePupil.animate({ ry: 0 }, 120);
|
|
387
|
-
rightEyeWhite?.animate({ ry: 0 }, 120);
|
|
388
|
-
rightEyePupil.animate({ ry: 0 }, 120, function () {
|
|
389
|
-
leftEyeWhite?.animate({ ry: 4 }, 200);
|
|
390
|
-
leftEyePupil?.animate({ ry: 3 }, 200);
|
|
391
|
-
rightEyeWhite?.animate({ ry: 4 }, 200);
|
|
392
|
-
rightEyePupil?.animate({ ry: 3 }, 200, () => {
|
|
393
|
-
blink(times - 1);
|
|
394
|
-
});
|
|
395
|
-
});
|
|
396
|
-
});
|
|
397
|
-
};
|
|
398
|
-
|
|
399
|
-
const animate = (s: any, animation: any): any => {
|
|
400
|
-
nextFrame(s, animation, 0);
|
|
401
|
-
};
|
|
402
|
-
|
|
403
|
-
// const drawPath = (s: any): void => {
|
|
404
|
-
// const linePath =
|
|
405
|
-
// "M46.5,433 q3.5,-153 7,-356 q59,-51 116,-5 q60,96 1,159 q-58,26 -116,2 q108,57 119,202 q26,-166 41,-371 q99,1 186,3 q28,108 -21,187 q-66,23 -160,-9 q154,79 133,143 q-82,59 -175,42";
|
|
406
|
-
// const lineLength: number = Snap.path.getTotalLength(linePath);
|
|
407
|
-
// const lineDraw = s?.path(linePath);
|
|
408
|
-
// lineDraw.attr({
|
|
409
|
-
// fill: "none",
|
|
410
|
-
// stroke: "#009FE3",
|
|
411
|
-
// "stroke-dasharray": `${lineLength} ${lineLength}`,
|
|
412
|
-
// "stroke-dashoffset": lineLength,
|
|
413
|
-
// "stroke-width": 6,
|
|
414
|
-
// "stroke-linecap": "round",
|
|
415
|
-
// "stroke-linejoin": "round",
|
|
416
|
-
// "stroke-miterlimit": 10,
|
|
417
|
-
// });
|
|
418
|
-
// lineDraw.animate(
|
|
419
|
-
// {
|
|
420
|
-
// strokeDashoffset: 0,
|
|
421
|
-
// },
|
|
422
|
-
// 3000,
|
|
423
|
-
// null
|
|
424
|
-
// );
|
|
425
|
-
// };
|
|
426
|
-
|
|
427
|
-
useEffect(() => {
|
|
428
|
-
if (typeof window === 'undefined') return;
|
|
429
|
-
if (Snap) {
|
|
430
|
-
setS(Snap('#svg'));
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
const makeBlinkHappen = (): void => {
|
|
434
|
-
const randNum = Math.floor(Math.random() * 2) + 1;
|
|
435
|
-
blink(randNum);
|
|
436
|
-
};
|
|
437
|
-
|
|
438
|
-
const loadActions = (): void => {
|
|
439
|
-
if (!avatar) return;
|
|
440
|
-
|
|
441
|
-
setTimeout(() => {
|
|
442
|
-
animate(s, leftWave);
|
|
443
|
-
}, 1000);
|
|
444
|
-
|
|
445
|
-
// drawPath(s)
|
|
446
|
-
setInterval(makeBlinkHappen, 3500);
|
|
447
|
-
|
|
448
|
-
rightArm?.click(() => animate(s, rightWave));
|
|
449
|
-
rightHand?.click(() => animate(s, rightWave));
|
|
450
|
-
|
|
451
|
-
leftArm?.click(() => animate(s, leftWave));
|
|
452
|
-
leftHand?.click(() => animate(s, leftWave));
|
|
453
|
-
armless?.click(jump);
|
|
454
|
-
leftArm?.hover(() => {
|
|
455
|
-
eyesLeft(200);
|
|
456
|
-
});
|
|
457
|
-
leftThigh?.hover(() => {
|
|
458
|
-
eyesLeft(200);
|
|
459
|
-
});
|
|
460
|
-
leftShoe?.hover(() => {
|
|
461
|
-
eyesLeft(200);
|
|
462
|
-
});
|
|
463
|
-
|
|
464
|
-
torso?.hover(() => {
|
|
465
|
-
eyesCenter(200);
|
|
466
|
-
});
|
|
467
|
-
|
|
468
|
-
rightArm?.hover(() => {
|
|
469
|
-
eyesRight(200);
|
|
470
|
-
});
|
|
471
|
-
rightThigh?.hover(() => {
|
|
472
|
-
eyesRight(200);
|
|
473
|
-
});
|
|
474
|
-
rightShoe?.hover(() => {
|
|
475
|
-
eyesRight(200);
|
|
476
|
-
});
|
|
477
|
-
};
|
|
478
|
-
|
|
479
|
-
createAvatar(s, loadActions);
|
|
480
|
-
}, [s]);
|
|
481
|
-
|
|
482
|
-
return (
|
|
483
|
-
<svg
|
|
484
|
-
id="svg"
|
|
485
|
-
className="mx-auto"
|
|
486
|
-
height={`${svgContainerHeight.toString()}px`}
|
|
487
|
-
width={`${svgContainerWidth.toString()}px`}
|
|
488
|
-
version="1.1"
|
|
489
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
490
|
-
/>
|
|
491
|
-
);
|
|
492
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import { Breadcrumbs } from '.';
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'V2Components/Breadcrumbs',
|
|
7
|
-
component: Breadcrumbs,
|
|
8
|
-
args: {
|
|
9
|
-
children: [
|
|
10
|
-
<Breadcrumbs.Item>
|
|
11
|
-
<Breadcrumbs.Label href="#">Link 1</Breadcrumbs.Label>
|
|
12
|
-
</Breadcrumbs.Item>,
|
|
13
|
-
<Breadcrumbs.Item>
|
|
14
|
-
<Breadcrumbs.Label href="#">Link 2</Breadcrumbs.Label>
|
|
15
|
-
</Breadcrumbs.Item>,
|
|
16
|
-
<Breadcrumbs.Item>
|
|
17
|
-
<Breadcrumbs.Label href="#">Link 3</Breadcrumbs.Label>
|
|
18
|
-
</Breadcrumbs.Item>,
|
|
19
|
-
<Breadcrumbs.Item>
|
|
20
|
-
<Breadcrumbs.Label href="#">Link 4</Breadcrumbs.Label>
|
|
21
|
-
</Breadcrumbs.Item>,
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
} satisfies Meta<typeof Breadcrumbs>;
|
|
25
|
-
export default meta;
|
|
26
|
-
|
|
27
|
-
type Story = StoryObj<typeof Breadcrumbs>;
|
|
28
|
-
|
|
29
|
-
export const Default: Story = {};
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { forwardRef, HTMLAttributes } from 'react';
|
|
2
|
-
|
|
3
|
-
import classNames from 'classnames';
|
|
4
|
-
|
|
5
|
-
export interface BreadcrumbsProps {
|
|
6
|
-
id?: string;
|
|
7
|
-
className?: string;
|
|
8
|
-
links?: Array<{ name: string; href: string }>;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const BreadcrumbsComponent = forwardRef<
|
|
12
|
-
HTMLUListElement,
|
|
13
|
-
HTMLAttributes<HTMLUListElement> & BreadcrumbsProps
|
|
14
|
-
>(({ children, ...props }, ref) => {
|
|
15
|
-
return (
|
|
16
|
-
<ul className="flex gap-2" {...props}>
|
|
17
|
-
{children}
|
|
18
|
-
</ul>
|
|
19
|
-
);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
const BreadcrumbsItem = forwardRef<
|
|
23
|
-
HTMLLIElement,
|
|
24
|
-
HTMLAttributes<HTMLLIElement>
|
|
25
|
-
>(({ children, ...props }, ref) => {
|
|
26
|
-
return (
|
|
27
|
-
<li className="flex items-center gap-2" {...props}>
|
|
28
|
-
{children}
|
|
29
|
-
<p>/</p>
|
|
30
|
-
</li>
|
|
31
|
-
);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
const BreadcrumbsLabel = forwardRef<
|
|
35
|
-
HTMLParagraphElement,
|
|
36
|
-
HTMLAttributes<HTMLParagraphElement> & { href: string }
|
|
37
|
-
>(({ children, href, ...props }, ref) => {
|
|
38
|
-
return (
|
|
39
|
-
<p className="px-1 py-1">
|
|
40
|
-
<a className="text-facebook hover:underline" href={href}>
|
|
41
|
-
{children}
|
|
42
|
-
</a>
|
|
43
|
-
</p>
|
|
44
|
-
);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
BreadcrumbsComponent.displayName = 'Breadcrumbs';
|
|
48
|
-
BreadcrumbsItem.displayName = 'Breadcrumbs.Item';
|
|
49
|
-
BreadcrumbsLabel.displayName = 'Breadcrumbs.Label';
|
|
50
|
-
|
|
51
|
-
const Breadcrumbs = Object.assign(BreadcrumbsComponent, {
|
|
52
|
-
Item: BreadcrumbsItem,
|
|
53
|
-
Label: BreadcrumbsLabel,
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
export { Breadcrumbs };
|
|
57
|
-
|
|
58
|
-
// export const Breadcrumbs = ({ id, className, links }: Props) => {
|
|
59
|
-
// const linksLength = links != null ? Object.keys(links).length : 0;
|
|
60
|
-
|
|
61
|
-
// const classList = classNames(className, 'flex py-2');
|
|
62
|
-
|
|
63
|
-
// return (
|
|
64
|
-
// <ul id={id} className={classList}>
|
|
65
|
-
// {links?.map((link, i) => {
|
|
66
|
-
// return (
|
|
67
|
-
// <div key={`breadcrumb_${i + 1}`} className="flex">
|
|
68
|
-
// <li className="h-8">
|
|
69
|
-
// {i + 1 >= linksLength ? (
|
|
70
|
-
// <p className="px-1 py-1">{link.name}</p>
|
|
71
|
-
// ) : (
|
|
72
|
-
// <p className="px-1 py-1">
|
|
73
|
-
// <a className="text-facebook hover:underline" href={link.href}>
|
|
74
|
-
// {link.name}
|
|
75
|
-
// </a>
|
|
76
|
-
// </p>
|
|
77
|
-
// )}
|
|
78
|
-
// </li>
|
|
79
|
-
// {i + 1 < linksLength && (
|
|
80
|
-
// <li className="h-8">
|
|
81
|
-
// <p className="py-1"> > </p>
|
|
82
|
-
// </li>
|
|
83
|
-
// )}
|
|
84
|
-
// </div>
|
|
85
|
-
// );
|
|
86
|
-
// })}
|
|
87
|
-
// </ul>
|
|
88
|
-
// );
|
|
89
|
-
// };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { faHeart } from '@fortawesome/fontawesome-free-solid';
|
|
2
|
-
import { action } from '@storybook/addon-actions';
|
|
3
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
4
|
-
|
|
5
|
-
import { Button } from '.';
|
|
6
|
-
|
|
7
|
-
const meta = {
|
|
8
|
-
title: 'V2Components/Button',
|
|
9
|
-
component: Button,
|
|
10
|
-
args: {
|
|
11
|
-
variant: 'primary',
|
|
12
|
-
children: [
|
|
13
|
-
<Button.Icon icon={faHeart} />,
|
|
14
|
-
<Button.Label>This is a button</Button.Label>,
|
|
15
|
-
],
|
|
16
|
-
onClick: action('clicked'),
|
|
17
|
-
},
|
|
18
|
-
} satisfies Meta<typeof Button>;
|
|
19
|
-
|
|
20
|
-
export default meta;
|
|
21
|
-
|
|
22
|
-
type Story = StoryObj<typeof Button>;
|
|
23
|
-
|
|
24
|
-
export const Default: Story = {};
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef, forwardRef, HTMLAttributes } from 'react';
|
|
2
|
-
|
|
3
|
-
import { Icon } from '@components/Icon';
|
|
4
|
-
import { PickU } from '@components/Pill';
|
|
5
|
-
import clsx from 'clsx';
|
|
6
|
-
|
|
7
|
-
export interface ButtonProps {
|
|
8
|
-
variant?: 'primary' | 'secondary' | 'ghost';
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const ButtonComponent = forwardRef<
|
|
13
|
-
HTMLButtonElement,
|
|
14
|
-
HTMLAttributes<HTMLButtonElement> & ButtonProps
|
|
15
|
-
>(({ className, children, variant = 'primary', disabled, ...props }) => {
|
|
16
|
-
return (
|
|
17
|
-
<button
|
|
18
|
-
className={clsx(
|
|
19
|
-
'flex items-center gap-2 rounded-lg border px-4 py-2 text-center text-sm duration-200',
|
|
20
|
-
{
|
|
21
|
-
'border-button-primary-border bg-button-primary-bg text-button-primary-text hover:bg-button-primary-hover active:bg-button-primary-active':
|
|
22
|
-
variant === 'primary',
|
|
23
|
-
'border-button-secondary-border bg-button-secondary-bg text-button-secondary-text hover:bg-button-secondary-hover active:bg-button-secondary-active':
|
|
24
|
-
variant === 'secondary',
|
|
25
|
-
'border-button-ghost-border bg-button-ghost-bg text-button-ghost-text hover:bg-button-ghost-hover active:bg-button-ghost-active':
|
|
26
|
-
variant === 'ghost',
|
|
27
|
-
},
|
|
28
|
-
className,
|
|
29
|
-
)}
|
|
30
|
-
{...props}
|
|
31
|
-
>
|
|
32
|
-
{children}
|
|
33
|
-
</button>
|
|
34
|
-
);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
const ButtonLabel = forwardRef<
|
|
38
|
-
HTMLParagraphElement,
|
|
39
|
-
HTMLAttributes<HTMLParagraphElement>
|
|
40
|
-
>(({ className, ...props }, ref) => (
|
|
41
|
-
<p className={clsx('text-md', className)} ref={ref} {...props} />
|
|
42
|
-
));
|
|
43
|
-
|
|
44
|
-
const ButtonIcon = forwardRef<
|
|
45
|
-
SVGSVGElement,
|
|
46
|
-
PickU<ComponentPropsWithoutRef<typeof Icon>, 'icon'>
|
|
47
|
-
>(({ icon }, ref) => <Icon size="md" ref={ref} icon={icon} />);
|
|
48
|
-
|
|
49
|
-
ButtonComponent.displayName = 'Button';
|
|
50
|
-
|
|
51
|
-
ButtonIcon.displayName = 'Button.Icon';
|
|
52
|
-
ButtonLabel.displayName = 'Button.Label';
|
|
53
|
-
|
|
54
|
-
const Button = Object.assign(ButtonComponent, {
|
|
55
|
-
Icon: ButtonIcon,
|
|
56
|
-
Label: ButtonLabel,
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
export { Button };
|