@clickpalm/react 1.3.6 → 1.3.7
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 +4 -1
- package/dist/index.mjs +7 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2564,7 +2564,10 @@ var CharCounter2 = styled(Span5, {
|
|
|
2564
2564
|
var TextArea = (0, import_react13.forwardRef)(
|
|
2565
2565
|
({ label, id, htmlFor, errorMessage, maxLength, showCounter = false, ...props }, ref) => {
|
|
2566
2566
|
const textAreaId = id || htmlFor || `textarea-${crypto.randomUUID()}`;
|
|
2567
|
-
const [charCount, setCharCount] = (0, import_react13.useState)(0);
|
|
2567
|
+
const [charCount, setCharCount] = (0, import_react13.useState)(props.value?.toString().length || 0);
|
|
2568
|
+
(0, import_react13.useEffect)(() => {
|
|
2569
|
+
setCharCount(props.value?.toString().length || 0);
|
|
2570
|
+
}, [props.value]);
|
|
2568
2571
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Wrapper4, { children: [
|
|
2569
2572
|
label && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(StyledLabel2, { htmlFor: textAreaId, children: label }),
|
|
2570
2573
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
package/dist/index.mjs
CHANGED
|
@@ -2384,7 +2384,7 @@ var Tabs2 = ({ defaultValue, colorContent, children, value, onValueChange }) =>
|
|
|
2384
2384
|
Tabs2.Item = TabsItem;
|
|
2385
2385
|
|
|
2386
2386
|
// src/components/TextArea.tsx
|
|
2387
|
-
import { forwardRef as forwardRef8, useState as useState7 } from "react";
|
|
2387
|
+
import { forwardRef as forwardRef8, useEffect as useEffect6, useState as useState7 } from "react";
|
|
2388
2388
|
import { jsx as jsx30, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2389
2389
|
var Wrapper4 = styled("div", {
|
|
2390
2390
|
display: "flex",
|
|
@@ -2494,7 +2494,10 @@ var CharCounter2 = styled(Span5, {
|
|
|
2494
2494
|
var TextArea = forwardRef8(
|
|
2495
2495
|
({ label, id, htmlFor, errorMessage, maxLength, showCounter = false, ...props }, ref) => {
|
|
2496
2496
|
const textAreaId = id || htmlFor || `textarea-${crypto.randomUUID()}`;
|
|
2497
|
-
const [charCount, setCharCount] = useState7(0);
|
|
2497
|
+
const [charCount, setCharCount] = useState7(props.value?.toString().length || 0);
|
|
2498
|
+
useEffect6(() => {
|
|
2499
|
+
setCharCount(props.value?.toString().length || 0);
|
|
2500
|
+
}, [props.value]);
|
|
2498
2501
|
return /* @__PURE__ */ jsxs12(Wrapper4, { children: [
|
|
2499
2502
|
label && /* @__PURE__ */ jsx30(StyledLabel2, { htmlFor: textAreaId, children: label }),
|
|
2500
2503
|
/* @__PURE__ */ jsx30(
|
|
@@ -2578,7 +2581,7 @@ var TooltipArrow = styled(RadixTooltip.Arrow, {
|
|
|
2578
2581
|
});
|
|
2579
2582
|
|
|
2580
2583
|
// src/components/Tooltip/index.tsx
|
|
2581
|
-
import { useState as useState8, useEffect as
|
|
2584
|
+
import { useState as useState8, useEffect as useEffect7 } from "react";
|
|
2582
2585
|
import { jsx as jsx31, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2583
2586
|
var Tooltip = ({
|
|
2584
2587
|
content,
|
|
@@ -2591,7 +2594,7 @@ var Tooltip = ({
|
|
|
2591
2594
|
}) => {
|
|
2592
2595
|
const [uncontrolledOpen, setUncontrolledOpen] = useState8(false);
|
|
2593
2596
|
const [isTouchDevice, setIsTouchDevice] = useState8(false);
|
|
2594
|
-
|
|
2597
|
+
useEffect7(() => {
|
|
2595
2598
|
setIsTouchDevice("ontouchstart" in window || navigator.maxTouchPoints > 0);
|
|
2596
2599
|
}, []);
|
|
2597
2600
|
const open = controlledOpen ?? uncontrolledOpen;
|
package/package.json
CHANGED