@clickpalm/react 1.3.0 → 1.3.1

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.d.ts CHANGED
@@ -3058,6 +3058,7 @@ interface TextAreaProps extends ComponentPropsWithoutRef<'textarea'>, VariantPro
3058
3058
  htmlFor?: string;
3059
3059
  errorMessage?: string;
3060
3060
  maxLength?: number;
3061
+ showCounter?: boolean;
3061
3062
  }
3062
3063
  declare const TextArea: react.ForwardRefExoticComponent<TextAreaProps & react.RefAttributes<HTMLTextAreaElement>>;
3063
3064
 
@@ -3088,6 +3089,7 @@ interface TextInputProps extends InputHTMLAttributes<HTMLInputElement> {
3088
3089
  noMargin?: boolean;
3089
3090
  errorMessage?: string;
3090
3091
  maxLength?: number;
3092
+ showCounter?: boolean;
3091
3093
  }
3092
3094
  declare const Input: react__default.ForwardRefExoticComponent<TextInputProps & react__default.RefAttributes<HTMLInputElement>>;
3093
3095
 
package/dist/index.js CHANGED
@@ -1312,7 +1312,7 @@ var CharCounter = styled(Span2, {
1312
1312
  whiteSpace: "nowrap",
1313
1313
  paddingRight: "1px",
1314
1314
  marginTop: "2px",
1315
- marginBottom: "$6",
1315
+ marginBottom: "0px",
1316
1316
  variants: {
1317
1317
  hasReachedMax: {
1318
1318
  true: {
@@ -1325,7 +1325,7 @@ var CharCounter = styled(Span2, {
1325
1325
  // src/components/Input/index.tsx
1326
1326
  var import_jsx_runtime19 = require("react/jsx-runtime");
1327
1327
  var Input2 = (0, import_react5.forwardRef)(
1328
- ({ prefix, suffix, label, maxLength, errorMessage, noMargin = false, ...props }, forwardedRef) => {
1328
+ ({ prefix, suffix, label, maxLength, showCounter = false, errorMessage, noMargin = false, ...props }, forwardedRef) => {
1329
1329
  const [charCount, setCharCount] = (0, import_react5.useState)(0);
1330
1330
  const localInputRef = (0, import_react5.useRef)(null);
1331
1331
  const inputRef = forwardedRef || localInputRef;
@@ -1346,7 +1346,7 @@ var Input2 = (0, import_react5.forwardRef)(
1346
1346
  hasButtonSuffix: isButtonElement(suffix),
1347
1347
  noMargin,
1348
1348
  hasError: !!errorMessage,
1349
- hasCounter: !!maxLength,
1349
+ hasCounter: showCounter,
1350
1350
  onClick: handleContainerClick,
1351
1351
  children: [
1352
1352
  !!prefix && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Prefix, { children: prefix }),
@@ -1370,7 +1370,7 @@ var Input2 = (0, import_react5.forwardRef)(
1370
1370
  ),
1371
1371
  /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Footer, { children: [
1372
1372
  errorMessage && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Span2, { children: errorMessage }),
1373
- maxLength && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(CharCounter, { hasReachedMax: maxLength ? charCount >= maxLength : false, children: [
1373
+ showCounter && maxLength && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(CharCounter, { hasReachedMax: maxLength ? charCount >= maxLength : false, children: [
1374
1374
  charCount,
1375
1375
  "/",
1376
1376
  maxLength
@@ -2502,7 +2502,7 @@ var CharCounter2 = styled(Span5, {
2502
2502
  whiteSpace: "nowrap",
2503
2503
  paddingRight: "1px",
2504
2504
  marginTop: "2px",
2505
- marginBottom: "$6",
2505
+ marginBottom: "0px",
2506
2506
  variants: {
2507
2507
  hasReachedMax: {
2508
2508
  true: {
@@ -2512,7 +2512,7 @@ var CharCounter2 = styled(Span5, {
2512
2512
  }
2513
2513
  });
2514
2514
  var TextArea = (0, import_react13.forwardRef)(
2515
- ({ label, id, htmlFor, errorMessage, maxLength, ...props }, ref) => {
2515
+ ({ label, id, htmlFor, errorMessage, maxLength, showCounter = false, ...props }, ref) => {
2516
2516
  const textAreaId = id || htmlFor || `textarea-${crypto.randomUUID()}`;
2517
2517
  const [charCount, setCharCount] = (0, import_react13.useState)(0);
2518
2518
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Wrapper4, { children: [
@@ -2523,7 +2523,7 @@ var TextArea = (0, import_react13.forwardRef)(
2523
2523
  id: textAreaId,
2524
2524
  ...props,
2525
2525
  hasError: !!errorMessage,
2526
- hasCounter: !!maxLength,
2526
+ hasCounter: showCounter,
2527
2527
  ref,
2528
2528
  maxLength,
2529
2529
  onChange: (e) => {
@@ -2536,7 +2536,7 @@ var TextArea = (0, import_react13.forwardRef)(
2536
2536
  ),
2537
2537
  /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Footer2, { children: [
2538
2538
  errorMessage && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Span5, { children: errorMessage }),
2539
- maxLength && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(CharCounter2, { hasReachedMax: maxLength ? charCount >= maxLength : false, children: [
2539
+ showCounter && maxLength && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(CharCounter2, { hasReachedMax: maxLength ? charCount >= maxLength : false, children: [
2540
2540
  charCount,
2541
2541
  "/",
2542
2542
  maxLength
package/dist/index.mjs CHANGED
@@ -1242,7 +1242,7 @@ var CharCounter = styled(Span2, {
1242
1242
  whiteSpace: "nowrap",
1243
1243
  paddingRight: "1px",
1244
1244
  marginTop: "2px",
1245
- marginBottom: "$6",
1245
+ marginBottom: "0px",
1246
1246
  variants: {
1247
1247
  hasReachedMax: {
1248
1248
  true: {
@@ -1255,7 +1255,7 @@ var CharCounter = styled(Span2, {
1255
1255
  // src/components/Input/index.tsx
1256
1256
  import { jsx as jsx19, jsxs as jsxs4 } from "react/jsx-runtime";
1257
1257
  var Input2 = forwardRef3(
1258
- ({ prefix, suffix, label, maxLength, errorMessage, noMargin = false, ...props }, forwardedRef) => {
1258
+ ({ prefix, suffix, label, maxLength, showCounter = false, errorMessage, noMargin = false, ...props }, forwardedRef) => {
1259
1259
  const [charCount, setCharCount] = useState2(0);
1260
1260
  const localInputRef = useRef2(null);
1261
1261
  const inputRef = forwardedRef || localInputRef;
@@ -1276,7 +1276,7 @@ var Input2 = forwardRef3(
1276
1276
  hasButtonSuffix: isButtonElement(suffix),
1277
1277
  noMargin,
1278
1278
  hasError: !!errorMessage,
1279
- hasCounter: !!maxLength,
1279
+ hasCounter: showCounter,
1280
1280
  onClick: handleContainerClick,
1281
1281
  children: [
1282
1282
  !!prefix && /* @__PURE__ */ jsx19(Prefix, { children: prefix }),
@@ -1300,7 +1300,7 @@ var Input2 = forwardRef3(
1300
1300
  ),
1301
1301
  /* @__PURE__ */ jsxs4(Footer, { children: [
1302
1302
  errorMessage && /* @__PURE__ */ jsx19(Span2, { children: errorMessage }),
1303
- maxLength && /* @__PURE__ */ jsxs4(CharCounter, { hasReachedMax: maxLength ? charCount >= maxLength : false, children: [
1303
+ showCounter && maxLength && /* @__PURE__ */ jsxs4(CharCounter, { hasReachedMax: maxLength ? charCount >= maxLength : false, children: [
1304
1304
  charCount,
1305
1305
  "/",
1306
1306
  maxLength
@@ -2432,7 +2432,7 @@ var CharCounter2 = styled(Span5, {
2432
2432
  whiteSpace: "nowrap",
2433
2433
  paddingRight: "1px",
2434
2434
  marginTop: "2px",
2435
- marginBottom: "$6",
2435
+ marginBottom: "0px",
2436
2436
  variants: {
2437
2437
  hasReachedMax: {
2438
2438
  true: {
@@ -2442,7 +2442,7 @@ var CharCounter2 = styled(Span5, {
2442
2442
  }
2443
2443
  });
2444
2444
  var TextArea = forwardRef8(
2445
- ({ label, id, htmlFor, errorMessage, maxLength, ...props }, ref) => {
2445
+ ({ label, id, htmlFor, errorMessage, maxLength, showCounter = false, ...props }, ref) => {
2446
2446
  const textAreaId = id || htmlFor || `textarea-${crypto.randomUUID()}`;
2447
2447
  const [charCount, setCharCount] = useState7(0);
2448
2448
  return /* @__PURE__ */ jsxs12(Wrapper4, { children: [
@@ -2453,7 +2453,7 @@ var TextArea = forwardRef8(
2453
2453
  id: textAreaId,
2454
2454
  ...props,
2455
2455
  hasError: !!errorMessage,
2456
- hasCounter: !!maxLength,
2456
+ hasCounter: showCounter,
2457
2457
  ref,
2458
2458
  maxLength,
2459
2459
  onChange: (e) => {
@@ -2466,7 +2466,7 @@ var TextArea = forwardRef8(
2466
2466
  ),
2467
2467
  /* @__PURE__ */ jsxs12(Footer2, { children: [
2468
2468
  errorMessage && /* @__PURE__ */ jsx30(Span5, { children: errorMessage }),
2469
- maxLength && /* @__PURE__ */ jsxs12(CharCounter2, { hasReachedMax: maxLength ? charCount >= maxLength : false, children: [
2469
+ showCounter && maxLength && /* @__PURE__ */ jsxs12(CharCounter2, { hasReachedMax: maxLength ? charCount >= maxLength : false, children: [
2470
2470
  charCount,
2471
2471
  "/",
2472
2472
  maxLength
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Design System da Clikpalm",
4
4
  "author": "Enisson Shilo",
5
5
  "license": "MIT",
6
- "version": "1.3.0",
6
+ "version": "1.3.1",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/clickpalm/clickpalm-designsystem-lib.git"