@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.
- package/Accordion/Accordion.cjs +13 -7
- package/Accordion/Accordion.d.ts +2 -0
- package/Accordion/Accordion.es.js +86 -65
- package/Autocomplete/Autocomplete.cjs +1 -1
- package/Autocomplete/Autocomplete.d.ts +1 -1
- package/Autocomplete/Autocomplete.es.js +235 -80
- package/BottomSheet/BottomSheet.cjs +5 -5
- package/BottomSheet/BottomSheet.d.ts +3 -0
- package/BottomSheet/BottomSheet.es.js +88 -70
- package/BottomSheet/BottomSheetText/BottomSheetText.cjs +2 -2
- package/BottomSheet/BottomSheetText/BottomSheetText.es.js +18 -6
- package/BottomSheet/BottomSheetTitle/BottomSheetTitle.cjs +6 -6
- package/BottomSheet/BottomSheetTitle/BottomSheetTitle.d.ts +2 -1
- package/BottomSheet/BottomSheetTitle/BottomSheetTitle.es.js +26 -15
- package/Button/Button.cjs +6 -6
- package/Button/Button.es.js +35 -29
- package/ChainPicker/ChainPicker.cjs +16 -6
- package/ChainPicker/ChainPicker.d.ts +4 -2
- package/ChainPicker/ChainPicker.es.js +155 -110
- package/ChainPicker/ChainPicker.stories.d.ts +1 -1
- package/Checkbox/Checkbox.cjs +3 -3
- package/Checkbox/Checkbox.es.js +12 -10
- package/CircularProgressIndicator/CircularProgressIndicator.cjs +5 -5
- package/CircularProgressIndicator/CircularProgressIndicator.es.js +25 -22
- package/DatePicker/DatePicker.cjs +37 -20
- package/DatePicker/DatePicker.d.ts +2 -1
- package/DatePicker/DatePicker.es.js +345 -320
- package/DatePicker/DatePicker.stories.d.ts +1 -0
- package/DatePicker/EventDot/EventDot.cjs +8 -0
- package/DatePicker/EventDot/EventDot.d.ts +8 -0
- package/DatePicker/EventDot/EventDot.es.js +19 -0
- package/DatePicker/EventDot/index.cjs +1 -0
- package/DatePicker/EventDot/index.d.ts +3 -0
- package/DatePicker/EventDot/index.es.js +4 -0
- package/DatePicker/EventDotGroup/EventDotGroup.cjs +8 -0
- package/DatePicker/EventDotGroup/EventDotGroup.d.ts +8 -0
- package/DatePicker/EventDotGroup/EventDotGroup.es.js +39 -0
- package/DatePicker/EventDotGroup/index.cjs +1 -0
- package/DatePicker/EventDotGroup/index.d.ts +3 -0
- package/DatePicker/EventDotGroup/index.es.js +4 -0
- package/DatePicker/index.cjs +1 -1
- package/DatePicker/index.d.ts +2 -0
- package/DatePicker/index.es.js +6 -2
- package/Dialog/Dialog.cjs +2 -2
- package/Dialog/Dialog.d.ts +2 -0
- package/Dialog/Dialog.es.js +45 -40
- package/Dialog/Dialog.stories.d.ts +10 -0
- package/Dialog/DialogText/DialogText.cjs +1 -1
- package/Dialog/DialogText/DialogText.es.js +1 -1
- package/Dialog/DialogTitle/DialogTitle.cjs +4 -4
- package/Dialog/DialogTitle/DialogTitle.d.ts +2 -1
- package/Dialog/DialogTitle/DialogTitle.es.js +17 -17
- package/FocusBoundary/FocusBoundary.cjs +1 -1
- package/FocusBoundary/FocusBoundary.d.ts +3 -1
- package/FocusBoundary/FocusBoundary.es.js +49 -42
- package/FormControlText/FormControlText.cjs +7 -5
- package/FormControlText/FormControlText.d.ts +2 -0
- package/FormControlText/FormControlText.es.js +50 -40
- package/Icon/Icon.cjs +1 -1
- package/Icon/Icon.es.js +1 -1
- package/IconButton/IconButton.cjs +8 -8
- package/IconButton/IconButton.es.js +32 -25
- package/LineProgressIndicator/LineProgressIndicator.cjs +6 -6
- package/LineProgressIndicator/LineProgressIndicator.es.js +34 -22
- package/Menu/Menu.cjs +16 -16
- package/Menu/Menu.d.ts +3 -2
- package/Menu/Menu.es.js +115 -81
- package/Menu/Menu.stories.d.ts +1 -0
- package/Menu/MenuBlock/MenuBlock.cjs +14 -7
- package/Menu/MenuBlock/MenuBlock.d.ts +1 -0
- package/Menu/MenuBlock/MenuBlock.es.js +47 -35
- package/Menu/MenuButton/MenuButton.cjs +1 -0
- package/Menu/MenuButton/MenuButton.d.ts +10 -0
- package/Menu/MenuButton/MenuButton.es.js +44 -0
- package/Menu/MenuButton/index.cjs +1 -0
- package/Menu/MenuButton/index.d.ts +3 -0
- package/Menu/MenuButton/index.es.js +4 -0
- package/Menu/index.cjs +1 -1
- package/Menu/index.d.ts +1 -0
- package/Menu/index.es.js +4 -2
- package/NumberKeypad/NumberKeypad.cjs +2 -2
- package/NumberKeypad/NumberKeypad.es.js +18 -16
- package/NumberKeypad/NumberKeypadBlock/NumberKeypadBlock.cjs +1 -1
- package/NumberKeypad/NumberKeypadBlock/NumberKeypadBlock.es.js +10 -1
- package/PageControl/PageControl.cjs +16 -5
- package/PageControl/PageControl.d.ts +3 -0
- package/PageControl/PageControl.es.js +77 -24
- package/PageControl/PageControl.stories.d.ts +1 -0
- package/Radio/Radio.cjs +3 -3
- package/Radio/Radio.es.js +22 -20
- package/RadioGroup/RadioGroup.cjs +1 -0
- package/RadioGroup/RadioGroup.d.ts +8 -0
- package/RadioGroup/RadioGroup.es.js +28 -0
- package/RadioGroup/RadioGroup.stories.d.ts +14 -0
- package/RadioGroup/index.cjs +1 -0
- package/RadioGroup/index.d.ts +3 -0
- package/RadioGroup/index.es.js +4 -0
- package/SegmentedButton/SegmentedButton.cjs +14 -3
- package/SegmentedButton/SegmentedButton.es.js +108 -34
- package/Select/Select.cjs +4 -4
- package/Select/Select.es.js +95 -86
- package/Slider/Slider.cjs +27 -12
- package/Slider/Slider.d.ts +1 -0
- package/Slider/Slider.es.js +177 -90
- package/Switch/Switch.cjs +28 -11
- package/Switch/Switch.d.ts +2 -0
- package/Switch/Switch.es.js +185 -65
- package/Switch/Switch.stories.d.ts +1 -0
- package/Tab/Tab.es.js +2 -4
- package/TextArea/TextArea.cjs +42 -34
- package/TextArea/TextArea.es.js +116 -82
- package/TextArea/TextArea.stories.d.ts +1 -1
- package/TextField/TextField.cjs +29 -13
- package/TextField/TextField.d.ts +2 -1
- package/TextField/TextField.es.js +122 -79
- package/TextField/TextField.stories.d.ts +1 -0
- package/Tooltip/Tooltip.cjs +7 -6
- package/Tooltip/Tooltip.d.ts +8 -3
- package/Tooltip/Tooltip.es.js +248 -146
- package/Tooltip/Tooltip.stories.d.ts +1 -0
- package/hooks/index.cjs +1 -1
- package/hooks/index.d.ts +3 -0
- package/hooks/index.es.js +7 -1
- package/hooks/useCheckHasFocus/useCheckHasFocus.cjs +1 -0
- package/hooks/useCheckHasFocus/useCheckHasFocus.d.ts +9 -0
- package/hooks/useCheckHasFocus/useCheckHasFocus.es.js +21 -0
- package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.cjs +1 -0
- package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.d.ts +4 -0
- package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.es.js +30 -0
- package/hooks/useFocusBoundary/useFocusBoundary.cjs +1 -0
- package/hooks/useFocusBoundary/useFocusBoundary.d.ts +12 -0
- package/hooks/useFocusBoundary/useFocusBoundary.es.js +63 -0
- package/index.cjs +1 -1
- package/index.d.ts +2 -1
- package/index.es.js +97 -90
- package/package.json +3 -3
- package/resources/tictoccroc/icons/fill/certified-fill.svg-B_RVx6K_.cjs +1 -0
- package/resources/tictoccroc/icons/fill/certified-fill.svg-CK7UqYft.js +5 -0
- package/resources/tictoccroc/icons/fill/index.d.ts +3 -0
- package/resources/tictoccroc/icons/fill/location-fill.svg-DfSHAnsd.js +5 -0
- package/resources/tictoccroc/icons/fill/location-fill.svg-Die9mxQH.cjs +1 -0
- package/resources/tictoccroc/icons/fill/send-fill.svg-CItD_2L1.js +5 -0
- package/resources/tictoccroc/icons/fill/send-fill.svg-D197Lwl0.cjs +1 -0
- package/resources/tictoccroc/icons/index.ts-BmqvB_n6.cjs +1 -0
- package/resources/tictoccroc/icons/index.ts-CzTh-XsD.js +228 -0
- package/resources/tictoccroc/icons/line/index.d.ts +4 -0
- package/resources/tictoccroc/icons/line/list-line.svg-r5d5htjN.cjs +1 -0
- package/resources/tictoccroc/icons/line/list-line.svg-yFfhZxUp.js +5 -0
- package/resources/tictoccroc/icons/line/monthly-line.svg-BdyaJ1t_.cjs +1 -0
- package/resources/tictoccroc/icons/line/monthly-line.svg-DY5-Xv34.js +5 -0
- package/resources/tictoccroc/icons/line/review-line.svg-B4rfJrsO.js +5 -0
- package/resources/tictoccroc/icons/line/review-line.svg-DYUuUybx.cjs +1 -0
- package/resources/tictoccroc/icons/line/weekly-line.svg-BCO-LS_a.cjs +1 -0
- package/resources/tictoccroc/icons/line/weekly-line.svg-BUPmmgeE.js +5 -0
- package/utils/getIconLabel/getIconLabel.cjs +1 -1
- package/utils/getIconLabel/getIconLabel.es.js +8 -1
- package/utils/getSibling/getSibling.es.js +1 -2
- package/resources/tictoccroc/icons/index.ts-CarI_z7q.js +0 -214
- package/resources/tictoccroc/icons/index.ts-IVJAK4qr.cjs +0 -1
package/Menu/Menu.es.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import
|
|
5
|
-
|
|
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`
|
|
6
7
|
position: fixed;
|
|
7
8
|
top: 0;
|
|
8
9
|
left: 0;
|
|
@@ -17,7 +18,7 @@ const nt = x.div`
|
|
|
17
18
|
}
|
|
18
19
|
}}}
|
|
19
20
|
|
|
20
|
-
`,
|
|
21
|
+
`, lt = I.div`
|
|
21
22
|
position: fixed;
|
|
22
23
|
max-width: calc(100% - ${({ theme: { spacing: o } }) => o.layout(4)}px);
|
|
23
24
|
border-radius: 10px;
|
|
@@ -34,16 +35,16 @@ const nt = x.div`
|
|
|
34
35
|
transform: scale(${({ open: o }) => o ? 1 : 0.97});
|
|
35
36
|
opacity: ${({ open: o }) => o ? 1 : 0};
|
|
36
37
|
z-index: 100003;
|
|
37
|
-
`,
|
|
38
|
+
`, pt = I.ul`
|
|
38
39
|
display: flex;
|
|
39
40
|
flex-direction: column;
|
|
40
41
|
max-height: ${({ maxHeight: o }) => o}px;
|
|
41
42
|
overflow-y: auto;
|
|
42
43
|
|
|
43
|
-
${({ theme: { spacing: o }, disablePadding:
|
|
44
|
+
${({ theme: { spacing: o }, disablePadding: l }) => l ? null : {
|
|
44
45
|
padding: `${o.content(1)}px 0`
|
|
45
46
|
}}}
|
|
46
|
-
`,
|
|
47
|
+
`, yt = I.div`
|
|
47
48
|
width: 100%;
|
|
48
49
|
height: 1px;
|
|
49
50
|
background-color: ${({
|
|
@@ -51,113 +52,146 @@ const nt = x.div`
|
|
|
51
52
|
palette: { grey: o }
|
|
52
53
|
}
|
|
53
54
|
}) => o[20]};
|
|
54
|
-
`,
|
|
55
|
-
children:
|
|
56
|
-
anchorRef:
|
|
57
|
-
open:
|
|
58
|
-
onClose:
|
|
59
|
-
spacing:
|
|
60
|
-
transitionDuration:
|
|
61
|
-
onChange:
|
|
55
|
+
`, T = 24, ht = ut(function({
|
|
56
|
+
children: l,
|
|
57
|
+
anchorRef: c,
|
|
58
|
+
open: w,
|
|
59
|
+
onClose: d,
|
|
60
|
+
spacing: y = 4,
|
|
61
|
+
transitionDuration: S = 200,
|
|
62
|
+
onChange: x,
|
|
62
63
|
value: B,
|
|
63
64
|
showDivider: G,
|
|
64
|
-
placement:
|
|
65
|
-
disablePadding:
|
|
66
|
-
disableClickOutside:
|
|
67
|
-
width:
|
|
68
|
-
fitToAnchorWidth:
|
|
65
|
+
placement: P = "bottom-center",
|
|
66
|
+
disablePadding: K,
|
|
67
|
+
disableClickOutside: U = !0,
|
|
68
|
+
width: M,
|
|
69
|
+
fitToAnchorWidth: W = !0,
|
|
69
70
|
maxHeight: V = 476,
|
|
70
71
|
style: _,
|
|
71
|
-
inlineCSS:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
inlineCSS: C,
|
|
73
|
+
menuProps: J,
|
|
74
|
+
...Q
|
|
75
|
+
}, 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) {
|
|
83
|
+
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());
|
|
86
|
+
}
|
|
87
|
+
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());
|
|
90
|
+
}
|
|
91
|
+
}
|
|
76
92
|
};
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
|
|
93
|
+
return b(() => {
|
|
94
|
+
w && (v.current && clearTimeout(v.current), document.body.style.overflow = "hidden", j(!1), m.current = setTimeout(() => {
|
|
95
|
+
N(!0);
|
|
80
96
|
}, 100));
|
|
81
|
-
}, [
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
}, [
|
|
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(() => {
|
|
86
102
|
const t = () => {
|
|
87
|
-
var
|
|
88
|
-
const { offsetWidth:
|
|
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()) || {
|
|
89
105
|
top: 0,
|
|
90
106
|
left: 0,
|
|
91
107
|
bottom: 0
|
|
92
|
-
}, { offsetWidth:
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
switch (
|
|
108
|
+
}, { offsetWidth: u = 0, offsetHeight: n = 0 } = k.current || {}, [f, i] = P.split("-");
|
|
109
|
+
Y(M || e);
|
|
110
|
+
const E = (r.top || 0) - n - y - T < T, rt = (r.bottom || 0) + n + y + T > window.innerHeight;
|
|
111
|
+
switch (f) {
|
|
96
112
|
case "top":
|
|
97
|
-
|
|
98
|
-
|
|
113
|
+
F(
|
|
114
|
+
E ? T : r.top - n - y
|
|
99
115
|
);
|
|
100
116
|
break;
|
|
101
117
|
default:
|
|
102
|
-
|
|
118
|
+
F(rt ? "auto" : r.top + s + y);
|
|
103
119
|
break;
|
|
104
120
|
}
|
|
105
|
-
switch (
|
|
121
|
+
switch (i) {
|
|
106
122
|
case "left":
|
|
107
|
-
|
|
123
|
+
L(r.left);
|
|
108
124
|
break;
|
|
109
125
|
case "right":
|
|
110
|
-
|
|
126
|
+
L(r.left - Math.abs(e - u));
|
|
111
127
|
break;
|
|
112
128
|
default:
|
|
113
|
-
|
|
129
|
+
L(r.left + e / 2 - u / 2);
|
|
114
130
|
break;
|
|
115
131
|
}
|
|
116
132
|
};
|
|
117
133
|
return t(), window.addEventListener("scroll", t), window.addEventListener("resize", t), () => {
|
|
118
134
|
window.removeEventListener("scroll", t), window.removeEventListener("resize", t);
|
|
119
135
|
};
|
|
120
|
-
}, [
|
|
121
|
-
|
|
122
|
-
}, [
|
|
123
|
-
|
|
124
|
-
}, []),
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
|
|
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,
|
|
127
143
|
{
|
|
128
|
-
ref:
|
|
129
|
-
open:
|
|
130
|
-
transitionDuration:
|
|
131
|
-
...
|
|
132
|
-
css:
|
|
144
|
+
ref: X,
|
|
145
|
+
open: Z,
|
|
146
|
+
transitionDuration: S,
|
|
147
|
+
...Q,
|
|
148
|
+
css: C,
|
|
133
149
|
style: {
|
|
134
150
|
..._,
|
|
135
|
-
top:
|
|
136
|
-
left:
|
|
137
|
-
bottom:
|
|
138
|
-
width:
|
|
151
|
+
top: h,
|
|
152
|
+
left: D,
|
|
153
|
+
bottom: h === "auto" ? 24 : void 0,
|
|
154
|
+
width: W ? g : void 0
|
|
139
155
|
},
|
|
140
|
-
children: /* @__PURE__ */
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
children: /* @__PURE__ */ $(
|
|
157
|
+
pt,
|
|
158
|
+
{
|
|
159
|
+
role: "menu",
|
|
160
|
+
ref: k,
|
|
161
|
+
disablePadding: K,
|
|
162
|
+
maxHeight: V,
|
|
163
|
+
...J,
|
|
164
|
+
children: H.map(l, (t, e) => {
|
|
165
|
+
var r, u, n, f, i, E;
|
|
166
|
+
if (!ct(t))
|
|
167
|
+
return null;
|
|
168
|
+
const s = ot === e;
|
|
169
|
+
return /* @__PURE__ */ st(nt, { children: [
|
|
170
|
+
dt(t, {
|
|
171
|
+
...t.props,
|
|
172
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
173
|
+
// @ts-expect-error
|
|
174
|
+
"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
|
+
style: {
|
|
180
|
+
...(E = t == null ? void 0 : t.props) == null ? void 0 : E.style,
|
|
181
|
+
[M ? "width" : "minWidth"]: W ? void 0 : g,
|
|
182
|
+
maxWidth: W ? void 0 : "100%"
|
|
183
|
+
}
|
|
184
|
+
}),
|
|
185
|
+
G && H.count(l) !== e + 1 && /* @__PURE__ */ $(yt, {})
|
|
186
|
+
] });
|
|
187
|
+
})
|
|
188
|
+
}
|
|
189
|
+
)
|
|
156
190
|
}
|
|
157
191
|
) }),
|
|
158
192
|
document.body
|
|
159
193
|
);
|
|
160
194
|
});
|
|
161
195
|
export {
|
|
162
|
-
|
|
196
|
+
ht as default
|
|
163
197
|
};
|
package/Menu/Menu.stories.d.ts
CHANGED
|
@@ -1,26 +1,33 @@
|
|
|
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"),$=e=>e&&e.__esModule?e:{default:e},c=$(S),j=c.default.li`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
gap: ${({theme:{spacing:e}})=>e.content(2)}px;
|
|
5
5
|
padding: 10px ${({theme:{spacing:e}})=>e.content(3)}px;
|
|
6
6
|
background-color: ${({theme:{palette:{grey:e}}})=>e.white};
|
|
7
7
|
cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
|
|
8
|
+
border: 2px solid transparent;
|
|
8
9
|
|
|
9
10
|
& svg {
|
|
10
11
|
width: 20px;
|
|
11
12
|
height: 20px;
|
|
12
|
-
color: ${({theme:{palette:{brand:e,grey:
|
|
13
|
+
color: ${({theme:{palette:{brand:e,grey:n}},selected:t,disabled:r})=>t?e.primary.main:r?n[30]:"inherit"};
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
${({ellipsis:e})=>e?{maxHeight:"40px"}:{}};
|
|
16
17
|
|
|
17
|
-
${({theme:{palette:{brand:e,grey:
|
|
18
|
-
|
|
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`
|
|
19
26
|
flex-grow: 1;
|
|
20
27
|
|
|
21
28
|
${({ellipsis:e})=>e?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:{}};
|
|
22
29
|
|
|
23
|
-
${({theme:{palette:{brand:e,grey:
|
|
24
|
-
`,
|
|
30
|
+
${({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
32
|
white-space: nowrap;
|
|
26
|
-
`,H=w.forwardRef(function({children:
|
|
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;
|
|
@@ -8,6 +8,7 @@ export interface MenuBlockProps extends GeneralComponentProps<HTMLAttributes<HTM
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
value?: string | number;
|
|
10
10
|
ellipsis?: boolean;
|
|
11
|
+
focused?: boolean;
|
|
11
12
|
}
|
|
12
13
|
declare const MenuBlock: import('react').ForwardRefExoticComponent<MenuBlockProps & import('react').RefAttributes<HTMLLIElement>>;
|
|
13
14
|
export default MenuBlock;
|
|
@@ -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
|
|
5
|
-
import
|
|
6
|
-
const
|
|
4
|
+
import $ from "../../hooks/useCheckHoverPossible/useCheckHoverPossible.es.js";
|
|
5
|
+
import c from "@emotion/styled";
|
|
6
|
+
const k = c.li`
|
|
7
7
|
display: flex;
|
|
8
8
|
align-items: center;
|
|
9
9
|
gap: ${({ theme: { spacing: e } }) => e.content(2)}px;
|
|
@@ -14,17 +14,18 @@ const v = a.li`
|
|
|
14
14
|
}
|
|
15
15
|
}) => e.white};
|
|
16
16
|
cursor: ${({ disabled: e }) => e ? "not-allowed" : "pointer"};
|
|
17
|
+
border: 2px solid transparent;
|
|
17
18
|
|
|
18
19
|
& svg {
|
|
19
20
|
width: 20px;
|
|
20
21
|
height: 20px;
|
|
21
22
|
color: ${({
|
|
22
23
|
theme: {
|
|
23
|
-
palette: { brand: e, grey:
|
|
24
|
+
palette: { brand: e, grey: o }
|
|
24
25
|
},
|
|
25
26
|
selected: t,
|
|
26
27
|
disabled: r
|
|
27
|
-
}) => t ? e.primary.main : r ?
|
|
28
|
+
}) => t ? e.primary.main : r ? o[30] : "inherit"};
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
${({ ellipsis: e }) => e ? {
|
|
@@ -33,16 +34,26 @@ const v = a.li`
|
|
|
33
34
|
|
|
34
35
|
${({
|
|
35
36
|
theme: {
|
|
36
|
-
palette: { brand: e, grey:
|
|
37
|
+
palette: { brand: e, grey: o }
|
|
37
38
|
},
|
|
38
39
|
selected: t,
|
|
39
40
|
isHoverPossible: r
|
|
40
41
|
}) => r ? {
|
|
41
42
|
"&:hover:not([disabled])": {
|
|
42
|
-
backgroundColor: t ? e.primary.bg :
|
|
43
|
+
backgroundColor: t ? e.primary.bg : o[10]
|
|
43
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
57
|
flex-grow: 1;
|
|
47
58
|
|
|
48
59
|
${({ ellipsis: e }) => e ? {
|
|
@@ -53,64 +64,65 @@ const v = a.li`
|
|
|
53
64
|
|
|
54
65
|
${({
|
|
55
66
|
theme: {
|
|
56
|
-
palette: { brand: e, grey:
|
|
67
|
+
palette: { brand: e, grey: o },
|
|
57
68
|
typography: { h5B: t, b4R: r }
|
|
58
69
|
},
|
|
59
|
-
selected:
|
|
70
|
+
selected: p,
|
|
60
71
|
disabled: n
|
|
61
72
|
}) => {
|
|
62
|
-
let
|
|
73
|
+
let i = {
|
|
63
74
|
fontSize: r.size,
|
|
64
75
|
fontWeight: r.weight,
|
|
65
76
|
letterSpacing: r.letterSpacing,
|
|
66
77
|
lineHeight: r.lineHeight
|
|
67
78
|
};
|
|
68
|
-
return
|
|
79
|
+
return p && (i = {
|
|
69
80
|
fontSize: t.size,
|
|
70
81
|
fontWeight: t.weight,
|
|
71
82
|
letterSpacing: t.letterSpacing,
|
|
72
83
|
lineHeight: t.lineHeight,
|
|
73
84
|
color: e.primary.text
|
|
74
|
-
}), n && (
|
|
85
|
+
}), n && (i.color = o[30]), i;
|
|
75
86
|
}}}
|
|
76
|
-
`,
|
|
87
|
+
`, a = c.div`
|
|
77
88
|
white-space: nowrap;
|
|
78
|
-
`,
|
|
79
|
-
children:
|
|
89
|
+
`, M = w(function({
|
|
90
|
+
children: o,
|
|
80
91
|
startAdornment: t,
|
|
81
92
|
endAdornment: r,
|
|
82
|
-
inlineCSS:
|
|
93
|
+
inlineCSS: p,
|
|
83
94
|
selected: n,
|
|
84
|
-
disabled:
|
|
85
|
-
value:
|
|
95
|
+
disabled: i,
|
|
96
|
+
value: u,
|
|
86
97
|
onClick: h,
|
|
87
98
|
ellipsis: f = !0,
|
|
88
|
-
...
|
|
89
|
-
},
|
|
90
|
-
const { isHoverPossible: d } =
|
|
99
|
+
...m
|
|
100
|
+
}, g) {
|
|
101
|
+
const { isHoverPossible: d } = $();
|
|
91
102
|
return /* @__PURE__ */ x(
|
|
92
|
-
|
|
103
|
+
k,
|
|
93
104
|
{
|
|
94
|
-
ref:
|
|
105
|
+
ref: g,
|
|
95
106
|
selected: n,
|
|
96
|
-
disabled:
|
|
97
|
-
"data-value":
|
|
107
|
+
disabled: i,
|
|
108
|
+
"data-value": u,
|
|
98
109
|
isHoverPossible: d,
|
|
99
|
-
onClick: (
|
|
100
|
-
|
|
110
|
+
onClick: (s) => {
|
|
111
|
+
s.stopPropagation(), !i && typeof h == "function" && h(s);
|
|
101
112
|
},
|
|
102
113
|
ellipsis: f,
|
|
103
|
-
|
|
104
|
-
|
|
114
|
+
role: "menuitem",
|
|
115
|
+
...m,
|
|
116
|
+
css: p,
|
|
105
117
|
children: [
|
|
106
|
-
t && /* @__PURE__ */ l(
|
|
107
|
-
/* @__PURE__ */ l(
|
|
108
|
-
!n && r && /* @__PURE__ */ l(
|
|
109
|
-
n && /* @__PURE__ */ l(
|
|
118
|
+
t && /* @__PURE__ */ l(a, { children: t }),
|
|
119
|
+
/* @__PURE__ */ l(v, { selected: n, disabled: i, ellipsis: f, children: o }),
|
|
120
|
+
!n && r && /* @__PURE__ */ l(a, { children: r }),
|
|
121
|
+
n && /* @__PURE__ */ l(a, { children: /* @__PURE__ */ l(y, { name: "CheckLine", color: "primary" }) })
|
|
110
122
|
]
|
|
111
123
|
}
|
|
112
124
|
);
|
|
113
125
|
});
|
|
114
126
|
export {
|
|
115
|
-
|
|
127
|
+
M as default
|
|
116
128
|
};
|
|
@@ -0,0 +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;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SyntheticEvent } from 'react';
|
|
2
|
+
import { ButtonProps } from '../Button/Button';
|
|
3
|
+
|
|
4
|
+
export interface MenuButtonProps extends ButtonProps {
|
|
5
|
+
isMenuOpen: boolean;
|
|
6
|
+
menuId: string;
|
|
7
|
+
onClick: (e: SyntheticEvent) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const MenuButton: import('react').ForwardRefExoticComponent<MenuButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
export default MenuButton;
|
|
@@ -0,0 +1,44 @@
|
|
|
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();
|
|
12
|
+
}
|
|
13
|
+
t.current = void 0;
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
}, f = (r) => {
|
|
17
|
+
if (r.stopPropagation(), r.key === "ArrowDown" && !n) {
|
|
18
|
+
o(r), u();
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if ((r.key === "Enter" || r.key === " ") && !n) {
|
|
22
|
+
o(r), u();
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return p(() => () => {
|
|
27
|
+
t.current && cancelAnimationFrame(t.current);
|
|
28
|
+
}, []), /* @__PURE__ */ m(
|
|
29
|
+
y,
|
|
30
|
+
{
|
|
31
|
+
ref: i,
|
|
32
|
+
type: "button",
|
|
33
|
+
"aria-haspopup": !0,
|
|
34
|
+
"aria-expanded": n,
|
|
35
|
+
"aria-controls": a,
|
|
36
|
+
onKeyDown: f,
|
|
37
|
+
onClick: o,
|
|
38
|
+
...c
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
});
|
|
42
|
+
export {
|
|
43
|
+
F as default
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./MenuButton.cjs");exports.default=e.default;
|
package/Menu/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Menu.cjs"),u=require("./MenuBlock/MenuBlock.cjs");exports.default=e.default;exports.MenuBlock=u.default;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Menu.cjs"),u=require("./MenuBlock/MenuBlock.cjs"),t=require("./MenuButton/MenuButton.cjs");exports.default=e.default;exports.MenuBlock=u.default;exports.MenuButton=t.default;
|
package/Menu/index.d.ts
CHANGED
package/Menu/index.es.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import o from "./Menu.es.js";
|
|
2
|
-
import { default as
|
|
2
|
+
import { default as u } from "./MenuBlock/MenuBlock.es.js";
|
|
3
|
+
import { default as f } from "./MenuButton/MenuButton.es.js";
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
+
u as MenuBlock,
|
|
6
|
+
f as MenuButton,
|
|
5
7
|
o as default
|
|
6
8
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("@emotion/react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("@emotion/react/jsx-runtime"),n=require("react"),b=require("@emotion/styled"),m=e=>e&&e.__esModule?e:{default:e},_=m(b),g=_.default.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-content: center;
|
|
4
4
|
justify-content: space-between;
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
gap: ${({theme:{spacing:e}})=>e.content(3)}px;
|
|
7
7
|
|
|
8
8
|
${({maxWidth:e})=>({maxWidth:e})}
|
|
9
|
-
`,
|
|
9
|
+
`,x=n.forwardRef(function({children:u,maxWidth:s,size:o="small",onChange:a,disabled:i,inlineCSS:c,...d},p){const f=(t,r)=>l=>{l.stopPropagation(),typeof a=="function"&&a(t,r)};return y.jsx(g,{ref:p,maxWidth:s||(o==="large"?264:228),role:"group","aria-label":"가상 숫자 키패드",...d,css:c,children:n.Children.map(u,t=>{var r,l;return n.isValidElement(t)?n.cloneElement(t,{disabled:i,size:o,onClick:f((r=t.props)==null?void 0:r.value,(l=t.props)==null?void 0:l.children),...t.props}):null})})});exports.default=x;
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
import { jsx as u } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { forwardRef as m, Children as y, isValidElement as x, cloneElement as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
2
|
+
import { forwardRef as m, Children as y, isValidElement as x, cloneElement as b } from "react";
|
|
3
|
+
import h from "@emotion/styled";
|
|
4
|
+
const g = h.div`
|
|
5
5
|
display: flex;
|
|
6
6
|
align-content: center;
|
|
7
7
|
justify-content: space-between;
|
|
8
8
|
flex-wrap: wrap;
|
|
9
|
-
gap: ${({ theme: { spacing:
|
|
9
|
+
gap: ${({ theme: { spacing: e } }) => e.content(3)}px;
|
|
10
10
|
|
|
11
|
-
${({ maxWidth:
|
|
12
|
-
`, j = m(function({ children:
|
|
13
|
-
const f = (r,
|
|
14
|
-
o.stopPropagation(), typeof
|
|
11
|
+
${({ maxWidth: e }) => ({ maxWidth: e })}
|
|
12
|
+
`, j = m(function({ children: n, maxWidth: l, size: p = "small", onChange: a, disabled: i, inlineCSS: c, ...s }, d) {
|
|
13
|
+
const f = (r, t) => (o) => {
|
|
14
|
+
o.stopPropagation(), typeof a == "function" && a(r, t);
|
|
15
15
|
};
|
|
16
16
|
return /* @__PURE__ */ u(
|
|
17
|
-
|
|
17
|
+
g,
|
|
18
18
|
{
|
|
19
19
|
ref: d,
|
|
20
|
-
maxWidth:
|
|
20
|
+
maxWidth: l || (p === "large" ? 264 : 228),
|
|
21
|
+
role: "group",
|
|
22
|
+
"aria-label": "가상 숫자 키패드",
|
|
21
23
|
...s,
|
|
22
24
|
css: c,
|
|
23
|
-
children: y.map(
|
|
24
|
-
var
|
|
25
|
-
return x(r) ?
|
|
26
|
-
disabled:
|
|
27
|
-
size:
|
|
28
|
-
onClick: f((
|
|
25
|
+
children: y.map(n, (r) => {
|
|
26
|
+
var t, o;
|
|
27
|
+
return x(r) ? b(r, {
|
|
28
|
+
disabled: i,
|
|
29
|
+
size: p,
|
|
30
|
+
onClick: f((t = r.props) == null ? void 0 : t.value, (o = r.props) == null ? void 0 : o.children),
|
|
29
31
|
...r.props
|
|
30
32
|
}) : null;
|
|
31
33
|
})
|