@maelstrom-futurism/button 0.7.4-alpha.9

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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright 2025 OSMstudios
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,5 @@
1
+ import { ReactNode } from "react";
2
+ import { ButtonProps } from "./types";
3
+ declare const Button: (props: ButtonProps) => ReactNode;
4
+ export default Button;
5
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAU,MAAM,OAAO,CAAC;AAMjD,OAAO,EAAE,WAAW,EAAiB,MAAM,SAAS,CAAC;AAmDrD,QAAA,MAAM,MAAM,GAAI,OAAO,WAAW,KAAG,SAoEpC,CAAC;AAEF,eAAe,MAAM,CAAC"}
package/dist/Button.js ADDED
@@ -0,0 +1,84 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { useRef } from "react";
3
+ import { buttonStyle } from "./Button.styles";
4
+ import { useTheme, debounce } from "@maelstrom-futurism/core";
5
+ import { css as emotionCss } from "@emotion/react";
6
+ import LinkButton from "./LinkButton";
7
+ const scales = {
8
+ small: {
9
+ padding: `5px 10px`,
10
+ fontSize: 14,
11
+ },
12
+ normal: {
13
+ padding: `10px 20px`,
14
+ fontSize: 16,
15
+ },
16
+ big: {
17
+ padding: `20px 30px`,
18
+ fontSize: 18,
19
+ },
20
+ };
21
+ const getVariantColor = (theme, variant) => {
22
+ switch (variant) {
23
+ case "secondary":
24
+ return [theme.color("secondary"), theme.color("textColor")];
25
+ case "cancel":
26
+ return [theme.color("alert"), theme.color("textColor")];
27
+ case "ghost":
28
+ return ["transparent", theme.color("textColor")];
29
+ case "primary":
30
+ default:
31
+ return [theme.color("primary"), theme.color("textColor")];
32
+ }
33
+ };
34
+ const getVariantStyle = (theme, variant, outline) => {
35
+ const colors = getVariantColor(theme, variant);
36
+ const boxShadowColor = outline ? colors[0] : "transparent";
37
+ const backgroundColor = outline ? "transparent" : colors[0];
38
+ return {
39
+ background: backgroundColor,
40
+ boxShadow: `inset 0 0 0 1px ${boxShadowColor}`,
41
+ color: `${outline ? colors[0] : colors[1]}`,
42
+ transition: "all .3s",
43
+ "&:hover": {
44
+ boxShadow: `inset 0 0 0 1000px ${boxShadowColor}`,
45
+ color: colors[1],
46
+ },
47
+ };
48
+ };
49
+ const Button = (props) => {
50
+ const theme = useTheme();
51
+ if (props.variant === "link") {
52
+ return _jsx(LinkButton, { theme: theme, ...props });
53
+ }
54
+ const { children, onClick, scale = "normal", variant = "secondary", outline, type = "button", disabled = false, css, ...rest } = props;
55
+ const buttonRef = useRef(null);
56
+ const buttonStyleByTheme = emotionCss `
57
+ border-radius: ${theme.buttonRadius};
58
+ `;
59
+ const addRipple = (e) => {
60
+ if (!buttonRef || !buttonRef.current)
61
+ return;
62
+ const rippleContainer = buttonRef.current.querySelector("div.rippleContainer");
63
+ if (!rippleContainer)
64
+ return;
65
+ const size = buttonRef.current.offsetWidth;
66
+ const pos = buttonRef.current.getBoundingClientRect();
67
+ const rippler = document.createElement("span");
68
+ const x = e.pageX - pos.left - size / 2;
69
+ const y = e.pageY - pos.top - size / 2;
70
+ rippleContainer.appendChild(rippler);
71
+ rippler.setAttribute("style", `top: ${y}px; left: ${x}px; height: ${size}px; width: ${size}px;`);
72
+ };
73
+ const cleanUp = () => {
74
+ if (!buttonRef || !buttonRef.current)
75
+ return;
76
+ const rippleContainer = buttonRef.current.querySelector("div.rippleContainer");
77
+ if (!rippleContainer)
78
+ return;
79
+ rippleContainer.innerHTML = "";
80
+ };
81
+ return (_jsxs("button", { css: [buttonStyle, buttonStyleByTheme, getVariantStyle(theme, variant, !!outline), scales[scale], css], onClick: onClick, ref: buttonRef, onMouseDown: addRipple, onMouseUp: debounce(cleanUp, 2000), type: type, disabled: disabled, ...rest, children: [children, _jsx("div", { className: "rippleContainer" })] }));
82
+ };
83
+ export default Button;
84
+ //# sourceMappingURL=Button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAa,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAS,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,GAAG,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,UAAU,MAAM,cAAc,CAAC;AAGtC,MAAM,MAAM,GAAG;IACb,KAAK,EAAE;QACL,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,EAAE;KACb;IACD,MAAM,EAAE;QACN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AC,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC;QACxC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC;QACvC,eAAe,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACrC,OAAO,CAAC,YAAY,CAClB,OAAO,EACP,QAAQ,CAAC,aAAa,CAAC,eAAe,IAAI,cAAc,IAAI,KAAK,CAClE,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,GAAG,EAAE;QACnB,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,OAAO;YAAE,OAAO;QAC7C,MAAM,eAAe,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;QAC/E,IAAI,CAAC,eAAe;YAAE,OAAO;QAE7B,eAAe,CAAC,SAAS,GAAG,EAAE,CAAC;IACjC,CAAC,CAAC;IAGF,OAAO,CACL,kBACE,GAAG,EAAE,CAAC,WAAW,EAAE,kBAAkB,EAAE,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,EACtG,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,SAAS,EACd,WAAW,EAAE,SAAS,EACtB,SAAS,EAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,EAClC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,KACd,IAAI,aAEP,QAAQ,EACT,cAAK,SAAS,EAAC,iBAAiB,GAAG,IAC5B,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { SerializedStyles } from "@emotion/react";
2
+ export declare const ripple: SerializedStyles;
3
+ export declare const buttonStyle: SerializedStyles;
4
+ export declare const buttonGroupStyle: SerializedStyles;
5
+ //# sourceMappingURL=Button.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.styles.d.ts","sourceRoot":"","sources":["../src/Button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElE,eAAO,MAAM,MAAM,EAAE,gBAKpB,CAAC;AAEF,eAAO,MAAM,WAAW,kBAwBvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,kBAkB5B,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { css, keyframes } from "@emotion/react";
2
+ export const ripple = keyframes `
3
+ to {
4
+ opacity : 0;
5
+ transform: scale(2);
6
+ }
7
+ `;
8
+ export const buttonStyle = css `
9
+ cursor: pointer;
10
+ margin: 6px 5px 0px 0px;
11
+ border: none;
12
+
13
+ position: relative;
14
+ overflow: hidden;
15
+
16
+ div.rippleContainer {
17
+ position: absolute;
18
+ top: 0;
19
+ right: 0;
20
+ bottom: 0;
21
+ left: 0;
22
+
23
+ span {
24
+ transform: scale(0);
25
+ border-radius: 100%;
26
+ position: absolute;
27
+ opacity: 0.75;
28
+ background-color: #fff;
29
+ animation: ${ripple} 1000ms;
30
+ }
31
+ }
32
+ `;
33
+ export const buttonGroupStyle = css `
34
+ & button:first-of-type {
35
+ border-top-right-radius: 0px;
36
+ border-bottom-right-radius: 0px;
37
+ margin-right: 0;
38
+ }
39
+
40
+ & button:not(:first-of-type):not(:last-child) {
41
+ border-radius: 0px;
42
+ margin-left: 0;
43
+ margin-right: 0;
44
+ }
45
+
46
+ & button:last-of-type {
47
+ border-top-left-radius: 0px;
48
+ border-bottom-left-radius: 0px;
49
+ margin-left: 0;
50
+ }
51
+ `;
52
+ //# sourceMappingURL=Button.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Button.styles.js","sourceRoot":"","sources":["../src/Button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAoB,MAAM,gBAAgB,CAAC;AAElE,MAAM,CAAC,MAAM,MAAM,GAAqB,SAAS,CAAA;;;;;CAKhD,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;mBAqBX,MAAM;;;CAGxB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;CAkBlC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from "react";
2
+ interface ButtonGroupProps {
3
+ children?: ReactNode;
4
+ }
5
+ declare const ButtonGroup: ({ children }: ButtonGroupProps) => ReactNode;
6
+ export default ButtonGroup;
7
+ //# sourceMappingURL=ButtonGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonGroup.d.ts","sourceRoot":"","sources":["../src/ButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIlC,UAAU,gBAAgB;IACtB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACvB;AAED,QAAA,MAAM,WAAW,GAAI,cAAc,gBAAgB,KAAG,SAIrD,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ // import Button from "./Button";
3
+ import { buttonGroupStyle } from "./Button.styles";
4
+ const ButtonGroup = ({ children }) => (_jsx("div", { css: buttonGroupStyle, children: children }));
5
+ export default ButtonGroup;
6
+ //# sourceMappingURL=ButtonGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonGroup.js","sourceRoot":"","sources":["../src/ButtonGroup.tsx"],"names":[],"mappings":";AACA,iCAAiC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAMnD,MAAM,WAAW,GAAG,CAAC,EAAE,QAAQ,EAAoB,EAAa,EAAE,CAAC,CAC/D,cAAK,GAAG,EAAE,gBAAgB,YACrB,QAAQ,GACP,CACT,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { ButtonProps } from "./types";
2
+ interface DropdownButtonProps extends Omit<ButtonProps, "onClick"> {
3
+ items?: Array<{
4
+ label: string;
5
+ onClick: () => void;
6
+ }>;
7
+ }
8
+ declare const DropdownButton: (props: DropdownButtonProps) => import("@emotion/react/jsx-runtime").JSX.Element;
9
+ export default DropdownButton;
10
+ //# sourceMappingURL=DropdownButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownButton.d.ts","sourceRoot":"","sources":["../src/DropdownButton.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,UAAU,mBAAoB,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;IAC9D,KAAK,CAAC,EAAE,KAAK,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;KACvB,CAAC,CAAC;CACN;AAkCD,QAAA,MAAM,cAAc,GAAI,OAAO,mBAAmB,qDAkDjD,CAAA;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ import { useEffect, useRef, useState } from "react";
3
+ import { Icon } from "@maelstrom-futurism/icons";
4
+ import { css as emotionCss } from "@emotion/react";
5
+ import Button from "./Button";
6
+ const dropdownButtonStyles = emotionCss `
7
+ position: relative;
8
+ display: inline-block;
9
+ `;
10
+ const dropdownStyles = emotionCss `
11
+ position: absolute;
12
+ z-index: 10;
13
+ margin-top: 2px;
14
+ width: 98%;
15
+
16
+ & button {
17
+ border-radius: 0;
18
+ }
19
+ & button:first-of-type {
20
+ border-top-left-radius: 4px;
21
+ border-top-right-radius: 4px;
22
+ }
23
+ & button:last-of-type {
24
+ border-bottom-left-radius: 4px;
25
+ border-bottom-right-radius: 4px;
26
+ }
27
+ `;
28
+ const buttonStyles = emotionCss `
29
+ display: block;
30
+ width: 100%;
31
+ padding: 10px;
32
+ border: 0;
33
+ text-align: left;
34
+ `;
35
+ const DropdownButton = (props) => {
36
+ const [isOpen, setIsOpen] = useState(false);
37
+ const dropdownRef = useRef(null);
38
+ useEffect(() => {
39
+ const handleClickOutside = (event) => {
40
+ if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
41
+ setIsOpen(false);
42
+ }
43
+ };
44
+ document.addEventListener('mousedown', handleClickOutside);
45
+ return () => document.removeEventListener('mousedown', handleClickOutside);
46
+ }, []);
47
+ const handleRootClick = () => setIsOpen(!isOpen);
48
+ const { children, css, items, ...rest } = props;
49
+ const styles = [];
50
+ if (css)
51
+ styles.concat(css);
52
+ styles.push(dropdownButtonStyles);
53
+ return (_jsxs("div", { css: dropdownButtonStyles, ref: dropdownRef, children: [_jsxs(Button, { css: styles, onClick: handleRootClick, ...rest, children: [children, " ", _jsx(Icon, { icon: "CaretDown", size: 20 })] }), isOpen && (_jsx("div", { css: dropdownStyles, children: items && items.map((item, index) => (_jsx("button", { css: buttonStyles, onClick: () => {
54
+ item.onClick();
55
+ setIsOpen(false);
56
+ }, children: item.label }, index))) }))] }));
57
+ };
58
+ export default DropdownButton;
59
+ //# sourceMappingURL=DropdownButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownButton.js","sourceRoot":"","sources":["../src/DropdownButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,GAAG,IAAI,UAAU,EAAoB,MAAM,gBAAgB,CAAC;AAErE,OAAO,MAAM,MAAM,UAAU,CAAC;AAU9B,MAAM,oBAAoB,GAAG,UAAU,CAAA;;;CAGtC,CAAC;AAEF,MAAM,cAAc,GAAG,UAAU,CAAA;;;;;;;;;;;;;;;;;CA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AW,EAAC,IAAI,EAAE,EAAE,GAAI,IAAS,EAE/G,MAAM,IAAI,CACP,cAAK,GAAG,EAAE,cAAc,YACnB,KAAK,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACjC,iBAEI,GAAG,EAAE,YAAY,EACjB,OAAO,EAAE,GAAG,EAAE;wBACV,IAAI,CAAC,OAAO,EAAE,CAAC;wBACf,SAAS,CAAC,KAAK,CAAC,CAAC;oBACrB,CAAC,YAEA,IAAI,CAAC,KAAK,IAPN,KAAK,CAQL,CACZ,CAAC,GACA,CACT,IACC,CACT,CAAC;AACN,CAAC,CAAA;AAED,eAAe,cAAc,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from "react";
2
+ import { Theme } from "@maelstrom-futurism/core";
3
+ interface LinkButtonProps {
4
+ theme: Theme;
5
+ children?: ReactNode;
6
+ onClick?: React.MouseEventHandler;
7
+ disabled?: boolean;
8
+ }
9
+ declare const LinkButton: ({ theme, children, onClick, disabled, }: LinkButtonProps) => ReactNode;
10
+ export default LinkButton;
11
+ //# sourceMappingURL=LinkButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkButton.d.ts","sourceRoot":"","sources":["../src/LinkButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAWjD,UAAU,eAAe;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,QAAA,MAAM,UAAU,GAAI,yCAKjB,eAAe,KAAG,SAcpB,CAAA;AAED,eAAe,UAAU,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
+ import { css } from "@emotion/react";
3
+ const linkButtonStyles = css `
4
+ border: 0;
5
+ margin: 0;
6
+ padding: 0;
7
+ background: transparent;
8
+ cursor: pointer;
9
+ font-size: 16px;
10
+ `;
11
+ const LinkButton = ({ theme, children, onClick, disabled, }) => {
12
+ const linkStyles = css `
13
+ color: ${theme.color("textColor")};
14
+
15
+ &:hover {
16
+ color: ${theme.color('linkColor')};
17
+ text-decoration: underline;
18
+ }
19
+ `;
20
+ return _jsx("button", { onClick: onClick, disabled: disabled, css: [linkButtonStyles, linkStyles], children: children });
21
+ };
22
+ export default LinkButton;
23
+ //# sourceMappingURL=LinkButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkButton.js","sourceRoot":"","sources":["../src/LinkButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAGrC,MAAM,gBAAgB,GAAG,GAAG,CAAA;;;;;;;CAO3B,CAAC;AASF,MAAM,UAAU,GAAG,CAAC,EAChB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,QAAQ,GACM,EAAa,EAAE;IAC7B,MAAM,UAAU,GAAG,GAAG,CAAA;iBACT,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC;;;qBAGpB,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC;;;KAGxC,CAAC;IAEF,OAAO,iBACH,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,CAAC,gBAAgB,EAAE,UAAU,CAAC,YAAG,QAAQ,GAAU,CAAC;AACjE,CAAC,CAAA;AAED,eAAe,UAAU,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { ButtonVariant } from "./types";
2
+ export { default as Button } from "./Button";
3
+ export { default as ButtonGroup } from "./ButtonGroup";
4
+ export { default as DropdownButton } from "./DropdownButton";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export { default as Button } from "./Button";
2
+ export { default as ButtonGroup } from "./ButtonGroup";
3
+ export { default as DropdownButton } from "./DropdownButton";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { ReactNode } from "react";
2
+ import { SerializedStyles } from "@emotion/react";
3
+ export type ButtonVariant = "primary" | "secondary" | "cancel" | "ghost" | "link";
4
+ export type ButtonType = "button" | "submit";
5
+ export type Scale = "small" | "normal" | "big";
6
+ export interface ButtonProps {
7
+ children?: ReactNode;
8
+ /**
9
+ * Either type="submit" or type="button"
10
+ */
11
+ type?: ButtonType;
12
+ /**
13
+ * Allow the user to pass in custom styles
14
+ */
15
+ css?: SerializedStyles | SerializedStyles[];
16
+ scale?: Scale;
17
+ variant?: ButtonVariant;
18
+ outline?: boolean;
19
+ onClick?: React.MouseEventHandler;
20
+ disabled?: boolean;
21
+ }
22
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,WAAW,GACX,QAAQ,GACR,OAAO,GACP,MAAM,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC7C,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE/C,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;OAEG;IACH,GAAG,CAAC,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,CAAC;IAE5C,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@maelstrom-futurism/button",
3
+ "version": "0.7.4-alpha.9",
4
+ "description": "A button (with very cool ripples!) for MF",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "typings": "dist/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "test": "echo \"Error: run tests from root\" && exit 1",
14
+ "clean": "rm -Rf dist",
15
+ "build": "tsc",
16
+ "prepublishOnly": "npm run build"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/DawsonG/maelstrom-futurism.git",
21
+ "directory": "packages/button"
22
+ },
23
+ "keywords": [
24
+ "button",
25
+ "component",
26
+ "react"
27
+ ],
28
+ "author": "Dawson Goodell <dawsong@osmstudios.com>",
29
+ "license": "MIT",
30
+ "bugs": {
31
+ "url": "https://github.com/DawsonG/maelstrom-futurism/issues"
32
+ },
33
+ "homepage": "https://github.com/DawsonG/maelstrom-futurism#readme",
34
+ "dependencies": {
35
+ "@maelstrom-futurism/core": "^0.7.4-alpha.9",
36
+ "@maelstrom-futurism/icons": "^0.7.4-alpha.3"
37
+ },
38
+ "peerDependencies": {
39
+ "@emotion/react": ">= 11.10.5",
40
+ "react": ">= 18.3.1"
41
+ },
42
+ "gitHead": "8c49684db1a6002ee19db00c53ed2e9aac7e484b"
43
+ }