@purr-react-styled-components/components.button 0.0.4 → 0.0.6
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.d.ts +1 -1
- package/dist/_style.d.ts +1 -6
- package/dist/index.cjs +1 -1
- package/dist/index.js +18 -20
- package/package.json +3 -3
package/dist/_components.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { IButtonProps } from './_types';
|
|
3
3
|
|
|
4
|
-
export declare const Button: ({
|
|
4
|
+
export declare const Button: ({ loading, loadingComponent, className, htmlAttributes, children, onClick, }: IButtonProps) => React.JSX.Element;
|
package/dist/_style.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import { TButtonSize, TButtonVariant } from './_types';
|
|
2
|
-
|
|
3
1
|
export declare const Styled: {
|
|
4
|
-
Container: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components
|
|
5
|
-
$size: TButtonSize;
|
|
6
|
-
$variant: TButtonVariant;
|
|
7
|
-
}>> & string;
|
|
2
|
+
Container: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
8
3
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),u=require("clsx"),a=require("react"),l=require("@purr-react-styled-components/components.loading-ripple"),d=require("styled-components"),p={Container:d.button.withConfig({displayName:"_style__Container",componentId:"sc-1ssweka-0"})(["display:flex;align-items:center;justify-content:center;transition:all 0.2s ease;background-color:transparent;box-shadow:none;outline:none;overflow:hidden;border-radius:6px;min-width:64px;min-height:32px;padding:0px 15px;cursor:pointer;border:1px solid #d9d9d9;background-color:#ffffff;&:hover,&:focus{outline:0;text-decoration:none;background-color:#0000000a;}"])},f=({loading:e=!1,loadingComponent:t,className:r,htmlAttributes:s,children:n,onClick:i})=>{const c=a.useMemo(()=>e?t??o.jsx(l.LoadingRipple,{size:16,fullScreen:!1}):n,[n,e,t]);return o.jsx(p.Container,{...s,onClick:i,className:u("button",e&&"button--loading",r),children:c})};exports.Button=f;
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { LoadingRipple as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
Container:
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import d from "clsx";
|
|
3
|
+
import { useMemo as l } from "react";
|
|
4
|
+
import { LoadingRipple as c } from "@purr-react-styled-components/components.loading-ripple";
|
|
5
|
+
import f from "styled-components";
|
|
6
|
+
const p = {
|
|
7
|
+
Container: f.button.withConfig({
|
|
8
8
|
displayName: "_style__Container",
|
|
9
9
|
componentId: "sc-1ssweka-0"
|
|
10
|
-
})(["display:flex;align-items:center;justify-content:center;transition:all 0.2s ease;background-color:transparent;box-shadow:none;outline:none;overflow:hidden;border-radius:
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
children: i,
|
|
19
|
-
onClick: l
|
|
10
|
+
})(["display:flex;align-items:center;justify-content:center;transition:all 0.2s ease;background-color:transparent;box-shadow:none;outline:none;overflow:hidden;border-radius:6px;min-width:64px;min-height:32px;padding:0px 15px;cursor:pointer;border:1px solid #d9d9d9;background-color:#ffffff;&:hover,&:focus{outline:0;text-decoration:none;background-color:#0000000a;}"])
|
|
11
|
+
}, g = ({
|
|
12
|
+
loading: o = !1,
|
|
13
|
+
loadingComponent: t,
|
|
14
|
+
className: r,
|
|
15
|
+
htmlAttributes: i,
|
|
16
|
+
children: e,
|
|
17
|
+
onClick: s
|
|
20
18
|
}) => {
|
|
21
|
-
const
|
|
22
|
-
return /* @__PURE__ */
|
|
19
|
+
const a = l(() => o ? t ?? /* @__PURE__ */ n(c, { size: 16, fullScreen: !1 }) : e, [e, o, t]);
|
|
20
|
+
return /* @__PURE__ */ n(p.Container, { ...i, onClick: s, className: d("button", o && "button--loading", r), children: a });
|
|
23
21
|
};
|
|
24
22
|
export {
|
|
25
|
-
|
|
23
|
+
g as Button
|
|
26
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purr-react-styled-components/components.button",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"react": "*",
|
|
26
26
|
"clsx": "*",
|
|
27
27
|
"styled-components": "*",
|
|
28
|
-
"@purr-core/utils.definitions": "0.0.
|
|
29
|
-
"@purr-react-styled-components/components.loading-ripple": "0.0.
|
|
28
|
+
"@purr-core/utils.definitions": "0.0.9",
|
|
29
|
+
"@purr-react-styled-components/components.loading-ripple": "0.0.6"
|
|
30
30
|
},
|
|
31
31
|
"author": "@DinhThienPhuc",
|
|
32
32
|
"license": "ISC",
|