@t3q-ui/design-system 1.68.1 → 1.68.2

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 (35) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/dist/components/_internal/floatingLabelOutline.cjs +68 -1
  3. package/dist/components/_internal/floatingLabelOutline.cjs.map +1 -1
  4. package/dist/components/_internal/floatingLabelOutline.js +52 -2
  5. package/dist/components/_internal/floatingLabelOutline.js.map +1 -1
  6. package/dist/components/_internal/textInput.cjs +217 -0
  7. package/dist/components/_internal/textInput.cjs.map +1 -0
  8. package/dist/components/_internal/textInput.js +200 -0
  9. package/dist/components/_internal/textInput.js.map +1 -0
  10. package/dist/components/datePicker.cjs +11 -47
  11. package/dist/components/datePicker.cjs.map +1 -1
  12. package/dist/components/datePicker.js +12 -48
  13. package/dist/components/datePicker.js.map +1 -1
  14. package/dist/components/multiSelect/multiSelectTrigger.cjs +18 -38
  15. package/dist/components/multiSelect/multiSelectTrigger.cjs.map +1 -1
  16. package/dist/components/multiSelect/multiSelectTrigger.js +19 -39
  17. package/dist/components/multiSelect/multiSelectTrigger.js.map +1 -1
  18. package/dist/components/select/selectTrigger.cjs +11 -47
  19. package/dist/components/select/selectTrigger.cjs.map +1 -1
  20. package/dist/components/select/selectTrigger.js +12 -48
  21. package/dist/components/select/selectTrigger.js.map +1 -1
  22. package/dist/components/textArea.cjs +15 -172
  23. package/dist/components/textArea.cjs.map +1 -1
  24. package/dist/components/textArea.js +15 -172
  25. package/dist/components/textArea.js.map +1 -1
  26. package/dist/components/textField.cjs +48 -222
  27. package/dist/components/textField.cjs.map +1 -1
  28. package/dist/components/textField.js +48 -222
  29. package/dist/components/textField.js.map +1 -1
  30. package/dist/components/timePicker.cjs +11 -47
  31. package/dist/components/timePicker.cjs.map +1 -1
  32. package/dist/components/timePicker.js +12 -48
  33. package/dist/components/timePicker.js.map +1 -1
  34. package/mcp/manifests/components.json +6 -1
  35. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"selectTrigger.js","sources":["../../../src/components/select/selectTrigger.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as PopoverPrimitive from '@radix-ui/react-popover'\nimport { cva } from 'class-variance-authority'\n\nimport { useFloatingLabel } from '../../hooks/useFloatingLabel'\nimport { cn } from '../../utils/cn'\nimport { FloatingLabelOutline } from '../_internal/floatingLabelOutline'\nimport { useFormControlContext } from '../form'\nimport { sendKeyToList, useSelectContext } from './selectRoot'\nimport type { SelectTriggerProps } from './types'\n\nexport const selectTriggerVariants = cva(\n [\n 'flex w-full items-center gap-[2px] bg-transparent whitespace-nowrap outline-none cursor-pointer',\n 'rounded-small min-h-[36px] text-base-medium text-sys-text-main',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0',\n ].join(' '),\n {\n variants: {\n appearance: {\n standard: [\n 'bg-sys-background border border-sys-divider-main py-[3px] px-[5px]',\n 'hover:bg-secondary-o10 disabled:hover:bg-sys-background',\n 'focus:border-[2px] focus:border-sys-focus-ring-bold focus:py-[2px] focus:px-[4px]',\n ].join(' '),\n none: 'bg-transparent border-none py-[4px] px-[6px]',\n },\n isInvalid: {\n true: '',\n false: '',\n },\n },\n compoundVariants: [\n {\n appearance: 'standard',\n isInvalid: true,\n class: 'border-[2px] border-danger30 py-[2px] px-[4px] focus:border-danger30',\n },\n ],\n defaultVariants: {\n appearance: 'standard',\n isInvalid: false,\n },\n },\n)\n\n// 닫힌 트리거를 여는 키, 열린 목록에 넘기는 키(Space 는 Enter 로 넘겨 고른다)\nconst OPEN_KEYS = ['Enter', ' ', 'ArrowDown', 'ArrowUp']\nconst LIST_KEYS = ['Enter', ' ', 'ArrowDown', 'ArrowUp', 'Home', 'End']\n\nconst SelectTrigger = React.forwardRef<HTMLButtonElement, SelectTriggerProps>(\n (\n {\n className,\n children,\n appearance,\n isInvalid: isInvalidProp,\n label,\n required,\n onFocus: onFocusProp,\n onBlur: onBlurProp,\n onKeyDown: onKeyDownProp,\n ...props\n },\n ref,\n ) => {\n const formControl = useFormControlContext()\n const isInvalid = isInvalidProp ?? formControl?.isInvalid ?? false\n const { open, disabled, value, openWithKeyboard, commandRef, listboxId, activeOptionId } =\n useSelectContext()\n // role=combobox 는 자식 텍스트로 접근 가능한 이름을 얻지 못한다(axe button-name).\n // label 이 없으면 placeholder/선택값이 든 내용 영역을 aria-labelledby 로 연결한다.\n const contentId = React.useId()\n const [isFocused, setIsFocused] = React.useState(false)\n\n const {\n hasLabel,\n isFloating,\n isMounted,\n labelColorClass,\n borderColorClass,\n isThickBorder,\n labelId,\n } = useFloatingLabel({\n label,\n hasValue: !!value,\n isOpen: open,\n isFocused,\n isInvalid: !!isInvalid,\n isDisabled: disabled || !!props.disabled,\n appearance: appearance ?? 'standard',\n })\n\n const showNotchedOutline = hasLabel && appearance !== 'none'\n const showNoneLabel = hasLabel && appearance === 'none'\n\n const handleFocus = React.useCallback(\n (e: React.FocusEvent<HTMLButtonElement>) => {\n setIsFocused(true)\n onFocusProp?.(e)\n },\n [onFocusProp],\n )\n\n const handleBlur = React.useCallback(\n (e: React.FocusEvent<HTMLButtonElement>) => {\n setIsFocused(false)\n onBlurProp?.(e)\n },\n [onBlurProp],\n )\n\n // 포커스는 트리거에 남는다. 닫혀 있으면 열고(고른 항목, 없으면 첫 활성 항목을 하이라이트), 열려 있으면 키를 목록에 넘긴다\n const handleKeyDown = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n onKeyDownProp?.(e)\n if (e.defaultPrevented) return\n if (!open) {\n if (!OPEN_KEYS.includes(e.key)) return\n e.preventDefault()\n openWithKeyboard(value ?? '')\n return\n }\n if (LIST_KEYS.includes(e.key)) {\n sendKeyToList(commandRef.current, e, e.key === ' ' ? 'Enter' : e.key)\n }\n }\n\n return (\n <PopoverPrimitive.Trigger asChild>\n <button\n ref={ref}\n type='button'\n role='combobox'\n aria-expanded={open}\n aria-controls={open ? listboxId : undefined}\n aria-activedescendant={open ? activeOptionId : undefined}\n aria-haspopup='listbox'\n aria-invalid={isInvalid || undefined}\n aria-labelledby={hasLabel ? labelId : contentId}\n aria-required={hasLabel && required ? true : undefined}\n data-slot='select-trigger'\n data-state={open ? 'open' : 'closed'}\n disabled={disabled || props.disabled}\n className={cn(\n selectTriggerVariants({ appearance, isInvalid }),\n '[&_[data-placeholder]]:text-sys-text-placeholder',\n (showNotchedOutline || showNoneLabel) && 'relative',\n // Three-box가 border를 대신 그리므로 버튼 자체 border 제거\n showNotchedOutline && '!border-0 !py-[4px] !px-[6px]',\n className,\n )}\n {...props}\n onKeyDown={handleKeyDown}\n onFocus={hasLabel ? handleFocus : onFocusProp}\n onBlur={hasLabel ? handleBlur : onBlurProp}\n >\n {/* Floating label (standard: notched outline, none: inline label) */}\n {(showNotchedOutline || showNoneLabel) && (\n <FloatingLabelOutline\n mode={showNotchedOutline ? 'standard' : 'none'}\n label={label!}\n required={required}\n isFloating={isFloating}\n isMounted={isMounted}\n labelColorClass={labelColorClass}\n borderColorClass={borderColorClass}\n isThickBorder={isThickBorder}\n labelId={labelId}\n />\n )}\n\n {/* Content (label 모드에서 값이 없으면 숨김 - label이 placeholder 역할) */}\n <div\n id={contentId}\n className={cn(\n 'flex flex-1 items-center min-h-[28px] min-w-0 px-[4px] py-[2px]',\n hasLabel && !value && 'invisible',\n )}\n >\n {children}\n </div>\n\n {/* Chevron */}\n <svg\n viewBox='0 0 24 24'\n fill='currentColor'\n aria-hidden='true'\n className={cn('size-[24px] shrink-0 transition-transform', open && 'rotate-180')}\n >\n <path d='M7 10l5 5 5-5z' />\n </svg>\n </button>\n </PopoverPrimitive.Trigger>\n )\n },\n)\nSelectTrigger.displayName = 'SelectTrigger'\n\nexport { SelectTrigger }\n"],"names":[],"mappings":";;;;;;;;;;AAaO,MAAM,wBAAwB;AAAA,EACnC;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,E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;AAAA,QAED,GAAG;AAAA,QACJ,WAAW;AAAA,QACX,SAAS,WAAW,cAAc;AAAA,QAClC,QAAQ,WAAW,aAAa;AAAA,QAG9B,UAAA;AAAA,WAAA,sBAAsB,kBACtB;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAM,qBAAqB,aAAa;AAAA,cACxC;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,YAAA;AAAA,UAAA;AAAA,UAKJ;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAI;AAAA,cACJ,WAAW;AAAA,gBACT;AAAA,gBACA,YAAY,CAAC,SAAS;AAAA,cAAA;AAAA,cAGvB;AAAA,YAAA;AAAA,UAAA;AAAA,UAIH;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,eAAY;AAAA,cACZ,WAAW,GAAG,6CAA6C,QAAQ,YAAY;AAAA,cAE/E,UAAA,oBAAC,QAAA,EAAK,GAAE,iBAAA,CAAiB;AAAA,YAAA;AAAA,UAAA;AAAA,QAC3B;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AACA,cAAc,cAAc;"}
