@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/dist/css/index.css +1 -0
- package/dist/hyphen-components.cjs.development.js +123 -118
- package/dist/hyphen-components.cjs.development.js.map +1 -1
- package/dist/hyphen-components.cjs.production.min.js +1 -1
- package/dist/hyphen-components.cjs.production.min.js.map +1 -1
- package/dist/hyphen-components.esm.js +123 -118
- package/dist/hyphen-components.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Sidebar/Sidebar.module.scss +9 -0
- package/src/components/Sidebar/Sidebar.tsx +15 -12
package/package.json
CHANGED
|
@@ -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
|
-
|
|
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: '
|
|
562
|
-
bottom: '
|
|
563
|
-
right: '-
|
|
564
|
-
width: '
|
|
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
|
|
578
|
+
margin="0"
|
|
576
579
|
shadow="xs"
|
|
577
580
|
className={classNames(
|
|
578
581
|
'hover-child',
|