onchain-lexical-ui 0.0.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/README.md +5 -0
- package/package.json +221 -0
- package/src/Button.module.less +36 -0
- package/src/Button.tsx +50 -0
- package/src/ColorPicker.module.less +89 -0
- package/src/ColorPicker.tsx +369 -0
- package/src/ContentEditable.module.less +78 -0
- package/src/ContentEditable.tsx +41 -0
- package/src/Dialog.module.less +23 -0
- package/src/Dialog.tsx +34 -0
- package/src/DropDown.module.less +95 -0
- package/src/DropDown.tsx +267 -0
- package/src/DropdownColorPicker.tsx +41 -0
- package/src/EditorShellStyles/index.module.less +43 -0
- package/src/EditorShellStyles/index.tsx +18 -0
- package/src/EquationEditor.module.less +41 -0
- package/src/EquationEditor.tsx +49 -0
- package/src/ExcalidrawModal.module.less +62 -0
- package/src/ExcalidrawModal.tsx +252 -0
- package/src/FileInput.tsx +40 -0
- package/src/FlashMessage.module.less +28 -0
- package/src/FlashMessage.tsx +31 -0
- package/src/Icon/index.module.less +4 -0
- package/src/Icon/index.tsx +32 -0
- package/src/ImageResizer.tsx +317 -0
- package/src/Input.module.less +38 -0
- package/src/KatexEquationAlterer.module.less +41 -0
- package/src/KatexEquationAlterer.tsx +84 -0
- package/src/KatexRenderer.tsx +73 -0
- package/src/Modal.module.less +65 -0
- package/src/Modal.tsx +176 -0
- package/src/Select.module.less +41 -0
- package/src/Select.tsx +37 -0
- package/src/Skeleton.module.less +67 -0
- package/src/Skeleton.tsx +28 -0
- package/src/Switch.tsx +38 -0
- package/src/TextInput.tsx +48 -0
- package/src/utils/joinClasses.ts +13 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type {JSX} from 'react';
|
|
10
|
+
|
|
11
|
+
import * as React from 'react';
|
|
12
|
+
import {HTMLInputTypeAttribute} from 'react';
|
|
13
|
+
|
|
14
|
+
import Styles from './Input.module.less';
|
|
15
|
+
|
|
16
|
+
type Props = Readonly<{
|
|
17
|
+
'data-test-id'?: string;
|
|
18
|
+
label: string;
|
|
19
|
+
onChange: (val: string) => void;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
value: string;
|
|
22
|
+
type?: HTMLInputTypeAttribute;
|
|
23
|
+
}>;
|
|
24
|
+
|
|
25
|
+
export default function TextInput({
|
|
26
|
+
label,
|
|
27
|
+
value,
|
|
28
|
+
onChange,
|
|
29
|
+
placeholder = '',
|
|
30
|
+
'data-test-id': dataTestId,
|
|
31
|
+
type = 'text',
|
|
32
|
+
}: Props): JSX.Element {
|
|
33
|
+
return (
|
|
34
|
+
<div className={Styles.Input__wrapper}>
|
|
35
|
+
<label className={Styles.Input__label}>{label}</label>
|
|
36
|
+
<input
|
|
37
|
+
type={type}
|
|
38
|
+
className={Styles.Input__input}
|
|
39
|
+
placeholder={placeholder}
|
|
40
|
+
value={value}
|
|
41
|
+
onChange={(e) => {
|
|
42
|
+
onChange(e.target.value);
|
|
43
|
+
}}
|
|
44
|
+
data-test-id={dataTestId}
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export default function joinClasses(
|
|
10
|
+
...args: Array<string | boolean | null | undefined>
|
|
11
|
+
) {
|
|
12
|
+
return args.filter(Boolean).join(' ');
|
|
13
|
+
}
|