File tree Expand file tree Collapse file tree 4 files changed +477
-50
lines changed Expand file tree Collapse file tree 4 files changed +477
-50
lines changed Original file line number Diff line number Diff line change @@ -4,58 +4,60 @@ import { forwardRef } from "react";
4
4
5
5
import { useShadCNComponentsContext } from "../ShadCNComponentsContext" ;
6
6
7
- export const TextInput = forwardRef (
8
- ( props : ComponentProps [ "Generic" ] [ "Form" ] [ "TextInput" ] ) => {
9
- const {
10
- className,
11
- name,
12
- label,
13
- icon, // TODO: implement
14
- value,
15
- autoFocus,
16
- placeholder,
17
- onKeyDown,
18
- onChange,
19
- onSubmit,
20
- ...rest
21
- } = props ;
7
+ export const TextInput = forwardRef <
8
+ HTMLInputElement ,
9
+ ComponentProps [ "Generic" ] [ "Form" ] [ "TextInput" ]
10
+ > ( ( props , ref ) => {
11
+ const {
12
+ className,
13
+ name,
14
+ label,
15
+ icon, // TODO: implement
16
+ value,
17
+ autoFocus,
18
+ placeholder,
19
+ onKeyDown,
20
+ onChange,
21
+ onSubmit,
22
+ ...rest
23
+ } = props ;
22
24
23
- assertEmpty ( rest ) ;
25
+ assertEmpty ( rest ) ;
24
26
25
- const ShadCNComponents = useShadCNComponentsContext ( ) ! ;
26
-
27
- if ( ! label ) {
28
- return (
29
- < ShadCNComponents . Input . Input
30
- aria-label = { name }
31
- name = { name }
32
- autoFocus = { autoFocus }
33
- placeholder = { placeholder }
34
- value = { value }
35
- onKeyDown = { onKeyDown }
36
- onChange = { onChange }
37
- onSubmit = { onSubmit }
38
- />
39
- ) ;
40
- }
27
+ const ShadCNComponents = useShadCNComponentsContext ( ) ! ;
41
28
29
+ if ( ! label ) {
42
30
return (
43
- < div >
44
- < ShadCNComponents . Label . Label htmlFor = { label } >
45
- { label }
46
- </ ShadCNComponents . Label . Label >
47
- < ShadCNComponents . Input . Input
48
- className = { className }
49
- id = { label }
50
- name = { name }
51
- autoFocus = { autoFocus }
52
- placeholder = { placeholder }
53
- value = { value }
54
- onKeyDown = { onKeyDown }
55
- onChange = { onChange }
56
- onSubmit = { onSubmit }
57
- />
58
- </ div >
31
+ < ShadCNComponents . Input . Input
32
+ aria-label = { name }
33
+ name = { name }
34
+ autoFocus = { autoFocus }
35
+ placeholder = { placeholder }
36
+ value = { value }
37
+ onKeyDown = { onKeyDown }
38
+ onChange = { onChange }
39
+ onSubmit = { onSubmit }
40
+ ref = { ref }
41
+ />
59
42
) ;
60
43
}
61
- ) ;
44
+
45
+ return (
46
+ < div >
47
+ < ShadCNComponents . Label . Label htmlFor = { label } >
48
+ { label }
49
+ </ ShadCNComponents . Label . Label >
50
+ < ShadCNComponents . Input . Input
51
+ className = { className }
52
+ id = { label }
53
+ name = { name }
54
+ autoFocus = { autoFocus }
55
+ placeholder = { placeholder }
56
+ value = { value }
57
+ onKeyDown = { onKeyDown }
58
+ onChange = { onChange }
59
+ onSubmit = { onSubmit }
60
+ />
61
+ </ div >
62
+ ) ;
63
+ } ) ;
Original file line number Diff line number Diff line change
1
+ @import "./tailwindStyles.css" ;
1
2
@import url ("@blocknote/react/style.css" );
2
3
3
- @tailwind base;
4
4
@tailwind components;
5
5
@tailwind utilities;
6
6
69
69
.bn-shadcn * {
70
70
@apply bn-border-border;
71
71
}
72
+
72
73
.bn-shadcn .bn-editor {
73
74
@apply bn-bg-background bn-text-foreground;
74
75
}
You can’t perform that action at this time.
0 commit comments