@x-plat/design-system 0.12.0 → 0.13.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.
Files changed (50) hide show
  1. package/dist/components/AutoResizeTextArea/index.cjs +2 -2
  2. package/dist/components/AutoResizeTextArea/index.js +2 -2
  3. package/dist/components/ChatInput/index.cjs +2 -2
  4. package/dist/components/ChatInput/index.js +2 -2
  5. package/dist/components/CheckBox/index.cjs +2 -2
  6. package/dist/components/CheckBox/index.js +2 -2
  7. package/dist/components/DatePicker/index.cjs +109 -75
  8. package/dist/components/DatePicker/index.d.cts +19 -0
  9. package/dist/components/DatePicker/index.d.ts +19 -0
  10. package/dist/components/DatePicker/index.js +109 -75
  11. package/dist/components/Editor/index.css +3 -0
  12. package/dist/components/FieldMessage/index.cjs +2 -2
  13. package/dist/components/FieldMessage/index.d.cts +8 -0
  14. package/dist/components/FieldMessage/index.d.ts +8 -0
  15. package/dist/components/FieldMessage/index.js +2 -2
  16. package/dist/components/FileUpload/index.cjs +10 -6
  17. package/dist/components/FileUpload/index.d.cts +15 -2
  18. package/dist/components/FileUpload/index.d.ts +15 -2
  19. package/dist/components/FileUpload/index.js +10 -6
  20. package/dist/components/ImageSelector/index.cjs +7 -6
  21. package/dist/components/ImageSelector/index.d.cts +15 -2
  22. package/dist/components/ImageSelector/index.d.ts +15 -2
  23. package/dist/components/ImageSelector/index.js +7 -6
  24. package/dist/components/Input/index.cjs +2 -2
  25. package/dist/components/Input/index.d.cts +4 -0
  26. package/dist/components/Input/index.d.ts +4 -0
  27. package/dist/components/Input/index.js +2 -2
  28. package/dist/components/Radio/index.cjs +2 -2
  29. package/dist/components/Radio/index.js +2 -2
  30. package/dist/components/Select/index.cjs +2 -2
  31. package/dist/components/Select/index.d.cts +1 -2
  32. package/dist/components/Select/index.d.ts +1 -2
  33. package/dist/components/Select/index.js +2 -2
  34. package/dist/components/Switch/index.cjs +2 -2
  35. package/dist/components/Switch/index.js +2 -2
  36. package/dist/components/TextArea/index.cjs +2 -2
  37. package/dist/components/TextArea/index.js +2 -2
  38. package/dist/components/TimePicker/index.cjs +2 -2
  39. package/dist/components/TimePicker/index.js +2 -2
  40. package/dist/components/index.cjs +122 -83
  41. package/dist/components/index.css +3 -0
  42. package/dist/components/index.js +122 -83
  43. package/dist/index.cjs +122 -83
  44. package/dist/index.css +3 -0
  45. package/dist/index.js +122 -83
  46. package/guidelines/Guidelines.md +12 -0
  47. package/guidelines/MIGRATION.md +270 -0
  48. package/guidelines/components/datepicker.md +26 -0
  49. package/guidelines/components/file-media.md +21 -4
  50. package/package.json +1 -1
@@ -178,11 +178,11 @@ var FieldMessage = (props) => {
178
178
  FieldMessage.displayName = "FieldMessage";
179
179
  var FieldMessage_default = FieldMessage;
180
180
  var Field = (props) => {
181
- const { label, required = false, htmlFor, validations, children } = props;
181
+ const { label, required = false, htmlFor, labelId, validations, children } = props;
182
182
  const hasMessages = !!validations && validations.length > 0;
183
183
  if (!label && !hasMessages) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children });
184
184
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "lib-xplat-field", children: [
185
- label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", htmlFor, children: [
185
+ label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
186
186
  label,
187
187
  required && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "required", "aria-hidden": "true", children: "*" })
188
188
  ] }),
