boflow-components 1.0.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.
- package/README.md +23 -0
- package/dist/App.d.ts +2 -0
- package/dist/App.js +411 -0
- package/dist/components/Button/Button.d.ts +3 -0
- package/dist/components/Button/Button.js +37 -0
- package/dist/components/Button/button.css +71 -0
- package/dist/components/Checkbox/Checkbox.d.ts +3 -0
- package/dist/components/Checkbox/Checkbox.js +33 -0
- package/dist/components/Checkbox/checkbox.css +74 -0
- package/dist/components/Input/Input.d.ts +3 -0
- package/dist/components/Input/Input.js +54 -0
- package/dist/components/Input/input.css +106 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +4 -0
- package/dist/index.css +1948 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/root.d.ts +1 -0
- package/dist/root.js +12 -0
- package/dist/types/Button.d.ts +13 -0
- package/dist/types/Button.js +7 -0
- package/dist/types/Checkbox.d.ts +13 -0
- package/dist/types/Checkbox.js +0 -0
- package/dist/types/Input.d.ts +8 -0
- package/dist/types/Input.js +0 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.js +2 -0
- package/package.json +49 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useId } from "react";
|
|
3
|
+
import "./input.css";
|
|
4
|
+
const Input = /*#__PURE__*/ forwardRef(({ label, hint, error, leftIcon, rightIcon, className = '', disabled, value, defaultValue, onChange, ...props }, ref)=>{
|
|
5
|
+
const defaultId = useId();
|
|
6
|
+
const id = props.id || defaultId;
|
|
7
|
+
const hasValue = void 0 !== value ? String(value).length > 0 : void 0 !== defaultValue ? String(defaultValue).length > 0 : false;
|
|
8
|
+
const wrapperClasses = [
|
|
9
|
+
'bo-input-wrapper',
|
|
10
|
+
disabled ? 'bo-input-wrapper--disabled' : '',
|
|
11
|
+
error ? 'bo-input-wrapper--error' : '',
|
|
12
|
+
hasValue ? 'bo-input-wrapper--filled' : '',
|
|
13
|
+
className
|
|
14
|
+
].filter(Boolean).join(' ');
|
|
15
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
16
|
+
className: "bo-input-container",
|
|
17
|
+
children: [
|
|
18
|
+
label && /*#__PURE__*/ jsx("label", {
|
|
19
|
+
htmlFor: id,
|
|
20
|
+
className: `bo-input-label ${disabled ? 'bo-input-label--disabled' : ''}`,
|
|
21
|
+
children: label
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ jsxs("div", {
|
|
24
|
+
className: wrapperClasses,
|
|
25
|
+
children: [
|
|
26
|
+
leftIcon && /*#__PURE__*/ jsx("div", {
|
|
27
|
+
className: "bo-input-prefix",
|
|
28
|
+
children: leftIcon
|
|
29
|
+
}),
|
|
30
|
+
/*#__PURE__*/ jsx("input", {
|
|
31
|
+
id: id,
|
|
32
|
+
ref: ref,
|
|
33
|
+
className: "bo-input",
|
|
34
|
+
disabled: disabled,
|
|
35
|
+
value: value,
|
|
36
|
+
defaultValue: defaultValue,
|
|
37
|
+
onChange: onChange,
|
|
38
|
+
...props
|
|
39
|
+
}),
|
|
40
|
+
rightIcon && /*#__PURE__*/ jsx("div", {
|
|
41
|
+
className: "bo-input-suffix",
|
|
42
|
+
children: rightIcon
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
}),
|
|
46
|
+
hint && /*#__PURE__*/ jsx("div", {
|
|
47
|
+
className: `bo-input-hint ${error ? 'bo-input-hint--error' : ''} ${disabled ? 'bo-input-hint--disabled' : ''}`,
|
|
48
|
+
children: hint
|
|
49
|
+
})
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
Input.displayName = 'Input';
|
|
54
|
+
export { Input };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
.bo-input-container {
|
|
2
|
+
gap: var(--spacing-2, 8px);
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: 100%;
|
|
5
|
+
display: flex;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.bo-input-label {
|
|
9
|
+
color: var(--neutral-13, #0d0d12);
|
|
10
|
+
font-family: Inter Tight, sans-serif;
|
|
11
|
+
font-size: 14px;
|
|
12
|
+
font-weight: 500;
|
|
13
|
+
line-height: 1.4;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.bo-input-label--disabled {
|
|
17
|
+
color: var(--neutral-7, #a4acb9);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.bo-input-wrapper {
|
|
21
|
+
border: 1px solid var(--neutral-5, #dfe1e7);
|
|
22
|
+
background: var(--neutral-2, #f8fafb);
|
|
23
|
+
width: 100%;
|
|
24
|
+
padding: 0 var(--spacing-4, 16px);
|
|
25
|
+
align-items: center;
|
|
26
|
+
gap: var(--spacing-2, 8px);
|
|
27
|
+
border-radius: 10px;
|
|
28
|
+
height: 48px;
|
|
29
|
+
transition: all .2s ease-in-out;
|
|
30
|
+
display: flex;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.bo-input-wrapper:hover:not(.bo-input-wrapper--disabled):not(.bo-input-wrapper--error) {
|
|
34
|
+
border-color: var(--neutral-6, #c1c7d0);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.bo-input-wrapper:focus-within:not(.bo-input-wrapper--disabled):not(.bo-input-wrapper--error) {
|
|
38
|
+
box-shadow: 0 0 0 1px var(--primary-500, #131313) inset, 0 0 1px 3px #1313131a;
|
|
39
|
+
border-color: #0000;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.bo-input-wrapper--error {
|
|
43
|
+
border-color: #0000;
|
|
44
|
+
box-shadow: inset 0 0 0 1px #ec778d, 0 0 1px 3px #df1c4126;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.bo-input-wrapper--disabled {
|
|
48
|
+
background: var(--neutral-2, #f8fafb);
|
|
49
|
+
border-color: var(--neutral-5, #dfe1e7);
|
|
50
|
+
cursor: not-allowed;
|
|
51
|
+
opacity: .7;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.bo-input-prefix, .bo-input-suffix {
|
|
55
|
+
color: var(--neutral-9, #666d80);
|
|
56
|
+
flex-shrink: 0;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
align-items: center;
|
|
59
|
+
display: flex;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.bo-input {
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
color: var(--neutral-9, #666d80);
|
|
66
|
+
background: none;
|
|
67
|
+
border: none;
|
|
68
|
+
outline: none;
|
|
69
|
+
flex-grow: 1;
|
|
70
|
+
padding: 0;
|
|
71
|
+
font-family: Inter Tight, sans-serif;
|
|
72
|
+
font-size: 16px;
|
|
73
|
+
font-style: normal;
|
|
74
|
+
font-weight: 400;
|
|
75
|
+
line-height: 160%;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.bo-input::placeholder {
|
|
79
|
+
color: var(--neutral-7, #a4acb9);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.bo-input-wrapper--filled .bo-input, .bo-input-wrapper:focus-within:not(.bo-input-wrapper--disabled) .bo-input, .bo-input-wrapper--error .bo-input {
|
|
83
|
+
color: var(--neutral-13, #0d0d12);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.bo-input-wrapper--disabled .bo-input {
|
|
87
|
+
color: var(--neutral-7, #a4acb9);
|
|
88
|
+
cursor: not-allowed;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.bo-input-hint {
|
|
92
|
+
color: var(--neutral-9, #666d80);
|
|
93
|
+
font-family: Inter Tight, sans-serif;
|
|
94
|
+
font-size: 14px;
|
|
95
|
+
font-weight: 400;
|
|
96
|
+
line-height: 1.4;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.bo-input-hint--error {
|
|
100
|
+
color: #ec778d;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.bo-input-hint--disabled {
|
|
104
|
+
color: var(--neutral-7, #a4acb9);
|
|
105
|
+
}
|
|
106
|
+
|