@hyphen/hyphen-components 7.3.1 → 7.3.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": "@hyphen/hyphen-components",
3
- "version": "7.3.1",
3
+ "version": "7.3.2",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "@hyphen"
@@ -22,6 +22,7 @@ import {
22
22
  } from '../Tooltip/Tooltip';
23
23
 
24
24
  const SIDEBAR_WIDTH = '16rem';
25
+ const SIDEBAR_RIGHT_WIDTH = '24rem';
25
26
  const SIDEBAR_WIDTH_ICON = '44px';
26
27
  const SIDEBAR_KEYBOARD_SHORTCUT_LEFT = '[';
27
28
  const SIDEBAR_KEYBOARD_SHORTCUT_RIGHT = ']';
@@ -343,7 +344,7 @@ const SidebarProvider = forwardRef<
343
344
  } as React.CSSProperties
344
345
  }
345
346
  className={classNames(
346
- 'display-flex w-100 background-color-secondary',
347
+ 'display-flex w-100 background-color-secondary overflow-hidden',
347
348
  className
348
349
  )}
349
350
  ref={ref}
@@ -372,6 +373,7 @@ const Sidebar = React.forwardRef<
372
373
  ref
373
374
  ) => {
374
375
  const { isMobile, state, openMobile, setOpenMobile } = useSidebar(side);
376
+ const sidebarWidth = side === 'right' ? SIDEBAR_RIGHT_WIDTH : SIDEBAR_WIDTH;
375
377
 
376
378
  if (isMobile) {
377
379
  return (
@@ -397,9 +399,12 @@ const Sidebar = React.forwardRef<
397
399
  'group display-flex h-100 font-size-xs flex-direction-column background-color-secondary font-color-base',
398
400
  className
399
401
  )}
400
- style={{
401
- width: 'var(--sidebar-width)',
402
- }}
402
+ style={
403
+ {
404
+ '--sidebar-width': sidebarWidth,
405
+ width: 'var(--sidebar-width)',
406
+ } as React.CSSProperties
407
+ }
403
408
  ref={ref}
404
409
  {...props}
405
410
  >
@@ -419,9 +424,9 @@ const Sidebar = React.forwardRef<
419
424
  fontSize="sm"
420
425
  position="relative"
421
426
  style={
422
- side === 'right' && collapsible === 'offcanvas'
423
- ? { overflowX: 'hidden' }
424
- : undefined
427
+ {
428
+ '--sidebar-width': sidebarWidth,
429
+ } as React.CSSProperties
425
430
  }
426
431
  data-state={state}
427
432
  data-collapsible={collapsible}
@@ -846,9 +851,10 @@ const SidebarRail = React.forwardRef<
846
851
  top: '20px',
847
852
  bottom: '20px',
848
853
  right: side === 'left' ? '-14px' : undefined,
849
- left: side === 'right' ? '-14px' : undefined,
854
+ left: side === 'right' ? '-18px' : undefined,
850
855
  width: '10px',
851
856
  }}
857
+ type="button"
852
858
  {...props}
853
859
  >
854
860
  <Box