2024-06-15 00:55:43 +03:00

151 lines
3.8 KiB
JavaScript

"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/circular-progress.ts
var circular_progress_exports = {};
__export(circular_progress_exports, {
circularProgress: () => circularProgress
});
module.exports = __toCommonJS(circular_progress_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"]
}
};
// 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/circular-progress.ts
var circularProgress = tv({
slots: {
base: "flex flex-col justify-center gap-1 max-w-fit items-center",
label: "",
svgWrapper: "relative block",
svg: "z-0 relative overflow-hidden",
track: "h-full stroke-default-300/50",
indicator: "h-full stroke-current",
value: "absolute font-normal inset-0 flex items-center justify-center"
},
variants: {
color: {
default: {
svg: "text-default-400"
},
primary: {
svg: "text-primary"
},
secondary: {
svg: "text-secondary"
},
success: {
svg: "text-success"
},
warning: {
svg: "text-warning"
},
danger: {
svg: "text-danger"
}
},
size: {
sm: {
svg: "w-8 h-8",
label: "text-small",
value: "text-[0.5rem]"
},
md: {
svg: "w-10 h-10",
label: "text-small",
value: "text-[0.55rem]"
},
lg: {
svg: "w-12 h-12",
label: "text-medium",
value: "text-[0.6rem]"
}
},
isIndeterminate: {
true: {
svg: "animate-spinner-ease-spin"
}
},
isDisabled: {
true: {
base: "opacity-disabled cursor-not-allowed"
}
},
disableAnimation: {
true: {},
false: {
indicator: "transition-all !duration-500"
}
}
},
defaultVariants: {
color: "primary",
size: "md",
isDisabled: false
},
compoundVariants: [
{
disableAnimation: true,
isIndeterminate: false,
class: {
svg: "!transition-none motion-reduce:transition-none"
}
}
]
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
circularProgress
});