@clickpalm/react 1.2.10 → 1.2.12

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;
@@ -2601,6 +2602,7 @@ interface TabItemProps {
2601
2602
  value: string;
2602
2603
  label: string;
2603
2604
  children: ReactNode;
2605
+ forceMount?: boolean;
2604
2606
  }
2605
2607
  declare const TabsItem: React.FC<TabItemProps>;
2606
2608
  declare const Tabs: React.FC<TabsProps> & {
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");
@@ -2020,8 +2023,8 @@ var Tabs2 = ({ defaultValue, colorContent, children }) => {
2020
2023
  const childrenArray = import_react11.Children.toArray(children);
2021
2024
  childrenArray.forEach((child) => {
2022
2025
  if ((0, import_react11.isValidElement)(child) && child.type === TabsItem) {
2023
- const { value, label, children: content } = child.props;
2024
- items.push({ value, label, children: content });
2026
+ const { value, label, forceMount, children: content } = child.props;
2027
+ items.push({ value, label, forceMount, children: content });
2025
2028
  }
2026
2029
  });
2027
2030
  const listRef = (0, import_react11.useRef)(null);
@@ -2110,6 +2113,7 @@ var Tabs2 = ({ defaultValue, colorContent, children }) => {
2110
2113
  {
2111
2114
  colorContent,
2112
2115
  value: item.value,
2116
+ forceMount: item.forceMount || void 0,
2113
2117
  children: item.children
2114
2118
  },
2115
2119
  `content-${item.value}`
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,
@@ -1949,8 +1952,8 @@ var Tabs2 = ({ defaultValue, colorContent, children }) => {
1949
1952
  const childrenArray = Children.toArray(children);
1950
1953
  childrenArray.forEach((child) => {
1951
1954
  if (isValidElement(child) && child.type === TabsItem) {
1952
- const { value, label, children: content } = child.props;
1953
- items.push({ value, label, children: content });
1955
+ const { value, label, forceMount, children: content } = child.props;
1956
+ items.push({ value, label, forceMount, children: content });
1954
1957
  }
1955
1958
  });
1956
1959
  const listRef = useRef4(null);
@@ -2039,6 +2042,7 @@ var Tabs2 = ({ defaultValue, colorContent, children }) => {
2039
2042
  {
2040
2043
  colorContent,
2041
2044
  value: item.value,
2045
+ forceMount: item.forceMount || void 0,
2042
2046
  children: item.children
2043
2047
  },
2044
2048
  `content-${item.value}`
@@ -2050,7 +2054,7 @@ var Tabs2 = ({ defaultValue, colorContent, children }) => {
2050
2054
  Tabs2.Item = TabsItem;
2051
2055
 
2052
2056
  // src/components/TextArea.tsx
2053
- import { forwardRef as forwardRef7 } from "react";
2057
+ import { forwardRef as forwardRef8 } from "react";
2054
2058
  import { jsx as jsx28, jsxs as jsxs11 } from "react/jsx-runtime";
2055
2059
  var Wrapper4 = styled("div", {
2056
2060
  display: "flex",
@@ -2126,7 +2130,7 @@ var Span5 = styled("span", {
2126
2130
  marginTop: "2px",
2127
2131
  marginBottom: "$6"
2128
2132
  });
2129
- var TextArea = forwardRef7(
2133
+ var TextArea = forwardRef8(
2130
2134
  ({ label, id, htmlFor, errorMessage, ...props }, ref) => {
2131
2135
  const textAreaId = id || htmlFor || `textarea-${crypto.randomUUID()}`;
2132
2136
  return /* @__PURE__ */ jsxs11(Wrapper4, { children: [
@@ -2302,7 +2306,7 @@ var Loader = ({ show, fullscreen = false }) => {
2302
2306
  Loader.displayName = "Loader";
2303
2307
 
2304
2308
  // src/components/MaskedInput/index.tsx
2305
- import { forwardRef as forwardRef8, useState as useState5, useRef as useRef5 } from "react";
2309
+ import { forwardRef as forwardRef9, useState as useState5, useRef as useRef5 } from "react";
2306
2310
 
2307
2311
  // src/components/MaskedInput/utils.ts
2308
2312
  var MAX_LENGTHS = {
@@ -2367,7 +2371,7 @@ var applyMask = (value, maskType) => {
2367
2371
 
2368
2372
  // src/components/MaskedInput/index.tsx
2369
2373
  import { jsx as jsx31 } from "react/jsx-runtime";
2370
- var MaskedInput = forwardRef8(
2374
+ var MaskedInput = forwardRef9(
2371
2375
  ({ maskType, onChange, ...props }, ref) => {
2372
2376
  const [value, setValue] = useState5("");
2373
2377
  const inputRef = useRef5(null);
@@ -2596,7 +2600,7 @@ var Paragraph = (props) => {
2596
2600
  Paragraph.displayName = "Paragraph";
2597
2601
 
2598
2602
  // src/components/Heading.tsx
2599
- import { forwardRef as forwardRef9 } from "react";
2603
+ import { forwardRef as forwardRef10 } from "react";
2600
2604
  import { jsx as jsx35 } from "react/jsx-runtime";
2601
2605
  var StyledHeading = styled("h2", {
2602
2606
  fontFamily: "$default",
@@ -2619,7 +2623,7 @@ var StyledHeading = styled("h2", {
2619
2623
  size: "md"
2620
2624
  }
2621
2625
  });
2622
- var Heading = forwardRef9(function Heading2({ children, ...props }, ref) {
2626
+ var Heading = forwardRef10(function Heading2({ children, ...props }, ref) {
2623
2627
  return /* @__PURE__ */ jsx35(StyledHeading, { ref, ...props, children });
2624
2628
  });
2625
2629
  Heading.displayName = "Heading";
@@ -2627,7 +2631,7 @@ Heading.displayName = "Heading";
2627
2631
  // src/components/Select/index.tsx
2628
2632
  import { TriangleDownIcon, TriangleUpIcon } from "@radix-ui/react-icons";
2629
2633
  import * as CustomSelect from "@radix-ui/react-select";
2630
- import { forwardRef as forwardRef10, useState as useState6 } from "react";
2634
+ import { forwardRef as forwardRef11, useState as useState6 } from "react";
2631
2635
 
2632
2636
  // src/components/Select/styles.ts
2633
2637
  import * as Select from "@radix-ui/react-select";
@@ -2748,7 +2752,7 @@ var Span6 = styled("span", {
2748
2752
 
2749
2753
  // src/components/Select/index.tsx
2750
2754
  import { jsx as jsx36, jsxs as jsxs14 } from "react/jsx-runtime";
2751
- var Select2 = forwardRef10(
2755
+ var Select2 = forwardRef11(
2752
2756
  ({
2753
2757
  value,
2754
2758
  onValueChange,
@@ -3674,7 +3678,7 @@ var CarouselItem = ({ children, style, ...props }) => /* @__PURE__ */ jsx41(Caro
3674
3678
  Carousel.Item = CarouselItem;
3675
3679
 
3676
3680
  // src/components/PasswordInput.tsx
3677
- import { forwardRef as forwardRef11, useImperativeHandle, useRef as useRef6, useState as useState9 } from "react";
3681
+ import { forwardRef as forwardRef12, useImperativeHandle as useImperativeHandle2, useRef as useRef6, useState as useState9 } from "react";
3678
3682
  import { jsx as jsx42 } from "react/jsx-runtime";
3679
3683
  var ToggleButton = styled("button", {
3680
3684
  all: "unset",
@@ -3690,11 +3694,11 @@ var ToggleButton = styled("button", {
3690
3694
  borderRadius: "$sm"
3691
3695
  }
3692
3696
  });
3693
- var PasswordInput = forwardRef11(
3697
+ var PasswordInput = forwardRef12(
3694
3698
  ({ value, onChange, ...props }, ref) => {
3695
3699
  const [visible, setVisible] = useState9(false);
3696
3700
  const innerRef = useRef6(null);
3697
- useImperativeHandle(ref, () => innerRef.current);
3701
+ useImperativeHandle2(ref, () => innerRef.current);
3698
3702
  const handleToggleVisibility = () => {
3699
3703
  setVisible((v) => !v);
3700
3704
  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.12",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/clickpalm/clickpalm-designsystem-lib.git"