@blockend/widget 1.0.31 → 1.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/dist/AllRoutes-CPwuTwqd.js +2209 -0
  2. package/dist/Box-CIChapvH.js +55 -0
  3. package/dist/EstGas-CEFILtyf.js +12867 -0
  4. package/dist/Grow-DJZj9zjv.js +1656 -0
  5. package/dist/InputComp-DqF1JGIu.js +106 -0
  6. package/dist/LoadRoute-r3sHTYXM.js +126 -0
  7. package/dist/QuotesProgress-BXVLxZ8U.js +28 -0
  8. package/dist/SwapAsset-07WvVwl-.js +64 -0
  9. package/dist/Tooltip-CNAsCF8n.js +572 -0
  10. package/dist/TxnButton-D2TTkFYA.js +207 -0
  11. package/dist/WidgetForm.module-QHJ0-m5f.js +9 -0
  12. package/dist/{add-B8AfyNIx.js → add-t2GqC9VA.js} +3 -3
  13. package/dist/{all-wallets-BaLLU39i.js → all-wallets-DFyf0q31.js} +3 -3
  14. package/dist/{app-store-DNpoABj1.js → app-store-aAahwmBP.js} +3 -3
  15. package/dist/{apple-DzzHtaL4.js → apple-DeRgpwlc.js} +3 -3
  16. package/dist/{arrow-bottom-D2c13c51.js → arrow-bottom-DdEOkaAj.js} +3 -3
  17. package/dist/{arrow-bottom-circle-ls9OCLx1.js → arrow-bottom-circle-BWwREWcv.js} +3 -3
  18. package/dist/{arrow-left-BI3rQkNI.js → arrow-left-CulyLmoH.js} +3 -3
  19. package/dist/{arrow-right-rnMzhVod.js → arrow-right-Dwr7TISn.js} +3 -3
  20. package/dist/{arrow-top-CfA6PVMz.js → arrow-top-pL4rM_y8.js} +3 -3
  21. package/dist/{bank-CmpAmHgg.js → bank-CPuyK_08.js} +3 -3
  22. package/dist/basic-CVc9xEvb.js +5783 -0
  23. package/dist/{browser-mEcjgS1H.js → browser-Cbq2Zbp4.js} +3 -3
  24. package/dist/{card-DkgIWcMc.js → card-B_hUtPWK.js} +3 -3
  25. package/dist/ccip-BLVGcR4A.js +228 -0
  26. package/dist/{checkmark-B_A013n2.js → checkmark-WEqTsFAc.js} +3 -3
  27. package/dist/{checkmark-bold-DestuG2T.js → checkmark-bold-Du_ZvhqM.js} +3 -3
  28. package/dist/{chevron-bottom-Di3S86dj.js → chevron-bottom-C-s-lv4L.js} +3 -3
  29. package/dist/{chevron-left-A9Wj-3tj.js → chevron-left-C7NcRElx.js} +3 -3
  30. package/dist/{chevron-right-UFxJogOZ.js → chevron-right-CSzmAmdn.js} +3 -3
  31. package/dist/{chevron-top-BbZs3eaC.js → chevron-top-Dd99Wfel.js} +3 -3
  32. package/dist/{chrome-store-B4F6hJmy.js → chrome-store-C4p77Of0.js} +3 -3
  33. package/dist/{clock-BbAQ09uV.js → clock-Cib24qjH.js} +3 -3
  34. package/dist/clockIcon-C2W5xvyt.js +76 -0
  35. package/dist/{close-CY3oZP_D.js → close-BXjEkTvS.js} +3 -3
  36. package/dist/{coinPlaceholder-DpfsobZT.js → coinPlaceholder-BFNC7cQN.js} +3 -3
  37. package/dist/{compass-CHS7RZFk.js → compass-CXPX5Ycp.js} +3 -3
  38. package/dist/{copy-CEd4nGhs.js → copy-BEawMbmF.js} +3 -3
  39. package/dist/core-Bez9Ow7F.js +14967 -0
  40. package/dist/cursor-Cxq4Q9jk.js +7 -0
  41. package/dist/{cursor-transparent-Tm6k6Ws4.js → cursor-transparent-ZjJ0P2vr.js} +3 -3
  42. package/dist/{desktop-CrSyXZkL.js → desktop-BhZVovAp.js} +3 -3
  43. package/dist/{disconnect-BooT10E1.js → disconnect-AC-bffZO.js} +3 -3
  44. package/dist/{discord-B982Qaml.js → discord-dT97h-CC.js} +3 -3
  45. package/dist/down-DP56YSKp.js +606 -0
  46. package/dist/{etherscan-CFL0IcNl.js → etherscan-rYFRhRTM.js} +3 -3
  47. package/dist/ethertousd-CC_ezooz.js +6 -0
  48. package/dist/{exclamation-triangle-BBeGXYgt.js → exclamation-triangle-C-pCuC08.js} +3 -3
  49. package/dist/{extension-C5WqJw73.js → extension-BnqauLSn.js} +3 -3
  50. package/dist/{external-link-CcSxVDcd.js → external-link-M9D6e_F3.js} +3 -3
  51. package/dist/{facebook-DF0v9ED8.js → facebook-DHezcoD-.js} +3 -3
  52. package/dist/{farcaster-Boq7M4VK.js → farcaster-D0Ky-Imv.js} +3 -3
  53. package/dist/{filters-DfeymbPx.js → filters-B02NYLWq.js} +3 -3
  54. package/dist/getChainIds-CJd2TZYT.js +1888 -0
  55. package/dist/getCosmosAddress-DTZfw04G.js +9565 -0
  56. package/dist/{github-DQ8FV4bD.js → github-BzQkIMuE.js} +3 -3
  57. package/dist/{google-Dm8FDDZR.js → google-BpwCJ4Fs.js} +3 -3
  58. package/dist/hamburger-BzqwkUjE.js +3915 -0
  59. package/dist/{help-circle-CbgiAebR.js → help-circle-C0nOySHC.js} +3 -3
  60. package/dist/{id-CzqxUksI.js → id-DFP_kFd4.js} +3 -3
  61. package/dist/{image-CsCGTIN-.js → image-QiYOAGjM.js} +3 -3
  62. package/dist/index-CDq3vNnP.js +22 -0
  63. package/dist/index-CLzkn733.js +28223 -0
  64. package/dist/index-CjtwASJt.js +252 -0
  65. package/dist/index-CrC4B7xn.js +331 -0
  66. package/dist/index-D5hLIe-N.js +9 -0
  67. package/dist/index-DDk00SOL.js +159 -0
  68. package/dist/index-DTish3yr.js +1014 -0
  69. package/dist/index-DW3W7zaF.js +473 -0
  70. package/dist/index-DXdD3L9f.js +1460 -0
  71. package/dist/index-DaJ1272l.js +18613 -0
  72. package/dist/index-DxPp2gBS.js +992 -0
  73. package/dist/index-Dy_n2MPD.js +3010 -0
  74. package/dist/index-oc8HPfOF.js +13583 -0
  75. package/dist/index.es-Bsr7zP98.js +366 -0
  76. package/dist/index.es-C-j-Ghef.js +11678 -0
  77. package/dist/index.es.js +4 -4
  78. package/dist/{info-fKCfLW0k.js → info-BTLQJ-wd.js} +3 -3
  79. package/dist/{info-circle-Bt350Yzj.js → info-circle-Dla9169_.js} +3 -3
  80. package/dist/{lightbulb-BL9YBxiA.js → lightbulb-PN8DA_Wh.js} +3 -3
  81. package/dist/{mail-_g6CHQeQ.js → mail-BGYZut_4.js} +3 -3
  82. package/dist/{mobile-B-EQ4IcH.js → mobile-BM760ZzX.js} +3 -3
  83. package/dist/{more-C3rpOdUy.js → more-rHGnl2ck.js} +3 -3
  84. package/dist/{network-placeholder-D9Ak7Xj_.js → network-placeholder-CyQl-3_2.js} +3 -3
  85. package/dist/{nftPlaceholder-CIIm2V_o.js → nftPlaceholder-nuUJ8nKY.js} +3 -3
  86. package/dist/{off-DZjgI0eE.js → off-GYlwYDrT.js} +3 -3
  87. package/dist/{play-store-DvRnagoF.js → play-store-Ck01Ez1F.js} +3 -3
  88. package/dist/{plus-C2jN2huZ.js → plus-CQfXWgLw.js} +3 -3
  89. package/dist/{qr-code-B64HnZgi.js → qr-code-CyLVwLY7.js} +3 -3
  90. package/dist/{recycle-horizontal-CovcJGa_.js → recycle-horizontal-DvnWPcEQ.js} +3 -3
  91. package/dist/{refresh-J1Vw6QMA.js → refresh-BOxj8b2n.js} +3 -3
  92. package/dist/{reown-logo-BsXoZ3KT.js → reown-logo-D1iprOTg.js} +3 -3
  93. package/dist/{search-BC86wYXR.js → search-DrPaZPnc.js} +3 -3
  94. package/dist/secp256k1-DgmH1qVg.js +1251 -0
  95. package/dist/{send-BPA1bK5G.js → send-ybBREe4b.js} +3 -3
  96. package/dist/shareicon-D3Qj5j1T.js +262 -0
  97. package/dist/{sortDown-cDA6MpOw.js → sortDown-CjBaDQTU.js} +13 -13
  98. package/dist/{swapHorizontal-47_8ePle.js → swapHorizontal-BddjZdXK.js} +3 -3
  99. package/dist/{swapHorizontalBold-CJ7TzeQP.js → swapHorizontalBold-B6AWjPZ9.js} +3 -3
  100. package/dist/{swapHorizontalMedium-CTACgUR9.js → swapHorizontalMedium-CNacWoBn.js} +3 -3
  101. package/dist/{swapHorizontalRoundedBold-Ht3_LABp.js → swapHorizontalRoundedBold-B8VcPnqt.js} +3 -3
  102. package/dist/{swapVertical-DlS0V6DD.js → swapVertical-zY2BbSyQ.js} +3 -3
  103. package/dist/{telegram-UZ00kvIE.js → telegram-DS4l-8Oc.js} +3 -3
  104. package/dist/{three-dots-D9zVXr1j.js → three-dots-RctNqamK.js} +3 -3
  105. package/dist/truncate-D9t92mVX.js +7 -0
  106. package/dist/{twitch-CP6rpz4m.js → twitch-CJ0llIIH.js} +3 -3
  107. package/dist/{twitterIcon-Cm3I3FRU.js → twitterIcon-pgvN9-bP.js} +3 -3
  108. package/dist/unsupportedProp-BJVuEW_b.js +10 -0
  109. package/dist/useRegisterError-C_YLA1dw.js +9857 -0
  110. package/dist/validError-CDlJpg_f.js +6 -0
  111. package/dist/{verify-DuUE85WT.js → verify-BeZLo1Fq.js} +3 -3
  112. package/dist/{verify-filled-CfgydKPa.js → verify-filled-meyb7E16.js} +3 -3
  113. package/dist/w3m-modal-C-Jp9NVv.js +1471 -0
  114. package/dist/{wallet-BC2LSDlF.js → wallet-CFcOgSsz.js} +3 -3
  115. package/dist/{wallet-placeholder-DugEJ7xM.js → wallet-placeholder-CeUMILZq.js} +3 -3
  116. package/dist/{walletconnect-wayCaYfk.js → walletconnect-D6LB1PyC.js} +7 -9
  117. package/dist/{warning-circle-Cy9YuvwU.js → warning-circle-BRtzofvT.js} +3 -3
  118. package/dist/{x-jggPFiy-.js → x-DKQAOOh3.js} +3 -3
  119. package/package.json +1 -1
  120. package/dist/AllRoutes-Bdi5ZW8W.js +0 -2604
  121. package/dist/Box-e4gA-y_H.js +0 -60
  122. package/dist/EstGas-C5ihS0Mw.js +0 -17108
  123. package/dist/Grow-B4K-I-E-.js +0 -2212
  124. package/dist/InputComp-C_UUZxNU.js +0 -114
  125. package/dist/LoadRoute-CnDhVKdh.js +0 -142
  126. package/dist/QuotesProgress-DxgPgPJE.js +0 -29
  127. package/dist/SwapAsset-CmmuxeQF.js +0 -65
  128. package/dist/Tooltip-D8YjOOKU.js +0 -718
  129. package/dist/TxnButton-CF-TLZrD.js +0 -302
  130. package/dist/WidgetForm.module-DhUUlwZP.js +0 -13
  131. package/dist/basic-Cx2xxgd9.js +0 -7109
  132. package/dist/ccip-BKpquA5i.js +0 -250
  133. package/dist/clockIcon-jSNFFrLy.js +0 -76
  134. package/dist/core-C-gr9X18.js +0 -17217
  135. package/dist/cursor-BTtIlTHP.js +0 -7
  136. package/dist/down-DDk8OoJG.js +0 -809
  137. package/dist/ethertousd-BOknTgU4.js +0 -7
  138. package/dist/getChainIds-6iugk2h0.js +0 -2431
  139. package/dist/getCosmosAddress-BgD5iV6f.js +0 -13998
  140. package/dist/hamburger-BYe_G11E.js +0 -4562
  141. package/dist/index-BAmjBHYR.js +0 -1087
  142. package/dist/index-BxHeZ9IF.js +0 -543
  143. package/dist/index-C7cb2O7r.js +0 -16078
  144. package/dist/index-CF9p4S_X.js +0 -11
  145. package/dist/index-C_vo1L7p.js +0 -24384
  146. package/dist/index-Ch7w83dW.js +0 -4217
  147. package/dist/index-Crhenmgw.js +0 -188
  148. package/dist/index-Cz5Dosd2.js +0 -412
  149. package/dist/index-D5OnT-__.js +0 -35858
  150. package/dist/index-DArR1lwi.js +0 -1759
  151. package/dist/index-hEJSpZe-.js +0 -308
  152. package/dist/index-m2O0cbD8.js +0 -1883
  153. package/dist/index-sLx4Edw4.js +0 -22
  154. package/dist/index.es-DIbGJsfa.js +0 -475
  155. package/dist/index.es-t6sHlseh.js +0 -12916
  156. package/dist/secp256k1-BkBK0mD5.js +0 -1681
  157. package/dist/shareicon-C88Wx-AM.js +0 -314
  158. package/dist/truncate-DSxFWEga.js +0 -7
  159. package/dist/unsupportedProp-DkeDzLfM.js +0 -14
  160. package/dist/useRegisterError-W_UfecIN.js +0 -19288
  161. package/dist/validError-rariWQ7G.js +0 -14
  162. package/dist/w3m-modal-Bl-DPlah.js +0 -1721
