azeriand-library 1.18.0 → 1.19.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/dist/index.esm.js CHANGED
@@ -15,7 +15,7 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
15
15
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
16
16
  import { jsx as jsx$1, jsxs, Fragment } from "react/jsx-runtime";
17
17
  import * as React from "react";
18
- import React__default, { forwardRef, useContext, isValidElement, cloneElement, Children, createContext, useState, useEffect } from "react";
18
+ import React__default, { forwardRef, useContext, isValidElement, cloneElement, Children, createContext, useState } from "react";
19
19
  import ReactDOM from "react-dom";
20
20
  function Avatar({ src, className = "", style: style2 }) {
21
21
  return /* @__PURE__ */ jsx$1(
@@ -15788,8 +15788,6 @@ function Card({
15788
15788
  ...rest
15789
15789
  }) {
15790
15790
  const Component = as || "article";
15791
- let [classNames, setClassNames] = useState("");
15792
- let [cardStyle, setCardStyle] = useState({});
15793
15791
  const { theme, cardDefaults } = useContext(ThemeContext);
15794
15792
  const mergedProps = {
15795
15793
  appearance: appearance || cardDefaults.appearance,
@@ -15797,26 +15795,26 @@ function Card({
15797
15795
  intensity: intensity || cardDefaults.intensity,
15798
15796
  dark: dark2 !== void 0 ? dark2 : cardDefaults.theme
15799
15797
  };
15800
- useEffect(() => {
15801
- let intensityValue = mergedProps.intensity;
15802
- if (intensityValue === void 0) {
15803
- intensityValue = theme === "dark" ? 600 : 300;
15804
- }
15805
- setCardStyle({
15806
- "--glass-color": `var(--color-${mergedProps.color}-${intensityValue})`,
15807
- "--card-text-color": `var(--color-${mergedProps.color}-${mergedProps.dark ? "100" : "800"})`,
15808
- backdropFilter: mergedProps.appearance === "glass" && !noBlur ? `blur(${blur}px)` : void 0,
15809
- ...style2
15810
- });
15811
- let rounded = "rounded-md";
15812
- if (className) {
15813
- const roundedMatch = className.match(/rounded\-[a-z0-9]+/g);
15814
- if (roundedMatch) {
15815
- rounded = roundedMatch[roundedMatch.length - 1];
15816
- }
15798
+ let intensityValue = mergedProps.intensity;
15799
+ if (intensityValue === void 0) {
15800
+ intensityValue = theme === "dark" ? 600 : 300;
15801
+ }
15802
+ const cardStyle = {
15803
+ ...style2 || {}
15804
+ };
15805
+ cardStyle["--glass-color"] = `var(--color-${mergedProps.color}-${intensityValue})`;
15806
+ cardStyle["--card-text-color"] = `var(--color-${mergedProps.color}-${mergedProps.dark ? "100" : "800"})`;
15807
+ if (mergedProps.appearance === "glass" && !noBlur) {
15808
+ cardStyle.backdropFilter = `blur(${blur}px)`;
15809
+ }
15810
+ let rounded = "rounded-md";
15811
+ if (className) {
15812
+ const roundedMatch = className.match(/rounded\-[a-z0-9]+/g);
15813
+ if (roundedMatch) {
15814
+ rounded = roundedMatch[roundedMatch.length - 1];
15817
15815
  }
15818
- setClassNames(`card ${rounded} ${mergedProps.appearance} ${className} ${noPadding ? "" : "p-[2rem]"}`);
15819
- }, [color2, intensity, dark2, appearance, noBlur, className, theme]);
15816
+ }
15817
+ const classNames = `card ${rounded} ${mergedProps.appearance} ${className || ""} ${noPadding ? "" : "p-[2rem]"}`.trim();
15820
15818
  return /* @__PURE__ */ jsx$1(Component, { className: classNames, style: cardStyle, onClick, ...rest, children });
15821
15819
  }
15822
15820
  function Button({ children, label, icon, position: position2 = "left", onClick, size, className, ...cardProps }) {