UNPKG

nextuiq

Version:

NextUIQ is a modern, lightweight, and developer-friendly UI component library for React and Next.js. Built with TypeScript and Tailwind CSS, it offers customizable, accessible, and performance-optimized components with built-in dark mode, theme customizat

2 lines (1 loc) 2.72 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index46.js");exports.Button=({children:r,className:t="",variant:a="primary",size:s="md",startIcon:n,endIcon:i,disabled:o=!1,tag:c="button",href:l,loading:d=!1,loadingText:m="Loading...",target:x,rel:h,ariaLabel:p,ariaDescribedBy:u,...v})=>{const g=`inline-flex items-center justify-center font-[var(--font-weight-semibold)] gap-[var(--spacing)] rounded-[var(--radius-md)] transition-all duration-[var(--ease-in-out)] whitespace-nowrap ${{sm:"text-[var(--text-sm)] px-[var(--spacing)] py-[calc(var(--spacing)*0.5)]",md:"text-[var(--text-base)] px-[calc(var(--spacing)*1.5)] py-[var(--spacing)]"}[s]} ${{primary:"bg-[oklch(var(--theme-primary))] text-white hover:bg-[oklch(var(--theme-primary-dark))] focus:ring-[oklch(var(--theme-primary)/50)]",destructive:"bg-[oklch(var(--theme-error))] text-white hover:bg-[oklch(var(--theme-error)/90)] focus:ring-[oklch(var(--theme-error)/50)]",outline:"border border-[oklch(var(--theme-border))] bg-[oklch(var(--theme-background))] text-[oklch(var(--theme-foreground))] hover:bg-[oklch(var(--theme-muted))]",secondary:"bg-[oklch(var(--theme-secondary))] text-white hover:bg-[oklch(var(--theme-secondary-dark))]",ghost:"text-[oklch(var(--theme-foreground))] hover:bg-[oklch(var(--theme-muted))]",link:'underline-offset-4 hover:underline p-0 h-auto font-normal [&:not([class*="text-"])]:text-[oklch(var(--theme-primary))]'}[a]} ${o||d?"cursor-not-allowed opacity-50":"cursor-pointer"} ${t}`,b=e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:d?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("span",{className:"animate-[var(--animate-spin)] mr-[var(--spacing)]","aria-hidden":"true",children:"⚪"}),e.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Loading"}),e.jsxRuntimeExports.jsx("span",{children:m})]}):e.jsxRuntimeExports.jsxs("div",{className:"inline-flex items-center gap-[var(--spacing)]",children:[n&&e.jsxRuntimeExports.jsx("span",{className:"flex items-center","aria-hidden":"true",children:n}),"string"==typeof r?e.jsxRuntimeExports.jsx("span",{children:r}):e.jsxRuntimeExports.jsx("div",{className:"inline-flex items-center gap-3",children:r}),i&&e.jsxRuntimeExports.jsx("span",{className:"flex items-center","aria-hidden":"true",children:i})]})}),j={className:g,"aria-label":p,"aria-describedby":u,"aria-disabled":o||d,"aria-busy":d};return"a"===c&&l?e.jsxRuntimeExports.jsx("a",{href:l,target:x,rel:"_blank"===x?`${h||""} noopener noreferrer`.trim():h,role:"button",tabIndex:o||d?-1:0,...j,...v,children:b}):e.jsxRuntimeExports.jsx("button",{type:v.type||"button",disabled:o||d,...j,...v,children:b})};