@@ -23,6 +23,10 @@ interface PasswordInputProps extends Omit<InputAttributes, "size"> {
23
23
  validations?: Validation[];
24
24
  /** 높이와 글자 크기 */
25
25
  size?: InputSize;
26
+ /** 컨트롤 위에 붙는 라벨. 클릭하면 입력칸에 포커스가 간다 */
27
+ label?: React.ReactNode;
28
+ /** 라벨 뒤에 필수 표시(*)를 붙인다 */
29
+ required?: boolean;
26
30
  reg?: RegExp;
27
31
  }
28
32
  declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps & React.RefAttributes<HTMLInputElement>>;
@@ -23,6 +23,10 @@ interface PasswordInputProps extends Omit<InputAttributes, "size"> {
23
23
  validations?: Validation[];
24
24
  /** 높이와 글자 크기 */
25
25
  size?: InputSize;
26
+ /** 컨트롤 위에 붙는 라벨. 클릭하면 입력칸에 포커스가 간다 */
27
+ label?: React.ReactNode;
28
+ /** 라벨 뒤에 필수 표시(*)를 붙인다 */
29
+ required?: boolean;
26
30
  reg?: RegExp;
27
31
  }
28
32
  declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps & React.RefAttributes<HTMLInputElement>>;
@@ -141,11 +141,11 @@ var FieldMessage = (props) => {
141
141
  FieldMessage.displayName = "FieldMessage";
142
142
  var FieldMessage_default = FieldMessage;
143
143
  var Field = (props) => {
144
- const { label, required = false, htmlFor, validations, children } = props;
144
+ const { label, required = false, htmlFor, labelId, validations, children } = props;
145
145
  const hasMessages = !!validations && validations.length > 0;
146
146
  if (!label && !hasMessages) return /* @__PURE__ */ jsx4(Fragment, { children });
147
147
  return /* @__PURE__ */ jsxs3("div", { className: "lib-xplat-field", children: [
148
- label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", htmlFor, children: [
148
+ label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
149
149
  label,
150
150
  required && /* @__PURE__ */ jsx4("span", { className: "required", "aria-hidden": "true", children: "*" })
151
151
  ] }),
@@ -177,11 +177,11 @@ var FieldMessage = (props) => {
177
177
  };
178
178
  FieldMessage.displayName = "FieldMessage";
179
179
  var Field = (props) => {
180
- const { label, required = false, htmlFor, validations, children } = props;
180
+ const { label, required = false, htmlFor, labelId, validations, children } = props;
181
181
  const hasMessages = !!validations && validations.length > 0;
182
182
  if (!label && !hasMessages) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children });
183
183
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "lib-xplat-field", children: [
184
- label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", htmlFor, children: [
184
+ label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
185
185
  label,
186
186
  required && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "required", "aria-hidden": "true", children: "*" })
187
187
  ] }),
@@ -140,11 +140,11 @@ var FieldMessage = (props) => {
140
140
  };
141
141
  FieldMessage.displayName = "FieldMessage";
