@hyphen/hyphen-components 4.2.0 → 4.3.0

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.0",
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
  }
@@ -548,9 +546,10 @@ const SidebarRail = React.forwardRef<
548
546
  aria-label="Toggle Sidebar"
549
547
  tabIndex={-1}
550
548
  onClick={toggleSidebar}
551
- title="Toggle Sidebar"
549
+ title="Toggle Sidebar ["
552
550
  className={classNames(
553
- 'hover-show-child display-flex p-top-5xl justify-content-center position-absolute background-color-transparent bw-0',
551
+ styles.rail,
552
+ 'hover-show-child background-color-transparent display-flex p-top-5xl p-left-xl p-right-0 justify-content-center position-absolute',
554
553
  {
555
554
  'cursor-w-resize': open,
556
555
  'cursor-e-resize': !open,
@@ -558,11 +557,10 @@ const SidebarRail = React.forwardRef<
558
557
  className
559
558
  )}
560
559
  style={{
561
- top: '0',
562
- bottom: '0',
563
- right: '-1rem',
564
- width: '1rem',
565
- zIndex: '-1',
560
+ top: '20px',
561
+ bottom: '20px',
562
+ right: '-14px',
563
+ width: '10px',
566
564
  }}
567
565
  {...props}
568
566
  >
@@ -572,7 +570,7 @@ const SidebarRail = React.forwardRef<
572
570
  color="secondary"
573
571
  borderWidth="sm"
574
572
  padding="xs"
575
- margin="0 0 0 sm"
573
+ margin="0"
576
574
  shadow="xs"
577
575
  className={classNames(
578
576
  'hover-child',