@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,11 +1,11 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("@emotion/react/jsx-runtime"),i=require("react"),_=require("../Icon/Icon.cjs"),q=require("../utils/convertNumberToCSSValue.cjs"),C=require("@emotion/styled"),T=e=>e&&e.__esModule?e:{default:e},c=T(C),k=c.default.div`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("@emotion/react/jsx-runtime"),l=require("react"),z=require("../Icon/Icon.cjs"),A=require("../utils/convertNumberToCSSValue.cjs"),D=require("@emotion/styled"),L=e=>e&&e.__esModule?e:{default:e},s=L(D),N=s.default.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  border-radius: 12px;
5
5
  background-color: ${({theme:{palette:{grey:e,background:n}},disabled:t})=>t?n.secondary:e.white};
6
6
 
7
7
  ${({fullWidth:e})=>e?{width:"100%"}:null};
8
- `,z=c.default.div`
8
+ `,O=s.default.div`
9
9
  display: flex;
10
10
  align-items: center;
11
11
  justify-content: space-between;
@@ -14,21 +14,27 @@
14
14
  cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
15
15
 
16
16
  ${({theme:{palette:{grey:e},typography:{h5M:n}},disabled:t})=>({fontSize:n.size,fontWeight:n.weight,lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,color:t?e[50]:e[70],"& svg":{color:t?e[50]:e[70]}})};
17
- `,A=c.default.button`
17
+ `,V=s.default.button`
18
18
  display: flex;
19
19
  align-items: center;
20
20
  justify-content: space-between;
21
21
  gap: ${({theme:{spacing:e}})=>e.content(2)}px;
22
22
  padding: ${({theme:{spacing:e}})=>e.content(4)}px;
23
- `,D=c.default.div`
23
+
24
+ &[aria-disabled='true'] {
25
+ cursor: not-allowed;
26
+ }
27
+
28
+ ${({fullWidth:e})=>e?{width:"100%"}:null};
29
+ `,F=s.default.div`
24
30
  display: inline-flex;
25
31
  align-items: center;
26
32
  justify-content: center;
27
33
  transition: transform 0.2s;
28
34
  transform: rotate(${({expand:e})=>e?"180deg":"0deg"});
29
- `,B=c.default.div`
35
+ `,G=s.default.div`
30
36
  transition: height 0.2s;
31
37
  overflow: hidden;
32
- `,L=c.default.div`
38
+ `,J=s.default.div`
33
39
  padding: ${({theme:{spacing:e}})=>`0 ${e.content(4)}px ${e.content(4)}px ${e.content(4)}px`};
34
- `,N=i.forwardRef(function({children:n,expand:t=!1,title:S,endAdornment:v,onChange:h,disabled:u=!1,inlineCSS:E,headerProps:d,...w},I){const m=i.useId(),x=i.useId(),[r,g]=i.useState(t),[f,p]=i.useState(t?"auto":"0px"),o=i.useRef(null),b=s=>{u||(typeof h=="function"?h(s):g(a=>!a))};return i.useEffect(()=>{g(t)},[t]),i.useEffect(()=>{var y,$;let s;const a=q.default(((y=o.current)==null?void 0:y.scrollHeight)||0),H=!r&&f==="auto",R=!r&&f!=="auto";return($=o.current)!=null&&$.parentElement&&(r?(o.current.parentElement.style.height=a,s=setTimeout(()=>{var j;p("auto"),(j=o.current)!=null&&j.parentElement&&(o.current.parentElement.style.height="auto")},200)):H?(o.current.parentElement.style.height=a,p(a)):R&&(o.current.parentElement.style.height="0px",p("0px"))),()=>{s&&clearTimeout(s)}},[r,f]),l.jsxs(k,{ref:I,disabled:u,...w,css:E,children:[l.jsx(z,{as:(d==null?void 0:d.tag)||"h3",onClick:b,disabled:u,...d,children:l.jsxs(A,{id:m,"aria-disabled":u,"aria-expanded":r,"aria-controls":x,children:[S,l.jsx(D,{expand:r,children:v||l.jsx(_.default,{name:"ChevronDownLine",size:"xSmall"})})]})}),l.jsx(B,{children:l.jsx(L,{role:"region",id:x,"aria-labelledby":m,ref:o,children:n})})]})});exports.default=N;
40
+ `,K=l.forwardRef(function({children:n,expand:t=!1,title:I,endAdornment:E,onChange:g,disabled:u=!1,inlineCSS:b,fullWidth:p=!1,headerProps:d,headerButtonProps:f,panelProps:m,...H},R){const _=l.useId(),q=l.useId(),y=(f==null?void 0:f.id)||_,$=(m==null?void 0:m.id)||q,[c,j]=l.useState(t),[h,x]=l.useState(t?"auto":"0px"),i=l.useRef(null),C=r=>{u||(typeof g=="function"?g(r):j(a=>!a))};return l.useEffect(()=>{j(t)},[t]),l.useEffect(()=>{var S,v;let r;const a=A.default(((S=i.current)==null?void 0:S.scrollHeight)||0),T=!c&&h==="auto",k=!c&&h!=="auto";return(v=i.current)!=null&&v.parentElement&&(c?(i.current.parentElement.style.height=a,r=setTimeout(()=>{var w;x("auto"),(w=i.current)!=null&&w.parentElement&&(i.current.parentElement.style.height="auto")},200)):T?(i.current.parentElement.style.height=a,x(a)):k&&(i.current.parentElement.style.height="0px",x("0px"))),()=>{r&&clearTimeout(r)}},[c,h]),o.jsxs(N,{ref:R,disabled:u,fullWidth:p,...H,css:b,children:[o.jsx(O,{as:(d==null?void 0:d.tag)||"h3",onClick:C,disabled:u,...d,children:o.jsxs(V,{id:y,"aria-disabled":u,"aria-expanded":c,"aria-controls":$,fullWidth:p,...f,children:[I,o.jsx(F,{expand:c,children:E||o.jsx(z.default,{name:"ChevronDownLine",size:"xSmall"})})]})}),o.jsx(G,{children:o.jsx(J,{role:"region",id:$,"aria-labelledby":y,ref:i,...m,children:n})})]})});exports.default=K;
@@ -9,6 +9,8 @@ export interface AccordionProps extends Omit<GeneralComponentProps<HTMLAttribute
9
9
  fullWidth?: boolean;
10
10
  disabled?: boolean;
11
11
  headerProps?: PolymorphicComponentProps<ElementType>;
12
+ headerButtonProps?: HTMLAttributes<HTMLButtonElement>;
13
+ panelProps?: HTMLAttributes<HTMLDivElement>;
12
14
  }
13
15
  declare const Accordion: import('react').ForwardRefExoticComponent<AccordionProps & import('react').RefAttributes<HTMLDivElement>>;
14
16
  export default Accordion;
@@ -1,115 +1,136 @@
1
- import { jsxs as v, jsx as s } from "@emotion/react/jsx-runtime";
2
- import { forwardRef as z, useId as w, useState as E, useRef as A, useEffect as S } from "react";
3
- import B from "../Icon/Icon.es.js";
4
- import D from "../utils/convertNumberToCSSValue.es.js";
5
- import r from "@emotion/styled";
6
- const L = r.div`
1
+ import { jsxs as E, jsx as a } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as V, useId as S, useState as H, useRef as q, useEffect as b } from "react";
3
+ import F from "../Icon/Icon.es.js";
4
+ import G from "../utils/convertNumberToCSSValue.es.js";
5
+ import c from "@emotion/styled";
6
+ const J = c.div`
7
7
  display: flex;
8
8
  flex-direction: column;
9
9
  border-radius: 12px;
10
10
  background-color: ${({
11
11
  theme: {
12
- palette: { grey: e, background: n }
12
+ palette: { grey: t, background: n }
13
13
  },
14
- disabled: t
15
- }) => t ? n.secondary : e.white};
14
+ disabled: e
15
+ }) => e ? n.secondary : t.white};
16
16
 
17
- ${({ fullWidth: e }) => e ? { width: "100%" } : null};
18
- `, N = r.div`
17
+ ${({ fullWidth: t }) => t ? { width: "100%" } : null};
18
+ `, K = c.div`
19
19
  display: flex;
20
20
  align-items: center;
21
21
  justify-content: space-between;
22
- min-height: calc(24px + (${({ theme: { spacing: e } }) => e.content(4)}px * 2));
23
- gap: ${({ theme: { spacing: e } }) => e.content(2)}px;
24
- cursor: ${({ disabled: e }) => e ? "not-allowed" : "pointer"};
22
+ min-height: calc(24px + (${({ theme: { spacing: t } }) => t.content(4)}px * 2));
23
+ gap: ${({ theme: { spacing: t } }) => t.content(2)}px;
24
+ cursor: ${({ disabled: t }) => t ? "not-allowed" : "pointer"};
25
25
 
26
26
  ${({
27
27
  theme: {
28
- palette: { grey: e },
28
+ palette: { grey: t },
29
29
  typography: { h5M: n }
30
30
  },
31
- disabled: t
31
+ disabled: e
32
32
  }) => ({
33
33
  fontSize: n.size,
34
34
  fontWeight: n.weight,
35
35
  lineHeight: n.lineHeight,
36
36
  letterSpacing: n.letterSpacing,
37
- color: t ? e[50] : e[70],
37
+ color: e ? t[50] : t[70],
38
38
  "& svg": {
39
- color: t ? e[50] : e[70]
39
+ color: e ? t[50] : t[70]
40
40
  }
41
41
  })};
42
- `, V = r.button`
42
+ `, O = c.button`
43
43
  display: flex;
44
44
  align-items: center;
45
45
  justify-content: space-between;
46
- gap: ${({ theme: { spacing: e } }) => e.content(2)}px;
47
- padding: ${({ theme: { spacing: e } }) => e.content(4)}px;
48
- `, W = r.div`
46
+ gap: ${({ theme: { spacing: t } }) => t.content(2)}px;
47
+ padding: ${({ theme: { spacing: t } }) => t.content(4)}px;
48
+
49
+ &[aria-disabled='true'] {
50
+ cursor: not-allowed;
51
+ }
52
+
53
+ ${({ fullWidth: t }) => t ? { width: "100%" } : null};
54
+ `, Q = c.div`
49
55
  display: inline-flex;
50
56
  align-items: center;
51
57
  justify-content: center;
52
58
  transition: transform 0.2s;
53
- transform: rotate(${({ expand: e }) => e ? "180deg" : "0deg"});
54
- `, q = r.div`
59
+ transform: rotate(${({ expand: t }) => t ? "180deg" : "0deg"});
60
+ `, U = c.div`
55
61
  transition: height 0.2s;
56
62
  overflow: hidden;
57
- `, F = r.div`
58
- padding: ${({ theme: { spacing: e } }) => `0 ${e.content(4)}px ${e.content(4)}px ${e.content(4)}px`};
59
- `, U = z(function({
63
+ `, W = c.div`
64
+ padding: ${({ theme: { spacing: t } }) => `0 ${t.content(4)}px ${t.content(4)}px ${t.content(4)}px`};
65
+ `, M = V(function({
60
66
  children: n,
61
- expand: t = !1,
62
- title: I,
63
- endAdornment: H,
64
- onChange: p,
65
- disabled: a = !1,
66
- inlineCSS: b,
67
+ expand: e = !1,
68
+ title: j,
69
+ endAdornment: C,
70
+ onChange: g,
71
+ disabled: s = !1,
72
+ inlineCSS: R,
73
+ fullWidth: p = !1,
67
74
  headerProps: d,
68
- ...j
69
- }, C) {
70
- const m = w(), h = w(), [i, g] = E(t), [f, u] = E(t ? "auto" : "0px"), o = A(null), R = (c) => {
71
- a || (typeof p == "function" ? p(c) : g((l) => !l));
75
+ headerButtonProps: f,
76
+ panelProps: u,
77
+ ...T
78
+ }, k) {
79
+ const z = S(), A = S(), x = (f == null ? void 0 : f.id) || z, y = (u == null ? void 0 : u.id) || A, [o, $] = H(e), [m, h] = H(e ? "auto" : "0px"), i = q(null), D = (l) => {
80
+ s || (typeof g == "function" ? g(l) : $((r) => !r));
72
81
  };
73
- return S(() => {
74
- g(t);
75
- }, [t]), S(() => {
76
- var x, y;
77
- let c;
78
- const l = D(
79
- ((x = o.current) == null ? void 0 : x.scrollHeight) || 0
80
- ), T = !i && f === "auto", k = !i && f !== "auto";
81
- return (y = o.current) != null && y.parentElement && (i ? (o.current.parentElement.style.height = l, c = setTimeout(() => {
82
- var $;
83
- u("auto"), ($ = o.current) != null && $.parentElement && (o.current.parentElement.style.height = "auto");
84
- }, 200)) : T ? (o.current.parentElement.style.height = l, u(l)) : k && (o.current.parentElement.style.height = "0px", u("0px"))), () => {
85
- c && clearTimeout(c);
82
+ return b(() => {
83
+ $(e);
84
+ }, [e]), b(() => {
85
+ var w, I;
86
+ let l;
87
+ const r = G(
88
+ ((w = i.current) == null ? void 0 : w.scrollHeight) || 0
89
+ ), L = !o && m === "auto", N = !o && m !== "auto";
90
+ return (I = i.current) != null && I.parentElement && (o ? (i.current.parentElement.style.height = r, l = setTimeout(() => {
91
+ var v;
92
+ h("auto"), (v = i.current) != null && v.parentElement && (i.current.parentElement.style.height = "auto");
93
+ }, 200)) : L ? (i.current.parentElement.style.height = r, h(r)) : N && (i.current.parentElement.style.height = "0px", h("0px"))), () => {
94
+ l && clearTimeout(l);
86
95
  };
87
- }, [i, f]), /* @__PURE__ */ v(L, { ref: C, disabled: a, ...j, css: b, children: [
88
- /* @__PURE__ */ s(
89
- N,
96
+ }, [o, m]), /* @__PURE__ */ E(J, { ref: k, disabled: s, fullWidth: p, ...T, css: R, children: [
97
+ /* @__PURE__ */ a(
98
+ K,
90
99
  {
91
100
  as: (d == null ? void 0 : d.tag) || "h3",
92
- onClick: R,
93
- disabled: a,
101
+ onClick: D,
102
+ disabled: s,
94
103
  ...d,
95
- children: /* @__PURE__ */ v(
96
- V,
104
+ children: /* @__PURE__ */ E(
105
+ O,
97
106
  {
98
- id: m,
99
- "aria-disabled": a,
100
- "aria-expanded": i,
101
- "aria-controls": h,
107
+ id: x,
108
+ "aria-disabled": s,
109
+ "aria-expanded": o,
110
+ "aria-controls": y,
111
+ fullWidth: p,
112
+ ...f,
102
113
  children: [
103
- I,
104
- /* @__PURE__ */ s(W, { expand: i, children: H || /* @__PURE__ */ s(B, { name: "ChevronDownLine", size: "xSmall" }) })
114
+ j,
115
+ /* @__PURE__ */ a(Q, { expand: o, children: C || /* @__PURE__ */ a(F, { name: "ChevronDownLine", size: "xSmall" }) })
105
116
  ]
106
117
  }
107
118
  )
108
119
  }
109
120
  ),
110
- /* @__PURE__ */ s(q, { children: /* @__PURE__ */ s(F, { role: "region", id: h, "aria-labelledby": m, ref: o, children: n }) })
121
+ /* @__PURE__ */ a(U, { children: /* @__PURE__ */ a(
122
+ W,
123
+ {
124
+ role: "region",
125
+ id: y,
126
+ "aria-labelledby": x,
127
+ ref: i,
128
+ ...u,
129
+ children: n
130
+ }
131
+ ) })
111
132
  ] });
112
133
  });
113
134
  export {
114
- U as default
135
+ M as default
115
136
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@emotion/react/jsx-runtime"),n=require("react"),B=require("../CircularProgressIndicator/CircularProgressIndicator.cjs"),T=require("../Flexbox/Flexbox.cjs"),D=require("../Icon/Icon.cjs"),z=require("../Menu/Menu.cjs"),x=require("../Menu/MenuBlock/MenuBlock.cjs"),M=require("../TextField/TextField.cjs"),E=require("../Typography/Typography.cjs"),d=100,G=n.forwardRef(function({inputValue:l,onInputChange:c,menuValue:q,onMenuChange:i,inputProps:I,minInputLengthForMenu:m=0,options:g=[],isLoading:o=!1,renderOptions:f,renderEmpty:b,filterOptions:j,getOptionLabel:S},R){const h=n.useRef(null);n.useImperativeHandle(R,()=>h.current);const[k,a]=n.useState(!1),u=j?j(g):g.filter(e=>e.label.includes(l)),O=u.length>0,v=l.length>=m,y=()=>a(e=>!e),A=e=>{e.target.value.length>0?a(!0):i("",e,null),c(e.target.value,e)},N=()=>{v&&a(!0)},F=(e,r)=>{var C;if(e===void 0||!r||!((C=r==null?void 0:r.target)!=null&&C.textContent))return;const s=u.find(_=>_.value===e);if(S){s&&setTimeout(()=>{c(S(s),r),i(e.toString(),r,s)},d);return}setTimeout(()=>{c(r.target.textContent||"",r),i(e.toString(),r,s||null)},d)},P=e=>{a(!1),setTimeout(()=>{c("",e),i("",e,null)},d)};return t.jsxs(T.default,{ref:h,inlineCSS:{position:"relative"},children:[t.jsx(M.default,{value:l,onChange:A,onFocus:N,fullWidth:!0,endAdornment:l?t.jsx(D.default,{name:"InvalidFill",color:"grey.50",size:"medium",onClick:P,inlineCSS:{cursor:"pointer"}}):null,inlineCSS:{"& svg":{flexShrink:0}},...I}),t.jsxs(z.default,{value:q,anchorRef:h,open:k&&l.length>=m,onClose:y,onChange:F,transitionDuration:d,disablePadding:!v,disableClickOutside:!l,children:[o&&t.jsx(x.default,{value:"LOADING",disabled:!0,children:t.jsx(T.default,{justifyContent:"center",children:t.jsx(B.default,{size:"small",loop:!0})})}),!o&&O&&u.map((e,r)=>{if(f&&typeof f=="function")return f(e,r,u);if(l&&!e.label.includes(l)||!v)return;const s=e.label.indexOf(l);return t.jsx(x.default,{value:e.value,...e==null?void 0:e.menuBlockProps,children:l?t.jsxs(t.Fragment,{children:[e.label.slice(0,s),t.jsx(E.default,{tag:"span",variant:"h5B",color:"primary",children:e.label.slice(s,s+l.length)}),e.label.slice(s+l.length)]}):e.label},e.value)}),!o&&!O&&(b?(()=>{const e=b(l);return n.isValidElement(e)?n.cloneElement(e,{...e.props,disabled:!0}):e})():t.jsx(x.default,{value:"NO_OPTION",disabled:!0,children:"검색 결과가 없어요."}))]})]})});exports.default=G;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("@emotion/react/jsx-runtime"),n=require("react"),X=require("../CircularProgressIndicator/CircularProgressIndicator.cjs"),B=require("../Flexbox/Flexbox.cjs"),Y=require("../Icon/Icon.cjs"),Z=require("../Menu/Menu.cjs"),w=require("../Menu/MenuBlock/MenuBlock.cjs");require("../Menu/MenuButton/MenuButton.cjs");const L=require("../TextField/TextField.cjs"),V=require("../Typography/Typography.cjs"),ee=require("../core/useTheme.cjs"),z=require("../utils/getSibling/getSibling.cjs"),x=100,te=n.forwardRef(function({inputValue:o,onInputChange:f,menuValue:T,onMenuChange:y,inputProps:H,minInputLengthForMenu:P=0,options:C=[],isLoading:q=!1,renderOptions:O,renderEmpty:R,filterOptions:E,getOptionLabel:h},U){const D=n.useRef(null),v=n.useRef(null),A=n.useId(),{palette:F}=ee.default();n.useImperativeHandle(U,()=>D.current);const[k,S]=n.useState(!1),[p,m]=n.useState(void 0),r=n.useRef(!1),g=E?E(C):C.filter(e=>e.label.includes(o)),$=g.length>0,j=o.length>=P,N=()=>{if(k&&!T){S(!1),setTimeout(()=>{f("")},x);return}if(k&&T){const e=g.find(l=>l.value===T);if(e){const l=h?h(e):e.label;S(!1),setTimeout(()=>{f(l)});return}}S(e=>!e)},G=e=>{e.target.value.length>0?S(!0):y("",e,null),f(e.target.value,e)},M=()=>{j&&S(!0)},W=(e,l)=>{var u;if(e===void 0||!l||!((u=l==null?void 0:l.target)!=null&&u.textContent))return;const i=g.find(d=>d.value===e);if(h){i&&setTimeout(()=>{f(h(i),l),y(e.toString(),l,i)},x);return}setTimeout(()=>{f(l.target.textContent||"",l),y(e.toString(),l,i||null)},x)},J=e=>{var l,i,u,d,I,b,_;if(!r.current){if(e.key==="ArrowDown"){e.preventDefault(),e.stopPropagation(),r.current=!0;const t=(l=v.current)==null?void 0:l.querySelector('li[role="option"]');if(!p)t&&(m(t.id),t.scrollIntoView({block:"end"}));else{const s=(i=v.current)==null?void 0:i.querySelector(`#${CSS.escape(p)}`);if(!s){r.current=!1;return}const c=z.default(s,"next",{skipDisabled:!0});c&&c.id&&(m(c.id),c.scrollIntoView({block:"end"})),c||(m(t.id),t.scrollIntoView({block:"end"}))}setTimeout(()=>{r.current=!1},0)}if(e.key==="ArrowUp"){if(e.preventDefault(),e.stopPropagation(),r.current=!0,!p){r.current=!1;return}const t=(u=v.current)==null?void 0:u.querySelector(`#${CSS.escape(p)}`);if(!t){r.current=!1;return}const s=z.default(t,"prev",{skipDisabled:!0});if(s&&s.id&&(m(s.id),s.scrollIntoView({block:"end"})),!s){const c=(d=v.current)==null?void 0:d.querySelector('li[role="option"]:last-child');c&&(m(c.id),c.scrollIntoView({block:"end"}))}setTimeout(()=>{r.current=!1},0)}if(e.key==="Enter"){if(e.preventDefault(),e.stopPropagation(),r.current=!0,!p){r.current=!1;return}const t=(I=v.current)==null?void 0:I.querySelector(`#${CSS.escape(p)}`);if(!t){r.current=!1;return}const s=g.find(c=>c.value===t.dataset.value);S(!1),setTimeout(h&&s?()=>{f(h(s),e),y(t.dataset.value||"",e,s)}:()=>{f(t.textContent||"",e),y(t.dataset.value||"",e,s||null)},x),setTimeout(()=>{r.current=!1},0)}if(e.key==="Home"){e.preventDefault(),e.stopPropagation(),r.current=!0;const t=(b=v.current)==null?void 0:b.querySelector('li[role="option"]');t&&(m(t.id),t.scrollIntoView({block:"start"})),setTimeout(()=>{r.current=!1},0)}if(e.key==="End"){e.preventDefault(),e.stopPropagation(),r.current=!0;const t=(_=v.current)==null?void 0:_.querySelector('li[role="option"]:last-child');t&&(m(t.id),t.scrollIntoView({block:"end"})),setTimeout(()=>{r.current=!1},0)}e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),r.current=!0,N(),setTimeout(()=>{r.current=!1},0))}},K=e=>{S(!1),setTimeout(()=>{f("",e),y("",e,null)},x)},Q=e=>{(e.key==="Enter"||e.key===" ")&&K(e)};return n.useEffect(()=>{k||m(void 0)},[k]),a.jsxs(B.default,{ref:D,inlineCSS:{position:"relative"},children:[a.jsx(L.default,{value:o,onChange:G,onFocus:M,onKeyDown:J,fullWidth:!0,autoComplete:"off",role:"combobox","aria-expanded":k,"aria-autocomplete":"list","aria-controls":A,"aria-activedescendant":p,"aria-busy":q,"aria-haspopup":"listbox",endAdornment:o?a.jsx(Y.default,{name:"InvalidFill",color:"grey.50",size:"medium",role:"button",onClick:K,onKeyDown:Q,tabIndex:0,"aria-hidden":!1,focusable:!0,"aria-label":"지우기",inlineCSS:{cursor:"pointer"}}):null,inlineCSS:{"& svg":{flexShrink:0}},...H}),a.jsxs(Z.default,{id:A,value:T,ref:v,anchorRef:D,open:k&&o.length>=P,onClose:N,onChange:W,transitionDuration:x,disablePadding:!j,children:[q&&a.jsx(w.default,{value:"LOADING",disabled:!0,children:a.jsx(B.default,{justifyContent:"center",children:a.jsx(X.default,{size:"small",loop:!0})})}),!q&&$&&g.map((e,l)=>{const i=e.label.indexOf(o),u=`menu-option-${e.value}-${e.label}`,d=p===u,I=e.value===T;if(O&&typeof O=="function"){const b=O(e,l,g);return n.isValidElement(b)?n.cloneElement(b,{id:u,key:e.value,role:"option","aria-selected":d,"data-value":e.value,inlineCSS:{border:d?`2px solid ${F.grey[100]}`:"2px solid transparent"},...b.props}):b}if(!(o&&!e.label.includes(o))&&j)return a.jsx(w.default,{id:u,value:e.value,role:"option","aria-selected":d,"data-value":e.value,inlineCSS:{border:d?`2px solid ${F.grey[100]}`:"2px solid transparent"},...e==null?void 0:e.menuBlockProps,children:o&&!I?a.jsxs(a.Fragment,{children:[e.label.slice(0,i),a.jsx(V.default,{tag:"span",variant:"h5B",color:"primary",children:e.label.slice(i,i+o.length)}),e.label.slice(i+o.length)]}):e.label},e.value)}),!q&&!$&&(R?(()=>{const e=R(o);return n.isValidElement(e)?n.cloneElement(e,{...e.props,disabled:!0}):e})():a.jsx(w.default,{value:"NO_OPTION",disabled:!0,children:"검색 결과가 없어요."}))]})]})});exports.default=te;
@@ -10,7 +10,7 @@ export interface Option {
10
10
  }
11
11
  export interface AutocompleteProps {
12
12
  inputValue: string;
13
- onInputChange: (inputValue: string, e: SyntheticEvent) => void;
13
+ onInputChange: (inputValue: string, e?: SyntheticEvent) => void;
14
14
  menuValue: Option['value'];
15
15
  onMenuChange: (menuValue: string, e: SyntheticEvent, option: Option | null) => void;
16
16
  options: Array<Option>;