142
142
  var Field = (props) => {
143
- const { label, required = false, htmlFor, validations, children } = props;
143
+ const { label, required = false, htmlFor, labelId, validations, children } = props;
144
144
  const hasMessages = !!validations && validations.length > 0;
145
145
  if (!label && !hasMessages) return /* @__PURE__ */ jsx4(Fragment, { children });
146
146
  return /* @__PURE__ */ jsxs3("div", { className: "lib-xplat-field", children: [
147
- label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", htmlFor, children: [
147
+ label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
148
148
  label,
149
149
  required && /* @__PURE__ */ jsx4("span", { className: "required", "aria-hidden": "true", children: "*" })
150
150
  ] }),
@@ -1200,11 +1200,11 @@ var FieldMessage = (props) => {
1200
1200
  };
1201
1201
  FieldMessage.displayName = "FieldMessage";
1202
1202
  var Field = (props) => {
1203
- const { label, required = false, htmlFor, validations, children } = props;
1203
+ const { label, required = false, htmlFor, labelId, validations, children } = props;
1204
1204
  const hasMessages = !!validations && validations.length > 0;
1205
1205
  if (!label && !hasMessages) return /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(import_jsx_runtime295.Fragment, { children });
1206
1206
  return /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)("div", { className: "lib-xplat-field", children: [
1207
- label && /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)("label", { className: "lib-xplat-field-label", htmlFor, children: [
1207
+ label && /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
1208
1208
  label,
1209
1209
  required && /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("span", { className: "required", "aria-hidden": "true", children: "*" })
1210
1210
  ] }),
@@ -34,10 +34,8 @@ interface SelectProps {
34
34
  children: SelectItemElement | SelectItemElement[];
35
35
  /** 비활성화 상태 */
36
36
  disabled?: boolean;
37
- /** 에러 상태 */
38
37
  /** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
39
38
  validations?: Validation[];
40
- /** 메시지 없이 테두리만 붉게 한다. validations 와 함께 쓰면 둘 중 하나만 참이어도 적용된다 */
41
39
  /** 컨트롤 위에 붙는 라벨. 클릭하면 컨트롤에 포커스가 간다 */
42
40
  label?: React.ReactNode;
43
41
  /** 라벨 뒤에 필수 표시(*)를 붙인다 */
@@ -49,6 +47,7 @@ interface SelectProps {
49
47
  searchable?: boolean;
50
48
  /** 검색칸 안내 문구 */
51
49
  searchPlaceholder?: string;
50
+ /** 메시지 없이 테두리만 붉게 한다. validations 와 함께 쓰면 둘 중 하나만 참이어도 적용된다 */
52
51
  error?: boolean;
53
52
  /** 사이즈 */
54
53
  size?: SelectSize;
@@ -34,10 +34,8 @@ interface SelectProps {
34
34
  children: SelectItemElement | SelectItemElement[];
35
35
  /** 비활성화 상태 */
36
36
  disabled?: boolean;
37
- /** 에러 상태 */
38
37
  /** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
39
38
  validations?: Validation[];
40
- /** 메시지 없이 테두리만 붉게 한다. validations 와 함께 쓰면 둘 중 하나만 참이어도 적용된다 */
41
39
  /** 컨트롤 위에 붙는 라벨. 클릭하면 컨트롤에 포커스가 간다 */
42
40
  label?: React.ReactNode;
43
41
  /** 라벨 뒤에 필수 표시(*)를 붙인다 */
@@ -49,6 +47,7 @@ interface SelectProps {
49
47
  searchable?: boolean;
50
48
  /** 검색칸 안내 문구 */
51
49
  searchPlaceholder?: string;
50
+ /** 메시지 없이 테두리만 붉게 한다. validations 와 함께 쓰면 둘 중 하나만 참이어도 적용된다 */
52
51
  error?: boolean;
53
52
  /** 사이즈 */
54
53
  size?: SelectSize;
@@ -1163,11 +1163,11 @@ var FieldMessage = (props) => {
1163
1163
  };
1164
1164
  FieldMessage.displayName = "FieldMessage";
1165
1165
  var Field = (props) => {
1166
- const { label, required = false, htmlFor, validations, children } = props;
1166
+ const { label, required = false, htmlFor, labelId, validations, children } = props;
1167
1167
  const hasMessages = !!validations && validations.length > 0;
1168
1168
  if (!label && !hasMessages) return /* @__PURE__ */ jsx295(Fragment, { children });
1169
1169
  return /* @__PURE__ */ jsxs189("div", { className: "lib-xplat-field", children: [
1170
- label && /* @__PURE__ */ jsxs189("label", { className: "lib-xplat-field-label", htmlFor, children: [
1170
+ label && /* @__PURE__ */ jsxs189("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
1171
1171
  label,
1172
1172
  required && /* @__PURE__ */ jsx295("span", { className: "required", "aria-hidden": "true", children: "*" })
1173
1173
  ] }),
@@ -179,11 +179,11 @@ var FieldMessage = (props) => {
179
179
  };
180
180
  FieldMessage.displayName = "FieldMessage";
181
181
  var Field = (props) => {
182
- const { label, required = false, htmlFor, validations, children } = props;
182
+ const { label, required = false, htmlFor, labelId, validations, children } = props;
183
183
  const hasMessages = !!validations && validations.length > 0;
184
184
  if (!label && !hasMessages) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children });
185
185
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "lib-xplat-field", children: [
186
- label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", htmlFor, children: [
186
+ label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
187
187
  label,
188
188
  required && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "required", "aria-hidden": "true", children: "*" })
189
189
  ] }),
@@ -143,11 +143,11 @@ var FieldMessage = (props) => {
143
143
  };
144
144
  FieldMessage.displayName = "FieldMessage";
145
145
  var Field = (props) => {
146
- const { label, required = false, htmlFor, validations, children } = props;
146
+ const { label, required = false, htmlFor, labelId, validations, children } = props;
147
147
  const hasMessages = !!validations && validations.length > 0;
148
148
  if (!label && !hasMessages) return /* @__PURE__ */ jsx4(Fragment, { children });
149
149
  return /* @__PURE__ */ jsxs3("div", { className: "lib-xplat-field", children: [
150
- label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", htmlFor, children: [
150
+ label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
151
151
  label,
152
152
  required && /* @__PURE__ */ jsx4("span", { className: "required", "aria-hidden": "true", children: "*" })
153
153
  ] }),
@@ -176,11 +176,11 @@ var FieldMessage = (props) => {
176
176
  };
177
177
  FieldMessage.displayName = "FieldMessage";
178
178
  var Field = (props) => {
179
- const { label, required = false, htmlFor, validations, children } = props;
179
+ const { label, required = false, htmlFor, labelId, validations, children } = props;
180
180
  const hasMessages = !!validations && validations.length > 0;
181
181
  if (!label && !hasMessages) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children });
182
182
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "lib-xplat-field", children: [
183
- label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", htmlFor, children: [
183
+ label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
184
184
  label,
185
185
  required && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "required", "aria-hidden": "true", children: "*" })
186
186
  ] }),
@@ -140,11 +140,11 @@ var FieldMessage = (props) => {
140
140
  };
141
141
  FieldMessage.displayName = "FieldMessage";
142
142
  var Field = (props) => {
143
- const { label, required = false, htmlFor, validations, children } = props;
143
+ const { label, required = false, htmlFor, labelId, validations, children } = props;
144
144
  const hasMessages = !!validations && validations.length > 0;
145
145
  if (!label && !hasMessages) return /* @__PURE__ */ jsx4(Fragment, { children });
146
146
  return /* @__PURE__ */ jsxs3("div", { className: "lib-xplat-field", children: [
147
- label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", htmlFor, children: [
147
+ label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
148
148
  label,
149
149
  required && /* @__PURE__ */ jsx4("span", { className: "required", "aria-hidden": "true", children: "*" })
150
150
  ] }),
@@ -308,11 +308,11 @@ var FieldMessage = (props) => {
308
308
  };
309
309
  FieldMessage.displayName = "FieldMessage";
310
310
  var Field = (props) => {
311
- const { label, required = false, htmlFor, validations, children } = props;
311
+ const { label, required = false, htmlFor, labelId, validations, children } = props;
312
312
  const hasMessages = !!validations && validations.length > 0;
313
313
  if (!label && !hasMessages) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children });
314
314
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "lib-xplat-field", children: [
315
- label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", htmlFor, children: [
315
+ label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
316
316
  label,
317
317
  required && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "required", "aria-hidden": "true", children: "*" })
318
318
  ] }),
