@purr-react-styled-components/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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purr-react-styled-components/components.hamburger-menu",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -26,9 +26,9 @@
26
26
  "react-dom": "*",
27
27
  "styled-components": "*",
28
28
  "clsx": "*",
29
- "@purr-core/utils.definitions": "0.0.10",
30
- "@purr-react-styled-components/utils.helpers": "0.0.6",
31
- "@purr-core/hooks.sync-state-with-props": "0.0.7"
29
+ "@purr-react-styled-components/utils.helpers": "0.0.7",
30
+ "@purr-core/hooks.sync-state-with-props": "0.0.8",
31
+ "@purr-core/utils.definitions": "0.0.11"
32
32
  },
33
33
  "author": "@DinhThienPhuc",
34
34
  "license": "ISC",
@@ -37,6 +37,8 @@
37
37
  "scripts": {
38
38
  "dev": "vite build --watch",
39
39
  "build": "tsc && vite build",
40
+ "build:vite": "tsc && vite build",
41
+ "build:tsup": "tsup",
40
42
  "lint": "eslint . --ext ts,tsx --max-warnings 0"
41
43
  }
42
44
  }
@@ -1,4 +0,0 @@
1
- import { default as React } from 'react';
2
- import { IHamburgerMenuProps } from './_types';
3
-
4
- export declare const HamburgerMenu: React.MemoExoticComponent<({ gap, width, height, borderRadius, color, isStandalone, active, className, onClick, htmlAttributes, }: IHamburgerMenuProps) => React.JSX.Element>;
package/dist/_style.d.ts DELETED
@@ -1,11 +0,0 @@
1
- export declare const Styled: {
2
- Container: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
3
- Bar: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
4
- $isActivated: boolean;
5
- $gap: number;
6
- $width: number;
7
- $height: number;
8
- $borderRadius: number;
9
- $color: string;
10
- }>> & string;
11
- };
package/dist/_types.d.ts DELETED
@@ -1,15 +0,0 @@
1
- import { ButtonHTMLAttributes } from 'react';
2
- import { IExtendable } from '@purr-core/utils.definitions';
3
-
4
- export interface IHamburgerMenuProps {
5
- gap?: number;
6
- width?: number;
7
- height?: number;
8
- borderRadius?: number;
9
- onClick?: (active: boolean) => void;
10
- color?: string;
11
- active?: boolean;
12
- className?: string;
13
- isStandalone?: boolean;
14
- htmlAttributes?: ButtonHTMLAttributes<HTMLButtonElement> & IExtendable;
15
- }
package/dist/index.cjs DELETED
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),g=require("clsx"),_=require("react"),$=require("@purr-core/hooks.sync-state-with-props"),s=require("styled-components"),f=require("@purr-react-styled-components/utils.helpers"),u={Container:s.button.withConfig({displayName:"_style__Container",componentId:"sc-10gsfr3-0"})(["",""],f.getInvisibleButton),Bar:s.span.withConfig({displayName:"_style__Bar",componentId:"sc-10gsfr3-1"})(["display:block;width:","px;height:","px;background-color:",";margin:","px 0px;transition:0.4s;border-radius:","px;&:nth-child(1){","}&:nth-child(2){","}&:nth-child(3){","}"],({$width:e})=>e,({$height:e,$gap:r})=>(e-4*r)/3,({$color:e})=>e,({$gap:e})=>e,({$borderRadius:e})=>e,({$isActivated:e,$height:r,$gap:t})=>e&&s.css(["transform:translate(0,","px) rotate(-45deg);"],(r-t)/3),({$isActivated:e})=>e&&s.css(["opacity:0;"]),({$isActivated:e,$height:r,$gap:t})=>e&&s.css(["transform:translate(0,-","px) rotate(45deg);"],(r-t)/3))},l=_.memo(({gap:e=5,width:r=32,height:t=32,borderRadius:c=4,color:m="#000000",isStandalone:h=!0,active:d=!1,className:b,onClick:i,htmlAttributes:p})=>{const{currentValue:a,setCurrentValue:x}=$(d,h),y=()=>{x(!a),i==null||i(!a)},o={$isActivated:a,$gap:e,$width:r,$height:t,$borderRadius:c,$color:m,className:g("hamburger-menu__bar",a&&"hamburger-menu__bar--active")};return n.jsxs(u.Container,{...p,className:g("hamburger-menu",`hamburger-menu--gap-${e}`,`hamburger-menu--width-${r}`,`hamburger-menu--height-${t}`,`hamburger-menu--border-radius-${c}`,`hamburger-menu--color-${m}`,a&&"hamburger-menu--active",b),onClick:y,children:[n.jsx(u.Bar,{...o}),n.jsx(u.Bar,{...o}),n.jsx(u.Bar,{...o})]})});l.displayName="HamburgerMenu";exports.HamburgerMenu=l;
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './_components';
2
- export * from './_types';
package/dist/index.js DELETED
@@ -1,72 +0,0 @@
1
- import { jsxs as $, jsx as s } from "react/jsx-runtime";
2
- import h from "clsx";
3
- import { memo as y } from "react";
4
- import _ from "@purr-core/hooks.sync-state-with-props";
5
- import g, { css as i } from "styled-components";
6
- import { getInvisibleButton as v } from "@purr-react-styled-components/utils.helpers";
7
- const n = {
8
- Container: g.button.withConfig({
9
- displayName: "_style__Container",
10
- componentId: "sc-10gsfr3-0"
11
- })(["", ""], v),
12
- Bar: g.span.withConfig({
13
- displayName: "_style__Bar",
14
- componentId: "sc-10gsfr3-1"
15
- })(["display:block;width:", "px;height:", "px;background-color:", ";margin:", "px 0px;transition:0.4s;border-radius:", "px;&:nth-child(1){", "}&:nth-child(2){", "}&:nth-child(3){", "}"], ({
16
- $width: r
17
- }) => r, ({
18
- $height: r,
19
- $gap: e
20
- }) => (r - 4 * e) / 3, ({
21
- $color: r
22
- }) => r, ({
23
- $gap: r
24
- }) => r, ({
25
- $borderRadius: r
26
- }) => r, ({
27
- $isActivated: r,
28
- $height: e,
29
- $gap: t
30
- }) => r && i(["transform:translate(0,", "px) rotate(-45deg);"], (e - t) / 3), ({
31
- $isActivated: r
32
- }) => r && i(["opacity:0;"]), ({
33
- $isActivated: r,
34
- $height: e,
35
- $gap: t
36
- }) => r && i(["transform:translate(0,-", "px) rotate(45deg);"], (e - t) / 3))
37
- }, B = y(({
38
- gap: r = 5,
39
- width: e = 32,
40
- height: t = 32,
41
- borderRadius: u = 4,
42
- color: c = "#000000",
43
- isStandalone: p = !0,
44
- active: d = !1,
45
- className: l,
46
- onClick: m,
47
- htmlAttributes: b
48
- }) => {
49
- const {
50
- currentValue: a,
51
- setCurrentValue: f
52
- } = _(d, p), x = () => {
53
- f(!a), m == null || m(!a);
54
- }, o = {
55
- $isActivated: a,
56
- $gap: r,
57
- $width: e,
58
- $height: t,
59
- $borderRadius: u,
60
- $color: c,
61
- className: h("hamburger-menu__bar", a && "hamburger-menu__bar--active")
62
- };
63
- return /* @__PURE__ */ $(n.Container, { ...b, className: h("hamburger-menu", `hamburger-menu--gap-${r}`, `hamburger-menu--width-${e}`, `hamburger-menu--height-${t}`, `hamburger-menu--border-radius-${u}`, `hamburger-menu--color-${c}`, a && "hamburger-menu--active", l), onClick: x, children: [
64
- /* @__PURE__ */ s(n.Bar, { ...o }),
65
- /* @__PURE__ */ s(n.Bar, { ...o }),
66
- /* @__PURE__ */ s(n.Bar, { ...o })
67
- ] });
68
- });
69
- B.displayName = "HamburgerMenu";
70
- export {
71
- B as HamburgerMenu
72
- };