@koaris/bloom-ui 1.1.0 → 1.1.2
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/.eslintrc.json +3 -0
- package/CHANGELOG.md +55 -0
- package/README.md +8 -4
- package/dist/index.mjs +13 -4
- package/package.json +12 -10
- package/postcss.config.js +6 -0
- package/src/components/Avatar/index.tsx +27 -0
- package/src/components/Box/index.tsx +33 -0
- package/src/components/Button/index.tsx +43 -0
- package/src/components/Card/index.tsx +59 -0
- package/src/components/Checkbox/index.tsx +49 -0
- package/src/components/Form/index.tsx +38 -0
- package/src/components/Heading/index.tsx +53 -0
- package/src/components/Input/index.tsx +154 -0
- package/src/components/Link/index.tsx +39 -0
- package/src/components/MultiStep/index.tsx +35 -0
- package/src/components/RadioGroup/index.tsx +67 -0
- package/src/components/Shared/masks.tsx +60 -0
- package/src/components/Text/index.tsx +62 -0
- package/src/components/TextArea/index.tsx +79 -0
- package/src/components/TextInput/index.tsx +102 -0
- package/src/index.tsx +14 -0
- package/src/styles/tailwind.css +7 -0
- package/tailwind.config.ts +19 -0
- package/tailwind.css +1 -0
- package/tsconfig.json +7 -0
- package/tsup.config.ts +14 -0
- package/dist/index.d.mts +0 -145
- package/dist/index.js +0 -3222
- package/dist/tailwind.css +0 -1013
- /package/{LICENSE → LICENSE.md} +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DetailedHTMLProps, HTMLAttributes, useState } from 'react'
|
|
2
|
+
import { twMerge } from 'tailwind-merge'
|
|
3
|
+
import { FiCheck } from 'react-icons/fi'
|
|
4
|
+
|
|
5
|
+
const options = [
|
|
6
|
+
{ id: 1, value: 'option1', label: 'Opção 1' },
|
|
7
|
+
{ id: 2, value: 'option2', label: 'Opção 2' },
|
|
8
|
+
]
|
|
9
|
+
|
|
10
|
+
export interface RadioGroupProps
|
|
11
|
+
extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
12
|
+
disabled?: boolean
|
|
13
|
+
options: typeof options
|
|
14
|
+
required?: boolean
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const RadioGroup = ({
|
|
18
|
+
disabled,
|
|
19
|
+
options = [
|
|
20
|
+
{ id: 1, value: 'option1', label: 'Opção 1' },
|
|
21
|
+
{ id: 2, value: 'option2', label: 'Opção 2' },
|
|
22
|
+
],
|
|
23
|
+
required = false,
|
|
24
|
+
className,
|
|
25
|
+
}: RadioGroupProps) => {
|
|
26
|
+
const [selectedOption, setSelectedOption] = useState('')
|
|
27
|
+
|
|
28
|
+
const handleOptionChange = (value: string) => {
|
|
29
|
+
setSelectedOption(value)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<div className="flex flex-col ">
|
|
34
|
+
{options.map((option) => (
|
|
35
|
+
<div key={option.id} className="flex py-2 items-center">
|
|
36
|
+
<label
|
|
37
|
+
htmlFor={`radio${option.id}`}
|
|
38
|
+
className={twMerge(
|
|
39
|
+
'relative rounded-full border-2 w-5 h-5 flex items-center justify-center hover:border-orange-500 hover:cursor-pointer',
|
|
40
|
+
selectedOption === option.value
|
|
41
|
+
? 'bg-orange-500 border-orange-500'
|
|
42
|
+
: 'border-neutral-500 hover:shadow-md hover:shadow-orange-500',
|
|
43
|
+
disabled === true && 'opacity-50 cursor-not-allowed',
|
|
44
|
+
className,
|
|
45
|
+
)}
|
|
46
|
+
>
|
|
47
|
+
<input
|
|
48
|
+
type="radio"
|
|
49
|
+
id={`radio${option.id}`}
|
|
50
|
+
name="radioGroup"
|
|
51
|
+
value={option.value}
|
|
52
|
+
required={required}
|
|
53
|
+
className="hidden"
|
|
54
|
+
checked={selectedOption === option.value}
|
|
55
|
+
onChange={() => handleOptionChange(option.value)}
|
|
56
|
+
disabled={disabled}
|
|
57
|
+
/>
|
|
58
|
+
{selectedOption === option.value && (
|
|
59
|
+
<FiCheck color="#FFFFFF" size={12} style={{ strokeWidth: 4 }} />
|
|
60
|
+
)}
|
|
61
|
+
</label>
|
|
62
|
+
<span className="px-2">{option.label}</span>
|
|
63
|
+
</div>
|
|
64
|
+
))}
|
|
65
|
+
</div>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
const masks = {
|
|
2
|
+
password: [/^(?=.*[!@#$%^&*])/, /(?=.*[0-9])/, /.{8,}$/],
|
|
3
|
+
date: [/\d/, /\d/, '/', /\d/, /\d/, '/', /\d/, /\d/, /\d/, /\d/],
|
|
4
|
+
cpf: [
|
|
5
|
+
/\d/,
|
|
6
|
+
/\d/,
|
|
7
|
+
/\d/,
|
|
8
|
+
'.',
|
|
9
|
+
/\d/,
|
|
10
|
+
/\d/,
|
|
11
|
+
/\d/,
|
|
12
|
+
'.',
|
|
13
|
+
/\d/,
|
|
14
|
+
/\d/,
|
|
15
|
+
/\d/,
|
|
16
|
+
'-',
|
|
17
|
+
/\d/,
|
|
18
|
+
/\d/,
|
|
19
|
+
],
|
|
20
|
+
cnpj: [
|
|
21
|
+
/\d/,
|
|
22
|
+
/\d/,
|
|
23
|
+
'.',
|
|
24
|
+
/\d/,
|
|
25
|
+
/\d/,
|
|
26
|
+
/\d/,
|
|
27
|
+
'.',
|
|
28
|
+
/\d/,
|
|
29
|
+
/\d/,
|
|
30
|
+
/\d/,
|
|
31
|
+
'/',
|
|
32
|
+
/\d/,
|
|
33
|
+
/\d/,
|
|
34
|
+
/\d/,
|
|
35
|
+
/\d/,
|
|
36
|
+
'-',
|
|
37
|
+
/\d/,
|
|
38
|
+
/\d/,
|
|
39
|
+
],
|
|
40
|
+
cep: [/\d/, /\d/, /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/],
|
|
41
|
+
phone: [
|
|
42
|
+
'(',
|
|
43
|
+
/[1-9]/,
|
|
44
|
+
/[1-9]/,
|
|
45
|
+
')',
|
|
46
|
+
' ',
|
|
47
|
+
/\d/,
|
|
48
|
+
/\d/,
|
|
49
|
+
/\d/,
|
|
50
|
+
/\d/,
|
|
51
|
+
/\d/,
|
|
52
|
+
'-',
|
|
53
|
+
/\d/,
|
|
54
|
+
/\d/,
|
|
55
|
+
/\d/,
|
|
56
|
+
/\d/,
|
|
57
|
+
],
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export default masks
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { DetailedHTMLProps, HTMLAttributes, ReactNode } from 'react'
|
|
2
|
+
import { twMerge } from 'tailwind-merge'
|
|
3
|
+
|
|
4
|
+
export interface TextProps
|
|
5
|
+
extends DetailedHTMLProps<
|
|
6
|
+
HTMLAttributes<HTMLLabelElement>,
|
|
7
|
+
HTMLLabelElement
|
|
8
|
+
> {
|
|
9
|
+
children: ReactNode
|
|
10
|
+
color?: string
|
|
11
|
+
size?:
|
|
12
|
+
| 'xxs'
|
|
13
|
+
| 'xs'
|
|
14
|
+
| 'sm'
|
|
15
|
+
| 'md'
|
|
16
|
+
| 'lg'
|
|
17
|
+
| 'xl'
|
|
18
|
+
| '2xl'
|
|
19
|
+
| '3xl'
|
|
20
|
+
| '4xl'
|
|
21
|
+
| '5xl'
|
|
22
|
+
| '6xl'
|
|
23
|
+
| '7xl'
|
|
24
|
+
| '8xl'
|
|
25
|
+
| '9xl'
|
|
26
|
+
tag?: 'p' | 'strong' | 'span' | 'label'
|
|
27
|
+
htmlFor?: string
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const Text = ({
|
|
31
|
+
children,
|
|
32
|
+
color = 'neutral-800',
|
|
33
|
+
size = 'md',
|
|
34
|
+
tag = 'p',
|
|
35
|
+
className,
|
|
36
|
+
...rest
|
|
37
|
+
}: TextProps) => {
|
|
38
|
+
const fontSize = {
|
|
39
|
+
xxs: 'text-xxs',
|
|
40
|
+
xs: 'text-xs',
|
|
41
|
+
sm: 'text-sm',
|
|
42
|
+
md: 'text-md',
|
|
43
|
+
lg: 'text-lg',
|
|
44
|
+
xl: 'text-xl',
|
|
45
|
+
'2xl': 'text-2xl',
|
|
46
|
+
'3xl': 'text-3xl',
|
|
47
|
+
'4xl': 'text-4xl',
|
|
48
|
+
'5xl': 'text-5xl',
|
|
49
|
+
'6xl': 'text-6xl',
|
|
50
|
+
'7xl': 'text-7xl',
|
|
51
|
+
'8xl': 'text-8xl',
|
|
52
|
+
'9xl': 'text-9xl',
|
|
53
|
+
}[size]
|
|
54
|
+
|
|
55
|
+
const Tag = tag as React.ElementType
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Tag {...rest} className={twMerge(`text-${color} ${fontSize}`, className)}>
|
|
59
|
+
{children}
|
|
60
|
+
</Tag>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DetailedHTMLProps,
|
|
3
|
+
TextareaHTMLAttributes,
|
|
4
|
+
useEffect,
|
|
5
|
+
useState,
|
|
6
|
+
} from 'react'
|
|
7
|
+
import { twMerge } from 'tailwind-merge'
|
|
8
|
+
|
|
9
|
+
export interface TextAreaProps
|
|
10
|
+
extends DetailedHTMLProps<
|
|
11
|
+
TextareaHTMLAttributes<HTMLTextAreaElement>,
|
|
12
|
+
HTMLTextAreaElement
|
|
13
|
+
> {
|
|
14
|
+
disabled?: boolean
|
|
15
|
+
reference?: React.RefObject<HTMLTextAreaElement>
|
|
16
|
+
placeholder?: string
|
|
17
|
+
value?: string
|
|
18
|
+
validated?: boolean
|
|
19
|
+
error: boolean
|
|
20
|
+
required?: boolean
|
|
21
|
+
resize?: boolean
|
|
22
|
+
type: 'text' | 'password' | 'date' | 'cpf' | 'phone' | 'cnpj' | 'cep'
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const TextArea = ({
|
|
26
|
+
className,
|
|
27
|
+
disabled,
|
|
28
|
+
reference,
|
|
29
|
+
value,
|
|
30
|
+
error,
|
|
31
|
+
required,
|
|
32
|
+
placeholder,
|
|
33
|
+
resize,
|
|
34
|
+
onClick,
|
|
35
|
+
...rest
|
|
36
|
+
}: TextAreaProps) => {
|
|
37
|
+
const [selected, setSelected] = useState(false)
|
|
38
|
+
const [inputValue, setInputValue] = useState(value)
|
|
39
|
+
|
|
40
|
+
const handleFocus = () => {
|
|
41
|
+
setSelected(!selected)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const handleBlur = () => {
|
|
45
|
+
setSelected(false)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const handleInput = (event: React.FocusEvent<HTMLTextAreaElement>) => {
|
|
49
|
+
setInputValue(event.currentTarget.value)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
setInputValue(value)
|
|
54
|
+
}, [value])
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<textarea
|
|
58
|
+
required={required}
|
|
59
|
+
ref={reference}
|
|
60
|
+
disabled={disabled}
|
|
61
|
+
className={twMerge(
|
|
62
|
+
'rounded-sm w-full px-3 py-2 border-2 border-neutral text-md hover:shadow-md hover:shadow-neutral-500 focus:outline-none',
|
|
63
|
+
'resize-y h-32',
|
|
64
|
+
className,
|
|
65
|
+
disabled === true && 'opacity-50 cursor-not-allowed',
|
|
66
|
+
selected === true && 'border-2 border-orange-500',
|
|
67
|
+
error === true && 'border-2 border-red-900',
|
|
68
|
+
resize === false && 'resize-none overflow-hidden',
|
|
69
|
+
)}
|
|
70
|
+
onClick={onClick}
|
|
71
|
+
onFocus={handleFocus}
|
|
72
|
+
onChange={handleInput}
|
|
73
|
+
onBlur={handleBlur}
|
|
74
|
+
placeholder={placeholder}
|
|
75
|
+
value={inputValue}
|
|
76
|
+
{...rest}
|
|
77
|
+
/>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DetailedHTMLProps,
|
|
3
|
+
InputHTMLAttributes,
|
|
4
|
+
useEffect,
|
|
5
|
+
useState,
|
|
6
|
+
forwardRef,
|
|
7
|
+
} from 'react'
|
|
8
|
+
import { twMerge } from 'tailwind-merge'
|
|
9
|
+
|
|
10
|
+
export interface TextInputProps
|
|
11
|
+
extends DetailedHTMLProps<
|
|
12
|
+
InputHTMLAttributes<HTMLInputElement>,
|
|
13
|
+
HTMLInputElement
|
|
14
|
+
> {
|
|
15
|
+
disabled?: boolean
|
|
16
|
+
placeholder?: string
|
|
17
|
+
prefix?: string
|
|
18
|
+
value?: string
|
|
19
|
+
variant?: 'primary' | 'secondary'
|
|
20
|
+
validated?: boolean
|
|
21
|
+
error: boolean
|
|
22
|
+
required?: boolean
|
|
23
|
+
type: 'text' | 'password' | 'date' | 'cpf' | 'phone' | 'cnpj' | 'cep'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const TextInput = forwardRef<HTMLInputElement, TextInputProps>(
|
|
27
|
+
(
|
|
28
|
+
{
|
|
29
|
+
className,
|
|
30
|
+
disabled,
|
|
31
|
+
value,
|
|
32
|
+
prefix,
|
|
33
|
+
placeholder,
|
|
34
|
+
error,
|
|
35
|
+
type = 'text',
|
|
36
|
+
variant = 'primary',
|
|
37
|
+
onClick,
|
|
38
|
+
...rest
|
|
39
|
+
}: TextInputProps,
|
|
40
|
+
ref,
|
|
41
|
+
) => {
|
|
42
|
+
const [selected, setSelected] = useState(false)
|
|
43
|
+
const [inputValue, setInputValue] = useState(value)
|
|
44
|
+
|
|
45
|
+
const handleFocus = () => {
|
|
46
|
+
setSelected(!selected)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const handleBlur = () => {
|
|
50
|
+
setSelected(false)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const handleInput = (event: React.FocusEvent<HTMLInputElement>) => {
|
|
54
|
+
setInputValue(event.currentTarget.value)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
setInputValue(value)
|
|
59
|
+
}, [value])
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<div
|
|
63
|
+
className={twMerge(
|
|
64
|
+
' py-2 px-4 border-2 rounded-sm box-border flex items-baseline bg-neutral-200',
|
|
65
|
+
'hover:shadow-md hover:shadow-neutral-500 focus:outline-none',
|
|
66
|
+
variant === 'secondary' && 'bg-neutral-800 border-neutral-800 ',
|
|
67
|
+
selected === true && 'border-2 border-orange-500',
|
|
68
|
+
disabled === true && 'opacity-50 cursor-not-allowed',
|
|
69
|
+
error === true && 'border-2 border-red-900',
|
|
70
|
+
)}
|
|
71
|
+
>
|
|
72
|
+
{!!prefix && (
|
|
73
|
+
<span className="text-neutral-500 sm:text-sm">{prefix}</span>
|
|
74
|
+
)}
|
|
75
|
+
<input
|
|
76
|
+
type={type}
|
|
77
|
+
required={rest.required}
|
|
78
|
+
onClick={onClick}
|
|
79
|
+
onFocus={handleFocus}
|
|
80
|
+
onChange={handleInput}
|
|
81
|
+
onBlur={handleBlur}
|
|
82
|
+
value={inputValue}
|
|
83
|
+
placeholder={placeholder}
|
|
84
|
+
disabled={disabled}
|
|
85
|
+
ref={ref}
|
|
86
|
+
className={twMerge(
|
|
87
|
+
'flex items-center justify-center bg-neutral-200 rounded-sm w-full px-1 py-2 text-md',
|
|
88
|
+
'focus:outline-none text-neutral-800',
|
|
89
|
+
disabled === true && 'cursor-not-allowed',
|
|
90
|
+
variant === 'secondary' && 'bg-neutral-800 text-neutral',
|
|
91
|
+
className,
|
|
92
|
+
)}
|
|
93
|
+
{...rest}
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
96
|
+
)
|
|
97
|
+
},
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
TextInput.displayName = 'TextInput'
|
|
101
|
+
|
|
102
|
+
export { TextInput }
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './components/Card'
|
|
2
|
+
export * from './components/Button'
|
|
3
|
+
export * from './components/Link'
|
|
4
|
+
export * from './components/RadioGroup'
|
|
5
|
+
export * from './components/Checkbox'
|
|
6
|
+
export * from './components/Input'
|
|
7
|
+
export * from './components/TextInput'
|
|
8
|
+
export * from './components/TextArea'
|
|
9
|
+
export * from './components/Text'
|
|
10
|
+
export * from './components/Heading'
|
|
11
|
+
export * from './components/Box'
|
|
12
|
+
export * from './components/Form'
|
|
13
|
+
export * from './components/Avatar'
|
|
14
|
+
export * from './components/MultiStep'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Config } from 'tailwindcss'
|
|
2
|
+
import { colors, fontSizes, fontWeights, fonts, lineHeights, raddi, space } from '@koaris/tokens';
|
|
3
|
+
|
|
4
|
+
/** @type {import('tailwindcss').Config} */
|
|
5
|
+
export default {
|
|
6
|
+
content: ['./src/**/*.{js,ts,jsx,tsx}'],
|
|
7
|
+
theme: {
|
|
8
|
+
extend: {
|
|
9
|
+
colors: colors,
|
|
10
|
+
fontSize: fontSizes,
|
|
11
|
+
fontWeight: fontWeights,
|
|
12
|
+
fontFamily: fonts,
|
|
13
|
+
lineHeight: lineHeights,
|
|
14
|
+
raddi,
|
|
15
|
+
space
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
plugins: [],
|
|
19
|
+
} satisfies Config
|
package/tailwind.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.relative{position:relative}.bottom-1{bottom:.25rem}.z-10{z-index:10}.mt-1{margin-top:.25rem}.box-border{box-sizing:border-box}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-1{height:.25rem}.h-16{height:4rem}.h-32{height:8rem}.h-5{height:1.25rem}.h-full{height:100%}.w-16{width:4rem}.w-5{width:1.25rem}.w-64{width:16rem}.w-96{width:24rem}.w-full{width:100%}.max-w-\[180px\]{max-width:180px}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.resize-y{resize:vertical}.resize{resize:both}.grid-flow-col{grid-auto-flow:column}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-center{justify-content:center}.gap-2{gap:.5rem}.gap-4{gap:1rem}.overflow-hidden{overflow:hidden}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.border{border-width:1px}.border-2{border-width:2px}.border-green-900{--tw-border-opacity:1;border-color:rgb(20 83 45/var(--tw-border-opacity,1))}.border-neutral{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity,1))}.border-neutral-300{--tw-border-opacity:1;border-color:rgb(227 227 226/var(--tw-border-opacity,1))}.border-neutral-500{--tw-border-opacity:1;border-color:rgb(157 157 157/var(--tw-border-opacity,1))}.border-neutral-800{--tw-border-opacity:1;border-color:rgb(28 33 38/var(--tw-border-opacity,1))}.border-orange-500{--tw-border-opacity:1;border-color:rgb(243 98 70/var(--tw-border-opacity,1))}.border-red-900{--tw-border-opacity:1;border-color:rgb(158 0 63/var(--tw-border-opacity,1))}.bg-neutral{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-neutral-200{--tw-bg-opacity:1;background-color:rgb(246 246 246/var(--tw-bg-opacity,1))}.bg-neutral-500{--tw-bg-opacity:1;background-color:rgb(157 157 157/var(--tw-bg-opacity,1))}.bg-neutral-600{--tw-bg-opacity:1;background-color:rgb(50 60 69/var(--tw-bg-opacity,1))}.bg-neutral-800{--tw-bg-opacity:1;background-color:rgb(28 33 38/var(--tw-bg-opacity,1))}.bg-orange-500{--tw-bg-opacity:1;background-color:rgb(243 98 70/var(--tw-bg-opacity,1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pr-5{padding-right:1.25rem}.text-center{text-align:center}.text-justify{text-align:justify}.font-default{font-family:Open Sans,sans-serif}.text-2xl{font-size:1.5rem}.text-3xl{font-size:1.75rem}.text-4xl{font-size:2rem}.text-5xl{font-size:2.25rem}.text-6xl{font-size:3rem}.text-7xl{font-size:4rem}.text-8xl{font-size:4.5rem}.text-9xl{font-size:6rem}.text-lg{font-size:1.125rem}.text-md{font-size:1rem}.text-sm{font-size:.875rem}.text-xl{font-size:1.25rem}.text-xs{font-size:.75rem}.text-xxs{font-size:.625rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.leading-tight{line-height:1.25}.text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.text-neutral{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.text-neutral-1000{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.text-neutral-200{--tw-text-opacity:1;color:rgb(246 246 246/var(--tw-text-opacity,1))}.text-neutral-500{--tw-text-opacity:1;color:rgb(157 157 157/var(--tw-text-opacity,1))}.text-neutral-800{--tw-text-opacity:1;color:rgb(28 33 38/var(--tw-text-opacity,1))}.text-orange-500{--tw-text-opacity:1;color:rgb(243 98 70/var(--tw-text-opacity,1))}.text-red-900{--tw-text-opacity:1;color:rgb(158 0 63/var(--tw-text-opacity,1))}.opacity-50{opacity:.5}html{font-family:Open Sans,sans-serif}.hover\:cursor-pointer:hover{cursor:pointer}.hover\:border-orange-500:hover{--tw-border-opacity:1;border-color:rgb(243 98 70/var(--tw-border-opacity,1))}.hover\:bg-orange-500:hover{--tw-bg-opacity:1;background-color:rgb(243 98 70/var(--tw-bg-opacity,1))}.hover\:bg-orange-700:hover{--tw-bg-opacity:1;background-color:rgb(194 65 12/var(--tw-bg-opacity,1))}.hover\:text-orange-100:hover{--tw-text-opacity:1;color:rgb(255 237 213/var(--tw-text-opacity,1))}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\:shadow-neutral-500:hover{--tw-shadow-color:#9d9d9d;--tw-shadow:var(--tw-shadow-colored)}.hover\:shadow-orange-500:hover{--tw-shadow-color:#f36246;--tw-shadow:var(--tw-shadow-colored)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}@media (min-width:640px){.sm\:text-sm{font-size:.875rem}}
|
package/tsconfig.json
ADDED
package/tsup.config.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineConfig } from "tsup";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: ["src/index.tsx", "src/tailwind-preset.ts"],
|
|
5
|
+
format: ["esm"],
|
|
6
|
+
tsconfig: "./tsconfig.json",
|
|
7
|
+
outExtension({ format }) {
|
|
8
|
+
return { js: ".mjs" };
|
|
9
|
+
},
|
|
10
|
+
dts: true,
|
|
11
|
+
external: ["react"],
|
|
12
|
+
|
|
13
|
+
clean: true,
|
|
14
|
+
});
|
package/dist/index.d.mts
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as react from 'react';
|
|
3
|
-
import { DetailedHTMLProps, HTMLAttributes, ButtonHTMLAttributes, AnchorHTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes, ReactNode, FormHTMLAttributes } from 'react';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Primary UI component for user interaction
|
|
7
|
-
*/
|
|
8
|
-
interface CardProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, // Change the type to HTMLDivElement
|
|
9
|
-
HTMLDivElement> {
|
|
10
|
-
selected?: boolean;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
direction?: string;
|
|
13
|
-
size?: string;
|
|
14
|
-
imageSize: string;
|
|
15
|
-
image?: string;
|
|
16
|
-
onClick?: () => void;
|
|
17
|
-
}
|
|
18
|
-
declare const Card: ({ className, selected, direction, size, disabled, imageSize, onClick, ...rest }: CardProps) => react_jsx_runtime.JSX.Element;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Primary UI component for user interaction
|
|
22
|
-
*/
|
|
23
|
-
interface ButtonProps extends DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
|
|
24
|
-
size?: 'sm' | 'md';
|
|
25
|
-
variant?: 'primary' | 'secondary';
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
children: string | JSX.Element;
|
|
28
|
-
}
|
|
29
|
-
declare const Button: ({ className, variant, size, disabled, onClick, ...rest }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
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
|
-
|
|
42
|
-
declare const options: {
|
|
43
|
-
id: number;
|
|
44
|
-
value: string;
|
|
45
|
-
label: string;
|
|
46
|
-
}[];
|
|
47
|
-
interface RadioGroupProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
48
|
-
disabled?: boolean;
|
|
49
|
-
options: typeof options;
|
|
50
|
-
required?: boolean;
|
|
51
|
-
}
|
|
52
|
-
declare const RadioGroup: ({ disabled, options, required, className, }: RadioGroupProps) => react_jsx_runtime.JSX.Element;
|
|
53
|
-
|
|
54
|
-
interface CheckboxProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
55
|
-
disabled?: boolean;
|
|
56
|
-
required?: boolean;
|
|
57
|
-
}
|
|
58
|
-
declare const Checkbox: ({ className, required, disabled }: CheckboxProps) => react_jsx_runtime.JSX.Element;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Primary UI component for user interaction
|
|
62
|
-
*/
|
|
63
|
-
interface InputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
64
|
-
disabled?: boolean;
|
|
65
|
-
placeholder?: string;
|
|
66
|
-
value?: string;
|
|
67
|
-
validated?: boolean;
|
|
68
|
-
error: boolean;
|
|
69
|
-
required?: boolean;
|
|
70
|
-
type: 'text' | 'password' | 'date' | 'cpf' | 'phone' | 'cnpj' | 'cep';
|
|
71
|
-
}
|
|
72
|
-
declare const Input: react.ForwardRefExoticComponent<Omit<InputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
|
|
73
|
-
|
|
74
|
-
interface TextInputProps extends DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> {
|
|
75
|
-
disabled?: boolean;
|
|
76
|
-
placeholder?: string;
|
|
77
|
-
prefix?: string;
|
|
78
|
-
value?: string;
|
|
79
|
-
variant?: 'primary' | 'secondary';
|
|
80
|
-
validated?: boolean;
|
|
81
|
-
error: boolean;
|
|
82
|
-
required?: boolean;
|
|
83
|
-
type: 'text' | 'password' | 'date' | 'cpf' | 'phone' | 'cnpj' | 'cep';
|
|
84
|
-
}
|
|
85
|
-
declare const TextInput: react.ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
|
|
86
|
-
|
|
87
|
-
interface TextAreaProps extends DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement> {
|
|
88
|
-
disabled?: boolean;
|
|
89
|
-
reference?: React.RefObject<HTMLTextAreaElement>;
|
|
90
|
-
placeholder?: string;
|
|
91
|
-
value?: string;
|
|
92
|
-
validated?: boolean;
|
|
93
|
-
error: boolean;
|
|
94
|
-
required?: boolean;
|
|
95
|
-
resize?: boolean;
|
|
96
|
-
type: 'text' | 'password' | 'date' | 'cpf' | 'phone' | 'cnpj' | 'cep';
|
|
97
|
-
}
|
|
98
|
-
declare const TextArea: ({ className, disabled, reference, value, error, required, placeholder, resize, onClick, ...rest }: TextAreaProps) => react_jsx_runtime.JSX.Element;
|
|
99
|
-
|
|
100
|
-
interface TextProps extends DetailedHTMLProps<HTMLAttributes<HTMLLabelElement>, HTMLLabelElement> {
|
|
101
|
-
children: ReactNode;
|
|
102
|
-
color?: string;
|
|
103
|
-
size?: 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
|
|
104
|
-
tag?: 'p' | 'strong' | 'span' | 'label';
|
|
105
|
-
htmlFor?: string;
|
|
106
|
-
}
|
|
107
|
-
declare const Text: ({ children, color, size, tag, className, ...rest }: TextProps) => react_jsx_runtime.JSX.Element;
|
|
108
|
-
|
|
109
|
-
interface HeadingProps extends DetailedHTMLProps<HTMLAttributes<HTMLHeadElement>, HTMLHeadElement> {
|
|
110
|
-
children: React.ReactNode;
|
|
111
|
-
color?: string;
|
|
112
|
-
size?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
|
|
113
|
-
tag?: 'h1' | 'h2' | 'h3' | 'h4';
|
|
114
|
-
}
|
|
115
|
-
declare const Heading: ({ children, color, size, tag, className, }: HeadingProps) => react_jsx_runtime.JSX.Element;
|
|
116
|
-
|
|
117
|
-
interface BoxProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
118
|
-
children: React.ReactNode;
|
|
119
|
-
tag?: 'div' | 'section' | 'article' | 'aside' | 'header' | 'footer';
|
|
120
|
-
variant?: 'primary' | 'secondary';
|
|
121
|
-
}
|
|
122
|
-
declare const Box: ({ className, children, tag, variant, }: BoxProps) => react_jsx_runtime.JSX.Element;
|
|
123
|
-
|
|
124
|
-
interface FormProps extends DetailedHTMLProps<FormHTMLAttributes<HTMLFormElement>, HTMLFormElement> {
|
|
125
|
-
children: React.ReactNode;
|
|
126
|
-
variant?: 'primary' | 'secondary';
|
|
127
|
-
orientation?: 'row' | 'col';
|
|
128
|
-
handleSubmit?: (event: React.FormEvent<HTMLFormElement>) => void;
|
|
129
|
-
}
|
|
130
|
-
declare const Form: ({ className, children, variant, orientation, ...rest }: FormProps) => react_jsx_runtime.JSX.Element;
|
|
131
|
-
|
|
132
|
-
interface AvatarProps {
|
|
133
|
-
src?: string;
|
|
134
|
-
alt?: string;
|
|
135
|
-
className?: string;
|
|
136
|
-
}
|
|
137
|
-
declare const Avatar: ({ className, ...rest }: AvatarProps) => react_jsx_runtime.JSX.Element;
|
|
138
|
-
|
|
139
|
-
interface MultiStepProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
140
|
-
size: number;
|
|
141
|
-
currentStep?: number;
|
|
142
|
-
}
|
|
143
|
-
declare const MultiStep: ({ className, size, currentStep }: MultiStepProps) => react_jsx_runtime.JSX.Element;
|
|
144
|
-
|
|
145
|
-
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 };
|