@dotss/ui 1.3.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Tab/Tab.es.js CHANGED
@@ -1,47 +1,57 @@
1
- import { jsx as N, jsxs as et } from "@emotion/react/jsx-runtime";
2
- import { forwardRef as rt, useRef as l, useState as x, Children as w, isValidElement as M, useEffect as H, cloneElement as nt } from "react";
3
- import L from "@emotion/styled";
4
- const st = L.div`
1
+ import { jsx as U, jsxs as ut } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as lt, useRef as l, useState as M, Children as w, isValidElement as I, useCallback as O, useEffect as C, cloneElement as dt } from "react";
3
+ import Y from "@emotion/styled";
4
+ const ft = Y.div`
5
5
  width: 100%;
6
- background-color: ${({ theme: o }) => o.palette.grey.white};
7
- ${({ scrollable: o }) => o ? {
8
- overflow: "hidden"
6
+ background-color: ${({ theme: a }) => a.palette.grey.white};
7
+ ${({ scrollable: a }) => a ? {
8
+ overflow: "hidden",
9
+ cursor: "grab",
10
+ '& [role="tab"]': {
11
+ flex: "0 0 auto"
12
+ }
9
13
  } : {}}
10
- `, it = L.div`
14
+ `, mt = Y.div`
11
15
  display: flex;
12
16
  position: relative;
13
- background: ${({ theme: o }) => o.palette.grey.white};
14
- ${({ theme: o, isChipped: u }) => u ? {
15
- gap: o.spacing.content(2)
17
+ background: ${({ theme: a }) => a.palette.grey.white};
18
+ ${({ theme: a, isChipped: m }) => m ? {
19
+ gap: a.spacing.content(2)
16
20
  } : {}}
17
- `, ot = L.div`
21
+ `, ht = Y.div`
18
22
  position: absolute;
19
23
  height: 2px;
20
24
  bottom: 0;
21
- background: ${({ theme: o, disabled: u }) => u ? o.palette.brand.primary.disableLine : o.palette.brand.primary.main};
25
+ background: ${({ theme: a, disabled: m }) => m ? a.palette.brand.primary.disableLine : a.palette.brand.primary.main};
22
26
  transition: all 0.2s ease-in-out;
23
27
  transition-property: transform, width;
24
- ${({ isChipped: o }) => o ? {
28
+ ${({ isChipped: a }) => a ? {
25
29
  display: "none"
26
30
  } : {}}
27
- `, S = 3, ut = rt(function({
28
- value: u,
29
- scrollable: d = !1,
31
+ `, L = 3, g = Object.freeze({
32
+ FRICTION: 0.85,
33
+ MIN_VELOCITY: 0.01,
34
+ MAX_VELOCITY: 1.62,
35
+ STOP_VELOCITY: 0.02,
36
+ SAMPLE_DURATION: 100
37
+ }), gt = lt(function({
38
+ value: m,
39
+ scrollable: h = !1,
30
40
  disabled: j = !1,
31
- onChange: E,
41
+ onChange: R,
32
42
  size: $ = "medium",
33
- inlineCSS: K,
34
- wrapperProps: m,
35
- children: R,
36
- ...O
37
- }, P) {
38
- const s = l(null), f = l(), p = l(0), z = l(!0), D = l(!1), g = l(!1), c = l(!1), [U, V] = x(!1), [T, _] = x(0), [A, G] = x(0), [W, J] = x(0), Y = j, X = w.toArray(R).every((t) => M(t) && w.toArray(t.props.children).every(
39
- (r) => M(r) && !Array.isArray(r.props.children)
40
- )), Q = (t) => (r) => {
41
- d && !D.current || (E(t, r.currentTarget), D.current = !1);
42
- }, Z = (t) => {
43
- if (!s.current) return;
44
- const r = s.current.querySelectorAll(
43
+ inlineCSS: H,
44
+ wrapperProps: v,
45
+ children: F,
46
+ ...z
47
+ }, K) {
48
+ const o = l(null), c = l(), p = l(0), G = l(!0), S = l(!1), x = l(!1), u = l(!1), T = l([]), [J, Q] = M(!1), [D, Z] = M(0), [E, B] = M(0), [N, tt] = M(0), W = j, P = w.toArray(F).every((t) => I(t) && w.toArray(t.props.children).every(
49
+ (r) => I(r) && !Array.isArray(r.props.children)
50
+ )), et = (t) => (r) => {
51
+ h && !S.current || (R(t, r.currentTarget), S.current = !1);
52
+ }, rt = (t) => {
53
+ if (!o.current) return;
54
+ const r = o.current.querySelectorAll(
45
55
  '[role="tab"]:not([disabled])'
46
56
  ), i = Array.from(r).findIndex((e) => e === document.activeElement);
47
57
  if (t.key === "ArrowLeft") {
@@ -66,42 +76,77 @@ const st = L.div`
66
76
  if (e && !e.getAttribute("disabled")) {
67
77
  const n = e.getAttribute("value");
68
78
  if (n) {
69
- E(n, e);
70
- const a = s.current.querySelector(".indicator");
71
- a && (a.style.width = `${e.clientWidth}px`, a.style.transform = `translate3d(${e.offsetLeft}px, 0px, 0px)`, g.current ? a.style.transition = "all 0.2s ease-in-out" : (a.style.transition = "unset", g.current = !0));
79
+ R(n, e);
80
+ const s = o.current.querySelector(".indicator");
81
+ s && (s.style.width = `${e.clientWidth}px`, s.style.transform = `translate3d(${e.offsetLeft}px, 0px, 0px)`, x.current ? s.style.transition = "all 0.2s ease-in-out" : (s.style.transition = "unset", x.current = !0));
72
82
  }
73
83
  }
74
84
  }
75
- }, k = (t, r) => {
76
- _(t), G(r), J(p.current);
77
- }, I = (t, r) => {
78
- if (!c.current) return;
79
- c.current = !1;
80
- const i = T - t, e = A - r;
81
- t && Math.abs(i) < S && Math.abs(e) < S * 2 && (D.current = !0), f.current && (cancelAnimationFrame(f.current), f.current = void 0);
82
- }, B = (t) => {
83
- d && (c.current = !0, k(t.clientX, t.clientY));
84
- }, tt = (t) => {
85
- d && k(t.touches[0].clientX, t.touches[0].clientY);
86
- }, C = (t) => I(t.changedTouches[0].clientX, t.changedTouches[0].clientY), q = (t) => I(t.clientX, t.clientY);
87
- return H(() => {
85
+ }, nt = (t) => {
86
+ if (t.length < 2) return 0;
87
+ const r = t[0], i = t[t.length - 1], e = i.time - r.time, n = i.x - r.x;
88
+ if (e === 0) return 0;
89
+ const s = n / e;
90
+ return Math.max(
91
+ -g.MAX_VELOCITY,
92
+ Math.min(g.MAX_VELOCITY, s)
93
+ );
94
+ }, b = O((t) => {
95
+ const r = o.current ? o.current.scrollWidth - o.current.clientWidth : 0;
96
+ return Math.max(0, Math.min(t, r));
97
+ }, []), A = O(
98
+ (t) => {
99
+ if (!o.current) return;
100
+ const r = b(t);
101
+ o.current.style.transition = "unset", o.current.style.transform = `translate3d(-${r}px, 0px, 0px)`, p.current = r;
102
+ },
103
+ [b]
104
+ ), ot = O(
105
+ (t) => {
106
+ c.current && cancelAnimationFrame(c.current);
107
+ let r = t * -1, i = p.current, e = performance.now();
108
+ const n = (s) => {
109
+ if (!o.current) return;
110
+ const d = s - e;
111
+ e = s, i = b(i + r * d);
112
+ const f = i <= 0, y = i >= o.current.scrollWidth - o.current.clientWidth;
113
+ (f && r < 0 || y && r > 0) && (r = 0), r *= g.FRICTION, A(i), Math.abs(r) > g.STOP_VELOCITY ? c.current = requestAnimationFrame(n) : c.current = void 0;
114
+ };
115
+ c.current = requestAnimationFrame(n);
116
+ },
117
+ [b, A]
118
+ ), _ = (t, r) => {
119
+ c.current && (cancelAnimationFrame(c.current), c.current = void 0), S.current = !1, Z(t), B(r), tt(p.current), T.current = [{ time: performance.now(), x: t }];
120
+ }, X = (t, r) => {
121
+ if (!u.current || !o.current) return;
122
+ u.current = !1, o.current.style.cursor = "grab";
123
+ const i = D - t, e = E - r;
124
+ t && Math.abs(i) < L && Math.abs(e) < L * 2 && (S.current = !0);
125
+ const n = nt(T.current);
126
+ T.current = [], c.current && (cancelAnimationFrame(c.current), c.current = void 0), !S.current && Math.abs(n) >= g.MIN_VELOCITY && ot(n);
127
+ }, it = (t) => {
128
+ h && (u.current = !0, _(t.clientX, t.clientY));
129
+ }, st = (t) => {
130
+ h && _(t.touches[0].clientX, t.touches[0].clientY);
131
+ }, k = (t) => X(t.changedTouches[0].clientX, t.changedTouches[0].clientY), V = (t) => X(t.clientX, t.clientY);
132
+ return C(() => {
88
133
  const t = () => {
89
134
  var r;
90
- if (s.current) {
91
- const i = s.current.querySelector(".indicator"), e = (r = s.current) == null ? void 0 : r.querySelectorAll(
135
+ if (o.current) {
136
+ const i = o.current.querySelector(".indicator"), e = (r = o.current) == null ? void 0 : r.querySelectorAll(
92
137
  '[role="tab"][data-selected="true"]'
93
138
  )[0];
94
- if (e && i && (i.style.width = `${e.clientWidth}px`, i.style.transform = `translate3d(${e.offsetLeft}px, 0px, 0px)`, g.current ? i.style.transition = "all 0.2s ease-in-out" : (i.style.transition = "unset", g.current = !0), V(e.getAttribute("data-disabled") === "true")), e && d) {
95
- const n = e.offsetLeft, a = e.offsetLeft + e.clientWidth, b = p.current, y = p.current + s.current.clientWidth;
96
- if (n < b || a > y) {
97
- const v = Math.min(
139
+ if (e && i && (i.style.width = `${e.clientWidth}px`, i.style.transform = `translate3d(${e.offsetLeft}px, 0px, 0px)`, x.current ? i.style.transition = "all 0.2s ease-in-out" : (i.style.transition = "unset", x.current = !0), Q(e.getAttribute("data-disabled") === "true")), e && h) {
140
+ const n = e.offsetLeft, s = e.offsetLeft + e.clientWidth, d = p.current, f = p.current + o.current.clientWidth;
141
+ if (n < d || s > f) {
142
+ const y = Math.min(
98
143
  n,
99
144
  Math.max(
100
- s.current.scrollWidth - s.current.clientWidth,
101
- s.current.scrollWidth - y
145
+ o.current.scrollWidth - o.current.clientWidth,
146
+ o.current.scrollWidth - f
102
147
  )
103
148
  );
104
- s.current.style.transition = "all 0.2s ease-in-out", s.current.style.transform = `translate3d(-${v}px, 0px, 0px)`, p.current = v;
149
+ o.current.style.transition = "all 0.2s ease-in-out", o.current.style.transform = `translate3d(-${y}px, 0px, 0px)`, p.current = y;
105
150
  }
106
151
  }
107
152
  }
@@ -109,72 +154,76 @@ const st = L.div`
109
154
  return t(), window.addEventListener("resize", t), () => {
110
155
  window.removeEventListener("resize", t);
111
156
  };
112
- }, [d, u, $]), H(() => {
113
- const t = s.current, r = (n, a, b) => {
114
- if (!s.current) return;
115
- const y = T - n, v = A - a;
116
- if (c.current = c.current || Math.abs(y) > S && Math.abs(v) < S * 2, c.current && b.cancelable && (b.preventDefault(), b.stopPropagation()), c.current) {
117
- let h = W + y;
118
- const F = s.current.scrollWidth - s.current.clientWidth;
119
- h < 0 ? h = 0 : h > F && (h = F), s.current && (f.current && cancelAnimationFrame(f.current), f.current = requestAnimationFrame(() => {
120
- s.current && (s.current.style.transition = "unset", s.current.style.transform = `translate3d(-${h}px, 0px, 0px)`, p.current = h, z.current = !1);
157
+ }, [h, m, $]), C(() => {
158
+ const t = o.current, r = (n, s, d) => {
159
+ if (!o.current) return;
160
+ const f = D - n, y = E - s;
161
+ if (u.current = u.current || Math.abs(f) > L && Math.abs(y) < L * 2, u.current && d.cancelable && (d.preventDefault(), d.stopPropagation()), u.current) {
162
+ const ct = b(N + f), q = performance.now();
163
+ T.current = [
164
+ ...T.current,
165
+ { time: q, x: n }
166
+ ].filter((at) => q - at.time <= g.SAMPLE_DURATION), o.current && (c.current && cancelAnimationFrame(c.current), c.current = requestAnimationFrame(() => {
167
+ o.current && (A(ct), o.current.style.cursor = "grabbing", G.current = !1);
121
168
  }));
122
169
  }
123
170
  }, i = (n) => {
124
- c.current && r(n.clientX, n.clientY, n);
171
+ u.current && r(n.clientX, n.clientY, n);
125
172
  }, e = (n) => {
126
- r(n.touches[0].clientX, n.touches[0].clientY, n);
173
+ n.stopPropagation(), r(n.touches[0].clientX, n.touches[0].clientY, n);
127
174
  };
128
175
  return t == null || t.addEventListener("mousemove", i), t == null || t.addEventListener("touchmove", e), () => {
129
176
  t == null || t.removeEventListener("mousemove", i), t == null || t.removeEventListener("touchmove", e);
130
177
  };
131
- }, [T, A, W]), /* @__PURE__ */ N(
132
- st,
178
+ }, [b, D, E, N, A]), C(() => () => {
179
+ c.current && cancelAnimationFrame(c.current);
180
+ }, []), /* @__PURE__ */ U(
181
+ ft,
133
182
  {
134
183
  className: "tab-wrapper",
135
- ref: P,
136
- scrollable: d,
137
- ...m,
138
- css: m == null ? void 0 : m.inlineCSS,
139
- children: /* @__PURE__ */ et(
140
- it,
184
+ ref: K,
185
+ scrollable: h,
186
+ ...v,
187
+ css: v == null ? void 0 : v.inlineCSS,
188
+ children: /* @__PURE__ */ ut(
189
+ mt,
141
190
  {
142
191
  className: "tab-list",
143
192
  role: "tablist",
144
- ref: s,
145
- isChipped: X,
146
- css: K,
147
- ...O,
148
- onMouseDown: B,
149
- onMouseUp: q,
150
- onMouseLeave: q,
151
- onTouchStart: tt,
152
- onTouchEnd: C,
153
- onTouchCancel: C,
193
+ ref: o,
194
+ isChipped: P,
195
+ css: H,
196
+ ...z,
197
+ onMouseDown: it,
198
+ onMouseUp: V,
199
+ onMouseLeave: V,
200
+ onTouchStart: st,
201
+ onTouchEnd: k,
202
+ onTouchCancel: k,
154
203
  children: [
155
- w.map(R, (t, r) => {
156
- var n, a;
157
- if (!M(t))
204
+ w.map(F, (t, r) => {
205
+ var n, s;
206
+ if (!I(t))
158
207
  return null;
159
- const i = u === t.props.value, e = Y || ((n = t.props) == null ? void 0 : n.disabled);
160
- return nt(t, {
208
+ const i = m === t.props.value, e = W || ((n = t.props) == null ? void 0 : n.disabled);
209
+ return dt(t, {
161
210
  ...t.props,
162
211
  className: `tab-block-${r}`,
163
212
  selected: i,
164
213
  "aria-selected": i,
165
214
  tabIndex: i ? 0 : -1,
166
- onClick: (a = t.props) != null && a.disabled ? void 0 : Q(t.props.value),
167
- onKeyDown: Z,
215
+ onClick: (s = t.props) != null && s.disabled ? void 0 : et(t.props.value),
216
+ onKeyDown: rt,
168
217
  disabled: e,
169
218
  size: $
170
219
  });
171
220
  }),
172
- /* @__PURE__ */ N(
173
- ot,
221
+ /* @__PURE__ */ U(
222
+ ht,
174
223
  {
175
224
  className: "indicator",
176
- disabled: Y || U,
177
- isChipped: X
225
+ disabled: W || J,
226
+ isChipped: P
178
227
  }
179
228
  )
180
229
  ]
@@ -184,5 +233,5 @@ const st = L.div`
184
233
  );
185
234
  });
186
235
  export {
187
- ut as default
236
+ gt as default
188
237
  };
@@ -1,11 +1,11 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("@emotion/react/jsx-runtime"),d=require("react"),p=require("../../Chip/Chip.cjs"),h=require("@emotion/styled"),b=e=>e&&e.__esModule?e:{default:e},x=b(h),y=x.default.div`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@emotion/react/jsx-runtime"),d=require("react"),m=require("../../Chip/Chip.cjs"),p=require("@emotion/styled"),x=t=>t&&t.__esModule?t:{default:t},h=x(p),y=h.default.div`
2
2
  display: flex;
3
3
  flex: 1;
4
4
  justify-content: center;
5
5
  align-items: center;
6
- padding: ${({theme:{spacing:e},size:t})=>t==="small"?`${e.content(2)}px ${e.content(3)}px`:`${e.content(3)}px ${e.content(4)}px`};
7
- border-bottom: ${({theme:e})=>`1px solid ${e.palette.grey[10]}`};
8
- cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
6
+ padding: ${({theme:{spacing:t},size:r})=>r==="small"?`${t.content(2)}px ${t.content(3)}px`:`${t.content(3)}px ${t.content(4)}px`};
7
+ border-bottom: ${({theme:t})=>`1px solid ${t.palette.grey[10]}`};
8
+ cursor: ${({disabled:t})=>t?"not-allowed":"pointer"};
9
9
 
10
- ${({theme:{typography:e,palette:t},size:r,selected:o,disabled:i})=>{if(o){const{size:n,weight:s,lineHeight:g,letterSpacing:m}=e[r==="medium"?"h4B":"h5B"];return{fontSize:n,fontWeight:s,lineHeight:g,letterSpacing:m,color:i?t.grey[30]:t.grey[100]}}const{size:f,weight:a,lineHeight:l,letterSpacing:u}=e[r==="medium"?"b2R":"b4R"];return{fontSize:f,fontWeight:a,lineHeight:l,letterSpacing:u,color:i?t.grey[30]:t.grey[70]}}}}
11
- `,$=d.forwardRef(function({size:t="medium",selected:r,disabled:o=!1,inlineCSS:i,children:f,onClick:a,...l},u){return c.jsx(c.Fragment,{children:d.Children.map(f,n=>{var s;return d.isValidElement(n)&&!Array.isArray((s=n==null?void 0:n.props)==null?void 0:s.children)?c.jsx(p.default,{tag:"button",role:"tab",ref:u,"data-shape":"chip","data-selected":r,disabled:o,variant:r?"filled":"outlined",selected:r,onClick:a,inlineCSS:i,...n.props,...l}):c.jsx(y,{as:"button",role:"tab",ref:u,size:t,disabled:o,selected:r,"data-selected":r,"data-disabled":o,onClick:a,css:i,...l,children:n})})})});exports.default=$;
10
+ ${({theme:{typography:t,palette:r},size:e,selected:o,disabled:a})=>{if(o){const{size:g,weight:n,lineHeight:c,letterSpacing:b}=t[e==="medium"?"h4B":"h5B"];return{fontSize:g,fontWeight:n,lineHeight:c,letterSpacing:b,color:a?r.grey[30]:r.grey[100]}}const{size:i,weight:u,lineHeight:l,letterSpacing:s}=t[e==="medium"?"b2R":"b4R"];return{fontSize:i,fontWeight:u,lineHeight:l,letterSpacing:s,color:a?r.grey[30]:r.grey[70]}}}}
11
+ `,$=d.forwardRef(function({size:r="medium",selected:e,disabled:o=!1,inlineCSS:a,children:i,onClick:u,...l},s){var g;return((g=d.Children.toArray(i))==null?void 0:g.length)!==1?f.jsx(y,{as:"button",role:"tab",ref:s,size:r,disabled:o,selected:e,"data-selected":e,"data-disabled":o,onClick:u,css:a,...l,children:i}):f.jsx(f.Fragment,{children:d.Children.map(i,n=>{var c;return d.isValidElement(n)&&n.type===m.default&&!Array.isArray((c=n==null?void 0:n.props)==null?void 0:c.children)?f.jsx(m.default,{tag:"button",role:"tab",ref:s,"data-shape":"chip","data-selected":e,disabled:o,variant:e?"filled":"outlined",selected:e,onClick:u,inlineCSS:a,...n.props,...l}):f.jsx(y,{as:"button",role:"tab",ref:s,size:r,disabled:o,selected:e,"data-selected":e,"data-disabled":o,onClick:u,css:a,...l,children:n})})})});exports.default=$;
@@ -1,84 +1,101 @@
1
- import { jsx as u, Fragment as c } from "@emotion/react/jsx-runtime";
2
- import { forwardRef as d, Children as h, isValidElement as b } from "react";
3
- import x from "../../Chip/Chip.es.js";
4
- import y from "@emotion/styled";
5
- const $ = y.div`
1
+ import { jsx as p, Fragment as h } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as x, Children as s, isValidElement as $ } from "react";
3
+ import y from "../../Chip/Chip.es.js";
4
+ import d from "@emotion/styled";
5
+ const b = d.div`
6
6
  display: flex;
7
7
  flex: 1;
8
8
  justify-content: center;
9
9
  align-items: center;
10
- padding: ${({ theme: { spacing: t }, size: e }) => e === "small" ? `${t.content(2)}px ${t.content(3)}px` : `${t.content(3)}px ${t.content(4)}px`};
10
+ padding: ${({ theme: { spacing: t }, size: r }) => r === "small" ? `${t.content(2)}px ${t.content(3)}px` : `${t.content(3)}px ${t.content(4)}px`};
11
11
  border-bottom: ${({ theme: t }) => `1px solid ${t.palette.grey[10]}`};
12
12
  cursor: ${({ disabled: t }) => t ? "not-allowed" : "pointer"};
13
13
 
14
- ${({ theme: { typography: t, palette: e }, size: r, selected: o, disabled: i }) => {
15
- if (o) {
14
+ ${({ theme: { typography: t, palette: r }, size: e, selected: n, disabled: a }) => {
15
+ if (n) {
16
16
  const {
17
- size: n,
18
- weight: f,
19
- lineHeight: p,
20
- letterSpacing: s
21
- } = t[r === "medium" ? "h4B" : "h5B"];
17
+ size: u,
18
+ weight: o,
19
+ lineHeight: l,
20
+ letterSpacing: c
21
+ } = t[e === "medium" ? "h4B" : "h5B"];
22
22
  return {
23
- fontSize: n,
24
- fontWeight: f,
25
- lineHeight: p,
26
- letterSpacing: s,
27
- color: i ? e.grey[30] : e.grey[100]
23
+ fontSize: u,
24
+ fontWeight: o,
25
+ lineHeight: l,
26
+ letterSpacing: c,
27
+ color: a ? r.grey[30] : r.grey[100]
28
28
  };
29
29
  }
30
30
  const {
31
- size: g,
32
- weight: a,
33
- lineHeight: l,
34
- letterSpacing: m
35
- } = t[r === "medium" ? "b2R" : "b4R"];
31
+ size: i,
32
+ weight: m,
33
+ lineHeight: f,
34
+ letterSpacing: g
35
+ } = t[e === "medium" ? "b2R" : "b4R"];
36
36
  return {
37
- fontSize: g,
38
- fontWeight: a,
39
- lineHeight: l,
40
- letterSpacing: m,
41
- color: i ? e.grey[30] : e.grey[70]
37
+ fontSize: i,
38
+ fontWeight: m,
39
+ lineHeight: f,
40
+ letterSpacing: g,
41
+ color: a ? r.grey[30] : r.grey[70]
42
42
  };
43
43
  }}}
44
- `, H = d(function({ size: e = "medium", selected: r, disabled: o = !1, inlineCSS: i, children: g, onClick: a, ...l }, m) {
45
- return /* @__PURE__ */ u(c, { children: h.map(g, (n) => {
46
- var f;
47
- return b(n) && !Array.isArray((f = n == null ? void 0 : n.props) == null ? void 0 : f.children) ? /* @__PURE__ */ u(
48
- x,
44
+ `, z = x(function({ size: r = "medium", selected: e, disabled: n = !1, inlineCSS: a, children: i, onClick: m, ...f }, g) {
45
+ var u;
46
+ return ((u = s.toArray(i)) == null ? void 0 : u.length) !== 1 ? /* @__PURE__ */ p(
47
+ b,
48
+ {
49
+ as: "button",
50
+ role: "tab",
51
+ ref: g,
52
+ size: r,
53
+ disabled: n,
54
+ selected: e,
55
+ "data-selected": e,
56
+ "data-disabled": n,
57
+ onClick: m,
58
+ css: a,
59
+ ...f,
60
+ children: i
61
+ }
62
+ ) : /* @__PURE__ */ p(h, { children: s.map(i, (o) => {
63
+ var l;
64
+ return $(o) && o.type === y && !Array.isArray((l = o == null ? void 0 : o.props) == null ? void 0 : l.children) ? /* @__PURE__ */ p(
65
+ y,
49
66
  {
50
67
  tag: "button",
51
68
  role: "tab",
52
- ref: m,
69
+ ref: g,
53
70
  "data-shape": "chip",
54
- "data-selected": r,
55
- disabled: o,
56
- variant: r ? "filled" : "outlined",
57
- selected: r,
58
- onClick: a,
59
- inlineCSS: i,
60
- ...n.props,
61
- ...l
71
+ "data-selected": e,
72
+ disabled: n,
73
+ variant: e ? "filled" : "outlined",
74
+ selected: e,
75
+ onClick: m,
76
+ inlineCSS: a,
77
+ ...o.props,
78
+ ...f
62
79
  }
63
- ) : /* @__PURE__ */ u(
64
- $,
80
+ ) : /* @__PURE__ */ p(
81
+ b,
65
82
  {
66
83
  as: "button",
67
84
  role: "tab",
68
- ref: m,
69
- size: e,
70
- disabled: o,
71
- selected: r,
72
- "data-selected": r,
73
- "data-disabled": o,
74
- onClick: a,
75
- css: i,
76
- ...l,
77
- children: n
85
+ ref: g,
86
+ size: r,
87
+ disabled: n,
88
+ selected: e,
89
+ "data-selected": e,
90
+ "data-disabled": n,
91
+ onClick: m,
92
+ css: a,
93
+ ...f,
94
+ children: o
78
95
  }
79
96
  );
80
97
  }) });
81
98
  });
82
99
  export {
83
- H as default
100
+ z as default
84
101
  };
@@ -34,3 +34,4 @@ export declare const PasswordVisibility: Story;
34
34
  export declare const Success: Story;
35
35
  export declare const Error: Story;
36
36
  export declare const WithScreenReaderSupport: Story;
37
+ export declare const withUseForm: Story;
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("@emotion/react/jsx-runtime"),s=require("react"),y=require("../Flexbox/Flexbox.cjs"),j=require("../Icon/Icon.cjs"),X=require("../Typography/Typography.cjs"),N=require("../hooks/useCheckKeyboardMode/useCheckKeyboardMode.cjs"),F=require("@emotion/styled"),H=t=>t&&t.__esModule?t:{default:t},q=H(F),V=q.default.div`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("@emotion/react/jsx-runtime"),p=require("react"),y=require("../Flexbox/Flexbox.cjs"),q=require("../Icon/Icon.cjs"),X=require("../Typography/Typography.cjs"),N=require("../hooks/useCheckKeyboardMode/useCheckKeyboardMode.cjs"),F=require("@emotion/styled"),W=t=>t&&t.__esModule?t:{default:t},E=W(F),V=E.default.div`
2
2
  position: relative;
3
3
  display: inline-block;
4
4
  &[open] > [role='dialog'] {
5
5
  display: flex;
6
6
  }
7
- `,W=q.default.div`
7
+ `,G=E.default.div`
8
8
  position: absolute;
9
9
  display: none;
10
10
  flex-direction: column;
@@ -19,9 +19,14 @@
19
19
  white-space: nowrap;
20
20
  word-break: break-all;
21
21
 
22
- ${({theme:{palette:{brand:t,grey:r}},color:m})=>{let e={};return m==="primary"&&(e={backgroundColor:t.primary.tooltip,color:r[100]}),m==="secondary"&&(e={backgroundColor:r[80],color:r.white}),e}}
22
+ & svg:not(.tooltip-closer) {
23
+ width: 24,
24
+ height: 24
25
+ }
26
+
27
+ ${({theme:{palette:{brand:t,grey:e}},color:x})=>{if(x==="primary")return{backgroundColor:t.primary.tooltip,color:e[100]};if(x==="secondary")return{backgroundColor:e[80],color:e.white}}}
23
28
 
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}})};
29
+ ${({size:t,theme:{typography:e,spacing:x}})=>{if(t==="small")return{fontSize:e.c3R.size,fontWeight:e.c3R.weight,lineHeight:e.c3R.lineHeight,letterSpacing:e.c3R.letterSpacing,padding:x.content(2)};if(t==="medium")return{fontSize:e.b4R.size,fontWeight:e.b4R.weight,lineHeight:e.b4R.lineHeight,letterSpacing:e.b4R.letterSpacing,padding:x.content(3)}}};
25
30
 
26
- ${({theme:{palette:{brand:t,grey:r}},placement:m,color:e,offset:c,arrowOffset:d})=>{let o={};const n=(c==null?void 0:c.x)||0,l=(c==null?void 0:c.y)||0,p=(d==null?void 0:d.x)||0,a=(d==null?void 0:d.y)||0;switch(m){case"bottom-left":o={top:`calc(-12px + ${l}px)`,left:`calc(-6px + ${n}px)`,transform:"translateY(-100%)","&:after":{content:'""',position:"absolute",top:"100%",left:`calc(12px + ${p}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 + ${l}px)`,left:"50%",transform:`translate(calc(-50% + ${n}px), -100%)`,"&:after":{content:'""',position:"absolute",top:"100%",left:`calc(50% + ${p}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 + ${l}px)`,right:`calc(-6px - ${n}px)`,transform:"translateY(-100%)","&:after":{content:'""',position:"absolute",top:"100%",right:`calc(12px - ${p}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 + ${l}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% + ${l}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 - ${l}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 + ${l}px))`,"&:after":{content:'""',position:"absolute",bottom:"100%",left:`calc(12px + ${p}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 + ${l}px))`,"&:after":{content:'""',position:"absolute",bottom:"100%",left:`calc(50% + ${p}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 + ${l}px))`,"&:after":{content:'""',position:"absolute",bottom:"100%",right:`calc(12px - ${p}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 + ${l}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% + ${l}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 - ${l}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
- `,G=s.forwardRef(function({children:r,placement:m="bottom-center",color:e="primary",title:c,body:d,closer:o,endAdornment:n,inlineCSS:l,open:p=!1,onClose:a,wrapperProps:g,offset:E,arrowOffset:K,...x},Y){const C=s.useId(),D=s.useId(),_=s.useId(),{isKeyboardMode:k}=N.default(),S=s.useRef(null),R=s.useRef(null),I=s.useRef(!0),[z,M]=s.useState(!1),B=(x==null?void 0:x.id)||C,L=(x==null?void 0:x.titleId)||D,T=(x==null?void 0:x.bodyId)||_,w=i=>{(i.key==="Enter"||i.key===" ")&&(a==null||a(i))};return s.useEffect(()=>{R.current&&R.current.getBoundingClientRect().width>=276&&M(!0)},[p]),s.useEffect(()=>{const i=b=>{b.key==="Escape"&&p&&(b.stopPropagation(),a==null||a(b))};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[p,a]),s.useEffect(()=>{var b,h,f;if(I.current){I.current=!1;return}if(p){const $=(b=S.current)==null?void 0:b.querySelector('.tooltip-closer[role="button"]');if($&&k&&$.focus(),!$){const v=(h=S.current)==null?void 0:h.querySelector('[role="button"]');v&&k&&v.focus()}return}const i=(f=S.current)==null?void 0:f.querySelector('[role="button"]');i&&k&&i.focus()},[p,k]),u.jsxs(V,{ref:S,open:p,...g,css:g==null?void 0:g.inlineCSS,children:[s.Children.map(r,i=>{if(!s.isValidElement(i))return i;const b=h=>{var f,$;(h.key==="Enter"||h.key===" ")&&(($=(f=i.props)==null?void 0:f.onClick)==null||$.call(f,h))};return s.cloneElement(i,{inlineCSS:{cursor:"pointer","&:active":{outline:"none"},...i.props.inlineCSS},role:"button",tabIndex:0,"aria-hidden":!1,"aria-expanded":p,"aria-haspopup":"dialog","aria-controls":B,focusable:!0,onKeyDown:b,...i.props})}),u.jsxs(W,{id:B,className:"tooltip",role:"dialog","aria-modal":"true","aria-labelledby":c?L:T,"aria-describedby":d?T:void 0,ref:Y,placement:m,color:e,offset:E,arrowOffset:K,...x,css:l,children:[c&&u.jsxs(y.default,{alignItems:"center",justifyContent:"space-between",gap:2,children:[u.jsx(X.default,{id:L,variant:"h5B",color:e==="primary"?"grey.100":"grey.white",children:c}),o&&u.jsx(y.default,{flexShrink:0,children:u.jsx(j.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:w,"aria-label":"닫기",inlineCSS:{marginLeft:"2px",cursor:"pointer","&:active":{outline:"none"}}})})]}),d&&u.jsxs(y.default,{id:T,alignItems:"center",gap:2,ref:R,style:z?{width:"276px",whiteSpace:"wrap"}:{},children:[d,n&&u.jsx(y.default,{flexShrink:0,inlineCSS:{fontSize:"24px"},children:n}),!c&&o&&u.jsx(y.default,{flexShrink:0,children:u.jsx(j.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:w,"aria-label":"닫기",inlineCSS:{marginLeft:"2px",cursor:"pointer","&:active":{outline:"none"}}})})]})]})]})});exports.default=G;
31
+ ${({theme:{palette:{brand:t,grey:e}},placement:x,color:r,offset:u,arrowOffset:s})=>{let o={};const i=(u==null?void 0:u.x)||0,n=(u==null?void 0:u.y)||0,f=(s==null?void 0:s.x)||0,l=(s==null?void 0:s.y)||0;switch(x){case"bottom-left":o={top:`calc(-12px + ${n}px)`,left:`calc(-6px + ${i}px)`,transform:"translateY(-100%)","&:after":{content:'""',position:"absolute",top:"100%",left:`calc(12px + ${f}px)`,borderTop:`8px solid ${r==="primary"?t.primary.tooltip:e[80]}`,borderRight:"6px solid transparent",borderBottom:"8px solid transparent",borderLeft:"6px solid transparent"}};break;case"bottom-center":o={top:`calc(-12px + ${n}px)`,left:"50%",transform:`translate(calc(-50% + ${i}px), -100%)`,"&:after":{content:'""',position:"absolute",top:"100%",left:`calc(50% + ${f}px)`,transform:"translateX(-50%)",borderTop:`8px solid ${r==="primary"?t.primary.tooltip:e[80]}`,borderRight:"6px solid transparent",borderBottom:"8px solid transparent",borderLeft:"6px solid transparent"}};break;case"bottom-right":o={top:`calc(-12px + ${n}px)`,right:`calc(-6px - ${i}px)`,transform:"translateY(-100%)","&:after":{content:'""',position:"absolute",top:"100%",right:`calc(12px - ${f}px)`,borderTop:`8px solid ${r==="primary"?t.primary.tooltip:e[80]}`,borderRight:"6px solid transparent",borderBottom:"8px solid transparent",borderLeft:"6px solid transparent"}};break;case"left-top":o={top:`calc(-6px + ${n}px)`,left:`calc(100% + 12px + ${i}px)`,"&:after":{content:'""',position:"absolute",top:`calc(12px + ${l}px)`,right:"100%",borderTop:"6px solid transparent",borderRight:`8px solid ${r==="primary"?t.primary.tooltip:e[80]}`,borderBottom:"6px solid transparent",borderLeft:"8px solid transparent"}};break;case"left-middle":o={top:"50%",left:`calc(100% + 12px + ${i}px)`,transform:`translateY(calc(-50% + ${n}px))`,"&:after":{content:'""',position:"absolute",top:`calc(50% + ${l}px)`,right:"100%",transform:"translateY(-50%)",borderTop:"6px solid transparent",borderRight:`8px solid ${r==="primary"?t.primary.tooltip:e[80]}`,borderBottom:"6px solid transparent",borderLeft:"8px solid transparent"}};break;case"left-bottom":o={bottom:`calc(-6px - ${n}px)`,left:`calc(100% + 12px + ${i}px)`,"&:after":{content:'""',position:"absolute",bottom:`calc(12px - ${l}px)`,right:"100%",borderTop:"6px solid transparent",borderRight:`8px solid ${r==="primary"?t.primary.tooltip:e[80]}`,borderBottom:"6px solid transparent",borderLeft:"8px solid transparent"}};break;case"top-left":o={left:`calc(-6px + ${i}px)`,transform:`translate(0, calc(12px + ${n}px))`,"&:after":{content:'""',position:"absolute",bottom:"100%",left:`calc(12px + ${f}px)`,borderTop:"8px solid transparent",borderRight:"6px solid transparent",borderBottom:`8px solid ${r==="primary"?t.primary.tooltip:e[80]}`,borderLeft:"6px solid transparent"}};break;case"top-center":o={right:"50%",transform:`translate(calc(50% + ${i}px), calc(12px + ${n}px))`,"&:after":{content:'""',position:"absolute",bottom:"100%",left:`calc(50% + ${f}px)`,transform:"translateX(-50%)",borderTop:"8px solid transparent",borderRight:"6px solid transparent",borderBottom:`8px solid ${r==="primary"?t.primary.tooltip:e[80]}`,borderLeft:"6px solid transparent"}};break;case"top-right":o={right:`calc(-6px - ${i}px)`,transform:`translate(0, calc(12px + ${n}px))`,"&:after":{content:'""',position:"absolute",bottom:"100%",right:`calc(12px - ${f}px)`,borderTop:"8px solid transparent",borderRight:"6px solid transparent",borderBottom:`8px solid ${r==="primary"?t.primary.tooltip:e[80]}`,borderLeft:"6px solid transparent"}};break;case"right-top":o={top:`calc(-6px + ${n}px)`,right:`calc(100% + 12px + ${i}px)`,"&:after":{content:'""',position:"absolute",top:`calc(12px + ${l}px)`,left:"100%",borderTop:"6px solid transparent",borderRight:"8px solid transparent",borderBottom:"6px solid transparent",borderLeft:`8px solid ${r==="primary"?t.primary.tooltip:e[80]}`}};break;case"right-middle":o={top:"50%",right:`calc(100% + 12px + ${i}px)`,transform:`translateY(calc(-50% + ${n}px))`,"&:after":{content:'""',position:"absolute",top:`calc(50% + ${l}px)`,left:"100%",transform:"translateY(-50%)",borderTop:"6px solid transparent",borderRight:"8px solid transparent",borderBottom:"6px solid transparent",borderLeft:`8px solid ${r==="primary"?t.primary.tooltip:e[80]}`}};break;case"right-bottom":o={bottom:`calc(-6px - ${n}px)`,right:`calc(100% + 12px + ${i}px)`,"&:after":{content:'""',position:"absolute",bottom:`calc(12px - ${l}px)`,left:"100%",borderTop:"6px solid transparent",borderRight:"8px solid transparent",borderBottom:"6px solid transparent",borderLeft:`8px solid ${r==="primary"?t.primary.tooltip:e[80]}`}};break}return o}};
32
+ `,J=p.forwardRef(function({children:e,placement:x="bottom-center",color:r="primary",size:u="medium",title:s,body:o,closer:i,endAdornment:n,inlineCSS:f,open:l=!1,onClose:b,wrapperProps:S,offset:K,arrowOffset:Y,...c},C){const D=p.useId(),_=p.useId(),z=p.useId(),{isKeyboardMode:k}=N.default(),R=p.useRef(null),T=p.useRef(null),I=p.useRef(!0),[M,H]=p.useState(!1),w=(c==null?void 0:c.id)||D,L=(c==null?void 0:c.titleId)||_,B=(c==null?void 0:c.bodyId)||z,v=a=>{(a.key==="Enter"||a.key===" ")&&(b==null||b(a))};return p.useEffect(()=>{T.current&&T.current.getBoundingClientRect().width>=276&&H(!0)},[l]),p.useEffect(()=>{const a=m=>{m.key==="Escape"&&l&&(m.stopPropagation(),b==null||b(m))};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[l,b]),p.useEffect(()=>{var m,$,h;if(I.current){I.current=!1;return}if(l){const g=(m=R.current)==null?void 0:m.querySelector('.tooltip-closer[role="button"]');if(g&&k&&g.focus(),!g){const j=($=R.current)==null?void 0:$.querySelector('[role="button"]');j&&k&&j.focus()}return}const a=(h=R.current)==null?void 0:h.querySelector('[role="button"]');a&&k&&a.focus()},[l,k]),d.jsxs(V,{ref:R,open:l,...S,css:S==null?void 0:S.inlineCSS,children:[p.Children.map(e,a=>{if(!p.isValidElement(a))return a;const m=$=>{var h,g;($.key==="Enter"||$.key===" ")&&((g=(h=a.props)==null?void 0:h.onClick)==null||g.call(h,$))};return p.cloneElement(a,{inlineCSS:{cursor:"pointer","&:active":{outline:"none"},...a.props.inlineCSS},role:"button",tabIndex:0,"aria-hidden":!1,"aria-expanded":l,"aria-haspopup":"dialog","aria-controls":w,focusable:!0,onKeyDown:m,...a.props})}),d.jsxs(G,{id:w,className:"tooltip",role:"dialog","aria-modal":"true","aria-labelledby":s?L:B,"aria-describedby":o?B:void 0,size:u,ref:C,placement:x,color:r,offset:K,arrowOffset:Y,...c,css:f,children:[s&&d.jsxs(y.default,{alignItems:"center",justifyContent:"space-between",gap:2,children:[d.jsx(X.default,{id:L,variant:u==="medium"?"h5B":"c3B",color:r==="primary"?"grey.100":"grey.white",children:s}),i&&d.jsx(y.default,{flexShrink:0,children:d.jsx(q.default,{className:"tooltip-closer",name:"CloseLine",size:"xSmall",color:r==="primary"?"grey.100":"grey.white",role:"button","aria-hidden":"false",focusable:"true",tabIndex:0,onClick:b,onKeyDown:v,"aria-label":"닫기",inlineCSS:{marginLeft:"2px",cursor:"pointer","&:active":{outline:"none"}}})})]}),o&&d.jsxs(y.default,{id:B,alignItems:"center",gap:2,ref:T,style:M?{width:"276px",whiteSpace:"wrap"}:{},children:[o,n&&d.jsx(y.default,{flexShrink:0,inlineCSS:{fontSize:"24px"},children:n}),!s&&i&&d.jsx(y.default,{flexShrink:0,children:d.jsx(q.default,{className:"tooltip-closer",name:"CloseLine",size:"xSmall",color:r==="primary"?"grey.100":"grey.white",role:"button","aria-hidden":"false",focusable:"true",tabIndex:0,onClick:b,onKeyDown:v,"aria-label":"닫기",inlineCSS:{marginLeft:"2px",cursor:"pointer","&:active":{outline:"none"}}})})]})]})]})});exports.default=J;
@@ -1,6 +1,6 @@
1
1
  import { HTMLAttributes, ReactNode, SyntheticEvent } from 'react';
2
2
  import { BrandColorKey } from '../typings/color';
3
- import { GeneralComponentProps } from '../typings/component';
3
+ import { GeneralComponentProps, Size } from '../typings/component';
4
4
 
5
5
  export interface TooltipOffset {
6
6
  x?: number;
@@ -12,6 +12,7 @@ export interface TooltipProps extends GeneralComponentProps<Omit<HTMLAttributes<
12
12
  title?: ReactNode;
13
13
  body?: ReactNode;
14
14
  endAdornment?: ReactNode;
15
+ size?: Extract<Size, 'small' | 'medium'>;
15
16
  open?: boolean;
16
17
  closer?: boolean;
17
18
  onClose?: (e: SyntheticEvent) => void;