azeriand-library 1.17.8 → 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 }) {
@@ -16017,15 +16015,28 @@ function Checkbox({ label, checkedDefault = false, onChange }) {
16017
16015
  function SectionName({ section, className }) {
16018
16016
  return /* @__PURE__ */ jsx$1("div", { className: `uppercase font-bold tracking-[0.15rem] w-fit section-name ${className}`, children: section });
16019
16017
  }
16020
- function Input({ type, value, disabled, placeholder, maxLength, onChange, iconPosition = "left", centerText = false, icon, className, ...cardProps }) {
16018
+ function Input({ type = "text", value, disabled, placeholder, maxLength, onChange, iconPosition = "left", centerText = false, icon, className, ...cardProps }) {
16021
16019
  function inputUpdated(ev) {
16022
16020
  onChange == null ? void 0 : onChange(ev.target.value);
16023
16021
  }
16024
- const inputClassName = `flex justify-center items-center border-none bg-transparent py-[0.5rem] ${iconPosition && icon ? "px-[0.5rem]" : "px-[1rem]"} m-0 w-full ${centerText ? "text-center" : ""}`;
16022
+ const normalizedValue = value ?? "";
16023
+ const inputClassName = `flex justify-center items-center border-none bg-transparent py-[0.5rem] ${icon && iconPosition ? "px-[0.5rem]" : "px-[1rem]"} m-0 w-full ${centerText ? "text-center" : ""}`;
16025
16024
  const directionClassName = iconPosition === "left" ? "pl-3" : "flex-row-reverse pr-3";
16026
16025
  return /* @__PURE__ */ jsxs(Card, { className: `flex justify-center items-center rounded-md ${className} ${icon ? directionClassName : ""}`, noBlur: true, noPadding: true, ...cardProps, style: cardProps.style, children: [
16027
16026
  icon && /* @__PURE__ */ jsx$1("div", { className: "flex items-center", children: icon }),
16028
- /* @__PURE__ */ jsx$1("input", { className: inputClassName, onChange: inputUpdated, placeholder, value, disabled, type, maxLength, style: cardProps.style })
16027
+ /* @__PURE__ */ jsx$1(
16028
+ "input",
16029
+ {
16030
+ className: inputClassName,
16031
+ onChange: inputUpdated,
16032
+ placeholder,
16033
+ value: normalizedValue,
16034
+ disabled,
16035
+ type,
16036
+ maxLength,
16037
+ style: cardProps.style
16038
+ }
16039
+ )
16029
16040
  ] });
16030
16041
  }
16031
16042
  function CustomDay(props) {