♻️ Re-organize workspace folders
This commit is contained in:
22
packages/embeds/js/src/components/inputs/ShortTextInput.tsx
Normal file
22
packages/embeds/js/src/components/inputs/ShortTextInput.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { splitProps } from 'solid-js'
|
||||
import { JSX } from 'solid-js/jsx-runtime'
|
||||
|
||||
type ShortTextInputProps = {
|
||||
ref: HTMLInputElement | undefined
|
||||
onInput: (value: string) => void
|
||||
} & Omit<JSX.InputHTMLAttributes<HTMLInputElement>, 'onInput'>
|
||||
|
||||
export const ShortTextInput = (props: ShortTextInputProps) => {
|
||||
const [local, others] = splitProps(props, ['ref', 'onInput'])
|
||||
|
||||
return (
|
||||
<input
|
||||
ref={props.ref}
|
||||
class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"
|
||||
type="text"
|
||||
style={{ 'font-size': '16px' }}
|
||||
onInput={(e) => local.onInput(e.currentTarget.value)}
|
||||
{...others}
|
||||
/>
|
||||
)
|
||||
}
|
||||
26
packages/embeds/js/src/components/inputs/Textarea.tsx
Normal file
26
packages/embeds/js/src/components/inputs/Textarea.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import { isMobile } from '@/utils/isMobileSignal'
|
||||
import { splitProps } from 'solid-js'
|
||||
import { JSX } from 'solid-js/jsx-runtime'
|
||||
|
||||
type TextareaProps = {
|
||||
ref: HTMLTextAreaElement | undefined
|
||||
onInput: (value: string) => void
|
||||
} & Omit<JSX.TextareaHTMLAttributes<HTMLTextAreaElement>, 'onInput'>
|
||||
|
||||
export const Textarea = (props: TextareaProps) => {
|
||||
const [local, others] = splitProps(props, ['ref', 'onInput'])
|
||||
|
||||
return (
|
||||
<textarea
|
||||
ref={local.ref}
|
||||
class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input"
|
||||
rows={6}
|
||||
data-testid="textarea"
|
||||
required
|
||||
style={{ 'font-size': '16px' }}
|
||||
autofocus={!isMobile()}
|
||||
onInput={(e) => local.onInput(e.currentTarget.value)}
|
||||
{...others}
|
||||
/>
|
||||
)
|
||||
}
|
||||
2
packages/embeds/js/src/components/inputs/index.ts
Normal file
2
packages/embeds/js/src/components/inputs/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './ShortTextInput'
|
||||
export * from './Textarea'
|
||||
Reference in New Issue
Block a user