@@ -272,11 +272,11 @@ var FieldMessage = (props) => {
272
272
  };
273
273
  FieldMessage.displayName = "FieldMessage";
274
274
  var Field = (props) => {
275
- const { label, required = false, htmlFor, validations, children } = props;
275
+ const { label, required = false, htmlFor, labelId, validations, children } = props;
276
276
  const hasMessages = !!validations && validations.length > 0;
277
277
  if (!label && !hasMessages) return /* @__PURE__ */ jsx4(Fragment, { children });
278
278
  return /* @__PURE__ */ jsxs3("div", { className: "lib-xplat-field", children: [
279
- label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", htmlFor, children: [
279
+ label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
280
280
  label,
281
281
  required && /* @__PURE__ */ jsx4("span", { className: "required", "aria-hidden": "true", children: "*" })
282
282
  ] }),
@@ -1633,11 +1633,11 @@ var FieldMessage = (props) => {
1633
1633
  FieldMessage.displayName = "FieldMessage";
1634
1634
  var FieldMessage_default = FieldMessage;
1635
1635
  var Field = (props) => {
1636
- const { label, required = false, htmlFor, validations, children } = props;
1636
+ const { label, required = false, htmlFor, labelId, validations, children } = props;
1637
1637
  const hasMessages = !!validations && validations.length > 0;
1638
1638
  if (!label && !hasMessages) return /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(import_jsx_runtime297.Fragment, { children });
1639
1639
  return /* @__PURE__ */ (0, import_jsx_runtime297.jsxs)("div", { className: "lib-xplat-field", children: [
1640
- label && /* @__PURE__ */ (0, import_jsx_runtime297.jsxs)("label", { className: "lib-xplat-field-label", htmlFor, children: [
1640
+ label && /* @__PURE__ */ (0, import_jsx_runtime297.jsxs)("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
1641
1641
  label,
1642
1642
  required && /* @__PURE__ */ (0, import_jsx_runtime297.jsx)("span", { className: "required", "aria-hidden": "true", children: "*" })
1643
1643
  ] }),
@@ -3404,8 +3404,12 @@ var SingleDatePicker = (props) => {
3404
3404
  highlightDates = [],
3405
3405
  locale = "ko",
3406
3406
  rangeStart,
3407
- rangeEnd
3407
+ rangeEnd,
3408
+ label,
3409
+ required,
3410
+ validations
3408
3411
  } = props;
3412
+ const labelId = import_react12.default.useId();
3409
3413
  const initialYear = value?.getFullYear();
3410
3414
  const initialMonth = value?.getMonth();
3411
3415
  const { year, month, days, goToPrevMonth, goToNextMonth, setYear, setMonth } = useCalendar(
@@ -3468,10 +3472,12 @@ var SingleDatePicker = (props) => {
3468
3472
  const monthLabels = MONTH_LABELS[locale];
3469
3473
  const titleText = pickerMode === "days" ? locale === "ko" ? `${year}\uB144 ${monthLabels[month]}` : `${monthLabels[month]} ${year}` : pickerMode === "months" ? `${year}` : `${yearRangeStart} - ${yearRangeStart + 11}`;
3470
3474
  const hasRange = rangeStart != null && rangeEnd != null;
3471
- return /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(
3475
+ const calendar = /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(
3472
3476
  "div",
3473
3477
  {
3474
3478
  className: clsx_default("lib-xplat-datepicker", "single"),
3479
+ role: "group",
3480
+ "aria-labelledby": label ? labelId : void 0,
3475
3481
  children: [
3476
3482
  /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { className: "datepicker-header", children: [
3477
3483
  /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("button", { className: "datepicker-nav", onClick: handlePrev, type: "button", children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(ChevronLeftIcon_default, {}) }),
@@ -3492,18 +3498,18 @@ var SingleDatePicker = (props) => {
3492
3498
  y
3493
3499
  );
3494
3500
  }) }),
3495
- pickerMode === "months" && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-picker-grid", children: monthLabels.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
3501
+ pickerMode === "months" && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-picker-grid", children: monthLabels.map((label2, i) => /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
3496
3502
  "button",
3497
3503
  {
3498
3504
  type: "button",
3499
3505
  className: clsx_default("datepicker-picker-cell", i === month && "active"),
3500
3506
  onClick: () => handleMonthSelect(i),
3501
- children: label
3507
+ children: label2
3502
3508
  },
3503
3509
  i
3504
3510
  )) }),
3505
3511
  pickerMode === "days" && /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(import_jsx_runtime314.Fragment, { children: [
3506
- /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-weekdays", children: weekdays.map((label, i) => /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
3512
+ /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-weekdays", children: weekdays.map((label2, i) => /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(
3507
3513
  "div",
3508
3514
  {
3509
3515
  className: clsx_default(
@@ -3511,9 +3517,9 @@ var SingleDatePicker = (props) => {
3511
3517
  i === 0 && "sunday",
3512
3518
  i === 6 && "saturday"
3513
3519
  ),
3514
- children: label
3520
+ children: label2
3515
3521
  },
3516
- label
3522
+ label2
3517
3523
  )) }),
3518
3524
  /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "datepicker-grid", children: days.map((day, idx) => {
3519
3525
  const t = day.date.getTime();
@@ -3545,6 +3551,7 @@ var SingleDatePicker = (props) => {
3545
3551
  ]
3546
3552
  }
3547
3553
  );
3554
+ return /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(Field, { label, required, labelId, validations, children: calendar });
3548
3555
  };
3549
3556
  SingleDatePicker.displayName = "SingleDatePicker";
3550
3557
  var SingleDatePicker_default = SingleDatePicker;
@@ -3559,7 +3566,18 @@ var formatDate = (date) => {
3559
3566
  return `${y}/${m}/${d}`;
3560
3567
  };
3561
3568
  var InputDatePicker = (props) => {
3562
- const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
3569
+ const {
3570
+ value,
3571
+ onChange,
3572
+ minDate,
3573
+ maxDate,
3574
+ disabled,
3575
+ locale = "ko",
3576
+ placeholder,
3577
+ label,
3578
+ required,
3579
+ validations
3580
+ } = props;
3563
3581
  const [isOpen, setIsOpen] = import_react13.default.useState(false);
3564
3582
  const [tempDate, setTempDate] = import_react13.default.useState(value ?? /* @__PURE__ */ new Date());
3565
3583
  const handleOpen = () => {
@@ -3585,6 +3603,9 @@ var InputDatePicker = (props) => {
3585
3603
  placeholder,
3586
3604
  suffix: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(CalenderIcon_default, {}),
3587
3605
  disabled,
3606
+ label,
3607
+ required,
3608
+ validations,
3588
3609
  readOnly: true
3589
3610
  }
3590
3611
  ) }),
@@ -3716,8 +3737,12 @@ var RangePicker = (props) => {
3716
3737
  onChange,
3717
3738
  minDate,
3718
3739
  maxDate,
3719
- locale = "ko"
3740
+ locale = "ko",
3741
+ label,
3742
+ required,
3743
+ validations
3720
3744
  } = props;
3745
+ const labelId = import_react16.default.useId();
3721
3746
  const [activeTab, setActiveTab] = import_react16.default.useState("start");
3722
3747
  const handleStartChange = (date) => {
3723
3748
  if (!date) return;
@@ -3731,70 +3756,79 @@ var RangePicker = (props) => {
3731
3756
  };
3732
3757
  const startMaxDate = maxDate && endDate < maxDate ? endDate : endDate;
3733
3758
  const endMinDate = minDate && startDate > minDate ? startDate : startDate;
3734
- return /* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { className: clsx_default("lib-xplat-datepicker", "range"), children: [
3735
- /* @__PURE__ */ (0, import_jsx_runtime318.jsx)("div", { className: "datepicker-range-tabs", children: /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
3736
- Tab_default,
3737
- {
3738
- activeIndex: activeTab === "start" ? 0 : 1,
3739
- tabs: [
3740
- { value: "start", title: locale === "ko" ? "\uC2DC\uC791\uC77C" : "Start" },
3741
- { value: "end", title: locale === "ko" ? "\uC885\uB8CC\uC77C" : "End" }
3742
- ],
3743
- onChange: (tab) => setActiveTab(tab.value),
3744
- type: "toggle",
3745
- size: "sm"
3746
- }
3747
- ) }),
3748
- /* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { className: "datepicker-range-panels", children: [
3749
- /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
3750
- SingleDatePicker_default,
3751
- {
3752
- value: startDate,
3753
- onChange: handleStartChange,
3754
- minDate,
3755
- maxDate: startMaxDate,
3756
- rangeStart: startDate,
3757
- rangeEnd: endDate,
3758
- locale
3759
- }
3760
- ),
3761
- /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
3762
- SingleDatePicker_default,
3763
- {
3764
- value: endDate,
3765
- onChange: handleEndChange,
3766
- minDate: endMinDate,
3767
- maxDate,
3768
- rangeStart: startDate,
3769
- rangeEnd: endDate,
3770
- locale
3771
- }
3772
- )
3773
- ] }),
3774
- /* @__PURE__ */ (0, import_jsx_runtime318.jsx)("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
3775
- SingleDatePicker_default,
3776
- {
3777
- value: startDate,
3778
- onChange: handleStartChange,
3779
- minDate,
3780
- maxDate: startMaxDate,
3781
- rangeStart: startDate,
3782
- rangeEnd: endDate,
3783
- locale
3784
- }
3785
- ) : /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
3786
- SingleDatePicker_default,
3787
- {
3788
- value: endDate,
3789
- onChange: handleEndChange,
3790
- minDate: endMinDate,
3791
- maxDate,
3792
- rangeStart: startDate,
3793
- rangeEnd: endDate,
3794
- locale
3795
- }
3796
- ) })
3797
- ] });
3759
+ const calendar = /* @__PURE__ */ (0, import_jsx_runtime318.jsxs)(
3760
+ "div",
3761
+ {
3762
+ className: clsx_default("lib-xplat-datepicker", "range"),
3763
+ role: "group",
3764
+ "aria-labelledby": label ? labelId : void 0,
3765
+ children: [
3766
+ /* @__PURE__ */ (0, import_jsx_runtime318.jsx)("div", { className: "datepicker-range-tabs", children: /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
3767
+ Tab_default,
3768
+ {
3769
+ activeIndex: activeTab === "start" ? 0 : 1,
3770
+ tabs: [
3771
+ { value: "start", title: locale === "ko" ? "\uC2DC\uC791\uC77C" : "Start" },
3772
+ { value: "end", title: locale === "ko" ? "\uC885\uB8CC\uC77C" : "End" }
3773
+ ],
3774
+ onChange: (tab) => setActiveTab(tab.value),
3775
+ type: "toggle",
3776
+ size: "sm"
3777
+ }
3778
+ ) }),
3779
+ /* @__PURE__ */ (0, import_jsx_runtime318.jsxs)("div", { className: "datepicker-range-panels", children: [
3780
+ /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
3781
+ SingleDatePicker_default,
3782
+ {
3783
+ value: startDate,
3784
+ onChange: handleStartChange,
3785
+ minDate,
3786
+ maxDate: startMaxDate,
3787
+ rangeStart: startDate,
3788
+ rangeEnd: endDate,
3789
+ locale
3790
+ }
3791
+ ),
3792
+ /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
3793
+ SingleDatePicker_default,
3794
+ {
3795
+ value: endDate,
3796
+ onChange: handleEndChange,
3797
+ minDate: endMinDate,
3798
+ maxDate,
3799
+ rangeStart: startDate,
3800
+ rangeEnd: endDate,
3801
+ locale
3802
+ }
3803
+ )
3804
+ ] }),
3805
+ /* @__PURE__ */ (0, import_jsx_runtime318.jsx)("div", { className: "datepicker-range-mobile", children: activeTab === "start" ? /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
3806
+ SingleDatePicker_default,
3807
+ {
3808
+ value: startDate,
3809
+ onChange: handleStartChange,
3810
+ minDate,
3811
+ maxDate: startMaxDate,
3812
+ rangeStart: startDate,
3813
+ rangeEnd: endDate,
3814
+ locale
3815
+ }
3816
+ ) : /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(
3817
+ SingleDatePicker_default,
3818
+ {
3819
+ value: endDate,
3820
+ onChange: handleEndChange,
3821
+ minDate: endMinDate,
3822
+ maxDate,
3823
+ rangeStart: startDate,
3824
+ rangeEnd: endDate,
3825
+ locale
3826
+ }
3827
+ ) })
3828
+ ]
3829
+ }
3830
+ );
3831
+ return /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(Field, { label, required, labelId, validations, children: calendar });
3798
3832
  };
