@dotss/ui 0.0.10 → 0.0.12

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 (159) hide show
  1. package/Accordion/Accordion.cjs +13 -7
  2. package/Accordion/Accordion.d.ts +2 -0
  3. package/Accordion/Accordion.es.js +86 -65
  4. package/Autocomplete/Autocomplete.cjs +1 -1
  5. package/Autocomplete/Autocomplete.d.ts +1 -1
  6. package/Autocomplete/Autocomplete.es.js +235 -80
  7. package/BottomSheet/BottomSheet.cjs +5 -5
  8. package/BottomSheet/BottomSheet.d.ts +3 -0
  9. package/BottomSheet/BottomSheet.es.js +88 -70
  10. package/BottomSheet/BottomSheetText/BottomSheetText.cjs +2 -2
  11. package/BottomSheet/BottomSheetText/BottomSheetText.es.js +18 -6
  12. package/BottomSheet/BottomSheetTitle/BottomSheetTitle.cjs +6 -6
  13. package/BottomSheet/BottomSheetTitle/BottomSheetTitle.d.ts +2 -1
  14. package/BottomSheet/BottomSheetTitle/BottomSheetTitle.es.js +26 -15
  15. package/Button/Button.cjs +6 -6
  16. package/Button/Button.es.js +35 -29
  17. package/ChainPicker/ChainPicker.cjs +16 -6
  18. package/ChainPicker/ChainPicker.d.ts +4 -2
  19. package/ChainPicker/ChainPicker.es.js +155 -110
  20. package/ChainPicker/ChainPicker.stories.d.ts +1 -1
  21. package/Checkbox/Checkbox.cjs +3 -3
  22. package/Checkbox/Checkbox.es.js +12 -10
  23. package/CircularProgressIndicator/CircularProgressIndicator.cjs +5 -5
  24. package/CircularProgressIndicator/CircularProgressIndicator.es.js +25 -22
  25. package/DatePicker/DatePicker.cjs +37 -20
  26. package/DatePicker/DatePicker.d.ts +2 -1
  27. package/DatePicker/DatePicker.es.js +345 -320
  28. package/DatePicker/DatePicker.stories.d.ts +1 -0
  29. package/DatePicker/EventDot/EventDot.cjs +8 -0
  30. package/DatePicker/EventDot/EventDot.d.ts +8 -0
  31. package/DatePicker/EventDot/EventDot.es.js +19 -0
  32. package/DatePicker/EventDot/index.cjs +1 -0
  33. package/DatePicker/EventDot/index.d.ts +3 -0
  34. package/DatePicker/EventDot/index.es.js +4 -0
  35. package/DatePicker/EventDotGroup/EventDotGroup.cjs +8 -0
  36. package/DatePicker/EventDotGroup/EventDotGroup.d.ts +8 -0
  37. package/DatePicker/EventDotGroup/EventDotGroup.es.js +39 -0
  38. package/DatePicker/EventDotGroup/index.cjs +1 -0
  39. package/DatePicker/EventDotGroup/index.d.ts +3 -0
  40. package/DatePicker/EventDotGroup/index.es.js +4 -0
  41. package/DatePicker/index.cjs +1 -1
  42. package/DatePicker/index.d.ts +2 -0
  43. package/DatePicker/index.es.js +6 -2
  44. package/Dialog/Dialog.cjs +2 -2
  45. package/Dialog/Dialog.d.ts +2 -0
  46. package/Dialog/Dialog.es.js +45 -40
  47. package/Dialog/Dialog.stories.d.ts +10 -0
  48. package/Dialog/DialogText/DialogText.cjs +1 -1
  49. package/Dialog/DialogText/DialogText.es.js +1 -1
  50. package/Dialog/DialogTitle/DialogTitle.cjs +4 -4
  51. package/Dialog/DialogTitle/DialogTitle.d.ts +2 -1
  52. package/Dialog/DialogTitle/DialogTitle.es.js +17 -17
  53. package/FocusBoundary/FocusBoundary.cjs +1 -1
  54. package/FocusBoundary/FocusBoundary.d.ts +3 -1
  55. package/FocusBoundary/FocusBoundary.es.js +49 -42
  56. package/FormControlText/FormControlText.cjs +7 -5
  57. package/FormControlText/FormControlText.d.ts +2 -0
  58. package/FormControlText/FormControlText.es.js +50 -40
  59. package/Icon/Icon.cjs +1 -1
  60. package/Icon/Icon.es.js +1 -1
  61. package/IconButton/IconButton.cjs +8 -8
  62. package/IconButton/IconButton.es.js +32 -25
  63. package/LineProgressIndicator/LineProgressIndicator.cjs +6 -6
  64. package/LineProgressIndicator/LineProgressIndicator.es.js +34 -22
  65. package/Menu/Menu.cjs +16 -16
  66. package/Menu/Menu.d.ts +3 -2
  67. package/Menu/Menu.es.js +115 -81
  68. package/Menu/Menu.stories.d.ts +1 -0
  69. package/Menu/MenuBlock/MenuBlock.cjs +14 -7
  70. package/Menu/MenuBlock/MenuBlock.d.ts +1 -0
  71. package/Menu/MenuBlock/MenuBlock.es.js +47 -35
  72. package/Menu/MenuButton/MenuButton.cjs +1 -0
  73. package/Menu/MenuButton/MenuButton.d.ts +10 -0
  74. package/Menu/MenuButton/MenuButton.es.js +44 -0
  75. package/Menu/MenuButton/index.cjs +1 -0
  76. package/Menu/MenuButton/index.d.ts +3 -0
  77. package/Menu/MenuButton/index.es.js +4 -0
  78. package/Menu/index.cjs +1 -1
  79. package/Menu/index.d.ts +1 -0
  80. package/Menu/index.es.js +4 -2
  81. package/NumberKeypad/NumberKeypad.cjs +2 -2
  82. package/NumberKeypad/NumberKeypad.es.js +18 -16
  83. package/NumberKeypad/NumberKeypadBlock/NumberKeypadBlock.cjs +1 -1
  84. package/NumberKeypad/NumberKeypadBlock/NumberKeypadBlock.es.js +10 -1
  85. package/PageControl/PageControl.cjs +16 -5
  86. package/PageControl/PageControl.d.ts +3 -0
  87. package/PageControl/PageControl.es.js +77 -24
  88. package/PageControl/PageControl.stories.d.ts +1 -0
  89. package/Radio/Radio.cjs +3 -3
  90. package/Radio/Radio.es.js +22 -20
  91. package/RadioGroup/RadioGroup.cjs +1 -0
  92. package/RadioGroup/RadioGroup.d.ts +8 -0
  93. package/RadioGroup/RadioGroup.es.js +28 -0
  94. package/RadioGroup/RadioGroup.stories.d.ts +14 -0
  95. package/RadioGroup/index.cjs +1 -0
  96. package/RadioGroup/index.d.ts +3 -0
  97. package/RadioGroup/index.es.js +4 -0
  98. package/SegmentedButton/SegmentedButton.cjs +14 -3
  99. package/SegmentedButton/SegmentedButton.es.js +108 -34
  100. package/Select/Select.cjs +4 -4
  101. package/Select/Select.es.js +95 -86
  102. package/Slider/Slider.cjs +27 -12
  103. package/Slider/Slider.d.ts +1 -0
  104. package/Slider/Slider.es.js +177 -90
  105. package/Switch/Switch.cjs +28 -11
  106. package/Switch/Switch.d.ts +2 -0
  107. package/Switch/Switch.es.js +185 -65
  108. package/Switch/Switch.stories.d.ts +1 -0
  109. package/Tab/Tab.es.js +2 -4
  110. package/TextArea/TextArea.cjs +42 -34
  111. package/TextArea/TextArea.es.js +116 -82
  112. package/TextArea/TextArea.stories.d.ts +1 -1
  113. package/TextField/TextField.cjs +29 -13
  114. package/TextField/TextField.d.ts +2 -1
  115. package/TextField/TextField.es.js +122 -79
  116. package/TextField/TextField.stories.d.ts +1 -0
  117. package/Tooltip/Tooltip.cjs +7 -6
  118. package/Tooltip/Tooltip.d.ts +8 -3
  119. package/Tooltip/Tooltip.es.js +248 -146
  120. package/Tooltip/Tooltip.stories.d.ts +1 -0
  121. package/hooks/index.cjs +1 -1
  122. package/hooks/index.d.ts +3 -0
  123. package/hooks/index.es.js +7 -1
  124. package/hooks/useCheckHasFocus/useCheckHasFocus.cjs +1 -0
  125. package/hooks/useCheckHasFocus/useCheckHasFocus.d.ts +9 -0
  126. package/hooks/useCheckHasFocus/useCheckHasFocus.es.js +21 -0
  127. package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.cjs +1 -0
  128. package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.d.ts +4 -0
  129. package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.es.js +30 -0
  130. package/hooks/useFocusBoundary/useFocusBoundary.cjs +1 -0
  131. package/hooks/useFocusBoundary/useFocusBoundary.d.ts +12 -0
  132. package/hooks/useFocusBoundary/useFocusBoundary.es.js +63 -0
  133. package/index.cjs +1 -1
  134. package/index.d.ts +2 -1
  135. package/index.es.js +97 -90
  136. package/package.json +3 -3
  137. package/resources/tictoccroc/icons/fill/certified-fill.svg-B_RVx6K_.cjs +1 -0
  138. package/resources/tictoccroc/icons/fill/certified-fill.svg-CK7UqYft.js +5 -0
  139. package/resources/tictoccroc/icons/fill/index.d.ts +3 -0
  140. package/resources/tictoccroc/icons/fill/location-fill.svg-DfSHAnsd.js +5 -0
  141. package/resources/tictoccroc/icons/fill/location-fill.svg-Die9mxQH.cjs +1 -0
  142. package/resources/tictoccroc/icons/fill/send-fill.svg-CItD_2L1.js +5 -0
  143. package/resources/tictoccroc/icons/fill/send-fill.svg-D197Lwl0.cjs +1 -0
  144. package/resources/tictoccroc/icons/index.ts-BmqvB_n6.cjs +1 -0
  145. package/resources/tictoccroc/icons/index.ts-CzTh-XsD.js +228 -0
  146. package/resources/tictoccroc/icons/line/index.d.ts +4 -0
  147. package/resources/tictoccroc/icons/line/list-line.svg-r5d5htjN.cjs +1 -0
  148. package/resources/tictoccroc/icons/line/list-line.svg-yFfhZxUp.js +5 -0
  149. package/resources/tictoccroc/icons/line/monthly-line.svg-BdyaJ1t_.cjs +1 -0
  150. package/resources/tictoccroc/icons/line/monthly-line.svg-DY5-Xv34.js +5 -0
  151. package/resources/tictoccroc/icons/line/review-line.svg-B4rfJrsO.js +5 -0
  152. package/resources/tictoccroc/icons/line/review-line.svg-DYUuUybx.cjs +1 -0
  153. package/resources/tictoccroc/icons/line/weekly-line.svg-BCO-LS_a.cjs +1 -0
  154. package/resources/tictoccroc/icons/line/weekly-line.svg-BUPmmgeE.js +5 -0
  155. package/utils/getIconLabel/getIconLabel.cjs +1 -1
  156. package/utils/getIconLabel/getIconLabel.es.js +8 -1
  157. package/utils/getSibling/getSibling.es.js +1 -2
  158. package/resources/tictoccroc/icons/index.ts-CarI_z7q.js +0 -214
  159. package/resources/tictoccroc/icons/index.ts-IVJAK4qr.cjs +0 -1
