zengenti-ps-components
Advanced tools
Comparing version 1.0.0 to 1.1.0
/// <reference types="react" /> | ||
export interface ExampleProps { | ||
/** | ||
* Is this the principal call to action on the page? | ||
*/ | ||
export interface ButtonProps { | ||
primary?: boolean; | ||
/** | ||
* What background color to use | ||
*/ | ||
backgroundColor?: string; | ||
/** | ||
* How large should the button be? | ||
*/ | ||
size?: "small" | "medium" | "large"; | ||
/** | ||
* Button contents | ||
*/ | ||
label: string; | ||
/** | ||
* Optional click handler | ||
*/ | ||
onClick?: () => void; | ||
} | ||
/** | ||
* Primary UI component for user interaction | ||
*/ | ||
export declare const Button: ({ primary, size, backgroundColor, label, ...props }: ExampleProps) => JSX.Element; | ||
export declare const Button: ({ primary, size, backgroundColor, label, ...props }: ButtonProps) => JSX.Element; |
@@ -1,15 +0,13 @@ | ||
import{jsx as o}from"react/jsx-runtime"; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
import { __rest } from 'tslib'; | ||
import { jsx } from 'react/jsx-runtime'; | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
// Primary UI component for user interaction | ||
const Button = (_a) => { | ||
var { primary = false, size = "medium", backgroundColor, label } = _a, props = __rest(_a, ["primary", "size", "backgroundColor", "label"]); | ||
const mode = primary | ||
? "storybook-button--primary" | ||
: "storybook-button--secondary"; | ||
return (jsx("button", Object.assign({ type: "button", className: ["storybook-button", `storybook-button--${size}`, mode].join(" "), style: { backgroundColor } }, props, { children: label }), void 0)); | ||
}; | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */const t=t=>{var{primary:r=!1,size:e="medium",backgroundColor:n,label:b}=t,a=function(o,t){var r={};for(var e in o)Object.prototype.hasOwnProperty.call(o,e)&&t.indexOf(e)<0&&(r[e]=o[e]);if(null!=o&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(e=Object.getOwnPropertySymbols(o);n<e.length;n++)t.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(o,e[n])&&(r[e[n]]=o[e[n]])}return r}(t,["primary","size","backgroundColor","label"]);const l=r?"storybook-button--primary":"storybook-button--secondary";return o("button",Object.assign({type:"button",className:["storybook-button",`storybook-button--${e}`,l].join(" "),style:{backgroundColor:n}},a,{children:b}),void 0)};export{t as Button}; | ||
export { Button }; |
/// <reference types="react" /> | ||
import { ComponentStory, ComponentMeta } from "@storybook/react"; | ||
import "./button.css"; | ||
declare const _default: ComponentMeta<({ primary, size, backgroundColor, label, ...props }: import("../../index").ExampleProps) => JSX.Element>; | ||
declare const _default: ComponentMeta<({ primary, size, backgroundColor, label, ...props }: import("../../index").ButtonProps) => JSX.Element>; | ||
export default _default; | ||
export declare const Primary: ComponentStory<({ primary, size, backgroundColor, label, ...props }: import("../../index").ExampleProps) => JSX.Element>; | ||
export declare const Secondary: ComponentStory<({ primary, size, backgroundColor, label, ...props }: import("../../index").ExampleProps) => JSX.Element>; | ||
export declare const Large: ComponentStory<({ primary, size, backgroundColor, label, ...props }: import("../../index").ExampleProps) => JSX.Element>; | ||
export declare const Small: ComponentStory<({ primary, size, backgroundColor, label, ...props }: import("../../index").ExampleProps) => JSX.Element>; | ||
export declare const Primary: ComponentStory<({ primary, size, backgroundColor, label, ...props }: import("../../index").ButtonProps) => JSX.Element>; | ||
export declare const Secondary: ComponentStory<({ primary, size, backgroundColor, label, ...props }: import("../../index").ButtonProps) => JSX.Element>; | ||
export declare const Large: ComponentStory<({ primary, size, backgroundColor, label, ...props }: import("../../index").ButtonProps) => JSX.Element>; | ||
export declare const Small: ComponentStory<({ primary, size, backgroundColor, label, ...props }: import("../../index").ButtonProps) => JSX.Element>; |
{ | ||
"name": "zengenti-ps-components", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "", | ||
"main": "lib/index.js", | ||
"main": "lib/index.cjs.js", | ||
"module": "lib/index.esm.js", | ||
@@ -12,3 +12,4 @@ "files": [ | ||
"scripts": { | ||
"build": "rollup -c", | ||
"build": "npm run clean:lib && rollup -c", | ||
"clean:lib": "rimraf ./lib", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
@@ -47,4 +48,2 @@ "storybook": "start-storybook -p 6006", | ||
"rollup-plugin-peer-deps-external": "^2.2.4", | ||
"rollup-plugin-postcss": "^4.0.1", | ||
"rollup-plugin-terser": "^7.0.2", | ||
"tslib": "^2.3.1", | ||
@@ -56,3 +55,4 @@ "typescript": "^4.4.4" | ||
"react-dom": ">=17.0.2" | ||
} | ||
}, | ||
"dependencies": {} | ||
} |
19
4223
44