@hyperbridge/ui 0.0.28 → 0.0.30
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/index.d.mts +2 -2
- package/dist/index.mjs +59 -5
- package/package.json +1 -1
- package/styles/base.css +8 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { Image } from '@unpic/react';
|
|
3
3
|
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
5
|
import * as React$1 from 'react';
|
|
5
6
|
import React__default from 'react';
|
|
6
|
-
import { VariantProps } from 'class-variance-authority';
|
|
7
7
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
8
8
|
import { DialogContentProps } from '@radix-ui/react-dialog';
|
|
9
9
|
import * as motion_dist_react from 'motion/dist/react';
|
|
@@ -965,4 +965,4 @@ declare function Badge({ className, variant, asChild, ...props }: React$1.Compon
|
|
|
965
965
|
asChild?: boolean;
|
|
966
966
|
}): react_jsx_runtime.JSX.Element;
|
|
967
967
|
|
|
968
|
-
export { AccessoryButton, type AccessoryButtonProps, AccountItem, AccountStack, type AccountStackProps, AddressInput, AddressInputFocusBehaviour, AssetList, AssetListItem, AssetValueTrend, Badge, BadgeIcon, Balance, BridgeForm, type BridgeFormProps, BridgeInput, BridgeSettings, type BridgeSettingsProps, BridgeTokenButton, Button, type ButtonProps, CWDrawerContent, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogMorphContent, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerContent, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, EmptyStateConceal, EmptyStateContent, EmptyStateDescription, EmptyStateTitle, type EstimatedTimeFormatted, GradientButton, HBDrawer, HBDrawerClose, HBDrawerContent, HBDrawerDescription, HBDrawerFooter, HBDrawerHeader, HBDrawerOverlay, HBDrawerPortal, HBDrawerTitle, HBDrawerTrigger, Header, HeaderChooseProvider, HeaderContent, HeaderGradient, HeaderNested, IconButton, Input, type InputProps, LabelledSeperator, ListHeading, ListSection, ManageAccounts, Modal, type ModalProps, type Network, NetworkGroupItem, NetworkSelectionItem, NetworkSelector, type NetworkSelectorProps, NetworkSwitcher, NetworkSwitcherButton, type NetworkSwitcherProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ReviewItem, ReviewItemAddress, ReviewItemCopyAddressButton, ScrollAwareSeparator, SearchInput, type SearchInputProps, Settings, type SettingsProps, Sheet, SheetContent, SheetTrigger, Summary, SummaryValues, SwapForm, type SwapFormProps, SwapTokenButton, SwapTokenItem, type SwapTokenItemProps, SwapTokenSelector, SwapTokenSelectorContent, type SwapTokenSelectorContentProps, SwapTokenSelectorEmpty, type SwapTokenSelectorEmptyProps, SwapTokenSelectorHeader, type SwapTokenSelectorHeaderProps, type SwapTokenSelectorProps, SwapTokenSelectorSearch, type SwapTokenSelectorSearchProps, SwapTokenSelectorSection, type SwapTokenSelectorSectionProps, TabAlt, TabAltContent, TabAltHeader, TabAltHeaders, TabAltPanel, TabItem, Tabs, TabsContent, TabsList, TagButton, Text, TimelineItem, TimelineList, TimelineListGroup, TimelineRoot, TimerWrap, ToastBox, type Token, TokenImage, type TokenInfo, TokenSelectionItem, TokenSelector, type TokenSelectorProps, TokenTransferPair, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransactionTimer, TxList, TxListItem, TxListItemProcessing, type WalletAccount, WalletAccountItem, WalletConnectedHeader, type WalletConnectedHeaderProps, WalletHeader, type WalletHeaderCallbacks, WalletHeaderContent, WalletHeaderContentBlur, type WalletHeaderContentProps, type WalletHeaderProps, WalletHeaderTabItem, WalletHeaderTabs, WalletHeaderTabsContent, WalletHeaderTabsList, type WalletHeaderTabsProps, WalletManagerUIContent, WalletManagerUIProvider, WalletProviderItem, badgeVariants, makeEntry };
|
|
968
|
+
export { AccessoryButton, type AccessoryButtonProps, AccountItem, AccountStack, type AccountStackProps, AddressInput, AddressInputFocusBehaviour, AssetList, AssetListItem, AssetValueTrend, Badge, BadgeIcon, Balance, BridgeForm, type BridgeFormProps, BridgeInput, BridgeSettings, type BridgeSettingsProps, BridgeTokenButton, Button, type ButtonProps, CWDrawerContent, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogMorphContent, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerContent, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, EmptyStateConceal, EmptyStateContent, EmptyStateDescription, EmptyStateTitle, type EstimatedTimeFormatted, GradientButton, HBDrawer, HBDrawerClose, HBDrawerContent, HBDrawerDescription, HBDrawerFooter, HBDrawerHeader, HBDrawerOverlay, HBDrawerPortal, HBDrawerTitle, HBDrawerTrigger, Header, HeaderChooseProvider, HeaderContent, HeaderGradient, HeaderNested, IconButton, Input, type InputProps, LabelledSeperator, ListHeading, ListSection, ManageAccounts, Modal, type ModalProps, type Network, NetworkGroupItem, NetworkSelectionItem, NetworkSelector, type NetworkSelectorProps, NetworkSwitcher, NetworkSwitcherButton, type NetworkSwitcherProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ReviewItem, ReviewItemAddress, ReviewItemCopyAddressButton, ScrollAwareSeparator, SearchInput, type SearchInputProps, Settings, type SettingsProps, Sheet, SheetContent, SheetTrigger, Summary, SummaryValues, SwapForm, type SwapFormProps, SwapTokenButton, SwapTokenItem, type SwapTokenItemProps, SwapTokenSelector, SwapTokenSelectorContent, type SwapTokenSelectorContentProps, SwapTokenSelectorEmpty, type SwapTokenSelectorEmptyProps, SwapTokenSelectorHeader, type SwapTokenSelectorHeaderProps, type SwapTokenSelectorProps, SwapTokenSelectorSearch, type SwapTokenSelectorSearchProps, SwapTokenSelectorSection, type SwapTokenSelectorSectionProps, TabAlt, TabAltContent, TabAltHeader, TabAltHeaders, TabAltPanel, TabItem, Tabs, TabsContent, TabsList, TagButton, Text, TimelineItem, TimelineList, TimelineListGroup, TimelineRoot, TimerWrap, ToastBox, type Token, TokenImage, type TokenInfo, TokenSelectionItem, TokenSelector, type TokenSelectorProps, TokenTransferPair, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TransactionTimer, TxList, TxListItem, TxListItemProcessing, type WalletAccount, WalletAccountItem, WalletConnectedHeader, type WalletConnectedHeaderProps, WalletHeader, type WalletHeaderCallbacks, WalletHeaderContent, WalletHeaderContentBlur, type WalletHeaderContentProps, type WalletHeaderProps, WalletHeaderTabItem, WalletHeaderTabs, WalletHeaderTabsContent, WalletHeaderTabsList, type WalletHeaderTabsProps, WalletManagerUIContent, WalletManagerUIProvider, WalletProviderItem, badgeVariants, buttonVariants, makeEntry };
|
package/dist/index.mjs
CHANGED
|
@@ -246,6 +246,7 @@ function TokenTransferPair(props) {
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
// src/components/button/button.tsx
|
|
249
|
+
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
249
250
|
import { cva as cva4 } from "class-variance-authority";
|
|
250
251
|
|
|
251
252
|
// src/@/ui/button.tsx
|
|
@@ -332,7 +333,6 @@ function Button(_a) {
|
|
|
332
333
|
}
|
|
333
334
|
|
|
334
335
|
// src/components/button/button.tsx
|
|
335
|
-
import { Slot as Slot3 } from "@radix-ui/react-slot";
|
|
336
336
|
import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
337
337
|
function Button2(_a) {
|
|
338
338
|
var _b = _a, { children } = _b, other = __objRest(_b, ["children"]);
|
|
@@ -1210,7 +1210,7 @@ function EmptyState(props) {
|
|
|
1210
1210
|
|
|
1211
1211
|
// src/components/molecules/modal.tsx
|
|
1212
1212
|
import { AnimatePresence, motion } from "motion/react";
|
|
1213
|
-
import { useEffect as
|
|
1213
|
+
import { useEffect as useEffect4 } from "react";
|
|
1214
1214
|
|
|
1215
1215
|
// src/hooks/is-mobile.ts
|
|
1216
1216
|
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
@@ -1227,6 +1227,31 @@ var useIsMobile = () => {
|
|
|
1227
1227
|
return isMobile;
|
|
1228
1228
|
};
|
|
1229
1229
|
|
|
1230
|
+
// src/hooks/use-viewport-height.ts
|
|
1231
|
+
import { useEffect as useEffect3, useState as useState4 } from "react";
|
|
1232
|
+
function useViewportHeight(enabled = true) {
|
|
1233
|
+
const [viewportHeight, setViewportHeight] = useState4(null);
|
|
1234
|
+
useEffect3(() => {
|
|
1235
|
+
if (!enabled) return;
|
|
1236
|
+
const handleResize = () => {
|
|
1237
|
+
if (window.visualViewport) {
|
|
1238
|
+
setViewportHeight(window.visualViewport.height);
|
|
1239
|
+
}
|
|
1240
|
+
};
|
|
1241
|
+
if (window.visualViewport) {
|
|
1242
|
+
window.visualViewport.addEventListener("resize", handleResize);
|
|
1243
|
+
handleResize();
|
|
1244
|
+
}
|
|
1245
|
+
return () => {
|
|
1246
|
+
if (window.visualViewport) {
|
|
1247
|
+
window.visualViewport.removeEventListener("resize", handleResize);
|
|
1248
|
+
}
|
|
1249
|
+
setViewportHeight(null);
|
|
1250
|
+
};
|
|
1251
|
+
}, [enabled]);
|
|
1252
|
+
return viewportHeight;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1230
1255
|
// src/lib/animations.ts
|
|
1231
1256
|
var modalVariants = {
|
|
1232
1257
|
initial: {
|
|
@@ -1398,8 +1423,22 @@ import { jsx as jsx17 } from "react/jsx-runtime";
|
|
|
1398
1423
|
var Modal = (props) => {
|
|
1399
1424
|
const { isOpen, children, onClose } = props;
|
|
1400
1425
|
const isMobile = useIsMobile();
|
|
1426
|
+
const viewportHeight = useViewportHeight(isMobile && isOpen);
|
|
1401
1427
|
if (isMobile) {
|
|
1402
|
-
return /* @__PURE__ */ jsx17(Drawer, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsx17(
|
|
1428
|
+
return /* @__PURE__ */ jsx17(Drawer, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ jsx17(
|
|
1429
|
+
DrawerContent,
|
|
1430
|
+
{
|
|
1431
|
+
className: "bg-brand-black-550 border-brand-black-300",
|
|
1432
|
+
style: viewportHeight ? {
|
|
1433
|
+
height: `${viewportHeight}px`,
|
|
1434
|
+
maxHeight: `${viewportHeight}px`,
|
|
1435
|
+
minHeight: "auto"
|
|
1436
|
+
} : {
|
|
1437
|
+
minHeight: "90dvh"
|
|
1438
|
+
},
|
|
1439
|
+
children
|
|
1440
|
+
}
|
|
1441
|
+
) });
|
|
1403
1442
|
}
|
|
1404
1443
|
return /* @__PURE__ */ jsx17(DestkopModal, __spreadValues({}, props));
|
|
1405
1444
|
};
|
|
@@ -1412,7 +1451,7 @@ function DestkopModal(props) {
|
|
|
1412
1451
|
className
|
|
1413
1452
|
} = props;
|
|
1414
1453
|
const { variants, transition } = animationPresets[animationPreset];
|
|
1415
|
-
|
|
1454
|
+
useEffect4(() => {
|
|
1416
1455
|
const handleEscapeKey = (event) => {
|
|
1417
1456
|
if (event.key === "Escape" && isOpen && onClose) {
|
|
1418
1457
|
onClose();
|
|
@@ -4839,8 +4878,22 @@ function CWDrawerContent(_a) {
|
|
|
4839
4878
|
"children"
|
|
4840
4879
|
]);
|
|
4841
4880
|
const isMobile = useIsMobile();
|
|
4881
|
+
const viewportHeight = useViewportHeight(isMobile);
|
|
4842
4882
|
if (isMobile) {
|
|
4843
|
-
return /* @__PURE__ */ jsx48(
|
|
4883
|
+
return /* @__PURE__ */ jsx48(
|
|
4884
|
+
HBDrawerContent,
|
|
4885
|
+
{
|
|
4886
|
+
className: "bg-brand-black-550 rounded-t-[1rem] w-full px-[1rem] border-t border-brand-black-300",
|
|
4887
|
+
style: viewportHeight ? {
|
|
4888
|
+
height: `${viewportHeight}px`,
|
|
4889
|
+
maxHeight: `${viewportHeight}px`,
|
|
4890
|
+
minHeight: "auto"
|
|
4891
|
+
} : {
|
|
4892
|
+
minHeight: "90dvh"
|
|
4893
|
+
},
|
|
4894
|
+
children: /* @__PURE__ */ jsx48("div", { className: "flex flex-col flex-1", children })
|
|
4895
|
+
}
|
|
4896
|
+
);
|
|
4844
4897
|
}
|
|
4845
4898
|
return /* @__PURE__ */ jsx48(
|
|
4846
4899
|
SheetContent,
|
|
@@ -5440,5 +5493,6 @@ export {
|
|
|
5440
5493
|
WalletManagerUIProvider,
|
|
5441
5494
|
WalletProviderItem,
|
|
5442
5495
|
badgeVariants,
|
|
5496
|
+
buttonVariants,
|
|
5443
5497
|
makeEntry
|
|
5444
5498
|
};
|
package/package.json
CHANGED
package/styles/base.css
CHANGED