@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
22 lines (21 loc) • 1.01 kB
JavaScript
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
v3.2.1 */
import { ref } from "lit-html/directives/ref.js";
import { keyed } from "lit-html/directives/keyed.js";
import { nothing, html } from "lit-html";
import { safeClassMap } from "@arcgis/lumina";
import { g as getIconScale } from "./component.js";
const CSS = {
button: "x-button",
buttonRound: "x-button--round"
};
const XButton = ({ disabled, focusable, key, label, onClick, ref: ref$1, round = true, scale, title }) => keyed(key, html`<button .ariaLabel=${label} class=${safeClassMap({
[((scale2) => `x-button--${scale2}`)(scale)]: true,
[CSS.button]: true,
[CSS.buttonRound]: round
})} .disabled=${disabled} @click=${onClick} .tabIndex=${focusable ? 0 : -1} title=${title ?? nothing} type=button ${ref(ref$1)}><calcite-icon icon=x .scale=${getIconScale(scale)}></calcite-icon></button>`);
export {
CSS as C,
XButton as X
};