@clickpalm/react 1.2.10 → 1.2.11

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
@@ -2311,8 +2311,9 @@ interface DatePickerInputProps {
2311
2311
  label: string;
2312
2312
  value?: string;
2313
2313
  onChange: (date: string) => void;
2314
+ errorMessage?: string;
2314
2315
  }
2315
- declare const Datepicker: ({ label, value, onChange }: DatePickerInputProps) => react_jsx_runtime.JSX.Element;
2316
+ declare const Datepicker: react.ForwardRefExoticComponent<DatePickerInputProps & react.RefAttributes<HTMLInputElement>>;
2316
2317
 
2317
2318
  declare const StyledHr: _stitches_react_types_styled_component.StyledComponent<"hr", {
2318
2319
  variant?: "gray" | "purple" | undefined;
package/dist/index.js CHANGED
@@ -1388,12 +1388,13 @@ var datePickerStyles = globalCss({
1388
1388
  // src/components/Datepicker/index.tsx
1389
1389
  var import_jsx_runtime20 = require("react/jsx-runtime");
1390
1390
  datePickerStyles();
1391
- var Datepicker = ({ label, value, onChange }) => {
1391
+ var Datepicker = (0, import_react6.forwardRef)(({ label, value, onChange, errorMessage }, ref) => {
1392
1392
  const [selected, setSelected] = (0, import_react6.useState)(void 0);
1393
1393
  const [month, setMonth] = (0, import_react6.useState)(/* @__PURE__ */ new Date());
1394
1394
  const [open, setOpen] = (0, import_react6.useState)(false);
1395
1395
  const inputRef = (0, import_react6.useRef)(null);
1396
1396
  const calendarRef = (0, import_react6.useRef)(null);
1397
+ (0, import_react6.useImperativeHandle)(ref, () => inputRef.current);
1397
1398
  const handleDaySelect = (date) => {
1398
1399
  setSelected(date);
1399
1400
  if (date) {
@@ -1426,7 +1427,8 @@ var Datepicker = ({ label, value, onChange }) => {
1426
1427
  onFocus: () => setOpen(true),
1427
1428
  value: value || "",
1428
1429
  readOnly: true,
1429
- suffix: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { name: "Calendar", size: 16 })
1430
+ suffix: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon, { name: "Calendar", size: 16 }),
1431
+ errorMessage
1430
1432
  }
1431
1433
  ),
1432
1434
  open && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
@@ -1471,7 +1473,8 @@ var Datepicker = ({ label, value, onChange }) => {
1471
1473
  }
1472
1474
  )
1473
1475
  ] });
1474
- };
1476
+ });
1477
+ Datepicker.displayName = "Datepicker";
1475
1478
 
1476
1479
  // src/components/Hr.tsx
1477
1480
  var import_react7 = require("react");
package/dist/index.mjs CHANGED
@@ -1115,7 +1115,7 @@ Checkbox2.displayName = "Checkbox";
1115
1115
  // src/components/Datepicker/index.tsx
1116
1116
  import { format as format2 } from "date-fns";
1117
1117
  import { ptBR as ptBR2 } from "date-fns/locale";
1118
- import { useEffect as useEffect2, useRef as useRef3, useState as useState2 } from "react";
1118
+ import { forwardRef as forwardRef4, useEffect as useEffect2, useImperativeHandle, useRef as useRef3, useState as useState2 } from "react";
1119
1119
  import { DayPicker as DayPicker2 } from "react-day-picker";
1120
1120
  import "react-day-picker/dist/style.css";
1121
1121
 
@@ -1317,12 +1317,13 @@ var datePickerStyles = globalCss({
1317
1317
  // src/components/Datepicker/index.tsx
1318
1318
  import { jsx as jsx20, jsxs as jsxs5 } from "react/jsx-runtime";
1319
1319
  datePickerStyles();
1320
- var Datepicker = ({ label, value, onChange }) => {
1320
+ var Datepicker = forwardRef4(({ label, value, onChange, errorMessage }, ref) => {
1321
1321
  const [selected, setSelected] = useState2(void 0);
1322
1322
  const [month, setMonth] = useState2(/* @__PURE__ */ new Date());
1323
1323
  const [open, setOpen] = useState2(false);
1324
1324
  const inputRef = useRef3(null);
1325
1325
  const calendarRef = useRef3(null);
1326
+ useImperativeHandle(ref, () => inputRef.current);
1326
1327
  const handleDaySelect = (date) => {
1327
1328
  setSelected(date);
1328
1329
  if (date) {
@@ -1355,7 +1356,8 @@ var Datepicker = ({ label, value, onChange }) => {
1355
1356
  onFocus: () => setOpen(true),
1356
1357
  value: value || "",
1357
1358
  readOnly: true,
1358
- suffix: /* @__PURE__ */ jsx20(Icon, { name: "Calendar", size: 16 })
1359
+ suffix: /* @__PURE__ */ jsx20(Icon, { name: "Calendar", size: 16 }),
1360
+ errorMessage
1359
1361
  }
1360
1362
  ),
1361
1363
  open && /* @__PURE__ */ jsx20(
@@ -1400,10 +1402,11 @@ var Datepicker = ({ label, value, onChange }) => {
1400
1402
  }
1401
1403
  )
1402
1404
  ] });
1403
- };
1405
+ });
1406
+ Datepicker.displayName = "Datepicker";
1404
1407
 
