UNPKG

@teamsparta/stack-button

Version:
111 lines (109 loc) 3.14 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/TextButton/TextButton.style.ts var TextButton_style_exports = {}; __export(TextButton_style_exports, { addonCss: () => addonCss, buttonBaseCss: () => buttonBaseCss, buttonIconSizeCss: () => buttonIconSizeCss, buttonTextCss: () => buttonTextCss, textButtonColorVariants: () => textButtonColorVariants }); module.exports = __toCommonJS(TextButton_style_exports); var import_react = require("@emotion/react"); var import_stack_font = require("@teamsparta/stack-font"); var import_stack_tokens = require("@teamsparta/stack-tokens"); var import_stack_utils = require("@teamsparta/stack-utils"); var textButtonIconVariants = { sm: { svg: { width: "16px", height: "16px" } }, md: { svg: { width: "16px", height: "16px" } }, lg: { svg: { width: "20px", height: "20px" } } }; var buttonTextFontVariants = { sm: import_stack_font.captionSb, md: import_stack_font.bodyB, lg: import_stack_font.subTitle3 }; var textButtonTextColorVar = "--stack-text-button-text-color"; var buttonTextCss = (sizes) => sizes.map( ({ breakpoint, size }) => import_react.css` @media screen and (min-width: ${breakpoint}px) { ${buttonTextFontVariants[size]} } ` ); var buttonBaseCss = (0, import_react.css)({ position: "relative", display: "inline-flex", gap: "4px", alignItems: "center", justifyContent: "center", cursor: "pointer", outline: "none", backgroundColor: "transparent", border: "none", textAlign: "center", color: (0, import_stack_utils.getVar)(textButtonTextColorVar), "&:focus": { outline: "revert" } }); var addonCss = (0, import_react.css)({ display: "inline-flex", alignItems: "center", justifyContent: "center" }); var textButtonColorVariants = { default: { [textButtonTextColorVar]: import_stack_tokens.vars.neutral[50] }, link: { [textButtonTextColorVar]: import_stack_tokens.vars.blue[70] } }; var buttonIconSizeCss = (sizes) => sizes.map( ({ breakpoint, size }) => import_react.css` @media screen and (min-width: ${breakpoint}px) { ${textButtonIconVariants[size]} } ` ); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { addonCss, buttonBaseCss, buttonIconSizeCss, buttonTextCss, textButtonColorVariants });