@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.
- package/Accordion/Accordion.d.ts +1 -1
- package/Backdrop/Backdrop.d.ts +1 -1
- package/Badge/Badge.d.ts +3 -3
- package/BottomSheet/BottomSheet.d.ts +1 -1
- package/BottomSheet/BottomSheetAction/BottomSheetAction.d.ts +1 -1
- package/BottomSheet/BottomSheetContent/BottomSheetContent.d.ts +1 -1
- package/BottomSheet/BottomSheetText/BottomSheetText.d.ts +1 -1
- package/BottomSheet/BottomSheetTitle/BottomSheetTitle.d.ts +1 -1
- package/Box/Box.d.ts +1 -1
- package/Button/Button.d.ts +2 -2
- package/Button/index.d.ts +1 -0
- package/Card/Card.d.ts +1 -1
- package/ChainPicker/ChainPicker.d.ts +1 -1
- package/Checkbox/Checkbox.d.ts +2 -2
- package/Chip/Chip.d.ts +1 -1
- package/CircularProgressIndicator/CircularProgressIndicator.cjs +5 -5
- package/CircularProgressIndicator/CircularProgressIndicator.d.ts +1 -1
- package/CircularProgressIndicator/CircularProgressIndicator.es.js +1 -1
- package/DatePicker/DatePicker.cjs +40 -30
- package/DatePicker/DatePicker.d.ts +2 -1
- package/DatePicker/DatePicker.es.js +477 -301
- package/DatePicker/EventDot/EventDot.d.ts +1 -1
- package/DatePicker/EventDotGroup/EventDotGroup.cjs +3 -3
- package/DatePicker/EventDotGroup/EventDotGroup.d.ts +1 -1
- package/DatePicker/EventDotGroup/EventDotGroup.es.js +14 -14
- package/Dialog/Dialog.d.ts +1 -1
- package/Dialog/DialogText/DialogText.d.ts +1 -1
- package/Dialog/DialogTitle/DialogTitle.d.ts +1 -1
- package/Flexbox/Flexbox.d.ts +1 -1
- package/FocusBoundary/FocusBoundary.d.ts +1 -1
- package/FormControlText/FormControlText.cjs +2 -2
- package/FormControlText/FormControlText.d.ts +1 -1
- package/FormControlText/FormControlText.es.js +14 -14
- package/Icon/Icon.cjs +1 -1
- package/Icon/Icon.d.ts +2 -2
- package/Icon/Icon.es.js +1 -1
- package/IconButton/IconButton.d.ts +2 -2
- package/Label/Label.d.ts +4 -4
- package/LineProgressIndicator/LineProgressIndicator.cjs +3 -3
- package/LineProgressIndicator/LineProgressIndicator.d.ts +1 -1
- package/LineProgressIndicator/LineProgressIndicator.es.js +1 -1
- package/Menu/Menu.cjs +6 -6
- package/Menu/Menu.d.ts +1 -1
- package/Menu/Menu.es.js +83 -79
- package/Menu/MenuBlock/MenuBlock.cjs +5 -11
- package/Menu/MenuBlock/MenuBlock.d.ts +1 -1
- package/Menu/MenuBlock/MenuBlock.es.js +19 -29
- package/Menu/MenuButton/MenuButton.cjs +1 -1
- package/Menu/MenuButton/MenuButton.d.ts +1 -1
- package/Menu/MenuButton/MenuButton.es.js +38 -29
- package/NumberKeypad/NumberKeypad.d.ts +2 -2
- package/NumberKeypad/NumberKeypadBlock/NumberKeypadBlock.d.ts +1 -1
- package/PageControl/PageControl.d.ts +2 -2
- package/Radio/Radio.d.ts +2 -2
- package/RadioGroup/RadioGroup.d.ts +1 -1
- package/SegmentedButton/SegmentedButton.d.ts +2 -2
- package/SegmentedButton/SegmentedButtonBlock/SegmentedButtonBlock.d.ts +1 -1
- package/Select/Option/Option.d.ts +1 -1
- package/Select/Select.d.ts +1 -1
- package/Skeleton/Skeleton.d.ts +3 -3
- package/Slider/Slider.d.ts +1 -1
- package/Snackbar/Snackbar.d.ts +2 -2
- package/Switch/Switch.d.ts +1 -1
- package/Tab/Tab.d.ts +1 -1
- package/Tab/TabBlock/TabBlock.d.ts +1 -1
- package/TextArea/TextArea.d.ts +1 -1
- package/TextField/TextField.d.ts +1 -1
- package/Tooltip/Tooltip.cjs +5 -5
- package/Tooltip/Tooltip.d.ts +4 -2
- package/Tooltip/Tooltip.es.js +84 -84
- package/Typography/Typography.d.ts +2 -2
- package/package.json +1 -1
- package/resources/tictoccroc/icons/fill/alphabet-fill.svg-CvfRsdBW.js +5 -0
- package/resources/tictoccroc/icons/fill/alphabet-fill.svg-HBXWjzrC.cjs +1 -0
- package/resources/tictoccroc/icons/fill/{certified-fill.svg-B_RVx6K_.cjs → certified-fill.svg-DA375i9-.cjs} +1 -1
- package/resources/tictoccroc/icons/fill/{certified-fill.svg-CK7UqYft.js → certified-fill.svg-DBC-EEKD.js} +1 -1
- package/resources/tictoccroc/icons/fill/check-fill.svg-0_5PrDLC.js +5 -0
- package/resources/tictoccroc/icons/fill/check-fill.svg-BKKTgIa3.cjs +1 -0
- package/resources/tictoccroc/icons/fill/index.d.ts +4 -0
- package/resources/tictoccroc/icons/fill/search-fill.svg-BvLNCg-N.cjs +1 -0
- package/resources/tictoccroc/icons/fill/search-fill.svg-DnxhncI6.js +5 -0
- package/resources/tictoccroc/icons/fill/time-fill.svg-CbMJxmhK.js +5 -0
- package/resources/tictoccroc/icons/fill/time-fill.svg-DcMfM75a.cjs +1 -0
- package/resources/tictoccroc/icons/index.ts-DI_CztBn.cjs +1 -0
- package/resources/tictoccroc/icons/index.ts-Dt89JG4Z.js +236 -0
- package/themes/tictoccroc/colors/background.d.ts +2 -2
- package/themes/tictoccroc/colors/blue.d.ts +1 -1
- package/themes/tictoccroc/colors/classType.d.ts +1 -1
- package/themes/tictoccroc/colors/etc.d.ts +2 -2
- package/themes/tictoccroc/colors/green.d.ts +1 -1
- package/themes/tictoccroc/colors/grey.d.ts +1 -1
- package/themes/tictoccroc/colors/pink.d.ts +1 -1
- package/themes/tictoccroc/colors/yellow.d.ts +1 -1
- package/themes/tictoccroc/parentLight.d.ts +1 -1
- package/themes/tictoccroc/teacherLight.d.ts +1 -1
- package/themes/tictoccroc/typography/body.d.ts +1 -1
- package/themes/tictoccroc/typography/caption.d.ts +1 -1
- package/themes/tictoccroc/typography/display.d.ts +1 -1
- package/themes/tictoccroc/typography/headline.d.ts +1 -1
- package/utils/getIconLabel/getIconLabel.cjs +1 -1
- package/utils/getIconLabel/getIconLabel.d.ts +1 -1
- package/utils/getIconLabel/getIconLabel.es.js +5 -1
- package/utils/getPaletteColor/getPaletteColor.d.ts +1 -1
- package/resources/tictoccroc/icons/index.ts-BmqvB_n6.cjs +0 -1
- 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
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
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
|
-
`,
|
|
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
|
-
`,
|
|
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:
|
|
45
|
+
${({ theme: { spacing: o }, disablePadding: p }) => p ? null : {
|
|
45
46
|
padding: `${o.content(1)}px 0`
|
|
46
47
|
}}}
|
|
47
|
-
`,
|
|
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
|
-
`,
|
|
56
|
-
children:
|
|
57
|
-
anchorRef:
|
|
56
|
+
`, S = 24, Et = dt(function({
|
|
57
|
+
children: p,
|
|
58
|
+
anchorRef: s,
|
|
58
59
|
open: w,
|
|
59
|
-
onClose:
|
|
60
|
+
onClose: c,
|
|
60
61
|
spacing: y = 4,
|
|
61
|
-
transitionDuration:
|
|
62
|
+
transitionDuration: I = 200,
|
|
62
63
|
onChange: x,
|
|
63
|
-
value:
|
|
64
|
-
showDivider:
|
|
65
|
-
placement:
|
|
66
|
-
disablePadding:
|
|
67
|
-
disableClickOutside:
|
|
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:
|
|
71
|
-
style:
|
|
72
|
-
inlineCSS:
|
|
71
|
+
maxHeight: U = 476,
|
|
72
|
+
style: V,
|
|
73
|
+
inlineCSS: _,
|
|
73
74
|
menuProps: J,
|
|
74
75
|
...Q
|
|
75
76
|
}, X) {
|
|
76
|
-
const [
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
var r,
|
|
80
|
-
e.key === "Tab" && typeof
|
|
81
|
-
|
|
82
|
-
|
|
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 =
|
|
85
|
-
i && i.dataset.index ? (
|
|
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 =
|
|
89
|
-
i && i.dataset.index ? (
|
|
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
|
|
94
|
-
w && (
|
|
95
|
-
|
|
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]),
|
|
98
|
-
w || (
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
}, [w,
|
|
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
|
|
104
|
-
const { offsetWidth: e = 0, offsetHeight:
|
|
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:
|
|
112
|
+
}, { offsetWidth: d = 0, offsetHeight: u = 0 } = k.current || {}, [f, i] = K.split("-");
|
|
109
113
|
Y(M || e);
|
|
110
|
-
const E = (r.top || 0) -
|
|
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
|
-
|
|
114
|
-
E ?
|
|
117
|
+
P(
|
|
118
|
+
E ? S : r.top - u - y
|
|
115
119
|
);
|
|
116
120
|
break;
|
|
117
121
|
default:
|
|
118
|
-
|
|
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 -
|
|
130
|
+
L(r.left - Math.abs(e - d));
|
|
127
131
|
break;
|
|
128
132
|
default:
|
|
129
|
-
L(r.left + e / 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
|
-
}, [
|
|
137
|
-
R(O && !!
|
|
138
|
-
}, [O,
|
|
139
|
-
|
|
140
|
-
}, []), tt ? null :
|
|
141
|
-
/* @__PURE__ */ $(at, { onClick:
|
|
142
|
-
|
|
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:
|
|
150
|
+
transitionDuration: I,
|
|
147
151
|
...Q,
|
|
148
|
-
css:
|
|
152
|
+
css: _,
|
|
149
153
|
style: {
|
|
150
|
-
...
|
|
151
|
-
top:
|
|
154
|
+
...V,
|
|
155
|
+
top: g,
|
|
152
156
|
left: D,
|
|
153
|
-
bottom:
|
|
154
|
-
width: W ?
|
|
157
|
+
bottom: g === "auto" ? 24 : void 0,
|
|
158
|
+
width: W ? h : void 0
|
|
155
159
|
},
|
|
156
160
|
children: /* @__PURE__ */ $(
|
|
157
|
-
|
|
161
|
+
bt,
|
|
158
162
|
{
|
|
159
163
|
role: "menu",
|
|
160
164
|
ref: k,
|
|
161
|
-
disablePadding:
|
|
162
|
-
maxHeight:
|
|
165
|
+
disablePadding: G,
|
|
166
|
+
maxHeight: U,
|
|
163
167
|
...J,
|
|
164
|
-
children: H.map(
|
|
165
|
-
var r,
|
|
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
|
|
169
|
-
return /* @__PURE__ */
|
|
170
|
-
|
|
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) && ((
|
|
176
|
-
onClick:
|
|
177
|
-
onKeyDown:
|
|
178
|
-
tabIndex:
|
|
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 :
|
|
185
|
+
[M ? "width" : "minWidth"]: W ? void 0 : h,
|
|
182
186
|
maxWidth: W ? void 0 : "100%"
|
|
183
187
|
}
|
|
184
188
|
}),
|
|
185
|
-
|
|
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
|
-
|
|
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")
|
|
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
|
|
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(
|
|
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 '
|
|
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
|
|
4
|
+
import k from "../../hooks/useCheckHoverPossible/useCheckHoverPossible.es.js";
|
|
5
5
|
import c from "@emotion/styled";
|
|
6
|
-
const
|
|
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:
|
|
24
|
+
palette: { brand: e, grey: i }
|
|
25
25
|
},
|
|
26
26
|
selected: t,
|
|
27
27
|
disabled: r
|
|
28
|
-
}) => t ? e.primary.main : r ?
|
|
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:
|
|
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 :
|
|
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:
|
|
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
|
|
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 && (
|
|
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 && (
|
|
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:
|
|
80
|
+
children: i,
|
|
91
81
|
startAdornment: t,
|
|
92
82
|
endAdornment: r,
|
|
93
83
|
inlineCSS: p,
|
|
94
84
|
selected: n,
|
|
95
|
-
disabled:
|
|
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
|
-
|
|
93
|
+
v,
|
|
104
94
|
{
|
|
105
95
|
ref: g,
|
|
106
96
|
selected: n,
|
|
107
|
-
disabled:
|
|
97
|
+
disabled: o,
|
|
108
98
|
"data-value": u,
|
|
109
99
|
isHoverPossible: d,
|
|
110
100
|
onClick: (s) => {
|
|
111
|
-
s.stopPropagation(), !
|
|
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(
|
|
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
|
|
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,44 +1,53 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
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
|
-
},
|
|
17
|
-
if (
|
|
18
|
-
|
|
25
|
+
}, d = (t) => {
|
|
26
|
+
if (t.stopPropagation(), t.key === "ArrowDown" && !e) {
|
|
27
|
+
t.preventDefault(), n(t), i();
|
|
19
28
|
return;
|
|
20
29
|
}
|
|
21
|
-
if ((
|
|
22
|
-
|
|
30
|
+
if ((t.key === "Enter" || t.key === " ") && !e) {
|
|
31
|
+
t.preventDefault(), n(t), i();
|
|
23
32
|
return;
|
|
24
33
|
}
|
|
25
34
|
};
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
}, []), /* @__PURE__ */
|
|
29
|
-
|
|
35
|
+
return F(() => () => {
|
|
36
|
+
r.current && cancelAnimationFrame(r.current);
|
|
37
|
+
}, []), /* @__PURE__ */ p(
|
|
38
|
+
v,
|
|
30
39
|
{
|
|
31
|
-
ref:
|
|
40
|
+
ref: a,
|
|
32
41
|
type: "button",
|
|
33
42
|
"aria-haspopup": !0,
|
|
34
|
-
"aria-expanded":
|
|
35
|
-
"aria-controls":
|
|
36
|
-
onKeyDown:
|
|
37
|
-
onClick:
|
|
38
|
-
...
|
|
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
|
-
|
|
52
|
+
x as default
|
|
44
53
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { GeneralComponentProps, Size } from '
|
|
3
|
-
import { CSSValue } from '
|
|
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 '
|
|
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 '
|
|
3
|
-
import { GeneralComponentProps } from '
|
|
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 '
|
|
3
|
-
import { GeneralComponentProps, Size } from '
|
|
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 '
|
|
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 '
|
|
3
|
-
import { GeneralComponentProps, Variant } from '
|
|
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 '
|
|
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 '
|
|
2
|
+
import { GeneralComponentProps } from '../../../typings/component';
|
|
3
3
|
|
|
4
4
|
export interface OptionProps extends GeneralComponentProps<HTMLAttributes<HTMLLIElement>> {
|
|
5
5
|
value?: string;
|
package/Select/Select.d.ts
CHANGED
|
@@ -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 '
|
|
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;
|
package/Skeleton/Skeleton.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import { GeneralComponentProps } from '
|
|
3
|
-
import { TypographyBodyKey, TypographyCaptionKey, TypographyHeadlineKey } from '
|
|
4
|
-
import { CSSValue } from '
|
|
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}`;
|
package/Slider/Slider.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
import { GeneralComponentProps } from '
|
|
2
|
+
import { GeneralComponentProps } from '../../typings/component';
|
|
3
3
|
|
|
4
4
|
export interface SliderProps extends GeneralComponentProps<Omit<HTMLAttributes<HTMLDivElement>, 'onChange'>> {
|
|
5
5
|
value: number;
|