@koaris/bloom-ui 1.1.2 → 1.2.1
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.cjs +3231 -0
- package/dist/index.d.cts +145 -0
- package/package.json +12 -4
- package/.eslintrc.json +0 -3
- package/CHANGELOG.md +0 -55
- package/postcss.config.js +0 -6
- package/src/components/Avatar/index.tsx +0 -27
- package/src/components/Box/index.tsx +0 -33
- package/src/components/Button/index.tsx +0 -43
- package/src/components/Card/index.tsx +0 -59
- package/src/components/Checkbox/index.tsx +0 -49
- package/src/components/Form/index.tsx +0 -38
- package/src/components/Heading/index.tsx +0 -53
- package/src/components/Input/index.tsx +0 -154
- package/src/components/Link/index.tsx +0 -39
- package/src/components/MultiStep/index.tsx +0 -35
- package/src/components/RadioGroup/index.tsx +0 -67
- package/src/components/Shared/masks.tsx +0 -60
- package/src/components/Text/index.tsx +0 -62
- package/src/components/TextArea/index.tsx +0 -79
- package/src/components/TextInput/index.tsx +0 -102
- package/src/index.tsx +0 -14
- package/src/styles/tailwind.css +0 -7
- package/tailwind.config.ts +0 -19
- package/tsconfig.json +0 -7
- package/tsup.config.ts +0 -14
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koaris/bloom-ui",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
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
|
"type": "module",
|
|
7
|
-
"
|
|
7
|
+
"types": "./,dist/index.d.ts",
|
|
8
|
+
"main": "./dist/index.mjs",
|
|
9
|
+
"module": "./ist/index.mjs",
|
|
8
10
|
"scripts": {
|
|
9
11
|
"build": "NODE_ENV=production tailwindcss -i ./src/styles/tailwind.css -o ./tailwind.css -c ./tailwind.config.ts --minify && tsup",
|
|
10
12
|
"dev": "concurrently --kill-others \"tailwindcss -i ./src/styles/tailwind.css -o ./tailwind.css -c ./tailwind.config.ts --minify --watch \" \"tsup --watch\"",
|
|
@@ -12,8 +14,9 @@
|
|
|
12
14
|
},
|
|
13
15
|
"exports": {
|
|
14
16
|
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
15
18
|
"import": "./dist/index.mjs",
|
|
16
|
-
"require": "./dist/index.
|
|
19
|
+
"require": "./dist/index.cjs"
|
|
17
20
|
},
|
|
18
21
|
"./tailwind.css": "./tailwind.css"
|
|
19
22
|
},
|
|
@@ -21,11 +24,16 @@
|
|
|
21
24
|
"design-system",
|
|
22
25
|
"react"
|
|
23
26
|
],
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"README.md",
|
|
30
|
+
"tailwind.css"
|
|
31
|
+
],
|
|
24
32
|
"author": "guilhermesalviano",
|
|
25
33
|
"homepage": "https://guilhermesalviano.github.io/bloom-ui",
|
|
26
34
|
"repository": {
|
|
27
35
|
"type": "git",
|
|
28
|
-
"url": "https://github.com/guilhermesalviano/bloom-ui.git"
|
|
36
|
+
"url": "git+https://github.com/guilhermesalviano/bloom-ui.git"
|
|
29
37
|
},
|
|
30
38
|
"license": "GPL-3.0-only",
|
|
31
39
|
"devDependencies": {
|
package/.eslintrc.json
DELETED
package/CHANGELOG.md
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# @koaris/bloom-ui
|
|
2
|
-
|
|
3
|
-
## 1.1.2
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Optimized Tailwind configuration and build process to reduce bundle size.
|
|
8
|
-
|
|
9
|
-
## 1.1.1
|
|
10
|
-
|
|
11
|
-
### Patch Changes
|
|
12
|
-
|
|
13
|
-
- fix card css
|
|
14
|
-
|
|
15
|
-
## 1.1.0
|
|
16
|
-
|
|
17
|
-
### Minor Changes
|
|
18
|
-
|
|
19
|
-
- button and checkbox improvements
|
|
20
|
-
|
|
21
|
-
## 1.0.5
|
|
22
|
-
|
|
23
|
-
### Patch Changes
|
|
24
|
-
|
|
25
|
-
- Create link component
|
|
26
|
-
|
|
27
|
-
## 1.0.4
|
|
28
|
-
|
|
29
|
-
### Patch Changes
|
|
30
|
-
|
|
31
|
-
- creating form component
|
|
32
|
-
|
|
33
|
-
## 1.0.3
|
|
34
|
-
|
|
35
|
-
### Patch Changes
|
|
36
|
-
|
|
37
|
-
- Update components and add new colors
|
|
38
|
-
|
|
39
|
-
## 1.0.2
|
|
40
|
-
|
|
41
|
-
### Patch Changes
|
|
42
|
-
|
|
43
|
-
- fix tailwind post css
|
|
44
|
-
|
|
45
|
-
## 1.0.1
|
|
46
|
-
|
|
47
|
-
### Patch Changes
|
|
48
|
-
|
|
49
|
-
- recreating package
|
|
50
|
-
|
|
51
|
-
## 1.0.0
|
|
52
|
-
|
|
53
|
-
### Major Changes
|
|
54
|
-
|
|
55
|
-
- Creating bloom-ui
|
package/postcss.config.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { twMerge } from 'tailwind-merge'
|
|
2
|
-
import { FaUser } from 'react-icons/fa'
|
|
3
|
-
|
|
4
|
-
export interface AvatarProps {
|
|
5
|
-
src?: string
|
|
6
|
-
alt?: string
|
|
7
|
-
className?: string
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const Avatar = ({ className, ...rest }: AvatarProps) => {
|
|
11
|
-
return (
|
|
12
|
-
<div
|
|
13
|
-
className={twMerge(
|
|
14
|
-
`
|
|
15
|
-
rounded-full w-16 h-16 overflow-hidden flex items-center
|
|
16
|
-
bg-neutral-600 justify-center`,
|
|
17
|
-
className,
|
|
18
|
-
)}
|
|
19
|
-
>
|
|
20
|
-
{rest.src ? (
|
|
21
|
-
<img className="w-full h-full object-cover rounded-full" {...rest} />
|
|
22
|
-
) : (
|
|
23
|
-
<FaUser color="#FFFFFF" size={24} />
|
|
24
|
-
)}
|
|
25
|
-
</div>
|
|
26
|
-
)
|
|
27
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { DetailedHTMLProps, HTMLAttributes } from 'react'
|
|
2
|
-
import { twMerge } from 'tailwind-merge'
|
|
3
|
-
|
|
4
|
-
export interface BoxProps
|
|
5
|
-
extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
6
|
-
children: React.ReactNode
|
|
7
|
-
tag?: 'div' | 'section' | 'article' | 'aside' | 'header' | 'footer'
|
|
8
|
-
variant?: 'primary' | 'secondary'
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const Box = ({
|
|
12
|
-
className,
|
|
13
|
-
children,
|
|
14
|
-
tag = 'div',
|
|
15
|
-
variant = 'secondary',
|
|
16
|
-
}: BoxProps) => {
|
|
17
|
-
const Tag = tag as React.ElementType
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<Tag
|
|
21
|
-
className={twMerge(
|
|
22
|
-
'p-6 rounded-md bottom-1 border-2',
|
|
23
|
-
variant === 'primary' &&
|
|
24
|
-
'text-neutral-800 bg-neutral-200 border-neutral-300',
|
|
25
|
-
variant === 'secondary' &&
|
|
26
|
-
'text-neutral-200 bg-neutral-600 border-neutral-800',
|
|
27
|
-
className,
|
|
28
|
-
)}
|
|
29
|
-
>
|
|
30
|
-
{children}
|
|
31
|
-
</Tag>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { DetailedHTMLProps, ButtonHTMLAttributes } from 'react'
|
|
2
|
-
import { twMerge } from 'tailwind-merge'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Primary UI component for user interaction
|
|
6
|
-
*/
|
|
7
|
-
export interface ButtonProps
|
|
8
|
-
extends DetailedHTMLProps<
|
|
9
|
-
ButtonHTMLAttributes<HTMLButtonElement>,
|
|
10
|
-
HTMLButtonElement
|
|
11
|
-
> {
|
|
12
|
-
size?: 'sm' | 'md'
|
|
13
|
-
variant?: 'primary' | 'secondary'
|
|
14
|
-
disabled?: boolean
|
|
15
|
-
children: string | JSX.Element
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const Button = ({
|
|
19
|
-
className,
|
|
20
|
-
variant = 'primary',
|
|
21
|
-
size = 'md',
|
|
22
|
-
disabled,
|
|
23
|
-
onClick,
|
|
24
|
-
...rest
|
|
25
|
-
}: ButtonProps) => {
|
|
26
|
-
return (
|
|
27
|
-
<button
|
|
28
|
-
className={twMerge(
|
|
29
|
-
'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 max-w-[180px]',
|
|
30
|
-
variant === 'primary' &&
|
|
31
|
-
'bg-orange-500 text-neutral hover:bg-orange-700',
|
|
32
|
-
variant === 'secondary' &&
|
|
33
|
-
'bg-neutral text-orange-500 border border-orange-500 hover:text-orange-100 hover:bg-orange-500',
|
|
34
|
-
size === 'sm' && 'px-6 py-1',
|
|
35
|
-
typeof rest.children !== 'string' && 'px-4',
|
|
36
|
-
disabled === true && 'opacity-50 cursor-not-allowed',
|
|
37
|
-
className,
|
|
38
|
-
)}
|
|
39
|
-
onClick={onClick}
|
|
40
|
-
{...rest}
|
|
41
|
-
/>
|
|
42
|
-
)
|
|
43
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { DetailedHTMLProps, HTMLAttributes } from 'react'
|
|
2
|
-
import { twMerge } from 'tailwind-merge'
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Primary UI component for user interaction
|
|
6
|
-
*/
|
|
7
|
-
export interface CardProps
|
|
8
|
-
extends DetailedHTMLProps<
|
|
9
|
-
HTMLAttributes<HTMLDivElement>, // Change the type to HTMLDivElement
|
|
10
|
-
HTMLDivElement
|
|
11
|
-
> {
|
|
12
|
-
selected?: boolean
|
|
13
|
-
disabled?: boolean
|
|
14
|
-
direction?: string
|
|
15
|
-
size?: string
|
|
16
|
-
imageSize: string
|
|
17
|
-
image?: string // Add the image property
|
|
18
|
-
onClick?: () => void
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export const Card = ({
|
|
22
|
-
className,
|
|
23
|
-
selected = false,
|
|
24
|
-
direction,
|
|
25
|
-
size,
|
|
26
|
-
disabled,
|
|
27
|
-
imageSize,
|
|
28
|
-
onClick,
|
|
29
|
-
...rest
|
|
30
|
-
}: CardProps) => {
|
|
31
|
-
return (
|
|
32
|
-
<div
|
|
33
|
-
className={twMerge(
|
|
34
|
-
'flex items-center justify-center rounded-lg cursor-pointer bg-neutral',
|
|
35
|
-
'hover:shadow-md hover:shadow-neutral-500 border border-neutral-500 text-neutral-1000',
|
|
36
|
-
size === 'medium' && 'w-64 px-8 py-4',
|
|
37
|
-
size === 'large' && 'w-96 pr-5',
|
|
38
|
-
direction === 'col' && 'flex-col',
|
|
39
|
-
selected === true && 'border-2 border-orange-500',
|
|
40
|
-
disabled === true && 'opacity-50 cursor-not-allowed',
|
|
41
|
-
className,
|
|
42
|
-
)}
|
|
43
|
-
onClick={onClick}
|
|
44
|
-
>
|
|
45
|
-
<img src={rest.image} alt={rest.title} width={imageSize} height="auto" />
|
|
46
|
-
<aside
|
|
47
|
-
className={twMerge(
|
|
48
|
-
direction === 'col' && 'text-center',
|
|
49
|
-
'flex flex-col gap-2',
|
|
50
|
-
)}
|
|
51
|
-
>
|
|
52
|
-
<h1 className="text-xl font-bold font-default leading-tight">
|
|
53
|
-
{rest.title}
|
|
54
|
-
</h1>
|
|
55
|
-
<p className="text-justify">{rest.content}</p>
|
|
56
|
-
</aside>
|
|
57
|
-
</div>
|
|
58
|
-
)
|
|
59
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { DetailedHTMLProps, HTMLAttributes, useState } from 'react'
|
|
2
|
-
import { FiCheck } from 'react-icons/fi'
|
|
3
|
-
import { twMerge } from 'tailwind-merge'
|
|
4
|
-
|
|
5
|
-
export interface CheckboxProps
|
|
6
|
-
extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
7
|
-
disabled?: boolean
|
|
8
|
-
required?: boolean
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const Checkbox = ({ className, required, disabled }: CheckboxProps) => {
|
|
12
|
-
const [selected, setSelected] = useState(false)
|
|
13
|
-
|
|
14
|
-
const handleCheckboxChange = (value: boolean) => {
|
|
15
|
-
setSelected(!value)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<div className="flex items-center justify-center">
|
|
20
|
-
<label
|
|
21
|
-
className={twMerge(
|
|
22
|
-
className,
|
|
23
|
-
'relative border-2 w-5 h-5 flex items-center justify-center rounded-sm hover:border-orange-500 hover:cursor-pointer',
|
|
24
|
-
selected
|
|
25
|
-
? 'bg-orange-500 border-orange-500'
|
|
26
|
-
: 'border-neutral-500 hover:shadow-md hover:shadow-orange-500',
|
|
27
|
-
disabled === true && 'opacity-50 cursor-not-allowed',
|
|
28
|
-
)}
|
|
29
|
-
>
|
|
30
|
-
<input
|
|
31
|
-
type="checkbox"
|
|
32
|
-
required={required}
|
|
33
|
-
checked={selected}
|
|
34
|
-
onChange={() => handleCheckboxChange(selected)}
|
|
35
|
-
disabled={disabled}
|
|
36
|
-
className={twMerge(
|
|
37
|
-
'relative z-10 hidden',
|
|
38
|
-
selected
|
|
39
|
-
? 'bg-orange-500 border-orange-500'
|
|
40
|
-
: 'border-neutral-500 hover:shadow-md hover:shadow-orange-500',
|
|
41
|
-
)}
|
|
42
|
-
/>
|
|
43
|
-
{selected && (
|
|
44
|
-
<FiCheck color="#FFFFFF" size={14} style={{ strokeWidth: 4 }} />
|
|
45
|
-
)}
|
|
46
|
-
</label>
|
|
47
|
-
</div>
|
|
48
|
-
)
|
|
49
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { DetailedHTMLProps, FormHTMLAttributes } from 'react'
|
|
2
|
-
import { twMerge } from 'tailwind-merge'
|
|
3
|
-
|
|
4
|
-
export interface FormProps
|
|
5
|
-
extends DetailedHTMLProps<
|
|
6
|
-
FormHTMLAttributes<HTMLFormElement>,
|
|
7
|
-
HTMLFormElement
|
|
8
|
-
> {
|
|
9
|
-
children: React.ReactNode
|
|
10
|
-
variant?: 'primary' | 'secondary'
|
|
11
|
-
orientation?: 'row' | 'col'
|
|
12
|
-
handleSubmit?: (event: React.FormEvent<HTMLFormElement>) => void
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const Form = ({
|
|
16
|
-
className,
|
|
17
|
-
children,
|
|
18
|
-
variant = 'secondary',
|
|
19
|
-
orientation = 'row',
|
|
20
|
-
...rest
|
|
21
|
-
}: FormProps) => {
|
|
22
|
-
return (
|
|
23
|
-
<form
|
|
24
|
-
className={twMerge(
|
|
25
|
-
'flex flex-row gap-2 p-6 rounded-md border-2',
|
|
26
|
-
variant === 'primary' &&
|
|
27
|
-
'text-neutral-800 bg-neutral-200 border-neutral-300',
|
|
28
|
-
variant === 'secondary' &&
|
|
29
|
-
'text-neutral-200 bg-neutral-600 border-neutral-800',
|
|
30
|
-
orientation === 'col' && 'flex-col',
|
|
31
|
-
className,
|
|
32
|
-
)}
|
|
33
|
-
{...rest}
|
|
34
|
-
>
|
|
35
|
-
{children}
|
|
36
|
-
</form>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { DetailedHTMLProps, HTMLAttributes } from 'react'
|
|
2
|
-
import { twMerge } from 'tailwind-merge'
|
|
3
|
-
|
|
4
|
-
export interface HeadingProps
|
|
5
|
-
extends DetailedHTMLProps<HTMLAttributes<HTMLHeadElement>, HTMLHeadElement> {
|
|
6
|
-
children: React.ReactNode
|
|
7
|
-
color?: string
|
|
8
|
-
size?:
|
|
9
|
-
| 'sm'
|
|
10
|
-
| 'md'
|
|
11
|
-
| 'lg'
|
|
12
|
-
| 'xl'
|
|
13
|
-
| '2xl'
|
|
14
|
-
| '3xl'
|
|
15
|
-
| '4xl'
|
|
16
|
-
| '5xl'
|
|
17
|
-
| '6xl'
|
|
18
|
-
| '7xl'
|
|
19
|
-
| '8xl'
|
|
20
|
-
| '9xl'
|
|
21
|
-
tag?: 'h1' | 'h2' | 'h3' | 'h4'
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const Heading = ({
|
|
25
|
-
children,
|
|
26
|
-
color = 'neutral-800',
|
|
27
|
-
size = 'lg',
|
|
28
|
-
tag = 'h2',
|
|
29
|
-
className,
|
|
30
|
-
}: HeadingProps) => {
|
|
31
|
-
const fontSize = {
|
|
32
|
-
sm: 'text-sm',
|
|
33
|
-
md: 'text-md',
|
|
34
|
-
lg: 'text-lg',
|
|
35
|
-
xl: 'text-xl',
|
|
36
|
-
'2xl': 'text-2xl',
|
|
37
|
-
'3xl': 'text-3xl',
|
|
38
|
-
'4xl': 'text-4xl',
|
|
39
|
-
'5xl': 'text-5xl',
|
|
40
|
-
'6xl': 'text-6xl',
|
|
41
|
-
'7xl': 'text-7xl',
|
|
42
|
-
'8xl': 'text-8xl',
|
|
43
|
-
'9xl': 'text-9xl',
|
|
44
|
-
}[size]
|
|
45
|
-
|
|
46
|
-
const Tag = tag as React.ElementType
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<Tag className={twMerge(`text-${color} ${fontSize}`, className)}>
|
|
50
|
-
{children}
|
|
51
|
-
</Tag>
|
|
52
|
-
)
|
|
53
|
-
}
|