@hyphen/hyphen-components 4.2.0 → 4.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyphen/hyphen-components",
3
- "version": "4.2.0",
3
+ "version": "4.3.1",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "@hyphen"
@@ -0,0 +1,9 @@
1
+ .rail {
2
+ border-width: 0;
3
+ transition: border-right 0.3s linear;
4
+ border-right: 2px solid transparent;
5
+ }
6
+
7
+ .rail:hover {
8
+ border-right: 2px solid var(--color-background-inverse);
9
+ }
@@ -13,6 +13,7 @@ import { useIsMobile } from '../../hooks/useIsMobile/useIsMobile';
13
13
  import { Box } from '../Box/Box';
14
14
  import { IconName } from 'src/types';
15
15
  import { Icon } from '../Icon/Icon';
16
+ import styles from './Sidebar.module.scss';
16
17
 
17
18
  const SIDEBAR_COOKIE_NAME = 'sidebar:state';
18
19
  const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
@@ -104,10 +105,7 @@ const SidebarProvider = forwardRef<
104
105
  // Keydown event handler for toggling sidebar
105
106
  useEffect(() => {
106
107
  const handleKeyDown = (event: KeyboardEvent) => {
107
- if (
108
- event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
109
- (event.metaKey || event.ctrlKey)
110
- ) {
108
+ if (event.key === SIDEBAR_KEYBOARD_SHORTCUT) {
111
109
  event.preventDefault();
112
110
  toggleSidebar();
113
111
  }
@@ -238,6 +236,11 @@ const Sidebar = React.forwardRef<
238
236
  top: '0',
239
237
  bottom: '0',
240
238
  zIndex: 'var(--size-z-index-drawer)',
239
+ animationTimingFunction: 'var(--sidebar-transition-timing, linear)',
240
+ transitionTimingFunction:
241
+ 'var(--sidebar-transition-timing, linear)',
242
+ transitionDuration: 'var(--sidebar-transition-duration, 200ms)',
243
+ animationDuration: 'var(--sidebar-transition-duration, 200ms)',
241
244
  transitionProperty: 'left, right, width',
242
245
  width: 'var(--sidebar-width)',
243
246
  height: '100svh',
@@ -548,9 +551,10 @@ const SidebarRail = React.forwardRef<
548
551
  aria-label="Toggle Sidebar"
549
552
  tabIndex={-1}
550
553
  onClick={toggleSidebar}
551
- title="Toggle Sidebar"
554
+ title="Toggle Sidebar ["
552
555
  className={classNames(
553
- 'hover-show-child display-flex p-top-5xl justify-content-center position-absolute background-color-transparent bw-0',
556
+ styles.rail,
557
+ 'hover-show-child background-color-transparent display-flex p-top-5xl p-left-xl p-right-0 justify-content-center position-absolute',
554
558
  {
555
559
  'cursor-w-resize': open,
556
560
  'cursor-e-resize': !open,
@@ -558,11 +562,10 @@ const SidebarRail = React.forwardRef<
558
562
  className
559
563
  )}
560
564
  style={{
561
- top: '0',
562
- bottom: '0',
563
- right: '-1rem',
564
- width: '1rem',
565
- zIndex: '-1',
565
+ top: '20px',
566
+ bottom: '20px',
567
+ right: '-14px',
568
+ width: '10px',
566
569
  }}
567
570
  {...props}
568
571
  >
@@ -572,7 +575,7 @@ const SidebarRail = React.forwardRef<
572
575
  color="secondary"
573
576
  borderWidth="sm"
574
577
  padding="xs"
575
- margin="0 0 0 sm"
578
+ margin="0"
576
579
  shadow="xs"
577
580
  className={classNames(
578
581
  'hover-child',