-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'wip' into feat-stackflow-integration
- Loading branch information
Showing
50 changed files
with
1,265 additions
and
166 deletions.
There are no files selected for viewing
Binary file renamed
BIN
+1 MB
...data-npm-0.0.18-3788ca3104-b5e61aa033.zip → ...data-npm-0.0.19-790e2b55e5-0bac33a47d.zip
Binary file not shown.
Binary file added
BIN
+1.81 MB
.yarn/cache/@daangn-react-monochrome-icon-npm-0.0.14-bd603e1ea2-c02ca32122.zip
Binary file not shown.
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,10 @@ | ||
import { IconFaceSmileCircleFill } from "@daangn/react-monochrome-icon"; | ||
import { ReactionButton } from "seed-design/ui/reaction-button"; | ||
|
||
export default function ReactionButtonDisabled() { | ||
return ( | ||
<ReactionButton prefixIcon={<IconFaceSmileCircleFill />} disabled> | ||
비활성 | ||
</ReactionButton> | ||
); | ||
} |
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,30 @@ | ||
"use client"; | ||
|
||
import { IconFaceSmileCircleFill } from "@daangn/react-monochrome-icon"; | ||
import { useState } from "react"; | ||
import { ReactionButton } from "seed-design/ui/reaction-button"; | ||
|
||
export default function ReactionButtonLoading() { | ||
const [pressed, setPressed] = useState(false); | ||
const [loading, setLoading] = useState(false); | ||
|
||
function handleToggle() { | ||
setLoading(true); | ||
setTimeout(() => { | ||
setLoading(false); | ||
setPressed((prev) => !prev); | ||
}, 2000); | ||
} | ||
|
||
// 이벤트 핸들링이 필요할 수 있으므로 loading은 disabled를 포함하지 않습니다. 이벤트 발생을 원하지 않는 경우, disabled 속성을 추가해주세요. | ||
return ( | ||
<ReactionButton | ||
prefixIcon={<IconFaceSmileCircleFill />} | ||
loading={loading} | ||
pressed={pressed} | ||
onPressedChange={handleToggle} | ||
> | ||
시간이 걸리는 토글 | ||
</ReactionButton> | ||
); | ||
} |
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,10 @@ | ||
import { IconFaceSmileCircleFill } from "@daangn/react-monochrome-icon"; | ||
import { ReactionButton } from "seed-design/ui/reaction-button"; | ||
|
||
export default function ReactionButtonPreview() { | ||
return ( | ||
<ReactionButton prefixIcon={<IconFaceSmileCircleFill />} count={1}> | ||
도움돼요 | ||
</ReactionButton> | ||
); | ||
} |
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,10 @@ | ||
import { IconFaceSmileCircleFill } from "@daangn/react-monochrome-icon"; | ||
import { ReactionButton } from "seed-design/ui/reaction-button"; | ||
|
||
export default function ReactionButtonSmall() { | ||
return ( | ||
<ReactionButton prefixIcon={<IconFaceSmileCircleFill />} size="small" count={1}> | ||
도움돼요 | ||
</ReactionButton> | ||
); | ||
} |
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,10 @@ | ||
import { IconFaceSmileCircleFill } from "@daangn/react-monochrome-icon"; | ||
import { ReactionButton } from "seed-design/ui/reaction-button"; | ||
|
||
export default function ReactionButtonXsmall() { | ||
return ( | ||
<ReactionButton prefixIcon={<IconFaceSmileCircleFill />} size="xsmall" count={1}> | ||
도움돼요 | ||
</ReactionButton> | ||
); | ||
} |
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 @@ | ||
--- | ||
title: Reaction Button | ||
description: TBD | ||
--- | ||
|
||
<SanityGuideline title="Reaction Button" /> | ||
|
||
## 옵션 테이블 | ||
|
||
| 속성 | 값 | 기본값 | | ||
| ----------- | ------------------------- | --------- | | ||
| size | xsmall, small | small | | ||
| disabled | true, false | false | | ||
| loading | true, false | false | | ||
| prefix icon | icon | | | ||
| count | number | | | ||
|
||
## 링크 | ||
|
||
<Cards> | ||
<Card | ||
icon={<AtomIcon />} | ||
title="React" | ||
description="Reaction Button 컴포넌트를 React로 사용하는 방법을 설명합니다." | ||
href="/docs/react/components/reaction-button" | ||
/> | ||
</Cards> | ||
|
||
## Spec | ||
|
||
<ComponentSpecBlock id="reaction-button" /> |
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 @@ | ||
--- | ||
title: Reaction Button | ||
--- | ||
|
||
<ComponentExample name="reaction-button-preview" /> | ||
|
||
## 설치 | ||
|
||
<Installation name="reaction-button" /> | ||
|
||
## Props | ||
|
||
<ReactTypeTable path="./registry/ui/reaction-button.tsx" name="ReactionButtonProps" /> | ||
|
||
## 예제 | ||
|
||
### Small | ||
|
||
<ComponentExample name="reaction-button-small" /> | ||
|
||
### Xsmall | ||
|
||
<ComponentExample name="reaction-button-xsmall" /> | ||
|
||
### Disabled | ||
|
||
<ComponentExample name="reaction-button-disabled" /> | ||
|
||
### Loading | ||
|
||
<ComponentExample name="reaction-button-loading" /> |
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 @@ | ||
{ | ||
"name": "reaction-button", | ||
"dependencies": [ | ||
"@radix-ui/react-slot", | ||
"@seed-design/react-toggle" | ||
], | ||
"registries": [ | ||
{ | ||
"name": "reaction-button.tsx", | ||
"type": "ui", | ||
"content": "\"use client\";\n\nimport \"@seed-design/stylesheet/progressCircle.css\";\nimport \"@seed-design/stylesheet/reactionButton.css\";\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { useToggle, type UseToggleProps } from \"@seed-design/react-toggle\";\nimport {\n reactionButton,\n type ReactionButtonVariantProps,\n} from \"@seed-design/recipe/reactionButton\";\nimport clsx from \"clsx\";\nimport * as React from \"react\";\nimport { ProgressCircle } from \"./progress-circle\";\n\nexport interface ReactionButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n UseToggleProps,\n ReactionButtonVariantProps {\n prefixIcon?: React.ReactNode;\n\n count?: number;\n\n loading?: boolean;\n\n /**\n * @default false\n */\n asChild?: boolean;\n}\n\n/**\n * @see https://v3.seed-design.io/docs/react/components/reaction-button\n */\nexport const ReactionButton = React.forwardRef<\n HTMLButtonElement,\n ReactionButtonProps\n>(\n (\n {\n className,\n size = \"small\",\n children,\n prefixIcon,\n count,\n loading = false,\n asChild = false,\n ...otherProps\n },\n ref,\n ) => {\n const Comp = asChild ? Slot : \"button\";\n const { rootProps, stateProps, restProps } = useToggle(otherProps);\n const classNames = reactionButton({ size });\n const dataProps = {\n ...stateProps,\n \"data-loading\": loading ? \"\" : undefined,\n };\n\n return (\n <Comp\n ref={ref}\n className={clsx(classNames.root, className)}\n {...dataProps}\n {...rootProps}\n {...restProps}\n >\n {prefixIcon && (\n <Slot aria-hidden {...dataProps} className={classNames.prefixIcon}>\n {prefixIcon}\n </Slot>\n )}\n <span {...dataProps} className={classNames.label}>\n {children}\n </span>\n <span {...dataProps} className={classNames.count}>\n {count}\n </span>\n {loading ? (\n <ProgressCircle\n {...dataProps}\n className={classNames.progressCircle}\n />\n ) : null}\n </Comp>\n );\n },\n);\nReactionButton.displayName = \"ReactionButton\";\n" | ||
} | ||
] | ||
} |
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,141 @@ | ||
{ | ||
"kind": "ComponentSpec", | ||
"metadata": { | ||
"id": "reaction-button", | ||
"name": "Reaction Button" | ||
}, | ||
"data": { | ||
"base": { | ||
"enabled": { | ||
"root": { | ||
"color": "$color.bg.neutral-weak", | ||
"colorDuration": "$duration.s4", | ||
"colorTimingFunction": "$timing-function.easing" | ||
}, | ||
"label": { | ||
"color": "$color.fg.neutral", | ||
"fontWeight": "$font-weight.medium" | ||
}, | ||
"count": { | ||
"color": "$color.fg.neutral", | ||
"fontWeight": "$font-weight.bold" | ||
}, | ||
"prefixIcon": { | ||
"color": "$color.fg.neutral" | ||
}, | ||
"progressCircle": { | ||
"trackColor": "$color.palette.gray-500", | ||
"rangeColor": "$color.fg.neutral" | ||
} | ||
}, | ||
"pressed": { | ||
"root": { | ||
"color": "$color.bg.neutral-weak-pressed" | ||
} | ||
}, | ||
"selected": { | ||
"root": { | ||
"color": "$color.bg.layer-default", | ||
"strokeColor": "$color.stroke.brand", | ||
"strokeWidth": "1px" | ||
}, | ||
"label": { | ||
"color": "$color.fg.brand" | ||
}, | ||
"count": { | ||
"color": "$color.fg.brand" | ||
}, | ||
"prefixIcon": { | ||
"color": "$color.fg.brand" | ||
}, | ||
"progressCircle": { | ||
"trackColor": "$color.palette.carrot-200", | ||
"rangeColor": "$color.fg.brand" | ||
} | ||
}, | ||
"selected,pressed": { | ||
"root": { | ||
"color": "$color.bg.layer-default-pressed" | ||
} | ||
}, | ||
"disabled": { | ||
"root": { | ||
"color": "$color.bg.disabled", | ||
"strokeWidth": "0px" | ||
}, | ||
"label": { | ||
"color": "$color.fg.disabled" | ||
}, | ||
"count": { | ||
"color": "$color.fg.disabled" | ||
}, | ||
"prefixIcon": { | ||
"color": "$color.fg.disabled" | ||
} | ||
}, | ||
"loading": { | ||
"root": { | ||
"color": "$color.bg.neutral-weak-pressed" | ||
} | ||
}, | ||
"selected,loading": { | ||
"root": { | ||
"color": "$color.bg.layer-default-pressed", | ||
"strokeWidth": "1px" | ||
} | ||
} | ||
}, | ||
"size=xsmall": { | ||
"enabled": { | ||
"root": { | ||
"minHeight": "$unit.s8", | ||
"cornerRadius": "$radius.full", | ||
"gap": "$unit.s1", | ||
"paddingX": "$unit.s3", | ||
"paddingY": "$unit.s1_5" | ||
}, | ||
"prefixIcon": { | ||
"size": "18px" | ||
}, | ||
"label": { | ||
"fontSize": "$font-size.s3", | ||
"lineHeight": "$line-height.s3" | ||
}, | ||
"count": { | ||
"fontSize": "$font-size.s3", | ||
"lineHeight": "$line-height.s3" | ||
}, | ||
"progressCircle": { | ||
"size": "14px", | ||
"thickness": "2px" | ||
} | ||
} | ||
}, | ||
"size=small": { | ||
"enabled": { | ||
"root": { | ||
"minHeight": "$unit.s9", | ||
"cornerRadius": "$radius.full", | ||
"gap": "$unit.s1", | ||
"paddingX": "$unit.s3_5", | ||
"paddingY": "$unit.s2" | ||
}, | ||
"prefixIcon": { | ||
"size": "18px" | ||
}, | ||
"label": { | ||
"fontSize": "$font-size.s3", | ||
"lineHeight": "$line-height.s3" | ||
}, | ||
"count": { | ||
"fontSize": "$font-size.s3", | ||
"lineHeight": "$line-height.s3" | ||
}, | ||
"progressCircle": { | ||
"size": "14px", | ||
"thickness": "2px" | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.