@nurihaus/web-design-system 3.9.4 → 3.9.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.
@@ -890,6 +890,7 @@ import { TextField } from '@nurihaus/web-design-system'; // 루트.
890
890
 
891
891
  - `prefix`·`suffix`는 input 앞뒤에 붙는 고정 글(`₩`, `원`, `@`, `.com`)이다. 입력값에는 들어가지 않는다.
892
892
  - `format={{ transform, reset }}`을 주면 `value`·`defaultValue`·`onChange`는 raw 값을 주고받고 input에는 `transform(raw)`가 보인다. `onChange`의 `event.target.value`는 이미 `reset`으로 되돌린 raw 값이다. `reset`이 없으면 화면 글을 그대로 raw로 쓴다. `transform`이 글자를 끼워 넣으면(하이픈 등) 입력 중 커서가 끝으로 옮겨갈 수 있다. `maxLength`는 화면 글 길이에 걸리므로 raw 길이 제한은 `reset`에서 자른다.
893
+ - `value`를 주지 않으면 input 값은 DOM 이 쥔다. react-hook-form `register`처럼 `ref`로 값을 넣고 읽는 폼을 그대로 쓸 수 있고, 다시 그려도 넣은 값이 남는다. `format`을 함께 쓰면 DOM(`ref.value`)에는 화면 글(`transform(raw)`)이 남으므로 raw 값은 `onChange`에서 받는다.
893
894
  - `clearable`이면 값이 있고 포커스가 입력 상자 안에 있을 때 지우기 버튼(X, `aria-label` '입력 지우기')이 뜬다. 누르면 포커스는 input에 남고 `onChange`가 `''`로 불린 뒤 `onClear`가 불린다. `disabled`·`readOnly`면 뜨지 않는다.
894
895
  - `passwordToggle`은 `type='password'`일 때만 보기·숨기기 버튼을 붙인다. 누르면 input `type`이 `text`·`password`로 바뀌고 `aria-pressed`와 `aria-label`('비밀번호 보기'·'비밀번호 숨기기')이 따라 바뀌며 `onVisibilityChange(visible)`가 불린다.
895
896
 
@@ -1186,6 +1187,7 @@ import { TextArea } from '@nurihaus/web-design-system'; // 루트.
1186
1187
 
1187
1188
  `track`을 주면 포커스가 빠질 때 값이 포커스를 받을 때와 다르면 `change`를 한 번 사용 로그로 보낸다. 값은 싣지 않는다. 사용자가 입력한 글자는 로그에 들어가지 않는다.
1188
1189
 
1190
+ - `value`를 주지 않으면 textarea 값은 DOM 이 쥔다. react-hook-form `register`처럼 `ref`로 값을 넣고 읽는 폼을 그대로 쓸 수 있고, 다시 그려도 넣은 값이 남는다.
1189
1191
  - `clearable`이면 값이 있고 포커스가 입력 상자 안에 있을 때 첫 줄 오른쪽에 지우기 버튼(X, `aria-label` '입력 지우기')이 뜬다. 누르면 포커스는 textarea에 남고 `onChange`가 `''`로 불린 뒤 `onClear`가 불린다. `disabled`·`readOnly`면 뜨지 않는다.
1190
1192
 
1191
1193
  **쓰지 않는다.** 한 줄 입력은 TextField를 쓴다. 정해진 값 중에서 고르는 입력은 DropDown이나 Radio를 쓴다.
@@ -39,7 +39,6 @@ var identity = function identity(text) {
39
39
  return text;
40
40
  };
41
41
  var TextFieldContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({
42
- display: '',
43
42
  onChange: function onChange() {}
44
43
  });
45
44
  // context 만 내려주고 DOM 을 그리지 않아 ref 를 받을 곳이 없다.
@@ -47,6 +46,7 @@ var TextFieldRootBase = function TextFieldRootBase(props) {
47
46
  var _a, _b;
48
47
  var children = props.children,
49
48
  value = props.value,
49
+ defaultValue = props.defaultValue,
50
50
  format = props.format,
51
51
  onChange = props.onChange;
52
52
  var transform = (_a = format === null || format === void 0 ? void 0 : format.transform) !== null && _a !== void 0 ? _a : identity;
@@ -56,10 +56,15 @@ var TextFieldRootBase = function TextFieldRootBase(props) {
56
56
  // DOM 값을 raw 로 맞춰야 받는 쪽이 raw 를 읽고, React 가 다음 렌더에서 transform(raw) 로 다시 그린다
57
57
  if (raw !== e.target.value) e.target.value = raw;
58
58
  onChange(e);
59
+ // uncontrolled 는 React 가 다시 그리지 않으니 보이는 글을 직접 맞춘다
60
+ var display = transform(raw);
61
+ if (value === undefined && display !== e.target.value) e.target.value = display;
59
62
  };
60
63
  return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(TextFieldContext.Provider, {
61
64
  value: {
62
- display: transform(value),
65
+ display: value === undefined ? undefined : transform(value),
66
+ // controlled 면 defaultValue 를 input 에 같이 주지 않는다 (React 가 둘 다 있다고 경고한다)
67
+ defaultDisplay: value === undefined && defaultValue !== undefined ? transform(defaultValue) : undefined,
63
68
  onChange: handleChange
64
69
  },
65
70
  children: children
@@ -84,6 +89,7 @@ var TextFieldInput = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardR
84
89
  restProps = __rest(props, ["className", "disabled"]);
85
90
  var _a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(TextFieldContext),
86
91
  display = _a.display,
92
+ defaultDisplay = _a.defaultDisplay,
87
93
  onChange = _a.onChange;
88
94
  return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", __assign({
89
95
  ref: ref,
@@ -91,8 +97,9 @@ var TextFieldInput = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardR
91
97
  disabled: disabled,
92
98
  "data-disabled": disabled
93
99
  }, restProps, {
94
- // 값은 Root 가 쥔다. 넘겨받은 value·onChange 가 Root 상태를 덮지 않게 spread 뒤에 둔다.
100
+ // 값은 Root 가 정한다. 넘겨받은 value·onChange 가 Root 를 덮지 않게 spread 뒤에 둔다.
95
101
  value: display,
102
+ defaultValue: defaultDisplay,
96
103
  onChange: onChange
97
104
  }));
98
105
  });
@@ -5,13 +5,13 @@ declare const Asset: {
5
5
  size?: import("./asset-type").AssetFrameSize<"square">;
6
6
  }, "ref"> | Omit<import("./asset-type").AssetFrameCommonProps & {
7
7
  shape: "circle";
8
- size?: "s" | "l" | "xl" | "m" | undefined;
9
- }, "ref"> | Omit<import("./asset-type").AssetFrameCommonProps & {
10
- shape: "card";
11
- size?: "l" | "xl" | "m" | undefined;
8
+ size?: "s" | "m" | "l" | "xl" | undefined;
12
9
  }, "ref"> | Omit<import("./asset-type").AssetFrameCommonProps & {
13
10
  shape: "squircle";
14
- size?: "s" | "l" | "xl" | "m" | undefined;
11
+ size?: "s" | "m" | "l" | "xl" | undefined;
12
+ }, "ref"> | Omit<import("./asset-type").AssetFrameCommonProps & {
13
+ shape: "card";
14
+ size?: "m" | "l" | "xl" | undefined;
15
15
  }, "ref">) & import("react").RefAttributes<HTMLSpanElement>>;
