
* Refactor topic creation
* Remove unused thunk
* Remove excess interface
* Add New page snapshot test
* Refactor new component tests
* Remove excess function
* Add typography variables and classes
* Add font families
* Implement custom button
* Get rid of enums
* Add theme
* Separate styles from logic
* Feature/layout redesign (#862)
* Refactor pages general layout
* Refactor breadcrumbs
* Refactor brokers metrics
* Fix toggle position
Co-authored-by: azat.belgibayev <azat.belgibayev@almatech.dev>
* add redesigned new menu item
* remove styles from theme
* update tests
* fix local and app wide styles
* add tests
* Add theme
* Add types to the styles
* update menu item prop prefixes, minor fixes
* add theme styles, move interface, update test, snapshot
* add optional styling
* add isActive props, propagate component, update tests
* remove button
* Revert "remove button"
This reverts commit 4a9c87d8d8
.
* add tests for styled button
* remove ternary operator from style
* import styled from lib/
* Custom Inputs (#890)
* Implement and test custom input
* Custom select (#896)
* Implement custom select
* Fix Metrics component (#914)
* Add styled table header cell component (#901)
* Redesign menu (#918)
* Finish styling menu
* Styled Table
* Fix styled table
* Allow custom buttons work as links
* Restyle Breadcrumb
* Topics list (#946)
* Redesign pagination
* Fix styled components usage
* Topic messages (#959)
* Topic Consumer Groups
* Message settings
* Finish styling indicators
* Style the dashboard
* Finish with the topics page
* Style consumer groups list
* Restyle the consumer group details
* Style alerts
* Style confirmation modal
* Update DangerZone.spec.tsx
* redesign schema registry
* Add Topic details snapshot
* Style Page Loader
* Style connectors list
* Style KSQL
* Remove all the classes from the styled components (#1049)
* Redesign topic form (#1051)
* Redesign connect details (#1053)
* Update types for styled-components (#1054)
* Redesign some minor forms in the app (#1062)
* Fix alert styles
* Get rid of bulma/layout styles
* Fix form styling
* Custom Switch component
* fix border-radius property of metrick widgets
* get rid of warnings in tests
* use jest-styled-components
* cleanup
* get rid of some bulma modules
* refactor metrics component
* get rid of JSON-tree. Json Editor redesign
* update proxy config
* Refactor Alerts component (#1124)
* Refactor tests (#1129)
* App layout update (#1127)
* ‘App-layout-update’
* toBeNull changed to toBeInDocument
* scss file removed
* App navbar layout update
* navbar test
* code smells local refactoring
* StyledMenuItem code smells refactoring
* StyledClusterTab code smells refactoring
* ConfirmationModalWrapper code smells refactoring
* input icon and label code smells refactoring
* navburger displaying fixed
* Get rid of classes
* fix code smells
* refactor styles
* refactor styles
Co-authored-by: Oleg Shuralev <workshur@gmail.com>
* Refactored Cluster nav (#1147)
* Update caniuse
* refactor Nav component
* Update sonars config
* refactor Nav component + specs
* Specs
* Feature/code smells removing (#1148)
* StyledSelect code smell refactoring
* SecondaryTabs code smell refactoring
* TextareaStyled code smell refactoring
* TableStyled code smell refactoring
* StyledTableHeaderCell code smell refactoring
* Add custom render with theme provider wrapper for testing lib (#1152)
* Added cleanupPolicy to topic details. Closes #999 (#1067)
* Rename "latest first" to "oldest first"
* Switch to redux-toolkit. Refactoring (#1171)
* Switch to redux-toolkit
* Fix #1207 (cherry-pick)
* refactor metrics (#1253)
Co-authored-by: Azat Belgibayev <belg.azat@gmail.com>
Co-authored-by: Alexander <mr.afigitelniychuvak@gmail.com>
Co-authored-by: azat.belgibayev <azat.belgibayev@almatech.dev>
Co-authored-by: sergei <scheremnov@provectus.com>
Co-authored-by: Alexander Krivonosov <31561808+GneyHabub@users.noreply.github.com>
Co-authored-by: Alina Miryuk <alinamiryuk@mail.ru>
Co-authored-by: Roman Zabaluev <rzabaluev@provectus.com>
63 lines
1.4 KiB
TypeScript
63 lines
1.4 KiB
TypeScript
import React from 'react';
|
|
import { RegisterOptions, useFormContext } from 'react-hook-form';
|
|
import styled from 'styled-components';
|
|
|
|
import { InputIcon } from './InputIcon.styled';
|
|
import * as S from './Input.styled';
|
|
|
|
export interface InputProps
|
|
extends React.InputHTMLAttributes<HTMLInputElement>,
|
|
Omit<S.InputProps, 'hasLeftIcon'> {
|
|
name?: string;
|
|
hookFormOptions?: RegisterOptions;
|
|
leftIcon?: string;
|
|
rightIcon?: string;
|
|
}
|
|
|
|
const Input: React.FC<InputProps> = ({
|
|
className,
|
|
name,
|
|
hookFormOptions,
|
|
leftIcon,
|
|
rightIcon,
|
|
inputSize = 'L',
|
|
...rest
|
|
}) => {
|
|
const methods = useFormContext();
|
|
return (
|
|
<div className={className}>
|
|
{leftIcon && (
|
|
<InputIcon className={leftIcon} position="left" inputSize={inputSize} />
|
|
)}
|
|
{name ? (
|
|
<S.Input
|
|
className={className}
|
|
inputSize={inputSize}
|
|
{...methods.register(name, { ...hookFormOptions })}
|
|
hasLeftIcon={!!leftIcon}
|
|
{...rest}
|
|
/>
|
|
) : (
|
|
<S.Input
|
|
className={className}
|
|
inputSize={inputSize}
|
|
hasLeftIcon={!!leftIcon}
|
|
{...rest}
|
|
/>
|
|
)}
|
|
{rightIcon && (
|
|
<InputIcon
|
|
className={rightIcon}
|
|
position="right"
|
|
inputSize={inputSize}
|
|
/>
|
|
)}
|
|
</div>
|
|
);
|
|
};
|
|
|
|
const InputWrapper = styled(Input)`
|
|
position: relative;
|
|
`;
|
|
|
|
export default InputWrapper;
|