@campxdev/shared 1.4.15 → 1.4.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,61 +0,0 @@
1
- import { Search, Tune } from '@mui/icons-material'
2
- import { Box, InputAdornment, styled } from '@mui/material'
3
- import { useMemo, useState } from 'react'
4
- import _ from 'lodash'
5
- import { TextField } from './Input'
6
-
7
- interface SearchBarProps {
8
- onSearch: (v: string) => void
9
- filters?: {
10
- onClick: () => void
11
- }
12
- }
13
-
14
- const StyledButtonWrapper = styled(Box)(({ theme }) => ({
15
- width: '52px',
16
- border: theme.borders.grayLight,
17
- display: 'flex',
18
- alignItems: 'center',
19
- justifyContent: 'center',
20
- borderRadius: '10px',
21
- cursor: 'pointer',
22
- '&:active': {
23
- border: `1px solid ${theme.palette.primary.main}`,
24
- },
25
- transition: 'border 0.1s ease-in-out',
26
- }))
27
-
28
- export default function SearchBar({ onSearch, filters }: SearchBarProps) {
29
- const [, setSearch] = useState('')
30
-
31
- const debouncedChangeHandler = useMemo(
32
- () =>
33
- _.debounce((e) => {
34
- setSearch(e.target.value)
35
- setSearch(e.target.value)
36
- }, 300),
37
- [],
38
- )
39
-
40
- return (
41
- <Box sx={{ display: 'flex', gap: '20px' }}>
42
- <TextField
43
- sx={{ maxWidth: '600px' }}
44
- label="Search"
45
- onChange={debouncedChangeHandler}
46
- InputProps={{
47
- endAdornment: (
48
- <InputAdornment position="end">
49
- <Search />
50
- </InputAdornment>
51
- ),
52
- }}
53
- />
54
- {filters && (
55
- <StyledButtonWrapper onClick={filters?.onClick}>
56
- <Tune />
57
- </StyledButtonWrapper>
58
- )}
59
- </Box>
60
- )
61
- }
@@ -1,11 +0,0 @@
1
- import { LocalizationProvider } from '@mui/x-date-pickers'
2
- import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment'
3
- import { ReactNode } from 'react'
4
-
5
- export default function withLocalization(component: ReactNode) {
6
- return (
7
- <LocalizationProvider dateAdapter={AdapterMoment}>
8
- {component}
9
- </LocalizationProvider>
10
- )
11
- }