16
16
  Icon: import("react").ForwardRefExoticComponent<Omit<AssetIconProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
17
17
  Image: import("react").ForwardRefExoticComponent<Omit<AssetImageProps, "ref"> & import("react").RefAttributes<HTMLImageElement>>;
@@ -13,13 +13,13 @@ declare const meta: {
13
13
  size?: import("./asset-type").AssetFrameSize<"square">;
14
14
  }, "ref"> | Omit<import("./asset-type").AssetFrameCommonProps & {
15
15
  shape: "circle";
16
- size?: "s" | "l" | "xl" | "m" | undefined;
17
- }, "ref"> | Omit<import("./asset-type").AssetFrameCommonProps & {
18
- shape: "card";
19
- size?: "l" | "xl" | "m" | undefined;
16
+ size?: "s" | "m" | "l" | "xl" | undefined;
20
17
  }, "ref"> | Omit<import("./asset-type").AssetFrameCommonProps & {
21
18
  shape: "squircle";
22
- size?: "s" | "l" | "xl" | "m" | undefined;
19
+ size?: "s" | "m" | "l" | "xl" | undefined;
20
+ }, "ref"> | Omit<import("./asset-type").AssetFrameCommonProps & {
21
+ shape: "card";
22
+ size?: "m" | "l" | "xl" | undefined;
23
23
  }, "ref">) & import("react").RefAttributes<HTMLSpanElement>>;
