@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
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as g, jsx as l } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef as T, useId as v, useState as S } from "react";
|
|
3
|
+
import b from "../Icon/Icon.es.js";
|
|
4
4
|
import u from "@emotion/styled";
|
|
5
|
-
const
|
|
5
|
+
const V = u.div`
|
|
6
6
|
position: relative;
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
${({ fullWidth: t }) => t ? { width: "100%" } : null};
|
|
10
|
-
`,
|
|
10
|
+
`, E = u.div`
|
|
11
11
|
display: flex;
|
|
12
12
|
align-items: center;
|
|
13
13
|
justify-content: center;
|
|
@@ -16,9 +16,9 @@ const F = u.div`
|
|
|
16
16
|
|
|
17
17
|
${({
|
|
18
18
|
theme: {
|
|
19
|
-
palette: { green: t, grey: e, background:
|
|
19
|
+
palette: { green: t, grey: e, background: o, etc: n }
|
|
20
20
|
},
|
|
21
|
-
variant:
|
|
21
|
+
variant: f,
|
|
22
22
|
helper: r
|
|
23
23
|
}) => {
|
|
24
24
|
let s = {
|
|
@@ -26,7 +26,7 @@ const F = u.div`
|
|
|
26
26
|
borderColor: e[50],
|
|
27
27
|
color: e[100]
|
|
28
28
|
};
|
|
29
|
-
switch (
|
|
29
|
+
switch (f) {
|
|
30
30
|
case "outlined":
|
|
31
31
|
(r == null ? void 0 : r.severity) === "success" && (s = {
|
|
32
32
|
...s,
|
|
@@ -38,7 +38,7 @@ const F = u.div`
|
|
|
38
38
|
break;
|
|
39
39
|
case "filled":
|
|
40
40
|
s = {
|
|
41
|
-
backgroundColor:
|
|
41
|
+
backgroundColor: o.primary
|
|
42
42
|
};
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
@@ -46,14 +46,14 @@ const F = u.div`
|
|
|
46
46
|
}};
|
|
47
47
|
|
|
48
48
|
${({ theme: { spacing: t }, size: e }) => {
|
|
49
|
-
let
|
|
49
|
+
let o = {
|
|
50
50
|
maxHeight: 48,
|
|
51
51
|
padding: `${t.content(3)}px ${t.content(4)}px`,
|
|
52
52
|
borderRadius: 10
|
|
53
53
|
};
|
|
54
54
|
switch (e) {
|
|
55
55
|
case "2xLarge":
|
|
56
|
-
|
|
56
|
+
o = {
|
|
57
57
|
maxHeight: 80,
|
|
58
58
|
padding: `${t.content(4)}px ${t.content(5)}px`,
|
|
59
59
|
borderRadius: 12,
|
|
@@ -64,14 +64,14 @@ const F = u.div`
|
|
|
64
64
|
};
|
|
65
65
|
break;
|
|
66
66
|
case "xLarge":
|
|
67
|
-
|
|
67
|
+
o = {
|
|
68
68
|
maxHeight: 56,
|
|
69
69
|
padding: t.content(4),
|
|
70
70
|
borderRadius: 12
|
|
71
71
|
};
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
|
-
return
|
|
74
|
+
return o;
|
|
75
75
|
}};
|
|
76
76
|
|
|
77
77
|
${({
|
|
@@ -79,8 +79,8 @@ const F = u.div`
|
|
|
79
79
|
palette: { brand: t }
|
|
80
80
|
},
|
|
81
81
|
variant: e,
|
|
82
|
-
focus:
|
|
83
|
-
}) => e === "outlined" &&
|
|
82
|
+
focus: o
|
|
83
|
+
}) => e === "outlined" && o ? {
|
|
84
84
|
borderColor: t.primary.line
|
|
85
85
|
} : null};
|
|
86
86
|
|
|
@@ -91,10 +91,9 @@ const F = u.div`
|
|
|
91
91
|
palette: { grey: t }
|
|
92
92
|
},
|
|
93
93
|
variant: e,
|
|
94
|
-
disabled:
|
|
94
|
+
disabled: o
|
|
95
95
|
}) => {
|
|
96
|
-
if (!
|
|
97
|
-
return null;
|
|
96
|
+
if (!o) return null;
|
|
98
97
|
let n = {
|
|
99
98
|
backgroundColor: t[10],
|
|
100
99
|
borderColor: t[30]
|
|
@@ -108,7 +107,7 @@ const F = u.div`
|
|
|
108
107
|
}
|
|
109
108
|
return n;
|
|
110
109
|
}}
|
|
111
|
-
`,
|
|
110
|
+
`, W = u.input`
|
|
112
111
|
width: inherit;
|
|
113
112
|
flex-grow: 1;
|
|
114
113
|
border: none;
|
|
@@ -119,8 +118,8 @@ const F = u.div`
|
|
|
119
118
|
theme: {
|
|
120
119
|
typography: { b2R: t, h0R: e }
|
|
121
120
|
},
|
|
122
|
-
inputSize:
|
|
123
|
-
}) =>
|
|
121
|
+
inputSize: o
|
|
122
|
+
}) => o === "2xLarge" ? {
|
|
124
123
|
fontSize: e.size,
|
|
125
124
|
fontWeight: e.weight,
|
|
126
125
|
lineHeight: e.lineHeight,
|
|
@@ -132,7 +131,7 @@ const F = u.div`
|
|
|
132
131
|
letterSpacing: t.letterSpacing
|
|
133
132
|
}};
|
|
134
133
|
|
|
135
|
-
&::placeholder {
|
|
134
|
+
&::placeholder, &::-webkit-input-placeholder, &::-ms-input-placeholder, &::-moz-placeholder {
|
|
136
135
|
${({
|
|
137
136
|
theme: {
|
|
138
137
|
palette: { grey: t }
|
|
@@ -156,7 +155,19 @@ const F = u.div`
|
|
|
156
155
|
color: t[30]
|
|
157
156
|
}
|
|
158
157
|
})}
|
|
159
|
-
|
|
158
|
+
|
|
159
|
+
&:focus {
|
|
160
|
+
outline: 'none';
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&[type='password']::-ms-reveal {
|
|
164
|
+
display: none;
|
|
165
|
+
}
|
|
166
|
+
`, B = u.button`
|
|
167
|
+
&:empty {
|
|
168
|
+
display: none;
|
|
169
|
+
}
|
|
170
|
+
`, M = u.div`
|
|
160
171
|
position: absolute;
|
|
161
172
|
left: 0;
|
|
162
173
|
bottom: ${({ inputSize: t }) => t === "2xLarge" ? "-26px" : "-16px"};
|
|
@@ -165,8 +176,8 @@ const F = u.div`
|
|
|
165
176
|
theme: {
|
|
166
177
|
typography: { c3R: t, b1R: e }
|
|
167
178
|
},
|
|
168
|
-
inputSize:
|
|
169
|
-
}) =>
|
|
179
|
+
inputSize: o
|
|
180
|
+
}) => o === "2xLarge" ? {
|
|
170
181
|
fontSize: e.size,
|
|
171
182
|
fontWeight: e.weight,
|
|
172
183
|
lineHeight: e.lineHeight,
|
|
@@ -182,91 +193,123 @@ const F = u.div`
|
|
|
182
193
|
theme: {
|
|
183
194
|
palette: { etc: t, grey: e }
|
|
184
195
|
},
|
|
185
|
-
helper:
|
|
196
|
+
helper: o
|
|
186
197
|
}) => {
|
|
187
198
|
const n = {
|
|
188
199
|
color: e[100]
|
|
189
200
|
};
|
|
190
|
-
return (
|
|
201
|
+
return (o == null ? void 0 : o.severity) === "error" ? {
|
|
191
202
|
color: t.red
|
|
192
203
|
} : n;
|
|
193
204
|
}}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
205
|
+
|
|
206
|
+
&:empty {
|
|
207
|
+
display: none;
|
|
208
|
+
}
|
|
209
|
+
`, J = T(function({
|
|
210
|
+
type: e = "text",
|
|
211
|
+
variant: o = "outlined",
|
|
197
212
|
size: n = "large",
|
|
198
|
-
startAdornment:
|
|
213
|
+
startAdornment: f,
|
|
199
214
|
endAdornment: r,
|
|
200
215
|
fullWidth: s,
|
|
201
|
-
helper:
|
|
216
|
+
helper: i,
|
|
202
217
|
disabled: m,
|
|
203
218
|
inlineCSS: $,
|
|
204
|
-
onFocus:
|
|
205
|
-
onBlur:
|
|
206
|
-
disablePasswordVisibility:
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
219
|
+
onFocus: x,
|
|
220
|
+
onBlur: y,
|
|
221
|
+
disablePasswordVisibility: k,
|
|
222
|
+
helperProps: C,
|
|
223
|
+
...H
|
|
224
|
+
}, L) {
|
|
225
|
+
const j = v(), p = v(), [z, w] = S(!1), [c, I] = S(!1), a = !k && !r && e === "password" && (i == null ? void 0 : i.severity) !== "success", F = (d) => {
|
|
226
|
+
w(!0), typeof x == "function" && x(d);
|
|
227
|
+
}, h = (d) => {
|
|
228
|
+
w(!1), typeof y == "function" && y(d);
|
|
229
|
+
}, O = () => I((d) => !d);
|
|
230
|
+
return /* @__PURE__ */ g(V, { fullWidth: s, children: [
|
|
231
|
+
/* @__PURE__ */ g(
|
|
232
|
+
E,
|
|
217
233
|
{
|
|
218
|
-
variant:
|
|
234
|
+
variant: o,
|
|
219
235
|
size: n,
|
|
220
|
-
focus:
|
|
236
|
+
focus: z,
|
|
221
237
|
fullWidth: s,
|
|
222
|
-
helper:
|
|
238
|
+
helper: i,
|
|
223
239
|
disabled: m,
|
|
224
240
|
css: $,
|
|
225
241
|
children: [
|
|
226
|
-
|
|
227
|
-
/* @__PURE__ */
|
|
228
|
-
|
|
242
|
+
f,
|
|
243
|
+
/* @__PURE__ */ l(
|
|
244
|
+
W,
|
|
229
245
|
{
|
|
230
|
-
ref:
|
|
231
|
-
|
|
232
|
-
|
|
246
|
+
ref: L,
|
|
247
|
+
id: j,
|
|
248
|
+
type: a && c ? "text" : a && !c ? "password" : e,
|
|
249
|
+
variant: o,
|
|
233
250
|
inputSize: n,
|
|
234
251
|
disabled: m,
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
252
|
+
"aria-invalid": (i == null ? void 0 : i.severity) === "error",
|
|
253
|
+
"aria-describedby": i != null && i.message ? p : void 0,
|
|
254
|
+
...H,
|
|
255
|
+
onFocus: F,
|
|
256
|
+
onBlur: h
|
|
238
257
|
}
|
|
239
258
|
),
|
|
240
259
|
r,
|
|
241
|
-
!r && (
|
|
242
|
-
|
|
243
|
-
|
|
260
|
+
!r && (i == null ? void 0 : i.severity) === "success" && /* @__PURE__ */ l(b, { name: "CheckLine", color: "green.70", "aria-label": "성공", role: "img" }),
|
|
261
|
+
/* @__PURE__ */ g(
|
|
262
|
+
B,
|
|
244
263
|
{
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
264
|
+
type: "button",
|
|
265
|
+
tabIndex: a ? 0 : -1,
|
|
266
|
+
"aria-pressed": a ? c : void 0,
|
|
267
|
+
onClick: O,
|
|
268
|
+
"aria-hidden": !a,
|
|
269
|
+
"aria-label": a && c ? "비밀번호 표시됨" : "비밀번호 숨김됨",
|
|
270
|
+
children: [
|
|
271
|
+
a && c && /* @__PURE__ */ l(
|
|
272
|
+
b,
|
|
273
|
+
{
|
|
274
|
+
name: "EyeVisibleLine",
|
|
275
|
+
"data-testid": "EyeVisibleLine",
|
|
276
|
+
inlineCSS: {
|
|
277
|
+
cursor: "pointer"
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
),
|
|
281
|
+
a && !c && /* @__PURE__ */ l(
|
|
282
|
+
b,
|
|
283
|
+
{
|
|
284
|
+
name: "EyeInvisibleLine",
|
|
285
|
+
"data-testid": "EyeInvisibleLine",
|
|
286
|
+
inlineCSS: {
|
|
287
|
+
cursor: "pointer"
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
)
|
|
291
|
+
]
|
|
262
292
|
}
|
|
263
293
|
)
|
|
264
294
|
]
|
|
265
295
|
}
|
|
266
296
|
),
|
|
267
|
-
|
|
297
|
+
/* @__PURE__ */ l(
|
|
298
|
+
M,
|
|
299
|
+
{
|
|
300
|
+
id: p,
|
|
301
|
+
className: "textfield-helper",
|
|
302
|
+
"aria-live": (i == null ? void 0 : i.severity) === "error" ? "assertive" : "off",
|
|
303
|
+
role: (i == null ? void 0 : i.severity) === "error" ? "alert" : "status",
|
|
304
|
+
helper: i,
|
|
305
|
+
inputSize: n,
|
|
306
|
+
"data-testid": "helper",
|
|
307
|
+
...C,
|
|
308
|
+
children: i == null ? void 0 : i.message
|
|
309
|
+
}
|
|
310
|
+
)
|
|
268
311
|
] });
|
|
269
312
|
});
|
|
270
313
|
export {
|
|
271
|
-
|
|
314
|
+
J as default
|
|
272
315
|
};
|
package/Tooltip/Tooltip.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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 x=require("@emotion/react/jsx-runtime"),s=require("react"),$=require("../Flexbox/Flexbox.cjs"),I=require("../Icon/Icon.cjs"),z=require("../Typography/Typography.cjs"),M=require("../hooks/useCheckKeyboardMode/useCheckKeyboardMode.cjs"),X=require("@emotion/styled"),N=t=>t&&t.__esModule?t:{default:t},q=N(X),F=q.default.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
display: inline-block;
|
|
4
4
|
&[open] > .tooltip {
|
|
5
5
|
display: flex;
|
|
6
6
|
}
|
|
7
|
-
`,
|
|
7
|
+
`,H=q.default.div`
|
|
8
8
|
position: absolute;
|
|
9
9
|
display: none;
|
|
10
10
|
flex-direction: column;
|
|
@@ -17,10 +17,11 @@
|
|
|
17
17
|
max-height: calc(136px - 8px);
|
|
18
18
|
z-index: 100003;
|
|
19
19
|
white-space: nowrap;
|
|
20
|
+
word-break: break-all;
|
|
20
21
|
|
|
21
|
-
${({theme:{palette:{brand:t,grey:r}},color:
|
|
22
|
+
${({theme:{palette:{brand:t,grey:r}},color:f})=>{let e={};return f==="primary"&&(e={backgroundColor:t.primary.tooltip,color:r[100]}),f==="secondary"&&(e={backgroundColor:r[80],color:r.white}),e}}
|
|
22
23
|
|
|
23
|
-
${({theme:{typography:t}})=>({fontSize:t.b4R.size,fontWeight:t.b4R.weight,lineHeight:t.b4R.lineHeight,letterSpacing:t.b4R.letterSpacing,"& svg:not(.
|
|
24
|
+
${({theme:{typography:t}})=>({fontSize:t.b4R.size,fontWeight:t.b4R.weight,lineHeight:t.b4R.lineHeight,letterSpacing:t.b4R.letterSpacing,"& svg:not(.tooltip-closer)":{width:24,height:24}})};
|
|
24
25
|
|
|
25
|
-
${({theme:{palette:{brand:t,grey:r}},placement:
|
|
26
|
-
`,
|
|
26
|
+
${({theme:{palette:{brand:t,grey:r}},placement:f,color:e,offset:c,arrowOffset:d})=>{let o={};const n=(c==null?void 0:c.x)||0,p=(c==null?void 0:c.y)||0,l=(d==null?void 0:d.x)||0,a=(d==null?void 0:d.y)||0;switch(f){case"bottom-left":o={top:`calc(-12px + ${p}px)`,left:`calc(-6px + ${n}px)`,transform:"translateY(-100%)","&:after":{content:'""',position:"absolute",top:"100%",left:`calc(12px + ${l}px)`,borderTop:`8px solid ${e==="primary"?t.primary.tooltip:r[80]}`,borderRight:"6px solid transparent",borderBottom:"8px solid transparent",borderLeft:"6px solid transparent"}};break;case"bottom-center":o={top:`calc(-12px + ${p}px)`,left:"50%",transform:`translate(calc(-50% + ${n}px), -100%)`,"&:after":{content:'""',position:"absolute",top:"100%",left:`calc(50% + ${l}px)`,transform:"translateX(-50%)",borderTop:`8px solid ${e==="primary"?t.primary.tooltip:r[80]}`,borderRight:"6px solid transparent",borderBottom:"8px solid transparent",borderLeft:"6px solid transparent"}};break;case"bottom-right":o={top:`calc(-12px + ${p}px)`,right:`calc(-6px - ${n}px)`,transform:"translateY(-100%)","&:after":{content:'""',position:"absolute",top:"100%",right:`calc(12px - ${l}px)`,borderTop:`8px solid ${e==="primary"?t.primary.tooltip:r[80]}`,borderRight:"6px solid transparent",borderBottom:"8px solid transparent",borderLeft:"6px solid transparent"}};break;case"left-top":o={top:`calc(-6px + ${p}px)`,left:`calc(100% + 12px + ${n}px)`,"&:after":{content:'""',position:"absolute",top:`calc(12px + ${a}px)`,right:"100%",borderTop:"6px solid transparent",borderRight:`8px solid ${e==="primary"?t.primary.tooltip:r[80]}`,borderBottom:"6px solid transparent",borderLeft:"8px solid transparent"}};break;case"left-middle":o={top:"50%",left:`calc(100% + 12px + ${n}px)`,transform:`translateY(calc(-50% + ${p}px))`,"&:after":{content:'""',position:"absolute",top:`calc(50% + ${a}px)`,right:"100%",transform:"translateY(-50%)",borderTop:"6px solid transparent",borderRight:`8px solid ${e==="primary"?t.primary.tooltip:r[80]}`,borderBottom:"6px solid transparent",borderLeft:"8px solid transparent"}};break;case"left-bottom":o={bottom:`calc(-6px - ${p}px)`,left:`calc(100% + 12px + ${n}px)`,"&:after":{content:'""',position:"absolute",bottom:`calc(12px - ${a}px)`,right:"100%",borderTop:"6px solid transparent",borderRight:`8px solid ${e==="primary"?t.primary.tooltip:r[80]}`,borderBottom:"6px solid transparent",borderLeft:"8px solid transparent"}};break;case"top-left":o={left:`calc(-6px + ${n}px)`,transform:`translate(0, calc(12px + ${p}px))`,"&:after":{content:'""',position:"absolute",bottom:"100%",left:`calc(12px + ${l}px)`,borderTop:"8px solid transparent",borderRight:"6px solid transparent",borderBottom:`8px solid ${e==="primary"?t.primary.tooltip:r[80]}`,borderLeft:"6px solid transparent"}};break;case"top-center":o={right:"50%",transform:`translate(calc(50% + ${n}px), calc(12px + ${p}px))`,"&:after":{content:'""',position:"absolute",bottom:"100%",left:`calc(50% + ${l}px)`,transform:"translateX(-50%)",borderTop:"8px solid transparent",borderRight:"6px solid transparent",borderBottom:`8px solid ${e==="primary"?t.primary.tooltip:r[80]}`,borderLeft:"6px solid transparent"}};break;case"top-right":o={right:`calc(-6px - ${n}px)`,transform:`translate(0, calc(12px + ${p}px))`,"&:after":{content:'""',position:"absolute",bottom:"100%",right:`calc(12px - ${l}px)`,borderTop:"8px solid transparent",borderRight:"6px solid transparent",borderBottom:`8px solid ${e==="primary"?t.primary.tooltip:r[80]}`,borderLeft:"6px solid transparent"}};break;case"right-top":o={top:`calc(-6px + ${p}px)`,right:`calc(100% + 12px + ${n}px)`,"&:after":{content:'""',position:"absolute",top:`calc(12px + ${a}px)`,left:"100%",borderTop:"6px solid transparent",borderRight:"8px solid transparent",borderBottom:"6px solid transparent",borderLeft:`8px solid ${e==="primary"?t.primary.tooltip:r[80]}`}};break;case"right-middle":o={top:"50%",right:`calc(100% + 12px + ${n}px)`,transform:`translateY(calc(-50% + ${p}px))`,"&:after":{content:'""',position:"absolute",top:`calc(50% + ${a}px)`,left:"100%",transform:"translateY(-50%)",borderTop:"6px solid transparent",borderRight:"8px solid transparent",borderBottom:"6px solid transparent",borderLeft:`8px solid ${e==="primary"?t.primary.tooltip:r[80]}`}};break;case"right-bottom":o={bottom:`calc(-6px - ${p}px)`,right:`calc(100% + 12px + ${n}px)`,"&:after":{content:'""',position:"absolute",bottom:`calc(12px - ${a}px)`,left:"100%",borderTop:"6px solid transparent",borderRight:"8px solid transparent",borderBottom:"6px solid transparent",borderLeft:`8px solid ${e==="primary"?t.primary.tooltip:r[80]}`}};break}return o}};
|
|
27
|
+
`,V=s.forwardRef(function({children:r,placement:f="bottom-center",color:e="primary",title:c,body:d,closer:o,endAdornment:n,inlineCSS:p,open:l=!1,onClose:a,wrapperProps:y,offset:E,arrowOffset:K,...g},Y){const C=s.useId(),T=s.useId(),L=s.useId(),{isKeyboardMode:k}=M.default(),S=s.useRef(null),R=s.useRef(null),v=s.useRef(!0),[D,_]=s.useState(!1),w=(g==null?void 0:g.id)||C,B=i=>{(i.key==="Enter"||i.key===" ")&&(a==null||a(i))};return s.useEffect(()=>{R.current&&R.current.getBoundingClientRect().width>=276&&_(!0)},[l]),s.useEffect(()=>{const i=u=>{u.key==="Escape"&&l&&(u.stopPropagation(),a==null||a(u))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[l,a]),s.useEffect(()=>{var u,m,b;if(v.current){v.current=!1;return}if(l){const h=(u=S.current)==null?void 0:u.querySelector('.tooltip-closer[role="button"]');if(h&&k&&h.focus(),!h){const j=(m=S.current)==null?void 0:m.querySelector('[role="button"]');j&&k&&j.focus()}return}const i=(b=S.current)==null?void 0:b.querySelector('[role="button"]');i&&k&&i.focus()},[l,k]),x.jsxs(F,{ref:S,open:l,...y,css:y==null?void 0:y.inlineCSS,children:[s.Children.map(r,i=>{if(!s.isValidElement(i))return i;const u=m=>{var b,h;(m.key==="Enter"||m.key===" ")&&((h=(b=i.props)==null?void 0:b.onClick)==null||h.call(b,m))};return s.cloneElement(i,{inlineCSS:{cursor:"pointer","&:active":{outline:"none"},...i.props.inlineCSS},role:"button",tabIndex:0,"aria-hidden":!1,"aria-expanded":l,"aria-haspopup":"dialog","aria-controls":w,focusable:!0,onKeyDown:u,...i.props})}),x.jsxs(H,{id:w,className:"tooltip",role:"dialog","aria-modal":"true","aria-labelledby":c?T:void 0,"aria-describedby":d?L:void 0,ref:Y,placement:f,color:e,offset:E,arrowOffset:K,...g,css:p,children:[c&&x.jsxs($.default,{alignItems:"center",justifyContent:"space-between",gap:2,children:[x.jsx(z.default,{id:T,variant:"h5B",color:e==="primary"?"grey.100":"grey.white",children:c}),o&&x.jsx($.default,{flexShrink:0,children:x.jsx(I.default,{className:"tooltip-closer",name:"CloseLine",size:"xSmall",color:e==="primary"?"grey.100":"grey.white",role:"button","aria-hidden":"false",focusable:"true",tabIndex:0,onClick:a,onKeyDown:B,"aria-label":"닫기",inlineCSS:{marginLeft:"2px",cursor:"pointer","&:active":{outline:"none"}}})})]}),d&&x.jsxs($.default,{id:L,alignItems:"center",gap:2,ref:R,style:D?{width:"276px",whiteSpace:"wrap"}:{},children:[d,n&&x.jsx($.default,{flexShrink:0,inlineCSS:{fontSize:"24px"},children:n}),!c&&o&&x.jsx($.default,{flexShrink:0,children:x.jsx(I.default,{className:"tooltip-closer",name:"CloseLine",size:"xSmall",color:e==="primary"?"grey.100":"grey.white",role:"button","aria-hidden":"false",focusable:"true",tabIndex:0,onClick:a,onKeyDown:B,"aria-label":"닫기",inlineCSS:{marginLeft:"2px",cursor:"pointer","&:active":{outline:"none"}}})})]})]})]})});exports.default=V;
|
package/Tooltip/Tooltip.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { HTMLAttributes,
|
|
1
|
+
import { HTMLAttributes, ReactNode, SyntheticEvent } from 'react';
|
|
2
2
|
import { BrandColorKey } from '../typings/color';
|
|
3
3
|
import { GeneralComponentProps } from '../typings/component';
|
|
4
4
|
|
|
5
|
+
export interface TooltipOffset {
|
|
6
|
+
x?: number;
|
|
7
|
+
y?: number;
|
|
8
|
+
}
|
|
5
9
|
export interface TooltipProps extends GeneralComponentProps<Omit<HTMLAttributes<HTMLDivElement>, 'title'>> {
|
|
6
10
|
placement?: 'bottom-left' | 'bottom-center' | 'bottom-right' | 'left-top' | 'left-middle' | 'left-bottom' | 'top-left' | 'top-center' | 'top-right' | 'right-top' | 'right-middle' | 'right-bottom';
|
|
7
11
|
color?: BrandColorKey;
|
|
@@ -10,9 +14,10 @@ export interface TooltipProps extends GeneralComponentProps<Omit<HTMLAttributes<
|
|
|
10
14
|
endAdornment?: ReactNode;
|
|
11
15
|
open?: boolean;
|
|
12
16
|
closer?: boolean;
|
|
13
|
-
|
|
14
|
-
onClose?: MouseEventHandler;
|
|
17
|
+
onClose?: (e: SyntheticEvent) => void;
|
|
15
18
|
wrapperProps?: GeneralComponentProps<HTMLAttributes<HTMLDivElement>>;
|
|
19
|
+
offset?: TooltipOffset;
|
|
20
|
+
arrowOffset?: TooltipOffset;
|
|
16
21
|
}
|
|
17
22
|
declare const Tooltip: import('react').ForwardRefExoticComponent<TooltipProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
18
23
|
export default Tooltip;
|