@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/Tooltip/Tooltip.es.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
1
|
+
import { jsxs as S, jsx as u } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef as H, useId as L, useRef as T, useState as M, useEffect as w, Children as V, isValidElement as W, cloneElement as G } from "react";
|
|
3
|
+
import h from "../Flexbox/Flexbox.es.js";
|
|
4
|
+
import C from "../Icon/Icon.es.js";
|
|
5
|
+
import J from "../Typography/Typography.es.js";
|
|
6
|
+
import Q from "../hooks/useCheckKeyboardMode/useCheckKeyboardMode.es.js";
|
|
7
|
+
import z from "@emotion/styled";
|
|
8
|
+
const U = z.div`
|
|
8
9
|
position: relative;
|
|
9
10
|
display: inline-block;
|
|
10
11
|
&[open] > .tooltip {
|
|
11
12
|
display: flex;
|
|
12
13
|
}
|
|
13
|
-
`,
|
|
14
|
+
`, Z = z.div`
|
|
14
15
|
position: absolute;
|
|
15
16
|
display: none;
|
|
16
17
|
flex-direction: column;
|
|
@@ -23,20 +24,21 @@ const w = c.div`
|
|
|
23
24
|
max-height: calc(136px - 8px);
|
|
24
25
|
z-index: 100003;
|
|
25
26
|
white-space: nowrap;
|
|
27
|
+
word-break: break-all;
|
|
26
28
|
|
|
27
29
|
${({
|
|
28
30
|
theme: {
|
|
29
|
-
palette: { brand: t, grey:
|
|
31
|
+
palette: { brand: t, grey: e }
|
|
30
32
|
},
|
|
31
|
-
color:
|
|
33
|
+
color: b
|
|
32
34
|
}) => {
|
|
33
35
|
let r = {};
|
|
34
|
-
return
|
|
36
|
+
return b === "primary" && (r = {
|
|
35
37
|
backgroundColor: t.primary.tooltip,
|
|
36
|
-
color:
|
|
37
|
-
}),
|
|
38
|
-
backgroundColor:
|
|
39
|
-
color:
|
|
38
|
+
color: e[100]
|
|
39
|
+
}), b === "secondary" && (r = {
|
|
40
|
+
backgroundColor: e[80],
|
|
41
|
+
color: e.white
|
|
40
42
|
}), r;
|
|
41
43
|
}}
|
|
42
44
|
|
|
@@ -45,7 +47,7 @@ const w = c.div`
|
|
|
45
47
|
fontWeight: t.b4R.weight,
|
|
46
48
|
lineHeight: t.b4R.lineHeight,
|
|
47
49
|
letterSpacing: t.b4R.letterSpacing,
|
|
48
|
-
"& svg:not(.
|
|
50
|
+
"& svg:not(.tooltip-closer)": {
|
|
49
51
|
width: 24,
|
|
50
52
|
height: 24
|
|
51
53
|
}
|
|
@@ -53,24 +55,27 @@ const w = c.div`
|
|
|
53
55
|
|
|
54
56
|
${({
|
|
55
57
|
theme: {
|
|
56
|
-
palette: { brand: t, grey:
|
|
58
|
+
palette: { brand: t, grey: e }
|
|
57
59
|
},
|
|
58
|
-
placement:
|
|
59
|
-
color: r
|
|
60
|
+
placement: b,
|
|
61
|
+
color: r,
|
|
62
|
+
offset: s,
|
|
63
|
+
arrowOffset: c
|
|
60
64
|
}) => {
|
|
61
|
-
let
|
|
62
|
-
|
|
65
|
+
let o = {};
|
|
66
|
+
const n = (s == null ? void 0 : s.x) || 0, p = (s == null ? void 0 : s.y) || 0, l = (c == null ? void 0 : c.x) || 0, a = (c == null ? void 0 : c.y) || 0;
|
|
67
|
+
switch (b) {
|
|
63
68
|
case "bottom-left":
|
|
64
|
-
|
|
65
|
-
top:
|
|
66
|
-
left:
|
|
69
|
+
o = {
|
|
70
|
+
top: `calc(-12px + ${p}px)`,
|
|
71
|
+
left: `calc(-6px + ${n}px)`,
|
|
67
72
|
transform: "translateY(-100%)",
|
|
68
73
|
"&:after": {
|
|
69
74
|
content: '""',
|
|
70
75
|
position: "absolute",
|
|
71
76
|
top: "100%",
|
|
72
|
-
left:
|
|
73
|
-
borderTop: `8px solid ${r === "primary" ? t.primary.tooltip :
|
|
77
|
+
left: `calc(12px + ${l}px)`,
|
|
78
|
+
borderTop: `8px solid ${r === "primary" ? t.primary.tooltip : e[80]}`,
|
|
74
79
|
borderRight: "6px solid transparent",
|
|
75
80
|
borderBottom: "8px solid transparent",
|
|
76
81
|
borderLeft: "6px solid transparent"
|
|
@@ -78,17 +83,17 @@ const w = c.div`
|
|
|
78
83
|
};
|
|
79
84
|
break;
|
|
80
85
|
case "bottom-center":
|
|
81
|
-
|
|
82
|
-
top:
|
|
86
|
+
o = {
|
|
87
|
+
top: `calc(-12px + ${p}px)`,
|
|
83
88
|
left: "50%",
|
|
84
|
-
transform:
|
|
89
|
+
transform: `translate(calc(-50% + ${n}px), -100%)`,
|
|
85
90
|
"&:after": {
|
|
86
91
|
content: '""',
|
|
87
92
|
position: "absolute",
|
|
88
93
|
top: "100%",
|
|
89
|
-
left:
|
|
94
|
+
left: `calc(50% + ${l}px)`,
|
|
90
95
|
transform: "translateX(-50%)",
|
|
91
|
-
borderTop: `8px solid ${r === "primary" ? t.primary.tooltip :
|
|
96
|
+
borderTop: `8px solid ${r === "primary" ? t.primary.tooltip : e[80]}`,
|
|
92
97
|
borderRight: "6px solid transparent",
|
|
93
98
|
borderBottom: "8px solid transparent",
|
|
94
99
|
borderLeft: "6px solid transparent"
|
|
@@ -96,16 +101,16 @@ const w = c.div`
|
|
|
96
101
|
};
|
|
97
102
|
break;
|
|
98
103
|
case "bottom-right":
|
|
99
|
-
|
|
100
|
-
top:
|
|
101
|
-
right:
|
|
104
|
+
o = {
|
|
105
|
+
top: `calc(-12px + ${p}px)`,
|
|
106
|
+
right: `calc(-6px - ${n}px)`,
|
|
102
107
|
transform: "translateY(-100%)",
|
|
103
108
|
"&:after": {
|
|
104
109
|
content: '""',
|
|
105
110
|
position: "absolute",
|
|
106
111
|
top: "100%",
|
|
107
|
-
right:
|
|
108
|
-
borderTop: `8px solid ${r === "primary" ? t.primary.tooltip :
|
|
112
|
+
right: `calc(12px - ${l}px)`,
|
|
113
|
+
borderTop: `8px solid ${r === "primary" ? t.primary.tooltip : e[80]}`,
|
|
109
114
|
borderRight: "6px solid transparent",
|
|
110
115
|
borderBottom: "8px solid transparent",
|
|
111
116
|
borderLeft: "6px solid transparent"
|
|
@@ -113,229 +118,326 @@ const w = c.div`
|
|
|
113
118
|
};
|
|
114
119
|
break;
|
|
115
120
|
case "left-top":
|
|
116
|
-
|
|
117
|
-
top:
|
|
118
|
-
left:
|
|
121
|
+
o = {
|
|
122
|
+
top: `calc(-6px + ${p}px)`,
|
|
123
|
+
left: `calc(100% + 12px + ${n}px)`,
|
|
119
124
|
"&:after": {
|
|
120
125
|
content: '""',
|
|
121
126
|
position: "absolute",
|
|
122
|
-
top:
|
|
127
|
+
top: `calc(12px + ${a}px)`,
|
|
123
128
|
right: "100%",
|
|
124
129
|
borderTop: "6px solid transparent",
|
|
125
|
-
borderRight: `8px solid ${r === "primary" ? t.primary.tooltip :
|
|
130
|
+
borderRight: `8px solid ${r === "primary" ? t.primary.tooltip : e[80]}`,
|
|
126
131
|
borderBottom: "6px solid transparent",
|
|
127
132
|
borderLeft: "8px solid transparent"
|
|
128
133
|
}
|
|
129
134
|
};
|
|
130
135
|
break;
|
|
131
136
|
case "left-middle":
|
|
132
|
-
|
|
137
|
+
o = {
|
|
133
138
|
top: "50%",
|
|
134
|
-
left:
|
|
135
|
-
transform:
|
|
139
|
+
left: `calc(100% + 12px + ${n}px)`,
|
|
140
|
+
transform: `translateY(calc(-50% + ${p}px))`,
|
|
136
141
|
"&:after": {
|
|
137
142
|
content: '""',
|
|
138
143
|
position: "absolute",
|
|
139
|
-
top:
|
|
144
|
+
top: `calc(50% + ${a}px)`,
|
|
140
145
|
right: "100%",
|
|
141
146
|
transform: "translateY(-50%)",
|
|
142
147
|
borderTop: "6px solid transparent",
|
|
143
|
-
borderRight: `8px solid ${r === "primary" ? t.primary.tooltip :
|
|
148
|
+
borderRight: `8px solid ${r === "primary" ? t.primary.tooltip : e[80]}`,
|
|
144
149
|
borderBottom: "6px solid transparent",
|
|
145
150
|
borderLeft: "8px solid transparent"
|
|
146
151
|
}
|
|
147
152
|
};
|
|
148
153
|
break;
|
|
149
154
|
case "left-bottom":
|
|
150
|
-
|
|
151
|
-
bottom:
|
|
152
|
-
left:
|
|
155
|
+
o = {
|
|
156
|
+
bottom: `calc(-6px - ${p}px)`,
|
|
157
|
+
left: `calc(100% + 12px + ${n}px)`,
|
|
153
158
|
"&:after": {
|
|
154
159
|
content: '""',
|
|
155
160
|
position: "absolute",
|
|
156
|
-
bottom:
|
|
161
|
+
bottom: `calc(12px - ${a}px)`,
|
|
157
162
|
right: "100%",
|
|
158
163
|
borderTop: "6px solid transparent",
|
|
159
|
-
borderRight: `8px solid ${r === "primary" ? t.primary.tooltip :
|
|
164
|
+
borderRight: `8px solid ${r === "primary" ? t.primary.tooltip : e[80]}`,
|
|
160
165
|
borderBottom: "6px solid transparent",
|
|
161
166
|
borderLeft: "8px solid transparent"
|
|
162
167
|
}
|
|
163
168
|
};
|
|
164
169
|
break;
|
|
165
170
|
case "top-left":
|
|
166
|
-
|
|
167
|
-
left:
|
|
168
|
-
transform:
|
|
171
|
+
o = {
|
|
172
|
+
left: `calc(-6px + ${n}px)`,
|
|
173
|
+
transform: `translate(0, calc(12px + ${p}px))`,
|
|
169
174
|
"&:after": {
|
|
170
175
|
content: '""',
|
|
171
176
|
position: "absolute",
|
|
172
177
|
bottom: "100%",
|
|
173
|
-
left:
|
|
178
|
+
left: `calc(12px + ${l}px)`,
|
|
174
179
|
borderTop: "8px solid transparent",
|
|
175
180
|
borderRight: "6px solid transparent",
|
|
176
|
-
borderBottom: `8px solid ${r === "primary" ? t.primary.tooltip :
|
|
181
|
+
borderBottom: `8px solid ${r === "primary" ? t.primary.tooltip : e[80]}`,
|
|
177
182
|
borderLeft: "6px solid transparent"
|
|
178
183
|
}
|
|
179
184
|
};
|
|
180
185
|
break;
|
|
181
186
|
case "top-center":
|
|
182
|
-
|
|
187
|
+
o = {
|
|
183
188
|
right: "50%",
|
|
184
|
-
transform:
|
|
189
|
+
transform: `translate(calc(50% + ${n}px), calc(12px + ${p}px))`,
|
|
185
190
|
"&:after": {
|
|
186
191
|
content: '""',
|
|
187
192
|
position: "absolute",
|
|
188
193
|
bottom: "100%",
|
|
189
|
-
left:
|
|
194
|
+
left: `calc(50% + ${l}px)`,
|
|
190
195
|
transform: "translateX(-50%)",
|
|
191
196
|
borderTop: "8px solid transparent",
|
|
192
197
|
borderRight: "6px solid transparent",
|
|
193
|
-
borderBottom: `8px solid ${r === "primary" ? t.primary.tooltip :
|
|
198
|
+
borderBottom: `8px solid ${r === "primary" ? t.primary.tooltip : e[80]}`,
|
|
194
199
|
borderLeft: "6px solid transparent"
|
|
195
200
|
}
|
|
196
201
|
};
|
|
197
202
|
break;
|
|
198
203
|
case "top-right":
|
|
199
|
-
|
|
200
|
-
right:
|
|
201
|
-
transform:
|
|
204
|
+
o = {
|
|
205
|
+
right: `calc(-6px - ${n}px)`,
|
|
206
|
+
transform: `translate(0, calc(12px + ${p}px))`,
|
|
202
207
|
"&:after": {
|
|
203
208
|
content: '""',
|
|
204
209
|
position: "absolute",
|
|
205
210
|
bottom: "100%",
|
|
206
|
-
right:
|
|
211
|
+
right: `calc(12px - ${l}px)`,
|
|
207
212
|
borderTop: "8px solid transparent",
|
|
208
213
|
borderRight: "6px solid transparent",
|
|
209
|
-
borderBottom: `8px solid ${r === "primary" ? t.primary.tooltip :
|
|
214
|
+
borderBottom: `8px solid ${r === "primary" ? t.primary.tooltip : e[80]}`,
|
|
210
215
|
borderLeft: "6px solid transparent"
|
|
211
216
|
}
|
|
212
217
|
};
|
|
213
218
|
break;
|
|
214
219
|
case "right-top":
|
|
215
|
-
|
|
216
|
-
top:
|
|
217
|
-
right:
|
|
220
|
+
o = {
|
|
221
|
+
top: `calc(-6px + ${p}px)`,
|
|
222
|
+
right: `calc(100% + 12px + ${n}px)`,
|
|
218
223
|
"&:after": {
|
|
219
224
|
content: '""',
|
|
220
225
|
position: "absolute",
|
|
221
|
-
top:
|
|
226
|
+
top: `calc(12px + ${a}px)`,
|
|
222
227
|
left: "100%",
|
|
223
228
|
borderTop: "6px solid transparent",
|
|
224
229
|
borderRight: "8px solid transparent",
|
|
225
230
|
borderBottom: "6px solid transparent",
|
|
226
|
-
borderLeft: `8px solid ${r === "primary" ? t.primary.tooltip :
|
|
231
|
+
borderLeft: `8px solid ${r === "primary" ? t.primary.tooltip : e[80]}`
|
|
227
232
|
}
|
|
228
233
|
};
|
|
229
234
|
break;
|
|
230
235
|
case "right-middle":
|
|
231
|
-
|
|
236
|
+
o = {
|
|
232
237
|
top: "50%",
|
|
233
|
-
right:
|
|
234
|
-
transform:
|
|
238
|
+
right: `calc(100% + 12px + ${n}px)`,
|
|
239
|
+
transform: `translateY(calc(-50% + ${p}px))`,
|
|
235
240
|
"&:after": {
|
|
236
241
|
content: '""',
|
|
237
242
|
position: "absolute",
|
|
238
|
-
top:
|
|
243
|
+
top: `calc(50% + ${a}px)`,
|
|
239
244
|
left: "100%",
|
|
240
245
|
transform: "translateY(-50%)",
|
|
241
246
|
borderTop: "6px solid transparent",
|
|
242
247
|
borderRight: "8px solid transparent",
|
|
243
248
|
borderBottom: "6px solid transparent",
|
|
244
|
-
borderLeft: `8px solid ${r === "primary" ? t.primary.tooltip :
|
|
249
|
+
borderLeft: `8px solid ${r === "primary" ? t.primary.tooltip : e[80]}`
|
|
245
250
|
}
|
|
246
251
|
};
|
|
247
252
|
break;
|
|
248
253
|
case "right-bottom":
|
|
249
|
-
|
|
250
|
-
bottom:
|
|
251
|
-
right:
|
|
254
|
+
o = {
|
|
255
|
+
bottom: `calc(-6px - ${p}px)`,
|
|
256
|
+
right: `calc(100% + 12px + ${n}px)`,
|
|
252
257
|
"&:after": {
|
|
253
258
|
content: '""',
|
|
254
259
|
position: "absolute",
|
|
255
|
-
bottom:
|
|
260
|
+
bottom: `calc(12px - ${a}px)`,
|
|
256
261
|
left: "100%",
|
|
257
262
|
borderTop: "6px solid transparent",
|
|
258
263
|
borderRight: "8px solid transparent",
|
|
259
264
|
borderBottom: "6px solid transparent",
|
|
260
|
-
borderLeft: `8px solid ${r === "primary" ? t.primary.tooltip :
|
|
265
|
+
borderLeft: `8px solid ${r === "primary" ? t.primary.tooltip : e[80]}`
|
|
261
266
|
}
|
|
262
267
|
};
|
|
263
268
|
break;
|
|
264
269
|
}
|
|
265
|
-
return
|
|
270
|
+
return o;
|
|
266
271
|
}};
|
|
267
|
-
`,
|
|
268
|
-
children:
|
|
269
|
-
placement:
|
|
272
|
+
`, ot = H(function({
|
|
273
|
+
children: e,
|
|
274
|
+
placement: b = "bottom-center",
|
|
270
275
|
color: r = "primary",
|
|
271
|
-
title:
|
|
272
|
-
body:
|
|
273
|
-
closer:
|
|
274
|
-
endAdornment:
|
|
275
|
-
inlineCSS:
|
|
276
|
-
open:
|
|
277
|
-
onClose:
|
|
278
|
-
wrapperProps:
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
276
|
+
title: s,
|
|
277
|
+
body: c,
|
|
278
|
+
closer: o,
|
|
279
|
+
endAdornment: n,
|
|
280
|
+
inlineCSS: p,
|
|
281
|
+
open: l = !1,
|
|
282
|
+
onClose: a,
|
|
283
|
+
wrapperProps: $,
|
|
284
|
+
offset: D,
|
|
285
|
+
arrowOffset: j,
|
|
286
|
+
...y
|
|
287
|
+
}, X) {
|
|
288
|
+
const q = L(), B = L(), v = L(), { isKeyboardMode: g } = Q(), k = T(null), R = T(null), I = T(!0), [N, F] = M(!1), E = (y == null ? void 0 : y.id) || q, K = (i) => {
|
|
289
|
+
(i.key === "Enter" || i.key === " ") && (a == null || a(i));
|
|
290
|
+
};
|
|
291
|
+
return w(() => {
|
|
292
|
+
R.current && R.current.getBoundingClientRect().width >= 276 && F(!0);
|
|
293
|
+
}, [l]), w(() => {
|
|
294
|
+
const i = (d) => {
|
|
295
|
+
d.key === "Escape" && l && (d.stopPropagation(), a == null || a(d));
|
|
296
|
+
};
|
|
297
|
+
return document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i);
|
|
298
|
+
}, [l, a]), w(() => {
|
|
299
|
+
var d, m, x;
|
|
300
|
+
if (I.current) {
|
|
301
|
+
I.current = !1;
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
if (l) {
|
|
305
|
+
const f = (d = k.current) == null ? void 0 : d.querySelector(
|
|
306
|
+
'.tooltip-closer[role="button"]'
|
|
307
|
+
);
|
|
308
|
+
if (f && g && f.focus(), !f) {
|
|
309
|
+
const Y = (m = k.current) == null ? void 0 : m.querySelector('[role="button"]');
|
|
310
|
+
Y && g && Y.focus();
|
|
311
|
+
}
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
const i = (x = k.current) == null ? void 0 : x.querySelector('[role="button"]');
|
|
315
|
+
i && g && i.focus();
|
|
316
|
+
}, [l, g]), /* @__PURE__ */ S(
|
|
317
|
+
U,
|
|
318
|
+
{
|
|
319
|
+
ref: k,
|
|
320
|
+
open: l,
|
|
321
|
+
...$,
|
|
322
|
+
css: $ == null ? void 0 : $.inlineCSS,
|
|
323
|
+
children: [
|
|
324
|
+
V.map(e, (i) => {
|
|
325
|
+
if (!W(i))
|
|
326
|
+
return i;
|
|
327
|
+
const d = (m) => {
|
|
328
|
+
var x, f;
|
|
329
|
+
(m.key === "Enter" || m.key === " ") && ((f = (x = i.props) == null ? void 0 : x.onClick) == null || f.call(x, m));
|
|
330
|
+
};
|
|
331
|
+
return G(i, {
|
|
332
|
+
inlineCSS: {
|
|
333
|
+
cursor: "pointer",
|
|
334
|
+
"&:active": {
|
|
335
|
+
outline: "none"
|
|
336
|
+
},
|
|
337
|
+
...i.props.inlineCSS
|
|
338
|
+
},
|
|
339
|
+
role: "button",
|
|
340
|
+
tabIndex: 0,
|
|
341
|
+
"aria-hidden": !1,
|
|
342
|
+
"aria-expanded": l,
|
|
343
|
+
"aria-haspopup": "dialog",
|
|
344
|
+
"aria-controls": E,
|
|
345
|
+
focusable: !0,
|
|
346
|
+
onKeyDown: d,
|
|
347
|
+
...i.props
|
|
348
|
+
});
|
|
349
|
+
}),
|
|
350
|
+
/* @__PURE__ */ S(
|
|
351
|
+
Z,
|
|
352
|
+
{
|
|
353
|
+
id: E,
|
|
354
|
+
className: "tooltip",
|
|
355
|
+
role: "dialog",
|
|
356
|
+
"aria-modal": "true",
|
|
357
|
+
"aria-labelledby": s ? B : void 0,
|
|
358
|
+
"aria-describedby": c ? v : void 0,
|
|
359
|
+
ref: X,
|
|
360
|
+
placement: b,
|
|
361
|
+
color: r,
|
|
362
|
+
offset: D,
|
|
363
|
+
arrowOffset: j,
|
|
364
|
+
...y,
|
|
365
|
+
css: p,
|
|
366
|
+
children: [
|
|
367
|
+
s && /* @__PURE__ */ S(h, { alignItems: "center", justifyContent: "space-between", gap: 2, children: [
|
|
368
|
+
/* @__PURE__ */ u(
|
|
369
|
+
J,
|
|
322
370
|
{
|
|
323
|
-
|
|
371
|
+
id: B,
|
|
372
|
+
variant: "h5B",
|
|
373
|
+
color: r === "primary" ? "grey.100" : "grey.white",
|
|
374
|
+
children: s
|
|
375
|
+
}
|
|
376
|
+
),
|
|
377
|
+
o && /* @__PURE__ */ u(h, { flexShrink: 0, children: /* @__PURE__ */ u(
|
|
378
|
+
C,
|
|
379
|
+
{
|
|
380
|
+
className: "tooltip-closer",
|
|
324
381
|
name: "CloseLine",
|
|
325
382
|
size: "xSmall",
|
|
326
383
|
color: r === "primary" ? "grey.100" : "grey.white",
|
|
327
|
-
|
|
328
|
-
|
|
384
|
+
role: "button",
|
|
385
|
+
"aria-hidden": "false",
|
|
386
|
+
focusable: "true",
|
|
387
|
+
tabIndex: 0,
|
|
388
|
+
onClick: a,
|
|
389
|
+
onKeyDown: K,
|
|
390
|
+
"aria-label": "닫기",
|
|
391
|
+
inlineCSS: {
|
|
392
|
+
marginLeft: "2px",
|
|
393
|
+
cursor: "pointer",
|
|
394
|
+
"&:active": { outline: "none" }
|
|
395
|
+
}
|
|
329
396
|
}
|
|
330
397
|
) })
|
|
331
|
-
]
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
398
|
+
] }),
|
|
399
|
+
c && /* @__PURE__ */ S(
|
|
400
|
+
h,
|
|
401
|
+
{
|
|
402
|
+
id: v,
|
|
403
|
+
alignItems: "center",
|
|
404
|
+
gap: 2,
|
|
405
|
+
ref: R,
|
|
406
|
+
style: N ? { width: "276px", whiteSpace: "wrap" } : {},
|
|
407
|
+
children: [
|
|
408
|
+
c,
|
|
409
|
+
n && /* @__PURE__ */ u(h, { flexShrink: 0, inlineCSS: { fontSize: "24px" }, children: n }),
|
|
410
|
+
!s && o && /* @__PURE__ */ u(h, { flexShrink: 0, children: /* @__PURE__ */ u(
|
|
411
|
+
C,
|
|
412
|
+
{
|
|
413
|
+
className: "tooltip-closer",
|
|
414
|
+
name: "CloseLine",
|
|
415
|
+
size: "xSmall",
|
|
416
|
+
color: r === "primary" ? "grey.100" : "grey.white",
|
|
417
|
+
role: "button",
|
|
418
|
+
"aria-hidden": "false",
|
|
419
|
+
focusable: "true",
|
|
420
|
+
tabIndex: 0,
|
|
421
|
+
onClick: a,
|
|
422
|
+
onKeyDown: K,
|
|
423
|
+
"aria-label": "닫기",
|
|
424
|
+
inlineCSS: {
|
|
425
|
+
marginLeft: "2px",
|
|
426
|
+
cursor: "pointer",
|
|
427
|
+
"&:active": { outline: "none" }
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
) })
|
|
431
|
+
]
|
|
432
|
+
}
|
|
433
|
+
)
|
|
434
|
+
]
|
|
435
|
+
}
|
|
436
|
+
)
|
|
437
|
+
]
|
|
438
|
+
}
|
|
439
|
+
);
|
|
338
440
|
});
|
|
339
441
|
export {
|
|
340
|
-
|
|
442
|
+
ot as default
|
|
341
443
|
};
|
package/hooks/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useCheckHoverPossible/useCheckHoverPossible.cjs");exports.useCheckHoverPossible=e.default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useCheckHoverPossible/useCheckHoverPossible.cjs"),u=require("./useCheckKeyboardMode/useCheckKeyboardMode.cjs"),s=require("./useCheckHasFocus/useCheckHasFocus.cjs"),o=require("./useFocusBoundary/useFocusBoundary.cjs");exports.useCheckHoverPossible=e.default;exports.useCheckKeyboardMode=u.default;exports.useCheckHasFocus=s.default;exports.useFocusBoundary=o.default;
|
package/hooks/index.d.ts
CHANGED
|
@@ -1 +1,4 @@
|
|
|
1
1
|
export { default as useCheckHoverPossible } from './useCheckHoverPossible/useCheckHoverPossible';
|
|
2
|
+
export { default as useCheckKeyboardMode } from './useCheckKeyboardMode/useCheckKeyboardMode';
|
|
3
|
+
export { default as useCheckHasFocus } from './useCheckHasFocus/useCheckHasFocus';
|
|
4
|
+
export { default as useFocusBoundary } from './useFocusBoundary/useFocusBoundary';
|
package/hooks/index.es.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { default as s } from "./useCheckHoverPossible/useCheckHoverPossible.es.js";
|
|
2
|
+
import { default as r } from "./useCheckKeyboardMode/useCheckKeyboardMode.es.js";
|
|
3
|
+
import { default as f } from "./useCheckHasFocus/useCheckHasFocus.es.js";
|
|
4
|
+
import { default as d } from "./useFocusBoundary/useFocusBoundary.es.js";
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
f as useCheckHasFocus,
|
|
7
|
+
s as useCheckHoverPossible,
|
|
8
|
+
r as useCheckKeyboardMode,
|
|
9
|
+
d as useFocusBoundary
|
|
4
10
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react");function i({ref:t}){const[a,u]=r.useState(!1);return r.useEffect(()=>{const o=n=>{var e;const s=n.target;(e=t.current)!=null&&e.contains(s)&&u(!0)},c=n=>{var e;const s=n.target;(e=t.current)!=null&&e.contains(s)&&u(!1)};return document.addEventListener("focusin",o),document.addEventListener("focusout",c),()=>{document.removeEventListener("focusin",o),document.removeEventListener("focusout",c)}},[t]),{hasFocus:a}}exports.default=i;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useState as a, useEffect as i } from "react";
|
|
2
|
+
function f({ ref: e }) {
|
|
3
|
+
const [r, o] = a(!1);
|
|
4
|
+
return i(() => {
|
|
5
|
+
const u = (n) => {
|
|
6
|
+
var t;
|
|
7
|
+
const s = n.target;
|
|
8
|
+
(t = e.current) != null && t.contains(s) && o(!0);
|
|
9
|
+
}, c = (n) => {
|
|
10
|
+
var t;
|
|
11
|
+
const s = n.target;
|
|
12
|
+
(t = e.current) != null && t.contains(s) && o(!1);
|
|
13
|
+
};
|
|
14
|
+
return document.addEventListener("focusin", u), document.addEventListener("focusout", c), () => {
|
|
15
|
+
document.removeEventListener("focusin", u), document.removeEventListener("focusout", c);
|
|
16
|
+
};
|
|
17
|
+
}, [e]), { hasFocus: r };
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
f as default
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react"),s=["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter"," ","Home","End","PageUp","PageDown"];function u(){const[r,e]=n.useState(!1);return n.useEffect(()=>{const o=d=>{s.includes(d.key)&&e(!0)},t=()=>{e(!1)};return document.addEventListener("keydown",o),document.addEventListener("mousedown",t),()=>{document.removeEventListener("keydown",o),document.removeEventListener("mousedown",t)}},[]),{isKeyboardMode:r}}exports.default=u;
|