@umami/react-zen 0.232.0 → 0.233.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/index.d.mts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/styles.full.css +1 -1
- package/tailwind.preset.ts +34 -0
package/dist/index.mjs
CHANGED
|
@@ -2263,6 +2263,37 @@ function isMinHeightPreset(value) {
|
|
|
2263
2263
|
function isMaxHeightPreset(value) {
|
|
2264
2264
|
return value in maxHeightMap;
|
|
2265
2265
|
}
|
|
2266
|
+
function addStatePrefix(prefix, className) {
|
|
2267
|
+
if (!className) return "";
|
|
2268
|
+
return className.split(" ").filter(Boolean).map((cls) => `${prefix}:${cls}`).join(" ");
|
|
2269
|
+
}
|
|
2270
|
+
function mapStateStyles(prefix, styles) {
|
|
2271
|
+
if (!styles) return "";
|
|
2272
|
+
const classes = [];
|
|
2273
|
+
if (styles.color !== void 0) {
|
|
2274
|
+
const colorClass = mapTextColor(
|
|
2275
|
+
typeof styles.color === "boolean" ? "true" : String(styles.color)
|
|
2276
|
+
);
|
|
2277
|
+
if (colorClass) classes.push(addStatePrefix(prefix, colorClass));
|
|
2278
|
+
}
|
|
2279
|
+
if (styles.backgroundColor !== void 0) {
|
|
2280
|
+
const bgClass = mapBackgroundColor(
|
|
2281
|
+
typeof styles.backgroundColor === "boolean" ? "true" : String(styles.backgroundColor)
|
|
2282
|
+
);
|
|
2283
|
+
if (bgClass) classes.push(addStatePrefix(prefix, bgClass));
|
|
2284
|
+
}
|
|
2285
|
+
if (styles.borderColor !== void 0) {
|
|
2286
|
+
const borderClass = mapBorderColor(
|
|
2287
|
+
typeof styles.borderColor === "boolean" ? "true" : String(styles.borderColor)
|
|
2288
|
+
);
|
|
2289
|
+
if (borderClass) classes.push(addStatePrefix(prefix, borderClass));
|
|
2290
|
+
}
|
|
2291
|
+
if (styles.opacity !== void 0) {
|
|
2292
|
+
const opacityClass = mapOpacity(styles.opacity);
|
|
2293
|
+
if (opacityClass) classes.push(addStatePrefix(prefix, opacityClass));
|
|
2294
|
+
}
|
|
2295
|
+
return classes.join(" ");
|
|
2296
|
+
}
|
|
2266
2297
|
var sizeMap = {
|
|
2267
2298
|
xs: "w-3 h-3",
|
|
2268
2299
|
sm: "w-4 h-4",
|
|
@@ -2478,6 +2509,9 @@ var Box = forwardRef(function Box2({
|
|
|
2478
2509
|
order,
|
|
2479
2510
|
zIndex,
|
|
2480
2511
|
theme,
|
|
2512
|
+
hover,
|
|
2513
|
+
focus,
|
|
2514
|
+
active,
|
|
2481
2515
|
as = "div",
|
|
2482
2516
|
render,
|
|
2483
2517
|
className,
|
|
@@ -2532,6 +2566,9 @@ var Box = forwardRef(function Box2({
|
|
|
2532
2566
|
mapPointerEvents(pointerEvents),
|
|
2533
2567
|
mapAlignSelf(alignSelf),
|
|
2534
2568
|
theme && `${theme}-theme`,
|
|
2569
|
+
mapStateStyles("hover", hover),
|
|
2570
|
+
mapStateStyles("focus", focus),
|
|
2571
|
+
mapStateStyles("active", active),
|
|
2535
2572
|
className
|
|
2536
2573
|
);
|
|
2537
2574
|
const widthStyle = getSizingStyle(width, isWidthPreset);
|