@datability/8ui 1.0.0 → 1.1.0

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.
Files changed (84) hide show
  1. package/.prettierrc +8 -0
  2. package/.vscode/extensions.json +6 -0
  3. package/README.md +1 -3
  4. package/declaration.d.ts +10 -0
  5. package/docker-compose.yml +20 -0
  6. package/eslint.config.js +23 -0
  7. package/{dist/index.html → index.html} +1 -2
  8. package/package.json +13 -14
  9. package/src/App.tsx +370 -0
  10. package/src/components/assets/closed.svg +4 -0
  11. package/src/components/assets/expand-arrow.svg +3 -0
  12. package/src/components/assets/visibility-off.svg +5 -0
  13. package/src/components/assets/visibility.svg +5 -0
  14. package/src/components/blackdrop/index.scss +16 -0
  15. package/src/components/blackdrop/index.tsx +18 -0
  16. package/src/components/blackdrop/index.type.ts +7 -0
  17. package/src/components/button/index.scss +40 -0
  18. package/src/components/button/index.tsx +44 -0
  19. package/src/components/button/index.type.ts +13 -0
  20. package/src/components/chip/index.scss +32 -0
  21. package/src/components/chip/index.tsx +39 -0
  22. package/src/components/chip/index.type.ts +12 -0
  23. package/src/components/context.tsx +26 -0
  24. package/src/components/divider/index.scss +4 -0
  25. package/src/components/divider/index.tsx +13 -0
  26. package/src/components/index.ts +62 -0
  27. package/src/components/input/extend.scss +19 -0
  28. package/src/components/input/input-auto-complete/index.scss +53 -0
  29. package/src/components/input/input-auto-complete/index.tsx +140 -0
  30. package/src/components/input/input-auto-complete/index.type.tsx +13 -0
  31. package/src/components/input/input-base/index.scss +14 -0
  32. package/src/components/input/input-base/index.tsx +39 -0
  33. package/src/components/input/input-base/index.type.tsx +13 -0
  34. package/src/components/input/input-basic/index.scss +9 -0
  35. package/src/components/input/input-basic/index.tsx +47 -0
  36. package/src/components/input/input-basic/index.type.tsx +8 -0
  37. package/src/components/input/input-checkbox/index.scss +30 -0
  38. package/src/components/input/input-checkbox/index.tsx +69 -0
  39. package/src/components/input/input-checkbox/index.type.tsx +11 -0
  40. package/src/components/input/input-date/index.scss +102 -0
  41. package/src/components/input/input-date/index.tsx +354 -0
  42. package/src/components/input/input-date/index.type.tsx +11 -0
  43. package/src/components/input/input-date-range/index.scss +101 -0
  44. package/src/components/input/input-date-range/index.tsx +284 -0
  45. package/src/components/input/input-date-range/index.type.tsx +11 -0
  46. package/src/components/input/input-date-time/index.scss +179 -0
  47. package/src/components/input/input-date-time/index.tsx +367 -0
  48. package/src/components/input/input-date-time/index.type.tsx +11 -0
  49. package/src/components/input/input-number/index.scss +9 -0
  50. package/src/components/input/input-number/index.tsx +118 -0
  51. package/src/components/input/input-number/index.type.tsx +11 -0
  52. package/src/components/input/input-password/index.scss +22 -0
  53. package/src/components/input/input-password/index.tsx +60 -0
  54. package/src/components/input/input-password/index.type.tsx +8 -0
  55. package/src/components/input/input-radio/index.scss +35 -0
  56. package/src/components/input/input-radio/index.tsx +72 -0
  57. package/src/components/input/input-radio/index.type.tsx +12 -0
  58. package/src/components/input/input-select/index.scss +81 -0
  59. package/src/components/input/input-select/index.tsx +113 -0
  60. package/src/components/input/input-select/index.type.tsx +15 -0
  61. package/src/components/input/input-switch/index.scss +84 -0
  62. package/src/components/input/input-switch/index.tsx +44 -0
  63. package/src/components/input/input-switch/index.type.tsx +4 -0
  64. package/src/components/input/input-textarea/index.scss +10 -0
  65. package/src/components/input/input-textarea/index.tsx +48 -0
  66. package/src/components/input/input-textarea/index.type.tsx +10 -0
  67. package/src/components/menu/index.scss +30 -0
  68. package/src/components/menu/index.tsx +136 -0
  69. package/src/components/menu/index.type.ts +8 -0
  70. package/src/components/modal/index.scss +33 -0
  71. package/src/components/modal/index.tsx +99 -0
  72. package/src/components/modal/index.type.tsx +8 -0
  73. package/src/index.scss +44 -0
  74. package/src/index.ts +62 -0
  75. package/src/logoDownload.svg +3 -0
  76. package/src/main.tsx +9 -0
  77. package/tsconfig.app.json +28 -0
  78. package/tsconfig.json +42 -0
  79. package/tsconfig.node.json +29 -0
  80. package/vite.config.d.ts +2 -0
  81. package/vite.config.ts +35 -0
  82. package/dist/assets/index-BYmsRLQS.js +0 -48
  83. package/dist/assets/index-QxCDX2bt.css +0 -1
  84. /package/{dist → public}/vite.svg +0 -0