@@ -1,718 +0,0 @@
1
- import { g as generateUtilityClass, _ as _objectWithoutPropertiesLoose, p as process$1, b as _extends, d as capitalize, e as colorManipulatorExports, P as PropTypes } from "./index-D5OnT-__.js";
2
- import * as React from "react";
3
- import { g as generateUtilityClasses, d as useDefaultProps, o as useTheme, z as useTimeout, q as useEventCallback, D as useIsFocusVisible, h as useForkRef, x as getReactElementRef, c as clsx, U as appendOwnerState, s as styled, V as Timeout, a as composeClasses, J as elementAcceptingRef } from "./useRegisterError-W_UfecIN.js";
4
- import { G as Grow, b as useRtl, u as useControlled, a as useId, P as Popper } from "./Grow-B4K-I-E-.js";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- function getTooltipUtilityClass(slot) {
7
- return generateUtilityClass("MuiTooltip", slot);
8
- }
9
- const tooltipClasses = generateUtilityClasses("MuiTooltip", ["popper", "popperInteractive", "popperArrow", "popperClose", "tooltip", "tooltipArrow", "touch", "tooltipPlacementLeft", "tooltipPlacementRight", "tooltipPlacementTop", "tooltipPlacementBottom", "arrow"]);
10
- const _excluded = ["arrow", "children", "classes", "components", "componentsProps", "describeChild", "disableFocusListener", "disableHoverListener", "disableInteractive", "disableTouchListener", "enterDelay", "enterNextDelay", "enterTouchDelay", "followCursor", "id", "leaveDelay", "leaveTouchDelay", "onClose", "onOpen", "open", "placement", "PopperComponent", "PopperProps", "slotProps", "slots", "title", "TransitionComponent", "TransitionProps"];
11
- function round(value) {
12
- return Math.round(value * 1e5) / 1e5;
13
- }
14
- const useUtilityClasses = (ownerState) => {
15
- const {
16
- classes,
17
- disableInteractive,
18
- arrow,
19
- touch,
20
- placement
21
- } = ownerState;
22
- const slots = {
23
- popper: ["popper", !disableInteractive && "popperInteractive", arrow && "popperArrow"],
24
- tooltip: ["tooltip", arrow && "tooltipArrow", touch && "touch", `tooltipPlacement${capitalize(placement.split("-")[0])}`],
25
- arrow: ["arrow"]
26
- };
27
- return composeClasses(slots, getTooltipUtilityClass, classes);
28
- };
29
- const TooltipPopper = styled(Popper, {
30
- name: "MuiTooltip",
31
- slot: "Popper",
32
- overridesResolver: (props, styles) => {
33
- const {
34
- ownerState
35
- } = props;
36
- return [styles.popper, !ownerState.disableInteractive && styles.popperInteractive, ownerState.arrow && styles.popperArrow, !ownerState.open && styles.popperClose];
37
- }
38
- })(({
39
- theme,
40
- ownerState,
41
- open
42
- }) => _extends({
43
- zIndex: (theme.vars || theme).zIndex.tooltip,
44
- pointerEvents: "none"
45
- }, !ownerState.disableInteractive && {
46
- pointerEvents: "auto"
47
- }, !open && {
48
- pointerEvents: "none"
49
- }, ownerState.arrow && {
50
- [`&[data-popper-placement*="bottom"] .${tooltipClasses.arrow}`]: {
51
- top: 0,
52
- marginTop: "-0.71em",
53
- "&::before": {
54
- transformOrigin: "0 100%"
55
- }
56
- },
57
- [`&[data-popper-placement*="top"] .${tooltipClasses.arrow}`]: {
58
- bottom: 0,
59
- marginBottom: "-0.71em",
60
- "&::before": {
61
- transformOrigin: "100% 0"
62
- }
63
- },
64
- [`&[data-popper-placement*="right"] .${tooltipClasses.arrow}`]: _extends({}, !ownerState.isRtl ? {
65
- left: 0,
66
- marginLeft: "-0.71em"
67
- } : {
68
- right: 0,
69
- marginRight: "-0.71em"
70
- }, {
71
- height: "1em",
72
- width: "0.71em",
73
- "&::before": {
74
- transformOrigin: "100% 100%"
75
- }
76
- }),
77
- [`&[data-popper-placement*="left"] .${tooltipClasses.arrow}`]: _extends({}, !ownerState.isRtl ? {
78
- right: 0,
79
- marginRight: "-0.71em"
80
- } : {
81
- left: 0,
82
- marginLeft: "-0.71em"
83
- }, {
84
- height: "1em",
85
- width: "0.71em",
86
- "&::before": {
87
- transformOrigin: "0 0"
88
- }
89
- })
90
- }));
91
- const TooltipTooltip = styled("div", {
92
- name: "MuiTooltip",
93
- slot: "Tooltip",
94
- overridesResolver: (props, styles) => {
95
- const {
96
- ownerState
97
- } = props;
98
- return [styles.tooltip, ownerState.touch && styles.touch, ownerState.arrow && styles.tooltipArrow, styles[`tooltipPlacement${capitalize(ownerState.placement.split("-")[0])}`]];
99
- }
100
- })(({
101
- theme,
102
- ownerState
103
- }) => _extends({
104
- backgroundColor: theme.vars ? theme.vars.palette.Tooltip.bg : colorManipulatorExports.alpha(theme.palette.grey[700], 0.92),
105
- borderRadius: (theme.vars || theme).shape.borderRadius,
106
- color: (theme.vars || theme).palette.common.white,
107
- fontFamily: theme.typography.fontFamily,
108
- padding: "4px 8px",
109
- fontSize: theme.typography.pxToRem(11),
110
- maxWidth: 300,
111
- margin: 2,
112
- wordWrap: "break-word",
113
- fontWeight: theme.typography.fontWeightMedium
114
- }, ownerState.arrow && {
115
- position: "relative",
116
- margin: 0
117
- }, ownerState.touch && {
118
- padding: "8px 16px",
119
- fontSize: theme.typography.pxToRem(14),
120
- lineHeight: `${round(16 / 14)}em`,
121
- fontWeight: theme.typography.fontWeightRegular
122
- }, {
123
- [`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]: _extends({
124
- transformOrigin: "right center"
125
- }, !ownerState.isRtl ? _extends({
126
- marginRight: "14px"
127
- }, ownerState.touch && {
128
- marginRight: "24px"
129
- }) : _extends({
130
- marginLeft: "14px"
131
- }, ownerState.touch && {
132
- marginLeft: "24px"
133
- })),
134
- [`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]: _extends({
135
- transformOrigin: "left center"
136
- }, !ownerState.isRtl ? _extends({
137
- marginLeft: "14px"
138
- }, ownerState.touch && {
139
- marginLeft: "24px"
140
- }) : _extends({
141
- marginRight: "14px"
142
- }, ownerState.touch && {
143
- marginRight: "24px"
144
- })),
145
- [`.${tooltipClasses.popper}[data-popper-placement*="top"] &`]: _extends({
146
- transformOrigin: "center bottom",
147
- marginBottom: "14px"
148
- }, ownerState.touch && {
149
- marginBottom: "24px"
150
- }),
151
- [`.${tooltipClasses.popper}[data-popper-placement*="bottom"] &`]: _extends({
152
- transformOrigin: "center top",
153
- marginTop: "14px"
154
- }, ownerState.touch && {
155
- marginTop: "24px"
156
- })
157
- }));
158
- const TooltipArrow = styled("span", {
159
- name: "MuiTooltip",
160
- slot: "Arrow",
161
- overridesResolver: (props, styles) => styles.arrow
162
- })(({
163
- theme
164
- }) => ({
165
- overflow: "hidden",
166
- position: "absolute",
167
- width: "1em",
168
- height: "0.71em",
169
- boxSizing: "border-box",
170
- color: theme.vars ? theme.vars.palette.Tooltip.bg : colorManipulatorExports.alpha(theme.palette.grey[700], 0.9),
171
- "&::before": {
172
- content: '""',
173
- margin: "auto",
174
- display: "block",
175
- width: "100%",
176
- height: "100%",
177
- backgroundColor: "currentColor",
178
- transform: "rotate(45deg)"
179
- }
180
- }));
181
- let hystersisOpen = false;
182
- const hystersisTimer = new Timeout();
183
- let cursorPosition = {
184
- x: 0,
185
- y: 0
186
- };
187
- function composeEventHandler(handler, eventHandler) {
188
- return (event, ...params) => {
189
- if (eventHandler) {
190
- eventHandler(event, ...params);
191
- }
192
- handler(event, ...params);
193
- };
194
- }
195
- const Tooltip = /* @__PURE__ */ React.forwardRef(function Tooltip2(inProps, ref) {
196
- var _ref, _slots$popper, _ref2, _ref3, _slots$transition, _ref4, _slots$tooltip, _ref5, _slots$arrow, _slotProps$popper, _ref6, _slotProps$popper2, _slotProps$transition, _slotProps$tooltip, _ref7, _slotProps$tooltip2, _slotProps$arrow, _ref8, _slotProps$arrow2;
197
- const props = useDefaultProps({
198
- props: inProps,
199
- name: "MuiTooltip"
200
- });
201
- const {
202
- arrow = false,
203
- children: childrenProp,
204
- components = {},
205
- componentsProps = {},
206
- describeChild = false,
207
- disableFocusListener = false,
208
- disableHoverListener = false,
209
- disableInteractive: disableInteractiveProp = false,
210
- disableTouchListener = false,
211
- enterDelay = 100,
212
- enterNextDelay = 0,
213
- enterTouchDelay = 700,
214
- followCursor = false,
215
- id: idProp,
216
- leaveDelay = 0,
217
- leaveTouchDelay = 1500,
218
- onClose,
219
- onOpen,
220
- open: openProp,
221
- placement = "bottom",
222
- PopperComponent: PopperComponentProp,
223
- PopperProps = {},
224
- slotProps = {},
225
- slots = {},
226
- title,
227
- TransitionComponent: TransitionComponentProp = Grow,
228
- TransitionProps
229
- } = props, other = _objectWithoutPropertiesLoose(props, _excluded);
230
- const children = /* @__PURE__ */ React.isValidElement(childrenProp) ? childrenProp : /* @__PURE__ */ jsx("span", {
231
- children: childrenProp
232
- });
233
- const theme = useTheme();
234
- const isRtl = useRtl();
235
- const [childNode, setChildNode] = React.useState();
236
- const [arrowRef, setArrowRef] = React.useState(null);
237
- const ignoreNonTouchEvents = React.useRef(false);
238
- const disableInteractive = disableInteractiveProp || followCursor;
239
- const closeTimer = useTimeout();
240
- const enterTimer = useTimeout();
241
- const leaveTimer = useTimeout();
242
- const touchTimer = useTimeout();
243
- const [openState, setOpenState] = useControlled({
244
- controlled: openProp,
245
- default: false,
246
- name: "Tooltip",
247
- state: "open"
248
- });
249
- let open = openState;
250
- if (process$1.env.NODE_ENV !== "production") {
251
- const {
252
- current: isControlled
253
- } = React.useRef(openProp !== void 0);
254
- React.useEffect(() => {
255
- if (childNode && childNode.disabled && !isControlled && title !== "" && childNode.tagName.toLowerCase() === "button") {
256
- }
257
- }, [title, childNode, isControlled]);
258
- }
259
- const id = useId(idProp);
260
- const prevUserSelect = React.useRef();
261
- const stopTouchInteraction = useEventCallback(() => {
262
- if (prevUserSelect.current !== void 0) {
263
- document.body.style.WebkitUserSelect = prevUserSelect.current;
264
- prevUserSelect.current = void 0;
265
- }
266
- touchTimer.clear();
267
- });
268
- React.useEffect(() => stopTouchInteraction, [stopTouchInteraction]);
269
- const handleOpen = (event) => {
270
- hystersisTimer.clear();
271
- hystersisOpen = true;
272
- setOpenState(true);
273
- if (onOpen && !open) {
274
- onOpen(event);
275
- }
276
- };
277
- const handleClose = useEventCallback(
278
- /**
279
- * @param {React.SyntheticEvent | Event} event
280
- */
281
- (event) => {
282
- hystersisTimer.start(800 + leaveDelay, () => {
283
- hystersisOpen = false;
284
- });
285
- setOpenState(false);
286
- if (onClose && open) {
287
- onClose(event);
288
- }
289
- closeTimer.start(theme.transitions.duration.shortest, () => {
290
- ignoreNonTouchEvents.current = false;
291
- });
292
- }
293
- );
294
- const handleMouseOver = (event) => {
295
- if (ignoreNonTouchEvents.current && event.type !== "touchstart") {
296
- return;
297
- }
298
- if (childNode) {
299
- childNode.removeAttribute("title");
300
- }
301
- enterTimer.clear();
302
- leaveTimer.clear();
303
- if (enterDelay || hystersisOpen && enterNextDelay) {
304
- enterTimer.start(hystersisOpen ? enterNextDelay : enterDelay, () => {
305
- handleOpen(event);
306
- });
307
- } else {
308
- handleOpen(event);
309
- }
310
- };
311
- const handleMouseLeave = (event) => {
312
- enterTimer.clear();
313
- leaveTimer.start(leaveDelay, () => {
314
- handleClose(event);
315
- });
316
- };
317
- const {
318
- isFocusVisibleRef,
319
- onBlur: handleBlurVisible,
320
- onFocus: handleFocusVisible,
321
- ref: focusVisibleRef
322
- } = useIsFocusVisible();
323
- const [, setChildIsFocusVisible] = React.useState(false);
324
- const handleBlur = (event) => {
325
- handleBlurVisible(event);
326
- if (isFocusVisibleRef.current === false) {
327
- setChildIsFocusVisible(false);
328
- handleMouseLeave(event);
329
- }
330
- };
331
- const handleFocus = (event) => {
332
- if (!childNode) {
333
- setChildNode(event.currentTarget);
334
- }
335
- handleFocusVisible(event);
336
- if (isFocusVisibleRef.current === true) {
337
- setChildIsFocusVisible(true);
338
- handleMouseOver(event);
339
- }
340
- };
341
- const detectTouchStart = (event) => {
342
- ignoreNonTouchEvents.current = true;
343
- const childrenProps2 = children.props;
344
- if (childrenProps2.onTouchStart) {
345
- childrenProps2.onTouchStart(event);
346
- }
347
- };
348
- const handleTouchStart = (event) => {
349
- detectTouchStart(event);
350
- leaveTimer.clear();
351
- closeTimer.clear();
352
- stopTouchInteraction();
353
- prevUserSelect.current = document.body.style.WebkitUserSelect;
354
- document.body.style.WebkitUserSelect = "none";
355
- touchTimer.start(enterTouchDelay, () => {
356
- document.body.style.WebkitUserSelect = prevUserSelect.current;
357
- handleMouseOver(event);
358
- });
359
- };
360
- const handleTouchEnd = (event) => {
361
- if (children.props.onTouchEnd) {
362
- children.props.onTouchEnd(event);
363
- }
364
- stopTouchInteraction();
365
- leaveTimer.start(leaveTouchDelay, () => {
366
- handleClose(event);
367
- });
368
- };
369
- React.useEffect(() => {
370
- if (!open) {
371
- return void 0;
372
- }
373
- function handleKeyDown(nativeEvent) {
374
- if (nativeEvent.key === "Escape" || nativeEvent.key === "Esc") {
375
- handleClose(nativeEvent);
376
- }
377
- }
378
- document.addEventListener("keydown", handleKeyDown);
379
- return () => {
380
- document.removeEventListener("keydown", handleKeyDown);
381
- };
382
- }, [handleClose, open]);
383
- const handleRef = useForkRef(getReactElementRef(children), focusVisibleRef, setChildNode, ref);
384
- if (!title && title !== 0) {
385
- open = false;
386
- }
387
- const popperRef = React.useRef();
388
- const handleMouseMove = (event) => {
389
- const childrenProps2 = children.props;
390
- if (childrenProps2.onMouseMove) {
391
- childrenProps2.onMouseMove(event);
392
- }
393
- cursorPosition = {
394
- x: event.clientX,
395
- y: event.clientY
396
- };
397
- if (popperRef.current) {
398
- popperRef.current.update();
399
- }
400
- };
401
- const nameOrDescProps = {};
402
- const titleIsString = typeof title === "string";
403
- if (describeChild) {
404
- nameOrDescProps.title = !open && titleIsString && !disableHoverListener ? title : null;
405
- nameOrDescProps["aria-describedby"] = open ? id : null;
406
- } else {
407
- nameOrDescProps["aria-label"] = titleIsString ? title : null;
408
- nameOrDescProps["aria-labelledby"] = open && !titleIsString ? id : null;
409
- }
410
- const childrenProps = _extends({}, nameOrDescProps, other, children.props, {
411
- className: clsx(other.className, children.props.className),
412
- onTouchStart: detectTouchStart,
413
- ref: handleRef
414
- }, followCursor ? {
415
- onMouseMove: handleMouseMove
416
- } : {});
417
- if (process$1.env.NODE_ENV !== "production") {
418
- childrenProps["data-mui-internal-clone-element"] = true;
419
- React.useEffect(() => {
420
- if (childNode && !childNode.getAttribute("data-mui-internal-clone-element")) {
421
- }
422
- }, [childNode]);
423
- }
424
- const interactiveWrapperListeners = {};
425
- if (!disableTouchListener) {
426
- childrenProps.onTouchStart = handleTouchStart;
427
- childrenProps.onTouchEnd = handleTouchEnd;
428
- }
429
- if (!disableHoverListener) {
430
- childrenProps.onMouseOver = composeEventHandler(handleMouseOver, childrenProps.onMouseOver);
431
- childrenProps.onMouseLeave = composeEventHandler(handleMouseLeave, childrenProps.onMouseLeave);
432
- if (!disableInteractive) {
433
- interactiveWrapperListeners.onMouseOver = handleMouseOver;
434
- interactiveWrapperListeners.onMouseLeave = handleMouseLeave;
435
- }
436
- }
437
- if (!disableFocusListener) {
438
- childrenProps.onFocus = composeEventHandler(handleFocus, childrenProps.onFocus);
439
- childrenProps.onBlur = composeEventHandler(handleBlur, childrenProps.onBlur);
440
- if (!disableInteractive) {
441
- interactiveWrapperListeners.onFocus = handleFocus;
442
- interactiveWrapperListeners.onBlur = handleBlur;
443
- }
444
- }
445
- if (process$1.env.NODE_ENV !== "production") {
446
- if (children.props.title) {
447
- }
448
- }
449
- const popperOptions = React.useMemo(() => {
450
- var _PopperProps$popperOp;
451
- let tooltipModifiers = [{
452
- name: "arrow",
453
- enabled: Boolean(arrowRef),
454
- options: {
455
- element: arrowRef,
456
- padding: 4
457
- }
458
- }];
459
- if ((_PopperProps$popperOp = PopperProps.popperOptions) != null && _PopperProps$popperOp.modifiers) {
460
- tooltipModifiers = tooltipModifiers.concat(PopperProps.popperOptions.modifiers);
461
- }
462
- return _extends({}, PopperProps.popperOptions, {
463
- modifiers: tooltipModifiers
464
- });
465
- }, [arrowRef, PopperProps]);
466
- const ownerState = _extends({}, props, {
467
- isRtl,
468
- arrow,
469
- disableInteractive,
470
- placement,
471
- PopperComponentProp,
472
- touch: ignoreNonTouchEvents.current
473
- });
474
- const classes = useUtilityClasses(ownerState);
475
- const PopperComponent = (_ref = (_slots$popper = slots.popper) != null ? _slots$popper : components.Popper) != null ? _ref : TooltipPopper;
476
- const TransitionComponent = (_ref2 = (_ref3 = (_slots$transition = slots.transition) != null ? _slots$transition : components.Transition) != null ? _ref3 : TransitionComponentProp) != null ? _ref2 : Grow;
477
- const TooltipComponent = (_ref4 = (_slots$tooltip = slots.tooltip) != null ? _slots$tooltip : components.Tooltip) != null ? _ref4 : TooltipTooltip;
478
- const ArrowComponent = (_ref5 = (_slots$arrow = slots.arrow) != null ? _slots$arrow : components.Arrow) != null ? _ref5 : TooltipArrow;
479
- const popperProps = appendOwnerState(PopperComponent, _extends({}, PopperProps, (_slotProps$popper = slotProps.popper) != null ? _slotProps$popper : componentsProps.popper, {
480
- className: clsx(classes.popper, PopperProps == null ? void 0 : PopperProps.className, (_ref6 = (_slotProps$popper2 = slotProps.popper) != null ? _slotProps$popper2 : componentsProps.popper) == null ? void 0 : _ref6.className)
481
- }), ownerState);
482
- const transitionProps = appendOwnerState(TransitionComponent, _extends({}, TransitionProps, (_slotProps$transition = slotProps.transition) != null ? _slotProps$transition : componentsProps.transition), ownerState);
483
- const tooltipProps = appendOwnerState(TooltipComponent, _extends({}, (_slotProps$tooltip = slotProps.tooltip) != null ? _slotProps$tooltip : componentsProps.tooltip, {
484
- className: clsx(classes.tooltip, (_ref7 = (_slotProps$tooltip2 = slotProps.tooltip) != null ? _slotProps$tooltip2 : componentsProps.tooltip) == null ? void 0 : _ref7.className)
485
- }), ownerState);
486
- const tooltipArrowProps = appendOwnerState(ArrowComponent, _extends({}, (_slotProps$arrow = slotProps.arrow) != null ? _slotProps$arrow : componentsProps.arrow, {
487
- className: clsx(classes.arrow, (_ref8 = (_slotProps$arrow2 = slotProps.arrow) != null ? _slotProps$arrow2 : componentsProps.arrow) == null ? void 0 : _ref8.className)
488
- }), ownerState);
489
- return /* @__PURE__ */ jsxs(React.Fragment, {
490
- children: [/* @__PURE__ */ React.cloneElement(children, childrenProps), /* @__PURE__ */ jsx(PopperComponent, _extends({
491
- as: PopperComponentProp != null ? PopperComponentProp : Popper,
492
- placement,
493
- anchorEl: followCursor ? {
494
- getBoundingClientRect: () => ({
495
- top: cursorPosition.y,
496
- left: cursorPosition.x,
497
- right: cursorPosition.x,
498
- bottom: cursorPosition.y,
499
- width: 0,
500
- height: 0
501
- })
502
- } : childNode,
503
- popperRef,
504
- open: childNode ? open : false,
505
- id,
506
- transition: true
507
- }, interactiveWrapperListeners, popperProps, {
508
- popperOptions,
509
- children: ({
510
- TransitionProps: TransitionPropsInner
511
- }) => /* @__PURE__ */ jsx(TransitionComponent, _extends({
512
- timeout: theme.transitions.duration.shorter
513
- }, TransitionPropsInner, transitionProps, {
514
- children: /* @__PURE__ */ jsxs(TooltipComponent, _extends({}, tooltipProps, {
515
- children: [title, arrow ? /* @__PURE__ */ jsx(ArrowComponent, _extends({}, tooltipArrowProps, {
516
- ref: setArrowRef
517
- })) : null]
518
- }))
519
- }))
520
- }))]
521
- });
522
- });
523
- process$1.env.NODE_ENV !== "production" ? Tooltip.propTypes = {
524
- // ┌────────────────────────────── Warning ──────────────────────────────┐
525
- // │ These PropTypes are generated from the TypeScript type definitions. │
526
- // │ To update them, edit the d.ts file and run `pnpm proptypes`. │
527
- // └─────────────────────────────────────────────────────────────────────┘
528
- /**
529
- * If `true`, adds an arrow to the tooltip.
530
- * @default false
531
- */
532
- arrow: PropTypes.bool,
533
- /**
534
- * Tooltip reference element.
535
- */
536
- children: elementAcceptingRef.isRequired,
537
- /**
538
- * Override or extend the styles applied to the component.
539
- */
540
- classes: PropTypes.object,
541
- /**
542
- * @ignore
543
- */
544
- className: PropTypes.string,
545
- /**
546
- * The components used for each slot inside.
547
- *
548
- * This prop is an alias for the `slots` prop.
549
- * It's recommended to use the `slots` prop instead.
550
- *
551
- * @default {}
552
- */
553
- components: PropTypes.shape({
554
- Arrow: PropTypes.elementType,
555
- Popper: PropTypes.elementType,
556
- Tooltip: PropTypes.elementType,
557
- Transition: PropTypes.elementType
558
- }),
559
- /**
560
- * The extra props for the slot components.
561
- * You can override the existing props or add new ones.
562
- *
563
- * This prop is an alias for the `slotProps` prop.
564
- * It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
565
- *
566
- * @default {}
567
- */
568
- componentsProps: PropTypes.shape({
569
- arrow: PropTypes.object,
570
- popper: PropTypes.object,
571
- tooltip: PropTypes.object,
572
- transition: PropTypes.object
573
- }),
574
- /**
575
- * Set to `true` if the `title` acts as an accessible description.
576
- * By default the `title` acts as an accessible label for the child.
577
- * @default false
578
- */
579
- describeChild: PropTypes.bool,
580
- /**
581
- * Do not respond to focus-visible events.
582
- * @default false
583
- */
584
- disableFocusListener: PropTypes.bool,
585
- /**
586
- * Do not respond to hover events.
587
- * @default false
588
- */
589
- disableHoverListener: PropTypes.bool,
590
- /**
591
- * Makes a tooltip not interactive, i.e. it will close when the user
592
- * hovers over the tooltip before the `leaveDelay` is expired.
593
- * @default false
594
- */
595
- disableInteractive: PropTypes.bool,
596
- /**
597
- * Do not respond to long press touch events.
598
- * @default false
599
- */
600
- disableTouchListener: PropTypes.bool,
601
- /**
602
- * The number of milliseconds to wait before showing the tooltip.
603
- * This prop won't impact the enter touch delay (`enterTouchDelay`).
604
- * @default 100
605
- */
606
- enterDelay: PropTypes.number,
607
- /**
608
- * The number of milliseconds to wait before showing the tooltip when one was already recently opened.
609
- * @default 0
610
- */
611
- enterNextDelay: PropTypes.number,
612
- /**
613
- * The number of milliseconds a user must touch the element before showing the tooltip.
614
- * @default 700
615
- */
616
- enterTouchDelay: PropTypes.number,
617
- /**
618
- * If `true`, the tooltip follow the cursor over the wrapped element.
619
- * @default false
620
- */
621
- followCursor: PropTypes.bool,
622
- /**
623
- * This prop is used to help implement the accessibility logic.
624
- * If you don't provide this prop. It falls back to a randomly generated id.
625
- */
626
- id: PropTypes.string,
627
- /**
628
- * The number of milliseconds to wait before hiding the tooltip.
629
- * This prop won't impact the leave touch delay (`leaveTouchDelay`).
630
- * @default 0
631
- */
632
- leaveDelay: PropTypes.number,
633
- /**
634
- * The number of milliseconds after the user stops touching an element before hiding the tooltip.
635
- * @default 1500
636
- */
637
- leaveTouchDelay: PropTypes.number,
638
- /**
639
- * Callback fired when the component requests to be closed.
640
- *
641
- * @param {React.SyntheticEvent} event The event source of the callback.
642
- */
643
- onClose: PropTypes.func,
644
- /**
645
- * Callback fired when the component requests to be open.
646
- *
647
- * @param {React.SyntheticEvent} event The event source of the callback.
648
- */
649
- onOpen: PropTypes.func,
650
- /**
651
- * If `true`, the component is shown.
652
- */
653
- open: PropTypes.bool,
654
- /**
655
- * Tooltip placement.
656
- * @default 'bottom'
657
- */
658
- placement: PropTypes.oneOf(["bottom-end", "bottom-start", "bottom", "left-end", "left-start", "left", "right-end", "right-start", "right", "top-end", "top-start", "top"]),
659
- /**
660
- * The component used for the popper.
661
- * @default Popper
662
- */
663
- PopperComponent: PropTypes.elementType,
664
- /**
665
- * Props applied to the [`Popper`](/material-ui/api/popper/) element.
666
- * @default {}
667
- */
668
- PopperProps: PropTypes.object,
669
- /**
670
- * The extra props for the slot components.
671
- * You can override the existing props or add new ones.
672
- *
673
- * This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
674
- *
675
- * @default {}
676
- */
677
- slotProps: PropTypes.shape({
678
- arrow: PropTypes.object,
679
- popper: PropTypes.object,
680
- tooltip: PropTypes.object,
681
- transition: PropTypes.object
682
- }),
683
- /**
684
- * The components used for each slot inside.
685
- *
686
- * This prop is an alias for the `components` prop, which will be deprecated in the future.
687
- *
688
- * @default {}
689
- */
690
- slots: PropTypes.shape({
691
- arrow: PropTypes.elementType,
692
- popper: PropTypes.elementType,
693
- tooltip: PropTypes.elementType,
694
- transition: PropTypes.elementType
695
- }),
696
- /**
697
- * The system prop that allows defining system overrides as well as additional CSS styles.
698
- */
699
- sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
700
- /**
701
- * Tooltip title. Zero-length titles string, undefined, null and false are never displayed.
702
- */
703
- title: PropTypes.node,
704
- /**
705
- * The component used for the transition.
706
- * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.
707
- * @default Grow
708
- */
709
- TransitionComponent: PropTypes.elementType,
710
- /**
711
- * Props applied to the transition element.
712
- * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.
713
- */
714
- TransitionProps: PropTypes.object
715
- } : void 0;
716
- export {
717
- Tooltip as T
718
- };