@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.
Files changed (82) hide show
  1. package/Blockquote/__snapshots__/index.test.tsx.snap +17 -0
  2. package/Blockquote/index.d.ts +8 -1
  3. package/Blockquote/index.js +3 -2
  4. package/Blockquote/index.test.js +8 -0
  5. package/Card/__snapshots__/index.test.tsx.snap +21 -0
  6. package/Card/index.d.ts +8 -1
  7. package/Card/index.js +3 -2
  8. package/Card/index.test.js +23 -15
  9. package/KitchenSinkCard/index.d.ts +1 -1
  10. package/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
  11. package/RadioItem/index.d.ts +4 -4
  12. package/RadioItem/index.js +3 -3
  13. package/RadioItem/index.test.js +4 -4
  14. package/StepNav/__snapshots__/index.test.tsx.snap +17 -0
  15. package/StepNav/index.d.ts +8 -1
  16. package/StepNav/index.js +3 -2
  17. package/StepNav/index.test.js +8 -0
  18. package/TaskList/__snapshots__/index.test.tsx.snap +17 -0
  19. package/TaskList/index.d.ts +8 -1
  20. package/TaskList/index.js +3 -2
  21. package/TaskList/index.test.js +8 -0
  22. package/Timeline/__snapshots__/index.test.tsx.snap +17 -0
  23. package/Timeline/index.d.ts +2 -2
  24. package/Timeline/index.js +2 -3
  25. package/Timeline/index.test.js +8 -0
  26. package/es/Blockquote/__snapshots__/index.test.tsx.snap +17 -0
  27. package/es/Blockquote/index.js +3 -2
  28. package/es/Blockquote/index.test.js +8 -0
  29. package/es/Card/__snapshots__/index.test.tsx.snap +21 -0
  30. package/es/Card/index.js +3 -2
  31. package/es/Card/index.test.js +23 -15
  32. package/es/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
  33. package/es/RadioItem/index.js +3 -3
  34. package/es/RadioItem/index.test.js +4 -4
  35. package/es/StepNav/__snapshots__/index.test.tsx.snap +17 -0
  36. package/es/StepNav/index.js +3 -2
  37. package/es/StepNav/index.test.js +8 -0
  38. package/es/TaskList/__snapshots__/index.test.tsx.snap +17 -0
  39. package/es/TaskList/index.js +3 -2
  40. package/es/TaskList/index.test.js +8 -0
  41. package/es/Timeline/__snapshots__/index.test.tsx.snap +17 -0
  42. package/es/Timeline/index.js +2 -3
  43. package/es/Timeline/index.test.js +8 -0
  44. package/esm/Blockquote/__snapshots__/index.test.tsx.snap +17 -0
  45. package/esm/Blockquote/index.js +3 -2
  46. package/esm/Blockquote/index.test.js +8 -0
  47. package/esm/Card/__snapshots__/index.test.tsx.snap +21 -0
  48. package/esm/Card/index.js +3 -2
  49. package/esm/Card/index.test.js +23 -15
  50. package/esm/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
  51. package/esm/RadioItem/index.js +3 -3
  52. package/esm/RadioItem/index.test.js +4 -4
  53. package/esm/StepNav/__snapshots__/index.test.tsx.snap +17 -0
  54. package/esm/StepNav/index.js +3 -2
  55. package/esm/StepNav/index.test.js +8 -0
  56. package/esm/TaskList/__snapshots__/index.test.tsx.snap +17 -0
  57. package/esm/TaskList/index.js +3 -2
  58. package/esm/TaskList/index.test.js +8 -0
  59. package/esm/Timeline/__snapshots__/index.test.tsx.snap +17 -0
  60. package/esm/Timeline/index.js +2 -3
  61. package/esm/Timeline/index.test.js +8 -0
  62. package/esm/index.js +1 -1
  63. package/package.json +3 -3
  64. package/src/Blockquote/__snapshots__/index.test.tsx.snap +17 -0
  65. package/src/Blockquote/index.test.tsx +4 -0
  66. package/src/Blockquote/index.tsx +11 -2
  67. package/src/Card/__snapshots__/index.test.tsx.snap +21 -0
  68. package/src/Card/index.test.tsx +3 -0
  69. package/src/Card/index.tsx +9 -1
  70. package/src/RadioItem/__snapshots__/index.test.tsx.snap +2 -2
  71. package/src/RadioItem/index.test.tsx +4 -4
  72. package/src/RadioItem/index.tsx +5 -5
  73. package/src/StepNav/__snapshots__/index.test.tsx.snap +17 -0
  74. package/src/StepNav/index.test.tsx +4 -0
  75. package/src/StepNav/index.tsx +11 -2
  76. package/src/TaskList/__snapshots__/index.test.tsx.snap +17 -0
  77. package/src/TaskList/index.test.tsx +4 -0
  78. package/src/TaskList/index.tsx +11 -2
  79. package/src/Timeline/__snapshots__/index.test.tsx.snap +17 -0
  80. package/src/Timeline/index.test.tsx +4 -0
  81. package/src/Timeline/index.tsx +4 -4
  82. 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 `divider` props', () => {
21
- expect(mount(<RadioItem divider={'ή'}>hello</RadioItem>)).toMatchSnapshot();
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`, `divider` and `value` props', () => {
48
+ it('renders the RadioItem with `name`, `disabled`, `dividerText` and `value` props', () => {
49
49
  expect(
50
50
  mount(
51
- <RadioItem name={'name'} value={'someValue'} divider={'ή'} disabled>
51
+ <RadioItem name={'name'} value={'someValue'} dividerText={'ή'} disabled>
52
52
  hello
53
53
  </RadioItem>
54
54
  )
@@ -6,11 +6,11 @@ import LabelContainer from '@digigov/react-core/LabelContainer';
6
6
 
7
7
  export interface RadioItemProps extends BaseProps<'input'> {
8
8
  /**
9
- * divider is optional.
10
- * Add this prop to add a choice divider ontop of a radio item.
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
- divider?: string;
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
- { divider, name, value, className, disabled = false, children, ...props },
21
+ { dividerText, name, value, className, disabled = false, children, ...props },
22
22
  ref
23
23
  ) {
24
24
  return <>
25
- {divider && <ChoiceDividerText>{divider}</ChoiceDividerText>}
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
+ });
@@ -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
+ });
@@ -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
+ });
@@ -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
- * spaced is optional. Use it to add space between the list items.
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 = true, className, children, ...props }, ref) {
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--spaced': !dense,
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
+