@gearbox-protocol/ui-kit 3.14.0-next.66 → 3.14.0-next.68
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/dist/cjs/components/assets-list-cell/assets-list-cell.cjs +1 -1
- package/dist/cjs/components/block-sync/block-sync.cjs +1 -1
- package/dist/cjs/components/block-sync-pill/block-sync-pill.cjs +1 -1
- package/dist/cjs/components/breakpoint-provider.cjs +1 -0
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
- package/dist/cjs/components/complex-input/complex-input.cjs +1 -1
- package/dist/cjs/components/composites/index.cjs +1 -1
- package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-head.cjs +1 -1
- package/dist/cjs/components/composites/pool-credit-managers-table/pool-credit-managers-table-head.cjs +1 -1
- package/dist/cjs/components/composites/pool-table/columns.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/columns.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/cells/cells.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/cells/index.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/index.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/points-feature/points-feature.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/components/strategies-table.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/index.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/types/index.cjs +1 -1
- package/dist/cjs/components/composites/strategies-table/types/rewards-cell.cjs +1 -0
- package/dist/cjs/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.cjs +1 -1
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.cjs +1 -1
- package/dist/cjs/components/compound-apy/compound-apy-legacy.cjs +1 -0
- package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/compound-apy/index.cjs +1 -1
- package/dist/cjs/components/detailed-page-title/detailed-page-title.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/markdown-viewer/markdown-viewer.cjs +1 -1
- package/dist/cjs/components/pool-apy-tooltip/apy-tooltip.cjs +1 -0
- package/dist/cjs/components/pool-apy-tooltip/index.cjs +1 -1
- package/dist/cjs/components/pool-apy-tooltip/pool-apy-tooltip.cjs +1 -1
- package/dist/cjs/components/split-list/split-list.cjs +1 -1
- package/dist/cjs/components/time-to-liquidation/time-to-liquidation.cjs +1 -1
- package/dist/cjs/components/token-icon/token-icon.cjs +1 -1
- package/dist/cjs/components/token-symbol/index.cjs +1 -1
- package/dist/cjs/components/token-symbol/token-symbol.cjs +1 -1
- package/dist/cjs/components/tokens-list-cell/tokens-list-cell.cjs +1 -1
- package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
- package/dist/cjs/components/yield-breakdown-tooltip/index.cjs +1 -0
- package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown-tooltip.cjs +1 -0
- package/dist/cjs/hooks/use-debounce-call.cjs +1 -1
- package/dist/cjs/hooks/use-media-query.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/cjs/types/common.cjs +1 -1
- package/dist/cjs/utils/apy-breakdown.cjs +1 -0
- package/dist/cjs/utils/bps.cjs +1 -0
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/token-icon-source.cjs +1 -0
- package/dist/esm/components/assets-list-cell/assets-list-cell.js +132 -206
- package/dist/esm/components/block-sync/block-sync.js +5 -4
- package/dist/esm/components/block-sync-pill/block-sync-pill.js +5 -4
- package/dist/esm/components/breakpoint-provider.js +67 -0
- package/dist/esm/components/checkbox/checkbox-labeled.js +3 -2
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +3 -2
- package/dist/esm/components/complex-input/complex-input.js +5 -4
- package/dist/esm/components/composites/index.js +86 -81
- package/dist/esm/components/composites/pool-assets-table/pool-assets-table-head.js +3 -2
- package/dist/esm/components/composites/pool-credit-managers-table/pool-credit-managers-table-head.js +3 -2
- package/dist/esm/components/composites/pool-table/columns.js +61 -60
- package/dist/esm/components/composites/strategies-table/columns.js +55 -86
- package/dist/esm/components/composites/strategies-table/components/cells/cells.js +150 -110
- package/dist/esm/components/composites/strategies-table/components/cells/index.js +7 -5
- package/dist/esm/components/composites/strategies-table/components/index.js +32 -30
- package/dist/esm/components/composites/strategies-table/components/points-feature/points-feature.js +35 -32
- package/dist/esm/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.js +91 -224
- package/dist/esm/components/composites/strategies-table/components/strategies-table.js +26 -24
- package/dist/esm/components/composites/strategies-table/index.js +36 -31
- package/dist/esm/components/composites/strategies-table/types/index.js +5 -1
- package/dist/esm/components/composites/strategies-table/types/rewards-cell.js +40 -0
- package/dist/esm/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js +32 -189
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.js +5 -4
- package/dist/esm/components/compound-apy/compound-apy-legacy.js +127 -0
- package/dist/esm/components/compound-apy/compound-apy.js +56 -245
- package/dist/esm/components/compound-apy/index.js +4 -2
- package/dist/esm/components/detailed-page-title/detailed-page-title.js +25 -180
- package/dist/esm/components/index.js +805 -787
- package/dist/esm/components/markdown-viewer/markdown-viewer.js +5 -4
- package/dist/esm/components/pool-apy-tooltip/apy-tooltip.js +155 -0
- package/dist/esm/components/pool-apy-tooltip/index.js +4 -2
- package/dist/esm/components/pool-apy-tooltip/pool-apy-tooltip.js +3 -3
- package/dist/esm/components/split-list/split-list.js +12 -12
- package/dist/esm/components/time-to-liquidation/time-to-liquidation.js +3 -2
- package/dist/esm/components/token-icon/token-icon.js +72 -58
- package/dist/esm/components/token-symbol/index.js +2 -3
- package/dist/esm/components/token-symbol/token-symbol.js +41 -62
- package/dist/esm/components/tokens-list-cell/tokens-list-cell.js +35 -192
- package/dist/esm/components/with-copy/with-copy.js +5 -4
- package/dist/esm/components/yield-breakdown-tooltip/index.js +4 -0
- package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +222 -0
- package/dist/esm/hooks/use-debounce-call.js +3 -2
- package/dist/esm/hooks/use-media-query.js +49 -16
- package/dist/esm/index.js +974 -946
- package/dist/esm/locale/en.json.js +9 -2
- package/dist/esm/types/common.js +1 -6
- package/dist/esm/utils/apy-breakdown.js +18 -0
- package/dist/esm/utils/bps.js +4 -0
- package/dist/esm/utils/index.js +105 -95
- package/dist/esm/utils/token-icon-source.js +48 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/assets-list-cell/assets-list-cell.d.ts +44 -4
- package/dist/types/components/breakpoint-provider.d.ts +56 -0
- package/dist/types/components/composites/pool-table/pool-table-backend-contract.types.d.ts +1 -1
- package/dist/types/components/composites/strategies-table/components/cells/cells.d.ts +34 -3
- package/dist/types/components/composites/strategies-table/components/points-feature/points-feature.d.ts +14 -10
- package/dist/types/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.d.ts +10 -13
- package/dist/types/components/composites/strategies-table/index.d.ts +1 -1
- package/dist/types/components/composites/strategies-table/types/index.d.ts +1 -0
- package/dist/types/components/composites/strategies-table/types/rewards-cell.d.ts +48 -0
- package/dist/types/components/composites/strategies-table/types/rewards-tooltip.d.ts +37 -32
- package/dist/types/components/composites/strategies-table/types/table.d.ts +27 -12
- package/dist/types/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.d.ts +3 -3
- package/dist/types/components/compound-apy/compound-apy-legacy.d.ts +109 -0
- package/dist/types/components/compound-apy/compound-apy.d.ts +18 -94
- package/dist/types/components/compound-apy/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +3 -1
- package/dist/types/components/points-icon/index.d.ts +1 -1
- package/dist/types/components/points-icon/points-icon.d.ts +13 -2
- package/dist/types/components/pool-apy-tooltip/apy-tooltip.d.ts +20 -0
- package/dist/types/components/pool-apy-tooltip/index.d.ts +1 -0
- package/dist/types/components/pool-apy-tooltip/pool-apy-tooltip.d.ts +18 -1
- package/dist/types/components/split-list/split-list.d.ts +1 -1
- package/dist/types/components/token-icon/token-icon.d.ts +11 -2
- package/dist/types/components/token-symbol/token-symbol.d.ts +4 -4
- package/dist/types/components/yield-breakdown-tooltip/index.d.ts +1 -0
- package/dist/types/components/yield-breakdown-tooltip/yield-breakdown-tooltip.d.ts +32 -0
- package/dist/types/hooks/use-media-query.d.ts +5 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/locale/en.json.d.ts +10 -2
- package/dist/types/types/common.d.ts +5 -11
- package/dist/types/utils/apy-breakdown.d.ts +18 -0
- package/dist/types/utils/bps.d.ts +3 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/token-icon-source.d.ts +28 -0
- package/package.json +2 -2
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { jsxs as s, jsx as e, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import { faArrowUpRightFromSquare as R } from "@fortawesome/free-solid-svg-icons";
|
|
3
|
+
import { FaIcon as T } from "../icons/fa-icon.js";
|
|
4
|
+
import { PointsIcon as $ } from "../points-icon/points-icon.js";
|
|
5
|
+
import { TokenIcon as j } from "../token-icon/token-icon.js";
|
|
6
|
+
import { SimpleTooltip as F } from "../tooltip/simple-tooltip.js";
|
|
7
|
+
import "../tooltip/tooltip.js";
|
|
8
|
+
import { FormattedMessageTyped as a } from "../typed-intl/index.js";
|
|
9
|
+
import "react";
|
|
10
|
+
import { positiveTokenRewardsOf as P, pointProgramsOf as S, totalApyOf as Y } from "../../utils/apy-breakdown.js";
|
|
11
|
+
import "@gearbox-protocol/sdk";
|
|
12
|
+
import { bpsToPercent as v } from "../../utils/bps.js";
|
|
13
|
+
import { cn as N } from "../../utils/cn.js";
|
|
14
|
+
import "sonner";
|
|
15
|
+
import { percentTemplate as p } from "../../utils/format-money.js";
|
|
16
|
+
import "@gearbox-protocol/sdk/common-utils";
|
|
17
|
+
import "luxon";
|
|
18
|
+
import "../../utils/z-index.js";
|
|
19
|
+
function z(t) {
|
|
20
|
+
const n = t.toFixed(1);
|
|
21
|
+
return n.endsWith(".0") ? n.slice(0, -2) : n;
|
|
22
|
+
}
|
|
23
|
+
function m(t) {
|
|
24
|
+
const n = v(t), i = p(Math.abs(n));
|
|
25
|
+
return n < 0 ? `-${i}` : n > 0 ? i : p(0);
|
|
26
|
+
}
|
|
27
|
+
function w(t) {
|
|
28
|
+
const n = v(Math.abs(t));
|
|
29
|
+
return `-${p(n)}`;
|
|
30
|
+
}
|
|
31
|
+
function Z({
|
|
32
|
+
supplyApy: t,
|
|
33
|
+
maxLeverage: n,
|
|
34
|
+
collateralApy: i,
|
|
35
|
+
borrowApy: l,
|
|
36
|
+
additionalBorrowApy: d,
|
|
37
|
+
children: k,
|
|
38
|
+
className: f
|
|
39
|
+
}) {
|
|
40
|
+
const g = i ?? t, u = P(g), h = S(t), x = l !== void 0 && l > 0, b = d !== void 0 && d > 0, B = x || b, y = /* @__PURE__ */ s(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
className: N(
|
|
44
|
+
"flex w-[400px] max-w-[calc(100vw-32px)] flex-col gap-4 p-4",
|
|
45
|
+
"rounded-xl",
|
|
46
|
+
"bg-popover text-popover-foreground",
|
|
47
|
+
"border border-white/[0.07]",
|
|
48
|
+
"shadow-[0_4px_14px_rgba(0,0,0,0.15)]",
|
|
49
|
+
"text-left font-normal"
|
|
50
|
+
),
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ s("div", { className: "flex h-6 items-center justify-between gap-3 text-base leading-4 text-foreground", children: [
|
|
53
|
+
/* @__PURE__ */ e("span", { className: "font-semibold", children: /* @__PURE__ */ e(
|
|
54
|
+
a,
|
|
55
|
+
{
|
|
56
|
+
messageId: "components.yieldBreakdown.title"
|
|
57
|
+
}
|
|
58
|
+
) }),
|
|
59
|
+
n !== void 0 && n > 0 && /* @__PURE__ */ e("span", { className: "font-medium", children: /* @__PURE__ */ e(
|
|
60
|
+
a,
|
|
61
|
+
{
|
|
62
|
+
messageId: "components.yieldBreakdown.atLeverage",
|
|
63
|
+
values: { leverage: z(n) }
|
|
64
|
+
}
|
|
65
|
+
) })
|
|
66
|
+
] }),
|
|
67
|
+
/* @__PURE__ */ e(
|
|
68
|
+
r,
|
|
69
|
+
{
|
|
70
|
+
label: /* @__PURE__ */ e(
|
|
71
|
+
a,
|
|
72
|
+
{
|
|
73
|
+
messageId: "components.yieldBreakdown.baseYield"
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
value: /* @__PURE__ */ e("span", { className: "font-semibold", children: m(g.organicApy) })
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
u.length > 0 && /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: [
|
|
80
|
+
/* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(
|
|
81
|
+
a,
|
|
82
|
+
{
|
|
83
|
+
messageId: "components.yieldBreakdown.incentiveYield"
|
|
84
|
+
}
|
|
85
|
+
) }),
|
|
86
|
+
u.map((o) => /* @__PURE__ */ e(
|
|
87
|
+
r,
|
|
88
|
+
{
|
|
89
|
+
label: /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
90
|
+
/* @__PURE__ */ e(j, { token: o.token, size: 20 }),
|
|
91
|
+
/* @__PURE__ */ e("span", { children: o.token.symbol }),
|
|
92
|
+
/* @__PURE__ */ e(
|
|
93
|
+
T,
|
|
94
|
+
{
|
|
95
|
+
icon: R,
|
|
96
|
+
className: "size-3.5 text-muted-foreground"
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
] }),
|
|
100
|
+
value: /* @__PURE__ */ e("span", { className: "font-semibold", children: m(o.supplyApr ?? 0) })
|
|
101
|
+
},
|
|
102
|
+
`incentive-${o.token.address}-${o.supplyApr ?? 0}`
|
|
103
|
+
))
|
|
104
|
+
] }),
|
|
105
|
+
B && /* @__PURE__ */ s("div", { className: "flex flex-col gap-2", children: [
|
|
106
|
+
/* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(
|
|
107
|
+
a,
|
|
108
|
+
{
|
|
109
|
+
messageId: "components.yieldBreakdown.borrowRate"
|
|
110
|
+
}
|
|
111
|
+
) }),
|
|
112
|
+
x && /* @__PURE__ */ e(
|
|
113
|
+
r,
|
|
114
|
+
{
|
|
115
|
+
label: /* @__PURE__ */ e(
|
|
116
|
+
a,
|
|
117
|
+
{
|
|
118
|
+
messageId: "components.yieldBreakdown.baseRate"
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
value: /* @__PURE__ */ e("span", { className: "font-semibold text-muted-foreground", children: w(l) })
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
b && /* @__PURE__ */ e(
|
|
125
|
+
r,
|
|
126
|
+
{
|
|
127
|
+
label: /* @__PURE__ */ e(
|
|
128
|
+
a,
|
|
129
|
+
{
|
|
130
|
+
messageId: "components.yieldBreakdown.additionalRate"
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
value: /* @__PURE__ */ e("span", { className: "font-semibold text-muted-foreground", children: w(d) })
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
] }),
|
|
137
|
+
/* @__PURE__ */ e(
|
|
138
|
+
r,
|
|
139
|
+
{
|
|
140
|
+
className: "h-7",
|
|
141
|
+
label: /* @__PURE__ */ e("span", { className: "text-sm font-bold uppercase leading-5 tracking-wide", children: /* @__PURE__ */ e(
|
|
142
|
+
a,
|
|
143
|
+
{
|
|
144
|
+
messageId: "components.yieldBreakdown.netYield"
|
|
145
|
+
}
|
|
146
|
+
) }),
|
|
147
|
+
value: /* @__PURE__ */ e("span", { className: "text-xl font-bold leading-7", children: m(Y(t)) })
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
h.length > 0 && /* @__PURE__ */ s(I, { children: [
|
|
151
|
+
/* @__PURE__ */ e("div", { className: "h-px w-full bg-[#2d3035]" }),
|
|
152
|
+
/* @__PURE__ */ s("div", { className: "flex h-5 items-center justify-between gap-3", children: [
|
|
153
|
+
/* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(
|
|
154
|
+
a,
|
|
155
|
+
{
|
|
156
|
+
messageId: "components.yieldBreakdown.points"
|
|
157
|
+
}
|
|
158
|
+
) }),
|
|
159
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: h.map((o) => /* @__PURE__ */ s(
|
|
160
|
+
"span",
|
|
161
|
+
{
|
|
162
|
+
className: "inline-flex items-center gap-1 rounded-[10px] bg-[#242528] pr-2 text-sm font-semibold text-foreground",
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ e(
|
|
165
|
+
$,
|
|
166
|
+
{
|
|
167
|
+
reward: {
|
|
168
|
+
name: o.name,
|
|
169
|
+
type: o.id
|
|
170
|
+
},
|
|
171
|
+
size: 20
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
o.multiplier != null ? `${o.multiplier}×` : "—"
|
|
175
|
+
]
|
|
176
|
+
},
|
|
177
|
+
`points-${o.id}`
|
|
178
|
+
)) })
|
|
179
|
+
] })
|
|
180
|
+
] })
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
return /* @__PURE__ */ e(
|
|
185
|
+
F,
|
|
186
|
+
{
|
|
187
|
+
placement: "bottom",
|
|
188
|
+
triangle: !1,
|
|
189
|
+
type: "modal-tooltip",
|
|
190
|
+
minWidth: "100%",
|
|
191
|
+
maxWidth: "100%",
|
|
192
|
+
title: /* @__PURE__ */ e("span", { className: f, children: k }),
|
|
193
|
+
triggerClassName: f,
|
|
194
|
+
children: y
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
function c({ children: t }) {
|
|
199
|
+
return /* @__PURE__ */ e("span", { className: "text-xs font-normal uppercase leading-4 tracking-wide text-muted-foreground", children: t });
|
|
200
|
+
}
|
|
201
|
+
function r({
|
|
202
|
+
label: t,
|
|
203
|
+
value: n,
|
|
204
|
+
className: i
|
|
205
|
+
}) {
|
|
206
|
+
return /* @__PURE__ */ s(
|
|
207
|
+
"div",
|
|
208
|
+
{
|
|
209
|
+
className: N(
|
|
210
|
+
"flex h-6 items-center justify-between gap-3 text-sm leading-5 text-foreground",
|
|
211
|
+
i
|
|
212
|
+
),
|
|
213
|
+
children: [
|
|
214
|
+
/* @__PURE__ */ e("span", { className: "min-w-0 font-normal", children: t }),
|
|
215
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 tabular-nums", children: n })
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
export {
|
|
221
|
+
Z as YieldBreakdownTooltip
|
|
222
|
+
};
|
|
@@ -2,10 +2,11 @@ import "react";
|
|
|
2
2
|
import { useDebounce as e } from "./use-debounce.js";
|
|
3
3
|
import "@gearbox-protocol/sdk/common-utils";
|
|
4
4
|
import "@gearbox-protocol/sdk";
|
|
5
|
+
import "../components/breakpoint-provider.js";
|
|
5
6
|
const n = (o) => o();
|
|
6
|
-
function
|
|
7
|
+
function p(o) {
|
|
7
8
|
return e(n, o);
|
|
8
9
|
}
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
p as useDebounceCall
|
|
11
12
|
};
|
|
@@ -1,19 +1,52 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { useState as l, useEffect as u } from "react";
|
|
2
|
+
import { useBreakpointContext as o, BREAKPOINT_QUERIES as c } from "../components/breakpoint-provider.js";
|
|
3
|
+
function n(t, e = !0) {
|
|
4
|
+
const [i, a] = l(!1);
|
|
5
|
+
return u(() => {
|
|
6
|
+
if (!e)
|
|
7
|
+
return;
|
|
8
|
+
const s = window.matchMedia(t);
|
|
9
|
+
s.matches !== i && a(s.matches);
|
|
10
|
+
const r = () => a(s.matches);
|
|
11
|
+
return s.addEventListener("change", r), () => s.removeEventListener("change", r);
|
|
12
|
+
}, [i, t, e]), i;
|
|
10
13
|
}
|
|
11
|
-
const
|
|
14
|
+
const f = () => {
|
|
15
|
+
const t = o(), e = n(
|
|
16
|
+
c.isExtraSmall,
|
|
17
|
+
t === void 0
|
|
18
|
+
);
|
|
19
|
+
return t?.isExtraSmall ?? e;
|
|
20
|
+
}, b = () => {
|
|
21
|
+
const t = o(), e = n(
|
|
22
|
+
c.isMobile,
|
|
23
|
+
t === void 0
|
|
24
|
+
);
|
|
25
|
+
return t?.isMobile ?? e;
|
|
26
|
+
}, x = () => {
|
|
27
|
+
const t = o(), e = n(
|
|
28
|
+
c.isTablet,
|
|
29
|
+
t === void 0
|
|
30
|
+
);
|
|
31
|
+
return t?.isTablet ?? e;
|
|
32
|
+
}, k = () => {
|
|
33
|
+
const t = o(), e = n(
|
|
34
|
+
c.isMedium,
|
|
35
|
+
t === void 0
|
|
36
|
+
);
|
|
37
|
+
return t?.isMedium ?? e;
|
|
38
|
+
}, E = () => {
|
|
39
|
+
const t = o(), e = n(
|
|
40
|
+
c.isDesktop,
|
|
41
|
+
t === void 0
|
|
42
|
+
);
|
|
43
|
+
return t?.isDesktop ?? e;
|
|
44
|
+
};
|
|
12
45
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
46
|
+
E as useIsDesktop,
|
|
47
|
+
f as useIsExtraSmall,
|
|
48
|
+
k as useIsMedium,
|
|
49
|
+
b as useIsMobile,
|
|
50
|
+
x as useIsTablet,
|
|
51
|
+
n as useMediaQuery
|
|
19
52
|
};
|