@orderly.network/ui 2.12.2 → 2.12.3

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.mjs CHANGED
@@ -8,7 +8,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
10
  import { findLongestCommonSubString, Decimal, getPrecisionByNumber, numberToHumanStyle, commify, getGlobalObject, todpIfNeed, formatNum } from '@orderly.network/utils';
11
- import * as DialogPrimitive from '@radix-ui/react-dialog';
11
+ import * as SheetPrimitive from '@radix-ui/react-dialog';
12
12
  import { enUS } from 'date-fns/locale';
13
13
  import * as TooltipPrimitive from '@radix-ui/react-tooltip';
14
14
  import * as SelectPrimitive from '@radix-ui/react-select';
@@ -5241,22 +5241,22 @@ var modalActions = {
5241
5241
  setStates,
5242
5242
  updateArgs
5243
5243
  };
5244
- var Sheet = DialogPrimitive.Root;
5245
- var SheetTrigger = DialogPrimitive.Trigger;
5246
- var SheetClose = DialogPrimitive.Close;
5247
- var SheetPortal = DialogPrimitive.Portal;
5244
+ var Sheet = SheetPrimitive.Root;
5245
+ var SheetTrigger = SheetPrimitive.Trigger;
5246
+ var SheetClose = SheetPrimitive.Close;
5247
+ var SheetPortal = SheetPrimitive.Portal;
5248
5248
  var SheetOverlay = React79.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
5249
- DialogPrimitive.Overlay,
5249
+ SheetPrimitive.Overlay,
5250
5250
  {
5251
5251
  className: cnBase(
5252
- "oui-sheet-overlay oui-fixed oui-inset-0 oui-z-50 oui-bg-black/60 oui-backdrop-blur-sm data-[state=open]:oui-animate-in data-[state=closed]:oui-animate-out data-[state=closed]:oui-fade-out-0 data-[state=open]:oui-fade-in-0",
5252
+ "oui-sheet-overlay oui-fixed oui-inset-0 oui-z-50 oui-bg-black/50 oui-backdrop-blur-sm data-[state=open]:oui-animate-in data-[state=closed]:oui-animate-out data-[state=closed]:oui-fade-out-0 data-[state=open]:oui-fade-in-0",
5253
5253
  className
5254
5254
  ),
5255
5255
  ...props,
5256
5256
  ref
5257
5257
  }
5258
5258
  ));
