@clicoh/orion-library 1.1.0-beta.4 → 1.1.0-beta.5
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/components/02-molecules/SlideOver/SlideOver.d.ts +4 -1
- package/dist/components/02-molecules/SlideOver/SlideOver.d.ts.map +1 -1
- package/dist/components/02-molecules/SlideOver/SlideOver.jsx +7 -3
- package/dist/components/02-molecules/SlideOver/SlideOver.jsx.map +1 -1
- package/dist/components/02-molecules/SlideOver/index.d.ts +1 -1
- package/dist/components/02-molecules/SlideOver/index.d.ts.map +1 -1
- package/dist/components/02-molecules/SlideOver/index.js.map +1 -1
- package/dist/components/03-organisms/AsideMenu/AsideMenu.d.ts +4 -4
- package/dist/components/03-organisms/AsideMenu/AsideMenu.d.ts.map +1 -1
- package/dist/components/03-organisms/AsideMenu/AsideMenu.jsx +14 -3
- package/dist/components/03-organisms/AsideMenu/AsideMenu.jsx.map +1 -1
- package/dist/components/03-organisms/Header/SecondMenu.d.ts +1 -1
- package/dist/components/03-organisms/Header/SecondMenu.d.ts.map +1 -1
- package/dist/components/03-organisms/Header/SecondMenu.jsx +12 -3
- package/dist/components/03-organisms/Header/SecondMenu.jsx.map +1 -1
- package/package.json +1 -1
|
@@ -8,6 +8,9 @@ type SlideOverProps = {
|
|
|
8
8
|
'aria-labelledby'?: string;
|
|
9
9
|
'aria-describedby'?: string;
|
|
10
10
|
};
|
|
11
|
+
export type SlideOverHandle = {
|
|
12
|
+
handlerClose: () => void;
|
|
13
|
+
};
|
|
11
14
|
/**
|
|
12
15
|
* SlideOver component for rendering a slide-over panel from the left or right side of the screen.
|
|
13
16
|
*
|
|
@@ -28,6 +31,6 @@ type SlideOverProps = {
|
|
|
28
31
|
*
|
|
29
32
|
* @returns {ReactNode} The rendered SlideOver component.
|
|
30
33
|
*/
|
|
31
|
-
export declare
|
|
34
|
+
export declare const SlideOver: import("react").ForwardRefExoticComponent<SlideOverProps & import("react").RefAttributes<SlideOverHandle>>;
|
|
32
35
|
export {};
|
|
33
36
|
//# sourceMappingURL=SlideOver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlideOver.d.ts","sourceRoot":"","sources":["../../../../src/components/02-molecules/SlideOver/SlideOver.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"SlideOver.d.ts","sourceRoot":"","sources":["../../../../src/components/02-molecules/SlideOver/SlideOver.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAIf,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACjC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAChD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,CAAC;AAIF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,SAAS,4GAwHpB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
|
-
import { useCallback, useEffect, useRef, useState, } from 'react';
|
|
3
|
+
import { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, useState, } from 'react';
|
|
4
4
|
import { MdClose } from 'react-icons/md';
|
|
5
5
|
import { useDialogFocus } from '../Modal/useDialogFocus';
|
|
6
6
|
const transitionClasses = 'transition ease-in-out duration-500';
|
|
@@ -24,7 +24,7 @@ const transitionClasses = 'transition ease-in-out duration-500';
|
|
|
24
24
|
*
|
|
25
25
|
* @returns {ReactNode} The rendered SlideOver component.
|
|
26
26
|
*/
|
|
27
|
-
export
|
|
27
|
+
export const SlideOver = forwardRef(function ({ side, closeCallback, children, closeButtonAriaLabel, initialFocusRef, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, }, ref) {
|
|
28
28
|
const [isOpen, setIsOpen] = useState(false);
|
|
29
29
|
const dialogRef = useRef(null);
|
|
30
30
|
const overlayClasses = clsx('bg-gray-1/25 pointer-events-none fixed inset-0 dark:bg-black/75', transitionClasses, isOpen ? 'opacity-100' : 'opacity-0');
|
|
@@ -43,6 +43,9 @@ export function SlideOver({ side, closeCallback, children, closeButtonAriaLabel,
|
|
|
43
43
|
setIsOpen(false);
|
|
44
44
|
closeCallback && setTimeout(closeCallback, 500);
|
|
45
45
|
}, [closeCallback]);
|
|
46
|
+
useImperativeHandle(ref, () => ({
|
|
47
|
+
handlerClose,
|
|
48
|
+
}));
|
|
46
49
|
const handlerOverlayClick = (event) => {
|
|
47
50
|
const target = event.target;
|
|
48
51
|
const currentTarget = event.currentTarget;
|
|
@@ -83,5 +86,6 @@ export function SlideOver({ side, closeCallback, children, closeButtonAriaLabel,
|
|
|
83
86
|
</div>
|
|
84
87
|
</div>
|
|
85
88
|
</>);
|
|
86
|
-
}
|
|
89
|
+
});
|
|
90
|
+
SlideOver.displayName = 'SlideOver';
|
|
87
91
|
//# sourceMappingURL=SlideOver.jsx.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SlideOver.jsx","sourceRoot":"","sources":["../../../../src/components/02-molecules/SlideOver/SlideOver.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,
|
|
1
|
+
{"version":3,"file":"SlideOver.jsx","sourceRoot":"","sources":["../../../../src/components/02-molecules/SlideOver/SlideOver.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;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;YAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAC/B;cAAA,CAAC,GAAG,CACF,GAAG,CAAC,CAAC,SAAS,CAAC,CACf,IAAI,CAAC,QAAQ,CACb,UAAU,CAAC,MAAM,CACjB,eAAe,CAAC,CAAC,cAAc,CAAC,CAChC,gBAAgB,CAAC,CAAC,eAAe,CAAC,CAClC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CACb,SAAS,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC,CAE9C;gBAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC,CACjC;kBAAA,CAAC,MAAM,CACL,IAAI,CAAC,QAAQ,CACb,UAAU,CAAC,CAAC,oBAAoB,CAAC,CACjC,OAAO,CAAC,CAAC,YAAY,CAAC,CACtB,SAAS,CAAC,yMAAyM,CAEnN;oBAAA,CAAC,IAAI,CAAC,SAAS,CAAC,qBAAqB,EACrC;oBAAA,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,SAAS,EAC1C;kBAAA,EAAE,MAAM,CACV;gBAAA,EAAE,GAAG,CAEL;;gBAAA,CAAC,GAAG,CAAC,SAAS,CAAC,sHAAsH,CACnI;kBAAA,CAAC,QAAQ,CACX;gBAAA,EAAE,GAAG,CACP;cAAA,EAAE,GAAG,CACP;YAAA,EAAE,GAAG,CACP;UAAA,EAAE,GAAG,CACP;QAAA,EAAE,GAAG,CACP;MAAA,EAAE,GAAG,CACP;IAAA,GAAG,CACJ,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { SlideOver } from './SlideOver';
|
|
1
|
+
export { SlideOver, type SlideOverHandle } from './SlideOver';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/02-molecules/SlideOver/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/02-molecules/SlideOver/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/02-molecules/SlideOver/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/02-molecules/SlideOver/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAwB,MAAM,aAAa,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { Menu } from '../../02-molecules';
|
|
3
|
-
type AsideMenuProps = Pick<ComponentProps<typeof Menu>, 'menu' | 'onFavoriteToggle'>;
|
|
1
|
+
import { type ComponentProps, type ReactNode } from 'react';
|
|
2
|
+
import { Menu, SlideOver } from '../../02-molecules';
|
|
3
|
+
type AsideMenuProps = Pick<ComponentProps<typeof Menu>, 'menu' | 'onFavoriteToggle'> & Pick<ComponentProps<typeof SlideOver>, 'closeCallback'>;
|
|
4
4
|
/**
|
|
5
5
|
* AsideMenu component for rendering a slide-over menu with a specified menu configuration.
|
|
6
6
|
*
|
|
@@ -15,6 +15,6 @@ type AsideMenuProps = Pick<ComponentProps<typeof Menu>, 'menu' | 'onFavoriteTogg
|
|
|
15
15
|
*
|
|
16
16
|
* @returns {ReactNode} The rendered AsideMenu component.
|
|
17
17
|
*/
|
|
18
|
-
export declare function AsideMenu({ menu, onFavoriteToggle, }: AsideMenuProps): ReactNode;
|
|
18
|
+
export declare function AsideMenu({ menu, onFavoriteToggle, closeCallback, }: AsideMenuProps): ReactNode;
|
|
19
19
|
export {};
|
|
20
20
|
//# sourceMappingURL=AsideMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsideMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/03-organisms/AsideMenu/AsideMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AsideMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/03-organisms/AsideMenu/AsideMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAE,SAAS,EAAwB,MAAM,oBAAoB,CAAC;AAE3E,KAAK,cAAc,GAAG,IAAI,CACxB,cAAc,CAAC,OAAO,IAAI,CAAC,EAC3B,MAAM,GAAG,kBAAkB,CAC5B,GACC,IAAI,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,EAAE,eAAe,CAAC,CAAC;AAE1D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,EACxB,IAAI,EACJ,gBAAgB,EAChB,aAAa,GACd,EAAE,cAAc,GAAG,SAAS,CAsB5B"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useRef, } from 'react';
|
|
1
3
|
import { Menu, SlideOver } from '../../02-molecules';
|
|
2
4
|
/**
|
|
3
5
|
* AsideMenu component for rendering a slide-over menu with a specified menu configuration.
|
|
@@ -13,9 +15,18 @@ import { Menu, SlideOver } from '../../02-molecules';
|
|
|
13
15
|
*
|
|
14
16
|
* @returns {ReactNode} The rendered AsideMenu component.
|
|
15
17
|
*/
|
|
16
|
-
export function AsideMenu({ menu, onFavoriteToggle, }) {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
export function AsideMenu({ menu, onFavoriteToggle, closeCallback, }) {
|
|
19
|
+
const slideOverRef = useRef(null);
|
|
20
|
+
const handleMenuClick = (event) => {
|
|
21
|
+
const target = event.target;
|
|
22
|
+
if (target.closest('a[href]')) {
|
|
23
|
+
slideOverRef.current?.handlerClose();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return (<SlideOver ref={slideOverRef} side="left" closeCallback={closeCallback}>
|
|
27
|
+
<div onClick={handleMenuClick}>
|
|
28
|
+
<Menu menu={menu} orientation="vertical" onFavoriteToggle={onFavoriteToggle}/>
|
|
29
|
+
</div>
|
|
19
30
|
</SlideOver>);
|
|
20
31
|
}
|
|
21
32
|
//# sourceMappingURL=AsideMenu.jsx.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsideMenu.jsx","sourceRoot":"","sources":["../../../../src/components/03-organisms/AsideMenu/AsideMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AsideMenu.jsx","sourceRoot":"","sources":["../../../../src/components/03-organisms/AsideMenu/AsideMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAIL,MAAM,GACP,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,IAAI,EAAE,SAAS,EAAwB,MAAM,oBAAoB,CAAC;AAQ3E;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,IAAI,EACJ,gBAAgB,EAChB,aAAa,GACE;IACf,MAAM,YAAY,GAAG,MAAM,CAAkB,IAAI,CAAC,CAAC;IAEnD,MAAM,eAAe,GAAG,CAAC,KAAiC,EAAE,EAAE;QAC5D,MAAM,MAAM,GAAG,KAAK,CAAC,MAAqB,CAAC;QAE3C,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;YAC9B,YAAY,CAAC,OAAO,EAAE,YAAY,EAAE,CAAC;QACvC,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,aAAa,CAAC,CACrE;MAAA,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,CAC5B;QAAA,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,WAAW,CAAC,UAAU,CACtB,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,EAEvC;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,SAAS,CAAC,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecondMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/03-organisms/Header/SecondMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"SecondMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/03-organisms/Header/SecondMenu.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,IAAI,EAAmC,MAAM,oBAAoB,CAAC;AAE3E,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;IAC1C,gBAAgB,CAAC,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,CAAC,kBAAkB,CAAC,CAAC;CACpE,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,gBAAgB,GACjB,EAAE,eAAe,GAAG,SAAS,CAoC7B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useState } from 'react';
|
|
2
|
+
import { useRef, useState, } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
4
|
import { IoMenu } from 'react-icons/io5';
|
|
5
5
|
import { Menu, SlideOver } from '../../02-molecules';
|
|
@@ -18,13 +18,22 @@ import { Menu, SlideOver } from '../../02-molecules';
|
|
|
18
18
|
*/
|
|
19
19
|
export function SecondMenu({ menu, onFavoriteToggle, }) {
|
|
20
20
|
const [showMenu, setShowMenu] = useState(false);
|
|
21
|
+
const slideOverRef = useRef(null);
|
|
22
|
+
const handleMenuClick = (event) => {
|
|
23
|
+
const target = event.target;
|
|
24
|
+
if (target.closest('a[href]')) {
|
|
25
|
+
slideOverRef.current?.handlerClose();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
21
28
|
return (<>
|
|
22
29
|
<span className="cursor-pointer p-1">
|
|
23
30
|
<IoMenu size={22} onClick={() => setShowMenu(true)}/>
|
|
24
31
|
</span>
|
|
25
32
|
{!!showMenu &&
|
|
26
|
-
createPortal(<SlideOver side="left" closeCallback={() => setShowMenu(false)}>
|
|
27
|
-
<
|
|
33
|
+
createPortal(<SlideOver ref={slideOverRef} side="left" closeCallback={() => setShowMenu(false)}>
|
|
34
|
+
<div onClick={handleMenuClick}>
|
|
35
|
+
<Menu menu={menu} orientation="vertical" onFavoriteToggle={onFavoriteToggle}/>
|
|
36
|
+
</div>
|
|
28
37
|
</SlideOver>, document.body)}
|
|
29
38
|
</>);
|
|
30
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecondMenu.jsx","sourceRoot":"","sources":["../../../../src/components/03-organisms/Header/SecondMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,
|
|
1
|
+
{"version":3,"file":"SecondMenu.jsx","sourceRoot":"","sources":["../../../../src/components/03-organisms/Header/SecondMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAIL,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAwB,MAAM,oBAAoB,CAAC;AAO3E;;;;;;;;;;;;GAYG;AACH,MAAM,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