3799
3833
  RangePicker.displayName = "RangePicker";
3800
3834
  var RangePicker_default = RangePicker;
@@ -5567,10 +5601,13 @@ var FileUpload = (props) => {
5567
5601
  multiple = false,
5568
5602
  maxSize,
5569
5603
  onChange,
5570
- label = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
5604
+ placeholder = "\uD30C\uC77C\uC744 \uB4DC\uB798\uADF8\uD558\uAC70\uB098 \uD074\uB9AD\uD558\uC5EC \uC5C5\uB85C\uB4DC",
5571
5605
  description,
5572
- validations
5606
+ validations,
5607
+ label,
5608
+ required
5573
5609
  } = props;
5610
+ const fieldId = import_react23.default.useId();
5574
5611
  const [isDragOver, setIsDragOver] = import_react23.default.useState(false);
5575
5612
  const inputRef = import_react23.default.useRef(null);
5576
5613
  const handleFiles = (fileList) => {
@@ -5615,6 +5652,7 @@ var FileUpload = (props) => {
5615
5652
  "input",
5616
5653
  {
5617
5654
  ref: inputRef,
5655
+ id: fieldId,
5618
5656
  type: "file",
5619
5657
  accept,
5620
5658
  multiple,
@@ -5623,12 +5661,12 @@ var FileUpload = (props) => {
5623
5661
  }
5624
5662
  ),
5625
5663
  /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("div", { className: "upload-icon", children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(UploadIcon_default, {}) }),
5626
- /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("p", { className: "upload-label", children: label }),
5664
+ /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("p", { className: "upload-label", children: placeholder }),
5627
5665
  description && /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("p", { className: "upload-description", children: description })
5628
5666
  ]
5629
5667
  }
