@koaris/bloom-ui 1.0.3 → 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/LICENSE +674 -0
- package/dist/index.d.mts +23 -7
- package/dist/index.d.ts +23 -7
- package/dist/index.js +190 -120
- package/dist/index.mjs +189 -120
- package/dist/tailwind.css +20 -2
- package/package.json +2 -2
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 } 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:
|
|
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;
|
|
@@ -73,9 +84,6 @@ interface TextInputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInput
|
|
|
73
84
|
}
|
|
74
85
|
declare const TextInput: react.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
|
|
75
86
|
|
|
76
|
-
/**
|
|
77
|
-
* Primary UI component for user interaction
|
|
78
|
-
*/
|
|
79
87
|
interface TextAreaProps extends DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> {
|
|
80
88
|
disabled?: boolean;
|
|
81
89
|
placeholder?: string;
|
|
@@ -106,11 +114,19 @@ declare const Heading: ({ children, color, size, tag, className, }: HeadingProps
|
|
|
106
114
|
|
|
107
115
|
interface BoxProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
108
116
|
children: React.ReactNode;
|
|
109
|
-
tag?: '
|
|
117
|
+
tag?: 'div' | 'section' | 'article' | 'aside' | 'header' | 'footer';
|
|
110
118
|
variant?: 'primary' | 'secondary';
|
|
111
119
|
}
|
|
112
120
|
declare const Box: ({ className, children, tag, variant, }: BoxProps) => react_jsx_runtime.JSX.Element;
|
|
113
121
|
|
|
122
|
+
interface FormProps extends DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement> {
|
|
123
|
+
children: React.ReactNode;
|
|
124
|
+
variant?: 'primary' | 'secondary';
|
|
125
|
+
orientation?: 'row' | 'col';
|
|
126
|
+
handleSubmit?: (event: React.FormEvent<HTMLFormElement>) => void;
|
|
127
|
+
}
|
|
128
|
+
declare const Form: ({ className, children, variant, orientation, ...rest }: FormProps) => react_jsx_runtime.JSX.Element;
|
|
129
|
+
|
|
114
130
|
interface AvatarProps {
|
|
115
131
|
src?: string;
|
|
116
132
|
alt?: string;
|
|
@@ -124,4 +140,4 @@ interface MultiStepProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement
|
|
|
124
140
|
}
|
|
125
141
|
declare const MultiStep: ({ className, size, currentStep }: MultiStepProps) => react_jsx_runtime.JSX.Element;
|
|
126
142
|
|
|
127
|
-
export { Avatar, type AvatarProps, Box, type BoxProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, 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 } 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:
|
|
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;
|
|
@@ -73,9 +84,6 @@ interface TextInputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInput
|
|
|
73
84
|
}
|
|
74
85
|
declare const TextInput: react.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
|
|
75
86
|
|
|
76
|
-
/**
|
|
77
|
-
* Primary UI component for user interaction
|
|
78
|
-
*/
|
|
79
87
|
interface TextAreaProps extends DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> {
|
|
80
88
|
disabled?: boolean;
|
|
81
89
|
placeholder?: string;
|
|
@@ -106,11 +114,19 @@ declare const Heading: ({ children, color, size, tag, className, }: HeadingProps
|
|
|
106
114
|
|
|
107
115
|
interface BoxProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
108
116
|
children: React.ReactNode;
|
|
109
|
-
tag?: '
|
|
117
|
+
tag?: 'div' | 'section' | 'article' | 'aside' | 'header' | 'footer';
|
|
110
118
|
variant?: 'primary' | 'secondary';
|
|
111
119
|
}
|
|
112
120
|
declare const Box: ({ className, children, tag, variant, }: BoxProps) => react_jsx_runtime.JSX.Element;
|
|
113
121
|
|
|
122
|
+
interface FormProps extends DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement> {
|
|
123
|
+
children: React.ReactNode;
|
|
124
|
+
variant?: 'primary' | 'secondary';
|
|
125
|
+
orientation?: 'row' | 'col';
|
|
126
|
+
handleSubmit?: (event: React.FormEvent<HTMLFormElement>) => void;
|
|
127
|
+
}
|
|
128
|
+
declare const Form: ({ className, children, variant, orientation, ...rest }: FormProps) => react_jsx_runtime.JSX.Element;
|
|
129
|
+
|
|
114
130
|
interface AvatarProps {
|
|
115
131
|
src?: string;
|
|
116
132
|
alt?: string;
|
|
@@ -124,4 +140,4 @@ interface MultiStepProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement
|
|
|
124
140
|
}
|
|
125
141
|
declare const MultiStep: ({ className, size, currentStep }: MultiStepProps) => react_jsx_runtime.JSX.Element;
|
|
126
142
|
|
|
127
|
-
export { Avatar, type AvatarProps, Box, type BoxProps, Button, type ButtonProps, Card, type CardProps, Checkbox, type CheckboxProps, 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
|
@@ -54,8 +54,10 @@ __export(src_exports, {
|
|
|
54
54
|
Button: () => Button,
|
|
55
55
|
Card: () => Card,
|
|
56
56
|
Checkbox: () => Checkbox,
|
|
57
|
+
Form: () => Form,
|
|
57
58
|
Heading: () => Heading,
|
|
58
59
|
Input: () => Input,
|
|
60
|
+
Link: () => Link,
|
|
59
61
|
MultiStep: () => MultiStep,
|
|
60
62
|
RadioGroup: () => RadioGroup,
|
|
61
63
|
Text: () => Text,
|
|
@@ -424,6 +426,7 @@ var fractionRegex = /^\d+\/\d+$/;
|
|
|
424
426
|
var stringLengths = /* @__PURE__ */ new Set(["px", "full", "screen"]);
|
|
425
427
|
var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
|
|
426
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))\(.+\)$/;
|
|
427
430
|
var shadowRegex = /^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
|
|
428
431
|
var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
|
|
429
432
|
function isLength(value) {
|
|
@@ -478,7 +481,7 @@ function getIsArbitraryValue(value, label, testValue) {
|
|
|
478
481
|
return false;
|
|
479
482
|
}
|
|
480
483
|
function isLengthOnly(value) {
|
|
481
|
-
return lengthUnitRegex.test(value);
|
|
484
|
+
return lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);
|
|
482
485
|
}
|
|
483
486
|
function isNever() {
|
|
484
487
|
return false;
|
|
@@ -2610,9 +2613,9 @@ var Button = (_a) => {
|
|
|
2610
2613
|
"button",
|
|
2611
2614
|
__spreadValues({
|
|
2612
2615
|
className: twMerge(
|
|
2613
|
-
"flex items-center justify-center rounded-
|
|
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",
|
|
2614
2617
|
variant === "primary" && "bg-orange-500 text-neutral hover:bg-orange-700",
|
|
2615
|
-
variant === "secondary" && "bg-neutral text-orange-500 border border-orange-500 hover:bg-
|
|
2618
|
+
variant === "secondary" && "bg-neutral text-orange-500 border border-orange-500 hover:text-orange-100 hover:bg-orange-500",
|
|
2616
2619
|
size === "sm" && "px-6 py-1",
|
|
2617
2620
|
typeof rest.children !== "string" && "px-4",
|
|
2618
2621
|
disabled === true && "opacity-50 cursor-not-allowed",
|
|
@@ -2623,10 +2626,40 @@ var Button = (_a) => {
|
|
|
2623
2626
|
);
|
|
2624
2627
|
};
|
|
2625
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
|
+
|
|
2626
2659
|
// src/components/RadioGroup/index.tsx
|
|
2627
2660
|
var import_react = require("react");
|
|
2628
2661
|
var import_fi = require("react-icons/fi");
|
|
2629
|
-
var
|
|
2662
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
2630
2663
|
var RadioGroup = ({
|
|
2631
2664
|
disabled,
|
|
2632
2665
|
options = [
|
|
@@ -2640,8 +2673,8 @@ var RadioGroup = ({
|
|
|
2640
2673
|
const handleOptionChange = (value) => {
|
|
2641
2674
|
setSelectedOption(value);
|
|
2642
2675
|
};
|
|
2643
|
-
return /* @__PURE__ */ (0,
|
|
2644
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
2645
2678
|
"label",
|
|
2646
2679
|
{
|
|
2647
2680
|
htmlFor: `radio${option.id}`,
|
|
@@ -2652,7 +2685,7 @@ var RadioGroup = ({
|
|
|
2652
2685
|
className
|
|
2653
2686
|
),
|
|
2654
2687
|
children: [
|
|
2655
|
-
/* @__PURE__ */ (0,
|
|
2688
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
2656
2689
|
"input",
|
|
2657
2690
|
{
|
|
2658
2691
|
type: "radio",
|
|
@@ -2666,24 +2699,24 @@ var RadioGroup = ({
|
|
|
2666
2699
|
disabled
|
|
2667
2700
|
}
|
|
2668
2701
|
),
|
|
2669
|
-
selectedOption === option.value && /* @__PURE__ */ (0,
|
|
2702
|
+
selectedOption === option.value && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_fi.FiCheck, { color: "#FFFFFF", size: 12, style: { strokeWidth: 4 } })
|
|
2670
2703
|
]
|
|
2671
2704
|
}
|
|
2672
2705
|
),
|
|
2673
|
-
/* @__PURE__ */ (0,
|
|
2706
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "px-2", children: option.label })
|
|
2674
2707
|
] }, option.id)) });
|
|
2675
2708
|
};
|
|
2676
2709
|
|
|
2677
2710
|
// src/components/Checkbox/index.tsx
|
|
2678
2711
|
var import_react2 = require("react");
|
|
2679
2712
|
var import_fi2 = require("react-icons/fi");
|
|
2680
|
-
var
|
|
2713
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
2681
2714
|
var Checkbox = ({ className, required, disabled }) => {
|
|
2682
2715
|
const [selected, setSelected] = (0, import_react2.useState)(false);
|
|
2683
2716
|
const handleCheckboxChange = (value) => {
|
|
2684
2717
|
setSelected(!value);
|
|
2685
2718
|
};
|
|
2686
|
-
return /* @__PURE__ */ (0,
|
|
2719
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex items-center justify-center px-2", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
2687
2720
|
"label",
|
|
2688
2721
|
{
|
|
2689
2722
|
className: twMerge(
|
|
@@ -2693,7 +2726,7 @@ var Checkbox = ({ className, required, disabled }) => {
|
|
|
2693
2726
|
disabled === true && "opacity-50 cursor-not-allowed"
|
|
2694
2727
|
),
|
|
2695
2728
|
children: [
|
|
2696
|
-
/* @__PURE__ */ (0,
|
|
2729
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2697
2730
|
"input",
|
|
2698
2731
|
{
|
|
2699
2732
|
type: "checkbox",
|
|
@@ -2707,7 +2740,7 @@ var Checkbox = ({ className, required, disabled }) => {
|
|
|
2707
2740
|
)
|
|
2708
2741
|
}
|
|
2709
2742
|
),
|
|
2710
|
-
selected && /* @__PURE__ */ (0,
|
|
2743
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_fi2.FiCheck, { color: "#FFFFFF", size: 14, style: { strokeWidth: 4 } })
|
|
2711
2744
|
]
|
|
2712
2745
|
}
|
|
2713
2746
|
) });
|
|
@@ -2779,65 +2812,102 @@ var masks = {
|
|
|
2779
2812
|
var masks_default = masks;
|
|
2780
2813
|
|
|
2781
2814
|
// src/components/Input/index.tsx
|
|
2782
|
-
var
|
|
2783
|
-
var Input = (
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
2831
2901
|
"input",
|
|
2832
2902
|
__spreadValues({
|
|
2833
2903
|
type,
|
|
2834
2904
|
required,
|
|
2905
|
+
ref,
|
|
2835
2906
|
className: twMerge(
|
|
2836
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",
|
|
2837
2908
|
className,
|
|
2838
2909
|
disabled === true && "opacity-50 cursor-not-allowed",
|
|
2839
2910
|
selected === true && "border-2 border-orange-500",
|
|
2840
|
-
validated === true && "border-2 border-green-900",
|
|
2841
2911
|
error === true && "border-2 border-red-900"
|
|
2842
2912
|
),
|
|
2843
2913
|
onClick,
|
|
@@ -2848,47 +2918,15 @@ var Input = (_a) => {
|
|
|
2848
2918
|
value: inputValue
|
|
2849
2919
|
}, rest)
|
|
2850
2920
|
),
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("li", { className: "flex items-center px-2", children: [
|
|
2857
|
-
hasSpecialCharacteres ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_fi3.FiCheck, {}) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_fi3.FiX, {}),
|
|
2858
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "px-1", children: "Pelo menos 1 s\xEDmbolo (@, !, $, etc)" })
|
|
2859
|
-
] }),
|
|
2860
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("li", { className: "flex items-center px-2", children: [
|
|
2861
|
-
hasNumber ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_fi3.FiCheck, {}) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_fi3.FiX, {}),
|
|
2862
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "px-1", children: "Deve conter 1 n\xFAmero" })
|
|
2863
|
-
] })
|
|
2864
|
-
] })
|
|
2865
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
2866
|
-
"input",
|
|
2867
|
-
__spreadValues({
|
|
2868
|
-
type,
|
|
2869
|
-
required,
|
|
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
|
-
error === true && "border-2 border-red-900"
|
|
2876
|
-
),
|
|
2877
|
-
onClick,
|
|
2878
|
-
onFocus: handleFocus,
|
|
2879
|
-
onChange: handleInput,
|
|
2880
|
-
onBlur: handleBlur,
|
|
2881
|
-
placeholder,
|
|
2882
|
-
value: inputValue
|
|
2883
|
-
}, rest)
|
|
2884
|
-
),
|
|
2885
|
-
error === true && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: rest.id, className: "text-red-900", children: "Campo inv\xE1lido." })
|
|
2886
|
-
] });
|
|
2887
|
-
};
|
|
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";
|
|
2888
2926
|
|
|
2889
2927
|
// src/components/TextInput/index.tsx
|
|
2890
2928
|
var import_react4 = require("react");
|
|
2891
|
-
var
|
|
2929
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
2892
2930
|
var TextInput = (0, import_react4.forwardRef)(
|
|
2893
2931
|
(_a, ref) => {
|
|
2894
2932
|
var _b = _a, {
|
|
@@ -2926,7 +2964,7 @@ var TextInput = (0, import_react4.forwardRef)(
|
|
|
2926
2964
|
(0, import_react4.useEffect)(() => {
|
|
2927
2965
|
setInputValue(value);
|
|
2928
2966
|
}, [value]);
|
|
2929
|
-
return /* @__PURE__ */ (0,
|
|
2967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
2930
2968
|
"div",
|
|
2931
2969
|
{
|
|
2932
2970
|
className: twMerge(
|
|
@@ -2938,8 +2976,8 @@ var TextInput = (0, import_react4.forwardRef)(
|
|
|
2938
2976
|
error === true && "border-2 border-red-900"
|
|
2939
2977
|
),
|
|
2940
2978
|
children: [
|
|
2941
|
-
!!prefix && /* @__PURE__ */ (0,
|
|
2942
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
2943
2981
|
"input",
|
|
2944
2982
|
__spreadValues({
|
|
2945
2983
|
type,
|
|
@@ -2970,7 +3008,7 @@ TextInput.displayName = "TextInput";
|
|
|
2970
3008
|
|
|
2971
3009
|
// src/components/TextArea/index.tsx
|
|
2972
3010
|
var import_react5 = require("react");
|
|
2973
|
-
var
|
|
3011
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
2974
3012
|
var TextArea = (_a) => {
|
|
2975
3013
|
var _b = _a, {
|
|
2976
3014
|
className,
|
|
@@ -3003,7 +3041,7 @@ var TextArea = (_a) => {
|
|
|
3003
3041
|
(0, import_react5.useEffect)(() => {
|
|
3004
3042
|
setInputValue(value);
|
|
3005
3043
|
}, [value]);
|
|
3006
|
-
return /* @__PURE__ */ (0,
|
|
3044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
3007
3045
|
"textarea",
|
|
3008
3046
|
__spreadValues({
|
|
3009
3047
|
required,
|
|
@@ -3027,7 +3065,7 @@ var TextArea = (_a) => {
|
|
|
3027
3065
|
};
|
|
3028
3066
|
|
|
3029
3067
|
// src/components/Text/index.tsx
|
|
3030
|
-
var
|
|
3068
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
3031
3069
|
var Text = (_a) => {
|
|
3032
3070
|
var _b = _a, {
|
|
3033
3071
|
children,
|
|
@@ -3059,11 +3097,11 @@ var Text = (_a) => {
|
|
|
3059
3097
|
"9xl": "text-9xl"
|
|
3060
3098
|
}[size];
|
|
3061
3099
|
const Tag = tag;
|
|
3062
|
-
return /* @__PURE__ */ (0,
|
|
3100
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Tag, __spreadProps(__spreadValues({}, rest), { className: twMerge(`text-${color} ${fontSize}`, className), children }));
|
|
3063
3101
|
};
|
|
3064
3102
|
|
|
3065
3103
|
// src/components/Heading/index.tsx
|
|
3066
|
-
var
|
|
3104
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
3067
3105
|
var Heading = ({
|
|
3068
3106
|
children,
|
|
3069
3107
|
color = "neutral-800",
|
|
@@ -3086,11 +3124,11 @@ var Heading = ({
|
|
|
3086
3124
|
"9xl": "text-9xl"
|
|
3087
3125
|
}[size];
|
|
3088
3126
|
const Tag = tag;
|
|
3089
|
-
return /* @__PURE__ */ (0,
|
|
3127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Tag, { className: twMerge(`text-${color} ${fontSize}`, className), children });
|
|
3090
3128
|
};
|
|
3091
3129
|
|
|
3092
3130
|
// src/components/Box/index.tsx
|
|
3093
|
-
var
|
|
3131
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
3094
3132
|
var Box = ({
|
|
3095
3133
|
className,
|
|
3096
3134
|
children,
|
|
@@ -3098,7 +3136,7 @@ var Box = ({
|
|
|
3098
3136
|
variant = "secondary"
|
|
3099
3137
|
}) => {
|
|
3100
3138
|
const Tag = tag;
|
|
3101
|
-
return /* @__PURE__ */ (0,
|
|
3139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
3102
3140
|
Tag,
|
|
3103
3141
|
{
|
|
3104
3142
|
className: twMerge(
|
|
@@ -3112,12 +3150,42 @@ var Box = ({
|
|
|
3112
3150
|
);
|
|
3113
3151
|
};
|
|
3114
3152
|
|
|
3153
|
+
// src/components/Form/index.tsx
|
|
3154
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
3155
|
+
var Form = (_a) => {
|
|
3156
|
+
var _b = _a, {
|
|
3157
|
+
className,
|
|
3158
|
+
children,
|
|
3159
|
+
variant = "secondary",
|
|
3160
|
+
orientation = "row"
|
|
3161
|
+
} = _b, rest = __objRest(_b, [
|
|
3162
|
+
"className",
|
|
3163
|
+
"children",
|
|
3164
|
+
"variant",
|
|
3165
|
+
"orientation"
|
|
3166
|
+
]);
|
|
3167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3168
|
+
"form",
|
|
3169
|
+
__spreadProps(__spreadValues({
|
|
3170
|
+
className: twMerge(
|
|
3171
|
+
"flex flex-row gap-2 p-6 rounded-md border-2",
|
|
3172
|
+
variant === "primary" && "text-neutral-800 bg-neutral-200 border-neutral-300",
|
|
3173
|
+
variant === "secondary" && "text-neutral-200 bg-neutral-600 border-neutral-800",
|
|
3174
|
+
orientation === "col" && "flex-col",
|
|
3175
|
+
className
|
|
3176
|
+
)
|
|
3177
|
+
}, rest), {
|
|
3178
|
+
children
|
|
3179
|
+
})
|
|
3180
|
+
);
|
|
3181
|
+
};
|
|
3182
|
+
|
|
3115
3183
|
// src/components/Avatar/index.tsx
|
|
3116
3184
|
var import_fa = require("react-icons/fa");
|
|
3117
|
-
var
|
|
3185
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
3118
3186
|
var Avatar = (_a) => {
|
|
3119
3187
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
3120
|
-
return /* @__PURE__ */ (0,
|
|
3188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
3121
3189
|
"div",
|
|
3122
3190
|
{
|
|
3123
3191
|
className: twMerge(
|
|
@@ -3126,18 +3194,18 @@ var Avatar = (_a) => {
|
|
|
3126
3194
|
bg-neutral-600 justify-center`,
|
|
3127
3195
|
className
|
|
3128
3196
|
),
|
|
3129
|
-
children: rest.src ? /* @__PURE__ */ (0,
|
|
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 })
|
|
3130
3198
|
}
|
|
3131
3199
|
);
|
|
3132
3200
|
};
|
|
3133
3201
|
|
|
3134
3202
|
// src/components/MultiStep/index.tsx
|
|
3135
|
-
var
|
|
3203
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
3136
3204
|
var MultiStep = ({ className, size, currentStep }) => {
|
|
3137
|
-
return /* @__PURE__ */ (0,
|
|
3138
|
-
/* @__PURE__ */ (0,
|
|
3139
|
-
/* @__PURE__ */ (0,
|
|
3140
|
-
return /* @__PURE__ */ (0,
|
|
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)(
|
|
3141
3209
|
"div",
|
|
3142
3210
|
{
|
|
3143
3211
|
className: twMerge(
|
|
@@ -3158,8 +3226,10 @@ var MultiStep = ({ className, size, currentStep }) => {
|
|
|
3158
3226
|
Button,
|
|
3159
3227
|
Card,
|
|
3160
3228
|
Checkbox,
|
|
3229
|
+
Form,
|
|
3161
3230
|
Heading,
|
|
3162
3231
|
Input,
|
|
3232
|
+
Link,
|
|
3163
3233
|
MultiStep,
|
|
3164
3234
|
RadioGroup,
|
|
3165
3235
|
Text,
|