@koaris/bloom-ui 1.0.4 → 1.0.5

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.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import { DetailedHTMLProps, HTMLAttributes, ButtonHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, ReactNode, FormHTMLAttributes } from 'react';
3
+ import { DetailedHTMLProps, HTMLAttributes, ButtonHTMLAttributes, AnchorHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, ReactNode, FormHTMLAttributes } from 'react';
4
4
 
5
5
  /**
6
6
  * Primary UI component for user interaction
@@ -28,6 +28,17 @@ interface ButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonE
28
28
  }
29
29
  declare const Button: ({ className, variant, size, disabled, onClick, ...rest }: ButtonProps) => react_jsx_runtime.JSX.Element;
30
30
 
31
+ /**
32
+ * Primary UI component for user interaction
33
+ */
34
+ interface LinkProps extends DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> {
35
+ url: string;
36
+ newPage: boolean;
37
+ disabled?: boolean;
38
+ children: string | JSX.Element;
39
+ }
40
+ declare const Link: ({ className, disabled, url, newPage, onClick, ...rest }: LinkProps) => react_jsx_runtime.JSX.Element;
41
+
31
42
  declare const options: {
32
43
  id: number;
33
44
  value: string;
@@ -58,7 +69,7 @@ interface InputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElem
58
69
  required?: boolean;
59
70
  type: 'text' | 'password' | 'date' | 'cpf' | 'phone' | 'cnpj' | 'cep';
60
71
  }
61
- declare const Input: ({ className, disabled, placeholder, value, validated, error, required, type, onClick, ...rest }: InputProps) => react_jsx_runtime.JSX.Element;
72
+ declare const Input: react.ForwardRefExoticComponent<Omit<InputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
62
73
 
63
74
  interface TextInputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
64
75
  disabled?: boolean;
@@ -129,4 +140,4 @@ interface MultiStepProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement
129
140
  }
130
141
  declare const MultiStep: ({ className, size, currentStep }: MultiStepProps) => react_jsx_runtime.JSX.Element;
131
142
 
132
- export { Avatar, type AvatarProps, Box, type BoxProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, Form, type FormProps, Heading, type HeadingProps, Input, type InputProps, MultiStep, type MultiStepProps, RadioGroup, type RadioGroupProps, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextProps };
143
+ export { Avatar, type AvatarProps, Box, type BoxProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, Form, type FormProps, Heading, type HeadingProps, Input, type InputProps, Link, type LinkProps, MultiStep, type MultiStepProps, RadioGroup, type RadioGroupProps, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextProps };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
- import { DetailedHTMLProps, HTMLAttributes, ButtonHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, ReactNode, FormHTMLAttributes } from 'react';
3
+ import { DetailedHTMLProps, HTMLAttributes, ButtonHTMLAttributes, AnchorHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, ReactNode, FormHTMLAttributes } from 'react';
4
4
 
5
5
  /**
6
6
  * Primary UI component for user interaction
@@ -28,6 +28,17 @@ interface ButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonE
28
28
  }
29
29
  declare const Button: ({ className, variant, size, disabled, onClick, ...rest }: ButtonProps) => react_jsx_runtime.JSX.Element;
30
30
 
31
+ /**
32
+ * Primary UI component for user interaction
33
+ */
34
+ interface LinkProps extends DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> {
35
+ url: string;
36
+ newPage: boolean;
37
+ disabled?: boolean;
38
+ children: string | JSX.Element;
39
+ }
40
+ declare const Link: ({ className, disabled, url, newPage, onClick, ...rest }: LinkProps) => react_jsx_runtime.JSX.Element;
41
+
31
42
  declare const options: {
32
43
  id: number;
33
44
  value: string;
@@ -58,7 +69,7 @@ interface InputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElem
58
69
  required?: boolean;
59
70
  type: 'text' | 'password' | 'date' | 'cpf' | 'phone' | 'cnpj' | 'cep';
60
71
  }
61
- declare const Input: ({ className, disabled, placeholder, value, validated, error, required, type, onClick, ...rest }: InputProps) => react_jsx_runtime.JSX.Element;
72
+ declare const Input: react.ForwardRefExoticComponent<Omit<InputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
62
73
 
63
74
  interface TextInputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
64
75
  disabled?: boolean;
@@ -129,4 +140,4 @@ interface MultiStepProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement
129
140
  }
130
141
  declare const MultiStep: ({ className, size, currentStep }: MultiStepProps) => react_jsx_runtime.JSX.Element;
131
142
 
