@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,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ACCORDIAN_VARIANTS = void 0;
|
|
4
|
+
var colors_1 = require("../../shared/colors");
|
|
5
|
+
exports.ACCORDIAN_VARIANTS = {
|
|
6
|
+
DETAILS: {
|
|
7
|
+
closed: function () { return ({
|
|
8
|
+
height: '0%',
|
|
9
|
+
opacity: 0,
|
|
10
|
+
display: 'none',
|
|
11
|
+
}); },
|
|
12
|
+
open: function () { return ({
|
|
13
|
+
transform: {
|
|
14
|
+
height: '100%',
|
|
15
|
+
},
|
|
16
|
+
transition: {
|
|
17
|
+
duration: 2,
|
|
18
|
+
bounce: 0,
|
|
19
|
+
damping: 2,
|
|
20
|
+
stiffness: 10,
|
|
21
|
+
},
|
|
22
|
+
}); },
|
|
23
|
+
},
|
|
24
|
+
BUTTON: {
|
|
25
|
+
closed: function () { return ({}); },
|
|
26
|
+
open: function () { return ({
|
|
27
|
+
rotate: '45deg',
|
|
28
|
+
transition: {
|
|
29
|
+
duration: 0.5,
|
|
30
|
+
bounce: 0,
|
|
31
|
+
},
|
|
32
|
+
}); },
|
|
33
|
+
},
|
|
34
|
+
DIVIDER: {
|
|
35
|
+
closed: function () { return ({
|
|
36
|
+
backgroundColor: colors_1.default[400],
|
|
37
|
+
}); },
|
|
38
|
+
open: function () { return ({
|
|
39
|
+
backgroundColor: colors_1.default[50],
|
|
40
|
+
transition: {
|
|
41
|
+
duration: 0.5,
|
|
42
|
+
bounce: 0,
|
|
43
|
+
},
|
|
44
|
+
}); },
|
|
45
|
+
},
|
|
46
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
var bind_1 = require("classnames/bind");
|
|
5
|
+
var react_1 = require("react");
|
|
6
|
+
var react_intersection_observer_1 = require("react-intersection-observer");
|
|
7
|
+
var NoStyleButton_1 = require("../TripieButton/NoStyle/NoStyleButton");
|
|
8
|
+
var TripieContainer_1 = require("../TripieContainer/TripieContainer");
|
|
9
|
+
var Icon_1 = require("../TripieIcon/Icon");
|
|
10
|
+
var carousel_module_scss_1 = require("./carousel.module.scss");
|
|
11
|
+
var cx = bind_1.default.bind(carousel_module_scss_1.default);
|
|
12
|
+
var Carousel = function (_a) {
|
|
13
|
+
var items = _a.items, className = _a.className;
|
|
14
|
+
var _b = (0, react_1.useState)(0), focusedIndex = _b[0], setFocusedIndex = _b[1];
|
|
15
|
+
var ref = (0, react_1.useRef)(null);
|
|
16
|
+
var handleScrollButton = (0, react_1.useCallback)(function (direction) {
|
|
17
|
+
var _a, _b, _c;
|
|
18
|
+
var next = focusedIndex;
|
|
19
|
+
setFocusedIndex(function (prevIndex) {
|
|
20
|
+
if (direction === 'prev') {
|
|
21
|
+
next = prevIndex != 0 ? prevIndex - 1 : 0;
|
|
22
|
+
return next;
|
|
23
|
+
}
|
|
24
|
+
if (direction === 'next') {
|
|
25
|
+
next = prevIndex != items.length - 1 ? prevIndex + 1 : items.length - 1;
|
|
26
|
+
return next;
|
|
27
|
+
}
|
|
28
|
+
return prevIndex;
|
|
29
|
+
});
|
|
30
|
+
if (((_b = (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.children) === null || _b === void 0 ? void 0 : _b[next]) != null) {
|
|
31
|
+
(_c = ref.current.children) === null || _c === void 0 ? void 0 : _c[next].scrollIntoView({ behavior: 'smooth', block: 'nearest' });
|
|
32
|
+
}
|
|
33
|
+
}, [ref, focusedIndex]);
|
|
34
|
+
return (<TripieContainer_1.default margin="none" className={cx('carousel')}>
|
|
35
|
+
{items.length > 1 && focusedIndex != 0 ? (<NoStyleButton_1.default name="previous" action={function () { return handleScrollButton('prev'); }}>
|
|
36
|
+
<Icon_1.default.Scroll className={cx('scroll-icon', 'next-icon')} next={false}/>
|
|
37
|
+
</NoStyleButton_1.default>) : null}
|
|
38
|
+
<TripieContainer_1.default margin="none" className={cx('flex-items', 'carousel-inner')}>
|
|
39
|
+
<TripieContainer_1.default margin="none" className={cx('insta-like-carousel-container', className)} refs={ref}>
|
|
40
|
+
{items.map(function (item, index) { return (<CarouselItem key={"carousel-item-".concat(item === null || item === void 0 ? void 0 : item.key)} index={index} setFocusedIndex={setFocusedIndex} focusedIndex={focusedIndex}>
|
|
41
|
+
{item}
|
|
42
|
+
</CarouselItem>); })}
|
|
43
|
+
</TripieContainer_1.default>
|
|
44
|
+
</TripieContainer_1.default>
|
|
45
|
+
{items.length > 1 && focusedIndex != items.length - 1 ? (<NoStyleButton_1.default name="next" action={function () { return handleScrollButton('next'); }}>
|
|
46
|
+
<Icon_1.default.Scroll className={cx('scroll-icon', 'prev-icon')}/>
|
|
47
|
+
</NoStyleButton_1.default>) : null}
|
|
48
|
+
</TripieContainer_1.default>);
|
|
49
|
+
};
|
|
50
|
+
var CarouselItem = function (_a) {
|
|
51
|
+
var children = _a.children, className = _a.className, index = _a.index, setFocusedIndex = _a.setFocusedIndex, focusedIndex = _a.focusedIndex, _b = _a.threshold, threshold = _b === void 0 ? 0.6 : _b;
|
|
52
|
+
var _c = (0, react_intersection_observer_1.useInView)({
|
|
53
|
+
threshold: threshold, // 60% 보여야 동작
|
|
54
|
+
triggerOnce: false, // 가시성 체크
|
|
55
|
+
}), ref = _c.ref, inView = _c.inView;
|
|
56
|
+
// 보이면 스크롤한 인덱스로 이동
|
|
57
|
+
(0, react_1.useEffect)(function () {
|
|
58
|
+
if (inView && index != focusedIndex) {
|
|
59
|
+
setFocusedIndex(index);
|
|
60
|
+
}
|
|
61
|
+
}, [inView, focusedIndex]);
|
|
62
|
+
// 버튼 클릭으로 보이지 않는 경우 인접한 캐로솔로 인덱스 포커스
|
|
63
|
+
(0, react_1.useEffect)(function () {
|
|
64
|
+
if (!inView && index != focusedIndex) {
|
|
65
|
+
setFocusedIndex(focusedIndex);
|
|
66
|
+
}
|
|
67
|
+
}, [inView, focusedIndex]);
|
|
68
|
+
return (<TripieContainer_1.default margin="none" refs={ref} className={cx('insta-like-carousel-item', focusedIndex == index ? 'focused' : '', className)}>
|
|
69
|
+
{children}
|
|
70
|
+
</TripieContainer_1.default>);
|
|
71
|
+
};
|
|
72
|
+
// 좌표를 클릭하는 등 외부의 조작으로 carousel 포커싱이 결정되어 스타일만 carousel 형태
|
|
73
|
+
var ControlledCarousel = function (_a) {
|
|
74
|
+
var children = _a.children, className = _a.className;
|
|
75
|
+
return (<TripieContainer_1.default margin="none" className={cx('carousel')}>
|
|
76
|
+
<TripieContainer_1.default margin="none" className={cx('flex-items', 'carousel-inner')}>
|
|
77
|
+
<TripieContainer_1.default margin="none" className={cx('insta-like-carousel-container', className)}>
|
|
78
|
+
{children}
|
|
79
|
+
</TripieContainer_1.default>
|
|
80
|
+
</TripieContainer_1.default>
|
|
81
|
+
</TripieContainer_1.default>);
|
|
82
|
+
};
|
|
83
|
+
Carousel.Controlled = ControlledCarousel;
|
|
84
|
+
exports.default = Carousel;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var react_1 = require("@testing-library/react");
|
|
40
|
+
var react_intersection_observer_1 = require("react-intersection-observer");
|
|
41
|
+
var vitest_1 = require("vitest");
|
|
42
|
+
var TripieImage_1 = require("../TripieImage/TripieImage");
|
|
43
|
+
var Carousel_1 = require("./Carousel");
|
|
44
|
+
var images_1 = require("./images");
|
|
45
|
+
// https://vitest.dev/guide/mocking#globals
|
|
46
|
+
var IntersectionObserverMock = vitest_1.vi.fn(function () { return ({
|
|
47
|
+
disconnect: vitest_1.vi.fn(),
|
|
48
|
+
observe: vitest_1.vi.fn(),
|
|
49
|
+
takeRecords: vitest_1.vi.fn(),
|
|
50
|
+
unobserve: vitest_1.vi.fn(),
|
|
51
|
+
}); });
|
|
52
|
+
vitest_1.vi.stubGlobal('IntersectionObserver', IntersectionObserverMock);
|
|
53
|
+
vitest_1.vi.mock('react-intersection-observer', function () { return ({
|
|
54
|
+
useInView: vitest_1.vi.fn(function () { return ({
|
|
55
|
+
ref: vitest_1.vi.fn(), // Mock function
|
|
56
|
+
inView: false, // Start as false
|
|
57
|
+
}); }),
|
|
58
|
+
}); });
|
|
59
|
+
// Mock `scrollIntoView` since JSDOM doesn’t have it
|
|
60
|
+
Element.prototype.scrollIntoView = vitest_1.vi.fn();
|
|
61
|
+
// vi.spyOn(window.HTMLElement.prototype, 'scrollIntoView').mockImplementation(() => {});
|
|
62
|
+
react_intersection_observer_1.useInView.mockImplementation(function (_a) {
|
|
63
|
+
var threshold = _a.threshold;
|
|
64
|
+
return {
|
|
65
|
+
ref: vitest_1.vi.fn(),
|
|
66
|
+
inView: threshold === 0.6,
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
(0, vitest_1.describe)('Carousel Component', function () {
|
|
70
|
+
(0, vitest_1.it)('1. 캐로솔 이미지가 1개인 경우 다음/이전 버튼이 보이지 않는다.', function () {
|
|
71
|
+
(0, react_1.render)(<Carousel_1.default items={images_1.default.slice(0, 1).map(function (item, index) { return (<TripieImage_1.default.WithSourceUrl sizes="large" key={item.src + index} alt={item.alt} src={item.src} sourceUrl={item.sourceUrl} blurDataURL={item.blurDataURL}/>); })}/>);
|
|
72
|
+
var carouselElement = react_1.screen.getByAltText(images_1.default[0].alt);
|
|
73
|
+
(0, vitest_1.expect)(carouselElement).toBeInTheDocument();
|
|
74
|
+
var nextButton = react_1.screen.queryByRole('button', { name: /next/i });
|
|
75
|
+
var prevButton = react_1.screen.queryByRole('button', { name: /previous/i });
|
|
76
|
+
(0, vitest_1.expect)(nextButton).not.toBeInTheDocument();
|
|
77
|
+
(0, vitest_1.expect)(prevButton).not.toBeInTheDocument();
|
|
78
|
+
});
|
|
79
|
+
(0, vitest_1.it)('2. 캐로솔 이미지가 여려 개인 경우, 하나의 이미지만 focus된다.', function () {
|
|
80
|
+
var container = (0, react_1.render)(<Carousel_1.default items={images_1.default.map(function (item, index) { return (<TripieImage_1.default.WithSourceUrl sizes="large" key={item.src + index} alt={item.alt} src={item.src} sourceUrl={item.sourceUrl} blurDataURL={item.blurDataURL}/>); })}/>).container;
|
|
81
|
+
var carouselItemElements = Array.from(container.querySelectorAll('*')).filter(function (el) {
|
|
82
|
+
return el.className.match(/carousel-item/);
|
|
83
|
+
});
|
|
84
|
+
var focusedElement = carouselItemElements.filter(function (el) { return el.className.match(/focused/); });
|
|
85
|
+
(0, vitest_1.expect)(focusedElement.length).toEqual(1);
|
|
86
|
+
});
|
|
87
|
+
(0, vitest_1.it)('3. 캐로솔 아이템이 2개인 경우, 다음 버튼을 클릭하면 두번째 아이템에 focus되고 이전 버튼이 생기고, 다음 버튼이 사라진다.', function () {
|
|
88
|
+
var container = (0, react_1.render)(<Carousel_1.default items={images_1.default.slice(0, 2).map(function (item, index) { return (<TripieImage_1.default.WithSourceUrl sizes="large" key={item.src + index} alt={item.alt} src={item.src} sourceUrl={item.sourceUrl} blurDataURL={item.blurDataURL}/>); })}/>).container;
|
|
89
|
+
(0, vitest_1.expect)(container).toBeInTheDocument();
|
|
90
|
+
var buttonElements = container.querySelectorAll('button');
|
|
91
|
+
var carouselItemElements = Array.from(container.querySelectorAll('*')).filter(function (el) {
|
|
92
|
+
return el.className.match(/carousel-item/);
|
|
93
|
+
});
|
|
94
|
+
(0, vitest_1.expect)(carouselItemElements.length).toEqual(2);
|
|
95
|
+
var focusedElement = carouselItemElements.findIndex(function (el) { return el.className.match(/focused/); });
|
|
96
|
+
(0, vitest_1.expect)(focusedElement).toEqual(0);
|
|
97
|
+
(0, vitest_1.expect)(buttonElements.length).toEqual(1); // 버튼이 하나만 있고,
|
|
98
|
+
(0, vitest_1.expect)(buttonElements[0].name).toEqual('next'); // 해당 버튼이 다음 버튼
|
|
99
|
+
(0, vitest_1.expect)(buttonElements[0].name).not.toEqual('previous'); // 해당 버튼이 다음 버튼
|
|
100
|
+
});
|
|
101
|
+
(0, vitest_1.it)('4. 3개의 이미지 캐로솔에서 다음버튼을 두 번 누르면 이미지 1->2->3으로, 이전 버튼을 1번 누르면 3->2로 focus된다.', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
102
|
+
var container, scrollContainer, carouselItems, nextButton, prevButton;
|
|
103
|
+
return __generator(this, function (_a) {
|
|
104
|
+
switch (_a.label) {
|
|
105
|
+
case 0:
|
|
106
|
+
container = (0, react_1.render)(<Carousel_1.default items={images_1.default.slice(0, 3).map(function (item, index) { return (<TripieImage_1.default.WithSourceUrl sizes="large" key={item.src + index} alt={item.alt} src={item.src} sourceUrl={item.sourceUrl} blurDataURL={item.blurDataURL}/>); })}/>).container;
|
|
107
|
+
(0, vitest_1.expect)(container).toBeInTheDocument();
|
|
108
|
+
scrollContainer = Array.from(container.querySelectorAll('*')).filter(function (el) {
|
|
109
|
+
return el.className.match(/carousel-container/);
|
|
110
|
+
})[0];
|
|
111
|
+
(0, vitest_1.expect)(scrollContainer).toBeInTheDocument();
|
|
112
|
+
carouselItems = Array.from(container.querySelectorAll('*')).filter(function (el) { return el.className.match(/carousel-item/); });
|
|
113
|
+
(0, vitest_1.expect)(carouselItems.length).toBe(3);
|
|
114
|
+
nextButton = container.querySelector('button[name="next"]');
|
|
115
|
+
(0, vitest_1.expect)(nextButton).toBeInTheDocument();
|
|
116
|
+
// 다음 버튼 클릭
|
|
117
|
+
return [4 /*yield*/, (0, react_1.act)(function () { return react_1.fireEvent.click(nextButton); })];
|
|
118
|
+
case 1:
|
|
119
|
+
// 다음 버튼 클릭
|
|
120
|
+
_a.sent();
|
|
121
|
+
// 클래스 변경, 두번째 항목(인덱스1)에만 focus
|
|
122
|
+
return [4 /*yield*/, (0, react_1.waitFor)(function () {
|
|
123
|
+
(0, vitest_1.expect)(carouselItems[0].classList.contains('focused')).toBe(false);
|
|
124
|
+
(0, vitest_1.expect)(carouselItems[1].classList.contains('focused')).toBe(true);
|
|
125
|
+
(0, vitest_1.expect)(carouselItems[2].classList.contains('focused')).toBe(false);
|
|
126
|
+
})];
|
|
127
|
+
case 2:
|
|
128
|
+
// 클래스 변경, 두번째 항목(인덱스1)에만 focus
|
|
129
|
+
_a.sent();
|
|
130
|
+
// 다음 버튼 클릭
|
|
131
|
+
return [4 /*yield*/, (0, react_1.act)(function () { return react_1.fireEvent.click(nextButton); })];
|
|
132
|
+
case 3:
|
|
133
|
+
// 다음 버튼 클릭
|
|
134
|
+
_a.sent();
|
|
135
|
+
// 클래스 변경, 세번째 항목(인덱스2)에만 focus
|
|
136
|
+
return [4 /*yield*/, (0, react_1.waitFor)(function () {
|
|
137
|
+
(0, vitest_1.expect)(carouselItems[0].classList.contains('focused')).toBe(false);
|
|
138
|
+
(0, vitest_1.expect)(carouselItems[1].classList.contains('focused')).toBe(false);
|
|
139
|
+
(0, vitest_1.expect)(carouselItems[2].classList.contains('focused')).toBe(true);
|
|
140
|
+
(0, vitest_1.expect)(nextButton).not.toBeInTheDocument(); // 마지막 항목이므로 다음 버튼이 보이지 않는다.
|
|
141
|
+
})];
|
|
142
|
+
case 4:
|
|
143
|
+
// 클래스 변경, 세번째 항목(인덱스2)에만 focus
|
|
144
|
+
_a.sent();
|
|
145
|
+
prevButton = container.querySelector('button[name="previous"]');
|
|
146
|
+
(0, vitest_1.expect)(prevButton).toBeInTheDocument();
|
|
147
|
+
// 이전 버튼 클릭
|
|
148
|
+
return [4 /*yield*/, (0, react_1.act)(function () { return react_1.fireEvent.click(prevButton); })];
|
|
149
|
+
case 5:
|
|
150
|
+
// 이전 버튼 클릭
|
|
151
|
+
_a.sent();
|
|
152
|
+
// 클래스 변경, 두번째 항목(인덱스)에만 focus
|
|
153
|
+
return [4 /*yield*/, (0, react_1.waitFor)(function () {
|
|
154
|
+
(0, vitest_1.expect)(carouselItems[0].classList.contains('focused')).toBe(false);
|
|
155
|
+
(0, vitest_1.expect)(carouselItems[1].classList.contains('focused')).toBe(true);
|
|
156
|
+
(0, vitest_1.expect)(carouselItems[2].classList.contains('focused')).toBe(false);
|
|
157
|
+
})];
|
|
158
|
+
case 6:
|
|
159
|
+
// 클래스 변경, 두번째 항목(인덱스)에만 focus
|
|
160
|
+
_a.sent();
|
|
161
|
+
(0, vitest_1.expect)(Element.prototype.scrollIntoView).toHaveBeenCalled();
|
|
162
|
+
return [2 /*return*/];
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}); });
|
|
166
|
+
// !! 🤔 스크롤 테스트가 잘 안됨 !! https://github.com/f-lab-edu/Tripie/blob/e6a096584da85ba6cfba371464b96aee4e77847c/packages/design-system/src/components/Carousel/Carousel.tsx#L92 useEffect가 안먹힘.
|
|
167
|
+
// it('5. 스크롤', async () => {
|
|
168
|
+
// const { container } = render(
|
|
169
|
+
// <Carousel
|
|
170
|
+
// items={images.slice(0, 2).map((item, index) => (
|
|
171
|
+
// <TripieImage.WithSourceUrl
|
|
172
|
+
// sizes="large"
|
|
173
|
+
// key={item.src + index}
|
|
174
|
+
// alt={item.alt}
|
|
175
|
+
// src={item.src}
|
|
176
|
+
// sourceUrl={item.sourceUrl}
|
|
177
|
+
// blurDataURL={item.blurDataURL}
|
|
178
|
+
// />
|
|
179
|
+
// ))}
|
|
180
|
+
// />
|
|
181
|
+
// );
|
|
182
|
+
// expect(container).toBeInTheDocument();
|
|
183
|
+
// // Get all carousel items
|
|
184
|
+
// const carouselItems = Array.from(container.querySelectorAll('*')).filter(el => el.className.match(/carousel-item/));
|
|
185
|
+
// expect(carouselItems.length).toBe(2);
|
|
186
|
+
// // Ensure first item is focused initially
|
|
187
|
+
// expect(carouselItems[0].classList.contains('focused')).toBe(true);
|
|
188
|
+
// expect(carouselItems[1].classList.contains('focused')).toBe(false);
|
|
189
|
+
// act(() => {
|
|
190
|
+
// container.scrollLeft = 1000;
|
|
191
|
+
// fireEvent.scroll(container);
|
|
192
|
+
// !! 동작하므로 scroll은 되는 것 같지만 state 변경이 잘 안된듯
|
|
193
|
+
// container.addEventListener('scroll', () => {
|
|
194
|
+
// console.log('Scroll event triggered!');
|
|
195
|
+
// });
|
|
196
|
+
// });
|
|
197
|
+
// // Wait for class update where only the second item is focused
|
|
198
|
+
// await waitFor(() => {
|
|
199
|
+
// expect(carouselItems[0].classList.contains('focused')).toBe(false);
|
|
200
|
+
// expect(carouselItems[1].classList.contains('focused')).toBe(true);
|
|
201
|
+
// });
|
|
202
|
+
// });
|
|
203
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CarouselImageOf5 = exports.CarouselImageOf4 = exports.CarouselImageOf3 = exports.Default = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var hooks_1 = require("../../hooks");
|
|
6
|
+
var TripieImage_1 = require("../TripieImage/TripieImage");
|
|
7
|
+
var Carousel_1 = require("./Carousel");
|
|
8
|
+
var images_1 = require("./images");
|
|
9
|
+
var meta = {
|
|
10
|
+
title: 'tripie-ui/Carousel',
|
|
11
|
+
component: Carousel_1.default,
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
parameters: {
|
|
14
|
+
docs: {
|
|
15
|
+
description: {
|
|
16
|
+
component: '인스타그램의 이미지 carousel와 같이 임계점을 넘어야 해당 이미지에 고정되는 carousel 컴포넌트입니다.ex. 기본은 인접한 게시물의 60%가 보여야 해당 콘텐츠로 넘어갑니다.',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
argTypes: {},
|
|
21
|
+
decorators: [
|
|
22
|
+
function (story, context) {
|
|
23
|
+
var _a = (0, hooks_1.useAppTheme)(), mode = _a.mode, setMode = _a.setMode;
|
|
24
|
+
var selectedTheme = context.globals.theme || mode;
|
|
25
|
+
(0, react_1.useEffect)(function () {
|
|
26
|
+
setMode(selectedTheme);
|
|
27
|
+
}, [selectedTheme]);
|
|
28
|
+
return <div className={"".concat(context.globals.theme)}>{story()}</div>;
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
exports.default = meta;
|
|
33
|
+
exports.Default = {
|
|
34
|
+
name: 'Carousel.Image.2',
|
|
35
|
+
render: function () {
|
|
36
|
+
return (<Carousel_1.default items={images_1.default.slice(0, 2).map(function (item, index) { return (<TripieImage_1.default.WithSourceUrl sizes="large" key={item.src + index} alt={item.alt} src={item.src} sourceUrl={item.sourceUrl} blurDataURL={item.blurDataURL}/>); })}/>);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
exports.CarouselImageOf3 = {
|
|
40
|
+
name: 'Carousel.Image.3',
|
|
41
|
+
render: function () {
|
|
42
|
+
return (<Carousel_1.default items={images_1.default.slice(0, 3).map(function (item, index) { return (<TripieImage_1.default.WithSourceUrl sizes="large" key={item.src + index} alt={item.alt} src={item.src} sourceUrl={item.sourceUrl} blurDataURL={item.blurDataURL}/>); })}/>);
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
exports.CarouselImageOf4 = {
|
|
46
|
+
name: 'Carousel.Image.4',
|
|
47
|
+
render: function () {
|
|
48
|
+
return (<Carousel_1.default items={images_1.default.slice(0, 4).map(function (item, index) { return (<TripieImage_1.default.WithSourceUrl sizes="large" key={item.src + index} alt={item.alt} src={item.src} sourceUrl={item.sourceUrl} blurDataURL={item.blurDataURL}/>); })}/>);
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
exports.CarouselImageOf5 = {
|
|
52
|
+
name: 'Carousel.Image.5',
|
|
53
|
+
render: function () {
|
|
54
|
+
return (<Carousel_1.default items={images_1.default.map(function (item, index) { return (<TripieImage_1.default.WithSourceUrl sizes="large" key={item.src + index} alt={item.alt} src={item.src} sourceUrl={item.sourceUrl} blurDataURL={item.blurDataURL}/>); })}/>);
|
|
55
|
+
},
|
|
56
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var images = [
|
|
4
|
+
{
|
|
5
|
+
sizes: 'large',
|
|
6
|
+
alt: 'https://media.triple.guide/triple-cms/c_limit,f_auto,h_2048,w_2048/1037f801-0b0e-40b1-bff1-c5be7d66eab1.jpeg',
|
|
7
|
+
src: 'https://media.triple.guide/triple-cms/c_limit,f_auto,h_2048,w_2048/1037f801-0b0e-40b1-bff1-c5be7d66eab1.jpeg',
|
|
8
|
+
sourceUrl: 'huistenbosch.co.jp/gourmet/64',
|
|
9
|
+
blurDataURL: 'data:image/svg+xml;base64,CiAgPHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA4IDUnPgogICAgPGZpbHRlciBpZD0nYicgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSdzUkdCJz4KICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0nMScgLz4KICAgIDwvZmlsdGVyPgogICAgPGltYWdlIHByZXNlcnZlQXNwZWN0UmF0aW89J25vbmUnIGZpbHRlcj0ndXJsKCNiKScgeD0nMCcgeT0nMCcgaGVpZ2h0PScxMDAlJyB3aWR0aD0nMTAwJScgCiAgICBocmVmPSdkYXRhOmltYWdlL2F2aWY7YmFzZTY0LC85ai8yd0JEQUFnSUNBZ0pDQWtLQ2drTkRnd09EUk1SRUJBUkV4d1VGaFFXRkJ3ckd4OGJHeDhiS3lZdUpTTWxMaVpFTlM4dk5VUk9RajVDVGw5VlZWOTNjWGVjbk5ILzJ3QkRBUWdJQ0FnSkNBa0tDZ2tORGd3T0RSTVJFQkFSRXh3VUZoUVdGQndyR3g4Ykd4OGJLeVl1SlNNbExpWkVOUzh2TlVST1FqNUNUbDlWVlY5M2NYZWNuTkgvd2dBUkNBQVFBQkFEQVNJQUFoRUJBeEVCLzhRQUZnQUJBUUVBQUFBQUFBQUFBQUFBQUFBQUJnTUYvOFFBRlFFQkFRQUFBQUFBQUFBQUFBQUFBQUFBQXdULzJnQU1Bd0VBQWhBREVBQUFBRXN6MkdGSC84UUFKUkFBQWdJQkFnUUhBQUFBQUFBQUFBQUFBUUlEQkJJQUVRVVVNVkVURlNFaU1sSnkvOW9BQ0FFQkFBRS9BRnQwR3hyclRYbW5iWmc3bkdMY2RHUDI3alVGV0VoY1ZnbEhVeU14YmNkOGZUVnpqbEdLSzBKSjRzekZKNFlpSU14WS9FKzNwcFpxL0pWZk1PS1N6TWNDd2pjSXY0eFRZNi8veEFBYUVRQUNBZ01BQUFBQUFBQUFBQUFBQUFBQkVRQVNBaE5oLzlvQUNBRUNBUUUvQU53b0dNbDEyTS8veEFBWUVRRUJBQU1BQUFBQUFBQUFBQUFBQUFBQkVRQVN3Zi9hQUFnQkF3RUJQd0RSckU1bi85az0nIC8+CiAgPC9zdmc+Cg==',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
sizes: 'large',
|
|
13
|
+
alt: 'https://media.triple.guide/triple-cms/c_limit,f_auto,h_2048,w_2048/5aa4fd86-ce45-4675-a227-a1577bd8d823.jpeg',
|
|
14
|
+
src: 'https://media.triple.guide/triple-cms/c_limit,f_auto,h_2048,w_2048/5aa4fd86-ce45-4675-a227-a1577bd8d823.jpeg',
|
|
15
|
+
sourceUrl: 'huistenbosch.co.jp/gourmet/329',
|
|
16
|
+
blurDataURL: 'data:image/svg+xml;base64,CiAgPHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA4IDUnPgogICAgPGZpbHRlciBpZD0nYicgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSdzUkdCJz4KICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0nMScgLz4KICAgIDwvZmlsdGVyPgogICAgPGltYWdlIHByZXNlcnZlQXNwZWN0UmF0aW89J25vbmUnIGZpbHRlcj0ndXJsKCNiKScgeD0nMCcgeT0nMCcgaGVpZ2h0PScxMDAlJyB3aWR0aD0nMTAwJScgCiAgICBocmVmPSdkYXRhOmltYWdlL2F2aWY7YmFzZTY0LC85ai8yd0JEQUFnSUNBZ0pDQWtLQ2drTkRnd09EUk1SRUJBUkV4d1VGaFFXRkJ3ckd4OGJHeDhiS3lZdUpTTWxMaVpFTlM4dk5VUk9RajVDVGw5VlZWOTNjWGVjbk5ILzJ3QkRBUWdJQ0FnSkNBa0tDZ2tORGd3T0RSTVJFQkFSRXh3VUZoUVdGQndyR3g4Ykd4OGJLeVl1SlNNbExpWkVOUzh2TlVST1FqNUNUbDlWVlY5M2NYZWNuTkgvd2dBUkNBQVFBQkFEQVNJQUFoRUJBeEVCLzhRQUZnQUJBUUVBQUFBQUFBQUFBQUFBQUFBQUJBVUcvOFFBRkFFQkFBQUFBQUFBQUFBQUFBQUFBQUFBQmYvYUFBd0RBUUFDRUFNUUFBQUEwNW16eld2L3hBQWhFQUFEQUFFREJBTUFBQUFBQUFBQUFBQUJBZ01SQUFRVEJSSWhNUlFWWWYvYUFBZ0JBUUFCUHdDa3BmRVZJQ2ZLaUZITGVQYlp5UXZyOE9vN0xkYm8zanVKSkpPSWhheHFmTEgwZTBnRWE2cjA1NUZhSStUSHRkeU1qTFpKeVJyN3ppdFMrOUNxenFxRW9DUW9HVHIveEFBYkVRQURBUUFEQVFBQUFBQUFBQUFBQUFBQkF4RUNBQklUSWYvYUFBZ0JBZ0VCUHdCU2J2eGRoUnU4OVFWMHlUNFFlZi9FQUJvUkFBSUNBd0FBQUFBQUFBQUFBQUFBQUFFQ0F4SUFJekgvMmdBSUFRTUJBVDhBRnh0aGtmcFltMmYvMlE9PScgLz4KICA8L3N2Zz4K',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
sizes: 'large',
|
|
20
|
+
alt: 'https://media.triple.guide/triple-cms/c_limit,f_auto,h_2048,w_2048/0e054e18-9b82-4382-a239-75891abfd614.jpeg',
|
|
21
|
+
src: 'https://media.triple.guide/triple-cms/c_limit,f_auto,h_2048,w_2048/0e054e18-9b82-4382-a239-75891abfd614.jpeg',
|
|
22
|
+
sourceUrl: 'huistenbosch.co.jp/gourmet/73',
|
|
23
|
+
blurDataURL: 'data:image/svg+xml;base64,CiAgPHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA4IDUnPgogICAgPGZpbHRlciBpZD0nYicgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSdzUkdCJz4KICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0nMScgLz4KICAgIDwvZmlsdGVyPgogICAgPGltYWdlIHByZXNlcnZlQXNwZWN0UmF0aW89J25vbmUnIGZpbHRlcj0ndXJsKCNiKScgeD0nMCcgeT0nMCcgaGVpZ2h0PScxMDAlJyB3aWR0aD0nMTAwJScgCiAgICBocmVmPSdkYXRhOmltYWdlL2F2aWY7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5TVWhFVWdBQUFCQUFBQUFRQ0FNQUFBQW9MUTlUQUFBQmpGQk1WRVVEQUFDOFhFNjZVMHdNQ0FpaVpFTzdnbC9EaFZvR0F3VzFjRXVNVlRzVkVoVXVLUzBVQ3cwd0xUQTRORG1pYUV5ZlhqNm1ia3lYWHo2SlBqbkdURVFlR3lYT2syZjBzUXIzNjloYWRpeUlxRE5pU1RsR05pNC9MQ3pkbm5GTEd4eUVTeTdDZFVMN3p5cjd4NHl5UFRpM2UwaktpbGJTV1ZQeHNCbXNTRCtYYWovVmRXYWFQVFpXVjJTbVNEZm1tUjcvMlNiUGZGdjV4aVgyOVBEODkrdUVocG1pbWp2OC9QcnUyOGhEUDBRdlBDZmd4cWRzbGl5SmhZbVJlR1QxcHdMR3kyMzZ6bVIzWGxDZ2JFVFdtV0pUT1N2Z21WclRqVldvV3pheVprbXJuWHBpWDJWM0hSekxoVjVJUlV4NVNUYTRtSVBDZWs5MVJpK2liRHlOTGlyYWYzR3RrempwZEdUb3ExSDhvNWZHa1ZIaHFUcnBybDM2MXBQd3dYYmNhbHZrNHVESmxsMy8xb25pcGgzZmpES3pzTE95a3gyWWRSUHN3SVYvZVg3WHRKMkpoU3hqWFYybGx4dGFneS8vNHF6MjM4VDR1VDNMNEVPeHRDcjh3MXRXVlJUZjJNL3pueURSMUVHL3VIMjh5a1gvcWkvUjA5cVhsWjRrTFJTeXMwYm95MFgvOHBSSllDVzR0anlYeWdvQUFBQUFDWEJJV1hNQUFoY29BQUlYS0FFUCsrY1dBQUFCQWtsRVFWUjRuRFhIWlZlREFCaEE0UmNHak5oZ3hJaDFkM2VIM2QzZDNkMU8vZU1lOWZoOHVlZkNjTHhzcm55K1FmbTFubis1cTU5QVBtNnVXSjdlRzlXUGRsc3RaZzloYUc3LzlQcWgxZW9vemVhbFd0d0ZUeXFWS2RTMDJ0ZnovYzE1THJjQm5veVMxTTQweTJQcG9ucFVVck1RVWtMYmU4ZVdxOXVHakdNQ1BnSEo1ZFcxblRSZmlKQUhXMHRUTGhlZ1VlOUtERVVvbWR0Y21CNFhNRUJpYVhkaVBTRVRSTUR2RnlnTTBMQWtSZWNSWXBJa1RTWVR4c0hzWWhCQmd6NXlGQ2NKbnVKNEVNV3dOT01iQ1RnR0IvcjdjTW9LWTZ4ZGREb05FYS9EM2RQZFpXZUFOckpHeHNqYWVxMDJ4a3pUT2dBQXZjNWcwT2wvL041Zi91bS9BVElpSytQS3lJZ2tBQUFBQUVsRlRrU3VRbUNDJyAvPgogIDwvc3ZnPgo=',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
sizes: 'large',
|
|
27
|
+
alt: 'https://media.triple.guide/triple-cms/c_limit,f_auto,h_2048,w_2048/24201c4a-ad69-489c-bd73-96b830ce9040.jpeg',
|
|
28
|
+
src: 'https://media.triple.guide/triple-cms/c_limit,f_auto,h_2048,w_2048/24201c4a-ad69-489c-bd73-96b830ce9040.jpeg',
|
|
29
|
+
sourceUrl: 'huistenbosch.co.jp/gourmet/66#photo',
|
|
30
|
+
blurDataURL: 'data:image/svg+xml;base64,CiAgPHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA4IDUnPgogICAgPGZpbHRlciBpZD0nYicgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSdzUkdCJz4KICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0nMScgLz4KICAgIDwvZmlsdGVyPgogICAgPGltYWdlIHByZXNlcnZlQXNwZWN0UmF0aW89J25vbmUnIGZpbHRlcj0ndXJsKCNiKScgeD0nMCcgeT0nMCcgaGVpZ2h0PScxMDAlJyB3aWR0aD0nMTAwJScgCiAgICBocmVmPSdkYXRhOmltYWdlL2F2aWY7YmFzZTY0LC85ai8yd0JEQUFnSUNBZ0pDQWtLQ2drTkRnd09EUk1SRUJBUkV4d1VGaFFXRkJ3ckd4OGJHeDhiS3lZdUpTTWxMaVpFTlM4dk5VUk9RajVDVGw5VlZWOTNjWGVjbk5ILzJ3QkRBUWdJQ0FnSkNBa0tDZ2tORGd3T0RSTVJFQkFSRXh3VUZoUVdGQndyR3g4Ykd4OGJLeVl1SlNNbExpWkVOUzh2TlVST1FqNUNUbDlWVlY5M2NYZWNuTkgvd2dBUkNBQVFBQkFEQVNJQUFoRUJBeEVCLzhRQUZnQUJBUUVBQUFBQUFBQUFBQUFBQUFBQUJnTUUvOFFBRlFFQkFRQUFBQUFBQUFBQUFBQUFBQUFBQkFYLzJnQU1Bd0VBQWhBREVBQUFBSkNGZXdWSC84UUFJeEFBQVFNREJBSURBQUFBQUFBQUFBQUFBZ0VEQkJFU0lRQUZFeUlHTVRKQllmL2FBQWdCQVFBQlB3Q1REOGJoczJUNGR6dnNXMk83cDV4MjA5UDNTRklSM2hjYVVBUVE1VzBKYkV3aVpUTk5iZURUVUxjQWZKS2lWUmRKQ080UitRMVgzK2EyOTlpWkZtdXlsYjVXMUVVS3hWVHRYNjlEU21kZi84UUFHQkVCQVFBREFBQUFBQUFBQUFBQUFBQUFBZ0VBRWlILzJnQUlBUUlCQVQ4QU5STTV0TS8veEFBWUVRRUJBQU1BQUFBQUFBQUFBQUFBQUFBQkFnQURJZi9hQUFnQkF3RUJQd0RZWGFWZEp6UC8yUT09JyAvPgogIDwvc3ZnPgo=',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
sizes: 'large',
|
|
34
|
+
alt: 'https://media.triple.guide/triple-cms/c_limit,f_auto,h_2048,w_2048/e3dc3514-e5c7-456e-93c2-e342483aa769.jpeg',
|
|
35
|
+
src: 'https://media.triple.guide/triple-cms/c_limit,f_auto,h_2048,w_2048/e3dc3514-e5c7-456e-93c2-e342483aa769.jpeg',
|
|
36
|
+
sourceUrl: 'huistenbosch.co.jp/gourmet/58#information',
|
|
37
|
+
blurDataURL: 'data:image/svg+xml;base64,CiAgPHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA4IDUnPgogICAgPGZpbHRlciBpZD0nYicgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSdzUkdCJz4KICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0nMScgLz4KICAgIDwvZmlsdGVyPgogICAgPGltYWdlIHByZXNlcnZlQXNwZWN0UmF0aW89J25vbmUnIGZpbHRlcj0ndXJsKCNiKScgeD0nMCcgeT0nMCcgaGVpZ2h0PScxMDAlJyB3aWR0aD0nMTAwJScgCiAgICBocmVmPSdkYXRhOmltYWdlL2F2aWY7YmFzZTY0LC85ai8yd0JEQUFnSUNBZ0pDQWtLQ2drTkRnd09EUk1SRUJBUkV4d1VGaFFXRkJ3ckd4OGJHeDhiS3lZdUpTTWxMaVpFTlM4dk5VUk9RajVDVGw5VlZWOTNjWGVjbk5ILzJ3QkRBUWdJQ0FnSkNBa0tDZ2tORGd3T0RSTVJFQkFSRXh3VUZoUVdGQndyR3g4Ykd4OGJLeVl1SlNNbExpWkVOUzh2TlVST1FqNUNUbDlWVlY5M2NYZWNuTkgvd2dBUkNBQVFBQkFEQVNJQUFoRUJBeEVCLzhRQUZnQUJBUUVBQUFBQUFBQUFBQUFBQUFBQUJRWUgvOFFBRkFFQkFBQUFBQUFBQUFBQUFBQUFBQUFBQlAvYUFBd0RBUUFDRUFNUUFBQUFsZEFGWE9yL3hBQWpFQUFCQXdNRUFnTUFBQUFBQUFBQUFBQURBUUlFQlNFaUFCRVNFd1l4UVdGeS85b0FDQUVCQUFFL0FQSG80MmxFYkRkRE0rYjNYVVhqR0lpRmlMTGN1WElqdnJmYk4ya3FsSEIzQlJpakt4K0QrbEZIYjgzMUhTbFZFSFlhc1F4eUh0dzV2ZUgxYTZhLy84UUFHQkVBQWdNQUFBQUFBQUFBQUFBQUFBQUFBQUVDRVNMLzJnQUlBUUlCQVQ4QWl0MmYvOFFBR0JFQUF3RUJBQUFBQUFBQUFBQUFBQUFBQWhFaEFBSC8yZ0FJQVFNQkFUOEFJWHl4Yi8vWicgLz4KICA8L3N2Zz4K',
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
exports.default = images;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.default = void 0;
|
|
18
|
+
__exportStar(require("./Carousel"), exports);
|
|
19
|
+
var Carousel_1 = require("./Carousel");
|
|
20
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return Carousel_1.default; } });
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var bind_1 = require("classnames/bind");
|
|
4
|
+
var chip_module_scss_1 = require("./chip.module.scss");
|
|
5
|
+
var framer_motion_1 = require("framer-motion");
|
|
6
|
+
var variants_1 = require("../../shared/variants");
|
|
7
|
+
var cx = bind_1.default.bind(chip_module_scss_1.default);
|
|
8
|
+
var Chip = function (_a) {
|
|
9
|
+
var children = _a.children, className = _a.className, onClick = _a.onClick, selected = _a.selected, _b = _a.disabled, disabled = _b === void 0 ? false : _b;
|
|
10
|
+
return (<framer_motion_1.motion.button whileHover={'shine'} whileTap={'shine'} disabled={disabled} animate={selected ? 'selected' : 'rest'} variants={variants_1.SHINE_VARIANT} onClick={onClick} className={cx('chip', 'with-border', className)}>
|
|
11
|
+
{children}
|
|
12
|
+
</framer_motion_1.motion.button>);
|
|
13
|
+
};
|
|
14
|
+
var AccentedChip = function (_a) {
|
|
15
|
+
var children = _a.children, current = _a.current, className = _a.className, onClick = _a.onClick;
|
|
16
|
+
return (<framer_motion_1.motion.button initial={'rest'} className={cx('wrap', 'with-border', current === 'on' ? 'selected' : 'chip', className)} variants={variants_1.GLOW_VARIANT} whileHover={'glow'} onClick={onClick}>
|
|
17
|
+
<div className={cx('accented', current === 'on' ? 'selected' : 'chip')}>{children}</div>
|
|
18
|
+
<framer_motion_1.motion.div className={cx('glow')} animate={{ rotate: 360 }} transition={{
|
|
19
|
+
type: 'tween',
|
|
20
|
+
duration: 2,
|
|
21
|
+
ease: 'linear',
|
|
22
|
+
repeat: Infinity,
|
|
23
|
+
}}/>
|
|
24
|
+
</framer_motion_1.motion.button>);
|
|
25
|
+
};
|
|
26
|
+
Chip.Accented = AccentedChip;
|
|
27
|
+
exports.default = Chip;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
50
|
+
var t = {};
|
|
51
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
52
|
+
t[p] = s[p];
|
|
53
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
54
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
55
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
56
|
+
t[p[i]] = s[p[i]];
|
|
57
|
+
}
|
|
58
|
+
return t;
|
|
59
|
+
};
|
|
60
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
61
|
+
var react_1 = require("@testing-library/react");
|
|
62
|
+
var vitest_1 = require("vitest");
|
|
63
|
+
require("../../shared/variants");
|
|
64
|
+
var Chip_1 = require("./Chip");
|
|
65
|
+
// !! motion framer 올바르게 mock 하는 방법? props 못 읽는 문제..
|
|
66
|
+
vitest_1.vi.mock('framer-motion', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
67
|
+
var actual;
|
|
68
|
+
return __generator(this, function (_a) {
|
|
69
|
+
switch (_a.label) {
|
|
70
|
+
case 0: return [4 /*yield*/, vitest_1.vi.importActual('framer-motion')];
|
|
71
|
+
case 1:
|
|
72
|
+
actual = _a.sent();
|
|
73
|
+
return [2 /*return*/, __assign(__assign({}, actual), { motion: {
|
|
74
|
+
button: vitest_1.vi.fn(function (_a) {
|
|
75
|
+
var animate = _a.animate, whileHover = _a.whileHover, whileTap = _a.whileTap, className = _a.className, props = __rest(_a, ["animate", "whileHover", "whileTap", "className"]);
|
|
76
|
+
console.log('Mocked motion.button animate:', animate); // Debugging log
|
|
77
|
+
return (<button data-animate={animate !== null && animate !== void 0 ? animate : 'rest'} // Ensure animate is always defined
|
|
78
|
+
data-while-hover={whileHover !== null && whileHover !== void 0 ? whileHover : ''} data-while-tap={whileTap !== null && whileTap !== void 0 ? whileTap : ''} className={className !== null && className !== void 0 ? className : ''} {...props}/>);
|
|
79
|
+
}),
|
|
80
|
+
} })];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}); });
|
|
84
|
+
(0, vitest_1.describe)('Chip Component', function () {
|
|
85
|
+
(0, vitest_1.it)('1. should have correct motion attributes', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
86
|
+
var chip;
|
|
87
|
+
return __generator(this, function (_a) {
|
|
88
|
+
(0, react_1.render)(<Chip_1.default selected={true}>Animated Chip</Chip_1.default>);
|
|
89
|
+
chip = react_1.screen.getByRole('button', { name: /Animated Chip/i });
|
|
90
|
+
expect(chip).toBeInTheDocument();
|
|
91
|
+
return [2 /*return*/];
|
|
92
|
+
});
|
|
93
|
+
}); });
|
|
94
|
+
(0, vitest_1.it)('2. Chip disabled 속성을 true로 설정하면 disable된다.', function () {
|
|
95
|
+
(0, react_1.render)(<Chip_1.default disabled={true}>Disabled Chip</Chip_1.default>);
|
|
96
|
+
var chip = react_1.screen.getByRole('button', { name: /Disabled Chip/i });
|
|
97
|
+
expect(chip).toBeDisabled();
|
|
98
|
+
});
|
|
99
|
+
(0, vitest_1.it)('2. Chip disabled 속성을 true로 설정하면 disable된다.', function () {
|
|
100
|
+
(0, react_1.render)(<Chip_1.default className={'restaurant'}>1</Chip_1.default>);
|
|
101
|
+
var chip = react_1.screen.getByRole('button', { name: /1/i });
|
|
102
|
+
});
|
|
103
|
+
});
|