@launchpad-ui/button
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -1,6 +0,3 @@ | ||
// ../../scripts/react-shim.js | ||
import * as React from "react"; | ||
// src/Button.tsx | ||
import cx from "clsx"; | ||
import { cx } from "classix"; | ||
import { cloneElement, forwardRef, memo } from "react"; | ||
@@ -65,8 +62,12 @@ import "./styles/Button.css"; | ||
const sizeClass = `Button--${size}`; | ||
const classes = cx("Button", className, kindClass, sizeClass, { | ||
"Button--fit": fit, | ||
"Button--icon": type === "icon", | ||
"Button--outlined": type === "icon" && outlined, | ||
"Button--borderless": type === "borderless" | ||
}); | ||
const classes = cx( | ||
"Button", | ||
className, | ||
kindClass, | ||
sizeClass, | ||
fit && "Button--fit", | ||
type === "icon" && "Button--icon", | ||
type === "icon" && outlined && "Button--outlined", | ||
type === "borderless" && "Button--borderless" | ||
); | ||
const handleClick = (event) => { | ||
@@ -166,3 +167,3 @@ if (disabled) { | ||
// src/ButtonGroup.tsx | ||
import cx2 from "clsx"; | ||
import { cx as cx2 } from "classix"; | ||
import "./styles/ButtonGroup.css"; | ||
@@ -187,3 +188,3 @@ import { jsx as jsx2 } from "react/jsx-runtime"; | ||
// src/UploadButton.tsx | ||
import cx3 from "clsx"; | ||
import { cx as cx3 } from "classix"; | ||
import { useRef } from "react"; | ||
@@ -190,0 +191,0 @@ import { jsx as jsx3, jsxs } from "react/jsx-runtime"; |
"use strict"; | ||
var __create = Object.create; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __getProtoOf = Object.getPrototypeOf; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
@@ -20,6 +18,2 @@ var __export = (target, all) => { | ||
}; | ||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( | ||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, | ||
mod | ||
)); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
@@ -40,7 +34,4 @@ | ||
// ../../scripts/react-shim.js | ||
var React = __toESM(require("react")); | ||
// src/Button.tsx | ||
var import_clsx = __toESM(require("clsx")); | ||
var import_classix = require("classix"); | ||
var import_react = require("react"); | ||
@@ -105,8 +96,12 @@ var import_Button = require("./styles/Button.css"); | ||
const sizeClass = `Button--${size}`; | ||
const classes = (0, import_clsx.default)("Button", className, kindClass, sizeClass, { | ||
"Button--fit": fit, | ||
"Button--icon": type === "icon", | ||
"Button--outlined": type === "icon" && outlined, | ||
"Button--borderless": type === "borderless" | ||
}); | ||
const classes = (0, import_classix.cx)( | ||
"Button", | ||
className, | ||
kindClass, | ||
sizeClass, | ||
fit && "Button--fit", | ||
type === "icon" && "Button--icon", | ||
type === "icon" && outlined && "Button--outlined", | ||
type === "borderless" && "Button--borderless" | ||
); | ||
const handleClick = (event) => { | ||
@@ -206,3 +201,3 @@ if (disabled) { | ||
// src/ButtonGroup.tsx | ||
var import_clsx2 = __toESM(require("clsx")); | ||
var import_classix2 = require("classix"); | ||
var import_ButtonGroup = require("./styles/ButtonGroup.css"); | ||
@@ -217,3 +212,3 @@ var import_jsx_runtime = require("react/jsx-runtime"); | ||
}) => { | ||
const classes = (0, import_clsx2.default)("ButtonGroup", `ButtonGroup--${spacing}`, className); | ||
const classes = (0, import_classix2.cx)("ButtonGroup", `ButtonGroup--${spacing}`, className); | ||
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { | ||
@@ -228,3 +223,3 @@ className: classes, | ||
// src/UploadButton.tsx | ||
var import_clsx3 = __toESM(require("clsx")); | ||
var import_classix3 = require("classix"); | ||
var import_react2 = require("react"); | ||
@@ -243,3 +238,3 @@ var import_jsx_runtime = require("react/jsx-runtime"); | ||
const inputRef = (0, import_react2.useRef)(null); | ||
const classes = (0, import_clsx3.default)("UploadButton", className); | ||
const classes = (0, import_classix3.cx)("UploadButton", className); | ||
const handleClick = () => { | ||
@@ -246,0 +241,0 @@ inputRef.current?.click(); |
{ | ||
"name": "@launchpad-ui/button", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"status": "beta", | ||
@@ -30,3 +30,3 @@ "publishConfig": { | ||
"@launchpad-ui/tokens": "~0.1.5", | ||
"clsx": "^1.2.0" | ||
"classix": "^2.1.13" | ||
}, | ||
@@ -33,0 +33,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
106471
817
+ Addedclassix@^2.1.13
+ Addedclassix@2.2.0(transitive)
- Removedclsx@^1.2.0
- Removedclsx@1.2.1(transitive)