@bigtablet/design-system 3.18.3 → 3.19.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/index.css CHANGED
@@ -2385,6 +2385,16 @@ body:has(.bottom_nav) {
2385
2385
  cursor: pointer;
2386
2386
  transition: color 0.2s ease-in-out;
2387
2387
  }
2388
+ .field_label_row {
2389
+ display: flex;
2390
+ align-items: center;
2391
+ justify-content: flex-end;
2392
+ gap: 8px;
2393
+ width: 100%;
2394
+ }
2395
+ .field_label_row .field_label {
2396
+ margin-right: auto;
2397
+ }
2388
2398
  .field_required {
2389
2399
  margin-left: 2px;
2390
2400
  color: var(--bt-color-status-error-on-surface);
package/dist/index.d.ts CHANGED
@@ -2293,6 +2293,14 @@ interface FieldProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "child
2293
2293
  name: string;
2294
2294
  /** 라벨 텍스트. `Field` 가 소유하므로 자식 입력에는 `label` 을 주지 않는다 */
2295
2295
  label?: string;
2296
+ /**
2297
+ * 라벨과 **같은 줄 오른쪽**에 놓는 조작 요소(토글·링크 버튼 등).
2298
+ *
2299
+ * `<label>` 안이 아니라 형제로 렌더된다 - 라벨 클릭이 입력 포커스로 가는 동작과
2300
+ * 조작 요소 클릭이 겹치지 않아야 한다(`TextField` 의 `leadingIcon` 은 `aria-hidden`,
2301
+ * `leadingAction` 은 아닌 것과 같은 구분).
2302
+ */
2303
+ labelAction?: React$1.ReactNode;
2296
2304
  /** 필수 표시(*). 자식 입력에 `aria-required` 로도 전달된다 */
2297
2305
  required?: boolean;
2298
2306
  /** 입력 아래 도움말. 에러가 있으면 에러가 대신 보인다 */
@@ -2321,7 +2329,7 @@ interface FieldProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>, "child
2321
2329
  * </Field>
2322
2330
  * ```
2323
2331
  */
2324
- declare const Field: ({ name, label, required, help, error: errorProp, children, className, ...props }: FieldProps) => React$1.JSX.Element;
2332
+ declare const Field: ({ name, label, labelAction, required, help, error: errorProp, children, className, ...props }: FieldProps) => React$1.JSX.Element;
2325
2333
 
2326
2334
  type FileInputVariant = "button" | "preview";
2327
2335
  interface FileInputProps extends React$1.InputHTMLAttributes<HTMLInputElement> {
package/dist/index.js CHANGED
@@ -2849,6 +2849,7 @@ function useFieldControl() {
2849
2849
  var Field = ({
2850
2850
  name,
2851
2851
  label,
2852
+ labelAction,
2852
2853
  required = false,
2853
2854
  help,
2854
2855
  error: errorProp,
@@ -2871,11 +2872,15 @@ var Field = ({
2871
2872
  invalid: !!error,
2872
2873
  required
2873
2874
  };
2875
+ const labelElement = label ? /* @__PURE__ */ jsxs("label", { id: labelId, htmlFor: inputId, className: "field_label", children: [
2876
+ label,
2877
+ required && /* @__PURE__ */ jsx("span", { className: "field_required", "aria-hidden": "true", children: "*" })
2878
+ ] }) : null;
2874
2879
  return /* @__PURE__ */ jsxs("div", { className: cn("field", !!error && "field_error", className), ...props, children: [
2875
- label && /* @__PURE__ */ jsxs("label", { id: labelId, htmlFor: inputId, className: "field_label", children: [
2876
- label,
2877
- required && /* @__PURE__ */ jsx("span", { className: "field_required", "aria-hidden": "true", children: "*" })
2878
- ] }),
2880
+ labelAction ? /* @__PURE__ */ jsxs("div", { className: "field_label_row", children: [
2881
+ labelElement,
2882
+ labelAction
2883
+ ] }) : labelElement,
2879
2884
  /* @__PURE__ */ jsx(FieldContext.Provider, { value: control, children }),
2880
2885
  showHelp && /* @__PURE__ */ jsx("div", { id: helpId, className: "field_help", children: help }),
2881
2886
  error && /* @__PURE__ */ jsx("div", { id: errorId, className: "field_message", children: error })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigtablet/design-system",
3
- "version": "3.18.3",
3
+ "version": "3.19.0",
4
4
  "description": "Bigtablet Design System UI Components",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",