24
24
  argTypes: {
25
25
  shape: {
@@ -12,10 +12,9 @@ declare const meta: {
12
12
  ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
13
13
  }, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
14
14
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-webpack5").ReactRenderer, {
15
- slot?: string | undefined | undefined;
15
+ className?: string | undefined | undefined;
16
16
  style?: import("react").CSSProperties | undefined;
17
- title?: string | undefined | undefined;
18
- key?: import("react").Key | null | undefined;
17
+ children?: import("react").ReactNode;
19
18
  defaultChecked?: boolean | undefined | undefined;
20
19
  defaultValue?: string | number | readonly string[] | undefined;
21
20
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -23,7 +22,6 @@ declare const meta: {
23
22
  accessKey?: string | undefined | undefined;
24
23
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
25
24
  autoFocus?: boolean | undefined | undefined;
26
- className?: string | undefined | undefined;
27
25
  contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
28
26
  contextMenu?: string | undefined | undefined;
29
27
  dir?: string | undefined | undefined;
@@ -33,8 +31,10 @@ declare const meta: {
33
31
  id?: string | undefined | undefined;
34
32
  lang?: string | undefined | undefined;
35
33
  nonce?: string | undefined | undefined;
34
+ slot?: string | undefined | undefined;
36
35
  spellCheck?: (boolean | "true" | "false") | undefined;
37
36
  tabIndex?: number | undefined | undefined;
37
+ title?: string | undefined | undefined;
38
38
  translate?: "yes" | "no" | undefined | undefined;
39
39
  radioGroup?: string | undefined | undefined;
40
40
  role?: import("react").AriaRole | undefined;
@@ -117,7 +117,6 @@ declare const meta: {
117
117
  "aria-valuemin"?: number | undefined | undefined;
118
118
  "aria-valuenow"?: number | undefined | undefined;
119
119
  "aria-valuetext"?: string | undefined | undefined;
120
- children?: import("react").ReactNode;
121
120
  dangerouslySetInnerHTML?: {
122
121
  __html: string | TrustedHTML;
123
122
  } | undefined | undefined;
@@ -279,6 +278,7 @@ declare const meta: {
279
278
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
280
279
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
281
280
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
281
+ key?: import("react").Key | null | undefined;
282
282
  ref?: import("react").LegacyRef<HTMLDivElement> | undefined;
283
283
  }>) => import("react/jsx-runtime").JSX.Element)[];
284
284
  };
@@ -37,11 +37,8 @@ declare const meta: {
37
37
  description: string;
38
38
  };
39
39
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-webpack5").ReactRenderer, {
40
- figure?: never | undefined;
41
- slot?: string | undefined | undefined;
40
+ className?: string | undefined | undefined;
42
41
  style?: import("react").CSSProperties | undefined;
43
- title: import("react").ReactNode;
44
- key?: import("react").Key | null | undefined;
45
42
  defaultChecked?: boolean | undefined | undefined;
46
43
  defaultValue?: string | number | readonly string[] | undefined;
47
44
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -49,7 +46,6 @@ declare const meta: {
49
46
  accessKey?: string | undefined | undefined;
50
47
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
51
48
  autoFocus?: boolean | undefined | undefined;
52
- className?: string | undefined | undefined;
53
49
  contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
54
50
  contextMenu?: string | undefined | undefined;
55
51
  dir?: string | undefined | undefined;
@@ -59,8 +55,10 @@ declare const meta: {
59
55
  id?: string | undefined | undefined;
60
56
  lang?: string | undefined | undefined;
61
57
  nonce?: string | undefined | undefined;
58
+ slot?: string | undefined | undefined;
62
59
  spellCheck?: (boolean | "true" | "false") | undefined;
63
60
  tabIndex?: number | undefined | undefined;
61
+ title: import("react").ReactNode;
64
62
  translate?: "yes" | "no" | undefined | undefined;
65
63
  radioGroup?: string | undefined | undefined;
66
64
  role?: import("react").AriaRole | undefined;
@@ -304,18 +302,17 @@ declare const meta: {
304
302
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
305
303
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
306
304
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
307
- icon: import("../..").IconName;
305
+ figure?: never | undefined;
306
+ key?: import("react").Key | null | undefined;
308
307
  variant?: (typeof variant)[number] | undefined;
308
+ icon: import("../..").IconName;
309
309
  action?: import("react").ReactNode;
310
310
  description?: import("react").ReactNode;
311
311
  titleAs?: (typeof titleAs)[number] | undefined;
312
312
  ref?: import("react").LegacyRef<HTMLDivElement> | undefined;
313
313
  } | {
314
- figure: import("react").ReactNode;
315
- slot?: string | undefined | undefined;
314
+ className?: string | undefined | undefined;
316
315
  style?: import("react").CSSProperties | undefined;
317
- title: import("react").ReactNode;
318
- key?: import("react").Key | null | undefined;
319
316
  defaultChecked?: boolean | undefined | undefined;
320
317
  defaultValue?: string | number | readonly string[] | undefined;
321
318
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -323,7 +320,6 @@ declare const meta: {
323
320
  accessKey?: string | undefined | undefined;
324
321
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
325
322
  autoFocus?: boolean | undefined | undefined;
326
- className?: string | undefined | undefined;
327
323
  contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
328
324
  contextMenu?: string | undefined | undefined;
329
325
  dir?: string | undefined | undefined;
@@ -333,8 +329,10 @@ declare const meta: {
333
329
  id?: string | undefined | undefined;
334
330
  lang?: string | undefined | undefined;
335
331
  nonce?: string | undefined | undefined;
332
+ slot?: string | undefined | undefined;
336
333
  spellCheck?: (boolean | "true" | "false") | undefined;
337
334
  tabIndex?: number | undefined | undefined;
335
+ title: import("react").ReactNode;
338
336
  translate?: "yes" | "no" | undefined | undefined;
339
337
  radioGroup?: string | undefined | undefined;
340
338
  role?: import("react").AriaRole | undefined;
@@ -578,8 +576,10 @@ declare const meta: {
578
576
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
579
577
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
580
578
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
581
- icon?: never | undefined;
579
+ figure: import("react").ReactNode;
580
+ key?: import("react").Key | null | undefined;
582
581
  variant?: (typeof variant)[number] | undefined;
582
+ icon?: never | undefined;
583
583
  action?: import("react").ReactNode;
584
584
  description?: import("react").ReactNode;
585
585
  titleAs?: (typeof titleAs)[number] | undefined;
@@ -14,7 +14,7 @@ declare const meta: {
14
14
  control: {
15
15
  type: "select";
16
16
  };
17
- options: ("link" | "circle" | "image" | "x" | "house" | "megaphone-simple" | "chats-circle" | "user-circle" | "bell" | "caret-left" | "magnifying-glass" | "dots-three" | "gear-six" | "chat-circle" | "paper-plane-tilt" | "plus" | "minus" | "camera" | "video-camera" | "play" | "upload-simple" | "calendar-blank" | "clock" | "map-pin" | "truck" | "ticket" | "qr-code" | "sparkle" | "gift" | "wallet" | "bank" | "credit-card" | "check-circle" | "check" | "warning" | "info" | "question" | "lock" | "pencil-simple" | "trash" | "copy" | "share-network" | "eye" | "sliders-horizontal" | "heart" | "star" | "globe" | "sign-out" | "caret-right" | "caret-down" | "arrow-right" | "backspace" | "arrow-fat-up" | "instagram-logo" | "tiktok-logo" | "youtube-logo")[];
17
+ options: ("circle" | "link" | "image" | "x" | "copy" | "house" | "megaphone-simple" | "chats-circle" | "user-circle" | "bell" | "caret-left" | "magnifying-glass" | "dots-three" | "gear-six" | "chat-circle" | "paper-plane-tilt" | "plus" | "minus" | "camera" | "video-camera" | "play" | "upload-simple" | "calendar-blank" | "clock" | "map-pin" | "truck" | "ticket" | "qr-code" | "sparkle" | "gift" | "wallet" | "bank" | "credit-card" | "check-circle" | "check" | "warning" | "info" | "question" | "lock" | "pencil-simple" | "trash" | "share-network" | "eye" | "sliders-horizontal" | "heart" | "star" | "globe" | "sign-out" | "caret-right" | "caret-down" | "arrow-right" | "backspace" | "arrow-fat-up" | "instagram-logo" | "tiktok-logo" | "youtube-logo")[];
18
18
  };
19
19
  weight: {
20
20
  control: {
@@ -15,11 +15,9 @@ declare const meta: {
15
15
  onClick: () => void;
16
16
  };
17
17
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-webpack5").ReactRenderer, {
18
- slot?: string | undefined | undefined;
18
+ className?: string | undefined | undefined;
19
19
  style?: import("react").CSSProperties | undefined;
20
- title?: string | undefined | undefined;
21
- track?: string | undefined;
22
- key?: import("react").Key | null | undefined;
20
+ children: import("react").ReactNode;
23
21
  defaultChecked?: boolean | undefined | undefined;
24
22
  defaultValue?: string | number | readonly string[] | undefined;
25
23
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -27,7 +25,6 @@ declare const meta: {
27
25
  accessKey?: string | undefined | undefined;
28
26
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
29
27
  autoFocus?: boolean | undefined | undefined;
30
- className?: string | undefined | undefined;
31
28
  contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
32
29
  contextMenu?: string | undefined | undefined;
33
30
  dir?: string | undefined | undefined;
@@ -37,8 +34,10 @@ declare const meta: {
37
34
  id?: string | undefined | undefined;
38
35
  lang?: string | undefined | undefined;
39
36
  nonce?: string | undefined | undefined;
37
+ slot?: string | undefined | undefined;
40
38
  spellCheck?: (boolean | "true" | "false") | undefined;
41
39
  tabIndex?: number | undefined | undefined;
40
+ title?: string | undefined | undefined;
42
41
  translate?: "yes" | "no" | undefined | undefined;
43
42
  radioGroup?: string | undefined | undefined;
44
43
  role?: import("react").AriaRole | undefined;
@@ -121,7 +120,6 @@ declare const meta: {
121
120
  "aria-valuemin"?: number | undefined | undefined;
122
121
  "aria-valuenow"?: number | undefined | undefined;
123
122
  "aria-valuetext"?: string | undefined | undefined;
124
- children: import("react").ReactNode;
125
123
  dangerouslySetInnerHTML?: {
126
124
  __html: string | TrustedHTML;
127
125
  } | undefined | undefined;
@@ -283,12 +281,14 @@ declare const meta: {
283
281
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
284
282
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
285
283
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
286
- icon?: import("../..").IconName | undefined;
284
+ track?: string | undefined;
285
+ key?: import("react").Key | null | undefined;
287
286
  loading?: boolean | undefined;
288
287
  asChild?: boolean | undefined;
289
288
  trackProps?: Record<string, string | number | boolean> | undefined;
290
289
  pressEffect?: boolean | undefined;
291
290
  border?: (typeof footerBorder)[number] | undefined;
291
+ icon?: import("../..").IconName | undefined;
292
292
  ref?: import("react").LegacyRef<HTMLDivElement> | undefined;
293
293
  }>) => import("react/jsx-runtime").JSX.Element)[];
294
294
  };
@@ -15,10 +15,9 @@ declare const meta: {
15
15
  description: string;
16
16
  };
17
17
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-webpack5").ReactRenderer, {
18
- slot?: string | undefined | undefined;
18
+ className?: string | undefined | undefined;
19
19
  style?: import("react").CSSProperties | undefined;
20
- title: import("react").ReactNode;
21
- key?: import("react").Key | null | undefined;
20
+ children?: import("react").ReactNode;
22
21
  defaultChecked?: boolean | undefined | undefined;
23
22
  defaultValue?: string | number | readonly string[] | undefined;
24
23
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -26,7 +25,6 @@ declare const meta: {
26
25
  accessKey?: string | undefined | undefined;
27
26
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
28
27
  autoFocus?: boolean | undefined | undefined;
29
- className?: string | undefined | undefined;
30
28
  contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
31
29
  contextMenu?: string | undefined | undefined;
32
30
  dir?: string | undefined | undefined;
@@ -36,8 +34,10 @@ declare const meta: {
36
34
  id?: string | undefined | undefined;
37
35
  lang?: string | undefined | undefined;
38
36
  nonce?: string | undefined | undefined;
37
+ slot?: string | undefined | undefined;
39
38
  spellCheck?: (boolean | "true" | "false") | undefined;
40
39
  tabIndex?: number | undefined | undefined;
40
+ title: import("react").ReactNode;
41
41
  translate?: "yes" | "no" | undefined | undefined;
42
42
  radioGroup?: string | undefined | undefined;
43
43
  role?: import("react").AriaRole | undefined;
@@ -120,7 +120,6 @@ declare const meta: {
120
120
  "aria-valuemin"?: number | undefined | undefined;
121
121
  "aria-valuenow"?: number | undefined | undefined;
122
122
  "aria-valuetext"?: string | undefined | undefined;
123
- children?: import("react").ReactNode;
124
123
  dangerouslySetInnerHTML?: {
125
124
  __html: string | TrustedHTML;
126
125
  } | undefined | undefined;
@@ -282,6 +281,7 @@ declare const meta: {
282
281
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
283
282
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
284
283
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
284
+ key?: import("react").Key | null | undefined;
285
285
  right?: import("react").ReactNode;
286
286
  description?: import("react").ReactNode;
287
287
  descriptionPosition?: (typeof descriptionPosition)[number] | undefined;
@@ -16,12 +16,10 @@ declare const meta: {
16
16
  label: string;
17
17
  };
18
18
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-webpack5").ReactRenderer, {
19
- label: import("react").ReactNode;
20
- slot?: string | undefined | undefined;
19
+ size?: import("./list-type").ListRowSize | undefined;
20
+ className?: string | undefined | undefined;
21
21
  style?: import("react").CSSProperties | undefined;
22
- title?: string | undefined | undefined;
23
- track?: string | undefined;
24
- key?: import("react").Key | null | undefined;
22
+ children?: import("react").ReactNode;
25
23
  defaultChecked?: boolean | undefined | undefined;
26
24
  defaultValue?: string | number | readonly string[] | undefined;
27
25
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -29,7 +27,6 @@ declare const meta: {
29
27
  accessKey?: string | undefined | undefined;
30
28
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
31
29
  autoFocus?: boolean | undefined | undefined;
32
- className?: string | undefined | undefined;
33
30
  contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
34
31
  contextMenu?: string | undefined | undefined;
35
32
  dir?: string | undefined | undefined;
@@ -39,8 +36,10 @@ declare const meta: {
39
36
  id?: string | undefined | undefined;
40
37
  lang?: string | undefined | undefined;
41
38
  nonce?: string | undefined | undefined;
39
+ slot?: string | undefined | undefined;
42
40
  spellCheck?: (boolean | "true" | "false") | undefined;
43
41
  tabIndex?: number | undefined | undefined;
42
+ title?: string | undefined | undefined;
44
43
  translate?: "yes" | "no" | undefined | undefined;
45
44
  radioGroup?: string | undefined | undefined;
46
45
  role?: import("react").AriaRole | undefined;
@@ -123,7 +122,6 @@ declare const meta: {
123
122
  "aria-valuemin"?: number | undefined | undefined;
124
123
  "aria-valuenow"?: number | undefined | undefined;
125
124
  "aria-valuetext"?: string | undefined | undefined;
126
- children?: import("react").ReactNode;
127
125
  dangerouslySetInnerHTML?: {
128
126
  __html: string | TrustedHTML;
129
127
  } | undefined | undefined;
@@ -285,7 +283,9 @@ declare const meta: {
285
283
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
286
284
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
287
285
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
288
- size?: import("./list-type").ListRowSize | undefined;
286
+ label: import("react").ReactNode;
287
+ track?: string | undefined;
288
+ key?: import("react").Key | null | undefined;
289
289
  asChild?: boolean | undefined;
290
290
  trackProps?: Record<string, string | number | boolean> | undefined;
291
291
  pressEffect?: boolean | undefined;
@@ -29,13 +29,9 @@ declare const meta: {
29
29
  time: string;
30
30
  };
31
31
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-webpack5").ReactRenderer, {
32
- slot?: string | undefined | undefined;
32
+ className?: string | undefined | undefined;
33
33
  style?: import("react").CSSProperties | undefined;
34
- time?: import("react").ReactNode;
35
- title?: string | undefined | undefined;
36
- key?: import("react").Key | null | undefined;
37
- name?: import("react").ReactNode;
38
- value?: string | number | readonly string[] | undefined;
34
+ children?: import("react").ReactNode;
39
35
  defaultChecked?: boolean | undefined | undefined;
40
36
  defaultValue?: string | number | readonly string[] | undefined;
41
37
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -43,7 +39,6 @@ declare const meta: {
43
39
  accessKey?: string | undefined | undefined;
44
40
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
45
41
  autoFocus?: boolean | undefined | undefined;
46
- className?: string | undefined | undefined;
47
42
  contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
48
43
  contextMenu?: string | undefined | undefined;
49
44
  dir?: string | undefined | undefined;
@@ -53,8 +48,10 @@ declare const meta: {
53
48
  id?: string | undefined | undefined;
54
49
  lang?: string | undefined | undefined;
55
50
  nonce?: string | undefined | undefined;
51
+ slot?: string | undefined | undefined;
56
52
  spellCheck?: (boolean | "true" | "false") | undefined;
57
53
  tabIndex?: number | undefined | undefined;
54
+ title?: string | undefined | undefined;
58
55
  translate?: "yes" | "no" | undefined | undefined;
59
56
  radioGroup?: string | undefined | undefined;
60
57
  role?: import("react").AriaRole | undefined;
@@ -137,7 +134,6 @@ declare const meta: {
137
134
  "aria-valuemin"?: number | undefined | undefined;
138
135
  "aria-valuenow"?: number | undefined | undefined;
139
136
  "aria-valuetext"?: string | undefined | undefined;
140
- children?: import("react").ReactNode;
141
137
  dangerouslySetInnerHTML?: {
142
138
  __html: string | TrustedHTML;
143
139
  } | undefined | undefined;
@@ -299,6 +295,10 @@ declare const meta: {
299
295
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLLIElement> | undefined;
300
296
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLLIElement> | undefined;
301
297
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLLIElement> | undefined;
298
+ time?: import("react").ReactNode;
299
+ key?: import("react").Key | null | undefined;
300
+ name?: import("react").ReactNode;
301
+ value?: string | number | readonly string[] | undefined;
302
302
  motion?: (typeof motion)[number] | undefined;
303
303
  media?: import("react").ReactNode;
304
304
  dateTime?: string | undefined;
@@ -28,10 +28,9 @@ declare const meta: {
28
28
  children: string;
29
29
  };
30
30
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-webpack5").ReactRenderer, {
31
- slot?: string | undefined | undefined;
31
+ className?: string | undefined | undefined;
32
32
  style?: import("react").CSSProperties | undefined;
33
- title?: import("react").ReactNode;
34
- key?: import("react").Key | null | undefined;
33
+ children: import("react").ReactNode;
35
34
  defaultChecked?: boolean | undefined | undefined;
36
35
  defaultValue?: string | number | readonly string[] | undefined;
37
36
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -39,7 +38,6 @@ declare const meta: {
39
38
  accessKey?: string | undefined | undefined;
40
39
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
41
40
  autoFocus?: boolean | undefined | undefined;
42
- className?: string | undefined | undefined;
43
41
  contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
44
42
  contextMenu?: string | undefined | undefined;
45
43
  dir?: string | undefined | undefined;
@@ -49,8 +47,10 @@ declare const meta: {
49
47
  id?: string | undefined | undefined;
50
48
  lang?: string | undefined | undefined;
51
49
  nonce?: string | undefined | undefined;
50
+ slot?: string | undefined | undefined;
52
51
  spellCheck?: (boolean | "true" | "false") | undefined;
53
52
  tabIndex?: number | undefined | undefined;
53
+ title?: import("react").ReactNode;
54
54
  translate?: "yes" | "no" | undefined | undefined;
55
55
  radioGroup?: string | undefined | undefined;
56
56
  role?: import("react").AriaRole | undefined;
@@ -133,7 +133,6 @@ declare const meta: {
133
133
  "aria-valuemin"?: number | undefined | undefined;
134
134
  "aria-valuenow"?: number | undefined | undefined;
135
135
  "aria-valuetext"?: string | undefined | undefined;
136
- children: import("react").ReactNode;
137
136
  dangerouslySetInnerHTML?: {
138
137
  __html: string | TrustedHTML;
139
138
  } | undefined | undefined;
@@ -295,6 +294,7 @@ declare const meta: {
295
294
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement> | undefined;
296
295
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
297
296
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
297
+ key?: import("react").Key | null | undefined;
298
298
  variant?: (typeof variant)[number] | undefined;
299
299
  motion?: (typeof motion)[number] | undefined;
300
300
  action?: import("./notice-type").NoticeAction | undefined;
@@ -18,8 +18,8 @@ declare const meta: {
18
18
  };
19
19
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-webpack5").ReactRenderer, {
20
20
  portalContainer?: HTMLElement | undefined;
21
- label?: string | undefined;
22
21
  children: import("react").ReactNode;
22
+ label?: string | undefined;
23
23
  position?: typeof import("../toast/toast-props").positions[number] | undefined;
24
24
  duration?: number | undefined;
25
25
  }>) => import("react/jsx-runtime").JSX.Element)[];
@@ -35,8 +35,8 @@ declare const meta: {
35
35
  animated: true;
36
36
  };
37
37
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-webpack5").ReactRenderer, {
38
- 'aria-label'?: string | undefined;
39
38
  repeat?: number | undefined;
39
+ 'aria-label'?: string | undefined;
40
40
  animated?: boolean | undefined;
41
41
  pattern?: SkeletonPattern | undefined;
42
42
  }>) => import("react/jsx-runtime").JSX.Element)[];
@@ -45,10 +45,9 @@ declare const meta: {
45
45
  animated: true;
46
46
  };
47
47
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-webpack5").ReactRenderer, {
48
- slot?: string | undefined | undefined;
48
+ className?: string | undefined | undefined;
49
49
  style?: import("react").CSSProperties | undefined;
50
- title?: string | undefined | undefined;
51
- key?: import("react").Key | null | undefined;
50
+ children?: import("react").ReactNode;
52
51
  defaultChecked?: boolean | undefined | undefined;
53
52
  defaultValue?: string | number | readonly string[] | undefined;
54
53
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -56,7 +55,6 @@ declare const meta: {
56
55
  accessKey?: string | undefined | undefined;
57
56
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
58
57
  autoFocus?: boolean | undefined | undefined;
59
- className?: string | undefined | undefined;
60
58
  contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
61
59
  contextMenu?: string | undefined | undefined;
62
60
  dir?: string | undefined | undefined;
@@ -66,8 +64,10 @@ declare const meta: {
66
64
  id?: string | undefined | undefined;
67
65
  lang?: string | undefined | undefined;
68
66
  nonce?: string | undefined | undefined;
67
+ slot?: string | undefined | undefined;
69
68
  spellCheck?: (boolean | "true" | "false") | undefined;
70
69
  tabIndex?: number | undefined | undefined;
70
+ title?: string | undefined | undefined;
71
71
  translate?: "yes" | "no" | undefined | undefined;
72
72
  radioGroup?: string | undefined | undefined;
73
73
  role?: import("react").AriaRole | undefined;
@@ -150,7 +150,6 @@ declare const meta: {
150
150
  "aria-valuemin"?: number | undefined | undefined;
151
151
  "aria-valuenow"?: number | undefined | undefined;
152
152
  "aria-valuetext"?: string | undefined | undefined;
153
- children?: import("react").ReactNode;
154
153
  dangerouslySetInnerHTML?: {
155
154
  __html: string | TrustedHTML;
156
155
  } | undefined | undefined;
@@ -312,11 +311,12 @@ declare const meta: {
312
311
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLSpanElement> | undefined;
313
312
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLSpanElement> | undefined;
314
313
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLSpanElement> | undefined;
314
+ key?: import("react").Key | null | undefined;
315
315
  height?: number | string | undefined;
316
316
  width?: number | string | undefined;
317
- animated?: boolean | undefined;
318
- lines?: number | undefined;
319
317
  shape?: (typeof shapes)[number] | undefined;
318
+ lines?: number | undefined;
319
+ animated?: boolean | undefined;
320
320
  ref?: import("react").LegacyRef<HTMLSpanElement> | undefined;
321
321
  }>) => import("react/jsx-runtime").JSX.Element)[];
322
322
  };
@@ -3,8 +3,9 @@ import { TrackProps } from '../logging/logging-type';
3
3
  import { resize, sizes } from './text-area-props';
4
4
  export interface TextAreaRootProps {
5
5
  children: ReactNode;
6
- /** controlled·uncontrolled 는 조합형이 정한다 */
7
- value: string;
6
+ /** 없으면 uncontrolled — DOM 이 값을 쥔다 (react-hook-form register 가 ref 로 넣은 값이 남는다) */
7
+ value?: string;
8
+ defaultValue?: string;
8
9
  onChange: (e: ChangeEvent<HTMLTextAreaElement>) => void;
9
10
  }
10
11
  export interface TextAreaLabelProps {
@@ -9,8 +9,9 @@ export interface TextFieldFormat {
9
9
  }
10
10
  export interface TextFieldRootProps {
11
11
  children: ReactNode;
12
- /** raw 값. controlled·uncontrolled 는 조합형이 정한다 */
13
- value: string;
12
+ /** raw 값. 없으면 uncontrolled — DOM 이 값을 쥔다 (react-hook-form register 가 ref 로 넣은 값이 남는다) */
13
+ value?: string;
14
+ defaultValue?: string;
14
15
  format?: TextFieldFormat;
15
16
  /** event.target.value 는 이미 raw 로 되돌려져 있다 */
16
17
  onChange: (e: ChangeEvent<HTMLInputElement>) => void;
@@ -24,12 +24,8 @@ declare const meta: {
24
24
  variant: "default";
25
25
  };
26
26
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-webpack5").ReactRenderer, {
27
- slot?: string | undefined | undefined;
27
+ className?: string | undefined;
28
28
  style?: import("react").CSSProperties | undefined;
29
- title: import("react").ReactNode;
30
- track?: string | undefined;
31
- key?: import("react").Key | null | undefined;
32
- value?: string | number | readonly string[] | undefined;
33
29
  defaultChecked?: boolean | undefined | undefined;
34
30
  defaultValue?: string | number | readonly string[] | undefined;
35
31
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -37,7 +33,6 @@ declare const meta: {
37
33
  accessKey?: string | undefined | undefined;
38
34
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
39
35
  autoFocus?: boolean | undefined | undefined;
40
- className?: string | undefined;
41
36
  contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
42
37
  contextMenu?: string | undefined | undefined;
43
38
  dir?: string | undefined | undefined;
@@ -47,8 +42,10 @@ declare const meta: {
47
42
  id?: string | undefined | undefined;
48
43
  lang?: string | undefined | undefined;
49
44
  nonce?: string | undefined | undefined;
45
+ slot?: string | undefined | undefined;
50
46
  spellCheck?: (boolean | "true" | "false") | undefined;
51
47
  tabIndex?: number | undefined | undefined;
48
+ title: import("react").ReactNode;
52
49
  translate?: "yes" | "no" | undefined | undefined;
53
50
  radioGroup?: string | undefined | undefined;
54
51
  role?: import("react").AriaRole | undefined;
@@ -292,6 +289,9 @@ declare const meta: {
292
289
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLLIElement> | undefined;
293
290
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLLIElement> | undefined;
294
291
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLLIElement> | undefined;
292
+ track?: string | undefined;
293
+ key?: import("react").Key | null | undefined;
294
+ value?: string | number | readonly string[] | undefined;
295
295
  variant?: (typeof variants)[number] | undefined;
296
296
  trackProps?: Record<string, string | number | boolean> | undefined;
297
297
  open?: boolean | undefined;
@@ -300,9 +300,9 @@ declare const meta: {
300
300
  onEntered?: (() => void) | undefined;
301
301
  onExited?: (() => void) | undefined;
302
302
  action?: import("./toast-type").ToastAction | undefined;
303
- description?: import("react").ReactNode;
304
303
  onResume?: (() => void) | undefined;
305
304
  duration?: number | undefined;
305
+ description?: import("react").ReactNode;
306
306
  showClose?: boolean | undefined;
307
307
  ref?: import("react").LegacyRef<HTMLLIElement> | undefined;
308
308
  }>) => import("react/jsx-runtime").JSX.Element)[];
@@ -30,10 +30,8 @@ declare const meta: {
30
30
  subtitleBottom: string;
31
31
  };
32
32
  decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("@storybook/react-webpack5").ReactRenderer, {
33
- slot?: string | undefined | undefined;
33
+ className?: string | undefined | undefined;
34
34
  style?: import("react").CSSProperties | undefined;
35
- title: import("react").ReactNode;
36
- key?: import("react").Key | null | undefined;
37
35
  defaultChecked?: boolean | undefined | undefined;
38
36
  defaultValue?: string | number | readonly string[] | undefined;
39
37
  suppressContentEditableWarning?: boolean | undefined | undefined;
@@ -41,7 +39,6 @@ declare const meta: {
41
39
  accessKey?: string | undefined | undefined;
42
40
  autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
43
41
  autoFocus?: boolean | undefined | undefined;
44
- className?: string | undefined | undefined;
45
42
  contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
46
43
  contextMenu?: string | undefined | undefined;
47
44
  dir?: string | undefined | undefined;
@@ -51,8 +48,10 @@ declare const meta: {
51
48
  id?: string | undefined | undefined;
52
49
  lang?: string | undefined | undefined;
53
50
  nonce?: string | undefined | undefined;
51
+ slot?: string | undefined | undefined;
54
52
  spellCheck?: (boolean | "true" | "false") | undefined;
55
53
  tabIndex?: number | undefined | undefined;
54
+ title: import("react").ReactNode;
56
55
  translate?: "yes" | "no" | undefined | undefined;
57
56
  radioGroup?: string | undefined | undefined;
58
57
  role?: import("react").AriaRole | undefined;
@@ -296,6 +295,7 @@ declare const meta: {
296
295
  onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLElement> | undefined;
297
296
  onTransitionEnd?: import("react").TransitionEventHandler<HTMLElement> | undefined;
298
297
  onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLElement> | undefined;
298
+ key?: import("react").Key | null | undefined;
299
299
  right?: import("react").ReactNode;
300
300
  titleLevel?: import("./top-type").TopTitleLevel | undefined;
301
301
  subtitleTop?: import("react").ReactNode;
package/dist/index.js CHANGED
@@ -14101,21 +14101,25 @@ var __rest = undefined && undefined.__rest || function (s, e) {
14101
14101
 
14102
14102
 
14103
14103
  var TextAreaContext = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_.createContext)({
14104
- value: '',
14105
14104
  onChange: function onChange() {}
14106
14105
  });
14107
14106
  // context 만 내려주고 DOM 을 그리지 않아 ref 를 받을 곳이 없다.
14108
14107
  var TextAreaRootBase = function TextAreaRootBase(props) {
14109
14108
  var children = props.children,
14110
14109
  value = props.value,
14110
+ defaultValue = props.defaultValue,
14111
14111
  onChange = props.onChange;
14112
- return (0,jsx_runtime_.jsx)(TextAreaContext.Provider, {
14113
- value: {
14114
- value: value,
14115
- onChange: onChange
14116
- },
14117
- children: children
14118
- });
14112
+ return (
14113
+ // controlled 면 defaultValue 를 textarea 에 같이 주지 않는다 (React 가 둘 다 있다고 경고한다)
14114
+ (0,jsx_runtime_.jsx)(TextAreaContext.Provider, {
14115
+ value: {
14116
+ value: value,
14117
+ defaultValue: value === undefined ? defaultValue : undefined,
14118
+ onChange: onChange
14119
+ },
14120
+ children: children
14121
+ })
14122
+ );
14119
14123
  };
14120
14124
  TextAreaRootBase.displayName = 'TextAreaRoot';
14121
14125
  var TextAreaLabel = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_.forwardRef)(function (props, ref) {
@@ -14136,6 +14140,7 @@ var TextAreaTextarea = /*#__PURE__*/(0,external_root_React_commonjs2_react_commo
14136
14140
  restProps = __rest(props, ["className", "disabled"]);
14137
14141
  var _a = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_.useContext)(TextAreaContext),
14138
14142
  value = _a.value,
14143
+ defaultValue = _a.defaultValue,
14139
14144
  onChange = _a.onChange;
14140
14145
  return (0,jsx_runtime_.jsx)("textarea", __assign({
14141
14146
  ref: ref,
@@ -14143,8 +14148,9 @@ var TextAreaTextarea = /*#__PURE__*/(0,external_root_React_commonjs2_react_commo
14143
14148
  disabled: disabled,
14144
14149
  "data-disabled": disabled || undefined
14145
14150
  }, restProps, {
14146
- // 값은 Root 가 쥔다. 넘겨받은 value·onChange 가 Root 상태를 덮지 않게 spread 뒤에 둔다.
14151
+ // 값은 Root 가 정한다. 넘겨받은 value·onChange 가 Root 를 덮지 않게 spread 뒤에 둔다.
14147
14152
  value: value,
14153
+ defaultValue: defaultValue,
14148
14154
  onChange: onChange
14149
14155
  }));
14150
14156
  });
@@ -14271,7 +14277,8 @@ var TextArea = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
14271
14277
  };
14272
14278
  var showClear = clearable && currentValue !== '' && engaged && !disabled && !readOnly;
14273
14279
  return (0,jsx_runtime_.jsx)(base_text_area, {
14274
- value: currentValue,
14280
+ value: value,
14281
+ defaultValue: defaultValue,
14275
14282
  onChange: handleChange,
14276
14283
  children: (0,jsx_runtime_.jsxs)("div", {
14277
14284
  className: 'text-area',
@@ -14288,6 +14295,8 @@ var TextArea = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
14288
14295
  readOnly: readOnly,
14289
14296
  "aria-invalid": isError || undefined,
14290
14297
  onFocus: function onFocus(e) {
14298
+ // uncontrolled 면 ref 로 바뀐 값(react-hook-form)을 여기서 읽어 지우기 버튼에 맞춘다
14299
+ if (value === undefined) setInnerValue(e.target.value);
14291
14300
  focusedValueRef.current = e.target.value;
14292
14301
  _onFocus === null || _onFocus === void 0 ? void 0 : _onFocus(e);
14293
14302
  },
@@ -14527,7 +14536,6 @@ var identity = function identity(text) {
14527
14536
  return text;
14528
14537
  };
14529
14538
  var TextFieldContext = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({
14530
- display: '',
14531
14539
  onChange: function onChange() {}
14532
14540
  });
14533
14541
  // context 만 내려주고 DOM 을 그리지 않아 ref 를 받을 곳이 없다.
@@ -14535,6 +14543,7 @@ var TextFieldRootBase = function TextFieldRootBase(props) {
14535
14543
  var _a, _b;
14536
14544
  var children = props.children,
14537
14545
  value = props.value,
14546
+ defaultValue = props.defaultValue,
14538
14547
  format = props.format,
14539
14548
  onChange = props.onChange;
14540
14549
  var transform = (_a = format === null || format === void 0 ? void 0 : format.transform) !== null && _a !== void 0 ? _a : identity;
@@ -14544,10 +14553,15 @@ var TextFieldRootBase = function TextFieldRootBase(props) {
14544
14553
  // DOM 값을 raw 로 맞춰야 받는 쪽이 raw 를 읽고, React 가 다음 렌더에서 transform(raw) 로 다시 그린다
14545
14554
  if (raw !== e.target.value) e.target.value = raw;
14546
14555
  onChange(e);
14556
+ // uncontrolled 는 React 가 다시 그리지 않으니 보이는 글을 직접 맞춘다
14557
+ var display = transform(raw);
14558
+ if (value === undefined && display !== e.target.value) e.target.value = display;
14547
14559
  };
14548
14560
  return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(TextFieldContext.Provider, {
14549
14561
  value: {
14550
- display: transform(value),
14562
+ display: value === undefined ? undefined : transform(value),
14563
+ // controlled 면 defaultValue 를 input 에 같이 주지 않는다 (React 가 둘 다 있다고 경고한다)
14564
+ defaultDisplay: value === undefined && defaultValue !== undefined ? transform(defaultValue) : undefined,
14551
14565
  onChange: handleChange
14552
14566
  },
14553
14567
  children: children
@@ -14572,6 +14586,7 @@ var TextFieldInput = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardR
14572
14586
  restProps = __rest(props, ["className", "disabled"]);
14573
14587
  var _a = (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(TextFieldContext),
14574
14588
  display = _a.display,
14589
+ defaultDisplay = _a.defaultDisplay,
14575
14590
  onChange = _a.onChange;
14576
14591
  return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", __assign({
14577
14592
  ref: ref,
@@ -14579,8 +14594,9 @@ var TextFieldInput = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardR
14579
14594
  disabled: disabled,
14580
14595
  "data-disabled": disabled
14581
14596
  }, restProps, {
14582
- // 값은 Root 가 쥔다. 넘겨받은 value·onChange 가 Root 상태를 덮지 않게 spread 뒤에 둔다.
14597
+ // 값은 Root 가 정한다. 넘겨받은 value·onChange 가 Root 를 덮지 않게 spread 뒤에 둔다.
14583
14598
  value: display,
14599
+ defaultValue: defaultDisplay,
14584
14600
  onChange: onChange
14585
14601
  }));
14586
14602
  });
@@ -14785,7 +14801,8 @@ var TextField = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(f
14785
14801
  });
14786
14802
  }
14787
14803
  return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_base_text_field__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A, {
14788
- value: raw,
14804
+ value: value,
14805
+ defaultValue: defaultValue,
14789
14806
  format: format,
14790
14807
  onChange: handleChange,
14791
14808
  children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
@@ -14807,7 +14824,13 @@ var TextField = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(f
14807
14824
  readOnly: readOnly,
14808
14825
  "aria-invalid": isError || undefined,
14809
14826
  onFocus: function onFocus(e) {
14810
- focusedValueRef.current = raw;
14827
+ // uncontrolled 면 ref 로 바뀐 값(react-hook-form)을 여기서 읽어 지우기 버튼에 맞춘다
14828
+ var now = raw;
14829
+ if (value === undefined) {
14830
+ now = (format === null || format === void 0 ? void 0 : format.reset) ? format.reset(e.target.value) : e.target.value;
14831
+ setInnerValue(now);
14832
+ }
14833
+ focusedValueRef.current = now;
14811
14834
  _onFocus === null || _onFocus === void 0 ? void 0 : _onFocus(e);
14812
14835
  },
14813
14836
  onBlur: function onBlur(e) {
@@ -279,7 +279,8 @@ var TextField = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(f
279
279
  });
280
280
  }
281
281
  return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_base_text_field__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A, {
282
- value: raw,
282
+ value: value,
283
+ defaultValue: defaultValue,
283
284
  format: format,
284
285
  onChange: handleChange,
285
286
  children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
@@ -301,7 +302,13 @@ var TextField = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(f
301
302
  readOnly: readOnly,
302
303
  "aria-invalid": isError || undefined,
303
304
  onFocus: function onFocus(e) {
304
- focusedValueRef.current = raw;
305
+ // uncontrolled 면 ref 로 바뀐 값(react-hook-form)을 여기서 읽어 지우기 버튼에 맞춘다
306
+ var now = raw;
307
+ if (value === undefined) {
308
+ now = (format === null || format === void 0 ? void 0 : format.reset) ? format.reset(e.target.value) : e.target.value;
309
+ setInnerValue(now);
310
+ }
311
+ focusedValueRef.current = now;
305
312
  _onFocus === null || _onFocus === void 0 ? void 0 : _onFocus(e);
306
313
  },
307
314
  onBlur: function onBlur(e) {
package/dist/text-area.js CHANGED
@@ -52,21 +52,25 @@ var __rest = undefined && undefined.__rest || function (s, e) {
52
52
 
53
53
 
54
54
  var TextAreaContext = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_.createContext)({
55
- value: '',
56
55
  onChange: function onChange() {}
57
56
  });
58
57
  // context 만 내려주고 DOM 을 그리지 않아 ref 를 받을 곳이 없다.
59
58
  var TextAreaRootBase = function TextAreaRootBase(props) {
60
59
  var children = props.children,
61
60
  value = props.value,
61
+ defaultValue = props.defaultValue,
62
62
  onChange = props.onChange;
63
- return (0,jsx_runtime_.jsx)(TextAreaContext.Provider, {
64
- value: {
65
- value: value,
66
- onChange: onChange
67
- },
68
- children: children
69
- });
63
+ return (
64
+ // controlled 면 defaultValue 를 textarea 에 같이 주지 않는다 (React 가 둘 다 있다고 경고한다)
65
+ (0,jsx_runtime_.jsx)(TextAreaContext.Provider, {
66
+ value: {
67
+ value: value,
68
+ defaultValue: value === undefined ? defaultValue : undefined,
69
+ onChange: onChange
70
+ },
71
+ children: children
72
+ })
73
+ );
70
74
  };
71
75
  TextAreaRootBase.displayName = 'TextAreaRoot';
72
76
  var TextAreaLabel = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_.forwardRef)(function (props, ref) {
@@ -87,6 +91,7 @@ var TextAreaTextarea = /*#__PURE__*/(0,external_root_React_commonjs2_react_commo
87
91
  restProps = __rest(props, ["className", "disabled"]);
88
92
  var _a = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_module_react_.useContext)(TextAreaContext),
89
93
  value = _a.value,
94
+ defaultValue = _a.defaultValue,
90
95
  onChange = _a.onChange;
91
96
  return (0,jsx_runtime_.jsx)("textarea", __assign({
92
97
  ref: ref,
@@ -94,8 +99,9 @@ var TextAreaTextarea = /*#__PURE__*/(0,external_root_React_commonjs2_react_commo
94
99
  disabled: disabled,
95
100
  "data-disabled": disabled || undefined
96
101
  }, restProps, {
97
- // 값은 Root 가 쥔다. 넘겨받은 value·onChange 가 Root 상태를 덮지 않게 spread 뒤에 둔다.
102
+ // 값은 Root 가 정한다. 넘겨받은 value·onChange 가 Root 를 덮지 않게 spread 뒤에 둔다.
98
103
  value: value,
104
+ defaultValue: defaultValue,
99
105
  onChange: onChange
100
106
  }));
101
107
  });
@@ -222,7 +228,8 @@ var TextArea = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
222
228
  };
223
229
  var showClear = clearable && currentValue !== '' && engaged && !disabled && !readOnly;
224
230
  return (0,jsx_runtime_.jsx)(base_text_area, {
225
- value: currentValue,
231
+ value: value,
232
+ defaultValue: defaultValue,
226
233
  onChange: handleChange,
227
234
  children: (0,jsx_runtime_.jsxs)("div", {
228
235
  className: 'text-area',
@@ -239,6 +246,8 @@ var TextArea = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_reac
239
246
  readOnly: readOnly,
240
247
  "aria-invalid": isError || undefined,
241
248
  onFocus: function onFocus(e) {
249
+ // uncontrolled 면 ref 로 바뀐 값(react-hook-form)을 여기서 읽어 지우기 버튼에 맞춘다
250
+ if (value === undefined) setInnerValue(e.target.value);
242
251
  focusedValueRef.current = e.target.value;
243
252
  _onFocus === null || _onFocus === void 0 ? void 0 : _onFocus(e);
244
253
  },
@@ -127,7 +127,8 @@ var TextField = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(f
127
127
  });
128
128
  }
129
129
  return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_base_text_field__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .A, {
130
- value: raw,
130
+ value: value,
131
+ defaultValue: defaultValue,
131
132
  format: format,
132
133
  onChange: handleChange,
133
134
  children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
@@ -149,7 +150,13 @@ var TextField = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(f
149
150
  readOnly: readOnly,
150
151
  "aria-invalid": isError || undefined,
151
152
  onFocus: function onFocus(e) {
152
- focusedValueRef.current = raw;
153
+ // uncontrolled 면 ref 로 바뀐 값(react-hook-form)을 여기서 읽어 지우기 버튼에 맞춘다
154
+ var now = raw;
155
+ if (value === undefined) {
156
+ now = (format === null || format === void 0 ? void 0 : format.reset) ? format.reset(e.target.value) : e.target.value;
157
+ setInnerValue(now);
158
+ }
159
+ focusedValueRef.current = now;
153
160
  _onFocus === null || _onFocus === void 0 ? void 0 : _onFocus(e);
154
161
  },
155
162
  onBlur: function onBlur(e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nurihaus/web-design-system",
3
- "version": "3.9.4",
3
+ "version": "3.9.5",
4
4
  "description": "Nurihaus 디자인 시스템 — 컴포넌트와 디자인 토큰",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",