Comparing version 0.0.5 to 0.0.6
import React, { MouseEventHandler } from "react"; | ||
type Variant = "primary" | "secondary" | "tertiary" | "primaryInverse" | "tertiaryInverse"; | ||
type Variant = "primary" | "secondary" | "tertiary"; | ||
type Size = "small" | "medium" | "large"; | ||
type Colors = "inverse" | "destructive"; | ||
export interface Button extends React.ButtonHTMLAttributes<HTMLButtonElement> { | ||
@@ -16,3 +17,3 @@ className?: string; | ||
variant?: "primary" | "tertiary"; | ||
variantColor?: "inverse" | "destructive"; | ||
variantColor?: Colors; | ||
}; | ||
@@ -19,0 +20,0 @@ type AriaLabel = { |
49
index.js
@@ -1,37 +0,26 @@ | ||
import d from "react"; | ||
const u = "_kbutton_1yzq7_2", z = "_primary_1yzq7_17", q = "_destructive_1yzq7_33", b = "_secondary_1yzq7_48", v = "_tertiary_1yzq7_67", $ = "_inverse_1yzq7_87", k = "_large_1yzq7_102", p = "_icon_1yzq7_107", g = "_medium_1yzq7_110", C = "_small_1yzq7_118", t = { | ||
kbutton: u, | ||
primary: z, | ||
destructive: q, | ||
secondary: b, | ||
tertiary: v, | ||
inverse: $, | ||
large: k, | ||
icon: p, | ||
medium: g, | ||
small: C | ||
}, h = (n) => { | ||
const { | ||
variant: r = "secondary", | ||
size: o = "medium", | ||
className: e, | ||
variantColor: s, | ||
icon: a, | ||
ariaLabel: c, | ||
disabled: i, | ||
onClick: _, | ||
style: y, | ||
children: l | ||
} = n, m = ` | ||
import u from "react"; | ||
const g = "_kbutton_50pmg_1", y = "_primary_50pmg_16", b = "_destructive_50pmg_32", v = "_secondary_50pmg_47", $ = "_tertiary_50pmg_66", k = "_inverse_50pmg_86", C = "_large_50pmg_101", f = "_icon_50pmg_106", h = "_medium_50pmg_109", x = "_small_50pmg_117", t = { | ||
kbutton: g, | ||
primary: y, | ||
destructive: b, | ||
secondary: v, | ||
tertiary: $, | ||
inverse: k, | ||
large: C, | ||
icon: f, | ||
medium: h, | ||
small: x | ||
}, B = (n) => { | ||
const { variant: o = "secondary", size: r = "medium", className: e, variantColor: s, icon: c, ariaLabel: a, disabled: i, onClick: _, style: m, children: l } = n, p = s, d = ` | ||
${t.kbutton} | ||
${t[o]} | ||
${t[r]} | ||
${t[o]} | ||
${s} | ||
${t[p]} | ||
${e != null ? e : ""} | ||
${a && t.icon} | ||
${c && t.icon} | ||
`; | ||
return d.createElement("button", { disabled: i, "aria-label": c, className: m, onClick: _, style: y }, l); | ||
return u.createElement("button", { disabled: i, "aria-label": a, className: d, onClick: _, style: m }, l); | ||
}; | ||
export { | ||
h as Button | ||
B as Button | ||
}; |
{ | ||
"name": "kzkzkz", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
11
18466
365