@digigov/react-core 1.0.0-266e80f3 → 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/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/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/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/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/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/index.js +1 -1
- package/package.json +3 -3
- 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/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/registry.js +2 -1
|
@@ -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/registry.js
CHANGED
|
@@ -255,7 +255,7 @@ function lazyImport(pkgImport) {
|
|
|
255
255
|
get: (_target, name) => {
|
|
256
256
|
if (name === '__esModule' || name === 'default') {
|
|
257
257
|
return pkgImport.default;
|
|
258
|
-
} else if
|
|
258
|
+
} else if(
|
|
259
259
|
name === '*'
|
|
260
260
|
) {
|
|
261
261
|
return pkgImport;
|
|
@@ -516,3 +516,4 @@ export default {
|
|
|
516
516
|
'@digigov/react-core/VisuallyHidden': lazyImport(_digigov_react_core_VisuallyHidden),
|
|
517
517
|
'@digigov/react-core/WarningText': lazyImport(_digigov_react_core_WarningText)
|
|
518
518
|
};
|
|
519
|
+
|