@@ -1,110 +1,265 @@
1
- import { jsxs as h, jsx as n, Fragment as D } from "@emotion/react/jsx-runtime";
2
- import { forwardRef as z, useRef as _, useImperativeHandle as E, useState as G, isValidElement as H, cloneElement as U } from "react";
3
- import W from "../CircularProgressIndicator/CircularProgressIndicator.es.js";
4
- import T from "../Flexbox/Flexbox.es.js";
5
- import p from "../Icon/Icon.es.js";
6
- import q from "../Menu/Menu.es.js";
7
- import v from "../Menu/MenuBlock/MenuBlock.es.js";
8
- import J from "../TextField/TextField.es.js";
9
- import K from "../Typography/Typography.es.js";
10
- const a = 100, re = z(function({
11
- inputValue: l,
12
- onInputChange: s,
13
- menuValue: k,
14
- onMenuChange: i,
15
- inputProps: A,
16
- minInputLengthForMenu: g = 0,
17
- options: b = [],
18
- isLoading: d = !1,
19
- renderOptions: f,
20
- renderEmpty: C,
21
- filterOptions: x,
22
- getOptionLabel: O
23
- }, N) {
24
- const m = _(null);
25
- E(N, () => m.current);
26
- const [y, c] = G(!1), o = x ? x(b) : b.filter((e) => e.label.includes(l)), S = o.length > 0, u = l.length >= g, F = () => c((e) => !e), R = (e) => {
27
- e.target.value.length > 0 ? c(!0) : i("", e, null), s(e.target.value, e);
28
- }, P = () => {
29
- u && c(!0);
30
- }, j = (e, r) => {
31
- var I;
32
- if (e === void 0 || !r || !((I = r == null ? void 0 : r.target) != null && I.textContent))
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
- const t = o.find((B) => B.value === e);
35
- if (O) {
36
- t && setTimeout(() => {
37
- s(O(t), r), i(e.toString(), r, t);
38
- }, a);
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
- s(r.target.textContent || "", r), i(e.toString(), r, t || null);
43
- }, a);
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 /* @__PURE__ */ h(T, { ref: m, inlineCSS: { position: "relative" }, children: [
46
- /* @__PURE__ */ n(
47
- J,
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: l,
50
- onChange: R,
51
- onFocus: P,
166
+ value: n,
167
+ onChange: X,
168
+ onFocus: Y,
169
+ onKeyDown: M,
52
170
  fullWidth: !0,
53
- endAdornment: l ? /* @__PURE__ */ n(
54
- p,
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
- onClick: (e) => {
60
- c(!1), setTimeout(() => {
61
- s("", e), i("", e, null);
62
- }, a);
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
- ...A
196
+ ...J
69
197
  }
70
198
  ),
71
- /* @__PURE__ */ h(
72
- q,
199
+ /* @__PURE__ */ C(
200
+ ie,
73
201
  {
74
- value: k,
75
- anchorRef: m,
76
- open: y && l.length >= g,
77
- onClose: F,
78
- onChange: j,
79
- transitionDuration: a,
80
- disablePadding: !u,
81
- disableClickOutside: !l,
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
- d && /* @__PURE__ */ n(v, { value: "LOADING", disabled: !0, children: /* @__PURE__ */ n(T, { justifyContent: "center", children: /* @__PURE__ */ n(W, { size: "small", loop: !0 }) }) }),
84
- !d && S && o.map((e, r) => {
85
- if (f && typeof f == "function")
86
- return f(e, r, o);
87
- if (l && !e.label.includes(l) || !u)
88
- return;
89
- const t = e.label.indexOf(l);
90
- return /* @__PURE__ */ n(v, { value: e.value, ...e == null ? void 0 : e.menuBlockProps, children: l ? /* @__PURE__ */ h(D, { children: [
91
- e.label.slice(0, t),
92
- /* @__PURE__ */ n(K, { tag: "span", variant: "h5B", color: "primary", children: e.label.slice(t, t + l.length) }),
93
- e.label.slice(t + l.length)
94
- ] }) : e.label }, e.value);
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
- !d && !S && (C ? (() => {
97
- const e = C(l);
98
- return H(e) ? U(e, {
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__ */ n(v, { value: "NO_OPTION", disabled: !0, children: "검색 결과가 없어요." }))
257
+ })() : /* @__PURE__ */ p(A, { value: "NO_OPTION", disabled: !0, children: "검색 결과가 없어요." }))
103
258
  ]
104
259
  }
105
260
  )
106
261
  ] });
107
262
  });
108
263
  export {
109
- re as default
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"),q=require("../Backdrop/Backdrop.cjs"),B=require("../Flexbox/Flexbox.cjs"),O=require("@emotion/styled"),C=e=>e&&e.__esModule?e:{default:e},l=C(O),P=l.default.div`
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
- `,A=l.default.div`
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
- `,H=l.default.div`
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
- `,I=l.default.div`
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
- `,L=r.forwardRef(function({children:y,open:a,onClose:n,transitionDuration:d=200,inlineCSS:b,enableDragCloseHandler:T,backdropProps:M,systemNavigationBarColor:S="#FFFFFF",hideSystemNavigationBar:$=!1,...w},k){const[D,g]=r.useState(!1),[o,f]=r.useState(!1),c=r.useRef(),h=r.useRef(0),u=r.useRef(0),j=t=>t.stopPropagation(),R=t=>{f(!1),o&&t.stopPropagation()},m=t=>()=>{f(!0),h.current=t},p=(t,i)=>()=>{o&&(u.current=t-h.current,!(u.current<0)&&(i.currentTarget.style.transitionDuration="0ms",i.currentTarget.style.transform=`translate3d(0, ${u.current}px, 0)`))},x=t=>{u.current>=20&&typeof n=="function"?(t.currentTarget.style.transitionDuration=`${d}ms`,t.currentTarget.style.transform="translate3d(0, 100%, 0)",n()):t.currentTarget.removeAttribute("style"),h.current=0,u.current=0,f(!1)},v=t=>{o&&t.currentTarget.removeAttribute("style")},E=t=>m(t.clientY)(),F=t=>p(t.clientY,t)(),_=t=>m(t.touches[0].clientY)(),Y=t=>p(t.touches[0].clientY,t)();return r.useEffect(()=>{a?(c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{g(!0)},100)):g(!1)},[a]),r.useEffect(()=>{const t=i=>{i.key==="Escape"&&a&&n&&n()};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[a,n]),r.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]),s.jsx(q.default,{open:a,onClose:n,transitionDuration:d,fullScreen:!0,...M,children:s.jsx(P,{isDragging:o,onClick:R,children:s.jsxs(A,{ref:k,open:D,transitionDuration:d,onClick:j,onMouseMove:F,onMouseUp:x,onMouseOut:v,onTouchMove:Y,onTouchEnd:x,onTouchCancel:v,...w,css:b,children:[T&&s.jsx(H,{isDragging:o,onMouseDown:E,onTouchStart:_,children:s.jsx(I,{isDragging:o})}),y,!$&&s.jsx(B.default,{inlineCSS:{minHeight:"var(--system-navigation-bar-height, 0px)",backgroundColor:S}})]})})})});exports.default=L;
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 s, jsxs as A } from "@emotion/react/jsx-runtime";
2
- import { forwardRef as H, useState as b, useRef as h, useEffect as m } from "react";
3
- import I from "../Backdrop/Backdrop.es.js";
4
- import L from "../Flexbox/Flexbox.es.js";
5
- import u from "@emotion/styled";
6
- const P = u.div`
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
- `, W = u.div`
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
- `, K = u.div`
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
- `, U = u.div`
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
- `, Q = H(function({
47
- children: T,
48
- open: o,
49
- onClose: r,
50
- transitionDuration: l = 200,
51
- inlineCSS: $,
52
- enableDragCloseHandler: w,
53
- backdropProps: k,
54
- systemNavigationBarColor: M = "#FFFFFF",
55
- hideSystemNavigationBar: S = !1,
56
- ...D
57
- }, F) {
58
- const [E, g] = b(!1), [n, d] = b(!1), a = h(), f = h(0), c = h(0), Y = (e) => e.stopPropagation(), B = (e) => {
59
- d(!1), n && e.stopPropagation();
60
- }, p = (e) => () => {
61
- d(!0), f.current = e;
62
- }, x = (e, i) => () => {
63
- n && (c.current = e - f.current, !(c.current < 0) && (i.currentTarget.style.transitionDuration = "0ms", i.currentTarget.style.transform = `translate3d(0, ${c.current}px, 0)`));
64
- }, v = (e) => {
65
- c.current >= 20 && typeof r == "function" ? (e.currentTarget.style.transitionDuration = `${l}ms`, e.currentTarget.style.transform = "translate3d(0, 100%, 0)", r()) : e.currentTarget.removeAttribute("style"), f.current = 0, c.current = 0, d(!1);
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
- n && e.currentTarget.removeAttribute("style");
68
- }, R = (e) => p(e.clientY)(), j = (e) => x(e.clientY, e)(), C = (e) => p(e.touches[0].clientY)(), O = (e) => x(e.touches[0].clientY, e)();
69
- return m(() => {
70
- o ? (a.current && clearTimeout(a.current), a.current = setTimeout(() => {
71
- g(!0);
72
- }, 100)) : g(!1);
73
- }, [o]), m(() => {
74
- const e = (i) => {
75
- i.key === "Escape" && o && r && r();
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
- }, [o, r]), m(() => () => {
92
+ }, [r, n]), g(() => () => {
79
93
  a.current && clearTimeout(a.current);
80
- }, []), /* @__PURE__ */ s(
81
- I,
94
+ }, []), /* @__PURE__ */ i(
95
+ N,
82
96
  {
83
- open: o,
84
- onClose: r,
85
- transitionDuration: l,
97
+ open: r,
98
+ onClose: n,
99
+ transitionDuration: s,
86
100
  fullScreen: !0,
87
- ...k,
88
- children: /* @__PURE__ */ s(P, { isDragging: n, onClick: B, children: /* @__PURE__ */ A(
89
- W,
101
+ ...B,
102
+ children: /* @__PURE__ */ i(X, { ref: l, isDragging: o, onClick: P, children: /* @__PURE__ */ G(
103
+ Z,
90
104
  {
91
- ref: F,
92
- open: E,
93
- transitionDuration: l,
94
- onClick: Y,
95
- onMouseMove: j,
96
- onMouseUp: v,
97
- onMouseOut: y,
98
- onTouchMove: O,
99
- onTouchEnd: v,
100
- onTouchCancel: y,
101
- ...D,
102
- css: $,
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
- w && /* @__PURE__ */ s(
105
- K,
122
+ F && /* @__PURE__ */ i(
123
+ _,
106
124
  {
107
- isDragging: n,
108
- onMouseDown: R,
109
- onTouchStart: C,
110
- children: /* @__PURE__ */ s(U, { isDragging: n })
125
+ isDragging: o,
126
+ onMouseDown: W,
127
+ onTouchStart: U,
128
+ children: /* @__PURE__ */ i(ee, { isDragging: o })
111
129
  }
112
130
  ),
113
- T,
114
- !S && /* @__PURE__ */ s(
115
- L,
131
+ M,
132
+ !R && /* @__PURE__ */ i(
133
+ Q,
116
134
  {
117
135
  inlineCSS: {
118
136
  minHeight: "var(--system-navigation-bar-height, 0px)",
119
- backgroundColor: M
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
- Q as default
148
+ ie as default
131
149
  };
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("@emotion/react/jsx-runtime"),u=require("react"),a=require("@emotion/styled"),c=e=>e&&e.__esModule?e:{default:e},g=c(a),f=g.default.div`
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
- `,d=u.forwardRef(function({children:t,type:i="main",textAlign:n="center",inlineCSS:o,...r},l){return s.jsx(f,{ref:l,type:i,textAlign:n,...r,css:o,children:t})});exports.default=d;
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;