@team-monolith/cds 0.2.12 → 0.3.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/package.json +1 -1
- package/src/cds/components/Button.tsx +0 -5
- package/src/cds/components/Input.tsx +7 -2
- package/src/cds/foundation/shadows.ts +1 -1
- package/dist/CodleDesignSystemProvider.d.ts +0 -69
- package/dist/CodleDesignSystemProvider.js +0 -96
- package/dist/components/AlertDialog/AlertDialog.d.ts +0 -14
- package/dist/components/AlertDialog/AlertDialog.js +0 -45
- package/dist/components/AlertDialog/AlertDialogActions.d.ts +0 -8
- package/dist/components/AlertDialog/AlertDialogActions.js +0 -35
- package/dist/components/AlertDialog/AlertDialogContent.d.ts +0 -8
- package/dist/components/AlertDialog/AlertDialogContent.js +0 -36
- package/dist/components/AlertDialog/AlertDialogTitle.d.ts +0 -13
- package/dist/components/AlertDialog/AlertDialogTitle.js +0 -38
- package/dist/components/AlertDialog/index.d.ts +0 -4
- package/dist/components/AlertDialog/index.js +0 -4
- package/dist/components/Banner.d.ts +0 -29
- package/dist/components/Banner.js +0 -65
- package/dist/components/Button.d.ts +0 -33
- package/dist/components/Button.js +0 -72
- package/dist/components/CheckboxInput.d.ts +0 -27
- package/dist/components/CheckboxInput.js +0 -77
- package/dist/components/Input.d.ts +0 -17
- package/dist/components/Input.js +0 -72
- package/dist/components/InputBase.d.ts +0 -42
- package/dist/components/InputBase.js +0 -52
- package/dist/components/Pagination.d.ts +0 -27
- package/dist/components/Pagination.js +0 -32
- package/dist/components/PinInput.d.ts +0 -36
- package/dist/components/PinInput.js +0 -154
- package/dist/components/RadioInput.d.ts +0 -23
- package/dist/components/RadioInput.js +0 -78
- package/dist/components/SquareButton.d.ts +0 -26
- package/dist/components/SquareButton.js +0 -80
- package/dist/components/Switch.d.ts +0 -19
- package/dist/components/Switch.js +0 -59
- package/dist/components/Tag.d.ts +0 -21
- package/dist/components/Tag.js +0 -61
- package/dist/components/Tooltip.d.ts +0 -26
- package/dist/components/Tooltip.js +0 -50
- package/dist/foundation/color.d.ts +0 -75
- package/dist/foundation/color.js +0 -75
- package/dist/foundation/shadows.d.ts +0 -9
- package/dist/foundation/shadows.js +0 -10
- package/dist/icons/Arrows/index.d.ts +0 -2
- package/dist/icons/Arrows/index.js +0 -2
- package/dist/icons/Media/index.d.ts +0 -2
- package/dist/icons/Media/index.js +0 -2
- package/dist/icons/System/index.d.ts +0 -2
- package/dist/icons/System/index.js +0 -2
- package/dist/icons/arrows.d.ts +0 -28
- package/dist/icons/arrows.js +0 -21
- package/dist/icons/brand.d.ts +0 -4
- package/dist/icons/brand.js +0 -13
- package/dist/icons/design.d.ts +0 -4
- package/dist/icons/design.js +0 -13
- package/dist/icons/map.d.ts +0 -4
- package/dist/icons/map.js +0 -13
- package/dist/icons/system.d.ts +0 -31
- package/dist/icons/system.js +0 -22
- package/dist/index.d.ts +0 -44
- package/dist/index.js +0 -44
- package/dist/patterns/Card/Card.d.ts +0 -39
- package/dist/patterns/Card/Card.js +0 -68
- package/dist/patterns/Card/class-icon.svg +0 -28
- package/dist/patterns/Card/index.d.ts +0 -2
- package/dist/patterns/Card/index.js +0 -2
- package/dist/patterns/Card/material-icon.svg +0 -25
- package/dist/patterns/Card/problem-icon.svg +0 -25
- package/dist/patterns/Card/thumbnail/sample.png +0 -0
- package/dist/patterns/Dialog/Dialog.d.ts +0 -12
- package/dist/patterns/Dialog/Dialog.js +0 -26
- package/dist/patterns/Dialog/DialogContent.d.ts +0 -8
- package/dist/patterns/Dialog/DialogContent.js +0 -23
- package/dist/patterns/Dialog/DialogNavigation.d.ts +0 -12
- package/dist/patterns/Dialog/DialogNavigation.js +0 -25
- package/dist/patterns/Dialog/DialogNavigationContext.d.ts +0 -5
- package/dist/patterns/Dialog/DialogNavigationContext.js +0 -5
- package/dist/patterns/Dialog/DialogNavigationItem.d.ts +0 -10
- package/dist/patterns/Dialog/DialogNavigationItem.js +0 -25
- package/dist/patterns/Dialog/DialogPanel.d.ts +0 -10
- package/dist/patterns/Dialog/DialogPanel.js +0 -31
- package/dist/patterns/Dialog/DialogPanels.d.ts +0 -13
- package/dist/patterns/Dialog/DialogPanels.js +0 -17
- package/dist/patterns/Dialog/DialogPanelsContext.d.ts +0 -5
- package/dist/patterns/Dialog/DialogPanelsContext.js +0 -5
- package/dist/patterns/Dialog/DialogTitle.d.ts +0 -13
- package/dist/patterns/Dialog/DialogTitle.js +0 -26
- package/dist/patterns/Dialog/index.d.ts +0 -7
- package/dist/patterns/Dialog/index.js +0 -7
- package/dist/patterns/Dropdown/Dropdown.d.ts +0 -27
- package/dist/patterns/Dropdown/Dropdown.js +0 -41
- package/dist/patterns/Dropdown/DropdownItem.d.ts +0 -42
- package/dist/patterns/Dropdown/DropdownItem.js +0 -89
- package/dist/patterns/Dropdown/DropdownMenu.d.ts +0 -30
- package/dist/patterns/Dropdown/DropdownMenu.js +0 -85
- package/dist/patterns/Dropdown/index.d.ts +0 -2
- package/dist/patterns/Dropdown/index.js +0 -2
- package/dist/patterns/EmptyState/EmptyState.d.ts +0 -16
- package/dist/patterns/EmptyState/EmptyState.js +0 -36
- package/dist/patterns/EmptyState/empty-state-icon.svg +0 -36
- package/dist/patterns/EmptyState/index.d.ts +0 -2
- package/dist/patterns/EmptyState/index.js +0 -2
- package/dist/patterns/Navigation/NavigationContext.d.ts +0 -5
- package/dist/patterns/Navigation/NavigationContext.js +0 -5
- package/dist/patterns/Navigation/NavigationHorizontal.d.ts +0 -11
- package/dist/patterns/Navigation/NavigationHorizontal.js +0 -27
- package/dist/patterns/Navigation/NavigationItem.d.ts +0 -9
- package/dist/patterns/Navigation/NavigationItem.js +0 -33
- package/dist/patterns/Navigation/NavigationVertical.d.ts +0 -14
- package/dist/patterns/Navigation/NavigationVertical.js +0 -27
- package/dist/patterns/Navigation/index.d.ts +0 -3
- package/dist/patterns/Navigation/index.js +0 -3
- package/dist/patterns/SegmentedControl/SegmentedControlButton.d.ts +0 -8
- package/dist/patterns/SegmentedControl/SegmentedControlButton.js +0 -41
- package/dist/patterns/SegmentedControl/SegmentedControlGroup.d.ts +0 -26
- package/dist/patterns/SegmentedControl/SegmentedControlGroup.js +0 -50
- package/dist/patterns/SegmentedControl/SegmentedControlGroupPropsContext.d.ts +0 -5
- package/dist/patterns/SegmentedControl/SegmentedControlGroupPropsContext.js +0 -5
- package/dist/patterns/SegmentedControl/SegmentedControlSquareButton.d.ts +0 -8
- package/dist/patterns/SegmentedControl/SegmentedControlSquareButton.js +0 -45
- package/dist/patterns/SegmentedControl/index.d.ts +0 -3
- package/dist/patterns/SegmentedControl/index.js +0 -3
- package/dist/patterns/Table/Table.d.ts +0 -18
- package/dist/patterns/Table/Table.js +0 -33
- package/dist/patterns/Table/TableBody.d.ts +0 -8
- package/dist/patterns/Table/TableBody.js +0 -26
- package/dist/patterns/Table/TableCell.d.ts +0 -15
- package/dist/patterns/Table/TableCell.js +0 -78
- package/dist/patterns/Table/TableHead.d.ts +0 -8
- package/dist/patterns/Table/TableHead.js +0 -26
- package/dist/patterns/Table/TablePropsContext.d.ts +0 -7
- package/dist/patterns/Table/TablePropsContext.js +0 -3
- package/dist/patterns/Table/TableRow.d.ts +0 -14
- package/dist/patterns/Table/TableRow.js +0 -34
- package/dist/patterns/Table/TableVariantContext.d.ts +0 -6
- package/dist/patterns/Table/TableVariantContext.js +0 -3
- package/dist/patterns/Table/index.d.ts +0 -7
- package/dist/patterns/Table/index.js +0 -6
- package/dist/utils/hover.d.ts +0 -3
- package/dist/utils/hover.js +0 -14
- package/dist/utils/reset.d.ts +0 -2
- package/dist/utils/reset.js +0 -8
- package/dist/utils/zIndex.d.ts +0 -3
- package/dist/utils/zIndex.js +0 -3
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
-
var t = {};
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
-
t[p[i]] = s[p[i]];
|
|
24
|
-
}
|
|
25
|
-
return t;
|
|
26
|
-
};
|
|
27
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
28
|
-
/** @jsxImportSource @emotion/react */
|
|
29
|
-
import { css, useTheme } from "@emotion/react";
|
|
30
|
-
import styled from "@emotion/styled";
|
|
31
|
-
import React from "react";
|
|
32
|
-
import { HOVER } from "../utils/hover";
|
|
33
|
-
var COLOR_TO_BUTTON_STYLE = function (theme, color) {
|
|
34
|
-
return ({
|
|
35
|
-
primary: css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: ", ";\n color: ", ";\n\n ", "\n &:disabled {\n background: ", ";\n }\n "], ["\n background: ", ";\n color: ", ";\n\n ", "\n &:disabled {\n background: ", ";\n }\n "])), theme.color.background.primary, theme.color.foreground.neutralAlt, HOVER(css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), theme.color.background.primaryActive)), theme.color.background.primaryDisabled),
|
|
36
|
-
secondary: css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background: ", ";\n color: ", ";\n\n ", "\n &:disabled {\n background: ", ";\n color: ", ";\n }\n "], ["\n background: ", ";\n color: ", ";\n\n ", "\n &:disabled {\n background: ", ";\n color: ", ";\n }\n "])), theme.color.background.neutralAlt, theme.color.foreground.neutralBase, HOVER(css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background: ", ";\n color: ", ";\n "], ["\n background: ", ";\n color: ", ";\n "])), theme.color.background.neutralAltActive, theme.color.foreground.neutralBase)), theme.color.background.neutralAlt, theme.color.foreground.neutralBaseDisabled),
|
|
37
|
-
danger: css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n background: ", ";\n color: ", ";\n\n ", "\n &:disabled {\n background: ", ";\n }\n "], ["\n background: ", ";\n color: ", ";\n\n ", "\n &:disabled {\n background: ", ";\n }\n "])), theme.color.background.danger, theme.color.foreground.neutralAlt, HOVER(css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background: ", ";\n "], ["\n background: ", ";\n "])), theme.color.background.dangerActive)), theme.color.background.dangerDisabled),
|
|
38
|
-
textNeutral: css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n background: none;\n color: ", ";\n\n ", "\n &:disabled {\n background: none;\n color: ", ";\n }\n "], ["\n background: none;\n color: ", ";\n\n ", "\n &:disabled {\n background: none;\n color: ", ";\n }\n "])), theme.color.foreground.neutralBase, HOVER(css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n background: ", ";\n color: ", ";\n "], ["\n background: ", ";\n color: ", ";\n "])), theme.color.background.neutralAltActive, theme.color.foreground.neutralBase)), theme.color.foreground.neutralBaseDisabled),
|
|
39
|
-
textDanger: css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n background: none;\n color: ", ";\n\n ", "\n &:disabled {\n background: none;\n color: ", ";\n }\n "], ["\n background: none;\n color: ", ";\n\n ", "\n &:disabled {\n background: none;\n color: ", ";\n }\n "])), theme.color.foreground.danger, HOVER(css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n background: ", ";\n color: ", ";\n "], ["\n background: ", ";\n color: ", ";\n "])), theme.color.background.neutralAltActive, theme.color.foreground.danger)), theme.color.foreground.dangerDisabled),
|
|
40
|
-
textPrimary: css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n background: none;\n color: ", ";\n\n ", "\n &:disabled {\n background: none;\n color: ", ";\n }\n "], ["\n background: none;\n color: ", ";\n\n ", "\n &:disabled {\n background: none;\n color: ", ";\n }\n "])), theme.color.foreground.primary, HOVER(css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n background: ", ";\n color: ", ";\n "], ["\n background: ", ";\n color: ", ";\n "])), theme.color.background.neutralAltActive, theme.color.foreground.primary)), theme.color.foreground.primaryDisabled),
|
|
41
|
-
}[color]);
|
|
42
|
-
};
|
|
43
|
-
var SIZE_TO_BUTTON_STYLE = {
|
|
44
|
-
large: css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n padding: 16px 20px;\n gap: 10px;\n\n svg {\n width: 24px;\n height: 24px;\n }\n "], ["\n padding: 16px 20px;\n gap: 10px;\n\n svg {\n width: 24px;\n height: 24px;\n }\n "]))),
|
|
45
|
-
medium: css(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n padding: 14px 16px;\n gap: 8px;\n\n svg {\n width: 20px;\n height: 20px;\n }\n "], ["\n padding: 14px 16px;\n gap: 8px;\n\n svg {\n width: 20px;\n height: 20px;\n }\n "]))),
|
|
46
|
-
small: css(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n padding: 10px 12px;\n gap: 8px;\n\n svg {\n width: 16px;\n height: 16px;\n }\n "], ["\n padding: 10px 12px;\n gap: 8px;\n\n svg {\n width: 16px;\n height: 16px;\n }\n "]))),
|
|
47
|
-
xsmall: css(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n padding: 6px 8px;\n gap: 4px;\n\n svg {\n width: 12px;\n height: 12px;\n }\n "], ["\n padding: 6px 8px;\n gap: 4px;\n\n svg {\n width: 12px;\n height: 12px;\n }\n "]))),
|
|
48
|
-
};
|
|
49
|
-
var SIZE_TO_LABEL_STYLE = {
|
|
50
|
-
large: css(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n font-size: 20px;\n line-height: 24px;\n "], ["\n font-size: 20px;\n line-height: 24px;\n "]))),
|
|
51
|
-
medium: css(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n font-size: 18px;\n line-height: 20px;\n "], ["\n font-size: 18px;\n line-height: 20px;\n "]))),
|
|
52
|
-
small: css(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n font-size: 14px;\n line-height: 16px;\n "], ["\n font-size: 14px;\n line-height: 16px;\n "]))),
|
|
53
|
-
xsmall: css(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n font-size: 14px;\n line-height: 16px;\n "], ["\n font-size: 14px;\n line-height: 16px;\n "]))),
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=20-173&t=cXcCv3QijbX7MkoC-0)
|
|
57
|
-
*/
|
|
58
|
-
var Button = React.forwardRef(function Button(props, ref) {
|
|
59
|
-
var className = props.className, _a = props.component, Component = _a === void 0 ? "button" : _a, disabled = props.disabled, color = props.color, size = props.size, startIcon = props.startIcon, endIcon = props.endIcon, label = props.label, onClick = props.onClick, other = __rest(props, ["className", "component", "disabled", "color", "size", "startIcon", "endIcon", "label", "onClick"]);
|
|
60
|
-
var theme = useTheme();
|
|
61
|
-
return (_jsxs(Component, __assign({}, other, { className: className, ref: ref, css: [
|
|
62
|
-
css(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n gap: 8px;\n\n border: none;\n border-radius: 8px;\n\n cursor: pointer;\n &:disabled {\n cursor: default;\n pointer-events: none;\n }\n\n font: inherit;\n text-decoration: none;\n "], ["\n display: inline-flex;\n align-items: center;\n gap: 8px;\n\n border: none;\n border-radius: 8px;\n\n cursor: pointer;\n &:disabled {\n cursor: default;\n pointer-events: none;\n }\n\n font: inherit;\n text-decoration: none;\n "]))),
|
|
63
|
-
COLOR_TO_BUTTON_STYLE(theme, color),
|
|
64
|
-
SIZE_TO_BUTTON_STYLE[size],
|
|
65
|
-
], disabled: disabled, onClick: onClick }, { children: [startIcon, _jsx(Label, __assign({ size: size }, { children: label })), endIcon] })));
|
|
66
|
-
});
|
|
67
|
-
var Label = styled.span(templateObject_22 || (templateObject_22 = __makeTemplateObject(["\n font-weight: 400;\n white-space: nowrap;\n ", "\n"], ["\n font-weight: 400;\n white-space: nowrap;\n ", "\n"])), function (_a) {
|
|
68
|
-
var size = _a.size;
|
|
69
|
-
return SIZE_TO_LABEL_STYLE[size];
|
|
70
|
-
});
|
|
71
|
-
export default Button;
|
|
72
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21, templateObject_22;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { InputHTMLAttributes } from "react";
|
|
3
|
-
export type CheckboxInputType = "default" | "checked" | "partial";
|
|
4
|
-
export interface CheckboxInputProps {
|
|
5
|
-
className?: string;
|
|
6
|
-
/** 체크박스의 체크 여부(Controlled) */
|
|
7
|
-
checked: boolean;
|
|
8
|
-
/** 체크박스의 라벨 */
|
|
9
|
-
label?: string;
|
|
10
|
-
/** 체크박스의 하단 마진(8px) 여부 */
|
|
11
|
-
spacer?: boolean;
|
|
12
|
-
/** 체크박스의 비활성화 여부 */
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
/** 체크박스의 partial 여부. 체크여부가 우선합니다. */
|
|
15
|
-
partial?: boolean;
|
|
16
|
-
/** 체크박스 값 변경시 호출되는 함수 */
|
|
17
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
18
|
-
/** 체크박스 클릭시 호출되는 함수 */
|
|
19
|
-
onClick?: (event: React.MouseEvent<HTMLInputElement>) => void;
|
|
20
|
-
/** HTML input 태그에 전달될 props */
|
|
21
|
-
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=36-907&t=G4t39O7uXZvsGQ9u-0)
|
|
25
|
-
*/
|
|
26
|
-
declare const CheckboxInput: React.ForwardRefExoticComponent<CheckboxInputProps & React.RefAttributes<any>>;
|
|
27
|
-
export default CheckboxInput;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
-
var t = {};
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
-
t[p[i]] = s[p[i]];
|
|
24
|
-
}
|
|
25
|
-
return t;
|
|
26
|
-
};
|
|
27
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
28
|
-
/** @jsxImportSource @emotion/react */
|
|
29
|
-
import { css, useTheme } from "@emotion/react";
|
|
30
|
-
import * as React from "react";
|
|
31
|
-
import styled from "@emotion/styled";
|
|
32
|
-
import { ZINDEX } from "../utils/zIndex";
|
|
33
|
-
var CHECKBOX_ICON_STYLE = function (theme, type, disabled) {
|
|
34
|
-
return {
|
|
35
|
-
default: css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n rect {\n fill: ", ";\n stroke: ", ";\n }\n ", "\n "], ["\n rect {\n fill: ", ";\n stroke: ", ";\n }\n ", "\n "])), theme.color.background.neutralBase, theme.color.background.neutralAltActive, disabled
|
|
36
|
-
? css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n rect {\n fill: ", ";\n stroke: ", ";\n }\n "], ["\n rect {\n fill: ", ";\n stroke: ", ";\n }\n "])), theme.color.background.neutralAlt, theme.color.background.neutralAltActive) : css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n input[type=\"checkbox\"]:hover + & {\n rect {\n stroke: ", ";\n }\n }\n "], ["\n input[type=\"checkbox\"]:hover + & {\n rect {\n stroke: ", ";\n }\n }\n "])), theme.color.background.primary)),
|
|
37
|
-
checked: css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n rect {\n fill: ", ";\n stroke: ", ";\n }\n path {\n fill: ", ";\n }\n ", "\n "], ["\n rect {\n fill: ", ";\n stroke: ", ";\n }\n path {\n fill: ", ";\n }\n ", "\n "])), theme.color.background.primary, theme.color.background.primary, theme.color.background.neutralBase, disabled
|
|
38
|
-
? css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n rect {\n fill: ", ";\n stroke: ", ";\n }\n path {\n fill: ", ";\n }\n "], ["\n rect {\n fill: ", ";\n stroke: ", ";\n }\n path {\n fill: ", ";\n }\n "])), theme.color.background.neutralAlt, theme.color.background.primaryDisabled, theme.color.background.primaryDisabled) : css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n input[type=\"checkbox\"]:hover + & {\n rect {\n fill: ", ";\n stroke: ", ";\n }\n }\n "], ["\n input[type=\"checkbox\"]:hover + & {\n rect {\n fill: ", ";\n stroke: ", ";\n }\n }\n "])), theme.color.background.primaryActive, theme.color.background.primaryActive)),
|
|
39
|
-
partial: css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n rect {\n fill: ", ";\n stroke: ", ";\n }\n rect + rect {\n fill: ", ";\n stroke: none;\n }\n ", "\n "], ["\n rect {\n fill: ", ";\n stroke: ", ";\n }\n rect + rect {\n fill: ", ";\n stroke: none;\n }\n ", "\n "])), theme.color.background.neutralBase, theme.color.background.primary, theme.color.background.primary, disabled
|
|
40
|
-
? css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n rect {\n fill: ", ";\n stroke: ", ";\n }\n rect + rect {\n fill: ", ";\n stroke: none;\n }\n "], ["\n rect {\n fill: ", ";\n stroke: ", ";\n }\n rect + rect {\n fill: ", ";\n stroke: none;\n }\n "])), theme.color.background.neutralAlt, theme.color.background.primaryDisabled, theme.color.background.primaryDisabled) : css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n input[type=\"checkbox\"]:hover + & {\n rect {\n stroke: ", ";\n }\n rect + rect {\n fill: ", ";\n stroke: none;\n }\n }\n "], ["\n input[type=\"checkbox\"]:hover + & {\n rect {\n stroke: ", ";\n }\n rect + rect {\n fill: ", ";\n stroke: none;\n }\n }\n "])), theme.color.background.primaryActive, theme.color.background.primaryActive)),
|
|
41
|
-
}[type];
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=36-907&t=G4t39O7uXZvsGQ9u-0)
|
|
45
|
-
*/
|
|
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"]);
|
|
48
|
-
if (!label) {
|
|
49
|
-
return _jsx(Checkbox, __assign({}, props, { ref: ref }));
|
|
50
|
-
}
|
|
51
|
-
var checkboxProps = { checked: checked, spacer: spacer, disabled: disabled, partial: partial, onChange: onChange };
|
|
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
|
-
});
|
|
54
|
-
var Checkbox = React.forwardRef(function (props, ref) {
|
|
55
|
-
var className = props.className, checked = props.checked, partial = props.partial, _a = props.disabled, disabled = _a === void 0 ? false : _a, _b = props.spacer, spacer = _b === void 0 ? false : _b, onChange = props.onChange, onClick = props.onClick, inputProps = props.inputProps, other = __rest(props, ["className", "checked", "partial", "disabled", "spacer", "onChange", "onClick", "inputProps"]);
|
|
56
|
-
var type = checked
|
|
57
|
-
? "checked"
|
|
58
|
-
: partial
|
|
59
|
-
? "partial"
|
|
60
|
-
: "default";
|
|
61
|
-
return (_jsxs(CheckboxContainer, __assign({ className: className, spacer: spacer, disabled: disabled, ref: ref }, other, { children: [_jsx(StyledInput, __assign({ type: "checkbox" }, inputProps, { checked: checked, disabled: disabled, onClick: onClick, onChange: onChange })), _jsx(CheckboxIcon, { type: type, disabled: disabled })] })));
|
|
62
|
-
});
|
|
63
|
-
var CheckboxContainer = styled.span(function (_a) {
|
|
64
|
-
var spacer = _a.spacer, disabled = _a.disabled;
|
|
65
|
-
return css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n display: inline-block;\n position: relative;\n width: 16px;\n height: 16px;\n cursor: ", ";\n margin-bottom: ", ";\n "], ["\n display: inline-block;\n position: relative;\n width: 16px;\n height: 16px;\n cursor: ", ";\n margin-bottom: ", ";\n "])), disabled ? "default" : "pointer", spacer ? "8px" : "0");
|
|
66
|
-
});
|
|
67
|
-
var StyledInput = styled.input(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n cursor: inherit;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n width: 16px;\n height: 16px;\n margin: 0;\n padding: 0;\n // input \uCEF4\uD3EC\uB10C\uD2B8\uB294 \uBCF4\uC774\uC9C0 \uC54A\uC9C0\uB9CC, \uD074\uB9AD\uC774 \uAC00\uB2A5\uD558\uAC8C z-index\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n z-index: ", ";\n"], ["\n cursor: inherit;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n width: 16px;\n height: 16px;\n margin: 0;\n padding: 0;\n // input \uCEF4\uD3EC\uB10C\uD2B8\uB294 \uBCF4\uC774\uC9C0 \uC54A\uC9C0\uB9CC, \uD074\uB9AD\uC774 \uAC00\uB2A5\uD558\uAC8C z-index\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n z-index: ", ";\n"])), ZINDEX.inputBase);
|
|
68
|
-
var Label = styled.label(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n display: flex;\n position: relative;\n width: fit-content;\n font-size: 14px;\n font-weight: 500;\n line-height: 16px;\n color: ", ";\n align-self: center;\n"], ["\n display: flex;\n position: relative;\n width: fit-content;\n font-size: 14px;\n font-weight: 500;\n line-height: 16px;\n color: ", ";\n align-self: center;\n"])), function (_a) {
|
|
69
|
-
var theme = _a.theme;
|
|
70
|
-
return theme.color.foreground.neutralBase;
|
|
71
|
-
});
|
|
72
|
-
var CheckboxIcon = function (props) {
|
|
73
|
-
var theme = useTheme();
|
|
74
|
-
return (_jsxs("svg", __assign({ width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", css: CHECKBOX_ICON_STYLE(theme, props.type, props.disabled) }, { children: [_jsx("rect", { x: "0.5", y: "0.5", width: "15", height: "15", rx: "1.5", fill: "currentColor", stroke: "currentColor" }), props.type === "checked" && (_jsx("path", { d: "M7.10545 12.6041L7.08783 12.6217L2.68799 8.22185L4.12067 6.78917L7.10551 9.77402L11.8795 5L13.3122 6.43268L7.12313 12.6218L7.10545 12.6041Z", fill: "currentColor" })), props.type === "partial" && (_jsx("rect", { x: "4", y: "4", width: "8", height: "8", fill: "currentColor" }))] })));
|
|
75
|
-
};
|
|
76
|
-
export default CheckboxInput;
|
|
77
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { InputBaseColor, InputBaseProps, InputBaseSize } from "./InputBase";
|
|
3
|
-
export type InputColor = InputBaseColor;
|
|
4
|
-
export type InputSize = InputBaseSize;
|
|
5
|
-
export interface InputProps extends InputBaseProps {
|
|
6
|
-
/** Input 컴포넌트 상단에 노출될 문자열 */
|
|
7
|
-
label?: string;
|
|
8
|
-
/** Input 컴포넌트 하단에 노출될 문자열 */
|
|
9
|
-
hintText?: string;
|
|
10
|
-
/** hint 영역 좌측에 노출될 아이콘 */
|
|
11
|
-
hintIcon?: React.ReactNode;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=26-10284&t=HnIfxpf8uR6WmzMW-0)
|
|
15
|
-
*/
|
|
16
|
-
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<any>>;
|
|
17
|
-
export default Input;
|
package/dist/components/Input.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
|
-
var t = {};
|
|
18
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
19
|
-
t[p] = s[p];
|
|
20
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
21
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
22
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
23
|
-
t[p[i]] = s[p[i]];
|
|
24
|
-
}
|
|
25
|
-
return t;
|
|
26
|
-
};
|
|
27
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
28
|
-
/** @jsxImportSource @emotion/react */
|
|
29
|
-
import { css } from "@emotion/react";
|
|
30
|
-
import styled from "@emotion/styled";
|
|
31
|
-
import React from "react";
|
|
32
|
-
import { InputBase, } from "./InputBase";
|
|
33
|
-
var COLOR_TO_HINT_STYLES = function (theme, color, disabled) {
|
|
34
|
-
return disabled
|
|
35
|
-
? css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), theme.color.foreground.neutralBaseDisabled) : {
|
|
36
|
-
default: css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), theme.color.foreground.neutralBaseDisabled),
|
|
37
|
-
activePrimary: css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), theme.color.foreground.neutralBaseDisabled),
|
|
38
|
-
activeDanger: css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), theme.color.foreground.danger),
|
|
39
|
-
activeSuccess: css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), theme.color.foreground.success),
|
|
40
|
-
}[color];
|
|
41
|
-
};
|
|
42
|
-
var SIZE_TO_FONT_STYLES = function (size) {
|
|
43
|
-
return ({
|
|
44
|
-
small: css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n font-size: 14px;\n line-height: 20px;\n svg {\n width: 16px;\n height: 16px;\n }\n "], ["\n font-size: 14px;\n line-height: 20px;\n svg {\n width: 16px;\n height: 16px;\n }\n "]))),
|
|
45
|
-
medium: css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n font-size: 16px;\n line-height: 24px;\n svg {\n width: 16px;\n height: 16px;\n }\n "], ["\n font-size: 16px;\n line-height: 24px;\n svg {\n width: 16px;\n height: 16px;\n }\n "]))),
|
|
46
|
-
large: css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n font-size: 18px;\n line-height: 28px;\n svg {\n width: 18px;\n height: 18px;\n }\n "], ["\n font-size: 18px;\n line-height: 28px;\n svg {\n width: 18px;\n height: 18px;\n }\n "]))),
|
|
47
|
-
}[size]);
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=26-10284&t=HnIfxpf8uR6WmzMW-0)
|
|
51
|
-
*/
|
|
52
|
-
var Input = React.forwardRef(function (props, ref) {
|
|
53
|
-
var label = props.label, hintText = props.hintText, hintIcon = props.hintIcon, className = props.className, color = props.color, size = props.size, placeholder = props.placeholder, disabled = props.disabled, startIcon = props.startIcon, startLabel = props.startLabel, endLabel = props.endLabel, endIcon = props.endIcon, inputProps = props.inputProps, inputRef = props.inputRef, fullWidth = props.fullWidth, onChange = props.onChange, onClear = props.onClear, defaultValue = props.defaultValue, value = props.value, other = __rest(props, ["label", "hintText", "hintIcon", "className", "color", "size", "placeholder", "disabled", "startIcon", "startLabel", "endLabel", "endIcon", "inputProps", "inputRef", "fullWidth", "onChange", "onClear", "defaultValue", "value"]);
|
|
54
|
-
return (_jsxs(InputWrapper, __assign({ className: props.className, size: props.size, fullWidth: props.fullWidth, ref: ref }, other, { children: [label ? (_jsxs(Label, __assign({ disabled: props.disabled }, { children: [label, " ", _jsx(InputBase, __assign({}, props))] }))) : (_jsx(InputBase, __assign({}, props))), hintText && (_jsxs(Hint, __assign({ color: props.color, disabled: props.disabled }, { children: [hintIcon, hintText] })))] })));
|
|
55
|
-
});
|
|
56
|
-
var InputWrapper = styled.span(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: inline-flex;\n flex-direction: column;\n gap: 8px;\n ", "\n ", "\n\n position: relative;\n"], ["\n display: inline-flex;\n flex-direction: column;\n gap: 8px;\n ", "\n ", "\n\n position: relative;\n"])), function (_a) {
|
|
57
|
-
var size = _a.size;
|
|
58
|
-
return SIZE_TO_FONT_STYLES(size);
|
|
59
|
-
}, function (_a) {
|
|
60
|
-
var fullWidth = _a.fullWidth;
|
|
61
|
-
return fullWidth && "width: 100%;";
|
|
62
|
-
});
|
|
63
|
-
var Label = styled.label(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n ", "\n"], ["\n display: flex;\n flex-direction: column;\n gap: 8px;\n ", "\n"])), function (_a) {
|
|
64
|
-
var theme = _a.theme, disabled = _a.disabled;
|
|
65
|
-
return disabled && css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), theme.color.foreground.neutralBaseDisabled);
|
|
66
|
-
});
|
|
67
|
-
var Hint = styled.div(function (_a) {
|
|
68
|
-
var theme = _a.theme, color = _a.color, disabled = _a.disabled;
|
|
69
|
-
return css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 4px;\n ", ";\n "], ["\n display: flex;\n align-items: center;\n gap: 4px;\n ", ";\n "])), COLOR_TO_HINT_STYLES(theme, color, disabled));
|
|
70
|
-
});
|
|
71
|
-
export default Input;
|
|
72
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { InputHTMLAttributes } from "react";
|
|
2
|
-
export type InputBaseColor = "default" | "activePrimary" | "activeDanger" | "activeSuccess";
|
|
3
|
-
export type InputBaseSize = "large" | "medium" | "small";
|
|
4
|
-
export interface InputBaseProps {
|
|
5
|
-
className?: string;
|
|
6
|
-
/** 컴포넌트 색상 */
|
|
7
|
-
color: InputBaseColor;
|
|
8
|
-
/** 컴포넌트 크기 */
|
|
9
|
-
size: InputBaseSize;
|
|
10
|
-
/** 입력되기 전 Input 컴포넌트에 노출될 문자열 */
|
|
11
|
-
placeholder?: string;
|
|
12
|
-
/** 비활성화 여부 */
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
/** Input 컴포넌트 내의 좌측 영역에 노출될 아이콘 */
|
|
15
|
-
startIcon?: React.ReactNode;
|
|
16
|
-
/** Input 컴포넌트 내의 좌측 영역에 노출될 텍스트.
|
|
17
|
-
* `startIcon` 보다 우측에 노출됩니다. */
|
|
18
|
-
startLabel?: string;
|
|
19
|
-
/** Input 컴포넌트 내의 우측 영역에 노출될 텍스트.
|
|
20
|
-
* `endIcon` 보다 좌측에 노출됩니다. */
|
|
21
|
-
endLabel?: string;
|
|
22
|
-
/** Input 컴포넌트 내의 우측 영역에 노출될 아이콘 */
|
|
23
|
-
endIcon?: React.ReactNode;
|
|
24
|
-
/** HTML input 태그에 전달될 ref */
|
|
25
|
-
inputRef?: React.LegacyRef<HTMLInputElement>;
|
|
26
|
-
/** HTML input 태그에 전달될 props */
|
|
27
|
-
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
28
|
-
/** true일 경우, Input이 상위 요소의 전체 길이를 차지하게 됩니다. */
|
|
29
|
-
fullWidth?: boolean;
|
|
30
|
-
/** 값이 변경될때 호출될 콜백 함수 */
|
|
31
|
-
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
32
|
-
/**
|
|
33
|
-
* Clear Button을 클릭했을 때의 콜백 함수.
|
|
34
|
-
* 설정하면, Input 컴포넌트 내의 우측 영역에 Clear Button이 노출됩니다.
|
|
35
|
-
*/
|
|
36
|
-
onClear?: () => void;
|
|
37
|
-
/** input의 value의 초기값 (UnControlled Component) */
|
|
38
|
-
defaultValue?: any;
|
|
39
|
-
/** input의 value (Controlled Component) */
|
|
40
|
-
value?: any;
|
|
41
|
-
}
|
|
42
|
-
export declare function InputBase(props: InputBaseProps): React.ReactElement;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
-
import { css } from "@emotion/react";
|
|
18
|
-
import styled from "@emotion/styled";
|
|
19
|
-
import { CloseCircleFillIcon } from "../icons/system";
|
|
20
|
-
import { RESET_BUTTON } from "../utils/reset";
|
|
21
|
-
var COLOR_TO_INPUT_STYLES = function (theme, color, disabled) {
|
|
22
|
-
if (disabled) {
|
|
23
|
-
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border: none;\n background: ", ";\n color: ", ";\n "], ["\n border: none;\n background: ", ";\n color: ", ";\n "])), theme.color.foreground.neutralBaseDisabled, theme.color.background.neutralAlt);
|
|
24
|
-
}
|
|
25
|
-
return {
|
|
26
|
-
default: css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n border: none;\n background: ", ";\n color: ", ";\n "], ["\n border: none;\n background: ", ";\n color: ", ";\n "])), theme.color.background.neutralAlt, theme.color.foreground.neutralBase),
|
|
27
|
-
activePrimary: css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n border: 2px solid ", ";\n background: ", ";\n color: ", ";\n "], ["\n border: 2px solid ", ";\n background: ", ";\n color: ", ";\n "])), theme.color.foreground.primary, theme.color.background.neutralBase, theme.color.foreground.neutralBase),
|
|
28
|
-
activeDanger: css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border: 2px solid ", ";\n background: ", ";\n color: ", ";\n "], ["\n border: 2px solid ", ";\n background: ", ";\n color: ", ";\n "])), theme.color.foreground.danger, theme.color.background.neutralBase, theme.color.foreground.neutralBase),
|
|
29
|
-
activeSuccess: css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n border: 2px solid ", ";\n background: ", ";\n color: ", ";\n "], ["\n border: 2px solid ", ";\n background: ", ";\n color: ", ";\n "])), theme.color.foreground.success, theme.color.background.neutralBase, theme.color.foreground.neutralBase),
|
|
30
|
-
}[color];
|
|
31
|
-
};
|
|
32
|
-
var SIZE_TO_STYLES = function (size) {
|
|
33
|
-
return ({
|
|
34
|
-
small: css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n padding-top: 8px;\n padding-bottom: 8px;\n width: 300px;\n height: 36px;\n "], ["\n padding-top: 8px;\n padding-bottom: 8px;\n width: 300px;\n height: 36px;\n "]))),
|
|
35
|
-
medium: css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n padding-top: 12px;\n padding-bottom: 12px;\n width: 375px;\n height: 48px;\n "], ["\n padding-top: 12px;\n padding-bottom: 12px;\n width: 375px;\n height: 48px;\n "]))),
|
|
36
|
-
large: css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n padding-top: 14px;\n padding-bottom: 14px;\n width: 375px;\n height: 56px;\n "], ["\n padding-top: 14px;\n padding-bottom: 14px;\n width: 375px;\n height: 56px;\n "]))),
|
|
37
|
-
}[size]);
|
|
38
|
-
};
|
|
39
|
-
export function InputBase(props) {
|
|
40
|
-
var className = props.className, color = props.color, size = props.size, placeholder = props.placeholder, _a = props.disabled, disabled = _a === void 0 ? false : _a, startIcon = props.startIcon, startLabel = props.startLabel, endLabel = props.endLabel, endIcon = props.endIcon, inputProps = props.inputProps, inputRef = props.inputRef, _b = props.fullWidth, fullWidth = _b === void 0 ? false : _b, onChange = props.onChange, onClear = props.onClear, defaultValue = props.defaultValue, value = props.value;
|
|
41
|
-
return (_jsxs(InputContainer, __assign({ className: className, disabled: disabled, color: color, inputSize: size, fullWidth: fullWidth }, { children: [startIcon, startLabel && _jsx("span", { children: startLabel }), _jsx(StyledInput, __assign({}, inputProps, { ref: inputRef, onChange: onChange, placeholder: placeholder, disabled: disabled, defaultValue: defaultValue, value: value })), endLabel && _jsx("span", { children: endLabel }), endIcon, onClear && (_jsx(ClearButton, __assign({ onClick: onClear, disabled: disabled }, { children: _jsx(CloseCircleFillIcon, {}) })))] })));
|
|
42
|
-
}
|
|
43
|
-
var InputContainer = styled.div(function (_a) {
|
|
44
|
-
var theme = _a.theme, color = _a.color, inputSize = _a.inputSize, disabled = _a.disabled, fullWidth = _a.fullWidth;
|
|
45
|
-
return css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 16px;\n\n box-sizing: border-box;\n padding: 14px 16px;\n border-radius: 8px;\n ", "\n ", "\n ", " // InputWrapper\uC758 width\uB97C \uB530\uB985\uB2C8\uB2E4.\n "], ["\n display: flex;\n align-items: center;\n gap: 16px;\n\n box-sizing: border-box;\n padding: 14px 16px;\n border-radius: 8px;\n ", "\n ", "\n ", " // InputWrapper\uC758 width\uB97C \uB530\uB985\uB2C8\uB2E4.\n "])), COLOR_TO_INPUT_STYLES(theme, color, disabled), SIZE_TO_STYLES(inputSize), fullWidth && "width: inherit;");
|
|
46
|
-
});
|
|
47
|
-
var StyledInput = styled.input(function (_a) {
|
|
48
|
-
var theme = _a.theme;
|
|
49
|
-
return css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n appearance: none;\n flex: 1;\n min-width: 0;\n border: none;\n padding: 0;\n background-color: transparent;\n font: inherit;\n color: currentColor;\n\n &:focus-visible {\n outline: none;\n }\n &::placeholder {\n color: ", ";\n }\n "], ["\n appearance: none;\n flex: 1;\n min-width: 0;\n border: none;\n padding: 0;\n background-color: transparent;\n font: inherit;\n color: currentColor;\n\n &:focus-visible {\n outline: none;\n }\n &::placeholder {\n color: ", ";\n }\n "])), theme.color.foreground.neutralBaseDisabled);
|
|
50
|
-
});
|
|
51
|
-
var ClearButton = styled.button(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n ", "\n color: currentColor;\n &:not(:disabled) {\n cursor: pointer;\n }\n display: flex;\n align-items: center;\n"], ["\n ", "\n color: currentColor;\n &:not(:disabled) {\n cursor: pointer;\n }\n display: flex;\n align-items: center;\n"])), RESET_BUTTON);
|
|
52
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
export interface PaginationProps {
|
|
3
|
-
className?: string;
|
|
4
|
-
/** 시작과 끝에 오는 페이지의 수 */
|
|
5
|
-
boundaryCount?: number;
|
|
6
|
-
/** 전체 페이지의 수 */
|
|
7
|
-
count?: number;
|
|
8
|
-
/** 기본 페이지 (UnControlled) */
|
|
9
|
-
defaultPage?: number;
|
|
10
|
-
/** 비활성화 여부 */
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
/** 다음 페이지로 이동하는 버튼 숨김여부 */
|
|
13
|
-
hideNextButton?: boolean;
|
|
14
|
-
/** 이전 페이지로 이동하는 버튼 숨김여부 */
|
|
15
|
-
hidePrevButton?: boolean;
|
|
16
|
-
/** 페이지가 변경되었을 때 콜백함수 */
|
|
17
|
-
onChange?: (event: React.ChangeEvent<unknown>, page: number) => void;
|
|
18
|
-
/** 현재 페이지 전후로 나타나는 페이지의 수 */
|
|
19
|
-
siblingCount?: number;
|
|
20
|
-
/** 현재 페이지 */
|
|
21
|
-
page: number;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=35-798&t=6OdVgm0hiYaq5PFw-0)
|
|
25
|
-
*/
|
|
26
|
-
declare const Pagination: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<any>>;
|
|
27
|
-
export default Pagination;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
2
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
3
|
-
return cooked;
|
|
4
|
-
};
|
|
5
|
-
var __assign = (this && this.__assign) || function () {
|
|
6
|
-
__assign = Object.assign || function(t) {
|
|
7
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
-
s = arguments[i];
|
|
9
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
10
|
-
t[p] = s[p];
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
};
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
17
|
-
/** @jsxImportSource @emotion/react */
|
|
18
|
-
import { css } from "@emotion/react";
|
|
19
|
-
import * as React from "react";
|
|
20
|
-
import styled from "@emotion/styled";
|
|
21
|
-
import { Pagination as MuiPagination } from "@mui/material";
|
|
22
|
-
import { HOVER } from "../utils/hover";
|
|
23
|
-
/**
|
|
24
|
-
* [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=35-798&t=6OdVgm0hiYaq5PFw-0)
|
|
25
|
-
*/
|
|
26
|
-
var Pagination = React.forwardRef(function (props, ref) { return (_jsx(StyledPagination, __assign({ siblingCount: 2, shape: "rounded" }, props, { ref: ref }))); });
|
|
27
|
-
var StyledPagination = styled(MuiPagination)(function (_a) {
|
|
28
|
-
var theme = _a.theme;
|
|
29
|
-
return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n &.MuiPagination-root {\n & .MuiPagination-ul {\n li {\n width: 32px;\n height: 32px;\n margin-left: 4px;\n margin-right: 4px;\n button {\n padding: 0;\n margin: 0;\n }\n }\n }\n & .MuiPaginationItem-root {\n ", "\n }\n & .MuiPaginationItem-text {\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n border-radius: 8px;\n color: ", ";\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n padding: 1px 7px;\n margin: 0;\n }\n & .Mui-selected {\n border: 2px solid ", ";\n background-color: transparent;\n color: ", ";\n font-weight: 700;\n ", "\n }\n & .Mui-disabled {\n background-color: transparent;\n color: ", ";\n }\n & .Mui-disabled.Mui-selected {\n border: 2px solid ", ";\n background-color: transparent;\n color: ", ";\n }\n & .MuiPaginationItem-ellipsis {\n ", "\n }\n }\n "], ["\n &.MuiPagination-root {\n & .MuiPagination-ul {\n li {\n width: 32px;\n height: 32px;\n margin-left: 4px;\n margin-right: 4px;\n button {\n padding: 0;\n margin: 0;\n }\n }\n }\n & .MuiPaginationItem-root {\n ", "\n }\n & .MuiPaginationItem-text {\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n border-radius: 8px;\n color: ", ";\n font-weight: 400;\n font-size: 14px;\n line-height: 24px;\n padding: 1px 7px;\n margin: 0;\n }\n & .Mui-selected {\n border: 2px solid ", ";\n background-color: transparent;\n color: ", ";\n font-weight: 700;\n ", "\n }\n & .Mui-disabled {\n background-color: transparent;\n color: ", ";\n }\n & .Mui-disabled.Mui-selected {\n border: 2px solid ", ";\n background-color: transparent;\n color: ", ";\n }\n & .MuiPaginationItem-ellipsis {\n ", "\n }\n }\n "])), HOVER(css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: ", ";\n "], ["\n background-color: ", ";\n "])), theme.color.background.neutralAlt)), theme.color.foreground.neutralBase, theme.color.background.primary, theme.color.background.primary, HOVER(css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-color: transparent;\n "], ["\n background-color: transparent;\n "])))), theme.color.foreground.neutralBaseDisabled, theme.color.background.primaryDisabled, theme.color.background.primaryDisabled, HOVER(css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n background-color: transparent;\n "], ["\n background-color: transparent;\n "])))));
|
|
30
|
-
});
|
|
31
|
-
export default Pagination;
|
|
32
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export type PinInputColor = "default" | "activePrimary" | "activeDanger" | "activeSuccess";
|
|
3
|
-
export type PinInputSize = "large" | "medium" | "small";
|
|
4
|
-
export interface PinInputProps {
|
|
5
|
-
className?: string;
|
|
6
|
-
/** `true` 값일 때 첫번째 Input에 자동으로 포커싱합니다. */
|
|
7
|
-
autoFocus?: boolean;
|
|
8
|
-
/** 컴포넌트 크기 */
|
|
9
|
-
size: PinInputSize;
|
|
10
|
-
/** 입력되기 전 PinInput 컴포넌트에 노출될 문자열 */
|
|
11
|
-
placeholder?: string;
|
|
12
|
-
/** Input 컴포넌트 상단에 노출될 문자열 */
|
|
13
|
-
label?: string;
|
|
14
|
-
/** Input 컴포넌트 하단에 노출될 문자열 */
|
|
15
|
-
hintText?: string;
|
|
16
|
-
/** hint 영역 좌측에 노출될 아이콘 */
|
|
17
|
-
hintIcon?: React.ReactNode;
|
|
18
|
-
/** 비활성화 여부 */
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
/** 에러 상태 여부 */
|
|
21
|
-
error?: boolean;
|
|
22
|
-
/** 성공 상태 여부 */
|
|
23
|
-
positive?: boolean;
|
|
24
|
-
/** 값이 변경될때 호출될 콜백 함수 */
|
|
25
|
-
onChange: (e: {
|
|
26
|
-
values: string[];
|
|
27
|
-
event: React.ChangeEvent<HTMLInputElement>;
|
|
28
|
-
}) => void;
|
|
29
|
-
/** PinInput의 value (Controlled Component) */
|
|
30
|
-
values: string[];
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* [피그마](https://www.figma.com/file/yhrRFizzmhPoHdw9FbYow2/Codle-PD-Kit---Components?type=design&node-id=26-11031&t=n7a8XP4k8R2TGmiO-0)
|
|
34
|
-
*/
|
|
35
|
-
declare const PinInput: React.ForwardRefExoticComponent<PinInputProps & React.RefAttributes<any>>;
|
|
36
|
-
export default PinInput;
|