@@ -0,0 +1,44 @@
1
+ // Lib
2
+ import React from "react"
3
+
4
+ // Images
5
+
6
+ // Include in project
7
+ import "./index.scss"
8
+ import type { PropsButton } from "./index.type"
9
+
10
+ const Button: React.FC<PropsButton> = ({
11
+ name,
12
+ type = "button",
13
+ disabled = false,
14
+ onClick,
15
+ startIcon: StartIcon,
16
+ endIcon: EndIcon,
17
+ className,
18
+ style,
19
+ isLoading = false,
20
+ }) => {
21
+ return (
22
+ <button
23
+ type={type}
24
+ className={`DBui-button ${className ? className : ""}`}
25
+ onClick={onClick && onClick}
26
+ disabled={isLoading || disabled}
27
+ style={style ? style : {}}
28
+ >
29
+ {isLoading ? (
30
+ <div className="DBui-loaderSpinButton" />
31
+ ) : (
32
+ <>
33
+ {StartIcon && typeof StartIcon === "string" && <img src={StartIcon} alt="startIcon" />}
34
+ {StartIcon && typeof StartIcon !== "string" && <StartIcon alt="startIcon" />}
35
+ {name}
36
+ {EndIcon && typeof EndIcon === "string" && <img src={EndIcon} alt="endIcon" />}
37
+ {EndIcon && typeof EndIcon !== "string" && <EndIcon alt="endIcon" />}
38
+ </>
39
+ )}
40
+ </button>
41
+ )
42
+ }
43
+
44
+ export default Button
@@ -0,0 +1,13 @@
1
+ import type { CSSProperties, ElementType } from "react"
2
+
3
+ export type PropsButton = {
4
+ name?: string
5
+ type?: "button" | "submit"
6
+ disabled?: boolean
7
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void
8
+ startIcon?: string | ElementType
9
+ endIcon?: string | ElementType
10
+ className?: string
11
+ style?: CSSProperties
12
+ isLoading?: boolean
13
+ }
@@ -0,0 +1,32 @@
1
+ .DBui-chip {
2
+ display: flex;
3
+ align-items: center;
4
+ width: fit-content;
5
+ padding: 0.4em 0.5em;
6
+ border-radius: 0.3em;
7
+ border: 1px solid #03287E;
8
+ background-color: #618aea;
9
+ gap: 0.5em;
10
+
11
+ &[data-checked='true'] {
12
+ cursor: pointer;
13
+
14
+ &:hover {
15
+ opacity: 0.5;
16
+ }
17
+ }
18
+
19
+ .DBui-chipIcon {
20
+ width: 20px;
21
+ height: 20px;
22
+
23
+ &[data-checked='true'] {
24
+ cursor: pointer;
25
+
26
+ &:hover {
27
+ opacity: 0.5;
28
+ }
29
+ }
30
+ }
31
+ }
32
+
@@ -0,0 +1,39 @@
1
+ // Lib
2
+ import React from "react"
3
+
4
+ //Images
5
+ import closedSVG from "../assets/closed.svg"
6
+
7
+ // Include in project
8
+ import type { PropsChip } from "./index.type"
9
+ import "./index.scss"
10
+
11
+ const Chip: React.FC<PropsChip> = ({ label, onDelete, onClick, icon: Icon, className, style }) => {
12
+ return (
13
+ <div
14
+ className={`DBui-chip ${className ? className : ""}`}
15
+ style={style ? style : {}}
16
+ data-checked={Boolean(onClick)}
17
+ onClick={onClick && onClick}
18
+ >
19
+ {label}
20
+ {onDelete && !Icon && (
21
+ <img src={closedSVG} alt="icon" className="DBui-chipIcon" data-checked={Boolean(onDelete)} onClick={onDelete} />
22
+ )}
23
+ {onDelete && Icon && typeof Icon === "string" && (
24
+ <img src={Icon} alt="icon" className="DBui-chipIcon" data-checked={Boolean(onDelete)} onClick={onDelete} />
25
+ )}
26
+ {onDelete && Icon && typeof Icon !== "string" && (
27
+ <Icon alt="icon" className="DBui-chipIcon" data-checked={Boolean(onDelete)} onClick={onDelete} />
28
+ )}
29
+ {!onDelete && Icon && typeof Icon === "string" && (
30
+ <img src={Icon} alt="icon" className="DBui-chipIcon" data-checked={Boolean(onDelete)} onClick={onDelete} />
31
+ )}
32
+ {!onDelete && Icon && typeof Icon !== "string" && (
33
+ <Icon alt="icon" className="DBui-chipIcon" data-checked={Boolean(onDelete)} onClick={onDelete} />
34
+ )}
35
+ </div>
36
+ )
37
+ }
38
+
39
+ export default Chip
@@ -0,0 +1,12 @@
1
+ // Lib
2
+
3
+ import type { CSSProperties, ElementType } from "react"
4
+
5
+ export type PropsChip = {
6
+ label: string
7
+ onDelete?: () => void
8
+ onClick?: () => void
9
+ icon?: string | ElementType
10
+ className?: string
11
+ style?: CSSProperties
12
+ }
@@ -0,0 +1,26 @@
1
+ import React, { createContext, useState } from "react"
2
+
3
+ type TContext = {
4
+ openModalCount: number
5
+ setOpenModalCount?: React.Dispatch<React.SetStateAction<number>>
6
+ }
7
+
8
+ // eslint-disable-next-line react-refresh/only-export-components
9
+ export const DBuiContext = createContext<TContext>({
10
+ openModalCount: 0,
11
+ })
12
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
+ export const DBuiProvider = (props: any) => {
14
+ const [openModalCount, setOpenModalCount] = useState(0)
15
+
16
+ return (
17
+ <DBuiContext.Provider
18
+ value={{
19
+ openModalCount,
20
+ setOpenModalCount,
21
+ }}
22
+ >
23
+ {props.children}
24
+ </DBuiContext.Provider>
25
+ )
26
+ }
@@ -0,0 +1,4 @@
1
+ .DBui-divider {
2
+ border: 1px solid #9E9E9E;
3
+ width: 100%;
4
+ }
@@ -0,0 +1,13 @@
1
+ // Lib
2
+ import React from 'react'
3
+
4
+ // Images
5
+
6
+ // Include in project
7
+ import './index.scss'
8
+
9
+ const Divider: React.FC = () => {
10
+ return <hr className="DBui-divider" />
11
+ }
12
+
13
+ export default Divider
@@ -0,0 +1,62 @@
1
+ export { default as Button } from "./button"
2
+ export type { PropsButton } from "./button/index.type"
3
+
4
+ export { default as Blackdrop } from "./blackdrop" // Need variable --z-index-backdrop
5
+ export type { PropsBlackdrop } from "./blackdrop/index.type"
6
+
7
+ export { default as Chip } from "./chip"
8
+ export type { PropsChip } from "./chip/index.type"
9
+
10
+ export { default as Divider } from "./divider"
11
+
12
+ export { default as Menu } from "./menu" // Need variable --z-index-menu
13
+ export type { PropsMenu } from "./menu/index.type"
14
+
15
+ export { default as Modal } from "./modal" // Need variable --z-index-normale
16
+ export type { PropsModal } from "./modal/index.type"
17
+
18
+ export { default as Input } from "./input/input-basic"
19
+ export type { PropsInputBasic as PropsInput } from "./input/input-basic/index.type"
20
+
21
+ export { default as InputNumber } from "./input/input-number"
22
+ export type { PropsInputNumber } from "./input/input-number/index.type"
23
+
24
+ export { default as InputDate } from "./input/input-date"
25
+ export type { PropsInputDate } from "./input/input-date/index.type"
26
+
27
+ export { default as InputDateRange } from "./input/input-date-range"
28
+ export type { PropsInputDateRange } from "./input/input-date-range/index.type"
29
+
30
+ export { default as InputDateTime } from "./input/input-date-time"
31
+ export type { PropsInputDateTime } from "./input/input-date-time/index.type"
32
+
33
+ export { default as InputPassword } from "./input/input-password"
34
+ export type { PropsInputPassword } from "./input/input-password/index.type"
35
+
36
+ export { default as InputRadio } from "./input/input-radio"
37
+ export type { PropsInputRadio } from "./input/input-radio/index.type"
38
+
39
+ export { default as InputCheckbox } from "./input/input-checkbox"
40
+ export type { PropsInputCheckbox } from "./input/input-checkbox/index.type"
41
+
42
+ export { default as InputTextarea } from "./input/input-textarea"
43
+ export type { PropsInputTextarea } from "./input/input-textarea/index.type"
44
+
45
+ export { default as InputSelect } from "./input/input-select"
46
+ export type { PropsInputSelect } from "./input/input-select/index.type"
47
+
48
+ export { default as InputAutoComplete } from "./input/input-auto-complete"
49
+ export type { PropsInputAutoComplete } from "./input/input-auto-complete/index.type"
50
+
51
+ export { default as InputSwitch } from "./input/input-switch"
52
+ export type { PropsInputSwitch } from "./input/input-switch/index.type"
53
+
54
+ // Type
55
+ export type TValueOption = string | number
56
+ export type TOption = {
57
+ label: string
58
+ value: TValueOption
59
+ }
60
+
61
+ // Context
62
+ export { DBuiContext, DBuiProvider } from "./context"
@@ -0,0 +1,19 @@
1
+ // Disable
2
+ .DBui-disabled {
3
+ cursor: not-allowed;
4
+ background-color: #FAFAFA;
5
+ color: #000000;
6
+ }
7
+
8
+ .DBui-input {
9
+ width: 100%;
10
+ padding: 0.3em 0.5em;
11
+ border-radius: 0.3em;
12
+ border: 1px solid #E3E3E8;
13
+ background-color: #FFFFFF;
14
+ color: #000000;
15
+
16
+ &[data-invalid='true'] {
17
+ border: 1px solid #EB5757;
18
+ }
19
+ }
@@ -0,0 +1,53 @@
1
+ @import '../extend.scss';
2
+
3
+ .DBui-wrapInputAutoComplete {
4
+ @extend .DBui-input;
5
+
6
+ padding: 0.4em 0.5em;
7
+ display: flex;
8
+ align-items: center;
9
+ gap: 0.3em;
10
+ height: 36px;
11
+
12
+ &[data-disabled='true'] {
13
+ @extend .DBui-disabled;
14
+ }
15
+
16
+ .DBui-wrapSelectValueInputAutoComplete {
17
+ display: flex;
18
+ align-items: center;
19
+
20
+ .DBui-iconInputAutoComplete {
21
+ width: 20px;
22
+ color: #E3E3E8;
23
+ cursor: pointer;
24
+ }
25
+ }
26
+
27
+ .DBui-inputAutoComplete {
28
+ border: none;
29
+ background-color: #FFFFFF;
30
+ align-items: center;
31
+ width: 100%;
32
+
33
+ &:disabled {
34
+ @extend .DBui-disabled;
35
+ }
36
+ }
37
+ }
38
+
39
+ .DBui-menuItemInputAutoComplete {
40
+ background-color: #FFFFFF;
41
+ color: #000000;
42
+ padding: 0.3em 0.5em;
43
+ cursor: pointer;
44
+
45
+ &:hover {
46
+ background-color: #FAFAFA;
47
+ }
48
+
49
+ &[data-checked='true'] {
50
+ background-color: #0045a5;
51
+ color: #FFFFFF;
52
+ }
53
+ }
@@ -0,0 +1,140 @@
1
+ // Lib
2
+ import React, { useState } from "react"
3
+ import { Controller, useFormContext } from "react-hook-form"
4
+
5
+ // Images
6
+ import closedSVG from "../../assets/closed.svg"
7
+
8
+ // Include in project
9
+ import "./index.scss"
10
+ import InputBase from "../input-base"
11
+ import Menu from "../../menu"
12
+ import { Chip, type TValueOption } from "../.."
13
+ import type { PropsInputAutoComplete } from "./index.type"
14
+
15
+ const InputAutoComplete: React.FC<PropsInputAutoComplete> = ({
16
+ name,
17
+ label,
18
+ placeholder,
19
+ disabled = false,
20
+ require = false,
21
+ fullWidth = false,
22
+ options,
23
+ isMultiple = false,
24
+ isInModal = false,
25
+ }) => {
26
+ const { control } = useFormContext()
27
+ const [searchText, setSearchText] = useState("")
28
+
29
+ return (
30
+ <Controller
31
+ name={name}
32
+ control={control}
33
+ render={({ field, fieldState }) => {
34
+ const value: TValueOption[] = field.value ?? []
35
+ const { onChange } = field
36
+ const { invalid, error } = fieldState
37
+
38
+ const suggestions = options.filter((opt) => opt.label.toLowerCase().includes(searchText.toLowerCase()))
39
+
40
+ const handleSelect = (val: TValueOption, close: () => void) => {
41
+ setSearchText("")
42
+ close()
43
+
44
+ if (isMultiple) {
45
+ onChange([...value, val])
46
+ } else {
47
+ onChange([val])
48
+ }
49
+ }
50
+
51
+ const handleSearchChange = (val: string) => {
52
+ setSearchText(val)
53
+ if (!isMultiple) {
54
+ onChange([val])
55
+ }
56
+ }
57
+
58
+ const handleClearChip = (e: React.MouseEvent<HTMLImageElement>, target: TValueOption) => {
59
+ e.stopPropagation()
60
+ setSearchText("")
61
+ onChange(value.filter((v) => v !== target))
62
+ }
63
+
64
+ const selectedValue = value[0] || searchText
65
+ const selectedOption = options.find((o) => o.label === selectedValue || o.value === selectedValue)
66
+
67
+ return (
68
+ <InputBase
69
+ name={name}
70
+ label={label}
71
+ require={require}
72
+ fullWidth={fullWidth}
73
+ isInvalid={invalid}
74
+ errorMessage={error?.message}
75
+ >
76
+ <Menu
77
+ isInModal={isInModal}
78
+ disabled={disabled}
79
+ trigger={() => (
80
+ <div className="DBui-wrapInputAutoComplete" data-invalid={invalid} data-disabled={disabled}>
81
+ {isMultiple &&
82
+ value.map((v, index) => {
83
+ const selected = options.find((o) => o.value === v)
84
+ if (!selected) return null
85
+
86
+ if (disabled) {
87
+ return <Chip key={index} label={selected.label} />
88
+ }
89
+
90
+ return (
91
+ <div key={index} className="DBui-wrapSelectValueInputAutoComplete">
92
+ <p>
93
+ <small>{selected.label}</small>
94
+ </p>
95
+ <img
96
+ src={closedSVG}
97
+ className="DBui-iconInputAutoComplete"
98
+ onClick={(e) => handleClearChip(e, v)}
99
+ />
100
+ </div>
101
+ )
102
+ })}
103
+
104
+ <input
105
+ className="DBui-inputAutoComplete"
106
+ autoComplete="off"
107
+ type="text"
108
+ placeholder={!value.length ? placeholder : ""}
109
+ disabled={disabled}
110
+ value={isMultiple ? searchText : selectedOption?.label || value[0] || ""}
111
+ onChange={(e) => handleSearchChange(e.target.value)}
112
+ />
113
+ </div>
114
+ )}
115
+ >
116
+ {({ close }) =>
117
+ suggestions.map((opt, index) => {
118
+ const isChecked = value.includes(opt.value)
119
+
120
+ return (
121
+ <p
122
+ key={index}
123
+ className="DBui-menuItemInputAutoComplete"
124
+ data-checked={isChecked}
125
+ onClick={() => !isChecked && handleSelect(opt.value, close)}
126
+ >
127
+ {opt.label}
128
+ </p>
129
+ )
130
+ })
131
+ }
132
+ </Menu>
133
+ </InputBase>
134
+ )
135
+ }}
136
+ />
137
+ )
138
+ }
139
+
140
+ export default InputAutoComplete
@@ -0,0 +1,13 @@
1
+ import type { TOption } from "../.."
2
+
3
+ export type PropsInputAutoComplete = {
4
+ name: string
5
+ label?: string
6
+ placeholder?: string
7
+ disabled?: boolean
8
+ require?: boolean
9
+ fullWidth?: boolean
10
+ options: TOption[]
11
+ isMultiple?: boolean
12
+ isInModal?: boolean
13
+ }
@@ -0,0 +1,14 @@
1
+ .DBui-inputBase {
2
+ display: flex;
3
+ flex-direction: column;
4
+
5
+ &[data-invalid='true'] {
6
+ .DBui-inputLabel {
7
+ color: #EB5757;
8
+ }
9
+ }
10
+
11
+ .DBui-dataInvalid {
12
+ color: #EB5757;
13
+ }
14
+ }
@@ -0,0 +1,39 @@
1
+ // Lib
2
+ import React from "react"
3
+
4
+ // Include in project
5
+ import "./index.scss"
6
+ import type { PropsInputBase } from "./index.type"
7
+
8
+ const InputBase: React.FC<PropsInputBase> = ({
9
+ label,
10
+ require = false,
11
+ fullWidth = false,
12
+ children,
13
+ isInvalid,
14
+ errorMessage,
15
+ }) => {
16
+ const styleDiv = {
17
+ width: !fullWidth ? "fit-content" : "100%",
18
+ }
19
+
20
+ return (
21
+ <div className="DBui-inputBase" style={styleDiv} data-invalid={isInvalid}>
22
+ {label && (
23
+ <p className="DBui-inputLabel">
24
+ <small>{label}</small> {require && <span className="DBui-dataInvalid">*</span>}
25
+ </p>
26
+ )}
27
+
28
+ {children}
29
+
30
+ {isInvalid && errorMessage && (
31
+ <p className="DBui-dataInvalid">
32
+ <small>{errorMessage.toString()}</small>
33
+ </p>
34
+ )}
35
+ </div>
36
+ )
37
+ }
38
+
39
+ export default InputBase
@@ -0,0 +1,13 @@
1
+ import type { JSX } from "react"
2
+ import type { FieldError, FieldErrorsImpl, Merge } from "react-hook-form"
3
+
4
+ export type PropsInputBase = {
5
+ name: string
6
+ label?: string
7
+ require?: boolean
8
+ fullWidth?: boolean
9
+ children: JSX.Element | JSX.Element[]
10
+ isInvalid: boolean
11
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
+ errorMessage: string | FieldError | Merge<FieldError, FieldErrorsImpl<any>> | undefined
13
+ }
@@ -0,0 +1,9 @@
1
+ @import '../extend.scss';
2
+
3
+ .DBui-inputBasic {
4
+ @extend .DBui-input;
5
+
6
+ &:disabled {
7
+ @extend .DBui-disabled;
8
+ }
9
+ }
@@ -0,0 +1,47 @@
1
+ // Lib
2
+ import React from "react"
3
+ import { useFormContext, useFormState } from "react-hook-form"
4
+
5
+ // Include in project
6
+ import "./index.scss"
7
+ import InputBase from "../input-base"
8
+ import type { PropsInputBasic } from "./index.type"
9
+
10
+ const Input: React.FC<PropsInputBasic> = ({
11
+ name,
12
+ label,
13
+ placeholder,
14
+ disabled = false,
15
+ require = false,
16
+ fullWidth = false,
17
+ }) => {
18
+ const { register, control } = useFormContext()
19
+ const { errors } = useFormState({
20
+ control,
21
+ name,
22
+ })
23
+
24
+ const error = errors?.[name]
25
+ const isInvalid = Boolean(error)
26
+ return (
27
+ <InputBase
28
+ name={name}
29
+ label={label}
30
+ require={require}
31
+ fullWidth={fullWidth}
32
+ isInvalid={isInvalid}
33
+ errorMessage={error?.message}
34
+ >
35
+ <input
36
+ {...register(name)}
37
+ className="DBui-inputBasic"
38
+ type="text"
39
+ placeholder={placeholder}
40
+ disabled={disabled}
41
+ data-invalid={isInvalid}
42
+ />
43
+ </InputBase>
44
+ )
45
+ }
46
+
47
+ export default Input
@@ -0,0 +1,8 @@
1
+ export type PropsInputBasic = {
2
+ name: string
3
+ label?: string
4
+ placeholder?: string
5
+ disabled?: boolean
6
+ require?: boolean
7
+ fullWidth?: boolean
8
+ }
@@ -0,0 +1,30 @@
1
+ @import '../extend.scss';
2
+
3
+ .DBui-wrapInputCheckboxList {
4
+ display: flex;
5
+ width: 100%;
6
+ gap: 1em;
7
+
8
+ .DBui-wrapInputCheckbox {
9
+ display: flex;
10
+ align-items: center;
11
+ gap: 0.3em;
12
+
13
+ .DBui-labelCheckbox {
14
+ &[data-invalid='true'] {
15
+ color: #EB5757;
16
+ }
17
+ }
18
+
19
+ .DBui-inputCheckbox {
20
+ width: 100%;
21
+ border-radius: 0.3em;
22
+ width: 18px;
23
+ height: 18px;
24
+
25
+ &:disabled {
26
+ @extend .DBui-disabled;
27
+ }
28
+ }
29
+ }
30
+ }