@dotss/ui 0.0.11 → 1.0.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.
Files changed (105) hide show
  1. package/Accordion/Accordion.d.ts +1 -1
  2. package/Backdrop/Backdrop.d.ts +1 -1
  3. package/Badge/Badge.d.ts +3 -3
  4. package/BottomSheet/BottomSheet.d.ts +1 -1
  5. package/BottomSheet/BottomSheetAction/BottomSheetAction.d.ts +1 -1
  6. package/BottomSheet/BottomSheetContent/BottomSheetContent.d.ts +1 -1
  7. package/BottomSheet/BottomSheetText/BottomSheetText.d.ts +1 -1
  8. package/BottomSheet/BottomSheetTitle/BottomSheetTitle.d.ts +1 -1
  9. package/Box/Box.d.ts +1 -1
  10. package/Button/Button.d.ts +2 -2
  11. package/Button/index.d.ts +1 -0
  12. package/Card/Card.d.ts +1 -1
  13. package/ChainPicker/ChainPicker.d.ts +1 -1
  14. package/Checkbox/Checkbox.d.ts +2 -2
  15. package/Chip/Chip.d.ts +1 -1
  16. package/CircularProgressIndicator/CircularProgressIndicator.cjs +5 -5
  17. package/CircularProgressIndicator/CircularProgressIndicator.d.ts +1 -1
  18. package/CircularProgressIndicator/CircularProgressIndicator.es.js +1 -1
  19. package/DatePicker/DatePicker.cjs +40 -30
  20. package/DatePicker/DatePicker.d.ts +2 -1
  21. package/DatePicker/DatePicker.es.js +477 -301
  22. package/DatePicker/EventDot/EventDot.d.ts +1 -1
  23. package/DatePicker/EventDotGroup/EventDotGroup.cjs +3 -3
  24. package/DatePicker/EventDotGroup/EventDotGroup.d.ts +1 -1
  25. package/DatePicker/EventDotGroup/EventDotGroup.es.js +14 -14
  26. package/Dialog/Dialog.d.ts +1 -1
  27. package/Dialog/DialogText/DialogText.d.ts +1 -1
  28. package/Dialog/DialogTitle/DialogTitle.d.ts +1 -1
  29. package/Flexbox/Flexbox.d.ts +1 -1
  30. package/FocusBoundary/FocusBoundary.d.ts +1 -1
  31. package/FormControlText/FormControlText.cjs +2 -2
  32. package/FormControlText/FormControlText.d.ts +1 -1
  33. package/FormControlText/FormControlText.es.js +14 -14
  34. package/Icon/Icon.cjs +1 -1
  35. package/Icon/Icon.d.ts +2 -2
  36. package/Icon/Icon.es.js +1 -1
  37. package/IconButton/IconButton.d.ts +2 -2
  38. package/Label/Label.d.ts +4 -4
  39. package/LineProgressIndicator/LineProgressIndicator.cjs +3 -3
  40. package/LineProgressIndicator/LineProgressIndicator.d.ts +1 -1
  41. package/LineProgressIndicator/LineProgressIndicator.es.js +1 -1
  42. package/Menu/Menu.cjs +6 -6
  43. package/Menu/Menu.d.ts +1 -1
  44. package/Menu/Menu.es.js +83 -79
  45. package/Menu/MenuBlock/MenuBlock.cjs +5 -11
  46. package/Menu/MenuBlock/MenuBlock.d.ts +1 -1
  47. package/Menu/MenuBlock/MenuBlock.es.js +19 -29
  48. package/Menu/MenuButton/MenuButton.cjs +1 -1
  49. package/Menu/MenuButton/MenuButton.d.ts +1 -1
  50. package/Menu/MenuButton/MenuButton.es.js +38 -29
  51. package/NumberKeypad/NumberKeypad.d.ts +2 -2
  52. package/NumberKeypad/NumberKeypadBlock/NumberKeypadBlock.d.ts +1 -1
  53. package/PageControl/PageControl.d.ts +2 -2
  54. package/Radio/Radio.d.ts +2 -2
  55. package/RadioGroup/RadioGroup.d.ts +1 -1
  56. package/SegmentedButton/SegmentedButton.d.ts +2 -2
  57. package/SegmentedButton/SegmentedButtonBlock/SegmentedButtonBlock.d.ts +1 -1
  58. package/Select/Option/Option.d.ts +1 -1
  59. package/Select/Select.d.ts +1 -1
  60. package/Skeleton/Skeleton.d.ts +3 -3
  61. package/Slider/Slider.d.ts +1 -1
  62. package/Snackbar/Snackbar.d.ts +2 -2
  63. package/Switch/Switch.d.ts +1 -1
  64. package/Tab/Tab.d.ts +1 -1
  65. package/Tab/TabBlock/TabBlock.d.ts +1 -1
  66. package/TextArea/TextArea.d.ts +1 -1
  67. package/TextField/TextField.d.ts +1 -1
  68. package/Tooltip/Tooltip.cjs +5 -5
  69. package/Tooltip/Tooltip.d.ts +4 -2
  70. package/Tooltip/Tooltip.es.js +84 -84
  71. package/Typography/Typography.d.ts +2 -2
  72. package/package.json +1 -1
  73. package/resources/tictoccroc/icons/fill/alphabet-fill.svg-CvfRsdBW.js +5 -0
  74. package/resources/tictoccroc/icons/fill/alphabet-fill.svg-HBXWjzrC.cjs +1 -0
  75. package/resources/tictoccroc/icons/fill/{certified-fill.svg-B_RVx6K_.cjs → certified-fill.svg-DA375i9-.cjs} +1 -1
  76. package/resources/tictoccroc/icons/fill/{certified-fill.svg-CK7UqYft.js → certified-fill.svg-DBC-EEKD.js} +1 -1
  77. package/resources/tictoccroc/icons/fill/check-fill.svg-0_5PrDLC.js +5 -0
  78. package/resources/tictoccroc/icons/fill/check-fill.svg-BKKTgIa3.cjs +1 -0
  79. package/resources/tictoccroc/icons/fill/index.d.ts +4 -0
  80. package/resources/tictoccroc/icons/fill/search-fill.svg-BvLNCg-N.cjs +1 -0
  81. package/resources/tictoccroc/icons/fill/search-fill.svg-DnxhncI6.js +5 -0
  82. package/resources/tictoccroc/icons/fill/time-fill.svg-CbMJxmhK.js +5 -0
  83. package/resources/tictoccroc/icons/fill/time-fill.svg-DcMfM75a.cjs +1 -0
  84. package/resources/tictoccroc/icons/index.ts-DI_CztBn.cjs +1 -0
  85. package/resources/tictoccroc/icons/index.ts-Dt89JG4Z.js +236 -0
  86. package/themes/tictoccroc/colors/background.d.ts +2 -2
  87. package/themes/tictoccroc/colors/blue.d.ts +1 -1
  88. package/themes/tictoccroc/colors/classType.d.ts +1 -1
  89. package/themes/tictoccroc/colors/etc.d.ts +2 -2
  90. package/themes/tictoccroc/colors/green.d.ts +1 -1
  91. package/themes/tictoccroc/colors/grey.d.ts +1 -1
  92. package/themes/tictoccroc/colors/pink.d.ts +1 -1
  93. package/themes/tictoccroc/colors/yellow.d.ts +1 -1
  94. package/themes/tictoccroc/parentLight.d.ts +1 -1
  95. package/themes/tictoccroc/teacherLight.d.ts +1 -1
  96. package/themes/tictoccroc/typography/body.d.ts +1 -1
  97. package/themes/tictoccroc/typography/caption.d.ts +1 -1
  98. package/themes/tictoccroc/typography/display.d.ts +1 -1
  99. package/themes/tictoccroc/typography/headline.d.ts +1 -1
  100. package/utils/getIconLabel/getIconLabel.cjs +1 -1
  101. package/utils/getIconLabel/getIconLabel.d.ts +1 -1
  102. package/utils/getIconLabel/getIconLabel.es.js +5 -1
  103. package/utils/getPaletteColor/getPaletteColor.d.ts +1 -1
  104. package/resources/tictoccroc/icons/index.ts-BmqvB_n6.cjs +0 -1
  105. package/resources/tictoccroc/icons/index.ts-CzTh-XsD.js +0 -228
