@launchpad-ui/button
Advanced tools
Comparing version 0.11.2 to 0.11.3-alpha.0
import type { IconProps } from '@launchpad-ui/icons'; | ||
import type { ButtonHTMLAttributes, ReactElement } from 'react'; | ||
import './styles/Button.css'; | ||
type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & { | ||
@@ -5,0 +4,0 @@ isLoading?: boolean; |
import type { ComponentProps } from 'react'; | ||
import './styles/ButtonGroup.css'; | ||
type ButtonGroupProps = ComponentProps<'div'> & { | ||
@@ -4,0 +3,0 @@ spacing?: 'compact' | 'normal' | 'large'; |
import type { IconProps } from '@launchpad-ui/icons'; | ||
import type { ButtonHTMLAttributes, ReactElement } from 'react'; | ||
import './styles/Button.css'; | ||
type IconButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & { | ||
@@ -5,0 +4,0 @@ kind?: 'default' | 'primary' | 'destructive' | 'minimal' | 'close'; |
@@ -6,3 +6,26 @@ import './style.css'; | ||
import { memo, forwardRef, cloneElement, isValidElement, useRef } from "react"; | ||
const Button$1 = ""; | ||
const Button$1 = "_Button_d8h3z_4"; | ||
const ButtonGroup$1 = "_ButtonGroup_d8h3z_545"; | ||
const styles = { | ||
Button: Button$1, | ||
ButtonGroup: ButtonGroup$1, | ||
"Button--tiny": "_Button--tiny_d8h3z_27", | ||
"Button--small": "_Button--small_d8h3z_35", | ||
"Button--big": "_Button--big_d8h3z_43", | ||
"Button--fit": "_Button--fit_d8h3z_50", | ||
"Button--icon": "_Button--icon_d8h3z_55", | ||
"Button-icon": "_Button-icon_d8h3z_55", | ||
"Button--default": "_Button--default_d8h3z_87", | ||
"Button--primary": "_Button--primary_d8h3z_122", | ||
"Button--minimal": "_Button--minimal_d8h3z_178", | ||
"Button--close": "_Button--close_d8h3z_201", | ||
"Button--destructive": "_Button--destructive_d8h3z_242", | ||
"Button--link": "_Button--link_d8h3z_310", | ||
"Button--primaryFlair": "_Button--primaryFlair_d8h3z_406", | ||
"Button--defaultFlair": "_Button--defaultFlair_d8h3z_462", | ||
"Button--minimalFlair": "_Button--minimalFlair_d8h3z_505", | ||
"ButtonGroup--normal": "_ButtonGroup--normal_d8h3z_551", | ||
"ButtonGroup--large": "_ButtonGroup--large_d8h3z_555", | ||
"ButtonGroup--compact": "_ButtonGroup--compact_d8h3z_559" | ||
}; | ||
const ButtonComponent = /* @__PURE__ */ forwardRef((props, ref) => { | ||
@@ -29,7 +52,6 @@ const { | ||
const classes = cx( | ||
"Button", | ||
`Button--${kind}`, | ||
disabled && "Button--disabled", | ||
size && `Button--${size}`, | ||
fit && "Button--fit", | ||
styles.Button, | ||
styles[`Button--${kind}`], | ||
size && styles[`Button--${size}`], | ||
fit && styles["Button--fit"], | ||
className | ||
@@ -48,3 +70,3 @@ ); | ||
"aria-hidden": true, | ||
className: cx(icon.props.className, "Button-icon") | ||
className: cx(icon.props.className, styles["Button-icon"]) | ||
}); | ||
@@ -97,3 +119,2 @@ const getFinalChildren = (c) => [ | ||
const Button = /* @__PURE__ */ memo(ButtonComponent); | ||
const ButtonGroup$1 = ""; | ||
const ButtonGroup = ({ | ||
@@ -106,3 +127,3 @@ spacing = "normal", | ||
}) => { | ||
const classes = cx("ButtonGroup", `ButtonGroup--${spacing}`, className); | ||
const classes = cx(styles.ButtonGroup, styles[`ButtonGroup--${spacing}`], className); | ||
return /* @__PURE__ */ jsx("div", { className: classes, "data-test-id": testId, ...rest, children }); | ||
@@ -122,3 +143,2 @@ }; | ||
const inputRef = useRef(null); | ||
const classes = cx("UploadButton", className); | ||
const handleClick = () => { | ||
@@ -152,3 +172,3 @@ var _a; | ||
}; | ||
return /* @__PURE__ */ jsxs("span", { className: classes, "data-test-id": testId, children: [ | ||
return /* @__PURE__ */ jsxs("span", { className, "data-test-id": testId, children: [ | ||
/* @__PURE__ */ jsx( | ||
@@ -158,3 +178,2 @@ "input", | ||
ref: inputRef, | ||
className: "UploadButton-input", | ||
id, | ||
@@ -169,3 +188,3 @@ style: { display: "none" }, | ||
), | ||
/* @__PURE__ */ jsx("label", { htmlFor: id, className: "UploadButton-label", children: /* @__PURE__ */ jsx( | ||
/* @__PURE__ */ jsx("label", { htmlFor: id, children: /* @__PURE__ */ jsx( | ||
Button, | ||
@@ -201,8 +220,7 @@ { | ||
const classes = cx( | ||
"IconButton", | ||
"Button", | ||
"Button--icon", | ||
`Button--${kind}`, | ||
disabled && "Button--disabled", | ||
size && `Button--${size}`, | ||
styles.IconButton, | ||
styles.Button, | ||
styles["Button--icon"], | ||
styles[`Button--${kind}`], | ||
size && styles[`Button--${size}`], | ||
className | ||
@@ -209,0 +227,0 @@ ); |
@@ -8,3 +8,26 @@ require('./style.css'); | ||
const react = require("react"); | ||
const Button$1 = ""; | ||
const Button$1 = "_Button_d8h3z_4"; | ||
const ButtonGroup$1 = "_ButtonGroup_d8h3z_545"; | ||
const styles = { | ||
Button: Button$1, | ||
ButtonGroup: ButtonGroup$1, | ||
"Button--tiny": "_Button--tiny_d8h3z_27", | ||
"Button--small": "_Button--small_d8h3z_35", | ||
"Button--big": "_Button--big_d8h3z_43", | ||
"Button--fit": "_Button--fit_d8h3z_50", | ||
"Button--icon": "_Button--icon_d8h3z_55", | ||
"Button-icon": "_Button-icon_d8h3z_55", | ||
"Button--default": "_Button--default_d8h3z_87", | ||
"Button--primary": "_Button--primary_d8h3z_122", | ||
"Button--minimal": "_Button--minimal_d8h3z_178", | ||
"Button--close": "_Button--close_d8h3z_201", | ||
"Button--destructive": "_Button--destructive_d8h3z_242", | ||
"Button--link": "_Button--link_d8h3z_310", | ||
"Button--primaryFlair": "_Button--primaryFlair_d8h3z_406", | ||
"Button--defaultFlair": "_Button--defaultFlair_d8h3z_462", | ||
"Button--minimalFlair": "_Button--minimalFlair_d8h3z_505", | ||
"ButtonGroup--normal": "_ButtonGroup--normal_d8h3z_551", | ||
"ButtonGroup--large": "_ButtonGroup--large_d8h3z_555", | ||
"ButtonGroup--compact": "_ButtonGroup--compact_d8h3z_559" | ||
}; | ||
const ButtonComponent = /* @__PURE__ */ react.forwardRef((props, ref) => { | ||
@@ -31,7 +54,6 @@ const { | ||
const classes = classix.cx( | ||
"Button", | ||
`Button--${kind}`, | ||
disabled && "Button--disabled", | ||
size && `Button--${size}`, | ||
fit && "Button--fit", | ||
styles.Button, | ||
styles[`Button--${kind}`], | ||
size && styles[`Button--${size}`], | ||
fit && styles["Button--fit"], | ||
className | ||
@@ -50,3 +72,3 @@ ); | ||
"aria-hidden": true, | ||
className: classix.cx(icon.props.className, "Button-icon") | ||
className: classix.cx(icon.props.className, styles["Button-icon"]) | ||
}); | ||
@@ -99,3 +121,2 @@ const getFinalChildren = (c) => [ | ||
const Button = /* @__PURE__ */ react.memo(ButtonComponent); | ||
const ButtonGroup$1 = ""; | ||
const ButtonGroup = ({ | ||
@@ -108,3 +129,3 @@ spacing = "normal", | ||
}) => { | ||
const classes = classix.cx("ButtonGroup", `ButtonGroup--${spacing}`, className); | ||
const classes = classix.cx(styles.ButtonGroup, styles[`ButtonGroup--${spacing}`], className); | ||
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes, "data-test-id": testId, ...rest, children }); | ||
@@ -124,3 +145,2 @@ }; | ||
const inputRef = react.useRef(null); | ||
const classes = classix.cx("UploadButton", className); | ||
const handleClick = () => { | ||
@@ -154,3 +174,3 @@ var _a; | ||
}; | ||
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: classes, "data-test-id": testId, children: [ | ||
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className, "data-test-id": testId, children: [ | ||
/* @__PURE__ */ jsxRuntime.jsx( | ||
@@ -160,3 +180,2 @@ "input", | ||
ref: inputRef, | ||
className: "UploadButton-input", | ||
id, | ||
@@ -171,3 +190,3 @@ style: { display: "none" }, | ||
), | ||
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, className: "UploadButton-label", children: /* @__PURE__ */ jsxRuntime.jsx( | ||
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: id, children: /* @__PURE__ */ jsxRuntime.jsx( | ||
Button, | ||
@@ -203,8 +222,7 @@ { | ||
const classes = classix.cx( | ||
"IconButton", | ||
"Button", | ||
"Button--icon", | ||
`Button--${kind}`, | ||
disabled && "Button--disabled", | ||
size && `Button--${size}`, | ||
styles.IconButton, | ||
styles.Button, | ||
styles["Button--icon"], | ||
styles[`Button--${kind}`], | ||
size && styles[`Button--${size}`], | ||
className | ||
@@ -211,0 +229,0 @@ ); |
{ | ||
"name": "@launchpad-ui/button", | ||
"version": "0.11.2", | ||
"version": "0.11.3-alpha.0", | ||
"status": "beta", | ||
@@ -31,4 +31,4 @@ "publishConfig": { | ||
"classix": "2.1.17", | ||
"@launchpad-ui/icons": "~0.14.2", | ||
"@launchpad-ui/tokens": "~0.8.2" | ||
"@launchpad-ui/icons": "~0.14.3-alpha.0", | ||
"@launchpad-ui/tokens": "~0.9.0-alpha.1" | ||
}, | ||
@@ -35,0 +35,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
82620
1331
- Removed@launchpad-ui/tokens@0.8.2(transitive)