@team-monolith/cds 0.16.0 → 0.17.1

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.
@@ -44,11 +44,11 @@ var CHECKBOX_ICON_STYLE = function (theme, type, disabled) {
44
44
  * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=36-907&t=G4t39O7uXZvsGQ9u-0)
45
45
  */
46
46
  var CheckboxInput = React.forwardRef(function (props, ref) {
47
- var className = props.className, checked = props.checked, label = props.label, spacer = props.spacer, disabled = props.disabled, partial = props.partial, onChange = props.onChange, onClick = props.onClick, other = __rest(props, ["className", "checked", "label", "spacer", "disabled", "partial", "onChange", "onClick"]);
47
+ var className = props.className, checked = props.checked, label = props.label, spacer = props.spacer, disabled = props.disabled, partial = props.partial, onChange = props.onChange, onClick = props.onClick, inputProps = props.inputProps, other = __rest(props, ["className", "checked", "label", "spacer", "disabled", "partial", "onChange", "onClick", "inputProps"]);
48
48
  if (!label) {
49
49
  return _jsx(Checkbox, __assign({}, props, { ref: ref }));
50
50
  }
51
- var checkboxProps = { checked: checked, spacer: spacer, disabled: disabled, partial: partial, onChange: onChange };
51
+ var checkboxProps = { checked: checked, spacer: spacer, disabled: disabled, partial: partial, onChange: onChange, inputProps: inputProps };
52
52
  return (_jsxs(Label, __assign({ className: className, ref: ref }, other, { children: [_jsx(Checkbox, __assign({}, checkboxProps)), _jsx("span", __assign({ css: css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n margin-left: 8px;\n "], ["\n margin-left: 8px;\n "]))) }, { children: label }))] })));
53
53
  });
54
54
  var Checkbox = React.forwardRef(function (props, ref) {
@@ -1,9 +1,10 @@
1
1
  import React from "react";
2
+ import { PolymorphicProps } from "@mui/base";
2
3
  export type SquareButtonColor = "danger" | "primary" | "secondary" | "icon";
3
4
  export type SquareButtonSize = "large" | "medium" | "small" | "xsmall";
4
- export interface SquareButtonProps {
5
+ export interface SquareButtonOwnProps<RootComponentType extends React.ElementType> {
5
6
  className?: string;
6
- component?: React.ElementType;
7
+ component?: RootComponentType;
7
8
  /** 비활성화 여부 */
8
9
  disabled?: boolean;
9
10
  /** 컴포넌트 색상 */
@@ -19,8 +20,14 @@ export interface SquareButtonProps {
19
20
  /** 버튼 클릭 시 호출될 콜백 함수 */
20
21
  onClick?: () => void;
21
22
  }
23
+ export type SquareButtonProps<RootComponentType extends React.ElementType = SquareButtonTypeMap["defaultComponent"]> = PolymorphicProps<SquareButtonTypeMap<RootComponentType>, RootComponentType>;
24
+ export interface SquareButtonTypeMap<RootComponentType extends React.ElementType = "span"> {
25
+ props: SquareButtonOwnProps<RootComponentType>;
26
+ defaultComponent: RootComponentType;
27
+ }
28
+ type SquareButtonComponent = <RootComponentType extends React.ElementType = "span">(props: SquareButtonProps<RootComponentType>) => React.ReactElement | null;
22
29
  /**
23
30
  * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=22-374&t=kTLv3t86qtGalHSS-0)
24
31
  */
25
- declare const SquareButton: React.ForwardRefExoticComponent<SquareButtonProps & React.RefAttributes<any>>;
32
+ declare const SquareButton: SquareButtonComponent;
26
33
  export default SquareButton;
@@ -53,7 +53,7 @@ var SIZE_TO_LABEL_STYLE = {
53
53
  /**
54
54
  * [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=22-374&t=kTLv3t86qtGalHSS-0)
55
55
  */
56
- var SquareButton = React.forwardRef(function (props, ref) {
56
+ var SquareButton = React.forwardRef(function SquareButton(props, ref) {
57
57
  var className = props.className, _a = props.component, Component = _a === void 0 ? "span" : _a, disabled = props.disabled, color = props.color, size = props.size, icon = props.icon, label = props.label, fullWidth = props.fullWidth, onClick = props.onClick, other = __rest(props, ["className", "component", "disabled", "color", "size", "icon", "label", "fullWidth", "onClick"]);
58
58
  return (_jsxs(Component, __assign({}, other, { ref: ref, className: className, css: css(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n\n width: ", ";\n "], ["\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n\n width: ", ";\n "])), fullWidth ? "100%" : "fit-content") }, { children: [_jsx(Button, __assign({ type: "button", color: color, size: size, disabled: disabled, fullWidth: fullWidth, onClick: onClick }, { children: icon })), label && (_jsx(Label, __assign({ disabled: disabled, size: size }, { children: label })))] })));
59
59
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,