-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #230 from coldsurfers/release/coldsurf-io-v1.0.5
release(coldsurf-io): v1.0.5
- Loading branch information
Showing
30 changed files
with
353 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './product-card' | ||
export * from './product-card-bottom-sheet' |
1 change: 1 addition & 0 deletions
1
apps/coldsurf-io/src/app/products/(components)/product-card-bottom-sheet/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './product-card-bottom-sheet' |
23 changes: 23 additions & 0 deletions
23
...-io/src/app/products/(components)/product-card-bottom-sheet/product-card-bottom-sheet.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use client' | ||
|
||
import { useProductStore } from '@/stores' | ||
import { useShallow } from 'zustand/shallow' | ||
import { ProductCardBottomSheet as BottomSheet } from '../../(ui)/product-card-bottom-sheet' | ||
|
||
export function ProductCardBottomSheet() { | ||
const { | ||
isProductBottomSheetOpen: isOpen, | ||
setIsProductBottomSheetOpen: setIsOpen, | ||
selectedProduct, | ||
} = useProductStore( | ||
useShallow((state) => ({ | ||
isProductBottomSheetOpen: state.isProductBottomSheetOpen, | ||
setIsProductBottomSheetOpen: state.setIsProductBottomSheetOpen, | ||
selectedProduct: state.selectedProduct, | ||
})), | ||
) | ||
if (!selectedProduct) { | ||
return null | ||
} | ||
return <BottomSheet isOpen={isOpen} onClose={() => setIsOpen(false)} selectedProduct={selectedProduct} /> | ||
} |
1 change: 1 addition & 0 deletions
1
apps/coldsurf-io/src/app/products/(components)/product-card/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './product-card' |
24 changes: 24 additions & 0 deletions
24
apps/coldsurf-io/src/app/products/(components)/product-card/product-card.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use client' | ||
|
||
import { useProductStore } from '@/stores' | ||
import { useShallow } from 'zustand/shallow' | ||
import { ProductCard as Card } from '../../(ui)' | ||
import { ProductCardProps } from './product-card.types' | ||
|
||
export function ProductCard(props: ProductCardProps) { | ||
const { setSelectedProduct, setIsProductBottomSheetOpen } = useProductStore( | ||
useShallow((state) => ({ | ||
setSelectedProduct: state.setSelectedProduct, | ||
setIsProductBottomSheetOpen: state.setIsProductBottomSheetOpen, | ||
})), | ||
) | ||
return ( | ||
<Card | ||
onClick={() => { | ||
setIsProductBottomSheetOpen(true) | ||
setSelectedProduct(props) | ||
}} | ||
{...props} | ||
/> | ||
) | ||
} |
3 changes: 3 additions & 0 deletions
3
apps/coldsurf-io/src/app/products/(components)/product-card/product-card.types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Product } from '@/types' | ||
|
||
export type ProductCardProps = Product |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './product-card' | ||
export * from './product-card-bottom-sheet' | ||
export * from './product-card-list-layout' | ||
export * from './top-title' |
1 change: 1 addition & 0 deletions
1
apps/coldsurf-io/src/app/products/(ui)/product-card-bottom-sheet/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './product-card-bottom-sheet' |
121 changes: 121 additions & 0 deletions
121
...rf-io/src/app/products/(ui)/product-card-bottom-sheet/product-card-bottom-sheet.styled.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
import { colors, IconButton, media, semantics, Text } from '@coldsurfers/ocean-road' | ||
import { css } from '@emotion/react' | ||
import styled from '@emotion/styled' | ||
import { motion } from 'framer-motion' | ||
|
||
// Styled container for the bottom sheet | ||
export const SheetContainer = styled(motion.div)` | ||
position: fixed; | ||
bottom: 0; | ||
left: 0; | ||
right: 0; | ||
width: 100%; | ||
height: 85vh; | ||
background: white; | ||
border-radius: 16px 16px 0 0; | ||
box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.2); | ||
z-index: 101; | ||
display: flex; | ||
flex-direction: column; | ||
padding: 40px 40px 16px; | ||
background-color: ${semantics.color.background[4]}; | ||
${media.medium(css` | ||
padding: 24px 24px 16px; | ||
`)} | ||
` | ||
|
||
export const SheetInner = styled.div` | ||
min-width: 0px; | ||
padding: 24px; | ||
overflow: hidden auto; | ||
padding-left: 40px; | ||
padding-right: 40px; | ||
` | ||
|
||
export const Overlay = styled(motion.div)` | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background: rgba(0, 0, 0, 0.5); | ||
z-index: 100; | ||
backdrop-filter: blur(5px); | ||
` | ||
|
||
export const CloseButton = styled(IconButton)` | ||
padding: 8px; | ||
position: absolute; | ||
top: 14px; | ||
right: 14px; | ||
color: inherit; | ||
cursor: pointer; | ||
border: none; | ||
z-index: 10000; | ||
background: ${semantics.color.background[3]}; | ||
border-radius: 100%; | ||
display: flex; | ||
-webkit-box-align: center; | ||
align-items: center; | ||
-webkit-box-pack: center; | ||
justify-content: center; | ||
` | ||
|
||
export const StyledTitle = styled(Text)` | ||
font-size: clamp(28px, 8vmin, 56px); | ||
font-weight: 820; | ||
letter-spacing: -0.02em; | ||
line-height: 1.05; | ||
text-align: left; | ||
` | ||
|
||
export const StyledDescription = styled(Text)` | ||
font-weight: 418; | ||
letter-spacing: 0.01em; | ||
line-height: 1.5; | ||
font-size: 16px; | ||
white-space: pre-wrap; | ||
${media.small(css` | ||
font-size: 14px; | ||
`)} | ||
` | ||
|
||
export const StyledProductImageContainer = styled.div` | ||
width: 390px; | ||
margin-left: auto; | ||
` | ||
|
||
export const StyledProductImage = styled.img` | ||
aspect-ratio: 0.5625 / 1; | ||
width: 100%; | ||
height: auto; | ||
border-radius: 20px; | ||
object-fit: cover; | ||
object-position: 50%; | ||
` | ||
|
||
export const StyledContentGrid = styled.div` | ||
display: grid; | ||
grid-template-areas: | ||
'breadcrumbs . .' | ||
'content . image' | ||
'ctaButton . image' | ||
'linkApps . image' | ||
'tags . image'; | ||
grid-template-columns: 3fr 1fr; | ||
max-width: 1200px; | ||
margin: 0 auto; | ||
` | ||
|
||
export const StyledCtaText = styled(Text)` | ||
font-size: 16px; | ||
font-weight: 418; | ||
letter-spacing: 0.01em; | ||
line-height: 1.5; | ||
color: ${colors.oc.white.value}; | ||
` |
81 changes: 81 additions & 0 deletions
81
...coldsurf-io/src/app/products/(ui)/product-card-bottom-sheet/product-card-bottom-sheet.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
'use client' | ||
|
||
import { Button, Text } from '@coldsurfers/ocean-road' | ||
import { AnimatePresence } from 'framer-motion' | ||
import { X as XIcon } from 'lucide-react' | ||
import { | ||
CloseButton, | ||
Overlay, | ||
SheetContainer, | ||
SheetInner, | ||
StyledContentGrid, | ||
StyledCtaText, | ||
StyledDescription, | ||
StyledProductImage, | ||
StyledProductImageContainer, | ||
StyledTitle, | ||
} from './product-card-bottom-sheet.styled' | ||
import { ProductCardBottomSheetProps } from './product-card-bottom-sheet.types' | ||
|
||
export function ProductCardBottomSheet({ isOpen, onClose, selectedProduct }: ProductCardBottomSheetProps) { | ||
// Animation variants for the sheet | ||
const sheetVariants = { | ||
hidden: { y: '100%', opacity: 0 }, | ||
visible: { y: 0, opacity: 1 }, | ||
} | ||
|
||
return ( | ||
<AnimatePresence> | ||
{isOpen && ( | ||
<> | ||
{/* Overlay */} | ||
<Overlay initial={{ opacity: 0 }} animate={{ opacity: 1 }} exit={{ opacity: 0 }} onClick={() => onClose()} /> | ||
|
||
{/* Bottom Sheet */} | ||
<SheetContainer | ||
initial="hidden" | ||
animate="visible" | ||
exit="hidden" | ||
variants={sheetVariants} | ||
transition={{ type: 'keyframes', stiffness: 70, damping: 15, duration: 0.25 }} | ||
> | ||
<CloseButton onClick={() => onClose()}> | ||
<XIcon /> | ||
</CloseButton> | ||
<SheetInner> | ||
<StyledContentGrid> | ||
<div style={{ gridArea: 'breadcrumbs', verticalAlign: 'baseline' }}> | ||
<Text as="p">Products / {selectedProduct.title}</Text> | ||
</div> | ||
<div | ||
style={{ | ||
gridArea: 'content', | ||
minWidth: 0, | ||
marginBottom: 48, | ||
marginTop: 13, | ||
verticalAlign: 'baseline', | ||
}} | ||
> | ||
<StyledTitle as="h2">{selectedProduct.title}</StyledTitle> | ||
<StyledDescription as="p">{selectedProduct.longDescription}</StyledDescription> | ||
</div> | ||
<div style={{ gridArea: 'ctaButton' }}> | ||
{selectedProduct.ctaTitle && ( | ||
<Button onClick={() => window.open(selectedProduct.ctaLink, '_blank')}> | ||
<StyledCtaText>{selectedProduct.ctaTitle}</StyledCtaText> | ||
</Button> | ||
)} | ||
</div> | ||
<div style={{ gridArea: 'image' }}> | ||
<StyledProductImageContainer> | ||
<StyledProductImage src={selectedProduct.productImgSrc} /> | ||
</StyledProductImageContainer> | ||
</div> | ||
</StyledContentGrid> | ||
</SheetInner> | ||
</SheetContainer> | ||
</> | ||
)} | ||
</AnimatePresence> | ||
) | ||
} |
3 changes: 3 additions & 0 deletions
3
...urf-io/src/app/products/(ui)/product-card-bottom-sheet/product-card-bottom-sheet.types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Product } from '@/types' | ||
|
||
export type ProductCardBottomSheetProps = { isOpen: boolean; onClose: () => void; selectedProduct: Product } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
apps/coldsurf-io/src/app/products/(ui)/product-card/product-card.types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Product } from '@/types' | ||
|
||
export type ProductCardProps = Product & { | ||
onClick: () => void | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './product-store' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './product-store' |
Oops, something went wrong.