@nuskin/foundation-ui-components 1.0.0-develop.4 → 1.0.0-develop.5
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 +9 -4
- package/src/common/accordion/specs/NsAccordion.spec.tsx +3 -1
- package/src/common/accordion/specs/NsAccordionHeader.spec.tsx +21 -5
- package/src/common/accordion/specs/NsAccordionItem.spec.tsx +29 -5
- package/src/common/accordion/specs/NsCollapse.spec.tsx +4 -4
- package/src/common/accordion/specs/NsToggleSection.spec.tsx +10 -5
- package/src/common/alert/NsAlert.spec.tsx +0 -1
- package/src/common/alert/NsAlert.styled.ts +10 -10
- package/src/common/alert/NsAlert.tsx +4 -3
- package/src/common/auth-dropdown/NsAuthDropdown.styled.ts +12 -11
- package/src/common/auth-dropdown/NsAuthDropdown.tsx +2 -1
- package/src/common/auth-dropdown/types.d.ts +3 -1
- package/src/common/brand-components/NsBrandComponent.tsx +3 -0
- package/src/common/breadcrumb/NsBreadcrumb.tsx +4 -2
- package/src/common/button/NsButton.spec.tsx +1 -1
- package/src/common/button/NsButton.stories.tsx +1 -1
- package/src/common/button/NsButton.styled.tsx +25 -23
- package/src/common/button/NsButton.tsx +9 -2
- package/src/common/button/types.d.ts +1 -0
- package/src/common/common.types.d.ts +1 -0
- package/src/common/dropdown/types.d.ts +3 -1
- package/src/common/flag/NsFlag.spec.tsx +1 -0
- package/src/common/flag/NsFlag.styled.tsx +5 -5
- package/src/common/icon/types.d.ts +1 -0
- package/src/common/input/InputFieldWrapper.tsx +4 -4
- package/src/common/label/NsLabel.tsx +11 -7
- package/src/common/nav-tab/NsNavTab.styled.tsx +7 -4
- package/src/common/radiogroup/NsRadioGroup.spec.tsx +2 -1
- package/src/common/radiogroup/NsRadioGroup.stories.tsx +2 -1
- package/src/common/radiogroup/NsRadioGroup.styled.tsx +26 -32
- package/src/common/radiogroup/NsRadioGroup.tsx +20 -5
- package/src/common/radiogroup/types.d.ts +4 -3
- package/src/common/select/NsSelect.styled.tsx +19 -23
- package/src/common/table/NsTable.styled.ts +69 -66
- package/src/common/text-strip/NsTextStrip.tsx +10 -7
- package/src/common/typography/Typography.styled.tsx +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// TODO: const ariel = #f8e9f8;
|
|
2
2
|
|
|
3
|
-
import { styled } from '@nuskin/foundation-theme';
|
|
4
|
-
|
|
3
|
+
import { styled, ColorUtils } from '@nuskin/foundation-theme';
|
|
4
|
+
|
|
5
5
|
import {
|
|
6
6
|
Table,
|
|
7
7
|
TableContainer,
|
|
@@ -12,8 +12,10 @@ import {
|
|
|
12
12
|
import Pagination from '@mui/material/Pagination';
|
|
13
13
|
import LinearProgress from '@mui/material/LinearProgress';
|
|
14
14
|
|
|
15
|
+
const { color } = ColorUtils;
|
|
16
|
+
|
|
15
17
|
export const StyledTableContainer= styled(TableContainer)`
|
|
16
|
-
background-color: ${(
|
|
18
|
+
background-color: ${color('primary', 'white')};
|
|
17
19
|
`;
|
|
18
20
|
|
|
19
21
|
export const StyledTable = styled(Table)`
|
|
@@ -21,53 +23,54 @@ export const StyledTable = styled(Table)`
|
|
|
21
23
|
`;
|
|
22
24
|
|
|
23
25
|
export const StyledTableSortLabel = styled(TableSortLabel)`
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
color: ${(
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
font-size: 12px;
|
|
27
|
+
text-transform: uppercase;
|
|
28
|
+
font-weight: 600;
|
|
29
|
+
line-height: 16px;
|
|
30
|
+
letter-spacing: 0.05em;
|
|
31
|
+
color: rgba(0, 0, 0, 0.54);
|
|
32
|
+
&:hover {
|
|
33
|
+
color: ${color('primary', 'black')};
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
34
36
|
|
|
35
37
|
export const StyledTableLabel = styled.span`
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
font-size: 12px;
|
|
39
|
+
text-transform: uppercase;
|
|
40
|
+
font-weight: 700;
|
|
41
|
+
line-height: 16px;
|
|
42
|
+
letter-spacing: 0.05em;
|
|
43
|
+
color: rgba(0, 0, 0, 0.54);
|
|
44
|
+
&:hover {
|
|
45
|
+
cursor: default;
|
|
46
|
+
}
|
|
45
47
|
`;
|
|
46
48
|
|
|
47
49
|
export const StyledPageComponent = styled.div`
|
|
48
|
-
|
|
50
|
+
background-color: ${color('primary', 'white')};
|
|
49
51
|
`;
|
|
50
52
|
|
|
51
53
|
export const StyledEmptyRow = styled(TableRow)<{emptyRows: number}>`
|
|
52
|
-
|
|
54
|
+
height: ${({ emptyRows }) => 48 * emptyRows}px;
|
|
53
55
|
`;
|
|
54
56
|
|
|
57
|
+
// [Todo-Arun] - Move f8e9f8 to custom color palette
|
|
55
58
|
export const StyledTableRow = styled(TableRow)`
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
&:hover {
|
|
60
|
+
background-color: #f8e9f8 !important;
|
|
61
|
+
}
|
|
59
62
|
`;
|
|
60
63
|
|
|
61
64
|
export const StyledTableLastCell = styled(TableCell)`
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
display: flex;
|
|
66
|
+
height: 49px;
|
|
67
|
+
align-items: center;
|
|
68
|
+
padding: 0 24px;
|
|
69
|
+
margin-bottom: -0.5px;
|
|
67
70
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
.action {
|
|
72
|
+
margin-left: auto;
|
|
73
|
+
}
|
|
71
74
|
`;
|
|
72
75
|
|
|
73
76
|
export const StyledOriginalTableCell = styled(TableCell)`
|
|
@@ -76,43 +79,43 @@ export const StyledOriginalTableCell = styled(TableCell)`
|
|
|
76
79
|
`;
|
|
77
80
|
|
|
78
81
|
export const StyledPagination = styled(Pagination)`
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
82
|
+
.MuiPagination-ul {
|
|
83
|
+
display: flex;
|
|
84
|
+
justify-content: flex-end;
|
|
85
|
+
background-color: ${color('primary', 'white')};
|
|
86
|
+
}
|
|
87
|
+
& .MuiPaginationItem-previousNext {
|
|
88
|
+
margin: 0.3rem 10px;
|
|
89
|
+
width: 2rem;
|
|
90
|
+
height: 2rem;
|
|
91
|
+
border-radius: 4px;
|
|
92
|
+
}
|
|
93
|
+
& .MuiPaginationItem-page {
|
|
94
|
+
border-radius: 0px;
|
|
95
|
+
width: auto;
|
|
96
|
+
min-width: 34px;
|
|
97
|
+
padding: 0 5px;
|
|
98
|
+
font-size: 16px;
|
|
99
|
+
line-height: 17px;
|
|
100
|
+
border-color: ${color('primary', 'black')};
|
|
101
|
+
}
|
|
102
|
+
& .MuiPaginationItem-root.Mui-selected {
|
|
103
|
+
background-color: ${color('primary', 'black')};
|
|
104
|
+
color: ${color('primary', 'white')};
|
|
105
|
+
}
|
|
103
106
|
`;
|
|
104
107
|
|
|
105
108
|
export const StyledExpandCell= styled(TableCell)`
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
padding-bottom: 0;
|
|
110
|
+
padding-top: 0;
|
|
111
|
+
&.remove {
|
|
112
|
+
border: 0;
|
|
113
|
+
}
|
|
111
114
|
`;
|
|
112
115
|
|
|
113
116
|
export const StyledProgressCell = styled(TableCell)`
|
|
114
|
-
|
|
115
|
-
|
|
117
|
+
padding: 0;
|
|
118
|
+
border: 0;
|
|
116
119
|
`;
|
|
117
120
|
|
|
118
121
|
export const StyledLinearProgress = styled(LinearProgress)`
|
|
@@ -8,14 +8,16 @@ import React from 'react';
|
|
|
8
8
|
import { NsTextStripProps } from './types.d';
|
|
9
9
|
import { NsTypography } from '../typography';
|
|
10
10
|
import { NsLink } from '../link';
|
|
11
|
-
import { styled, ColorUtils
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
return palette.primary.main === getAppColor(theme, 'primary', 'black');
|
|
16
|
-
};
|
|
11
|
+
import { styled, ColorUtils } from '@nuskin/foundation-theme';
|
|
12
|
+
|
|
13
|
+
const { isDarkMode, paletteColor, color } = ColorUtils;
|
|
14
|
+
|
|
17
15
|
const StyledHeader = styled.header`
|
|
18
|
-
background: ${(
|
|
16
|
+
background: ${(props) => (
|
|
17
|
+
!isDarkMode(props)
|
|
18
|
+
? color('primary', 'gray')
|
|
19
|
+
: paletteColor('primary', 'contrastText')
|
|
20
|
+
)};
|
|
19
21
|
display: flex;
|
|
20
22
|
flex-direction: column;
|
|
21
23
|
min-height: 60px;
|
|
@@ -25,6 +27,7 @@ const StyledHeader = styled.header`
|
|
|
25
27
|
font-weight: 600;
|
|
26
28
|
}
|
|
27
29
|
`;
|
|
30
|
+
|
|
28
31
|
const NsTextStrip = (props: NsTextStripProps) => {
|
|
29
32
|
const { alignment = 'center', text, description, link, className = '' } = props;
|
|
30
33
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { styled, ColorUtils } from '@nuskin/foundation-theme';
|
|
2
2
|
import { NsTypographyProps } from './types.d';
|
|
3
3
|
|
|
4
|
-
const {
|
|
4
|
+
const { paletteColor } = ColorUtils;
|
|
5
5
|
|
|
6
6
|
const variantStyles = {
|
|
7
7
|
h1: 'font-size: 36px; line-height: 44px;',
|
|
@@ -29,8 +29,8 @@ const fontWeightMap = {
|
|
|
29
29
|
|
|
30
30
|
export const StyledTypography = styled.div<NsTypographyProps>`
|
|
31
31
|
font-family: Inter;
|
|
32
|
-
color: ${({ color,
|
|
33
|
-
colorOverride?.startsWith('#') ? colorOverride :
|
|
32
|
+
color: ${({ color, colorOverride }) =>
|
|
33
|
+
colorOverride?.startsWith('#') ? colorOverride : paletteColor(color)};
|
|
34
34
|
font-weight: ${({ weight = 'normal' }) => fontWeightMap[weight]};
|
|
35
35
|
font-style: ${({ fontStyle }) => fontStyle};
|
|
36
36
|
${({ variant = 'h1' }) => variantStyles[variant]};
|