diff --git a/apps/trading/components/market-selector/market-selector.tsx b/apps/trading/components/market-selector/market-selector.tsx index d182a814f..59ec08fc5 100644 --- a/apps/trading/components/market-selector/market-selector.tsx +++ b/apps/trading/components/market-selector/market-selector.tsx @@ -2,7 +2,7 @@ import { t } from '@vegaprotocol/i18n'; import uniqBy from 'lodash/uniqBy'; import type { MarketMaybeWithDataAndCandles } from '@vegaprotocol/markets'; import { - Input, + TradingInput, TinyScroll, VegaIcon, VegaIconNames, @@ -57,7 +57,7 @@ export const MarketSelector = ({ />
- setFilter((curr) => ({ ...curr, searchTerm: e.target.value })) } diff --git a/apps/trading/components/welcome-dialog/telemetry-approval.tsx b/apps/trading/components/welcome-dialog/telemetry-approval.tsx index c27506dfa..0fd49c983 100644 --- a/apps/trading/components/welcome-dialog/telemetry-approval.tsx +++ b/apps/trading/components/welcome-dialog/telemetry-approval.tsx @@ -1,4 +1,4 @@ -import { Checkbox } from '@vegaprotocol/ui-toolkit'; +import { TradingCheckbox } from '@vegaprotocol/ui-toolkit'; import { t } from '@vegaprotocol/i18n'; import { useTelemetryApproval } from '../../lib/hooks/use-telemetry-approval'; @@ -7,7 +7,7 @@ export const TelemetryApproval = ({ helpText }: { helpText: string }) => { return (
- {t('Share usage data')}} checked={isApproved} name="telemetry-approval" diff --git a/libs/accounts/src/lib/transfer-form.tsx b/libs/accounts/src/lib/transfer-form.tsx index 7aa0dcc0b..a3e81c4c7 100644 --- a/libs/accounts/src/lib/transfer-form.tsx +++ b/libs/accounts/src/lib/transfer-form.tsx @@ -9,13 +9,13 @@ import { import { t } from '@vegaprotocol/i18n'; import { Button, - FormGroup, - Input, - InputError, - RichSelect, - Select, + TradingFormGroup, + TradingInput, + TradingInputError, + TradingRichSelect, + TradingSelect, Tooltip, - Checkbox, + TradingCheckbox, } from '@vegaprotocol/ui-toolkit'; import type { Transfer } from '@vegaprotocol/wallet'; import { normalizeTransfer } from '@vegaprotocol/wallet'; @@ -130,12 +130,16 @@ export const TransferForm = ({ className="text-sm" data-testid="transfer-form" > - + setValue('toAddress', '')} select={ - + } input={ - {errors.toAddress?.message && ( - + {errors.toAddress.message} - + )} - - + + ( - ))} - + )} /> {errors.asset?.message && ( - {errors.asset.message} + + {errors.asset.message} + )} - - - + + {errors.amount?.message && ( - {errors.amount.message} + + {errors.amount.message} + )} - +
- { return ( - + ); }; diff --git a/libs/datagrid/src/lib/filters/date-range-filter.tsx b/libs/datagrid/src/lib/filters/date-range-filter.tsx index a2e8d8041..364d8289f 100644 --- a/libs/datagrid/src/lib/filters/date-range-filter.tsx +++ b/libs/datagrid/src/lib/filters/date-range-filter.tsx @@ -15,7 +15,7 @@ import { } from 'date-fns'; import { formatForInput } from '@vegaprotocol/utils'; import { t } from '@vegaprotocol/i18n'; -import { InputError } from '@vegaprotocol/ui-toolkit'; +import { TradingInputError } from '@vegaprotocol/ui-toolkit'; const defaultValue: Schema.DateRange = {}; export interface DateRangeFilterProps extends IFilterParams { @@ -195,7 +195,7 @@ export const DateRangeFilter = forwardRef( }, [value, props]); const notification = useMemo(() => { - const not = error ? {error} : null; + const not = error ? {error} : null; return (
{not}
); diff --git a/libs/deal-ticket/src/components/deal-ticket/deal-ticket-limit-amount.tsx b/libs/deal-ticket/src/components/deal-ticket/deal-ticket-limit-amount.tsx index 6691cd12c..327435b88 100644 --- a/libs/deal-ticket/src/components/deal-ticket/deal-ticket-limit-amount.tsx +++ b/libs/deal-ticket/src/components/deal-ticket/deal-ticket-limit-amount.tsx @@ -1,4 +1,8 @@ -import { FormGroup, Input, InputError } from '@vegaprotocol/ui-toolkit'; +import { + TradingFormGroup, + TradingInput, + TradingInputError, +} from '@vegaprotocol/ui-toolkit'; import { toDecimal, validateAmount } from '@vegaprotocol/utils'; import { t } from '@vegaprotocol/i18n'; import type { DealTicketAmountProps } from './deal-ticket-amount'; @@ -22,17 +26,17 @@ export const DealTicketLimitAmount = ({ const renderError = () => { if (sizeError) { return ( - + {sizeError} - + ); } if (priceError) { return ( - + {priceError} - + ); } @@ -43,7 +47,7 @@ export const DealTicketLimitAmount = ({
- ( - )} /> - +
@
- ( - )} /> - +
{renderError()} diff --git a/libs/deal-ticket/src/components/deal-ticket/deal-ticket-market-amount.tsx b/libs/deal-ticket/src/components/deal-ticket/deal-ticket-market-amount.tsx index a370bc78a..82e003364 100644 --- a/libs/deal-ticket/src/components/deal-ticket/deal-ticket-market-amount.tsx +++ b/libs/deal-ticket/src/components/deal-ticket/deal-ticket-market-amount.tsx @@ -4,7 +4,11 @@ import { validateAmount, } from '@vegaprotocol/utils'; import { t } from '@vegaprotocol/i18n'; -import { Input, InputError, Tooltip } from '@vegaprotocol/ui-toolkit'; +import { + TradingInput, + TradingInputError, + Tooltip, +} from '@vegaprotocol/ui-toolkit'; import { isMarketInAuction } from '@vegaprotocol/markets'; import type { DealTicketAmountProps } from './deal-ticket-amount'; import { Controller } from 'react-hook-form'; @@ -46,7 +50,7 @@ export const DealTicketMarketAmount = ({ validate: validateAmount(sizeStep, 'Size'), }} render={({ field, fieldState }) => ( -
{sizeError && ( - {sizeError} - + )}
); diff --git a/libs/deal-ticket/src/components/deal-ticket/deal-ticket-size-iceberg.tsx b/libs/deal-ticket/src/components/deal-ticket/deal-ticket-size-iceberg.tsx index 40a5480d3..1b69cac2b 100644 --- a/libs/deal-ticket/src/components/deal-ticket/deal-ticket-size-iceberg.tsx +++ b/libs/deal-ticket/src/components/deal-ticket/deal-ticket-size-iceberg.tsx @@ -4,9 +4,9 @@ import type { OrderFormValues } from '../../hooks/use-form-values'; import { toDecimal, validateAmount } from '@vegaprotocol/utils'; import { t } from '@vegaprotocol/i18n'; import { - FormGroup, - Input, - InputError, + TradingFormGroup, + TradingInput, + TradingInputError, Tooltip, } from '@vegaprotocol/ui-toolkit'; @@ -32,9 +32,9 @@ export const DealTicketSizeIceberg = ({ const renderPeakSizeError = () => { if (peakSizeError) { return ( - + {peakSizeError} - + ); } @@ -44,9 +44,9 @@ export const DealTicketSizeIceberg = ({ const renderMinimumSizeError = () => { if (minimumVisibleSizeError) { return ( - + {minimumVisibleSizeError} - + ); } @@ -57,7 +57,7 @@ export const DealTicketSizeIceberg = ({
- ( - )} /> - +
- ( - )} /> - +
{renderPeakSizeError()} diff --git a/libs/deal-ticket/src/components/deal-ticket/deal-ticket-stop-order.tsx b/libs/deal-ticket/src/components/deal-ticket/deal-ticket-stop-order.tsx index 754bf3a03..dbe61bdf3 100644 --- a/libs/deal-ticket/src/components/deal-ticket/deal-ticket-stop-order.tsx +++ b/libs/deal-ticket/src/components/deal-ticket/deal-ticket-stop-order.tsx @@ -10,13 +10,13 @@ import { import { useForm, Controller, useController } from 'react-hook-form'; import * as Schema from '@vegaprotocol/types'; import { - Radio, - RadioGroup, - Input, - Checkbox, - FormGroup, - InputError, - Select, + TradingRadio, + TradingRadioGroup, + TradingInput, + TradingCheckbox, + TradingFormGroup, + TradingInputError, + TradingSelect, Tooltip, } from '@vegaprotocol/ui-toolkit'; import { getDerivedPrice, type Market } from '@vegaprotocol/markets'; @@ -187,9 +187,9 @@ export const StopOrder = ({ market, marketPrice, submit }: StopOrderProps) => { }} /> {errors.type && ( - + {errors.type.message} - + )} { )} /> - + { const { onChange, value } = field; return ( - - { id="triggerDirection-risesAbove" label={'Rises above'} /> - { id="triggerDirection-fallsBelow" label={'Falls below'} /> - + ); }} /> @@ -250,7 +250,7 @@ export const StopOrder = ({ market, marketPrice, submit }: StopOrderProps) => { const { value, ...props } = field; return (
- { }} /> {errors.triggerPrice && ( - + {errors.triggerPrice.message} - + )}
)} @@ -299,7 +299,7 @@ export const StopOrder = ({ market, marketPrice, submit }: StopOrderProps) => { const { value, ...props } = field; return (
- { }} /> {errors.triggerTrailingPercentOffset && ( - + {errors.triggerTrailingPercentOffset.message} - + )}
)} @@ -326,25 +326,29 @@ export const StopOrder = ({ market, marketPrice, submit }: StopOrderProps) => { render={({ field }) => { const { onChange, value } = field; return ( - - - + - + ); }} /> -
+
- { render={({ field, fieldState }) => { const { value, ...props } = field; return ( - { ); }} /> - +
@
{type === Schema.OrderType.TYPE_LIMIT ? ( - { render={({ field, fieldState }) => { const { value, ...props } = field; return ( - { ); }} /> - + ) : (
{
{errors.size && ( - + {errors.size.message} - + )} {!errors.size && errors.price && type === Schema.OrderType.TYPE_LIMIT && ( - + {errors.price.message} - + )}
- { name="timeInForce" control={control} render={({ field, fieldState }) => ( - + )} /> - + {errors.timeInForce && ( - + {errors.timeInForce.message} - + )}
@@ -490,7 +494,7 @@ export const StopOrder = ({ market, marketPrice, submit }: StopOrderProps) => { render={({ field }) => { const { onChange: onCheckedChange, value } = field; return ( - { ); }} /> - {
{expire && ( <> - { control={control} render={({ field }) => { return ( - - + - - + ); }} /> - +
( - ( - ( - - + { 'You need to connect your own wallet to start trading on this market' } - +
); } @@ -613,9 +613,9 @@ const SummaryMessage = memo( if (error?.message) { return (
- + {error?.message} - +
); } diff --git a/libs/deal-ticket/src/components/deal-ticket/expiry-selector.tsx b/libs/deal-ticket/src/components/deal-ticket/expiry-selector.tsx index 8f84c9da7..b174fcbda 100644 --- a/libs/deal-ticket/src/components/deal-ticket/expiry-selector.tsx +++ b/libs/deal-ticket/src/components/deal-ticket/expiry-selector.tsx @@ -1,4 +1,8 @@ -import { FormGroup, Input, InputError } from '@vegaprotocol/ui-toolkit'; +import { + TradingFormGroup, + TradingInput, + TradingInputError, +} from '@vegaprotocol/ui-toolkit'; import { formatForInput } from '@vegaprotocol/utils'; import { t } from '@vegaprotocol/i18n'; import { useRef } from 'react'; @@ -19,12 +23,12 @@ export const ExpirySelector = ({ const dateFormatted = formatForInput(date); const minDate = formatForInput(date); return ( - - {errorMessage && ( - + {errorMessage} - + )} - + ); }; diff --git a/libs/deal-ticket/src/components/deal-ticket/time-in-force-selector.tsx b/libs/deal-ticket/src/components/deal-ticket/time-in-force-selector.tsx index 279e97e8a..7fefd689c 100644 --- a/libs/deal-ticket/src/components/deal-ticket/time-in-force-selector.tsx +++ b/libs/deal-ticket/src/components/deal-ticket/time-in-force-selector.tsx @@ -1,7 +1,7 @@ import { - FormGroup, - InputError, - Select, + TradingFormGroup, + TradingInputError, + TradingSelect, Tooltip, SimpleGrid, } from '@vegaprotocol/ui-toolkit'; @@ -90,12 +90,12 @@ export const TimeInForceSelector = ({ }; return ( - - + {errorMessage && ( - + {renderError(errorMessage)} - + )} - + ); }; diff --git a/libs/deal-ticket/src/components/deal-ticket/type-selector.tsx b/libs/deal-ticket/src/components/deal-ticket/type-selector.tsx index f6798d813..55ce9ef61 100644 --- a/libs/deal-ticket/src/components/deal-ticket/type-selector.tsx +++ b/libs/deal-ticket/src/components/deal-ticket/type-selector.tsx @@ -1,5 +1,5 @@ import { - InputError, + TradingInputError, SimpleGrid, Tooltip, TradingDropdown, @@ -178,9 +178,9 @@ export const TypeSelector = ({ value={value} /> {errorMessage && ( - + {renderError(errorMessage as MarketModeValidationType)} - + )} ); diff --git a/libs/deposits/src/lib/deposit-form.tsx b/libs/deposits/src/lib/deposit-form.tsx index 3468cce63..4dc0a8771 100644 --- a/libs/deposits/src/lib/deposit-form.tsx +++ b/libs/deposits/src/lib/deposit-form.tsx @@ -14,14 +14,14 @@ import { t } from '@vegaprotocol/i18n'; import { useLocalStorage } from '@vegaprotocol/react-helpers'; import { Button, - FormGroup, - Input, - InputError, - RichSelect, + TradingFormGroup, + TradingInput, + TradingInputError, + TradingRichSelect, Notification, Intent, ButtonLink, - Select, + TradingSelect, } from '@vegaprotocol/ui-toolkit'; import { useVegaWallet } from '@vegaprotocol/wallet'; import { useWeb3React } from '@web3-react/core'; @@ -151,7 +151,7 @@ export const DepositForm = ({ noValidate={true} data-testid="deposit-form" > - @@ -197,15 +197,17 @@ export const DepositForm = ({ }} /> {errors.from?.message && ( - {errors.from.message} + + {errors.from.message} + )} - - + + setValue('to', '')} select={ - + } input={ - {errors.to?.message && ( - + {errors.to.message} - + )} - - + + ( - ))} - + )} /> {errors.asset?.message && ( - + {errors.asset.message} - + )} {isActive && isFaucetable && selectedAsset && ( @@ -296,7 +298,7 @@ export const DepositForm = ({ {t('View asset details')} )} - + )} {approved && ( - - + {errors.amount?.message && ( - + {errors.amount.message} - + )} {selectedAsset && balances && ( )} - + )} void }) => { `This app will only work on ${VEGA_ENV}. Select a node to connect to.` )}

- setNodeRadio(value)} > @@ -112,7 +112,7 @@ export const NodeSwitcher = ({ closeDialog }: { closeDialog: () => void }) => { />
- +