@team-monolith/cds 1.4.8 → 1.5.0
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.
- package/README.md +4 -4
- package/dist/components/SquareButton.d.ts +1 -1
- package/dist/icons/Custom.d.ts +37 -46
- package/dist/icons/Custom.js +4 -15
- package/dist/icons/custom/judge-color.svg +4 -4
- package/dist/icons/custom/judge.svg +1 -1
- package/dist/icons/custom/material.svg +5 -4
- package/dist/icons/custom/resource.svg +5 -5
- package/dist/patterns/LexicalEditor/LexicalEditor.d.ts +1 -1
- package/dist/patterns/LexicalEditor/plugins/ImagesPlugin/InsertImageDialog.d.ts +1 -2
- package/dist/patterns/LexicalEditor/plugins/ImagesPlugin/InsertImageDialog.js +76 -7
- package/dist/patterns/LexicalEditor/plugins/ImagesPlugin/InsertImageUploadedDialogBody.d.ts +5 -2
- package/dist/patterns/LexicalEditor/plugins/ImagesPlugin/InsertImageUploadedDialogBody.js +14 -12
- package/dist/patterns/LexicalEditor/plugins/ImagesPlugin/InsertImageUriDialogBody.d.ts +5 -2
- package/dist/patterns/LexicalEditor/plugins/ImagesPlugin/InsertImageUriDialogBody.js +7 -11
- package/dist/patterns/ReactEditorJS/ReactEditorJS.d.ts +1 -2
- package/dist/patterns/SegmentedControl/SegmentedControlButton.js +6 -19
- package/dist/patterns/SegmentedControl/SegmentedControlSquareButton.d.ts +1 -1
- package/dist/patterns/SegmentedControl/SegmentedControlSquareButton.js +17 -35
- package/package.json +1 -1
- package/dist/icons/custom/quiz-color.svg +0 -12
- package/dist/icons/custom/quiz.svg +0 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<
|
|
3
|
-
<path
|
|
4
|
-
<path d="
|
|
5
|
-
<path d="
|
|
2
|
+
<rect x="1.5" y="1.5" width="21" height="21" rx="10" fill="#ECF3FF"/>
|
|
3
|
+
<path d="M17.1114 5.25H7.26359C6.97994 5.25 6.75 5.47395 6.75 5.7502V18.9998C6.75 19.2761 6.97994 19.5 7.26359 19.5H17.1114C17.3951 19.5 17.625 19.2761 17.625 18.9998V5.7502C17.625 5.47395 17.3951 5.25 17.1114 5.25Z" fill="#C5DBFF"/>
|
|
4
|
+
<path d="M15.1912 7.12494H9.18378C8.46096 7.12494 7.875 7.71242 7.875 8.43711V8.43776C7.875 9.16246 8.46096 9.74994 9.18378 9.74994H15.1912C15.914 9.74994 16.5 9.16246 16.5 8.43776V8.43711C16.5 7.71242 15.914 7.12494 15.1912 7.12494Z" fill="#82ACE8"/>
|
|
5
|
+
<path d="M15.7961 11.25H8.57891C8.39726 11.25 8.25 11.4179 8.25 11.625C8.25 11.8321 8.39726 12 8.57891 12H15.7961C15.9777 12 16.125 11.8321 16.125 11.625C16.125 11.4179 15.9777 11.25 15.7961 11.25Z" fill="#82ACE8"/>
|
|
6
|
+
<path d="M11.8931 13.8287L8.73224 12.4227C8.66206 12.3911 8.58466 12.375 8.50595 12.375H5.76424C5.48023 12.375 5.25 12.5843 5.25 12.8425V19.0325C5.25 19.2907 5.48023 19.5 5.76424 19.5H18.2358C18.5198 19.5 18.75 19.2907 18.75 19.0325V14.3439C18.75 14.0857 18.5198 13.8764 18.2358 13.8764H12.1194C12.0413 13.8764 11.9639 13.8603 11.8931 13.8287Z" fill="#5599FF"/>
|
|
6
7
|
</svg>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<g clip-path="url(#
|
|
3
|
-
<path
|
|
4
|
-
<path d="
|
|
2
|
+
<g clip-path="url(#clip0_358_3211)">
|
|
3
|
+
<path d="M11.8576 13.0612L7.64236 11.0937C7.54909 11.0499 7.446 11.0264 7.34127 11.0264H3.68564C3.30764 11.0264 3 11.3191 3 11.6807V20.3457C3 20.7073 3.30764 21 3.68564 21H20.3144C20.6924 21 21 20.7073 21 20.3457V13.7828C21 13.4212 20.6924 13.1285 20.3144 13.1285H12.1587C12.054 13.1285 11.9509 13.1066 11.8576 13.0612Z" fill="#363636"/>
|
|
4
|
+
<path d="M7.34127 9.37983C7.446 9.37983 7.54909 9.40174 7.64236 9.44713L11.8576 11.4146C11.9525 11.4584 12.0556 11.4819 12.1587 11.4819H19.0085V3.63235C19.0085 3.2833 18.7124 3 18.3458 3H5.65418C5.28927 3 4.99146 3.2833 4.99146 3.63235V9.37983H7.34127Z" fill="#363636"/>
|
|
5
5
|
</g>
|
|
6
6
|
<defs>
|
|
7
|
-
<clipPath id="
|
|
8
|
-
<rect width="
|
|
7
|
+
<clipPath id="clip0_358_3211">
|
|
8
|
+
<rect width="18" height="18" fill="white" transform="translate(3 3)"/>
|
|
9
9
|
</clipPath>
|
|
10
10
|
</defs>
|
|
11
11
|
</svg>
|
|
@@ -11,4 +11,4 @@ export interface LexicalEditorProps {
|
|
|
11
11
|
/** 외부에서 플러그인을 주입하는 경우 활용함 */
|
|
12
12
|
children?: JSX.Element | string | (JSX.Element | string)[];
|
|
13
13
|
}
|
|
14
|
-
export declare function LexicalEditor(props: LexicalEditorProps): JSX.Element;
|
|
14
|
+
export declare function LexicalEditor(props: LexicalEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { LexicalEditor } from "lexical";
|
|
3
2
|
export interface InsertImageDialogProps {
|
|
4
3
|
open: boolean;
|
|
5
4
|
activeEditor: LexicalEditor;
|
|
6
5
|
onClose: () => void;
|
|
7
6
|
}
|
|
8
|
-
export declare function InsertImageDialog(props: InsertImageDialogProps): JSX.Element;
|
|
7
|
+
export declare function InsertImageDialog(props: InsertImageDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,32 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
1
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useRef, useState } from "react";
|
|
11
|
+
import { useContext, useEffect, useRef, useState } from "react";
|
|
3
12
|
import { INSERT_IMAGE_COMMAND } from ".";
|
|
4
13
|
import { InsertImageUriDialogBody } from "./InsertImageUriDialogBody";
|
|
5
14
|
import { InsertImageUploadedDialogBody } from "./InsertImageUploadedDialogBody";
|
|
6
15
|
import styled from "@emotion/styled";
|
|
7
|
-
import { AlertDialog, AlertDialogContent, AlertDialogTitle } from "../../../../components/AlertDialog";
|
|
8
|
-
import { ImageFillIcon } from "../../../../icons";
|
|
16
|
+
import { AlertDialog, AlertDialogContent, AlertDialogTitle, } from "../../../../components/AlertDialog";
|
|
17
|
+
import { ImageFillIcon, LinkIcon, UploadLineIcon } from "../../../../icons";
|
|
9
18
|
import Button from "../../../../components/Button";
|
|
19
|
+
import { useTheme } from "@emotion/react";
|
|
20
|
+
import { CodleDesignSystemContext } from "../../../../CodleDesignSystemProvider";
|
|
10
21
|
export function InsertImageDialog(props) {
|
|
11
22
|
const { open, activeEditor, onClose } = props;
|
|
23
|
+
const theme = useTheme();
|
|
12
24
|
const [mode, setMode] = useState(null);
|
|
13
25
|
const hasModifier = useRef(false);
|
|
26
|
+
const inputRef = useRef(null);
|
|
27
|
+
const cdsContext = useContext(CodleDesignSystemContext);
|
|
28
|
+
const [src, setSrc] = useState("");
|
|
29
|
+
const [altText, setAltText] = useState("");
|
|
14
30
|
useEffect(() => {
|
|
15
31
|
hasModifier.current = false;
|
|
16
32
|
const handler = (e) => {
|
|
@@ -23,17 +39,70 @@ export function InsertImageDialog(props) {
|
|
|
23
39
|
}, [activeEditor]);
|
|
24
40
|
const onClick = (payload) => {
|
|
25
41
|
activeEditor.dispatchCommand(INSERT_IMAGE_COMMAND, payload);
|
|
26
|
-
|
|
42
|
+
handleOnClose();
|
|
27
43
|
};
|
|
28
44
|
const handleOnClose = () => {
|
|
29
45
|
setMode(null);
|
|
46
|
+
setSrc("");
|
|
47
|
+
setAltText("");
|
|
30
48
|
onClose();
|
|
31
49
|
};
|
|
32
|
-
return (_jsxs(
|
|
50
|
+
return (_jsxs(StyledAlertDialog, Object.assign({ icon: _jsx(ImageFillIcon, { color: theme.color.background.primary }), open: open, onClose: handleOnClose, disableIconPadding: true }, { children: [_jsx(StyledAlertDialogTitle, Object.assign({ onClose: handleOnClose }, { children: "\uC774\uBBF8\uC9C0 \uC0BD\uC785\uD558\uAE30" })), !mode && (_jsx(AlertDialogContent, { children: _jsxs(Buttons, { children: [_jsxs(ButtonAndDescription, { children: [_jsx(Description, { children: "\uC774\uBBF8\uC9C0 URL\uC744 \uC54C\uACE0 \uC788\uB2E4\uBA74" }), _jsx(Button, { color: "grey", size: "medium", fullWidth: true, label: "URL\uB85C \uC0BD\uC785\uD558\uAE30", startIcon: _jsx(LinkIcon, {}), onClick: () => setMode("url") })] }), _jsxs(ButtonAndDescription, { children: [_jsx(Description, { children: "\uAC16\uACE0 \uC788\uB294 \uC774\uBBF8\uC9C0\uB97C \uC0BD\uC785\uD558\uACE0 \uC2F6\uB2E4\uBA74" }), _jsx(Button, { color: "grey", size: "medium", fullWidth: true, label: "\uD30C\uC77C \uC120\uD0DD\uD558\uAE30", startIcon: _jsx(UploadLineIcon, {}), onClick: () => {
|
|
51
|
+
var _a;
|
|
52
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
53
|
+
} }), _jsx(HiddenInput, { ref: inputRef, type: "file", accept: "image/*", onChange: (event) => __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
const file = (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
56
|
+
if (!file)
|
|
57
|
+
return;
|
|
58
|
+
const uploadByFile = (_b = cdsContext.lexical) === null || _b === void 0 ? void 0 : _b.uploadByFile;
|
|
59
|
+
if (uploadByFile) {
|
|
60
|
+
setSrc(yield uploadByFile(file));
|
|
61
|
+
setMode("file");
|
|
62
|
+
}
|
|
63
|
+
}) })] })] }) })), mode === "url" && (_jsx(InsertImageUriDialogBody, { src: src, setSrc: setSrc, altText: altText, setAltText: setAltText, onClick: onClick })), mode === "file" && (_jsx(InsertImageUploadedDialogBody, { src: src, setSrc: setSrc, altText: altText, setAltText: setAltText, onClick: onClick }))] })));
|
|
33
64
|
}
|
|
65
|
+
const StyledAlertDialog = styled(AlertDialog) `
|
|
66
|
+
gap: 16px;
|
|
67
|
+
`;
|
|
68
|
+
const StyledAlertDialogTitle = styled(AlertDialogTitle) `
|
|
69
|
+
color: ${({ theme }) => theme.color.foreground.neutralBase};
|
|
70
|
+
text-align: center;
|
|
71
|
+
|
|
72
|
+
/* Default/Heading/20px-Bd */
|
|
73
|
+
font-family: ${({ theme }) => theme.fontFamily.ui};
|
|
74
|
+
font-size: 20px;
|
|
75
|
+
font-style: normal;
|
|
76
|
+
font-weight: 700;
|
|
77
|
+
line-height: 28px; /* 140% */
|
|
78
|
+
letter-spacing: 0.25px;
|
|
79
|
+
`;
|
|
34
80
|
const Buttons = styled.div `
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: flex-start;
|
|
83
|
+
gap: 8px;
|
|
84
|
+
|
|
85
|
+
// Actions가 없는 경우 하단이 디자인과 맞지 않는다
|
|
86
|
+
margin-bottom: -16px;
|
|
87
|
+
`;
|
|
88
|
+
const ButtonAndDescription = styled.div `
|
|
35
89
|
display: flex;
|
|
36
90
|
flex-direction: column;
|
|
37
|
-
|
|
38
|
-
gap:
|
|
91
|
+
align-items: center;
|
|
92
|
+
gap: 8px;
|
|
93
|
+
flex: 1 0 0;
|
|
94
|
+
`;
|
|
95
|
+
const Description = styled.div `
|
|
96
|
+
color: ${({ theme }) => theme.color.foreground.neutralBaseDisabled};
|
|
97
|
+
text-align: center;
|
|
98
|
+
|
|
99
|
+
/* Default/Label/12px-Md */
|
|
100
|
+
font-family: ${({ theme }) => theme.fontFamily.ui};
|
|
101
|
+
font-size: 12px;
|
|
102
|
+
font-style: normal;
|
|
103
|
+
font-weight: 500;
|
|
104
|
+
line-height: 16px; /* 133.333% */
|
|
105
|
+
`;
|
|
106
|
+
const HiddenInput = styled.input `
|
|
107
|
+
display: none;
|
|
39
108
|
`;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { InsertImagePayload } from ".";
|
|
3
2
|
export interface InsertImageUploadedDialogBodyProps {
|
|
3
|
+
src: string;
|
|
4
|
+
setSrc: (src: string) => void;
|
|
5
|
+
altText: string;
|
|
6
|
+
setAltText: (altText: string) => void;
|
|
4
7
|
onClick: (payload: InsertImagePayload) => void;
|
|
5
8
|
}
|
|
6
|
-
export declare function InsertImageUploadedDialogBody(props: InsertImageUploadedDialogBodyProps): JSX.Element;
|
|
9
|
+
export declare function InsertImageUploadedDialogBody(props: InsertImageUploadedDialogBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,23 +8,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
|
-
import { useContext, useRef
|
|
11
|
+
import { useContext, useRef } from "react";
|
|
12
12
|
import styled from "@emotion/styled";
|
|
13
13
|
import { CodleDesignSystemContext } from "../../../../CodleDesignSystemProvider";
|
|
14
|
-
import { AlertDialogContent, AlertDialogActions } from "../../../../components/AlertDialog";
|
|
14
|
+
import { AlertDialogContent, AlertDialogActions, } from "../../../../components/AlertDialog";
|
|
15
15
|
import Button from "../../../../components/Button";
|
|
16
16
|
import Input from "../../../../components/Input";
|
|
17
|
+
import { RefreshLineIcon } from "../../../../icons";
|
|
17
18
|
export function InsertImageUploadedDialogBody(props) {
|
|
18
|
-
const { onClick } = props;
|
|
19
|
-
const [src, setSrc] = useState("");
|
|
20
|
-
const [altText, setAltText] = useState("");
|
|
19
|
+
const { src, setSrc, altText, setAltText, onClick } = props;
|
|
21
20
|
const inputRef = useRef(null);
|
|
22
21
|
const cdsContext = useContext(CodleDesignSystemContext);
|
|
23
22
|
const isDisabled = src === "";
|
|
24
|
-
return (_jsxs(_Fragment, { children: [_jsx(AlertDialogContent, { children: _jsxs(Inputs, { children: [_jsx(Button, { fullWidth: true, color: "grey", size: "medium", label: "\uD30C\uC77C \
|
|
23
|
+
return (_jsxs(_Fragment, { children: [_jsx(AlertDialogContent, { children: _jsxs(Inputs, { children: [_jsx(Button, { fullWidth: true, color: "grey", size: "medium", label: "\uD30C\uC77C \uBC14\uAFB8\uAE30", onClick: () => {
|
|
25
24
|
var _a;
|
|
26
25
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
27
|
-
} }), _jsx(HiddenInput, { ref: inputRef, type: "file", accept: "image/*", onChange: (event) => __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
}, startIcon: _jsx(RefreshLineIcon, {}) }), _jsx(HiddenInput, { ref: inputRef, type: "file", accept: "image/*", onChange: (event) => __awaiter(this, void 0, void 0, function* () {
|
|
28
27
|
var _a, _b;
|
|
29
28
|
const file = (_a = event.target.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
30
29
|
if (!file)
|
|
@@ -33,17 +32,20 @@ export function InsertImageUploadedDialogBody(props) {
|
|
|
33
32
|
if (uploadByFile) {
|
|
34
33
|
setSrc(yield uploadByFile(file));
|
|
35
34
|
}
|
|
36
|
-
}) }), _jsx(Input, { fullWidth: true, label: "\
|
|
35
|
+
}) }), _jsxs(ImagePreview, { children: ["\uC774\uBBF8\uC9C0 \uBBF8\uB9AC\uBCF4\uAE30", _jsx("img", { src: src, alt: altText })] }), _jsx(Input, { fullWidth: true, label: "\uB300\uCCB4 \uD14D\uC2A4\uD2B8", placeholder: "\uC0BD\uC785\uD558\uB294 \uC774\uBBF8\uC9C0\uC5D0 \uAD00\uD55C \uC124\uBA85", color: "default", size: "medium", onChange: (e) => {
|
|
37
36
|
setAltText(e.target.value);
|
|
38
|
-
}, value: altText })] }) }), _jsx(AlertDialogActions, { children: _jsx(Button, { label: "\
|
|
37
|
+
}, value: altText })] }) }), _jsx(AlertDialogActions, { children: _jsx(Button, { fullWidth: true, label: "\uC0BD\uC785\uD558\uAE30", size: "medium", color: "primary", disabled: isDisabled, onClick: () => onClick({ altText, src }) }) })] }));
|
|
39
38
|
}
|
|
40
39
|
const Inputs = styled.div `
|
|
41
40
|
display: flex;
|
|
42
41
|
flex-direction: column;
|
|
43
|
-
gap:
|
|
44
|
-
margin-top: 20px;
|
|
45
|
-
margin-bottom: 10px;
|
|
42
|
+
gap: 16px;
|
|
46
43
|
`;
|
|
47
44
|
const HiddenInput = styled.input `
|
|
48
45
|
display: none;
|
|
49
46
|
`;
|
|
47
|
+
const ImagePreview = styled.div `
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-direction: column;
|
|
50
|
+
gap: 8px;
|
|
51
|
+
`;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { InsertImagePayload } from ".";
|
|
3
2
|
export interface InsertImageUriDialogBodyProps {
|
|
3
|
+
src: string;
|
|
4
|
+
setSrc: (src: string) => void;
|
|
5
|
+
altText: string;
|
|
6
|
+
setAltText: (altText: string) => void;
|
|
4
7
|
onClick: (payload: InsertImagePayload) => void;
|
|
5
8
|
}
|
|
6
|
-
export declare function InsertImageUriDialogBody(props: InsertImageUriDialogBodyProps): JSX.Element;
|
|
9
|
+
export declare function InsertImageUriDialogBody(props: InsertImageUriDialogBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
3
2
|
import styled from "@emotion/styled";
|
|
4
|
-
import { AlertDialogContent,
|
|
3
|
+
import { AlertDialogActions, AlertDialogContent, } from "../../../../components/AlertDialog";
|
|
5
4
|
import Input from "../../../../components/Input";
|
|
5
|
+
import { LinkIcon } from "../../../../icons";
|
|
6
6
|
import Button from "../../../../components/Button";
|
|
7
7
|
export function InsertImageUriDialogBody(props) {
|
|
8
|
-
const { onClick } = props;
|
|
9
|
-
const [src, setSrc] = useState("");
|
|
10
|
-
const [altText, setAltText] = useState("");
|
|
8
|
+
const { src, setSrc, altText, setAltText, onClick } = props;
|
|
11
9
|
const isDisabled = src === "";
|
|
12
|
-
return (_jsxs(_Fragment, { children: [_jsx(AlertDialogContent, { children: _jsxs(Inputs, { children: [_jsx(Input, { fullWidth: true, label: "URL", placeholder: "https://
|
|
10
|
+
return (_jsxs(_Fragment, { children: [" ", _jsx(AlertDialogContent, { children: _jsxs(Inputs, { children: [_jsx(Input, { fullWidth: true, label: "URL", placeholder: "https://www.pexels.com/photo/n-2848492/", color: "default", size: "medium", onChange: (e) => {
|
|
13
11
|
setSrc(e.target.value);
|
|
14
|
-
}, value: src }), _jsx(Input, { fullWidth: true, label: "\
|
|
12
|
+
}, value: src, startIcon: _jsx(LinkIcon, {}) }), _jsx(Input, { fullWidth: true, label: "\uB300\uCCB4 \uD14D\uC2A4\uD2B8", placeholder: "\uC0BD\uC785\uD558\uB294 \uC774\uBBF8\uC9C0\uC5D0 \uAD00\uD55C \uC124\uBA85", color: "default", size: "medium", onChange: (e) => {
|
|
15
13
|
setAltText(e.target.value);
|
|
16
|
-
}, value: altText })] }) }), _jsx(AlertDialogActions, { children: _jsx(Button, { label: "\
|
|
14
|
+
}, value: altText })] }) }), _jsx(AlertDialogActions, { children: _jsx(Button, { fullWidth: true, label: "\uC0BD\uC785\uD558\uAE30", size: "medium", color: "primary", disabled: isDisabled, onClick: () => onClick({ altText, src }) }) })] }));
|
|
17
15
|
}
|
|
18
16
|
const Inputs = styled.div `
|
|
19
17
|
display: flex;
|
|
20
18
|
flex-direction: column;
|
|
21
|
-
gap:
|
|
22
|
-
margin-top: 20px;
|
|
23
|
-
margin-bottom: 10px;
|
|
19
|
+
gap: 16px;
|
|
24
20
|
`;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { EditorCore } from "@react-editor-js/core";
|
|
3
2
|
export interface ReactEditorJSProps {
|
|
4
3
|
className?: string;
|
|
@@ -13,4 +12,4 @@ export interface ReactEditorJSProps {
|
|
|
13
12
|
/** 초기화시 콜백 */
|
|
14
13
|
onInitialize?: (instance: EditorCore) => void;
|
|
15
14
|
}
|
|
16
|
-
export declare function ReactEditorJS(props: ReactEditorJSProps): JSX.Element;
|
|
15
|
+
export declare function ReactEditorJS(props: ReactEditorJSProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,7 +11,6 @@ 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";
|
|
15
14
|
import { css } from "@emotion/react";
|
|
16
15
|
import React, { useContext } from "react";
|
|
17
16
|
import { SegmentedControlGroupPropsContext } from "./SegmentedControlGroupPropsContext";
|
|
@@ -30,22 +29,10 @@ export const SegmentedControlButton = React.forwardRef(function SegmentedControl
|
|
|
30
29
|
const isActive = context.multiSelect
|
|
31
30
|
? context.value.includes(props.value)
|
|
32
31
|
: context.value === props.value;
|
|
33
|
-
return (_jsx(
|
|
32
|
+
return (_jsx(Button, Object.assign({ css: css `
|
|
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 })));
|
|
34
38
|
});
|
|
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,51 +1,33 @@
|
|
|
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
|
-
};
|
|
12
1
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
13
2
|
/** @jsxImportSource @emotion/react */
|
|
14
3
|
import styled from "@emotion/styled";
|
|
15
|
-
import {
|
|
16
|
-
import React, { useContext } from "react";
|
|
4
|
+
import { useContext } from "react";
|
|
17
5
|
import { shadows, SquareButton } from "../..";
|
|
18
6
|
import { SegmentedControlGroupPropsContext } from "./SegmentedControlGroupPropsContext";
|
|
7
|
+
import React from "react";
|
|
19
8
|
/**
|
|
20
9
|
* [피그마](https://www.figma.com/file/PnQp3tPxiCjgsPZfLUaUL1/Codle-PD-Kit---Patterns?node-id=181%3A89883)
|
|
21
10
|
*/
|
|
22
11
|
export const SegmentedControlSquareButton = React.forwardRef(function SegmentedControlSquareButton(props, ref) {
|
|
23
|
-
const { onClick } = props, other = __rest(props, ["onClick"]);
|
|
24
12
|
const context = useContext(SegmentedControlGroupPropsContext);
|
|
25
|
-
const handleClick = () => {
|
|
26
|
-
var _a;
|
|
27
|
-
(_a = context.onClick) === null || _a === void 0 ? void 0 : _a.call(context, props.value);
|
|
28
|
-
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
29
|
-
};
|
|
30
13
|
const isActive = context.multiSelect
|
|
31
14
|
? context.value.includes(props.value)
|
|
32
15
|
: context.value === props.value;
|
|
33
|
-
return (_jsx(StyledSquareButton, Object.assign({},
|
|
16
|
+
return (_jsx(StyledSquareButton, Object.assign({}, props, { ref: ref, isActive: isActive, color: isActive ? "primary" : "icon", size: context.size, fullWidth: context.fullWidth, onClick: () => {
|
|
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
23
|
});
|
|
35
24
|
const StyledSquareButton = styled(SquareButton, {
|
|
36
25
|
shouldForwardProp: (prop) => prop !== "isActive",
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
`
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
color: ${theme.color.foreground.primary};
|
|
46
|
-
}
|
|
47
|
-
span {
|
|
48
|
-
font-weight: 700;
|
|
49
|
-
}
|
|
50
|
-
`}
|
|
51
|
-
`);
|
|
26
|
+
}) `
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
flex-grow: 1;
|
|
30
|
+
button {
|
|
31
|
+
${({ isActive }) => isActive && `box-shadow: ${shadows.shadow04};`}
|
|
32
|
+
}
|
|
33
|
+
`;
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<g clip-path="url(#clip0_296_4038)">
|
|
3
|
-
<path d="M19.5238 19.81C19.5238 20.3913 19.2927 20.9478 18.8819 21.3584C18.4712 21.7691 17.9137 22.0002 17.3333 22.0002H4.19048C3.60913 22.0002 3.05258 21.7691 2.64186 21.3584C2.23115 20.9478 2 20.3903 2 19.81V6.09309C2 5.5118 2.23115 4.95531 2.64186 4.54463C3.05258 4.13396 3.61012 3.90283 4.19048 3.90283H17.3333C17.9147 3.90283 18.4712 4.13396 18.8819 4.54463C19.2927 4.95531 19.5238 5.51279 19.5238 6.09309V19.81C19.5238 20.3913 19.2927 20.9478 18.8819 21.3584C18.4712 21.7691 17.9137 22.0002 17.3333 22.0002" fill="#FBEAF3"/>
|
|
4
|
-
<path d="M21.9999 17.9072C21.9999 18.4884 21.7687 19.0449 21.358 19.4556C20.9473 19.8663 20.3898 20.0974 19.8094 20.0974H6.66655C6.0852 20.0974 5.52865 19.8663 5.11794 19.4556C4.70723 19.0449 4.47607 18.4875 4.47607 17.9072V4.19026C4.47607 3.60897 4.70723 3.05247 5.11794 2.6418C5.52865 2.23113 6.08619 2 6.66655 2H19.8094C20.3908 2 20.9473 2.23113 21.358 2.6418C21.7687 3.05247 21.9999 3.60996 21.9999 4.19026V17.9072C21.9999 18.4884 21.7687 19.0449 21.358 19.4556C20.9473 19.8663 20.3898 20.0974 19.8094 20.0974" fill="#F889AA"/>
|
|
5
|
-
<path d="M17.2836 14.917C18.4152 13.8846 19.0484 12.3944 19.0484 10.7363C19.0484 7.62109 16.8132 5.09766 13.2381 5.09766C9.66292 5.09766 7.42773 7.62274 7.42773 10.7363C7.42773 13.8499 9.66292 16.375 13.2381 16.375C14.044 16.375 14.7805 16.246 15.4394 16.0113L16.0651 16.9064C16.118 16.9833 16.2147 17.0172 16.304 16.9916L18.0341 16.494C18.1011 16.4742 18.1556 16.4237 18.1796 16.3568C18.2028 16.2907 18.1928 16.2171 18.1523 16.1584L17.2836 14.917ZM13.2381 13.6656C11.3815 13.6656 10.2192 12.3539 10.2192 10.7363C10.2192 9.11878 11.3798 7.80706 13.2381 7.80706C15.0963 7.80706 16.2569 9.11878 16.2569 10.7363C16.2569 11.4331 16.0403 12.0728 15.6468 12.5762L14.8864 11.4885C14.8326 11.4124 14.7367 11.3777 14.6475 11.4033L12.9165 11.9009C12.8496 11.9208 12.795 11.9712 12.771 12.0381C12.7479 12.1042 12.7578 12.1778 12.7983 12.2365L13.7696 13.6251C13.6001 13.6499 13.4241 13.6656 13.2381 13.6656Z" fill="#FBEAF3"/>
|
|
6
|
-
</g>
|
|
7
|
-
<defs>
|
|
8
|
-
<clipPath id="clip0_296_4038">
|
|
9
|
-
<rect width="20" height="20" fill="white" transform="translate(2 2)"/>
|
|
10
|
-
</clipPath>
|
|
11
|
-
</defs>
|
|
12
|
-
</svg>
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.3773 18.3971C21.7758 18.0113 22 17.4886 22 16.9426V4.05744C22 3.51233 21.7758 2.98865 21.3773 2.60288C20.9789 2.21711 20.439 2 19.875 2H7.125C6.56199 2 6.02112 2.21711 5.62268 2.60288C5.22424 2.98865 5 3.5114 5 4.05744V16.9426C5 17.4877 5.22424 18.0113 5.62268 18.3971C6.02112 18.7829 6.56103 19 7.125 19H19.875C20.438 19 20.9789 18.7829 21.3773 18.3971ZM19 10.1849C19 11.8566 18.4006 13.359 17.3294 14.3998L18.1518 15.6515C18.1901 15.7107 18.1995 15.7848 18.1776 15.8515C18.1549 15.919 18.1033 15.9698 18.0399 15.9898L16.4022 16.4915C16.3177 16.5173 16.2261 16.4832 16.1761 16.4057L15.5837 15.5032C14.9601 15.7398 14.2629 15.8698 13.5 15.8698C10.1158 15.8698 8 13.324 8 10.1849C8 7.04579 10.1158 4.5 13.5 4.5C16.8842 4.5 19 7.04413 19 10.1849ZM10.6424 10.1849C10.6424 11.8157 11.7426 13.1382 13.5 13.1382C13.6761 13.1382 13.8427 13.1224 14.0031 13.0974L13.0837 11.6974C13.0454 11.6382 13.036 11.5641 13.0579 11.4974C13.0806 11.4299 13.1322 11.3791 13.1956 11.3591L14.8341 10.8574C14.9186 10.8316 15.0094 10.8666 15.0603 10.9432L15.7801 12.0399C16.1526 11.5324 16.3576 10.8874 16.3576 10.1849C16.3576 8.55411 15.259 7.23163 13.5 7.23163C11.741 7.23163 10.6424 8.55411 10.6424 10.1849Z" fill="#363636"/>
|
|
3
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M3 3C3.55228 3 4 3.44772 4 4V18C4 19.1046 4.89543 20 6 20H20C20.5523 20 21 20.4477 21 21C21 21.5523 20.5523 22 20 22H6C3.79086 22 2 20.2091 2 18V4C2 3.44772 2.44772 3 3 3Z" fill="#363636"/>
|
|
4
|
-
</svg>
|