132
- export { Avatar, type AvatarProps, Box, type BoxProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, Form, type FormProps, Heading, type HeadingProps, Input, type InputProps, MultiStep, type MultiStepProps, RadioGroup, type RadioGroupProps, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextProps };
143
+ export { Avatar, type AvatarProps, Box, type BoxProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, Form, type FormProps, Heading, type HeadingProps, Input, type InputProps, Link, type LinkProps, MultiStep, type MultiStepProps, RadioGroup, type RadioGroupProps, Text, TextArea, type TextAreaProps, TextInput, type TextInputProps, type TextProps };
package/dist/index.js CHANGED
@@ -57,6 +57,7 @@ __export(src_exports, {
57
57
  Form: () => Form,
58
58
  Heading: () => Heading,
59
59
  Input: () => Input,
60
+ Link: () => Link,
60
61
  MultiStep: () => MultiStep,
61
62
  RadioGroup: () => RadioGroup,
62
63
  Text: () => Text,
@@ -425,6 +426,7 @@ var fractionRegex = /^\d+\/\d+$/;
425
426
  var stringLengths = /* @__PURE__ */ new Set(["px", "full", "screen"]);
426
427
  var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
427
428
  var lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
429
+ var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/;
428
430
  var shadowRegex = /^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
429
431
  var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
430
432
  function isLength(value) {
@@ -479,7 +481,7 @@ function getIsArbitraryValue(value, label, testValue) {
479
481
  return false;
480
482
  }
481
483
  function isLengthOnly(value) {
482
- return lengthUnitRegex.test(value);
484
+ return lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);
483
485
  }
484
486
  function isNever() {
485
487
  return false;
@@ -2611,9 +2613,9 @@ var Button = (_a) => {
2611
2613
  "button",
2612
2614
  __spreadValues({
2613
2615
  className: twMerge(
2614
- "flex items-center justify-center rounded-lg px-8 py-2 text-md font-medium hover:shadow-md hover:shadow-neutral-500 w-full",
2616
+ "flex gap-4 items-center justify-center rounded-sm px-8 py-2 text-md font-medium hover:shadow-md hover:shadow-neutral-500 w-full",
2615
2617
  variant === "primary" && "bg-orange-500 text-neutral hover:bg-orange-700",
2616
- variant === "secondary" && "bg-neutral text-orange-500 border border-orange-500 hover:bg-neutral-200",
2618
+ variant === "secondary" && "bg-neutral text-orange-500 border border-orange-500 hover:text-orange-100 hover:bg-orange-500",
2617
2619
  size === "sm" && "px-6 py-1",
2618
2620
  typeof rest.children !== "string" && "px-4",
2619
2621
  disabled === true && "opacity-50 cursor-not-allowed",
@@ -2624,10 +2626,40 @@ var Button = (_a) => {
2624
2626
  );
2625
2627
  };
2626
2628
 
2629
+ // src/components/Link/index.tsx
2630
+ var import_jsx_runtime3 = require("react/jsx-runtime");
2631
+ var Link = (_a) => {
2632
+ var _b = _a, {
2633
+ className,
2634
+ disabled,
2635
+ url,
2636
+ newPage = true,
2637
+ onClick
2638
+ } = _b, rest = __objRest(_b, [
2639
+ "className",
2640
+ "disabled",
2641
+ "url",
2642
+ "newPage",
2643
+ "onClick"
2644
+ ]);
2645
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
2646
+ "a",
2647
+ __spreadValues(__spreadValues({
2648
+ className: twMerge(
2649
+ "text-blue-800 font-bold",
2650
+ typeof rest.children !== "string" && "px-4",
2651
+ disabled === true && "opacity-50 cursor-not-allowed",
2652
+ className
2653
+ ),
2654
+ href: url
2655
+ }, newPage && { target: "_blank", rel: "noopener noreferrer" }), rest)
2656
+ );
2657
+ };
2658
+
2627
2659
  // src/components/RadioGroup/index.tsx
2628
2660
  var import_react = require("react");
2629
2661
  var import_fi = require("react-icons/fi");
2630
- var import_jsx_runtime3 = require("react/jsx-runtime");
2662
+ var import_jsx_runtime4 = require("react/jsx-runtime");
2631
2663
  var RadioGroup = ({
2632
2664
  disabled,
2633
2665
  options = [
@@ -2641,8 +2673,8 @@ var RadioGroup = ({
2641
2673
  const handleOptionChange = (value) => {
2642
2674
  setSelectedOption(value);
2643
2675
  };
2644
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "flex flex-col ", children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex py-2 items-center", children: [
2645
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
2676
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex flex-col ", children: options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex py-2 items-center", children: [
2677
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
2646
2678
  "label",
2647
2679
  {
2648
2680
  htmlFor: `radio${option.id}`,
@@ -2653,7 +2685,7 @@ var RadioGroup = ({
2653
2685
  className
2654
2686
  ),
2655
2687
  children: [
2656
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
2688
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2657
2689
  "input",
2658
2690
  {
2659
2691
  type: "radio",
@@ -2667,24 +2699,24 @@ var RadioGroup = ({
2667
2699
  disabled
2668
2700
  }
2669
2701
  ),
2670
- selectedOption === option.value && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_fi.FiCheck, { color: "#FFFFFF", size: 12, style: { strokeWidth: 4 } })
2702
+ selectedOption === option.value && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_fi.FiCheck, { color: "#FFFFFF", size: 12, style: { strokeWidth: 4 } })
2671
2703
  ]
2672
2704
  }
2673
2705
  ),
2674
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "px-2", children: option.label })
2706
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "px-2", children: option.label })
2675
2707
  ] }, option.id)) });
2676
2708
  };
2677
2709
 
2678
2710
  // src/components/Checkbox/index.tsx
2679
2711
  var import_react2 = require("react");
2680
2712
  var import_fi2 = require("react-icons/fi");
2681
- var import_jsx_runtime4 = require("react/jsx-runtime");
2713
+ var import_jsx_runtime5 = require("react/jsx-runtime");
2682
2714
  var Checkbox = ({ className, required, disabled }) => {
2683
2715
  const [selected, setSelected] = (0, import_react2.useState)(false);
2684
2716
  const handleCheckboxChange = (value) => {
2685
2717
  setSelected(!value);
2686
2718
  };
2687
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex items-center justify-center px-2", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
2719
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex items-center justify-center px-2", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
2688
2720
  "label",
2689
2721
  {
2690
2722
  className: twMerge(
@@ -2694,7 +2726,7 @@ var Checkbox = ({ className, required, disabled }) => {
2694
2726
  disabled === true && "opacity-50 cursor-not-allowed"
2695
2727
  ),
2696
2728
  children: [
2697
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
2729
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2698
2730
  "input",
2699
2731
  {
2700
2732
  type: "checkbox",
@@ -2708,7 +2740,7 @@ var Checkbox = ({ className, required, disabled }) => {
2708
2740
  )
2709
2741
  }
2710
2742
  ),
2711
- selected && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_fi2.FiCheck, { color: "#FFFFFF", size: 14, style: { strokeWidth: 4 } })
2743
+ selected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_fi2.FiCheck, { color: "#FFFFFF", size: 14, style: { strokeWidth: 4 } })
2712
2744
  ]
2713
2745
  }
2714
2746
  ) });
