()
| 85 | }; |
| 86 | |
| 87 | const TextInputExample = () => { |
| 88 | const [state, dispatch] = React.useReducer(inputReducer, initialState); |
| 89 | const { |
| 90 | text, |
| 91 | customIconText, |
| 92 | name, |
| 93 | outlinedText, |
| 94 | largeText, |
| 95 | flatTextPassword, |
| 96 | flatLongText, |
| 97 | outlinedLargeText, |
| 98 | outlinedCustomLabel, |
| 99 | outlinedTextPassword, |
| 100 | outlinedLongText, |
| 101 | nameNoPadding, |
| 102 | customStyleText, |
| 103 | nameRequired, |
| 104 | flatDenseText, |
| 105 | flatDense, |
| 106 | outlinedDenseText, |
| 107 | outlinedDense, |
| 108 | flatMultiline, |
| 109 | flatTextArea, |
| 110 | flatUnderlineColors, |
| 111 | outlinedMultiline, |
| 112 | outlinedTextArea, |
| 113 | outlinedColors, |
| 114 | maxLengthName, |
| 115 | flatTextSecureEntry, |
| 116 | outlineTextSecureEntry, |
| 117 | iconsColor: { |
| 118 | flatLeftIcon, |
| 119 | flatRightIcon, |
| 120 | outlineLeftIcon, |
| 121 | outlineRightIcon, |
| 122 | customIcon, |
| 123 | }, |
| 124 | } = state; |
| 125 | |
| 126 | const _isUsernameValid = (name: string) => /^[a-zA-Z]*$/.test(name); |
| 127 | |
| 128 | const theme = useExampleTheme(); |
| 129 | |
| 130 | const inputActionHandler = (type: keyof State, payload: string) => |
| 131 | dispatch({ |
| 132 | type: type, |
| 133 | payload: payload, |
| 134 | }); |
| 135 | |
| 136 | const changeIconColor = (name: keyof State['iconsColor']) => { |
| 137 | const color = state.iconsColor[name]; |
| 138 | |
| 139 | const newColors = { |
| 140 | ...state.iconsColor, |
| 141 | [name]: !color |
| 142 | ? theme.isV3 |
| 143 | ? theme.colors.primary |
| 144 | : theme.colors?.accent |
nothing calls this directly
no test coverage detected
searching dependent graphs…