@purr-react-tailwindcss/components.hamburger-menu 0.0.7 → 0.0.8
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/index.cjs +1 -0
- package/dist/index.d.cts +16 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +1 -0
- package/package.json +3 -3
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var e=require('clsx'),a=require('react'),c=require('@purr-core/hooks.sync-state-with-props');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var e__default=/*#__PURE__*/_interopDefault(e);var a__default=/*#__PURE__*/_interopDefault(a);var c__default=/*#__PURE__*/_interopDefault(c);var g=a.memo(({isStandalone:t=true,active:n=false,onClick:o,htmlAttributes:m,firstBarHTMLAttributes:s,secondBarHTMLAttributes:u,thirdBarHTMLAttributes:l})=>{let{currentValue:r,setCurrentValue:b}=c__default.default(n,t),i=()=>{b(!r),o?.(!r);};return a__default.default.createElement("button",{className:e__default.default("bg-transparent","outline-none","border-none","hamburger-menu",r&&"hamburger-menu--active"),onClick:i,...m},a__default.default.createElement("span",{className:e__default.default("block","w-8","h-1","bg-white","my-1","transition-all","rounded",r&&"translate-y-2 -rotate-45 transform","hamburger-menu__bar"),...s}),a__default.default.createElement("span",{className:e__default.default("block","w-8","h-1","bg-white","my-1","transition-all","rounded",r&&"opacity-0","hamburger-menu__bar"),...u}),a__default.default.createElement("span",{className:e__default.default("block","w-8","h-1","bg-white","my-1","transition-all","rounded",r&&"-translate-y-2 rotate-45 transform","hamburger-menu__bar"),...l}))});g.displayName="HamburgerMenu";exports.HamburgerMenu=g;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { IExtendable } from '@purr-core/utils.definitions';
|
|
3
|
+
|
|
4
|
+
interface IHamburgerMenuProps {
|
|
5
|
+
onClick?: (active: boolean) => void;
|
|
6
|
+
active?: boolean;
|
|
7
|
+
isStandalone?: boolean;
|
|
8
|
+
htmlAttributes?: ButtonHTMLAttributes<HTMLButtonElement> & IExtendable;
|
|
9
|
+
firstBarHTMLAttributes?: ButtonHTMLAttributes<HTMLSpanElement> & IExtendable;
|
|
10
|
+
secondBarHTMLAttributes?: ButtonHTMLAttributes<HTMLSpanElement> & IExtendable;
|
|
11
|
+
thirdBarHTMLAttributes?: ButtonHTMLAttributes<HTMLSpanElement> & IExtendable;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare const HamburgerMenu: React.MemoExoticComponent<({ isStandalone, active, onClick, htmlAttributes, firstBarHTMLAttributes, secondBarHTMLAttributes, thirdBarHTMLAttributes, }: IHamburgerMenuProps) => React.JSX.Element>;
|
|
15
|
+
|
|
16
|
+
export { HamburgerMenu, type IHamburgerMenuProps };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { IExtendable } from '@purr-core/utils.definitions';
|
|
3
|
+
|
|
4
|
+
interface IHamburgerMenuProps {
|
|
5
|
+
onClick?: (active: boolean) => void;
|
|
6
|
+
active?: boolean;
|
|
7
|
+
isStandalone?: boolean;
|
|
8
|
+
htmlAttributes?: ButtonHTMLAttributes<HTMLButtonElement> & IExtendable;
|
|
9
|
+
firstBarHTMLAttributes?: ButtonHTMLAttributes<HTMLSpanElement> & IExtendable;
|
|
10
|
+
secondBarHTMLAttributes?: ButtonHTMLAttributes<HTMLSpanElement> & IExtendable;
|
|
11
|
+
thirdBarHTMLAttributes?: ButtonHTMLAttributes<HTMLSpanElement> & IExtendable;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare const HamburgerMenu: React.MemoExoticComponent<({ isStandalone, active, onClick, htmlAttributes, firstBarHTMLAttributes, secondBarHTMLAttributes, thirdBarHTMLAttributes, }: IHamburgerMenuProps) => React.JSX.Element>;
|
|
15
|
+
|
|
16
|
+
export { HamburgerMenu, type IHamburgerMenuProps };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from'clsx';import a,{memo}from'react';import c from'@purr-core/hooks.sync-state-with-props';var g=memo(({isStandalone:t=true,active:n=false,onClick:o,htmlAttributes:m,firstBarHTMLAttributes:s,secondBarHTMLAttributes:u,thirdBarHTMLAttributes:l})=>{let{currentValue:r,setCurrentValue:b}=c(n,t),i=()=>{b(!r),o?.(!r);};return a.createElement("button",{className:e("bg-transparent","outline-none","border-none","hamburger-menu",r&&"hamburger-menu--active"),onClick:i,...m},a.createElement("span",{className:e("block","w-8","h-1","bg-white","my-1","transition-all","rounded",r&&"translate-y-2 -rotate-45 transform","hamburger-menu__bar"),...s}),a.createElement("span",{className:e("block","w-8","h-1","bg-white","my-1","transition-all","rounded",r&&"opacity-0","hamburger-menu__bar"),...u}),a.createElement("span",{className:e("block","w-8","h-1","bg-white","my-1","transition-all","rounded",r&&"-translate-y-2 rotate-45 transform","hamburger-menu__bar"),...l}))});g.displayName="HamburgerMenu";export{g as HamburgerMenu};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purr-react-tailwindcss/components.hamburger-menu",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"typescript": "*",
|
|
25
25
|
"react": "*",
|
|
26
26
|
"clsx": "*",
|
|
27
|
-
"@purr-core/utils.definitions": "0.0.
|
|
28
|
-
"@purr-core/hooks.sync-state-with-props": "0.0.
|
|
27
|
+
"@purr-core/utils.definitions": "0.0.12",
|
|
28
|
+
"@purr-core/hooks.sync-state-with-props": "0.0.9"
|
|
29
29
|
},
|
|
30
30
|
"author": "@DinhThienPhuc",
|
|
31
31
|
"license": "ISC",
|