@team-monolith/cds 1.99.10 → 1.99.11
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.
|
@@ -191,7 +191,7 @@ export const SquareButton = React.forwardRef(function SquareButton(props, ref) {
|
|
|
191
191
|
SIZE_TO_BUTTON_STYLE[size],
|
|
192
192
|
css `
|
|
193
193
|
border: none;
|
|
194
|
-
|
|
194
|
+
${fullWidth && `width: 100%;`}
|
|
195
195
|
${disabled || loading
|
|
196
196
|
? css `
|
|
197
197
|
cursor: default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { InputHTMLAttributes } from "react";
|
|
2
2
|
export type SwitchSize = "small" | "large";
|
|
3
3
|
export interface SwitchProps {
|
|
4
4
|
className?: string;
|
|
@@ -11,6 +11,8 @@ export interface SwitchProps {
|
|
|
11
11
|
size: SwitchSize;
|
|
12
12
|
/** 스위치 상태 변경 시 호출될 콜백 함수 */
|
|
13
13
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
|
|
14
|
+
/** HTML input 태그에 전달될 props */
|
|
15
|
+
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
14
16
|
}
|
|
15
17
|
/**
|
|
16
18
|
* [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=36-1577&t=9sDLb4XIOdmF2VMc-0)
|
|
@@ -19,8 +19,8 @@ import { css } from "@emotion/react";
|
|
|
19
19
|
* [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=36-1577&t=9sDLb4XIOdmF2VMc-0)
|
|
20
20
|
*/
|
|
21
21
|
export const Switch = React.forwardRef(function Switch(props, ref) {
|
|
22
|
-
const { className, checked, disabled = false, size, onChange } = props, other = __rest(props, ["className", "checked", "disabled", "size", "onChange"]);
|
|
23
|
-
return (_jsx(StyledSwitch, Object.assign({}, other, { ref: ref, className: className, checked: checked, disabled: disabled, onChange: onChange, switchSize: size })));
|
|
22
|
+
const { className, checked, disabled = false, size, onChange, inputProps } = props, other = __rest(props, ["className", "checked", "disabled", "size", "onChange", "inputProps"]);
|
|
23
|
+
return (_jsx(StyledSwitch, Object.assign({}, other, { ref: ref, className: className, checked: checked, disabled: disabled, onChange: onChange, switchSize: size, inputProps: inputProps })));
|
|
24
24
|
});
|
|
25
25
|
const SIZE_TO_SWTICH_SIZE = {
|
|
26
26
|
large: {
|
|
@@ -30,7 +30,6 @@ export const SegmentedControlButton = React.forwardRef(function SegmentedControl
|
|
|
30
30
|
const isActive = context.multiSelect
|
|
31
31
|
? context.value.includes(props.value)
|
|
32
32
|
: context.value === props.value;
|
|
33
|
-
const { label } = other;
|
|
34
33
|
return (_jsx(StyledButton, Object.assign({}, other, { ref: ref, startIcon: typeof startIcon === "function" ? startIcon(isActive) : startIcon, endIcon: typeof endIcon === "function" ? endIcon(isActive) : endIcon, isActive: isActive, color: isActive ? "white" : "textNeutral", size: context.size, onClick: handleClick, disabled: context.disabled || props.disabled, "aria-selected": isActive ? "true" : undefined })));
|
|
35
34
|
});
|
|
36
35
|
const StyledButton = styled(Button, {
|