@team-monolith/cds 1.34.2 → 1.34.4
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { ButtonHTMLAttributes } from "react";
|
|
2
2
|
import { PolymorphicProps } from "@mui/base";
|
|
3
3
|
export type SquareButtonColor = "danger" | "primary" | "grey" | "icon" | "black" | "white";
|
|
4
4
|
export type SquareButtonSize = "large" | "medium" | "small" | "xsmall";
|
|
@@ -7,6 +7,8 @@ export interface SquareButtonOwnProps<RootComponentType extends React.ElementTyp
|
|
|
7
7
|
component?: RootComponentType;
|
|
8
8
|
/** 비활성화 여부 */
|
|
9
9
|
disabled?: boolean;
|
|
10
|
+
/** 버튼의 타입 */
|
|
11
|
+
type?: ButtonHTMLAttributes<RootComponentType>["type"];
|
|
10
12
|
/** 컴포넌트 색상 */
|
|
11
13
|
color: SquareButtonColor;
|
|
12
14
|
/** 컴포넌트 크기 */
|
|
@@ -159,7 +159,7 @@ const SIZE_TO_LABEL_STYLE = {
|
|
|
159
159
|
* [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=22-374&t=kTLv3t86qtGalHSS-0)
|
|
160
160
|
*/
|
|
161
161
|
const SquareButton = React.forwardRef(function SquareButton(props, ref) {
|
|
162
|
-
const { className, component: Component = "span", disabled, color, size, icon, label, fullWidth, onClick } = props, other = __rest(props, ["className", "component", "disabled", "color", "size", "icon", "label", "fullWidth", "onClick"]);
|
|
162
|
+
const { className, component: Component = "span", disabled, type = "button", color, size, icon, label, fullWidth, onClick } = props, other = __rest(props, ["className", "component", "disabled", "type", "color", "size", "icon", "label", "fullWidth", "onClick"]);
|
|
163
163
|
return (_jsxs(Component, Object.assign({}, other, { ref: ref, className: className, css: css `
|
|
164
164
|
display: flex;
|
|
165
165
|
flex-direction: column;
|
|
@@ -167,7 +167,7 @@ const SquareButton = React.forwardRef(function SquareButton(props, ref) {
|
|
|
167
167
|
gap: 8px;
|
|
168
168
|
|
|
169
169
|
width: ${fullWidth ? "100%" : "fit-content"};
|
|
170
|
-
` }, { children: [_jsx(Button, Object.assign({ type:
|
|
170
|
+
` }, { children: [_jsx(Button, Object.assign({ type: type, color: color, size: size, disabled: disabled, fullWidth: fullWidth, onClick: onClick }, { children: icon })), label && (_jsx(Label, Object.assign({ disabled: disabled, size: size }, { children: label })))] })));
|
|
171
171
|
});
|
|
172
172
|
const Button = styled.button `
|
|
173
173
|
border-radius: 8px;
|