5259
- SheetOverlay.displayName = DialogPrimitive.Overlay.displayName;
5259
+ SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
5260
5260
  var sheetVariants = tv$1({
5261
5261
  base: "oui-sheet-content oui-fixed oui-z-50 oui-gap-4 oui-bg-base-8 oui-px-4 oui-shadow-lg oui-transition oui-ease-in-out data-[state=closed]:oui-duration-260 data-[state=open]:oui-duration-300 data-[state=open]:oui-animate-in data-[state=closed]:oui-animate-out",
5262
5262
  variants: {
@@ -5284,7 +5284,7 @@ var SheetContent = React79.forwardRef(
5284
5284
  }, ref) => /* @__PURE__ */ jsxs(SheetPortal, { children: [
5285
5285
  /* @__PURE__ */ jsx(SheetOverlay, { className: overlayClassName }),
5286
5286
  /* @__PURE__ */ jsxs(
5287
- DialogPrimitive.Content,
5287
+ SheetPrimitive.Content,
5288
5288
  {
5289
5289
  ref,
5290
5290
  className: cnBase(sheetVariants({ side }), className),
@@ -5293,7 +5293,7 @@ var SheetContent = React79.forwardRef(
5293
5293
  ...props,
5294
5294
  children: [
5295
5295
  closeable && /* @__PURE__ */ jsxs(
5296
- DialogPrimitive.Close,
5296
+ SheetPrimitive.Close,
5297
5297
  {
5298
5298
  className: cnBase(
5299
5299
  "oui-sheet-close-btn oui-ring-offset-base-700 focus:oui-ring-ring oui-absolute oui-right-4 oui-top-4 oui-z-10 oui-rounded-sm oui-transition-opacity focus:oui-outline-none focus:oui-ring-2 focus:oui-ring-offset-2 active:oui-outline-none focus:orderly-outline-none disabled:oui-pointer-events-none data-[state=open]:oui-bg-secondary",
@@ -5319,7 +5319,7 @@ var SheetContent = React79.forwardRef(
5319
5319
  )
5320
5320
  ] })
5321
5321
  );
5322
- SheetContent.displayName = DialogPrimitive.Content.displayName;
5322
+ SheetContent.displayName = SheetPrimitive.Content.displayName;
5323
5323
  var SheetHeader = ({
5324
5324
  className,
5325
5325
  leading,
@@ -5367,29 +5367,24 @@ var SheetFooter = ({
5367
5367
  }
5368
5368
  );
5369
5369
  SheetFooter.displayName = "SheetFooter";
5370
- var SheetTitle = React79.forwardRef(({ className, leading, ...props }, ref) => /* @__PURE__ */ jsxs(
5371
- "div",
5372
- {
5373
- className: "oui-sheet-header oui-grid oui-grid-cols-[40px_1fr_40px] oui-items-center",
5374
- ref,
5375
- children: [
5376
- /* @__PURE__ */ jsx("div", { children: leading }),
5377
- /* @__PURE__ */ jsx(
5378
- "div",
5379
- {
5380
- className: cnBase(
5381
- "oui-flex oui-flex-col oui-space-y-2 oui-text-center oui-text-lg oui-text-base-contrast",
5382
- className
5383
- ),
5384
- ...props
5385
- }
5386
- )
5387
- ]
5388
- }
5389
- ));
5390
- SheetTitle.displayName = DialogPrimitive.Title.displayName;
5370
+ var SheetTitle = React79.forwardRef(({ className, leading, children, ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: "oui-sheet-header oui-grid oui-grid-cols-[40px_1fr_40px] oui-items-center", children: [
5371
+ /* @__PURE__ */ jsx("div", { children: leading }),
5372
+ /* @__PURE__ */ jsx(
5373
+ SheetPrimitive.Title,
5374
+ {
5375
+ ref,
5376
+ className: cnBase(
5377
+ "oui-flex oui-flex-col oui-space-y-2 oui-text-center oui-text-lg oui-text-base-contrast",
5378
+ className
5379
+ ),
5380
+ ...props,
5381
+ children
5382
+ }
5383
+ )
5384
+ ] }));
5385
+ SheetTitle.displayName = SheetPrimitive.Title.displayName;
5391
5386
  var SheetDescription = React79.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
5392
- DialogPrimitive.Description,
5387
+ SheetPrimitive.Description,
5393
5388
  {
5394
5389
  ref,
5395
5390
  className: cnBase(
@@ -5399,7 +5394,7 @@ var SheetDescription = React79.forwardRef(({ className, ...props }, ref) => /* @
5399
5394
  ...props
5400
5395
  }
5401
5396
  ));
5402
- SheetDescription.displayName = DialogPrimitive.Description.displayName;
5397
+ SheetDescription.displayName = SheetPrimitive.Description.displayName;
5403
5398
  function createSheetComponent(Comp) {
5404
5399
  return modal.create((props) => {
5405
5400
  const { title, leading, classNames, contentProps, closable, ...rest } = props;
@@ -5659,10 +5654,10 @@ var SimpleSheet = (props) => {
5659
5654
  closeable: closable,
5660
5655
  ...contentProps,
5661
5656
  children: [
5662
- title && /* @__PURE__ */ jsxs(Fragment, { children: [
5657
+ title ? /* @__PURE__ */ jsxs(Fragment, { children: [
5663
5658
  /* @__PURE__ */ jsx(SheetHeader, { leading: props.leading, children: /* @__PURE__ */ jsx(SheetTitle, { children: title }) }),
5664
5659
  /* @__PURE__ */ jsx(Divider, {})
5665
- ] }),
5660
+ ] }) : /* @__PURE__ */ jsx(SheetPrimitive.Title, { className: "oui-sr-only", children: "sheet title" }),
5666
5661
  /* @__PURE__ */ jsx(SheetBody, { className: classNames?.body, children: props.children })
5667
5662
  ]
5668
5663
  }
@@ -5682,7 +5677,7 @@ var dialogVariants = tv$1({
5682
5677
  "oui-fixed",
5683
5678
  "oui-inset-0",
5684
5679
  "oui-z-50",
5685
- "oui-bg-black/60",
5680
+ "oui-bg-black/50",
5686
5681
  "oui-backdrop-blur-sm",
5687
5682
  "data-[state=open]:oui-animate-in",
5688
5683
  "data-[state=closed]:oui-animate-out",
@@ -5827,14 +5822,14 @@ var dialogVariants = tv$1({
5827
5822
  intensity: 800
5828
5823
  }
5829
5824
  });
5830
- var Dialog = DialogPrimitive.Root;
5831
- var DialogTrigger = DialogPrimitive.Trigger;
5832
- var DialogPortal = DialogPrimitive.Portal;
5833
- var DialogClose = DialogPrimitive.Close;
5825
+ var Dialog = SheetPrimitive.Root;
5826
+ var DialogTrigger = SheetPrimitive.Trigger;
5827
+ var DialogPortal = SheetPrimitive.Portal;
5828
+ var DialogClose = SheetPrimitive.Close;
5834
5829
  var DialogOverlay = React79.forwardRef(({ className, ...props }, ref) => {
5835
5830
  const { overlay } = dialogVariants();
5836
5831
  return /* @__PURE__ */ jsx(
5837
- DialogPrimitive.Overlay,
5832
+ SheetPrimitive.Overlay,
5838
5833
  {
5839
5834
  ref,
5840
5835
  className: overlay({ className }),
@@ -5842,7 +5837,7 @@ var DialogOverlay = React79.forwardRef(({ className, ...props }, ref) => {
5842
5837
  }
5843
5838
  );
5844
5839
  });
5845
- DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
5840
+ DialogOverlay.displayName = SheetPrimitive.Overlay.displayName;
5846
5841
  var DialogContent = React79.forwardRef(
5847
5842
  ({
5848
5843
  overlyClassName,
@@ -5857,7 +5852,7 @@ var DialogContent = React79.forwardRef(
5857
5852
  return /* @__PURE__ */ jsxs(DialogPortal, { children: [
5858
5853
  /* @__PURE__ */ jsx(DialogOverlay, { className: overlyClassName }),
5859
5854
  /* @__PURE__ */ jsxs(
5860
- DialogPrimitive.Content,
5855
+ SheetPrimitive.Content,
5861
5856
  {
5862
5857
  ref,
5863
5858
  className: content({ className }),
@@ -5865,7 +5860,7 @@ var DialogContent = React79.forwardRef(
5865
5860
  children: [
5866
5861
  children,
5867
5862
  closable && /* @__PURE__ */ jsxs(
5868
- DialogPrimitive.Close,
5863
+ SheetPrimitive.Close,
5869
5864
  {
5870
5865
  className: close(),
5871
5866
  "data-testid": "oui-testid-dialog-content-close-btn",
@@ -5881,7 +5876,7 @@ var DialogContent = React79.forwardRef(
5881
5876
  ] });
5882
5877
  }
5883
5878
  );
5884
- DialogContent.displayName = DialogPrimitive.Content.displayName;
5879
+ DialogContent.displayName = SheetPrimitive.Content.displayName;
5885
5880
  var DialogHeader = ({
5886
5881
  className,
5887
5882
  ...props
@@ -5908,7 +5903,7 @@ DialogFooter.displayName = "DialogFooter";
5908
5903
  var DialogTitle = React79.forwardRef(({ className, ...props }, ref) => {
5909
5904
  const { title } = dialogVariants();
5910
5905
  return /* @__PURE__ */ jsx(
5911
- DialogPrimitive.Title,
5906
+ SheetPrimitive.Title,
5912
5907
  {
5913
5908
  ref,
5914
5909
  className: title({ className }),
@@ -5916,11 +5911,11 @@ var DialogTitle = React79.forwardRef(({ className, ...props }, ref) => {
5916
5911
  }
5917
5912
  );
5918
5913
  });
5919
- DialogTitle.displayName = DialogPrimitive.Title.displayName;
5914
+ DialogTitle.displayName = SheetPrimitive.Title.displayName;
5920
5915
  var DialogDescription = React79.forwardRef(({ className, ...props }, ref) => {
5921
5916
  const { desc } = dialogVariants();
5922
5917
  return /* @__PURE__ */ jsx(
5923
- DialogPrimitive.Description,
5918
+ SheetPrimitive.Description,
5924
5919
  {
5925
5920
  ref,
5926
5921
  className: desc({ className }),
@@ -5928,7 +5923,7 @@ var DialogDescription = React79.forwardRef(({ className, ...props }, ref) => {
5928
5923
  }
5929
5924
  );
5930
5925
  });
5931
- DialogDescription.displayName = DialogPrimitive.Description.displayName;
5926
+ DialogDescription.displayName = SheetPrimitive.Description.displayName;
5932
5927
  var SimpleDialogFooter = (props) => {
5933
5928
  const { actions } = props;
5934
5929
  const [primaryLoading, setPrimaryLoading] = useState(
@@ -6018,10 +6013,10 @@ var SimpleDialog = (props) => {
6018
6013
  overlyClassName: props.classNames?.overlay,
6019
6014
  ...props.contentProps,
6020
6015
  children: [
6021
- title && /* @__PURE__ */ jsxs(Fragment, { children: [
6016
+ title ? /* @__PURE__ */ jsxs(Fragment, { children: [
6022
6017
  /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: title }) }),
6023
6018
  /* @__PURE__ */ jsx(Divider, {})
6024
- ] }),
6019
+ ] }) : /* @__PURE__ */ jsx(SheetPrimitive.Title, { className: "oui-sr-only", children: "dialog title" }),
6025
6020
  /* @__PURE__ */ jsx(DialogBody, { className: props.classNames?.body, children: props.children }),
6026
6021
  typeof props.description !== "undefined" && /* @__PURE__ */ jsx(DialogDescription, { children: props.description }),
6027
6022
  /* @__PURE__ */ jsx(