@nuskin/foundation-ui-components 1.10.0 → 1.11.0
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.
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { styled } from '@nuskin/foundation-theme';
|
|
2
|
+
|
|
2
3
|
import { NsTypography } from '../../typography';
|
|
3
4
|
|
|
4
5
|
type AutoCompleteButtonProps = {
|
|
@@ -9,20 +10,24 @@ type AutoCompleteButtonProps = {
|
|
|
9
10
|
recentSearchText: string;
|
|
10
11
|
};
|
|
11
12
|
export const StyledClear = styled(NsTypography)`
|
|
13
|
+
margin: 4px 8px;
|
|
12
14
|
:hover {
|
|
13
15
|
opacity: 0.5;
|
|
14
16
|
}
|
|
15
17
|
`;
|
|
18
|
+
const TypoWrapper = styled(NsTypography)`
|
|
19
|
+
margin: 4px 8px;
|
|
20
|
+
`;
|
|
16
21
|
export const RecentClearAll = (props: AutoCompleteButtonProps) => {
|
|
17
22
|
const { show, onClick, text, testId, recentSearchText } = props;
|
|
18
23
|
if (!show) {
|
|
19
24
|
return null;
|
|
20
25
|
}
|
|
21
26
|
return (
|
|
22
|
-
<li className="justify-between flex p-
|
|
23
|
-
<
|
|
27
|
+
<li className="justify-between flex p-0 m-0" onClick={onClick}>
|
|
28
|
+
<TypoWrapper data-testid={testId} variant="body-m" weight="bold">
|
|
24
29
|
{recentSearchText}
|
|
25
|
-
</
|
|
30
|
+
</TypoWrapper>
|
|
26
31
|
<StyledClear
|
|
27
32
|
data-testid={testId}
|
|
28
33
|
variant="body-m"
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Dispatch, MutableRefObject, SetStateAction, useCallback } from 'react';
|
|
2
|
-
import { styled, ColorUtils } from '@nuskin/foundation-theme';
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import { ColorUtils, styled } from '@nuskin/foundation-theme';
|
|
4
|
+
|
|
5
|
+
import { NsTypography, OptionsProps } from '../../';
|
|
6
|
+
|
|
5
7
|
const { getGenomeColor } = ColorUtils;
|
|
6
8
|
export const ListStyled = styled.div`
|
|
7
9
|
display: flex;
|
|
@@ -9,7 +11,8 @@ export const ListStyled = styled.div`
|
|
|
9
11
|
flex-direction: row;
|
|
10
12
|
align-items: center;
|
|
11
13
|
gap: 10px;
|
|
12
|
-
padding:
|
|
14
|
+
padding: 0;
|
|
15
|
+
margin: 4px 8px;
|
|
13
16
|
cursor: pointer;
|
|
14
17
|
&:hover {
|
|
15
18
|
background: ${({ theme }) => getGenomeColor(theme, 'A10')};
|
|
@@ -51,7 +54,7 @@ export const SeeMoreButton = (props: SeeMoreButtonProps) => {
|
|
|
51
54
|
return null;
|
|
52
55
|
}
|
|
53
56
|
return (
|
|
54
|
-
<ListStyled className="text-left p-
|
|
57
|
+
<ListStyled className="text-left p-0" onClick={handleSeeMore}>
|
|
55
58
|
<NsTypography
|
|
56
59
|
data-testid="autocomplete-loadmore-id"
|
|
57
60
|
variant="body-m"
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { AutocompleteRenderGroupParams } from '@mui/material';
|
|
2
|
-
import {
|
|
2
|
+
import { styled } from '@nuskin/foundation-theme';
|
|
3
3
|
|
|
4
|
+
import { OptionsProps } from '../../autocomplete';
|
|
5
|
+
import { NsTypography } from '../../typography';
|
|
6
|
+
|
|
7
|
+
const GroupNameTypography = styled(NsTypography)`
|
|
8
|
+
margin: 4px 8px;
|
|
9
|
+
`;
|
|
4
10
|
export const renderGroupName = ({ key, group, children }: AutocompleteRenderGroupParams) => (
|
|
5
11
|
<li key={key}>
|
|
6
12
|
{group ? (
|
|
7
|
-
<
|
|
13
|
+
<GroupNameTypography variant="body-m" weight="bold" className="p-0 m-0 border-solid">
|
|
8
14
|
{group}
|
|
9
|
-
</
|
|
15
|
+
</GroupNameTypography>
|
|
10
16
|
) : null}
|
|
11
17
|
<ul className="p-0">{children}</ul>
|
|
12
18
|
</li>
|