@nation-a/ui 0.15.2 → 0.16.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.js CHANGED
@@ -19304,8 +19304,7 @@ const navigationRecipe = sva({
19304
19304
  flexDirection: "row",
19305
19305
  justifyContent: "space-around",
19306
19306
  bg: "surface.layer_1",
19307
- pt: 2,
19308
- pb: 8
19307
+ py: 2
19309
19308
  },
19310
19309
  trigger: {
19311
19310
  display: "flex",
@@ -19885,6 +19884,7 @@ const Textarea = forwardRef(
19885
19884
  ...rest
19886
19885
  }, ref) => {
19887
19886
  const [count, setCount] = useState((value == null ? void 0 : value.toString().length) || 0);
19887
+ const [text, setText] = useState(value);
19888
19888
  const recipe = inputRecipe({
19889
19889
  variant,
19890
19890
  color: color2,
@@ -19900,8 +19900,8 @@ const Textarea = forwardRef(
19900
19900
  if (disabled) return;
19901
19901
  const { value: value2 } = e2.target;
19902
19902
  e2.target.value = value2.slice(0, textLimit);
19903
+ setText(e2.target.value);
19903
19904
  onChange == null ? void 0 : onChange(e2);
19904
- if (showTextCount) setCount(value2.length);
19905
19905
  },
19906
19906
  [disabled, onChange, textLimit, showTextCount]
19907
19907
  );
@@ -19928,17 +19928,19 @@ const Textarea = forwardRef(
19928
19928
  },
19929
19929
  [recipe.label, required, RequiredStar]
19930
19930
  );
19931
- const TextLengthIndicator = useCallback(
19932
- ({ count: count2, limit }) => {
19933
- return /* @__PURE__ */ jsx("span", { className: recipe.textLengthIndicator, children: `${count2}${limit ? ` / ${limit}` : ""}` });
19934
- },
19935
- [recipe.textLengthIndicator]
19936
- );
19931
+ const TextLengthIndicator = ({ count: count2, limit }) => {
19932
+ return /* @__PURE__ */ jsx("span", { className: recipe.textLengthIndicator, children: `${count2}${limit ? ` / ${limit}` : ""}` });
19933
+ };
19934
+ useEffect(() => {
19935
+ const textUpdated = value == null ? void 0 : value.toString().slice(0, textLimit);
19936
+ setText(textUpdated);
19937
+ setCount((textUpdated == null ? void 0 : textUpdated.length) || 0);
19938
+ }, [value]);
19937
19939
  return /* @__PURE__ */ jsxs(VStack2, { gap: 1, className: "group", "data-disabled": disabled || void 0, css: { width: "100%" }, children: [
19938
19940
  /* @__PURE__ */ jsx(Label2, { visible: !!(label && labelPosition === "outside"), children: label }),
19939
19941
  /* @__PURE__ */ jsxs(Stack2, { gap: 1, className: cx(recipe.inputContainer, className), onClick: handleContainerClick, css: css2, children: [
19940
19942
  /* @__PURE__ */ jsx(Label2, { visible: !!(label && labelPosition === "inside"), children: label }),
19941
- /* @__PURE__ */ jsx("textarea", { ref: inputRef, value, disabled, onChange: handleTextareaChange, ...rest }),
19943
+ /* @__PURE__ */ jsx("textarea", { ref: inputRef, value: text, disabled, onChange: handleTextareaChange, ...rest }),
19942
19944
  showTextCount && /* @__PURE__ */ jsx(TextLengthIndicator, { count, limit: textLimit })
19943
19945
  ] }),
19944
19946
  description && /* @__PURE__ */ jsx(Description2, { children: description })