@nation-a/ui 0.15.1 → 0.15.3

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.cjs CHANGED
@@ -19240,9 +19240,9 @@ const Header = React.forwardRef(
19240
19240
  Header.displayName = "BottomSheet.Header";
19241
19241
  const Content$3 = React.forwardRef(
19242
19242
  ({ className, children, css: cssProp, ...props }, ref) => {
19243
- const styles2 = bottomSheetRecipe();
19243
+ const styles2 = bottomSheetRecipe.raw();
19244
19244
  const { rounded } = React.useContext(BottomSheetContext);
19245
- const contentClass = cx(styles2.content, className, cssProp ? css$1(cssProp) : void 0);
19245
+ const contentClass = cx(css$1(styles2.content, cssProp), className);
19246
19246
  return /* @__PURE__ */ jsxRuntime.jsx(
19247
19247
  Sheet.Container,
19248
19248
  {
@@ -19903,6 +19903,7 @@ const Textarea = React.forwardRef(
19903
19903
  ...rest
19904
19904
  }, ref) => {
19905
19905
  const [count, setCount] = React.useState((value == null ? void 0 : value.toString().length) || 0);
19906
+ const [text, setText] = React.useState(value);
19906
19907
  const recipe = inputRecipe({
19907
19908
  variant,
19908
19909
  color: color2,
@@ -19918,8 +19919,8 @@ const Textarea = React.forwardRef(
19918
19919
  if (disabled) return;
19919
19920
  const { value: value2 } = e2.target;
19920
19921
  e2.target.value = value2.slice(0, textLimit);
19922
+ setText(e2.target.value);
19921
19923
  onChange == null ? void 0 : onChange(e2);
19922
- if (showTextCount) setCount(value2.length);
19923
19924
  },
19924
19925
  [disabled, onChange, textLimit, showTextCount]
19925
19926
  );
@@ -19946,17 +19947,19 @@ const Textarea = React.forwardRef(
19946
19947
  },
19947
19948
  [recipe.label, required, RequiredStar]
19948
19949
  );
19949
- const TextLengthIndicator = React.useCallback(
19950
- ({ count: count2, limit }) => {
19951
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: recipe.textLengthIndicator, children: `${count2}${limit ? ` / ${limit}` : ""}` });
19952
- },
19953
- [recipe.textLengthIndicator]
19954
- );
19950
+ const TextLengthIndicator = ({ count: count2, limit }) => {
19951
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: recipe.textLengthIndicator, children: `${count2}${limit ? ` / ${limit}` : ""}` });
19952
+ };
19953
+ React.useEffect(() => {
19954
+ const textUpdated = value == null ? void 0 : value.toString().slice(0, textLimit);
19955
+ setText(textUpdated);
19956
+ setCount((textUpdated == null ? void 0 : textUpdated.length) || 0);
19957
+ }, [value]);
19955
19958
  return /* @__PURE__ */ jsxRuntime.jsxs(VStack2, { gap: 1, className: "group", "data-disabled": disabled || void 0, css: { width: "100%" }, children: [
19956
19959
  /* @__PURE__ */ jsxRuntime.jsx(Label2, { visible: !!(label && labelPosition === "outside"), children: label }),
19957
19960
  /* @__PURE__ */ jsxRuntime.jsxs(Stack2, { gap: 1, className: cx(recipe.inputContainer, className), onClick: handleContainerClick, css: css2, children: [
19958
19961
  /* @__PURE__ */ jsxRuntime.jsx(Label2, { visible: !!(label && labelPosition === "inside"), children: label }),
19959
- /* @__PURE__ */ jsxRuntime.jsx("textarea", { ref: inputRef, value, disabled, onChange: handleTextareaChange, ...rest }),
19962
+ /* @__PURE__ */ jsxRuntime.jsx("textarea", { ref: inputRef, value: text, disabled, onChange: handleTextareaChange, ...rest }),
19960
19963
  showTextCount && /* @__PURE__ */ jsxRuntime.jsx(TextLengthIndicator, { count, limit: textLimit })
19961
19964
  ] }),
19962
19965
  description && /* @__PURE__ */ jsxRuntime.jsx(Description2, { children: description })