Skip to content

Commit 1612e82

Browse files
mwclemyClement Mwimo
andauthored
feat: migrate @kyper/button component to MXUI and clean up unused select and selectionbox components
* converted kyper button * feat: migrate @kyper/button component to MXUI * remove name prop * fix the test * fixing the failing tests * Removed unused @kyper/select code (#352) * remove unsed select code * feat: remove unused @kyper/select component * remove select input --------- Co-authored-by: Clement Mwimo <clement.mwimo@mx.com> * Remove @kyper/selectionbox (#354) * feat: remove @kyper/selectionbox * remove remaining @kyper/selectionbox reference --------- Co-authored-by: Clement Mwimo <clement.mwimo@mx.com> --------- Co-authored-by: Clement Mwimo <clement.mwimo@mx.com>
1 parent 706bfca commit 1612e82

7 files changed

Lines changed: 8 additions & 84 deletions

File tree

.eslintrc.cjs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@ module.exports = {
3333
name: '@kyper/input',
3434
message: "Please import from 'src/privacy/input instead'.",
3535
},
36-
{
37-
name: '@kyper/select',
38-
message: "Please import from 'src/privacy/input instead'.",
39-
},
40-
{
41-
name: '@kyper/selectionbox',
42-
message: "Please import from 'src/privacy/input instead'.",
43-
},
4436
{
4537
name: '@kyper/textarea',
4638
message: "Please import from 'src/privacy/input instead'.",

package-lock.json

Lines changed: 1 addition & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,12 @@
4343
"dependencies": {
4444
"@emotion/react": "^11.14.0",
4545
"@emotion/styled": "^11.14.1",
46-
"@kyper/button": "^4.0.0",
4746
"@kyper/hooks": "^1.0.0",
4847
"@kyper/icon": "^1.18.1",
4948
"@kyper/input": "^6.1.0",
5049
"@kyper/institutionlogo": "^3.1.0",
5150
"@kyper/messagebox": "^3.1.0",
5251
"@kyper/progressindicators": "^3.1.0",
53-
"@kyper/select": "^2.0.0",
54-
"@kyper/selectionbox": "^2.1.0",
5552
"@kyper/tag": "^3.0.0",
5653
"@kyper/tokenprovider": "^4.0.1",
5754
"@kyper/userfeedback": "^2.0.0",

src/components/DayOfMonthPicker.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React, { MutableRefObject } from 'react'
33
import _range from 'lodash/range'
44

55
import { useTokens } from '@kyper/tokenprovider'
6-
import { Button } from '@kyper/button'
6+
import { Button } from '@mui/material'
77
import { Text } from '@mxenabled/mxui'
88

99
import { fadeOut } from 'src/utilities/Animation'
@@ -15,8 +15,8 @@ import { getDelay } from 'src/utilities/getDelay'
1515

1616
interface DayOfMonthPicker {
1717
handleClose: () => void
18-
handleSelect: (e: React.ChangeEvent) => void
19-
name?: string
18+
handleSelect: (e: React.MouseEvent<HTMLElement>) => void
19+
name: string
2020
}
2121

2222
export const DayOfMonthPicker = React.forwardRef<HTMLInputElement, DayOfMonthPicker>(
@@ -61,15 +61,12 @@ export const DayOfMonthPicker = React.forwardRef<HTMLInputElement, DayOfMonthPic
6161
autoFocus={day === 1}
6262
data-test={`date-picker-button-${day}`}
6363
key={day}
64-
name={props.name || day}
65-
onClick={(e: React.ChangeEvent) => {
66-
e.persist()
67-
64+
name={props.name}
65+
onClick={(e: React.MouseEvent<HTMLElement>) => {
6866
fadeOut(containerRef?.current, 'up', 300).then(() => props.handleSelect(e))
6967
}}
7068
style={styles.button}
7169
value={day}
72-
variant="transparent"
7370
>
7471
{day}
7572
</Button>

src/privacy/input.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// This is the ONLY file that @kyper related inputs should be directly imported
33

44
import { Radio, PASSWORD_VALIDATIONS } from '@kyper/input'
5-
import { Select } from '@kyper/select'
65
import { SelectionBox } from '@mxenabled/mxui'
76
import { UserFeedback } from '@kyper/userfeedback'
87
import { withProtection } from 'src/privacy/withProtection'
@@ -21,14 +20,12 @@ import { TextField } from '@mxenabled/mxui'
2120

2221
const ProtectedTextField = withProtection(TextField)
2322
const ProtectedRadio = withProtection(Radio)
24-
const ProtectedSelect = withProtection(Select)
2523
const ProtectedSelectionBox = withProtection(SelectionBox)
2624
const ProtectedUserFeedback = withProtection(UserFeedback)
2725

2826
export {
2927
ProtectedTextField as TextField,
3028
ProtectedRadio as Radio,
31-
ProtectedSelect as Select,
3229
ProtectedSelectionBox as SelectionBox,
3330
ProtectedUserFeedback as UserFeedback,
3431
PASSWORD_VALIDATIONS as PasswordValidations,

src/views/manualAccount/ManualAccountSuccess.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
33
import { __ } from 'src/utilities/Intl'
44

55
import { useTokens } from '@kyper/tokenprovider'
6-
import { Button } from '@kyper/button'
6+
import { Button } from '@mui/material'
77
import { Text } from '@mxenabled/mxui'
88

99
import { fadeOut } from 'src/utilities/Animation'
@@ -84,7 +84,7 @@ export const ManualAccountSuccess = (props) => {
8484
handleDone()
8585
}}
8686
style={styles.button}
87-
variant="primary"
87+
variant="contained"
8888
>
8989
{__('Done')}
9090
</Button>

typings/kyper.d.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
declare module '@kyper/button'
21
declare module '@kyper/tokenprovider'
32
declare module '@kyper/institutionlogo'
43
declare module '@kyper/messagebox'
54
declare module '@kyper/userfeedback'
65
declare module '@kyper/textarea'
7-
declare module '@kyper/selectionbox'
8-
declare module '@kyper/select'
96
declare module '@kyper/input'
107
declare module '@kyper/icon/Accounts'
118
declare module '@kyper/icon/Check'

0 commit comments

Comments
 (0)