2
0

💄 Show send icon by default on textboxes

Closes #1418
This commit is contained in:
Baptiste Arnaud
2024-04-24 16:56:33 +02:00
parent dc1929e15b
commit 873ba0bfda
10 changed files with 15 additions and 15 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@typebot.io/js",
"version": "0.2.78",
"version": "0.2.79",
"description": "Javascript library to display typebots on your website",
"type": "module",
"main": "dist/index.js",

View File

@ -16,6 +16,7 @@ export const SendButton = (props: SendButtonProps) => {
return (
<Button type="submit" {...others}>
{(isMobile() && !local.disableIcon) ||
!props.children ||
(typeof props.children === 'string' && isEmpty(props.children)) ? (
<SendIcon
class={'send-icon flex ' + (local.disableIcon ? 'hidden' : '')}

View File

@ -3,6 +3,7 @@ import { InputSubmitContent } from '@/types'
import { DateInputBlock } from '@typebot.io/schemas'
import { createSignal } from 'solid-js'
import { defaultDateInputOptions } from '@typebot.io/schemas/features/blocks/inputs/date/constants'
import clsx from 'clsx'
type Props = {
onSubmit: (inputValue: InputSubmitContent) => void
@ -19,7 +20,10 @@ export const DateForm = (props: Props) => {
<div class="flex flex-col">
<div class="flex items-center">
<form
class={'flex justify-between typebot-input pr-2 items-end'}
class={clsx(
'flex justify-between typebot-input pr-2',
props.options?.isRange ? 'items-end' : 'items-center'
)}
onSubmit={(e) => {
if (inputValues().from === '' && inputValues().to === '') return
e.preventDefault()
@ -95,8 +99,7 @@ export const DateForm = (props: Props) => {
</div>
<SendButton class="my-2 ml-2">
{props.options?.labels?.button ??
defaultDateInputOptions.labels.button}
{props.options?.labels?.button}
</SendButton>
</form>
</div>

View File

@ -68,8 +68,7 @@ export const EmailInput = (props: Props) => {
autocomplete="email"
/>
<SendButton type="button" class="my-2 ml-2" on:click={submit}>
{props.block.options?.labels?.button ??
defaultEmailInputOptions.labels.button}
{props.block.options?.labels?.button}
</SendButton>
</div>
)

View File

@ -80,8 +80,7 @@ export const NumberInput = (props: NumberInputProps) => {
step={props.block.options?.step ?? 'any'}
/>
<SendButton type="button" class="my-2 ml-2" on:click={submit}>
{props.block.options?.labels?.button ??
defaultNumberInputOptions.labels.button}
{props.block.options?.labels?.button}
</SendButton>
</div>
)

View File

@ -158,7 +158,7 @@ export const PhoneInput = (props: PhoneInputProps) => {
</div>
<SendButton type="button" class="my-2 ml-2" on:click={submit}>
{props.labels?.button ?? defaultPhoneInputOptions.labels.button}
{props.labels?.button}
</SendButton>
</div>
)

View File

@ -89,8 +89,7 @@ export const TextInput = (props: Props) => {
/>
)}
<SendButton type="button" class="my-2 ml-2" on:click={submit}>
{props.block.options?.labels?.button ??
defaultTextInputOptions.labels.button}
{props.block.options?.labels?.button}
</SendButton>
</div>
)

View File

@ -74,8 +74,7 @@ export const UrlInput = (props: Props) => {
autocomplete="url"
/>
<SendButton type="button" class="my-2 ml-2" on:click={submit}>
{props.block.options?.labels?.button ??
defaultUrlInputOptions.labels.button}
{props.block.options?.labels?.button}
</SendButton>
</div>
)

View File

@ -1,6 +1,6 @@
{
"name": "@typebot.io/nextjs",
"version": "0.2.78",
"version": "0.2.79",
"description": "Convenient library to display typebots on your Next.js website",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@ -1,6 +1,6 @@
{
"name": "@typebot.io/react",
"version": "0.2.78",
"version": "0.2.79",
"description": "Convenient library to display typebots on your React app",
"main": "dist/index.js",
"types": "dist/index.d.ts",