@team-monolith/cds 0.30.2 → 0.30.3
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,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { EditorCore } from "@react-editor-js/core";
|
|
2
3
|
export interface ReactEditorJSProps {
|
|
3
4
|
className?: string;
|
|
@@ -12,4 +13,4 @@ export interface ReactEditorJSProps {
|
|
|
12
13
|
/** 초기화시 콜백 */
|
|
13
14
|
onInitialize?: (instance: EditorCore) => void;
|
|
14
15
|
}
|
|
15
|
-
export declare function ReactEditorJS(props: ReactEditorJSProps):
|
|
16
|
+
export declare function ReactEditorJS(props: ReactEditorJSProps): JSX.Element;
|
|
@@ -11,6 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
13
13
|
/** @jsxImportSource @emotion/react */
|
|
14
|
+
import styled from "@emotion/styled";
|
|
14
15
|
import { css } from "@emotion/react";
|
|
15
16
|
import React, { useContext } from "react";
|
|
16
17
|
import { SegmentedControlGroupPropsContext } from "./SegmentedControlGroupPropsContext";
|
|
@@ -29,10 +30,22 @@ export const SegmentedControlButton = React.forwardRef(function SegmentedControl
|
|
|
29
30
|
const isActive = context.multiSelect
|
|
30
31
|
? context.value.includes(props.value)
|
|
31
32
|
: context.value === props.value;
|
|
32
|
-
return (_jsx(
|
|
33
|
-
display: flex;
|
|
34
|
-
justify-content: center;
|
|
35
|
-
flex-grow: 1;
|
|
36
|
-
${isActive && `box-shadow: ${shadows.shadow04};`}
|
|
37
|
-
` }, other, { ref: ref, color: isActive ? "white" : "textNeutral", size: context.size, onClick: handleClick })));
|
|
33
|
+
return (_jsx(StyledButton, Object.assign({}, other, { ref: ref, isActive: isActive, color: isActive ? "white" : "textNeutral", size: context.size, onClick: handleClick })));
|
|
38
34
|
});
|
|
35
|
+
const StyledButton = styled(Button, {
|
|
36
|
+
shouldForwardProp: (prop) => prop !== "isActive",
|
|
37
|
+
})(({ theme, isActive }) => css `
|
|
38
|
+
display: flex;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
flex-grow: 1;
|
|
41
|
+
${isActive &&
|
|
42
|
+
`
|
|
43
|
+
box-shadow: ${shadows.shadow04};
|
|
44
|
+
svg {
|
|
45
|
+
color: ${theme.color.foreground.primary};
|
|
46
|
+
}
|
|
47
|
+
span {
|
|
48
|
+
font-weight: 700;
|
|
49
|
+
}
|
|
50
|
+
`}
|
|
51
|
+
`);
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
2
13
|
/** @jsxImportSource @emotion/react */
|
|
3
14
|
import styled from "@emotion/styled";
|
|
15
|
+
import { css } from "@emotion/react";
|
|
4
16
|
import { useContext } from "react";
|
|
5
17
|
import { shadows, SquareButton } from "../..";
|
|
6
18
|
import { SegmentedControlGroupPropsContext } from "./SegmentedControlGroupPropsContext";
|
|
@@ -9,25 +21,32 @@ import React from "react";
|
|
|
9
21
|
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A89883)
|
|
10
22
|
*/
|
|
11
23
|
export const SegmentedControlSquareButton = React.forwardRef(function SegmentedControlSquareButton(props, ref) {
|
|
24
|
+
const { onClick } = props, other = __rest(props, ["onClick"]);
|
|
12
25
|
const context = useContext(SegmentedControlGroupPropsContext);
|
|
26
|
+
const handleClick = () => {
|
|
27
|
+
var _a;
|
|
28
|
+
(_a = context.onClick) === null || _a === void 0 ? void 0 : _a.call(context, props.value);
|
|
29
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
30
|
+
};
|
|
13
31
|
const isActive = context.multiSelect
|
|
14
32
|
? context.value.includes(props.value)
|
|
15
33
|
: context.value === props.value;
|
|
16
|
-
return (_jsx(StyledSquareButton, Object.assign({},
|
|
17
|
-
var _a;
|
|
18
|
-
if (context.onClick) {
|
|
19
|
-
context.onClick(props.value);
|
|
20
|
-
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
21
|
-
}
|
|
22
|
-
} })));
|
|
34
|
+
return (_jsx(StyledSquareButton, Object.assign({}, other, { ref: ref, isActive: isActive, color: isActive ? "white" : "icon", size: context.size, fullWidth: context.fullWidth, onClick: handleClick })));
|
|
23
35
|
});
|
|
24
36
|
const StyledSquareButton = styled(SquareButton, {
|
|
25
37
|
shouldForwardProp: (prop) => prop !== "isActive",
|
|
26
|
-
}) `
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
})(({ theme, isActive }) => css `
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
flex-grow: 1;
|
|
42
|
+
${isActive &&
|
|
43
|
+
`
|
|
44
|
+
box-shadow: ${shadows.shadow04};
|
|
45
|
+
svg {
|
|
46
|
+
color: ${theme.color.foreground.primary};
|
|
47
|
+
}
|
|
48
|
+
span {
|
|
49
|
+
font-weight: 700;
|
|
50
|
+
}
|
|
51
|
+
`}
|
|
52
|
+
`);
|