@erxes/ui 3.2.20-1 → 3.2.20-2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erxes/ui",
3
- "version": "3.2.20-1",
3
+ "version": "3.2.20-2",
4
4
  "description": "erxes design system: UI primitives, business modules, hooks and shared frontend state",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -1,12 +1,15 @@
1
1
  import * as React from 'react';
2
2
 
3
- import { IconChevronsLeft, IconChevronsRight } from '@tabler/icons-react';
3
+ import {
4
+ IconLayoutSidebarLeftCollapse,
5
+ IconLayoutSidebarLeftExpand,
6
+ } from '@tabler/icons-react';
4
7
  import { useAtom, useAtomValue } from 'jotai';
5
8
 
6
9
  import { Button } from 'erxes-ui/components/button';
7
10
  import { Separator } from 'erxes-ui/components/separator';
8
11
  import { cn } from 'erxes-ui/lib/utils';
9
- import { createPortal } from 'react-dom';
12
+ import { Portal } from 'radix-ui';
10
13
  import { sidebarPanelOpenState } from 'erxes-ui/state/sidebarPanelState';
11
14
  import { useComposedRef } from './hooks';
12
15
  import { useTranslation } from 'react-i18next';
@@ -93,7 +96,11 @@ export const SidebarPanelTrigger = React.forwardRef<
93
96
  }}
94
97
  {...props}
95
98
  >
96
- {open ? <IconChevronsLeft /> : <IconChevronsRight />}
99
+ {open ? (
100
+ <IconLayoutSidebarLeftCollapse />
101
+ ) : (
102
+ <IconLayoutSidebarLeftExpand />
103
+ )}
97
104
  </Button>
98
105
  );
99
106
  });
@@ -122,15 +129,14 @@ export const SidebarPanel = React.forwardRef<
122
129
  )}
123
130
  {...props}
124
131
  >
125
- {slot &&
126
- claimed &&
127
- createPortal(
128
- <>
132
+ {slot && claimed && (
133
+ <Portal.Root asChild container={slot}>
134
+ <span className="contents">
129
135
  <SidebarPanelTrigger className="size-7" />
130
136
  <Separator.Inline />
131
- </>,
132
- slot,
133
- )}
137
+ </span>
138
+ </Portal.Root>
139
+ )}
134
140
  {!open && !slot && (
135
141
  <div className="absolute top-2 left-2 z-20">
136
142
  <SidebarPanelTrigger className="size-7 border bg-background shadow-xs" />