@team-monolith/cds 1.44.0 → 1.44.2

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.
@@ -22,7 +22,7 @@ export interface SquareButtonOwnProps<RootComponentType extends React.ElementTyp
22
22
  /** 로딩 여부 */
23
23
  loading?: boolean;
24
24
  /** 버튼 클릭 시 호출될 콜백 함수 */
25
- onClick?: () => void;
25
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
26
26
  }
27
27
  export type SquareButtonProps<RootComponentType extends React.ElementType = SquareButtonTypeMap["defaultComponent"]> = PolymorphicProps<SquareButtonTypeMap<RootComponentType>, RootComponentType>;
28
28
  export interface SquareButtonTypeMap<RootComponentType extends React.ElementType = "span"> {
@@ -65,7 +65,12 @@ export default function SegmentedInput(props) {
65
65
  ? "activeDanger"
66
66
  : focusedIndex === i
67
67
  ? "activePrimary"
68
- : "default", inputProps: {
68
+ : "default", css: isCorrect === false &&
69
+ css `
70
+ input {
71
+ color: ${theme.color.foreground.danger};
72
+ }
73
+ `, inputProps: {
69
74
  readOnly,
70
75
  onFocus: () => {
71
76
  var _a, _b;
@@ -75,9 +80,6 @@ export default function SegmentedInput(props) {
75
80
  (_a = hiddenRef.current) === null || _a === void 0 ? void 0 : _a.focus();
76
81
  (_b = hiddenRef.current) === null || _b === void 0 ? void 0 : _b.setSelectionRange(i, i);
77
82
  },
78
- color: isCorrect === false
79
- ? theme.color.foreground.danger
80
- : undefined,
81
83
  }, value: splitedValues[i] || "", onChange: () => { } }, i))) })), _jsx(InputMarker, {})] }), _jsx(Text, { children: placeholder })] }));
82
84
  }
83
85
  const Container = styled.div `
@@ -22,10 +22,10 @@ import { SegmentedControlGroupPropsContext, } from "./SegmentedControlGroupProps
22
22
  export const SegmentedControlSquareButton = React.forwardRef(function SegmentedControlSquareButton(props, ref) {
23
23
  const { onClick, icon } = props, other = __rest(props, ["onClick", "icon"]);
24
24
  const context = useContext(SegmentedControlGroupPropsContext);
25
- const handleClick = () => {
25
+ const handleClick = (e) => {
26
26
  var _a;
27
27
  (_a = context.onClick) === null || _a === void 0 ? void 0 : _a.call(context, props.value);
28
- onClick === null || onClick === void 0 ? void 0 : onClick();
28
+ onClick === null || onClick === void 0 ? void 0 : onClick(e);
29
29
  };
30
30
  const isActive = context.multiSelect
31
31
  ? context.value.includes(props.value)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-monolith/cds",
3
- "version": "1.44.0",
3
+ "version": "1.44.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "sideEffects": false,