@dotss/ui 0.0.10 → 0.0.11
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/Accordion/Accordion.cjs +13 -7
- package/Accordion/Accordion.d.ts +2 -0
- package/Accordion/Accordion.es.js +86 -65
- package/Autocomplete/Autocomplete.cjs +1 -1
- package/Autocomplete/Autocomplete.d.ts +1 -1
- package/Autocomplete/Autocomplete.es.js +235 -80
- package/BottomSheet/BottomSheet.cjs +5 -5
- package/BottomSheet/BottomSheet.d.ts +3 -0
- package/BottomSheet/BottomSheet.es.js +88 -70
- package/BottomSheet/BottomSheetText/BottomSheetText.cjs +2 -2
- package/BottomSheet/BottomSheetText/BottomSheetText.es.js +18 -6
- package/BottomSheet/BottomSheetTitle/BottomSheetTitle.cjs +6 -6
- package/BottomSheet/BottomSheetTitle/BottomSheetTitle.d.ts +2 -1
- package/BottomSheet/BottomSheetTitle/BottomSheetTitle.es.js +26 -15
- package/Button/Button.cjs +6 -6
- package/Button/Button.es.js +35 -29
- package/ChainPicker/ChainPicker.cjs +16 -6
- package/ChainPicker/ChainPicker.d.ts +4 -2
- package/ChainPicker/ChainPicker.es.js +155 -110
- package/ChainPicker/ChainPicker.stories.d.ts +1 -1
- package/Checkbox/Checkbox.cjs +3 -3
- package/Checkbox/Checkbox.es.js +12 -10
- package/CircularProgressIndicator/CircularProgressIndicator.cjs +5 -5
- package/CircularProgressIndicator/CircularProgressIndicator.es.js +26 -23
- package/DatePicker/DatePicker.cjs +37 -20
- package/DatePicker/DatePicker.d.ts +2 -1
- package/DatePicker/DatePicker.es.js +345 -320
- package/DatePicker/DatePicker.stories.d.ts +1 -0
- package/DatePicker/EventDot/EventDot.cjs +8 -0
- package/DatePicker/EventDot/EventDot.d.ts +8 -0
- package/DatePicker/EventDot/EventDot.es.js +19 -0
- package/DatePicker/EventDot/index.cjs +1 -0
- package/DatePicker/EventDot/index.d.ts +3 -0
- package/DatePicker/EventDot/index.es.js +4 -0
- package/DatePicker/EventDotGroup/EventDotGroup.cjs +8 -0
- package/DatePicker/EventDotGroup/EventDotGroup.d.ts +8 -0
- package/DatePicker/EventDotGroup/EventDotGroup.es.js +39 -0
- package/DatePicker/EventDotGroup/index.cjs +1 -0
- package/DatePicker/EventDotGroup/index.d.ts +3 -0
- package/DatePicker/EventDotGroup/index.es.js +4 -0
- package/DatePicker/index.cjs +1 -1
- package/DatePicker/index.d.ts +2 -0
- package/DatePicker/index.es.js +6 -2
- package/Dialog/Dialog.cjs +2 -2
- package/Dialog/Dialog.d.ts +2 -0
- package/Dialog/Dialog.es.js +45 -40
- package/Dialog/Dialog.stories.d.ts +10 -0
- package/Dialog/DialogText/DialogText.cjs +1 -1
- package/Dialog/DialogText/DialogText.es.js +1 -1
- package/Dialog/DialogTitle/DialogTitle.cjs +4 -4
- package/Dialog/DialogTitle/DialogTitle.d.ts +2 -1
- package/Dialog/DialogTitle/DialogTitle.es.js +17 -17
- package/FocusBoundary/FocusBoundary.cjs +1 -1
- package/FocusBoundary/FocusBoundary.d.ts +3 -1
- package/FocusBoundary/FocusBoundary.es.js +49 -42
- package/FormControlText/FormControlText.cjs +7 -5
- package/FormControlText/FormControlText.d.ts +2 -0
- package/FormControlText/FormControlText.es.js +50 -40
- package/Icon/Icon.cjs +1 -1
- package/Icon/Icon.es.js +1 -1
- package/IconButton/IconButton.cjs +8 -8
- package/IconButton/IconButton.es.js +32 -25
- package/LineProgressIndicator/LineProgressIndicator.cjs +6 -6
- package/LineProgressIndicator/LineProgressIndicator.es.js +35 -23
- package/Menu/Menu.cjs +16 -16
- package/Menu/Menu.d.ts +3 -2
- package/Menu/Menu.es.js +115 -81
- package/Menu/Menu.stories.d.ts +1 -0
- package/Menu/MenuBlock/MenuBlock.cjs +14 -7
- package/Menu/MenuBlock/MenuBlock.d.ts +1 -0
- package/Menu/MenuBlock/MenuBlock.es.js +47 -35
- package/Menu/MenuButton/MenuButton.cjs +1 -0
- package/Menu/MenuButton/MenuButton.d.ts +10 -0
- package/Menu/MenuButton/MenuButton.es.js +44 -0
- package/Menu/MenuButton/index.cjs +1 -0
- package/Menu/MenuButton/index.d.ts +3 -0
- package/Menu/MenuButton/index.es.js +4 -0
- package/Menu/index.cjs +1 -1
- package/Menu/index.d.ts +1 -0
- package/Menu/index.es.js +4 -2
- package/NumberKeypad/NumberKeypad.cjs +2 -2
- package/NumberKeypad/NumberKeypad.es.js +18 -16
- package/NumberKeypad/NumberKeypadBlock/NumberKeypadBlock.cjs +1 -1
- package/NumberKeypad/NumberKeypadBlock/NumberKeypadBlock.es.js +10 -1
- package/PageControl/PageControl.cjs +16 -5
- package/PageControl/PageControl.d.ts +3 -0
- package/PageControl/PageControl.es.js +77 -24
- package/PageControl/PageControl.stories.d.ts +1 -0
- package/Radio/Radio.cjs +3 -3
- package/Radio/Radio.es.js +22 -20
- package/RadioGroup/RadioGroup.cjs +1 -0
- package/RadioGroup/RadioGroup.d.ts +8 -0
- package/RadioGroup/RadioGroup.es.js +28 -0
- package/RadioGroup/RadioGroup.stories.d.ts +14 -0
- package/RadioGroup/index.cjs +1 -0
- package/RadioGroup/index.d.ts +3 -0
- package/RadioGroup/index.es.js +4 -0
- package/SegmentedButton/SegmentedButton.cjs +14 -3
- package/SegmentedButton/SegmentedButton.es.js +108 -34
- package/Select/Select.cjs +4 -4
- package/Select/Select.es.js +95 -86
- package/Slider/Slider.cjs +27 -12
- package/Slider/Slider.d.ts +1 -0
- package/Slider/Slider.es.js +177 -90
- package/Switch/Switch.cjs +28 -11
- package/Switch/Switch.d.ts +2 -0
- package/Switch/Switch.es.js +185 -65
- package/Switch/Switch.stories.d.ts +1 -0
- package/Tab/Tab.es.js +2 -4
- package/TextArea/TextArea.cjs +42 -34
- package/TextArea/TextArea.es.js +116 -82
- package/TextArea/TextArea.stories.d.ts +1 -1
- package/TextField/TextField.cjs +29 -13
- package/TextField/TextField.d.ts +2 -1
- package/TextField/TextField.es.js +122 -79
- package/TextField/TextField.stories.d.ts +1 -0
- package/Tooltip/Tooltip.cjs +7 -6
- package/Tooltip/Tooltip.d.ts +8 -3
- package/Tooltip/Tooltip.es.js +248 -146
- package/Tooltip/Tooltip.stories.d.ts +1 -0
- package/hooks/index.cjs +1 -1
- package/hooks/index.d.ts +3 -0
- package/hooks/index.es.js +7 -1
- package/hooks/useCheckHasFocus/useCheckHasFocus.cjs +1 -0
- package/hooks/useCheckHasFocus/useCheckHasFocus.d.ts +9 -0
- package/hooks/useCheckHasFocus/useCheckHasFocus.es.js +21 -0
- package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.cjs +1 -0
- package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.d.ts +4 -0
- package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.es.js +30 -0
- package/hooks/useFocusBoundary/useFocusBoundary.cjs +1 -0
- package/hooks/useFocusBoundary/useFocusBoundary.d.ts +12 -0
- package/hooks/useFocusBoundary/useFocusBoundary.es.js +63 -0
- package/index.cjs +1 -1
- package/index.d.ts +2 -1
- package/index.es.js +97 -90
- package/package.json +3 -3
- package/resources/tictoccroc/icons/fill/certified-fill.svg-B_RVx6K_.cjs +1 -0
- package/resources/tictoccroc/icons/fill/certified-fill.svg-CK7UqYft.js +5 -0
- package/resources/tictoccroc/icons/fill/index.d.ts +3 -0
- package/resources/tictoccroc/icons/fill/location-fill.svg-DfSHAnsd.js +5 -0
- package/resources/tictoccroc/icons/fill/location-fill.svg-Die9mxQH.cjs +1 -0
- package/resources/tictoccroc/icons/fill/send-fill.svg-CItD_2L1.js +5 -0
- package/resources/tictoccroc/icons/fill/send-fill.svg-D197Lwl0.cjs +1 -0
- package/resources/tictoccroc/icons/index.ts-BmqvB_n6.cjs +1 -0
- package/resources/tictoccroc/icons/index.ts-CzTh-XsD.js +228 -0
- package/resources/tictoccroc/icons/line/index.d.ts +4 -0
- package/resources/tictoccroc/icons/line/list-line.svg-r5d5htjN.cjs +1 -0
- package/resources/tictoccroc/icons/line/list-line.svg-yFfhZxUp.js +5 -0
- package/resources/tictoccroc/icons/line/monthly-line.svg-BdyaJ1t_.cjs +1 -0
- package/resources/tictoccroc/icons/line/monthly-line.svg-DY5-Xv34.js +5 -0
- package/resources/tictoccroc/icons/line/review-line.svg-B4rfJrsO.js +5 -0
- package/resources/tictoccroc/icons/line/review-line.svg-DYUuUybx.cjs +1 -0
- package/resources/tictoccroc/icons/line/weekly-line.svg-BCO-LS_a.cjs +1 -0
- package/resources/tictoccroc/icons/line/weekly-line.svg-BUPmmgeE.js +5 -0
- package/utils/getIconLabel/getIconLabel.cjs +1 -1
- package/utils/getIconLabel/getIconLabel.es.js +8 -1
- package/utils/getSibling/getSibling.es.js +1 -2
- package/resources/tictoccroc/icons/index.ts-CarI_z7q.js +0 -214
- package/resources/tictoccroc/icons/index.ts-IVJAK4qr.cjs +0 -1
package/TextArea/TextArea.es.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { jsxs as u, jsx as a } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef as F, useRef as v, useState as q, useId as h, useEffect as B } from "react";
|
|
3
|
+
import s from "@emotion/styled";
|
|
4
|
+
import y from "../Typography/Typography.es.js";
|
|
5
|
+
const E = s.div`
|
|
6
|
+
position: relative;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
${({ fullWidth: t }) => t ? { width: "100%" } : null};
|
|
10
|
+
`, D = s.div`
|
|
5
11
|
position: relative;
|
|
6
12
|
border-radius: 12px;
|
|
7
13
|
height: auto;
|
|
@@ -9,12 +15,12 @@ const T = l.div`
|
|
|
9
15
|
|
|
10
16
|
${({
|
|
11
17
|
theme: {
|
|
12
|
-
palette: { brand: t, background:
|
|
18
|
+
palette: { brand: t, background: e, grey: n }
|
|
13
19
|
},
|
|
14
20
|
variant: c,
|
|
15
21
|
isFocused: r
|
|
16
22
|
}) => c === "filled" ? {
|
|
17
|
-
backgroundColor:
|
|
23
|
+
backgroundColor: e.primary,
|
|
18
24
|
border: "1px solid transparent"
|
|
19
25
|
} : c === "outlined" ? r ? {
|
|
20
26
|
backgroundColor: n.white,
|
|
@@ -28,9 +34,9 @@ const T = l.div`
|
|
|
28
34
|
theme: {
|
|
29
35
|
palette: { etc: t }
|
|
30
36
|
},
|
|
31
|
-
variant:
|
|
37
|
+
variant: e,
|
|
32
38
|
helper: n
|
|
33
|
-
}) =>
|
|
39
|
+
}) => e === "outlined" && ((n == null ? void 0 : n.severity) === "error" || n != null && n.message) ? {
|
|
34
40
|
borderColor: t.red
|
|
35
41
|
} : {}}
|
|
36
42
|
|
|
@@ -38,9 +44,9 @@ const T = l.div`
|
|
|
38
44
|
theme: {
|
|
39
45
|
palette: { grey: t }
|
|
40
46
|
},
|
|
41
|
-
variant:
|
|
47
|
+
variant: e,
|
|
42
48
|
disabled: n
|
|
43
|
-
}) =>
|
|
49
|
+
}) => e === "outlined" && n ? {
|
|
44
50
|
backgroundColor: t[10],
|
|
45
51
|
borderColor: t[30]
|
|
46
52
|
} : {}}
|
|
@@ -48,7 +54,7 @@ const T = l.div`
|
|
|
48
54
|
${({ fullWidth: t }) => t ? {
|
|
49
55
|
width: "100%"
|
|
50
56
|
} : {}}
|
|
51
|
-
`,
|
|
57
|
+
`, G = s.textarea`
|
|
52
58
|
width: 100%;
|
|
53
59
|
overflow: hidden;
|
|
54
60
|
resize: none;
|
|
@@ -82,7 +88,10 @@ const T = l.div`
|
|
|
82
88
|
})};
|
|
83
89
|
}
|
|
84
90
|
|
|
85
|
-
&::placeholder
|
|
91
|
+
&::placeholder,
|
|
92
|
+
&::-webkit-input-placeholder,
|
|
93
|
+
&::-ms-input-placeholder,
|
|
94
|
+
&::-moz-placeholder {
|
|
86
95
|
color: ${({ theme: t }) => t.palette.grey[50]};
|
|
87
96
|
text-align: justify;
|
|
88
97
|
}
|
|
@@ -95,8 +104,8 @@ const T = l.div`
|
|
|
95
104
|
&[disabled]::placeholder {
|
|
96
105
|
color: ${({ theme: t }) => t.palette.grey[30]};
|
|
97
106
|
}
|
|
98
|
-
`,
|
|
99
|
-
color: ${({ theme: t, disabled:
|
|
107
|
+
`, J = s.div`
|
|
108
|
+
color: ${({ theme: t, disabled: e }) => e ? t.palette.grey[30] : t.palette.grey[50]};
|
|
100
109
|
text-align: right;
|
|
101
110
|
padding-right: ${({ theme: t }) => t.spacing.content(4)}px;
|
|
102
111
|
padding-bottom: ${({ theme: t }) => t.spacing.content(3)}px;
|
|
@@ -113,10 +122,19 @@ const T = l.div`
|
|
|
113
122
|
})};
|
|
114
123
|
|
|
115
124
|
& > span {
|
|
116
|
-
color: ${({ theme: t, disabled:
|
|
125
|
+
color: ${({ theme: t, disabled: e }) => e ? t.palette.grey[30] : t.palette.grey[100]};
|
|
126
|
+
}
|
|
127
|
+
`, K = s.p`
|
|
128
|
+
position: absolute;
|
|
129
|
+
left: 0;
|
|
130
|
+
bottom: calc(
|
|
131
|
+
${({ theme: { spacing: t } }) => -t.content(1)}px -
|
|
132
|
+
${({
|
|
133
|
+
theme: {
|
|
134
|
+
typography: { c3R: t }
|
|
117
135
|
}
|
|
118
|
-
|
|
119
|
-
|
|
136
|
+
}) => t.lineHeight}
|
|
137
|
+
);
|
|
120
138
|
color: ${({ theme: t }) => t.palette.etc.red};
|
|
121
139
|
|
|
122
140
|
${({
|
|
@@ -129,94 +147,110 @@ const T = l.div`
|
|
|
129
147
|
lineHeight: t.lineHeight,
|
|
130
148
|
letterSpacing: t.letterSpacing
|
|
131
149
|
})};
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
padding: 0;
|
|
138
|
-
overflow: hidden;
|
|
139
|
-
clip: rect(0, 0, 0, 0);
|
|
140
|
-
border: 0;
|
|
141
|
-
`, J = A(
|
|
150
|
+
|
|
151
|
+
&:empty {
|
|
152
|
+
display: none;
|
|
153
|
+
}
|
|
154
|
+
`, V = F(
|
|
142
155
|
({
|
|
143
156
|
onChange: t,
|
|
144
|
-
value:
|
|
157
|
+
value: e,
|
|
145
158
|
variant: n = "filled",
|
|
146
159
|
size: c = "large",
|
|
147
160
|
maxLength: r = 290,
|
|
148
|
-
onFocus:
|
|
149
|
-
onBlur:
|
|
161
|
+
onFocus: $,
|
|
162
|
+
onBlur: x,
|
|
150
163
|
helper: o,
|
|
151
|
-
disabled:
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
disabled: d = !1,
|
|
165
|
+
fullWidth: w,
|
|
166
|
+
wrapperProps: g,
|
|
167
|
+
...z
|
|
168
|
+
}, C) => {
|
|
169
|
+
const f = v(null), p = v(c === "large" ? 112.5 : 57.5), [b, m] = q(!1), S = h(), k = h(), H = h(), W = (i) => {
|
|
170
|
+
i.target.value.length > r && (i.target.value = i.target.value.slice(0, r)), typeof t == "function" && t(i);
|
|
171
|
+
}, A = (i) => {
|
|
172
|
+
m(!0), typeof $ == "function" && $(i);
|
|
173
|
+
}, I = (i) => {
|
|
174
|
+
m(!1), typeof x == "function" && x(i);
|
|
175
|
+
}, M = () => {
|
|
176
|
+
var l;
|
|
177
|
+
const i = (l = f.current) == null ? void 0 : l.querySelector("textarea");
|
|
178
|
+
i && i.focus();
|
|
165
179
|
};
|
|
166
|
-
return
|
|
167
|
-
var
|
|
168
|
-
const
|
|
169
|
-
if (
|
|
170
|
-
|
|
171
|
-
const { scrollHeight:
|
|
172
|
-
|
|
180
|
+
return B(() => {
|
|
181
|
+
var l;
|
|
182
|
+
const i = (l = f.current) == null ? void 0 : l.querySelector("textarea");
|
|
183
|
+
if (i) {
|
|
184
|
+
i.style.height = "auto";
|
|
185
|
+
const { scrollHeight: T, clientHeight: j } = i;
|
|
186
|
+
i.style.height = `${p.current}px`, i.style.height = `${Math.max(T, p.current, j)}px`;
|
|
173
187
|
}
|
|
174
|
-
}, [
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
|
|
188
|
+
}, [e]), /* @__PURE__ */ u(E, { fullWidth: w, children: [
|
|
189
|
+
/* @__PURE__ */ u(
|
|
190
|
+
D,
|
|
177
191
|
{
|
|
178
192
|
ref: f,
|
|
179
|
-
isFocused:
|
|
193
|
+
isFocused: b,
|
|
180
194
|
variant: n,
|
|
181
195
|
helper: o,
|
|
182
|
-
disabled:
|
|
183
|
-
...
|
|
184
|
-
css:
|
|
196
|
+
disabled: d,
|
|
197
|
+
...g,
|
|
198
|
+
css: g == null ? void 0 : g.inlineCSS,
|
|
185
199
|
children: [
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
|
|
200
|
+
/* @__PURE__ */ a(
|
|
201
|
+
G,
|
|
188
202
|
{
|
|
189
|
-
ref:
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
203
|
+
ref: C,
|
|
204
|
+
id: k,
|
|
205
|
+
onChange: W,
|
|
206
|
+
onFocus: A,
|
|
207
|
+
onBlur: I,
|
|
208
|
+
value: e,
|
|
209
|
+
disabled: d,
|
|
195
210
|
"aria-invalid": (o == null ? void 0 : o.severity) === "error",
|
|
196
|
-
"aria-describedby": o != null && o.message ?
|
|
197
|
-
minHeight:
|
|
198
|
-
...
|
|
211
|
+
"aria-describedby": o != null && o.message ? S : H,
|
|
212
|
+
minHeight: p.current,
|
|
213
|
+
...z
|
|
199
214
|
}
|
|
200
215
|
),
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
216
|
+
/* @__PURE__ */ u(
|
|
217
|
+
J,
|
|
218
|
+
{
|
|
219
|
+
disabled: d,
|
|
220
|
+
onClick: M,
|
|
221
|
+
"aria-label": `현재 ${e.length}자 입력됨, 최대 ${r}자까지 입력 가능`,
|
|
222
|
+
children: [
|
|
223
|
+
"(",
|
|
224
|
+
/* @__PURE__ */ a("span", { children: e.length }),
|
|
225
|
+
" / ",
|
|
226
|
+
r,
|
|
227
|
+
")"
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
)
|
|
208
231
|
]
|
|
209
232
|
}
|
|
210
233
|
),
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
234
|
+
/* @__PURE__ */ a(
|
|
235
|
+
K,
|
|
236
|
+
{
|
|
237
|
+
id: S,
|
|
238
|
+
helper: o,
|
|
239
|
+
"aria-live": "assertive",
|
|
240
|
+
role: "alert",
|
|
241
|
+
children: !d && (o == null ? void 0 : o.message)
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
/* @__PURE__ */ u(y, { visuallyHidden: !0, id: H, children: [
|
|
245
|
+
"최대 ",
|
|
214
246
|
r,
|
|
215
|
-
"
|
|
216
|
-
] })
|
|
247
|
+
"까지 입력 가능"
|
|
248
|
+
] }),
|
|
249
|
+
/* @__PURE__ */ a(y, { visuallyHidden: !0, "aria-live": "assertive", role: "alert", children: e.length >= r && `최대 입력 글자 수에 도달하였습니다. ${r} 자까지 입력이 가능합니다.` }),
|
|
250
|
+
/* @__PURE__ */ a(y, { visuallyHidden: !0, role: "status", children: e.length >= r * 0.8 && e.length < r && `최대 입력 가능한 글자 수의 80퍼센트에 도달했습니다. ${r * 0.8}자 입력됨.` })
|
|
217
251
|
] });
|
|
218
252
|
}
|
|
219
253
|
);
|
|
220
254
|
export {
|
|
221
|
-
|
|
255
|
+
V as default
|
|
222
256
|
};
|
|
@@ -21,5 +21,5 @@ export declare const Outlined: Story;
|
|
|
21
21
|
export declare const Filled: Story;
|
|
22
22
|
export declare const FullWidth: Story;
|
|
23
23
|
export declare const Small: Story;
|
|
24
|
-
export declare const Success: Story;
|
|
25
24
|
export declare const Error: Story;
|
|
25
|
+
export declare const WithScreenReaderSupport: Story;
|
package/TextField/TextField.cjs
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("@emotion/react/jsx-runtime"),u=require("react"),b=require("../Icon/Icon.cjs"),O=require("@emotion/styled"),_=t=>t&&t.__esModule?t:{default:t},f=_(O),T=f.default.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
${({fullWidth:t})=>t?{width:"100%"}:null};
|
|
6
|
-
`,
|
|
6
|
+
`,V=f.default.div`
|
|
7
7
|
display: flex;
|
|
8
8
|
align-items: center;
|
|
9
9
|
justify-content: center;
|
|
10
10
|
gap: ${({theme:{spacing:t}})=>t.content(2)}px;
|
|
11
11
|
border: 1px solid transparent;
|
|
12
12
|
|
|
13
|
-
${({theme:{palette:{green:t,grey:e,background:
|
|
13
|
+
${({theme:{palette:{green:t,grey:e,background:o,etc:n}},variant:g,helper:s})=>{let r={backgroundColor:e.white,borderColor:e[50],color:e[100]};switch(g){case"outlined":(s==null?void 0:s.severity)==="success"&&(r={...r,borderColor:`${t[70]} !important`}),(s==null?void 0:s.severity)==="error"&&(r={...r,borderColor:`${n.red} !important`});break;case"filled":r={backgroundColor:o.primary};break}return r}};
|
|
14
14
|
|
|
15
|
-
${({theme:{spacing:t},size:e})=>{let
|
|
15
|
+
${({theme:{spacing:t},size:e})=>{let o={maxHeight:48,padding:`${t.content(3)}px ${t.content(4)}px`,borderRadius:10};switch(e){case"2xLarge":o={maxHeight:80,padding:`${t.content(4)}px ${t.content(5)}px`,borderRadius:12,"& svg":{width:48,height:48}};break;case"xLarge":o={maxHeight:56,padding:t.content(4),borderRadius:12};break}return o}};
|
|
16
16
|
|
|
17
|
-
${({theme:{palette:{brand:t}},variant:e,focus:
|
|
17
|
+
${({theme:{palette:{brand:t}},variant:e,focus:o})=>e==="outlined"&&o?{borderColor:t.primary.line}:null};
|
|
18
18
|
|
|
19
19
|
${({fullWidth:t})=>t?{width:"100%"}:null};
|
|
20
20
|
|
|
21
|
-
${({theme:{palette:{grey:t}},variant:e,disabled:
|
|
22
|
-
`,
|
|
21
|
+
${({theme:{palette:{grey:t}},variant:e,disabled:o})=>{if(!o)return null;let n={backgroundColor:t[10],borderColor:t[30]};switch(e){case"filled":n={backgroundColor:t[10]};break}return n}}
|
|
22
|
+
`,M=f.default.input`
|
|
23
23
|
width: inherit;
|
|
24
24
|
flex-grow: 1;
|
|
25
25
|
border: none;
|
|
26
26
|
background-color: transparent;
|
|
27
27
|
outline: 0;
|
|
28
28
|
|
|
29
|
-
${({theme:{typography:{b2R:t,h0R:e}},inputSize:
|
|
29
|
+
${({theme:{typography:{b2R:t,h0R:e}},inputSize:o})=>o==="2xLarge"?{fontSize:e.size,fontWeight:e.weight,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing}:{fontSize:t.size,fontWeight:t.weight,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing}};
|
|
30
30
|
|
|
31
|
-
&::placeholder {
|
|
31
|
+
&::placeholder, &::-webkit-input-placeholder, &::-ms-input-placeholder, &::-moz-placeholder {
|
|
32
32
|
${({theme:{palette:{grey:t}},variant:e})=>({color:t[50]})};
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -36,12 +36,28 @@
|
|
|
36
36
|
cursor: not-allowed;
|
|
37
37
|
|
|
38
38
|
${({theme:{palette:{grey:t}}})=>({color:t[30],"&::placeholder":{color:t[30]}})}
|
|
39
|
-
|
|
39
|
+
|
|
40
|
+
&:focus {
|
|
41
|
+
outline: 'none';
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&[type='password']::-ms-reveal {
|
|
45
|
+
display: none;
|
|
46
|
+
}
|
|
47
|
+
`,q=f.default.button`
|
|
48
|
+
&:empty {
|
|
49
|
+
display: none;
|
|
50
|
+
}
|
|
51
|
+
`,E=f.default.div`
|
|
40
52
|
position: absolute;
|
|
41
53
|
left: 0;
|
|
42
54
|
bottom: ${({inputSize:t})=>t==="2xLarge"?"-26px":"-16px"};
|
|
43
55
|
white-space: nowrap;
|
|
44
|
-
${({theme:{typography:{c3R:t,b1R:e}},inputSize:
|
|
56
|
+
${({theme:{typography:{c3R:t,b1R:e}},inputSize:o})=>o==="2xLarge"?{fontSize:e.size,fontWeight:e.weight,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing}:{fontSize:t.size,fontWeight:t.weight,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing}};
|
|
45
57
|
|
|
46
|
-
${({theme:{palette:{etc:t,grey:e}},helper:
|
|
47
|
-
|
|
58
|
+
${({theme:{palette:{etc:t,grey:e}},helper:o})=>{const n={color:e[100]};return(o==null?void 0:o.severity)==="error"?{color:t.red}:n}}
|
|
59
|
+
|
|
60
|
+
&:empty {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
`,W=u.forwardRef(function({type:e="text",variant:o="outlined",size:n="large",startAdornment:g,endAdornment:s,fullWidth:r,helper:i,disabled:x,inlineCSS:w,onFocus:y,onBlur:m,disablePasswordVisibility:S,helperProps:$,...j},k){const C=u.useId(),p=u.useId(),[H,v]=u.useState(!1),[d,I]=u.useState(!1),a=!S&&!s&&e==="password"&&(i==null?void 0:i.severity)!=="success",L=l=>{v(!0),typeof y=="function"&&y(l)},z=l=>{v(!1),typeof m=="function"&&m(l)},F=()=>I(l=>!l),h=()=>a&&d?"text":a&&!d?"password":e;return c.jsxs(T,{fullWidth:r,children:[c.jsxs(V,{variant:o,size:n,focus:H,fullWidth:r,helper:i,disabled:x,css:w,children:[g,c.jsx(M,{ref:k,id:C,type:h(),variant:o,inputSize:n,disabled:x,"aria-invalid":(i==null?void 0:i.severity)==="error","aria-describedby":i!=null&&i.message?p:void 0,...j,onFocus:L,onBlur:z}),s,!s&&(i==null?void 0:i.severity)==="success"&&c.jsx(b.default,{name:"CheckLine",color:"green.70","aria-label":"성공",role:"img"}),c.jsxs(q,{type:"button",tabIndex:a?0:-1,"aria-pressed":a?d:void 0,onClick:F,"aria-hidden":!a,"aria-label":a&&d?"비밀번호 표시됨":"비밀번호 숨김됨",children:[a&&d&&c.jsx(b.default,{name:"EyeVisibleLine","data-testid":"EyeVisibleLine",inlineCSS:{cursor:"pointer"}}),a&&!d&&c.jsx(b.default,{name:"EyeInvisibleLine","data-testid":"EyeInvisibleLine",inlineCSS:{cursor:"pointer"}})]})]}),c.jsx(E,{id:p,className:"textfield-helper","aria-live":(i==null?void 0:i.severity)==="error"?"assertive":"off",role:(i==null?void 0:i.severity)==="error"?"alert":"status",helper:i,inputSize:n,"data-testid":"helper",...$,children:i==null?void 0:i.message})]})});exports.default=W;
|
package/TextField/TextField.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
1
|
+
import { HTMLAttributes, InputHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { GeneralComponentProps, Size, Variant } from '../typings/component';
|
|
3
3
|
|
|
4
4
|
export interface TextFieldProps extends GeneralComponentProps<Omit<InputHTMLAttributes<HTMLInputElement>, 'size'>> {
|
|
@@ -12,6 +12,7 @@ export interface TextFieldProps extends GeneralComponentProps<Omit<InputHTMLAttr
|
|
|
12
12
|
};
|
|
13
13
|
fullWidth?: boolean;
|
|
14
14
|
disablePasswordVisibility?: boolean;
|
|
15
|
+
helperProps?: HTMLAttributes<HTMLDivElement>;
|
|
15
16
|
}
|
|
16
17
|
declare const TextField: import('react').ForwardRefExoticComponent<TextFieldProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
17
18
|
export default TextField;
|