@x-plat/design-system 0.8.3 → 0.10.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/dist/components/AutoResizeTextArea/index.cjs +140 -4
- package/dist/components/AutoResizeTextArea/index.css +38 -0
- package/dist/components/AutoResizeTextArea/index.d.cts +4 -0
- package/dist/components/AutoResizeTextArea/index.d.ts +4 -0
- package/dist/components/AutoResizeTextArea/index.js +140 -4
- package/dist/components/Badge/index.cjs +5 -1
- package/dist/components/Badge/index.css +1 -0
- package/dist/components/Badge/index.d.cts +1 -0
- package/dist/components/Badge/index.d.ts +1 -0
- package/dist/components/Badge/index.js +5 -1
- package/dist/components/Box/index.d.cts +3 -0
- package/dist/components/Box/index.d.ts +3 -0
- package/dist/components/Chart/index.cjs +7 -6
- package/dist/components/Chart/index.d.cts +12 -1
- package/dist/components/Chart/index.d.ts +12 -1
- package/dist/components/Chart/index.js +7 -6
- package/dist/components/ChatInput/index.cjs +150 -9
- package/dist/components/ChatInput/index.css +38 -0
- package/dist/components/ChatInput/index.d.cts +9 -0
- package/dist/components/ChatInput/index.d.ts +9 -0
- package/dist/components/ChatInput/index.js +151 -10
- package/dist/components/CheckBox/index.cjs +137 -6
- package/dist/components/CheckBox/index.css +40 -0
- package/dist/components/CheckBox/index.d.cts +13 -2
- package/dist/components/CheckBox/index.d.ts +13 -2
- package/dist/components/CheckBox/index.js +137 -6
- package/dist/components/Chip/index.d.cts +2 -0
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/DatePicker/index.cjs +76 -62
- package/dist/components/DatePicker/index.css +38 -31
- package/dist/components/DatePicker/index.js +42 -28
- package/dist/components/Drawer/index.d.cts +1 -0
- package/dist/components/Drawer/index.d.ts +1 -0
- package/dist/components/FieldMessage/index.cjs +183 -0
- package/dist/components/FieldMessage/index.css +37 -0
- package/dist/components/FieldMessage/index.d.cts +37 -0
- package/dist/components/FieldMessage/index.d.ts +37 -0
- package/dist/components/FieldMessage/index.js +154 -0
- package/dist/components/FileUpload/index.cjs +135 -8
- package/dist/components/FileUpload/index.css +38 -0
- package/dist/components/FileUpload/index.d.cts +9 -0
- package/dist/components/FileUpload/index.d.ts +9 -0
- package/dist/components/FileUpload/index.js +135 -8
- package/dist/components/ImageSelector/index.cjs +153 -11
- package/dist/components/ImageSelector/index.css +38 -0
- package/dist/components/ImageSelector/index.d.cts +6 -0
- package/dist/components/ImageSelector/index.d.ts +6 -0
- package/dist/components/ImageSelector/index.js +153 -11
- package/dist/components/Input/index.cjs +38 -25
- package/dist/components/Input/index.css +38 -31
- package/dist/components/Input/index.d.cts +7 -8
- package/dist/components/Input/index.d.ts +7 -8
- package/dist/components/Input/index.js +36 -23
- package/dist/components/NotificationBadge/index.cjs +5 -1
- package/dist/components/NotificationBadge/index.css +1 -0
- package/dist/components/NotificationBadge/index.d.cts +6 -2
- package/dist/components/NotificationBadge/index.d.ts +6 -2
- package/dist/components/NotificationBadge/index.js +5 -1
- package/dist/components/Pagination/index.cjs +6 -2
- package/dist/components/Pagination/index.css +1 -0
- package/dist/components/Pagination/index.d.cts +13 -2
- package/dist/components/Pagination/index.d.ts +13 -2
- package/dist/components/Pagination/index.js +6 -2
- package/dist/components/Progress/index.cjs +6 -2
- package/dist/components/Progress/index.css +1 -0
- package/dist/components/Progress/index.d.cts +11 -2
- package/dist/components/Progress/index.d.ts +11 -2
- package/dist/components/Progress/index.js +6 -2
- package/dist/components/Radio/index.cjs +158 -10
- package/dist/components/Radio/index.css +40 -0
- package/dist/components/Radio/index.d.cts +14 -2
- package/dist/components/Radio/index.d.ts +14 -2
- package/dist/components/Radio/index.js +158 -10
- package/dist/components/Select/index.cjs +139 -13
- package/dist/components/Select/index.css +38 -0
- package/dist/components/Select/index.d.cts +8 -1
- package/dist/components/Select/index.d.ts +8 -1
- package/dist/components/Select/index.js +139 -13
- package/dist/components/Skeleton/index.d.cts +3 -0
- package/dist/components/Skeleton/index.d.ts +3 -0
- package/dist/components/Spinner/index.cjs +6 -2
- package/dist/components/Spinner/index.css +1 -0
- package/dist/components/Spinner/index.d.cts +8 -2
- package/dist/components/Spinner/index.d.ts +8 -2
- package/dist/components/Spinner/index.js +6 -2
- package/dist/components/Steps/index.cjs +6 -2
- package/dist/components/Steps/index.css +11 -0
- package/dist/components/Steps/index.d.cts +9 -2
- package/dist/components/Steps/index.d.ts +9 -2
- package/dist/components/Steps/index.js +6 -2
- package/dist/components/Switch/index.cjs +146 -6
- package/dist/components/Switch/index.css +40 -0
- package/dist/components/Switch/index.d.cts +13 -2
- package/dist/components/Switch/index.d.ts +13 -2
- package/dist/components/Switch/index.js +146 -6
- package/dist/components/Tab/index.cjs +4 -3
- package/dist/components/Tab/index.d.cts +12 -1
- package/dist/components/Tab/index.d.ts +12 -1
- package/dist/components/Tab/index.js +4 -3
- package/dist/components/Tag/index.cjs +5 -3
- package/dist/components/Tag/index.d.cts +12 -2
- package/dist/components/Tag/index.d.ts +12 -2
- package/dist/components/Tag/index.js +5 -3
- package/dist/components/TextArea/index.cjs +138 -2
- package/dist/components/TextArea/index.css +38 -0
- package/dist/components/TextArea/index.d.cts +6 -0
- package/dist/components/TextArea/index.d.ts +6 -0
- package/dist/components/TextArea/index.js +138 -2
- package/dist/components/Tooltip/index.cjs +4 -2
- package/dist/components/Tooltip/index.d.cts +11 -1
- package/dist/components/Tooltip/index.d.ts +11 -1
- package/dist/components/Tooltip/index.js +4 -2
- package/dist/components/index.cjs +479 -408
- package/dist/components/index.css +59 -31
- package/dist/components/index.d.cts +3 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +262 -194
- package/dist/index.cjs +484 -413
- package/dist/index.css +59 -31
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +264 -196
- package/dist/status-g_KP3qT6.d.cts +8 -0
- package/dist/status-g_KP3qT6.d.ts +8 -0
- package/dist/validation-Dqo1zqhT.d.cts +13 -0
- package/dist/validation-Dqo1zqhT.d.ts +13 -0
- package/guidelines/AGENT_PROMPT.md +15 -0
- package/guidelines/components/card.md +3 -3
- package/guidelines/components/feedback.md +1 -1
- package/guidelines/components/form.md +26 -0
- package/guidelines/components/navigation.md +16 -15
- package/guidelines/components/overlay.md +43 -4
- package/package.json +1 -1
|
@@ -806,12 +806,83 @@ var CheckIcon_default = CheckIcon;
|
|
|
806
806
|
|
|
807
807
|
// src/tokens/svg/status/ErrorIcon.tsx
|
|
808
808
|
var import_jsx_runtime254 = require("react/jsx-runtime");
|
|
809
|
+
var ErrorIcon = () => /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)(
|
|
810
|
+
"svg",
|
|
811
|
+
{
|
|
812
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
813
|
+
width: "1em",
|
|
814
|
+
height: "1em",
|
|
815
|
+
viewBox: "0 0 16 16",
|
|
816
|
+
fill: "none",
|
|
817
|
+
children: [
|
|
818
|
+
/* @__PURE__ */ (0, import_jsx_runtime254.jsxs)("g", { clipPath: "url(#clip0_1196_9603)", children: [
|
|
819
|
+
/* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
|
|
820
|
+
"path",
|
|
821
|
+
{
|
|
822
|
+
d: "M9.57588 5.57559C9.81019 5.34127 10.19 5.34127 10.4243 5.57559C10.6586 5.8099 10.6586 6.18971 10.4243 6.42402L8.84854 7.9998L10.4243 9.57559C10.6586 9.8099 10.6586 10.1897 10.4243 10.424C10.19 10.6583 9.81019 10.6583 9.57588 10.424L8.0001 8.84824L6.42432 10.424C6.19 10.6583 5.81019 10.6583 5.57588 10.424C5.34156 10.1897 5.34156 9.8099 5.57588 9.57559L7.15166 7.9998L5.57588 6.42402C5.34156 6.18971 5.34156 5.8099 5.57588 5.57559C5.81019 5.34127 6.19 5.34127 6.42432 5.57559L8.0001 7.15137L9.57588 5.57559Z",
|
|
823
|
+
fill: "currentColor"
|
|
824
|
+
}
|
|
825
|
+
),
|
|
826
|
+
/* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
|
|
827
|
+
"path",
|
|
828
|
+
{
|
|
829
|
+
fillRule: "evenodd",
|
|
830
|
+
clipRule: "evenodd",
|
|
831
|
+
d: "M8.0001 0.733398C12.0131 0.73361 15.2671 3.98679 15.2673 7.9998C15.2672 12.0129 12.0131 15.2668 8.0001 15.267C3.98701 15.2669 0.733016 12.0129 0.73291 7.9998C0.733051 3.98674 3.98704 0.733539 8.0001 0.733398ZM8.0001 1.9334C4.64978 1.93354 1.93383 4.64948 1.93369 7.9998C1.9338 11.3502 4.64975 14.0669 8.0001 14.067C11.3504 14.0668 14.0672 11.3501 14.0673 7.9998C14.0671 4.64953 11.3504 1.93361 8.0001 1.9334Z",
|
|
832
|
+
fill: "currentColor"
|
|
833
|
+
}
|
|
834
|
+
)
|
|
835
|
+
] }),
|
|
836
|
+
/* @__PURE__ */ (0, import_jsx_runtime254.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime254.jsx)("clipPath", { id: "clip0_1196_9603", children: /* @__PURE__ */ (0, import_jsx_runtime254.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
837
|
+
]
|
|
838
|
+
}
|
|
839
|
+
);
|
|
840
|
+
var ErrorIcon_default = ErrorIcon;
|
|
809
841
|
|
|
810
842
|
// src/tokens/svg/status/HelpCircleIcon.tsx
|
|
811
843
|
var import_jsx_runtime255 = require("react/jsx-runtime");
|
|
812
844
|
|
|
813
845
|
// src/tokens/svg/status/InfoIcon.tsx
|
|
814
846
|
var import_jsx_runtime256 = require("react/jsx-runtime");
|
|
847
|
+
var InfoIcon = () => /* @__PURE__ */ (0, import_jsx_runtime256.jsxs)(
|
|
848
|
+
"svg",
|
|
849
|
+
{
|
|
850
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
851
|
+
width: "1em",
|
|
852
|
+
height: "1em",
|
|
853
|
+
viewBox: "0 0 16 16",
|
|
854
|
+
fill: "none",
|
|
855
|
+
children: [
|
|
856
|
+
/* @__PURE__ */ (0, import_jsx_runtime256.jsxs)("g", { clipPath: "url(#clip0_1188_11261)", children: [
|
|
857
|
+
/* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
|
|
858
|
+
"path",
|
|
859
|
+
{
|
|
860
|
+
d: "M8.00156 7.39999C8.33293 7.39999 8.60156 7.66862 8.60156 7.99999V10.6664C8.60156 10.9978 8.33293 11.2664 8.00156 11.2664C7.67019 11.2664 7.40156 10.9978 7.40156 10.6664V7.99999C7.40156 7.66862 7.67019 7.39999 8.00156 7.39999Z",
|
|
861
|
+
fill: "currentColor"
|
|
862
|
+
}
|
|
863
|
+
),
|
|
864
|
+
/* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
|
|
865
|
+
"path",
|
|
866
|
+
{
|
|
867
|
+
d: "M8.00859 4.73358C8.3398 4.73378 8.60859 5.00233 8.60859 5.33358C8.60849 5.66474 8.33973 5.93338 8.00859 5.93358H8.00156C7.67026 5.93358 7.40167 5.66486 7.40156 5.33358C7.40156 5.00221 7.67019 4.73358 8.00156 4.73358H8.00859Z",
|
|
868
|
+
fill: "currentColor"
|
|
869
|
+
}
|
|
870
|
+
),
|
|
871
|
+
/* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
|
|
872
|
+
"path",
|
|
873
|
+
{
|
|
874
|
+
fillRule: "evenodd",
|
|
875
|
+
clipRule: "evenodd",
|
|
876
|
+
d: "M8.00156 0.733582C12.0146 0.733793 15.2686 3.98697 15.2688 7.99999C15.2686 12.013 12.0146 15.267 8.00156 15.2672C3.98848 15.267 0.734481 12.0131 0.734375 7.99999C0.734516 3.98693 3.9885 0.733722 8.00156 0.733582ZM8.00156 1.93358C4.65124 1.93372 1.9353 4.64967 1.93516 7.99999C1.93526 11.3503 4.65122 14.067 8.00156 14.0672C11.3518 14.067 14.0686 11.3503 14.0688 7.99999C14.0686 4.64971 11.3518 1.93379 8.00156 1.93358Z",
|
|
877
|
+
fill: "currentColor"
|
|
878
|
+
}
|
|
879
|
+
)
|
|
880
|
+
] }),
|
|
881
|
+
/* @__PURE__ */ (0, import_jsx_runtime256.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime256.jsx)("clipPath", { id: "clip0_1188_11261", children: /* @__PURE__ */ (0, import_jsx_runtime256.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
882
|
+
]
|
|
883
|
+
}
|
|
884
|
+
);
|
|
885
|
+
var InfoIcon_default = InfoIcon;
|
|
815
886
|
|
|
816
887
|
// src/tokens/svg/status/LoaderIcon.tsx
|
|
817
888
|
var import_jsx_runtime257 = require("react/jsx-runtime");
|
|
@@ -836,6 +907,24 @@ var import_jsx_runtime263 = require("react/jsx-runtime");
|
|
|
836
907
|
|
|
837
908
|
// src/tokens/svg/status/SuccessIcon.tsx
|
|
838
909
|
var import_jsx_runtime264 = require("react/jsx-runtime");
|
|
910
|
+
var SuccessIcon = () => /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(
|
|
911
|
+
"svg",
|
|
912
|
+
{
|
|
913
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
914
|
+
width: "1em",
|
|
915
|
+
height: "1em",
|
|
916
|
+
viewBox: "0 0 16 16",
|
|
917
|
+
fill: "none",
|
|
918
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(
|
|
919
|
+
"path",
|
|
920
|
+
{
|
|
921
|
+
d: "M12.9084 3.57597C13.1426 3.34172 13.5225 3.34185 13.7568 3.57597C13.9911 3.81028 13.9911 4.19009 13.7568 4.4244L6.424 11.758C6.31157 11.8703 6.15869 11.9337 5.99978 11.9338C5.8409 11.9337 5.68798 11.8703 5.57556 11.758L2.24197 8.4244C2.00782 8.19018 2.00795 7.81028 2.24197 7.57597C2.47626 7.34167 2.85609 7.34172 3.09041 7.57597L5.999 10.4846L12.9084 3.57597Z",
|
|
922
|
+
fill: "currentColor"
|
|
923
|
+
}
|
|
924
|
+
)
|
|
925
|
+
}
|
|
926
|
+
);
|
|
927
|
+
var SuccessIcon_default = SuccessIcon;
|
|
839
928
|
|
|
840
929
|
// src/tokens/svg/status/XCircleIcon.tsx
|
|
841
930
|
var import_jsx_runtime265 = require("react/jsx-runtime");
|
|
@@ -930,6 +1019,9 @@ var import_jsx_runtime294 = require("react/jsx-runtime");
|
|
|
930
1019
|
// src/tokens/index.ts
|
|
931
1020
|
var import_tokens_core2 = require("@x-plat/tokens-core");
|
|
932
1021
|
|
|
1022
|
+
// src/tokens/interface/status.ts
|
|
1023
|
+
var normalizeStatus = (value) => value === "brand" ? "primary" : value;
|
|
1024
|
+
|
|
933
1025
|
// ../../node_modules/clsx/dist/clsx.mjs
|
|
934
1026
|
function r(e) {
|
|
935
1027
|
var t, f, n = "";
|
|
@@ -946,8 +1038,43 @@ function clsx() {
|
|
|
946
1038
|
}
|
|
947
1039
|
var clsx_default = clsx;
|
|
948
1040
|
|
|
949
|
-
// src/components/
|
|
1041
|
+
// src/components/FieldMessage/FieldMessage.tsx
|
|
950
1042
|
var import_jsx_runtime295 = require("react/jsx-runtime");
|
|
1043
|
+
var ICON = {
|
|
1044
|
+
default: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(InfoIcon_default, {}),
|
|
1045
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(SuccessIcon_default, {}),
|
|
1046
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(InfoIcon_default, {}),
|
|
1047
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(ErrorIcon_default, {})
|
|
1048
|
+
};
|
|
1049
|
+
var FieldMessage = (props) => {
|
|
1050
|
+
const { validations } = props;
|
|
1051
|
+
if (!validations || validations.length === 0) return null;
|
|
1052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("div", { className: "lib-xplat-field-message-wrap", children: validations.map((v, idx) => /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)(
|
|
1053
|
+
"div",
|
|
1054
|
+
{
|
|
1055
|
+
className: clsx_default("lib-xplat-field-message", v.status),
|
|
1056
|
+
children: [
|
|
1057
|
+
/* @__PURE__ */ (0, import_jsx_runtime295.jsx)("div", { className: "icon", children: ICON[v.status] }),
|
|
1058
|
+
/* @__PURE__ */ (0, import_jsx_runtime295.jsx)("span", { children: v.message })
|
|
1059
|
+
]
|
|
1060
|
+
},
|
|
1061
|
+
`${v.message}_${idx}`
|
|
1062
|
+
)) });
|
|
1063
|
+
};
|
|
1064
|
+
FieldMessage.displayName = "FieldMessage";
|
|
1065
|
+
var Field = (props) => {
|
|
1066
|
+
const { validations, children } = props;
|
|
1067
|
+
if (!validations || validations.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(import_jsx_runtime295.Fragment, { children });
|
|
1068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)("div", { className: "lib-xplat-field", children: [
|
|
1069
|
+
children,
|
|
1070
|
+
/* @__PURE__ */ (0, import_jsx_runtime295.jsx)(FieldMessage, { validations })
|
|
1071
|
+
] });
|
|
1072
|
+
};
|
|
1073
|
+
Field.displayName = "Field";
|
|
1074
|
+
var hasError = (validations) => !!validations?.some((v) => v.status === "error");
|
|
1075
|
+
|
|
1076
|
+
// src/components/CheckBox/CheckBox.tsx
|
|
1077
|
+
var import_jsx_runtime296 = require("react/jsx-runtime");
|
|
951
1078
|
var CheckBox = (props) => {
|
|
952
1079
|
const {
|
|
953
1080
|
checked,
|
|
@@ -956,9 +1083,11 @@ var CheckBox = (props) => {
|
|
|
956
1083
|
onChange,
|
|
957
1084
|
disabled,
|
|
958
1085
|
size = "md",
|
|
959
|
-
type = "
|
|
1086
|
+
type = "primary",
|
|
1087
|
+
validations,
|
|
960
1088
|
...rest
|
|
961
1089
|
} = props;
|
|
1090
|
+
const statusType = normalizeStatus(type);
|
|
962
1091
|
const handleChange = (e) => {
|
|
963
1092
|
if (onChange) onChange(e);
|
|
964
1093
|
};
|
|
@@ -966,20 +1095,22 @@ var CheckBox = (props) => {
|
|
|
966
1095
|
const checkedClasses = `checked`;
|
|
967
1096
|
const disabledClasses = "disabled";
|
|
968
1097
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
969
|
-
|
|
970
|
-
/* @__PURE__ */ (0,
|
|
1098
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime296.jsxs)("label", { className: clsx_default("lib-xplat-checkbox", size, statusType, className), children: [
|
|
1099
|
+
/* @__PURE__ */ (0, import_jsx_runtime296.jsx)(
|
|
971
1100
|
"input",
|
|
972
1101
|
{
|
|
973
1102
|
type: "checkbox",
|
|
974
1103
|
checked,
|
|
975
1104
|
onChange: handleChange,
|
|
976
1105
|
disabled,
|
|
1106
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
977
1107
|
...rest
|
|
978
1108
|
}
|
|
979
1109
|
),
|
|
980
|
-
/* @__PURE__ */ (0,
|
|
981
|
-
label && /* @__PURE__ */ (0,
|
|
1110
|
+
/* @__PURE__ */ (0, import_jsx_runtime296.jsx)("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ (0, import_jsx_runtime296.jsx)("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(CheckIcon_default, {}) }) }),
|
|
1111
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime296.jsx)("span", { className: "label", children: label })
|
|
982
1112
|
] });
|
|
1113
|
+
return /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(Field, { validations, children: control });
|
|
983
1114
|
};
|
|
984
1115
|
CheckBox.displayName = "CheckBox";
|
|
985
1116
|
var CheckBox_default = CheckBox;
|
|
@@ -1,3 +1,41 @@
|
|
|
1
|
+
/* src/components/FieldMessage/fieldMessage.scss */
|
|
2
|
+
.lib-xplat-field {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
gap: var(--spacing-space-2);
|
|
6
|
+
}
|
|
7
|
+
.lib-xplat-field-message-wrap {
|
|
8
|
+
display: flex;
|
|
9
|
+
gap: var(--spacing-space-2);
|
|
10
|
+
margin-left: var(--spacing-space-1);
|
|
11
|
+
}
|
|
12
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message {
|
|
13
|
+
display: flex;
|
|
14
|
+
gap: var(--spacing-space-1);
|
|
15
|
+
font-family: var(--semantic-typo-caption-2-r-font);
|
|
16
|
+
font-size: var(--semantic-typo-caption-2-r-size);
|
|
17
|
+
line-height: var(--semantic-typo-caption-2-r-lh);
|
|
18
|
+
font-weight: var(--semantic-typo-caption-2-r-weight);
|
|
19
|
+
letter-spacing: var(--semantic-typo-caption-2-r-ls);
|
|
20
|
+
align-items: center;
|
|
21
|
+
user-select: none;
|
|
22
|
+
}
|
|
23
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message.default {
|
|
24
|
+
color: var(--semantic-icon-secondary);
|
|
25
|
+
}
|
|
26
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message.success {
|
|
27
|
+
color: var(--semantic-text-success);
|
|
28
|
+
}
|
|
29
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message.warning {
|
|
30
|
+
color: var(--semantic-text-warning);
|
|
31
|
+
}
|
|
32
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message.error {
|
|
33
|
+
color: var(--semantic-text-error);
|
|
34
|
+
}
|
|
35
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message > .icon {
|
|
36
|
+
font-size: var(--semantic-typo-label-2-m-size);
|
|
37
|
+
}
|
|
38
|
+
|
|
1
39
|
/* src/components/CheckBox/checkbox.scss */
|
|
2
40
|
.lib-xplat-checkbox {
|
|
3
41
|
display: flex;
|
|
@@ -72,6 +110,7 @@
|
|
|
72
110
|
.lib-xplat-checkbox:hover > .checkbox.unchecked {
|
|
73
111
|
background-color: var(--semantic-surface-neutral-disabled);
|
|
74
112
|
}
|
|
113
|
+
.lib-xplat-checkbox.primary > .checkbox.checked,
|
|
75
114
|
.lib-xplat-checkbox.brand > .checkbox.checked {
|
|
76
115
|
background-color: var(--semantic-surface-brand-default);
|
|
77
116
|
}
|
|
@@ -87,6 +126,7 @@
|
|
|
87
126
|
.lib-xplat-checkbox.info > .checkbox.checked {
|
|
88
127
|
background-color: var(--semantic-surface-info-default);
|
|
89
128
|
}
|
|
129
|
+
.lib-xplat-checkbox:hover.primary > .checkbox.checked,
|
|
90
130
|
.lib-xplat-checkbox:hover.brand > .checkbox.checked {
|
|
91
131
|
background-color: var(--semantic-surface-brand-strong);
|
|
92
132
|
}
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { I as InputAttributes } from '../../attributes-DJIWir_0.cjs';
|
|
3
|
+
import { L as LegacyStatusType } from '../../status-g_KP3qT6.cjs';
|
|
4
|
+
import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
|
|
3
5
|
import 'react';
|
|
4
6
|
|
|
5
7
|
type CheckBoxSize = "sm" | "md" | "lg";
|
|
6
|
-
|
|
8
|
+
/** CheckBox 의 상태 색 */
|
|
9
|
+
type CheckBoxType = "primary" | "success" | "error" | "warning" | "info";
|
|
10
|
+
/** 입력으로는 예전 이름 `brand` 도 받는다 (= `primary`) */
|
|
11
|
+
type CheckBoxTypeInput = CheckBoxType | LegacyStatusType;
|
|
7
12
|
interface CheckBoxProps extends Omit<InputAttributes, "size"> {
|
|
13
|
+
/** 체크박스 옆에 붙는 글자. 클릭하면 체크가 토글된다 */
|
|
8
14
|
label?: string;
|
|
15
|
+
/** 체크 여부. 주면 controlled 가 되므로 onChange 와 함께 쓴다 */
|
|
9
16
|
checked?: boolean;
|
|
17
|
+
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
18
|
+
validations?: Validation[];
|
|
19
|
+
/** 컨트롤 크기. 글자 크기도 함께 바뀐다 */
|
|
10
20
|
size?: CheckBoxSize;
|
|
11
|
-
|
|
21
|
+
/** 체크됐을 때의 색 */
|
|
22
|
+
type?: CheckBoxTypeInput;
|
|
12
23
|
}
|
|
13
24
|
declare const CheckBox: {
|
|
14
25
|
(props: CheckBoxProps): react_jsx_runtime.JSX.Element;
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { I as InputAttributes } from '../../attributes-DJIWir_0.js';
|
|
3
|
+
import { L as LegacyStatusType } from '../../status-g_KP3qT6.js';
|
|
4
|
+
import { V as Validation } from '../../validation-Dqo1zqhT.js';
|
|
3
5
|
import 'react';
|
|
4
6
|
|
|
5
7
|
type CheckBoxSize = "sm" | "md" | "lg";
|
|
6
|
-
|
|
8
|
+
/** CheckBox 의 상태 색 */
|
|
9
|
+
type CheckBoxType = "primary" | "success" | "error" | "warning" | "info";
|
|
10
|
+
/** 입력으로는 예전 이름 `brand` 도 받는다 (= `primary`) */
|
|
11
|
+
type CheckBoxTypeInput = CheckBoxType | LegacyStatusType;
|
|
7
12
|
interface CheckBoxProps extends Omit<InputAttributes, "size"> {
|
|
13
|
+
/** 체크박스 옆에 붙는 글자. 클릭하면 체크가 토글된다 */
|
|
8
14
|
label?: string;
|
|
15
|
+
/** 체크 여부. 주면 controlled 가 되므로 onChange 와 함께 쓴다 */
|
|
9
16
|
checked?: boolean;
|
|
17
|
+
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
18
|
+
validations?: Validation[];
|
|
19
|
+
/** 컨트롤 크기. 글자 크기도 함께 바뀐다 */
|
|
10
20
|
size?: CheckBoxSize;
|
|
11
|
-
|
|
21
|
+
/** 체크됐을 때의 색 */
|
|
22
|
+
type?: CheckBoxTypeInput;
|
|
12
23
|
}
|
|
13
24
|
declare const CheckBox: {
|
|
14
25
|
(props: CheckBoxProps): react_jsx_runtime.JSX.Element;
|
|
@@ -780,12 +780,83 @@ var CheckIcon_default = CheckIcon;
|
|
|
780
780
|
|
|
781
781
|
// src/tokens/svg/status/ErrorIcon.tsx
|
|
782
782
|
import { jsx as jsx254, jsxs as jsxs160 } from "react/jsx-runtime";
|
|
783
|
+
var ErrorIcon = () => /* @__PURE__ */ jsxs160(
|
|
784
|
+
"svg",
|
|
785
|
+
{
|
|
786
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
787
|
+
width: "1em",
|
|
788
|
+
height: "1em",
|
|
789
|
+
viewBox: "0 0 16 16",
|
|
790
|
+
fill: "none",
|
|
791
|
+
children: [
|
|
792
|
+
/* @__PURE__ */ jsxs160("g", { clipPath: "url(#clip0_1196_9603)", children: [
|
|
793
|
+
/* @__PURE__ */ jsx254(
|
|
794
|
+
"path",
|
|
795
|
+
{
|
|
796
|
+
d: "M9.57588 5.57559C9.81019 5.34127 10.19 5.34127 10.4243 5.57559C10.6586 5.8099 10.6586 6.18971 10.4243 6.42402L8.84854 7.9998L10.4243 9.57559C10.6586 9.8099 10.6586 10.1897 10.4243 10.424C10.19 10.6583 9.81019 10.6583 9.57588 10.424L8.0001 8.84824L6.42432 10.424C6.19 10.6583 5.81019 10.6583 5.57588 10.424C5.34156 10.1897 5.34156 9.8099 5.57588 9.57559L7.15166 7.9998L5.57588 6.42402C5.34156 6.18971 5.34156 5.8099 5.57588 5.57559C5.81019 5.34127 6.19 5.34127 6.42432 5.57559L8.0001 7.15137L9.57588 5.57559Z",
|
|
797
|
+
fill: "currentColor"
|
|
798
|
+
}
|
|
799
|
+
),
|
|
800
|
+
/* @__PURE__ */ jsx254(
|
|
801
|
+
"path",
|
|
802
|
+
{
|
|
803
|
+
fillRule: "evenodd",
|
|
804
|
+
clipRule: "evenodd",
|
|
805
|
+
d: "M8.0001 0.733398C12.0131 0.73361 15.2671 3.98679 15.2673 7.9998C15.2672 12.0129 12.0131 15.2668 8.0001 15.267C3.98701 15.2669 0.733016 12.0129 0.73291 7.9998C0.733051 3.98674 3.98704 0.733539 8.0001 0.733398ZM8.0001 1.9334C4.64978 1.93354 1.93383 4.64948 1.93369 7.9998C1.9338 11.3502 4.64975 14.0669 8.0001 14.067C11.3504 14.0668 14.0672 11.3501 14.0673 7.9998C14.0671 4.64953 11.3504 1.93361 8.0001 1.9334Z",
|
|
806
|
+
fill: "currentColor"
|
|
807
|
+
}
|
|
808
|
+
)
|
|
809
|
+
] }),
|
|
810
|
+
/* @__PURE__ */ jsx254("defs", { children: /* @__PURE__ */ jsx254("clipPath", { id: "clip0_1196_9603", children: /* @__PURE__ */ jsx254("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
811
|
+
]
|
|
812
|
+
}
|
|
813
|
+
);
|
|
814
|
+
var ErrorIcon_default = ErrorIcon;
|
|
783
815
|
|
|
784
816
|
// src/tokens/svg/status/HelpCircleIcon.tsx
|
|
785
817
|
import { jsx as jsx255, jsxs as jsxs161 } from "react/jsx-runtime";
|
|
786
818
|
|
|
787
819
|
// src/tokens/svg/status/InfoIcon.tsx
|
|
788
820
|
import { jsx as jsx256, jsxs as jsxs162 } from "react/jsx-runtime";
|
|
821
|
+
var InfoIcon = () => /* @__PURE__ */ jsxs162(
|
|
822
|
+
"svg",
|
|
823
|
+
{
|
|
824
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
825
|
+
width: "1em",
|
|
826
|
+
height: "1em",
|
|
827
|
+
viewBox: "0 0 16 16",
|
|
828
|
+
fill: "none",
|
|
829
|
+
children: [
|
|
830
|
+
/* @__PURE__ */ jsxs162("g", { clipPath: "url(#clip0_1188_11261)", children: [
|
|
831
|
+
/* @__PURE__ */ jsx256(
|
|
832
|
+
"path",
|
|
833
|
+
{
|
|
834
|
+
d: "M8.00156 7.39999C8.33293 7.39999 8.60156 7.66862 8.60156 7.99999V10.6664C8.60156 10.9978 8.33293 11.2664 8.00156 11.2664C7.67019 11.2664 7.40156 10.9978 7.40156 10.6664V7.99999C7.40156 7.66862 7.67019 7.39999 8.00156 7.39999Z",
|
|
835
|
+
fill: "currentColor"
|
|
836
|
+
}
|
|
837
|
+
),
|
|
838
|
+
/* @__PURE__ */ jsx256(
|
|
839
|
+
"path",
|
|
840
|
+
{
|
|
841
|
+
d: "M8.00859 4.73358C8.3398 4.73378 8.60859 5.00233 8.60859 5.33358C8.60849 5.66474 8.33973 5.93338 8.00859 5.93358H8.00156C7.67026 5.93358 7.40167 5.66486 7.40156 5.33358C7.40156 5.00221 7.67019 4.73358 8.00156 4.73358H8.00859Z",
|
|
842
|
+
fill: "currentColor"
|
|
843
|
+
}
|
|
844
|
+
),
|
|
845
|
+
/* @__PURE__ */ jsx256(
|
|
846
|
+
"path",
|
|
847
|
+
{
|
|
848
|
+
fillRule: "evenodd",
|
|
849
|
+
clipRule: "evenodd",
|
|
850
|
+
d: "M8.00156 0.733582C12.0146 0.733793 15.2686 3.98697 15.2688 7.99999C15.2686 12.013 12.0146 15.267 8.00156 15.2672C3.98848 15.267 0.734481 12.0131 0.734375 7.99999C0.734516 3.98693 3.9885 0.733722 8.00156 0.733582ZM8.00156 1.93358C4.65124 1.93372 1.9353 4.64967 1.93516 7.99999C1.93526 11.3503 4.65122 14.067 8.00156 14.0672C11.3518 14.067 14.0686 11.3503 14.0688 7.99999C14.0686 4.64971 11.3518 1.93379 8.00156 1.93358Z",
|
|
851
|
+
fill: "currentColor"
|
|
852
|
+
}
|
|
853
|
+
)
|
|
854
|
+
] }),
|
|
855
|
+
/* @__PURE__ */ jsx256("defs", { children: /* @__PURE__ */ jsx256("clipPath", { id: "clip0_1188_11261", children: /* @__PURE__ */ jsx256("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
856
|
+
]
|
|
857
|
+
}
|
|
858
|
+
);
|
|
859
|
+
var InfoIcon_default = InfoIcon;
|
|
789
860
|
|
|
790
861
|
// src/tokens/svg/status/LoaderIcon.tsx
|
|
791
862
|
import { jsx as jsx257, jsxs as jsxs163 } from "react/jsx-runtime";
|
|
@@ -810,6 +881,24 @@ import { jsx as jsx263, jsxs as jsxs167 } from "react/jsx-runtime";
|
|
|
810
881
|
|
|
811
882
|
// src/tokens/svg/status/SuccessIcon.tsx
|
|
812
883
|
import { jsx as jsx264 } from "react/jsx-runtime";
|
|
884
|
+
var SuccessIcon = () => /* @__PURE__ */ jsx264(
|
|
885
|
+
"svg",
|
|
886
|
+
{
|
|
887
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
888
|
+
width: "1em",
|
|
889
|
+
height: "1em",
|
|
890
|
+
viewBox: "0 0 16 16",
|
|
891
|
+
fill: "none",
|
|
892
|
+
children: /* @__PURE__ */ jsx264(
|
|
893
|
+
"path",
|
|
894
|
+
{
|
|
895
|
+
d: "M12.9084 3.57597C13.1426 3.34172 13.5225 3.34185 13.7568 3.57597C13.9911 3.81028 13.9911 4.19009 13.7568 4.4244L6.424 11.758C6.31157 11.8703 6.15869 11.9337 5.99978 11.9338C5.8409 11.9337 5.68798 11.8703 5.57556 11.758L2.24197 8.4244C2.00782 8.19018 2.00795 7.81028 2.24197 7.57597C2.47626 7.34167 2.85609 7.34172 3.09041 7.57597L5.999 10.4846L12.9084 3.57597Z",
|
|
896
|
+
fill: "currentColor"
|
|
897
|
+
}
|
|
898
|
+
)
|
|
899
|
+
}
|
|
900
|
+
);
|
|
901
|
+
var SuccessIcon_default = SuccessIcon;
|
|
813
902
|
|
|
814
903
|
// src/tokens/svg/status/XCircleIcon.tsx
|
|
815
904
|
import { jsx as jsx265, jsxs as jsxs168 } from "react/jsx-runtime";
|
|
@@ -904,6 +993,9 @@ import { jsx as jsx294, jsxs as jsxs188 } from "react/jsx-runtime";
|
|
|
904
993
|
// src/tokens/index.ts
|
|
905
994
|
import { cssVar } from "@x-plat/tokens-core";
|
|
906
995
|
|
|
996
|
+
// src/tokens/interface/status.ts
|
|
997
|
+
var normalizeStatus = (value) => value === "brand" ? "primary" : value;
|
|
998
|
+
|
|
907
999
|
// ../../node_modules/clsx/dist/clsx.mjs
|
|
908
1000
|
function r(e) {
|
|
909
1001
|
var t, f, n = "";
|
|
@@ -920,8 +1012,43 @@ function clsx() {
|
|
|
920
1012
|
}
|
|
921
1013
|
var clsx_default = clsx;
|
|
922
1014
|
|
|
1015
|
+
// src/components/FieldMessage/FieldMessage.tsx
|
|
1016
|
+
import { Fragment, jsx as jsx295, jsxs as jsxs189 } from "react/jsx-runtime";
|
|
1017
|
+
var ICON = {
|
|
1018
|
+
default: /* @__PURE__ */ jsx295(InfoIcon_default, {}),
|
|
1019
|
+
success: /* @__PURE__ */ jsx295(SuccessIcon_default, {}),
|
|
1020
|
+
warning: /* @__PURE__ */ jsx295(InfoIcon_default, {}),
|
|
1021
|
+
error: /* @__PURE__ */ jsx295(ErrorIcon_default, {})
|
|
1022
|
+
};
|
|
1023
|
+
var FieldMessage = (props) => {
|
|
1024
|
+
const { validations } = props;
|
|
1025
|
+
if (!validations || validations.length === 0) return null;
|
|
1026
|
+
return /* @__PURE__ */ jsx295("div", { className: "lib-xplat-field-message-wrap", children: validations.map((v, idx) => /* @__PURE__ */ jsxs189(
|
|
1027
|
+
"div",
|
|
1028
|
+
{
|
|
1029
|
+
className: clsx_default("lib-xplat-field-message", v.status),
|
|
1030
|
+
children: [
|
|
1031
|
+
/* @__PURE__ */ jsx295("div", { className: "icon", children: ICON[v.status] }),
|
|
1032
|
+
/* @__PURE__ */ jsx295("span", { children: v.message })
|
|
1033
|
+
]
|
|
1034
|
+
},
|
|
1035
|
+
`${v.message}_${idx}`
|
|
1036
|
+
)) });
|
|
1037
|
+
};
|
|
1038
|
+
FieldMessage.displayName = "FieldMessage";
|
|
1039
|
+
var Field = (props) => {
|
|
1040
|
+
const { validations, children } = props;
|
|
1041
|
+
if (!validations || validations.length === 0) return /* @__PURE__ */ jsx295(Fragment, { children });
|
|
1042
|
+
return /* @__PURE__ */ jsxs189("div", { className: "lib-xplat-field", children: [
|
|
1043
|
+
children,
|
|
1044
|
+
/* @__PURE__ */ jsx295(FieldMessage, { validations })
|
|
1045
|
+
] });
|
|
1046
|
+
};
|
|
1047
|
+
Field.displayName = "Field";
|
|
1048
|
+
var hasError = (validations) => !!validations?.some((v) => v.status === "error");
|
|
1049
|
+
|
|
923
1050
|
// src/components/CheckBox/CheckBox.tsx
|
|
924
|
-
import { jsx as
|
|
1051
|
+
import { jsx as jsx296, jsxs as jsxs190 } from "react/jsx-runtime";
|
|
925
1052
|
var CheckBox = (props) => {
|
|
926
1053
|
const {
|
|
927
1054
|
checked,
|
|
@@ -930,9 +1057,11 @@ var CheckBox = (props) => {
|
|
|
930
1057
|
onChange,
|
|
931
1058
|
disabled,
|
|
932
1059
|
size = "md",
|
|
933
|
-
type = "
|
|
1060
|
+
type = "primary",
|
|
1061
|
+
validations,
|
|
934
1062
|
...rest
|
|
935
1063
|
} = props;
|
|
1064
|
+
const statusType = normalizeStatus(type);
|
|
936
1065
|
const handleChange = (e) => {
|
|
937
1066
|
if (onChange) onChange(e);
|
|
938
1067
|
};
|
|
@@ -940,20 +1069,22 @@ var CheckBox = (props) => {
|
|
|
940
1069
|
const checkedClasses = `checked`;
|
|
941
1070
|
const disabledClasses = "disabled";
|
|
942
1071
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
943
|
-
|
|
944
|
-
/* @__PURE__ */
|
|
1072
|
+
const control = /* @__PURE__ */ jsxs190("label", { className: clsx_default("lib-xplat-checkbox", size, statusType, className), children: [
|
|
1073
|
+
/* @__PURE__ */ jsx296(
|
|
945
1074
|
"input",
|
|
946
1075
|
{
|
|
947
1076
|
type: "checkbox",
|
|
948
1077
|
checked,
|
|
949
1078
|
onChange: handleChange,
|
|
950
1079
|
disabled,
|
|
1080
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
951
1081
|
...rest
|
|
952
1082
|
}
|
|
953
1083
|
),
|
|
954
|
-
/* @__PURE__ */
|
|
955
|
-
label && /* @__PURE__ */
|
|
1084
|
+
/* @__PURE__ */ jsx296("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ jsx296("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ jsx296(CheckIcon_default, {}) }) }),
|
|
1085
|
+
label && /* @__PURE__ */ jsx296("span", { className: "label", children: label })
|
|
956
1086
|
] });
|
|
1087
|
+
return /* @__PURE__ */ jsx296(Field, { validations, children: control });
|
|
957
1088
|
};
|
|
958
1089
|
CheckBox.displayName = "CheckBox";
|
|
959
1090
|
var CheckBox_default = CheckBox;
|
|
@@ -5,7 +5,9 @@ type ChipType = "primary" | "secondary" | "neutral" | "success" | "error" | "war
|
|
|
5
5
|
type ChipSize = "sm" | "md" | "lg";
|
|
6
6
|
interface ChipProps {
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
+
/** 칩 색. 상태를 나타낸다 */
|
|
8
9
|
type?: ChipType;
|
|
10
|
+
/** 칩 크기 */
|
|
9
11
|
size?: ChipSize;
|
|
10
12
|
}
|
|
11
13
|
declare const Chip: {
|
|
@@ -5,7 +5,9 @@ type ChipType = "primary" | "secondary" | "neutral" | "success" | "error" | "war
|
|
|
5
5
|
type ChipSize = "sm" | "md" | "lg";
|
|
6
6
|
interface ChipProps {
|
|
7
7
|
children: React.ReactNode;
|
|
8
|
+
/** 칩 색. 상태를 나타낸다 */
|
|
8
9
|
type?: ChipType;
|
|
10
|
+
/** 칩 크기 */
|
|
9
11
|
size?: ChipSize;
|
|
10
12
|
}
|
|
11
13
|
declare const Chip: {
|