-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
177 additions
and
38 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
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,37 @@ | ||
"use client"; | ||
|
||
import { ActionButton } from "seed-design/ui/action-button"; | ||
import { Snackbar, SnackbarProvider, useSnackbarAdapter } from "seed-design/ui/snackbar"; | ||
|
||
function Component() { | ||
const adapter = useSnackbarAdapter(); | ||
|
||
return ( | ||
<ActionButton | ||
onClick={() => | ||
adapter.create({ | ||
timeout: 50000000, | ||
onClose: () => {}, | ||
render: () => ( | ||
<Snackbar | ||
variant="danger" | ||
message="알림 메세지" | ||
actionLabel="확인" | ||
onAction={() => {}} | ||
/> | ||
), | ||
}) | ||
} | ||
> | ||
실행 | ||
</ActionButton> | ||
); | ||
} | ||
|
||
export default function SnackbarNegative() { | ||
return ( | ||
<SnackbarProvider> | ||
<Component /> | ||
</SnackbarProvider> | ||
); | ||
} |
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,37 @@ | ||
"use client"; | ||
|
||
import { ActionButton } from "seed-design/ui/action-button"; | ||
import { Snackbar, SnackbarProvider, useSnackbarAdapter } from "seed-design/ui/snackbar"; | ||
|
||
function Component() { | ||
const adapter = useSnackbarAdapter(); | ||
|
||
return ( | ||
<ActionButton | ||
onClick={() => | ||
adapter.create({ | ||
timeout: 5000, | ||
onClose: () => {}, | ||
render: () => ( | ||
<Snackbar | ||
variant="positive" | ||
message="알림 메세지" | ||
actionLabel="확인" | ||
onAction={() => {}} | ||
/> | ||
), | ||
}) | ||
} | ||
> | ||
실행 | ||
</ActionButton> | ||
); | ||
} | ||
|
||
export default function SnackbarPositive() { | ||
return ( | ||
<SnackbarProvider> | ||
<Component /> | ||
</SnackbarProvider> | ||
); | ||
} |
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
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
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
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,21 @@ | ||
declare interface SnackbarRegionVariant { | ||
|
||
} | ||
|
||
declare type SnackbarRegionVariantMap = { | ||
[key in keyof SnackbarRegionVariant]: Array<SnackbarRegionVariant[key]>; | ||
}; | ||
|
||
export declare type SnackbarRegionVariantProps = Partial<SnackbarRegionVariant>; | ||
|
||
export declare type SnackbarRegionSlotName = "root"; | ||
|
||
export declare const snackbarRegionVariantMap: SnackbarRegionVariantMap; | ||
|
||
export declare const snackbarRegion: (( | ||
props?: SnackbarRegionVariantProps, | ||
) => Record<SnackbarRegionSlotName, string>) & { | ||
splitVariantProps: <T extends SnackbarRegionVariantProps>( | ||
props: T, | ||
) => [SnackbarRegionVariantProps, Omit<T, keyof SnackbarRegionVariantProps>]; | ||
} |
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,31 @@ | ||
import { createClassName } from "./className.mjs"; | ||
import { mergeVariants } from "./mergeVariants.mjs"; | ||
import { splitVariantProps } from "./splitVariantProps.mjs"; | ||
|
||
const snackbarRegionSlotNames = [ | ||
[ | ||
"root", | ||
"snackbarRegion__root" | ||
] | ||
]; | ||
|
||
const defaultVariant = {}; | ||
|
||
const compoundVariants = []; | ||
|
||
export const snackbarRegionVariantMap = {}; | ||
|
||
export const snackbarRegionVariantKeys = Object.keys(snackbarRegionVariantMap); | ||
|
||
export function snackbarRegion(props) { | ||
return Object.fromEntries( | ||
snackbarRegionSlotNames.map(([slot, className]) => { | ||
return [ | ||
slot, | ||
createClassName(className, mergeVariants(defaultVariant, props), compoundVariants), | ||
]; | ||
}), | ||
); | ||
} | ||
|
||
Object.assign(snackbarRegion, { splitVariantProps: (props) => splitVariantProps(props, snackbarRegionVariantMap) }); |
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
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,14 @@ | ||
.snackbarRegion__root { | ||
z-index: 2147483647; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
left: calc(env(safe-area-inset-left, 0px)); | ||
right: calc(env(safe-area-inset-right, 0px)); | ||
bottom: calc(env(safe-area-inset-bottom, 0px) + var(--snackbar-region-offset, 0px)); | ||
padding-inline: var(--seed-v3-unit-s2); | ||
padding-block: var(--seed-v3-unit-s2); | ||
transition-property: bottom; | ||
transition-duration: var(--seed-v3-duration-s4); | ||
transition-timing-function: var(--seed-v3-timing-function-easing) | ||
} |