@purr-react-tailwindcss/components.hamburger-menu 0.0.6 → 0.0.7
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 +5 -3
- package/dist/_components.d.ts +0 -4
- package/dist/_types.d.ts +0 -12
- package/dist/index.cjs +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -90
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.7",
|
|
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.11",
|
|
28
|
+
"@purr-core/hooks.sync-state-with-props": "0.0.8"
|
|
29
29
|
},
|
|
30
30
|
"author": "@DinhThienPhuc",
|
|
31
31
|
"license": "ISC",
|
|
@@ -34,6 +34,8 @@
|
|
|
34
34
|
"scripts": {
|
|
35
35
|
"dev": "vite build --watch",
|
|
36
36
|
"build": "tsc && vite build",
|
|
37
|
+
"build:vite": "tsc && vite build",
|
|
38
|
+
"build:tsup": "tsup",
|
|
37
39
|
"lint": "eslint . --ext ts,tsx --max-warnings 0"
|
|
38
40
|
}
|
|
39
41
|
}
|
package/dist/_components.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { IHamburgerMenuProps } from './_types';
|
|
3
|
-
|
|
4
|
-
export declare const HamburgerMenu: React.MemoExoticComponent<({ isStandalone, active, onClick, htmlAttributes, firstBarHTMLAttributes, secondBarHTMLAttributes, thirdBarHTMLAttributes, }: IHamburgerMenuProps) => React.JSX.Element>;
|
package/dist/_types.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
-
import { IExtendable } from '@purr-core/utils.definitions';
|
|
3
|
-
|
|
4
|
-
export 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
|
-
}
|
package/dist/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("clsx"),g=require("react"),h=require("@purr-core/hooks.sync-state-with-props"),n=g.memo(({isStandalone:s=!0,active:u=!1,onClick:a,htmlAttributes:o,firstBarHTMLAttributes:m,secondBarHTMLAttributes:l,thirdBarHTMLAttributes:i})=>{const{currentValue:e,setCurrentValue:b}=h(u,s),c=()=>{b(!e),a==null||a(!e)};return r.jsxs("button",{className:t("bg-transparent","outline-none","border-none","hamburger-menu",e&&"hamburger-menu--active"),onClick:c,...o,children:[r.jsx("span",{className:t("block","w-8","h-1","bg-white","my-1","transition-all","rounded",e&&"translate-y-2 -rotate-45 transform","hamburger-menu__bar"),...m}),r.jsx("span",{className:t("block","w-8","h-1","bg-white","my-1","transition-all","rounded",e&&"opacity-0","hamburger-menu__bar"),...l}),r.jsx("span",{className:t("block","w-8","h-1","bg-white","my-1","transition-all","rounded",e&&"-translate-y-2 rotate-45 transform","hamburger-menu__bar"),...i})]})});n.displayName="HamburgerMenu";exports.HamburgerMenu=n;
|
package/dist/index.d.ts
DELETED
package/dist/index.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { jsxs as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import r from "clsx";
|
|
3
|
-
import { memo as h } from "react";
|
|
4
|
-
import g from "@purr-core/hooks.sync-state-with-props";
|
|
5
|
-
const p = h(
|
|
6
|
-
({
|
|
7
|
-
isStandalone: n = !0,
|
|
8
|
-
active: s = !1,
|
|
9
|
-
onClick: a,
|
|
10
|
-
htmlAttributes: m,
|
|
11
|
-
firstBarHTMLAttributes: o,
|
|
12
|
-
secondBarHTMLAttributes: u,
|
|
13
|
-
thirdBarHTMLAttributes: l
|
|
14
|
-
}) => {
|
|
15
|
-
const { currentValue: e, setCurrentValue: b } = g(s, n), i = () => {
|
|
16
|
-
b(!e), a == null || a(!e);
|
|
17
|
-
};
|
|
18
|
-
return /* @__PURE__ */ c(
|
|
19
|
-
"button",
|
|
20
|
-
{
|
|
21
|
-
className: r(
|
|
22
|
-
"bg-transparent",
|
|
23
|
-
"outline-none",
|
|
24
|
-
"border-none",
|
|
25
|
-
"hamburger-menu",
|
|
26
|
-
e && "hamburger-menu--active"
|
|
27
|
-
),
|
|
28
|
-
onClick: i,
|
|
29
|
-
...m,
|
|
30
|
-
children: [
|
|
31
|
-
/* @__PURE__ */ t(
|
|
32
|
-
"span",
|
|
33
|
-
{
|
|
34
|
-
className: r(
|
|
35
|
-
"block",
|
|
36
|
-
"w-8",
|
|
37
|
-
"h-1",
|
|
38
|
-
"bg-white",
|
|
39
|
-
"my-1",
|
|
40
|
-
"transition-all",
|
|
41
|
-
"rounded",
|
|
42
|
-
e && "translate-y-2 -rotate-45 transform",
|
|
43
|
-
"hamburger-menu__bar"
|
|
44
|
-
),
|
|
45
|
-
...o
|
|
46
|
-
}
|
|
47
|
-
),
|
|
48
|
-
/* @__PURE__ */ t(
|
|
49
|
-
"span",
|
|
50
|
-
{
|
|
51
|
-
className: r(
|
|
52
|
-
"block",
|
|
53
|
-
"w-8",
|
|
54
|
-
"h-1",
|
|
55
|
-
"bg-white",
|
|
56
|
-
"my-1",
|
|
57
|
-
"transition-all",
|
|
58
|
-
"rounded",
|
|
59
|
-
e && "opacity-0",
|
|
60
|
-
"hamburger-menu__bar"
|
|
61
|
-
),
|
|
62
|
-
...u
|
|
63
|
-
}
|
|
64
|
-
),
|
|
65
|
-
/* @__PURE__ */ t(
|
|
66
|
-
"span",
|
|
67
|
-
{
|
|
68
|
-
className: r(
|
|
69
|
-
"block",
|
|
70
|
-
"w-8",
|
|
71
|
-
"h-1",
|
|
72
|
-
"bg-white",
|
|
73
|
-
"my-1",
|
|
74
|
-
"transition-all",
|
|
75
|
-
"rounded",
|
|
76
|
-
e && "-translate-y-2 rotate-45 transform",
|
|
77
|
-
"hamburger-menu__bar"
|
|
78
|
-
),
|
|
79
|
-
...l
|
|
80
|
-
}
|
|
81
|
-
)
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
);
|
|
87
|
-
p.displayName = "HamburgerMenu";
|
|
88
|
-
export {
|
|
89
|
-
p as HamburgerMenu
|
|
90
|
-
};
|