@digigov/react-core 1.0.0-290a96e2 → 1.0.0-3bfc7d37
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/Blockquote/__snapshots__/index.test.tsx.snap +17 -0
- package/Blockquote/index.d.ts +8 -1
- package/Blockquote/index.js +3 -2
- package/Blockquote/index.test.js +8 -0
- package/Card/__snapshots__/index.test.tsx.snap +21 -0
- package/Card/index.d.ts +8 -1
- package/Card/index.js +3 -2
- package/Card/index.test.js +23 -15
- package/ImageLogo/__snapshots__/index.test.tsx.snap +36 -0
- package/ImageLogo/index.d.ts +20 -0
- package/ImageLogo/index.js +45 -0
- package/ImageLogo/index.test.d.ts +1 -0
- package/ImageLogo/index.test.js +26 -0
- package/ImageLogoSet/__snapshots__/index.test.tsx.snap +118 -0
- package/ImageLogoSet/index.d.ts +20 -0
- package/ImageLogoSet/index.js +45 -0
- package/ImageLogoSet/index.test.d.ts +1 -0
- package/ImageLogoSet/index.test.js +29 -0
- package/KitchenSinkCard/index.d.ts +1 -1
- package/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
- package/RadioItem/index.d.ts +4 -4
- package/RadioItem/index.js +3 -3
- package/RadioItem/index.test.js +4 -4
- package/StepNav/__snapshots__/index.test.tsx.snap +17 -0
- package/StepNav/index.d.ts +8 -1
- package/StepNav/index.js +3 -2
- package/StepNav/index.test.js +8 -0
- package/TaskList/__snapshots__/index.test.tsx.snap +17 -0
- package/TaskList/index.d.ts +8 -1
- package/TaskList/index.js +3 -2
- package/TaskList/index.test.js +8 -0
- package/Timeline/__snapshots__/index.test.tsx.snap +17 -0
- package/Timeline/index.d.ts +2 -2
- package/Timeline/index.js +2 -3
- package/Timeline/index.test.js +8 -0
- package/Unpurge/index.js +1 -1
- package/es/Blockquote/__snapshots__/index.test.tsx.snap +17 -0
- package/es/Blockquote/index.js +3 -2
- package/es/Blockquote/index.test.js +8 -0
- package/es/Card/__snapshots__/index.test.tsx.snap +21 -0
- package/es/Card/index.js +3 -2
- package/es/Card/index.test.js +23 -15
- package/es/ImageLogo/__snapshots__/index.test.tsx.snap +36 -0
- package/es/ImageLogo/index.js +29 -0
- package/es/ImageLogo/index.test.js +20 -0
- package/es/ImageLogoSet/__snapshots__/index.test.tsx.snap +118 -0
- package/es/ImageLogoSet/index.js +30 -0
- package/es/ImageLogoSet/index.test.js +23 -0
- package/es/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
- package/es/RadioItem/index.js +3 -3
- package/es/RadioItem/index.test.js +4 -4
- package/es/StepNav/__snapshots__/index.test.tsx.snap +17 -0
- package/es/StepNav/index.js +3 -2
- package/es/StepNav/index.test.js +8 -0
- package/es/TaskList/__snapshots__/index.test.tsx.snap +17 -0
- package/es/TaskList/index.js +3 -2
- package/es/TaskList/index.test.js +8 -0
- package/es/Timeline/__snapshots__/index.test.tsx.snap +17 -0
- package/es/Timeline/index.js +2 -3
- package/es/Timeline/index.test.js +8 -0
- package/es/Unpurge/index.js +1 -1
- package/es/index.js +2 -1
- package/es/registry.js +4 -0
- package/esm/Blockquote/__snapshots__/index.test.tsx.snap +17 -0
- package/esm/Blockquote/index.js +3 -2
- package/esm/Blockquote/index.test.js +8 -0
- package/esm/Card/__snapshots__/index.test.tsx.snap +21 -0
- package/esm/Card/index.js +3 -2
- package/esm/Card/index.test.js +23 -15
- package/esm/ImageLogo/__snapshots__/index.test.tsx.snap +36 -0
- package/esm/ImageLogo/index.js +29 -0
- package/esm/ImageLogo/index.test.js +20 -0
- package/esm/ImageLogoSet/__snapshots__/index.test.tsx.snap +118 -0
- package/esm/ImageLogoSet/index.js +30 -0
- package/esm/ImageLogoSet/index.test.js +23 -0
- package/esm/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
- package/esm/RadioItem/index.js +3 -3
- package/esm/RadioItem/index.test.js +4 -4
- package/esm/StepNav/__snapshots__/index.test.tsx.snap +17 -0
- package/esm/StepNav/index.js +3 -2
- package/esm/StepNav/index.test.js +8 -0
- package/esm/TaskList/__snapshots__/index.test.tsx.snap +17 -0
- package/esm/TaskList/index.js +3 -2
- package/esm/TaskList/index.test.js +8 -0
- package/esm/Timeline/__snapshots__/index.test.tsx.snap +17 -0
- package/esm/Timeline/index.js +2 -3
- package/esm/Timeline/index.test.js +8 -0
- package/esm/Unpurge/index.js +1 -1
- package/esm/index.js +3 -2
- package/esm/registry.js +4 -0
- package/index.d.ts +2 -1
- package/index.js +17 -4
- package/package.json +3 -3
- package/registry.d.ts +2 -0
- package/registry.js +6 -0
- package/src/Blockquote/__snapshots__/index.test.tsx.snap +17 -0
- package/src/Blockquote/index.test.tsx +4 -0
- package/src/Blockquote/index.tsx +11 -2
- package/src/Card/__snapshots__/index.test.tsx.snap +21 -0
- package/src/Card/index.test.tsx +3 -0
- package/src/Card/index.tsx +9 -1
- package/src/ImageLogo/__snapshots__/index.test.tsx.snap +36 -0
- package/src/ImageLogo/index.test.tsx +13 -0
- package/src/ImageLogo/index.tsx +43 -0
- package/src/ImageLogoSet/__snapshots__/index.test.tsx.snap +118 -0
- package/src/ImageLogoSet/index.test.tsx +17 -0
- package/src/ImageLogoSet/index.tsx +36 -0
- package/src/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
- package/src/RadioItem/index.test.tsx +4 -4
- package/src/RadioItem/index.tsx +5 -5
- package/src/StepNav/__snapshots__/index.test.tsx.snap +17 -0
- package/src/StepNav/index.test.tsx +4 -0
- package/src/StepNav/index.tsx +11 -2
- package/src/TaskList/__snapshots__/index.test.tsx.snap +17 -0
- package/src/TaskList/index.test.tsx +4 -0
- package/src/TaskList/index.tsx +11 -2
- package/src/Timeline/__snapshots__/index.test.tsx.snap +17 -0
- package/src/Timeline/index.test.tsx +4 -0
- package/src/Timeline/index.tsx +4 -4
- package/src/Unpurge/index.tsx +2 -0
- package/src/index.ts +2 -1
- package/src/registry.js +4 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`renders the Hint with variants=[light, dark] and src props 1`] = `
|
|
4
|
+
<ForwardRef(ImageLogoSet)
|
|
5
|
+
src="logo.png"
|
|
6
|
+
variants={
|
|
7
|
+
Array [
|
|
8
|
+
"light",
|
|
9
|
+
"dark",
|
|
10
|
+
]
|
|
11
|
+
}
|
|
12
|
+
>
|
|
13
|
+
<ForwardRef(ImageLogo)
|
|
14
|
+
key="light"
|
|
15
|
+
src="logo--light.png"
|
|
16
|
+
variant="light"
|
|
17
|
+
>
|
|
18
|
+
<ForwardRef(Base)
|
|
19
|
+
as="img"
|
|
20
|
+
className="govgr-image-logo--light"
|
|
21
|
+
printHidden={true}
|
|
22
|
+
src="logo--light.png"
|
|
23
|
+
>
|
|
24
|
+
<img
|
|
25
|
+
className="govgr-image-logo--light govgr-print-hidden"
|
|
26
|
+
src="logo--light.png"
|
|
27
|
+
/>
|
|
28
|
+
</ForwardRef(Base)>
|
|
29
|
+
</ForwardRef(ImageLogo)>
|
|
30
|
+
<ForwardRef(ImageLogo)
|
|
31
|
+
key="dark"
|
|
32
|
+
src="logo--dark.png"
|
|
33
|
+
variant="dark"
|
|
34
|
+
>
|
|
35
|
+
<ForwardRef(Base)
|
|
36
|
+
as="img"
|
|
37
|
+
className="govgr-image-logo--dark"
|
|
38
|
+
printHidden={true}
|
|
39
|
+
src="logo--dark.png"
|
|
40
|
+
>
|
|
41
|
+
<img
|
|
42
|
+
className="govgr-image-logo--dark govgr-print-hidden"
|
|
43
|
+
src="logo--dark.png"
|
|
44
|
+
/>
|
|
45
|
+
</ForwardRef(Base)>
|
|
46
|
+
</ForwardRef(ImageLogo)>
|
|
47
|
+
</ForwardRef(ImageLogoSet)>
|
|
48
|
+
`;
|
|
49
|
+
|
|
50
|
+
exports[`renders the Hint with variants=[light] and src props 1`] = `
|
|
51
|
+
<ForwardRef(ImageLogoSet)
|
|
52
|
+
src="logo.png"
|
|
53
|
+
variants={
|
|
54
|
+
Array [
|
|
55
|
+
"light",
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
>
|
|
59
|
+
<ForwardRef(ImageLogo)
|
|
60
|
+
key="light"
|
|
61
|
+
src="logo--light.png"
|
|
62
|
+
variant="light"
|
|
63
|
+
>
|
|
64
|
+
<ForwardRef(Base)
|
|
65
|
+
as="img"
|
|
66
|
+
className="govgr-image-logo--light"
|
|
67
|
+
printHidden={true}
|
|
68
|
+
src="logo--light.png"
|
|
69
|
+
>
|
|
70
|
+
<img
|
|
71
|
+
className="govgr-image-logo--light govgr-print-hidden"
|
|
72
|
+
src="logo--light.png"
|
|
73
|
+
/>
|
|
74
|
+
</ForwardRef(Base)>
|
|
75
|
+
</ForwardRef(ImageLogo)>
|
|
76
|
+
</ForwardRef(ImageLogoSet)>
|
|
77
|
+
`;
|
|
78
|
+
|
|
79
|
+
exports[`renders the Hint with src prop 1`] = `
|
|
80
|
+
<ForwardRef(ImageLogoSet)
|
|
81
|
+
src="logo.png"
|
|
82
|
+
>
|
|
83
|
+
<ForwardRef(ImageLogo)
|
|
84
|
+
key="dark"
|
|
85
|
+
src="logo--dark.png"
|
|
86
|
+
variant="dark"
|
|
87
|
+
>
|
|
88
|
+
<ForwardRef(Base)
|
|
89
|
+
as="img"
|
|
90
|
+
className="govgr-image-logo--dark"
|
|
91
|
+
printHidden={true}
|
|
92
|
+
src="logo--dark.png"
|
|
93
|
+
>
|
|
94
|
+
<img
|
|
95
|
+
className="govgr-image-logo--dark govgr-print-hidden"
|
|
96
|
+
src="logo--dark.png"
|
|
97
|
+
/>
|
|
98
|
+
</ForwardRef(Base)>
|
|
99
|
+
</ForwardRef(ImageLogo)>
|
|
100
|
+
<ForwardRef(ImageLogo)
|
|
101
|
+
key="light"
|
|
102
|
+
src="logo--light.png"
|
|
103
|
+
variant="light"
|
|
104
|
+
>
|
|
105
|
+
<ForwardRef(Base)
|
|
106
|
+
as="img"
|
|
107
|
+
className="govgr-image-logo--light"
|
|
108
|
+
printHidden={true}
|
|
109
|
+
src="logo--light.png"
|
|
110
|
+
>
|
|
111
|
+
<img
|
|
112
|
+
className="govgr-image-logo--light govgr-print-hidden"
|
|
113
|
+
src="logo--light.png"
|
|
114
|
+
/>
|
|
115
|
+
</ForwardRef(Base)>
|
|
116
|
+
</ForwardRef(ImageLogo)>
|
|
117
|
+
</ForwardRef(ImageLogoSet)>
|
|
118
|
+
`;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mount } from 'enzyme';
|
|
3
|
+
|
|
4
|
+
import ImageLogoSet from '@digigov/react-core/ImageLogoSet';
|
|
5
|
+
|
|
6
|
+
it('renders the Hint with src prop', () => {
|
|
7
|
+
expect(mount(<ImageLogoSet src='logo.png' />)).toMatchSnapshot();
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
it('renders the Hint with variants=[light] and src props', () => {
|
|
12
|
+
expect(mount(<ImageLogoSet variants={['light']} src='logo.png' />)).toMatchSnapshot();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('renders the Hint with variants=[light, dark] and src props', () => {
|
|
16
|
+
expect(mount(<ImageLogoSet variants={['light', 'dark']} src='logo.png' />)).toMatchSnapshot();
|
|
17
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BaseProps } from '@digigov/react-core/Base';
|
|
3
|
+
import ImageLogo from '@digigov/react-core/ImageLogo';
|
|
4
|
+
|
|
5
|
+
export interface ImageLogoSet extends BaseProps<'img'> {
|
|
6
|
+
/**
|
|
7
|
+
* src is optional.
|
|
8
|
+
* src is used to display images.
|
|
9
|
+
*/
|
|
10
|
+
src?: string;
|
|
11
|
+
/**
|
|
12
|
+
* variant is optional.
|
|
13
|
+
* variant is used to display images depending the theme (dark, light).
|
|
14
|
+
*/
|
|
15
|
+
variants?: Array<"dark" | "light">;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* ImageLogoSet is used as image inverter depending the theme (dark, light).
|
|
19
|
+
* This component can't have children.
|
|
20
|
+
*/
|
|
21
|
+
export const ImageLogoSet = React.forwardRef<
|
|
22
|
+
HTMLImageElement,
|
|
23
|
+
ImageLogoSet
|
|
24
|
+
>(function ImageLogoSet({ lang, src, variants = ['dark', 'light'], className, children, ...props }, ref) {
|
|
25
|
+
return (
|
|
26
|
+
<>
|
|
27
|
+
{variants.map((variant) => {
|
|
28
|
+
const imageSrc = src?.replace(/(\.[^\.]+)$/, `--${variant}$1`);
|
|
29
|
+
return <ImageLogo key={variant} ref={ref} variant={variant} src={imageSrc} {...props} />
|
|
30
|
+
})}
|
|
31
|
+
</>
|
|
32
|
+
)
|
|
33
|
+
;
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export default ImageLogoSet;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`renders the RadioItem \`divider\` props 1`] = `
|
|
4
4
|
<ForwardRef(RadioItem)
|
|
5
|
-
|
|
5
|
+
dividerText="ή"
|
|
6
6
|
>
|
|
7
7
|
<ForwardRef(ChoiceDividerText)>
|
|
8
8
|
<ForwardRef(Base)
|
|
@@ -91,7 +91,7 @@ exports[`renders the RadioItem value props 1`] = `
|
|
|
91
91
|
exports[`renders the RadioItem with \`name\`, \`disabled\`, \`divider\` and \`value\` props 1`] = `
|
|
92
92
|
<ForwardRef(RadioItem)
|
|
93
93
|
disabled={true}
|
|
94
|
-
|
|
94
|
+
dividerText="ή"
|
|
95
95
|
name="name"
|
|
96
96
|
value="someValue"
|
|
97
97
|
>
|
|
@@ -17,8 +17,8 @@ it('renders the RadioItem value props', () => {
|
|
|
17
17
|
).toMatchSnapshot();
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
it('renders the RadioItem `
|
|
21
|
-
expect(mount(<RadioItem
|
|
20
|
+
it('renders the RadioItem `dividerText` props', () => {
|
|
21
|
+
expect(mount(<RadioItem dividerText={'ή'}>hello</RadioItem>)).toMatchSnapshot();
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
it('renders the RadioItem with name and value props', () => {
|
|
@@ -45,10 +45,10 @@ it('renders the RadioItem with name disabled and value props', () => {
|
|
|
45
45
|
).toMatchSnapshot();
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
it('renders the RadioItem with `name`, `disabled`, `
|
|
48
|
+
it('renders the RadioItem with `name`, `disabled`, `dividerText` and `value` props', () => {
|
|
49
49
|
expect(
|
|
50
50
|
mount(
|
|
51
|
-
<RadioItem name={'name'} value={'someValue'}
|
|
51
|
+
<RadioItem name={'name'} value={'someValue'} dividerText={'ή'} disabled>
|
|
52
52
|
hello
|
|
53
53
|
</RadioItem>
|
|
54
54
|
)
|
package/src/RadioItem/index.tsx
CHANGED
|
@@ -6,11 +6,11 @@ import LabelContainer from '@digigov/react-core/LabelContainer';
|
|
|
6
6
|
|
|
7
7
|
export interface RadioItemProps extends BaseProps<'input'> {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
* Add this prop to add a choice
|
|
9
|
+
* dividerText is optional.
|
|
10
|
+
* Add this prop to add a choice dividerText on top of a radio item.
|
|
11
11
|
* The string is the text that it will appear above this radio item.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
dividerText?: string;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* RadioItem component is used for display radio buttons.
|
|
@@ -18,11 +18,11 @@ export interface RadioItemProps extends BaseProps<'input'> {
|
|
|
18
18
|
*/
|
|
19
19
|
export const RadioItem = React.forwardRef<HTMLInputElement, RadioItemProps>(
|
|
20
20
|
function RadioItem(
|
|
21
|
-
{
|
|
21
|
+
{ dividerText, name, value, className, disabled = false, children, ...props },
|
|
22
22
|
ref
|
|
23
23
|
) {
|
|
24
24
|
return <>
|
|
25
|
-
{
|
|
25
|
+
{dividerText && <ChoiceDividerText>{dividerText}</ChoiceDividerText>}
|
|
26
26
|
<div
|
|
27
27
|
className={clsx(className, {
|
|
28
28
|
'govgr-radios__item': true,
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`renders the StepNav with dense props 1`] = `
|
|
4
|
+
<ForwardRef(StepNav)
|
|
5
|
+
dense={true}
|
|
6
|
+
>
|
|
7
|
+
<ForwardRef(Base)
|
|
8
|
+
as="div"
|
|
9
|
+
className="govgr-step--dense govgr-step-nav"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
className="govgr-step--dense govgr-step-nav"
|
|
13
|
+
>
|
|
14
|
+
hello
|
|
15
|
+
</div>
|
|
16
|
+
</ForwardRef(Base)>
|
|
17
|
+
</ForwardRef(StepNav)>
|
|
18
|
+
`;
|
|
19
|
+
|
|
3
20
|
exports[`renders the StepNav with no props 1`] = `
|
|
4
21
|
<ForwardRef(StepNav)>
|
|
5
22
|
<ForwardRef(Base)
|
|
@@ -6,3 +6,7 @@ import StepNav from '@digigov/react-core/StepNav';
|
|
|
6
6
|
it('renders the StepNav with no props', () => {
|
|
7
7
|
expect(mount(<StepNav>hello</StepNav>)).toMatchSnapshot();
|
|
8
8
|
});
|
|
9
|
+
|
|
10
|
+
it('renders the StepNav with dense props', () => {
|
|
11
|
+
expect(mount(<StepNav dense>hello</StepNav>)).toMatchSnapshot();
|
|
12
|
+
});
|
package/src/StepNav/index.tsx
CHANGED
|
@@ -2,19 +2,28 @@ import React from 'react';
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
4
4
|
|
|
5
|
-
export interface StepNavProps extends BaseProps<'div'> {
|
|
5
|
+
export interface StepNavProps extends BaseProps<'div'> {
|
|
6
|
+
/**
|
|
7
|
+
* dense is optional.
|
|
8
|
+
* @value true StepNav will be dense.
|
|
9
|
+
* @value false
|
|
10
|
+
* @default false
|
|
11
|
+
* */
|
|
12
|
+
dense?: boolean;
|
|
13
|
+
}
|
|
6
14
|
/**
|
|
7
15
|
* StepNav contains the content or any other element for step-by-step implementation.
|
|
8
16
|
* Use StepNav as wrapper component.
|
|
9
17
|
*/
|
|
10
18
|
export const StepNav = React.forwardRef<HTMLDivElement, StepNavProps>(
|
|
11
|
-
function StepNav({ className, children, ...props }, ref) {
|
|
19
|
+
function StepNav({ className, dense, children, ...props }, ref) {
|
|
12
20
|
return (
|
|
13
21
|
<Base
|
|
14
22
|
as="div"
|
|
15
23
|
ref={ref}
|
|
16
24
|
className={clsx(className, {
|
|
17
25
|
'govgr-step-nav': true,
|
|
26
|
+
'govgr-step-nav--dense': dense,
|
|
18
27
|
})}
|
|
19
28
|
{...props}
|
|
20
29
|
>
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`renders the TaskList with dense prop 1`] = `
|
|
4
|
+
<ForwardRef(TaskList)
|
|
5
|
+
dense={true}
|
|
6
|
+
>
|
|
7
|
+
<ForwardRef(Base)
|
|
8
|
+
as="ol"
|
|
9
|
+
className="govgr-task--dense govgr-task-list"
|
|
10
|
+
>
|
|
11
|
+
<ol
|
|
12
|
+
className="govgr-task--dense govgr-task-list"
|
|
13
|
+
>
|
|
14
|
+
hello
|
|
15
|
+
</ol>
|
|
16
|
+
</ForwardRef(Base)>
|
|
17
|
+
</ForwardRef(TaskList)>
|
|
18
|
+
`;
|
|
19
|
+
|
|
3
20
|
exports[`renders the TaskList with no prop 1`] = `
|
|
4
21
|
<ForwardRef(TaskList)>
|
|
5
22
|
<ForwardRef(Base)
|
|
@@ -6,3 +6,7 @@ import TaskList from '@digigov/react-core/TaskList';
|
|
|
6
6
|
it('renders the TaskList with no prop', () => {
|
|
7
7
|
expect(mount(<TaskList>hello</TaskList>)).toMatchSnapshot();
|
|
8
8
|
});
|
|
9
|
+
|
|
10
|
+
it('renders the TaskList with dense prop', () => {
|
|
11
|
+
expect(mount(<TaskList dense>hello</TaskList>)).toMatchSnapshot();
|
|
12
|
+
});
|
package/src/TaskList/index.tsx
CHANGED
|
@@ -2,19 +2,28 @@ import React from 'react';
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
4
4
|
|
|
5
|
-
export interface TaskListProps extends BaseProps<'ol'> {
|
|
5
|
+
export interface TaskListProps extends BaseProps<'ol'> {
|
|
6
|
+
/**
|
|
7
|
+
* dense is optional.
|
|
8
|
+
* @value true TaskList will be dense.
|
|
9
|
+
* @value false
|
|
10
|
+
* @default false
|
|
11
|
+
* */
|
|
12
|
+
dense?: boolean;
|
|
13
|
+
}
|
|
6
14
|
/**
|
|
7
15
|
* TaskList component is used for listing items.
|
|
8
16
|
* This component must contain TaskListItem component.
|
|
9
17
|
*/
|
|
10
18
|
export const TaskList = React.forwardRef<HTMLOListElement, TaskListProps>(
|
|
11
|
-
function TaskList({ className, children, ...props }, ref) {
|
|
19
|
+
function TaskList({ className, dense, children, ...props }, ref) {
|
|
12
20
|
return (
|
|
13
21
|
<Base
|
|
14
22
|
as="ol"
|
|
15
23
|
ref={ref}
|
|
16
24
|
className={clsx(className, {
|
|
17
25
|
'govgr-task-list': true,
|
|
26
|
+
'govgr-task-list--dense': dense,
|
|
18
27
|
})}
|
|
19
28
|
{...props}
|
|
20
29
|
>
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`renders the Timeline with dense prop 1`] = `
|
|
4
|
+
<ForwardRef(Timeline)
|
|
5
|
+
dense={true}
|
|
6
|
+
>
|
|
7
|
+
<ForwardRef(Base)
|
|
8
|
+
as="ol"
|
|
9
|
+
className="govgr-timeline--dense govgr-timeline"
|
|
10
|
+
>
|
|
11
|
+
<ol
|
|
12
|
+
className="govgr-timeline--dense govgr-timeline"
|
|
13
|
+
>
|
|
14
|
+
hello
|
|
15
|
+
</ol>
|
|
16
|
+
</ForwardRef(Base)>
|
|
17
|
+
</ForwardRef(Timeline)>
|
|
18
|
+
`;
|
|
19
|
+
|
|
3
20
|
exports[`renders the Timeline with no prop 1`] = `
|
|
4
21
|
<ForwardRef(Timeline)>
|
|
5
22
|
<ForwardRef(Base)
|
|
@@ -6,3 +6,7 @@ import Timeline from '@digigov/react-core/Timeline';
|
|
|
6
6
|
it('renders the Timeline with no prop', () => {
|
|
7
7
|
expect(mount(<Timeline>hello</Timeline>)).toMatchSnapshot();
|
|
8
8
|
});
|
|
9
|
+
|
|
10
|
+
it('renders the Timeline with dense prop', () => {
|
|
11
|
+
expect(mount(<Timeline dense>hello</Timeline>)).toMatchSnapshot();
|
|
12
|
+
});
|
package/src/Timeline/index.tsx
CHANGED
|
@@ -4,8 +4,8 @@ import Base, { BaseProps } from '@digigov/react-core/Base';
|
|
|
4
4
|
|
|
5
5
|
export interface TimelineProps extends BaseProps<'ol'> {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
* @value true
|
|
7
|
+
* dense is optional.
|
|
8
|
+
* @value true Timeline will be dense.
|
|
9
9
|
* @value false
|
|
10
10
|
* @default true
|
|
11
11
|
*/
|
|
@@ -16,14 +16,14 @@ export interface TimelineProps extends BaseProps<'ol'> {
|
|
|
16
16
|
* This component must contain TimelineItem component.
|
|
17
17
|
*/
|
|
18
18
|
export const Timeline = React.forwardRef<HTMLOListElement, TimelineProps>(
|
|
19
|
-
function Timeline({ dense
|
|
19
|
+
function Timeline({ dense, className, children, ...props }, ref) {
|
|
20
20
|
return (
|
|
21
21
|
<Base
|
|
22
22
|
as="ol"
|
|
23
23
|
ref={ref}
|
|
24
24
|
className={clsx(className, {
|
|
25
25
|
'govgr-timeline': true,
|
|
26
|
-
'govgr-timeline--
|
|
26
|
+
'govgr-timeline--dense': dense,
|
|
27
27
|
})}
|
|
28
28
|
{...props}
|
|
29
29
|
>
|
package/src/Unpurge/index.tsx
CHANGED
package/src/index.ts
CHANGED
|
@@ -117,7 +117,8 @@ export * from '@digigov/react-core/SummaryListItemAction';
|
|
|
117
117
|
export * from '@digigov/react-core/SummaryListItemKey';
|
|
118
118
|
export * from '@digigov/react-core/SummaryListItemValue';
|
|
119
119
|
export * from '@digigov/react-core/SvgIcon';
|
|
120
|
-
export * from '@digigov/react-
|
|
120
|
+
export * from '@digigov/react-core/ImageLogo';
|
|
121
|
+
export * from '@digigov/react-core/ImageLogoSet';
|
|
121
122
|
export * from '@digigov/react-core/Table';
|
|
122
123
|
export * from '@digigov/react-core/TableBody';
|
|
123
124
|
export * from '@digigov/react-core/TableCaption';
|
package/src/registry.js
CHANGED
|
@@ -122,6 +122,8 @@ import * as _digigov_react_core_HellenicRepublicLogo_logo_inverted_el from '@dig
|
|
|
122
122
|
import * as _digigov_react_core_HellenicRepublicLogo_logo_inverted_en from '@digigov/react-core/HellenicRepublicLogo/logo-inverted-en';
|
|
123
123
|
import * as _digigov_react_core_Hidden from '@digigov/react-core/Hidden';
|
|
124
124
|
import * as _digigov_react_core_Hint from '@digigov/react-core/Hint';
|
|
125
|
+
import * as _digigov_react_core_ImageLogo from '@digigov/react-core/ImageLogo';
|
|
126
|
+
import * as _digigov_react_core_ImageLogoSet from '@digigov/react-core/ImageLogoSet';
|
|
125
127
|
import * as _digigov_react_core from '@digigov/react-core';
|
|
126
128
|
import * as _digigov_react_core_KitchenSinkAllComponents from '@digigov/react-core/KitchenSinkAllComponents';
|
|
127
129
|
import * as _digigov_react_core_KitchenSinkCard from '@digigov/react-core/KitchenSinkCard';
|
|
@@ -388,6 +390,8 @@ export default {
|
|
|
388
390
|
'@digigov/react-core/HellenicRepublicLogo/logo-inverted-en': lazyImport(_digigov_react_core_HellenicRepublicLogo_logo_inverted_en),
|
|
389
391
|
'@digigov/react-core/Hidden': lazyImport(_digigov_react_core_Hidden),
|
|
390
392
|
'@digigov/react-core/Hint': lazyImport(_digigov_react_core_Hint),
|
|
393
|
+
'@digigov/react-core/ImageLogo': lazyImport(_digigov_react_core_ImageLogo),
|
|
394
|
+
'@digigov/react-core/ImageLogoSet': lazyImport(_digigov_react_core_ImageLogoSet),
|
|
391
395
|
'@digigov/react-core': lazyImport(_digigov_react_core),
|
|
392
396
|
'@digigov/react-core/KitchenSinkAllComponents': lazyImport(_digigov_react_core_KitchenSinkAllComponents),
|
|
393
397
|
'@digigov/react-core/KitchenSinkCard': lazyImport(_digigov_react_core_KitchenSinkCard),
|