@@ -2780,65 +2812,102 @@ var masks = {
2780
2812
  var masks_default = masks;
2781
2813
 
2782
2814
  // src/components/Input/index.tsx
2783
- var import_jsx_runtime5 = require("react/jsx-runtime");
2784
- var Input = (_a) => {
2785
- var _b = _a, {
2786
- className,
2787
- disabled,
2788
- placeholder,
2789
- value,
2790
- validated,
2791
- error,
2792
- required,
2793
- type,
2794
- onClick
2795
- } = _b, rest = __objRest(_b, [
2796
- "className",
2797
- "disabled",
2798
- "placeholder",
2799
- "value",
2800
- "validated",
2801
- "error",
2802
- "required",
2803
- "type",
2804
- "onClick"
2805
- ]);
2806
- const [selected, setSelected] = (0, import_react3.useState)(false);
2807
- const [inputValue, setInputValue] = (0, import_react3.useState)(value);
2808
- const [hasNumber, setHasNumber] = (0, import_react3.useState)(false);
2809
- const [hasSpecialCharacteres, setHasSpecialCharacteres] = (0, import_react3.useState)(false);
2810
- const [hasEightCharacteres, setHasEightCharacteres] = (0, import_react3.useState)(false);
2811
- const handleFocus = () => {
2812
- setSelected(!selected);
2813
- };
2814
- const handleBlur = () => {
2815
- setSelected(false);
2816
- };
2817
- const handleInput = (event) => {
2818
- setInputValue(event.currentTarget.value);
2819
- checkPassword(event.currentTarget.value);
2820
- };
2821
- (0, import_react3.useEffect)(() => {
2822
- setInputValue(value);
2823
- }, [value]);
2824
- const checkPassword = (value2) => {
2825
- setHasSpecialCharacteres((value2 == null ? void 0 : value2.match(masks_default.password[0])) !== null);
2826
- setHasNumber((value2 == null ? void 0 : value2.match(masks_default.password[1])) !== null);
2827
- setHasEightCharacteres((value2 == null ? void 0 : value2.match(masks_default.password[2])) !== null);
2828
- };
2829
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
2830
- type === "text" || type === "password" || type === "date" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
2831
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2815
+ var import_jsx_runtime6 = require("react/jsx-runtime");
2816
+ var Input = (0, import_react3.forwardRef)(
2817
+ (_a, ref) => {
2818
+ var _b = _a, {
2819
+ className,
2820
+ disabled,
2821
+ placeholder,
2822
+ value,
2823
+ validated,
2824
+ error,
2825
+ required,
2826
+ type,
2827
+ onClick
2828
+ } = _b, rest = __objRest(_b, [
2829
+ "className",
2830
+ "disabled",
2831
+ "placeholder",
2832
+ "value",
2833
+ "validated",
2834
+ "error",
2835
+ "required",
2836
+ "type",
2837
+ "onClick"
2838
+ ]);
2839
+ const [selected, setSelected] = (0, import_react3.useState)(false);
2840
+ const [inputValue, setInputValue] = (0, import_react3.useState)(value);
2841
+ const [hasNumber, setHasNumber] = (0, import_react3.useState)(false);
2842
+ const [hasSpecialCharacteres, setHasSpecialCharacteres] = (0, import_react3.useState)(false);
2843
+ const [hasEightCharacteres, setHasEightCharacteres] = (0, import_react3.useState)(false);
2844
+ const handleFocus = () => {
2845
+ setSelected(!selected);
2846
+ };
2847
+ const handleBlur = () => {
2848
+ setSelected(false);
2849
+ };
2850
+ const handleInput = (event) => {
2851
+ setInputValue(event.currentTarget.value);
2852
+ checkPassword(event.currentTarget.value);
2853
+ };
2854
+ (0, import_react3.useEffect)(() => {
2855
+ setInputValue(value);
2856
+ }, [value]);
2857
+ const checkPassword = (value2) => {
2858
+ setHasSpecialCharacteres((value2 == null ? void 0 : value2.match(masks_default.password[0])) !== null);
2859
+ setHasNumber((value2 == null ? void 0 : value2.match(masks_default.password[1])) !== null);
2860
+ setHasEightCharacteres((value2 == null ? void 0 : value2.match(masks_default.password[2])) !== null);
2861
+ };
2862
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
2863
+ type === "text" || type === "password" || type === "date" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
2864
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2865
+ "input",
2866
+ __spreadValues({
2867
+ type,
2868
+ required,
2869
+ ref,
2870
+ className: twMerge(
2871
+ "flex items-center justify-center border-2 border-neutral rounded-sm w-full px-3 py-2 text-md hover:shadow-md hover:shadow-neutral-500 focus:outline-none",
2872
+ className,
2873
+ disabled === true && "opacity-50 cursor-not-allowed",
2874
+ selected === true && "border-2 border-orange-500",
2875
+ validated === true && "border-2 border-green-900",
2876
+ error === true && "border-2 border-red-900"
2877
+ ),
2878
+ onClick,
2879
+ onFocus: handleFocus,
2880
+ onChange: handleInput,
2881
+ onBlur: handleBlur,
2882
+ placeholder,
2883
+ value: inputValue
2884
+ }, rest)
2885
+ ),
2886
+ type === "password" && (!hasEightCharacteres || !hasSpecialCharacteres || !hasNumber) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("ul", { className: "py-1", children: [
2887
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("li", { className: "flex items-center px-2", children: [
2888
+ hasEightCharacteres ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_fi3.FiCheck, {}) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_fi3.FiX, {}),
2889
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "px-1", children: "Pelo menos 8 caracteres" })
2890
+ ] }),
2891
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("li", { className: "flex items-center px-2", children: [
2892
+ hasSpecialCharacteres ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_fi3.FiCheck, {}) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_fi3.FiX, {}),
2893
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "px-1", children: "Pelo menos 1 s\xEDmbolo (@, !, $, etc)" })
2894
+ ] }),
2895
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("li", { className: "flex items-center px-2", children: [
2896
+ hasNumber ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_fi3.FiCheck, {}) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_fi3.FiX, {}),
2897
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "px-1", children: "Deve conter 1 n\xFAmero" })
2898
+ ] })
2899
+ ] })
2900
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2832
2901
  "input",
2833
2902
  __spreadValues({
2834
2903
  type,
2835
2904
  required,
2905
+ ref,
2836
2906
  className: twMerge(
2837
2907
  "flex items-center justify-center border-2 border-neutral rounded-sm w-full px-3 py-2 text-md hover:shadow-md hover:shadow-neutral-500 focus:outline-none",
2838
2908
  className,
2839
2909
  disabled === true && "opacity-50 cursor-not-allowed",
2840
2910
  selected === true && "border-2 border-orange-500",
2841
- validated === true && "border-2 border-green-900",
2842
2911
  error === true && "border-2 border-red-900"
2843
2912
  ),
2844
2913
  onClick,
@@ -2849,47 +2918,15 @@ var Input = (_a) => {
2849
2918
  value: inputValue
2850
2919
  }, rest)
2851
2920
  ),
2852
- type === "password" && (!hasEightCharacteres || !hasSpecialCharacteres || !hasNumber) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("ul", { className: "py-1", children: [
2853
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("li", { className: "flex items-center px-2", children: [
2854
- hasEightCharacteres ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_fi3.FiCheck, {}) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_fi3.FiX, {}),
2855
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "px-1", children: "Pelo menos 8 caracteres" })
2856
- ] }),
2857
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("li", { className: "flex items-center px-2", children: [
2858
- hasSpecialCharacteres ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_fi3.FiCheck, {}) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_fi3.FiX, {}),
2859
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "px-1", children: "Pelo menos 1 s\xEDmbolo (@, !, $, etc)" })
2860
- ] }),
2861
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("li", { className: "flex items-center px-2", children: [
2862
- hasNumber ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_fi3.FiCheck, {}) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_fi3.FiX, {}),
2863
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "px-1", children: "Deve conter 1 n\xFAmero" })
2864
- ] })
2865
- ] })
2866
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
2867
- "input",
2868
- __spreadValues({
2869
- type,
2870
- required,
2871
- className: twMerge(
2872
- "flex items-center justify-center border-2 border-neutral rounded-sm w-full px-3 py-2 text-md hover:shadow-md hover:shadow-neutral-500 focus:outline-none",
2873
- className,
2874
- disabled === true && "opacity-50 cursor-not-allowed",
2875
- selected === true && "border-2 border-orange-500",
2876
- error === true && "border-2 border-red-900"
2877
- ),
2878
- onClick,
2879
- onFocus: handleFocus,
2880
- onChange: handleInput,
2881
- onBlur: handleBlur,
2882
- placeholder,
2883
- value: inputValue
2884
- }, rest)
2885
- ),
2886
- error === true && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: rest.id, className: "text-red-900", children: "Campo inv\xE1lido." })
2887
- ] });
2888
- };
2921
+ error === true && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: rest.id, className: "text-red-900", children: "Campo inv\xE1lido." })
2922
+ ] });
2923
+ }
2924
+ );
2925
+ Input.displayName = "Input";
2889
2926
 
2890
2927
  // src/components/TextInput/index.tsx
2891
2928
  var import_react4 = require("react");