package/Menu/Menu.es.js CHANGED
@@ -1,9 +1,10 @@
1
- import { jsx as $, jsxs as st, Fragment as nt } from "@emotion/react/jsx-runtime";
2
- import { forwardRef as ut, useState as a, useRef as z, useEffect as b, Children as H, isValidElement as ct, cloneElement as dt } from "react";
3
- import { createPortal as ft } from "react-dom";
4
- import A from "../utils/getSibling/getSibling.es.js";
5
- import I from "@emotion/styled";
6
- const at = I.div`
1
+ import { jsx as $, jsxs as nt, Fragment as ut } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as dt, useState as l, useRef as z, useEffect as v, Children as H, isValidElement as ct, cloneElement as ft } from "react";
3
+ import { createPortal as lt } from "react-dom";
4
+ import pt from "../hooks/useCheckKeyboardMode/useCheckKeyboardMode.es.js";
5
+ import j from "../utils/getSibling/getSibling.es.js";
6
+ import T from "@emotion/styled";
7
+ const at = T.div`
7
8
  position: fixed;
8
9
  top: 0;
9
10
  left: 0;
@@ -18,7 +19,7 @@ const at = I.div`
18
19
  }
19
20
  }}}
20
21
 
21
- `, lt = I.div`
22
+ `, yt = T.div`
22
23
  position: fixed;
23
24
  max-width: calc(100% - ${({ theme: { spacing: o } }) => o.layout(4)}px);
24
25
  border-radius: 10px;
@@ -35,16 +36,16 @@ const at = I.div`
35
36
  transform: scale(${({ open: o }) => o ? 1 : 0.97});
36
37
  opacity: ${({ open: o }) => o ? 1 : 0};
37
38
  z-index: 100003;
38
- `, pt = I.ul`
39
+ `, bt = T.ul`
39
40
  display: flex;
40
41
  flex-direction: column;
41
42
  max-height: ${({ maxHeight: o }) => o}px;
42
43
  overflow-y: auto;
43
44
 
