@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,110 +1,265 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import { jsxs as C, jsx as p, Fragment as V } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ee, useRef as P, useId as te, useImperativeHandle as re, useState as H, useEffect as le, isValidElement as U, cloneElement as _ } from "react";
|
|
3
|
+
import oe from "../CircularProgressIndicator/CircularProgressIndicator.es.js";
|
|
4
|
+
import G from "../Flexbox/Flexbox.es.js";
|
|
5
|
+
import ne from "../Icon/Icon.es.js";
|
|
6
|
+
import ie from "../Menu/Menu.es.js";
|
|
7
|
+
import A from "../Menu/MenuBlock/MenuBlock.es.js";
|
|
8
|
+
import "../Menu/MenuButton/MenuButton.es.js";
|
|
9
|
+
import se from "../TextField/TextField.es.js";
|
|
10
|
+
import ce from "../Typography/Typography.es.js";
|
|
11
|
+
import ae from "../core/useTheme.es.js";
|
|
12
|
+
import W from "../utils/getSibling/getSibling.es.js";
|
|
13
|
+
const S = 100, ge = ee(function({
|
|
14
|
+
inputValue: n,
|
|
15
|
+
onInputChange: u,
|
|
16
|
+
menuValue: T,
|
|
17
|
+
onMenuChange: y,
|
|
18
|
+
inputProps: J,
|
|
19
|
+
minInputLengthForMenu: q = 0,
|
|
20
|
+
options: E = [],
|
|
21
|
+
isLoading: g = !1,
|
|
22
|
+
renderOptions: D,
|
|
23
|
+
renderEmpty: F,
|
|
24
|
+
filterOptions: $,
|
|
25
|
+
getOptionLabel: h
|
|
26
|
+
}, Q) {
|
|
27
|
+
const O = P(null), f = P(null), N = te(), { palette: R } = ae();
|
|
28
|
+
re(Q, () => O.current);
|
|
29
|
+
const [k, v] = H(!1), [d, m] = H(void 0), r = P(!1), x = $ ? $(E) : E.filter((e) => e.label.includes(n)), K = x.length > 0, w = n.length >= q, j = () => {
|
|
30
|
+
if (k && !T) {
|
|
31
|
+
v(!1), setTimeout(() => {
|
|
32
|
+
u("");
|
|
33
|
+
}, S);
|
|
33
34
|
return;
|
|
34
|
-
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
}
|
|
36
|
+
if (k && T) {
|
|
37
|
+
const e = x.find((l) => l.value === T);
|
|
38
|
+
if (e) {
|
|
39
|
+
const l = h ? h(e) : e.label;
|
|
40
|
+
v(!1), setTimeout(() => {
|
|
41
|
+
u(l);
|
|
42
|
+
});
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
v((e) => !e);
|
|
47
|
+
}, X = (e) => {
|
|
48
|
+
e.target.value.length > 0 ? v(!0) : y("", e, null), u(e.target.value, e);
|
|
49
|
+
}, Y = () => {
|
|
50
|
+
w && v(!0);
|
|
51
|
+
}, Z = (e, l) => {
|
|
52
|
+
var c;
|
|
53
|
+
if (e === void 0 || !l || !((c = l == null ? void 0 : l.target) != null && c.textContent)) return;
|
|
54
|
+
const i = x.find((a) => a.value === e);
|
|
55
|
+
if (h) {
|
|
56
|
+
i && setTimeout(() => {
|
|
57
|
+
u(h(i), l), y(e.toString(), l, i);
|
|
58
|
+
}, S);
|
|
39
59
|
return;
|
|
40
60
|
}
|
|
41
61
|
setTimeout(() => {
|
|
42
|
-
|
|
43
|
-
},
|
|
62
|
+
u(l.target.textContent || "", l), y(e.toString(), l, i || null);
|
|
63
|
+
}, S);
|
|
64
|
+
}, M = (e) => {
|
|
65
|
+
var l, i, c, a, I, b, z;
|
|
66
|
+
if (!r.current) {
|
|
67
|
+
if (e.key === "ArrowDown") {
|
|
68
|
+
e.preventDefault(), e.stopPropagation(), r.current = !0;
|
|
69
|
+
const t = (l = f.current) == null ? void 0 : l.querySelector('li[role="option"]');
|
|
70
|
+
if (!d)
|
|
71
|
+
t && (m(t.id), t.scrollIntoView({ block: "end" }));
|
|
72
|
+
else {
|
|
73
|
+
const o = (i = f.current) == null ? void 0 : i.querySelector(
|
|
74
|
+
`#${CSS.escape(d)}`
|
|
75
|
+
);
|
|
76
|
+
if (!o) {
|
|
77
|
+
r.current = !1;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const s = W(o, "next", { skipDisabled: !0 });
|
|
81
|
+
s && s.id && (m(s.id), s.scrollIntoView({ block: "end" })), s || (m(t.id), t.scrollIntoView({ block: "end" }));
|
|
82
|
+
}
|
|
83
|
+
setTimeout(() => {
|
|
84
|
+
r.current = !1;
|
|
85
|
+
}, 0);
|
|
86
|
+
}
|
|
87
|
+
if (e.key === "ArrowUp") {
|
|
88
|
+
if (e.preventDefault(), e.stopPropagation(), r.current = !0, !d) {
|
|
89
|
+
r.current = !1;
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const t = (c = f.current) == null ? void 0 : c.querySelector(
|
|
93
|
+
`#${CSS.escape(d)}`
|
|
94
|
+
);
|
|
95
|
+
if (!t) {
|
|
96
|
+
r.current = !1;
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const o = W(t, "prev", { skipDisabled: !0 });
|
|
100
|
+
if (o && o.id && (m(o.id), o.scrollIntoView({ block: "end" })), !o) {
|
|
101
|
+
const s = (a = f.current) == null ? void 0 : a.querySelector(
|
|
102
|
+
'li[role="option"]:last-child'
|
|
103
|
+
);
|
|
104
|
+
s && (m(s.id), s.scrollIntoView({ block: "end" }));
|
|
105
|
+
}
|
|
106
|
+
setTimeout(() => {
|
|
107
|
+
r.current = !1;
|
|
108
|
+
}, 0);
|
|
109
|
+
}
|
|
110
|
+
if (e.key === "Enter") {
|
|
111
|
+
if (e.preventDefault(), e.stopPropagation(), r.current = !0, !d) {
|
|
112
|
+
r.current = !1;
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const t = (I = f.current) == null ? void 0 : I.querySelector(
|
|
116
|
+
`#${CSS.escape(d)}`
|
|
117
|
+
);
|
|
118
|
+
if (!t) {
|
|
119
|
+
r.current = !1;
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const o = x.find(
|
|
123
|
+
(s) => s.value === t.dataset.value
|
|
124
|
+
);
|
|
125
|
+
v(!1), setTimeout(h && o ? () => {
|
|
126
|
+
u(h(o), e), y(t.dataset.value || "", e, o);
|
|
127
|
+
} : () => {
|
|
128
|
+
u(t.textContent || "", e), y(t.dataset.value || "", e, o || null);
|
|
129
|
+
}, S), setTimeout(() => {
|
|
130
|
+
r.current = !1;
|
|
131
|
+
}, 0);
|
|
132
|
+
}
|
|
133
|
+
if (e.key === "Home") {
|
|
134
|
+
e.preventDefault(), e.stopPropagation(), r.current = !0;
|
|
135
|
+
const t = (b = f.current) == null ? void 0 : b.querySelector('li[role="option"]');
|
|
136
|
+
t && (m(t.id), t.scrollIntoView({ block: "start" })), setTimeout(() => {
|
|
137
|
+
r.current = !1;
|
|
138
|
+
}, 0);
|
|
139
|
+
}
|
|
140
|
+
if (e.key === "End") {
|
|
141
|
+
e.preventDefault(), e.stopPropagation(), r.current = !0;
|
|
142
|
+
const t = (z = f.current) == null ? void 0 : z.querySelector(
|
|
143
|
+
'li[role="option"]:last-child'
|
|
144
|
+
);
|
|
145
|
+
t && (m(t.id), t.scrollIntoView({ block: "end" })), setTimeout(() => {
|
|
146
|
+
r.current = !1;
|
|
147
|
+
}, 0);
|
|
148
|
+
}
|
|
149
|
+
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), r.current = !0, j(), setTimeout(() => {
|
|
150
|
+
r.current = !1;
|
|
151
|
+
}, 0));
|
|
152
|
+
}
|
|
153
|
+
}, B = (e) => {
|
|
154
|
+
v(!1), setTimeout(() => {
|
|
155
|
+
u("", e), y("", e, null);
|
|
156
|
+
}, S);
|
|
157
|
+
}, L = (e) => {
|
|
158
|
+
(e.key === "Enter" || e.key === " ") && B(e);
|
|
44
159
|
};
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
160
|
+
return le(() => {
|
|
161
|
+
k || m(void 0);
|
|
162
|
+
}, [k]), /* @__PURE__ */ C(G, { ref: O, inlineCSS: { position: "relative" }, children: [
|
|
163
|
+
/* @__PURE__ */ p(
|
|
164
|
+
se,
|
|
48
165
|
{
|
|
49
|
-
value:
|
|
50
|
-
onChange:
|
|
51
|
-
onFocus:
|
|
166
|
+
value: n,
|
|
167
|
+
onChange: X,
|
|
168
|
+
onFocus: Y,
|
|
169
|
+
onKeyDown: M,
|
|
52
170
|
fullWidth: !0,
|
|
53
|
-
|
|
54
|
-
|
|
171
|
+
autoComplete: "off",
|
|
172
|
+
role: "combobox",
|
|
173
|
+
"aria-expanded": k,
|
|
174
|
+
"aria-autocomplete": "list",
|
|
175
|
+
"aria-controls": N,
|
|
176
|
+
"aria-activedescendant": d,
|
|
177
|
+
"aria-busy": g,
|
|
178
|
+
"aria-haspopup": "listbox",
|
|
179
|
+
endAdornment: n ? /* @__PURE__ */ p(
|
|
180
|
+
ne,
|
|
55
181
|
{
|
|
56
182
|
name: "InvalidFill",
|
|
57
183
|
color: "grey.50",
|
|
58
184
|
size: "medium",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
185
|
+
role: "button",
|
|
186
|
+
onClick: B,
|
|
187
|
+
onKeyDown: L,
|
|
188
|
+
tabIndex: 0,
|
|
189
|
+
"aria-hidden": !1,
|
|
190
|
+
focusable: !0,
|
|
191
|
+
"aria-label": "지우기",
|
|
64
192
|
inlineCSS: { cursor: "pointer" }
|
|
65
193
|
}
|
|
66
194
|
) : null,
|
|
67
195
|
inlineCSS: { "& svg": { flexShrink: 0 } },
|
|
68
|
-
...
|
|
196
|
+
...J
|
|
69
197
|
}
|
|
70
198
|
),
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
199
|
+
/* @__PURE__ */ C(
|
|
200
|
+
ie,
|
|
73
201
|
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
202
|
+
id: N,
|
|
203
|
+
value: T,
|
|
204
|
+
ref: f,
|
|
205
|
+
anchorRef: O,
|
|
206
|
+
open: k && n.length >= q,
|
|
207
|
+
onClose: j,
|
|
208
|
+
onChange: Z,
|
|
209
|
+
transitionDuration: S,
|
|
210
|
+
disablePadding: !w,
|
|
82
211
|
children: [
|
|
83
|
-
|
|
84
|
-
!
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
212
|
+
g && /* @__PURE__ */ p(A, { value: "LOADING", disabled: !0, children: /* @__PURE__ */ p(G, { justifyContent: "center", children: /* @__PURE__ */ p(oe, { size: "small", loop: !0 }) }) }),
|
|
213
|
+
!g && K && x.map((e, l) => {
|
|
214
|
+
const i = e.label.indexOf(n), c = `menu-option-${e.value}-${e.label}`, a = d === c, I = e.value === T;
|
|
215
|
+
if (D && typeof D == "function") {
|
|
216
|
+
const b = D(e, l, x);
|
|
217
|
+
return U(b) ? _(b, {
|
|
218
|
+
id: c,
|
|
219
|
+
key: e.value,
|
|
220
|
+
role: "option",
|
|
221
|
+
"aria-selected": a,
|
|
222
|
+
"data-value": e.value,
|
|
223
|
+
inlineCSS: {
|
|
224
|
+
border: a ? `2px solid ${R.grey[100]}` : "2px solid transparent"
|
|
225
|
+
},
|
|
226
|
+
...b.props
|
|
227
|
+
}) : b;
|
|
228
|
+
}
|
|
229
|
+
if (!(n && !e.label.includes(n)) && w)
|
|
230
|
+
return /* @__PURE__ */ p(
|
|
231
|
+
A,
|
|
232
|
+
{
|
|
233
|
+
id: c,
|
|
234
|
+
value: e.value,
|
|
235
|
+
role: "option",
|
|
236
|
+
"aria-selected": a,
|
|
237
|
+
"data-value": e.value,
|
|
238
|
+
inlineCSS: {
|
|
239
|
+
border: a ? `2px solid ${R.grey[100]}` : "2px solid transparent"
|
|
240
|
+
},
|
|
241
|
+
...e == null ? void 0 : e.menuBlockProps,
|
|
242
|
+
children: n && !I ? /* @__PURE__ */ C(V, { children: [
|
|
243
|
+
e.label.slice(0, i),
|
|
244
|
+
/* @__PURE__ */ p(ce, { tag: "span", variant: "h5B", color: "primary", children: e.label.slice(i, i + n.length) }),
|
|
245
|
+
e.label.slice(i + n.length)
|
|
246
|
+
] }) : e.label
|
|
247
|
+
},
|
|
248
|
+
e.value
|
|
249
|
+
);
|
|
95
250
|
}),
|
|
96
|
-
!
|
|
97
|
-
const e =
|
|
98
|
-
return
|
|
251
|
+
!g && !K && (F ? (() => {
|
|
252
|
+
const e = F(n);
|
|
253
|
+
return U(e) ? _(e, {
|
|
99
254
|
...e.props,
|
|
100
255
|
disabled: !0
|
|
101
256
|
}) : e;
|
|
102
|
-
})() : /* @__PURE__ */
|
|
257
|
+
})() : /* @__PURE__ */ p(A, { value: "NO_OPTION", disabled: !0, children: "검색 결과가 없어요." }))
|
|
103
258
|
]
|
|
104
259
|
}
|
|
105
260
|
)
|
|
106
261
|
] });
|
|
107
262
|
});
|
|
108
263
|
export {
|
|
109
|
-
|
|
264
|
+
ge as default
|
|
110
265
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("@emotion/react/jsx-runtime"),r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("@emotion/react/jsx-runtime"),r=require("react"),K=require("../Backdrop/Backdrop.cjs"),U=require("../Flexbox/Flexbox.cjs"),z=require("../hooks/useFocusBoundary/useFocusBoundary.cjs"),G=require("@emotion/styled"),J=e=>e&&e.__esModule?e:{default:e},f=J(G),N=f.default.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: flex-end;
|
|
4
4
|
flex-direction: column;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
height: 100%;
|
|
7
7
|
cursor: ${({isDragging:e})=>e?"grabbing":"default"};
|
|
8
8
|
overflow: hidden;
|
|
9
|
-
`,
|
|
9
|
+
`,Q=f.default.div`
|
|
10
10
|
display: flex;
|
|
11
11
|
flex-direction: column;
|
|
12
12
|
max-height: 100%;
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
box-shadow: ${({theme:{elevation:e}})=>e[4]};
|
|
18
18
|
transition: transform ${({transitionDuration:e})=>e}ms;
|
|
19
19
|
transform: translate3d(0, ${({open:e})=>e?0:"100%"}, 0);
|
|
20
|
-
`,
|
|
20
|
+
`,V=f.default.div`
|
|
21
21
|
display: flex;
|
|
22
22
|
align-items: center;
|
|
23
23
|
justify-content: center;
|
|
24
24
|
padding: ${({theme:{spacing:e}})=>e.content(3)}px
|
|
25
25
|
${({theme:{spacing:e}})=>e.content(4)}px;
|
|
26
26
|
cursor: ${({isDragging:e})=>e?"grabbing":"grab"};
|
|
27
|
-
`,
|
|
27
|
+
`,X=f.default.div`
|
|
28
28
|
width: 32px;
|
|
29
29
|
height: 4px;
|
|
30
30
|
border-radius: 100px;
|
|
31
31
|
background-color: ${({theme:{palette:{grey:e}}})=>e[60]};
|
|
32
32
|
cursor: ${({isDragging:e})=>e?"grabbing":"grab"};
|
|
33
|
-
`,
|
|
33
|
+
`,Z=r.forwardRef(function({children:$,open:n,onClose:o,transitionDuration:i=200,inlineCSS:w,enableDragCloseHandler:k,backdropProps:R,systemNavigationBarColor:j="#FFFFFF",hideSystemNavigationBar:D=!1,disableFocusBoundary:q=!1,returnFocus:E=!0,initialFocusId:F,..._},B){var v,T,S,M;const[Y,m]=r.useState(!1),[a,h]=r.useState(!1),l=r.useRef(null),c=r.useRef(),g=r.useRef(0),u=r.useRef(0);z.default({ref:l,active:n,delay:i,disabled:q,returnFocus:E,initialFocusId:F});const O=((T=(v=l.current)==null?void 0:v.querySelector('[id^="bottom-sheet-title"]'))==null?void 0:T.getAttribute("id"))||void 0,A=((M=(S=l.current)==null?void 0:S.querySelector('[id^="bottom-sheet-text"]'))==null?void 0:M.getAttribute("id"))||void 0,C=t=>t.stopPropagation(),I=t=>{h(!1),a&&t.stopPropagation()},p=t=>()=>{h(!0),g.current=t},b=(t,d)=>()=>{a&&(u.current=t-g.current,!(u.current<0)&&(d.currentTarget.style.transitionDuration="0ms",d.currentTarget.style.transform=`translate3d(0, ${u.current}px, 0)`))},x=t=>{u.current>=20&&typeof o=="function"?(t.currentTarget.style.transitionDuration=`${i}ms`,t.currentTarget.style.transform="translate3d(0, 100%, 0)",o()):t.currentTarget.removeAttribute("style"),g.current=0,u.current=0,h(!1)},y=t=>{a&&t.currentTarget.removeAttribute("style")},P=t=>p(t.clientY)(),H=t=>b(t.clientY,t)(),L=t=>p(t.touches[0].clientY)(),W=t=>b(t.touches[0].clientY,t)();return r.useEffect(()=>{n?(c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{m(!0)},100)):m(!1)},[n]),r.useEffect(()=>{const t=d=>{d.key==="Escape"&&n&&o&&o()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[n,o]),r.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]),s.jsx(K.default,{open:n,onClose:o,transitionDuration:i,fullScreen:!0,...R,children:s.jsx(N,{ref:l,isDragging:a,onClick:I,children:s.jsxs(Q,{ref:B,open:Y,transitionDuration:i,onClick:C,onMouseMove:H,onMouseUp:x,onMouseOut:y,onTouchMove:W,onTouchEnd:x,onTouchCancel:y,role:"dialog","aria-modal":"true","aria-labelledby":O,"aria-describedby":A,..._,css:w,children:[k&&s.jsx(V,{isDragging:a,onMouseDown:P,onTouchStart:L,children:s.jsx(X,{isDragging:a})}),$,!D&&s.jsx(U.default,{inlineCSS:{minHeight:"var(--system-navigation-bar-height, 0px)",backgroundColor:j}})]})})})});exports.default=Z;
|
|
@@ -10,6 +10,9 @@ export interface BottomSheetProps extends GeneralComponentProps<HTMLAttributes<H
|
|
|
10
10
|
backdropProps?: BackdropProps;
|
|
11
11
|
systemNavigationBarColor?: string;
|
|
12
12
|
hideSystemNavigationBar?: boolean;
|
|
13
|
+
disableFocusBoundary?: boolean;
|
|
14
|
+
returnFocus?: boolean;
|
|
15
|
+
initialFocusId?: string;
|
|
13
16
|
}
|
|
14
17
|
declare const BottomSheet: import('react').ForwardRefExoticComponent<BottomSheetProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
15
18
|
export default BottomSheet;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { jsx as i, jsxs as G } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef as J, useState as k, useRef as d, useEffect as g } from "react";
|
|
3
|
+
import N from "../Backdrop/Backdrop.es.js";
|
|
4
|
+
import Q from "../Flexbox/Flexbox.es.js";
|
|
5
|
+
import V from "../hooks/useFocusBoundary/useFocusBoundary.es.js";
|
|
6
|
+
import f from "@emotion/styled";
|
|
7
|
+
const X = f.div`
|
|
7
8
|
display: flex;
|
|
8
9
|
justify-content: flex-end;
|
|
9
10
|
flex-direction: column;
|
|
@@ -11,7 +12,7 @@ const P = u.div`
|
|
|
11
12
|
height: 100%;
|
|
12
13
|
cursor: ${({ isDragging: t }) => t ? "grabbing" : "default"};
|
|
13
14
|
overflow: hidden;
|
|
14
|
-
`,
|
|
15
|
+
`, Z = f.div`
|
|
15
16
|
display: flex;
|
|
16
17
|
flex-direction: column;
|
|
17
18
|
max-height: 100%;
|
|
@@ -26,14 +27,14 @@ const P = u.div`
|
|
|
26
27
|
box-shadow: ${({ theme: { elevation: t } }) => t[4]};
|
|
27
28
|
transition: transform ${({ transitionDuration: t }) => t}ms;
|
|
28
29
|
transform: translate3d(0, ${({ open: t }) => t ? 0 : "100%"}, 0);
|
|
29
|
-
`,
|
|
30
|
+
`, _ = f.div`
|
|
30
31
|
display: flex;
|
|
31
32
|
align-items: center;
|
|
32
33
|
justify-content: center;
|
|
33
34
|
padding: ${({ theme: { spacing: t } }) => t.content(3)}px
|
|
34
35
|
${({ theme: { spacing: t } }) => t.content(4)}px;
|
|
35
36
|
cursor: ${({ isDragging: t }) => t ? "grabbing" : "grab"};
|
|
36
|
-
`,
|
|
37
|
+
`, ee = f.div`
|
|
37
38
|
width: 32px;
|
|
38
39
|
height: 4px;
|
|
39
40
|
border-radius: 100px;
|
|
@@ -43,80 +44,97 @@ const P = u.div`
|
|
|
43
44
|
}
|
|
44
45
|
}) => t[60]};
|
|
45
46
|
cursor: ${({ isDragging: t }) => t ? "grabbing" : "grab"};
|
|
46
|
-
`,
|
|
47
|
-
children:
|
|
48
|
-
open:
|
|
49
|
-
onClose:
|
|
50
|
-
transitionDuration:
|
|
51
|
-
inlineCSS:
|
|
52
|
-
enableDragCloseHandler:
|
|
53
|
-
backdropProps:
|
|
54
|
-
systemNavigationBarColor:
|
|
55
|
-
hideSystemNavigationBar:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
47
|
+
`, ie = J(function({
|
|
48
|
+
children: M,
|
|
49
|
+
open: r,
|
|
50
|
+
onClose: n,
|
|
51
|
+
transitionDuration: s = 200,
|
|
52
|
+
inlineCSS: D,
|
|
53
|
+
enableDragCloseHandler: F,
|
|
54
|
+
backdropProps: B,
|
|
55
|
+
systemNavigationBarColor: E = "#FFFFFF",
|
|
56
|
+
hideSystemNavigationBar: R = !1,
|
|
57
|
+
disableFocusBoundary: Y = !1,
|
|
58
|
+
returnFocus: j = !0,
|
|
59
|
+
initialFocusId: A,
|
|
60
|
+
...C
|
|
61
|
+
}, I) {
|
|
62
|
+
var T, S, $, w;
|
|
63
|
+
const [O, p] = k(!1), [o, h] = k(!1), l = d(null), a = d(), m = d(0), c = d(0);
|
|
64
|
+
V({
|
|
65
|
+
ref: l,
|
|
66
|
+
active: r,
|
|
67
|
+
delay: s,
|
|
68
|
+
disabled: Y,
|
|
69
|
+
returnFocus: j,
|
|
70
|
+
initialFocusId: A
|
|
71
|
+
});
|
|
72
|
+
const q = ((S = (T = l.current) == null ? void 0 : T.querySelector('[id^="bottom-sheet-title"]')) == null ? void 0 : S.getAttribute("id")) || void 0, H = ((w = ($ = l.current) == null ? void 0 : $.querySelector('[id^="bottom-sheet-text"]')) == null ? void 0 : w.getAttribute("id")) || void 0, L = (e) => e.stopPropagation(), P = (e) => {
|
|
73
|
+
h(!1), o && e.stopPropagation();
|
|
74
|
+
}, b = (e) => () => {
|
|
75
|
+
h(!0), m.current = e;
|
|
76
|
+
}, x = (e, u) => () => {
|
|
77
|
+
o && (c.current = e - m.current, !(c.current < 0) && (u.currentTarget.style.transitionDuration = "0ms", u.currentTarget.style.transform = `translate3d(0, ${c.current}px, 0)`));
|
|
66
78
|
}, y = (e) => {
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
c.current >= 20 && typeof n == "function" ? (e.currentTarget.style.transitionDuration = `${s}ms`, e.currentTarget.style.transform = "translate3d(0, 100%, 0)", n()) : e.currentTarget.removeAttribute("style"), m.current = 0, c.current = 0, h(!1);
|
|
80
|
+
}, v = (e) => {
|
|
81
|
+
o && e.currentTarget.removeAttribute("style");
|
|
82
|
+
}, W = (e) => b(e.clientY)(), K = (e) => x(e.clientY, e)(), U = (e) => b(e.touches[0].clientY)(), z = (e) => x(e.touches[0].clientY, e)();
|
|
83
|
+
return g(() => {
|
|
84
|
+
r ? (a.current && clearTimeout(a.current), a.current = setTimeout(() => {
|
|
85
|
+
p(!0);
|
|
86
|
+
}, 100)) : p(!1);
|
|
87
|
+
}, [r]), g(() => {
|
|
88
|
+
const e = (u) => {
|
|
89
|
+
u.key === "Escape" && r && n && n();
|
|
76
90
|
};
|
|
77
91
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
78
|
-
}, [
|
|
92
|
+
}, [r, n]), g(() => () => {
|
|
79
93
|
a.current && clearTimeout(a.current);
|
|
80
|
-
}, []), /* @__PURE__ */
|
|
81
|
-
|
|
94
|
+
}, []), /* @__PURE__ */ i(
|
|
95
|
+
N,
|
|
82
96
|
{
|
|
83
|
-
open:
|
|
84
|
-
onClose:
|
|
85
|
-
transitionDuration:
|
|
97
|
+
open: r,
|
|
98
|
+
onClose: n,
|
|
99
|
+
transitionDuration: s,
|
|
86
100
|
fullScreen: !0,
|
|
87
|
-
...
|
|
88
|
-
children: /* @__PURE__ */
|
|
89
|
-
|
|
101
|
+
...B,
|
|
102
|
+
children: /* @__PURE__ */ i(X, { ref: l, isDragging: o, onClick: P, children: /* @__PURE__ */ G(
|
|
103
|
+
Z,
|
|
90
104
|
{
|
|
91
|
-
ref:
|
|
92
|
-
open:
|
|
93
|
-
transitionDuration:
|
|
94
|
-
onClick:
|
|
95
|
-
onMouseMove:
|
|
96
|
-
onMouseUp:
|
|
97
|
-
onMouseOut:
|
|
98
|
-
onTouchMove:
|
|
99
|
-
onTouchEnd:
|
|
100
|
-
onTouchCancel:
|
|
101
|
-
|
|
102
|
-
|
|
105
|
+
ref: I,
|
|
106
|
+
open: O,
|
|
107
|
+
transitionDuration: s,
|
|
108
|
+
onClick: L,
|
|
109
|
+
onMouseMove: K,
|
|
110
|
+
onMouseUp: y,
|
|
111
|
+
onMouseOut: v,
|
|
112
|
+
onTouchMove: z,
|
|
113
|
+
onTouchEnd: y,
|
|
114
|
+
onTouchCancel: v,
|
|
115
|
+
role: "dialog",
|
|
116
|
+
"aria-modal": "true",
|
|
117
|
+
"aria-labelledby": q,
|
|
118
|
+
"aria-describedby": H,
|
|
119
|
+
...C,
|
|
120
|
+
css: D,
|
|
103
121
|
children: [
|
|
104
|
-
|
|
105
|
-
|
|
122
|
+
F && /* @__PURE__ */ i(
|
|
123
|
+
_,
|
|
106
124
|
{
|
|
107
|
-
isDragging:
|
|
108
|
-
onMouseDown:
|
|
109
|
-
onTouchStart:
|
|
110
|
-
children: /* @__PURE__ */
|
|
125
|
+
isDragging: o,
|
|
126
|
+
onMouseDown: W,
|
|
127
|
+
onTouchStart: U,
|
|
128
|
+
children: /* @__PURE__ */ i(ee, { isDragging: o })
|
|
111
129
|
}
|
|
112
130
|
),
|
|
113
|
-
|
|
114
|
-
!
|
|
115
|
-
|
|
131
|
+
M,
|
|
132
|
+
!R && /* @__PURE__ */ i(
|
|
133
|
+
Q,
|
|
116
134
|
{
|
|
117
135
|
inlineCSS: {
|
|
118
136
|
minHeight: "var(--system-navigation-bar-height, 0px)",
|
|
119
|
-
backgroundColor:
|
|
137
|
+
backgroundColor: E
|
|
120
138
|
}
|
|
121
139
|
}
|
|
122
140
|
)
|
|
@@ -127,5 +145,5 @@ const P = u.div`
|
|
|
127
145
|
);
|
|
128
146
|
});
|
|
129
147
|
export {
|
|
130
|
-
|
|
148
|
+
ie as default
|
|
131
149
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
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"),o=require("react"),a=require("@emotion/styled"),d=e=>e&&e.__esModule?e:{default:e},g=d(a),f=g.default.div`
|
|
2
2
|
text-align: ${({textAlign:e})=>e};
|
|
3
3
|
|
|
4
4
|
${({theme:{palette:{grey:e},typography:{b2R:t,b4R:i}},type:n})=>n==="sub"?{fontSize:i.size,fontWeight:i.weight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,color:e[70]}:{fontSize:t.size,fontWeight:t.weight,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing}}
|
|
5
|
-
`,
|
|
5
|
+
`,h=o.forwardRef(function({children:t,type:i="main",textAlign:n="center",inlineCSS:r,...l},s){const u=o.useId();return c.jsx(f,{ref:s,type:i,textAlign:n,id:`bottom-sheet-text-${u}`,...l,css:r,children:t})});exports.default=h;
|