pillardash-ui-react 0.1.13 → 0.1.14
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.d.ts +13 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,16 +2,28 @@ import React$1, { FC, ReactNode, InputHTMLAttributes, TextareaHTMLAttributes } f
|
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
interface ButtonProps {
|
|
5
|
+
/** The content of the button */
|
|
5
6
|
children: ReactNode;
|
|
6
|
-
|
|
7
|
+
/** Click handler function */
|
|
8
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
9
|
+
/** HTML button type attribute */
|
|
7
10
|
type?: "button" | "submit" | "reset";
|
|
11
|
+
/** Size of the button */
|
|
8
12
|
size?: "small" | "medium" | "large";
|
|
13
|
+
/** Visual style variant */
|
|
9
14
|
variant?: "primary" | "secondary" | "dark" | "neutral";
|
|
15
|
+
/** Disabled state of the button */
|
|
10
16
|
disabled?: boolean;
|
|
17
|
+
/** Additional CSS classes */
|
|
11
18
|
className?: string;
|
|
19
|
+
/** Optional icon to display before text */
|
|
12
20
|
icon?: ReactNode;
|
|
21
|
+
/** Loading state - shows spinner */
|
|
13
22
|
loading?: boolean;
|
|
23
|
+
/** Outline style instead of solid */
|
|
14
24
|
outline?: boolean;
|
|
25
|
+
/** Position of the icon relative to text */
|
|
26
|
+
iconPosition?: "left" | "right";
|
|
15
27
|
}
|
|
16
28
|
declare const Button: FC<ButtonProps>;
|
|
17
29
|
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Copyright (c) 2018 Jed Watson.
|
|
4
4
|
Licensed under the MIT License (MIT), see
|
|
5
5
|
http://jedwatson.github.io/classnames
|
|
6
|
-
*/o=i,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=r(e,n(o)))}return e}function n(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var o="";for(var i in n)e.call(n,i)&&n[i]&&(o=r(o,i));return o}function r(e,t){return t?e?e+" "+t:e+t:e}o.exports?(t.default=t,o.exports=t):window.classNames=t}();var s=r(i.exports),l=function(t){var n=t.children,r=t.onClick,o=t.type,i=void 0===o?"button":o,l=t.size,a=void 0===l?"medium":l,c=t.variant,d=void 0===c?"primary":c,h=t.disabled,u=void 0!==h&&h,p=t.className,f=t.icon,m=t.loading,g=void 0!==m&&m,y=t.outline,v=void 0!==y&&y,b=s("animate-spin -ml-1 mr-3",{"h-4 w-4":"small"===a,"h-5 w-5":"medium"===a,"h-6 w-6":"large"===a},"primary"===d?"text-white":"text-primary"),
|
|
6
|
+
*/o=i,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=r(e,n(o)))}return e}function n(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var o="";for(var i in n)e.call(n,i)&&n[i]&&(o=r(o,i));return o}function r(e,t){return t?e?e+" "+t:e+t:e}o.exports?(t.default=t,o.exports=t):window.classNames=t}();var s=r(i.exports),l=function(t){var n=t.children,r=t.onClick,o=t.type,i=void 0===o?"button":o,l=t.size,a=void 0===l?"medium":l,c=t.variant,d=void 0===c?"primary":c,h=t.disabled,u=void 0!==h&&h,p=t.className,f=t.icon,m=t.loading,g=void 0!==m&&m,y=t.outline,v=void 0!==y&&y,b=t.iconPosition,x=void 0===b?"left":b,w=s("animate-spin -ml-1 mr-3",{"h-4 w-4":"small"===a,"h-5 w-5":"medium"===a,"h-6 w-6":"large"===a},"primary"===d?"text-white":"text-primary"),k=s("rounded-xl text-sm transition-all font-semibold duration-300 inline-flex items-center justify-center ease-in-out",{small:"px-5 py-2 text-sm",medium:"px-6 py-3 text-md",large:"px-8 py-4 text-lg"}[a],{primary:{solid:"bg-primary text-white hover:bg-white hover:text-primary border border-primary",outline:"bg-transparent text-primary hover:bg-primary hover:text-white border border-primary"},secondary:{solid:"bg-secondary text-white hover:bg-white hover:text-secondary border border-secondary",outline:"bg-transparent text-secondary hover:bg-secondary hover:text-white border border-secondary"},dark:{solid:"bg-dark text-white hover:bg-primary hover:border-primary border border-dark",outline:"bg-transparent text-dark hover:bg-dark hover:text-white border border-dark"},neutral:{solid:"bg-white text-gray-700 hover:bg-gray-700 hover:text-white border border-gray-300",outline:"bg-transparent text-gray-700 hover:bg-gray-200 border border-gray-300"}}[d][v?"outline":"solid"],u?"opacity-50 cursor-not-allowed":"hover:shadow-lg",p,{"flex-row-reverse":"right"===x}),S="left"===x?"mr-2":"ml-2";return e.jsx("button",{type:i,onClick:r,disabled:u,className:k,children:g?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:w,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),n]}):e.jsxs(e.Fragment,{children:[f&&e.jsx("span",{className:S,children:f}),n]})})};
|
|
7
7
|
/**
|
|
8
8
|
* @license lucide-react v0.511.0 - ISC
|
|
9
9
|
*
|