@orderly.network/ui 2.11.0 → 3.0.0-beta.1
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 +22 -52
- package/dist/index.d.ts +22 -52
- package/dist/index.js +109 -165
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -164
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React71 from 'react';
|
|
2
|
-
import React71__default, { forwardRef, useMemo, useRef, useCallback, useState, useEffect, useId, createContext, Fragment as Fragment$1, memo, useImperativeHandle, useContext, useReducer } from 'react';
|
|
2
|
+
import React71__default, { forwardRef, useMemo, useRef, useCallback, useState, useEffect, useId, createContext, Fragment as Fragment$1, memo, useImperativeHandle, useContext, useReducer, createElement } from 'react';
|
|
3
3
|
import { createTV, tv as tv$1, cnBase, cn } from 'tailwind-variants';
|
|
4
4
|
export { cnBase as cn } from 'tailwind-variants';
|
|
5
5
|
import { Slot } from '@radix-ui/react-slot';
|
|
@@ -7,7 +7,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
7
7
|
import { isValid, format } from 'date-fns';
|
|
8
8
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
9
9
|
import makeBlockie from 'ethereum-blockies-base64';
|
|
10
|
-
import { findLongestCommonSubString, Decimal, getPrecisionByNumber, numberToHumanStyle, commify,
|
|
10
|
+
import { findLongestCommonSubString, Decimal, getPrecisionByNumber, numberToHumanStyle, commify, todpIfNeed, formatNum } from '@orderly.network/utils';
|
|
11
11
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
12
12
|
import { SelectItem as SelectItem$1, SelectItemText, ItemIndicator } from '@radix-ui/react-select';
|
|
13
13
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
@@ -17,7 +17,8 @@ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
|
17
17
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
18
18
|
import { useReactTable, getFilteredRowModel, getSortedRowModel, getExpandedRowModel, getCoreRowModel, getPaginationRowModel, createColumnHelper, flexRender } from '@tanstack/react-table';
|
|
19
19
|
import { enUS } from 'date-fns/locale';
|
|
20
|
-
import {
|
|
20
|
+
import { injectable, positionToPath, OrderlyPluginRegistry } from '@orderly.network/plugin-core';
|
|
21
|
+
export { ExtensionPositionEnum, ExtensionProvider, ExtensionSlot, OrderlyExtensionRegistry, OrderlyPluginProvider, OrderlyPluginRegistry, PluginErrorBoundary, PluginScopeContext, PluginScopeProvider, createInterceptor, createOrderlySDK, injectable, installExtension, positionToPath, setExtensionBuilder, useExtensionContext, useInjectedComponent, useOrderlyPluginContext, usePluginScope } from '@orderly.network/plugin-core';
|
|
21
22
|
import { DayPicker } from 'react-day-picker';
|
|
22
23
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
23
24
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
@@ -7431,139 +7432,26 @@ var TablePagination = (props) => {
|
|
|
7431
7432
|
}
|
|
7432
7433
|
) });
|
|
7433
7434
|
};
|
|
7434
|
-
var
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
if (!globalObject.__ORDERLY_EXTENSION_REGISTRY__) {
|
|
7439
|
-
globalObject.__ORDERLY_EXTENSION_REGISTRY__ = new _OrderlyExtensionRegistry();
|
|
7440
|
-
}
|
|
7441
|
-
return globalObject.__ORDERLY_EXTENSION_REGISTRY__;
|
|
7442
|
-
}
|
|
7443
|
-
extensionMap = /* @__PURE__ */ new Map();
|
|
7444
|
-
// private formatterMap: Map<string, Function> = new Map();
|
|
7445
|
-
register(plugin3) {
|
|
7446
|
-
if (!plugin3.builder) ;
|
|
7447
|
-
for (let index = 0; index < plugin3.positions.length; index++) {
|
|
7448
|
-
if (typeof plugin3.builder !== "function") {
|
|
7449
|
-
const builder = this.extensionMap.get(plugin3.positions[index])?.builder;
|
|
7450
|
-
plugin3.builder = typeof builder === "undefined" ? (
|
|
7451
|
-
// ? DEFAULT_BUILDER
|
|
7452
|
-
void 0
|
|
7453
|
-
) : builder;
|
|
7454
|
-
}
|
|
7455
|
-
const pos = plugin3.positions[index];
|
|
7456
|
-
this.registerToPosition(pos, plugin3);
|
|
7457
|
-
}
|
|
7458
|
-
}
|
|
7459
|
-
registerToPosition(position, plugin3) {
|
|
7460
|
-
if (this.extensionMap.has(position)) {
|
|
7461
|
-
const existingPlugin = this.extensionMap.get(position);
|
|
7462
|
-
if (!existingPlugin?.__isInternal) {
|
|
7463
|
-
if (!existingPlugin?.builder && plugin3.__isInternal) {
|
|
7464
|
-
this.setBuilder(position, plugin3.builder);
|
|
7465
|
-
}
|
|
7466
|
-
return;
|
|
7467
|
-
}
|
|
7468
|
-
if (!plugin3.builder) {
|
|
7469
|
-
plugin3.builder = existingPlugin.builder;
|
|
7470
|
-
}
|
|
7471
|
-
}
|
|
7472
|
-
this.extensionMap.set(position, plugin3);
|
|
7473
|
-
}
|
|
7474
|
-
setBuilder(position, builder) {
|
|
7475
|
-
const plugin3 = this.extensionMap.get(position);
|
|
7476
|
-
if (plugin3) {
|
|
7477
|
-
plugin3.builder = builder;
|
|
7478
|
-
}
|
|
7479
|
-
}
|
|
7480
|
-
unregister(plugin3) {
|
|
7481
|
-
for (let index = 0; index < plugin3.positions.length; index++) {
|
|
7482
|
-
const pos = plugin3.positions[index];
|
|
7483
|
-
this.unregisterFromPosition(pos);
|
|
7484
|
-
}
|
|
7485
|
-
}
|
|
7486
|
-
unregisterFromPosition(position) {
|
|
7487
|
-
this.extensionMap.delete(position);
|
|
7488
|
-
}
|
|
7489
|
-
getPluginsByPosition(position) {
|
|
7490
|
-
return this.extensionMap.get(position);
|
|
7491
|
-
}
|
|
7492
|
-
/**
|
|
7493
|
-
* get the registered formatter by position
|
|
7494
|
-
* @param position
|
|
7495
|
-
*/
|
|
7496
|
-
getFormatterByPosition(position) {
|
|
7497
|
-
return this.extensionMap.get(position);
|
|
7498
|
-
}
|
|
7499
|
-
};
|
|
7500
|
-
|
|
7501
|
-
// src/plugin/install.tsx
|
|
7502
|
-
var installExtension = (options) => {
|
|
7503
|
-
return (component) => {
|
|
7504
|
-
const registry = OrderlyExtensionRegistry.getInstance();
|
|
7505
|
-
registry.register({
|
|
7506
|
-
name: options.name,
|
|
7507
|
-
positions: options.positions,
|
|
7508
|
-
__isInternal: !!options.__isInternal,
|
|
7509
|
-
builder: options.builder,
|
|
7510
|
-
render: component
|
|
7511
|
-
});
|
|
7512
|
-
};
|
|
7513
|
-
};
|
|
7514
|
-
var setExtensionBuilder = (position, builder) => {
|
|
7515
|
-
const registry = OrderlyExtensionRegistry.getInstance();
|
|
7516
|
-
registry.setBuilder(position, builder);
|
|
7517
|
-
};
|
|
7518
|
-
var NotFound = (props) => {
|
|
7519
|
-
const { position } = props;
|
|
7520
|
-
return /* @__PURE__ */ jsxs("div", { className: "oui-text-danger", children: [
|
|
7521
|
-
/* @__PURE__ */ jsx("strong", { children: `[${position}] ` }),
|
|
7522
|
-
/* @__PURE__ */ jsx("span", { children: "Not found!" })
|
|
7523
|
-
] });
|
|
7524
|
-
};
|
|
7525
|
-
|
|
7526
|
-
// src/plugin/useBuilder.ts
|
|
7527
|
-
var useBuilder = (position, props) => {
|
|
7528
|
-
const registry = OrderlyExtensionRegistry.getInstance();
|
|
7529
|
-
const plugin3 = registry.getPluginsByPosition(position);
|
|
7530
|
-
return () => {
|
|
7531
|
-
return plugin3?.builder?.(props) || props;
|
|
7532
|
-
};
|
|
7533
|
-
};
|
|
7534
|
-
|
|
7535
|
-
// src/plugin/useExtensionBuilder.ts
|
|
7536
|
-
var useExtensionBuilder = (position, props) => {
|
|
7537
|
-
const builder = useBuilder(position, props);
|
|
7538
|
-
return builder();
|
|
7539
|
-
};
|
|
7540
|
-
var ExtensionSlot = (props) => {
|
|
7541
|
-
const { position, scope, defaultWidget: defaultValue, ...rest } = props;
|
|
7542
|
-
const elementProps = useExtensionBuilder(position, rest);
|
|
7543
|
-
const Ele = useMemo(() => {
|
|
7544
|
-
const registry = OrderlyExtensionRegistry.getInstance();
|
|
7545
|
-
const plugin3 = registry.getPluginsByPosition(position);
|
|
7546
|
-
return plugin3?.render ?? defaultValue ?? NotFound;
|
|
7547
|
-
}, []);
|
|
7548
|
-
return /* @__PURE__ */ jsx(
|
|
7549
|
-
ErrorBoundary,
|
|
7435
|
+
var EmptyDataState = (props) => {
|
|
7436
|
+
const [locale] = useLocale("empty");
|
|
7437
|
+
return /* @__PURE__ */ jsxs(
|
|
7438
|
+
Flex,
|
|
7550
7439
|
{
|
|
7551
|
-
|
|
7552
|
-
|
|
7440
|
+
itemAlign: "center",
|
|
7441
|
+
direction: "column",
|
|
7442
|
+
gapY: 4,
|
|
7443
|
+
className: props.className,
|
|
7444
|
+
children: [
|
|
7445
|
+
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(emptyData_default, {}) }),
|
|
7446
|
+
/* @__PURE__ */ jsx(Text2, { as: "div", intensity: 36, size: "2xs", children: props.title ?? locale.description })
|
|
7447
|
+
]
|
|
7553
7448
|
}
|
|
7554
7449
|
);
|
|
7555
7450
|
};
|
|
7556
|
-
|
|
7557
|
-
|
|
7558
|
-
|
|
7559
|
-
|
|
7560
|
-
ExtensionPositionEnum2["WithdrawForm"] = "withdrawForm";
|
|
7561
|
-
ExtensionPositionEnum2["AccountMenu"] = "accountMenu";
|
|
7562
|
-
ExtensionPositionEnum2["MobileAccountMenu"] = "mobileAccountMenu";
|
|
7563
|
-
ExtensionPositionEnum2["MainMenus"] = "mainMenus";
|
|
7564
|
-
ExtensionPositionEnum2["EmptyDataIdentifier"] = "emptyDataIdentifier";
|
|
7565
|
-
return ExtensionPositionEnum2;
|
|
7566
|
-
})(ExtensionPositionEnum || {});
|
|
7451
|
+
var InjectableEmptyDataState = injectable(
|
|
7452
|
+
EmptyDataState,
|
|
7453
|
+
"Table.EmptyDataIdentifier"
|
|
7454
|
+
);
|
|
7567
7455
|
var TablePlaceholder = (props) => {
|
|
7568
7456
|
const { visible, loading, emptyView, className } = props;
|
|
7569
7457
|
if (!visible) {
|
|
@@ -7581,7 +7469,7 @@ var TablePlaceholder = (props) => {
|
|
|
7581
7469
|
"oui-flex oui-items-center oui-justify-center",
|
|
7582
7470
|
className
|
|
7583
7471
|
),
|
|
7584
|
-
children: loading ? /* @__PURE__ */ jsx(Spinner, {}) : emptyView || /* @__PURE__ */ jsx(
|
|
7472
|
+
children: loading ? /* @__PURE__ */ jsx(Spinner, {}) : emptyView || /* @__PURE__ */ jsx(InjectableEmptyDataState, {})
|
|
7585
7473
|
}
|
|
7586
7474
|
);
|
|
7587
7475
|
};
|
|
@@ -9842,26 +9730,6 @@ var usePagination = (initial) => {
|
|
|
9842
9730
|
parsePagination
|
|
9843
9731
|
};
|
|
9844
9732
|
};
|
|
9845
|
-
var EmptyDataState = (props) => {
|
|
9846
|
-
const [locale] = useLocale("empty");
|
|
9847
|
-
return /* @__PURE__ */ jsxs(
|
|
9848
|
-
Flex,
|
|
9849
|
-
{
|
|
9850
|
-
itemAlign: "center",
|
|
9851
|
-
direction: "column",
|
|
9852
|
-
gapY: 4,
|
|
9853
|
-
className: props.className,
|
|
9854
|
-
children: [
|
|
9855
|
-
/* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(emptyData_default, {}) }),
|
|
9856
|
-
/* @__PURE__ */ jsx(Text2, { as: "div", intensity: 36, size: "2xs", children: props.title ?? locale.description })
|
|
9857
|
-
]
|
|
9858
|
-
}
|
|
9859
|
-
);
|
|
9860
|
-
};
|
|
9861
|
-
installExtension({
|
|
9862
|
-
name: "emptyDataIdentifier",
|
|
9863
|
-
positions: ["emptyDataIdentifier" /* EmptyDataIdentifier */]
|
|
9864
|
-
})(EmptyDataState);
|
|
9865
9733
|
|
|
9866
9734
|
// src/table/features/index.ts
|
|
9867
9735
|
var features_exports = {};
|
|
@@ -11556,19 +11424,23 @@ var SimpleDropdownMenu = (props) => {
|
|
|
11556
11424
|
) })
|
|
11557
11425
|
] });
|
|
11558
11426
|
};
|
|
11427
|
+
|
|
11428
|
+
// src/provider/componentProvider.tsx
|
|
11429
|
+
var COMPONENTS_PLUGIN_ID = "orderly-components-provider-overrides";
|
|
11559
11430
|
var ComponentsProvider = (props) => {
|
|
11560
11431
|
useEffect(() => {
|
|
11561
11432
|
if (props.components && Object.keys(props.components).length) {
|
|
11562
|
-
|
|
11563
|
-
|
|
11564
|
-
|
|
11565
|
-
|
|
11566
|
-
|
|
11567
|
-
|
|
11568
|
-
|
|
11569
|
-
|
|
11570
|
-
|
|
11571
|
-
|
|
11433
|
+
const interceptors = Object.entries(props.components).map(
|
|
11434
|
+
([position, Element]) => ({
|
|
11435
|
+
target: positionToPath(position),
|
|
11436
|
+
component: (_Original, slotProps) => createElement(Element, slotProps)
|
|
11437
|
+
})
|
|
11438
|
+
);
|
|
11439
|
+
OrderlyPluginRegistry.register({
|
|
11440
|
+
id: COMPONENTS_PLUGIN_ID,
|
|
11441
|
+
name: "ComponentsProvider",
|
|
11442
|
+
interceptors
|
|
11443
|
+
});
|
|
11572
11444
|
}
|
|
11573
11445
|
}, [props.components]);
|
|
11574
11446
|
return props.children;
|
|
@@ -11926,6 +11798,6 @@ var LIGHT_THEME_CSS_VARS = {
|
|
|
11926
11798
|
"--oui-spacing-xl": "33.75rem"
|
|
11927
11799
|
};
|
|
11928
11800
|
|
|
11929
|
-
export { ActionSheet, AddCircleIcon, AffiliateIcon, AlertDialog, ArrowDownShortIcon, ArrowDownSquareFillIcon, ArrowDownUpIcon, ArrowLeftRightIcon, ArrowLeftRightSquareFill, ArrowLeftShortIcon, ArrowRightShortIcon, ArrowRightUpSquareFillIcon, ArrowUpShortIcon, ArrowUpSquareFillIcon, AssetIcon, Avatar, Badge, BarChartIcon, BattleActiveIcon, BattleIcon, BattleInactiveIcon, BattleSolidActiveIcon, BattleSolidInactiveIcon, BellIcon, Box, Button, Calendar, CalendarIcon, CalendarMinusIcon, Card, CardBase, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CaretDownIcon, CaretLeftIcon, CaretRightIcon, CaretUpIcon, ChainIcon, CheckIcon, CheckSquareEmptyIcon, Checkbox, CheckedCircleFillIcon, CheckedSquareFillIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleOutlinedIcon, CloseCircleFillIcon, CloseIcon, CloseRoundFillIcon, CloseSquareFillIcon, collapse_default as Collapse, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ConfirmDialog, CopyIcon, DARK_THEME_CSS_VARS, DataFilter, DataTable, DatePicker2 as DatePicker, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DotStatus, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuTrigger, EVMAvatar, EarnActiveIcon, EarnIcon, EarnInactiveIcon, EditIcon, Either, EmptyDataState, EmptyStateIcon, EsOrderlyIcon, ExclamationFillIcon,
|
|
11801
|
+
export { ActionSheet, AddCircleIcon, AffiliateIcon, AlertDialog, ArrowDownShortIcon, ArrowDownSquareFillIcon, ArrowDownUpIcon, ArrowLeftRightIcon, ArrowLeftRightSquareFill, ArrowLeftShortIcon, ArrowRightShortIcon, ArrowRightUpSquareFillIcon, ArrowUpShortIcon, ArrowUpSquareFillIcon, AssetIcon, Avatar, Badge, BarChartIcon, BattleActiveIcon, BattleIcon, BattleInactiveIcon, BattleSolidActiveIcon, BattleSolidInactiveIcon, BellIcon, Box, Button, Calendar, CalendarIcon, CalendarMinusIcon, Card, CardBase, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CaretDownIcon, CaretLeftIcon, CaretRightIcon, CaretUpIcon, ChainIcon, CheckIcon, CheckSquareEmptyIcon, Checkbox, CheckedCircleFillIcon, CheckedSquareFillIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleOutlinedIcon, CloseCircleFillIcon, CloseIcon, CloseRoundFillIcon, CloseSquareFillIcon, collapse_default as Collapse, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, ConfirmDialog, CopyIcon, DARK_THEME_CSS_VARS, DataFilter, DataTable, DatePicker2 as DatePicker, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Divider, DotStatus, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRoot, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuTrigger, EVMAvatar, EarnActiveIcon, EarnIcon, EarnInactiveIcon, EditIcon, Either, EmptyDataState, EmptyStateIcon, EsOrderlyIcon, ExclamationFillIcon, EyeCloseIcon, EyeIcon, FeeTierIcon, Flex, GradientText, Grid2 as Grid, HoverCard, HoverCardContent, HoverCardRoot, HoverCardTrigger, Icon, IconButton, InfoCircleIcon, InjectableEmptyDataState, Input2 as Input, InputAdditional, LIGHT_THEME_CSS_VARS, LeaderboardActiveIcon, LeaderboardInactiveIcon, LeftNavVaultsIcon, ListView, LocaleContext, LocaleProvider, Logo, MarketsActiveIcon, MarketsInactiveIcon, Marquee, ModalContext, ModalIdContext, ModalProvider, MultiSortHeader, NewsFillIcon, tailwind_exports as OUITailwind, OrderlyIcon, OrderlyThemeProvider, PaginationItems, PeopleIcon, PerpsIcon, PersonIcon, Picker, PlusIcon, Popover, PopoverAnchor, PopoverContent, PopoverRoot, PopoverTrigger, PopupUnionIcon, PortfolioActiveIcon, PortfolioInactiveIcon, QuestionFillIcon, ReduceIcon, ReferralSolidIcon, RefreshIcon, RwaIcon, ScrollArea, ScrollBar, ScrollIndicator, Select2 as Select, SelectItem, SelectedChoicesFillIcon, ServerFillIcon, SettingFillIcon, SettingIcon, ShareIcon, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SimpleDialog, SimpleDialogFooter, SimpleDropdownMenu, SimpleSheet, Slider, SortingAscIcon, SortingDescIcon, SortingIcon, Spinner, SpotIcon, SquareOutlinedIcon, StarChildChatActiveIcon, StarChildChatInactiveIcon, Statistic, StatisticLabel, SwapHorizIcon, Switch, TabPanel, features_exports as TableFeatures, Tabs, TabsBase, TabsContent, TabsList, TabsTrigger, Text2 as Text, TextField, ThrottledButton, Tips, ToastTile, Toaster, TokenIcon, Tooltip, TooltipArrow, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger, TraderMobileIcon, TradingActiveIcon, TradingIcon, TradingInactiveIcon, TradingLeftNavIcon, TradingRewardsIcon, TriggerDialog, VaultsIcon, VectorIcon, WalletIcon, WarningIcon, WoofiStakeIcon, boxVariants, buttonVariants, capitalizeFirstLetter, convertValueToPercentage, dotStatusVariants, formatAddress, gradientTextVariants, iconButtonVariants, formatter_exports as inputFormatter, modal, parseNumber, registerSimpleDialog, registerSimpleSheet, scrollAreaVariants, startViewTransition, statisticVariants, textVariants, tv, useLocale, useLongPress, useMediaQuery, useModal, useMultiSort, useObserverElement, useOrderlyTheme, usePagination, useScreen, useThemeAttribute };
|
|
11930
11802
|
//# sourceMappingURL=index.mjs.map
|
|
11931
11803
|
//# sourceMappingURL=index.mjs.map
|