44
- ${({ theme: { spacing: o }, disablePadding: l }) => l ? null : {
45
+ ${({ theme: { spacing: o }, disablePadding: p }) => p ? null : {
45
46
  padding: `${o.content(1)}px 0`
46
47
  }}}
47
- `, yt = I.div`
48
+ `, mt = T.div`
48
49
  width: 100%;
49
50
  height: 1px;
50
51
  background-color: ${({
@@ -52,70 +53,73 @@ const at = I.div`
52
53
  palette: { grey: o }
53
54
  }
54
55
  }) => o[20]};
55
- `, T = 24, ht = ut(function({
56
- children: l,
57
- anchorRef: c,
56
+ `, S = 24, Et = dt(function({
57
+ children: p,
58
+ anchorRef: s,
58
59
  open: w,
59
- onClose: d,
60
+ onClose: c,
60
61
  spacing: y = 4,
61
- transitionDuration: S = 200,
62
+ transitionDuration: I = 200,
62
63
  onChange: x,
63
- value: B,
64
- showDivider: G,
65
- placement: P = "bottom-center",
66
- disablePadding: K,
67
- disableClickOutside: U = !0,
64
+ value: A,
65
+ showDivider: B,
66
+ placement: K = "bottom-center",
67
+ disablePadding: G,
68
+ disableClickOutside: C = !0,
68
69
  width: M,
69
70
  fitToAnchorWidth: W = !0,
70
- maxHeight: V = 476,
71
- style: _,
72
- inlineCSS: C,
71
+ maxHeight: U = 476,
72
+ style: V,
73
+ inlineCSS: _,
73
74
  menuProps: J,
74
75
  ...Q
75
76
  }, X) {
76
- const [h, F] = a(0), [D, L] = a(0), [g, Y] = a(0), [O, N] = a(!1), [Z, R] = a(!1), [tt, j] = a(!0), [ot, p] = a(null), m = z(), v = z(), k = z(null), et = (t, e) => (s) => {
77
- s.stopPropagation(), typeof d == "function" && d(), typeof x == "function" && x(t, s), typeof e == "function" && e(s);
78
- }, it = (t) => (e) => {
79
- var r, u, n, f;
80
- e.key === "Tab" && typeof d == "function" && (d(), p(0)), (e.key === "Enter" || e.key === " ") && typeof d == "function" && typeof x == "function" && (d(), x(t, e));
81
- const s = document.activeElement;
82
- if (s) {
77
+ const [g, P] = l(0), [D, L] = l(0), [h, Y] = l(0), [O, q] = l(!1), [Z, R] = l(!1), [tt, F] = l(!0), [ot, a] = l(null), b = z(), m = z(), k = z(null), { isKeyboardMode: et } = pt(), it = (t, e) => (n) => {
78
+ n.stopPropagation(), typeof c == "function" && c(), typeof x == "function" && x(t, n), typeof e == "function" && e(n);
79
+ }, rt = (t) => (e) => {
80
+ var r, d, u, f;
81
+ if (e.key === "Tab" && typeof c == "function" && (c(), a(0)), (e.key === "Enter" || e.key === " ") && typeof c == "function" && typeof x == "function" && (c(), x(t, e), s != null && s.current)) {
82
+ const i = s.current.querySelector("button");
83
+ i && et && i.focus();
84
+ }
85
+ const n = document.activeElement;
86
+ if (n) {
83
87
  if (e.code === "ArrowDown") {
84
- const i = A(s, "next", { skipDisabled: !0 });
85
- i && i.dataset.index ? (p(Number(i.dataset.index)), i.focus()) : (p(0), (u = (r = k.current) == null ? void 0 : r.querySelector('[role="menuitem"]')) == null || u.focus());
88
+ const i = j(n, "next", { skipDisabled: !0 });
89
+ i && i.dataset.index ? (a(Number(i.dataset.index)), i.focus()) : (a(0), (d = (r = k.current) == null ? void 0 : r.querySelector('[role="menuitem"]')) == null || d.focus());
86
90
  }
87
91
  if (e.code === "ArrowUp") {
88
- const i = A(s, "prev", { skipDisabled: !0 });
89
- i && i.dataset.index ? (p(Number(i.dataset.index)), i.focus()) : (p(H.count(l) - 1), (f = (n = k.current) == null ? void 0 : n.querySelector('[role="menuitem"]:last-child')) == null || f.focus());
92
+ const i = j(n, "prev", { skipDisabled: !0 });
93
+ i && i.dataset.index ? (a(Number(i.dataset.index)), i.focus()) : (a(H.count(p) - 1), (f = (u = k.current) == null ? void 0 : u.querySelector('[role="menuitem"]:last-child')) == null || f.focus());
90
94
  }
91
95
  }
92
96
  };
93
- return b(() => {
94
- w && (v.current && clearTimeout(v.current), document.body.style.overflow = "hidden", j(!1), m.current = setTimeout(() => {
95
- N(!0);
97
+ return v(() => {
98
+ w && (m.current && clearTimeout(m.current), document.body.style.overflow = "hidden", F(!1), b.current = setTimeout(() => {
99
+ q(!0);
96
100
  }, 100));
97
- }, [w]), b(() => {
98
- w || (m.current && clearTimeout(m.current), N(!1), document.body.removeAttribute("style"), v.current = setTimeout(() => {
99
- j(!0), p(0);
100
- }, S));
101
- }, [w, S]), b(() => {
101
+ }, [w]), v(() => {
102
+ w || (b.current && clearTimeout(b.current), q(!1), document.body.removeAttribute("style"), m.current = setTimeout(() => {
103
+ F(!0), a(0);
104
+ }, I));
105
+ }, [w, I]), v(() => {
102
106
  const t = () => {
103
- var q;
104
- const { offsetWidth: e = 0, offsetHeight: s = 0 } = (c == null ? void 0 : c.current) || {}, r = ((q = c == null ? void 0 : c.current) == null ? void 0 : q.getBoundingClientRect()) || {
107
+ var N;
108
+ const { offsetWidth: e = 0, offsetHeight: n = 0 } = (s == null ? void 0 : s.current) || {}, r = ((N = s == null ? void 0 : s.current) == null ? void 0 : N.getBoundingClientRect()) || {
105
109
  top: 0,
106
110
  left: 0,
107
111
  bottom: 0
108
- }, { offsetWidth: u = 0, offsetHeight: n = 0 } = k.current || {}, [f, i] = P.split("-");
112
+ }, { offsetWidth: d = 0, offsetHeight: u = 0 } = k.current || {}, [f, i] = K.split("-");
109
113
  Y(M || e);
110
- const E = (r.top || 0) - n - y - T < T, rt = (r.bottom || 0) + n + y + T > window.innerHeight;
114
+ const E = (r.top || 0) - u - y - S < S, st = (r.bottom || 0) + u + y + S > window.innerHeight;
111
115
  switch (f) {
112
116
  case "top":
113
- F(
114
- E ? T : r.top - n - y
117
+ P(
118
+ E ? S : r.top - u - y
115
119
  );
116
120
  break;
117
121
  default:
118
- F(rt ? "auto" : r.top + s + y);
122
+ P(st ? "auto" : r.top + n + y);
119
123
  break;
120
124
  }
121
125
  switch (i) {
@@ -123,66 +127,66 @@ const at = I.div`
123
127
  L(r.left);
124
128
  break;
125
129
  case "right":
126
- L(r.left - Math.abs(e - u));
130
+ L(r.left - Math.abs(e - d));
127
131
  break;
128
132
  default:
129
- L(r.left + e / 2 - u / 2);
133
+ L(r.left + e / 2 - d / 2);
130
134
  break;
131
135
  }
132
136
  };
133
137
  return t(), window.addEventListener("scroll", t), window.addEventListener("resize", t), () => {
134
138
  window.removeEventListener("scroll", t), window.removeEventListener("resize", t);
135
139
  };
136
- }, [c, y, P, O, l, M]), b(() => {
137
- R(O && !!h && !!D && !!g);
138
- }, [O, h, D, g]), b(() => () => {
139
- m.current && clearTimeout(m.current), v.current && clearTimeout(v.current);
140
- }, []), tt ? null : ft(
141
- /* @__PURE__ */ $(at, { onClick: d, disableClickOutside: U, children: /* @__PURE__ */ $(
142
- lt,
140
+ }, [s, y, K, O, p, M]), v(() => {
141
+ R(O && !!g && !!D && !!h);
142
+ }, [O, g, D, h]), v(() => () => {
143
+ b.current && clearTimeout(b.current), m.current && clearTimeout(m.current);
144
+ }, []), tt ? null : lt(
145
+ /* @__PURE__ */ $(at, { onClick: c, disableClickOutside: C, children: /* @__PURE__ */ $(
146
+ yt,
143
147
  {
144
148
  ref: X,
145
149
  open: Z,
146
- transitionDuration: S,
150
+ transitionDuration: I,
147
151
  ...Q,
148
- css: C,
152
+ css: _,
149
153
  style: {
150
- ..._,
151
- top: h,
154
+ ...V,
155
+ top: g,
152
156
  left: D,
153
- bottom: h === "auto" ? 24 : void 0,
154
- width: W ? g : void 0
157
+ bottom: g === "auto" ? 24 : void 0,
158
+ width: W ? h : void 0
155
159
  },
156
160
  children: /* @__PURE__ */ $(
157
- pt,
161
+ bt,
158
162
  {
159
163
  role: "menu",
160
164
  ref: k,
161
- disablePadding: K,
162
- maxHeight: V,
165
+ disablePadding: G,
166
+ maxHeight: U,
163
167
  ...J,
164
- children: H.map(l, (t, e) => {
165
- var r, u, n, f, i, E;
168
+ children: H.map(p, (t, e) => {
169
+ var r, d, u, f, i, E;
166
170
  if (!ct(t))
167
171
  return null;
168
- const s = ot === e;
169
- return /* @__PURE__ */ st(nt, { children: [
170
- dt(t, {
172
+ const n = ot === e;
173
+ return /* @__PURE__ */ nt(ut, { children: [
174
+ ft(t, {
171
175
  ...t.props,
172
176
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
173
177
  // @ts-expect-error
174
178
  "data-index": e,
175
- selected: !!((r = t == null ? void 0 : t.props) != null && r.value) && ((u = t == null ? void 0 : t.props) == null ? void 0 : u.value) === B,
176
- onClick: et((n = t == null ? void 0 : t.props) == null ? void 0 : n.value, (f = t == null ? void 0 : t.props) == null ? void 0 : f.onClick),
177
- onKeyDown: it((i = t == null ? void 0 : t.props) == null ? void 0 : i.value),
178
- tabIndex: s ? 0 : -1,
179
+ selected: !!((r = t == null ? void 0 : t.props) != null && r.value) && ((d = t == null ? void 0 : t.props) == null ? void 0 : d.value) === A,
180
+ onClick: it((u = t == null ? void 0 : t.props) == null ? void 0 : u.value, (f = t == null ? void 0 : t.props) == null ? void 0 : f.onClick),
181
+ onKeyDown: rt((i = t == null ? void 0 : t.props) == null ? void 0 : i.value),
182
+ tabIndex: n ? 0 : -1,
179
183
  style: {
180
184
  ...(E = t == null ? void 0 : t.props) == null ? void 0 : E.style,
181
- [M ? "width" : "minWidth"]: W ? void 0 : g,
185
+ [M ? "width" : "minWidth"]: W ? void 0 : h,
182
186
  maxWidth: W ? void 0 : "100%"
183
187
  }
184
188
  }),
185
- G && H.count(l) !== e + 1 && /* @__PURE__ */ $(yt, {})
189
+ B && H.count(p) !== e + 1 && /* @__PURE__ */ $(mt, {})
186
190
  ] });
187
191
  })
188
192
  }
@@ -193,5 +197,5 @@ const at = I.div`
193
197
  );
194
198
  });
195
199
  export {
196
- ht as default
200
+ Et as default
197
201
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("@emotion/react/jsx-runtime"),w=require("react"),y=require("../../Icon/Icon.cjs"),v=require("../../hooks/useCheckHoverPossible/useCheckHoverPossible.cjs"),S=require("@emotion/styled"),$=e=>e&&e.__esModule?e:{default:e},c=$(S),j=c.default.li`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("@emotion/react/jsx-runtime"),w=require("react"),y=require("../../Icon/Icon.cjs"),v=require("../../hooks/useCheckHoverPossible/useCheckHoverPossible.cjs"),S=require("@emotion/styled"),j=e=>e&&e.__esModule?e:{default:e},u=j(S),$=u.default.li`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  gap: ${({theme:{spacing:e}})=>e.content(2)}px;
@@ -15,19 +15,13 @@
15
15
 
16
16
  ${({ellipsis:e})=>e?{maxHeight:"40px"}:{}};
17
17
 
18
- ${({theme:{palette:{brand:e,grey:n}},selected:t,isHoverPossible:r})=>r?{"&:hover:not([disabled])":{backgroundColor:t?e.primary.bg:n[10]}}:{}}
19
-
20
- &:focus {
21
- outline: none;
22
- border: 2px solid
23
- ${({theme:{palette:{grey:e}}})=>e[100]};
24
- }
25
- `,k=c.default.div`
18
+ ${({theme:{palette:{brand:e,grey:n}},selected:t,isHoverPossible:r})=>r?{"&:hover:not([disabled]), &:focus:not([disabled])":{backgroundColor:t?e.primary.bg:n[10]}}:{}}
19
+ `,k=u.default.div`
26
20
  flex-grow: 1;
27
21
 
28
22
  ${({ellipsis:e})=>e?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:{}};
29
23
 
30
24
  ${({theme:{palette:{brand:e,grey:n},typography:{h5B:t,b4R:r}},selected:a,disabled:o})=>{let i={fontSize:r.size,fontWeight:r.weight,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight};return a&&(i={fontSize:t.size,fontWeight:t.weight,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,color:e.primary.text}),o&&(i.color=n[30]),i}}}
31
- `,u=c.default.div`
25
+ `,c=u.default.div`
32
26
  white-space: nowrap;
33
- `,H=w.forwardRef(function({children:n,startAdornment:t,endAdornment:r,inlineCSS:a,selected:o,disabled:i,value:d,onClick:s,ellipsis:p=!0,...h},g){const{isHoverPossible:x}=v.default(),m=f=>{f.stopPropagation(),!i&&typeof s=="function"&&s(f)};return l.jsxs(j,{ref:g,selected:o,disabled:i,"data-value":d,isHoverPossible:x,onClick:m,ellipsis:p,role:"menuitem",...h,css:a,children:[t&&l.jsx(u,{children:t}),l.jsx(k,{selected:o,disabled:i,ellipsis:p,children:n}),!o&&r&&l.jsx(u,{children:r}),o&&l.jsx(u,{children:l.jsx(y.default,{name:"CheckLine",color:"primary"})})]})});exports.default=H;
27
+ `,H=w.forwardRef(function({children:n,startAdornment:t,endAdornment:r,inlineCSS:a,selected:o,disabled:i,value:d,onClick:s,ellipsis:p=!0,...h},g){const{isHoverPossible:x}=v.default(),m=f=>{f.stopPropagation(),!i&&typeof s=="function"&&s(f)};return l.jsxs($,{ref:g,selected:o,disabled:i,"data-value":d,isHoverPossible:x,onClick:m,ellipsis:p,role:"menuitem",...h,css:a,children:[t&&l.jsx(c,{children:t}),l.jsx(k,{selected:o,disabled:i,ellipsis:p,children:n}),!o&&r&&l.jsx(c,{children:r}),o&&l.jsx(c,{children:l.jsx(y.default,{name:"CheckLine",color:"primary"})})]})});exports.default=H;
@@ -1,5 +1,5 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
- import { GeneralComponentProps } from '../../typings/component';
2
+ import { GeneralComponentProps } from '../../../typings/component';
3
3
 
4
4
  export interface MenuBlockProps extends GeneralComponentProps<HTMLAttributes<HTMLLIElement>> {
5
5
  startAdornment?: ReactNode;
@@ -1,9 +1,9 @@
1
1
  import { jsxs as x, jsx as l } from "@emotion/react/jsx-runtime";
2
2
  import { forwardRef as w } from "react";
3
3
  import y from "../../Icon/Icon.es.js";
4
- import $ from "../../hooks/useCheckHoverPossible/useCheckHoverPossible.es.js";
4
+ import k from "../../hooks/useCheckHoverPossible/useCheckHoverPossible.es.js";
5
5
  import c from "@emotion/styled";
6
- const k = c.li`
6
+ const v = c.li`
7
7
  display: flex;
8
8
  align-items: center;
9
9
  gap: ${({ theme: { spacing: e } }) => e.content(2)}px;
@@ -21,11 +21,11 @@ const k = c.li`
21
21
  height: 20px;
22
22
  color: ${({
23
23
  theme: {
24
- palette: { brand: e, grey: o }
24
+ palette: { brand: e, grey: i }
25
25
  },
26
26
  selected: t,
27
27
  disabled: r
28
- }) => t ? e.primary.main : r ? o[30] : "inherit"};
28
+ }) => t ? e.primary.main : r ? i[30] : "inherit"};
29
29
  }
30
30
 
31
31
  ${({ ellipsis: e }) => e ? {
@@ -34,26 +34,16 @@ const k = c.li`
34
34
 
35
35
  ${({
36
36
  theme: {
37
- palette: { brand: e, grey: o }
37
+ palette: { brand: e, grey: i }
38
38
  },
39
39
  selected: t,
40
40
  isHoverPossible: r
41
41
  }) => r ? {
42
- "&:hover:not([disabled])": {
43
- backgroundColor: t ? e.primary.bg : o[10]
42
+ "&:hover:not([disabled]), &:focus:not([disabled])": {
43
+ backgroundColor: t ? e.primary.bg : i[10]
44
44
  }
45
45
  } : {}}
46
-
47
- &:focus {
48
- outline: none;
49
- border: 2px solid
50
- ${({
51
- theme: {
52
- palette: { grey: e }
53
- }
54
- }) => e[100]};
55
- }
56
- `, v = c.div`
46
+ `, $ = c.div`
57
47
  flex-grow: 1;
58
48
 
59
49
  ${({ ellipsis: e }) => e ? {
@@ -64,51 +54,51 @@ const k = c.li`
64
54
 
65
55
  ${({
66
56
  theme: {
67
- palette: { brand: e, grey: o },
57
+ palette: { brand: e, grey: i },
68
58
  typography: { h5B: t, b4R: r }
69
59
  },
70
60
  selected: p,
71
61
  disabled: n
72
62
  }) => {
73
- let i = {
63
+ let o = {
74
64
  fontSize: r.size,
75
65
  fontWeight: r.weight,
76
66
  letterSpacing: r.letterSpacing,
77
67
  lineHeight: r.lineHeight
78
68
  };
79
- return p && (i = {
69
+ return p && (o = {
80
70
  fontSize: t.size,
81
71
  fontWeight: t.weight,
82
72
  letterSpacing: t.letterSpacing,
83
73
  lineHeight: t.lineHeight,
84
74
  color: e.primary.text
85
- }), n && (i.color = o[30]), i;
75
+ }), n && (o.color = i[30]), o;
86
76
  }}}
87
77
  `, a = c.div`
88
78
  white-space: nowrap;
89
79
  `, M = w(function({
90
- children: o,
80
+ children: i,
91
81
  startAdornment: t,
92
82
  endAdornment: r,
93
83
  inlineCSS: p,
94
84
  selected: n,
95
- disabled: i,
85
+ disabled: o,
96
86
  value: u,
97
87
  onClick: h,
98
88
  ellipsis: f = !0,
99
89
  ...m
100
90
  }, g) {
101
- const { isHoverPossible: d } = $();
91
+ const { isHoverPossible: d } = k();
102
92
  return /* @__PURE__ */ x(
103
- k,
93
+ v,
104
94
  {
105
95
  ref: g,
106
96
  selected: n,
107
- disabled: i,
97
+ disabled: o,
108
98
  "data-value": u,
109
99
  isHoverPossible: d,
110
100
  onClick: (s) => {
111
- s.stopPropagation(), !i && typeof h == "function" && h(s);
101
+ s.stopPropagation(), !o && typeof h == "function" && h(s);
112
102
  },
113
103
  ellipsis: f,
114
104
  role: "menuitem",
@@ -116,7 +106,7 @@ const k = c.li`
116
106
  css: p,
117
107
  children: [
118
108
  t && /* @__PURE__ */ l(a, { children: t }),
119
- /* @__PURE__ */ l(v, { selected: n, disabled: i, ellipsis: f, children: o }),
109
+ /* @__PURE__ */ l($, { selected: n, disabled: o, ellipsis: f, children: i }),
120
110
  !n && r && /* @__PURE__ */ l(a, { children: r }),
121
111
  n && /* @__PURE__ */ l(a, { children: /* @__PURE__ */ l(y, { name: "CheckLine", color: "primary" }) })
122
112
  ]
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("@emotion/react/jsx-runtime"),u=require("react"),l=require("../../Button/Button.cjs"),m=u.forwardRef(function({isMenuOpen:n,menuId:a,onClick:o,...i},s){const t=u.useRef(),c=()=>{t.current&&cancelAnimationFrame(t.current),t.current=requestAnimationFrame(()=>{t.current=requestAnimationFrame(()=>{const e=document.getElementById(a);if(e){const r=e.querySelector('[role="menuitem"]');r==null||r.setAttribute("tabindex","0"),r==null||r.focus()}t.current=void 0})})},f=e=>{if(e.stopPropagation(),e.key==="ArrowDown"&&!n){o(e),c();return}if((e.key==="Enter"||e.key===" ")&&!n){o(e),c();return}};return u.useEffect(()=>()=>{t.current&&cancelAnimationFrame(t.current)},[]),d.jsx(l.default,{ref:s,type:"button","aria-haspopup":!0,"aria-expanded":n,"aria-controls":a,onKeyDown:f,onClick:o,...i})});exports.default=m;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("@emotion/react/jsx-runtime"),r=require("react"),p=require("../../Button/Button.cjs"),v=r.forwardRef(function({isMenuOpen:n,menuId:a,onClick:u,...l},d){const c=r.useRef(null),t=r.useRef();r.useImperativeHandle(d,()=>c.current);const i=()=>{t.current&&cancelAnimationFrame(t.current);const e=(s=0)=>{const f=document.getElementById(a);if(f){const o=f.querySelector('[role="menuitem"]');if(o){o.setAttribute("tabindex","0"),o.focus(),t.current=void 0;return}}s<10?t.current=requestAnimationFrame(()=>{e(s+1)}):t.current=void 0};t.current=requestAnimationFrame(()=>{e()})},m=e=>{if(e.stopPropagation(),e.key==="ArrowDown"&&!n){e.preventDefault(),u(e),i();return}if((e.key==="Enter"||e.key===" ")&&!n){e.preventDefault(),u(e),i();return}};return r.useEffect(()=>()=>{t.current&&cancelAnimationFrame(t.current)},[]),y.jsx(p.default,{ref:c,type:"button","aria-haspopup":!0,"aria-expanded":n,"aria-controls":a,onKeyDown:m,onClick:u,...l})});exports.default=v;
@@ -1,5 +1,5 @@
1
1
  import { SyntheticEvent } from 'react';
2
- import { ButtonProps } from '../Button/Button';
2
+ import { ButtonProps } from '../../Button/Button';
3
3
 
4
4
  export interface MenuButtonProps extends ButtonProps {
5
5
  isMenuOpen: boolean;
@@ -1,44 +1,53 @@
1
- import { jsx as m } from "@emotion/react/jsx-runtime";
2
- import { forwardRef as s, useRef as d, useEffect as p } from "react";
3
- import y from "../../Button/Button.es.js";
4
- const F = s(function({ isMenuOpen: n, menuId: a, onClick: o, ...c }, i) {
5
- const t = d(), u = () => {
6
- t.current && cancelAnimationFrame(t.current), t.current = requestAnimationFrame(() => {
7
- t.current = requestAnimationFrame(() => {
8
- const r = document.getElementById(a);
9
- if (r) {
10
- const e = r.querySelector('[role="menuitem"]');
11
- e == null || e.setAttribute("tabindex", "0"), e == null || e.focus();
1
+ import { jsx as p } from "@emotion/react/jsx-runtime";
2
+ import { forwardRef as y, useRef as s, useImperativeHandle as A, useEffect as F } from "react";
3
+ import v from "../../Button/Button.es.js";
4
+ const x = y(function({ isMenuOpen: e, menuId: u, onClick: n, ...m }, l) {
5
+ const a = s(null), r = s();
6
+ A(l, () => a.current);
7
+ const i = () => {
8
+ r.current && cancelAnimationFrame(r.current);
9
+ const t = (c = 0) => {
10
+ const f = document.getElementById(u);
11
+ if (f) {
12
+ const o = f.querySelector('[role="menuitem"]');
13
+ if (o) {
14
+ o.setAttribute("tabindex", "0"), o.focus(), r.current = void 0;
15
+ return;
12
16
  }
13
- t.current = void 0;
14
- });
17
+ }
18
+ c < 10 ? r.current = requestAnimationFrame(() => {
19
+ t(c + 1);
20
+ }) : r.current = void 0;
21
+ };
22
+ r.current = requestAnimationFrame(() => {
23
+ t();
15
24
  });
16
- }, f = (r) => {
17
- if (r.stopPropagation(), r.key === "ArrowDown" && !n) {
18
- o(r), u();
25
+ }, d = (t) => {
26
+ if (t.stopPropagation(), t.key === "ArrowDown" && !e) {
27
+ t.preventDefault(), n(t), i();
19
28
  return;
20
29
  }
21
- if ((r.key === "Enter" || r.key === " ") && !n) {
22
- o(r), u();
30
+ if ((t.key === "Enter" || t.key === " ") && !e) {
31
+ t.preventDefault(), n(t), i();
23
32
  return;
24
33
  }
25
34
  };
26
- return p(() => () => {
27
- t.current && cancelAnimationFrame(t.current);
28
- }, []), /* @__PURE__ */ m(
29
- y,
35
+ return F(() => () => {
36
+ r.current && cancelAnimationFrame(r.current);
37
+ }, []), /* @__PURE__ */ p(
38
+ v,
30
39
  {
31
- ref: i,
40
+ ref: a,
32
41
  type: "button",
33
42
  "aria-haspopup": !0,
34
- "aria-expanded": n,
35
- "aria-controls": a,
36
- onKeyDown: f,
37
- onClick: o,
38
- ...c
43
+ "aria-expanded": e,
44
+ "aria-controls": u,
45
+ onKeyDown: d,
46
+ onClick: n,
47
+ ...m
39
48
  }
40
49
  );
41
50
  });
42
51
  export {
43
- F as default
52
+ x as default
44
53
  };
@@ -1,6 +1,6 @@
1
1
  import { HTMLAttributes, ReactElement, ReactNode } from 'react';
2
- import { GeneralComponentProps, Size } from '../typings/component';
3
- import { CSSValue } from '../typings/utility';
2
+ import { GeneralComponentProps, Size } from '../../typings/component';
3
+ import { CSSValue } from '../../typings/utility';
4
4
  import { default as NumberKeypadBlock } from './NumberKeypadBlock';
5
5
 
6
6
  export interface NumberKeypadProps extends GeneralComponentProps<Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>> {
@@ -1,5 +1,5 @@
1
1
  import { HTMLAttributes } from 'react';
2
- import { GeneralComponentProps } from '../../typings/component';
2
+ import { GeneralComponentProps } from '../../../typings/component';
3
3
  import { NumberKeypadProps } from '../NumberKeypad';
4
4
 
5
5
  export interface NumberKeypadBlockProps extends GeneralComponentProps<HTMLAttributes<HTMLDivElement> & Pick<NumberKeypadProps, 'size' | 'disabled'>> {
@@ -1,6 +1,6 @@
1
1
  import { HTMLAttributes } from 'react';
2
- import { BrandColorKey } from '../typings/color';
3
- import { GeneralComponentProps } from '../typings/component';
2
+ import { BrandColorKey } from '../../typings/color';
3
+ import { GeneralComponentProps } from '../../typings/component';
4
4
 
5
5
  export interface PageControlProps extends GeneralComponentProps<Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'onClick'>> {
6
6
  totalCount?: number;
package/Radio/Radio.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { InputHTMLAttributes } from 'react';
2
- import { BrandColorKey } from '../typings/color';
3
- import { GeneralComponentProps, Size } from '../typings/component';
2
+ import { BrandColorKey } from '../../typings/color';
3
+ import { GeneralComponentProps, Size } from '../../typings/component';
4
4
 
5
5
  export interface RadioProps extends GeneralComponentProps<Omit<InputHTMLAttributes<HTMLInputElement>, 'size'>> {
6
6
  size?: Extract<Size, 'medium' | '2xLarge'>;
@@ -1,5 +1,5 @@
1
1
  import { HTMLAttributes } from 'react';
2
- import { GeneralComponentProps } from '../typings/component';
2
+ import { GeneralComponentProps } from '../../typings/component';
3
3
 
4
4
  export interface RadioGroupProps extends GeneralComponentProps<HTMLAttributes<HTMLDivElement>> {
5
5
  name?: string;
@@ -1,6 +1,6 @@
1
1
  import { HTMLAttributes, ReactElement } from 'react';
2
- import { BrandColorKey } from '../typings/color';
3
- import { GeneralComponentProps, Variant } from '../typings/component';
2
+ import { BrandColorKey } from '../../typings/color';
3
+ import { GeneralComponentProps, Variant } from '../../typings/component';
4
4
  import { default as SegmentedButtonBlock } from './SegmentedButtonBlock';
5
5
 
6
6
  export interface SegmentedButtonProps extends GeneralComponentProps<Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>> {
@@ -1,5 +1,5 @@
1
1
  import { ButtonHTMLAttributes, ReactNode } from 'react';
2
- import { GeneralComponentProps } from '../../typings/component';
2
+ import { GeneralComponentProps } from '../../../typings/component';
3
3
  import { SegmentedButtonProps } from '../SegmentedButton';
4
4
 
5
5
  export interface SegmentedButtonBlockProps extends GeneralComponentProps<ButtonHTMLAttributes<HTMLButtonElement> & Pick<SegmentedButtonProps, 'variant' | 'color' | 'rounded'>> {
@@ -1,5 +1,5 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
- import { GeneralComponentProps } from '../../typings/component';
2
+ import { GeneralComponentProps } from '../../../typings/component';
3
3
 
4
4
  export interface OptionProps extends GeneralComponentProps<HTMLAttributes<HTMLLIElement>> {
5
5
  value?: string;
@@ -1,6 +1,6 @@
1
1
  import { HTMLAttributes, ReactElement, ReactNode } from 'react';
2
2
  import { default as Option } from './Option';
3
- import { GeneralComponentProps, Size, Variant } from '../typings/component';
3
+ import { GeneralComponentProps, Size, Variant } from '../../typings/component';
4
4
 
5
5
  export interface SelectProps extends GeneralComponentProps<Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>> {
6
6
  value: string;
@@ -1,7 +1,7 @@
1
1
  import { HTMLAttributes } from 'react';
2
- import { GeneralComponentProps } from '../typings/component';
3
- import { TypographyBodyKey, TypographyCaptionKey, TypographyHeadlineKey } from '../typings/typography';
4
- import { CSSValue } from '../typings/utility';
2
+ import { GeneralComponentProps } from '../../typings/component';
3
+ import { TypographyBodyKey, TypographyCaptionKey, TypographyHeadlineKey } from '../../typings/typography';
4
+ import { CSSValue } from '../../typings/utility';
5
5
 
6
6
  export interface SkeletonProps extends GeneralComponentProps<HTMLAttributes<HTMLDivElement>> {
7
7
  ratio?: `${number}:${number}`;
@@ -1,5 +1,5 @@
1
1
  import { HTMLAttributes } from 'react';
2
- import { GeneralComponentProps } from '../typings/component';
2
+ import { GeneralComponentProps } from '../../typings/component';
3
3
 
4
4
  export interface SliderProps extends GeneralComponentProps<Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>> {
5
5
  value: number;