1
+ {"version":3,"file":"selectTrigger.js","sources":["../../../src/components/select/selectTrigger.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport * as PopoverPrimitive from '@radix-ui/react-popover'\nimport { cva } from 'class-variance-authority'\n\nimport { cn } from '../../utils/cn'\nimport { useFloatingLabelOutline } from '../_internal/floatingLabelOutline'\nimport { useFormControlContext } from '../form'\nimport { sendKeyToList, useSelectContext } from './selectRoot'\nimport type { SelectTriggerProps } from './types'\n\nexport const selectTriggerVariants = cva(\n [\n 'flex w-full items-center gap-[2px] bg-transparent whitespace-nowrap outline-none cursor-pointer',\n 'rounded-small min-h-[36px] text-base-medium text-sys-text-main',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0',\n ].join(' '),\n {\n variants: {\n appearance: {\n standard: [\n 'bg-sys-background border border-sys-divider-main py-[3px] px-[5px]',\n 'hover:bg-secondary-o10 disabled:hover:bg-sys-background',\n 'focus:border-[2px] focus:border-sys-focus-ring-bold focus:py-[2px] focus:px-[4px]',\n ].join(' '),\n none: 'bg-transparent border-none py-[4px] px-[6px]',\n },\n isInvalid: {\n true: '',\n false: '',\n },\n },\n compoundVariants: [\n {\n appearance: 'standard',\n isInvalid: true,\n class: 'border-[2px] border-danger30 py-[2px] px-[4px] focus:border-danger30',\n },\n ],\n defaultVariants: {\n appearance: 'standard',\n isInvalid: false,\n },\n },\n)\n\n// 닫힌 트리거를 여는 키, 열린 목록에 넘기는 키(Space 는 Enter 로 넘겨 고른다)\nconst OPEN_KEYS = ['Enter', ' ', 'ArrowDown', 'ArrowUp']\nconst LIST_KEYS = ['Enter', ' ', 'ArrowDown', 'ArrowUp', 'Home', 'End']\n\nconst SelectTrigger = React.forwardRef<HTMLButtonElement, SelectTriggerProps>(\n (\n {\n className,\n children,\n appearance,\n isInvalid: isInvalidProp,\n label,\n required,\n onFocus: onFocusProp,\n onBlur: onBlurProp,\n onKeyDown: onKeyDownProp,\n ...props\n },\n ref,\n ) => {\n const formControl = useFormControlContext()\n const isInvalid = isInvalidProp ?? formControl?.isInvalid ?? false\n const { open, disabled, value, openWithKeyboard, commandRef, listboxId, activeOptionId } =\n useSelectContext()\n // role=combobox 는 자식 텍스트로 접근 가능한 이름을 얻지 못한다(axe button-name).\n // label 이 없으면 placeholder/선택값이 든 내용 영역을 aria-labelledby 로 연결한다.\n const contentId = React.useId()\n\n const floating = useFloatingLabelOutline<HTMLButtonElement>({\n label,\n required,\n appearance: appearance ?? 'standard',\n hasValue: !!value,\n isOpen: open,\n isInvalid: !!isInvalid,\n isDisabled: disabled || !!props.disabled,\n onFocus: onFocusProp,\n onBlur: onBlurProp,\n })\n const { hasLabel, labelId } = floating\n\n // 포커스는 트리거에 남는다. 닫혀 있으면 열고(고른 항목, 없으면 첫 활성 항목을 하이라이트), 열려 있으면 키를 목록에 넘긴다\n const handleKeyDown = (e: React.KeyboardEvent<HTMLButtonElement>) => {\n onKeyDownProp?.(e)\n if (e.defaultPrevented) return\n if (!open) {\n if (!OPEN_KEYS.includes(e.key)) return\n e.preventDefault()\n openWithKeyboard(value ?? '')\n return\n }\n if (LIST_KEYS.includes(e.key)) {\n sendKeyToList(commandRef.current, e, e.key === ' ' ? 'Enter' : e.key)\n }\n }\n\n return (\n <PopoverPrimitive.Trigger asChild>\n <button\n ref={ref}\n type='button'\n role='combobox'\n aria-expanded={open}\n aria-controls={open ? listboxId : undefined}\n aria-activedescendant={open ? activeOptionId : undefined}\n aria-haspopup='listbox'\n aria-invalid={isInvalid || undefined}\n aria-labelledby={hasLabel ? labelId : contentId}\n aria-required={hasLabel && required ? true : undefined}\n data-slot='select-trigger'\n data-state={open ? 'open' : 'closed'}\n disabled={disabled || props.disabled}\n className={cn(\n selectTriggerVariants({ appearance, isInvalid }),\n '[&_[data-placeholder]]:text-sys-text-placeholder',\n // Three-box가 border를 대신 그리므로 버튼 자체 border 제거\n floating.hostClassName,\n className,\n )}\n {...props}\n onKeyDown={handleKeyDown}\n onFocus={floating.onFocus}\n onBlur={floating.onBlur}\n >\n {/* Floating label (standard: notched outline, none: inline label) */}\n {floating.outline}\n\n {/* Content (label 모드에서 값이 없으면 숨김 - label이 placeholder 역할) */}\n <div\n id={contentId}\n className={cn(\n 'flex flex-1 items-center min-h-[28px] min-w-0 px-[4px] py-[2px]',\n hasLabel && !value && 'invisible',\n )}\n >\n {children}\n </div>\n\n {/* Chevron */}\n <svg\n viewBox='0 0 24 24'\n fill='currentColor'\n aria-hidden='true'\n className={cn('size-[24px] shrink-0 transition-transform', open && 'rotate-180')}\n >\n <path d='M7 10l5 5 5-5z' />\n </svg>\n </button>\n </PopoverPrimitive.Trigger>\n )\n },\n)\nSelectTrigger.displayName = 'SelectTrigger'\n\nexport {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YAAA;AAAA,UAAA;AAAA,UAIH;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,SAAQ;AAAA,cACR,MAAK;AAAA,cACL,eAAY;AAAA,cACZ,WAAW,GAAG,6CAA6C,QAAQ,YAAY;AAAA,cAE/E,UAAA,oBAAC,QAAA,EAAK,GAAE,iBAAA,CAAiB;AAAA,YAAA;AAAA,UAAA;AAAA,QAC3B;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AACA,cAAc,cAAc;"}
@@ -4,12 +4,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
4
4
  const jsxRuntime = require("react/jsx-runtime");
5
5
  const React = require("react");
6
6
  const TextareaAutosize = require("react-textarea-autosize");
7
- const classVarianceAuthority = require("class-variance-authority");
8
- const floatingLabelOutline = require("./_internal/floatingLabelOutline.cjs");
9
- const useControllableValue = require("../hooks/useControllableValue.cjs");
10
- const useFloatingLabel = require("../hooks/useFloatingLabel.cjs");
11
- const cn = require("../utils/cn.cjs");
12
- const form = require("./form.cjs");
7
+ const textInput = require("./_internal/textInput.cjs");
13
8
  function _interopNamespaceDefault(e) {
14
9
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
15
10
  if (e) {
@@ -27,192 +22,40 @@ function _interopNamespaceDefault(e) {
27
22
  return Object.freeze(n);
28
23
  }
29
24
  const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
30
- const textareaContainerVariants = classVarianceAuthority.cva(
31
- [
32
- "flex w-full items-start bg-transparent",
33
- "rounded-small min-h-[84px] text-base-medium text-sys-text-main",
34
- "transition-colors"
35
- ].join(" "),
36
- {
37
- variants: {
38
- appearance: {
39
- standard: [
40
- "bg-sys-background border border-sys-divider-main py-[3px] px-[5px]",
41
- "hover:bg-secondary-o10"
42
- ].join(" "),
43
- none: "bg-transparent border-none py-[4px] px-[6px]"
44
- },
45
- isInvalid: {
46
- true: "",
47
- false: ""
48
- }
49
- },
50
- compoundVariants: [
25
+ const Textarea = React__namespace.forwardRef(
26
+ ({ appearance = "standard", resize = false, minRows = 3, maxRows, style, ...props }, forwardedRef) => {
27
+ const { floating, containerProps, elementProps } = textInput.useTextInput(
28
+ { ...props, appearance },
29
+ forwardedRef,
51
30
  {
52
- appearance: "standard",
53
- isInvalid: true,
54
- class: "border-[2px] border-danger30 py-[2px] px-[4px]"
31
+ multiline: true,
32
+ // maxRows 미지정(무한 auto-grow) 시 자체 스크롤바 숨김: 스크롤바가 뜨면 content 폭이 줄어
33
+ // autosize 재측정과 어긋나 스크롤바가 고착되는 피드백 루프를 막는다(스크롤바 없으면 content 가
34
+ // height 에 정확히 맞아 잘림 없음). maxRows 지정(바운드) 시엔 기본 overflow-y:auto 로 캡 초과분 스크롤.
35
+ elementClass: maxRows == null && "overflow-hidden"
55
36
  }
56
- ],
57
- defaultVariants: {
58
- appearance: "standard",
59
- isInvalid: false
60
- }
61
- }
62
- );
63
- const Textarea = React__namespace.forwardRef(
64
- ({
65
- appearance = "standard",
66
- label,
67
- required: requiredProp,
68
- isInvalid: isInvalidProp,
69
- containerClassName,
70
- className,
71
- disabled,
72
- readOnly,
73
- resize = false,
74
- minRows = 3,
75
- maxRows,
76
- value: valueProp,
77
- defaultValue,
78
- onChange: onChangeProp,
79
- onFocus: onFocusProp,
80
- onBlur: onBlurProp,
81
- style,
82
- ...textareaProps
83
- }, forwardedRef) => {
84
- const formControl = form.useFormControlContext();
85
- const isInvalid = isInvalidProp ?? formControl?.isInvalid ?? false;
86
- const textareaRef = React__namespace.useRef(null);
87
- const [isFocused, setIsFocused] = React__namespace.useState(false);
88
- const {
89
- value,
90
- setValue: trackValue,
91
- isControlled
92
- } = useControllableValue.useControllableValue({ value: valueProp, defaultValue, empty: "" });
93
- const hasValue = String(value) !== "";
94
- const composedRef = React__namespace.useCallback(
95
- (node) => {
96
- textareaRef.current = node;
97
- if (typeof forwardedRef === "function") forwardedRef(node);
98
- else if (forwardedRef)
99
- forwardedRef.current = node;
100
- },
101
- [forwardedRef]
102
- );
103
- const {
104
- hasLabel,
105
- isFloating,
106
- isMounted,
107
- labelColorClass,
108
- borderColorClass,
109
- isThickBorder,
110
- labelId
111
- } = useFloatingLabel.useFloatingLabel({
112
- label,
113
- hasValue,
114
- isFocused,
115
- isInvalid: !!isInvalid,
116
- isDisabled: !!disabled
117
- });
118
- const showNotchedOutline = hasLabel && appearance !== "none";
119
- const showNoneLabel = hasLabel && appearance === "none";
120
- const handleChange = React__namespace.useCallback(
121
- (e) => {
122
- trackValue(e.target.value);
123
- onChangeProp?.(e);
124
- },
125
- [trackValue, onChangeProp]
126
- );
127
- const handleFocus = React__namespace.useCallback(
128
- (e) => {
129
- setIsFocused(true);
130
- onFocusProp?.(e);
131
- },
132
- [onFocusProp]
133
- );
134
- const handleBlur = React__namespace.useCallback(
135
- (e) => {
136
- setIsFocused(false);
137
- onBlurProp?.(e);
138
- },
139
- [onBlurProp]
140
37
  );
141
38
  return /* @__PURE__ */ jsxRuntime.jsxs(
142
39
  "div",
143
40
  {
144
41
  "data-slot": "textarea",
145
- "aria-disabled": disabled || void 0,
146
- className: cn.cn(
147
- textareaContainerVariants({ appearance, isInvalid }),
148
- // Focus styling (state-managed, standard appearance without notched outline only)
149
- isFocused && !isInvalid && appearance === "standard" && !showNotchedOutline && "border-[2px] border-sys-focus-ring-bold py-[2px] px-[4px]",
150
- // Floating label positioning
151
- (showNotchedOutline || showNoneLabel) && "relative",
152
- // Notched outline draws border — remove container's own border
153
- showNotchedOutline && "!border-0 !py-[4px] !px-[6px]",
154
- // Disabled / cursor
155
- disabled ? "cursor-not-allowed opacity-50" : "cursor-text",
156
- // disabled 시 hover 배경 무력화 (div container라 :disabled 불가 → JS 조건부; none은 원래 hover bg 없음)
157
- disabled && appearance !== "none" && "hover:bg-sys-background",
158
- containerClassName,
159
- // 외부 className 은 root container 에 적용 — FormControl 의 maxWidth 가
160
- // 자식 className 에 inject 되는데, wrapper div 의 폭 제어가 의도이므로
161
- // inner textarea 가 아닌 여기에 머지한다.
162
- className
163
- ),
42
+ ...containerProps,
164
43
  style: {
165
44
  resize: resize ? "vertical" : "none",
166
45
  overflow: resize ? "hidden" : void 0
167
46
  },
168
47
  children: [
169
- (showNotchedOutline || showNoneLabel) && /* @__PURE__ */ jsxRuntime.jsx(
170
- floatingLabelOutline.FloatingLabelOutline,
171
- {
172
- mode: showNotchedOutline ? "standard" : "none",
173
- label,
174
- required: requiredProp,
175
- isFloating,
176
- isMounted,
177
- labelColorClass,
178
- borderColorClass,
179
- isThickBorder,
180
- labelId
181
- }
182
- ),
48
+ floating.outline,
183
49
  /* @__PURE__ */ jsxRuntime.jsx(
184
50
  TextareaAutosize,
185
51
  {
186
- ref: composedRef,
187
52
  minRows,
188
53
  maxRows,
189
- disabled,
190
- readOnly,
191
- value: isControlled ? value : void 0,
192
- defaultValue: !isControlled ? defaultValue : void 0,
193
- onChange: handleChange,
194
- onFocus: handleFocus,
195
- onBlur: handleBlur,
196
- "aria-labelledby": hasLabel ? labelId : void 0,
197
- "aria-required": hasLabel && requiredProp ? true : void 0,
198
- className: cn.cn(
199
- "flex-1 min-w-0 bg-transparent border-none outline-none",
200
- "text-base-medium text-sys-text-main",
201
- "placeholder:text-sys-text-placeholder",
202
- "disabled:cursor-not-allowed",
203
- "px-[4px] py-[2px]",
204
- // maxRows 미지정(무한 auto-grow) 시 자체 스크롤바 숨김: 스크롤바가 뜨면 content 폭이 줄어
205
- // autosize 재측정과 어긋나 스크롤바가 고착되는 피드백 루프를 막는다(스크롤바 없으면 content 가
206
- // height 에 정확히 맞아 잘림 없음). maxRows 지정(바운드) 시엔 기본 overflow-y:auto 로 캡 초과분 스크롤.
207
- maxRows == null && "overflow-hidden",
208
- // When label is down (acting as placeholder), hide textarea's placeholder
209
- hasLabel && !hasValue && !isFocused && "placeholder:text-transparent"
210
- ),
54
+ ...elementProps,
211
55
  style: {
212
56
  resize: "none",
213
57
  ...style
214
- },
215
- ...textareaProps
58
+ }
216
59
  }
217
60
  )
218
61
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"textArea.cjs","sources":["../../src/components/textArea.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport TextareaAutosize, { TextareaAutosizeProps } from 'react-textarea-autosize'\nimport { cva } from 'class-variance-authority'\n\nimport { FloatingLabelOutline } from './_internal/floatingLabelOutline'\nimport { useControllableValue } from '../hooks/useControllableValue'\nimport { useFloatingLabel } from '../hooks/useFloatingLabel'\nimport { cn } from '../utils/cn'\nimport { useFormControlContext } from './form'\n\nconst textareaContainerVariants = cva(\n [\n 'flex w-full items-start bg-transparent',\n 'rounded-small min-h-[84px] text-base-medium text-sys-text-main',\n 'transition-colors',\n ].join(' '),\n {\n variants: {\n appearance: {\n standard: [\n 'bg-sys-background border border-sys-divider-main py-[3px] px-[5px]',\n 'hover:bg-secondary-o10',\n ].join(' '),\n none: 'bg-transparent border-none py-[4px] px-[6px]',\n },\n isInvalid: {\n true: '',\n false: '',\n },\n },\n compoundVariants: [\n {\n appearance: 'standard',\n isInvalid: true,\n class: 'border-[2px] border-danger30 py-[2px] px-[4px]',\n },\n ],\n defaultVariants: {\n appearance: 'standard',\n isInvalid: false,\n },\n },\n)\n\nexport type TextareaProps = Omit<TextareaAutosizeProps, 'children'> & {\n /** @default 'standard' */\n appearance?: 'standard' | 'none'\n /** Floating label 텍스트 */\n label?: string\n /** 라벨 필수 표시 (*) */\n required?: boolean\n /** 에러 상태 */\n isInvalid?: boolean\n /** 컨테이너 div에 적용할 추가 className */\n containerClassName?: string\n /** 수동 리사이즈 허용 */\n resize?: boolean\n}\n\n/**\n * 여러 줄 글자 입력(떠 있는 라벨·자동 높이).\n *\n * 언제 쓰나: 설명·메모·사유처럼 한 줄을 넘는 글. `minRows`·`maxRows` 로 내용만큼 늘린다.\n * 언제 안 쓰나: 한 줄 값(→ TextField), 이름-값 여러 줄(→ ParameterTable), 코드·JSON 편집(DS 밖의 코드 편집기).\n * 대신/함께: 폼에서는 `FormControl` 안에. 글자 수(\"0 / 200자\")는 `FormDescription` 에 아이콘 없이.\n */\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n {\n appearance = 'standard',\n label,\n required: requiredProp,\n isInvalid: isInvalidProp,\n containerClassName,\n className,\n disabled,\n readOnly,\n resize = false,\n minRows = 3,\n maxRows,\n value: valueProp,\n defaultValue,\n onChange: onChangeProp,\n onFocus: onFocusProp,\n onBlur: onBlurProp,\n style,\n ...textareaProps\n },\n forwardedRef,\n ) => {\n const formControl = useFormControlContext()\n const isInvalid = isInvalidProp ?? formControl?.isInvalid ?? false\n const textareaRef = React.useRef<HTMLTextAreaElement>(null)\n const [isFocused, setIsFocused] = React.useState(false)\n\n // 비제어일 때 네이티브 입력이 값을 들고, 훅은 떠 있는 라벨용 hasValue 만 따라간다\n const {\n value,\n setValue: trackValue,\n isControlled,\n } = useControllableValue({ value: valueProp, defaultValue, empty: '' })\n const hasValue = String(value) !== ''\n\n // Compose refs (forwarded ref + internal ref)\n const composedRef = React.useCallback(\n (node: HTMLTextAreaElement | null) => {\n ;(textareaRef as React.MutableRefObject<HTMLTextAreaElement | null>).current = node\n if (typeof forwardedRef === 'function') forwardedRef(node)\n else if (forwardedRef)\n (forwardedRef as React.MutableRefObject<HTMLTextAreaElement | null>).current = node\n },\n [forwardedRef],\n )\n\n // Floating label\n const {\n hasLabel,\n isFloating,\n isMounted,\n labelColorClass,\n borderColorClass,\n isThickBorder,\n labelId,\n } = useFloatingLabel({\n label,\n hasValue,\n isFocused,\n isInvalid: !!isInvalid,\n isDisabled: !!disabled,\n appearance,\n })\n\n const showNotchedOutline = hasLabel && appearance !== 'none'\n const showNoneLabel = hasLabel && appearance === 'none'\n\n // --- Handlers ---\n\n const handleChange = React.useCallback(\n (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n trackValue(e.target.value)\n onChangeProp?.(e)\n },\n [trackValue, onChangeProp],\n )\n\n const handleFocus = React.useCallback(\n (e: React.FocusEvent<HTMLTextAreaElement>) => {\n setIsFocused(true)\n onFocusProp?.(e)\n },\n [onFocusProp],\n )\n\n const handleBlur = React.useCallback(\n (e: React.FocusEvent<HTMLTextAreaElement>) => {\n setIsFocused(false)\n onBlurProp?.(e)\n },\n [onBlurProp],\n )\n\n return (\n <div\n data-slot='textarea'\n aria-disabled={disabled || undefined}\n className={cn(\n textareaContainerVariants({ appearance, isInvalid }),\n // Focus styling (state-managed, standard appearance without notched outline only)\n isFocused &&\n !isInvalid &&\n appearance === 'standard' &&\n !showNotchedOutline &&\n 'border-[2px] border-sys-focus-ring-bold py-[2px] px-[4px]',\n // Floating label positioning\n (showNotchedOutline || showNoneLabel) && 'relative',\n // Notched outline draws border — remove container's own border\n showNotchedOutline && '!border-0 !py-[4px] !px-[6px]',\n // Disabled / cursor\n disabled ? 'cursor-not-allowed opacity-50' : 'cursor-text',\n // disabled 시 hover 배경 무력화 (div container라 :disabled 불가 → JS 조건부; none은 원래 hover bg 없음)\n disabled && appearance !== 'none' && 'hover:bg-sys-background',\n containerClassName,\n // 외부 className 은 root container 에 적용 — FormControl 의 maxWidth 가\n // 자식 className 에 inject 되는데, wrapper div 의 폭 제어가 의도이므로\n // inner textarea 가 아닌 여기에 머지한다.\n className,\n )}\n style={{\n resize: resize ? 'vertical' : 'none',\n overflow: resize ? 'hidden' : undefined,\n }}\n >\n {/* Floating label (standard: notched outline, none: inline label) */}\n {(showNotchedOutline || showNoneLabel) && (\n <FloatingLabelOutline\n mode={showNotchedOutline ? 'standard' : 'none'}\n label={label!}\n required={requiredProp}\n isFloating={isFloating}\n isMounted={isMounted}\n labelColorClass={labelColorClass}\n borderColorClass={borderColorClass}\n isThickBorder={isThickBorder}\n labelId={labelId}\n />\n )}\n\n {/* Textarea */}\n <TextareaAutosize\n ref={composedRef}\n minRows={minRows}\n maxRows={maxRows}\n disabled={disabled}\n readOnly={readOnly}\n value={isControlled ? value : undefined}\n defaultValue={!isControlled ? defaultValue : undefined}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n aria-labelledby={hasLabel ? labelId : undefined}\n aria-required={hasLabel && requiredProp ? true : undefined}\n className={cn(\n 'flex-1 min-w-0 bg-transparent border-none outline-none',\n 'text-base-medium text-sys-text-main',\n 'placeholder:text-sys-text-placeholder',\n 'disabled:cursor-not-allowed',\n 'px-[4px] py-[2px]',\n // maxRows 미지정(무한 auto-grow) 시 자체 스크롤바 숨김: 스크롤바가 뜨면 content 폭이 줄어\n // autosize 재측정과 어긋나 스크롤바가 고착되는 피드백 루프를 막는다(스크롤바 없으면 content 가\n // height 에 정확히 맞아 잘림 없음). maxRows 지정(바운드) 시엔 기본 overflow-y:auto 로 캡 초과분 스크롤.\n maxRows == null && 'overflow-hidden',\n // When label is down (acting as placeholder), hide textarea's placeholder\n hasLabel && !hasValue && !isFocused && 'placeholder:text-transparent',\n )}\n style={{\n resize: 'none',\n ...style,\n }}\n {...textareaProps}\n />\n </div>\n )\n },\n)\nTextarea.displayName = 'Textarea'\n\nexport { Textarea }\n"],"names":["cva","React","useFormControlContext","useControllableValue","useFloatingLabel","jsxs","cn","jsx","FloatingLabelOutline"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAM,4BAA4BA,uBAAAA;AAAAA,EAChC;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,EACV;AAAA,IACE,UAAU;AAAA,MACR,YAAY;AAAA,QACV,UAAU;AAAA,UACR;AAAA,UACA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA,QACV,MAAM;AAAA,MAAA;AAAA,MAER,WAAW;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,IAEF,kBAAkB;AAAA,MAChB;AAAA,QACE,YAAY;AAAA,QACZ,WAAW;AAAA,QACX,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,IAEF,iBAAiB;AAAA,MACf,YAAY;AAAA,MACZ,WAAW;AAAA,IAAA;AAAA,EACb;AAEJ;AAwBA,MA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e,eAAe;AAAA,cAC7C,UAAU;AAAA,cACV,SAAS;AAAA,cACT,QAAQ;AAAA,cACR,mBAAiB,WAAW,UAAU;AAAA,cACtC,iBAAe,YAAY,eAAe,OAAO;AAAA,cACjD,WAAWD,GAAAA;AAAAA,gBACT;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA;AAAA;AAAA;AAAA,gBAIA,WAAW,QAAQ;AAAA;AAAA,gBAEnB,YAAY,CAAC,YAAY,CAAC,aAAa;AAAA,cAAA;AAAA,cAEzC,OAAO;AAAA,gBACL,QAAQ;AAAA,gBACR,GAAG;AAAA,cAAA;AAAA,cAEJ,GAAG;AAAA,YAAA;AAAA,UAAA;AAAA,QACN;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACA,SAAS,cAAc;;"}
1
+ {"version":3,"file":"textArea.cjs","sources":["../../src/components/textArea.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport TextareaAutosize, { TextareaAutosizeProps } from 'react-textarea-autosize'\n\nimport { useTextInput } from './_internal/textInput'\n\nexport type TextareaProps = Omit<TextareaAutosizeProps, 'children'> & {\n /** @default 'standard' */\n appearance?: 'standard' | 'none'\n /** Floating label 텍스트 */\n label?: string\n /** 라벨 필수 표시 (*) */\n required?: boolean\n /** 에러 상태 */\n isInvalid?: boolean\n /** 컨테이너 div에 적용할 추가 className */\n containerClassName?: string\n /** 수동 리사이즈 허용 */\n resize?: boolean\n}\n\n/**\n * 여러 줄 글자 입력(떠 있는 라벨·자동 높이).\n *\n * 언제 쓰나: 설명·메모·사유처럼 한 줄을 넘는 글. `minRows`·`maxRows` 로 내용만큼 늘린다.\n * 언제 안 쓰나: 한 줄 값(→ TextField), 이름-값 여러 줄(→ ParameterTable), 코드·JSON 편집(DS 밖의 코드 편집기).\n * 대신/함께: 폼에서는 `FormControl` 안에. 글자 수(\"0 / 200자\")는 `FormDescription` 에 아이콘 없이.\n */\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n { appearance = 'standard', resize = false, minRows = 3, maxRows, style, ...props },\n forwardedRef,\n ) => {\n const { floating, containerProps, elementProps } = useTextInput(\n { ...props, appearance },\n forwardedRef,\n {\n multiline: true,\n // maxRows 미지정(무한 auto-grow) 시 자체 스크롤바 숨김: 스크롤바가 뜨면 content 폭이 줄어\n // autosize 재측정과 어긋나 스크롤바가 고착되는 피드백 루프를 막는다(스크롤바 없으면 content 가\n // height 에 정확히 맞아 잘림 없음). maxRows 지정(바운드) 시엔 기본 overflow-y:auto 로 캡 초과분 스크롤.\n elementClass: maxRows == null && 'overflow-hidden',\n },\n )\n\n return (\n <div\n data-slot='textarea'\n {...containerProps}\n style={{\n resize: resize ? 'vertical' : 'none',\n overflow: resize ? 'hidden' : undefined,\n }}\n >\n {/* Floating label (standard: notched outline, none: inline label) */}\n {floating.outline}\n\n <TextareaAutosize\n minRows={minRows}\n maxRows={maxRows}\n {...elementProps}\n style={{\n resize: 'none',\n ...style,\n }}\n />\n </div>\n )\n },\n)\nTextarea.displayName = 'Textarea'\n\nexport { Textarea }\n"],"names":["React","useTextInput","jsxs","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,WAAWA,iBAAM;AAAA,EACrB,CACE,EAAE,aAAa,YAAY,SAAS,OAAO,UAAU,GAAG,SAAS,OAAO,GAAG,MAAA,GAC3E,iBACG;AACH,UAAM,EAAE,UAAU,gBAAgB,aAAA,IAAiBC,UAAAA;AAAAA,MACjD,EAAE,GAAG,OAAO,WAAA;AAAA,MACZ;AAAA,MACA;AAAA,QACE,WAAW;AAAA;AAAA;AAAA;AAAA,QAIX,cAAc,WAAW,QAAQ;AAAA,MAAA;AAAA,IACnC;AAGF,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,aAAU;AAAA,QACT,GAAG;AAAA,QACJ,OAAO;AAAA,UACL,QAAQ,SAAS,aAAa;AAAA,UAC9B,UAAU,SAAS,WAAW;AAAA,QAAA;AAAA,QAI/B,UAAA;AAAA,UAAA,SAAS;AAAA,UAEVC,2BAAAA;AAAAA,YAAC;AAAA,YAAA;AAAA,cACC;AAAA,cACA;AAAA,cACC,GAAG;AAAA,cACJ,OAAO;AAAA,gBACL,QAAQ;AAAA,gBACR,GAAG;AAAA,cAAA;AAAA,YACL;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACA,SAAS,cAAc;;"}
@@ -2,198 +2,41 @@
2
2
  import { jsxs, jsx } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import TextareaAutosize from "react-textarea-autosize";
5
- import { cva } from "class-variance-authority";
6
- import { FloatingLabelOutline } from "./_internal/floatingLabelOutline.js";
7
- import { useControllableValue } from "../hooks/useControllableValue.js";
8
- import { useFloatingLabel } from "../hooks/useFloatingLabel.js";
9
- import { cn } from "../utils/cn.js";
10
- import { useFormControlContext } from "./form.js";
11
- const textareaContainerVariants = cva(
12
- [
13
- "flex w-full items-start bg-transparent",
14
- "rounded-small min-h-[84px] text-base-medium text-sys-text-main",
15
- "transition-colors"
16
- ].join(" "),
17
- {
18
- variants: {
19
- appearance: {
20
- standard: [
21
- "bg-sys-background border border-sys-divider-main py-[3px] px-[5px]",
22
- "hover:bg-secondary-o10"
23
- ].join(" "),
24
- none: "bg-transparent border-none py-[4px] px-[6px]"
25
- },
26
- isInvalid: {
27
- true: "",
28
- false: ""
29
- }
30
- },
31
- compoundVariants: [
5
+ import { useTextInput } from "./_internal/textInput.js";
6
+ const Textarea = React.forwardRef(
7
+ ({ appearance = "standard", resize = false, minRows = 3, maxRows, style, ...props }, forwardedRef) => {
8
+ const { floating, containerProps, elementProps } = useTextInput(
9
+ { ...props, appearance },
10
+ forwardedRef,
32
11
  {
33
- appearance: "standard",
34
- isInvalid: true,
35
- class: "border-[2px] border-danger30 py-[2px] px-[4px]"
12
+ multiline: true,
13
+ // maxRows 미지정(무한 auto-grow) 시 자체 스크롤바 숨김: 스크롤바가 뜨면 content 폭이 줄어
14
+ // autosize 재측정과 어긋나 스크롤바가 고착되는 피드백 루프를 막는다(스크롤바 없으면 content 가
15
+ // height 에 정확히 맞아 잘림 없음). maxRows 지정(바운드) 시엔 기본 overflow-y:auto 로 캡 초과분 스크롤.
16
+ elementClass: maxRows == null && "overflow-hidden"
36
17
  }
37
- ],
38
- defaultVariants: {
39
- appearance: "standard",
40
- isInvalid: false
41
- }
42
- }
43
- );
44
- const Textarea = React.forwardRef(
45
- ({
46
- appearance = "standard",
47
- label,
48
- required: requiredProp,
49
- isInvalid: isInvalidProp,
50
- containerClassName,
51
- className,
52
- disabled,
53
- readOnly,
54
- resize = false,
55
- minRows = 3,
56
- maxRows,
57
- value: valueProp,
58
- defaultValue,
59
- onChange: onChangeProp,
60
- onFocus: onFocusProp,
61
- onBlur: onBlurProp,
62
- style,
63
- ...textareaProps
64
- }, forwardedRef) => {
65
- const formControl = useFormControlContext();
66
- const isInvalid = isInvalidProp ?? formControl?.isInvalid ?? false;
67
- const textareaRef = React.useRef(null);
68
- const [isFocused, setIsFocused] = React.useState(false);
69
- const {
70
- value,
71
- setValue: trackValue,
72
- isControlled
73
- } = useControllableValue({ value: valueProp, defaultValue, empty: "" });
74
- const hasValue = String(value) !== "";
75
- const composedRef = React.useCallback(
76
- (node) => {
77
- textareaRef.current = node;
78
- if (typeof forwardedRef === "function") forwardedRef(node);
79
- else if (forwardedRef)
80
- forwardedRef.current = node;
81
- },
82
- [forwardedRef]
83
- );
84
- const {
85
- hasLabel,
86
- isFloating,
87
- isMounted,
88
- labelColorClass,
89
- borderColorClass,
90
- isThickBorder,
91
- labelId
92
- } = useFloatingLabel({
93
- label,
94
- hasValue,
95
- isFocused,
96
- isInvalid: !!isInvalid,
97
- isDisabled: !!disabled
98
- });
99
- const showNotchedOutline = hasLabel && appearance !== "none";
100
- const showNoneLabel = hasLabel && appearance === "none";
101
- const handleChange = React.useCallback(
102
- (e) => {
103
- trackValue(e.target.value);
104
- onChangeProp?.(e);
105
- },
106
- [trackValue, onChangeProp]
107
- );
108
- const handleFocus = React.useCallback(
109
- (e) => {
110
- setIsFocused(true);
111
- onFocusProp?.(e);
112
- },
113
- [onFocusProp]
114
- );
115
- const handleBlur = React.useCallback(
116
- (e) => {
117
- setIsFocused(false);
118
- onBlurProp?.(e);
119
- },
120
- [onBlurProp]
121
18
  );
122
19
  return /* @__PURE__ */ jsxs(
123
20
  "div",
124
21
  {
125
22
  "data-slot": "textarea",
126
- "aria-disabled": disabled || void 0,
127
- className: cn(
128
- textareaContainerVariants({ appearance, isInvalid }),
129
- // Focus styling (state-managed, standard appearance without notched outline only)
130
- isFocused && !isInvalid && appearance === "standard" && !showNotchedOutline && "border-[2px] border-sys-focus-ring-bold py-[2px] px-[4px]",
131
- // Floating label positioning
132
- (showNotchedOutline || showNoneLabel) && "relative",
133
- // Notched outline draws border — remove container's own border
134
- showNotchedOutline && "!border-0 !py-[4px] !px-[6px]",
135
- // Disabled / cursor
136
- disabled ? "cursor-not-allowed opacity-50" : "cursor-text",
137
- // disabled 시 hover 배경 무력화 (div container라 :disabled 불가 → JS 조건부; none은 원래 hover bg 없음)
138
- disabled && appearance !== "none" && "hover:bg-sys-background",
139
- containerClassName,
140
- // 외부 className 은 root container 에 적용 — FormControl 의 maxWidth 가
141
- // 자식 className 에 inject 되는데, wrapper div 의 폭 제어가 의도이므로
142
- // inner textarea 가 아닌 여기에 머지한다.
143
- className
144
- ),
23
+ ...containerProps,
145
24
  style: {
146
25
  resize: resize ? "vertical" : "none",
147
26
  overflow: resize ? "hidden" : void 0
148
27
  },
149
28
  children: [
150
- (showNotchedOutline || showNoneLabel) && /* @__PURE__ */ jsx(
151
- FloatingLabelOutline,
152
- {
153
- mode: showNotchedOutline ? "standard" : "none",
154
- label,
155
- required: requiredProp,
156
- isFloating,
157
- isMounted,
158
- labelColorClass,
159
- borderColorClass,
160
- isThickBorder,
161
- labelId
162
- }
163
- ),
29
+ floating.outline,
164
30
  /* @__PURE__ */ jsx(
165
31
  TextareaAutosize,
166
32
  {
167
- ref: composedRef,
168
33
  minRows,
169
34
  maxRows,
170
- disabled,
171
- readOnly,
172
- value: isControlled ? value : void 0,
173
- defaultValue: !isControlled ? defaultValue : void 0,
174
- onChange: handleChange,
175
- onFocus: handleFocus,
176
- onBlur: handleBlur,
177
- "aria-labelledby": hasLabel ? labelId : void 0,
178
- "aria-required": hasLabel && requiredProp ? true : void 0,
179
- className: cn(
180
- "flex-1 min-w-0 bg-transparent border-none outline-none",
181
- "text-base-medium text-sys-text-main",
182
- "placeholder:text-sys-text-placeholder",
183
- "disabled:cursor-not-allowed",
184
- "px-[4px] py-[2px]",
185
- // maxRows 미지정(무한 auto-grow) 시 자체 스크롤바 숨김: 스크롤바가 뜨면 content 폭이 줄어
186
- // autosize 재측정과 어긋나 스크롤바가 고착되는 피드백 루프를 막는다(스크롤바 없으면 content 가
187
- // height 에 정확히 맞아 잘림 없음). maxRows 지정(바운드) 시엔 기본 overflow-y:auto 로 캡 초과분 스크롤.
188
- maxRows == null && "overflow-hidden",
189
- // When label is down (acting as placeholder), hide textarea's placeholder
190
- hasLabel && !hasValue && !isFocused && "placeholder:text-transparent"
191
- ),
35
+ ...elementProps,
192
36
  style: {
193
37
  resize: "none",
194
38
  ...style
195
- },
196
- ...textareaProps
39
+ }
197
40
  }
198
41
  )
199
42
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"textArea.js","sources":["../../src/components/textArea.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport TextareaAutosize, { TextareaAutosizeProps } from 'react-textarea-autosize'\nimport { cva } from 'class-variance-authority'\n\nimport { FloatingLabelOutline } from './_internal/floatingLabelOutline'\nimport { useControllableValue } from '../hooks/useControllableValue'\nimport { useFloatingLabel } from '../hooks/useFloatingLabel'\nimport { cn } from '../utils/cn'\nimport { useFormControlContext } from './form'\n\nconst textareaContainerVariants = cva(\n [\n 'flex w-full items-start bg-transparent',\n 'rounded-small min-h-[84px] text-base-medium text-sys-text-main',\n 'transition-colors',\n ].join(' '),\n {\n variants: {\n appearance: {\n standard: [\n 'bg-sys-background border border-sys-divider-main py-[3px] px-[5px]',\n 'hover:bg-secondary-o10',\n ].join(' '),\n none: 'bg-transparent border-none py-[4px] px-[6px]',\n },\n isInvalid: {\n true: '',\n false: '',\n },\n },\n compoundVariants: [\n {\n appearance: 'standard',\n isInvalid: true,\n class: 'border-[2px] border-danger30 py-[2px] px-[4px]',\n },\n ],\n defaultVariants: {\n appearance: 'standard',\n isInvalid: false,\n },\n },\n)\n\nexport type TextareaProps = Omit<TextareaAutosizeProps, 'children'> & {\n /** @default 'standard' */\n appearance?: 'standard' | 'none'\n /** Floating label 텍스트 */\n label?: string\n /** 라벨 필수 표시 (*) */\n required?: boolean\n /** 에러 상태 */\n isInvalid?: boolean\n /** 컨테이너 div에 적용할 추가 className */\n containerClassName?: string\n /** 수동 리사이즈 허용 */\n resize?: boolean\n}\n\n/**\n * 여러 줄 글자 입력(떠 있는 라벨·자동 높이).\n *\n * 언제 쓰나: 설명·메모·사유처럼 한 줄을 넘는 글. `minRows`·`maxRows` 로 내용만큼 늘린다.\n * 언제 안 쓰나: 한 줄 값(→ TextField), 이름-값 여러 줄(→ ParameterTable), 코드·JSON 편집(DS 밖의 코드 편집기).\n * 대신/함께: 폼에서는 `FormControl` 안에. 글자 수(\"0 / 200자\")는 `FormDescription` 에 아이콘 없이.\n */\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n {\n appearance = 'standard',\n label,\n required: requiredProp,\n isInvalid: isInvalidProp,\n containerClassName,\n className,\n disabled,\n readOnly,\n resize = false,\n minRows = 3,\n maxRows,\n value: valueProp,\n defaultValue,\n onChange: onChangeProp,\n onFocus: onFocusProp,\n onBlur: onBlurProp,\n style,\n ...textareaProps\n },\n forwardedRef,\n ) => {\n const formControl = useFormControlContext()\n const isInvalid = isInvalidProp ?? formControl?.isInvalid ?? false\n const textareaRef = React.useRef<HTMLTextAreaElement>(null)\n const [isFocused, setIsFocused] = React.useState(false)\n\n // 비제어일 때 네이티브 입력이 값을 들고, 훅은 떠 있는 라벨용 hasValue 만 따라간다\n const {\n value,\n setValue: trackValue,\n isControlled,\n } = useControllableValue({ value: valueProp, defaultValue, empty: '' })\n const hasValue = String(value) !== ''\n\n // Compose refs (forwarded ref + internal ref)\n const composedRef = React.useCallback(\n (node: HTMLTextAreaElement | null) => {\n ;(textareaRef as React.MutableRefObject<HTMLTextAreaElement | null>).current = node\n if (typeof forwardedRef === 'function') forwardedRef(node)\n else if (forwardedRef)\n (forwardedRef as React.MutableRefObject<HTMLTextAreaElement | null>).current = node\n },\n [forwardedRef],\n )\n\n // Floating label\n const {\n hasLabel,\n isFloating,\n isMounted,\n labelColorClass,\n borderColorClass,\n isThickBorder,\n labelId,\n } = useFloatingLabel({\n label,\n hasValue,\n isFocused,\n isInvalid: !!isInvalid,\n isDisabled: !!disabled,\n appearance,\n })\n\n const showNotchedOutline = hasLabel && appearance !== 'none'\n const showNoneLabel = hasLabel && appearance === 'none'\n\n // --- Handlers ---\n\n const handleChange = React.useCallback(\n (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n trackValue(e.target.value)\n onChangeProp?.(e)\n },\n [trackValue, onChangeProp],\n )\n\n const handleFocus = React.useCallback(\n (e: React.FocusEvent<HTMLTextAreaElement>) => {\n setIsFocused(true)\n onFocusProp?.(e)\n },\n [onFocusProp],\n )\n\n const handleBlur = React.useCallback(\n (e: React.FocusEvent<HTMLTextAreaElement>) => {\n setIsFocused(false)\n onBlurProp?.(e)\n },\n [onBlurProp],\n )\n\n return (\n <div\n data-slot='textarea'\n aria-disabled={disabled || undefined}\n className={cn(\n textareaContainerVariants({ appearance, isInvalid }),\n // Focus styling (state-managed, standard appearance without notched outline only)\n isFocused &&\n !isInvalid &&\n appearance === 'standard' &&\n !showNotchedOutline &&\n 'border-[2px] border-sys-focus-ring-bold py-[2px] px-[4px]',\n // Floating label positioning\n (showNotchedOutline || showNoneLabel) && 'relative',\n // Notched outline draws border — remove container's own border\n showNotchedOutline && '!border-0 !py-[4px] !px-[6px]',\n // Disabled / cursor\n disabled ? 'cursor-not-allowed opacity-50' : 'cursor-text',\n // disabled 시 hover 배경 무력화 (div container라 :disabled 불가 → JS 조건부; none은 원래 hover bg 없음)\n disabled && appearance !== 'none' && 'hover:bg-sys-background',\n containerClassName,\n // 외부 className 은 root container 에 적용 — FormControl 의 maxWidth 가\n // 자식 className 에 inject 되는데, wrapper div 의 폭 제어가 의도이므로\n // inner textarea 가 아닌 여기에 머지한다.\n className,\n )}\n style={{\n resize: resize ? 'vertical' : 'none',\n overflow: resize ? 'hidden' : undefined,\n }}\n >\n {/* Floating label (standard: notched outline, none: inline label) */}\n {(showNotchedOutline || showNoneLabel) && (\n <FloatingLabelOutline\n mode={showNotchedOutline ? 'standard' : 'none'}\n label={label!}\n required={requiredProp}\n isFloating={isFloating}\n isMounted={isMounted}\n labelColorClass={labelColorClass}\n borderColorClass={borderColorClass}\n isThickBorder={isThickBorder}\n labelId={labelId}\n />\n )}\n\n {/* Textarea */}\n <TextareaAutosize\n ref={composedRef}\n minRows={minRows}\n maxRows={maxRows}\n disabled={disabled}\n readOnly={readOnly}\n value={isControlled ? value : undefined}\n defaultValue={!isControlled ? defaultValue : undefined}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n aria-labelledby={hasLabel ? labelId : undefined}\n aria-required={hasLabel && requiredProp ? true : undefined}\n className={cn(\n 'flex-1 min-w-0 bg-transparent border-none outline-none',\n 'text-base-medium text-sys-text-main',\n 'placeholder:text-sys-text-placeholder',\n 'disabled:cursor-not-allowed',\n 'px-[4px] py-[2px]',\n // maxRows 미지정(무한 auto-grow) 시 자체 스크롤바 숨김: 스크롤바가 뜨면 content 폭이 줄어\n // autosize 재측정과 어긋나 스크롤바가 고착되는 피드백 루프를 막는다(스크롤바 없으면 content 가\n // height 에 정확히 맞아 잘림 없음). maxRows 지정(바운드) 시엔 기본 overflow-y:auto 로 캡 초과분 스크롤.\n maxRows == null && 'overflow-hidden',\n // When label is down (acting as placeholder), hide textarea's placeholder\n hasLabel && !hasValue && !isFocused && 'placeholder:text-transparent',\n )}\n style={{\n resize: 'none',\n ...style,\n }}\n {...textareaProps}\n />\n </div>\n )\n },\n)\nTextarea.displayName = 'Textarea'\n\nexport { Textarea }\n"],"names":[],"mappings":";;;;;;;;;;AAYA,MAAM,4BAA4B;AAAA,EAChC;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,EACV;AAAA,IACE,UAAU;AAAA,MACR,YAAY;AAAA,QACV,UAAU;AAAA,UACR;AAAA,UACA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA,QACV,MAAM;AAAA,MAAA;AAAA,MAER,WAAW;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,IAEF,kBAAkB;AAAA,MAChB;AAAA,QACE,YAAY;AAAA,QACZ,WAAW;AAAA,QACX,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,IAEF,iBAAiB;AAAA,MACf,YAAY;AAAA,MACZ,WAAW;AAAA,IAAA;AAAA,EACb;AAEJ;AAwBA,MAAM,WAAW,MAAM;AAAA,EACrB,CACE;AAAA,IACE,aAAa;AAAA,IACb;AAAA,IACA,UAAU;AAAA,IACV,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,UAAU;AAAA,IACV;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA,UAAU;AAAA,IACV,SAAS;AAAA,IACT,QAAQ;AAAA,IACR;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,iBACG;AACH,UAAM,cAAc,sBAAA;AACpB,UAAM,YAAY,iBAAiB,aAAa,aAAa;AAC7D,UAAM,cAAc,MAAM,OAA4B,IAAI;AAC1D,UAAM,CAAC,WAAW,YAAY,IAAI,MAAM,SAAS,KAAK;AAGtD,UAAM;AAA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React from 'react'\nimport TextareaAutosize, { TextareaAutosizeProps } from 'react-textarea-autosize'\n\nimport { useTextInput } from './_internal/textInput'\n\nexport type TextareaProps = Omit<TextareaAutosizeProps, 'children'> & {\n /** @default 'standard' */\n appearance?: 'standard' | 'none'\n /** Floating label 텍스트 */\n label?: string\n /** 라벨 필수 표시 (*) */\n required?: boolean\n /** 에러 상태 */\n isInvalid?: boolean\n /** 컨테이너 div에 적용할 추가 className */\n containerClassName?: string\n /** 수동 리사이즈 허용 */\n resize?: boolean\n}\n\n/**\n * 여러 줄 글자 입력(떠 있는 라벨·자동 높이).\n *\n * 언제 쓰나: 설명·메모·사유처럼 한 줄을 넘는 글. `minRows`·`maxRows` 로 내용만큼 늘린다.\n * 언제 안 쓰나: 한 줄 값(→ TextField), 이름-값 여러 줄(→ ParameterTable), 코드·JSON 편집(DS 밖의 코드 편집기).\n * 대신/함께: 폼에서는 `FormControl` 안에. 글자 수(\"0 / 200자\")는 `FormDescription` 에 아이콘 없이.\n */\nconst Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n { appearance = 'standard', resize = false, minRows = 3, maxRows, style, ...props },\n forwardedRef,\n ) => {\n const { floating, containerProps, elementProps } = useTextInput(\n { ...props, appearance },\n forwardedRef,\n {\n multiline: true,\n // maxRows 미지정(무한 auto-grow) 시 자체 스크롤바 숨김: 스크롤바가 뜨면 content 폭이 줄어\n // autosize 재측정과 어긋나 스크롤바가 고착되는 피드백 루프를 막는다(스크롤바 없으면 content 가\n // height 에 정확히 맞아 잘림 없음). maxRows 지정(바운드) 시엔 기본 overflow-y:auto 로 캡 초과분 스크롤.\n elementClass: maxRows == null && 'overflow-hidden',\n },\n )\n\n return (\n <div\n data-slot='textarea'\n {...containerProps}\n style={{\n resize: resize ? 'vertical' : 'none',\n overflow: resize ? 'hidden' : undefined,\n }}\n >\n {/* Floating label (standard: notched outline, none: inline label) */}\n {floating.outline}\n\n <TextareaAutosize\n minRows={minRows}\n maxRows={maxRows}\n {...elementProps}\n style={{\n resize: 'none',\n ...style,\n }}\n />\n </div>\n )\n },\n)\nTextarea.displayName = 'Textarea'\n\nexport { Textarea }\n"],"names":[],"mappings":";;;;;AA6BA,MAAM,WAAW,MAAM;AAAA,EACrB,CACE,EAAE,aAAa,YAAY,SAAS,OAAO,UAAU,GAAG,SAAS,OAAO,GAAG,MAAA,GAC3E,iBACG;AACH,UAAM,EAAE,UAAU,gBAAgB,aAAA,IAAiB;AAAA,MACjD,EAAE,GAAG,OAAO,WAAA;AAAA,MACZ;AAAA,MACA;AAAA,QACE,WAAW;AAAA;AAAA;AAAA;AAAA,QAIX,cAAc,WAAW,QAAQ;AAAA,MAAA;AAAA,IACnC;AAGF,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,aAAU;AAAA,QACT,GAAG;AAAA,QACJ,OAAO;AAAA,UACL,QAAQ,SAAS,aAAa;AAAA,UAC9B,UAAU,SAAS,WAAW;AAAA,QAAA;AAAA,QAI/B,UAAA;AAAA,UAAA,SAAS;AAAA,UAEV;AAAA,YAAC;AAAA,YAAA;AAAA,cACC;AAAA,cACA;AAAA,cACC,GAAG;AAAA,cACJ,OAAO;AAAA,gBACL,QAAQ;AAAA,gBACR,GAAG;AAAA,cAAA;AAAA,YACL;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACA,SAAS,cAAc;"}