@tripie-pyotato/design-system 0.0.0
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/.turbo/turbo-build.log +4 -0
- package/.turbo/turbo-lint$colon$fix.log +22 -0
- package/.turbo/turbo-lint.log +18 -0
- package/.turbo/turbo-test.log +152 -0
- package/.turbo/turbo-typecheck.log +5 -0
- package/coverage/clover.xml +1651 -0
- package/coverage/coverage-final.json +57 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/dist/button.js.html +112 -0
- package/coverage/lcov-report/dist/common.js.html +127 -0
- package/coverage/lcov-report/dist/components/body/_body.js.html +157 -0
- package/coverage/lcov-report/dist/components/body/_body.stories.js.html +193 -0
- package/coverage/lcov-report/dist/components/body/index.html +146 -0
- package/coverage/lcov-report/dist/components/body/index.js.html +109 -0
- package/coverage/lcov-report/dist/components/index.html +116 -0
- package/coverage/lcov-report/dist/components/index.js.html +127 -0
- package/coverage/lcov-report/dist/components/myButton/index.html +161 -0
- package/coverage/lcov-report/dist/components/myButton/index.js.html +154 -0
- package/coverage/lcov-report/dist/components/myButton/my-button.js.html +109 -0
- package/coverage/lcov-report/dist/components/myButton/myButton.js.html +133 -0
- package/coverage/lcov-report/dist/components/myButton/myButton.stories.js.html +181 -0
- package/coverage/lcov-report/dist/components/typography/_typography.js.html +190 -0
- package/coverage/lcov-report/dist/components/typography/_typography.stories.js.html +352 -0
- package/coverage/lcov-report/dist/components/typography/index.html +146 -0
- package/coverage/lcov-report/dist/components/typography/index.js.html +154 -0
- package/coverage/lcov-report/dist/components/typography/text/_text.js.html +139 -0
- package/coverage/lcov-report/dist/components/typography/text/_text.stories.js.html +259 -0
- package/coverage/lcov-report/dist/components/typography/text/index.html +146 -0
- package/coverage/lcov-report/dist/components/typography/text/index.js.html +160 -0
- package/coverage/lcov-report/dist/fonts/index.html +116 -0
- package/coverage/lcov-report/dist/fonts/index.js.html +154 -0
- package/coverage/lcov-report/dist/hooks/index.html +131 -0
- package/coverage/lcov-report/dist/hooks/index.js.html +136 -0
- package/coverage/lcov-report/dist/hooks/useAppTheme.js.html +202 -0
- package/coverage/lcov-report/dist/index.html +161 -0
- package/coverage/lcov-report/dist/index.js.html +139 -0
- package/coverage/lcov-report/dist/my-button.js.html +109 -0
- package/coverage/lcov-report/dist/myButton/Button.stories.js.html +229 -0
- package/coverage/lcov-report/dist/myButton/index.html +161 -0
- package/coverage/lcov-report/dist/myButton/index.js.html +154 -0
- package/coverage/lcov-report/dist/myButton/myButton.js.html +133 -0
- package/coverage/lcov-report/dist/myButton/myButton.stories.js.html +181 -0
- package/coverage/lcov-report/dist/text/index.html +176 -0
- package/coverage/lcov-report/dist/text/index.js.html +139 -0
- package/coverage/lcov-report/dist/text/text.js.html +151 -0
- package/coverage/lcov-report/dist/text/text.stories.js.html +232 -0
- package/coverage/lcov-report/dist/text/typography.js.html +160 -0
- package/coverage/lcov-report/dist/text/typography.stories.js.html +166 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +431 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/src/components/body/_body.stories.tsx.html +196 -0
- package/coverage/lcov-report/src/components/body/_body.tsx.html +163 -0
- package/coverage/lcov-report/src/components/body/index.html +146 -0
- package/coverage/lcov-report/src/components/body/index.ts.html +88 -0
- package/coverage/lcov-report/src/components/index.html +116 -0
- package/coverage/lcov-report/src/components/index.ts.html +97 -0
- package/coverage/lcov-report/src/components/myButton/index.html +161 -0
- package/coverage/lcov-report/src/components/myButton/index.ts.html +91 -0
- package/coverage/lcov-report/src/components/myButton/my-button.tsx.html +109 -0
- package/coverage/lcov-report/src/components/myButton/myButton.stories.tsx.html +220 -0
- package/coverage/lcov-report/src/components/myButton/myButton.tsx.html +160 -0
- package/coverage/lcov-report/src/components/typography/font/_font.tsx.html +127 -0
- package/coverage/lcov-report/src/components/typography/font/index.html +131 -0
- package/coverage/lcov-report/src/components/typography/font/index.ts.html +91 -0
- package/coverage/lcov-report/src/components/typography/headings/_headings.stories.tsx.html +361 -0
- package/coverage/lcov-report/src/components/typography/headings/_headings.tsx.html +211 -0
- package/coverage/lcov-report/src/components/typography/headings/index.html +146 -0
- package/coverage/lcov-report/src/components/typography/headings/index.ts.html +91 -0
- package/coverage/lcov-report/src/components/typography/index.html +116 -0
- package/coverage/lcov-report/src/components/typography/index.ts.html +91 -0
- package/coverage/lcov-report/src/components/typography/link/_link.stories.tsx.html +268 -0
- package/coverage/lcov-report/src/components/typography/link/_link.tsx.html +199 -0
- package/coverage/lcov-report/src/components/typography/link/index.html +146 -0
- package/coverage/lcov-report/src/components/typography/link/index.ts.html +91 -0
- package/coverage/lcov-report/src/components/typography/paragraph/_paragraph.stories.tsx.html +229 -0
- package/coverage/lcov-report/src/components/typography/paragraph/_paragraph.tsx.html +124 -0
- package/coverage/lcov-report/src/components/typography/paragraph/index.html +131 -0
- package/coverage/lcov-report/src/components/typography/text/_text.stories.tsx.html +184 -0
- package/coverage/lcov-report/src/components/typography/text/_text.tsx.html +196 -0
- package/coverage/lcov-report/src/components/typography/text/index.html +146 -0
- package/coverage/lcov-report/src/components/typography/text/index.ts.html +91 -0
- package/coverage/lcov-report/src/hooks/index.html +131 -0
- package/coverage/lcov-report/src/hooks/index.ts.html +88 -0
- package/coverage/lcov-report/src/hooks/useAppTheme.ts.html +220 -0
- package/coverage/lcov-report/src/index.html +116 -0
- package/coverage/lcov-report/src/index.ts.html +91 -0
- package/coverage/lcov-report/turbo/generators/config.ts.html +175 -0
- package/coverage/lcov-report/turbo/generators/index.html +116 -0
- package/coverage/lcov.info +2087 -0
- package/dist/button.d.ts +7 -0
- package/dist/button.d.ts.map +1 -0
- package/dist/button.js +9 -0
- package/dist/common.d.ts +12 -0
- package/dist/common.d.ts.map +1 -0
- package/dist/common.js +14 -0
- package/dist/components/body/_body.d.ts +8 -0
- package/dist/components/body/_body.d.ts.map +1 -0
- package/dist/components/body/_body.js +24 -0
- package/dist/components/body/_body.stories.d.ts +7 -0
- package/dist/components/body/_body.stories.d.ts.map +1 -0
- package/dist/components/body/_body.stories.js +36 -0
- package/dist/components/body/index.d.ts +2 -0
- package/dist/components/body/index.d.ts.map +1 -0
- package/dist/components/body/index.js +8 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +14 -0
- package/dist/components/myButton/index.d.ts +3 -0
- package/dist/components/myButton/index.d.ts.map +1 -0
- package/dist/components/myButton/index.js +23 -0
- package/dist/components/myButton/my-button.d.ts +4 -0
- package/dist/components/myButton/my-button.d.ts.map +1 -0
- package/dist/components/myButton/my-button.js +8 -0
- package/dist/components/myButton/myButton.d.ts +7 -0
- package/dist/components/myButton/myButton.d.ts.map +1 -0
- package/dist/components/myButton/myButton.js +16 -0
- package/dist/components/myButton/myButton.stories.d.ts +7 -0
- package/dist/components/myButton/myButton.stories.d.ts.map +1 -0
- package/dist/components/myButton/myButton.stories.js +32 -0
- package/dist/components/typography/_typography.d.ts +23 -0
- package/dist/components/typography/_typography.d.ts.map +1 -0
- package/dist/components/typography/_typography.js +35 -0
- package/dist/components/typography/_typography.stories.d.ts +13 -0
- package/dist/components/typography/_typography.stories.d.ts.map +1 -0
- package/dist/components/typography/_typography.stories.js +89 -0
- package/dist/components/typography/index.d.ts +3 -0
- package/dist/components/typography/index.d.ts.map +1 -0
- package/dist/components/typography/index.js +23 -0
- package/dist/components/typography/text/_text.d.ts +19 -0
- package/dist/components/typography/text/_text.d.ts.map +1 -0
- package/dist/components/typography/text/_text.js +18 -0
- package/dist/components/typography/text/_text.stories.d.ts +10 -0
- package/dist/components/typography/text/_text.stories.d.ts.map +1 -0
- package/dist/components/typography/text/_text.stories.js +58 -0
- package/dist/components/typography/text/index.d.ts +3 -0
- package/dist/components/typography/text/index.d.ts.map +1 -0
- package/dist/components/typography/text/index.js +25 -0
- package/dist/fonts/index.d.ts +3 -0
- package/dist/fonts/index.d.ts.map +1 -0
- package/dist/fonts/index.js +23 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +17 -0
- package/dist/hooks/useAppTheme.d.ts +21 -0
- package/dist/hooks/useAppTheme.d.ts.map +1 -0
- package/dist/hooks/useAppTheme.js +39 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/my-button.d.ts +4 -0
- package/dist/my-button.d.ts.map +1 -0
- package/dist/my-button.js +8 -0
- package/dist/myButton/Button.stories.d.ts +8 -0
- package/dist/myButton/Button.stories.d.ts.map +1 -0
- package/dist/myButton/Button.stories.js +48 -0
- package/dist/myButton/index.d.ts +3 -0
- package/dist/myButton/index.d.ts.map +1 -0
- package/dist/myButton/index.js +23 -0
- package/dist/myButton/myButton.d.ts +7 -0
- package/dist/myButton/myButton.d.ts.map +1 -0
- package/dist/myButton/myButton.js +16 -0
- package/dist/myButton/myButton.stories.d.ts +7 -0
- package/dist/myButton/myButton.stories.d.ts.map +1 -0
- package/dist/myButton/myButton.stories.js +32 -0
- package/dist/src/components/Accordian/Accordian.jsx +61 -0
- package/dist/src/components/Accordian/accordian.stories.jsx +76 -0
- package/dist/src/components/Accordian/index.js +21 -0
- package/dist/src/components/Accordian/variants.js +46 -0
- package/dist/src/components/Carousel/Carousel.jsx +84 -0
- package/dist/src/components/Carousel/Carousel.spec.jsx +203 -0
- package/dist/src/components/Carousel/carousel.stories.jsx +56 -0
- package/dist/src/components/Carousel/images.js +40 -0
- package/dist/src/components/Carousel/index.js +20 -0
- package/dist/src/components/Chip/Chip.jsx +27 -0
- package/dist/src/components/Chip/Chip.spec.jsx +103 -0
- package/dist/src/components/Chip/chip.stories.jsx +61 -0
- package/dist/src/components/Chip/index.js +20 -0
- package/dist/src/components/ChipMarker/ChipMarker.jsx +17 -0
- package/dist/src/components/ChipMarker/chip.stories.jsx +42 -0
- package/dist/src/components/ChipMarker/index.js +20 -0
- package/dist/src/components/Divider/Divider.jsx +21 -0
- package/dist/src/components/Divider/constants.js +10 -0
- package/dist/src/components/Divider/divider.stories.jsx +72 -0
- package/dist/src/components/Divider/index.js +20 -0
- package/dist/src/components/Headings/Headings.jsx +37 -0
- package/dist/src/components/Headings/headings.stories.jsx +83 -0
- package/dist/src/components/Headings/index.js +20 -0
- package/dist/src/components/Link/Link.jsx +26 -0
- package/dist/src/components/Link/List.spec.jsx +22 -0
- package/dist/src/components/Link/index.js +20 -0
- package/dist/src/components/Link/link.stories.jsx +53 -0
- package/dist/src/components/List/List.jsx +29 -0
- package/dist/src/components/List/list-item.stories.jsx +81 -0
- package/dist/src/components/List/list.stories.jsx +45 -0
- package/dist/src/components/List/variants.js +24 -0
- package/dist/src/components/MotionSlideUp/MotionSlideUp.jsx +20 -0
- package/dist/src/components/MotionSlideUp/index.js +20 -0
- package/dist/src/components/Particle/Background/ParticleBackground.jsx +16 -0
- package/dist/src/components/Particle/Background/index.js +20 -0
- package/dist/src/components/Particle/Background/particle-background.stories.jsx +29 -0
- package/dist/src/components/Particle/Field/ParticleField.jsx +17 -0
- package/dist/src/components/Particle/Field/index.js +20 -0
- package/dist/src/components/Particle/Field/particle-field.stories.jsx +31 -0
- package/dist/src/components/Particle/Particles/Particles.jsx +15 -0
- package/dist/src/components/RotatingBlur/RotatingBlur.jsx +19 -0
- package/dist/src/components/RotatingBlur/index.js +20 -0
- package/dist/src/components/RotatingBlur/rotating-blur.stories.jsx +38 -0
- package/dist/src/components/SplashScreen/SplashScreen.jsx +22 -0
- package/dist/src/components/SplashScreen/index.js +20 -0
- package/dist/src/components/SplashScreen/splash-screen.stories.jsx +44 -0
- package/dist/src/components/Switch/Switch.jsx +18 -0
- package/dist/src/components/Switch/index.js +20 -0
- package/dist/src/components/Switch/switch.stories.jsx +31 -0
- package/dist/src/components/Switch/variants.js +35 -0
- package/dist/src/components/Text/Text.jsx +72 -0
- package/dist/src/components/Text/index.js +20 -0
- package/dist/src/components/Text/text.stories.jsx +44 -0
- package/dist/src/components/Text/variants.js +40 -0
- package/dist/src/components/TextFill/TextFillAnimation.jsx +51 -0
- package/dist/src/components/TextFill/index.js +20 -0
- package/dist/src/components/TextFill/text-fill-animation.stories.jsx +51 -0
- package/dist/src/components/TextUnderlineAnimation/TextUnderlineAnimation.jsx +16 -0
- package/dist/src/components/TextUnderlineAnimation/index.js +20 -0
- package/dist/src/components/TextUnderlineAnimation/text-underline-animation.stories.jsx +34 -0
- package/dist/src/components/TextUnderlineAnimation/variants.js +24 -0
- package/dist/src/components/TripieButton/Animated/AnimateButton.spec.jsx +106 -0
- package/dist/src/components/TripieButton/Animated/AnimatedButton.jsx +16 -0
- package/dist/src/components/TripieButton/Animated/animated-button.stories.jsx +58 -0
- package/dist/src/components/TripieButton/Animated/index.js +20 -0
- package/dist/src/components/TripieButton/Animated/variants.js +15 -0
- package/dist/src/components/TripieButton/MenuToggle/MenuItem/index.jsx +15 -0
- package/dist/src/components/TripieButton/MenuToggle/MenuItem/menu-item.stories.jsx +36 -0
- package/dist/src/components/TripieButton/MenuToggle/MenuItem/variants.js +19 -0
- package/dist/src/components/TripieButton/MenuToggle/MenuList/index.jsx +15 -0
- package/dist/src/components/TripieButton/MenuToggle/MenuList/menu-list.stories.jsx +41 -0
- package/dist/src/components/TripieButton/MenuToggle/MenuList/variants.js +15 -0
- package/dist/src/components/TripieButton/MenuToggle/MenuToggle.jsx +45 -0
- package/dist/src/components/TripieButton/MenuToggle/index.js +20 -0
- package/dist/src/components/TripieButton/MenuToggle/menu-toggle.stories.jsx +55 -0
- package/dist/src/components/TripieButton/NoStyle/NoStyleButton.jsx +12 -0
- package/dist/src/components/TripieButton/NoStyle/NoStyleButton.spec.jsx +87 -0
- package/dist/src/components/TripieButton/NoStyle/index.js +20 -0
- package/dist/src/components/TripieButton/NoStyle/no-style-button.stories.jsx +29 -0
- package/dist/src/components/TripieCard/Card.jsx +57 -0
- package/dist/src/components/TripieCard/card.stories.jsx +45 -0
- package/dist/src/components/TripieCard/index.js +20 -0
- package/dist/src/components/TripieContainer/TripieContainer.jsx +23 -0
- package/dist/src/components/TripieContainer/index.js +20 -0
- package/dist/src/components/TripieContainer/tripie-container.stories.jsx +70 -0
- package/dist/src/components/TripieIcon/Icon.jsx +84 -0
- package/dist/src/components/TripieIcon/icon-transport.stories.jsx +89 -0
- package/dist/src/components/TripieIcon/icon.stories.jsx +68 -0
- package/dist/src/components/TripieIcon/index.js +20 -0
- package/dist/src/components/TripieIcon/variants.js +172 -0
- package/dist/src/components/TripieImage/TripieImage.jsx +25 -0
- package/dist/src/components/TripieImage/index.js +20 -0
- package/dist/src/components/TripieImage/tripie-image.stories.jsx +86 -0
- package/dist/src/components/TripieSkeleton/Skeleton.jsx +30 -0
- package/dist/src/components/TripieSkeleton/index.js +20 -0
- package/dist/src/components/TripieSkeleton/skeleton.stories.jsx +28 -0
- package/dist/src/components/index.js +54 -0
- package/dist/src/font.js +12 -0
- package/dist/src/hooks/index.js +19 -0
- package/dist/src/hooks/useAppTheme.js +33 -0
- package/dist/src/hooks/useCycle.js +32 -0
- package/dist/src/hooks/useDrawer.js +21 -0
- package/dist/src/index.js +19 -0
- package/dist/src/shared/colors.js +20 -0
- package/dist/src/shared/index.js +19 -0
- package/dist/src/shared/resource.js +26 -0
- package/dist/src/shared/variants.js +66 -0
- package/dist/text/index.d.ts +3 -0
- package/dist/text/index.d.ts.map +1 -0
- package/dist/text/index.js +18 -0
- package/dist/text/text.d.ts +47 -0
- package/dist/text/text.d.ts.map +1 -0
- package/dist/text/text.js +22 -0
- package/dist/text/text.stories.d.ts +10 -0
- package/dist/text/text.stories.d.ts.map +1 -0
- package/dist/text/text.stories.js +49 -0
- package/dist/text/typography.d.ts +18 -0
- package/dist/text/typography.d.ts.map +1 -0
- package/dist/text/typography.js +25 -0
- package/dist/text/typography.stories.d.ts +7 -0
- package/dist/text/typography.stories.d.ts.map +1 -0
- package/dist/text/typography.stories.js +27 -0
- package/dist/turbo/generators/config.js +30 -0
- package/jest.config.cjs +21 -0
- package/jest.setup.cjs +4 -0
- package/package.json +80 -0
- package/setupTests.mjs +39 -0
- package/src/base/_breakpoint.scss +15 -0
- package/src/base/_colors.scss +98 -0
- package/src/base/_config.scss +33 -0
- package/src/base/_font-size.scss +17 -0
- package/src/base/_font-stack.scss +27 -0
- package/src/base/_font-weight.scss +23 -0
- package/src/base/_letter-spacing.scss +12 -0
- package/src/base/_line-height.scss +12 -0
- package/src/base/_motion.scss +35 -0
- package/src/base/_shape.scss +19 -0
- package/src/base/_space.scss +58 -0
- package/src/base/_theme.scss +97 -0
- package/src/base/_z-index.scss +44 -0
- package/src/base/index.scss +13 -0
- package/src/components/Accordian/Accordian.tsx +72 -0
- package/src/components/Accordian/accordian.module.scss +18 -0
- package/src/components/Accordian/accordian.stories.tsx +86 -0
- package/src/components/Accordian/index.ts +3 -0
- package/src/components/Accordian/variants.ts +45 -0
- package/src/components/Carousel/Carousel.spec.tsx +239 -0
- package/src/components/Carousel/Carousel.tsx +131 -0
- package/src/components/Carousel/carousel.module.scss +61 -0
- package/src/components/Carousel/carousel.stories.tsx +117 -0
- package/src/components/Carousel/images.ts +44 -0
- package/src/components/Carousel/index.ts +2 -0
- package/src/components/Chip/Chip.spec.tsx +59 -0
- package/src/components/Chip/Chip.tsx +64 -0
- package/src/components/Chip/chip.module.scss +79 -0
- package/src/components/Chip/chip.stories.tsx +70 -0
- package/src/components/Chip/index.ts +2 -0
- package/src/components/ChipMarker/ChipMarker.tsx +20 -0
- package/src/components/ChipMarker/chip-marker.module.scss +75 -0
- package/src/components/ChipMarker/chip.stories.tsx +48 -0
- package/src/components/ChipMarker/index.ts +2 -0
- package/src/components/Divider/Divider.tsx +29 -0
- package/src/components/Divider/constants.ts +9 -0
- package/src/components/Divider/divider.module.scss +37 -0
- package/src/components/Divider/divider.stories.tsx +94 -0
- package/src/components/Divider/index.ts +2 -0
- package/src/components/Headings/Headings.tsx +36 -0
- package/src/components/Headings/headings.module.scss +46 -0
- package/src/components/Headings/headings.stories.tsx +92 -0
- package/src/components/Headings/index.ts +2 -0
- package/src/components/Link/Link.tsx +31 -0
- package/src/components/Link/List.spec.tsx +25 -0
- package/src/components/Link/index.ts +2 -0
- package/src/components/Link/link.module.scss +26 -0
- package/src/components/Link/link.stories.tsx +61 -0
- package/src/components/List/List.tsx +63 -0
- package/src/components/List/list-item.stories.tsx +89 -0
- package/src/components/List/list.module.scss +59 -0
- package/src/components/List/list.stories.tsx +65 -0
- package/src/components/List/variants.ts +23 -0
- package/src/components/MotionSlideUp/MotionSlideUp.tsx +37 -0
- package/src/components/MotionSlideUp/index.ts +2 -0
- package/src/components/Particle/Background/ParticleBackground.tsx +18 -0
- package/src/components/Particle/Background/index.ts +2 -0
- package/src/components/Particle/Background/particle-background.module.scss +25 -0
- package/src/components/Particle/Background/particle-background.stories.tsx +36 -0
- package/src/components/Particle/Field/ParticleField.tsx +28 -0
- package/src/components/Particle/Field/index.ts +2 -0
- package/src/components/Particle/Field/particle-field.module.scss +6 -0
- package/src/components/Particle/Field/particle-field.stories.tsx +38 -0
- package/src/components/Particle/Particles/Particles.tsx +22 -0
- package/src/components/Particle/Particles/particles.module.scss +19 -0
- package/src/components/RotatingBlur/RotatingBlur.tsx +26 -0
- package/src/components/RotatingBlur/index.ts +2 -0
- package/src/components/RotatingBlur/rotating-blur.module.scss +59 -0
- package/src/components/RotatingBlur/rotating-blur.stories.tsx +45 -0
- package/src/components/SplashScreen/SplashScreen.tsx +31 -0
- package/src/components/SplashScreen/index.ts +2 -0
- package/src/components/SplashScreen/splash-screen.module.scss +12 -0
- package/src/components/SplashScreen/splash-screen.stories.tsx +53 -0
- package/src/components/Switch/Switch.tsx +33 -0
- package/src/components/Switch/index.ts +2 -0
- package/src/components/Switch/switch.module.scss +43 -0
- package/src/components/Switch/switch.stories.tsx +36 -0
- package/src/components/Switch/variants.ts +34 -0
- package/src/components/Text/Text.tsx +158 -0
- package/src/components/Text/index.ts +2 -0
- package/src/components/Text/text.module.scss +84 -0
- package/src/components/Text/text.stories.tsx +52 -0
- package/src/components/Text/variants.ts +53 -0
- package/src/components/TextFill/TextFillAnimation.tsx +87 -0
- package/src/components/TextFill/index.ts +2 -0
- package/src/components/TextFill/text-fill-animation.module.scss +37 -0
- package/src/components/TextFill/text-fill-animation.stories.tsx +61 -0
- package/src/components/TextUnderlineAnimation/TextUnderlineAnimation.tsx +37 -0
- package/src/components/TextUnderlineAnimation/index.ts +2 -0
- package/src/components/TextUnderlineAnimation/text-underline-animation.stories.tsx +39 -0
- package/src/components/TextUnderlineAnimation/text-underline.module.scss +13 -0
- package/src/components/TextUnderlineAnimation/variants.ts +23 -0
- package/src/components/TripieButton/Animated/AnimateButton.spec.tsx +84 -0
- package/src/components/TripieButton/Animated/AnimatedButton.tsx +88 -0
- package/src/components/TripieButton/Animated/animated-button.module.scss +61 -0
- package/src/components/TripieButton/Animated/animated-button.stories.tsx +68 -0
- package/src/components/TripieButton/Animated/index.ts +2 -0
- package/src/components/TripieButton/MenuToggle/MenuItem/index.tsx +28 -0
- package/src/components/TripieButton/MenuToggle/MenuItem/menu-item.module.scss +14 -0
- package/src/components/TripieButton/MenuToggle/MenuItem/menu-item.stories.tsx +42 -0
- package/src/components/TripieButton/MenuToggle/MenuItem/variants.ts +18 -0
- package/src/components/TripieButton/MenuToggle/MenuList/index.tsx +20 -0
- package/src/components/TripieButton/MenuToggle/MenuList/menu-list.module.scss +21 -0
- package/src/components/TripieButton/MenuToggle/MenuList/menu-list.stories.tsx +51 -0
- package/src/components/TripieButton/MenuToggle/MenuList/variants.ts +14 -0
- package/src/components/TripieButton/MenuToggle/MenuToggle.tsx +67 -0
- package/src/components/TripieButton/MenuToggle/index.ts +2 -0
- package/src/components/TripieButton/MenuToggle/menu-toggle.module.scss +42 -0
- package/src/components/TripieButton/MenuToggle/menu-toggle.stories.tsx +73 -0
- package/src/components/TripieButton/NoStyle/NoStyleButton.spec.tsx +50 -0
- package/src/components/TripieButton/NoStyle/NoStyleButton.tsx +27 -0
- package/src/components/TripieButton/NoStyle/index.ts +2 -0
- package/src/components/TripieButton/NoStyle/no-style-button.module.scss +5 -0
- package/src/components/TripieButton/NoStyle/no-style-button.stories.tsx +34 -0
- package/src/components/TripieCard/Card.tsx +167 -0
- package/src/components/TripieCard/card.module.scss +122 -0
- package/src/components/TripieCard/card.stories.tsx +66 -0
- package/src/components/TripieCard/index.ts +2 -0
- package/src/components/TripieContainer/TripieContainer.tsx +54 -0
- package/src/components/TripieContainer/index.ts +2 -0
- package/src/components/TripieContainer/tripie-container.module.scss +93 -0
- package/src/components/TripieContainer/tripie-container.stories.tsx +81 -0
- package/src/components/TripieIcon/Icon.tsx +242 -0
- package/src/components/TripieIcon/icon-transport.stories.tsx +108 -0
- package/src/components/TripieIcon/icon.module.scss +35 -0
- package/src/components/TripieIcon/icon.stories.tsx +81 -0
- package/src/components/TripieIcon/index.ts +2 -0
- package/src/components/TripieIcon/variants.ts +177 -0
- package/src/components/TripieImage/TripieImage.tsx +90 -0
- package/src/components/TripieImage/index.ts +2 -0
- package/src/components/TripieImage/tripie-image.module.scss +73 -0
- package/src/components/TripieImage/tripie-image.stories.tsx +128 -0
- package/src/components/TripieSkeleton/Skeleton.tsx +27 -0
- package/src/components/TripieSkeleton/index.ts +2 -0
- package/src/components/TripieSkeleton/skeleton.module.scss +7 -0
- package/src/components/TripieSkeleton/skeleton.stories.tsx +32 -0
- package/src/components/index.ts +25 -0
- package/src/font.ts +12 -0
- package/src/functions/_breakpoint.scss +21 -0
- package/src/functions/_color.scss +63 -0
- package/src/functions/_config.scss +27 -0
- package/src/functions/_shape.scss +29 -0
- package/src/functions/_space.scss +28 -0
- package/src/functions/_typography.scss +101 -0
- package/src/functions/_units.scss +66 -0
- package/src/functions/_z-index.scss +21 -0
- package/src/functions/index.scss +8 -0
- package/src/generator/_generator.scss +21 -0
- package/src/generator/index.scss +1 -0
- package/src/global.scss +49 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useAppTheme.ts +41 -0
- package/src/hooks/useCycle.ts +28 -0
- package/src/hooks/useDrawer.ts +29 -0
- package/src/index.ts +3 -0
- package/src/mixins/_border.scss +83 -0
- package/src/mixins/_clear.scss +21 -0
- package/src/mixins/_color.scss +19 -0
- package/src/mixins/_default.scss +40 -0
- package/src/mixins/_media.scss +26 -0
- package/src/mixins/_normalize.scss +353 -0
- package/src/mixins/_positioning.scss +34 -0
- package/src/mixins/_pseudo.scss +39 -0
- package/src/mixins/_reset.scss +70 -0
- package/src/mixins/_shape.scss +12 -0
- package/src/mixins/_skeleton.scss +89 -0
- package/src/mixins/_text.scss +52 -0
- package/src/mixins/_transition.scss +90 -0
- package/src/mixins/_z-index.scss +12 -0
- package/src/mixins/index.scss +14 -0
- package/src/mixins.scss +275 -0
- package/src/shared/colors.ts +18 -0
- package/src/shared/index.ts +3 -0
- package/src/shared/resource.ts +26 -0
- package/src/shared/variants.ts +68 -0
- package/src/shared/wrappers/classNames.ts +2 -0
- package/src/shared/wrappers/index.tsx +4 -0
- package/src/shared/wrappers/motion-wrapper.tsx +27 -0
- package/src/static/fonts/MaruBuri-Regular.eot +0 -0
- package/src/static/fonts/MaruBuri-Regular.otf +0 -0
- package/src/static/fonts/MaruBuri-Regular.ttf +0 -0
- package/src/static/fonts/MaruBuri-Regular.woff +0 -0
- package/src/static/fonts/MaruBuri-Regular.woff2 +0 -0
- package/src/styles/index.scss +2 -0
- package/src/typings.d.ts +5 -0
- package/src/variables.scss +31 -0
- package/tsconfig.json +21 -0
- package/turbo/generators/config.ts +30 -0
- package/turbo/generators/templates/component.hbs +8 -0
- package/vite.config.mjs +25 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import COLORS from '../../shared/colors';
|
|
2
|
+
import { MotionProps } from '../../shared/wrappers/motion-wrapper';
|
|
3
|
+
|
|
4
|
+
export const TEXT_UNDERLINE_VARIANTS = {
|
|
5
|
+
DIVIDER: {
|
|
6
|
+
closed: () => ({
|
|
7
|
+
x: '0%',
|
|
8
|
+
width: '0%',
|
|
9
|
+
translateY: '-10px',
|
|
10
|
+
backgroundColor: 'transparent',
|
|
11
|
+
}),
|
|
12
|
+
open: () => ({
|
|
13
|
+
x: '0%',
|
|
14
|
+
backgroundColor: COLORS[50],
|
|
15
|
+
width: '100%',
|
|
16
|
+
transition: {
|
|
17
|
+
damping: 10,
|
|
18
|
+
stiffness: 100,
|
|
19
|
+
duration: 0.5,
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
},
|
|
23
|
+
} as MotionProps['variants'];
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/react';
|
|
2
|
+
|
|
3
|
+
import userEvent from '@testing-library/user-event';
|
|
4
|
+
import { describe, expect, it } from 'vitest';
|
|
5
|
+
import AnimatedButton from './AnimatedButton';
|
|
6
|
+
|
|
7
|
+
describe('AnimatedButton Component', () => {
|
|
8
|
+
it('텍스트가 하나의 텍스트 "button"만 있다.', () => {
|
|
9
|
+
render(<AnimatedButton>button</AnimatedButton>);
|
|
10
|
+
|
|
11
|
+
const buttonElement = screen.getByRole('button', { name: /button/i });
|
|
12
|
+
|
|
13
|
+
expect(buttonElement).toBeInTheDocument();
|
|
14
|
+
expect(buttonElement).toHaveTextContent('button');
|
|
15
|
+
});
|
|
16
|
+
it('텍스트가 디폴트 텍스트 "button"와 "other child"가 있다.', () => {
|
|
17
|
+
render(<AnimatedButton otherChild={'other child'}>button</AnimatedButton>);
|
|
18
|
+
|
|
19
|
+
const buttonElement = screen.getByRole('button', { name: /button/i });
|
|
20
|
+
|
|
21
|
+
expect(buttonElement).toBeInTheDocument();
|
|
22
|
+
expect(buttonElement).toHaveTextContent('button');
|
|
23
|
+
expect(buttonElement).toHaveTextContent('other child');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('버튼에 마우스를 올리면 otherChild와 original text가 translateY(2rem)로 이동한다.', async () => {
|
|
27
|
+
render(<AnimatedButton otherChild="other child">original text</AnimatedButton>);
|
|
28
|
+
|
|
29
|
+
const buttonElement = screen.getByRole('button');
|
|
30
|
+
|
|
31
|
+
// 버튼 호버 시
|
|
32
|
+
await userEvent.hover(buttonElement);
|
|
33
|
+
|
|
34
|
+
const hoveredOriginalText = screen.getByText(/original text/i);
|
|
35
|
+
const hoveredChildText = screen.getByText(/original text/i);
|
|
36
|
+
|
|
37
|
+
expect(getComputedStyle(hoveredOriginalText).transform).toContain('translateY(2rem)');
|
|
38
|
+
expect(getComputedStyle(hoveredChildText).transform).toContain('translateY(2rem)');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('disabled={true} 설정 시 비활성화된다.', () => {
|
|
42
|
+
render(<AnimatedButton disabled={true}>button</AnimatedButton>);
|
|
43
|
+
|
|
44
|
+
const buttonElement = screen.getByRole('button', { name: /button/i });
|
|
45
|
+
|
|
46
|
+
expect(buttonElement).toBeInTheDocument();
|
|
47
|
+
expect(buttonElement).toBeDisabled();
|
|
48
|
+
});
|
|
49
|
+
it('withBorder={true} 설정 시 버튼 테두리 스타일이 적용되어scss module이므로 className에 `with-border`가 포함된다.', () => {
|
|
50
|
+
render(<AnimatedButton withBorder={true}>button</AnimatedButton>);
|
|
51
|
+
|
|
52
|
+
const buttonElement = screen.getByRole('button', { name: /button/i });
|
|
53
|
+
|
|
54
|
+
expect(buttonElement).toBeInTheDocument();
|
|
55
|
+
expect(buttonElement.className).toMatch(/with-border/);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// ! 🤔 버튼 길이를 제한해야할듯, 텍스트가 너무 많으면 가독성도 안좋아지고 애니메이션도 깨진다. 어떻게 제한할까?
|
|
59
|
+
// it('버튼이 긴 텍스트를 포함하고, 잘리지 않고, 크기가 조정된다.', () => {
|
|
60
|
+
// const longText = 'Super long button text. max max max'.repeat(3); // 105자
|
|
61
|
+
|
|
62
|
+
// render(<AnimatedButton>{longText}</AnimatedButton>);
|
|
63
|
+
|
|
64
|
+
// const button = screen.getByRole('button');
|
|
65
|
+
|
|
66
|
+
// // ✅ Ensure button contains full text
|
|
67
|
+
// expect(button).toHaveTextContent(longText);
|
|
68
|
+
|
|
69
|
+
// // ✅ Ensure button width expands (adjust 200px based on your design)
|
|
70
|
+
// // expect(button.scrollWidth).toBeGreaterThan(200);
|
|
71
|
+
|
|
72
|
+
// // ✅ Ensure text is not truncated (checks if scrollWidth > clientWidth)
|
|
73
|
+
// // expect(button.scrollWidth).toBeGreaterThan(button.clientWidth);
|
|
74
|
+
|
|
75
|
+
// expect(getComputedStyle(button).width).not.toBe('0px');
|
|
76
|
+
|
|
77
|
+
// console.log(button.scrollWidth);
|
|
78
|
+
|
|
79
|
+
// expect(button.textContent?.length).toBeGreaterThan(10);
|
|
80
|
+
|
|
81
|
+
// // ✅ Optional: Ensure button text is under a reasonable limit (e.g., 30 chars)
|
|
82
|
+
// expect(longText.length).toBeLessThanOrEqual(105);
|
|
83
|
+
// });
|
|
84
|
+
});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import { classNames, Motion } from '../../../shared/wrappers';
|
|
5
|
+
import Text from '../../Text';
|
|
6
|
+
import TripieContainer from '../../TripieContainer/TripieContainer';
|
|
7
|
+
import Style from './animated-button.module.scss';
|
|
8
|
+
|
|
9
|
+
const cx = classNames.bind(Style);
|
|
10
|
+
|
|
11
|
+
const AnimatedButton = ({
|
|
12
|
+
children,
|
|
13
|
+
className,
|
|
14
|
+
disabled = false,
|
|
15
|
+
type = 'button',
|
|
16
|
+
otherChild = children,
|
|
17
|
+
withBorder = false,
|
|
18
|
+
onClick,
|
|
19
|
+
animate = 'rest',
|
|
20
|
+
withMinWidth = false,
|
|
21
|
+
selected=false
|
|
22
|
+
}: Readonly<{
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
otherChild?: ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
withBorder?: boolean;
|
|
28
|
+
type?: 'submit' | 'reset' | 'button';
|
|
29
|
+
onClick?: () => void;
|
|
30
|
+
animate?: 'rest' | 'hover';
|
|
31
|
+
withMinWidth?: boolean;
|
|
32
|
+
selected?:boolean;
|
|
33
|
+
}>) => {
|
|
34
|
+
return (
|
|
35
|
+
<Motion.Button
|
|
36
|
+
disabled={disabled}
|
|
37
|
+
onTap={onClick}
|
|
38
|
+
type={type}
|
|
39
|
+
className={cx('button', withBorder && 'with-border', withMinWidth && 'min',className,selected?'selected':'')}
|
|
40
|
+
initial="rest"
|
|
41
|
+
whileHover={disabled ? 'rest' : 'hover'}
|
|
42
|
+
whileTap={disabled ? 'rest' : 'hover'}
|
|
43
|
+
animate={animate}
|
|
44
|
+
>
|
|
45
|
+
<Text.Flick>{children}</Text.Flick>
|
|
46
|
+
<span className={cx('gap')}>{' '}</span>
|
|
47
|
+
<Text.Flick className={cx('hovered')}>{otherChild}</Text.Flick>
|
|
48
|
+
</Motion.Button>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const AnimatedText = ({
|
|
53
|
+
children,
|
|
54
|
+
className,
|
|
55
|
+
disabled = false,
|
|
56
|
+
otherChild = children,
|
|
57
|
+
withBorder = false,
|
|
58
|
+
|
|
59
|
+
animate = 'rest',
|
|
60
|
+
withMinWidth = false,
|
|
61
|
+
}: Readonly<{
|
|
62
|
+
children: ReactNode;
|
|
63
|
+
disabled?: boolean;
|
|
64
|
+
otherChild?: ReactNode;
|
|
65
|
+
className?: string;
|
|
66
|
+
withBorder?: boolean;
|
|
67
|
+
|
|
68
|
+
animate?: 'rest' | 'hover';
|
|
69
|
+
withMinWidth?: boolean;
|
|
70
|
+
}>) => {
|
|
71
|
+
return (
|
|
72
|
+
<Motion.Div
|
|
73
|
+
className={cx('button', withBorder && 'with-border', withMinWidth && 'min', className)}
|
|
74
|
+
initial="rest"
|
|
75
|
+
whileHover={disabled ? 'rest' : 'hover'}
|
|
76
|
+
whileTap={disabled ? 'rest' : 'hover'}
|
|
77
|
+
animate={animate}
|
|
78
|
+
>
|
|
79
|
+
<Text.Flick>{children}</Text.Flick>
|
|
80
|
+
<TripieContainer applyMargin="top"> </TripieContainer>
|
|
81
|
+
<Text.Flick className={cx('hovered')}>{otherChild}</Text.Flick>
|
|
82
|
+
</Motion.Div>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
AnimatedButton.Text = AnimatedText;
|
|
87
|
+
|
|
88
|
+
export default AnimatedButton;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@use '../../../variables' as *;
|
|
2
|
+
@use '../../../mixins' as *;
|
|
3
|
+
|
|
4
|
+
.selected {
|
|
5
|
+
background-color: $theme-100 !important;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.hovered {
|
|
9
|
+
position: relative;
|
|
10
|
+
z-index: 30;
|
|
11
|
+
color: $theme-50;
|
|
12
|
+
}
|
|
13
|
+
.gap {
|
|
14
|
+
display: inline-block;
|
|
15
|
+
padding: 0.2rem;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.button {
|
|
19
|
+
height: 3rem;
|
|
20
|
+
overflow-y: hidden;
|
|
21
|
+
color: inherit;
|
|
22
|
+
align-content: center;
|
|
23
|
+
align-items: center;
|
|
24
|
+
display: inline-flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
flex-wrap: nowrap;
|
|
27
|
+
gap: 1.2rem;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
position: relative;
|
|
30
|
+
text-decoration: none;
|
|
31
|
+
width: fit-content;
|
|
32
|
+
min-width: 4rem;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
background: none;
|
|
35
|
+
border: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.with-border {
|
|
39
|
+
min-width: 9rem;
|
|
40
|
+
@include with-border;
|
|
41
|
+
}
|
|
42
|
+
.button:disabled {
|
|
43
|
+
cursor: not-allowed;
|
|
44
|
+
color: $theme-300;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// 다음으로 넘어가기 버튼에 커서를 올리는 애니메이션 버튼 스타일
|
|
48
|
+
|
|
49
|
+
.next-button-wrap {
|
|
50
|
+
width: 100%;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.submit-button {
|
|
54
|
+
width: 100%;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.all-info-cursor {
|
|
58
|
+
position: 'fixed';
|
|
59
|
+
right: 2rem;
|
|
60
|
+
float: right;
|
|
61
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import AnimatedButton from '.';
|
|
5
|
+
import { useAppTheme } from '../../../hooks';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof AnimatedButton> = {
|
|
8
|
+
title: 'tripie-ui/Button/Animated',
|
|
9
|
+
component: AnimatedButton,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: {},
|
|
12
|
+
decorators: [
|
|
13
|
+
(story, context) => {
|
|
14
|
+
const { mode, setMode } = useAppTheme();
|
|
15
|
+
const selectedTheme = context.globals.theme || mode;
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
setMode(selectedTheme);
|
|
19
|
+
}, [selectedTheme]);
|
|
20
|
+
|
|
21
|
+
return <div className={`${context.globals.theme}`}>{story()}</div>;
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default meta;
|
|
27
|
+
type Story = StoryObj<typeof meta>;
|
|
28
|
+
|
|
29
|
+
export const Default: Story = {
|
|
30
|
+
name: 'AnimatedButton.Default',
|
|
31
|
+
args: {
|
|
32
|
+
children: 'Default',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const AnimatedButtonWithOtherChild: Story = {
|
|
37
|
+
name: 'AnimatedButton.WithOtherChild',
|
|
38
|
+
args: {
|
|
39
|
+
children: 'Default',
|
|
40
|
+
otherChild: 'Other child',
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const AnimatedButtonWithBorder: Story = {
|
|
45
|
+
name: 'AnimatedButton.WithBorder',
|
|
46
|
+
args: {
|
|
47
|
+
children: 'AnimatedButton.WithBorder',
|
|
48
|
+
withBorder: true,
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const AnimatedButtonWithBorderWithLongText: Story = {
|
|
53
|
+
name: 'AnimatedButton.WithBorder.LongText',
|
|
54
|
+
args: {
|
|
55
|
+
children: 'super long button text. see how it looks like!',
|
|
56
|
+
withBorder: true,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const longText = 'Super long button text. max max max max max'.repeat(3);
|
|
61
|
+
|
|
62
|
+
export const AnimatedButtonWithBorderWithSuperLongText: Story = {
|
|
63
|
+
name: 'AnimatedButton.WithBorder.Super.LongText',
|
|
64
|
+
args: {
|
|
65
|
+
children: longText,
|
|
66
|
+
withBorder: true,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
import { classNames, Motion } from '../../../../shared/wrappers';
|
|
6
|
+
import Style from './menu-item.module.scss';
|
|
7
|
+
import { MENU_ITEM_VARIANT } from './variants';
|
|
8
|
+
|
|
9
|
+
const cx = classNames.bind(Style);
|
|
10
|
+
|
|
11
|
+
const MenuItem = ({
|
|
12
|
+
children,
|
|
13
|
+
}: Readonly<{
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}>) => {
|
|
16
|
+
return (
|
|
17
|
+
<Motion.Li
|
|
18
|
+
className={cx('menu-item')}
|
|
19
|
+
variants={MENU_ITEM_VARIANT}
|
|
20
|
+
whileHover={{ scale: 1.1 }}
|
|
21
|
+
whileTap={{ scale: 0.95 }}
|
|
22
|
+
>
|
|
23
|
+
{children}
|
|
24
|
+
</Motion.Li>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default MenuItem;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import MenuItem from '.';
|
|
5
|
+
import { useAppTheme } from '../../../../hooks';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof MenuItem> = {
|
|
8
|
+
title: 'tripie-ui/Button/Menu/Item',
|
|
9
|
+
component: MenuItem,
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
argTypes: {},
|
|
12
|
+
parameters: {
|
|
13
|
+
docs: {
|
|
14
|
+
description: {
|
|
15
|
+
component:
|
|
16
|
+
'네비게이션 토글 버튼이 열린 상태에서 보이는 메뉴 리스트의 아이템 컴포넌트. 호버 시 확대 애니메이션이 동작합니다.',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
decorators: [
|
|
21
|
+
(story, context) => {
|
|
22
|
+
const { mode, setMode } = useAppTheme();
|
|
23
|
+
const selectedTheme = context.globals.theme || mode;
|
|
24
|
+
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
setMode(selectedTheme);
|
|
27
|
+
}, [selectedTheme]);
|
|
28
|
+
|
|
29
|
+
return <div className={`${context.globals.theme}`}>{story()}</div>;
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default meta;
|
|
35
|
+
type Story = StoryObj<typeof meta>;
|
|
36
|
+
|
|
37
|
+
export const Default: Story = {
|
|
38
|
+
name: 'Default',
|
|
39
|
+
render: () => {
|
|
40
|
+
return <MenuItem>아이템1</MenuItem>;
|
|
41
|
+
},
|
|
42
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MotionProps } from '../../../../shared/wrappers/motion-wrapper';
|
|
2
|
+
|
|
3
|
+
export const MENU_ITEM_VARIANT = {
|
|
4
|
+
open: {
|
|
5
|
+
y: 0,
|
|
6
|
+
opacity: 1,
|
|
7
|
+
transition: {
|
|
8
|
+
y: { stiffness: 1000, velocity: -100 },
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
closed: {
|
|
12
|
+
y: 50,
|
|
13
|
+
opacity: 0,
|
|
14
|
+
transition: {
|
|
15
|
+
y: { stiffness: 1000 },
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
} as MotionProps['variants'];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { classNames, Motion } from '../../../../shared/wrappers';
|
|
4
|
+
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
|
|
7
|
+
import Style from './menu-list.module.scss';
|
|
8
|
+
import { NAVIGATION_VARIANT } from './variants';
|
|
9
|
+
|
|
10
|
+
const cx = classNames.bind(Style);
|
|
11
|
+
|
|
12
|
+
const MenuList = ({ children }: { children: ReactNode }) => {
|
|
13
|
+
return (
|
|
14
|
+
<Motion.Ul className={cx('navigation')} variants={NAVIGATION_VARIANT}>
|
|
15
|
+
{children}
|
|
16
|
+
</Motion.Ul>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default MenuList;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@use '../../../../variables' as *;
|
|
2
|
+
@use '../../../../mixins' as *;
|
|
3
|
+
|
|
4
|
+
.navigation {
|
|
5
|
+
border-bottom-width: 1px;
|
|
6
|
+
border-color: $theme-400;
|
|
7
|
+
border-left-width: 1px;
|
|
8
|
+
border-right-width: 1px;
|
|
9
|
+
border-style: solid;
|
|
10
|
+
border-top-width: 1px;
|
|
11
|
+
backdrop-filter: blur(10px);
|
|
12
|
+
border-radius: 10px;
|
|
13
|
+
transform-origin: 50% 50% 0px;
|
|
14
|
+
will-change: auto;
|
|
15
|
+
padding: 0;
|
|
16
|
+
position: fixed;
|
|
17
|
+
top: 3px;
|
|
18
|
+
width: 12rem;
|
|
19
|
+
height: fit-content;
|
|
20
|
+
right: 5rem;
|
|
21
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import MenuList from '.';
|
|
5
|
+
import { useAppTheme } from '../../../../hooks';
|
|
6
|
+
import MenuItem from '../MenuItem';
|
|
7
|
+
|
|
8
|
+
const meta: Meta<typeof MenuList> = {
|
|
9
|
+
title: 'tripie-ui/Button/Menu/List',
|
|
10
|
+
component: MenuList,
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
argTypes: {},
|
|
13
|
+
parameters: {
|
|
14
|
+
docs: {
|
|
15
|
+
description: {
|
|
16
|
+
component:
|
|
17
|
+
'네비게이션 토글 버튼이 열린 상태에서 보이는 메뉴 리스트 컴포넌트. 여닫을 때 리스트 아이템들이 하나씩 stagger되는 애니메이션이 동작합니다. 다른 ui 위에 리스트가 올라가면 블러 효과가 있습니다.',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
decorators: [
|
|
22
|
+
(story, context) => {
|
|
23
|
+
const { mode, setMode } = useAppTheme();
|
|
24
|
+
const selectedTheme = context.globals.theme || mode;
|
|
25
|
+
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
setMode(selectedTheme);
|
|
28
|
+
}, [selectedTheme]);
|
|
29
|
+
|
|
30
|
+
return <div className={`${context.globals.theme}`}>{story()}</div>;
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default meta;
|
|
36
|
+
type Story = StoryObj<typeof meta>;
|
|
37
|
+
|
|
38
|
+
export const Default: Story = {
|
|
39
|
+
name: 'Default',
|
|
40
|
+
render: () => {
|
|
41
|
+
return (
|
|
42
|
+
<div style={{ height: '12rem' }}>
|
|
43
|
+
<MenuList>
|
|
44
|
+
{Array.from({ length: 3 }, (_, i) => (
|
|
45
|
+
<MenuItem key={i}>아이템 {i + 1}</MenuItem>
|
|
46
|
+
))}
|
|
47
|
+
</MenuList>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
},
|
|
51
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MotionProps } from '../../../../shared/wrappers/motion-wrapper';
|
|
2
|
+
|
|
3
|
+
export const NAVIGATION_VARIANT = {
|
|
4
|
+
open: {
|
|
5
|
+
opacity: 1,
|
|
6
|
+
display: 'inline-block',
|
|
7
|
+
transition: { staggerChildren: 0.07, delayChildren: 0.2 },
|
|
8
|
+
},
|
|
9
|
+
closed: {
|
|
10
|
+
opacity: 0,
|
|
11
|
+
display: 'none',
|
|
12
|
+
transition: { staggerChildren: 0.05, staggerDirection: -1 },
|
|
13
|
+
},
|
|
14
|
+
} as MotionProps['variants'];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { classNames, Motion, MotionProps } from '../../../shared/wrappers';
|
|
2
|
+
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
import { useCycle } from '../../../hooks/useCycle';
|
|
5
|
+
import COLORS from '../../../shared/colors';
|
|
6
|
+
|
|
7
|
+
import TripieContainer from '../../TripieContainer/TripieContainer';
|
|
8
|
+
import NoStyleButton from '../NoStyle/NoStyleButton';
|
|
9
|
+
import Style from './menu-toggle.module.scss';
|
|
10
|
+
import MenuItem from './MenuItem';
|
|
11
|
+
import MenuList from './MenuList';
|
|
12
|
+
|
|
13
|
+
const cx = classNames.bind(Style);
|
|
14
|
+
|
|
15
|
+
export const Path = (props: MotionProps['svgProps']) => (
|
|
16
|
+
<Motion.Path fill="transparent" strokeWidth="1" stroke={COLORS[0]} strokeLinecap="round" {...props} />
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const ToggleButton = ({ toggle }: { toggle: () => void }) => (
|
|
20
|
+
<NoStyleButton action={() => toggle()} className={cx('menu-toggle')}>
|
|
21
|
+
<svg width="24" height="24" viewBox="0 0 24 24" className={cx('svg')}>
|
|
22
|
+
<Path
|
|
23
|
+
variants={{
|
|
24
|
+
closed: { d: 'M 2 2.5 L 20 2.5' },
|
|
25
|
+
open: { d: 'M 3 16.5 L 17 2.5' },
|
|
26
|
+
}}
|
|
27
|
+
/>
|
|
28
|
+
<Path
|
|
29
|
+
d="M 2 9.423 L 20 9.423"
|
|
30
|
+
variants={{
|
|
31
|
+
closed: { opacity: 1 },
|
|
32
|
+
open: { opacity: 0 },
|
|
33
|
+
}}
|
|
34
|
+
transition={{ duration: 0.1 }}
|
|
35
|
+
/>
|
|
36
|
+
<Path
|
|
37
|
+
variants={{
|
|
38
|
+
closed: { d: 'M 2 16.346 L 20 16.346' },
|
|
39
|
+
open: { d: 'M 3 2.5 L 17 16.346' },
|
|
40
|
+
}}
|
|
41
|
+
/>
|
|
42
|
+
</svg>
|
|
43
|
+
</NoStyleButton>
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const MenuToggle = ({
|
|
47
|
+
className,
|
|
48
|
+
children = '',
|
|
49
|
+
initial = false,
|
|
50
|
+
}: {
|
|
51
|
+
children?: ReactNode;
|
|
52
|
+
initial?: boolean;
|
|
53
|
+
className?: string;
|
|
54
|
+
}) => {
|
|
55
|
+
const [isOpen, toggleOpen] = useCycle(initial, true);
|
|
56
|
+
return (
|
|
57
|
+
<Motion.Nav className={cx('nav', className)} initial={initial} animate={isOpen ? 'open' : 'closed'}>
|
|
58
|
+
<TripieContainer margin="none">{children}</TripieContainer>
|
|
59
|
+
<ToggleButton toggle={toggleOpen} />
|
|
60
|
+
</Motion.Nav>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
MenuToggle.Item = MenuItem;
|
|
65
|
+
MenuToggle.List = MenuList;
|
|
66
|
+
|
|
67
|
+
export default MenuToggle;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
@use '../../../variables' as *;
|
|
2
|
+
|
|
3
|
+
.nav {
|
|
4
|
+
align-items: center;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
flex-wrap: nowrap;
|
|
8
|
+
gap: 10px;
|
|
9
|
+
height: 80px;
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
overflow: visible;
|
|
12
|
+
padding: 0 15px;
|
|
13
|
+
position: fixed;
|
|
14
|
+
top: 0;
|
|
15
|
+
left: 0;
|
|
16
|
+
right: 0;
|
|
17
|
+
z-index: 40;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.menu-toggle {
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
border-bottom-width: 1px;
|
|
23
|
+
border-color: $theme-400;
|
|
24
|
+
border-left-width: 1px;
|
|
25
|
+
border-right-width: 1px;
|
|
26
|
+
border-style: solid;
|
|
27
|
+
border-top-width: 1px;
|
|
28
|
+
backdrop-filter: blur(10px);
|
|
29
|
+
border-radius: 50%;
|
|
30
|
+
transform: none;
|
|
31
|
+
transform-origin: 50% 50% 100px;
|
|
32
|
+
will-change: auto;
|
|
33
|
+
background: none;
|
|
34
|
+
width: 40px;
|
|
35
|
+
height: 40px;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.svg {
|
|
41
|
+
transform: translate(1.5px, 3px);
|
|
42
|
+
}
|