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.
@@ -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
+
@@ -0,0 +1,3 @@
1
+ export { Button } from './Button/Button';
2
+ export { Input } from './Input/Input';
3
+ export { Checkbox } from './Checkbox/Checkbox';
@@ -0,0 +1,4 @@
1
+ import { Button } from "./Button/Button.js";
2
+ import { Input } from "./Input/Input.js";
3
+ import { Checkbox } from "./Checkbox/Checkbox.js";
4
+ export { Button, Checkbox, Input };