1405
1408
  // src/components/Hr.tsx
1406
- import { forwardRef as forwardRef4 } from "react";
1409
+ import { forwardRef as forwardRef5 } from "react";
1407
1410
  import { jsx as jsx21 } from "react/jsx-runtime";
1408
1411
  var StyledHr = styled("hr", {
1409
1412
  border: "none",
@@ -1420,7 +1423,7 @@ var StyledHr = styled("hr", {
1420
1423
  }
1421
1424
  }
1422
1425
  });
1423
- var Hr = forwardRef4(function Hr2({ children, ...props }, ref) {
1426
+ var Hr = forwardRef5(function Hr2({ children, ...props }, ref) {
1424
1427
  return /* @__PURE__ */ jsx21(StyledHr, { ref, ...props, children });
1425
1428
  });
1426
1429
  Hr.displayName = "Hr";
@@ -1576,7 +1579,7 @@ var ProgressBar = ({ label, value = 0, max = 100, ...rest }) => {
1576
1579
  ProgressBar.displayName = "ProgressBar";
1577
1580
 
1578
1581
  // src/components/Radio/index.tsx
1579
- import { forwardRef as forwardRef5 } from "react";
1582
+ import { forwardRef as forwardRef6 } from "react";
1580
1583
 
1581
1584
  // src/components/Radio/styles.ts
1582
1585
  import * as RadioGroup from "@radix-ui/react-radio-group";
@@ -1671,7 +1674,7 @@ var Span3 = styled("span", {
1671
1674
 
1672
1675
  // src/components/Radio/index.tsx
1673
1676
  import { jsx as jsx24, jsxs as jsxs8 } from "react/jsx-runtime";
1674
- var Radio = forwardRef5(({
1677
+ var Radio = forwardRef6(({
1675
1678
  labels,
1676
1679
  value,
1677
1680
  onChange,
@@ -1727,7 +1730,7 @@ var Spacing = ({ size, axis = "vertical" }) => {
1727
1730
  };
1728
1731
 
1729
1732
  // src/components/Switch/index.tsx
1730
- import { forwardRef as forwardRef6 } from "react";
1733
+ import { forwardRef as forwardRef7 } from "react";
1731
1734
 
1732
1735
  // src/components/Switch/styles.ts
1733
1736
  import * as Switch from "@radix-ui/react-switch";
@@ -1825,7 +1828,7 @@ var Span4 = styled("span", {
1825
1828
 
1826
1829
  // src/components/Switch/index.tsx
1827
1830
  import { jsx as jsx26, jsxs as jsxs9 } from "react/jsx-runtime";
1828
- var Switch2 = forwardRef6(({
1831
+ var Switch2 = forwardRef7(({
1829
1832
  label,
1830
1833
  checked,
1831
1834
  defaultChecked,
@@ -2050,7 +2053,7 @@ var Tabs2 = ({ defaultValue, colorContent, children }) => {
2050
2053
  Tabs2.Item = TabsItem;
2051
2054
 
2052
2055
  // src/components/TextArea.tsx
2053
- import { forwardRef as forwardRef7 } from "react";
2056
+ import { forwardRef as forwardRef8 } from "react";
2054
2057
  import { jsx as jsx28, jsxs as jsxs11 } from "react/jsx-runtime";
2055
2058
  var Wrapper4 = styled("div", {
2056
2059
  display: "flex",
@@ -2126,7 +2129,7 @@ var Span5 = styled("span", {
2126
2129
  marginTop: "2px",
2127
2130
  marginBottom: "$6"
2128
2131
  });
2129
- var TextArea = forwardRef7(
2132
+ var TextArea = forwardRef8(
2130
2133
  ({ label, id, htmlFor, errorMessage, ...props }, ref) => {
2131
2134
  const textAreaId = id || htmlFor || `textarea-${crypto.randomUUID()}`;
2132
2135
  return /* @__PURE__ */ jsxs11(Wrapper4, { children: [
@@ -2302,7 +2305,7 @@ var Loader = ({ show, fullscreen = false }) => {
2302
2305
  Loader.displayName = "Loader";
2303
2306
 
2304
2307
  // src/components/MaskedInput/index.tsx
2305
- import { forwardRef as forwardRef8, useState as useState5, useRef as useRef5 } from "react";
2308
+ import { forwardRef as forwardRef9, useState as useState5, useRef as useRef5 } from "react";
2306
2309
 
2307
2310
  // src/components/MaskedInput/utils.ts
2308
2311
  var MAX_LENGTHS = {
@@ -2367,7 +2370,7 @@ var applyMask = (value, maskType) => {
2367
2370
 
2368
2371
  // src/components/MaskedInput/index.tsx
2369
2372
  import { jsx as jsx31 } from "react/jsx-runtime";
2370
- var MaskedInput = forwardRef8(
2373
+ var MaskedInput = forwardRef9(
2371
2374
  ({ maskType, onChange, ...props }, ref) => {
2372
2375
  const [value, setValue] = useState5("");
2373
2376
  const inputRef = useRef5(null);
@@ -2596,7 +2599,7 @@ var Paragraph = (props) => {
2596
2599
  Paragraph.displayName = "Paragraph";
2597
2600
 
2598
2601
  // src/components/Heading.tsx
2599
- import { forwardRef as forwardRef9 } from "react";
2602
+ import { forwardRef as forwardRef10 } from "react";
2600
2603
  import { jsx as jsx35 } from "react/jsx-runtime";
2601
2604
  var StyledHeading = styled("h2", {
2602
2605
  fontFamily: "$default",
@@ -2619,7 +2622,7 @@ var StyledHeading = styled("h2", {
2619
2622
  size: "md"
2620
2623
  }
2621
2624
  });
2622
- var Heading = forwardRef9(function Heading2({ children, ...props }, ref) {
2625
+ var Heading = forwardRef10(function Heading2({ children, ...props }, ref) {
2623
2626
  return /* @__PURE__ */ jsx35(StyledHeading, { ref, ...props, children });
2624
2627
  });
2625
2628
  Heading.displayName = "Heading";
@@ -2627,7 +2630,7 @@ Heading.displayName = "Heading";
2627
2630
  // src/components/Select/index.tsx
2628
2631
  import { TriangleDownIcon, TriangleUpIcon } from "@radix-ui/react-icons";
2629
2632
  import * as CustomSelect from "@radix-ui/react-select";
2630
- import { forwardRef as forwardRef10, useState as useState6 } from "react";
2633
+ import { forwardRef as forwardRef11, useState as useState6 } from "react";
2631
2634
 
2632
2635
  // src/components/Select/styles.ts
2633
2636
  import * as Select from "@radix-ui/react-select";
@@ -2748,7 +2751,7 @@ var Span6 = styled("span", {
2748
2751
 
2749
2752
  // src/components/Select/index.tsx
2750
2753
  import { jsx as jsx36, jsxs as jsxs14 } from "react/jsx-runtime";
2751
- var Select2 = forwardRef10(
2754
+ var Select2 = forwardRef11(
2752
2755
  ({
2753
2756
  value,
2754
2757
  onValueChange,
@@ -3674,7 +3677,7 @@ var CarouselItem = ({ children, style, ...props }) => /* @__PURE__ */ jsx41(Caro
3674
3677
  Carousel.Item = CarouselItem;
3675
3678
 
3676
3679
  // src/components/PasswordInput.tsx
3677
- import { forwardRef as forwardRef11, useImperativeHandle, useRef as useRef6, useState as useState9 } from "react";
3680
+ import { forwardRef as forwardRef12, useImperativeHandle as useImperativeHandle2, useRef as useRef6, useState as useState9 } from "react";
3678
3681
  import { jsx as jsx42 } from "react/jsx-runtime";
3679
3682
  var ToggleButton = styled("button", {
3680
3683
  all: "unset",
@@ -3690,11 +3693,11 @@ var ToggleButton = styled("button", {
3690
3693
  borderRadius: "$sm"
3691
3694
  }
3692
3695
  });
3693
- var PasswordInput = forwardRef11(
3696
+ var PasswordInput = forwardRef12(
3694
3697
  ({ value, onChange, ...props }, ref) => {
3695
3698
  const [visible, setVisible] = useState9(false);
3696
3699
  const innerRef = useRef6(null);
3697
- useImperativeHandle(ref, () => innerRef.current);
3700
+ useImperativeHandle2(ref, () => innerRef.current);
3698
3701
  const handleToggleVisibility = () => {
3699
3702
  setVisible((v) => !v);
3700
3703
  setTimeout(() => {
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.2.10",
6
+ "version": "1.2.11",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/clickpalm/clickpalm-designsystem-lib.git"