@x-plat/design-system 0.1.3 → 0.1.5
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/dist/components/Accordion/index.cjs +908 -18
- package/dist/components/Accordion/index.js +908 -18
- package/dist/components/Avatar/index.css +1 -0
- package/dist/components/CheckBox/index.cjs +1 -1
- package/dist/components/CheckBox/index.css +13 -1
- package/dist/components/CheckBox/index.js +1 -1
- package/dist/components/DatePicker/index.cjs +75 -5
- package/dist/components/DatePicker/index.css +20 -2
- package/dist/components/DatePicker/index.d.cts +245 -4
- package/dist/components/DatePicker/index.d.ts +245 -4
- package/dist/components/DatePicker/index.js +75 -5
- package/dist/components/Drawer/index.cjs +111 -0
- package/dist/components/Drawer/index.css +70 -0
- package/dist/components/Drawer/index.d.cts +14 -0
- package/dist/components/Drawer/index.d.ts +14 -0
- package/dist/components/Drawer/index.js +74 -0
- package/dist/components/Dropdown/index.cjs +185 -0
- package/dist/components/Dropdown/index.css +54 -0
- package/dist/components/Dropdown/index.d.cts +17 -0
- package/dist/components/Dropdown/index.d.ts +17 -0
- package/dist/components/Dropdown/index.js +148 -0
- package/dist/components/EmptyState/index.cjs +60 -0
- package/dist/components/EmptyState/index.css +32 -0
- package/dist/components/EmptyState/index.d.cts +12 -0
- package/dist/components/EmptyState/index.d.ts +12 -0
- package/dist/components/EmptyState/index.js +33 -0
- package/dist/components/FileUpload/index.cjs +1039 -0
- package/dist/components/FileUpload/index.css +42 -0
- package/dist/components/FileUpload/index.d.cts +14 -0
- package/dist/components/FileUpload/index.d.ts +14 -0
- package/dist/components/FileUpload/index.js +1002 -0
- package/dist/components/Pagination/index.cjs +913 -7
- package/dist/components/Pagination/index.js +913 -7
- package/dist/components/Radio/index.css +1 -1
- package/dist/components/Select/index.cjs +17 -7
- package/dist/components/Select/index.d.cts +2 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Select/index.js +17 -7
- package/dist/components/Steps/index.cjs +1105 -0
- package/dist/components/Steps/index.css +918 -0
- package/dist/components/Steps/index.d.cts +134 -0
- package/dist/components/Steps/index.d.ts +134 -0
- package/dist/components/Steps/index.js +1078 -0
- package/dist/components/Switch/index.cjs +2 -0
- package/dist/components/Switch/index.css +34 -8
- package/dist/components/Switch/index.d.cts +2 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switch/index.js +2 -0
- package/dist/components/Tag/index.cjs +1090 -0
- package/dist/components/Tag/index.css +498 -0
- package/dist/components/Tag/index.d.cts +131 -0
- package/dist/components/Tag/index.d.ts +131 -0
- package/dist/components/Tag/index.js +1063 -0
- package/dist/components/Toast/index.cjs +150 -0
- package/dist/components/Toast/index.css +111 -0
- package/dist/components/Toast/index.d.cts +15 -0
- package/dist/components/Toast/index.d.ts +15 -0
- package/dist/components/Toast/index.js +112 -0
- package/dist/components/Tooltip/index.css +3 -0
- package/dist/components/index.cjs +1669 -1188
- package/dist/components/index.css +5803 -4011
- package/dist/components/index.d.cts +7 -0
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.js +1635 -1162
- package/dist/index.cjs +2689 -2244
- package/dist/index.css +5803 -4011
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +2758 -2321
- package/package.json +2 -2
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
justify-content: center;
|
|
20
20
|
cursor: pointer;
|
|
21
21
|
background-color: #FFFFFF;
|
|
22
|
-
transition: border-color 0.
|
|
22
|
+
transition: border-color 0.12s ease-out, background-color 0.12s ease-out;
|
|
23
23
|
}
|
|
24
24
|
.lib-xplat-radio:hover .lib-xplat-radio > .circle:not(.checked) {
|
|
25
25
|
border-color: #525252;
|
|
@@ -1062,6 +1062,7 @@ var ANIMATION_DURATION_MS = 200;
|
|
|
1062
1062
|
var SelectRoot = (props) => {
|
|
1063
1063
|
const {
|
|
1064
1064
|
placeholder = "\uC120\uD0DD\uD558\uC138\uC694",
|
|
1065
|
+
value: valueProp,
|
|
1065
1066
|
onChange,
|
|
1066
1067
|
children,
|
|
1067
1068
|
disabled = false,
|
|
@@ -1070,8 +1071,15 @@ var SelectRoot = (props) => {
|
|
|
1070
1071
|
const itemChildren = import_react5.default.Children.toArray(children).filter(
|
|
1071
1072
|
(child) => import_react5.default.isValidElement(child) && child.type === SelectItem_default
|
|
1072
1073
|
);
|
|
1074
|
+
const isControlled = valueProp !== void 0;
|
|
1073
1075
|
const [isOpen, setOpen] = import_react5.default.useState(false);
|
|
1074
|
-
const [
|
|
1076
|
+
const [uncontrolledLabel, setUncontrolledLabel] = import_react5.default.useState(null);
|
|
1077
|
+
const controlledLabel = import_react5.default.useMemo(() => {
|
|
1078
|
+
if (!isControlled) return null;
|
|
1079
|
+
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
1080
|
+
return match ? match.props.children : null;
|
|
1081
|
+
}, [isControlled, valueProp, itemChildren]);
|
|
1082
|
+
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
1075
1083
|
const triggerRef = import_react5.default.useRef(null);
|
|
1076
1084
|
const contentRef = import_react5.default.useRef(null);
|
|
1077
1085
|
const [mounted, setMounted] = import_react5.default.useState(false);
|
|
@@ -1095,13 +1103,15 @@ var SelectRoot = (props) => {
|
|
|
1095
1103
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
1096
1104
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
1097
1105
|
const setSelected = import_react5.default.useCallback(
|
|
1098
|
-
(label,
|
|
1099
|
-
|
|
1100
|
-
|
|
1106
|
+
(label, itemValue) => {
|
|
1107
|
+
if (!isControlled) {
|
|
1108
|
+
setUncontrolledLabel(label);
|
|
1109
|
+
}
|
|
1110
|
+
onChange?.(itemValue, label);
|
|
1101
1111
|
},
|
|
1102
|
-
[onChange]
|
|
1112
|
+
[isControlled, onChange]
|
|
1103
1113
|
);
|
|
1104
|
-
const
|
|
1114
|
+
const ctxValue = import_react5.default.useMemo(
|
|
1105
1115
|
() => ({
|
|
1106
1116
|
isOpen,
|
|
1107
1117
|
mounted,
|
|
@@ -1122,7 +1132,7 @@ var SelectRoot = (props) => {
|
|
|
1122
1132
|
if (disabled) return;
|
|
1123
1133
|
toggle();
|
|
1124
1134
|
};
|
|
1125
|
-
return /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(context_default.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime296.jsxs)(
|
|
1135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime296.jsxs)(
|
|
1126
1136
|
"div",
|
|
1127
1137
|
{
|
|
1128
1138
|
className: clsx_default(
|
|
@@ -22,6 +22,8 @@ type SelectChangeHandler = (value: string | number | undefined, label: React.Rea
|
|
|
22
22
|
interface SelectProps {
|
|
23
23
|
/** 선택 전 표시할 문구 */
|
|
24
24
|
placeholder?: string;
|
|
25
|
+
/** 현재 선택된 값 (controlled) */
|
|
26
|
+
value?: string | number;
|
|
25
27
|
/** 값이 바뀔 때 호출 */
|
|
26
28
|
onChange?: SelectChangeHandler;
|
|
27
29
|
/** Select.Item 만 허용 */
|
|
@@ -22,6 +22,8 @@ type SelectChangeHandler = (value: string | number | undefined, label: React.Rea
|
|
|
22
22
|
interface SelectProps {
|
|
23
23
|
/** 선택 전 표시할 문구 */
|
|
24
24
|
placeholder?: string;
|
|
25
|
+
/** 현재 선택된 값 (controlled) */
|
|
26
|
+
value?: string | number;
|
|
25
27
|
/** 값이 바뀔 때 호출 */
|
|
26
28
|
onChange?: SelectChangeHandler;
|
|
27
29
|
/** Select.Item 만 허용 */
|
|
@@ -1025,6 +1025,7 @@ var ANIMATION_DURATION_MS = 200;
|
|
|
1025
1025
|
var SelectRoot = (props) => {
|
|
1026
1026
|
const {
|
|
1027
1027
|
placeholder = "\uC120\uD0DD\uD558\uC138\uC694",
|
|
1028
|
+
value: valueProp,
|
|
1028
1029
|
onChange,
|
|
1029
1030
|
children,
|
|
1030
1031
|
disabled = false,
|
|
@@ -1033,8 +1034,15 @@ var SelectRoot = (props) => {
|
|
|
1033
1034
|
const itemChildren = React5.Children.toArray(children).filter(
|
|
1034
1035
|
(child) => React5.isValidElement(child) && child.type === SelectItem_default
|
|
1035
1036
|
);
|
|
1037
|
+
const isControlled = valueProp !== void 0;
|
|
1036
1038
|
const [isOpen, setOpen] = React5.useState(false);
|
|
1037
|
-
const [
|
|
1039
|
+
const [uncontrolledLabel, setUncontrolledLabel] = React5.useState(null);
|
|
1040
|
+
const controlledLabel = React5.useMemo(() => {
|
|
1041
|
+
if (!isControlled) return null;
|
|
1042
|
+
const match = itemChildren.find((child) => child.props.value === valueProp);
|
|
1043
|
+
return match ? match.props.children : null;
|
|
1044
|
+
}, [isControlled, valueProp, itemChildren]);
|
|
1045
|
+
const selectedLabel = isControlled ? controlledLabel : uncontrolledLabel;
|
|
1038
1046
|
const triggerRef = React5.useRef(null);
|
|
1039
1047
|
const contentRef = React5.useRef(null);
|
|
1040
1048
|
const [mounted, setMounted] = React5.useState(false);
|
|
@@ -1058,13 +1066,15 @@ var SelectRoot = (props) => {
|
|
|
1058
1066
|
useClickOutside_default([contentRef, triggerRef], close, isOpen);
|
|
1059
1067
|
const position = useAutoPosition_default(triggerRef, contentRef, mounted);
|
|
1060
1068
|
const setSelected = React5.useCallback(
|
|
1061
|
-
(label,
|
|
1062
|
-
|
|
1063
|
-
|
|
1069
|
+
(label, itemValue) => {
|
|
1070
|
+
if (!isControlled) {
|
|
1071
|
+
setUncontrolledLabel(label);
|
|
1072
|
+
}
|
|
1073
|
+
onChange?.(itemValue, label);
|
|
1064
1074
|
},
|
|
1065
|
-
[onChange]
|
|
1075
|
+
[isControlled, onChange]
|
|
1066
1076
|
);
|
|
1067
|
-
const
|
|
1077
|
+
const ctxValue = React5.useMemo(
|
|
1068
1078
|
() => ({
|
|
1069
1079
|
isOpen,
|
|
1070
1080
|
mounted,
|
|
@@ -1085,7 +1095,7 @@ var SelectRoot = (props) => {
|
|
|
1085
1095
|
if (disabled) return;
|
|
1086
1096
|
toggle();
|
|
1087
1097
|
};
|
|
1088
|
-
return /* @__PURE__ */ jsx296(context_default.Provider, { value, children: /* @__PURE__ */ jsxs189(
|
|
1098
|
+
return /* @__PURE__ */ jsx296(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ jsxs189(
|
|
1089
1099
|
"div",
|
|
1090
1100
|
{
|
|
1091
1101
|
className: clsx_default(
|