@nuskin/foundation-ui-components 1.30.1 → 1.31.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 +3 -1
- package/src/common/autocomplete/NsAutocomplete.styled.tsx +10 -7
- package/src/common/autocomplete/NsAutocomplete.tsx +133 -63
- package/src/common/autocomplete/stories/NsAutocomplete.stories.tsx +2 -1
- package/src/common/autocomplete/types.d.ts +1 -0
- package/src/common/card/CardButton.tsx +8 -10
- package/src/common/card/NsAwardCard.tsx +27 -29
- package/src/common/card/NsBrandWrapper.tsx +16 -18
- package/src/common/card/NsCheckoutCard.tsx +46 -48
- package/src/common/card/NsHeroCardLevel2.tsx +44 -46
- package/src/common/card/NsIconText.tsx +32 -34
- package/src/common/card/NsPost.tsx +45 -47
- package/src/common/card/NsSmallFullCard.tsx +47 -49
- package/src/common/card/NsXLargeCard.tsx +43 -45
- package/src/common/input/InputFieldWrapper.tsx +1 -1
- package/src/common/progress/NsProgress.styled.tsx +22 -23
- package/src/common/search-bar/NsSearchBar.tsx +8 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuskin/foundation-ui-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.31.0",
|
|
4
4
|
"description": "It is a foundation library written in react, that provides common components to all UI pages",
|
|
5
5
|
"main": "src/common/index.ts",
|
|
6
6
|
"repository": {
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"react-dom": "^18.2.0",
|
|
58
58
|
"react-material-ui-carousel": "^3.4.2",
|
|
59
59
|
"react-slick": "^0.29.0",
|
|
60
|
+
"react-window": "^1.8.10",
|
|
60
61
|
"slick-carousel": "^1.8.1",
|
|
61
62
|
"typescript": "^5.4.2"
|
|
62
63
|
},
|
|
@@ -86,6 +87,7 @@
|
|
|
86
87
|
"@types/ramda": "^0.29.7",
|
|
87
88
|
"@types/react-slick": "^0.23.11",
|
|
88
89
|
"@types/react-test-renderer": "^18.0.5",
|
|
90
|
+
"@types/react-window": "^1.8.8",
|
|
89
91
|
"babel-jest": "^29.7.0",
|
|
90
92
|
"babel-loader": "^9.1.3",
|
|
91
93
|
"babel-plugin-emotion": "^11.0.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { styled, ColorUtils } from '@nuskin/foundation-theme';
|
|
2
2
|
import { NsInputField } from '../input';
|
|
3
|
-
import { Popper } from '@mui/material';
|
|
3
|
+
import { Popper, autocompleteClasses } from '@mui/material';
|
|
4
4
|
const { getGenomeColor } = ColorUtils;
|
|
5
5
|
|
|
6
6
|
export const StyledTextField = styled(NsInputField)`
|
|
@@ -13,9 +13,12 @@ export const StyledTextField = styled(NsInputField)`
|
|
|
13
13
|
}
|
|
14
14
|
`;
|
|
15
15
|
|
|
16
|
-
export const StyledPopper = styled(Popper)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
export const StyledPopper = styled(Popper)({
|
|
17
|
+
[`& .${autocompleteClasses.listbox}`]: {
|
|
18
|
+
boxSizing: 'border-box',
|
|
19
|
+
'& ul': {
|
|
20
|
+
padding: 0,
|
|
21
|
+
margin: 0,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
});
|
|
@@ -1,36 +1,19 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
useEffect,
|
|
5
|
-
useRef,
|
|
6
|
-
useState,
|
|
7
|
-
} from 'react';
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
Autocomplete,
|
|
11
|
-
AutocompleteRenderInputParams,
|
|
12
|
-
Popper,
|
|
13
|
-
} from '@mui/material';
|
|
1
|
+
import React, { PropsWithChildren, ReactElement, useEffect, useRef, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Autocomplete, AutocompleteRenderInputParams, ListSubheader, Popper, useMediaQuery, useTheme } from '@mui/material';
|
|
14
4
|
|
|
15
5
|
import { LineLoader } from './helper/LineLoader';
|
|
16
6
|
import { RecentClearAll } from './helper/RecentClearAll';
|
|
17
|
-
import {
|
|
18
|
-
renderGroupBy,
|
|
19
|
-
renderGroupName,
|
|
20
|
-
renderOptionLabel,
|
|
21
|
-
} from './helper/renderGroupName';
|
|
7
|
+
import { renderGroupBy, renderOptionLabel } from './helper/renderGroupName';
|
|
22
8
|
import { SeeMoreButton } from './helper/SeeMoreButton';
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} from './NsAutocomplete.styled';
|
|
27
|
-
import {
|
|
28
|
-
ComponentBoxProps,
|
|
29
|
-
NsAutocompleteProps,
|
|
30
|
-
OptionsProps,
|
|
31
|
-
} from './types.d';
|
|
9
|
+
import { StyledPopper, StyledTextField } from './NsAutocomplete.styled';
|
|
10
|
+
import { ComponentBoxProps, NsAutocompleteProps, OptionsProps } from './types.d';
|
|
11
|
+
import { VariableSizeList, ListChildComponentProps } from 'react-window';
|
|
32
12
|
|
|
13
|
+
const LISTBOX_PADDING = 8;
|
|
33
14
|
const noop = () => {};
|
|
15
|
+
const OuterElementContext = React.createContext({});
|
|
16
|
+
|
|
34
17
|
const NsAutocomplete = ({
|
|
35
18
|
id = 'custom_autocomplete_dropdown',
|
|
36
19
|
options,
|
|
@@ -50,9 +33,10 @@ const NsAutocomplete = ({
|
|
|
50
33
|
value,
|
|
51
34
|
isFilterEnabled = true,
|
|
52
35
|
fullWidth,
|
|
53
|
-
|
|
36
|
+
onKeypress
|
|
37
|
+
}: PropsWithChildren<NsAutocompleteProps>): ReactElement => {
|
|
38
|
+
const listboxRef = useRef<any | null>(null);
|
|
54
39
|
const [scrollTopPosition, setScrollTopPosition] = useState(0);
|
|
55
|
-
const listboxRef = useRef<HTMLUListElement | null>(null);
|
|
56
40
|
|
|
57
41
|
useEffect(() => {
|
|
58
42
|
if (listboxRef.current && options.length > 0) {
|
|
@@ -60,6 +44,13 @@ const NsAutocomplete = ({
|
|
|
60
44
|
}
|
|
61
45
|
}, [options, scrollTopPosition]);
|
|
62
46
|
|
|
47
|
+
const OuterElementType = React.forwardRef((props: any, ref) => {
|
|
48
|
+
const outerProps = React.useContext(OuterElementContext);
|
|
49
|
+
return <ul ref={ref} {...props} {...outerProps} />;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
OuterElementType.displayName = 'OuterElementType';
|
|
53
|
+
|
|
63
54
|
const renderInput = (params: AutocompleteRenderInputParams) => (
|
|
64
55
|
<StyledTextField
|
|
65
56
|
{...(params as any)}
|
|
@@ -82,54 +73,132 @@ const NsAutocomplete = ({
|
|
|
82
73
|
</li>
|
|
83
74
|
);
|
|
84
75
|
|
|
85
|
-
const
|
|
76
|
+
const renderRow = (props: ListChildComponentProps) => {
|
|
77
|
+
const { data, index, style } = props;
|
|
78
|
+
const dataSet = data[index];
|
|
79
|
+
const option = dataSet?.[1];
|
|
80
|
+
const inlineStyle = {
|
|
81
|
+
top: (style.top as number) + LISTBOX_PADDING,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
if (Object.hasOwn(dataSet, 'group')) {
|
|
85
|
+
return (
|
|
86
|
+
<ListSubheader key={dataSet.key} component="div" style={inlineStyle}>
|
|
87
|
+
{dataSet.group}
|
|
88
|
+
</ListSubheader>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
86
92
|
return (
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
role={rest.role}
|
|
91
|
-
id={rest.id}
|
|
92
|
-
className={rest.className}
|
|
93
|
-
ref={listboxRef}
|
|
94
|
-
>
|
|
95
|
-
<RecentClearAll
|
|
96
|
-
show={clear?.show ?? false}
|
|
97
|
-
text={clear?.text ?? 'Clear All'}
|
|
98
|
-
onClick={clear?.onClear ?? noop}
|
|
99
|
-
testId="autocomplete-clear-id"
|
|
100
|
-
recentSearchText={clear?.recentSearchText ?? 'Your Recent Searches'}
|
|
101
|
-
/>
|
|
102
|
-
{children}
|
|
103
|
-
<SeeMoreButton
|
|
104
|
-
onSeeMore={seeMore?.onSeeMore}
|
|
105
|
-
show={seeMore?.show}
|
|
106
|
-
text={seeMore?.text}
|
|
107
|
-
options={options}
|
|
108
|
-
setScrollTopPosition={setScrollTopPosition}
|
|
109
|
-
listboxRef={listboxRef}
|
|
110
|
-
/>
|
|
111
|
-
</ul>
|
|
93
|
+
<div component="div" {...dataSet[0]} style={inlineStyle}>
|
|
94
|
+
{renderOption(props, option)}
|
|
95
|
+
</div>
|
|
112
96
|
);
|
|
113
97
|
};
|
|
98
|
+
|
|
99
|
+
const useResetCache = (data: any) => {
|
|
100
|
+
const ref = React.useRef<VariableSizeList>(null);
|
|
101
|
+
React.useEffect(() => {
|
|
102
|
+
if (ref.current != null) {
|
|
103
|
+
ref.current.resetAfterIndex(0, true);
|
|
104
|
+
}
|
|
105
|
+
}, [data]);
|
|
106
|
+
return ref;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const ListboxComponent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLElement>>(
|
|
110
|
+
function ListboxComponent(props, ref) {
|
|
111
|
+
const { children, ...other } = props;
|
|
112
|
+
const itemData: React.ReactElement[] = [];
|
|
113
|
+
(children as React.ReactElement[]).forEach(
|
|
114
|
+
(item: React.ReactElement & { children?: React.ReactElement[] }) => {
|
|
115
|
+
itemData.push(item);
|
|
116
|
+
itemData.push(...(item.children || []));
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
const theme = useTheme();
|
|
121
|
+
const smUp = useMediaQuery(theme.breakpoints.up('sm'), {
|
|
122
|
+
noSsr: true,
|
|
123
|
+
});
|
|
124
|
+
const itemCount = itemData.length;
|
|
125
|
+
const itemSize = smUp ? 36 : 48;
|
|
126
|
+
|
|
127
|
+
const getChildSize = (child: React.ReactElement) => {
|
|
128
|
+
if (Object.hasOwn(child, 'group')) {
|
|
129
|
+
return 48;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return itemSize;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const getHeight = () => {
|
|
136
|
+
if (itemCount > 8) {
|
|
137
|
+
return 8 * itemSize;
|
|
138
|
+
}
|
|
139
|
+
return itemData.map(getChildSize).reduce((a, b) => a + b, 0);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const gridRef = useResetCache(itemCount);
|
|
143
|
+
|
|
144
|
+
return (
|
|
145
|
+
<>
|
|
146
|
+
<RecentClearAll
|
|
147
|
+
show={clear?.show ?? false}
|
|
148
|
+
text={clear?.text ?? 'Clear All'}
|
|
149
|
+
onClick={clear?.onClear ?? noop}
|
|
150
|
+
testId="autocomplete-clear-id"
|
|
151
|
+
recentSearchText={clear?.recentSearchText ?? 'Your Recent Searches'}
|
|
152
|
+
/>
|
|
153
|
+
<div ref={ref}>
|
|
154
|
+
<OuterElementContext.Provider value={other}>
|
|
155
|
+
<VariableSizeList
|
|
156
|
+
itemData={itemData}
|
|
157
|
+
height={getHeight() + 2 * LISTBOX_PADDING}
|
|
158
|
+
width="100%"
|
|
159
|
+
ref={gridRef}
|
|
160
|
+
outerElementType={OuterElementType}
|
|
161
|
+
innerElementType="ul"
|
|
162
|
+
itemSize={(index) => getChildSize(itemData[index])}
|
|
163
|
+
overscanCount={5}
|
|
164
|
+
itemCount={itemCount}
|
|
165
|
+
>
|
|
166
|
+
{renderRow}
|
|
167
|
+
</VariableSizeList>
|
|
168
|
+
</OuterElementContext.Provider>
|
|
169
|
+
</div>
|
|
170
|
+
<SeeMoreButton
|
|
171
|
+
onSeeMore={seeMore?.onSeeMore}
|
|
172
|
+
show={seeMore?.show}
|
|
173
|
+
text={seeMore?.text}
|
|
174
|
+
options={options}
|
|
175
|
+
setScrollTopPosition={setScrollTopPosition}
|
|
176
|
+
listboxRef={listboxRef}
|
|
177
|
+
/>
|
|
178
|
+
</>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
|
|
114
183
|
return (
|
|
115
184
|
<>
|
|
116
185
|
<LineLoader show={loading ?? false} />
|
|
117
186
|
<Autocomplete
|
|
118
|
-
|
|
187
|
+
open
|
|
119
188
|
id={id}
|
|
120
|
-
|
|
189
|
+
disableListWrap
|
|
121
190
|
className={className}
|
|
122
|
-
options={options}
|
|
123
191
|
loading={loading}
|
|
124
192
|
noOptionsText={noOptionsText}
|
|
193
|
+
PopperComponent={fullWidth ? StyledPopper : Popper}
|
|
194
|
+
ListboxComponent={ListboxComponent}
|
|
195
|
+
options={options}
|
|
125
196
|
groupBy={renderGroupBy}
|
|
126
197
|
getOptionLabel={renderOptionLabel}
|
|
127
|
-
renderOption={
|
|
128
|
-
|
|
129
|
-
PopperComponent={fullWidth ? StyledPopper : Popper} // TODO:https://code.tls.nuskin.io/ns-am/content-foundation/nuskin-app/-/jobs/1355817
|
|
130
|
-
ListboxComponent={renderListBoxComponent}
|
|
131
|
-
renderGroup={renderGroupName}
|
|
198
|
+
renderOption={(props, option, state) => [props, option, state.index] as React.ReactNode}
|
|
199
|
+
renderGroup={(params) => params as any}
|
|
132
200
|
onChange={onChange}
|
|
201
|
+
renderInput={renderInput}
|
|
133
202
|
onInputChange={onInputChange}
|
|
134
203
|
value={value}
|
|
135
204
|
onFocus={onFocus ?? noop}
|
|
@@ -140,6 +209,7 @@ const NsAutocomplete = ({
|
|
|
140
209
|
: (options) => options
|
|
141
210
|
}
|
|
142
211
|
freeSolo
|
|
212
|
+
onKeyDown={onKeypress}
|
|
143
213
|
/>
|
|
144
214
|
</>
|
|
145
215
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactElement } from 'react';
|
|
1
|
+
import React, { ReactElement, SyntheticEvent } from 'react';
|
|
2
2
|
|
|
3
3
|
import { withCenterDecorator } from '@/stories/decorators/withCenterDecorator';
|
|
4
4
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
@@ -65,6 +65,7 @@ export default {
|
|
|
65
65
|
iconEnd: (<NsIcon name="roundedClose" size="small" colorOverride="#F5F5F5" />) as ReactElement,
|
|
66
66
|
placeholder: 'Search',
|
|
67
67
|
fullWidth: false,
|
|
68
|
+
onKeypress: (e: SyntheticEvent) => console.log(e),
|
|
68
69
|
},
|
|
69
70
|
} as MetaStory;
|
|
70
71
|
|
|
@@ -17,6 +17,7 @@ export type NsAutocompleteProps = {
|
|
|
17
17
|
reason Can be: "input" (user input), "reset" (programmatic change), "clear".
|
|
18
18
|
*/
|
|
19
19
|
onInputChange(event: SyntheticEvent, value: string, reason: string): void;
|
|
20
|
+
onKeypress?:(event:SyntheticEvent) => void;
|
|
20
21
|
/*
|
|
21
22
|
event The event source of the callback.
|
|
22
23
|
value The new value of the component.
|
|
@@ -6,16 +6,14 @@ import { styled } from '@nuskin/foundation-theme';
|
|
|
6
6
|
import { NsButton, NsIcon } from '../';
|
|
7
7
|
import { NsCardButton } from './types';
|
|
8
8
|
|
|
9
|
-
const ButtonTextVariant = styled(Button)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
});
|
|
9
|
+
const ButtonTextVariant = styled(Button)`
|
|
10
|
+
padding: 0;
|
|
11
|
+
border-bottom: 1px solid black;
|
|
12
|
+
border-radius: 0;
|
|
13
|
+
text-transform: none;
|
|
14
|
+
font-size: 14px;
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
`;
|
|
19
17
|
|
|
20
18
|
const CardButton = ({
|
|
21
19
|
url,
|
|
@@ -15,35 +15,33 @@ type NsAwardCardProps = {
|
|
|
15
15
|
className?: string;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
const CardContainer = styled(Box)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
};
|
|
46
|
-
});
|
|
18
|
+
const CardContainer = styled(Box)`
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
position: relative;
|
|
22
|
+
align-items: center;
|
|
23
|
+
width: 160px;
|
|
24
|
+
height: auto;
|
|
25
|
+
.image {
|
|
26
|
+
width: 160px;
|
|
27
|
+
height: auto;
|
|
28
|
+
object-fit: cover;
|
|
29
|
+
}
|
|
30
|
+
.content {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
text-align: center;
|
|
34
|
+
align-items: center;
|
|
35
|
+
margin-top: 25px;
|
|
36
|
+
}
|
|
37
|
+
.content-text: {
|
|
38
|
+
margin-top: 20px;
|
|
39
|
+
}
|
|
40
|
+
.action-link {
|
|
41
|
+
margin-top: 10px;
|
|
42
|
+
align-self: start;
|
|
43
|
+
},
|
|
44
|
+
`;
|
|
47
45
|
|
|
48
46
|
export default function NsAwardCard({
|
|
49
47
|
title,
|
|
@@ -3,24 +3,22 @@ import { PropsWithChildren, ReactElement } from 'react';
|
|
|
3
3
|
import Box from '@mui/material/Box';
|
|
4
4
|
import { styled } from '@nuskin/foundation-theme';
|
|
5
5
|
|
|
6
|
-
const Wrapper = styled(Box)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
});
|
|
6
|
+
const Wrapper = styled(Box)`
|
|
7
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
z-index: 100;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
&:hover {
|
|
16
|
+
background-color: rgba(0, 0, 0, 0);
|
|
17
|
+
& img {
|
|
18
|
+
visibility: hidden;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
24
22
|
|
|
25
23
|
export default function NsBrandWrapper({ children }: PropsWithChildren): ReactElement {
|
|
26
24
|
return <Wrapper className="logo-wrapper">{children}</Wrapper>;
|
|
@@ -13,54 +13,52 @@ type NsCheckoutCardProps = {
|
|
|
13
13
|
className?: string;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
const CardContainer = styled(Box)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
|
|
16
|
+
const CardContainer = styled(Box)`
|
|
17
|
+
background-color: #fff;
|
|
18
|
+
display: flex;
|
|
19
|
+
max-width: 345px;
|
|
20
|
+
height: auto;
|
|
21
|
+
border: 2px solid #B2B2B2;
|
|
22
|
+
border-radius: 2px;
|
|
23
|
+
.left-bar {
|
|
24
|
+
width: 4px;
|
|
25
|
+
height: auto;
|
|
26
|
+
background-color: #22D55C;
|
|
27
|
+
}
|
|
28
|
+
.content {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: row;
|
|
31
|
+
gap: 10px;
|
|
32
|
+
margin: 10px;
|
|
33
|
+
width: 100%;
|
|
34
|
+
}
|
|
35
|
+
.text-content {
|
|
36
|
+
width: 100%;
|
|
37
|
+
}
|
|
38
|
+
.title {
|
|
39
|
+
font-size: 14px;
|
|
40
|
+
font-weight: 700;
|
|
41
|
+
}
|
|
42
|
+
.address {
|
|
43
|
+
font-size: 13px;
|
|
44
|
+
font-weight: 400;
|
|
45
|
+
}
|
|
46
|
+
.action-link {
|
|
47
|
+
color: #7123D9;
|
|
48
|
+
font-size: 14px;
|
|
49
|
+
font-weight: 700;
|
|
50
|
+
letter-spacing: 0.7;
|
|
51
|
+
}
|
|
52
|
+
.icon-right {
|
|
53
|
+
margin-left: auto;
|
|
54
|
+
}
|
|
55
|
+
.icon {
|
|
56
|
+
&:hover {
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
61
|
+
|
|
64
62
|
export default function NsCheckoutCard({ title, icon, linkText, url, className }: NsCheckoutCardProps): ReactElement {
|
|
65
63
|
const [dropdownIcon, setDropdownIcon] = useState(false);
|
|
66
64
|
const handleClick = () => {
|
|
@@ -17,52 +17,50 @@ type NsHeroCardLevel2Props = {
|
|
|
17
17
|
className?: string;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
const CardContainer = styled(Box)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
};
|
|
65
|
-
});
|
|
20
|
+
const CardContainer = styled(Box)`
|
|
21
|
+
background-clip: border-box;
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: row;
|
|
24
|
+
word-wrap: break-word;
|
|
25
|
+
position: relative;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
height: 236px;
|
|
28
|
+
max-width: 536px;
|
|
29
|
+
.content {
|
|
30
|
+
height: 100%;
|
|
31
|
+
padding: 50px;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 0;
|
|
36
|
+
left: 0;
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
}
|
|
39
|
+
.bg-image {
|
|
40
|
+
object-fit: cover;
|
|
41
|
+
}
|
|
42
|
+
.brand-container {
|
|
43
|
+
background-color: #fff;
|
|
44
|
+
width: fit-content;
|
|
45
|
+
padding-left: 10px;
|
|
46
|
+
padding-right: 10px;
|
|
47
|
+
}
|
|
48
|
+
.body-title {
|
|
49
|
+
font-size: 26px;
|
|
50
|
+
line-height: 44px;
|
|
51
|
+
margin-bottom: 5px;
|
|
52
|
+
}
|
|
53
|
+
.body-text {
|
|
54
|
+
font-size: 12px;
|
|
55
|
+
font-weight: 700;
|
|
56
|
+
margin-bottom: 5px;
|
|
57
|
+
}
|
|
58
|
+
@media (max-width:768px) {
|
|
59
|
+
.content {
|
|
60
|
+
padding: 5%;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`
|
|
66
64
|
|
|
67
65
|
const NsHeroCardLevel2 = ({
|
|
68
66
|
brandName,
|
|
@@ -9,40 +9,38 @@ type NsIconTextProps = {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
const CardContainer = styled(Box)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
45
|
-
});
|
|
12
|
+
const CardContainer = styled(Box)`
|
|
13
|
+
background-clip: border-box;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
word-wrap: break-word;
|
|
17
|
+
position: relative;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
height: auto;
|
|
20
|
+
max-width: 222px;
|
|
21
|
+
background-color: #F5F5F5;
|
|
22
|
+
padding: 20px;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
gap: 30px;
|
|
25
|
+
.icon {
|
|
26
|
+
display: flex;
|
|
27
|
+
width: 100%;
|
|
28
|
+
}
|
|
29
|
+
.divider {
|
|
30
|
+
width: 182px;
|
|
31
|
+
height: 1px;
|
|
32
|
+
background: #B2B2B2;
|
|
33
|
+
}
|
|
34
|
+
.title {
|
|
35
|
+
font-size: 26px;
|
|
36
|
+
font-weight: 400;
|
|
37
|
+
margin-top: -10px;
|
|
38
|
+
}
|
|
39
|
+
.text {
|
|
40
|
+
font-weight: 400;
|
|
41
|
+
font-size: 14px;
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
46
44
|
|
|
47
45
|
const Icon = (): ReactElement => {
|
|
48
46
|
return (
|
|
@@ -13,53 +13,51 @@ type NsPostProps = {
|
|
|
13
13
|
className?: string;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
const CardContainer = styled(Box)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
};
|
|
62
|
-
});
|
|
16
|
+
const CardContainer = styled(Box)`
|
|
17
|
+
background-clip: border-box;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
word-wrap: break-word;
|
|
21
|
+
position: relative;
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
max-width: 165px;
|
|
24
|
+
height: 272px;
|
|
25
|
+
background-color: #fff;
|
|
26
|
+
.image {
|
|
27
|
+
height: 180px;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
object-fit: contain
|
|
30
|
+
}
|
|
31
|
+
.content {
|
|
32
|
+
padding: 20px;
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
min-height: 92px;
|
|
36
|
+
max-height: 92px;
|
|
37
|
+
justify-content: space-around
|
|
38
|
+
}
|
|
39
|
+
.body-title {
|
|
40
|
+
font-size: 18px;
|
|
41
|
+
font-weight: 600;
|
|
42
|
+
display: -webkit-box;
|
|
43
|
+
-webkit-box-orient: vertical;
|
|
44
|
+
-webkit-line-clamp: 1;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
text-overflow: ellipsis;
|
|
47
|
+
margin: 0
|
|
48
|
+
}
|
|
49
|
+
.body-text {
|
|
50
|
+
font-size: 12px;
|
|
51
|
+
font-weight: 700;
|
|
52
|
+
display: -webkit-box;
|
|
53
|
+
-webkit-box-orient: vertical;
|
|
54
|
+
-webkit-line-clamp: 1;
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
text-overflow: ellipsis;
|
|
57
|
+
color: #8C8C8C;
|
|
58
|
+
margin: 0
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
63
61
|
|
|
64
62
|
const NsPost = ({ text, body, backgroundImageDetail, className }: NsPostProps): ReactElement => {
|
|
65
63
|
return (
|
|
@@ -16,55 +16,53 @@ type NsSmallFullCardProps = {
|
|
|
16
16
|
className?: string;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
const CardContainer = styled(Box)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
};
|
|
67
|
-
});
|
|
19
|
+
const CardContainer = styled(Box)`
|
|
20
|
+
background-color: #fff;
|
|
21
|
+
display: flex;
|
|
22
|
+
max-height: 320px;
|
|
23
|
+
max-width: 375px;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
position: relative;
|
|
26
|
+
.image {
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: 100%;
|
|
29
|
+
object-fit: cover
|
|
30
|
+
}
|
|
31
|
+
.gradientOverlay {
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: 0;
|
|
34
|
+
left: 0;
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: 100%;
|
|
37
|
+
background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
|
|
38
|
+
}
|
|
39
|
+
.content {
|
|
40
|
+
position: absolute;
|
|
41
|
+
height: 100%;
|
|
42
|
+
width: 100%;
|
|
43
|
+
padding: 40px 40px 25px 30px;
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column
|
|
46
|
+
}
|
|
47
|
+
.subtitle {
|
|
48
|
+
color: #fff;
|
|
49
|
+
font-size: 11px;
|
|
50
|
+
font-weight: 400;
|
|
51
|
+
margin-top: auto
|
|
52
|
+
}
|
|
53
|
+
.title {
|
|
54
|
+
color: #fff;
|
|
55
|
+
font-size: 26px;
|
|
56
|
+
font-weight: 400;
|
|
57
|
+
margin-top: 20px
|
|
58
|
+
}
|
|
59
|
+
.cta {
|
|
60
|
+
margin-top: 20px;
|
|
61
|
+
max-width: 208px;
|
|
62
|
+
border-radius: 4px;
|
|
63
|
+
overflow: hidden
|
|
64
|
+
}
|
|
65
|
+
`
|
|
68
66
|
|
|
69
67
|
export default function NsSmallFullCard({
|
|
70
68
|
title,
|
|
@@ -16,51 +16,49 @@ type NsXLargeCardProps = {
|
|
|
16
16
|
className?: string;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
const CardContainer = styled(Box)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
};
|
|
63
|
-
});
|
|
19
|
+
const CardContainer = styled(Box)`
|
|
20
|
+
background-color: #fff;
|
|
21
|
+
display: flex;
|
|
22
|
+
height: 620px;
|
|
23
|
+
width: 450px;
|
|
24
|
+
position: relative;
|
|
25
|
+
.image {
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
object-fit: cover;
|
|
29
|
+
}
|
|
30
|
+
.gradientOverlay {
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 0;
|
|
33
|
+
left: 0;
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
36
|
+
background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
|
|
37
|
+
}
|
|
38
|
+
.content {
|
|
39
|
+
position: absolute;
|
|
40
|
+
height: 100%;
|
|
41
|
+
width: 100%;
|
|
42
|
+
padding: 40px 40px 25px 30px;
|
|
43
|
+
display: flex;
|
|
44
|
+
flex-direction: column;
|
|
45
|
+
}
|
|
46
|
+
.subtitle {
|
|
47
|
+
color: #fff;
|
|
48
|
+
font-size: 11px;
|
|
49
|
+
font-weight: 400;
|
|
50
|
+
margin-top: auto;
|
|
51
|
+
}
|
|
52
|
+
.title {
|
|
53
|
+
color: #fff;
|
|
54
|
+
font-size: 26px;
|
|
55
|
+
font-weight: 400;
|
|
56
|
+
margin-top: 20px;
|
|
57
|
+
}
|
|
58
|
+
.cta {
|
|
59
|
+
margin-top: 20px;
|
|
60
|
+
}
|
|
61
|
+
`
|
|
64
62
|
|
|
65
63
|
export default function NsXLargeCard({
|
|
66
64
|
title,
|
|
@@ -5,7 +5,7 @@ const { color, paletteColor } = ColorUtils;
|
|
|
5
5
|
const InputFieldWrapper = styled(Stack)(({ theme }: any) => {
|
|
6
6
|
return {
|
|
7
7
|
display: 'flex',
|
|
8
|
-
flexDirection: 'column',
|
|
8
|
+
flexDirection: 'column' as 'column',
|
|
9
9
|
gap: '7px',
|
|
10
10
|
'.MuiFormHelperText-root': {
|
|
11
11
|
fontSize: '11px',
|
|
@@ -32,26 +32,25 @@ export const StyledLinearProgress = styled(LinearProgress)<Omit<NsProgressProps,
|
|
|
32
32
|
},
|
|
33
33
|
})
|
|
34
34
|
);
|
|
35
|
-
export const StyledProgress = styled('div')
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
});
|
|
35
|
+
export const StyledProgress = styled('div')`
|
|
36
|
+
display: grid;
|
|
37
|
+
grid-template-rows: 30px 30px;
|
|
38
|
+
.progress-info {
|
|
39
|
+
justify-content: flex-end;
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
}
|
|
43
|
+
.progress-bar {
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
.MuiSvgIcon-root {
|
|
47
|
+
padding: 0;
|
|
48
|
+
margin: 0;
|
|
49
|
+
height: 100%;
|
|
50
|
+
position: relative;
|
|
51
|
+
left: -4px;
|
|
52
|
+
scale: 1.3
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
|
|
@@ -12,14 +12,14 @@ const Search = styled('div')`
|
|
|
12
12
|
width: 100%;
|
|
13
13
|
)`;
|
|
14
14
|
|
|
15
|
-
const SearchIconWrapper = styled('div')
|
|
16
|
-
height:
|
|
17
|
-
position:
|
|
18
|
-
|
|
19
|
-
display:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
const SearchIconWrapper = styled('div')`
|
|
16
|
+
height: 100%;
|
|
17
|
+
position: absolute;
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
`;
|
|
23
23
|
|
|
24
24
|
const StyledInputBase = styled(InputBase)(() => ({
|
|
25
25
|
color: 'inherit',
|