@scality/core-ui 0.152.0 → 0.154.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/dist/components/buttonv2/Buttonv2.component.js +1 -1
- package/dist/components/icon/Icon.component.d.ts +1 -0
- package/dist/components/icon/Icon.component.d.ts.map +1 -1
- package/dist/components/icon/Icon.component.js +2 -1
- package/dist/components/inputv2/inputv2.js +7 -7
- package/package.json +1 -1
- package/src/lib/components/buttonv2/Buttonv2.component.tsx +3 -3
- package/src/lib/components/icon/Icon.component.tsx +2 -1
- package/src/lib/components/iconhelper/IconHelper.test.tsx +5 -5
- package/src/lib/components/inputv2/inputv2.tsx +7 -7
|
@@ -25,10 +25,10 @@ export const ButtonStyled = styled.button `
|
|
|
25
25
|
text-decoration: none;
|
|
26
26
|
font-family: 'Lato';
|
|
27
27
|
font-weight: ${fontWeight.base};
|
|
28
|
-
|
|
29
28
|
padding: ${spacing.r4} ${spacing.r8};
|
|
30
29
|
font-size: ${fontSize.base};
|
|
31
30
|
border-radius: ${spacing.r4};
|
|
31
|
+
white-space: nowrap;
|
|
32
32
|
height: ${(props) => (props.size === 'inline' ? spacing.r24 : spacing.r32)};
|
|
33
33
|
${(props) => {
|
|
34
34
|
const brand = props.theme;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/icon/Icon.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EACL,aAAa,EAKd,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"Icon.component.d.ts","sourceRoot":"","sources":["../../../src/lib/components/icon/Icon.component.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EACL,aAAa,EAKd,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6HrB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;CAOvB,CAAC;AAaF,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,SAAS,GAAG,MAAM,OAAO,WAAW,CAAC;AACzE,MAAM,MAAM,SAAS,GAAG,MAAM,WAAW,CAAC;AAC1C,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAiBF,eAAO,MAAM,WAAW;UAAsB,QAAQ;SAiCrD,CAAC;AAyEF,iBAAS,IAAI,CAAC,EAAE,WAAW,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,2CAU7C;AAED,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
|
@@ -129,6 +129,7 @@ export const iconTable = {
|
|
|
129
129
|
Ring: 'fas faRing',
|
|
130
130
|
Stop: 'fas faStop',
|
|
131
131
|
Play: 'fas faPlay',
|
|
132
|
+
Mail: 'fas faEnvelope',
|
|
132
133
|
};
|
|
133
134
|
export const customIcons = {
|
|
134
135
|
'Remote-user': ({ ariaLabel, color, size }) => (_jsx(RemoteUser, { ariaLabel: ariaLabel, color: color, size: size })),
|
|
@@ -217,7 +218,7 @@ function NonWrappedIcon({ name, size = '1x', color = undefined, ariaLabel = '',
|
|
|
217
218
|
}
|
|
218
219
|
},
|
|
219
220
|
});
|
|
220
|
-
return (_jsxs(_Fragment, { children: [(status === 'loading' || status === 'error') && (_jsx(DelayedFallback, { "aria-label": `${name} ${ariaLabel}`, children: _jsx(Loader, { size: "base" }) })), status === 'success' && (_jsx(data.default, { name: name, color: color, size: size, ariaLabel: ariaLabel, title: title
|
|
221
|
+
return (_jsxs(_Fragment, { children: [(status === 'loading' || status === 'error') && (_jsx(DelayedFallback, { "aria-label": `${name} ${ariaLabel}`, children: _jsx(Loader, { size: "base" }) })), status === 'success' && (_jsx(data.default, { name: name, color: color, size: size, ariaLabel: ariaLabel, title: title, ...rest }))] }));
|
|
221
222
|
}
|
|
222
223
|
function Icon({ withWrapper, ...props }) {
|
|
223
224
|
if (withWrapper) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
4
|
import { spacing } from '../../spacing';
|
|
5
5
|
import { DESCRIPTION_PREFIX, useFieldContext } from '../form/Form.component';
|
|
6
6
|
import { Icon } from '../icon/Icon.component';
|
|
@@ -57,12 +57,12 @@ const InputContainer = styled.div `
|
|
|
57
57
|
padding: 0 ${spacing.r8} 0 ${spacing.r8};
|
|
58
58
|
background: ${(props) => props.theme.backgroundLevel1};
|
|
59
59
|
border-radius: ${spacing.r4};
|
|
60
|
-
${(props) => props.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
${(props) => props.disabled
|
|
61
|
+
? css `
|
|
62
|
+
opacity: 0.5;
|
|
63
|
+
cursor: not-allowed;
|
|
64
|
+
`
|
|
65
|
+
: ''}
|
|
66
66
|
`;
|
|
67
67
|
const InputBorder = styled.div `
|
|
68
68
|
box-sizing: border-box;
|
package/package.json
CHANGED
|
@@ -40,10 +40,10 @@ export const ButtonStyled = styled.button<Props>`
|
|
|
40
40
|
text-decoration: none;
|
|
41
41
|
font-family: 'Lato';
|
|
42
42
|
font-weight: ${fontWeight.base};
|
|
43
|
-
|
|
44
43
|
padding: ${spacing.r4} ${spacing.r8};
|
|
45
44
|
font-size: ${fontSize.base};
|
|
46
45
|
border-radius: ${spacing.r4};
|
|
46
|
+
white-space: nowrap;
|
|
47
47
|
height: ${(props) => (props.size === 'inline' ? spacing.r24 : spacing.r32)};
|
|
48
48
|
${(props) => {
|
|
49
49
|
const brand = props.theme;
|
|
@@ -198,8 +198,8 @@ export const ButtonLoader = styled(Loader)<{ label; variant }>`
|
|
|
198
198
|
fill: ${props.variant === 'danger'
|
|
199
199
|
? props.theme.statusCritical
|
|
200
200
|
: props.variant === 'outline'
|
|
201
|
-
|
|
202
|
-
|
|
201
|
+
? props.theme.textPrimary
|
|
202
|
+
: props.theme.textSecondary};
|
|
203
203
|
}
|
|
204
204
|
`;
|
|
205
205
|
}}
|
|
@@ -137,6 +137,7 @@ export const iconTable = {
|
|
|
137
137
|
Ring: 'fas faRing',
|
|
138
138
|
Stop: 'fas faStop',
|
|
139
139
|
Play: 'fas faPlay',
|
|
140
|
+
Mail: 'fas faEnvelope',
|
|
140
141
|
};
|
|
141
142
|
|
|
142
143
|
export const customIcons = {
|
|
@@ -285,7 +286,7 @@ function NonWrappedIcon({
|
|
|
285
286
|
color={color}
|
|
286
287
|
size={size}
|
|
287
288
|
ariaLabel={ariaLabel}
|
|
288
|
-
title={title
|
|
289
|
+
title={title}
|
|
289
290
|
{...rest}
|
|
290
291
|
/>
|
|
291
292
|
)}
|
|
@@ -5,15 +5,15 @@ import { getWrapper } from '../../testUtils';
|
|
|
5
5
|
import userEvent from '@testing-library/user-event';
|
|
6
6
|
import { IconHelp } from './IconHelper';
|
|
7
7
|
|
|
8
|
-
describe('
|
|
8
|
+
describe('IconHelper', () => {
|
|
9
9
|
const selectors = {
|
|
10
|
-
icon: () => screen.getByRole('img'
|
|
10
|
+
icon: () => screen.getByRole('img'),
|
|
11
11
|
};
|
|
12
12
|
const renderIcon = (tooltipMessage: React.ReactNode) => {
|
|
13
13
|
const { Wrapper } = getWrapper();
|
|
14
14
|
render(
|
|
15
15
|
<Wrapper>
|
|
16
|
-
<IconHelp tooltipMessage={tooltipMessage} />
|
|
16
|
+
<IconHelp tooltipMessage={tooltipMessage} title="Info" />
|
|
17
17
|
</Wrapper>,
|
|
18
18
|
);
|
|
19
19
|
};
|
|
@@ -41,12 +41,12 @@ describe('Icon', () => {
|
|
|
41
41
|
<Wrapper>
|
|
42
42
|
<IconHelp
|
|
43
43
|
tooltipMessage={'This is a tooltip'}
|
|
44
|
-
title="Info Helper
|
|
44
|
+
title="Info Helper Testing"
|
|
45
45
|
/>
|
|
46
46
|
</Wrapper>,
|
|
47
47
|
);
|
|
48
48
|
await waitFor(() => {
|
|
49
|
-
expect(screen.getByLabelText('Info Helper
|
|
49
|
+
expect(screen.getByLabelText('Info Helper Testing')).toBeInTheDocument();
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
52
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { forwardRef, InputHTMLAttributes } from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
3
|
import { spacing } from '../../spacing';
|
|
4
4
|
import { DESCRIPTION_PREFIX, useFieldContext } from '../form/Form.component';
|
|
5
5
|
import { Icon, IconName } from '../icon/Icon.component';
|
|
@@ -62,12 +62,12 @@ const InputContainer = styled.div<{
|
|
|
62
62
|
background: ${(props) => props.theme.backgroundLevel1};
|
|
63
63
|
border-radius: ${spacing.r4};
|
|
64
64
|
${(props) =>
|
|
65
|
-
props.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
props.disabled
|
|
66
|
+
? css`
|
|
67
|
+
opacity: 0.5;
|
|
68
|
+
cursor: not-allowed;
|
|
69
|
+
`
|
|
70
|
+
: ''}
|
|
71
71
|
`;
|
|
72
72
|
|
|
73
73
|
const InputBorder = styled.div<{
|