2892
- var import_jsx_runtime6 = require("react/jsx-runtime");
2929
+ var import_jsx_runtime7 = require("react/jsx-runtime");
2893
2930
  var TextInput = (0, import_react4.forwardRef)(
2894
2931
  (_a, ref) => {
2895
2932
  var _b = _a, {
@@ -2927,7 +2964,7 @@ var TextInput = (0, import_react4.forwardRef)(
2927
2964
  (0, import_react4.useEffect)(() => {
2928
2965
  setInputValue(value);
2929
2966
  }, [value]);
2930
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
2967
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
2931
2968
  "div",
2932
2969
  {
2933
2970
  className: twMerge(
@@ -2939,8 +2976,8 @@ var TextInput = (0, import_react4.forwardRef)(
2939
2976
  error === true && "border-2 border-red-900"
2940
2977
  ),
2941
2978
  children: [
2942
- !!prefix && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-neutral-500 sm:text-sm", children: prefix }),
2943
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
2979
+ !!prefix && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "text-neutral-500 sm:text-sm", children: prefix }),
2980
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
2944
2981
  "input",
2945
2982
  __spreadValues({
2946
2983
  type,
@@ -2971,7 +3008,7 @@ TextInput.displayName = "TextInput";
2971
3008
 
2972
3009
  // src/components/TextArea/index.tsx
2973
3010
  var import_react5 = require("react");
2974
- var import_jsx_runtime7 = require("react/jsx-runtime");
3011
+ var import_jsx_runtime8 = require("react/jsx-runtime");
2975
3012
  var TextArea = (_a) => {
2976
3013
  var _b = _a, {
2977
3014
  className,
@@ -3004,7 +3041,7 @@ var TextArea = (_a) => {
3004
3041
  (0, import_react5.useEffect)(() => {
3005
3042
  setInputValue(value);
3006
3043
  }, [value]);
3007
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
3044
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
3008
3045
  "textarea",
3009
3046
  __spreadValues({
3010
3047
  required,
@@ -3028,7 +3065,7 @@ var TextArea = (_a) => {
3028
3065
  };
3029
3066
 
3030
3067
  // src/components/Text/index.tsx
3031
- var import_jsx_runtime8 = require("react/jsx-runtime");
3068
+ var import_jsx_runtime9 = require("react/jsx-runtime");
3032
3069
  var Text = (_a) => {
3033
3070
  var _b = _a, {
3034
3071
  children,
@@ -3060,11 +3097,11 @@ var Text = (_a) => {
3060
3097
  "9xl": "text-9xl"
3061
3098
  }[size];
3062
3099
  const Tag = tag;
3063
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Tag, __spreadProps(__spreadValues({}, rest), { className: twMerge(`text-${color} ${fontSize}`, className), children }));
3100
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Tag, __spreadProps(__spreadValues({}, rest), { className: twMerge(`text-${color} ${fontSize}`, className), children }));
3064
3101
  };
3065
3102
 
3066
3103
  // src/components/Heading/index.tsx
3067
- var import_jsx_runtime9 = require("react/jsx-runtime");
3104
+ var import_jsx_runtime10 = require("react/jsx-runtime");
3068
3105
  var Heading = ({
3069
3106
  children,
3070
3107
  color = "neutral-800",
@@ -3087,11 +3124,11 @@ var Heading = ({
3087
3124
  "9xl": "text-9xl"
3088
3125
  }[size];
3089
3126
  const Tag = tag;
3090
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Tag, { className: twMerge(`text-${color} ${fontSize}`, className), children });
3127
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Tag, { className: twMerge(`text-${color} ${fontSize}`, className), children });
3091
3128
  };
3092
3129
 
3093
3130
  // src/components/Box/index.tsx
3094
- var import_jsx_runtime10 = require("react/jsx-runtime");
3131
+ var import_jsx_runtime11 = require("react/jsx-runtime");
3095
3132
  var Box = ({
3096
3133
  className,
3097
3134
  children,
@@ -3099,7 +3136,7 @@ var Box = ({
3099
3136
  variant = "secondary"
3100
3137
  }) => {
3101
3138
  const Tag = tag;
3102
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
3139
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3103
3140
  Tag,
3104
3141
  {
3105
3142
  className: twMerge(
@@ -3114,7 +3151,7 @@ var Box = ({
3114
3151
  };
3115
3152
 
3116
3153
  // src/components/Form/index.tsx
3117
- var import_jsx_runtime11 = require("react/jsx-runtime");
3154
+ var import_jsx_runtime12 = require("react/jsx-runtime");
3118
3155
  var Form = (_a) => {
3119
3156
  var _b = _a, {
3120
3157
  className,
@@ -3127,7 +3164,7 @@ var Form = (_a) => {
3127
3164
  "variant",
3128
3165
  "orientation"
3129
3166
  ]);
3130
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
3167
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3131
3168
  "form",
3132
3169
  __spreadProps(__spreadValues({
3133
3170
  className: twMerge(
@@ -3145,10 +3182,10 @@ var Form = (_a) => {
3145
3182
 
3146
3183
  // src/components/Avatar/index.tsx
3147
3184
  var import_fa = require("react-icons/fa");
3148
- var import_jsx_runtime12 = require("react/jsx-runtime");
3185
+ var import_jsx_runtime13 = require("react/jsx-runtime");
3149
3186
  var Avatar = (_a) => {
3150
3187
  var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
3151
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
3188
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3152
3189
  "div",
3153
3190
  {
3154
3191
  className: twMerge(
@@ -3157,18 +3194,18 @@ var Avatar = (_a) => {
3157
3194
  bg-neutral-600 justify-center`,
3158
3195
  className
3159
3196
  ),
3160
- children: rest.src ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("img", __spreadValues({ className: "w-full h-full object-cover rounded-full" }, rest)) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_fa.FaUser, { color: "#FFFFFF", size: 24 })
3197
+ children: rest.src ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("img", __spreadValues({ className: "w-full h-full object-cover rounded-full" }, rest)) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_fa.FaUser, { color: "#FFFFFF", size: 24 })
3161
3198
  }
3162
3199
  );
3163
3200
  };
3164
3201
 
3165
3202
  // src/components/MultiStep/index.tsx
3166
- var import_jsx_runtime13 = require("react/jsx-runtime");
3203
+ var import_jsx_runtime14 = require("react/jsx-runtime");
3167
3204
  var MultiStep = ({ className, size, currentStep }) => {
3168
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w-full", children: [
3169
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Text, { tag: "label", color: "neutral-100", size: "xs", children: `Passo ${currentStep} de ${size}` }),
3170
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: `grid gap-2 grid-cols-${size} grid-flow-col mt-1`, children: Array.from(Array(size).keys()).map((_, index) => {
3171
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
3205
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w-full", children: [
3206
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text, { tag: "label", color: "neutral-100", size: "xs", children: `Passo ${currentStep} de ${size}` }),
3207
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: `grid gap-2 grid-cols-${size} grid-flow-col mt-1`, children: Array.from(Array(size).keys()).map((_, index) => {
3208
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
3172
3209
  "div",
3173
3210
  {
3174
3211
  className: twMerge(
@@ -3192,6 +3229,7 @@ var MultiStep = ({ className, size, currentStep }) => {
3192
3229
  Form,
3193
3230
  Heading,
3194
3231
  Input,
3232
+ Link,
3195
3233
  MultiStep,
3196
3234
  RadioGroup,
3197
3235
  Text,
package/dist/index.mjs CHANGED
@@ -390,6 +390,7 @@ var fractionRegex = /^\d+\/\d+$/;
390
390
  var stringLengths = /* @__PURE__ */ new Set(["px", "full", "screen"]);
391
391
  var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
392
392
  var lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
393
+ var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/;
393
394
  var shadowRegex = /^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
394
395
  var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
395
396
  function isLength(value) {
@@ -444,7 +445,7 @@ function getIsArbitraryValue(value, label, testValue) {
444
445
  return false;
445
446
  }
446
447
  function isLengthOnly(value) {
447
- return lengthUnitRegex.test(value);
448
+ return lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);
448
449
  }
449
450
  function isNever() {
450
451
  return false;
@@ -2576,9 +2577,9 @@ var Button = (_a) => {
2576
2577
  "button",
2577
2578
  __spreadValues({
2578
2579
  className: twMerge(
2579
- "flex items-center justify-center rounded-lg px-8 py-2 text-md font-medium hover:shadow-md hover:shadow-neutral-500 w-full",
2580
+ "flex gap-4 items-center justify-center rounded-sm px-8 py-2 text-md font-medium hover:shadow-md hover:shadow-neutral-500 w-full",
2580
2581
  variant === "primary" && "bg-orange-500 text-neutral hover:bg-orange-700",
2581
- variant === "secondary" && "bg-neutral text-orange-500 border border-orange-500 hover:bg-neutral-200",
2582
+ variant === "secondary" && "bg-neutral text-orange-500 border border-orange-500 hover:text-orange-100 hover:bg-orange-500",
2582
2583
  size === "sm" && "px-6 py-1",
2583
2584
  typeof rest.children !== "string" && "px-4",
2584
2585
  disabled === true && "opacity-50 cursor-not-allowed",
@@ -2589,10 +2590,40 @@ var Button = (_a) => {
2589
2590
  );
2590
2591
  };
2591
2592
 
2593
+ // src/components/Link/index.tsx
2594
+ import { jsx as jsx3 } from "react/jsx-runtime";
2595
+ var Link = (_a) => {
2596
+ var _b = _a, {
2597
+ className,
2598
+ disabled,
2599
+ url,
2600
+ newPage = true,
2601
+ onClick
2602
+ } = _b, rest = __objRest(_b, [
2603
+ "className",
2604
+ "disabled",
2605
+ "url",
2606
+ "newPage",
2607
+ "onClick"
2608
+ ]);
2609
+ return /* @__PURE__ */ jsx3(
2610
+ "a",
2611
+ __spreadValues(__spreadValues({
2612
+ className: twMerge(
2613
+ "text-blue-800 font-bold",
2614
+ typeof rest.children !== "string" && "px-4",
2615
+ disabled === true && "opacity-50 cursor-not-allowed",
2616
+ className
2617
+ ),
2618
+ href: url
2619
+ }, newPage && { target: "_blank", rel: "noopener noreferrer" }), rest)
2620
+ );
2621
+ };
2622
+
2592
2623
  // src/components/RadioGroup/index.tsx
2593
2624
  import { useState } from "react";
2594
2625
  import { FiCheck } from "react-icons/fi";
2595
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
2626
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
2596
2627
  var RadioGroup = ({
2597
2628
  disabled,
2598
2629
  options = [
@@ -2606,7 +2637,7 @@ var RadioGroup = ({
2606
2637
  const handleOptionChange = (value) => {
2607
2638
  setSelectedOption(value);
2608
2639
  };
2609
- return /* @__PURE__ */ jsx3("div", { className: "flex flex-col ", children: options.map((option) => /* @__PURE__ */ jsxs2("div", { className: "flex py-2 items-center", children: [
2640
+ return /* @__PURE__ */ jsx4("div", { className: "flex flex-col ", children: options.map((option) => /* @__PURE__ */ jsxs2("div", { className: "flex py-2 items-center", children: [
2610
2641
  /* @__PURE__ */ jsxs2(
2611
2642
  "label",
2612
2643
  {
@@ -2618,7 +2649,7 @@ var RadioGroup = ({
2618
2649
  className
2619
2650
  ),
2620
2651
  children: [
2621
- /* @__PURE__ */ jsx3(
2652
+ /* @__PURE__ */ jsx4(
2622
2653
  "input",
2623
2654
  {
2624
2655
  type: "radio",
@@ -2632,24 +2663,24 @@ var RadioGroup = ({
2632
2663
  disabled
2633
2664
  }
2634
2665
  ),
2635
- selectedOption === option.value && /* @__PURE__ */ jsx3(FiCheck, { color: "#FFFFFF", size: 12, style: { strokeWidth: 4 } })
2666
+ selectedOption === option.value && /* @__PURE__ */ jsx4(FiCheck, { color: "#FFFFFF", size: 12, style: { strokeWidth: 4 } })
2636
2667
  ]
2637
2668
  }
2638
2669
  ),
2639
- /* @__PURE__ */ jsx3("span", { className: "px-2", children: option.label })
2670
+ /* @__PURE__ */ jsx4("span", { className: "px-2", children: option.label })
2640
2671
  ] }, option.id)) });
2641
2672
  };
2642
2673
 
2643
2674
  // src/components/Checkbox/index.tsx
2644
2675
  import { useState as useState2 } from "react";
2645
2676
  import { FiCheck as FiCheck2 } from "react-icons/fi";
2646
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
2677
+ import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
2647
2678
  var Checkbox = ({ className, required, disabled }) => {
2648
2679
  const [selected, setSelected] = useState2(false);
2649
2680
  const handleCheckboxChange = (value) => {
2650
2681
  setSelected(!value);
2651
2682
  };
2652
- return /* @__PURE__ */ jsx4("div", { className: "flex items-center justify-center px-2", children: /* @__PURE__ */ jsxs3(
2683
+ return /* @__PURE__ */ jsx5("div", { className: "flex items-center justify-center px-2", children: /* @__PURE__ */ jsxs3(
2653
2684
  "label",
2654
2685
  {
2655
2686
  className: twMerge(
@@ -2659,7 +2690,7 @@ var Checkbox = ({ className, required, disabled }) => {
2659
2690
  disabled === true && "opacity-50 cursor-not-allowed"
2660
2691
  ),
2661
2692
  children: [
2662
- /* @__PURE__ */ jsx4(
2693
+ /* @__PURE__ */ jsx5(
2663
2694
  "input",
2664
2695
  {
2665
2696
  type: "checkbox",
@@ -2673,7 +2704,7 @@ var Checkbox = ({ className, required, disabled }) => {
2673
2704
  )
2674
2705
  }
2675
2706
  ),
2676
- selected && /* @__PURE__ */ jsx4(FiCheck2, { color: "#FFFFFF", size: 14, style: { strokeWidth: 4 } })
2707
+ selected && /* @__PURE__ */ jsx5(FiCheck2, { color: "#FFFFFF", size: 14, style: { strokeWidth: 4 } })
2677
2708
  ]
2678
2709
  }
2679
2710
  ) });
@@ -2682,7 +2713,8 @@ var Checkbox = ({ className, required, disabled }) => {
2682
2713
  // src/components/Input/index.tsx
2683
2714
  import {
2684
2715
  useEffect,
2685
- useState as useState3
2716
+ useState as useState3,
2717
+ forwardRef
2686
2718
  } from "react";
2687
2719
  import { FiCheck as FiCheck3, FiX } from "react-icons/fi";
2688
2720
 
@@ -2748,65 +2780,102 @@ var masks = {
2748
2780
  var masks_default = masks;
2749
2781
 
2750
2782
  // src/components/Input/index.tsx
2751
- import { Fragment, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
2752
- var Input = (_a) => {
2753
- var _b = _a, {
2754
- className,
2755
- disabled,
2756
- placeholder,
2757
- value,
2758
- validated,
2759
- error,
2760
- required,
2761
- type,
2762
- onClick
2763
- } = _b, rest = __objRest(_b, [
2764
- "className",
2765
- "disabled",
2766
- "placeholder",
2767
- "value",
2768
- "validated",
2769
- "error",
2770
- "required",
2771
- "type",
2772
- "onClick"
2773
- ]);
2774
- const [selected, setSelected] = useState3(false);
2775
- const [inputValue, setInputValue] = useState3(value);
2776
- const [hasNumber, setHasNumber] = useState3(false);
2777
- const [hasSpecialCharacteres, setHasSpecialCharacteres] = useState3(false);
2778
- const [hasEightCharacteres, setHasEightCharacteres] = useState3(false);
2779
- const handleFocus = () => {
2780
- setSelected(!selected);
2781
- };
2782
- const handleBlur = () => {
2783
- setSelected(false);
2784
- };
2785
- const handleInput = (event) => {
2786
- setInputValue(event.currentTarget.value);
2787
- checkPassword(event.currentTarget.value);
2788
- };
2789
- useEffect(() => {
2790
- setInputValue(value);
2791
- }, [value]);
2792
- const checkPassword = (value2) => {
2793
- setHasSpecialCharacteres((value2 == null ? void 0 : value2.match(masks_default.password[0])) !== null);
2794
- setHasNumber((value2 == null ? void 0 : value2.match(masks_default.password[1])) !== null);
2795
- setHasEightCharacteres((value2 == null ? void 0 : value2.match(masks_default.password[2])) !== null);
2796
- };
2797
- return /* @__PURE__ */ jsxs4(Fragment, { children: [
2798
- type === "text" || type === "password" || type === "date" ? /* @__PURE__ */ jsxs4(Fragment, { children: [
2799
- /* @__PURE__ */ jsx5(
2783
+ import { Fragment, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
2784
+ var Input = forwardRef(
2785
+ (_a, ref) => {
2786
+ var _b = _a, {
2787
+ className,
2788
+ disabled,
2789
+ placeholder,
2790
+ value,
2791
+ validated,
2792
+ error,
2793
+ required,
2794
+ type,
2795
+ onClick
2796
+ } = _b, rest = __objRest(_b, [
2797
+ "className",
2798
+ "disabled",
2799
+ "placeholder",
2800
+ "value",
2801
+ "validated",
2802
+ "error",
2803
+ "required",
2804
+ "type",
2805
+ "onClick"
2806
+ ]);
2807
+ const [selected, setSelected] = useState3(false);
2808
+ const [inputValue, setInputValue] = useState3(value);
2809
+ const [hasNumber, setHasNumber] = useState3(false);
2810
+ const [hasSpecialCharacteres, setHasSpecialCharacteres] = useState3(false);
2811
+ const [hasEightCharacteres, setHasEightCharacteres] = useState3(false);
2812
+ const handleFocus = () => {
2813
+ setSelected(!selected);
2814
+ };
2815
+ const handleBlur = () => {
2816
+ setSelected(false);
2817
+ };
2818
+ const handleInput = (event) => {
2819
+ setInputValue(event.currentTarget.value);
2820
+ checkPassword(event.currentTarget.value);
2821
+ };
2822
+ useEffect(() => {
2823
+ setInputValue(value);
2824
+ }, [value]);
2825
+ const checkPassword = (value2) => {
2826
+ setHasSpecialCharacteres((value2 == null ? void 0 : value2.match(masks_default.password[0])) !== null);
2827
+ setHasNumber((value2 == null ? void 0 : value2.match(masks_default.password[1])) !== null);
2828
+ setHasEightCharacteres((value2 == null ? void 0 : value2.match(masks_default.password[2])) !== null);
2829
+ };
2830
+ return /* @__PURE__ */ jsxs4(Fragment, { children: [
2831
+ type === "text" || type === "password" || type === "date" ? /* @__PURE__ */ jsxs4(Fragment, { children: [
2832
+ /* @__PURE__ */ jsx6(
2833
+ "input",
2834
+ __spreadValues({
2835
+ type,
2836
+ required,
2837
+ ref,
2838
+ className: twMerge(
2839
+ "flex items-center justify-center border-2 border-neutral rounded-sm w-full px-3 py-2 text-md hover:shadow-md hover:shadow-neutral-500 focus:outline-none",
2840
+ className,
2841
+ disabled === true && "opacity-50 cursor-not-allowed",
2842
+ selected === true && "border-2 border-orange-500",
2843
+ validated === true && "border-2 border-green-900",
2844
+ error === true && "border-2 border-red-900"
2845
+ ),
2846
+ onClick,
2847
+ onFocus: handleFocus,
2848
+ onChange: handleInput,
2849
+ onBlur: handleBlur,
2850
+ placeholder,
2851
+ value: inputValue
2852
+ }, rest)
2853
+ ),
2854
+ type === "password" && (!hasEightCharacteres || !hasSpecialCharacteres || !hasNumber) && /* @__PURE__ */ jsxs4("ul", { className: "py-1", children: [
2855
+ /* @__PURE__ */ jsxs4("li", { className: "flex items-center px-2", children: [
2856
+ hasEightCharacteres ? /* @__PURE__ */ jsx6(FiCheck3, {}) : /* @__PURE__ */ jsx6(FiX, {}),
2857
+ /* @__PURE__ */ jsx6("span", { className: "px-1", children: "Pelo menos 8 caracteres" })
2858
+ ] }),
2859
+ /* @__PURE__ */ jsxs4("li", { className: "flex items-center px-2", children: [
2860
+ hasSpecialCharacteres ? /* @__PURE__ */ jsx6(FiCheck3, {}) : /* @__PURE__ */ jsx6(FiX, {}),
2861
+ /* @__PURE__ */ jsx6("span", { className: "px-1", children: "Pelo menos 1 s\xEDmbolo (@, !, $, etc)" })
2862
+ ] }),
2863
+ /* @__PURE__ */ jsxs4("li", { className: "flex items-center px-2", children: [
2864
+ hasNumber ? /* @__PURE__ */ jsx6(FiCheck3, {}) : /* @__PURE__ */ jsx6(FiX, {}),
2865
+ /* @__PURE__ */ jsx6("span", { className: "px-1", children: "Deve conter 1 n\xFAmero" })
2866
+ ] })
2867
+ ] })
2868
+ ] }) : /* @__PURE__ */ jsx6(
2800
2869
  "input",
2801
2870
  __spreadValues({
2802
2871
  type,
2803
2872
  required,
2873
+ ref,
2804
2874
  className: twMerge(
2805
2875
  "flex items-center justify-center border-2 border-neutral rounded-sm w-full px-3 py-2 text-md hover:shadow-md hover:shadow-neutral-500 focus:outline-none",
2806
2876
  className,
2807
2877
  disabled === true && "opacity-50 cursor-not-allowed",
2808
2878
  selected === true && "border-2 border-orange-500",
2809
- validated === true && "border-2 border-green-900",
2810
2879
  error === true && "border-2 border-red-900"
2811
2880
  ),
2812
2881
  onClick,
@@ -2817,52 +2886,20 @@ var Input = (_a) => {
2817
2886
  value: inputValue
2818
2887
  }, rest)
2819
2888
  ),
2820
- type === "password" && (!hasEightCharacteres || !hasSpecialCharacteres || !hasNumber) && /* @__PURE__ */ jsxs4("ul", { className: "py-1", children: [
2821
- /* @__PURE__ */ jsxs4("li", { className: "flex items-center px-2", children: [
2822
- hasEightCharacteres ? /* @__PURE__ */ jsx5(FiCheck3, {}) : /* @__PURE__ */ jsx5(FiX, {}),
2823
- /* @__PURE__ */ jsx5("span", { className: "px-1", children: "Pelo menos 8 caracteres" })
2824
- ] }),
2825
- /* @__PURE__ */ jsxs4("li", { className: "flex items-center px-2", children: [
2826
- hasSpecialCharacteres ? /* @__PURE__ */ jsx5(FiCheck3, {}) : /* @__PURE__ */ jsx5(FiX, {}),
2827
- /* @__PURE__ */ jsx5("span", { className: "px-1", children: "Pelo menos 1 s\xEDmbolo (@, !, $, etc)" })
2828
- ] }),
2829
- /* @__PURE__ */ jsxs4("li", { className: "flex items-center px-2", children: [
2830
- hasNumber ? /* @__PURE__ */ jsx5(FiCheck3, {}) : /* @__PURE__ */ jsx5(FiX, {}),
2831
- /* @__PURE__ */ jsx5("span", { className: "px-1", children: "Deve conter 1 n\xFAmero" })
2832
- ] })
2833
- ] })
2834
- ] }) : /* @__PURE__ */ jsx5(
2835
- "input",
2836
- __spreadValues({
2837
- type,
2838
- required,
2839
- className: twMerge(
2840
- "flex items-center justify-center border-2 border-neutral rounded-sm w-full px-3 py-2 text-md hover:shadow-md hover:shadow-neutral-500 focus:outline-none",
2841
- className,
2842
- disabled === true && "opacity-50 cursor-not-allowed",
2843
- selected === true && "border-2 border-orange-500",
2844
- error === true && "border-2 border-red-900"
2845
- ),
2846
- onClick,
2847
- onFocus: handleFocus,
2848
- onChange: handleInput,
2849
- onBlur: handleBlur,
2850
- placeholder,
2851
- value: inputValue
2852
- }, rest)
2853
- ),
2854
- error === true && /* @__PURE__ */ jsx5("label", { htmlFor: rest.id, className: "text-red-900", children: "Campo inv\xE1lido." })
2855
- ] });
2856
- };
2889
+ error === true && /* @__PURE__ */ jsx6("label", { htmlFor: rest.id, className: "text-red-900", children: "Campo inv\xE1lido." })
2890
+ ] });
2891
+ }
2892
+ );
2893
+ Input.displayName = "Input";
2857
2894
 
2858
2895
  // src/components/TextInput/index.tsx
2859
2896
  import {
2860
2897
  useEffect as useEffect2,
2861
2898
  useState as useState4,
2862
- forwardRef
2899
+ forwardRef as forwardRef2
2863
2900
  } from "react";
2864
- import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
2865
- var TextInput = forwardRef(
2901
+ import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
2902
+ var TextInput = forwardRef2(
2866
2903
  (_a, ref) => {
2867
2904
  var _b = _a, {
2868
2905
  className,
@@ -2911,8 +2948,8 @@ var TextInput = forwardRef(
2911
2948
  error === true && "border-2 border-red-900"
2912
2949
  ),
2913
2950
  children: [
2914
- !!prefix && /* @__PURE__ */ jsx6("span", { className: "text-neutral-500 sm:text-sm", children: prefix }),
2915
- /* @__PURE__ */ jsx6(
2951
+ !!prefix && /* @__PURE__ */ jsx7("span", { className: "text-neutral-500 sm:text-sm", children: prefix }),
2952
+ /* @__PURE__ */ jsx7(
2916
2953
  "input",
2917
2954
  __spreadValues({
2918
2955
  type,
@@ -2946,7 +2983,7 @@ import {
2946
2983
  useEffect as useEffect3,
2947
2984
  useState as useState5
2948
2985
  } from "react";
2949
- import { jsx as jsx7 } from "react/jsx-runtime";
2986
+ import { jsx as jsx8 } from "react/jsx-runtime";
2950
2987
  var TextArea = (_a) => {
2951
2988
  var _b = _a, {
2952
2989
  className,
@@ -2979,7 +3016,7 @@ var TextArea = (_a) => {
2979
3016
  useEffect3(() => {
2980
3017
  setInputValue(value);
2981
3018
  }, [value]);
2982
- return /* @__PURE__ */ jsx7(
3019
+ return /* @__PURE__ */ jsx8(
2983
3020
  "textarea",
2984
3021
  __spreadValues({
2985
3022
  required,
@@ -3003,7 +3040,7 @@ var TextArea = (_a) => {
3003
3040
  };
3004
3041
 
3005
3042
  // src/components/Text/index.tsx
3006
- import { jsx as jsx8 } from "react/jsx-runtime";
3043
+ import { jsx as jsx9 } from "react/jsx-runtime";
3007
3044
  var Text = (_a) => {
3008
3045
  var _b = _a, {
3009
3046
  children,
@@ -3035,11 +3072,11 @@ var Text = (_a) => {
3035
3072
  "9xl": "text-9xl"
3036
3073
  }[size];
3037
3074
  const Tag = tag;
3038
- return /* @__PURE__ */ jsx8(Tag, __spreadProps(__spreadValues({}, rest), { className: twMerge(`text-${color} ${fontSize}`, className), children }));
3075
+ return /* @__PURE__ */ jsx9(Tag, __spreadProps(__spreadValues({}, rest), { className: twMerge(`text-${color} ${fontSize}`, className), children }));
3039
3076
  };
3040
3077
 
3041
3078
  // src/components/Heading/index.tsx
3042
- import { jsx as jsx9 } from "react/jsx-runtime";
3079
+ import { jsx as jsx10 } from "react/jsx-runtime";
3043
3080
  var Heading = ({
3044
3081
  children,
3045
3082
  color = "neutral-800",
@@ -3062,11 +3099,11 @@ var Heading = ({
3062
3099
  "9xl": "text-9xl"
3063
3100
  }[size];
3064
3101
  const Tag = tag;
3065
- return /* @__PURE__ */ jsx9(Tag, { className: twMerge(`text-${color} ${fontSize}`, className), children });
3102
+ return /* @__PURE__ */ jsx10(Tag, { className: twMerge(`text-${color} ${fontSize}`, className), children });
3066
3103
  };
3067
3104
 
3068
3105
  // src/components/Box/index.tsx
3069
- import { jsx as jsx10 } from "react/jsx-runtime";
3106
+ import { jsx as jsx11 } from "react/jsx-runtime";
3070
3107
  var Box = ({
3071
3108
  className,
3072
3109
  children,
@@ -3074,7 +3111,7 @@ var Box = ({
3074
3111
  variant = "secondary"
3075
3112
  }) => {
3076
3113
  const Tag = tag;
3077
- return /* @__PURE__ */ jsx10(
3114
+ return /* @__PURE__ */ jsx11(
3078
3115
  Tag,
3079
3116
  {
3080
3117
  className: twMerge(
@@ -3089,7 +3126,7 @@ var Box = ({
3089
3126
  };
3090
3127
 
3091
3128
  // src/components/Form/index.tsx
3092
- import { jsx as jsx11 } from "react/jsx-runtime";
3129
+ import { jsx as jsx12 } from "react/jsx-runtime";
3093
3130
  var Form = (_a) => {
3094
3131
  var _b = _a, {
3095
3132
  className,
@@ -3102,7 +3139,7 @@ var Form = (_a) => {
3102
3139
  "variant",
3103
3140
  "orientation"
3104
3141
  ]);
3105
- return /* @__PURE__ */ jsx11(
3142
+ return /* @__PURE__ */ jsx12(
3106
3143
  "form",
3107
3144
  __spreadProps(__spreadValues({
3108
3145
  className: twMerge(
@@ -3120,10 +3157,10 @@ var Form = (_a) => {
3120
3157
 
3121
3158
  // src/components/Avatar/index.tsx
3122
3159
  import { FaUser } from "react-icons/fa";
3123
- import { jsx as jsx12 } from "react/jsx-runtime";
3160
+ import { jsx as jsx13 } from "react/jsx-runtime";
3124
3161
  var Avatar = (_a) => {
3125
3162
  var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
3126
- return /* @__PURE__ */ jsx12(
3163
+ return /* @__PURE__ */ jsx13(
3127
3164
  "div",
3128
3165
  {
3129
3166
  className: twMerge(
@@ -3132,18 +3169,18 @@ var Avatar = (_a) => {
3132
3169
  bg-neutral-600 justify-center`,
3133
3170
  className
3134
3171
  ),
3135
- children: rest.src ? /* @__PURE__ */ jsx12("img", __spreadValues({ className: "w-full h-full object-cover rounded-full" }, rest)) : /* @__PURE__ */ jsx12(FaUser, { color: "#FFFFFF", size: 24 })
3172
+ children: rest.src ? /* @__PURE__ */ jsx13("img", __spreadValues({ className: "w-full h-full object-cover rounded-full" }, rest)) : /* @__PURE__ */ jsx13(FaUser, { color: "#FFFFFF", size: 24 })
3136
3173
  }
3137
3174
  );
3138
3175
  };
3139
3176
 
3140
3177
  // src/components/MultiStep/index.tsx
3141
- import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
3178
+ import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
3142
3179
  var MultiStep = ({ className, size, currentStep }) => {
3143
3180
  return /* @__PURE__ */ jsxs6("div", { className: "w-full", children: [
3144
- /* @__PURE__ */ jsx13(Text, { tag: "label", color: "neutral-100", size: "xs", children: `Passo ${currentStep} de ${size}` }),
3145
- /* @__PURE__ */ jsx13("div", { className: `grid gap-2 grid-cols-${size} grid-flow-col mt-1`, children: Array.from(Array(size).keys()).map((_, index) => {
3146
- return /* @__PURE__ */ jsx13(
3181
+ /* @__PURE__ */ jsx14(Text, { tag: "label", color: "neutral-100", size: "xs", children: `Passo ${currentStep} de ${size}` }),
3182
+ /* @__PURE__ */ jsx14("div", { className: `grid gap-2 grid-cols-${size} grid-flow-col mt-1`, children: Array.from(Array(size).keys()).map((_, index) => {
3183
+ return /* @__PURE__ */ jsx14(
3147
3184
  "div",
3148
3185
  {
3149
3186
  className: twMerge(
@@ -3166,6 +3203,7 @@ export {
3166
3203
  Form,
3167
3204
  Heading,
3168
3205
  Input,
3206
+ Link,
3169
3207
  MultiStep,
3170
3208
  RadioGroup,
3171
3209
  Text,
package/dist/tailwind.css CHANGED
@@ -656,6 +656,10 @@ video {
656
656
  gap: 0.5rem;
657
657
  }
658
658
 
659
+ .gap-4 {
660
+ gap: 1rem;
661
+ }
662
+
659
663
  .overflow-hidden {
660
664
  overflow: hidden;
661
665
  }
@@ -883,6 +887,11 @@ video {
883
887
  line-height: 1.25;
884
888
  }
885
889
 
890
+ .text-blue-800 {
891
+ --tw-text-opacity: 1;
892
+ color: rgb(30 64 175 / var(--tw-text-opacity));
893
+ }
894
+
886
895
  .text-neutral {
887
896
  --tw-text-opacity: 1;
888
897
  color: rgb(255 255 255 / var(--tw-text-opacity));
@@ -935,9 +944,9 @@ html {
935
944
  border-color: rgb(243 98 70 / var(--tw-border-opacity));
936
945
  }
937
946
 
938
- .hover\:bg-neutral-200:hover {
947
+ .hover\:bg-orange-500:hover {
939
948
  --tw-bg-opacity: 1;
940
- background-color: rgb(246 246 246 / var(--tw-bg-opacity));
949
+ background-color: rgb(243 98 70 / var(--tw-bg-opacity));
941
950
  }
942
951
 
943
952
  .hover\:bg-orange-700:hover {
@@ -945,6 +954,11 @@ html {
945
954
  background-color: rgb(194 65 12 / var(--tw-bg-opacity));
946
955
  }
947
956
 
957
+ .hover\:text-orange-100:hover {
958
+ --tw-text-opacity: 1;
959
+ color: rgb(255 237 213 / var(--tw-text-opacity));
960
+ }
961
+
948
962
  .hover\:shadow-md:hover {
949
963
  --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
950
964
  --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koaris/bloom-ui",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Bloom-ui is a public design system from the Koaris Project developed with React, Typescript, and Tailwind.",
5
5
  "source": "./src/index.ts",
6
6
  "main": "./dist/index.js",