5630
5668
  );
5631
- return /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(Field, { validations, children: control });
5669
+ return /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(Field, { label, required, htmlFor: fieldId, validations, children: control });
5632
5670
  };
5633
5671
  FileUpload.displayName = "FileUpload";
5634
5672
  var FileUpload_default = FileUpload;
@@ -5771,7 +5809,8 @@ var HtmlTypeWriter_default = HtmlTypeWriter;
5771
5809
  var import_react26 = __toESM(require("react"), 1);
5772
5810
  var import_jsx_runtime327 = require("react/jsx-runtime");
5773
5811
  var ImageSelector = (props) => {
5774
- const { value, label, onChange, validations } = props;
5812
+ const { value, placeholder, onChange, validations, label, required } = props;
5813
+ const fieldId = import_react26.default.useId();
5775
5814
  const [previewUrl, setPreviewUrl] = import_react26.default.useState();
5776
5815
  import_react26.default.useEffect(() => {
5777
5816
  if (!value) {
@@ -5801,7 +5840,7 @@ var ImageSelector = (props) => {
5801
5840
  {
5802
5841
  type: "file",
5803
5842
  accept: "image/*",
5804
- id: "image-input",
5843
+ id: fieldId,
5805
5844
  onChange: handleFileChange,
5806
5845
  ref: inputRef,
5807
5846
  "aria-invalid": hasError(validations) || void 0
@@ -5813,10 +5852,10 @@ var ImageSelector = (props) => {
5813
5852
  ] }),
5814
5853
  /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("div", { className: "content", children: previewUrl ? /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
5815
5854
  /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("div", { className: "icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(ImageIcon_default, {}) }),
5816
- /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
5855
+ /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("div", { className: "label", children: placeholder || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
5817
5856
  ] }) })
5818
5857
  ] });
5819
- return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(Field, { validations, children: control });
5858
+ return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(Field, { label, required, htmlFor: fieldId, validations, children: control });
5820
5859
  };
5821
5860
  ImageSelector.displayName = "ImageSelector";
5822
5861
  var ImageSelector_default = ImageSelector;
@@ -3612,6 +3612,9 @@
3612
3612
  color: var(--semantic-text-inverse);
3613
3613
  border-color: var(--semantic-surface-brand-default);
3614
3614
  }
3615
+ .lib-xplat-editor.readonly .lib-xplat-editor__editable ul.checklist > li::before {
3616
+ cursor: default;
3617
+ }
3615
3618
  .lib-xplat-editor__editable .align-center {
3616
3619
  text-align: center;
3617
3620
  }