@am92/react-design-system 2.8.0 → 2.8.2
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/dist/Components/DsAvatar/DsAvatar.Component.d.ts +3 -1
- package/dist/Components/DsAvatar/DsAvatar.Component.js +5 -1
- package/dist/Components/DsBottomNavigationAction/DsBottomNavigationAction.Overrides.js +14 -4
- package/dist/Components/DsChip/DsChip.Component.d.ts +3 -1
- package/dist/Components/DsChip/DsChip.Component.js +5 -1
- package/dist/Components/DsChip/DsChip.Overrides.d.ts +1 -8
- package/dist/Components/DsChip/DsChip.Overrides.js +12 -57
- package/dist/Components/DsChip/DsChip.Types.d.ts +9 -3
- package/dist/Components/DsChip/DsChip.Types.js +1 -2
- package/dist/Components/DsFormHelperText/DsFormHelperText.Overrides.d.ts +1 -0
- package/dist/Components/DsFormHelperText/DsFormHelperText.Overrides.js +2 -0
- package/dist/Components/DsHelperText/DsHelperText.Overrides.d.ts +1 -5
- package/dist/Components/DsHelperText/DsHelperText.Overrides.js +1 -6
- package/dist/Components/DsLink/DsLink.Overrides.d.ts +5 -0
- package/dist/Components/DsLink/DsLink.Overrides.js +5 -0
- package/dist/Components/DsRadio/DsRadio.Component.js +1 -1
- package/dist/Components/DsRadio/DsRadio.Overrides.d.ts +1 -0
- package/dist/Components/DsRadio/DsRadio.Overrides.js +2 -1
- package/dist/Components/DsStepConnector/DsStepConnector.Overrides.js +2 -1
- package/dist/Components/DsTab/DsTab.Overrides.js +6 -0
- package/dist/Components/DsTabs/DsTabs.Overrides.d.ts +1 -0
- package/dist/Components/DsTabs/DsTabs.Overrides.js +2 -1
- package/dist/Components/DsTag/DsTag.Component.js +43 -4
- package/dist/Components/DsTag/DsTag.Overrides.d.ts +5 -1
- package/dist/Components/DsTag/DsTag.Overrides.js +6 -2
- package/dist/Components/DsToast/DsToast.Overrides.js +1 -1
- package/dist/Constants/TYPOGRAPGHY.d.ts +4 -1
- package/dist/Constants/TYPOGRAPGHY.js +3 -0
- package/dist/Helpers/accessibility.d.ts +3 -0
- package/dist/Helpers/accessibility.js +14 -0
- package/dist/Helpers/index.d.ts +1 -0
- package/dist/Helpers/index.js +1 -0
- package/dist/Hooks/accessibility.d.ts +9 -0
- package/dist/Hooks/accessibility.js +35 -0
- package/dist/Hooks/index.d.ts +1 -0
- package/dist/Hooks/index.js +1 -0
- package/dist/Theme/componentOverrides.d.ts +14 -8
- package/dist/Theme/getColorScheme/dark.js +1 -1
- package/dist/Types/DsAccessibility.d.ts +1 -0
- package/dist/Types/DsAccessibility.js +1 -0
- package/dist/Types/index.d.ts +1 -0
- package/dist/Types/index.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -6,7 +6,6 @@ export const DsBottomNavigationActionOverrides = {
|
|
|
6
6
|
root: {
|
|
7
7
|
marginLeft: 'var(--ds-spacing-quickFreeze)',
|
|
8
8
|
marginRight: 'var(--ds-spacing-quickFreeze)',
|
|
9
|
-
borderTopWidth: '2px',
|
|
10
9
|
borderTopStyle: 'solid',
|
|
11
10
|
borderTopColor: 'transparent',
|
|
12
11
|
padding: 'var(--ds-spacing-zero)',
|
|
@@ -16,8 +15,16 @@ export const DsBottomNavigationActionOverrides = {
|
|
|
16
15
|
paddingTop: 'var(--ds-spacing-glacial)'
|
|
17
16
|
},
|
|
18
17
|
'&.Mui-selected': {
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
color: 'var(--ds-colour-actionSecondary)',
|
|
19
|
+
// adding this for the inverse curve at top
|
|
20
|
+
'&::before': {
|
|
21
|
+
content: '""',
|
|
22
|
+
position: 'absolute',
|
|
23
|
+
width: '100%',
|
|
24
|
+
height: '2px',
|
|
25
|
+
backgroundColor: 'var(--ds-colour-actionSecondary)',
|
|
26
|
+
borderRadius: '0 0 2px 2px',
|
|
27
|
+
}
|
|
21
28
|
}
|
|
22
29
|
},
|
|
23
30
|
label: {
|
|
@@ -28,7 +35,10 @@ export const DsBottomNavigationActionOverrides = {
|
|
|
28
35
|
color: 'var(--ds-colour-typoDisabled)',
|
|
29
36
|
paddingBottom: 'var(--ds-spacing-quickFreeze)',
|
|
30
37
|
'&.Mui-selected': {
|
|
31
|
-
|
|
38
|
+
fontWeight: 'var(--ds-typo-bodyBoldMedium-fontWeight)',
|
|
39
|
+
fontSize: 'var(--ds-typo-bodyBoldMedium-fontSize)',
|
|
40
|
+
lineHeight: 'var(--ds-typo-bodyBoldMedium-lineHeight)',
|
|
41
|
+
letterSpacing: 'var(--ds-typo-bodyBoldMedium-letterSpacing)',
|
|
32
42
|
color: 'var(--ds-colour-actionSecondary)'
|
|
33
43
|
}
|
|
34
44
|
}
|
|
@@ -7,13 +7,6 @@ export declare const DsChipOverrides: {
|
|
|
7
7
|
props: Partial<DsChipProps>;
|
|
8
8
|
style: CSSInterpolation;
|
|
9
9
|
}[];
|
|
10
|
-
styleOverrides: {
|
|
11
|
-
root: CSSInterpolation;
|
|
12
|
-
filled: CSSInterpolation;
|
|
13
|
-
filledSecondary: CSSInterpolation;
|
|
14
|
-
label: CSSInterpolation;
|
|
15
|
-
icon: CSSInterpolation;
|
|
16
|
-
deleteIcon: CSSInterpolation;
|
|
17
|
-
};
|
|
10
|
+
styleOverrides: {};
|
|
18
11
|
};
|
|
19
12
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import STATE_STYLES from '../../Theme/STATE_STYLES';
|
|
2
1
|
import { DsChipDefaultProps } from './DsChip.Types';
|
|
3
2
|
export const DsChipOverrides = {
|
|
4
3
|
MuiChip: {
|
|
5
4
|
defaultProps: DsChipDefaultProps,
|
|
6
5
|
variants: [
|
|
7
6
|
{
|
|
8
|
-
props: {
|
|
7
|
+
props: { variant: 'chip' },
|
|
9
8
|
style: {
|
|
10
9
|
border: 'none',
|
|
11
10
|
borderRadius: 'var(--ds-radius-quickFreeze)',
|
|
@@ -25,7 +24,7 @@ export const DsChipOverrides = {
|
|
|
25
24
|
}
|
|
26
25
|
},
|
|
27
26
|
{
|
|
28
|
-
props: {
|
|
27
|
+
props: { variant: 'chip', type: 'status' },
|
|
29
28
|
style: {
|
|
30
29
|
fontWeight: 'var(--ds-typo-supportRegularMetadata-fontWeight)',
|
|
31
30
|
fontSize: 'var(--ds-typo-supportRegularMetadata-fontSize)',
|
|
@@ -40,7 +39,7 @@ export const DsChipOverrides = {
|
|
|
40
39
|
},
|
|
41
40
|
{
|
|
42
41
|
props: {
|
|
43
|
-
|
|
42
|
+
variant: 'chip',
|
|
44
43
|
type: 'status',
|
|
45
44
|
color: 'success'
|
|
46
45
|
},
|
|
@@ -50,7 +49,7 @@ export const DsChipOverrides = {
|
|
|
50
49
|
},
|
|
51
50
|
{
|
|
52
51
|
props: {
|
|
53
|
-
|
|
52
|
+
variant: 'chip',
|
|
54
53
|
type: 'status',
|
|
55
54
|
color: 'warning'
|
|
56
55
|
},
|
|
@@ -60,7 +59,7 @@ export const DsChipOverrides = {
|
|
|
60
59
|
},
|
|
61
60
|
{
|
|
62
61
|
props: {
|
|
63
|
-
|
|
62
|
+
variant: 'chip',
|
|
64
63
|
type: 'status',
|
|
65
64
|
color: 'error'
|
|
66
65
|
},
|
|
@@ -70,7 +69,7 @@ export const DsChipOverrides = {
|
|
|
70
69
|
},
|
|
71
70
|
{
|
|
72
71
|
props: {
|
|
73
|
-
|
|
72
|
+
variant: 'chip',
|
|
74
73
|
type: 'status',
|
|
75
74
|
color: 'info'
|
|
76
75
|
},
|
|
@@ -80,7 +79,7 @@ export const DsChipOverrides = {
|
|
|
80
79
|
}
|
|
81
80
|
},
|
|
82
81
|
{
|
|
83
|
-
props: {
|
|
82
|
+
props: { variant: 'chip', type: 'nudge' },
|
|
84
83
|
style: {
|
|
85
84
|
fontWeight: 'var(--ds-typo-supportRegularInfo-fontWeight)',
|
|
86
85
|
fontSize: 'var(--ds-typo-supportRegularInfo-fontSize)',
|
|
@@ -95,7 +94,7 @@ export const DsChipOverrides = {
|
|
|
95
94
|
},
|
|
96
95
|
{
|
|
97
96
|
props: {
|
|
98
|
-
|
|
97
|
+
variant: 'chip',
|
|
99
98
|
type: 'nudge',
|
|
100
99
|
color: 'success'
|
|
101
100
|
},
|
|
@@ -106,7 +105,7 @@ export const DsChipOverrides = {
|
|
|
106
105
|
},
|
|
107
106
|
{
|
|
108
107
|
props: {
|
|
109
|
-
|
|
108
|
+
variant: 'chip',
|
|
110
109
|
type: 'nudge',
|
|
111
110
|
color: 'warning'
|
|
112
111
|
},
|
|
@@ -117,7 +116,7 @@ export const DsChipOverrides = {
|
|
|
117
116
|
},
|
|
118
117
|
{
|
|
119
118
|
props: {
|
|
120
|
-
|
|
119
|
+
variant: 'chip',
|
|
121
120
|
type: 'nudge',
|
|
122
121
|
color: 'error'
|
|
123
122
|
},
|
|
@@ -128,7 +127,7 @@ export const DsChipOverrides = {
|
|
|
128
127
|
},
|
|
129
128
|
{
|
|
130
129
|
props: {
|
|
131
|
-
|
|
130
|
+
variant: 'chip',
|
|
132
131
|
type: 'nudge',
|
|
133
132
|
color: 'info'
|
|
134
133
|
},
|
|
@@ -138,50 +137,6 @@ export const DsChipOverrides = {
|
|
|
138
137
|
}
|
|
139
138
|
}
|
|
140
139
|
],
|
|
141
|
-
styleOverrides: {
|
|
142
|
-
root: {
|
|
143
|
-
paddingTop: 'var(--ds-spacing-quickFreeze)',
|
|
144
|
-
paddingBottom: 'var(--ds-spacing-quickFreeze)',
|
|
145
|
-
fontWeight: 'var(--ds-typo-bodyRegularMedium-fontWeight)',
|
|
146
|
-
fontSize: 'var(--ds-typo-bodyRegularMedium-fontSize)',
|
|
147
|
-
lineHeight: 'var(--ds-typo-bodyRegularMedium-lineHeight)',
|
|
148
|
-
letterSpacing: 'var(--ds-typo-bodyRegularMedium-letterSpacing)'
|
|
149
|
-
},
|
|
150
|
-
filled: {
|
|
151
|
-
backgroundColor: 'var(--ds-colour-surfacePrimary)',
|
|
152
|
-
border: '1px solid var(--ds-colour-strokeDefault)',
|
|
153
|
-
'> .MuiIcon-root': {
|
|
154
|
-
color: 'var(--ds-colour-iconDefault)'
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
filledSecondary: {
|
|
158
|
-
backgroundColor: 'var(--ds-colour-actionSecondary)',
|
|
159
|
-
border: '1px solid var(--ds-colour-strokeSelected)',
|
|
160
|
-
fontWeight: 'var(--ds-typo-bodyBoldMedium-fontWeight)',
|
|
161
|
-
fontSize: 'var(--ds-typo-bodyBoldMedium-fontSize)',
|
|
162
|
-
lineHeight: 'var(--ds-typo-bodyBoldMedium-lineHeight)',
|
|
163
|
-
letterSpacing: 'var(--ds-typo-bodyBoldMedium-letterSpacing)',
|
|
164
|
-
'> .MuiIcon-root': {
|
|
165
|
-
color: 'inherit'
|
|
166
|
-
},
|
|
167
|
-
...STATE_STYLES.ACTION_SECONDARY_STATE_SECONDARY
|
|
168
|
-
},
|
|
169
|
-
label: {
|
|
170
|
-
paddingTop: 'var(--ds-spacing-deepFreeze)',
|
|
171
|
-
paddingBottom: 'var(--ds-spacing-deepFreeze)',
|
|
172
|
-
paddingLeft: 'var(--ds-spacing-frostbite)',
|
|
173
|
-
paddingRight: 'var(--ds-spacing-frostbite)'
|
|
174
|
-
},
|
|
175
|
-
icon: {
|
|
176
|
-
fontSize: 'var(--ds-typo-fontSizeBitterCold)',
|
|
177
|
-
marginLeft: 'var(--ds-spacing-frostbite)',
|
|
178
|
-
marginRight: 'calc(var(--ds-spacing-quickFreeze) * -1)'
|
|
179
|
-
},
|
|
180
|
-
deleteIcon: {
|
|
181
|
-
fontSize: 'var(--ds-typo-fontSizeBitterCold)',
|
|
182
|
-
marginRight: 'var(--ds-spacing-frostbite)',
|
|
183
|
-
marginLeft: 'calc(var(--ds-spacing-quickFreeze) * -1)'
|
|
184
|
-
}
|
|
185
|
-
}
|
|
140
|
+
styleOverrides: {}
|
|
186
141
|
}
|
|
187
142
|
};
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { ChipProps } from '@mui/material';
|
|
2
|
-
export interface DsChipProps extends Omit<ChipProps, '
|
|
2
|
+
export interface DsChipProps extends Omit<ChipProps, 'onDelete'> {
|
|
3
3
|
type?: 'status' | 'nudge';
|
|
4
|
-
color?: Extract<ChipProps['color'], 'default' | 'info' | 'success' | 'warning' | 'error'>;
|
|
5
|
-
'ds-variant'?: 'chip';
|
|
6
4
|
}
|
|
7
5
|
export declare const DsChipDefaultProps: DsChipProps;
|
|
6
|
+
declare module '@mui/material/Chip' {
|
|
7
|
+
interface ChipPropsVariantOverrides {
|
|
8
|
+
filled: false;
|
|
9
|
+
outlined: false;
|
|
10
|
+
chip: true;
|
|
11
|
+
tag: true;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -11,7 +11,12 @@ export declare const DsLinkOverrides: {
|
|
|
11
11
|
textDecorationColor: string;
|
|
12
12
|
};
|
|
13
13
|
'&:active': {
|
|
14
|
+
fontWeight: string;
|
|
15
|
+
fontSize: string;
|
|
16
|
+
lineHeight: string;
|
|
17
|
+
letterSpacing: string;
|
|
14
18
|
color: string;
|
|
19
|
+
textDecoration: string;
|
|
15
20
|
textDecorationColor: string;
|
|
16
21
|
};
|
|
17
22
|
'&:disabled': {
|
|
@@ -12,7 +12,12 @@ export const DsLinkOverrides = {
|
|
|
12
12
|
textDecorationColor: 'var(--ds-colour-stateSelectedVisitedTextLink)'
|
|
13
13
|
},
|
|
14
14
|
'&:active': {
|
|
15
|
+
fontWeight: 'var(--ds-typo-bodyBoldSmall-fontWeight)',
|
|
16
|
+
fontSize: 'var(--ds-typo-bodyBoldSmall-fontSize)',
|
|
17
|
+
lineHeight: 'var(--ds-typo-bodyBoldSmall-lineHeight)',
|
|
18
|
+
letterSpacing: 'var(--ds-typo-bodyBoldSmall-letterSpacing)',
|
|
15
19
|
color: 'var(--ds-colour-typoActionPrimary)',
|
|
20
|
+
textDecoration: 'underline',
|
|
16
21
|
textDecorationColor: 'var(--ds-colour-typoActionPrimary)'
|
|
17
22
|
},
|
|
18
23
|
'&:disabled': {
|
|
@@ -4,7 +4,7 @@ import { DsRadioDefaultProps } from './DsRadio.Types';
|
|
|
4
4
|
import { DsFormControlLabel } from '../DsFormControlLabel';
|
|
5
5
|
import { DsRemixIcon } from '../DsRemixIcon';
|
|
6
6
|
export const DsRadio = (inProps) => {
|
|
7
|
-
const props = { ...
|
|
7
|
+
const props = { ...DsRadioDefaultProps, ...inProps };
|
|
8
8
|
const { disabled, RadioProps, ...restProps } = props;
|
|
9
9
|
return (_jsx(DsFormControlLabel, { ...restProps, disabled: disabled, control: _jsx(Radio, { icon: _jsx(DsRemixIcon, { className: "ri-checkbox-blank-circle-line", sx: { fontSize: 'var(--ds-typo-fontSizeBitterCold)' } }), checkedIcon: _jsx(DsRemixIcon, { className: "ri-radio-button-line", sx: { fontSize: 'var(--ds-typo-fontSizeBitterCold)' } }), color: "secondary", ...RadioProps, disabled: disabled }) }));
|
|
10
10
|
};
|
|
@@ -9,7 +9,8 @@ export const DsStepConnectorOverrides = {
|
|
|
9
9
|
borderLeftWidth: '2px',
|
|
10
10
|
borderLeftStyle: 'solid',
|
|
11
11
|
borderLeftColor: 'var(--ds-colour-strokeDefault)',
|
|
12
|
-
minHeight: 'var(--ds-rules-stepperConnectorMinHeight)'
|
|
12
|
+
minHeight: 'var(--ds-rules-stepperConnectorMinHeight)',
|
|
13
|
+
marginLeft: '15px'
|
|
13
14
|
},
|
|
14
15
|
lineHorizontal: {
|
|
15
16
|
borderTopWidth: '2px',
|
|
@@ -18,6 +18,12 @@ export const DsTabOverrides = {
|
|
|
18
18
|
'> .MuiTab-iconWrapper': {
|
|
19
19
|
fontSize: 'var(--ds-typo-fontSizeFrostbite)',
|
|
20
20
|
margin: 'var(--ds-spacing-zero)'
|
|
21
|
+
},
|
|
22
|
+
'&.Mui-selected': {
|
|
23
|
+
fontWeight: 'var(--ds-typo-bodyBoldMedium-fontWeight)',
|
|
24
|
+
fontSize: 'var(--ds-typo-bodyBoldMedium-fontSize)',
|
|
25
|
+
lineHeight: 'var(--ds-typo-bodyBoldMedium-lineHeight)',
|
|
26
|
+
letterSpacing: 'var(--ds-typo-bodyBoldMedium-letterSpacing)',
|
|
21
27
|
}
|
|
22
28
|
}
|
|
23
29
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Chip from '@mui/material/Chip';
|
|
3
|
-
import { DsTagDefaultProps } from './DsTag.Types';
|
|
4
3
|
import { DsRemixIcon } from '../DsRemixIcon';
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import STATE_STYLES from '../../Theme/STATE_STYLES';
|
|
5
|
+
import { useThemeProps } from '@mui/system';
|
|
6
|
+
export const DsTag = inProps => {
|
|
7
|
+
const props = useThemeProps({ props: inProps, name: 'DsTag' });
|
|
7
8
|
const handleClick = () => {
|
|
8
9
|
const { value, onClick } = props;
|
|
9
10
|
if (typeof onClick === 'function') {
|
|
@@ -18,5 +19,43 @@ export const DsTag = (inProps) => {
|
|
|
18
19
|
};
|
|
19
20
|
const { selected, onClick, onDelete, ...chipProps } = props;
|
|
20
21
|
const color = (selected && 'secondary') || 'default';
|
|
21
|
-
return (_jsx(Chip, { deleteIcon: _jsx(DsRemixIcon, { className: "ri-close-circle-fill" }), skipFocusWhenDisabled: true,
|
|
22
|
+
return (_jsx(Chip, { deleteIcon: _jsx(DsRemixIcon, { className: "ri-close-circle-fill" }), skipFocusWhenDisabled: true, sx: {
|
|
23
|
+
paddingTop: 'var(--ds-spacing-quickFreeze)',
|
|
24
|
+
paddingBottom: 'var(--ds-spacing-quickFreeze)',
|
|
25
|
+
fontWeight: 'var(--ds-typo-bodyRegularMedium-fontWeight)',
|
|
26
|
+
fontSize: 'var(--ds-typo-bodyRegularMedium-fontSize)',
|
|
27
|
+
lineHeight: 'var(--ds-typo-bodyRegularMedium-lineHeight)',
|
|
28
|
+
letterSpacing: 'var(--ds-typo-bodyRegularMedium-letterSpacing)',
|
|
29
|
+
backgroundColor: 'var(--ds-colour-surfacePrimary)',
|
|
30
|
+
border: '1px solid var(--ds-colour-strokeDefault)',
|
|
31
|
+
'&.MuiChip-colorSecondary': {
|
|
32
|
+
backgroundColor: 'var(--ds-colour-actionSecondary)',
|
|
33
|
+
border: '1px solid var(--ds-colour-strokeSelected)',
|
|
34
|
+
fontWeight: 'var(--ds-typo-bodyBoldMedium-fontWeight)',
|
|
35
|
+
fontSize: 'var(--ds-typo-bodyBoldMedium-fontSize)',
|
|
36
|
+
lineHeight: 'var(--ds-typo-bodyBoldMedium-lineHeight)',
|
|
37
|
+
letterSpacing: 'var(--ds-typo-bodyBoldMedium-letterSpacing)',
|
|
38
|
+
'> .MuiChip-icon': {
|
|
39
|
+
color: 'inherit'
|
|
40
|
+
},
|
|
41
|
+
...STATE_STYLES.ACTION_SECONDARY_STATE_SECONDARY
|
|
42
|
+
},
|
|
43
|
+
'> .MuiChip-label': {
|
|
44
|
+
paddingTop: 'var(--ds-spacing-deepFreeze)',
|
|
45
|
+
paddingBottom: 'var(--ds-spacing-deepFreeze)',
|
|
46
|
+
paddingLeft: 'var(--ds-spacing-frostbite)',
|
|
47
|
+
paddingRight: 'var(--ds-spacing-frostbite)'
|
|
48
|
+
},
|
|
49
|
+
'> .MuiChip-icon': {
|
|
50
|
+
color: 'var(--ds-colour-iconDefault)',
|
|
51
|
+
fontSize: 'var(--ds-typo-fontSizeBitterCold)',
|
|
52
|
+
marginLeft: 'var(--ds-spacing-frostbite)',
|
|
53
|
+
marginRight: 'calc(var(--ds-spacing-quickFreeze) * -1)'
|
|
54
|
+
},
|
|
55
|
+
'> .MuiChip-deleteIcon': {
|
|
56
|
+
fontSize: 'var(--ds-typo-fontSizeBitterCold)',
|
|
57
|
+
marginRight: 'var(--ds-spacing-frostbite)',
|
|
58
|
+
marginLeft: 'calc(var(--ds-spacing-quickFreeze) * -1)'
|
|
59
|
+
}
|
|
60
|
+
}, ...chipProps, variant: "tag", clickable: true, color: color, onDelete: (onDelete && handleDelete) || undefined, onClick: handleClick }));
|
|
22
61
|
};
|
|
@@ -36,7 +36,7 @@ export const DsToastOverrides = {
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
filledDefault: {
|
|
39
|
-
borderColor: 'var(--ds-colour-
|
|
39
|
+
borderColor: 'var(--ds-colour-strokeActive)',
|
|
40
40
|
backgroundColor: 'var(--ds-colour-surfaceTertiary)',
|
|
41
41
|
color: 'var(--ds-colour-typoOnSurfaceDynamic)'
|
|
42
42
|
},
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import { DsTypographyTokens } from '../Types';
|
|
1
|
+
import { DS_TYPOGRAPHY_HTML_FONT_SIZE, DsTypographyTokens } from '../Types';
|
|
2
2
|
export declare const DSTYPOGRAPHY_TOKENS: DsTypographyTokens[];
|
|
3
|
+
export declare const DS_TYPOGRAPHY_DEFAULT_HTML_FONT_SIZE: DS_TYPOGRAPHY_HTML_FONT_SIZE;
|
|
4
|
+
export declare const DS_TYPOGRAPHY_MIN_HTML_FONT_SIZE: DS_TYPOGRAPHY_HTML_FONT_SIZE;
|
|
5
|
+
export declare const DS_TYPOGRAPHY_MAX_HTML_FONT_SIZE: DS_TYPOGRAPHY_HTML_FONT_SIZE;
|
|
@@ -28,3 +28,6 @@ export const DSTYPOGRAPHY_TOKENS = [
|
|
|
28
28
|
'supportBoldTextButton',
|
|
29
29
|
'supportRegularMetadata'
|
|
30
30
|
];
|
|
31
|
+
export const DS_TYPOGRAPHY_DEFAULT_HTML_FONT_SIZE = 16;
|
|
32
|
+
export const DS_TYPOGRAPHY_MIN_HTML_FONT_SIZE = 16;
|
|
33
|
+
export const DS_TYPOGRAPHY_MAX_HTML_FONT_SIZE = 18;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DS_TYPOGRAPHY_DEFAULT_HTML_FONT_SIZE, DS_TYPOGRAPHY_MIN_HTML_FONT_SIZE, DS_TYPOGRAPHY_MAX_HTML_FONT_SIZE } from '../Constants';
|
|
2
|
+
export const getCurrentFontSize = () => {
|
|
3
|
+
const htmlElement = document.documentElement;
|
|
4
|
+
const computedFontSize = window.getComputedStyle(htmlElement).fontSize;
|
|
5
|
+
if (computedFontSize) {
|
|
6
|
+
const parsedFontSize = parseInt(computedFontSize, 10);
|
|
7
|
+
return parsedFontSize;
|
|
8
|
+
}
|
|
9
|
+
return DS_TYPOGRAPHY_DEFAULT_HTML_FONT_SIZE;
|
|
10
|
+
};
|
|
11
|
+
export const isValidFontSize = (fontSize) => {
|
|
12
|
+
return (fontSize >= DS_TYPOGRAPHY_MIN_HTML_FONT_SIZE &&
|
|
13
|
+
fontSize <= DS_TYPOGRAPHY_MAX_HTML_FONT_SIZE);
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './accessibility';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './accessibility';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DS_TYPOGRAPHY_HTML_FONT_SIZE } from '../Types';
|
|
2
|
+
export declare const useFontSizeAccessibility: () => {
|
|
3
|
+
fontSize: DS_TYPOGRAPHY_HTML_FONT_SIZE;
|
|
4
|
+
disableDecrease: boolean;
|
|
5
|
+
disableIncrease: boolean;
|
|
6
|
+
increaseFontSize: () => void;
|
|
7
|
+
decreaseFontSize: () => void;
|
|
8
|
+
setFontSize: (newFontSize: DS_TYPOGRAPHY_HTML_FONT_SIZE) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
2
|
+
import { DS_TYPOGRAPHY_DEFAULT_HTML_FONT_SIZE, DS_TYPOGRAPHY_MAX_HTML_FONT_SIZE, DS_TYPOGRAPHY_MIN_HTML_FONT_SIZE } from '../Constants';
|
|
3
|
+
import { getCurrentFontSize, isValidFontSize } from '../Helpers';
|
|
4
|
+
export const useFontSizeAccessibility = () => {
|
|
5
|
+
let currentFontSize = getCurrentFontSize();
|
|
6
|
+
if (!isValidFontSize(currentFontSize)) {
|
|
7
|
+
currentFontSize = DS_TYPOGRAPHY_DEFAULT_HTML_FONT_SIZE;
|
|
8
|
+
}
|
|
9
|
+
const [fontSize, setFontSize] = useState(currentFontSize);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const htmlElement = document.documentElement;
|
|
12
|
+
htmlElement.style.fontSize = `${fontSize}px`;
|
|
13
|
+
}, [fontSize, document.documentElement.style.fontSize]);
|
|
14
|
+
const setValidFontSize = useCallback((newFontSize) => {
|
|
15
|
+
if (isValidFontSize(newFontSize)) {
|
|
16
|
+
setFontSize(newFontSize);
|
|
17
|
+
}
|
|
18
|
+
}, []);
|
|
19
|
+
const deltaChangeFontSize = (delta) => () => {
|
|
20
|
+
const newFontSize = (fontSize + delta);
|
|
21
|
+
if (isValidFontSize(newFontSize)) {
|
|
22
|
+
setFontSize(newFontSize);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
let disableIncrease = fontSize >= DS_TYPOGRAPHY_MAX_HTML_FONT_SIZE;
|
|
26
|
+
let disableDecrease = fontSize <= DS_TYPOGRAPHY_MIN_HTML_FONT_SIZE;
|
|
27
|
+
return {
|
|
28
|
+
fontSize,
|
|
29
|
+
disableDecrease,
|
|
30
|
+
disableIncrease,
|
|
31
|
+
increaseFontSize: deltaChangeFontSize(1),
|
|
32
|
+
decreaseFontSize: deltaChangeFontSize(-1),
|
|
33
|
+
setFontSize: setValidFontSize
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './accessibility';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './accessibility';
|
|
@@ -480,6 +480,9 @@ declare const componentOverrides: {
|
|
|
480
480
|
};
|
|
481
481
|
};
|
|
482
482
|
};
|
|
483
|
+
DsTag: {
|
|
484
|
+
defaultProps: import("../Components").DsTagProps;
|
|
485
|
+
};
|
|
483
486
|
MuiTabs: {
|
|
484
487
|
defaultProps: import("../Components").DsTabsProps;
|
|
485
488
|
variants: {
|
|
@@ -490,6 +493,7 @@ declare const componentOverrides: {
|
|
|
490
493
|
root: import("@mui/system").CSSInterpolation;
|
|
491
494
|
indicator: {
|
|
492
495
|
height: string;
|
|
496
|
+
borderRadius: string;
|
|
493
497
|
};
|
|
494
498
|
};
|
|
495
499
|
};
|
|
@@ -725,6 +729,7 @@ declare const componentOverrides: {
|
|
|
725
729
|
styleOverrides: {
|
|
726
730
|
root: {
|
|
727
731
|
padding: string;
|
|
732
|
+
color: string;
|
|
728
733
|
};
|
|
729
734
|
};
|
|
730
735
|
};
|
|
@@ -769,7 +774,12 @@ declare const componentOverrides: {
|
|
|
769
774
|
textDecorationColor: string;
|
|
770
775
|
};
|
|
771
776
|
'&:active': {
|
|
777
|
+
fontWeight: string;
|
|
778
|
+
fontSize: string;
|
|
779
|
+
lineHeight: string;
|
|
780
|
+
letterSpacing: string;
|
|
772
781
|
color: string;
|
|
782
|
+
textDecoration: string;
|
|
773
783
|
textDecorationColor: string;
|
|
774
784
|
};
|
|
775
785
|
'&:disabled': {
|
|
@@ -980,6 +990,9 @@ declare const componentOverrides: {
|
|
|
980
990
|
};
|
|
981
991
|
MuiFormHelperText: {
|
|
982
992
|
defaultProps: import("../Components").DsHelperTextProps;
|
|
993
|
+
styleOverrides: {
|
|
994
|
+
root: import("@mui/system").CSSInterpolation;
|
|
995
|
+
};
|
|
983
996
|
};
|
|
984
997
|
MuiFormControlLabel: {
|
|
985
998
|
styleOverrides: {
|
|
@@ -1097,14 +1110,7 @@ declare const componentOverrides: {
|
|
|
1097
1110
|
props: Partial<import("../Components").DsChipProps>;
|
|
1098
1111
|
style: import("@mui/system").CSSInterpolation;
|
|
1099
1112
|
}[];
|
|
1100
|
-
styleOverrides: {
|
|
1101
|
-
root: import("@mui/system").CSSInterpolation;
|
|
1102
|
-
filled: import("@mui/system").CSSInterpolation;
|
|
1103
|
-
filledSecondary: import("@mui/system").CSSInterpolation;
|
|
1104
|
-
label: import("@mui/system").CSSInterpolation;
|
|
1105
|
-
icon: import("@mui/system").CSSInterpolation;
|
|
1106
|
-
deleteIcon: import("@mui/system").CSSInterpolation;
|
|
1107
|
-
};
|
|
1113
|
+
styleOverrides: {};
|
|
1108
1114
|
};
|
|
1109
1115
|
MuiCheckbox: {
|
|
1110
1116
|
defaultProps: import("../Components").DsCheckboxProps;
|
|
@@ -47,7 +47,7 @@ export default function getDarkModeColorScheme(colorPalette) {
|
|
|
47
47
|
supportPositive: successGreenDark,
|
|
48
48
|
supportWarning: warningOrangeDark,
|
|
49
49
|
supportVariable: snackBlue,
|
|
50
|
-
supportTypical:
|
|
50
|
+
supportTypical: typical,
|
|
51
51
|
supportNegativeNeutral: errorRedNeutralDark,
|
|
52
52
|
supportPositiveNeutral: successGreenNeutralDark,
|
|
53
53
|
supportWarningNeutral: warningOrangeNeutralDark,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type DS_TYPOGRAPHY_HTML_FONT_SIZE = 16 | 17 | 18;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/Types/index.d.ts
CHANGED
package/dist/Types/index.js
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED