@bigtablet/design-system 3.15.2 → 3.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +12 -2
- package/dist/index.d.ts +7 -1
- package/dist/index.js +36 -32
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -4967,6 +4967,14 @@ body:has(.bottom_nav) {
|
|
|
4967
4967
|
.textarea_container:focus-within {
|
|
4968
4968
|
border-color: var(--bt-color-border-focus);
|
|
4969
4969
|
}
|
|
4970
|
+
.textarea_toolbar {
|
|
4971
|
+
display: flex;
|
|
4972
|
+
align-items: center;
|
|
4973
|
+
gap: 4px;
|
|
4974
|
+
flex-wrap: wrap;
|
|
4975
|
+
padding: 8px 16px;
|
|
4976
|
+
border-bottom: 1px solid var(--bt-color-border-default);
|
|
4977
|
+
}
|
|
4970
4978
|
.textarea_input_wrap {
|
|
4971
4979
|
display: flex;
|
|
4972
4980
|
width: 100%;
|
|
@@ -4992,14 +5000,16 @@ body:has(.bottom_nav) {
|
|
|
4992
5000
|
cursor: not-allowed;
|
|
4993
5001
|
color: var(--bt-color-text-disabled);
|
|
4994
5002
|
}
|
|
4995
|
-
.textarea_size_sm .textarea_input_wrap
|
|
5003
|
+
.textarea_size_sm .textarea_input_wrap,
|
|
5004
|
+
.textarea_size_sm .textarea_toolbar {
|
|
4996
5005
|
padding: 8px 16px;
|
|
4997
5006
|
}
|
|
4998
5007
|
.textarea_size_sm .textarea_input {
|
|
4999
5008
|
font-size: 14px;
|
|
5000
5009
|
line-height: 20px;
|
|
5001
5010
|
}
|
|
5002
|
-
.textarea_size_lg .textarea_input_wrap
|
|
5011
|
+
.textarea_size_lg .textarea_input_wrap,
|
|
5012
|
+
.textarea_size_lg .textarea_toolbar {
|
|
5003
5013
|
padding: 12px 20px;
|
|
5004
5014
|
}
|
|
5005
5015
|
.textarea_size_lg .textarea_input {
|
package/dist/index.d.ts
CHANGED
|
@@ -2178,6 +2178,12 @@ interface TextareaProps extends Omit<React$1.TextareaHTMLAttributes<HTMLTextArea
|
|
|
2178
2178
|
showCounter?: boolean;
|
|
2179
2179
|
/** resize 핸들 제어 (기본 "vertical") */
|
|
2180
2180
|
resize?: TextareaResize;
|
|
2181
|
+
/**
|
|
2182
|
+
* 입력 영역 위, **테두리 안쪽**에 붙는 슬롯. 서식 툴바처럼 입력과 한 박스로 보여야 하는
|
|
2183
|
+
* 컨트롤을 넣는다. 컨테이너가 품으므로 `:focus-within` 테두리가 툴바까지 감싸고, 모서리와
|
|
2184
|
+
* 구분선을 DS 가 처리한다. 미지정 시 DOM·스타일이 이전과 동일하다.
|
|
2185
|
+
*/
|
|
2186
|
+
toolbar?: React$1.ReactNode;
|
|
2181
2187
|
/** textarea 요소 참조 */
|
|
2182
2188
|
ref?: React$1.Ref<HTMLTextAreaElement>;
|
|
2183
2189
|
}
|
|
@@ -2192,7 +2198,7 @@ interface TextareaProps extends Omit<React$1.TextareaHTMLAttributes<HTMLTextArea
|
|
|
2192
2198
|
* ```
|
|
2193
2199
|
*/
|
|
2194
2200
|
declare const Textarea: {
|
|
2195
|
-
({ id, label, showLabel, supportingText, error, fullWidth, size, className, onValueChange, onChangeAction, imeStrategy, value, defaultValue, transformValue, rows, minRows, maxRows, showCounter, resize, maxLength, ref, ...props }: TextareaProps): React$1.JSX.Element;
|
|
2201
|
+
({ id, label, showLabel, supportingText, error, fullWidth, size, className, onValueChange, onChangeAction, imeStrategy, value, defaultValue, transformValue, rows, minRows, maxRows, showCounter, resize, toolbar, maxLength, ref, ...props }: TextareaProps): React$1.JSX.Element;
|
|
2196
2202
|
displayName: string;
|
|
2197
2203
|
};
|
|
2198
2204
|
|
package/dist/index.js
CHANGED
|
@@ -4307,6 +4307,7 @@ var Textarea = ({
|
|
|
4307
4307
|
maxRows,
|
|
4308
4308
|
showCounter,
|
|
4309
4309
|
resize = "vertical",
|
|
4310
|
+
toolbar,
|
|
4310
4311
|
maxLength,
|
|
4311
4312
|
ref,
|
|
4312
4313
|
...props
|
|
@@ -4367,41 +4368,44 @@ var Textarea = ({
|
|
|
4367
4368
|
};
|
|
4368
4369
|
return /* @__PURE__ */ jsxs("div", { className: rootClassName, children: [
|
|
4369
4370
|
label && showLabel && /* @__PURE__ */ jsx("label", { htmlFor: inputId, className: "textarea_label", children: label }),
|
|
4370
|
-
/* @__PURE__ */
|
|
4371
|
-
"
|
|
4372
|
-
{
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
if (
|
|
4396
|
-
|
|
4397
|
-
(
|
|
4371
|
+
/* @__PURE__ */ jsxs("div", { className: "textarea_container", children: [
|
|
4372
|
+
toolbar && /* @__PURE__ */ jsx("div", { className: "textarea_toolbar", inert: props.disabled || void 0, children: toolbar }),
|
|
4373
|
+
/* @__PURE__ */ jsx("div", { className: "textarea_input_wrap", children: /* @__PURE__ */ jsx(
|
|
4374
|
+
"textarea",
|
|
4375
|
+
{
|
|
4376
|
+
id: inputId,
|
|
4377
|
+
ref: setRefs,
|
|
4378
|
+
className: "textarea_input",
|
|
4379
|
+
style: { resize: autoGrow ? "none" : resize },
|
|
4380
|
+
rows: autoGrow ? minRows ?? rows : rows,
|
|
4381
|
+
maxLength,
|
|
4382
|
+
"aria-invalid": !!error,
|
|
4383
|
+
"aria-describedby": helperId,
|
|
4384
|
+
"aria-label": !showLabel ? label : void 0,
|
|
4385
|
+
...props,
|
|
4386
|
+
value: innerValue,
|
|
4387
|
+
onCompositionStart: () => {
|
|
4388
|
+
isComposingRef.current = true;
|
|
4389
|
+
},
|
|
4390
|
+
onCompositionEnd: (event) => {
|
|
4391
|
+
isComposingRef.current = false;
|
|
4392
|
+
emit(applyTransform(event.currentTarget.value));
|
|
4393
|
+
},
|
|
4394
|
+
onChange: (event) => {
|
|
4395
|
+
const rawValue = event.target.value;
|
|
4396
|
+
if (isComposingRef.current) {
|
|
4397
|
+
setInnerValue(rawValue);
|
|
4398
|
+
if (imeStrategy === "immediate" && rawValue !== lastEmittedValueRef.current) {
|
|
4399
|
+
lastEmittedValueRef.current = rawValue;
|
|
4400
|
+
(onValueChange ?? onChangeAction)?.(rawValue);
|
|
4401
|
+
}
|
|
4402
|
+
return;
|
|
4398
4403
|
}
|
|
4399
|
-
|
|
4404
|
+
emit(applyTransform(rawValue));
|
|
4400
4405
|
}
|
|
4401
|
-
emit(applyTransform(rawValue));
|
|
4402
4406
|
}
|
|
4403
|
-
}
|
|
4404
|
-
|
|
4407
|
+
) })
|
|
4408
|
+
] }),
|
|
4405
4409
|
(supportingText || counterText) && /* @__PURE__ */ jsxs("div", { className: "textarea_footer", children: [
|
|
4406
4410
|
supportingText ? /* @__PURE__ */ jsx("div", { id: helperId, className: "textarea_helper", children: supportingText }) : /* @__PURE__ */ jsx("span", {}),
|
|
4407
4411
|
counterText && /* @__PURE__ */ jsx("div", { className: "textarea_counter", "aria-hidden": "true", children: counterText })
|