UNPKG

@nextui-org/theme

Version:

The default theme for NextUI components

191 lines (185 loc) 4.86 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/components/spinner.ts var spinner_exports = {}; __export(spinner_exports, { spinner: () => spinner }); module.exports = __toCommonJS(spinner_exports); // src/utils/tv.ts var import_tailwind_variants = require("tailwind-variants"); // src/utils/tw-merge-config.ts var COMMON_UNITS = ["small", "medium", "large"]; var twMergeConfig = { theme: { opacity: ["disabled"], spacing: ["divider"], borderWidth: COMMON_UNITS, borderRadius: COMMON_UNITS }, classGroups: { shadow: [{ shadow: COMMON_UNITS }], "font-size": [{ text: ["tiny", ...COMMON_UNITS] }], "bg-image": [ "bg-stripe-gradient-default", "bg-stripe-gradient-primary", "bg-stripe-gradient-secondary", "bg-stripe-gradient-success", "bg-stripe-gradient-warning", "bg-stripe-gradient-danger" ] } }; // src/utils/tv.ts var tv = (options, config) => { var _a, _b, _c; return (0, import_tailwind_variants.tv)(options, { ...config, twMerge: (_a = config == null ? void 0 : config.twMerge) != null ? _a : true, twMergeConfig: { ...config == null ? void 0 : config.twMergeConfig, theme: { ...(_b = config == null ? void 0 : config.twMergeConfig) == null ? void 0 : _b.theme, ...twMergeConfig.theme }, classGroups: { ...(_c = config == null ? void 0 : config.twMergeConfig) == null ? void 0 : _c.classGroups, ...twMergeConfig.classGroups } } }); }; // src/components/spinner.ts var spinner = tv({ slots: { base: "relative inline-flex flex-col gap-2 items-center justify-center", wrapper: "relative flex", circle1: [ "absolute", "w-full", "h-full", "rounded-full", "animate-spinner-ease-spin", "border-2", "border-solid", "border-t-transparent", "border-l-transparent", "border-r-transparent" ], circle2: [ "absolute", "w-full", "h-full", "rounded-full", "opacity-75", "animate-spinner-linear-spin", "border-2", "border-dotted", "border-t-transparent", "border-l-transparent", "border-r-transparent" ], label: "text-foreground dark:text-foreground-dark font-regular" }, variants: { size: { sm: { wrapper: "w-5 h-5", circle1: "border-2", circle2: "border-2", label: "text-small" }, md: { wrapper: "w-8 h-8", circle1: "border-3", circle2: "border-3", label: "text-medium" }, lg: { wrapper: "w-10 h-10", circle1: "border-3", circle2: "border-3", label: "text-large" } }, color: { current: { circle1: "border-b-current", circle2: "border-b-current" }, white: { circle1: "border-b-white", circle2: "border-b-white" }, default: { circle1: "border-b-default", circle2: "border-b-default" }, primary: { circle1: "border-b-primary", circle2: "border-b-primary" }, secondary: { circle1: "border-b-secondary", circle2: "border-b-secondary" }, success: { circle1: "border-b-success", circle2: "border-b-success" }, warning: { circle1: "border-b-warning", circle2: "border-b-warning" }, danger: { circle1: "border-b-danger", circle2: "border-b-danger" } }, labelColor: { foreground: { label: "text-foreground" }, primary: { label: "text-primary" }, secondary: { label: "text-secondary" }, success: { label: "text-success" }, warning: { label: "text-warning" }, danger: { label: "text-danger" } } }, defaultVariants: { size: "md", color: "primary", labelColor: "foreground" } }); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { spinner });