@orderly.network/ui 3.0.0-beta.3 → 3.0.0-beta.5

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